From 2db2b811d349b3a2a79b14681f9ffe5aff930870 Mon Sep 17 00:00:00 2001 From: luzhengwang Date: Thu, 18 Jan 2024 15:47:11 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/vm/html/list.html.vm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/resources/vm/html/list.html.vm b/src/main/resources/vm/html/list.html.vm index 670fe2e1..6a3dbe67 100644 --- a/src/main/resources/vm/html/list.html.vm +++ b/src/main/resources/vm/html/list.html.vm @@ -83,10 +83,11 @@ #end - - + +
+
+
+ view +
+
+
+
+
+
+
+
+
+
html
+
+ +
+
+
+
code
+
+ +
+
+
+ + + + + + diff --git a/src/main/resources/static/component/layui/css/layui.css b/src/main/resources/static/component/layui/css/layui.css index a537eabf..d3ff80c8 100644 --- a/src/main/resources/static/component/layui/css/layui.css +++ b/src/main/resources/static/component/layui/css/layui.css @@ -1 +1 @@ -blockquote,body,button,dd,div,dl,dt,form,h1,h2,h3,h4,h5,h6,input,li,ol,p,pre,td,textarea,th,ul{margin:0;padding:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}a:active,a:hover{outline:0}img{display:inline-block;border:none;vertical-align:middle}li{list-style:none}table{border-collapse:collapse;border-spacing:0}h1,h2,h3{font-weight:400}h4,h5,h6{font-size:100%;font-weight:400}button,input,select,textarea{font-size:100%}button,input,optgroup,option,select,textarea{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;outline:0}pre{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}body{line-height:1.6;color:#333;color:rgba(0,0,0,.85);font:14px Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif}hr{height:0;line-height:0;margin:10px 0;padding:0;border:none!important;border-bottom:1px solid #eee!important;clear:both;overflow:hidden;background:0 0}a{color:#333;text-decoration:none}a:hover{color:#777}a cite{font-style:normal;*cursor:pointer}.layui-border-box,.layui-border-box *{box-sizing:border-box}.layui-box,.layui-box *{box-sizing:content-box}.layui-clear{clear:both;*zoom:1}.layui-clear:after{content:'\20';clear:both;*zoom:1;display:block;height:0}.layui-inline{position:relative;display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.layui-edge{position:relative;display:inline-block;vertical-align:middle;width:0;height:0;border-width:6px;border-style:dashed;border-color:transparent;overflow:hidden}.layui-edge-top{top:-4px;border-bottom-color:#999;border-bottom-style:solid}.layui-edge-right{border-left-color:#999;border-left-style:solid}.layui-edge-bottom{top:2px;border-top-color:#999;border-top-style:solid}.layui-edge-left{border-right-color:#999;border-right-style:solid}.layui-elip{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-disabled,.layui-icon,.layui-unselect{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-disabled,.layui-disabled:hover{color:#d2d2d2!important;cursor:not-allowed!important}.layui-circle{border-radius:100%}.layui-show{display:block!important}.layui-hide{display:none!important}.layui-show-v{visibility:visible!important}.layui-hide-v{visibility:hidden!important}@font-face{font-family:layui-icon;src:url(../font/iconfont.eot?v=256);src:url(../font/iconfont.eot?v=256#iefix) format('embedded-opentype'),url(../font/iconfont.woff2?v=256) format('woff2'),url(../font/iconfont.woff?v=256) format('woff'),url(../font/iconfont.ttf?v=256) format('truetype'),url(../font/iconfont.svg?v=256#layui-icon) format('svg')}.layui-icon{font-family:layui-icon!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.layui-icon-eye:before{content:"\e695"}.layui-icon-eye-invisible:before{content:"\e696"}.layui-icon-backspace:before{content:"\e694"}.layui-icon-help-circle:before{content:"\e77c"}.layui-icon-tips-fill:before{content:"\eb2e"}.layui-icon-test:before{content:"\e692"}.layui-icon-clear:before{content:"\e788"}.layui-icon-heart-fill:before{content:"\e68f"}.layui-icon-light:before{content:"\e748"}.layui-icon-music:before{content:"\e690"}.layui-icon-time:before{content:"\e68d"}.layui-icon-ie:before{content:"\e7bb"}.layui-icon-firefox:before{content:"\e686"}.layui-icon-at:before{content:"\e687"}.layui-icon-bluetooth:before{content:"\e689"}.layui-icon-chrome:before{content:"\e68a"}.layui-icon-edge:before{content:"\e68b"}.layui-icon-heart:before{content:"\e68c"}.layui-icon-key:before{content:"\e683"}.layui-icon-android:before{content:"\e684"}.layui-icon-mike:before{content:"\e6dc"}.layui-icon-mute:before{content:"\e685"}.layui-icon-gift:before{content:"\e627"}.layui-icon-windows:before{content:"\e67f"}.layui-icon-ios:before{content:"\e680"}.layui-icon-logout:before{content:"\e682"}.layui-icon-wifi:before{content:"\e7e0"}.layui-icon-rss:before{content:"\e808"}.layui-icon-email:before{content:"\e618"}.layui-icon-reduce-circle:before{content:"\e616"}.layui-icon-transfer:before{content:"\e691"}.layui-icon-service:before{content:"\e626"}.layui-icon-addition:before{content:"\e624"}.layui-icon-subtraction:before{content:"\e67e"}.layui-icon-slider:before{content:"\e714"}.layui-icon-print:before{content:"\e66d"}.layui-icon-export:before{content:"\e67d"}.layui-icon-cols:before{content:"\e610"}.layui-icon-screen-full:before{content:"\e622"}.layui-icon-screen-restore:before{content:"\e758"}.layui-icon-rate-half:before{content:"\e6c9"}.layui-icon-rate-solid:before{content:"\e67a"}.layui-icon-rate:before{content:"\e67b"}.layui-icon-cellphone:before{content:"\e678"}.layui-icon-vercode:before{content:"\e679"}.layui-icon-login-weibo:before{content:"\e675"}.layui-icon-login-qq:before{content:"\e676"}.layui-icon-login-wechat:before{content:"\e677"}.layui-icon-username:before{content:"\e66f"}.layui-icon-password:before{content:"\e673"}.layui-icon-refresh-3:before{content:"\e9aa"}.layui-icon-auz:before{content:"\e672"}.layui-icon-shrink-right:before{content:"\e668"}.layui-icon-spread-left:before{content:"\e66b"}.layui-icon-snowflake:before{content:"\e6b1"}.layui-icon-tips:before{content:"\e702"}.layui-icon-note:before{content:"\e66e"}.layui-icon-senior:before{content:"\e674"}.layui-icon-refresh-1:before{content:"\e666"}.layui-icon-refresh:before{content:"\e669"}.layui-icon-flag:before{content:"\e66c"}.layui-icon-theme:before{content:"\e66a"}.layui-icon-notice:before{content:"\e667"}.layui-icon-console:before{content:"\e665"}.layui-icon-website:before{content:"\e7ae"}.layui-icon-face-surprised:before{content:"\e664"}.layui-icon-set:before{content:"\e716"}.layui-icon-template:before{content:"\e663"}.layui-icon-app:before{content:"\e653"}.layui-icon-template-1:before{content:"\e656"}.layui-icon-home:before{content:"\e68e"}.layui-icon-female:before{content:"\e661"}.layui-icon-male:before{content:"\e662"}.layui-icon-tread:before{content:"\e6c5"}.layui-icon-praise:before{content:"\e6c6"}.layui-icon-rmb:before{content:"\e65e"}.layui-icon-more:before{content:"\e65f"}.layui-icon-camera:before{content:"\e660"}.layui-icon-cart-simple:before{content:"\e698"}.layui-icon-face-cry:before{content:"\e69c"}.layui-icon-face-smile:before{content:"\e6af"}.layui-icon-survey:before{content:"\e6b2"}.layui-icon-read:before{content:"\e705"}.layui-icon-location:before{content:"\e715"}.layui-icon-dollar:before{content:"\e659"}.layui-icon-diamond:before{content:"\e735"}.layui-icon-return:before{content:"\e65c"}.layui-icon-camera-fill:before{content:"\e65d"}.layui-icon-fire:before{content:"\e756"}.layui-icon-more-vertical:before{content:"\e671"}.layui-icon-cart:before{content:"\e657"}.layui-icon-star-fill:before{content:"\e658"}.layui-icon-prev:before{content:"\e65a"}.layui-icon-next:before{content:"\e65b"}.layui-icon-upload:before{content:"\e67c"}.layui-icon-upload-drag:before{content:"\e681"}.layui-icon-user:before{content:"\e770"}.layui-icon-file-b:before{content:"\e655"}.layui-icon-component:before{content:"\e857"}.layui-icon-find-fill:before{content:"\e670"}.layui-icon-loading:before{content:"\e63d"}.layui-icon-loading-1:before{content:"\e63e"}.layui-icon-add-1:before{content:"\e654"}.layui-icon-pause:before{content:"\e651"}.layui-icon-play:before{content:"\e652"}.layui-icon-video:before{content:"\e6ed"}.layui-icon-headset:before{content:"\e6fc"}.layui-icon-voice:before{content:"\e688"}.layui-icon-speaker:before{content:"\e645"}.layui-icon-fonts-del:before{content:"\e64f"}.layui-icon-fonts-html:before{content:"\e64b"}.layui-icon-fonts-code:before{content:"\e64e"}.layui-icon-fonts-strong:before{content:"\e62b"}.layui-icon-unlink:before{content:"\e64d"}.layui-icon-picture:before{content:"\e64a"}.layui-icon-link:before{content:"\e64c"}.layui-icon-face-smile-b:before{content:"\e650"}.layui-icon-align-center:before{content:"\e647"}.layui-icon-align-right:before{content:"\e648"}.layui-icon-align-left:before{content:"\e649"}.layui-icon-fonts-u:before{content:"\e646"}.layui-icon-fonts-i:before{content:"\e644"}.layui-icon-tabs:before{content:"\e62a"}.layui-icon-circle:before{content:"\e63f"}.layui-icon-radio:before{content:"\e643"}.layui-icon-share:before{content:"\e641"}.layui-icon-edit:before{content:"\e642"}.layui-icon-delete:before{content:"\e640"}.layui-icon-engine:before{content:"\e628"}.layui-icon-chart-screen:before{content:"\e629"}.layui-icon-chart:before{content:"\e62c"}.layui-icon-table:before{content:"\e62d"}.layui-icon-tree:before{content:"\e62e"}.layui-icon-upload-circle:before{content:"\e62f"}.layui-icon-templeate-1:before{content:"\e630"}.layui-icon-util:before{content:"\e631"}.layui-icon-layouts:before{content:"\e632"}.layui-icon-prev-circle:before{content:"\e633"}.layui-icon-carousel:before{content:"\e634"}.layui-icon-code-circle:before{content:"\e635"}.layui-icon-water:before{content:"\e636"}.layui-icon-date:before{content:"\e637"}.layui-icon-layer:before{content:"\e638"}.layui-icon-fonts-clear:before{content:"\e639"}.layui-icon-dialogue:before{content:"\e63a"}.layui-icon-cellphone-fine:before{content:"\e63b"}.layui-icon-form:before{content:"\e63c"}.layui-icon-file:before{content:"\e621"}.layui-icon-triangle-r:before{content:"\e623"}.layui-icon-triangle-d:before{content:"\e625"}.layui-icon-set-sm:before{content:"\e620"}.layui-icon-add-circle:before{content:"\e61f"}.layui-icon-layim-download:before{content:"\e61e"}.layui-icon-layim-uploadfile:before{content:"\e61d"}.layui-icon-404:before{content:"\e61c"}.layui-icon-about:before{content:"\e60b"}.layui-icon-layim-theme:before{content:"\e61b"}.layui-icon-down:before{content:"\e61a"}.layui-icon-up:before{content:"\e619"}.layui-icon-circle-dot:before{content:"\e617"}.layui-icon-set-fill:before{content:"\e614"}.layui-icon-search:before{content:"\e615"}.layui-icon-friends:before{content:"\e612"}.layui-icon-group:before{content:"\e613"}.layui-icon-reply-fill:before{content:"\e611"}.layui-icon-menu-fill:before{content:"\e60f"}.layui-icon-face-smile-fine:before{content:"\e60c"}.layui-icon-picture-fine:before{content:"\e60d"}.layui-icon-log:before{content:"\e60e"}.layui-icon-list:before{content:"\e60a"}.layui-icon-release:before{content:"\e609"}.layui-icon-add-circle-fine:before{content:"\e608"}.layui-icon-ok:before{content:"\e605"}.layui-icon-help:before{content:"\e607"}.layui-icon-chat:before{content:"\e606"}.layui-icon-top:before{content:"\e604"}.layui-icon-right:before{content:"\e602"}.layui-icon-left:before{content:"\e603"}.layui-icon-star:before{content:"\e600"}.layui-icon-download-circle:before{content:"\e601"}.layui-icon-close:before{content:"\1006"}.layui-icon-close-fill:before{content:"\1007"}.layui-icon-ok-circle:before{content:"\1005"}.layui-main{position:relative;width:1160px;margin:0 auto}.layui-header{position:relative;z-index:1000;height:60px}.layui-header a:hover{transition:all .5s;-webkit-transition:all .5s}.layui-side{position:fixed;left:0;top:0;bottom:0;z-index:999;width:200px;overflow-x:hidden}.layui-side-scroll{position:relative;width:220px;height:100%;overflow-x:hidden}.layui-body{position:relative;left:200px;right:0;top:0;bottom:0;z-index:900;width:auto;box-sizing:border-box}.layui-layout-body{overflow-x:hidden}.layui-layout-admin .layui-header{position:fixed;top:0;left:0;right:0;background-color:#23262e}.layui-layout-admin .layui-side{top:60px;width:200px;overflow-x:hidden}.layui-layout-admin .layui-body{position:absolute;top:60px;padding-bottom:44px}.layui-layout-admin .layui-main{width:auto;margin:0 15px}.layui-layout-admin .layui-footer{position:fixed;left:200px;right:0;bottom:0;z-index:990;height:44px;line-height:44px;padding:0 15px;box-shadow:-1px 0 4px rgb(0 0 0 / 12%);background-color:#fafafa}.layui-layout-admin .layui-logo{position:absolute;left:0;top:0;width:200px;height:100%;line-height:60px;text-align:center;color:#009688;font-size:16px;box-shadow:0 1px 2px 0 rgb(0 0 0 / 15%)}.layui-layout-admin .layui-header .layui-nav{background:0 0}.layui-layout-left{position:absolute!important;left:200px;top:0}.layui-layout-right{position:absolute!important;right:0;top:0}.layui-container{position:relative;margin:0 auto;box-sizing:border-box}.layui-fluid{position:relative;margin:0 auto;padding:0 15px}.layui-row:after,.layui-row:before{content:"";display:block;clear:both}.layui-col-lg1,.layui-col-lg10,.layui-col-lg11,.layui-col-lg12,.layui-col-lg2,.layui-col-lg3,.layui-col-lg4,.layui-col-lg5,.layui-col-lg6,.layui-col-lg7,.layui-col-lg8,.layui-col-lg9,.layui-col-md1,.layui-col-md10,.layui-col-md11,.layui-col-md12,.layui-col-md2,.layui-col-md3,.layui-col-md4,.layui-col-md5,.layui-col-md6,.layui-col-md7,.layui-col-md8,.layui-col-md9,.layui-col-sm1,.layui-col-sm10,.layui-col-sm11,.layui-col-sm12,.layui-col-sm2,.layui-col-sm3,.layui-col-sm4,.layui-col-sm5,.layui-col-sm6,.layui-col-sm7,.layui-col-sm8,.layui-col-sm9,.layui-col-xl1,.layui-col-xl10,.layui-col-xl11,.layui-col-xl12,.layui-col-xl2,.layui-col-xl3,.layui-col-xl4,.layui-col-xl5,.layui-col-xl6,.layui-col-xl7,.layui-col-xl8,.layui-col-xl9,.layui-col-xs1,.layui-col-xs10,.layui-col-xs11,.layui-col-xs12,.layui-col-xs2,.layui-col-xs3,.layui-col-xs4,.layui-col-xs5,.layui-col-xs6,.layui-col-xs7,.layui-col-xs8,.layui-col-xs9{position:relative;display:block;box-sizing:border-box}.layui-col-xs1,.layui-col-xs10,.layui-col-xs11,.layui-col-xs12,.layui-col-xs2,.layui-col-xs3,.layui-col-xs4,.layui-col-xs5,.layui-col-xs6,.layui-col-xs7,.layui-col-xs8,.layui-col-xs9{float:left}.layui-col-xs1{width:8.33333333%}.layui-col-xs2{width:16.66666667%}.layui-col-xs3{width:25%}.layui-col-xs4{width:33.33333333%}.layui-col-xs5{width:41.66666667%}.layui-col-xs6{width:50%}.layui-col-xs7{width:58.33333333%}.layui-col-xs8{width:66.66666667%}.layui-col-xs9{width:75%}.layui-col-xs10{width:83.33333333%}.layui-col-xs11{width:91.66666667%}.layui-col-xs12{width:100%}.layui-col-xs-offset1{margin-left:8.33333333%}.layui-col-xs-offset2{margin-left:16.66666667%}.layui-col-xs-offset3{margin-left:25%}.layui-col-xs-offset4{margin-left:33.33333333%}.layui-col-xs-offset5{margin-left:41.66666667%}.layui-col-xs-offset6{margin-left:50%}.layui-col-xs-offset7{margin-left:58.33333333%}.layui-col-xs-offset8{margin-left:66.66666667%}.layui-col-xs-offset9{margin-left:75%}.layui-col-xs-offset10{margin-left:83.33333333%}.layui-col-xs-offset11{margin-left:91.66666667%}.layui-col-xs-offset12{margin-left:100%}@media screen and (max-width:767.98px){.layui-container{padding:0 15px}.layui-hide-xs{display:none!important}.layui-show-xs-block{display:block!important}.layui-show-xs-inline{display:inline!important}.layui-show-xs-inline-block{display:inline-block!important}}@media screen and (min-width:768px){.layui-container{width:720px}.layui-hide-sm{display:none!important}.layui-show-sm-block{display:block!important}.layui-show-sm-inline{display:inline!important}.layui-show-sm-inline-block{display:inline-block!important}.layui-col-sm1,.layui-col-sm10,.layui-col-sm11,.layui-col-sm12,.layui-col-sm2,.layui-col-sm3,.layui-col-sm4,.layui-col-sm5,.layui-col-sm6,.layui-col-sm7,.layui-col-sm8,.layui-col-sm9{float:left}.layui-col-sm1{width:8.33333333%}.layui-col-sm2{width:16.66666667%}.layui-col-sm3{width:25%}.layui-col-sm4{width:33.33333333%}.layui-col-sm5{width:41.66666667%}.layui-col-sm6{width:50%}.layui-col-sm7{width:58.33333333%}.layui-col-sm8{width:66.66666667%}.layui-col-sm9{width:75%}.layui-col-sm10{width:83.33333333%}.layui-col-sm11{width:91.66666667%}.layui-col-sm12{width:100%}.layui-col-sm-offset1{margin-left:8.33333333%}.layui-col-sm-offset2{margin-left:16.66666667%}.layui-col-sm-offset3{margin-left:25%}.layui-col-sm-offset4{margin-left:33.33333333%}.layui-col-sm-offset5{margin-left:41.66666667%}.layui-col-sm-offset6{margin-left:50%}.layui-col-sm-offset7{margin-left:58.33333333%}.layui-col-sm-offset8{margin-left:66.66666667%}.layui-col-sm-offset9{margin-left:75%}.layui-col-sm-offset10{margin-left:83.33333333%}.layui-col-sm-offset11{margin-left:91.66666667%}.layui-col-sm-offset12{margin-left:100%}}@media screen and (min-width:992px){.layui-container{width:960px}.layui-hide-md{display:none!important}.layui-show-md-block{display:block!important}.layui-show-md-inline{display:inline!important}.layui-show-md-inline-block{display:inline-block!important}.layui-col-md1,.layui-col-md10,.layui-col-md11,.layui-col-md12,.layui-col-md2,.layui-col-md3,.layui-col-md4,.layui-col-md5,.layui-col-md6,.layui-col-md7,.layui-col-md8,.layui-col-md9{float:left}.layui-col-md1{width:8.33333333%}.layui-col-md2{width:16.66666667%}.layui-col-md3{width:25%}.layui-col-md4{width:33.33333333%}.layui-col-md5{width:41.66666667%}.layui-col-md6{width:50%}.layui-col-md7{width:58.33333333%}.layui-col-md8{width:66.66666667%}.layui-col-md9{width:75%}.layui-col-md10{width:83.33333333%}.layui-col-md11{width:91.66666667%}.layui-col-md12{width:100%}.layui-col-md-offset1{margin-left:8.33333333%}.layui-col-md-offset2{margin-left:16.66666667%}.layui-col-md-offset3{margin-left:25%}.layui-col-md-offset4{margin-left:33.33333333%}.layui-col-md-offset5{margin-left:41.66666667%}.layui-col-md-offset6{margin-left:50%}.layui-col-md-offset7{margin-left:58.33333333%}.layui-col-md-offset8{margin-left:66.66666667%}.layui-col-md-offset9{margin-left:75%}.layui-col-md-offset10{margin-left:83.33333333%}.layui-col-md-offset11{margin-left:91.66666667%}.layui-col-md-offset12{margin-left:100%}}@media screen and (min-width:1200px){.layui-container{width:1150px}.layui-hide-lg{display:none!important}.layui-show-lg-block{display:block!important}.layui-show-lg-inline{display:inline!important}.layui-show-lg-inline-block{display:inline-block!important}.layui-col-lg1,.layui-col-lg10,.layui-col-lg11,.layui-col-lg12,.layui-col-lg2,.layui-col-lg3,.layui-col-lg4,.layui-col-lg5,.layui-col-lg6,.layui-col-lg7,.layui-col-lg8,.layui-col-lg9{float:left}.layui-col-lg1{width:8.33333333%}.layui-col-lg2{width:16.66666667%}.layui-col-lg3{width:25%}.layui-col-lg4{width:33.33333333%}.layui-col-lg5{width:41.66666667%}.layui-col-lg6{width:50%}.layui-col-lg7{width:58.33333333%}.layui-col-lg8{width:66.66666667%}.layui-col-lg9{width:75%}.layui-col-lg10{width:83.33333333%}.layui-col-lg11{width:91.66666667%}.layui-col-lg12{width:100%}.layui-col-lg-offset1{margin-left:8.33333333%}.layui-col-lg-offset2{margin-left:16.66666667%}.layui-col-lg-offset3{margin-left:25%}.layui-col-lg-offset4{margin-left:33.33333333%}.layui-col-lg-offset5{margin-left:41.66666667%}.layui-col-lg-offset6{margin-left:50%}.layui-col-lg-offset7{margin-left:58.33333333%}.layui-col-lg-offset8{margin-left:66.66666667%}.layui-col-lg-offset9{margin-left:75%}.layui-col-lg-offset10{margin-left:83.33333333%}.layui-col-lg-offset11{margin-left:91.66666667%}.layui-col-lg-offset12{margin-left:100%}}@media screen and (min-width:1400px){.layui-container{width:1330px}.layui-hide-xl{display:none!important}.layui-show-xl-block{display:block!important}.layui-show-xl-inline{display:inline!important}.layui-show-xl-inline-block{display:inline-block!important}.layui-col-xl1,.layui-col-xl10,.layui-col-xl11,.layui-col-xl12,.layui-col-xl2,.layui-col-xl3,.layui-col-xl4,.layui-col-xl5,.layui-col-xl6,.layui-col-xl7,.layui-col-xl8,.layui-col-xl9{float:left}.layui-col-xl1{width:8.33333333%}.layui-col-xl2{width:16.66666667%}.layui-col-xl3{width:25%}.layui-col-xl4{width:33.33333333%}.layui-col-xl5{width:41.66666667%}.layui-col-xl6{width:50%}.layui-col-xl7{width:58.33333333%}.layui-col-xl8{width:66.66666667%}.layui-col-xl9{width:75%}.layui-col-xl10{width:83.33333333%}.layui-col-xl11{width:91.66666667%}.layui-col-xl12{width:100%}.layui-col-xl-offset1{margin-left:8.33333333%}.layui-col-xl-offset2{margin-left:16.66666667%}.layui-col-xl-offset3{margin-left:25%}.layui-col-xl-offset4{margin-left:33.33333333%}.layui-col-xl-offset5{margin-left:41.66666667%}.layui-col-xl-offset6{margin-left:50%}.layui-col-xl-offset7{margin-left:58.33333333%}.layui-col-xl-offset8{margin-left:66.66666667%}.layui-col-xl-offset9{margin-left:75%}.layui-col-xl-offset10{margin-left:83.33333333%}.layui-col-xl-offset11{margin-left:91.66666667%}.layui-col-xl-offset12{margin-left:100%}}.layui-col-space1{margin:-.5px}.layui-col-space1>*{padding:.5px}.layui-col-space2{margin:-1px}.layui-col-space2>*{padding:1px}.layui-col-space4{margin:-2px}.layui-col-space4>*{padding:2px}.layui-col-space5{margin:-2.5px}.layui-col-space5>*{padding:2.5px}.layui-col-space6{margin:-3px}.layui-col-space6>*{padding:3px}.layui-col-space8{margin:-4px}.layui-col-space8>*{padding:4px}.layui-col-space10{margin:-5px}.layui-col-space10>*{padding:5px}.layui-col-space12{margin:-6px}.layui-col-space12>*{padding:6px}.layui-col-space14{margin:-7px}.layui-col-space14>*{padding:7px}.layui-col-space15{margin:-7.5px}.layui-col-space15>*{padding:7.5px}.layui-col-space16{margin:-8px}.layui-col-space16>*{padding:8px}.layui-col-space18{margin:-9px}.layui-col-space18>*{padding:9px}.layui-col-space20{margin:-10px}.layui-col-space20>*{padding:10px}.layui-col-space22{margin:-11px}.layui-col-space22>*{padding:11px}.layui-col-space24{margin:-12px}.layui-col-space24>*{padding:12px}.layui-col-space25{margin:-12.5px}.layui-col-space25>*{padding:12.5px}.layui-col-space26{margin:-13px}.layui-col-space26>*{padding:13px}.layui-col-space28{margin:-14px}.layui-col-space28>*{padding:14px}.layui-col-space30{margin:-15px}.layui-col-space30>*{padding:15px}.layui-col-space32{margin:-15px}.layui-col-space32>*{padding:15px}.layui-btn,.layui-input,.layui-select,.layui-textarea,.layui-upload-button{outline:0;-webkit-appearance:none;transition:all .3s;-webkit-transition:all .3s;box-sizing:border-box}.layui-elem-quote{margin-bottom:10px;padding:15px;line-height:1.6;border-left:5px solid #5fb878;border-radius:0 2px 2px 0;background-color:#fafafa}.layui-quote-nm{border-style:solid;border-width:1px;border-left-width:5px;background:0 0}.layui-elem-field{margin-bottom:10px;padding:0;border-width:1px;border-style:solid}.layui-elem-field legend{margin-left:20px;padding:0 10px;font-size:20px;font-weight:300}.layui-field-title{margin:10px 0 20px;border-width:0;border-top-width:1px}.layui-field-box{padding:15px}.layui-field-title .layui-field-box{padding:10px 0}.layui-progress{position:relative;height:6px;border-radius:20px;background-color:#eee}.layui-progress-bar{position:absolute;left:0;top:0;width:0;max-width:100%;height:6px;border-radius:20px;text-align:right;background-color:#5fb878;transition:all .3s;-webkit-transition:all .3s}.layui-progress-big,.layui-progress-big .layui-progress-bar{height:18px;line-height:18px}.layui-progress-text{position:relative;top:-20px;line-height:18px;font-size:12px;color:#5f5f5f}.layui-progress-big .layui-progress-text{position:static;padding:0 10px;color:#fff}.layui-collapse{border-width:1px;border-style:solid;border-radius:2px}.layui-colla-content,.layui-colla-item{border-top-width:1px;border-top-style:solid}.layui-colla-item:first-child{border-top:none}.layui-colla-title{position:relative;height:42px;line-height:42px;padding:0 15px 0 35px;color:#333;background-color:#fafafa;cursor:pointer;font-size:14px;overflow:hidden}.layui-colla-content{display:none;padding:10px 15px;line-height:1.6;color:#5f5f5f}.layui-colla-icon{position:absolute;left:15px;top:0;font-size:14px}.layui-card{margin-bottom:15px;border-radius:2px;background-color:#fff;box-shadow:0 1px 2px 0 rgba(0,0,0,.05)}.layui-card:last-child{margin-bottom:0}.layui-card-header{position:relative;height:42px;line-height:42px;padding:0 15px;border-bottom:1px solid #f6f6f6;color:#333;border-radius:2px 2px 0 0;font-size:14px}.layui-card-body{position:relative;padding:10px 15px;line-height:24px}.layui-card-body[pad15]{padding:15px}.layui-card-body[pad20]{padding:20px}.layui-card-body .layui-table{margin:5px 0}.layui-card .layui-tab{margin:0}.layui-panel{position:relative;border-width:1px;border-style:solid;border-radius:2px;box-shadow:1px 1px 4px rgb(0 0 0 / 8%);background-color:#fff;color:#5f5f5f}.layui-panel-window{position:relative;padding:15px;border-radius:0;border-top:5px solid #eee;background-color:#fff}.layui-auxiliar-moving{position:fixed;left:0;right:0;top:0;bottom:0;width:100%;height:100%;background:0 0;z-index:9999999999}.layui-bg-red{background-color:#ff5722!important;color:#fff!important}.layui-bg-orange{background-color:#ffb800!important;color:#fff!important}.layui-bg-green{background-color:#009688!important;color:#fff!important}.layui-bg-cyan{background-color:#2f4056!important;color:#fff!important}.layui-bg-blue{background-color:#1e9fff!important;color:#fff!important}.layui-bg-black{background-color:#393d49!important;color:#fff!important}.layui-bg-gray{background-color:#fafafa!important;color:#5f5f5f!important}.layui-badge-rim,.layui-border,.layui-colla-content,.layui-colla-item,.layui-collapse,.layui-elem-field,.layui-form-pane .layui-form-item[pane],.layui-form-pane .layui-form-label,.layui-input,.layui-input-split,.layui-panel,.layui-quote-nm,.layui-select,.layui-tab-bar,.layui-tab-card,.layui-tab-title,.layui-tab-title .layui-this:after,.layui-textarea{border-color:#eee}.layui-border{border-width:1px;border-style:solid;color:#5f5f5f!important}.layui-border-red{border-width:1px;border-style:solid;border-color:#ff5722!important;color:#ff5722!important}.layui-border-orange{border-width:1px;border-style:solid;border-color:#ffb800!important;color:#ffb800!important}.layui-border-green{border-width:1px;border-style:solid;border-color:#009688!important;color:#009688!important}.layui-border-cyan{border-width:1px;border-style:solid;border-color:#2f4056!important;color:#2f4056!important}.layui-border-blue{border-width:1px;border-style:solid;border-color:#1e9fff!important;color:#1e9fff!important}.layui-border-black{border-width:1px;border-style:solid;border-color:#393d49!important;color:#393d49!important}.layui-timeline-item:before{background-color:#eee}.layui-text{line-height:1.6;font-size:14px;color:#5f5f5f}.layui-text h1,.layui-text h2,.layui-text h3,.layui-text h4,.layui-text h5,.layui-text h6{font-weight:500;color:#333}.layui-text h1{font-size:32px}.layui-text h2{font-size:24px}.layui-text h3{font-size:18px}.layui-text h4{font-size:16px}.layui-text h5{font-size:14px}.layui-text h6{font-size:13px}.layui-text a:not(.layui-btn){color:#01aaed}.layui-text a:not(.layui-btn):hover{text-decoration:underline}.layui-text ol,.layui-text ul{padding:5px 0 5px 15px}.layui-text ul li{margin-top:5px;list-style-type:disc}.layui-text ol li{margin-top:5px;list-style-type:decimal}.layui-text em,.layui-word-aux{color:#999!important;padding-left:5px!important;padding-right:5px!important}.layui-text p{margin:15px 0}.layui-text p:first-child{margin-top:0}.layui-text p:last-child{margin-bottom:0}.layui-text blockquote:not(.layui-elem-quote){padding:5px 15px;border-left:5px solid #eee}.layui-text pre:not(.layui-code){padding:15px;font-family:Lucida Console,Consolas,Courier New;background-color:#fafafa}.layui-font-12{font-size:12px!important}.layui-font-14{font-size:14px!important}.layui-font-16{font-size:16px!important}.layui-font-18{font-size:18px!important}.layui-font-20{font-size:20px!important}.layui-font-red{color:#ff5722!important}.layui-font-orange{color:#ffb800!important}.layui-font-green{color:#009688!important}.layui-font-cyan{color:#2f4056!important}.layui-font-blue{color:#01aaed!important}.layui-font-black{color:#000!important}.layui-font-gray{color:#c2c2c2!important}.layui-btn{display:inline-block;vertical-align:middle;height:38px;line-height:38px;border:1px solid transparent;padding:0 18px;background-color:#009688;color:#fff;white-space:nowrap;text-align:center;font-size:14px;border-radius:2px;cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-btn:hover{opacity:.8;filter:alpha(opacity=80);color:#fff}.layui-btn:active{opacity:1;filter:alpha(opacity=100)}.layui-btn+.layui-btn{margin-left:10px}.layui-btn-container{font-size:0}.layui-btn-container .layui-btn{margin-right:10px;margin-bottom:10px}.layui-btn-container .layui-btn+.layui-btn{margin-left:0}.layui-table .layui-btn-container .layui-btn{margin-bottom:9px}.layui-btn-radius{border-radius:100px}.layui-btn .layui-icon{padding:0 2px;vertical-align:middle\0;vertical-align:bottom}.layui-btn-primary{border-color:#d2d2d2;background:0 0;color:#5f5f5f}.layui-btn-primary:hover{border-color:#009688;color:#333}.layui-btn-normal{background-color:#1e9fff}.layui-btn-warm{background-color:#ffb800}.layui-btn-danger{background-color:#ff5722}.layui-btn-checked{background-color:#5fb878}.layui-btn-disabled,.layui-btn-disabled:active,.layui-btn-disabled:hover{border-color:#eee!important;background-color:#fbfbfb!important;color:#d2d2d2!important;cursor:not-allowed!important;opacity:1}.layui-btn-lg{height:44px;line-height:44px;padding:0 25px;font-size:16px}.layui-btn-sm{height:30px;line-height:30px;padding:0 10px;font-size:12px}.layui-btn-xs{height:22px;line-height:22px;padding:0 5px;font-size:12px}.layui-btn-xs i{font-size:12px!important}.layui-btn-group{display:inline-block;vertical-align:middle;font-size:0}.layui-btn-group .layui-btn{margin-left:0!important;margin-right:0!important;border-left:1px solid rgba(255,255,255,.5);border-radius:0}.layui-btn-group .layui-btn-primary{border-left:none}.layui-btn-group .layui-btn-primary:hover{border-color:#d2d2d2;color:#009688}.layui-btn-group .layui-btn:first-child{border-left:none;border-radius:2px 0 0 2px}.layui-btn-group .layui-btn-primary:first-child{border-left:1px solid #d2d2d2}.layui-btn-group .layui-btn:last-child{border-radius:0 2px 2px 0}.layui-btn-group .layui-btn+.layui-btn{margin-left:0}.layui-btn-group+.layui-btn-group{margin-left:10px}.layui-btn-fluid{width:100%}.layui-input,.layui-select,.layui-textarea{height:38px;line-height:1.3;line-height:38px\9;border-width:1px;border-style:solid;background-color:#fff;color:rgba(0,0,0,.85);border-radius:2px}.layui-input::-webkit-input-placeholder,.layui-select::-webkit-input-placeholder,.layui-textarea::-webkit-input-placeholder{line-height:1.3}.layui-input,.layui-textarea{display:block;width:100%;padding-left:10px}.layui-input:hover,.layui-textarea:hover{border-color:#eee!important}.layui-input:focus,.layui-textarea:focus{border-color:#d2d2d2!important}.layui-textarea{position:relative;min-height:100px;height:auto;line-height:20px;padding:6px 10px;resize:vertical}.layui-select{padding:0 10px}.layui-form input[type=checkbox],.layui-form input[type=radio],.layui-form select{display:none}.layui-form [lay-ignore]{display:initial}.layui-form-item{margin-bottom:15px;clear:both;*zoom:1}.layui-form-item:after{content:'\20';clear:both;*zoom:1;display:block;height:0}.layui-form-label{position:relative;float:left;display:block;padding:9px 15px;width:80px;font-weight:400;line-height:20px;text-align:right}.layui-form-label-col{display:block;float:none;padding:9px 0;line-height:20px;text-align:left}.layui-form-item .layui-inline{margin-bottom:5px;margin-right:10px}.layui-input-block,.layui-input-inline{position:relative}.layui-input-block{margin-left:110px;min-height:36px}.layui-input-inline{display:inline-block;vertical-align:middle}.layui-form-item .layui-input-inline{float:left;width:190px;margin-right:10px}.layui-form-text .layui-input-inline{width:auto}.layui-form-mid{position:relative;float:left;display:block;padding:9px 0!important;line-height:20px;margin-right:10px}.layui-form-danger+.layui-form-select .layui-input,.layui-form-danger:focus{border-color:#ff5722!important}.layui-input-wrap{position:relative;height:38px;line-height:38px}.layui-input-wrap .layui-input{padding-right:35px}.layui-input-wrap .layui-input::-ms-clear,.layui-input-wrap .layui-input::-ms-reveal{display:none}.layui-input-wrap-prefix .layui-input{padding-left:35px}.layui-input-prefix,.layui-input-split,.layui-input-suffix{position:absolute;right:0;top:0;padding:0 10px;width:35px;height:100%;text-align:center;transition:all .3s;cursor:pointer;pointer-events:none;box-sizing:border-box}.layui-input-prefix{left:0;border-radius:2px 0 0 2px}.layui-input-suffix{right:0;border-radius:0 2px 2px 0}.layui-input-wrap .layui-input:focus+.layui-input-split{border-color:#d2d2d2}.layui-input-prefix .layui-icon,.layui-input-split .layui-icon,.layui-input-suffix .layui-icon{position:relative;font-size:16px;color:#5f5f5f;transition:all .3s}.layui-input-wrap .layui-input-prefix.layui-input-split{border-width:0;border-right-width:1px}.layui-input-wrap-prefix .layui-form-select{position:static}.layui-input-affix-event .layui-icon{color:rgba(0,0,0,.8)}.layui-input-affix-event .layui-icon-clear{color:rgba(0,0,0,.3)}.layui-input-affix-event .layui-icon:hover{color:rgba(0,0,0,.6)}.layui-input-split{border-width:1px;border-style:solid}.layui-input-affix-event{pointer-events:auto}.layui-input-group{position:relative;display:inline-table}.layui-input-group>*{display:table-cell;vertical-align:middle;position:relative}.layui-input-group .layui-input{padding-right:15px}.layui-input-group .layui-input-prefix{width:auto;border-right:0}.layui-input-group .layui-input-suffix{width:auto;border-left:0}.layui-form-select{position:relative;color:#5f5f5f}.layui-form-select .layui-input{padding-right:30px;cursor:pointer}.layui-form-select .layui-edge{position:absolute;right:10px;top:50%;margin-top:-3px;cursor:pointer;border-width:6px;border-top-color:#c2c2c2;border-top-style:solid;transition:all .3s;-webkit-transition:all .3s}.layui-form-select dl{display:none;position:absolute;left:0;top:42px;padding:5px 0;z-index:899;min-width:100%;border:1px solid #eee;max-height:300px;overflow-y:auto;background-color:#fff;border-radius:2px;box-shadow:1px 1px 4px rgb(0 0 0 / 8%);box-sizing:border-box}.layui-form-select dl dd,.layui-form-select dl dt{padding:0 10px;line-height:36px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layui-form-select dl dt{font-size:12px;color:#999}.layui-form-select dl dd{cursor:pointer}.layui-form-select dl dd:hover{background-color:#f6f6f6;-webkit-transition:.5s all;transition:.5s all}.layui-form-select .layui-select-group dd{padding-left:20px}.layui-form-select dl dd.layui-select-tips{padding-left:10px!important;color:#999}.layui-form-select dl dd.layui-this{background-color:#f7f7f7;color:#5fb878;font-weight:700}.layui-form-select dl dd.layui-disabled{background-color:#fff}.layui-form-selected dl{display:block}.layui-form-selected .layui-edge{margin-top:-9px;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.layui-form-selected .layui-edge{margin-top:-3px\0}:root .layui-form-selected .layui-edge{margin-top:-9px\0/IE9}.layui-form-selectup dl{top:auto;bottom:42px}.layui-select-none{margin:5px 0;text-align:center;color:#999}.layui-select-disabled .layui-disabled{border-color:#eee!important}.layui-select-disabled .layui-edge{border-top-color:#d2d2d2}.layui-form-checkbox{position:relative;display:inline-block;vertical-align:middle;height:30px;line-height:30px;margin-right:10px;padding-right:30px;background-color:#fff;cursor:pointer;font-size:0;-webkit-transition:.1s linear;transition:.1s linear;box-sizing:border-box}.layui-form-checkbox *{display:inline-block;vertical-align:middle}.layui-form-checkbox span{padding:0 10px;height:100%;font-size:14px;border-radius:2px 0 0 2px;background-color:#d2d2d2;color:#fff;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.layui-form-checkbox:hover span{background-color:#c2c2c2}.layui-form-checkbox i{position:absolute;right:0;top:0;width:30px;height:28px;border:1px solid #d2d2d2;border-left:none;border-radius:0 2px 2px 0;color:#fff;font-size:20px;text-align:center}.layui-form-checkbox:hover i{border-color:#c2c2c2;color:#c2c2c2}.layui-form-checked,.layui-form-checked:hover{border-color:#5fb878}.layui-form-checked span,.layui-form-checked:hover span{background-color:#5fb878}.layui-form-checked i,.layui-form-checked:hover i{color:#5fb878}.layui-form-item .layui-form-checkbox{margin-top:4px}.layui-form-checkbox[lay-skin=primary]{height:auto!important;line-height:normal!important;min-width:18px;min-height:18px;border:none!important;margin-right:0;padding-left:28px;padding-right:0;background:0 0}.layui-form-checkbox[lay-skin=primary] span{padding-left:0;padding-right:15px;line-height:18px;background:0 0;color:#5f5f5f}.layui-form-checkbox[lay-skin=primary] i{right:auto;left:0;width:16px;height:16px;line-height:16px;border:1px solid #d2d2d2;font-size:12px;border-radius:2px;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-checkbox[lay-skin=primary]:hover i{border-color:#5fb878;color:#fff}.layui-form-checked[lay-skin=primary] i{border-color:#5fb878!important;background-color:#5fb878;color:#fff}.layui-checkbox-disabled[lay-skin=primary] span{background:0 0!important;color:#c2c2c2!important}.layui-form-checked.layui-checkbox-disabled[lay-skin=primary] i{background:#eee!important;border-color:#eee!important}.layui-checkbox-disabled[lay-skin=primary]:hover i{border-color:#d2d2d2}.layui-form-item .layui-form-checkbox[lay-skin=primary]{margin-top:10px}.layui-form-switch{position:relative;display:inline-block;vertical-align:middle;height:22px;line-height:22px;min-width:35px;padding:0 5px;margin-top:8px;border:1px solid #d2d2d2;border-radius:20px;cursor:pointer;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-switch i{position:absolute;left:5px;top:3px;width:16px;height:16px;border-radius:20px;background-color:#d2d2d2;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-switch em{position:relative;top:0;width:25px;margin-left:21px;padding:0!important;text-align:center!important;color:#999!important;font-style:normal!important;font-size:12px}.layui-form-onswitch{border-color:#5fb878;background-color:#5fb878}.layui-form-onswitch i{left:100%;margin-left:-21px;background-color:#fff}.layui-form-onswitch em{margin-left:5px;margin-right:21px;color:#fff!important}.layui-checkbox-disabled{border-color:#eee!important}.layui-checkbox-disabled span{background-color:#eee!important}.layui-checkbox-disabled i{border-color:#eee!important}.layui-checkbox-disabled em{color:#d2d2d2!important}.layui-checkbox-disabled:hover i{color:#fff!important}[lay-radio]{display:none}.layui-form-radio{display:inline-block;vertical-align:middle;line-height:28px;margin:6px 10px 0 0;padding-right:10px;cursor:pointer;font-size:0}.layui-form-radio *{display:inline-block;vertical-align:middle;font-size:14px}.layui-form-radio>i{margin-right:8px;font-size:22px;color:#c2c2c2}.layui-form-radio:hover *,.layui-form-radioed,.layui-form-radioed>i{color:#5fb878}.layui-radio-disabled>i{color:#eee!important}.layui-radio-disabled *{color:#c2c2c2!important}.layui-form-pane .layui-form-label{width:110px;padding:8px 15px;height:38px;line-height:20px;border-width:1px;border-style:solid;border-radius:2px 0 0 2px;text-align:center;background-color:#fafafa;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box}.layui-form-pane .layui-input-inline{margin-left:-1px}.layui-form-pane .layui-input-block{margin-left:110px;left:-1px}.layui-form-pane .layui-input{border-radius:0 2px 2px 0}.layui-form-pane .layui-form-text .layui-form-label{float:none;width:100%;border-radius:2px;box-sizing:border-box;text-align:left}.layui-form-pane .layui-form-text .layui-input-inline{display:block;margin:0;top:-1px;clear:both}.layui-form-pane .layui-form-text .layui-input-block{margin:0;left:0;top:-1px}.layui-form-pane .layui-form-text .layui-textarea{min-height:100px;border-radius:0 0 2px 2px}.layui-form-pane .layui-form-checkbox{margin:4px 0 4px 10px}.layui-form-pane .layui-form-radio,.layui-form-pane .layui-form-switch{margin-top:6px;margin-left:10px}.layui-form-pane .layui-form-item[pane]{position:relative;border-width:1px;border-style:solid}.layui-form-pane .layui-form-item[pane] .layui-form-label{position:absolute;left:0;top:0;height:100%;border-width:0;border-right-width:1px}.layui-form-pane .layui-form-item[pane] .layui-input-inline{margin-left:110px}@media screen and (max-width:450px){.layui-form-item .layui-form-label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-form-item .layui-inline{display:block;margin-right:0;margin-bottom:20px;clear:both}.layui-form-item .layui-inline:after{content:'\20';clear:both;display:block;height:0}.layui-form-item .layui-input-inline{display:block;float:none;left:-3px;width:auto!important;margin:0 0 10px 112px}.layui-form-item .layui-input-inline+.layui-form-mid{margin-left:110px;top:-5px;padding:0}.layui-form-item .layui-form-checkbox{margin-right:5px;margin-bottom:5px}}.layui-laypage{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;margin:10px 0;font-size:0}.layui-laypage>a:first-child,.layui-laypage>a:first-child em{border-radius:2px 0 0 2px}.layui-laypage>a:last-child,.layui-laypage>a:last-child em{border-radius:0 2px 2px 0}.layui-laypage>:first-child{margin-left:0!important}.layui-laypage>:last-child{margin-right:0!important}.layui-laypage a,.layui-laypage button,.layui-laypage input,.layui-laypage select,.layui-laypage span{border:1px solid #eee}.layui-laypage a,.layui-laypage span{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;padding:0 15px;height:28px;line-height:28px;margin:0 -1px 5px 0;background-color:#fff;color:#333;font-size:12px}.layui-laypage a:hover{color:#009688}.layui-laypage em{font-style:normal}.layui-laypage .layui-laypage-spr{color:#999;font-weight:700}.layui-laypage a{text-decoration:none}.layui-laypage .layui-laypage-curr{position:relative}.layui-laypage .layui-laypage-curr em{position:relative;color:#fff}.layui-laypage .layui-laypage-curr .layui-laypage-em{position:absolute;left:-1px;top:-1px;padding:1px;width:100%;height:100%;background-color:#009688}.layui-laypage-em{border-radius:2px}.layui-laypage-next em,.layui-laypage-prev em{font-family:Sim sun;font-size:16px}.layui-laypage .layui-laypage-count,.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh,.layui-laypage .layui-laypage-skip{margin-left:10px;margin-right:10px;padding:0;border:none}.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh{vertical-align:top}.layui-laypage .layui-laypage-refresh i{font-size:18px;cursor:pointer}.layui-laypage select{height:22px;padding:3px;border-radius:2px;cursor:pointer}.layui-laypage .layui-laypage-skip{height:30px;line-height:30px;color:#999}.layui-laypage button,.layui-laypage input{height:30px;line-height:30px;border-radius:2px;vertical-align:top;background-color:#fff;box-sizing:border-box}.layui-laypage input{display:inline-block;width:40px;margin:0 10px;padding:0 3px;text-align:center}.layui-laypage input:focus,.layui-laypage select:focus{border-color:#009688!important}.layui-laypage button{margin-left:10px;padding:0 10px;cursor:pointer}.layui-flow-more{margin:10px 0;text-align:center;color:#999;font-size:14px;clear:both}.layui-flow-more a{height:32px;line-height:32px}.layui-flow-more a *{display:inline-block;vertical-align:top}.layui-flow-more a cite{padding:0 20px;border-radius:3px;background-color:#eee;color:#333;font-style:normal}.layui-flow-more a cite:hover{opacity:.8}.layui-flow-more a i{font-size:30px;color:#737383}.layui-table{width:100%;margin:10px 0;background-color:#fff;color:#5f5f5f}.layui-table tr{transition:all .3s;-webkit-transition:all .3s}.layui-table th{text-align:left;font-weight:400}.layui-table tbody tr:hover,.layui-table thead tr,.layui-table-click,.layui-table-header,.layui-table-hover,.layui-table-mend,.layui-table-patch,.layui-table-tool,.layui-table-total,.layui-table-total tr{background-color:#fafafa}.layui-table td,.layui-table th,.layui-table-col-set,.layui-table-fixed-r,.layui-table-grid-down,.layui-table-header,.layui-table-page,.layui-table-tips-main,.layui-table-tool,.layui-table-total,.layui-table-view,.layui-table[lay-skin=line],.layui-table[lay-skin=row]{border-width:1px;border-style:solid;border-color:#eee}.layui-table td,.layui-table th{position:relative;padding:9px 15px;min-height:20px;line-height:20px;font-size:14px}.layui-table[lay-skin=line] td,.layui-table[lay-skin=line] th{border-width:0;border-bottom-width:1px}.layui-table[lay-skin=row] td,.layui-table[lay-skin=row] th{border-width:0;border-right-width:1px}.layui-table[lay-skin=nob] td,.layui-table[lay-skin=nob] th{border:none}.layui-table img{max-width:100px}.layui-table[lay-size=lg] td,.layui-table[lay-size=lg] th{padding-top:15px;padding-right:30px;padding-bottom:15px;padding-left:30px}.layui-table-view .layui-table[lay-size=lg] .layui-table-cell{height:50px;line-height:40px}.layui-table[lay-size=sm] td,.layui-table[lay-size=sm] th{padding-top:5px;padding-right:10px;padding-bottom:5px;padding-left:10px;font-size:12px}.layui-table-view .layui-table[lay-size=sm] .layui-table-cell{height:30px;line-height:20px;padding-top:5px;padding-left:11px;padding-right:11px}.layui-table[lay-data],.layui-table[lay-options]{display:none}.layui-table-box{position:relative;overflow:hidden}.layui-table-view{margin:10px 0}.layui-table-view .layui-table{position:relative;width:auto;margin:0;border:0;border-collapse:separate}.layui-table-view .layui-table[lay-skin=line]{border-width:0;border-right-width:1px}.layui-table-view .layui-table[lay-skin=row]{border-width:0;border-bottom-width:1px}.layui-table-view .layui-table td,.layui-table-view .layui-table th{padding:0;border-top:none;border-left:none}.layui-table-view .layui-table th.layui-unselect .layui-table-cell span{cursor:pointer}.layui-table-view .layui-table td{cursor:default}.layui-table-view .layui-table td[data-edit=text]{cursor:text}.layui-table-view .layui-form-checkbox[lay-skin=primary] i{width:18px;height:18px}.layui-table-view .layui-form-radio{line-height:0;padding:0}.layui-table-view .layui-form-radio>i{margin:0;font-size:20px}.layui-table-init{position:absolute;left:0;top:0;width:100%;height:100%;text-align:center;z-index:199}.layui-table-init .layui-icon{position:absolute;left:50%;top:50%;margin:-15px 0 0 -15px;font-size:30px;color:#c2c2c2}.layui-table-header{border-width:0;border-bottom-width:1px;overflow:hidden}.layui-table-header .layui-table{margin-bottom:-1px}.layui-table-column{position:relative;width:100%;min-height:41px;padding:8px 16px;border-width:0;border-bottom-width:1px}.layui-table-column .layui-btn-container{margin-bottom:-8px}.layui-table-column .layui-btn-container .layui-btn{margin-right:8px;margin-bottom:8px}.layui-table-tool .layui-inline[lay-event]{position:relative;width:26px;height:26px;padding:5px;line-height:16px;margin-right:10px;text-align:center;color:#333;border:1px solid #ccc;cursor:pointer;-webkit-transition:.5s all;transition:.5s all}.layui-table-tool .layui-inline[lay-event]:hover{border:1px solid #999}.layui-table-tool-temp{padding-right:120px}.layui-table-tool-self{position:absolute;right:17px;top:10px}.layui-table-tool .layui-table-tool-self .layui-inline[lay-event]{margin:0 0 0 10px}.layui-table-tool-panel{position:absolute;top:29px;left:-1px;z-index:399;padding:5px 0;min-width:150px;min-height:40px;border:1px solid #d2d2d2;text-align:left;overflow-y:auto;background-color:#fff;box-shadow:0 2px 4px rgba(0,0,0,.12)}.layui-table-tool-panel li{padding:0 10px;line-height:30px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-webkit-transition:.5s all;transition:.5s all}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary]{width:100%}.layui-table-tool-panel li:hover{background-color:#f6f6f6}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary]{padding-left:28px}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary] i{position:absolute;left:0;top:0}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary] span{padding:0}.layui-table-tool .layui-table-tool-self .layui-table-tool-panel{left:auto;right:-1px}.layui-table-col-set{position:absolute;right:0;top:0;width:20px;height:100%;border-width:0;border-left-width:1px;background-color:#fff}.layui-table-sort{width:10px;height:20px;margin-left:5px;cursor:pointer!important}.layui-table-sort .layui-edge{position:absolute;left:5px;border-width:5px}.layui-table-sort .layui-table-sort-asc{top:3px;border-top:none;border-bottom-style:solid;border-bottom-color:#b2b2b2}.layui-table-sort .layui-table-sort-asc:hover{border-bottom-color:#5f5f5f}.layui-table-sort .layui-table-sort-desc{bottom:5px;border-bottom:none;border-top-style:solid;border-top-color:#b2b2b2}.layui-table-sort .layui-table-sort-desc:hover{border-top-color:#5f5f5f}.layui-table-sort[lay-sort=asc] .layui-table-sort-asc{border-bottom-color:#000}.layui-table-sort[lay-sort=desc] .layui-table-sort-desc{border-top-color:#000}.layui-table-cell{height:38px;line-height:28px;padding:6px 15px;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box}.layui-table-cell .layui-form-checkbox[lay-skin=primary]{top:-1px;padding:0}.layui-table-cell .layui-table-link{color:#01aaed}.layui-table-cell .layui-btn{vertical-align:inherit}.layui-table-cell[align=center]{-webkit-box-pack:center}.layui-table-cell[align=right]{-webkit-box-pack:end}.laytable-cell-checkbox,.laytable-cell-numbers,.laytable-cell-radio,.laytable-cell-space{text-align:center;-webkit-box-pack:center}.layui-table-body{position:relative;overflow:auto;margin-right:-1px;margin-bottom:-1px}.layui-table-body .layui-none{line-height:26px;padding:30px 15px;text-align:center;color:#999}.layui-table-body .layui-table[lay-even] tr:nth-child(even){background-color:#f2f2f2}.layui-table-fixed{position:absolute;left:0;top:0;z-index:101}.layui-table-fixed .layui-table-body{overflow:hidden}.layui-table-fixed-l{box-shadow:1px 0 8px rgba(0,0,0,.08)}.layui-table-fixed-r{left:auto;right:-1px;border-width:0;border-left-width:1px;box-shadow:-1px 0 8px rgba(0,0,0,.08)}.layui-table-fixed-r .layui-table-header{position:relative;overflow:visible}.layui-table-mend{position:absolute;right:-49px;top:0;height:100%;width:50px}.layui-table-tool{position:relative;width:100%;min-height:50px;line-height:30px;padding:10px 15px;border-width:0;border-bottom-width:1px}.layui-table-tool .layui-btn-container{margin-bottom:-10px}.layui-table-total{margin-bottom:-1px;border-width:0;border-top-width:1px;overflow:hidden}.layui-table-page{border-width:0;border-top-width:1px;margin-bottom:-1px;white-space:nowrap;overflow:hidden}.layui-table-page>div{height:26px}.layui-table-page .layui-laypage{margin:0}.layui-table-page .layui-laypage a,.layui-table-page .layui-laypage span{height:26px;line-height:26px;margin-bottom:10px;border:none;background:0 0}.layui-table-page .layui-laypage a,.layui-table-page .layui-laypage span.layui-laypage-curr{padding:0 12px}.layui-table-page .layui-laypage span{margin-left:0;padding:0}.layui-table-page .layui-laypage .layui-laypage-prev{margin-left:-11px!important}.layui-table-page .layui-laypage .layui-laypage-curr .layui-laypage-em{left:0;top:0;padding:0}.layui-table-page .layui-laypage button,.layui-table-page .layui-laypage input{height:26px;line-height:26px}.layui-table-page .layui-laypage input{width:40px}.layui-table-page .layui-laypage button{padding:0 10px}.layui-table-page select{height:18px}.layui-table-pagebar{float:right;line-height:23px}.layui-table-pagebar .layui-btn-sm{margin-top:-1px}.layui-table-pagebar .layui-btn-xs{margin-top:2px}.layui-table-view select[lay-ignore]{display:inline-block}.layui-table-patch .layui-table-cell{padding:0;width:30px}.layui-table-edit{position:absolute;left:0;top:0;z-index:189;min-width:100%;min-height:100%;padding:5px 14px;border-radius:0;box-shadow:1px 1px 20px rgba(0,0,0,.15);background-color:#fff}.layui-table-edit:focus{border-color:#5fb878!important}input.layui-input.layui-table-edit{height:100%}select.layui-table-edit{padding:0 0 0 10px;border-color:#d2d2d2}.layui-table-view .layui-form-checkbox,.layui-table-view .layui-form-radio,.layui-table-view .layui-form-switch{top:0;margin:0;box-sizing:content-box}.layui-table-view .layui-form-checkbox{top:-1px;height:26px;line-height:26px}.layui-table-view .layui-form-checkbox i{height:26px}.layui-table-grid .layui-table-cell{overflow:visible}.layui-table-grid-down{position:absolute;top:0;right:0;width:26px;height:100%;padding:5px 0;border-width:0;border-left-width:1px;text-align:center;background-color:#fff;color:#999;cursor:pointer}.layui-table-grid-down .layui-icon{position:absolute;top:50%;left:50%;margin:-8px 0 0 -8px}.layui-table-grid-down:hover{background-color:#fbfbfb}body .layui-table-tips .layui-layer-content{background:0 0;padding:0;box-shadow:0 1px 6px rgba(0,0,0,.12)}.layui-table-tips-main{margin:-49px 0 0 -1px;max-height:150px;padding:8px 15px;font-size:14px;overflow-y:scroll;background-color:#fff;color:#5f5f5f}.layui-table-tips-c{position:absolute;right:-3px;top:-13px;width:20px;height:20px;padding:3px;cursor:pointer;background-color:#5f5f5f;border-radius:50%;color:#fff}.layui-table-tips-c:hover{background-color:#777}.layui-table-tips-c:before{position:relative;right:-2px}.layui-upload-file{display:none!important;opacity:.01;filter:Alpha(opacity=1)}.layui-upload-list{margin:10px 0}.layui-upload-choose{max-width:200px;padding:0 10px;color:#999;font-size:14px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-upload-drag{position:relative;display:inline-block;padding:30px;border:1px dashed #e2e2e2;background-color:#fff;text-align:center;cursor:pointer;color:#999}.layui-upload-drag .layui-icon{font-size:50px;color:#009688}.layui-upload-drag[lay-over]{border-color:#009688}.layui-upload-form{display:inline-block}.layui-upload-iframe{position:absolute;width:0;height:0;border:0;visibility:hidden}.layui-upload-wrap{position:relative;display:inline-block;vertical-align:middle}.layui-upload-wrap .layui-upload-file{display:block!important;position:absolute;left:0;top:0;z-index:10;font-size:100px;width:100%;height:100%;opacity:.01;filter:Alpha(opacity=1);cursor:pointer}.layui-btn-container .layui-upload-choose{padding-left:0}.layui-menu{position:relative;margin:5px 0;background-color:#fff;box-sizing:border-box}.layui-menu *{box-sizing:border-box}.layui-menu li,.layui-menu-body-title a{padding:5px 15px}.layui-menu li{position:relative;margin:1px 0;width:calc(100% + 1px);line-height:26px;color:rgba(0,0,0,.8);font-size:14px;white-space:nowrap;cursor:pointer;transition:all .3s}.layui-menu li:hover{background-color:#f6f6f6}.layui-menu-item-parent:hover>.layui-menu-body-panel{display:block;animation-name:layui-fadein;animation-duration:.3s;animation-fill-mode:both;animation-delay:.2s}.layui-menu-item-group .layui-menu-body-title,.layui-menu-item-parent .layui-menu-body-title{padding-right:25px}.layui-menu .layui-menu-item-divider:hover,.layui-menu .layui-menu-item-group:hover,.layui-menu .layui-menu-item-none:hover{background:0 0;cursor:default}.layui-menu .layui-menu-item-group>ul{margin:5px 0 -5px}.layui-menu .layui-menu-item-group>.layui-menu-body-title{color:rgba(0,0,0,.35);user-select:none}.layui-menu .layui-menu-item-none{color:rgba(0,0,0,.35);cursor:default}.layui-menu .layui-menu-item-none{text-align:center}.layui-menu .layui-menu-item-divider{margin:5px 0;padding:0;height:0;line-height:0;border-bottom:1px solid #eee;overflow:hidden}.layui-menu .layui-menu-item-down:hover,.layui-menu .layui-menu-item-up:hover{cursor:pointer}.layui-menu .layui-menu-item-up>.layui-menu-body-title{color:rgba(0,0,0,.8)}.layui-menu .layui-menu-item-up>ul{visibility:hidden;height:0;overflow:hidden}.layui-menu .layui-menu-item-down:hover>.layui-menu-body-title>.layui-icon,.layui-menu .layui-menu-item-up>.layui-menu-body-title:hover>.layui-icon{color:#000}.layui-menu .layui-menu-item-down>ul{visibility:visible;height:auto}.layui-menu .layui-menu-item-checked,.layui-menu .layui-menu-item-checked2{background-color:#f6f6f6!important;color:#5fb878}.layui-menu .layui-menu-item-checked a,.layui-menu .layui-menu-item-checked2 a{color:#5fb878}.layui-menu .layui-menu-item-checked:after{position:absolute;right:0;top:0;bottom:0;border-right:3px solid #5fb878;content:""}.layui-menu-body-title{position:relative;overflow:hidden;text-overflow:ellipsis}.layui-menu-body-title a{display:block;margin:-5px -15px;color:rgba(0,0,0,.8)}.layui-menu-body-title a:hover{transition:all .3s}.layui-menu-body-title>.layui-icon{position:absolute;right:0;top:0;font-size:14px}.layui-menu-body-title>.layui-icon:hover{transition:all .3s}.layui-menu-body-title>.layui-icon-right{right:-1px}.layui-menu-body-panel{display:none;position:absolute;top:-7px;left:100%;z-index:1000;margin-left:13px;padding:5px 0}.layui-menu-body-panel:before{content:"";position:absolute;width:20px;left:-16px;top:0;bottom:0}.layui-menu-body-panel-left{left:auto;right:100%;margin:0 13px 0}.layui-menu-body-panel-left:before{left:auto;right:-16px}.layui-menu-lg li{line-height:32px}.layui-menu-lg .layui-menu-body-title a:hover,.layui-menu-lg li:hover{background:0 0;color:#5fb878}.layui-menu-lg li .layui-menu-body-panel{margin-left:14px}.layui-menu-lg li .layui-menu-body-panel-left{margin:0 15px 0}.layui-dropdown{position:absolute;left:-999999px;top:-999999px;z-index:77777777;margin:5px 0;min-width:100px}.layui-dropdown:before{content:"";position:absolute;width:100%;height:6px;left:0;top:-6px}.layui-dropdown-shade{top:0;left:0;width:100%;height:100%;_height:expression(document.body.offsetHeight+"px");position:fixed;_position:absolute;pointer-events:auto}.layui-nav{position:relative;padding:0 20px;background-color:#393d49;color:#fff;border-radius:2px;font-size:0;box-sizing:border-box}.layui-nav *{font-size:14px}.layui-nav .layui-nav-item{position:relative;display:inline-block;*display:inline;*zoom:1;vertical-align:middle;line-height:60px}.layui-nav .layui-nav-item a{display:block;padding:0 20px;color:#fff;color:rgba(255,255,255,.7);transition:all .3s;-webkit-transition:all .3s}.layui-nav .layui-this:after,.layui-nav-bar{content:"";position:absolute;left:0;top:0;width:0;height:5px;background-color:#5fb878;transition:all .2s;-webkit-transition:all .2s;pointer-events:none}.layui-nav-bar{z-index:1000}.layui-nav[lay-bar=disabled] .layui-nav-bar{display:none}.layui-nav .layui-nav-item a:hover,.layui-nav .layui-this a{color:#fff}.layui-nav .layui-this:after{top:auto;bottom:0;width:100%}.layui-nav-img{width:30px;height:30px;margin-right:10px;border-radius:50%}.layui-nav .layui-nav-more{position:absolute;top:0;right:3px;left:auto!important;margin-top:0;font-size:12px;cursor:pointer;transition:all .2s;-webkit-transition:all .2s}.layui-nav .layui-nav-mored,.layui-nav-itemed>a .layui-nav-more{transform:rotate(180deg)}.layui-nav-child{display:none;position:absolute;left:0;top:65px;min-width:100%;line-height:36px;padding:5px 0;box-shadow:0 2px 4px rgba(0,0,0,.12);border:1px solid #eee;background-color:#fff;z-index:100;border-radius:2px;white-space:nowrap;box-sizing:border-box}.layui-nav .layui-nav-child a{color:#5f5f5f;color:rgba(0,0,0,.8)}.layui-nav .layui-nav-child a:hover{background-color:#f6f6f6;color:rgba(0,0,0,.8)}.layui-nav-child dd{margin:1px 0;position:relative}.layui-nav-child dd.layui-this{background-color:#f6f6f6;color:#000}.layui-nav-child dd.layui-this:after{display:none}.layui-nav-child-r{left:auto;right:0}.layui-nav-child-c{text-align:center}.layui-nav-tree{width:200px;padding:0}.layui-nav-tree .layui-nav-item{display:block;width:100%;line-height:40px}.layui-nav-tree .layui-nav-item a{position:relative;height:40px;line-height:40px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-nav-tree .layui-nav-item>a{padding-top:5px;padding-bottom:5px}.layui-nav-tree .layui-nav-more{right:15px}.layui-nav-tree .layui-nav-item>a .layui-nav-more{padding:5px 0}.layui-nav-tree .layui-nav-bar{width:5px;height:0}.layui-side .layui-nav-tree .layui-nav-bar{width:2px}.layui-nav-tree .layui-nav-child dd.layui-this,.layui-nav-tree .layui-nav-child dd.layui-this a,.layui-nav-tree .layui-this,.layui-nav-tree .layui-this>a,.layui-nav-tree .layui-this>a:hover{background-color:#009688;color:#fff}.layui-nav-tree .layui-this:after{display:none}.layui-nav-itemed>a,.layui-nav-tree .layui-nav-title a,.layui-nav-tree .layui-nav-title a:hover{color:#fff!important}.layui-nav-tree .layui-nav-bar{background-color:#009688}.layui-nav-tree .layui-nav-child{position:relative;z-index:0;top:0;border:none;box-shadow:none}.layui-nav-tree .layui-nav-child dd{margin:0}.layui-nav-tree .layui-nav-child a{color:#fff;color:rgba(255,255,255,.7)}.layui-nav-tree .layui-nav-child,.layui-nav-tree .layui-nav-child a:hover{background:0 0;color:#fff}.layui-nav-itemed>.layui-nav-child{display:block;background-color:rgba(0,0,0,.3)!important}.layui-nav-itemed>.layui-nav-child>.layui-this>.layui-nav-child{display:block}.layui-nav-side{position:fixed;top:0;bottom:0;left:0;overflow-x:hidden;z-index:999}.layui-nav-tree.layui-bg-gray a,.layui-nav.layui-bg-gray .layui-nav-item a{color:rgba(0,0,0,.8)}.layui-nav-tree.layui-bg-gray{padding:6px 0}.layui-nav-tree.layui-bg-gray .layui-nav-itemed>a{color:#000!important}.layui-nav.layui-bg-gray .layui-this a{color:#5fb878}.layui-nav-tree.layui-bg-gray .layui-nav-itemed>.layui-nav-child{padding-left:11px;background:0 0!important}.layui-nav-tree.layui-bg-gray .layui-nav-item>a{padding-top:0;padding-bottom:0}.layui-nav-tree.layui-bg-gray .layui-nav-item>a .layui-nav-more{padding:0}.layui-nav-tree.layui-bg-gray .layui-nav-child dd.layui-this,.layui-nav-tree.layui-bg-gray .layui-nav-child dd.layui-this a,.layui-nav-tree.layui-bg-gray .layui-this,.layui-nav-tree.layui-bg-gray .layui-this>a{background:0 0!important;color:#5fb878!important;font-weight:700}.layui-nav-tree.layui-bg-gray .layui-nav-bar{background-color:#5fb878}.layui-breadcrumb{visibility:hidden;font-size:0}.layui-breadcrumb>*{font-size:14px}.layui-breadcrumb a{color:#999!important}.layui-breadcrumb a:hover{color:#5fb878!important}.layui-breadcrumb a cite{color:#5f5f5f;font-style:normal}.layui-breadcrumb span[lay-separator]{margin:0 10px;color:#999}.layui-tab{margin:10px 0;text-align:left!important}.layui-tab[overflow]>.layui-tab-title{overflow:hidden}.layui-tab-title{position:relative;left:0;height:40px;white-space:nowrap;font-size:0;border-bottom-width:1px;border-bottom-style:solid;transition:all .2s;-webkit-transition:all .2s}.layui-tab-title li{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;font-size:14px;transition:all .2s;-webkit-transition:all .2s}.layui-tab-title li{position:relative;line-height:40px;min-width:65px;padding:0 15px;text-align:center;cursor:pointer}.layui-tab-title li a{display:block;padding:0 15px;margin:0 -15px}.layui-tab-title .layui-this{color:#000}.layui-tab-title .layui-this:after{position:absolute;left:0;top:0;content:"";width:100%;height:41px;border-width:1px;border-style:solid;border-bottom-color:#fff;border-radius:2px 2px 0 0;box-sizing:border-box;pointer-events:none}.layui-tab-bar{position:absolute;right:0;top:0;z-index:10;width:30px;height:39px;line-height:39px;border-width:1px;border-style:solid;border-radius:2px;text-align:center;background-color:#fff;cursor:pointer}.layui-tab-bar .layui-icon{position:relative;display:inline-block;top:3px;transition:all .3s;-webkit-transition:all .3s}.layui-tab-item{display:none}.layui-tab-more{padding-right:30px;height:auto!important;white-space:normal!important}.layui-tab-more li.layui-this:after{border-bottom-color:#eee;border-radius:2px}.layui-tab-more .layui-tab-bar .layui-icon{top:-2px;top:3px\0;-webkit-transform:rotate(180deg);transform:rotate(180deg)}:root .layui-tab-more .layui-tab-bar .layui-icon{top:-2px\0/IE9}.layui-tab-content{padding:15px 0}.layui-tab-title li .layui-tab-close{position:relative;display:inline-block;width:18px;height:18px;line-height:20px;margin-left:8px;top:1px;text-align:center;font-size:14px;color:#c2c2c2;transition:all .2s;-webkit-transition:all .2s}.layui-tab-title li .layui-tab-close:hover{border-radius:2px;background-color:#ff5722;color:#fff}.layui-tab-brief>.layui-tab-title .layui-this{color:#009688}.layui-tab-brief>.layui-tab-more li.layui-this:after,.layui-tab-brief>.layui-tab-title .layui-this:after{border:none;border-radius:0;border-bottom:2px solid #5fb878}.layui-tab-brief[overflow]>.layui-tab-title .layui-this:after{top:-1px}.layui-tab-card{border-width:1px;border-style:solid;border-radius:2px;box-shadow:0 2px 5px 0 rgba(0,0,0,.1)}.layui-tab-card>.layui-tab-title{background-color:#fafafa}.layui-tab-card>.layui-tab-title li{margin-right:-1px;margin-left:-1px}.layui-tab-card>.layui-tab-title .layui-this{background-color:#fff}.layui-tab-card>.layui-tab-title .layui-this:after{border-top:none;border-width:1px;border-bottom-color:#fff}.layui-tab-card>.layui-tab-title .layui-tab-bar{height:40px;line-height:40px;border-radius:0;border-top:none;border-right:none}.layui-tab-card>.layui-tab-more .layui-this{background:0 0;color:#5fb878}.layui-tab-card>.layui-tab-more .layui-this:after{border:none}.layui-timeline{padding-left:5px}.layui-timeline-item{position:relative;padding-bottom:20px}.layui-timeline-axis{position:absolute;left:-5px;top:0;z-index:10;width:20px;height:20px;line-height:20px;background-color:#fff;color:#5fb878;border-radius:50%;text-align:center;cursor:pointer}.layui-timeline-axis:hover{color:#ff5722}.layui-timeline-item:before{content:"";position:absolute;left:5px;top:0;z-index:0;width:1px;height:100%}.layui-timeline-item:first-child:before{display:block}.layui-timeline-item:last-child:before{display:none}.layui-timeline-content{padding-left:25px}.layui-timeline-title{position:relative;margin-bottom:10px;line-height:22px}.layui-badge,.layui-badge-dot,.layui-badge-rim{position:relative;display:inline-block;padding:0 6px;font-size:12px;text-align:center;background-color:#ff5722;color:#fff;border-radius:2px}.layui-badge{height:18px;line-height:18px}.layui-badge-dot{width:8px;height:8px;padding:0;border-radius:50%}.layui-badge-rim{height:18px;line-height:18px;border-width:1px;border-style:solid;background-color:#fff;color:#5f5f5f}.layui-btn .layui-badge,.layui-btn .layui-badge-dot{margin-left:5px}.layui-nav .layui-badge,.layui-nav .layui-badge-dot{position:absolute;top:50%;margin:-5px 6px 0}.layui-nav .layui-badge{margin-top:-10px}.layui-tab-title .layui-badge,.layui-tab-title .layui-badge-dot{left:5px;top:-2px}.layui-carousel{position:relative;left:0;top:0;background-color:#f8f8f8}.layui-carousel>[carousel-item]{position:relative;width:100%;height:100%;overflow:hidden}.layui-carousel>[carousel-item]:before{position:absolute;content:'\e63d';left:50%;top:50%;width:100px;line-height:20px;margin:-10px 0 0 -50px;text-align:center;color:#c2c2c2;font-family:layui-icon!important;font-size:30px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.layui-carousel>[carousel-item]>*{display:none;position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f8f8f8;transition-duration:.3s;-webkit-transition-duration:.3s}.layui-carousel-updown>*{-webkit-transition:.3s ease-in-out up;transition:.3s ease-in-out up}.layui-carousel-arrow{display:none\0;opacity:0;position:absolute;left:10px;top:50%;margin-top:-18px;width:36px;height:36px;line-height:36px;text-align:center;font-size:20px;border:none 0;border-radius:50%;background-color:rgba(0,0,0,.2);color:#fff;-webkit-transition-duration:.3s;transition-duration:.3s;cursor:pointer}.layui-carousel-arrow[lay-type=add]{left:auto!important;right:10px}.layui-carousel[lay-arrow=always] .layui-carousel-arrow{opacity:1;left:20px}.layui-carousel[lay-arrow=always] .layui-carousel-arrow[lay-type=add]{right:20px}.layui-carousel[lay-arrow=none] .layui-carousel-arrow{display:none}.layui-carousel-arrow:hover,.layui-carousel-ind ul:hover{background-color:rgba(0,0,0,.35)}.layui-carousel:hover .layui-carousel-arrow{display:block\0;opacity:1;left:20px}.layui-carousel:hover .layui-carousel-arrow[lay-type=add]{right:20px}.layui-carousel-ind{position:relative;top:-35px;width:100%;line-height:0!important;text-align:center;font-size:0}.layui-carousel[lay-indicator=outside]{margin-bottom:30px}.layui-carousel[lay-indicator=outside] .layui-carousel-ind{top:10px}.layui-carousel[lay-indicator=outside] .layui-carousel-ind ul{background-color:rgba(0,0,0,.5)}.layui-carousel[lay-indicator=none] .layui-carousel-ind{display:none}.layui-carousel-ind ul{display:inline-block;padding:5px;background-color:rgba(0,0,0,.2);border-radius:10px;-webkit-transition-duration:.3s;transition-duration:.3s}.layui-carousel-ind li{display:inline-block;width:10px;height:10px;margin:0 3px;font-size:14px;background-color:#eee;background-color:rgba(255,255,255,.5);border-radius:50%;cursor:pointer;-webkit-transition-duration:.3s;transition-duration:.3s}.layui-carousel-ind li:hover{background-color:rgba(255,255,255,.7)}.layui-carousel-ind li.layui-this{background-color:#fff}.layui-carousel>[carousel-item]>.layui-carousel-next,.layui-carousel>[carousel-item]>.layui-carousel-prev,.layui-carousel>[carousel-item]>.layui-this{display:block}.layui-carousel>[carousel-item]>.layui-this{left:0}.layui-carousel>[carousel-item]>.layui-carousel-prev{left:-100%}.layui-carousel>[carousel-item]>.layui-carousel-next{left:100%}.layui-carousel>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel>[carousel-item]>.layui-carousel-prev.layui-carousel-right{left:0}.layui-carousel>[carousel-item]>.layui-this.layui-carousel-left{left:-100%}.layui-carousel>[carousel-item]>.layui-this.layui-carousel-right{left:100%}.layui-carousel[lay-anim=updown] .layui-carousel-arrow{left:50%!important;top:20px;margin:0 0 0 -18px}.layui-carousel[lay-anim=updown] .layui-carousel-arrow[lay-type=add]{top:auto!important;bottom:20px}.layui-carousel[lay-anim=updown] .layui-carousel-ind{position:absolute;top:50%;right:20px;width:auto;height:auto}.layui-carousel[lay-anim=updown] .layui-carousel-ind ul{padding:3px 5px}.layui-carousel[lay-anim=updown] .layui-carousel-ind li{display:block;margin:6px 0}.layui-carousel[lay-anim=updown]>[carousel-item]>*{left:0!important}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this{top:0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-prev{top:-100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-next{top:100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-prev.layui-carousel-right{top:0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this.layui-carousel-left{top:-100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this.layui-carousel-right{top:100%}.layui-carousel[lay-anim=fade]>[carousel-item]>*{left:0!important}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-next,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-prev{opacity:0}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-prev.layui-carousel-right{opacity:1}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-this.layui-carousel-left,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-this.layui-carousel-right{opacity:0}.layui-fixbar{position:fixed;right:15px;bottom:15px;z-index:999999}.layui-fixbar li{width:50px;height:50px;line-height:50px;margin-bottom:1px;text-align:center;cursor:pointer;font-size:30px;background-color:#9f9f9f;color:#fff;border-radius:2px;opacity:.95}.layui-fixbar li:hover{opacity:.85}.layui-fixbar li:active{opacity:1}.layui-fixbar .layui-fixbar-top{display:none;font-size:40px}body .layui-util-face{border:none;background:0 0}body .layui-util-face .layui-layer-content{padding:0;background-color:#fff;color:#5f5f5f;box-shadow:none}.layui-util-face .layui-layer-TipsG{display:none}.layui-util-face ul{position:relative;width:372px;padding:10px;border:1px solid #d9d9d9;background-color:#fff;box-shadow:0 0 20px rgba(0,0,0,.2)}.layui-util-face ul li{cursor:pointer;float:left;border:1px solid #e8e8e8;height:22px;width:26px;overflow:hidden;margin:-1px 0 0 -1px;padding:4px 2px;text-align:center}.layui-util-face ul li:hover{position:relative;z-index:2;border:1px solid #eb7350;background:#fff9ec}.layui-code{position:relative;margin:10px 0;padding:15px;line-height:20px;border:1px solid #eee;border-left-width:6px;background-color:#fafafa;color:#333;font-family:Courier New;font-size:12px}.layui-transfer-box,.layui-transfer-header,.layui-transfer-search{border-width:0;border-style:solid;border-color:#eee}.layui-transfer-box{position:relative;display:inline-block;vertical-align:middle;border-width:1px;width:200px;height:360px;border-radius:2px;background-color:#fff}.layui-transfer-box .layui-form-checkbox{width:100%;margin:0!important}.layui-transfer-header{height:38px;line-height:38px;padding:0 10px;border-bottom-width:1px}.layui-transfer-search{position:relative;padding:10px;border-bottom-width:1px}.layui-transfer-search .layui-input{height:32px;padding-left:30px;font-size:12px}.layui-transfer-search .layui-icon-search{position:absolute;left:20px;top:50%;margin-top:-8px;color:#5f5f5f}.layui-transfer-active{margin:0 15px;display:inline-block;vertical-align:middle}.layui-transfer-active .layui-btn{display:block;margin:0;padding:0 15px;background-color:#5fb878;border-color:#5fb878;color:#fff}.layui-transfer-active .layui-btn-disabled{background-color:#fbfbfb;border-color:#eee;color:#d2d2d2}.layui-transfer-active .layui-btn:first-child{margin-bottom:15px}.layui-transfer-active .layui-btn .layui-icon{margin:0;font-size:14px!important}.layui-transfer-data{padding:5px 0;overflow:auto}.layui-transfer-data li{height:32px;line-height:32px;padding:0 10px}.layui-transfer-data li:hover{background-color:#f6f6f6;transition:.5s all}.layui-transfer-data .layui-none{padding:15px 10px;text-align:center;color:#999}.layui-rate,.layui-rate *{display:inline-block;vertical-align:middle}.layui-rate{padding:10px 5px 10px 0;font-size:0}.layui-rate li i.layui-icon{font-size:20px;color:#ffb800}.layui-rate li i.layui-icon{margin-right:5px;transition:all .3s;-webkit-transition:all .3s}.layui-rate li i:hover{cursor:pointer;transform:scale(1.12);-webkit-transform:scale(1.12)}.layui-rate[readonly] li i:hover{cursor:default;transform:scale(1)}.layui-colorpicker{width:38px;height:38px;border:1px solid #eee;padding:5px;border-radius:2px;line-height:24px;display:inline-block;cursor:pointer;transition:all .3s;-webkit-transition:all .3s;box-sizing:border-box}.layui-colorpicker:hover{border-color:#d2d2d2}.layui-colorpicker.layui-colorpicker-lg{width:44px;height:44px;line-height:30px}.layui-colorpicker.layui-colorpicker-sm{width:30px;height:30px;line-height:20px;padding:3px}.layui-colorpicker.layui-colorpicker-xs{width:22px;height:22px;line-height:16px;padding:1px}.layui-colorpicker-trigger-bgcolor{display:block;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);border-radius:2px}.layui-colorpicker-trigger-span{display:block;height:100%;box-sizing:border-box;border:1px solid rgba(0,0,0,.15);border-radius:2px;text-align:center}.layui-colorpicker-trigger-i{display:inline-block;color:#fff;font-size:12px}.layui-colorpicker-trigger-i.layui-icon-close{color:#999}.layui-colorpicker-main{position:absolute;left:-999999px;top:-999999px;z-index:77777777;width:280px;margin:5px 0;padding:7px;background:#fff;border:1px solid #d2d2d2;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.12)}.layui-colorpicker-main-wrapper{height:180px;position:relative}.layui-colorpicker-basis{width:260px;height:100%;position:relative}.layui-colorpicker-basis-white{width:100%;height:100%;position:absolute;top:0;left:0;background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.layui-colorpicker-basis-black{width:100%;height:100%;position:absolute;top:0;left:0;background:linear-gradient(0deg,#000,transparent)}.layui-colorpicker-basis-cursor{width:10px;height:10px;border:1px solid #fff;border-radius:50%;position:absolute;top:-3px;right:-3px;cursor:pointer}.layui-colorpicker-side{position:absolute;top:0;right:0;width:12px;height:100%;background:linear-gradient(red,#ff0,#0f0,#0ff,#00f,#f0f,red)}.layui-colorpicker-side-slider{width:100%;height:5px;box-shadow:0 0 1px #888;box-sizing:border-box;background:#fff;border-radius:1px;border:1px solid #f0f0f0;cursor:pointer;position:absolute;left:0}.layui-colorpicker-main-alpha{display:none;height:12px;margin-top:7px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.layui-colorpicker-alpha-bgcolor{height:100%;position:relative}.layui-colorpicker-alpha-slider{width:5px;height:100%;box-shadow:0 0 1px #888;box-sizing:border-box;background:#fff;border-radius:1px;border:1px solid #f0f0f0;cursor:pointer;position:absolute;top:0}.layui-colorpicker-main-pre{padding-top:7px;font-size:0}.layui-colorpicker-pre{width:20px;height:20px;border-radius:2px;display:inline-block;margin-left:6px;margin-bottom:7px;cursor:pointer}.layui-colorpicker-pre:nth-child(11n+1){margin-left:0}.layui-colorpicker-pre-isalpha{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.layui-colorpicker-pre.layui-this{box-shadow:0 0 3px 2px rgba(0,0,0,.15)}.layui-colorpicker-pre>div{height:100%;border-radius:2px}.layui-colorpicker-main-input{text-align:right;padding-top:7px}.layui-colorpicker-main-input .layui-btn-container .layui-btn{margin:0 0 0 10px}.layui-colorpicker-main-input div.layui-inline{float:left;margin-right:10px;font-size:14px}.layui-colorpicker-main-input input.layui-input{width:150px;height:30px;color:#5f5f5f}.layui-slider{height:4px;background:#eee;border-radius:3px;position:relative;cursor:pointer}.layui-slider-bar{border-radius:3px;position:absolute;height:100%}.layui-slider-step{position:absolute;top:0;width:4px;height:4px;border-radius:50%;background:#fff;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.layui-slider-wrap{width:36px;height:36px;position:absolute;top:-16px;-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:10;text-align:center}.layui-slider-wrap-btn{width:12px;height:12px;border-radius:50%;background:#fff;display:inline-block;vertical-align:middle;cursor:pointer;transition:.3s}.layui-slider-wrap:after{content:"";height:100%;display:inline-block;vertical-align:middle}.layui-slider-wrap-btn.layui-slider-hover,.layui-slider-wrap-btn:hover{transform:scale(1.2)}.layui-slider-wrap-btn.layui-disabled:hover{transform:scale(1)!important}.layui-slider-tips{position:absolute;top:-42px;z-index:77777777;white-space:nowrap;display:none;-webkit-transform:translateX(-50%);transform:translateX(-50%);color:#fff;background:#000;border-radius:3px;height:25px;line-height:25px;padding:0 10px}.layui-slider-tips:after{content:"";position:absolute;bottom:-12px;left:50%;margin-left:-6px;width:0;height:0;border-width:6px;border-style:solid;border-color:#000 transparent transparent transparent}.layui-slider-input{width:70px;height:32px;border:1px solid #eee;border-radius:3px;font-size:16px;line-height:32px;position:absolute;right:0;top:-14px}.layui-slider-input-btn{position:absolute;top:0;right:0;width:20px;height:100%;border-left:1px solid #eee}.layui-slider-input-btn i{cursor:pointer;position:absolute;right:0;bottom:0;width:20px;height:50%;font-size:12px;line-height:16px;text-align:center;color:#999}.layui-slider-input-btn i:first-child{top:0;border-bottom:1px solid #eee}.layui-slider-input-txt{height:100%;font-size:14px}.layui-slider-input-txt input{height:100%;border:none}.layui-slider-input-btn i:hover{color:#009688}.layui-slider-vertical{width:4px;margin-left:33px}.layui-slider-vertical .layui-slider-bar{width:4px}.layui-slider-vertical .layui-slider-step{top:auto;left:0;-webkit-transform:translateY(50%);transform:translateY(50%)}.layui-slider-vertical .layui-slider-wrap{top:auto;left:-16px;-webkit-transform:translateY(50%);transform:translateY(50%)}.layui-slider-vertical .layui-slider-tips{top:auto;left:2px}@media \0screen{.layui-slider-wrap-btn{margin-left:-20px}.layui-slider-vertical .layui-slider-wrap-btn{margin-left:0;margin-bottom:-20px}.layui-slider-vertical .layui-slider-tips{margin-left:-8px}.layui-slider>span{margin-left:8px}}.layui-tree{line-height:22px}.layui-tree .layui-form-checkbox{margin:0!important}.layui-tree-set{width:100%;position:relative}.layui-tree-pack{display:none;padding-left:20px;position:relative}.layui-tree-line .layui-tree-pack{padding-left:27px}.layui-tree-line .layui-tree-set .layui-tree-set:after{content:"";position:absolute;top:14px;left:-9px;width:17px;height:0;border-top:1px dotted #c0c4cc}.layui-tree-entry{position:relative;padding:3px 0;height:20px;white-space:nowrap}.layui-tree-entry:hover{background-color:#eee}.layui-tree-line .layui-tree-entry:hover{background-color:rgba(0,0,0,0)}.layui-tree-line .layui-tree-entry:hover .layui-tree-txt{color:#999;text-decoration:underline;transition:.3s}.layui-tree-main{display:inline-block;vertical-align:middle;cursor:pointer;padding-right:10px}.layui-tree-line .layui-tree-set:before{content:"";position:absolute;top:0;left:-9px;width:0;height:100%;border-left:1px dotted #c0c4cc}.layui-tree-line .layui-tree-set.layui-tree-setLineShort:before{height:13px}.layui-tree-line .layui-tree-set.layui-tree-setHide:before{height:0}.layui-tree-iconClick{display:inline-block;vertical-align:middle;position:relative;height:20px;line-height:20px;margin:0 10px;color:#c0c4cc}.layui-tree-icon{height:12px;line-height:12px;width:12px;text-align:center;border:1px solid #c0c4cc}.layui-tree-iconClick .layui-icon{font-size:18px}.layui-tree-icon .layui-icon{font-size:12px;color:#5f5f5f}.layui-tree-iconArrow{padding:0 5px}.layui-tree-iconArrow:after{content:"";position:absolute;left:4px;top:3px;z-index:100;width:0;height:0;border-width:5px;border-style:solid;border-color:transparent transparent transparent #c0c4cc;transition:.5s}.layui-tree-spread>.layui-tree-entry .layui-tree-iconClick>.layui-tree-iconArrow:after{transform:rotate(90deg) translate(3px,4px)}.layui-tree-txt{display:inline-block;vertical-align:middle;color:#555}.layui-tree-search{margin-bottom:15px;color:#5f5f5f}.layui-tree-btnGroup{visibility:hidden;display:inline-block;vertical-align:middle;position:relative}.layui-tree-btnGroup .layui-icon{display:inline-block;vertical-align:middle;padding:0 2px;cursor:pointer}.layui-tree-btnGroup .layui-icon:hover{color:#999;transition:.3s}.layui-tree-entry:hover .layui-tree-btnGroup{visibility:visible}.layui-tree-editInput{position:relative;display:inline-block;vertical-align:middle;height:20px;line-height:20px;padding:0 3px;border:none;background-color:rgba(0,0,0,.05)}.layui-tree-emptyText{text-align:center;color:#999}.layui-anim{-webkit-animation-duration:.3s;-webkit-animation-fill-mode:both;animation-duration:.3s;animation-fill-mode:both}.layui-anim.layui-icon{display:inline-block}.layui-anim-loop{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.layui-trans,.layui-trans a{transition:all .2s;-webkit-transition:all .2s}@-webkit-keyframes layui-rotate{from{-webkit-transform:rotate(0)}to{-webkit-transform:rotate(360deg)}}@keyframes layui-rotate{from{transform:rotate(0)}to{transform:rotate(360deg)}}.layui-anim-rotate{-webkit-animation-name:layui-rotate;animation-name:layui-rotate;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:linear;animation-timing-function:linear}@-webkit-keyframes layui-up{from{-webkit-transform:translate3d(0,100%,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes layui-up{from{transform:translate3d(0,100%,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.layui-anim-up{-webkit-animation-name:layui-up;animation-name:layui-up}@-webkit-keyframes layui-upbit{from{-webkit-transform:translate3d(0,15px,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes layui-upbit{from{transform:translate3d(0,15px,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.layui-anim-upbit{-webkit-animation-name:layui-upbit;animation-name:layui-upbit}@keyframes layui-down{0%{opacity:.3;transform:translate3d(0,-100%,0)}100%{opacity:1;transform:translate3d(0,0,0)}}.layui-anim-down{animation-name:layui-down}@keyframes layui-downbit{0%{opacity:.3;transform:translate3d(0,-5px,0)}100%{opacity:1;transform:translate3d(0,0,0)}}.layui-anim-downbit{animation-name:layui-downbit}@-webkit-keyframes layui-scale{0%{opacity:.3;-webkit-transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1)}}@keyframes layui-scale{0%{opacity:.3;-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-ms-transform:scale(1);transform:scale(1)}}.layui-anim-scale{-webkit-animation-name:layui-scale;animation-name:layui-scale}@-webkit-keyframes layui-scale-spring{0%{opacity:.5;-webkit-transform:scale(.5)}80%{opacity:.8;-webkit-transform:scale(1.1)}100%{opacity:1;-webkit-transform:scale(1)}}@keyframes layui-scale-spring{0%{opacity:.5;transform:scale(.5)}80%{opacity:.8;transform:scale(1.1)}100%{opacity:1;transform:scale(1)}}.layui-anim-scaleSpring{-webkit-animation-name:layui-scale-spring;animation-name:layui-scale-spring}@keyframes layui-scalesmall{0%{opacity:.3;transform:scale(1.5)}100%{opacity:1;transform:scale(1)}}.layui-anim-scalesmall{animation-name:layui-scalesmall}@keyframes layui-scalesmall-spring{0%{opacity:.3;transform:scale(1.5)}80%{opacity:.8;transform:scale(.9)}100%{opacity:1;transform:scale(1)}}.layui-anim-scalesmall-spring{animation-name:layui-scalesmall-spring}@-webkit-keyframes layui-fadein{0%{opacity:0}100%{opacity:1}}@keyframes layui-fadein{0%{opacity:0}100%{opacity:1}}.layui-anim-fadein{-webkit-animation-name:layui-fadein;animation-name:layui-fadein}@-webkit-keyframes layui-fadeout{0%{opacity:1}100%{opacity:0}}@keyframes layui-fadeout{0%{opacity:1}100%{opacity:0}}.layui-anim-fadeout{-webkit-animation-name:layui-fadeout;animation-name:layui-fadeout}html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-view{display:block;position:relative;margin:10px 0;padding:0;border:1px solid #eee;border-left-width:6px;background-color:#fafafa;color:#333;font-family:Courier New;font-size:13px}.layui-code-title{position:relative;padding:0 10px;height:40px;line-height:40px;border-bottom:1px solid #eee;font-size:12px}.layui-code-title>.layui-code-about{position:absolute;right:10px;top:0;color:#b7b7b7}.layui-code-about>a{padding-left:10px}.layui-code-view>.layui-code-ol,.layui-code-view>.layui-code-ul{position:relative;overflow:auto}.layui-code-view>.layui-code-ol>li{position:relative;margin-left:45px;line-height:20px;padding:0 10px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view>.layui-code-ol>li:first-child,.layui-code-view>.layui-code-ul>li:first-child{padding-top:10px}.layui-code-view>.layui-code-ol>li:last-child,.layui-code-view>.layui-code-ul>li:last-child{padding-bottom:10px}.layui-code-view>.layui-code-ul>li{position:relative;line-height:20px;padding:0 10px;list-style-type:none;*list-style-type:none;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-dark{border:1px solid #0c0c0c;border-left-color:#3f3f3f;background-color:#0c0c0c;color:#c2be9e}.layui-code-dark>.layui-code-title{border-bottom:none}.layui-code-dark>.layui-code-ol>li,.layui-code-dark>.layui-code-ul>li{background-color:#3f3f3f;border-left:none}.layui-code-dark>.layui-code-ul>li{margin-left:6px}.layui-code-demo .layui-code{visibility:visible!important;margin:-15px;border-top:none;border-right:none;border-bottom:none}.layui-code-demo .layui-tab-content{padding:15px;border-top:none}html #layuicss-laydate{display:none;position:absolute;width:1989px}.layui-laydate *{margin:0;padding:0}.layui-laydate,.layui-laydate *{box-sizing:border-box}.layui-laydate{position:absolute;z-index:66666666;margin:5px 0;border-radius:2px;font-size:14px;-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.layui-laydate-main{width:272px}.layui-laydate-content td,.layui-laydate-header *,.layui-laydate-list li{transition-duration:.3s;-webkit-transition-duration:.3s}.layui-laydate-shade{top:0;left:0;width:100%;height:100%;_height:expression(document.body.offsetHeight+"px");position:fixed;_position:absolute;pointer-events:auto}@keyframes laydate-downbit{0%{opacity:.3;transform:translate3d(0,-5px,0)}100%{opacity:1;transform:translate3d(0,0,0)}}.layui-laydate{animation-name:laydate-downbit}.layui-laydate-static{position:relative;z-index:0;display:inline-block;margin:0;-webkit-animation:none;animation:none}.laydate-ym-show .laydate-next-m,.laydate-ym-show .laydate-prev-m{display:none!important}.laydate-ym-show .laydate-next-y,.laydate-ym-show .laydate-prev-y{display:inline-block!important}.laydate-ym-show .laydate-set-ym span[lay-type=month]{display:none!important}.laydate-time-show .laydate-set-ym span[lay-type=month],.laydate-time-show .laydate-set-ym span[lay-type=year],.laydate-time-show .layui-laydate-header .layui-icon{display:none!important}.layui-laydate-header{position:relative;line-height:30px;padding:10px 70px 5px}.layui-laydate-header *{display:inline-block;vertical-align:bottom}.layui-laydate-header i{position:absolute;top:10px;padding:0 5px;color:#999;font-size:18px;cursor:pointer}.layui-laydate-header i.laydate-prev-y{left:15px}.layui-laydate-header i.laydate-prev-m{left:45px}.layui-laydate-header i.laydate-next-y{right:15px}.layui-laydate-header i.laydate-next-m{right:45px}.laydate-set-ym{width:100%;text-align:center;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.laydate-set-ym span{padding:0 10px;cursor:pointer}.laydate-time-text{cursor:default!important}.layui-laydate-content{position:relative;padding:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-laydate-content table{border-collapse:collapse;border-spacing:0}.layui-laydate-content td,.layui-laydate-content th{width:36px;height:30px;padding:0;text-align:center}.layui-laydate-content th{font-weight:400}.layui-laydate-content td{position:relative;cursor:pointer}.laydate-day-mark{position:absolute;left:0;top:0;width:100%;line-height:30px;font-size:12px;overflow:hidden}.laydate-day-mark::after{position:absolute;content:'';right:2px;top:2px;width:5px;height:5px;border-radius:50%}.laydate-day-holidays:before{position:absolute;left:0;top:0;font-size:12px;transform:scale(.7)}.laydate-day-holidays:before{content:'\4F11';color:#ff5722}.laydate-day-holidays[type=work]:before{content:'\73ED';color:inherit}.layui-laydate .layui-this .laydate-day-holidays:before{color:#fff}.layui-laydate-footer{position:relative;height:46px;line-height:26px;padding:10px}.layui-laydate-footer span{display:inline-block;vertical-align:top;height:26px;line-height:24px;padding:0 10px;border:1px solid #c9c9c9;border-radius:2px;background-color:#fff;font-size:12px;cursor:pointer;white-space:nowrap;transition:all .3s}.layui-laydate-footer span:hover{color:#5fb878}.layui-laydate-footer span.layui-laydate-preview{cursor:default;border-color:transparent!important}.layui-laydate-footer span.layui-laydate-preview:hover{color:#666}.layui-laydate-footer span:first-child.layui-laydate-preview{padding-left:0}.laydate-footer-btns{position:absolute;right:10px;top:10px}.laydate-footer-btns span{margin:0 0 0 -1px}.layui-laydate-shortcut{width:80px;padding:6px 0;display:inline-block;vertical-align:top;overflow:auto;max-height:276px}.layui-laydate-shortcut+.layui-laydate-main{display:inline-block;border-left:1px solid #e2e2e2}.layui-laydate-shortcut>li{padding:5px 8px;cursor:pointer;line-height:18px}.layui-laydate-list{position:absolute;left:0;top:0;width:100%;height:100%;padding:10px;box-sizing:border-box;background-color:#fff}.layui-laydate-list>li{position:relative;display:inline-block;width:33.3%;height:36px;line-height:36px;margin:3px 0;vertical-align:middle;text-align:center;cursor:pointer}.laydate-month-list>li{width:25%;margin:17px 0}.laydate-time-list>li{height:100%;margin:0;line-height:normal;cursor:default}.laydate-time-list p{position:relative;top:-4px;line-height:29px}.laydate-time-list ol{height:181px;overflow:hidden}.laydate-time-list>li:hover ol{overflow-y:auto}.laydate-time-list ol li{width:130%;padding-left:33px;height:30px;line-height:30px;text-align:left;cursor:pointer}.layui-laydate-hint{position:absolute;top:115px;left:50%;width:250px;margin-left:-125px;line-height:20px;padding:15px;text-align:center;font-size:12px;color:#ff5722}.layui-laydate-range{width:546px}.layui-laydate-range .layui-laydate-main{display:inline-block;vertical-align:middle;max-width:50%}.layui-laydate-range .laydate-main-list-1 .layui-laydate-content,.layui-laydate-range .laydate-main-list-1 .layui-laydate-header{border-left:1px solid #e2e2e2}.layui-laydate-range.layui-laydate-linkage .laydate-main-list-0 .laydate-next-m,.layui-laydate-range.layui-laydate-linkage .laydate-main-list-0 .laydate-next-y,.layui-laydate-range.layui-laydate-linkage .laydate-main-list-1 .laydate-prev-m,.layui-laydate-range.layui-laydate-linkage .laydate-main-list-1 .laydate-prev-y{display:none}.layui-laydate,.layui-laydate-hint{border:1px solid #d2d2d2;box-shadow:0 2px 4px rgba(0,0,0,.12);background-color:#fff;color:#777}.layui-laydate-header{border-bottom:1px solid #e2e2e2}.layui-laydate-header i:hover,.layui-laydate-header span:hover{color:#5fb878}.layui-laydate-content{border-top:none 0;border-bottom:none 0}.layui-laydate-content th{color:#333}.layui-laydate-content td{color:#777}.layui-laydate-content td.laydate-day-now{color:#5fb878}.layui-laydate-content td.laydate-day-now:after{content:'';position:absolute;width:100%;height:30px;left:0;top:0;border:1px solid #5fb878;box-sizing:border-box}.layui-laydate-linkage .layui-laydate-content td.laydate-selected>div{background-color:#00f7de}.layui-laydate-linkage .laydate-selected:hover>div{background-color:#00f7de!important}.layui-laydate-content td.laydate-selected:after,.layui-laydate-content td:hover:after{content:none}.layui-laydate-content td>div:hover,.layui-laydate-list li:hover,.layui-laydate-shortcut>li:hover{background-color:#eee;color:#333}.laydate-time-list li ol{margin:0;padding:0;border:1px solid #e2e2e2;border-left-width:0}.laydate-time-list li:first-child ol{border-left-width:1px}.laydate-time-list>li:hover{background:0 0}.layui-laydate-content .laydate-day-next,.layui-laydate-content .laydate-day-prev{color:#d2d2d2}.layui-laydate-linkage .laydate-selected.laydate-day-next>div,.layui-laydate-linkage .laydate-selected.laydate-day-prev>div{background-color:#f8f8f8!important}.layui-laydate-footer{border-top:1px solid #e2e2e2}.layui-laydate-hint{color:#ff5722}.laydate-day-mark::after{background-color:#5fb878}.layui-laydate-content td.layui-this .laydate-day-mark::after{display:none}.layui-laydate-footer span[lay-type=date]{color:#5fb878}.layui-laydate .layui-this,.layui-laydate .layui-this>div{background-color:#009688!important;color:#fff!important}.layui-laydate .laydate-disabled,.layui-laydate .laydate-disabled:hover{background:0 0!important;color:#d2d2d2!important;cursor:not-allowed!important;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-laydate-content td>div{padding:7px 0;height:100%}.laydate-theme-molv{border:none}.laydate-theme-molv.layui-laydate-range{width:548px}.laydate-theme-molv .layui-laydate-main{width:274px}.laydate-theme-molv .layui-laydate-header{border:none;background-color:#009688}.laydate-theme-molv .layui-laydate-header i,.laydate-theme-molv .layui-laydate-header span{color:#f6f6f6}.laydate-theme-molv .layui-laydate-header i:hover,.laydate-theme-molv .layui-laydate-header span:hover{color:#fff}.laydate-theme-molv .layui-laydate-content{border:1px solid #e2e2e2;border-top:none;border-bottom:none}.laydate-theme-molv .laydate-main-list-1 .layui-laydate-content{border-left:none}.laydate-theme-molv .layui-laydate-footer{border:1px solid #e2e2e2}.laydate-theme-grid .laydate-month-list>li,.laydate-theme-grid .laydate-year-list>li,.laydate-theme-grid .layui-laydate-content td,.laydate-theme-grid .layui-laydate-content thead{border:1px solid #e2e2e2}.layui-laydate-linkage.laydate-theme-grid .laydate-selected,.layui-laydate-linkage.laydate-theme-grid .laydate-selected:hover{background-color:#f2f2f2!important;color:#009688!important}.layui-laydate-linkage.laydate-theme-grid .laydate-selected.laydate-day-next,.layui-laydate-linkage.laydate-theme-grid .laydate-selected.laydate-day-prev{color:#d2d2d2!important}.laydate-theme-grid .laydate-month-list,.laydate-theme-grid .laydate-year-list{margin:1px 0 0 1px}.laydate-theme-grid .laydate-month-list>li,.laydate-theme-grid .laydate-year-list>li{margin:0 -1px -1px 0}.laydate-theme-grid .laydate-year-list>li{height:43px;line-height:43px}.laydate-theme-grid .laydate-month-list>li{height:71px;line-height:71px}.laydate-theme-grid .layui-laydate-content td>div{height:29px;margin-top:-1px}.laydate-theme-circle .layui-laydate-content td.layui-this>div,.laydate-theme-circle .layui-laydate-content td>div{width:28px;height:28px;line-height:28px;border-radius:14px;margin:0 4px;padding:0}.layui-laydate.laydate-theme-circle .layui-laydate-content table td.layui-this{background-color:transparent!important}.laydate-theme-grid.laydate-theme-circle .layui-laydate-content td>div{margin:0 3.5px}.laydate-theme-fullpanel .layui-laydate-main{width:526px}.laydate-theme-fullpanel .layui-laydate-list{width:252px;left:272px}.laydate-theme-fullpanel .laydate-set-ym span{display:none}.laydate-theme-fullpanel .laydate-time-show .laydate-set-ym span[lay-type=month],.laydate-theme-fullpanel .laydate-time-show .laydate-set-ym span[lay-type=year],.laydate-theme-fullpanel .laydate-time-show .layui-laydate-header .layui-icon{display:inline-block!important}.laydate-theme-fullpanel .laydate-btns-time{display:none}html #layuicss-layer{display:none;position:absolute;width:1989px}.layui-layer,.layui-layer-shade{position:fixed;_position:absolute;pointer-events:auto}.layui-layer-shade{top:0;left:0;width:100%;height:100%;_height:expression(document.body.offsetHeight+"px")}.layui-layer{-webkit-overflow-scrolling:touch}.layui-layer{top:150px;left:0;margin:0;padding:0;background-color:#fff;-webkit-background-clip:content;border-radius:2px;box-shadow:1px 1px 50px rgba(0,0,0,.3)}.layui-layer-close{position:absolute}.layui-layer-content{position:relative}.layui-layer-border{border:1px solid #b2b2b2;border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 5px rgba(0,0,0,.2)}.layui-layer-btn a,.layui-layer-setwin span{display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-move{display:none;position:fixed;*position:absolute;left:0;top:0;width:100%;height:100%;cursor:move;opacity:0;filter:alpha(opacity=0);background-color:#fff;z-index:2147483647}.layui-layer-resize{position:absolute;width:15px;height:15px;right:0;bottom:0;cursor:se-resize}.layer-anim{-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.3s;animation-duration:.3s}@-webkit-keyframes layer-bounceIn{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes layer-bounceIn{0%{opacity:0;-webkit-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim-00{-webkit-animation-name:layer-bounceIn;animation-name:layer-bounceIn}@-webkit-keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);-ms-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);-ms-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-01{-webkit-animation-name:layer-zoomInDown;animation-name:layer-zoomInDown}@-webkit-keyframes layer-fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes layer-fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.layer-anim-02{-webkit-animation-name:layer-fadeInUpBig;animation-name:layer-fadeInUpBig}@-webkit-keyframes layer-zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes layer-zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);-ms-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);-ms-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-03{-webkit-animation-name:layer-zoomInLeft;animation-name:layer-zoomInLeft}@-webkit-keyframes layer-rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}@keyframes layer-rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);-ms-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);-ms-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}.layer-anim-04{-webkit-animation-name:layer-rollIn;animation-name:layer-rollIn}@keyframes layer-fadeIn{0%{opacity:0}100%{opacity:1}}.layer-anim-05{-webkit-animation-name:layer-fadeIn;animation-name:layer-fadeIn}@-webkit-keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}.layer-anim-06{-webkit-animation-name:layer-shake;animation-name:layer-shake}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.layui-layer-title{padding:0 80px 0 20px;height:50px;line-height:50px;border-bottom:1px solid #f0f0f0;font-size:14px;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:2px 2px 0 0}.layui-layer-setwin{position:absolute;right:15px;*right:0;top:16px;font-size:0;line-height:initial}.layui-layer-setwin span{position:relative;width:16px;height:16px;line-height:18px;margin-left:10px;text-align:center;font-size:16px;cursor:pointer;color:#000;_overflow:hidden}.layui-layer-setwin .layui-layer-min:before{content:'';position:absolute;width:12px;height:1px;left:50%;top:50%;margin:-.5px 0 0 -6px;background-color:#2e2d3c;cursor:pointer;_overflow:hidden}.layui-layer-setwin .layui-layer-min:hover:before{background-color:#2d93ca}.layui-layer-setwin .layui-layer-max:after,.layui-layer-setwin .layui-layer-max:before{content:'';position:absolute;left:50%;top:50%;z-index:1;width:9px;height:9px;margin:-5px 0 0 -5px;border:1px solid #2e2d3c}.layui-layer-setwin .layui-layer-max:hover:after,.layui-layer-setwin .layui-layer-max:hover:before{border-color:#2d93ca}.layui-layer-setwin .layui-layer-min:hover:before{background-color:#2d93ca}.layui-layer-setwin .layui-layer-maxmin:after,.layui-layer-setwin .layui-layer-maxmin:before{width:7px;height:7px;margin:-3px 0 0 -3px;background-color:#fff}.layui-layer-setwin .layui-layer-maxmin:after{z-index:0;margin:-5px 0 0 -1px}.layui-layer-setwin .layui-layer-close{cursor:pointer}.layui-layer-setwin .layui-layer-close:hover{opacity:.7}.layui-layer-setwin .layui-layer-close2{position:absolute;right:-28px;top:-28px;color:#fff;background-color:#787878;padding:3px;border:3px solid;width:18px;height:18px;font-size:18px;font-weight:bolder;border-radius:50%;margin-left:0;*right:-18px;_display:none}.layui-layer-setwin .layui-layer-close2:hover{opacity:unset;background-color:#3888f6}.layui-layer-btn{text-align:right;padding:0 15px 12px;pointer-events:auto;user-select:none;-webkit-user-select:none}.layui-layer-btn a{height:28px;line-height:28px;margin:5px 5px 0;padding:0 15px;border:1px solid #dedede;background-color:#fff;color:#333;border-radius:2px;font-weight:400;cursor:pointer;text-decoration:none}.layui-layer-btn a:hover{opacity:.9;text-decoration:none}.layui-layer-btn a:active{opacity:.8}.layui-layer-btn .layui-layer-btn0{border-color:#1e9fff;background-color:#1e9fff;color:#fff}.layui-layer-btn-l{text-align:left}.layui-layer-btn-c{text-align:center}.layui-layer-dialog{min-width:300px}.layui-layer-dialog .layui-layer-content{position:relative;padding:20px;line-height:24px;word-break:break-all;overflow:hidden;font-size:14px;overflow-x:hidden;overflow-y:auto}.layui-layer-dialog .layui-layer-content .layui-layer-face{position:absolute;top:18px;left:16px;color:#959595;font-size:24px;_left:-40px}.layui-layer-dialog .layui-layer-content .layui-icon-tips{color:#f39b12}.layui-layer-dialog .layui-layer-content .layui-icon-ok{color:#5fb878}.layui-layer-dialog .layui-layer-content .layui-icon-close-fill{color:#ff5722}.layui-layer-dialog .layui-layer-content .layui-icon-password{color:#787878}.layui-layer-dialog .layui-layer-content .layui-icon-face-cry{color:#ff5722}.layui-layer-dialog .layui-layer-content .layui-icon-face-smile{color:#5fb878}.layui-layer-rim{border:6px solid #8d8d8d;border:6px solid rgba(0,0,0,.3);border-radius:5px;box-shadow:none}.layui-layer-msg{min-width:180px;border:1px solid #d3d4d3;box-shadow:none}.layui-layer-hui{min-width:100px;background-color:#000;filter:alpha(opacity=60);background-color:rgba(0,0,0,.6);color:#fff;border:none}.layui-layer-hui .layui-layer-close{color:#fff}.layui-layer-hui .layui-layer-content{padding:11px 24px;text-align:center}.layui-layer-dialog .layui-layer-padding{padding:18px 24px 18px 52px;text-align:left}.layui-layer-page .layui-layer-content{position:relative;overflow:auto}.layui-layer-iframe .layui-layer-btn,.layui-layer-page .layui-layer-btn{padding-top:10px}.layui-layer-nobg{background:0 0}.layui-layer-iframe iframe{display:block;width:100%}.layui-layer-loading{border-radius:100%;background:0 0;box-shadow:none;border:none}.layui-layer-loading .layui-layer-content{width:76px;height:38px;line-height:38px;text-align:center}.layui-layer-loading-icon{font-size:38px;color:#959595}.layui-layer-loading2{text-align:center}.layui-layer-loading-2{position:relative;height:38px}.layui-layer-loading-2:after,.layui-layer-loading-2:before{content:'';position:absolute;left:50%;top:50%;width:38px;height:38px;margin:-19px 0 0 -19px;border-radius:50%;border:3px solid #d2d2d2;box-sizing:border-box}.layui-layer-loading-2:after{border-color:transparent;border-left-color:#1e9fff}.layui-layer-tips{background:0 0;box-shadow:none;border:none}.layui-layer-tips .layui-layer-content{position:relative;line-height:22px;min-width:12px;padding:8px 15px;font-size:12px;_float:left;border-radius:2px;box-shadow:1px 1px 3px rgba(0,0,0,.2);background-color:#000;color:#fff}.layui-layer-tips .layui-layer-close{right:-2px;top:-1px}.layui-layer-tips i.layui-layer-TipsG{position:absolute;width:0;height:0;border-width:8px;border-color:transparent;border-style:dashed;*overflow:hidden}.layui-layer-tips i.layui-layer-TipsB,.layui-layer-tips i.layui-layer-TipsT{left:5px;border-right-style:solid;border-right-color:#000}.layui-layer-tips i.layui-layer-TipsT{bottom:-8px}.layui-layer-tips i.layui-layer-TipsB{top:-8px}.layui-layer-tips i.layui-layer-TipsL,.layui-layer-tips i.layui-layer-TipsR{top:5px;border-bottom-style:solid;border-bottom-color:#000}.layui-layer-tips i.layui-layer-TipsR{left:-8px}.layui-layer-tips i.layui-layer-TipsL{right:-8px}.layui-layer-lan[type=dialog]{min-width:280px}.layui-layer-lan .layui-layer-title{background:#4476a7;color:#fff;border:none}.layui-layer-lan .layui-layer-btn{padding:5px 10px 10px;text-align:right;border-top:1px solid #e9e7e7}.layui-layer-lan .layui-layer-btn a{background:#fff;border-color:#e9e7e7;color:#333}.layui-layer-lan .layui-layer-btn .layui-layer-btn1{background:#c9c5c5}.layui-layer-molv .layui-layer-title{background:#009f95;color:#fff;border:none}.layui-layer-molv .layui-layer-btn a{background:#009f95;border-color:#009f95}.layui-layer-molv .layui-layer-btn .layui-layer-btn1{background:#92b8b1}.layui-layer-prompt .layui-layer-input{display:block;width:260px;height:36px;margin:0 auto;line-height:30px;padding-left:10px;border:1px solid #e6e6e6;color:#333}.layui-layer-prompt textarea.layui-layer-input{width:300px;height:100px;line-height:20px;padding:6px 10px}.layui-layer-prompt .layui-layer-content{padding:20px}.layui-layer-prompt .layui-layer-btn{padding-top:0}.layui-layer-tab{box-shadow:1px 1px 50px rgba(0,0,0,.4)}.layui-layer-tab .layui-layer-title{padding-left:0;overflow:visible}.layui-layer-tab .layui-layer-title span{position:relative;float:left;min-width:80px;max-width:300px;padding:0 20px;text-align:center;cursor:default;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;cursor:pointer}.layui-layer-tab .layui-layer-title span.layui-this{height:51px;border-left:1px solid #eee;border-right:1px solid #eee;background-color:#fff;z-index:10}.layui-layer-tab .layui-layer-title span:first-child{border-left:none}.layui-layer-tabmain{line-height:24px;clear:both}.layui-layer-tabmain .layui-layer-tabli{display:none}.layui-layer-tabmain .layui-layer-tabli.layui-this{display:block}.layui-layer-photos{background:0 0;box-shadow:none}.layui-layer-photos .layui-layer-content{overflow:hidden;text-align:center}.layui-layer-photos .layui-layer-phimg img{position:relative;width:100%;display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-imgnext,.layui-layer-imgprev{position:fixed;top:50%;width:52px;height:52px;line-height:52px;margin-top:-26px;cursor:pointer;font-size:52px;color:#717171}.layui-layer-imgprev{left:32px}.layui-layer-imgnext{right:32px}.layui-layer-imgnext:hover,.layui-layer-imgprev:hover{color:#959595}.layui-layer-imgbar{position:fixed;left:0;right:0;bottom:0;width:100%;height:40px;line-height:40px;background-color:#000\9;filter:Alpha(opacity=60);background-color:rgba(2,0,0,.35);color:#fff;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:0}.layui-layer-imgtit *{display:inline-block;*display:inline;*zoom:1;vertical-align:top;padding:0 5px;font-size:12px;color:#fff}.layui-layer-imgtit h3{max-width:65%;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-weight:300}.layui-layer-imgtit a:hover{color:#fff;text-decoration:underline}.layui-layer-imgtit em{font-style:normal}@-webkit-keyframes layer-bounceOut{100%{opacity:0;-webkit-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes layer-bounceOut{100%{opacity:0;-webkit-transform:scale(.7);-ms-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim-close{-webkit-animation-name:layer-bounceOut;animation-name:layer-bounceOut;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.2s;animation-duration:.2s}@media screen and (max-width:1100px){.layui-layer-iframe{overflow-y:auto;-webkit-overflow-scrolling:touch}} \ No newline at end of file +blockquote,body,button,dd,div,dl,dt,form,h1,h2,h3,h4,h5,h6,input,li,ol,p,pre,td,textarea,th,ul{margin:0;padding:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}a:active,a:hover{outline:0}img{display:inline-block;border:none;vertical-align:middle}li{list-style:none}table{border-collapse:collapse;border-spacing:0}h1,h2,h3,h4{font-weight:700}h5,h6{font-weight:500;font-size:100%}button,input,select,textarea{font-size:100%}button,input,optgroup,option,select,textarea{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;outline:0}pre{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}body{line-height:1.6;color:#333;color:rgba(0,0,0,.85);font:14px Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif}hr{height:0;line-height:0;margin:10px 0;padding:0;border:none;border-bottom:1px solid #eee;clear:both;overflow:hidden;background:0 0}a{color:#333;text-decoration:none}a:hover{color:#777}a cite{font-style:normal;*cursor:pointer}.layui-border-box,.layui-border-box *{box-sizing:border-box}.layui-box,.layui-box *{box-sizing:content-box}.layui-clear{clear:both;*zoom:1}.layui-clear:after{content:'\20';clear:both;*zoom:1;display:block;height:0}.layui-clear-space{word-spacing:-5px}.layui-inline{position:relative;display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.layui-edge{position:relative;display:inline-block;vertical-align:middle;width:0;height:0;border-width:6px;border-style:dashed;border-color:transparent;overflow:hidden}.layui-edge-top{top:-4px;border-bottom-color:#999;border-bottom-style:solid}.layui-edge-right{border-left-color:#999;border-left-style:solid}.layui-edge-bottom{top:2px;border-top-color:#999;border-top-style:solid}.layui-edge-left{border-right-color:#999;border-right-style:solid}.layui-elip{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-disabled,.layui-icon,.layui-unselect{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-disabled,.layui-disabled:hover{color:#d2d2d2!important;cursor:not-allowed!important}.layui-circle{border-radius:100%}.layui-show{display:block!important}.layui-hide{display:none!important}.layui-show-v{visibility:visible!important}.layui-hide-v{visibility:hidden!important}@font-face{font-family:layui-icon;src:url(../font/iconfont.eot?v=282);src:url(../font/iconfont.eot?v=282#iefix) format('embedded-opentype'),url(../font/iconfont.woff2?v=282) format('woff2'),url(../font/iconfont.woff?v=282) format('woff'),url(../font/iconfont.ttf?v=282) format('truetype'),url(../font/iconfont.svg?v=282#layui-icon) format('svg')}.layui-icon{font-family:layui-icon!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.layui-icon-leaf:before{content:"\e701"}.layui-icon-folder:before{content:"\eabe"}.layui-icon-folder-open:before{content:"\eac1"}.layui-icon-gitee:before{content:"\e69b"}.layui-icon-github:before{content:"\e6a7"}.layui-icon-disabled:before{content:"\e6cc"}.layui-icon-moon:before{content:"\e6c2"}.layui-icon-error:before{content:"\e693"}.layui-icon-success:before{content:"\e697"}.layui-icon-question:before{content:"\e699"}.layui-icon-lock:before{content:"\e69a"}.layui-icon-eye:before{content:"\e695"}.layui-icon-eye-invisible:before{content:"\e696"}.layui-icon-backspace:before{content:"\e694"}.layui-icon-tips-fill:before{content:"\eb2e"}.layui-icon-test:before{content:"\e692"}.layui-icon-clear:before{content:"\e788"}.layui-icon-heart-fill:before{content:"\e68f"}.layui-icon-light:before{content:"\e748"}.layui-icon-music:before{content:"\e690"}.layui-icon-time:before{content:"\e68d"}.layui-icon-ie:before{content:"\e7bb"}.layui-icon-firefox:before{content:"\e686"}.layui-icon-at:before{content:"\e687"}.layui-icon-bluetooth:before{content:"\e689"}.layui-icon-chrome:before{content:"\e68a"}.layui-icon-edge:before{content:"\e68b"}.layui-icon-heart:before{content:"\e68c"}.layui-icon-key:before{content:"\e683"}.layui-icon-android:before{content:"\e684"}.layui-icon-mike:before{content:"\e6dc"}.layui-icon-mute:before{content:"\e685"}.layui-icon-gift:before{content:"\e627"}.layui-icon-windows:before{content:"\e67f"}.layui-icon-ios:before{content:"\e680"}.layui-icon-logout:before{content:"\e682"}.layui-icon-wifi:before{content:"\e7e0"}.layui-icon-rss:before{content:"\e808"}.layui-icon-email:before{content:"\e618"}.layui-icon-reduce-circle:before{content:"\e616"}.layui-icon-transfer:before{content:"\e691"}.layui-icon-service:before{content:"\e626"}.layui-icon-addition:before{content:"\e624"}.layui-icon-subtraction:before{content:"\e67e"}.layui-icon-slider:before{content:"\e714"}.layui-icon-print:before{content:"\e66d"}.layui-icon-export:before{content:"\e67d"}.layui-icon-cols:before{content:"\e610"}.layui-icon-screen-full:before{content:"\e622"}.layui-icon-screen-restore:before{content:"\e758"}.layui-icon-rate-half:before{content:"\e6c9"}.layui-icon-rate-solid:before{content:"\e67a"}.layui-icon-rate:before{content:"\e67b"}.layui-icon-cellphone:before{content:"\e678"}.layui-icon-vercode:before{content:"\e679"}.layui-icon-login-weibo:before{content:"\e675"}.layui-icon-login-qq:before{content:"\e676"}.layui-icon-login-wechat:before{content:"\e677"}.layui-icon-username:before{content:"\e66f"}.layui-icon-password:before{content:"\e673"}.layui-icon-refresh-3:before{content:"\e9aa"}.layui-icon-auz:before{content:"\e672"}.layui-icon-shrink-right:before{content:"\e668"}.layui-icon-spread-left:before{content:"\e66b"}.layui-icon-snowflake:before{content:"\e6b1"}.layui-icon-tips:before{content:"\e702"}.layui-icon-note:before{content:"\e66e"}.layui-icon-senior:before{content:"\e674"}.layui-icon-refresh-1:before{content:"\e666"}.layui-icon-refresh:before{content:"\e669"}.layui-icon-flag:before{content:"\e66c"}.layui-icon-theme:before{content:"\e66a"}.layui-icon-notice:before{content:"\e667"}.layui-icon-console:before{content:"\e665"}.layui-icon-website:before{content:"\e7ae"}.layui-icon-face-surprised:before{content:"\e664"}.layui-icon-set:before{content:"\e716"}.layui-icon-template:before{content:"\e663"}.layui-icon-app:before{content:"\e653"}.layui-icon-template-1:before{content:"\e656"}.layui-icon-home:before{content:"\e68e"}.layui-icon-female:before{content:"\e661"}.layui-icon-male:before{content:"\e662"}.layui-icon-tread:before{content:"\e6c5"}.layui-icon-praise:before{content:"\e6c6"}.layui-icon-rmb:before{content:"\e65e"}.layui-icon-more:before{content:"\e65f"}.layui-icon-camera:before{content:"\e660"}.layui-icon-cart-simple:before{content:"\e698"}.layui-icon-face-cry:before{content:"\e69c"}.layui-icon-face-smile:before{content:"\e6af"}.layui-icon-survey:before{content:"\e6b2"}.layui-icon-read:before{content:"\e705"}.layui-icon-location:before{content:"\e715"}.layui-icon-dollar:before{content:"\e659"}.layui-icon-diamond:before{content:"\e735"}.layui-icon-return:before{content:"\e65c"}.layui-icon-camera-fill:before{content:"\e65d"}.layui-icon-fire:before{content:"\e756"}.layui-icon-more-vertical:before{content:"\e671"}.layui-icon-cart:before{content:"\e657"}.layui-icon-star-fill:before{content:"\e658"}.layui-icon-prev:before{content:"\e65a"}.layui-icon-next:before{content:"\e65b"}.layui-icon-upload:before{content:"\e67c"}.layui-icon-upload-drag:before{content:"\e681"}.layui-icon-user:before{content:"\e770"}.layui-icon-file-b:before{content:"\e655"}.layui-icon-component:before{content:"\e857"}.layui-icon-find-fill:before{content:"\e670"}.layui-icon-loading:before{content:"\e63d"}.layui-icon-loading-1:before{content:"\e63e"}.layui-icon-add-1:before{content:"\e654"}.layui-icon-pause:before{content:"\e651"}.layui-icon-play:before{content:"\e652"}.layui-icon-video:before{content:"\e6ed"}.layui-icon-headset:before{content:"\e6fc"}.layui-icon-voice:before{content:"\e688"}.layui-icon-speaker:before{content:"\e645"}.layui-icon-fonts-del:before{content:"\e64f"}.layui-icon-fonts-html:before{content:"\e64b"}.layui-icon-fonts-code:before{content:"\e64e"}.layui-icon-fonts-strong:before{content:"\e62b"}.layui-icon-unlink:before{content:"\e64d"}.layui-icon-picture:before{content:"\e64a"}.layui-icon-link:before{content:"\e64c"}.layui-icon-face-smile-b:before{content:"\e650"}.layui-icon-align-center:before{content:"\e647"}.layui-icon-align-right:before{content:"\e648"}.layui-icon-align-left:before{content:"\e649"}.layui-icon-fonts-u:before{content:"\e646"}.layui-icon-fonts-i:before{content:"\e644"}.layui-icon-tabs:before{content:"\e62a"}.layui-icon-circle:before{content:"\e63f"}.layui-icon-radio:before{content:"\e643"}.layui-icon-share:before{content:"\e641"}.layui-icon-edit:before{content:"\e642"}.layui-icon-delete:before{content:"\e640"}.layui-icon-engine:before{content:"\e628"}.layui-icon-chart-screen:before{content:"\e629"}.layui-icon-chart:before{content:"\e62c"}.layui-icon-table:before{content:"\e62d"}.layui-icon-tree:before{content:"\e62e"}.layui-icon-upload-circle:before{content:"\e62f"}.layui-icon-templeate-1:before{content:"\e630"}.layui-icon-util:before{content:"\e631"}.layui-icon-layouts:before{content:"\e632"}.layui-icon-prev-circle:before{content:"\e633"}.layui-icon-carousel:before{content:"\e634"}.layui-icon-code-circle:before{content:"\e635"}.layui-icon-water:before{content:"\e636"}.layui-icon-date:before{content:"\e637"}.layui-icon-layer:before{content:"\e638"}.layui-icon-fonts-clear:before{content:"\e639"}.layui-icon-dialogue:before{content:"\e63a"}.layui-icon-cellphone-fine:before{content:"\e63b"}.layui-icon-form:before{content:"\e63c"}.layui-icon-file:before{content:"\e621"}.layui-icon-triangle-r:before{content:"\e623"}.layui-icon-triangle-d:before{content:"\e625"}.layui-icon-set-sm:before{content:"\e620"}.layui-icon-add-circle:before{content:"\e61f"}.layui-icon-layim-download:before{content:"\e61e"}.layui-icon-layim-uploadfile:before{content:"\e61d"}.layui-icon-404:before{content:"\e61c"}.layui-icon-about:before{content:"\e60b"}.layui-icon-layim-theme:before{content:"\e61b"}.layui-icon-down:before{content:"\e61a"}.layui-icon-up:before{content:"\e619"}.layui-icon-circle-dot:before{content:"\e617"}.layui-icon-set-fill:before{content:"\e614"}.layui-icon-search:before{content:"\e615"}.layui-icon-friends:before{content:"\e612"}.layui-icon-group:before{content:"\e613"}.layui-icon-reply-fill:before{content:"\e611"}.layui-icon-menu-fill:before{content:"\e60f"}.layui-icon-face-smile-fine:before{content:"\e60c"}.layui-icon-picture-fine:before{content:"\e60d"}.layui-icon-log:before{content:"\e60e"}.layui-icon-list:before{content:"\e60a"}.layui-icon-release:before{content:"\e609"}.layui-icon-add-circle-fine:before{content:"\e608"}.layui-icon-ok:before{content:"\e605"}.layui-icon-help:before{content:"\e607"}.layui-icon-chat:before{content:"\e606"}.layui-icon-top:before{content:"\e604"}.layui-icon-right:before{content:"\e602"}.layui-icon-left:before{content:"\e603"}.layui-icon-star:before{content:"\e600"}.layui-icon-download-circle:before{content:"\e601"}.layui-icon-close:before{content:"\1006"}.layui-icon-close-fill:before{content:"\1007"}.layui-icon-ok-circle:before{content:"\1005"}.layui-main{position:relative;width:1160px;margin:0 auto}.layui-header{position:relative;z-index:1000;height:60px}.layui-header a:hover{transition:all .5s;-webkit-transition:all .5s}.layui-side{position:fixed;left:0;top:0;bottom:0;z-index:999;width:200px;overflow-x:hidden}.layui-side-scroll{position:relative;width:220px;height:100%;overflow-x:hidden}.layui-body{position:relative;left:200px;right:0;top:0;bottom:0;z-index:900;width:auto;box-sizing:border-box}.layui-layout-body{overflow-x:hidden}.layui-layout-admin .layui-header{position:fixed;top:0;left:0;right:0;background-color:#23292e}.layui-layout-admin .layui-side{top:60px;width:200px;overflow-x:hidden}.layui-layout-admin .layui-body{position:absolute;top:60px;padding-bottom:44px}.layui-layout-admin .layui-main{width:auto;margin:0 15px}.layui-layout-admin .layui-footer{position:fixed;left:200px;right:0;bottom:0;z-index:990;height:44px;line-height:44px;padding:0 15px;box-shadow:-1px 0 4px rgb(0 0 0 / 12%);background-color:#fafafa}.layui-layout-admin .layui-logo{position:absolute;left:0;top:0;width:200px;height:100%;line-height:60px;text-align:center;color:#16baaa;font-size:16px;box-shadow:0 1px 2px 0 rgb(0 0 0 / 15%)}.layui-layout-admin .layui-header .layui-nav{background:0 0}.layui-layout-left{position:absolute!important;left:200px;top:0}.layui-layout-right{position:absolute!important;right:0;top:0}.layui-container{position:relative;margin:0 auto;box-sizing:border-box}.layui-fluid{position:relative;margin:0 auto;padding:0 15px}.layui-row:after,.layui-row:before{content:"";display:block;clear:both}.layui-col-lg1,.layui-col-lg10,.layui-col-lg11,.layui-col-lg12,.layui-col-lg2,.layui-col-lg3,.layui-col-lg4,.layui-col-lg5,.layui-col-lg6,.layui-col-lg7,.layui-col-lg8,.layui-col-lg9,.layui-col-md1,.layui-col-md10,.layui-col-md11,.layui-col-md12,.layui-col-md2,.layui-col-md3,.layui-col-md4,.layui-col-md5,.layui-col-md6,.layui-col-md7,.layui-col-md8,.layui-col-md9,.layui-col-sm1,.layui-col-sm10,.layui-col-sm11,.layui-col-sm12,.layui-col-sm2,.layui-col-sm3,.layui-col-sm4,.layui-col-sm5,.layui-col-sm6,.layui-col-sm7,.layui-col-sm8,.layui-col-sm9,.layui-col-xl1,.layui-col-xl10,.layui-col-xl11,.layui-col-xl12,.layui-col-xl2,.layui-col-xl3,.layui-col-xl4,.layui-col-xl5,.layui-col-xl6,.layui-col-xl7,.layui-col-xl8,.layui-col-xl9,.layui-col-xs1,.layui-col-xs10,.layui-col-xs11,.layui-col-xs12,.layui-col-xs2,.layui-col-xs3,.layui-col-xs4,.layui-col-xs5,.layui-col-xs6,.layui-col-xs7,.layui-col-xs8,.layui-col-xs9{position:relative;display:block;box-sizing:border-box}.layui-col-xs1,.layui-col-xs10,.layui-col-xs11,.layui-col-xs12,.layui-col-xs2,.layui-col-xs3,.layui-col-xs4,.layui-col-xs5,.layui-col-xs6,.layui-col-xs7,.layui-col-xs8,.layui-col-xs9{float:left}.layui-col-xs1{width:8.33333333%}.layui-col-xs2{width:16.66666667%}.layui-col-xs3{width:25%}.layui-col-xs4{width:33.33333333%}.layui-col-xs5{width:41.66666667%}.layui-col-xs6{width:50%}.layui-col-xs7{width:58.33333333%}.layui-col-xs8{width:66.66666667%}.layui-col-xs9{width:75%}.layui-col-xs10{width:83.33333333%}.layui-col-xs11{width:91.66666667%}.layui-col-xs12{width:100%}.layui-col-xs-offset1{margin-left:8.33333333%}.layui-col-xs-offset2{margin-left:16.66666667%}.layui-col-xs-offset3{margin-left:25%}.layui-col-xs-offset4{margin-left:33.33333333%}.layui-col-xs-offset5{margin-left:41.66666667%}.layui-col-xs-offset6{margin-left:50%}.layui-col-xs-offset7{margin-left:58.33333333%}.layui-col-xs-offset8{margin-left:66.66666667%}.layui-col-xs-offset9{margin-left:75%}.layui-col-xs-offset10{margin-left:83.33333333%}.layui-col-xs-offset11{margin-left:91.66666667%}.layui-col-xs-offset12{margin-left:100%}@media screen and (max-width:767.98px){.layui-container{padding:0 15px}.layui-hide-xs{display:none!important}.layui-show-xs-block{display:block!important}.layui-show-xs-inline{display:inline!important}.layui-show-xs-inline-block{display:inline-block!important}}@media screen and (min-width:768px){.layui-container{width:720px}.layui-hide-sm{display:none!important}.layui-show-sm-block{display:block!important}.layui-show-sm-inline{display:inline!important}.layui-show-sm-inline-block{display:inline-block!important}.layui-col-sm1,.layui-col-sm10,.layui-col-sm11,.layui-col-sm12,.layui-col-sm2,.layui-col-sm3,.layui-col-sm4,.layui-col-sm5,.layui-col-sm6,.layui-col-sm7,.layui-col-sm8,.layui-col-sm9{float:left}.layui-col-sm1{width:8.33333333%}.layui-col-sm2{width:16.66666667%}.layui-col-sm3{width:25%}.layui-col-sm4{width:33.33333333%}.layui-col-sm5{width:41.66666667%}.layui-col-sm6{width:50%}.layui-col-sm7{width:58.33333333%}.layui-col-sm8{width:66.66666667%}.layui-col-sm9{width:75%}.layui-col-sm10{width:83.33333333%}.layui-col-sm11{width:91.66666667%}.layui-col-sm12{width:100%}.layui-col-sm-offset1{margin-left:8.33333333%}.layui-col-sm-offset2{margin-left:16.66666667%}.layui-col-sm-offset3{margin-left:25%}.layui-col-sm-offset4{margin-left:33.33333333%}.layui-col-sm-offset5{margin-left:41.66666667%}.layui-col-sm-offset6{margin-left:50%}.layui-col-sm-offset7{margin-left:58.33333333%}.layui-col-sm-offset8{margin-left:66.66666667%}.layui-col-sm-offset9{margin-left:75%}.layui-col-sm-offset10{margin-left:83.33333333%}.layui-col-sm-offset11{margin-left:91.66666667%}.layui-col-sm-offset12{margin-left:100%}}@media screen and (min-width:992px){.layui-container{width:960px}.layui-hide-md{display:none!important}.layui-show-md-block{display:block!important}.layui-show-md-inline{display:inline!important}.layui-show-md-inline-block{display:inline-block!important}.layui-col-md1,.layui-col-md10,.layui-col-md11,.layui-col-md12,.layui-col-md2,.layui-col-md3,.layui-col-md4,.layui-col-md5,.layui-col-md6,.layui-col-md7,.layui-col-md8,.layui-col-md9{float:left}.layui-col-md1{width:8.33333333%}.layui-col-md2{width:16.66666667%}.layui-col-md3{width:25%}.layui-col-md4{width:33.33333333%}.layui-col-md5{width:41.66666667%}.layui-col-md6{width:50%}.layui-col-md7{width:58.33333333%}.layui-col-md8{width:66.66666667%}.layui-col-md9{width:75%}.layui-col-md10{width:83.33333333%}.layui-col-md11{width:91.66666667%}.layui-col-md12{width:100%}.layui-col-md-offset1{margin-left:8.33333333%}.layui-col-md-offset2{margin-left:16.66666667%}.layui-col-md-offset3{margin-left:25%}.layui-col-md-offset4{margin-left:33.33333333%}.layui-col-md-offset5{margin-left:41.66666667%}.layui-col-md-offset6{margin-left:50%}.layui-col-md-offset7{margin-left:58.33333333%}.layui-col-md-offset8{margin-left:66.66666667%}.layui-col-md-offset9{margin-left:75%}.layui-col-md-offset10{margin-left:83.33333333%}.layui-col-md-offset11{margin-left:91.66666667%}.layui-col-md-offset12{margin-left:100%}}@media screen and (min-width:1200px){.layui-container{width:1150px}.layui-hide-lg{display:none!important}.layui-show-lg-block{display:block!important}.layui-show-lg-inline{display:inline!important}.layui-show-lg-inline-block{display:inline-block!important}.layui-col-lg1,.layui-col-lg10,.layui-col-lg11,.layui-col-lg12,.layui-col-lg2,.layui-col-lg3,.layui-col-lg4,.layui-col-lg5,.layui-col-lg6,.layui-col-lg7,.layui-col-lg8,.layui-col-lg9{float:left}.layui-col-lg1{width:8.33333333%}.layui-col-lg2{width:16.66666667%}.layui-col-lg3{width:25%}.layui-col-lg4{width:33.33333333%}.layui-col-lg5{width:41.66666667%}.layui-col-lg6{width:50%}.layui-col-lg7{width:58.33333333%}.layui-col-lg8{width:66.66666667%}.layui-col-lg9{width:75%}.layui-col-lg10{width:83.33333333%}.layui-col-lg11{width:91.66666667%}.layui-col-lg12{width:100%}.layui-col-lg-offset1{margin-left:8.33333333%}.layui-col-lg-offset2{margin-left:16.66666667%}.layui-col-lg-offset3{margin-left:25%}.layui-col-lg-offset4{margin-left:33.33333333%}.layui-col-lg-offset5{margin-left:41.66666667%}.layui-col-lg-offset6{margin-left:50%}.layui-col-lg-offset7{margin-left:58.33333333%}.layui-col-lg-offset8{margin-left:66.66666667%}.layui-col-lg-offset9{margin-left:75%}.layui-col-lg-offset10{margin-left:83.33333333%}.layui-col-lg-offset11{margin-left:91.66666667%}.layui-col-lg-offset12{margin-left:100%}}@media screen and (min-width:1400px){.layui-container{width:1330px}.layui-hide-xl{display:none!important}.layui-show-xl-block{display:block!important}.layui-show-xl-inline{display:inline!important}.layui-show-xl-inline-block{display:inline-block!important}.layui-col-xl1,.layui-col-xl10,.layui-col-xl11,.layui-col-xl12,.layui-col-xl2,.layui-col-xl3,.layui-col-xl4,.layui-col-xl5,.layui-col-xl6,.layui-col-xl7,.layui-col-xl8,.layui-col-xl9{float:left}.layui-col-xl1{width:8.33333333%}.layui-col-xl2{width:16.66666667%}.layui-col-xl3{width:25%}.layui-col-xl4{width:33.33333333%}.layui-col-xl5{width:41.66666667%}.layui-col-xl6{width:50%}.layui-col-xl7{width:58.33333333%}.layui-col-xl8{width:66.66666667%}.layui-col-xl9{width:75%}.layui-col-xl10{width:83.33333333%}.layui-col-xl11{width:91.66666667%}.layui-col-xl12{width:100%}.layui-col-xl-offset1{margin-left:8.33333333%}.layui-col-xl-offset2{margin-left:16.66666667%}.layui-col-xl-offset3{margin-left:25%}.layui-col-xl-offset4{margin-left:33.33333333%}.layui-col-xl-offset5{margin-left:41.66666667%}.layui-col-xl-offset6{margin-left:50%}.layui-col-xl-offset7{margin-left:58.33333333%}.layui-col-xl-offset8{margin-left:66.66666667%}.layui-col-xl-offset9{margin-left:75%}.layui-col-xl-offset10{margin-left:83.33333333%}.layui-col-xl-offset11{margin-left:91.66666667%}.layui-col-xl-offset12{margin-left:100%}}.layui-col-space1{margin:-.5px}.layui-col-space1>*{padding:.5px}.layui-col-space2{margin:-1px}.layui-col-space2>*{padding:1px}.layui-col-space4{margin:-2px}.layui-col-space4>*{padding:2px}.layui-col-space5{margin:-2.5px}.layui-col-space5>*{padding:2.5px}.layui-col-space6{margin:-3px}.layui-col-space6>*{padding:3px}.layui-col-space8{margin:-4px}.layui-col-space8>*{padding:4px}.layui-col-space10{margin:-5px}.layui-col-space10>*{padding:5px}.layui-col-space12{margin:-6px}.layui-col-space12>*{padding:6px}.layui-col-space14{margin:-7px}.layui-col-space14>*{padding:7px}.layui-col-space15{margin:-7.5px}.layui-col-space15>*{padding:7.5px}.layui-col-space16{margin:-8px}.layui-col-space16>*{padding:8px}.layui-col-space18{margin:-9px}.layui-col-space18>*{padding:9px}.layui-col-space20{margin:-10px}.layui-col-space20>*{padding:10px}.layui-col-space22{margin:-11px}.layui-col-space22>*{padding:11px}.layui-col-space24{margin:-12px}.layui-col-space24>*{padding:12px}.layui-col-space25{margin:-12.5px}.layui-col-space25>*{padding:12.5px}.layui-col-space26{margin:-13px}.layui-col-space26>*{padding:13px}.layui-col-space28{margin:-14px}.layui-col-space28>*{padding:14px}.layui-col-space30{margin:-15px}.layui-col-space30>*{padding:15px}.layui-col-space32{margin:-16px}.layui-col-space32>*{padding:16px}.layui-padding-1{padding:4px!important}.layui-padding-2{padding:8px!important}.layui-padding-3{padding:16px!important}.layui-padding-4{padding:32px!important}.layui-padding-5{padding:48px!important}.layui-margin-1{margin:4px!important}.layui-margin-2{margin:8px!important}.layui-margin-3{margin:16px!important}.layui-margin-4{margin:32px!important}.layui-margin-5{margin:48px!important}.layui-btn,.layui-input,.layui-select,.layui-textarea,.layui-upload-button{outline:0;-webkit-appearance:none;transition:all .3s;-webkit-transition:all .3s;box-sizing:border-box}.layui-elem-quote{margin-bottom:10px;padding:15px;line-height:1.8;border-left:5px solid #16b777;border-radius:0 2px 2px 0;background-color:#fafafa}.layui-quote-nm{border-style:solid;border-width:1px;border-left-width:5px;background:0 0}.layui-elem-field{margin-bottom:10px;padding:0;border-width:1px;border-style:solid}.layui-elem-field legend{margin-left:20px;padding:0 10px;font-size:20px}.layui-field-title{margin:16px 0;border-width:0;border-top-width:1px}.layui-field-box{padding:15px}.layui-field-title .layui-field-box{padding:10px 0}.layui-progress{position:relative;height:6px;border-radius:20px;background-color:#eee}.layui-progress-bar{position:absolute;left:0;top:0;width:0;max-width:100%;height:6px;border-radius:20px;text-align:right;background-color:#16b777;transition:all .3s;-webkit-transition:all .3s}.layui-progress-big,.layui-progress-big .layui-progress-bar{height:18px;line-height:18px}.layui-progress-text{position:relative;top:-20px;line-height:18px;font-size:12px;color:#5f5f5f}.layui-progress-big .layui-progress-text{position:static;padding:0 10px;color:#fff}.layui-collapse{border-width:1px;border-style:solid;border-radius:2px}.layui-colla-content,.layui-colla-item{border-top-width:1px;border-top-style:solid}.layui-colla-item:first-child{border-top:none}.layui-colla-title{position:relative;height:42px;line-height:42px;padding:0 15px 0 35px;color:#333;background-color:#fafafa;cursor:pointer;font-size:14px;overflow:hidden}.layui-colla-content{display:none;padding:10px 15px;line-height:1.6;color:#5f5f5f}.layui-colla-icon{position:absolute;left:15px;top:0;font-size:14px}.layui-card{margin-bottom:15px;border-radius:2px;background-color:#fff;box-shadow:0 1px 2px 0 rgba(0,0,0,.05)}.layui-card:last-child{margin-bottom:0}.layui-card-header{position:relative;height:42px;line-height:42px;padding:0 15px;border-bottom:1px solid #f8f8f8;color:#333;border-radius:2px 2px 0 0;font-size:14px}.layui-card-body{position:relative;padding:10px 15px;line-height:24px}.layui-card-body[pad15]{padding:15px}.layui-card-body[pad20]{padding:20px}.layui-card-body .layui-table{margin:5px 0}.layui-card .layui-tab{margin:0}.layui-panel{position:relative;border-width:1px;border-style:solid;border-radius:2px;box-shadow:1px 1px 4px rgb(0 0 0 / 8%);background-color:#fff;color:#5f5f5f}.layui-panel-window{position:relative;padding:15px;border-radius:0;border-top:5px solid #eee;background-color:#fff}.layui-auxiliar-moving{position:fixed;left:0;right:0;top:0;bottom:0;width:100%;height:100%;background:0 0;z-index:9999999999}.layui-scrollbar-hide{overflow:hidden!important}.layui-bg-red{background-color:#ff5722!important;color:#fff!important}.layui-bg-orange{background-color:#ffb800!important;color:#fff!important}.layui-bg-green{background-color:#16baaa!important;color:#fff!important}.layui-bg-cyan{background-color:#2f4056!important;color:#fff!important}.layui-bg-blue{background-color:#1e9fff!important;color:#fff!important}.layui-bg-purple{background-color:#a233c6!important;color:#fff!important}.layui-bg-black{background-color:#2f363c!important;color:#fff!important}.layui-bg-gray{background-color:#fafafa!important;color:#5f5f5f!important}.layui-badge-rim,.layui-border,.layui-colla-content,.layui-colla-item,.layui-collapse,.layui-elem-field,.layui-form-pane .layui-form-item[pane],.layui-form-pane .layui-form-label,.layui-input,.layui-input-split,.layui-panel,.layui-quote-nm,.layui-select,.layui-tab-bar,.layui-tab-card,.layui-tab-title,.layui-tab-title .layui-this:after,.layui-textarea{border-color:#eee}.layui-border{border-width:1px;border-style:solid;color:#5f5f5f!important}.layui-border-red{border-width:1px;border-style:solid;border-color:#ff5722!important;color:#ff5722!important}.layui-border-orange{border-width:1px;border-style:solid;border-color:#ffb800!important;color:#ffb800!important}.layui-border-green{border-width:1px;border-style:solid;border-color:#16baaa!important;color:#16baaa!important}.layui-border-cyan{border-width:1px;border-style:solid;border-color:#2f4056!important;color:#2f4056!important}.layui-border-blue{border-width:1px;border-style:solid;border-color:#1e9fff!important;color:#1e9fff!important}.layui-border-purple{border-width:1px;border-style:solid;border-color:#a233c6!important;color:#a233c6!important}.layui-border-black{border-width:1px;border-style:solid;border-color:#2f363c!important;color:#2f363c!important}hr.layui-border-black,hr.layui-border-blue,hr.layui-border-cyan,hr.layui-border-green,hr.layui-border-orange,hr.layui-border-purple,hr.layui-border-red{border-width:0 0 1px}.layui-timeline-item:before{background-color:#eee}.layui-text{line-height:1.8;font-size:14px}.layui-text h1,.layui-text h2,.layui-text h3,.layui-text h4,.layui-text h5,.layui-text h6{color:#3a3a3a}.layui-text h1{font-size:32px}.layui-text h2{font-size:24px}.layui-text h3{font-size:18px}.layui-text h4{font-size:16px}.layui-text h5{font-size:14px}.layui-text h6{font-size:13px}.layui-text ol,.layui-text ul{padding-left:15px}.layui-text ul li{margin-top:5px;list-style-type:disc}.layui-text ol li{margin-top:5px;list-style-type:decimal}.layui-text-em,.layui-word-aux{color:#999!important;padding-left:5px!important;padding-right:5px!important}.layui-text p{margin:15px 0}.layui-text p:first-child{margin-top:0}.layui-text p:last-child{margin-bottom:0}.layui-text a:not(.layui-btn){color:#01aaed}.layui-text a:not(.layui-btn):hover{text-decoration:underline}.layui-text blockquote:not(.layui-elem-quote){padding:5px 15px;border-left:5px solid #eee}.layui-text pre>code:not(.layui-code){padding:15px;font-family:"Courier New",Consolas,"Lucida Console"}.layui-font-12{font-size:12px!important}.layui-font-13{font-size:13px!important}.layui-font-14{font-size:14px!important}.layui-font-16{font-size:16px!important}.layui-font-18{font-size:18px!important}.layui-font-20{font-size:20px!important}.layui-font-22{font-size:22px!important}.layui-font-24{font-size:24px!important}.layui-font-26{font-size:26px!important}.layui-font-28{font-size:28px!important}.layui-font-30{font-size:30px!important}.layui-font-32{font-size:32px!important}.layui-font-red{color:#ff5722!important}.layui-font-orange{color:#ffb800!important}.layui-font-green{color:#16baaa!important}.layui-font-cyan{color:#2f4056!important}.layui-font-blue{color:#01aaed!important}.layui-font-purple{color:#a233c6!important}.layui-font-black{color:#000!important}.layui-font-gray{color:#c2c2c2!important}.layui-btn{display:inline-block;vertical-align:middle;height:38px;line-height:38px;border:1px solid transparent;padding:0 18px;background-color:#16baaa;color:#fff;white-space:nowrap;text-align:center;font-size:14px;border-radius:2px;cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-btn:hover{opacity:.8;filter:alpha(opacity=80);color:#fff}.layui-btn:active{opacity:1;filter:alpha(opacity=100)}.layui-btn+.layui-btn{margin-left:10px}.layui-btn-container{word-spacing:-5px}.layui-btn-container .layui-btn{margin-right:10px;margin-bottom:10px;word-spacing:normal}.layui-btn-container .layui-btn+.layui-btn{margin-left:0}.layui-table .layui-btn-container .layui-btn{margin-bottom:9px}.layui-btn-radius{border-radius:100px}.layui-btn .layui-icon{padding:0 2px;vertical-align:middle\0;vertical-align:bottom}.layui-btn-primary{border-color:#d2d2d2;background:0 0;color:#5f5f5f}.layui-btn-primary:hover{border-color:#16baaa;color:#333}.layui-btn-normal{background-color:#1e9fff}.layui-btn-warm{background-color:#ffb800}.layui-btn-danger{background-color:#ff5722}.layui-btn-checked{background-color:#16b777}.layui-btn-disabled,.layui-btn-disabled:active,.layui-btn-disabled:hover{border-color:#eee!important;background-color:#fbfbfb!important;color:#d2d2d2!important;cursor:not-allowed!important;opacity:1}.layui-btn-lg{height:44px;line-height:44px;padding:0 25px;font-size:16px}.layui-btn-sm{height:30px;line-height:30px;padding:0 10px;font-size:12px}.layui-btn-xs{height:22px;line-height:22px;padding:0 5px;font-size:12px}.layui-btn-xs i{font-size:12px!important}.layui-btn-group{display:inline-block;vertical-align:middle;font-size:0}.layui-btn-group .layui-btn{margin-left:0!important;margin-right:0!important;border-left:1px solid rgba(255,255,255,.5);border-radius:0}.layui-btn-group .layui-btn-primary{border-left:none}.layui-btn-group .layui-btn-primary:hover{border-color:#d2d2d2;color:#16baaa}.layui-btn-group .layui-btn:first-child{border-left:none;border-radius:2px 0 0 2px}.layui-btn-group .layui-btn-primary:first-child{border-left:1px solid #d2d2d2}.layui-btn-group .layui-btn:last-child{border-radius:0 2px 2px 0}.layui-btn-group .layui-btn+.layui-btn{margin-left:0}.layui-btn-group+.layui-btn-group{margin-left:10px}.layui-btn-fluid{width:100%}.layui-input,.layui-select,.layui-textarea{height:38px;line-height:1.3;line-height:38px\9;border-width:1px;border-style:solid;background-color:#fff;color:rgba(0,0,0,.85);border-radius:2px}.layui-input::-webkit-input-placeholder,.layui-select::-webkit-input-placeholder,.layui-textarea::-webkit-input-placeholder{line-height:1.3}.layui-input,.layui-textarea{display:block;width:100%;padding-left:10px}.layui-input:hover,.layui-textarea:hover{border-color:#d2d2d2!important}.layui-input:focus,.layui-textarea:focus{border-color:#16b777!important;box-shadow:0 0 0 3px rgba(22,183,119,.08)}.layui-textarea{position:relative;min-height:100px;height:auto;line-height:20px;padding:6px 10px;resize:vertical}.layui-input[disabled],.layui-textarea[disabled]{background-color:#fafafa}.layui-select{padding:0 10px}.layui-form input[type=checkbox],.layui-form input[type=radio],.layui-form select{display:none}.layui-form [lay-ignore]{display:initial}.layui-form-item{position:relative;margin-bottom:15px;clear:both;*zoom:1}.layui-form-item:after{content:'\20';clear:both;*zoom:1;display:block;height:0}.layui-form-label{position:relative;float:left;display:block;padding:9px 15px;width:80px;font-weight:400;line-height:20px;text-align:right}.layui-form-label-col{display:block;float:none;padding:9px 0;line-height:20px;text-align:left}.layui-form-item .layui-inline{margin-bottom:5px;margin-right:10px}.layui-input-block,.layui-input-inline{position:relative}.layui-input-block{margin-left:110px;min-height:36px}.layui-input-inline{display:inline-block;vertical-align:middle}.layui-form-item .layui-input-inline{float:left;width:190px;margin-right:10px}.layui-form-text .layui-input-inline{width:auto}.layui-form-mid{position:relative;float:left;display:block;padding:9px 0!important;line-height:20px;margin-right:10px}.layui-form-danger+.layui-form-select .layui-input,.layui-form-danger:focus{border-color:#ff5722!important;box-shadow:0 0 0 3px rgba(255,87,34,.08)}.layui-input-prefix,.layui-input-split,.layui-input-suffix,.layui-input-suffix .layui-input-affix{position:absolute;right:0;top:0;padding:0 10px;width:35px;height:100%;text-align:center;transition:all .3s;box-sizing:border-box}.layui-input-prefix{left:0;border-radius:2px 0 0 2px}.layui-input-suffix{right:0;border-radius:0 2px 2px 0}.layui-input-split{border-width:1px;border-style:solid}.layui-input-prefix .layui-icon,.layui-input-split .layui-icon,.layui-input-suffix .layui-icon{position:relative;font-size:16px;color:#5f5f5f;transition:all .3s}.layui-input-group{position:relative;display:table;box-sizing:border-box}.layui-input-group>*{display:table-cell;vertical-align:middle;position:relative}.layui-input-group .layui-input{padding-right:15px}.layui-input-group>.layui-input-prefix{width:auto;border-right:0}.layui-input-group>.layui-input-suffix{width:auto;border-left:0}.layui-input-group .layui-input-split{white-space:nowrap}.layui-input-wrap{position:relative;line-height:38px}.layui-input-wrap .layui-input{padding-right:35px}.layui-input-wrap .layui-input::-ms-clear,.layui-input-wrap .layui-input::-ms-reveal{display:none}.layui-input-wrap .layui-input-prefix+.layui-input,.layui-input-wrap .layui-input-prefix~* .layui-input{padding-left:35px}.layui-input-wrap .layui-input-split+.layui-input,.layui-input-wrap .layui-input-split~* .layui-input{padding-left:45px}.layui-input-wrap .layui-input-prefix~.layui-form-select{position:static}.layui-input-wrap .layui-input-prefix,.layui-input-wrap .layui-input-split,.layui-input-wrap .layui-input-suffix{pointer-events:none}.layui-input-wrap .layui-input:hover+.layui-input-split{border-color:#d2d2d2}.layui-input-wrap .layui-input:focus+.layui-input-split{border-color:#16b777}.layui-input-wrap .layui-input.layui-form-danger:focus+.layui-input-split{border-color:#ff5722}.layui-input-wrap .layui-input-prefix.layui-input-split{border-width:0;border-right-width:1px}.layui-input-wrap .layui-input-suffix.layui-input-split{border-width:0;border-left-width:1px}.layui-input-affix{line-height:38px}.layui-input-suffix .layui-input-affix{right:auto;left:-35px}.layui-input-affix .layui-icon{color:rgba(0,0,0,.8);pointer-events:auto!important;cursor:pointer}.layui-input-affix .layui-icon-clear{color:rgba(0,0,0,.3)}.layui-input-affix .layui-icon:hover{color:rgba(0,0,0,.6)}.layui-input-wrap .layui-input-number{width:24px;padding:0}.layui-input-wrap .layui-input-number .layui-icon{position:absolute;right:0;width:100%;height:50%;line-height:normal;font-size:12px}.layui-input-wrap .layui-input-number .layui-icon:before{position:absolute;left:50%;top:50%;margin-top:-6px;margin-left:-6px}.layui-input-wrap .layui-input-number .layui-icon-up{top:0;border-bottom:1px solid #eee}.layui-input-wrap .layui-input-number .layui-icon-down{bottom:0}.layui-input-wrap .layui-input-number .layui-icon:hover{font-weight:700}.layui-input-wrap .layui-input[type=number]::-webkit-inner-spin-button,.layui-input-wrap .layui-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none!important}.layui-input-wrap .layui-input[type=number]{-moz-appearance:textfield}.layui-input-wrap .layui-input[type=number].layui-input-number-out-of-range{color:#ff5722}.layui-form-select{position:relative;color:#5f5f5f}.layui-form-select .layui-input{padding-right:30px;cursor:pointer}.layui-form-select .layui-edge{position:absolute;right:10px;top:50%;margin-top:-3px;cursor:pointer;border-width:6px;border-top-color:#c2c2c2;border-top-style:solid;transition:all .3s;-webkit-transition:all .3s}.layui-form-select dl{display:none;position:absolute;left:0;top:42px;padding:5px 0;z-index:899;min-width:100%;border:1px solid #eee;max-height:300px;overflow-y:auto;background-color:#fff;border-radius:2px;box-shadow:1px 1px 4px rgb(0 0 0 / 8%);box-sizing:border-box}.layui-form-select dl dd,.layui-form-select dl dt{padding:0 10px;line-height:36px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layui-form-select dl dt{font-size:12px;color:#999}.layui-form-select dl dd{cursor:pointer}.layui-form-select dl dd:hover{background-color:#f8f8f8;-webkit-transition:.5s all;transition:.5s all}.layui-form-select .layui-select-group dd{padding-left:20px}.layui-form-select dl dd.layui-select-tips{padding-left:10px!important;color:#999}.layui-form-select dl dd.layui-this{background-color:#f8f8f8;color:#16b777;font-weight:700}.layui-form-select dl dd.layui-disabled{background-color:#fff}.layui-form-selected dl{display:block}.layui-form-selected .layui-edge{margin-top:-9px;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.layui-form-selected .layui-edge{margin-top:-3px\0}:root .layui-form-selected .layui-edge{margin-top:-9px\0/IE9}.layui-form-selectup dl{top:auto;bottom:42px}.layui-select-none{margin:5px 0;text-align:center;color:#999}.layui-select-disabled .layui-disabled{border-color:#eee!important}.layui-select-disabled .layui-edge{border-top-color:#d2d2d2}.layui-form-checkbox{position:relative;display:inline-block;vertical-align:middle;height:30px;line-height:30px;margin-right:10px;padding-right:30px;background-color:#fff;cursor:pointer;font-size:0;-webkit-transition:.1s linear;transition:.1s linear;box-sizing:border-box}.layui-form-checkbox>*{display:inline-block;vertical-align:middle}.layui-form-checkbox>div{padding:0 11px;font-size:14px;border-radius:2px 0 0 2px;background-color:#d2d2d2;color:#fff;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.layui-form-checkbox>div>.layui-icon{line-height:normal}.layui-form-checkbox:hover>div{background-color:#c2c2c2}.layui-form-checkbox>i{position:absolute;right:0;top:0;width:30px;height:100%;border:1px solid #d2d2d2;border-left:none;border-radius:0 2px 2px 0;color:#fff;color:rgba(255,255,255,0);font-size:20px;text-align:center;box-sizing:border-box}.layui-form-checkbox:hover>i{border-color:#c2c2c2;color:#c2c2c2}.layui-form-checked,.layui-form-checked:hover{border-color:#16b777}.layui-form-checked:hover>div,.layui-form-checked>div{background-color:#16b777}.layui-form-checked:hover>i,.layui-form-checked>i{color:#16b777}.layui-form-item .layui-form-checkbox{margin-top:4px}.layui-form-checkbox.layui-checkbox-disabled>div{background-color:#eee!important}.layui-form [lay-checkbox]{display:none}.layui-form-checkbox[lay-skin=primary]{height:auto!important;line-height:normal!important;min-width:18px;min-height:18px;border:none!important;margin-right:0;padding-left:24px;padding-right:0;background:0 0}.layui-form-checkbox[lay-skin=primary]>div{margin-top:-1px;padding-left:0;padding-right:15px;line-height:18px;background:0 0;color:#5f5f5f}.layui-form-checkbox[lay-skin=primary]>i{right:auto;left:0;width:16px;height:16px;line-height:14px;border:1px solid #d2d2d2;font-size:12px;border-radius:2px;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-checkbox[lay-skin=primary]:hover>i{border-color:#16b777;color:#fff}.layui-form-checked[lay-skin=primary]>i{border-color:#16b777!important;background-color:#16b777;color:#fff}.layui-checkbox-disabled[lay-skin=primary]>div{background:0 0!important}.layui-form-checked.layui-checkbox-disabled[lay-skin=primary]>i{background:#eee!important;border-color:#eee!important}.layui-checkbox-disabled[lay-skin=primary]:hover>i{border-color:#d2d2d2}.layui-form-item .layui-form-checkbox[lay-skin=primary]{margin-top:10px}.layui-form-checkbox[lay-skin=primary]>.layui-icon-indeterminate{border-color:#16b777}.layui-form-checkbox[lay-skin=primary]>.layui-icon-indeterminate:before{content:'';display:inline-block;vertical-align:middle;position:relative;width:50%;height:1px;margin:-1px auto 0;background-color:#16b777}.layui-form-switch{position:relative;display:inline-block;vertical-align:middle;height:24px;line-height:22px;min-width:44px;padding:0 5px;margin-top:8px;border:1px solid #d2d2d2;border-radius:20px;cursor:pointer;box-sizing:border-box;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-switch>i{position:absolute;left:5px;top:3px;width:16px;height:16px;border-radius:20px;background-color:#d2d2d2;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-switch>div{position:relative;top:0;margin-left:21px;padding:0!important;text-align:center!important;color:#999!important;font-style:normal!important;font-size:12px}.layui-form-onswitch{border-color:#16b777;background-color:#16b777}.layui-form-onswitch>i{left:100%;margin-left:-21px;background-color:#fff}.layui-form-onswitch>div{margin-left:0;margin-right:21px;color:#fff!important}.layui-checkbox-disabled{border-color:#eee!important}.layui-checkbox-disabled>div{color:#c2c2c2!important}.layui-checkbox-disabled>i{border-color:#eee!important}.layui-checkbox-disabled:hover>i{color:#fff!important}.layui-form-radio{display:inline-block;vertical-align:middle;line-height:28px;margin:6px 10px 0 0;padding-right:10px;cursor:pointer;font-size:0}.layui-form-radio>*{display:inline-block;vertical-align:middle;font-size:14px}.layui-form-radio>i{margin-right:8px;font-size:22px;color:#c2c2c2}.layui-form-radio:hover>*,.layui-form-radioed,.layui-form-radioed>i{color:#16b777}.layui-radio-disabled>i{color:#eee!important}.layui-radio-disabled>*{color:#c2c2c2!important}.layui-form [lay-radio]{display:none}.layui-form-pane .layui-form-label{width:110px;padding:8px 15px;height:38px;line-height:20px;border-width:1px;border-style:solid;border-radius:2px 0 0 2px;text-align:center;background-color:#fafafa;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box}.layui-form-pane .layui-input-inline{margin-left:-1px}.layui-form-pane .layui-input-block{margin-left:110px;left:-1px}.layui-form-pane .layui-input{border-radius:0 2px 2px 0}.layui-form-pane .layui-form-text .layui-form-label{float:none;width:100%;border-radius:2px;box-sizing:border-box;text-align:left}.layui-form-pane .layui-form-text .layui-input-inline{display:block;margin:0;top:-1px;clear:both}.layui-form-pane .layui-form-text .layui-input-block{margin:0;left:0;top:-1px}.layui-form-pane .layui-form-text .layui-textarea{min-height:100px;border-radius:0 0 2px 2px}.layui-form-pane .layui-form-checkbox{margin:4px 0 4px 10px}.layui-form-pane .layui-form-radio,.layui-form-pane .layui-form-switch{margin-top:6px;margin-left:10px}.layui-form-pane .layui-form-item[pane]{position:relative;border-width:1px;border-style:solid}.layui-form-pane .layui-form-item[pane] .layui-form-label{position:absolute;left:0;top:0;height:100%;border-width:0;border-right-width:1px}.layui-form-pane .layui-form-item[pane] .layui-input-inline{margin-left:110px}@media screen and (max-width:450px){.layui-form-item .layui-form-label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-form-item .layui-inline{display:block;margin-right:0;margin-bottom:20px;clear:both}.layui-form-item .layui-inline:after{content:'\20';clear:both;display:block;height:0}.layui-form-item .layui-input-inline{display:block;float:none;left:-3px;width:auto!important;margin:0 0 10px 112px}.layui-form-item .layui-input-inline+.layui-form-mid{margin-left:110px;top:-5px;padding:0}.layui-form-item .layui-form-checkbox{margin-right:5px;margin-bottom:5px}}.layui-laypage{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;margin:10px 0;font-size:0}.layui-laypage>a:first-child,.layui-laypage>a:first-child em{border-radius:2px 0 0 2px}.layui-laypage>a:last-child,.layui-laypage>a:last-child em{border-radius:0 2px 2px 0}.layui-laypage>:first-child{margin-left:0!important}.layui-laypage>:last-child{margin-right:0!important}.layui-laypage a,.layui-laypage button,.layui-laypage input,.layui-laypage select,.layui-laypage span{border:1px solid #eee}.layui-laypage a,.layui-laypage span{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;padding:0 15px;height:28px;line-height:28px;margin:0 -1px 5px 0;background-color:#fff;color:#333;font-size:12px}.layui-laypage a[data-page]{color:#333}.layui-laypage a{text-decoration:none!important;cursor:pointer}.layui-laypage a:hover{color:#16baaa}.layui-laypage em{font-style:normal}.layui-laypage .layui-laypage-spr{color:#999;font-weight:700}.layui-laypage .layui-laypage-curr{position:relative}.layui-laypage .layui-laypage-curr em{position:relative;color:#fff}.layui-laypage .layui-laypage-curr .layui-laypage-em{position:absolute;left:-1px;top:-1px;padding:1px;width:100%;height:100%;background-color:#16baaa}.layui-laypage-em{border-radius:2px}.layui-laypage-next em,.layui-laypage-prev em{font-family:Sim sun;font-size:16px}.layui-laypage .layui-laypage-count,.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh,.layui-laypage .layui-laypage-skip{margin-left:10px;margin-right:10px;padding:0;border:none}.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh{vertical-align:top}.layui-laypage .layui-laypage-refresh i{font-size:18px;cursor:pointer}.layui-laypage select{height:22px;padding:3px;border-radius:2px;cursor:pointer}.layui-laypage .layui-laypage-skip{height:30px;line-height:30px;color:#999}.layui-laypage button,.layui-laypage input{height:30px;line-height:30px;border-radius:2px;vertical-align:top;background-color:#fff;box-sizing:border-box}.layui-laypage input{display:inline-block;width:40px;margin:0 10px;padding:0 3px;text-align:center}.layui-laypage input:focus,.layui-laypage select:focus{border-color:#16baaa!important}.layui-laypage button{margin-left:10px;padding:0 10px;cursor:pointer}.layui-flow-more{margin:10px 0;text-align:center;color:#999;font-size:14px;clear:both}.layui-flow-more a{height:32px;line-height:32px}.layui-flow-more a *{display:inline-block;vertical-align:top}.layui-flow-more a cite{padding:0 20px;border-radius:3px;background-color:#eee;color:#333;font-style:normal}.layui-flow-more a cite:hover{opacity:.8}.layui-flow-more a i{font-size:30px;color:#737383}.layui-table{width:100%;margin:10px 0;background-color:#fff;color:#5f5f5f}.layui-table tr{transition:all .3s;-webkit-transition:all .3s}.layui-table th{text-align:left;font-weight:600}.layui-table-mend{background-color:#fff}.layui-table-click,.layui-table-hover,.layui-table[lay-even] tbody tr:nth-child(even){background-color:#f8f8f8}.layui-table-checked{background-color:#dbfbf0}.layui-table-checked.layui-table-click,.layui-table-checked.layui-table-hover{background-color:#abf8dd}.layui-table td,.layui-table th,.layui-table-col-set,.layui-table-fixed-r,.layui-table-grid-down,.layui-table-header,.layui-table-mend,.layui-table-page,.layui-table-tips-main,.layui-table-tool,.layui-table-total,.layui-table-view,.layui-table[lay-skin=line],.layui-table[lay-skin=row]{border-width:1px;border-style:solid;border-color:#eee}.layui-table td,.layui-table th{position:relative;padding:9px 15px;min-height:20px;line-height:20px;font-size:14px}.layui-table[lay-skin=line] td,.layui-table[lay-skin=line] th{border-width:0;border-bottom-width:1px}.layui-table[lay-skin=row] td,.layui-table[lay-skin=row] th{border-width:0;border-right-width:1px}.layui-table[lay-skin=nob] td,.layui-table[lay-skin=nob] th{border:none}.layui-table img{max-width:100px}.layui-table[lay-size=lg] td,.layui-table[lay-size=lg] th{padding-top:15px;padding-right:30px;padding-bottom:15px;padding-left:30px}.layui-table-view .layui-table[lay-size=lg] .layui-table-cell{height:50px;line-height:40px}.layui-table[lay-size=sm] td,.layui-table[lay-size=sm] th{padding-top:5px;padding-right:10px;padding-bottom:5px;padding-left:10px;font-size:12px}.layui-table-view .layui-table[lay-size=sm] .layui-table-cell{height:30px;line-height:20px;padding-top:5px;padding-left:11px;padding-right:11px}.layui-table[lay-data],.layui-table[lay-options]{display:none}.layui-table-box{position:relative;overflow:hidden}.layui-table-view{clear:both}.layui-table-view .layui-table{position:relative;width:auto;margin:0;border:0;border-collapse:separate}.layui-table-view .layui-table[lay-skin=line]{border-width:0;border-right-width:1px}.layui-table-view .layui-table[lay-skin=row]{border-width:0;border-bottom-width:1px}.layui-table-view .layui-table td,.layui-table-view .layui-table th{padding:0;border-top:none;border-left:none}.layui-table-view .layui-table th [lay-event],.layui-table-view .layui-table th.layui-unselect .layui-table-cell span{cursor:pointer}.layui-table-view .layui-table td,.layui-table-view .layui-table th span{cursor:default}.layui-table-view .layui-table td[data-edit]{cursor:text}.layui-table-view .layui-table td[data-edit]:hover:after{position:absolute;left:0;top:0;width:100%;height:100%;box-sizing:border-box;border:1px solid #16b777;pointer-events:none;content:""}.layui-table-view .layui-form-checkbox[lay-skin=primary] i{width:18px;height:18px;line-height:16px}.layui-table-view .layui-form-radio{line-height:0;padding:0}.layui-table-view .layui-form-radio>i{margin:0;font-size:20px}.layui-table-init{position:absolute;left:0;top:0;width:100%;height:100%;text-align:center;z-index:199}.layui-table-init .layui-icon{position:absolute;left:50%;top:50%;margin:-15px 0 0 -15px;font-size:30px;color:#c2c2c2}.layui-table-header{border-width:0;border-bottom-width:1px;overflow:hidden}.layui-table-header .layui-table{margin-bottom:-1px}.layui-table-column{position:relative;width:100%;min-height:41px;padding:8px 16px;border-width:0;border-bottom-width:1px}.layui-table-column .layui-btn-container{margin-bottom:-8px}.layui-table-column .layui-btn-container .layui-btn{margin-right:8px;margin-bottom:8px}.layui-table-tool .layui-inline[lay-event]{position:relative;width:26px;height:26px;padding:5px;line-height:16px;margin-right:10px;text-align:center;color:#333;border:1px solid #ccc;cursor:pointer;-webkit-transition:.5s all;transition:.5s all}.layui-table-tool .layui-inline[lay-event]:hover{border:1px solid #999}.layui-table-tool-temp{padding-right:120px}.layui-table-tool-self{position:absolute;right:17px;top:10px}.layui-table-tool .layui-table-tool-self .layui-inline[lay-event]{margin:0 0 0 10px}.layui-table-tool-panel{position:absolute;top:29px;left:-1px;z-index:399;padding:5px 0!important;min-width:150px;min-height:40px;border:1px solid #d2d2d2;text-align:left;overflow-y:auto;background-color:#fff;box-shadow:0 2px 4px rgba(0,0,0,.12)}.layui-table-tool-panel li{padding:0 10px;margin:0!important;line-height:30px;list-style-type:none!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-webkit-transition:.5s all;transition:.5s all}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary]{width:100%}.layui-table-tool-panel li:hover{background-color:#f8f8f8}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary]{padding-left:28px}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary] i{position:absolute;left:0;top:0}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary] span{padding:0}.layui-table-tool .layui-table-tool-self .layui-table-tool-panel{left:auto;right:-1px}.layui-table-col-set{position:absolute;right:0;top:0;width:20px;height:100%;border-width:0;border-left-width:1px;background-color:#fff}.layui-table-sort{width:10px;height:20px;margin-left:5px;cursor:pointer!important}.layui-table-sort .layui-edge{position:absolute;left:5px;border-width:5px}.layui-table-sort .layui-table-sort-asc{top:3px;border-top:none;border-bottom-style:solid;border-bottom-color:#b2b2b2}.layui-table-sort .layui-table-sort-asc:hover{border-bottom-color:#5f5f5f}.layui-table-sort .layui-table-sort-desc{bottom:5px;border-bottom:none;border-top-style:solid;border-top-color:#b2b2b2}.layui-table-sort .layui-table-sort-desc:hover{border-top-color:#5f5f5f}.layui-table-sort[lay-sort=asc] .layui-table-sort-asc{border-bottom-color:#000}.layui-table-sort[lay-sort=desc] .layui-table-sort-desc{border-top-color:#000}.layui-table-cell{height:38px;line-height:28px;padding:6px 15px;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box}.layui-table-cell .layui-form-checkbox[lay-skin=primary]{top:-1px;padding:0}.layui-table-cell .layui-form-checkbox[lay-skin=primary]>div{padding-left:24px}.layui-table-cell .layui-table-link{color:#01aaed}.layui-table-cell .layui-btn{vertical-align:inherit}.layui-table-cell[align=center]{-webkit-box-pack:center}.layui-table-cell[align=right]{-webkit-box-pack:end}.laytable-cell-checkbox,.laytable-cell-numbers,.laytable-cell-radio,.laytable-cell-space{text-align:center;-webkit-box-pack:center}.layui-table-body{position:relative;overflow:auto;margin-right:-1px;margin-bottom:-1px}.layui-table-body .layui-none{line-height:26px;padding:30px 15px;text-align:center;color:#999}.layui-table-fixed{position:absolute;left:0;top:0;z-index:101}.layui-table-fixed .layui-table-body{overflow:hidden}.layui-table-fixed-l{box-shadow:1px 0 8px rgba(0,0,0,.08)}.layui-table-fixed-r{left:auto;right:-1px;border-width:0;border-left-width:1px;box-shadow:-1px 0 8px rgba(0,0,0,.08)}.layui-table-fixed-r .layui-table-header{position:relative;overflow:visible}.layui-table-mend{position:absolute;right:-49px;top:0;height:100%;width:50px;border-width:0;border-left-width:1px}.layui-table-tool{position:relative;width:100%;min-height:50px;line-height:30px;padding:10px 15px;border-width:0;border-bottom-width:1px}.layui-table-tool .layui-btn-container{margin-bottom:-10px}.layui-table-total{margin-bottom:-1px;border-width:0;border-top-width:1px;overflow:hidden}.layui-table-page{border-width:0;border-top-width:1px;margin-bottom:-1px;white-space:nowrap;overflow:hidden}.layui-table-page>div{height:26px}.layui-table-page .layui-laypage{margin:0}.layui-table-page .layui-laypage a,.layui-table-page .layui-laypage span{height:26px;line-height:26px;margin-bottom:10px;border:none;background:0 0}.layui-table-page .layui-laypage a,.layui-table-page .layui-laypage span.layui-laypage-curr{padding:0 12px}.layui-table-page .layui-laypage span{margin-left:0;padding:0}.layui-table-page .layui-laypage .layui-laypage-prev{margin-left:-11px!important}.layui-table-page .layui-laypage .layui-laypage-curr .layui-laypage-em{left:0;top:0;padding:0}.layui-table-page .layui-laypage button,.layui-table-page .layui-laypage input{height:26px;line-height:26px}.layui-table-page .layui-laypage input{width:40px}.layui-table-page .layui-laypage button{padding:0 10px}.layui-table-page select{height:18px}.layui-table-pagebar{float:right;line-height:23px}.layui-table-pagebar .layui-btn-sm{margin-top:-1px}.layui-table-pagebar .layui-btn-xs{margin-top:2px}.layui-table-view select[lay-ignore]{display:inline-block}.layui-table-patch .layui-table-cell{padding:0;width:30px}.layui-table-edit{position:absolute;left:0;top:0;z-index:189;min-width:100%;min-height:100%;padding:5px 14px;border-radius:0;box-shadow:1px 1px 20px rgba(0,0,0,.15);background-color:#fff}.layui-table-edit:focus{border-color:#16b777!important}input.layui-input.layui-table-edit{height:100%}select.layui-table-edit{padding:0 0 0 10px;border-color:#d2d2d2}.layui-table-view .layui-form-checkbox,.layui-table-view .layui-form-radio,.layui-table-view .layui-form-switch{top:0;margin:0}.layui-table-view .layui-form-checkbox{top:-1px;height:26px;line-height:26px}.layui-table-view .layui-form-checkbox i{height:26px}.layui-table-grid .layui-table-cell{overflow:visible}.layui-table-grid-down{position:absolute;top:0;right:0;width:24px;height:100%;padding:5px 0;border-width:0;border-left-width:1px;text-align:center;background-color:#fff;color:#999;cursor:pointer}.layui-table-grid-down .layui-icon{position:absolute;top:50%;left:50%;margin:-8px 0 0 -8px;font-size:14px}.layui-table-grid-down:hover{background-color:#fbfbfb}.layui-table-expanded{height:95px}.layui-table-expanded .layui-table-cell,.layui-table-view .layui-table[lay-size=lg] .layui-table-expanded .layui-table-cell,.layui-table-view .layui-table[lay-size=sm] .layui-table-expanded .layui-table-cell{height:auto;max-height:94px;white-space:normal;text-overflow:clip}.layui-table-cell-c{position:absolute;bottom:-10px;right:50%;margin-right:-9px;width:20px;height:20px;line-height:18px;cursor:pointer;text-align:center;background-color:#fff;border:1px solid #eee;border-radius:50%;z-index:1000;transition:.3s all;font-size:14px}.layui-table-cell-c:hover{border-color:#16b777}.layui-table-expanded td:hover .layui-table-cell{overflow:auto}.layui-table-main>.layui-table>tbody>tr:last-child>td>.layui-table-cell-c{bottom:0}body .layui-table-tips .layui-layer-content{background:0 0;padding:0;box-shadow:0 1px 6px rgba(0,0,0,.12)}.layui-table-tips-main{margin:-49px 0 0 -1px;max-height:150px;padding:8px 15px;font-size:14px;overflow-y:scroll;background-color:#fff;color:#5f5f5f}.layui-table-tips-c{position:absolute;right:-3px;top:-13px;width:20px;height:20px;padding:3px;cursor:pointer;background-color:#5f5f5f;border-radius:50%;color:#fff}.layui-table-tips-c:hover{background-color:#777}.layui-table-tips-c:before{position:relative;right:-2px}.layui-table-tree-nodeIcon{max-width:20px}.layui-table-tree-nodeIcon>*{width:100%}.layui-table-tree-flexIcon,.layui-table-tree-nodeIcon{margin-right:2px}.layui-table-tree-flexIcon{cursor:pointer}.layui-upload-file{display:none!important;opacity:.01;filter:Alpha(opacity=1)}.layui-upload-list{margin:11px 0}.layui-upload-choose{max-width:200px;padding:0 10px;color:#999;font-size:14px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-upload-drag{position:relative;display:inline-block;padding:30px;border:1px dashed #e2e2e2;background-color:#fff;text-align:center;cursor:pointer;color:#999}.layui-upload-drag .layui-icon{font-size:50px;color:#16baaa}.layui-upload-drag[lay-over]{border-color:#16baaa}.layui-upload-form{display:inline-block}.layui-upload-iframe{position:absolute;width:0;height:0;border:0;visibility:hidden}.layui-upload-wrap{position:relative;display:inline-block;vertical-align:middle}.layui-upload-wrap .layui-upload-file{display:block!important;position:absolute;left:0;top:0;z-index:10;font-size:100px;width:100%;height:100%;opacity:.01;filter:Alpha(opacity=1);cursor:pointer}.layui-btn-container .layui-upload-choose{padding-left:0}.layui-menu{position:relative;margin:5px 0;background-color:#fff;box-sizing:border-box}.layui-menu *{box-sizing:border-box}.layui-menu li,.layui-menu-body-title,.layui-menu-body-title a{padding:5px 15px;color:initial}.layui-menu li{position:relative;margin:0 0 1px;line-height:26px;color:rgba(0,0,0,.8);font-size:14px;white-space:nowrap;cursor:pointer;transition:all .3s}.layui-menu li:hover{background-color:#f8f8f8}.layui-menu li.layui-disabled,.layui-menu li.layui-disabled *{background:0 0!important;color:#d2d2d2!important;cursor:not-allowed!important}.layui-menu-item-parent:hover>.layui-menu-body-panel{display:block;animation-name:layui-fadein;animation-duration:.3s;animation-fill-mode:both;animation-delay:.2s}.layui-menu-item-group>.layui-menu-body-title,.layui-menu-item-parent>.layui-menu-body-title{padding-right:38px}.layui-menu .layui-menu-item-divider:hover,.layui-menu .layui-menu-item-group:hover,.layui-menu .layui-menu-item-none:hover{background:0 0;cursor:default}.layui-menu .layui-menu-item-group>ul{margin:5px 0 -5px}.layui-menu .layui-menu-item-group>.layui-menu-body-title{color:rgba(0,0,0,.35);user-select:none}.layui-menu .layui-menu-item-none{color:rgba(0,0,0,.35);cursor:default}.layui-menu .layui-menu-item-none{text-align:center}.layui-menu .layui-menu-item-divider{margin:5px 0;padding:0;height:0;line-height:0;border-bottom:1px solid #eee;overflow:hidden}.layui-menu .layui-menu-item-down:hover,.layui-menu .layui-menu-item-up:hover{cursor:pointer}.layui-menu .layui-menu-item-up>.layui-menu-body-title{color:rgba(0,0,0,.8)}.layui-menu .layui-menu-item-up>ul{visibility:hidden;height:0;overflow:hidden}.layui-menu .layui-menu-item-down>.layui-menu-body-title>.layui-icon-down{transform:rotate(180deg)}.layui-menu .layui-menu-item-up>.layui-menu-body-title>.layui-icon-up{transform:rotate(-180deg)}.layui-menu .layui-menu-item-down:hover>.layui-menu-body-title>.layui-icon,.layui-menu .layui-menu-item-up>.layui-menu-body-title:hover>.layui-icon{color:#000}.layui-menu .layui-menu-item-down>ul{visibility:visible;height:auto}.layui-menu .layui-menu-item-checked,.layui-menu .layui-menu-item-checked2{background-color:#f8f8f8!important;color:#16b777}.layui-menu .layui-menu-item-checked a,.layui-menu .layui-menu-item-checked2 a{color:#16b777}.layui-menu .layui-menu-item-checked:after{position:absolute;right:-1px;top:0;bottom:0;border-right:3px solid #16b777;content:""}.layui-menu-body-title{position:relative;margin:-5px -15px;overflow:hidden;text-overflow:ellipsis}.layui-menu-body-title a{display:block;margin:-5px -15px;color:rgba(0,0,0,.8)}.layui-menu-body-title a:hover{transition:all .3s}.layui-menu-body-title>.layui-icon{position:absolute;right:15px;top:50%;margin-top:-6px;line-height:normal;font-size:14px;transition:all .2s;-webkit-transition:all .2s}.layui-menu-body-title>.layui-icon:hover{transition:all .3s}.layui-menu-body-title>.layui-icon-right{right:14px}.layui-menu-body-panel{display:none;position:absolute;top:-7px;left:100%;z-index:1000;margin-left:13px;padding:5px 0}.layui-menu-body-panel:before{content:"";position:absolute;width:20px;left:-16px;top:0;bottom:0}.layui-menu-body-panel-left{left:auto;right:100%;margin:0 13px 0}.layui-menu-body-panel-left:before{left:auto;right:-16px}.layui-menu-lg li{line-height:32px}.layui-menu-lg .layui-menu-body-title a:hover,.layui-menu-lg li:hover{background:0 0;color:#16b777}.layui-menu-lg li .layui-menu-body-panel{margin-left:14px}.layui-menu-lg li .layui-menu-body-panel-left{margin:0 15px 0}.layui-dropdown{position:absolute;left:-999999px;top:-999999px;z-index:77777777;margin:5px 0;min-width:100px}.layui-dropdown:before{content:"";position:absolute;width:100%;height:6px;left:0;top:-6px}.layui-dropdown-shade{top:0;left:0;width:100%;height:100%;_height:expression(document.body.offsetHeight+"px");position:fixed;_position:absolute;pointer-events:auto}.layui-nav{position:relative;padding:0 15px;background-color:#2f363c;color:#fff;border-radius:2px;font-size:0;box-sizing:border-box}.layui-nav *{font-size:14px}.layui-nav .layui-nav-item{position:relative;display:inline-block;*display:inline;*zoom:1;margin-top:0;list-style:none;vertical-align:middle;line-height:60px}.layui-nav .layui-nav-item a{display:block;padding:0 20px;color:#fff;color:rgba(255,255,255,.7);transition:all .3s;-webkit-transition:all .3s}.layui-nav .layui-this:after,.layui-nav-bar{content:"";position:absolute;left:0;top:0;width:0;height:3px;background-color:#16b777;transition:all .2s;-webkit-transition:all .2s;pointer-events:none}.layui-nav-bar{z-index:1000}.layui-nav[lay-bar=disabled] .layui-nav-bar{display:none}.layui-nav .layui-nav-item a:hover,.layui-nav .layui-this a{color:#fff;text-decoration:none}.layui-nav .layui-this:after{top:auto;bottom:0;width:100%}.layui-nav-img{width:30px;height:30px;margin-right:10px;border-radius:50%}.layui-nav .layui-nav-more{position:absolute;top:0;right:3px;left:auto!important;margin-top:0;font-size:12px;cursor:pointer;transition:all .2s;-webkit-transition:all .2s}.layui-nav .layui-nav-mored,.layui-nav-itemed>a .layui-nav-more{transform:rotate(180deg)}.layui-nav-child{display:none;position:absolute;left:0;top:65px;min-width:100%;line-height:36px;padding:5px 0;box-shadow:0 2px 4px rgba(0,0,0,.12);border:1px solid #eee;background-color:#fff;z-index:100;border-radius:2px;white-space:nowrap;box-sizing:border-box}.layui-nav .layui-nav-child a{color:#5f5f5f;color:rgba(0,0,0,.8)}.layui-nav .layui-nav-child a:hover{background-color:#f8f8f8;color:rgba(0,0,0,.8)}.layui-nav-child dd{margin:1px 0;position:relative}.layui-nav-child dd.layui-this{background-color:#f8f8f8;color:#000}.layui-nav-child dd.layui-this:after{display:none}.layui-nav-child-r{left:auto;right:0}.layui-nav-child-c{text-align:center}.layui-nav.layui-nav-tree{width:200px;padding:0}.layui-nav-tree .layui-nav-item{display:block;width:100%;line-height:40px}.layui-nav-tree .layui-nav-item a{position:relative;height:40px;line-height:40px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-nav-tree .layui-nav-item>a{padding-top:5px;padding-bottom:5px}.layui-nav-tree .layui-nav-more{right:15px}.layui-nav-tree .layui-nav-item>a .layui-nav-more{padding:5px 0}.layui-nav-tree .layui-nav-bar{width:5px;height:0}.layui-side .layui-nav-tree .layui-nav-bar{width:2px}.layui-nav-tree .layui-nav-child dd.layui-this,.layui-nav-tree .layui-nav-child dd.layui-this a,.layui-nav-tree .layui-this,.layui-nav-tree .layui-this>a,.layui-nav-tree .layui-this>a:hover{background-color:#16baaa;color:#fff}.layui-nav-tree .layui-this:after{display:none}.layui-nav-itemed>a,.layui-nav-tree .layui-nav-title a,.layui-nav-tree .layui-nav-title a:hover{color:#fff!important}.layui-nav-tree .layui-nav-bar{background-color:#16baaa}.layui-nav-tree .layui-nav-child{position:relative;z-index:0;top:0;border:none;background:0 0;background-color:rgba(0,0,0,.3);box-shadow:none}.layui-nav-tree .layui-nav-child dd{margin:0}.layui-nav-tree .layui-nav-child a{color:#fff;color:rgba(255,255,255,.7)}.layui-nav-tree .layui-nav-child a:hover{background:0 0;color:#fff}.layui-nav-itemed>.layui-nav-child,.layui-nav-itemed>.layui-nav-child>.layui-this>.layui-nav-child{display:block}.layui-nav-side{position:fixed;top:0;bottom:0;left:0;overflow-x:hidden;z-index:999}.layui-nav-tree.layui-bg-gray a,.layui-nav.layui-bg-gray .layui-nav-item a{color:#373737;color:rgba(0,0,0,.8)}.layui-nav-tree.layui-bg-gray .layui-nav-itemed>a{color:#000!important}.layui-nav.layui-bg-gray .layui-this a{color:#16b777}.layui-nav-tree.layui-bg-gray .layui-nav-child{padding-left:11px;background:0 0}.layui-nav-tree.layui-bg-gray .layui-nav-child dd.layui-this,.layui-nav-tree.layui-bg-gray .layui-nav-child dd.layui-this a,.layui-nav-tree.layui-bg-gray .layui-this,.layui-nav-tree.layui-bg-gray .layui-this>a{background:0 0!important;color:#16b777!important;font-weight:700}.layui-nav-tree.layui-bg-gray .layui-nav-bar{background-color:#16b777}.layui-breadcrumb{visibility:hidden;font-size:0}.layui-breadcrumb>*{font-size:14px}.layui-breadcrumb a{color:#999!important}.layui-breadcrumb a:hover{color:#16b777!important}.layui-breadcrumb a cite{color:#5f5f5f;font-style:normal}.layui-breadcrumb span[lay-separator]{margin:0 10px;color:#999}.layui-tab{margin:10px 0;text-align:left!important}.layui-tab[overflow]>.layui-tab-title{overflow:hidden}.layui-tab .layui-tab-title{position:relative;left:0;height:40px;white-space:nowrap;font-size:0;border-bottom-width:1px;border-bottom-style:solid;transition:all .2s;-webkit-transition:all .2s}.layui-tab .layui-tab-title li{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;font-size:14px;transition:all .2s;-webkit-transition:all .2s}.layui-tab .layui-tab-title li{position:relative;line-height:40px;min-width:65px;margin:0;padding:0 15px;text-align:center;cursor:pointer}.layui-tab .layui-tab-title li a{display:block;padding:0 15px;margin:0 -15px}.layui-tab-title .layui-this{color:#000}.layui-tab-title .layui-this:after{position:absolute;left:0;top:0;content:"";width:100%;height:41px;border-width:1px;border-style:solid;border-bottom-color:#fff;border-radius:2px 2px 0 0;box-sizing:border-box;pointer-events:none}.layui-tab-bar{position:absolute;right:0;top:0;z-index:10;width:30px;height:39px;line-height:39px;border-width:1px;border-style:solid;border-radius:2px;text-align:center;background-color:#fff;cursor:pointer}.layui-tab-bar .layui-icon{position:relative;display:inline-block;top:3px;transition:all .3s;-webkit-transition:all .3s}.layui-tab-item{display:none}.layui-tab-more{padding-right:30px;height:auto!important;white-space:normal!important}.layui-tab-more li.layui-this:after{border-bottom-color:#eee;border-radius:2px}.layui-tab-more .layui-tab-bar .layui-icon{top:-2px;top:3px\0;-webkit-transform:rotate(180deg);transform:rotate(180deg)}:root .layui-tab-more .layui-tab-bar .layui-icon{top:-2px\0/IE9}.layui-tab-content{padding:15px 0}.layui-tab-title li .layui-tab-close{position:relative;display:inline-block;width:18px;height:18px;line-height:20px;margin-left:8px;top:1px;text-align:center;font-size:14px;color:#c2c2c2;transition:all .2s;-webkit-transition:all .2s}.layui-tab-title li .layui-tab-close:hover{border-radius:2px;background-color:#ff5722;color:#fff}.layui-tab-brief>.layui-tab-title .layui-this{color:#16baaa}.layui-tab-brief>.layui-tab-more li.layui-this:after,.layui-tab-brief>.layui-tab-title .layui-this:after{border:none;border-radius:0;border-bottom:2px solid #16b777}.layui-tab-brief[overflow]>.layui-tab-title .layui-this:after{top:-1px}.layui-tab-card{border-width:1px;border-style:solid;border-radius:2px;box-shadow:0 2px 5px 0 rgba(0,0,0,.1)}.layui-tab-card>.layui-tab-title{background-color:#fafafa}.layui-tab-card>.layui-tab-title li{margin-right:-1px;margin-left:-1px}.layui-tab-card>.layui-tab-title .layui-this{background-color:#fff}.layui-tab-card>.layui-tab-title .layui-this:after{border-top:none;border-width:1px;border-bottom-color:#fff}.layui-tab-card>.layui-tab-title .layui-tab-bar{height:40px;line-height:40px;border-radius:0;border-top:none;border-right:none}.layui-tab-card>.layui-tab-more .layui-this{background:0 0;color:#16b777}.layui-tab-card>.layui-tab-more .layui-this:after{border:none}.layui-timeline{padding-left:5px}.layui-timeline-item{position:relative;padding-bottom:20px}.layui-timeline-axis{position:absolute;left:-5px;top:0;z-index:10;width:20px;height:20px;line-height:20px;background-color:#fff;color:#16b777;border-radius:50%;text-align:center;cursor:pointer}.layui-timeline-axis:hover{color:#ff5722}.layui-timeline-item:before{content:"";position:absolute;left:5px;top:0;z-index:0;width:1px;height:100%}.layui-timeline-item:first-child:before{display:block}.layui-timeline-item:last-child:before{display:none}.layui-timeline-content{padding-left:25px}.layui-timeline-title{position:relative;margin-bottom:10px;line-height:22px}.layui-badge,.layui-badge-dot,.layui-badge-rim{position:relative;display:inline-block;padding:0 6px;font-size:12px;text-align:center;background-color:#ff5722;color:#fff;border-radius:2px}.layui-badge{height:18px;line-height:18px}.layui-badge-dot{width:8px;height:8px;padding:0;border-radius:50%}.layui-badge-rim{height:18px;line-height:18px;border-width:1px;border-style:solid;background-color:#fff;color:#5f5f5f}.layui-btn .layui-badge,.layui-btn .layui-badge-dot{margin-left:5px}.layui-nav .layui-badge,.layui-nav .layui-badge-dot{position:absolute;top:50%;margin:-5px 6px 0}.layui-nav .layui-badge{margin-top:-10px}.layui-tab-title .layui-badge,.layui-tab-title .layui-badge-dot{left:5px;top:-2px}.layui-carousel{position:relative;left:0;top:0;background-color:#f8f8f8}.layui-carousel>[carousel-item]{position:relative;width:100%;height:100%;overflow:hidden}.layui-carousel>[carousel-item]:before{position:absolute;content:'\e63d';left:50%;top:50%;width:100px;line-height:20px;margin:-10px 0 0 -50px;text-align:center;color:#c2c2c2;font-family:layui-icon!important;font-size:30px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.layui-carousel>[carousel-item]>*{display:none;position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f8f8f8;transition-duration:.3s;-webkit-transition-duration:.3s}.layui-carousel-updown>*{-webkit-transition:.3s ease-in-out up;transition:.3s ease-in-out up}.layui-carousel-arrow{display:none\0;opacity:0;position:absolute;left:10px;top:50%;margin-top:-18px;width:36px;height:36px;line-height:36px;text-align:center;font-size:20px;border:none 0;border-radius:50%;background-color:rgba(0,0,0,.2);color:#fff;-webkit-transition-duration:.3s;transition-duration:.3s;cursor:pointer}.layui-carousel-arrow[lay-type=add]{left:auto!important;right:10px}.layui-carousel[lay-arrow=always] .layui-carousel-arrow{opacity:1;left:20px}.layui-carousel[lay-arrow=always] .layui-carousel-arrow[lay-type=add]{right:20px}.layui-carousel[lay-arrow=none] .layui-carousel-arrow{display:none}.layui-carousel-arrow:hover,.layui-carousel-ind ul:hover{background-color:rgba(0,0,0,.35)}.layui-carousel:hover .layui-carousel-arrow{display:block\0;opacity:1;left:20px}.layui-carousel:hover .layui-carousel-arrow[lay-type=add]{right:20px}.layui-carousel-ind{position:relative;top:-35px;width:100%;line-height:0!important;text-align:center;font-size:0}.layui-carousel[lay-indicator=outside]{margin-bottom:30px}.layui-carousel[lay-indicator=outside] .layui-carousel-ind{top:10px}.layui-carousel[lay-indicator=outside] .layui-carousel-ind ul{background-color:rgba(0,0,0,.5)}.layui-carousel[lay-indicator=none] .layui-carousel-ind{display:none}.layui-carousel-ind ul{display:inline-block;padding:5px;background-color:rgba(0,0,0,.2);border-radius:10px;-webkit-transition-duration:.3s;transition-duration:.3s}.layui-carousel-ind ul li{display:inline-block;width:10px;height:10px;margin:0 3px;font-size:14px;background-color:#eee;background-color:rgba(255,255,255,.5);border-radius:50%;cursor:pointer;-webkit-transition-duration:.3s;transition-duration:.3s}.layui-carousel-ind ul li:hover{background-color:rgba(255,255,255,.7)}.layui-carousel-ind ul li.layui-this{background-color:#fff}.layui-carousel>[carousel-item]>.layui-carousel-next,.layui-carousel>[carousel-item]>.layui-carousel-prev,.layui-carousel>[carousel-item]>.layui-this{display:block}.layui-carousel>[carousel-item]>.layui-this{left:0}.layui-carousel>[carousel-item]>.layui-carousel-prev{left:-100%}.layui-carousel>[carousel-item]>.layui-carousel-next{left:100%}.layui-carousel>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel>[carousel-item]>.layui-carousel-prev.layui-carousel-right{left:0}.layui-carousel>[carousel-item]>.layui-this.layui-carousel-left{left:-100%}.layui-carousel>[carousel-item]>.layui-this.layui-carousel-right{left:100%}.layui-carousel[lay-anim=updown] .layui-carousel-arrow{left:50%!important;top:20px;margin:0 0 0 -18px}.layui-carousel[lay-anim=updown] .layui-carousel-arrow[lay-type=add]{top:auto!important;bottom:20px}.layui-carousel[lay-anim=updown] .layui-carousel-ind{position:absolute;top:50%;right:20px;width:auto;height:auto}.layui-carousel[lay-anim=updown] .layui-carousel-ind ul{padding:3px 5px}.layui-carousel[lay-anim=updown] .layui-carousel-ind li{display:block;margin:6px 0}.layui-carousel[lay-anim=updown]>[carousel-item]>*{left:0!important}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this{top:0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-prev{top:-100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-next{top:100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-prev.layui-carousel-right{top:0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this.layui-carousel-left{top:-100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this.layui-carousel-right{top:100%}.layui-carousel[lay-anim=fade]>[carousel-item]>*{left:0!important}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-next,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-prev{opacity:0}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-prev.layui-carousel-right{opacity:1}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-this.layui-carousel-left,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-this.layui-carousel-right{opacity:0}.layui-fixbar{position:fixed;right:16px;bottom:16px;z-index:999999}.layui-fixbar li{width:50px;height:50px;line-height:50px;margin-bottom:1px;text-align:center;cursor:pointer;font-size:30px;background-color:#9f9f9f;color:#fff;border-radius:2px;opacity:.95}.layui-fixbar li:hover{opacity:.85}.layui-fixbar li:active{opacity:1}.layui-fixbar .layui-fixbar-top{display:none;font-size:40px}body .layui-util-face{border:none;background:0 0}body .layui-util-face .layui-layer-content{padding:0;background-color:#fff;color:#5f5f5f;box-shadow:none}.layui-util-face .layui-layer-TipsG{display:none}.layui-util-face ul{position:relative;width:372px;padding:10px;border:1px solid #d9d9d9;background-color:#fff;box-shadow:0 0 20px rgba(0,0,0,.2)}.layui-util-face ul li{cursor:pointer;float:left;border:1px solid #e8e8e8;height:22px;width:26px;overflow:hidden;margin:-1px 0 0 -1px;padding:4px 2px;text-align:center}.layui-util-face ul li:hover{position:relative;z-index:2;border:1px solid #eb7350;background:#fff9ec}.layui-code{display:block;position:relative;padding:15px;line-height:20px;border:1px solid #eee;border-left-width:6px;background-color:#fff;color:#333;font-family:"Courier New",Consolas,"Lucida Console";font-size:12px}.layui-transfer-box,.layui-transfer-header,.layui-transfer-search{border-width:0;border-style:solid;border-color:#eee}.layui-transfer-box{position:relative;display:inline-block;vertical-align:middle;border-width:1px;width:200px;height:360px;border-radius:2px;background-color:#fff}.layui-transfer-box .layui-form-checkbox{width:100%;margin:0!important}.layui-transfer-header{height:38px;line-height:38px;padding:0 11px;border-bottom-width:1px}.layui-transfer-search{position:relative;padding:11px;border-bottom-width:1px}.layui-transfer-search .layui-input{height:32px;padding-left:30px;font-size:12px}.layui-transfer-search .layui-icon-search{position:absolute;left:20px;top:50%;line-height:normal;margin-top:-8px;color:#5f5f5f}.layui-transfer-active{margin:0 15px;display:inline-block;vertical-align:middle}.layui-transfer-active .layui-btn{display:block;margin:0;padding:0 15px;background-color:#16b777;border-color:#16b777;color:#fff}.layui-transfer-active .layui-btn-disabled{background-color:#fbfbfb;border-color:#eee;color:#d2d2d2}.layui-transfer-active .layui-btn:first-child{margin-bottom:15px}.layui-transfer-active .layui-btn .layui-icon{margin:0;font-size:14px!important}.layui-transfer-data{padding:5px 0;overflow:auto}.layui-transfer-data li{height:32px;line-height:32px;margin-top:0!important;padding:0 11px;list-style-type:none!important}.layui-transfer-data li:hover{background-color:#f8f8f8;transition:.5s all}.layui-transfer-data .layui-none{padding:15px 11px;text-align:center;color:#999}.layui-rate,.layui-rate *{display:inline-block;vertical-align:middle}.layui-rate{padding:11px 6px 11px 0;font-size:0}.layui-rate li{margin-top:0!important}.layui-rate li i.layui-icon{font-size:20px;color:#ffb800}.layui-rate li i.layui-icon{margin-right:5px;transition:all .3s;-webkit-transition:all .3s}.layui-rate li i:hover,.layui-rate-hover{cursor:pointer;transform:scale(1.12);-webkit-transform:scale(1.12)}.layui-rate[readonly] li i:hover{cursor:default;transform:scale(1)}.layui-colorpicker{width:38px;height:38px;border:1px solid #eee;padding:5px;border-radius:2px;line-height:24px;display:inline-block;cursor:pointer;transition:all .3s;-webkit-transition:all .3s;box-sizing:border-box}.layui-colorpicker:hover{border-color:#d2d2d2}.layui-colorpicker.layui-colorpicker-lg{width:44px;height:44px;line-height:30px}.layui-colorpicker.layui-colorpicker-sm{width:30px;height:30px;line-height:20px;padding:3px}.layui-colorpicker.layui-colorpicker-xs{width:22px;height:22px;line-height:16px;padding:1px}.layui-colorpicker-trigger-bgcolor{display:block;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);border-radius:2px}.layui-colorpicker-trigger-span{display:block;height:100%;box-sizing:border-box;border:1px solid rgba(0,0,0,.15);border-radius:2px;text-align:center}.layui-colorpicker-trigger-i{display:inline-block;color:#fff;font-size:12px}.layui-colorpicker-trigger-i.layui-icon-close{color:#999}.layui-colorpicker-main{position:absolute;left:-999999px;top:-999999px;z-index:77777777;width:280px;margin:5px 0;padding:7px;background:#fff;border:1px solid #d2d2d2;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.12)}.layui-colorpicker-main-wrapper{height:180px;position:relative}.layui-colorpicker-basis{width:260px;height:100%;position:relative}.layui-colorpicker-basis-white{width:100%;height:100%;position:absolute;top:0;left:0;background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.layui-colorpicker-basis-black{width:100%;height:100%;position:absolute;top:0;left:0;background:linear-gradient(0deg,#000,transparent)}.layui-colorpicker-basis-cursor{width:10px;height:10px;border:1px solid #fff;border-radius:50%;position:absolute;top:-3px;right:-3px;cursor:pointer}.layui-colorpicker-side{position:absolute;top:0;right:0;width:12px;height:100%;background:linear-gradient(red,#ff0,#0f0,#0ff,#00f,#f0f,red)}.layui-colorpicker-side-slider{width:100%;height:5px;box-shadow:0 0 1px #888;box-sizing:border-box;background:#fff;border-radius:1px;border:1px solid #f0f0f0;cursor:pointer;position:absolute;left:0}.layui-colorpicker-main-alpha{display:none;height:12px;margin-top:7px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.layui-colorpicker-alpha-bgcolor{height:100%;position:relative}.layui-colorpicker-alpha-slider{width:5px;height:100%;box-shadow:0 0 1px #888;box-sizing:border-box;background:#fff;border-radius:1px;border:1px solid #f0f0f0;cursor:pointer;position:absolute;top:0}.layui-colorpicker-main-pre{padding-top:7px;font-size:0}.layui-colorpicker-pre{width:20px;height:20px;border-radius:2px;display:inline-block;margin-left:6px;margin-bottom:7px;cursor:pointer}.layui-colorpicker-pre:nth-child(11n+1){margin-left:0}.layui-colorpicker-pre-isalpha{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.layui-colorpicker-pre.layui-this{box-shadow:0 0 3px 2px rgba(0,0,0,.15)}.layui-colorpicker-pre>div{height:100%;border-radius:2px}.layui-colorpicker-main-input{text-align:right;padding-top:7px}.layui-colorpicker-main-input .layui-btn-container .layui-btn{margin:0 0 0 10px}.layui-colorpicker-main-input div.layui-inline{float:left;margin-right:10px;font-size:14px}.layui-colorpicker-main-input input.layui-input{width:150px;height:30px;color:#5f5f5f}.layui-slider{height:4px;background:#eee;border-radius:3px;position:relative;cursor:pointer}.layui-slider-bar{border-radius:3px;position:absolute;height:100%}.layui-slider-step{position:absolute;top:0;width:4px;height:4px;border-radius:50%;background:#fff;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.layui-slider-wrap{width:36px;height:36px;position:absolute;top:-16px;-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:10;text-align:center}.layui-slider-wrap-btn{width:12px;height:12px;border-radius:50%;background:#fff;display:inline-block;vertical-align:middle;cursor:pointer;transition:.3s}.layui-slider-wrap:after{content:"";height:100%;display:inline-block;vertical-align:middle}.layui-slider-wrap-btn.layui-slider-hover,.layui-slider-wrap-btn:hover{transform:scale(1.2)}.layui-slider-wrap-btn.layui-disabled:hover{transform:scale(1)!important}.layui-slider-tips{position:absolute;top:-42px;z-index:77777777;white-space:nowrap;-webkit-transform:translateX(-50%);transform:translateX(-50%);color:#fff;background:#000;border-radius:3px;height:25px;line-height:25px;padding:0 10px}.layui-slider-tips:after{content:"";position:absolute;bottom:-12px;left:50%;margin-left:-6px;width:0;height:0;border-width:6px;border-style:solid;border-color:#000 transparent transparent transparent}.layui-slider-input{width:70px;height:32px;border:1px solid #eee;border-radius:3px;font-size:16px;line-height:32px;position:absolute;right:0;top:-14px;box-sizing:border-box}.layui-slider-input-btn{position:absolute;top:0;right:0;width:20px;height:100%;border-left:1px solid #eee}.layui-slider-input-btn i{cursor:pointer;position:absolute;right:0;bottom:0;width:20px;height:50%;font-size:12px;line-height:16px;text-align:center;color:#999}.layui-slider-input-btn i:first-child{top:0;border-bottom:1px solid #eee}.layui-slider-input-txt{height:100%;font-size:14px}.layui-slider-input-txt input{height:100%;border:none;padding-right:21px}.layui-slider-input-btn i:hover{color:#16baaa}.layui-slider-vertical{width:4px;margin-left:33px}.layui-slider-vertical .layui-slider-bar{width:4px}.layui-slider-vertical .layui-slider-step{top:auto;left:0;-webkit-transform:translateY(50%);transform:translateY(50%)}.layui-slider-vertical .layui-slider-wrap{top:auto;left:-16px;-webkit-transform:translateY(50%);transform:translateY(50%)}.layui-slider-vertical .layui-slider-tips{top:auto;left:2px}@media \0screen{.layui-slider-wrap-btn{margin-left:-20px}.layui-slider-vertical .layui-slider-wrap-btn{margin-left:0;margin-bottom:-20px}.layui-slider-vertical .layui-slider-tips{margin-left:-8px}.layui-slider>span{margin-left:8px}}.layui-tree{line-height:22px}.layui-tree .layui-form-checkbox{margin:0!important}.layui-tree-set{width:100%;position:relative}.layui-tree-pack{display:none;padding-left:20px;position:relative}.layui-tree-line .layui-tree-pack{padding-left:27px}.layui-tree-line .layui-tree-set .layui-tree-set:after{content:"";position:absolute;top:14px;left:-9px;width:17px;height:0;border-top:1px dotted #c0c4cc}.layui-tree-entry{position:relative;padding:3px 0;height:26px;white-space:nowrap}.layui-tree-entry:hover{background-color:#eee}.layui-tree-line .layui-tree-entry:hover{background-color:rgba(0,0,0,0)}.layui-tree-line .layui-tree-entry:hover .layui-tree-txt{color:#999;text-decoration:underline;transition:.3s}.layui-tree-main{display:inline-block;vertical-align:middle;cursor:pointer;padding-right:10px}.layui-tree-line .layui-tree-set:before{content:"";position:absolute;top:0;left:-9px;width:0;height:100%;border-left:1px dotted #c0c4cc}.layui-tree-line .layui-tree-set.layui-tree-setLineShort:before{height:13px}.layui-tree-line .layui-tree-set.layui-tree-setHide:before{height:0}.layui-tree-iconClick{display:inline-block;vertical-align:middle;position:relative;height:20px;line-height:20px;margin:0 10px;color:#c0c4cc}.layui-tree-icon{height:14px;line-height:12px;width:14px;text-align:center;border:1px solid #c0c4cc}.layui-tree-iconClick .layui-icon{font-size:18px}.layui-tree-icon .layui-icon{font-size:12px;color:#5f5f5f}.layui-tree-iconArrow{padding:0 5px}.layui-tree-iconArrow:after{content:"";position:absolute;left:4px;top:3px;z-index:100;width:0;height:0;border-width:5px;border-style:solid;border-color:transparent transparent transparent #c0c4cc;transition:.5s}.layui-tree-spread>.layui-tree-entry .layui-tree-iconClick>.layui-tree-iconArrow:after{transform:rotate(90deg) translate(3px,4px)}.layui-tree-txt{display:inline-block;vertical-align:middle;color:#555}.layui-tree-search{margin-bottom:15px;color:#5f5f5f}.layui-tree-btnGroup{visibility:hidden;display:inline-block;vertical-align:middle;position:relative}.layui-tree-btnGroup .layui-icon{display:inline-block;vertical-align:middle;padding:0 2px;cursor:pointer}.layui-tree-btnGroup .layui-icon:hover{color:#999;transition:.3s}.layui-tree-entry:hover .layui-tree-btnGroup{visibility:visible}.layui-tree-editInput{position:relative;display:inline-block;vertical-align:middle;height:20px;line-height:20px;padding:0;border:none;background-color:rgba(0,0,0,.05)}.layui-tree-emptyText{text-align:center;color:#999}.layui-anim{-webkit-animation-duration:.3s;-webkit-animation-fill-mode:both;animation-duration:.3s;animation-fill-mode:both}.layui-anim.layui-icon{display:inline-block}.layui-anim-loop{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.layui-trans,.layui-trans a{transition:all .2s;-webkit-transition:all .2s}@-webkit-keyframes layui-rotate{from{-webkit-transform:rotate(0)}to{-webkit-transform:rotate(360deg)}}@keyframes layui-rotate{from{transform:rotate(0)}to{transform:rotate(360deg)}}.layui-anim-rotate{-webkit-animation-name:layui-rotate;animation-name:layui-rotate;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:linear;animation-timing-function:linear}@-webkit-keyframes layui-up{from{-webkit-transform:translate3d(0,100%,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes layui-up{from{transform:translate3d(0,100%,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.layui-anim-up{-webkit-animation-name:layui-up;animation-name:layui-up}@-webkit-keyframes layui-upbit{from{-webkit-transform:translate3d(0,15px,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes layui-upbit{from{transform:translate3d(0,15px,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.layui-anim-upbit{-webkit-animation-name:layui-upbit;animation-name:layui-upbit}@keyframes layui-down{0%{opacity:.3;transform:translate3d(0,-100%,0)}100%{opacity:1;transform:translate3d(0,0,0)}}.layui-anim-down{animation-name:layui-down}@keyframes layui-downbit{0%{opacity:.3;transform:translate3d(0,-5px,0)}100%{opacity:1;transform:translate3d(0,0,0)}}.layui-anim-downbit{animation-name:layui-downbit}@-webkit-keyframes layui-scale{0%{opacity:.3;-webkit-transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1)}}@keyframes layui-scale{0%{opacity:.3;-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-ms-transform:scale(1);transform:scale(1)}}.layui-anim-scale{-webkit-animation-name:layui-scale;animation-name:layui-scale}@-webkit-keyframes layui-scale-spring{0%{opacity:.5;-webkit-transform:scale(.5)}80%{opacity:.8;-webkit-transform:scale(1.1)}100%{opacity:1;-webkit-transform:scale(1)}}@keyframes layui-scale-spring{0%{opacity:.5;transform:scale(.5)}80%{opacity:.8;transform:scale(1.1)}100%{opacity:1;transform:scale(1)}}.layui-anim-scaleSpring{-webkit-animation-name:layui-scale-spring;animation-name:layui-scale-spring}@keyframes layui-scalesmall{0%{opacity:.3;transform:scale(1.5)}100%{opacity:1;transform:scale(1)}}.layui-anim-scalesmall{animation-name:layui-scalesmall}@keyframes layui-scalesmall-spring{0%{opacity:.3;transform:scale(1.5)}80%{opacity:.8;transform:scale(.9)}100%{opacity:1;transform:scale(1)}}.layui-anim-scalesmall-spring{animation-name:layui-scalesmall-spring}@-webkit-keyframes layui-fadein{0%{opacity:0}100%{opacity:1}}@keyframes layui-fadein{0%{opacity:0}100%{opacity:1}}.layui-anim-fadein{-webkit-animation-name:layui-fadein;animation-name:layui-fadein}@-webkit-keyframes layui-fadeout{0%{opacity:1}100%{opacity:0}}@keyframes layui-fadeout{0%{opacity:1}100%{opacity:0}}.layui-anim-fadeout{-webkit-animation-name:layui-fadeout;animation-name:layui-fadeout}html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-wrap{font-size:13px;font-family:"Courier New",Consolas,"Lucida Console"}.layui-code-view{display:block;position:relative;padding:0!important;border:1px solid #eee;border-left-width:6px;background-color:#fff;color:#333}.layui-code-view pre{margin:0!important}.layui-code-header{position:relative;z-index:3;padding:0 11px;height:40px;line-height:40px;border-bottom:1px solid #eee;background-color:#fafafa;font-size:12px}.layui-code-header>.layui-code-header-about{position:absolute;right:11px;top:0;color:#b7b7b7}.layui-code-header-about>a{padding-left:10px}.layui-code-wrap{position:relative;display:block;z-index:1;margin:0!important;padding:11px 0!important;overflow-x:hidden;overflow-y:auto}.layui-code-line{position:relative;line-height:19px;margin:0!important}.layui-code-line-number{position:absolute;left:0;top:0;padding:0 8px;min-width:45px;height:100%;text-align:right;user-select:none;white-space:nowrap;overflow:hidden}.layui-code-line-content{padding:0 11px;word-wrap:break-word;white-space:pre-wrap}.layui-code-ln-mode>.layui-code-wrap>.layui-code-line{padding-left:45px}.layui-code-ln-side{position:absolute;left:0;top:0;bottom:0;z-index:0;width:45px;border-right:1px solid #eee;border-color:rgb(126 122 122 / 15%);background-color:#fafafa;pointer-events:none}.layui-code-nowrap>.layui-code-wrap{overflow:auto}.layui-code-nowrap>.layui-code-wrap>.layui-code-line>.layui-code-line-content{white-space:pre;word-wrap:normal}.layui-code-nowrap>.layui-code-ln-side{border-right-width:0!important;background:0 0!important}.layui-code-fixbar{position:absolute;top:8px;right:11px;padding-right:45px;z-index:5}.layui-code-fixbar>span{position:absolute;right:0;top:0;padding:0 8px;color:#777;transition:all .3s}.layui-code-fixbar>span:hover{color:#16b777}.layui-code-copy{display:none;cursor:pointer}.layui-code-preview>.layui-code-view>.layui-code-fixbar .layui-code-copy{display:none!important}.layui-code-view:hover>.layui-code-fixbar .layui-code-copy{display:block}.layui-code-view:hover>.layui-code-fixbar .layui-code-lang-marker{display:none}.layui-code-theme-dark,.layui-code-theme-dark>.layui-code-header{border-color:rgb(126 122 122 / 15%);background-color:#1f1f1f}.layui-code-theme-dark{border-width:1px;color:#ccc}.layui-code-theme-dark>.layui-code-ln-side{border-right-color:#2a2a2a;background:0 0;color:#6e7681}.layui-code textarea{display:none}.layui-code-preview>.layui-code,.layui-code-preview>.layui-code-view{margin:0}.layui-code-preview>.layui-tab{position:relative;z-index:1;margin-bottom:0}.layui-code-preview>.layui-tab>.layui-tab-title{border-width:0}.layui-code-preview .layui-code-item{display:none}.layui-code-item-preview{position:relative;padding:16px}.layui-code-item-preview>iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:none}.layui-code-tools{position:absolute;right:11px;top:8px;line-height:normal}.layui-code-tools>i{display:inline-block;margin-left:6px;padding:3px;cursor:pointer}.layui-code-tools>i.layui-icon-file-b{color:#999}.layui-code-tools>i:hover{color:#16b777}.layui-code-full{position:fixed;left:0;top:0;z-index:1111111;width:100%;height:100%;background-color:#fff}.layui-code-full .layui-code-item{width:100%!important;border-width:0!important;border-top-width:1px!important}.layui-code-full .layui-code-item,.layui-code-full .layui-code-view,.layui-code-full .layui-code-wrap{height:calc(100vh - 51px)!important;box-sizing:border-box}.layui-code-full .layui-code-item-preview{overflow:auto}.layui-code-view.layui-code-hl{line-height:20px!important;border-left-width:1px}.layui-code-view.layui-code-hl>.layui-code-ln-side{background-color:transparent}.layui-code-theme-dark.layui-code-hl,.layui-code-theme-dark.layui-code-hl>.layui-code-ln-side{border-color:rgb(126 122 122 / 15%)}html #layuicss-laydate{display:none;position:absolute;width:1989px}.layui-laydate *{margin:0;padding:0}.layui-laydate,.layui-laydate *{box-sizing:border-box}.layui-laydate{position:absolute;z-index:99999999;margin:5px 0;border-radius:2px;font-size:14px;line-height:normal;-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.layui-laydate-main{width:272px}.layui-laydate-content td,.layui-laydate-header *,.layui-laydate-list li{transition-duration:.3s;-webkit-transition-duration:.3s}.layui-laydate-shade{top:0;left:0;width:100%;height:100%;_height:expression(document.body.offsetHeight+"px");position:fixed;_position:absolute;pointer-events:auto}@keyframes laydate-downbit{0%{opacity:.3;transform:translate3d(0,-5px,0)}100%{opacity:1;transform:translate3d(0,0,0)}}.layui-laydate{animation-name:laydate-downbit}.layui-laydate-static{position:relative;z-index:0;display:inline-block;margin:0;-webkit-animation:none;animation:none}.laydate-ym-show .laydate-next-m,.laydate-ym-show .laydate-prev-m{display:none!important}.laydate-ym-show .laydate-next-y,.laydate-ym-show .laydate-prev-y{display:inline-block!important}.laydate-ym-show .laydate-set-ym span[lay-type=month]{display:none!important}.laydate-time-show .laydate-set-ym span[lay-type=month],.laydate-time-show .laydate-set-ym span[lay-type=year],.laydate-time-show .layui-laydate-header .layui-icon{display:none!important}.layui-laydate-header{position:relative;line-height:30px;padding:10px 70px 5px}.layui-laydate-header *{display:inline-block;vertical-align:bottom}.layui-laydate-header i{position:absolute;top:10px;padding:0 5px;color:#999;font-size:18px;cursor:pointer}.layui-laydate-header i.laydate-prev-y{left:15px}.layui-laydate-header i.laydate-prev-m{left:45px}.layui-laydate-header i.laydate-next-y{right:15px}.layui-laydate-header i.laydate-next-m{right:45px}.laydate-set-ym{width:100%;text-align:center;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.laydate-set-ym span{padding:0 10px;cursor:pointer}.laydate-time-text{cursor:default!important}.layui-laydate-content{position:relative;padding:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-laydate-content table{border-collapse:collapse;border-spacing:0}.layui-laydate-content td,.layui-laydate-content th{width:36px;height:30px;padding:0;text-align:center}.layui-laydate-content th{font-weight:400}.layui-laydate-content td{position:relative;cursor:pointer}.laydate-day-mark{position:absolute;left:0;top:0;width:100%;line-height:30px;font-size:12px;overflow:hidden}.laydate-day-mark::after{position:absolute;content:'';right:2px;top:2px;width:5px;height:5px;border-radius:50%}.laydate-day-holidays:before{position:absolute;left:0;top:0;font-size:12px;transform:scale(.7)}.laydate-day-holidays:before{content:'\4F11';color:#ff5722}.laydate-day-holidays[type=work]:before{content:'\73ED';color:inherit}.layui-laydate .layui-this .laydate-day-holidays:before{color:#fff}.layui-laydate-footer{position:relative;height:46px;line-height:26px;padding:10px}.layui-laydate-footer span{display:inline-block;vertical-align:top;height:26px;line-height:24px;padding:0 10px;border:1px solid #c9c9c9;border-radius:2px;background-color:#fff;font-size:12px;cursor:pointer;white-space:nowrap;transition:all .3s}.layui-laydate-footer span:hover{color:#16b777}.layui-laydate-footer span.layui-laydate-preview{cursor:default;border-color:transparent!important}.layui-laydate-footer span.layui-laydate-preview:hover{color:#777}.layui-laydate-footer span:first-child.layui-laydate-preview{padding-left:0}.laydate-footer-btns{position:absolute;right:10px;top:10px}.laydate-footer-btns span{margin:0 0 0 -1px;border-radius:0}.laydate-footer-btns span:first-child{border-radius:2px 0 0 2px}.laydate-footer-btns span:last-child{border-radius:0 2px 2px 0}.layui-laydate-shortcut{width:80px;padding:6px 0;display:inline-block;vertical-align:top;overflow:auto;max-height:276px;text-align:center}.layui-laydate-shortcut+.layui-laydate-main{display:inline-block;border-left:1px solid #e2e2e2}.layui-laydate-shortcut>li{padding:5px 8px;cursor:pointer;line-height:18px}.layui-laydate .layui-laydate-list{position:absolute;left:0;top:0;width:100%;height:100%;padding:10px;box-sizing:border-box;background-color:#fff}.layui-laydate .layui-laydate-list>li{position:relative;display:inline-block;width:33.3%;height:36px;line-height:36px;margin:3px 0;vertical-align:middle;text-align:center;cursor:pointer;list-style:none}.layui-laydate .laydate-month-list>li{width:25%;margin:17px 0}.layui-laydate .laydate-time-list>li{height:100%;margin:0;line-height:normal;cursor:default}.layui-laydate .laydate-time-list p{position:relative;top:-4px;margin:0;line-height:29px}.layui-laydate .laydate-time-list ol{height:181px;overflow:hidden}.layui-laydate .laydate-time-list>li:hover ol{overflow-y:auto}.layui-laydate .laydate-time-list ol li{width:130%;padding-left:33px;height:30px;line-height:30px;text-align:left;cursor:pointer}.layui-laydate-hint{position:absolute;top:115px;left:50%;width:250px;margin-left:-125px;line-height:20px;padding:15px;text-align:center;font-size:12px;color:#ff5722}.layui-laydate-range{width:546px}.layui-laydate-range .layui-laydate-main{display:inline-block;vertical-align:middle;max-width:50%}.layui-laydate-range .laydate-main-list-1 .layui-laydate-content,.layui-laydate-range .laydate-main-list-1 .layui-laydate-header{border-left:1px solid #e2e2e2}.layui-laydate-range.layui-laydate-linkage .laydate-main-list-0 .laydate-next-m,.layui-laydate-range.layui-laydate-linkage .laydate-main-list-0 .laydate-next-y,.layui-laydate-range.layui-laydate-linkage .laydate-main-list-1 .laydate-prev-m,.layui-laydate-range.layui-laydate-linkage .laydate-main-list-1 .laydate-prev-y{display:none}.layui-laydate,.layui-laydate-hint{border:1px solid #d2d2d2;box-shadow:0 2px 4px rgba(0,0,0,.12);background-color:#fff;color:#777}.layui-laydate-header{border-bottom:1px solid #e2e2e2}.layui-laydate-header i:hover,.layui-laydate-header span:hover{color:#16b777}.layui-laydate-content{border-top:none 0;border-bottom:none 0}.layui-laydate-content th{color:#333}.layui-laydate-content td{color:#777}.layui-laydate-content td.laydate-day-now{color:#16b777}.layui-laydate-content td.laydate-day-now:after{content:'';position:absolute;width:100%;height:30px;left:0;top:0;border:1px solid #16b777;box-sizing:border-box}.layui-laydate-linkage .layui-laydate-content td.laydate-selected>div{background-color:#00f7de}.layui-laydate-linkage .laydate-selected:hover>div{background-color:#00f7de!important}.layui-laydate-content td.laydate-selected:after,.layui-laydate-content td:hover:after{content:none}.layui-laydate-content td>div:hover,.layui-laydate-list li:hover,.layui-laydate-shortcut>li:hover{background-color:#eee;color:#333}.laydate-time-list li ol{margin:0;padding:0;border:1px solid #e2e2e2;border-left-width:0}.laydate-time-list li:first-child ol{border-left-width:1px}.laydate-time-list>li:hover{background:0 0}.layui-laydate-content .laydate-day-next,.layui-laydate-content .laydate-day-prev{color:#d2d2d2}.layui-laydate-linkage .laydate-selected.laydate-day-next>div,.layui-laydate-linkage .laydate-selected.laydate-day-prev>div{background-color:#f8f8f8!important}.layui-laydate-footer{border-top:1px solid #e2e2e2}.layui-laydate-hint{color:#ff5722}.laydate-day-mark::after{background-color:#16b777}.layui-laydate-content td.layui-this .laydate-day-mark::after{display:none}.layui-laydate-footer span[lay-type=date]{color:#16b777}.layui-laydate .layui-this,.layui-laydate .layui-this>div{background-color:#16baaa!important;color:#fff!important}.layui-laydate .laydate-disabled,.layui-laydate .laydate-disabled:hover{background:0 0!important;color:#d2d2d2!important;cursor:not-allowed!important;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-laydate-content td>div{padding:7px 0;height:100%}.laydate-theme-molv{border:none}.laydate-theme-molv.layui-laydate-range{width:548px}.laydate-theme-molv .layui-laydate-main{width:274px}.laydate-theme-molv .layui-laydate-header{border:none;background-color:#16baaa}.laydate-theme-molv .layui-laydate-header i,.laydate-theme-molv .layui-laydate-header span{color:#f6f6f6}.laydate-theme-molv .layui-laydate-header i:hover,.laydate-theme-molv .layui-laydate-header span:hover{color:#fff}.laydate-theme-molv .layui-laydate-content{border:1px solid #e2e2e2;border-top:none;border-bottom:none}.laydate-theme-molv .laydate-main-list-1 .layui-laydate-content{border-left:none}.laydate-theme-molv .layui-laydate-footer{border:1px solid #e2e2e2}.laydate-theme-grid .laydate-month-list>li,.laydate-theme-grid .laydate-year-list>li,.laydate-theme-grid .layui-laydate-content td,.laydate-theme-grid .layui-laydate-content thead{border:1px solid #e2e2e2}.layui-laydate-linkage.laydate-theme-grid .laydate-selected,.layui-laydate-linkage.laydate-theme-grid .laydate-selected:hover{background-color:#f2f2f2!important;color:#16baaa!important}.layui-laydate-linkage.laydate-theme-grid .laydate-selected.laydate-day-next,.layui-laydate-linkage.laydate-theme-grid .laydate-selected.laydate-day-prev{color:#d2d2d2!important}.laydate-theme-grid .laydate-month-list,.laydate-theme-grid .laydate-year-list{margin:1px 0 0 1px}.laydate-theme-grid .laydate-month-list>li,.laydate-theme-grid .laydate-year-list>li{margin:0 -1px -1px 0}.laydate-theme-grid .laydate-year-list>li{height:43px;line-height:43px}.laydate-theme-grid .laydate-month-list>li{height:71px;line-height:71px}.laydate-theme-grid .layui-laydate-content td>div{height:29px;margin-top:-1px}.laydate-theme-circle .layui-laydate-content td.layui-this>div,.laydate-theme-circle .layui-laydate-content td>div{width:28px;height:28px;line-height:28px;border-radius:14px;margin:0 4px;padding:0}.layui-laydate.laydate-theme-circle .layui-laydate-content table td.layui-this{background-color:transparent!important}.laydate-theme-grid.laydate-theme-circle .layui-laydate-content td>div{margin:0 3.5px}.laydate-theme-fullpanel .layui-laydate-main{width:526px}.laydate-theme-fullpanel .layui-laydate-list{width:252px;left:272px}.laydate-theme-fullpanel .laydate-set-ym span{display:none}.laydate-theme-fullpanel .laydate-time-show .laydate-set-ym span[lay-type=month],.laydate-theme-fullpanel .laydate-time-show .laydate-set-ym span[lay-type=year],.laydate-theme-fullpanel .laydate-time-show .layui-laydate-header .layui-icon{display:inline-block!important}.laydate-theme-fullpanel .laydate-btns-time{display:none}html #layuicss-layer{display:none;position:absolute;width:1989px}.layui-layer,.layui-layer-shade{position:fixed;_position:absolute;pointer-events:auto}.layui-layer-shade{top:0;left:0;width:100%;height:100%;_height:expression(document.body.offsetHeight+"px")}.layui-layer{-webkit-overflow-scrolling:touch}.layui-layer{top:150px;left:0;margin:0;padding:0;background-color:#fff;-webkit-background-clip:content;border-radius:2px;box-shadow:1px 1px 50px rgba(0,0,0,.3)}.layui-layer-close{position:absolute}.layui-layer-content{position:relative}.layui-layer-border{border:1px solid #b2b2b2;border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 5px rgba(0,0,0,.2)}.layui-layer-btn a,.layui-layer-setwin span{display:inline-block;vertical-align:middle;*display:inline;*zoom:1}.layui-layer-move{display:none;position:fixed;*position:absolute;left:0;top:0;width:100%;height:100%;cursor:move;opacity:0;filter:alpha(opacity=0);background-color:#fff;z-index:2147483647}.layui-layer-resize{position:absolute;width:15px;height:15px;right:0;bottom:0;cursor:se-resize}.layer-anim{-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.3s;animation-duration:.3s}@-webkit-keyframes layer-bounceIn{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes layer-bounceIn{0%{opacity:0;-webkit-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim-00{-webkit-animation-name:layer-bounceIn;animation-name:layer-bounceIn}@-webkit-keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes layer-zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);-ms-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);-ms-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-01{-webkit-animation-name:layer-zoomInDown;animation-name:layer-zoomInDown}@-webkit-keyframes layer-fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes layer-fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.layer-anim-02{-webkit-animation-name:layer-fadeInUpBig;animation-name:layer-fadeInUpBig}@-webkit-keyframes layer-zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes layer-zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);-ms-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);-ms-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-03{-webkit-animation-name:layer-zoomInLeft;animation-name:layer-zoomInLeft}@-webkit-keyframes layer-rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}@keyframes layer-rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);-ms-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);-ms-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}.layer-anim-04{-webkit-animation-name:layer-rollIn;animation-name:layer-rollIn}@keyframes layer-fadeIn{0%{opacity:0}100%{opacity:1}}.layer-anim-05{-webkit-animation-name:layer-fadeIn;animation-name:layer-fadeIn}@-webkit-keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes layer-shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}.layer-anim-06{-webkit-animation-name:layer-shake;animation-name:layer-shake}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes layer-slide-down{from{transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}@keyframes layer-slide-down-out{from{transform:translate3d(0,0,0)}to{transform:translate3d(0,-100%,0)}}.layer-anim-slide-down{animation-name:layer-slide-down}.layer-anim-slide-down-out{animation-name:layer-slide-down-out}@keyframes layer-slide-left{from{transform:translate3d(100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes layer-slide-left-out{from{transform:translate3d(0,0,0)}to{transform:translate3d(100%,0,0)}}.layer-anim-slide-left{animation-name:layer-slide-left}.layer-anim-slide-left-out{animation-name:layer-slide-left-out}@keyframes layer-slide-up{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}@keyframes layer-slide-up-out{from{transform:translate3d(0,0,0)}to{transform:translate3d(0,100%,0)}}.layer-anim-slide-up{animation-name:layer-slide-up}.layer-anim-slide-up-out{animation-name:layer-slide-up-out}@keyframes layer-slide-right{from{transform:translate3d(-100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes layer-slide-right-out{from{transform:translate3d(0,0,0)}to{transform:translate3d(-100%,0,0)}}.layer-anim-slide-right{animation-name:layer-slide-right}.layer-anim-slide-right-out{animation-name:layer-slide-right-out}.layui-layer-title{padding:0 81px 0 16px;height:50px;line-height:50px;border-bottom:1px solid #f0f0f0;font-size:14px;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:2px 2px 0 0}.layui-layer-setwin{position:absolute;right:15px;*right:0;top:16px;font-size:0;line-height:initial}.layui-layer-setwin span{position:relative;width:16px;height:16px;line-height:18px;margin-left:10px;text-align:center;font-size:16px;cursor:pointer;color:#000;_overflow:hidden;box-sizing:border-box}.layui-layer-setwin .layui-layer-min:before{content:'';position:absolute;width:12px;border-bottom:1px solid #2e2d3c;left:50%;top:50%;margin:-.5px 0 0 -6px;cursor:pointer;_overflow:hidden}.layui-layer-setwin .layui-layer-min:hover:before{background-color:#2d93ca}.layui-layer-setwin .layui-layer-max:after,.layui-layer-setwin .layui-layer-max:before{content:'';position:absolute;left:50%;top:50%;z-index:1;width:9px;height:9px;margin:-5px 0 0 -5px;border:1px solid #2e2d3c}.layui-layer-setwin .layui-layer-max:hover:after,.layui-layer-setwin .layui-layer-max:hover:before{border-color:#2d93ca}.layui-layer-setwin .layui-layer-min:hover:before{background-color:#2d93ca}.layui-layer-setwin .layui-layer-maxmin:after,.layui-layer-setwin .layui-layer-maxmin:before{width:7px;height:7px;margin:-3px 0 0 -3px;background-color:#fff}.layui-layer-setwin .layui-layer-maxmin:after{z-index:0;margin:-5px 0 0 -1px}.layui-layer-setwin .layui-layer-close{cursor:pointer}.layui-layer-setwin .layui-layer-close:hover{opacity:.7}.layui-layer-setwin .layui-layer-close2{position:absolute;right:-28px;top:-28px;color:#fff;background-color:#787878;padding:3px;border:3px solid;width:28px;height:28px;font-size:16px;font-weight:bolder;border-radius:50%;margin-left:0;*right:-18px;_display:none}.layui-layer-setwin .layui-layer-close2:hover{opacity:unset;background-color:#3888f6}.layui-layer-btn{text-align:right;padding:0 15px 12px;pointer-events:auto;user-select:none;-webkit-user-select:none}.layui-layer-btn a{height:30px;line-height:30px;margin:5px 5px 0;padding:0 16px;border:1px solid #dedede;background-color:#fff;color:#333;border-radius:2px;font-weight:400;cursor:pointer;text-decoration:none;box-sizing:border-box}.layui-layer-btn a:hover{opacity:.9;text-decoration:none}.layui-layer-btn a:active{opacity:.8}.layui-layer-btn .layui-layer-btn0{border-color:transparent;background-color:#1e9fff;color:#fff}.layui-layer-btn-l{text-align:left}.layui-layer-btn-c{text-align:center}.layui-layer-dialog{min-width:240px}.layui-layer-dialog .layui-layer-content{position:relative;padding:16px;line-height:24px;word-break:break-all;overflow:hidden;font-size:14px;overflow-x:hidden;overflow-y:auto}.layui-layer-dialog .layui-layer-content .layui-layer-face{position:absolute;top:18px;left:16px;color:#959595;font-size:32px;_left:-40px}.layui-layer-dialog .layui-layer-content .layui-icon-tips{color:#f39b12}.layui-layer-dialog .layui-layer-content .layui-icon-success{color:#16b777}.layui-layer-dialog .layui-layer-content .layui-icon-error{top:19px;color:#ff5722}.layui-layer-dialog .layui-layer-content .layui-icon-question{color:#ffb800}.layui-layer-dialog .layui-layer-content .layui-icon-lock{color:#787878}.layui-layer-dialog .layui-layer-content .layui-icon-face-cry{color:#ff5722}.layui-layer-dialog .layui-layer-content .layui-icon-face-smile{color:#16b777}.layui-layer-rim{border:6px solid #8d8d8d;border:6px solid rgba(0,0,0,.3);border-radius:5px;box-shadow:none}.layui-layer-msg{min-width:180px;border:1px solid #d3d4d3;box-shadow:none}.layui-layer-hui{min-width:100px;background-color:#000;filter:alpha(opacity=60);background-color:rgba(0,0,0,.6);color:#fff;border:none}.layui-layer-hui .layui-layer-close{color:#fff}.layui-layer-hui .layui-layer-content{padding:11px 24px;text-align:center}.layui-layer-dialog .layui-layer-padding{padding:18px 24px 18px 58px;text-align:left}.layui-layer-page .layui-layer-content{position:relative;overflow:auto}.layui-layer-iframe .layui-layer-btn,.layui-layer-page .layui-layer-btn{padding-top:10px}.layui-layer-nobg{background:0 0}.layui-layer-iframe iframe{display:block;width:100%}.layui-layer-loading{border-radius:100%;background:0 0;box-shadow:none;border:none}.layui-layer-loading .layui-layer-content{width:76px;height:38px;line-height:38px;text-align:center}.layui-layer-loading-icon{font-size:38px;color:#959595}.layui-layer-loading2{text-align:center}.layui-layer-loading-2{position:relative;height:38px}.layui-layer-loading-2:after,.layui-layer-loading-2:before{content:'';position:absolute;left:50%;top:50%;width:38px;height:38px;margin:-19px 0 0 -19px;border-radius:50%;border:3px solid #d2d2d2;box-sizing:border-box}.layui-layer-loading-2:after{border-color:transparent;border-left-color:#1e9fff}.layui-layer-tips{background:0 0;box-shadow:none;border:none}.layui-layer-tips .layui-layer-content{position:relative;line-height:22px;min-width:12px;padding:8px 15px;font-size:12px;_float:left;border-radius:2px;box-shadow:1px 1px 3px rgba(0,0,0,.2);background-color:#000;color:#fff}.layui-layer-tips .layui-layer-close{right:-2px;top:-1px}.layui-layer-tips i.layui-layer-TipsG{position:absolute;width:0;height:0;border-width:8px;border-color:transparent;border-style:dashed;*overflow:hidden}.layui-layer-tips i.layui-layer-TipsB,.layui-layer-tips i.layui-layer-TipsT{left:5px;border-right-style:solid;border-right-color:#000}.layui-layer-tips i.layui-layer-TipsT{bottom:-8px}.layui-layer-tips i.layui-layer-TipsB{top:-8px}.layui-layer-tips i.layui-layer-TipsL,.layui-layer-tips i.layui-layer-TipsR{top:5px;border-bottom-style:solid;border-bottom-color:#000}.layui-layer-tips i.layui-layer-TipsR{left:-8px}.layui-layer-tips i.layui-layer-TipsL{right:-8px}.layui-layer-lan .layui-layer-title{background:#4476a7;color:#fff;border:none}.layui-layer-lan .layui-layer-btn{padding:5px 10px 10px;border-top:1px solid #e9e7e7}.layui-layer-lan .layui-layer-btn a{background:#fff;border-color:#e9e7e7;color:#333}.layui-layer-lan .layui-layer-btn .layui-layer-btn1{background:#c9c5c5}.layui-layer-molv .layui-layer-title{background:#009f95;color:#fff;border:none}.layui-layer-molv .layui-layer-btn a{background:#009f95;border-color:#009f95}.layui-layer-molv .layui-layer-btn .layui-layer-btn1{background:#92b8b1}.layui-layer-lan .layui-layer-setwin .layui-icon,.layui-layer-molv .layui-layer-setwin .layui-icon{color:#fff}.layui-layer-win10{border:1px solid #aaa;box-shadow:1px 1px 6px rgba(0,0,0,.3);border-radius:none}.layui-layer-win10 .layui-layer-title{height:32px;line-height:32px;padding-left:8px;border-bottom:none;font-size:12px}.layui-layer-win10 .layui-layer-setwin{right:0;top:0}.layui-layer-win10 .layui-layer-setwin span{margin-left:0;width:32px;height:32px;padding:8px}.layui-layer-win10.layui-layer-page .layui-layer-setwin span{width:38px}.layui-layer-win10 .layui-layer-setwin span:hover{background-color:#e5e5e5}.layui-layer-win10 .layui-layer-setwin span.layui-icon-close:hover{background-color:#e81123;color:#fff}.layui-layer-win10.layui-layer-dialog .layui-layer-content{padding:8px 16px 32px;color:#0033bc}.layui-layer-win10.layui-layer-dialog .layui-layer-padding{padding-top:18px;padding-left:58px}.layui-layer-win10 .layui-layer-btn{padding:5px 5px 10px;border-top:1px solid #dfdfdf;background-color:#f0f0f0}.layui-layer-win10 .layui-layer-btn a{height:20px;line-height:18px;background-color:#e1e1e1;border-color:#adadad;color:#000;font-size:12px;transition:all .3s}.layui-layer-win10 .layui-layer-btn a:hover{border-color:#2a8edd;background-color:#e5f1fb}.layui-layer-win10 .layui-layer-btn .layui-layer-btn0{border-color:#0078d7}.layui-layer-prompt .layui-layer-input{display:block;width:260px;height:36px;margin:0 auto;line-height:30px;padding-left:10px;border:1px solid #e6e6e6;color:#333}.layui-layer-prompt textarea.layui-layer-input{width:300px;height:100px;line-height:20px;padding:6px 10px}.layui-layer-prompt .layui-layer-content{padding:16px}.layui-layer-prompt .layui-layer-btn{padding-top:0}.layui-layer-tab{box-shadow:1px 1px 50px rgba(0,0,0,.4)}.layui-layer-tab .layui-layer-title{padding-left:0;overflow:visible}.layui-layer-tab .layui-layer-title span{position:relative;display:inline-block;vertical-align:top;border-left:1px solid transparent;border-right:1px solid transparent;min-width:80px;max-width:300px;padding:0 16px;text-align:center;cursor:default;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;cursor:pointer}.layui-layer-tab .layui-layer-title span.layui-this{height:51px;border-left-color:#eee;border-right-color:#eee;background-color:#fff;z-index:10}.layui-layer-tab .layui-layer-title span:first-child{border-left-color:transparent}.layui-layer-tabmain{line-height:24px;clear:both}.layui-layer-tabmain .layui-layer-tabli{display:none}.layui-layer-tabmain .layui-layer-tabli.layui-this{display:block}.layui-layer-photos{background:0 0;box-shadow:none}.layui-layer-photos .layui-layer-content{overflow:visible;text-align:center}.layui-layer-photos .layer-layer-photos-main img{position:relative;width:100%;display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-photos-next,.layui-layer-photos-prev{position:fixed;top:50%;width:52px;height:52px;line-height:52px;margin-top:-26px;cursor:pointer;font-size:52px;color:#717171}.layui-layer-photos-prev{left:32px}.layui-layer-photos-next{right:32px}.layui-layer-photos-next:hover,.layui-layer-photos-prev:hover{color:#959595}.layui-layer-photos-toolbar{position:fixed;left:0;right:0;bottom:0;width:100%;height:52px;line-height:52px;background-color:#000\9;filter:Alpha(opacity=60);background-color:rgba(0,0,0,.32);color:#fff;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:0}.layui-layer-photos-toolbar>*{display:inline-block;vertical-align:top;padding:0 16px;font-size:12px;color:#fff;*display:inline;*zoom:1}.layui-layer-photos-toolbar *{font-size:12px}.layui-layer-photos-header{top:0;bottom:auto}.layui-layer-photos-header>span{cursor:pointer}.layui-layer-photos-header>span:hover{background-color:rgba(51,51,51,.32)}.layui-layer-photos-header .layui-icon{font-size:18px}.layui-layer-photos-footer>h3{max-width:65%;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-layer-photos-footer a:hover{text-decoration:underline}.layui-layer-photos-footer em{font-style:normal}@-webkit-keyframes layer-bounceOut{100%{opacity:0;-webkit-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes layer-bounceOut{100%{opacity:0;-webkit-transform:scale(.7);-ms-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim-close{-webkit-animation-name:layer-bounceOut;animation-name:layer-bounceOut;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.2s;animation-duration:.2s} \ No newline at end of file diff --git a/src/main/resources/static/component/layui/font/iconfont.eot b/src/main/resources/static/component/layui/font/iconfont.eot index 0859a67a5a60042fe49a8e7e65f7ed35e6098fc0..3f5e98bb584b80ae0ce0d39b598fb37423ea8220 100644 GIT binary patch delta 6458 zcmai(dvsgHoyWg(uXJ@~$+Bci@+0xvmL0z>+mao>lQ=O6ArJC!OdRKB$4MO9kOu_V zD1^X5U<1S@rAeS{mse?*N0N4FfwZKw2TpT(wvWSdcG)hcyJtk9>{2%E;q)Z-en&&L z&_8x9f9{M%cSdvP_xpW+KPT@^n`fRituwy_e)o$;#bD(?DUjl!}O3NF#Uot=bSK)8;RFapTqbr%v7(2Z5p@z8XU$k&g?=F94PR+ zd_?;4|`7d++kN-SBk`!DZ`2Q_1U2JzI1UIul+@5;fDee@9zVJFM4vVAz z*Nczx27Z7a;&oiWtF+Yj@elYOUcq)gB zY{6En!+H#0HEzTWxE@QQRFd zlwudkkdFeIHV3&lfIQ5h@#i9pRmegJ^ALa=8AykZ&aeR=POdewT*kgXEBchJ>VVD`-+k`n!V0g)}uPASJ^@L4!kbeFaSqX(iN! zZ@$NtU!b5rK-wC52BcdRF2SKK5=u4134ZR97Lqq?9QTYUqBDSsFSbWKctwgbZouoRDD+-4rrgLx+W=tSIQZkhvNG?hHAH z->)w8Y)G0wfv4H#Yv}Bd1sb|NWTA!u09mAAC_ol#7!;5t8iogCsfK|9S*BsgK$dIp zBpqEw_=Yf!Ak}UOBMMSI5n*gW&eJf;Ak}?@@dl|DBaA%A8VzF*vR1=rgsjsrE+OkR zj8I5*@(r{*Ph6)3@P(!VO zT%@7uK=x@86d=gO8cGr55)BTs?blGAAg|Lot@y$mJRe8srTc zN*m+~4Mh%erLzA@K0VDKS81qxkgGM+K*$?4R71!$8tNkCS`8Hva-D`+3AtWF)r1_- zP(L9zXsD!+gBt8mUwo5>@(Q_8gDq@_G*n#3O&V%1q*{Pbg&{X9K}4JLS@ghQ$w5{fzG4h>};Qf-P*;30QvDD{xLG!%Wv-5T_;Ri{Ci z2q5=pm=Yi-G)xYV%BKj^1mj;h6=BAJRL4q~J0O)A2(t*JG6P{gf!wEIW`W$VVUB@3 zpkcOwR6a$RcOaFW2{RC+@)5#Z1gU)Cc4c@KR(EKapdgjQ5T+_f2yt82^{}hOmx+ zd{4uQ0`g-GYYWIL8de!d@`x3xwoQHxD-R^OaRqA-B!e1OBS`X86|75;q!|>fP>^g< z(EixW4#P;nvIWU?8Wu1}4ro})Ajv3Eu&6oqKh@Y}@myb#t#`0#>;RT4gYL&JIrAJu78<;0(dMWz@OuNe`u$ec1?ag;fZ zI{nV0&UdWqt+Uo=uH&w^Y=`|bccuG~`%2mYkIyse`Gq&;J(`}DKA!%r@2KzF8PSZB z{xbh||M^6~A2^n|CUZRVXyzwb&jsyZfAG^#O=xxKMCd}eEc{ybQ#reG8*vo zQe|4@y_J8Oce1Lv>iwFMnjhBgs=ZV@Q@65yQ~mJt0oN8{u13#~@0Y}?v)Y5w^9ciR`WpKbqLhoj?E$NQZf zoyR&~>Kg0%&+fABiSFfCzS^e3K$JQKL^UrI;YfrAdyl!ya`SsrQ zTi4&d{?`Kw22KsUFmQ3h)P{Eky@P{;FVPI*jHDU>2n*RDB5`Ay6t{{SDM!lmYHaYL_}42 zU-yb-OB)9lS9sF`>0#S6OB-%j&>N|U_4kz(2yyl3hPCTj0`+yro*#^^Zx$s*W?*~o zqSNu3>ZnWPWW@VdRkgJ@-Z;O&5LLn{ytae7!yx4e8RlIoYl=v4~GpvaCMCyRE!%b23Sys&alkLsBJo@y= ztxJ{{c(XDJoAXOELK&;#>o<N-oqL|MgXpWQ@M+-%9iL0eKCW00}j&L;AR2&V5%%9HOIOPw| zyc;eo44b=oy^;`>PIL9lA*bas4_b~Zk2+i~hq>Ef8Q+@n7lp6(s9TMmaM4CF*^9I%}G!-1Li)ZS;_n%QmJPVuNsHRV5K z%pP_K^Dxsjh1WU#@{2i%EbcE~1jFq@Z8m7pH&R5>fDQ?T|$i*7#rSr zyrQzQ;`qklfBbXz^vu7eWn`qi?8&Gt{6t;ER*%o;nRz187n|$zi2ZddYJG?QV%CXv zSHft^Nb6Bk(+g`eJf9TS`aInp-`rSVWabHvuXaV#3D4k#pSDG+3ax6PmXIKSBcC5KhSV4aGwfA+xCkjNYshLq140DDa z=n@7-Hx3?)RMb?T-WEu6rMWW}RJZ1rHrs}o$jmIuEz0XW+?iLDTbh+=8g_GOert7a zo>fxZnC}hx0&Zu4$LR@Wr8(1U3Tr}sVW$PQovyB_h#VUn`ni$ruuNyj5KhZM!iK}; zbh`2l!?GR1WmgENZ5yP@<+k`65iYk=VeVD)Hzr2Mw+=s8Y}&Tx{^Hzlx+^QUv2}2H zTQIk}mT{StAp!w^mOI^9Tb&zhTRzy@keB7ksrH+WXvoJ^GHlyj?9Zt1drV;td2HJ( zesFl}xPIQNO-`q68X{;|PDX&!m}9tHhUs#dxx%)DgVg#=%QP*^FifX#@HR)9;V}3t z2J0s#4ch%j=IiDH78=EFDh27#aI? zY_z?zvwd{z;O?OfE%C-WqbhpWzg_)#TTkD0yN3o_Vli{Um+t#i&Af6x)-pJ>d&%AL ztN#>jy4RT3kT)kavRIWates~6!#raK5KN?WsX)-_=vt*EkqRxZbU5XRsj&*>mH#_j zCyehcTi;N(V%6|XkJmeoOpbT=uE=PMZQ48)kLB!JwPw@QmZ5lSW#j?lx%$TkhgYwt zYZzG8+cQ3Sm$9oQKDBvMtSw{Ufr?5s<>t`PnpG_AuANRNPiG$brYCZ;r?)K+JF>$; zYx;%qaKdHa;Es{`ot^VXc6@rRb8y$-Kyyn=^T6P*u5}h3u>INgfdh7q-@aA%Z?&@n zcE^_{rdBX}zce$o#LOKB>}Lb?6BVial*;_6w3iA{<54>=)3h(ydG34Mra#X;QF_NtZQ`AOywaIQ zN{C;D3&Z@4nCVQek^J&>m*MsLBB6>_k(HMvs`{&oyRw5JVfX^Id0wB9=@r5F@ly{^ zw0BJOuQ~VlXm(rg%zxd!b5wcx=+4X6I$!sP!$slnauG}~X%9uRePu;npFduio|&0m z-Cs2)CloIz&g&_x%?)Jb1s-VaFxvM#bo%(7{4(!`ub%x@kMYYdEtgtXAH?f4-NKZ6 zEyS|V9W0c{Ds8DVe1`gd!5X!!kW zovI9@vS(>mnee#1LU`Sxj&0h^pNzJZ?dIEz&o4Y7x76Nc4(a*xzPQrNz8lIrN{mQX z`C_mAmhI)m z+Z}r*CnuaEx7;#$i)-)xZQDln?zL~;KeBh<&dCV}{|{sLwCBya(@k%#Ja^xltDOG> DNL2-) delta 4089 zcmZ{ndvKKH6~>=$ce4qb&F*Hi*-bW^kUN2F?#U+PMu31JL<9m!z$!$N7%*Up)Ossx z6&0;F2qL9uQ?+O*A`10_msY1b#6jyH4u5o*$~ewh6m^`jb*2nTpEpN4<4n8X{J#75 z?tbq%=XuT^c-nqu!tOjX1w^NIIb)9VM_!-W)iD`=bYj>AI8FiX&TGeR9?59?v>5R3 z01p3kba-&6@c53y0M3%wC{N7rCVj;H*GTc`=5059+V{*(>|xfIKHJ$U8DM@l{f2 z#che5i6e0*>NYJclDVj6dQK z4&Z4#gFoOPO7VLk1 z6nA0=?!w);2Rm^u?!&KeKOVq?cnA+;7j|O;!x+JBxEyA$Elkg)rj{j4g!Y z8yMv{go7Ixa0tJ^z|ccd6ea;=hQf4!FwqT63`nZN6oK$H3``bCn!>b!coZfO#H%os zAS`I{nfEW{PP)SUg7_6?8YDwu&OrhSvk#J~Fb^R?g&7G6DVXGz3SnTDLb4U+D=JDXeqIT!j@6X;!d{ z@s}2bG5~2+ClI2bWKf|9L(GpNlw-&Sg~ALOQYg`oVH2NW z-qgXZi7laSL(JO|DmcW<2BDTi%xn;gbOFm6_KAjqu>y$EufLRW(PLZLrFwkvchX0Afdg50jqy&y&_2-b6ZheAh# z7)>DbHpmWzF30-6iwA^;2f16J^+E1YXo8TP3hfYbuR>#l7)>CwNQlt{LbHV2uh2Fj z4=6NH$b$;46!MUPZ$VduJgk^5N_Hu9TF7pNp3Ck?q5DD}QB3zGdll2P$v%bN3^}0C zr6JEL^lQlT3Z0v?_ySjiCJuR9p`AnCQLvQTDTNLXIit|)AzvtTeaJ!57`7NWZzSbMt+-)b@^V|2#8=7~jW1!>1j?d;FT(E4x!37r=HZSa2IM8`v z(a54xi#<#K($m_rr{~?CuP*OiRv%q<=!(|m)ywZ+esV?Eii0cND@Rto(HrQE_CDPE z&s9CE*00*Ox^VT*)o=8<`>r|Wnz_yvVQ?>2M9LzOz|9+n zTiV-OhBtmaI^5dU);c_T%jlZ^y88OM{xu)0?W=2OsOwuhTHalrk>hVF3rE8~SJ*1{ zWM_mk{Hc*5Pq2K+elt+n@`!EHJpT2M2E6#@j|Td{3~hV7d`Wp)Mn+m$W4I#h$xI6u zXBHR6Jbu3?mLBp%iURrh(eCnNBLxdx{Evf6uiKxsFEm1AmCl-8_+tNEyjHu#7voY_ z8w%<&(<&%6XXaVo-{!SBf4KI;Rixle0?g{dpBNP4V`Q?)l9%6(#xM zV7kYZ?6CW5{dv_r9nDqc1-Zctx67GiS>L^Ao005wrKQe|7UyJoTuF9|ABQ8w<@JTa z`6bcCOWNkuRu|@l>LRm>=ErKwigUC5zSJ2>4$HE2J8X7u!1h>KVM#FC;qa#AW|!vA zDJsh^%nGgc`xm4~!m|T@Pg*Dt4rZtOy`gY0 + + + + + + + + + + + + + + + + + + + + + + + + - - @@ -46,8 +68,6 @@ - - diff --git a/src/main/resources/static/component/layui/font/iconfont.ttf b/src/main/resources/static/component/layui/font/iconfont.ttf index 35cfa0bad40a3c581aff22f324b2e60d3f1bd0d4..6e84a89e031247509801ae5d65cc8d20323cb766 100644 GIT binary patch delta 6442 zcmai(d30RWeaFA|y;NV2s{BU!sf(u`#7wq*-1c)^P-EX$i@*_I`N7cfwd zF@}O6hFHNN*pM^@LP^46lavJGV3Xv)iBC_{=1@*c6HeN5hd^ivb#iEqE%kfn;s)|Z ztI_A(J9pl_bKm{_e&63u_IFO2zkS+#q#?Qe-=5eE*scJccXo~+8vU0aKY0?!UJHD0 z%h<@)9pyb2CIGxg;$s|e`Ru=8|2!!h+q?hvj3u+b1H^9u(;A=LzV)N~)JK8K9J_Dt z*4w9y9P-Bc_+U#L_lX(x{TQJlpf7HB7(*@!e#_a6$>*mJk@0x+> z88PSFYU6~FJfHp?#`j^Sdo^q`xa;$<8OJ%Z3q`P@!0(i2@487OQh$&#Q8t@ z)BI>kaDm|ex4`r*&d#LZW)_G$(yzP3UE=WPUPr_caqRzk@lh_~M|d5t;R0Tzp?-+J z#SicbzK`$WWjuqIa2DtAA{y`lzKiGaZF~oncn%f#8$63|;prrv!e8T?_$xe#MtmLB z_y(#_j0f=$?!}$>5>DV@Jc2LdB&P8dJc?8JDjvhv@HkH644%Lwrf?sQ<9x5vJt{O1mJ=XnefsXHo^@L?EM&o12>}=o9JC@u?|geq7eIWfWEc>L#V}OtiToo zu^ln&K^B%Ff^tN$7oGGg8~k)f2aS1k`VqS`>7h~Jnyaq-xv0EElkPj%Co~%TP7Tcm z$sq*|2}$2p(4>&`cLj|LX=+qFN`{Go28ZPO3Ys3$kyIDH`2kygfr9=3X=&&gkS+~< z1d?H)ptnG}HS`-uK8AuG1evL!FF|@W^eRZ7hW-V~Lr@^uz)nCzr-RJW(ET8@HFQMC zpoT698Pd=>A;TKFDP%-LhlQl7DCoM7xf(h#WS)lZ3^|A2uP*d#NSZ)_r`hIf=jVc0^( zGz?(KCJjRwk~*wlP(!w87~YU^4FerAp<&2FwrUvskZl^u0OWiP1pzYI&I_S7Kz3-T z5|Eu5>IGz%hROlit)YfM_GqXkki8n}3giL}6$WylhFSx;NJG_u?9(JEK#+?ylp@F_ z8XRHUuc16a-k_mSK`zx$vLKgfC|;1uHIy;P6&eZ}LTPi4HXh{y@px|xj{qKgdEUNKOr}2sHBjC8thbGe6xn~ z3b{#xt!#%hR9wi-8fq`3T7Xc6A-8C#$B=3cp)y0NIfNPwxm`oGhTNf{ZbPaKCV8QR zL#iDTiaF#?4P_ltZHiFfA$Msg^^m(Y6n)4&8uYMLr$LwqAopsR5+EluOb(FBrwG#o z<6k)yVa9+|$4ZzxAe9*ivk0Uz17SXa+^=C~fjppLj)6R=VYY!(K1G;!AeEg7GZ3Wm z5yD&qseIuMWq1`a&i0Ik$({w9hG`%21q}-T$d@!M z1t8CASQJ2B(y%;${E3Ez0_0CMEEyo*(y(}7{9oo9!a4%-T@5P=$d5FvEg-LISY;r^ zBUY%|HuV{-JdonX6|6y!3Tjx5AjMNvur5K0W>By~L8?VT`(q0`3?l{07Npi|Sim4P zpkXP46r)7Jq6R7Ygo5P_QqOBx=pgl~h9wVD?`c^4;C)NOG6?T)(6AuFZ<5dPLRcH& zg9{o~N%-KRhV>FYtkbBKX~GvW0@J53!11iLS>sv9 zvOdm!HfRO=gP(+ILTf@NLl?qj;q#HFa(3r7$SUUFW1i0t*YN#f1<%^Sk#a_+Hk4SXnZC%KQ|VqG$R_`da(0EIzaN%95o^?q70h$ul?f-|+I%yrr8~c~>1z zuKM-roYh^cA6s*D&8IgVUwe4%Kd%d~JGJi0`oZ-tZ}4o`w&9KqzZ_UF@c6*<1D7^V zZG3ysGdMW-BF$jV&dw%nFpsiu=~YQ3yGul3k+6D&f?lJvq#{}oZSFSWEzPP|TH=f+ z;)$ksMYel&#Tsu~zhmEylEvlogb;8JdK~ofl`feU;8D4L5W_S$YFq19OsHiIM>t4BRY2)DH3QtBLGi;e= zX~T^RdZQKb{=TvTA+8rifOH5|DPoo;!z&@81$@%`a;0sxR5n+ME}5 z+CG_iYhm1JpX+qn?O7pvrfaU#i1$5qRupRe?&yqL|K5T;d1?g5joQ zF`qxs94#-76^h~#XG?Qj1ReZ1%F%dJaV#7%e>QW|ls`Q4PPnizZ0_OpYEo3%%{4QJ z?GC4T$YHzssLkoLnR{#w=V-XlL&5b-R<=ZE0_NxnK(u3l#&2eob$5uMb$0tnd>PL2mm@xY-Gn<_cGu#Kl zMdsemHXja%Q=S}A$N`7_KsYe-uG;&|n=^YX%Pt6w4c z@cA-ca{FovKUNp9&F%HNXP%7q#pin6;y~TXTJMoRn>D>^zB6gG`7(Oc+|0sSpZnv& zTCcm??VTI%i_Sdh_SUYfJDI_}%_o@srg_EO&#H5hwea06;-~pXz|*uwEK(qphG;cV z4?xdP2LhFZZADZ?Q7BsCR1x7+YQjiTy2F@CeikT7a5&JYM%9JU(ijOcjOqkKtC`W3 zh@0^!C&wf4I>S+5MB>eL!V%aGyrMwFo0=JR!7yj&fi7WSbkpGRXhlu+>Ft3G zXNJqSpt?1`wAnJuWL8#LZc$$6kHiu~s8N%+ck+5NN+U?GK!*EzO;j}7*-Lec) z<#ajt8x>BMU19E1^EV|&$F~hXRBT$7`+?%zaHcamx3P6_MO!epx|V^N?Gu53KiidQ zudU7vwyhX!ZOF@Z=2ZJlTP)<|Dn83{75jY^ezz&iA-83j#SaZ{8`sZ!t;ue;OhW_> zhn*o{H|7{lr(rssX0EUt!bWPnro%KH4#P0*!p7Td8HUZ^vluL(m^EnkH_X?}1*|lR zQ9u3sxybad?r|g;_X(bMLeRcV=`0coI>fa@VI3 z+J(i_?7y35%m9MPv@jJ2IvriBv?N-g^_32%95Fpsp}g{chwFs#gJl~U>Q=5EzWIrI z`_akq?%tKYw)o~PQ;B%a{?%(YPi-Aav{ptRG@h-0VsLoP%DRSuWxYM)lXn}tTM|=S zHpkn10}obIswuaGhSsiTZFl{2I(a(t&^LV{5}7`?JZy`EgO2H$vT)LA;Ly&I`JJ8f zM|OU4y>n>y;6QUrOY^|sFRphM9<=-s>)=5v$8X)H`?pzabfj~C2Kw4k4r-F(Jt7lXt{3C(>HL z3riBg>>CO@n0>m8rdXIlq-@U@>lwS(s56?CZWNdf=k$x`LP_z9aABCgQ8Sa-HJV?Z z=`=hZZ!}cVDzfvkMOA-waaSZ55{5TWo9FQwSsoEgoOt|^iS~|({%^`&iv;c zyGE6lkM6p1z4LW{I9wDCuMok^lJ-zE;w>xkc>RgW%&e@;>i()ZIiW;Bab8bhZEhet zFYsV%htaB=wwVQ7-K0o(_+){g&Ii%;$`}|5X`)@4oC^4d4<%>Pmo0f+cr)NoJtI<-q z4Cjt!4IAhFJJgeL?n}j+z9BB1`{3e~*d=}_UKQuXYvO|Vk$7EP6qm#su#N24Ibs_h z**fYNogCjWa;sZ6wUbjL6ZW0E_K%D>cpW>i&DybR-_~v8BRgz+CnqQDBe&i2Z pf$iHz_U*H7IWV$s|E|di8~+bu&-Bf2%$>gHjaBE~d1JNxe*gtA1e5>( delta 4072 zcmZ{ndvKKH6~>=$casgtW_PpM>?WH{NH!M&+1!&&$eko$2mygW2v~&(!GHl%MC+BM zii#E$2qL9wQ!ms~L@*Q;(N?EAV0Fen9RBDym2sT2cpYbKoz|h!=jCW;oN4!)-*^As z-S0i;JkQzBpRpg=Yu{ZRe{^Cb6>z)*xO%P|yLEkL+b6|mnz19072i z#722ynkVT)?w=;bqnozg@=?#FuL0|Gz;=G@hPA^3_Y{YL3@^`Z*))91xXo?6Dd zzhLw5rjZu!u^!-$y}Um@e#4FFTffbXt_NN}12~8GoG$8k2^Q}qXJ0+~*=kSgKal3& z3E;!p$rV3rFa7({wxl}y-8@c#&79@OJonN>zV-e@z*aS}&=#G#$+p)vd-C!H*bc&e zc`wQ>U)eqhhix+-X+;4X2z#BfSN6*Rc}$*{7vwEDJJFdGTyjTZXX0q$mBjfADHm3J za`>~#OP2s|l0f!-fA4X5Q_ji<@`YSX*b+$zf1)ALn;1+CCB_r~8zzEjk4s6FZ#BnEX!zSE{oAEQ;f*WxIwqgs$u^BgE6dN!X*Wp^s z!&UeRmg8z%gB6Gmp&tve2)&q(9(17-E$Bc4XQdr6w4oTYQG<0@g?iMY8I`C)HKM4% zER_4+iaso;#Y|*j zBd$ji22g}$=*A$XVI|5i%w%w44qV7Z7;907B&JsKQ^%cFoOACYNO{_<`FYXgf^vC3 znfrwCf!C=pQV^apFlG>@se#dhFm(-#BgC#Sq7Y`hfw6^fd;_B#hj4HM0}kOA7#Mm; ziozs-OjDQ+5GJ~Ti2+Gdm?99qhJncfNmrOQ5Vyhvf_N0B5`^_EUi1E?+{sXwUl5Qb>-%e1(J*W-cV2%N1b~L#Q$arZdDm zL~xK>GcaL>L#8Xtbx482tcMgT%zsEkVI@F{6xIZ!SYdTQN|ZPY1!87^zzk>}A}k(A znZh!H%v4xVkXZ^#3sSDI$RJUL!kUIODy(iulfpWO%vMLLglV-w)EQP*xy43Izr-m&CcE)~DM-IU#eytUs9lgn3RMhpr9wSJTo&_yP}(3%6p9>VsY1Df3@8*n z$TEcz2wARB3?YLGWf8JMp+G{06iOvzr9#n!thx;6=W6bl8wr&ZVs0eVREW7oUX3~J^&N7(LZyd{Db#$32`!=eLpa?A`T)d)iXd*X-o%8^93ZBQ2yFsl z;zno~5EExY>wuWp5}F9agpJTnASPc3jRj)zh0tOkCSM5624eDy&~_k9!nj${fgral z^diU|3S9|ur$T>%Y*Xk|%v^<@1=+69y&y&_2-a|WmqJH_7)>DbHpmWzF30-6hX;g) z2f0_F^+E1aXo8TP3hfYbzd~b#7)>CwNQlt{LbHVIQfQly2NfD9aa6kK5K8`!Jhlfw$T7JSAmH<C;!#C!+9YkmU4Pp{QK0y-$1pmf^_g$r#T#=i8h)=nwlp%3755U7#m$EO0T{8$6mF%HEk%ma{SE zjZkyw%iQ|h6XEaj4o@GP{z1V|!N-M>!e=ANk=r6)6>TdzUEEZBq@=e*O83rqzii9Q z@XT#9kIk}`d&@h^PnCZYt&eVvo~RhA_`EV6s@z)ncGcplo2w30hpTti4Ava3wbedU z`*B@<-FV%J`U4IAhHbI@*aNX|8rL;G(Ri|{ziDsNm$O@EU)vmNo@_qXQqVHm>TSKb z&DD0My`X(x$GVPpI)^&n@BDPmp{_+;hq^9yH+T1T5A}RIcm3RV=D8RAslT;!>@VA!SvYyrBZ@>xB-tORjn$Vg(%PtbA|PU|mB)-QcRx^1kxSTwhaJC>rvnhOAIkGy|0_ z4%;Tp<6r-1z>BZ{XrTAZ(6%Sa=a;8vW~P@lhAKkttn^TER&gZe_W9hgjG#MQtE@skIiu9RBEO=hDc;`MH>bI#qNE@c$Z)4R9d=)>FTc9Kv$?9g zFfWklN=;6(tnW_Rra3*S>1ng0#kpDT)FivbkHe9Y>hT6c1trmW^V>RVt0Vcry6}vm zIkDQZ;=CN6H*H#y!?J9B4x8QMw>@4KDGB5_9G>*NoYI0>MP&t%?BH^ruPY-Qn(6ns z(}Vs{ASc7;35Eheuh$hWE1XqW5(@cU9$$8LUbrw^n42HW@dT6XsVQEUC;jEHE5qrs zthCfjZ!k0H^Lx_Mf<^PXuENwmXI(vMy)-rWmvPI&MAf_Dw6xKYvGIzv8@8++o9KIY SiNi6n?z*Xi?=DTE^x{7rNy*~? diff --git a/src/main/resources/static/component/layui/font/iconfont.woff b/src/main/resources/static/component/layui/font/iconfont.woff index afb843a1843bf9c93a170d6dc620a156b1f54343..acd7ed6082729ae968e44aa9f676cd50a37e8eb6 100644 GIT binary patch delta 34132 zcmV)2K+M08f&##f0u*;oMn(Vu00000hd=-e00000((I8GN`D15000cwW8004hj0004o0004o?S{MnZDDwD004mC z0000V0000W0xK8;>TY3eWdHzy00001PXGV{e>)JcL~w6&bN~Q?Pyhe~@Bjb@xUr8p z^^*tzgMZgob5#Wt#qoba0zpxu2BafmMd@8Y0YR}KHj;=1=^a9^0#Yq3_$tw7 z7*n#g`B<-G!#|EqI=24Xq4OK~nP2#c6CCG9e&Aca=R1z^4PWyyM>xt?d`Vvp^96_a zjDOF$k%Qd8r+mTzKH@_@;CCO&zvW<1@;ssvhC0^zgcJnH)@j7qt zCVSY+KKAn#i>c#Two}jZJjYg6v4u@M!)Bgl4I5a`T2`}>r7UA2OIW}I%w!f*n9Urf zGL33#sO2FZ=6>$u9>#Guw{s`s8O2@n=6?=`vxphGP9qr0P=;|UgBij=1~HdDs)=jp z!91>|3td$Y?diZuI?_qkwlnQ`kSl4+OCWI*7Q`)Jw!=rmi9?P5nh&Zt67R3RBM!SDLzys512- z(bm+FL_1S&5?7hJlxT12SE7TdbAO4BrXD6bnYx+iZ0c*Gi>bqjuBKimx|zD3xZ2eJ zM0ZmX5Z9P8f#_jM2jW^&P7v3b5`(zjlpVwkM*hAVO?g7xWJ(sIrzvBIn@wp$++xZd zqL(Rwh~B0wBKnw8iRf#}C!(Jzsfhlj%pwMu(u){q$}wV)Dba|*rfegIn151^7;4Hp zVwfrUh+9n=NDMcnAu+;~i^ND%LK3%`vXZ#nl$yjSQ+^VoO-V|OF=Z-ohbdi&v8J3Q z#+eeAxYLxq#9gKoCdQlcn7G@N%)~vWj3(|ir8RM%DYuCUrUWPMH)T07(Uj`M1Ezc@ z9yBFA@sKI=iHD6m?-A1+Ab%#ACIV4yj&W2R|BJZ_pR z#1p0oLp*8Z>r657b)GWvb*38m-lrM)-lrRR4Q3d5on{(&EoT{dPi7l=z2_Kt&*vI> zujUzff94xm3k!_AhYO9Y{Y6IB!eS%quFlAxFER2xE;X|5mKj-_%YTimqZLNh_(~&d ze3g+kzS_wCSYu>=tTnQq)*0DP>y7-ZPaD~<8!Y#_*l1+NY%(%qo-y*;Y&J4)wiuab zTaC=KZANC;vqt9Sb4KQ6y^){qc_XuPyOG(s!*aijokr&9E+ez~1tV+xMI&?lB_p%^ zWg~O$6(eWDZX@TfbK^}TYk!ZC^J=f<)Qx?XyL0R}vOf+O zIU5ff*(*nk%$uV|_RUEnXXYs*`}MSu{d&g8Og(Glygg^+Z28^DTKmJaPf?VZHYSYg`tXsj`9e*AjSv;)#~!t(EyrUuKuU4H9rRQ?4o($uB^0C=3# zy?KBe#hEwURn@mzt!{Not@|8FGoz7aB#orGN8_3C_`dIRz{WOUPIH;lCgI9Ku1yFK zh&KtjAZ!Sb`+qPb+07;)OA>YymV^+N9J_o0l5BSKCZ6{9RJUeqgV}xm`TqDkQgwB8 zRjI1F>Un<8QDuglJbCgamLWGY-OL2Dn_-MGWL2#o{R@~X&SnbvLcV_-H|qT~mdyx_ zW}{ha6bv5n=(tiw&qcIc|c;U6NJ7%ugw_|!d zo6b#dt4xy-giw;r^-OPBx#H01vKyB)50u2}_Gld6hcngQ zi${kl`SBi;pk!cr`+@rIO{^d*81bZ@&!g_#^!V!K%PQLz7Zh3d21P=$eXABtpVG-dld#r?*u%_oGaT=zAxo?rruIs{#u7noHJp4-Qw>4<#__MjTQ^ zR%RH)Ffcxt9A!4aO}>aS&=uz|U_$?$Yp@D~)1<=!15s`C!ywTdFk1CSv;9}&F$_wc z{;4SFj&H3>pBN4D7g34)=e`HdyLx72LNR>F{(pGZ7x1lZZr*XAcT3je^LaM@?3_xs zA?ZkpPL5wRd;gx_l|Fg+oI}f|{kjzJa8e++c%>P*{G98z?5|>SwZw{{*yzN?#evDu zYH{7B0~gRrKJ+*HH|=PIqfqx1v(OJf^#jJ z6}N(^jbt5K&hc|~mgiaA;&`5O+e7{g?SF|g6=odTQ$|Hp@273*b>7iJ%bG?b5AP(2 z=v^=l4TK+rb|K<45gyZY^0Htl6Um@`GfOV^1#PFDaeth6u9eqFvp(G^m+?7Gy{uyn#{T=&4QRLA3MSqcD zFs!>HEFwpk5VM?NxJ;ppV4cAXYBs7?0$D-RSw{x6IF8KVFrv*jdFWhz6gdOifGh2? zirc*%Lo@|52X^ncv(VXDxO2zur%y%iwSO-AeDWh6Un%(-4bZtBRrT2S=cgMn)q}1q zuP&)aUSGqNTmblF##6vVWv{#yx7RF`c*X_o$`S<@d@yhJkLK{0R9^as_jM zxrDifIm*0^c^~s3<^gy^Zl3~frwX(SuoRq?0dxhzLf%g2BCzT zForO*Z^yQ`z<+s+?iFUu1yfDy;D@C{;C;5Z?UF)y-6 z5DSPCMGW6=LE_<)M}oxBFMl~i%kS8C@Z8<+NE1=?+>s6ky@C<03~XCDXoia=Sf_>$ z>AGe}UanLOn}aL24fI6}Aym`|TMejCiBA-zwB{>l9)ieDk0_G#J9eLY(CzJ9jpIau zk%@T@)&z&6SP(D~1QJFfk68GsgeQdOF(w>hAr~uS7DG=k&%i&r7Jt7 z+*)r|%DB6F^cQnK9BfT5y>REYdZR%WossVkwB(7$8ue{EFPwQxbM7bA+O4>&FA{Z9 z7T*r-!_dB$$cKmy?SG?`D}i7RLIbmze8Hu^F#m${X$3k-7m~{ee`)#VzVhm|ySLxh z%iVm*!SRXJzQM+>*-M*^&=qSp?7H-voy~#H{M+#-d+*z}d)?}C-$I*9O)2LdPX8DPki zS~P&LK`|(UnZx_f8yX!QI&c3U<|BtM*tVs=Uhm(s?V0(=Eg&41)T_)IHRN!v9G&Iv@}{q3(;C={2EcWM7LjGCr`pW(3l)E1S35LW9@_2-3!!t z3?-3qwvHA~b${h@Xhx7bDUw644^k#o6o5cjw6Y|1}@E?vmX*8v_H4ox7i( zk6_8k{YQz27dtiVu-|(|87I#pt0K%$XiYO}fE68l#dC$8q9v-=P$%aSo+h+|<*sorD{yy5Nedqt@ zeB{GgFqjGkS0dA!84lzvwIijdTC>yZ_j`*=x}%{$Gm(xYOJUuJ=x-kw!NV85>)tyr zigzem?|=H-gDw2yGiq}p?znu-85cTVC)>R0|8m9}*?JkPSO~y~SpnYR$OYijxiK8H z0$I$Q*@>~?edk|$>26q31I?YgUzm?{`*3G#*;ohiND4xVgvxN0?Z4o`HN)f|7rnmK z!((LU8ReabeZ{KWNCxM}a*Gx5JE8)Cpv-g*;D37Oa>jlCFo~bRABOiIVDe0j@+`XE zV3jp9z$+36_$zReLN(~}=1jiLuQN`+Q%;{Tj^y+8TrQd&&SZuc4`s7Mx!G?Y;Q0gJ zKK`xqdH(!w%|83faQH>^$cr?5B3Gx`TbbeM;cOOy%+7u1^M3yPeeFx@#qi?ri%!5W ze1E%*k3(xUXyY(5!YqMyHdWjdf+{Wu!7?cRq~rgJ#)XI&F$>$Z%xrQk1Z)L9plNW4f}cztQUj> z-=1BuxNpb4XMY*_o@H5cufZ=_SPP=tu75@8X1JoIEQ$05mC;Qx2|6OxP4r@TCOqC> zu8s54o5y=cH_;yMk5`KDU@_96{M>6ny8Jb3{(bx{{ygJlqQF-sC}%07#yFz%&WHFK zg?bJJOaPIw0L;;QDr`8IQwPq%n=bBi@F@T#0lg&pc)~v{0r`7a`lup348%)%n15#l z-zRNMq$u|@~dc_wA_-sF{LPgeeD6EH|Fcb~xP*m6CC;Zy4 z&5HlGy1!Yl*A<#*gh=eK)SwSN>`n4evO8oqU-7#$L#Iv>s`HW_nx(@OT9q-#)pUQ>XZaU5FQf3mVdy1hV|(l z@dq-iMLbV=SW&h&%Mx6_Cq@FS_+2>(l`dQPDX0Eo_cBjJBXVnoR{8aHYs!5+-OE<& z^cseD{d*hrK~&}VhzFHDf;X(#KNclLxJQfxi3p*`dz~OeWn{{%FXFNPA8#8we2aXQ zOu>6gy$Rhj3PM4!1gmK^3xDXu0+jjVe56^r?e@}bx0PN6B*rNU&lk18pUgcB8b(1^# z7sX<=1`#Lf^@)!3P;>O0^EYf98%P+07>R+gjT_ECXS6w#?x4R5qJQqmuae`W<>0t7 z(3U04M&?|=@z*nV053c{^L8krOC1eYK5?a!Gj4MH!cq;I==7VMvyvS&)2O1;Z*uM; zaF+yk`VD3_E}7{n7Q1Gae0n~zaq{xX$;)r0!6dxx2)uCjg4Rn>sY5m(kmkN|DvmoP z2&0A!!Q4N~^x~%p__CxiobkD%jf69S4a-%MgwlLdfpM9+*#0YR%=~%?*zX6s7VPVm8RzZ@c6QU zv7yZ#P85{<#ORTNredU(jFd+bc?F3G6H}8EV(_w0NgBnBFMsUQNo(%5ut!?aABtGM z63-9S%B9K!HtT@X;OG--E`WdOMYN;-y6 zzR`qx72%hj$IU1v9oDWJ7W=f_8`oVC?Ct9xQ_E|I8-MXAj(4wEvUAIxt!q{tiv1$A zaoBmODsCh_e_89@CrHIG)?O zW_iOKWHZ5@s#jb(eaqiqR9t(}JC^s}b^W3TKY#jx-ggRE>Ka7WfdmWkC+_kSCB*H{ z1oJVKaNeMda2%v^38d@ZEe%@3K;e7$w~k)Cx#H6E;|`76!JK~v z7pCtMQx4V^1J9s!0hj_RD#FuIO74o3;KdPLU0Imf(DhmsriA6p30JR?H%vOs5eNb> zFMluww%`h^*REI`2#OrxEf4mOP43^esn*|L+qCVUwr;NVBSZJ)4V38;CDAL0d?B39 zlE(HXu5D|O-i@)`GF}+{uskCxC z4P4yvBsqsHW(t5>01=lk5d3^0mxm?m>M^+h2bWrP9O))yO}Q}`Cc@Plg)j!F&ykh( z4^T~%CDDGT7XO(X*0GFOdrl_0&m;caCujmXBuYr$X8#`1f6CAAd4yH{KK2))Uw^lM z@g)%(5%FL5|5ywMgh%aP=@Lg?;Cy}`y6{+#<516B2IV-8yQ7WaPksYrl?g@#+S5;^ zYm}zY#sM$*|9`NvSCP!G`P6HvZo-}zt`^f@?dYsk{_esLcH$*V zFH59KJ*({hQ{B*)F0I(Mq9>ieJprkh8mE;(n{ z4H^;*I&a}+9LFaB3AZRO&b!(am|ZYG=`?NkK}96vG@CL75Lgy~!aSC9OMhaf>#ikh z`x>o_Zki|-3dM<=E^0OU)-Jj0ua)(cOrqI4T;JKbvp(G0Ok^NsV!9(B2Gu}1TV-dL zuHU$4)5Jxsm=TW~vDQTsoAzv6zjPKKudJ_*&5X4MYCQu3J+*-r+*H?BU?m8u*HTT| z1rFZN5z(A!3arl*HSrcNxzvD>p8gUJJQD_D;&U-?{Gp zWHN_txhmU{O*@yl-`ML>3;r>VY<2R}EwmXtTw~sEJdv)1pC#+l^cQvkUbkPX@EzMiW;Jdtj@51MNlnMPQoXLd$ z6v}$+w?uMB>CI6$%zs7D4ZlfVHaU4&aybzQCd(~rIa~x{-#=d{vmmdmgmt6=?p;Jj zVa%m{4&{RtL|n=Safi;;IXX7LEFcaql4`6I*m4Xbqm)r#W^nhw!0yXwu(_~k)uMtE zpr0FI19?^+dh4N;9t3gk#v{uC{477RK|##G?!jYDG3SCVEq~Bbg=6le&ui#P>%j2v zftI2hUT)cSD}|3x*!2-%#dXWt@AF0SC6WM6$1ySJM~5RrHif1okW3+$bqy55DCaC6 z9eRRvPDe1)(Akx2KB|=G@xMLx#m9xmFA)U$p<{}!E630VLGy~D*Zv$T*n|7_;ghP| z8u!FaxiuvR;(zkwlnn97aoI%q#~*o2c+CC=`&C^*M-=_*tf-1}3lM9XFyK!3#@5|X8`z>!M>S$NBa4ug}) zb6L2WJc&VOm6&>@&>R^|31XsWcp%m1@vtfIAHmz(e+%4O`@@Jx|8qN4ojQ57pwM@^d8jz3em&OR@gpkj##d}#6 zk*Jjjg+1yAMR_~&iuMOl(Ei6@5H;=pPy%hNy?h(1ZEw?F10-{Rev{Nuep{O9 zO8XO`iObW)RJ^x4UMiWU5{&r5&5+us1cT{#IHJYkmPbIyFacnoqjA;87B)70I@jIZ z8Gl2wtH)D;!HABD%xf~$9LQcyMAJjd_HCWrGC3A4QiH4Pq4qkH<&oh_nw>qhNC=5) zG+&=YH)Og>MO>Y2qC#JNyd<}%l>UB6>N>2mFk^=q$h^DmelPvGw|7NDWk zz#+Cewnu91HL2zUnoPBW6f5VOZI!m_=tLI4*@+P?h1c&r@QVZI zt*6hh-D>3;Irtzm*VUDWlJF{VB9%(OrAYX94J6^;0Q?qBuSBBJNX2;~ymLht%#G#5 zEiu)R%jc%tGWMz{tuZ&RuPfpwV1MPrfqxbNr}R5|rEH*W`^(l`4}yTxS#F`9q*&|w z+~rr_eChtZ_jDKkdE?OF?A}8=)~qb`o@6#w7gyoay7}ruk5sA~d%Ex0v;VRy_M9^? zys2DXxmwItt25QA%d;T3A3q4cpJb{O`JHK>Ca*I}3tY}cu++5L#;uFyj(_Cq^*p8_ z3i{@bP}Ltk;tOuDU$tM8g9<03gdkGOSW*VT13%cv*<16CMjm}4*O;@lKtMyEpoJO_ zJ;ZZHkbj(IALoMx*S3#P9blL#Q~SsnTDRb77T>IXR#keM%Eq+iR3W&1!qp*|HKQADKHs(=dc{vosmEXqfWH{D1JVTkaLN-Ylbo z9lq??vQ{#im|5lm<}lTPp+@19p(X5Lovg1I( zd72wKIfg0UT`(>bvV6W!2Zmb%Nve>oQ%@S?2v;D0k71~g;}ghH_c*R4fbrKNR4%Pp z{e{&lO69(BgcjFh*MF|!<@#u$Fj|)fw}q3ciGyliKG&MKd(n8VP*DR21=Lnzpcopr zFI6oY4CXh)$&H6jxQ?oqkq8l0@^RIiWOja7E7w8;Bm=Rh?wj^&{kBT`U;qb zM_?X$99>vCkOmZzuBUOTWgkPcEi`Kb_qLC@ckTQQ^f4#@X^V&GbI&`=Is+lv5l95! z!!VMQ|2_ECHh=$*Inqf#Ges>dMj%@UIA3?Ju4+@rI_iLiRWn}am_ai-nO~RALE&Fr ziJr8_zVHRq<24QS7S%M>TPD4x>AjT(xM`2U^P@j?(rFIVb0vOga?<|OqDA(9O-|x1 zkggiQyJ=Z8_wsxlUK9Oza&qqF$w{=bT^R(EixyG5cz^Pr$%CW>6uAP3aXYgg(Bh4B z4C}yNsrQH#$mXdJ2|&eKz$KWYs0Q;*FQZ((VY!YoZKs~L?@2IV!Sv6%J~x0ZsfAQ` z^TOJvvfMCg1o=V@W;cux9e6J7hb(SSb{QgAgtP|u-TbM@YQ z6XSuokAG9y;#Mtcm(h=cntiPn3~F#6yc31|y>%#?s}E=GvXRzfNNVdRC-{z|Ti`*Zbrt{(#dpUzjW_L<199iIC! z{jCRmR!|G;A+#vh-=ABA!y1}$p7$V860r}&1%K6tA$lbeWPno;%wwHjkhhQ~)9Xl1 z{f;{l3{Zh0z=joQ76J|ggyo%e9%Oh50vyw5f1T=}vgtY<<9eGUk|QzmSu^(c#KI)k zv*n?O)-|ezKitV}HDl+ReqpsxF!2uEAR|GD*^@pQ4Xg5dWEH(&#$x7ru2QVVQuv|= z9)GwHCt}s!ODkO5Tok8u2K_91--sDc$m&5^Rb|HY;rS1s_r(PqYyjGc0_|svw4S!$ zOR+GaS4SuZajAVhf{xfnT8KHxAc(f$!pwnieY^!}?&U!@xnSOqG-Cy@YfjZX7s5b{x?N~v{L$n#WS9Y!?OqR6Bd;hUdAvfveD1Q+Q+QAQr| zvZn;q6zsXDkZ0k^LxKk>g8KxWgcJp`J|&o{@cm0g58OX4NOPMm6BH=(IFxZpI)Bff z!p!#%iLxks9!fyEB1!0b^uZI~zXB?KW4b-}8NeSN;fn9mANwAXBn9#zS(NZ2r*1xf zdLCD{`5}3jlpWoM1tSZxO)Y>dR0~Kb0Aw^!Lk7@Ny@n`V&ElCV@@MT=UOw>(@>lKS zFWawFQQ1CL#ecScgl4PgA5iOMCx1uP_8|Yus8zLJAwtzYW;d#6c77c^Nd83j0A;1J zRL+CEh~zjT=9lV{*5eIY=F5|FC!YA-JeQ9H;K!8z_uMt(Ye|?Z>hJQv5+P{{3 zJSRLmg$17>{{A)5@CkV8S%E{p6O|weP-0=f98`2a|D^qM$uA@BzWX?jUqaa@dH;N0 zo^bTW608QNFPugD;zP~CICA>)4g33Vf4lwtUjXSxf%*$icRu=u^AG&~ksSJuUR1E3 z?S0Aq>fLvvsSB=r`SYn4UVq3u{&HJKaTB?Q9D!QnK%YCAx}&2=Qzf2mIz(X%0X8Zl z&ar8yspq0Ygwr6l=due<2~dDI8Y)U`%pm1)vEFF3H-?;32L7fWLcmA5S!lUiSI*6xRQRjPMPZ5)%Xt8JaN0J?tkB}n$xmRmVE{- zioYqVvh2_e;^_9i5Atq?S<38kZ3^^HcN}LZeranZ9cvYT%4dXvUcIfboR@f^T%Dq0 zM_!hw6A=KRF%0iI=O`&K9=&g7MNb9ea%RKo^%IfF==9q4o6|j*m(*%$ackMksOniZ zyLqR_i*TuPYW%j@;eXb^cvl&44I)TWc5L0W6rSn!Pvn?K{D{B_0N#aLk)mWQ8%K;}yfYJ%hSsTW1imWWkb;~MmjwHLN(mc;Sq8*e975eT7OUc%Cb6p21@5uiw%#V6eAuI zM3s`n6Hg%8Q7ZMuQ|J$bu=Sr|UrxD?vYz6U)zO&wuBA zhMA+x&5m{H?C&RQxYOU&`S?(KG4#3?C5SlL~_Dm1;)SP(Cg zu19&hN`I^3TIVZo<_Ub@-v|~Y#S4tb!vl1|EbmdxP%0QPqMo29YD9vmkg0kAiUY3U zJ&@0@iEK(&2$E7hAMX_eQtKFsm*YbnH3E>G!-U8lNtG225k*gtH}NB$dyBwpS^!{& zAbC`c6L^UiSt!E^)InX~2;x`~5(Q3EJ(9q(;eV9o>1RpO=c|;1-cm>*=MHrF1i{xe zaIRCzAC?r=3`CjH@GscfmQn)iWTyT>*IaHs;;`!#g2nMX&%u^kShPG<(T7 zOR-l{g!ciw1B3;u-~*)A%a3!;13uTb36xQ7!8+ii(MWARf?0S0?<{n672dgH_YY|l z27d#hkNQM!z#}VVfnAdcd}F95vN3Q{i{m-$(RaL zhx0@``-j&9qt#5G8-B@^uicNcE}kYw$sq9VK4zKY4d7a+9L-+Mu~OAsg&(!UI_!)r z*iNZdzJJhN02IDi6>4>8m%?P`n#GBDb@KdJ0wF79A(YGButHRXnX6~uQDuFlvVU&R z`o6yPXa!2d`#ot(=`6K#lEIm4mrM)}p>GRgRX<5hurZ)2`^b(>~z!Sq2lC7=bZQ^R#j zJ5w)}b>zb`qUJouw+g-mx0YJF8h?<*fE(s$z9u!hFZfPp9dk<-MpUS%2n)%gmvXnz_+O3&!F=HSS# z)vHRp>6LXhcVy}KrK?nApv}c(utQo$HK^;Pj$pEAUzm@gPet>n5VbeM<$vFy@`qp* zM$v|d&wj{I*UFHs2bG|lyjC?%788LEX+8BuT`zS662-?&74w68mYQa7d6gu?ugg+v zSz~rgHC)VhoO}f^R}bZgZ5!?>YrW%rafYql85IFUlm5|FYqwl;U@vuM-h1Gh^R{ok zA$*m!W307!+sb7!U^(%8IRS8N#+wkmUi&ZT$vf|qL-y)T>!-%b`LG~b`O?_r zhArq3MYjjmtsNaqM`NYIu@y_voo~6pl?(oj{DkxXLQgXl28gG1YFmk8F+%ODGh6#A zb!VT?8959~?VLZT#PteLns?hNg*r>V07)kIqiBCuq1JGj=l5R-1&Am>a*9if_vR_QqalYop_9@t;h;R(@uO6J?S_A zjX@IGeA*N4mxSn^0cyz`@aXoKrnqrM`z4KPPJmK(+P`Yg$$$G{P6A5jYIUnws3$=L zfNQfL6q@d}39OBF|~2G{-H-c zcdx!1qLH!gM=tMKJU(4MbYIs<_`=i$JGFc6yYC)t7eqs&T_1vnt?Q;rmp-=dL;9{t zvl1EY+P4p?fq&?3{l0xqU0zze=Uk}zscrXayT_WNk?u&p$gSl{6p@Jtvmj4$JX2P zg+l&zCwfP&VEeDx?=H&yukPPFJVMvq)#YeD63ItbQh)0;{o=_jchFLIY}xVM?OX52 z!@oPWZvXDwi;#QYYy0=mVte+#whzkVD~)J07meBnXwg5?z@5`?2f6b~kg0MobH*4( zqIM)srLL$!3qhY?#R`be6aZcs(7#;6qK=7xwH=JjTYSdxh647(ljrQ5k}>Q@(j{yn zuNOTRntutSJ>i!9Au%l4ISDAE=0R(`5_(RYtAzdj>f~fi*Q-;L*92MtP4ef;d0j$B z&~s4O#HF=n3T$t7}GXT|y=sC%Y)_63iN`e|gXnS~as;cX?$;qnU|LI^*>nVoA z#h$i}6nphB)W_%w+aFDO2r zshf&QSSv7{$f#>Y*=qzM@ocWLu1gTQ`UiW;$*B2uVk&QWhSGy)VD+Ppn=e?joCSdC zv45i7X_#V~zoXaVRs3FE_Fx=~^z{tX%Edt7F`scKp}Tvi9dV% z^4Z;u!QsJk&%5%_p4p)hw#C+}Yd4;=cYo9RO0}=NX5B1);mAqm7&|gFyXVlA=bbw^ zJkZ>A&gJKG-NLImwe+YVpMuRaHJlt% z{UblP>Xec4@;$R-;|kKE0VFr->o=aWVA%Yp&-H)MF?@OqQZ&2|oOk7dVYJ@AeSha= z-T=|P=d4-PQ(iEm9@qld4SBpqTlaA@w6~Y;{XqG4y9)ERY)4h$7<1dxr)|e}6c-NX zo8P(znf1nLJ73AgqF<2objRfv56ujY_Y^I!M+G#}1rH}%i)V%gIy(%HAj-9LzFZj@ zS-PsH$ME-bcK0+Y6V>&bn~hYGB!5_zhbiOjT9oyxfLj5(>Yfw-K#2kBhAAj}GdV>P zIIqC7J`tOeHur0V<3vxg0Jp@09)lu^mZ+MFqw7(qt_N=gAbK<?k-H)n`NsqZLn0o+ZG)?f# zEGhOBmYp|ncz%1;;k1?gLVuLjlz+s%)ZNS5+>8Bc=fJ?4fr0sbgCB-pwNqEtF_y^LzkJjUYsp(SZoPTBwQ0RoT()Uhu?5x7 zy+DqfI6{&W6MU(>ZsXPV3n;bwJ!@9KXO_ku-LreHSX@Rw(3nog_kWA-fq#j`BmxL% zhFQ-rO{#S%&kvG4}fpd&ATop z>CY#LWyx$t6nCx^{hsdb&D+9?Q0~5B)rvr{NaRqE0NuqMGt-~nTiN^h>6wlseo+cZ z4|7tOx_Obmlb$s1Ea=_4c3gS*kT)R6%BJmG z*Y8=ebR)-YT)JY<`mNhhwVJEi%6Y_t-g*)Hwu2M!tmM+4&iMxV3QH;{ETf{q(@GvFvjoS&xO%(se;!h>zst%gHd!D+mJJAW~o@>%isAd&M$ydGXr<<(SJEu)qh)-Nl|-W9o`{(3cd%uo_CP8oHocHD%rKWdg$R$55}$N8Tr@3NP}ZPJbiO-J46Lf}ieA7@Z+AQwXL~ zIaJGpO0kZfu}0yZs}RpBxERTFeiI>?WzqG8sJ~-9Cjz|`ru1;ypSa}Xh{YniVVu*a zV#ZQrUXNH-#?h=E%Rk{|1$0$sCbHK^cZXxr)UqcLM?AzBigZOex!&c`c#oLv3Kji} z&x3RhJ%2f;2a-lHjU>W7fNm*v#7dG^^vjiU6-+ZV1+4s!4M)qoOK{-QCcg;o)r@~MKiqc)@4)b-?p)MW&^|@O&-jaiVw`|<{ z&8?f>n#<>NZ{4)@oNMQ|ApeoNO;Zo-lc{nFK7VLYFr6-?)3*h(UD<#WAV1yd?TKWf zte}}vhsWRIIIp5d42~7T3a1J3k$lH3o3=i=b<-^!`O~80!<4L^+A%~4t$ob>0Ve=B z`Ea}%k5`8)@puJq7DdBnML3^g0ztrptzyE%==%cHp`0~Y!NJEzfxq3v+=_GndPNw~ zY=0T`g3JW?km?@u)CNiS(G@CG>r!?$@KO&2nnt~sAYWs=z1M5pG0MTKsL>4rCPkx^ zVmcU-ZvJ)C;3WlA=N{^(dFbze$UtkRsR8-|3(i(PTEJ>n+)67Mx2_imXd+MfbYWx@H$e19+IvqE1bV9vLTe&fi+y6yJBv%X;}&^MZ= ztDnf}n?KQykUv5E0!b1DZ}fGkEfsr4FoHD=fRyYvq6kNgeMCfFNF4ECrKNRh8<7{K ziQp#*V_U#2&U(%$u8Lq9Dp5Q#~ zvM`WNSvpXsl?`k8`LarS5{6>Z3D6Ub?FY9voWQ}2u5N&HES^Co%A}YAAe)M_YkCcE zPCz(ks(miHf01T(IG+*wt7z)@ z@wdM9GwXBm5K`76J~G4y>^pPPP+A@8Lp zet(&Nh(9C^ai~`w;^$u6f`9*J%T@jM#{U2MVh8H&nAg95lKhlxhH;=fUi+CrW+}7s zEIxT@J+0>o6gWA1b*qj8QvEfIazzTMG(T?1js{wXTpWzPtH;Tb`2F8tiHZ^)3a zZ*x)(v!YnCpG5^y6FA64&t-vJ_Q$BP_JL=3{u#mGX+^wYf6K|?mVXlL2WSqo{q5(LBHG1IiOj8T}0XOg05Uvcp((Q$ILdT?!HXwOP)0-SIGznz;#nX!7)Sz<{sIE zDtSC$NEIvo<<z9@o2mpzXO%;b*cav05PGk@I)4$yfsw1e%Ch!*rI;$A z^Xz*iHRi~#-y!#r4e%~DoUTcx)=;6X5}|wmrl2FcR_Tj^x#*gqdvS9?CI>V@WjTua zo31~ed-en2v!!BX-QuM^Jpw;GocfwqRdi9+MbFnRAcU|!Rgol~z2M7U&FhyXfmJ+T zOSP7*g#vv9(0^(!bHP|38kFcirJRb3ezEr+*$aWp!EFMnS9nk)-44(jiCw7aj?*t~3M zcTZ3E(q#|Rh+j`VYNdh%$g;rTZ6h)5zvVt*`shcj&>e z{+dtb$(-Igc=V!H>!PCvTWxvq-Q+v?b4(uO@})pctpe3f7McQatg7j}BREjEiDA@s z#_q-NB7ap3bIaLa1cZay&eL>LSCGo(2qqud$@4)khse;-9xm)x{d2$8VggIB8WoNk z@8dL4@e)aB$yiJEmbClc7fwZ!ny;S3k?L|~zij!s0&`CdeP(FL%lkz|L2Jy6ED;rC z3d#Nyhz60b3LM4(S-)!sno+Ott zIgmxE#wATLR{@|I&bodfbk;S~j%wDh=w8)qGuu9ggzm&o^Hg)C_q#g48r^n;1?r>C<_^{Vl&y%y{OF@oE#EU(V}I$8H=$*7{q z#(%r-(@MQ54cng|8p7)*uT}yWbHZ1le?I$DP@}36NlpjQ8bwh|FU&u!$Aq4Z5}b&p z!e}$p#IuBaQ&**A-kdw)_SHFi?x=(DXa6VrtfNoSXpd5Kf@+QjL$==bd2#e*J_^|> z;%vJc2j;Ks8SEHj-^?O@l%DM~F@Eq8gn#E_=YI2>RBQJB_X~m*;U9WXh**N~f%mJ1 zp+5Pf6B^YMP-e~VSjy{A_hkHT}z8!yKmIK2#QnVFw}wGS1P&t6W>q% z47?)26alqNPXzA7<_M$-oh=YL+pJRuAW-i!_rQ)!K6lpCm!Dg;o(YfnFbHDLM*r!>)DG_v4wA?61o!|rUu0*0Mjz4l*65K=Tw|}E~bUcu= zd;y$L!$GhY4z#CH9d!6Xnb4Q&$WXqU+)K9hWdfN~6 zV{dQ4dBcuqlNZ`f>ACrRk?DmEl8uEUMDh#n@~(eTgJs^Z^0s_*O2l4M9DCpD8!tS6 zbbNgD{0mReNH)vS?Unh$+<)3gF4y1Df!+h}wLh1$ADw<`y2HovhQVQ8(FZ;?pesD) z41;HV=*SyZ_+UdYbu9GtFH}t+w&3W4#}W$kzmz@S|QK`jMhZ-4mGJ6 z6~@r9Q7zaW3-jlrjHA4JZeScOq)-KXoo;^qQM^mA59#)A;$2oKRZpP|x;NQKHT0YI z-=ytaoZh+E{vemSAAebJXP;EAj9DPt+c#5-g6j9H??(u8Vu12=vTu@bUlvRdf$~ipZu^kF zz%tlo(l93vGVfp>W}c;cRh;=oDY7NZZ#M(503$89hQ4~Zyugj<+kaT#HZP%^SikJaQ3e0?i+pI`7-&G8y_) ztGD-f1=e6S)0-N4td@U}ErYWN;k{aYYSUC&CuUqBh-ig-djmYi-nfB;e)J745gUI({kRMw3g@+#2okS*Og$F&`8AV>Jo+LuQBz9z2X=;+SVNCS`WI!g zu#yFtlTEErf~C!21={5Nl!N1LB}aiS(%s_c10!9SJM*U$opFXy5;Ygjr+J-SOmINF ziVB8vYQg+@4K6`-?9?uRpn2&;LEkcmO`l=5>O+NU|fc-;_UWu0sDc48h!lR?n_mLl3fAvu<|v zjZ>?aE(?E|nt%lKYOZr+@9^;6Yxa&rIK$6#W_k6F)#dW)axyL%f+V?^Qd3=+zO+FKGNQ0p(_LOmN$S!%Jg0%g+7(xXrV zHOwELcgXnteB_!v+c)1vwcNLD-v0O7=A+xLiFSWzS~ix8bcGcwZK0m=v~0#QFnfau zzgYG}`|`PLZ_LLU5XQ2mfcvnTYUXkiXILnl2sxI|-MVGl-=F?NTW-ze?PZ=!rx7hi zIs12VygLynB>m{;_FuTdL@`uIhJ&KaKF5e> zK=iV*AK#c+a$Nq& z+Xvr=YD<@2{Ur7wdO$E1`RH42)aU*L{1$(~%m9}103Q%U(S9HLIEUH5pI>~j@>toP zjiIlWKk+HoPvEcQ>%_xEs0@hQy)5n`q7<>efE?sNj?GD^F8afgeK*0pgwB`3e$oCe z{xfx|_z0@QEj+@kD0@Zw0}^CJjkev-l`;N>AVo0h;MeCiP;BMT4f zP|8PTM2bXD^FbIpqg<~j_m^Buj-%BoCdO;Zwp*!L~%NzRn}x`*M{s`^wpA&L=Q4F!{$MV)2{>+z@6P)G_P*(ZouL$ty?)=VK0lhEwS#jU1C9FDNO zFIZgMna@|3)%b9>cyK@k8eW~) zaNqjxEDgz$s6>J030%kn(>#Be7#i8W{9P+YN@gHv=$$S%<2uLeLGX4sbH~i@zrge&}(=Z(VTrb z@zYOh3Cx@Ovid>{Gl^nxq*zRxdBK;KC(H0T*1M<|KK60^^mgyHZrXYFRwBrTwe~-P>td zP1%0N9U1_X<}DFko&$dr$;!TCqKp8R%st><(e2N=>+KnGoOIK@R-AJXN*RwM$02SU z)AJ1g-C>@dg`y(-nyNkhBP|zKN%3P|*%LEJMg+jJx z`h?mUSMB@IUSGUZ?Ih@vaPNcr^VAsJ+c%;kkQD2JEcU%LYbUz-4GHtV{S0}W6rD5c zGSp*`T8*1h`=G)K(BCr>vZz8Hv-hfnn2NU952(>jZvkCx-`Y;v3Q4hoT0rO;bQ7dO z9BoD0>9c};#~XhV7@~|(KO0nAt*T8;vre&R^PacocI?acb1oph#JcY)v!pil-8Z?(CJf_K6*GL z3BJu9#)p2W2JEBw19LNKAfTdeBP;N^tFM2?OXp6Qz8{bw(|6+URrB}wLZ9i>eUy9x z@B-cEN>6dlBkCNTC7084UdJ7wJ;xm|KwXb`@_u_(1QfMflq3=TEkw~V zhz{E~+egt&=*GG81VMSlj0Ij%L^Y8BZ>G1lnS84gf6)7UBDoNW(gM`TsX1rt z9Va6UJu^WDzDv)>O*`!#U{(1p+TxmoZ}|d>#m?hR|DH|Eq~zo^GGEv`p$Ir}LKDoLf@p#;6{YIduJ0d=6Dtg3&es{TQi zWm9(lZy4unlok_ke0k|UFjtUuJpie;DMESk-pv~-RbS9IG%$NEX#uOPRW@wiOP^f6 zXZOI+DJ*^f|NA`u%ejgzXXg-gs<+@@F0%MsQ7Vo#$`rF zP-nbdyx%$1eRC7Qr+XkyZV^tam&}e5g1AxV18F_613-qB9Rgp4_fjQYEvJ3Sg zl*{vN9AV&O+Q7oKtk*Hho(BVNj&{(&D;=b{JgR#ohde&}DLj7?Q7yxhfrWXeD)W3K z!C}J13`v)dAtJk`sYHCPJL04u1x9+p5M<1MlHo?|=ET-(Vp#Qxip+HU?P#~xi+&NY zBk@=+Owgnr){T@GmpD!;rxnGrCJ_neVhNbf|Ng`G;!P8aqL>d`IXzXKkukCi+4Of= zvSIS#OtnkTni_uxTyimq(UVEd?TP^tkNn;vxudT@T{t=KMN>w`pB8$ODNO-}%1V?~ zeNf?f!_4R&`mn2a1@ZB14z#MIYL`xAh?KiQEzap?Yo8mKT4wY^v3PAzVV)N2+xAD%C#3 zDCz$T+Xf|Tz=fHiH#TG+?7%o3w1>RDs9kgi ze{elTpO}9s54Zlqsup@`J@{sNVd$Ep*9_4#^|O}Tx#XG>;=d@O|0*qT7U36K zSN-K`&g2lUSiK*IgNje8ydVDQPp>PDD?n&raiB3E;;<$nWxTZX%5E&f{ZkiTwJSxm zFh_s7uUvX+zIX}_S(tgL?52$oSR6oRo7FTsnk!AV_>F391C6YmH?x5i2RVKxA2Uk* zW78|YahxtZ9RKmk@oF(+B)L1_wDp-OxmH-(-xU16o0&o92#vm}Y#%zYVZ66E5KsFj z?1b%~NX7c{rRD3X^AZtZ*{Cf&ETbK<9qy9ue}z9 z3qScu;q#yOUw!GNlP6L5CqMCDEzGqK7s5{h=bmF0gr~I3sIn;S$sIr#A==hFs{nt4 zLKsRy;5bZ|6Y{rY_)l2!GtbEQ2c3{bultvWJ^mkgRig(^#aFVFutDrI&nWS4v_mux zM4(XHFNl=bX9IE8c50_kaDy;|^L-BO zIqFrQh=GToUf+nb|r2 zaB+F65RVr&Q;h!2G1IIpSrXfaTqDoTz7064FpQkf;k}4RsvXNK znrdo>tRkuy7R#%8(oP(wi>#2>Xf-KFg(!`3Jk2NF{q=ibzWyr0yXzF0Kw(B(`1RK7 zw*rlIQz*|Yb35INdZd43U21}9w>Q}&#{f6%AVIr7m748d#?XY2FtWW^&F8D{+Hxzk z=bW03KWaxUeZ|c3T%lBaG+Qm-yS$dq*B-6jeDm&8>6T8rUxYpqUvYh@SiAY=>aAPe z6`z`}S{7t4m&?(qEz5J;4{XalS^!pJ#S~9e(+Cj`Vg&W{nZ?Ove+oCAZy7$WnXg-oJa@Rm>6dj{4x!7^*bo)eLdq3o$J z#-Y7W{MG8!?|I_+C*D&k6iV-TV(*+=hRKbYbUL$f^8PKK7x;*s>?&^P%Vu0FB1)nn zKnF0qM7A(cK4*VnUs@Ls;Up!J4fGHaXbJFHwL&3&boF07@ilgf9ozrc_8sq8O`hzy zahTkA%@tQ%eZl0?)?=b%MVv5&5RO<8c>H;%|DGJ=%FHsyqGq|Lc9tuV>*cu6uvX`1m^SbF zTf8wp^k#q0*wMQ^O1=coMyUR?LowE}4%3;aQNdFg)q_(Z&@QG|$Y*EQp!aW%9z1mA z9(OBRazXU7&+h%uU@jfqQdz@=CIri0cI2|FZ$=Nh;>3jL`YS*Ck$SDPX9s%BqL{6S z`E7eAS<3J)ojj^J*?J8KV)D*o{+EyX6UWf>QL=wzYIb&Nif~hm2B5l_S1>Gy0#MsS zp-N~b^!5Pjwe5m5fDG>#g?D_C=9^h~fc8c)IScvv9PZ&8LT{-!$Y3TZ25jStRN02^ zQulH)A@cn&smRx&SNzQU4Nn-B_DRjU&C(tY+cyL`H1agvTiWam^awlrZ?J{!@DtQk z4D5ftP0M42l5*zW%)=RUP39kh#PjyE=dr>(&6@o;7P^|nSslMnpCK=hwah2pAM$v4 z#u7db&9P#$oxtJCI#|8m?gYr%(^9a&?D5l*us~G0hwU~)I=o+Xf_Irbl4 zJ9MJ9dH?3oQP|bK{72Ok9j$L3MeSU5^um81UvJt!Un9rK5=NWn1hE7)qq>%JQa~r_ z@d3C^;IgC1vn7ePE-AsqrS5-;((l}5rGb?L11m3BHGurzJ7XDkHjo{25y1niE?{S< zn(eyLDSJ0$^8KqWSk>RZYCx86ay%9vci*Y1?K1jL@m6c`3n4kAQHdu|2!X>Y5tV4r27(cMxQGymL5CN2M3JAoc2$iEg5g3zBMg5u^vx;O*7 zevHQm;bN9TFDO>5pAg`~|4HOu4>5}ywtw?*XRLh=##)`Bv*+tIYD?}0W2=9CCWw$H zmIRUQoP51VL0sB93dGzjHNEx@I8~P-xUe0Q8={Z@{O3}&yVPiux~tL*^;p|z)VFNE z^xWl34|ebICPr81dwVu)AKt#9r?+QyeZrd<;8(2R2OuzdUeBqh^F}AUJ>3VFE&VF=121c{b>1eKa;;bpT8ZK^8VecQd7sbU2osDqm9w|63jQ$%Wi+Zj3Y=zWt5Mg zQ}Ex-BsHwbP-jxu&Jd=)^7tqAYeHDuvrpC}Nxt*56s`PONyk_2#UdtHk*I%?cdQlo zC)G#3%jW-x* zCk1+i6>>uf;E-}mJ1BpI3Z()yFss+nIL{EC^RQ7zGX>bjVcz872y>@{D(Dlp`it=^ ze(iDi4S(SaUqH{pu62k7(B=n^R9YX$GyaXojtv|;hBhCA-=~7@n{Z%#^Y`Q#{3^_= zmj>D_loM_=tBcx>I|BNhdg}CsJ6bMt_H zsUBxAl`~UrVO2#~oai?l&Fyi^1v4Fu&BXGNgeoWE3;sN6!*ojh$&j^a#ES+Zs~4nQ z%ZMvv(gD)EYqWpZpSGp2+uL2M4M;@dRE6_+Q45Q_ViwcZSw*U9Nx4cx<@(%GUv;wB z1F6kq;?{kMqMOg}-E-l^w=3OV*W!`5JJ|JOHEibQFc*V04a)h=m+a4%_}iyuxl=PA zskImWU~(x3;vx4fMf`7^4y8Rn-tB>2dsK2^liq3p;~Rf(oD}`%{2bLKM&FAlk0|gT zY0LH>#wQu#GDU-(hM8jbo6=uq-V_-+H1)>9JSCdc*rLfWuxc!ZO4Q7}SPRB?doGPV z=L~gz(kvux&ZR+9FDDCyB;9S@c!4JO_sbdzh2?<(Is7yK;hyS1-0F8<-snD@uU4hF zH85bsf7*Xjt@ik#Jj9t7IA~zNc{y%v+-Swo(V!%{8=#QTKYdvazaG-$pv<3Dd;0sW z_>LX^#{Oy^ZS1M~G}FUz%fFzS$53E3Ps_jHg4QSdAqHO%x2Ug5Xshdp1hcCda+pVj zvw%mwD71^=vrzqzCVkzdipW&uJQ&{)HLs-(`&fS*5D|euK%h2Ll&NO&0@ht9sEb!A ziERCi`T%NrZ4se|s63e#*7Q0afP-vZsEHEMh0*NAS;xs{sUZ8kcXi)|mfVuPWr^88 z+;6@&``+lnKIg9NU9MrcBi`caMdes5)}I~7<;?zazuBLyn8{+Pku)mV^DBC?q*u;w z-8g@Y@V4wW|Fypf+Pg4{k3^%{UD@cO=#nfIp}%lP_TB!~w`FhJ zMb|g)$=>6j-bGP3x{JqMbf*`Kl@~2pSrIbH%@jj`bqDZP$PM0dfLA)J6sG2I{v;H7ofu=$Ha<0nBCB z8xS$)0z73F$opnbTCtc#`eEOCAKub>@P!8-q$l}!{GbVkSnMEB0dPS7033Ax-k62I zNOQE716_bF_1}jsMQdp4d~E*y#)lpXb$oh%i7aMxdV}$ke>63W8g1`MR9wjiVB&wL z1jwj$ec;oN`Ed;b*S+n+ZS@5U>f0{-&P7`r&1PfkMgCo!8RHx=#d|tmMn{eup|9$_ zBK+GrSv=>%e$K1?>?4rv!tY)f9_X248=?Q)hHwzHJppX~_mPp{p12W)02rkJ6;?(axLA zYR&ZAIjy>8$7coKhHa)_2$SUoy896{-$1*g!5^T*R6B^Z@U5eCCJ-USJw^VBHtXp{d>TgNkd zqgO9A>mpyX^Pc00PP2~jzEgm*Uq2Pxd*rhH6H`+Y`!8#C0{-BCo;dNJDAIGFX9@!3 za9{D=Tj})F$@7hiw!XXAH(Q=$xekm^O^qL5*(cEx`-aw@H?-#kbZCFs(0OZz_VssU zljMKHylVg*RS7MD-nNr!Mh+tw4l6LcIxe;FYmU%Sw5<(MMsv{>_EQ{a>c=n)kT{QX*grWmy4<0;t znapvyh07LZ%~_1H%ddaE{o3WZr@OnmpGKMSeTVif?#iWW3*&#`egvWT!dm*?E3dSj z?C@~bvA;Te-nP=q`TUC*m$sfa{0sEd)25;ug(ZDG6Du?ReT0lJUwOky_+K%O)-;=j z|0r(Ucwln!z>N*&nFPMWFOhO638Ug7wmwg7c-Ms11JAdWaU*|uXKwogq7a8IjRhMu zqXY`H+1}nNO#b@8+=<+`vJc6cCX>~$2mWpLQOt4pq3pLH>On$UJ;#pC9y|8KW5@j5 z8$VUG)gBE9lKaye?+?wTGq0ANYT7fwL8Jpi#HbcOFpF@?rGN zuIm)6CXA6Du6v|FjJnXDdbal168~*yaXOFwOhEjz{u2`u$3E}@^l#pCMt_nR8job1 zHybbj{(%rA{9lD=mh4L2FN^X zo;GU7DN7%l*;gRO$jkxJqiUeQC<^4qW6cY9Ua|GB7mqEPdE3qn>qaV$y0rC@*WEpw z&3-R9pm%uLEIqwq=Y`F&+R&P_*N;nG^5PAv)(n5wApgb3OZyt0UMlKdb1#gt>CutV zTkpEHRvAsZ=(Q~r<#%x-jLXHs#MC(>Lj!~7U%aP_Dtw>zk30$myk+Cc>7hPtjjFEE z`i7=gZe-bgDOZ+>Rjpb?F6X)n)dlq(rQX58-qMcxf@-lnrjy&qF-EQTG25LtdTwYi z&kcWYr|bk~M$gn%dmJ$_>D;u6zw56ouNxUzS4NM~-N-sWjvmV|D&W=>E-bd&zE z{|%_`NZYTA6Y2?Yb)C7tz>^(CTj2x$q|ASM66SG4#nlv9fZ{-9(L!{ae>K}A|97Y) zG*>nS|0Hq!TB%VoE3W@lw}PH*4I;5LDxuq?(Gn8T-*s*6+M2;r-GhVOvp*-%uN9Ef<-}kls#D-{_&hy?zIbe}_!I(dUmZ&}XJ9>Xp zt$Wg?-V{2i%a4gaQZ#=rlVB~dllR?+Hx0F3OZWDs@l&Z@UU^JBPnVxh+O30BD22ZF zok#RQrw_k?zePti8KVMv*x!i%$^Wqbq4qd;J#OPs6znW;tk<*(=&~*7$NpXI_18y9 zJoFa~swm0)|CAZeQ4CNV7@vuSGG>3+Ra6eg)*}PhEe5~EmdJ%u7*+HuW8hjH+^nuP z@K%H31=8RmMqDv~u7=k^;Hon`uhGe17_Ey@VIKTegt16aozBe%7%#(=!iqFqyTWA_ z7)L=dji5jZ{N;8~xR~}|;4Hkss^kW!U%|-W6yDOHh}ZFI2*+0Zm0T;u+Iak+2bV#|W?UaTQ01V<1jMIyRJ~5*Jq}&=i~y*9}D$HPu?K z@}f4bdz=cnx&;Ky5MG#$ryX9$;Uy~8_*gO?pAaOzOb{71Rh74m^N7fE7sw9O5R*C( z$%3?0O@v)lQsJeBKi+@XdKqnn%eFTByN1r0X}3jZJ>zraD`Ya1g7Il3MS5W?M{QSG zX99ZU-xT$)t<-r24V|yx`;RzX?h)$#?TFjuu)qU{4(u79m>A!4;5P^ME}ocJy!XJN zOFK$*-`qYk+H8)_Y(I!TJTIH;Mrc9kW0Q;b9Qf`2Alv@m9@u}gcyjhrH2GXU76^qp zey!d`vdkCp5aZH9O%uj0Dt`$UGwa!oSRNR)qD_b797Cl>rD05%?FFTHm^EjK8pb~n z%i@uE>oG5v^YD1l^5)se?oLOK!QmuE~op7#X{;H?!sHi_5A! zdTu&?mbGh_wHkjfkG=mhxpFQ(l4~8w48^LVza`x;K6kP4nVL9Jde)w!XA8Bq-?)0m_sWrzIZ zH-D(qL{r1~?L*To>)kh@x2JnsLI&U6`m1y={;yvA{_cN$3relO9-f{aMn4)pvadJ& zj(>N%TYY_LwA6nx-A9}9T&Tn2Qp>Fj9kcU7hLd$LC3(q6woF+9RgPE)3G@7+ZsHo^U@L>!2lj>wA z2VaD8XnW>KlNe=Ke?$F%T!w~+@@ZsVWG@=hIPBhRM{-R5)F@Soc|PheL&BU$J=cy> zI)V;)LZIi}6sx1TXpO!aIvPTUqpJxc6=)T4&LXnj5#H3CxogdaD?k^VU?5qIruU~L z=0_?(#ZWDx(E(HnG!z3_&}hkJ0Kjlg*B^2Y(>KbA`L_9Of7GR}c3?aYmc6EfrWb>M%+Ms~k`&6pzi?_8613bd02pdACifp8Ec`U0aLU12J98C_f9K!t~CIccy zGKvlp5s@ZZ(nBZ5s5Kyv9v*XpC;_n+l44;lsX7RWQJ?~FH`04VIB-0iAhBD}p%90l zD0LLgn`WhlM@3SAnL3>5g1Y1}pW;h|%W^R!5zGT0f6AcadC*n5xJ0cot4-zpZyvUmzuMklJ zf*Jpk;FvCg}0XZS#^S0gWlj1etL)lED6l&WLB_sVWv*N1@@MuK3ATf`}YKhAm?Y z-(gxnsq<(M^NLnDM{>EI0m)T4QqXXOi@}?Ze^`uZfBbi$n~E5ECkGz_AHkgBaVt1t z7+gkHID%pR>*fuN@&>|L=tCtO89)&pRiqnqij5+cA}9{T@kekR+C+@>k7d*9-~>?e zE-!~sTr9*5A+2aa7)nnX29UX)MwScV1h0j4BdI7!u^VG9Q&xCa(1x|BsCsw}M;v70 zt2sl>e@&n?rxqj~=VT3Gmvi?(?}PWn^B6h{FUi2f0Ljh`5JTHh|B=8`2a_ z#Ht2kub@gXO`#5K`4m<#Qm^N9q#`j=N|_t$e-c&(V$mIiw@FARk`NOV7=^e*9Nw{$ zjltl=1H)+%O{uSw1P@s_5sA14b)ku1KoMjLSp(k-j|GX2NicX}ERMR4ifYTk@OhA- z`jzkrMI?+2qC^pI;?H4VMI$k-#}v8V2$JrB&B78MkY$uaL`$HZU9!q`xp+mGQ;7ki ze@z%ZU1TSC1W%|&`5ql!J>o@4BZg{9 zeW_GmdPlO9g#WeCq-`go7Q6<5;qgXbEQUckDe>km-vF55oF*O2J1pZ6#U!#&%G=?ozaLVZ; zPR4;#jGdS&*|Av0jG$y9>&a>uLeQ46E>+2Q4--L7BgFA|v4s4is82A$oCKc|G};1~ zAyjKpfOZNaB=gi@pR)}*G5Oy{X<)7Uv40&$kOEgkhZlAK`xx~Y0?+$j72CYne-q?6 zvXrf#)kACkl=U-01^;w$X|yQVOuR@#RN4T9juQ<)xk?yc4_p(lPkRo$wtp{0Qs2A( z&}E(FukUm~ciyIZRghL%<>ZN(QO$L;%iaPl5S*5js&(12#jymHTd)Bc_4^64Y~f92@T4b96l zm%BH`qIHDo(b!EcoHpBfKJUUa9ota^@1a7q)r1^SkE2k#s90eRk4Bpnh(qKYC9SBc z{~@JIQIv|R!l{2R1iKV;30`yRJgur}IH29_^lh8hoA9~7`-S8-5)Cs3M9f4Cde`}q zXUhIZIGr~H{{yn=!F23@f0`cAF51yQK;t{S{{IASX_ED?eumNW$M>)7e3M~}<~-rN z+JWZ3{=m%U(RzJ!^UOiiGnG13ej3EdXDJ#-K4AAzJhf565M5bcAG(vk25 z+BkuLPiNx04nR%1gO4A$0(Aq?Uf?UYE!$&MXfx3JVc{|gyfpMly zE!X3mfH|oj2KS7TQODG7)v#hP-FW(-?!hstnz1frOodnlOZ_qsACYKyIW<&&L*{Vi zkIw9GFRv|^*Ir0>f93tD%7RLY?a-6|-){NF%%?x>zqP9ayT3`btCOk({qXDLYh*oJ zpPgXn!he#N2^1)t1cqf4!T~W?_a5ad&|_yWo8FyDr&GJ9m%VT4lHDoz?Ow9&Dof?K+0phIPap`M#O;wV+IH(w48V}u{gnFC@bGaNVIT!KRpKSiAwYZbvOu^v zyo*wD(E{1df9alx@a)wHNuHjyl?4k^CEX=92C7-cqJ=dPWbIRaD}(N$;X^LQPS_i8v>QyUn)uaV`Ue~UxUg+hEeT%Y8;NdY+hNnBPV zvX_sb4A;zXVg`uy>?F`M+}t%MVmcWD7t7lGY)U>t_zDqaU9+5&(}=Be6^SwqA`de$ zq2Ns%RffgXct$r}+jCvlHVj>t1q5UrgJV}94bU=3QnRue^He9S7(i{)%#x0B8t?(L z|HIH#f5;(24roYKpuTo3y*rz9yto(hqMi|!fqWr~Zj+K87J-(Kl!zYnGT!3&OiWQk z;4(!)2r4CV1PF4tsj5Yyv1mLNk2#hWOQ+JVV;YJk7sKbN5xviZw2~V3qNc(jHxaWf z(=a2ds`5Y*ijt}ub~M&CC4^Jmh726EVVK?;e?r1Mr<-chu=}juxETp+k|-#uPU@!P zC9=y!Et9tt9;Hpoj&G79x+Y7U0PW*>UM$(?+BQ(Lq8c`$iELMQ%(E>87*>5_*fa)# z;N+mFxNE6Ailq~dZJSXetf@ROv~qZkzIle673vC=LL;FuI&*em&(*Q0<2KHFBUs3! zf9rQ0u!=cYi%tN|Zhzp0l?Y8djJ)B8pUFx$A7)p zEW*EEpoaokhL&G@|MtxvddGP(f!8G{Su97x{npqAH*bI7&`N(IStv9L1)xAnkRh3b zGK$5Z-cLfkDP0z0^5i$4H>r*lU281Vf3pq_T@PdtOmutpzuE}^UGZ~28f>k*@xPKK zr$w{Ct2zJH+`YM6TZaAm%j5*v$mZ*b(8|#Hf69z)Gx(oe8`GA#@NEMCku&0e<6uh z1xK>+v|^Yqo!O7m?B74FKvV~=WzpGZFBU~!7gucFv_jNRT2MkFVYd%$J*zL{7ug!B z2YqHBR1UBOsm2>!CPimz<)5y)nMWm<{!tT&R2#9>^vIWIZz4C&-cQD7p8>|Sr&jC1 zJ=JQFfq1yttlN6gL$>=%|F<5Je*97E|0Wk^ ztJje1`oGP)54-P&9Ko1&f?<_VU&YkZXO4jp1+cD6-RAVgl3WLNs8*f8%(=B=!bzoV z-V4M$Sv>i`qYoTjR>+G9M-VgJ_1dPH7iKn5Qft%9zJuG;xF)Ehe>SlNe-bV8uQH%^ z#t#h7GamQwm!_63J#zod^or zhW~?z9qaafZFr%!{^ynWd(1i`6Uxtf6ARApGD4uL_WZ?Tr^d8q;L{M#IP&;_e-*Xz z!OJxZrN8i$z_q?e5qQz{ez7g3@55-{H83u0iU&}iD$ zB!$u<-{-Zk>`(hkZB56(1(!^pg#B~V47*L_(2GYA@n13R|8gZUf12SIY^0JiLdG#K zyz&D@blnKqUR{gs_N{F31x44D=VhD6M(ZZ-f~s(?fD;aK(Z^&?6ZK$>d4@bmrb7<2 zEo;{|MJ3IfZ@K_S?fdIYfyv1`$iJ@h{r%_M_k8uPoeLH%TCj81zjgvwTRkUF!hc7r zvNHngUNlbjFQh3if7vm%aN*dFOK6sbt;@bi(|>aghX+4GwT}=qrbtb6P7Jkv;Q#j! zg(t>Ghx`zV5BiTYz@@+sMu>DVzhWJqAUf5$3RY$s)ixY$qyxq+3d~lf(e?*OnORiS znK642f3CMOG`@Y|(7-)ZG^m@-!XCp*sJ5GQ(wZT{3>&#Ye-tsNboJ#To?P^Q)Y~NW zbxk~qf83>qOPT%a=;CO^Q#I3052W&j9Ki&Oaj^ z^vfo~KN|C|e?WJP`Jb7Wj(%&OBtM3EwI{SbbP?70|HH_O@V*Mv9&G|MJ&lRL4O*Eg z@Gz899kf4GOYT#Mf$Mt-gsaP1KVVkOg6 zz9#rz2ci@RIbMN%pFmYO?^%ddmBZsi+@S8;7babm#4GpP)oPZ@J{L=;W6wdLTD9+g zB~gi(pW)ulqp+>~M+ELhjc@Z&e}m_d1F=h65+kz;l8FB+|5uV@NC-lb z;lL3^=(+zZI2sOqk_95J=>L)?jEKnaeF1V_;-pU;yIf zA5Uh*^V@u7;AUX}fd>_PEnxKjzyIr4e~p=&fm{v-CXgrqb({@X0001ZoMT{QU|??e z-@p*Vy7K?u|9@GH8Gs@v;1B?{jtBvGoMT~NU|?bR|DS~sM8hzU&w$LQ05g)H)`m)U zV#CUmnt>}!{{N$Dcwxhw*vuzZ3|Bn-|4Xwt$7Y{8D4eKgKI=;AhA{w*4H_)~e*gdg z0FVI^0a^jP0wx0>18@Vl1SAB61rP;<1=a>k2C@eD2aX5G2m}bu2`CAE3H%Cn3l0lr z3(^cW41^5|4QvhA4ulS@4>Avy5F`*}5VR2x5sDI25^NHL67UnK6bKYZ6!H};6;c(F z6}}cE7Q7dv7-|_X8JrqS8j>3Re;Z00mK*#WXdKoZb{)7L5FUshJRgD}0wGKx_#>nw zDkP>QG9_>&_9j#&$R|E0%qR*dhA8?emMSzV;4C66z%6Pm%q{*dP%mCDjxY!?L@LKZ@9LgGWRL>feN9EQ5aD^QJ7MKQutGfRDM+2RTfp2RrFR`RA00R)(Um!f8rnGXd0Vm=loQzX&Do(@cI0I+mES!yVa4ycn`M3ZV;v!s( zOK>SJ!{xXFSK=yMjcaf%uEX`X0XO0%2n-P+1|h)+DI{*j7z!D3XcSn2frUefWlXRE zE4T%>;x^olJ8&oNf5P3k2lwJW+>ZzFARfZQcm$8)F+7eZ@FbqX(|88Y;yFBz7w{rp z!pnFCui`bljyLco-oo2>2k+uNypIp?AwI&#_ynKgGklIO@Fl*&*Z2nC;yZkgAMhi7 z!q4~xzv4Iijz91x{=(nbh<|20ibv!r5=oF~6_e>VQ>Y8dfBlhkL;;U!IqbyJilL&| z%e2mYGDe%WEu)C6?JSjKoz%IfbTn?!3eE99l=-r>l6|^E5shsjBI-I>*f5bwd5&HD zh_5!ilm}OT^_3i@&d*9KBhSfakeYfoez>xpeiZ3Cr8x^&(|CbDI$^(hll%^8Zzh{8x3&Zgsx$ZbMg z8<}MpQAfnFtZM7qa>$!eWd~MCM#(RX%w0em3T>PhX=VF1GDLZpluFG{ZNr6XLtP^r zg{e?UuePk_7+z&|BT}kJbx!SNGLep{&zZ_RoRA#qe@aFR@lin072hrt>&3$uvs#WgS3*S{wgvY$n+!VDYRKJ!1H99DrWT3X7$)hNflo8 oEVP_1{F-C0V%Muwy|7x;Dx#6nmU{KrWTMB@t(lpB0TdQ@pvf}#Z~y=R delta 32485 zcmV)FK)=7hjslQ^0u*;oMn(Vu00000fe-)-00000$t;l+N`D09000a`my=}*XKZ<9 z000JX0044v006AS6Fuo9Xk}q!004O80000n0000sBD938XlP|&004Oy0000W0000a z2@eI|Xl-004P>0004U0004UQ-vfPZDDwD004UM z0000V0000W0xJ#!>TY3eWdHzs5C8xHPXGV{e>)JcL~w6&bN~Q+U;qFFtpETAVfq^^ zW|Ig3gMZdXZ&Y^_#^Ik0E_4IN^xm7PruS-kx9PoC)0^qd^b#P1kc1?pkpu!MELelY zcVNNl{Ebk)0TMaKFB=w7q+}P59&0@E9nIW(-uE6L3#jILxa$7&E*bue%-jBIM%C-p zs9E)T^~|mQ_b}S{|Fy`=v1@kIZrL4sXpil=y??Nm_NTo~nJFt3q@q-uO49sPmdaB_ zdXS!`SCzSyrLXV5DSY=1^0ExO{{HAk_UwbB^Z)7SfBlo;pMF%v>Wua89~(0^fAA># z`-dO>gx~ptU-^wkJmwdE<{=OGi66Po9lqmxe&Aa=@eN;dk1zR(R@|i}U+_7f@hP|Y zgnwIn%yl|*gSOoCGufD99Ooe0Il)Ozahfw!aF%nN=K>eG#AU8|zIHY-Km=*}!<#v62ZaVlner!ct0^&s3%{onj_2jxmg4C?hHI zb25Sf45tHw>BDLk(x1Kzp^#qm_Uqr1Zhv%V869ay6PmJ|W;7(90_sqg&D0~0`ZS;x z6Up^iX-#(3>|`>7napA!vzg2ky3&Y^Y+?{|XwO{6QbG+D(1jH~Q8|pJHqB|lD*DA# zW@P_|EB$}@sU5#^@4f%)NhC+Ao@a~CC3!jG6N(`|t5}Bk)MA<9^NUpzpJc4M_n@;WsA=_mLop#Sg!c&V>QH6fYlVw16E5s8CY%cj9_)d(}L9%&ka^jJV98Vc$TpG z;;F(Ki02DyD4sMdUp#YIBk}ZM1>!lx8jB|qYa*Uatf_cPv1a0V#hQyJ7i%G&VXUQi znz2^mxyD+HCmd@do^`CPc<)?I_+3SSKOgud@)}qlT@!r9Di8m0|TfB>~KH{x}^%d_Yte<#OVg1EB3o8=bbCw`Pe-1_Qy(u_#UO=cLZ#{_`LyJ zAjEMC#qSr`BJn#1wpfVwSbrkKdn^^=`z;gV`z;sZ`>hb-oUIh%oUIb#+^-hm`m7P+ z8m<*$7S;)Io!1L7Ya4`^k&Qyk#U>$UaI+Azvqgx^Z53h$w+S)tWkP(e?LwTJ9YW0e zP9ZX}ONja1Ekw5V2$8M5LS$>7#Li{=g~;UrA#!|Bh#Z#-agGlO(SH+%h3J(dLUh|v zA-e6D5ZC0m5IuK7h#oyDM30^lqB~Cu(b;E&=+U-p^?u=vqPE8(2~Jy zb}+yDTL*alz_*Tn^8%i~;G4Uj`$ahXB6|2m8a|P4(Cp)xp_!p<7J|&qeHZY4{(^n& z+xUy&CE*vHfMNJ{8y{m>MuRpEF~iI&9N zrQ7aohDK}9Tw+y&0^*C+LJKv~P1mMc>EBgZDU{Nxg-s)#`QOmyc69WOPt!J!E~_jb z<;m&|`+5${3BrMI?OwU0cgMcxei8YeWm)sD!j~+p1<|e7qI4@<)l!y3dV|WyrkDgB zks2m?F@L-?Jl0pKkMT2`$9hIK(H`!PS4;3>3DTkb{HsA|B-Sj3ap&W2@#Bn_i84LR z1oSggLCrDLglX|1zMknpFgLX%N+1k0I!Mx)u!RCXaYCiGuLdZ0LQ3Y&s*L zUy44S@DE8LO?*iDs3JWi>X!5n&kDXz+Wufc{eOn$ebQSDqL+)U*1Q*!Zzz8BvM&(u z*?zx*6j{@uupWZKP&A}NQC*Xt@N2&|tN!2W{#MamUu>aaBC)?xgFf_-FQ_t3Urv6R ze2EMKY{i)xvx{N!8Qu)mntcTVljKfQ5T?X|p&}#}9pHlJn&nIzHU~mcbDEnnTE)(Go1WhDDboU7DD=cA-yyT!`GwkzT?%LCPHgGJZw|C-PgG z#eS8BpL9Ft%+U+vZ%LBrW2TsObdI=85th5V#$m*1t5j5gwCt&7)}3}XXoCVK4}Yu6 zpoLn-C_tq^R3reDRsbd`lnOj|`b!?84XaihPNvhz!z)&8IB)ZYL6HQaV(mTacCBC2 z)7#s#X8o=`>(-QeU@pdn2Jh^U1Vs=Y6vCFke}?tx9`Oe~2D|ga4ntN}vF@S0uAMv1yNAQLf z`yWL~5$+ZvK_Wuv@m?ngQ5l&s>x+2o|Ko*u!!TCgBwr=dFmEYmoL&#DMo}mVmSDB4 zRuP@JW?}djp|DlH^|tb@x0Y|awS4RF8E>2jUa{~JE{X~eeDnX3ZxD&eQhzw%g^CL- z0cRQ(A;z5z+8+GelFO6H%irFt$6}LxJEqo`QoPEiO6#X~^i9TM^(GM~8jXoudayNe z?gbk*j`k-ELX1TJ=*A5foIBDQOy}r#W%%w_$#F6ceN8hJz`4tqjm&w>CCryCk^NA273V z+0xEZsdMSFPcK9^P92(>I&=#SreL-sFyZbE%}G%yCmRq*^WQiX#~l)cQA37c{-0!e z^V0kPv|St5Umon~?Hg4q>xP=~D2{inT()z|o~>(FACCPzv~k}? zD~NFKs_mhqrqV0O}l3YhjW%Enn0Z$cWfQ*>`p*s zySHqayD3&;*-AN=J+iLU*H`MOTwGq!-MylWmRcM78|$nXd*V-tD_2ill1~aQY&}Ds z0$RPAVm8`e=#emrEVu!mkpNU41gOG-Rpb-cfh$P#A%B$=Ra8u%QAn%Mh}A66FsPC& zX5aO*W?as#?Bn?XK6uq&bdq=r%CN|Lu~LqSOC&kc5eSF6{6-?qVkCG>Z(`$Ee(Ty5 zO>dCR1iNcqarw;6e}hqJ-No-%(R1gUCm;Ce2YTKqV5xHeSqBm;QCI<+4d3gA#SZGZa*%1|If_Z1A3=@cc=D~NnCoX(Qw z_7<*hYm%OgvHUEqcV|0ChR#2rWQUgyXPtnIQ!eE{DZ3IDJV6id5jo6Tz@}_{W~*EM z)&s?*(Qp)E{;DL)FsM7Tz?7{<+FgCnc#AE3G@ zOQQWwE&i`^SjRGA?RlB#K9BfQpP&iouqYvUoBex4f0Uoz{V=QgeeBOgzi$8hOCmNR z;=k@@w1qRp$xieR`-dGpie!Gxr(Szt-_VFXF;pw1znbf)S3i5v2Rrbx<$sqY zQswT|_J7wl^rp)zx2^0>CvbOv*Rl#1+gwYgf;sz3$N`W|_P^zm18Amobo!EW&$(Vh zg5j*yuaVD?Ddr&bsEybK{?xCJu3d*GaM?Hdn?&gXO&LQAnJ~ZbZsFH`-*8@^A{j-H zFwzbYA)6EBYX9i??8IQToKHo9x_>GQEb-U;iQbjtgFU5mJZLB~&mm+#jwQh-dp!f) zxoAL@IYMWX1&+<9S&>w}d&%;Vv085?Vbx>B>_oHHk&B1@nn&VTgzzkjiO1e_V`z(&gqNez~Uy3QZpdjRt4b3tvzv=UOtn8A>?G7#g06&gTfYdck`5UL>4Z31s zWa!dw!-a}mfy5ax5RMm_uLb_tEs2@VJD08NZH`}jWTI3omL`r|Jl^bGx9rZpR_Cgj zM5|}0v9n`mW2mQ<$Uw@(On)vQ2Gu}1TVr=GpWC=+)5OK&F(V!~V&fN2Y}&JNZuxF} zygFAKT{=46U+?bk@2>Zc!$WPZ3fM(}u~1Fg1rA{2DCr|NGJcRPI)LK#0*tifU%)^P z5`(VfDJ3%<_R(3xg)FJ-S)(4v2H=m>yE^Y!zj5i3b?cTa{WRR{r+;S#`=_S*2j4b4 zI5RUiJd+w9PaTIJylUgJnRSr+WACKQ&^y=vcP4ZA<}0(gY}&ca|Hhs} zv6drZ7=eYdH4w`sMSt-t%3s}^JrK%ds+kPFG8ZXjs@c`q-fUMSk8T@TKL5(>NC#j; z9(OjcZFbTK{w>X0&EPw|e(&OS0m_8_6wYMAe+p$i_FE$P8|lN1ZkUgt>wlBHY-;MV zE%Q1-MBASz?lo!l+A69BKksiGR4%0^$zsXmE6FfB-`r zCNcx!ZvtBZR|E#)iaE92S*u z|LxH)J|;YNi6Gby9#eE(Ifga}npYIP_UBR29@w`JpH$`XF;Co-$EW2$T%MYiAwD%G zo2c;E!;cD&+TUQmsw?QIqJNzgRdJqy057pW`!RgC?SDf{>|e;^UTG@KI zOSXUI&qP%UkaM(1V5hWA+1Rqx}FGw};TT;BUG8l^zsC zm)nn{sQnfDsxdT+zF;3lYufVo4Imre2$X#TrG$Wp>!%UJj5|SDDhe&g%L~FXMS{TR zHGdbL$57UtPeLgju(^)#)FKVk7fGYyL}ypJ80-wmdeAS2(*8tf;!wJjiuZKI%VpD4 zf)QW16;gYZU@#pIN3>Yn@(2hSCNOR2#<=QZiyK=$o$KoAh@stU#!`WSh>nTOYckcw z$X-rFGlR4Hw(j0CH5x5p#1q-W3Ic1gJbyBLNwcH79tj~)jTRbH==w}&xr9sO9hFWJ zFtZG^z{@@XysSd$7jmU2R|RM}tQqaEL&4l}X*l{F%AN_Q#;48k07PQOl{@cKLLQGY zb1D41tb$jSMG;LtOmAC4WoT z9N6Y+-nJcBvvkRYaV`{=xy+l_&FxrJWL>*sZrz*P^b5e_3H)8g0uFNxP>8M28;b7) zs@6=~ zw~W0yN^8t7=!Q%930OICpr1wHQ~DfTT{hstb0AxHZVKg z@4dUL^iLZH2X^m0ykqUEa?eR-V{J(duJN0$I{a|8wz0eG?mhc2yL`{N{X?57l~rrR zY^}DmR&!|<1oz{q0{1I9nJY1 z6lpfwk(Ry1XZql3+c%Cw^Xa&jm=?2?*-WX8JGwA-3#02Og7vmyn9EXLX~4U(_}nO!<0Yfhsz#! z?|A%;GCI7&mq9k01b_OviP_Cu$XrA9il|w1rlPImq@s2pLA4K7J%JqUBGrHvsf69= zE0j>F%N-tC-~r#Rd@EI!LF*Y@-gqfEP- z073zEJkehYjoFtfnr7+xFS`r<1P>It@hxbeSSl32cOofQa z9D=r@DwQh%4vzvHdK~>?I*l zG@(v2I+rY0vTzj*SW$OEJd z7`X}@<9~K$KX8jT&@pTPc}-_jVAQh(6$f-+73%>PVUD0Wz?)t{`9jl5(~hK(i$9&N zQ2c2D_-7lA4G(xr7>$b zQNKSGQgE%%-^im|@{OKC3*-Lzk5k#=7A&Jq;+EZ}e*> z2H3)Xt3?5EvpmlhC0UkscG0kl<9YP)`9D)e1&i>2cU)7bVI`FEUxU05+F!}Ha9_UB z$oFAD;4_8VRX!8>wQJ`8k$&p|pB2=?dI(MC`}*>eIIN**=Y2O4B@z2TTu^-&qE{e6 z27h)6f(2gZ=j1J<#q>Cm6Ga5h02Lh#hZSfQ0}cxa%RB45$nca2prc;wYf!yjHchRG zG;mNNIT|ycGh=^8EKKs`?pkSf1N zR?!P)EN0Ge)lw~%!WZ9v|3x?vtMy!3<$vPlWSrI+^t0@}!)81os|RIOm7)D2wEsT< z-sTSo- zdJw+pX(S6?K}K+s9uQ^Z5ifgMP))&}e;Rof-#jRIkRrHm&`C&9AnVhDsS4k}RP?~} zV}dll=`ulqGLJzSr=;`#Y0P~8uzx6v!sAc^(iKTU-=i;{`2OWk>Fd+&`Og6V;SnzX zKKjPmyy3_AAiYyxrQqCu^Rrf{UfxyhQ5u)UvhHPY!C9kgn!0s_RB=5 z*~jc=4eef72M>@xkv)J}sVtTEATJ_$jtDwTfkpmk-}TOS+IJy+J!+uFx?gU3{^K?D z=OkKTKbrWR{kLEKGTOBi{qVcSyMOHJ|DSN=hpfYIXY<5ix(SzY$Ryztc#KZkC@K;l zl;mqfmF-_2B$}a-gZ8f_AAipY&rM^&XNbRlRWy78o_+qklL;t|mvJ);Qqj z4yNJgDAH7kr<)E^7)8JvRS@U+Po#lOLJks6gV>(WE;_(K0pe(=D6%nwl*Yw+qS2lh z&N%n^CviqK=kGRg@BGhzIoM~~zsN|MUz41m{%Jv$1sVXd>4~2BK9qzz>4W>Usm@=8 zZ&%F|x0&kx{i-=5`+sEFXV9YfDOr_e2X7EZxA%RJcQed#<{Z~fLx1(Qy0@)TpnUFv zD%kb2piHmcR#+}byil$|xnoCOmXL~ifDszSFxPoUNrCamy-QbiS23<+HmsSOh)hLi z*3E5BcVk{sYvm>5vr9)*&+P8aJ3U^6%N^5Wx9%Pq?;q=|0DoVD2-1`tTQ@C-ce?!( zIpz^RB5(pQ@4_ueQ8E_t9^Jfj<)&R*Q6f|0#8h~|B>qM^>=kO6_rCY=o-Na(nKb#P zI2p}}MDy6cT(e=t^ysQsqA|Q?+XV;C>CGXBp~}9`!^C1`3J;cz{m399rFqf zXFLv`J<2jLUVpB>v74D;E@s}se2D4_R74p{5EI)GkoglBctLEb5YVAaVB(njct`E; zC`zfIK*x-aMDqiq$TPgN(eL7jRvKV8n=ef}W@m38q4(>H$_9_!`~=`TUy5rgViMDdqF=UO^!B z++e&CAI#MWuFnp^syxA^HnQBZ#krp^ZGk|g5c}yKhG)U4@-(_2BJ})FG<)w z#?_I+TyTI_Lm;hQ$XpKm?ybzb|A#ptW>v6&h3LUTQE2s$F_!XPNfG7)Xa@)jR?!EX zS`R zBbiE9+++V-)-+l5BmWT^@%sJtdA?96?)QJpXIXH2!}<6V+S-LMmRQ`mw!_=Iy??Sj zl$SBatPrSs5(9_=2j}bZ+~DbK^-OgLJmQo{zHfE8FBww-bU076qi<*q2(4!N-0(}T zeC=M&x_E}%NCtp*_cF7NhlOjQax{B&$4XUq6@JvV?T|CFXpg2^`Mv>n0Z{hMs#2>% zyA&o%uU?Xf*QPFrB@nVw7DD;#^?xfxMOb>(Qg~IJt5(g{Sk76WRSr}N0P7Wu46*T|Rc{ zY84r1b150jN$aTwb-k1eCVxxzMTIE(RJ4GKQF}Ao{v9fR5LRInZHV~n2Mu+d4B5I- z8Oq7)RO4hR5y(k%0G!@ADHlkT9y3+U5A0cPnmv`(k_=y$rSaM3?orindA{T1E5LJg zyLRL=9sFF6mNWbxoKX=#H0c{zy>83Z2lft*j12BQaP|4yH(wvV(tp}9I=*Dvs@d*x zxqEiiwu#}v$`{cc_)A0S^zhK${lDLT{@_S=*PXk@_rzl5?iH&ZS+$~64u!hEfbMAX zHeUjKVuDmRM%$BVYkX^C2vG%H2Dp@bmV=pHFjz0D@AYPZ@TVDN^gM^Ay>ZFwy_?lE zMM6cdS4l|rE9jr?gMUH$V4R(3Y@J+P3tCon^~AQm30CwBk+mb|4^J$a-8rz7Lxdt?QTy&dYkzMQz&Zb#9EPR$k+*tv z-FxEA3SgRd+bM-Q=Dq+)CoVbd4fkr?uME@2Va1PLaBfb*s}MR-#cw}-Cn`JbdIfk% z;^-WE7PPqw?Qqm*uW1GMn)jrrlh2-bl&Y=BN=4I7d=fqBI8}{864`v(8}1i`=$?LR z$?Ny%_Nb<~aeqbo1&wM>fKqqZziPweeE^fdrE~R$)hafUAOgU>RTPRX_uc|h(SUm+ z8z>4^pa-Obw%29b`%d}d$e7nt&zw`*S2k4BjK^u=sEg5+aJ5Ed&aTFzmL2^E(3Y6n<+C* zW{D$PQBZyzjYMbleO^@H8-R(bZPiefYAn8;zkTbDzu&R-wnDL3xXp>)o-f+|tM|K$ za{nv)_kRuz({*=MC0d9?3ei>6dQJcE)Rx<6soS^g`0nWLL`t2ZhUI8*y9w29wVI*ot;#BJ18?+Gg30ACt z_)HPlD+BtMZ(7vZ6L@Wh$L1|Q<9L_>`Qgd)c7I;U81}>IGB%Odi=GcH4Wm8bar;AJ zShVvJU`EY@)_NuMyf|MC`~9`4sk*M$rl+nBj0ZHypRW{j2^~exLtzt_)AqwgMzQl@ zTFcUYs76H3OJ20rqd`>?)EGkB!&B2WU9V3~)%^ZX2ZLI7DI6|!w{09>#~)@onXQgj zSbwoWdB1vd(KH4VQ*1374jrb@Wd>E01$J^l^0FMOleO@e1$uj`1jTD0O`f5>#Lql^ z{$ZbA3;BbJFBYDSr^O{KCn{PXk}6D=I|BwP=34{Lkcjbu;`5ohsi=gt0yBw>x=xh6 zMj#T;=Bw*F1);NVpu3Wcnr|nj@|I^QK7V)?RzJ$!bm8O*78p#A741p`h-v;@kH@R{ zy}IndI2P&c?ypx$fxx3a;|@X@Q_&wtbwxsg-zfCbZ~6?`JGi6P?Cw`RKH1c^5pUG~ zrSA37Z$RM4@yE#L$Zm*r(9zRfccQ>)ZsV;if6A}U)!?`A=Z+uRy{kDeG;rSeSAQJd zvwLuu9cSycbsNv!yJ@ak>#eL^zZ<`B^dxhP9Uk1h=kOKhpEoen-#X{qL+7qrTj{M; z=Qiy0Xdq%v-qx4Z^gx_IkohtA)hjvX=*q*ruv6}aOEi@<)J;h zN5>STMFU7~Hs&^-yJ*<_htKzY(0?&}dJIxBy!W4f#iC)f(YJl)W!?bMz2~l7-CbEU zqaN4-yc_a(jkfONCTMRDvw~8-cDoiGyBt-8W6W)XPuq^|C@vhz*S2)iPU`I(PB+P$ zM86>E>D-|=4K5uR>n>Sdj|$vKC%l{*U$S(tzawXO1W~T13zh2d@bcB&-G7F^yQ8bS zS)HiOZEiJFNs?e$9ze$1IhpmVz_$YLs(Vg+n<4|$1t2JUGkHZ4IIqC7J`tOeHvemd z<3vxg2#>^r9)%)`mZ+JEqw7(qt_!u*(3__0aP(+e(mYlv+*O>pVW@OYPi6fiwSZH1%i$5i-8t^=YqEbkPB%j}3MjOY z@?<-uzI$LzfB%{Rl5)kw>1)q{dBxYroX^AZ!|74C1@rfVjHU^mrGLvx-No7S`>(mc zg~1E1Nn6=3L}^WhhuvGly}ix7*{^i;_pj~mXWIIr55qdx%|skeFa`m=bXTKZ*Zb&p zDe9F2Q7WCeUPg5X&hqI1HTs;pba|n3eA!zzZoO${eAAp&n%y*88i(rVUm!NzEql}7c{2B@%Q|Lp5tSkEg901)k((ZbtGngcnC9@e( z+__5hd%C(dZwo6zrR(z5D+9q2kwZZOco*lE&OE-iy7%#!rGL33eo+cZ4{=hMx_Ob$ zO3$CToU%#e9S~licm&IH&YoSL9ugEG;!Uww(7Vpram6)s0T6PJ7(u~=j`jB)yO%vg@hHzSsn zaWt#P3Qu@h0bSXViR?AfUE!ECJ^Li$h=&-1k$=u8CpS7h8t)OaouQI{$@!4Zp(p3{ zK+-6skwm!r(aoh?tSos&zg(@<&_$FZeD$>6434yQIOMP7CMM)?r(?`YW+&j^GyNuN zr}<5seb=6AWUmEJZSFhW-5oiU3PTYn3e?PUh_9m#b@BMG&)d53<~;n|ym9MOTQ|Km zUwBh(f0+YlYc&IvVy}O-w5>W2y+Y4fzd0$h-NFO2V^GT z52^04Ky8q8&t|bowJ!7>3`JwqNu%CNkgqw`-aj|y80BCp>U0x^Nx4yqF&!S#htzf& zOj1B~o}qr4hkge{23j*s4bTZJI@?BR0jpJYE3IbSx`H59jG;!~Ld)pi2r4=)b$?q! z&2_!NtkT-t)V@Lyu(IHMve1M1tk7Exm<#Qqe{tmUy6yJByWSxx&^KGBtDnf}8;#MA zkUv5E0!b1DZ}fGl<0|$HV+3m&7*ev|h$0*{_7M?zA#vD)m2s^@+lagwQ*Kn6@;G=^m&C|p9{hggL1K7X9^ zh(sPn@CswJQ7!u1vUoEst3_x@^8ccs{*~#&)6<7I>@;wFo1{(f&%Tcv|6odV=$`%fdi9W$8ej zRyM2^7RoB=DHw_=CqPd$w;$ZzbOMKObaexqWAO|!Q6|L{fwQSHQ@}Z|1L*`{q1MH;LVMfxU@7*5#t<+Pf89=dN*Gjq;0Y=0F^A3y%qw|-_W zFApMR9pWQ{e89dVFAWCfmWBqyG5kt+AQW%J<9uMx^VeMS`>U@;1%GMKd+CYaU*;d= z4@-j_>X8Te`4_j~zu9tSpS`i~zrL75J-G$_`zOgilg%&=bQf_SGr%loR-MHsFRiEb ze33Fv&c5)P;{bWKOlM0(pR;ds^j}v)ShoKe74ht|f?s%65S$x7|J>^`Bk>c|u)EP+ zX3(#DJrepb*1WR4FC6x3_8Q3}i|APq+rZ@sri}g-{i|#Wf`4R(vFN6XrgU1WeAcY! z=)XJ+GB+U{`w$TV9zS|m<{l@ysj~LX_$RDs2<(r3#0rMV{siAi6Z``A%rmTLnB*sS zzBU7cfxrF5<1_$M^a;s z{Q4boFWCTdvEg)0GPQ;ZZIuY60|0`K>{_D}1+eIvp?h#^Q6>j&g35A~>uJ-9glSN)|;DWmv?n{cP*cN zh(`Q+>JcjyB!HGZc6{RC`1rw_Xh2e!2p(Wk9!cr`#oRQqxmoY+dgL8?Fs#4olX)_) zj~~48;_>l|Z#+2OmKWbmzJou{6hJOt4%pNxQh)7au_X}4s+ul1f&+D%7(#7l>>dmg zsbYXFXM+(S4r)73(~WXLDwiVwKC+YNgI*4i!NEOT*suEMf33v?mS8n195>#_X`QB+)XmdD~NN{AN*Zxdz${&D5J%XNU>-e4|moj;fMXAOm zO?j>&ux2>x`h`%aYo#64tYOjpzu8u{?!qEH-5||V&6VEg>HzC>+YuJ1j~3Z!|5%WS zR}nStea3MissjHRRdGc3nPIYTa1hq3#(%&1YOoW;2yVZ!qBj5QWW%Q=qlzXQ@4i~2hdtYQA{tupVnCAKXj4osi;Bd(0k0v~#H~77vDth9Ng>$(u{?|w@$1CD| zP6Vv>4;>=MeUHad=MO~1zGYwA0GpG$-4|J{mj9}2=k6@RUPeAo^_ z4H5L)aDM(@U_pxLx1zFEXzA7<_M$(oh=dyZPuwnC8+nAdk9LVkUwkcOHyAPmu}>hRB--} z9#sVvU+1n1&Hu(5VV`0Brhi1xmC;JG5_N(P#5)s-&N%+aX-V)5so#ng(D6Xt@&$aF zJ?Hl;_#!~XhJ50?QR?i~q(L+gk9Wo6f!C$9_c|Q~dVHg^hisPFNBvZbueJS9Klb(( zoY(C#H+iA$l%8MM7nxq%AlY0zmZh-hF7NsmHCg6$D{sq3r$y{F#edQFt-0Z%3r5Dq zMlQJM1dU{~9Nk`7D9*2o_C7B*h8h+abT6FQz2&l37g(8x zgv9^H<~RCf;dON$_lYLUTB4&YXZ{I{M3iQ0B_alTkF+gcL**8VF$}l3VVDcP6gCpG0 zzai^7;`XOC`(gps?!Sk6ta&R1)czRSoopuOAJJ~ue?x6&dI?F^PZmAFat^wefF)zG{GVJ*(E z=j>h;G9(szW6lS@gUgD> zv%I~G7m2C)eesxXdUReA&=an=bubD*T(HEhKno`C;urs{G8hSL+H<`)8N)}{JHnnCM zmNthKXp{3PhmX63+z5D)?iRlQ2*r{Cxg65@wg1%`EnLfiDZwwY!HT$;i_{ol~ea%(H!N$00__Ca27-Nn8!jhiK z>UCdRyQb2!q|o0O1Llp_`CqDod#>06Z2w@hN8%+z%6FC9CyIE8==ZbdS(X+Et(;xA z^!6PWpR=9rsM~(d#XH`%WZmq_P(aUc9)HtXv3&LPku|&5uce2BtzEx+%?;CQmd}Pv zO+W&ACEqc;cW7wu)q95{oZ;s=v$AH#no4C&B^j3tL6Tgaw2vm&IK~6eIQ(k;6HVWAhSfi2kr--$gJlp$nw2U$noA|4f}KK7tzX z2(K_J%3jg_fCL#)vu*ctWq*tx6XeJk4c9kwkzGI22{TKNLUR=C)FI&scOVZ;MT%%HLfdmkw0~+S<~IqMRW9^X25yj9HHQ{cm;B8 zN)P~x`$uFc66g#lEQ?$PILixRRSU5k8>k2313jIItdC<^%yOJeSkBKwM!xPfby#yb zL+f})Ppi5*Q(fDV1b;yGz013kODnxygM|*i&!3K@sON1LMu_E;orc##1dk^XEp*m= zs+J$w4|eu zsf9V9R7j9~!$;qBv8j1_eS$wX)Hk&Or9N80dL$T3sveF*KwP4=_)vegbg*9q9A2B) zaPQoAmWO0XRHA_M1TN$OFb^gMhqteI*Q(*N83-DBM|W;CRaz3(m9W*H@0u9t?Muo$ zn>KP++XcAn;mpg|r%+!qRL_r*X0hpPk))nkZFPj<&@*T4X451spf|<4x(2(t;vlMOih>?F z?a|}0-|q2ZpNzgD^V|T?be}wL_7PPaqlCBocf>0Zf?M=q{-1wt#9!;(NXrg(ZKq{5 zW&0UVs2{jAZ<+A&JaCb$>^mmP2-uSO``tUb?KyY7Jxh+0F1pu>a}GkO;4$Pl#EoHk zz5#G|n5SoY4v%p-a4?_||vNjz{sBEhWx zg}c1@TnKkPqnm#L?U@b|%H_QGykKNP3;rPAf$z2)pU)J-7|x-xf`q8(+=HsGeMV#G z6KY3XweLlHeen*pgP>2svk#unS7Y#O-++!nQmhlQ*!R$^9q6XlB`kdVS@IYuIp+Xo zsK+3+8n>kO;g40ozh@+5QI$Mu?^TO26>YQcSEC)?BD#OdzNMYC6_R2_wTRHw=m?}i z9BoD0>ARwR`|A=Ibn+w!MZs$lp$5-CL`c$pi$Vw<1s5gMVS1=jN zWUiQAeoZPL>z?frhx3KLEsf(x07&qWC;GP5+16I{v!%m>Gb_iG(rlL=vU=-dkbWFt z+dj^UW4nKw1G`7tdSMuZKa(a<0eWheYmlLz97Ap2E-OfV*{K3}6t@bF$()|1*G71% z3m=r8V&}*hz^5RREgVg#BG+4;o=4*x*Vl431PeUA=gmsO^JdM+dHciJP`{cr?TPX8 znt0%xK{ah{zVfHfi6ug-Av#GmkGcW*);OP*7oIuym6 z&qo5gTlFnr*2hZ3++lDFhgRY98NM6HZTSgf_OE8)+1Fy4Vb=>1tDxfqGk0@Q!VsX6Bs z9w);LJu^WDx=YU+PCM=HX9ht2n_^Zns~lU~V#7`~k+k=$HqLZz#CBXyXB z2=sBOOVpm8>Fn>M*O(qp$Mt+Ye}6MsPNm98w4uiv3T!Qfi|dhm-hSGGN>ZtJC_!(#nq8`4KpiM3tE#E0|0&C| zDa%azj0w6gIN zA%+9~aM(|S`Nh~903&&U7O+p8S;_pyupf=nqV{nbo{BH5C%3O*rU&40`hVJush`cX zlr{3e%~3pLRfDa3tFM32EM(t!Kjm94bxk~%B7PzEmY>=W0++?HJdd`pgs^XDB}$)J z(EbaJq2GLq=Q(0u$wCF+0^C42M~4b9@)Gd^>N?*%&hNjWWt)x%S!2AjyBU4{NTct%Xh5ryZ@X z_br^bUR^k8E{hsgF+jd_;z8W&^Y}GO0ukmWkHm4l2#X0D(nM9d5fLe<>$1;gQ@%iq zo~DV^h{j8p`?Paz#QCf+|0hB5SOr;feEbbFWp$w6`3zq;lu-y8Qx#Q6nd3A)saojXpqj{HPAw^( zYQ)bId;H!t{%aQ3?~~YunGvZhov-Ry_cTE>Km|i;L3e-uAHc$qKy)_f){Ww6Dl)Wp zKl;%A{qvuo2a-t9A{r8J(a~hPQ!Jb%vTG} zc^Ql9r-gr4T%j%QpnnhyRVerNmIc)i8nI|JhUA`Y^puLZ?yj!xIePlUww}uTEB;zO zSI^#WM`NyjT>(VqVsdLY8P1sUVtePkQ&C9D$YeUjr@BFpwq4j)F}?ai~iLPim04J^^}(SU&+=YjXd3^46@DcP_8)15ClLPO{NcB+Vs#dAvcKcwaP#0F zdpLhv`H%m&rZ^%4qlJZ1vm{`}DWBkMo}!m+JYct`=`Uwrv|)!8bd{)180l_=b^=LMa@#j~fxgJ{}8oW{XSaAdUot zC9OVno&6;wTs2km%ZOPx8}5gg2X4;*+D5I}*+y2c!|cEUu^?>J8(FSMldO76poz}= zC(o}`;F_DQ%sz>B^~_c({XM8M``OB8(XoB@AFsX|Df!?0Cja>3_8*^p_QyX)%5Q&u zWB)O~I6f?czXpGq|H#eJ9acqX~$?8c!4@tk23!wCB(uVSCo*m z7Jot>ChK5S=-FzFk*-nRo);*y?;wBTv=OMEItAB_JIDEc8|}I9z`EAdz`D)-=PfHg zVE^!uD=!FF8s&2I$o@~98|kPQXRjq|_5PiMqZdT1L#sv(&4?Vrzxn~;8yot7wA}Z9 zIHA9%qd)A}=G_1JLC<@o=itvWJDBU34?>I7wv+6r<8E6JTFwcu!S?RUjNpH$I$Ze5 za;M@YYW_SUW486$s4=7%i@Ye~EATO}| zbsqhMtk8ds0_)U%!mF`C?{yTG@sL;Jf(pd_>doI;%)%ahZE@DVp|B*D4~O$x=>I*~ z64LeRW|HipL%ufyHiOh8w$1) zP>+QRE2atcu#@t}WD50KaEvdUs+uO$15#`#Bob#{a3NH?GgdxDULhpZ&CsXLrV_DW z9(TNsJy}~+S_wp#ZKHn{$85(I+|ImT&y_?Ki6mFZ1aVFVwn9&w~ zrS-}UKx17S$}!8_PPg*Jc9$Aw+U-p?$uYnUJ4n#(Po-wNmoYRUB#dk;R&%-PyEolH z?Kvl>;t$$UOJBNqNw!cbKA5SN?^sgHjt_89?W|b zwe9Vp1N7P24k-d+9p}b~*>+jc0nUNJVGNPk4p=5oEqKeP>^%c(oM4%?V$X<3$57@} z7~|0HN8Yz$#rq$5@{#wK3Wd`9AK5+Q>SAJDI+aSVn>c^5>5Bp%v6J1!wSAeiYehs! zR0QY%hL^|`2Fhp6?MvwbA{1Ob6X+o%&_dv|YK21l=!*9}@@;mD?c4ro+xGXbAdhxj zV@#}j$K{tFSU<6-^^ho85hqL`gdk;0f%3RD%L{oigs z$^)p-f;oTq9_EFXz6uGD?sCC}!mR7)R4~V9P9^eYg~?B+C+Rm#PQw048fu+n=b>5G zr+?2zA$Fk^VwW@){bc(Zy@Kc*N~g|Ha6B3uS|?9CZJ&kS=(%Rszw{Qv=#8FBYq2ms zRq?-ky;Z}fq9;$Q`0E~~k9MAl>Q2A%KfSNn^(=q9!FBJ=yszom^(0TeQH(b0jcK#4 zzrh>xL$CLY9lhJ5!S~RefOP%*;I5>WhECH7c77AkxLF-hwgL5@o~}hmp$;Ydabl;J9@~Xn5}^y zhIfCFMGXJa$)TE)sn>uYCht1tfAy$8ehf_=B?~8~rza-~H_2!Ks*8C!!-6OPwLKK7 zgf@rX7GS;7sXQRIM~h;|D12TU3p3Zuzyq{5ipg2X)n{-IUlV#m#X$x$Nikp>U#7}7 zbk}tUClex{fJsHZ5}p?qQ#D0L>l;T=J69b&_2%nM`{zsKI9bSO^Q<72pk`Fpaz+a1 zL_IzLw+Y;!GFSxUyUD<83UHd7-mH z8(=nnCzaY1W&={c4m4167T_xV&X_z3P9w^BH!| z@iYELJDIf6y|DMs01}y?dkOqDwCEKZ)7aK~F^@O$81t=rd5ms25ltqeCm`ZcB%Ba{ zUW1+9C5WQX#f##v=#KB=CFzwuLb#Zv&n8;G@PB_5`By^B;)d;CKinB>pMbGeXXxy?dX3tWyTRCMzZyiy z6H9`~c22Hdq#!Qs9R*@;mYQCB2b`))5nR}g$qmt`e)Ait+EZ#YNS#)vFE^mBvMXoo$cH8i_wfWxsiu$-WKEN+s$`3$b^ql;usB?ct$Gu%W7cW|J zHrhL!E;Y_+l+x$~E$UfXW>@mUsd>HmRn^%AR98X9bz6tGuFJn()V!$+lU<#D{EygY z7_J#=fhL+c7^ZV(4kjVGk_htwjM{`^*D!z@@{fhz_#gUJ9zC$-2b)izjQ-@3hx(fKsYH^a2m%Q%8mR7SZ7 zItBmTOj5&|GZ`pW* zfp$`$S6Cr8lmHGX%d~?+s8A|U1G9Q9g>wwyIR_hcG*f_W0nD2`9AWNsPz8PZ27f+& z-mg6jzu_-^=}YKI*tHI_0NQxZkxJ`Rc(Z@#*s+0Q$I!-O@cV4AeIE|2Z~mEl4gUe= z)%_jsNM+P$R_A}U9d`uuJM{|d4R^F$X7K%rZU1g<0ar&2#_MRO2thJhMq7$Ym0)U& zDIj0d=J)hxE34-$>}nPU)(+%)vk^%y#1{#NR$O%bl9} zNUgo_2a|tGIS>!IZz$q_?Q|&Z0`hJb^xC763!C&t3mD&h?WE{G;b*BXG5T>txnF_* zNL#jlAAXi0E>kqvDVQmCzApV`=1h^HLsM@o%=@HCjV+oC1FObjs6@@oiM3#Sw`bDW zGmdv>C(S_8=1dwi`Ao7+)5fX1XtK`Rl7W3+)hFpmmn z0FQrse&|Am&qDP>n)G#-Dk4*r^I&{K)V!8DL1b}2L<9l>f!a(_rkcqMSa+eIE?%W1 zvh_FW1E}e>MT8!r@?=_A)9ZMf4zhKlCQ3x-Ml%;=94C{Zg6t36+H)&fczx#jg=YV7 zzxjd82cmQPoLe)ux`yG7c=M;`m1D73e`bFmn>G8({bqlrVkV2FM$)Kc&aLRll3qEt zb!Zsjt(mR{s+;1w34RI#b)mh-Fts;n>PLj;JfBCI=#X8$u~_6qek0%5*1hS0hstH z0WxY`9r#IPzHx)VRhOQ(wLWJ~ed~EYJbz20*=%e%-@lbJW1J&)@t)3?(UBuZ=&SmG z2>-TD=F_#D-*wO(en%H|rtgPr=l$rsAb$`*(^`ZJPaK{f#!+?8q3f?_y-R;|qz{O? z-L|cu>w++LP`+(0TY+B}x-#@WnDH64*9^XRr_SiWT-z#+(vl5oLRT;3%o>{IAEim( zqn$IG)tc$KGg@`cj?W6d4ckn=5GKnFboV1@wt;p>gFirrsdf-+$**G8B+ABGZ})Nw zfDBC93$ihMQ$jZ<&BXKvCntaLGX~!}N@oHA!(spA0y;Ca{xwrBPnF9(rsrim58W`B z?}|nGRm1e6n#0BPSYl*;CeDW?JS>HcSnI#DvB8vOsZo?LlHH^y9*M`?^uR6XX}eqW zvZXjmSpJ}u;A2@?bxTnmJ?n>f)8uhKuM?AR{Tlrm`@Qf`#?a*O@Z^8c0k6k(d%Sr{ zEZS`@R3j3v;fNrQB)V&oqDaV)!~TnfXi?&{2nB|Z>7|0xWwiAOseZ>{HcyQLk2di? z+B&|vH+uC_vo7*AJLfr`=rrpX?>Pl1`<+w4-A69jJ3cu%zW0(=C*TkM?&Qhep-6sT zei8!Ya9{DgTj=!E$@72R^S8XW*f(9CV7c}!n4Da&k7b`gkL(#*bbzExU*BqgvXj>bijAo)M?6GKqQJO%U z;p<9-X-@=bPoqtnrWFYrUW4fKQk9gxO529?RHb`-d|d9I*ROxPIC$oub5%6@PK2TZ zXAWL`@g*|HW#=xQn=z*`$}G9^rYo0ZAMfeuc^st|>^Zn+es?xin;ZXY_hSgf=hjkp zTycf%WQK<`j{U9SbGDYA$>qL>acRpr!~c#Rd)!oXqp+|qKfWyO-$lrRCCjc^2LDSJ zpq0(0;XjBQhxUI>Ozb<E-jO4kVkpeO5LVwrSYY#2-FFk|PdGuET;=k@cGCqFn!yiV!^qw&Klf=+? zB6j20Br@qc`?jMabl`g>!ys9g$r$s*~IJZ#qTWF9>+ z@E@zumX$o>{I9@`L+x+&aq@r3I8aMjren4`bQ!Z>Y{S$wPT>lRuG6UVGYbKoz|7JB znPtt>M(sFd>0>kd3d9(h86bL84HOtff&6@|dESo8w|sK`*u2e`?pV8eq~fTHT2FgD zJ;Q&Q%#VWudZ(Ak(9_FzoYx$y4Xr$L%>t=gp1*ea%HbO1zu30tvA#vqbV1?w27kp&ToWqxmXyVJZofVVDQ`vc6C#Q@6-N~N1=c>ty?xV)Tgaf z)sE@(T)BAwn_e< zP)TSmYYP6e#Pw^XM#-$W{n^-usP$5+w>O0!>+0o|hs1Mq`N^c+x|j;3 z(2sw3zaHrH;ivEq=%^-RR6zIn>+rw&ANB8Sk8@Y!HXcR6&H%^yj#dF(vI&3v+`qNG z{`w$^hyI#D6(yPfpEBb)iUEoP<1?{P#tgfP%Hi00WB|Lx;J4Tkxo`@jihgAbT&shd z)!hc(YEZmD8l1<7D+bWj@Hz-wb%y6PIuQ(`bulW;g5QcT7741;x%mL&WtdV}k)~@` zxXc0zP*6-GD3Ahwxg8WPru}~xIACwED!BpbS1>X-g*P-PB404|^}K?@yfPwUMeXCn zq`XX!ge**0I(D_Q!VcCEPjI)SsuNn5TvL$JCvu!fh^nv9&5~EavO)+)9ePN^5@%<5 zHKk8!5myqRWa1j*C4s0|5R#I}Nt0TaS_$iYn8RUSTN^P70y!5*N0om=LRAn)I9ZSi zwwG`XNhDzuo)SdNNjM^PrCeiBQE^$4`W#i0Q!B#Sav&O2Yl!2^oWf1U;z^ip!${%;726P%e<(B*M|Lfor2G5Ft6O3&l(y!3*BaTa2L`Y))vbtC0yb~ zv4#oJIZ-}WGi`M(bx?mDCPW&L3A935pR0sb1Dc9x#51OH@N8IwpG0IunNm~HET>|b znly5Xvp_V=v^9z8GjSO6!!l7v!baE~BfQSXRU9FXfjANA*ie#6TwJO^Q*c6DHxyaa zRBMUKi`oL+<5bAiBOqvo@Z3~9!SX(l{#NVL+2{^#1W_4Jwn~T9dWxI7P$N1zFiB(#~19{_s4y^=Z}xi z-@WhP{*Dse_qTs-9&I*9H*dQbeRNhf*NxDE&?hG5@7nkB-XPoFm-p?OKQaATntUc7 z3xq-)zgF)i8Rm<4h;eD5rU_#gmA?dwne|LZEDwxY(WXOkmZ4Ik(l92>_JUG8%$l=A z4dWk)W$;M6^^lj%dU!$WYuS;(o}c~9>8|3D)_2iklNWyv`K6kV6nVL9Jde)wyXA8Bq-?)0m`X zW`_LZ*WG_vYNE+u{I;Q~mi69i(c4nJEg_9>YrQYki~p+^f2e2AoKowP!&6hk=!M}U zdwNsv{13OM)z_Coi~L7ZeY7dhhB`b1@?{@?g%{2YFP ztRM%;d&$G(QSvzX5&1Wh@o6J91Y#21QWGes290b28Cz=9bC3+ejMSwD^kSBx$U_Qd z0$K7{NMwq?Ou*G>Qp>G09kX*nnv+RtCr(^3S8p_P6s460+-3u~P?ws_X6u3jPczzt zBZMfzE0B*(F;{otlIWGPqLZe$iY188!7L3A3(q5FohCISgPE)3G@7*usHo^U@L>zN zlfG&v2Umo0XnW>Jlk93(e?k3#T!w~+@@ZsFWG@=hIPBhRN3u-*)F@SoIX>zzL&B^` zJ=cy>I)V;)LZIi}6sx1zXpO!aIvPTUqpJxc6=)T4#v-!b5#H3CnQP64D?k?knCn=^JImT-*FMf9g_KJ20LHOaxVq zrVg!zzytCOJr`KkmI|yIbr>asRSqbX@)ERRJFbr?j|?Mx&dW4KCWK6(ks<{*%ZN@< z1nQOf6JyQ;fqoTfHw|ou19WE!5=!q~H-Q^!*0Tes8H`wrbSmW_qF}moZQ6|HDrk^L z3Eptr5-wY0#FUZAe+lY%io@!F#oOB20Ulvggbg86MK)5o9F|oSA-InqjwXj#4&iQNZ!94Jxe;kTn)sBwfL5bqXA$g9@ zp^XvUR&N2e-$F_j_am-X>{dub?&mp4kCf1057rga7)Cfx9ZwG;Ot%_ww3sCJIMi1( zo<~SNL#vfVe4Z46qD6AHo8*yU33P=giwptBNH&jfmY|pdS%8L4A<=|aqF{yp_f@F~ zv6folkrADXe=Z!7#Ry&3gY<%c3`}#ODnA6ROZvhQ9yft@K`DWglM)e=d|XsT!kH45 zD9kG-b;-!m925z2x~f<_AL9x-5d~MC5!&*cJS``tl+lmyFF+xzCU`@6h{u{`SCvC*+y{#|~i!wrCXAbTb5Q_ChV}h!n zBs>ade<$KL`g#r_F|TNavm}?x4@j=ck%ERJTnyfP z{G(z_<9`I*RK(CbIrtFx2<8-zTgnl`;L@_f5e)NR4{u9WGRf;Oy0Mb*PAIpQD_AK(l%JC0JET99;{l{JK2&fNvQ58fBgW9Tfr zBm)xzBs(`q1eHKt}=t{^{b14c#(#vv;hbm zCmMiql`y^o>7xsNArfG zszoI|V-NpT{P&?4v&Ajt+Nv0B5(ntFCdm-5WM^zKaQ#%9arspX+&q!5KDQHwe#`4A z)q6GI;JJ&Q+q2omX?ycEj-QPl$lqlj*B@RMwknI!qN=4W{c_~Ee|=XTCvR6|J#M-P z4QQs!E4SY@<==uXn>ylOhHhEgyexg0du=RQN2nf+UF*VWv#sazZoIi;JBr{vRH(L^ zkOk^-6lxb0E6m~1XtM%wh@7RQ6jk-_RJs*Ksi-QP`gcIETR|7$m8Z^As+xiW+SyLu zwt2l4pAEcUNNyw1e=uV}#7xAXcbzMFrtE)=(|JSiKP;ObOvnD;(j&T%cJvR^_ztiC z55O%=u>RH0FnZp6|H{lZ8OCVF6V4wx(EL~L+q`kKULW1K`ROeiYxR0<G-y7u-i%|C~p7nJKjqelK=FVA^nzrf%J_=jRi*Q==!b4f46Qu{xIFKI)9TqM4F)^ zp&LUtg>I+)Ban0l*!TgWeb7-l623qiClK)IOnlb?s7ZD3@dH<&ZXntVeC4)fdyEQg z26{g%TttQ8nA)QnRt%;aPao7hI7U@7 z)~$@G5UXIRe_saTBN7cSp@!CFDN@~U!q)p>MR-rH4~Q|V$m^yvS$TfR2) z=@0wMc6DI)xvq9~x++0G{0{jxS;N+6#~HftTk;nu#7@DAm-}cqkIK==*-1a zJG)Y;uANhhKe%Y&&Mx@vT)610wab_G4Gi=xUH<9ie@pt|w`4hbTQ2s|!pEezDSf2) zkyxd5O;0x4Q_Of?=Bh51eO5^{*oE(=`DO}Wf$1;AAh&GArH>Up8atzcuIxE?^Xi^r z&&G|JK=1Ym@(r??SyHz9oZGScZTqqbgw1WQvQ& zpqgbYT38cd1_T-c0(^hEnw?*^QnJip>=(!4bx)RKBMFUHMI~;V^e!qV)D$(Gh;w3C zj>Kwb#N%hwVi7qka`8l1RcZn+i@YF9=KwV-fA?59jkkdKny6Q%6o;3(EnYC>whrkR z`5IXgx*+sKD8!e;^$E_K5P;L4z-2Wed$|ZobImj-rh!<`OaM*8&0KRLrjsUcv8>I` zrsN`ouMknzHOuL88nM-`B2mUcx+hN0`SfPk!HaO?`C ze*szsNoqz`W1i}S6$7Yknpx6ORs%j@`hOX^3OQuR0S&1N)Yq=1_hgce7x!Xb)HA{| zkS|2hZBo+1BG3|&649ex+M6HW98(k#xJ*$Hf=Y=T0fHQEs%nvFEES} zR()OAGzNj-Wa(ITm`5HMR)Ez2?MnYqB=Iq9vt7B2e zZJhT;u#idD?>b-=Gq4t&0Gi%*_chB9nz-z?4PI@0#mN5MN~7e6=I9hgORl;b74nT@ zv61&*DK?An?-%HyKo+BaC0CxR8dW#zH;g;Lz1T7QsZfYwsUA0iY{><41$7 zbsPQ#S$JAB3;ZGL-;li{n{CUmUwMX{BrN|%`O=yG6wUsV(+Wg&;9BOLdFFgkhs18hO6@kW>)|=?)CoW9`~NL_;BkJc-((6NDRB$Eg2WL z^Z3`gFk8KZWY>Q==icXj2yz5t+DV30LVXoePoG%^Mijt*x-xZ}(-%v!9oV5-bsRJ2 z){Y4$m9}{=5c6dI#N7|xeRy#pCng+0O!w4l8#X_+c>^W2Hf-K=@m4ji3F_!yjcV^QHAG|fq4^u3SwZT&}iD$1clNfKjF2o z>`(cNY)!|&1(!^pg#EKq47*L_(D#la;y-WN|K&cJTEHS#E#3OUfWtX*Fhl{9C* z?gAXO@2@j|1turwApfe)_xHP*@A<%mJLb%rH)qF%zvu)GSovq4h5wFLWoHD~Id1{k zJC~-sX#3dQxntWeqFLs)F8Mx9|NR*p9(+I5K0?r#A~n%DIn?^8|KCFto){k;@5+iAX)X<78{sa{Pnf!x{cqX{y&TP>(?B( zaLwxSNTo9J>D`L($cDcu_RbyKanUa>+A%g4A#-@-9owxgqtLgbuV|pVc5Pf&9UX=2 zyEd*kYk#!XC)R6g)?Ki7%cgheQ!5jHwR-I!w#zR#zd3hq^ZX0`+~c_Y>2S=nEHe=b z^orqO2Js)+ldyX*f7*W<4Zi&HpZ;{CF}#0sZ#23ZD1vw{tE!9C$g(N8eY{+ZX|h@Q z$o==@t*sy3d^7re>l=p;MMXDFtlvTynK`2P@% z&WO}sO$ni{F?6$k`50P-zcFBri8S-1m7yZqUk1frp`->bR}u(G4Xus5)h%)@0s;sBg0d zEshGv1rh&8%z5l&tTE{Dg-_UFvp4x~+rz_+;qdl&f5ct9KY4iKe4$ngs7`vj`OdHY&aNj!hTu2wT#=80G;6?*~#)vA5s`9vjRex7?9kHWU{pAonlHNMSZ?O9n> zv@h-e}x-G)WMqjI(dXFU^L6rTcTIQ z0Cn7KN29AIa@j+x*F3a#)uC(-f~#mQ2$CgK#Ply6 zSrZGi4nI$`tPK4>i$@4$0001ZoMT{QU|;~^lY7^_j_0@e%D~OS00Q@o7KFp-|9}72 z5V0CFHv_pG3``(V0Cn9BA(QET9DiU30JVe%_jsIRVPIfjAr&){sNRMQJBY=~l$!DX zKMwJKxaFvXIkA~ftQfAi`2QDGjLLpMw@)1uPSi7>btQGf7yvk|76FM#48jdO4h9Y$4mJ*=4_Xhp5BdiBse6j zB}gUaCXy%AC~_$rDSj!iDt`hi5Gz0{x-0f9G%R#1v@KXI>@FHEbS}y-P%m~brZ5~Z zh%r_%sxksHjxyvk9y4$=v^1DC6g7S}9yW?L_BUiVo;S8QOgNG_?m0X;VmcZ+pgPt& zAUkM05IlB03_Zv`AU>2oWIxP6SU}W3>OrPLPC}+a{6jiJNJCge`e8+8Ma)JHOTbJ# zOq5K@Oz=%gPBc!cPdrdCP>fK>QAkmyQVddNQod6ZQ!G=EQ}k3!RA5weRU%c0RlZgX zR$>4Ec${NkWME*}!F-RwhXDkbfS3yi85sV9`3wL!f&%=r|A1Bjf1Ber5Z$*igm(AJ z%nWXCdsk*=X0Bq7V|8uIC&|g>%FN8n%zXXtIv02a#7(#vx8PRXhTCxm?!;ZV8}~q9gcu13 zDaObkaWB@8qd*CT3R|FIU{Pa&DYjyUZMYBj;{iN~hwv~Sf5D@843FapJc+09G@ik; zcn;6w1-yut@G@S(t9T8s;|;utx9~RJ!Mk`5@8bh}h>!3wKEbE>44>l*e2K5{HNL^O z_zvIW2mFYi@H2kFulNnW;}86azpx#DFLY=|OZ<;yIgv(=a_Wslyk;s9(;%a~iejl_ zUbV6^Q7ZG?f3sw)&r3r0GahWS>gRHtS-+@_j6Ew0T9g!~Qd6q7E(+Tlsp&{%f?SPNZM~^XWk(z1Qz2x& zq$#OmnrGRyT9hUw9U9UT8B5ZN(v{WW0lZ=GnHjDB{@>v*50yZ zxV{)?!gg!UuM`D!D`Cu3>7>U<@l{#0sUzxbLz8iCYms)K4osy`T^7!D`w;2@_@Ii(nj8(~*Q#hrOk(QQIra3aTW+)6L9YeNj zsi<j}*~7lI**MZ-&?@?7XJk)lv#e-dc2wJry3#8!JwQA_Tgh_U91MDDqp zdd3Rfo?xsdUP)VRP*=GU$)Np2i56qe!5;82iblOy6%~_K+Fr^cYn(%OQkLW1{2Q(M ztREgL!JZx?G4m%Z9Tl>069&tlD2J-4h#AqnRF&353FZCP%51T2I$aD~(^##_aZr~z ze^VS*GUh7DbCcl?fTGb*a7&d@%o&m%w39{;{nmDJ2-}GD{3|^xMkZ)`!Pi`a@=YeR z>o#cvPK;PCRI(6h$U1ZsH7fU;iO=3lF7rxDbJW^UgGL6_>Y%ogff6(BMKf?{ulF7k zp%|uo;A)*O`crn&Uc#f#K3vEg4)=U?f0=0Rikg=HZ6T(iBrjFE@ElEjtEDK%42Rxf zCMbF7I-F97Q zCk4Jk=r{{gEvZb5Kjzx1zNRXlHT%7S%DS;u{zIC}emG~enRK{5rq)>QNiNyYG|G;o zn*)n#&2!JJ=bnX*Rh8dx>^XKlr|OmUqSg_Ob7iRCjBO@rZN9az@DGchSM>k@0PT2M AX8-^I diff --git a/src/main/resources/static/component/layui/font/iconfont.woff2 b/src/main/resources/static/component/layui/font/iconfont.woff2 index 8265e3ae258b8f5493ec1daf0965350fd8bf7501..5badd6e38ec077cd5b50da3d41f029f7534be086 100644 GIT binary patch literal 29736 zcmV(>K-j-`Pew8T0RR910CXq-3jhEB0MhIL0CUv<0RR9100000000000000000000 z0000SR0d!GnOF*f>R^JU9|1N3Bm;&B3xfs#1Rw>3e+Q2^8{@4t0} z!N!3geqb0y2?vE_|NluxWsL2M?MFb>tRj-rtg0urDkL_IPgCIG!X07VDV|t?ab9}LVVqHGfB*=UKfP0HX7}qxcl>6?wgLr# zq2+LC863N`yO(sC{UiNKzaz;ISgSrm{UibL&<_Zi61N4HmFuRVr3J#F9Os$X7t_Vsce-2s`G4o?b7A$S$exoX42&qcYU6&T!0ccx zta^Xi-}LuN+9D%OQ-RTN%{N;`;+3w`nmE`0K2p$0=U<2EYy(2L=FZ7Xz5CQXVs=D5Rq)oa~N~4^{_=WFL zsZ`3|%b02U|KEYSe+Q8G2U5ZTDg;T%I6&gV9aM0D6th`obF2LhAZ;8ZId>rC0F(>h zO1hG1wQO0Yyo?^bj9JE3_a*C+G5Zp#>O^{L0E=CXEI7yN_d5IA_!6PsMAN+EUmoSy zl;#$?${fAP2#ruNlG-&+pt7vA#O!N(*aDOcaeM!aHQxudYk zwtCEq)<3aH88`%Sz$)PX)}R4Saw$QSyQv(HaFKmGjN^SjUAJ^yRWs7MRP zWaH3g%w`8Xd}&|x=?>?8lj8v(egsu|+e;p&k5_WVzU9USD4|SukAA-7oBqDS{r`vu zKp!|_feJ+mfu7W|7*2 ziKB*^GZp^}+GwDmM(U`mhH9!Pud^!+ zw7N(qQ3|QVh&4c*c$x%JY6}-BvrrDf0tInu%q4(D6IM-?){I>}_2p%gQa}9(Wi*#v z3)Qs}p{+c+3R6|I^fKtKI7t_RfCXUfXh6intNH-(L)!SdEsTHA0sIFD;15FZ7h&)V z;qV&~@Dq{n4N>p|(eNEH@D;J}1#$2h@$eK0@BxYN5lQd~$?zU2P!Fl_4r%ZP>F^dA z@Cupm8d*>d+3*rMPzH_Q1scP1G=XPm3Qy1s9-}!tLJN3^TzG&yxQl#ffR=C%1yBX8 z;64hW5?Vt6w1HD-3#ZWzj-Wm4f(~#79pNlG!8vq>^XLK>&=oGC2ri)*E~6V2LoU|41}X7fs-hO<0yj@D2HRHfWxSSZ7>K9 zVKD5+5IBILa1fWl9vB8YU^wiB5wIIZ!cG_k+hH{9gE6oX#=<73I#h}S*Z|eA8pa>G zN&r{_6JaS#f_YE_%V07rhbgcCE{BCM6{f;8mfkDa3dtaE=YmhPyu@&0ro-!+yrrOGsM6x5DT|L zB-{owU>`)meu#$KAp{Pvnv4*@Tr47@;&<`4r$c8Ce11;m0;9dd`!3JQTkrFa-^p+p#Yph6g3p>`Ny z&@mWQp$Qn#&{Kf)c!?PqXbAw_;ngq{$LpVlgk}JAc;obk5CA>^Xd@HZEEGLd8;+aV zwR}ZONHk;;fjy8ebdOeaSQBVCH_M=93a^$olUT7KiHoGXpR}T(u~ZUHU(G1vKvwj_ zNz|Z>8YuZ}h&r-Hl{Z+u-XM90ktE_Z)r<~#tC=b^Kym>|CDc6UiB@kwW4tHjs>eWC zkTQWl>0v{p65|MKG00b3$`P#Q0k3HjXrPt6ShRZE`3E@L)X~hhsur6M`#NpCc4tx>nevez_+jET!*Wk=*`cG$E|I;F0YPs zEyhoY!Zb=w^8qdp*EdK4JBQ9qPn&RgT&;joBx6!HsiY*mH;B1mMfPG&hMwcnIsYPTE-4A&?dE5=f#J%{S)!R|vtPb;f)xw%#Nb@I!z96&TwjacQ?-!#nBF>9Y8EZ2#mNPPllo?O+ya{)xizCx2zgGvnX`Z zEXJ8xe6Vd!y-0jJOUUhZz0DmT-i(VgA|P%%?j`+cK0KjNLsY%QILxqkfc2YKJ@Pr& z5e+`gMf-%z6KL5Z>S93TF#ZOOQ4RSh=I<}+P$}xr<=Ev;Rx5NhzPeP{)>97UdfT%g zrAXYwk;k}#>c2|}>tTR3{uvoM;T_jmxbdFc@`y|2uIAi`AEf}*(UEtJwzD%+Bz8nK zWeKfi?6Sz@=d;}@G!v-GR93?echyWC{$wE(&Gi@GYAq%L4wF(9Gh#|8=291{2Ehof z41<8bM&rl@z0}+g^Eq-(lIpn9RZ;7}H~t68)VL>~NsqXg4VWLA$qJK)PGBkcWypL! z&{uY;l6~dMKn{$2sdSP5;MHq4LAd+y%YBP+*Uf>MHRsY#?L6NO<6ci2(sO`8To7f! z^%SGXZ9lo0X^C@e4@)tC9IIU(JkupU7EjwssSEgt{y@J-m-)Z{5pMsp9lW4e^vyU~l$Qjt$zw4hPr)(+1H++d6a76_k4! z>1L&HaAp|$U15Yy4i5q?Bu|nSWwd(339ncB!-$WKWQI4>48$ul$U>#t`Nvbxe?A!u zc*u+p7hign0oBQTN7c|uDut6g|J?6g_!;osvKFTH8D%EVus7w&QDla<YD;c_3!$&-Wby%O zGhZ+=-aRdwS$~t}?!M87csZ!Eee>P_xECG6!{E{TD$N+r#7Z}NyGR-bRyun{YxrZmr z=tY4R);(=_XhQ*!^g7GqloL|nBakNvjo^zu#+rokLgJP|jz#&C9!j z0?);c3$Hz1MKHrI2EGej@IAW-mk17lAdG{4Ifxu#7Ta+DPO{!He)PDn^r^s?!ir43 z(X+qzWBo5)v-gK2<80^o*qNP`vska3&rJ2EdqxvX0Hd}n zW#fc=x^H|-Y3~9nrAjx*z!Q4$tY1{)MmFVL}t4ms^^Qd*<7S|C7&l zTy*|kYT%R?yBK{FRc0uslJhI;4kn~KK4T=D%a#Rm0bU>MB5A^tT^w#Fx0Hu&p@FYp>A0G@&_`|J64s^&Z{dmW zo3AZA1=?Q%Du%7>ojX!r3W1*mhVj<1|^$zjMSyDVWilJEb& zy-evuYh@vRQA6{bhYL4wZAVx%fL*s zTNyvN7$HU4#n4_jaX_-f%!lB=6s1DCeHa&zRsTj24Wo$32BD9zZl&Yxk8Q_6i<}Uj z)^wwdtZAQTM-KHS_fhi2(vOm$!`ui;aLlu_$F=;x&7p@yf}I(A+>@V6Skp;Pp_wjD zcE{A31R@$pCR}LEVm;;s-zBn=SDb(l;81u_D;rK3ECrS)rBA0v=QFUB5-y(80*zce zrCC8oCg3K@1s~P)^jsS2W1haPC(FCk>ttbQW*}D*#FB$|3qIU{*yAL)C}{1;Edqvcv_ zbBTZ?O&pts5as=YRcasL68AS)iJqL=OWH$bi|Mai?_JXaq;L%J8T8Ie;+9{+t2mOC zE79bNaGw$t&<94iJ8{d5_RsfGmLploL=SV~(7SPla|_*S{p(b`|;L z&OtIFgi^dQ8W{Yj-6KGw02F=||DD$t`w71W=fth1=@;O;YiVHOQMLNRnTItH@CSdT z4hzb@b&i)NuFLvarQ!2(w>ISiHTl-PgenH3SR0J*t1GHQBO`cEA>0HpPHkK}m{kCv zST3RJS0~KvK#xcV65(yDp*mr>d!d;nJhxUAGV4J(slexdl}MfWt6EhaA8jCn29MHf z$JY)-i`IQe5O2#|5u-CrVFd~Vvi8hBthf~M+H|O){X5~PnNsrD5ln>x*Q07Zh!gce z5^vypzEpPzLrjQT7y3`{s*WoaQR-cH%O>0H;Xs8Ck~lqo%MDwpBrdPXED)Gut3iQe z^PM^!KWbFGMHxLAYqOUOc3VjYD&)a=LtKqrfW(W`Lq{rdW;izQM<4{w+H&S_z$7Xh zxumSfrUw4=%PdLsP;k)eSeR9h4X$FCvv+TuxuNWUpsLjsPliqqf}lvHCq z9iB;Fh9ig)O0xv({oGNa$senogvAqhu^eCc{Ju+#Bobp#wM4NyQ$Co7Z95ZC6CCr*n!OJu)jf?G?*pRB z{O4E!u_&uEPA;YAHz*#G=fWu%LG9HIzgEpDDe-RMCV>5GF~{TnIceSf@a@$p`E0k^ zUjF@Ev(qzl6LoiX?o?u`S}r%7ywb%8pH47aJc)k^-WD;3g6T{Vx!sF-S1~k-s1(I;S{I8POOhiV+mwsS<@wc6Os0BR2_5q9Q+CTf+O*4iWtPO0LJT6NPpiO$-vDI76&tyJgIBVlsUQSe|asw-i>;F8YZhaZtmmI{Id~V|zI&LDLy{MH^7oZQDIg4osc8b!cqw zj>3u$a=V6yy{9$T4UX>FzJ8J;Sm9Tj($;S_Cov*gG)X=ZG$X`qKmRIqA$&5RMOIl3 z4yR{?PdxP`1Pf!|h4m!Hn)nl7ba@vAm)azQ|2MzHgq>_({lW<>D<9Mg8R=zJN?%w; z$}N3s3PoE=gBRp?$wp+|((}i$tloI3xTA`a2nsp4)j8(5|J2H4nl-Z1T^xL%a==%a zjGFBF=hclN1F)d&SFwPUEde3uJHX9w+!o!ik=_Nx?by`M-8{)@yUfzQ1fo;EXa3VMk1Is~Yd)(h3L z+6*8qGix=TSV4^LF2fJ z9*f1e`pz408g`Z^Mhje9^W=8Ni5>qx;DEOT5ZohKv6gO;-nQK#BE<6bJf~CA-A$#j z$ced^`C_O>Hx`EjsRr?x_ud5|yo3T;6IGPo3jeM9#P5U!ND#kNa1s_qrFo$7{s~Qz zBMSDNXUhpW+pmuHSn0x->e*y^^OBoQm$RkR_@PTLPA2|j1)kn{b^^Sh%VA?WIo68= z%Ognx>Y0Sqg9)`nU11nfmh;qBxq47K;;ZT|Z&rC$VTzWTNoD$I62GU~ssf+r&lVQ; zUfK1a*VW4N!n>|6pOMez@GaY{)hkIE-&@+d$CLYba;%iiY+25IXe8JI&-G>cN^mLV zj7!DmKh!AoZGP;B&TPZPQR}#Q!ajE7-WZuH`x7VUtcBC&na(1f`m9%^&bBTzXu7Ph z^N@R!-RL-tMg>@%iK-?s0iTajBOwK309q&j7z8G7%SVg3gn=Igk`~WgohiiRFwTr-M0OS@Eu zfZ)3Isq({0ZpC;|~wM z+=a5HK# z9{O3?aA?eAgN8E2z>sWI%CAG_&w8I>#siADCBw2b7W(0U%+;!FINDQ{d?d#GT1k#= z)cXhQ_`Bpb5v&ZS7-_6eDS3)ZPO(opi0fHec;_B|3k-6 zWHVe3a!q_fYl0*sHW9SP z5|xI;7b7ieO8ae68^dp<>=*Yc;a7CCz-x8atT+C644((YHRZCq8dha?F=?a-{3 z^<*}AgEyqOb3*RjzC)(+WCK*ge3G-&Mn>bV`e$z^W%9vi9>G_$)Kz-=!ntrd@wKYS za;TvAyPM+gZ;!vd(ZDQ3c~c}rMM8BzMC?Uns+2at##w!oOgdyP-~q%UPn~ge?jHwI z30_kf)K&Z}@vbyWD>`*(S&+oLJI({C#_M(-Cb6P4XucC1giY183F`o3b@CohJEv!& ztb*Xmk|5GmZ$|8RnejiW1ynZR0xnzy1Mo3h(N`f(b3u=~YUROjaqthpycckB8{JrP z0}m+EGGqB4KK_3^Y!;+hPA6DKdmQe|B^ZeFkCto^G4FeZR^>;8ME$_S@PK%aZu-tn zmr~0}Wzn{fxq_pM-bOFEQ@6O;qUH2$Hgg`PWF-bUmrzADL`RM`n$J)N)rJPSkw)H0 zC>a#$NJ&OVdeVC0DgI*5jBxVp7qlk+ZqPh8K&Zs0O?p*xEF~5a>#|-0=@o3i{ukvebd`!0}bO0JnTuYz> z{#c<$ODl0te{*n0LsJ^_#j0SKU&`x{Q0;W~C32twSH=f|y}2k~?_y8wLKtQJ1rOsi z*jXl~pm*pN?VQod1sbb`1{Q|LzOrIw$v&5rvc6E}Y%=uW7lkydTi!c?&GrEvc0J_9 za|De8#3c$J(GNDAzI$$gQ~8w{EVGMxw>^Ihxv5}I0g(?LAeEUYT9EYaFJOn^G-8=K zzAywJygPSvs*K#J<#|=fFC3qd;pp$jZdEI)Z3~wqE0_Q)kD9)D(0kcjdNPIBt2T+P zS^7|j!5s3)uy^|cDz7R?RyApPa8%&q`l+=l_*g%{YawHpb%&n-lv5QIA0k4 zhx89B)2qK{6^d`3CF7?K5m9Hm@5*%I;*ToSN;6ol{H~?zP&zN+G=H}3c24bID{R<) z3oAfQ88g6MI>X6HEq$mr}HGH#K3Pyjzk|mc@TcF&BB;Fm#$hcU! zQUC40eWDOJZXNfIyXHCP2+YH+B--xB{WM(-yGRU)uue~as987#oDUgEJa!3MJT4~2 zJ%QS^*vk_ui;_#=gz}{^uz+}%kyQy8O)F1mG=`i%p3)zux}?@hW0n~QC@A|T*|~y2 zZb>~iW67HESf;4jl3AJJj;yYgd_SjL3VQd4u*)p7LcB8dD*^V6*r~CSCdfuCN~I4p zsV%H%ze8t|V@WmBm%;cSNwpW6P_zBnK9=F#1zK7ErM7SN5FOjH0b@E=K}`akB%gUl zb<_HN31h7ONkBj3ylKvkV@_Wx>jxHqghPvaFquHIx;cwNWauX@RzcHsJ?Ts<8 zqygOLeX?4r3mwuM_x)9ZsN_R)&>S1gJ_@eaz!TnSLO6Hdih#mvGcD)wYu3C!V-+Q2<89-Q%nzOS}m&6_OKPO#gNJgXSkp@N~{q7(!!Pu1ESPk zQo;_+J2Il#2hdJffE-P}uyzrL(7-)m1AcZ9dCAT*fy5kWydiPVJOYv^U$UG5&{m@G4q{{%bn+~#1%Tq5F=Z{9b`ClF{-)q z2xPWBM6fL%S$hwZB{iWMX&^^{Q;0s4 zn;||lEi5J#9b#n?@+IGH%z+?@hanhV&Qzg{DH?>xBm^>)bo{bN)JG8c^aEVYzx=1n z-%si_!ap$h%>%C3{OJ}~D1n>=~& zEkxJyvv^%C#282s7$9IIoHY?TqtseoxyL2wB}sgsXZ)M+;ndJ*?r}G z)m%B}%8pCPsb2D+Lb)Jeta;bwUMm2p#(+qh@< zlCj4&9B}&C96oYUfuLUtx?0}ahz~I{|55xi`-K4V_p1{XR^FCLO7pj9?Z!T*{RnQF7cLzzWEJ1YcLWqB5F1^xLX0*Tli`*3{s9aU4;^&GQwsUeTIGZaEo2PoM*xiRg zS%JK(cBp^?DHX8(_T!{X!CK7GN#o>ARtYY13+e5*B}L4R3*MpN%C|5c(kUZ`NFK-% zqoQ_oMmW7TAZRRkx))sg9$p*K&f%?=_v0PRxguUXGFIw9u95CTff;0MTzP}j3*D7B zlKFj!<{HhHk0m;_G|AVh@2RB1zjh)v9bVvu=Q##gzlArFx37?6c!AU9lu*gbf1V!b zk)i-bN>K+C>o6eZ)|0(3KYjG^;d941AzJRiPoTel}SvWrlD4leMWG- zhcWm=6F9x+s>2-RK*D9NLmif#>S@wvcIbR=#2}!{7MV^8^edhN%`pL*yCs$n=N{JU z%JwfqkPz7kP*QrIMnp(Nf4Yaa@nCs zQBe&H3%`r93p~j;1rE@a5(9=lz?nwCPzDv)+-ianR_$Sf#T86S;175T)4O1z`%k2s z)Y*-oRdJqIGlSgKa3%%5OV%n{iV$e2pcPimQXtre*`16trmP4y(zIbN2#IbCOev^X z3qCb?e##c)NJ!7;F`2-1LD~z&>7*xeP}!SF`5H;iD5I53EkO5Da1Iy+Pnz%Sq+3u` zmK@$(i8(FvW|0m%(xrL;OB`ne70$4?zU_g+rL*}`0ct|-YPcp%DBgrWPZ8(kcL))|rsm%4}O<;-gvpAy( zNa9s@B8Y@7l8{j@mf&2oRyxAv8@ykTr=RO_oU&~oiCf^S7G*g}XpNJmRNAS&ai+Uk zGR1)bl&Lc>ok(kviC!dL6BfW6Xd<7>NmQHYSON^7f*fVl0CR6Tb13(?F~lY51zGa) zZ1zVeln9Jto;^*|Tul{6r`uRKIz9-~H32HLvB1dsPzxIGXdi*NWJLw)HAN`D)ax-5 z3`m^GUsb~jh6ae3rlg!pZY=7GCd$`Mi`9N%1~v(0zc_?o%-1ik#h`=L9{rro9Z5MN z2#E_!<%0Z7P@=O39;sNoxK%2-P1Z>B7M67LgK6C#ay2hIT=^ zL!EpJ?L^H~J^6nP+0})kWm(0mNITvXmo^28jD}eZ2$QRO8qmWSgtx~2GKqVItA&6C z?N1!)#WNvNoLlIEM?}OjsSMvLtE|&)!ag_pfwdB2;)5|K%*&j1QC?jEmMF}^A;ml# z$EATytU^1S2G!~CDObagLYl;>Y;i|-C{mg(ug12BDwpyEDXWA2PY;NKt|ZAkcrrUx z;oXNrI>KQWswrNZ{4}cxf_!z*cz99*YO8SlTx^^F8e7-&TZM)zJr=M!?AY2E14HN2 zQ}m<8i@Uk1qD(Nks!b-$;+m{3haJB6LH;M+PD3AzA(KRti2)PYfv9oGPHjBh&3{mP zr@ljFaNWrajk6T7eOJ^vjehWjVzd$iD!X?Rd?j6bk4>{q;oCl1YmBx;mN3 zM-5V{W@uF5UvmuNmpv=PU@c*BeONPjW56P_Zu%a{sR3PMR~+!?6nEFhsr!^451fu zS|NKc8R@{oU9qK|#STomaQr#SBO|}iZj2jr#<|AK0?ZeNA`ADl4{*+}s4)K&?xA@2P7UXD;koD`HNwVe|LqsJp>-r*5=ai5w;GJnY+khOj>Ue5G$NgCh^h5PFlUP?u0XCdPqDEd#xnUe-}TEbbn2h> z!D+^lxEB(I*~O3K%jy8NEj_quf(=gsfrI50NyhKA@O|iPb~j2bGD!1h9rluw@4pbo z7SDB7Pvc*F$Hsy4?}>g9PIuetOjpOVaB>TOBr{14xa=X>#uOD~;+iHlZ@% zuN+%BBB44c zKfl@T@5-Z^A-|C1ulEfW-naNJ#C5sJ>YQI3vrF^RMPqMvLemY?yWX@r2=Yp^J9(8Z!r98b64X|W1sFba(*GW!32A;TcnE}W zH%EetQ!mCOZvgP%%eTTZxl`-yQc1q%Fy4)GE?%2t<-wnuW1RPl#Yhzhm?D~i62!O= zu^t)n*r3d>DQs&SGgezT3#=^e$WXPnmqM}|R4Auj5-6)tfy|@?7B^*;5m8Vm42mL; zRbLni3L>J%9U*}r#MKCbAz`7hz2Pf7YzK?wpO-P4l=u*-o>n2H_? z+uqY}P;X63{uhgvU;x ze@0JWooI2lBZJtBqM&`&VJCq$V;sk}vQ=#5+m?HbmATu3dhC>?s|6|E6Iy-LinK0p zw@;tb<~#!ej+$0}{pqvzp!R3aMxV8|19;jhD<7t#UUER-#5kr{901Es~YwV~(^)`*G^9NK!R%(NC*`LE+F(ImP5(a0T22 zyD2ncF~pd#@iGBW5NAN^3pzRqbZEm~c?$Fg^!yCy8o#a7Qo`5umsD@7v{)4sQ*WYG zQK?ll)8}lXR##ClGwK6IQdJ3AN3Ez$<{M*^RROE_Z`$HzT^65xDmQPRW8T7*IqtU{ zJRjikWmo&QdjH=uG}kxeUA6IG6|U`oPvt3k<=V(t?<9Qyd=bthnw}Uu^b=0Q(VuB+ zThlg2z=8moP8)FS#RQc|fA}4FELCw2o%YX=MVS_Nja+Qv?tc?YihXl5#`C*%cMa1b zi~7VL{lHZLhG4a(R81tROEuF1K6^D$Q##GX)s!pRFU`$KNc#J`zLLa)egzGjS2Xu+hk+0sI&8BojwDsUDYC3J^;E)eudD&gIO+-#!W# zvN+Mvf_k<+&z@@rHD2itg9pP?9PQ+Qv%07f+cAtX-mQvbhV}ci(M|N7C_l9i_Kz778 zCMI_CRvnP)DaYeRP81~`rA=HqiB45w7Hr;LE1O@l*@%07&Xoqr*)N`c9B1=mWMW2j z>N0`(v?df}-f-0M0Wc zh=}_Qs%*8ZOOJC!c2JpDXh8{oYv>?~O>Na7 zOnD=Qh%QnmSgcw`=E6NRLQV)&C5kvDMu>A9{jflz17OS_ENy0$Ln=$6gK>$EocM-M zgD02UO{W%cn_qD46OEMYplv8AzVqQIm3MP|Ya`5PEBwA5c4Mmzf{ZVFG-g75kWKM- z+%4Sz?M%u`*~LO293EStI7oaufN3@gLVDW_`PGHCsE6z%i7UrZuAUYL4Nj>blPX-g z-4!GXL4lry08G3}@fsOreur~4)y611(kh+|dP=IAi%&(r?Q>J#^aB_$q3|G#C|em` zdhLOlywt6zVqk#VZb=K)8qKsCw%;ZzZ*DFhk)pPl+xFr{p8U(3Wj3~-R%0}4wBu=? zr(9#{bTdPOQQt23Yj0Qzm#ETLZ2PNVffpoU(9LFgnM{deD7rImhocJk;vxO`u9hjQ}erU7FXmc@$xQFa%}Iu^)QcdT7E)}?rFMzMO$38h80bic%+ zd`99u8yLL>J4tK$6570&Q;5iZW<)JR5r4aJSO%Na)dZGzYs|NMmt%6 zZ+gb?==ppmZB31gnwEC2>9ekL&4+s$NB$d_e{dg?KR3)_JoK5@J;!m{o6ITCCoDo7 zI2od>p=Q=}>a8diNV)cWz_JskJ1;~5af}y;4A_i-awIvU-LPEs%E}%Di?ODXz_`ni z07Z&;yU?(+us+XDm2bLydB(;4y`=uGg=zYg-y3~ck)m) zAA}c^tg`S##(abqAwa^4H^@BA1vLd92XH0@7ZJnvK^QTsf{e7eZvr6WDqb`~fQ>2Y zNC|5tc9#4LRSUtRN5ZsZL6{YRqDb*wy;ZQ-tjLvwjF}phm?$~kbONFgNt39I*75F0 zkxO^kTyGsEwRqpV8CnHww7x0$$~0dDz!B1-fy`oHvFrxJAYyF3^CI zhUt_#ca%73FlRGCJO%)|B`C>YAxWW{Vv>Uc8;(Q{Q%AX)IdG>wfFqI}tH>1<9Q%4jW0-xsM&K@CLyvMQkEWaL0cQt&(rlB?Nca$S-OBHT(= z^;9C9lnQ@{6v_-x*LgYVEoqub%xCXiZJx%ERINNhFmM*R4?lp>Y{a5xG^HC&S(EDL!9}FV1p8dSsVnc?rgr`8sBg5*VwnQ=;;Eic?z``I&_kN`T zT&W&xs={2E8WaTleptR*aTF(;m7T`Q&&ciV$zoC~i9g>uFQSw_*%ar#jCR>V>X-6sP^B0AMfns>nVxClv2aS< zLSn$8nL-(=jCNkbqvd?5t(k>ja$IR}(eXmXrF8qh$_d*o%IOc6ib zBWbUmgs0o%6A;#oJ9jiJw;SEDv(XNju(!Vy zS0*grx}go!4>x3`0g#cvkOT&{BS-2bqY}T_0Ka6Q(J*%h^uhF@iRi6pa0=a*jvWS= zDKr6d5K{=|F6$V#89MOv+?7()aC-KGI*f$E30jResT_-v?b+|MGygf1~SdQ1tpM z>xVcaW>Y%xU-~B-fMY%W-)L#*+Kil^?fZpW`f%XCfl~Uf85{-nR~@Ys@O}M4?6gEU zz>d1}+)bW70f779Ztk^G>tDxCy|&1?tADbD896C<0dmtv`KG@eGjT&5_}7%h`^&K@ zV$xdOTKFv?74Ox0U1YrGN^HW0Pqa@P=o>%MK5i7v4x{@>eQ3}CXvBYGe2{uo<$nRQ z((6Ep=7{qQRcxe%Ia|tGD}(J(xEayrY+Dj)l#1-ebQ6nR{bajJ@iLUBMni6%Ck=&4 z>vL^Ip4h$DaHdeCgN2}1DE?>*Pv7^g^k17uiZdw(sfU)6Eg}4yv1DSRv9(Am*fmYb zCT35J4XxfYtXBqK$(4}>o%pX4)Ev-dFyG?BKc5;0K7Y>pD`sDk?b;I>TXf(0WJiWF zcG=%qChZ9+PG!p2(EC}&q=Sdxmy1v_RSM#fu>geP0E#KmIv3c*9TqqazNs*+D12*`9S0OY3K~C&c6DbzhVRtb z#90**7ubO;pwwHv))wq0DiAVe)>aecyL-W>Iy1RG%{wRD-x^GsnbGfRgc+?XPtKI| zmL1gOry^MHj-7YKr4M5_35SodjtvVp#V(bKukKHD&xDfmHG9f>OE|CVeSo)+?M@^z zX!!QWOVI4nicA3Jv*x{d(dpt&FY7aLQ4L35fFVvC?!39_>@q-3aT85G@!5o5smSrtSHNJj4!ihN-VL9ROF%*Yv1WeOlSIOAJ|Fv=ODu zS66|6mKy>fNTfiCl?~QZ#1xI7gUi(F-c>=BlKkh(#vV&h4NUZanNG6=f!iuZA&}cp zX{O3kvVdWp4)Y19beJWE=t%>hY!=fNtN_ux9Ag}7)0tU#n7OIm#ERNW{3Bc9X>L22-_3{3nE@h5MWh-bl2wpR zRz~u$`s5gTKf;g){W6`}z&yXyDrzN#TyVdQ#`9-ZUkaZ-Io@{tuz#d&`&*YLF z-1_j$=?xozd~D9FgI0g;+v)b6a=JyxJ7a!n(!7I$ygSp|$qGxqa7N*3iJ7Hvh-H*Y zT(&JM62k{sN_L8wa;XK9Fj~Fa=MpR?%6KN*>m7-)3Z)}^c*}#rpdlNInu=-wzZN1y z@FN1^d;*2&N1%Fxo<3!S@Ki_ucno+`9!gXZpeiaM148uQ7DwRo7G4bx@Vqd^8wg8; zLii>3#@Shdf#4OBe0V_BWcR}R;dnBG*+`g=0b%j9(*!&X3>;7@&J-1VFsilLFwI$B zLw~N#)a4{?w;9onYWr;nshnhOPTe`%fg)TjD*9BZ43zto%3H-n-wY(#Oigi88^zCa z{X97@`fLZ10_@P&<(x(d^6}5Aow4cPt~pgy_=!>h_!TRP?PKkUR&M;s0i1GCyHx_- zeM+doITi^h9A!1ySi2w*?>hC$tRh@nRiTF}e?Slx{>8nZz%L9x^wkOiX5F)?Y16`f ztA62d_*Np-c1sb&x6}&oA8mN>VA7OZl?Ixl(5t{RSGs;h@K|Q%Sn!9ete%{nFlr~z zq7n?dqi8ej;yBK?ns%xTp_m-JFcz5ZhcKdNuTr9Vz1}#4>PT1*u364C=4Hz|^xxAc zZP~7mUfA(IYz{?TgG!WCfnng?uadscF;dW#wNdu5;(UE@{rL#2?3k# zUd^gBlWHiwsNB(XP7=|a9o38N6GR>_OYr!pyw5pkAmO%QeYv(dqf znLYD(@9z8SZP!W5a>|olD+TJrZDpk*{LZYpI0kl?$S5)H7W(W@A;QX(GY)jbdsQcU zM`Q33vRQ1Iooo638At`^GJ_vZR7vVH*EW{*&1NeRzTT!nzOv=iO(m5hTosVR5^k5m z75{Eff4r^VS~;W^Xr`Cj)2JrAOji`-^%=OE9-F)seHgra{It3vuuZx*o%N2yq=v0z ztJu~omMaN%7cVX;1MVd*iYhnuR4)R2xP??I^TL80v=p3)Skr@+qU$xQnxfRsIgyH0 z=~4an)tTnH%uDumI$fzvz!FJHEI5ORh2^7?24J2;Y7CG2@M>c-(WxnW!+p9@yZQ#= zEu0V|LdKo065Gn!3U~VKjNZ}?^18AlQi0VCB$}DQmYM1brS`+PET}61Jqm3%DDoGW zo$mX#?VMe^q7=I;06t3b!ed*1gAZmq2z4MN1^)yAE?vDt-yUi&{jn7->%?}O-8; z^n0V&6GN&W9&L$~hv5^H*GIRkV(u)oe0S>!8<3C*S$6$6hgLmJWsXR@AuG7bMG zsfL+P13d5pOJ&{c3};5*Lf4^j`$UDJQ+I4S?zb12#f$G(yof;b<+@Eg2;7Xb{*4nn zy(dOl67>K2Tii5r#%!_0Y0T%T%g;C5jCZ!SbmK}^yhwC7nDNVqe@s_nZ&(!I3j))L za-HyS%CV5Mzz>UnKk73bxSFE*Edq71B}WpGax(!(&!8>FOhzst%Y@S4qf?5o zWo4O%cl9xj`DVQqH@fbnzn03r7(;Y9DY(rG&&c0qZ2{NoAnF4?H3ZRff9H)*a zaIo@9@jW?oJ@cZ?K?vX*x5=vDaMWFxmI8=i@qkJR!I57}4%G@b`NjcAU=CT@WetiY`4=en73w&~VraKDAI|`+Uf89%(&&`>Cg?#fB_I0Z1J|aF``+mIH z(m4*8z{M3X9dcIaLpldHk&w~49XD@kX`!`~j$TO%cdF@lp&W}nl?XUo%ky1*Nxlpb z2iGUuD_q>0_qUDs#2~=4`lNzt$PCQ;aS0W@B`s9Mng8$_J-wcw<{mP3OU@z!af3~ijR75X?X?o}(w1|2Tu04w z@((d0g_~A?o)A-*Kj)9zM|}J+o3m&>8`WY4Id2Nfr}{4D(sJ_swL* zg*zjl_BN{ez+`3aHXA#l=)v6)Y>UdhVaE@Z7yh52?pnXf=kU;Ejlp2YC>Du8($KVE zH7wSu0&ghxA{+P;tTOGr5}$TzA*ZlO@Gf70d@uWl{PRH);5o=$>h96?)5!7EWn*Kz zmUtd^9Z6eKq9y4L2)IjIq9YyP^0RZ0sh`HiI;dK-1Mv_Z)TiD1+oE(ud3n>Ez?Hyr z8P!a!m~y~<{%BHC<{2eqy?uLTlwyw2J(}_3AM-uP+4j`?N6^!@JrhCiibl`dW6Dsn zPgpno+4sM%E^VCcH8LFg-6CQCCh4nJe>bM-MMre8n+u+`Fh#G=jhzGeZ>a2IWSBDh z6Qf1%f_f%wr_o35lM^seZnO5^Fs456ZV+gzH*ELKBEy{zmsrg=rjq4h^O0qK$lUu8 zFAPQrg+ClS^|puKH88vM&EMaj(L+ZB$9*=Mf-%jH8V_PSBpg`4o+e2j8vGpbjhzcR zw<>RM^QP;0xwFQT5C1p(--<2yxsB_uZziR7rpyM-(%4oa-vpW5npXonu`oWg-EI3O zJ_<&Lis%4O+2WHA_LpB_mHwmh13#ZKa?5#OEY7(#O>!R?xxuV36PQPs!gj4 zs8RBQD_~fL9l&c932upQ{NiIOV{b5LTlES0XLu4nm1g}lAA0bvBswPe)(6#syvs0|>mZtngX7R1d zdQe7YV`l&8>#}~~zKi5yr*@@V{FusR8&d0P!{HhGC?y4>QelD(BgM+XjXTU)8EM9V z;dCkcFssB37;4$e_cE49BZAdfaQz9Sk~V#V1WVqP5mIEPgY&dd85$;!I5+9SgIb9~ z=~g)o%C>pqk`tn?9@-0m$V(b%@=Ad_6g7^r7Ci}^`M&X_{d{j8R~3yNcM#ZTzE#RW zZfZd8ok$c+(cF(s@?nCH+Un=Fo zNEGPU#DMluL71ey#lbw8#|4YMVjiE0^wBpC6@uZ#bi_DKkbjCwwd;P~zWQ$g4f*M; zJMD;oh?jZW0Jt2A_%^K_;?;(+ zlzetA)8$~fIadYjVY+$=XL$^Zg-X7Wr7N%C7T@D3mRJfUdX|=3iBqVCtG!ecrMi-8 zqk446$(qbK&QW_H`tBEIIy{a+Yvh_!-+5B1M9arY^~ z?@#ZzyKdL|o(XXXMZc@;;4CNt?fu~9)|-RK8Pn-7Y4!x-nw;FRkB(k8`=1r^WWy8n zc|>UC_saqufrxITP^;^xRUg>Ps4A*D*#LE1p*-mB3c?_ecZ<0kN6S)TJ$VCrC9_&kO;sOle$i|u!&d&TbeH4{ zl*&~+S55Bf&>t!=4!Oem8xQ0=o{6-`g4{@swf<^-$X~gbNPcV-KCdOS(WB)<2=25+ z@YN6NcO+FKTq(<_E4bkszCM44d(*|n!vg|c1*$Rbm4ib4jzeaWx6+!;|GC{eUtE$i z8$M2~VoN>0zV~volZZ~P+l=9l>nj(O!C|`=Q9;UI9WQ9CPh#O*&)96TZ&>rA^F8pvj`ZQ0{<{97?7|J6 z-QB@$bDIXw@P4<|o-KSUcvql1``ns;aIkr9U%$;0(e=MTiTYhb3pQ757cw&g!9Q%~ zY!=GFRel&uz1lMvylpdiTN)dIuXJR?_66$+>xHC5m+Q9mVVkQuP*&F8E=z=AK02tp z3;@j6j{zE!oY_jHuD9YFTS|U?K&qq*F&z=`so>jXQG5r&*5?E z9b%yW$Lh?F%@3{*rxy&ewfJNWlG<)rfq>QAxAaV9{KS*^C~O-j&&yFuUrkhV6)iSJ zSAKtr$+#%2vLb1?=hmOb`lS4w&gCL~>~*HE>HPaU@9@D1v9!vj;~Ls(36dlxAyPBr z-^8UQBr|i~HOfUQAt}@5qO=qS$RH_B8i!hsAc;-DGg6SL)`|NRm4L(KlMp6d5mc>`9~U!w=NHOj zjn*j3S8pOA%VkyBLv6ZAnA(oMbzhxhEmNUuKV0-KAkv>MuIDmY_C391M1@S6=6A4r zlyMWJ2@Iq!-UnRM-&U^fEAV3L7opWkX9)IB&OU|ao)6^$RgT01ZyF)K$TUE^IN zP>q#L#ioc%gJN3P!Q>Nr;mU^)0?>_Z=*`+gz}+>uHS#Zn}D?;7g(uj{k# zA<#IGF*2AFJKk(>kurtMvJ<|@wfW;I{dsGV(dTx=fA62XMKNt1t@F>?#PT2d&J5Sh zFauuT?M94>*8j%vJ+fmUvY%QBWI@10kJ?~7tw$WBI2sO#6v-^HXh(W8%foQmSPu3D z0q4PRvOLXclo*Uk#(*L5Ms=blK{O9g&- z=sq-o&|O9NN}>Kf-??X9Qn+Qt5`UE^BQY_ znO#~PHOZ+W)End(Tde=t>91v0$5Kx@omxh4y5)G&%jq(>=0sR_?9abqjN?{-*xqj3 ze(#^CocI}*Yx){ zu3w(i$hJh%KIlt8&nUjW(wnI#(TH%D0Ljt+`DsV1lV3KUshK6c>fLIh&?G;l_58Hl zF(B$C+H??&gFnebShZnut$0tTa^+l6fX$ z2?=AVq7?KKiU36CE>4J7`g5vHtIP3u%9S?z1o#@p6pH@V%zh}s66_=!r))Ind;IsB zu@5kC;ymo+`&|;3)upF$)>D3A8*v-Q&(QqZSP%rq)4kvnr)NvnFIw4QbeSo&N%cqsbFVB303U|LYwkPkdzc!x z0{?p|^-pwB*1E(z#MDn;Gj~9thn>SVwoK0_V=zLWu5mKpy5zE4P6;^|0CHoBnS{?N zsY3!yPyd-r;5}pL3KBT5p06l*w0oT!}QLr^20p>bczoL1dBh)$nuv!xnAd^^Q+{Z^pc3jYJcN=4whP($| z6Jfy1QZAjtphFuZvve%rjz3GJ5he&UqLXBDeLDin#}1M*+I;0s_br}nrw`Ms7x4d? zQj<(24vRG%toks4=cvJFfgYo0DK-H&eL`#jzBDHS{11kUExqWvCP`E*j!K$d2>9%y z;wH%pZe{HA^!$^QDsCJ+=LVPqU}V}|WVbV;K!S*AZ(x3N4f>s7*x8@Y_rtOakAat? zYyYXqrgi^aovOeRNScyTtqs7$re&!}@fbvtqRqlyQ<}zUXhOn_sbP)AczZjIw$uiK zM$(W3xX_@rwSO8M3{+zM$l=-=n`LN-e>i-urUtkrJ4io7Z>J5@FW)e&{V_Z{4i`b~ zkO+Pd&WADi@OY3&-$V65?4di_B3lG35lQt%28Og&_#k75hNB*23})!#XhV~>Fw`Il zhNB{p9wOc~Md^?L8Ah2Ram5P?NtZ3{uE~!(VIp9E&P%74bu2W&T4g1mGl!kqE-Gnr zusv43}uvVv8B`l4R+EjQV|uDWDT-`rI_&1t~5+wV|L)tAvHwA%W}^^Oae;`WX3QQUGJhkNuN zu#2X2H(9v|G<I2unQtb{leXz{SfwX0_6iHuL@A@dUxLJ8hM6(k1lSumR2!)zwR%%mms`1TRFw$Su zV(ZUQ;IcP+L6W`?_hZjqjLs;OUCZ??>hN~PQ5rB_H^DfO-Ai|e z#52aEJk}BGDo5U`WcgQG2L#q%Hc_BRo2wL1S84ybjlF`k19sRs0|q;ZwFmat3G9m( zY5}6SlvIiwquF^gy_XNGllECsiv%Qg_(8JYXCG+)IV7MK0hZKaA{CKH$tY^PEyG4C zNp~qOOH$jcK~`W?#}qJuj7&i8t3b-P-w{4NEK+Qlr9zC^qRP5ceN(8*4Bc;e5$=&soSUg0E;if68GwM6UF{s->HD@c_Q3(_;Q6Y{m9Fogbr+l-d zS)Y4RYr%z-9RRxKGfOb{Zx$YLQO$_COx`Bn9X#fmr7I4h6jG%}-Fpe-5dme_A;=@S zv{FYQH~kKQ71Jwc8od4CIE-vU(Mt>=eMzT*2|*#Mfga6r0b9~)@{UG=_s@Z0<`w9V zTEB*fWB|s(hM~)#NbK_=Z$5v9=v?>a@%Lcou(P<}A}$YZ7B*pb;e2=mOaz~Wi(m)6 zc)aUgeBO+McZ-w{>l;%WzbyA1&kprMbTl83cJqkjh<*KoEq{ZelrIuXl=|c~W)YVg zL|f}S_xaxkhA&>TebMveh+_UA$?d83e#BG7{5B#3b9QK7^jsUhR62fsu;bHPwYYda zd|#3z9rS=VxZ&W;y4ub=TkckD>^C`N^zQYWfWRkjBAp+(g}By^oWE#y`js?#wMJ3J zI(M|}!(vHRfPjo=NnQqyu9oB_x4U=vo?5>r$*IL>!5NERlB>EHrX6G^KPi;;(*Bzh z(VqA?B;{-$!9BOYD)N$RNgN%|;IuL{WN8&yM>Hq-MfMjg@r|@3h1gV)DN=^U+K)Va zX;8sIHH3_S;3 zfT=MDsT4oiow3{9Dfcs7Mto;7e9I6)?G9!i>c^aRyiyLGGl>fv7M4= zR-PBmkK`XUz09xNT6_Am?s)|6D)wq0eVD#!34!+dm;3R~2S<02fZ*$EkNAo5Rx4G$13xh?b4s$+}lbsx6YD^9z$c&R!SOp(` zvv}{&i=W5Z`F*4vYjb@CtvJHY8{vc-D2lWw9EgQAZV?JOSzsG%rK7Z8RD@7W&)kzZ zef>vbiBq`|F`(0HyX zc_zwx+8Yz^s&#NYg#3-WtP|G!1nf1B?V znDyo>{*~{)w*h;58MH6_9b=h2l=i)`^)p;D3_)~F-G29)3w@8>04tb$LiO-yD2xTA zL1u6i1olBr(4e<4EiPyf_MbC-g$-8R1R(=pX^23G(o;YI!*>@@L2XdL1MVs)H$7Hb zEe1b;Mm<@(Qn|c}v@+5rXd4A;W|1l@-tikg905bGa{s`_9{vyNs#gIH{M9=gM}k9F zeNKClNdX5rfayvcil1&sB$9nX<2Ax+6NpY&d>o2^SuqWtg=gUfF|OON4b8`&kT%1Z5#{=K@b{>ZX*!L1ns?f{_c(IVdrr$286>h5R9!DxENLi%RxNE z@&8x{--Zr$jf2hq0n39=Ex|5BJ%F-6pm-#};g-w5un7_jf{k;kU{*ZE@uD(6_${m) z8AhPP_6lJAcvln_3Fl(z5FLqEcqRxFpvlo-c(dsfl#K@z_nHxVWq{EMMuhh$0jqMz z;3P*TV~jPSvJ1_Dp%M15U!d2&hCsvUgQ9m(`jIbDQKXCia;Y_HR@S?pKHnA7>t)5{ zS&PzN!O%>YC(WQK5rZ5aJ69G3eIM0>(6M!U{AROb}CKdLo- zUk;a^QpD`N40{Q4Dft}Ph-6<4f}W1L+=K1eLRTvL>GEW`z1e7-+p(z_f^j3WWON#a z0siHA1A-+1!A4;&x2cQ41I=6^BshRhi0NBJiIjoMA;b$WtjlEx=78wq!qPiAb`Y4O z5(EX=uN{Vw;pc1YC)1}TqU(YeNc2IL-9-VM2&Bj!3m7CoV-AiR(6^kZOPkoTU;KxbvcW%rB;BeT_>8uyFUmX9neaTMGxMBUk zo>*l?r^-#_1!j~b^_e&>V#WHHtF_pQ*cwheA!q+?`>*2{+pnzj%)I5y`Q#`?>TAoF zU=(xx6##;VoLOToFN#B6#PiztLtK=TF%($RGe0())U`n56N-x58_`hCkRsdkPGe#Z zwBHgK!8^EHd26`%Q*bRjV`=GXzQOi?vg;q{5j9#3KF3KEDeqUNDOS< zjYajF^@BrZhqAIK&HF%Kt8^WPRO-vl_6q?0=KWb&0Ejh3_htd?H5r-AD@cku5?K^e zRRCOidH;EfWQ4pdSPWB~@yIl+pGmxH()i6IX z#l3k~^0+!vHvf>qN|wACc*lIE#9eRpiOv%DO;njrF7`beT6^&A{`cl3s05{1AjN@{ zW!BR2wj+yfZe2U{EYrZeYGQqWruDw(Xff;ohv0Et{f!!b{@UvT!+ZaBj-nox<*MCW z$I?*u=bFBQ_ri~O1v=n##WDp-iV6l-Fi)}Gw3{Xvl%f=Q>t&`g0fj0v$tXj~QTpw1 zAtmY(qN-H8SHR$a&g~slsuH5z`$kkMzbKhcA}xD1Zd2~qR$&A(DxcU9w{4(Y2{e}* zcrh-F@wJ-FN~nMC0kHX7D~6-Ubntf9hYqszcxN0;vMxcuO>AanUe7yxsG?bDa&46! z3@MD3836^XeAP9)u(zUbBJX~zRdF__ST)8*ML=}Q*9AOmGNO^e&i*!AQX>6@!8rJe zdcJj|7Yk5PlC4)ReRP2#ITD)EYs9&$rt0$dP`F-&rWA#T0B;o?R}u@OMz^l|=>bk7 z@Ea{Q!hheM+-Oc97GRVnC>l+>F4~(`-xdQRi?`uh25Zx&mreD2l$K`$Bw)nbnM3aTydds_owzG+ac?Qu7U|Z*K2W><`ZF%Pd1$(ibwEc+qPf(*RP5-pVM3( zf&whgDN=yJHIt0nKnh3**icZmJ|aFYQ*b^C{67z?x_fU${Z%(y24$iX*;KF5Bu~4=?dC7nIZ>2Bi_VfSd7deQ!>UIRo z#%|M-bD#%2xs{1ab5)C{xw-XspL{pX(;a=+GmYbRb9#J`<-5$*M06w4ufSiqmCwpi z_uJp7ink`ScK>bKA*()b`5}5JvjTjV;%bM7*cVd$C1QLEOu#RmG>@hl({L-?Yb=o4ye@th-WAN8hZ`jf zM;Dmkz*CAIJv4{jQglG>Lg$uKTu102Gw{%CeE)O zMJT{1lp}}<{Cm>9T;TuKUz&Wf75wyc@`>%m+svPOgejnJQ7%WfoOm@YypDave1!#9 zv6*h?$@Mi5xVai+^)XD{9?SU0%`>BBD+X@Lq5$7Sm38xyLHFb7pOXWyBI;|H?dN;B zT(7|Yz$c4a@8x~N4-m&Y9zg)LnOv`zyTNS48o}K=f;(Tc{4OX4YnZbzAURj8g2Fan z^p9HN760YqzuM)Prtnx3t2gi9!hPtESK8;TIqsOcRr>S!55D|(Jh=v~M;ZrizTIK` zGP6S!(1c1U%ml|MjG%NV)(vRcsT0}DYVL7Km=}h>{W3-k(;jx<3`P3+d9i7oj1qrL ztecTRJ)6E5bYBDAMRV*a)g@yksI!srIZIYs83~r!cD|2S=j8Wh7VKvX1#YEe3+WLf}BJla;Z#?2@jz1S{(TY z5{}7_Ik2*R4{qp`azG+V4vnY6XP=}pmrz{+lk4j?bi|p~Ma2NmQNFKK9Q}-bN?&dM zOcGjrZ_i%-C{#H3h@1B1nMWRv&KMvxSO|^se_JfU(@;s>DDF5~b#>LIXne5|;ZO6v zBS&;H|BLQ_`Oj8rFNYXs=4$C#`K*V!zh=t9e~IrixBk?;FYzFJ(;gr<$HHm z81*jnDg&1{Ka$+oa^@>mSqeFHFssOAxLgQ8u`&QI++&5C?O-w;Z1)v;n9c*baOJt& z>2PSwcq`%)s(Optzc2-WOOh>EBW7UmGV{ z`{L+TH_3OX!N)pqQS4lO=rwL@^S@_LYX;N0#p0S(xRuNQ@jD;v^8=b^29)kWCMDD_ zqzB*wpA}WgAE)xR8KX%fQOkW*8q`sTlnLsog+h_+us9F%i3EpblS4y5UhR^2*G=^TC1Q(%8W~&H2XKo zkgrO%-VALZu5OR*lLE7A--xoM;0Q-##Wa-4qPJ&gDXZ{uaW_=4?k%IDQr%zm9Uu)r zsercfrfK~U)HNGqcg8-DtRSe@f6EFW-BN(^+bjpD4Zg_=%3F3pebwkTs19g2XWCW9 zfMLn9OFRmzV0azSbU;;&stUL#Zpfw|bU}<)?}?&3+H&RQIar9uDF^NArj{-McF2RUBrwKYrrE zyiPL}^Hki&E)&9&PFKaQGG#FlW}T&1?K+_rKzE2okp1KlE=2RH#)f&UVN6=yq_rbV z#hQw5QtZ@MIARCLHv$oSCi945HeUTBqd%MAM3cJ7Un_u)IOGi8uubhr>2W`Wy0>kl zOt#6TGFFt~Amt%RO@r>C&Ih;htA*yi+1->&wdyZ5tq;dcoAbIlX|qqam{>a3ucZyW ze%D}jP;;4GJE_zTR(dY5VM^^RE*+G!x3t&xkC4%H`n;Ib={C`ZdWnX)^tSGk znE`~qw=jpaRMp?!Ar{njCzJ$`W11+xJK3~sAHN2(l-fztYe!~D9MdK+m)vTzu&^Xg z+f(Ou(FJvzM0P?G?mqL*YV3fc%G)wNx^|7JzRteOv!;rTa6gVOSZ0}%vnXt8`d}6? zci1MI|2LcX9`&Vv2&8Vk=jz{m+yTV_WHE8v!2}c4G)=j?{D1p*%b4@}^uH>&*f#>N z1Mslo?}dYgd+W^KFgd}F0BPnw`IBCjbs5yR-rm!L4*}>Xr5~+k;xCnbi|k*T+@qmb zd40kGnpVAE_IT{5|F-HA4eQXoN%(%%!DCbXtM5L`;xpRlw?y}2$g;RYem zbO(^Z1gB0T!nQg=5XZ3;Rb1c~BUJp=nZZA2v1_@GKS;G!AMF>ppf?O|dAJO9C8>@5 zqvs)3^Nz6(kmqhJ^o^n!CvwMePU(8X6{S}uy2XmZ74n=)<$?TJ#{~HpD;F3E>qgjf66IRJy z4b!SkbYh-F9Fav;nETaKjE}Lba+)~Z4FYDA6y)Y=@`fT=VJz2Orsjgtu}^pNpA!Nq zKrmpzfd{%)wMHO7ga-aAtJw`8!h|v|q|(MZA7YYbc~Mq%({}wZPV=&E`*B|P^M3y^ zi~p|5imK^`Y1xkJ`9T=PNt)$F*=V-foo?0Z4~C=hWIC(oi{)y)+3xm-;3rxAOs^Qh7%-3Gc3moq9iM-rW>YZJFe#kVH786mKSAJH*MDs<1{bpwjbwpKkxVF z&DT-74nf%w81zV_QebPxFxLw;Ms^^zig5J%6u8k{P(o3y5zW*_?c0Xdrh5+)XRU#C zdk*-6SE9_hesW`ZoAW~3vt6`dHojUW775nUL=ccI$roI3*GK04@K}1|Ef}A8$ryd2_}gXs(7?$dMDtV_`&9oe!_Kb_R%ChgOUmY}103b?2IQ@Leao?Ee3ja_4Rb z`P3V%(ut{2YhP+*7Ca2?$mfCj?@bTm`pja>TvxpeR5Ih?vsV3j2t5(%;U>eXj-;rp zrrdfQ84kG?*rOddkscP_FoM>mf^o;avEz+sL)LDWaYGptJ{itS$T9fqT0Z4`42SkY zO*lyqd@-6qxu<5t4TGHbP}GosP8hAw9Eh@_7gHZP!G4yKgux@u!bxiGQewTu*bgE?;`;c?ZhPL{dlX7~&%zCHCzl*-ysH^_jSqg8cZog6lrh>U@m21mq&6977ZOi5nN_m_Vh${ zY$mPVa)2ysS@N^}OwfW`j_Rg$PrVA)=h%4jZU~P9ZbN5_dAWJvy=Fjl*a}Qja4j$B z#WiYkce-W{M)#H`gTkXwVU2o_Az)!o0Rl(Dx^u-1Qd>MXa3Mx;RNP1q%z#&mvAq%2 zQNV?E>h3Hf(~ov$J74;>^Z*tWed;Zgwk1hHwjCoGqm~w0B-{T0RR9100000000000000000000 z0000SR0d!Gm_!PK*+hbtAptf5Bm;$D3xaY01Rw>3e+Q0X8&ah=3U7a#LUKD8|C`m_ zZ#JTajWf@1fP;~NVB-(~ig#!K|Nr;oWDExyY-;-IAUQIUR+^WfLSaFHJd6pmNQP8m zS~u)E9@%EaDe#0}LdK)1EmRay7`;&OSUzMYt!efOCoF-w7*=bAn9|Js-<`_7O2ujmIi9J<8J ztNS5I(KMm|e)+B6>6yR3-fYT%OIc-?^eU1IQ6dyVf|HBOMx#(!xH|-M>sIs{24lpU zv60&tFa|7%92?u%Kp3%&Qc9^1L~OtWF)=a03c@IS!KgQ1{WmdR-!~utVsD46}fF0(9Y|bU$36xAT+QEH8+$wi5(snhc&es$(yt@(ym={k6u9hBV0)AknOQBiEv&-r%paWK&G?{jbKS^gk(DOj^|4p@@YcJlhllGholE$%)LP%_DmhKEHLq$t;=i365lzQhG$eeM((Qas< zF%=9EVhETbB96Z6>*|jow%OxgRr(4h6-UKI0`At(0CaF!1gQL8LMm7;elmL&*arvR z5gTB*d@Fuq$p-U&5DY2P8<;oGRBsRtgLD!C$byW6_w1YB-q09e0|*#lz}uz+vmy_C z!XVyUgf*8RK48z>TIf3fMgRghZ&|Aw)7#Ta5Xa}4&}E-~!O&U2Eo5+TG~Sx0-3rr= zJL@^G{e9{02Y`2&hWgMEX2NRt|Ccr|b$>{p!W@XHTCzEc2+q<9unZ?_G1%jhnY_-?@A5{sSRDe*XIX=kLG&NT0ud z{r2T!{xHq&r7E}5eK;G3^DY2ewyoH)Yt6c8GiHsOFl(#19u?`K++SII3 zr&@LDRjW~{$_XV3rOR+qrX?+&1M$ab`+KDq=nO03_=y7WivYe80zU|a zuY|!j!r==M@R3&Vnbz=$Ht>PA@Sb+?j`r|?4)B^tctaGtB^q8412u?+m&Czy;^74y z;VGTq83|B|&hUgTP=Z8wOjmeB5YlGy~xbxp0;|I7dF5XAoSV04_2Z zE-?fyGZd~+2v->f*C>MP42P8%0jn?)4xkv0Py&Zg3Wre!2T>0DPyrh;3ie_&?7|q> zjj^x?<6t|+!)8o?9heB)FbTF`GHgO6?8FpUgDO~yY8Z{Fuo^Y647D%@bub^(U;*kE zoeY45m=23D17_n4n1h)x5wlVHAa_GVe=)l=90OvppRzfRQK^s;>6V^a8)E`khP z44JqDl5i=E#bpqWosfuKP=?(Qiz^@sS3(4?f=FBgQ?L)F;y##$gU}C$U^*L1^#mw%6A&%LLDPd+fQ z5GtS*zy~`7D^Ur|P9rUsu5ne>=K%{aKwJ-AmOz!YXZFs&jh0D==p!4n@&s!Z ztDZi?C=z)?&X~|An9vpWsXvNR3C;_KstrJEjIZTd-v_FKvtAM>83#&Am%ra^LAR@fu1FOURw4jr?*RX9D&Gf;{&o|;KzV}bIN zm@5v`qd6g}pZ%OBDdl*B9<>Q|GRa!DyO~?6AjqzLT8^7I?(fFw2aLydF%#_$QS)+B=f9#2 z7OgYpEn0h%2;mZ8f;!i2zSf-x`?hfJf}@_ADH-z=BW?v^>;lnDoyTar<+NwnKD50Y z+FADLNadM*SR}!X%;NuKGhpE8ZfpbO42Pyy+sjf=9Ben%Q;3BMffLtdDKKhEQ`f?( zSY5zt%c;R5{YVE*KP=4RgROIFMdBA(Law*gTe;!gn?rv@1jLKsj-mCktWJT)z8k^0XtMn3QUm z5mO>*r4`l~6~zQM4CJwn%cm9ZV^O%~n^q(`lup?RHnp^)tcN&HH^!DKN3JN( zAO!)6P@ZPFl=QwVi|xWLue+DS)A=HK6jUC9?(#Bok&3UbJiwg}5n0+N-9iTSFcz$V z8QGkBM8x{X^f*wJA@A+d&0~gs+%me&gi~!fSI-viw46~&TG=kgc#2kzHVQn;XV1NR z?_drxq#FELZ8OA#Xm6^dfcKm-n8q%@M3O_yAzjULg5x~-6S%MS^`K+SDciJLrhb6( zb<%^>xqynwvGg;>Dghh+OkBaTv_FH_jjKGKo6>SXZ(oj`-j-<__c4YTE@)Dtv)Ui+ zle^1ZE2JDKe?n#&BjkCCm9YB(X74zSVxRPVBzT}%gp*g4=h!N2pzqaZftZbo-@D3n zG@?OF&|DtAKhKU;jW1FC`Yd7QkIW9fXE3d424MAK-?X@|RBO2u=5F(~a)uGnViiw2 zb*KmCWnEs+pKVNg)lGaJzrv^6$x_fT(-Wonh#NWTh6*JgVp&F>OjoCtYs~+*%+^E0 z^4;P_fEwA~sy_MO0hQ|^-!RwB5h99+1#hV48i{zWT9;me^hI5w2mvWDrocDhg#)l& zUP3gf>Y8g-joq6KcNDSe+mqEF*{_iDZ~v3x!67MaK?a4VsB)b5GI&5)8m3EXq*jy1 zJVoCPvZA*iOi1&e^ooIjBWmr{L$dWegad8MHFm~ldX2OwtQU^-k09l!+Uu4 zu=DQ9i=gupcE$3@_AMo5y6(;0nyQ;CGfT(3ozpwhZE2sc(un$}$^2~{_ZMO%f97WZ z+>+IDnxyo`z}n7fA3?-yxe1mQE5(-g*X-5l>)nfy2)I$Tw68jKt!p7(jAsL3Aqd%; z>u5mzVA}v#NNKRQ%ZFEwwxJ+8yLSp0$T<7K#nrpydHM19@ip zU})k(9gC@Vi9~;7xy6JQ@A~EYoQ9=)YK|3k83?vp*&U@V9G2v&ndmR9D=@wG15h@< zZ1QW6&SxFq&XpegO(K=XyeXvQ*tqRyEpq`!C!(oR>qDsqTg(uJ$t7#F!)}yD1P`Ti zgX~G!@zAelq(bN+1x}~m!ZdCJ1G?`m-NJg0Lk3|e13e^$I+&z5SEf8;pEdQ8W!7{s zkPqJ~{OM3r zve%oaHZE4CfS%Bl?-JS270*x$;Ar0NmIa?=uozz1eF=JJJEq#_s(-dlZ<{~5x+mdyimD_FEoDRG(-~YF zW=v1hN5y3ShDZ3(x#w+@qD0(;WW!`_FTCp+0F6DQj4}z|e*I*e@Q1*>1y0d+P59ZP5-|0+Q~mO} z2VD^Gmk*0a!*vk~ahWzkkbagaxU|yfPPwt#{DxPdGGG;Ji>6+EMTTqMm!$sVeP9 zTL_@Z8%?g?+tWYLGc?evHy4F&B(jkD9r3K7o_>e*hAg9p zWq5&FaY;GSJK&k%HAYgmOv{QQZwX7&P?JAhIa#Z-U|MEYzNmMpktReF8g>M;FL@Ap z9*ZdL_=D_Yw1Dt+Fv*Dr_|vHQ#mn6d*HCHH*KBP5VsWkKYs~{wz2P7$#u#d{*FGda ze|!D$Xw<@FI}lkCHC>>QVU{OUqos5U*cg)YrExUYwVf5*T((m%#<`Tjyn;x7iF4ra zFWB^*58qxr&}JK*h4tU4XVzd1*6kirE|mi?!@k{25jALsTzI`!Jt@5NinL z!{H(!(89qN04yGW2$dS9m?KWWnXs@7@YOxBE0da}0N9+@+*Ii5;6s~?nDOl(`Ea#? zBub`H?C90VOg4j`giU1Yb}VRc#uU6o@9heC%xz_DlYF$E!meQ%=y+pdiUC){w&vhO>cu+ns9om2R_%k~O34*=cY*Dr5+r>e~rCBu*S(_C8nX~U8 z7s5~5v}!8O!8kZW>f&wBLi%W)ARe{>)=*yq?*HYrSb1gaN6R6`eww{azNtcdeu^!NhQtEO2j?b=w04*di!WD?e!bLJXr1! zC?CxG(!TLnsTQqv7>FS+SY~rD)I;ST-H)di33gma>_{>_DuP?#l-Y#qhE5W+5p?jn zMbT4GLxk5sK+PhbuanuLhk`PCn-VuU?z0!vYM!m%4dz|JBLbY*zE$aywyxPcW9@b=u%XK*4(I zh|f)dX(4>vA%rH37^|AKYWckdV7anI-ZyR%Z7qY=;QN(A`emyEWS+_q{y5wP@nUq+YCr8X~&|JzCqTycT3Z6qpQT z+btV>9x8+sda)yCu5@i4y**uZ${WJ;c9MA4< zr!I6VtkDbY+4dY<#7=s#@$4v#x-Lok=Dx=pdLP@8)6R@Nn>syIH)i%mPx8!?vvSTp zKUl=GpN|UbTxGF`~iw$R4 zdCCi3PDehb<|o9~DyJbMwh0Ok1>10U}s%kQ@%m~REz7_Q#< z)XRf^=~Yh!!9mc?nI{MT+=EgT2%?Lro<(7`7LlMywZ9Y&FvQ@GM=9-ZeDrkK#&E4a zPzV(wlF}g>Ly#;PEW&{LSvtw_h(iX&a;kwLS;(Z{y47#iuVY36ieLu|%c59lCOo)U zL*DT4NLACZ5$@&^Y%DwRfr`-TUU-|0(lL$=9kDT`rYS0^WtfzUh@N@oo}1HSq5<`7 z7bYRnaBnKMerdBYovPK}rLt-ai6-91bDdfK&5>KG+b<{O*_quIQb$9-%O?#c#XFwL z&MHSh#$`WYsqY!DPHcJY*5+(7 z_JQ6Hwzls36b3tAt8}?9_gmov(uO>ZH9xl z{K%iw=d4Tv2uGg0a6?hWI3w9h_W2i)49bdlaKR^f8i}4w*epFqt6sKAGK5d+QBO? zSf{Gmbd+2i_#G4`MtpSyZOpyQXAsl;5IKF1NKLcWexR{jX|SG1(mqi z7s-ZiWiy^H6qf}>Z^HvN_bsT+QWP~MOD?7V;;X5{1)MymH&i<&`8 zHjM%MU}rhm;96VdLJ*b6V;v0??9CIC(rUf8Q=PQZ*$`OGlCUr&_T`mg{%%3a@j6xJ zZ8G#3HeM9hE$Ev9N`i=vM_YN$670rkCIzM5SOWzn#9>sj%w^ z0n=@ap|r01K5gkm1u7*=A@-?F;woqAE#+MXJX<|+Z*OZ=8PKJkxUAbS#1xN5c&cKP z(XIavP##l?t;={xCt<+yXabo3K7$gi+E&qtI{f~$q|d$1P(He*kGGBQ$RH^(jI}>! z)?JR$Jul~@cSbIlYMEdg=9cj=EkBh7FLqe(BQNTE=23mK^eb0&e62BG&4&6M3N_!PzQMKy#q7CJnBN?g(3^c#_>@jIwlwtAlo`EJ-Ag zMnIGaBjm_cd49yzNVm#8?v%8X<$E1s>TIDrsad9&oT@}DD_2RCuwfKR6XQt7DZ#!m zne)`)krQ=D7r2a!x?vIZv&KeGp+yw+t&Q=TLA$o!mGN5nVbYIBb>+`|NN>JaPT z$*dv8L&8hm#bn@vTgX;6~ znH04NeZjShxnRU6EL`&O$^zv-3*-F>i;Rn{AI0Au+!T($bJMfoxz)03b_6EjR}Agi zmm4X&>T!w=NvdvNAX>A03^*O4Hkb&A4o`^;&^CbHqFt1Tl9c z(Rh@5(nAwSaV9{TkuJ$qg4ng`2@8}12kzO%P=1X+mzlo_tHyMpf@-&?sLQJBC4Glu zuExmlhoCDYy8#0?RTg-AOnyI74hy)9MX3x>lUid%hrIHfdhHBqwml1`f5gAS1657isq%!e_bGw;A>mE)z&N4SpUV37 zeFTymmyR270M5f(-2bhZg?HYfu)0RB|>%qsXZ%Jvl~EsNzL zv+rZ*n$9kiR<=_gdK7rwGIZ}u?eA9r zaw@a-Ou)2^j+Caay}s0EdJ2zI53T4XeCL5WU$6S8-WZteXNRza3cou|FANaY`68GA zw6&NU;Y_F$nok{60=7~$pHRo1*eH7rhBsGsX9=LC7D*MmDDUuy_7p+aQ~-Heyt(ti z8KKVmojUzIM-+s6ZUpGDKVz%!b(83{Mcb#QQ*VCW^yXjMIzfA57MR(G{6+*O>yN%G9{zwFNucDG2)Y@)FWeam)g@#y`gnY%VRVffK z4QL2D*D__+FhyN-I0<9vPQ83hSjN_v!$VH{82>-f6fOkG{}wfZ=rWrNhtH?0dU(v{stK>zW}NAVpw-fRS*) zf|)5b!>VnF>1G0!I|xEO9}@x*I!XCyqojTRz?iK;T$YCR85kP~-Dqsc9Q;$3EF(io zgxxJouK@-cV06NJ4zzXS>b3Hbl~>K{E~WA>u&{6L(25|lBjsyV%ezWDE`6|R|H#&wq8Sb>ehCi*)iK)>0a%ubXIL_-G6!;e9-85&zIgV z!n^{XYE4MCeE^xSgXBBKy=AQ))V56}lsY&{LO_aqj2ZBQikrfu-b6Yd9g3nLECZ9@ z2v@3ETY+00?x9EPWvc3)-j2Mbk}`WmB?nZgzbUrCTN_W3fA?EXyvsUXN=8j^+YG3U zVeT{rO67)#(gt>MFKo zndj2L6G{s*oU@O}Vji8TwQ`ZSf4^ebi+*F$PBg<0rEPD(w6d2*3Z9}!qJyL{gt{O4 zS#XLpAM|N&oCWlzrP|(_$|&=s?~bb4&cEY(e3szE+O7=D9rB{-Y952QumqvG^MT>* zrRa85nOV=4A3HbI7~&xnDSo?zaH>=80kfTzgYv2MmhA2`Kv{vjr*^4;B3CMO;nw3+ zv%pyfSDsFuxuGfnWu8{V_S+ILoq9-{EpX*7V2tqTWEEX`1eX{dbxA`H#}^j_^(Qa& zfoq=u!5(yG+G=e}3^4DO1lDFO(}Ctj(vl1|9Z^F}XKdOABOitSO6$$isY;8D)}K$N zI&(C`*Q(E`W@UUA*V#mAky0sn5~Y7FUEgB8UEFk$TJ4r;Nm}{i+(HkFI@nW+Jkm#E z62#(qbBoIp({n46nx0t?>F*l)s3qsR=5mx+5t9tnmFv?hFY}B(6n^J~vO(tSDOy!*Cz%hcuH*EyoTl?nIWNz5=!vL`s1Ws{|`Rxq&bYxgtvvL8h) ze`)=-e|?u*1vo(unkvc!#_6J%PFUMIvmf zNq?~%xGot@$|GOwqQRGh5<;XoBpA#%=+hU^s)%?>WXUZ-OF41bCFo0)Kp-171wf(J zqNe5IFUDrlEhT=Z6p6@OtSprw7NeCryqh0#oTnkCv6KzI9YE=eS-Wi0`HK{XcVWwV zCBFv=I}pjs%&qTDR#+vqE&*ekz(?4?O^cfJNTK}Ct&pw&K+!9hD<&y^2~pX&I{*ab zMTQkmtUyyzcp&C|tqG|{LcUT9+X<2>O65m&eT6gS*TyIh;R(Y%jF0UCY<{SS$P7Rj z-3TL+wOq}m`YI8WEMbOI<?x~YAm2gumx zATH92C1?qAWa0`XD37+CZSzGYpC!~VBgn(sRtbR~{?4QbcM^t>*b>ok;t7%uzOrPR ztWqLibSFlt4ZqXz&RjwkmKsW}yLx0l^f7h+GRmkh8evVqM`;O{fFr z6uL-ldMJ}AdsK#)vIr=GfNNk5y%2Vgfptfry#2rF%V>5{HOrRf*tl|2pyyhLOVkDJy1}kAs17coLW;{ z6~JN=BZ-tS*t;QQ{53s~=DMykca-0@=WKJ*LC3*($)4 zb5!M4r%BEP?UH+tr=F112pAo(0Rf*?C@VIE0XIms!oRmq5+cHOfFp*W49vXwYZR%D z;z1`Y90cbiU@wYrCAa|fCNq3NcwJ8ZHA<<(z7YUqk_L0n; zXj9QTZ>0tEJJI3Jzcj!hoS^Z92^rgRqu#!2Ln0sufqG%}Z0!{0iI#5uq7~NzmiqKv z8Uw2v>lIBkcA8P+`Gibiz{%*CLx8ZUdZGb6ih*<6$SIk4PzWIeOle=DK+oCH0*i~w z5Mxu6Nj8wBFUc&4iz0e^9)17eGG^kvH7CsL^e9X3ok7g!>4_3HcxfFMM#>}^$9Mth zw7ZyxoDfHvLoHdMZp1}Mc{*i|yeP6%Y8%9@cIih41mIkfKr`a5+|2(eb4!4W63V?)x=^ai%SeSRQnoKA0n>obPlN?=QUZ1`qKl z!}RZ{iDrxSbS@$fy7aBvwFl*MG_n|@cr#ffB9LtdB1a|p{pmj%wYR&k_r^jPPW&bC zZ4i%#!>@+TFre|W4h>VarUeK=+8zLtBOlhNAcbgO;~fwozaL||tM|wBl>HcoVz{RI zw~2nV;ag+j|K(R~GmL55{P5uoV#+r9zMv3wB|gPP3_Te*5(u;dR2P5ST3vvKVlW}y z3E3K^smWjY5W4E2@Orp7LRxm3D?LN$81_SIA44tWF zp-l+Ja3@{pq!<)G&rz&p?V5jn^5-Z2{KU5~Jd*bhK^8krfPVnaJ3Pm$4@GUj1DA}& zjM2`Kwzw5D%uXZmsLLZMzc4C|>oPOD#^@0h%%#Y}P2mGH_yc?l?8;3FYz|kKQ`8>r zT>Ix0&2$p6z|=V`e0TZ5qUVIe7+CthN;k=?HshGZ+=IG}q8SGybs#Wup zuCmtmUxic>@mHgbSQQ>s^Mu8)2?GIvyW^YDVpZ$jEA+CIPZl2FU;5Agb}Aq{(CA>XEW=pUR@W9r4}E{> z@N%jVh0}+YoFglN#9;sDCoQA*qyktwRIzj))0C$)e!ozHUDqcV)4c3K0+T_ABct7q zj|_h}cIw07k&i~dbi$^dzxM30W|`&R&u`9B;ngBQ?WOBye~o6H33`JmZ1DSac$3_g za#>-*7dVT7Xlx*6MKK~zNv7~2%27#nSZzycn?HDJrPg0PpwG?KVSTzv*RK{wv+G=v z!buE|UIj;n#qPne5m`WRbj*2!3G=%b$fLQqmpa0xt+u@5gXa6*m+Po1wac`OF$4Ux zS>JE$e;SJ-NWPD@$yMRHIjWnjV0Y0ojAu=jd<{+`Xn{L6a>kT@4+z+2R^+`WPdlPI zo<1FX+PMXwrM;%+gVE}(3y54+`QInBMq@v2r*R?KX4V>6)%?#gpy58c<54v4VGQ?? zhW|vN)|w)wEFzW0gfkV8Z8jz-+&-kUO-hB4^|vaJ?8v$uJbMb_-u z)8X>LrOFBQJ9IqcDi`1k=bC_$SKCLX2q}+GzxW(DI{ME@Het%k?6r5=dI3%l* z<$A2o74@aB2g1AAN)@0et`w92OW1P)P;X?Beb})vY(R#IYb}MtqMmE{()|}f)$f4jGj_iPWX?b}gn*S<|ya~WT=JSmpHgzp1C!fGs@HOspHEa(Jr z z$CUP299L6)e~mW2Kf1W8h18q~wkdZ-gE;?shYUYx9+ zsUy$mTivG?zC-bhkDu1)2c^&hWL=LbNsn}1va zCq0ql7w5A*$_&)O^las}AK5V93j2r1Im|?7sbSVxxrf;b!2FgyToqL3Cb1o$ZH`|V zfmp0D(r<_?}7Kf1oUF6nEmnLF-HfW!}oQ4bryyl|=I7cpwgvzm+%gD3$dh zDa|Pv9Y(K0G<;-I3qJVfnrip8oW?IO70`Txm zLQ8mUg2E-rFei>-ux!CP-IiHaW3*xecr?PbRUHcVXTB9K%I>8B55cfzBptJT8Ijb28NsV+@$PxjR2XZYwj;fbrP0)y3Q{utkQA5OeM<;HV- zy=3H>SU?J4GovNGZHxWu{Ip!p;d#81QBP27otKz|Lepbwt@gBAnB!g>a6&HdYLb_5 zjR7*Hd$6Xcy1sf>A{P{he^|{NRgB;h= zj;%}+Lr`&q1*X3@T-&wiNWf0<&7N4AJqltSEUN2#^PzCv*O=1^LJWNDmGd;|QSmX( z2_sW%uf)`bjx8g6+SVeAaIlLL;GhbW1aAP-Fz;1a(J@Mue`-*URuWlU9N8o$Z8o?0 z!8N@~k1UpGgL3>+m8$5NRayTJ2dV-BRNM$k)Wed0HpgcKvsC@~&Ht1wT}gVF%BF&vj5-#^Dvtww$4?b*ysQpnrXE+s!!!& zE;QHxn}!RCiWFvl@A(hrDD!U*RL}JLo$fsM-rq7=kGsshM=F&`dq$q(^+;t?z3w~^ zIF@Erpugk8wON;&H`x5MpnCGyrixFWwrmQ!6I%nLR2-)9h_7l$xR1w?*dYw^_*0zQ zi<8k59`yt|k!L-#6r}&c9W1e*`_xfTb$T>we!bKWkAE`vfAf<0-|iZGLs#3pvip|) zfAhGFz(TkeeALc#!)ZA9F~K1f9E?$<`Vmqq;xr^aM6uv(MBLfKOU@+&UWySUMQngW z^2NmFE@**fSxq;b;MiT`;CRPH49euT>{zqjGs{iqCtY{>@@PQNkiPd>dvN8A&j&OF zFt&94=Ob5gc3J?$E4*+X97vn%NAJEBW~Z`C{z1lcuc#RMb>5DoA~)783|+3H9IV-~ z{h-{fsK8C(5tW?J({r`j^~>!4yh;9Ysk~Wz=pB zq||26R1_sr!FBwWB37jgw^FQdLadR3RC{JbL3gYXE5sqnmr8?G9;qHj1GtbZ7;8lp zVwIH6C}NE3dH@vcq$sgMs#V$IjQA2(h4*)8W_e}A;Sfd!z^Y`qGzB$ui~O ztcC~0B)PyJOTgVPp3ANDFCW}r7El>DS5s={L>L!jsL^@5Ch z0*>qX89{fk9wAq-db^F?l;f0Lr~{GHBd!|PX6j`!af1VI2>|qqNzSyV7=?ACAjAD9 z3`Y)8d8D2_2*SRE!P9+{eB$GMl6;ROZK4A{@qN_O5%3=oNf10-p^PEL)mRcyR((mA zW<|`pl+?FaAKmJS3UvR3R-*#o2@FZn7csL(!hD{@lqA3dCuFG4sA(tmn7wn32c8>| zv~0J-w97C1hu;PLY{W-d&cGAeQheqWTeTWF7dY8%Rw#4Sf%wXU{fOMB7iV~`&GwH7 zk&&d9#wc2;J=z)AE3*QC=d{>pe9Hp@u^Cjf+(V8I%L31L$>zvL?WAMU!?v;`GL8<( zL(M}`C+1CX8O4i89g$o_woAeM+L40mvN74HqpV4GC*h@f?MNDmBbCmP0{&Qre~nX_ zq#gUC>Kddb1oN|M7^iR~q=fJpaz;B$`2Hy-Cxug)zS6j9J7yE6=K7=$MuTZbWEWb? z^h;bo6~QYzOwo^+JvIJ)H~ z-OVj>%)l}zaClf>dTz1fDG$4Mc45VK5AC`T1x*9ZIb|AKu*Pg0$!s)!8JwRN zC&h8!V6jvs-f#mc|Go=iArFjZ?Z-75x!*3q0f?0RXZBbew>aMHj(MAs$v;-5DKno% zO=>RP$8B8}cngG0zVrIij_6e6$oh`|&H^~jZQm#*rn{pus!R4O^6U?N@B3!sUuV0> zs6QK+Bp~eLYo6ai<^Vh8(KEixaSZ_OgU1EeW_!IJI`q*q|FPxq2g?3~^w%H|-%NFT zvzNpt?S13MGs9(66c4q)yZ~Vutopg$Vzvy`Lr%3@`W^RuDSp|1xc`=M#|Er>P(9Yr z0Z3DLpEfFLC+UfXCLj}%=7F7bR9h!`s$9e&%camwa=wzRa?v_i4Pp^pHeJZ_z#Jc) zLiQ_`5=DmHIE&gIE6H-z(lV?!U$b+AB>AYl;$*US?Fq(Rzh=K-CHd+d@(~uu3^Wa5 z|7j>4ndYjY#R#{JVDeZlYlgPZ*)(8LFLOy{b{T$wa_iW8xvrceJ7Jg0tWu8RQ)mm%%jdey%Fpyl zXD(U7O!vy15b#A`vLv0E=`|r4S9UN`yo4Yp%- z{*a<_QT-Lu#Nh;|UPeCKZH%6kM`Z)VvrN?G&RAj@EfMlJUS8Q0 zuMhD$!{??7;yfsU%ReV`mxWqS+;i7f6Sn)v?`{=`YQn4DQ z8?4(XyZ}u}R*vU|>=(N#NU=T{Axom-;W10g=9bk1Q5zECAVLCUn*#_2;_6ZIj9760r1htHfIZQi*#H2BM zz_jR~(x(abXb#hnw3KPM=aVHQ@FX&_PA(fSD>*o5Vyzu|Dl0vqkONVeVXj@}Y(M+}vzO7!97tG=#Ma$BEb=pR z0>THI@83V^Moz**#xeLL=;)PhTpit!lhYCXEjPD{SQTa+4!C5y>5a*_kq&u=%O8dg ztQ0Go9HuZ8%<%IVTeVXmR!lE)jqyvfTLiAr##;*WB;|3>aF|jT!{OI#%AwX+t80)7 zg`Y5?Zt$nL=l>K5X)Ts_6J!(#^OC7`?$aJHZ2nMqH`PBoPs7^&F$8Mzvi;S* zDanB;+$`NWKY!*A%8iSJgi7HO2Z+1T0 z(LBM3=&lV~c)B%63MotM?Z?_J5j^v#z?(YktVCt3nUd}(?2@O0{n?|NChS9p@836j z2`*PJb@-^DN7=8boGoH*&26-CwB5iZ+Na*MK7KlenTR^#gU1fl9$Y?{VlPI!s{(bw z>K{)58AiqizngqHr$#lSFtBEJkQ|#`UE~=mpLO|$0xJmXjL63cBa|6zzw}%7wfA}{ z8lr^J12Z`Oekn{zEG;jjMwDOJj(pLl{Nk(gYbZ?Vs>A$>5G2>We&_vSQfiPqND-uQ z<{O#hdEpDH%EcI2^OLKTRmt-K73L`sON@vppBP_83M;jWEGB0~cg{`L=v$KHoyMr~ z0Zoo7lW>#6j*Vq&1uSvItO>^v%QLcB+zdSOIfdp`Ldp#59P7-Coe9E9(zc#Ht*0JF zbjZHlS>c^HBR<`6wo^5`+-F6lp5viO2WjpqC@m){ULJEOH5VR8z<@lao6vGRRQmL% z-W@K#-xejdzYBnU$(FhI2)KNIY_UTV2oB*>AP~^GeEY9IO&4CQww5lj?ee%eyuoSv z&h55Kq}Ho>lV+z40Us~m(8D+LxLp>9^a}eO?zf`MJ(W*Zeh!oTug`Y&8p8y9f0jE^ z-(^)Rc}7&7-L5|NU{#XLj9G*ExM$TYr>&*5!PN&?>gb3>cpgS6tNTQYDZtl{R+#O$`{o1q+flVn2@4TGXf2EE%jk-^@`3(u51YEq%cilR#t;?>W=x3VGk?c$R!&BxIR+~k+ zp~BqtM6Fr)u;!R0I0!Y1z>B7wG)5||t&Ogsr;Q019MD5)j59;h&{`!FgJyt%H3(bb zHyrnB4HF*U2gW9J^Z7dfxG1TAXAwU5eek7837G(VeUtVScZrX;k0eYSerbxaT4!ff zU6lxgmI`pFFs@{fO*y?kX_Z2*KW`Vofj$`7LEXHZ|;3^Pkg? zo%e;Qakf}s%!B}_iEPGD_dpGfd#EN1xe|I6Z-)z0?{hvi{p;KRQ^UXrK*B6AtciM` zVvv~mSd=$`8;{-utkT3{6anDx^{0@{Q_K{{lg}`Rk3V1Hk1<2IKnDO7f-#f(;J|Xt z?ee>7=!aV?HV%P%vk20*nI)6iZUW?&khu zO2lY8NfUY9m)^TQk;#y80HCn}Xp(?7o~{85Lv|UK~AF9GDgVvWJk3}ZI?F3lW4GM6VZxc#G&6n*&fKBFGsDzaH&6qI$FRWNP&3L`65?Zc ztvHx&x^ZvKeqjn0I<}>C{T|#`C;QRPp8X4mxG(z;&E4p@uHr_m4fgNbt+_dZ<$q3A ze7PVexAptESnE|u@iIZ%pVt^z9t>*kLEEm%SV6#RW+iL6@WH_43}y&^iA#6jphv#@ zF~_8^b#wkd!Nc(WnR%3xc=XRaPN1WS91xI8_8#9As8TRun4B1n#3~69FI=|y)5+>{ zxA%jFTUK@3PSzA`X0chKmv{EtwyA>(wj8TD_wNXH!=hQjV<-~Y<$8ciz3V2D3cPwYGP?}DFLw_F{T8uT3)36_4s2)rRzI-6wv%stm#u`ffL>89khYr}GVF!~Q42(8zL(`9DWaGVI|`ZV$N zG*RdIeD9&p-PF#$u@6^Y{{9yq+ax?AJZLhuYJJc$OI#EYQ6!!P6>y*^qIVCyPiA+V zi8`|@?{4La$-;t}tI~J9A9!E1YGy&<%E^_e#17P0)EE=yeTyl~%c=v9JzbBj<*z-& zM`7=*A_gE>y5QjbtyNbDW&EIO+r>jfKJle1kN9BPxV|Lv5e%CXHVE9_cfC{Zxi+c{T2+IwGcf3G0? zhOKmU8uxy{e&9X6$x#MH%$A=sAci#O@25IW+Z-Ybs>F{3RzB|LB{vpE*`N)v*Zp|$_jBav@4kbaiRFc4MZWb>AG&Vj zSE3BU*8o|lJ(50*3mQ8~h0^~st^Frfhs9oYr{j*ojZ*_9APMpa$9KDe<oz)&_zeB^A+U6)gOlJY6GoFxdQ>u>m<%QPnVH2BZwW3RaJaYdF0&SVS11n=p=k@5W4 zP$e@ep(A5v&cdB$W#149;^#E*%H^`br20`0S@n=DaiZjNwH&VC!N=2l@s z!K*e^3!_cOKB^x`$`CN0?)K~Fxtmo^a0vkjam{|7$Lz`N{-ZDw>(-6A28Nd2K98!~62DJJ^B$htcVH!SKt!He;Y+g7<_3i3 z?U3hAKW02jj7@wN7aGvH0ZL!L}9*uW8Y%E^MXS&NWO=%voZykudrU({&p>sEIu zHSw(?D8gMRmv>SEqg{809l>zNla7Y`p_z`3yWg@DX>YRS|{5Vw&k=4 z+P=lu9rldA^KIoieI3?-io-4?C#?PX>x?##H$~uXv_OUh*GM4G^KLRbc zNi%IK!E}ko9@!odnb~8b$6o1P(Hsx4mC$Ng)@SM(pDJoh$TEB#FWQewXL%!_)Yzjb^|FY7UP@*fb8{uNIox3#|;`8X@Yo8n?^?A z!D$iPEJ27MD=i%Ko~p|^>ak;eA^mhjd+{#SBd{H`YAmAu9xWK{c$y;4_6^cP3PaLn z1au)aWZ5jOY>s;^igc74pBV2j(0%i7SBt~U_5M|&IO|ELu$0NKkG?RY?NqqLqB90u zml%QKq2QT0wx3e7?9!cxgTw-y9F{O<0SdKet`9_FCrKr(grj&Q=%@tbXkx=_WQhr_ zUnO2^CCq=bn9@W=cw>x`T-zwymSKIuT1iJTgPKZF*Ee<+!qu^BZvU6;BCWEEmn@B{ zQ%KLqnYeAGGHc>|MOD`d6rxI+SH1G0!o%<8qfk6I84CHX<8bZW z!*NiD>iKP3W&N|JnUViU_N^`seR$RLBUkwFVW)?bWEK!TnEvvb#~R_9Fq$^rrEu#A zfjgFaB-Y^?<(dQ5RnC)d;R>AJ`%XI!->Vn-JDkfPW*j0ON++hDOUb07xNbr59BgrN zv3rPr=lBl)Q1B6JXKU-Ic0lPDw|zNJ%T*r%4h3rSIz_N856ubA%nHs91%f2!X=gzF zIqbl`e;+v&bHH@dmT1G1xh0a~XtAUOF5ojSjwq491vO;A3D0F_*;Eeqk+j`3*kI)+w0EqATTN&4nSD94g`rKoX05Ok4JBE z{E^)fZVzeE?`RPt&|Q%(*mXEoWGTkxW_z<9;^Et@bbxiCf0AFs91=oK*|{MeuKrhL zixKa`}^}%t6Djps9{7dJM3ox>)jLlvw3C2(`@9Mdk1e~+)A1o z!=2X=!W;f_x9f6r2e0kf`-x>M|8fi)Ue}k@i>(2<5J0k!*1AsTmNbqH&JKa#O4ZiZ zzW8E(23N1;rv+UXa0y&JKcg7$Yh|OBauEo7Vxy=?m~RTVM0^2&g)m=K1pa6RX8dWs zkpJvv8jhPCAL7k&lH66&8Gz}wB;Yq&pC(CFsW?U6mcQ7}DO9P|&Gl)1vwcgyU=p!h z8P7B4g1Ar1E1}OC- z;&pv`T&ni^84I^+=M-hHvJ=>?$}aLbY>fTsHAf~Z+ZPD83kedbIHB1U!W@!Hlzt{> zpR7y2Y~<3^FJyJ=H8O0o;ka@$(;Rmd-jS-FMpOL z)}6AFif1w=%Q{u`P#S~vOw6Aq7l zh*J;NA(Fu01+k6-E*mP`8*Wovz1~ zN?N1U9ap%?ypR-9hfdd#D2gHDPy`^=b%9PR&mmScCYG4(QI~6VYrs#lO)2-AVeA{t z)`2bV8)g~EPpDrFL*JmlF1(Q1^L2wbplkM_{6&~c&cxutRY!25Qa%js5}ZEoRHl1X z?&Uw$^h|(p-UuX*Cn^obKs9%J;01!0+8B7h1+Dc<=`@FQYdF>sZSTXjaM%pnn zM2+zGxDgepPg5wc^o&Agddkoc9RI90N)bs>=BS;=z8`2_o-USBXKBZFcVNWmj;JUw z-DEkQ(Ak-A{0{}XIuCahjk~&-S@evHz<{6=3-G!>bzWxbRBEcnY`4-HQ;&*N&D3V8 z9)LqJ+UTc#TmH;UU26Y46FX&Hmb)UY5ZinDXU;lE>@NTKzP6ExbQ>F{aLy_;AP2be z2`7i*3V_s=VIJj)CACLDMn>i)69&hphk_XUpKg*Kt$^#|?z@ijaraPm7>*p? z=SDMGpLItNO@i2aOf(mc`s5(Ew=4}#SZIz-^frlR7ya#KayE{(w|LK>m53OYKt zf89CDTK*8h&15_hn1%o$G^x175f5(`kFowhko|Ea&f$au4(a5O?yZH}Qf>Qb4Q{3? zzo(v0*V4P_IlBtKh^a?nkpp7=VqU+?f#Rvh$3YL#W0W%iHv)oe13x<>0)FMfUt31X z#-fP)@bLVIqMrgj^Zf9lh@Zkj>u1K97b(@?A|A6$X{ zZMeFi(-TEF4xn(EQu2)d>ht_7ztv^Rs9v0CZ+46pz(gCvtvI$e@VWAKPfj#DiHoKU zhti>ewz%4J*wHa;Ere)AQw|8g!5bQ;rhTTd)cNjR4fR@eLqq8Cgz@@%a8tSizZ2hq z8^B+o0bIw+^!QO27t#UY!gj!@=$8u9f;9XNtPr~c@94|Cv4}JTHWU|{;^x8n9k=7` zusa<4Q;h9!+fRB!t@^E?c31@RLy&jetjq|2Fk87H+`88kg07rbS??bA!Zp~M|JLtq zBZ2ItNz!goi?~6opz6AShAT(p;17=(wH~3k$W~Yrf1a5oz>l%1;V;SJM(MLD-W1V zS(bZ?&)JlBEQ1Z&ZP#&jFXQ{pWxeJbgaRxX(^WRhrsP*{NX|@^oCNmo2vZK4q{t9Be4qr)=edkLEEX1u3Tj!`9s6g{F4kWhdR>WT0Dx;NXHi6)mB!P)Z{hx#*p7nQJ_ zIKE1^7k2T+kK3P{VVQ`8m>=Dgk^RVwY^-V8T|)>iw-H1(-6F|JG-_Z2O;z{RE!!)$ zY{0f1pSH0*Y0Ci|+Y`30Uu)=CI-A4Bb>P@Wg7MZajeZvmOOp`mfu6+K#R>JVcG9sl zK*Q3hMB{KqQ?OdCla^Cb?9J3PNu$+-0|H_rPsjt=IY1UBBTK-JS^>Oy`9$~958X>7 zi`o_e?OKupI{iAq@}6DrJLiYVx_dwsG(Uc7{Fj-JNVZSaN^2{7!2s5XLwEUip?d*< zfB`00tep>h03am=@{qa9>mejXHFv$gpFiYTx&fdHcH}+p8ay<$ zhZkDa$pxWG3maF3J5If<$U<*@k$$3Zd(n39BwQ7(n$|&^UySX7;;Mk>#~~~()`K1F z9l-O3=)^R0o;m;NRNJiELRy7+LcJ+ZXl%V)J!^&_J&11zp7B7yhUq~w1b=1<3_(E# z0RaIW8-g+g#Xm%-im)WBh7(v9a?ez5yq;a>lwW zab^-B;rJfhO$cr$J{;jP>dN)59YKs;=G}8ndu?Maij8UPZ_{}I3 zau?y}g{Hg}zmvQZzxAxZn#m@LiEN%HJQjSQ;fc3o;5QaH2cJy{Y`j(N8Zi8At88=3 z#*f^K7~3DtC@aT`L+&`|ei3B-*PRn&^89!0V0P-8eSl1B%+F+{GZrsl8qP2BEEcYv zbu?))ZOCC{vaBj5St4n*p~&K2Y8+mWFDj1w1>71Q1lW$97DwDziG)5{e20^V6Ma9L zP!sfmT6(0+_q+0jlYKv0*dXW$)!kuCcsF?gIG3>wK<*0196Z9?MIgMa#>HGG%DS+1 z6sPVFSA1f9If)rj)i(i`3o0ie5J5USG1k|o=q&^kjTDbIhlXPq6v-O-a%2qZhY<&L zh>B6vRYflmu%no0x6vf<^(&YjO@O>;5EWP=>R=vL&~OU~RbRJJ&c<3e|YP(tp7P(wx>yj`aLv#BMs<;RS`^YmapR7Ohy zSvPizcXOIvu6hZ=Fz3=LQs(2)R$`U%F#-VZ)N!tL{`U>m}_Ze);$* zBJ%U6B>#{67{l`YXV0?_zmq7t4DuxY#M!bBiyA2h5!wIhLlOkBGdM<{vh*!shZb$p z`_0N$GnDjS==gwy0Uv2f4#(vDi}TA5$w59EkSgZ@;huX)C^P!Z;0R(v67(8ww2wH+ zCzhph5GB=mEDTFhJH)V(e0;^+XiX6%X8UaTmTmD%%bCnhnas&I`(-D~M?->mSzm+a zah5CKWpzx0LPj;f_e}Fqf2BY0#sCfiM*@KTVjfgA{$?McZH&Q<;9@p1KGW&pXXr=i zXTs^eW1KO@nDM#O6#Jc@H3dQsF7{ZQPAh2RX~T@nDvBw}VmlHX#}zmRF-MR?47Rq- z2N$_7U7iv2FWNUPAx`>gzxm-%08&GR<)}lJ8<@| zi$eqG6BvhE9XLM9@o3zr8uix~j2NyZryxg@LkB`_w1H82^EA&^JtxMuq$llbeIdnO zVdo&R$|H#C-T$sQekJS2@XC$Ysj9jK2|LEy&L$uS9i;Z7F%FLN2X?qz4YH9>aXY!c zN*4~C9rL$Ogqq<|u-R~w#^p=-+nh3KJbzBdv?khLT1$+d7iZ}mR3rC0$Z9B@D1X7s zp!8{PGsU2EV^GbtD?=Q|=f>a@7v}>G`AJi2@n8HLD zUhvKIBC{#1ApEP)$vK z@d5_FNU>juuXq_e_j}j4bgreuy{e4=pCY_pdAr2D+FkZtwx4JN4o3p-N%-Ozr!(Q7 zxqAI;*9wIr12g;YTnoVOVD}NCea@=?+!G5WK(Zk2Fe?by0`Y_NhcfXtQT@>O{`jRV zTi#p_Q+{X=}ULe2;O1pQ7jzFa7s9pkjoTW1v)3e%IO%fWKP8lg~Q%Y*ga$s{QtA@X|RDpVg`ri zx3}PMgzm+Y3F^jWi=bya)DdE5>j-yTZ3E*$Ym-0x*{LsrH4D*KY@icAp@k0r&-K<# z{C|TH*uh}5I4JbQG86(m%F%){D6%tUK@RluldnJ>@X*c2p}kX}l`R5Bw#7s62z&We zJEjhvegK8F9(_E;62R>~p6V(9#XArkzJ4gQ_Pmn-8HHSJyc}viSi3;2;T-6t_IP>- z9y`{+t=FygBHqrDm(TwqcZ_3GqxjB)-~YeE!)Hn8J~QVV-$AXNpuq@YY6|Q#5$eK% zSvg^%&p_PazR;zEe7ThHk+j)=MU z=&uphI|%F>bQlsy5Z#_o2;JJ|q%DGLKW#sVv98bWt+p43GonRdZSzc3R=fYnZM8VH z*48NOp>JX+Y#&N{`}za`7#Q@Tk?_;|hwmHjx6VeV`(F1s)G0xUmXV|$Dv}!gl$UDJ zP_ubmCfn+`F+1J~ne$ukH@-i-e-ey@thG)vNl7yFN7|clE4kByO zomA)SQ5vBK39jDa%KX~&<_Kdm83w`5_ZWEPipxU}`_+1GmbrH=M)J0M7q~w3JqD}V*J-At{v};p@-%n)v{hM#+7&qcogdz z9hW`AFRM@s)|dEgD7kfXZp;xpTm~Rg;E2BveQfTF4JCf-O9X&Fl-%py3wFBi%+2fZ z=m9-#O5gxwQcqr9PzLDr=*`Uqz&b@)?F^jfXXo&4BQP3^Wq#~@ssR}vS$hL~Oa2XL zO=rw`uc0-z?vE6@%^~pes6@tr8)4%*7H46$x)~bawe8PwXvz<>+|i9roDm2?L?(0EV|U6ss)hJbmBJK+jRCwO;@KdVIZA zhb*yCkVyXiF)Ngz{#m6~AgO$_eOrHnaUgEE`#(vQ3qXZsRNbbY>nTJAR|I{yxlIqO z6t+=r9$ZT77Nsa4d#;P_?r-Go7)z_ErYPL}_3-@O4ktXd?;hFf_VFS#%)4~m`#XZ1 zrv;}w^xh4cwVfp=sAQvB&vs`aAi}%=FOe;rsw(Zj_C{38Z*ys_iXj2dGx7}3zh_c# zGspnCh_xk^D-*RgIrPaW^WQ>SGr21*H@*N8B3=X0feb}|b!~q%eU!u(q@ocYxRSKN zl!p8D`uP2ewJ)C5XFFZCsLk^^XJ{}2Lm zu-p9k>g!n-pgOT$ZYa$R&JYOFgR>q7X9_Yh1ikU&tl)HkAfxf);4DFUx*#);pMA^O zV2N##aXj<(&6xyZRIP4xt=2lij6Jt-I~hIxf}QwS?gWH=NNs3r2)dpb9udw&LFrWb zq$xDk9LHGZ{DA;Px<|;Gga*E{1!(QSi(~|-a{yAKNJU9=Wesc1$_xW2+r@NUMkYC9G zqpJ?Q8(~h`zH@qK3$EJc@F&qt^)Q%+2EzC+UQ=f6_=+Fwl)A|V=0@-ZzeF`n^X7T} zPwPLg0N_MaQ!qOx)EFFW6z04X<_2dOL%!mdgbO(VVJ;eSf{n)Dm1bkR>343^Z@*3O zJ3s_&9`~F^xLjdGnYCc>MFa9m_>5J5u=7)T?QKbn^|$R3gaMz5Id0wid^0ymE}s3C zJ=4}6U2kncxJGWcwb=D-&SG^$5eZeA15J@DAx4Ob58Bq7xw^pAzhOss*Jr=`KyE5e zXHH`z(Bj$(Rrm_7caD{cujKk&O<#$C?1BJ;f7*`OW~8my>UfftxNr_b>7|}g7MdNB zX%ys!z8t{dfbJIjkG}cuoGfpT6W_!w*)7WNfIHH|+3hz<|4RG1^xLR@S`^xdY4k%E zq4gM6updv5!UR@sZNAjKy1lZ!J_P5t(alRFE)Xt;=pUkBx?I9KEyM-_(&WOWi{o?) zlT*MmQtCUkOWcTM*ixrDC61*(*|eED2r2DeFJ=tr%B=YYYR$PkX%UXO7hThs+)iuPI`= zy>i9B-%aWO1ESKkz^Y5Uij=Qxw=%H{ls)dDZI1o@LMPE8rV)647S&v4PDGX~jYMG{ z#E+Is(W$%{AHyuzaw(H+C^LqvuF;GT<5L9$GY~QcKLs}f(HX(Urw9l#j&oy(S3`Y) z+sDOY^r%+ycl~Ww^yQ@T@2Ogb@uEbSR0BXAcAO{JG z(u2}?ytJV7+Y0dX2Xx`~eXZV;rc*IB*b`XIMsMQ=79c1hT}@R|>gsPZj~}6_Dai+P zs7W>Th)Oa}O{S`^rS7CEk$4^A%st=0Kh@CB*WZx&Qa}H?@ZPbOr%#g0U0pn0auRqq z?WOO7sivQGDw+Z^?agdp`9n8t%3;)T#}qm;VpNGdu}M!k>!fn|=CHPM(uiW7z)-1< zIc)^aVR*tB6Nbo`Y@;}AO!ekd_9z2zBtIQ##)q}|0n5$NK_an#9c>Fdz@og7g&PHI zgbk~zjS#1CG?!V-fsSropIxZaRhR@vbo_B+N?kS!5DOq%ZtBW=)GfR8by_~wYA^ux z8XSa8ddQ@``pGW;%59F8U1O$-z6n-sb5-)=mo*0n5NUowi=jGfP*#Q9i5hUsm1pkg zW8a$q4Ego4+>U*qd(F*Z=Ue_AYM=u@yZ!@*#0zc)_Kr_?t## z+lY}S3vN1eV7dSXTj*1S{}E*SFr%vZ=7kp9ZC)`NHZ2VsQPfsUn;Of{t4iM-uo-+K z(#4p~944w`|HJJ3=N3nAnv4|y29Q(E)jI}FS*0GIGz~NTtJ;IXTI=Lg8I#rQB(tZQ z(8=od`ZB2fCRLK*f8E%YV`V1e^o-%GZNsB(u3{|DJ{#jR`4aES?YnBU0n{2J*|Dm) zlT}aOq}A&LjkdTeZhTVz`Hi_%zX`l-=a_$1c{afo*P)$Y*#LXr^xNJ5Kqhk!U~R-z zfBS$$0BXp2BLM*Cw^4reVB7M?Osd_qxC^$s;Y}3h#{jk_!Paz4cd{-y(&YY{KUBAg z@Vo{dUfw3BdcqkMxigiz)uYDbnd_UVdL7|W9G~5hGfr(fy0WM318f3@Puo-H|Mh`> z9n|N%5XlAy{B8P;I_HGp0DvOsIR}euOfY<2#sBv8IX<4+`zDJQ{p;=F0N@9AqmGSF z|Efm&H@1Q~$T&8@|LrxfjoA5+`31SY=Swdf!U52I6Qa6ri_C8p?58ySgHzM8UjCLp z8fcHUrZj6QRUbP*s zRwQ%1gqn{|7_Fi+!-sJ90cs&dlLg&d7V_7<#j*FysT&k$enb|8i*7c{wGw?H6vg#g zrk82lsxOhD3fIj2=eA<(r>AO~Jl_F9mtI3@$1A@(QWciv`tw>^z~Z<;Z}7kMQWgq8 zFkr!f2l_c!oj`yH75tYt6B|H;31wVJrHyqy#3aq~qO9ts?fPMy=4IXXX? zpQOd&iDW9B$>#EfVyRrI*6NLBtKI4L`h%f28c(LP`C_?R`k4bm+S2wgpcRz z{rUc)f4Nev)f>%LyVLFU2gA{LGM&vA%hh_b-R%#@)5Yc0_08?w{lnwa^ULeo`TgVb z>-*>T?;lkGe(^@j%%Og9=Z9b(XnXcX8&(f#8Q3<7opS4$SR^RA$2*y9@qysv0g8!_ z(__9nZ$bIOOTb8M*!Abd`aH-DSM@W&X?h`GIS_R}Ery8S(bi(hC1idgnitS48INUp(Mfu z7MpSPgg;Hq1E};>HUny=Tjbpt0;9VcW+q4WB>TdNs6HPa-OK=yc51~q!8R>etz4OF zp1}{D9_PRN|C(^;ZYTNFJFL=$sZsCWYGr2ZhJNN9IAG6;N9 zTusO^*w&U;C2#Q5JhX(11R)TkS|q1tG+7Y?UyqR0kbo{2t*}rK;nyIh0y@Bcmy(o= z1*yE)7kZzQ3=corv1z2Ro~ z3I#u&dK0CxzH72GI>Ic+Da#O$hZ*#0T2Xx_u4O`geBF!dF|+!-F}Q@JkyeqR3H`>2 z3v~3L(&2H^8Xbl-&=WS3R`1zC7Cztm)kST>_X-nn(|V*{W&UQ5jW@py;knc6%(=ll zyjtO-W1e3*m.timeout/4?g(u+" is not a valid module","error"):void(m.status[u]?c():setTimeout(n,4))}())}function c(){e.push(layui[u]),11e3*m.timeout/4?g(u+" is not a valid module","error"):void("string"==typeof m.modules[u]&&m.status[u]?c():setTimeout(f,4))}():((p=h.createElement("script"))["async"]=!0,p.charset="utf-8",p.src=y+((i=!0===m.version?m.v||(new Date).getTime():m.version||"")?"?v="+i:""),a.appendChild(p),!p.attachEvent||p.attachEvent.toString&&p.attachEvent.toString().indexOf("[native code")<0||b?p.addEventListener("load",function(t){s(t,y)},!1):p.attachEvent("onreadystatechange",function(t){s(t,y)}),m.modules[u]=y),o},n.prototype.disuse=function(t){var r=this;return t=r.isArray(t)?t:[t],r.each(t,function(t,e){m.status[e],delete r[e],delete N[e],delete r.modules[e],delete m.status[e],delete m.modules[e]}),r},n.prototype.getStyle=function(t,e){t=t.currentStyle||d.getComputedStyle(t,null);return t[t.getPropertyValue?"getPropertyValue":"getAttribute"](e)},n.prototype.link=function(r,n,t){var o=this,e=h.getElementsByTagName("head")[0],i=h.createElement("link"),t=((t="string"==typeof n?n:t)||r).replace(/\.|\//g,""),a=i.id="layuicss-"+t,u="creating",l=0;return i.rel="stylesheet",i.href=r+(m.debug?"?v="+(new Date).getTime():""),i.media="all",h.getElementById(a)||e.appendChild(i),"function"!=typeof n||function s(t){var e=h.getElementById(a);return++l>1e3*m.timeout/100?g(r+" timeout"):void(1989===parseInt(o.getStyle(e,"width"))?(t===u&&e.removeAttribute("lay-status"),e.getAttribute("lay-status")===u?setTimeout(s,100):n()):(e.setAttribute("lay-status",u),setTimeout(function(){s(u)},100)))}(),o},n.prototype.addcss=function(t,e,r){return layui.link(m.dir+"css/"+t,e,r)},m.callback={},n.prototype.factory=function(t){if(layui[t])return"function"==typeof m.callback[t]?m.callback[t]:null},n.prototype.img=function(t,e,r){var n=new Image;if(n.src=t,n.complete)return e(n);n.onload=function(){n.onload=null,"function"==typeof e&&e(n)},n.onerror=function(t){n.onerror=null,"function"==typeof r&&r(t)}},n.prototype.config=function(t){for(var e in t=t||{})m[e]=t[e];return this},n.prototype.modules=function(){var t,e={};for(t in N)e[t]=N[t];return e}(),n.prototype.extend=function(t){for(var e in t=t||{})this[e]||this.modules[e]?g(e+" Module already exists","error"):this.modules[e]=t[e];return this},n.prototype.router=n.prototype.hash=function(t){var r={path:[],search:{},hash:((t=t||location.hash).match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(t)&&(t=t.replace(/^#\//,""),r.href="/"+t,t=t.replace(/([^#])(#.*$)/,"$1").split("/")||[],this.each(t,function(t,e){/^\w+=/.test(e)?(e=e.split("="),r.search[e[0]]=e[1]):r.path.push(e)})),r},n.prototype.url=function(t){var o,e,r=this;return{pathname:(t?((t.match(/\.[^.]+?\/.+/)||[])[0]||"").replace(/^[^\/]+/,"").replace(/\?.+/,""):location.pathname).replace(/^\//,"").split("/"),search:(o={},e=(t?((t.match(/\?.+/)||[])[0]||"").replace(/\#.+/,""):location.search).replace(/^\?+/,"").split("&"),r.each(e,function(t,e){var r=e.indexOf("="),n=r<0?e.substr(0,e.length):0!==r&&e.substr(0,r);n&&(o[n]=0(l.innerHeight||f.documentElement.clientHeight)},h.position=function(t,e,n){var o,r,i,c,u,a,s;e&&(n=n||{},t!==f&&t!==h("body")[0]||(n.clickType="right"),u="right"===n.clickType?{left:(u=n.e||l.event||{}).clientX,top:u.clientY,right:u.clientX,bottom:u.clientY}:t.getBoundingClientRect(),a=e.offsetWidth,s=e.offsetHeight,o=function(t){return f.body[t=t?"scrollLeft":"scrollTop"]|f.documentElement[t]},i=u.left,c=u.bottom,"center"===n.align?i-=(a-t.offsetWidth)/2:"right"===n.align&&(i=i-a+t.offsetWidth),(i=i+a+5>(r=function(t){return f.documentElement[t?"clientWidth":"clientHeight"]})("width")?r("width")-a-5:i)<5&&(i=5),c+s+5>r()&&(u.top>s+5?c=u.top-s-10:"right"===n.clickType?(c=r()-s-10)<0&&(c=0):c=5),(a=n.position)&&(e.style.position=a),e.style.left=i+("fixed"===a?0:o(1))+"px",e.style.top=c+("fixed"===a?0:o())+"px",h.hasScrollbar()||(s=e.getBoundingClientRect(),!n.SYSTEM_RELOAD&&s.bottom+5>r()&&(n.SYSTEM_RELOAD=!0,setTimeout(function(){h.position(t,e,n)},50))))},h.options=function(t,e){e="object"==typeof e?e:{attr:e};var t=h(t),n=e.attr||"lay-options",t=t.attr(n);try{return new Function("return "+(t||"{}"))()}catch(o){return layui.hint().error(e.errorText||[n+'="'+t+'"',"\n parseerror: "+o].join("\n"),"error"),{}}},h.isTopElem=function(n){var t=[f,h("body")[0]],o=!1;return h.each(t,function(t,e){if(e===n)return o=!0}),o},r.addStr=function(n,t){return n=n.replace(/\s+/," "),t=t.replace(/\s+/," ").split(" "),h.each(t,function(t,e){new RegExp("\\b"+e+"\\b").test(n)||(n=n+" "+e)}),n.replace(/^\s|\s$/,"")},r.removeStr=function(n,t){return n=n.replace(/\s+/," "),t=t.replace(/\s+/," ").split(" "),h.each(t,function(t,e){e=new RegExp("\\b"+e+"\\b");e.test(n)&&(n=n.replace(e,""))}),n.replace(/\s+/," ").replace(/^\s|\s$/,"")},r.prototype.find=function(o){var r=this,i=0,c=[],u="object"==typeof o;return this.each(function(t,e){for(var n=u?e.contains(o):e.querySelectorAll(o||null);i]|&(?=#[a-zA-Z0-9]+)/g.test(e+="")?e.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,"""):e},error:function(e,r){var n="Laytpl Error: ";return"object"==typeof console&&console.error(n+e+"\n"+(r||"")),n+e}},l=a.exp,r=function(e){this.tpl=e},n=(r.pt=r.prototype,window.errors=0,r.pt.parse=function(e,r){var n=e,c=l("^"+p.open+"#",""),t=l(p.close+"$","");e='"use strict";var view = "'+(e=e.replace(/\s+|\r|\t|\n/g," ").replace(l(p.open+"#"),p.open+"# ").replace(l(p.close+"}"),"} "+p.close).replace(/\\/g,"\\\\").replace(l(p.open+"!(.+?)!"+p.close),function(e){return e=e.replace(l("^"+p.open+"!"),"").replace(l("!"+p.close),"").replace(l(p.open+"|"+p.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(a.query(),function(e){return'";'+(e=e.replace(c,"").replace(t,"")).replace(/\\(.)/g,"$1")+';view+="'}).replace(a.query(1),function(e){var r='"+laytpl.escape(';return e.replace(/\s/g,"")===p.open+p.close?"":(e=e.replace(l(p.open+"|"+p.close),""),/^=/.test(e)?e=e.replace(/^=/,""):/^-/.test(e)&&(e=e.replace(/^-/,""),r='"+('),r+e.replace(/\\(.)/g,"$1")+')+"')}))+'";return view;';try{return this.cache=e=new Function("d, laytpl",e),e(r,a)}catch(o){return delete this.cache,a.error(o,n)}},r.pt.render=function(e,r){var n=this;return e?(e=n.cache?n.cache(e,a):n.parse(n.tpl,e),r?void r(e):e):a.error("no data")},function(e){return"string"!=typeof e?a.error("Template not found"):new r(e)});n.config=function(e){for(var r in e=e||{})p[r]=e[r]},n.v="1.2.0",e("laytpl",n)});layui.define(function(e){"use strict";var n=document,u="getElementById",c="getElementsByTagName",a="layui-disabled",t=function(e){var a=this;a.config=e||{},a.config.index=++o.index,a.render(!0)},o=(t.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return e.elem.length===undefined?2:3},t.prototype.view=function(){var t,i,r=this.config,n=r.groups="groups"in r?Number(r.groups)||0:5,u=(r.layout="object"==typeof r.layout?r.layout:["prev","page","next"],r.count=Number(r.count)||0,r.curr=Number(r.curr)||1,r.limits="object"==typeof r.limits?r.limits:[10,20,30,40,50],r.limit=Number(r.limit)||10,r.pages=Math.ceil(r.count/r.limit)||1,r.curr>r.pages?r.curr=r.pages:r.curr<1&&(r.curr=1),n<0?n=1:n>r.pages&&(n=r.pages),r.prev="prev"in r?r.prev:"上一页",r.next="next"in r?r.next:"下一页",r.pages>n?Math.ceil((r.curr+(1'+r.prev+"":"",page:function(){var e=[];if(r.count<1)return"";1'+(r.first||1)+"");var a=Math.floor((n-1)/2),t=1r.pages?r.pages:a:n;for(i-t…');t<=i;t++)t===r.curr?e.push('"+t+""):e.push(''+t+"");return r.pages>n&&r.pages>i&&!1!==r.last&&(i+1…'),0!==n&&e.push(''+(r.last||r.pages)+"")),e.join("")}(),next:r.next?''+r.next+"":"",count:'\u5171 '+r.count+" \u6761",limit:(t=['"),refresh:['','',""].join(""),skip:['到第','','页',""].join("")};return['
',(i=[],layui.each(r.layout,function(e,a){s[a]&&i.push(s[a])}),i.join("")),"
"].join("")},t.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,n=e[c]("button")[0],u=e[c]("input")[0],e=e[c]("select")[0],s=function(){var e=Number(u.value.replace(/\s|\D/g,""));e&&(i.curr=e,t.render())};if(a)return s();for(var l=0,p=r.length;li.pages||(i.curr=e,t.render())});e&&o.on(e,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),n&&o.on(n,"click",function(){s()})}},t.prototype.skip=function(t){var i,e;t&&(i=this,(e=t[c]("input")[0])&&o.on(e,"keyup",function(e){var a=this.value,e=e.keyCode;/^(37|38|39|40)$/.test(e)||(/\D/.test(a)&&(this.value=a.replace(/\D/,"")),13===e&&i.jump(t,!0))}))},t.prototype.render=function(e){var a=this,t=a.config,i=a.type(),r=a.view(),i=(2===i?t.elem&&(t.elem.innerHTML=r):3===i?t.elem.html(r):n[u](t.elem)&&(n[u](t.elem).innerHTML=r),t.jump&&t.jump(t,e),n[u]("layui-laypage-"+t.index));a.jump(i),t.hash&&!e&&(location.hash="!"+t.hash+"="+t.curr),a.skip(i)},{render:function(e){return new t(e).index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(a,e,t){return a.attachEvent?a.attachEvent("on"+e,function(e){e.target=e.srcElement,t.call(a,e)}):a.addEventListener(e,t,!1),this}});e("laypage",o)});!function(i,p){"use strict";var n=i.layui&&layui.define,l={getPath:i.lay&&lay.getPath?lay.getPath:"",link:function(e,t,a){v.path&&i.lay&&lay.layui&&lay.layui.link(v.path+e,t,a)}},e=i.LAYUI_GLOBAL||{},v={v:"5.5.0",config:{weekStart:0},index:i.laydate&&i.laydate.v?1e5:0,path:e.laydate_dir||l.getPath,set:function(e){var t=this;return t.config=lay.extend({},t.config,e),t},ready:function(e){var t="laydate",a=(n?"modules/":"")+"laydate.css?v="+v.v;return n?layui["layui.all"]?"function"==typeof e&&e():layui.addcss(a,e,t):l.link(a,e,t),this}},d=function(){var t=this,e=t.config.id;return(d.that[e]=t).inst={hint:function(e){t.hint.call(t,e)},config:t.config}},a="laydate",x="layui-this",k="laydate-disabled",h=[100,2e5],D="layui-laydate-static",w="layui-laydate-list",o="laydate-selected",r="layui-laydate-hint",s="laydate-day-prev",y="laydate-day-next",C=".laydate-btns-confirm",M="laydate-time-text",E="laydate-btns-time",T="layui-laydate-preview",L="layui-laydate-main",S="layui-laydate-shade",I=function(e){var t=this,a=(t.index=++v.index,t.config=lay.extend({},t.config,v.config,e),lay(e.elem||t.config.elem));if(1\u8bf7\u91cd\u65b0\u9009\u62e9",invalidDate:"\u4e0d\u5728\u6709\u6548\u65e5\u671f\u6216\u65f6\u95f4\u8303\u56f4\u5185",formatError:["\u65e5\u671f\u683c\u5f0f\u4e0d\u5408\u6cd5
\u5fc5\u987b\u9075\u5faa\u4e0b\u8ff0\u683c\u5f0f\uff1a
","
\u5df2\u4e3a\u4f60\u91cd\u7f6e"],preview:"\u5f53\u524d\u9009\u4e2d\u7684\u7ed3\u679c"},en:{weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],time:["Hours","Minutes","Seconds"],timeTips:"Select Time",startTime:"Start Time",endTime:"End Time",dateTips:"Select Date",month:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],tools:{confirm:"Confirm",clear:"Clear",now:"Now"},timeout:"End time cannot be less than start Time
Please re-select",invalidDate:"Invalid date",formatError:["The date format error
Must be followed\uff1a
","
It has been reset"],preview:"The selected result"}};return e[this.config.lang]||e.cn},I.prototype.init=function(){var e,r=this,o=r.config,t="static"===o.position,a={year:"yyyy",month:"yyyy-MM",date:"yyyy-MM-dd",time:"HH:mm:ss",datetime:"yyyy-MM-dd HH:mm:ss"};o.elem=lay(o.elem),o.eventElem=lay(o.eventElem),o.elem[0]&&((e=d.that[o.elem.attr("lay-key")])&&e.destroy&&e.destroy(),"array"!==layui.type(o.theme)&&(o.theme=[o.theme]),o.fullPanel&&("datetime"!==o.type||o.range)&&delete o.fullPanel,r.rangeStr=o.range?"string"==typeof o.range?o.range:"-":"",r.rangeLinked=!(!o.range||!o.rangeLinked||"date"!==o.type&&"datetime"!==o.type),r.autoCalendarModel=function(){var e=r.rangeLinked;return r.rangeLinked=o.range&&("date"===o.type||"datetime"===o.type)&&(!r.startDate||!r.endDate||r.startDate&&r.endDate&&r.startDate.year===r.endDate.year&&r.startDate.month===r.endDate.month),lay(r.elem)[r.rangeLinked?"addClass":"removeClass"]("layui-laydate-linkage"),r.rangeLinked!=e},r.autoCalendarModel.auto=r.rangeLinked&&"auto"===o.rangeLinked,"array"===layui.type(o.range)&&(r.rangeElem=[lay(o.range[0]),lay(o.range[1])]),a[o.type]||(i.console&&console.error&&console.error("laydate type error:'"+o.type+"' is not supported"),o.type="date"),o.format===a.date&&(o.format=a[o.type]||a.date),r.format=d.formatArr(o.format),o.weekStart&&!/^[0-6]$/.test(o.weekStart)&&(e=r.lang(),o.weekStart=e.weeks.indexOf(o.weekStart),-1===o.weekStart&&(o.weekStart=0)),r.EXP_IF="",r.EXP_SPLIT="",lay.each(r.format,function(e,t){e=new RegExp(m).test(t)?"\\d{"+(new RegExp(m).test(r.format[0===e?e+1:e-1]||"")?/^yyyy|y$/.test(t)?4:t.length:/^yyyy$/.test(t)?"1,4":/^y$/.test(t)?"1,308":"1,2")+"}":"\\"+t;r.EXP_IF=r.EXP_IF+e,r.EXP_SPLIT=r.EXP_SPLIT+"("+e+")"}),r.EXP_IF_ONE=new RegExp("^"+r.EXP_IF+"$"),r.EXP_IF=new RegExp("^"+(o.range?r.EXP_IF+"\\s\\"+r.rangeStr+"\\s"+r.EXP_IF:r.EXP_IF)+"$"),r.EXP_SPLIT=new RegExp("^"+r.EXP_SPLIT+"$",""),r.isInput(o.elem[0])||"focus"===o.trigger&&(o.trigger="click"),o.elem.attr("lay-key",r.index),o.eventElem.attr("lay-key",r.index),o.mark=lay.extend({},o.calendar&&"cn"===o.lang?{"0-1-1":"\u5143\u65e6","0-2-14":"\u60c5\u4eba","0-3-8":"\u5987\u5973","0-3-12":"\u690d\u6811","0-4-1":"\u611a\u4eba","0-5-1":"\u52b3\u52a8","0-5-4":"\u9752\u5e74","0-6-1":"\u513f\u7ae5","0-9-10":"\u6559\u5e08","0-10-1":"\u56fd\u5e86","0-12-25":"\u5723\u8bde"}:{},o.mark),lay.each(["min","max"],function(e,t){var a,n,i=[],l=[];l="number"==typeof o[t]?(a=o[t],n=new Date,n=r.newDate({year:n.getFullYear(),month:n.getMonth(),date:n.getDate(),hours:e?23:0,minutes:e?59:0,seconds:e?59:0}).getTime(),i=[(e=new Date(a?a<864e5?n+864e5*a:a:n)).getFullYear(),e.getMonth()+1,e.getDate()],[e.getHours(),e.getMinutes(),e.getSeconds()]):(i=(o[t].match(/\d+-\d+-\d+/)||[""])[0].split("-"),(o[t].match(/\d+:\d+:\d+/)||[""])[0].split(":")),o[t]={year:0|i[0]||(new Date).getFullYear(),month:i[1]?(0|i[1])-1:(new Date).getMonth(),date:0|i[2]||(new Date).getDate(),hours:0|l[0],minutes:0|l[1],seconds:0|l[2]}}),r.elemID="layui-laydate"+o.elem.attr("lay-key"),(o.show||t)&&r.render(),t||r.events(),o.value&&o.isInitValue&&("date"===layui.type(o.value)?r.setValue(r.parse(0,r.systemDate(o.value))):r.setValue(o.value)))},I.prototype.render=function(){var a,n,i,l,r=this,o=r.config,d=r.lang(),s="static"===o.position,y=r.elem=lay.elem("div",{id:r.elemID,"class":["layui-laydate",o.range?" layui-laydate-range":"",r.rangeLinked?" layui-laydate-linkage":"",s?" "+D:"",o.fullPanel?" laydate-theme-fullpanel":"",(a="",lay.each(o.theme,function(e,t){"default"===t||/^#/.test(t)||(a+=" laydate-theme-"+t)}),a)].join("")}),m=r.elemMain=[],c=r.elemHeader=[],u=r.elemCont=[],h=r.table=[],e=r.footer=lay.elem("div",{"class":"layui-laydate-footer"}),t=r.shortcut=lay.elem("ul",{"class":"layui-laydate-shortcut"}),f=(o.zIndex&&(y.style.zIndex=o.zIndex),lay.each(new Array(2),function(e){if(!o.range&&0'+d.timeTips+""),(o.range||"datetime"!==o.type||o.fullPanel)&&f.push(''),lay.each(o.btns,function(e,t){var a=d.tools[t]||"btn";o.range&&"now"===t||(s&&"clear"===t&&(a="cn"===o.lang?"\u91cd\u7f6e":"Reset"),n.push(''+a+""))}),f.push('"),f.join(""))),o.shortcuts&&(y.appendChild(t),lay(t).html((i=[],lay.each(o.shortcuts,function(e,t){i.push('
  • '+t.text+"
  • ")}),i.join(""))).find("li").on("click",function(e){var t=(o.shortcuts[this.dataset.index]||{}).value||[],n=(layui.isArray(t)||(t=[t]),o.type),t=(lay.each(t,function(e,t){var a=[o.dateTime,r.endDate][e];"time"===n&&"date"!==layui.type(t)?r.EXP_IF.test(t)&&(t=(t.match(r.EXP_SPLIT)||[]).slice(1),lay.extend(a,{hours:0|t[0],minutes:0|t[2],seconds:0|t[4]})):lay.extend(a,r.systemDate("date"===layui.type(t)?t:new Date(t))),"time"!==n&&"datetime"!==n||(r[["startTime","endTime"][e]]={hours:a.hours,minutes:a.minutes,seconds:a.seconds}),0===e?r.startDate=lay.extend({},a):r.endState=!0,"year"===n||"month"===n||"time"===n?r.listYM[e]=[a.year,a.month+1]:e&&r.autoCalendarModel.auto&&r.autoCalendarModel()}),r.checkDate("limit").calendar(null,null,"init"),lay(r.footer).find("."+E).removeClass(k));t&&"date"===t.attr("lay-type")&&t[0].click(),r.done(null,"change"),lay(this).addClass(x),"static"!==o.position&&!o.range&&o.autoConfirm&&("date"===n?r.choose(lay(y).find("td.layui-this")):"year"!==n&&"month"!==n||lay(m[0]).find("."+L+" li."+x+":not(.laydate-disabled)")[0]&&r.setValue(r.parse()).done().remove())})),lay.each(m,function(e,t){y.appendChild(t)}),o.showBottom&&y.appendChild(e),lay.elem("style")),g=[],t=(lay.each(o.theme,function(e,t){/^#/.test(t)&&(l=!0,g.push(["#{{id}} .layui-laydate-header{background-color:{{theme}};}","#{{id}} li.layui-this,#{{id}} td.layui-this>div{background-color:{{theme}} !important;}",-1!==o.theme.indexOf("circle")?"":"#{{id}} .layui-this{background-color:{{theme}} !important;}"].join("").replace(/{{id}}/g,r.elemID).replace(/{{theme}}/g,t)))}),o.shortcuts&&o.range&&g.push("#{{id}}.layui-laydate-range{width: 628px;}".replace(/{{id}}/g,r.elemID)),g.length&&(g=g.join(""),"styleSheet"in f?(f.setAttribute("type","text/css"),f.styleSheet.cssText=g):f.innerHTML=g,l&&lay(y).addClass("laydate-theme-molv"),y.appendChild(f)),r.remove(I.thisElemDate),v.thisId=o.id,s?o.elem.append(y):(p.body.appendChild(y),r.position()),o.shade?'
    ':"");y.insertAdjacentHTML("beforebegin",t),r.checkDate().calendar(null,0,"init"),r.changeEvent(),I.thisElemDate=r.elemID,r.renderAdditional(),"function"==typeof o.ready&&o.ready(lay.extend({},o.dateTime,{month:o.dateTime.month+1})),r.preview()},I.prototype.remove=function(e){var t=this,a=t.config,n=lay("#"+(e||t.elemID));return n[0]&&(n.hasClass(D)||t.checkDate(function(){n.remove(),delete t.startDate,delete t.endDate,delete t.endState,delete t.startTime,delete t.endTime,delete v.thisId,"function"==typeof a.close&&a.close(t)}),lay("."+S).remove()),t},I.prototype.position=function(){var e=this.config;return lay.position(this.bindElem||e.elem[0],this.elem,{position:e.position}),this},I.prototype.hint=function(e){var t=this,a=(t.config,lay.elem("div",{"class":r}));t.elem&&(a.innerHTML=e||"",lay(t.elem).find("."+r).remove(),t.elem.appendChild(a),clearTimeout(t.hinTimer),t.hinTimer=setTimeout(function(){lay(t.elem).find("."+r).remove()},3e3))},I.prototype.getAsYM=function(e,t,a){return a?t--:t++,t<0&&(t=11,e--),11h[1]&&(e.year=h[1],o=!0),11t&&(e.date=t,o=!0))},r=function(n,i,l){var r=["startTime","endTime"];i=(i.match(d.EXP_SPLIT)||[]).slice(1),l=l||0,s.range&&(d[r[l]]=d[r[l]]||{}),lay.each(d.format,function(e,t){var a=parseFloat(i[e]);i[e].lengthd.getDateTime(s.max)?(n=s.dateTime=lay.extend({},s.max),c=!0):d.getDateTime(n)d.getDateTime(s.max))&&(d.endDate=lay.extend({},s.max),c=!0),d.startTime={hours:s.dateTime.hours,minutes:s.dateTime.minutes,seconds:s.dateTime.seconds},d.endTime={hours:d.endDate.hours,minutes:d.endDate.minutes,seconds:d.endDate.seconds}),c&&l&&(d.setValue(d.parse()),d.hint("value "+a.invalidDate+a.formatError[1])),d.startDate=d.startDate||l&&lay.extend({},s.dateTime),d.autoCalendarModel.auto&&d.autoCalendarModel(),d.endState=!s.range||!d.rangeLinked||!(!d.startDate||!d.endDate),e&&e(),d},I.prototype.mark=function(e,a){var n,t=this.config;return lay.each(t.mark,function(e,t){e=e.split("-");e[0]!=a[0]&&0!=e[0]||e[1]!=a[1]&&0!=e[1]||e[2]!=a[2]||(n=t||a[2])}),n&&e.find("div").html(''+n+""),this},I.prototype.holidays=function(n,i){var e=this.config,l=["","work"];return"array"!==layui.type(e.holidays)||lay.each(e.holidays,function(a,e){lay.each(e,function(e,t){t===n.attr("lay-ymd")&&n.find("div").html('"+i[2]+"")})}),this},I.prototype.limit=function(t){t=t||{};var i=this,e=i.config,l={},a=t.index>(t.time?0:41)?i.endDate:e.dateTime;return lay.each({now:lay.extend({},a,t.date||{}),min:e.min,max:e.max},function(e,a){var n;l[e]=i.newDate(lay.extend({year:a.year,month:"year"===t.type?0:a.month,date:"year"===t.type||"month"===t.type?1:a.date},(n={},lay.each(t.time,function(e,t){n[t]=a[t]}),n))).getTime()}),a=l.nowl.max,t.elem&&t.elem[a?"addClass":"removeClass"](k),a},I.prototype.thisDateTime=function(e){var t=this.config;return e?this.endDate:t.dateTime},I.prototype.calendar=function(e,t,a){var i,l,r,o=this,n=o.config,t=t?1:0,d=e||o.thisDateTime(t),s=new Date,y=o.lang(),m="date"!==n.type&&"datetime"!==n.type,c=lay(o.table[t]).find("td"),u=lay(o.elemHeader[t][2]).find("span");return d.yearh[1]&&(d.year=h[1],o.hint(y.invalidDate)),o.firstDate||(o.firstDate=lay.extend({},d)),s.setFullYear(d.year,d.month,1),i=(s.getDay()+(7-n.weekStart))%7,l=v.getEndDate(d.month||12,d.year),r=v.getEndDate(d.month+1,d.year),lay.each(c,function(e,t){var a=[d.year,d.month],n=0;(t=lay(t)).removeAttr("class"),e"+a[2]+""),o.mark(t,a).holidays(t,a).limit({elem:t,date:{year:a[0],month:a[1]-1,date:a[2]},index:e})}),lay(u[0]).attr("lay-ym",d.year+"-"+(d.month+1)),lay(u[1]).attr("lay-ym",d.year+"-"+(d.month+1)),"cn"===n.lang?(lay(u[0]).attr("lay-type","year").html(d.year+" \u5e74"),lay(u[1]).attr("lay-type","month").html(d.month+1+" \u6708")):(lay(u[0]).attr("lay-type","month").html(y.month[d.month]),lay(u[1]).attr("lay-type","year").html(d.year)),m&&(n.range?!e&&"init"===a||(o.listYM=[[(o.startDate||n.dateTime).year,(o.startDate||n.dateTime).month+1],[o.endDate.year,o.endDate.month+1]],o.list(n.type,0).list(n.type,1),"time"===n.type?o.setBtnStatus("\u65f6\u95f4",lay.extend({},o.systemDate(),o.startTime),lay.extend({},o.systemDate(),o.endTime)):o.setBtnStatus(!0)):(o.listYM=[[d.year,d.month+1]],o.list(n.type,0))),n.range&&"init"===a&&(o.rangeLinked?(s=o.getAsYM(d.year,d.month,t?"sub":null),o.calendar(lay.extend({},d,{year:s[0],month:s[1]}),1-t)):o.calendar(null,1-t)),n.range||(c=["hours","minutes","seconds"],o.limit({elem:lay(o.footer).find(".laydate-btns-now"),date:o.systemDate(),index:0,time:c}),o.limit({elem:lay(o.footer).find(C),index:0,time:c})),o.setBtnStatus(),lay(o.shortcut).find("li."+x).removeClass(x),n.range&&!m&&"init"!==a&&o.stampRange(),o},I.prototype.list=function(n,i){var l,r,e,o,d=this,s=d.config,y=d.rangeLinked?s.dateTime:[s.dateTime,d.endDate][i],m=d.lang(),t=s.range&&"date"!==s.type&&"datetime"!==s.type,c=lay.elem("ul",{"class":w+" "+{year:"laydate-year-list",month:"laydate-month-list",time:"laydate-time-list"}[n]}),a=d.elemHeader[i],u=lay(a[2]).find("span"),h=d.elemCont[i||0],f=lay(h).find("."+w)[0],g="cn"===s.lang,p=g?"\u5e74":"",v=d.listYM[i]||{},D=["hours","minutes","seconds"],T=["startTime","endTime"][i];return v[0]<1&&(v[0]=1),"year"===n?(e=l=v[0]-7,l<1&&(e=l=1),lay.each(new Array(15),function(e){var t=lay.elem("li",{"lay-ym":l}),a={year:l,month:0,date:1};l==v[0]&&lay(t).addClass(x),t.innerHTML=l+p,c.appendChild(t),d.limit({elem:lay(t),date:a,index:i,type:n}),l++}),lay(u[g?0:1]).attr("lay-ym",l-8+"-"+v[1]).html(e+p+" - "+(l-1)+p)):"month"===n?(lay.each(new Array(12),function(e){var t=lay.elem("li",{"lay-ym":e}),a={year:v[0],month:e,date:1};e+1==v[1]&&lay(t).addClass(x),t.innerHTML=m.month[e]+(g?"\u6708":""),c.appendChild(t),d.limit({elem:lay(t),date:a,index:i,type:n})}),lay(u[g?0:1]).attr("lay-ym",v[0]+"-"+v[1]).html(v[0]+p)):"time"===n&&(r=function(){lay(c).find("ol").each(function(a,e){lay(e).find("li").each(function(e,t){d.limit({elem:lay(t),date:[{hours:e},{hours:d[T].hours,minutes:e},{hours:d[T].hours,minutes:d[T].minutes,seconds:e}][a],index:i,time:[["hours"],["hours","minutes"],["hours","minutes","seconds"]][a]})})}),s.range||d.limit({elem:lay(d.footer).find(C),date:d[T],inedx:0,time:["hours","minutes","seconds"]})},s.range?d[T]||(d[T]="startTime"===T?y:d.endDate):d[T]=y,lay.each([24,60,60],function(t,e){var a=lay.elem("li"),n=["

    "+m.time[t]+"

      "];lay.each(new Array(e),function(e){n.push(""+lay.digit(e,2)+"")}),a.innerHTML=n.join("")+"
    ",c.appendChild(a)}),r()),f&&h.removeChild(f),h.appendChild(c),"year"===n||"month"===n?(lay(d.elemMain[i]).addClass("laydate-ym-show"),lay(c).find("li").on("click",function(){var e=0|lay(this).attr("lay-ym");lay(this).hasClass(k)||(d.rangeLinked?lay.extend(y,{year:"year"===n?e:v[0],month:"year"===n?v[1]-1:e}):y[n]=e,"year"===s.type||"month"===s.type?(lay(c).find("."+x).removeClass(x),lay(this).addClass(x),"month"===s.type&&"year"===n&&(d.listYM[i][0]=e,t&&((i?d.endDate:y).year=e),d.list("month",i))):(d.checkDate("limit").calendar(y,i,"init"),d.closeList()),d.setBtnStatus(),!s.range&&s.autoConfirm&&("month"===s.type&&"month"===n||"year"===s.type&&"year"===n)&&d.setValue(d.parse()).done().remove(),d.autoCalendarModel.auto&&!d.rangeLinked?d.choose(lay(h).find("td.layui-this"),i):d.endState&&d.done(null,"change"),lay(d.footer).find("."+E).removeClass(k))})):(e=lay.elem("span",{"class":M}),o=function(){lay(c).find("ol").each(function(e){var a=this,t=lay(a).find("li");a.scrollTop=30*(d[T][D[e]]-2),a.scrollTop<=0&&t.each(function(e,t){if(!lay(this).hasClass(k))return a.scrollTop=30*(e-2),!0})})},u=lay(a[2]).find("."+M),o(),e.innerHTML=s.range?[m.startTime,m.endTime][i]:m.timeTips,lay(d.elemMain[i]).addClass("laydate-time-show"),u[0]&&u.remove(),a[2].appendChild(e),lay(c).find("ol").each(function(t){var a=this;lay(a).find("li").on("click",function(){var e=0|this.innerHTML;lay(this).hasClass(k)||(s.range?d[T][D[t]]=e:y[D[t]]=e,lay(a).find("."+x).removeClass(x),lay(this).addClass(x),r(),o(),(d.endDate||"time"===s.type||"datetime"===s.type&&s.fullPanel)&&d.done(null,"change"),d.setBtnStatus())})})),d},I.prototype.listYM=[],I.prototype.closeList=function(){var a=this;a.config;lay.each(a.elemCont,function(e,t){lay(this).find("."+w).remove(),lay(a.elemMain[e]).removeClass("laydate-ym-show laydate-time-show")}),lay(a.elem).find("."+M).remove()},I.prototype.setBtnStatus=function(e,t,a){var n=this,i=n.config,l=n.lang(),r=lay(n.footer).find(C);i.range&&"time"!==i.type&&(t=t||(n.rangeLinked?n.startDate:i.dateTime),a=a||n.endDate,i=!n.endState||n.newDate(t).getTime()>n.newDate(a).getTime(),n.limit({date:t})||n.limit({date:a})?r.addClass(k):r[i?"addClass":"removeClass"](k),e&&i&&n.hint("string"==typeof e?l.timeout.replace(/\u65e5\u671f/g,e):l.timeout))},I.prototype.parse=function(e,t){var a=this,n=a.config,t=t||("end"==e?lay.extend({},a.endDate,a.endTime):n.range?lay.extend({},a.rangeLinked?a.startDate:n.dateTime,a.startTime):n.dateTime),t=v.parse(t,a.format,1);return n.range&&e===undefined?t+" "+a.rangeStr+" "+a.parse("end"):t},I.prototype.newDate=function(e){return e=e||{},new Date(e.year||1,e.month||0,e.date||1,e.hours||0,e.minutes||0,e.seconds||0)},I.prototype.getDateTime=function(e){return this.newDate(e).getTime()},I.prototype.setValue=function(e){var t=this,a=t.config,n=t.bindElem||a.elem[0];return"static"===a.position||(e=e||"",t.isInput(n)?lay(n).val(e):(a=t.rangeElem)?("array"!==layui.type(e)&&(e=e.split(" "+t.rangeStr+" ")),a[0].val(e[0]||""),a[1].val(e[1]||"")):(0===lay(n).find("*").length&&lay(n).html(e),lay(n).attr("lay-date",e))),t},I.prototype.preview=function(){var e,t=this,a=t.config;a.isPreview&&(e=lay(t.elem).find("."+T),a=!a.range||(t.rangeLinked?t.endState:t.endDate)?t.parse():"",e.html(a),e.html()&&(e.css({color:"#5FB878"}),setTimeout(function(){e.css({color:"#777"})},300)))},I.prototype.renderAdditional=function(){this.config.fullPanel&&this.list("time",0)},I.prototype.stampRange=function(){var n,i=this,l=i.config,r=i.rangeLinked?i.startDate:l.dateTime,e=lay(i.elem).find("td");l.range&&!i.endState&&lay(i.footer).find(C).addClass(k),r=r&&i.newDate({year:r.year,month:r.month,date:r.date}).getTime(),n=i.endState&&i.endDate&&i.newDate({year:i.endDate.year,month:i.endDate.month,date:i.endDate.date}).getTime(),lay.each(e,function(e,t){var a=lay(t).attr("lay-ymd").split("-"),a=i.newDate({year:a[0],month:a[1]-1,date:a[2]}).getTime();l.rangeLinked&&!i.startDate&&a===i.newDate(i.systemDate()).getTime()&&lay(t).addClass(lay(t).hasClass(s)||lay(t).hasClass(y)?"":"laydate-day-now"),lay(t).removeClass(o+" "+x),a!==r&&a!==n||(i.rangeLinked||!i.rangeLinked&&(e<42?a===r:a===n))&&lay(t).addClass(lay(t).hasClass(s)||lay(t).hasClass(y)?o:x),rn.getDateTime(i.max)&&(n[t]={hours:i.max.hours,minutes:i.max.minutes,seconds:i.max.seconds},lay.extend(l,n[t])))}),a||(n.startDate=lay.extend({},l)),n.endState&&!n.limit({date:n.thisDateTime(1-a)})&&(((r=n.endState&&n.autoCalendarModel.auto?n.autoCalendarModel():r)||n.rangeLinked&&n.endState)&&n.newDate(n.startDate)>n.newDate(n.endDate)&&(e=n.startDate.year===n.endDate.year&&n.startDate.month===n.endDate.month&&n.startDate.date===n.endDate.date,o=n.startDate,n.startDate=lay.extend({},n.endDate,e?{}:n.startTime),i.dateTime=lay.extend({},n.startDate),n.endDate=lay.extend({},o,e?{}:n.endTime),e&&(o=n.startTime,n.startTime=n.endTime,n.endTime=o)),r&&(i.dateTime=lay.extend({},n.startDate))),n.rangeLinked?(e=lay.extend({},l),!t||a||r||(o=n.getAsYM(l.year,l.month,"sub"),lay.extend(i.dateTime,{year:o[0],month:o[1]})),n.calendar(e,t,r?"init":null)):n.calendar(null,a,r?"init":null),n.endState&&n.done(null,"change")):"static"===i.position?n.calendar().done().done(null,"change"):"date"===i.type?i.autoConfirm?n.setValue(n.parse()).done().remove():n.calendar().done(null,"change"):"datetime"===i.type&&n.calendar().done(null,"change"))},I.prototype.tool=function(t,e){var a=this,n=a.config,i=a.lang(),l=n.dateTime,r="static"===n.position,o={datetime:function(){lay(t).hasClass(k)||(a.list("time",0),n.range&&a.list("time",1),lay(t).attr("lay-type","date").html(a.lang().dateTips))},date:function(){a.closeList(),lay(t).attr("lay-type","datetime").html(a.lang().timeTips)},clear:function(){r&&(lay.extend(l,a.firstDate),a.calendar()),n.range&&(delete n.dateTime,delete a.endDate,delete a.startTime,delete a.endTime),a.setValue(""),a.done(["",{},{}]).remove()},now:function(){var e=new Date;if(lay(t).hasClass(k))return a.hint(i.tools.now+", "+i.invalidDate);lay.extend(l,a.systemDate(),{hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}),a.setValue(a.parse()),r&&a.calendar(),a.done().remove()},confirm:function(){if(n.range){if(lay(t).hasClass(k))return a.hint("time"===n.type?i.timeout.replace(/\u65e5\u671f/g,"\u65f6\u95f4"):i.timeout)}else if(lay(t).hasClass(k))return a.hint(i.invalidDate);a.setValue(a.parse()),a.done().remove()}};o[e]&&o[e]()},I.prototype.change=function(n){var i=this,l=i.config,r=i.thisDateTime(n),o=l.range&&("year"===l.type||"month"===l.type),d=i.elemCont[n||0],s=i.listYM[n],e=function(e){var t=lay(d).find(".laydate-year-list")[0],a=lay(d).find(".laydate-month-list")[0];return t&&(s[0]=e?s[0]-15:s[0]+15,i.list("year",n)),a&&(e?s[0]--:s[0]++,i.list("month",n)),(t||a)&&(lay.extend(r,{year:s[0]}),o&&(r.year=s[0]),l.range||i.done(null,"change"),l.range||i.limit({elem:lay(i.footer).find(C),date:{year:s[0]}})),i.setBtnStatus(),t||a};return{prevYear:function(){e("sub")||(i.rangeLinked?(l.dateTime.year--,i.checkDate("limit").calendar(null,null,"init")):(r.year--,i.checkDate("limit").calendar(null,n),i.autoCalendarModel.auto?i.choose(lay(d).find("td.layui-this"),n):i.done(null,"change")))},prevMonth:function(){i.rangeLinked&&(r=l.dateTime);var e=i.getAsYM(r.year,r.month,"sub");lay.extend(r,{year:e[0],month:e[1]}),i.checkDate("limit").calendar(null,null,"init"),i.rangeLinked||(i.autoCalendarModel.auto?i.choose(lay(d).find("td.layui-this"),n):i.done(null,"change"))},nextMonth:function(){i.rangeLinked&&(r=l.dateTime);var e=i.getAsYM(r.year,r.month);lay.extend(r,{year:e[0],month:e[1]}),i.checkDate("limit").calendar(null,null,"init"),i.rangeLinked||(i.autoCalendarModel.auto?i.choose(lay(d).find("td.layui-this"),n):i.done(null,"change"))},nextYear:function(){e()||(i.rangeLinked?(l.dateTime.year++,i.checkDate("limit").calendar(null,0,"init")):(r.year++,i.checkDate("limit").calendar(null,n),i.autoCalendarModel.auto?i.choose(lay(d).find("td.layui-this"),n):i.done(null,"change")))}}},I.prototype.changeEvent=function(){var i=this;i.config;lay(i.elem).on("click",function(e){lay.stope(e)}).on("mousedown",function(e){lay.stope(e)}),lay.each(i.elemHeader,function(n,e){lay(e[0]).on("click",function(e){i.change(n).prevYear()}),lay(e[1]).on("click",function(e){i.change(n).prevMonth()}),lay(e[2]).find("span").on("click",function(e){var t=lay(this),a=t.attr("lay-ym"),t=t.attr("lay-type");a&&(a=a.split("-"),i.listYM[n]=[0|a[0],0|a[1]],i.list(t,n),lay(i.footer).find("."+E).addClass(k))}),lay(e[3]).on("click",function(e){i.change(n).nextMonth()}),lay(e[4]).on("click",function(e){i.change(n).nextYear()})}),lay.each(i.table,function(e,t){lay(t).find("td").on("click",function(){i.choose(lay(this),e)})}),lay(i.footer).find("span").on("click",function(){var e=lay(this).attr("lay-type");i.tool(this,e)})},I.prototype.isInput=function(e){return/input|textarea/.test(e.tagName.toLocaleLowerCase())||/INPUT|TEXTAREA/.test(e.tagName)},I.prototype.events=function(){var e,t=this,a=t.config;a.elem[0]&&!a.elem[0].eventHandler&&(a.elem.on(a.trigger,e=function(){v.thisId!==a.id&&(t.bindElem=this,t.render())}),a.elem[0].eventHandler=!0,a.eventElem.on(a.trigger,e),t.destroy=function(){t.remove(),a.elem.off(a.trigger,e),a.elem.removeAttr("lay-key"),a.elem[0].eventHandler=!1,a.eventElem.off(a.trigger,e),a.eventElem.removeAttr("lay-key"),delete d.that[a.id]})},d.that={},d.getThis=function(e){var t=d.that[e];return!t&&n&&layui.hint().error(e?a+" instance with ID '"+e+"' not found":"ID argument required"),t},l.run=function(n){n(p).on("mousedown",function(e){var t,a;!v.thisId||(t=d.getThis(v.thisId))&&(a=t.config,e.target!==a.elem[0]&&e.target!==a.eventElem[0]&&e.target!==n(a.closeStop)[0]&&t.remove())}).on("keydown",function(e){var t;!v.thisId||(t=d.getThis(v.thisId))&&"static"!==t.config.position&&13===e.keyCode&&n("#"+t.elemID)[0]&&t.elemID===I.thisElemDate&&(e.preventDefault(),n(t.footer).find(C)[0].click())}),n(i).on("resize",function(){if(v.thisId){var e=d.getThis(v.thisId);if(e)return!(!e.elem||!n(".layui-laydate")[0])&&void e.position()}})},v.render=function(e){e=new I(e);return d.call(e)},v.getInst=function(e){e=d.getThis(e);if(e)return e.inst},v.parse=function(a,n,i){return a=a||{},n=((n="string"==typeof n?d.formatArr(n):n)||[]).concat(),lay.each(n,function(e,t){/yyyy|y/.test(t)?n[e]=lay.digit(a.year,t.length):/MM|M/.test(t)?n[e]=lay.digit(a.month+(i||0),t.length):/dd|d/.test(t)?n[e]=lay.digit(a.date,t.length):/HH|H/.test(t)?n[e]=lay.digit(a.hours,t.length):/mm|m/.test(t)?n[e]=lay.digit(a.minutes,t.length):/ss|s/.test(t)&&(n[e]=lay.digit(a.seconds,t.length))}),n.join("")},v.getEndDate=function(e,t){var a=new Date;return a.setFullYear(t||a.getFullYear(),e||a.getMonth()+1,1),new Date(a.getTime()-864e5).getDate()},v.close=function(e){e=d.getThis(e||v.thisId);if(e)return e.remove()},v.destroy=function(e){e=d.getThis(e||v.thisId);if(e)return e.destroy()},n?(v.ready(),layui.define("lay",function(e){v.path=layui.cache.dir,l.run(lay),e(a,v)})):"function"==typeof define&&define.amd?define(function(){return l.run(lay),v}):(v.ready(),l.run(i.lay),i.laydate=v)}(window,window.document);!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e):function(e){if(e.document)return t(e);throw new Error("jQuery requires a window with a document")}:t(e)}("undefined"!=typeof window?window:this,function(T,M){var f=[],g=T.document,c=f.slice,O=f.concat,R=f.push,P=f.indexOf,B={},W=B.toString,m=B.hasOwnProperty,y={},e="1.12.4",C=function(e,t){return new C.fn.init(e,t)},I=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,$=/^-ms-/,z=/-([\da-z])/gi,X=function(e,t){return t.toUpperCase()};function U(e){var t=!!e&&"length"in e&&e.length,n=C.type(e);return"function"!==n&&!C.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+a+")"+a+"*"),ee=new RegExp("="+a+"*([^\\]'\"]*?)"+a+"*\\]","g"),te=new RegExp(G),ne=new RegExp("^"+s+"$"),f={ID:new RegExp("^#("+s+")"),CLASS:new RegExp("^\\.("+s+")"),TAG:new RegExp("^("+s+"|[*])"),ATTR:new RegExp("^"+J),PSEUDO:new RegExp("^"+G),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+a+"*(even|odd|(([+-]|)(\\d*)n|)"+a+"*(?:([+-]|)"+a+"*(\\d+)|))"+a+"*\\)|)","i"),bool:new RegExp("^(?:"+Y+")$","i"),needsContext:new RegExp("^"+a+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+a+"*((?:-\\d)?\\d*)"+a+"*\\)|)(?=[^-]|$)","i")},re=/^(?:input|select|textarea|button)$/i,ie=/^h\d$/i,c=/^[^{]+\{\s*\[native \w/,oe=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ae=/[+~]/,se=/'|\\/g,d=new RegExp("\\\\([\\da-f]{1,6}"+a+"?|("+a+")|.)","ig"),p=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(65536+r):String.fromCharCode(r>>10|55296,1023&r|56320)},ue=function(){C()};try{D.apply(n=V.call(v.childNodes),v.childNodes),n[v.childNodes.length].nodeType}catch(F){D={apply:n.length?function(e,t){U.apply(e,V.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function H(e,t,n,r){var i,o,a,s,u,l,c,f,d=t&&t.ownerDocument,p=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==p&&9!==p&&11!==p)return n;if(!r&&((t?t.ownerDocument||t:v)!==E&&C(t),t=t||E,N)){if(11!==p&&(l=oe.exec(e)))if(i=l[1]){if(9===p){if(!(a=t.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(d&&(a=d.getElementById(i))&&y(t,a)&&a.id===i)return n.push(a),n}else{if(l[2])return D.apply(n,t.getElementsByTagName(e)),n;if((i=l[3])&&g.getElementsByClassName&&t.getElementsByClassName)return D.apply(n,t.getElementsByClassName(i)),n}if(g.qsa&&!A[e+" "]&&(!m||!m.test(e))){if(1!==p)d=t,f=e;else if("object"!==t.nodeName.toLowerCase()){for((s=t.getAttribute("id"))?s=s.replace(se,"\\$&"):t.setAttribute("id",s=k),o=(c=w(e)).length,u=ne.test(s)?"#"+s:"[id='"+s+"']";o--;)c[o]=u+" "+_(c[o]);f=c.join(","),d=ae.test(e)&&de(t.parentNode)||t}if(f)try{return D.apply(n,d.querySelectorAll(f)),n}catch(h){}finally{s===k&&t.removeAttribute("id")}}}return P(e.replace(L,"$1"),t,n,r)}function le(){var n=[];function r(e,t){return n.push(e+" ")>b.cacheLength&&delete r[n.shift()],r[e+" "]=t}return r}function q(e){return e[k]=!0,e}function h(e){var t=E.createElement("div");try{return!!e(t)}catch(F){return!1}finally{t.parentNode&&t.parentNode.removeChild(t)}}function ce(e,t){for(var n=e.split("|"),r=n.length;r--;)b.attrHandle[n[r]]=t}function fe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function x(a){return q(function(o){return o=+o,q(function(e,t){for(var n,r=a([],e.length,o),i=r.length;i--;)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function de(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in g=H.support={},O=H.isXML=function(e){e=e&&(e.ownerDocument||e).documentElement;return!!e&&"HTML"!==e.nodeName},C=H.setDocument=function(e){var e=e?e.ownerDocument||e:v;return e!==E&&9===e.nodeType&&e.documentElement&&(t=(E=e).documentElement,N=!O(E),(e=E.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",ue,!1):e.attachEvent&&e.attachEvent("onunload",ue)),g.attributes=h(function(e){return e.className="i",!e.getAttribute("className")}),g.getElementsByTagName=h(function(e){return e.appendChild(E.createComment("")),!e.getElementsByTagName("*").length}),g.getElementsByClassName=c.test(E.getElementsByClassName),g.getById=h(function(e){return t.appendChild(e).id=k,!E.getElementsByName||!E.getElementsByName(k).length}),g.getById?(b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&N)return(e=t.getElementById(e))?[e]:[]},b.filter.ID=function(e){var t=e.replace(d,p);return function(e){return e.getAttribute("id")===t}}):(delete b.find.ID,b.filter.ID=function(e){var t=e.replace(d,p);return function(e){e="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return e&&e.value===t}}),b.find.TAG=g.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):g.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"!==e)return o;for(;n=o[i++];)1===n.nodeType&&r.push(n);return r},b.find.CLASS=g.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&N)return t.getElementsByClassName(e)},r=[],m=[],(g.qsa=c.test(E.querySelectorAll))&&(h(function(e){t.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+a+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+a+"*(?:value|"+Y+")"),e.querySelectorAll("[id~="+k+"-]").length||m.push("~="),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||m.push(".#.+[+~]")}),h(function(e){var t=E.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+a+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")})),(g.matchesSelector=c.test(i=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.msMatchesSelector))&&h(function(e){g.disconnectedMatch=i.call(e,"div"),i.call(e,"[s!='']:x"),r.push("!=",G)}),m=m.length&&new RegExp(m.join("|")),r=r.length&&new RegExp(r.join("|")),e=c.test(t.compareDocumentPosition),y=e||c.test(t.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,t=t&&t.parentNode;return e===t||!(!t||1!==t.nodeType||!(n.contains?n.contains(t):e.compareDocumentPosition&&16&e.compareDocumentPosition(t)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},$=e?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!g.sortDetached&&t.compareDocumentPosition(e)===n?e===E||e.ownerDocument===v&&y(v,e)?-1:t===E||t.ownerDocument===v&&y(v,t)?1:u?j(u,e)-j(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===E?-1:t===E?1:i?-1:o?1:u?j(u,e)-j(u,t):0;if(i===o)return fe(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?fe(a[r],s[r]):a[r]===v?-1:s[r]===v?1:0}),E},H.matches=function(e,t){return H(e,null,null,t)},H.matchesSelector=function(e,t){if((e.ownerDocument||e)!==E&&C(e),t=t.replace(ee,"='$1']"),g.matchesSelector&&N&&!A[t+" "]&&(!r||!r.test(t))&&(!m||!m.test(t)))try{var n=i.call(e,t);if(n||g.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(F){}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(d,p),e[3]=(e[3]||e[4]||e[5]||"").replace(d,p),"~="===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]||H.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]&&H.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return f.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&te.test(n)&&(t=w(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(d,p).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=W[e+" "];return t||(t=new RegExp("(^|"+a+")"+e+"("+a+"|$)"))&&W(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(e){e=H.attr(e,t);return null==e?"!="===n:!n||(e+="","="===n?e===r:"!="===n?e!==r:"^="===n?r&&0===e.indexOf(r):"*="===n?r&&-1(?:<\/\1>|)$/,G=/^.[^:#\[\.,]*$/;function K(e,n,r){if(C.isFunction(n))return C.grep(e,function(e,t){return!!n.call(e,t,e)!==r});if(n.nodeType)return C.grep(e,function(e){return e===n!==r});if("string"==typeof n){if(G.test(n))return C.filter(n,e,r);n=C.filter(n,e)}return C.grep(e,function(e){return-1)[^>]*|#([\w-]*))$/,ee=((C.fn.init=function(e,t,n){if(!e)return this;if(n=n||Q,"string"!=typeof e)return e.nodeType?(this.context=this[0]=e,this.length=1,this):C.isFunction(e)?"undefined"!=typeof n.ready?n.ready(e):e(C):(e.selector!==undefined&&(this.selector=e.selector,this.context=e.context),C.makeArray(e,this));if(!(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:Z.exec(e))||!r[1]&&t)return(!t||t.jquery?t||n:this.constructor(t)).find(e);if(r[1]){if(t=t instanceof C?t[0]:t,C.merge(this,C.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:g,!0)),J.test(r[1])&&C.isPlainObject(t))for(var r in t)C.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}if((n=g.getElementById(r[2]))&&n.parentNode){if(n.id!==r[2])return Q.find(e);this.length=1,this[0]=n}return this.context=g,this.selector=e,this}).prototype=C.fn,Q=C(g),/^(?:parents|prev(?:Until|All))/),te={children:!0,contents:!0,next:!0,prev:!0};function ne(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}C.fn.extend({has:function(e){var t,n=C(e,this),r=n.length;return this.filter(function(){for(t=0;t
    a",y.leadingWhitespace=3===S.firstChild.nodeType,y.tbody=!S.getElementsByTagName("tbody").length,y.htmlSerialize=!!S.getElementsByTagName("link").length,y.html5Clone="<:nav>"!==g.createElement("nav").cloneNode(!0).outerHTML,q.type="checkbox",q.checked=!0,k.appendChild(q),y.appendChecked=q.checked,S.innerHTML="",y.noCloneChecked=!!S.cloneNode(!0).lastChild.defaultValue,k.appendChild(S),(q=g.createElement("input")).setAttribute("type","radio"),q.setAttribute("checked","checked"),q.setAttribute("name","t"),S.appendChild(q),y.checkClone=S.cloneNode(!0).cloneNode(!0).lastChild.checked,y.noCloneEvent=!!S.addEventListener,S[C.expando]=1,y.attributes=!S.getAttribute(C.expando);var x={option:[1,""],legend:[1,"
    ","
    "],area:[1,"",""],param:[1,"",""],thead:[1,"","
    "],tr:[2,"","
    "],col:[2,"","
    "],td:[3,"","
    "],_default:y.htmlSerialize?[0,"",""]:[1,"X
    ","
    "]};function b(e,t){var n,r,i=0,o="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):undefined;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||C.nodeName(r,t)?o.push(r):C.merge(o,b(r,t));return t===undefined||t&&C.nodeName(e,t)?C.merge([e],o):o}function we(e,t){for(var n,r=0;null!=(n=e[r]);r++)C._data(n,"globalEval",!t||C._data(t[r],"globalEval"))}x.optgroup=x.option,x.tbody=x.tfoot=x.colgroup=x.caption=x.thead,x.th=x.td;var Te=/<|&#?\w+;/,Ce=/"!==f[1]||Ce.test(a)?0:u:u.firstChild)&&a.childNodes.length;o--;)C.nodeName(c=a.childNodes[o],"tbody")&&!c.childNodes.length&&a.removeChild(c);for(C.merge(h,u.childNodes),u.textContent="";u.firstChild;)u.removeChild(u.firstChild);u=p.lastChild}else h.push(t.createTextNode(a));for(u&&p.removeChild(u),y.appendChecked||C.grep(b(h,"input"),Ee),g=0;a=h[g++];)if(r&&-1]","i"),Pe=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,Be=/\s*$/g,ze=be(g).appendChild(g.createElement("div"));function Xe(e,t){return C.nodeName(e,"table")&&C.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ue(e){return e.type=(null!==C.find.attr(e,"type"))+"/"+e.type,e}function Ve(e){var t=Ie.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Ye(e,t){if(1===t.nodeType&&C.hasData(e)){var n,r,i,e=C._data(e),o=C._data(t,e),a=e.events;if(a)for(n in delete o.handle,o.events={},a)for(r=0,i=a[n].length;r")},clone:function(e,t,n){var r,i,o,a,s,u=C.contains(e.ownerDocument,e);if(y.html5Clone||C.isXMLDoc(e)||!Re.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(ze.innerHTML=e.outerHTML,ze.removeChild(o=ze.firstChild)),!(y.noCloneEvent&&y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||C.isXMLDoc(e)))for(r=b(o),s=b(e),a=0;null!=(i=s[a]);++a)if(r[a]){f=c=l=p=d=void 0;var l,c,f,d=i,p=r[a];if(1===p.nodeType){if(l=p.nodeName.toLowerCase(),!y.noCloneEvent&&p[C.expando]){for(c in(f=C._data(p)).events)C.removeEvent(p,c,f.handle);p.removeAttribute(C.expando)}"script"===l&&p.text!==d.text?(Ue(p).text=d.text,Ve(p)):"object"===l?(p.parentNode&&(p.outerHTML=d.outerHTML),y.html5Clone&&d.innerHTML&&!C.trim(p.innerHTML)&&(p.innerHTML=d.innerHTML)):"input"===l&&ge.test(d.type)?(p.defaultChecked=p.checked=d.checked,p.value!==d.value&&(p.value=d.value)):"option"===l?p.defaultSelected=p.selected=d.defaultSelected:"input"!==l&&"textarea"!==l||(p.defaultValue=d.defaultValue)}}if(t)if(n)for(s=s||b(e),r=r||b(o),a=0;null!=(i=s[a]);a++)Ye(i,r[a]);else Ye(e,o);return 0<(r=b(o,"script")).length&&we(r,!u&&b(e,"script")),r=s=i=null,o},cleanData:function(e,t){for(var n,r,i,o,a=0,s=C.expando,u=C.cache,l=y.attributes,c=C.event.special;null!=(n=e[a]);a++)if((t||v(n))&&(o=(i=n[s])&&u[i])){if(o.events)for(r in o.events)c[r]?C.event.remove(n,r):C.removeEvent(n,r,o.handle);u[i]&&(delete u[i],l||"undefined"==typeof n.removeAttribute?n[s]=undefined:n.removeAttribute(s),f.push(i))}}}),C.fn.extend({domManip:w,detach:function(e){return Je(this,e,!0)},remove:function(e){return Je(this,e)},text:function(e){return d(this,function(e){return e===undefined?C.text(this):this.empty().append((this[0]&&this[0].ownerDocument||g).createTextNode(e))},null,e,arguments.length)},append:function(){return w(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Xe(this,e).appendChild(e)})},prepend:function(){return w(this,arguments,function(e){var t;1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(t=Xe(this,e)).insertBefore(e,t.firstChild)})},before:function(){return w(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return w(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&C.cleanData(b(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&C.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return C.clone(this,e,t)})},html:function(e){return d(this,function(e){var t=this[0]||{},n=0,r=this.length;if(e===undefined)return 1===t.nodeType?t.innerHTML.replace(Oe,""):undefined;if("string"==typeof e&&!Be.test(e)&&(y.htmlSerialize||!Re.test(e))&&(y.leadingWhitespace||!ve.test(e))&&!x[(me.exec(e)||["",""])[1].toLowerCase()]){e=C.htmlPrefilter(e);try{for(;n")).appendTo(t.documentElement))[0].contentWindow||Ge[0].contentDocument).document).write(),t.close(),n=Qe(e,t),Ge.detach()),Ke[e]=n),n}var n,et,tt,nt,rt,it,ot,a,at=/^margin/,st=new RegExp("^("+e+")(?!px)[a-z%]+$","i"),ut=function(e,t,n,r){var i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.apply(e,r||[]),t)e.style[i]=o[i];return r},lt=g.documentElement;function t(){var e,t=g.documentElement;t.appendChild(ot),a.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",n=tt=it=!1,et=rt=!0,T.getComputedStyle&&(e=T.getComputedStyle(a),n="1%"!==(e||{}).top,it="2px"===(e||{}).marginLeft,tt="4px"===(e||{width:"4px"}).width,a.style.marginRight="50%",et="4px"===(e||{marginRight:"4px"}).marginRight,(e=a.appendChild(g.createElement("div"))).style.cssText=a.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",e.style.marginRight=e.style.width="0",a.style.width="1px",rt=!parseFloat((T.getComputedStyle(e)||{}).marginRight),a.removeChild(e)),a.style.display="none",(nt=0===a.getClientRects().length)&&(a.style.display="",a.innerHTML="
    t
    ",a.childNodes[0].style.borderCollapse="separate",(e=a.getElementsByTagName("td"))[0].style.cssText="margin:0;border:0;padding:0;display:none",(nt=0===e[0].offsetHeight)&&(e[0].style.display="",e[1].style.display="none",nt=0===e[0].offsetHeight)),t.removeChild(ot)}ot=g.createElement("div"),(a=g.createElement("div")).style&&(a.style.cssText="float:left;opacity:.5",y.opacity="0.5"===a.style.opacity,y.cssFloat=!!a.style.cssFloat,a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===a.style.backgroundClip,(ot=g.createElement("div")).style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",a.innerHTML="",ot.appendChild(a),y.boxSizing=""===a.style.boxSizing||""===a.style.MozBoxSizing||""===a.style.WebkitBoxSizing,C.extend(y,{reliableHiddenOffsets:function(){return null==n&&t(),nt},boxSizingReliable:function(){return null==n&&t(),tt},pixelMarginRight:function(){return null==n&&t(),et},pixelPosition:function(){return null==n&&t(),n},reliableMarginRight:function(){return null==n&&t(),rt},reliableMarginLeft:function(){return null==n&&t(),it}}));var l,p,ct=/^(top|right|bottom|left)$/;function ft(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}T.getComputedStyle?(l=function(e){var t=e.ownerDocument.defaultView;return(t=t&&t.opener?t:T).getComputedStyle(e)},p=function(e,t,n){var r,i,o=e.style;return""!==(i=(n=n||l(e))?n.getPropertyValue(t)||n[t]:undefined)&&i!==undefined||C.contains(e.ownerDocument,e)||(i=C.style(e,t)),n&&!y.pixelMarginRight()&&st.test(i)&&at.test(t)&&(e=o.width,t=o.minWidth,r=o.maxWidth,o.minWidth=o.maxWidth=o.width=i,i=n.width,o.width=e,o.minWidth=t,o.maxWidth=r),i===undefined?i:i+""}):lt.currentStyle&&(l=function(e){return e.currentStyle},p=function(e,t,n){var r,i,o,a=e.style;return null==(n=(n=n||l(e))?n[t]:undefined)&&a&&a[t]&&(n=a[t]),st.test(n)&&!ct.test(t)&&(r=a.left,(o=(i=e.runtimeStyle)&&i.left)&&(i.left=e.currentStyle.left),a.left="fontSize"===t?"1em":n,n=a.pixelLeft+"px",a.left=r,o&&(i.left=o)),n===undefined?n:n+""||"auto"});var dt=/alpha\([^)]*\)/i,pt=/opacity\s*=\s*([^)]*)/i,ht=/^(none|table(?!-c[ea]).+)/,gt=new RegExp("^("+e+")(.*)$","i"),mt={position:"absolute",visibility:"hidden",display:"block"},yt={letterSpacing:"0",fontWeight:"400"},vt=["Webkit","O","Moz","ms"],xt=g.createElement("div").style;function bt(e){if(e in xt)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=vt.length;n--;)if((e=vt[n]+t)in xt)return e}function wt(e,t){for(var n,r,i,o=[],a=0,s=e.length;a
    a",F=q.getElementsByTagName("a")[0],k.setAttribute("type","checkbox"),q.appendChild(k),(F=q.getElementsByTagName("a")[0]).style.cssText="top:1px",y.getSetAttribute="t"!==q.className,y.style=/top/.test(F.getAttribute("style")),y.hrefNormalized="/a"===F.getAttribute("href"),y.checkOn=!!k.value,y.optSelected=e.selected,y.enctype=!!g.createElement("form").enctype,S.disabled=!0,y.optDisabled=!e.disabled,(k=g.createElement("input")).setAttribute("value",""),y.input=""===k.getAttribute("value"),k.value="t",k.setAttribute("type","radio"),y.radioValue="t"===k.value;var Lt=/\r/g,Ht=/[\x20\t\r\n\f]+/g;C.fn.extend({val:function(t){var n,e,r,i=this[0];return arguments.length?(r=C.isFunction(t),this.each(function(e){1===this.nodeType&&(null==(e=r?t.call(this,e,C(this).val()):t)?e="":"number"==typeof e?e+="":C.isArray(e)&&(e=C.map(e,function(e){return null==e?"":e+""})),(n=C.valHooks[this.type]||C.valHooks[this.nodeName.toLowerCase()])&&"set"in n&&n.set(this,e,"value")!==undefined||(this.value=e))})):i?(n=C.valHooks[i.type]||C.valHooks[i.nodeName.toLowerCase()])&&"get"in n&&(e=n.get(i,"value"))!==undefined?e:"string"==typeof(e=i.value)?e.replace(Lt,""):null==e?"":e:void 0}}),C.extend({valHooks:{option:{get:function(e){var t=C.find.attr(e,"value");return null!=t?t:C.trim(C.text(e)).replace(Ht," ")}},select:{get:function(e){for(var t,n=e.options,r=e.selectedIndex,i="select-one"===e.type||r<0,o=i?null:[],a=i?r+1:n.length,s=r<0?a:i?r:0;s").append(C.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},C.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){C.fn[t]=function(e){return this.on(t,e)}}),C.expr.filters.animated=function(t){return C.grep(C.timers,function(e){return t===e.elem}).length},C.offset={setOffset:function(e,t,n){var r,i,o,a,s=C.css(e,"position"),u=C(e),l={};"static"===s&&(e.style.position="relative"),o=u.offset(),r=C.css(e,"top"),a=C.css(e,"left"),s=("absolute"===s||"fixed"===s)&&-1'+(s?a.title[0]:a.title)+"":"";return a.zIndex=o,t([a.shade?'
    ':"",'
    '+(e&&2!=a.type?"":s)+"'+(n=["layui-icon-tips","layui-icon-ok","layui-icon-close-fill","layui-icon-help","layui-icon-password","layui-icon-face-cry","layui-icon-face-smile"],o="layui-anim layui-anim-rotate layui-anim-loop",0==a.type&&-1!==a.icon?'':3==a.type?(i=["layui-icon-loading","layui-icon-loading-1"],2==a.icon?'
    ':''):"")+((1!=a.type||!e)&&a.content||"")+'
    '+(n=[],l&&(n.push(''),n.push('')),a.closeBtn&&n.push(''),n.join(""))+"
    "+(a.btn?function(){var e="";"string"==typeof a.btn&&(a.btn=[a.btn]);for(var t=0,i=a.btn.length;t'+a.btn[t]+"";return'
    '+e+"
    "}():"")+(a.resize?'':"")+""],s,m('
    ')),this},t.pt.creat=function(){var e,n=this,a=n.config,o=n.index,s="object"==typeof(r=a.content),l=m("body");if(!a.id||!m("."+d[0]).find("#"+a.id)[0]){switch(a.removeFocus&&document.activeElement.blur(),"string"==typeof a.area&&(a.area="auto"===a.area?["",""]:[a.area,""]),a.shift&&(a.anim=a.shift),6==h.ie&&(a.fixed=!1),a.type){case 0:a.btn="btn"in a?a.btn:f.btn[0],h.closeAll("dialog");break;case 2:var r=a.content=s?a.content:[a.content||"","auto"];a.content='';break;case 3:delete a.title,delete a.closeBtn,-1===a.icon&&a.icon,h.closeAll("loading");break;case 4:s||(a.content=[a.content,"body"]),a.follow=a.content[1],a.content=a.content[0]+'',delete a.title,a.tips="object"==typeof a.tips?a.tips:[a.tips,!0],a.tipsMore||h.closeAll("tips")}n.vessel(s,function(e,t,i){l.append(e[0]),s?2==a.type||4==a.type?m("body").append(e[1]):r.parents("."+d[0])[0]||(r.data("display",r.css("display")).show().addClass("layui-layer-wrap").wrap(e[1]),m("#"+d[0]+o).find("."+d[5]).before(t)):l.append(e[1]),m("#"+d.MOVE)[0]||l.append(f.moveElem=i),n.layero=m("#"+d[0]+o),n.shadeo=m("#"+d.SHADE+o),a.scrollbar||d.html.css("overflow","hidden").attr("layer-full",o)}).auto(o),n.shadeo.css({"background-color":a.shade[1]||"#000",opacity:a.shade[0]||a.shade}),2==a.type&&6==h.ie&&n.layero.find("iframe").attr("src",r[0]),4==a.type?n.tips():(n.offset(),parseInt(f.getStyle(document.getElementById(d.MOVE),"z-index"))||(n.layero.css("visibility","hidden"),h.ready(function(){n.offset(),n.layero.css("visibility","visible")}))),!a.fixed||f.events.resize[n.index]||(f.events.resize[n.index]=function(){n.resize()},c.on("resize",f.events.resize[n.index])),a.time<=0||setTimeout(function(){h.close(n.index)},a.time),n.move().callback(),d.anim[a.anim]&&(e="layer-anim "+d.anim[a.anim],n.layero.addClass(e).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){m(this).removeClass(e)})),a.isOutAnim&&n.layero.data("isOutAnim",!0)}},t.pt.resize=function(){var e=this,t=e.config;e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(e.index),4==t.type&&e.tips()},t.pt.auto=function(e){var t=this.config,i=m("#"+d[0]+e),n=(""===t.area[0]&&0t.maxWidth&&i.width(t.maxWidth)),[i.innerWidth(),i.innerHeight()]),a=i.find(d[1]).outerHeight()||0,o=i.find("."+d[6]).outerHeight()||0,e=function(e){(e=i.find(e)).height(n[1]-a-o-2*(0|parseFloat(e.css("padding-top"))))};return 2===t.type?e("iframe"):""===t.area[1]?0t.maxHeight?(n[1]=t.maxHeight,e("."+d[5])):t.fixed&&n[1]>=c.height()&&(n[1]=c.height(),e("."+d[5])):e("."+d[5]),this},t.pt.offset=function(){var e=this,t=e.config,i=e.layero,n=[i.outerWidth(),i.outerHeight()],a="object"==typeof t.offset;e.offsetTop=(c.height()-n[1])/2,e.offsetLeft=(c.width()-n[0])/2,a?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=c.width()-n[0]:"b"===t.offset?e.offsetTop=c.height()-n[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=c.height()-n[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=c.width()-n[0]):"rb"===t.offset?(e.offsetTop=c.height()-n[1],e.offsetLeft=c.width()-n[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?c.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?c.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=c.scrollTop(),e.offsetLeft+=c.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=c.height()-(i.find(d[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},t.pt.tips=function(){var e=this.config,t=this.layero,i=[t.outerWidth(),t.outerHeight()],n=m(e.follow),a={width:(n=n[0]?n:m("body")).outerWidth(),height:n.outerHeight(),top:n.offset().top,left:n.offset().left},o=t.find(".layui-layer-TipsG"),n=e.tips[0];e.tips[1]||o.remove(),a.autoLeft=function(){0":'",s=i.success;return delete i.success,h.open(m.extend({type:1,btn:["确定","取消"],content:o,skin:"layui-layer-prompt"+g("prompt"),maxWidth:c.width(),success:function(e){(a=e.find(".layui-layer-input")).val(i.value||"").focus(),"function"==typeof s&&s(e)},resize:!1,yes:function(e){var t=a.val();t.length>(i.maxlength||500)?h.tips("最多输入"+(i.maxlength||500)+"个字数",a,{tips:1}):n&&n(t,e,a)}},i))},h.tab=function(n){var a=(n=n||{}).tab||{},o="layui-this",s=n.success;return delete n.success,h.open(m.extend({type:1,skin:"layui-layer-tab"+g("tab"),resize:!1,title:function(){var e=a.length,t=1,i="";if(0'+a[0].title+"";t"+a[t].title+"";return i}(),content:'
      '+function(){var e=a.length,t=1,i="";if(0'+(a[0].content||"no content")+"";t'+(a[t].content||"no content")+"";return i}()+"
    ",success:function(e){var t=e.find(".layui-layer-title").children(),i=e.find(".layui-layer-tabmain").children();t.on("mousedown",function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0;var e=m(this),t=e.index();e.addClass(o).siblings().removeClass(o),i.eq(t).show().siblings().hide(),"function"==typeof n.change&&n.change(t)}),"function"==typeof s&&s(e)}},n))},h.photos=function(n,e,a){var o={};if((n=n||{}).photos){var t=!("string"==typeof n.photos||n.photos instanceof m),i=t?n.photos:{},s=i.data||[],l=i.start||0,r=(o.imgIndex=1+(0|l),n.img=n.img||"img",n.success);if(delete n.success,t){if(0===s.length)return h.msg("没有图片")}else{var c=m(n.photos),f=function(){s=[],c.find(n.img).each(function(e){var t=m(this);t.attr("layer-index",e),s.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(f(),0===s.length)return;if(e||c.on("click",n.img,function(){f();var e=m(this).attr("layer-index");h.photos(m.extend(n,{photos:{start:e,data:s,tab:n.tab},full:n.full}),!0)}),!e)return}o.imgprev=function(e){o.imgIndex--,o.imgIndex<1&&(o.imgIndex=s.length),o.tabimg(e)},o.imgnext=function(e,t){o.imgIndex++,o.imgIndex>s.length&&(o.imgIndex=1,t)||o.tabimg(e)},o.keyup=function(e){var t;o.end||(t=e.keyCode,e.preventDefault(),37===t?o.imgprev(!0):39===t?o.imgnext(!0):27===t&&h.close(o.index))},o.tabimg=function(e){if(!(s.length<=1))return i.start=o.imgIndex-1,h.close(o.index),h.photos(n,!0,e)},o.event=function(){o.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),o.imgprev(!0)}),o.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),o.imgnext(!0)}),m(document).on("keyup",o.keyup)},o.loadi=h.load(1,{shade:!("shade"in n)&&.9,scrollbar:!1});var t=s[l].src,d=function(e){h.close(o.loadi);var t,i=s[l].alt||"";a&&(n.anim=-1),o.index=h.open(m.extend({type:1,id:"layui-layer-photos",area:(e=[e.width,e.height],t=[m(p).width()-100,m(p).height()-100],!n.full&&(e[0]>t[0]||e[1]>t[1])&&((t=[e[0]/t[0],e[1]/t[1]])[1]'+i+''+(t=['
    '],1','','',"
    "].join("")),n.hideFooter||t.push(['
    ','
    ',"

    "+i+"

    ",""+o.imgIndex+" / "+s.length+"",'\u67e5\u770b\u539f\u56fe',"
    ","
    "].join("")),t.push(""),t.join(""))+"",success:function(e,t){o.bigimg=e.find(".layui-layer-phimg"),o.imgsee=e.find(".layui-layer-imgbar"),o.event(e),n.tab&&n.tab(s[l],e),"function"==typeof r&&r(e)},end:function(){o.end=!0,m(document).off("keyup",o.keyup)}},n))},u=function(){h.close(o.loadi),h.msg("当前图片地址异常
    是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){1").addClass(o));layui.each(i.bars,function(e,t){var n=s('
  • ');n.addClass(t.icon).attr({"lay-type":t.type,style:t.style||"background-color: "+i.bgcolor}).html(t.content),n.on("click",function(){var e=s(this).attr("lay-type");"top"===e&&("body"===i.target?s("html,body"):c).animate({scrollTop:0},i.duration),"function"==typeof i.click&&i.click.call(this,e)}),"object"===layui.type(i.on)&&layui.each(i.on,function(e,t){n.on(e,function(){var e=s(this).attr("lay-type");"function"==typeof t&&t.call(this,e)})}),"top"===t.type&&(n.addClass("layui-fixbar-top"),a=n),u.append(n)}),l.find("."+o).remove(),"object"==typeof i.css&&u.css(i.css),l.append(u),a&&(t=function t(){return c.scrollTop()>=i.showHeight?e||(a.show(),e=1):e&&(a.hide(),e=0),t}()),c.on("scroll",function(){t&&(clearTimeout(n),n=setTimeout(function(){t()},100))})},countdown:function(e,t,n){var i=this,a="function"==typeof t,o=new Date(e).getTime(),r=new Date(!t||a?(new Date).getTime():t).getTime(),o=o-r,l=[Math.floor(o/864e5),Math.floor(o/36e5)%24,Math.floor(o/6e4)%60,Math.floor(o/1e3)%60],a=(a&&(n=t),setTimeout(function(){i.countdown(e,r+1e3,n)},1e3));return n&&n(0]|&(?=#[a-zA-Z0-9]+)/g.test(e+="")?e.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,"""):e},unescape:function(e){return e!==undefined&&null!==e||(e=""),(e+="").replace(/\&/g,"&").replace(/\</g,"<").replace(/\>/g,">").replace(/\'/g,"'").replace(/\"/g,'"')},toVisibleArea:function(e){var t,n,i,a,o,r,l,c;(e=s.extend({margin:160,duration:200,type:"y"},e)).scrollElem[0]&&e.thisElem[0]&&(t=e.scrollElem,l=e.thisElem,i=(o="y"===e.type)?"top":"left",a=t[n=o?"scrollTop":"scrollLeft"](),o=t[o?"height":"width"](),r=t.offset()[i],c={},((l=l.offset()[i]-r)>o-e.margin||l."+f,x=function(e){var i=this;i.index=++p.index,i.config=s.extend({},i.config,p.config,e),i.init()};x.prototype.config={trigger:"click",content:"",className:"",style:"",show:!1,isAllowSpread:!0,isSpreadItem:!0,data:[],delay:300,shade:0},x.prototype.reload=function(e){var i=this;i.config=s.extend({},i.config,e),i.init(!0)},x.prototype.init=function(e){var i=this,n=i.config,t=n.elem=s(n.elem);return 1",(n="href"in i?''+l+"":l,t?'
    '+n+("parent"===o?'':"group"===o&&d.isAllowSpread?'':"")+"
    ":'
    '+n+"
    "),"
  • "].join(""))).data("item",i),t&&(a=s('
    '),n=s("
      "),"parent"===o?(a.append(u(n,i.child)),l.append(a)):l.append(u(n,i.child))),r.append(l))}),r},n=['
      ',"
      "].join("");!(e="contextmenu"!==d.trigger&&!lay.isTopElem(d.elem[0])?e:!0)&&d.elem.data(c+"_opened")||(l.elemView=s(n),l.elemView.append(d.content||(e=s('
        '),0no menu'),e)),d.className&&l.elemView.addClass(d.className),d.style&&l.elemView.attr("style",d.style),p.thisId=d.id,l.remove(),i.append(l.elemView),d.elem.data(c+"_opened",!0),n=d.shade?'
        ':"",l.elemView.before(n),l.position(),(y.prevElem=l.elemView).data("prevElem",d.elem),l.elemView.find(".layui-menu").on(o,function(e){layui.stope(e)}),l.elemView.find(".layui-menu li").on("click",function(e){var i=s(this),n=i.data("item")||{},t=n.child&&0t.width()&&(n.addClass(C),(i=n[0].getBoundingClientRect()).left<0&&n.removeClass(C)),i.bottom>t.height()&&n.eq(0).css("margin-top",-(i.bottom-t.height()+5)))}).on("mouseleave",n,function(e){var i=s(this).children("."+w);i.removeClass(C),i.css("margin-top",0)}),p.reload=function(e,i){e=y.getThis(e);return e?(e.reload(i),y.call(e)):this},p.render=function(e){e=new x(e);return y.call(e)},e(r,p)});layui.define("jquery",function(e){"use strict";var g=layui.$,t={config:{},index:layui.slider?layui.slider.index+1e4:0,set:function(e){var i=this;return i.config=g.extend({},i.config,e),i},on:function(e,i){return layui.onevent.call(this,a,e,i)}},a="slider",c="layui-disabled",x="layui-slider-bar",b="layui-slider-wrap",T="layui-slider-wrap-btn",w="layui-slider-tips",M="layui-slider-input-txt",L="layui-slider-hover",i=function(e){var i=this;i.index=++t.index,i.config=g.extend({},i.config,t.config,e),i.render()};i.prototype.config={type:"default",min:0,max:100,value:0,step:1,showstep:!1,tips:!0,input:!1,range:!1,height:200,disabled:!1,theme:"#009688"},i.prototype.render=function(){var a,n=this,l=n.config,e=(l.step<1&&(l.step=1),l.maxl.min?i:l.min,l.value[1]=s>l.min?s:l.min,l.value[0]=l.value[0]>l.max?l.max:l.value[0],l.value[1]=l.value[1]>l.max?l.max:l.value[1],i=Math.floor((l.value[0]-l.min)/(l.max-l.min)*100),t=(s=Math.floor((l.value[1]-l.min)/(l.max-l.min)*100))-i+"%",i+="%",s+="%"):("object"==typeof l.value&&(l.value=Math.min.apply(null,l.value)),l.valuel.max&&(l.value=l.max),t=Math.floor((l.value-l.min)/(l.max-l.min)*100)+"%"),l.disabled?"#c2c2c2":l.theme),i='
        '+(l.tips?'
        ':"")+'
        '+(l.range?'
        ':"")+"
        ",t=g(l.elem),s=t.next(".layui-slider");if(s[0]&&s.remove(),n.elemTemp=g(i),l.range?(n.elemTemp.find("."+b).eq(0).data("value",l.value[0]),n.elemTemp.find("."+b).eq(1).data("value",l.value[1])):n.elemTemp.find("."+b).data("value",l.value),t.html(n.elemTemp),"vertical"===l.type&&n.elemTemp.height(l.height+"px"),l.showstep){for(var o=(l.max-l.min)/l.step,r="",u=1;u<1+o;u++){var d=100*u/o;d<100&&(r+='
        ')}n.elemTemp.append(r)}l.input&&!l.range&&(e=g('
        '),t.css("position","relative"),t.append(e),t.find("."+M).children("input").val(l.value),"vertical"===l.type?e.css({left:0,top:-48}):n.elemTemp.css("margin-right",e.outerWidth()+15)),l.disabled?(n.elemTemp.addClass(c),n.elemTemp.find("."+T).addClass(c)):n.slide(),n.elemTemp.find("."+T).on("mouseover",function(){var e="vertical"===l.type?l.height:n.elemTemp[0].offsetWidth,i=n.elemTemp.find("."+b),t=("vertical"===l.type?e-g(this).parent()[0].offsetTop-i.height():g(this).parent()[0].offsetLeft)/e*100,i=g(this).parent().data("value"),e=l.setTips?l.setTips(i):i;n.elemTemp.find("."+w).html(e),clearTimeout(a),a=setTimeout(function(){"vertical"===l.type?n.elemTemp.find("."+w).css({bottom:t+"%","margin-bottom":"20px",display:"inline-block"}):n.elemTemp.find("."+w).css({left:t+"%",display:"inline-block"})},300)}).on("mouseout",function(){clearTimeout(a),n.elemTemp.find("."+w).css("display","none")})},i.prototype.slide=function(e,i,t){var o=this,r=o.config,u=o.elemTemp,d=function(){return"vertical"===r.type?r.height:u[0].offsetWidth},c=u.find("."+b),m=u.next(".layui-slider-input"),v=m.children("."+M).children("input").val(),p=100/((r.max-r.min)/Math.ceil(r.step)),f=function(e,i,t){e=(e=100<(e=100a[1]&&a.reverse(),o.value=r.range?a:l,r.change&&r.change(o.value),"done"===t&&r.done&&r.done(o.value)},h=function(e){var i=e/d()*100/p,t=Math.round(i)*p;return t=e==d()?Math.ceil(i)*p:t},y=g(['
        d()?d():i)/d()*100/p;f(i,l),s.addClass(L),u.find("."+w).show(),e.preventDefault()},i=function(){s.removeClass(L),u.find("."+w).hide()},t=function(){i&&i(),y.remove(),r.done&&r.done(o.value)},g("#LAY-slider-moving")[0]||g("body").append(y),y.on("mousemove",e),y.on("mouseup",t).on("mouseleave",t)})}),u.on("click",function(e){var i=g("."+T),t=g(this);!i.is(event.target)&&0===i.has(event.target).length&&i.length&&(t=(i=(i=(i="vertical"===r.type?d()-e.clientY+t.offset().top-g(window).scrollTop():e.clientX-t.offset().left-g(window).scrollLeft())<0?0:i)>d()?d():i)/d()*100/p,i=r.range?"vertical"===r.type?Math.abs(i-parseInt(g(c[0]).css("bottom")))>Math.abs(i-parseInt(g(c[1]).css("bottom")))?1:0:Math.abs(i-c[0].offsetLeft)>Math.abs(i-c[1].offsetLeft)?1:0:0,f(t,i,"done"),e.preventDefault())}),m.children(".layui-slider-input-btn").children("i").each(function(i){g(this).on("click",function(){v=m.children("."+M).children("input").val();var e=((v=1==i?v-r.stepr.max?r.max:Number(v)+r.step)-r.min)/(r.max-r.min)*100/p;f(e,0,"done")})});var a=function(){var e=this.value,e=(e=(e=(e=isNaN(e)?0:e)r.max?r.max:e,((this.value=e)-r.min)/(r.max-r.min)*100/p);f(e,0,"done")};m.children("."+M).children("input").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),a.call(this))}).on("change",a)},i.prototype.events=function(){this.config},t.render=function(e){e=new i(e);return function(){var t=this,a=t.config;return{setValue:function(e,i){return e=(e=e>a.max?a.max:e)',"",'','',"","","
        "].join("")),r=i.elem=m(i.elem);i.size&&o.addClass("layui-colorpicker-"+i.size),r.addClass("layui-inline").html(e.elemColorBox=o),i.id="id"in i?i.id:e.index,e.color=e.elemColorBox.find("."+C)[0].style.background,e.events()},d.prototype.renderPicker=function(){var o,e=this,i=e.config,r=e.elemColorBox[0],t=e.elemPicker=m(['
        ','
        ','
        ','
        ','
        ','
        ',"
        ",'
        ','
        ',"
        ","
        ",'
        ','
        ','
        ',"
        ","
        ",i.predefine?(o=['
        '],layui.each(i.colors,function(e,i){o.push(['
        ','
        ',"
        "].join(""))}),o.push("
        "),o.join("")):"",'
        ','
        ','',"
        ",'
        ','','',"","
        "].join(""));e.elemColorBox.find("."+C)[0];m(a)[0]&&m(a).data("index")==e.index?e.removePicker(d.thisElemInd):(e.removePicker(d.thisElemInd),m("body").append(t)),n.thisId=i.id,d.thisElemInd=e.index,d.thisColor=r.style.background,e.position(),e.pickerEvents()},d.prototype.removePicker=function(e){var i=this.config,e=m("#layui-colorpicker"+(e||this.index));return e[0]&&(e.remove(),delete n.thisId,"function"==typeof i.close&&i.close(this.color)),this},d.prototype.position=function(){var e=this,i=e.config;return t.position(e.bindElem||e.elemColorBox[0],e.elemPicker[0],{position:i.position,align:"center"}),e},d.prototype.val=function(){var e,i=this,o=(i.config,i.elemColorBox.find("."+C)),r=i.elemPicker.find("."+M),t=o[0].style.backgroundColor;t?(e=T(L(t)),o=o.attr("lay-type"),i.select(e.h,e.s,e.b),"torgb"===o&&r.find("input").val(t),"rgba"===o&&(e=L(t),3==(t.match(/[0-9]{1,3}/g)||[]).length?(r.find("input").val("rgba("+e.r+", "+e.g+", "+e.b+", 1)"),i.elemPicker.find("."+E).css("left",280)):(r.find("input").val(t),o=280*t.slice(t.lastIndexOf(",")+1,t.length-1),i.elemPicker.find("."+E).css("left",o)),i.elemPicker.find("."+D)[0].style.background="linear-gradient(to right, rgba("+e.r+", "+e.g+", "+e.b+", 0), rgb("+e.r+", "+e.g+", "+e.b+"))")):(i.select(0,100,100),r.find("input").val(""),i.elemPicker.find("."+D)[0].style.background="",i.elemPicker.find("."+E).css("left",280))},d.prototype.side=function(){var n=this,l=n.config,c=n.elemColorBox.find("."+C),a=c.attr("lay-type"),s=n.elemPicker.find(".layui-colorpicker-side"),e=n.elemPicker.find("."+w),d=n.elemPicker.find("."+I),r=n.elemPicker.find("."+F),f=n.elemPicker.find("."+D),u=n.elemPicker.find("."+E),g=e[0].offsetTop/180*360,h=100-(r[0].offsetTop+3)/180*100,p=(r[0].offsetLeft+3)/260*100,v=Math.round(u[0].offsetLeft/280*100)/100,b=n.elemColorBox.find("."+B),i=n.elemPicker.find(".layui-colorpicker-pre").children("div"),y=function(e,i,o,r){n.select(e,i,o);var t=Y({h:e,s:i,b:o}),e=j({h:e,s:i,b:o}),i=n.elemPicker.find("."+M).find("input");b.addClass(x).removeClass(P),c[0].style.background="rgb("+t.r+", "+t.g+", "+t.b+")","torgb"===a?i.val("rgb("+t.r+", "+t.g+", "+t.b+")"):"rgba"===a?(u.css("left",280*r),i.val("rgba("+t.r+", "+t.g+", "+t.b+", "+r+")"),c[0].style.background="rgba("+t.r+", "+t.g+", "+t.b+", "+r+")",f[0].style.background="linear-gradient(to right, rgba("+t.r+", "+t.g+", "+t.b+", 0), rgb("+t.r+", "+t.g+", "+t.b+"))"):i.val("#"+e),l.change&&l.change(n.elemPicker.find("."+M).find("input").val())},o=m(['
        '].join("")),k=function(e){m("#LAY-colorpicker-moving")[0]||m("body").append(o),o.on("mousemove",e),o.on("mouseup",function(){o.remove()}).on("mouseleave",function(){o.remove()})};e.on("mousedown",function(e){var r=this.offsetTop,t=e.clientY;k(function(e){var i=r+(e.clientY-t),o=s[0].offsetHeight,o=(i=o<(i=i<0?0:i)?o:i)/180*360;y(g=o,p,h,v),e.preventDefault()}),e.preventDefault()}),s.on("click",function(e){var i=e.clientY-m(this).offset().top,i=(i=(i=i<0?0:i)>this.offsetHeight?this.offsetHeight:i)/180*360;y(g=i,p,h,v),e.preventDefault()}),r.on("mousedown",function(e){var n=this.offsetTop,l=this.offsetLeft,c=e.clientY,a=e.clientX;layui.stope(e),k(function(e){var i=n+(e.clientY-c),o=l+(e.clientX-a),r=d[0].offsetHeight-3,t=d[0].offsetWidth-3,t=((o=t<(o=o<-3?-3:o)?t:o)+3)/260*100,o=100-((i=r<(i=i<-3?-3:i)?r:i)+3)/180*100;y(g,p=t,h=o,v),e.preventDefault()}),e.preventDefault()}),d.on("mousedown",function(e){var i=e.clientY-m(this).offset().top-3+H.scrollTop(),o=e.clientX-m(this).offset().left-3+H.scrollLeft(),o=((i=i<-3?-3:i)>this.offsetHeight-3&&(i=this.offsetHeight-3),((o=(o=o<-3?-3:o)>this.offsetWidth-3?this.offsetWidth-3:o)+3)/260*100),i=100-(i+3)/180*100;y(g,p=o,h=i,v),layui.stope(e),e.preventDefault(),r.trigger(e,"mousedown")}),u.on("mousedown",function(e){var r=this.offsetLeft,t=e.clientX;k(function(e){var i=r+(e.clientX-t),o=f[0].offsetWidth,o=(o<(i=i<0?0:i)&&(i=o),Math.round(i/280*100)/100);y(g,p,h,v=o),e.preventDefault()}),e.preventDefault()}),f.on("click",function(e){var i=e.clientX-m(this).offset().left,i=((i=i<0?0:i)>this.offsetWidth&&(i=this.offsetWidth),Math.round(i/280*100)/100);y(g,p,h,v=i),e.preventDefault()}),i.each(function(){m(this).on("click",function(){m(this).parent(".layui-colorpicker-pre").addClass("selected").siblings().removeClass("selected");var e=this.style.backgroundColor,i=T(L(e)),o=e.slice(e.lastIndexOf(",")+1,e.length-1);g=i.h,p=i.s,h=i.b,3==(e.match(/[0-9]{1,3}/g)||[]).length&&(o=1),v=o,y(i.h,i.s,i.b,o)})})},d.prototype.select=function(e,i,o,r){this.config;var t=j({h:e,s:100,b:100}),e=(j({h:e,s:i,b:o}),e/360*180),o=180-o/100*180-3,i=i/100*260-3;this.elemPicker.find("."+w).css("top",e),this.elemPicker.find("."+I)[0].style.background="#"+t,this.elemPicker.find("."+F).css({top:o,left:i})},d.prototype.pickerEvents=function(){var c=this,a=c.config,s=c.elemColorBox.find("."+C),d=c.elemPicker.find("."+M+" input"),o={clear:function(e){s[0].style.background="",c.elemColorBox.find("."+B).removeClass(x).addClass(P),c.color="",a.done&&a.done(""),c.removePicker()},confirm:function(e,i){var o,r,t=d.val(),n=t,l={};if(-1>16,g:(65280&o)>>8,b:255&o},l=T(r),s[0].style.background=n="#"+j(l),c.elemColorBox.find("."+B).removeClass(P).addClass(x)),"change"===i)return c.select(l.h,l.s,l.b,i),void(a.change&&a.change(n));c.color=t,a.done&&a.done(t),c.removePicker()}};c.elemPicker.on("click","*[colorpicker-events]",function(){var e=m(this),i=e.attr("colorpicker-events");o[i]&&o[i].call(this,e)}),d.on("keyup",function(e){var i=m(this);o.confirm.call(this,i,13===e.keyCode?null:"change")})},d.prototype.events=function(){var e=this;e.config;e.elemColorBox.on("click",function(){e.renderPicker(),m(a)[0]&&(e.val(),e.side())})},s.on(i,function(e){var i,o,r;!n.thisId||(i=l.getThis(n.thisId))&&(o=i.config,r=i.elemColorBox.find("."+C),m(e.target).hasClass(c)||m(e.target).parents("."+c)[0]||m(e.target).hasClass(a.replace(/\./g,""))||m(e.target).parents(a)[0]||i.elemPicker&&(i.color?(e=T(L(i.color)),i.select(e.h,e.s,e.b)):i.elemColorBox.find("."+B).removeClass(x).addClass(P),r[0].style.background=i.color||"","function"==typeof o.cancel&&o.cancel(i.color),i.removePicker()))}),H.on("resize",function(){if(n.thisId){var e=l.getThis(n.thisId);if(e)return!(!e.elemPicker||!m(a)[0])&&void e.position()}}),l.that={},l.getThis=function(e){var i=l.that[e];return i||o.error(e?r+" instance with ID '"+e+"' not found":"ID argument required"),i},n.render=function(e){e=new d(e);return l.call(e)},e(r,n)});layui.define("jquery",function(t){"use strict";var u=layui.$,d=(layui.hint(),layui.device()),c="element",r="layui-this",y="layui-show",i=function(){this.config={}},h=(i.prototype.set=function(t){return u.extend(!0,this.config,t),this},i.prototype.on=function(t,i){return layui.onevent.call(this,c,t,i)},i.prototype.tabAdd=function(t,i){var a,t=u(".layui-tab[lay-filter="+t+"]"),e=t.children(".layui-tab-title"),l=e.children(".layui-tab-bar"),t=t.children(".layui-tab-content"),n=""+(i.title||"unnaming")+"";return l[0]?l.before(n):e.append(n),t.append('
        '+(i.content||"")+"
        "),C.hideTabMore(!0),C.tabAuto(),this},i.prototype.tabDelete=function(t,i){t=u(".layui-tab[lay-filter="+t+"]").children(".layui-tab-title").find('>li[lay-id="'+i+'"]');return C.tabDelete(null,t),this},i.prototype.tabChange=function(t,i){t=u(".layui-tab[lay-filter="+t+"]").children(".layui-tab-title").find('>li[lay-id="'+i+'"]');return C.tabClick.call(t[0],null,null,t),this},i.prototype.tab=function(a){a=a||{},e.on("click",a.headerElem,function(t){var i=u(this).index();C.tabClick.call(this,t,i,null,a)})},i.prototype.progress=function(t,i){var a="layui-progress",t=u("."+a+"[lay-filter="+t+"]").find("."+a+"-bar"),a=t.find("."+a+"-text");return t.css("width",function(){return/^.+\/.+$/.test(i)?100*new Function("return "+i)()+"%":i}).attr("lay-percent",i),a.text(i),this},".layui-nav"),f="layui-nav-item",l="layui-nav-bar",p="layui-nav-tree",b="layui-nav-child",v="layui-nav-more",m="layui-anim layui-anim-upbit",C={tabClick:function(t,i,a,e){e=e||{};var a=a||u(this),i=i||a.parent().children("li").index(a),l=e.headerElem?a.parent():a.parents(".layui-tab").eq(0),e=e.bodyElem?u(e.bodyElem):l.children(".layui-tab-content").children(".layui-tab-item"),n=a.find("a"),n="javascript:;"!==n.attr("href")&&"_blank"===n.attr("target"),s="string"==typeof a.attr("lay-unselect"),o=l.attr("lay-filter");n||s||(a.addClass(r).siblings().removeClass(r),e.eq(i).addClass(y).siblings().removeClass(y)),layui.event.call(this,c,"tab("+o+")",{elem:l,index:i})},tabDelete:function(t,i){var i=i||u(this).parent(),a=i.index(),e=i.parents(".layui-tab").eq(0),l=e.children(".layui-tab-content").children(".layui-tab-item"),n=e.attr("lay-filter");i.hasClass(r)&&(i.next()[0]&&i.next().is("li")?C.tabClick.call(i.next()[0],null,a+1):i.prev()[0]&&i.prev().is("li")&&C.tabClick.call(i.prev()[0],null,a-1)),i.remove(),l.eq(a).remove(),setTimeout(function(){C.tabAuto()},50),layui.event.call(this,c,"tabDelete("+n+")",{elem:e,index:a})},tabAuto:function(){var e="layui-tab-bar",l="layui-tab-close",n=this;u(".layui-tab").each(function(){var t=u(this),i=t.children(".layui-tab-title"),a=(t.children(".layui-tab-content").children(".layui-tab-item"),'lay-stope="tabmore"'),a=u('');n===window&&8!=d.ie&&C.hideTabMore(!0),t.attr("lay-allowClose")&&i.find("li").each(function(){var t,i=u(this);i.find("."+l)[0]||((t=u('')).on("click",C.tabDelete),i.append(t))}),"string"!=typeof t.attr("lay-unauto")&&(i.prop("scrollWidth")>i.outerWidth()+1?i.find("."+e)[0]||(i.append(a),t.attr("overflow",""),a.on("click",function(t){i[this.title?"removeClass":"addClass"]("layui-tab-more"),this.title=this.title?"":"\u6536\u7f29"})):(i.find("."+e).remove(),t.removeAttr("overflow")))})},hideTabMore:function(t){var i=u(".layui-tab-title");!0!==t&&"tabmore"===u(t.target).attr("lay-stope")||(i.removeClass("layui-tab-more"),i.find(".layui-tab-bar").attr("title",""))},clickThis:function(){var t=u(this),i=t.parents(h),a=i.attr("lay-filter"),e=t.parent(),l=t.siblings("."+b),n="string"==typeof e.attr("lay-unselect");"javascript:;"!==t.attr("href")&&"_blank"===t.attr("target")||n||l[0]||(i.find("."+r).removeClass(r),e.addClass(r)),i.hasClass(p)&&(l.removeClass(m),l[0]&&(e["none"===l.css("display")?"addClass":"removeClass"](f+"ed"),"all"===i.attr("lay-shrink")&&e.siblings().removeClass(f+"ed"))),layui.event.call(this,c,"nav("+a+")",t)},collapse:function(){var t=u(this),i=t.find(".layui-colla-icon"),a=t.siblings(".layui-colla-content"),e=t.parents(".layui-collapse").eq(0),l=e.attr("lay-filter"),n="none"===a.css("display");"string"==typeof e.attr("lay-accordion")&&((e=e.children(".layui-colla-item").children("."+y)).siblings(".layui-colla-title").children(".layui-colla-icon").html(""),e.removeClass(y)),a[n?"addClass":"removeClass"](y),i.html(n?"":""),layui.event.call(this,c,"collapse("+l+")",{title:t,content:a,show:n})}},a=(i.prototype.render=i.prototype.init=function(t,i){var a=i?'[lay-filter="'+i+'"]':"",i={tab:function(){C.tabAuto.call({})},nav:function(){var s={},o={},c={},r="layui-nav-title";u(h+a).each(function(t){var i=u(this),a=u(''),e=i.find("."+f);i.find("."+l)[0]||(i.append(a),(i.hasClass(p)?e.find("dd,>."+r):e).on("mouseenter",function(){!function(t,i,a){var e,l=u(this),n=l.find("."+b);i.hasClass(p)?n[0]||(e=l.children("."+r),t.css({top:l.offset().top-i.offset().top,height:(e[0]?e:l).outerHeight(),opacity:1})):(n.addClass(m),n.hasClass("layui-nav-child-c")&&n.css({left:-(n.outerWidth()-l.width())/2}),n[0]?t.css({left:t.position().left+t.width()/2,width:0,opacity:0}):t.css({left:l.position().left+parseFloat(l.css("marginLeft")),top:l.position().top+l.height()-t.height()}),s[a]=setTimeout(function(){t.css({width:n[0]?0:l.width(),opacity:n[0]?0:1})},d.ie&&d.ie<10?0:200),clearTimeout(c[a]),"block"===n.css("display")&&clearTimeout(o[a]),o[a]=setTimeout(function(){n.addClass(y),l.find("."+v).addClass(v+"d")},300))}.call(this,a,i,t)}).on("mouseleave",function(){i.hasClass(p)?a.css({height:0,opacity:0}):(clearTimeout(o[t]),o[t]=setTimeout(function(){i.find("."+b).removeClass(y),i.find("."+v).removeClass(v+"d")},300))}),i.on("mouseleave",function(){clearTimeout(s[t]),c[t]=setTimeout(function(){i.hasClass(p)||a.css({width:0,left:a.position().left+a.width()/2,opacity:0})},200)})),e.find("a").each(function(){var t=u(this);t.parent();t.siblings("."+b)[0]&&!t.children("."+v)[0]&&t.append(''),t.off("click",C.clickThis).on("click",C.clickThis)})})},breadcrumb:function(){u(".layui-breadcrumb"+a).each(function(){var t=u(this),i="lay-separator",a=t.attr(i)||"/",e=t.find("a");e.next("span["+i+"]")[0]||(e.each(function(t){t!==e.length-1&&u(this).after(""+a+"")}),t.css("visibility","visible"))})},progress:function(){var e="layui-progress";u("."+e+a).each(function(){var t=u(this),i=t.find(".layui-progress-bar"),a=i.attr("lay-percent");i.css("width",function(){return/^.+\/.+$/.test(a)?100*new Function("return "+a)()+"%":a}),t.attr("lay-showPercent")&&setTimeout(function(){i.html(''+a+"")},350)})},collapse:function(){u(".layui-collapse"+a).each(function(){u(this).find(".layui-colla-item").each(function(){var t=u(this),i=t.find(".layui-colla-title"),t="none"===t.find(".layui-colla-content").css("display");i.find(".layui-colla-icon").remove(),i.append(''+(t?"":"")+""),i.off("click",C.collapse).on("click",C.collapse)})})}};return i[t]?i[t]():layui.each(i,function(t,i){i()})},new i),e=u(document);u(function(){a.render()});e.on("click",".layui-tab-title li",C.tabClick),e.on("click",C.hideTabMore),u(window).on("resize",C.tabAuto),t(c,a)});layui.define(["lay","layer"],function(e){"use strict";var v=layui.$,t=layui.layer,y=layui.device(),i={config:{},set:function(e){var t=this;return t.config=v.extend({},t.config,e),t},on:function(e,t){return layui.onevent.call(this,n,e,t)}},n="upload",a="layui-upload-file",o="layui-upload-form",F="layui-upload-iframe",b="layui-upload-choose",x=function(e){var t=this;t.config=v.extend({},t.config,i.config,e),t.render()};x.prototype.config={accept:"images",exts:"",auto:!0,bindAction:"",url:"",force:"",field:"file",acceptMime:"",method:"post",data:{},drag:!0,size:0,number:0,multiple:!1},x.prototype.render=function(e){var t=this;(e=t.config).elem=v(e.elem),e.bindAction=v(e.bindAction),t.file(),t.events()},x.prototype.file=function(){var e=this,t=e.config,i=e.elemFile=v(['"].join("")),n=t.elem.next();(n.hasClass(a)||n.hasClass(o))&&n.remove(),y.ie&&y.ie<10&&t.elem.wrap('
        '),e.isFile()?(e.elemFile=t.elem,t.field=t.elem[0].name):t.elem.after(i),y.ie&&y.ie<10&&e.initIE()},x.prototype.initIE=function(){var i,e=this.config,t=v(''),n=v(['
        ',"
        "].join(""));v("#"+F)[0]||v("body").append(t),e.elem.next().hasClass(o)||(this.elemFile.wrap(n),e.elem.next("."+o).append((i=[],layui.each(e.data,function(e,t){t="function"==typeof t?t():t,i.push('')}),i.join(""))))},x.prototype.msg=function(e){return t.msg(e,{icon:2,shift:6})},x.prototype.isFile=function(){var e=this.config.elem[0];if(e)return"input"===e.tagName.toLocaleLowerCase()&&"file"===e.type},x.prototype.preview=function(n){window.FileReader&&layui.each(this.chooseFiles,function(e,t){var i=new FileReader;i.readAsDataURL(t),i.onload=function(){n&&n(e,t,this.result)}})},x.prototype.upload=function(i,e){var n,a,t,o,l=this,r=l.config,c=l.elemFile[0],u=function(){var t=0,a=0,e=i||l.files||l.chooseFiles||c.files,o=function(){r.multiple&&t+a===l.fileLength&&"function"==typeof r.allDone&&r.allDone({total:l.fileLength,successful:t,failed:a})};layui.each(e,function(i,e){var n=new FormData,e=(layui.each(r.data,function(e,t){t="function"==typeof t?t():t,n.append(e,t)}),n.append(r.field,e),{url:r.url,type:"post",data:n,contentType:!1,processData:!1,dataType:"json",headers:r.headers||{},success:function(e){t++,f(i,e),o()},error:function(e){a++,l.msg("Request URL is abnormal: "+(e.statusText||"error")),p(i),o()}});"function"==typeof r.progress&&(e.xhr=function(){var e=v.ajaxSettings.xhr();return e.upload.addEventListener("progress",function(e){var t;e.lengthComputable&&(t=Math.floor(e.loaded/e.total*100),r.progress(t,(r.item||r.elem)[0],e,i))}),e}),v.ajax(e)})},s=function(){var n=v("#"+F);l.elemFile.parent().submit(),clearInterval(x.timer),x.timer=setInterval(function(){var e,t=n.contents().find("body");try{e=t.text()}catch(i){l.msg("Cross-domain requests are not supported"),clearInterval(x.timer),p()}e&&(clearInterval(x.timer),t.html(""),f(0,e))},30)},f=function(e,t){if(l.elemFile.next("."+b).remove(),c.value="","json"===r.force&&"object"!=typeof t)try{t=JSON.parse(t)}catch(i){return t={},l.msg("Please return JSON data format")}"function"==typeof r.done&&r.done(t,e||0,function(e){l.upload(e)})},p=function(e){r.auto&&(c.value=""),"function"==typeof r.error&&r.error(e||0,function(e){l.upload(e)})},d=r.exts,m=(a=[],layui.each(i||l.chooseFiles,function(e,t){a.push(t.name)}),a),h={preview:function(e){l.preview(e)},upload:function(e,t){var i={};i[e]=t,l.upload(i)},pushFile:function(){return l.files=l.files||{},layui.each(l.chooseFiles,function(e,t){l.files[e]=t}),l.files},resetFile:function(e,t,i){t=new File([t],i);l.files=l.files||{},l.files[e]=t}},g={file:"\u6587\u4ef6",images:"\u56fe\u7247",video:"\u89c6\u9891",audio:"\u97f3\u9891"}[r.accept]||"\u6587\u4ef6",m=0===m.length?c.value.match(/[^\/\\]+\..+/g)||[]||"":m;if(0!==m.length){switch(r.accept){case"file":layui.each(m,function(e,t){if(d&&!RegExp(".\\.("+d+")$","i").test(escape(t)))return n=!0});break;case"video":layui.each(m,function(e,t){if(!RegExp(".\\.("+(d||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(t)))return n=!0});break;case"audio":layui.each(m,function(e,t){if(!RegExp(".\\.("+(d||"mp3|wav|mid")+")$","i").test(escape(t)))return n=!0});break;default:layui.each(m,function(e,t){if(!RegExp(".\\.("+(d||"jpg|png|gif|bmp|jpeg")+")$","i").test(escape(t)))return n=!0})}if(n)return l.msg("\u9009\u62e9\u7684"+g+"\u4e2d\u5305\u542b\u4e0d\u652f\u6301\u7684\u683c\u5f0f"),c.value="";if("choose"!==e&&!r.auto||(r.choose&&r.choose(h),"choose"!==e)){if(l.fileLength=(t=0,g=i||l.files||l.chooseFiles||c.files,layui.each(g,function(){t++}),t),r.number&&l.fileLength>r.number)return l.msg("\u540c\u65f6\u6700\u591a\u53ea\u80fd\u4e0a\u4f20: "+r.number+" \u4e2a\u6587\u4ef6
        \u60a8\u5f53\u524d\u5df2\u7ecf\u9009\u62e9\u4e86: "+l.fileLength+" \u4e2a\u6587\u4ef6");if(01024*r.size&&(t=1<=(t=r.size/1024)?t.toFixed(2)+"MB":r.size+"KB",c.value="",o=t)}),o)return l.msg("\u6587\u4ef6\u5927\u5c0f\u4e0d\u80fd\u8d85\u8fc7 "+o);if(!r.before||!1!==r.before(h))y.ie?(9'+e+"")},r=function(){var e=v(this);(e.attr("lay-data")||e.attr("lay-options"))&&(n.config=v.extend({},a,lay.options(this,{attr:e.attr("lay-data")?"lay-data":null})))};a.elem.off("upload.start").on("upload.start",function(){var e=v(this);r.call(this),n.config.item=e,n.elemFile[0].click()}),y.ie&&y.ie<10||a.elem.off("upload.over").on("upload.over",function(){v(this).attr("lay-over","")}).off("upload.leave").on("upload.leave",function(){v(this).removeAttr("lay-over")}).off("upload.drop").on("upload.drop",function(e,t){var i=v(this),t=t.originalEvent.dataTransfer.files||[];i.removeAttr("lay-over"),r.call(this),o(t),a.auto?n.upload():l(t)}),n.elemFile.off("upload.change").on("upload.change",function(){var e=this.files||[];r.call(this),o(e),a.auto?n.upload():l(e)}),a.bindAction.off("upload.action").on("upload.action",function(){n.upload()}),a.elem.data("haveEvents")||(n.elemFile.on("change",function(){v(this).trigger("upload.change")}),a.elem.on("click",function(){n.isFile()||v(this).trigger("upload.start")}),a.drag&&a.elem.on("dragover",function(e){e.preventDefault(),v(this).trigger("upload.over")}).on("dragleave",function(e){v(this).trigger("upload.leave")}).on("drop",function(e){e.preventDefault(),v(this).trigger("upload.drop",e)}),a.bindAction.on("click",function(){v(this).trigger("upload.action")}),a.elem.data("haveEvents",!0))},i.render=function(e){e=new x(e);return function(){var t=this;return{upload:function(e){t.upload.call(t,e)},reload:function(e){t.reload.call(t,e)},config:t.config}}.call(e)},e(n,i)});layui.define(["layer","util"],function(e){"use strict";var C=layui.$,h=layui.layer,d=layui.util,l=layui.hint(),w=(layui.device(),"form"),o=".layui-form",T="layui-this",$="layui-hide",F="layui-disabled",t=function(){this.config={verify:{required:[/[\S]+/,"\u5fc5\u586b\u9879\u4e0d\u80fd\u4e3a\u7a7a"],phone:[/^1\d{10}$/,"\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u624b\u673a\u53f7"],email:[/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,"\u90ae\u7bb1\u683c\u5f0f\u4e0d\u6b63\u786e"],url:[/^(#|(http(s?)):\/\/|\/\/)[^\s]+\.[^\s]+$/,"\u94fe\u63a5\u683c\u5f0f\u4e0d\u6b63\u786e"],number:function(e){if(!e||isNaN(e))return"\u53ea\u80fd\u586b\u5199\u6570\u5b57"},date:[/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/,"\u65e5\u671f\u683c\u5f0f\u4e0d\u6b63\u786e"],identity:[/(^\d{15}$)|(^\d{17}(x|X|\d)$)/,"\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u8eab\u4efd\u8bc1\u53f7"]},autocomplete:null}},i=(t.prototype.set=function(e){return C.extend(!0,this.config,e),this},t.prototype.verify=function(e){return C.extend(!0,this.config.verify,e),this},t.prototype.getFormElem=function(e){return C(o+(e?'[lay-filter="'+e+'"]':""))},t.prototype.on=function(e,t){return layui.onevent.call(this,w,e,t)},t.prototype.val=function(e,i){return this.getFormElem(e).each(function(e,t){var a=C(this);layui.each(i,function(e,t){var i,e=a.find('[name="'+e+'"]');e[0]&&("checkbox"===(i=e[0].type)?e[0].checked=t:"radio"===i?e.each(function(){this.value==t&&(this.checked=!0)}):e.val(t))})}),r.render(null,e),this.getValue(e)},t.prototype.getValue=function(e,t){t=t||this.getFormElem(e);var a={},n={},e=t.find("input,select,textarea");return layui.each(e,function(e,t){var i;C(this);t.name=(t.name||"").replace(/^\s*|\s*&/,""),t.name&&(/^.*\[\]$/.test(t.name)&&(i=t.name.match(/^(.*)\[\]$/g)[0],a[i]=0|a[i],i=t.name.replace(/^(.*)\[\]$/,"$1["+a[i]+++"]")),/^checkbox|radio$/.test(t.type)&&!t.checked||(n[i||t.name]=t.value))}),n},t.prototype.render=function(e,t){var i=this.config,a=C(o+(t?'[lay-filter="'+t+'"]':"")),n={input:function(e){e=e||a.find("input,textarea");i.autocomplete&&e.attr("autocomplete",i.autocomplete),a.find("input[lay-affix],textarea[lay-affix]").each(function(){var i=C(this),a=i.attr("lay-affix"),n=i.next(".layui-input-suffix"),e=i.is("[disabled]")||i.is("[readonly]"),l=function(e,t){e&&e[C.trim(t)?"removeClass":"addClass"]($)},r=function(e,t){n.remove(),n=C(['
        ",'',"
        "].join("")),i.after(n),l(n,i.val()),i.on("input propertychange",function(){var e=this.value;l(n,e)}),n.on("click",function(){var e=i.attr("lay-filter");C(this).is("[disabled]")||(s[a]&&s[a][1].call(this),layui.event.call(this,w,"input-affix("+e+")",{elem:i[0],affix:a}))})},s={clear:[function(){r("clear",e)},function(){i.val("").focus(),l(n,null)}],eye:[function(){r("eye-invisible")},function(){var e="LAY_FORM_INPUT_AFFIX_SHOW",t=i.data(e);i.attr("type",t?"password":"text").data(e,!t),r(t?"eye-invisible":"eye")}]};s[a]&&s[a][0]()})},select:function(e){var p,c="\u8bf7\u9009\u62e9",m="layui-form-select",g="layui-select-title",x="layui-select-none",k="",e=e||a.find("select"),b=function(e,t){C(e.target).parent().hasClass(g)&&!t||(C("."+m).removeClass(m+"ed "+m+"up"),p&&k&&p.val(k)),p=null},u=function(a,e,t){var s,r,i,n,o,l,c=C(this),u=a.find("."+g),d=u.find("input"),f=a.find("dl"),h=f.children("dd"),y=f.children("dt"),v=this.selectedIndex;e||(r=c.attr("lay-search"),i=function(){var e=a.offset().top+a.outerHeight()+5-E.scrollTop(),t=f.outerHeight();v=c[0].selectedIndex,a.addClass(m+"ed"),h.removeClass($),y.removeClass($),s=null,h.removeClass(T),0<=v&&h.eq(v).addClass(T),e+t>E.height()&&t<=e&&a.addClass(m+"up"),o()},n=function(e){a.removeClass(m+"ed "+m+"up"),d.blur(),s=null,e||l(d.val(),function(e){var t=c[0].selectedIndex;e&&(k=C(c[0].options[t]).html(),0===t&&k===d.attr("placeholder")&&(k=""),d.val(k||""))})},o=function(){var e,t,i=f.children("dd."+T);i[0]&&(e=i.position().top,t=f.height(),i=i.height(),t\u65e0\u5339\u914d\u9879

        '):f.find("."+x).remove()},"keyup"),""===t&&f.find("."+x).remove(),o()}).on("blur",function(e){var t=c[0].selectedIndex;p=d,k=C(c[0].options[t]).html(),0===t&&k===d.attr("placeholder")&&(k=""),setTimeout(function(){l(d.val(),function(e){k||d.val("")},"blur")},200)}),h.on("click",function(){var e=C(this),t=e.attr("lay-value"),i=c.attr("lay-filter");return e.hasClass(F)||(e.hasClass("layui-select-tips")?d.val(""):(d.val(e.text()),e.addClass(T)),e.siblings().removeClass(T),c.val(t).removeClass("layui-form-danger"),layui.event.call(this,w,"select("+i+")",{elem:c[0],value:t,othis:a}),n(!0)),!1}),a.find("dl>dt").on("click",function(e){return!1}),C(document).off("click",b).on("click",b))};e.each(function(e,t){var i=C(this),a=i.next("."+m),n=this.disabled,l=t.value,r=C(t.options[t.selectedIndex]),t=t.options[0];if("string"==typeof i.attr("lay-ignore"))return i.show();var s,o="string"==typeof i.attr("lay-search"),t=t&&!t.value&&t.innerHTML||c,r=C(['
        ','
        ','','
        ','
        ',(t=i.find("*"),s=[],layui.each(t,function(e,t){var i=t.tagName.toLowerCase();0!==e||t.value||"optgroup"===i?"optgroup"===i?s.push("
        "+t.label+"
        "):s.push('
        '+C.trim(t.innerHTML)+"
        "):s.push('
        '+C.trim(t.innerHTML||c)+"
        ")}),0===s.length&&s.push('
        \u6ca1\u6709\u9009\u9879
        '),s.join("")+"
        "),"
        "].join(""));a[0]&&a.remove(),i.after(r),u.call(this,r,n,o)})},checkbox:function(e){var o={checkbox:["layui-form-checkbox","layui-form-checked","checkbox"],_switch:["layui-form-switch","layui-form-onswitch","switch"]},e=e||a.find("input[type=checkbox]");e.each(function(e,t){var i=C(this),a=i.attr("lay-skin"),n=(i.attr("lay-text")||"").split("|"),l=this.disabled,r=o[a="switch"===a?"_"+a:a]||o.checkbox;if("string"==typeof i.attr("lay-ignore"))return i.show();var s=i.next("."+r[0]),t=C(['
        ",(l={checkbox:[t.title.replace(/\s/g,"")?""+d.escape(t.title)+"":"",''].join(""),_switch:""+((t.checked?n[0]:n[1])||"")+""})[a]||l.checkbox,"
        "].join(""));s[0]&&s.remove(),i.after(t),function(i,a){var n=C(this);i.on("click",function(){var e=n.attr("lay-filter"),t=(n.attr("lay-text")||"").split("|");n[0].disabled||(n[0].checked?(n[0].checked=!1,i.removeClass(a[1]).find("em").text(t[1])):(n[0].checked=!0,i.addClass(a[1]).find("em").text(t[0])),layui.event.call(n[0],w,a[2]+"("+e+")",{elem:n[0],value:n[0].value,othis:i}))})}.call(this,t,r)})},radio:function(e){var r="layui-form-radio",s=["",""],e=e||a.find("input[type=radio]");e.each(function(e,t){var i=C(this),a=i.next("."+r),n=this.disabled;if("string"==typeof i.attr("lay-ignore"))return i.show();a[0]&&a.remove();n=C(['
        ',''+s[t.checked?0:1]+"","
        "+(a=d.escape(t.title||""),a="string"==typeof i.next().attr("lay-radio")?i.next().html():a)+"
        ","
        "].join(""));i.after(n),function(a){var n=C(this),l="layui-anim-scaleSpring";a.on("click",function(){var e=n[0].name,t=n.parents(o),i=n.attr("lay-filter"),e=t.find("input[name="+e.replace(/(\.|#|\[|\])/g,"\\$1")+"]");n[0].disabled||(layui.each(e,function(){var e=C(this).next("."+r);this.checked=!1,e.removeClass(r+"ed"),e.find(".layui-icon").removeClass(l).html(s[1])}),n[0].checked=!0,a.addClass(r+"ed"),a.find(".layui-icon").addClass(l).html(s[0]),layui.event.call(n[0],w,"radio("+i+")",{elem:n[0],value:n[0].value,othis:a}))})}.call(this,n)})}};return"object"===layui.type(e)?e.each(function(e,t){var i=C(t);i.closest(o).length&&("SELECT"===t.tagName?n.select(i):"INPUT"===t.tagName&&("checkbox"===(t=t.type)||"radio"===t?n[t](i):n.input(i)))}):e?n[e]?n[e]():l.error('\u4e0d\u652f\u6301\u7684 "'+e+'" \u8868\u5355\u6e32\u67d3'):layui.each(n,function(e,t){t()}),this},t.prototype.validate=function(e){var u=null,d=r.config.verify,f="layui-form-danger";return!(e=C(e))[0]||(e.attr("lay-verify")!==undefined||!1!==this.validate(e.find("*[lay-verify]")))&&(layui.each(e,function(e,r){var s=C(this),t=(s.attr("lay-verify")||"").split("|"),o=s.attr("lay-verType"),c=s.val();if(s.removeClass(f),layui.each(t,function(e,t){var i="",a=d[t];if(a){var n="function"==typeof a?i=a(c,r):!a[0].test(c),l="select"===r.tagName.toLowerCase()||/^checkbox|radio$/.test(r.type),i=i||a[1];if("required"===t&&(i=s.attr("lay-reqText")||i),n)return"tips"===o?h.tips(i,"string"!=typeof s.attr("lay-ignore")&&l?s.next():s,{tips:1}):"alert"===o?h.alert(i,{title:"\u63d0\u793a",shadeClose:!0}):/\bstring|number\b/.test(typeof i)&&h.msg(i,{icon:5,shift:6}),setTimeout(function(){(l?s.next().find("input"):r).focus()},7),s.addClass(f),u=!0}}),u)return u}),!u)},t.prototype.submit=function(e,t){var i=C(this),e="string"==typeof e?e:i.attr("lay-filter"),a=this.getFormElem?this.getFormElem(e):i.parents(o).eq(0),n=a.find("*[lay-verify]");if(!r.validate(n))return!1;n=r.getValue(null,a),a={elem:this.getFormElem?window.event&&window.event.target:this,form:(this.getFormElem?a:i.parents("form"))[0],field:n};return"function"==typeof t&&t(a),layui.event.call(this,w,"submit("+e+")",a)}),r=new t,t=C(document),E=C(window);C(function(){r.render()}),t.on("reset",o,function(){var e=C(this).attr("lay-filter");setTimeout(function(){r.render(null,e)},50)}),t.on("submit",o,i).on("click","*[lay-submit]",i),e(w,r)});layui.define(["lay","laytpl","laypage","form","util"],function(e){"use strict";var v=layui.$,r=layui.lay,g=layui.laytpl,F=layui.laypage,b=layui.layer,y=layui.form,x=layui.util,f=layui.hint(),p=layui.device(),k={config:{checkName:"LAY_CHECKED",indexName:"LAY_TABLE_INDEX",numbersName:"LAY_INDEX",disabledName:"LAY_DISABLED"},cache:{},index:layui.table?layui.table.index+1e4:0,set:function(e){var t=this;return t.config=v.extend({},t.config,e),t},on:function(e,t){return layui.onevent.call(this,T,e,t)}},m=function(){var a=this,e=a.config,i=e.id||e.index;return i&&(m.that[i]=a,m.config[i]=e),{config:e,reload:function(e,t){a.reload.call(a,e,t)},reloadData:function(e,t){k.reloadData(i,e,t)},setColsWidth:function(){a.setColsWidth.call(a)},resize:function(){a.resize.call(a)}}},C=function(e){var t=m.that[e];return t||f.error(e?"The table instance with ID '"+e+"' not found":"ID argument required"),t||null},l=function(e){var t=m.config[e];return t||f.error(e?"The table instance with ID '"+e+"' not found":"ID argument required"),t||null},w=function(e){var t=this.config||{},a=(e=e||{}).item3,i=e.content,t=(("escape"in a?a:t).escape&&(i=x.escape(i)),e.text&&a.exportTemplet||a.templet||a.toolbar);return t&&(i="function"==typeof t?t.call(a,e.tplData,e.obj):g(v(t).html()||String(i)).render(v.extend({LAY_COL:a},e.tplData))),e.text?v("
        "+i+"
        ").text():i},T="table",t=".layui-table",L="layui-hide",o="layui-hide-v",d="layui-none",N="layui-table-view",c=".layui-table-header",D=".layui-table-body",s=".layui-table-pageview",W=".layui-table-sort",A="layui-table-edit",E="layui-table-hover",M="laytable-cell-group",_="layui-table-col-special",j="layui-table-tool-panel",R="LAY_TABLE_MOVE_DICT",a=function(e){return['',"","{{# layui.each(d.data.cols, function(i1, item1){ }}","","{{# layui.each(item1, function(i2, item2){ }}",'{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}','{{# if(item2.fixed === "right"){ right = true; } }}',(e=e||{}).fixed&&"right"!==e.fixed?'{{# if(item2.fixed && item2.fixed !== "right"){ }}':"right"===e.fixed?'{{# if(item2.fixed === "right"){ }}':"","{{# var isSort = !(item2.colGroup) && item2.sort; }}",'",e.fixed?"{{# }; }}":"","{{# }); }}","","{{# }); }}","","
        ','
        ','{{# if(item2.type === "checkbox"){ }}','',"{{# } else { }}",'{{-item2.title||""}}',"{{# if(isSort){ }}",'',"{{# } }}","{{# } }}","
        ","
        "].join("")},i=['',"","
        "].join(""),h=[,"{{# if(d.data.toolbar){ }}",'
        ','
        ','
        ',"
        ","{{# } }}",'
        ',"{{# if(d.data.loading){ }}",'
        ','',"
        ","{{# } }}","{{# var left, right; }}",'
        ',a(),"
        ",'
        ',i,"
        ","{{# if(left){ }}",'
        ','
        ',a({fixed:!0}),"
        ",'
        ',i,"
        ","
        ","{{# }; }}","{{# if(right){ }}",'
        ','
        ',a({fixed:"right"}),'
        ',"
        ",'
        ',i,"
        ","
        ","{{# }; }}","
        ","{{# if(d.data.totalRow){ }}",'
        ','','',"
        ","
        ","{{# } }}",'
        ','
        ',"
        ",""].join(""),H=v(window),S=v(document),n=function(e){this.index=++k.index,this.config=v.extend({},this.config,k.config,e),this.render()},u=(n.prototype.config={limit:10,loading:!0,escape:!0,cellMinWidth:60,cellMaxWidth:Number.MAX_VALUE,editTrigger:"click",defaultToolbar:["filter","exports","print"],autoSort:!0,text:{none:"\u65e0\u6570\u636e"},cols:[]},n.prototype.render=function(e){var t=this,a=t.config;if(a.elem=v(a.elem),a.where=a.where||{},a.id="id"in a?a.id:a.elem.attr("id")||t.index,a.request=v.extend({pageName:"page",limitName:"limit"},a.request),a.response=v.extend({statusName:"code",statusCode:0,msgName:"msg",dataName:"data",totalRowName:"totalRow",countName:"count"},a.response),"object"==typeof a.page&&(a.limit=a.page.limit||a.limit,a.limits=a.page.limits||a.limits,t.page=a.page.curr=a.page.curr||1,delete a.page.elem,delete a.page.jump),!a.elem[0])return t;if(a.elem.attr("lay-filter")||a.elem.attr("lay-filter",a.id),"reloadData"===e)return t.pullData(t.page,{type:"reloadData"});a.index=t.index,t.key=a.id||a.index,t.setInit(),a.height&&/^full-\d+$/.test(a.height)?(t.fullHeightGap=a.height.split("-")[1],a.height=H.height()-t.fullHeightGap):a.height&&/^#\w+\S*-\d+$/.test(a.height)&&(e=a.height.split("-"),t.parentHeightGap=e.pop(),t.parentDiv=e.join("-"),a.height=v(t.parentDiv).height()-t.parentHeightGap);var i,e=a.elem,l=e.next("."+N),n=t.elem=v("
        ");n.addClass((i=[N,N+"-"+t.index,"layui-form","layui-border-box"],a.className&&i.push(a.className),i.join(" "))).attr({"lay-filter":"LAY-TABLE-FORM-DF-"+t.index,"lay-id":a.id,style:(i=[],a.width&&i.push("width:"+a.width+"px;"),a.height&&i.push("height:"+a.height+"px;"),i.join(""))}).html(g(h).render({data:a,index:t.index})),l[0]&&l.remove(),e.after(n),t.layTool=n.find(".layui-table-tool"),t.layBox=n.find(".layui-table-box"),t.layHeader=n.find(c),t.layMain=n.find(".layui-table-main"),t.layBody=n.find(D),t.layFixed=n.find(".layui-table-fixed"),t.layFixLeft=n.find(".layui-table-fixed-l"),t.layFixRight=n.find(".layui-table-fixed-r"),t.layTotal=n.find(".layui-table-total"),t.layPage=n.find(".layui-table-page"),t.renderToolbar(),t.renderPagebar(),t.fullSize(),t.pullData(t.page),t.events()},n.prototype.initOpts=function(e){this.config;e.checkbox&&(e.type="checkbox"),e.space&&(e.type="space"),e.type||(e.type="normal"),"normal"!==e.type&&(e.unresize=!0,e.width=e.width||{checkbox:50,radio:50,space:30,numbers:60}[e.type])},n.prototype.setInit=function(e){var l,a,d=this,r=d.config;if(r.clientWidth=r.width||(l=function(e){var t,a=(e=e||r.elem.parent()).width();try{t="none"===e.css("display")}catch(i){}return!e[0]||a&&!t?a:l(e.parent())})(),"width"===e)return r.clientWidth;r.height=r.maxHeight||r.height,r.css&&-1===r.css.indexOf(N)&&(a=r.css.split("}"),layui.each(a,function(e,t){t&&(a[e]="."+N+"-"+d.index+" "+t)}),r.css=a.join("}"));var c=function(a,e,i,l){var n,o;l?(l.key=[r.index,a,i].join("-"),l.hide=l.hide||!1,l.colspan=l.colspan||0,l.rowspan=l.rowspan||0,d.initOpts(l),(n=a+(parseInt(l.rowspan)||1))
        ','
        ','
        '].join(""),a=this.layTool.find(".layui-table-tool-temp"),i=("default"===e.toolbar?a.html(t):"string"==typeof e.toolbar&&(t=v(e.toolbar).html()||"")&&a.html(g(t).render(e)),{filter:{title:"\u7b5b\u9009\u5217",layEvent:"LAYTABLE_COLS",icon:"layui-icon-cols"},exports:{title:"\u5bfc\u51fa",layEvent:"LAYTABLE_EXPORT",icon:"layui-icon-export"},print:{title:"\u6253\u5370",layEvent:"LAYTABLE_PRINT",icon:"layui-icon-print"}}),l=[];"object"==typeof e.defaultToolbar&&layui.each(e.defaultToolbar,function(e,t){t="string"==typeof t?i[t]:t;t&&l.push('
        ')}),this.layTool.find(".layui-table-tool-self").html(l.join(""))},n.prototype.renderPagebar=function(){var e,t=this.config,a=this.layPagebar=v('
        ');t.pagebar&&((e=v(t.pagebar).html()||"")&&a.append(g(e).render(t)),this.layPage.append(a))},n.prototype.setParentCol=function(e,t){var a=this.config,i=this.layHeader.find('th[data-key="'+t+'"]'),l=parseInt(i.attr("colspan"))||0;i[0]&&(t=t.split("-"),t=a.cols[t[1]][t[2]],e?l--:l++,i.attr("colspan",l),i[1<=l||!e?"removeClass":"addClass"](L),t.colspan=l,t.hide=1<=l||!e,(a=i.data("parentkey"))&&this.setParentCol(e,a))},n.prototype.setColsPatch=function(){var a=this,e=a.config;layui.each(e.cols,function(e,t){layui.each(t,function(e,t){t.hide&&a.setParentCol(t.hide,t.parentKey)})})},n.prototype.setGroupWidth=function(i){var e,l=this;l.config.cols.length<=1||((e=l.layHeader.find((i?"th[data-key="+i.data("parentkey")+"]>":"")+"."+M)).css("width",0),layui.each(e.get().reverse(),function(){var e=v(this),t=e.parent().data("key"),a=0;l.layHeader.eq(0).find("th[data-parentkey="+t+"]").width(function(e,t){v(this).hasClass(L)||0'+(e||"Error")+"
        ");a[0]&&(t.layNone.remove(),a.remove()),t.layFixed.addClass(L),t.layMain.find("tbody").html(""),t.layMain.append(t.layNone=e),t.layTotal.addClass(o),t.layPage.find(s).addClass(o),k.cache[t.key]=[],t.syncCheckAll()},n.prototype.page=1,n.prototype.pullData=function(t,a){var e,i=this,l=i.config,n=l.request,o=l.response,d=function(){"object"==typeof l.initSort&&i.sort(l.initSort.field,l.initSort.type)};a=a||{},"function"==typeof l.before&&l.before(l),i.startTime=(new Date).getTime(),l.url?((e={})[n.pageName]=t,e[n.limitName]=l.limit,n=v.extend(e,l.where),l.contentType&&0==l.contentType.indexOf("application/json")&&(n=JSON.stringify(n)),i.loading(),v.ajax({type:l.method||"get",url:l.url,contentType:l.contentType,data:n,dataType:l.dataType||"json",jsonpCallback:l.jsonpCallback,headers:l.headers||{},success:function(e){(e="function"==typeof l.parseData?l.parseData(e)||e:e)[o.statusName]!=o.statusCode?(i.renderForm(),i.errorView(e[o.msgName]||'\u8fd4\u56de\u7684\u6570\u636e\u4e0d\u7b26\u5408\u89c4\u8303\uff0c\u6b63\u786e\u7684\u6210\u529f\u72b6\u6001\u7801\u5e94\u4e3a\uff1a"'+o.statusName+'": '+o.statusCode)):(i.renderData({res:e,curr:t,count:e[o.countName],type:a.type}),d(),l.time=(new Date).getTime()-i.startTime+" ms"),i.setColsWidth(),"function"==typeof l.done&&l.done(e,t,e[o.countName])},error:function(e,t){i.errorView("\u8bf7\u6c42\u5f02\u5e38\uff0c\u9519\u8bef\u63d0\u793a\uff1a"+t),i.renderForm(),i.setColsWidth(),"function"==typeof l.error&&l.error(e,t)}})):"array"===layui.type(l.data)&&(e=t*l.limit-l.limit,(n={})[o.dataName]=l.data.concat().splice(e,l.limit),n[o.countName]=l.data.length,"object"==typeof l.totalRow&&(n[o.totalRowName]=v.extend({},l.totalRow)),i.renderData({res:n,curr:t,count:n[o.countName],type:a.type}),d(),i.setColsWidth(),"function"==typeof l.done&&l.done(n,t,n[o.countName]))},n.prototype.eachCols=function(e){return k.eachCols(null,e,this.config.cols),this},n.prototype.col=function(e){try{return e=e.split("-"),this.config.cols[e[1]][e[2]]||{}}catch(t){return f.error(t),{}}},n.prototype.renderData=function(e){var u=this,h=u.config,t=e.res,l=e.curr,a=e.count,n=e.sort,y=t[h.response.dataName]||[],t=t[h.response.totalRowName],f=[],p=[],m=[],i=function(){var s;if(h.HAS_SET_COLS_PATCH||u.setColsPatch(),h.HAS_SET_COLS_PATCH=!0,!n&&u.sortKey)return u.sort(u.sortKey.field,u.sortKey.sort,!0);layui.each(y,function(o,d){var a=[],i=[],r=[],c=o+h.limit*(l-1)+1;if("object"!=typeof d){y[o]=d={LAY_KEY:d};try{k.cache[u.key][o]=d}catch(e){}}"array"===layui.type(d)&&0===d.length||(d[k.config.numbersName]=c,n||(d[k.config.indexName]=o),u.eachCols(function(e,l){var e=l.field||e,t=l.key,n=d[e];n!==undefined&&null!==n||(n=""),l.colGroup||(t=['','
        "+function(){var e,t=v.extend(!0,{LAY_COL:l},d),a=k.config.checkName,i=k.config.disabledName;switch(l.type){case"checkbox":return'";case"radio":return t[a]&&(s=o),'';case"numbers":return c}return l.toolbar?g(v(l.toolbar).html()||"").render(t):w.call(u,{item3:l,content:n,tplData:t})}(),"
        "].join(""),a.push(t),l.fixed&&"right"!==l.fixed&&i.push(t),"right"===l.fixed&&r.push(t))}),f.push(''+a.join("")+""),p.push(''+i.join("")+""),m.push(''+r.join("")+""))}),"fixed"===h.scrollPos&&"reloadData"===e.type||u.layBody.scrollTop(0),"reset"===h.scrollPos&&u.layBody.scrollLeft(0),u.layMain.find("."+d).remove(),u.layMain.find("tbody").html(f.join("")),u.layFixLeft.find("tbody").html(p.join("")),u.layFixRight.find("tbody").html(m.join("")),u.renderForm(),"number"==typeof s&&u.setThisRowChecked(s),u.syncCheckAll(),u.fullSize(),u.haveInit?u.scrollPatch():setTimeout(function(){u.scrollPatch()},50),u.haveInit=!0,b.close(u.tipsIndex)};return k.cache[u.key]=y,u.layTotal[0==y.length?"addClass":"removeClass"](o),u.layPage[h.page||h.pagebar?"removeClass":"addClass"](L),u.layPage.find(s)[!h.page||0==a||0===y.length&&1==l?"addClass":"removeClass"](o),0===y.length?(u.renderForm(),u.errorView(h.text.none)):(u.layFixLeft.removeClass(L),n?i():(i(),u.renderTotal(y,t),u.layTotal&&u.layTotal.removeClass(L),void(h.page&&(h.page=v.extend({elem:"layui-table-page"+h.index,count:a,limit:h.limit,limits:h.limits||[10,20,30,40,50,60,70,80,90],groups:3,layout:["prev","page","next","skip","count","limit"],prev:'',next:'',jump:function(e,t){t||(u.page=e.curr,h.limit=e.limit,u.pullData(e.curr))}},h.page),h.page.count=a,F.render(h.page)))))},n.prototype.renderTotal=function(e,o){var d,r=this,c=r.config,s={};c.totalRow&&(layui.each(e,function(e,i){"array"===layui.type(i)&&0===i.length||r.eachCols(function(e,t){var e=t.field||e,a=i[e];t.totalRow&&(s[e]=(s[e]||0)+(parseFloat(a)||0))})}),r.dataTotal={},d=[],r.eachCols(function(e,t){var a,e=t.field||e,i=o&&o[t.field],l=(a=t.totalRowText||"",n="totalRowDecimals"in t?t.totalRowDecimals:2,n=parseFloat(s[e]).toFixed(n),(l={LAY_COL:t})[e]=n,n=t.totalRow&&w.call(r,{item3:t,content:n,tplData:l})||a,i||n),n=['','
        "+("string"==typeof(a=t.totalRow||c.totalRow)?g(a).render(v.extend({TOTAL_NUMS:i||s[e],LAY_COL:t},t)):l),"
        "].join("");t.field&&(r.dataTotal[e]=l),d.push(n)}),e=r.layTotal.find(".layui-table-patch"),r.layTotal.find("tbody").html(""+d.join("")+(e.length?e.get(0).outerHTML:"")+""))},n.prototype.getColElem=function(e,t){this.config;return e.eq(0).find(".laytable-cell-"+t+":eq(0)")},n.prototype.renderForm=function(e){this.config;var t=this.elem.attr("lay-filter");y.render(e,t)},n.prototype.setThisRowChecked=function(e){this.config;var t="layui-table-click";this.layBody.find('tr[data-index="'+e+'"]').addClass(t).siblings("tr").removeClass(t)},n.prototype.sort=function(l,e,t,a){var i,n=this,o={},d=n.config,r=d.elem.attr("lay-filter"),c=k.cache[n.key];"string"==typeof l&&(s=l,n.layHeader.find("th").each(function(e,t){var a=v(this),i=a.data("field");if(i===l)return l=a,s=i,!1}));try{var s=s||l.data("field"),u=l.data("key");if(n.sortKey&&!t&&s===n.sortKey.field&&e===n.sortKey.sort)return;var h=n.layHeader.find("th .laytable-cell-"+u).find(W);n.layHeader.find("th").find(W).removeAttr("lay-sort"),h.attr("lay-sort",e||null),n.layFixed.find("th")}catch(y){f.error("Table modules: sort field '"+s+"' not matched")}n.sortKey={field:s,sort:e},d.autoSort&&("asc"===e?i=layui.sort(c,s):"desc"===e?i=layui.sort(c,s,!0):(i=layui.sort(c,k.config.indexName),delete n.sortKey,delete d.initSort)),o[d.response.dataName]=i||c,n.renderData({res:o,curr:n.page,count:n.count,sort:!0}),a&&(d.initSort={field:s,type:e},layui.event.call(l,T,"sort("+r+")",v.extend({config:d},d.initSort)))},n.prototype.loading=function(e){var t=this;t.config.loading&&(e?(t.layInit&&t.layInit.remove(),delete t.layInit,t.layBox.find(".layui-table-init").remove()):(t.layInit=v(['
        ','',"
        "].join("")),t.layBox.append(t.layInit)))},n.prototype.setCheckData=function(e,t){var a=this.config,i=k.cache[this.key];i[e]&&"array"!==layui.type(i[e])&&(i[e][a.checkName]=t)},n.prototype.syncCheckAll=function(){var e=this,i=e.config,t=e.layHeader.find('input[name="layTableCheckbox"]'),a=function(a){return e.eachCols(function(e,t){"checkbox"===t.type&&(t[i.checkName]=a)}),a};t[0]&&(k.checkStatus(e.key).isAll?(t[0].checked||(t.prop("checked",!0),e.renderForm("checkbox")),a(!0)):(t[0].checked&&(t.prop("checked",!1),e.renderForm("checkbox")),a(!1)))},n.prototype.getCssRule=function(a,i){var e=this.elem.find("style")[0],e=e.sheet||e.styleSheet||{},e=e.cssRules||e.rules;layui.each(e,function(e,t){if(t.selectorText===".laytable-cell-"+a)return i(t),!0})},n.prototype.fullSize=function(){var e,a,i=this,t=i.config,l=t.height;i.fullHeightGap?(l=H.height()-i.fullHeightGap,i.elem.css("height",l=l<135?135:l)):i.parentDiv&&i.parentHeightGap&&(l=v(i.parentDiv).height()-i.parentHeightGap,i.elem.css("height",l=l<135?135:l)),1
        ')).find("div").css({width:a}),e.find("tr").append(t)):e.find(".layui-table-patch").remove()};n(e.layHeader),n(e.layTotal);n=e.layMain.height()-i;e.layFixed.find(D).css("height",t.height()>=n?n:"auto"),e.layFixRight[0');a.html(t),u.height&&a.css("max-height",u.height-(s.layTool.outerHeight()||50)),i.find("."+j)[0]||i.append(a),s.renderForm(),a.on("click",function(e){layui.stope(e)}),e.done&&e.done(a,t)};switch(layui.stope(e),S.trigger("table.tool.panel.remove"),b.close(s.tipsIndex),t){case"LAYTABLE_COLS":l({list:(a=[],s.eachCols(function(e,t){t.field&&"normal"==t.type&&a.push('
      • "+(t.fieldTitle||t.title||t.field)+"").text())+'" lay-filter="LAY_TABLE_TOOL_COLS">
      • ')}),a.join("")),done:function(){y.on("checkbox(LAY_TABLE_TOOL_COLS)",function(e){var e=v(e.elem),t=this.checked,a=e.data("key"),i=s.col(a),l=i.hide,e=e.data("parentkey");i.key&&(i.hide=!t,s.elem.find('*[data-key="'+a+'"]')[t?"removeClass":"addClass"](L),l!=i.hide&&s.setParentCol(!t,e),s.resize(),layui.event.call(this,T,"colToggled("+r+")",{col:i,config:u}))})}});break;case"LAYTABLE_EXPORT":p.ie?b.tips("\u5bfc\u51fa\u529f\u80fd\u4e0d\u652f\u6301 IE\uff0c\u8bf7\u7528 Chrome \u7b49\u9ad8\u7ea7\u6d4f\u89c8\u5668\u5bfc\u51fa",this,{tips:3}):l({list:['
      • \u5bfc\u51fa csv \u683c\u5f0f\u6587\u4ef6
      • ','
      • \u5bfc\u51fa xls \u683c\u5f0f\u6587\u4ef6
      • '].join(""),done:function(e,t){t.on("click",function(){var e=v(this).data("type");k.exportFile.call(s,u.id,null,e)})}});break;case"LAYTABLE_PRINT":var n=window.open("about:blank","_blank"),o=[""].join(""),d=v(s.layHeader.html());d.append(s.layMain.find("table").html()),d.append(s.layTotal.find("table").html()),d.find("th.layui-table-patch").remove(),d.find("thead>tr>th."+_).filter(function(e,t){return!v(t).children("."+M).length}).remove(),d.find("tbody>tr>td."+_).remove(),n.document.write(o+d.prop("outerHTML")),n.document.close(),n.print(),n.close()}layui.event.call(this,T,"toolbar("+r+")",v.extend({event:t,config:u},{}))}),s.layPagebar.on("click","*[lay-event]",function(e){var t=v(this).attr("lay-event");layui.event.call(this,T,"pagebar("+r+")",v.extend({event:t,config:u},{}))}),e.on("mousemove",function(e){var t=v(this),a=t.offset().left,e=e.clientX-a;t.data("unresize")||m.eventMoveElem||(o.allowResize=t.width()-e<=10,n.css("cursor",o.allowResize?"col-resize":""))}).on("mouseleave",function(){v(this);m.eventMoveElem||n.css("cursor","")}).on("mousedown",function(e){var t,a=v(this);o.allowResize&&(t=a.data("key"),e.preventDefault(),o.offset=[e.clientX,e.clientY],s.getCssRule(t,function(e){var t=e.style.width||a.outerWidth();o.rule=e,o.ruleWidth=parseFloat(t),o.minWidth=a.data("minwidth")||u.cellMinWidth,o.maxWidth=a.data("maxwidth")||u.cellMaxWidth}),a.data(R,o),m.eventMoveElem=a)}),m.docEvent||S.on("mousemove",function(e){var t,a;m.eventMoveElem&&(t=m.eventMoveElem.data(R)||{},m.eventMoveElem.data("resizing",1),e.preventDefault(),t.rule&&(e=t.ruleWidth+e.clientX-t.offset[0],a=m.eventMoveElem.closest("."+N).attr("lay-id"),(a=C(a))&&((e=et.maxWidth&&(e=t.maxWidth),t.rule.style.width=e+"px",a.setGroupWidth(m.eventMoveElem),b.close(s.tipsIndex))))}).on("mouseup",function(e){var t,a,i,l;m.eventMoveElem&&(i=(t=m.eventMoveElem).closest("."+N).attr("lay-id"),(a=C(i))&&(i=t.data("key"),l=a.col(i),o={},n.css("cursor",""),a.scrollPatch(),t.removeData(R),delete m.eventMoveElem,a.getCssRule(i,function(e){l.width=parseFloat(e.style.width),layui.event.call(t[0],T,"colResized("+r+")",{col:l,config:a.config})})))}),m.docEvent=!0,e.on("click",function(e){var t=v(this),a=t.find(W),i=a.attr("lay-sort");if(!a[0]||1===t.data("resizing"))return t.removeData("resizing");s.sort(t,"asc"===i?"desc":"desc"===i?null:"asc",null,!0)}).find(W+" .layui-edge ").on("click",function(e){var t=v(this),a=t.index(),t=t.parents("th").eq(0).data("field");layui.stope(e),0===a?s.sort(t,"asc",null,!0):s.sort(t,"desc",null,!0)}),s.commonMember=function(e){var t=v(this).parents("tr").eq(0).data("index"),r=s.layBody.find('tr[data-index="'+t+'"]'),c=(c=k.cache[s.key]||[])[t]||{};return v.extend({tr:r,config:u,data:k.clearCacheKey(c),del:function(){k.cache[s.key][t]=[],r.remove(),s.scrollPatch()},update:function(e,d){e=e||{},layui.each(e,function(i,l){var n=r.children('td[data-field="'+i+'"]'),o=n.children(h);i in c&&(c[i]=l),s.eachCols(function(e,t){var a;t.field==i?(o.html(w.call(s,{item3:t,content:l,tplData:v.extend({LAY_COL:t},c)})),n.data("content",l)):d&&(t.templet||t.toolbar)&&(e=r.children('td[data-field="'+(t.field||e)+'"]'),a=c[t.field],e.children(h).html(w.call(s,{item3:t,content:a,tplData:v.extend({LAY_COL:t},c)})),e.data("content",a))})}),s.renderForm()}},e)}),t=(s.elem.on("click",'input[name="layTableCheckbox"]+',function(){var e=v(this).prev(),t=s.layBody.find('input[name="layTableCheckbox"]'),a=e.parents("tr").eq(0).data("index"),i=e[0].checked,l="layTableAllChoose"===e.attr("lay-filter");e[0].disabled||(l?(t.each(function(e,t){t.checked=i,s.setCheckData(e,i)}),s.syncCheckAll(),s.renderForm("checkbox")):(s.setCheckData(a,i),s.syncCheckAll()),layui.event.call(e[0],T,"checkbox("+r+")",d.call(e[0],{checked:i,type:l?"all":"one"})))}),s.elem.on("click",'input[lay-type="layTableRadio"]+',function(){var e=v(this).prev(),t=e[0].checked,a=k.cache[s.key],i=e.parents("tr").eq(0).data("index");layui.each(a,function(e,t){i===e?t[u.checkName]=!0:delete t[u.checkName]}),s.setThisRowChecked(i),layui.event.call(this,T,"radio("+r+")",d.call(this,{checked:t}))}),s.layBody.on("mouseenter","tr",function(){var e=v(this),t=e.index();e.data("off")||s.layBody.find("tr:eq("+t+")").addClass(E)}).on("mouseleave","tr",function(){var e=v(this),t=e.index();e.data("off")||s.layBody.find("tr:eq("+t+")").removeClass(E)}).on("click","tr",function(){t.call(this,"row")}).on("dblclick","tr",function(){t.call(this,"rowDouble")}),function(e){var t=v(this);t.data("off")||layui.event.call(this,T,e+"("+r+")",d.call(t.children("td")[0]))}),c=function(e,t){var a,i,l,n;(e=v(e)).data("off")||(a=e.data("field"),n=e.data("key"),n=s.col(n),i=e.closest("tr").data("index"),i=k.cache[s.key][i],l=e.children(h),(n="function"==typeof n.edit?n.edit(i):n.edit)&&((n=v("textarea"===n?'':''))[0].value=e.data("content")||i[a]||l.text(),e.find("."+A)[0]||e.append(n),n.focus(),t&&layui.stope(t)))},i=(s.layBody.on("change","."+A,function(){var e=v(this),t=e.parent(),a=this.value,i=e.parent().data("field"),e=e.closest("tr").data("index"),e=k.cache[s.key][e],l=d.call(t[0],{value:a,field:i,oldValue:e[i],td:t,reedit:function(){setTimeout(function(){c(l.td);var e={};e[i]=l.oldValue,l.update(e)})}}),e={};e[i]=a,l.update(e),layui.event.call(t[0],T,"edit("+r+")",l)}).on("blur","."+A,function(){v(this).remove()}),s.layBody.on(u.editTrigger,"td",function(e){c(this,e)}).on("mouseenter","td",function(){a.call(this)}).on("mouseleave","td",function(){a.call(this,"hide")}),"layui-table-grid-down"),a=function(e){var t=v(this),a=t.children(h);t.data("off")||(e?t.find(".layui-table-grid-down").remove():!(a.prop("scrollWidth")>a.outerWidth()||0'))},l=(s.layBody.on("click","."+i,function(e){var t=v(this).parent().children(h);s.tipsIndex=b.tips(['
        ',t.html(),"
        ",''].join(""),t[0],{tips:[3,""],time:-1,anim:-1,maxWidth:p.ios||p.android?300:s.elem.width()/2,isOutAnim:!1,skin:"layui-table-tips",success:function(e,t){e.find(".layui-table-tips-c").on("click",function(){b.close(t)})}}),layui.stope(e)}),function(e){var t=v(this),a=t.parents("tr").eq(0).data("index");layui.event.call(this,T,(e||"tool")+"("+r+")",d.call(this,{event:t.attr("lay-event")})),s.setThisRowChecked(a)});s.layBody.on("click","*[lay-event]",function(e){l.call(this),layui.stope(e)}).on("dblclick","*[lay-event]",function(e){l.call(this,"toolDouble"),layui.stope(e)}),s.layMain.on("scroll",function(){var e=v(this),t=e.scrollLeft(),e=e.scrollTop();s.layHeader.scrollLeft(t),s.layTotal.scrollLeft(t),s.layFixed.find(D).scrollTop(e),b.close(s.tipsIndex)}),H.on("resize",function(){s.resize()})},S.on("click",function(){S.trigger("table.remove.tool.panel")}),S.on("table.remove.tool.panel",function(){v("."+j).remove()}),k.init=function(i,o){o=o||{};var e=v(i?'table[lay-filter="'+i+'"]':t+"[lay-data], "+t+"[lay-options]"),d="Table element property lay-data configuration item has a syntax error: ";return e.each(function(){var l,e=v(this),t=e.attr("lay-data"),t=r.options(this,{attr:t?"lay-data":null,errorText:d+(t||e.attr("lay-options"))}),n=v.extend({elem:this,cols:[],data:[],skin:e.attr("lay-skin"),size:e.attr("lay-size"),even:"string"==typeof e.attr("lay-even")},k.config,o,t),a=(i&&e.hide(),e.find("thead>tr").each(function(i){n.cols[i]=[],v(this).children().each(function(e){var t=v(this),a=t.attr("lay-data"),a=r.options(this,{attr:a?"lay-data":null,errorText:d+(a||t.attr("lay-options"))}),t=v.extend({title:t.text(),colspan:parseInt(t.attr("colspan"))||0,rowspan:parseInt(t.attr("rowspan"))||0},a);n.cols[i].push(t)})}),e.find("tbody>tr")),t=k.render(n);!a.length||o.data||t.config.url||(l=0,k.eachCols(t.config.id,function(e,i){a.each(function(e){n.data[e]=n.data[e]||{};var t=v(this),a=i.field;n.data[e][a]=t.children("td").eq(l).html()}),l++}),t.reloadData({data:n.data}))}),this},m.that={},m.config={},function(a,i,e,l){var n,o;l.colGroup&&(n=0,a++,l.CHILD_COLS=[],o=e+(parseInt(l.rowspan)||1),layui.each(i[o],function(e,t){t.parentKey?t.parentKey===l.key&&(t.PARENT_COL_INDEX=a,l.CHILD_COLS.push(t),u(a,i,o,t)):t.PARENT_COL_INDEX||1<=n&&n==(l.colspan||1)||(t.PARENT_COL_INDEX=a,l.CHILD_COLS.push(t),n+=t.hide?0:parseInt(1td'),a!==undefined&&null!==a||(a=""),0==l&&d.push(t.fieldTitle||t.title||t.field||""),o.push('"'+w.call(c,{item3:t,content:a,tplData:n,text:"text",obj:c.commonMember.call(i.eq(0),{td:function(e){return i.filter('[data-field="'+e+'"]')}})})+'"')))}),i.push(o.join(","))}),c&&layui.each(c.dataTotal,function(e,t){r[e]||l.push(t)}),d.join(",")+"\r\n"+i.join("\r\n")+"\r\n"+l.join(","))),u.download=(a.title||o.title||"table_"+(o.index||""))+"."+n,document.body.appendChild(u),u.click(),document.body.removeChild(u)},k.resize=function(e){e?l(e)&&C(e).resize():layui.each(m.that,function(){this.resize()})},k.reload=function(e,t,a,i){if(l(e))return e=C(e),e.reload(t,a,i),m.call(e)},k.reloadData=function(){var a=v.extend([],arguments),i=(a[3]="reloadData",new RegExp("^("+["data","url","method","contentType","dataType","jsonpCallback","headers","where","page","limit","request","response","parseData","scrollPos"].join("|")+")$"));return layui.each(a[1],function(e,t){i.test(e)||delete a[1][e]}),k.reload.apply(null,a)},k.render=function(e){e=new n(e);return m.call(e)},k.clearCacheKey=function(e){return delete(e=v.extend({},e))[k.config.checkName],delete e[k.config.indexName],delete e[k.config.numbersName],delete e[k.config.disabledName],e},k.getOptions=function(e){return v.extend(!0,{},l(e))},k.hideCol=function(e,l){var n=C(e);n&&("boolean"===layui.type(l)?n.eachCols(function(e,t){var a=t.key,i=n.col(a),t=t.parentKey;i.hide!=l&&(i=i.hide=l,n.elem.find('*[data-key="'+a+'"]')[i?"addClass":"removeClass"](L),n.setParentCol(i,t))}):layui.each(l,function(e,l){n.eachCols(function(e,t){var a,i;l.field===t.field&&(a=t.key,i=n.col(a),t=t.parentKey,"hide"in l&&i.hide!=l.hide&&(i=i.hide=!!l.hide,n.elem.find('*[data-key="'+a+'"]')[i?"addClass":"removeClass"](L),n.setParentCol(i,t)))})}),v("."+j).remove(),n.resize())},v(function(){k.init()}),e(T,k)});layui.define("form",function(e){"use strict";var u=layui.$,i=layui.form,p=layui.layer,n="tree",a={config:{},index:layui[n]?layui[n].index+1e4:0,set:function(e){var i=this;return i.config=u.extend({},i.config,e),i},on:function(e,i){return layui.onevent.call(this,n,e,i)}},t=function(){var i=this,e=i.config,n=e.id||i.index;return t.that[n]=i,{config:t.config[n]=e,reload:function(e){i.reload.call(i,e)},getChecked:function(){return i.getChecked.call(i)},setChecked:function(e){return i.setChecked.call(i,e)}}},y="layui-hide",d="layui-disabled",f="layui-tree-set",C="layui-tree-iconClick",k="layui-icon-addition",v="layui-icon-subtraction",m="layui-tree-entry",x="layui-tree-main",b="layui-tree-txt",g="layui-tree-pack",w="layui-tree-spread",N="layui-tree-setLineShort",T="layui-tree-showLine",L="layui-tree-lineExtend",l=function(e){var i=this;i.index=++a.index,i.config=u.extend({},i.config,a.config,e),i.render()};l.prototype.config={data:[],showCheckbox:!1,showLine:!0,accordion:!1,onlyIconControl:!1,isJump:!1,edit:!1,text:{defaultNodeName:"\u672a\u547d\u540d",none:"\u65e0\u6570\u636e"}},l.prototype.reload=function(e){var n=this;layui.each(e,function(e,i){"array"===layui.type(i)&&delete n.config[e]}),n.config=u.extend(!0,{},n.config,e),n.render()},l.prototype.render=function(){var e=this,i=e.config,n=(e.checkids=[],u('
        ')),a=(e.tree(n),i.elem=u(i.elem));if(a[0]){if(e.key=i.id||e.index,e.elem=n,e.elemNone=u('
        '+i.text.none+"
        "),a.html(e.elem),0==e.elem.find(".layui-tree-set").length)return e.elem.append(e.elemNone);i.showCheckbox&&e.renderForm("checkbox"),e.elem.find(".layui-tree-set").each(function(){var e=u(this);e.parent(".layui-tree-pack")[0]||e.addClass("layui-tree-setHide"),!e.next()[0]&&e.parents(".layui-tree-pack").eq(1).hasClass("layui-tree-lineExtend")&&e.addClass(N),e.next()[0]||e.parents(".layui-tree-set").eq(0).next()[0]||e.addClass(N)}),e.events()}},l.prototype.renderForm=function(e){i.render(e,"LAY-tree-"+this.index)},l.prototype.tree=function(l,e){var r=this,c=r.config,e=e||c.data;layui.each(e,function(e,i){var n=i.children&&0"),t=u(['
        ','
        ','
        ',c.showLine?n?'':'':'',c.showCheckbox?'':"",c.isJump&&i.href?''+(i.title||i.label||c.text.defaultNodeName)+"":''+(i.title||i.label||c.text.defaultNodeName)+"","
        ",function(){if(!c.edit)return"";var n={add:'',update:'',del:''},a=['
        '];return!0===c.edit&&(c.edit=["update","del"]),"object"==typeof c.edit?(layui.each(c.edit,function(e,i){a.push(n[i]||"")}),a.join("")+"
        "):void 0}(),"
        "].join(""));n&&(t.append(a),r.tree(a,i.children)),l.append(t),t.prev("."+f)[0]&&t.prev().children(".layui-tree-pack").addClass("layui-tree-showLine"),n||t.parent(".layui-tree-pack").addClass("layui-tree-lineExtend"),r.spread(t,i),c.showCheckbox&&(i.checked&&r.checkids.push(i.id),r.checkClick(t,i)),c.edit&&r.operate(t,i)})},l.prototype.spread=function(a,e){var t=this.config,i=a.children("."+m),n=i.children("."+x),l=i.find("."+C),i=i.find("."+b),r=t.onlyIconControl?l:n,c="";r.on("click",function(e){var i=a.children("."+g),n=(r.children(".layui-icon")[0]?r:r.find(".layui-tree-icon")).children(".layui-icon");i[0]?a.hasClass(w)?(a.removeClass(w),i.slideUp(200),n.removeClass(v).addClass(k)):(a.addClass(w),i.slideDown(200),n.addClass(v).removeClass(k),t.accordion&&((i=a.siblings("."+f)).removeClass(w),i.children("."+g).slideUp(200),i.find(".layui-tree-icon").children(".layui-icon").removeClass(v).addClass(k))):c="normal"}),i.on("click",function(){u(this).hasClass(d)||(c=a.hasClass(w)?t.onlyIconControl?"open":"close":t.onlyIconControl?"close":"open",t.click&&t.click({elem:a,state:c,data:e}))})},l.prototype.setCheckbox=function(e,i,n){this.config;var t,l=n.prop("checked");n.prop("disabled")||("object"!=typeof i.children&&!e.find("."+g)[0]||e.find("."+g).find('input[same="layuiTreeCheck"]').each(function(){this.disabled||(this.checked=l)}),(t=function(e){var i,n,a;e.parents("."+f)[0]&&(n=(e=e.parent("."+g)).parent(),a=e.prev().find('input[same="layuiTreeCheck"]'),l?a.prop("checked",l):(e.find('input[same="layuiTreeCheck"]').each(function(){this.checked&&(i=!0)}),i||a.prop("checked",!1)),t(n))})(e),this.renderForm("checkbox"))},l.prototype.checkClick=function(n,a){var t=this,l=t.config;n.children("."+m).children("."+x).on("click",'input[same="layuiTreeCheck"]+',function(e){layui.stope(e);var e=u(this).prev(),i=e.prop("checked");e.prop("disabled")||(t.setCheckbox(n,a,e),l.oncheck&&l.oncheck({elem:n,checked:i,data:a}))})},l.prototype.operate=function(c,d){var s=this,o=s.config,e=c.children("."+m),h=e.children("."+x);e.children(".layui-tree-btnGroup").on("click",".layui-icon",function(e){layui.stope(e);var i,e=u(this).data("type"),a=c.children("."+g),t={data:d,type:e,elem:c};if("add"==e){a[0]||(o.showLine?(h.find("."+C).addClass("layui-tree-icon"),h.find("."+C).children(".layui-icon").addClass(k).removeClass("layui-icon-file")):h.find(".layui-tree-iconArrow").removeClass(y),c.append('
        '));var n,l=o.operate&&o.operate(t),r={};if(r.title=o.text.defaultNodeName,r.id=l,s.tree(c.children("."+g),[r]),o.showLine&&(a[0]?(a.hasClass(L)||a.addClass(L),c.find("."+g).each(function(){u(this).children("."+f).last().addClass(N)}),(a.children("."+f).last().prev().hasClass(N)?a.children("."+f).last().prev():a.children("."+f).last()).removeClass(N),!c.parent("."+g)[0]&&c.next()[0]&&a.children("."+f).last().removeClass(N)):(l=c.siblings("."+f),n=1,r=c.parent("."+g),layui.each(l,function(e,i){u(i).children("."+g)[0]||(n=0)}),1==n?(l.children("."+g).addClass(T),l.children("."+g).children("."+f).removeClass(N),c.children("."+g).addClass(T),r.removeClass(L),r.children("."+f).last().children("."+g).children("."+f).last().addClass(N)):c.children("."+g).children("."+f).addClass(N))),!o.showCheckbox)return;h.find('input[same="layuiTreeCheck"]')[0].checked&&(c.children("."+g).children("."+f).last().find('input[same="layuiTreeCheck"]')[0].checked=!0),s.renderForm("checkbox")}else"update"==e?(l=h.children("."+b).html(),h.children("."+b).html(""),h.append(''),h.children(".layui-tree-editInput").val(l).focus(),i=function(e){var i=(i=e.val().trim())||o.text.defaultNodeName;e.remove(),h.children("."+b).html(i),t.data.title=i,o.operate&&o.operate(t)},h.children(".layui-tree-editInput").blur(function(){i(u(this))}),h.children(".layui-tree-editInput").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),i(u(this)))})):p.confirm('\u786e\u8ba4\u5220\u9664\u8be5\u8282\u70b9 "'+(d.title||"")+'" \u5417\uff1f',function(e){if(o.operate&&o.operate(t),t.status="remove",p.close(e),!c.prev("."+f)[0]&&!c.next("."+f)[0]&&!c.parent("."+g)[0])return c.remove(),void s.elem.append(s.elemNone);var l,n,i;c.siblings("."+f).children("."+m)[0]?(o.showCheckbox&&(l=function(e){var i,n,a,t;e.parents("."+f)[0]&&(i=e.siblings("."+f).children("."+m),n=(e=e.parent("."+g).prev()).find('input[same="layuiTreeCheck"]')[0],a=1,(t=0)==n.checked&&(i.each(function(e,i){i=u(i).find('input[same="layuiTreeCheck"]')[0];0!=i.checked||i.disabled||(a=0),i.disabled||(t=1)}),1==a&&1==t&&(n.checked=!0,s.renderForm("checkbox"),l(e.parent("."+f)))))})(c),o.showLine&&(e=c.siblings("."+f),n=1,i=c.parent("."+g),layui.each(e,function(e,i){u(i).children("."+g)[0]||(n=0)}),1==n?(a[0]||(i.removeClass(L),e.children("."+g).addClass(T),e.children("."+g).children("."+f).removeClass(N)),(c.next()[0]?i.children("."+f).last():c.prev()).children("."+g).children("."+f).last().addClass(N),c.next()[0]||c.parents("."+f)[1]||c.parents("."+f).eq(0).next()[0]||c.prev("."+f).addClass(N)):!c.next()[0]&&c.hasClass(N)&&c.prev().addClass(N))):(e=c.parent("."+g).prev(),o.showLine?(e.find("."+C).removeClass("layui-tree-icon"),e.find("."+C).children(".layui-icon").removeClass(v).addClass("layui-icon-file"),(i=e.parents("."+g).eq(0)).addClass(L),i.children("."+f).each(function(){u(this).children("."+g).children("."+f).last().addClass(N)})):e.find(".layui-tree-iconArrow").addClass(y),c.parents("."+f).eq(0).removeClass(w),c.parent("."+g).remove()),c.remove()})})},l.prototype.events=function(){var i=this,t=i.config;i.elem.find(".layui-tree-checkedFirst");i.setChecked(i.checkids),i.elem.find(".layui-tree-search").on("keyup",function(){var e=u(this),n=e.val(),e=e.nextAll(),a=[];e.find("."+b).each(function(){var i,e=u(this).parents("."+m);-1!=u(this).html().indexOf(n)&&(a.push(u(this).parent()),(i=function(e){e.addClass("layui-tree-searchShow"),e.parent("."+g)[0]&&i(e.parent("."+g).parent("."+f))})(e.parent("."+f)))}),e.find("."+m).each(function(){var e=u(this).parent("."+f);e.hasClass("layui-tree-searchShow")||e.addClass(y)}),0==e.find(".layui-tree-searchShow").length&&i.elem.append(i.elemNone),t.onsearch&&t.onsearch({elem:a})}),i.elem.find(".layui-tree-search").on("keydown",function(){u(this).nextAll().find("."+m).each(function(){u(this).parent("."+f).removeClass("layui-tree-searchShow "+y)}),u(".layui-tree-emptyText")[0]&&u(".layui-tree-emptyText").remove()})},l.prototype.getChecked=function(){var e=this.config,i=[],n=[],t=(this.elem.find(".layui-form-checked").each(function(){i.push(u(this).prev()[0].value)}),function(e,a){layui.each(e,function(e,n){layui.each(i,function(e,i){if(n.id==i)return delete(i=u.extend({},n)).children,a.push(i),n.children&&(i.children=[],t(n.children,i.children)),!0})})});return t(u.extend({},e.data),n),n},l.prototype.setChecked=function(l){this.config;this.elem.find("."+f).each(function(e,i){var n=u(this).data("id"),a=u(i).children("."+m).find('input[same="layuiTreeCheck"]'),t=a.next();if("number"==typeof l){if(n.toString()==l.toString())return a[0].checked||t.click(),!1}else"object"==typeof l&&layui.each(l,function(e,i){if(i.toString()==n.toString()&&!a[0].checked)return t.click(),!0})})},t.that={},t.config={},a.reload=function(e,i){e=t.that[e];return e.reload(i),t.call(e)},a.getChecked=function(e){return t.that[e].getChecked()},a.setChecked=function(e,i){return t.that[e].setChecked(i)},a.render=function(e){e=new l(e);return t.call(e)},e(n,a)});layui.define(["laytpl","form"],function(e){"use strict";var s=layui.$,n=layui.laytpl,t=layui.form,a="transfer",i={config:{},index:layui[a]?layui[a].index+1e4:0,set:function(e){var t=this;return t.config=s.extend({},t.config,e),t},on:function(e,t){return layui.onevent.call(this,a,e,t)}},l=function(){var t=this,e=t.config,a=e.id||t.index;return l.that[a]=t,{config:l.config[a]=e,reload:function(e){t.reload.call(t,e)},getData:function(){return t.getData.call(t)}}},d="layui-hide",h="layui-btn-disabled",r="layui-none",c="layui-transfer-box",u="layui-transfer-header",o="layui-transfer-search",f="layui-transfer-data",y=function(e){return['
        ','
        ','","
        ","{{# if(d.data.showSearch){ }}",'","{{# } }}",'
          ',"
          "].join("")},p=['
          ',y({index:0,checkAllName:"layTransferLeftCheckAll"}),'
          ','",'","
          ",y({index:1,checkAllName:"layTransferRightCheckAll"}),"
          "].join(""),v=function(e){var t=this;t.index=++i.index,t.config=s.extend({},t.config,i.config,e),t.render()};v.prototype.config={title:["\u5217\u8868\u4e00","\u5217\u8868\u4e8c"],width:200,height:360,data:[],value:[],showSearch:!1,id:"",text:{none:"\u65e0\u6570\u636e",searchNone:"\u65e0\u5339\u914d\u6570\u636e"}},v.prototype.reload=function(e){var t=this;t.config=s.extend({},t.config,e),t.render()},v.prototype.render=function(){var e=this,t=e.config,a=e.elem=s(n(p).render({data:t,index:e.index})),i=t.elem=s(t.elem);i[0]&&(t.data=t.data||[],t.value=t.value||[],e.key=t.id||e.index,i.html(e.elem),e.layBox=e.elem.find("."+c),e.layHeader=e.elem.find("."+u),e.laySearch=e.elem.find("."+o),e.layData=a.find("."+f),e.layBtn=a.find(".layui-transfer-active .layui-btn"),e.layBox.css({width:t.width,height:t.height}),e.layData.css({height:(i=t.height-e.layHeader.outerHeight(),t.showSearch&&(i-=e.laySearch.outerHeight()),i-2)}),e.renderData(),e.events())},v.prototype.renderData=function(){var e=this,i=(e.config,[{checkName:"layTransferLeftCheck",views:[]},{checkName:"layTransferRightCheck",views:[]}]);e.parseData(function(e){var t=e.selected?1:0,a=["
        • ",'',"
        • "].join("");i[t].views.push(a),delete e.selected}),e.layData.eq(0).html(i[0].views.join("")),e.layData.eq(1).html(i[1].views.join("")),e.renderCheckBtn()},v.prototype.renderForm=function(e){t.render(e,"LAY-transfer-"+this.index)},v.prototype.renderCheckBtn=function(r){var c=this,o=c.config;r=r||{},c.layBox.each(function(e){var t=s(this),a=t.find("."+f),t=t.find("."+u).find('input[type="checkbox"]'),i=a.find('input[type="checkbox"]'),n=0,l=!1;i.each(function(){var e=s(this).data("hide");(this.checked||this.disabled||e)&&n++,this.checked&&!e&&(l=!0)}),t.prop("checked",l&&n===i.length),c.layBtn.eq(e)[l?"removeClass":"addClass"](h),r.stopNone||(i=a.children("li:not(."+d+")").length,c.noneView(a,i?"":o.text.none))}),c.renderForm("checkbox")},v.prototype.noneView=function(e,t){var a=s('

          '+(t||"")+"

          ");e.find("."+r)[0]&&e.find("."+r).remove(),t.replace(/\s/g,"")&&e.append(a)},v.prototype.setValue=function(){var e=this.config,t=[];return this.layBox.eq(1).find("."+f+' input[type="checkbox"]').each(function(){s(this).data("hide")||t.push(this.value)}),e.value=t,this},v.prototype.parseData=function(t){var i=this.config,n=[];return layui.each(i.data,function(e,a){a=("function"==typeof i.parseData?i.parseData(a):a)||a,n.push(a=s.extend({},a)),layui.each(i.value,function(e,t){t==a.value&&(a.selected=!0)}),t&&t(a)}),i.data=n,this},v.prototype.getData=function(e){var t=this.config,i=[];return this.setValue(),layui.each(e||t.value,function(e,a){layui.each(t.data,function(e,t){delete t.selected,a==t.value&&i.push(t)})}),i},v.prototype.transfer=function(e,t){var a,i=this,n=i.config,l=i.layBox.eq(e),r=[],t=(t?((a=(t=t).find('input[type="checkbox"]'))[0].checked=!1,l.siblings("."+c).find("."+f).append(t.clone()),t.remove(),r.push(a[0].value),i.setValue()):l.each(function(e){s(this).find("."+f).children("li").each(function(){var e=s(this),t=e.find('input[type="checkbox"]'),a=t.data("hide");t[0].checked&&!a&&(t[0].checked=!1,l.siblings("."+c).find("."+f).append(e.clone()),e.remove(),r.push(t[0].value)),i.setValue()})}),i.renderCheckBtn(),l.siblings("."+c).find("."+o+" input"));""!==t.val()&&t.trigger("keyup"),n.onchange&&n.onchange(i.getData(r),e)},v.prototype.events=function(){var n=this,l=n.config;n.elem.on("click",'input[lay-filter="layTransferCheckbox"]+',function(){var e=s(this).prev(),t=e[0].checked,a=e.parents("."+c).eq(0).find("."+f);e[0].disabled||("all"===e.attr("lay-type")&&a.find('input[type="checkbox"]').each(function(){this.disabled||(this.checked=t)}),setTimeout(function(){n.renderCheckBtn({stopNone:!0})},0))}),n.elem.on("dblclick","."+f+">li",function(e){var t=s(this),a=t.children('input[type="checkbox"]'),i=t.parent().parent();a[0].disabled||n.transfer(i.data("index"),t)}),n.layBtn.on("click",function(){var e=s(this),t=e.data("index");e.hasClass(h)||n.transfer(t)}),n.laySearch.find("input").on("keyup",function(){var i=this.value,e=s(this).parents("."+o).eq(0).siblings("."+f),t=e.children("li"),t=(t.each(function(){var e=s(this),t=e.find('input[type="checkbox"]'),a=t[0].title,a=("cs"!==l.showSearch&&(a=a.toLowerCase(),i=i.toLowerCase()),-1!==a.indexOf(i));e[a?"removeClass":"addClass"](d),t.data("hide",!a)}),n.renderCheckBtn(),t.length===e.children("li."+d).length);n.noneView(e,t?l.text.searchNone:"")})},l.that={},l.config={},i.reload=function(e,t){e=l.that[e];return e.reload(t),l.call(e)},i.getData=function(e){return l.that[e].getData()},i.render=function(e){e=new v(e);return l.call(e)},e(a,i)});layui.define("jquery",function(e){"use strict";var a=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var i=this;return i.config=a.extend({},i.config,e),i},on:function(e,i){return layui.onevent.call(this,r,e,i)}}),r="carousel",d="layui-this",s="layui-carousel-left",u="layui-carousel-right",c="layui-carousel-prev",m="layui-carousel-next",t="layui-carousel-arrow",o="layui-carousel-ind",i=function(e){var i=this;i.config=a.extend({},i.config,n.config,e),i.render()};i.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},i.prototype.render=function(){var e=this,i=e.config;i.elem=a(i.elem),i.elem[0]&&(e.elemItem=i.elem.find(">*[carousel-item]>*"),i.index<0&&(i.index=0),i.index>=e.elemItem.length&&(i.index=e.elemItem.length-1),i.interval<800&&(i.interval=800),i.full?i.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):i.elem.css({width:i.width,height:i.height}),i.elem.attr("lay-anim",i.anim),e.elemItem.eq(i.index).addClass(d),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},i.prototype.reload=function(e){var i=this;clearInterval(i.timer),i.config=a.extend({},i.config,e),i.render()},i.prototype.prevIndex=function(){var e=this.config.index-1;return e=e<0?this.elemItem.length-1:e},i.prototype.nextIndex=function(){var e=this.config.index+1;return e=e>=this.elemItem.length?0:e},i.prototype.addIndex=function(e){var i=this.config;i.index=i.index+(e=e||1),i.index>=this.elemItem.length&&(i.index=0)},i.prototype.subIndex=function(e){var i=this.config;i.index=i.index-(e=e||1),i.index<0&&(i.index=this.elemItem.length-1)},i.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(clearInterval(e.timer),e.timer=setInterval(function(){e.slide()},i.interval))},i.prototype.arrow=function(){var i=this,e=i.config,n=a(['",'"].join(""));e.elem.attr("lay-arrow",e.arrow),e.elem.find("."+t)[0]&&e.elem.find("."+t).remove(),e.elem.append(n),n.on("click",function(){var e=a(this).attr("lay-type");i.slide(e)})},i.prototype.jump=function(e){var i=this,n=i.config;e>n.index?i.slide("add",e-n.index):e
            ',(i=[],layui.each(e.elemItem,function(e){i.push("")}),i.join("")),"
          "].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+o)[0]&&n.elem.find("."+o).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-t.height()/2),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){e.jump(a(this).index())})},i.prototype.slide=function(e,i){var n=this,t=n.elemItem,a=n.config,o=a.index,l=a.elem.attr("lay-filter");n.haveSlide||("sub"===e?(n.subIndex(i),t.eq(a.index).addClass(c),setTimeout(function(){t.eq(o).addClass(u),t.eq(a.index).addClass(u)},50)):(n.addIndex(i),t.eq(a.index).addClass(m),setTimeout(function(){t.eq(o).addClass(s),t.eq(a.index).addClass(s)},50)),setTimeout(function(){t.removeClass(d+" "+c+" "+m+" "+s+" "+u),t.eq(a.index).addClass(d),n.haveSlide=!1},300),n.elemInd.find("li").eq(a.index).addClass(d).siblings().removeClass(d),n.haveSlide=!0,e={index:a.index,prevIndex:o,item:t.eq(a.index)},"function"==typeof a.change&&a.change(e),layui.event.call(this,r,"change("+l+")",e))},i.prototype.events=function(){var e=this,i=e.config;i.elem.data("haveEvents")||(i.elem.on("mouseenter",function(){"always"!==e.config.autoplay&&clearInterval(e.timer)}).on("mouseleave",function(){"always"!==e.config.autoplay&&e.autoplay()}),i.elem.data("haveEvents",!0))},n.render=function(e){return new i(e)},e(r,n)});layui.define("jquery",function(e){"use strict";var u=layui.jquery,l={config:{},index:layui.rate?layui.rate.index+1e4:0,set:function(e){var a=this;return a.config=u.extend({},a.config,e),a},on:function(e,a){return layui.onevent.call(this,i,e,a)}},i="rate",c="layui-icon-rate",r="layui-icon-rate-solid",o="layui-icon-rate-half",s="layui-icon-rate-solid layui-icon-rate-half",f="layui-icon-rate layui-icon-rate-half",a=function(e){var a=this;a.index=++l.index,a.config=u.extend({},a.config,l.config,e),a.render()};a.prototype.config={length:5,text:!1,readonly:!1,half:!1,value:0,theme:""},a.prototype.render=function(){for(var e=this,a=e.config,l=a.theme?'style="color: '+a.theme+';"':"",i=(a.elem=u(a.elem),a.value>a.length&&(a.value=a.length),parseInt(a.value)===a.value||a.half||(a.value=Math.ceil(a.value)-a.value<.5?Math.ceil(a.value):Math.floor(a.value)),'
            "),n=1;n<=a.length;n++){var t='
          • ";a.half&&parseInt(a.value)!==a.value&&n==Math.ceil(a.value)?i=i+'
          • ":i+=t}i+="
          "+(a.text?''+a.value+"\u661f":"")+"";var o=a.elem,s=o.next(".layui-rate");s[0]&&s.remove(),e.elemTemp=u(i),a.span=e.elemTemp.next("span"),a.setText&&a.setText(a.value),o.html(e.elemTemp),o.addClass("layui-inline"),a.readonly||e.action()},a.prototype.setvalue=function(e){this.config.value=e,this.render()},a.prototype.action=function(){var i=this.config,n=this.elemTemp,t=n.find("i").width();n.children("li").each(function(e){var a=e+1,l=u(this);l.on("click",function(e){i.value=a,i.half&&e.pageX-u(this).offset().left<=t/2&&(i.value=i.value-.5),i.text&&n.next("span").text(i.value+"\u661f"),i.choose&&i.choose(i.value),i.setText&&i.setText(i.value)}),l.on("mousemove",function(e){n.find("i").each(function(){u(this).addClass(c).removeClass(s)}),n.find("i:lt("+a+")").each(function(){u(this).addClass(r).removeClass(f)}),i.half&&e.pageX-u(this).offset().left<=t/2&&l.children("i").addClass(o).removeClass(r)}),l.on("mouseleave",function(){n.find("i").each(function(){u(this).addClass(c).removeClass(s)}),n.find("i:lt("+Math.floor(i.value)+")").each(function(){u(this).addClass(r).removeClass(f)}),i.half&&parseInt(i.value)!==i.value&&n.children("li:eq("+Math.floor(i.value)+")").children("i").addClass(o).removeClass("layui-icon-rate-solid layui-icon-rate")})})},a.prototype.events=function(){this.config},l.render=function(e){e=new a(e);return function(){var a=this;return{setvalue:function(e){a.setvalue.call(a,e)},config:a.config}}.call(e)},e(i,l)});layui.define("jquery",function(l){"use strict";var g=layui.$,e=function(l){};e.prototype.load=function(l){var t,i,n,e,r,o,a,c,m,s,u,f,y,d=this,p=0,h=g((l=l||{}).elem);if(h[0])return e=g(l.scrollElem||document),r=l.mb||50,o=!("isAuto"in l)||l.isAuto,a=l.end||"\u6ca1\u6709\u66f4\u591a\u4e86",c=l.scrollElem&&l.scrollElem!==document,m="\u52a0\u8f7d\u66f4\u591a",s=g('"),h.find(".layui-flow-more")[0]||h.append(s),u=function(l,e){l=g(l),s.before(l),(e=0==e||null)?s.html(a):s.find("a").html(m),i=e,t=null,y&&y()},f=function(){t=!0,s.find("a").html(''),"function"==typeof l.done&&l.done(++p,u)},f(),s.find("a").on("click",function(){g(this);i||t||f()}),l.isLazyimg&&(y=d.lazyimg({elem:l.elem+" img",scrollElem:l.scrollElem})),o&&e.on("scroll",function(){var e=g(this),o=e.scrollTop();n&&clearTimeout(n),!i&&h.width()&&(n=setTimeout(function(){var l=(c?e:g(window)).height();(c?e.prop("scrollHeight"):document.documentElement.scrollHeight)-o-l<=r&&(t||f())},100))}),d},e.prototype.lazyimg=function(l){var e,c=this,m=0,s=g((l=l||{}).scrollElem||document),u=l.elem||"img",f=l.scrollElem&&l.scrollElem!==document,y=function(e,l){var o,t=s.scrollTop(),l=t+l,i=f?e.offset().top-s.offset().top+t:e.offset().top;t<=i&&i<=l&&e.attr("lay-src")&&(o=e.attr("lay-src"),layui.img(o,function(){var l=c.lazyimg.elem.eq(m);e.attr("src",o).removeAttr("lay-src"),l[0]&&n(l),m++},function(){c.lazyimg.elem.eq(m);e.removeAttr("lay-src")}))},n=function(l,e){var o=(f?e||s:g(window)).height(),t=s.scrollTop(),i=t+o;if(c.lazyimg.elem=g(u),l)y(l,o);else for(var n=0;n'),n=d('
          ');t.addClass("layui-code-view layui-box"),l.skin&&("notepad"===l.skin&&(l.skin="dark"),t.addClass("layui-code-"+l.skin)),i=(i=l.encode?o.escape(i):i).replace(/[\r\t\n]+/g,"
        • "),t.html(s.html("
        • "+i+"
        • ")),t.children("."+u)[0]||(n.html(l.title+(l.about?'
          '+l.about+"
          ":"")),t.prepend(n)),0<(i=Math.floor(s.find("li").length/100))&&s.css("margin-left",i+"px"),l.height&&s.css("max-height",l.height)})})}),layui["layui.all"]||layui.addcss("modules/code.css?v=3","skincodecss"); \ No newline at end of file +/** v2.9.4 | MIT Licensed */;!function(d){"use strict";var t,h=d.document,m={modules:{},status:{},timeout:10,event:{}},n=function(){this.v="2.9.4"},e=d.LAYUI_GLOBAL||{},v=(t=h.currentScript?h.currentScript.src:function(){for(var t,e=h.scripts,o=e.length-1,n=o;01e3*m.timeout/4?g(s+" is not a valid module","error"):void(m.status[s]?y():setTimeout(n,4))}())}function y(){e.push(layui[s]),11e3*m.timeout/4?g(s+" is not a valid module","error"):void("string"==typeof m.modules[s]&&m.status[s]?y():setTimeout(f,4))}():((r=h.createElement("script"))["async"]=!0,r.charset="utf-8",r.src=i+((u=!0===m.version?m.v||(new Date).getTime():m.version||"")?"?v="+u:""),l.appendChild(r),!r.attachEvent||r.attachEvent.toString&&r.attachEvent.toString().indexOf("[native code")<0||b?r.addEventListener("load",function(t){p(t,i)},!1):r.attachEvent("onreadystatechange",function(t){p(t,i)}),m.modules[s]=i)),a},n.prototype.disuse=function(t){var o=this;return t=o.isArray(t)?t:[t],o.each(t,function(t,e){m.status[e],delete o[e],delete N[e],delete o.modules[e],delete m.status[e],delete m.modules[e]}),o},n.prototype.getStyle=function(t,e){t=t.currentStyle||d.getComputedStyle(t,null);return t[t.getPropertyValue?"getPropertyValue":"getAttribute"](e)},n.prototype.link=function(o,n,t){var r=this,e=h.getElementsByTagName("head")[0],i=h.createElement("link"),a="layuicss-"+((t="string"==typeof n?n:t)||o).replace(/\.|\//g,""),u="creating",l=0;return i.href=o+(m.debug?"?v="+(new Date).getTime():""),i.rel="stylesheet",i.id=a,i.media="all",h.getElementById(a)||e.appendChild(i),"function"==typeof n&&function s(t){var e=h.getElementById(a);return++l>1e3*m.timeout/100?g(o+" timeout"):void(1989===parseInt(r.getStyle(e,"width"))?(t===u&&e.removeAttribute("lay-status"),e.getAttribute("lay-status")===u?setTimeout(s,100):n()):(e.setAttribute("lay-status",u),setTimeout(function(){s(u)},100)))}(),r},n.prototype.addcss=function(t,e,o){return layui.link(m.dir+"css/"+t,e,o)},m.callback={},n.prototype.factory=function(t){if(layui[t])return"function"==typeof m.callback[t]?m.callback[t]:null},n.prototype.img=function(t,e,o){var n=new Image;if(n.src=t,n.complete)return e(n);n.onload=function(){n.onload=null,"function"==typeof e&&e(n)},n.onerror=function(t){n.onerror=null,"function"==typeof o&&o(t)}},n.prototype.config=function(t){for(var e in t=t||{})m[e]=t[e];return this},n.prototype.modules=function(){var t,e={};for(t in N)e[t]=N[t];return e}(),n.prototype.extend=function(t){for(var e in t=t||{})this[e]||this.modules[e]?g(e+" Module already exists","error"):this.modules[e]=t[e];return this},n.prototype.router=n.prototype.hash=function(t){var o={path:[],search:{},hash:((t=t||location.hash).match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(t)&&(t=t.replace(/^#\//,""),o.href="/"+t,t=t.replace(/([^#])(#.*$)/,"$1").split("/")||[],this.each(t,function(t,e){/^\w+=/.test(e)?(e=e.split("="),o.search[e[0]]=e[1]):o.path.push(e)})),o},n.prototype.url=function(t){var r,e,o=this;return{pathname:(t?((t.match(/\.[^.]+?\/.+/)||[])[0]||"").replace(/^[^\/]+/,"").replace(/\?.+/,""):location.pathname).replace(/^\//,"").split("/"),search:(r={},e=(t?((t.match(/\?.+/)||[])[0]||"").replace(/\#.+/,""):location.search).replace(/^\?+/,"").split("&"),o.each(e,function(t,e){var o=e.indexOf("="),n=o<0?e.substr(0,e.length):0!==o&&e.substr(0,o);n&&(r[n]=0(l.innerHeight||h.documentElement.clientHeight)},d.getStyleRules=function(t,n){if(t)return t=(t=t.sheet||t.styleSheet||{}).cssRules||t.rules,"function"==typeof n&&layui.each(t,function(t,e){if(n(e,t))return!0}),t},d.style=function(t){t=t||{};var e=d.elem("style"),n=t.text||"",i=t.target;if(n)return"styleSheet"in e?(e.setAttribute("type","text/css"),e.styleSheet.cssText=n):e.innerHTML=n,e.id="LAY-STYLE-"+(t.id||(n=d.style.index||0,d.style.index++,"DF-"+n)),i&&((t=d(i).find("#"+e.id))[0]&&t.remove(),d(i).append(e)),e},d.position=function(t,e,n){var i,o,r,c,u,a,s,f;e&&(n=n||{},t!==h&&t!==d("body")[0]||(n.clickType="right"),i="right"===n.clickType?{left:(i=n.e||l.event||{}).clientX,top:i.clientY,right:i.clientX,bottom:i.clientY}:t.getBoundingClientRect(),s=e.offsetWidth,f=e.offsetHeight,o=function(t){return h.body[t=t?"scrollLeft":"scrollTop"]|h.documentElement[t]},r=function(t){return h.documentElement[t?"clientWidth":"clientHeight"]},c="margin"in n?n.margin:5,u=i.left,a=i.bottom,"center"===n.align?u-=(s-t.offsetWidth)/2:"right"===n.align&&(u=u-s+t.offsetWidth),(u=u+s+c>r("width")?r("width")-s-c:u)r()&&(i.top>f+c&&i.top<=r()?a=i.top-f-2*c:n.allowBottomOut||(a=r()-f-2*c)<0&&(a=0)),(s=n.position)&&(e.style.position=s),e.style.left=u+("fixed"===s?0:o(1))+"px",e.style.top=a+("fixed"===s?0:o())+"px",d.hasScrollbar()||(f=e.getBoundingClientRect(),!n.SYSTEM_RELOAD&&f.bottom+c>r()&&(n.SYSTEM_RELOAD=!0,setTimeout(function(){d.position(t,e,n)},50))))},d.options=function(t,e){if(e="object"==typeof e?e:{attr:e},t===h)return{};var t=d(t),n=e.attr||"lay-options",t=t.attr(n);try{return new Function("return "+(t||"{}"))()}catch(i){return layui.hint().error(e.errorText||[n+'="'+t+'"',"\n parseerror: "+i].join("\n"),"error"),{}}},d.isTopElem=function(n){var t=[h,d("body")[0]],i=!1;return d.each(t,function(t,e){if(e===n)return i=!0}),i},d.clipboard={writeText:function(n){var i=String(n.text);function t(){var t=h.createElement("textarea");t.value=i,t.style.position="fixed",t.style.opacity="0",t.style.top="0px",t.style.left="0px",h.body.appendChild(t),t.select();try{h.execCommand("copy"),"function"==typeof n.done&&n.done()}catch(e){"function"==typeof n.error&&n.error(e)}finally{t.remove?t.remove():h.body.removeChild(t)}}navigator&&"clipboard"in navigator?navigator.clipboard.writeText(i).then(n.done,function(){t()}):t()}},d.passiveSupported=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});l.addEventListener("test",null,e),l.removeEventListener("test",null,e)}catch(n){}return t}(),d.touchEventsSupported=function(){return"ontouchstart"in l},d.touchSwipe=function(t,e){var n,i,o,r=e,c=d(t)[0];c&&d.touchEventsSupported()&&(n={pointerStart:{x:0,y:0},pointerEnd:{x:0,y:0},distanceX:0,distanceY:0,direction:"none",timeStart:null},e=function(t){1===t.touches.length&&(c.addEventListener("touchmove",i,!!d.passiveSupported&&{passive:!1}),c.addEventListener("touchend",o),c.addEventListener("touchcancel",o),n.timeStart=Date.now(),n.pointerStart.x=n.pointerEnd.x=t.touches[0].clientX,n.pointerStart.y=n.pointerEnd.y=t.touches[0].clientY,n.distanceX=n.distanceY=0,n.direction="none",r.onTouchStart)&&r.onTouchStart(t,n)},i=function(t){t.preventDefault(),n.pointerEnd.x=t.touches[0].clientX,n.pointerEnd.y=t.touches[0].clientY,n.distanceX=n.pointerStart.x-n.pointerEnd.x,n.distanceY=n.pointerStart.y-n.pointerEnd.y,Math.abs(n.distanceX)>Math.abs(n.distanceY)?n.direction=0]|&(?=#[a-zA-Z0-9]+)/g.test(e+="")?e.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,"""):e}},i=function(e){return new RegExp(e,"g")},u=function(e,r){var n="Laytpl Error: ";return"object"==typeof console&&console.error(n+e+"\n"+(r||"")),n+e},n=function(e,r){var n=this,e=(n.config=n.config||{},n.template=e,function(e){for(var r in e)n.config[r]=e[r]});e(c),e(r)},r=(n.prototype.tagExp=function(e,r,n){var c=this.config;return i((r||"")+c.open+["#([\\s\\S])+?","([^{#}])*?"][e||0]+c.close+(n||""))},n.prototype.parse=function(e,r){var n=this,c=n.config,t=e,o=i("^"+c.open+"#",""),p=i(c.close+"$","");if("string"!=typeof e)return e;e='"use strict";var view = "'+(e=e.replace(/\s+|\r|\t|\n/g," ").replace(i(c.open+"#"),c.open+"# ").replace(i(c.close+"}"),"} "+c.close).replace(/\\/g,"\\\\").replace(i(c.open+"!(.+?)!"+c.close),function(e){return e=e.replace(i("^"+c.open+"!"),"").replace(i("!"+c.close),"").replace(i(c.open+"|"+c.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(n.tagExp(),function(e){return'";'+(e=e.replace(o,"").replace(p,"")).replace(/\\(.)/g,"$1")+';view+="'}).replace(n.tagExp(1),function(e){var r='"+laytpl.escape(';return e.replace(/\s/g,"")===c.open+c.close?"":(e=e.replace(i(c.open+"|"+c.close),""),/^=/.test(e)?e=e.replace(/^=/,""):/^-/.test(e)&&(e=e.replace(/^-/,""),r='"+('),r+e.replace(/\\(.)/g,"$1")+')+"')}))+'";return view;';try{return n.cache=e=new Function("d, laytpl",e),e(r,l)}catch(a){return delete n.cache,u(a,t)}},n.prototype.render=function(e,r){e=e||{};var n=this,e=n.cache?n.cache(e,l):n.parse(n.template,e);return"function"==typeof r&&r(e),e},function(e,r){return new n(e,r)});r.config=function(e){for(var r in e=e||{})c[r]=e[r]},r.v="2.0.0",e("laytpl",r)});layui.define(function(e){"use strict";var r=document,u="getElementById",c="getElementsByTagName",a="layui-disabled",t=function(e){var a=this;a.config=e||{},a.config.index=++o.index,a.render(!0)},o=(t.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return e.elem.length===undefined?2:3},t.prototype.view=function(){var i,e,t,n=this.config,r=n.groups="groups"in n?Number(n.groups)||0:5,u=(n.layout="object"==typeof n.layout?n.layout:["prev","page","next"],n.count=Number(n.count)||0,n.curr=Number(n.curr)||1,n.limits="object"==typeof n.limits?n.limits:[10,20,30,40,50],n.limit=Number(n.limit)||10,n.pages=Math.ceil(n.count/n.limit)||1,n.curr>n.pages?n.curr=n.pages:n.curr<1&&(n.curr=1),r<0?r=1:r>n.pages&&(r=n.pages),n.prev="prev"in n?n.prev:"上一页",n.next="next"in n?n.next:"下一页",n.pages>r?Math.ceil((n.curr+(1'+n.prev+"":"",page:function(){var e=[];if(n.count<1)return"";1'+(n.first||1)+"");var a=Math.floor((r-1)/2),t=1n.pages?n.pages:a:r;for(i-t…');t<=i;t++)t===n.curr?e.push('"+t+""):e.push(''+t+"");return n.pages>r&&n.pages>i&&!1!==n.last&&(i+1…'),0!==r)&&e.push(''+(n.last||n.pages)+""),e.join("")}(),next:n.next?''+n.next+"":"",count:''+(e="object"==typeof n.countText?n.countText:["\u5171 "," \u6761"])[0]+n.count+e[1]+"",limit:(i=['"),refresh:['','',""].join(""),skip:[''+(e="object"==typeof n.skipText?n.skipText:["到第","页","确定"])[0],'',e[1]+'",""].join("")};return['
          ',(t=[],layui.each(n.layout,function(e,a){l[a]&&t.push(l[a])}),t.join("")),"
          "].join("")},t.prototype.jump=function(e,a){if(e){var t=this,i=t.config,n=e.children,r=e[c]("button")[0],u=e[c]("input")[0],e=e[c]("select")[0],l=function(){var e=Number(u.value.replace(/\s|\D/g,""));e&&(i.curr=e,t.render())};if(a)return l();for(var s=0,p=n.length;si.pages||(i.curr=e,t.render())});e&&o.on(e,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),r&&o.on(r,"click",function(){l()})}},t.prototype.skip=function(t){var i,e;t&&(i=this,e=t[c]("input")[0])&&o.on(e,"keyup",function(e){var a=this.value,e=e.keyCode;/^(37|38|39|40)$/.test(e)||(/\D/.test(a)&&(this.value=a.replace(/\D/,"")),13===e&&i.jump(t,!0))})},t.prototype.render=function(e){var a=this,t=a.config,i=a.type(),n=a.view(),i=(2===i?t.elem&&(t.elem.innerHTML=n):3===i?t.elem.html(n):r[u](t.elem)&&(r[u](t.elem).innerHTML=n),t.jump&&t.jump(t,e),r[u]("layui-laypage-"+t.index));a.jump(i),t.hash&&!e&&(location.hash="!"+t.hash+"="+t.curr),a.skip(i)},{render:function(e){return new t(e).index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(a,e,t){return a.attachEvent?a.attachEvent("on"+e,function(e){e.target=e.srcElement,t.call(a,e)}):a.addEventListener(e,t,!1),this}});e("laypage",o)});!function(i,v){"use strict";var n=i.layui&&layui.define,l={getPath:i.lay&&lay.getPath?lay.getPath:"",link:function(e,t,a){D.path&&i.lay&&lay.layui&&lay.layui.link(D.path+e,t,a)}},e=i.LAYUI_GLOBAL||{},a="laydate",d="layui-"+a+"-id",D={v:"5.5.0",config:{weekStart:0},index:i.laydate&&i.laydate.v?1e5:0,path:e.laydate_dir||l.getPath,set:function(e){var t=this;return t.config=lay.extend({},t.config,e),t},ready:function(e){var t="laydate",a=(n?"modules/":"")+"laydate.css?v="+D.v;return n?layui["layui.all"]?"function"==typeof e&&e():layui.addcss(a,e,t):l.link(a,e,t),this}},s=function(){var t=this,e=t.config.id;return(s.that[e]=t).inst={hint:function(e){t.hint.call(t,e)},reload:function(e){t.reload.call(t,e)},config:t.config}},x="layui-this",k="laydate-disabled",h=[100,2e5],T="layui-laydate-static",w="layui-laydate-list",o="laydate-selected",r="layui-laydate-hint",y="laydate-day-prev",m="laydate-day-next",C=".laydate-btns-confirm",M="laydate-time-text",L="laydate-btns-time",E="layui-laydate-preview",S="layui-laydate-shade",I=function(e){var t,a=this,n=(a.index=++D.index,a.config=lay.extend({},a.config,D.config,e),lay(e.elem||a.config.elem));return 1\u8bf7\u91cd\u65b0\u9009\u62e9",invalidDate:"\u4e0d\u5728\u6709\u6548\u65e5\u671f\u6216\u65f6\u95f4\u8303\u56f4\u5185",formatError:["\u65e5\u671f\u683c\u5f0f\u4e0d\u5408\u6cd5
          \u5fc5\u987b\u9075\u5faa\u4e0b\u8ff0\u683c\u5f0f\uff1a
          ","
          \u5df2\u4e3a\u4f60\u91cd\u7f6e"],preview:"\u5f53\u524d\u9009\u4e2d\u7684\u7ed3\u679c"},en:{weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],time:["Hours","Minutes","Seconds"],timeTips:"Select Time",startTime:"Start Time",endTime:"End Time",dateTips:"Select Date",month:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],tools:{confirm:"Confirm",clear:"Clear",now:"Now"},timeout:"End time cannot be less than start Time
          Please re-select",invalidDate:"Invalid date",formatError:["The date format error
          Must be followed\uff1a
          ","
          It has been reset"],preview:"The selected result"}};return e[this.config.lang]||e.cn},I.prototype.reload=function(e){this.config=lay.extend({},this.config,e),this.init()},I.prototype.init=function(){var r=this,o=r.config,e="static"===o.position,t={year:"yyyy",month:"yyyy-MM",date:"yyyy-MM-dd",time:"HH:mm:ss",datetime:"yyyy-MM-dd HH:mm:ss"};o.elem=lay(o.elem),o.eventElem=lay(o.eventElem),o.elem[0]&&("array"!==layui.type(o.theme)&&(o.theme=[o.theme]),o.fullPanel&&("datetime"!==o.type||o.range)&&delete o.fullPanel,r.rangeStr=o.range?"string"==typeof o.range?o.range:"-":"",r.rangeLinked=!(!o.range||!o.rangeLinked||"date"!==o.type&&"datetime"!==o.type),r.autoCalendarModel=function(){var e=r.rangeLinked;return r.rangeLinked=o.range&&("date"===o.type||"datetime"===o.type)&&(!r.startDate||!r.endDate||r.startDate&&r.endDate&&r.startDate.year===r.endDate.year&&r.startDate.month===r.endDate.month),lay(r.elem)[r.rangeLinked?"addClass":"removeClass"]("layui-laydate-linkage"),r.rangeLinked!=e},r.autoCalendarModel.auto=r.rangeLinked&&"auto"===o.rangeLinked,"array"===layui.type(o.range)&&(r.rangeElem=[lay(o.range[0]),lay(o.range[1])]),t[o.type]||(i.console&&console.error&&console.error("laydate type error:'"+o.type+"' is not supported"),o.type="date"),o.format===t.date&&(o.format=t[o.type]||t.date),r.format=s.formatArr(o.format),o.weekStart&&!/^[0-6]$/.test(o.weekStart)&&(t=r.lang(),o.weekStart=t.weeks.indexOf(o.weekStart),-1===o.weekStart)&&(o.weekStart=0),r.EXP_IF="",r.EXP_SPLIT="",lay.each(r.format,function(e,t){e=new RegExp(c).test(t)?"\\d{"+(new RegExp(c).test(r.format[0===e?e+1:e-1]||"")?/^yyyy|y$/.test(t)?4:t.length:/^yyyy$/.test(t)?"1,4":/^y$/.test(t)?"1,308":"1,2")+"}":"\\"+t;r.EXP_IF=r.EXP_IF+e,r.EXP_SPLIT=r.EXP_SPLIT+"("+e+")"}),r.EXP_IF_ONE=new RegExp("^"+r.EXP_IF+"$"),r.EXP_IF=new RegExp("^"+(o.range?r.EXP_IF+"\\s\\"+r.rangeStr+"\\s"+r.EXP_IF:r.EXP_IF)+"$"),r.EXP_SPLIT=new RegExp("^"+r.EXP_SPLIT+"$",""),r.isInput(o.elem[0])||"focus"===o.trigger&&(o.trigger="click"),o.elem.attr("lay-key",r.index),o.eventElem.attr("lay-key",r.index),o.elem.attr(d,o.id),o.mark=lay.extend({},o.calendar&&"cn"===o.lang?{"0-1-1":"\u5143\u65e6","0-2-14":"\u60c5\u4eba","0-3-8":"\u5987\u5973","0-3-12":"\u690d\u6811","0-4-1":"\u611a\u4eba","0-5-1":"\u52b3\u52a8","0-5-4":"\u9752\u5e74","0-6-1":"\u513f\u7ae5","0-9-10":"\u6559\u5e08","0-10-1":"\u56fd\u5e86","0-12-25":"\u5723\u8bde"}:{},o.mark),lay.each(["min","max"],function(e,t){var a=[],n=[];if("number"==typeof o[t])var i=o[t],l=new Date,l=r.newDate({year:l.getFullYear(),month:l.getMonth(),date:l.getDate(),hours:e?23:0,minutes:e?59:0,seconds:e?59:0}).getTime(),e=new Date(i?i<864e5?l+864e5*i:i:l),a=[e.getFullYear(),e.getMonth()+1,e.getDate()],n=[e.getHours(),e.getMinutes(),e.getSeconds()];else if("string"==typeof o[t])a=(o[t].match(/\d+-\d+-\d+/)||[""])[0].split("-"),n=(o[t].match(/\d+:\d+:\d+/)||[""])[0].split(":");else if("object"==typeof o[t])return o[t];o[t]={year:0|a[0]||(new Date).getFullYear(),month:a[1]?(0|a[1])-1:(new Date).getMonth(),date:0|a[2]||(new Date).getDate(),hours:0|n[0],minutes:0|n[1],seconds:0|n[2]}}),r.elemID="layui-laydate"+o.elem.attr("lay-key"),(o.show||e)&&r.render(),e||r.events(),o.value)&&o.isInitValue&&("date"===layui.type(o.value)?r.setValue(r.parse(0,r.systemDate(o.value))):r.setValue(o.value))},I.prototype.render=function(){var a,n,i,l,r=this,o=r.config,d=r.lang(),s="static"===o.position,y=r.elem=lay.elem("div",{id:r.elemID,"class":["layui-laydate",o.range?" layui-laydate-range":"",r.rangeLinked?" layui-laydate-linkage":"",s?" "+T:"",o.fullPanel?" laydate-theme-fullpanel":"",(a="",lay.each(o.theme,function(e,t){"default"===t||/^#/.test(t)||(a+=" laydate-theme-"+t)}),a)].join("")}),m=r.elemMain=[],c=r.elemHeader=[],u=r.elemCont=[],h=r.table=[],e=r.footer=lay.elem("div",{"class":"layui-laydate-footer"}),t=r.shortcut=lay.elem("ul",{"class":"layui-laydate-shortcut"}),f=(o.zIndex&&(y.style.zIndex=o.zIndex),lay.each(new Array(2),function(e){if(!o.range&&0'+d.timeTips+""),(o.range||"datetime"!==o.type||o.fullPanel)&&f.push(''),lay.each(o.btns,function(e,t){var a=d.tools[t]||"btn";o.range&&"now"===t||(s&&"clear"===t&&(a="cn"===o.lang?"\u91cd\u7f6e":"Reset"),n.push(''+a+""))}),f.push('"),f.join(""))),o.shortcuts&&(y.appendChild(t),lay(t).html((i=[],lay.each(o.shortcuts,function(e,t){i.push('
        • '+t.text+"
        • ")}),i.join(""))).find("li").on("click",function(e){var t=o.shortcuts[this.dataset.index]||{},t=("function"==typeof t.value?t.value():t.value)||[],n=(layui.isArray(t)||(t=[t]),o.type),t=(lay.each(t,function(e,t){var a=[o.dateTime,r.endDate][e];"time"===n&&"date"!==layui.type(t)?r.EXP_IF.test(t)&&(t=(t.match(r.EXP_SPLIT)||[]).slice(1),lay.extend(a,{hours:0|t[0],minutes:0|t[2],seconds:0|t[4]})):lay.extend(a,r.systemDate("date"===layui.type(t)?t:new Date(t))),"time"!==n&&"datetime"!==n||(r[["startTime","endTime"][e]]={hours:a.hours,minutes:a.minutes,seconds:a.seconds}),0===e?r.startDate=lay.extend({},a):r.endState=!0,"year"===n||"month"===n||"time"===n?r.listYM[e]=[a.year,a.month+1]:e&&r.autoCalendarModel.auto&&r.autoCalendarModel()}),r.checkDate("limit").calendar(null,null,"init"),lay(r.footer).find("."+L).removeClass(k));t&&"date"===t.attr("lay-type")&&t[0].click(),r.done(null,"change"),lay(this).addClass(x),"static"!==o.position&&r.setValue(r.parse()).done().remove()})),lay.each(m,function(e,t){y.appendChild(t)}),o.showBottom&&y.appendChild(e),lay.elem("style")),p=[],g=!0,t=(lay.each(o.theme,function(e,t){g&&/^#/.test(t)?(g=!(l=!0),p.push(["#{{id}} .layui-laydate-header{background-color:{{theme}};}","#{{id}} li.layui-this,#{{id}} td.layui-this>div{background-color:{{theme}} !important;}",-1!==o.theme.indexOf("circle")?"":"#{{id}} .layui-this{background-color:{{theme}} !important;}","#{{id}} .laydate-day-now{color:{{theme}} !important;}","#{{id}} .laydate-day-now:after{border-color:{{theme}} !important;}"].join("").replace(/{{id}}/g,r.elemID).replace(/{{theme}}/g,t))):!g&&/^#/.test(t)&&p.push(["#{{id}} .laydate-selected>div{background-color:{{theme}} !important;}","#{{id}} .laydate-selected:hover>div{background-color:{{theme}} !important;}"].join("").replace(/{{id}}/g,r.elemID).replace(/{{theme}}/g,t))}),o.shortcuts&&o.range&&p.push("#{{id}}.layui-laydate-range{width: 628px;}".replace(/{{id}}/g,r.elemID)),p.length&&(p=p.join(""),"styleSheet"in f?(f.setAttribute("type","text/css"),f.styleSheet.cssText=p):f.innerHTML=p,l&&lay(y).addClass("laydate-theme-molv"),y.appendChild(f)),r.remove(I.thisElemDate),D.thisId=o.id,s?o.elem.append(y):(v.body.appendChild(y),r.position()),o.shade?'
          ':"");y.insertAdjacentHTML("beforebegin",t),r.checkDate().calendar(null,0,"init"),r.changeEvent(),I.thisElemDate=r.elemID,r.renderAdditional(),"function"==typeof o.ready&&o.ready(lay.extend({},o.dateTime,{month:o.dateTime.month+1})),r.preview()},I.prototype.remove=function(e){var t=this,a=t.config,n=lay("#"+(e||t.elemID));return n[0]&&(n.hasClass(T)||t.checkDate(function(){n.remove(),delete t.startDate,delete t.endDate,delete t.endState,delete t.startTime,delete t.endTime,delete D.thisId,"function"==typeof a.close&&a.close(t)}),lay("."+S).remove()),t},I.prototype.position=function(){var e=this.config;return lay.position(e.elem[0],this.elem,{position:e.position}),this},I.prototype.hint=function(e){var t=this,a=(t.config,lay.elem("div",{"class":r}));t.elem&&(a.innerHTML=(e="object"==typeof e?e||{}:{content:e}).content||"",lay(t.elem).find("."+r).remove(),t.elem.appendChild(a),clearTimeout(t.hinTimer),t.hinTimer=setTimeout(function(){lay(t.elem).find("."+r).remove()},"ms"in e?e.ms:3e3))},I.prototype.getAsYM=function(e,t,a){return a?t--:t++,t<0&&(t=11,e--),11h[1]&&(e.year=h[1],o=!0),11t)&&(e.date=t,o=!0)},u=function(n,i,l){var r=["startTime","endTime"];i=(i.match(d.EXP_SPLIT)||[]).slice(1),l=l||0,s.range&&(d[r[l]]=d[r[l]]||{}),lay.each(d.format,function(e,t){var a=parseFloat(i[e]);i[e].lengthd.getDateTime(s.max)?(r=s.dateTime=lay.extend({},s.max),i=!0):d.getDateTime(r)d.getDateTime(s.max))&&(d.endDate=lay.extend({},s.max),i=!0),d.startTime={hours:s.dateTime.hours,minutes:s.dateTime.minutes,seconds:s.dateTime.seconds},d.endTime={hours:d.endDate.hours,minutes:d.endDate.minutes,seconds:d.endDate.seconds},"month"===s.type)&&(s.dateTime.date=1,d.endDate.date=1),i&&m&&(d.setValue(d.parse()),d.hint("value "+l.invalidDate+l.formatError[1])),d.startDate=d.startDate||m&&lay.extend({},s.dateTime),d.autoCalendarModel.auto&&d.autoCalendarModel(),d.endState=!s.range||!d.rangeLinked||!(!d.startDate||!d.endDate),e&&e()),d},I.prototype.mark=function(e,a){var n,t=this.config;return lay.each(t.mark,function(e,t){e=e.split("-");e[0]!=a[0]&&0!=e[0]||e[1]!=a[1]&&0!=e[1]||e[2]!=a[2]||(n=t||a[2])}),n&&e.find("div").html(''+n+""),this},I.prototype.holidays=function(n,i){var e=this.config,l=["","work"];return"array"===layui.type(e.holidays)&&lay.each(e.holidays,function(a,e){lay.each(e,function(e,t){t===n.attr("lay-ymd")&&n.find("div").html('"+i[2]+"")})}),this},I.prototype.limit=function(t){t=t||{};var i=this,e=i.config,l={},a=t.index>(t.time?0:41)?i.endDate:e.dateTime;return lay.each({now:lay.extend({},a,t.date||{}),min:e.min,max:e.max},function(e,a){var n;l[e]=i.newDate(lay.extend({year:a.year,month:"year"===t.type?0:a.month,date:"year"===t.type||"month"===t.type?1:a.date},(n={},lay.each(t.time,function(e,t){n[t]=a[t]}),n))).getTime()}),a=l.nowh[1]&&(d.year=h[1],o.hint(y.invalidDate)),o.firstDate||(o.firstDate=lay.extend({},d)),s.setFullYear(d.year,d.month,1),i=(s.getDay()+(7-n.weekStart))%7,l=D.getEndDate(d.month||12,d.year),r=D.getEndDate(d.month+1,d.year),lay.each(c,function(e,t){var a,n=[d.year,d.month];(t=lay(t)).removeAttr("class"),e"+n[2]+"
          "),o.mark(t,n).holidays(t,n).limit({elem:t,date:{year:n[0],month:n[1]-1,date:n[2]},index:e})}),lay(u[0]).attr("lay-ym",d.year+"-"+(d.month+1)),lay(u[1]).attr("lay-ym",d.year+"-"+(d.month+1)),"cn"===n.lang?(lay(u[0]).attr("lay-type","year").html(d.year+" \u5e74"),lay(u[1]).attr("lay-type","month").html(d.month+1+" \u6708")):(lay(u[0]).attr("lay-type","month").html(y.month[d.month]),lay(u[1]).attr("lay-type","year").html(d.year)),m&&(n.range?!e&&"init"===a||(o.listYM=[[(o.startDate||n.dateTime).year,(o.startDate||n.dateTime).month+1],[o.endDate.year,o.endDate.month+1]],o.list(n.type,0).list(n.type,1),"time"===n.type?o.setBtnStatus("\u65f6\u95f4",lay.extend({},o.systemDate(),o.startTime),lay.extend({},o.systemDate(),o.endTime)):o.setBtnStatus(!0)):(o.listYM=[[d.year,d.month+1]],o.list(n.type,0))),n.range&&"init"===a&&(o.rangeLinked?(s=o.getAsYM(d.year,d.month,t?"sub":null),o.calendar(lay.extend({},d,{year:s[0],month:s[1]}),1-t)):o.calendar(null,1-t)),n.range||(c=["hours","minutes","seconds"],o.limit({elem:lay(o.footer).find(".laydate-btns-now"),date:o.systemDate(/^(datetime|time)$/.test(n.type)?new Date:null),index:0,time:c}),o.limit({elem:lay(o.footer).find(C),index:0,time:c})),o.setBtnStatus(),lay(o.shortcut).find("li."+x).removeClass(x),n.range&&!m&&"init"!==a&&o.stampRange(),o},I.prototype.list=function(n,i){var l,r,e,o,d=this,s=d.config,y=d.rangeLinked?s.dateTime:[s.dateTime,d.endDate][i],m=d.lang(),t=s.range&&"date"!==s.type&&"datetime"!==s.type,c=lay.elem("ul",{"class":w+" "+{year:"laydate-year-list",month:"laydate-month-list",time:"laydate-time-list"}[n]}),a=d.elemHeader[i],u=lay(a[2]).find("span"),h=d.elemCont[i||0],f=lay(h).find("."+w)[0],p="cn"===s.lang,g=p?"\u5e74":"",v=d.listYM[i]||{},D=["hours","minutes","seconds"],T=["startTime","endTime"][i];return v[0]<1&&(v[0]=1),"year"===n?(e=l=v[0]-7,l<1&&(e=l=1),lay.each(new Array(15),function(e){var t=lay.elem("li",{"lay-ym":l}),a={year:l,month:0,date:1};l==v[0]&&lay(t).addClass(x),t.innerHTML=l+g,c.appendChild(t),d.limit({elem:lay(t),date:a,index:i,type:n}),l++}),lay(u[p?0:1]).attr("lay-ym",l-8+"-"+v[1]).html(e+g+" - "+(l-1)+g)):"month"===n?(lay.each(new Array(12),function(e){var t=lay.elem("li",{"lay-ym":e}),a={year:v[0],month:e,date:1};e+1==v[1]&&lay(t).addClass(x),t.innerHTML=m.month[e]+(p?"\u6708":""),c.appendChild(t),d.limit({elem:lay(t),date:a,index:i,type:n})}),lay(u[p?0:1]).attr("lay-ym",v[0]+"-"+v[1]).html(v[0]+g)):"time"===n&&(r=function(){lay(c).find("ol").each(function(a,e){lay(e).find("li").each(function(e,t){d.limit({elem:lay(t),date:[{hours:e},{hours:d[T].hours,minutes:e},{hours:d[T].hours,minutes:d[T].minutes,seconds:e}][a],index:i,time:[["hours"],["hours","minutes"],["hours","minutes","seconds"]][a]})})}),s.range||d.limit({elem:lay(d.footer).find(C),date:d[T],index:0,time:["hours","minutes","seconds"]})},s.range?d[T]||(d[T]="startTime"===T?y:d.endDate):d[T]=y,lay.each([24,60,60],function(t,e){var a=lay.elem("li"),n=["

          "+m.time[t]+"

            "];lay.each(new Array(e),function(e){n.push(""+lay.digit(e,2)+"")}),a.innerHTML=n.join("")+"
          ",c.appendChild(a)}),r()),f&&h.removeChild(f),h.appendChild(c),"year"===n||"month"===n?(lay(d.elemMain[i]).addClass("laydate-ym-show"),lay(c).find("li").on("click",function(){var e=0|lay(this).attr("lay-ym");lay(this).hasClass(k)||(d.rangeLinked?lay.extend(y,{year:"year"===n?e:v[0],month:"year"===n?v[1]-1:e}):y[n]=e,"year"===s.type||"month"===s.type?(lay(c).find("."+x).removeClass(x),lay(this).addClass(x),"month"===s.type&&"year"===n&&(d.listYM[i][0]=e,t&&((i?d.endDate:y).year=e),d.list("month",i))):(d.checkDate("limit").calendar(y,i,"init"),d.closeList()),d.setBtnStatus(),!s.range&&s.autoConfirm&&("month"===s.type&&"month"===n||"year"===s.type&&"year"===n)&&d.setValue(d.parse()).done().remove(),d.autoCalendarModel.auto&&!d.rangeLinked?d.choose(lay(h).find("td.layui-this"),i):d.endState&&d.done(null,"change"),lay(d.footer).find("."+L).removeClass(k))})):(e=lay.elem("span",{"class":M}),o=function(){lay(c).find("ol").each(function(e){var a=this,t=lay(a).find("li");a.scrollTop=30*(d[T][D[e]]-2),a.scrollTop<=0&&t.each(function(e,t){if(!lay(this).hasClass(k))return a.scrollTop=30*(e-2),!0})})},u=lay(a[2]).find("."+M),o(),e.innerHTML=s.range?[m.startTime,m.endTime][i]:m.timeTips,lay(d.elemMain[i]).addClass("laydate-time-show"),u[0]&&u.remove(),a[2].appendChild(e),(f=lay(c).find("ol")).each(function(t){var a=this;lay(a).find("li").on("click",function(){var e=0|this.innerHTML;lay(this).hasClass(k)||(s.range?d[T][D[t]]=e:y[D[t]]=e,lay(a).find("."+x).removeClass(x),lay(this).addClass(x),r(),o(),(d.endDate||"time"===s.type||"datetime"===s.type&&s.fullPanel)&&d.done(null,"change"),d.setBtnStatus())})}),layui.device().mobile&&f.css({overflowY:"auto",touchAction:"pan-y"})),d},I.prototype.listYM=[],I.prototype.closeList=function(){var a=this;a.config;lay.each(a.elemCont,function(e,t){lay(this).find("."+w).remove(),lay(a.elemMain[e]).removeClass("laydate-ym-show laydate-time-show")}),lay(a.elem).find("."+M).remove()},I.prototype.setBtnStatus=function(e,t,a){var n=this,i=n.config,l=n.lang(),r=lay(n.footer).find(C);i.range&&"time"!==i.type&&(t=t||(n.rangeLinked?n.startDate:i.dateTime),a=a||n.endDate,i=!n.endState||n.newDate(t).getTime()>n.newDate(a).getTime(),n.limit({date:t})||n.limit({date:a})?r.addClass(k):r[i?"addClass":"removeClass"](k),e)&&i&&n.hint("string"==typeof e?l.timeout.replace(/\u65e5\u671f/g,e):l.timeout)},I.prototype.parse=function(e,t){var a=this,n=a.config,i=a.rangeLinked?a.startDate:n.dateTime,t=t||("end"==e?lay.extend({},a.endDate,a.endTime):n.range?lay.extend({},i||n.dateTime,a.startTime):n.dateTime),i=D.parse(t,a.format,1);return n.range&&e===undefined?i+" "+a.rangeStr+" "+a.parse("end"):i},I.prototype.newDate=function(e){return e=e||{},new Date(e.year||1,e.month||0,e.date||1,e.hours||0,e.minutes||0,e.seconds||0)},I.prototype.getDateTime=function(e){return this.newDate(e).getTime()},I.prototype.setValue=function(e){var t=this,a=t.config,n=a.elem[0];return"static"!==a.position&&(e=e||"",t.isInput(n)?lay(n).val(e):(a=t.rangeElem)?("array"!==layui.type(e)&&(e=e.split(" "+t.rangeStr+" ")),a[0].val(e[0]||""),a[1].val(e[1]||"")):(0===lay(n).find("*").length&&lay(n).html(e),lay(n).attr("lay-date",e))),t},I.prototype.preview=function(){var e,t=this,a=t.config;a.isPreview&&(e=lay(t.elem).find("."+E),a=!a.range||(t.rangeLinked?t.endState:t.endDate)?t.parse():"",e.html(a),e.html())&&(e.css({color:"#16b777"}),setTimeout(function(){e.css({color:"#777"})},300))},I.prototype.renderAdditional=function(){this.config.fullPanel&&this.list("time",0)},I.prototype.stampRange=function(){var n,i=this,l=i.config,r=i.rangeLinked?i.startDate:l.dateTime,e=lay(i.elem).find("td");l.range&&!i.endState&&lay(i.footer).find(C).addClass(k),r=r&&i.newDate({year:r.year,month:r.month,date:r.date}).getTime(),n=i.endState&&i.endDate&&i.newDate({year:i.endDate.year,month:i.endDate.month,date:i.endDate.date}).getTime(),lay.each(e,function(e,t){var a=lay(t).attr("lay-ymd").split("-"),a=i.newDate({year:a[0],month:a[1]-1,date:a[2]}).getTime();l.rangeLinked&&!i.startDate&&a===i.newDate(i.systemDate()).getTime()&&lay(t).addClass(lay(t).hasClass(y)||lay(t).hasClass(m)?"":"laydate-day-now"),lay(t).removeClass(o+" "+x),a!==r&&a!==n||(i.rangeLinked||!i.rangeLinked&&(e<42?a===r:a===n))&&lay(t).addClass(lay(t).hasClass(y)||lay(t).hasClass(m)?o:x),rn.getDateTime(i.max)&&(n[t]={hours:i.max.hours,minutes:i.max.minutes,seconds:i.max.seconds},lay.extend(l,n[t])))}),a||(n.startDate=lay.extend({},l)),n.endState&&!n.limit({date:n.thisDateTime(1-a)})&&(((r=n.endState&&n.autoCalendarModel.auto?n.autoCalendarModel():r)||n.rangeLinked&&n.endState)&&n.newDate(n.startDate)>n.newDate(n.endDate)&&(n.startDate.year===n.endDate.year&&n.startDate.month===n.endDate.month&&n.startDate.date===n.endDate.date&&(o=n.startTime,n.startTime=n.endTime,n.endTime=o),o=n.startDate,n.startDate=lay.extend({},n.endDate,n.startTime),i.dateTime=lay.extend({},n.startDate),n.endDate=lay.extend({},o,n.endTime)),r)&&(i.dateTime=lay.extend({},n.startDate)),n.rangeLinked?(e=lay.extend({},l),!t||a||r||(o=n.getAsYM(l.year,l.month,"sub"),lay.extend(i.dateTime,{year:o[0],month:o[1]})),n.calendar(e,t,r?"init":null)):n.calendar(null,a,r?"init":null),n.endState&&n.done(null,"change")):"static"===i.position?n.calendar().done().done(null,"change"):"date"===i.type?i.autoConfirm?n.setValue(n.parse()).done().remove():n.calendar().done(null,"change"):"datetime"===i.type&&n.calendar().done(null,"change"))},I.prototype.tool=function(t,e){var a=this,n=a.config,i=a.lang(),l=n.dateTime,r="static"===n.position,o={datetime:function(){lay(t).hasClass(k)||(a.list("time",0),n.range&&a.list("time",1),lay(t).attr("lay-type","date").html(a.lang().dateTips))},date:function(){a.closeList(),lay(t).attr("lay-type","datetime").html(a.lang().timeTips)},clear:function(){r&&(lay.extend(l,a.firstDate),a.calendar()),n.range&&(delete n.dateTime,delete a.endDate,delete a.startTime,delete a.endTime),a.setValue(""),a.done(null,"onClear").done(["",{},{}]).remove()},now:function(){var e=new Date;if(lay(t).hasClass(k))return a.hint(i.tools.now+", "+i.invalidDate);lay.extend(l,a.systemDate(),{hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}),a.setValue(a.parse()),r&&a.calendar(),a.done(null,"onNow").done().remove()},confirm:function(){if(n.range){if(lay(t).hasClass(k))return a.hint("time"===n.type?i.timeout.replace(/\u65e5\u671f/g,"\u65f6\u95f4"):i.timeout)}else if(lay(t).hasClass(k))return a.hint(i.invalidDate);a.setValue(a.parse()),a.done(null,"onConfirm").done().remove()}};o[e]&&o[e]()},I.prototype.change=function(n){var i=this,l=i.config,r=i.thisDateTime(n),o=l.range&&("year"===l.type||"month"===l.type),d=i.elemCont[n||0],s=i.listYM[n],e=function(e){var t=lay(d).find(".laydate-year-list")[0],a=lay(d).find(".laydate-month-list")[0];return t&&(s[0]=e?s[0]-15:s[0]+15,i.list("year",n)),a&&(e?s[0]--:s[0]++,i.list("month",n)),(t||a)&&(lay.extend(r,{year:s[0]}),o&&(r.year=s[0]),l.range||i.done(null,"change"),l.range||i.limit({elem:lay(i.footer).find(C),date:{year:s[0]}})),i.setBtnStatus(),t||a};return{prevYear:function(){e("sub")||(i.rangeLinked?(l.dateTime.year--,i.checkDate("limit").calendar(null,null,"init")):(r.year--,i.checkDate("limit").calendar(null,n),i.autoCalendarModel.auto?i.choose(lay(d).find("td.layui-this"),n):i.done(null,"change")))},prevMonth:function(){i.rangeLinked&&(r=l.dateTime);var e=i.getAsYM(r.year,r.month,"sub");lay.extend(r,{year:e[0],month:e[1]}),i.checkDate("limit").calendar(null,null,"init"),i.rangeLinked||(i.autoCalendarModel.auto?i.choose(lay(d).find("td.layui-this"),n):i.done(null,"change"))},nextMonth:function(){i.rangeLinked&&(r=l.dateTime);var e=i.getAsYM(r.year,r.month);lay.extend(r,{year:e[0],month:e[1]}),i.checkDate("limit").calendar(null,null,"init"),i.rangeLinked||(i.autoCalendarModel.auto?i.choose(lay(d).find("td.layui-this"),n):i.done(null,"change"))},nextYear:function(){e()||(i.rangeLinked?(l.dateTime.year++,i.checkDate("limit").calendar(null,0,"init")):(r.year++,i.checkDate("limit").calendar(null,n),i.autoCalendarModel.auto?i.choose(lay(d).find("td.layui-this"),n):i.done(null,"change")))}}},I.prototype.changeEvent=function(){var i=this;i.config;lay(i.elem).on("click",function(e){lay.stope(e)}).on("mousedown",function(e){lay.stope(e)}),lay.each(i.elemHeader,function(n,e){lay(e[0]).on("click",function(e){i.change(n).prevYear()}),lay(e[1]).on("click",function(e){i.change(n).prevMonth()}),lay(e[2]).find("span").on("click",function(e){var t=lay(this),a=t.attr("lay-ym"),t=t.attr("lay-type");a&&(a=a.split("-"),i.listYM[n]=[0|a[0],0|a[1]],i.list(t,n),lay(i.footer).find("."+L).addClass(k))}),lay(e[3]).on("click",function(e){i.change(n).nextMonth()}),lay(e[4]).on("click",function(e){i.change(n).nextYear()})}),lay.each(i.table,function(e,t){lay(t).find("td").on("click",function(){i.choose(lay(this),e)})}),lay(i.footer).find("span").on("click",function(){var e=lay(this).attr("lay-type");i.tool(this,e)})},I.prototype.isInput=function(e){return/input|textarea/.test(e.tagName.toLocaleLowerCase())||/INPUT|TEXTAREA/.test(e.tagName)},I.prototype.events=function(){var e,t=this,a=t.config;a.elem[0]&&!a.elem[0].eventHandler&&(a.elem.on(a.trigger,e=function(){D.thisId!==a.id&&t.render()}),a.elem[0].eventHandler=!0,a.eventElem.on(a.trigger,e),t.unbind=function(){t.remove(),a.elem.off(a.trigger,e),a.elem.removeAttr("lay-key"),a.elem.removeAttr(d),a.elem[0].eventHandler=!1,a.eventElem.off(a.trigger,e),a.eventElem.removeAttr("lay-key"),delete s.that[a.id]})},s.that={},s.getThis=function(e){var t=s.that[e];return!t&&n&&layui.hint().error(e?a+" instance with ID '"+e+"' not found":"ID argument required"),t},l.run=function(n){n(v).on("mousedown",function(e){var t,a;D.thisId&&(t=s.getThis(D.thisId))&&(a=t.config,e.target===a.elem[0]||e.target===a.eventElem[0]||e.target===n(a.closeStop)[0]||a.elem[0]&&a.elem[0].contains(e.target)||t.remove())}).on("keydown",function(e){var t;D.thisId&&(t=s.getThis(D.thisId))&&"static"!==t.config.position&&13===e.keyCode&&n("#"+t.elemID)[0]&&t.elemID===I.thisElemDate&&(e.preventDefault(),n(t.footer).find(C)[0].click())}),n(i).on("resize",function(){if(D.thisId){var e=s.getThis(D.thisId);if(e)return!(!e.elem||!n(".layui-laydate")[0])&&void e.position()}})},D.render=function(e){e=new I(e);return s.call(e)},D.reload=function(e,t){e=s.getThis(e);if(e)return e.reload(t)},D.getInst=function(e){e=s.getThis(e);if(e)return e.inst},D.hint=function(e,t){e=s.getThis(e);if(e)return e.hint(t)},D.unbind=function(e){e=s.getThis(e);if(e)return e.unbind()},D.close=function(e){e=s.getThis(e||D.thisId);if(e)return e.remove()},D.parse=function(a,n,i){return a=a||{},n=((n="string"==typeof n?s.formatArr(n):n)||[]).concat(),lay.each(n,function(e,t){/yyyy|y/.test(t)?n[e]=lay.digit(a.year,t.length):/MM|M/.test(t)?n[e]=lay.digit(a.month+(i||0),t.length):/dd|d/.test(t)?n[e]=lay.digit(a.date,t.length):/HH|H/.test(t)?n[e]=lay.digit(a.hours,t.length):/mm|m/.test(t)?n[e]=lay.digit(a.minutes,t.length):/ss|s/.test(t)&&(n[e]=lay.digit(a.seconds,t.length))}),n.join("")},D.getEndDate=function(e,t){var a=new Date;return a.setFullYear(t||a.getFullYear(),e||a.getMonth()+1,1),new Date(a.getTime()-864e5).getDate()},n?(D.ready(),layui.define("lay",function(e){D.path=layui.cache.dir,l.run(lay),e(a,D)})):"function"==typeof define&&define.amd?define(function(){return l.run(lay),D}):(D.ready(),l.run(i.lay),i.laydate=D)}(window,window.document);!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e):function(e){if(e.document)return t(e);throw new Error("jQuery requires a window with a document")}:t(e)}("undefined"!=typeof window?window:this,function(T,M){var f=[],g=T.document,c=f.slice,O=f.concat,R=f.push,P=f.indexOf,B={},W=B.toString,m=B.hasOwnProperty,y={},e="1.12.4",C=function(e,t){return new C.fn.init(e,t)},I=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,$=/^-ms-/,z=/-([\da-z])/gi,X=function(e,t){return t.toUpperCase()};function U(e){var t=!!e&&"length"in e&&e.length,n=C.type(e);return"function"!==n&&!C.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+a+")"+a+"*"),ee=new RegExp("="+a+"*([^\\]'\"]*?)"+a+"*\\]","g"),te=new RegExp(G),ne=new RegExp("^"+s+"$"),f={ID:new RegExp("^#("+s+")"),CLASS:new RegExp("^\\.("+s+")"),TAG:new RegExp("^("+s+"|[*])"),ATTR:new RegExp("^"+J),PSEUDO:new RegExp("^"+G),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+a+"*(even|odd|(([+-]|)(\\d*)n|)"+a+"*(?:([+-]|)"+a+"*(\\d+)|))"+a+"*\\)|)","i"),bool:new RegExp("^(?:"+Y+")$","i"),needsContext:new RegExp("^"+a+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+a+"*((?:-\\d)?\\d*)"+a+"*\\)|)(?=[^-]|$)","i")},re=/^(?:input|select|textarea|button)$/i,ie=/^h\d$/i,c=/^[^{]+\{\s*\[native \w/,oe=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ae=/[+~]/,se=/'|\\/g,d=new RegExp("\\\\([\\da-f]{1,6}"+a+"?|("+a+")|.)","ig"),p=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(65536+r):String.fromCharCode(r>>10|55296,1023&r|56320)},ue=function(){C()};try{D.apply(n=V.call(v.childNodes),v.childNodes),n[v.childNodes.length].nodeType}catch(F){D={apply:n.length?function(e,t){U.apply(e,V.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function H(e,t,n,r){var i,o,a,s,u,l,c,f,d=t&&t.ownerDocument,p=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==p&&9!==p&&11!==p)return n;if(!r&&((t?t.ownerDocument||t:v)!==E&&C(t),t=t||E,N)){if(11!==p&&(l=oe.exec(e)))if(i=l[1]){if(9===p){if(!(a=t.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(d&&(a=d.getElementById(i))&&y(t,a)&&a.id===i)return n.push(a),n}else{if(l[2])return D.apply(n,t.getElementsByTagName(e)),n;if((i=l[3])&&g.getElementsByClassName&&t.getElementsByClassName)return D.apply(n,t.getElementsByClassName(i)),n}if(g.qsa&&!A[e+" "]&&(!m||!m.test(e))){if(1!==p)d=t,f=e;else if("object"!==t.nodeName.toLowerCase()){for((s=t.getAttribute("id"))?s=s.replace(se,"\\$&"):t.setAttribute("id",s=k),o=(c=w(e)).length,u=ne.test(s)?"#"+s:"[id='"+s+"']";o--;)c[o]=u+" "+_(c[o]);f=c.join(","),d=ae.test(e)&&de(t.parentNode)||t}if(f)try{return D.apply(n,d.querySelectorAll(f)),n}catch(h){}finally{s===k&&t.removeAttribute("id")}}}return P(e.replace(L,"$1"),t,n,r)}function le(){var n=[];function r(e,t){return n.push(e+" ")>b.cacheLength&&delete r[n.shift()],r[e+" "]=t}return r}function q(e){return e[k]=!0,e}function h(e){var t=E.createElement("div");try{return!!e(t)}catch(F){return!1}finally{t.parentNode&&t.parentNode.removeChild(t)}}function ce(e,t){for(var n=e.split("|"),r=n.length;r--;)b.attrHandle[n[r]]=t}function fe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function x(a){return q(function(o){return o=+o,q(function(e,t){for(var n,r=a([],e.length,o),i=r.length;i--;)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function de(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in g=H.support={},O=H.isXML=function(e){e=e&&(e.ownerDocument||e).documentElement;return!!e&&"HTML"!==e.nodeName},C=H.setDocument=function(e){var e=e?e.ownerDocument||e:v;return e!==E&&9===e.nodeType&&e.documentElement&&(t=(E=e).documentElement,N=!O(E),(e=E.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",ue,!1):e.attachEvent&&e.attachEvent("onunload",ue)),g.attributes=h(function(e){return e.className="i",!e.getAttribute("className")}),g.getElementsByTagName=h(function(e){return e.appendChild(E.createComment("")),!e.getElementsByTagName("*").length}),g.getElementsByClassName=c.test(E.getElementsByClassName),g.getById=h(function(e){return t.appendChild(e).id=k,!E.getElementsByName||!E.getElementsByName(k).length}),g.getById?(b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&N)return(e=t.getElementById(e))?[e]:[]},b.filter.ID=function(e){var t=e.replace(d,p);return function(e){return e.getAttribute("id")===t}}):(delete b.find.ID,b.filter.ID=function(e){var t=e.replace(d,p);return function(e){e="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return e&&e.value===t}}),b.find.TAG=g.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):g.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"!==e)return o;for(;n=o[i++];)1===n.nodeType&&r.push(n);return r},b.find.CLASS=g.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&N)return t.getElementsByClassName(e)},r=[],m=[],(g.qsa=c.test(E.querySelectorAll))&&(h(function(e){t.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+a+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+a+"*(?:value|"+Y+")"),e.querySelectorAll("[id~="+k+"-]").length||m.push("~="),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||m.push(".#.+[+~]")}),h(function(e){var t=E.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+a+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")})),(g.matchesSelector=c.test(i=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.msMatchesSelector))&&h(function(e){g.disconnectedMatch=i.call(e,"div"),i.call(e,"[s!='']:x"),r.push("!=",G)}),m=m.length&&new RegExp(m.join("|")),r=r.length&&new RegExp(r.join("|")),e=c.test(t.compareDocumentPosition),y=e||c.test(t.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,t=t&&t.parentNode;return e===t||!(!t||1!==t.nodeType||!(n.contains?n.contains(t):e.compareDocumentPosition&&16&e.compareDocumentPosition(t)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},$=e?function(e,t){var n;return e===t?(l=!0,0):(n=!e.compareDocumentPosition-!t.compareDocumentPosition)||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!g.sortDetached&&t.compareDocumentPosition(e)===n?e===E||e.ownerDocument===v&&y(v,e)?-1:t===E||t.ownerDocument===v&&y(v,t)?1:u?j(u,e)-j(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===E?-1:t===E?1:i?-1:o?1:u?j(u,e)-j(u,t):0;if(i===o)return fe(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?fe(a[r],s[r]):a[r]===v?-1:s[r]===v?1:0}),E},H.matches=function(e,t){return H(e,null,null,t)},H.matchesSelector=function(e,t){if((e.ownerDocument||e)!==E&&C(e),t=t.replace(ee,"='$1']"),g.matchesSelector&&N&&!A[t+" "]&&(!r||!r.test(t))&&(!m||!m.test(t)))try{var n=i.call(e,t);if(n||g.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(F){}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(d,p),e[3]=(e[3]||e[4]||e[5]||"").replace(d,p),"~="===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]||H.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]&&H.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return f.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&te.test(n)&&(t=(t=w(n,!0))&&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(d,p).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=W[e+" "];return t||(t=new RegExp("(^|"+a+")"+e+"("+a+"|$)"))&&W(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(e){e=H.attr(e,t);return null==e?"!="===n:!n||(e+="","="===n?e===r:"!="===n?e!==r:"^="===n?r&&0===e.indexOf(r):"*="===n?r&&-1(?:<\/\1>|)$/,G=/^.[^:#\[\.,]*$/;function K(e,n,r){if(C.isFunction(n))return C.grep(e,function(e,t){return!!n.call(e,t,e)!==r});if(n.nodeType)return C.grep(e,function(e){return e===n!==r});if("string"==typeof n){if(G.test(n))return C.filter(n,e,r);n=C.filter(n,e)}return C.grep(e,function(e){return-1)[^>]*|#([\w-]*))$/,ee=((C.fn.init=function(e,t,n){if(e){if(n=n||Q,"string"!=typeof e)return e.nodeType?(this.context=this[0]=e,this.length=1,this):C.isFunction(e)?"undefined"!=typeof n.ready?n.ready(e):e(C):(e.selector!==undefined&&(this.selector=e.selector,this.context=e.context),C.makeArray(e,this));if(!(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:Z.exec(e))||!r[1]&&t)return(!t||t.jquery?t||n:this.constructor(t)).find(e);if(r[1]){if(t=t instanceof C?t[0]:t,C.merge(this,C.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:g,!0)),J.test(r[1])&&C.isPlainObject(t))for(var r in t)C.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r])}else{if((n=g.getElementById(r[2]))&&n.parentNode){if(n.id!==r[2])return Q.find(e);this.length=1,this[0]=n}this.context=g,this.selector=e}}return this}).prototype=C.fn,Q=C(g),/^(?:parents|prev(?:Until|All))/),te={children:!0,contents:!0,next:!0,prev:!0};function ne(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}C.fn.extend({has:function(e){var t,n=C(e,this),r=n.length;return this.filter(function(){for(t=0;t
          a",y.leadingWhitespace=3===S.firstChild.nodeType,y.tbody=!S.getElementsByTagName("tbody").length,y.htmlSerialize=!!S.getElementsByTagName("link").length,y.html5Clone="<:nav>"!==g.createElement("nav").cloneNode(!0).outerHTML,q.type="checkbox",q.checked=!0,k.appendChild(q),y.appendChecked=q.checked,S.innerHTML="",y.noCloneChecked=!!S.cloneNode(!0).lastChild.defaultValue,k.appendChild(S),(q=g.createElement("input")).setAttribute("type","radio"),q.setAttribute("checked","checked"),q.setAttribute("name","t"),S.appendChild(q),y.checkClone=S.cloneNode(!0).cloneNode(!0).lastChild.checked,y.noCloneEvent=!!S.addEventListener,S[C.expando]=1,y.attributes=!S.getAttribute(C.expando);var x={option:[1,""],legend:[1,"
          ","
          "],area:[1,"",""],param:[1,"",""],thead:[1,"","
          "],tr:[2,"","
          "],col:[2,"","
          "],td:[3,"","
          "],_default:y.htmlSerialize?[0,"",""]:[1,"X
          ","
          "]};function b(e,t){var n,r,i=0,o="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):undefined;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||C.nodeName(r,t)?o.push(r):C.merge(o,b(r,t));return t===undefined||t&&C.nodeName(e,t)?C.merge([e],o):o}function we(e,t){for(var n,r=0;null!=(n=e[r]);r++)C._data(n,"globalEval",!t||C._data(t[r],"globalEval"))}x.optgroup=x.option,x.tbody=x.tfoot=x.colgroup=x.caption=x.thead,x.th=x.td;var Te=/<|&#?\w+;/,Ce=/"!==f[1]||Ce.test(a)?0:u:u.firstChild)&&a.childNodes.length;o--;)C.nodeName(c=a.childNodes[o],"tbody")&&!c.childNodes.length&&a.removeChild(c);for(C.merge(h,u.childNodes),u.textContent="";u.firstChild;)u.removeChild(u.firstChild);u=p.lastChild}else h.push(t.createTextNode(a));for(u&&p.removeChild(u),y.appendChecked||C.grep(b(h,"input"),Ee),g=0;a=h[g++];)if(r&&-1]","i"),Pe=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,Be=/\s*$/g,ze=be(g).appendChild(g.createElement("div"));function Xe(e,t){return C.nodeName(e,"table")&&C.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ue(e){return e.type=(null!==C.find.attr(e,"type"))+"/"+e.type,e}function Ve(e){var t=Ie.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Ye(e,t){if(1===t.nodeType&&C.hasData(e)){var n,r,i,e=C._data(e),o=C._data(t,e),a=e.events;if(a)for(n in delete o.handle,o.events={},a)for(r=0,i=a[n].length;r")},clone:function(e,t,n){var r,i,o,a,s,u=C.contains(e.ownerDocument,e);if(y.html5Clone||C.isXMLDoc(e)||!Re.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(ze.innerHTML=e.outerHTML,ze.removeChild(o=ze.firstChild)),!(y.noCloneEvent&&y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||C.isXMLDoc(e)))for(r=b(o),s=b(e),a=0;null!=(i=s[a]);++a)if(r[a]){f=c=l=p=d=void 0;var l,c,f,d=i,p=r[a];if(1===p.nodeType){if(l=p.nodeName.toLowerCase(),!y.noCloneEvent&&p[C.expando]){for(c in(f=C._data(p)).events)C.removeEvent(p,c,f.handle);p.removeAttribute(C.expando)}"script"===l&&p.text!==d.text?(Ue(p).text=d.text,Ve(p)):"object"===l?(p.parentNode&&(p.outerHTML=d.outerHTML),y.html5Clone&&d.innerHTML&&!C.trim(p.innerHTML)&&(p.innerHTML=d.innerHTML)):"input"===l&&ge.test(d.type)?(p.defaultChecked=p.checked=d.checked,p.value!==d.value&&(p.value=d.value)):"option"===l?p.defaultSelected=p.selected=d.defaultSelected:"input"!==l&&"textarea"!==l||(p.defaultValue=d.defaultValue)}}if(t)if(n)for(s=s||b(e),r=r||b(o),a=0;null!=(i=s[a]);a++)Ye(i,r[a]);else Ye(e,o);return 0<(r=b(o,"script")).length&&we(r,!u&&b(e,"script")),r=s=i=null,o},cleanData:function(e,t){for(var n,r,i,o,a=0,s=C.expando,u=C.cache,l=y.attributes,c=C.event.special;null!=(n=e[a]);a++)if((t||v(n))&&(o=(i=n[s])&&u[i])){if(o.events)for(r in o.events)c[r]?C.event.remove(n,r):C.removeEvent(n,r,o.handle);u[i]&&(delete u[i],l||"undefined"==typeof n.removeAttribute?n[s]=undefined:n.removeAttribute(s),f.push(i))}}}),C.fn.extend({domManip:w,detach:function(e){return Je(this,e,!0)},remove:function(e){return Je(this,e)},text:function(e){return d(this,function(e){return e===undefined?C.text(this):this.empty().append((this[0]&&this[0].ownerDocument||g).createTextNode(e))},null,e,arguments.length)},append:function(){return w(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Xe(this,e).appendChild(e)})},prepend:function(){return w(this,arguments,function(e){var t;1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(t=Xe(this,e)).insertBefore(e,t.firstChild)})},before:function(){return w(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return w(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&C.cleanData(b(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&C.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return C.clone(this,e,t)})},html:function(e){return d(this,function(e){var t=this[0]||{},n=0,r=this.length;if(e===undefined)return 1===t.nodeType?t.innerHTML.replace(Oe,""):undefined;if("string"==typeof e&&!Be.test(e)&&(y.htmlSerialize||!Re.test(e))&&(y.leadingWhitespace||!ve.test(e))&&!x[(me.exec(e)||["",""])[1].toLowerCase()]){e=C.htmlPrefilter(e);try{for(;n")).appendTo(t.documentElement))[0].contentWindow||Ge[0].contentDocument).document).write(),t.close(),n=Qe(e,t),Ge.detach()),Ke[e]=n),n}var n,et,tt,nt,rt,it,ot,a,at=/^margin/,st=new RegExp("^("+e+")(?!px)[a-z%]+$","i"),ut=function(e,t,n,r){var i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.apply(e,r||[]),t)e.style[i]=o[i];return r},lt=g.documentElement;function t(){var e,t=g.documentElement;t.appendChild(ot),a.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",n=tt=it=!1,et=rt=!0,T.getComputedStyle&&(e=T.getComputedStyle(a),n="1%"!==(e||{}).top,it="2px"===(e||{}).marginLeft,tt="4px"===(e||{width:"4px"}).width,a.style.marginRight="50%",et="4px"===(e||{marginRight:"4px"}).marginRight,(e=a.appendChild(g.createElement("div"))).style.cssText=a.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",e.style.marginRight=e.style.width="0",a.style.width="1px",rt=!parseFloat((T.getComputedStyle(e)||{}).marginRight),a.removeChild(e)),a.style.display="none",(nt=0===a.getClientRects().length)&&(a.style.display="",a.innerHTML="
          t
          ",a.childNodes[0].style.borderCollapse="separate",(e=a.getElementsByTagName("td"))[0].style.cssText="margin:0;border:0;padding:0;display:none",nt=0===e[0].offsetHeight)&&(e[0].style.display="",e[1].style.display="none",nt=0===e[0].offsetHeight),t.removeChild(ot)}ot=g.createElement("div"),(a=g.createElement("div")).style&&(a.style.cssText="float:left;opacity:.5",y.opacity="0.5"===a.style.opacity,y.cssFloat=!!a.style.cssFloat,a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===a.style.backgroundClip,(ot=g.createElement("div")).style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",a.innerHTML="",ot.appendChild(a),y.boxSizing=""===a.style.boxSizing||""===a.style.MozBoxSizing||""===a.style.WebkitBoxSizing,C.extend(y,{reliableHiddenOffsets:function(){return null==n&&t(),nt},boxSizingReliable:function(){return null==n&&t(),tt},pixelMarginRight:function(){return null==n&&t(),et},pixelPosition:function(){return null==n&&t(),n},reliableMarginRight:function(){return null==n&&t(),rt},reliableMarginLeft:function(){return null==n&&t(),it}}));var l,p,ct=/^(top|right|bottom|left)$/;function ft(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}T.getComputedStyle?(l=function(e){var t=e.ownerDocument.defaultView;return(t=t&&t.opener?t:T).getComputedStyle(e)},p=function(e,t,n){var r,i,o=e.style;return""!==(i=(n=n||l(e))?n.getPropertyValue(t)||n[t]:undefined)&&i!==undefined||C.contains(e.ownerDocument,e)||(i=C.style(e,t)),n&&!y.pixelMarginRight()&&st.test(i)&&at.test(t)&&(e=o.width,t=o.minWidth,r=o.maxWidth,o.minWidth=o.maxWidth=o.width=i,i=n.width,o.width=e,o.minWidth=t,o.maxWidth=r),i===undefined?i:i+""}):lt.currentStyle&&(l=function(e){return e.currentStyle},p=function(e,t,n){var r,i,o,a=e.style;return null==(n=(n=n||l(e))?n[t]:undefined)&&a&&a[t]&&(n=a[t]),st.test(n)&&!ct.test(t)&&(r=a.left,(o=(i=e.runtimeStyle)&&i.left)&&(i.left=e.currentStyle.left),a.left="fontSize"===t?"1em":n,n=a.pixelLeft+"px",a.left=r,o)&&(i.left=o),n===undefined?n:n+""||"auto"});var dt=/alpha\([^)]*\)/i,pt=/opacity\s*=\s*([^)]*)/i,ht=/^(none|table(?!-c[ea]).+)/,gt=new RegExp("^("+e+")(.*)$","i"),mt={position:"absolute",visibility:"hidden",display:"block"},yt={letterSpacing:"0",fontWeight:"400"},vt=["Webkit","O","Moz","ms"],xt=g.createElement("div").style;function bt(e){if(e in xt)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=vt.length;n--;)if((e=vt[n]+t)in xt)return e}function wt(e,t){for(var n,r,i,o=[],a=0,s=e.length;a
          a",F=q.getElementsByTagName("a")[0],k.setAttribute("type","checkbox"),q.appendChild(k),(F=q.getElementsByTagName("a")[0]).style.cssText="top:1px",y.getSetAttribute="t"!==q.className,y.style=/top/.test(F.getAttribute("style")),y.hrefNormalized="/a"===F.getAttribute("href"),y.checkOn=!!k.value,y.optSelected=e.selected,y.enctype=!!g.createElement("form").enctype,S.disabled=!0,y.optDisabled=!e.disabled,(k=g.createElement("input")).setAttribute("value",""),y.input=""===k.getAttribute("value"),k.value="t",k.setAttribute("type","radio"),y.radioValue="t"===k.value;var Lt=/\r/g,Ht=/[\x20\t\r\n\f]+/g;C.fn.extend({val:function(t){var n,e,r,i=this[0];return arguments.length?(r=C.isFunction(t),this.each(function(e){1!==this.nodeType||(null==(e=r?t.call(this,e,C(this).val()):t)?e="":"number"==typeof e?e+="":C.isArray(e)&&(e=C.map(e,function(e){return null==e?"":e+""})),(n=C.valHooks[this.type]||C.valHooks[this.nodeName.toLowerCase()])&&"set"in n&&n.set(this,e,"value")!==undefined)||(this.value=e)})):i?(n=C.valHooks[i.type]||C.valHooks[i.nodeName.toLowerCase()])&&"get"in n&&(e=n.get(i,"value"))!==undefined?e:"string"==typeof(e=i.value)?e.replace(Lt,""):null==e?"":e:void 0}}),C.extend({valHooks:{option:{get:function(e){var t=C.find.attr(e,"value");return null!=t?t:C.trim(C.text(e)).replace(Ht," ")}},select:{get:function(e){for(var t,n=e.options,r=e.selectedIndex,i="select-one"===e.type||r<0,o=i?null:[],a=i?r+1:n.length,s=r<0?a:i?r:0;s").append(C.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this)},C.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){C.fn[t]=function(e){return this.on(t,e)}}),C.expr.filters.animated=function(t){return C.grep(C.timers,function(e){return t===e.elem}).length},C.offset={setOffset:function(e,t,n){var r,i,o,a,s=C.css(e,"position"),u=C(e),l={};"static"===s&&(e.style.position="relative"),o=u.offset(),r=C.css(e,"top"),a=C.css(e,"left"),s=("absolute"===s||"fixed"===s)&&-1'+(s?a.title[0]:a.title)+"":"";return a.zIndex=o,t([a.shade?'
          ':"",'
          '+(e&&2!=a.type?"":s)+"'+(n=["layui-icon-tips","layui-icon-success","layui-icon-error","layui-icon-question","layui-icon-lock","layui-icon-face-cry","layui-icon-face-smile"],o="layui-anim layui-anim-rotate layui-anim-loop",0==a.type&&-1!==a.icon?'':3==a.type?(i=["layui-icon-loading","layui-icon-loading-1"],2==a.icon?'
          ':''):"")+((1!=a.type||!e)&&a.content||"")+'
          '+(n=[],l&&(n.push(''),n.push('')),a.closeBtn&&n.push(''),n.join(""))+"
          "+(a.btn?function(){var e="";"string"==typeof a.btn&&(a.btn=[a.btn]);for(var t,i=0,n=a.btn.length;i'+a.btn[i]+"";return'
          '+e+"
          "}():"")+(a.resize?'':"")+""],s,m('
          ')),this},t.pt.creat=function(){var e,t,i,n,a,o=this,s=o.config,l=o.index,r="object"==typeof(f=s.content),c=m("body");if(s.id&&m("."+u[0]).find("#"+s.id)[0])e=m("#"+s.id).closest("."+u[0]),t=e.attr("times"),i=e.data("config"),n=m("#"+u.SHADE+t),"min"===(e.data("maxminStatus")||{})?g.restore(t):i.hideOnClose&&(n.show(),e.show());else{switch(s.removeFocus&&document.activeElement.blur(),"string"==typeof s.area&&(s.area="auto"===s.area?["",""]:[s.area,""]),s.shift&&(s.anim=s.shift),6==g.ie&&(s.fixed=!1),s.type){case 0:s.btn="btn"in s?s.btn:d.btn[0],g.closeAll("dialog");break;case 2:var f=s.content=r?s.content:[s.content||"","auto"];s.content='';break;case 3:delete s.title,delete s.closeBtn,-1===s.icon&&s.icon,g.closeAll("loading");break;case 4:r||(s.content=[s.content,"body"]),s.follow=s.content[1],s.content=s.content[0]+'',delete s.title,s.tips="object"==typeof s.tips?s.tips:[s.tips,!0],s.tipsMore||g.closeAll("tips")}o.vessel(r,function(e,t,i){c.append(e[0]),r?2==s.type||4==s.type?m("body").append(e[1]):f.parents("."+u[0])[0]||(f.data("display",f.css("display")).show().addClass("layui-layer-wrap").wrap(e[1]),m("#"+u[0]+l).find("."+u[5]).before(t)):c.append(e[1]),m("#"+u.MOVE)[0]||c.append(d.moveElem=i),o.layero=m("#"+u[0]+l),o.shadeo=m("#"+u.SHADE+l),s.scrollbar||d.setScrollbar(l)}).auto(l),o.shadeo.css({"background-color":s.shade[1]||"#000",opacity:s.shade[0]||s.shade}),2==s.type&&6==g.ie&&o.layero.find("iframe").attr("src",f[0]),4==s.type?o.tips():(o.offset(),parseInt(d.getStyle(document.getElementById(u.MOVE),"z-index"))||(o.layero.css("visibility","hidden"),g.ready(function(){o.offset(),o.layero.css("visibility","visible")}))),!s.fixed||d.events.resize[o.index]||(d.events.resize[o.index]=function(){o.resize()},h.on("resize",d.events.resize[o.index])),s.time<=0||setTimeout(function(){g.close(o.index)},s.time),o.move().callback(),u.anim[s.anim]&&(a="layer-anim "+u.anim[s.anim],o.layero.addClass(a).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){m(this).removeClass(a)})),o.layero.data("config",s)}},t.pt.resize=function(){var e=this,t=e.config;e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(e.index),4==t.type&&e.tips()},t.pt.auto=function(e){var t=this.config,i=m("#"+u[0]+e),n=(""===t.area[0]&&0t.maxWidth)&&i.width(t.maxWidth),[i.innerWidth(),i.innerHeight()]),a=i.find(u[1]).outerHeight()||0,o=i.find("."+u[6]).outerHeight()||0,e=function(e){(e=i.find(e)).height(n[1]-a-o-2*(0|parseFloat(e.css("padding-top"))))};return 2===t.type?e("iframe"):""===t.area[1]?0t.maxHeight?(n[1]=t.maxHeight,e("."+u[5])):t.fixed&&n[1]>=h.height()&&(n[1]=h.height(),e("."+u[5])):e("."+u[5]),this},t.pt.offset=function(){var e=this,t=e.config,i=e.layero,n=[i.outerWidth(),i.outerHeight()],a="object"==typeof t.offset;e.offsetTop=(h.height()-n[1])/2,e.offsetLeft=(h.width()-n[0])/2,a?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=h.width()-n[0]:"b"===t.offset?e.offsetTop=h.height()-n[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=h.height()-n[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=h.width()-n[0]):"rb"===t.offset?(e.offsetTop=h.height()-n[1],e.offsetLeft=h.width()-n[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?h.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?h.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=h.scrollTop(),e.offsetLeft+=h.scrollLeft()),"min"===i.data("maxminStatus")&&(e.offsetTop=h.height()-(i.find(u[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},t.pt.tips=function(){var e=this.config,t=this.layero,i=[t.outerWidth(),t.outerHeight()],n=m(e.follow),a={width:(n=n[0]?n:m("body")).outerWidth(),height:n.outerHeight(),top:n.offset().top,left:n.offset().left},o=t.find(".layui-layer-TipsG"),n=e.tips[0];e.tips[1]||o.remove(),a.autoLeft=function(){0h.width()&&(o=h.width()-180-(d.minStackArr.edgeIndex=d.minStackArr.edgeIndex||0,d.minStackArr.edgeIndex+=3))<0&&(o=0),t.minStack&&(l.left=o,l.top=h.height()-n,a||d.minStackIndex++,r.attr("minLeft",o)),r.attr("position",s),g.style(e,l,!0),i.hide(),"page"===r.attr("type")&&r.find(u[4]).hide(),d.restScrollbar(e),c.hide())},g.restore=function(e){var t=m("#"+u[0]+e),i=m("#"+u.SHADE+e),n=t.attr("area").split(","),a=t.attr("type"),o=t.data("config")||{};t.removeData("maxminStatus"),g.style(e,{width:n[0],height:n[1],top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===a&&t.find(u[4]).show(),o.scrollbar?d.restScrollbar(e):d.setScrollbar(e),i.show()},g.full=function(t){var i=m("#"+u[0]+t),e=i.data("maxminStatus");"max"!==e&&("min"===e&&g.restore(t),i.data("maxminStatus","max"),d.record(i),u.html.attr("layer-full")||d.setScrollbar(t),setTimeout(function(){var e="fixed"===i.css("position");g.style(t,{top:e?0:h.scrollTop(),left:e?0:h.scrollLeft(),width:"100%",height:"100%"},!0),i.find(".layui-layer-min").hide()},100))},g.title=function(e,t){m("#"+u[0]+(t||g.index)).find(u[1]).html(e)},g.close=function(o,s){var l,e,r=(t=m("."+u[0]).children("#"+o).closest("."+u[0]))[0]?(o=t.attr("times"),t):m("#"+u[0]+o),c=r.attr("type"),t=r.data("config")||{},f=t.id&&t.hideOnClose;r[0]&&(l={slideDown:"layer-anim-slide-down-out",slideLeft:"layer-anim-slide-left-out",slideUp:"layer-anim-slide-up-out",slideRight:"layer-anim-slide-right-out"}[t.anim]||"layer-anim-close",e=function(){var e="layui-layer-wrap";if(f)return r.removeClass("layer-anim "+l),r.hide();if(c===d.type[1]&&"object"===r.attr("conType")){r.children(":not(."+u[5]+")").remove();for(var t=r.find("."+e),i=0;i<2;i++)t.unwrap();t.css("display",t.data("display")).removeClass(e)}else{if(c===d.type[2])try{var n=m("#"+u[4]+o)[0];n.contentWindow.document.write(""),n.contentWindow.close(),r.find("."+u[5])[0].removeChild(n)}catch(a){}r[0].innerHTML="",r.remove()}"function"==typeof d.end[o]&&d.end[o](),delete d.end[o],"function"==typeof s&&s(),d.events.resize[o]&&(h.off("resize",d.events.resize[o]),delete d.events.resize[o])},m("#"+u.SHADE+o)[f?"hide":"remove"](),t.isOutAnim&&r.addClass("layer-anim "+l),6==g.ie&&d.reselect(),d.restScrollbar(o),"string"==typeof r.attr("minLeft")&&(d.minStackIndex--,d.minStackArr.push(r.attr("minLeft"))),g.ie&&g.ie<10||!t.isOutAnim?e():setTimeout(function(){e()},200))},g.closeAll=function(n,a){"function"==typeof n&&(a=n,n=null);var o=m("."+u[0]);m.each(o,function(e){var t=m(this),i=n?t.attr("type")===n:1;i&&g.close(t.attr("times"),e===o.length-1?a:null)}),0===o.length&&"function"==typeof a&&a()},g.closeLast=function(e,t){g.close(m(".layui-layer-"+(e=e||"page")+":last").attr("times"),t)},g.cache||{}),v=function(e){return i.skin?" "+i.skin+" "+i.skin+"-"+e:""};g.prompt=function(i,n){var e="",t="";"function"==typeof(i=i||{})&&(n=i),i.area&&(e='style="width: '+(o=i.area)[0]+"; height: "+o[1]+';"',delete i.area),i.placeholder&&(t=' placeholder="'+i.placeholder+'"');var a,o=2==i.formType?'":'",s=i.success;return delete i.success,g.open(m.extend({type:1,btn:["确定","取消"],content:o,skin:"layui-layer-prompt"+v("prompt"),maxWidth:h.width(),success:function(e){(a=e.find(".layui-layer-input")).val(i.value||"").focus(),"function"==typeof s&&s(e)},resize:!1,yes:function(e){var t=a.val();t.length>(i.maxlength||500)?g.tips("最多输入"+(i.maxlength||500)+"个字数",a,{tips:1}):n&&n(t,e,a)}},i))},g.tab=function(n){var a=(n=n||{}).tab||{},o="layui-this",s=n.success;return delete n.success,g.open(m.extend({type:1,skin:"layui-layer-tab"+v("tab"),resize:!1,title:function(){var e=a.length,t=1,i="";if(0'+a[0].title+"";t"+a[t].title+"";return i}(),content:'
            '+function(){var e=a.length,t=1,i="";if(0'+(a[0].content||"no content")+"";t'+(a[t].content||"no content")+"";return i}()+"
          ",success:function(e){var t=e.find(".layui-layer-title").children(),i=e.find(".layui-layer-tabmain").children();t.on("mousedown",function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0;var e=m(this),t=e.index();e.addClass(o).siblings().removeClass(o),i.eq(t).show().siblings().hide(),"function"==typeof n.change&&n.change(t)}),"function"==typeof s&&s(e)}},n))},g.photos=function(n,e,a){var s={};if((n=m.extend(!0,{toolbar:!0,footer:!0},n)).photos){var t=!("string"==typeof n.photos||n.photos instanceof m),i=t?n.photos:{},o=i.data||[],l=i.start||0,r=n.success;if(s.imgIndex=1+(0|l),n.img=n.img||"img",delete n.success,t){if(0===o.length)return g.msg("没有图片")}else{var c=m(n.photos),f=function(){o=[],c.find(n.img).each(function(e){var t=m(this);t.attr("layer-index",e),o.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("lay-src")||t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(f(),0===o.length)return;if(e||c.on("click",n.img,function(){f();var e=m(this).attr("layer-index");g.photos(m.extend(n,{photos:{start:e,data:o,tab:n.tab},full:n.full}),!0)}),!e)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=o.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>o.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){var t;s.end||(t=e.keyCode,e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&g.close(s.index))},s.tabimg=function(e){if(!(o.length<=1))return i.start=s.imgIndex-1,g.close(s.index),g.photos(n,!0,e)},s.isNumber=function(e){return"number"==typeof e&&!isNaN(e)},s.image={},s.getTransform=function(e){var t=[],i=e.rotate,n=e.scaleX,e=e.scale;return s.isNumber(i)&&0!==i&&t.push("rotate("+i+"deg)"),s.isNumber(n)&&1!==n&&t.push("scaleX("+n+")"),s.isNumber(e)&&t.push("scale("+e+")"),t.length?t.join(" "):"none"},s.event=function(e,i,n){var a,o;s.main.find(".layui-layer-photos-prev").on("click",function(e){e.preventDefault(),s.imgprev(!0)}),s.main.find(".layui-layer-photos-next").on("click",function(e){e.preventDefault(),s.imgnext(!0)}),m(document).on("keyup",s.keyup),e.off("click").on("click","*[toolbar-event]",function(){var e=m(this);switch(e.attr("toolbar-event")){case"rotate":s.image.rotate=((s.image.rotate||0)+Number(e.attr("data-option")))%360,s.imgElem.css({transform:s.getTransform(s.image)});break;case"scalex":s.image.scaleX=-1===s.image.scaleX?1:-1,s.imgElem.css({transform:s.getTransform(s.image)});break;case"zoom":var t=Number(e.attr("data-option"));s.image.scale=(s.image.scale||1)+t,t<0&&s.image.scale<0-t&&(s.image.scale=0-t),s.imgElem.css({transform:s.getTransform(s.image)});break;case"reset":s.image.scaleX=1,s.image.scale=1,s.image.rotate=0,s.imgElem.css({transform:"none"});break;case"close":g.close(i)}n.offset(),n.auto(i)}),s.main.on("mousewheel DOMMouseScroll",function(e){var t=e.originalEvent.wheelDelta||-e.originalEvent.detail,i=s.main.find('[toolbar-event="zoom"]');(0n)&&("left"===t.direction?s.imgnext(!0):"right"===t.direction&&s.imgprev(!0))},m.each([n.shadeo,s.main],function(e,t){a.touchSwipe(t,{onTouchEnd:o})}))},s.loadi=g.load(1,{shade:!("shade"in n)&&.9,scrollbar:!1});var t=o[l].src,d=function(e){g.close(s.loadi);var t,i=o[l].alt||"";a&&(n.anim=-1),s.index=g.open(m.extend({type:1,id:"layui-layer-photos",area:(e=[e.width,e.height],t=[m(p).width()-100,m(p).height()-100],!n.full&&(t[0]'+i+''+(t=['
          '],1','','',"
          "].join("")),n.toolbar&&t.push(['
          ','','','','','','',"
          "].join("")),n.footer&&t.push(['"].join("")),t.push(""),t.join(""))+"",success:function(e,t,i){s.main=e.find(".layer-layer-photos-main"),s.footer=e.find(".layui-layer-photos-footer"),s.imgElem=s.main.children("img"),s.event(e,t,i),n.tab&&n.tab(o[l],e),"function"==typeof r&&r(e)},end:function(){s.end=!0,m(document).off("keyup",s.keyup)}},n))},u=function(){g.close(s.loadi),g.msg("当前图片地址异常
          是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){1").addClass(r));layui.each(i.bars,function(t,e){var n=s('
        • ');n.addClass(e.icon).attr({"lay-type":e.type,style:e.style||(i.bgcolor?"background-color: "+i.bgcolor:"")}).html(e.content),n.on("click",function(){var t=s(this).attr("lay-type");"top"===t&&("body"===i.target?s("html,body"):u).animate({scrollTop:0},i.duration),"function"==typeof i.click&&i.click.call(this,t)}),"object"===layui.type(i.on)&&layui.each(i.on,function(t,e){n.on(t,function(){var t=s(this).attr("lay-type");"function"==typeof e&&e.call(this,t)})}),"top"===e.type&&(n.addClass("layui-fixbar-top"),o=n),l.append(n)}),c.find("."+r).remove(),"object"==typeof i.css&&l.css(i.css),c.append(l),o&&(e=function e(){return u.scrollTop()>=i.margin?t||(o.show(),t=1):t&&(o.hide(),t=0),e}()),u.on("scroll",function(){e&&(clearTimeout(n),n=setTimeout(function(){e()},100))})},countdown:function(i){i=s.extend(!0,{date:new Date,now:new Date},i);var o=arguments,r=(1]|&(?=#[a-zA-Z0-9]+)/g.test(t+="")?t.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,"""):t},unescape:function(t){return t!==undefined&&null!==t||(t=""),(t+="").replace(/\&/g,"&").replace(/\</g,"<").replace(/\>/g,">").replace(/\'/g,"'").replace(/\"/g,'"')},openWin:function(t){var e=(t=t||{}).window||window.open(t.url||"",t.target,t.specs);t.url||(e.document.open("text/html","replace"),e.document.write(t.content||""),e.document.close())},toVisibleArea:function(t){var e,n,i,o,r,a,c,u;(t=s.extend({margin:160,duration:200,type:"y"},t)).scrollElem[0]&&t.thisElem[0]&&(e=t.scrollElem,c=t.thisElem,i=(r="y"===t.type)?"top":"left",o=e[n=r?"scrollTop":"scrollLeft"](),r=e[r?"height":"width"](),a=e.offset()[i],u={},(c=c.offset()[i]-a)>r-t.margin||c."+v,E=function(e){var i=this;i.index=++h.index,i.config=c.extend({},i.config,h.config,e),i.init()};E.prototype.config={trigger:"click",content:"",className:"",style:"",show:!1,isAllowSpread:!0,isSpreadItem:!0,data:[],delay:[200,300],shade:0,accordion:!1},E.prototype.reload=function(e,i){var t=this;t.config=c.extend({},t.config,e),t.init(!0,i)},E.prototype.init=function(e,i){var t,n=this,a=n.config,l=c(a.elem);return 1');return 0No data
        • '),e},u=function(r,e){return layui.each(e,function(e,i){var t,n=i[s.children]&&0",(t="href"in i?''+l+"":l,n?'
          '+t+("parent"===o?'':"group"===o&&d.isAllowSpread?'':"")+"
          ":'
          '+t+"
          "),""].join(""))).data("item",i),n&&(a=c('
          '),t=c("
            "),"parent"===o?(a.append(u(t,i[s.children])),l.append(a)):l.append(u(t,i[s.children]))),r.append(l))}),r},a=['
            ',"
            "].join("");!(e="contextmenu"!==d.trigger&&!lay.isTopElem(d.elem[0])?e:!0)&&d.elem.data(y+"_opened")||(l.elemView=c("."+g+'[lay-id="'+d.id+'"]'),"reloadData"===i&&l.elemView.length?l.elemView.html(d.content||n()):(l.elemView=c(a),l.elemView.append(d.content||n()),d.className&&l.elemView.addClass(d.className),d.style&&l.elemView.attr("style",d.style),h.thisId=d.id,l.remove(),t.append(l.elemView),d.elem.data(y+"_opened",!0),e=d.shade?'
            ':"",l.elemView.before(e),"mouseenter"===d.trigger&&l.elemView.on("mouseenter",function(){clearTimeout(f.timer)}).on("mouseleave",function(){l.delayRemove()})),l.position(),(f.prevElem=l.elemView).data("prevElem",d.elem),l.elemView.find(".layui-menu").on(o,function(e){layui.stope(e)}),l.elemView.find(".layui-menu li").on("click",function(e){var i=c(this),t=i.data("item")||{},n=t[s.children]&&0n.width()&&(t.addClass(x),(i=t[0].getBoundingClientRect()).left<0)&&t.removeClass(x),i.bottom>n.height())&&t.eq(0).css("margin-top",-(i.bottom-n.height()+5))}).on("mouseleave",t,function(e){var i=c(this).children("."+C);i.removeClass(x),i.css("margin-top",0)}),h.close=function(e){e=f.getThis(e);return e?(e.remove(),f.call(e)):this},h.reload=function(e,i,t){e=f.getThis(e);return e?(e.reload(i,t),f.call(e)):this},h.reloadData=function(){var t=c.extend([],arguments),n=(t[2]="reloadData",new RegExp("^("+["data","templet","content"].join("|")+")$"));return layui.each(t[1],function(e,i){n.test(e)||delete t[1][e]}),h.reload.apply(null,t)},h.render=function(e){e=new E(e);return f.call(e)},e(r,h)});layui.define(["jquery","lay"],function(e){"use strict";var g=layui.$,x=layui.lay,m={config:{},index:layui.slider?layui.slider.index+1e4:0,set:function(e){var t=this;return t.config=g.extend({},t.config,e),t},on:function(e,t){return layui.onevent.call(this,i,e,t)}},i="slider",f="layui-disabled",b="layui-slider-bar",T="layui-slider-wrap",w="layui-slider-wrap-btn",M="layui-slider-tips",L="layui-slider-input-txt",E="layui-slider-hover",t=function(e){var t=this;t.index=++m.index,t.config=g.extend({},t.config,m.config,e),t.render()};t.prototype.config={type:"default",min:0,max:100,value:0,step:1,showstep:!1,tips:!0,tipsAlways:!1,input:!1,range:!1,height:200,disabled:!1,theme:"#16baaa"},t.prototype.render=function(){var n=this,a=n.config,e=g(a.elem);if(1a.max&&(a.value=a.max),l=Math.floor((a.value-a.min)/(a.max-a.min)*100)+"%");var t,e=a.disabled?"#c2c2c2":a.theme,i='
            '+(a.tips?'
            ":"")+'
            '+(a.range?'
            ':"")+"
            ",l=g(a.elem),s=l.next(".layui-slider");if(s[0]&&s.remove(),n.elemTemp=g(i),a.range?(n.elemTemp.find("."+T).eq(0).data("value",a.value[0]),n.elemTemp.find("."+T).eq(1).data("value",a.value[1])):n.elemTemp.find("."+T).data("value",a.value),l.html(n.elemTemp),"vertical"===a.type&&n.elemTemp.height(a.height+"px"),a.showstep){for(var o=(a.max-a.min)/a.step,r="",u=1;u<1+o;u++){var d=100*u/o;d<100&&(r+='
            ')}n.elemTemp.append(r)}function c(e){e=e.parent().data("value"),e=a.setTips?a.setTips(e):e;n.elemTemp.find("."+M).html(e)}function v(e){var t="vertical"===a.type?a.height:n.elemTemp[0].offsetWidth,i=n.elemTemp.find("."+T);return("vertical"===a.type?t-e.parent()[0].offsetTop-i.height():e.parent()[0].offsetLeft)/t*100}function p(e){"vertical"===a.type?n.elemTemp.find("."+M).css({bottom:e+"%","margin-bottom":"20px",display:"inline-block"}):n.elemTemp.find("."+M).css({left:e+"%",display:"inline-block"})}a.input&&!a.range&&(e=g('
            '),l.css("position","relative"),l.append(e),l.find("."+L).children("input").val(a.value),"vertical"===a.type?e.css({left:0,top:-48}):n.elemTemp.css("margin-right",e.outerWidth()+15)),a.disabled?(n.elemTemp.addClass(f),n.elemTemp.find("."+w).addClass(f)):n.slide(),a.tips&&(a.tipsAlways?(c(s=n.elemTemp.find("."+w)),p(v(s))):n.elemTemp.find("."+w).on("mouseover",function(){c(g(this));var e=v(g(this));clearTimeout(t),t=setTimeout(function(){p(e)},300)}).on("mouseout",function(){clearTimeout(t),a.tipsAlways||n.elemTemp.find("."+M).css("display","none")}))},t.prototype.slide=function(e,t,i){var u=this,d=u.config,c=u.elemTemp,v=function(){return"vertical"===d.type?d.height:c[0].offsetWidth},p=c.find("."+T),o=c.next(".layui-slider-input"),r=o.children("."+L).children("input").val(),m=100/((d.max-d.min)/Math.ceil(d.step)),f=function(e,t,i){e=(e=100<(e=100n[1]&&n.reverse(),u.value=d.range?n:l,d.change&&d.change(u.value),"done"===i&&d.done&&d.done(u.value)},h=function(e){var t=e/v()*100/m,i=Math.round(t)*m;return i=e==v()?Math.ceil(t)*m:i},y=g(['
            v()?v():t)/v()*100/m;f(t,o),r.addClass(E),c.find("."+M).show(),e.preventDefault()},n=function(e){r.removeClass(E),d.tipsAlways||setTimeout(function(){c.find("."+M).hide()},e)},a=function(){n&&n(x.touchEventsSupported()?1e3:0),y.remove(),d.done&&d.done(u.value),x.touchEventsSupported()&&(t[0].removeEventListener("touchmove",i,!!x.passiveSupported&&{passive:!1}),t[0].removeEventListener("touchend",a),t[0].removeEventListener("touchcancel",a))},g("#LAY-slider-moving")[0]||g("body").append(y),y.on("mousemove",i),y.on("mouseup",a).on("mouseleave",a),x.touchEventsSupported()&&(t[0].addEventListener("touchmove",i,!!x.passiveSupported&&{passive:!1}),t[0].addEventListener("touchend",a),t[0].addEventListener("touchcancel",a))})}),c.on("click",function(e){var t=g("."+w),i=g(this);!t.is(event.target)&&0===t.has(event.target).length&&t.length&&(i=(t=(t=(t="vertical"===d.type?v()-e.clientY+i.offset().top-g(window).scrollTop():e.clientX-i.offset().left-g(window).scrollLeft())<0?0:t)>v()?v():t)/v()*100/m,t=d.range?"vertical"===d.type?Math.abs(t-parseInt(g(p[0]).css("bottom")))>Math.abs(t-parseInt(g(p[1]).css("bottom")))?1:0:Math.abs(t-p[0].offsetLeft)>Math.abs(t-p[1].offsetLeft)?1:0:0,f(i,t,"done"),e.preventDefault())}),o.children(".layui-slider-input-btn").children("i").each(function(t){g(this).on("click",function(){r=o.children("."+L).children("input").val();var e=((r=1==t?r-d.stepd.max?d.max:Number(r)+d.step)-d.min)/(d.max-d.min)*100/m;f(e,0,"done")})});var n=function(){var e=this.value,e=(e=(e=(e=isNaN(e)?0:e)d.max?d.max:e,((this.value=e)-d.min)/(d.max-d.min)*100/m);f(e,0,"done")};o.children("."+L).children("input").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),n.call(this))}).on("change",n)},t.prototype.events=function(){this.config},m.render=function(e){e=new t(e);return function(){var i=this,n=i.config;return{setValue:function(e,t){return e=(e=e>n.max?n.max:e)',"",'','',"","","
            "].join("")),t=i.elem=k(i.elem);i.size&&o.addClass("layui-colorpicker-"+i.size),t.addClass("layui-inline").html(e.elemColorBox=o),i.id="id"in i?i.id:t.attr("id")||e.index,e.color=e.elemColorBox.find("."+C)[0].style.background,e.events()},d.prototype.renderPicker=function(){var o,e=this,i=e.config,t=e.elemColorBox[0],r=e.elemPicker=k(['
            ','
            ','
            ','
            ','
            ','
            ',"
            ",'
            ','
            ',"
            ","
            ",'
            ','
            ','
            ',"
            ","
            ",i.predefine?(o=['
            '],layui.each(i.colors,function(e,i){o.push(['
            ','
            ',"
            "].join(""))}),o.push("
            "),o.join("")):"",'
            ','
            ','',"
            ",'
            ','','',"","
            "].join(""));e.elemColorBox.find("."+C)[0];k(a)[0]&&k(a).data("index")==e.index?e.removePicker(d.thisElemInd):(e.removePicker(d.thisElemInd),k("body").append(r)),n.thisId=i.id,d.thisElemInd=e.index,d.thisColor=t.style.background,e.position(),e.pickerEvents()},d.prototype.removePicker=function(e){var i=this.config,e=k("#layui-colorpicker"+(e||this.index));return e[0]&&(e.remove(),delete n.thisId,"function"==typeof i.close)&&i.close(this.color),this},d.prototype.position=function(){var e=this,i=e.config;return r.position(e.bindElem||e.elemColorBox[0],e.elemPicker[0],{position:i.position,align:"center"}),e},d.prototype.val=function(){var e,i=this,o=(i.config,i.elemColorBox.find("."+C)),t=i.elemPicker.find("."+M),r=o[0].style.backgroundColor;r?(e=Y(F(r)),o=o.attr("lay-type"),i.select(e.h,e.s,e.b),"torgb"===o?t.find("input").val(r):"rgba"===o?(o=F(r),3===(r.match(/[0-9]{1,3}/g)||[]).length?(t.find("input").val("rgba("+o.r+", "+o.g+", "+o.b+", 1)"),i.elemPicker.find("."+D).css("left",280)):(t.find("input").val(r),r=280*r.slice(r.lastIndexOf(",")+1,r.length-1),i.elemPicker.find("."+D).css("left",r)),i.elemPicker.find("."+T)[0].style.background="linear-gradient(to right, rgba("+o.r+", "+o.g+", "+o.b+", 0), rgb("+o.r+", "+o.g+", "+o.b+"))"):t.find("input").val("#"+j(e))):(i.select(0,100,100),t.find("input").val(""),i.elemPicker.find("."+T)[0].style.background="",i.elemPicker.find("."+D).css("left",280))},d.prototype.side=function(){var n=this,l=n.config,c=n.elemColorBox.find("."+C),a=c.attr("lay-type"),s=n.elemPicker.find(".layui-colorpicker-side"),e=n.elemPicker.find("."+B),d=n.elemPicker.find("."+I),t=n.elemPicker.find("."+E),u=n.elemPicker.find("."+T),f=n.elemPicker.find("."+D),p=e[0].offsetTop/180*360,h=100-(t[0].offsetTop+3)/180*100,g=(t[0].offsetLeft+3)/260*100,v=Math.round(f[0].offsetLeft/280*100)/100,y=n.elemColorBox.find("."+w),i=n.elemPicker.find(".layui-colorpicker-pre").children("div"),m=function(e,i,o,t){n.select(e,i,o);var r=X({h:e,s:i,b:o}),e=j({h:e,s:i,b:o}),i=n.elemPicker.find("."+M).find("input");y.addClass(x).removeClass(P),c[0].style.background="rgb("+r.r+", "+r.g+", "+r.b+")","torgb"===a?i.val("rgb("+r.r+", "+r.g+", "+r.b+")"):"rgba"===a?(f.css("left",280*t),i.val("rgba("+r.r+", "+r.g+", "+r.b+", "+t+")"),c[0].style.background="rgba("+r.r+", "+r.g+", "+r.b+", "+t+")",u[0].style.background="linear-gradient(to right, rgba("+r.r+", "+r.g+", "+r.b+", 0), rgb("+r.r+", "+r.g+", "+r.b+"))"):i.val("#"+e),l.change&&l.change(k.trim(n.elemPicker.find("."+M).find("input").val()))},o=k(['
            '].join("")),b=function(e){k("#LAY-colorpicker-moving")[0]||k("body").append(o),o.on("mousemove",e),o.on("mouseup",function(){o.remove()}).on("mouseleave",function(){o.remove()})};e.on("mousedown",function(e){var t=this.offsetTop,r=e.clientY;b(function(e){var i=t+(e.clientY-r),o=s[0].offsetHeight,o=(i=o<(i=i<0?0:i)?o:i)/180*360;m(p=o,g,h,v),e.preventDefault()}),e.preventDefault()}),s.on("click",function(e){var i=e.clientY-k(this).offset().top+L.scrollTop(),i=(i=(i=i<0?0:i)>this.offsetHeight?this.offsetHeight:i)/180*360;m(p=i,g,h,v),e.preventDefault()}),t.on("mousedown",function(e){var n=this.offsetTop,l=this.offsetLeft,c=e.clientY,a=e.clientX;layui.stope(e),b(function(e){var i=n+(e.clientY-c),o=l+(e.clientX-a),t=d[0].offsetHeight-3,r=d[0].offsetWidth-3,r=((o=r<(o=o<-3?-3:o)?r:o)+3)/260*100,o=100-((i=t<(i=i<-3?-3:i)?t:i)+3)/180*100;m(p,g=r,h=o,v),e.preventDefault()}),e.preventDefault()}),d.on("mousedown",function(e){var i=e.clientY-k(this).offset().top-3+L.scrollTop(),o=e.clientX-k(this).offset().left-3+L.scrollLeft(),o=((i=i<-3?-3:i)>this.offsetHeight-3&&(i=this.offsetHeight-3),((o=(o=o<-3?-3:o)>this.offsetWidth-3?this.offsetWidth-3:o)+3)/260*100),i=100-(i+3)/180*100;m(p,g=o,h=i,v),layui.stope(e),e.preventDefault(),t.trigger(e,"mousedown")}),f.on("mousedown",function(e){var t=this.offsetLeft,r=e.clientX;b(function(e){var i=t+(e.clientX-r),o=u[0].offsetWidth,o=(o<(i=i<0?0:i)&&(i=o),Math.round(i/280*100)/100);m(p,g,h,v=o),e.preventDefault()}),e.preventDefault()}),u.on("click",function(e){var i=e.clientX-k(this).offset().left,i=((i=i<0?0:i)>this.offsetWidth&&(i=this.offsetWidth),Math.round(i/280*100)/100);m(p,g,h,v=i),e.preventDefault()}),i.each(function(){k(this).on("click",function(){k(this).parent(".layui-colorpicker-pre").addClass("selected").siblings().removeClass("selected");var e=this.style.backgroundColor,i=Y(F(e)),o=e.slice(e.lastIndexOf(",")+1,e.length-1);p=i.h,g=i.s,h=i.b,3===(e.match(/[0-9]{1,3}/g)||[]).length&&(o=1),v=o,m(i.h,i.s,i.b,o)})}),r.touchEventsSupported()&&layui.each([{elem:s,eventType:"click"},{elem:u,eventType:"click"},{elem:d,eventType:"mousedown"}],function(e,t){r.touchSwipe(t.elem,{onTouchMove:function(e){var i,o;e=e,i=t.eventType,e=e.touches[0],(o=document.createEvent("MouseEvent")).initMouseEvent(i,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(o)}})})},d.prototype.select=function(e,i,o,t){this.config;var r=j({h:e,s:100,b:100}),e=(j({h:e,s:i,b:o}),e/360*180),o=180-o/100*180-3,i=i/100*260-3;this.elemPicker.find("."+B).css("top",e),this.elemPicker.find("."+I)[0].style.background="#"+r,this.elemPicker.find("."+E).css({top:o,left:i})},d.prototype.pickerEvents=function(){var c=this,a=c.config,s=c.elemColorBox.find("."+C),d=c.elemPicker.find("."+M+" input"),o={clear:function(e){s[0].style.background="",c.elemColorBox.find("."+w).removeClass(x).addClass(P),c.color="",a.done&&a.done(""),c.removePicker()},confirm:function(e,i){var o,t,r,n,l=k.trim(d.val());-1>16,g:(65280&r)>>8,b:255&r},t=Y(n),s[0].style.background=o="#"+j(t),c.elemColorBox.find("."+w).removeClass(P).addClass(x)),"change"===i?(c.select(t.h,t.s,t.b,i),a.change&&a.change(o)):(c.color=l,a.done&&a.done(l),c.removePicker())}};c.elemPicker.on("click","*[colorpicker-events]",function(){var e=k(this),i=e.attr("colorpicker-events");o[i]&&o[i].call(this,e)}),d.on("keyup",function(e){var i=k(this);o.confirm.call(this,i,13===e.keyCode?null:"change")})},d.prototype.events=function(){var e=this;e.config;e.elemColorBox.on("click",function(){e.renderPicker(),k(a)[0]&&(e.val(),e.side())})},s.on(i,function(e){var i,o,t;n.thisId&&(i=l.getThis(n.thisId))&&(o=i.config,t=i.elemColorBox.find("."+C),k(e.target).hasClass(c)||k(e.target).parents("."+c)[0]||k(e.target).hasClass(a.replace(/\./g,""))||k(e.target).parents(a)[0]||i.elemPicker&&(i.color?(e=Y(F(i.color)),i.select(e.h,e.s,e.b)):i.elemColorBox.find("."+w).removeClass(x).addClass(P),t[0].style.background=i.color||"","function"==typeof o.cancel&&o.cancel(i.color),i.removePicker()))}),L.on("resize",function(){if(n.thisId){var e=l.getThis(n.thisId);if(e)return!(!e.elemPicker||!k(a)[0])&&void e.position()}}),l.that={},l.getThis=function(e){var i=l.that[e];return i||o.error(e?t+" instance with ID '"+e+"' not found":"ID argument required"),i},n.render=function(e){e=new d(e);return l.call(e)},e(t,n)});layui.define("jquery",function(t){"use strict";var u=layui.$,d=(layui.hint(),layui.device()),c="element",r="layui-this",h="layui-show",o=".layui-tab-title",i=function(){this.config={}},y=(i.prototype.set=function(t){return u.extend(!0,this.config,t),this},i.prototype.on=function(t,i){return layui.onevent.call(this,c,t,i)},i.prototype.tabAdd=function(t,i){var a,e=u(".layui-tab[lay-filter="+t+"]"),l=e.children(o),n=l.children(".layui-tab-bar"),e=e.children(".layui-tab-content"),s=""+(i.title||"unnaming")+"";return n[0]?n.before(s):l.append(s),e.append('
            '+(i.content||"")+"
            "),i.change&&this.tabChange(t,i.id),l.data("LAY_TAB_CHANGE",i.change),C.tabAuto(i.change?"change":null),this},i.prototype.tabDelete=function(t,i){t=u(".layui-tab[lay-filter="+t+"]").children(o).find('>li[lay-id="'+i+'"]');return C.tabDelete(null,t),this},i.prototype.tabChange=function(t,i){t=u(".layui-tab[lay-filter="+t+"]").children(o).find('>li[lay-id="'+i+'"]');return C.tabClick.call(t[0],{liElem:t}),this},i.prototype.tab=function(a){a=a||{},e.on("click",a.headerElem,function(t){var i=u(this).index();C.tabClick.call(this,{index:i,options:a})})},i.prototype.progress=function(t,i){var a="layui-progress",t=u("."+a+"[lay-filter="+t+"]").find("."+a+"-bar"),a=t.find("."+a+"-text");return t.css("width",function(){return/^.+\/.+$/.test(i)?100*new Function("return "+i)()+"%":i}).attr("lay-percent",i),a.text(i),this},".layui-nav"),f="layui-nav-item",p="layui-nav-bar",b="layui-nav-tree",v="layui-nav-child",m="layui-nav-more",g="layui-anim layui-anim-upbit",C={tabClick:function(t){var i=(t=t||{}).options||{},a=t.liElem||u(this),e=i.headerElem?a.parent():a.parents(".layui-tab").eq(0),i=i.bodyElem?u(i.bodyElem):e.children(".layui-tab-content").children(".layui-tab-item"),l=a.find("a"),l="javascript:;"!==l.attr("href")&&"_blank"===l.attr("target"),n="string"==typeof a.attr("lay-unselect"),s=e.attr("lay-filter"),t="index"in t?t.index:a.parent().children("li").index(a);l||n||(a.addClass(r).siblings().removeClass(r),i.eq(t).addClass(h).siblings().removeClass(h)),layui.event.call(this,c,"tab("+s+")",{elem:e,index:t})},tabDelete:function(t,i){var i=i||u(this).parent(),a=i.parent().children("li").index(i),e=i.closest(".layui-tab"),l=e.children(".layui-tab-content").children(".layui-tab-item"),n=e.attr("lay-filter");i.hasClass(r)&&(i.next()[0]&&i.next().is("li")?C.tabClick.call(i.next()[0],{index:a+1}):i.prev()[0]&&i.prev().is("li")&&C.tabClick.call(i.prev()[0],null,a-1)),i.remove(),l.eq(a).remove(),setTimeout(function(){C.tabAuto()},50),layui.event.call(this,c,"tabDelete("+n+")",{elem:e,index:a})},tabAuto:function(l){var n="layui-tab-more",s="layui-tab-bar",o="layui-tab-close",c=this;u(".layui-tab").each(function(){var t,i=u(this),a=i.children(".layui-tab-title"),e=(i.children(".layui-tab-content").children(".layui-tab-item"),'lay-stope="tabmore"'),e=u('');c===window&&d.ie,i.attr("lay-allowclose")&&a.find("li").each(function(){var t,i=u(this);i.find("."+o)[0]||((t=u('')).on("click",C.tabDelete),i.append(t))}),"string"!=typeof i.attr("lay-unauto")&&(a.prop("scrollWidth")>a.outerWidth()+1||a.find("li").length&&a.height()>(t=a.find("li").eq(0).height())+t/2?("change"===l&&a.data("LAY_TAB_CHANGE")&&a.addClass(n),a.find("."+s)[0]||(a.append(e),i.attr("overflow",""),e.on("click",function(t){var i=a.hasClass(n);a[i?"removeClass":"addClass"](n)}))):(a.find("."+s).remove(),i.removeAttr("overflow")))})},hideTabMore:function(t){var i=u(".layui-tab-title");!0!==t&&"tabmore"===u(t.target).attr("lay-stope")||(i.removeClass("layui-tab-more"),i.find(".layui-tab-bar").attr("title",""))},clickThis:function(){var t=u(this),i=t.closest(y),a=i.attr("lay-filter"),e=t.parent(),l=t.siblings("."+v),n="string"==typeof e.attr("lay-unselect");if("javascript:;"!==t.attr("href")&&"_blank"===t.attr("target")||n||l[0]||(i.find("."+r).removeClass(r),e.addClass(r)),i.hasClass(b)){var n=f+"ed",s=!e.hasClass(n),o=function(){u(this).css({display:""}),i.children("."+p).css({opacity:0})};if(l.is(":animated"))return;l.removeClass(g),l[0]&&(s?(l.slideDown(200,o),e.addClass(n)):(e.removeClass(n),l.show().slideUp(200,o)),"string"!=typeof i.attr("lay-accordion")&&"all"!==i.attr("lay-shrink")||((s=e.siblings("."+n)).removeClass(n),s.children("."+v).show().stop().slideUp(200,o)))}layui.event.call(this,c,"nav("+a+")",t)},collapse:function(){var t=u(this),i=t.find(".layui-colla-icon"),a=t.siblings(".layui-colla-content"),e=t.parents(".layui-collapse").eq(0),l=e.attr("lay-filter"),n="none"===a.css("display");"string"==typeof e.attr("lay-accordion")&&((e=e.children(".layui-colla-item").children("."+h)).siblings(".layui-colla-title").children(".layui-colla-icon").html(""),e.removeClass(h)),a[n?"addClass":"removeClass"](h),i.html(n?"":""),layui.event.call(this,c,"collapse("+l+")",{title:t,content:a,show:n})}},a=(i.prototype.render=i.prototype.init=function(t,i){var a=i?'[lay-filter="'+i+'"]':"",i={tab:function(){C.tabAuto.call({})},nav:function(){var s={},o={},c={},r="layui-nav-title";u(y+a).each(function(t){var i=u(this),a=u(''),e=i.find("."+f);i.find("."+p)[0]||(i.append(a),(i.hasClass(b)?e.find("dd,>."+r):e).on("mouseenter",function(){!function(t,i,a){var e,l=u(this),n=l.find("."+v);i.hasClass(b)?n[0]||(e=l.children("."+r),t.css({top:l.offset().top-i.offset().top,height:(e[0]?e:l).outerHeight(),opacity:1})):(n.addClass(g),n.hasClass("layui-nav-child-c")&&n.css({left:-(n.outerWidth()-l.width())/2}),n[0]?t.css({left:t.position().left+t.width()/2,width:0,opacity:0}):t.css({left:l.position().left+parseFloat(l.css("marginLeft")),top:l.position().top+l.height()-t.height()}),s[a]=setTimeout(function(){t.css({width:n[0]?0:l.width(),opacity:n[0]?0:1})},d.ie&&d.ie<10?0:200),clearTimeout(c[a]),"block"===n.css("display")&&clearTimeout(o[a]),o[a]=setTimeout(function(){n.addClass(h),l.find("."+m).addClass(m+"d")},300))}.call(this,a,i,t)}).on("mouseleave",function(){i.hasClass(b)?a.css({height:0,opacity:0}):(clearTimeout(o[t]),o[t]=setTimeout(function(){i.find("."+v).removeClass(h),i.find("."+m).removeClass(m+"d")},300))}),i.on("mouseleave",function(){clearTimeout(s[t]),c[t]=setTimeout(function(){i.hasClass(b)||a.css({width:0,left:a.position().left+a.width()/2,opacity:0})},200)})),e.find("a").each(function(){var t=u(this);t.parent();t.siblings("."+v)[0]&&!t.children("."+m)[0]&&t.append(''),t.off("click",C.clickThis).on("click",C.clickThis)})})},breadcrumb:function(){u(".layui-breadcrumb"+a).each(function(){var t=u(this),i="lay-separator",a=t.attr(i)||"/",e=t.find("a");e.next("span["+i+"]")[0]||(e.each(function(t){t!==e.length-1&&u(this).after(""+a+"")}),t.css("visibility","visible"))})},progress:function(){var e="layui-progress";u("."+e+a).each(function(){var t=u(this),i=t.find(".layui-progress-bar"),a=i.attr("lay-percent");i.css("width",function(){return/^.+\/.+$/.test(a)?100*new Function("return "+a)()+"%":a}),t.attr("lay-showpercent")&&setTimeout(function(){i.html(''+a+"")},350)})},collapse:function(){u(".layui-collapse"+a).each(function(){u(this).find(".layui-colla-item").each(function(){var t=u(this),i=t.find(".layui-colla-title"),t="none"===t.find(".layui-colla-content").css("display");i.find(".layui-colla-icon").remove(),i.append(''+(t?"":"")+""),i.off("click",C.collapse).on("click",C.collapse)})})}};return i[t]?i[t]():layui.each(i,function(t,i){i()})},new i),e=u(document);u(function(){a.render()}),e.on("click",".layui-tab-title li",C.tabClick),u(window).on("resize",C.tabAuto),t(c,a)});layui.define(["lay","layer"],function(e){"use strict";var x=layui.$,a=layui.lay,i=layui.layer,b=layui.device(),t="upload",r="layui_"+t+"_index",o={config:{},index:layui[t]?layui[t].index+1e4:0,set:function(e){var i=this;return i.config=x.extend({},i.config,e),i},on:function(e,i){return layui.onevent.call(this,t,e,i)}},l=function(){var i=this,e=i.config.id;return{upload:function(e){i.upload.call(i,e)},reload:function(e){i.reload.call(i,e)},config:(l.that[e]=i).config}},u="layui-upload-file",f="layui-upload-form",F="layui-upload-iframe",w="layui-upload-choose",L="UPLOADING",j=function(e){var i=this;i.index=++o.index,i.config=x.extend({},i.config,o.config,e),i.render()};j.prototype.config={accept:"images",exts:"",auto:!0,bindAction:"",url:"",force:"",field:"file",acceptMime:"",method:"post",data:{},drag:!0,size:0,number:0,multiple:!1,text:{"cross-domain":"Cross-domain requests are not supported","data-format-error":"Please return JSON data format","check-error":"",error:"","limit-number":null,"limit-size":null}},j.prototype.reload=function(e){var i=this;i.config=x.extend({},i.config,e),i.render(!0)},j.prototype.render=function(e){var i=this,t=i.config,n=x(t.elem);return 1"].join("")),n=i.elem.next();(n.hasClass(u)||n.hasClass(f))&&n.remove(),b.ie&&b.ie<10&&i.elem.wrap('
            '),e.isFile()?(e.elemFile=i.elem,i.field=i.elem[0].name):i.elem.after(t),b.ie&&b.ie<10&&e.initIE()},j.prototype.initIE=function(){var t,e=this.config,i=x(''),n=x(['
            ',"
            "].join(""));x("#"+F)[0]||x("body").append(i),e.elem.next().hasClass(f)||(this.elemFile.wrap(n),e.elem.next("."+f).append((t=[],layui.each(e.data,function(e,i){i="function"==typeof i?i():i,t.push('')}),t.join(""))))},j.prototype.msg=function(e){return i.msg(e,{icon:2,shift:6})},j.prototype.isFile=function(){var e=this.config.elem[0];if(e)return"input"===e.tagName.toLocaleLowerCase()&&"file"===e.type},j.prototype.preview=function(n){window.FileReader&&layui.each(this.chooseFiles,function(e,i){var t=new FileReader;t.readAsDataURL(i),t.onload=function(){n&&n(e,i,this.result)}})},j.prototype.upload=function(e,i){var t,n,a,o,u=this,f=u.config,c=f.text||{},l=u.elemFile[0],s=function(){return e||u.files||u.chooseFiles||l.files},r=function(){var a=0,o=0,l=s(),r=function(){f.multiple&&a+o===u.fileLength&&"function"==typeof f.allDone&&f.allDone({total:u.fileLength,successful:a,failed:o})},t=function(t){var n=new FormData,i=function(e){t.unified?layui.each(l,function(e,i){delete i[L]}):delete e[L]};if(layui.each(f.data,function(e,i){i="function"==typeof i?t.unified?i():i(t.index,t.file):i,n.append(e,i)}),t.unified)layui.each(l,function(e,i){i[L]||(i[L]=!0,n.append(f.field,i))});else{if(t.file[L])return;n.append(f.field,t.file),t.file[L]=!0}var e={url:f.url,type:"post",data:n,dataType:f.dataType||"json",contentType:!1,processData:!1,headers:f.headers||{},success:function(e){f.unified?a+=u.fileLength:a++,p(t.index,e),r(t.index),i(t.file)},error:function(e){f.unified?o+=u.fileLength:o++,u.msg(c.error||["Upload failed, please try again.","status: "+(e.status||"")+" - "+(e.statusText||"error")].join("
            ")),m(t.index),r(t.index),i(t.file)}};"function"==typeof f.progress&&(e.xhr=function(){var e=x.ajaxSettings.xhr();return e.upload.addEventListener("progress",function(e){var i;e.lengthComputable&&(i=Math.floor(e.loaded/e.total*100),f.progress(i,(f.item||f.elem)[0],e,t.index))}),e}),x.ajax(e)};f.unified?t({unified:!0,index:0}):layui.each(l,function(e,i){t({index:e,file:i})})},d=function(){var n=x("#"+F);u.elemFile.parent().submit(),clearInterval(j.timer),j.timer=setInterval(function(){var e,i=n.contents().find("body");try{e=i.text()}catch(t){u.msg(c["cross-domain"]),clearInterval(j.timer),m()}e&&(clearInterval(j.timer),i.html(""),p(0,e))},30)},p=function(e,i){if(u.elemFile.next("."+w).remove(),l.value="","json"===f.force&&"object"!=typeof i)try{i=JSON.parse(i)}catch(t){return i={},u.msg(c["data-format-error"])}"function"==typeof f.done&&f.done(i,e||0,function(e){u.upload(e)})},m=function(e){f.auto&&(l.value=""),"function"==typeof f.error&&f.error(e||0,function(e){u.upload(e)})},h=f.exts,g=(n=[],layui.each(e||u.chooseFiles,function(e,i){n.push(i.name)}),n),v={preview:function(e){u.preview(e)},upload:function(e,i){var t={};t[e]=i,u.upload(t)},pushFile:function(){return u.files=u.files||{},layui.each(u.chooseFiles,function(e,i){u.files[e]=i}),u.files},resetFile:function(e,i,t){i=new File([i],t);u.files=u.files||{},u.files[e]=i}},y={file:"\u6587\u4ef6",images:"\u56fe\u7247",video:"\u89c6\u9891",audio:"\u97f3\u9891"}[f.accept]||"\u6587\u4ef6",g=0===g.length?l.value.match(/[^\/\\]+\..+/g)||[]:g;if(0!==g.length){switch(f.accept){case"file":layui.each(g,function(e,i){if(h&&!RegExp(".\\.("+h+")$","i").test(escape(i)))return t=!0});break;case"video":layui.each(g,function(e,i){if(!RegExp(".\\.("+(h||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(i)))return t=!0});break;case"audio":layui.each(g,function(e,i){if(!RegExp(".\\.("+(h||"mp3|wav|mid")+")$","i").test(escape(i)))return t=!0});break;default:layui.each(g,function(e,i){if(!RegExp(".\\.("+(h||"jpg|png|gif|bmp|jpeg|svg")+")$","i").test(escape(i)))return t=!0})}if(t)return u.msg(c["check-error"]||"\u9009\u62e9\u7684"+y+"\u4e2d\u5305\u542b\u4e0d\u652f\u6301\u7684\u683c\u5f0f"),l.value="";if("choose"!==i&&!f.auto||(f.choose&&f.choose(v),"choose"!==i)){if(u.fileLength=(a=0,y=s(),layui.each(y,function(){a++}),a),f.number&&u.fileLength>f.number)return u.msg("function"==typeof c["limit-number"]?c["limit-number"](f,u.fileLength):"\u540c\u65f6\u6700\u591a\u53ea\u80fd\u4e0a\u4f20: "+f.number+" \u4e2a\u6587\u4ef6
            \u60a8\u5f53\u524d\u5df2\u7ecf\u9009\u62e9\u4e86: "+u.fileLength+" \u4e2a\u6587\u4ef6");if(01024*f.size&&(i=1<=(i=f.size/1024)?i.toFixed(2)+"MB":f.size+"KB",l.value="",o=i)}),o)return u.msg("function"==typeof c["limit-size"]?c["limit-size"](f,o):"\u6587\u4ef6\u5927\u5c0f\u4e0d\u80fd\u8d85\u8fc7 "+o);if(!f.before||!1!==f.before(v))b.ie?(9'+e+"")};a.elem.off("upload.start").on("upload.start",function(){var e=x(this);n.config.item=e,n.elemFile[0].click()}),b.ie&&b.ie<10||a.elem.off("upload.over").on("upload.over",function(){x(this).attr("lay-over","")}).off("upload.leave").on("upload.leave",function(){x(this).removeAttr("lay-over")}).off("upload.drop").on("upload.drop",function(e,i){var t=x(this),i=i.originalEvent.dataTransfer.files||[];t.removeAttr("lay-over"),o(i),a.auto?n.upload():l(i)}),n.elemFile.on("change",function(){var e=this.files||[];0!==e.length&&(o(e),a.auto?n.upload():l(e))}),a.bindAction.off("upload.action").on("upload.action",function(){n.upload()}),a.elem.data(r)||(a.elem.on("click",function(){n.isFile()||x(this).trigger("upload.start")}),a.drag&&a.elem.on("dragover",function(e){e.preventDefault(),x(this).trigger("upload.over")}).on("dragleave",function(e){x(this).trigger("upload.leave")}).on("drop",function(e){e.preventDefault(),x(this).trigger("upload.drop",e)}),a.bindAction.on("click",function(){x(this).trigger("upload.action")}),a.elem.data(r,a.id))},l.that={},l.getThis=function(e){var i=l.that[e];return i||hint.error(e?t+" instance with ID '"+e+"' not found":"ID argument required"),i},o.render=function(e){e=new j(e);return l.call(e)},e(t,o)});layui.define(["lay","layer","util"],function(e){"use strict";var C=layui.$,h=layui.layer,d=layui.util,l=layui.hint(),w=(layui.device(),"form"),o=".layui-form",N="layui-this",T="layui-hide",$="layui-disabled",t=function(){this.config={verify:{required:function(e){if(!/[\S]+/.test(e))return"\u5fc5\u586b\u9879\u4e0d\u80fd\u4e3a\u7a7a"},phone:function(e){if(e&&!/^1\d{10}$/.test(e))return"\u624b\u673a\u53f7\u683c\u5f0f\u4e0d\u6b63\u786e"},email:function(e){if(e&&!/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(e))return"\u90ae\u7bb1\u683c\u5f0f\u4e0d\u6b63\u786e"},url:function(e){if(e&&!/^(#|(http(s?)):\/\/|\/\/)[^\s]+\.[^\s]+$/.test(e))return"\u94fe\u63a5\u683c\u5f0f\u4e0d\u6b63\u786e"},number:function(e){if(e&&isNaN(e))return"\u53ea\u80fd\u586b\u5199\u6570\u5b57"},date:function(e){if(e&&!/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/.test(e))return"\u65e5\u671f\u683c\u5f0f\u4e0d\u6b63\u786e"},identity:function(e){if(e&&!/(^\d{15}$)|(^\d{17}(x|X|\d)$)/.test(e))return"\u8eab\u4efd\u8bc1\u53f7\u683c\u5f0f\u4e0d\u6b63\u786e"}},autocomplete:null}},i=(t.prototype.set=function(e){return C.extend(!0,this.config,e),this},t.prototype.verify=function(e){return C.extend(!0,this.config.verify,e),this},t.prototype.getFormElem=function(e){return C(o+(e?'[lay-filter="'+e+'"]':""))},t.prototype.on=function(e,t){return layui.onevent.call(this,w,e,t)},t.prototype.val=function(e,i){return this.getFormElem(e).each(function(e,t){var a=C(this);layui.each(i,function(e,t){var i,e=a.find('[name="'+e+'"]');e[0]&&("checkbox"===(i=e[0].type)?e[0].checked=t:"radio"===i?e.each(function(){this.checked=this.value==t}):e.val(t))})}),r.render(null,e),this.getValue(e)},t.prototype.getValue=function(e,t){t=t||this.getFormElem(e);var a={},n={},e=t.find("input,select,textarea");return layui.each(e,function(e,t){var i;C(this);t.name=(t.name||"").replace(/^\s*|\s*&/,""),t.name&&(/^.*\[\]$/.test(t.name)&&(i=t.name.match(/^(.*)\[\]$/g)[0],a[i]=0|a[i],i=t.name.replace(/^(.*)\[\]$/,"$1["+a[i]+++"]")),/^(checkbox|radio)$/.test(t.type)&&!t.checked||(n[i||t.name]=t.value))}),n},t.prototype.render=function(e,t){var i=this.config,a=C(o+(t?'[lay-filter="'+t+'"]':"")),n={input:function(e){var e=e||a.find("input,textarea"),t=(i.autocomplete&&e.attr("autocomplete",i.autocomplete),function(e,t){var i=e.val(),a=Number(i),n=Number(e.attr("step"))||1,l=Number(e.attr("min")),r=Number(e.attr("max")),s=Number(e.attr("lay-precision")),o="click"!==t&&""===i,c="init"===t;isNaN(a)||("click"===t&&(a=!!C(this).index()?a-n:a+n),t=function(e){return((e.toString().match(/\.(\d+$)/)||[])[1]||"").length},s=0<=s?s:Math.max(t(n),t(i)),o||(c||r<=(a=a<=l?l:a)&&(a=r),s&&(a=a.toFixed(s)),e.val(a)),e[(a'),e=layui.isArray(i.value)?i.value:[i.value],e=C((a=[],layui.each(e,function(e,t){a.push('')}),a.join(""))),n=(t.append(e),i.split&&t.addClass("layui-input-split"),i.className&&t.addClass(i.className),r.next("."+u)),l=(n[0]&&n.remove(),r.parent().hasClass(o)||r.wrap('
            '),r.next("."+c));l[0]?((n=l.find("."+u))[0]&&n.remove(),l.prepend(t),r.css("padding-right",function(){return(r.closest(".layui-input-group")[0]?0:l.outerWidth())+t.outerWidth()})):(t.addClass(c),r.after(t)),"auto"===i.show&&d(t,r.val()),"function"==typeof i.init&&i.init.call(this,r,i),r.on("input propertychange",function(){var e=this.value;"auto"===i.show&&d(t,e)}),r.on("blur",function(){"function"==typeof i.blur&&i.blur.call(this,r,i)}),e.on("click",function(){var e=r.attr("lay-filter");C(this).hasClass($)||("function"==typeof i.click&&i.click.call(this,r,i),layui.event.call(this,w,"input-affix("+e+")",{elem:r[0],affix:s,options:i}))})},f={eye:{value:"eye-invisible",click:function(e,t){var i="LAY_FORM_INPUT_AFFIX_SHOW",a=e.data(i);e.attr("type",a?"password":"text").data(i,!a),n({value:a?"eye-invisible":"eye"})}},clear:{value:"clear",click:function(e){e.val("").focus(),d(C(this).parent(),null)},show:"auto",disabled:e},number:{value:["up","down"],split:!0,className:"layui-input-number",disabled:r.is("[disabled]"),init:function(e){t.call(this,e,"init")},click:function(e){t.call(this,e,"click")},blur:function(e){t.call(this,e,"blur")}}};n()})},select:function(e){var p,c="\u8bf7\u9009\u62e9",m="layui-form-select",g="layui-select-title",x="layui-select-none",b="",e=e||a.find("select"),k=function(e,t){C(e.target).parent().hasClass(g)&&!t||(C("."+m).removeClass(m+"ed "+m+"up"),p&&b&&p.val(b)),p=null},u=function(a,e,t){var s,r,i,n,o,l,c=C(this),u=a.find("."+g),d=u.find("input"),f=a.find("dl"),h=f.children("dd"),y=f.children("dt"),v=this.selectedIndex;e||(r=c.attr("lay-search"),i=function(){var e=a.offset().top+a.outerHeight()+5-F.scrollTop(),t=f.outerHeight();v=c[0].selectedIndex,a.addClass(m+"ed"),h.removeClass(T),y.removeClass(T),s=null,h.removeClass(N),0<=v&&h.eq(v).addClass(N),e+t>F.height()&&t<=e&&a.addClass(m+"up"),o()},n=function(e){a.removeClass(m+"ed "+m+"up"),d.blur(),s=null,e||l(d.val(),function(e){var t=c[0].selectedIndex;e&&(b=C(c[0].options[t]).html(),0===t&&b===d.attr("placeholder")&&(b=""),d.val(b||""))})},o=function(){var e,t,i=f.children("dd."+N);i[0]&&(e=i.position().top,t=f.height(),i=i.height(),t\u65e0\u5339\u914d\u9879

            '):f.find("."+x).remove()},"keyup"),""===t&&(c.val(""),f.find("."+N).removeClass(N),(c[0].options[0]||{}).value||f.children("dd:eq(0)").addClass(N),f.find("."+x).remove()),o()}).on("blur",function(e){var t=c[0].selectedIndex;p=d,b=C(c[0].options[t]).text(),0===t&&b===d.attr("placeholder")&&(b=""),setTimeout(function(){l(d.val(),function(e){b||d.val("")},"blur")},200)})),h.on("click",function(){var e=C(this),t=e.attr("lay-value"),i=c.attr("lay-filter");return e.hasClass($)||(e.hasClass("layui-select-tips")?d.val(""):(d.val(e.text()),e.addClass(N)),e.siblings().removeClass(N),c.val(t).removeClass("layui-form-danger"),layui.event.call(this,w,"select("+i+")",{elem:c[0],value:t,othis:a}),n(!0)),!1}),a.find("dl>dt").on("click",function(e){return!1}),C(document).off("click",k).on("click",k))};e.each(function(e,t){var i=C(this),a=i.next("."+m),n=this.disabled,l=t.value,r=C(t.options[t.selectedIndex]),t=t.options[0];if("string"==typeof i.attr("lay-ignore"))return i.show();var s,o="string"==typeof i.attr("lay-search"),t=t&&!t.value&&t.innerHTML||c,r=C(['
            ','
            ','','
            ','
            ',(t=i.find("*"),s=[],layui.each(t,function(e,t){var i=t.tagName.toLowerCase();0!==e||t.value||"optgroup"===i?s.push("optgroup"===i?"
            "+t.label+"
            ":'
            '+C.trim(t.innerHTML)+"
            "):s.push('
            '+C.trim(t.innerHTML||c)+"
            ")}),0===s.length&&s.push('
            \u6ca1\u6709\u9009\u9879
            '),s.join("")+"
            "),"
            "].join(""));a[0]&&a.remove(),i.after(r),u.call(this,r,n,o)})},checkbox:function(e){var o={checkbox:["layui-form-checkbox","layui-form-checked","checkbox"],"switch":["layui-form-switch","layui-form-onswitch","switch"],SUBTRA:"layui-icon-indeterminate"},e=e||a.find("input[type=checkbox]");e.each(function(e,t){var i=C(this),a=i.attr("lay-skin")||"primary",n=d.escape(C.trim(t.title||(t.title=i.attr("lay-text")||""))),l=this.disabled,r=o[a]||o.checkbox,s=i.next("."+r[0]);if(s[0]&&s.remove(),i.next("[lay-checkbox]")[0]&&(n=i.next().html()||""),n="switch"===a?n.split("|"):[n],"string"==typeof i.attr("lay-ignore"))return i.show();l=C(['
            ",(s={checkbox:[n[0]?"
            "+n[0]+"
            ":"primary"===a?"":"
            ",''].join(""),"switch":"
            "+((t.checked?n[0]:n[1])||"")+"
            "})[a]||s.checkbox,"
            "].join(""));i.after(l),function(a,n){var l=C(this);a.on("click",function(){var e=C(this),t=l.attr("lay-filter"),e=e.next("*[lay-checkbox]")[0]?e.next().html():l.attr("title")||"",i=l.attr("lay-skin")||"primary",e="switch"===i?e.split("|"):[e];l[0].disabled||(l[0].indeterminate&&(l[0].indeterminate=!1,a.find("."+o.SUBTRA).removeClass(o.SUBTRA).addClass("layui-icon-ok")),l[0].checked?(l[0].checked=!1,a.removeClass(n[1]),"switch"===i&&a.children("div").html(e[1])):(l[0].checked=!0,a.addClass(n[1]),"switch"===i&&a.children("div").html(e[0])),layui.event.call(l[0],w,n[2]+"("+t+")",{elem:l[0],value:l[0].value,othis:a}))})}.call(this,l,r)})},radio:function(e){var r="layui-form-radio",s=["layui-icon-radio","layui-icon-circle"],e=e||a.find("input[type=radio]");e.each(function(e,t){var i=C(this),a=i.next("."+r),n=this.disabled;if("string"==typeof i.attr("lay-ignore"))return i.show();a[0]&&a.remove();n=C(['
            ','',"
            "+(a=d.escape(t.title||""),a=i.next("[lay-radio]")[0]?i.next().html():a)+"
            ","
            "].join(""));i.after(n),function(a){var n=C(this),l="layui-anim-scaleSpring";a.on("click",function(){var e=n[0].name,t=n.parents(o),i=n.attr("lay-filter"),e=t.find("input[name="+e.replace(/(\.|#|\[|\])/g,"\\$1")+"]");n[0].disabled||(layui.each(e,function(){var e=C(this).next("."+r);this.checked=!1,e.removeClass(r+"ed"),e.children(".layui-icon").removeClass(l+" "+s[0]).addClass(s[1])}),n[0].checked=!0,a.addClass(r+"ed"),a.children(".layui-icon").addClass(l+" "+s[0]),layui.event.call(n[0],w,"radio("+i+")",{elem:n[0],value:n[0].value,othis:a}))})}.call(this,n)})}},t=function(){layui.each(n,function(e,t){t()})};return"object"===layui.type(e)?C(e).is(o)?(a=C(e),t()):e.each(function(e,t){var i=C(t);i.closest(o).length&&("SELECT"===t.tagName?n.select(i):"INPUT"===t.tagName&&("checkbox"===(t=t.type)||"radio"===t?n[t](i):n.input(i)))}):e?n[e]?n[e]():l.error('\u4e0d\u652f\u6301\u7684 "'+e+'" \u8868\u5355\u6e32\u67d3'):t(),this},t.prototype.validate=function(e){var u,d=this.config.verify,f="layui-form-danger";return!(e=C(e))[0]||(e.attr("lay-verify")!==undefined||!1!==this.validate(e.find("*[lay-verify]")))&&(layui.each(e,function(e,r){var s=C(this),t=(s.attr("lay-verify")||"").split("|"),o=s.attr("lay-vertype"),c=C.trim(s.val());if(s.removeClass(f),layui.each(t,function(e,t){var i="",a=d[t];if(a){var n="function"==typeof a?i=a(c,r):!a[0].test(c),l="select"===r.tagName.toLowerCase()||/^(checkbox|radio)$/.test(r.type),i=i||a[1];if("required"===t&&(i=s.attr("lay-reqtext")||i),n)return"tips"===o?h.tips(i,"string"!=typeof s.attr("lay-ignore")&&l?s.next():s,{tips:1}):"alert"===o?h.alert(i,{title:"\u63d0\u793a",shadeClose:!0}):/\b(string|number)\b/.test(typeof i)&&h.msg(i,{icon:5,shift:6}),setTimeout(function(){(l?s.next().find("input"):r).focus()},7),s.addClass(f),u=!0}}),u)return u}),!u)},t.prototype.submit=function(e,t){var i={},a=C(this),e="string"==typeof e?e:a.attr("lay-filter"),n=this.getFormElem?this.getFormElem(e):a.parents(o).eq(0),l=n.find("*[lay-verify]");return!!r.validate(l)&&(i=r.getValue(null,n),l={elem:this.getFormElem?window.event&&window.event.target:this,form:(this.getFormElem?n:a.parents("form"))[0],field:i},"function"==typeof t&&t(l),layui.event.call(this,w,"submit("+e+")",l))}),r=new t,t=C(document),F=C(window);C(function(){r.render()}),t.on("reset",o,function(){var e=C(this).attr("lay-filter");setTimeout(function(){r.render(null,e)},50)}),t.on("submit",o,i).on("click","*[lay-submit]",i),e(w,r)});layui.define(["lay","laytpl","laypage","form","util"],function(n){"use strict";var f=layui.$,r=layui.lay,m=layui.laytpl,O=layui.laypage,p=layui.layer,v=layui.form,g=layui.util,b=layui.hint(),x=layui.device(),k={config:{checkName:"LAY_CHECKED",indexName:"LAY_INDEX",numbersName:"LAY_NUM",disabledName:"LAY_DISABLED"},cache:{},index:layui.table?layui.table.index+1e4:0,set:function(e){return this.config=f.extend({},this.config,e),this},on:function(e,t){return layui.onevent.call(this,N,e,t)}},w=function(){var a=this,e=a.config,i=e.id||e.index;return{config:e,reload:function(e,t){a.reload.call(a,e,t)},reloadData:function(e,t){k.reloadData(i,e,t)},setColsWidth:function(){a.setColsWidth.call(a)},resize:function(){a.resize.call(a)}}},C=function(e){var t=w.that[e];return t||b.error(e?"The table instance with ID '"+e+"' not found":"ID argument required"),t||null},l=function(e){var t=w.config[e];return t||b.error(e?"The table instance with ID '"+e+"' not found":"ID argument required"),t||null},T=function(e){var t=this.config||{},a=(e=e||{}).item3,i=e.content;"numbers"===a.type&&(i=e.tplData[k.config.numbersName]);("escape"in a?a:t).escape&&(i=g.escape(i));t=e.text&&a.exportTemplet||a.templet||a.toolbar;return t&&(i="function"==typeof t?t.call(a,e.tplData,e.obj):m(function(e){try{return r(e).html()}catch(t){return e}}(t)||String(i)).render(f.extend({LAY_COL:a},e.tplData))),e.text?f("
            "+i+"
            ").text():i},N="table",t=".layui-table",R="layui-hide",y="layui-hide-v",h="layui-none",D="layui-table-view",o=".layui-table-header",L=".layui-table-body",u=".layui-table-fixed-r",I=".layui-table-pageview",E=".layui-table-sort",A="layui-table-checked",_="layui-table-edit",M="layui-table-hover",P="laytable-cell-group",W="layui-table-col-special",j="layui-table-tool-panel",H="layui-table-expanded",S="LAY_TABLE_MOVE_DICT",e=function(e){return['',"","{{# layui.each(d.data.cols, function(i1, item1){ }}","","{{# layui.each(item1, function(i2, item2){ }}",'{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}','{{# if(item2.fixed === "right"){ right = true; } }}',(e=e||{}).fixed&&"right"!==e.fixed?'{{# if(item2.fixed && item2.fixed !== "right"){ }}':"right"===e.fixed?'{{# if(item2.fixed === "right"){ }}':"","{{# var isSort = !(item2.colGroup) && item2.sort; }}",'",e.fixed?"{{# }; }}":"","{{# }); }}","","{{# }); }}","","
            ','
            ','{{# if(item2.type === "checkbox"){ }}','',"{{# } else { }}",'{{-item2.title||""}}',"{{# if(isSort){ }}",'',"{{# } }}","{{# } }}","
            ","
            "].join("")},a=['',"","
            "].join(""),s=[,"{{# if(d.data.toolbar){ }}",'
            ','
            ','
            ',"
            ","{{# } }}",'
            ',"{{# if(d.data.loading){ }}",'
            ','',"
            ","{{# } }}","{{# var left, right; }}",'
            ',e(),"
            ",'
            ',a,"
            ","{{# if(left){ }}",'
            ','
            ',e({fixed:!0}),"
            ",'
            ',a,"
            ","
            ","{{# }; }}","{{# if(right){ }}",'
            ','
            ',e({fixed:"right"}),'
            ',"
            ",'
            ',a,"
            ","
            ","{{# }; }}","
            ","{{# if(d.data.totalRow){ }}",'
            ','','',"
            ","
            ","{{# } }}",'
            ','
            ',"
            "].join(""),d=f(window),F=f(document),i=function(e){this.index=++k.index,this.config=f.extend({},this.config,k.config,e),this.render()},c=(i.prototype.config={limit:10,loading:!0,escape:!0,cellMinWidth:60,cellMaxWidth:Number.MAX_VALUE,editTrigger:"click",defaultToolbar:["filter","exports","print"],defaultContextmenu:!0,autoSort:!0,text:{none:"\u65e0\u6570\u636e"},cols:[]},i.prototype.render=function(e){var t=this,a=t.config,i=(a.elem=f(a.elem),a.where=a.where||{},a.id="id"in a?a.id:a.elem.attr("id")||t.index);if(w.that[i]=t,(w.config[i]=a).request=f.extend({pageName:"page",limitName:"limit"},a.request),a.response=f.extend({statusName:"code",statusCode:0,msgName:"msg",dataName:"data",totalRowName:"totalRow",countName:"count"},a.response),null!==a.page&&"object"==typeof a.page&&(a.limit=a.page.limit||a.limit,a.limits=a.page.limits||a.limits,t.page=a.page.curr=a.page.curr||1,delete a.page.elem,delete a.page.jump),!a.elem[0])return t;if(a.elem.attr("lay-filter")||a.elem.attr("lay-filter",a.id),"reloadData"===e)return t.pullData(t.page,{type:"reloadData"});a.index=t.index,t.key=a.id||a.index,t.setInit(),a.height&&/^full-.+$/.test(a.height)?(t.fullHeightGap=a.height.split("-")[1],a.height=d.height()-(parseFloat(t.fullHeightGap)||0)):a.height&&/^#\w+\S*-.+$/.test(a.height)?(i=a.height.split("-"),t.parentHeightGap=i.pop(),t.parentDiv=i.join("-"),a.height=f(t.parentDiv).height()-(parseFloat(t.parentHeightGap)||0)):"function"==typeof a.height&&(t.customHeightFunc=a.height,a.height=t.customHeightFunc());var l,e=a.elem,i=e.next("."+D),n=t.elem=f("
            ");n.addClass((l=[D,D+"-"+t.index,"layui-form","layui-border-box"],a.className&&l.push(a.className),l.join(" "))).attr({"lay-filter":"LAY-TABLE-FORM-DF-"+t.index,"lay-id":a.id,style:(l=[],a.width&&l.push("width:"+a.width+"px;"),l.join(""))}).html(m(s,{open:"{{",close:"}}"}).render({data:a,index:t.index})),t.renderStyle(),i[0]&&i.remove(),e.after(n),t.layTool=n.find(".layui-table-tool"),t.layBox=n.find(".layui-table-box"),t.layHeader=n.find(o),t.layMain=n.find(".layui-table-main"),t.layBody=n.find(L),t.layFixed=n.find(".layui-table-fixed"),t.layFixLeft=n.find(".layui-table-fixed-l"),t.layFixRight=n.find(u),t.layTotal=n.find(".layui-table-total"),t.layPage=n.find(".layui-table-page"),t.renderToolbar(),t.renderPagebar(),t.fullSize(),t.pullData(t.page),t.events()},i.prototype.initOpts=function(e){this.config;e.checkbox&&(e.type="checkbox"),e.space&&(e.type="space"),e.type||(e.type="normal"),"normal"!==e.type&&(e.unresize=!0,e.width=e.width||{checkbox:50,radio:50,space:30,numbers:60}[e.type])},i.prototype.setInit=function(e){var l,a,d=this,r=d.config;if(r.clientWidth=r.width||(l=function(e){var t,a=(e=e||r.elem.parent()).width();try{t="none"===e.css("display")}catch(i){}return!e[0]||a&&!t?a:l(e.parent())})(),"width"===e)return r.clientWidth;r.height=r.maxHeight||r.height,r.css&&-1===r.css.indexOf(D)&&(a=r.css.split("}"),layui.each(a,function(e,t){t&&(a[e]="."+D+"-"+d.index+" "+t)}),r.css=a.join("}"));var c=function(a,e,i,l){var n,o;l?(l.key=[r.index,a,i].join("-"),l.colspan=l.colspan||0,l.rowspan=l.rowspan||0,d.initOpts(l),(n=a+(parseInt(l.rowspan)||1)) td:hover > .layui-table-cell{overflow: auto;}"].concat(x.ie?[".layui-table-edit{height: "+i+";}","td[data-edit]:hover:after{height: "+i+";}"]:[]),function(e,t){t&&o.push(a+" "+t)})),l.css&&o.push(l.css),r.style({target:this.elem[0],text:o.join(""),id:"DF-table-"+n})},i.prototype.renderToolbar=function(){var e=this.config,t=['
            ','
            ','
            '].join(""),a=this.layTool.find(".layui-table-tool-temp"),i=("default"===e.toolbar?a.html(t):"string"==typeof e.toolbar&&(t=f(e.toolbar).html()||"")&&a.html(m(t).render(e)),{filter:{title:"\u7b5b\u9009\u5217",layEvent:"LAYTABLE_COLS",icon:"layui-icon-cols"},exports:{title:"\u5bfc\u51fa",layEvent:"LAYTABLE_EXPORT",icon:"layui-icon-export"},print:{title:"\u6253\u5370",layEvent:"LAYTABLE_PRINT",icon:"layui-icon-print"}}),l=[];"object"==typeof e.defaultToolbar&&layui.each(e.defaultToolbar,function(e,t){t="string"==typeof t?i[t]:t;t&&l.push('
            ')}),this.layTool.find(".layui-table-tool-self").html(l.join(""))},i.prototype.renderPagebar=function(){var e,t=this.config,a=this.layPagebar=f('
            ');t.pagebar&&((e=f(t.pagebar).html()||"")&&a.append(m(e).render(t)),this.layPage.append(a))},i.prototype.setParentCol=function(e,t){var a=this.config,i=this.layHeader.find('th[data-key="'+t+'"]'),l=parseInt(i.attr("colspan"))||0;i[0]&&(t=t.split("-"),t=a.cols[t[1]][t[2]],e?l--:l++,i.attr("colspan",l),i[l?"removeClass":"addClass"](R),t.colspan2=l,t.hide=l<1,a=i.data("parentkey"))&&this.setParentCol(e,a)},i.prototype.setColsPatch=function(){var a=this,e=a.config;layui.each(e.cols,function(e,t){layui.each(t,function(e,t){t.hide&&a.setParentCol(t.hide,t.parentKey)})})},i.prototype.setGroupWidth=function(i){var e,l=this;l.config.cols.length<=1||((e=l.layHeader.find((i?"th[data-key="+i.data("parentkey")+"]>":"")+"."+P)).css("width",0),layui.each(e.get().reverse(),function(){var e=f(this),t=e.parent().data("key"),a=0;l.layHeader.eq(0).find("th[data-parentkey="+t+"]").width(function(e,t){f(this).hasClass(R)||0 tr:first-child > th:last-child")).data("field")&&e.prev()[0]?t(e.prev()):e})()).data("key"),n.cssRules(e,function(e){var t=e.style.width||a.outerWidth();e.style.width=parseFloat(t)+l+"px",0'+(e||"Error")+"
            ");a[0]&&(t.layNone.remove(),a.remove()),t.layFixed.addClass(R),t.layMain.find("tbody").html(""),t.layMain.append(t.layNone=e),t.layTotal.addClass(y),t.layPage.find(I).addClass(y),k.cache[t.key]=[],t.syncCheckAll(),t.renderForm(),t.setColsWidth()},i.prototype.page=1,i.prototype.pullData=function(a,t){var e,i,l=this,n=l.config,o=(n.HAS_SET_COLS_PATCH||l.setColsPatch(),n.HAS_SET_COLS_PATCH=!0,n.request),d=n.response,r=function(){"object"==typeof n.initSort&&l.sort({field:n.initSort.field,type:n.initSort.type,reloadType:t.type})},c=function(e,t){l.setColsWidth(),"function"==typeof n.done&&n.done(e,a,e[d.countName],t)};t=t||{},"function"==typeof n.before&&n.before(n),l.startTime=(new Date).getTime(),t.renderData?((e={})[d.dataName]=k.cache[l.key],e[d.countName]=n.url?"object"===layui.type(n.page)?n.page.count:e[d.dataName].length:n.data.length,"object"==typeof n.totalRow&&(e[d.totalRowName]=f.extend({},l.totalRow)),l.renderData({res:e,curr:a,count:e[d.countName],type:t.type,sort:!0}),c(e,"renderData")):n.url?(i={},n.page&&(i[o.pageName]=a,i[o.limitName]=n.limit),o=f.extend(i,n.where),n.contentType&&0==n.contentType.indexOf("application/json")&&(o=JSON.stringify(o)),l.loading(),f.ajax({type:n.method||"get",url:n.url,contentType:n.contentType,data:o,dataType:n.dataType||"json",jsonpCallback:n.jsonpCallback,headers:n.headers||{},complete:"function"==typeof n.complete?n.complete:undefined,success:function(e){(e="function"==typeof n.parseData?n.parseData(e)||e:e)[d.statusName]!=d.statusCode?l.errorView(e[d.msgName]||'\u8fd4\u56de\u7684\u6570\u636e\u4e0d\u7b26\u5408\u89c4\u8303\uff0c\u6b63\u786e\u7684\u6210\u529f\u72b6\u6001\u7801\u5e94\u4e3a\uff1a"'+d.statusName+'": '+d.statusCode):(l.totalRow=e[d.totalRowName],l.renderData({res:e,curr:a,count:e[d.countName],type:t.type}),r(),n.time=(new Date).getTime()-l.startTime+" ms"),c(e)},error:function(e,t){l.errorView("\u8bf7\u6c42\u5f02\u5e38\uff0c\u9519\u8bef\u63d0\u793a\uff1a"+t),"function"==typeof n.error&&n.error(e,t)}})):"array"===layui.type(n.data)&&(e={},i=a*n.limit-n.limit,o=n.data.concat(),e[d.dataName]=n.page?o.splice(i,n.limit):o,e[d.countName]=n.data.length,"object"==typeof n.totalRow&&(e[d.totalRowName]=f.extend({},n.totalRow)),l.totalRow=e[d.totalRowName],l.renderData({res:e,curr:a,count:e[d.countName],type:t.type}),r(),c(e))},i.prototype.eachCols=function(e){return k.eachCols(null,e,this.config.cols),this},i.prototype.col=function(e){try{return e=e.split("-"),this.config.cols[e[1]][e[2]]||{}}catch(t){return b.error(t),{}}},i.prototype.getTrHtml=function(a,l,n,e){var s=this,u=s.config,y=e&&e.trs||[],h=e&&e.trs_fixed||[],p=e&&e.trs_fixed_r||[];return n=n||1,layui.each(a,function(e,o){var i=[],d=[],r=[],c=e+u.limit*(n-1)+1;if("object"!=typeof o){a[e]=o={LAY_KEY:o};try{k.cache[s.key][e]=o}catch(t){}}"array"===layui.type(o)&&0===o.length||(o[k.config.numbersName]=c,l||(o[k.config.indexName]=e),s.eachCols(function(e,l){var t,e=l.field||e,a=l.key,n=o[e];n!==undefined&&null!==n||(n=""),l.colGroup||(e=['','
            "+function(){var e,t=f.extend(!0,{LAY_COL:l},o),a=k.config.checkName,i=k.config.disabledName;switch(l.type){case"checkbox":return'';case"radio":return'';case"numbers":return c}return l.toolbar?m(f(l.toolbar).html()||"").render(t):T.call(s,{item3:l,content:n,tplData:t})}(),"
            "].join(""),i.push(e),l.fixed&&"right"!==l.fixed&&d.push(e),"right"===l.fixed&&r.push(e))}),e=['data-index="'+e+'"'],o[k.config.checkName]&&e.push('class="'+A+'"'),e=e.join(" "),y.push(""+i.join("")+""),h.push(""+d.join("")+""),p.push(""+r.join("")+""))}),{trs:y,trs_fixed:h,trs_fixed_r:p}},k.getTrHtml=function(e,t){e=C(e);return e.getTrHtml(t,null,e.page)},i.prototype.renderData=function(e){var a=this,i=a.config,t=e.res,l=e.curr,n=a.count=e.count,o=e.sort,d=t[i.response.dataName]||[],t=t[i.response.totalRowName],r=[],c=[],s=[],u=function(){if(!o&&a.sortKey)return a.sort({field:a.sortKey.field,type:a.sortKey.sort,pull:!0,reloadType:e.type});a.getTrHtml(d,o,l,{trs:r,trs_fixed:c,trs_fixed_r:s}),"fixed"===i.scrollPos&&"reloadData"===e.type||a.layBody.scrollTop(0),"reset"===i.scrollPos&&a.layBody.scrollLeft(0),a.layMain.find("."+h).remove(),a.layMain.find("tbody").html(r.join("")),a.layFixLeft.find("tbody").html(c.join("")),a.layFixRight.find("tbody").html(s.join("")),a.syncCheckAll(),a.renderForm(),a.fullSize(),a.haveInit?a.scrollPatch():setTimeout(function(){a.scrollPatch()},50),a.haveInit=!0,p.close(a.tipsIndex)};return k.cache[a.key]=d,a.layTotal[0==d.length?"addClass":"removeClass"](y),a.layPage[i.page||i.pagebar?"removeClass":"addClass"](R),a.layPage.find(I)[!i.page||0==n||0===d.length&&1==l?"addClass":"removeClass"](y),0===d.length?a.errorView(i.text.none):(a.layFixLeft.removeClass(R),o?u():(u(),a.renderTotal(d,t),a.layTotal&&a.layTotal.removeClass(R),void(i.page&&(i.page=f.extend({elem:"layui-table-page"+i.index,count:n,limit:i.limit,limits:i.limits||[10,20,30,40,50,60,70,80,90],groups:3,layout:["prev","page","next","skip","count","limit"],prev:'',next:'',jump:function(e,t){t||(a.page=e.curr,i.limit=e.limit,a.pullData(e.curr))}},i.page),i.page.count=n,O.render(i.page)))))},k.renderData=function(e){e=C(e);e&&e.pullData(e.page,{renderData:!0,type:"reloadData"})},i.prototype.renderTotal=function(e,o){var d,r=this,c=r.config,s={};c.totalRow&&(layui.each(e,function(e,i){"array"===layui.type(i)&&0===i.length||r.eachCols(function(e,t){var e=t.field||e,a=i[e];t.totalRow&&(s[e]=(s[e]||0)+(parseFloat(a)||0))})}),r.dataTotal=[],d=[],r.eachCols(function(e,t){var a,e=t.field||e,i=o&&o[t.field],l="totalRowDecimals"in t?t.totalRowDecimals:2,l=s[e]?parseFloat(s[e]||0).toFixed(l):"",l=(a=t.totalRowText||"",(n={LAY_COL:t})[e]=l,n=t.totalRow&&T.call(r,{item3:t,content:l,tplData:n})||a,i||n),n=(t.field&&r.dataTotal.push({field:t.field,total:f("
            "+l+"
            ").text()}),['','
            "+("string"==typeof(a=t.totalRow||c.totalRow)?m(a).render(f.extend({TOTAL_NUMS:i||s[e],TOTAL_ROW:o||{},LAY_COL:t},t)):l),"
            "].join(""));d.push(n)}),e=r.layTotal.find(".layui-table-patch"),r.layTotal.find("tbody").html(""+d.join("")+(e.length?e.get(0).outerHTML:"")+""))},i.prototype.getColElem=function(e,t){return e.eq(0).find(".laytable-cell-"+t+":eq(0)")},i.prototype.renderForm=function(e){this.config;var t=this.elem.attr("lay-filter");v.render(e,t)},i.prototype.renderFormByElem=function(a){layui.each(["input","select"],function(e,t){v.render(a.find(t))})},i.prototype.syncCheckAll=function(){var a,e=this,i=e.config,t=e.layHeader.find('input[name="layTableCheckbox"]'),l=k.checkStatus(e.key);t[0]&&(a=l.isAll,e.eachCols(function(e,t){"checkbox"===t.type&&(t[i.checkName]=a)}),t.prop({checked:l.isAll,indeterminate:!l.isAll&&l.data.length}),v.render(t))},i.prototype.setRowActive=function(e,t,a){this.config;e=this.layBody.find('tr[data-index="'+e+'"]');if(t=t||"layui-table-click",a)return e.removeClass(t);e.addClass(t),e.siblings("tr").removeClass(t)},i.prototype.setRowChecked=function(i){var e=this,l=e.config,n="all"===i.index,o="array"===layui.type(i.index),d=(t=e.layBody.find("tr"),n?t:t.filter(o?function(){var e=f(this).data("index");return-1!==i.index.indexOf(e)}:'[data-index="'+i.index+'"]')),t=(i=f.extend({type:"checkbox"},i),k.cache[e.key]),a="checked"in i,r=function(e){return"radio"===i.type||(a?i.checked:!e)},t=(layui.each(t,function(e,t){var a;"array"===layui.type(t)||t[l.disabledName]||(n||(o?-1!==i.index.indexOf(e):Number(i.index)===e)?(a=t[l.checkName]=r(t[l.checkName]),(e=d.filter('[data-index="'+e+'"]'))[a?"addClass":"removeClass"](A),"radio"===i.type&&e.siblings().removeClass(A)):"radio"===i.type&&delete t[l.checkName])}),d.find('input[lay-type="'+({radio:"layTableRadio",checkbox:"layTableCheckbox"}[i.type]||"checkbox")+'"]:not(:disabled)')),c=t.last(),s=c.closest(u);("radio"===i.type&&s.hasClass(R)?t.first():t).prop("checked",r(c.prop("checked"))),e.syncCheckAll(),e.renderForm(i.type)},i.prototype.sort=function(l){var e,t=this,a={},i=t.config,n=i.elem.attr("lay-filter"),o=k.cache[t.key];"string"==typeof(l=l||{}).field&&(d=l.field,t.layHeader.find("th").each(function(e,t){var a=f(this),i=a.data("field");if(i===l.field)return l.field=a,d=i,!1}));try{var d=d||l.field.data("field"),r=l.field.data("key");if(t.sortKey&&!l.pull&&d===t.sortKey.field&&l.type===t.sortKey.sort)return;var c=t.layHeader.find("th .laytable-cell-"+r).find(E);t.layHeader.find("th").find(E).removeAttr("lay-sort"),c.attr("lay-sort",l.type||null),t.layFixed.find("th")}catch(s){b.error("Table modules: sort field '"+d+"' not matched")}t.sortKey={field:d,sort:l.type},i.autoSort&&("asc"===l.type?e=layui.sort(o,d,null,!0):"desc"===l.type?e=layui.sort(o,d,!0,!0):(e=layui.sort(o,k.config.indexName,null,!0),delete t.sortKey,delete i.initSort)),a[i.response.dataName]=e||o,t.renderData({res:a,curr:t.page,count:t.count,sort:!0,type:l.reloadType}),l.fromEvent&&(i.initSort={field:d,type:l.type},layui.event.call(l.field,N,"sort("+n+")",f.extend({config:i},i.initSort)))},i.prototype.loading=function(e){var t=this;t.config.loading&&(e?(t.layInit&&t.layInit.remove(),delete t.layInit,t.layBox.find(".layui-table-init").remove()):(t.layInit=f(['
            ','',"
            "].join("")),t.layBox.append(t.layInit)))},i.prototype.cssRules=function(t,a){var e=this.elem.children("style")[0];r.getStyleRules(e,function(e){if(e.selectorText===".laytable-cell-"+t)return a(e),self!==parent&&(e=r.elem("input",{style:"position: absolute; left: 0; top: 0; opacity: 0.01;"}),document.body.appendChild(e),e.focus(),document.body.removeChild(e)),!0})},i.prototype.fullSize=function(){var e,a,i=this,t=i.config,l=t.height;i.fullHeightGap?(l=d.height()-i.fullHeightGap)<135&&(l=135):i.parentDiv&&i.parentHeightGap?(l=f(i.parentDiv).height()-i.parentHeightGap)<135&&(l=135):i.customHeightFunc&&(l=i.customHeightFunc())<135&&(l=135),1
            ')).find("div").css({width:a}),e.find("tr").append(t)):e.find(".layui-table-patch").remove()};n(e.layHeader),n(e.layTotal);n=e.layMain.height()-i;e.layFixed.find(L).css("height",t.height()>=n?n:"auto").scrollTop(e.layMain.scrollTop()),e.layFixRight[k.cache[e.key]&&k.cache[e.key].length&&0');a.html(t),s.height&&a.css("max-height",s.height-(c.layTool.outerHeight()||50)),i.find("."+j)[0]||i.append(a),c.renderForm(),a.on("click",function(e){layui.stope(e)}),e.done&&e.done(a,t)};switch(layui.stope(e),F.trigger("table.tool.panel.remove"),p.close(c.tipsIndex),t){case"LAYTABLE_COLS":n({list:(a=[],c.eachCols(function(e,t){t.field&&"normal"==t.type&&a.push('
          • "+(t.fieldTitle||t.title||t.field)+"
          • ").text())+'" lay-filter="LAY_TABLE_TOOL_COLS">')}),a.join("")),done:function(){v.on("checkbox(LAY_TABLE_TOOL_COLS)",function(e){var e=f(e.elem),t=this.checked,a=e.data("key"),i=c.col(a),l=i.hide,e=e.data("parentkey");i.key&&(i.hide=!t,c.elem.find('*[data-key="'+a+'"]')[t?"removeClass":"addClass"](R),l!=i.hide&&c.setParentCol(!t,e),c.resize(),layui.event.call(this,N,"colToggled("+u+")",{col:i,config:s}))})}});break;case"LAYTABLE_EXPORT":if(!l.length)return p.tips("\u5f53\u524d\u8868\u683c\u65e0\u6570\u636e",this,{tips:3});x.ie?p.tips("\u5bfc\u51fa\u529f\u80fd\u4e0d\u652f\u6301 IE\uff0c\u8bf7\u7528 Chrome \u7b49\u9ad8\u7ea7\u6d4f\u89c8\u5668\u5bfc\u51fa",this,{tips:3}):n({list:['
          • \u5bfc\u51fa csv \u683c\u5f0f\u6587\u4ef6
          • ','
          • \u5bfc\u51fa xls \u683c\u5f0f\u6587\u4ef6
          • '].join(""),done:function(e,t){t.on("click",function(){var e=f(this).data("type");k.exportFile.call(c,s.id,null,e)})}});break;case"LAYTABLE_PRINT":if(!l.length)return p.tips("\u5f53\u524d\u8868\u683c\u65e0\u6570\u636e",this,{tips:3});var o=window.open("about:blank","_blank"),d=[""].join(""),r=f(c.layHeader.html());r.append(c.layMain.find("table").html()),r.append(c.layTotal.find("table").html()),r.find("th.layui-table-patch").remove(),r.find("thead>tr>th."+W).filter(function(e,t){return!f(t).children("."+P).length}).remove(),r.find("tbody>tr>td."+W).remove(),o.document.write(d+r.prop("outerHTML")),o.document.close(),layui.device("edg").edg?(o.onafterprint=o.close,o.print()):(o.print(),o.close())}layui.event.call(this,N,"toolbar("+u+")",f.extend({event:t,config:s},{}))}),c.layHeader.on("click","*[lay-event]",function(e){var t=f(this),a=t.attr("lay-event"),t=t.closest("th").data("key"),t=c.col(t);layui.event.call(this,N,"colTool("+u+")",f.extend({event:a,config:s,col:t},{}))}),c.layPagebar.on("click","*[lay-event]",function(e){var t=f(this).attr("lay-event");layui.event.call(this,N,"pagebar("+u+")",f.extend({event:t,config:s},{}))}),e.on("mousemove",function(e){var t=f(this),a=t.offset().left,e=e.clientX-a;t.data("unresize")||w.eventMoveElem||(d.allowResize=t.width()-e<=10,o.css("cursor",d.allowResize?"col-resize":""))}).on("mouseleave",function(){f(this);w.eventMoveElem||o.css("cursor","")}).on("mousedown",function(e){var t,a=f(this);d.allowResize&&(t=a.data("key"),e.preventDefault(),d.offset=[e.clientX,e.clientY],c.cssRules(t,function(e){var t=e.style.width||a.outerWidth();d.rule=e,d.ruleWidth=parseFloat(t),d.minWidth=a.data("minwidth")||s.cellMinWidth,d.maxWidth=a.data("maxwidth")||s.cellMaxWidth}),a.data(S,d),w.eventMoveElem=a)}),w.docEvent||F.on("mousemove",function(e){var t,a;w.eventMoveElem&&(t=w.eventMoveElem.data(S)||{},w.eventMoveElem.data("resizing",1),e.preventDefault(),t.rule)&&(e=t.ruleWidth+e.clientX-t.offset[0],a=w.eventMoveElem.closest("."+D).attr("lay-id"),a=C(a))&&((e=et.maxWidth&&(e=t.maxWidth),t.rule.style.width=e+"px",a.setGroupWidth(w.eventMoveElem),p.close(c.tipsIndex))}).on("mouseup",function(e){var t,a,i,l,n;w.eventMoveElem&&(i=(t=w.eventMoveElem).closest("."+D).attr("lay-id"),a=C(i))&&(i=t.data("key"),l=a.col(i),n=a.config.elem.attr("lay-filter"),d={},o.css("cursor",""),a.scrollPatch(),t.removeData(S),delete w.eventMoveElem,a.cssRules(i,function(e){l.width=parseFloat(e.style.width),layui.event.call(t[0],N,"colResized("+n+")",{col:l,config:a.config})}))}),w.docEvent=!0,e.on("click",function(e){var t=f(this),a=t.find(E),i=a.attr("lay-sort");if(!a[0]||1===t.data("resizing"))return t.removeData("resizing");c.sort({field:t,type:"asc"===i?"desc":"desc"===i?null:"asc",fromEvent:!0})}).find(E+" .layui-edge ").on("click",function(e){var t=f(this),a=t.index(),t=t.parents("th").eq(0).data("field");layui.stope(e),0===a?c.sort({field:t,type:"asc",fromEvent:!0}):c.sort({field:t,type:"desc",fromEvent:!0})}),c.commonMember=function(e){var a=f(this).parents("tr").eq(0).data("index"),t=c.layBody.find('tr[data-index="'+a+'"]'),i=(k.cache[c.key]||[])[a]||{},l={tr:t,config:s,data:k.clearCacheKey(i),dataCache:i,index:a,del:function(){k.cache[c.key][a]=[],t.remove(),c.scrollPatch()},update:function(e,t){c.updateRow({index:a,data:e=e||{},related:t},function(e,t){l.data[e]=t})},setRowChecked:function(e){c.setRowChecked(f.extend({index:a},e))}};return f.extend(l,e)}),a=(c.elem.on("click",'input[name="layTableCheckbox"]+',function(e){var t=f(this),a=t.closest("td"),t=t.prev(),i=(c.layBody.find('input[name="layTableCheckbox"]'),t.parents("tr").eq(0).data("index")),l=t[0].checked,n="layTableAllChoose"===t.attr("lay-filter");t[0].disabled||(n?c.setRowChecked({index:"all",checked:l}):(c.setRowChecked({index:i,checked:l}),layui.stope(e)),layui.event.call(t[0],N,"checkbox("+u+")",r.call(t[0],{checked:l,type:n?"all":"one",getCol:function(){return c.col(a.data("key"))}})))}),c.elem.on("click",'input[lay-type="layTableRadio"]+',function(e){var t=f(this),a=t.closest("td"),t=t.prev(),i=t[0].checked,l=t.parents("tr").eq(0).data("index");if(layui.stope(e),t[0].disabled)return!1;c.setRowChecked({type:"radio",index:l}),layui.event.call(t[0],N,"radio("+u+")",r.call(t[0],{checked:i,getCol:function(){return c.col(a.data("key"))}}))}),c.layBody.on("mouseenter","tr",function(){var e=f(this),t=e.index();e.data("off")||c.layBody.find("tr:eq("+t+")").addClass(M)}).on("mouseleave","tr",function(){var e=f(this),t=e.index();e.data("off")||c.layBody.find("tr:eq("+t+")").removeClass(M)}).on("click","tr",function(e){var t=[".layui-form-checkbox",".layui-form-switch",".layui-form-radio","[lay-unrow]"].join(",");f(e.target).is(t)||f(e.target).closest(t)[0]||a.call(this,"row")}).on("dblclick","tr",function(){a.call(this,"rowDouble")}).on("contextmenu","tr",function(e){s.defaultContextmenu||e.preventDefault(),a.call(this,"rowContextmenu")}),function(e){var t=f(this);t.data("off")||layui.event.call(this,N,e+"("+u+")",r.call(t.children("td")[0]))}),n=function(e,t){var a,i,l;(e=f(e)).data("off")||(l=e.data("field"),i=e.data("key"),i=c.col(i),a=e.closest("tr").data("index"),a=k.cache[c.key][a],e.children(y),(i="function"==typeof i.edit?i.edit(a):i.edit)&&((i=f("textarea"===i?'':''))[0].value=(l=e.data("content")||a[l])===undefined||null===l?"":l,e.find("."+_)[0]||e.append(i),i.focus(),t)&&layui.stope(t))},i=(c.layBody.on("change","."+_,function(){var e=f(this),t=e.parent(),a=this.value,i=e.parent().data("field"),e=e.closest("tr").data("index"),e=k.cache[c.key][e],l=r.call(t[0],{value:a,field:i,oldValue:e[i],td:t,reedit:function(){setTimeout(function(){n(l.td);var e={};e[i]=l.oldValue,l.update(e)})},getCol:function(){return c.col(t.data("key"))}}),e={};e[i]=a,l.update(e),layui.event.call(t[0],N,"edit("+u+")",l)}).on("blur","."+_,function(){f(this).remove()}),c.layBody.on(s.editTrigger,"td",function(e){n(this,e)}).on("mouseenter","td",function(){t.call(this)}).on("mouseleave","td",function(){t.call(this,"hide")}),c.layTotal.on("mouseenter","td",function(){t.call(this)}).on("mouseleave","td",function(){t.call(this,"hide")}),"layui-table-grid-down"),t=function(e){var t=f(this),a=t.children(y);t.data("off")||t.parent().hasClass(H)||(e?t.find(".layui-table-grid-down").remove():!(a.prop("scrollWidth")>a.outerWidth()||0'))},l=function(e,t){var a=f(this),i=a.parent(),l=i.data("key"),n=c.col(l),o=i.parent().data("index"),d=i.children(y),i="layui-table-cell-c",r=f('');"tips"===(t=t||n.expandedMode||s.cellExpandedMode)?c.tipsIndex=p.tips(['
            ',d.html(),"
            ",''].join(""),d[0],{tips:[3,""],time:-1,anim:-1,maxWidth:x.ios||x.android?300:c.elem.width()/2,isOutAnim:!1,skin:"layui-table-tips",success:function(e,t){e.find(".layui-table-tips-c").on("click",function(){p.close(t)})}}):(c.elem.find("."+i).trigger("click"),c.cssRules(l,function(e){var t=e.style.width,a=n.expandedWidth||s.cellExpandedWidth;atr").each(function(i){n.cols[i]=[],f(this).children().each(function(e){var t=f(this),a=t.attr("lay-data"),a=r.options(this,{attr:a?"lay-data":null,errorText:d+(a||t.attr("lay-options"))}),t=f.extend({title:t.text(),colspan:parseInt(t.attr("colspan"))||1,rowspan:parseInt(t.attr("rowspan"))||1},a);n.cols[i].push(t)})}),e.find("tbody>tr")),t=k.render(n);!a.length||o.data||t.config.url||(l=0,k.eachCols(t.config.id,function(e,i){a.each(function(e){n.data[e]=n.data[e]||{};var t=f(this),a=i.field;n.data[e][a]=t.children("td").eq(l).html()}),l++}),t.reloadData({data:n.data}))}),this},w.that={},w.config={},function(a,i,e,l){var n,o;l.colGroup&&(n=0,a++,l.CHILD_COLS=[],o=e+(parseInt(l.rowspan)||1),layui.each(i[o],function(e,t){t.parentKey?t.parentKey===l.key&&(t.PARENT_COL_INDEX=a,l.CHILD_COLS.push(t),c(a,i,o,t)):t.PARENT_COL_INDEX||1<=n&&n==(l.colspan||1)||(t.PARENT_COL_INDEX=a,l.CHILD_COLS.push(t),n+=parseInt(1td').filter('[data-field="'+e+'"]')}}})).replace(/"/g,'""'),n.push(a='"'+a+'"')):t.field&&"normal"!==t.type&&0==i&&(r[t.field]=!0)}),d.push(n.join(","))}),c&&layui.each(c.dataTotal,function(e,t){r[t.field]||i.push('"'+(t.total||"")+'"')}),o.join(",")+"\r\n"+d.join("\r\n")+"\r\n"+i.join(","))),u.download=(a.title||n.title||"table_"+(n.index||""))+"."+l,document.body.appendChild(u),u.click(),document.body.removeChild(u)},k.getOptions=l,k.hideCol=function(e,l){var n=C(e);n&&("boolean"===layui.type(l)?n.eachCols(function(e,t){var a=t.key,i=n.col(a),t=t.parentKey;i.hide!=l&&(i=i.hide=l,n.elem.find('*[data-key="'+a+'"]')[i?"addClass":"removeClass"](R),n.setParentCol(i,t))}):(l=layui.isArray(l)?l:[l],layui.each(l,function(e,l){n.eachCols(function(e,t){var a,i;l.field===t.field&&(a=t.key,i=n.col(a),t=t.parentKey,"hide"in l)&&i.hide!=l.hide&&(i=i.hide=!!l.hide,n.elem.find('*[data-key="'+a+'"]')[i?"addClass":"removeClass"](R),n.setParentCol(i,t))})})),f("."+j).remove(),n.resize())},k.reload=function(e,t,a,i){if(l(e))return(e=C(e)).reload(t,a,i),w.call(e)},k.reloadData=function(){var a=f.extend([],arguments),i=(a[3]="reloadData",new RegExp("^("+["elem","id","cols","width","height","maxHeight","toolbar","defaultToolbar","className","css","pagebar"].join("|")+")$"));return layui.each(a[1],function(e,t){i.test(e)&&delete a[1][e]}),k.reload.apply(null,a)},k.render=function(e){e=new i(e);return w.call(e)},k.clearCacheKey=function(e){return delete(e=f.extend({},e))[k.config.checkName],delete e[k.config.indexName],delete e[k.config.numbersName],delete e[k.config.disabledName],e},f(function(){k.init()}),n(N,k)});layui.define(["table"],function(e){"use strict";var E=layui.$,x=layui.form,B=layui.table,y=layui.hint(),j={config:{},on:B.on,eachCols:B.eachCols,index:B.index,set:function(e){var t=this;return t.config=E.extend({},t.config,e),t},resize:B.resize,getOptions:B.getOptions,hideCol:B.hideCol,renderData:B.renderData},i=function(){var a=this,e=a.config,n=e.id||e.index;return{config:e,reload:function(e,t){a.reload.call(a,e,t)},reloadData:function(e,t){j.reloadData(n,e,t)}}},P=function(e){var t=i.that[e];return t||y.error(e?"The treeTable instance with ID '"+e+"' not found":"ID argument required"),t||null},F="layui-hide",L=".layui-table-main",q=".layui-table-fixed-l",R=".layui-table-fixed-r",l="layui-table-checked",h="layui-table-tree",Y="LAY_DATA_INDEX",m="LAY_DATA_INDEX_HISTORY",s="LAY_PARENT_INDEX",b="LAY_CHECKBOX_HALF",H="LAY_EXPAND",z="LAY_HAS_EXPANDED",X="LAY_ASYNC_STATUS",n=["all","parent","children","none"],t=function(e){var t=this;t.index=++j.index,t.config=E.extend(!0,{},t.config,j.config,e),t.init(),t.render()},f=function(n,i,e){var l=B.cache[n];layui.each(e||l,function(e,t){var a=t[Y]||"";-1!==a.indexOf("-")&&(l[a]=t),t[i]&&f(n,i,t[i])})},d=function(l,a,e){var d=P(l),r=("reloadData"!==e&&(d.status={expand:{}}),E.extend(!0,{},d.getOptions(),a)),n=r.tree,o=n.customName.children,i=n.customName.id,c=(delete a.hasNumberCol,delete a.hasChecboxCol,delete a.hasRadioCol,B.eachCols(null,function(e,t){"numbers"===t.type?a.hasNumberCol=!0:"checkbox"===t.type?a.hasChecboxCol=!0:"radio"===t.type&&(a.hasRadioCol=!0)},r.cols),a.parseData),u=a.done;r.url?e&&(!c||c.mod)||(a.parseData=function(){var e=this,t=arguments,a=t[0],t=("function"===layui.type(c)&&(a=c.apply(e,t)||t[0]),e.response.dataName);return n.data.isSimpleData&&!n["async"].enable&&(a[t]=d.flatToTree(a[t])),p(a[t],function(e){e[H]=H in e?e[H]:e[i]!==undefined&&d.status.expand[e[i]]},o),e.autoSort&&e.initSort&&e.initSort.type&&layui.sort(a[t],e.initSort.field,"desc"===e.initSort.type,!0),d.initData(a[t]),a},a.parseData.mod=!0):(a.data=a.data||[],n.data.isSimpleData&&(a.data=d.flatToTree(a.data)),d.initData(a.data)),e&&(!u||u.mod)||(a.done=function(){var e,t=arguments,a=t[3],n=(a||delete d.isExpandAll,this.elem.next()),i=(d.updateStatus(null,{LAY_HAS_EXPANDED:!1}),f(l,o),n.find('[name="layTableCheckbox"][lay-filter="layTableAllChoose"]'));if(i.length&&(e=j.checkStatus(l),i.prop({checked:e.isAll&&e.data.length,indeterminate:!e.isAll&&e.data.length})),!a&&r.autoSort&&r.initSort&&r.initSort.type&&j.sort(l),d.renderTreeTable(n),"function"===layui.type(u))return u.apply(this,t)},a.done.mod=!0)};t.prototype.init=function(){var e=this.config,t=e.tree.data.cascade,t=(-1===n.indexOf(t)&&(e.tree.data.cascade="all"),B.render(E.extend({},e,{data:[],url:"",done:null}))),a=t.config.id;(i.that[a]=this).tableIns=t,d(a,e)},t.prototype.config={tree:{customName:{children:"children",isParent:"isParent",name:"name",id:"id",pid:"parentId",icon:"icon"},view:{indent:14,flexIconClose:'',flexIconOpen:'',showIcon:!0,icon:"",iconClose:'',iconOpen:'',iconLeaf:'',showFlexIconIfNotParent:!1,dblClickExpand:!0,expandAllDefault:!1},data:{isSimpleData:!1,rootPid:null,cascade:"all"},"async":{enable:!1,url:"",type:null,contentType:null,headers:null,where:null,autoParam:[]},callback:{beforeExpand:null,onExpand:null}}},t.prototype.getOptions=function(){return this.tableIns?B.getOptions(this.tableIns.config.id):this.config},t.prototype.flatToTree=function(e){var a,n,i,t,l,d,r,o=this.getOptions(),c=o.tree,u=c.customName,o=o.id;return e=e||B.cache[o],o=e,a=u.id,n=u.pid,i=u.children,t=c.data.rootPid,a=a||"id",n=n||"parentId",i=i||"children",r={},layui.each(o,function(e,t){l=a+t[a],r[l]=E.extend({},t),r[l][i]=[]}),layui.each(r,function(e,t){(d=a+t[n])&&r[d]&&r[d][i].push(t)}),Object.keys(r).map(function(e){return r[e]}).filter(function(e){return t?e[n]===t:!e[n]})},t.prototype.treeToFlat=function(e,n,i){var l=this,d=l.getOptions().tree.customName,r=d.children,o=d.pid,c=[];return layui.each(e,function(e,t){var e=(i?i+"-":"")+e,a=E.extend({},t);a[o]=t[o]||n,c.push(a),c=c.concat(l.treeToFlat(t[r],t[d.id],e))}),c},t.prototype.getTreeNode=function(e){var t,a,n=this;return e?(a=(t=n.getOptions()).tree,t.id,a.customName,{data:e,dataIndex:e[Y],getParentNode:function(){return n.getNodeByIndex(e[s])}}):y.error("\u627e\u4e0d\u5230\u8282\u70b9\u6570\u636e")},t.prototype.getNodeByIndex=function(t){var a,e,n=this,i=n.getNodeDataByIndex(t);return i?((e=n.getOptions()).tree.customName.parent,a=e.id,(e={data:i,dataIndex:i[Y],getParentNode:function(){return n.getNodeByIndex(i[s])},update:function(e){return j.updateNode(a,t,e)},remove:function(){return j.removeNode(a,t)},expand:function(e){return j.expandNode(a,E.extend({},e,{index:t}))},setChecked:function(e){return j.setRowChecked(a,E.extend({},e,{index:t}))}}).dataIndex=t,e):y.error("\u627e\u4e0d\u5230\u8282\u70b9\u6570\u636e")},t.prototype.getNodeById=function(a){var e=this.getOptions(),n=e.tree.customName.id,i="",e=j.getData(e.id,!0);if(layui.each(e,function(e,t){if(t[n]===a)return i=t[Y],!0}),i)return this.getNodeByIndex(i)},t.prototype.getNodeDataByIndex=function(e,t,a){var n=this.getOptions(),i=n.tree,n=n.id,n=B.cache[n],l=n[e];if("delete"!==a&&l)return E.extend(l,a),t?E.extend({},l):l;for(var d=n,r=String(e).split("-"),o=0,c=i.customName.children;o
            '),N=function(e){y[X]="success",y[s.children]=e,c.initData(y[s.children],y[Y]),U(t,!0,!p&&n,i,l)},C=m.format,"function"===layui.type(C)?C(y,o,N):(I=E.extend({},m.where||o.where),C=m.autoParam,layui.each(C,function(e,t){t=t.split("=");I[t[0].trim()]=y[(t[1]||t[0]).trim()]}),(C=m.contentType||o.contentType)&&0==C.indexOf("application/json")&&(I=JSON.stringify(I)),w=m.method||o.method,D=m.dataType||o.dataType,T=m.jsonpCallback||o.jsonpCallback,k=m.headers||o.headers,_=m.parseData||o.parseData,O=m.response||o.response,E.ajax({type:w||"get",url:b,contentType:C,data:I,dataType:D||"json",jsonpCallback:T,headers:k||{},success:function(e){(e="function"==typeof _?_.call(o,e)||e:e)[O.statusName]!=O.statusCode?(y[X]="error",g.html('')):N(e[O.dataName])},error:function(e,t){y[X]="error","function"==typeof o.error&&o.error(e,t)}})),h;y[z]=!0,v.length&&(!o.initSort||o.url&&!o.autoSort||((m=o.initSort).type?layui.sort(v,m.field,"desc"===m.type,!0):layui.sort(v,B.config.indexName,null,!0)),c.initData(y[s.children],y[Y]),w=B.getTrHtml(r,v,null,null,e),S={trs:E(w.trs.join("")),trs_fixed:E(w.trs_fixed.join("")),trs_fixed_r:E(w.trs_fixed_r.join(""))},A=(e.split("-").length-1||0)+1,layui.each(v,function(e,t){S.trs.eq(e).attr({"data-index":t[Y],"lay-data-index":t[Y],"data-level":A}),S.trs_fixed.eq(e).attr({"data-index":t[Y],"lay-data-index":t[Y],"data-level":A}),S.trs_fixed_r.eq(e).attr({"data-index":t[Y],"lay-data-index":t[Y],"data-level":A})}),d.find(L).find('tbody tr[lay-data-index="'+e+'"]').after(S.trs),d.find(q).find('tbody tr[lay-data-index="'+e+'"]').after(S.trs_fixed),d.find(R).find('tbody tr[lay-data-index="'+e+'"]').after(S.trs_fixed_r),c.renderTreeTable(S.trs,A),n)&&!p&&layui.each(v,function(e,t){U({dataIndex:t[Y],trElem:d.find('tr[lay-data-index="'+t[Y]+'"]').first(),tableViewElem:d,tableId:r,options:o},a,n,i,l)})}else c.isExpandAll=!1,(n&&!p?(layui.each(v,function(e,t){U({dataIndex:t[Y],trElem:d.find('tr[lay-data-index="'+t[Y]+'"]').first(),tableViewElem:d,tableId:r,options:o},a,n,i,l)}),d.find(v.map(function(e,t,a){return'tr[lay-data-index="'+e[Y]+'"]'}).join(","))):(b=c.treeToFlat(v,y[s.id],e),d.find(b.map(function(e,t,a){return'tr[lay-data-index="'+e[Y]+'"]'}).join(",")))).addClass(F);V("resize-"+r,function(){j.resize(r)},0)(),l&&"loading"!==y[X]&&(C=u.callback.onExpand,"function"===layui.type(C))&&C(r,y,x)}return h},g=(j.expandNode=function(e,t){var a,n,i,e=P(e);if(e)return a=(t=t||{}).index,n=t.expandFlag,i=t.inherit,t=t.callbackFlag,e=e.getOptions().elem.next(),U({trElem:e.find('tr[lay-data-index="'+a+'"]').first()},n,i,null,t)},j.expandAll=function(a,e){if("boolean"!==layui.type(e))return y.error("expandAll \u7684\u5c55\u5f00\u72b6\u6001\u53c2\u6570\u53ea\u63a5\u6536true/false");var t=P(a);if(t){t.isExpandAll=e;var n=t.getOptions(),i=n.tree,l=n.elem.next(),d=i.customName.isParent,r=i.customName.id,o=i.view.showFlexIconIfNotParent;if(e){e=j.getData(a,!0);if(i["async"].enable){var c=!0;if(layui.each(e,function(e,t){if(t[d]&&!t[X])return!(c=!1)}),!c)return void layui.each(j.getData(a),function(e,t){j.expandNode(a,{index:t[Y],expandFlag:!0,inherit:!0})})}var u=!0;if(layui.each(e,function(e,t){if(t[d]&&!t[z])return!(u=!1)}),u)t.updateStatus(null,function(e){(e[d]||o)&&(e[H]=!0,e[r]!==undefined)&&(t.status.expand[e[r]]=!0)}),l.find('tbody tr[data-level!="0"]').removeClass(F),l.find(".layui-table-tree-flexIcon").html(i.view.flexIconOpen),i.view.showIcon&&l.find(".layui-table-tree-nodeIcon:not(.layui-table-tree-iconCustom,.layui-table-tree-iconLeaf)").html(i.view.iconOpen);else{if(t.updateStatus(null,function(e){(e[d]||o)&&(e[H]=!0,e[z]=!0,e[r]!==undefined)&&(t.status.expand[e[r]]=!0)}),n.initSort&&n.initSort.type&&n.autoSort)return j.sort(a);var s,n=B.getTrHtml(a,e),f={trs:E(n.trs.join("")),trs_fixed:E(n.trs_fixed.join("")),trs_fixed_r:E(n.trs_fixed_r.join(""))};layui.each(e,function(e,t){var a=t[Y].split("-").length-1;s={"data-index":t[Y],"lay-data-index":t[Y],"data-level":a},f.trs.eq(e).attr(s),f.trs_fixed.eq(e).attr(s),f.trs_fixed_r.eq(e).attr(s)}),layui.each(["main","fixed-l","fixed-r"],function(e,t){l.find(".layui-table-"+t+" tbody").html(f[["trs","trs_fixed","trs_fixed_r"][e]])}),t.renderTreeTable(l,0,!1)}}else t.updateStatus(null,function(e){(e[d]||o)&&(e[H]=!1,e[r]!==undefined)&&(t.status.expand[e[r]]=!1)}),l.find('.layui-table-box tbody tr[data-level!="0"]').addClass(F),l.find(".layui-table-tree-flexIcon").html(i.view.flexIconClose),i.view.showIcon&&l.find(".layui-table-tree-nodeIcon:not(.layui-table-tree-iconCustom,.layui-table-tree-iconLeaf)").html(i.view.iconClose);j.resize(a)}},t.prototype.renderTreeTable=function(e,t,a){var n=this,i=n.getOptions(),l=i.elem.next(),d=(l.hasClass(h)||l.addClass(h),i.id),r=i.tree||{},o=(r.data,r.view||{}),c=r.customName||{},u=c.isParent,s=(l.attr("lay-filter"),n),f=((t=t||0)||(l.find(".layui-table-body tr:not([data-level])").attr("data-level",t),layui.each(B.cache[d],function(e,t){l.find('.layui-table-main tbody tr[data-level="0"]:eq('+e+")").attr("lay-data-index",t[Y]),l.find('.layui-table-fixed-l tbody tr[data-level="0"]:eq('+e+")").attr("lay-data-index",t[Y]),l.find('.layui-table-fixed-r tbody tr[data-level="0"]:eq('+e+")").attr("lay-data-index",t[Y])})),null),y=c.name,p=o.indent||14;if(layui.each(e.find('td[data-field="'+y+'"]'),function(e,t){var a,n,i=(t=E(t)).closest("tr"),t=t.children(".layui-table-cell");t.hasClass("layui-table-tree-item")||(n=i.attr("lay-data-index"))&&(i=l.find('tr[lay-data-index="'+n+'"]'),(a=s.getNodeDataByIndex(n))[H]&&a[u]&&((f=f||{})[n]=!0),a[b]&&i.find('input[type="checkbox"][name="layTableCheckbox"]').prop("indeterminate",!0),n=t.html(),(t=i.find('td[data-field="'+y+'"]>div.layui-table-cell')).addClass("layui-table-tree-item"),t.html(['
            ',a[H]?o.flexIconOpen:o.flexIconClose,"
            ",o.showIcon?'
            '+(a[c.icon]||o.icon||(a[u]?a[H]?o.iconOpen:o.iconClose:o.iconLeaf)||"")+"
            ":"",n].join("")).find(".layui-table-tree-flexIcon").on("click",function(e){layui.stope(e),U({trElem:i},null,null,null,!0)}))}),!t&&r.view.expandAllDefault&&n.isExpandAll===undefined)return j.expandAll(d,!0);(!1!==a&&f?(layui.each(f,function(e,t){e=l.find('tr[lay-data-index="'+e+'"]');e.find(".layui-table-tree-flexIcon").html(o.flexIconOpen),U({trElem:e.first()},!0)}),V("renderTreeTable2-"+d,function(){x.render(E('.layui-table-tree[lay-id="'+d+'"]'))},0)):V("renderTreeTable-"+d,function(){i.hasNumberCol&&g(n),x.render(E('.layui-table-tree[lay-id="'+d+'"]'))},0))()},function(a){var e=a.getOptions(),t=e.elem.next(),n=0,i=t.find(".layui-table-main tbody tr"),l=t.find(".layui-table-fixed-l tbody tr"),d=t.find(".layui-table-fixed-r tbody tr");layui.each(a.treeToFlat(B.cache[e.id]),function(e,t){t.LAY_HIDE||(a.getNodeDataByIndex(t[Y]).LAY_NUM=++n,i.eq(e).find(".laytable-cell-numbers").html(n),l.eq(e).find(".laytable-cell-numbers").html(n),d.eq(e).find(".laytable-cell-numbers").html(n))})}),p=(t.prototype.render=function(e){var t=this;t.tableIns=B["reloadData"===e?"reloadData":"reload"](t.tableIns.config.id,E.extend(!0,{},t.config)),t.config=t.tableIns.config},t.prototype.reload=function(e,t,a){var n=this;e=e||{},delete n.haveInit,layui.each(e,function(e,t){"array"===layui.type(t)&&delete n.config[e]}),d(n.getOptions().id,e,a||!0),n.config=E.extend(t,{},n.config,e),n.render(a)},j.reloadData=function(){var e=E.extend(!0,[],arguments);return e[3]="reloadData",j.reload.apply(null,e)},function(e,a,n,i){var l=[];return layui.each(e,function(e,t){"function"===layui.type(a)?a(t):E.extend(t,a),l.push(E.extend({},t)),i||(l=l.concat(p(t[n],a,n,i)))}),l}),o=(t.prototype.updateStatus=function(e,t,a){var n=this.getOptions(),i=n.tree;return e=e||B.cache[n.id],p(e,t,i.customName.children,a)},t.prototype.getTableData=function(){var e=this.getOptions();return B.cache[e.id]},j.updateStatus=function(e,t,a){var e=P(e),n=e.getOptions();return a=a||(n.url?B.cache[n.id]:n.data),e.updateStatus(a,t)},j.sort=function(e){var t=P(e);t&&t.getOptions().autoSort&&(t.initData(),j.renderData(e))},function(n){var t=n.config.id,i=P(t),a=n.data=j.getNodeDataByIndex(t,n.index),l=a[Y],d=(n.dataIndex=l,n.update);n.update=function(){var e=arguments,t=(E.extend(i.getNodeDataByIndex(l),e[0]),d.apply(this,e)),a=n.config.tree.customName.name;return a in e[0]&&n.tr.find('td[data-field="'+a+'"]').children("div.layui-table-cell").removeClass("layui-table-tree-item"),i.renderTreeTable(n.tr,n.tr.attr("data-level"),!1),t},n.del=function(){j.removeNode(t,a)},n.setRowChecked=function(e){j.setRowChecked(t,{index:a,checked:e})}}),u=(j.updateNode=function(e,a,t){var n,i,l,d,r,o=P(e);o&&((d=o.getOptions()).tree,d=(n=d.elem.next()).find('tr[lay-data-index="'+a+'"]'),i=d.attr("data-index"),l=d.attr("data-level"),t)&&(d=o.getNodeDataByIndex(a,!1,t),r=B.getTrHtml(e,[d]),layui.each(["main","fixed-l","fixed-r"],function(e,t){n.find(".layui-table-"+t+' tbody tr[lay-data-index="'+a+'"]').replaceWith(E(r[["trs","trs_fixed","trs_fixed_r"][e]].join("")).attr({"data-index":i,"lay-data-index":a,"data-level":l}))}),o.renderTreeTable(n.find('tr[lay-data-index="'+a+'"]'),l))},j.removeNode=function(e,t){var a,n,i,l,d,r=P(e);r&&(d=(a=r.getOptions()).tree,n=a.elem.next(),i=[],t=r.getNodeDataByIndex("string"===layui.type(t)?t:t[Y],!1,"delete"),l=r.getNodeDataByIndex(t[s]),r.updateCheckStatus(l),l=r.treeToFlat([t],t[d.customName.pid],t[s]),layui.each(l,function(e,t){i.push('tr[lay-data-index="'+t[Y]+'"]')}),n.find(i.join(",")).remove(),d=r.initData(),layui.each(r.treeToFlat(d),function(e,t){t[m]&&t[m]!==t[Y]&&n.find('tr[lay-data-index="'+t[m]+'"]').attr({"data-index":t[Y],"lay-data-index":t[Y]})}),layui.each(B.cache[e],function(e,t){n.find('tr[data-level="0"][lay-data-index="'+t[Y]+'"]').attr("data-index",e)}),a.hasNumberCol&&g(r),j.resize(e))},j.addNodes=function(e,t){var a=P(e);if(a){var n=a.getOptions(),i=n.tree,l=n.elem.next(),d=B.config.checkName,r=(t=t||{}).parentIndex,o=t.index,c=t.data,t=t.focus,u=(r="number"===layui.type(r)?r.toString():r)?a.getNodeDataByIndex(r):null,o="number"===layui.type(o)?o:-1,c=E.extend(!0,[],layui.isArray(c)?c:[c]);layui.each(c,function(e,t){d in t||!u||(t[d]=u[d])}),a.getTableData();if(u){var s=i.customName.isParent,f=i.customName.children;u[s]=!0;var y=(y=u[f])?(p=y.splice(-1===o?y.length:o),u[f]=y.concat(c,p)):u[f]=c,f=(a.updateStatus(y,function(e){(e[s]||i.view.showFlexIconIfNotParent)&&(e[z]=!1)}),a.treeToFlat(y));l.find(f.map(function(e){return'tr[lay-data-index="'+e[Y]+'"]'}).join(",")).remove(),a.initData(),u[z]=!1,u[X]="local",U({trElem:l.find('tr[lay-data-index="'+r+'"]')},!0)}else{var p=B.cache[e].splice(-1===o?B.cache[e].length:o);if(B.cache[e]=B.cache[e].concat(c,p),n.url||(n.page?(y=n.page,n.data.splice.apply(n.data,[y.limit*(y.curr-1),y.limit].concat(B.cache[e]))):n.data=B.cache[e]),a.initData(),l.find(".layui-none").length)return B.renderData(e),c;var x,f=B.getTrHtml(e,c),h={trs:E(f.trs.join("")),trs_fixed:E(f.trs_fixed.join("")),trs_fixed_r:E(f.trs_fixed_r.join(""))},r=(layui.each(c,function(e,t){x={"data-index":t[Y],"lay-data-index":t[Y],"data-level":"0"},h.trs.eq(e).attr(x),h.trs_fixed.eq(e).attr(x),h.trs_fixed_r.eq(e).attr(x)}),parseInt(c[0][Y])-1),y=l.find(L),n=l.find(q),f=l.find(R);-1==r?(y.find('tr[data-level="0"][data-index="0"]').before(h.trs),n.find('tr[data-level="0"][data-index="0"]').before(h.trs_fixed),f.find('tr[data-level="0"][data-index="0"]').before(h.trs_fixed_r)):-1===o?(y.find("tbody").append(h.trs),n.find("tbody").append(h.trs_fixed),f.find("tbody").append(h.trs_fixed_r)):(r=p[0][m],y.find('tr[data-level="0"][data-index="'+r+'"]').before(h.trs),n.find('tr[data-level="0"][data-index="'+r+'"]').before(h.trs_fixed),f.find('tr[data-level="0"][data-index="'+r+'"]').before(h.trs_fixed_r)),layui.each(B.cache[e],function(e,t){l.find('tr[data-level="0"][lay-data-index="'+t[Y]+'"]').attr("data-index",e)}),a.renderTreeTable(l.find(c.map(function(e,t,a){return'tr[lay-data-index="'+e[Y]+'"]'}).join(",")))}return a.updateCheckStatus(u),j.resize(e),t&&l.find(L).find('tr[lay-data-index="'+c[0][Y]+'"]').get(0).scrollIntoViewIfNeeded(),c}},j.checkStatus=function(e,n){var i,t,a,l=P(e);if(l)return l=l.getOptions().tree,i=B.config.checkName,t=j.getData(e,!0).filter(function(e,t,a){return e[i]||n&&e[b]}),a=!0,layui.each("all"===l.data.cascade?B.cache[e]:j.getData(e,!0),function(e,t){if(!t[i])return!(a=!1)}),{data:t,isAll:a}},j.on("sort",function(e){var e=e.config,t=e.elem.next(),e=e.id;t.hasClass(h)&&j.sort(e)}),j.on("row",function(e){e.config.elem.next().hasClass(h)&&o(e)}),j.on("rowDouble",function(e){var t=e.config,a=t.elem.next();t.id;a.hasClass(h)&&(o(e),(t.tree||{}).view.dblClickExpand)&&U({trElem:e.tr.first()},null,null,null,!0)}),j.on("rowContextmenu",function(e){var t=e.config,a=t.elem.next();t.id;a.hasClass(h)&&o(e)}),j.on("tool",function(e){var t=e.config,a=t.elem.next();t.id;a.hasClass(h)&&o(e)}),j.on("edit",function(e){var t=e.config,a=t.elem.next();t.id;a.hasClass(h)&&(o(e),e.field===t.tree.customName.name)&&((a={})[e.field]=e.value,e.update(a))}),j.on("radio",function(e){var t=e.config,a=t.elem.next(),t=t.id;a.hasClass(h)&&(a=P(t),o(e),u.call(a,e.tr,e.checked))}),t.prototype.setRowCheckedClass=function(e,t){var a=this.getOptions(),n=(e.data("index"),a.elem.next());e[t?"addClass":"removeClass"](l),e.each(function(){var e=E(this).data("index");n.find('.layui-table-fixed-r tbody tr[data-index="'+e+'"]')[t?"addClass":"removeClass"](l)})},t.prototype.updateCheckStatus=function(e,t){var a,n,i,l,d,r,o,c=this,u=c.getOptions();return!!u.hasChecboxCol&&(a=u.tree,n=u.id,i=u.elem.next(),l=B.config.checkName,"all"!==(d=a.data.cascade)&&"parent"!==d||!e||(d=c.updateParentCheckStatus(e,"boolean"===layui.type(t)?t:null),layui.each(d,function(e,t){var a=i.find('tr[lay-data-index="'+t[Y]+'"] input[name="layTableCheckbox"]:not(:disabled)'),n=t[l];c.setRowCheckedClass(a.closest("tr"),n),x.render(a.prop({checked:n,indeterminate:t[b]}))})),o=!(r=!0),e=(e="all"===a.data.cascade?B.cache[n]:j.getData(n,!0)).filter(function(e){return!e[u.disabledName]}),layui.each(e,function(e,t){if((t[l]||t[b])&&(o=!0),t[l]||(r=!1),o&&!r)return!0}),o=o&&!r,x.render(i.find('input[name="layTableCheckbox"][lay-filter="layTableAllChoose"]').prop({checked:r,indeterminate:o})),r)},t.prototype.updateParentCheckStatus=function(a,n){var i,e=this.getOptions(),t=e.tree,e=e.id,l=B.config.checkName,t=t.customName.children,d=[];return!(a[b]=!1)===n?a[t].length?layui.each(a[t],function(e,t){if(!t[l])return n=!1,a[b]=!0}):n=!1:!1===n?layui.each(a[t],function(e,t){if(t[l]||t[b])return a[b]=!0}):(n=!1,i=0,layui.each(a[t],function(e,t){t[l]&&i++}),n=a[t].length?a[t].length===i:a[l],a[b]=!n&&0')),n=(e.tree(a),i.elem=p(i.elem));if(n[0]){if(e.key=i.id||e.index,e.elem=a,e.elemNone=p('
            '+i.text.none+"
            "),n.html(e.elem),0==e.elem.find(".layui-tree-set").length)return e.elem.append(e.elemNone);i.showCheckbox&&e.renderForm("checkbox"),e.elem.find(".layui-tree-set").each(function(){var e=p(this);e.parent(".layui-tree-pack")[0]||e.addClass("layui-tree-setHide"),!e.next()[0]&&e.parents(".layui-tree-pack").eq(1).hasClass("layui-tree-lineExtend")&&e.addClass(T),e.next()[0]||e.parents(".layui-tree-set").eq(0).next()[0]||e.addClass(T)}),e.events()}},l.prototype.renderForm=function(e){i.render(e,"LAY-tree-"+this.index)},l.prototype.tree=function(r,e){var d=this,s=d.config,o=s.customName,e=e||s.data;layui.each(e,function(e,i){var a,n,t=i[o.children]&&0"),c=p(['
            ','
            ','
            ',s.showLine?t?'':'':'',s.showCheckbox?'':"",s.isJump&&i.href?''+(i[o.title]||i.label||s.text.defaultNodeName)+"":''+(i[o.title]||i.label||s.text.defaultNodeName)+"","
            ",s.edit?(a={add:'',update:'',del:''},n=['
            '],!0===s.edit&&(s.edit=["update","del"]),"object"==typeof s.edit?(layui.each(s.edit,function(e,i){n.push(a[i]||"")}),n.join("")+"
            "):void 0):"","
            "].join(""));t&&(c.append(l),d.tree(l,i[o.children])),r.append(c),c.prev("."+k)[0]&&c.prev().children(".layui-tree-pack").addClass("layui-tree-showLine"),t||c.parent(".layui-tree-pack").addClass("layui-tree-lineExtend"),d.spread(c,i),s.showCheckbox&&(i.checked&&d.checkids.push(i[o.id]),d.checkClick(c,i)),s.edit&&d.operate(c,i)})},l.prototype.spread=function(n,t){var l=this,c=l.config,e=n.children("."+b),i=e.children("."+g),a=i.find('input[same="layuiTreeCheck"]'),r=e.find("."+C),e=e.find("."+w),d=c.onlyIconControl?r:i,s="";d.on("click",function(e){var i=n.children("."+N),a=(d.children(".layui-icon")[0]?d:d.find(".layui-tree-icon")).children(".layui-icon");i[0]?n.hasClass(F)?(n.removeClass(F),i.slideUp(200),a.removeClass(x).addClass(v),l.updateFieldValue(t,"spread",!1)):(n.addClass(F),i.slideDown(200),a.addClass(x).removeClass(v),l.updateFieldValue(t,"spread",!0),c.accordion&&((i=n.siblings("."+k)).removeClass(F),i.children("."+N).slideUp(200),i.find(".layui-tree-icon").children(".layui-icon").removeClass(x).addClass(v))):s="normal"}),e.on("click",function(){p(this).hasClass(u)||(s=n.hasClass(F)?c.onlyIconControl?"open":"close":c.onlyIconControl?"close":"open",a[0]&&l.updateFieldValue(t,"checked",a.prop("checked")),c.click&&c.click({elem:n,state:s,data:t}))})},l.prototype.updateFieldValue=function(e,i,a){i in e&&(e[i]=a)},l.prototype.setCheckbox=function(e,i,a){var t,n=this,l=n.config.customName,c=a.prop("checked");a.prop("disabled")||("object"!=typeof i[l.children]&&!e.find("."+N)[0]||e.find("."+N).find('input[same="layuiTreeCheck"]').each(function(e){this.disabled||((e=i[l.children][e])&&n.updateFieldValue(e,"checked",c),n.updateFieldValue(this,"checked",c))}),(t=function(e){var i,a,n;e.parents("."+k)[0]&&(a=(e=e.parent("."+N)).parent(),n=e.prev().find('input[same="layuiTreeCheck"]'),c?n.prop("checked",c):(e.find('input[same="layuiTreeCheck"]').each(function(){this.checked&&(i=!0)}),i||n.prop("checked",!1)),t(a))})(e),n.renderForm("checkbox"))},l.prototype.checkClick=function(a,n){var t=this,l=t.config;a.children("."+b).children("."+g).on("click",'input[same="layuiTreeCheck"]+',function(e){layui.stope(e);var e=p(this).prev(),i=e.prop("checked");e.prop("disabled")||(t.setCheckbox(a,n,e),t.updateFieldValue(n,"checked",i),l.oncheck&&l.oncheck({elem:a,checked:i,data:n}))})},l.prototype.operate=function(r,d){var s=this,o=s.config,u=o.customName,e=r.children("."+b),h=e.children("."+g);e.children(".layui-tree-btnGroup").on("click",".layui-icon",function(e){layui.stope(e);var i,e=p(this).data("type"),n=r.children("."+N),t={data:d,type:e,elem:r};if("add"==e){n[0]||(o.showLine?(h.find("."+C).addClass("layui-tree-icon"),h.find("."+C).children(".layui-icon").addClass(v).removeClass("layui-icon-file")):h.find(".layui-tree-iconArrow").removeClass(m),r.append('
            '));var a,l=o.operate&&o.operate(t),c={};if(c[u.title]=o.text.defaultNodeName,c[u.id]=l,s.tree(r.children("."+N),[c]),o.showLine&&(n[0]?(n.hasClass(S)||n.addClass(S),r.find("."+N).each(function(){p(this).children("."+k).last().addClass(T)}),(n.children("."+k).last().prev().hasClass(T)?n.children("."+k).last().prev():n.children("."+k).last()).removeClass(T),!r.parent("."+N)[0]&&r.next()[0]&&n.children("."+k).last().removeClass(T)):(l=r.siblings("."+k),a=1,c=r.parent("."+N),layui.each(l,function(e,i){p(i).children("."+N)[0]||(a=0)}),(1==a?(l.children("."+N).addClass(L),l.children("."+N).children("."+k).removeClass(T),r.children("."+N).addClass(L),c.removeClass(S),c.children("."+k).last().children("."+N).children("."+k).last()):r.children("."+N).children("."+k)).addClass(T))),!o.showCheckbox)return;h.find('input[same="layuiTreeCheck"]')[0].checked&&(r.children("."+N).children("."+k).last().find('input[same="layuiTreeCheck"]')[0].checked=!0),s.renderForm("checkbox")}else"update"==e?(l=h.children("."+w).html(),h.children("."+w).html(""),h.append(''),h.children(".layui-tree-editInput").val(f.unescape(l)).focus(),i=function(e){var i=e.val().trim()||o.text.defaultNodeName;e.remove(),h.children("."+w).html(i),t.data[u.title]=i,o.operate&&o.operate(t)},h.children(".layui-tree-editInput").blur(function(){i(p(this))}),h.children(".layui-tree-editInput").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),i(p(this)))})):y.confirm('\u786e\u8ba4\u5220\u9664\u8be5\u8282\u70b9 "'+(d[u.title]||"")+'" \u5417\uff1f',function(e){var l,a,i;o.operate&&o.operate(t),t.status="remove",y.close(e),r.prev("."+k)[0]||r.next("."+k)[0]||r.parent("."+N)[0]?(r.siblings("."+k).children("."+b)[0]?(o.showCheckbox&&(l=function(e){var i,a,n,t;e.parents("."+k)[0]&&(i=e.siblings("."+k).children("."+b),a=(e=e.parent("."+N).prev()).find('input[same="layuiTreeCheck"]')[0],n=1,(t=0)==a.checked)&&(i.each(function(e,i){i=p(i).find('input[same="layuiTreeCheck"]')[0];0!=i.checked||i.disabled||(n=0),i.disabled||(t=1)}),1==n)&&1==t&&(a.checked=!0,s.renderForm("checkbox"),l(e.parent("."+k)))})(r),o.showLine&&(e=r.siblings("."+k),a=1,i=r.parent("."+N),layui.each(e,function(e,i){p(i).children("."+N)[0]||(a=0)}),1==a?(n[0]||(i.removeClass(S),e.children("."+N).addClass(L),e.children("."+N).children("."+k).removeClass(T)),(r.next()[0]?i.children("."+k).last():r.prev()).children("."+N).children("."+k).last().addClass(T),r.next()[0]||r.parents("."+k)[1]||r.parents("."+k).eq(0).next()[0]||r.prev("."+k).addClass(T)):!r.next()[0]&&r.hasClass(T)&&r.prev().addClass(T))):(e=r.parent("."+N).prev(),o.showLine?(e.find("."+C).removeClass("layui-tree-icon"),e.find("."+C).children(".layui-icon").removeClass(x).addClass("layui-icon-file"),(i=e.parents("."+N).eq(0)).addClass(S),i.children("."+k).each(function(){p(this).children("."+N).children("."+k).last().addClass(T)})):e.find(".layui-tree-iconArrow").addClass(m),r.parents("."+k).eq(0).removeClass(F),r.parent("."+N).remove()),r.remove()):(r.remove(),s.elem.append(s.elemNone))})})},l.prototype.events=function(){var i=this,t=i.config;i.elem.find(".layui-tree-checkedFirst");i.setChecked(i.checkids),i.elem.find(".layui-tree-search").on("keyup",function(){var e=p(this),a=e.val(),e=e.nextAll(),n=[];e.find("."+w).each(function(){var i,e=p(this).parents("."+b);-1!=p(this).html().indexOf(a)&&(n.push(p(this).parent()),(i=function(e){e.addClass("layui-tree-searchShow"),e.parent("."+N)[0]&&i(e.parent("."+N).parent("."+k))})(e.parent("."+k)))}),e.find("."+b).each(function(){var e=p(this).parent("."+k);e.hasClass("layui-tree-searchShow")||e.addClass(m)}),0==e.find(".layui-tree-searchShow").length&&i.elem.append(i.elemNone),t.onsearch&&t.onsearch({elem:n})}),i.elem.find(".layui-tree-search").on("keydown",function(){p(this).nextAll().find("."+b).each(function(){p(this).parent("."+k).removeClass("layui-tree-searchShow "+m)}),p(".layui-tree-emptyText")[0]&&p(".layui-tree-emptyText").remove()})},l.prototype.getChecked=function(){var t=this,e=t.config,l=e.customName,i=[],a=[],c=(t.elem.find(".layui-form-checked").each(function(){i.push(p(this).prev()[0].value)}),function(e,n){layui.each(e,function(e,a){layui.each(i,function(e,i){if(a[l.id]==i)return t.updateFieldValue(a,"checked",!0),delete(i=p.extend({},a))[l.children],n.push(i),a[l.children]&&(i[l.children]=[],c(a[l.children],i[l.children])),!0})})});return c(p.extend({},e.data),a),a},l.prototype.setChecked=function(l){this.config;this.elem.find("."+k).each(function(e,i){var a=p(this).data("id"),n=p(i).children("."+b).find('input[same="layuiTreeCheck"]'),t=n.next();if("number"==typeof l){if(a.toString()==l.toString())return n[0].checked||t.click(),!1}else"object"==typeof l&&layui.each(l,function(e,i){if(i.toString()==a.toString()&&!n[0].checked)return t.click(),!0})})},n.that={},n.config={},t.reload=function(e,i){e=n.that[e];return e.reload(i),n.call(e)},t.getChecked=function(e){return n.that[e].getChecked()},t.setChecked=function(e,i){return n.that[e].setChecked(i)},t.render=function(e){e=new l(e);return n.call(e)},e(a,t)});layui.define(["laytpl","form"],function(e){"use strict";var d=layui.$,n=layui.laytpl,t=layui.form,a="transfer",i={config:{},index:layui[a]?layui[a].index+1e4:0,set:function(e){var t=this;return t.config=d.extend({},t.config,e),t},on:function(e,t){return layui.onevent.call(this,a,e,t)}},l=function(){var t=this,e=t.config,a=e.id||t.index;return l.that[a]=t,{config:l.config[a]=e,reload:function(e){t.reload.call(t,e)},getData:function(){return t.getData.call(t)}}},s="layui-hide",u="layui-btn-disabled",c="layui-none",r="layui-transfer-box",h="layui-transfer-header",o="layui-transfer-search",f="layui-transfer-data",y=function(e){return['
            ','
            ','","
            ","{{# if(d.data.showSearch){ }}",'","{{# } }}",'
              ',"
              "].join("")},p=['
              ',y({index:0,checkAllName:"layTransferLeftCheckAll"}),'
              ','",'","
              ",y({index:1,checkAllName:"layTransferRightCheckAll"}),"
              "].join(""),v=function(e){var t=this;t.index=++i.index,t.config=d.extend({},t.config,i.config,e),t.render()};v.prototype.config={title:["\u5217\u8868\u4e00","\u5217\u8868\u4e8c"],width:200,height:360,data:[],value:[],showSearch:!1,id:"",text:{none:"\u65e0\u6570\u636e",searchNone:"\u65e0\u5339\u914d\u6570\u636e"}},v.prototype.reload=function(e){var t=this;t.config=d.extend({},t.config,e),t.render()},v.prototype.render=function(){var e=this,t=e.config,a=e.elem=d(n(p,{open:"{{",close:"}}"}).render({data:t,index:e.index})),i=t.elem=d(t.elem);i[0]&&(t.data=t.data||[],t.value=t.value||[],t.id="id"in t?t.id:elem.attr("id")||e.index,e.key=t.id,i.html(e.elem),e.layBox=e.elem.find("."+r),e.layHeader=e.elem.find("."+h),e.laySearch=e.elem.find("."+o),e.layData=a.find("."+f),e.layBtn=a.find(".layui-transfer-active .layui-btn"),e.layBox.css({width:t.width,height:t.height}),e.layData.css({height:(i=t.height-e.layHeader.outerHeight(),t.showSearch&&(i-=e.laySearch.outerHeight()),i-2)}),e.renderData(),e.events())},v.prototype.renderData=function(){var e=this,t=e.config,l=[{checkName:"layTransferLeftCheck",views:[]},{checkName:"layTransferRightCheck",views:[]}];e.parseData(function(a){var i=a.selected?1:0,n=["
            • ",'',"
            • "].join("");i?layui.each(t.value,function(e,t){t==a.value&&a.selected&&(l[i].views[e]=n)}):l[i].views.push(n),delete a.selected}),e.layData.eq(0).html(l[0].views.join("")),e.layData.eq(1).html(l[1].views.join("")),e.renderCheckBtn()},v.prototype.renderForm=function(e){t.render(e,"LAY-transfer-"+this.index)},v.prototype.renderCheckBtn=function(c){var r=this,o=r.config;c=c||{},r.layBox.each(function(e){var t=d(this),a=t.find("."+f),t=t.find("."+h).find('input[type="checkbox"]'),i=a.find('input[type="checkbox"]'),n=0,l=!1;i.each(function(){var e=d(this).data("hide");(this.checked||this.disabled||e)&&n++,this.checked&&!e&&(l=!0)}),t.prop("checked",l&&n===i.length),r.layBtn.eq(e)[l?"removeClass":"addClass"](u),c.stopNone||(i=a.children("li:not(."+s+")").length,r.noneView(a,i?"":o.text.none))}),r.renderForm("checkbox")},v.prototype.noneView=function(e,t){var a=d('

              '+(t||"")+"

              ");e.find("."+c)[0]&&e.find("."+c).remove(),t.replace(/\s/g,"")&&e.append(a)},v.prototype.setValue=function(){var e=this.config,t=[];return this.layBox.eq(1).find("."+f+' input[type="checkbox"]').each(function(){d(this).data("hide")||t.push(this.value)}),e.value=t,this},v.prototype.parseData=function(t){var i=this.config,n=[];return layui.each(i.data,function(e,a){a=("function"==typeof i.parseData?i.parseData(a):a)||a,n.push(a=d.extend({},a)),layui.each(i.value,function(e,t){t==a.value&&(a.selected=!0)}),t&&t(a)}),i.data=n,this},v.prototype.getData=function(e){var t=this.config,i=[];return this.setValue(),layui.each(e||t.value,function(e,a){layui.each(t.data,function(e,t){delete t.selected,a==t.value&&i.push(t)})}),i},v.prototype.transfer=function(e,t){var a,i=this,n=i.config,l=i.layBox.eq(e),c=[],t=(t?((a=(t=t).find('input[type="checkbox"]'))[0].checked=!1,l.siblings("."+r).find("."+f).append(t.clone()),t.remove(),c.push(a[0].value),i.setValue()):l.each(function(e){d(this).find("."+f).children("li").each(function(){var e=d(this),t=e.find('input[type="checkbox"]'),a=t.data("hide");t[0].checked&&!a&&(t[0].checked=!1,l.siblings("."+r).find("."+f).append(e.clone()),e.remove(),c.push(t[0].value)),i.setValue()})}),i.renderCheckBtn(),l.siblings("."+r).find("."+o+" input"));""!==t.val()&&t.trigger("keyup"),n.onchange&&n.onchange(i.getData(c),e)},v.prototype.events=function(){var n=this,l=n.config;n.elem.on("click",'input[lay-filter="layTransferCheckbox"]+',function(){var e=d(this).prev(),t=e[0].checked,a=e.parents("."+r).eq(0).find("."+f);e[0].disabled||("all"===e.attr("lay-type")&&a.find('input[type="checkbox"]').each(function(){this.disabled||(this.checked=t)}),setTimeout(function(){n.renderCheckBtn({stopNone:!0})},0))}),n.elem.on("dblclick","."+f+">li",function(e){var t=d(this),a=t.children('input[type="checkbox"]'),i=t.parent().parent().data("index");a[0].disabled||!1!==("function"==typeof l.dblclick?l.dblclick({elem:t,data:n.getData([a[0].value])[0],index:i}):null)&&n.transfer(i,t)}),n.layBtn.on("click",function(){var e=d(this),t=e.data("index");e.hasClass(u)||n.transfer(t)}),n.laySearch.find("input").on("keyup",function(){var i=this.value,e=d(this).parents("."+o).eq(0).siblings("."+f),t=e.children("li"),t=(t.each(function(){var e=d(this),t=e.find('input[type="checkbox"]'),a=t[0].title,a=("cs"!==l.showSearch&&(a=a.toLowerCase(),i=i.toLowerCase()),-1!==a.indexOf(i));e[a?"removeClass":"addClass"](s),t.data("hide",!a)}),n.renderCheckBtn(),t.length===e.children("li."+s).length);n.noneView(e,t?l.text.searchNone:"")})},l.that={},l.config={},i.reload=function(e,t){e=l.that[e];return e.reload(t),l.call(e)},i.getData=function(e){return l.that[e].getData()},i.render=function(e){e=new v(e);return l.call(e)},e(a,i)});layui.define(["jquery","lay"],function(e){"use strict";var a=layui.$,l=layui.lay,t=(layui.hint(),layui.device(),{config:{},set:function(e){var i=this;return i.config=a.extend({},i.config,e),i},on:function(e,i){return layui.onevent.call(this,d,e,i)}}),d="carousel",r="layui-this",s="layui-carousel-left",u="layui-carousel-right",c="layui-carousel-prev",h="layui-carousel-next",o="layui-carousel-arrow",m="layui-carousel-ind",i=function(e){var i=this;i.config=a.extend({},i.config,t.config,e),i.render()};i.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},i.prototype.render=function(){var e=this,i=e.config,n=a(i.elem);if(1*[carousel-item]>*"),i.index<0&&(i.index=0),i.index>=e.elemItem.length&&(i.index=e.elemItem.length-1),i.interval<800&&(i.interval=800),i.full?i.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):i.elem.css({width:i.width,height:i.height}),i.elem.attr("lay-anim",i.anim),e.elemItem.eq(i.index).addClass(r),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},i.prototype.reload=function(e){var i=this;clearInterval(i.timer),i.config=a.extend({},i.config,e),i.render()},i.prototype.prevIndex=function(){var e=this.config.index-1;return e=e<0?this.elemItem.length-1:e},i.prototype.nextIndex=function(){var e=this.config.index+1;return e=e>=this.elemItem.length?0:e},i.prototype.addIndex=function(e){var i=this.config;i.index=i.index+(e=e||1),i.index>=this.elemItem.length&&(i.index=0)},i.prototype.subIndex=function(e){var i=this.config;i.index=i.index-(e=e||1),i.index<0&&(i.index=this.elemItem.length-1)},i.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(clearInterval(e.timer),e.timer=setInterval(function(){e.slide()},i.interval))},i.prototype.arrow=function(){var i=this,e=i.config,n=a(['",'"].join(""));e.elem.attr("lay-arrow",e.arrow),e.elem.find("."+o)[0]&&e.elem.find("."+o).remove(),e.elem.append(n),n.on("click",function(){var e=a(this).attr("lay-type");i.slide(e)})},i.prototype["goto"]=function(e){var i=this,n=i.config;e>n.index?i.slide("add",e-n.index):e
                ',(i=[],layui.each(e.elemItem,function(e){i.push("")}),i.join("")),"
              "].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+m)[0]&&n.elem.find("."+m).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-t.height()/2),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){e["goto"](a(this).index())})},i.prototype.slide=function(e,i){var n=this,t=n.elemItem,a=n.config,o=a.index,l=a.elem.attr("lay-filter");n.haveSlide||("sub"===e?(n.subIndex(i),t.eq(a.index).addClass(c),setTimeout(function(){t.eq(o).addClass(u),t.eq(a.index).addClass(u)},50)):(n.addIndex(i),t.eq(a.index).addClass(h),setTimeout(function(){t.eq(o).addClass(s),t.eq(a.index).addClass(s)},50)),setTimeout(function(){t.removeClass(r+" "+c+" "+h+" "+s+" "+u),t.eq(a.index).addClass(r),n.haveSlide=!1},350),n.elemInd.find("li").eq(a.index).addClass(r).siblings().removeClass(r),n.haveSlide=!0,e={index:a.index,prevIndex:o,item:t.eq(a.index)},"function"==typeof a.change&&a.change(e),layui.event.call(this,d,"change("+l+")",e))},i.prototype.events=function(){var t,a,o=this,e=o.config;e.elem.data("haveEvents")||(e.elem.on("mouseenter touchstart",function(){"always"!==o.config.autoplay&&clearInterval(o.timer)}).on("mouseleave touchend",function(){"always"!==o.config.autoplay&&o.autoplay()}),t=e.elem,a="updown"===e.anim,l.touchSwipe(t,{onTouchEnd:function(e,i){var n=Date.now()-i.timeStart,i=a?i.distanceY:i.distanceX;(.25t[a?"height":"width"]()/3)&&o.slide(0a.length&&(a.value=a.length),parseInt(a.value)===a.value||a.half||(a.value=Math.ceil(a.value)-a.value<.5?Math.ceil(a.value):Math.floor(a.value)),'
                "),n=1;n<=a.length;n++){var o='
              • ";a.half&&parseInt(a.value)!==a.value&&n==Math.ceil(a.value)?i=i+'
              • ":i+=o}i+="
              "+(a.text?''+a.value+"\u661f":"")+"";var l=a.elem,s=l.next(".layui-rate");s[0]&&s.remove(),e.elemTemp=u(i),a.span=e.elemTemp.next("span"),a.setText&&a.setText(a.value),l.html(e.elemTemp),l.addClass("layui-inline"),a.readonly||e.action()},a.prototype.setvalue=function(e){this.config.value=e,this.render()},a.prototype.action=function(){var n=this.config,t=this.elemTemp,i=t.find("i").width(),l=t.children("li");l.each(function(e){var a=e+1,l=u(this);l.on("click",function(e){n.value=a,n.half&&e.pageX-u(this).offset().left<=i/2&&(n.value=n.value-.5),n.text&&t.next("span").text(n.value+"\u661f"),n.choose&&n.choose(n.value),n.setText&&n.setText(n.value)}),l.on("mousemove",function(e){t.find("i").each(function(){u(this).addClass(h).removeClass(s)}),t.find("i:lt("+a+")").each(function(){u(this).addClass(f).removeClass(v)}),n.half&&e.pageX-u(this).offset().left<=i/2&&l.children("i").addClass(o).removeClass(f)}),l.on("mouseleave",function(){t.find("i").each(function(){u(this).addClass(h).removeClass(s)}),t.find("i:lt("+Math.floor(n.value)+")").each(function(){u(this).addClass(f).removeClass(v)}),n.half&&parseInt(n.value)!==n.value&&t.children("li:eq("+Math.floor(n.value)+")").children("i").addClass(o).removeClass("layui-icon-rate-solid layui-icon-rate")})}),r.touchSwipe(t,{onTouchMove:function(e,a){var i;Date.now()-a.timeStart<=200||(a=e.touches[0].pageX,e=t.width()/n.length,a=(a-t.offset().left)/e,(i=(i=(e=a%1)<=.5&&n.half?.5+(a-e):Math.ceil(a))>n.length?n.length:i)<0&&(i=0),l.each(function(e){var a=u(this).children("i"),l=Math.ceil(i)-e==1,t=Math.ceil(i)>e,e=i-e==.5;t?(a.addClass(f).removeClass(v),n.half&&e&&a.addClass(o).removeClass(f)):a.addClass(h).removeClass(s),a.toggleClass("layui-rate-hover",l)}),n.value=i,n.text&&t.next("span").text(n.value+"\u661f"),n.setText&&n.setText(n.value))},onTouchEnd:function(e,a){Date.now()-a.timeStart<=200||(t.find("i").removeClass("layui-rate-hover"),n.choose&&n.choose(n.value),n.setText&&n.setText(n.value))}})},a.prototype.events=function(){},c.render=function(e){e=new a(e);return function(){var a=this;return{setvalue:function(e){a.setvalue.call(a,e)},config:a.config}}.call(e)},e(l,c)});layui.define("jquery",function(l){"use strict";var g=layui.$,e=function(l){};e.prototype.load=function(l){var t,i,o,n,e,r,a,c,m,s,u,f,y,d=this,p=0,h=g((l=l||{}).elem);if(h[0])return e=g(l.scrollElem||document),r=l.mb||50,a=!("isAuto"in l)||l.isAuto,c=l.end||"\u6ca1\u6709\u66f4\u591a\u4e86",m=l.scrollElem&&l.scrollElem!==document,u=g('"),h.find(".layui-flow-more")[0]||h.append(u),f=function(l,e){l=g(l),u.before(l),(e=0==e||null)?u.html(c):u.find("a").html(s),i=e,t=null,o&&o()},(y=function(){t=!0,u.find("a").html(''),"function"==typeof l.done&&l.done(++p,f)})(),u.find("a").on("click",function(){g(this);i||t||y()}),l.isLazyimg&&(o=d.lazyimg({elem:l.elem+" img",scrollElem:l.scrollElem})),a&&e.on("scroll",function(){var e=g(this),o=e.scrollTop();n&&clearTimeout(n),!i&&h.width()&&(n=setTimeout(function(){var l=(m?e:g(window)).height();(m?e.prop("scrollHeight"):document.documentElement.scrollHeight)-o-l<=r&&(t||y())},100))}),d},e.prototype.lazyimg=function(l){var e,c=this,m=0,s=g((l=l||{}).scrollElem||document),u=l.elem||"img",f=l.scrollElem&&l.scrollElem!==document,y=function(e,l){var o,t=s.scrollTop(),l=t+l,i=f?e.offset().top-s.offset().top+t:e.offset().top;t<=i&&i<=l&&e.attr("lay-src")&&(o=e.attr("lay-src"),layui.img(o,function(){var l=c.lazyimg.elem.eq(m);e.attr("src",o).removeAttr("lay-src"),l[0]&&n(l),m++},function(){c.lazyimg.elem.eq(m);e.removeAttr("lay-src")}))},n=function(l,e){var o=(f?e||s:g(window)).height(),t=s.scrollTop(),i=t+o;if(c.lazyimg.elem=g(u),l)y(l,o);else for(var n=0;n"),preview:"Preview"},wordWrap:!0,lang:"text",highlighter:!1,langMarker:!1},W=layui.code?layui.code.index+1e4:0,R=function(e){return String(e).replace(/\s+$/,"").replace(/^\n|\n$/,"")};e("code",function(l,e){var o,i,t,a,n,d,c,s,r,u,y,p,E,f,h,v,m,L,_,M,C,g={config:l=x.extend(!0,{},T,l),reload:function(e){layui.code(this.updateOptions(e))},updateOptions:function(e){return delete(e=e||{}).elem,x.extend(!0,l,e)},reloadCode:function(e){layui.code(this.updateOptions(e),"reloadCode")}},w=x(l.elem);return 1',l.ln?['
              ',D.digit(t+1)+".","
              "].join(""):"",'
              ',e||" ","
              ",""].join("")})}},a=l.code,n=function(e){return"function"==typeof l.codeParse?l.codeParse(e,l):e},"reloadCode"===e?o.children(".layui-code-wrap").html(w(n(a)).html):(d=layui.code.index=++W,o.attr("lay-code-index",d),(M=A.CDDE_DATA_CLASS in o.data())&&o.attr("class",o.data(A.CDDE_DATA_CLASS)||""),M||o.data(A.CDDE_DATA_CLASS,o.attr("class")),c={copy:{className:"file-b",title:["\u590d\u5236\u4ee3\u7801"],event:function(e){var t=D.unescape(n(l.code));lay.clipboard.writeText({text:t,done:function(){N.msg("\u5df2\u590d\u5236",{icon:1})},error:function(){N.msg("\u590d\u5236\u5931\u8d25",{icon:2})}}),"function"==typeof l.onCopy&&l.onCopy(t)}}},function b(){var e=o.parent("."+A.ELEM_PREVIEW),t=e.children("."+A.ELEM_TAB),a=e.children("."+A.ELEM_ITEM+"-preview");return t.remove(),a.remove(),e[0]&&o.unwrap(),b}(),l.preview&&(M="LAY-CODE-DF-"+d,f=l.layout||["code","preview"],s="iframe"===l.preview,E=x('
              '),C=x('
              '),r=x('
              '),_=x('
              '),u=x('
              '),l.id&&E.attr("id",l.id),E.addClass(l.className),C.attr("lay-filter",M),layui.each(f,function(e,t){var a=x('
            • ');0===e&&a.addClass("layui-this"),a.html(l.text[t]),r.append(a)}),x.extend(c,{full:{className:"screen-full",title:["\u6700\u5927\u5316\u663e\u793a","\u8fd8\u539f\u663e\u793a"],event:function(e){var e=e.elem,t=e.closest("."+A.ELEM_PREVIEW),a="layui-icon-"+this.className,i="layui-icon-screen-restore",l=this.title,o=x("html,body"),n="layui-scrollbar-hide";e.hasClass(a)?(t.addClass(A.ELEM_FULL),e.removeClass(a).addClass(i),e.attr("title",l[1]),o.addClass(n)):(t.removeClass(A.ELEM_FULL),e.removeClass(i).addClass(a),e.attr("title",l[0]),o.removeClass(n))}},window:{className:"release",title:["\u5728\u65b0\u7a97\u53e3\u9884\u89c8"],event:function(e){D.openWin({content:n(l.code)})}}}),l.copy&&("array"===layui.type(l.tools)?-1===l.tools.indexOf("copy")&&l.tools.unshift("copy"):l.tools=["copy"]),u.on("click",">i",function(){var e=x(this),t=e.data("type"),e={elem:e,type:t,options:l,rawCode:l.code,finalCode:D.unescape(n(l.code))};c[t]&&"function"==typeof c[t].event&&c[t].event(e),"function"==typeof l.toolsEvent&&l.toolsEvent(e)}),l.addTools&&l.tools&&(l.tools=[].concat(l.tools,l.addTools)),layui.each(l.tools,function(e,t){var a="object"==typeof t,i=a?t:c[t]||{className:t,title:[t]},l=i.className||i.type,o=i.title||[""],a=a?i.type||l:t;a&&(c[a]||((t={})[a]=i,x.extend(c,t)),u.append(''))}),o.addClass(A.ELEM_ITEM).wrap(E),C.append(r),l.tools&&C.append(u),o.before(C),s&&_.html(''),y=function(e){var t=e.children("iframe")[0];s&&t?t.srcdoc=n(l.code):e.html(l.code),setTimeout(function(){"function"==typeof l.done&&l.done({container:e,options:l,render:function(){I.render(e.find(".layui-form")),S.render()}})},3)},"preview"===f[0]?(_.addClass(A.ELEM_SHOW),o.before(_),y(_)):o.addClass(A.ELEM_SHOW).after(_),l.previewStyle=[l.style,l.previewStyle].join(""),_.attr("style",l.previewStyle),S.on("tab("+M+")",function(e){var t=x(this),a=x(e.elem).closest("."+A.ELEM_PREVIEW).find("."+A.ELEM_ITEM),e=a.eq(e.index);a.removeClass(A.ELEM_SHOW),e.addClass(A.ELEM_SHOW),"preview"===t.attr("lay-id")&&y(e),L()})),p=x(''),o.addClass((E=["layui-code-view layui-border-box"],l.wordWrap||E.push("layui-code-nowrap"),E.join(" "))),(C=l.theme||l.skin)&&(o.removeClass("layui-code-theme-dark layui-code-theme-light"),o.addClass("layui-code-theme-"+C)),l.highlighter&&o.addClass([l.highlighter,"language-"+l.lang,"layui-code-hl"].join(" ")),f=w(l.encode?D.escape(n(a)):a),h=f.lines,o.html(p.html(f.html)),l.ln&&o.append('
              '),l.height&&p.css("max-height",l.height),l.codeStyle=[l.style,l.codeStyle].join(""),l.codeStyle&&p.attr("style",function(e,t){return(t||"")+l.codeStyle}),v=[{selector:">.layui-code-wrap>.layui-code-line{}",setValue:function(e,t){e.style["padding-left"]=t+"px"}},{selector:">.layui-code-wrap>.layui-code-line>.layui-code-line-number{}",setValue:function(e,t){e.style.width=t+"px"}},{selector:">.layui-code-ln-side{}",setValue:function(e,t){e.style.width=t+"px"}}],m=lay.style({target:o[0],id:"DF-code-"+d,text:x.map(x.map(v,function(e){return e.selector}),function(e,t){return['.layui-code-view[lay-code-index="'+d+'"]',e].join(" ")}).join("")}),L=function b(){var e,i;return l.ln&&(e=Math.floor(h.length/100),i=p.children("."+A.ELEM_LINE).last().children("."+A.ELEM_LINE_NUM).outerWidth(),o.addClass(A.ELEM_LN_MODE),e)&&A.LINE_RAW_WIDTH
            • ')).html(l.title||l.text.code),o.prepend(_)),M=x('
              '),l.copy&&!l.preview&&((C=x(['','',""].join(""))).on("click",function(){c.copy.event()}),M.append(C)),l.langMarker&&M.append(''+l.lang+""),l.about&&M.append(l.about),o.append(M),l.preview||setTimeout(function(){"function"==typeof l.done&&l.done({})},3),l.elem.length===1+d&&"function"==typeof l.allDone&&l.allDone())),g})}),layui["layui.all"]||layui.addcss("modules/code.css?v=6","skincodecss"); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/css/module/button.css b/src/main/resources/static/component/pear/css/module/button.css index 567cde98..fcc6ba32 100644 --- a/src/main/resources/static/component/pear/css/module/button.css +++ b/src/main/resources/static/component/pear/css/module/button.css @@ -1,173 +1,169 @@ .pear-btn { - display: inline-block; - line-height: 38px; - white-space: nowrap; - cursor: pointer; - text-align: center; - box-sizing: border-box; - outline: none; - transition: 0.1s; - font-weight: 500; - padding: 0 18px; - height: 38px; - font-size: 14px; - background-color: white; - border: 1px solid #dcdfe6; - border-radius: 2px; + display: inline-block; + line-height: 38px; + white-space: nowrap; + cursor: pointer; + text-align: center; + box-sizing: border-box; + outline: none; + transition: 0.1s; + font-weight: 500; + padding: 0 18px; + height: 38px; + font-size: 14px; + background-color: white; + border: 1px solid #dcdfe6; + border-radius: 2px; } .pear-btn i { - font-size: 13px; + font-size: 13px; } .pear-btn:hover { - opacity: .8; - filter: alpha(opacity=80); - color: #409eff; - background-color: #ECF5FF; + opacity: .8; + filter: alpha(opacity=80); + color: #409eff; + background-color: #ECF5FF; } .pear-btn-danger, .pear-btn-warming, .pear-btn-success, .pear-btn-primary { - height: 37px; - line-height: 37px; - color: #fff !important + height: 37px; + line-height: 37px; + color: #fff !important } /** Button 主题 */ .pear-btn-primary { - border: #2D8CF0; - background-color: #2D8CF0 !important; + border: 1px solid #2D8CF0; + background-color: #2D8CF0 !important; } .pear-btn-danger { - border: #f56c6c; - background-color: #f56c6c !important; + border: 1px solid #f56c6c; + background-color: #f56c6c !important; } .pear-btn-warming { - border: #f6ad55; - background-color: #f6ad55 !important; + border: 1px solid #f6ad55; + background-color: #f6ad55 !important; } .pear-btn-success { - border: #36b368; - background-color: #36b368 !important; + border: 1px solid #36b368; + background-color: #36b368 !important; } .pear-btn[round] { - border-radius: 50px; + border-radius: 50px; } .pear-btn-primary[plain] { - border: #409eff !important; - color: #409eff !important; - background: #ecf5ff 10% !important; + color: #409eff !important; + background: #ecf5ff 10% !important; } .pear-btn-primary[plain]:hover { - color: #fff !important; - background-color: #2d8cf0!important + color: #fff !important; + background-color: #2d8cf0!important } .pear-btn-success[plain] { - border: #36b368 !important; - color: #36b368 !important; - background: #f0f9eb !important; + color: #36b368 !important; + background: #f0f9eb !important; } .pear-btn-success[plain]:hover { - color: white !important; - background-color: #36b368 !important + color: white !important; + background-color: #36b368 !important } .pear-btn-warming[plain] { - border: #e6a23c !important; - color: #e6a23c !important; - background: #fdf6ec !important; + color: #e6a23c !important; + background: #fdf6ec !important; } .pear-btn-warming[plain]:hover { - color: white !important; - background-color: #e6a23c !important + color: white !important; + background-color: #e6a23c !important } .pear-btn-danger[plain] { - border: #f56c6c !important; - color: #f56c6c !important; - background: #fef0f0 !important; + color: #f56c6c !important; + background: #fef0f0 !important; } .pear-btn-danger[plain]:hover { - color: white !important; - background-color: #f56c6c !important + color: white !important; + background-color: #f56c6c !important } /** Button Group */ .pear-btn-group { - display: inline-block; - vertical-align: middle; + display: inline-block; + vertical-align: middle; } .pear-btn-group .pear-btn { - float: left; - position: relative; - border-radius: 0px; - margin-left: 1px; - margin-right: 1px; + float: left; + position: relative; + border-radius: 0px; + margin-left: 1px; + margin-right: 1px; } .pear-btn-md { - height: 34px; - line-height: 34px; - padding: 0 10px; - font-size: 12.5px; + height: 34px; + line-height: 34px; + padding: 0 10px; + font-size: 12.5px; } .pear-btn-group .pear-btn:first-child { - border-top-left-radius: 4px !important; - border-bottom-left-radius: 4px !important; + border-top-left-radius: 4px !important; + border-bottom-left-radius: 4px !important; } .pear-btn-group .pear-btn:last-child { - border-top-right-radius: 4px !important; - border-bottom-right-radius: 4px !important; + border-top-right-radius: 4px !important; + border-bottom-right-radius: 4px !important; } .pear-btn-group .pear-btn[round]:first-child { - border-top-left-radius: 50px !important; - border-bottom-left-radius: 50px !important; + border-top-left-radius: 50px !important; + border-bottom-left-radius: 50px !important; } .pear-btn-group .pear-btn[round]:last-child { - border-top-right-radius: 50px !important; - border-bottom-right-radius: 50px !important; + border-top-right-radius: 50px !important; + border-bottom-right-radius: 50px !important; } /** Button Size*/ .pear-btn-sm { - height: 32px; - line-height: 32px; - padding: 0 10px; - font-size: 12px; + height: 32px; + line-height: 32px; + padding: 0 10px; + font-size: 12px; } .pear-btn-xs { - height: 28px; - line-height: 28px; - padding: 0 8px; - font-size: 12px; + height: 28px; + line-height: 28px; + padding: 0 8px; + font-size: 12px; } .pear-btn-md { - height: 34px; - line-height: 34px; - padding: 0 10px; - font-size: 12.5px; + height: 34px; + line-height: 34px; + padding: 0 10px; + font-size: 12.5px; } .pear-btn-lg { - height: 44px; - line-height: 44px; - padding: 0 25px; - font-size: 16px; -} \ No newline at end of file + height: 44px; + line-height: 44px; + padding: 0 25px; + font-size: 16px; +} diff --git a/src/main/resources/static/component/pear/css/module/card.css b/src/main/resources/static/component/pear/css/module/card.css index b6990188..39b4ed28 100644 --- a/src/main/resources/static/component/pear/css/module/card.css +++ b/src/main/resources/static/component/pear/css/module/card.css @@ -1,92 +1,90 @@ .project-list-item { - background-color: #fff; - border-radius: 4px; - cursor: pointer; - transition: all .2s; + background-color: #fff; + border-radius: 4px; + cursor: pointer; + transition: all .2s; } .project-list-item:hover { - box-shadow: 2px 0 4px rgba(0, 21, 41, .35); + box-shadow: 2px 0 4px rgba(0, 21, 41, .35); } .project-list-item .project-list-item-cover { - width: 100%; - height: 180px; - display: block; - border-top-left-radius: 4px; - border-top-right-radius: 4px; + width: 100%; + height: 180px; + display: block; + border-top-left-radius: 4px; + border-top-right-radius: 4px; } .project-list-item-body { - padding: 20px; - border: 1px solid #e8e8e8; + padding: 20px; + border: 1px solid #e8e8e8; } -.project-list-item .project-list-item-body > h2 { - font-size: 16px; - color: #333; - margin-bottom: 12px; +.project-list-item .project-list-item-body>h2 { + font-size: 16px; + color: #333; + margin-bottom: 12px; } .project-list-item .project-list-item-text { - height: 40px; - overflow: hidden; - margin-bottom: 12px; + height: 40px; + overflow: hidden; + margin-bottom: 12px; } .project-list-item .project-list-item-desc { - position: relative; + position: relative; } .project-list-item .project-list-item-desc .time { - color: #999; - font-size: 12px; + color: #999; + font-size: 12px; } .project-list-item .project-list-item-desc .ew-head-list { - position: absolute; - right: 0; - top: 0; + position: absolute; + right: 0; + top: 0; } .ew-head-list .ew-head-list-item:first-child { - margin-left: 0; + margin-left: 0; } .ew-head-list .ew-head-list-item { - width: 22px; - height: 22px; - border-radius: 50%; - border: 1px solid #fff; - margin-left: -10px; + width: 22px; + height: 22px; + border-radius: 50%; + border: 1px solid #fff; + margin-left: -10px; } .ew-head-list .ew-head-list-item { - width: 22px; - height: 22px; - border-radius: 50%; - border: 1px solid #fff; - margin-left: -10px; + width: 22px; + height: 22px; + border-radius: 50%; + border: 1px solid #fff; + margin-left: -10px; } .cloud-card-component { - padding: 20px; + padding: 20px; } .cloud-card-component .layui-table-click { - border-radius: 6px !important; + border-radius: 6px!important; } .ew-table-loading { padding: 10px 0; text-align: center; } - .ew-table-loading > i { color: #999; font-size: 30px; } - .ew-table-loading.ew-loading-float { position: absolute; top: 0; diff --git a/src/main/resources/static/component/pear/css/module/code.css b/src/main/resources/static/component/pear/css/module/code.css index 2b42161e..4bde0d3d 100644 --- a/src/main/resources/static/component/pear/css/module/code.css +++ b/src/main/resources/static/component/pear/css/module/code.css @@ -1,11 +1,9 @@ -.layui-colla-content { - padding: 0px; +.layui-colla-content{ + padding: 0px; } - -.layui-code-view { - margin: 0px !important; +.layui-code-view{ + margin: 0px!important; } - -.layui-code-h3 { - display: none !important; +.layui-code-h3{ + display: none!important; } \ No newline at end of file diff --git a/src/main/resources/static/component/pear/css/module/cropper.css b/src/main/resources/static/component/pear/css/module/cropper.css index 2b277b01..2c640426 100644 --- a/src/main/resources/static/component/pear/css/module/cropper.css +++ b/src/main/resources/static/component/pear/css/module/cropper.css @@ -1,272 +1,272 @@ .cropper-container { - position: relative; - overflow: hidden; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - -webkit-tap-highlight-color: transparent; - -webkit-touch-callout: none + position: relative; + overflow: hidden; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none } .cropper-container img { - display: block; - width: 100%; - min-width: 0 !important; - max-width: none !important; - height: 100%; - min-height: 0 !important; - max-height: none !important; - image-orientation: 0deg !important + display: block; + width: 100%; + min-width: 0 !important; + max-width: none !important; + height: 100%; + min-height: 0 !important; + max-height: none !important; + image-orientation: 0deg !important } .cropper-canvas, .cropper-crop-box, .cropper-drag-box, .cropper-modal { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0 + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0 } .cropper-drag-box { - background-color: #fff; - filter: alpha(opacity=0); - opacity: 0 + background-color: #fff; + filter: alpha(opacity=0); + opacity: 0 } .cropper-modal { - background-color: #000; - filter: alpha(opacity=50); - opacity: .5 + background-color: #000; + filter: alpha(opacity=50); + opacity: .5 } .cropper-view-box { - display: block; - width: 100%; - height: 100%; - overflow: hidden; - outline: #69f solid 1px; - outline-color: rgba(102, 153, 255, .75) + display: block; + width: 100%; + height: 100%; + overflow: hidden; + outline: #69f solid 1px; + outline-color: rgba(102, 153, 255, .75) } .cropper-dashed { - position: absolute; - display: block; - filter: alpha(opacity=50); - border: 0 dashed #fff; - opacity: .5 + position: absolute; + display: block; + filter: alpha(opacity=50); + border: 0 dashed #fff; + opacity: .5 } .cropper-dashed.dashed-h { - top: 33.33333333%; - left: 0; - width: 100%; - height: 33.33333333%; - border-top-width: 1px; - border-bottom-width: 1px + top: 33.33333333%; + left: 0; + width: 100%; + height: 33.33333333%; + border-top-width: 1px; + border-bottom-width: 1px } .cropper-dashed.dashed-v { - top: 0; - left: 33.33333333%; - width: 33.33333333%; - height: 100%; - border-right-width: 1px; - border-left-width: 1px + top: 0; + left: 33.33333333%; + width: 33.33333333%; + height: 100%; + border-right-width: 1px; + border-left-width: 1px } .cropper-face, .cropper-line, .cropper-point { - position: absolute; - display: block; - width: 100%; - height: 100%; - filter: alpha(opacity=10); - opacity: .1 + position: absolute; + display: block; + width: 100%; + height: 100%; + filter: alpha(opacity=10); + opacity: .1 } .cropper-face { - top: 0; - left: 0; - cursor: move; - background-color: #fff + top: 0; + left: 0; + cursor: move; + background-color: #fff } .cropper-line { - background-color: #69f + background-color: #69f } .cropper-line.line-e { - top: 0; - right: -3px; - width: 5px; - cursor: e-resize + top: 0; + right: -3px; + width: 5px; + cursor: e-resize } .cropper-line.line-n { - top: -3px; - left: 0; - height: 5px; - cursor: n-resize + top: -3px; + left: 0; + height: 5px; + cursor: n-resize } .cropper-line.line-w { - top: 0; - left: -3px; - width: 5px; - cursor: w-resize + top: 0; + left: -3px; + width: 5px; + cursor: w-resize } .cropper-line.line-s { - bottom: -3px; - left: 0; - height: 5px; - cursor: s-resize + bottom: -3px; + left: 0; + height: 5px; + cursor: s-resize } .cropper-point { - width: 5px; - height: 5px; - background-color: #69f; - filter: alpha(opacity=75); - opacity: .75 + width: 5px; + height: 5px; + background-color: #69f; + filter: alpha(opacity=75); + opacity: .75 } .cropper-point.point-e { - top: 50%; - right: -3px; - margin-top: -3px; - cursor: e-resize + top: 50%; + right: -3px; + margin-top: -3px; + cursor: e-resize } .cropper-point.point-n { - top: -3px; - left: 50%; - margin-left: -3px; - cursor: n-resize + top: -3px; + left: 50%; + margin-left: -3px; + cursor: n-resize } .cropper-point.point-w { - top: 50%; - left: -3px; - margin-top: -3px; - cursor: w-resize + top: 50%; + left: -3px; + margin-top: -3px; + cursor: w-resize } .cropper-point.point-s { - bottom: -3px; - left: 50%; - margin-left: -3px; - cursor: s-resize + bottom: -3px; + left: 50%; + margin-left: -3px; + cursor: s-resize } .cropper-point.point-ne { - top: -3px; - right: -3px; - cursor: ne-resize + top: -3px; + right: -3px; + cursor: ne-resize } .cropper-point.point-nw { - top: -3px; - left: -3px; - cursor: nw-resize + top: -3px; + left: -3px; + cursor: nw-resize } .cropper-point.point-sw { - bottom: -3px; - left: -3px; - cursor: sw-resize + bottom: -3px; + left: -3px; + cursor: sw-resize } .cropper-point.point-se { - right: -3px; - bottom: -3px; - width: 20px; - height: 20px; - cursor: se-resize; - filter: alpha(opacity=100); - opacity: 1 + right: -3px; + bottom: -3px; + width: 20px; + height: 20px; + cursor: se-resize; + filter: alpha(opacity=100); + opacity: 1 } .cropper-point.point-se:before { - position: absolute; - right: -50%; - bottom: -50%; - display: block; - width: 200%; - height: 200%; - content: " "; - background-color: #69f; - filter: alpha(opacity=0); - opacity: 0 + position: absolute; + right: -50%; + bottom: -50%; + display: block; + width: 200%; + height: 200%; + content: " "; + background-color: #69f; + filter: alpha(opacity=0); + opacity: 0 } -@media (min-width: 768px) { - .cropper-point.point-se { - width: 15px; - height: 15px - } +@media (min-width:768px) { + .cropper-point.point-se { + width: 15px; + height: 15px + } } -@media (min-width: 992px) { - .cropper-point.point-se { - width: 10px; - height: 10px - } +@media (min-width:992px) { + .cropper-point.point-se { + width: 10px; + height: 10px + } } -@media (min-width: 1200px) { - .cropper-point.point-se { - width: 5px; - height: 5px; - filter: alpha(opacity=75); - opacity: .75 - } +@media (min-width:1200px) { + .cropper-point.point-se { + width: 5px; + height: 5px; + filter: alpha(opacity=75); + opacity: .75 + } } .cropper-bg { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC) + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC) } .cropper-invisible { - filter: alpha(opacity=0); - opacity: 0 + filter: alpha(opacity=0); + opacity: 0 } .cropper-hide { - position: fixed; - top: 0; - left: 0; - z-index: -1; - width: auto !important; - min-width: 0 !important; - max-width: none !important; - height: auto !important; - min-height: 0 !important; - max-height: none !important; - filter: alpha(opacity=0); - opacity: 0 + position: fixed; + top: 0; + left: 0; + z-index: -1; + width: auto !important; + min-width: 0 !important; + max-width: none !important; + height: auto !important; + min-height: 0 !important; + max-height: none !important; + filter: alpha(opacity=0); + opacity: 0 } .cropper-hidden { - display: none !important + display: none !important } .cropper-move { - cursor: move + cursor: move } .cropper-crop { - cursor: crosshair + cursor: crosshair } .cropper-disabled .cropper-canvas, .cropper-disabled .cropper-face, .cropper-disabled .cropper-line, .cropper-disabled .cropper-point { - cursor: not-allowed + cursor: not-allowed } diff --git a/src/main/resources/static/component/pear/css/module/form.css b/src/main/resources/static/component/pear/css/module/form.css index d0bfb914..b6a8c8d3 100644 --- a/src/main/resources/static/component/pear/css/module/form.css +++ b/src/main/resources/static/component/pear/css/module/form.css @@ -1,28 +1,28 @@ .layui-card-body .layui-form{ - margin-top: 15px; + margin-top: 15px; } input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { - color: #ccc; + color: #ccc; } .layui-input:hover, .layui-textarea:hover, .layui-input:focus, .layui-textarea:focus { - border-color: #eee; + border-color: #eee; } .layui-input:focus, .layui-textarea:focus { - border-color: #5FB878 !important; - box-shadow: 0 0 0 3px #f0f9eb !important; + border-color: #5FB878 !important; + box-shadow: 0 0 0 3px #f0f9eb !important; } .layui-input[success] { - box-shadow: 0px 0px 0px 3px #f0f9eb !important; - border: #5FB878 1px solid!important; + box-shadow: 0px 0px 0px 3px #f0f9eb !important; + border: #5FB878 1px solid!important; } .layui-input[failure], @@ -34,41 +34,41 @@ textarea::-webkit-input-placeholder { .layui-input, .layui-select, .layui-textarea { - border-radius: 4px; - border-color: #eee; - transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; + border-radius: 4px; + border-color: #eee; + transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; } .layui-form-select dl::-webkit-scrollbar { - width: 0px; - height: 0px; + width: 0px; + height: 0px; } .layui-form-select dl::-webkit-scrollbar { - width: 6px; - height: 6px; + width: 6px; + height: 6px; } .layui-form-select dl::-webkit-scrollbar-track { - background: white; - border-radius: 3px; + background: white; + border-radius: 3px; } .layui-form-select dl::-webkit-scrollbar-thumb { - background: #E6E6E6; - border-radius: 3px; + background: #E6E6E6; + border-radius: 3px; } .layui-form-select dl::-webkit-scrollbar-thumb:hover { - background: #E6E6E6; + background: #E6E6E6; } .layui-form-select dl::-webkit-scrollbar-corner { - background: #f6f6f6; + background: #f6f6f6; } /* layui 2.6.9 样式变化 */ .layui-form-select dl dd.layui-this{ - background-color: #F6F6F6; - font-weight: 700; -} \ No newline at end of file + background-color: #F6F6F6; + font-weight: 700; +} diff --git a/src/main/resources/static/component/pear/css/module/frame.css b/src/main/resources/static/component/pear/css/module/frame.css index 96359c5e..09a1423f 100644 --- a/src/main/resources/static/component/pear/css/module/frame.css +++ b/src/main/resources/static/component/pear/css/module/frame.css @@ -1,158 +1,158 @@ .pear-frame { - width: 100%; - height: 100%; - position: relative; - overflow: hidden; + width: 100%; + height: 100%; + position: relative; + overflow: hidden; } .pear-frame .dot { - width: 5px; - height: 24px; - background-color: #5FB878; - margin-top: 8px; - margin-left: 15px; - border-radius: 2px; - display: inline-block; + width: 5px; + height: 24px; + background-color: #5FB878; + margin-top: 8px; + margin-left: 15px; + border-radius: 2px; + display: inline-block; } .pear-frame .title { - position: absolute; - margin-top: 0px; - margin-left: 12px; - color: dimgray; - display: inline-block; - letter-spacing: 2px; + position: absolute; + margin-top: 0px; + margin-left: 12px; + color: dimgray; + display: inline-block; + letter-spacing: 2px; } .pear-frame .pear-frame-title { - height: 40px; - line-height: 40px; - background-color: white; - border: whitesmoke 1px solid; + height: 40px; + line-height: 40px; + background-color: white; + border: whitesmoke 1px solid; } .pear-frame .pear-frame-content { - width: 100%; - height: calc(100% - 0px) !important; + width: 100%; + height: calc(100% - 0px) !important; } .pear-frame-loading { - position: absolute; - display: none; - width: 100%; - height: calc(100% - 0px) !important; - top: 0px; - z-index: 19; - background-color: #fff + position: absolute; + display: none; + width: 100%; + height: calc(100% - 0px) !important; + top: 0px; + z-index: 19; + background-color: #fff } .pear-frame-loading.close { - animation: close 1s; - -webkit-animation: close 1s; - animation-fill-mode: forwards; + animation: close 1s; + -webkit-animation: close 1s; + animation-fill-mode: forwards; } .ball-loader { - position: absolute; - left: 50%; - top: 50%; - transform: translate(-50%, -50%); - -ms-transform: translate(-50%, -50%); - -webkit-transform: translate(-50%, -50%) + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); + -webkit-transform: translate(-50%, -50%) } .ball-loader>span, .signal-loader>span { - background-color: #4aca85; - display: inline-block + background-color: #4aca85; + display: inline-block } .ball-loader>span:nth-child(1), .ball-loader.sm>span:nth-child(1), .signal-loader>span:nth-child(1), .signal-loader.sm>span:nth-child(1) { - -webkit-animation-delay: 0s; - animation-delay: 0s + -webkit-animation-delay: 0s; + animation-delay: 0s } .ball-loader>span:nth-child(2), .ball-loader.sm>span:nth-child(2), .signal-loader>span:nth-child(2), .signal-loader.sm>span:nth-child(2) { - -webkit-animation-delay: .1s; - animation-delay: .1s + -webkit-animation-delay: .1s; + animation-delay: .1s } .ball-loader>span:nth-child(3), .ball-loader.sm>span:nth-child(3), .signal-loader>span:nth-child(3), .signal-loader.sm>span:nth-child(3) { - -webkit-animation-delay: .15s; - animation-delay: .15s + -webkit-animation-delay: .15s; + animation-delay: .15s } .ball-loader>span:nth-child(4), .ball-loader.sm>span:nth-child(4), .signal-loader>span:nth-child(4), .signal-loader.sm>span:nth-child(4) { - -webkit-animation-delay: .2s; - animation-delay: .2s + -webkit-animation-delay: .2s; + animation-delay: .2s } .ball-loader>span { - width: 20px; - height: 20px; - margin: 0 3px; - border-radius: 50%; - transform: scale(0); - -ms-transform: scale(0); - -webkit-transform: scale(0); - animation: ball-load 1s ease-in-out infinite; - -webkit-animation: 1s ball-load ease-in-out infinite + width: 20px; + height: 20px; + margin: 0 3px; + border-radius: 50%; + transform: scale(0); + -ms-transform: scale(0); + -webkit-transform: scale(0); + animation: ball-load 1s ease-in-out infinite; + -webkit-animation: 1s ball-load ease-in-out infinite } @-webkit-keyframes ball-load { - 0% { - transform: scale(0); - -webkit-transform: scale(0) - } + 0% { + transform: scale(0); + -webkit-transform: scale(0) + } - 50% { - transform: scale(1); - -webkit-transform: scale(1) - } + 50% { + transform: scale(1); + -webkit-transform: scale(1) + } - 100% { - transform: scale(0); - -webkit-transform: scale(0) - } + 100% { + transform: scale(0); + -webkit-transform: scale(0) + } } @keyframes ball-load { - 0% { - transform: scale(0); - -webkit-transform: scale(0) - } + 0% { + transform: scale(0); + -webkit-transform: scale(0) + } - 50% { - transform: scale(1); - -webkit-transform: scale(1) - } + 50% { + transform: scale(1); + -webkit-transform: scale(1) + } - 100% { - transform: scale(0); - -webkit-transform: scale(0) - } + 100% { + transform: scale(0); + -webkit-transform: scale(0) + } } @-webkit-keyframes close { - 0% { - opacity: 1; - /*display: block;*/ - } - - 100% { - opacity: 0; - /*display: none;*/ - } -} \ No newline at end of file + 0% { + opacity: 1; + /*display: block;*/ + } + + 100% { + opacity: 0; + /*display: none;*/ + } +} diff --git a/src/main/resources/static/component/pear/css/module/fullscreen.css b/src/main/resources/static/component/pear/css/module/fullscreen.css new file mode 100644 index 00000000..63f77754 --- /dev/null +++ b/src/main/resources/static/component/pear/css/module/fullscreen.css @@ -0,0 +1,22 @@ +html:-moz-full-screen { + background: grey; +} +html:-webkit-full-screen { + background: grey; + width: 100%; + height: 100%; +} +html:fullscreen{ + background: grey; + width: 100% !important; + height: 100% !important; +} + +:not(:root):fullscreen::backdrop{ + background:whitesmoke; +} + +.pear-full-screen { + width: 100% !important; + height: 100% !important; +} \ No newline at end of file diff --git a/src/main/resources/static/component/pear/css/module/iconPicker.css b/src/main/resources/static/component/pear/css/module/iconPicker.css index 94663fb2..5d80b0b9 100644 --- a/src/main/resources/static/component/pear/css/module/iconPicker.css +++ b/src/main/resources/static/component/pear/css/module/iconPicker.css @@ -1,11 +1,11 @@ .layui-iconpicker { - width: 295px; + width: 295px; } .layui-iconpicker .layui-iconpicker-search .layui-input:focus{ - box-shadow: none!important; + box-shadow: none!important; } .layui-iconpicker-search .layui-icon { - top: 8px; + top: 8px; } \ No newline at end of file diff --git a/src/main/resources/static/component/pear/css/module/layer.css b/src/main/resources/static/component/pear/css/module/layer.css index 31f87abb..0ca669f5 100644 --- a/src/main/resources/static/component/pear/css/module/layer.css +++ b/src/main/resources/static/component/pear/css/module/layer.css @@ -1,324 +1,324 @@ .layui-layer-msg { - border-color: transparent !important; - box-shadow: 2px 0 6px rgb(0 21 41 / 0.05) !important; + border-color: transparent !important; + box-shadow: 2px 0 6px rgb(0 21 41 / 0.04) !important; } /* 扩展动画开始 */ .pear-drawer.layui-layer { - border-radius: 0 !important; - overflow: auto; + border-radius: 0 !important; + overflow: auto; } .pear-drawer.layui-layer.position-absolute { - position: absolute !important; + position: absolute !important; } .pear-drawer-anim, .pear-drawer-anim.layui-anim { - -webkit-animation-duration: .3s; - animation-duration: .3s; - -webkit-animation-timing-function: cubic-bezier(0.7, 0.3, 0.1, 1); - animation-timing-function: cubic-bezier(0.7, 0.3, 0.1, 1); + -webkit-animation-duration: .3s; + animation-duration: .3s; + -webkit-animation-timing-function: cubic-bezier(0.7, 0.3, 0.1, 1); + animation-timing-function: cubic-bezier(0.7, 0.3, 0.1, 1); } /* right to left */ @keyframes layer-rl { - from { - -webkit-transform: translate3d(100%, 0, 0); - -ms-transform: translate3d(100%, 0, 0); - transform: translate3d(100%, 0, 0); - opacity: 1; - - } - - to { - -webkit-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - opacity: 1; - } + from { + -webkit-transform: translate3d(100%, 0, 0); + -ms-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + opacity: 1; + + } + + to { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; + } } @-webkit-keyframes layer-rl { - from { - -webkit-transform: translate3d(100%, 0, 0); - -ms-transform: translate3d(100%, 0, 0); - transform: translate3d(100%, 0, 0); - opacity: 1; - - } - - to { - -webkit-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - opacity: 1; - } + from { + -webkit-transform: translate3d(100%, 0, 0); + -ms-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + opacity: 1; + + } + + to { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; + } } .layer-anim-rl { - -webkit-animation-name: layer-rl; - animation-name: layer-rl; + -webkit-animation-name: layer-rl; + animation-name: layer-rl; } /* right to left close */ @keyframes layer-rl-close { - from { - -webkit-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } - - to { - -webkit-transform: translate3d(100%, 0, 0); - -ms-transform: translate3d(100%, 0, 0); - transform: translate3d(100%, 0, 0); - } + from { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + -webkit-transform: translate3d(100%, 0, 0); + -ms-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + } } @-webkit-keyframes layer-rl-close { - from { - -webkit-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - - } - - to { - -webkit-transform: translate3d(100%, 0, 0); - -ms-transform: translate3d(100%, 0, 0); - transform: translate3d(100%, 0, 0); - } + from { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + + } + + to { + -webkit-transform: translate3d(100%, 0, 0); + -ms-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + } } .layer-anim-rl-close, .layer-anim-rl.layer-anim-close { - -webkit-animation-name: layer-rl-close; - animation-name: layer-rl-close; + -webkit-animation-name: layer-rl-close; + animation-name: layer-rl-close; } /* left to right */ @-webkit-keyframes layer-lr { - from { - -webkit-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - opacity: 1 - } - - to { - -webkit-transform: translate3d(-100%, 0, 0); - -ms-transform: translate3d(-100%, 0, 0); - transform: translate3d(-100%, 0, 0); - opacity: 1 - } + from { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1 + } + + to { + -webkit-transform: translate3d(-100%, 0, 0); + -ms-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + opacity: 1 + } } @keyframes layer-lr { - from { - -webkit-transform: translate3d(-100%, 0, 0); - -ms-transform: translate3d(-100%, 0, 0); - transform: translate3d(-100%, 0, 0); - opacity: 1 - } - - to { - -webkit-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - opacity: 1 - } + from { + -webkit-transform: translate3d(-100%, 0, 0); + -ms-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + opacity: 1 + } + + to { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1 + } } .layer-anim-lr { - -webkit-animation-name: layer-lr; - animation-name: layer-lr + -webkit-animation-name: layer-lr; + animation-name: layer-lr } /* left to right close */ @-webkit-keyframes layer-lr-close { - from { - -webkit-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } - - to { - -webkit-transform: translate3d(-100%, 0, 0); - -ms-transform: translate3d(-100%, 0, 0); - transform: translate3d(-100%, 0, 0); - } + from { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + -webkit-transform: translate3d(-100%, 0, 0); + -ms-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } } @keyframes layer-lr-close { - from { - -webkit-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } - - to { - -webkit-transform: translate3d(-100%, 0, 0); - -ms-transform: translate3d(-100%, 0, 0); - transform: translate3d(-100%, 0, 0); - } + from { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + -webkit-transform: translate3d(-100%, 0, 0); + -ms-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } } .layer-anim-lr-close, .layer-anim-lr.layer-anim-close { - -webkit-animation-name: layer-lr-close; - animation-name: layer-lr-close + -webkit-animation-name: layer-lr-close; + animation-name: layer-lr-close } /* top to bottom */ @-webkit-keyframes layer-tb { - from { - -webkit-transform: translate3d(0, -100%, 0); - -ms-transform: translate3d(0, -100%, 0); - transform: translate3d(0, -100%, 0); - opacity: 1; - animation-timing-function: cubic-bezier(0.7, 0.3, 0.1, 1); - } - - to { - -webkit-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - opacity: 1; - animation-timing-function: cubic-bezier(0.7, 0.3, 0.1, 1); - } + from { + -webkit-transform: translate3d(0, -100%, 0); + -ms-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + opacity: 1; + animation-timing-function: cubic-bezier(0.7, 0.3, 0.1, 1); + } + + to { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; + animation-timing-function: cubic-bezier(0.7, 0.3, 0.1, 1); + } } @keyframes layer-tb { - from { - -webkit-transform: translate3d(0, -100%, 0); - -ms-transform: translate3d(0, -100%, 0); - transform: translate3d(0, -100%, 0); - opacity: 1; - animation-timing-function: cubic-bezier(0.7, 0.3, 0.1, 1); - } - - to { - -webkit-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - opacity: 1; - animation-timing-function: cubic-bezier(0.7, 0.3, 0.1, 1); - } + from { + -webkit-transform: translate3d(0, -100%, 0); + -ms-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + opacity: 1; + animation-timing-function: cubic-bezier(0.7, 0.3, 0.1, 1); + } + + to { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; + animation-timing-function: cubic-bezier(0.7, 0.3, 0.1, 1); + } } .layer-anim-tb { - -webkit-animation-name: layer-tb; - animation-name: layer-tb + -webkit-animation-name: layer-tb; + animation-name: layer-tb } /* top to bottom close */ @-webkit-keyframes layer-tb-close { - from { - -webkit-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } - - to { - -webkit-transform: translate3d(0, -100%, 0); - -ms-transform: translate3d(0, -100%, 0); - transform: translate3d(0, -100%, 0); - } + from { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + -webkit-transform: translate3d(0, -100%, 0); + -ms-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } } @keyframes layer-tb-close { - from { - -webkit-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } - - to { - -webkit-transform: translate3d(0, -100%, 0); - -ms-transform: translate3d(0, -100%, 0); - transform: translate3d(0, -100%, 0); - } + from { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + -webkit-transform: translate3d(0, -100%, 0); + -ms-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } } .layer-anim-tb-close, .layer-anim-tb.layer-anim-close { - -webkit-animation-name: layer-tb-close; - animation-name: layer-tb-close + -webkit-animation-name: layer-tb-close; + animation-name: layer-tb-close } /* bottom to top */ @-webkit-keyframes layer-bt { - from { - -webkit-transform: translate3d(0, 100%, 0); - -ms-transform: translate3d(0, 100%, 0); - transform: translate3d(0, 100%, 0); - opacity: 1 - } - - to { - -webkit-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - opacity: 1 - } + from { + -webkit-transform: translate3d(0, 100%, 0); + -ms-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + opacity: 1 + } + + to { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1 + } } @keyframes layer-bt { - from { - -webkit-transform: translate3d(0, 100%, 0); - -ms-transform: translate3d(0, 100%, 0); - transform: translate3d(0, 100%, 0); - opacity: 1 - } - - to { - -webkit-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - opacity: 1 - } + from { + -webkit-transform: translate3d(0, 100%, 0); + -ms-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + opacity: 1 + } + + to { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1 + } } .layer-anim-bt { - -webkit-animation-name: layer-bt; - animation-name: layer-bt + -webkit-animation-name: layer-bt; + animation-name: layer-bt } /* bottom to top close */ @-webkit-keyframes layer-bt-close { - from { - -webkit-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } - - to { - -webkit-transform: translate3d(0, 100%, 0); - -ms-transform: translate3d(0, 100%, 0); - transform: translate3d(0, 100%, 0); - } + from { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + -webkit-transform: translate3d(0, 100%, 0); + -ms-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } } @keyframes layer-bt-close { - from { - -webkit-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); + from { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); - } + } - to { - -webkit-transform: translate3d(0, 100%, 0); - -ms-transform: translate3d(0, 100%, 0); - transform: translate3d(0, 100%, 0); + to { + -webkit-transform: translate3d(0, 100%, 0); + -ms-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); - } + } } .layer-anim-bt-close, .layer-anim-bt.layer-anim-close { - -webkit-animation-name: layer-bt-close; - animation-name: layer-bt-close + -webkit-animation-name: layer-bt-close; + animation-name: layer-bt-close } /* 扩展动画结束 */ \ No newline at end of file diff --git a/src/main/resources/static/component/pear/css/module/layout.css b/src/main/resources/static/component/pear/css/module/layout.css index f0fbad65..9c4d0822 100644 --- a/src/main/resources/static/component/pear/css/module/layout.css +++ b/src/main/resources/static/component/pear/css/module/layout.css @@ -1,1040 +1,1041 @@ .pear-container { - margin: 10px; - background-color: whitesmoke; + margin: 10px; + background-color: whitesmoke; + width: calc(100vw - 20px); } body::-webkit-scrollbar { - width: 0px; - height: 0px; + width: 0px; + height: 0px; } body::-webkit-scrollbar { - width: 6px; - height: 6px; + width: 6px; + height: 6px; } body::-webkit-scrollbar-track { - background: white; - border-radius: 2px; + background: white; + border-radius: 2px; } body::-webkit-scrollbar-thumb { - background: #E6E6E6; - border-radius: 2px; + background: #E6E6E6; + border-radius: 2px; } body::-webkit-scrollbar-thumb:hover { - background: #E6E6E6; + background: #E6E6E6; } body::-webkit-scrollbar-corner { - background: #f6f6f6; + background: #f6f6f6; } .mainBox::-webkit-scrollbar { - width: 0px; - height: 0px; + width: 0px; + height: 0px; } .mainBox::-webkit-scrollbar { - width: 6px; - height: 6px; + width: 6px; + height: 6px; } .mainBox::-webkit-scrollbar-track { - background: white; - border-radius: 2px; + background: white; + border-radius: 2px; } .mainBox::-webkit-scrollbar-thumb { - background: #E6E6E6; - border-radius: 2px; + background: #E6E6E6; + border-radius: 2px; } .mainBox::-webkit-scrollbar-thumb:hover { - background: #E6E6E6; + background: #E6E6E6; } .mainBox::-webkit-scrollbar-corner { - background: #f6f6f6; + background: #f6f6f6; } .mainBox { - width: 100%; - position: absolute; - top: 0px; - left: 0px; - bottom: 50px; - overflow: auto; + width: 100%; + position: absolute; + top: 0px; + left: 0px; + bottom: 50px; + overflow: auto; } .bottom { - width: 100%; - position: absolute; - bottom: 0px; - left: 0px; - height: 50px; - line-height: 50px; - background-color: #F8F8F8; - border-top: 1px solid #eee; + width: 100%; + position: absolute; + bottom: 0px; + left: 0px; + height: 50px; + line-height: 50px; + background-color: #F8F8F8; + border-top: 1px solid #eee; } .button-container { - position: absolute; - right: 15px; + position: absolute; + right: 15px; } .main-container { - margin: 15px; + margin: 15px; } .main-container .layui-form-item { - margin-bottom: 15px !important; - margin-top: 10px !important; + margin-bottom: 15px !important; + margin-top: 10px !important; } .pear-row::before, .pear-row::after { - content: ""; - display: table; - clear: both; + content: ""; + display: table; + clear: both; } .pear-col { - float: left; - min-height: 1px; + float: left; + min-height: 1px; } .pear-row * { - box-sizing: border-box + box-sizing: border-box } .pear-col-md1 { - width: 4.16%; + width: 4.16%; } .pear-col-md2 { - width: 8.33%; + width: 8.33%; } .pear-col-md3 { - width: 12.5%; + width: 12.5%; } .pear-col-md4 { - width: 16.66%; + width: 16.66%; } .pear-col-md5 { - width: 20.83%; + width: 20.83%; } .pear-col-md6 { - width: 25%; + width: 25%; } .pear-col-md7 { - width: 29.16%; + width: 29.16%; } .pear-col-md8 { - width: 33.33%; + width: 33.33%; } .pear-col-md9 { - width: 37.5%; + width: 37.5%; } .pear-col-md10 { - width: 41.66%; + width: 41.66%; } .pear-col-md11 { - width: 45.83%; + width: 45.83%; } .pear-col-md12 { - width: 50%; + width: 50%; } .pear-col-md13 { - width: 54.16%; + width: 54.16%; } .pear-col-md14 { - width: 58.33%; + width: 58.33%; } .pear-col-md15 { - width: 62.5%; + width: 62.5%; } .pear-col-md16 { - width: 66.66%; + width: 66.66%; } .pear-col-md17 { - width: 70.83%; + width: 70.83%; } .pear-col-md18 { - width: 75%; + width: 75%; } .pear-col-md19 { - width: 79.16%; + width: 79.16%; } .pear-col-md20 { - width: 83.33%; + width: 83.33%; } .pear-col-md21 { - width: 87.5%; + width: 87.5%; } .pear-col-md22 { - width: 91.66%; + width: 91.66%; } .pear-col-md23 { - width: 95.83%; + width: 95.83%; } .pear-col-md24 { - width: 100%; + width: 100%; } -@media all and (min-width: 993px) and (max-width: 1199px) { +@media all and (min-width:993px) and (max-width:1199px) { - .pear-col-md-offset1 { - margin-left: 4.16%; - } + .pear-col-md-offset1 { + margin-left: 4.16%; + } - .pear-col-md-offset2 { - margin-left: 8.33%; - } + .pear-col-md-offset2 { + margin-left: 8.33%; + } - .pear-col-md-offset3 { - margin-left: 12.5%; - } + .pear-col-md-offset3 { + margin-left: 12.5%; + } - .pear-col-md-offset4 { - margin-left: 16.66%; - } + .pear-col-md-offset4 { + margin-left: 16.66%; + } - .pear-col-md-offset5 { - margin-left: 20.83%; - } + .pear-col-md-offset5 { + margin-left: 20.83%; + } - .pear-col-md-offset6 { - margin-left: 25%; - } + .pear-col-md-offset6 { + margin-left: 25%; + } - .pear-col-md-offset7 { - margin-left: 29.16%; - } + .pear-col-md-offset7 { + margin-left: 29.16%; + } - .pear-col-md-offset8 { - margin-left: 33.33%; - } + .pear-col-md-offset8 { + margin-left: 33.33%; + } - .pear-col-md-offset9 { - margin-left: 37.5%; - } + .pear-col-md-offset9 { + margin-left: 37.5%; + } - .pear-col-md-offset10 { - margin-left: 41.66%; - } + .pear-col-md-offset10 { + margin-left: 41.66%; + } - .pear-col-md-offset11 { - margin-left: 45.83%; - } + .pear-col-md-offset11 { + margin-left: 45.83%; + } - .pear-col-md-offset12 { - margin-left: 50%; - } + .pear-col-md-offset12 { + margin-left: 50%; + } - .pear-col-md-offset13 { - margin-left: 54.16%; - } + .pear-col-md-offset13 { + margin-left: 54.16%; + } - .pear-col-md-offset14 { - margin-left: 58.33%; - } + .pear-col-md-offset14 { + margin-left: 58.33%; + } - .pear-col-md-offset15 { - margin-left: 62.5%; - } + .pear-col-md-offset15 { + margin-left: 62.5%; + } - .pear-col-md-offset16 { - margin-left: 66.66%; - } + .pear-col-md-offset16 { + margin-left: 66.66%; + } - .pear-col-md-offset17 { - margin-left: 70.83%; - } + .pear-col-md-offset17 { + margin-left: 70.83%; + } - .pear-col-md-offset18 { - margin-left: 75%; - } + .pear-col-md-offset18 { + margin-left: 75%; + } - .pear-col-md-offset19 { - margin-left: 79.16%; - } + .pear-col-md-offset19 { + margin-left: 79.16%; + } - .pear-col-md-offset20 { - margin-left: 83.33%; - } + .pear-col-md-offset20 { + margin-left: 83.33%; + } - .pear-col-md-offset21 { - margin-left: 87.5%; - } + .pear-col-md-offset21 { + margin-left: 87.5%; + } - .pear-col-md-offset22 { - margin-left: 91.66%; - } + .pear-col-md-offset22 { + margin-left: 91.66%; + } - .pear-col-md-offset23 { - margin-left: 95.83%; - } + .pear-col-md-offset23 { + margin-left: 95.83%; + } - .pear-col-md-offset24 { - margin-left: 100%; - } + .pear-col-md-offset24 { + margin-left: 100%; + } } -@media all and (max-width: 768px) { - .pear-col-xs1 { - width: 4.16%; - } +@media all and (max-width:768px) { + .pear-col-xs1 { + width: 4.16%; + } - .pear-col-xs2 { - width: 8.33%; - } + .pear-col-xs2 { + width: 8.33%; + } - .pear-col-xs3 { - width: 12.5%; - } + .pear-col-xs3 { + width: 12.5%; + } - .pear-col-xs4 { - width: 16.66%; - } + .pear-col-xs4 { + width: 16.66%; + } - .pear-col-xs5 { - width: 20.83%; - } + .pear-col-xs5 { + width: 20.83%; + } - .pear-col-xs6 { - width: 25%; - } + .pear-col-xs6 { + width: 25%; + } - .pear-col-xs7 { - width: 29.16%; - } + .pear-col-xs7 { + width: 29.16%; + } - .pear-col-xs8 { - width: 33.33%; - } + .pear-col-xs8 { + width: 33.33%; + } - .pear-col-xs9 { - width: 37.5%; - } + .pear-col-xs9 { + width: 37.5%; + } - .pear-col-xs10 { - width: 41.66%; - } + .pear-col-xs10 { + width: 41.66%; + } - .pear-col-xs11 { - width: 45.83%; - } + .pear-col-xs11 { + width: 45.83%; + } - .pear-col-xs12 { - width: 50%; - } + .pear-col-xs12 { + width: 50%; + } - .pear-col-xs13 { - width: 54.16%; - } + .pear-col-xs13 { + width: 54.16%; + } - .pear-col-xs14 { - width: 58.33%; - } + .pear-col-xs14 { + width: 58.33%; + } - .pear-col-xs15 { - width: 62.5%; - } + .pear-col-xs15 { + width: 62.5%; + } - .pear-col-xs16 { - width: 66.66%; - } + .pear-col-xs16 { + width: 66.66%; + } - .pear-col-xs17 { - width: 70.83%; - } + .pear-col-xs17 { + width: 70.83%; + } - .pear-col-xs18 { - width: 75%; - } + .pear-col-xs18 { + width: 75%; + } - .pear-col-xs19 { - width: 79.16%; - } + .pear-col-xs19 { + width: 79.16%; + } - .pear-col-xs20 { - width: 83.33%; - } + .pear-col-xs20 { + width: 83.33%; + } - .pear-col-xs21 { - width: 87.5%; - } + .pear-col-xs21 { + width: 87.5%; + } - .pear-col-xs22 { - width: 91.66%; - } + .pear-col-xs22 { + width: 91.66%; + } - .pear-col-xs23 { - width: 95.83%; - } + .pear-col-xs23 { + width: 95.83%; + } - .pear-col-xs24 { - width: 100%; - } + .pear-col-xs24 { + width: 100%; + } - .pear-col-xs-offset1 { - margin-left: 4.16%; - } + .pear-col-xs-offset1 { + margin-left: 4.16%; + } - .pear-col-xs-offset2 { - margin-left: 8.33%; - } + .pear-col-xs-offset2 { + margin-left: 8.33%; + } - .pear-col-xs-offset3 { - margin-left: 12.5%; - } + .pear-col-xs-offset3 { + margin-left: 12.5%; + } - .pear-col-xs-offset4 { - margin-left: 16.66%; - } + .pear-col-xs-offset4 { + margin-left: 16.66%; + } - .pear-col-xs-offset5 { - margin-left: 20.83%; - } + .pear-col-xs-offset5 { + margin-left: 20.83%; + } - .pear-col-xs-offset6 { - margin-left: 25%; - } + .pear-col-xs-offset6 { + margin-left: 25%; + } - .pear-col-xs-offset7 { - margin-left: 29.16%; - } + .pear-col-xs-offset7 { + margin-left: 29.16%; + } - .pear-col-xs-offset8 { - margin-left: 33.33%; - } + .pear-col-xs-offset8 { + margin-left: 33.33%; + } - .pear-col-xs-offset9 { - margin-left: 37.5%; - } + .pear-col-xs-offset9 { + margin-left: 37.5%; + } - .pear-col-xs-offset10 { - margin-left: 41.66%; - } + .pear-col-xs-offset10 { + margin-left: 41.66%; + } - .pear-col-xs-offset11 { - margin-left: 45.83%; - } + .pear-col-xs-offset11 { + margin-left: 45.83%; + } - .pear-col-xs-offset12 { - margin-left: 50%; - } + .pear-col-xs-offset12 { + margin-left: 50%; + } - .pear-col-xs-offset13 { - margin-left: 54.16%; - } + .pear-col-xs-offset13 { + margin-left: 54.16%; + } - .pear-col-xs-offset14 { - margin-left: 58.33%; - } + .pear-col-xs-offset14 { + margin-left: 58.33%; + } - .pear-col-xs-offset15 { - margin-left: 62.5%; - } + .pear-col-xs-offset15 { + margin-left: 62.5%; + } - .pear-col-xs-offset16 { - margin-left: 66.66%; - } + .pear-col-xs-offset16 { + margin-left: 66.66%; + } - .pear-col-xs-offset17 { - margin-left: 70.83%; - } + .pear-col-xs-offset17 { + margin-left: 70.83%; + } - .pear-col-xs-offset18 { - margin-left: 75%; - } + .pear-col-xs-offset18 { + margin-left: 75%; + } - .pear-col-xs-offset19 { - margin-left: 79.16%; - } + .pear-col-xs-offset19 { + margin-left: 79.16%; + } - .pear-col-xs-offset20 { - margin-left: 83.33%; - } + .pear-col-xs-offset20 { + margin-left: 83.33%; + } - .pear-col-xs-offset21 { - margin-left: 87.5%; - } + .pear-col-xs-offset21 { + margin-left: 87.5%; + } - .pear-col-xs-offset22 { - margin-left: 91.66%; - } + .pear-col-xs-offset22 { + margin-left: 91.66%; + } - .pear-col-xs-offset23 { - margin-left: 95.83%; - } + .pear-col-xs-offset23 { + margin-left: 95.83%; + } - .pear-col-xs-offset24 { - margin-left: 100%; - } + .pear-col-xs-offset24 { + margin-left: 100%; + } } -@media all and (min-width: 768px) and (max-width: 992px) { - .pear-col-sm1 { - width: 4.16%; - } +@media all and (min-width:768px) and (max-width:992px) { + .pear-col-sm1 { + width: 4.16%; + } - .pear-col-sm2 { - width: 8.33%; - } + .pear-col-sm2 { + width: 8.33%; + } - .pear-col-sm3 { - width: 12.5%; - } + .pear-col-sm3 { + width: 12.5%; + } - .pear-col-sm4 { - width: 16.66%; - } + .pear-col-sm4 { + width: 16.66%; + } - .pear-col-sm5 { - width: 20.83%; - } + .pear-col-sm5 { + width: 20.83%; + } - .pear-col-sm6 { - width: 25%; - } + .pear-col-sm6 { + width: 25%; + } - .pear-col-sm7 { - width: 29.16%; - } + .pear-col-sm7 { + width: 29.16%; + } - .pear-col-sm8 { - width: 33.33%; - } + .pear-col-sm8 { + width: 33.33%; + } - .pear-col-sm9 { - width: 37.5%; - } + .pear-col-sm9 { + width: 37.5%; + } - .pear-col-sm10 { - width: 41.66%; - } + .pear-col-sm10 { + width: 41.66%; + } - .pear-col-sm11 { - width: 45.83%; - } + .pear-col-sm11 { + width: 45.83%; + } - .pear-col-sm12 { - width: 50%; - } + .pear-col-sm12 { + width: 50%; + } - .pear-col-sm13 { - width: 54.16%; - } + .pear-col-sm13 { + width: 54.16%; + } - .pear-col-sm14 { - width: 58.33%; - } + .pear-col-sm14 { + width: 58.33%; + } - .pear-col-sm15 { - width: 62.5%; - } + .pear-col-sm15 { + width: 62.5%; + } - .pear-col-sm16 { - width: 66.66%; - } + .pear-col-sm16 { + width: 66.66%; + } - .pear-col-sm17 { - width: 70.83%; - } + .pear-col-sm17 { + width: 70.83%; + } - .pear-col-sm18 { - width: 75%; - } + .pear-col-sm18 { + width: 75%; + } - .pear-col-sm19 { - width: 79.16%; - } + .pear-col-sm19 { + width: 79.16%; + } - .pear-col-sm20 { - width: 83.33%; - } + .pear-col-sm20 { + width: 83.33%; + } - .pear-col-sm21 { - width: 87.5%; - } + .pear-col-sm21 { + width: 87.5%; + } - .pear-col-sm22 { - width: 91.66%; - } + .pear-col-sm22 { + width: 91.66%; + } - .pear-col-sm23 { - width: 95.83%; - } + .pear-col-sm23 { + width: 95.83%; + } - .pear-col-sm24 { - width: 100%; - } + .pear-col-sm24 { + width: 100%; + } - .pear-col-sm-offset1 { - margin-left: 4.16%; - } + .pear-col-sm-offset1 { + margin-left: 4.16%; + } - .pear-col-sm-offset2 { - margin-left: 8.33%; - } + .pear-col-sm-offset2 { + margin-left: 8.33%; + } - .pear-col-sm-offset3 { - margin-left: 12.5%; - } + .pear-col-sm-offset3 { + margin-left: 12.5%; + } - .pear-col-sm-offset4 { - margin-left: 16.66%; - } + .pear-col-sm-offset4 { + margin-left: 16.66%; + } - .pear-col-sm-offset5 { - margin-left: 20.83%; - } + .pear-col-sm-offset5 { + margin-left: 20.83%; + } - .pear-col-sm-offset6 { - margin-left: 25%; - } + .pear-col-sm-offset6 { + margin-left: 25%; + } - .pear-col-sm-offset7 { - margin-left: 29.16%; - } + .pear-col-sm-offset7 { + margin-left: 29.16%; + } - .pear-col-sm-offset8 { - margin-left: 33.33%; - } + .pear-col-sm-offset8 { + margin-left: 33.33%; + } - .pear-col-sm-offset9 { - margin-left: 37.5%; - } + .pear-col-sm-offset9 { + margin-left: 37.5%; + } - .pear-col-sm-offset10 { - margin-left: 41.66%; - } + .pear-col-sm-offset10 { + margin-left: 41.66%; + } - .pear-col-sm-offset11 { - margin-left: 45.83%; - } + .pear-col-sm-offset11 { + margin-left: 45.83%; + } - .pear-col-sm-offset12 { - margin-left: 50%; - } + .pear-col-sm-offset12 { + margin-left: 50%; + } - .pear-col-sm-offset13 { - margin-left: 54.16%; - } + .pear-col-sm-offset13 { + margin-left: 54.16%; + } - .pear-col-sm-offset14 { - margin-left: 58.33%; - } + .pear-col-sm-offset14 { + margin-left: 58.33%; + } - .pear-col-sm-offset15 { - margin-left: 62.5%; - } + .pear-col-sm-offset15 { + margin-left: 62.5%; + } - .pear-col-sm-offset16 { - margin-left: 66.66%; - } + .pear-col-sm-offset16 { + margin-left: 66.66%; + } - .pear-col-sm-offset17 { - margin-left: 70.83%; - } + .pear-col-sm-offset17 { + margin-left: 70.83%; + } - .pear-col-sm-offset18 { - margin-left: 75%; - } + .pear-col-sm-offset18 { + margin-left: 75%; + } - .pear-col-sm-offset19 { - margin-left: 79.16%; - } + .pear-col-sm-offset19 { + margin-left: 79.16%; + } - .pear-col-sm-offset20 { - margin-left: 83.33%; - } + .pear-col-sm-offset20 { + margin-left: 83.33%; + } - .pear-col-sm-offset21 { - margin-left: 87.5%; - } + .pear-col-sm-offset21 { + margin-left: 87.5%; + } - .pear-col-sm-offset22 { - margin-left: 91.66%; - } + .pear-col-sm-offset22 { + margin-left: 91.66%; + } - .pear-col-sm-offset23 { - margin-left: 95.83%; - } + .pear-col-sm-offset23 { + margin-left: 95.83%; + } - .pear-col-sm-offset24 { - margin-left: 100%; - } + .pear-col-sm-offset24 { + margin-left: 100%; + } } -@media all and (min-width: 1200px) { - .pear-col-lg1 { - width: 4.16%; - } +@media all and (min-width:1200px) { + .pear-col-lg1 { + width: 4.16%; + } - .pear-col-lg2 { - width: 8.33%; - } + .pear-col-lg2 { + width: 8.33%; + } - .pear-col-lg3 { - width: 12.5%; - } + .pear-col-lg3 { + width: 12.5%; + } - .pear-col-lg4 { - width: 16.66%; - } + .pear-col-lg4 { + width: 16.66%; + } - .pear-col-lg5 { - width: 20.83%; - } + .pear-col-lg5 { + width: 20.83%; + } - .pear-col-lg6 { - width: 25%; - } + .pear-col-lg6 { + width: 25%; + } - .pear-col-lg7 { - width: 29.16%; - } + .pear-col-lg7 { + width: 29.16%; + } - .pear-col-lg8 { - width: 33.33%; - } + .pear-col-lg8 { + width: 33.33%; + } - .pear-col-lg9 { - width: 37.5%; - } + .pear-col-lg9 { + width: 37.5%; + } - .pear-col-lg10 { - width: 41.66%; - } + .pear-col-lg10 { + width: 41.66%; + } - .pear-col-lg11 { - width: 45.83%; - } + .pear-col-lg11 { + width: 45.83%; + } - .pear-col-lg12 { - width: 50%; - } + .pear-col-lg12 { + width: 50%; + } - .pear-col-lg13 { - width: 54.16%; - } + .pear-col-lg13 { + width: 54.16%; + } - .pear-col-lg14 { - width: 58.33%; - } + .pear-col-lg14 { + width: 58.33%; + } - .pear-col-lg15 { - width: 62.5%; - } + .pear-col-lg15 { + width: 62.5%; + } - .pear-col-lg16 { - width: 66.66%; - } + .pear-col-lg16 { + width: 66.66%; + } - .pear-col-lg17 { - width: 70.83%; - } + .pear-col-lg17 { + width: 70.83%; + } - .pear-col-lg18 { - width: 75%; - } + .pear-col-lg18 { + width: 75%; + } - .pear-col-lg19 { - width: 79.16%; - } + .pear-col-lg19 { + width: 79.16%; + } - .pear-col-lg20 { - width: 83.33%; - } + .pear-col-lg20 { + width: 83.33%; + } - .pear-col-lg21 { - width: 87.5%; - } + .pear-col-lg21 { + width: 87.5%; + } - .pear-col-lg22 { - width: 91.66%; - } + .pear-col-lg22 { + width: 91.66%; + } - .pear-col-lg23 { - width: 95.83%; - } + .pear-col-lg23 { + width: 95.83%; + } - .pear-col-lg24 { - width: 100%; - } + .pear-col-lg24 { + width: 100%; + } - .pear-col-lg-offset1 { - margin-left: 4.16%; - } + .pear-col-lg-offset1 { + margin-left: 4.16%; + } - .pear-col-lg-offset2 { - margin-left: 8.33%; - } + .pear-col-lg-offset2 { + margin-left: 8.33%; + } - .pear-col-lg-offset3 { - margin-left: 12.5%; - } + .pear-col-lg-offset3 { + margin-left: 12.5%; + } - .pear-col-lg-offset4 { - margin-left: 16.66%; - } + .pear-col-lg-offset4 { + margin-left: 16.66%; + } - .pear-col-lg-offset5 { - margin-left: 20.83%; - } + .pear-col-lg-offset5 { + margin-left: 20.83%; + } - .pear-col-lg-offset6 { - margin-left: 25%; - } + .pear-col-lg-offset6 { + margin-left: 25%; + } - .pear-col-lg-offset7 { - margin-left: 29.16%; - } + .pear-col-lg-offset7 { + margin-left: 29.16%; + } - .pear-col-lg-offset8 { - margin-left: 33.33%; - } + .pear-col-lg-offset8 { + margin-left: 33.33%; + } - .pear-col-lg-offset9 { - margin-left: 37.5%; - } + .pear-col-lg-offset9 { + margin-left: 37.5%; + } - .pear-col-lg-offset10 { - margin-left: 41.66%; - } + .pear-col-lg-offset10 { + margin-left: 41.66%; + } - .pear-col-lg-offset11 { - margin-left: 45.83%; - } + .pear-col-lg-offset11 { + margin-left: 45.83%; + } - .pear-col-lg-offset12 { - margin-left: 50%; - } + .pear-col-lg-offset12 { + margin-left: 50%; + } - .pear-col-lg-offset13 { - margin-left: 54.16%; - } + .pear-col-lg-offset13 { + margin-left: 54.16%; + } - .pear-col-lg-offset14 { - margin-left: 58.33%; - } + .pear-col-lg-offset14 { + margin-left: 58.33%; + } - .pear-col-lg-offset15 { - margin-left: 62.5%; - } + .pear-col-lg-offset15 { + margin-left: 62.5%; + } - .pear-col-lg-offset16 { - margin-left: 66.66%; - } + .pear-col-lg-offset16 { + margin-left: 66.66%; + } - .pear-col-lg-offset17 { - margin-left: 70.83%; - } + .pear-col-lg-offset17 { + margin-left: 70.83%; + } - .pear-col-lg-offset18 { - margin-left: 75%; - } + .pear-col-lg-offset18 { + margin-left: 75%; + } - .pear-col-lg-offset19 { - margin-left: 79.16%; - } + .pear-col-lg-offset19 { + margin-left: 79.16%; + } - .pear-col-lg-offset20 { - margin-left: 83.33%; - } + .pear-col-lg-offset20 { + margin-left: 83.33%; + } - .pear-col-lg-offset21 { - margin-left: 87.5%; - } + .pear-col-lg-offset21 { + margin-left: 87.5%; + } - .pear-col-lg-offset22 { - margin-left: 91.66%; - } + .pear-col-lg-offset22 { + margin-left: 91.66%; + } - .pear-col-lg-offset23 { - margin-left: 95.83%; - } + .pear-col-lg-offset23 { + margin-left: 95.83%; + } - .pear-col-lg-offset24 { - margin-left: 100%; - } + .pear-col-lg-offset24 { + margin-left: 100%; + } } .pear-col-space1 { - margin: -.5px + margin: -.5px } -.pear-col-space1 > * { - padding: .5px +.pear-col-space1>* { + padding: .5px } .pear-col-space2 { - margin: -1px + margin: -1px } -.pear-col-space2 > * { - padding: 1px +.pear-col-space2>* { + padding: 1px } .pear-col-space4 { - margin: -2px + margin: -2px } -.pear-col-space4 > * { - padding: 2px +.pear-col-space4>* { + padding: 2px } .pear-col-space5 { - margin: -2.5px + margin: -2.5px } -.pear-col-space5 > * { - padding: 2.5px +.pear-col-space5>* { + padding: 2.5px } .pear-col-space6 { - margin: -3px + margin: -3px } -.pear-col-space6 > * { - padding: 3px +.pear-col-space6>* { + padding: 3px } .pear-col-space8 { - margin: -4px + margin: -4px } -.pear-col-space8 > * { - padding: 4px +.pear-col-space8>* { + padding: 4px } .pear-col-space10 { - margin: -5px + margin: -5px } -.pear-col-space10 > * { - padding: 5px +.pear-col-space10>* { + padding: 5px } .pear-col-space12 { - margin: -6px + margin: -6px } -.pear-col-space12 > * { - padding: 6px +.pear-col-space12>* { + padding: 6px } .pear-col-space14 { - margin: -7px + margin: -7px } -.pear-col-space14 > * { - padding: 7px +.pear-col-space14>* { + padding: 7px } .pear-col-space15 { - margin: -7.5px + margin: -7.5px } -.pear-col-space15 > * { - padding: 7.5px +.pear-col-space15>* { + padding: 7.5px } .pear-col-space16 { - margin: -8px + margin: -8px } -.pear-col-space16 > * { - padding: 8px +.pear-col-space16>* { + padding: 8px } .pear-col-space18 { - margin: -9px + margin: -9px } -.pear-col-space18 > * { - padding: 9px +.pear-col-space18>* { + padding: 9px } .pear-col-space20 { - margin: -10px + margin: -10px } -.pear-col-space20 > * { - padding: 10px +.pear-col-space20>* { + padding: 10px } .pear-col-space22 { - margin: -11px + margin: -11px } -.pear-col-space22 > * { - padding: 11px +.pear-col-space22>* { + padding: 11px } .pear-col-space24 { - margin: -12px + margin: -12px } -.pear-col-space24 > * { - padding: 12px +.pear-col-space24>* { + padding: 12px } .pear-col-space25 { - margin: -12.5px + margin: -12.5px } -.pear-col-space25 > * { - padding: 12.5px +.pear-col-space25>* { + padding: 12.5px } .pear-col-space26 { - margin: -13px + margin: -13px } -.pear-col-space26 > * { - padding: 13px +.pear-col-space26>* { + padding: 13px } .pear-col-space28 { - margin: -14px + margin: -14px } -.pear-col-space28 > * { - padding: 14px +.pear-col-space28>* { + padding: 14px } .pear-col-space30 { - margin: -15px + margin: -15px } -.pear-col-space30 > * { - padding: 15px +.pear-col-space30>* { + padding: 15px } diff --git a/src/main/resources/static/component/pear/css/module/link.css b/src/main/resources/static/component/pear/css/module/link.css index cf9586fa..380351c5 100644 --- a/src/main/resources/static/component/pear/css/module/link.css +++ b/src/main/resources/static/component/pear/css/module/link.css @@ -1,20 +1,20 @@ -.pear-link { - font-size: 15px !important; +.pear-link{ + font-size: 15px!important; } -.pear-link.pear-link-primary { - color: #5FB878; +.pear-link.pear-link-primary{ + color : #5FB878 ; } -.pear-link.pear-link-success { - color: #5FB878; +.pear-link.pear-link-success{ + color : #5FB878 ; } -.pear-link .pear-link-warming { - - +.pear-link .pear-link-warming{ + + } -.pear-link .pear-link-danger { - +.pear-link .pear-link-danger{ + } \ No newline at end of file diff --git a/src/main/resources/static/component/pear/css/module/loading.css b/src/main/resources/static/component/pear/css/module/loading.css index 821a8c75..4abb57d3 100644 --- a/src/main/resources/static/component/pear/css/module/loading.css +++ b/src/main/resources/static/component/pear/css/module/loading.css @@ -7,1473 +7,981 @@ /* Notiflix: Notify wrap on */ [id^=NotiflixNotifyWrap] { - position: fixed; - z-index: 4001; - opacity: 1; - right: 10px; - top: 10px; - width: 280px; - max-width: 96%; - box-sizing: border-box; - background: transparent; -} +position: fixed; +z-index:4001; +opacity:1; +right: 10px; +top: 10px; +width: 280px; +max-width:96%; +box-sizing:border-box; +background: transparent;} [id^=NotiflixNotifyWrap] * { - box-sizing: border-box; -} - +box-sizing:border-box;} /* Notiflix: Notify wrap off */ /* Notiflix: Notify content on */ [id^=NotiflixNotifyWrap] > div { - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - font-family: 'Quicksand', sans-serif; - width: 100%; - display: inline-block; - position: relative; - margin: 0 0 10px; - border-radius: 5px; - background: #1e1e1e; - color: #fff; - padding: 10px 12px; - font-size: 14px; - line-height: 1.4; -} +-webkit-user-select: none; +-moz-user-select: none; +-ms-user-select: none; +user-select: none; +font-family: 'Quicksand', sans-serif; +width:100%; +display: inline-block; +position:relative; +margin:0 0 10px; +border-radius:5px; +background: #1e1e1e; +color: #fff; +padding: 10px 12px; +font-size: 14px; +line-height: 1.4;} [id^=NotiflixNotifyWrap] > div:last-child { - margin: 0; -} +margin:0;} [id^=NotiflixNotifyWrap] > div.with-callback { - cursor: pointer; -} +cursor:pointer;} [id^=NotiflixNotifyWrap] *::selection { - background: inherit; -} +background:inherit;} [id^=NotiflixNotifyWrap] > div.with-icon { - padding: 8px; -} +padding: 8px;} [id^=NotiflixNotifyWrap] > div.click-to-close { - cursor: pointer; -} +cursor: pointer;} [id^=NotiflixNotifyWrap] > div.with-close-button { - padding: 10px 30px 10px 12px; -} - +padding: 10px 30px 10px 12px;} [id^=NotiflixNotifyWrap] > div.with-icon.with-close-button { - padding: 6px 30px 6px 6px; -} +padding: 6px 30px 6px 6px;} [id^=NotiflixNotifyWrap] > div > span.the-message { - font-weight: 500; - font-family: inherit !important; - word-break: break-all; - word-break: break-word; -} +font-weight: 500; +font-family:inherit !important; +word-break: break-all; +word-break: break-word;} [id^=NotiflixNotifyWrap] > div > span.notify-close-button { - cursor: pointer; - transition: all .2s ease-in-out; - position: absolute; - right: 8px; - top: 0; - bottom: 0; - margin: auto; - color: inherit; - width: 16px; - height: 16px; -} - +cursor:pointer; +transition:all .2s ease-in-out; +position: absolute; +right: 8px; +top: 0; +bottom:0; +margin:auto; +color:inherit; +width: 16px; +height: 16px;} [id^=NotiflixNotifyWrap] > div > span.notify-close-button:hover { - transform: rotate(90deg); -} - +transform:rotate(90deg);} [id^=NotiflixNotifyWrap] > div > span.notify-close-button > svg { - position: absolute; - width: 16px; - height: 16px; - right: 0; - top: 0; -} - +position: absolute; +width: 16px; +height: 16px; +right: 0; +top: 0;} /* Notiflix: Notify content off */ /* Notiflix: Notify icon on */ [id^=NotiflixNotifyWrap] > div > .nmi { - position: absolute; - width: 40px; - height: 40px; - font-size: 30px; - line-height: 40px; - text-align: center; - left: 8px; - top: 0; - bottom: 0; - margin: auto; - border-radius: inherit; -} +position: absolute; +width: 40px; +height: 40px; +font-size: 30px; +line-height: 40px; +text-align: center; +left: 8px; +top: 0; +bottom: 0; +margin: auto; +border-radius: inherit;} [id^=NotiflixNotifyWrap] > div > .wfa.shadow { - color: inherit; - background: rgba(0, 0, 0, 0.15); - box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.2); - text-shadow: 0 0 10px rgba(0, 0, 0, 0.3); -} +color: inherit; +background: rgba(0, 0, 0, 0.15); +box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.2); +text-shadow: 0 0 10px rgba(0, 0, 0, 0.3);} [id^=NotiflixNotifyWrap] > div > span.with-icon { - position: relative; - float: left; - width: calc(100% - 40px); - margin: 0 0 0 40px; - padding: 0 0 0 10px; - box-sizing: border-box; -} - +position: relative; +float: left; +width: calc(100% - 40px); +margin:0 0 0 40px; +padding:0 0 0 10px; +box-sizing: border-box;} /* Notiflix: Notify icon off */ /* Notiflix: Notify rtl on */ [id^=NotiflixNotifyWrap] > div.rtl-on > .nmi { - left: auto; - right: 8px; -} +left:auto; +right:8px;} [id^=NotiflixNotifyWrap] > div.rtl-on > span.with-icon { - padding: 0 10px 0 0; - margin: 0 40px 0 0; -} +padding:0 10px 0 0; +margin:0 40px 0 0;} [id^=NotiflixNotifyWrap] > div.rtl-on > span.notify-close-button { - right: auto; - left: 8px; -} +right: auto; +left: 8px;} [id^=NotiflixNotifyWrap] > div.with-icon.with-close-button.rtl-on { - padding: 6px 6px 6px 30px; -} +padding: 6px 6px 6px 30px;} [id^=NotiflixNotifyWrap] > div.with-close-button.rtl-on { - padding: 10px 12px 10px 30px; -} - +padding: 10px 12px 10px 30px;} /* Notiflix: Notify rtl off */ /* Notiflix: Notify animation => fade on */ [id^=NotiflixNotifyOverlay].with-animation, [id^=NotiflixNotifyWrap] > div.with-animation.nx-fade { - animation: notify-animation-fade .3s ease-in-out 0s normal; - -webkit-animation: notify-animation-fade .3s ease-in-out 0s normal; -} +animation: notify-animation-fade .3s ease-in-out 0s normal; +-webkit-animation: notify-animation-fade .3s ease-in-out 0s normal;} @keyframes notify-animation-fade { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } +0% {opacity:0;} +100% {opacity:1;} } @-webkit-keyframes notify-animation-fade { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } +0% {opacity:0;} +100% {opacity:1;} } - /* Notiflix: Notify animation => fade off */ /* Notiflix: Notify animation => zoom on */ [id^=NotiflixNotifyWrap] > div.with-animation.nx-zoom { - animation: notify-animation-zoom .3s ease-in-out 0s normal; - -webkit-animation: notify-animation-zoom .3s ease-in-out 0s normal; -} +animation: notify-animation-zoom .3s ease-in-out 0s normal; +-webkit-animation: notify-animation-zoom .3s ease-in-out 0s normal;} @keyframes notify-animation-zoom { - 0% { - transform: scale(0); - } - 50% { - transform: scale(1.05); - } - 100% { - transform: scale(1); - } +0% {transform:scale(0);} +50% {transform:scale(1.05);} +100% {transform:scale(1);} } @-webkit-keyframes notify-animation-zoom { - 0% { - transform: scale(0); - } - 50% { - transform: scale(1.05); - } - 100% { - transform: scale(1); - } +0% {transform:scale(0);} +50% {transform:scale(1.05);} +100% {transform:scale(1);} } - /* Notiflix: Notify animation => zoom off */ /* Notiflix: Notify animation => from right on */ [id^=NotiflixNotifyWrap] > div.with-animation.nx-from-right { - animation: notify-animation-from-right .3s ease-in-out 0s normal; - -webkit-animation: notify-animation-from-right .3s ease-in-out 0s normal; -} +animation: notify-animation-from-right .3s ease-in-out 0s normal; +-webkit-animation: notify-animation-from-right .3s ease-in-out 0s normal;} @keyframes notify-animation-from-right { - 0% { - right: -300px; - opacity: 0; - } - 50% { - right: 8px; - opacity: 1; - } - 100% { - right: 0px; - opacity: 1; - } +0% {right:-300px; opacity:0;} +50% {right:8px; opacity:1;} +100% {right:0px; opacity:1;} } @-webkit-keyframes notify-animation-from-right { - 0% { - right: -300px; - opacity: 0; - } - 50% { - right: 8px; - opacity: 1; - } - 100% { - right: 0px; - opacity: 1; - } +0% {right:-300px; opacity:0;} +50% {right:8px; opacity:1;} +100% {right:0px; opacity:1;} } - /* Notiflix: Notify animation => from right off */ /* Notiflix: Notify animation => from left on */ [id^=NotiflixNotifyWrap] > div.with-animation.nx-from-left { - animation: notify-animation-from-left .3s ease-in-out 0s normal; - -webkit-animation: notify-animation-from-left .3s ease-in-out 0s normal; -} +animation: notify-animation-from-left .3s ease-in-out 0s normal; +-webkit-animation: notify-animation-from-left .3s ease-in-out 0s normal;} @keyframes notify-animation-from-left { - 0% { - left: -300px; - opacity: 0; - } - 50% { - left: 8px; - opacity: 1; - } - 100% { - left: 0px; - opacity: 1; - } +0% {left:-300px; opacity:0;} +50% {left:8px; opacity:1;} +100% {left:0px; opacity:1;} } @-webkit-keyframes notify-animation-from-left { - 0% { - left: -300px; - opacity: 0; - } - 50% { - left: 8px; - opacity: 1; - } - 100% { - left: 0px; - opacity: 1; - } +0% {left:-300px; opacity:0;} +50% {left:8px; opacity:1;} +100% {left:0px; opacity:1;} } - /* Notiflix: Notify animation => from left off */ /* Notiflix: Notify animation => from top on */ [id^=NotiflixNotifyWrap] > div.with-animation.nx-from-top { - animation: notify-animation-from-top .3s ease-in-out 0s normal; - -webkit-animation: notify-animation-from-top .3s ease-in-out 0s normal; -} +animation: notify-animation-from-top .3s ease-in-out 0s normal; +-webkit-animation: notify-animation-from-top .3s ease-in-out 0s normal;} @keyframes notify-animation-from-top { - 0% { - top: -50px; - opacity: 0; - } - 50% { - top: 8px; - opacity: 1; - } - 100% { - top: 0px; - opacity: 1; - } +0% {top:-50px; opacity:0;} +50% {top:8px; opacity:1;} +100% {top:0px; opacity:1;} } @-webkit-keyframes notify-animation-from-top { - 0% { - top: -50px; - opacity: 0; - } - 50% { - top: 8px; - opacity: 1; - } - 100% { - top: 0px; - opacity: 1; - } +0% {top:-50px; opacity:0;} +50% {top:8px; opacity:1;} +100% {top:0px; opacity:1;} } - /* Notiflix: Notify animation => from top off */ /* Notiflix: Notify animation => from bottom on */ [id^=NotiflixNotifyWrap] > div.with-animation.nx-from-bottom { - animation: notify-animation-from-bottom .3s ease-in-out 0s normal; - -webkit-animation: notify-animation-from-bottom .3s ease-in-out 0s normal; -} +animation: notify-animation-from-bottom .3s ease-in-out 0s normal; +-webkit-animation: notify-animation-from-bottom .3s ease-in-out 0s normal;} @keyframes notify-animation-from-bottom { - 0% { - bottom: -50px; - opacity: 0; - } - 50% { - bottom: 8px; - opacity: 1; - } - 100% { - bottom: 0px; - opacity: 1; - } +0% {bottom:-50px; opacity:0;} +50% {bottom:8px; opacity:1;} +100% {bottom:0px; opacity:1;} } @-webkit-keyframes notify-animation-from-bottom { - 0% { - bottom: -50px; - opacity: 0; - } - 50% { - bottom: 8px; - opacity: 1; - } - 100% { - bottom: 0px; - opacity: 1; - } +0% {bottom:-50px; opacity:0;} +50% {bottom:8px; opacity:1;} +100% {bottom:0px; opacity:1;} } - /* Notiflix: Notify animation => from bottom off */ /* Notiflix: Notify animation remove => fade on */ [id^=NotiflixNotifyOverlay].with-animation.remove, [id^=NotiflixNotifyWrap] > div.with-animation.nx-fade.remove { - opacity: 0; - animation: notify-remove-fade .3s ease-in-out 0s normal; - -webkit-animation: notify-remove-fade .3s ease-in-out 0s normal; -} +opacity:0; +animation: notify-remove-fade .3s ease-in-out 0s normal; +-webkit-animation: notify-remove-fade .3s ease-in-out 0s normal;} @keyframes notify-remove-fade { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } +0% {opacity:1;} +100% {opacity:0;} } @-webkit-keyframes notify-remove-fade { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } +0% {opacity:1;} +100% {opacity:0;} } - /* Notiflix: Notify animation remove => fade off */ /* Notiflix: Notify animation remove => zoom on */ [id^=NotiflixNotifyWrap] > div.with-animation.nx-zoom.remove { - transform: scale(0); - animation: notify-remove-zoom .3s ease-in-out 0s normal; - -webkit-animation: notify-remove-zoom .3s ease-in-out 0s normal; -} +transform:scale(0); +animation: notify-remove-zoom .3s ease-in-out 0s normal; +-webkit-animation: notify-remove-zoom .3s ease-in-out 0s normal;} @keyframes notify-remove-zoom { - 0% { - transform: scale(1); - } - 50% { - transform: scale(1.05); - } - 100% { - transform: scale(0); - } +0% {transform:scale(1);} +50% {transform:scale(1.05);} +100% {transform:scale(0);} } @-webkit-keyframes notify-remove-zoom { - 0% { - transform: scale(1); - } - 50% { - transform: scale(1.05); - } - 100% { - transform: scale(0); - } +0% {transform:scale(1);} +50% {transform:scale(1.05);} +100% {transform:scale(0);} } - /* Notiflix: Notify animation remove => zoom off */ /* Notiflix: Notify animation remove => from top on */ [id^=NotiflixNotifyWrap] > div.with-animation.nx-from-top.remove { - opacity: 0; - animation: notify-remove-to-top .3s ease-in-out 0s normal; - -webkit-animation: notify-remove-to-top .3s ease-in-out 0s normal; -} +opacity:0; +animation: notify-remove-to-top .3s ease-in-out 0s normal; +-webkit-animation: notify-remove-to-top .3s ease-in-out 0s normal;} @keyframes notify-remove-to-top { - 0% { - top: 0px; - opacity: 1; - } - 50% { - top: 8px; - opacity: 1; - } - 100% { - top: -50px; - opacity: 0; - } +0% {top:0px; opacity:1;} +50% {top:8px; opacity:1;} +100% {top:-50px; opacity:0;} } @-webkit-keyframes notify-remove-to-top { - 0% { - top: 0px; - opacity: 1; - } - 50% { - top: 8px; - opacity: 1; - } - 100% { - top: -50px; - opacity: 0; - } +0% {top:0px; opacity:1;} +50% {top:8px; opacity:1;} +100% {top:-50px; opacity:0;} } - /* Notiflix: Notify animation remove => from top off */ /* Notiflix: Notify animation remove => from right on */ [id^=NotiflixNotifyWrap] > div.with-animation.nx-from-right.remove { - opacity: 0; - animation: notify-remove-to-right .3s ease-in-out 0s normal; - -webkit-animation: notify-remove-to-right .3s ease-in-out 0s normal; -} +opacity:0; +animation: notify-remove-to-right .3s ease-in-out 0s normal; +-webkit-animation: notify-remove-to-right .3s ease-in-out 0s normal;} @keyframes notify-remove-to-right { - 0% { - right: 0px; - opacity: 1; - } - 50% { - right: 8px; - opacity: 1; - } - 100% { - right: -300px; - opacity: 0; - } +0% {right:0px; opacity:1;} +50% {right:8px; opacity:1;} +100% {right:-300px; opacity:0;} } @-webkit-keyframes notify-remove-to-right { - 0% { - right: 0px; - opacity: 1; - } - 50% { - right: 8px; - opacity: 1; - } - 100% { - right: -300px; - opacity: 0; - } +0% {right:0px; opacity:1;} +50% {right:8px; opacity:1;} +100% {right:-300px; opacity:0;} } - /* Notiflix: Notify animation remove => from right off */ /* Notiflix: Notify animation remove => from bottom on */ [id^=NotiflixNotifyWrap] > div.with-animation.nx-from-bottom.remove { - opacity: 0; - animation: notify-remove-to-bottom .3s ease-in-out 0s normal; - -webkit-animation: notify-remove-to-bottom .3s ease-in-out 0s normal; -} +opacity:0; +animation: notify-remove-to-bottom .3s ease-in-out 0s normal; +-webkit-animation: notify-remove-to-bottom .3s ease-in-out 0s normal;} @keyframes notify-remove-to-bottom { - 0% { - bottom: 0px; - opacity: 1; - } - 50% { - bottom: 8px; - opacity: 1; - } - 100% { - bottom: -50px; - opacity: 0; - } +0% {bottom:0px; opacity:1;} +50% {bottom:8px; opacity:1;} +100% {bottom:-50px; opacity:0;} } @-webkit-keyframes notify-remove-to-bottom { - 0% { - bottom: 0px; - opacity: 1; - } - 50% { - bottom: 8px; - opacity: 1; - } - 100% { - bottom: -50px; - opacity: 0; - } +0% {bottom:0px; opacity:1;} +50% {bottom:8px; opacity:1;} +100% {bottom:-50px; opacity:0;} } - /* Notiflix: Notify animation remove => from bottom off */ /* Notiflix: Notify animation remove => from left on */ [id^=NotiflixNotifyWrap] > div.with-animation.nx-from-left.remove { - opacity: 0; - animation: notify-remove-to-left .3s ease-in-out 0s normal; - -webkit-animation: notify-remove-to-left .3s ease-in-out 0s normal; -} +opacity:0; +animation: notify-remove-to-left .3s ease-in-out 0s normal; +-webkit-animation: notify-remove-to-left .3s ease-in-out 0s normal;} @keyframes notify-remove-to-left { - 0% { - left: 0px; - opacity: 1; - } - 50% { - left: 8px; - opacity: 1; - } - 100% { - left: -300px; - opacity: 0; - } +0% {left:0px; opacity:1;} +50% {left:8px; opacity:1;} +100% {left:-300px; opacity:0;} } @-webkit-keyframes notify-remove-to-left { - 0% { - left: 0px; - opacity: 1; - } - 50% { - left: 8px; - opacity: 1; - } - 100% { - left: -300px; - opacity: 0; - } +0% {left:0px; opacity:1;} +50% {left:8px; opacity:1;} +100% {left:-300px; opacity:0;} } - /* Notiflix: Notify animation remove => from left off */ /* Notiflix: Report wrap on */ [id^=NotiflixReportWrap] { - position: fixed; - z-index: 4002; - width: 320px; - max-width: 96%; - box-sizing: border-box; - font-family: "Quicksand", sans-serif; - left: 0; - right: 0; - top: 20px; - color: #1e1e1e; - border-radius: 25px; - background: transparent; - margin: auto; -} +position: fixed; +z-index:4002; +width: 320px; +max-width:96%; +box-sizing:border-box; +font-family: "Quicksand", sans-serif; +left: 0; +right: 0; +top: 20px; +color:#1e1e1e; +border-radius: 25px; +background: transparent; +margin: auto;} [id^=NotiflixReportWrap] * { - box-sizing: border-box; -} - +box-sizing:border-box;} /* Notiflix: Report wrap off */ /* Notiflix: Report content on */ [id^=NotiflixReportWrap] > div[class*="-overlay"] { - width: 100%; - height: 100%; - left: 0; - top: 0; - background: rgba(255, 255, 255, .5); - position: fixed; - z-index: 0; -} +width:100%; +height:100%; +left:0; +top:0; +background: rgba(255, 255, 255, .5); +position:fixed; +z-index:0;} [id^=NotiflixReportWrap] > div[class*="-content"] { - width: 100%; - float: left; - border-radius: inherit; - padding: 10px; - filter: drop-shadow(0 0 5px rgba(0, 0, 0, .1)); - border: 1px solid rgba(0, 0, 0, .03); - background: #f8f8f8; - position: relative; - z-index: 1; -} +width:100%; +float:left; +border-radius: inherit; +padding:10px; +filter: drop-shadow(0 0 5px rgba(0,0,0,.1)); +border: 1px solid rgba(0,0,0,.03); +background: #f8f8f8; +position:relative; +z-index:1;} [id^=NotiflixReportWrap] > div[class*="-content"] > div[class$="-icon"] { - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - width: 110px; - height: 110px; - display: block; - margin: 6px auto 12px; -} +-webkit-user-select: none; +-moz-user-select: none; +-ms-user-select: none; +user-select: none; +width:110px; +height:110px; +display:block; +margin:6px auto 12px;} [id^=NotiflixReportWrap] > div[class*="-content"] > div[class$="-icon"] svg { - min-width: 100%; - max-width: 100%; - height: auto; -} +min-width:100%; +max-width:100%; +height:auto;} [id^=NotiflixReportWrap] > * > h5 { - word-break: break-all; - word-break: break-word; - font-family: inherit !important; - font-size: 16px; - font-weight: 500; - line-height: 1.4; - margin: 0 0 10px; - padding: 0 0 10px; - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - float: left; - width: 100%; - text-align: center; -} +word-break: break-all; +word-break: break-word; +font-family:inherit !important; +font-size:16px; +font-weight:500; +line-height: 1.4; +margin: 0 0 10px; +padding: 0 0 10px; +border-bottom: 1px solid rgba(0, 0, 0, 0.1); +float: left; +width: 100%; +text-align: center;} [id^=NotiflixReportWrap] > * > p { - word-break: break-all; - word-break: break-word; - font-family: inherit !important; - font-size: 13px; - line-height: 1.4; - float: left; - width: 100%; - padding: 0 10px; - margin: 0 0 10px; -} +word-break: break-all; +word-break: break-word; +font-family:inherit !important; +font-size:13px; +line-height: 1.4; +float: left; +width: 100%; +padding:0 10px; +margin: 0 0 10px;} [id^=NotiflixReportWrap] a#NXReportButton { - word-break: break-all; - word-break: break-word; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - font-family: inherit !important; - transition: all .25s ease-in-out; - cursor: pointer; - float: right; - padding: 7px 17px; - background: #32c682; - font-size: 14px; - line-height: 1.4; - font-weight: 500; - border-radius: inherit !important; - color: #fff; -} +word-break: break-all; +word-break: break-word; +-webkit-user-select: none; +-moz-user-select: none; +-ms-user-select: none; +user-select: none; +font-family:inherit !important; +transition:all .25s ease-in-out; +cursor:pointer; +float: right; +padding: 7px 17px; +background: #32c682; +font-size:14px; +line-height: 1.4; +font-weight: 500; +border-radius: inherit !important; +color: #fff;} [id^=NotiflixReportWrap] a#NXReportButton:hover { - box-shadow: inset 0 -60px 5px -5px rgba(0, 0, 0, 0.25); -} +box-shadow:inset 0 -60px 5px -5px rgba(0, 0, 0, 0.25);} [id^=NotiflixReportWrap].rtl-on a#NXReportButton { - float: left; -} - +float:left;} /* Notiflix: Report content off */ /* Notiflix: Report overlay animation => fade on */ [id^=NotiflixReportWrap] > div[class*="-overlay"].with-animation { - animation: report-overlay-animation .3s ease-in-out 0s normal; - -webkit-animation: report-overlay-animation .3s ease-in-out 0s normal; -} +animation: report-overlay-animation .3s ease-in-out 0s normal; +-webkit-animation: report-overlay-animation .3s ease-in-out 0s normal;} @keyframes report-overlay-animation { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } +0% {opacity:0;} +100% {opacity:1;} } @-webkit-keyframes report-overlay-animation { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } +0% {opacity:0;} +100% {opacity:1;} } - /* Notiflix: Report overlay animation => fade off */ /* Notiflix: Report content animation => fade on */ [id^=NotiflixReportWrap] > div[class*="-content"].with-animation.nx-fade { - animation: report-animation-fade .3s ease-in-out 0s normal; - -webkit-animation: report-animation-fade .3s ease-in-out 0s normal; -} +animation: report-animation-fade .3s ease-in-out 0s normal; +-webkit-animation: report-animation-fade .3s ease-in-out 0s normal;} @keyframes report-animation-fade { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } +0% {opacity:0;} +100% {opacity:1;} } @-webkit-keyframes report-animation-fade { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } +0% {opacity:0;} +100% {opacity:1;} } - /* Notiflix: Report content animation => fade off */ /* Notiflix: Report content animation => zoom on */ [id^=NotiflixReportWrap] > div[class*="-content"].with-animation.nx-zoom { - animation: report-animation-zoom .3s ease-in-out 0s normal; - -webkit-animation: report-animation-zoom .3s ease-in-out 0s normal; -} +animation: report-animation-zoom .3s ease-in-out 0s normal; +-webkit-animation: report-animation-zoom .3s ease-in-out 0s normal;} @keyframes report-animation-zoom { - 0% { - opacity: 0; - transform: scale(0.5); - } - 50% { - opacity: 1; - transform: scale(1.05); - } - 100% { - opacity: 1; - transform: scale(1); - } +0% {opacity:0; transform:scale(0.5);} +50% {opacity:1; transform:scale(1.05);} +100% {opacity:1; transform:scale(1);} } @-webkit-keyframes report-animation-zoom { - 0% { - opacity: 0; - transform: scale(0.5); - } - 50% { - opacity: 1; - transform: scale(1.05); - } - 100% { - opacity: 1; - transform: scale(1); - } +0% {opacity:0; transform:scale(0.5);} +50% {opacity:1; transform:scale(1.05);} +100% {opacity:1; transform:scale(1);} } - /* Notiflix: Report content animation => zoom off */ /* Notiflix: Report overlay animation remove => fade on */ [id^=NotiflixReportWrap].remove > div[class*="-overlay"].with-animation { - opacity: 0; - animation: report-overlay-animation-remove .3s ease-in-out 0s normal; - -webkit-animation: report-overlay-animation-remove .3s ease-in-out 0s normal; -} +opacity:0; +animation: report-overlay-animation-remove .3s ease-in-out 0s normal; +-webkit-animation: report-overlay-animation-remove .3s ease-in-out 0s normal;} @keyframes report-overlay-animation-remove { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } +0% {opacity:1;} +100% {opacity:0;} } @-webkit-keyframes report-overlay-animation-remove { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } +0% {opacity:1;} +100% {opacity:0;} } - /* Notiflix: Report overlay animation remove => fade off */ /* Notiflix: Report content animation remove => fade on */ [id^=NotiflixReportWrap].remove > div[class*="-content"].with-animation.nx-fade { - opacity: 0; - animation: report-animation-fade-remove .3s ease-in-out 0s normal; - -webkit-animation: report-animation-fade-remove .3s ease-in-out 0s normal; -} +opacity:0; +animation: report-animation-fade-remove .3s ease-in-out 0s normal; +-webkit-animation: report-animation-fade-remove .3s ease-in-out 0s normal;} @keyframes report-animation-fade-remove { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } +0% {opacity:1;} +100% {opacity:0;} } @-webkit-keyframes report-animation-fade-remove { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } +0% {opacity:1;} +100% {opacity:0;} } - /* Notiflix: Report content animation remove => fade off */ /* Notiflix: Report content animation remove => zoom on */ [id^=NotiflixReportWrap].remove > div[class*="-content"].with-animation.nx-zoom { - opacity: 0; - animation: report-animation-zoom-remove .3s ease-in-out 0s normal; - -webkit-animation: report-animation-zoom-remove .3s ease-in-out 0s normal; -} +opacity:0; +animation: report-animation-zoom-remove .3s ease-in-out 0s normal; +-webkit-animation: report-animation-zoom-remove .3s ease-in-out 0s normal;} @keyframes report-animation-zoom-remove { - 0% { - opacity: 1; - transform: scale(1); - } - 50% { - opacity: 0.5; - transform: scale(1.05); - } - 100% { - opacity: 0; - transform: scale(0); - } +0% {opacity:1; transform:scale(1);} +50% {opacity:0.5; transform:scale(1.05);} +100% {opacity:0; transform:scale(0);} } @-webkit-keyframes report-animation-zoom-remove { - 0% { - opacity: 1; - transform: scale(1); - } - 50% { - opacity: 0.5; - transform: scale(1.05); - } - 100% { - opacity: 0; - transform: scale(0); - } +0% {opacity:1; transform:scale(1);} +50% {opacity:0.5; transform:scale(1.05);} +100% {opacity:0; transform:scale(0);} } - /* Notiflix: Report content animation remove => zoom off */ /* Notiflix: Confirm wrap on */ [id^=NotiflixConfirmWrap] { - position: fixed; - z-index: 4003; - width: 300px; - max-width: 98%; - left: 10px; - right: 10px; - top: 10px; - margin: auto; - text-align: center; - box-sizing: border-box; - background: transparent; - font-family: "Quicksand", sans-serif; -} +position: fixed; +z-index: 4003; +width: 300px; +max-width:98%; +left: 10px; +right: 10px; +top: 10px; +margin:auto; +text-align: center; +box-sizing:border-box; +background:transparent; +font-family: "Quicksand", sans-serif;} [id^=NotiflixConfirmWrap] * { - box-sizing: border-box; -} - +box-sizing:border-box;} /* Notiflix: Confirm wrap off */ /* Notiflix: Confirm content on */ [id^=NotiflixConfirmWrap] > div[class*="-overlay"] { - width: 100%; - height: 100%; - left: 0; - top: 0; - background: rgba(255, 255, 255, .5); - position: fixed; - z-index: 0; -} +width:100%; +height:100%; +left:0; +top:0; +background: rgba(255, 255, 255, .5); +position:fixed; +z-index:0;} [id^=NotiflixConfirmWrap] > div[class*="-content"] { - width: 100%; - float: left; - border-radius: 25px; - padding: 10px; - margin: 0; - filter: drop-shadow(0 0 5px rgba(0, 0, 0, .1)); - background: #f8f8f8; - color: #1e1e1e; - position: relative; - z-index: 1; -} +width:100%; +float:left; +border-radius: 25px; +padding:10px; +margin:0; +filter: drop-shadow(0 0 5px rgba(0,0,0,.1)); +background: #f8f8f8; +color:#1e1e1e; +position:relative; +z-index:1;} [id^=NotiflixConfirmWrap] > div[class*="-content"] > div[class*="-head"] { - float: left; - width: 100%; -} +float:left; +width:100%;} [id^=NotiflixConfirmWrap] > div[class*="-content"] > div[class*="-head"] > h5 { - float: left; - width: 100%; - margin: 0; - padding: 0 0 10px; - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - color: #32c682; - font-family: inherit !important; - font-size: 16px; - line-height: 1.4; - font-weight: 500; -} +float:left; +width:100%; +margin:0; +padding:0 0 10px; +border-bottom:1px solid rgba(0,0,0,0.1); +color: #32c682; +font-family:inherit !important; +font-size:16px; +line-height:1.4; +font-weight:500;} [id^=NotiflixConfirmWrap] > div[class*="-content"] > div[class*="-head"] > p { - font-family: inherit !important; - margin: 15px 0 20px; - padding: 0 10px; - float: left; - width: 100%; - font-size: 14px; - line-height: 1.4; - color: inherit; -} +font-family:inherit !important; +margin: 15px 0 20px; +padding: 0 10px; +float:left; +width:100%; +font-size: 14px; +line-height: 1.4; +color: inherit;} [id^=NotiflixConfirmWrap] > div[class*="-content"] > div[class*="-buttons"] { - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - border-radius: inherit; - float: left; - width: 100%; -} +-webkit-user-select: none; +-moz-user-select: none; +-ms-user-select: none; +user-select: none; +border-radius:inherit; +float:left; +width:100%;} [id^=NotiflixConfirmWrap] > div[class*="-content"] > div[class*="-buttons"] > a { - cursor: pointer; - font-family: inherit !important; - transition: all .25s ease-in-out; - float: left; - width: 48%; - padding: 9px 5px; - border-radius: inherit !important; - font-weight: 500; - font-size: 15px; - line-height: 1.4; - color: #f8f8f8; -} +cursor:pointer; +font-family:inherit !important; +transition:all .25s ease-in-out; +float: left; +width: 48%; +padding: 9px 5px; +border-radius:inherit !important; +font-weight: 500; +font-size: 15px; +line-height: 1.4; +color:#f8f8f8;} [id^=NotiflixConfirmWrap] > div[class*="-content"] > div[class*="-buttons"] > a.confirm-button-ok { - margin: 0 2% 0 0; - background: #32c682; -} +margin:0 2% 0 0; +background:#32c682;} [id^=NotiflixConfirmWrap] > div[class*="-content"] > div[class*="-buttons"] > a.confirm-button-cancel { - margin: 0 0 0 2%; - background: #a9a9a9; -} +margin:0 0 0 2%; +background:#a9a9a9;} [id^=NotiflixConfirmWrap] > div[class*="-content"] > div[class*="-buttons"] > a.full { - margin: 0; - width: 100%; -} +margin:0; +width:100%;} [id^=NotiflixConfirmWrap] > div[class*="-content"] > div[class*="-buttons"] > a:hover { - box-shadow: inset 0 -60px 5px -5px rgba(0, 0, 0, 0.25); -} - +box-shadow:inset 0 -60px 5px -5px rgba(0, 0, 0, 0.25);} /* Notiflix: Confirm content off */ /* Notiflix: Confirm rtl on */ [id^=NotiflixConfirmWrap].rtl-on > div[class*="-content"] > div[class*="-buttons"], [id^=NotiflixConfirmWrap].rtl-on > div[class*="-content"] > div[class*="-buttons"] > a { - transform: rotateY(180deg); -} - +transform:rotateY(180deg);} /* Notiflix: Confirm rtl off */ /* Notiflix: Confirm overlay animation => fade on */ [id^=NotiflixConfirmWrap] > div[class*="-overlay"].with-animation { - animation: confirm-overlay-animation .3s ease-in-out 0s normal; - -webkit-animation: confirm-overlay-animation .3s ease-in-out 0s normal; -} +animation: confirm-overlay-animation .3s ease-in-out 0s normal; +-webkit-animation: confirm-overlay-animation .3s ease-in-out 0s normal;} @keyframes confirm-overlay-animation { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } +0% {opacity:0;} +100% {opacity:1;} } @-webkit-keyframes confirm-overlay-animation { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } +0% {opacity:0;} +100% {opacity:1;} } - /* Notiflix: Confirm overlay animation => fade off */ /* Notiflix: Confirm overlay animation remove => fade on */ [id^=NotiflixConfirmWrap].remove > div[class*="-overlay"].with-animation { - opacity: 0; - animation: confirm-overlay-animation-remove .3s ease-in-out 0s normal; - -webkit-animation: confirm-overlay-animation-remove .3s ease-in-out 0s normal; -} +opacity:0; +animation: confirm-overlay-animation-remove .3s ease-in-out 0s normal; +-webkit-animation: confirm-overlay-animation-remove .3s ease-in-out 0s normal;} @keyframes confirm-overlay-animation-remove { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } +0% {opacity:1;} +100% {opacity:0;} } @-webkit-keyframes confirm-overlay-animation-remove { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } +0% {opacity:1;} +100% {opacity:0;} } - /* Notiflix: Confirm overlay animation remove => fade off */ /* Notiflix: Confirm content animation => fade on */ [id^=NotiflixConfirmWrap].with-animation.nx-fade > div[class*="-content"] { - animation: confirm-animation-fade .3s ease-in-out 0s normal; - -webkit-animation: confirm-animation-fade .3s ease-in-out 0s normal; -} +animation: confirm-animation-fade .3s ease-in-out 0s normal; +-webkit-animation: confirm-animation-fade .3s ease-in-out 0s normal;} @keyframes confirm-animation-fade { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } +0% {opacity:0;} +100% {opacity:1;} } @-webkit-keyframes confirm-animation-fade { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } +0% {opacity:0;} +100% {opacity:1;} } - /* Notiflix: Confirm content animation => fade off */ /* Notiflix: Confirm content animation => zoom on */ [id^=NotiflixConfirmWrap].with-animation.nx-zoom > div[class*="-content"] { - animation: confirm-animation-zoom .3s ease-in-out 0s normal; - -webkit-animation: confirm-animation-zoom .3s ease-in-out 0s normal; -} +animation: confirm-animation-zoom .3s ease-in-out 0s normal; +-webkit-animation: confirm-animation-zoom .3s ease-in-out 0s normal;} @keyframes confirm-animation-zoom { - 0% { - opacity: 0; - transform: scale(0.5); - } - 50% { - opacity: 1; - transform: scale(1.05); - } - 100% { - opacity: 1; - transform: scale(1); - } +0% {opacity:0; transform:scale(0.5);} +50% {opacity:1; transform:scale(1.05);} +100% {opacity:1; transform:scale(1);} } @-webkit-keyframes confirm-animation-zoom { - 0% { - opacity: 0; - transform: scale(0.5); - } - 50% { - opacity: 1; - transform: scale(1.05); - } - 100% { - opacity: 1; - transform: scale(1); - } +0% {opacity:0; transform:scale(0.5);} +50% {opacity:1; transform:scale(1.05);} +100% {opacity:1; transform:scale(1);} } - /* Notiflix: Confirm content animation => zoom off */ /* Notiflix: Confirm content animation remove => fade on */ [id^=NotiflixConfirmWrap].with-animation.nx-fade.remove > div[class*="-content"] { - opacity: 0; - animation: confirm-animation-fade-remove .3s ease-in-out 0s normal; - -webkit-animation: confirm-animation-fade-remove .3s ease-in-out 0s normal; -} +opacity:0; +animation: confirm-animation-fade-remove .3s ease-in-out 0s normal; +-webkit-animation: confirm-animation-fade-remove .3s ease-in-out 0s normal;} @keyframes confirm-animation-fade-remove { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } +0% {opacity:1;} +100% {opacity:0;} } @-webkit-keyframes confirm-animation-fade-remove { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } +0% {opacity:1;} +100% {opacity:0;} } - /* Notiflix: Confirm content animation remove => fade off */ /* Notiflix: Confirm content animation remove => zoom on */ [id^=NotiflixConfirmWrap].with-animation.nx-zoom.remove > div[class*="-content"] { - opacity: 0; - animation: confirm-animation-zoom-remove .3s ease-in-out 0s normal; - -webkit-animation: confirm-animation-zoom-remove .3s ease-in-out 0s normal; -} +opacity:0; +animation: confirm-animation-zoom-remove .3s ease-in-out 0s normal; +-webkit-animation: confirm-animation-zoom-remove .3s ease-in-out 0s normal;} @keyframes confirm-animation-zoom-remove { - 0% { - opacity: 1; - transform: scale(1); - } - 50% { - opacity: 0.5; - transform: scale(1.05); - } - 100% { - opacity: 0; - transform: scale(0); - } +0% {opacity:1; transform:scale(1);} +50% {opacity:0.5; transform:scale(1.05);} +100% {opacity:0; transform:scale(0);} } @-webkit-keyframes confirm-animation-zoom-remove { - 0% { - opacity: 1; - transform: scale(1); - } - 50% { - opacity: 0.5; - transform: scale(1.05); - } - 100% { - opacity: 0; - transform: scale(0); - } +0% {opacity:1; transform:scale(1);} +50% {opacity:0.5; transform:scale(1.05);} +100% {opacity:0; transform:scale(0);} } - /* Notiflix: Confirm content animation remove => zoom off */ /* Notiflix: Loading wrap on */ [id^=NotiflixLoadingWrap] { - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - position: fixed; - z-index: 4000; - width: 100%; - height: 100%; - left: 0; - top: 0; - right: 0; - bottom: 0; - margin: auto; - text-align: center; - box-sizing: border-box; - background: white !important; - font-family: "Quicksand", sans-serif; -} +-webkit-user-select: none; +-moz-user-select: none; +-ms-user-select: none; +user-select: none; +position: fixed; +z-index: 4000; +width: 100%; +height: 100%; +left: 0; +top: 0; +right:0; +bottom:0; +margin:auto; +text-align: center; +box-sizing:border-box; +background: white!important; +font-family: "Quicksand", sans-serif;} [id^=NotiflixLoadingWrap] * { - box-sizing: border-box; -} +box-sizing:border-box;} [id^=NotiflixLoadingWrap].click-to-close { - cursor: pointer; -} - +cursor:pointer;} /* Notiflix: Loading wrap off */ /* Notiflix: Loading content on */ [id^=NotiflixLoadingWrap] > div[class*="-icon"] { - width: 60px; - height: 60px; - position: fixed; - background-color: white !important; - transition: top .2s ease-in-out; - left: 0; - top: 0; - right: 0; - bottom: 0; - margin: auto; -} +width:60px; +height:60px; +position:fixed; +background-color: white!important; +transition:top .2s ease-in-out; +left: 0; +top: 0; +right:0; +bottom:0; +margin:auto;} [id^=NotiflixLoadingWrap] > div[class*="-icon"] img, [id^=NotiflixLoadingWrap] > div[class*="-icon"] svg { - max-width: unset; - max-height: unset; - width: 100%; - height: 100%; - position: absolute; - left: 0; - top: 0; -} +max-width:unset; +max-height:unset; +width: 100%; +height: 100%; +position:absolute; +left: 0; +top: 0;} [id^=NotiflixLoadingWrap] > div[class*="-icon"].with-message { - top: -42px; -} +top:-42px;} [id^=NotiflixLoadingWrap] > p { - position: fixed; - left: 0; - right: 0; - top: 42px; - bottom: 0; - margin: auto; - font-family: inherit !important; - font-weight: 500; - line-height: 1.4; - padding: 0 10px; - width: 100%; - font-size: 15px; - height: 18px; -} - +position: fixed; +left: 0; +right: 0; +top: 42px; +bottom: 0; +margin: auto; +font-family: inherit !important; +font-weight: 500; +line-height: 1.4; +padding: 0 10px; +width: 100%; +font-size:15px; +height: 18px;} /* Notiflix: Loading content off */ /* Notiflix: Loading animation => fade on */ [id^=NotiflixLoadingWrap].with-animation { - animation: loading-animation-fade .3s ease-in-out 0s normal; - -webkit-animation: loading-animation-fade .3s ease-in-out 0s normal; -} +animation: loading-animation-fade .3s ease-in-out 0s normal; +-webkit-animation: loading-animation-fade .3s ease-in-out 0s normal;} @keyframes loading-animation-fade { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } +0% {opacity:0;} +100% {opacity:1;} } @-webkit-keyframes loading-animation-fade { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } +0% {opacity:0;} +100% {opacity:1;} } - /* Notiflix: Loading animation => fade off */ /* Notiflix: Loading animation remove => fade on */ [id^=NotiflixLoadingWrap].with-animation.remove { - opacity: 0; - animation: loading-animation-fade-remove .3s ease-in-out 0s normal; - -webkit-animation: loading-animation-fade-remove .3s ease-in-out 0s normal; -} +opacity:0; +animation: loading-animation-fade-remove .3s ease-in-out 0s normal; +-webkit-animation: loading-animation-fade-remove .3s ease-in-out 0s normal;} @keyframes loading-animation-fade-remove { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } +0% {opacity:1;} +100% {opacity:0;} } @-webkit-keyframes loading-animation-fade-remove { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } +0% {opacity:1;} +100% {opacity:0;} } - /* Notiflix: Loading animation remove => fade off */ /* Notiflix: Loading animation new message => fade on */ [id^=NotiflixLoadingWrap] > p.new { - animation: loading-new-message-fade .3s ease-in-out 0s normal; - -webkit-animation: loading-new-message-fade .3s ease-in-out 0s normal; -} +animation: loading-new-message-fade .3s ease-in-out 0s normal; +-webkit-animation: loading-new-message-fade .3s ease-in-out 0s normal;} @keyframes loading-new-message-fade { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } +0% {opacity:0;} +100% {opacity:1;} } @-webkit-keyframes loading-new-message-fade { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } +0% {opacity:0;} +100% {opacity:1;} } - /* Notiflix: Loading animation new message => fade off */ /* Notiflix: Block wrap on */ [id^=NotiflixBlockWrap] { - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - box-sizing: border-box; - position: absolute; - z-index: 1000; - font-family: "Quicksand", sans-serif; - background: rgba(255, 255, 255, 0.9); - text-align: center; - animation-duration: 400ms; - width: 100%; - height: 100%; - left: 0; - top: 0; - border-radius: inherit; -} +-webkit-user-select: none; +-moz-user-select: none; +-ms-user-select: none; +user-select: none; +box-sizing: border-box; +position: absolute; +z-index: 1000; +font-family: "Quicksand", sans-serif; +background: rgba(255, 255, 255, 0.9); +text-align: center; +animation-duration: 400ms; +width: 100%; +height: 100%; +left: 0; +top: 0; +border-radius: inherit;} [id^=NotiflixBlockWrap] * { - box-sizing: border-box; -} - +box-sizing: border-box;} /* Notiflix: Block wrap off */ /* Notiflix: Block content on */ [id^=NotiflixBlockWrap] > span[class*="-icon"] { - width: 45px; - height: 45px; - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - margin: auto; -} +width: 45px; +height: 45px; +position: absolute; +left: 0; +top: 0; +right: 0; +bottom: 0; +margin: auto;} [id^=NotiflixBlockWrap] > span[class*="-message"] { - position: absolute; - left: 0; - right: 0; - top: 50px; - bottom: 0; - margin: auto; - font-family: inherit !important; - font-weight: 500; - font-size: 14px; - line-height: 1.4; - padding: 0 10px; - width: 100%; - height: 20px; - overflow: hidden; -} - +position: absolute; +left: 0; +right: 0; +top: 50px; +bottom: 0; +margin: auto; +font-family: inherit !important; +font-weight: 500; +font-size: 14px; +line-height: 1.4; +padding: 0 10px; +width: 100%; +height: 20px; +overflow: hidden;} /* Notiflix: Block content off */ /* Notiflix: Block animation => fade on */ [id^=NotiflixBlockWrap].with-animation { - animation: block-animation-fade .3s ease-in-out 0s normal; - -webkit-animation: block-animation-fade .3s ease-in-out 0s normal; -} +animation: block-animation-fade .3s ease-in-out 0s normal; +-webkit-animation: block-animation-fade .3s ease-in-out 0s normal;} @keyframes block-animation-fade { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } +0% {opacity: 0;} +100% {opacity: 1;} } @-webkit-keyframes block-animation-fade { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } +0% {opacity: 0;} +100% {opacity: 1;} } - /* Notiflix: Block animation => fade off */ /* Notiflix: Block animation remove => fade on */ [id^=NotiflixBlockWrap].with-animation.remove { - opacity: 0; - animation: block-animation-fade-remove .3s ease-in-out 0s normal; - -webkit-animation: block-animation-fade-remove .3s ease-in-out 0s normal; -} +opacity: 0; +animation: block-animation-fade-remove .3s ease-in-out 0s normal; +-webkit-animation: block-animation-fade-remove .3s ease-in-out 0s normal;} @keyframes block-animation-fade-remove { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } +0% {opacity: 1;} +100% {opacity: 0;} } @-webkit-keyframes block-animation-fade-remove { - 0% { - opacity: 1; - } - 100% { - opacity: 0; - } +0% {opacity: 1;} +100% {opacity: 0;} } - /* Notiflix: Block animation remove => fade off */ diff --git a/src/main/resources/static/component/pear/css/module/menu.css b/src/main/resources/static/component/pear/css/module/menu.css index 93d1bf07..938f987a 100644 --- a/src/main/resources/static/component/pear/css/module/menu.css +++ b/src/main/resources/static/component/pear/css/module/menu.css @@ -1,31 +1,31 @@ .pear-nav-tree { - width: 230px; - border-radius: 0px; - background-color: #28333E; + width: 230px !important; + border-radius: 0px; + background-color: #28333E; } .pear-nav-tree .layui-nav-item>a { - height: 56px; - line-height: 56px; - padding-top: 0px; - padding-bottom: 0px; + height: 56px; + line-height: 56px; + padding-top: 0px; + padding-bottom: 0px; } .pear-nav-tree .layui-nav-item dd a { - height: 48px; - line-height: 48px; + height: 48px; + line-height: 48px; } .pear-nav-tree .layui-nav-item>a .layui-nav-more { - padding: 0px; + padding: 0px; } .pear-side-scroll::-webkit-scrollbar { - width: 0px; - height: 0px; + width: 0px; + height: 0px; } .pear-side-scroll{ - width: 230px; + width: 230px; } .pear-nav-tree .layui-nav-child dd.layui-this, @@ -33,235 +33,235 @@ .layui-nav-tree .layui-this, .layui-nav-tree .layui-this>a, .layui-nav-tree .layui-this>a:hover { - background-color: #5FB878; + background-color: #5FB878; } .pear-nav-tree .toast { - font-size: 14px; - margin: 5px; - margin-right: 8px; - text-align: center; - height: 40px; - line-height: 40px; - color: lightgray; + font-size: 14px; + margin: 5px; + margin-right: 8px; + text-align: center; + height: 40px; + line-height: 40px; + color: lightgray; } .pear-nav-tree .layui-nav-item a i { - margin-right: 12px; + margin-right: 12px; } .pear-nav-tree .layui-nav-item a span { - letter-spacing: 2px; - font-size: 13.5px; + letter-spacing: 2px; + font-size: 13.5px; } .pear-nav-tree .layui-nav-item a:hover { - background-color: transparent; + background-color: transparent; } .pear-nav-tree .layui-nav-more { - margin-right: 5px; + margin-right: 5px; } .pear-nav-tree .layui-nav-bar { - display: none; + display: none; } .pear-nav-tree .layui-nav-item a .layui-badge-dot { - float: right; - right: 13px; + float: right; + right: 13px; } .pear-nav-tree .layui-nav-item a .layui-badge { - float: right; - right: 10px; + float: right; + right: 10px; } /** 实 现 菜 单 隐 藏 */ .pear-nav-mini { - overflow: hidden; + overflow: hidden; } .pear-nav-mini .layui-nav-item a span { - display: none; + display: none; } .pear-nav-mini .layui-nav-child { - display: none; + display: none; } .pear-nav-mini .layui-nav-more { - display: none !important; + display: none !important; } .pear-nav-control.pc a { - font-weight: 500; - font-size: 14px; + font-weight: 500; + font-size: 14px; } .pear-nav-control.pc li{ - display: inline-block; + display: inline-block; } .pear-nav-control.pc .layui-nav-bar { - top: 0px !important; + top: 0px !important; } .pear-nav-control.pc .layui-this * { - background-color: whitesmoke; + background-color: whitesmoke; } .pear-nav-control.pc *{ - color: darkslategray!important; + color: darkslategray!important; } .pear-nav-control.pc .layui-nav-bar{ - display: none!important; + display: none!important; } .pear-nav-control .layui-nav-child{ - border: 1px solid whitesmoke; - border-radius: 6px; - width: 150px; + border: 1px solid whitesmoke; + border-radius: 6px; + width: 150px; } /** 隐 藏 后 子 级 悬 浮 菜 单 */ .pear-nav-tree .layui-nav-hover { - position: fixed; - min-width: 130px; - padding: 4px; - display: block !important; - background: transparent !important; + position: fixed; + min-width: 130px; + padding: 4px; + display: block !important; + background: transparent !important; } .pear-nav-tree .layui-nav-hover:before { - content: ''; - position: absolute; - right: 4px; - left: 4px; - bottom: 0; - top: 0; - border-radius: 4px; - overflow: hidden; - background-color: #28333E; - display: block; - box-shadow: 0px 0px 3px lightgray; + content: ''; + position: absolute; + right: 4px; + left: 4px; + bottom: 0; + top: 0; + border-radius: 4px; + overflow: hidden; + background-color: #28333E; + display: block; + box-shadow: 0px 0px 3px lightgray; } .pear-nav-tree .layui-nav-hover a span { - display: inline-block !important; + display: inline-block !important; } .pear-nav-tree .layui-nav-hover a i { - display: none; + display: none; } .pear-nav-tree .layui-nav-child dd a span { - margin-left: 26px !important; + margin-left: 26px !important; } .pear-nav-tree .layui-nav-child dd a i { - display: none; + display: none; } .pear-nav-tree .layui-nav-hover dd a span { - margin-left: 0px !important; + margin-left: 0px !important; } .pear-nav-tree dl { - padding-top: 0; - padding-bottom: 0; + padding-top: 0; + padding-bottom: 0; } /** 亮 样 式*/ .dark-theme .layui-nav-tree{ - background-color: #28333E!important; + background-color: #28333E!important; } .light-theme{ - background-color: white!important; + background-color: white!important; } .light-theme .pear-nav-tree, .light-theme .pear-nav-tree .layui-nav-hover:before, .light-theme .pear-nav-tree .layui-nav-child{ - background-color: white!important; + background-color: white!important; } .light-theme .pear-nav-tree a, .light-theme .pear-nav-tree .layui-nav-more{ - color: dimgray!important; - border-top-color: dimgray; + color: dimgray!important; + border-top-color: dimgray; } .light-theme .pear-nav-tree .layui-nav-itemed>a>.layui-nav-more{ - border-top-color: white!important; - border-bottom-color: dimgray!important; + border-top-color: white!important; + border-bottom-color: dimgray!important; } .light-theme .pear-nav-tree .layui-this a, .light-theme .pear-nav-tree .layui-this{ - color: white!important; - background-color: #5FB878!important; - + color: white!important; + background-color: #5FB878!important; + } .light-theme .pear-nav-tree .layui-this a:hover{ - background-color: #5FB878!important; - + background-color: #5FB878!important; + } - + .light-theme .pear-nav-tree .layui-nav-bar{ - display: none; - + display: none; + } /** 下 拉 图 标 */ .pear-nav-tree.arrow .layui-nav-more { - font-family: layui-icon !important; - font-size: 10px; - font-style: normal; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - overflow: hidden; - width: auto; - height: auto; - line-height: normal; - border: none; - top: 23px; - margin-right: 2px !important; - margin: 0; - padding: 0; - display: inline-block; - transition: all .2s; - -webkit-transition: all .2s; + font-family: layui-icon !important; + font-size: 10px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + overflow: hidden; + width: auto; + height: auto; + line-height: normal; + border: none; + top: 23px; + margin-right: 2px !important; + margin: 0; + padding: 0; + display: inline-block; + transition: all .2s; + -webkit-transition: all .2s; } .pear-nav-tree.arrow .layui-nav-child .layui-nav-more { - top: 17px; + top: 17px; } .pear-nav-tree.arrow .layui-nav-more:before { - content: "\e61a"; + content: "\e61a"; } .pear-nav-tree.arrow .layui-nav-itemed>a>.layui-nav-more { - transform: rotate(180deg); - -ms-transform: rotate(180deg); - -moz-transform: rotate(180deg); - -webkit-transform: rotate(180deg); - -o-transform: rotate(180deg); - width: 12px; - text-align: center; + transform: rotate(180deg); + -ms-transform: rotate(180deg); + -moz-transform: rotate(180deg); + -webkit-transform: rotate(180deg); + -o-transform: rotate(180deg); + width: 12px; + text-align: center; } .pear-nav-tree.arrow .layui-nav-child.layui-nav-hover>dd>a>.layui-nav-more { - display: inline-block !important; - transform: rotate(270deg); - -ms-transform: rotate(270deg); - -moz-transform: rotate(270deg); - -webkit-transform: rotate(270deg); - -o-transform: rotate(270deg); - width: 12px; - text-align: center; - background-color: transparent !important; + display: inline-block !important; + transform: rotate(270deg); + -ms-transform: rotate(270deg); + -moz-transform: rotate(270deg); + -webkit-transform: rotate(270deg); + -o-transform: rotate(270deg); + width: 12px; + text-align: center; + background-color: transparent !important; } .pear-nav-tree.arrow .layui-nav-child.layui-nav-hover>a>.layui-nav-more:before, .pear-nav-tree.arrow .layui-nav-itemed>a>.layui-nav-more:before { - content: '\e61a'; - display: inline-block; - vertical-align: middle; -} \ No newline at end of file + content: '\e61a'; + display: inline-block; + vertical-align: middle; +} diff --git a/src/main/resources/static/component/pear/css/module/message.css b/src/main/resources/static/component/pear/css/module/message.css index 6c4ef5bf..0a61d092 100644 --- a/src/main/resources/static/component/pear/css/module/message.css +++ b/src/main/resources/static/component/pear/css/module/message.css @@ -1,73 +1,133 @@ .pear-notice .layui-this { - color: #5FB878 !important; - font-weight: 500; + color: #5FB878 !important; + font-weight: 500; } .pear-notice { - box-shadow: 0 6px 16px -8px rgb(0 0 0 / 8%), 0 9px 28px 0 rgb(0 0 0 / 5%), 0 12px 48px 16px rgb(0 0 0 / 3%) !important; + box-shadow: 0 6px 16px -8px rgb(0 0 0 / 8%), 0 9px 28px 0 rgb(0 0 0 / 5%), 0 12px 48px 16px rgb(0 0 0 / 3%)!important; } .pear-notice .layui-tab-title { - text-align: center; - border-right: 1px solid whitesmoke; + display: flex; + text-align: center; + border-right: 1px solid whitesmoke; +} + +.pear-notice .layui-tab-title li { + flex: 1; + text-align: center; + border-right: 1px solid whitesmoke; +} +/*排除最后一个 li 右边框*/ +.pear-notice .layui-tab-title li:last-child { + border-right: none; } .pear-notice * { - color: dimgray !important; + color: dimgray !important; } .pear-notice { - width: 360px !important; + width: 360px !important; } .pear-notice img { - margin-left: 8px; - width: 33px !important; - height: 33px !important; - border-radius: 50px; - margin-right: 15px; + margin-left: 8px; + width: 33px !important; + height: 33px !important; + border-radius: 50px; + margin-right: 15px; } .pear-notice-item { - height: 45px !important; - line-height: 45px !important; - padding-right: 20px; - padding-left: 20px; - border-bottom: 1px solid whitesmoke; - padding-top: 10px; - padding-bottom: 15px; + height: 45px !important; + line-height: 45px !important; + padding-right: 20px; + padding-left: 20px; + border-bottom: 1px solid whitesmoke; + padding-top: 10px; + padding-bottom: 15px; } - .pear-notice-end { - float: right; - right: 10px; + float: right; + right: 10px; } -.pear-notice-item span { - height: 40px; - line-height: 40px; +.pear-notice-item span{ + height: 40px; + line-height: 40px; } /** 滚动条样式 */ .pear-notice *::-webkit-scrollbar { - width: 0px; - height: 0px; + width: 0px; + height: 0px; } .pear-notice *::-webkit-scrollbar-track { - background: white; - border-radius: 2px; + background: white; + border-radius: 2px; } .pear-notice *::-webkit-scrollbar-thumb { - background: #E6E6E6; - border-radius: 2px; + background: #E6E6E6; + border-radius: 2px; } .pear-notice *::-webkit-scrollbar-thumb:hover { - background: #E6E6E6; + background: #E6E6E6; } .pear-notice *::-webkit-scrollbar-corner { - background: #f6f6f6; -} \ No newline at end of file + background: #f6f6f6; +} +/** 增加 empty 样式 */ +.pear-empty { + font-size: 14px; + line-height: 1.5715; + min-height: 200px; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} +.pear-empty-normal { + margin: 32px 0; + color: #00000040; +} +.pear-empty-normal .pear-empty-image { + height: 40px; +} + +.pear-empty-image { + height: 100px; + margin-bottom: 8px; +} +.pear-empty-image svg { + height: 100%; + margin: auto; +} + +.pear-empty-img-simple-g { + stroke: #d9d9d9; +} +.pear-empty-img-default-g { + fill: #fff; +} +.pear-empty-img-simple-path { + fill: #fafafa; +} +.pear-empty-img-default-path-1 { + fill: #aeb8c2; +} +.pear-empty-img-default-path-2 { + fill: url(#linearGradient-1); +} +.pear-empty-img-default-path-3 { + fill: #f5f5f7; +} +.pear-empty-img-default-path-4, .pear-empty-img-default-path-5 { + fill: #dce0e6; +} + + diff --git a/src/main/resources/static/component/pear/css/module/notice.css b/src/main/resources/static/component/pear/css/module/notice.css index 866a46c4..65c9feac 100644 --- a/src/main/resources/static/component/pear/css/module/notice.css +++ b/src/main/resources/static/component/pear/css/module/notice.css @@ -1,270 +1,228 @@ .toast-title { - font-weight: bold; + font-weight: bold; } - .toast-message { - -ms-word-wrap: break-word; - word-wrap: break-word; + -ms-word-wrap: break-word; + word-wrap: break-word; } - .toast-message a, .toast-message label { - color: #FFFFFF; + color: #FFFFFF; } - .toast-message a:hover { - color: #CCCCCC; - text-decoration: none; + color: #CCCCCC; + text-decoration: none; } - .toast-close-button { - position: relative; - right: -0.3em; - top: -0.3em; - float: right; - font-size: 20px; - font-weight: bold; - color: #FFFFFF; - -webkit-text-shadow: 0 1px 0 #ffffff; - text-shadow: 0 1px 0 #ffffff; - opacity: 0.8; - -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); - filter: alpha(opacity=80); - line-height: 1; -} - + position: relative; + right: -0.3em; + top: -0.3em; + float: right; + font-size: 20px; + font-weight: bold; + color: #FFFFFF; + -webkit-text-shadow: 0 1px 0 #ffffff; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.8; + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); + filter: alpha(opacity=80); + line-height: 1; +} .toast-close-button:hover, .toast-close-button:focus { - color: #000000; - text-decoration: none; - cursor: pointer; - opacity: 0.4; - -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40); - filter: alpha(opacity=40); -} - + color: #000000; + text-decoration: none; + cursor: pointer; + opacity: 0.4; + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40); + filter: alpha(opacity=40); +} .rtl .toast-close-button { - left: -0.3em; - float: left; - right: 0.3em; + left: -0.3em; + float: left; + right: 0.3em; } - /*Additional properties for button version iOS requires the button element instead of an anchor tag. If you want the anchor version, it requires `href="#"`.*/ button.toast-close-button { - padding: 0; - cursor: pointer; - background: transparent; - border: 0; - -webkit-appearance: none; + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; } - .toast-top-center { - top: 0; - right: 0; - width: 100%; + top: 0; + right: 0; + width: 100%; } - .toast-bottom-center { - bottom: 0; - right: 0; - width: 100%; + bottom: 0; + right: 0; + width: 100%; } - .toast-top-full-width { - top: 0; - right: 0; - width: 100%; + top: 0; + right: 0; + width: 100%; } - .toast-bottom-full-width { - bottom: 0; - right: 0; - width: 100%; + bottom: 0; + right: 0; + width: 100%; } - .toast-top-left { - top: 12px; - left: 12px; + top: 12px; + left: 12px; } - .toast-top-right { - top: 12px; - right: 12px; + top: 12px; + right: 12px; } - .toast-bottom-right { - right: 12px; - bottom: 12px; + right: 12px; + bottom: 12px; } - .toast-bottom-left { - bottom: 12px; - left: 12px; + bottom: 12px; + left: 12px; } - #toast-container { - position: fixed; - z-index: 999999; - pointer-events: none; - /*overrides*/ + position: fixed; + z-index: 999999; + pointer-events: none; + /*overrides*/ } - #toast-container * { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; } - #toast-container > div { - position: relative; - pointer-events: auto; - overflow: hidden; - margin: 0 0 6px; - padding: 15px 15px 15px 50px; - width: 300px; - -moz-border-radius: 3px 3px 3px 3px; - -webkit-border-radius: 3px 3px 3px 3px; - border-radius: 3px 3px 3px 3px; - background-position: 15px center; - background-repeat: no-repeat; - -moz-box-shadow: 0 0 12px #999999; - -webkit-box-shadow: 0 0 12px #999999; - box-shadow: 0 0 12px #999999; - color: #FFFFFF; - opacity: 0.8; - -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); - filter: alpha(opacity=80); -} - + position: relative; + pointer-events: auto; + overflow: hidden; + margin: 0 0 6px; + padding: 15px 15px 15px 50px; + width: 300px; + -moz-border-radius: 3px 3px 3px 3px; + -webkit-border-radius: 3px 3px 3px 3px; + border-radius: 3px 3px 3px 3px; + background-position: 15px center; + background-repeat: no-repeat; + -moz-box-shadow: 0 0 12px #999999; + -webkit-box-shadow: 0 0 12px #999999; + box-shadow: 0 0 12px #999999; + color: #FFFFFF; + opacity: 0.8; + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); + filter: alpha(opacity=80); +} #toast-container > div.rtl { - direction: rtl; - padding: 15px 50px 15px 15px; - background-position: right 15px center; + direction: rtl; + padding: 15px 50px 15px 15px; + background-position: right 15px center; } - #toast-container > div:hover { - -moz-box-shadow: 0 0 12px #000000; - -webkit-box-shadow: 0 0 12px #000000; - box-shadow: 0 0 12px #000000; - opacity: 1; - -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); - filter: alpha(opacity=100); - cursor: pointer; -} - + -moz-box-shadow: 0 0 12px #000000; + -webkit-box-shadow: 0 0 12px #000000; + box-shadow: 0 0 12px #000000; + opacity: 1; + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); + filter: alpha(opacity=100); + cursor: pointer; +} #toast-container > .toast-info { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=") !important; + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=") !important; } - #toast-container > .toast-error { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=") !important; + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=") !important; } - #toast-container > .toast-success { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==") !important; + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==") !important; } - #toast-container > .toast-warning { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=") !important; + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=") !important; } - #toast-container.toast-top-center > div, #toast-container.toast-bottom-center > div { - width: 300px; - margin-left: auto; - margin-right: auto; + width: 300px; + margin-left: auto; + margin-right: auto; } - #toast-container.toast-top-full-width > div, #toast-container.toast-bottom-full-width > div { - width: 96%; - margin-left: auto; - margin-right: auto; + width: 96%; + margin-left: auto; + margin-right: auto; } - .toast { - background-color: #030303; + background-color: #030303; } - .toast-success { - background-color: #51A351; + background-color: #51A351; } - .toast-error { - background-color: #BD362F; + background-color: #BD362F; } - .toast-info { - background-color: #2F96B4; + background-color: #2F96B4; } - .toast-warning { - background-color: #F89406; + background-color: #F89406; } - .toast-progress { - position: absolute; - left: 0; - bottom: 0; - height: 4px; - background-color: #000000; - opacity: 0.4; - -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40); - filter: alpha(opacity=40); -} - + position: absolute; + left: 0; + bottom: 0; + height: 4px; + background-color: #000000; + opacity: 0.4; + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40); + filter: alpha(opacity=40); +} /*Responsive Design*/ @media all and (max-width: 240px) { - #toast-container > div { - padding: 8px 8px 8px 50px; - width: 11em; - } - - #toast-container > div.rtl { - padding: 8px 50px 8px 8px; - } - - #toast-container .toast-close-button { - right: -0.2em; - top: -0.2em; - } - - #toast-container .rtl .toast-close-button { - left: -0.2em; - right: 0.2em; - } -} - + #toast-container > div { + padding: 8px 8px 8px 50px; + width: 11em; + } + #toast-container > div.rtl { + padding: 8px 50px 8px 8px; + } + #toast-container .toast-close-button { + right: -0.2em; + top: -0.2em; + } + #toast-container .rtl .toast-close-button { + left: -0.2em; + right: 0.2em; + } +} @media all and (min-width: 241px) and (max-width: 480px) { - #toast-container > div { - padding: 8px 8px 8px 50px; - width: 18em; - } - - #toast-container > div.rtl { - padding: 8px 50px 8px 8px; - } - - #toast-container .toast-close-button { - right: -0.2em; - top: -0.2em; - } - - #toast-container .rtl .toast-close-button { - left: -0.2em; - right: 0.2em; - } -} - + #toast-container > div { + padding: 8px 8px 8px 50px; + width: 18em; + } + #toast-container > div.rtl { + padding: 8px 50px 8px 8px; + } + #toast-container .toast-close-button { + right: -0.2em; + top: -0.2em; + } + #toast-container .rtl .toast-close-button { + left: -0.2em; + right: 0.2em; + } +} @media all and (min-width: 481px) and (max-width: 768px) { - #toast-container > div { - padding: 15px 15px 15px 50px; - width: 25em; - } - - #toast-container > div.rtl { - padding: 15px 50px 15px 15px; - } + #toast-container > div { + padding: 15px 15px 15px 50px; + width: 25em; + } + #toast-container > div.rtl { + padding: 15px 50px 15px 15px; + } } \ No newline at end of file diff --git a/src/main/resources/static/component/pear/css/module/nprogress.css b/src/main/resources/static/component/pear/css/module/nprogress.css new file mode 100644 index 00000000..24c5cf19 --- /dev/null +++ b/src/main/resources/static/component/pear/css/module/nprogress.css @@ -0,0 +1,73 @@ +/* Make clicks pass-through */ +#nprogress { + pointer-events: none; +} + +#nprogress .bar { + background: #29d; + + position: fixed; + z-index: 999999; + top: 0; + left: 0; + + width: 100%; + height: 2px; +} + +/* Fancy blur effect */ +#nprogress .peg { + display: block; + position: absolute; + right: 0px; + width: 100px; + height: 100%; + box-shadow: 0 0 10px #29d, 0 0 5px #29d; + opacity: 1.0; + + -webkit-transform: rotate(3deg) translate(0px, -4px); + -ms-transform: rotate(3deg) translate(0px, -4px); + transform: rotate(3deg) translate(0px, -4px); +} + +/* Remove these to get rid of the spinner */ +#nprogress .spinner { + display: block; + position: fixed; + z-index: 1031; + top: 15px; + right: 15px; +} + +#nprogress .spinner-icon { + width: 18px; + height: 18px; + box-sizing: border-box; + + border: solid 2px transparent; + border-top-color: #29d; + border-left-color: #29d; + border-radius: 50%; + + -webkit-animation: nprogress-spinner 400ms linear infinite; + animation: nprogress-spinner 400ms linear infinite; +} + +.nprogress-custom-parent { + overflow: hidden; + position: relative; +} + +.nprogress-custom-parent #nprogress .spinner, +.nprogress-custom-parent #nprogress .bar { + position: absolute; +} + +@-webkit-keyframes nprogress-spinner { + 0% { -webkit-transform: rotate(0deg); } + 100% { -webkit-transform: rotate(360deg); } +} +@keyframes nprogress-spinner { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} \ No newline at end of file diff --git a/src/main/resources/static/component/pear/css/module/popover.min.css b/src/main/resources/static/component/pear/css/module/popover.min.css new file mode 100644 index 00000000..453a50fa --- /dev/null +++ b/src/main/resources/static/component/pear/css/module/popover.min.css @@ -0,0 +1 @@ +.webui-popover-content{display:none}.webui-popover-rtl{direction:rtl;text-align:right}.webui-popover{position:absolute;top:0;left:0;z-index:9999;display:none;min-width:50px;min-height:32px;padding:1px;text-align:left;white-space:normal;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.webui-popover.top,.webui-popover.top-left,.webui-popover.top-right{margin-top:-10px}.webui-popover.right,.webui-popover.right-top,.webui-popover.right-bottom{margin-left:10px}.webui-popover.bottom,.webui-popover.bottom-left,.webui-popover.bottom-right{margin-top:10px}.webui-popover.left,.webui-popover.left-top,.webui-popover.left-bottom{margin-left:-10px}.webui-popover.pop{-webkit-transform:scale(0.8);-o-transform:scale(0.8);transform:scale(0.8);-webkit-transition:transform .15s cubic-bezier(0.3,0,0,1.5);-o-transition:transform .15s cubic-bezier(0.3,0,0,1.5);transition:transform .15s cubic-bezier(0.3,0,0,1.5);opacity:0;filter:alpha(opacity=0)}.webui-popover.pop-out{-webkit-transition-property:"opacity,transform";-o-transition-property:"opacity,transform";transition-property:"opacity,transform";-webkit-transition:.15s linear;-o-transition:.15s linear;transition:.15s linear;opacity:0;filter:alpha(opacity=0)}.webui-popover.fade,.webui-popover.fade-out{-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear;opacity:0;filter:alpha(opacity=0)}.webui-popover.out{opacity:0;filter:alpha(opacity=0)}.webui-popover.in{-webkit-transform:none;-o-transform:none;transform:none;opacity:1;filter:alpha(opacity=100)}.webui-popover .webui-popover-content{padding:9px 14px;overflow:auto;display:block}.webui-popover .webui-popover-content>div:first-child{width:99%}.webui-popover-inner .close{font-family:arial;margin:8px 10px 0 0;float:right;font-size:16px;font-weight:700;line-height:16px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20);text-decoration:none}.webui-popover-inner .close:hover,.webui-popover-inner .close:focus{opacity:.5;filter:alpha(opacity=50)}.webui-popover-inner .close:after{content:"\00D7";width:.8em;height:.8em;padding:4px;position:relative}.webui-popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:700;line-height:18px;background-color:#fff;border-bottom:1px solid #f2f2f2;border-radius:5px 5px 0 0}.webui-popover-content{padding:9px 14px;overflow:auto;display:none}.webui-popover-inverse{background-color:#333;color:#eee}.webui-popover-inverse .webui-popover-title{background:#333;border-bottom:1px solid #3b3b3b;color:#eee}.webui-no-padding .webui-popover-content{padding:0}.webui-no-padding .list-group-item{border-right:none;border-left:none}.webui-no-padding .list-group-item:first-child{border-top:0}.webui-no-padding .list-group-item:last-child{border-bottom:0}.webui-popover>.webui-arrow,.webui-popover>.webui-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.webui-popover>.webui-arrow{border-width:11px}.webui-popover>.webui-arrow:after{border-width:10px;content:""}.webui-popover.top>.webui-arrow,.webui-popover.top-right>.webui-arrow,.webui-popover.top-left>.webui-arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.webui-popover.top>.webui-arrow:after,.webui-popover.top-right>.webui-arrow:after,.webui-popover.top-left>.webui-arrow:after{content:" ";bottom:1px;margin-left:-10px;border-top-color:#fff;border-bottom-width:0}.webui-popover.right>.webui-arrow,.webui-popover.right-top>.webui-arrow,.webui-popover.right-bottom>.webui-arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0,0,0,.25)}.webui-popover.right>.webui-arrow:after,.webui-popover.right-top>.webui-arrow:after,.webui-popover.right-bottom>.webui-arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#fff}.webui-popover.bottom>.webui-arrow,.webui-popover.bottom-right>.webui-arrow,.webui-popover.bottom-left>.webui-arrow{top:-11px;left:50%;margin-left:-11px;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25);border-top-width:0}.webui-popover.bottom>.webui-arrow:after,.webui-popover.bottom-right>.webui-arrow:after,.webui-popover.bottom-left>.webui-arrow:after{content:" ";top:1px;margin-left:-10px;border-bottom-color:#fff;border-top-width:0}.webui-popover.left>.webui-arrow,.webui-popover.left-top>.webui-arrow,.webui-popover.left-bottom>.webui-arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.webui-popover.left>.webui-arrow:after,.webui-popover.left-top>.webui-arrow:after,.webui-popover.left-bottom>.webui-arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#fff;bottom:-10px}.webui-popover-inverse.top>.webui-arrow,.webui-popover-inverse.top-left>.webui-arrow,.webui-popover-inverse.top-right>.webui-arrow,.webui-popover-inverse.top>.webui-arrow:after,.webui-popover-inverse.top-left>.webui-arrow:after,.webui-popover-inverse.top-right>.webui-arrow:after{border-top-color:#333}.webui-popover-inverse.right>.webui-arrow,.webui-popover-inverse.right-top>.webui-arrow,.webui-popover-inverse.right-bottom>.webui-arrow,.webui-popover-inverse.right>.webui-arrow:after,.webui-popover-inverse.right-top>.webui-arrow:after,.webui-popover-inverse.right-bottom>.webui-arrow:after{border-right-color:#333}.webui-popover-inverse.bottom>.webui-arrow,.webui-popover-inverse.bottom-left>.webui-arrow,.webui-popover-inverse.bottom-right>.webui-arrow,.webui-popover-inverse.bottom>.webui-arrow:after,.webui-popover-inverse.bottom-left>.webui-arrow:after,.webui-popover-inverse.bottom-right>.webui-arrow:after{border-bottom-color:#333}.webui-popover-inverse.left>.webui-arrow,.webui-popover-inverse.left-top>.webui-arrow,.webui-popover-inverse.left-bottom>.webui-arrow,.webui-popover-inverse.left>.webui-arrow:after,.webui-popover-inverse.left-top>.webui-arrow:after,.webui-popover-inverse.left-bottom>.webui-arrow:after{border-left-color:#333}.webui-popover i.icon-refresh:before{content:""}.webui-popover i.icon-refresh{display:block;width:30px;height:30px;font-size:20px;top:50%;left:50%;position:absolute;margin-left:-15px;margin-right:-15px;background:url(../img/loading.gif) no-repeat}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg)}}@keyframes rotate{100%{transform:rotate(360deg)}}.webui-popover-backdrop{background-color:rgba(0,0,0,.65);width:100%;height:100%;position:fixed;top:0;left:0;z-index:9998}.webui-popover .dropdown-menu{display:block;position:relative;top:0;border:none;box-shadow:none;float:none} \ No newline at end of file diff --git a/src/main/resources/static/component/pear/css/module/select.css b/src/main/resources/static/component/pear/css/module/select.css index 9745bb29..53285a68 100644 --- a/src/main/resources/static/component/pear/css/module/select.css +++ b/src/main/resources/static/component/pear/css/module/select.css @@ -1,825 +1,822 @@ /* formSelects多选css */ select[xm-select] { - display: none !important; + display: none !important; } .xm-select-parent * { - margin: 0; - padding: 0; - font-family: "Helvetica Neue", Helvetica, "PingFang SC", 微软雅黑, Tahoma, Arial, sans-serif; - box-sizing: initial; + margin: 0; + padding: 0; + font-family: "Helvetica Neue", Helvetica, "PingFang SC", 微软雅黑, Tahoma, Arial, sans-serif; + box-sizing: initial; } .xm-select-parent { - text-align: left; + text-align: left; } .xm-select-parent select { - display: none; + display: none; } .xm-select-parent .xm-select-title { - position: relative; - min-height: 36px; + position: relative; + min-height: 36px; } .xm-select-parent .xm-input { - cursor: pointer; - border-radius: 2px; - border-width: 1px; - border-style: solid; - border-color: #E6E6E6; - display: block; - width: 100%; - box-sizing: border-box; - background-color: #FFF; - height: 36px; - line-height: 1.3; - padding-left: 10px; - outline: 0 + cursor: pointer; + border-radius: 2px; + border-width: 1px; + border-style: solid; + border-color: #E6E6E6; + display: block; + width: 100%; + box-sizing: border-box; + background-color: #FFF; + height: 36px; + line-height: 1.3; + padding-left: 10px; + outline: 0 } .xm-select-parent .xm-select-sj { - display: inline-block; - width: 0; - height: 0; - border-style: dashed; - border-color: transparent; - overflow: hidden; - position: absolute; - right: 10px; - top: 50%; - margin-top: -3px; - cursor: pointer; - border-width: 6px; - border-top-color: #C2C2C2; - border-top-style: solid; - transition: all .3s; - -webkit-transition: all .3s + display: inline-block; + width: 0; + height: 0; + border-style: dashed; + border-color: transparent; + overflow: hidden; + position: absolute; + right: 10px; + top: 50%; + margin-top: -3px; + cursor: pointer; + border-width: 6px; + border-top-color: #C2C2C2; + border-top-style: solid; + transition: all .3s; + -webkit-transition: all .3s } .xm-select-parent .xm-form-selected .xm-select-sj { - margin-top: -9px; - transform: rotate(180deg) + margin-top: -9px; + transform: rotate(180deg) } .xm-select-parent .xm-form-select dl { - display: none; - position: absolute; - left: 0; - top: 42px; - padding: 5px 0; - z-index: 999; - min-width: 100%; - border: 1px solid #d2d2d2; - max-height: 300px; - overflow-y: auto; - background-color: #fff; - border-radius: 2px; - box-shadow: 0 2px 4px rgba(0, 0, 0, .12); - box-sizing: border-box; - animation-fill-mode: both; - -webkit-animation-name: layui-upbit; - animation-name: layui-upbit; - -webkit-animation-duration: .3s; - animation-duration: .3s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both + display: none; + position: absolute; + left: 0; + top: 42px; + padding: 5px 0; + z-index: 999; + min-width: 100%; + border: 1px solid #d2d2d2; + max-height: 300px; + overflow-y: auto; + background-color: #fff; + border-radius: 2px; + box-shadow: 0 2px 4px rgba(0, 0, 0, .12); + box-sizing: border-box; + animation-fill-mode: both; + -webkit-animation-name: layui-upbit; + animation-name: layui-upbit; + -webkit-animation-duration: .3s; + animation-duration: .3s; + -webkit-animation-fill-mode: both; + animation-fill-mode: both } @-webkit-keyframes layui-upbit { - from { - -webkit-transform: translate3d(0, 30px, 0); - opacity: .3 - } + from { + -webkit-transform: translate3d(0, 30px, 0); + opacity: .3 + } - to { - -webkit-transform: translate3d(0, 0, 0); - opacity: 1 - } + to { + -webkit-transform: translate3d(0, 0, 0); + opacity: 1 + } } @keyframes layui-upbit { - from { - transform: translate3d(0, 30px, 0); - opacity: .3 - } + from { + transform: translate3d(0, 30px, 0); + opacity: .3 + } - to { - transform: translate3d(0, 0, 0); - opacity: 1 - } + to { + transform: translate3d(0, 0, 0); + opacity: 1 + } } .xm-select-parent .xm-form-selected dl { - display: block + display: block } .xm-select-parent .xm-form-select dl dd, .xm-select-parent .xm-form-select dl dt { - padding: 0 10px; - line-height: 36px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis + padding: 0 10px; + line-height: 36px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis } .xm-select-parent .xm-form-select dl dd { - cursor: pointer; - height: 36px; + cursor: pointer; + height: 36px; } .xm-select-parent .xm-form-select dl dd:hover { - background-color: #f2f2f2 + background-color: #f2f2f2 } .xm-select-parent .xm-form-select dl dt { - font-size: 12px; - color: #999 + font-size: 12px; + color: #999 } .layui-select-disabled .xm-dis-disabled { - border-color: #eee !important + border-color: #eee !important } .xm-select-parent .xm-form-select dl .xm-select-tips { - padding-left: 10px !important; - color: #999; - font-size: 14px + padding-left: 10px !important; + color: #999; + font-size: 14px } .xm-unselect { - -moz-user-select: none; - -webkit-user-select: none; - -ms-user-select: none + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none } .xm-form-checkbox { - position: relative; - display: block; - vertical-align: middle; - cursor: pointer; - font-size: 0; - -webkit-transition: .1s linear; - transition: .1s linear; - box-sizing: border-box; - height: auto !important; - line-height: normal !important; - border: none !important; - margin-right: 0; - padding-right: 0; - background: 0 0; -} - -.xm-form-checkbox > i { - color: #FFF; - font-size: 16px; - width: 16px; - height: 16px; - position: absolute; - top: 9px; - border: 1px solid #5FB878; - border-radius: 3px; - z-index: 2; -} - -.xm-form-checkbox:hover > i { - border-color: #5FB878; -} - -.xm-form-checkbox > span { - display: block; - position: relative; - padding: 0 15px 0 30px; - height: 100%; - font-size: 14px; - border-radius: 2px 0 0 2px; - background-color: #d2d2d2; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - background: 0 0; - color: #666; - line-height: 36px; + position: relative; + display: block; + vertical-align: middle; + cursor: pointer; + font-size: 0; + -webkit-transition: .1s linear; + transition: .1s linear; + box-sizing: border-box; + height: auto !important; + line-height: normal !important; + border: none !important; + margin-right: 0; + padding-right: 0; + background: 0 0; +} + +.xm-form-checkbox>i { + color: #FFF; + font-size: 16px; + width: 16px; + height: 16px; + position: absolute; + top: 9px; + border: 1px solid #5FB878; + border-radius: 3px; + z-index: 2; +} + +.xm-form-checkbox:hover>i { + border-color: #5FB878; +} + +.xm-form-checkbox>span { + display: block; + position: relative; + padding: 0 15px 0 30px; + height: 100%; + font-size: 14px; + border-radius: 2px 0 0 2px; + background-color: #d2d2d2; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + background: 0 0; + color: #666; + line-height: 36px; } .xm-select-parent dl { - width: 100%; + width: 100%; } .xm-select-parent dl dd { - position: relative; + position: relative; } -.xm-select-parent dl dd > i:not(.icon-sousuo) { - position: absolute; - right: 10px; - top: 0; - color: #AAAAAA; +.xm-select-parent dl dd>i:not(.icon-sousuo) { + position: absolute; + right: 10px; + top: 0; + color: #AAAAAA; } .xm-select-parent dl dd.xm-select-this div i { - border: none; - color: #5FB878; - font-size: 18px; + border: none; + color: #5FB878; + font-size: 18px; } .xm-select-parent dl dd.xm-select-this div i:after { - content: '\e613'; + content: '\e613'; } .xm-select-parent dl dd.xm-dis-disabled div i { - border-color: #C2C2C2; + border-color: #C2C2C2; } .xm-select-parent dl dd.xm-dis-disabled.xm-select-this div i { - color: #C2C2C2; + color: #C2C2C2; } -.xm-select-radio div.xm-form-checkbox > i { - border-radius: 20px; +.xm-select-radio div.xm-form-checkbox>i { + border-radius: 20px; } .xm-select-parent dl.xm-select-radio dd.xm-select-this div i:after { - content: '\e62b'; + content: '\e62b'; } .xm-dis-disabled, .xm-dis-disabled:hover { - cursor: not-allowed !important + cursor: not-allowed !important } .xm-form-select dl dd.xm-dis-disabled { - background-color: #fff !important + background-color: #fff !important } .xm-form-select dl dd.xm-dis-disabled span { - color: #C2C2C2 + color: #C2C2C2 } .xm-form-select dl dd.xm-dis-disabled .xm-icon-yes { - border-color: #C2C2C2 + border-color: #C2C2C2 } .xm-select-parent { - position: relative; - -moz-user-select: none; - -ms-user-select: none; - -webkit-user-select: none + position: relative; + -moz-user-select: none; + -ms-user-select: none; + -webkit-user-select: none } .xm-select-parent .xm-select { - line-height: normal; - height: auto; - padding: 4px 10px 1px 10px; - overflow: hidden; - min-height: 36px; - left: 0; - z-index: 99; - position: absolute; - background: 0 0; - padding-right: 20px + line-height: normal; + height: auto; + padding: 4px 10px 1px 10px; + overflow: hidden; + min-height: 36px; + left: 0; + z-index: 99; + position: absolute; + background: 0 0; + padding-right: 20px } .xm-select-parent .xm-select:hover { - border-color: #C0C4CC + border-color: #C0C4CC } .xm-select-parent .xm-select .xm-select-label { - display: inline-block; - margin: 0; - vertical-align: middle -} - -.xm-select-parent .xm-select-title div.xm-select-label > span { - position: relative; - padding: 2px 5px; - background-color: #5FB878; - border-radius: 2px; - color: #FFF; - display: inline-block; - line-height: 18px; - height: 18px; - margin: 2px 5px 2px 0; - cursor: initial; - user-select: none; - font-size: 14px; - padding-right: 25px; - -webkit-user-select: none; -} - -.xm-select-parent .xm-select-title div.xm-select-label > span i { - position: absolute; - margin-left: 8px; - font-size: 12px; - cursor: pointer; - line-height: 20px; + display: inline-block; + margin: 0; + vertical-align: middle +} + +.xm-select-parent .xm-select-title div.xm-select-label>span { + position: relative; + padding: 2px 5px; + background-color: #5FB878; + border-radius: 2px; + color: #FFF; + display: inline-block; + line-height: 18px; + height: 18px; + margin: 2px 5px 2px 0; + cursor: initial; + user-select: none; + font-size: 14px; + padding-right: 25px; + -webkit-user-select: none; +} + +.xm-select-parent .xm-select-title div.xm-select-label>span i { + position: absolute; + margin-left: 8px; + font-size: 12px; + cursor: pointer; + line-height: 20px; } .xm-select-parent .xm-select .xm-select-input { - border: none; - height: 28px; - background-color: transparent; - padding: 0; - vertical-align: middle; - display: inline-block; - width: 50px + border: none; + height: 28px; + background-color: transparent; + padding: 0; + vertical-align: middle; + display: inline-block; + width: 50px } .xm-select-parent .xm-select--suffix input { - border: none + border: none } .xm-form-selected .xm-select, .xm-form-selected .xm-select:hover { - border-color: #67c23a !important + border-color: #67c23a !important } -.xm-select--suffix + div { - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0 +.xm-select--suffix+div { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0 } -.xm-select-dis .xm-select--suffix + div { - z-index: 100; - cursor: no-drop !important; - opacity: .2; - background-color: #FFF; +.xm-select-dis .xm-select--suffix+div { + z-index: 100; + cursor: no-drop !important; + opacity: .2; + background-color: #FFF; } .xm-select-disabled, .xm-select-disabled:hover { - color: #d2d2d2 !important; - cursor: not-allowed !important; - background-color: #fff + color: #d2d2d2 !important; + cursor: not-allowed !important; + background-color: #fff } .xm-select-none { - display: none; - margin: 5px 0; - text-align: center; + display: none; + margin: 5px 0; + text-align: center; } .xm-select-none:hover { - background-color: #FFF !important + background-color: #FFF !important } .xm-select-empty { - display: block + display: block } .xm-span-hide { - display: none !important; + display: none !important; } .layui-form-pane .xm-select, .layui-form-pane .xm-select:hover { - border: none !important; - top: 0px + border: none !important; + top: 0px } .layui-form-pane .xm-select-title { - border: 1px solid #e6e6e6 !important + border: 1px solid #e6e6e6 !important } .xm-select-hide { - display: none !important; + display: none !important; } div[xm-hg] .xm-select-label { - white-space: nowrap; - overflow: hidden; - position: absolute; - right: 30px; - left: 0; - padding-left: 10px; + white-space: nowrap; + overflow: hidden; + position: absolute; + right: 30px; + left: 0; + padding-left: 10px; } /* 颜色相关 */ -div[xm-select-skin] .xm-select-title div.xm-select-label > span { - border: 1px solid #67c23a +div[xm-select-skin] .xm-select-title div.xm-select-label>span { + border: 1px solid #67c23a } -div[xm-select-skin] .xm-select-title div.xm-select-label > span i:hover { - opacity: .8; - filter: alpha(opacity=80); - cursor: pointer +div[xm-select-skin] .xm-select-title div.xm-select-label>span i:hover { + opacity: .8; + filter: alpha(opacity=80); + cursor: pointer } -div[xm-select-skin=default] .xm-select-title div.xm-select-label > span { - background-color: #F0F2F5; - color: #909399; - border: 1px solid #F0F2F5 +div[xm-select-skin=default] .xm-select-title div.xm-select-label>span { + background-color: #F0F2F5; + color: #909399; + border: 1px solid #F0F2F5 } -div[xm-select-skin=default] .xm-select-title div.xm-select-label > span i { - color: #C0C4CC +div[xm-select-skin=default] .xm-select-title div.xm-select-label>span i { + color: #C0C4CC } -div[xm-select-skin=default] .xm-select-title div.xm-select-label > span i:before { - content: '\e60b'; - font-size: 16px; - margin-left: -3px; +div[xm-select-skin=default] .xm-select-title div.xm-select-label>span i:before { + content: '\e60b'; + font-size: 16px; + margin-left: -3px; } div[xm-select-skin=default] dl dd:not(.xm-dis-disabled) i { - border-color: #5FB878 + border-color: #5FB878 } div[xm-select-skin=default] dl dd.xm-select-this:not(.xm-dis-disabled) i { - color: #5FB878 + color: #5FB878 } div[xm-select-skin=default].xm-form-selected .xm-select, div[xm-select-skin=default].xm-form-selected .xm-select:hover { - border-color: #C0C4CC !important + border-color: #C0C4CC!important } -div[xm-select-skin=primary] .xm-select-title div.xm-select-label > span { - background-color: #5FB878 !important - color: #FFF; - border: 1px solid #5FB878 !important +div[xm-select-skin=primary] .xm-select-title div.xm-select-label>span { + background-color: #5FB878!important; + color: #FFF; + border: 1px solid #5FB878!important } -div[xm-select-skin=primary] .xm-select-title div.xm-select-label > span i { - background-color: #5FB878 !important - color: #FFF +div[xm-select-skin=primary] .xm-select-title div.xm-select-label>span i { + background-color: #5FB878!important; + color: #FFF } div[xm-select-skin=primary] dl dd:not(.xm-dis-disabled) i { - border-color: #5FB878 !important + border-color: #5FB878!important } div[xm-select-skin=primary] dl dd.xm-select-this:not(.xm-dis-disabled) i { - color: #5FB878 !important + color: #5FB878!important } div[xm-select-skin=primary].xm-form-selected .xm-select, div[xm-select-skin=primary].xm-form-selected .xm-select:hover { - border-color: #5FB878 !important + border-color: #5FB878!important } -div[xm-select-skin=normal] .xm-select-title div.xm-select-label > span { - background-color: #2D8CF0 !important; - color: #FFF; - border: 1px solid #2D8CF0 !important; +div[xm-select-skin=normal] .xm-select-title div.xm-select-label>span { + background-color: #2D8CF0!important; + color: #FFF; + border: 1px solid #2D8CF0!important; } -div[xm-select-skin=normal] .xm-select-title div.xm-select-label > span i { - background-color: #2D8CF0 !important; - color: #FFF +div[xm-select-skin=normal] .xm-select-title div.xm-select-label>span i { + background-color: #2D8CF0!important; + color: #FFF } div[xm-select-skin=normal] dl dd:not(.xm-dis-disabled) i { - border-color: #2D8CF0 !important; + border-color: #2D8CF0!important; } div[xm-select-skin=normal] dl dd.xm-select-this:not(.xm-dis-disabled) i { - color: #2D8CF0 !important; + color:#2D8CF0 !important; } div[xm-select-skin=normal].xm-form-selected .xm-select, div[xm-select-skin=normal].xm-form-selected .xm-select:hover { - border-color: #2D8CF0 !important; + border-color:#2D8CF0!important; } -div[xm-select-skin=warm] .xm-select-title div.xm-select-label > span { - background-color: #e6a23c !important; - color: #FFF; - border: 1px solid #e6a23c !important; +div[xm-select-skin=warm] .xm-select-title div.xm-select-label>span { + background-color: #e6a23c!important; + color: #FFF; + border: 1px solid #e6a23c!important; } -div[xm-select-skin=warm] .xm-select-title div.xm-select-label > span i { - background-color: #e6a23c !important; - color: #FFF +div[xm-select-skin=warm] .xm-select-title div.xm-select-label>span i { + background-color: #e6a23c!important; + color: #FFF } div[xm-select-skin=warm] dl dd:not(.xm-dis-disabled) i { - border-color: #e6a23c !important + border-color:#e6a23c!important } div[xm-select-skin=warm] dl dd.xm-select-this:not(.xm-dis-disabled) i { - color: #e6a23c !important + color:#e6a23c!important } div[xm-select-skin=warm].xm-form-selected .xm-select, div[xm-select-skin=warm].xm-form-selected .xm-select:hover { - border-color: #e6a23c !important + border-color: #e6a23c!important } -div[xm-select-skin=danger] .xm-select-title div.xm-select-label > span { - background-color: #f56c6c !important; - color: #FFF; - border: 1px solid #f56c6c !important; +div[xm-select-skin=danger] .xm-select-title div.xm-select-label>span { + background-color: #f56c6c!important; + color: #FFF; + border: 1px solid #f56c6c!important; } -div[xm-select-skin=danger] .xm-select-title div.xm-select-label > span i { - background-color: #f56c6c !important - color: #FFF +div[xm-select-skin=danger] .xm-select-title div.xm-select-label>span i { + background-color:#f56c6c!important; + color: #FFF } div[xm-select-skin=danger] dl dd:not(.xm-dis-disabled) i { - border-color: #f56c6c !important + border-color: #f56c6c!important } div[xm-select-skin=danger] dl dd.xm-select-this:not(.xm-dis-disabled) i { - color: #f56c6c !important + color: #f56c6c!important } div[xm-select-skin=danger].xm-form-selected .xm-select, div[xm-select-skin=danger].xm-form-selected .xm-select:hover { - border-color: #f56c6c !important + border-color: #f56c6c!important } /* 多选联动 */ -.xm-select-parent .layui-form-danger + .xm-select-title .xm-select { - border-color: #f56c6c !important +.xm-select-parent .layui-form-danger+.xm-select-title .xm-select { + border-color: #f56c6c!important } .xm-select-linkage li { - padding: 10px 0px; - cursor: pointer; + padding: 10px 0px; + cursor: pointer; } .xm-select-linkage li span { - padding-left: 20px; - padding-right: 30px; - display: inline-block; - height: 20px; - overflow: hidden; - text-overflow: ellipsis; + padding-left: 20px; + padding-right: 30px; + display: inline-block; + height: 20px; + overflow: hidden; + text-overflow: ellipsis; } .xm-select-linkage li.xm-select-this span { - border-left: 5px solid #009688; - color: #009688; - padding-left: 15px; + border-left: 5px solid #009688; + color: #009688; + padding-left: 15px; } .xm-select-linkage-group { - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - overflow-x: hidden; - overflow-y: auto; + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + overflow-x: hidden; + overflow-y: auto; } .xm-select-linkage-group li:hover { - border-left: 1px solid #009688; + border-left: 1px solid #009688; } .xm-select-linkage-group li:hover span { - padding-left: 19px; + padding-left: 19px; } .xm-select-linkage-group li.xm-select-this:hover span { - padding-left: 15px; - border-left-width: 4px; + padding-left: 15px; + border-left-width: 4px; } .xm-select-linkage-group:nth-child(4n+1) { - background-color: #EFEFEF; - left: 0; + background-color: #EFEFEF; + left: 0; } .xm-select-linkage-group:nth-child(4n+1) li.xm-select-active { - background-color: #F5F5F5; + background-color: #F5F5F5; } .xm-select-linkage-group:nth-child(4n+2) { - background-color: #F5F5F5; - left: 100px; + background-color: #F5F5F5; + left: 100px; } .xm-select-linkage-group:nth-child(4n+3) li.xm-select-active { - background-color: #FAFAFA; + background-color: #FAFAFA; } .xm-select-linkage-group:nth-child(4n+3) { - background-color: #FAFAFA; - left: 200px; + background-color: #FAFAFA; + left: 200px; } .xm-select-linkage-group:nth-child(4n+3) li.xm-select-active { - background-color: #FFFFFF; + background-color: #FFFFFF; } .xm-select-linkage-group:nth-child(4n+4) { - background-color: #FFFFFF; - left: 300px; + background-color: #FFFFFF; + left: 300px; } .xm-select-linkage-group:nth-child(4n+4) li.xm-select-active { - background-color: #EFEFEF; + background-color: #EFEFEF; } .xm-select-linkage li { - list-style: none; + list-style: none; } .xm-select-linkage-hide { - display: none; + display: none; } .xm-select-linkage-show { - display: block; + display: block; } div[xm-select-skin='default'] .xm-select-linkage li.xm-select-this span { - border-left-color: #5FB878; - color: #5FB878; + border-left-color: #5FB878; + color: #5FB878; } div[xm-select-skin='default'] .xm-select-linkage-group li:hover { - border-left-color: #5FB878; + border-left-color: #5FB878; } div[xm-select-skin='primary'] .xm-select-linkage li.xm-select-this span { - border-left-color: #1E9FFF; - color: #1E9FFF; + border-left-color: #1E9FFF; + color: #1E9FFF; } div[xm-select-skin='primary'] .xm-select-linkage-group li:hover { - border-left-color: #1E9FFF; + border-left-color: #1E9FFF; } div[xm-select-skin='normal'] .xm-select-linkage li.xm-select-this span { - border-left-color: #1E9FFF; - color: #1E9FFF; + border-left-color: #1E9FFF; + color: #1E9FFF; } div[xm-select-skin='normal'] .xm-select-linkage-group li:hover { - border-left-color: #1E9FFF; + border-left-color: #1E9FFF; } div[xm-select-skin='warm'] .xm-select-linkage li.xm-select-this span { - border-left-color: #FFB800; - color: #FFB800; + border-left-color: #FFB800; + color: #FFB800; } div[xm-select-skin='warm'] .xm-select-linkage-group li:hover { - border-left-color: #FFB800; + border-left-color: #FFB800; } div[xm-select-skin='danger'] .xm-select-linkage li.xm-select-this span { - border-left-color: #FF5722; - color: #FF5722; + border-left-color: #FF5722; + color: #FF5722; } div[xm-select-skin='danger'] .xm-select-linkage-group li:hover { - border-left-color: #FF5722; + border-left-color: #FF5722; } /* 快捷操作 */ .xm-select-tips[style]:hover { - background-color: #FFF !important; + background-color: #FFF !important; } -.xm-select-parent dd > .xm-cz { - position: absolute; - top: 0px; - right: 10px; +.xm-select-parent dd>.xm-cz { + position: absolute; + top: 0px; + right: 10px; } -.xm-select-parent dd > .xm-cz-group { - margin-right: 30px; - border-right: 2px solid #ddd; - height: 16px; - margin-top: 10px; - line-height: 16px; - overflow: hidden; +.xm-select-parent dd>.xm-cz-group { + margin-right: 30px; + border-right: 2px solid #ddd; + height: 16px; + margin-top: 10px; + line-height: 16px; + overflow: hidden; } -.xm-select-parent dd > .xm-cz-group .xm-cz { - display: inline-block; - margin-right: 30px; +.xm-select-parent dd>.xm-cz-group .xm-cz { + display: inline-block; + margin-right: 30px; } -.xm-select-parent dd > .xm-cz-group .xm-cz i { - margin-right: 10px; +.xm-select-parent dd>.xm-cz-group .xm-cz i { + margin-right: 10px; } -.xm-select-parent dd > .xm-cz-group[show='name'] .xm-cz i { - display: none; +.xm-select-parent dd>.xm-cz-group[show='name'] .xm-cz i { + display: none; } -.xm-select-parent dd > .xm-cz-group[show='icon'] .xm-cz span { - display: none; +.xm-select-parent dd>.xm-cz-group[show='icon'] .xm-cz span { + display: none; } .xm-select-parent dd .xm-cz:hover { - color: #009688; + color: #009688; } div[xm-select-skin='default'] dd .xm-cz:hover { - color: #C0C4CC; + color: #C0C4CC; } div[xm-select-skin='primary'] dd .xm-cz:hover { - color: #009688; + color: #009688; } div[xm-select-skin='normal'] dd .xm-cz:hover { - color: #1E9FFF; + color: #1E9FFF; } div[xm-select-skin='warm'] dd .xm-cz:hover { - color: #FFB800; + color: #FFB800; } div[xm-select-skin='danger'] dd .xm-cz:hover { - color: #FF5722; + color: #FF5722; } .xm-select-tips .xm-input { - border: none; - border-bottom: 1px solid #E6E6E6; - padding-left: 27px; + border: none; + border-bottom: 1px solid #E6E6E6; + padding-left: 27px; } .xm-select-tips .icon-sousuo { - position: absolute; + position: absolute; } .xm-select-tips.xm-dl-input { - display: none; + display: none; } div[xm-select-search-type="1"] .xm-select-tips.xm-dl-input { - display: block; + display: block; } div[xm-select-search-type="1"] .xm-select .xm-select-input { - display: none !important; + display: none !important; } @font-face { - font-family: "xm-iconfont"; - src: url('//at.alicdn.com/t/font_792691_qxv28s6g1l9.eot?t=1534240067831'); - /* IE9*/ - src: url('//at.alicdn.com/t/font_792691_qxv28s6g1l9.eot?t=1534240067831#iefix') format('embedded-opentype'), - /* IE6-IE8 */ url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAsYAAsAAAAAEQwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8ukovY21hcAAAAYAAAACrAAACPBtV6wxnbHlmAAACLAAABnEAAAmMovtEvWhlYWQAAAigAAAAMQAAADYSctBCaGhlYQAACNQAAAAgAAAAJAgBA69obXR4AAAI9AAAABsAAAAwMCX//WxvY2EAAAkQAAAAGgAAABoN8gwubWF4cAAACSwAAAAeAAAAIAEiAM9uYW1lAAAJTAAAAUUAAAJtPlT+fXBvc3QAAAqUAAAAhAAAALJ1LunfeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkYWacwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGByeMbwwZ27438AQw9zMcAQozAiSAwDk4AxmeJzlks0JwzAMhZ8bN/1xD4GU0h2Se26BbJMJOkkn6KmTPbJF8mT5UGg3qMRn0EPIRs8A9gAq0YsIhDcCLF5SQ9YrnLMe8VB9RSMlMjCxYcueIyfOy7CuAFHU7lP9iqApt5L3ksBJbzlgZ9PVkXDUvbWa6x8T/i0u+XyWKtmmHW0NDI55yeRok2DjaKdg65jX7Bzzm71jXnN08vzJkQvg7Ng/WAYH9Qb3wzM/AHicjVVvbFzFEd/Zfbv7/vn9uXf33vl8Pt/dO99BHOzEZ9/DKTImRS0KjUoLDUFCjtpCMGkT1D9qldQmhkiUSv2G1BBB1VYqilGREOIDViWEGzttqkpI/cAXqyL5gFRALVIF+VCJe9fZd+fEpR/o6d3s7G9mZ2dmZ3aJIKR3h0ZYmVgkIjGZJV8mDxECtenOTDOu1UU+hJoD+TCqzcNMk2V8O5OCbDVRPgZhEt4JCNTZ/4HA3+DfuWIxl8pcFFErG3K7oD7fvev8UaMUmEu259lrRjBsfs6cLhYbRfzSbSjGRVAkfQYihUXsyPkHTVyyZDNmXzSHg3Tl+aPKxpJFqbWGdtLl8w8iYDxuDTQIx7yc1YCdIx7Jk3HSwbwQwGBcyMKZVtG0ZCuJxjFJBb+foMSfhJaPOSr4FYgwSwqIx2MHJALtAdBi/7xcSMJL+fxmmBS2guD61tZm96X02mgcj0J1NAaIR9UMmhXIV24FuLUC71+r1AEmK1AYrQHUK/Tly/m8MrOZz2+FSf7jzc3NK9XR9F2lVq+gmRp0r+HK9B+VJmR263Rgd7ALwR/FOFfx/FeJS0YxQh9drakgMJhaBVizkwgqWxLD6eQ0Qo8f7p44fJziSH9x+PjLZUO+/jZ9+K35X37ljn/Rv+yW4Ziuf2nl4PfS5/LrP47OHTsFJULYjf369UZAEBmSqEOSJmG4Me6LeznA0BFkcDoJlGynVzmH2vY21DhPr25v9DjvbfTp2TXG1s5mlK0q4S7lT++6obbRox/s6CHF2LMEsHvoFfSFQIKnKQMZJVFCD6WH0p0PVvvcRx8uph8eUks0jOFNtskOkpDsJ18k9+NqVRg3qqMCSSerjyRuYUi1/vFH7YIqikGVcD+ehFl/pqPSPKZ6DG6mHisljFhBFvU/PoRkSNd/JHO6Ja5JOXcfwIGJbm/igBq/hn8Kfb57YbYUxyX4cwkLKH1u4gD9GVSL6USxCjjCO2p8VdcvH9XRYIQWqUblu3pR/v2BvXMAc3tTmJiDAQ895B9NL0C9BFdKqqRKczDX/Whg7O1irVbcqZ8/sbfYBOZwihC+6wSDzszUf+dF7rRO1O+fKaDO+nXOr6+vf8L5J44Qe4UvnlyRntwrxMoKzpFdeRJBNb9dGyiur1+nE59R+uwi9M1G395jb9KP0bcK2YM9nJB5cojcS75OFskxclzdc+pW699z8iYbtf14BGKf77ruZNyXKC0e50OEBI+V/Aug5Dex/9WjJfipuqnS00gfybjXbNe1f762tXmRPp3Bdl/l6g5JXyqXR0bK8J3PR+jvwYs8/GBnTM+kr8FX4ZknwC16XtG9iH9QfNn1vDHPe2GAj3ieV3XdF2+IPdeteh62Ra+HfQrsKWKSBtlHSOBgM7KkKQBLWnZoq1mVwotCLRGhOtSkMzMuqq2ml3SqUehdnZtynbtPLB88/Dy9dDrYVzoy/MTT6Svnlpd/AHueon5wpnGsEae/PZm+d3Jp6SSUTy7R3xw4f9/B5RN3O+5t3VNncjm6Cnt+uLx8DpedGj4yvD84HceNxTcG6ku4VPmZ9n6nNdj95BHyB3IJKxBPsKm6rpn4QopmqzlFm1MwqdxO5rPGnIc7aSfCGg1Vqyo6nUlQhnh7WiFhXzgGhVC4qjPRki9xdGCc4zXeSWb9BG1ktlqz2Q5Y7S2sIJfivkpVKCCDpyCWdbQzECj76qMVqvyJ/LxyI2rTv1bTC25lSM9xAUJ4Lc+U0wXTsKXDmaA8tHX+hvDt4Wa9IHLcMUBz9VwpL4xi2aGasAPPKNUbbmD/2jAtk0uXY4eJx8zRgj9iAnVNt5X+BL5vlHTOaiOmG7g6+7ZBNUOaefNXuJF3u25RjVvBLeW8E4wV7ZJBpbAXXGnqrwgupWVTAKqZjq5HbW44fMguNJhgwmw8oOk8GCqE8F3GhLB0uS/UDVt4lgjtqGxK/rpwuaDAqKHZNuWmJjVKuWUxbpg2B9DtoRdN3TKF9B0hw4p41C5i3CI9w4civP3aQLlmLMK3wpJpaI7BvmlhPtH3nPWCKQAdE2hK9zyuUeAm921qCA2kvqY8N1yDMq4beJlG+4XQqHDCQnqPlJIyyN579S4tIGcRv/82BbFfK9SgnVHkZzMeaSQjqR5/fP5XF2Chh+sW0g0gn27snqXv3/bsszsfJbCAIiTdjRTVCBL6jV0K5D8H/8xVAAAAeJxjYGRgYADi16c/vIvnt/nKwM3CAALXZxxzhtH///23YVFhbgZyORiYQKIAm34OJQAAAHicY2BkYGBu+N/AEMOi/P/f//8sKgxAERTAAwCmuAa3eJxjYWBgYAFhRiiNFf//z6L8/x+IDQAkCQRQAAAAAAAAjAEAATgBfgGaAiACbgMMA2AEhATGAAB4nGNgZGBg4GE4DMQgwATEXEDIwPAfzGcAAB2tAfIAAHicZY9NTsMwEIVf+gekEqqoYIfkBWIBKP0Rq25YVGr3XXTfpk6bKokjx63UA3AejsAJOALcgDvwSCebNpbH37x5Y08A3OAHHo7fLfeRPVwyO3INF7gXrlN/EG6QX4SbaONVuEX9TdjHM6bCbXRheYPXuGL2hHdhDx18CNdwjU/hOvUv4Qb5W7iJO/wKt9Dx6sI+5l5XuI1HL/bHVi+cXqnlQcWhySKTOb+CmV7vkoWt0uqca1vEJlODoF9JU51pW91T7NdD5yIVWZOqCas6SYzKrdnq0AUb5/JRrxeJHoQm5Vhj/rbGAo5xBYUlDowxQhhkiMro6DtVZvSvsUPCXntWPc3ndFsU1P9zhQEC9M9cU7qy0nk6T4E9XxtSdXQrbsuelDSRXs1JErJCXta2VELqATZlV44RelzRiT8oZ0j/AAlabsgAAAB4nG2L3QqCQBCFZ9RWU7sOfAeh8IFi3N10EHYUG1p8+gSjqz44F+cPEjgo4T81Jphihic0mGOBZyyxwhovUCxKIe4ylthRuDqV+I22UcLQ6+QH4ubWdZZkU3m4o/0tUqtSvT33TPLits12fzc+zhRcvoquo0o281OLhcMw7Q+AD8sULE0=') format('woff'), - url('//at.alicdn.com/t/font_792691_qxv28s6g1l9.ttf?t=1534240067831') format('truetype'), - /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ url('//at.alicdn.com/t/font_792691_qxv28s6g1l9.svg?t=1534240067831#iconfont') format('svg'); - /* iOS 4.1- */ + font-family: "xm-iconfont"; + src: url('//at.alicdn.com/t/font_792691_qxv28s6g1l9.eot?t=1534240067831'); + /* IE9*/ + src: url('//at.alicdn.com/t/font_792691_qxv28s6g1l9.eot?t=1534240067831#iefix') format('embedded-opentype'), + /* IE6-IE8 */ + url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAsYAAsAAAAAEQwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8ukovY21hcAAAAYAAAACrAAACPBtV6wxnbHlmAAACLAAABnEAAAmMovtEvWhlYWQAAAigAAAAMQAAADYSctBCaGhlYQAACNQAAAAgAAAAJAgBA69obXR4AAAI9AAAABsAAAAwMCX//WxvY2EAAAkQAAAAGgAAABoN8gwubWF4cAAACSwAAAAeAAAAIAEiAM9uYW1lAAAJTAAAAUUAAAJtPlT+fXBvc3QAAAqUAAAAhAAAALJ1LunfeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkYWacwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGByeMbwwZ27438AQw9zMcAQozAiSAwDk4AxmeJzlks0JwzAMhZ8bN/1xD4GU0h2Se26BbJMJOkkn6KmTPbJF8mT5UGg3qMRn0EPIRs8A9gAq0YsIhDcCLF5SQ9YrnLMe8VB9RSMlMjCxYcueIyfOy7CuAFHU7lP9iqApt5L3ksBJbzlgZ9PVkXDUvbWa6x8T/i0u+XyWKtmmHW0NDI55yeRok2DjaKdg65jX7Bzzm71jXnN08vzJkQvg7Ng/WAYH9Qb3wzM/AHicjVVvbFzFEd/Zfbv7/vn9uXf33vl8Pt/dO99BHOzEZ9/DKTImRS0KjUoLDUFCjtpCMGkT1D9qldQmhkiUSv2G1BBB1VYqilGREOIDViWEGzttqkpI/cAXqyL5gFRALVIF+VCJe9fZd+fEpR/o6d3s7G9mZ2dmZ3aJIKR3h0ZYmVgkIjGZJV8mDxECtenOTDOu1UU+hJoD+TCqzcNMk2V8O5OCbDVRPgZhEt4JCNTZ/4HA3+DfuWIxl8pcFFErG3K7oD7fvev8UaMUmEu259lrRjBsfs6cLhYbRfzSbSjGRVAkfQYihUXsyPkHTVyyZDNmXzSHg3Tl+aPKxpJFqbWGdtLl8w8iYDxuDTQIx7yc1YCdIx7Jk3HSwbwQwGBcyMKZVtG0ZCuJxjFJBb+foMSfhJaPOSr4FYgwSwqIx2MHJALtAdBi/7xcSMJL+fxmmBS2guD61tZm96X02mgcj0J1NAaIR9UMmhXIV24FuLUC71+r1AEmK1AYrQHUK/Tly/m8MrOZz2+FSf7jzc3NK9XR9F2lVq+gmRp0r+HK9B+VJmR263Rgd7ALwR/FOFfx/FeJS0YxQh9drakgMJhaBVizkwgqWxLD6eQ0Qo8f7p44fJziSH9x+PjLZUO+/jZ9+K35X37ljn/Rv+yW4Ziuf2nl4PfS5/LrP47OHTsFJULYjf369UZAEBmSqEOSJmG4Me6LeznA0BFkcDoJlGynVzmH2vY21DhPr25v9DjvbfTp2TXG1s5mlK0q4S7lT++6obbRox/s6CHF2LMEsHvoFfSFQIKnKQMZJVFCD6WH0p0PVvvcRx8uph8eUks0jOFNtskOkpDsJ18k9+NqVRg3qqMCSSerjyRuYUi1/vFH7YIqikGVcD+ehFl/pqPSPKZ6DG6mHisljFhBFvU/PoRkSNd/JHO6Ja5JOXcfwIGJbm/igBq/hn8Kfb57YbYUxyX4cwkLKH1u4gD9GVSL6USxCjjCO2p8VdcvH9XRYIQWqUblu3pR/v2BvXMAc3tTmJiDAQ895B9NL0C9BFdKqqRKczDX/Whg7O1irVbcqZ8/sbfYBOZwihC+6wSDzszUf+dF7rRO1O+fKaDO+nXOr6+vf8L5J44Qe4UvnlyRntwrxMoKzpFdeRJBNb9dGyiur1+nE59R+uwi9M1G395jb9KP0bcK2YM9nJB5cojcS75OFskxclzdc+pW699z8iYbtf14BGKf77ruZNyXKC0e50OEBI+V/Aug5Dex/9WjJfipuqnS00gfybjXbNe1f762tXmRPp3Bdl/l6g5JXyqXR0bK8J3PR+jvwYs8/GBnTM+kr8FX4ZknwC16XtG9iH9QfNn1vDHPe2GAj3ieV3XdF2+IPdeteh62Ra+HfQrsKWKSBtlHSOBgM7KkKQBLWnZoq1mVwotCLRGhOtSkMzMuqq2ml3SqUehdnZtynbtPLB88/Dy9dDrYVzoy/MTT6Svnlpd/AHueon5wpnGsEae/PZm+d3Jp6SSUTy7R3xw4f9/B5RN3O+5t3VNncjm6Cnt+uLx8DpedGj4yvD84HceNxTcG6ku4VPmZ9n6nNdj95BHyB3IJKxBPsKm6rpn4QopmqzlFm1MwqdxO5rPGnIc7aSfCGg1Vqyo6nUlQhnh7WiFhXzgGhVC4qjPRki9xdGCc4zXeSWb9BG1ktlqz2Q5Y7S2sIJfivkpVKCCDpyCWdbQzECj76qMVqvyJ/LxyI2rTv1bTC25lSM9xAUJ4Lc+U0wXTsKXDmaA8tHX+hvDt4Wa9IHLcMUBz9VwpL4xi2aGasAPPKNUbbmD/2jAtk0uXY4eJx8zRgj9iAnVNt5X+BL5vlHTOaiOmG7g6+7ZBNUOaefNXuJF3u25RjVvBLeW8E4wV7ZJBpbAXXGnqrwgupWVTAKqZjq5HbW44fMguNJhgwmw8oOk8GCqE8F3GhLB0uS/UDVt4lgjtqGxK/rpwuaDAqKHZNuWmJjVKuWUxbpg2B9DtoRdN3TKF9B0hw4p41C5i3CI9w4civP3aQLlmLMK3wpJpaI7BvmlhPtH3nPWCKQAdE2hK9zyuUeAm921qCA2kvqY8N1yDMq4beJlG+4XQqHDCQnqPlJIyyN579S4tIGcRv/82BbFfK9SgnVHkZzMeaSQjqR5/fP5XF2Chh+sW0g0gn27snqXv3/bsszsfJbCAIiTdjRTVCBL6jV0K5D8H/8xVAAAAeJxjYGRgYADi16c/vIvnt/nKwM3CAALXZxxzhtH///23YVFhbgZyORiYQKIAm34OJQAAAHicY2BkYGBu+N/AEMOi/P/f//8sKgxAERTAAwCmuAa3eJxjYWBgYAFhRiiNFf//z6L8/x+IDQAkCQRQAAAAAAAAjAEAATgBfgGaAiACbgMMA2AEhATGAAB4nGNgZGBg4GE4DMQgwATEXEDIwPAfzGcAAB2tAfIAAHicZY9NTsMwEIVf+gekEqqoYIfkBWIBKP0Rq25YVGr3XXTfpk6bKokjx63UA3AejsAJOALcgDvwSCebNpbH37x5Y08A3OAHHo7fLfeRPVwyO3INF7gXrlN/EG6QX4SbaONVuEX9TdjHM6bCbXRheYPXuGL2hHdhDx18CNdwjU/hOvUv4Qb5W7iJO/wKt9Dx6sI+5l5XuI1HL/bHVi+cXqnlQcWhySKTOb+CmV7vkoWt0uqca1vEJlODoF9JU51pW91T7NdD5yIVWZOqCas6SYzKrdnq0AUb5/JRrxeJHoQm5Vhj/rbGAo5xBYUlDowxQhhkiMro6DtVZvSvsUPCXntWPc3ndFsU1P9zhQEC9M9cU7qy0nk6T4E9XxtSdXQrbsuelDSRXs1JErJCXta2VELqATZlV44RelzRiT8oZ0j/AAlabsgAAAB4nG2L3QqCQBCFZ9RWU7sOfAeh8IFi3N10EHYUG1p8+gSjqz44F+cPEjgo4T81Jphihic0mGOBZyyxwhovUCxKIe4ylthRuDqV+I22UcLQ6+QH4ubWdZZkU3m4o/0tUqtSvT33TPLits12fzc+zhRcvoquo0o281OLhcMw7Q+AD8sULE0=') format('woff'), + url('//at.alicdn.com/t/font_792691_qxv28s6g1l9.ttf?t=1534240067831') format('truetype'), + /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ + url('//at.alicdn.com/t/font_792691_qxv28s6g1l9.svg?t=1534240067831#iconfont') format('svg'); + /* iOS 4.1- */ } .xm-iconfont { - font-family: "xm-iconfont" !important; - font-size: 16px; - font-style: normal; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; + font-family: "xm-iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; } .icon-quanxuan:before { - content: "\e62c"; + content: "\e62c"; } .icon-caidan:before { - content: "\e610"; + content: "\e610"; } .icon-fanxuan:before { - content: "\e837"; + content: "\e837"; } .icon-pifu:before { - content: "\e668"; + content: "\e668"; } .icon-qingkong:before { - content: "\e63e"; + content: "\e63e"; } .icon-sousuo:before { - content: "\e600"; + content: "\e600"; } .icon-danx:before { - content: "\e62b"; + content: "\e62b"; } .icon-duox:before { - content: "\e613"; + content: "\e613"; } .icon-close:before { - content: "\e601"; + content: "\e601"; } .icon-expand:before { - content: "\e641"; -} - -.xm-select-parent .xm-form-select dl { - position: relative; - top: 5px !important; + content: "\e641"; } diff --git a/src/main/resources/static/component/pear/css/module/step.css b/src/main/resources/static/component/pear/css/module/step.css index 6044fffc..63946620 100644 --- a/src/main/resources/static/component/pear/css/module/step.css +++ b/src/main/resources/static/component/pear/css/module/step.css @@ -2,9 +2,9 @@ font-size: 0; margin: 0 auto; max-width: 100%; - width: 60%; - padding-left: 15%; - + width: 60%; + padding-left: 15%; + } .step-item { @@ -27,16 +27,16 @@ display: inline-block; width: 100%; height: 3px; - margin-top: 4px; + margin-top: 4px; vertical-align: top; background: #5FB878; position: relative; } .step-item-tail .step-item-tail-done { - background: #5FB878; - height: 3px; - margin-top: 4px; + background: #5FB878; + height: 3px; + margin-top: 4px; } .step-item-head { diff --git a/src/main/resources/static/component/pear/css/module/tab.css b/src/main/resources/static/component/pear/css/module/tab.css index ffe62926..3161f3e4 100644 --- a/src/main/resources/static/component/pear/css/module/tab.css +++ b/src/main/resources/static/component/pear/css/module/tab.css @@ -1,308 +1,308 @@ .pear-tab { - margin: 0px; - overflow: hidden; - height: 100% !important; + margin: 0px; + overflow: hidden; + height: 100% !important; } .pear-tab .layui-tab-content { - height: calc(100% - 42px) !important; + height: calc(100% - 42px) !important; } .pear-tab .layui-tab-content .layui-tab-item { - height: 100%; + height: 100%; } .pear-tab-menu{ - box-shadow: 0 2px 8px #f0f1f2!important; - border: 1px solid whitesmoke!important; - border-radius: 4px!important; + box-shadow: 0 2px 8px #f0f1f2!important; + border: 1px solid whitesmoke!important; + border-radius: 4px!important; } .pear-tab-menu .item{ - height: 20px; - padding-left: 18px; - padding-top: 7px; - padding-bottom: 7px; - color: #333; - font-size: 13.5px; - line-height: 20px; + height: 20px; + padding-left: 18px; + padding-top: 7px; + padding-bottom: 7px; + color: #333; + font-size: 13.5px; + line-height: 20px; cursor:pointer; } .pear-tab-menu .item:hover{ - background: #36b368; - color: white; + background: #36b368; + color: white; } .pear-tab .layui-tab-content { - padding: 0px; + padding: 0px; } .pear-tab .layui-tab-title { - border: none; - border: 1px solid whitesmoke; - background-color: white; + border: none; + border: 1px solid whitesmoke; + background-color: white; } .pear-tab .layui-tab-title li { - border-right: 1px solid whitesmoke; - color: dimgray; - font-size: 13.5px; + border-right: 1px solid whitesmoke; + color: dimgray; + font-size: 13.5px; } .pear-tab .layui-tab-title .layui-tab-bar { - display: none; + display: none; } .pear-tab .layui-tab-title .layui-this:after { - display: none; + display: none; } .pear-tab .layui-tab-title .pear-tab-active { - display: inline-block; - background-color: lightgray; - width: 8px; - height: 8px; - border-radius: 30px; - margin-right: 12px; + display: inline-block; + background-color: lightgray; + width: 8px; + height: 8px; + border-radius: 30px; + margin-right: 12px; } .pear-tab .layui-tab-title .layui-this .pear-tab-active { - background-color: #5FB878; + background-color: #5FB878; } .pear-tab .layui-tab-title .layui-tab-close:hover { - background-color: white; - line-height: 19px; - color: gray; + background-color: white; + line-height: 19px; + color: gray; } .pear-tab .layui-tab-title .disable-close+.layui-tab-close { - display: none; + display: none; } .pear-tab .layui-tab-title .able-close+.layui-tab-close { - display: inline-block; + display: inline-block; } .pear-tab .layui-tab-close{ - font-size: 13px; + font-size: 13px; } .pear-tab .layui-tab-control>li { - position: absolute; - top: 0px; - height: 40px; - line-height: 40px; - width: 40px; - text-align: center; - background-color: white; - border-top: whitesmoke 1px solid; - border-bottom: whitesmoke 1px solid; + position: absolute; + top: 0px; + height: 40px; + line-height: 40px; + width: 40px; + text-align: center; + background-color: white; + border-top: whitesmoke 1px solid; + border-bottom: whitesmoke 1px solid; } .pear-tab .layui-tab-prev { - left: 0px; - border-right: whitesmoke 1px solid; + left: 0px; + border-right: whitesmoke 1px solid; } .pear-tab .layui-tab-next { - right: 40px; - border-left: 1px solid whitesmoke; + right: 40px; + border-left: 1px solid whitesmoke; } .pear-tab .layui-tab-tool { - right: 0px; - border-left: 1px solid whitesmoke; + right: 0px; + border-left: 1px solid whitesmoke; } .pear-tab .layui-tab-control .layui-tab-tool, .pear-tab .layui-tab-control .layui-tab-prev, .pear-tab .layui-tab-control .layui-tab-next { - display: none; + display: none; } .pear-tab.layui-tab-roll .layui-tab-control .layui-tab-prev, .pear-tab.layui-tab-roll .layui-tab-control .layui-tab-next { - display: block; + display: block; } .pear-tab.layui-tab-roll .layui-tab-control .layui-tab-next { - right: 0px; - border-right: 1px solid whitesmoke; + right: 0px; + border-right: 1px solid whitesmoke; } .pear-tab.layui-tab-roll .layui-tab-title { - padding-left: 40px; - padding-right: 40px; + padding-left: 40px; + padding-right: 40px; } .pear-tab.layui-tab-tool .layui-tab-control .layui-tab-tool { - display: block; + display: block; } .pear-tab.layui-tab-tool .layui-tab-title { - padding-left: 0px; - padding-right: 40px; + padding-left: 0px; + padding-right: 40px; } .pear-tab.layui-tab-rollTool .layui-tab-title { - padding-left: 40px; - padding-right: 80px; + padding-left: 40px; + padding-right: 80px; } .pear-tab.layui-tab-rollTool .layui-tab-control .layui-tab-prev, .pear-tab.layui-tab-rollTool .layui-tab-control .layui-tab-next, .pear-tab.layui-tab-rollTool .layui-tab-control .layui-tab-tool { - display: block; + display: block; } .pear-tab .layui-tab-tool .layui-nav { - position: absolute; - height: 43px !important; - top: 0; - width: 100%; - height: 100%; - padding: 0; - background: 0 0; + position: absolute; + height: 43px !important; + top: 0; + width: 100%; + height: 100%; + padding: 0; + background: 0 0; } .pear-tab .layui-tab-tool .layui-nav-item { - height: 40px; + height: 40px; } .pear-tab .layui-tab-tool .layui-nav-bar { - display: none; + display: none; } .pear-tab .layui-tab-tool .layui-nav-child { - left: auto; - top: 45px; - right: 3px; - width: 120px; - border: 1px solid whitesmoke; + left: auto; + top: 45px; + right: 3px; + width: 120px; + border: 1px solid whitesmoke; } .pear-tab .layui-tab-tool .layui-this a { - background-color: #009688; + background-color: #009688; } .pear-tab-loading { - position: absolute; - display: none; - width: 100%; - height: calc(100% - 42px); - top: 42px; - z-index: 19; - background-color: #fff + position: absolute; + display: none; + width: 100%; + height: calc(100% - 42px); + top: 42px; + z-index: 19; + background-color: #fff } .pear-tab-loading.close { - animation: close 1s; - -webkit-animation: close 1s; - animation-fill-mode: forwards; + animation: close 1s; + -webkit-animation: close 1s; + animation-fill-mode: forwards; } .ball-loader { - position: absolute; - left: 50%; - top: 50%; - transform: translate(-50%, -50%); - -ms-transform: translate(-50%, -50%); - -webkit-transform: translate(-50%, -50%) + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); + -webkit-transform: translate(-50%, -50%) } .ball-loader>span, .signal-loader>span { - background-color: #4aca85 !important; - display: inline-block + background-color: #4aca85 !important; + display: inline-block } .ball-loader>span:nth-child(1), .ball-loader.sm>span:nth-child(1), .signal-loader>span:nth-child(1), .signal-loader.sm>span:nth-child(1) { - -webkit-animation-delay: 0s; - animation-delay: 0s + -webkit-animation-delay: 0s; + animation-delay: 0s } .ball-loader>span:nth-child(2), .ball-loader.sm>span:nth-child(2), .signal-loader>span:nth-child(2), .signal-loader.sm>span:nth-child(2) { - -webkit-animation-delay: .1s; - animation-delay: .1s + -webkit-animation-delay: .1s; + animation-delay: .1s } .ball-loader>span:nth-child(3), .ball-loader.sm>span:nth-child(3), .signal-loader>span:nth-child(3), .signal-loader.sm>span:nth-child(3) { - -webkit-animation-delay: .15s; - animation-delay: .15s + -webkit-animation-delay: .15s; + animation-delay: .15s } .ball-loader>span:nth-child(4), .ball-loader.sm>span:nth-child(4), .signal-loader>span:nth-child(4), .signal-loader.sm>span:nth-child(4) { - -webkit-animation-delay: .2s; - animation-delay: .2s + -webkit-animation-delay: .2s; + animation-delay: .2s } .ball-loader>span { - width: 20px; - height: 20px; - margin: 0 3px; - border-radius: 50%; - transform: scale(0); - -ms-transform: scale(0); - -webkit-transform: scale(0); - animation: ball-load 1s ease-in-out infinite; - -webkit-animation: 1s ball-load ease-in-out infinite + width: 20px; + height: 20px; + margin: 0 3px; + border-radius: 50%; + transform: scale(0); + -ms-transform: scale(0); + -webkit-transform: scale(0); + animation: ball-load 1s ease-in-out infinite; + -webkit-animation: 1s ball-load ease-in-out infinite } @-webkit-keyframes ball-load { - 0% { - transform: scale(0); - -webkit-transform: scale(0) - } + 0% { + transform: scale(0); + -webkit-transform: scale(0) + } - 50% { - transform: scale(1); - -webkit-transform: scale(1) - } + 50% { + transform: scale(1); + -webkit-transform: scale(1) + } - 100% { - transform: scale(0); - -webkit-transform: scale(0) - } + 100% { + transform: scale(0); + -webkit-transform: scale(0) + } } @keyframes ball-load { - 0% { - transform: scale(0); - -webkit-transform: scale(0) - } + 0% { + transform: scale(0); + -webkit-transform: scale(0) + } - 50% { - transform: scale(1); - -webkit-transform: scale(1) - } + 50% { + transform: scale(1); + -webkit-transform: scale(1) + } - 100% { - transform: scale(0); - -webkit-transform: scale(0) - } + 100% { + transform: scale(0); + -webkit-transform: scale(0) + } } @-webkit-keyframes close { - 0% { - opacity: 1; - /*display: block;*/ - } - - 100% { - opacity: 0; - /*display: none;*/ - } -} \ No newline at end of file + 0% { + opacity: 1; + /*display: block;*/ + } + + 100% { + opacity: 0; + /*display: none;*/ + } +} diff --git a/src/main/resources/static/component/pear/css/module/table.css b/src/main/resources/static/component/pear/css/module/table.css index fe37f00e..a3c72104 100644 --- a/src/main/resources/static/component/pear/css/module/table.css +++ b/src/main/resources/static/component/pear/css/module/table.css @@ -1,53 +1,49 @@ .layui-table-tool-panel { - margin-top: 10px !important; + margin-top: 10px !important; } .layui-table-tool { - background-color: white !important; - border-bottom: none !important; - padding-bottom: 10px !important; + background-color: white !important; + border-bottom: none !important; + padding-bottom: 10px !important; } .layui-table-header, .layui-table-header th { - background-color: white !important; + background-color: white !important; } .layui-table-view { - border: none !important; + border: none !important; } /** 兼容 layui 2.7.0 升级 table cell 单元格边距的调整 */ .layui-table-view .layui-table td, .layui-table-view .layui-table th { - padding: 5px 0px; + padding: 5px 0px; } .layui-table-cell { - height: 34px; - line-height: 34px; + height: 34px; + line-height: 34px; } .layui-table .layui-laypage .layui-laypage-curr .layui-laypage-em { - border-radius: 50px !important; - border-radius: 4px!important; - background-color: #5FB878 !important; -} - -.layui-table-view .layui-table{ - width: 100%; + border-radius: 50px !important; + border-radius: 4px!important; + background-color: #5FB878 !important; } .layui-table tr { - height: 34px; - line-height: 34px; + height: 34px; + line-height: 34px; } .layui-table-cell { - padding-top: 1px !important; + padding-top: 1px !important; } .layui-table-box * { - font-size: 13px !important; + font-size: 13px !important; } .layui-table-page .layui-laypage input { @@ -56,23 +52,31 @@ } .layui-table-box button { - font-size: 15px !important; + font-size: 15px !important; +} + +.layui-table-cell .pear-btn { + margin-right: 5px; +} + +.layui-table-cell .pear-btn:last-child { + margin-right: 0px; } .layui-table-page { - height: 45px !important; - padding-top: 10px !important; + height: 45px !important; + padding-top: 10px !important; } .layui-table-tool .layui-inline { - border-radius: 3px !important; - width: 30px !important; - height: 30px !important; - line-height: 20px !important; + border-radius: 3px !important; + width: 30px !important; + height: 30px !important; + line-height: 20px !important; } .layui-table-view .layui-table[lay-skin=line] { - border: none !important; + border: none !important; } .layui-table-init .layui-icon{ @@ -81,28 +85,28 @@ } .layui-table-body::-webkit-scrollbar { - width: 0px; - height: 0px; + width: 0px; + height: 0px; } .layui-table-body::-webkit-scrollbar { - width: 6px; - height: 6px; + width: 6px; + height: 6px; } .layui-table-body::-webkit-scrollbar-track { - background: white; - border-radius: 2px; + background: white; + border-radius: 2px; } .layui-table-body::-webkit-scrollbar-thumb { - background: #E6E6E6; - border-radius: 2px; + background: #E6E6E6; + border-radius: 2px; } .layui-table-body::-webkit-scrollbar-thumb:hover { - background: #E6E6E6; + background: #E6E6E6; } .layui-table-body::-webkit-scrollbar-corner { - background: #f6f6f6; + background: #f6f6f6; } diff --git a/src/main/resources/static/component/pear/css/module/tag.css b/src/main/resources/static/component/pear/css/module/tag.css index 74e619a6..7c244bc2 100644 --- a/src/main/resources/static/component/pear/css/module/tag.css +++ b/src/main/resources/static/component/pear/css/module/tag.css @@ -1,87 +1,85 @@ .input-new-tag { - width: 90px; + width: 90px; } .input-new-tag input { - height: 100% !important; - border: none; - padding-left: 0px; + height: 100%!important; + border: none; + padding-left: 0px; } .tag .layui-btn .tag-close:hover { - border-radius: 2px; - color: #fff; + border-radius: 2px; + color: #fff; } .tag .layui-btn .tag-close { - margin-left: 8px; - transition: all .2s; - -webkit-transition: all .2s; + margin-left: 8px; + transition: all .2s; + -webkit-transition: all .2s; } - .tag-item { - background-color: #5FB878; - color: white; - border: none; + background-color: #5FB878; + color: white; + border: none; } .tag-item:hover { - color: white; + color: white; } - .tag-item-normal { - background-color: #5FB878; - color: white; - border: none; + background-color: #5FB878; + color: white; + border: none; } .tag-item-warm { - background-color: #f6ad55; - color: white; - border: none; + background-color: #f6ad55; + color: white; + border: none; } .tag-item-danger { - background-color: #f56c6c; - color: white; - border: none; + background-color: #f56c6c; + color: white; + border: none; } .tag-item-dark { - background-color: #525252; - color: white; - border: none; + background-color: #525252; + color: white; + border: none; } .tag-item-primary { - background-color: white !important; - color: dimgray; - border: 1px solid dimgray; + background-color: white !important; + color: dimgray; + border: 1px solid dimgray; } .tag-item-normal:hover { - color: white !important; + color: white !important; } .tag-item-warm:hover { - color: white; + color: white; } .tag-item-danger:hover { - color: white; + color: white; } .tag-item-dark:hover { - color: white; + color: white; } .tag-item-primary:hover { - color: dimgray; - border: 1px solid dimgray; + color: dimgray; + border: 1px solid dimgray; } \ No newline at end of file diff --git a/src/main/resources/static/component/pear/css/module/topBar.css b/src/main/resources/static/component/pear/css/module/topBar.css index e6a20a87..c3d5beca 100644 --- a/src/main/resources/static/component/pear/css/module/topBar.css +++ b/src/main/resources/static/component/pear/css/module/topBar.css @@ -1,5 +1,5 @@ .layui-fixbar li { - border-radius: 4px; - background-color: #5FB878; - color: white; + border-radius: 4px; + background-color: #5FB878; + color: white; } diff --git a/src/main/resources/static/component/pear/css/module/treetable.css b/src/main/resources/static/component/pear/css/module/treetable.css index 9aed1908..da849b89 100644 --- a/src/main/resources/static/component/pear/css/module/treetable.css +++ b/src/main/resources/static/component/pear/css/module/treetable.css @@ -1,11 +1,10 @@ -.treeTable-icon i:last-child { - display: none !important; +.treeTable-icon i:last-child{ + display: none!important; } -.treeTable-empty { - margin-left: -3px; +.treeTable-empty{ + margin-left: -3px; } - .treeTable-empty { width: 20px; display: inline-block; diff --git a/src/main/resources/static/component/pear/css/pear.css b/src/main/resources/static/component/pear/css/pear.css index 68078b24..c43e364a 100644 --- a/src/main/resources/static/component/pear/css/pear.css +++ b/src/main/resources/static/component/pear/css/pear.css @@ -5,6 +5,7 @@ @import url("module/dtree/dtree.css"); @import url("module/iconPicker.css"); @import url("module/treetable.css"); +@import url("module/nprogress.css"); @import url("module/message.css"); @import url("module/cropper.css"); @import url("module/loading.css"); @@ -19,9 +20,11 @@ @import url("module/toast.css"); @import url("module/menu.css"); @import url("module/form.css"); -@import url("module/code.css"); @import url("module/link.css"); +@import url("module/code.css"); @import url("module/step.css"); @import url("module/card.css"); @import url("module/tab.css"); -@import url("module/tag.css"); \ No newline at end of file +@import url("module/tag.css"); +@import url("module/fullscreen.css"); +@import url("module/popover.min.css"); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/font/iconfont.css b/src/main/resources/static/component/pear/font/iconfont.css index e23a69ed..5f6eb5fd 100644 --- a/src/main/resources/static/component/pear/font/iconfont.css +++ b/src/main/resources/static/component/pear/font/iconfont.css @@ -1,579 +1,579 @@ @font-face { - font-family: "pear-icon"; /* Project id 2654996 */ - src: url('iconfont.woff2?t=1625555217253') format('woff2'), - url('iconfont.woff?t=1625555217253') format('woff'), - url('iconfont.ttf?t=1625555217253') format('truetype'); + font-family: "pear-icon"; /* Project id 2654996 */ + src: url('iconfont.woff2?t=1625555217253') format('woff2'), + url('iconfont.woff?t=1625555217253') format('woff'), + url('iconfont.ttf?t=1625555217253') format('truetype'); } .pear-icon { - font-family: "pear-icon" !important; - font-size: 16px; - font-style: normal; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; + font-family: "pear-icon" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; } .pear-icon-load:before { - content: "\e6f0"; + content: "\e6f0"; } .pear-icon-download:before { - content: "\e68d"; + content: "\e68d"; } .pear-icon-electronics:before { - content: "\e68e"; + content: "\e68e"; } .pear-icon-drag:before { - content: "\e68f"; + content: "\e68f"; } .pear-icon-elipsis:before { - content: "\e690"; + content: "\e690"; } .pear-icon-export:before { - content: "\e691"; + content: "\e691"; } .pear-icon-explain:before { - content: "\e692"; + content: "\e692"; } .pear-icon-edit:before { - content: "\e693"; + content: "\e693"; } .pear-icon-eye-close:before { - content: "\e694"; + content: "\e694"; } .pear-icon-email:before { - content: "\e695"; + content: "\e695"; } .pear-icon-error:before { - content: "\e696"; + content: "\e696"; } .pear-icon-favorite:before { - content: "\e697"; + content: "\e697"; } .pear-icon-file-common:before { - content: "\e698"; + content: "\e698"; } .pear-icon-file-delete:before { - content: "\e699"; + content: "\e699"; } .pear-icon-file-add:before { - content: "\e69a"; + content: "\e69a"; } .pear-icon-film:before { - content: "\e69b"; + content: "\e69b"; } .pear-icon-fabulous:before { - content: "\e69c"; + content: "\e69c"; } .pear-icon-file:before { - content: "\e69d"; + content: "\e69d"; } .pear-icon-folder-close:before { - content: "\e69e"; + content: "\e69e"; } .pear-icon-filter:before { - content: "\e69f"; + content: "\e69f"; } .pear-icon-good:before { - content: "\e6a0"; + content: "\e6a0"; } .pear-icon-hide:before { - content: "\e6a1"; + content: "\e6a1"; } .pear-icon-home:before { - content: "\e6a2"; + content: "\e6a2"; } .pear-icon-history:before { - content: "\e6a3"; + content: "\e6a3"; } .pear-icon-file-open:before { - content: "\e6a4"; + content: "\e6a4"; } .pear-icon-forward:before { - content: "\e6a5"; + content: "\e6a5"; } .pear-icon-import:before { - content: "\e6a6"; + content: "\e6a6"; } .pear-icon-image-text:before { - content: "\e6a7"; + content: "\e6a7"; } .pear-icon-keyboard-26:before { - content: "\e6a8"; + content: "\e6a8"; } .pear-icon-keyboard-9:before { - content: "\e6a9"; + content: "\e6a9"; } .pear-icon-link:before { - content: "\e6aa"; + content: "\e6aa"; } .pear-icon-layout:before { - content: "\e6ab"; + content: "\e6ab"; } .pear-icon-fullscreen-shrink:before { - content: "\e6ac"; + content: "\e6ac"; } .pear-icon-layers:before { - content: "\e6ad"; + content: "\e6ad"; } .pear-icon-lock:before { - content: "\e6ae"; + content: "\e6ae"; } .pear-icon-fullscreen-expand:before { - content: "\e6af"; + content: "\e6af"; } .pear-icon-map:before { - content: "\e6b0"; + content: "\e6b0"; } .pear-icon-meh:before { - content: "\e6b1"; + content: "\e6b1"; } .pear-icon-menu:before { - content: "\e6b2"; + content: "\e6b2"; } .pear-icon-loading:before { - content: "\e6b3"; + content: "\e6b3"; } .pear-icon-help:before { - content: "\e6b4"; + content: "\e6b4"; } .pear-icon-minus-circle:before { - content: "\e6b5"; + content: "\e6b5"; } .pear-icon-modular:before { - content: "\e6b6"; + content: "\e6b6"; } .pear-icon-notification:before { - content: "\e6b7"; + content: "\e6b7"; } .pear-icon-mic:before { - content: "\e6b8"; + content: "\e6b8"; } .pear-icon-more:before { - content: "\e6b9"; + content: "\e6b9"; } .pear-icon-pad:before { - content: "\e6ba"; + content: "\e6ba"; } .pear-icon-operation:before { - content: "\e6bb"; + content: "\e6bb"; } .pear-icon-play:before { - content: "\e6bc"; + content: "\e6bc"; } .pear-icon-print:before { - content: "\e6bd"; + content: "\e6bd"; } .pear-icon-mobile-phone:before { - content: "\e6be"; + content: "\e6be"; } .pear-icon-minus:before { - content: "\e6bf"; + content: "\e6bf"; } .pear-icon-navigation:before { - content: "\e6c0"; + content: "\e6c0"; } .pear-icon-pdf:before { - content: "\e6c1"; + content: "\e6c1"; } .pear-icon-prompt:before { - content: "\e6c2"; + content: "\e6c2"; } .pear-icon-move:before { - content: "\e6c3"; + content: "\e6c3"; } .pear-icon-refresh:before { - content: "\e6c4"; + content: "\e6c4"; } .pear-icon-run-up:before { - content: "\e6c5"; + content: "\e6c5"; } .pear-icon-picture:before { - content: "\e6c6"; + content: "\e6c6"; } .pear-icon-run-in:before { - content: "\e6c7"; + content: "\e6c7"; } .pear-icon-pin:before { - content: "\e6c8"; + content: "\e6c8"; } .pear-icon-save:before { - content: "\e6c9"; + content: "\e6c9"; } .pear-icon-search:before { - content: "\e6ca"; + content: "\e6ca"; } .pear-icon-share:before { - content: "\e6cb"; + content: "\e6cb"; } .pear-icon-scanning:before { - content: "\e6cc"; + content: "\e6cc"; } .pear-icon-security:before { - content: "\e6cd"; + content: "\e6cd"; } .pear-icon-sign-out:before { - content: "\e6ce"; + content: "\e6ce"; } .pear-icon-select:before { - content: "\e6cf"; + content: "\e6cf"; } .pear-icon-stop:before { - content: "\e6d0"; + content: "\e6d0"; } .pear-icon-success:before { - content: "\e6d1"; + content: "\e6d1"; } .pear-icon-smile:before { - content: "\e6d2"; + content: "\e6d2"; } .pear-icon-switch:before { - content: "\e6d3"; + content: "\e6d3"; } .pear-icon-setting:before { - content: "\e6d4"; + content: "\e6d4"; } .pear-icon-survey:before { - content: "\e6d5"; + content: "\e6d5"; } .pear-icon-task:before { - content: "\e6d6"; + content: "\e6d6"; } .pear-icon-skip:before { - content: "\e6d7"; + content: "\e6d7"; } .pear-icon-text:before { - content: "\e6d8"; + content: "\e6d8"; } .pear-icon-time:before { - content: "\e6d9"; + content: "\e6d9"; } .pear-icon-telephone-out:before { - content: "\e6da"; + content: "\e6da"; } .pear-icon-toggle-left:before { - content: "\e6db"; + content: "\e6db"; } .pear-icon-toggle-right:before { - content: "\e6dc"; + content: "\e6dc"; } .pear-icon-telephone:before { - content: "\e6dd"; + content: "\e6dd"; } .pear-icon-top:before { - content: "\e6de"; + content: "\e6de"; } .pear-icon-unlock:before { - content: "\e6df"; + content: "\e6df"; } .pear-icon-user:before { - content: "\e6e0"; + content: "\e6e0"; } .pear-icon-upload:before { - content: "\e6e1"; + content: "\e6e1"; } .pear-icon-work:before { - content: "\e6e2"; + content: "\e6e2"; } .pear-icon-training:before { - content: "\e6e3"; + content: "\e6e3"; } .pear-icon-warning:before { - content: "\e6e4"; + content: "\e6e4"; } .pear-icon-zoom-in:before { - content: "\e6e5"; + content: "\e6e5"; } .pear-icon-zoom-out:before { - content: "\e6e6"; + content: "\e6e6"; } .pear-icon-add-bold:before { - content: "\e6e7"; + content: "\e6e7"; } .pear-icon-arrow-left-bold:before { - content: "\e6e8"; + content: "\e6e8"; } .pear-icon-arrow-up-bold:before { - content: "\e6e9"; + content: "\e6e9"; } .pear-icon-close-bold:before { - content: "\e6ea"; + content: "\e6ea"; } .pear-icon-arrow-down-bold:before { - content: "\e6eb"; + content: "\e6eb"; } .pear-icon-minus-bold:before { - content: "\e6ec"; + content: "\e6ec"; } .pear-icon-arrow-right-bold:before { - content: "\e6ed"; + content: "\e6ed"; } .pear-icon-select-bold:before { - content: "\e6ee"; + content: "\e6ee"; } .pear-icon-3column:before { - content: "\e663"; + content: "\e663"; } .pear-icon-column-4:before { - content: "\e664"; + content: "\e664"; } .pear-icon-add:before { - content: "\e665"; + content: "\e665"; } .pear-icon-add-circle:before { - content: "\e666"; + content: "\e666"; } .pear-icon-adjust:before { - content: "\e667"; + content: "\e667"; } .pear-icon-arrow-up-circle:before { - content: "\e668"; + content: "\e668"; } .pear-icon-arrow-right-circle:before { - content: "\e669"; + content: "\e669"; } .pear-icon-arrow-down:before { - content: "\e66a"; + content: "\e66a"; } .pear-icon-ashbin:before { - content: "\e66b"; + content: "\e66b"; } .pear-icon-arrow-right:before { - content: "\e66c"; + content: "\e66c"; } .pear-icon-browse:before { - content: "\e66d"; + content: "\e66d"; } .pear-icon-bottom:before { - content: "\e66e"; + content: "\e66e"; } .pear-icon-back:before { - content: "\e66f"; + content: "\e66f"; } .pear-icon-bad:before { - content: "\e670"; + content: "\e670"; } .pear-icon-arrow-double-left:before { - content: "\e671"; + content: "\e671"; } .pear-icon-arrow-left-circle:before { - content: "\e672"; + content: "\e672"; } .pear-icon-arrow-double-right:before { - content: "\e673"; + content: "\e673"; } .pear-icon-caps-lock:before { - content: "\e674"; + content: "\e674"; } .pear-icon-camera:before { - content: "\e675"; + content: "\e675"; } .pear-icon-chart-bar:before { - content: "\e676"; + content: "\e676"; } .pear-icon-attachment:before { - content: "\e677"; + content: "\e677"; } .pear-icon-code:before { - content: "\e678"; + content: "\e678"; } .pear-icon-close:before { - content: "\e679"; + content: "\e679"; } .pear-icon-check-item:before { - content: "\e67a"; + content: "\e67a"; } .pear-icon-calendar:before { - content: "\e67b"; + content: "\e67b"; } .pear-icon-comment:before { - content: "\e67c"; + content: "\e67c"; } .pear-icon-column-vertical:before { - content: "\e67d"; + content: "\e67d"; } .pear-icon-column-horizontal:before { - content: "\e67e"; + content: "\e67e"; } .pear-icon-complete:before { - content: "\e67f"; + content: "\e67f"; } .pear-icon-chart-pie:before { - content: "\e680"; + content: "\e680"; } .pear-icon-cry:before { - content: "\e681"; + content: "\e681"; } .pear-icon-customer-service:before { - content: "\e682"; + content: "\e682"; } .pear-icon-delete:before { - content: "\e683"; + content: "\e683"; } .pear-icon-direction-down:before { - content: "\e684"; + content: "\e684"; } .pear-icon-copy:before { - content: "\e685"; + content: "\e685"; } .pear-icon-cut:before { - content: "\e686"; + content: "\e686"; } .pear-icon-data-view:before { - content: "\e687"; + content: "\e687"; } .pear-icon-direction-down-circle:before { - content: "\e688"; + content: "\e688"; } .pear-icon-direction-right:before { - content: "\e689"; + content: "\e689"; } .pear-icon-direction-up:before { - content: "\e68a"; + content: "\e68a"; } .pear-icon-discount:before { - content: "\e68b"; + content: "\e68b"; } .pear-icon-direction-left:before { - content: "\e68c"; + content: "\e68c"; } diff --git a/src/main/resources/static/component/pear/module/admin.js b/src/main/resources/static/component/pear/module/admin.js index 2f2b30a9..e35f85c6 100644 --- a/src/main/resources/static/component/pear/module/admin.js +++ b/src/main/resources/static/component/pear/module/admin.js @@ -1,1035 +1,986 @@ -layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'menu', 'frame', 'theme', 'convert'], - function(exports) { - "use strict"; - - var $ = layui.jquery, - form = layui.form, - element = layui.element, - yaml = layui.yaml, - pearTab = layui.tab, - convert = layui.convert, - pearMenu = layui.menu, - pearFrame = layui.frame, - pearTheme = layui.theme, - message = layui.message; - - var bodyFrame; - var sideMenu; - var bodyTab; - var config; - var logout = function() {}; - var msgInstance; - - var body = $('body'); - - var pearAdmin = new function() { - - var configType = 'yml'; - var configPath = 'pear.config.yml'; - - this.setConfigPath = function(path) { - configPath = path; - } - - this.setConfigType = function(type) { - configType = type; - } - - this.render = function(initConfig) { - if (initConfig !== undefined) { - applyConfig(initConfig); - } else { - applyConfig(pearAdmin.readConfig()); - } - } - - this.readConfig = function() { - if (configType === "yml") { - return yaml.load(configPath); - } else { - var data; - $.ajax({ - url: configPath, - type: 'get', - dataType: 'json', - async: false, - success: function(result) { - data = result; - } - }) - return data; - } - } - - this.messageRender = function(option) { - var option = { - elem: '.message', - url: option.header.message, - height: '250px' - }; - msgInstance = message.render(option); - } - - this.logoRender = function(param) { - $(".layui-logo .logo").attr("src", param.logo.image); - $(".layui-logo .title").html(param.logo.title); - } - - this.menuRender = function(param) { - sideMenu = pearMenu.render({ - elem: 'sideMenu', - async: param.menu.async !== undefined ? param.menu.async : true, - theme: "dark-theme", - height: '100%', - method: param.menu.method, - control: isControl(param) === 'true' || isControl(param) === true ? 'control' : false, // control - controlWidth: param.menu.controlWidth, - defaultMenu: 0, - accordion: param.menu.accordion, - url: param.menu.data, - data: param.menu.data, - parseData: false, - change: function() { - compatible(); - }, - done: function() { - sideMenu.isCollapse = param.menu.collapse; - sideMenu.selectItem(param.menu.select); - pearAdmin.collapse(param); - } - }); - } - - this.bodyRender = function(param) { - - body.on("click", ".refresh", function() { - refresh(); - }) - - if (isMuiltTab(param) === "true" || isMuiltTab(param) === true) { - bodyTab = pearTab.render({ - elem: 'content', - roll: true, - tool: true, - width: '100%', - height: '100%', - session: param.tab.session, - index: 0, - tabMax: param.tab.max, - closeEvent: function(id) { - sideMenu.selectItem(id); - }, - data: [{ - id: param.tab.index.id, - url: param.tab.index.href, - title: param.tab.index.title, - close: false - }], - success: function(id) { - if (param.tab.session) { - setTimeout(function() { - sideMenu.selectItem(id); - bodyTab.positionTab(); - }, 500) - } - } - }); - - bodyTab.click(function(id) { - if (!param.tab.keepState) { - bodyTab.refresh(false); - } - bodyTab.positionTab(); - sideMenu.selectItem(id); - }) - - sideMenu.click(function(dom, data) { - bodyTab.addTabOnly({ - id: data.menuId, - title: data.menuTitle, - url: data.menuUrl, - icon: data.menuIcon, - close: true - }, 300); - compatible(); - }) - } else { - bodyFrame = pearFrame.render({ - elem: 'content', - title: '首页', - url: param.tab.index.href, - width: '100%', - height: '100%' - }); - - sideMenu.click(function(dom, data) { - bodyFrame.changePage(data.menuUrl, true); - compatible() - }) - } - } - - this.keepLoad = function(param) { - compatible() - setTimeout(function() { - $(".loader-main").fadeOut(200); - }, param.other.keepLoad) - } - - this.themeRender = function(option) { - if (option.theme.allowCustom === false) { - $(".setting").remove(); - } - var colorId = localStorage.getItem("theme-color"); - var currentColor = getColorById(colorId); - localStorage.setItem("theme-color", currentColor.id); - localStorage.setItem("theme-color-color", currentColor.color); - localStorage.setItem("theme-color-second", currentColor.second); - pearTheme.changeTheme(window, isAutoHead(config)); - - var menu = localStorage.getItem("theme-menu"); - if (menu === null) { - menu = option.theme.defaultMenu; - } else { - if (option.theme.allowCustom === false) { - menu = option.theme.defaultMenu; - } - } - - var header = localStorage.getItem("theme-header"); - if (header === null) { - header = option.theme.defaultHeader; - } else { - if (option.theme.allowCustom === false) { - header = option.theme.defaultHeader; - } - } - - var banner = localStorage.getItem("theme-banner"); - if (banner === null) { - banner = option.theme.banner; - } else { - if (option.theme.allowCustom === false) { - banner = option.theme.banner; - } - } - - var autoHead = localStorage.getItem("auto-head"); - if (autoHead === null) { - autoHead = option.other.autoHead; - } else { - if (option.theme.allowCustom === false) { - autoHead = option.other.autoHead; - } - } - - var muiltTab = localStorage.getItem("muilt-tab"); - if (muiltTab === null) { - muiltTab = option.tab.enable; - } else { - if (option.theme.allowCustom === false) { - muiltTab = option.tab.enable; - } - } - - var control = localStorage.getItem("control"); - if (control === null) { - control = option.menu.control; - } else { - if (option.theme.allowCustom === false) { - control = option.menu.control; - } - } - - var footer = localStorage.getItem("footer"); - if( footer === null) { - footer = option.other.footer; - }else{ - if (option.theme.allowCustom === false) { - footer = option.other.footer; - } - } - - localStorage.setItem("muilt-tab", muiltTab); - localStorage.setItem("theme-banner", banner); - localStorage.setItem("theme-menu", menu); - localStorage.setItem("theme-header", header); - localStorage.setItem("auto-head", autoHead); - localStorage.setItem("control", control); - localStorage.setItem("footer", footer); - this.menuSkin(menu); - this.headerSkin(header); - this.bannerSkin(banner); - this.footer(footer); - } - - this.footer = function(footer){ - var bodyDOM = $(".pear-admin .layui-body"); - var footerDOM = $(".pear-admin .layui-footer"); - if (footer === true || footer === "true") { - footerDOM.removeClass("close"); - bodyDOM.css("bottom", footerDOM.outerHeight()); - } else { - footerDOM.addClass("close"); - bodyDOM.css("bottom", ""); - } - } - - this.bannerSkin = function(theme) { - var pearAdmin = $(".pear-admin"); - pearAdmin.removeClass("banner-layout"); - if (theme === true || theme === "true") { - pearAdmin.addClass("banner-layout"); - } - } - - this.collapse = function(param) { - if (param.menu.collapse) { - if ($(window).width() >= 768) { - collapse() - } - } - } - - this.menuSkin = function(theme) { - var pearAdmin = $(".pear-admin .layui-side"); - pearAdmin.removeClass("light-theme"); - pearAdmin.removeClass("dark-theme"); - pearAdmin.addClass(theme); - } - - this.headerSkin = function(theme) { - var pearAdmin = $(".pear-admin .layui-header"); - pearAdmin.removeClass("light-theme"); - pearAdmin.removeClass("dark-theme"); - pearAdmin.addClass(theme); - } - - this.logout = function(callback) { - logout = callback; - } - - this.message = function(callback) { - if (callback != null) { - msgInstance.click(callback); - } - } - - this.collapseSide = function() { - collapse() - } - - this.refreshThis = function() { - refresh() - } - - this.refresh = function(id) { - $("iframe[id='"+ id +"']").attr('src', $("iframe[id='"+ id +"']").attr('src')); - } - - this.addTab = function(id, title, url) { - if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { - bodyTab.addTabOnly({ - id: id, - title: title, - url: url, - icon: null, - close: true - }, 400); - } else { - return; - } - } - - this.closeTab = function(id) { - if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { - pearTab.delTabByElem('content', id, function(currentId){ - sideMenu.selectItem(currentId); - }); - } else { - return; - } - } - - this.closeCurrentTab = function() { - if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { - pearTab.delCurrentTabByElem('content', function(id){ - sideMenu.selectItem(id); - }); - } else { - return; - } - } - - this.closeOtherTab = function() { - if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { - pearTab.delOtherTabByElem('content', function(id){ - sideMenu.selectItem(id); - }); - } else { - return; - } - } - - this.closeAllTab = function() { - if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { - pearTab.delAllTabByElem('content', function(id){ - sideMenu.selectItem(id); - }); - } else { - return; - } - } - - this.changeTabTitle = function(id, title) { - pearTab.changeTabTitleById('content', id ,title); - } - - this.changeIframe = function(id, title, url) { - if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { - return; - } else { - sideMenu.selectItem(id); - bodyFrame.changePage(url, true); - } - } - - this.jump = function(id, title, url) { - if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { - pearAdmin.addTab(id, title, url) - } else { - pearAdmin.changeIframe(id, title, url) - } - } - - this.fullScreen = function() { - if ($(".fullScreen").hasClass("layui-icon-screen-restore")) { - screenFun(2).then(function() { - $(".fullScreen").eq(0).removeClass("layui-icon-screen-restore"); - }); - } else { - screenFun(1).then(function() { - $(".fullScreen").eq(0).addClass("layui-icon-screen-restore"); - }); - } - } - }; - - function refresh() { - var refreshA = $(".refresh a"); - refreshA.removeClass("layui-icon-refresh-1"); - refreshA.addClass("layui-anim"); - refreshA.addClass("layui-anim-rotate"); - refreshA.addClass("layui-anim-loop"); - refreshA.addClass("layui-icon-loading"); - if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) bodyTab.refresh(true); - else bodyFrame.refresh(true); - setTimeout(function() { - refreshA.addClass("layui-icon-refresh-1"); - refreshA.removeClass("layui-anim"); - refreshA.removeClass("layui-anim-rotate"); - refreshA.removeClass("layui-anim-loop"); - refreshA.removeClass("layui-icon-loading"); - }, 600) - } - - function collapse() { - sideMenu.collapse(); - var admin = $(".pear-admin"); - var left = $(".layui-icon-spread-left") - var right = $(".layui-icon-shrink-right") - if (admin.is(".pear-mini")) { - left.addClass("layui-icon-shrink-right") - left.removeClass("layui-icon-spread-left") - admin.removeClass("pear-mini"); - sideMenu.isCollapse = false; - } else { - right.addClass("layui-icon-spread-left") - right.removeClass("layui-icon-shrink-right") - admin.addClass("pear-mini"); - sideMenu.isCollapse = true; - } - } - - body.on("click", ".logout", function() { - if (logout() && bodyTab) { - bodyTab.clear(); - } - }) - - body.on("click", ".collapse,.pear-cover", function() { - collapse(); - }); - - body.on("click", ".menuSearch", function () { - // 过滤菜单 - var filterHandle = function (filterData, val) { - if (!val) return []; - var filteredMenus = []; - filterData = $.extend(true, {}, filterData); - $.each(filterData, function (index, item) { - if (item.children && item.children.length) { - var children = filterHandle(item.children, val) - var obj = $.extend({}, item, { children: children }); - if (children && children.length) { - filteredMenus.push(obj); - } else if (item.title.indexOf(val) >= 0) { - item.children = []; // 父级匹配但子级不匹配,就去除子级 - filteredMenus.push($.extend({}, item)); - } - } else if (item.title.indexOf(val) >= 0) { - filteredMenus.push(item); - } - }) - return filteredMenus; - } - - // 树转路径 - var tiledHandle = function (data) { - var tiledMenus = []; - var treeTiled = function (data, content) { - var path = ""; - var separator = " / "; - // 上级路径 - if (!content) content = ""; - $.each(data, function (index, item) { - if (item.children && item.children.length) { - path += content + item.title + separator; - var childPath = treeTiled(item.children, path); - path += childPath; - if (!childPath) path = ""; // 重置路径 - } else { - path += content + item.title - tiledMenus.push({ path: path, info: item }); - path = ""; //重置路径 - } - }) - return path; - }; - treeTiled(data); - - return tiledMenus; - } - - // 创建搜索列表 - var createList = function (data) { - var _listHtml = ''; - $.each(data, function (index, item) { - _listHtml += '
            • '; - _listHtml += ' ' + item.path + ''; - _listHtml += ' '; - _listHtml += '
            • ' - }) - return _listHtml; - } - - var _html = [ - '' - ].join(''); - - layer.open({ - type: 1, - offset: "10%", - area: ['600px'], - title: false, - closeBtn: 0, - shadeClose: true, - anim: 0, - move: false, - content: _html, - success: function(layero,layeridx){ - var $layer = layero; - var $content = $(layero).children('.layui-layer-content'); - var $input = $(".menu-search-input-wrapper input"); - var $noData = $(".menu-search-no-data"); - var $list = $(".menu-search-list"); - var menuData = sideMenu.option.data; - - - $layer.css("border-radius", "6px"); - $input.off("focus").focus(); - // 搜索菜单 - $input.off("input").on("input", debounce(function(){ - var keywords = $input.val().trim(); - var filteredMenus = filterHandle(menuData, keywords); - - if(filteredMenus.length){ - var tiledMenus = tiledHandle(filteredMenus); - var listHtml = createList(tiledMenus); - $noData.css("display", "none"); - $list.html("").append(listHtml).children(":first").addClass("this") - }else{ - $list.html(""); - $noData.css("display", "flex"); - } - var currentHeight = $(".menu-search-content").outerHeight() - $layer.css("height", currentHeight); - $content.css("height", currentHeight); - }, 500) - ) - // 搜索列表点击事件 - $list.off("click").on("click", "li", function () { - var menuId = $(this).attr("smenu-id"); - var menuUrl = $(this).attr("smenu-url"); - var menuIcon = $(this).attr("smenu-icon"); - var menuTitle = $(this).attr("smenu-title"); - var menuType = $(this).attr("smenu-type"); - var openableWindow = menuType === "1" || menuType === 1; - - if(sideMenu.isCollapse){ - collapse(); - } - if (openableWindow) { - pearAdmin.jump(menuId, menuTitle, menuUrl) - } else { - sideMenu.selectItem(menuId); - } - compatible(); - layer.close(layeridx); - }) - - $list.off('mouseenter').on("mouseenter", "li", function () { - $(".menu-search-list li.this").removeClass("this"); - $(this).addClass("this"); - }).off("mouseleave").on("mouseleave", "li", function(){ - $(this).removeClass("this"); - }) - - // 监听键盘事件 - // Enter:13 Spacebar:32 UpArrow:38 DownArrow:40 Esc:27 - $(document).off("keydown").keydown(function (e) { - if (e.keyCode === 13 || e.keyCode === 32) { - e.preventDefault(); - var menuId = $(".menu-search-list li.this").attr("smenu-id"); - var menuUrl = $(".menu-search-list li.this").attr("smenu-url"); - var menuTitle = $(".menu-search-list li.this").attr("smenu-title"); - var menuType = $(".menu-search-list li.this").attr("smenu-type"); - var openableWindow = menuType === "1" || menuType === 1; - if (sideMenu.isCollapse) { - collapse(); - } - if (openableWindow) { - pearAdmin.jump(menuId, menuTitle, menuUrl) - } else { - sideMenu.selectItem(menuId); - } - compatible(); - layer.close(layeridx); - }else if(e.keyCode === 38){ - e.preventDefault(); - var prevEl = $(".menu-search-list li.this").prev(); - $(".menu-search-list li.this").removeClass("this"); - if(prevEl.length !== 0){ - prevEl.addClass("this"); - }else{ - $list.children().last().addClass("this"); - } - }else if(e.keyCode === 40){ - e.preventDefault(); - var nextEl = $(".menu-search-list li.this").next(); - $(".menu-search-list li.this").removeClass("this"); - if(nextEl.length !== 0){ - nextEl.addClass("this"); - }else{ - $list.children().first().addClass("this"); - } - }else if(e.keyCode === 27){ - e.preventDefault(); - layer.close(layeridx); - } - }) - } - }) - }); - - - body.on("click", ".fullScreen", function() { - if ($(this).hasClass("layui-icon-screen-restore")) { - screenFun(2).then(function() { - $(".fullScreen").eq(0).removeClass("layui-icon-screen-restore"); - }); - } else { - screenFun(1).then(function() { - $(".fullScreen").eq(0).addClass("layui-icon-screen-restore"); - }); - } - }); - - body.on("click", '[user-menu-id]', function() { - if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { - bodyTab.addTabOnly({ - id: $(this).attr("user-menu-id"), - title: $(this).attr("user-menu-title"), - url: $(this).attr("user-menu-url"), - icon: "", - close: true - }, 300); - } else { - bodyFrame.changePage($(this).attr("user-menu-url"), true); - } - }); - - body.on("click", ".setting", function() { - - var menuItem = - '
            • ' + - '' + - '
              ' + - '
              ' + - '
              ' + - '
            • '; - - menuItem += - '
            • ' + - '' + - '
              ' + - '
              ' + - '
              ' + - '
            • '; - - var menuHtml = - '
              \n' + - '
              菜单风格
              \n' + - '
              \n' + - '
                \n' + menuItem + '
              \n' + - '
              \n' + - '
              '; - - var headItem = - '
            • ' + - '' + - '
              ' + - '
              ' + - '
              ' + - '
            • '; - - headItem += - '
            • ' + - '' + - '
              ' + - '
              ' + - '
              ' + - '
            • '; - - var headHtml = - '
              \n' + - '
              顶部风格
              \n' + - '
              \n' + - '
                \n' + headItem + '
              \n' + - '
              \n' + - '
              '; - - var moreItem = - '
              菜单
              '; - - moreItem += - '
              视图
              '; - - moreItem += - '
              通栏
              '; - - moreItem += - '
              通色
              '; - - moreItem += - '
              页脚
              '; - - var moreHtml = '
              \n' + - '
              更多设置
              \n' + - '
              \n' + - '
              \n' + moreItem + '
              \n' + - '
              \n' + - '
              '; - - layer.open({ - type: 1, - offset: 'r', - area: ['320px', '100%'], - title: false, - shade: 0.1, - closeBtn: 0, - shadeClose: false, - anim: -1, - skin: 'layer-anim-right', - move: false, - content: menuHtml + headHtml + buildColorHtml() + moreHtml, - success: function(layero, index) { - - form.render(); - - var color = localStorage.getItem("theme-color"); - var menu = localStorage.getItem("theme-menu"); - var header = localStorage.getItem("theme-header"); - - if (color !== "null") { - $(".select-color-item").removeClass("layui-icon").removeClass("layui-icon-ok"); - $("*[color-id='" + color + "']").addClass("layui-icon").addClass("layui-icon-ok"); - } - - if (menu !== "null") { - $("*[data-select-bgcolor]").removeClass("layui-this"); - $("[data-select-bgcolor='" + menu + "']").addClass("layui-this"); - } - - if (header !== "null") { - $("*[data-select-header]").removeClass("layui-this"); - $("[data-select-header='" + header + "']").addClass("layui-this"); - } - - $('#layui-layer-shade' + index).click(function() { - var $layero = $('#layui-layer' + index); - $layero.animate({ - left: $layero.offset().left + $layero.width() - }, 200, function() { - layer.close(index); - }); - }) - - form.on('switch(control)', function(data) { - localStorage.setItem("control", this.checked); - window.location.reload(); - }) - - form.on('switch(muilt-tab)', function(data) { - localStorage.setItem("muilt-tab", this.checked); - window.location.reload(); - }) - - form.on('switch(auto-head)', function(data) { - localStorage.setItem("auto-head", this.checked); - pearTheme.changeTheme(window, this.checked); - }) - - form.on('switch(banner)', function(data) { - localStorage.setItem("theme-banner", this.checked); - pearAdmin.bannerSkin(this.checked); - }) - - form.on('switch(footer)', function (data) { - localStorage.setItem("footer", this.checked); - pearAdmin.footer(this.checked); - }) - - if (localStorage.getItem('theme-banner') === 'true') { - $('input[name="banner"]').attr('checked', 'checked') - } else { - $('input[name="banner"]').removeAttr('checked') - } - - if (localStorage.getItem('control') === 'true') { - $('input[name="control"]').attr('checked', 'checked') - } else { - $('input[name="control"]').removeAttr('checked') - } - - if (localStorage.getItem('muilt-tab') === 'true') { - $('input[name="muilt-tab"]').attr('checked', 'checked') - } else { - $('input[name="muilt-tab"]').removeAttr('checked') - } - - if (localStorage.getItem('auto-head') === 'true') { - $('input[name="auto-head"]').attr('checked', 'checked') - } else { - $('input[name="auto-head"]').removeAttr('checked') - } - - if (localStorage.getItem('footer') === 'true') { - $('input[name="footer"]').attr('checked', 'checked') - } else { - $('input[name="footer"]').removeAttr('checked') - } - - form.render('checkbox'); - } - }); - }); - - body.on('click', '[data-select-bgcolor]', function() { - var theme = $(this).attr('data-select-bgcolor'); - $('[data-select-bgcolor]').removeClass("layui-this"); - $(this).addClass("layui-this"); - localStorage.setItem("theme-menu", theme); - pearAdmin.menuSkin(theme); - }); - - body.on('click', '[data-select-header]', function() { - var theme = $(this).attr('data-select-header'); - $('[data-select-header]').removeClass("layui-this"); - $(this).addClass("layui-this"); - localStorage.setItem("theme-header", theme); - pearAdmin.headerSkin(theme); - }); - - body.on('click', '.select-color-item', function() { - $(".select-color-item").removeClass("layui-icon").removeClass("layui-icon-ok"); - $(this).addClass("layui-icon").addClass("layui-icon-ok"); - var colorId = $(".select-color-item.layui-icon-ok").attr("color-id"); - var currentColor = getColorById(colorId); - localStorage.setItem("theme-color", currentColor.id); - localStorage.setItem("theme-color-color", currentColor.color); - localStorage.setItem("theme-color-second", currentColor.second); - pearTheme.changeTheme(window, isAutoHead(config)); - }); - - function applyConfig(param) { - config = param; - pearAdmin.logoRender(param); - pearAdmin.menuRender(param); - pearAdmin.bodyRender(param); - pearAdmin.themeRender(param); - pearAdmin.keepLoad(param); - if (param.header.message != false) { - pearAdmin.messageRender(param); - } - } - - function getColorById(id) { - var color; - var flag = false; - $.each(config.colors, function(i, value) { - if (value.id === id) { - color = value; - flag = true; - } - }) - if (flag === false || config.theme.allowCustom === false) { - $.each(config.colors, function(i, value) { - if (value.id === config.theme.defaultColor) { - color = value; - } - }) - } - return color; - } - - function buildColorHtml() { - var colors = ""; - $.each(config.colors, function(i, value) { - colors += ""; - }) - return "
              主题配色
              " + - colors + "
              " - } - - function compatible() { - if ($(window).width() <= 768) { - collapse() - } - } - - function screenFun(num) { - num = num || 1; - num = num * 1; - var docElm = document.documentElement; - switch (num) { - case 1: - if (docElm.requestFullscreen) { - docElm.requestFullscreen(); - } else if (docElm.mozRequestFullScreen) { - docElm.mozRequestFullScreen(); - } else if (docElm.webkitRequestFullScreen) { - docElm.webkitRequestFullScreen(); - } else if (docElm.msRequestFullscreen) { - docElm.msRequestFullscreen(); - } - break; - case 2: - if (document.exitFullscreen) { - document.exitFullscreen(); - } else if (document.mozCancelFullScreen) { - document.mozCancelFullScreen(); - } else if (document.webkitCancelFullScreen) { - document.webkitCancelFullScreen(); - } else if (document.msExitFullscreen) { - document.msExitFullscreen(); - } - break; - } - return new Promise(function(res, rej) { - res("返回值"); - }); - } - - function isFullscreen() { - return document.fullscreenElement || - document.msFullscreenElement || - document.mozFullScreenElement || - document.webkitFullscreenElement || false; - } - - function isControl(option) { - if (option.theme.allowCustom) { - if (localStorage.getItem("control") != null) { - return localStorage.getItem("control") - } else { - return option.menu.control - } - } else { - return option.menu.control - } - } - - function isAutoHead(option) { - if (option.theme.allowCustom) { - if (localStorage.getItem("auto-head") != null) { - return localStorage.getItem("auto-head"); - } else { - return option.other.autoHead; - } - } else { - return option.other.autoHead; - } - } - - function isMuiltTab(option) { - if (option.theme.allowCustom) { - if (localStorage.getItem("muilt-tab") != null) { - return localStorage.getItem("muilt-tab") - } else { - return option.tab.enable - } - } else { - return option.tab.enable - } - } - - window.onresize = function() { - if (!isFullscreen()) { - $(".fullScreen").eq(0).removeClass("layui-icon-screen-restore"); - } - } - - $(window).on('resize', debounce(function () { - if (!sideMenu.isCollapse && $(window).width() <= 768) { - collapse(); - } - },50)); - - function debounce(fn,awaitTime) { - var timerID = null - return function () { - var arg = arguments[0] - if (timerID) { - clearTimeout(timerID) - } - timerID = setTimeout(function () { - fn(arg) - }, awaitTime) - } - } - exports('admin', pearAdmin); - }) \ No newline at end of file +layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'menu', 'frame', 'theme', 'convert','fullscreen'], + function(exports) { + "use strict"; + + const $ = layui.jquery, + form = layui.form, + element = layui.element, + yaml = layui.yaml, + pearTab = layui.tab, + convert = layui.convert, + pearMenu = layui.menu, + pearFrame = layui.frame, + pearTheme = layui.theme, + message = layui.message, + fullscreen = layui.fullscreen; + + let bodyFrame; + let sideMenu; + let bodyTab; + let config; + let logout = function () { + }; + let msgInstance; + const body = $('body'); + + const pearAdmin = new function () { + + let configType = 'yml'; + let configPath = 'pear.config.yml'; + + this.setConfigPath = function (path) { + configPath = path; + } + + this.setConfigType = function (type) { + configType = type; + } + + this.render = function (initConfig) { + if (initConfig !== undefined) { + applyConfig(initConfig); + } else { + applyConfig(pearAdmin.readConfig()); + } + } + + this.readConfig = function () { + if (configType === "yml") { + return yaml.load(configPath); + } else { + let data; + $.ajax({ + url: configPath, + type: 'get', + dataType: 'json', + async: false, + success: function(result) { + data = result; + } + }) + return data; + } + } + + this.messageRender = function (option) { + option = { + elem: '.message', + url: option.header.message, + height: '250px' + }; + msgInstance = message.render(option); + } + + this.logoRender = function (param) { + $(".layui-logo .logo").attr("src", param.logo.image); + $(".layui-logo .title").html(param.logo.title); + } + + this.menuRender = function (param) { + sideMenu = pearMenu.render({ + elem: 'sideMenu', + async: param.menu.async !== undefined ? param.menu.async : true, + theme: "dark-theme", + height: '100%', + method: param.menu.method, + control: isControl(param) === 'true' || isControl(param) === true ? 'control' : false, // control + defaultMenu: 0, + accordion: param.menu.accordion, + url: param.menu.data, + data: param.menu.data, + parseData: false, + change: function () { + compatible(); + }, + done: function () { + sideMenu.isCollapse = param.menu.collapse; + sideMenu.selectItem(param.menu.select); + pearAdmin.collapse(param); + } + }); + } + + this.bodyRender = function (param) { + + body.on("click", ".refresh", function () { + refresh(); + }) + + if (isMuiltTab(param) === "true" || isMuiltTab(param) === true) { + bodyTab = pearTab.render({ + elem: 'content', + roll: true, + tool: true, + width: '100%', + height: '100%', + session: param.tab.session, + index: 0, + tabMax: param.tab.max, + preload: param.tab.preload, + closeEvent: function (id) { + sideMenu.selectItem(id); + }, + data: [{ + id: param.tab.index.id, + url: param.tab.index.href, + title: param.tab.index.title, + close: false + }], + success: function (id) { + if (param.tab.session) { + setTimeout(function () { + sideMenu.selectItem(id); + bodyTab.positionTab(); + }, 500) + } + } + }); + + bodyTab.click(function (id) { + if (!param.tab.keepState) { + bodyTab.refresh(false); + } + bodyTab.positionTab(); + sideMenu.selectItem(id); + }) + + sideMenu.click(function (dom, data) { + bodyTab.addTabOnly({ + id: data.menuId, + title: data.menuTitle, + url: data.menuUrl, + icon: data.menuIcon, + close: true + }, 300); + compatible(); + }) + } else { + bodyFrame = pearFrame.render({ + elem: 'content', + title: '首页', + url: param.tab.index.href, + width: '100%', + height: '100%' + }); + + sideMenu.click(function (dom, data) { + bodyFrame.changePage(data.menuUrl, true); + compatible() + }) + } + } + + this.keepLoad = function (param) { + compatible() + setTimeout(function () { + $(".loader-main").fadeOut(200); + }, param.other.keepLoad) + } + + this.themeRender = function (option) { + if (option.theme.allowCustom === false) { + $(".setting").remove(); + } + const colorId = localStorage.getItem("theme-color"); + const currentColor = getColorById(colorId); + localStorage.setItem("theme-color", currentColor.id); + localStorage.setItem("theme-color-color", currentColor.color); + localStorage.setItem("theme-color-second", currentColor.second); + pearTheme.changeTheme(window, isAutoHead(config)); + + let menu = localStorage.getItem("theme-menu"); + if (menu === null) { + menu = option.theme.defaultMenu; + } else { + if (option.theme.allowCustom === false) { + menu = option.theme.defaultMenu; + } + } + + let header = localStorage.getItem("theme-header"); + if (header === null) { + header = option.theme.defaultHeader; + } else { + if (option.theme.allowCustom === false) { + header = option.theme.defaultHeader; + } + } + + let banner = localStorage.getItem("theme-banner"); + if (banner === null) { + banner = option.theme.banner; + } else { + if (option.theme.allowCustom === false) { + banner = option.theme.banner; + } + } + + let autoHead = localStorage.getItem("auto-head"); + if (autoHead === null) { + autoHead = option.other.autoHead; + } else { + if (option.theme.allowCustom === false) { + autoHead = option.other.autoHead; + } + } + + let muiltTab = localStorage.getItem("muilt-tab"); + if (muiltTab === null) { + muiltTab = option.tab.enable; + } else { + if (option.theme.allowCustom === false) { + muiltTab = option.tab.enable; + } + } + + let control = localStorage.getItem("control"); + if (control === null) { + control = option.menu.control; + } else { + if (option.theme.allowCustom === false) { + control = option.menu.control; + } + } + + let footer = localStorage.getItem("footer"); + if (footer === null) { + footer = option.other.footer; + } else { + if (option.theme.allowCustom === false) { + footer = option.other.footer; + } + } + + localStorage.setItem("muilt-tab", muiltTab); + localStorage.setItem("theme-banner", banner); + localStorage.setItem("theme-menu", menu); + localStorage.setItem("theme-header", header); + localStorage.setItem("auto-head", autoHead); + localStorage.setItem("control", control); + localStorage.setItem("footer", footer); + this.menuSkin(menu); + this.headerSkin(header); + this.bannerSkin(banner); + this.footer(footer); + } + + this.footer = function (footer) { + const bodyDOM = $(".pear-admin .layui-body"); + const footerDOM = $(".pear-admin .layui-footer"); + if (footer === true || footer === "true") { + footerDOM.removeClass("close"); + bodyDOM.css("bottom", footerDOM.outerHeight()); + } else { + footerDOM.addClass("close"); + bodyDOM.css("bottom", ""); + } + } + + this.bannerSkin = function (theme) { + const pearAdmin = $(".pear-admin"); + pearAdmin.removeClass("banner-layout"); + if (theme === true || theme === "true") { + pearAdmin.addClass("banner-layout"); + } + } + + this.collapse = function (param) { + if (param.menu.collapse) { + if ($(window).width() >= 768) { + collapse() + } + } + } + + this.menuSkin = function (theme) { + const pearAdmin = $(".pear-admin .layui-side"); + pearAdmin.removeClass("light-theme"); + pearAdmin.removeClass("dark-theme"); + pearAdmin.addClass(theme); + } + + this.headerSkin = function (theme) { + const pearAdmin = $(".pear-admin .layui-header"); + pearAdmin.removeClass("light-theme"); + pearAdmin.removeClass("dark-theme"); + pearAdmin.addClass(theme); + } + + this.logout = function (callback) { + logout = callback; + } + + this.message = function (callback) { + if (callback != null) { + msgInstance.click(callback); + } + } + + this.collapseSide = function () { + collapse() + } + + this.refreshThis = function () { + refresh() + } + + this.refresh = function (id) { + const iframe = $("iframe[id='" + id + "']"); + iframe.attr('src', iframe.attr('src')); + } + + this.addTab = function (id, title, url) { + if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { + bodyTab.addTabOnly({ + id: id, + title: title, + url: url, + icon: null, + close: true + }, 400); + } + } + + this.closeTab = function (id) { + if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { + pearTab.delTabByElem('content', id, function (currentId) { + sideMenu.selectItem(currentId); + }); + } + } + + this.closeCurrentTab = function () { + if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { + pearTab.delCurrentTabByElem('content', function (id) { + sideMenu.selectItem(id); + }); + } + } + + this.closeOtherTab = function () { + if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { + pearTab.delOtherTabByElem('content', function (id) { + sideMenu.selectItem(id); + }); + } + } + + this.closeAllTab = function () { + if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { + pearTab.delAllTabByElem('content', function (id) { + sideMenu.selectItem(id); + }); + } + } + + this.changeTabTitle = function (id, title) { + pearTab.changeTabTitleById('content', id, title); + } + + this.changeIframe = function (id, title, url) { + if (isMuiltTab(config) !== "true" && isMuiltTab(config) !== true) { + sideMenu.selectItem(id); + bodyFrame.changePage(url, true); + } + } + + this.jump = function (id, title, url) { + if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { + pearAdmin.addTab(id, title, url) + } else { + pearAdmin.changeIframe(id, title, url) + } + } + + this.fullScreen = function () { + if ($(".fullScreen").hasClass("layui-icon-screen-restore")) { + screenFun(2).then(function () { + $(".fullScreen").eq(0).removeClass("layui-icon-screen-restore"); + }); + } else { + screenFun(1).then(function () { + $(".fullScreen").eq(0).addClass("layui-icon-screen-restore"); + }); + } + } + }; + + function refresh() { + const refreshA = $(".refresh a"); + refreshA.removeClass("layui-icon-refresh-1"); + refreshA.addClass("layui-anim"); + refreshA.addClass("layui-anim-rotate"); + refreshA.addClass("layui-anim-loop"); + refreshA.addClass("layui-icon-loading"); + if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) bodyTab.refresh(true); + else bodyFrame.refresh(true); + setTimeout(function() { + refreshA.addClass("layui-icon-refresh-1"); + refreshA.removeClass("layui-anim"); + refreshA.removeClass("layui-anim-rotate"); + refreshA.removeClass("layui-anim-loop"); + refreshA.removeClass("layui-icon-loading"); + }, 600) + } + + function collapse() { + sideMenu.collapse(); + const admin = $(".pear-admin"); + const left = $(".layui-icon-spread-left"); + const right = $(".layui-icon-shrink-right"); + if (admin.is(".pear-mini")) { + left.addClass("layui-icon-shrink-right") + left.removeClass("layui-icon-spread-left") + admin.removeClass("pear-mini"); + sideMenu.isCollapse = false; + } else { + right.addClass("layui-icon-spread-left") + right.removeClass("layui-icon-shrink-right") + admin.addClass("pear-mini"); + sideMenu.isCollapse = true; + } + } + + body.on("click", ".logout", function() { + if (logout() && bodyTab) { + bodyTab.clear(); + } + }) + + body.on("click", ".collapse,.pear-cover", function() { + collapse(); + }); + + body.on("click", ".menuSearch", function () { + // 过滤菜单 + const filterHandle = function (filterData, val) { + if (!val) return []; + const filteredMenus = []; + filterData = $.extend(true, {}, filterData); + $.each(filterData, function (index, item) { + if (item.children && item.children.length) { + var children = filterHandle(item.children, val) + var obj = $.extend({}, item, {children: children}); + if (children && children.length) { + filteredMenus.push(obj); + } else if (item.title.indexOf(val) >= 0) { + item.children = []; // 父级匹配但子级不匹配,就去除子级 + filteredMenus.push($.extend({}, item)); + } + } else if (item.title.indexOf(val) >= 0) { + filteredMenus.push(item); + } + }) + return filteredMenus; + }; + + // 树转路径 + const tiledHandle = function (data) { + const tiledMenus = []; + const treeTiled = function (data, content) { + let path = ""; + const separator = " / "; + // 上级路径 + if (!content) content = ""; + $.each(data, function (index, item) { + if (item.children && item.children.length) { + path += content + item.title + separator; + const childPath = treeTiled(item.children, path); + path += childPath; + if (!childPath) path = ""; // 重置路径 + } else { + path += content + item.title + tiledMenus.push({path: path, info: item}); + path = ""; //重置路径 + } + }) + return path; + }; + treeTiled(data); + + return tiledMenus; + }; + + // 创建搜索列表 + const createList = function (data) { + let _listHtml = ''; + $.each(data, function (index, item) { + _listHtml += '
            • '; + _listHtml += ' ' + item.path + ''; + _listHtml += ' '; + _listHtml += '
            • ' + }) + return _listHtml; + }; + + const _html = [ + '' + ].join(''); + + layer.open({ + type: 1, + offset: "10%", + area: ['600px'], + title: false, + closeBtn: 0, + shadeClose: true, + anim: 0, + move: false, + content: _html, + success: function(layero,layeridx){ + const $layer = layero; + const $content = $(layero).children('.layui-layer-content'); + const $input = $(".menu-search-input-wrapper input"); + const $noData = $(".menu-search-no-data"); + const $list = $(".menu-search-list"); + const menuData = sideMenu.option.data; + + + $layer.css("border-radius", "6px"); + $input.off("focus").focus(); + // 搜索菜单 + $input.off("input").on("input", debounce(function(){ + const keywords = $input.val().trim(); + const filteredMenus = filterHandle(menuData, keywords); + + if(filteredMenus.length){ + const tiledMenus = tiledHandle(filteredMenus); + const listHtml = createList(tiledMenus); + $noData.css("display", "none"); + $list.html("").append(listHtml).children(":first").addClass("this") + }else{ + $list.html(""); + $noData.css("display", "flex"); + } + const currentHeight = $(".menu-search-content").outerHeight(); + $layer.css("height", currentHeight); + $content.css("height", currentHeight); + }, 500) + ) + // 搜索列表点击事件 + $list.off("click").on("click", "li", function () { + const menuId = $(this).attr("smenu-id"); + const menuUrl = $(this).attr("smenu-url"); + const menuIcon = $(this).attr("smenu-icon"); + const menuTitle = $(this).attr("smenu-title"); + const menuType = $(this).attr("smenu-type"); + const openableWindow = menuType === "1" || menuType === 1; + + if(sideMenu.isCollapse){ + collapse(); + } + if (openableWindow) { + pearAdmin.jump(menuId, menuTitle, menuUrl) + } else { + sideMenu.selectItem(menuId); + } + compatible(); + layer.close(layeridx); + }) + + $list.off('mouseenter').on("mouseenter", "li", function () { + $(".menu-search-list li.this").removeClass("this"); + $(this).addClass("this"); + }).off("mouseleave").on("mouseleave", "li", function(){ + $(this).removeClass("this"); + }) + + // 监听键盘事件 + // Enter:13 Spacebar:32 UpArrow:38 DownArrow:40 Esc:27 + $(document).off("keydown").keydown(function (e) { + const $menuSearchList = $(".menu-search-list li.this"); + if (e.keyCode === 13 || e.keyCode === 32) { + e.preventDefault(); + const menuId = $menuSearchList.attr("smenu-id"); + const menuUrl = $menuSearchList.attr("smenu-url"); + const menuTitle = $menuSearchList.attr("smenu-title"); + const menuType = $menuSearchList.attr("smenu-type"); + const openableWindow = menuType === "1" || menuType === 1; + if (sideMenu.isCollapse) { + collapse(); + } + if (openableWindow) { + pearAdmin.jump(menuId, menuTitle, menuUrl) + } else { + sideMenu.selectItem(menuId); + } + compatible(); + layer.close(layeridx); + }else if(e.keyCode === 38){ + e.preventDefault(); + const prevEl = $menuSearchList.prev(); + $menuSearchList.removeClass("this"); + if(prevEl.length !== 0){ + prevEl.addClass("this"); + }else{ + $list.children().last().addClass("this"); + } + }else if(e.keyCode === 40){ + e.preventDefault(); + const nextEl = $menuSearchList.next(); + $menuSearchList.removeClass("this"); + if(nextEl.length !== 0){ + nextEl.addClass("this"); + }else{ + $list.children().first().addClass("this"); + } + }else if(e.keyCode === 27){ + e.preventDefault(); + layer.close(layeridx); + } + }) + } + }) + }); + + + body.on("click", ".fullScreen", function() { + if ($(this).hasClass("layui-icon-screen-restore")) { + fullscreen.fullClose().then(function() { + $(".fullScreen").eq(0).removeClass("layui-icon-screen-restore"); + }); + } else { + fullscreen.fullScreen().then(function() { + $(".fullScreen").eq(0).addClass("layui-icon-screen-restore"); + }); + } + }); + + body.on("click", '[user-menu-id]', function() { + if (isMuiltTab(config) === "true" || isMuiltTab(config) === true) { + bodyTab.addTabOnly({ + id: $(this).attr("user-menu-id"), + title: $(this).attr("user-menu-title"), + url: $(this).attr("user-menu-url"), + icon: "", + close: true + }, 300); + } else { + bodyFrame.changePage($(this).attr("user-menu-url"), true); + } + }); + + body.on("click", ".setting", function() { + + let menuItem = + '
            • ' + + '' + + '
              ' + + '
              ' + + '
              ' + + '
            • '; + + menuItem += + '
            • ' + + '' + + '
              ' + + '
              ' + + '
              ' + + '
            • '; + + const menuHtml = + '
              \n' + + '
              菜单风格
              \n' + + '
              \n' + + '
                \n' + menuItem + '
              \n' + + '
              \n' + + '
              '; + + let headItem = + '
            • ' + + '' + + '
              ' + + '
              ' + + '
              ' + + '
            • '; + + headItem += + '
            • ' + + '' + + '
              ' + + '
              ' + + '
              ' + + '
            • '; + + const headHtml = + '
              \n' + + '
              顶部风格
              \n' + + '
              \n' + + '
                \n' + headItem + '
              \n' + + '
              \n' + + '
              '; + + let moreItem = + '
              菜单
              '; + + moreItem += + '
              视图
              '; + + moreItem += + '
              通栏
              '; + + moreItem += + '
              通色
              '; + + moreItem += + '
              页脚
              '; + + const moreHtml = '
              \n' + + '
              更多设置
              \n' + + '
              \n' + + '
              \n' + moreItem + '
              \n' + + '
              \n' + + '
              '; + + layer.open({ + type: 1, + offset: 'r', + area: ['320px', '100%'], + title: false, + shade: 0.1, + closeBtn: 0, + shadeClose: false, + anim: -1, + skin: 'layer-anim-right', + move: false, + content: menuHtml + headHtml + buildColorHtml() + moreHtml, + success: function(layero, index) { + + form.render(); + + const color = localStorage.getItem("theme-color"); + const menu = localStorage.getItem("theme-menu"); + const header = localStorage.getItem("theme-header"); + + if (color !== "null") { + $(".select-color-item").removeClass("layui-icon").removeClass("layui-icon-ok"); + $("*[color-id='" + color + "']").addClass("layui-icon").addClass("layui-icon-ok"); + } + + if (menu !== "null") { + $("*[data-select-bgcolor]").removeClass("layui-this"); + $("[data-select-bgcolor='" + menu + "']").addClass("layui-this"); + } + + if (header !== "null") { + $("*[data-select-header]").removeClass("layui-this"); + $("[data-select-header='" + header + "']").addClass("layui-this"); + } + + $('#layui-layer-shade' + index).click(function() { + const $layero = $('#layui-layer' + index); + $layero.animate({ + left: $layero.offset().left + $layero.width() + }, 200, function() { + layer.close(index); + }); + }) + + form.on('switch(control)', function(data) { + localStorage.setItem("control", this.checked); + window.location.reload(); + }) + + form.on('switch(muilt-tab)', function(data) { + localStorage.setItem("muilt-tab", this.checked); + window.location.reload(); + }) + + form.on('switch(auto-head)', function(data) { + localStorage.setItem("auto-head", this.checked); + pearTheme.changeTheme(window, this.checked); + }) + + form.on('switch(banner)', function(data) { + localStorage.setItem("theme-banner", this.checked); + pearAdmin.bannerSkin(this.checked); + }) + + form.on('switch(footer)', function (data) { + localStorage.setItem("footer", this.checked); + pearAdmin.footer(this.checked); + }) + + if (localStorage.getItem('theme-banner') === 'true') { + $('input[name="banner"]').attr('checked', 'checked') + } else { + $('input[name="banner"]').removeAttr('checked') + } + + if (localStorage.getItem('control') === 'true') { + $('input[name="control"]').attr('checked', 'checked') + } else { + $('input[name="control"]').removeAttr('checked') + } + + if (localStorage.getItem('muilt-tab') === 'true') { + $('input[name="muilt-tab"]').attr('checked', 'checked') + } else { + $('input[name="muilt-tab"]').removeAttr('checked') + } + + if (localStorage.getItem('auto-head') === 'true') { + $('input[name="auto-head"]').attr('checked', 'checked') + } else { + $('input[name="auto-head"]').removeAttr('checked') + } + + if (localStorage.getItem('footer') === 'true') { + $('input[name="footer"]').attr('checked', 'checked') + } else { + $('input[name="footer"]').removeAttr('checked') + } + + form.render('checkbox'); + } + }); + }); + + body.on('click', '[data-select-bgcolor]', function() { + const theme = $(this).attr('data-select-bgcolor'); + $('[data-select-bgcolor]').removeClass("layui-this"); + $(this).addClass("layui-this"); + localStorage.setItem("theme-menu", theme); + pearAdmin.menuSkin(theme); + }); + + body.on('click', '[data-select-header]', function() { + const theme = $(this).attr('data-select-header'); + $('[data-select-header]').removeClass("layui-this"); + $(this).addClass("layui-this"); + localStorage.setItem("theme-header", theme); + pearAdmin.headerSkin(theme); + }); + + body.on('click', '.select-color-item', function() { + $(".select-color-item").removeClass("layui-icon").removeClass("layui-icon-ok"); + $(this).addClass("layui-icon").addClass("layui-icon-ok"); + const colorId = $(".select-color-item.layui-icon-ok").attr("color-id"); + const currentColor = getColorById(colorId); + localStorage.setItem("theme-color", currentColor.id); + localStorage.setItem("theme-color-color", currentColor.color); + localStorage.setItem("theme-color-second", currentColor.second); + pearTheme.changeTheme(window, isAutoHead(config)); + }); + + function applyConfig(param) { + config = param; + pearAdmin.logoRender(param); + pearAdmin.menuRender(param); + pearAdmin.bodyRender(param); + pearAdmin.themeRender(param); + pearAdmin.keepLoad(param); + if (param.header.message !== false) { + pearAdmin.messageRender(param); + } + } + + function getColorById(id) { + let color; + let flag = false; + $.each(config.colors, function(i, value) { + if (value.id === id) { + color = value; + flag = true; + } + }) + if (flag === false || config.theme.allowCustom === false) { + $.each(config.colors, function(i, value) { + if (value.id === config.theme.defaultColor) { + color = value; + } + }) + } + return color; + } + + function buildColorHtml() { + let colors = ""; + $.each(config.colors, function(i, value) { + colors += ""; + }) + return "
              主题配色
              " + + colors + "
              " + } + + function compatible() { + if ($(window).width() <= 768) { + collapse() + } + } + + function isControl(option) { + if (option.theme.allowCustom) { + if (localStorage.getItem("control") != null) { + return localStorage.getItem("control") + } else { + return option.menu.control + } + } else { + return option.menu.control + } + } + + function isAutoHead(option) { + if (option.theme.allowCustom) { + if (localStorage.getItem("auto-head") != null) { + return localStorage.getItem("auto-head"); + } else { + return option.other.autoHead; + } + } else { + return option.other.autoHead; + } + } + + function isMuiltTab(option) { + if (option.theme.allowCustom) { + if (localStorage.getItem("muilt-tab") != null) { + return localStorage.getItem("muilt-tab") + } else { + return option.tab.enable + } + } else { + return option.tab.enable + } + } + + window.onresize = function() { + if (!fullscreen.isFullscreen()) { + $(".fullScreen").eq(0).removeClass("layui-icon-screen-restore"); + } + } + + $(window).on('resize', debounce(function () { + if (sideMenu && !sideMenu.isCollapse && $(window).width() <= 768) { + collapse(); + } + },50)); + + function debounce(fn, awaitTime) { + let timerID = null; + return function () { + const arg = arguments[0]; + if (timerID) { + clearTimeout(timerID) + } + timerID = setTimeout(function () { + fn(arg) + }, awaitTime) + } + } + exports('admin', pearAdmin); + }) diff --git a/src/main/resources/static/component/pear/module/area.js b/src/main/resources/static/component/pear/module/area.js index 15d59cc9..604c91e9 100644 --- a/src/main/resources/static/component/pear/module/area.js +++ b/src/main/resources/static/component/pear/module/area.js @@ -1,4066 +1,4070 @@ layui.define(['layer', 'form', 'laytpl'], function (exports) { "use strict"; - + let $ = layui.$ , form = layui.form , layarea = { - _id: 0 - , config: {} - , set: function (options) { - let that = this; - that.config = $.extend({}, that.config, options); - return that; - } - , on: function (events, callback) { - return layui.onevent.call(this, 'layarea', events, callback); - } + _id: 0 + , config: {} + , set: function (options) { + let that = this; + that.config = $.extend({}, that.config, options); + return that; + } + , on: function (events, callback) { + return layui.onevent.call(this, 'layarea', events, callback); + } } , thisArea = function () { - let that = this; - return { - layarea: function (files) { - that.layarea.call(that, files); - } - , config: that.config - , reload: that.reload - , events: that.events + let that = this; + return { + layarea: function (files) { + that.layarea.call(that, files); } + , config: that.config + , reload: that.reload + , events: that.events + } } , Class = function (options) { - let that = this; - that.config = $.extend({}, { - elem: '', - data: { - province: '', - city: '', - county: '', - provinceCode: 0, - cityCode: 0, - countyCode: 0, - } - }, options); - that.render(); + let that = this; + that.config = $.extend({}, { + elem: '', + data: { + province: '', + city: '', + county: '', + provinceCode: 0, + cityCode: 0, + countyCode: 0, + } + }, options); + that.render(); }; - + let areaList = { - province_list: { - 110000: '北京市', - 120000: '天津市', - 130000: '河北省', - 140000: '山西省', - 150000: '内蒙古自治区', - 210000: '辽宁省', - 220000: '吉林省', - 230000: '黑龙江省', - 310000: '上海市', - 320000: '江苏省', - 330000: '浙江省', - 340000: '安徽省', - 350000: '福建省', - 360000: '江西省', - 370000: '山东省', - 410000: '河南省', - 420000: '湖北省', - 430000: '湖南省', - 440000: '广东省', - 450000: '广西壮族自治区', - 460000: '海南省', - 500000: '重庆市', - 510000: '四川省', - 520000: '贵州省', - 530000: '云南省', - 540000: '西藏自治区', - 610000: '陕西省', - 620000: '甘肃省', - 630000: '青海省', - 640000: '宁夏回族自治区', - 650000: '新疆维吾尔自治区', - 710000: '台湾省', - 810000: '香港特别行政区', - 820000: '澳门特别行政区', - 900000: '海外' - }, - city_list: { - 110100: '北京市', - 120100: '天津市', - 130100: '石家庄市', - 130200: '唐山市', - 130300: '秦皇岛市', - 130400: '邯郸市', - 130500: '邢台市', - 130600: '保定市', - 130700: '张家口市', - 130800: '承德市', - 130900: '沧州市', - 131000: '廊坊市', - 131100: '衡水市', - 139000: '省直辖县', - 140100: '太原市', - 140200: '大同市', - 140300: '阳泉市', - 140400: '长治市', - 140500: '晋城市', - 140600: '朔州市', - 140700: '晋中市', - 140800: '运城市', - 140900: '忻州市', - 141000: '临汾市', - 141100: '吕梁市', - 150100: '呼和浩特市', - 150200: '包头市', - 150300: '乌海市', - 150400: '赤峰市', - 150500: '通辽市', - 150600: '鄂尔多斯市', - 150700: '呼伦贝尔市', - 150800: '巴彦淖尔市', - 150900: '乌兰察布市', - 152200: '兴安盟', - 152500: '锡林郭勒盟', - 152900: '阿拉善盟', - 210100: '沈阳市', - 210200: '大连市', - 210300: '鞍山市', - 210400: '抚顺市', - 210500: '本溪市', - 210600: '丹东市', - 210700: '锦州市', - 210800: '营口市', - 210900: '阜新市', - 211000: '辽阳市', - 211100: '盘锦市', - 211200: '铁岭市', - 211300: '朝阳市', - 211400: '葫芦岛市', - 220100: '长春市', - 220200: '吉林市', - 220300: '四平市', - 220400: '辽源市', - 220500: '通化市', - 220600: '白山市', - 220700: '松原市', - 220800: '白城市', - 222400: '延边朝鲜族自治州', - 230100: '哈尔滨市', - 230200: '齐齐哈尔市', - 230300: '鸡西市', - 230400: '鹤岗市', - 230500: '双鸭山市', - 230600: '大庆市', - 230700: '伊春市', - 230800: '佳木斯市', - 230900: '七台河市', - 231000: '牡丹江市', - 231100: '黑河市', - 231200: '绥化市', - 232700: '大兴安岭地区', - 310100: '上海市', - 320100: '南京市', - 320200: '无锡市', - 320300: '徐州市', - 320400: '常州市', - 320500: '苏州市', - 320600: '南通市', - 320700: '连云港市', - 320800: '淮安市', - 320900: '盐城市', - 321000: '扬州市', - 321100: '镇江市', - 321200: '泰州市', - 321300: '宿迁市', - 330100: '杭州市', - 330200: '宁波市', - 330300: '温州市', - 330400: '嘉兴市', - 330500: '湖州市', - 330600: '绍兴市', - 330700: '金华市', - 330800: '衢州市', - 330900: '舟山市', - 331000: '台州市', - 331100: '丽水市', - 340100: '合肥市', - 340200: '芜湖市', - 340300: '蚌埠市', - 340400: '淮南市', - 340500: '马鞍山市', - 340600: '淮北市', - 340700: '铜陵市', - 340800: '安庆市', - 341000: '黄山市', - 341100: '滁州市', - 341200: '阜阳市', - 341300: '宿州市', - 341500: '六安市', - 341600: '亳州市', - 341700: '池州市', - 341800: '宣城市', - 350100: '福州市', - 350200: '厦门市', - 350300: '莆田市', - 350400: '三明市', - 350500: '泉州市', - 350600: '漳州市', - 350700: '南平市', - 350800: '龙岩市', - 350900: '宁德市', - 360100: '南昌市', - 360200: '景德镇市', - 360300: '萍乡市', - 360400: '九江市', - 360500: '新余市', - 360600: '鹰潭市', - 360700: '赣州市', - 360800: '吉安市', - 360900: '宜春市', - 361000: '抚州市', - 361100: '上饶市', - 370100: '济南市', - 370200: '青岛市', - 370300: '淄博市', - 370400: '枣庄市', - 370500: '东营市', - 370600: '烟台市', - 370700: '潍坊市', - 370800: '济宁市', - 370900: '泰安市', - 371000: '威海市', - 371100: '日照市', - 371200: '莱芜市', - 371300: '临沂市', - 371400: '德州市', - 371500: '聊城市', - 371600: '滨州市', - 371700: '菏泽市', - 410100: '郑州市', - 410200: '开封市', - 410300: '洛阳市', - 410400: '平顶山市', - 410500: '安阳市', - 410600: '鹤壁市', - 410700: '新乡市', - 410800: '焦作市', - 410900: '濮阳市', - 411000: '许昌市', - 411100: '漯河市', - 411200: '三门峡市', - 411300: '南阳市', - 411400: '商丘市', - 411500: '信阳市', - 411600: '周口市', - 411700: '驻马店市', - 419000: '省直辖县', - 420100: '武汉市', - 420200: '黄石市', - 420300: '十堰市', - 420500: '宜昌市', - 420600: '襄阳市', - 420700: '鄂州市', - 420800: '荆门市', - 420900: '孝感市', - 421000: '荆州市', - 421100: '黄冈市', - 421200: '咸宁市', - 421300: '随州市', - 422800: '恩施土家族苗族自治州', - 429000: '省直辖县', - 430100: '长沙市', - 430200: '株洲市', - 430300: '湘潭市', - 430400: '衡阳市', - 430500: '邵阳市', - 430600: '岳阳市', - 430700: '常德市', - 430800: '张家界市', - 430900: '益阳市', - 431000: '郴州市', - 431100: '永州市', - 431200: '怀化市', - 431300: '娄底市', - 433100: '湘西土家族苗族自治州', - 440100: '广州市', - 440200: '韶关市', - 440300: '深圳市', - 440400: '珠海市', - 440500: '汕头市', - 440600: '佛山市', - 440700: '江门市', - 440800: '湛江市', - 440900: '茂名市', - 441200: '肇庆市', - 441300: '惠州市', - 441400: '梅州市', - 441500: '汕尾市', - 441600: '河源市', - 441700: '阳江市', - 441800: '清远市', - 441900: '东莞市', - 442000: '中山市', - 445100: '潮州市', - 445200: '揭阳市', - 445300: '云浮市', - 450100: '南宁市', - 450200: '柳州市', - 450300: '桂林市', - 450400: '梧州市', - 450500: '北海市', - 450600: '防城港市', - 450700: '钦州市', - 450800: '贵港市', - 450900: '玉林市', - 451000: '百色市', - 451100: '贺州市', - 451200: '河池市', - 451300: '来宾市', - 451400: '崇左市', - 460100: '海口市', - 460200: '三亚市', - 460300: '三沙市', - 460400: '儋州市', - 469000: '省直辖县', - 500100: '重庆市', - 500200: '县', - 510100: '成都市', - 510300: '自贡市', - 510400: '攀枝花市', - 510500: '泸州市', - 510600: '德阳市', - 510700: '绵阳市', - 510800: '广元市', - 510900: '遂宁市', - 511000: '内江市', - 511100: '乐山市', - 511300: '南充市', - 511400: '眉山市', - 511500: '宜宾市', - 511600: '广安市', - 511700: '达州市', - 511800: '雅安市', - 511900: '巴中市', - 512000: '资阳市', - 513200: '阿坝藏族羌族自治州', - 513300: '甘孜藏族自治州', - 513400: '凉山彝族自治州', - 520100: '贵阳市', - 520200: '六盘水市', - 520300: '遵义市', - 520400: '安顺市', - 520500: '毕节市', - 520600: '铜仁市', - 522300: '黔西南布依族苗族自治州', - 522600: '黔东南苗族侗族自治州', - 522700: '黔南布依族苗族自治州', - 530100: '昆明市', - 530300: '曲靖市', - 530400: '玉溪市', - 530500: '保山市', - 530600: '昭通市', - 530700: '丽江市', - 530800: '普洱市', - 530900: '临沧市', - 532300: '楚雄彝族自治州', - 532500: '红河哈尼族彝族自治州', - 532600: '文山壮族苗族自治州', - 532800: '西双版纳傣族自治州', - 532900: '大理白族自治州', - 533100: '德宏傣族景颇族自治州', - 533300: '怒江傈僳族自治州', - 533400: '迪庆藏族自治州', - 540100: '拉萨市', - 540200: '日喀则市', - 540300: '昌都市', - 540400: '林芝市', - 540500: '山南市', - 540600: '那曲市', - 542500: '阿里地区', - 610100: '西安市', - 610200: '铜川市', - 610300: '宝鸡市', - 610400: '咸阳市', - 610500: '渭南市', - 610600: '延安市', - 610700: '汉中市', - 610800: '榆林市', - 610900: '安康市', - 611000: '商洛市', - 620100: '兰州市', - 620200: '嘉峪关市', - 620300: '金昌市', - 620400: '白银市', - 620500: '天水市', - 620600: '武威市', - 620700: '张掖市', - 620800: '平凉市', - 620900: '酒泉市', - 621000: '庆阳市', - 621100: '定西市', - 621200: '陇南市', - 622900: '临夏回族自治州', - 623000: '甘南藏族自治州', - 630100: '西宁市', - 630200: '海东市', - 632200: '海北藏族自治州', - 632300: '黄南藏族自治州', - 632500: '海南藏族自治州', - 632600: '果洛藏族自治州', - 632700: '玉树藏族自治州', - 632800: '海西蒙古族藏族自治州', - 640100: '银川市', - 640200: '石嘴山市', - 640300: '吴忠市', - 640400: '固原市', - 640500: '中卫市', - 650100: '乌鲁木齐市', - 650200: '克拉玛依市', - 650400: '吐鲁番市', - 650500: '哈密市', - 652300: '昌吉回族自治州', - 652700: '博尔塔拉蒙古自治州', - 652800: '巴音郭楞蒙古自治州', - 652900: '阿克苏地区', - 653000: '克孜勒苏柯尔克孜自治州', - 653100: '喀什地区', - 653200: '和田地区', - 654000: '伊犁哈萨克自治州', - 654200: '塔城地区', - 654300: '阿勒泰地区', - 659000: '自治区直辖县级行政区划', - 710100: '台北市', - 710200: '高雄市', - 710300: '台南市', - 710400: '台中市', - 710500: '金门县', - 710600: '南投县', - 710700: '基隆市', - 710800: '新竹市', - 710900: '嘉义市', - 711100: '新北市', - 711200: '宜兰县', - 711300: '新竹县', - 711400: '桃园县', - 711500: '苗栗县', - 711700: '彰化县', - 711900: '嘉义县', - 712100: '云林县', - 712400: '屏东县', - 712500: '台东县', - 712600: '花莲县', - 712700: '澎湖县', - 712800: '连江县', - 810100: '香港岛', - 810200: '九龙', - 810300: '新界', - 820100: '澳门半岛', - 820200: '离岛', - 912400: '加拿大', - 941000: '韩国', - 984000: '美国' - }, - county_list: { - 110101: '东城区', - 110102: '西城区', - 110105: '朝阳区', - 110106: '丰台区', - 110107: '石景山区', - 110108: '海淀区', - 110109: '门头沟区', - 110111: '房山区', - 110112: '通州区', - 110113: '顺义区', - 110114: '昌平区', - 110115: '大兴区', - 110116: '怀柔区', - 110117: '平谷区', - 110118: '密云区', - 110119: '延庆区', - 120101: '和平区', - 120102: '河东区', - 120103: '河西区', - 120104: '南开区', - 120105: '河北区', - 120106: '红桥区', - 120110: '东丽区', - 120111: '西青区', - 120112: '津南区', - 120113: '北辰区', - 120114: '武清区', - 120115: '宝坻区', - 120116: '滨海新区', - 120117: '宁河区', - 120118: '静海区', - 120119: '蓟州区', - 130102: '长安区', - 130104: '桥西区', - 130105: '新华区', - 130107: '井陉矿区', - 130108: '裕华区', - 130109: '藁城区', - 130110: '鹿泉区', - 130111: '栾城区', - 130121: '井陉县', - 130123: '正定县', - 130125: '行唐县', - 130126: '灵寿县', - 130127: '高邑县', - 130128: '深泽县', - 130129: '赞皇县', - 130130: '无极县', - 130131: '平山县', - 130132: '元氏县', - 130133: '赵县', - 130181: '辛集市', - 130183: '晋州市', - 130184: '新乐市', - 130202: '路南区', - 130203: '路北区', - 130204: '古冶区', - 130205: '开平区', - 130207: '丰南区', - 130208: '丰润区', - 130209: '曹妃甸区', - 130223: '滦县', - 130224: '滦南县', - 130225: '乐亭县', - 130227: '迁西县', - 130229: '玉田县', - 130281: '遵化市', - 130283: '迁安市', - 130302: '海港区', - 130303: '山海关区', - 130304: '北戴河区', - 130306: '抚宁区', - 130321: '青龙满族自治县', - 130322: '昌黎县', - 130324: '卢龙县', - 130390: '经济技术开发区', - 130402: '邯山区', - 130403: '丛台区', - 130404: '复兴区', - 130406: '峰峰矿区', - 130407: '肥乡区', - 130408: '永年区', - 130423: '临漳县', - 130424: '成安县', - 130425: '大名县', - 130426: '涉县', - 130427: '磁县', - 130430: '邱县', - 130431: '鸡泽县', - 130432: '广平县', - 130433: '馆陶县', - 130434: '魏县', - 130435: '曲周县', - 130481: '武安市', - 130502: '桥东区', - 130503: '桥西区', - 130521: '邢台县', - 130522: '临城县', - 130523: '内丘县', - 130524: '柏乡县', - 130525: '隆尧县', - 130526: '任县', - 130527: '南和县', - 130528: '宁晋县', - 130529: '巨鹿县', - 130530: '新河县', - 130531: '广宗县', - 130532: '平乡县', - 130533: '威县', - 130534: '清河县', - 130535: '临西县', - 130581: '南宫市', - 130582: '沙河市', - 130602: '竞秀区', - 130606: '莲池区', - 130607: '满城区', - 130608: '清苑区', - 130609: '徐水区', - 130623: '涞水县', - 130624: '阜平县', - 130626: '定兴县', - 130627: '唐县', - 130628: '高阳县', - 130629: '容城县', - 130630: '涞源县', - 130631: '望都县', - 130632: '安新县', - 130633: '易县', - 130634: '曲阳县', - 130635: '蠡县', - 130636: '顺平县', - 130637: '博野县', - 130638: '雄县', - 130681: '涿州市', - 130682: '定州市', - 130683: '安国市', - 130684: '高碑店市', - 130702: '桥东区', - 130703: '桥西区', - 130705: '宣化区', - 130706: '下花园区', - 130708: '万全区', - 130709: '崇礼区', - 130722: '张北县', - 130723: '康保县', - 130724: '沽源县', - 130725: '尚义县', - 130726: '蔚县', - 130727: '阳原县', - 130728: '怀安县', - 130730: '怀来县', - 130731: '涿鹿县', - 130732: '赤城县', - 130802: '双桥区', - 130803: '双滦区', - 130804: '鹰手营子矿区', - 130821: '承德县', - 130822: '兴隆县', - 130824: '滦平县', - 130825: '隆化县', - 130826: '丰宁满族自治县', - 130827: '宽城满族自治县', - 130828: '围场满族蒙古族自治县', - 130881: '平泉市', - 130902: '新华区', - 130903: '运河区', - 130921: '沧县', - 130922: '青县', - 130923: '东光县', - 130924: '海兴县', - 130925: '盐山县', - 130926: '肃宁县', - 130927: '南皮县', - 130928: '吴桥县', - 130929: '献县', - 130930: '孟村回族自治县', - 130981: '泊头市', - 130982: '任丘市', - 130983: '黄骅市', - 130984: '河间市', - 131002: '安次区', - 131003: '广阳区', - 131022: '固安县', - 131023: '永清县', - 131024: '香河县', - 131025: '大城县', - 131026: '文安县', - 131028: '大厂回族自治县', - 131081: '霸州市', - 131082: '三河市', - 131090: '开发区', - 131102: '桃城区', - 131103: '冀州区', - 131121: '枣强县', - 131122: '武邑县', - 131123: '武强县', - 131124: '饶阳县', - 131125: '安平县', - 131126: '故城县', - 131127: '景县', - 131128: '阜城县', - 131182: '深州市', - 140105: '小店区', - 140106: '迎泽区', - 140107: '杏花岭区', - 140108: '尖草坪区', - 140109: '万柏林区', - 140110: '晋源区', - 140121: '清徐县', - 140122: '阳曲县', - 140123: '娄烦县', - 140181: '古交市', - 140202: '城区', - 140203: '矿区', - 140211: '南郊区', - 140212: '新荣区', - 140221: '阳高县', - 140222: '天镇县', - 140223: '广灵县', - 140224: '灵丘县', - 140225: '浑源县', - 140226: '左云县', - 140227: '大同县', - 140302: '城区', - 140303: '矿区', - 140311: '郊区', - 140321: '平定县', - 140322: '盂县', - 140402: '城区', - 140411: '郊区', - 140421: '长治县', - 140423: '襄垣县', - 140424: '屯留县', - 140425: '平顺县', - 140426: '黎城县', - 140427: '壶关县', - 140428: '长子县', - 140429: '武乡县', - 140430: '沁县', - 140431: '沁源县', - 140481: '潞城市', - 140502: '城区', - 140521: '沁水县', - 140522: '阳城县', - 140524: '陵川县', - 140525: '泽州县', - 140581: '高平市', - 140602: '朔城区', - 140603: '平鲁区', - 140621: '山阴县', - 140622: '应县', - 140623: '右玉县', - 140624: '怀仁县', - 140702: '榆次区', - 140721: '榆社县', - 140722: '左权县', - 140723: '和顺县', - 140724: '昔阳县', - 140725: '寿阳县', - 140726: '太谷县', - 140727: '祁县', - 140728: '平遥县', - 140729: '灵石县', - 140781: '介休市', - 140802: '盐湖区', - 140821: '临猗县', - 140822: '万荣县', - 140823: '闻喜县', - 140824: '稷山县', - 140825: '新绛县', - 140826: '绛县', - 140827: '垣曲县', - 140828: '夏县', - 140829: '平陆县', - 140830: '芮城县', - 140881: '永济市', - 140882: '河津市', - 140902: '忻府区', - 140921: '定襄县', - 140922: '五台县', - 140923: '代县', - 140924: '繁峙县', - 140925: '宁武县', - 140926: '静乐县', - 140927: '神池县', - 140928: '五寨县', - 140929: '岢岚县', - 140930: '河曲县', - 140931: '保德县', - 140932: '偏关县', - 140981: '原平市', - 141002: '尧都区', - 141021: '曲沃县', - 141022: '翼城县', - 141023: '襄汾县', - 141024: '洪洞县', - 141025: '古县', - 141026: '安泽县', - 141027: '浮山县', - 141028: '吉县', - 141029: '乡宁县', - 141030: '大宁县', - 141031: '隰县', - 141032: '永和县', - 141033: '蒲县', - 141034: '汾西县', - 141081: '侯马市', - 141082: '霍州市', - 141102: '离石区', - 141121: '文水县', - 141122: '交城县', - 141123: '兴县', - 141124: '临县', - 141125: '柳林县', - 141126: '石楼县', - 141127: '岚县', - 141128: '方山县', - 141129: '中阳县', - 141130: '交口县', - 141181: '孝义市', - 141182: '汾阳市', - 150102: '新城区', - 150103: '回民区', - 150104: '玉泉区', - 150105: '赛罕区', - 150121: '土默特左旗', - 150122: '托克托县', - 150123: '和林格尔县', - 150124: '清水河县', - 150125: '武川县', - 150202: '东河区', - 150203: '昆都仑区', - 150204: '青山区', - 150205: '石拐区', - 150206: '白云鄂博矿区', - 150207: '九原区', - 150221: '土默特右旗', - 150222: '固阳县', - 150223: '达尔罕茂明安联合旗', - 150302: '海勃湾区', - 150303: '海南区', - 150304: '乌达区', - 150402: '红山区', - 150403: '元宝山区', - 150404: '松山区', - 150421: '阿鲁科尔沁旗', - 150422: '巴林左旗', - 150423: '巴林右旗', - 150424: '林西县', - 150425: '克什克腾旗', - 150426: '翁牛特旗', - 150428: '喀喇沁旗', - 150429: '宁城县', - 150430: '敖汉旗', - 150502: '科尔沁区', - 150521: '科尔沁左翼中旗', - 150522: '科尔沁左翼后旗', - 150523: '开鲁县', - 150524: '库伦旗', - 150525: '奈曼旗', - 150526: '扎鲁特旗', - 150581: '霍林郭勒市', - 150602: '东胜区', - 150603: '康巴什区', - 150621: '达拉特旗', - 150622: '准格尔旗', - 150623: '鄂托克前旗', - 150624: '鄂托克旗', - 150625: '杭锦旗', - 150626: '乌审旗', - 150627: '伊金霍洛旗', - 150702: '海拉尔区', - 150703: '扎赉诺尔区', - 150721: '阿荣旗', - 150722: '莫力达瓦达斡尔族自治旗', - 150723: '鄂伦春自治旗', - 150724: '鄂温克族自治旗', - 150725: '陈巴尔虎旗', - 150726: '新巴尔虎左旗', - 150727: '新巴尔虎右旗', - 150781: '满洲里市', - 150782: '牙克石市', - 150783: '扎兰屯市', - 150784: '额尔古纳市', - 150785: '根河市', - 150802: '临河区', - 150821: '五原县', - 150822: '磴口县', - 150823: '乌拉特前旗', - 150824: '乌拉特中旗', - 150825: '乌拉特后旗', - 150826: '杭锦后旗', - 150902: '集宁区', - 150921: '卓资县', - 150922: '化德县', - 150923: '商都县', - 150924: '兴和县', - 150925: '凉城县', - 150926: '察哈尔右翼前旗', - 150927: '察哈尔右翼中旗', - 150928: '察哈尔右翼后旗', - 150929: '四子王旗', - 150981: '丰镇市', - 152201: '乌兰浩特市', - 152202: '阿尔山市', - 152221: '科尔沁右翼前旗', - 152222: '科尔沁右翼中旗', - 152223: '扎赉特旗', - 152224: '突泉县', - 152501: '二连浩特市', - 152502: '锡林浩特市', - 152522: '阿巴嘎旗', - 152523: '苏尼特左旗', - 152524: '苏尼特右旗', - 152525: '东乌珠穆沁旗', - 152526: '西乌珠穆沁旗', - 152527: '太仆寺旗', - 152528: '镶黄旗', - 152529: '正镶白旗', - 152530: '正蓝旗', - 152531: '多伦县', - 152921: '阿拉善左旗', - 152922: '阿拉善右旗', - 152923: '额济纳旗', - 210102: '和平区', - 210103: '沈河区', - 210104: '大东区', - 210105: '皇姑区', - 210106: '铁西区', - 210111: '苏家屯区', - 210112: '浑南区', - 210113: '沈北新区', - 210114: '于洪区', - 210115: '辽中区', - 210123: '康平县', - 210124: '法库县', - 210181: '新民市', - 210190: '经济技术开发区', - 210202: '中山区', - 210203: '西岗区', - 210204: '沙河口区', - 210211: '甘井子区', - 210212: '旅顺口区', - 210213: '金州区', - 210214: '普兰店区', - 210224: '长海县', - 210281: '瓦房店市', - 210283: '庄河市', - 210302: '铁东区', - 210303: '铁西区', - 210304: '立山区', - 210311: '千山区', - 210321: '台安县', - 210323: '岫岩满族自治县', - 210381: '海城市', - 210390: '高新区', - 210402: '新抚区', - 210403: '东洲区', - 210404: '望花区', - 210411: '顺城区', - 210421: '抚顺县', - 210422: '新宾满族自治县', - 210423: '清原满族自治县', - 210502: '平山区', - 210503: '溪湖区', - 210504: '明山区', - 210505: '南芬区', - 210521: '本溪满族自治县', - 210522: '桓仁满族自治县', - 210602: '元宝区', - 210603: '振兴区', - 210604: '振安区', - 210624: '宽甸满族自治县', - 210681: '东港市', - 210682: '凤城市', - 210702: '古塔区', - 210703: '凌河区', - 210711: '太和区', - 210726: '黑山县', - 210727: '义县', - 210781: '凌海市', - 210782: '北镇市', - 210793: '经济技术开发区', - 210802: '站前区', - 210803: '西市区', - 210804: '鲅鱼圈区', - 210811: '老边区', - 210881: '盖州市', - 210882: '大石桥市', - 210902: '海州区', - 210903: '新邱区', - 210904: '太平区', - 210905: '清河门区', - 210911: '细河区', - 210921: '阜新蒙古族自治县', - 210922: '彰武县', - 211002: '白塔区', - 211003: '文圣区', - 211004: '宏伟区', - 211005: '弓长岭区', - 211011: '太子河区', - 211021: '辽阳县', - 211081: '灯塔市', - 211102: '双台子区', - 211103: '兴隆台区', - 211104: '大洼区', - 211122: '盘山县', - 211202: '银州区', - 211204: '清河区', - 211221: '铁岭县', - 211223: '西丰县', - 211224: '昌图县', - 211281: '调兵山市', - 211282: '开原市', - 211302: '双塔区', - 211303: '龙城区', - 211321: '朝阳县', - 211322: '建平县', - 211324: '喀喇沁左翼蒙古族自治县', - 211381: '北票市', - 211382: '凌源市', - 211402: '连山区', - 211403: '龙港区', - 211404: '南票区', - 211421: '绥中县', - 211422: '建昌县', - 211481: '兴城市', - 215090: '工业园区', - 220102: '南关区', - 220103: '宽城区', - 220104: '朝阳区', - 220105: '二道区', - 220106: '绿园区', - 220112: '双阳区', - 220113: '九台区', - 220122: '农安县', - 220182: '榆树市', - 220183: '德惠市', - 220192: '经济技术开发区', - 220202: '昌邑区', - 220203: '龙潭区', - 220204: '船营区', - 220211: '丰满区', - 220221: '永吉县', - 220281: '蛟河市', - 220282: '桦甸市', - 220283: '舒兰市', - 220284: '磐石市', - 220302: '铁西区', - 220303: '铁东区', - 220322: '梨树县', - 220323: '伊通满族自治县', - 220381: '公主岭市', - 220382: '双辽市', - 220402: '龙山区', - 220403: '西安区', - 220421: '东丰县', - 220422: '东辽县', - 220502: '东昌区', - 220503: '二道江区', - 220521: '通化县', - 220523: '辉南县', - 220524: '柳河县', - 220581: '梅河口市', - 220582: '集安市', - 220602: '浑江区', - 220605: '江源区', - 220621: '抚松县', - 220622: '靖宇县', - 220623: '长白朝鲜族自治县', - 220681: '临江市', - 220702: '宁江区', - 220721: '前郭尔罗斯蒙古族自治县', - 220722: '长岭县', - 220723: '乾安县', - 220781: '扶余市', - 220802: '洮北区', - 220821: '镇赉县', - 220822: '通榆县', - 220881: '洮南市', - 220882: '大安市', - 221090: '工业园区', - 222401: '延吉市', - 222402: '图们市', - 222403: '敦化市', - 222404: '珲春市', - 222405: '龙井市', - 222406: '和龙市', - 222424: '汪清县', - 222426: '安图县', - 230102: '道里区', - 230103: '南岗区', - 230104: '道外区', - 230108: '平房区', - 230109: '松北区', - 230110: '香坊区', - 230111: '呼兰区', - 230112: '阿城区', - 230113: '双城区', - 230123: '依兰县', - 230124: '方正县', - 230125: '宾县', - 230126: '巴彦县', - 230127: '木兰县', - 230128: '通河县', - 230129: '延寿县', - 230183: '尚志市', - 230184: '五常市', - 230202: '龙沙区', - 230203: '建华区', - 230204: '铁锋区', - 230205: '昂昂溪区', - 230206: '富拉尔基区', - 230207: '碾子山区', - 230208: '梅里斯达斡尔族区', - 230221: '龙江县', - 230223: '依安县', - 230224: '泰来县', - 230225: '甘南县', - 230227: '富裕县', - 230229: '克山县', - 230230: '克东县', - 230231: '拜泉县', - 230281: '讷河市', - 230302: '鸡冠区', - 230303: '恒山区', - 230304: '滴道区', - 230305: '梨树区', - 230306: '城子河区', - 230307: '麻山区', - 230321: '鸡东县', - 230381: '虎林市', - 230382: '密山市', - 230402: '向阳区', - 230403: '工农区', - 230404: '南山区', - 230405: '兴安区', - 230406: '东山区', - 230407: '兴山区', - 230421: '萝北县', - 230422: '绥滨县', - 230502: '尖山区', - 230503: '岭东区', - 230505: '四方台区', - 230506: '宝山区', - 230521: '集贤县', - 230522: '友谊县', - 230523: '宝清县', - 230524: '饶河县', - 230602: '萨尔图区', - 230603: '龙凤区', - 230604: '让胡路区', - 230605: '红岗区', - 230606: '大同区', - 230621: '肇州县', - 230622: '肇源县', - 230623: '林甸县', - 230624: '杜尔伯特蒙古族自治县', - 230702: '伊春区', - 230703: '南岔区', - 230704: '友好区', - 230705: '西林区', - 230706: '翠峦区', - 230707: '新青区', - 230708: '美溪区', - 230709: '金山屯区', - 230710: '五营区', - 230711: '乌马河区', - 230712: '汤旺河区', - 230713: '带岭区', - 230714: '乌伊岭区', - 230715: '红星区', - 230716: '上甘岭区', - 230722: '嘉荫县', - 230781: '铁力市', - 230803: '向阳区', - 230804: '前进区', - 230805: '东风区', - 230811: '郊区', - 230822: '桦南县', - 230826: '桦川县', - 230828: '汤原县', - 230881: '同江市', - 230882: '富锦市', - 230883: '抚远市', - 230902: '新兴区', - 230903: '桃山区', - 230904: '茄子河区', - 230921: '勃利县', - 231002: '东安区', - 231003: '阳明区', - 231004: '爱民区', - 231005: '西安区', - 231025: '林口县', - 231081: '绥芬河市', - 231083: '海林市', - 231084: '宁安市', - 231085: '穆棱市', - 231086: '东宁市', - 231102: '爱辉区', - 231121: '嫩江县', - 231123: '逊克县', - 231124: '孙吴县', - 231181: '北安市', - 231182: '五大连池市', - 231202: '北林区', - 231221: '望奎县', - 231222: '兰西县', - 231223: '青冈县', - 231224: '庆安县', - 231225: '明水县', - 231226: '绥棱县', - 231281: '安达市', - 231282: '肇东市', - 231283: '海伦市', - 232721: '呼玛县', - 232722: '塔河县', - 232723: '漠河县', - 232790: '松岭区', - 232791: '呼中区', - 232792: '加格达奇区', - 232793: '新林区', - 310101: '黄浦区', - 310104: '徐汇区', - 310105: '长宁区', - 310106: '静安区', - 310107: '普陀区', - 310109: '虹口区', - 310110: '杨浦区', - 310112: '闵行区', - 310113: '宝山区', - 310114: '嘉定区', - 310115: '浦东新区', - 310116: '金山区', - 310117: '松江区', - 310118: '青浦区', - 310120: '奉贤区', - 310151: '崇明区', - 320102: '玄武区', - 320104: '秦淮区', - 320105: '建邺区', - 320106: '鼓楼区', - 320111: '浦口区', - 320113: '栖霞区', - 320114: '雨花台区', - 320115: '江宁区', - 320116: '六合区', - 320117: '溧水区', - 320118: '高淳区', - 320205: '锡山区', - 320206: '惠山区', - 320211: '滨湖区', - 320213: '梁溪区', - 320214: '新吴区', - 320281: '江阴市', - 320282: '宜兴市', - 320302: '鼓楼区', - 320303: '云龙区', - 320305: '贾汪区', - 320311: '泉山区', - 320312: '铜山区', - 320321: '丰县', - 320322: '沛县', - 320324: '睢宁县', - 320381: '新沂市', - 320382: '邳州市', - 320391: '工业园区', - 320402: '天宁区', - 320404: '钟楼区', - 320411: '新北区', - 320412: '武进区', - 320413: '金坛区', - 320481: '溧阳市', - 320505: '虎丘区', - 320506: '吴中区', - 320507: '相城区', - 320508: '姑苏区', - 320509: '吴江区', - 320581: '常熟市', - 320582: '张家港市', - 320583: '昆山市', - 320585: '太仓市', - 320590: '工业园区', - 320591: '高新区', - 320602: '崇川区', - 320611: '港闸区', - 320612: '通州区', - 320621: '海安县', - 320623: '如东县', - 320681: '启东市', - 320682: '如皋市', - 320684: '海门市', - 320691: '高新区', - 320703: '连云区', - 320706: '海州区', - 320707: '赣榆区', - 320722: '东海县', - 320723: '灌云县', - 320724: '灌南县', - 320803: '淮安区', - 320804: '淮阴区', - 320812: '清江浦区', - 320813: '洪泽区', - 320826: '涟水县', - 320830: '盱眙县', - 320831: '金湖县', - 320890: '经济开发区', - 320902: '亭湖区', - 320903: '盐都区', - 320904: '大丰区', - 320921: '响水县', - 320922: '滨海县', - 320923: '阜宁县', - 320924: '射阳县', - 320925: '建湖县', - 320981: '东台市', - 321002: '广陵区', - 321003: '邗江区', - 321012: '江都区', - 321023: '宝应县', - 321081: '仪征市', - 321084: '高邮市', - 321090: '经济开发区', - 321102: '京口区', - 321111: '润州区', - 321112: '丹徒区', - 321181: '丹阳市', - 321182: '扬中市', - 321183: '句容市', - 321202: '海陵区', - 321203: '高港区', - 321204: '姜堰区', - 321281: '兴化市', - 321282: '靖江市', - 321283: '泰兴市', - 321302: '宿城区', - 321311: '宿豫区', - 321322: '沭阳县', - 321323: '泗阳县', - 321324: '泗洪县', - 330102: '上城区', - 330103: '下城区', - 330104: '江干区', - 330105: '拱墅区', - 330106: '西湖区', - 330108: '滨江区', - 330109: '萧山区', - 330110: '余杭区', - 330111: '富阳区', - 330112: '临安区', - 330122: '桐庐县', - 330127: '淳安县', - 330182: '建德市', - 330203: '海曙区', - 330205: '江北区', - 330206: '北仑区', - 330211: '镇海区', - 330212: '鄞州区', - 330213: '奉化区', - 330225: '象山县', - 330226: '宁海县', - 330281: '余姚市', - 330282: '慈溪市', - 330302: '鹿城区', - 330303: '龙湾区', - 330304: '瓯海区', - 330305: '洞头区', - 330324: '永嘉县', - 330326: '平阳县', - 330327: '苍南县', - 330328: '文成县', - 330329: '泰顺县', - 330381: '瑞安市', - 330382: '乐清市', - 330402: '南湖区', - 330411: '秀洲区', - 330421: '嘉善县', - 330424: '海盐县', - 330481: '海宁市', - 330482: '平湖市', - 330483: '桐乡市', - 330502: '吴兴区', - 330503: '南浔区', - 330521: '德清县', - 330522: '长兴县', - 330523: '安吉县', - 330602: '越城区', - 330603: '柯桥区', - 330604: '上虞区', - 330624: '新昌县', - 330681: '诸暨市', - 330683: '嵊州市', - 330702: '婺城区', - 330703: '金东区', - 330723: '武义县', - 330726: '浦江县', - 330727: '磐安县', - 330781: '兰溪市', - 330782: '义乌市', - 330783: '东阳市', - 330784: '永康市', - 330802: '柯城区', - 330803: '衢江区', - 330822: '常山县', - 330824: '开化县', - 330825: '龙游县', - 330881: '江山市', - 330902: '定海区', - 330903: '普陀区', - 330921: '岱山县', - 330922: '嵊泗县', - 331002: '椒江区', - 331003: '黄岩区', - 331004: '路桥区', - 331022: '三门县', - 331023: '天台县', - 331024: '仙居县', - 331081: '温岭市', - 331082: '临海市', - 331083: '玉环市', - 331102: '莲都区', - 331121: '青田县', - 331122: '缙云县', - 331123: '遂昌县', - 331124: '松阳县', - 331125: '云和县', - 331126: '庆元县', - 331127: '景宁畲族自治县', - 331181: '龙泉市', - 340102: '瑶海区', - 340103: '庐阳区', - 340104: '蜀山区', - 340111: '包河区', - 340121: '长丰县', - 340122: '肥东县', - 340123: '肥西县', - 340124: '庐江县', - 340181: '巢湖市', - 340190: '高新技术开发区', - 340191: '经济技术开发区', - 340202: '镜湖区', - 340203: '弋江区', - 340207: '鸠江区', - 340208: '三山区', - 340221: '芜湖县', - 340222: '繁昌县', - 340223: '南陵县', - 340225: '无为县', - 340302: '龙子湖区', - 340303: '蚌山区', - 340304: '禹会区', - 340311: '淮上区', - 340321: '怀远县', - 340322: '五河县', - 340323: '固镇县', - 340402: '大通区', - 340403: '田家庵区', - 340404: '谢家集区', - 340405: '八公山区', - 340406: '潘集区', - 340421: '凤台县', - 340422: '寿县', - 340503: '花山区', - 340504: '雨山区', - 340506: '博望区', - 340521: '当涂县', - 340522: '含山县', - 340523: '和县', - 340602: '杜集区', - 340603: '相山区', - 340604: '烈山区', - 340621: '濉溪县', - 340705: '铜官区', - 340706: '义安区', - 340711: '郊区', - 340722: '枞阳县', - 340802: '迎江区', - 340803: '大观区', - 340811: '宜秀区', - 340822: '怀宁县', - 340824: '潜山县', - 340825: '太湖县', - 340826: '宿松县', - 340827: '望江县', - 340828: '岳西县', - 340881: '桐城市', - 341002: '屯溪区', - 341003: '黄山区', - 341004: '徽州区', - 341021: '歙县', - 341022: '休宁县', - 341023: '黟县', - 341024: '祁门县', - 341102: '琅琊区', - 341103: '南谯区', - 341122: '来安县', - 341124: '全椒县', - 341125: '定远县', - 341126: '凤阳县', - 341181: '天长市', - 341182: '明光市', - 341202: '颍州区', - 341203: '颍东区', - 341204: '颍泉区', - 341221: '临泉县', - 341222: '太和县', - 341225: '阜南县', - 341226: '颍上县', - 341282: '界首市', - 341302: '埇桥区', - 341321: '砀山县', - 341322: '萧县', - 341323: '灵璧县', - 341324: '泗县', - 341390: '经济开发区', - 341502: '金安区', - 341503: '裕安区', - 341504: '叶集区', - 341522: '霍邱县', - 341523: '舒城县', - 341524: '金寨县', - 341525: '霍山县', - 341602: '谯城区', - 341621: '涡阳县', - 341622: '蒙城县', - 341623: '利辛县', - 341702: '贵池区', - 341721: '东至县', - 341722: '石台县', - 341723: '青阳县', - 341802: '宣州区', - 341821: '郎溪县', - 341822: '广德县', - 341823: '泾县', - 341824: '绩溪县', - 341825: '旌德县', - 341881: '宁国市', - 350102: '鼓楼区', - 350103: '台江区', - 350104: '仓山区', - 350105: '马尾区', - 350111: '晋安区', - 350112: '长乐区', - 350121: '闽侯县', - 350122: '连江县', - 350123: '罗源县', - 350124: '闽清县', - 350125: '永泰县', - 350128: '平潭县', - 350181: '福清市', - 350203: '思明区', - 350205: '海沧区', - 350206: '湖里区', - 350211: '集美区', - 350212: '同安区', - 350213: '翔安区', - 350302: '城厢区', - 350303: '涵江区', - 350304: '荔城区', - 350305: '秀屿区', - 350322: '仙游县', - 350402: '梅列区', - 350403: '三元区', - 350421: '明溪县', - 350423: '清流县', - 350424: '宁化县', - 350425: '大田县', - 350426: '尤溪县', - 350427: '沙县', - 350428: '将乐县', - 350429: '泰宁县', - 350430: '建宁县', - 350481: '永安市', - 350502: '鲤城区', - 350503: '丰泽区', - 350504: '洛江区', - 350505: '泉港区', - 350521: '惠安县', - 350524: '安溪县', - 350525: '永春县', - 350526: '德化县', - 350527: '金门县', - 350581: '石狮市', - 350582: '晋江市', - 350583: '南安市', - 350602: '芗城区', - 350603: '龙文区', - 350622: '云霄县', - 350623: '漳浦县', - 350624: '诏安县', - 350625: '长泰县', - 350626: '东山县', - 350627: '南靖县', - 350628: '平和县', - 350629: '华安县', - 350681: '龙海市', - 350702: '延平区', - 350703: '建阳区', - 350721: '顺昌县', - 350722: '浦城县', - 350723: '光泽县', - 350724: '松溪县', - 350725: '政和县', - 350781: '邵武市', - 350782: '武夷山市', - 350783: '建瓯市', - 350802: '新罗区', - 350803: '永定区', - 350821: '长汀县', - 350823: '上杭县', - 350824: '武平县', - 350825: '连城县', - 350881: '漳平市', - 350902: '蕉城区', - 350921: '霞浦县', - 350922: '古田县', - 350923: '屏南县', - 350924: '寿宁县', - 350925: '周宁县', - 350926: '柘荣县', - 350981: '福安市', - 350982: '福鼎市', - 360102: '东湖区', - 360103: '西湖区', - 360104: '青云谱区', - 360105: '湾里区', - 360111: '青山湖区', - 360112: '新建区', - 360121: '南昌县', - 360123: '安义县', - 360124: '进贤县', - 360190: '经济技术开发区', - 360192: '高新区', - 360202: '昌江区', - 360203: '珠山区', - 360222: '浮梁县', - 360281: '乐平市', - 360302: '安源区', - 360313: '湘东区', - 360321: '莲花县', - 360322: '上栗县', - 360323: '芦溪县', - 360402: '濂溪区', - 360403: '浔阳区', - 360404: '柴桑区', - 360423: '武宁县', - 360424: '修水县', - 360425: '永修县', - 360426: '德安县', - 360428: '都昌县', - 360429: '湖口县', - 360430: '彭泽县', - 360481: '瑞昌市', - 360482: '共青城市', - 360483: '庐山市', - 360490: '经济技术开发区', - 360502: '渝水区', - 360521: '分宜县', - 360602: '月湖区', - 360622: '余江县', - 360681: '贵溪市', - 360702: '章贡区', - 360703: '南康区', - 360704: '赣县区', - 360722: '信丰县', - 360723: '大余县', - 360724: '上犹县', - 360725: '崇义县', - 360726: '安远县', - 360727: '龙南县', - 360728: '定南县', - 360729: '全南县', - 360730: '宁都县', - 360731: '于都县', - 360732: '兴国县', - 360733: '会昌县', - 360734: '寻乌县', - 360735: '石城县', - 360781: '瑞金市', - 360802: '吉州区', - 360803: '青原区', - 360821: '吉安县', - 360822: '吉水县', - 360823: '峡江县', - 360824: '新干县', - 360825: '永丰县', - 360826: '泰和县', - 360827: '遂川县', - 360828: '万安县', - 360829: '安福县', - 360830: '永新县', - 360881: '井冈山市', - 360902: '袁州区', - 360921: '奉新县', - 360922: '万载县', - 360923: '上高县', - 360924: '宜丰县', - 360925: '靖安县', - 360926: '铜鼓县', - 360981: '丰城市', - 360982: '樟树市', - 360983: '高安市', - 361002: '临川区', - 361003: '东乡区', - 361021: '南城县', - 361022: '黎川县', - 361023: '南丰县', - 361024: '崇仁县', - 361025: '乐安县', - 361026: '宜黄县', - 361027: '金溪县', - 361028: '资溪县', - 361030: '广昌县', - 361102: '信州区', - 361103: '广丰区', - 361121: '上饶县', - 361123: '玉山县', - 361124: '铅山县', - 361125: '横峰县', - 361126: '弋阳县', - 361127: '余干县', - 361128: '鄱阳县', - 361129: '万年县', - 361130: '婺源县', - 361181: '德兴市', - 370102: '历下区', - 370103: '市中区', - 370104: '槐荫区', - 370105: '天桥区', - 370112: '历城区', - 370113: '长清区', - 370114: '章丘区', - 370124: '平阴县', - 370125: '济阳县', - 370126: '商河县', - 370190: '高新区', - 370202: '市南区', - 370203: '市北区', - 370211: '黄岛区', - 370212: '崂山区', - 370213: '李沧区', - 370214: '城阳区', - 370215: '即墨区', - 370281: '胶州市', - 370283: '平度市', - 370285: '莱西市', - 370290: '开发区', - 370302: '淄川区', - 370303: '张店区', - 370304: '博山区', - 370305: '临淄区', - 370306: '周村区', - 370321: '桓台县', - 370322: '高青县', - 370323: '沂源县', - 370402: '市中区', - 370403: '薛城区', - 370404: '峄城区', - 370405: '台儿庄区', - 370406: '山亭区', - 370481: '滕州市', - 370502: '东营区', - 370503: '河口区', - 370505: '垦利区', - 370522: '利津县', - 370523: '广饶县', - 370602: '芝罘区', - 370611: '福山区', - 370612: '牟平区', - 370613: '莱山区', - 370634: '长岛县', - 370681: '龙口市', - 370682: '莱阳市', - 370683: '莱州市', - 370684: '蓬莱市', - 370685: '招远市', - 370686: '栖霞市', - 370687: '海阳市', - 370690: '开发区', - 370702: '潍城区', - 370703: '寒亭区', - 370704: '坊子区', - 370705: '奎文区', - 370724: '临朐县', - 370725: '昌乐县', - 370781: '青州市', - 370782: '诸城市', - 370783: '寿光市', - 370784: '安丘市', - 370785: '高密市', - 370786: '昌邑市', - 370790: '开发区', - 370791: '高新区', - 370811: '任城区', - 370812: '兖州区', - 370826: '微山县', - 370827: '鱼台县', - 370828: '金乡县', - 370829: '嘉祥县', - 370830: '汶上县', - 370831: '泗水县', - 370832: '梁山县', - 370881: '曲阜市', - 370883: '邹城市', - 370890: '高新区', - 370902: '泰山区', - 370911: '岱岳区', - 370921: '宁阳县', - 370923: '东平县', - 370982: '新泰市', - 370983: '肥城市', - 371002: '环翠区', - 371003: '文登区', - 371082: '荣成市', - 371083: '乳山市', - 371091: '经济技术开发区', - 371102: '东港区', - 371103: '岚山区', - 371121: '五莲县', - 371122: '莒县', - 371202: '莱城区', - 371203: '钢城区', - 371302: '兰山区', - 371311: '罗庄区', - 371312: '河东区', - 371321: '沂南县', - 371322: '郯城县', - 371323: '沂水县', - 371324: '兰陵县', - 371325: '费县', - 371326: '平邑县', - 371327: '莒南县', - 371328: '蒙阴县', - 371329: '临沭县', - 371402: '德城区', - 371403: '陵城区', - 371422: '宁津县', - 371423: '庆云县', - 371424: '临邑县', - 371425: '齐河县', - 371426: '平原县', - 371427: '夏津县', - 371428: '武城县', - 371481: '乐陵市', - 371482: '禹城市', - 371502: '东昌府区', - 371521: '阳谷县', - 371522: '莘县', - 371523: '茌平县', - 371524: '东阿县', - 371525: '冠县', - 371526: '高唐县', - 371581: '临清市', - 371602: '滨城区', - 371603: '沾化区', - 371621: '惠民县', - 371622: '阳信县', - 371623: '无棣县', - 371625: '博兴县', - 371626: '邹平县', - 371702: '牡丹区', - 371703: '定陶区', - 371721: '曹县', - 371722: '单县', - 371723: '成武县', - 371724: '巨野县', - 371725: '郓城县', - 371726: '鄄城县', - 371728: '东明县', - 410102: '中原区', - 410103: '二七区', - 410104: '管城回族区', - 410105: '金水区', - 410106: '上街区', - 410108: '惠济区', - 410122: '中牟县', - 410181: '巩义市', - 410182: '荥阳市', - 410183: '新密市', - 410184: '新郑市', - 410185: '登封市', - 410190: '高新技术开发区', - 410191: '经济技术开发区', - 410202: '龙亭区', - 410203: '顺河回族区', - 410204: '鼓楼区', - 410205: '禹王台区', - 410212: '祥符区', - 410221: '杞县', - 410222: '通许县', - 410223: '尉氏县', - 410225: '兰考县', - 410302: '老城区', - 410303: '西工区', - 410304: '瀍河回族区', - 410305: '涧西区', - 410306: '吉利区', - 410311: '洛龙区', - 410322: '孟津县', - 410323: '新安县', - 410324: '栾川县', - 410325: '嵩县', - 410326: '汝阳县', - 410327: '宜阳县', - 410328: '洛宁县', - 410329: '伊川县', - 410381: '偃师市', - 410402: '新华区', - 410403: '卫东区', - 410404: '石龙区', - 410411: '湛河区', - 410421: '宝丰县', - 410422: '叶县', - 410423: '鲁山县', - 410425: '郏县', - 410481: '舞钢市', - 410482: '汝州市', - 410502: '文峰区', - 410503: '北关区', - 410505: '殷都区', - 410506: '龙安区', - 410522: '安阳县', - 410523: '汤阴县', - 410526: '滑县', - 410527: '内黄县', - 410581: '林州市', - 410590: '开发区', - 410602: '鹤山区', - 410603: '山城区', - 410611: '淇滨区', - 410621: '浚县', - 410622: '淇县', - 410702: '红旗区', - 410703: '卫滨区', - 410704: '凤泉区', - 410711: '牧野区', - 410721: '新乡县', - 410724: '获嘉县', - 410725: '原阳县', - 410726: '延津县', - 410727: '封丘县', - 410728: '长垣县', - 410781: '卫辉市', - 410782: '辉县市', - 410802: '解放区', - 410803: '中站区', - 410804: '马村区', - 410811: '山阳区', - 410821: '修武县', - 410822: '博爱县', - 410823: '武陟县', - 410825: '温县', - 410882: '沁阳市', - 410883: '孟州市', - 410902: '华龙区', - 410922: '清丰县', - 410923: '南乐县', - 410926: '范县', - 410927: '台前县', - 410928: '濮阳县', - 411002: '魏都区', - 411003: '建安区', - 411024: '鄢陵县', - 411025: '襄城县', - 411081: '禹州市', - 411082: '长葛市', - 411102: '源汇区', - 411103: '郾城区', - 411104: '召陵区', - 411121: '舞阳县', - 411122: '临颍县', - 411202: '湖滨区', - 411203: '陕州区', - 411221: '渑池县', - 411224: '卢氏县', - 411281: '义马市', - 411282: '灵宝市', - 411302: '宛城区', - 411303: '卧龙区', - 411321: '南召县', - 411322: '方城县', - 411323: '西峡县', - 411324: '镇平县', - 411325: '内乡县', - 411326: '淅川县', - 411327: '社旗县', - 411328: '唐河县', - 411329: '新野县', - 411330: '桐柏县', - 411381: '邓州市', - 411402: '梁园区', - 411403: '睢阳区', - 411421: '民权县', - 411422: '睢县', - 411423: '宁陵县', - 411424: '柘城县', - 411425: '虞城县', - 411426: '夏邑县', - 411481: '永城市', - 411502: '浉河区', - 411503: '平桥区', - 411521: '罗山县', - 411522: '光山县', - 411523: '新县', - 411524: '商城县', - 411525: '固始县', - 411526: '潢川县', - 411527: '淮滨县', - 411528: '息县', - 411602: '川汇区', - 411621: '扶沟县', - 411622: '西华县', - 411623: '商水县', - 411624: '沈丘县', - 411625: '郸城县', - 411626: '淮阳县', - 411627: '太康县', - 411628: '鹿邑县', - 411681: '项城市', - 411690: '经济开发区', - 411702: '驿城区', - 411721: '西平县', - 411722: '上蔡县', - 411723: '平舆县', - 411724: '正阳县', - 411725: '确山县', - 411726: '泌阳县', - 411727: '汝南县', - 411728: '遂平县', - 411729: '新蔡县', - 419001: '济源市', - 420102: '江岸区', - 420103: '江汉区', - 420104: '硚口区', - 420105: '汉阳区', - 420106: '武昌区', - 420107: '青山区', - 420111: '洪山区', - 420112: '东西湖区', - 420113: '汉南区', - 420114: '蔡甸区', - 420115: '江夏区', - 420116: '黄陂区', - 420117: '新洲区', - 420202: '黄石港区', - 420203: '西塞山区', - 420204: '下陆区', - 420205: '铁山区', - 420222: '阳新县', - 420281: '大冶市', - 420302: '茅箭区', - 420303: '张湾区', - 420304: '郧阳区', - 420322: '郧西县', - 420323: '竹山县', - 420324: '竹溪县', - 420325: '房县', - 420381: '丹江口市', - 420502: '西陵区', - 420503: '伍家岗区', - 420504: '点军区', - 420505: '猇亭区', - 420506: '夷陵区', - 420525: '远安县', - 420526: '兴山县', - 420527: '秭归县', - 420528: '长阳土家族自治县', - 420529: '五峰土家族自治县', - 420581: '宜都市', - 420582: '当阳市', - 420583: '枝江市', - 420590: '经济开发区', - 420602: '襄城区', - 420606: '樊城区', - 420607: '襄州区', - 420624: '南漳县', - 420625: '谷城县', - 420626: '保康县', - 420682: '老河口市', - 420683: '枣阳市', - 420684: '宜城市', - 420702: '梁子湖区', - 420703: '华容区', - 420704: '鄂城区', - 420802: '东宝区', - 420804: '掇刀区', - 420821: '京山县', - 420822: '沙洋县', - 420881: '钟祥市', - 420902: '孝南区', - 420921: '孝昌县', - 420922: '大悟县', - 420923: '云梦县', - 420981: '应城市', - 420982: '安陆市', - 420984: '汉川市', - 421002: '沙市区', - 421003: '荆州区', - 421022: '公安县', - 421023: '监利县', - 421024: '江陵县', - 421081: '石首市', - 421083: '洪湖市', - 421087: '松滋市', - 421102: '黄州区', - 421121: '团风县', - 421122: '红安县', - 421123: '罗田县', - 421124: '英山县', - 421125: '浠水县', - 421126: '蕲春县', - 421127: '黄梅县', - 421181: '麻城市', - 421182: '武穴市', - 421202: '咸安区', - 421221: '嘉鱼县', - 421222: '通城县', - 421223: '崇阳县', - 421224: '通山县', - 421281: '赤壁市', - 421303: '曾都区', - 421321: '随县', - 421381: '广水市', - 422801: '恩施市', - 422802: '利川市', - 422822: '建始县', - 422823: '巴东县', - 422825: '宣恩县', - 422826: '咸丰县', - 422827: '来凤县', - 422828: '鹤峰县', - 429004: '仙桃市', - 429005: '潜江市', - 429006: '天门市', - 429021: '神农架林区', - 430102: '芙蓉区', - 430103: '天心区', - 430104: '岳麓区', - 430105: '开福区', - 430111: '雨花区', - 430112: '望城区', - 430121: '长沙县', - 430181: '浏阳市', - 430182: '宁乡市', - 430202: '荷塘区', - 430203: '芦淞区', - 430204: '石峰区', - 430211: '天元区', - 430221: '株洲县', - 430223: '攸县', - 430224: '茶陵县', - 430225: '炎陵县', - 430281: '醴陵市', - 430302: '雨湖区', - 430304: '岳塘区', - 430321: '湘潭县', - 430381: '湘乡市', - 430382: '韶山市', - 430405: '珠晖区', - 430406: '雁峰区', - 430407: '石鼓区', - 430408: '蒸湘区', - 430412: '南岳区', - 430421: '衡阳县', - 430422: '衡南县', - 430423: '衡山县', - 430424: '衡东县', - 430426: '祁东县', - 430481: '耒阳市', - 430482: '常宁市', - 430502: '双清区', - 430503: '大祥区', - 430511: '北塔区', - 430521: '邵东县', - 430522: '新邵县', - 430523: '邵阳县', - 430524: '隆回县', - 430525: '洞口县', - 430527: '绥宁县', - 430528: '新宁县', - 430529: '城步苗族自治县', - 430581: '武冈市', - 430602: '岳阳楼区', - 430603: '云溪区', - 430611: '君山区', - 430621: '岳阳县', - 430623: '华容县', - 430624: '湘阴县', - 430626: '平江县', - 430681: '汨罗市', - 430682: '临湘市', - 430702: '武陵区', - 430703: '鼎城区', - 430721: '安乡县', - 430722: '汉寿县', - 430723: '澧县', - 430724: '临澧县', - 430725: '桃源县', - 430726: '石门县', - 430781: '津市市', - 430802: '永定区', - 430811: '武陵源区', - 430821: '慈利县', - 430822: '桑植县', - 430902: '资阳区', - 430903: '赫山区', - 430921: '南县', - 430922: '桃江县', - 430923: '安化县', - 430981: '沅江市', - 431002: '北湖区', - 431003: '苏仙区', - 431021: '桂阳县', - 431022: '宜章县', - 431023: '永兴县', - 431024: '嘉禾县', - 431025: '临武县', - 431026: '汝城县', - 431027: '桂东县', - 431028: '安仁县', - 431081: '资兴市', - 431102: '零陵区', - 431103: '冷水滩区', - 431121: '祁阳县', - 431122: '东安县', - 431123: '双牌县', - 431124: '道县', - 431125: '江永县', - 431126: '宁远县', - 431127: '蓝山县', - 431128: '新田县', - 431129: '江华瑶族自治县', - 431202: '鹤城区', - 431221: '中方县', - 431222: '沅陵县', - 431223: '辰溪县', - 431224: '溆浦县', - 431225: '会同县', - 431226: '麻阳苗族自治县', - 431227: '新晃侗族自治县', - 431228: '芷江侗族自治县', - 431229: '靖州苗族侗族自治县', - 431230: '通道侗族自治县', - 431281: '洪江市', - 431302: '娄星区', - 431321: '双峰县', - 431322: '新化县', - 431381: '冷水江市', - 431382: '涟源市', - 433101: '吉首市', - 433122: '泸溪县', - 433123: '凤凰县', - 433124: '花垣县', - 433125: '保靖县', - 433126: '古丈县', - 433127: '永顺县', - 433130: '龙山县', - 440103: '荔湾区', - 440104: '越秀区', - 440105: '海珠区', - 440106: '天河区', - 440111: '白云区', - 440112: '黄埔区', - 440113: '番禺区', - 440114: '花都区', - 440115: '南沙区', - 440117: '从化区', - 440118: '增城区', - 440203: '武江区', - 440204: '浈江区', - 440205: '曲江区', - 440222: '始兴县', - 440224: '仁化县', - 440229: '翁源县', - 440232: '乳源瑶族自治县', - 440233: '新丰县', - 440281: '乐昌市', - 440282: '南雄市', - 440303: '罗湖区', - 440304: '福田区', - 440305: '南山区', - 440306: '宝安区', - 440307: '龙岗区', - 440308: '盐田区', - 440309: '龙华区', - 440310: '坪山区', - 440402: '香洲区', - 440403: '斗门区', - 440404: '金湾区', - 440507: '龙湖区', - 440511: '金平区', - 440512: '濠江区', - 440513: '潮阳区', - 440514: '潮南区', - 440515: '澄海区', - 440523: '南澳县', - 440604: '禅城区', - 440605: '南海区', - 440606: '顺德区', - 440607: '三水区', - 440608: '高明区', - 440703: '蓬江区', - 440704: '江海区', - 440705: '新会区', - 440781: '台山市', - 440783: '开平市', - 440784: '鹤山市', - 440785: '恩平市', - 440802: '赤坎区', - 440803: '霞山区', - 440804: '坡头区', - 440811: '麻章区', - 440823: '遂溪县', - 440825: '徐闻县', - 440881: '廉江市', - 440882: '雷州市', - 440883: '吴川市', - 440890: '经济技术开发区', - 440902: '茂南区', - 440904: '电白区', - 440981: '高州市', - 440982: '化州市', - 440983: '信宜市', - 441202: '端州区', - 441203: '鼎湖区', - 441204: '高要区', - 441223: '广宁县', - 441224: '怀集县', - 441225: '封开县', - 441226: '德庆县', - 441284: '四会市', - 441302: '惠城区', - 441303: '惠阳区', - 441322: '博罗县', - 441323: '惠东县', - 441324: '龙门县', - 441402: '梅江区', - 441403: '梅县区', - 441422: '大埔县', - 441423: '丰顺县', - 441424: '五华县', - 441426: '平远县', - 441427: '蕉岭县', - 441481: '兴宁市', - 441502: '城区', - 441521: '海丰县', - 441523: '陆河县', - 441581: '陆丰市', - 441602: '源城区', - 441621: '紫金县', - 441622: '龙川县', - 441623: '连平县', - 441624: '和平县', - 441625: '东源县', - 441702: '江城区', - 441704: '阳东区', - 441721: '阳西县', - 441781: '阳春市', - 441802: '清城区', - 441803: '清新区', - 441821: '佛冈县', - 441823: '阳山县', - 441825: '连山壮族瑶族自治县', - 441826: '连南瑶族自治县', - 441881: '英德市', - 441882: '连州市', - 441901: '中堂镇', - 441903: '南城区', - 441904: '长安镇', - 441905: '东坑镇', - 441906: '樟木头镇', - 441907: '莞城区', - 441908: '石龙镇', - 441909: '桥头镇', - 441910: '万江区', - 441911: '麻涌镇', - 441912: '虎门镇', - 441913: '谢岗镇', - 441914: '石碣镇', - 441915: '茶山镇', - 441916: '东城区', - 441917: '洪梅镇', - 441918: '道滘镇', - 441919: '高埗镇', - 441920: '企石镇', - 441921: '凤岗镇', - 441922: '大岭山镇', - 441923: '松山湖', - 441924: '清溪镇', - 441925: '望牛墩镇', - 441926: '厚街镇', - 441927: '常平镇', - 441928: '寮步镇', - 441929: '石排镇', - 441930: '横沥镇', - 441931: '塘厦镇', - 441932: '黄江镇', - 441933: '大朗镇', - 441990: '沙田镇', - 442001: '南头镇', - 442002: '神湾镇', - 442003: '东凤镇', - 442004: '五桂山镇', - 442005: '黄圃镇', - 442006: '小榄镇', - 442007: '石岐区街道', - 442008: '横栏镇', - 442009: '三角镇', - 442010: '三乡镇', - 442011: '港口镇', - 442012: '沙溪镇', - 442013: '板芙镇', - 442014: '沙朗镇', - 442015: '东升镇', - 442016: '阜沙镇', - 442017: '民众镇', - 442018: '东区街道', - 442019: '火炬开发区', - 442020: '西区街道', - 442021: '南区街道', - 442022: '古镇', - 442023: '坦洲镇', - 442024: '大涌镇', - 442025: '南朗镇', - 445102: '湘桥区', - 445103: '潮安区', - 445122: '饶平县', - 445202: '榕城区', - 445203: '揭东区', - 445222: '揭西县', - 445224: '惠来县', - 445281: '普宁市', - 445302: '云城区', - 445303: '云安区', - 445321: '新兴县', - 445322: '郁南县', - 445381: '罗定市', - 450102: '兴宁区', - 450103: '青秀区', - 450105: '江南区', - 450107: '西乡塘区', - 450108: '良庆区', - 450109: '邕宁区', - 450110: '武鸣区', - 450123: '隆安县', - 450124: '马山县', - 450125: '上林县', - 450126: '宾阳县', - 450127: '横县', - 450202: '城中区', - 450203: '鱼峰区', - 450204: '柳南区', - 450205: '柳北区', - 450206: '柳江区', - 450222: '柳城县', - 450223: '鹿寨县', - 450224: '融安县', - 450225: '融水苗族自治县', - 450226: '三江侗族自治县', - 450302: '秀峰区', - 450303: '叠彩区', - 450304: '象山区', - 450305: '七星区', - 450311: '雁山区', - 450312: '临桂区', - 450321: '阳朔县', - 450323: '灵川县', - 450324: '全州县', - 450325: '兴安县', - 450326: '永福县', - 450327: '灌阳县', - 450328: '龙胜各族自治县', - 450329: '资源县', - 450330: '平乐县', - 450331: '荔浦县', - 450332: '恭城瑶族自治县', - 450403: '万秀区', - 450405: '长洲区', - 450406: '龙圩区', - 450421: '苍梧县', - 450422: '藤县', - 450423: '蒙山县', - 450481: '岑溪市', - 450502: '海城区', - 450503: '银海区', - 450512: '铁山港区', - 450521: '合浦县', - 450602: '港口区', - 450603: '防城区', - 450621: '上思县', - 450681: '东兴市', - 450702: '钦南区', - 450703: '钦北区', - 450721: '灵山县', - 450722: '浦北县', - 450802: '港北区', - 450803: '港南区', - 450804: '覃塘区', - 450821: '平南县', - 450881: '桂平市', - 450902: '玉州区', - 450903: '福绵区', - 450921: '容县', - 450922: '陆川县', - 450923: '博白县', - 450924: '兴业县', - 450981: '北流市', - 451002: '右江区', - 451021: '田阳县', - 451022: '田东县', - 451023: '平果县', - 451024: '德保县', - 451026: '那坡县', - 451027: '凌云县', - 451028: '乐业县', - 451029: '田林县', - 451030: '西林县', - 451031: '隆林各族自治县', - 451081: '靖西市', - 451102: '八步区', - 451103: '平桂区', - 451121: '昭平县', - 451122: '钟山县', - 451123: '富川瑶族自治县', - 451202: '金城江区', - 451203: '宜州区', - 451221: '南丹县', - 451222: '天峨县', - 451223: '凤山县', - 451224: '东兰县', - 451225: '罗城仫佬族自治县', - 451226: '环江毛南族自治县', - 451227: '巴马瑶族自治县', - 451228: '都安瑶族自治县', - 451229: '大化瑶族自治县', - 451302: '兴宾区', - 451321: '忻城县', - 451322: '象州县', - 451323: '武宣县', - 451324: '金秀瑶族自治县', - 451381: '合山市', - 451402: '江州区', - 451421: '扶绥县', - 451422: '宁明县', - 451423: '龙州县', - 451424: '大新县', - 451425: '天等县', - 451481: '凭祥市', - 460105: '秀英区', - 460106: '龙华区', - 460107: '琼山区', - 460108: '美兰区', - 460202: '海棠区', - 460203: '吉阳区', - 460204: '天涯区', - 460205: '崖州区', - 460321: '西沙群岛', - 460322: '南沙群岛', - 460323: '中沙群岛的岛礁及其海域', - 460401: '那大镇', - 460402: '和庆镇', - 460403: '南丰镇', - 460404: '大成镇', - 460405: '雅星镇', - 460406: '兰洋镇', - 460407: '光村镇', - 460408: '木棠镇', - 460409: '海头镇', - 460410: '峨蔓镇', - 460411: '王五镇', - 460412: '白马井镇', - 460413: '中和镇', - 460414: '排浦镇', - 460415: '东成镇', - 460416: '新州镇', - 469001: '五指山市', - 469002: '琼海市', - 469005: '文昌市', - 469006: '万宁市', - 469007: '东方市', - 469021: '定安县', - 469022: '屯昌县', - 469023: '澄迈县', - 469024: '临高县', - 469025: '白沙黎族自治县', - 469026: '昌江黎族自治县', - 469027: '乐东黎族自治县', - 469028: '陵水黎族自治县', - 469029: '保亭黎族苗族自治县', - 469030: '琼中黎族苗族自治县', - 500101: '万州区', - 500102: '涪陵区', - 500103: '渝中区', - 500104: '大渡口区', - 500105: '江北区', - 500106: '沙坪坝区', - 500107: '九龙坡区', - 500108: '南岸区', - 500109: '北碚区', - 500110: '綦江区', - 500111: '大足区', - 500112: '渝北区', - 500113: '巴南区', - 500114: '黔江区', - 500115: '长寿区', - 500116: '江津区', - 500117: '合川区', - 500118: '永川区', - 500119: '南川区', - 500120: '璧山区', - 500151: '铜梁区', - 500152: '潼南区', - 500153: '荣昌区', - 500154: '开州区', - 500155: '梁平区', - 500156: '武隆区', - 500229: '城口县', - 500230: '丰都县', - 500231: '垫江县', - 500233: '忠县', - 500235: '云阳县', - 500236: '奉节县', - 500237: '巫山县', - 500238: '巫溪县', - 500240: '石柱土家族自治县', - 500241: '秀山土家族苗族自治县', - 500242: '酉阳土家族苗族自治县', - 500243: '彭水苗族土家族自治县', - 510104: '锦江区', - 510105: '青羊区', - 510106: '金牛区', - 510107: '武侯区', - 510108: '成华区', - 510112: '龙泉驿区', - 510113: '青白江区', - 510114: '新都区', - 510115: '温江区', - 510116: '双流区', - 510117: '郫都区', - 510121: '金堂县', - 510129: '大邑县', - 510131: '蒲江县', - 510132: '新津县', - 510181: '都江堰市', - 510182: '彭州市', - 510183: '邛崃市', - 510184: '崇州市', - 510185: '简阳市', - 510191: '高新区', - 510302: '自流井区', - 510303: '贡井区', - 510304: '大安区', - 510311: '沿滩区', - 510321: '荣县', - 510322: '富顺县', - 510402: '东区', - 510403: '西区', - 510411: '仁和区', - 510421: '米易县', - 510422: '盐边县', - 510502: '江阳区', - 510503: '纳溪区', - 510504: '龙马潭区', - 510521: '泸县', - 510522: '合江县', - 510524: '叙永县', - 510525: '古蔺县', - 510603: '旌阳区', - 510604: '罗江区', - 510623: '中江县', - 510681: '广汉市', - 510682: '什邡市', - 510683: '绵竹市', - 510703: '涪城区', - 510704: '游仙区', - 510705: '安州区', - 510722: '三台县', - 510723: '盐亭县', - 510725: '梓潼县', - 510726: '北川羌族自治县', - 510727: '平武县', - 510781: '江油市', - 510791: '高新区', - 510802: '利州区', - 510811: '昭化区', - 510812: '朝天区', - 510821: '旺苍县', - 510822: '青川县', - 510823: '剑阁县', - 510824: '苍溪县', - 510903: '船山区', - 510904: '安居区', - 510921: '蓬溪县', - 510922: '射洪县', - 510923: '大英县', - 511002: '市中区', - 511011: '东兴区', - 511024: '威远县', - 511025: '资中县', - 511083: '隆昌市', - 511102: '市中区', - 511111: '沙湾区', - 511112: '五通桥区', - 511113: '金口河区', - 511123: '犍为县', - 511124: '井研县', - 511126: '夹江县', - 511129: '沐川县', - 511132: '峨边彝族自治县', - 511133: '马边彝族自治县', - 511181: '峨眉山市', - 511302: '顺庆区', - 511303: '高坪区', - 511304: '嘉陵区', - 511321: '南部县', - 511322: '营山县', - 511323: '蓬安县', - 511324: '仪陇县', - 511325: '西充县', - 511381: '阆中市', - 511402: '东坡区', - 511403: '彭山区', - 511421: '仁寿县', - 511423: '洪雅县', - 511424: '丹棱县', - 511425: '青神县', - 511502: '翠屏区', - 511503: '南溪区', - 511521: '宜宾县', - 511523: '江安县', - 511524: '长宁县', - 511525: '高县', - 511526: '珙县', - 511527: '筠连县', - 511528: '兴文县', - 511529: '屏山县', - 511602: '广安区', - 511603: '前锋区', - 511621: '岳池县', - 511622: '武胜县', - 511623: '邻水县', - 511681: '华蓥市', - 511702: '通川区', - 511703: '达川区', - 511722: '宣汉县', - 511723: '开江县', - 511724: '大竹县', - 511725: '渠县', - 511781: '万源市', - 511802: '雨城区', - 511803: '名山区', - 511822: '荥经县', - 511823: '汉源县', - 511824: '石棉县', - 511825: '天全县', - 511826: '芦山县', - 511827: '宝兴县', - 511902: '巴州区', - 511903: '恩阳区', - 511921: '通江县', - 511922: '南江县', - 511923: '平昌县', - 512002: '雁江区', - 512021: '安岳县', - 512022: '乐至县', - 513201: '马尔康市', - 513221: '汶川县', - 513222: '理县', - 513223: '茂县', - 513224: '松潘县', - 513225: '九寨沟县', - 513226: '金川县', - 513227: '小金县', - 513228: '黑水县', - 513230: '壤塘县', - 513231: '阿坝县', - 513232: '若尔盖县', - 513233: '红原县', - 513301: '康定市', - 513322: '泸定县', - 513323: '丹巴县', - 513324: '九龙县', - 513325: '雅江县', - 513326: '道孚县', - 513327: '炉霍县', - 513328: '甘孜县', - 513329: '新龙县', - 513330: '德格县', - 513331: '白玉县', - 513332: '石渠县', - 513333: '色达县', - 513334: '理塘县', - 513335: '巴塘县', - 513336: '乡城县', - 513337: '稻城县', - 513338: '得荣县', - 513401: '西昌市', - 513422: '木里藏族自治县', - 513423: '盐源县', - 513424: '德昌县', - 513425: '会理县', - 513426: '会东县', - 513427: '宁南县', - 513428: '普格县', - 513429: '布拖县', - 513430: '金阳县', - 513431: '昭觉县', - 513432: '喜德县', - 513433: '冕宁县', - 513434: '越西县', - 513435: '甘洛县', - 513436: '美姑县', - 513437: '雷波县', - 520102: '南明区', - 520103: '云岩区', - 520111: '花溪区', - 520112: '乌当区', - 520113: '白云区', - 520115: '观山湖区', - 520121: '开阳县', - 520122: '息烽县', - 520123: '修文县', - 520181: '清镇市', - 520201: '钟山区', - 520203: '六枝特区', - 520221: '水城县', - 520281: '盘州市', - 520302: '红花岗区', - 520303: '汇川区', - 520304: '播州区', - 520322: '桐梓县', - 520323: '绥阳县', - 520324: '正安县', - 520325: '道真仡佬族苗族自治县', - 520326: '务川仡佬族苗族自治县', - 520327: '凤冈县', - 520328: '湄潭县', - 520329: '余庆县', - 520330: '习水县', - 520381: '赤水市', - 520382: '仁怀市', - 520402: '西秀区', - 520403: '平坝区', - 520422: '普定县', - 520423: '镇宁布依族苗族自治县', - 520424: '关岭布依族苗族自治县', - 520425: '紫云苗族布依族自治县', - 520502: '七星关区', - 520521: '大方县', - 520522: '黔西县', - 520523: '金沙县', - 520524: '织金县', - 520525: '纳雍县', - 520526: '威宁彝族回族苗族自治县', - 520527: '赫章县', - 520602: '碧江区', - 520603: '万山区', - 520621: '江口县', - 520622: '玉屏侗族自治县', - 520623: '石阡县', - 520624: '思南县', - 520625: '印江土家族苗族自治县', - 520626: '德江县', - 520627: '沿河土家族自治县', - 520628: '松桃苗族自治县', - 522301: '兴义市', - 522322: '兴仁县', - 522323: '普安县', - 522324: '晴隆县', - 522325: '贞丰县', - 522326: '望谟县', - 522327: '册亨县', - 522328: '安龙县', - 522601: '凯里市', - 522622: '黄平县', - 522623: '施秉县', - 522624: '三穗县', - 522625: '镇远县', - 522626: '岑巩县', - 522627: '天柱县', - 522628: '锦屏县', - 522629: '剑河县', - 522630: '台江县', - 522631: '黎平县', - 522632: '榕江县', - 522633: '从江县', - 522634: '雷山县', - 522635: '麻江县', - 522636: '丹寨县', - 522701: '都匀市', - 522702: '福泉市', - 522722: '荔波县', - 522723: '贵定县', - 522725: '瓮安县', - 522726: '独山县', - 522727: '平塘县', - 522728: '罗甸县', - 522729: '长顺县', - 522730: '龙里县', - 522731: '惠水县', - 522732: '三都水族自治县', - 530102: '五华区', - 530103: '盘龙区', - 530111: '官渡区', - 530112: '西山区', - 530113: '东川区', - 530114: '呈贡区', - 530115: '晋宁区', - 530124: '富民县', - 530125: '宜良县', - 530126: '石林彝族自治县', - 530127: '嵩明县', - 530128: '禄劝彝族苗族自治县', - 530129: '寻甸回族彝族自治县', - 530181: '安宁市', - 530302: '麒麟区', - 530303: '沾益区', - 530321: '马龙县', - 530322: '陆良县', - 530323: '师宗县', - 530324: '罗平县', - 530325: '富源县', - 530326: '会泽县', - 530381: '宣威市', - 530402: '红塔区', - 530403: '江川区', - 530422: '澄江县', - 530423: '通海县', - 530424: '华宁县', - 530425: '易门县', - 530426: '峨山彝族自治县', - 530427: '新平彝族傣族自治县', - 530428: '元江哈尼族彝族傣族自治县', - 530502: '隆阳区', - 530521: '施甸县', - 530523: '龙陵县', - 530524: '昌宁县', - 530581: '腾冲市', - 530602: '昭阳区', - 530621: '鲁甸县', - 530622: '巧家县', - 530623: '盐津县', - 530624: '大关县', - 530625: '永善县', - 530626: '绥江县', - 530627: '镇雄县', - 530628: '彝良县', - 530629: '威信县', - 530630: '水富县', - 530702: '古城区', - 530721: '玉龙纳西族自治县', - 530722: '永胜县', - 530723: '华坪县', - 530724: '宁蒗彝族自治县', - 530802: '思茅区', - 530821: '宁洱哈尼族彝族自治县', - 530822: '墨江哈尼族自治县', - 530823: '景东彝族自治县', - 530824: '景谷傣族彝族自治县', - 530825: '镇沅彝族哈尼族拉祜族自治县', - 530826: '江城哈尼族彝族自治县', - 530827: '孟连傣族拉祜族佤族自治县', - 530828: '澜沧拉祜族自治县', - 530829: '西盟佤族自治县', - 530902: '临翔区', - 530921: '凤庆县', - 530922: '云县', - 530923: '永德县', - 530924: '镇康县', - 530925: '双江拉祜族佤族布朗族傣族自治县', - 530926: '耿马傣族佤族自治县', - 530927: '沧源佤族自治县', - 532301: '楚雄市', - 532322: '双柏县', - 532323: '牟定县', - 532324: '南华县', - 532325: '姚安县', - 532326: '大姚县', - 532327: '永仁县', - 532328: '元谋县', - 532329: '武定县', - 532331: '禄丰县', - 532501: '个旧市', - 532502: '开远市', - 532503: '蒙自市', - 532504: '弥勒市', - 532523: '屏边苗族自治县', - 532524: '建水县', - 532525: '石屏县', - 532527: '泸西县', - 532528: '元阳县', - 532529: '红河县', - 532530: '金平苗族瑶族傣族自治县', - 532531: '绿春县', - 532532: '河口瑶族自治县', - 532601: '文山市', - 532622: '砚山县', - 532623: '西畴县', - 532624: '麻栗坡县', - 532625: '马关县', - 532626: '丘北县', - 532627: '广南县', - 532628: '富宁县', - 532801: '景洪市', - 532822: '勐海县', - 532823: '勐腊县', - 532901: '大理市', - 532922: '漾濞彝族自治县', - 532923: '祥云县', - 532924: '宾川县', - 532925: '弥渡县', - 532926: '南涧彝族自治县', - 532927: '巍山彝族回族自治县', - 532928: '永平县', - 532929: '云龙县', - 532930: '洱源县', - 532931: '剑川县', - 532932: '鹤庆县', - 533102: '瑞丽市', - 533103: '芒市', - 533122: '梁河县', - 533123: '盈江县', - 533124: '陇川县', - 533301: '泸水市', - 533323: '福贡县', - 533324: '贡山独龙族怒族自治县', - 533325: '兰坪白族普米族自治县', - 533401: '香格里拉市', - 533422: '德钦县', - 533423: '维西傈僳族自治县', - 540102: '城关区', - 540103: '堆龙德庆区', - 540104: '达孜区', - 540121: '林周县', - 540122: '当雄县', - 540123: '尼木县', - 540124: '曲水县', - 540127: '墨竹工卡县', - 540202: '桑珠孜区', - 540221: '南木林县', - 540222: '江孜县', - 540223: '定日县', - 540224: '萨迦县', - 540225: '拉孜县', - 540226: '昂仁县', - 540227: '谢通门县', - 540228: '白朗县', - 540229: '仁布县', - 540230: '康马县', - 540231: '定结县', - 540232: '仲巴县', - 540233: '亚东县', - 540234: '吉隆县', - 540235: '聂拉木县', - 540236: '萨嘎县', - 540237: '岗巴县', - 540302: '卡若区', - 540321: '江达县', - 540322: '贡觉县', - 540323: '类乌齐县', - 540324: '丁青县', - 540325: '察雅县', - 540326: '八宿县', - 540327: '左贡县', - 540328: '芒康县', - 540329: '洛隆县', - 540330: '边坝县', - 540402: '巴宜区', - 540421: '工布江达县', - 540422: '米林县', - 540423: '墨脱县', - 540424: '波密县', - 540425: '察隅县', - 540426: '朗县', - 540502: '乃东区', - 540521: '扎囊县', - 540522: '贡嘎县', - 540523: '桑日县', - 540524: '琼结县', - 540525: '曲松县', - 540526: '措美县', - 540527: '洛扎县', - 540528: '加查县', - 540529: '隆子县', - 540530: '错那县', - 540531: '浪卡子县', - 540602: '色尼区', - 542421: '那曲县', - 542422: '嘉黎县', - 542423: '比如县', - 542424: '聂荣县', - 542425: '安多县', - 542426: '申扎县', - 542427: '索县', - 542428: '班戈县', - 542429: '巴青县', - 542430: '尼玛县', - 542431: '双湖县', - 542521: '普兰县', - 542522: '札达县', - 542523: '噶尔县', - 542524: '日土县', - 542525: '革吉县', - 542526: '改则县', - 542527: '措勤县', - 610102: '新城区', - 610103: '碑林区', - 610104: '莲湖区', - 610111: '灞桥区', - 610112: '未央区', - 610113: '雁塔区', - 610114: '阎良区', - 610115: '临潼区', - 610116: '长安区', - 610117: '高陵区', - 610118: '鄠邑区', - 610122: '蓝田县', - 610124: '周至县', - 610202: '王益区', - 610203: '印台区', - 610204: '耀州区', - 610222: '宜君县', - 610302: '渭滨区', - 610303: '金台区', - 610304: '陈仓区', - 610322: '凤翔县', - 610323: '岐山县', - 610324: '扶风县', - 610326: '眉县', - 610327: '陇县', - 610328: '千阳县', - 610329: '麟游县', - 610330: '凤县', - 610331: '太白县', - 610402: '秦都区', - 610403: '杨陵区', - 610404: '渭城区', - 610422: '三原县', - 610423: '泾阳县', - 610424: '乾县', - 610425: '礼泉县', - 610426: '永寿县', - 610427: '彬县', - 610428: '长武县', - 610429: '旬邑县', - 610430: '淳化县', - 610431: '武功县', - 610481: '兴平市', - 610502: '临渭区', - 610503: '华州区', - 610522: '潼关县', - 610523: '大荔县', - 610524: '合阳县', - 610525: '澄城县', - 610526: '蒲城县', - 610527: '白水县', - 610528: '富平县', - 610581: '韩城市', - 610582: '华阴市', - 610602: '宝塔区', - 610603: '安塞区', - 610621: '延长县', - 610622: '延川县', - 610623: '子长县', - 610625: '志丹县', - 610626: '吴起县', - 610627: '甘泉县', - 610628: '富县', - 610629: '洛川县', - 610630: '宜川县', - 610631: '黄龙县', - 610632: '黄陵县', - 610702: '汉台区', - 610703: '南郑区', - 610722: '城固县', - 610723: '洋县', - 610724: '西乡县', - 610725: '勉县', - 610726: '宁强县', - 610727: '略阳县', - 610728: '镇巴县', - 610729: '留坝县', - 610730: '佛坪县', - 610802: '榆阳区', - 610803: '横山区', - 610822: '府谷县', - 610824: '靖边县', - 610825: '定边县', - 610826: '绥德县', - 610827: '米脂县', - 610828: '佳县', - 610829: '吴堡县', - 610830: '清涧县', - 610831: '子洲县', - 610881: '神木市', - 610902: '汉滨区', - 610921: '汉阴县', - 610922: '石泉县', - 610923: '宁陕县', - 610924: '紫阳县', - 610925: '岚皋县', - 610926: '平利县', - 610927: '镇坪县', - 610928: '旬阳县', - 610929: '白河县', - 611002: '商州区', - 611021: '洛南县', - 611022: '丹凤县', - 611023: '商南县', - 611024: '山阳县', - 611025: '镇安县', - 611026: '柞水县', - 620102: '城关区', - 620103: '七里河区', - 620104: '西固区', - 620105: '安宁区', - 620111: '红古区', - 620121: '永登县', - 620122: '皋兰县', - 620123: '榆中县', - 620201: '市辖区', - 620290: '雄关区', - 620291: '长城区', - 620292: '镜铁区', - 620293: '新城镇', - 620294: '峪泉镇', - 620295: '文殊镇', - 620302: '金川区', - 620321: '永昌县', - 620402: '白银区', - 620403: '平川区', - 620421: '靖远县', - 620422: '会宁县', - 620423: '景泰县', - 620502: '秦州区', - 620503: '麦积区', - 620521: '清水县', - 620522: '秦安县', - 620523: '甘谷县', - 620524: '武山县', - 620525: '张家川回族自治县', - 620602: '凉州区', - 620621: '民勤县', - 620622: '古浪县', - 620623: '天祝藏族自治县', - 620702: '甘州区', - 620721: '肃南裕固族自治县', - 620722: '民乐县', - 620723: '临泽县', - 620724: '高台县', - 620725: '山丹县', - 620802: '崆峒区', - 620821: '泾川县', - 620822: '灵台县', - 620823: '崇信县', - 620824: '华亭县', - 620825: '庄浪县', - 620826: '静宁县', - 620902: '肃州区', - 620921: '金塔县', - 620922: '瓜州县', - 620923: '肃北蒙古族自治县', - 620924: '阿克塞哈萨克族自治县', - 620981: '玉门市', - 620982: '敦煌市', - 621002: '西峰区', - 621021: '庆城县', - 621022: '环县', - 621023: '华池县', - 621024: '合水县', - 621025: '正宁县', - 621026: '宁县', - 621027: '镇原县', - 621102: '安定区', - 621121: '通渭县', - 621122: '陇西县', - 621123: '渭源县', - 621124: '临洮县', - 621125: '漳县', - 621126: '岷县', - 621202: '武都区', - 621221: '成县', - 621222: '文县', - 621223: '宕昌县', - 621224: '康县', - 621225: '西和县', - 621226: '礼县', - 621227: '徽县', - 621228: '两当县', - 622901: '临夏市', - 622921: '临夏县', - 622922: '康乐县', - 622923: '永靖县', - 622924: '广河县', - 622925: '和政县', - 622926: '东乡族自治县', - 622927: '积石山保安族东乡族撒拉族自治县', - 623001: '合作市', - 623021: '临潭县', - 623022: '卓尼县', - 623023: '舟曲县', - 623024: '迭部县', - 623025: '玛曲县', - 623026: '碌曲县', - 623027: '夏河县', - 630102: '城东区', - 630103: '城中区', - 630104: '城西区', - 630105: '城北区', - 630121: '大通回族土族自治县', - 630122: '湟中县', - 630123: '湟源县', - 630202: '乐都区', - 630203: '平安区', - 630222: '民和回族土族自治县', - 630223: '互助土族自治县', - 630224: '化隆回族自治县', - 630225: '循化撒拉族自治县', - 632221: '门源回族自治县', - 632222: '祁连县', - 632223: '海晏县', - 632224: '刚察县', - 632321: '同仁县', - 632322: '尖扎县', - 632323: '泽库县', - 632324: '河南蒙古族自治县', - 632521: '共和县', - 632522: '同德县', - 632523: '贵德县', - 632524: '兴海县', - 632525: '贵南县', - 632621: '玛沁县', - 632622: '班玛县', - 632623: '甘德县', - 632624: '达日县', - 632625: '久治县', - 632626: '玛多县', - 632701: '玉树市', - 632722: '杂多县', - 632723: '称多县', - 632724: '治多县', - 632725: '囊谦县', - 632726: '曲麻莱县', - 632801: '格尔木市', - 632802: '德令哈市', - 632821: '乌兰县', - 632822: '都兰县', - 632823: '天峻县', - 640104: '兴庆区', - 640105: '西夏区', - 640106: '金凤区', - 640121: '永宁县', - 640122: '贺兰县', - 640181: '灵武市', - 640202: '大武口区', - 640205: '惠农区', - 640221: '平罗县', - 640302: '利通区', - 640303: '红寺堡区', - 640323: '盐池县', - 640324: '同心县', - 640381: '青铜峡市', - 640402: '原州区', - 640422: '西吉县', - 640423: '隆德县', - 640424: '泾源县', - 640425: '彭阳县', - 640502: '沙坡头区', - 640521: '中宁县', - 640522: '海原县', - 650102: '天山区', - 650103: '沙依巴克区', - 650104: '新市区', - 650105: '水磨沟区', - 650106: '头屯河区', - 650107: '达坂城区', - 650109: '米东区', - 650121: '乌鲁木齐县', - 650202: '独山子区', - 650203: '克拉玛依区', - 650204: '白碱滩区', - 650205: '乌尔禾区', - 650402: '高昌区', - 650421: '鄯善县', - 650422: '托克逊县', - 650502: '伊州区', - 650521: '巴里坤哈萨克自治县', - 650522: '伊吾县', - 652301: '昌吉市', - 652302: '阜康市', - 652323: '呼图壁县', - 652324: '玛纳斯县', - 652325: '奇台县', - 652327: '吉木萨尔县', - 652328: '木垒哈萨克自治县', - 652701: '博乐市', - 652702: '阿拉山口市', - 652722: '精河县', - 652723: '温泉县', - 652801: '库尔勒市', - 652822: '轮台县', - 652823: '尉犁县', - 652824: '若羌县', - 652825: '且末县', - 652826: '焉耆回族自治县', - 652827: '和静县', - 652828: '和硕县', - 652829: '博湖县', - 652901: '阿克苏市', - 652922: '温宿县', - 652923: '库车县', - 652924: '沙雅县', - 652925: '新和县', - 652926: '拜城县', - 652927: '乌什县', - 652928: '阿瓦提县', - 652929: '柯坪县', - 653001: '阿图什市', - 653022: '阿克陶县', - 653023: '阿合奇县', - 653024: '乌恰县', - 653101: '喀什市', - 653121: '疏附县', - 653122: '疏勒县', - 653123: '英吉沙县', - 653124: '泽普县', - 653125: '莎车县', - 653126: '叶城县', - 653127: '麦盖提县', - 653128: '岳普湖县', - 653129: '伽师县', - 653130: '巴楚县', - 653131: '塔什库尔干塔吉克自治县', - 653201: '和田市', - 653221: '和田县', - 653222: '墨玉县', - 653223: '皮山县', - 653224: '洛浦县', - 653225: '策勒县', - 653226: '于田县', - 653227: '民丰县', - 654002: '伊宁市', - 654003: '奎屯市', - 654004: '霍尔果斯市', - 654021: '伊宁县', - 654022: '察布查尔锡伯自治县', - 654023: '霍城县', - 654024: '巩留县', - 654025: '新源县', - 654026: '昭苏县', - 654027: '特克斯县', - 654028: '尼勒克县', - 654201: '塔城市', - 654202: '乌苏市', - 654221: '额敏县', - 654223: '沙湾县', - 654224: '托里县', - 654225: '裕民县', - 654226: '和布克赛尔蒙古自治县', - 654301: '阿勒泰市', - 654321: '布尔津县', - 654322: '富蕴县', - 654323: '福海县', - 654324: '哈巴河县', - 654325: '青河县', - 654326: '吉木乃县', - 659001: '石河子市', - 659002: '阿拉尔市', - 659003: '图木舒克市', - 659004: '五家渠市', - 659005: '北屯市', - 659006: '铁门关市', - 659007: '双河市', - 659008: '可克达拉市', - 659009: '昆玉市', - 710101: '中正区', - 710102: '大同区', - 710103: '中山区', - 710104: '松山区', - 710105: '大安区', - 710106: '万华区', - 710107: '信义区', - 710108: '士林区', - 710109: '北投区', - 710110: '内湖区', - 710111: '南港区', - 710112: '文山区', - 710199: '其它区', - 710201: '新兴区', - 710202: '前金区', - 710203: '芩雅区', - 710204: '盐埕区', - 710205: '鼓山区', - 710206: '旗津区', - 710207: '前镇区', - 710208: '三民区', - 710209: '左营区', - 710210: '楠梓区', - 710211: '小港区', - 710241: '苓雅区', - 710242: '仁武区', - 710243: '大社区', - 710244: '冈山区', - 710245: '路竹区', - 710246: '阿莲区', - 710247: '田寮区', - 710248: '燕巢区', - 710249: '桥头区', - 710250: '梓官区', - 710251: '弥陀区', - 710252: '永安区', - 710253: '湖内区', - 710254: '凤山区', - 710255: '大寮区', - 710256: '林园区', - 710257: '鸟松区', - 710258: '大树区', - 710259: '旗山区', - 710260: '美浓区', - 710261: '六龟区', - 710262: '内门区', - 710263: '杉林区', - 710264: '甲仙区', - 710265: '桃源区', - 710266: '那玛夏区', - 710267: '茂林区', - 710268: '茄萣区', - 710299: '其它区', - 710301: '中西区', - 710302: '东区', - 710303: '南区', - 710304: '北区', - 710305: '安平区', - 710306: '安南区', - 710339: '永康区', - 710340: '归仁区', - 710341: '新化区', - 710342: '左镇区', - 710343: '玉井区', - 710344: '楠西区', - 710345: '南化区', - 710346: '仁德区', - 710347: '关庙区', - 710348: '龙崎区', - 710349: '官田区', - 710350: '麻豆区', - 710351: '佳里区', - 710352: '西港区', - 710353: '七股区', - 710354: '将军区', - 710355: '学甲区', - 710356: '北门区', - 710357: '新营区', - 710358: '后壁区', - 710359: '白河区', - 710360: '东山区', - 710361: '六甲区', - 710362: '下营区', - 710363: '柳营区', - 710364: '盐水区', - 710365: '善化区', - 710366: '大内区', - 710367: '山上区', - 710368: '新市区', - 710369: '安定区', - 710399: '其它区', - 710401: '中区', - 710402: '东区', - 710403: '南区', - 710404: '西区', - 710405: '北区', - 710406: '北屯区', - 710407: '西屯区', - 710408: '南屯区', - 710431: '太平区', - 710432: '大里区', - 710433: '雾峰区', - 710434: '乌日区', - 710435: '丰原区', - 710436: '后里区', - 710437: '石冈区', - 710438: '东势区', - 710439: '和平区', - 710440: '新社区', - 710441: '潭子区', - 710442: '大雅区', - 710443: '神冈区', - 710444: '大肚区', - 710445: '沙鹿区', - 710446: '龙井区', - 710447: '梧栖区', - 710448: '清水区', - 710449: '大甲区', - 710450: '外埔区', - 710451: '大安区', - 710499: '其它区', - 710507: '金沙镇', - 710508: '金湖镇', - 710509: '金宁乡', - 710510: '金城镇', - 710511: '烈屿乡', - 710512: '乌坵乡', - 710614: '南投市', - 710615: '中寮乡', - 710616: '草屯镇', - 710617: '国姓乡', - 710618: '埔里镇', - 710619: '仁爱乡', - 710620: '名间乡', - 710621: '集集镇', - 710622: '水里乡', - 710623: '鱼池乡', - 710624: '信义乡', - 710625: '竹山镇', - 710626: '鹿谷乡', - 710701: '仁爱区', - 710702: '信义区', - 710703: '中正区', - 710704: '中山区', - 710705: '安乐区', - 710706: '暖暖区', - 710707: '七堵区', - 710799: '其它区', - 710801: '东区', - 710802: '北区', - 710803: '香山区', - 710899: '其它区', - 710901: '东区', - 710902: '西区', - 710999: '其它区', - 711130: '万里区', - 711132: '板桥区', - 711133: '汐止区', - 711134: '深坑区', - 711136: '瑞芳区', - 711137: '平溪区', - 711138: '双溪区', - 711140: '新店区', - 711141: '坪林区', - 711142: '乌来区', - 711143: '永和区', - 711144: '中和区', - 711145: '土城区', - 711146: '三峡区', - 711147: '树林区', - 711149: '三重区', - 711150: '新庄区', - 711151: '泰山区', - 711152: '林口区', - 711154: '五股区', - 711155: '八里区', - 711156: '淡水区', - 711157: '三芝区', - 711287: '宜兰市', - 711288: '头城镇', - 711289: '礁溪乡', - 711290: '壮围乡', - 711291: '员山乡', - 711292: '罗东镇', - 711293: '三星乡', - 711294: '大同乡', - 711295: '五结乡', - 711296: '冬山乡', - 711297: '苏澳镇', - 711298: '南澳乡', - 711299: '钓鱼台', - 711387: '竹北市', - 711388: '湖口乡', - 711389: '新丰乡', - 711390: '新埔镇', - 711391: '关西镇', - 711392: '芎林乡', - 711393: '宝山乡', - 711394: '竹东镇', - 711395: '五峰乡', - 711396: '横山乡', - 711397: '尖石乡', - 711398: '北埔乡', - 711399: '峨眉乡', - 711487: '中坜市', - 711488: '平镇市', - 711489: '龙潭乡', - 711490: '杨梅市', - 711491: '新屋乡', - 711492: '观音乡', - 711493: '桃园市', - 711494: '龟山乡', - 711495: '八德市', - 711496: '大溪镇', - 711497: '复兴乡', - 711498: '大园乡', - 711499: '芦竹乡', - 711582: '竹南镇', - 711583: '头份镇', - 711584: '三湾乡', - 711585: '南庄乡', - 711586: '狮潭乡', - 711587: '后龙镇', - 711588: '通霄镇', - 711589: '苑里镇', - 711590: '苗栗市', - 711591: '造桥乡', - 711592: '头屋乡', - 711593: '公馆乡', - 711594: '大湖乡', - 711595: '泰安乡', - 711596: '铜锣乡', - 711597: '三义乡', - 711598: '西湖乡', - 711599: '卓兰镇', - 711774: '彰化市', - 711775: '芬园乡', - 711776: '花坛乡', - 711777: '秀水乡', - 711778: '鹿港镇', - 711779: '福兴乡', - 711780: '线西乡', - 711781: '和美镇', - 711782: '伸港乡', - 711783: '员林镇', - 711784: '社头乡', - 711785: '永靖乡', - 711786: '埔心乡', - 711787: '溪湖镇', - 711788: '大村乡', - 711789: '埔盐乡', - 711790: '田中镇', - 711791: '北斗镇', - 711792: '田尾乡', - 711793: '埤头乡', - 711794: '溪州乡', - 711795: '竹塘乡', - 711796: '二林镇', - 711797: '大城乡', - 711798: '芳苑乡', - 711799: '二水乡', - 711982: '番路乡', - 711983: '梅山乡', - 711984: '竹崎乡', - 711985: '阿里山乡', - 711986: '中埔乡', - 711987: '大埔乡', - 711988: '水上乡', - 711989: '鹿草乡', - 711990: '太保市', - 711991: '朴子市', - 711992: '东石乡', - 711993: '六脚乡', - 711994: '新港乡', - 711995: '民雄乡', - 711996: '大林镇', - 711997: '溪口乡', - 711998: '义竹乡', - 711999: '布袋镇', - 712180: '斗南镇', - 712181: '大埤乡', - 712182: '虎尾镇', - 712183: '土库镇', - 712184: '褒忠乡', - 712185: '东势乡', - 712186: '台西乡', - 712187: '仑背乡', - 712188: '麦寮乡', - 712189: '斗六市', - 712190: '林内乡', - 712191: '古坑乡', - 712192: '莿桐乡', - 712193: '西螺镇', - 712194: '二仑乡', - 712195: '北港镇', - 712196: '水林乡', - 712197: '口湖乡', - 712198: '四湖乡', - 712199: '元长乡', - 712467: '屏东市', - 712468: '三地门乡', - 712469: '雾台乡', - 712470: '玛家乡', - 712471: '九如乡', - 712472: '里港乡', - 712473: '高树乡', - 712474: '盐埔乡', - 712475: '长治乡', - 712476: '麟洛乡', - 712477: '竹田乡', - 712478: '内埔乡', - 712479: '万丹乡', - 712480: '潮州镇', - 712481: '泰武乡', - 712482: '来义乡', - 712483: '万峦乡', - 712484: '莰顶乡', - 712485: '新埤乡', - 712486: '南州乡', - 712487: '林边乡', - 712488: '东港镇', - 712489: '琉球乡', - 712490: '佳冬乡', - 712491: '新园乡', - 712492: '枋寮乡', - 712493: '枋山乡', - 712494: '春日乡', - 712495: '狮子乡', - 712496: '车城乡', - 712497: '牡丹乡', - 712498: '恒春镇', - 712499: '满州乡', - 712584: '台东市', - 712585: '绿岛乡', - 712586: '兰屿乡', - 712587: '延平乡', - 712588: '卑南乡', - 712589: '鹿野乡', - 712590: '关山镇', - 712591: '海端乡', - 712592: '池上乡', - 712593: '东河乡', - 712594: '成功镇', - 712595: '长滨乡', - 712596: '金峰乡', - 712597: '大武乡', - 712598: '达仁乡', - 712599: '太麻里乡', - 712686: '花莲市', - 712687: '新城乡', - 712688: '太鲁阁', - 712689: '秀林乡', - 712690: '吉安乡', - 712691: '寿丰乡', - 712692: '凤林镇', - 712693: '光复乡', - 712694: '丰滨乡', - 712695: '瑞穗乡', - 712696: '万荣乡', - 712697: '玉里镇', - 712698: '卓溪乡', - 712699: '富里乡', - 712794: '马公市', - 712795: '西屿乡', - 712796: '望安乡', - 712797: '七美乡', - 712798: '白沙乡', - 712799: '湖西乡', - 712896: '南竿乡', - 712897: '北竿乡', - 712898: '东引乡', - 712899: '莒光乡', - 810101: '中西区', - 810102: '湾仔', - 810103: '东区', - 810104: '南区', - 810201: '九龙城区', - 810202: '油尖旺区', - 810203: '深水埗区', - 810204: '黄大仙区', - 810205: '观塘区', - 810301: '北区', - 810302: '大埔区', - 810303: '沙田区', - 810304: '西贡区', - 810305: '元朗区', - 810306: '屯门区', - 810307: '荃湾区', - 810308: '葵青区', - 810309: '离岛区', - 820101: '澳门半岛', - 820201: '离岛' - } + province_list: { + 110000: '北京市', + 120000: '天津市', + 130000: '河北省', + 140000: '山西省', + 150000: '内蒙古自治区', + 210000: '辽宁省', + 220000: '吉林省', + 230000: '黑龙江省', + 310000: '上海市', + 320000: '江苏省', + 330000: '浙江省', + 340000: '安徽省', + 350000: '福建省', + 360000: '江西省', + 370000: '山东省', + 410000: '河南省', + 420000: '湖北省', + 430000: '湖南省', + 440000: '广东省', + 450000: '广西壮族自治区', + 460000: '海南省', + 500000: '重庆市', + 510000: '四川省', + 520000: '贵州省', + 530000: '云南省', + 540000: '西藏自治区', + 610000: '陕西省', + 620000: '甘肃省', + 630000: '青海省', + 640000: '宁夏回族自治区', + 650000: '新疆维吾尔自治区', + 710000: '台湾省', + 810000: '香港特别行政区', + 820000: '澳门特别行政区', + 900000: '海外' + }, + city_list: { + 110100: '北京市', + 120100: '天津市', + 130100: '石家庄市', + 130200: '唐山市', + 130300: '秦皇岛市', + 130400: '邯郸市', + 130500: '邢台市', + 130600: '保定市', + 130700: '张家口市', + 130800: '承德市', + 130900: '沧州市', + 131000: '廊坊市', + 131100: '衡水市', + 139000: '省直辖县', + 140100: '太原市', + 140200: '大同市', + 140300: '阳泉市', + 140400: '长治市', + 140500: '晋城市', + 140600: '朔州市', + 140700: '晋中市', + 140800: '运城市', + 140900: '忻州市', + 141000: '临汾市', + 141100: '吕梁市', + 150100: '呼和浩特市', + 150200: '包头市', + 150300: '乌海市', + 150400: '赤峰市', + 150500: '通辽市', + 150600: '鄂尔多斯市', + 150700: '呼伦贝尔市', + 150800: '巴彦淖尔市', + 150900: '乌兰察布市', + 152200: '兴安盟', + 152500: '锡林郭勒盟', + 152900: '阿拉善盟', + 210100: '沈阳市', + 210200: '大连市', + 210300: '鞍山市', + 210400: '抚顺市', + 210500: '本溪市', + 210600: '丹东市', + 210700: '锦州市', + 210800: '营口市', + 210900: '阜新市', + 211000: '辽阳市', + 211100: '盘锦市', + 211200: '铁岭市', + 211300: '朝阳市', + 211400: '葫芦岛市', + 220100: '长春市', + 220200: '吉林市', + 220300: '四平市', + 220400: '辽源市', + 220500: '通化市', + 220600: '白山市', + 220700: '松原市', + 220800: '白城市', + 222400: '延边朝鲜族自治州', + 230100: '哈尔滨市', + 230200: '齐齐哈尔市', + 230300: '鸡西市', + 230400: '鹤岗市', + 230500: '双鸭山市', + 230600: '大庆市', + 230700: '伊春市', + 230800: '佳木斯市', + 230900: '七台河市', + 231000: '牡丹江市', + 231100: '黑河市', + 231200: '绥化市', + 232700: '大兴安岭地区', + 310100: '上海市', + 320100: '南京市', + 320200: '无锡市', + 320300: '徐州市', + 320400: '常州市', + 320500: '苏州市', + 320600: '南通市', + 320700: '连云港市', + 320800: '淮安市', + 320900: '盐城市', + 321000: '扬州市', + 321100: '镇江市', + 321200: '泰州市', + 321300: '宿迁市', + 330100: '杭州市', + 330200: '宁波市', + 330300: '温州市', + 330400: '嘉兴市', + 330500: '湖州市', + 330600: '绍兴市', + 330700: '金华市', + 330800: '衢州市', + 330900: '舟山市', + 331000: '台州市', + 331100: '丽水市', + 340100: '合肥市', + 340200: '芜湖市', + 340300: '蚌埠市', + 340400: '淮南市', + 340500: '马鞍山市', + 340600: '淮北市', + 340700: '铜陵市', + 340800: '安庆市', + 341000: '黄山市', + 341100: '滁州市', + 341200: '阜阳市', + 341300: '宿州市', + 341500: '六安市', + 341600: '亳州市', + 341700: '池州市', + 341800: '宣城市', + 350100: '福州市', + 350200: '厦门市', + 350300: '莆田市', + 350400: '三明市', + 350500: '泉州市', + 350600: '漳州市', + 350700: '南平市', + 350800: '龙岩市', + 350900: '宁德市', + 360100: '南昌市', + 360200: '景德镇市', + 360300: '萍乡市', + 360400: '九江市', + 360500: '新余市', + 360600: '鹰潭市', + 360700: '赣州市', + 360800: '吉安市', + 360900: '宜春市', + 361000: '抚州市', + 361100: '上饶市', + 370100: '济南市', + 370200: '青岛市', + 370300: '淄博市', + 370400: '枣庄市', + 370500: '东营市', + 370600: '烟台市', + 370700: '潍坊市', + 370800: '济宁市', + 370900: '泰安市', + 371000: '威海市', + 371100: '日照市', + 371200: '莱芜市', + 371300: '临沂市', + 371400: '德州市', + 371500: '聊城市', + 371600: '滨州市', + 371700: '菏泽市', + 410100: '郑州市', + 410200: '开封市', + 410300: '洛阳市', + 410400: '平顶山市', + 410500: '安阳市', + 410600: '鹤壁市', + 410700: '新乡市', + 410800: '焦作市', + 410900: '濮阳市', + 411000: '许昌市', + 411100: '漯河市', + 411200: '三门峡市', + 411300: '南阳市', + 411400: '商丘市', + 411500: '信阳市', + 411600: '周口市', + 411700: '驻马店市', + 419000: '省直辖县', + 420100: '武汉市', + 420200: '黄石市', + 420300: '十堰市', + 420500: '宜昌市', + 420600: '襄阳市', + 420700: '鄂州市', + 420800: '荆门市', + 420900: '孝感市', + 421000: '荆州市', + 421100: '黄冈市', + 421200: '咸宁市', + 421300: '随州市', + 422800: '恩施土家族苗族自治州', + 429000: '省直辖县', + 430100: '长沙市', + 430200: '株洲市', + 430300: '湘潭市', + 430400: '衡阳市', + 430500: '邵阳市', + 430600: '岳阳市', + 430700: '常德市', + 430800: '张家界市', + 430900: '益阳市', + 431000: '郴州市', + 431100: '永州市', + 431200: '怀化市', + 431300: '娄底市', + 433100: '湘西土家族苗族自治州', + 440100: '广州市', + 440200: '韶关市', + 440300: '深圳市', + 440400: '珠海市', + 440500: '汕头市', + 440600: '佛山市', + 440700: '江门市', + 440800: '湛江市', + 440900: '茂名市', + 441200: '肇庆市', + 441300: '惠州市', + 441400: '梅州市', + 441500: '汕尾市', + 441600: '河源市', + 441700: '阳江市', + 441800: '清远市', + 441900: '东莞市', + 442000: '中山市', + 445100: '潮州市', + 445200: '揭阳市', + 445300: '云浮市', + 450100: '南宁市', + 450200: '柳州市', + 450300: '桂林市', + 450400: '梧州市', + 450500: '北海市', + 450600: '防城港市', + 450700: '钦州市', + 450800: '贵港市', + 450900: '玉林市', + 451000: '百色市', + 451100: '贺州市', + 451200: '河池市', + 451300: '来宾市', + 451400: '崇左市', + 460100: '海口市', + 460200: '三亚市', + 460300: '三沙市', + 460400: '儋州市', + 469000: '省直辖县', + 500100: '重庆市', + 500200: '县', + 510100: '成都市', + 510300: '自贡市', + 510400: '攀枝花市', + 510500: '泸州市', + 510600: '德阳市', + 510700: '绵阳市', + 510800: '广元市', + 510900: '遂宁市', + 511000: '内江市', + 511100: '乐山市', + 511300: '南充市', + 511400: '眉山市', + 511500: '宜宾市', + 511600: '广安市', + 511700: '达州市', + 511800: '雅安市', + 511900: '巴中市', + 512000: '资阳市', + 513200: '阿坝藏族羌族自治州', + 513300: '甘孜藏族自治州', + 513400: '凉山彝族自治州', + 520100: '贵阳市', + 520200: '六盘水市', + 520300: '遵义市', + 520400: '安顺市', + 520500: '毕节市', + 520600: '铜仁市', + 522300: '黔西南布依族苗族自治州', + 522600: '黔东南苗族侗族自治州', + 522700: '黔南布依族苗族自治州', + 530100: '昆明市', + 530300: '曲靖市', + 530400: '玉溪市', + 530500: '保山市', + 530600: '昭通市', + 530700: '丽江市', + 530800: '普洱市', + 530900: '临沧市', + 532300: '楚雄彝族自治州', + 532500: '红河哈尼族彝族自治州', + 532600: '文山壮族苗族自治州', + 532800: '西双版纳傣族自治州', + 532900: '大理白族自治州', + 533100: '德宏傣族景颇族自治州', + 533300: '怒江傈僳族自治州', + 533400: '迪庆藏族自治州', + 540100: '拉萨市', + 540200: '日喀则市', + 540300: '昌都市', + 540400: '林芝市', + 540500: '山南市', + 540600: '那曲市', + 542500: '阿里地区', + 610100: '西安市', + 610200: '铜川市', + 610300: '宝鸡市', + 610400: '咸阳市', + 610500: '渭南市', + 610600: '延安市', + 610700: '汉中市', + 610800: '榆林市', + 610900: '安康市', + 611000: '商洛市', + 620100: '兰州市', + 620200: '嘉峪关市', + 620300: '金昌市', + 620400: '白银市', + 620500: '天水市', + 620600: '武威市', + 620700: '张掖市', + 620800: '平凉市', + 620900: '酒泉市', + 621000: '庆阳市', + 621100: '定西市', + 621200: '陇南市', + 622900: '临夏回族自治州', + 623000: '甘南藏族自治州', + 630100: '西宁市', + 630200: '海东市', + 632200: '海北藏族自治州', + 632300: '黄南藏族自治州', + 632500: '海南藏族自治州', + 632600: '果洛藏族自治州', + 632700: '玉树藏族自治州', + 632800: '海西蒙古族藏族自治州', + 640100: '银川市', + 640200: '石嘴山市', + 640300: '吴忠市', + 640400: '固原市', + 640500: '中卫市', + 650100: '乌鲁木齐市', + 650200: '克拉玛依市', + 650400: '吐鲁番市', + 650500: '哈密市', + 652300: '昌吉回族自治州', + 652700: '博尔塔拉蒙古自治州', + 652800: '巴音郭楞蒙古自治州', + 652900: '阿克苏地区', + 653000: '克孜勒苏柯尔克孜自治州', + 653100: '喀什地区', + 653200: '和田地区', + 654000: '伊犁哈萨克自治州', + 654200: '塔城地区', + 654300: '阿勒泰地区', + 659000: '自治区直辖县级行政区划', + 710100: '台北市', + 710200: '高雄市', + 710300: '台南市', + 710400: '台中市', + 710500: '金门县', + 710600: '南投县', + 710700: '基隆市', + 710800: '新竹市', + 710900: '嘉义市', + 711100: '新北市', + 711200: '宜兰县', + 711300: '新竹县', + 711400: '桃园县', + 711500: '苗栗县', + 711700: '彰化县', + 711900: '嘉义县', + 712100: '云林县', + 712400: '屏东县', + 712500: '台东县', + 712600: '花莲县', + 712700: '澎湖县', + 712800: '连江县', + 810100: '香港岛', + 810200: '九龙', + 810300: '新界', + 820100: '澳门半岛', + 820200: '离岛', + 912400: '加拿大', + 941000: '韩国', + 984000: '美国' + }, + county_list: { + 110101: '东城区', + 110102: '西城区', + 110105: '朝阳区', + 110106: '丰台区', + 110107: '石景山区', + 110108: '海淀区', + 110109: '门头沟区', + 110111: '房山区', + 110112: '通州区', + 110113: '顺义区', + 110114: '昌平区', + 110115: '大兴区', + 110116: '怀柔区', + 110117: '平谷区', + 110118: '密云区', + 110119: '延庆区', + 120101: '和平区', + 120102: '河东区', + 120103: '河西区', + 120104: '南开区', + 120105: '河北区', + 120106: '红桥区', + 120110: '东丽区', + 120111: '西青区', + 120112: '津南区', + 120113: '北辰区', + 120114: '武清区', + 120115: '宝坻区', + 120116: '滨海新区', + 120117: '宁河区', + 120118: '静海区', + 120119: '蓟州区', + 130102: '长安区', + 130104: '桥西区', + 130105: '新华区', + 130107: '井陉矿区', + 130108: '裕华区', + 130109: '藁城区', + 130110: '鹿泉区', + 130111: '栾城区', + 130121: '井陉县', + 130123: '正定县', + 130125: '行唐县', + 130126: '灵寿县', + 130127: '高邑县', + 130128: '深泽县', + 130129: '赞皇县', + 130130: '无极县', + 130131: '平山县', + 130132: '元氏县', + 130133: '赵县', + 130181: '辛集市', + 130183: '晋州市', + 130184: '新乐市', + 130202: '路南区', + 130203: '路北区', + 130204: '古冶区', + 130205: '开平区', + 130207: '丰南区', + 130208: '丰润区', + 130209: '曹妃甸区', + 130223: '滦县', + 130224: '滦南县', + 130225: '乐亭县', + 130227: '迁西县', + 130229: '玉田县', + 130281: '遵化市', + 130283: '迁安市', + 130302: '海港区', + 130303: '山海关区', + 130304: '北戴河区', + 130306: '抚宁区', + 130321: '青龙满族自治县', + 130322: '昌黎县', + 130324: '卢龙县', + 130390: '经济技术开发区', + 130402: '邯山区', + 130403: '丛台区', + 130404: '复兴区', + 130406: '峰峰矿区', + 130407: '肥乡区', + 130408: '永年区', + 130423: '临漳县', + 130424: '成安县', + 130425: '大名县', + 130426: '涉县', + 130427: '磁县', + 130430: '邱县', + 130431: '鸡泽县', + 130432: '广平县', + 130433: '馆陶县', + 130434: '魏县', + 130435: '曲周县', + 130481: '武安市', + 130502: '桥东区', + 130503: '桥西区', + 130521: '邢台县', + 130522: '临城县', + 130523: '内丘县', + 130524: '柏乡县', + 130525: '隆尧县', + 130526: '任县', + 130527: '南和县', + 130528: '宁晋县', + 130529: '巨鹿县', + 130530: '新河县', + 130531: '广宗县', + 130532: '平乡县', + 130533: '威县', + 130534: '清河县', + 130535: '临西县', + 130581: '南宫市', + 130582: '沙河市', + 130602: '竞秀区', + 130606: '莲池区', + 130607: '满城区', + 130608: '清苑区', + 130609: '徐水区', + 130623: '涞水县', + 130624: '阜平县', + 130626: '定兴县', + 130627: '唐县', + 130628: '高阳县', + 130629: '容城县', + 130630: '涞源县', + 130631: '望都县', + 130632: '安新县', + 130633: '易县', + 130634: '曲阳县', + 130635: '蠡县', + 130636: '顺平县', + 130637: '博野县', + 130638: '雄县', + 130681: '涿州市', + 130682: '定州市', + 130683: '安国市', + 130684: '高碑店市', + 130702: '桥东区', + 130703: '桥西区', + 130705: '宣化区', + 130706: '下花园区', + 130708: '万全区', + 130709: '崇礼区', + 130722: '张北县', + 130723: '康保县', + 130724: '沽源县', + 130725: '尚义县', + 130726: '蔚县', + 130727: '阳原县', + 130728: '怀安县', + 130730: '怀来县', + 130731: '涿鹿县', + 130732: '赤城县', + 130802: '双桥区', + 130803: '双滦区', + 130804: '鹰手营子矿区', + 130821: '承德县', + 130822: '兴隆县', + 130824: '滦平县', + 130825: '隆化县', + 130826: '丰宁满族自治县', + 130827: '宽城满族自治县', + 130828: '围场满族蒙古族自治县', + 130881: '平泉市', + 130902: '新华区', + 130903: '运河区', + 130921: '沧县', + 130922: '青县', + 130923: '东光县', + 130924: '海兴县', + 130925: '盐山县', + 130926: '肃宁县', + 130927: '南皮县', + 130928: '吴桥县', + 130929: '献县', + 130930: '孟村回族自治县', + 130981: '泊头市', + 130982: '任丘市', + 130983: '黄骅市', + 130984: '河间市', + 131002: '安次区', + 131003: '广阳区', + 131022: '固安县', + 131023: '永清县', + 131024: '香河县', + 131025: '大城县', + 131026: '文安县', + 131028: '大厂回族自治县', + 131081: '霸州市', + 131082: '三河市', + 131090: '开发区', + 131102: '桃城区', + 131103: '冀州区', + 131121: '枣强县', + 131122: '武邑县', + 131123: '武强县', + 131124: '饶阳县', + 131125: '安平县', + 131126: '故城县', + 131127: '景县', + 131128: '阜城县', + 131182: '深州市', + 140105: '小店区', + 140106: '迎泽区', + 140107: '杏花岭区', + 140108: '尖草坪区', + 140109: '万柏林区', + 140110: '晋源区', + 140121: '清徐县', + 140122: '阳曲县', + 140123: '娄烦县', + 140181: '古交市', + 140202: '城区', + 140203: '矿区', + 140211: '南郊区', + 140212: '新荣区', + 140221: '阳高县', + 140222: '天镇县', + 140223: '广灵县', + 140224: '灵丘县', + 140225: '浑源县', + 140226: '左云县', + 140227: '大同县', + 140302: '城区', + 140303: '矿区', + 140311: '郊区', + 140321: '平定县', + 140322: '盂县', + 140402: '城区', + 140411: '郊区', + 140421: '长治县', + 140423: '襄垣县', + 140424: '屯留县', + 140425: '平顺县', + 140426: '黎城县', + 140427: '壶关县', + 140428: '长子县', + 140429: '武乡县', + 140430: '沁县', + 140431: '沁源县', + 140481: '潞城市', + 140502: '城区', + 140521: '沁水县', + 140522: '阳城县', + 140524: '陵川县', + 140525: '泽州县', + 140581: '高平市', + 140602: '朔城区', + 140603: '平鲁区', + 140621: '山阴县', + 140622: '应县', + 140623: '右玉县', + 140624: '怀仁县', + 140702: '榆次区', + 140721: '榆社县', + 140722: '左权县', + 140723: '和顺县', + 140724: '昔阳县', + 140725: '寿阳县', + 140726: '太谷县', + 140727: '祁县', + 140728: '平遥县', + 140729: '灵石县', + 140781: '介休市', + 140802: '盐湖区', + 140821: '临猗县', + 140822: '万荣县', + 140823: '闻喜县', + 140824: '稷山县', + 140825: '新绛县', + 140826: '绛县', + 140827: '垣曲县', + 140828: '夏县', + 140829: '平陆县', + 140830: '芮城县', + 140881: '永济市', + 140882: '河津市', + 140902: '忻府区', + 140921: '定襄县', + 140922: '五台县', + 140923: '代县', + 140924: '繁峙县', + 140925: '宁武县', + 140926: '静乐县', + 140927: '神池县', + 140928: '五寨县', + 140929: '岢岚县', + 140930: '河曲县', + 140931: '保德县', + 140932: '偏关县', + 140981: '原平市', + 141002: '尧都区', + 141021: '曲沃县', + 141022: '翼城县', + 141023: '襄汾县', + 141024: '洪洞县', + 141025: '古县', + 141026: '安泽县', + 141027: '浮山县', + 141028: '吉县', + 141029: '乡宁县', + 141030: '大宁县', + 141031: '隰县', + 141032: '永和县', + 141033: '蒲县', + 141034: '汾西县', + 141081: '侯马市', + 141082: '霍州市', + 141102: '离石区', + 141121: '文水县', + 141122: '交城县', + 141123: '兴县', + 141124: '临县', + 141125: '柳林县', + 141126: '石楼县', + 141127: '岚县', + 141128: '方山县', + 141129: '中阳县', + 141130: '交口县', + 141181: '孝义市', + 141182: '汾阳市', + 150102: '新城区', + 150103: '回民区', + 150104: '玉泉区', + 150105: '赛罕区', + 150121: '土默特左旗', + 150122: '托克托县', + 150123: '和林格尔县', + 150124: '清水河县', + 150125: '武川县', + 150202: '东河区', + 150203: '昆都仑区', + 150204: '青山区', + 150205: '石拐区', + 150206: '白云鄂博矿区', + 150207: '九原区', + 150221: '土默特右旗', + 150222: '固阳县', + 150223: '达尔罕茂明安联合旗', + 150302: '海勃湾区', + 150303: '海南区', + 150304: '乌达区', + 150402: '红山区', + 150403: '元宝山区', + 150404: '松山区', + 150421: '阿鲁科尔沁旗', + 150422: '巴林左旗', + 150423: '巴林右旗', + 150424: '林西县', + 150425: '克什克腾旗', + 150426: '翁牛特旗', + 150428: '喀喇沁旗', + 150429: '宁城县', + 150430: '敖汉旗', + 150502: '科尔沁区', + 150521: '科尔沁左翼中旗', + 150522: '科尔沁左翼后旗', + 150523: '开鲁县', + 150524: '库伦旗', + 150525: '奈曼旗', + 150526: '扎鲁特旗', + 150581: '霍林郭勒市', + 150602: '东胜区', + 150603: '康巴什区', + 150621: '达拉特旗', + 150622: '准格尔旗', + 150623: '鄂托克前旗', + 150624: '鄂托克旗', + 150625: '杭锦旗', + 150626: '乌审旗', + 150627: '伊金霍洛旗', + 150702: '海拉尔区', + 150703: '扎赉诺尔区', + 150721: '阿荣旗', + 150722: '莫力达瓦达斡尔族自治旗', + 150723: '鄂伦春自治旗', + 150724: '鄂温克族自治旗', + 150725: '陈巴尔虎旗', + 150726: '新巴尔虎左旗', + 150727: '新巴尔虎右旗', + 150781: '满洲里市', + 150782: '牙克石市', + 150783: '扎兰屯市', + 150784: '额尔古纳市', + 150785: '根河市', + 150802: '临河区', + 150821: '五原县', + 150822: '磴口县', + 150823: '乌拉特前旗', + 150824: '乌拉特中旗', + 150825: '乌拉特后旗', + 150826: '杭锦后旗', + 150902: '集宁区', + 150921: '卓资县', + 150922: '化德县', + 150923: '商都县', + 150924: '兴和县', + 150925: '凉城县', + 150926: '察哈尔右翼前旗', + 150927: '察哈尔右翼中旗', + 150928: '察哈尔右翼后旗', + 150929: '四子王旗', + 150981: '丰镇市', + 152201: '乌兰浩特市', + 152202: '阿尔山市', + 152221: '科尔沁右翼前旗', + 152222: '科尔沁右翼中旗', + 152223: '扎赉特旗', + 152224: '突泉县', + 152501: '二连浩特市', + 152502: '锡林浩特市', + 152522: '阿巴嘎旗', + 152523: '苏尼特左旗', + 152524: '苏尼特右旗', + 152525: '东乌珠穆沁旗', + 152526: '西乌珠穆沁旗', + 152527: '太仆寺旗', + 152528: '镶黄旗', + 152529: '正镶白旗', + 152530: '正蓝旗', + 152531: '多伦县', + 152921: '阿拉善左旗', + 152922: '阿拉善右旗', + 152923: '额济纳旗', + 210102: '和平区', + 210103: '沈河区', + 210104: '大东区', + 210105: '皇姑区', + 210106: '铁西区', + 210111: '苏家屯区', + 210112: '浑南区', + 210113: '沈北新区', + 210114: '于洪区', + 210115: '辽中区', + 210123: '康平县', + 210124: '法库县', + 210181: '新民市', + 210190: '经济技术开发区', + 210202: '中山区', + 210203: '西岗区', + 210204: '沙河口区', + 210211: '甘井子区', + 210212: '旅顺口区', + 210213: '金州区', + 210214: '普兰店区', + 210224: '长海县', + 210281: '瓦房店市', + 210283: '庄河市', + 210302: '铁东区', + 210303: '铁西区', + 210304: '立山区', + 210311: '千山区', + 210321: '台安县', + 210323: '岫岩满族自治县', + 210381: '海城市', + 210390: '高新区', + 210402: '新抚区', + 210403: '东洲区', + 210404: '望花区', + 210411: '顺城区', + 210421: '抚顺县', + 210422: '新宾满族自治县', + 210423: '清原满族自治县', + 210502: '平山区', + 210503: '溪湖区', + 210504: '明山区', + 210505: '南芬区', + 210521: '本溪满族自治县', + 210522: '桓仁满族自治县', + 210602: '元宝区', + 210603: '振兴区', + 210604: '振安区', + 210624: '宽甸满族自治县', + 210681: '东港市', + 210682: '凤城市', + 210702: '古塔区', + 210703: '凌河区', + 210711: '太和区', + 210726: '黑山县', + 210727: '义县', + 210781: '凌海市', + 210782: '北镇市', + 210793: '经济技术开发区', + 210802: '站前区', + 210803: '西市区', + 210804: '鲅鱼圈区', + 210811: '老边区', + 210881: '盖州市', + 210882: '大石桥市', + 210902: '海州区', + 210903: '新邱区', + 210904: '太平区', + 210905: '清河门区', + 210911: '细河区', + 210921: '阜新蒙古族自治县', + 210922: '彰武县', + 211002: '白塔区', + 211003: '文圣区', + 211004: '宏伟区', + 211005: '弓长岭区', + 211011: '太子河区', + 211021: '辽阳县', + 211081: '灯塔市', + 211102: '双台子区', + 211103: '兴隆台区', + 211104: '大洼区', + 211122: '盘山县', + 211202: '银州区', + 211204: '清河区', + 211221: '铁岭县', + 211223: '西丰县', + 211224: '昌图县', + 211281: '调兵山市', + 211282: '开原市', + 211302: '双塔区', + 211303: '龙城区', + 211321: '朝阳县', + 211322: '建平县', + 211324: '喀喇沁左翼蒙古族自治县', + 211381: '北票市', + 211382: '凌源市', + 211402: '连山区', + 211403: '龙港区', + 211404: '南票区', + 211421: '绥中县', + 211422: '建昌县', + 211481: '兴城市', + 215090: '工业园区', + 220102: '南关区', + 220103: '宽城区', + 220104: '朝阳区', + 220105: '二道区', + 220106: '绿园区', + 220112: '双阳区', + 220113: '九台区', + 220122: '农安县', + 220182: '榆树市', + 220183: '德惠市', + 220192: '经济技术开发区', + 220202: '昌邑区', + 220203: '龙潭区', + 220204: '船营区', + 220211: '丰满区', + 220221: '永吉县', + 220281: '蛟河市', + 220282: '桦甸市', + 220283: '舒兰市', + 220284: '磐石市', + 220302: '铁西区', + 220303: '铁东区', + 220322: '梨树县', + 220323: '伊通满族自治县', + 220381: '公主岭市', + 220382: '双辽市', + 220402: '龙山区', + 220403: '西安区', + 220421: '东丰县', + 220422: '东辽县', + 220502: '东昌区', + 220503: '二道江区', + 220521: '通化县', + 220523: '辉南县', + 220524: '柳河县', + 220581: '梅河口市', + 220582: '集安市', + 220602: '浑江区', + 220605: '江源区', + 220621: '抚松县', + 220622: '靖宇县', + 220623: '长白朝鲜族自治县', + 220681: '临江市', + 220702: '宁江区', + 220721: '前郭尔罗斯蒙古族自治县', + 220722: '长岭县', + 220723: '乾安县', + 220781: '扶余市', + 220802: '洮北区', + 220821: '镇赉县', + 220822: '通榆县', + 220881: '洮南市', + 220882: '大安市', + 221090: '工业园区', + 222401: '延吉市', + 222402: '图们市', + 222403: '敦化市', + 222404: '珲春市', + 222405: '龙井市', + 222406: '和龙市', + 222424: '汪清县', + 222426: '安图县', + 230102: '道里区', + 230103: '南岗区', + 230104: '道外区', + 230108: '平房区', + 230109: '松北区', + 230110: '香坊区', + 230111: '呼兰区', + 230112: '阿城区', + 230113: '双城区', + 230123: '依兰县', + 230124: '方正县', + 230125: '宾县', + 230126: '巴彦县', + 230127: '木兰县', + 230128: '通河县', + 230129: '延寿县', + 230183: '尚志市', + 230184: '五常市', + 230202: '龙沙区', + 230203: '建华区', + 230204: '铁锋区', + 230205: '昂昂溪区', + 230206: '富拉尔基区', + 230207: '碾子山区', + 230208: '梅里斯达斡尔族区', + 230221: '龙江县', + 230223: '依安县', + 230224: '泰来县', + 230225: '甘南县', + 230227: '富裕县', + 230229: '克山县', + 230230: '克东县', + 230231: '拜泉县', + 230281: '讷河市', + 230302: '鸡冠区', + 230303: '恒山区', + 230304: '滴道区', + 230305: '梨树区', + 230306: '城子河区', + 230307: '麻山区', + 230321: '鸡东县', + 230381: '虎林市', + 230382: '密山市', + 230402: '向阳区', + 230403: '工农区', + 230404: '南山区', + 230405: '兴安区', + 230406: '东山区', + 230407: '兴山区', + 230421: '萝北县', + 230422: '绥滨县', + 230502: '尖山区', + 230503: '岭东区', + 230505: '四方台区', + 230506: '宝山区', + 230521: '集贤县', + 230522: '友谊县', + 230523: '宝清县', + 230524: '饶河县', + 230602: '萨尔图区', + 230603: '龙凤区', + 230604: '让胡路区', + 230605: '红岗区', + 230606: '大同区', + 230621: '肇州县', + 230622: '肇源县', + 230623: '林甸县', + 230624: '杜尔伯特蒙古族自治县', + 230702: '伊春区', + 230703: '南岔区', + 230704: '友好区', + 230705: '西林区', + 230706: '翠峦区', + 230707: '新青区', + 230708: '美溪区', + 230709: '金山屯区', + 230710: '五营区', + 230711: '乌马河区', + 230712: '汤旺河区', + 230713: '带岭区', + 230714: '乌伊岭区', + 230715: '红星区', + 230716: '上甘岭区', + 230722: '嘉荫县', + 230781: '铁力市', + 230803: '向阳区', + 230804: '前进区', + 230805: '东风区', + 230811: '郊区', + 230822: '桦南县', + 230826: '桦川县', + 230828: '汤原县', + 230881: '同江市', + 230882: '富锦市', + 230883: '抚远市', + 230902: '新兴区', + 230903: '桃山区', + 230904: '茄子河区', + 230921: '勃利县', + 231002: '东安区', + 231003: '阳明区', + 231004: '爱民区', + 231005: '西安区', + 231025: '林口县', + 231081: '绥芬河市', + 231083: '海林市', + 231084: '宁安市', + 231085: '穆棱市', + 231086: '东宁市', + 231102: '爱辉区', + 231121: '嫩江县', + 231123: '逊克县', + 231124: '孙吴县', + 231181: '北安市', + 231182: '五大连池市', + 231202: '北林区', + 231221: '望奎县', + 231222: '兰西县', + 231223: '青冈县', + 231224: '庆安县', + 231225: '明水县', + 231226: '绥棱县', + 231281: '安达市', + 231282: '肇东市', + 231283: '海伦市', + 232721: '呼玛县', + 232722: '塔河县', + 232723: '漠河县', + 232790: '松岭区', + 232791: '呼中区', + 232792: '加格达奇区', + 232793: '新林区', + 310101: '黄浦区', + 310104: '徐汇区', + 310105: '长宁区', + 310106: '静安区', + 310107: '普陀区', + 310109: '虹口区', + 310110: '杨浦区', + 310112: '闵行区', + 310113: '宝山区', + 310114: '嘉定区', + 310115: '浦东新区', + 310116: '金山区', + 310117: '松江区', + 310118: '青浦区', + 310120: '奉贤区', + 310151: '崇明区', + 320102: '玄武区', + 320104: '秦淮区', + 320105: '建邺区', + 320106: '鼓楼区', + 320111: '浦口区', + 320113: '栖霞区', + 320114: '雨花台区', + 320115: '江宁区', + 320116: '六合区', + 320117: '溧水区', + 320118: '高淳区', + 320205: '锡山区', + 320206: '惠山区', + 320211: '滨湖区', + 320213: '梁溪区', + 320214: '新吴区', + 320281: '江阴市', + 320282: '宜兴市', + 320302: '鼓楼区', + 320303: '云龙区', + 320305: '贾汪区', + 320311: '泉山区', + 320312: '铜山区', + 320321: '丰县', + 320322: '沛县', + 320324: '睢宁县', + 320381: '新沂市', + 320382: '邳州市', + 320391: '工业园区', + 320402: '天宁区', + 320404: '钟楼区', + 320411: '新北区', + 320412: '武进区', + 320413: '金坛区', + 320481: '溧阳市', + 320505: '虎丘区', + 320506: '吴中区', + 320507: '相城区', + 320508: '姑苏区', + 320509: '吴江区', + 320581: '常熟市', + 320582: '张家港市', + 320583: '昆山市', + 320585: '太仓市', + 320590: '工业园区', + 320591: '高新区', + 320602: '崇川区', + 320611: '港闸区', + 320612: '通州区', + 320621: '海安县', + 320623: '如东县', + 320681: '启东市', + 320682: '如皋市', + 320684: '海门市', + 320691: '高新区', + 320703: '连云区', + 320706: '海州区', + 320707: '赣榆区', + 320722: '东海县', + 320723: '灌云县', + 320724: '灌南县', + 320803: '淮安区', + 320804: '淮阴区', + 320812: '清江浦区', + 320813: '洪泽区', + 320826: '涟水县', + 320830: '盱眙县', + 320831: '金湖县', + 320890: '经济开发区', + 320902: '亭湖区', + 320903: '盐都区', + 320904: '大丰区', + 320921: '响水县', + 320922: '滨海县', + 320923: '阜宁县', + 320924: '射阳县', + 320925: '建湖县', + 320981: '东台市', + 321002: '广陵区', + 321003: '邗江区', + 321012: '江都区', + 321023: '宝应县', + 321081: '仪征市', + 321084: '高邮市', + 321090: '经济开发区', + 321102: '京口区', + 321111: '润州区', + 321112: '丹徒区', + 321181: '丹阳市', + 321182: '扬中市', + 321183: '句容市', + 321202: '海陵区', + 321203: '高港区', + 321204: '姜堰区', + 321281: '兴化市', + 321282: '靖江市', + 321283: '泰兴市', + 321302: '宿城区', + 321311: '宿豫区', + 321322: '沭阳县', + 321323: '泗阳县', + 321324: '泗洪县', + 330102: '上城区', + 330103: '下城区', + 330104: '江干区', + 330105: '拱墅区', + 330106: '西湖区', + 330108: '滨江区', + 330109: '萧山区', + 330110: '余杭区', + 330111: '富阳区', + 330112: '临安区', + 330122: '桐庐县', + 330127: '淳安县', + 330182: '建德市', + 330203: '海曙区', + 330205: '江北区', + 330206: '北仑区', + 330211: '镇海区', + 330212: '鄞州区', + 330213: '奉化区', + 330225: '象山县', + 330226: '宁海县', + 330281: '余姚市', + 330282: '慈溪市', + 330302: '鹿城区', + 330303: '龙湾区', + 330304: '瓯海区', + 330305: '洞头区', + 330324: '永嘉县', + 330326: '平阳县', + 330327: '苍南县', + 330328: '文成县', + 330329: '泰顺县', + 330381: '瑞安市', + 330382: '乐清市', + 330402: '南湖区', + 330411: '秀洲区', + 330421: '嘉善县', + 330424: '海盐县', + 330481: '海宁市', + 330482: '平湖市', + 330483: '桐乡市', + 330502: '吴兴区', + 330503: '南浔区', + 330521: '德清县', + 330522: '长兴县', + 330523: '安吉县', + 330602: '越城区', + 330603: '柯桥区', + 330604: '上虞区', + 330624: '新昌县', + 330681: '诸暨市', + 330683: '嵊州市', + 330702: '婺城区', + 330703: '金东区', + 330723: '武义县', + 330726: '浦江县', + 330727: '磐安县', + 330781: '兰溪市', + 330782: '义乌市', + 330783: '东阳市', + 330784: '永康市', + 330802: '柯城区', + 330803: '衢江区', + 330822: '常山县', + 330824: '开化县', + 330825: '龙游县', + 330881: '江山市', + 330902: '定海区', + 330903: '普陀区', + 330921: '岱山县', + 330922: '嵊泗县', + 331002: '椒江区', + 331003: '黄岩区', + 331004: '路桥区', + 331022: '三门县', + 331023: '天台县', + 331024: '仙居县', + 331081: '温岭市', + 331082: '临海市', + 331083: '玉环市', + 331102: '莲都区', + 331121: '青田县', + 331122: '缙云县', + 331123: '遂昌县', + 331124: '松阳县', + 331125: '云和县', + 331126: '庆元县', + 331127: '景宁畲族自治县', + 331181: '龙泉市', + 340102: '瑶海区', + 340103: '庐阳区', + 340104: '蜀山区', + 340111: '包河区', + 340121: '长丰县', + 340122: '肥东县', + 340123: '肥西县', + 340124: '庐江县', + 340181: '巢湖市', + 340190: '高新技术开发区', + 340191: '经济技术开发区', + 340202: '镜湖区', + 340203: '弋江区', + 340207: '鸠江区', + 340208: '三山区', + 340221: '芜湖县', + 340222: '繁昌县', + 340223: '南陵县', + 340225: '无为县', + 340302: '龙子湖区', + 340303: '蚌山区', + 340304: '禹会区', + 340311: '淮上区', + 340321: '怀远县', + 340322: '五河县', + 340323: '固镇县', + 340402: '大通区', + 340403: '田家庵区', + 340404: '谢家集区', + 340405: '八公山区', + 340406: '潘集区', + 340421: '凤台县', + 340422: '寿县', + 340503: '花山区', + 340504: '雨山区', + 340506: '博望区', + 340521: '当涂县', + 340522: '含山县', + 340523: '和县', + 340602: '杜集区', + 340603: '相山区', + 340604: '烈山区', + 340621: '濉溪县', + 340705: '铜官区', + 340706: '义安区', + 340711: '郊区', + 340722: '枞阳县', + 340802: '迎江区', + 340803: '大观区', + 340811: '宜秀区', + 340822: '怀宁县', + 340824: '潜山县', + 340825: '太湖县', + 340826: '宿松县', + 340827: '望江县', + 340828: '岳西县', + 340881: '桐城市', + 341002: '屯溪区', + 341003: '黄山区', + 341004: '徽州区', + 341021: '歙县', + 341022: '休宁县', + 341023: '黟县', + 341024: '祁门县', + 341102: '琅琊区', + 341103: '南谯区', + 341122: '来安县', + 341124: '全椒县', + 341125: '定远县', + 341126: '凤阳县', + 341181: '天长市', + 341182: '明光市', + 341202: '颍州区', + 341203: '颍东区', + 341204: '颍泉区', + 341221: '临泉县', + 341222: '太和县', + 341225: '阜南县', + 341226: '颍上县', + 341282: '界首市', + 341302: '埇桥区', + 341321: '砀山县', + 341322: '萧县', + 341323: '灵璧县', + 341324: '泗县', + 341390: '经济开发区', + 341502: '金安区', + 341503: '裕安区', + 341504: '叶集区', + 341522: '霍邱县', + 341523: '舒城县', + 341524: '金寨县', + 341525: '霍山县', + 341602: '谯城区', + 341621: '涡阳县', + 341622: '蒙城县', + 341623: '利辛县', + 341702: '贵池区', + 341721: '东至县', + 341722: '石台县', + 341723: '青阳县', + 341802: '宣州区', + 341821: '郎溪县', + 341822: '广德县', + 341823: '泾县', + 341824: '绩溪县', + 341825: '旌德县', + 341881: '宁国市', + 350102: '鼓楼区', + 350103: '台江区', + 350104: '仓山区', + 350105: '马尾区', + 350111: '晋安区', + 350112: '长乐区', + 350121: '闽侯县', + 350122: '连江县', + 350123: '罗源县', + 350124: '闽清县', + 350125: '永泰县', + 350128: '平潭县', + 350181: '福清市', + 350203: '思明区', + 350205: '海沧区', + 350206: '湖里区', + 350211: '集美区', + 350212: '同安区', + 350213: '翔安区', + 350302: '城厢区', + 350303: '涵江区', + 350304: '荔城区', + 350305: '秀屿区', + 350322: '仙游县', + 350402: '梅列区', + 350403: '三元区', + 350421: '明溪县', + 350423: '清流县', + 350424: '宁化县', + 350425: '大田县', + 350426: '尤溪县', + 350427: '沙县', + 350428: '将乐县', + 350429: '泰宁县', + 350430: '建宁县', + 350481: '永安市', + 350502: '鲤城区', + 350503: '丰泽区', + 350504: '洛江区', + 350505: '泉港区', + 350521: '惠安县', + 350524: '安溪县', + 350525: '永春县', + 350526: '德化县', + 350527: '金门县', + 350581: '石狮市', + 350582: '晋江市', + 350583: '南安市', + 350602: '芗城区', + 350603: '龙文区', + 350622: '云霄县', + 350623: '漳浦县', + 350624: '诏安县', + 350625: '长泰县', + 350626: '东山县', + 350627: '南靖县', + 350628: '平和县', + 350629: '华安县', + 350681: '龙海市', + 350702: '延平区', + 350703: '建阳区', + 350721: '顺昌县', + 350722: '浦城县', + 350723: '光泽县', + 350724: '松溪县', + 350725: '政和县', + 350781: '邵武市', + 350782: '武夷山市', + 350783: '建瓯市', + 350802: '新罗区', + 350803: '永定区', + 350821: '长汀县', + 350823: '上杭县', + 350824: '武平县', + 350825: '连城县', + 350881: '漳平市', + 350902: '蕉城区', + 350921: '霞浦县', + 350922: '古田县', + 350923: '屏南县', + 350924: '寿宁县', + 350925: '周宁县', + 350926: '柘荣县', + 350981: '福安市', + 350982: '福鼎市', + 360102: '东湖区', + 360103: '西湖区', + 360104: '青云谱区', + 360105: '湾里区', + 360111: '青山湖区', + 360112: '新建区', + 360121: '南昌县', + 360123: '安义县', + 360124: '进贤县', + 360190: '经济技术开发区', + 360192: '高新区', + 360202: '昌江区', + 360203: '珠山区', + 360222: '浮梁县', + 360281: '乐平市', + 360302: '安源区', + 360313: '湘东区', + 360321: '莲花县', + 360322: '上栗县', + 360323: '芦溪县', + 360402: '濂溪区', + 360403: '浔阳区', + 360404: '柴桑区', + 360423: '武宁县', + 360424: '修水县', + 360425: '永修县', + 360426: '德安县', + 360428: '都昌县', + 360429: '湖口县', + 360430: '彭泽县', + 360481: '瑞昌市', + 360482: '共青城市', + 360483: '庐山市', + 360490: '经济技术开发区', + 360502: '渝水区', + 360521: '分宜县', + 360602: '月湖区', + 360622: '余江县', + 360681: '贵溪市', + 360702: '章贡区', + 360703: '南康区', + 360704: '赣县区', + 360722: '信丰县', + 360723: '大余县', + 360724: '上犹县', + 360725: '崇义县', + 360726: '安远县', + 360727: '龙南县', + 360728: '定南县', + 360729: '全南县', + 360730: '宁都县', + 360731: '于都县', + 360732: '兴国县', + 360733: '会昌县', + 360734: '寻乌县', + 360735: '石城县', + 360781: '瑞金市', + 360802: '吉州区', + 360803: '青原区', + 360821: '吉安县', + 360822: '吉水县', + 360823: '峡江县', + 360824: '新干县', + 360825: '永丰县', + 360826: '泰和县', + 360827: '遂川县', + 360828: '万安县', + 360829: '安福县', + 360830: '永新县', + 360881: '井冈山市', + 360902: '袁州区', + 360921: '奉新县', + 360922: '万载县', + 360923: '上高县', + 360924: '宜丰县', + 360925: '靖安县', + 360926: '铜鼓县', + 360981: '丰城市', + 360982: '樟树市', + 360983: '高安市', + 361002: '临川区', + 361003: '东乡区', + 361021: '南城县', + 361022: '黎川县', + 361023: '南丰县', + 361024: '崇仁县', + 361025: '乐安县', + 361026: '宜黄县', + 361027: '金溪县', + 361028: '资溪县', + 361030: '广昌县', + 361102: '信州区', + 361103: '广丰区', + 361121: '上饶县', + 361123: '玉山县', + 361124: '铅山县', + 361125: '横峰县', + 361126: '弋阳县', + 361127: '余干县', + 361128: '鄱阳县', + 361129: '万年县', + 361130: '婺源县', + 361181: '德兴市', + 370102: '历下区', + 370103: '市中区', + 370104: '槐荫区', + 370105: '天桥区', + 370112: '历城区', + 370113: '长清区', + 370114: '章丘区', + 370124: '平阴县', + 370125: '济阳县', + 370126: '商河县', + 370190: '高新区', + 370202: '市南区', + 370203: '市北区', + 370211: '黄岛区', + 370212: '崂山区', + 370213: '李沧区', + 370214: '城阳区', + 370215: '即墨区', + 370281: '胶州市', + 370283: '平度市', + 370285: '莱西市', + 370290: '开发区', + 370302: '淄川区', + 370303: '张店区', + 370304: '博山区', + 370305: '临淄区', + 370306: '周村区', + 370321: '桓台县', + 370322: '高青县', + 370323: '沂源县', + 370402: '市中区', + 370403: '薛城区', + 370404: '峄城区', + 370405: '台儿庄区', + 370406: '山亭区', + 370481: '滕州市', + 370502: '东营区', + 370503: '河口区', + 370505: '垦利区', + 370522: '利津县', + 370523: '广饶县', + 370602: '芝罘区', + 370611: '福山区', + 370612: '牟平区', + 370613: '莱山区', + 370634: '长岛县', + 370681: '龙口市', + 370682: '莱阳市', + 370683: '莱州市', + 370684: '蓬莱市', + 370685: '招远市', + 370686: '栖霞市', + 370687: '海阳市', + 370690: '开发区', + 370702: '潍城区', + 370703: '寒亭区', + 370704: '坊子区', + 370705: '奎文区', + 370724: '临朐县', + 370725: '昌乐县', + 370781: '青州市', + 370782: '诸城市', + 370783: '寿光市', + 370784: '安丘市', + 370785: '高密市', + 370786: '昌邑市', + 370790: '开发区', + 370791: '高新区', + 370811: '任城区', + 370812: '兖州区', + 370826: '微山县', + 370827: '鱼台县', + 370828: '金乡县', + 370829: '嘉祥县', + 370830: '汶上县', + 370831: '泗水县', + 370832: '梁山县', + 370881: '曲阜市', + 370883: '邹城市', + 370890: '高新区', + 370902: '泰山区', + 370911: '岱岳区', + 370921: '宁阳县', + 370923: '东平县', + 370982: '新泰市', + 370983: '肥城市', + 371002: '环翠区', + 371003: '文登区', + 371082: '荣成市', + 371083: '乳山市', + 371091: '经济技术开发区', + 371102: '东港区', + 371103: '岚山区', + 371121: '五莲县', + 371122: '莒县', + 371202: '莱城区', + 371203: '钢城区', + 371302: '兰山区', + 371311: '罗庄区', + 371312: '河东区', + 371321: '沂南县', + 371322: '郯城县', + 371323: '沂水县', + 371324: '兰陵县', + 371325: '费县', + 371326: '平邑县', + 371327: '莒南县', + 371328: '蒙阴县', + 371329: '临沭县', + 371402: '德城区', + 371403: '陵城区', + 371422: '宁津县', + 371423: '庆云县', + 371424: '临邑县', + 371425: '齐河县', + 371426: '平原县', + 371427: '夏津县', + 371428: '武城县', + 371481: '乐陵市', + 371482: '禹城市', + 371502: '东昌府区', + 371521: '阳谷县', + 371522: '莘县', + 371523: '茌平县', + 371524: '东阿县', + 371525: '冠县', + 371526: '高唐县', + 371581: '临清市', + 371602: '滨城区', + 371603: '沾化区', + 371621: '惠民县', + 371622: '阳信县', + 371623: '无棣县', + 371625: '博兴县', + 371626: '邹平县', + 371702: '牡丹区', + 371703: '定陶区', + 371721: '曹县', + 371722: '单县', + 371723: '成武县', + 371724: '巨野县', + 371725: '郓城县', + 371726: '鄄城县', + 371728: '东明县', + 410102: '中原区', + 410103: '二七区', + 410104: '管城回族区', + 410105: '金水区', + 410106: '上街区', + 410108: '惠济区', + 410122: '中牟县', + 410181: '巩义市', + 410182: '荥阳市', + 410183: '新密市', + 410184: '新郑市', + 410185: '登封市', + 410190: '高新技术开发区', + 410191: '经济技术开发区', + 410202: '龙亭区', + 410203: '顺河回族区', + 410204: '鼓楼区', + 410205: '禹王台区', + 410212: '祥符区', + 410221: '杞县', + 410222: '通许县', + 410223: '尉氏县', + 410225: '兰考县', + 410302: '老城区', + 410303: '西工区', + 410304: '瀍河回族区', + 410305: '涧西区', + 410306: '吉利区', + 410311: '洛龙区', + 410322: '孟津县', + 410323: '新安县', + 410324: '栾川县', + 410325: '嵩县', + 410326: '汝阳县', + 410327: '宜阳县', + 410328: '洛宁县', + 410329: '伊川县', + 410381: '偃师市', + 410402: '新华区', + 410403: '卫东区', + 410404: '石龙区', + 410411: '湛河区', + 410421: '宝丰县', + 410422: '叶县', + 410423: '鲁山县', + 410425: '郏县', + 410481: '舞钢市', + 410482: '汝州市', + 410502: '文峰区', + 410503: '北关区', + 410505: '殷都区', + 410506: '龙安区', + 410522: '安阳县', + 410523: '汤阴县', + 410526: '滑县', + 410527: '内黄县', + 410581: '林州市', + 410590: '开发区', + 410602: '鹤山区', + 410603: '山城区', + 410611: '淇滨区', + 410621: '浚县', + 410622: '淇县', + 410702: '红旗区', + 410703: '卫滨区', + 410704: '凤泉区', + 410711: '牧野区', + 410721: '新乡县', + 410724: '获嘉县', + 410725: '原阳县', + 410726: '延津县', + 410727: '封丘县', + 410728: '长垣县', + 410781: '卫辉市', + 410782: '辉县市', + 410802: '解放区', + 410803: '中站区', + 410804: '马村区', + 410811: '山阳区', + 410821: '修武县', + 410822: '博爱县', + 410823: '武陟县', + 410825: '温县', + 410882: '沁阳市', + 410883: '孟州市', + 410902: '华龙区', + 410922: '清丰县', + 410923: '南乐县', + 410926: '范县', + 410927: '台前县', + 410928: '濮阳县', + 411002: '魏都区', + 411003: '建安区', + 411024: '鄢陵县', + 411025: '襄城县', + 411081: '禹州市', + 411082: '长葛市', + 411102: '源汇区', + 411103: '郾城区', + 411104: '召陵区', + 411121: '舞阳县', + 411122: '临颍县', + 411202: '湖滨区', + 411203: '陕州区', + 411221: '渑池县', + 411224: '卢氏县', + 411281: '义马市', + 411282: '灵宝市', + 411302: '宛城区', + 411303: '卧龙区', + 411321: '南召县', + 411322: '方城县', + 411323: '西峡县', + 411324: '镇平县', + 411325: '内乡县', + 411326: '淅川县', + 411327: '社旗县', + 411328: '唐河县', + 411329: '新野县', + 411330: '桐柏县', + 411381: '邓州市', + 411402: '梁园区', + 411403: '睢阳区', + 411421: '民权县', + 411422: '睢县', + 411423: '宁陵县', + 411424: '柘城县', + 411425: '虞城县', + 411426: '夏邑县', + 411481: '永城市', + 411502: '浉河区', + 411503: '平桥区', + 411521: '罗山县', + 411522: '光山县', + 411523: '新县', + 411524: '商城县', + 411525: '固始县', + 411526: '潢川县', + 411527: '淮滨县', + 411528: '息县', + 411602: '川汇区', + 411621: '扶沟县', + 411622: '西华县', + 411623: '商水县', + 411624: '沈丘县', + 411625: '郸城县', + 411626: '淮阳县', + 411627: '太康县', + 411628: '鹿邑县', + 411681: '项城市', + 411690: '经济开发区', + 411702: '驿城区', + 411721: '西平县', + 411722: '上蔡县', + 411723: '平舆县', + 411724: '正阳县', + 411725: '确山县', + 411726: '泌阳县', + 411727: '汝南县', + 411728: '遂平县', + 411729: '新蔡县', + 419001: '济源市', + 420102: '江岸区', + 420103: '江汉区', + 420104: '硚口区', + 420105: '汉阳区', + 420106: '武昌区', + 420107: '青山区', + 420111: '洪山区', + 420112: '东西湖区', + 420113: '汉南区', + 420114: '蔡甸区', + 420115: '江夏区', + 420116: '黄陂区', + 420117: '新洲区', + 420202: '黄石港区', + 420203: '西塞山区', + 420204: '下陆区', + 420205: '铁山区', + 420222: '阳新县', + 420281: '大冶市', + 420302: '茅箭区', + 420303: '张湾区', + 420304: '郧阳区', + 420322: '郧西县', + 420323: '竹山县', + 420324: '竹溪县', + 420325: '房县', + 420381: '丹江口市', + 420502: '西陵区', + 420503: '伍家岗区', + 420504: '点军区', + 420505: '猇亭区', + 420506: '夷陵区', + 420525: '远安县', + 420526: '兴山县', + 420527: '秭归县', + 420528: '长阳土家族自治县', + 420529: '五峰土家族自治县', + 420581: '宜都市', + 420582: '当阳市', + 420583: '枝江市', + 420590: '经济开发区', + 420602: '襄城区', + 420606: '樊城区', + 420607: '襄州区', + 420624: '南漳县', + 420625: '谷城县', + 420626: '保康县', + 420682: '老河口市', + 420683: '枣阳市', + 420684: '宜城市', + 420702: '梁子湖区', + 420703: '华容区', + 420704: '鄂城区', + 420802: '东宝区', + 420804: '掇刀区', + 420821: '京山县', + 420822: '沙洋县', + 420881: '钟祥市', + 420902: '孝南区', + 420921: '孝昌县', + 420922: '大悟县', + 420923: '云梦县', + 420981: '应城市', + 420982: '安陆市', + 420984: '汉川市', + 421002: '沙市区', + 421003: '荆州区', + 421022: '公安县', + 421023: '监利县', + 421024: '江陵县', + 421081: '石首市', + 421083: '洪湖市', + 421087: '松滋市', + 421102: '黄州区', + 421121: '团风县', + 421122: '红安县', + 421123: '罗田县', + 421124: '英山县', + 421125: '浠水县', + 421126: '蕲春县', + 421127: '黄梅县', + 421181: '麻城市', + 421182: '武穴市', + 421202: '咸安区', + 421221: '嘉鱼县', + 421222: '通城县', + 421223: '崇阳县', + 421224: '通山县', + 421281: '赤壁市', + 421303: '曾都区', + 421321: '随县', + 421381: '广水市', + 422801: '恩施市', + 422802: '利川市', + 422822: '建始县', + 422823: '巴东县', + 422825: '宣恩县', + 422826: '咸丰县', + 422827: '来凤县', + 422828: '鹤峰县', + 429004: '仙桃市', + 429005: '潜江市', + 429006: '天门市', + 429021: '神农架林区', + 430102: '芙蓉区', + 430103: '天心区', + 430104: '岳麓区', + 430105: '开福区', + 430111: '雨花区', + 430112: '望城区', + 430121: '长沙县', + 430181: '浏阳市', + 430182: '宁乡市', + 430202: '荷塘区', + 430203: '芦淞区', + 430204: '石峰区', + 430211: '天元区', + 430221: '株洲县', + 430223: '攸县', + 430224: '茶陵县', + 430225: '炎陵县', + 430281: '醴陵市', + 430302: '雨湖区', + 430304: '岳塘区', + 430321: '湘潭县', + 430381: '湘乡市', + 430382: '韶山市', + 430405: '珠晖区', + 430406: '雁峰区', + 430407: '石鼓区', + 430408: '蒸湘区', + 430412: '南岳区', + 430421: '衡阳县', + 430422: '衡南县', + 430423: '衡山县', + 430424: '衡东县', + 430426: '祁东县', + 430481: '耒阳市', + 430482: '常宁市', + 430502: '双清区', + 430503: '大祥区', + 430511: '北塔区', + 430521: '邵东县', + 430522: '新邵县', + 430523: '邵阳县', + 430524: '隆回县', + 430525: '洞口县', + 430527: '绥宁县', + 430528: '新宁县', + 430529: '城步苗族自治县', + 430581: '武冈市', + 430602: '岳阳楼区', + 430603: '云溪区', + 430611: '君山区', + 430621: '岳阳县', + 430623: '华容县', + 430624: '湘阴县', + 430626: '平江县', + 430681: '汨罗市', + 430682: '临湘市', + 430702: '武陵区', + 430703: '鼎城区', + 430721: '安乡县', + 430722: '汉寿县', + 430723: '澧县', + 430724: '临澧县', + 430725: '桃源县', + 430726: '石门县', + 430781: '津市市', + 430802: '永定区', + 430811: '武陵源区', + 430821: '慈利县', + 430822: '桑植县', + 430902: '资阳区', + 430903: '赫山区', + 430921: '南县', + 430922: '桃江县', + 430923: '安化县', + 430981: '沅江市', + 431002: '北湖区', + 431003: '苏仙区', + 431021: '桂阳县', + 431022: '宜章县', + 431023: '永兴县', + 431024: '嘉禾县', + 431025: '临武县', + 431026: '汝城县', + 431027: '桂东县', + 431028: '安仁县', + 431081: '资兴市', + 431102: '零陵区', + 431103: '冷水滩区', + 431121: '祁阳县', + 431122: '东安县', + 431123: '双牌县', + 431124: '道县', + 431125: '江永县', + 431126: '宁远县', + 431127: '蓝山县', + 431128: '新田县', + 431129: '江华瑶族自治县', + 431202: '鹤城区', + 431221: '中方县', + 431222: '沅陵县', + 431223: '辰溪县', + 431224: '溆浦县', + 431225: '会同县', + 431226: '麻阳苗族自治县', + 431227: '新晃侗族自治县', + 431228: '芷江侗族自治县', + 431229: '靖州苗族侗族自治县', + 431230: '通道侗族自治县', + 431281: '洪江市', + 431302: '娄星区', + 431321: '双峰县', + 431322: '新化县', + 431381: '冷水江市', + 431382: '涟源市', + 433101: '吉首市', + 433122: '泸溪县', + 433123: '凤凰县', + 433124: '花垣县', + 433125: '保靖县', + 433126: '古丈县', + 433127: '永顺县', + 433130: '龙山县', + 440103: '荔湾区', + 440104: '越秀区', + 440105: '海珠区', + 440106: '天河区', + 440111: '白云区', + 440112: '黄埔区', + 440113: '番禺区', + 440114: '花都区', + 440115: '南沙区', + 440117: '从化区', + 440118: '增城区', + 440203: '武江区', + 440204: '浈江区', + 440205: '曲江区', + 440222: '始兴县', + 440224: '仁化县', + 440229: '翁源县', + 440232: '乳源瑶族自治县', + 440233: '新丰县', + 440281: '乐昌市', + 440282: '南雄市', + 440303: '罗湖区', + 440304: '福田区', + 440305: '南山区', + 440306: '宝安区', + 440307: '龙岗区', + 440308: '盐田区', + 440309: '龙华区', + 440310: '坪山区', + 440402: '香洲区', + 440403: '斗门区', + 440404: '金湾区', + 440507: '龙湖区', + 440511: '金平区', + 440512: '濠江区', + 440513: '潮阳区', + 440514: '潮南区', + 440515: '澄海区', + 440523: '南澳县', + 440604: '禅城区', + 440605: '南海区', + 440606: '顺德区', + 440607: '三水区', + 440608: '高明区', + 440703: '蓬江区', + 440704: '江海区', + 440705: '新会区', + 440781: '台山市', + 440783: '开平市', + 440784: '鹤山市', + 440785: '恩平市', + 440802: '赤坎区', + 440803: '霞山区', + 440804: '坡头区', + 440811: '麻章区', + 440823: '遂溪县', + 440825: '徐闻县', + 440881: '廉江市', + 440882: '雷州市', + 440883: '吴川市', + 440890: '经济技术开发区', + 440902: '茂南区', + 440904: '电白区', + 440981: '高州市', + 440982: '化州市', + 440983: '信宜市', + 441202: '端州区', + 441203: '鼎湖区', + 441204: '高要区', + 441223: '广宁县', + 441224: '怀集县', + 441225: '封开县', + 441226: '德庆县', + 441284: '四会市', + 441302: '惠城区', + 441303: '惠阳区', + 441322: '博罗县', + 441323: '惠东县', + 441324: '龙门县', + 441402: '梅江区', + 441403: '梅县区', + 441422: '大埔县', + 441423: '丰顺县', + 441424: '五华县', + 441426: '平远县', + 441427: '蕉岭县', + 441481: '兴宁市', + 441502: '城区', + 441521: '海丰县', + 441523: '陆河县', + 441581: '陆丰市', + 441602: '源城区', + 441621: '紫金县', + 441622: '龙川县', + 441623: '连平县', + 441624: '和平县', + 441625: '东源县', + 441702: '江城区', + 441704: '阳东区', + 441721: '阳西县', + 441781: '阳春市', + 441802: '清城区', + 441803: '清新区', + 441821: '佛冈县', + 441823: '阳山县', + 441825: '连山壮族瑶族自治县', + 441826: '连南瑶族自治县', + 441881: '英德市', + 441882: '连州市', + 441901: '中堂镇', + 441903: '南城区', + 441904: '长安镇', + 441905: '东坑镇', + 441906: '樟木头镇', + 441907: '莞城区', + 441908: '石龙镇', + 441909: '桥头镇', + 441910: '万江区', + 441911: '麻涌镇', + 441912: '虎门镇', + 441913: '谢岗镇', + 441914: '石碣镇', + 441915: '茶山镇', + 441916: '东城区', + 441917: '洪梅镇', + 441918: '道滘镇', + 441919: '高埗镇', + 441920: '企石镇', + 441921: '凤岗镇', + 441922: '大岭山镇', + 441923: '松山湖', + 441924: '清溪镇', + 441925: '望牛墩镇', + 441926: '厚街镇', + 441927: '常平镇', + 441928: '寮步镇', + 441929: '石排镇', + 441930: '横沥镇', + 441931: '塘厦镇', + 441932: '黄江镇', + 441933: '大朗镇', + 441990: '沙田镇', + 442001: '南头镇', + 442002: '神湾镇', + 442003: '东凤镇', + 442004: '五桂山镇', + 442005: '黄圃镇', + 442006: '小榄镇', + 442007: '石岐区街道', + 442008: '横栏镇', + 442009: '三角镇', + 442010: '三乡镇', + 442011: '港口镇', + 442012: '沙溪镇', + 442013: '板芙镇', + 442014: '沙朗镇', + 442015: '东升镇', + 442016: '阜沙镇', + 442017: '民众镇', + 442018: '东区街道', + 442019: '火炬开发区', + 442020: '西区街道', + 442021: '南区街道', + 442022: '古镇', + 442023: '坦洲镇', + 442024: '大涌镇', + 442025: '南朗镇', + 445102: '湘桥区', + 445103: '潮安区', + 445122: '饶平县', + 445202: '榕城区', + 445203: '揭东区', + 445222: '揭西县', + 445224: '惠来县', + 445281: '普宁市', + 445302: '云城区', + 445303: '云安区', + 445321: '新兴县', + 445322: '郁南县', + 445381: '罗定市', + 450102: '兴宁区', + 450103: '青秀区', + 450105: '江南区', + 450107: '西乡塘区', + 450108: '良庆区', + 450109: '邕宁区', + 450110: '武鸣区', + 450123: '隆安县', + 450124: '马山县', + 450125: '上林县', + 450126: '宾阳县', + 450127: '横县', + 450202: '城中区', + 450203: '鱼峰区', + 450204: '柳南区', + 450205: '柳北区', + 450206: '柳江区', + 450222: '柳城县', + 450223: '鹿寨县', + 450224: '融安县', + 450225: '融水苗族自治县', + 450226: '三江侗族自治县', + 450302: '秀峰区', + 450303: '叠彩区', + 450304: '象山区', + 450305: '七星区', + 450311: '雁山区', + 450312: '临桂区', + 450321: '阳朔县', + 450323: '灵川县', + 450324: '全州县', + 450325: '兴安县', + 450326: '永福县', + 450327: '灌阳县', + 450328: '龙胜各族自治县', + 450329: '资源县', + 450330: '平乐县', + 450331: '荔浦县', + 450332: '恭城瑶族自治县', + 450403: '万秀区', + 450405: '长洲区', + 450406: '龙圩区', + 450421: '苍梧县', + 450422: '藤县', + 450423: '蒙山县', + 450481: '岑溪市', + 450502: '海城区', + 450503: '银海区', + 450512: '铁山港区', + 450521: '合浦县', + 450602: '港口区', + 450603: '防城区', + 450621: '上思县', + 450681: '东兴市', + 450702: '钦南区', + 450703: '钦北区', + 450721: '灵山县', + 450722: '浦北县', + 450802: '港北区', + 450803: '港南区', + 450804: '覃塘区', + 450821: '平南县', + 450881: '桂平市', + 450902: '玉州区', + 450903: '福绵区', + 450921: '容县', + 450922: '陆川县', + 450923: '博白县', + 450924: '兴业县', + 450981: '北流市', + 451002: '右江区', + 451021: '田阳县', + 451022: '田东县', + 451023: '平果县', + 451024: '德保县', + 451026: '那坡县', + 451027: '凌云县', + 451028: '乐业县', + 451029: '田林县', + 451030: '西林县', + 451031: '隆林各族自治县', + 451081: '靖西市', + 451102: '八步区', + 451103: '平桂区', + 451121: '昭平县', + 451122: '钟山县', + 451123: '富川瑶族自治县', + 451202: '金城江区', + 451203: '宜州区', + 451221: '南丹县', + 451222: '天峨县', + 451223: '凤山县', + 451224: '东兰县', + 451225: '罗城仫佬族自治县', + 451226: '环江毛南族自治县', + 451227: '巴马瑶族自治县', + 451228: '都安瑶族自治县', + 451229: '大化瑶族自治县', + 451302: '兴宾区', + 451321: '忻城县', + 451322: '象州县', + 451323: '武宣县', + 451324: '金秀瑶族自治县', + 451381: '合山市', + 451402: '江州区', + 451421: '扶绥县', + 451422: '宁明县', + 451423: '龙州县', + 451424: '大新县', + 451425: '天等县', + 451481: '凭祥市', + 460105: '秀英区', + 460106: '龙华区', + 460107: '琼山区', + 460108: '美兰区', + 460202: '海棠区', + 460203: '吉阳区', + 460204: '天涯区', + 460205: '崖州区', + 460321: '西沙群岛', + 460322: '南沙群岛', + 460323: '中沙群岛的岛礁及其海域', + 460401: '那大镇', + 460402: '和庆镇', + 460403: '南丰镇', + 460404: '大成镇', + 460405: '雅星镇', + 460406: '兰洋镇', + 460407: '光村镇', + 460408: '木棠镇', + 460409: '海头镇', + 460410: '峨蔓镇', + 460411: '王五镇', + 460412: '白马井镇', + 460413: '中和镇', + 460414: '排浦镇', + 460415: '东成镇', + 460416: '新州镇', + 469001: '五指山市', + 469002: '琼海市', + 469005: '文昌市', + 469006: '万宁市', + 469007: '东方市', + 469021: '定安县', + 469022: '屯昌县', + 469023: '澄迈县', + 469024: '临高县', + 469025: '白沙黎族自治县', + 469026: '昌江黎族自治县', + 469027: '乐东黎族自治县', + 469028: '陵水黎族自治县', + 469029: '保亭黎族苗族自治县', + 469030: '琼中黎族苗族自治县', + 500101: '万州区', + 500102: '涪陵区', + 500103: '渝中区', + 500104: '大渡口区', + 500105: '江北区', + 500106: '沙坪坝区', + 500107: '九龙坡区', + 500108: '南岸区', + 500109: '北碚区', + 500110: '綦江区', + 500111: '大足区', + 500112: '渝北区', + 500113: '巴南区', + 500114: '黔江区', + 500115: '长寿区', + 500116: '江津区', + 500117: '合川区', + 500118: '永川区', + 500119: '南川区', + 500120: '璧山区', + 500151: '铜梁区', + 500152: '潼南区', + 500153: '荣昌区', + 500154: '开州区', + 500155: '梁平区', + 500156: '武隆区', + 500229: '城口县', + 500230: '丰都县', + 500231: '垫江县', + 500233: '忠县', + 500235: '云阳县', + 500236: '奉节县', + 500237: '巫山县', + 500238: '巫溪县', + 500240: '石柱土家族自治县', + 500241: '秀山土家族苗族自治县', + 500242: '酉阳土家族苗族自治县', + 500243: '彭水苗族土家族自治县', + 510104: '锦江区', + 510105: '青羊区', + 510106: '金牛区', + 510107: '武侯区', + 510108: '成华区', + 510112: '龙泉驿区', + 510113: '青白江区', + 510114: '新都区', + 510115: '温江区', + 510116: '双流区', + 510117: '郫都区', + 510121: '金堂县', + 510129: '大邑县', + 510131: '蒲江县', + 510132: '新津县', + 510181: '都江堰市', + 510182: '彭州市', + 510183: '邛崃市', + 510184: '崇州市', + 510185: '简阳市', + 510191: '高新区', + 510302: '自流井区', + 510303: '贡井区', + 510304: '大安区', + 510311: '沿滩区', + 510321: '荣县', + 510322: '富顺县', + 510402: '东区', + 510403: '西区', + 510411: '仁和区', + 510421: '米易县', + 510422: '盐边县', + 510502: '江阳区', + 510503: '纳溪区', + 510504: '龙马潭区', + 510521: '泸县', + 510522: '合江县', + 510524: '叙永县', + 510525: '古蔺县', + 510603: '旌阳区', + 510604: '罗江区', + 510623: '中江县', + 510681: '广汉市', + 510682: '什邡市', + 510683: '绵竹市', + 510703: '涪城区', + 510704: '游仙区', + 510705: '安州区', + 510722: '三台县', + 510723: '盐亭县', + 510725: '梓潼县', + 510726: '北川羌族自治县', + 510727: '平武县', + 510781: '江油市', + 510791: '高新区', + 510802: '利州区', + 510811: '昭化区', + 510812: '朝天区', + 510821: '旺苍县', + 510822: '青川县', + 510823: '剑阁县', + 510824: '苍溪县', + 510903: '船山区', + 510904: '安居区', + 510921: '蓬溪县', + 510922: '射洪县', + 510923: '大英县', + 511002: '市中区', + 511011: '东兴区', + 511024: '威远县', + 511025: '资中县', + 511083: '隆昌市', + 511102: '市中区', + 511111: '沙湾区', + 511112: '五通桥区', + 511113: '金口河区', + 511123: '犍为县', + 511124: '井研县', + 511126: '夹江县', + 511129: '沐川县', + 511132: '峨边彝族自治县', + 511133: '马边彝族自治县', + 511181: '峨眉山市', + 511302: '顺庆区', + 511303: '高坪区', + 511304: '嘉陵区', + 511321: '南部县', + 511322: '营山县', + 511323: '蓬安县', + 511324: '仪陇县', + 511325: '西充县', + 511381: '阆中市', + 511402: '东坡区', + 511403: '彭山区', + 511421: '仁寿县', + 511423: '洪雅县', + 511424: '丹棱县', + 511425: '青神县', + 511502: '翠屏区', + 511503: '南溪区', + 511521: '宜宾县', + 511523: '江安县', + 511524: '长宁县', + 511525: '高县', + 511526: '珙县', + 511527: '筠连县', + 511528: '兴文县', + 511529: '屏山县', + 511602: '广安区', + 511603: '前锋区', + 511621: '岳池县', + 511622: '武胜县', + 511623: '邻水县', + 511681: '华蓥市', + 511702: '通川区', + 511703: '达川区', + 511722: '宣汉县', + 511723: '开江县', + 511724: '大竹县', + 511725: '渠县', + 511781: '万源市', + 511802: '雨城区', + 511803: '名山区', + 511822: '荥经县', + 511823: '汉源县', + 511824: '石棉县', + 511825: '天全县', + 511826: '芦山县', + 511827: '宝兴县', + 511902: '巴州区', + 511903: '恩阳区', + 511921: '通江县', + 511922: '南江县', + 511923: '平昌县', + 512002: '雁江区', + 512021: '安岳县', + 512022: '乐至县', + 513201: '马尔康市', + 513221: '汶川县', + 513222: '理县', + 513223: '茂县', + 513224: '松潘县', + 513225: '九寨沟县', + 513226: '金川县', + 513227: '小金县', + 513228: '黑水县', + 513230: '壤塘县', + 513231: '阿坝县', + 513232: '若尔盖县', + 513233: '红原县', + 513301: '康定市', + 513322: '泸定县', + 513323: '丹巴县', + 513324: '九龙县', + 513325: '雅江县', + 513326: '道孚县', + 513327: '炉霍县', + 513328: '甘孜县', + 513329: '新龙县', + 513330: '德格县', + 513331: '白玉县', + 513332: '石渠县', + 513333: '色达县', + 513334: '理塘县', + 513335: '巴塘县', + 513336: '乡城县', + 513337: '稻城县', + 513338: '得荣县', + 513401: '西昌市', + 513422: '木里藏族自治县', + 513423: '盐源县', + 513424: '德昌县', + 513425: '会理县', + 513426: '会东县', + 513427: '宁南县', + 513428: '普格县', + 513429: '布拖县', + 513430: '金阳县', + 513431: '昭觉县', + 513432: '喜德县', + 513433: '冕宁县', + 513434: '越西县', + 513435: '甘洛县', + 513436: '美姑县', + 513437: '雷波县', + 520102: '南明区', + 520103: '云岩区', + 520111: '花溪区', + 520112: '乌当区', + 520113: '白云区', + 520115: '观山湖区', + 520121: '开阳县', + 520122: '息烽县', + 520123: '修文县', + 520181: '清镇市', + 520201: '钟山区', + 520203: '六枝特区', + 520221: '水城县', + 520281: '盘州市', + 520302: '红花岗区', + 520303: '汇川区', + 520304: '播州区', + 520322: '桐梓县', + 520323: '绥阳县', + 520324: '正安县', + 520325: '道真仡佬族苗族自治县', + 520326: '务川仡佬族苗族自治县', + 520327: '凤冈县', + 520328: '湄潭县', + 520329: '余庆县', + 520330: '习水县', + 520381: '赤水市', + 520382: '仁怀市', + 520402: '西秀区', + 520403: '平坝区', + 520422: '普定县', + 520423: '镇宁布依族苗族自治县', + 520424: '关岭布依族苗族自治县', + 520425: '紫云苗族布依族自治县', + 520502: '七星关区', + 520521: '大方县', + 520522: '黔西县', + 520523: '金沙县', + 520524: '织金县', + 520525: '纳雍县', + 520526: '威宁彝族回族苗族自治县', + 520527: '赫章县', + 520602: '碧江区', + 520603: '万山区', + 520621: '江口县', + 520622: '玉屏侗族自治县', + 520623: '石阡县', + 520624: '思南县', + 520625: '印江土家族苗族自治县', + 520626: '德江县', + 520627: '沿河土家族自治县', + 520628: '松桃苗族自治县', + 522301: '兴义市', + 522322: '兴仁县', + 522323: '普安县', + 522324: '晴隆县', + 522325: '贞丰县', + 522326: '望谟县', + 522327: '册亨县', + 522328: '安龙县', + 522601: '凯里市', + 522622: '黄平县', + 522623: '施秉县', + 522624: '三穗县', + 522625: '镇远县', + 522626: '岑巩县', + 522627: '天柱县', + 522628: '锦屏县', + 522629: '剑河县', + 522630: '台江县', + 522631: '黎平县', + 522632: '榕江县', + 522633: '从江县', + 522634: '雷山县', + 522635: '麻江县', + 522636: '丹寨县', + 522701: '都匀市', + 522702: '福泉市', + 522722: '荔波县', + 522723: '贵定县', + 522725: '瓮安县', + 522726: '独山县', + 522727: '平塘县', + 522728: '罗甸县', + 522729: '长顺县', + 522730: '龙里县', + 522731: '惠水县', + 522732: '三都水族自治县', + 530102: '五华区', + 530103: '盘龙区', + 530111: '官渡区', + 530112: '西山区', + 530113: '东川区', + 530114: '呈贡区', + 530115: '晋宁区', + 530124: '富民县', + 530125: '宜良县', + 530126: '石林彝族自治县', + 530127: '嵩明县', + 530128: '禄劝彝族苗族自治县', + 530129: '寻甸回族彝族自治县', + 530181: '安宁市', + 530302: '麒麟区', + 530303: '沾益区', + 530321: '马龙县', + 530322: '陆良县', + 530323: '师宗县', + 530324: '罗平县', + 530325: '富源县', + 530326: '会泽县', + 530381: '宣威市', + 530402: '红塔区', + 530403: '江川区', + 530422: '澄江县', + 530423: '通海县', + 530424: '华宁县', + 530425: '易门县', + 530426: '峨山彝族自治县', + 530427: '新平彝族傣族自治县', + 530428: '元江哈尼族彝族傣族自治县', + 530502: '隆阳区', + 530521: '施甸县', + 530523: '龙陵县', + 530524: '昌宁县', + 530581: '腾冲市', + 530602: '昭阳区', + 530621: '鲁甸县', + 530622: '巧家县', + 530623: '盐津县', + 530624: '大关县', + 530625: '永善县', + 530626: '绥江县', + 530627: '镇雄县', + 530628: '彝良县', + 530629: '威信县', + 530630: '水富县', + 530702: '古城区', + 530721: '玉龙纳西族自治县', + 530722: '永胜县', + 530723: '华坪县', + 530724: '宁蒗彝族自治县', + 530802: '思茅区', + 530821: '宁洱哈尼族彝族自治县', + 530822: '墨江哈尼族自治县', + 530823: '景东彝族自治县', + 530824: '景谷傣族彝族自治县', + 530825: '镇沅彝族哈尼族拉祜族自治县', + 530826: '江城哈尼族彝族自治县', + 530827: '孟连傣族拉祜族佤族自治县', + 530828: '澜沧拉祜族自治县', + 530829: '西盟佤族自治县', + 530902: '临翔区', + 530921: '凤庆县', + 530922: '云县', + 530923: '永德县', + 530924: '镇康县', + 530925: '双江拉祜族佤族布朗族傣族自治县', + 530926: '耿马傣族佤族自治县', + 530927: '沧源佤族自治县', + 532301: '楚雄市', + 532322: '双柏县', + 532323: '牟定县', + 532324: '南华县', + 532325: '姚安县', + 532326: '大姚县', + 532327: '永仁县', + 532328: '元谋县', + 532329: '武定县', + 532331: '禄丰县', + 532501: '个旧市', + 532502: '开远市', + 532503: '蒙自市', + 532504: '弥勒市', + 532523: '屏边苗族自治县', + 532524: '建水县', + 532525: '石屏县', + 532527: '泸西县', + 532528: '元阳县', + 532529: '红河县', + 532530: '金平苗族瑶族傣族自治县', + 532531: '绿春县', + 532532: '河口瑶族自治县', + 532601: '文山市', + 532622: '砚山县', + 532623: '西畴县', + 532624: '麻栗坡县', + 532625: '马关县', + 532626: '丘北县', + 532627: '广南县', + 532628: '富宁县', + 532801: '景洪市', + 532822: '勐海县', + 532823: '勐腊县', + 532901: '大理市', + 532922: '漾濞彝族自治县', + 532923: '祥云县', + 532924: '宾川县', + 532925: '弥渡县', + 532926: '南涧彝族自治县', + 532927: '巍山彝族回族自治县', + 532928: '永平县', + 532929: '云龙县', + 532930: '洱源县', + 532931: '剑川县', + 532932: '鹤庆县', + 533102: '瑞丽市', + 533103: '芒市', + 533122: '梁河县', + 533123: '盈江县', + 533124: '陇川县', + 533301: '泸水市', + 533323: '福贡县', + 533324: '贡山独龙族怒族自治县', + 533325: '兰坪白族普米族自治县', + 533401: '香格里拉市', + 533422: '德钦县', + 533423: '维西傈僳族自治县', + 540102: '城关区', + 540103: '堆龙德庆区', + 540104: '达孜区', + 540121: '林周县', + 540122: '当雄县', + 540123: '尼木县', + 540124: '曲水县', + 540127: '墨竹工卡县', + 540202: '桑珠孜区', + 540221: '南木林县', + 540222: '江孜县', + 540223: '定日县', + 540224: '萨迦县', + 540225: '拉孜县', + 540226: '昂仁县', + 540227: '谢通门县', + 540228: '白朗县', + 540229: '仁布县', + 540230: '康马县', + 540231: '定结县', + 540232: '仲巴县', + 540233: '亚东县', + 540234: '吉隆县', + 540235: '聂拉木县', + 540236: '萨嘎县', + 540237: '岗巴县', + 540302: '卡若区', + 540321: '江达县', + 540322: '贡觉县', + 540323: '类乌齐县', + 540324: '丁青县', + 540325: '察雅县', + 540326: '八宿县', + 540327: '左贡县', + 540328: '芒康县', + 540329: '洛隆县', + 540330: '边坝县', + 540402: '巴宜区', + 540421: '工布江达县', + 540422: '米林县', + 540423: '墨脱县', + 540424: '波密县', + 540425: '察隅县', + 540426: '朗县', + 540502: '乃东区', + 540521: '扎囊县', + 540522: '贡嘎县', + 540523: '桑日县', + 540524: '琼结县', + 540525: '曲松县', + 540526: '措美县', + 540527: '洛扎县', + 540528: '加查县', + 540529: '隆子县', + 540530: '错那县', + 540531: '浪卡子县', + 540602: '色尼区', + 542421: '那曲县', + 542422: '嘉黎县', + 542423: '比如县', + 542424: '聂荣县', + 542425: '安多县', + 542426: '申扎县', + 542427: '索县', + 542428: '班戈县', + 542429: '巴青县', + 542430: '尼玛县', + 542431: '双湖县', + 542521: '普兰县', + 542522: '札达县', + 542523: '噶尔县', + 542524: '日土县', + 542525: '革吉县', + 542526: '改则县', + 542527: '措勤县', + 610102: '新城区', + 610103: '碑林区', + 610104: '莲湖区', + 610111: '灞桥区', + 610112: '未央区', + 610113: '雁塔区', + 610114: '阎良区', + 610115: '临潼区', + 610116: '长安区', + 610117: '高陵区', + 610118: '鄠邑区', + 610122: '蓝田县', + 610124: '周至县', + 610202: '王益区', + 610203: '印台区', + 610204: '耀州区', + 610222: '宜君县', + 610302: '渭滨区', + 610303: '金台区', + 610304: '陈仓区', + 610322: '凤翔县', + 610323: '岐山县', + 610324: '扶风县', + 610326: '眉县', + 610327: '陇县', + 610328: '千阳县', + 610329: '麟游县', + 610330: '凤县', + 610331: '太白县', + 610402: '秦都区', + 610403: '杨陵区', + 610404: '渭城区', + 610422: '三原县', + 610423: '泾阳县', + 610424: '乾县', + 610425: '礼泉县', + 610426: '永寿县', + 610427: '彬县', + 610428: '长武县', + 610429: '旬邑县', + 610430: '淳化县', + 610431: '武功县', + 610481: '兴平市', + 610502: '临渭区', + 610503: '华州区', + 610522: '潼关县', + 610523: '大荔县', + 610524: '合阳县', + 610525: '澄城县', + 610526: '蒲城县', + 610527: '白水县', + 610528: '富平县', + 610581: '韩城市', + 610582: '华阴市', + 610602: '宝塔区', + 610603: '安塞区', + 610621: '延长县', + 610622: '延川县', + 610623: '子长县', + 610625: '志丹县', + 610626: '吴起县', + 610627: '甘泉县', + 610628: '富县', + 610629: '洛川县', + 610630: '宜川县', + 610631: '黄龙县', + 610632: '黄陵县', + 610702: '汉台区', + 610703: '南郑区', + 610722: '城固县', + 610723: '洋县', + 610724: '西乡县', + 610725: '勉县', + 610726: '宁强县', + 610727: '略阳县', + 610728: '镇巴县', + 610729: '留坝县', + 610730: '佛坪县', + 610802: '榆阳区', + 610803: '横山区', + 610822: '府谷县', + 610824: '靖边县', + 610825: '定边县', + 610826: '绥德县', + 610827: '米脂县', + 610828: '佳县', + 610829: '吴堡县', + 610830: '清涧县', + 610831: '子洲县', + 610881: '神木市', + 610902: '汉滨区', + 610921: '汉阴县', + 610922: '石泉县', + 610923: '宁陕县', + 610924: '紫阳县', + 610925: '岚皋县', + 610926: '平利县', + 610927: '镇坪县', + 610928: '旬阳县', + 610929: '白河县', + 611002: '商州区', + 611021: '洛南县', + 611022: '丹凤县', + 611023: '商南县', + 611024: '山阳县', + 611025: '镇安县', + 611026: '柞水县', + 620102: '城关区', + 620103: '七里河区', + 620104: '西固区', + 620105: '安宁区', + 620111: '红古区', + 620121: '永登县', + 620122: '皋兰县', + 620123: '榆中县', + 620201: '市辖区', + 620290: '雄关区', + 620291: '长城区', + 620292: '镜铁区', + 620293: '新城镇', + 620294: '峪泉镇', + 620295: '文殊镇', + 620302: '金川区', + 620321: '永昌县', + 620402: '白银区', + 620403: '平川区', + 620421: '靖远县', + 620422: '会宁县', + 620423: '景泰县', + 620502: '秦州区', + 620503: '麦积区', + 620521: '清水县', + 620522: '秦安县', + 620523: '甘谷县', + 620524: '武山县', + 620525: '张家川回族自治县', + 620602: '凉州区', + 620621: '民勤县', + 620622: '古浪县', + 620623: '天祝藏族自治县', + 620702: '甘州区', + 620721: '肃南裕固族自治县', + 620722: '民乐县', + 620723: '临泽县', + 620724: '高台县', + 620725: '山丹县', + 620802: '崆峒区', + 620821: '泾川县', + 620822: '灵台县', + 620823: '崇信县', + 620824: '华亭县', + 620825: '庄浪县', + 620826: '静宁县', + 620902: '肃州区', + 620921: '金塔县', + 620922: '瓜州县', + 620923: '肃北蒙古族自治县', + 620924: '阿克塞哈萨克族自治县', + 620981: '玉门市', + 620982: '敦煌市', + 621002: '西峰区', + 621021: '庆城县', + 621022: '环县', + 621023: '华池县', + 621024: '合水县', + 621025: '正宁县', + 621026: '宁县', + 621027: '镇原县', + 621102: '安定区', + 621121: '通渭县', + 621122: '陇西县', + 621123: '渭源县', + 621124: '临洮县', + 621125: '漳县', + 621126: '岷县', + 621202: '武都区', + 621221: '成县', + 621222: '文县', + 621223: '宕昌县', + 621224: '康县', + 621225: '西和县', + 621226: '礼县', + 621227: '徽县', + 621228: '两当县', + 622901: '临夏市', + 622921: '临夏县', + 622922: '康乐县', + 622923: '永靖县', + 622924: '广河县', + 622925: '和政县', + 622926: '东乡族自治县', + 622927: '积石山保安族东乡族撒拉族自治县', + 623001: '合作市', + 623021: '临潭县', + 623022: '卓尼县', + 623023: '舟曲县', + 623024: '迭部县', + 623025: '玛曲县', + 623026: '碌曲县', + 623027: '夏河县', + 630102: '城东区', + 630103: '城中区', + 630104: '城西区', + 630105: '城北区', + 630121: '大通回族土族自治县', + 630122: '湟中县', + 630123: '湟源县', + 630202: '乐都区', + 630203: '平安区', + 630222: '民和回族土族自治县', + 630223: '互助土族自治县', + 630224: '化隆回族自治县', + 630225: '循化撒拉族自治县', + 632221: '门源回族自治县', + 632222: '祁连县', + 632223: '海晏县', + 632224: '刚察县', + 632321: '同仁县', + 632322: '尖扎县', + 632323: '泽库县', + 632324: '河南蒙古族自治县', + 632521: '共和县', + 632522: '同德县', + 632523: '贵德县', + 632524: '兴海县', + 632525: '贵南县', + 632621: '玛沁县', + 632622: '班玛县', + 632623: '甘德县', + 632624: '达日县', + 632625: '久治县', + 632626: '玛多县', + 632701: '玉树市', + 632722: '杂多县', + 632723: '称多县', + 632724: '治多县', + 632725: '囊谦县', + 632726: '曲麻莱县', + 632801: '格尔木市', + 632802: '德令哈市', + 632821: '乌兰县', + 632822: '都兰县', + 632823: '天峻县', + 640104: '兴庆区', + 640105: '西夏区', + 640106: '金凤区', + 640121: '永宁县', + 640122: '贺兰县', + 640181: '灵武市', + 640202: '大武口区', + 640205: '惠农区', + 640221: '平罗县', + 640302: '利通区', + 640303: '红寺堡区', + 640323: '盐池县', + 640324: '同心县', + 640381: '青铜峡市', + 640402: '原州区', + 640422: '西吉县', + 640423: '隆德县', + 640424: '泾源县', + 640425: '彭阳县', + 640502: '沙坡头区', + 640521: '中宁县', + 640522: '海原县', + 650102: '天山区', + 650103: '沙依巴克区', + 650104: '新市区', + 650105: '水磨沟区', + 650106: '头屯河区', + 650107: '达坂城区', + 650109: '米东区', + 650121: '乌鲁木齐县', + 650202: '独山子区', + 650203: '克拉玛依区', + 650204: '白碱滩区', + 650205: '乌尔禾区', + 650402: '高昌区', + 650421: '鄯善县', + 650422: '托克逊县', + 650502: '伊州区', + 650521: '巴里坤哈萨克自治县', + 650522: '伊吾县', + 652301: '昌吉市', + 652302: '阜康市', + 652323: '呼图壁县', + 652324: '玛纳斯县', + 652325: '奇台县', + 652327: '吉木萨尔县', + 652328: '木垒哈萨克自治县', + 652701: '博乐市', + 652702: '阿拉山口市', + 652722: '精河县', + 652723: '温泉县', + 652801: '库尔勒市', + 652822: '轮台县', + 652823: '尉犁县', + 652824: '若羌县', + 652825: '且末县', + 652826: '焉耆回族自治县', + 652827: '和静县', + 652828: '和硕县', + 652829: '博湖县', + 652901: '阿克苏市', + 652922: '温宿县', + 652923: '库车县', + 652924: '沙雅县', + 652925: '新和县', + 652926: '拜城县', + 652927: '乌什县', + 652928: '阿瓦提县', + 652929: '柯坪县', + 653001: '阿图什市', + 653022: '阿克陶县', + 653023: '阿合奇县', + 653024: '乌恰县', + 653101: '喀什市', + 653121: '疏附县', + 653122: '疏勒县', + 653123: '英吉沙县', + 653124: '泽普县', + 653125: '莎车县', + 653126: '叶城县', + 653127: '麦盖提县', + 653128: '岳普湖县', + 653129: '伽师县', + 653130: '巴楚县', + 653131: '塔什库尔干塔吉克自治县', + 653201: '和田市', + 653221: '和田县', + 653222: '墨玉县', + 653223: '皮山县', + 653224: '洛浦县', + 653225: '策勒县', + 653226: '于田县', + 653227: '民丰县', + 654002: '伊宁市', + 654003: '奎屯市', + 654004: '霍尔果斯市', + 654021: '伊宁县', + 654022: '察布查尔锡伯自治县', + 654023: '霍城县', + 654024: '巩留县', + 654025: '新源县', + 654026: '昭苏县', + 654027: '特克斯县', + 654028: '尼勒克县', + 654201: '塔城市', + 654202: '乌苏市', + 654221: '额敏县', + 654223: '沙湾县', + 654224: '托里县', + 654225: '裕民县', + 654226: '和布克赛尔蒙古自治县', + 654301: '阿勒泰市', + 654321: '布尔津县', + 654322: '富蕴县', + 654323: '福海县', + 654324: '哈巴河县', + 654325: '青河县', + 654326: '吉木乃县', + 659001: '石河子市', + 659002: '阿拉尔市', + 659003: '图木舒克市', + 659004: '五家渠市', + 659005: '北屯市', + 659006: '铁门关市', + 659007: '双河市', + 659008: '可克达拉市', + 659009: '昆玉市', + 710101: '中正区', + 710102: '大同区', + 710103: '中山区', + 710104: '松山区', + 710105: '大安区', + 710106: '万华区', + 710107: '信义区', + 710108: '士林区', + 710109: '北投区', + 710110: '内湖区', + 710111: '南港区', + 710112: '文山区', + 710199: '其它区', + 710201: '新兴区', + 710202: '前金区', + 710203: '芩雅区', + 710204: '盐埕区', + 710205: '鼓山区', + 710206: '旗津区', + 710207: '前镇区', + 710208: '三民区', + 710209: '左营区', + 710210: '楠梓区', + 710211: '小港区', + 710241: '苓雅区', + 710242: '仁武区', + 710243: '大社区', + 710244: '冈山区', + 710245: '路竹区', + 710246: '阿莲区', + 710247: '田寮区', + 710248: '燕巢区', + 710249: '桥头区', + 710250: '梓官区', + 710251: '弥陀区', + 710252: '永安区', + 710253: '湖内区', + 710254: '凤山区', + 710255: '大寮区', + 710256: '林园区', + 710257: '鸟松区', + 710258: '大树区', + 710259: '旗山区', + 710260: '美浓区', + 710261: '六龟区', + 710262: '内门区', + 710263: '杉林区', + 710264: '甲仙区', + 710265: '桃源区', + 710266: '那玛夏区', + 710267: '茂林区', + 710268: '茄萣区', + 710299: '其它区', + 710301: '中西区', + 710302: '东区', + 710303: '南区', + 710304: '北区', + 710305: '安平区', + 710306: '安南区', + 710339: '永康区', + 710340: '归仁区', + 710341: '新化区', + 710342: '左镇区', + 710343: '玉井区', + 710344: '楠西区', + 710345: '南化区', + 710346: '仁德区', + 710347: '关庙区', + 710348: '龙崎区', + 710349: '官田区', + 710350: '麻豆区', + 710351: '佳里区', + 710352: '西港区', + 710353: '七股区', + 710354: '将军区', + 710355: '学甲区', + 710356: '北门区', + 710357: '新营区', + 710358: '后壁区', + 710359: '白河区', + 710360: '东山区', + 710361: '六甲区', + 710362: '下营区', + 710363: '柳营区', + 710364: '盐水区', + 710365: '善化区', + 710366: '大内区', + 710367: '山上区', + 710368: '新市区', + 710369: '安定区', + 710399: '其它区', + 710401: '中区', + 710402: '东区', + 710403: '南区', + 710404: '西区', + 710405: '北区', + 710406: '北屯区', + 710407: '西屯区', + 710408: '南屯区', + 710431: '太平区', + 710432: '大里区', + 710433: '雾峰区', + 710434: '乌日区', + 710435: '丰原区', + 710436: '后里区', + 710437: '石冈区', + 710438: '东势区', + 710439: '和平区', + 710440: '新社区', + 710441: '潭子区', + 710442: '大雅区', + 710443: '神冈区', + 710444: '大肚区', + 710445: '沙鹿区', + 710446: '龙井区', + 710447: '梧栖区', + 710448: '清水区', + 710449: '大甲区', + 710450: '外埔区', + 710451: '大安区', + 710499: '其它区', + 710507: '金沙镇', + 710508: '金湖镇', + 710509: '金宁乡', + 710510: '金城镇', + 710511: '烈屿乡', + 710512: '乌坵乡', + 710614: '南投市', + 710615: '中寮乡', + 710616: '草屯镇', + 710617: '国姓乡', + 710618: '埔里镇', + 710619: '仁爱乡', + 710620: '名间乡', + 710621: '集集镇', + 710622: '水里乡', + 710623: '鱼池乡', + 710624: '信义乡', + 710625: '竹山镇', + 710626: '鹿谷乡', + 710701: '仁爱区', + 710702: '信义区', + 710703: '中正区', + 710704: '中山区', + 710705: '安乐区', + 710706: '暖暖区', + 710707: '七堵区', + 710799: '其它区', + 710801: '东区', + 710802: '北区', + 710803: '香山区', + 710899: '其它区', + 710901: '东区', + 710902: '西区', + 710999: '其它区', + 711130: '万里区', + 711132: '板桥区', + 711133: '汐止区', + 711134: '深坑区', + 711136: '瑞芳区', + 711137: '平溪区', + 711138: '双溪区', + 711140: '新店区', + 711141: '坪林区', + 711142: '乌来区', + 711143: '永和区', + 711144: '中和区', + 711145: '土城区', + 711146: '三峡区', + 711147: '树林区', + 711149: '三重区', + 711150: '新庄区', + 711151: '泰山区', + 711152: '林口区', + 711154: '五股区', + 711155: '八里区', + 711156: '淡水区', + 711157: '三芝区', + 711287: '宜兰市', + 711288: '头城镇', + 711289: '礁溪乡', + 711290: '壮围乡', + 711291: '员山乡', + 711292: '罗东镇', + 711293: '三星乡', + 711294: '大同乡', + 711295: '五结乡', + 711296: '冬山乡', + 711297: '苏澳镇', + 711298: '南澳乡', + 711299: '钓鱼台', + 711387: '竹北市', + 711388: '湖口乡', + 711389: '新丰乡', + 711390: '新埔镇', + 711391: '关西镇', + 711392: '芎林乡', + 711393: '宝山乡', + 711394: '竹东镇', + 711395: '五峰乡', + 711396: '横山乡', + 711397: '尖石乡', + 711398: '北埔乡', + 711399: '峨眉乡', + 711487: '中坜市', + 711488: '平镇市', + 711489: '龙潭乡', + 711490: '杨梅市', + 711491: '新屋乡', + 711492: '观音乡', + 711493: '桃园市', + 711494: '龟山乡', + 711495: '八德市', + 711496: '大溪镇', + 711497: '复兴乡', + 711498: '大园乡', + 711499: '芦竹乡', + 711582: '竹南镇', + 711583: '头份镇', + 711584: '三湾乡', + 711585: '南庄乡', + 711586: '狮潭乡', + 711587: '后龙镇', + 711588: '通霄镇', + 711589: '苑里镇', + 711590: '苗栗市', + 711591: '造桥乡', + 711592: '头屋乡', + 711593: '公馆乡', + 711594: '大湖乡', + 711595: '泰安乡', + 711596: '铜锣乡', + 711597: '三义乡', + 711598: '西湖乡', + 711599: '卓兰镇', + 711774: '彰化市', + 711775: '芬园乡', + 711776: '花坛乡', + 711777: '秀水乡', + 711778: '鹿港镇', + 711779: '福兴乡', + 711780: '线西乡', + 711781: '和美镇', + 711782: '伸港乡', + 711783: '员林镇', + 711784: '社头乡', + 711785: '永靖乡', + 711786: '埔心乡', + 711787: '溪湖镇', + 711788: '大村乡', + 711789: '埔盐乡', + 711790: '田中镇', + 711791: '北斗镇', + 711792: '田尾乡', + 711793: '埤头乡', + 711794: '溪州乡', + 711795: '竹塘乡', + 711796: '二林镇', + 711797: '大城乡', + 711798: '芳苑乡', + 711799: '二水乡', + 711982: '番路乡', + 711983: '梅山乡', + 711984: '竹崎乡', + 711985: '阿里山乡', + 711986: '中埔乡', + 711987: '大埔乡', + 711988: '水上乡', + 711989: '鹿草乡', + 711990: '太保市', + 711991: '朴子市', + 711992: '东石乡', + 711993: '六脚乡', + 711994: '新港乡', + 711995: '民雄乡', + 711996: '大林镇', + 711997: '溪口乡', + 711998: '义竹乡', + 711999: '布袋镇', + 712180: '斗南镇', + 712181: '大埤乡', + 712182: '虎尾镇', + 712183: '土库镇', + 712184: '褒忠乡', + 712185: '东势乡', + 712186: '台西乡', + 712187: '仑背乡', + 712188: '麦寮乡', + 712189: '斗六市', + 712190: '林内乡', + 712191: '古坑乡', + 712192: '莿桐乡', + 712193: '西螺镇', + 712194: '二仑乡', + 712195: '北港镇', + 712196: '水林乡', + 712197: '口湖乡', + 712198: '四湖乡', + 712199: '元长乡', + 712467: '屏东市', + 712468: '三地门乡', + 712469: '雾台乡', + 712470: '玛家乡', + 712471: '九如乡', + 712472: '里港乡', + 712473: '高树乡', + 712474: '盐埔乡', + 712475: '长治乡', + 712476: '麟洛乡', + 712477: '竹田乡', + 712478: '内埔乡', + 712479: '万丹乡', + 712480: '潮州镇', + 712481: '泰武乡', + 712482: '来义乡', + 712483: '万峦乡', + 712484: '莰顶乡', + 712485: '新埤乡', + 712486: '南州乡', + 712487: '林边乡', + 712488: '东港镇', + 712489: '琉球乡', + 712490: '佳冬乡', + 712491: '新园乡', + 712492: '枋寮乡', + 712493: '枋山乡', + 712494: '春日乡', + 712495: '狮子乡', + 712496: '车城乡', + 712497: '牡丹乡', + 712498: '恒春镇', + 712499: '满州乡', + 712584: '台东市', + 712585: '绿岛乡', + 712586: '兰屿乡', + 712587: '延平乡', + 712588: '卑南乡', + 712589: '鹿野乡', + 712590: '关山镇', + 712591: '海端乡', + 712592: '池上乡', + 712593: '东河乡', + 712594: '成功镇', + 712595: '长滨乡', + 712596: '金峰乡', + 712597: '大武乡', + 712598: '达仁乡', + 712599: '太麻里乡', + 712686: '花莲市', + 712687: '新城乡', + 712688: '太鲁阁', + 712689: '秀林乡', + 712690: '吉安乡', + 712691: '寿丰乡', + 712692: '凤林镇', + 712693: '光复乡', + 712694: '丰滨乡', + 712695: '瑞穗乡', + 712696: '万荣乡', + 712697: '玉里镇', + 712698: '卓溪乡', + 712699: '富里乡', + 712794: '马公市', + 712795: '西屿乡', + 712796: '望安乡', + 712797: '七美乡', + 712798: '白沙乡', + 712799: '湖西乡', + 712896: '南竿乡', + 712897: '北竿乡', + 712898: '东引乡', + 712899: '莒光乡', + 810101: '中西区', + 810102: '湾仔', + 810103: '东区', + 810104: '南区', + 810201: '九龙城区', + 810202: '油尖旺区', + 810203: '深水埗区', + 810204: '黄大仙区', + 810205: '观塘区', + 810301: '北区', + 810302: '大埔区', + 810303: '沙田区', + 810304: '西贡区', + 810305: '元朗区', + 810306: '屯门区', + 810307: '荃湾区', + 810308: '葵青区', + 810309: '离岛区', + 820101: '澳门半岛', + 820201: '离岛' + } }; - - + + Class.prototype.config = { - elem: '', - data: { - province: '', - city: '', - county: '', - provinceCode: 0, - cityCode: 0, - countyCode: 0, - }, - change: function(result){} + elem: '', + data: { + province: '', + city: '', + county: '', + provinceCode: 0, + cityCode: 0, + countyCode: 0, + }, + change: function(result){} }; - + Class.prototype.index = 0; - + Class.prototype.render = function () { - let that = this, options = that.config; - options.elem = $(options.elem); - - that.events(); + let that = this, options = that.config; + options.elem = $(options.elem); + + that.events(); }; - + Class.prototype.reload = function (op) { - let options = this.config; - options.data = $.extend(options.data, op.data || {}); - this.events(true); + let options = this.config; + options.data = $.extend(options.data, op.data || {}); + this.events(true); }; - + Class.prototype.events = function (reload = false) { - let that = this, options = that.config; - let provinceFilter = 'province-' + layarea._id; - let cityFilter = 'city-' + layarea._id; - let countyFilter = 'county-' + layarea._id; - - let provinceEl = options.elem.find('.province-selector'); - let cityEl = options.elem.find('.city-selector'); - let countyEl = options.elem.find('.county-selector'); + let that = this, options = that.config; + let provinceFilter = 'province-' + layarea._id; + let cityFilter = 'city-' + layarea._id; + let countyFilter = 'county-' + layarea._id; + + let provinceEl = options.elem.find('.province-selector'); + let cityEl = options.elem.find('.city-selector'); + let countyEl = options.elem.find('.county-selector'); - if (reload){ - options.data.provinceCode = getCode('province', options.data.province); - let code = getCode('city', options.data.city, options.data.provinceCode.slice(0, 2)); - options.data.cityCode = code; - options.data.countyCode = getCode('county', options.data.county, options.data.cityCode.slice(0, 4)); - renderProvince(); - return; - } - //filter - if(provinceEl.attr('lay-filter')){ - provinceFilter = provinceEl.attr('lay-filter'); - } - if(cityEl.attr('lay-filter')){ - cityFilter = cityEl.attr('lay-filter'); - } - if(countyEl.attr('lay-filter')){ - countyFilter = countyEl.attr('lay-filter'); - } - provinceEl.attr('lay-filter', provinceFilter); - cityEl.attr('lay-filter', cityFilter); - countyEl.attr('lay-filter', countyFilter); + if (reload){ + options.data.provinceCode = getCode('province', options.data.province); + let code = getCode('city', options.data.city, options.data.provinceCode.slice(0, 2)); + options.data.cityCode = code; + options.data.countyCode = getCode('county', options.data.county, options.data.cityCode.slice(0, 4)); + renderProvince(); + return; + } + //filter + if(provinceEl.attr('lay-filter')){ + provinceFilter = provinceEl.attr('lay-filter'); + } + if(cityEl.attr('lay-filter')){ + cityFilter = cityEl.attr('lay-filter'); + } + if(countyEl.attr('lay-filter')){ + countyFilter = countyEl.attr('lay-filter'); + } + provinceEl.attr('lay-filter', provinceFilter); + cityEl.attr('lay-filter', cityFilter); + countyEl.attr('lay-filter', countyFilter); + + //获取默认值 + if(provinceEl.data('value')){ + options.data.province = provinceEl.data('value'); + options.data.provinceCode = getCode('province', options.data.province); + } else if (!options.data.province) { + options.data.province = ''; + } + if(cityEl.data('value')){ + options.data.city = cityEl.data('value'); + let code = getCode('city', options.data.city, options.data.provinceCode.slice(0, 2)); + options.data.cityCode = code; + } else if (!options.data.city) { + options.data.city = ''; + } + if(countyEl.data('value')){ + options.data.county = countyEl.data('value'); + options.data.countyCode = getCode('county', options.data.county, options.data.cityCode.slice(0, 4)); + } else if (!options.data.county) { + options.data.county = ''; + } + provinceEl.attr('lay-filter', provinceFilter); + cityEl.attr('lay-filter', cityFilter); + countyEl.attr('lay-filter', countyFilter); - //获取默认值 - if(provinceEl.data('value')){ - options.data.province = provinceEl.data('value'); - options.data.provinceCode = getCode('province', options.data.province); - } else if (!options.data.province) { - options.data.province = ''; + //监听结果 + form.on('select('+provinceFilter+')', function(data){ + options.data.province = data.value; + options.data.provinceCode = getCode('province', data.value); + renderCity(options.data.provinceCode); + + options.change(options.data); + }); + form.on('select('+cityFilter+')', function(data){ + options.data.city = data.value; + if(options.data.provinceCode){ + options.data.cityCode = getCode('city', data.value, options.data.provinceCode.slice(0, 2)); + renderCounty(options.data.cityCode); } - if(cityEl.data('value')){ - options.data.city = cityEl.data('value'); - let code = getCode('city', options.data.city, options.data.provinceCode.slice(0, 2)); - options.data.cityCode = code; - } else if (!options.data.city) { - options.data.city = ''; + + options.change(options.data); + }); + form.on('select('+countyFilter+')', function(data){ + options.data.county = data.value; + if(options.data.cityCode){ + options.data.countyCode = getCode('county', data.value, options.data.cityCode.slice(0, 4)); } - if(countyEl.data('value')){ - options.data.county = countyEl.data('value'); - options.data.countyCode = getCode('county', options.data.county, options.data.cityCode.slice(0, 4)); - } else if (!options.data.county) { - options.data.county = ''; - } - provinceEl.attr('lay-filter', provinceFilter); - cityEl.attr('lay-filter', cityFilter); - countyEl.attr('lay-filter', countyFilter); - - //监听结果 - form.on('select('+provinceFilter+')', function(data){ - options.data.province = data.value; - options.data.provinceCode = getCode('province', data.value); - renderCity(options.data.provinceCode); - - options.change(options.data); + options.change(options.data); + }); + + renderProvince(); + + //查找province + function renderProvince(){ + let tpl = ''; + let provinceList = getList("province"); + let currentCode = ''; + let currentName = ''; + provinceList.forEach(function(_item){ + // if (!currentCode){ + // currentCode = _item.code; + // currentName = _item.name; + // } + if(_item.name === options.data.province){ + currentCode = _item.code; + currentName = _item.name; + } + tpl += ''; }); - form.on('select('+cityFilter+')', function(data){ - options.data.city = data.value; - if(options.data.provinceCode){ - options.data.cityCode = getCode('city', data.value, options.data.provinceCode.slice(0, 2)); - renderCounty(options.data.cityCode); - } - - options.change(options.data); + provinceEl.html(tpl); + provinceEl.val(options.data.province); + form.render('select'); + renderCity(currentCode); + } + + function renderCity(provinceCode){ + let tpl = ''; + let cityList = getList('city', provinceCode.slice(0, 2)); + let currentCode = ''; + let currentName = ''; + cityList.forEach(function(_item){ + // if (!currentCode){ + // currentCode = _item.code; + // currentName = _item.name; + // } + if(_item.name === options.data.city){ + currentCode = _item.code; + currentName = _item.name; + } + tpl += ''; }); - form.on('select('+countyFilter+')', function(data){ - options.data.county = data.value; - if(options.data.cityCode){ - options.data.countyCode = getCode('county', data.value, options.data.cityCode.slice(0, 4)); - } - options.change(options.data); + options.data.city = currentName; + cityEl.html(tpl); + cityEl.val(options.data.city); + form.render('select'); + renderCounty(currentCode); + } + + function renderCounty(cityCode){ + let tpl = ''; + let countyList = getList('county', cityCode.slice(0, 4)); + let currentCode = ''; + let currentName = ''; + countyList.forEach(function(_item){ + // if (!currentCode){ + // currentCode = _item.code; + // currentName = _item.name; + // } + if(_item.name === options.data.county){ + currentCode = _item.code; + currentName = _item.name; + } + tpl += ''; }); - - renderProvince(); - - //查找province - function renderProvince(){ - let tpl = ''; - let provinceList = getList("province"); - let currentCode = ''; - let currentName = ''; - provinceList.forEach(function(_item){ - // if (!currentCode){ - // currentCode = _item.code; - // currentName = _item.name; - // } - if(_item.name === options.data.province){ - currentCode = _item.code; - currentName = _item.name; - } - tpl += ''; - }); - provinceEl.html(tpl); - provinceEl.val(options.data.province); - form.render('select'); - renderCity(currentCode); - } - - function renderCity(provinceCode){ - let tpl = ''; - let cityList = getList('city', provinceCode.slice(0, 2)); - let currentCode = ''; - let currentName = ''; - cityList.forEach(function(_item){ - // if (!currentCode){ - // currentCode = _item.code; - // currentName = _item.name; - // } - if(_item.name === options.data.city){ - currentCode = _item.code; - currentName = _item.name; - } - tpl += ''; - }); - options.data.city = currentName; - cityEl.html(tpl); - cityEl.val(options.data.city); - form.render('select'); - renderCounty(currentCode); + options.data.county = currentName; + countyEl.html(tpl); + countyEl.val(options.data.county); + + form.render('select'); + } + + function getList(type, code) { + let result = []; + + if (type !== 'province' && !code) { + return result; } - - function renderCounty(cityCode){ - let tpl = ''; - let countyList = getList('county', cityCode.slice(0, 4)); - let currentCode = ''; - let currentName = ''; - countyList.forEach(function(_item){ - // if (!currentCode){ - // currentCode = _item.code; - // currentName = _item.name; - // } - if(_item.name === options.data.county){ - currentCode = _item.code; - currentName = _item.name; - } - tpl += ''; - }); - options.data.county = currentName; - countyEl.html(tpl); - countyEl.val(options.data.county); - - form.render('select'); + + let list = areaList[type + "_list"] || {}; + result = Object.keys(list).map(function (code) { + return { + code: code, + name: list[code] + }; + }); + + if (code) { + // oversea code + if (code[0] === '9' && type === 'city') { + code = '9'; + } + + result = result.filter(function (item) { + return item.code.indexOf(code) === 0; + }); } - - function getList(type, code) { - let result = []; - - if (type !== 'province' && !code) { - return result; - } - let list = areaList[type + "_list"] || {}; - result = Object.keys(list).map(function (code) { - return { - code: code, - name: list[code] - }; - }); - if (code) { - // oversea code - if (code[0] === '9' && type === 'city') { - code = '9'; - } - - result = result.filter(function (item) { - return item.code.indexOf(code) === 0; - }); + + return result; + } + + function getCode(type, name, parentCode = 0){ + let code = ''; + let list = areaList[type + "_list"] || {}; + let result = {}; + Object.keys(list).map(function (_code) { + if(parentCode){ + if(_code.indexOf(parentCode) === 0){ + result[_code] = list[_code]; } - return result; - } + }else{ + result[_code] = list[_code]; + } + }); + layui.each(result, function(_code, _name){ + if(_name === name){ + code = _code; + } + }); - function getCode(type, name, parentCode = 0){ - let code = ''; - let list = areaList[type + "_list"] || {}; - let result = {}; - Object.keys(list).map(function (_code) { - if(parentCode){ - if(_code.indexOf(parentCode) === 0){ - result[_code] = list[_code]; - } - }else{ - result[_code] = list[_code]; - } - }); - layui.each(result, function(_code, _name){ - if(_name === name){ - code = _code; - } - }); - return code; - } + return code; + } }; - + layarea.render = function (options) { - let inst = new Class(options); - layarea._id++; - return thisArea.call(inst); + let inst = new Class(options); + layarea._id++; + return thisArea.call(inst); }; - + exports('area', layarea); -}); \ No newline at end of file + }); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/button.js b/src/main/resources/static/component/pear/module/button.js index 94bbadd6..d77c18d2 100644 --- a/src/main/resources/static/component/pear/module/button.js +++ b/src/main/resources/static/component/pear/module/button.js @@ -1,41 +1,53 @@ -layui.define(['jquery', 'element', 'util'], function (exports) { - "use strict"; +layui.define(['jquery'], function(exports) { + "use strict"; - var MOD_NAME = 'button', - $ = layui.jquery, - util = layui.util, - element = layui.element; + /** + * Button component + * */ + var MOD_NAME = 'button', + $ = layui.jquery; - var button = function (opt) { - this.option = opt; - }; + var button = function(opt) { + this.option = opt; + }; - button.prototype.load = function (opt) { - //默认配置值 - var option = { - elem: opt.elem, - time: opt.time ? opt.time : false, - done: opt.done ? opt.done : function () { - } - } - var load = $(option.elem).text(); - $(option.elem).html(""); - var buttons = $(option.elem); - if (option.time == "") { - } else { - setTimeout(function () { - buttons.html(load); - option.done(); - }, option.time); - } - option.text = load; - return new button(option); - } + /** + * Button start loading + * */ + button.prototype.load = function(opt) { + + var option = { + elem: opt.elem, + time: opt.time ? opt.time : false, + done: opt.done ? opt.done : function(){} + } + var text = $(option.elem).html(); + + $(option.elem).html(""); + + $(option.elem).attr("disabled", "disabled"); + + var buttons = $(option.elem); + + if (option.time != "" || option.time !=false) { + setTimeout(function() { + $(option.elem).attr("disabled", false); + buttons.html(text); + option.done(); + }, option.time); + } + option.text = text; + return new button(option); + } + + /** + * Button stop loaded + * */ + button.prototype.stop = function(success) { + $(this.option.elem).attr("disabled", false); + $(this.option.elem).html(this.option.text); + success && success(); + } - button.prototype.stop = function (success) { - $(this.option.elem).html(this.option.text); - success(); - } - - exports(MOD_NAME, new button()); + exports(MOD_NAME, new button()); }); diff --git a/src/main/resources/static/component/pear/module/card.js b/src/main/resources/static/component/pear/module/card.js index 51d14ad2..76934da3 100644 --- a/src/main/resources/static/component/pear/module/card.js +++ b/src/main/resources/static/component/pear/module/card.js @@ -1,266 +1,275 @@ layui.define(['table', 'laypage','jquery', 'element'], function(exports) { - "use strict"; + "use strict"; - var MOD_NAME = 'card', - $ = layui.jquery, - element = layui.element, - laypage = layui.laypage; + var MOD_NAME = 'card', + $ = layui.jquery, + element = layui.element, + laypage = layui.laypage; + + var _instances = {}; // 记录所有实例 + + var defaultOption = { + elem: "#currentTableId",// 构建的模型 + url: "",// 数据 url 连接 + loading: true,//是否加载 + limit: 0, //每页数量默认是每行数量的双倍 + linenum: 4, //每行数量 2,3,4,6 + currentPage: 1,//当前页 + data:[], //静态数据 + limits:[], //页码 + page: true, //是否分页 + layout: ['count', 'prev', 'page', 'next','limit', 'skip'],//分页控件 + request: { + pageName: 'page' //页码的参数名称,默认:page + , limitName: 'limit' //每页数据量的参数名,默认:limit + , idName: 'id' //主键名称,默认:id + , titleName: 'title' //标题名称,默认:title + , imageName: 'image' //图片地址,默认:image + , remarkName: 'remark' //备注名称,默认:remark + , timeName: 'time' //时间名称,默认:time + }, + response: { + statusName: 'code' //规定数据状态的字段名称,默认:code + , statusCode: 0 //规定成功的状态码,默认:0 + , msgName: 'msg' //规定状态信息的字段名称,默认:msg + , countName: 'count' //规定数据总数的字段名称,默认:count + , dataName: 'data' //规定数据列表的字段名称,默认:data + }, + clickItem: function(data){}, + done: function () { - var _instances = {}; // 记录所有实例 - - var defaultOption = { - elem: "#currentTableId",// 构建的模型 - url: "",// 数据 url 连接 - loading: true,//是否加载 - limit: 0, //每页数量默认是每行数量的双倍 - linenum: 4, //每行数量 2,3,4,6 - currentPage: 1,//当前页 - data:[], //静态数据 - limits:[], //页码 - page: true, //是否分页 - layout: ['count', 'prev', 'page', 'next','limit', 'skip'],//分页控件 - request: { - pageName: 'page' //页码的参数名称,默认:page - , limitName: 'limit' //每页数据量的参数名,默认:limit - , idName: 'id' //主键名称,默认:id - , titleName: 'title' //标题名称,默认:title - , imageName: 'image' //图片地址,默认:image - , remarkName: 'remark' //备注名称,默认:remark - , timeName: 'time' //时间名称,默认:time - }, - response: { - statusName: 'code' //规定数据状态的字段名称,默认:code - , statusCode: 0 //规定成功的状态码,默认:0 - , msgName: 'msg' //规定状态信息的字段名称,默认:msg - , countName: 'count' //规定数据总数的字段名称,默认:count - , dataName: 'data' //规定数据列表的字段名称,默认:data - }, - clickItem: function(data){}, - done: function () { - - } - }; - - var card = function(opt) { - _instances[opt.elem.substring(1)] = this; - this.reload(opt); - }; - card.prototype.initOptions = function (opt) { - this.option = $.extend(true, {}, defaultOption, opt); - if (!this.option.limit || this.option.limit == 0) { - this.option.limit = this.option.linenum * 2; - } - if (!this.option.limits || this.option.limits.length == 0) { - this.option.limits = [this.option.limit]; - } - }; - - card.prototype.init = function () { - var option = this.option; - var url = option.url; - var html = ""; - html += option.loading == true ? '
              ' : '
              '; - html += ''; - html += '
              '; - $(option.elem).html(html); - html = ""; - if (!!url) { - if (url.indexOf("?") >= 0) { - url = url + '&v=1.0.0'; - } - else { - url = url + '?v=1.0.0'; - } - if (!!option.page) { - url = url + '&' + option.request.limitName + '=' + option.limit; - url = url + '&' + option.request.pageName + '=' + option.currentPage; - } - if (!!option.where) { - for (let key in option.where) { - url = url + '&' + key + '=' + option.where[key]; - } - } - getData(url).then(function(data){ - data = initData(data, option); - if (data.code != option.response.statusCode) { - option.data = []; - option.count = 0; - } else { - option.data = data.data; - option.count = option.data.length; - } - - if (!!option.data && option.data.length > 0) { - html = createComponent(option.elem.substring(1), option.linenum, option.data); - html += "
              "; - } - else { - html = "

              没有数据

              "; - } - $(option.elem).html(html); - if (option.page) { - laypage.render({ - elem: 'cardpage' - , count: option.count, limit: option.limit, limits: option.limits, curr: option.currentPage - , layout: option.layout - , jump: function (obj, first) { - option.limit = obj.limit; - option.currentPage = obj.curr; - if (!first) { - _instances[option.elem.substring(1)].reload(option); - } - } - }); - } - }); + } + }; + + var card = function(opt) { + _instances[opt.elem.substring(1)] = this; + this.reload(opt); + }; + card.prototype.initOptions = function (opt) { + this.option = $.extend(true, {}, defaultOption, opt); + if (!this.option.limit || this.option.limit == 0) { + this.option.limit = this.option.linenum * 2; + } + if (!this.option.limits || this.option.limits.length == 0) { + this.option.limits = [this.option.limit]; } - else { - if (!option.alldata) { - option.alldata = option.data; - } - if (option.page) { - var data = []; - option.count = option.alldata.length; - for (var i = (option.currentPage - 1) * option.limit; i < option.currentPage * option.limit && i 0) { - html = createComponent(option.elem.substring(1), option.linenum, option.data); - html += "
              "; + }; + + card.prototype.init = function () { + var option = this.option; + var url = option.url; + var html = ""; + html += option.loading == true ? '
              ' : '
              '; + html += ''; + html += '
              '; + $(option.elem).html(html); + html = ""; + if (!!url) { + if (url.indexOf("?") >= 0) { + url = url + '&v=1.0.0'; + } + else { + url = url + '?v=1.0.0'; + } + if (!!option.page) { + url = url + '&' + option.request.limitName + '=' + option.limit; + url = url + '&' + option.request.pageName + '=' + option.currentPage; + } + if (!!option.where) { + for (let key in option.where) { + url = url + '&' + key + '=' + option.where[key]; + } } - else { - html = "

              没有数据

              "; + getData(url).then(function(data){ + data = initData(data, option); + if (data.code != option.response.statusCode) { + option.data = []; + option.count = 0; + } else { + option.data = data.data; + option.count = data.count; + } + + if (!!option.data && option.data.length > 0) { + html = createComponent(option.elem.substring(1), option.linenum, option.data); + html += "
              "; + } + else { + if (data.code != option.response.statusCode) { + html = "

              " + data.msg + "

              "; + } else { + html = "

              没有数据

              "; + } + } + $(option.elem).html(html); + if (option.page) { + laypage.render({ + elem: 'cardpage' + , count: option.count, limit: option.limit, limits: option.limits, curr: option.currentPage + , layout: option.layout + , jump: function (obj, first) { + option.limit = obj.limit; + option.currentPage = obj.curr; + if (!first) { + _instances[option.elem.substring(1)].reload(option); + } + } + }); + } + }); + } + else { + if (!option.alldata) { + option.alldata = option.data; } - $(option.elem).html(html); - if (option.page) { - laypage.render({ - elem: 'cardpage' - , count: option.count, limit: option.limit, limits: option.limits, curr: option.currentPage - , layout: option.layout - , jump: function (obj, first) { - option.limit = obj.limit; - option.currentPage = obj.curr; - if (!first) { - _instances[option.elem.substring(1)].reload(option); - } - } - }); - } - } - } - - card.prototype.reload = function (opt) { - this.initOptions(this.option ? $.extend(true, this.option, opt) : opt); - this.init(); // 初始化表格 + if (option.page) { + var data = []; + option.count = option.alldata.length; + for (var i = (option.currentPage - 1) * option.limit; i < option.currentPage * option.limit && i 0) { + html = createComponent(option.elem.substring(1), option.linenum, option.data); + html += "
              "; + } + else { + html = "

              没有数据

              "; + } + $(option.elem).html(html); + if (option.page) { + laypage.render({ + elem: 'cardpage' + , count: option.count, limit: option.limit, limits: option.limits, curr: option.currentPage + , layout: option.layout + , jump: function (obj, first) { + option.limit = obj.limit; + option.currentPage = obj.curr; + if (!first) { + _instances[option.elem.substring(1)].reload(option); + } + } + }); + } + } + } + + card.prototype.reload = function (opt) { + this.initOptions(this.option ? $.extend(true, this.option, opt) : opt); + this.init(); // 初始化表格 } - function createComponent(elem,linenum,data) { - var html = "
              " - var content = createCards(elem, linenum,data); + function createComponent(elem,linenum,data) { + var html = "
              " + var content = createCards(elem, linenum,data); var page = ""; content = content + page; html += content + "
              " return html; - } - - function createCards(elem, linenum,data) { - var content = "
              "; - for (var i = 0; i < data.length; i++) { - content += createCard(elem, linenum,data[i],i); + } + + function createCards(elem, linenum,data) { + var content = "
              "; + for (var i = 0; i < data.length; i++) { + content += createCard(elem, linenum,data[i],i); } - content += "
              "; - return content; - } - - function createCard(elem, linenum, item, no) { - var line = 12 / linenum; - var card = - '

              ' + item.title + '

              ' + item.remark + '
              ' +item.time + '
              ' - return card; - } - - function initData(tempData, option) { - var data = {}; - data.code = tempData[option.response.statusName]; - data.msg = tempData[option.response.msgName]; - data.count = tempData[option.response.countName]; - var dataList = tempData[option.response.dataName]; - data.data = []; - for (var i = 0; i < dataList.length; i++) { - var item = {}; - item.id = dataList[i][option.request.idName]; - item.image = dataList[i][option.request.imageName]; - item.title = dataList[i][option.request.titleName]; - item.remark = dataList[i][option.request.remarkName]; - item.time = dataList[i][option.request.timeName]; - data.data.push(item); + content += "
              "; + return content; + } + + function createCard(elem, linenum, item, no) { + var line = 12 / linenum; + var card = + '

              ' + item.title + '

              ' + item.remark + '
              ' +item.time + '
              ' + return card; + } + + function initData(tempData, option) { + var data = {}; + data.code = tempData[option.response.statusName]; + data.msg = tempData[option.response.msgName]; + data.count = tempData[option.response.countName]; + var dataList = tempData[option.response.dataName]; + if(!dataList){ + return data; } - return data; - } - - function getData(url) { - var defer = $.Deferred(); - $.get(url + (url.indexOf("?") ? "&" : "?") + "fresh=" + Math.random(), function(result) { - defer.resolve(result) - }); - return defer.promise(); + data.data = []; + for (var i = 0; i < dataList.length; i++) { + var item = dataList[i]; + item.id = dataList[i][option.request.idName]; + item.image = dataList[i][option.request.imageName]; + item.title = dataList[i][option.request.titleName]; + item.remark = dataList[i][option.request.remarkName]; + item.time = dataList[i][option.request.timeName]; + data.data.push(item); + } + return data; } - window.cardTableCheckedCard = function (elem,obj) { - $(obj).addClass('layui-table-click').siblings().removeClass('layui-table-click'); - var item = {}; - item.id = obj.id; - item.image = $(obj).find('.project-list-item-cover')[0].src; - item.title = $(obj).find('h2')[0].innerHTML; - item.remark = $(obj).find('.project-list-item-text')[0].innerHTML; - item.time = $(obj).find('.time')[0].innerHTML; - _instances[elem.id].option.checkedItem = item; - _instances[elem.id].option.clickItem(item); - } - - /** 对外提供的方法 */ - var tt = { - - render: function (options) { - return new card(options); - }, - - reload: function (id, opt) { - _instances[id].option.checkedItem = null; - _instances[id].reload(opt); - }, - - getChecked: function (id) { - var option = _instances[id].option; - var data = option.checkedItem; - var item = {}; + function getData(url) { + var defer = $.Deferred(); + $.get(url + (url.indexOf("?") ? "&" : "?") + "fresh=" + Math.random(), function(result) { + defer.resolve(result) + }); + return defer.promise(); + } + + window.cardTableCheckedCard = function (elem,obj) { + $(obj).addClass('layui-table-click').siblings().removeClass('layui-table-click'); + var item = {}; + item.id = obj.id; + item.index = $(obj).attr('data-index'); + item.image = $(obj).find('.project-list-item-cover')[0].src; + item.title = $(obj).find('h2')[0].innerHTML; + item.remark = $(obj).find('.project-list-item-text')[0].innerHTML; + item.time = $(obj).find('.time')[0].innerHTML; + _instances[elem.id].option.checkedItem = item; + _instances[elem.id].option.clickItem(item); + } + + /** 对外提供的方法 */ + var tt = { + + render: function (options) { + return new card(options); + }, + + reload: function (id, opt) { + _instances[id].option.checkedItem = null; + _instances[id].reload(opt); + }, + + getChecked: function (id) { + var option = _instances[id].option; + var data = option.checkedItem; + var item = {}; if (!data) { - return null; + return null; } - item[option.request.idName] = data.id; - item[option.request.imageName] = data.image; - item[option.request.titleName] = data.title; - item[option.request.remarkName] = data.remark; - item[option.request.timeName] = data.time; - return item; - }, - - getAllData: function (id) { - var option = _instances[id].option; - var data = []; - for (var i = 0; i < option.data.length; i++) { - var item = {}; - item[option.request.idName] = option.data[i].id; - item[option.request.imageName] = option.data[i].image; - item[option.request.titleName] = option.data[i].title; - item[option.request.remarkName] = option.data[i].remark; - item[option.request.timeName] = option.data[i].time; - data.push(item); + item[option.request.idName] = data.id; + item[option.request.imageName] = data.image; + item[option.request.titleName] = data.title; + item[option.request.remarkName] = data.remark; + item[option.request.timeName] = data.time; + return item; + }, + + getAllData: function (id) { + var option = _instances[id].option; + var data = []; + for (var i = 0; i < option.data.length; i++) { + var item = {}; + item[option.request.idName] = option.data[i].id; + item[option.request.imageName] = option.data[i].image; + item[option.request.titleName] = option.data[i].title; + item[option.request.remarkName] = option.data[i].remark; + item[option.request.timeName] = option.data[i].time; + data.push(item); } - return data; - }, - } - exports(MOD_NAME, tt); + return data; + }, + } + + exports(MOD_NAME, tt); }) \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/common.js b/src/main/resources/static/component/pear/module/common.js index 769e8fcf..50f2f15d 100644 --- a/src/main/resources/static/component/pear/module/common.js +++ b/src/main/resources/static/component/pear/module/common.js @@ -1,10 +1,22 @@ -; -"use strict"; -layui.define(["layer", "jquery", "table"], function (exports) { - var $ = layui.jquery; - var table = layui.table; - var obj = { - checkField: function (obj, field) { +layui.define(['jquery', 'element', 'table'], function (exports) { + "use strict"; + + /** + * 常用封装类 + * */ + var MOD_NAME = 'common', + $ = layui.jquery, + table = layui.table, + element = layui.element; + + var common = new function () { + + /** + * 获取当前表格选中字段 + * @param obj 表格回调参数 + * @param field 要获取的字段 + * */ + this.checkField = function (obj, field) { let data = table.checkStatus(obj.config.id).data; if (data.length === 0) { return ""; @@ -13,203 +25,90 @@ layui.define(["layer", "jquery", "table"], function (exports) { for (let i = 0; i < data.length; i++) { ids += data[i][field] + ","; } - ids = ids.substr(0, ids.length - 1); + ids = ids.substring(0, ids.length - 1); return ids; - }, - resizeTable: function (tableId) { - layui.table.resize(tableId); } - , sprintf: function (str) { - var args = arguments, flag = true, i = 1; - str = str.replace(/%s/g, function () { - var arg = args[i++]; - if (typeof arg === 'undefined') { - flag = false; - return ''; - } - return arg; - }); - return flag ? str : ''; - }, - equals: function (str, that) { - return str == that; - }, - equalsIgnoreCase: function (str, that) { - return String(str).toUpperCase() === String(that).toUpperCase(); - }, - isEmpty: function (value) { - if (typeof (value) === "undefined" || value == null || this.trim(value) == "") { - return true; - } - return false; - }, - formatNullStr: function (o) { - if (this.isEmpty(o)) { - return ""; + + /** + * 当前是否为与移动端 + * */ + this.isModile = function () { + return $(window).width() <= 768; + } + + + /** + * 提交 json 数据 + * @param href 必选 提交接口 + * @param data 可选 提交数据 + * @param ajaxtype 可选 提交方式(默认为get) + * @param table 可选 刷新父级表 + * @param callback 可选 自定义回调函数 + * @param dataType 可选 返回数据类型 智能猜测(可以是xml, json, script, 或 html) + * @param is_async 可选 请求是否异步处理。默认是 true + * @param is_cache 可选 浏览器是否缓存被请求页面。默认是 true + * */ + this.submit = function (href, data, ajaxtype, table, callback, dataType, is_async, is_cache) { + if (data !== undefined) { + $.ajaxSetup({data: JSON.stringify(data)}); } else { - return o; - } - }, - getJsonArrayValue: function (array, key, keyChecked, keyId) { - var aa = []; - for (var a in array) { - var _item = array[a]; - if (_item[keyChecked]) { - aa.push(_item[keyId]); - } - if (typeof (_item[key]) != "undefined" && _item[key].length > 0) { - var _aa = this.getJsonArrayValue(_item[key], key, keyChecked, keyId); - if (_aa != null && _aa.length > 0) { - for (var _a in _aa) { - aa.push(_aa[_a]); - } - } - } + $.ajaxSetup({data: ''}); } - return aa; - }, - trim: function (value) { - if (value == null) { - return ""; + if (dataType !== undefined) { + $.ajaxSetup({dataType: dataType}); } - return value.toString().replace(/(^\s*)|(\s*$)|\r|\n/g, ""); - }, - random: function (min, max) { - return Math.floor((Math.random() * max) + min); - }, - getCheckValues: function (name) { - var _items = $('input:checkbox[name*="' + name + '"]:checked'); - var _itemsStr = ""; - layui.each(_items, function (i, n) { - _itemsStr += "," + $(n).val(); - }); - if (_itemsStr.length > 0) { - return _itemsStr.substr(1, _itemsStr.length); + if (is_async !== undefined) { + $.ajaxSetup({async: is_async}); } - return ""; - }, - joinArray: function (array, key) { - var _itemsStr = ""; - layui.each(array, function (i, n) { - _itemsStr += "," + n[key]; - }); - if (_itemsStr.length > 0) { - return _itemsStr.substr(1, _itemsStr.length); + if (is_cache !== undefined) { + $.ajaxSetup({cache: is_cache}); } - return ""; - }, - getDictLabel: function (array, value) { - var actions = []; - layui.each(array, function (i, n) { - if (n.dictValue === value) { - actions.push(n.dictLabel); - } - }); - return actions.join(''); - }, - ajaxRemove: function (removeUrl, id, cb) { - if (id == '' || id == undefined) { - layui.layer.alert('请选择删除数据!'); - return; - } - var url = this.isEmpty(id) ? removeUrl : removeUrl.replace("{id}", id); - var msg = (id.length > 0 && id.indexOf(",") > 0) ? "是否确认删除这些项?" : "是否确认删除该项?"; - layer.confirm(msg, function (index) { - $.ajax({ - type: "POST", - url: url, - async: true, - cache: false, - dataType: "json", - data: {"ids": id}, - success: function (res) { - if (typeof (cb) === "function") { - cb(res); - } - layer.close(index); + $.ajax({ + url: href, + contentType: 'application/json', + type: ajaxtype || 'get', + success: callback != null ? callback : function (result) { + if (result.code === 1) { + layer.msg(result.msg, {icon: 1, time: 1000}, function () { + let frameIndex = parent.layer.getFrameIndex(window.name); + if (frameIndex) { + parent.layer.close(frameIndex);//关闭当前页 + } + table && parent.layui.table.reload(table); + }); + } else { + layer.msg(result.msg, {icon: 2, time: 1000}); } - }); - }); - }, - ajax: { - submit: function (url, type, dataType, data, cb) { - var config = { - url: url, - type: type, - dataType: dataType, - data: data, - beforeSend: function () { - //layer.loading("正在处理中,请稍后..."); - layer.load(2); - }, - success: function (result) { - layer.closeAll('loading'); - if (typeof (cb) === "function") { - cb(result); - } + }, + error: function (xhr) { + if (xhr.status === 401) { + layer.msg('权限不足,您无法访问受限资源或数据', {icon: 5}); + return; } - }; - $.ajax(config) - }, - post: function (url, data, cb) { - obj.ajax.submit(url, "post", "json", data, cb); - }, - get: function (url, cb) { - obj.ajax.submit(url, "get", "json", "", cb); - } - }, - verify: { - roleKey: function (value, item) { - var msg; - if (!new RegExp("^[a-zA-Z0-9_\u4e00-\u9fa5\\s·]+$").test(value)) { - msg = 'roleKey不能有特殊字符'; - } - $.ajax({ - type: "POST", - url: "/system/role/checkRoleKeyUnique", - async: false, - cache: false, - dataType: "json", - data: { - roleKey: $("[name='roleKey']").val() - }, - success: function (res) { - if (res != "0") { - msg = "roleKey已存在,请修改!"; - } - }, - error: function () { - msg = "验证roleKey出错!"; + if (xhr.status === 404) { + layer.msg('请求url地址错误,请确认后刷新重试', {icon: 5}); + return; } - }); - return msg; - }, - roleName: function (value, item) { - var msg; - if (!new RegExp("^[a-zA-Z0-9_\u4e00-\u9fa5\\s·]+$").test(value)) { - msg = 'roleName不能有特殊字符'; - } - $.ajax({ - type: "POST", - url: "/system/role/checkRoleNameUnique", - async: false, - cache: false, - dataType: "json", - data: { - roleName: $("[name='roleName']").val() - }, - success: function (res) { - if (res != "0") { - msg = "roleName已存在,请修改!"; - } - }, - error: function () { - msg = "验证roleName出错!"; + if (xhr.status === 419) { + layer.msg('长时间未操作,自动刷新后重试!', {icon: 5}); + setTimeout(function () { + window.location.reload(); + }, 2000); + return; } - }); - return msg; - } + if (xhr.status === 429) { + layer.msg('尝试次数太多,请一分钟后再试', {icon: 5}); + return; + } + if (xhr.status === 500) { + layer.msg(xhr.responseJSON.message, {icon: 5}); + } + } + , complete: function (xhr, status) { + + } + }) } - }; - exports('common', obj); -}); \ No newline at end of file + } + exports(MOD_NAME, common); +}); diff --git a/src/main/resources/static/component/pear/module/context.js b/src/main/resources/static/component/pear/module/context.js new file mode 100644 index 00000000..a803e02b --- /dev/null +++ b/src/main/resources/static/component/pear/module/context.js @@ -0,0 +1,19 @@ +layui.define(['jquery', 'element'], function(exports) { + "use strict"; + + var MOD_NAME = 'context', + $ = layui.jquery, + element = layui.element; + + var context = new function() { + + this.put = function(key,value){ + localStorage.setItem(key,value); + } + + this.get = function(key){ + return localStorage.getItem(key); + } + } + exports(MOD_NAME, context); +}); diff --git a/src/main/resources/static/component/pear/module/convert.js b/src/main/resources/static/component/pear/module/convert.js index d2dd34e9..1f86ba5a 100644 --- a/src/main/resources/static/component/pear/module/convert.js +++ b/src/main/resources/static/component/pear/module/convert.js @@ -1,27 +1,27 @@ -layui.define(['jquery', 'element'], function (exports) { - "use strict"; +layui.define(['jquery', 'element'], function(exports) { + "use strict"; - /** - * 类 型 转 换 工 具 类 - * */ - var MOD_NAME = 'convert', - $ = layui.jquery, - element = layui.element; + /** + * 类 型 转 换 工 具 类 + * */ + var MOD_NAME = 'convert', + $ = layui.jquery, + element = layui.element; - var convert = new function () { + var convert = new function() { - // image 转 base64 - this.imageToBase64 = function (img) { - var canvas = document.createElement("canvas"); - canvas.width = img.width; - canvas.height = img.height; - var ctx = canvas.getContext("2d"); - ctx.drawImage(img, 0, 0, img.width, img.height); - var ext = img.src.substring(img.src.lastIndexOf(".") + 1).toLowerCase(); - var dataURL = canvas.toDataURL("image/" + ext); - return dataURL; - } + // image 转 base64 + this.imageToBase64 = function(img) { + var canvas = document.createElement("canvas"); + canvas.width = img.width; + canvas.height = img.height; + var ctx = canvas.getContext("2d"); + ctx.drawImage(img, 0, 0, img.width, img.height); + var ext = img.src.substring(img.src.lastIndexOf(".")+1).toLowerCase(); + var dataURL = canvas.toDataURL("image/"+ext); + return dataURL; + } - } - exports(MOD_NAME, convert); + } + exports(MOD_NAME, convert); }); diff --git a/src/main/resources/static/component/pear/module/count.js b/src/main/resources/static/component/pear/module/count.js index 65cb3d14..c9a659f0 100644 --- a/src/main/resources/static/component/pear/module/count.js +++ b/src/main/resources/static/component/pear/module/count.js @@ -1,37 +1,37 @@ layui.define(['jquery', 'element'], function(exports) { - "use strict"; + "use strict"; - var MOD_NAME = 'count', - $ = layui.jquery, - element = layui.element; + var MOD_NAME = 'count', + $ = layui.jquery, + element = layui.element; - var count = new function() { + var count = new function() { - this.up = function(targetEle, options) { + this.up = function(targetEle, options) { - options = options || {}; + options = options || {}; - var $this = document.getElementById(targetEle), - time = options.time, - finalNum = options.num, - regulator = options.regulator, - step = finalNum / (time / regulator), - count = 0.00, - initial = 0; + var $this = document.getElementById(targetEle), + time = options.time, + finalNum = options.num, + regulator = options.regulator, + step = finalNum / (time / regulator), + count = 0.00, + initial = 0; + + var timer = setInterval(function() { + count = count + step; + if (count >= finalNum) { + clearInterval(timer); + count = finalNum; + } + var t = count.toFixed(options.bit?options.bit:0);; + if (t == initial) return; + initial = t; + $this.innerHTML = initial; + }, 30); + } - var timer = setInterval(function() { - count = count + step; - if (count >= finalNum) { - clearInterval(timer); - count = finalNum; - } - var t = count.toFixed(options.bit?options.bit:0);; - if (t == initial) return; - initial = t; - $this.innerHTML = initial; - }, 30); - } - - } - exports(MOD_NAME, count); -}); \ No newline at end of file + } + exports(MOD_NAME, count); +}); diff --git a/src/main/resources/static/component/pear/module/cropper.js b/src/main/resources/static/component/pear/module/cropper.js index c3075cb3..6d774977 100644 --- a/src/main/resources/static/component/pear/module/cropper.js +++ b/src/main/resources/static/component/pear/module/cropper.js @@ -1419,7 +1419,7 @@ layui.define(['jquery'], function (exports) { top += range.y; break; - // Resize crop box + // Resize crop box case ACTION_EAST: if (range.x >= 0 && (right >= maxWidth || aspectRatio && (top <= minTop || bottom >= maxHeight))) { renderable = false; @@ -1702,19 +1702,19 @@ layui.define(['jquery'], function (exports) { break; - // Move canvas + // Move canvas case 'move': self.move(range.x, range.y); renderable = false; break; - // Zoom canvas + // Zoom canvas case 'zoom': self.zoom(getMaxZoomRatio(pointers), e.originalEvent); renderable = false; break; - // Create crop box + // Create crop box case 'crop': if (!range.x || !range.y) { renderable = false; @@ -1770,16 +1770,7 @@ layui.define(['jquery'], function (exports) { } }; - function _toConsumableArray(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - return arr2; - } else { - return Array.from(arr); - } - } + function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length) ; i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function getPointersCenter(pointers) { var pageX = 0; @@ -2632,29 +2623,9 @@ layui.define(['jquery'], function (exports) { } }; - var _createClass = function () { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps); - if (staticProps) defineProperties(Constructor, staticProps); - return Constructor; - }; - }(); - - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var CLASS_HIDDEN = 'cropper-hidden'; var REGEXP_DATA_URL = /^data:/; @@ -2792,34 +2763,34 @@ layui.define(['jquery'], function (exports) { scaleX = -1; break; - // rotate left 180° + // rotate left 180° case 3: rotate = -180; break; - // flip vertical + // flip vertical case 4: scaleY = -1; break; - // flip vertical + rotate right 90° + // flip vertical + rotate right 90° case 5: rotate = 90; scaleY = -1; break; - // rotate right 90° + // rotate right 90° case 6: rotate = 90; break; - // flip horizontal + rotate right 90° + // flip horizontal + rotate right 90° case 7: rotate = 90; scaleX = -1; break; - // rotate left 90° + // rotate left 90° case 8: rotate = -90; break; diff --git a/src/main/resources/static/component/pear/module/design.js b/src/main/resources/static/component/pear/module/design.js index 1535ebd4..6bcf7acd 100644 --- a/src/main/resources/static/component/pear/module/design.js +++ b/src/main/resources/static/component/pear/module/design.js @@ -1,183 +1,182 @@ -layui.define(['layer', 'form'], function (exports) { - var layer = layui.layer, - form = layui.form, - $ = layui.$, - key = ''; - delHtml() - $('button').on('click', function () { - var _this = $(this), - size = _this.data('size'), - type = _this.data('type'), - html = ''; - key = randStrName(); - switch (type) { - case 'text': - html = input(type, size) - break; - case 'password': - html = input(type, size) - break; - case 'select': - html = select(size) - break; - case 'checkbox_a': - html = checkbox_a(size) - break; - case 'checkbox_b': - html = checkbox_b(size) - break; - case 'radio': - html = radio(size) - break; - case 'textarea': - html = textarea(size) - break; - case 'submit': - html = submits(size) - break; - case 'del': - $('form').html("\n") - delHtml() - $('.code-show').text('') - return false - break; - default: - layer.msg('类型错误', { - icon: 2 - }) - } +layui.define(['layer', 'form'], function(exports) { + var layer = layui.layer, + form = layui.form, + $ = layui.$, + key = ''; + delHtml() + $('button').on('click', function() { + var _this = $(this), + size = _this.data('size'), + type = _this.data('type'), + html = ''; + key = randStrName(); + switch (type) { + case 'text': + html = input(type, size) + break; + case 'password': + html = input(type, size) + break; + case 'select': + html = select(size) + break; + case 'checkbox_a': + html = checkbox_a(size) + break; + case 'checkbox_b': + html = checkbox_b(size) + break; + case 'radio': + html = radio(size) + break; + case 'textarea': + html = textarea(size) + break; + case 'submit': + html = submits(size) + break; + case 'del': + $('form').html("\n") + delHtml() + $('.code-show').text('') + return false + break; + default: + layer.msg('类型错误', { + icon: 2 + }) + } - $('form').append(html); - form.render(); - setHtml(html) - }) + $('form').append(html); + form.render(); + setHtml(html) + }) - function delHtml() { - layui.data('form_html', { - key: 'html', - remove: true - }); - } + function delHtml() { + layui.data('form_html', { + key: 'html', + remove: true + }); + } - function setHtml(html) { - var h = layui.data('form_html'); - if (h && h.html) { - var _d = h.html + html - } else { - var _d = html - } - layui.data('form_html', { - key: 'html', - value: _d - }) - $('.code-show').text('
              \n' + _d + '
              ') + function setHtml(html) { + var h = layui.data('form_html'); + if (h && h.html) { + var _d = h.html + html + } else { + var _d = html + } + layui.data('form_html', { + key: 'html', + value: _d + }) + $('.code-show').text('
              \n' + _d + '
              ') - } + } - function input(type, size) { - var name = type === 'text' ? '输入框' : (type === 'password' ? '密码框' : ''); - var html = '
              \n' + - ' \n' + - '
              \n' + - ' \n' + - '
              \n' + - '
              \n'; - return html; - } + function input(type, size) { + var name = type === 'text' ? '输入框' : (type === 'password' ? '密码框' : ''); + var html = '
              \n' + + ' \n' + + '
              \n' + + ' \n' + + '
              \n' + + '
              \n'; + return html; + } - function select(size) { - var html = '
              \n' + - ' \n' + - '
              \n' + - ' \n' + - '
              \n' + - '
              \n'; - return html; - } + function select(size) { + var html = '
              \n' + + ' \n' + + '
              \n' + + ' \n' + + '
              \n' + + '
              \n'; + return html; + } - function checkbox_a(size) { - var html = '
              \n' + - ' \n' + - '
              \n' + - ' \n' + - ' \n' + - ' \n' + - '
              \n' + - '
              \n'; - return html; - } + function checkbox_a(size) { + var html = '
              \n' + + ' \n' + + '
              \n' + + ' \n' + + ' \n' + + ' \n' + + '
              \n' + + '
              \n'; + return html; + } - function checkbox_b(size) { - var html = '
              \n' + - ' \n' + - '
              \n' + - ' \n' + - '
              \n' + - '
              \n'; - return html; - } + function checkbox_b(size) { + var html = '
              \n' + + ' \n' + + '
              \n' + + ' \n' + + '
              \n' + + '
              \n'; + return html; + } - function radio(size) { - var html = '
              \n' + - ' \n' + - '
              \n' + - ' \n' + - ' \n' + - '
              \n' + - '
              \n'; - return html; - } + function radio(size) { + var html = '
              \n' + + ' \n' + + '
              \n' + + ' \n' + + ' \n' + + '
              \n' + + '
              \n'; + return html; + } - function textarea(size) { - var html = '
              \n' + - ' \n' + - '
              \n' + - ' \n' + - '
              \n' + - '
              \n'; - return html; - } + function textarea(size) { + var html = '
              \n' + + ' \n' + + '
              \n' + + ' \n' + + '
              \n' + + '
              \n'; + return html; + } - function submits(size) { - var html = '
              \n' + - '
              \n' + - ' \n' + - ' \n' + - '
              \n' + - '
              \n'; - return html; - } + function submits(size) { + var html = '
              \n' + + '
              \n' + + ' \n' + + ' \n' + + '
              \n' + + '
              \n'; + return html; + } - function jscode() { - var html = ''; - return html; - } + function jscode() { + var html = ''; + return html; + } - function randStrName() { - return Math.random().toString(36).substr(8); - } - - var jscodehtml = jscode(); - $('.js-show').text(jscodehtml) - form.on('submit(formDemo)', function (data) { - layer.msg(JSON.stringify(data.field)); - return false; - }); - exports('design', {}); + function randStrName() { + return Math.random().toString(36).substr(8); + } + var jscodehtml = jscode(); + $('.js-show').text(jscodehtml) + form.on('submit(formDemo)', function(data) { + layer.msg(JSON.stringify(data.field)); + return false; + }); + exports('design', {}); }); diff --git a/src/main/resources/static/component/pear/module/drawer.js b/src/main/resources/static/component/pear/module/drawer.js index 50e2a701..a95e41ac 100644 --- a/src/main/resources/static/component/pear/module/drawer.js +++ b/src/main/resources/static/component/pear/module/drawer.js @@ -1,392 +1,420 @@ -layui.define(['jquery', 'element', 'layer'], function (exports) { - "use strict"; +layui.define(['jquery', 'element', 'layer', 'loading'], function (exports) { + "use strict"; - /** - * Drawer component - * */ - var MOD_NAME = 'drawer', - $ = layui.jquery, - element = layui.element, - layer = layui.layer; + /** + * Drawer component + * */ + var MOD_NAME = 'drawer', + $ = layui.jquery, + element = layui.element, + layer = layui.layer, + loading = layui.loading; - var drawer = new function () { + var drawer = new function () { - /** - * open drawer - * */ - this.open = function (option) { - // 默认使用 legacy 模式 - if (option.legacy === undefined) { - option.legacy = true; - }; - if (option.legacy) { - var obj = new mSlider({ - target: option.target, - dom: option.dom, - direction: option.direction, - distance: option.distance, - time: option.time ? option.time : 0, - maskClose: option.maskClose, - callback: option.success - }); - obj.open(); - return obj; - } else { - return layerDrawer(option); - } - } - this.title = layer.title; - this.style = layer.style; - this.close = layer.close; - this.closeAll = layer.closeAll; - } + /** + * open drawer + * */ + this.open = function (option) { + // 默认使用 legacy 模式 + if (option.legacy === undefined) { + option.legacy = true; + }; + if (option.legacy) { + var obj = new mSlider({ + target: option.target, + dom: option.dom, + direction: option.direction, + distance: option.distance, + time: option.time ? option.time : 0, + maskClose: option.maskClose, + callback: option.success + }); + obj.open(); + return obj; + } else { + return layerDrawer(option); + } + } + this.title = layer.title; + this.style = layer.style; + this.close = layer.close; + this.closeAll = layer.closeAll; + } - /** - * - * 封装 layer.open - * type,anim,move,fixed不可用,其它参数和 layer.open 一致 - * @param {LayerOption} option - * @returns 原生 layer 的 index - */ - function layerDrawer(option) { + /** + * + * 封装 layer.open + * type,anim,move,fixed不可用,其它参数和 layer.open 一致 + * @param {LayerOption} option + * @returns 原生 layer 的 index + */ + function layerDrawer(option) { + var opt = normalizeOption(option) + if (opt.target) appendToTarget(opt); + if (opt.url) loadFragment(opt); + var layerIndex = layer.open(opt); - var opt = normalizeOption(option) - if (opt.target) { - var targetDOM = $(opt.target); - var contentDOM = $(opt.content); - contentDOM.appendTo(targetDOM); - opt.skin = getDrawerAnimationClass(opt.offset, true); - opt.offset = calcOffset(opt.offset, opt.area, targetDOM); - // 处理关闭后偶现 DOM 仍显示的问题,layer 的 BUG - opt.end = Aspect(opt.end, function () { - contentDOM.css("display", "none"); - }) - if (opt.shade) { - // 遮罩和弹层同级处理 - opt.success = Aspect(opt.success, function (layero) { - var shadeDOM = $(".layui-layer-shade"); - shadeDOM.css("position", "absolute"); - shadeDOM.appendTo(layero.parent()); - }) - } - } - var layerIndex = layer.open(opt); + return layerIndex; + } - return layerIndex; - } + /** + * 加载 HTML 片段到 layer content + * @param {*} option + */ + function loadFragment(option) { + option.success = Aspect(option.success, function (layero, index) { + var layerID = "#" + layero.attr("id"); + loading.block({ + type: 1, + elem: layerID, + msg: '' + }); + $.ajax({ + url: option.url, + dataType: "html", + success: function (result) { + layero.children('.layui-layer-content').html(result); + loading.blockRemove(layerID); + } + }) + }) + } - /** - * 规格化 layer.open 选项,兼容原版 Drawer 所有选项 - * @param {LayerOption} option layer.open 的选项 - * @returns 规格化后的 layer.open 选项 - */ - function normalizeOption(option) { - if (option.direction && !option.offset) { - if (option.direction === "right") { - option.offset = "r"; - } else if (option.direction === "left") { - option.offset = "l"; - } else if (option.direction === "top") { - option.offset = "t"; - } else if (option.direction === "bottom") { - option.offset = "b"; - } else { - option.offset = "r"; - } - } - if (option.distance && !option.area) { - option.area = option.distance; - } - if (option.dom && !option.content) { - option.content = $(option.dom); - } - if (option.maskClose && option.shadeClose === undefined) { - option.shadeClose = (option.maskClose + "").toString() !== "false" ? true : false; - } + /** + *将 layer 挂载到指定节点 + * @param {object} opt + */ + function appendToTarget(opt) { + var targetDOM = $(opt.target); + var contentDOM = $(opt.content); + contentDOM.appendTo(targetDOM); + opt.skin = getDrawerAnimationClass(opt.offset, true); + opt.offset = calcOffset(opt.offset, opt.area, targetDOM); + // 处理关闭后偶现 DOM 仍显示的问题,layer 的 BUG + opt.end = Aspect(opt.end, function () { + contentDOM.css("display", "none"); + }) + if (opt.shade) { + opt.success = Aspect(opt.success, function (layero, index) { + var shadeDOM = $("#layui-layer-shade" + index); + shadeDOM.css("position", "absolute"); + shadeDOM.appendTo(layero.parent()); + }) + } + } - option.type = 1 - option.anim = -1; - option.move = false; - option.fixed = true; - if (option.iframe) { - option.type = 2; - option.content = option.iframe; - } - if (option.offset === undefined) option.offset = "r"; - option.area = calcDrawerArea(option.offset, option.area); - if (option.title === undefined) option.title = false; - if (option.closeBtn === undefined) option.closeBtn = false; - if (option.shade === undefined) option.shade = 0.3; - if (option.shadeClose === undefined) option.shadeClose = true; - if (option.skin === undefined) option.skin = getDrawerAnimationClass(option.offset); - if (option.resize === undefined) option.resize = false; - if (option.success === undefined) option.success = function () { }; // 处理遮罩需要 - if (option.end === undefined) option.end = function () { }; + /** + * 规格化 layer.open 选项,兼容原版 Drawer 所有选项 + * @param {LayerOption} option layer.open 的选项 + * @returns 规格化后的 layer.open 选项 + */ + function normalizeOption(option) { + if (option.direction && !option.offset) { + if (option.direction === "right") { + option.offset = "r"; + } else if (option.direction === "left") { + option.offset = "l"; + } else if (option.direction === "top") { + option.offset = "t"; + } else if (option.direction === "bottom") { + option.offset = "b"; + } else { + option.offset = "r"; + } + } + if (option.distance && !option.area) { + option.area = option.distance; + } + if (option.dom && !option.content) { + option.content = $(option.dom); + } + if (option.maskClose && option.shadeClose === undefined) { + option.shadeClose = (option.maskClose + "").toString() !== "false" ? true : false; + } - return option; - } + option.type = 1 + option.anim = -1; + option.move = false; + option.fixed = true; + if (option.iframe) { + option.type = 2; + option.content = option.iframe; + } + if (option.offset === undefined) option.offset = "r"; + option.area = calcDrawerArea(option.offset, option.area); + if (option.title === undefined) option.title = false; + if (option.closeBtn === undefined) option.closeBtn = false; + if (option.shade === undefined) option.shade = 0.3; + if (option.shadeClose === undefined) option.shadeClose = true; + if (option.skin === undefined) option.skin = getDrawerAnimationClass(option.offset); + if (option.resize === undefined) option.resize = false; + if (option.success === undefined) option.success = function () { }; // 处理遮罩需要 + if (option.end === undefined) option.end = function () { }; - /** - * 计算抽屉宽高 - * @param {string} offset 抽屉方向 l = 左, r = 右, t = 上, b = 下 - * @param {string[] | string} drawerArea 抽屉大小,字符串数组格式:[width, height],字符串格式:百分比或单位 px。 - * @returns 抽屉宽高数组 - */ - function calcDrawerArea(offset, drawerArea) { - if (drawerArea instanceof Array) { - return drawerArea; - } - if (drawerArea === undefined || drawerArea === "auto") { - drawerArea = "30%"; - } - if (offset === "l" || offset === "r") { - return [drawerArea, "100%"]; - } else if (offset === "t" || offset === "b") { - return ["100%", drawerArea]; - } - return [drawerArea, "100%"]; - } + return option; + } - /** - * 获取抽屉动画类 - * @param {string} offset 抽屉方向 - * @param {boolean} 是否 absolute 布局 - * @returns 抽屉入场动画类 - */ - function getDrawerAnimationClass(offset, isAbsolute) { - var positionAbsoluteClass = "position-absolute "; - var prefixClass = "pear-drawer pear-drawer-anim layui-anim layer-anim-"; - var suffix = "rl"; + /** + * 计算抽屉宽高 + * @param {string} offset 抽屉方向 l = 左, r = 右, t = 上, b = 下 + * @param {string[] | string} drawerArea 抽屉大小,字符串数组格式:[width, height],字符串格式:百分比或单位 px。 + * @returns 抽屉宽高数组 + */ + function calcDrawerArea(offset, drawerArea) { + if (drawerArea instanceof Array) { + return drawerArea; + } + if (drawerArea === undefined || drawerArea === "auto") { + drawerArea = "30%"; + } + if (offset === "l" || offset === "r") { + return [drawerArea, "100%"]; + } else if (offset === "t" || offset === "b") { + return ["100%", drawerArea]; + } + return [drawerArea, "100%"]; + } - if (isAbsolute) { - prefixClass = positionAbsoluteClass + prefixClass; - } - if (offset === "l") { - suffix = "lr"; - } else if (offset === "r") { - suffix = "rl"; - } else if (offset === "t") { - suffix = "tb"; - } else if (offset === "b") { - suffix = "bt"; - } - return prefixClass + suffix; - } + /** + * 获取抽屉动画类 + * @param {string} offset 抽屉方向 + * @param {boolean} 是否 absolute 布局 + * @returns 抽屉入场动画类 + */ + function getDrawerAnimationClass(offset, isAbsolute) { + var positionAbsoluteClass = "position-absolute "; + var prefixClass = "pear-drawer pear-drawer-anim layui-anim layer-anim-"; + var suffix = "rl"; - /** - * 指定挂载容器重新计算 offset - * @param {*} offset 位置 - * @param {*} area 范围大小 - * @param {*} targetEl 挂载节点 - * @returns 包含抽屉位置信息的数组,[top,left] - */ - function calcOffset(offset, area, targetEl) { - if (offset === undefined || offset === "l" || offset === "t") { - offset = "lt"; - } else if (offset === "r") { - var left; - if (area instanceof Array) { - area = area[0]; - } - if (area.includes("%")) { - left = targetEl.innerWidth() * (1 - area.replace("%", "") / 100); - } else { - left = targetEl.innerWidth() - area; - } - offset = [0, left]; - } else if (offset === "b") { - var top; - if (area instanceof Array) { - area = area[1]; - } - if (area.includes("%")) { - top = targetEl.innerHeight() * (1 - area.replace("%", "") / 100); - } else { - top = targetEl.innerHeight() - area; - } - offset = [top, 0]; - } + if (isAbsolute) { + prefixClass = positionAbsoluteClass + prefixClass; + } + if (offset === "l") { + suffix = "lr"; + } else if (offset === "r") { + suffix = "rl"; + } else if (offset === "t") { + suffix = "tb"; + } else if (offset === "b") { + suffix = "bt"; + } + return prefixClass + suffix; + } - return offset; - } + /** + * 指定挂载容器重新计算 offset + * @param {*} offset 位置 + * @param {*} area 范围大小 + * @param {*} targetEl 挂载节点 + * @returns 包含抽屉位置信息的数组,[top,left] + */ + function calcOffset(offset, area, targetEl) { + if (offset === undefined || offset === "l" || offset === "t") { + offset = "lt"; + } else if (offset === "r") { + var left; + if (area instanceof Array) { + area = area[0]; + } + if (area.indexOf("%") != -1) { + left = targetEl.innerWidth() * (1 - area.replace("%", "") / 100); + } else { + left = targetEl.innerWidth() - area; + } + offset = [0, left]; + } else if (offset === "b") { + var top; + if (area instanceof Array) { + area = area[1]; + } + if (area.indexOf("%") != -1) { + top = targetEl.innerHeight() * (1 - area.replace("%", "") / 100); + } else { + top = targetEl.innerHeight() - area; + } + offset = [top, 0]; + } - /** - * 一个简易的切面 - * @param {Function} func 被通知的对象,原函数 - * @param {Function} before 前置通知 - * @param {Function} after 后置通知 - * @returns 代理函数 - */ - function Aspect(target, before, after) { - function proxyFunc() { - if (before && typeof before === "function") { - before.apply(this, arguments) - } - target.apply(this, arguments); - if (after && typeof after === "function") { - after.apply(this, arguments) - } - } - return proxyFunc; - } + return offset; + } - exports(MOD_NAME, drawer); + /** + * 简易的切面 + * @param {Function} func 被通知的对象,原函数 + * @param {Function | undefined} before 前置通知 + * @param {Function | undefined} after 后置通知 + * @returns 代理函数 + */ + function Aspect(target, before, after) { + function proxyFunc() { + if (before && typeof before === "function") { + before.apply(this, arguments) + } + target.apply(this, arguments); + if (after && typeof after === "function") { + after.apply(this, arguments) + } + } + return proxyFunc; + } + + exports(MOD_NAME, drawer); }); /** * 源码 * */ (function (b, c) { - function a(d) { - this.opts = { - "target": d.target || "body", - "direction": d.direction || "left", - "distance": d.distance || "60%", - "dom": this.Q(d.dom), - "time": d.time || "", - "maskClose": (d.maskClose + "").toString() !== "false" ? true : false, - "callback": d.callback || "" - }; - this.rnd = this.rnd(); - this.target = this.opts.target; - this.dom = this.opts.dom[0]; - this.wrap = ""; - this.inner = ""; - this.mask = ""; - this.init() - } - a.prototype = { - Q: function (d) { - return document.querySelectorAll(d) - }, - isMobile: function () { - return navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i) ? true : false - }, - addEvent: function (f, e, d) { - if (f.attachEvent) { - f.attachEvent("on" + e, d) - } else { - f.addEventListener(e, d, false) - } - }, - rnd: function () { - return Math.random().toString(36).substr(2, 6) - }, - init: function () { - var g = this; - if (!g.dom) { - console.log("未正确绑定弹窗容器"); - return - } - g.dom.style.display = "block"; // 兼容 layer 捕获层 - var d = document.createElement("div"); - var e = document.createElement("div"); - var f = document.createElement("div"); - d.setAttribute("class", "mSlider-main ms-" + g.rnd); - e.setAttribute("class", "mSlider-inner"); - f.setAttribute("class", "mSlider-mask"); - g.Q(g.target)[0].appendChild(d); - g.Q(".ms-" + g.rnd)[0].appendChild(e); - g.Q(".ms-" + g.rnd)[0].appendChild(f); - g.wrap = g.Q(".ms-" + g.rnd)[0]; - g.inner = g.Q(".ms-" + g.rnd + " .mSlider-inner")[0]; - g.mask = g.Q(".ms-" + g.rnd + " .mSlider-mask")[0]; - g.inner.appendChild(g.dom); - switch (g.opts.direction) { - case "top": - g.top = "0"; - g.left = "0"; - g.width = "100%"; - g.height = g.opts.distance; - g.translate = "0,-100%,0"; - break; - case "bottom": - g.bottom = "0"; - g.left = "0"; - g.width = "100%"; - g.height = g.opts.distance; - g.translate = "0,100%,0"; - break; - case "right": - g.top = "0"; - g.right = "0"; - g.width = g.opts.distance; - g.height = document.documentElement.clientHeight + "px"; - g.translate = "100%,0,0"; - break; - default: - g.top = "0"; - g.left = "0"; - g.width = g.opts.distance; - g.height = document.documentElement.clientHeight + "px"; - g.translate = "-100%,0,0" - } - g.wrap.style.display = "none"; - g.wrap.style.position = (g.target === "body" ? "fixed" : "absolute"); - g.wrap.style.top = "0"; - g.wrap.style.left = "0"; - g.wrap.style.width = "100%"; - g.wrap.style.height = "100%"; - g.wrap.style.zIndex = 9999999; - g.inner.style.position = "absolute"; - g.inner.style.top = g.top; - g.inner.style.bottom = g.bottom; - g.inner.style.left = g.left; - g.inner.style.right = g.right; - g.inner.style.width = g.width; - g.inner.style.height = (g.target === "body" ? g.height : "100%"); - g.inner.style.backgroundColor = "#fff"; - g.inner.style.transform = "translate3d(" + g.translate + ")"; - g.inner.style.webkitTransition = "all .2s ease-out"; - g.inner.style.transition = "all .2s ease-out"; - g.inner.style.zIndex = 10000000; - g.mask.style.width = "100%"; - g.mask.style.height = "100%"; - g.mask.style.opacity = "0.1"; - g.mask.style.backgroundColor = "black"; - g.mask.style.zIndex = "9999998"; - g.mask.style.webkitBackfaceVisibility = "hidden"; - g.events() - }, - open: function () { - var d = this; - d.wrap.style.display = "block"; - - setTimeout(function () { - d.inner.style.transform = "translate3d(0,0,0)"; - d.inner.style.webkitTransform = "translate3d(0,0,0)"; - d.mask.style.opacity = 0.1 - }, 30); - if (d.opts.time) { - d.timer = setTimeout(function () { - d.close() - }, d.opts.time) - } - }, - close: function () { - var d = this; - d.timer && clearTimeout(d.timer); - d.inner.style.webkitTransform = "translate3d(" + d.translate + ")"; - d.inner.style.transform = "translate3d(" + d.translate + ")"; - d.mask.style.opacity = 0; - setTimeout(function () { - d.wrap.style.display = "none"; - d.timer = null; - d.opts.callback && d.opts.callback() - }, 300) - }, - events: function () { - var d = this; - d.addEvent(d.mask, "touchmove", function (f) { - f.preventDefault() - }); - d.addEvent(d.mask, (d.isMobile() ? "touchend" : "click"), function (f) { - if (d.opts.maskClose) { - d.close() - } - }) - } - }; - b.mSlider = a -})(window); \ No newline at end of file + function a(d) { + this.opts = { + "target": d.target || "body", + "direction": d.direction || "left", + "distance": d.distance || "60%", + "dom": this.Q(d.dom), + "time": d.time || "", + "maskClose": (d.maskClose + "").toString() !== "false" ? true : false, + "callback": d.callback || "" + }; + this.rnd = this.rnd(); + this.target = this.opts.target; + this.dom = this.opts.dom[0]; + this.wrap = ""; + this.inner = ""; + this.mask = ""; + this.init() + } + a.prototype = { + Q: function (d) { + return document.querySelectorAll(d) + }, + isMobile: function () { + return navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i) ? true : false + }, + addEvent: function (f, e, d) { + if (f.attachEvent) { + f.attachEvent("on" + e, d) + } else { + f.addEventListener(e, d, false) + } + }, + rnd: function () { + return Math.random().toString(36).substr(2, 6) + }, + init: function () { + var g = this; + if (!g.dom) { + console.log("未正确绑定弹窗容器"); + return + } + g.dom.style.display = "block"; // 兼容 layer 捕获层 + var d = document.createElement("div"); + var e = document.createElement("div"); + var f = document.createElement("div"); + d.setAttribute("class", "mSlider-main ms-" + g.rnd); + e.setAttribute("class", "mSlider-inner"); + f.setAttribute("class", "mSlider-mask"); + g.Q(g.target)[0].appendChild(d); + g.Q(".ms-" + g.rnd)[0].appendChild(e); + g.Q(".ms-" + g.rnd)[0].appendChild(f); + g.wrap = g.Q(".ms-" + g.rnd)[0]; + g.inner = g.Q(".ms-" + g.rnd + " .mSlider-inner")[0]; + g.mask = g.Q(".ms-" + g.rnd + " .mSlider-mask")[0]; + g.inner.appendChild(g.dom); + switch (g.opts.direction) { + case "top": + g.top = "0"; + g.left = "0"; + g.width = "100%"; + g.height = g.opts.distance; + g.translate = "0,-100%,0"; + break; + case "bottom": + g.bottom = "0"; + g.left = "0"; + g.width = "100%"; + g.height = g.opts.distance; + g.translate = "0,100%,0"; + break; + case "right": + g.top = "0"; + g.right = "0"; + g.width = g.opts.distance; + g.height = document.documentElement.clientHeight + "px"; + g.translate = "100%,0,0"; + break; + default: + g.top = "0"; + g.left = "0"; + g.width = g.opts.distance; + g.height = document.documentElement.clientHeight + "px"; + g.translate = "-100%,0,0" + } + g.wrap.style.display = "none"; + g.wrap.style.position = (g.target === "body" ? "fixed" : "absolute"); + g.wrap.style.top = "0"; + g.wrap.style.left = "0"; + g.wrap.style.width = "100%"; + g.wrap.style.height = "100%"; + g.wrap.style.zIndex = 9999999; + g.inner.style.position = "absolute"; + g.inner.style.top = g.top; + g.inner.style.bottom = g.bottom; + g.inner.style.left = g.left; + g.inner.style.right = g.right; + g.inner.style.width = g.width; + g.inner.style.height = (g.target === "body" ? g.height : "100%"); + g.inner.style.backgroundColor = "#fff"; + g.inner.style.transform = "translate3d(" + g.translate + ")"; + g.inner.style.webkitTransition = "all .2s ease-out"; + g.inner.style.transition = "all .2s ease-out"; + g.inner.style.zIndex = 10000000; + g.mask.style.width = "100%"; + g.mask.style.height = "100%"; + g.mask.style.opacity = "0.1"; + g.mask.style.backgroundColor = "black"; + g.mask.style.zIndex = "9999998"; + g.mask.style.webkitBackfaceVisibility = "hidden"; + g.events() + }, + open: function () { + var d = this; + d.wrap.style.display = "block"; + setTimeout(function () { + d.inner.style.transform = "translate3d(0,0,0)"; + d.inner.style.webkitTransform = "translate3d(0,0,0)"; + d.mask.style.opacity = 0.1 + }, 30); + if (d.opts.time) { + d.timer = setTimeout(function () { + d.close() + }, d.opts.time) + } + }, + close: function () { + var d = this; + d.timer && clearTimeout(d.timer); + d.inner.style.webkitTransform = "translate3d(" + d.translate + ")"; + d.inner.style.transform = "translate3d(" + d.translate + ")"; + d.mask.style.opacity = 0; + setTimeout(function () { + d.wrap.style.display = "none"; + d.timer = null; + d.opts.callback && d.opts.callback() + }, 300) + }, + events: function () { + var d = this; + d.addEvent(d.mask, "touchmove", function (f) { + f.preventDefault() + }); + d.addEvent(d.mask, (d.isMobile() ? "touchend" : "click"), function (f) { + if (d.opts.maskClose) { + d.close() + } + }) + } + }; + b.mSlider = a +})(window); diff --git a/src/main/resources/static/component/pear/module/dtree.js b/src/main/resources/static/component/pear/module/dtree.js index 18295381..e4f2d2dd 100644 --- a/src/main/resources/static/component/pear/module/dtree.js +++ b/src/main/resources/static/component/pear/module/dtree.js @@ -191,10 +191,10 @@ layui.define(['jquery','layer','form'], function(exports) { contentType : config.contentType, xhrFields: {withCredentials: config.withCredentials}, beforeSend: function (XMLHttpRequest, self) { - if (typeof (config.beforeSend) === "function") { + if (typeof (config.beforeSend) === "function") { return config.beforeSend(XMLHttpRequest, self); } - return true; + return true; }, success : config.success, error : function(XMLHttpRequest, textStatus, errorThrown) { @@ -402,7 +402,7 @@ layui.define(['jquery','layer','form'], function(exports) { basicData: "", //用户自定义的记录节点数据 recordData: "", //当前data数据(排除basicData和children字段) }; - + this.toolbarMenu = {}; // 工具栏右键菜单绑定的所有元素 this.checkbarNode = []; // 复选框标记的全部节点数据 this.errData = []; // 记录在渲染节点时有问题的数据 @@ -411,7 +411,7 @@ layui.define(['jquery','layer','form'], function(exports) { this.bak = ""; // 临时变量 this.setting(options); }; - + /******************** 初始参数加载 ********************/ /** * @Desc: 设置基本属性值 @@ -550,12 +550,12 @@ layui.define(['jquery','layer','form'], function(exports) { this.iframeFun = $.extend(this.iframeFun, this.options.iframeFun) || $.extend(this.iframeFun, OPTIONS.iframeFun) || this.iframeFun; //iframe事件加载 /** 下拉树模式参数**/ - this.select = this.options.select || false; + this.select = this.options.select || false; if(this.select) { - // 重置下拉树 - this.selectSetting(); + // 重置下拉树 + this.selectSetting(); } - + /** 调用确认最终主题方法*/ this.ensureTheme(); }; @@ -696,22 +696,22 @@ layui.define(['jquery','layer','form'], function(exports) { /** 下拉树模式参数**/ if(this.select) { - // 重置下拉树 - this.reloadSelectSetting(); + // 重置下拉树 + this.reloadSelectSetting(); } - + /** 调用确认最终主题方法*/ this.ensureTheme(); - + }; - + /** * @Desc: 设置下拉树的基本参数值 - */ + */ DTree.prototype.selectSetting = function() { - /** select模式参数*/ + /** select模式参数*/ this.select = true; //配置成select模式 - + this.selectInitVal = this.obj.attr("data-value") || this.options.selectInitVal || ""; //输入框的值 this.selectTreeDiv = this.obj[0].id + "_tree_div"; // 上级DIV节点 this.selectCardDiv = this.obj[0].id + "_select_card_div"; // 上级layui卡片节点 @@ -720,21 +720,21 @@ layui.define(['jquery','layer','form'], function(exports) { this.selectTips = this.options.selectTips || "请选择"; // 输入框的提示语 this.selectCardHeight = this.options.selectCardHeight || "350"; // 下拉面板的高度 this.selectInputName = this.options.selectInputName || {nodeId: this.obj[0].id + "_select_nodeId"}; // select表单中的元素 - + // 调取下拉树的特殊处理页面元素标识 this.renderSelectDom(); } - + /** * @Desc: 重置下拉树的基本参数值 */ DTree.prototype.reloadSelectSetting = function() { - - this.selectInitVal = this.obj.attr("data-value") || this.options.selectInitVal || this.selectInitVal; //输入框的值 + + this.selectInitVal = this.obj.attr("data-value") || this.options.selectInitVal || this.selectInitVal; //输入框的值 this.selectTips = this.options.selectTips || this.selectTips; // 输入框的提示语 this.selectCardHeight = this.options.selectCardHeight || this.selectCardHeight; // 下拉面板的高度 this.selectInputName = $.extend(this.selectInputName, this.options.selectInputName) || this.selectInputName; // select表单中的元素 - + // 调取下拉树的特殊处理页面元素标识 this.reloadSelectDom(); } @@ -746,57 +746,57 @@ layui.define(['jquery','layer','form'], function(exports) { DTree.prototype.renderSelectDom = function() { var _this = this; var rootId = _this.obj[0].id; - + // 设置自定义表单隐藏域 var selectInputName = _this.selectInputName; var selectInput = []; for(var key in selectInputName) { - selectInput.push(''); + selectInput.push(''); } // 设置html var prevHtml = ['
              ', - '
              ', selectInput.join(""), - '', - '', - '
              '].join(''); + '
              ', selectInput.join(""), + '', + '', + '
              '].join(''); _this.obj.before(prevHtml); var cardStyle = "style="; if(this.selectCardHeight) { - cardStyle += "'height:"+_this.selectCardHeight+"px'"; + cardStyle += "'height:"+_this.selectCardHeight+"px'"; } _this.obj.wrap('
              ').wrap('
              ').wrap('
              '); - + } - + /** * @Desc: 重新渲染下拉树的Dom结构 */ DTree.prototype.reloadSelectDom = function() { var _this = this; var rootId = _this.obj[0].id; - + // 设置自定义表单隐藏域 var selectInputName = _this.selectInputName; var selectInput = []; for(var key in selectInputName) { - selectInput.push(''); + selectInput.push(''); } - + $("div[dtree-id='"+rootId+"'][dtree-select='"+_this.selectDiv+"']").find("div.layui-select-title").html(""); // 设置html - var prevHtml = [selectInput.join(""), - '', - ''].join(''); + var prevHtml = [selectInput.join(""), + '', + ''].join(''); $("div[dtree-id='"+rootId+"'][dtree-select='"+_this.selectDiv+"']").find("div.layui-select-title").html(prevHtml); var cardStyle = "style="; if(this.selectCardHeight) { - cardStyle += "'height:"+_this.selectCardHeight+"px'"; + cardStyle += "'height:"+_this.selectCardHeight+"px'"; } $("div[dtree-id='"+rootId+"'][dtree-card='"+_this.selectCardDiv+"']").attr("style", cardStyle); } @@ -811,74 +811,74 @@ layui.define(['jquery','layer','form'], function(exports) { var selectInputName = _this.selectInputName; var selectTipsNameValue = ""; var selectValues = {}; - + // 如果开启了复选框,则此方法用来取值 if(_this.checkbar) { - return _this.selectCheckboxVal(); + return _this.selectCheckboxVal(); } - + if(typeof param === 'undefined') { // 不传,则为当前树中记录的ID - param = _this.getNowParam(); + param = _this.getNowParam(); } if(typeof param === 'string') { // 传递ID,则查询树节点ID对应的值 - param = _this.getParam(param); + param = _this.getParam(param); } - + selectTipsNameValue = param["context"]; - for(var key in selectInputName) { - selectValues[selectInputName[key]] = param[key]; - $("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "'][name='"+selectInputName[key]+"']").val(param[key] || ""); - } - - if(param["nodeId"] && !param["context"]) { - selectTipsNameValue = _this.getParam(param["nodeId"]); - } - + for(var key in selectInputName) { + selectValues[selectInputName[key]] = param[key]; + $("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "'][name='"+selectInputName[key]+"']").val(param[key] || ""); + } + + if(param["nodeId"] && !param["context"]) { + selectTipsNameValue = _this.getParam(param["nodeId"]); + } + // 返显提示输入框值 $("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "'][name='"+_this.selectTipsName+"']").val(selectTipsNameValue || ""); - + // 返回隐藏域中的值 return selectValues; } - + /** * @Desc: 设置复选框模式中的下拉树的选中值 */ DTree.prototype.selectCheckboxVal = function() { - var _this = this; - var rootId = _this.obj[0].id; - var selectInputName = _this.selectInputName; - - // 获取全部复选框选中节点 - var param = _this.getCheckbarJsonArrParam(); - - selectTipsNameValue = param["context"]; - var selectValues = {}; - for(var key in selectInputName) { - var value = param[key].join(","); - selectValues[selectInputName[key]] = value; - $("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "'][name='"+selectInputName[key]+"']").val(value); - } - - $("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "'][name='"+_this.selectTipsName+"']").val(selectTipsNameValue); - - // 返回隐藏域中的值 + var _this = this; + var rootId = _this.obj[0].id; + var selectInputName = _this.selectInputName; + + // 获取全部复选框选中节点 + var param = _this.getCheckbarJsonArrParam(); + + selectTipsNameValue = param["context"]; + var selectValues = {}; + for(var key in selectInputName) { + var value = param[key].join(","); + selectValues[selectInputName[key]] = value; + $("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "'][name='"+selectInputName[key]+"']").val(value); + } + + $("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "'][name='"+_this.selectTipsName+"']").val(selectTipsNameValue); + + // 返回隐藏域中的值 return selectValues; } - + /** * @Desc: 重置下拉树的值,1.表单清空;2.节点重置;3.复选框重置 */ DTree.prototype.selectResetVal = function() { - var _this = this; - var rootId = _this.obj[0].id; - // 表单清空 + var _this = this; + var rootId = _this.obj[0].id; + // 表单清空 $("input[dtree-id='"+rootId+"']").val(""); // 节点重置 _this.cancelNavThis(); if(_this.checkbar) { - // 复选框重置 - _this.cancelCheckedNode(); + // 复选框重置 + _this.cancelCheckedNode(); } } @@ -1462,51 +1462,51 @@ layui.define(['jquery','layer','form'], function(exports) { * @Desc: 初始化加载 */ DTree.prototype.loadTreeInit = function(){ - var _this = this; - var asyncLoad = _this.asyncLoad; - // 初始化加载 - _this.init(function(){ - // ajax加载之后的回调 - if(asyncLoad && asyncLoad.length > 0) { - _this.obj.addClass(NAV_SHOW); - - // 说明此时要异步加载子节点 - _this.loadChildTreeInit(asyncLoad, 0); - } - }) + var _this = this; + var asyncLoad = _this.asyncLoad; + // 初始化加载 + _this.init(function(){ + // ajax加载之后的回调 + if(asyncLoad && asyncLoad.length > 0) { + _this.obj.addClass(NAV_SHOW); + + // 说明此时要异步加载子节点 + _this.loadChildTreeInit(asyncLoad, 0); + } + }) } - + /** * @Desc: 初始化加载子节点 * @Param: asyncLoad: 需异步加载的层级,在基础属性中配置 * @Param: i: 已经加载到的层级 */ DTree.prototype.loadChildTreeInit = function(asyncLoad, i){ - var _this = this; - if(i == asyncLoad.length) { // 满足条件,终止递归 - return ; - } - - var $div = _this.getNode(asyncLoad[i]); - - if($div && $div.length > 0) { - // 设置节点状态 - var $ul = $div.next("ul"), - $i_fnode = _this.getNodeDom($div).fnode(), - $i_snode = _this.getNodeDom($div).snode(); - - $ul.addClass(NAV_SHOW); - _this.accordionUL($ul); - _this.operateIcon($i_fnode, $i_snode).open(); - // 加载子节点 - _this.getChild($div, undefined, function(){ - // 继续递归 - _this.loadChildTreeInit(asyncLoad, ++i); - }); - } - + var _this = this; + if(i == asyncLoad.length) { // 满足条件,终止递归 + return ; + } + + var $div = _this.getNode(asyncLoad[i]); + + if($div && $div.length > 0) { + // 设置节点状态 + var $ul = $div.next("ul"), + $i_fnode = _this.getNodeDom($div).fnode(), + $i_snode = _this.getNodeDom($div).snode(); + + $ul.addClass(NAV_SHOW); + _this.accordionUL($ul); + _this.operateIcon($i_fnode, $i_snode).open(); + // 加载子节点 + _this.getChild($div, undefined, function(){ + // 继续递归 + _this.loadChildTreeInit(asyncLoad, ++i); + }); + } + } - + /** * @Desc: 初始化树 * @Param: callback: 异步加载完成之后的回调函数 @@ -1522,9 +1522,9 @@ layui.define(['jquery','layer','form'], function(exports) { _this.autoHeight(); if(_this.data) { - _this.dataLoadTree(true, _this.obj, _this.data); + _this.dataLoadTree(true, _this.obj, _this.data); } else { - _this.asyncLoadTree(true, _this.obj, callback); + _this.asyncLoadTree(true, _this.obj, callback); } }; @@ -1540,12 +1540,12 @@ layui.define(['jquery','layer','form'], function(exports) { _this.setNodeParam($div); if(typeof data !== 'undefined') { - _this.dataLoadTree(false, $ul, data); + _this.dataLoadTree(false, $ul, data); } else { - _this.asyncLoadTree(false, $ul, callback); + _this.asyncLoadTree(false, $ul, callback); } }; - + /** * @Desc: 用data加载树 * @Param: first: 表示是否第一次加载 @@ -1553,21 +1553,21 @@ layui.define(['jquery','layer','form'], function(exports) { * @Param: data: data加载的数据 */ DTree.prototype.dataLoadTree = function(first, $ul, data){ - var _this = this; - - if(typeof data.length === 'undefined'){ + var _this = this; + + if(typeof data.length === 'undefined'){ layer.msg("数据解析异常,data数据格式不正确", {icon:5}); return ; } if(first && data.length == 0) { - $ul.html(_this.getNoneDom().text()); + $ul.html(_this.getNoneDom().text()); return ; } //先将ul中的元素清空 $ul.html(""); - + var index = _this.load ? layer.load(1) : ""; setTimeout(function () { @@ -1579,7 +1579,7 @@ layui.define(['jquery','layer','form'], function(exports) { var pid = (first == true) ? $ul.attr("data-id") : _this.node.nodeId; var level = (first == true) ? 1 : parseInt(_this.node.level)+1; - + // 解析树 if (_this.dataFormat == 'list'){ //1.构建一个存放节点的树组 @@ -1588,7 +1588,7 @@ layui.define(['jquery','layer','form'], function(exports) { } else { _this.loadTree(data, level); } - + // 显示树线 _this.showLine(); @@ -1599,28 +1599,28 @@ layui.define(['jquery','layer','form'], function(exports) { // 判断是否存在错误数据,并是否打印错误数据 _this.msgErrData(); - + // 设置下拉树的初始值 if(first && _this.select && _this.selectInitVal){ - if(_this.checkbar) { // 复选框模式下 - _this.chooseDataInit(_this.selectInitVal); - _this.selectCheckboxVal(_this.selectInitVal); - } else { // 普通模式下 - _this.dataInit(_this.selectInitVal); - _this.selectVal(_this.selectInitVal); - } + if(_this.checkbar) { // 复选框模式下 + _this.chooseDataInit(_this.selectInitVal); + _this.selectCheckboxVal(_this.selectInitVal); + } else { // 普通模式下 + _this.dataInit(_this.selectInitVal); + _this.selectVal(_this.selectInitVal); + } } // 保存树副本 _this.bak = _this.obj.html(); - + // 加载完毕后的回调 _this.done(_this.data, $ul, first); - + if(_this.load){layer.close(index);} }, 100); } - + /** * @Desc: 异步加载树 * @Param: first: 表示是否第一次加载 @@ -1628,9 +1628,9 @@ layui.define(['jquery','layer','form'], function(exports) { * @Param: callback: 异步加载完成之后的回调函数 */ DTree.prototype.asyncLoadTree = function(first, $ul, callback){ - var _this = this; - - if (!_this.url) { + var _this = this; + + if (!_this.url) { layer.msg("数据请求异常,url参数未指定", {icon:5}); return ; } @@ -1650,12 +1650,12 @@ layui.define(['jquery','layer','form'], function(exports) { withCredentials: _this.withCredentials, data: _this.getFilterRequestParam(_this.getRequestParam()), beforeSend: function(XMLHttpRequest, self){ - index = _this.load ? layer.load(1) : ""; - var returnFlag = _this.beforeSend(this, XMLHttpRequest, self); - if(!returnFlag) { - if(_this.load){layer.close(index);} - } - return returnFlag; + index = _this.load ? layer.load(1) : ""; + var returnFlag = _this.beforeSend(this, XMLHttpRequest, self); + if(!returnFlag) { + if(_this.load){layer.close(index);} + } + return returnFlag; }, success: function(result) { if (typeof result === 'string') { @@ -1676,7 +1676,7 @@ layui.define(['jquery','layer','form'], function(exports) { } if (code == _this.response.statusCode) { - + var d = result[_this.response.rootName]; if(first && typeof d.length === 'undefined'){ @@ -1693,21 +1693,21 @@ layui.define(['jquery','layer','form'], function(exports) { //1.识别根节点ul中的data-id标签,判断顶级父节点 var pid = (first == true) ? $ul.attr("data-id") : _this.node.nodeId; var level = (first == true) ? 1 : parseInt(_this.node.level)+1; - + // 第一次解析树 if (_this.dataFormat == 'list'){ //1.构建一个存放节点的树组 var rootListData = _this.queryListTreeByPid(pid, d); if(first) { - _this.loadListTree(rootListData, d, level); + _this.loadListTree(rootListData, d, level); } else { - _this.loadListTree(rootListData, d, level, $ul); + _this.loadListTree(rootListData, d, level, $ul); } } else { - if(first) { - _this.loadTree(d, level); + if(first) { + _this.loadTree(d, level); } else { - _this.loadTree(d, level, $ul); + _this.loadTree(d, level, $ul); } } @@ -1721,28 +1721,28 @@ layui.define(['jquery','layer','form'], function(exports) { // 判断是否存在错误数据,并是否打印错误数据 _this.msgErrData(); - + if(!first) { - $ul.addClass(NAV_SHOW); + $ul.addClass(NAV_SHOW); } - + // 设置下拉树的初始值 if(first && _this.select && _this.selectInitVal){ - if(_this.checkbar) { // 复选框模式下 - _this.chooseDataInit(_this.selectInitVal); - _this.selectCheckboxVal(_this.selectInitVal); - } else { // 普通模式下 - _this.dataInit(_this.selectInitVal); - _this.selectVal(_this.selectInitVal); - } + if(_this.checkbar) { // 复选框模式下 + _this.chooseDataInit(_this.selectInitVal); + _this.selectCheckboxVal(_this.selectInitVal); + } else { // 普通模式下 + _this.dataInit(_this.selectInitVal); + _this.selectVal(_this.selectInitVal); + } } // 保存树副本 _this.bak = _this.obj.html(); - + // 加载完毕后的回调 _this.done(result, $ul, first); - + callback && callback(); } else { // 如果打印不出任何信息说明是在这里,用了错误的数据格式, 或返回码不正确 @@ -1764,7 +1764,7 @@ layui.define(['jquery','layer','form'], function(exports) { _this.complete(XMLHttpRequest, textStatus); } }); - + } /** @@ -1851,7 +1851,7 @@ layui.define(['jquery','layer','form'], function(exports) { /** * @Desc: 判断在数据加载时是否存在错误数据,并是否打印错误数据 - * @Param: + * @Param: */ DTree.prototype.msgErrData = function() { var _this = this; @@ -2282,10 +2282,10 @@ layui.define(['jquery','layer','form'], function(exports) { $div.attr("data-record", recordData); }, p_li: function(pId){ - var $li = $div.parent("li"); - $li.attr("data-id", treeId); + var $li = $div.parent("li"); + $li.attr("data-id", treeId); if(pId) { - $li.attr("data-pid", pId); + $li.attr("data-pid", pId); } return $li; } @@ -2331,12 +2331,12 @@ layui.define(['jquery','layer','form'], function(exports) { var lineClass = ""; if(hide){hideClass = NAV_HIDE;} var li = ["
            • " + - div , - dom.fnode(), - dom.node(), - dom.checkbox(), - dom.text(), - "
            • ", dom.ul(), ""].join(""); + div , + dom.fnode(), + dom.node(), + dom.checkbox(), + dom.text(), + "
              ", dom.ul(), ""].join(""); return li; }; @@ -2349,44 +2349,44 @@ layui.define(['jquery','layer','form'], function(exports) { var _this = this; var $div = _this.obj.find("div[data-id='"+chooseId+"']"); if($div && $div.length > 0) { - _this.obj.find("."+NAV_THIS).removeClass(NAV_THIS); - _this.obj.find("."+_this.style.itemThis).removeClass(_this.style.itemThis); - $div.addClass(NAV_THIS); - $div.addClass(_this.style.itemThis); - _this.setNodeParam($div); - // 将该节点的父节点全部展开 - var $li_parents = $div.parents("."+LI_NAV_ITEM); - $li_parents.children("ul").addClass(NAV_SHOW); - $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.fnode.node.close)).addClass(_this.usefontStyle.fnode.node.open); - $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.fnode.node.close)).removeClass(_this.usefontStyle.fnode.node.close); - $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.snode.node.close)).addClass(_this.usefontStyle.snode.node.open); - $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.snode.node.close)).removeClass(_this.usefontStyle.snode.node.close); + _this.obj.find("."+NAV_THIS).removeClass(NAV_THIS); + _this.obj.find("."+_this.style.itemThis).removeClass(_this.style.itemThis); + $div.addClass(NAV_THIS); + $div.addClass(_this.style.itemThis); + _this.setNodeParam($div); + // 将该节点的父节点全部展开 + var $li_parents = $div.parents("."+LI_NAV_ITEM); + $li_parents.children("ul").addClass(NAV_SHOW); + $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.fnode.node.close)).addClass(_this.usefontStyle.fnode.node.open); + $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.fnode.node.close)).removeClass(_this.usefontStyle.fnode.node.close); + $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.snode.node.close)).addClass(_this.usefontStyle.snode.node.open); + $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.snode.node.close)).removeClass(_this.usefontStyle.snode.node.close); } return _this.getNowParam(); }; - + /** * @Desc: 基于备份的Html数据回滚 * @Param: chooseId: 节点ID */ DTree.prototype.rollbackHtml = function(chooseId){ - var _this = this; - if(_this.bak) { - _this.obj.html(_this.bak); - // 取消全部选中状态 - _this.cancelNavThis(); - if(_this.checkbar) { - _this.cancelCheckedNode(); - _this.chooseDataInit(chooseId); - } else { - _this.dataInit(chooseId); - } - - _this.bak = _this.obj.html(); - } + var _this = this; + if(_this.bak) { + _this.obj.html(_this.bak); + // 取消全部选中状态 + _this.cancelNavThis(); + if(_this.checkbar) { + _this.cancelCheckedNode(); + _this.chooseDataInit(chooseId); + } else { + _this.dataInit(chooseId); + } + + _this.bak = _this.obj.html(); + } }; - + /******************** 基础事件区域 ********************/ /** * @Desc: 数据格式化 @@ -2498,32 +2498,32 @@ layui.define(['jquery','layer','form'], function(exports) { var _this = this; var disabledId = []; if(typeof disabledIds === "string") { - disabledId = disabledIds.split(","); + disabledId = disabledIds.split(","); } else { - disabledId = disabledIds; + disabledId = disabledIds; } - + if(disabledIds.length) { - for (var i=0; i 0) { - for(var i=0; i 0) { + for(var i=0; i 0) { _this.checkStatus($i).check(); } + var _this = this; + var $i = _this.obj.find("i[data-par][data-checked!='1']"); + if($i.length > 0) { _this.checkStatus($i).check(); } } - + /** * @Desc: 取消全部复选框选中 */ DTree.prototype.cancelCheckedNode = function(){ - var _this = this; - var $i = _this.obj.find("i[data-par][data-checked!='0']"); - if($i.length > 0) { _this.checkStatus($i).noCheck(); } + var _this = this; + var $i = _this.obj.find("i[data-par][data-checked!='0']"); + if($i.length > 0) { _this.checkStatus($i).noCheck(); } } - + /** * @Desc: 反选复选框 */ DTree.prototype.invertCheckedNode = function(){ - var _this = this; - if(_this.obj.find("i[data-par]").length > 0) { + var _this = this; + if(_this.obj.find("i[data-par]").length > 0) { var flag = false; _this.obj.find("i[data-par]").each(function(){ var $i = $(this); if($i.attr("data-checked") == '2'){ - flag = true; + flag = true; }else if($i.attr("data-checked") == '0') { _this.checkStatus($i).check(); }else if($i.attr("data-checked") == '1') { @@ -3481,13 +3481,13 @@ layui.define(['jquery','layer','form'], function(exports) { } } } - + /** * @Desc: 删除选中节点 */ DTree.prototype.removeCheckedNode = function(){ - var _this = this; - var len = _this.obj.find("i[data-par][data-checked='1']").length; + var _this = this; + var len = _this.obj.find("i[data-par][data-checked='1']").length; if(len == 0){ layer.msg("请至少选中一个节点",{icon:2}); }else{ @@ -3517,7 +3517,7 @@ layui.define(['jquery','layer','form'], function(exports) { /******************** 工具栏及菜单栏区域 ********************/ /** * @Desc: 初始化菜单栏和工具栏的div - */ + */ DTree.prototype.initTreePlus = function(){ var _this = this; // 初始化菜单栏和工具栏的div @@ -3537,7 +3537,7 @@ layui.define(['jquery','layer','form'], function(exports) { /** * @Desc: 开启工具栏和菜单栏 - */ + */ DTree.prototype.openTreePlus = function(){ var _this = this; // 先对工具栏做处理,因为菜单栏可能会与工具栏产生关联。 @@ -3742,16 +3742,16 @@ layui.define(['jquery','layer','form'], function(exports) { _this.refreshTree(); }, checkAll: function(){ // 全选节点 - _this.checkAllNode(); + _this.checkAllNode(); }, unCheckAll: function(){ // 全不选节点 _this.cancelCheckedNode(); }, invertAll: function(){ // 反选节点 - _this.invertCheckedNode(); + _this.invertCheckedNode(); }, remove: function(){// 删除选中节点 - _this.removeCheckedNode(); + _this.removeCheckedNode(); }, searchNode: function(){//模糊查询该值,展开该值节点 layer.prompt({ @@ -4083,7 +4083,7 @@ layui.define(['jquery','layer','form'], function(exports) { $p_ul = $p_li.parent("ul"), //当前选中节点的顶级li节点的父级ul $p_div = $p_ul.prev("div"), //当前选中节点的顶级li节点的父级ul的前一个div title = (typeof _this.formatter.title === 'function') ? $cite.attr("data-title") : $cite.text(); - + switch (tool) { case defaultTool.pulldown: _this.toolbarMethod().pulldown($ul); @@ -4588,7 +4588,7 @@ layui.define(['jquery','layer','form'], function(exports) { * @Desc: 加载iframe * @Param: $div: JQuery对象,表示当前节点 * @Param: iframeParam: iframe加载的参数 - */ + */ DTree.prototype.loadIframe = function($div, iframeParam) { var _this = this; var $cite = _this.getNodeDom($div).cite(); @@ -4757,16 +4757,16 @@ layui.define(['jquery','layer','form'], function(exports) { var basicData = $div.attr("data-basic"); if(basicData) { - basicData = JSON.parse(event.unescape(basicData)); + basicData = JSON.parse(event.unescape(basicData)); } _this.node.basicData = basicData; - + var recordData = $div.attr("data-record"); if(recordData) { - recordData = JSON.parse(event.unescape(recordData)); + recordData = JSON.parse(event.unescape(recordData)); } _this.node.recordData = recordData; - + if (_this.getNodeDom($div).checkbox()) { var dataTypes = "", checkeds = "", initcheckeds = ""; _this.getNodeDom($div).checkbox().each(function(){ @@ -4813,18 +4813,18 @@ layui.define(['jquery','layer','form'], function(exports) { temp_node.leaf = _this.getNodeDom($div).cite().attr("data-leaf") == "leaf" ? true : false; temp_node.level = _this.getNodeDom($div).parentLi().attr("data-index"); temp_node.spread = _this.getNodeDom($div).fnode().attr("data-spread") == "open" ? true : false; - + var basicData = $div.attr("data-basic"); if(basicData) { - basicData = JSON.parse(event.unescape(basicData)); + basicData = JSON.parse(event.unescape(basicData)); } temp_node.basicData = basicData; var recordData = $div.attr("data-record"); if(recordData) { - recordData = JSON.parse(event.unescape(recordData)); + recordData = JSON.parse(event.unescape(recordData)); } temp_node.recordData = recordData; - + if (_this.getNodeDom($div).checkbox()) { var dataTypes = "", checkeds = "", initcheckeds = ""; _this.getNodeDom($div).checkbox().each(function(){ @@ -4859,9 +4859,9 @@ layui.define(['jquery','layer','form'], function(exports) { _this.node.initchecked = ""; _this.node.basicData = ""; _this.node.recordData = ""; - + if(_this.select) { - _this.selectResetVal(); + _this.selectResetVal(); } }; @@ -5034,7 +5034,7 @@ layui.define(['jquery','layer','form'], function(exports) { node = _this.getNodeParam($div); _this.toolbarHide(); _this.navThis($div); - + if(_this.select) { _this.selectVal(node.nodeId); $("div[dtree-id='" + rootId + "'][dtree-select='"+_this.selectDiv+"']").click(); @@ -5097,7 +5097,7 @@ layui.define(['jquery','layer','form'], function(exports) { var flag = _this.checkbarFun.chooseBefore($i, _this.getRequestParam(node)); _this.temp = [$i]; if(flag){_this.changeCheck();} - + event.stopPropagation(); }); } @@ -5214,34 +5214,34 @@ layui.define(['jquery','layer','form'], function(exports) { var dl = $(this).find('dl'); //debugger; $(this).toggleClass("layui-form-selected"); - + var $card = $("div[dtree-id='" + rootId + "'][dtree-card='"+_this.selectCardDiv+"']"); - + $card.toggleClass("dtree-select-show layui-anim layui-anim-upbit"); var top = $(this).offset().top + $(this).outerHeight() - $WIN.scrollTop() - 5, - cardHeight = $card.height(), - winHeight = $WIN.height(); + cardHeight = $card.height(), + winHeight = $WIN.height(); // console.log("top = $(this).offset().top: " + $(this).offset().top + " + $(this).outerHeight(): " + $(this).outerHeight() + " - $WIN.scrollTop(): " + $WIN.scrollTop() + " - 5 =" + top); // console.log("winHeight = " + winHeight); if($card.hasClass('dtree-select-up')) { - $card.removeClass('dtree-select-up'); - } - - //上下定位识别 + $card.removeClass('dtree-select-up'); + } + + //上下定位识别 if(top + cardHeight > $WIN.height() && top >= cardHeight){ - console.log(" top + cardHeight : "+ top + " + " + cardHeight + " > $WIN.height() :" + $WIN.height() + " && top >= cardHeight :" + top + " > " + cardHeight); - if($card.hasClass('dtree-select-up')) { - $card.removeClass('dtree-select-up'); - } else { - $card.addClass('dtree-select-up'); - } - } else { - $card.removeClass('dtree-select-up'); - } - + console.log(" top + cardHeight : "+ top + " + " + cardHeight + " > $WIN.height() :" + $WIN.height() + " && top >= cardHeight :" + top + " > " + cardHeight); + if($card.hasClass('dtree-select-up')) { + $card.removeClass('dtree-select-up'); + } else { + $card.addClass('dtree-select-up'); + } + } else { + $card.removeClass('dtree-select-up'); + } + // 下拉树面板开闭状态改变后,用户自定义想做的事情 layui.event.call(this, MOD_NAME, "changeSelect("+$(_this.obj)[0].id+")", { - show: $(this).hasClass("layui-form-selected"), + show: $(this).hasClass("layui-form-selected"), param: _this.selectVal() }); }); @@ -5252,9 +5252,9 @@ layui.define(['jquery','layer','form'], function(exports) { // 绑定body的单击,让本页面所有的toolbar隐藏 $BODY.on("click", function(event){ $("div."+LI_DIV_TOOLBAR).find(".layui-show").removeClass('layui-anim-fadein layui-show'); - // $("div[dtree-id][dtree-select]").removeClass("layui-form-selected"); - // $("div[dtree-id][dtree-card]").removeClass("dtree-select-show layui-anim layui-anim-upbit"); - + // $("div[dtree-id][dtree-select]").removeClass("layui-form-selected"); + // $("div[dtree-id][dtree-card]").removeClass("dtree-select-show layui-anim layui-anim-upbit"); + }); // 解绑浏览器事件 @@ -5280,11 +5280,11 @@ layui.define(['jquery','layer','form'], function(exports) { } } } - + // 下拉树解绑 if(_this.select) { // 解绑select的点击事件 - $("div[dtree-id='" + _this.obj[0].id + "'][dtree-select='"+_this.selectDiv+"']").removeClass("layui-form-selected"); + $("div[dtree-id='" + _this.obj[0].id + "'][dtree-select='"+_this.selectDiv+"']").removeClass("layui-form-selected"); $("div[dtree-id='" + _this.obj[0].id + "'][dtree-card='"+_this.selectCardDiv+"']").removeClass("dtree-select-show layui-anim layui-anim-upbit"); $("div[dtree-id='" + _this.obj[0].id + "'][dtree-select='"+_this.selectDiv+"']").unbind(); } @@ -5439,14 +5439,14 @@ layui.define(['jquery','layer','form'], function(exports) { return dTree.getCheckbarNodesParam(); // 获取复选框选中值 }, getCheckbarJsonArrParam: function(dTree){ // 获取复选框选中值 - if(typeof dTree === "string"){ - dTree = DTrees[dTree]; - } - if(typeof dTree === "undefined"){ - layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); - return {}; - } - return dTree.getCheckbarJsonArrParam(); // 获取复选框选中值 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return {}; + } + return dTree.getCheckbarJsonArrParam(); // 获取复选框选中值 }, dataInit: function(dTree, chooseId){ // 初始化选中树,针对数据反选 if(typeof dTree === "string"){ @@ -5519,7 +5519,7 @@ layui.define(['jquery','layer','form'], function(exports) { return event.unescape(str); }, serialize: function(first, param) { // 序列化JSON对象 - return AjaxHelper.serialize(first, param); + return AjaxHelper.serialize(first, param); }, version: function(){ //获取版本号 return VERSION; diff --git a/src/main/resources/static/component/pear/module/echarts.js b/src/main/resources/static/component/pear/module/echarts.js index 09c67ad0..e97eb7b7 100644 --- a/src/main/resources/static/component/pear/module/echarts.js +++ b/src/main/resources/static/component/pear/module/echarts.js @@ -20,8 +20,8 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.echarts = {})); + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.echarts = {})); }(this, (function (exports) { 'use strict'; /*! ***************************************************************************** @@ -126,9 +126,9 @@ env.domSupported = typeof document !== 'undefined'; var style = document.documentElement.style; env.transform3dSupported = ((browser.ie && 'transition' in style) - || browser.edge - || (('WebKitCSSMatrix' in window) && ('m11' in new WebKitCSSMatrix())) - || 'MozPerspective' in style) + || browser.edge + || (('WebKitCSSMatrix' in window) && ('m11' in new WebKitCSSMatrix())) + || 'MozPerspective' in style) && !('OTransition' in style); env.transformSupported = env.transform3dSupported || (browser.ie && +browser.version >= 9); @@ -1081,7 +1081,7 @@ } } eventProcessor && eventProcessor.afterTrigger - && eventProcessor.afterTrigger(eventType); + && eventProcessor.afterTrigger(eventType); return this; }; Eventful.prototype.triggerWithContext = function (type) { @@ -1123,7 +1123,7 @@ } } eventProcessor && eventProcessor.afterTrigger - && eventProcessor.afterTrigger(type); + && eventProcessor.afterTrigger(type); return this; }; return Eventful; @@ -1581,7 +1581,7 @@ var eventPacket = makeEventPacket(eventName, targetInfo, event); while (el) { el[eventKey] - && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket)); + && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket)); el.trigger(eventName, eventPacket); el = el.__hostTarget ? el.__hostTarget : el.parent; if (eventPacket.cancelBubble) { @@ -2947,8 +2947,8 @@ return function (p) { return p <= 0 ? 0 : p >= 1 - ? 1 - : cubicRootAt(0, a_1, c_1, 1, p, roots_1) && cubicAt(0, b_1, d_1, 1, roots_1[0]); + ? 1 + : cubicRootAt(0, a_1, c_1, 1, p, roots_1) && cubicAt(0, b_1, d_1, 1, roots_1[0]); }; } } @@ -3517,7 +3517,7 @@ var arr = parse(color); return arr ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255 - + (1 - arr[3]) * backgroundLum + + (1 - arr[3]) * backgroundLum : 0; } function random() { @@ -4608,8 +4608,8 @@ var elTmp = el; var isLocal = false; while (elTmp && elTmp.nodeType !== 9 - && !(isLocal = elTmp.domBelongToZr - || (elTmp !== el && elTmp === instance.painterRoot))) { + && !(isLocal = elTmp.domBelongToZr + || (elTmp !== el && elTmp === instance.painterRoot))) { elTmp = elTmp.parentNode; } return isLocal; @@ -7178,7 +7178,7 @@ var ROUND_SUPPORTED_PRECISION_MAX = 20; function _trim(str) { - return str.replace(/^\s+|\s+$/g, ''); + return str.replace(/^\s+|\s+$/g, ''); } /** * Linear mapping a value from domain to range @@ -7190,47 +7190,47 @@ function linearMap(val, domain, range, clamp) { - var d0 = domain[0]; - var d1 = domain[1]; - var r0 = range[0]; - var r1 = range[1]; - var subDomain = d1 - d0; - var subRange = r1 - r0; - - if (subDomain === 0) { - return subRange === 0 ? r0 : (r0 + r1) / 2; - } // Avoid accuracy problem in edge, such as - // 146.39 - 62.83 === 83.55999999999999. - // See echarts/test/ut/spec/util/number.js#linearMap#accuracyError - // It is a little verbose for efficiency considering this method - // is a hotspot. - - - if (clamp) { - if (subDomain > 0) { - if (val <= d0) { - return r0; - } else if (val >= d1) { - return r1; - } - } else { - if (val >= d0) { - return r0; - } else if (val <= d1) { - return r1; - } - } + var d0 = domain[0]; + var d1 = domain[1]; + var r0 = range[0]; + var r1 = range[1]; + var subDomain = d1 - d0; + var subRange = r1 - r0; + + if (subDomain === 0) { + return subRange === 0 ? r0 : (r0 + r1) / 2; + } // Avoid accuracy problem in edge, such as + // 146.39 - 62.83 === 83.55999999999999. + // See echarts/test/ut/spec/util/number.js#linearMap#accuracyError + // It is a little verbose for efficiency considering this method + // is a hotspot. + + + if (clamp) { + if (subDomain > 0) { + if (val <= d0) { + return r0; + } else if (val >= d1) { + return r1; + } } else { - if (val === d0) { - return r0; - } + if (val >= d0) { + return r0; + } else if (val <= d1) { + return r1; + } + } + } else { + if (val === d0) { + return r0; + } - if (val === d1) { - return r1; - } + if (val === d1) { + return r1; } + } - return (val - d0) / subDomain * subRange + r0; + return (val - d0) / subDomain * subRange + r0; } /** * Convert a percent string to absolute number. @@ -7238,43 +7238,43 @@ */ function parsePercent$1(percent, all) { - switch (percent) { - case 'center': - case 'middle': - percent = '50%'; - break; + switch (percent) { + case 'center': + case 'middle': + percent = '50%'; + break; - case 'left': - case 'top': - percent = '0%'; - break; + case 'left': + case 'top': + percent = '0%'; + break; - case 'right': - case 'bottom': - percent = '100%'; - break; - } + case 'right': + case 'bottom': + percent = '100%'; + break; + } - if (isString(percent)) { - if (_trim(percent).match(/%$/)) { - return parseFloat(percent) / 100 * all; - } - - return parseFloat(percent); + if (isString(percent)) { + if (_trim(percent).match(/%$/)) { + return parseFloat(percent) / 100 * all; } - return percent == null ? NaN : +percent; + return parseFloat(percent); + } + + return percent == null ? NaN : +percent; } function round(x, precision, returnStr) { - if (precision == null) { - precision = 10; - } // Avoid range error + if (precision == null) { + precision = 10; + } // Avoid range error - precision = Math.min(Math.max(0, precision), ROUND_SUPPORTED_PRECISION_MAX); // PENDING: 1.005.toFixed(2) is '1.00' rather than '1.01' + precision = Math.min(Math.max(0, precision), ROUND_SUPPORTED_PRECISION_MAX); // PENDING: 1.005.toFixed(2) is '1.00' rather than '1.01' - x = (+x).toFixed(precision); - return returnStr ? x : +x; + x = (+x).toFixed(precision); + return returnStr ? x : +x; } /** * Inplacd asc sort arr. @@ -7282,70 +7282,70 @@ */ function asc(arr) { - arr.sort(function (a, b) { - return a - b; - }); - return arr; + arr.sort(function (a, b) { + return a - b; + }); + return arr; } /** * Get precision. */ function getPrecision(val) { - val = +val; + val = +val; - if (isNaN(val)) { - return 0; - } // It is much faster than methods converting number to string as follows - // let tmp = val.toString(); - // return tmp.length - 1 - tmp.indexOf('.'); - // especially when precision is low - // Notice: - // (1) If the loop count is over about 20, it is slower than `getPrecisionSafe`. - // (see https://jsbench.me/2vkpcekkvw/1) - // (2) If the val is less than for example 1e-15, the result may be incorrect. - // (see test/ut/spec/util/number.test.ts `getPrecision_equal_random`) - - - if (val > 1e-14) { - var e = 1; - - for (var i = 0; i < 15; i++, e *= 10) { - if (Math.round(val * e) / e === val) { - return i; - } - } + if (isNaN(val)) { + return 0; + } // It is much faster than methods converting number to string as follows + // let tmp = val.toString(); + // return tmp.length - 1 - tmp.indexOf('.'); + // especially when precision is low + // Notice: + // (1) If the loop count is over about 20, it is slower than `getPrecisionSafe`. + // (see https://jsbench.me/2vkpcekkvw/1) + // (2) If the val is less than for example 1e-15, the result may be incorrect. + // (see test/ut/spec/util/number.test.ts `getPrecision_equal_random`) + + + if (val > 1e-14) { + var e = 1; + + for (var i = 0; i < 15; i++, e *= 10) { + if (Math.round(val * e) / e === val) { + return i; + } } + } - return getPrecisionSafe(val); + return getPrecisionSafe(val); } /** * Get precision with slow but safe method */ function getPrecisionSafe(val) { - // toLowerCase for: '3.4E-12' - var str = val.toString().toLowerCase(); // Consider scientific notation: '3.4e-12' '3.4e+12' + // toLowerCase for: '3.4E-12' + var str = val.toString().toLowerCase(); // Consider scientific notation: '3.4e-12' '3.4e+12' - var eIndex = str.indexOf('e'); - var exp = eIndex > 0 ? +str.slice(eIndex + 1) : 0; - var significandPartLen = eIndex > 0 ? eIndex : str.length; - var dotIndex = str.indexOf('.'); - var decimalPartLen = dotIndex < 0 ? 0 : significandPartLen - 1 - dotIndex; - return Math.max(0, decimalPartLen - exp); + var eIndex = str.indexOf('e'); + var exp = eIndex > 0 ? +str.slice(eIndex + 1) : 0; + var significandPartLen = eIndex > 0 ? eIndex : str.length; + var dotIndex = str.indexOf('.'); + var decimalPartLen = dotIndex < 0 ? 0 : significandPartLen - 1 - dotIndex; + return Math.max(0, decimalPartLen - exp); } /** * Minimal dicernible data precisioin according to a single pixel. */ function getPixelPrecision(dataExtent, pixelExtent) { - var log = Math.log; - var LN10 = Math.LN10; - var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10); - var sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10); // toFixed() digits argument must be between 0 and 20. + var log = Math.log; + var LN10 = Math.LN10; + var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10); + var sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10); // toFixed() digits argument must be between 0 and 20. - var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20); - return !isFinite(precision) ? 20 : precision; + var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20); + return !isFinite(precision) ? 20 : precision; } /** * Get a data of given precision, assuring the sum of percentages @@ -7360,53 +7360,53 @@ */ function getPercentWithPrecision(valueList, idx, precision) { - if (!valueList[idx]) { - return 0; - } - - var sum = reduce(valueList, function (acc, val) { - return acc + (isNaN(val) ? 0 : val); - }, 0); - - if (sum === 0) { - return 0; - } - - var digits = Math.pow(10, precision); - var votesPerQuota = map(valueList, function (val) { - return (isNaN(val) ? 0 : val) / sum * digits * 100; - }); - var targetSeats = digits * 100; - var seats = map(votesPerQuota, function (votes) { - // Assign automatic seats. - return Math.floor(votes); - }); - var currentSum = reduce(seats, function (acc, val) { - return acc + val; - }, 0); - var remainder = map(votesPerQuota, function (votes, idx) { - return votes - seats[idx]; - }); // Has remainding votes. - - while (currentSum < targetSeats) { - // Find next largest remainder. - var max = Number.NEGATIVE_INFINITY; - var maxId = null; - - for (var i = 0, len = remainder.length; i < len; ++i) { - if (remainder[i] > max) { - max = remainder[i]; - maxId = i; - } - } // Add a vote to max remainder. - + if (!valueList[idx]) { + return 0; + } - ++seats[maxId]; - remainder[maxId] = 0; - ++currentSum; - } + var sum = reduce(valueList, function (acc, val) { + return acc + (isNaN(val) ? 0 : val); + }, 0); - return seats[idx] / digits; + if (sum === 0) { + return 0; + } + + var digits = Math.pow(10, precision); + var votesPerQuota = map(valueList, function (val) { + return (isNaN(val) ? 0 : val) / sum * digits * 100; + }); + var targetSeats = digits * 100; + var seats = map(votesPerQuota, function (votes) { + // Assign automatic seats. + return Math.floor(votes); + }); + var currentSum = reduce(seats, function (acc, val) { + return acc + val; + }, 0); + var remainder = map(votesPerQuota, function (votes, idx) { + return votes - seats[idx]; + }); // Has remainding votes. + + while (currentSum < targetSeats) { + // Find next largest remainder. + var max = Number.NEGATIVE_INFINITY; + var maxId = null; + + for (var i = 0, len = remainder.length; i < len; ++i) { + if (remainder[i] > max) { + max = remainder[i]; + maxId = i; + } + } // Add a vote to max remainder. + + + ++seats[maxId]; + remainder[maxId] = 0; + ++currentSum; + } + + return seats[idx] / digits; } /** * Solve the floating point adding problem like 0.1 + 0.2 === 0.30000000000000004 @@ -7414,12 +7414,12 @@ */ function addSafe(val0, val1) { - var maxPrecision = Math.max(getPrecision(val0), getPrecision(val1)); // const multiplier = Math.pow(10, maxPrecision); - // return (Math.round(val0 * multiplier) + Math.round(val1 * multiplier)) / multiplier; + var maxPrecision = Math.max(getPrecision(val0), getPrecision(val1)); // const multiplier = Math.pow(10, maxPrecision); + // return (Math.round(val0 * multiplier) + Math.round(val1 * multiplier)) / multiplier; - var sum = val0 + val1; // // PENDING: support more? + var sum = val0 + val1; // // PENDING: support more? - return maxPrecision > ROUND_SUPPORTED_PRECISION_MAX ? sum : round(sum, maxPrecision); + return maxPrecision > ROUND_SUPPORTED_PRECISION_MAX ? sum : round(sum, maxPrecision); } // Number.MAX_SAFE_INTEGER, ie do not support. var MAX_SAFE_INTEGER = 9007199254740991; @@ -7428,8 +7428,8 @@ */ function remRadian(radian) { - var pi2 = Math.PI * 2; - return (radian % pi2 + pi2) % pi2; + var pi2 = Math.PI * 2; + return (radian % pi2 + pi2) % pi2; } /** * @param {type} radian @@ -7437,7 +7437,7 @@ */ function isRadianAroundZero(val) { - return val > -RADIAN_EPSILON && val < RADIAN_EPSILON; + return val > -RADIAN_EPSILON && val < RADIAN_EPSILON; } // eslint-disable-next-line var TIME_REG = /^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/; // jshint ignore:line @@ -7460,47 +7460,47 @@ */ function parseDate(value) { - if (value instanceof Date) { - return value; - } else if (isString(value)) { - // Different browsers parse date in different way, so we parse it manually. - // Some other issues: - // new Date('1970-01-01') is UTC, - // new Date('1970/01/01') and new Date('1970-1-01') is local. - // See issue #3623 - var match = TIME_REG.exec(value); - - if (!match) { - // return Invalid Date. - return new Date(NaN); - } // Use local time when no timezone offset specifed. - - - if (!match[8]) { - // match[n] can only be string or undefined. - // But take care of '12' + 1 => '121'. - return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0); - } // Timezoneoffset of Javascript Date has considered DST (Daylight Saving Time, - // https://tc39.github.io/ecma262/#sec-daylight-saving-time-adjustment). - // For example, system timezone is set as "Time Zone: America/Toronto", - // then these code will get different result: - // `new Date(1478411999999).getTimezoneOffset(); // get 240` - // `new Date(1478412000000).getTimezoneOffset(); // get 300` - // So we should not use `new Date`, but use `Date.UTC`. - else { - var hour = +match[4] || 0; - - if (match[8].toUpperCase() !== 'Z') { - hour -= +match[8].slice(0, 3); - } + if (value instanceof Date) { + return value; + } else if (isString(value)) { + // Different browsers parse date in different way, so we parse it manually. + // Some other issues: + // new Date('1970-01-01') is UTC, + // new Date('1970/01/01') and new Date('1970-1-01') is local. + // See issue #3623 + var match = TIME_REG.exec(value); + + if (!match) { + // return Invalid Date. + return new Date(NaN); + } // Use local time when no timezone offset specifed. + + + if (!match[8]) { + // match[n] can only be string or undefined. + // But take care of '12' + 1 => '121'. + return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0); + } // Timezoneoffset of Javascript Date has considered DST (Daylight Saving Time, + // https://tc39.github.io/ecma262/#sec-daylight-saving-time-adjustment). + // For example, system timezone is set as "Time Zone: America/Toronto", + // then these code will get different result: + // `new Date(1478411999999).getTimezoneOffset(); // get 240` + // `new Date(1478412000000).getTimezoneOffset(); // get 300` + // So we should not use `new Date`, but use `Date.UTC`. + else { + var hour = +match[4] || 0; - return new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0)); + if (match[8].toUpperCase() !== 'Z') { + hour -= +match[8].slice(0, 3); } - } else if (value == null) { - return new Date(NaN); - } - return new Date(Math.round(value)); + return new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0)); + } + } else if (value == null) { + return new Date(NaN); + } + + return new Date(Math.round(value)); } /** * Quantity of a number. e.g. 0.1, 1, 10, 100 @@ -7510,7 +7510,7 @@ */ function quantity(val) { - return Math.pow(10, quantityExponent(val)); + return Math.pow(10, quantityExponent(val)); } /** * Exponent of the quantity of a number @@ -7521,22 +7521,22 @@ */ function quantityExponent(val) { - if (val === 0) { - return 0; - } + if (val === 0) { + return 0; + } - var exp = Math.floor(Math.log(val) / Math.LN10); - /** - * exp is expected to be the rounded-down result of the base-10 log of val. - * But due to the precision loss with Math.log(val), we need to restore it - * using 10^exp to make sure we can get val back from exp. #11249 - */ + var exp = Math.floor(Math.log(val) / Math.LN10); + /** + * exp is expected to be the rounded-down result of the base-10 log of val. + * But due to the precision loss with Math.log(val), we need to restore it + * using 10^exp to make sure we can get val back from exp. #11249 + */ - if (val / Math.pow(10, exp) >= 10) { - exp++; - } + if (val / Math.pow(10, exp) >= 10) { + exp++; + } - return exp; + return exp; } /** * find a “nice” number approximately equal to x. Round the number if round = true, @@ -7551,42 +7551,42 @@ */ function nice(val, round) { - var exponent = quantityExponent(val); - var exp10 = Math.pow(10, exponent); - var f = val / exp10; // 1 <= f < 10 - - var nf; - - if (round) { - if (f < 1.5) { - nf = 1; - } else if (f < 2.5) { - nf = 2; - } else if (f < 4) { - nf = 3; - } else if (f < 7) { - nf = 5; - } else { - nf = 10; - } + var exponent = quantityExponent(val); + var exp10 = Math.pow(10, exponent); + var f = val / exp10; // 1 <= f < 10 + + var nf; + + if (round) { + if (f < 1.5) { + nf = 1; + } else if (f < 2.5) { + nf = 2; + } else if (f < 4) { + nf = 3; + } else if (f < 7) { + nf = 5; } else { - if (f < 1) { - nf = 1; - } else if (f < 2) { - nf = 2; - } else if (f < 3) { - nf = 3; - } else if (f < 5) { - nf = 5; - } else { - nf = 10; - } + nf = 10; + } + } else { + if (f < 1) { + nf = 1; + } else if (f < 2) { + nf = 2; + } else if (f < 3) { + nf = 3; + } else if (f < 5) { + nf = 5; + } else { + nf = 10; } + } - val = nf * exp10; // Fix 3 * 0.1 === 0.30000000000000004 issue (see IEEE 754). - // 20 is the uppper bound of toFixed. + val = nf * exp10; // Fix 3 * 0.1 === 0.30000000000000004 issue (see IEEE 754). + // 20 is the uppper bound of toFixed. - return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val; + return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val; } /** * This code was copied from "d3.js" @@ -7596,11 +7596,11 @@ */ function quantile(ascArr, p) { - var H = (ascArr.length - 1) * p + 1; - var h = Math.floor(H); - var v = +ascArr[h - 1]; - var e = H - h; - return e ? v + e * (ascArr[h] - v) : v; + var H = (ascArr.length - 1) * p + 1; + var h = Math.floor(H); + var v = +ascArr[h - 1]; + var e = H - h; + return e ? v + e * (ascArr[h] - v) : v; } /** * Order intervals asc, and split them when overlap. @@ -7626,38 +7626,38 @@ */ function reformIntervals(list) { - list.sort(function (a, b) { - return littleThan(a, b, 0) ? -1 : 1; - }); - var curr = -Infinity; - var currClose = 1; + list.sort(function (a, b) { + return littleThan(a, b, 0) ? -1 : 1; + }); + var curr = -Infinity; + var currClose = 1; - for (var i = 0; i < list.length;) { - var interval = list[i].interval; - var close_1 = list[i].close; + for (var i = 0; i < list.length;) { + var interval = list[i].interval; + var close_1 = list[i].close; - for (var lg = 0; lg < 2; lg++) { - if (interval[lg] <= curr) { - interval[lg] = curr; - close_1[lg] = !lg ? 1 - currClose : 1; - } + for (var lg = 0; lg < 2; lg++) { + if (interval[lg] <= curr) { + interval[lg] = curr; + close_1[lg] = !lg ? 1 - currClose : 1; + } - curr = interval[lg]; - currClose = close_1[lg]; - } + curr = interval[lg]; + currClose = close_1[lg]; + } - if (interval[0] === interval[1] && close_1[0] * close_1[1] !== 1) { - list.splice(i, 1); - } else { - i++; - } + if (interval[0] === interval[1] && close_1[0] * close_1[1] !== 1) { + list.splice(i, 1); + } else { + i++; } + } - return list; + return list; - function littleThan(a, b, lg) { - return a.interval[lg] < b.interval[lg] || a.interval[lg] === b.interval[lg] && (a.close[lg] - b.close[lg] === (!lg ? 1 : -1) || !lg && littleThan(a, b, 1)); - } + function littleThan(a, b, lg) { + return a.interval[lg] < b.interval[lg] || a.interval[lg] === b.interval[lg] && (a.close[lg] - b.close[lg] === (!lg ? 1 : -1) || !lg && littleThan(a, b, 1)); + } } /** * [Numberic is defined as]: @@ -7677,17 +7677,17 @@ */ function numericToNumber(val) { - var valFloat = parseFloat(val); - return valFloat == val // eslint-disable-line eqeqeq - && (valFloat !== 0 || !isString(val) || val.indexOf('x') <= 0) // For case ' 0x0 '. - ? valFloat : NaN; + var valFloat = parseFloat(val); + return valFloat == val // eslint-disable-line eqeqeq + && (valFloat !== 0 || !isString(val) || val.indexOf('x') <= 0) // For case ' 0x0 '. + ? valFloat : NaN; } /** * Definition of "numeric": see `numericToNumber`. */ function isNumeric(val) { - return !isNaN(numericToNumber(val)); + return !isNaN(numericToNumber(val)); } /** * Use random base to prevent users hard code depending on @@ -7696,7 +7696,7 @@ */ function getRandomIdBase() { - return Math.round(Math.random() * 9); + return Math.round(Math.random() * 9); } /** * Get the greatest common dividor @@ -7706,11 +7706,11 @@ */ function getGreatestCommonDividor(a, b) { - if (b === 0) { - return a; - } + if (b === 0) { + return a; + } - return getGreatestCommonDividor(b, a % b); + return getGreatestCommonDividor(b, a % b); } /** * Get the least common multiple @@ -7720,56 +7720,56 @@ */ function getLeastCommonMultiple(a, b) { - if (a == null) { - return b; - } + if (a == null) { + return b; + } - if (b == null) { - return a; - } + if (b == null) { + return a; + } - return a * b / getGreatestCommonDividor(a, b); + return a * b / getGreatestCommonDividor(a, b); } var ECHARTS_PREFIX = '[ECharts] '; var storedLogs = {}; var hasConsole = typeof console !== 'undefined' // eslint-disable-next-line - && console.warn && console.log; + && console.warn && console.log; function outputLog(type, str, onlyOnce) { - if (hasConsole) { - if (onlyOnce) { - if (storedLogs[str]) { - return; - } + if (hasConsole) { + if (onlyOnce) { + if (storedLogs[str]) { + return; + } - storedLogs[str] = true; - } // eslint-disable-next-line + storedLogs[str] = true; + } // eslint-disable-next-line - console[type](ECHARTS_PREFIX + str); - } + console[type](ECHARTS_PREFIX + str); + } } function log(str, onlyOnce) { - outputLog('log', str, onlyOnce); + outputLog('log', str, onlyOnce); } function warn(str, onlyOnce) { - outputLog('warn', str, onlyOnce); + outputLog('warn', str, onlyOnce); } function error(str, onlyOnce) { - outputLog('error', str, onlyOnce); + outputLog('error', str, onlyOnce); } function deprecateLog(str) { - if ("development" !== 'production') { - // Not display duplicate message. - outputLog('warn', 'DEPRECATED: ' + str, true); - } + if ("development" !== 'production') { + // Not display duplicate message. + outputLog('warn', 'DEPRECATED: ' + str, true); + } } function deprecateReplaceLog(oldOpt, newOpt, scope) { - if ("development" !== 'production') { - deprecateLog((scope ? "[" + scope + "]" : '') + (oldOpt + " is deprecated, use " + newOpt + " instead.")); - } + if ("development" !== 'production') { + deprecateLog((scope ? "[" + scope + "]" : '') + (oldOpt + " is deprecated, use " + newOpt + " instead.")); + } } /** * If in __DEV__ environment, get console printable message for users hint. @@ -7782,58 +7782,58 @@ */ function makePrintable() { - var hintInfo = []; - - for (var _i = 0; _i < arguments.length; _i++) { - hintInfo[_i] = arguments[_i]; - } - - var msg = ''; - - if ("development" !== 'production') { - // Fuzzy stringify for print. - // This code only exist in dev environment. - var makePrintableStringIfPossible_1 = function (val) { - return val === void 0 ? 'undefined' : val === Infinity ? 'Infinity' : val === -Infinity ? '-Infinity' : eqNaN(val) ? 'NaN' : val instanceof Date ? 'Date(' + val.toISOString() + ')' : isFunction(val) ? 'function () { ... }' : isRegExp(val) ? val + '' : null; - }; - - msg = map(hintInfo, function (arg) { - if (isString(arg)) { - // Print without quotation mark for some statement. - return arg; - } else { - var printableStr = makePrintableStringIfPossible_1(arg); - - if (printableStr != null) { - return printableStr; - } else if (typeof JSON !== 'undefined' && JSON.stringify) { - try { - return JSON.stringify(arg, function (n, val) { - var printableStr = makePrintableStringIfPossible_1(val); - return printableStr == null ? val : printableStr; - }); // In most cases the info object is small, so do not line break. - } catch (err) { - return '?'; - } - } else { - return '?'; - } - } - }).join(' '); - } + var hintInfo = []; + + for (var _i = 0; _i < arguments.length; _i++) { + hintInfo[_i] = arguments[_i]; + } + + var msg = ''; + + if ("development" !== 'production') { + // Fuzzy stringify for print. + // This code only exist in dev environment. + var makePrintableStringIfPossible_1 = function (val) { + return val === void 0 ? 'undefined' : val === Infinity ? 'Infinity' : val === -Infinity ? '-Infinity' : eqNaN(val) ? 'NaN' : val instanceof Date ? 'Date(' + val.toISOString() + ')' : isFunction(val) ? 'function () { ... }' : isRegExp(val) ? val + '' : null; + }; + + msg = map(hintInfo, function (arg) { + if (isString(arg)) { + // Print without quotation mark for some statement. + return arg; + } else { + var printableStr = makePrintableStringIfPossible_1(arg); + + if (printableStr != null) { + return printableStr; + } else if (typeof JSON !== 'undefined' && JSON.stringify) { + try { + return JSON.stringify(arg, function (n, val) { + var printableStr = makePrintableStringIfPossible_1(val); + return printableStr == null ? val : printableStr; + }); // In most cases the info object is small, so do not line break. + } catch (err) { + return '?'; + } + } else { + return '?'; + } + } + }).join(' '); + } - return msg; + return msg; } /** * @throws Error */ function throwError(msg) { - throw new Error(msg); + throw new Error(msg); } function interpolateNumber$1(p0, p1, percent) { - return (p1 - p0) * percent + p0; + return (p1 - p0) * percent + p0; } /** * Make the name displayable. But we should @@ -7851,7 +7851,7 @@ */ function normalizeToArray(value) { - return value instanceof Array ? value : value == null ? [] : [value]; + return value instanceof Array ? value : value == null ? [] : [value]; } /** * Sync default option between normal and emphasis like `position` and `show` @@ -7867,20 +7867,20 @@ */ function defaultEmphasis(opt, key, subOpts) { - // Caution: performance sensitive. - if (opt) { - opt[key] = opt[key] || {}; - opt.emphasis = opt.emphasis || {}; - opt.emphasis[key] = opt.emphasis[key] || {}; // Default emphasis option from normal + // Caution: performance sensitive. + if (opt) { + opt[key] = opt[key] || {}; + opt.emphasis = opt.emphasis || {}; + opt.emphasis[key] = opt.emphasis[key] || {}; // Default emphasis option from normal - for (var i = 0, len = subOpts.length; i < len; i++) { - var subOptName = subOpts[i]; + for (var i = 0, len = subOpts.length; i < len; i++) { + var subOptName = subOpts[i]; - if (!opt.emphasis[key].hasOwnProperty(subOptName) && opt[key].hasOwnProperty(subOptName)) { - opt.emphasis[key][subOptName] = opt[key][subOptName]; - } - } + if (!opt.emphasis[key].hasOwnProperty(subOptName) && opt[key].hasOwnProperty(subOptName)) { + opt.emphasis[key][subOptName] = opt[key][subOptName]; + } } + } } var TEXT_STYLE_OPTIONS = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'rich', 'tag', 'color', 'textBorderColor', 'textBorderWidth', 'width', 'height', 'lineHeight', 'align', 'verticalAlign', 'baseline', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY', 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY', 'backgroundColor', 'borderColor', 'borderWidth', 'borderRadius', 'padding']; // modelUtil.LABEL_OPTIONS = modelUtil.TEXT_STYLE_OPTIONS.concat([ // 'position', 'offset', 'rotate', 'origin', 'show', 'distance', 'formatter', @@ -7896,7 +7896,7 @@ */ function getDataItemValue(dataItem) { - return isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date) ? dataItem.value : dataItem; + return isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date) ? dataItem.value : dataItem; } /** * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}] @@ -7904,8 +7904,8 @@ */ function isDataItemOption(dataItem) { - return isObject(dataItem) && !(dataItem instanceof Array); // // markLine data can be array - // && !(dataItem[0] && isObject(dataItem[0]) && !(dataItem[0] instanceof Array)); + return isObject(dataItem) && !(dataItem instanceof Array); // // markLine data can be array + // && !(dataItem[0] && isObject(dataItem[0]) && !(dataItem[0] instanceof Array)); } /** * Mapping to existings for merge. @@ -7938,177 +7938,177 @@ */ function mappingToExists(existings, newCmptOptions, mode) { - var isNormalMergeMode = mode === 'normalMerge'; - var isReplaceMergeMode = mode === 'replaceMerge'; - var isReplaceAllMode = mode === 'replaceAll'; - existings = existings || []; - newCmptOptions = (newCmptOptions || []).slice(); - var existingIdIdxMap = createHashMap(); // Validate id and name on user input option. - - each(newCmptOptions, function (cmptOption, index) { - if (!isObject(cmptOption)) { - newCmptOptions[index] = null; - return; - } + var isNormalMergeMode = mode === 'normalMerge'; + var isReplaceMergeMode = mode === 'replaceMerge'; + var isReplaceAllMode = mode === 'replaceAll'; + existings = existings || []; + newCmptOptions = (newCmptOptions || []).slice(); + var existingIdIdxMap = createHashMap(); // Validate id and name on user input option. - if ("development" !== 'production') { - // There is some legacy case that name is set as `false`. - // But should work normally rather than throw error. - if (cmptOption.id != null && !isValidIdOrName(cmptOption.id)) { - warnInvalidateIdOrName(cmptOption.id); - } + each(newCmptOptions, function (cmptOption, index) { + if (!isObject(cmptOption)) { + newCmptOptions[index] = null; + return; + } - if (cmptOption.name != null && !isValidIdOrName(cmptOption.name)) { - warnInvalidateIdOrName(cmptOption.name); - } - } - }); - var result = prepareResult(existings, existingIdIdxMap, mode); + if ("development" !== 'production') { + // There is some legacy case that name is set as `false`. + // But should work normally rather than throw error. + if (cmptOption.id != null && !isValidIdOrName(cmptOption.id)) { + warnInvalidateIdOrName(cmptOption.id); + } - if (isNormalMergeMode || isReplaceMergeMode) { - mappingById(result, existings, existingIdIdxMap, newCmptOptions); + if (cmptOption.name != null && !isValidIdOrName(cmptOption.name)) { + warnInvalidateIdOrName(cmptOption.name); + } } + }); + var result = prepareResult(existings, existingIdIdxMap, mode); - if (isNormalMergeMode) { - mappingByName(result, newCmptOptions); - } + if (isNormalMergeMode || isReplaceMergeMode) { + mappingById(result, existings, existingIdIdxMap, newCmptOptions); + } - if (isNormalMergeMode || isReplaceMergeMode) { - mappingByIndex(result, newCmptOptions, isReplaceMergeMode); - } else if (isReplaceAllMode) { - mappingInReplaceAllMode(result, newCmptOptions); - } + if (isNormalMergeMode) { + mappingByName(result, newCmptOptions); + } - makeIdAndName(result); // The array `result` MUST NOT contain elided items, otherwise the - // forEach will ommit those items and result in incorrect result. + if (isNormalMergeMode || isReplaceMergeMode) { + mappingByIndex(result, newCmptOptions, isReplaceMergeMode); + } else if (isReplaceAllMode) { + mappingInReplaceAllMode(result, newCmptOptions); + } - return result; + makeIdAndName(result); // The array `result` MUST NOT contain elided items, otherwise the + // forEach will ommit those items and result in incorrect result. + + return result; } function prepareResult(existings, existingIdIdxMap, mode) { - var result = []; + var result = []; - if (mode === 'replaceAll') { - return result; - } // Do not use native `map` to in case that the array `existings` - // contains elided items, which will be ommited. + if (mode === 'replaceAll') { + return result; + } // Do not use native `map` to in case that the array `existings` + // contains elided items, which will be ommited. - for (var index = 0; index < existings.length; index++) { - var existing = existings[index]; // Because of replaceMerge, `existing` may be null/undefined. + for (var index = 0; index < existings.length; index++) { + var existing = existings[index]; // Because of replaceMerge, `existing` may be null/undefined. - if (existing && existing.id != null) { - existingIdIdxMap.set(existing.id, index); - } // For non-internal-componnets: - // Mode "normalMerge": all existings kept. - // Mode "replaceMerge": all existing removed unless mapped by id. - // For internal-components: - // go with "replaceMerge" approach in both mode. + if (existing && existing.id != null) { + existingIdIdxMap.set(existing.id, index); + } // For non-internal-componnets: + // Mode "normalMerge": all existings kept. + // Mode "replaceMerge": all existing removed unless mapped by id. + // For internal-components: + // go with "replaceMerge" approach in both mode. - result.push({ - existing: mode === 'replaceMerge' || isComponentIdInternal(existing) ? null : existing, - newOption: null, - keyInfo: null, - brandNew: null - }); - } + result.push({ + existing: mode === 'replaceMerge' || isComponentIdInternal(existing) ? null : existing, + newOption: null, + keyInfo: null, + brandNew: null + }); + } - return result; + return result; } function mappingById(result, existings, existingIdIdxMap, newCmptOptions) { - // Mapping by id if specified. - each(newCmptOptions, function (cmptOption, index) { - if (!cmptOption || cmptOption.id == null) { - return; - } + // Mapping by id if specified. + each(newCmptOptions, function (cmptOption, index) { + if (!cmptOption || cmptOption.id == null) { + return; + } - var optionId = makeComparableKey(cmptOption.id); - var existingIdx = existingIdIdxMap.get(optionId); + var optionId = makeComparableKey(cmptOption.id); + var existingIdx = existingIdIdxMap.get(optionId); - if (existingIdx != null) { - var resultItem = result[existingIdx]; - assert(!resultItem.newOption, 'Duplicated option on id "' + optionId + '".'); - resultItem.newOption = cmptOption; // In both mode, if id matched, new option will be merged to - // the existings rather than creating new component model. + if (existingIdx != null) { + var resultItem = result[existingIdx]; + assert(!resultItem.newOption, 'Duplicated option on id "' + optionId + '".'); + resultItem.newOption = cmptOption; // In both mode, if id matched, new option will be merged to + // the existings rather than creating new component model. - resultItem.existing = existings[existingIdx]; - newCmptOptions[index] = null; - } - }); + resultItem.existing = existings[existingIdx]; + newCmptOptions[index] = null; + } + }); } function mappingByName(result, newCmptOptions) { - // Mapping by name if specified. - each(newCmptOptions, function (cmptOption, index) { - if (!cmptOption || cmptOption.name == null) { - return; - } + // Mapping by name if specified. + each(newCmptOptions, function (cmptOption, index) { + if (!cmptOption || cmptOption.name == null) { + return; + } - for (var i = 0; i < result.length; i++) { - var existing = result[i].existing; + for (var i = 0; i < result.length; i++) { + var existing = result[i].existing; - if (!result[i].newOption // Consider name: two map to one. - // Can not match when both ids existing but different. - && existing && (existing.id == null || cmptOption.id == null) && !isComponentIdInternal(cmptOption) && !isComponentIdInternal(existing) && keyExistAndEqual('name', existing, cmptOption)) { - result[i].newOption = cmptOption; - newCmptOptions[index] = null; - return; - } - } - }); + if (!result[i].newOption // Consider name: two map to one. + // Can not match when both ids existing but different. + && existing && (existing.id == null || cmptOption.id == null) && !isComponentIdInternal(cmptOption) && !isComponentIdInternal(existing) && keyExistAndEqual('name', existing, cmptOption)) { + result[i].newOption = cmptOption; + newCmptOptions[index] = null; + return; + } + } + }); } function mappingByIndex(result, newCmptOptions, brandNew) { - each(newCmptOptions, function (cmptOption) { - if (!cmptOption) { - return; - } // Find the first place that not mapped by id and not internal component (consider the "hole"). - - - var resultItem; - var nextIdx = 0; - - while ( // Be `!resultItem` only when `nextIdx >= result.length`. - (resultItem = result[nextIdx]) && ( // (1) Existing models that already have id should be able to mapped to. Because - // after mapping performed, model will always be assigned with an id if user not given. - // After that all models have id. - // (2) If new option has id, it can only set to a hole or append to the last. It should - // not be merged to the existings with different id. Because id should not be overwritten. - // (3) Name can be overwritten, because axis use name as 'show label text'. - resultItem.newOption || isComponentIdInternal(resultItem.existing) || // In mode "replaceMerge", here no not-mapped-non-internal-existing. - resultItem.existing && cmptOption.id != null && !keyExistAndEqual('id', cmptOption, resultItem.existing))) { - nextIdx++; - } - - if (resultItem) { - resultItem.newOption = cmptOption; - resultItem.brandNew = brandNew; - } else { - result.push({ - newOption: cmptOption, - brandNew: brandNew, - existing: null, - keyInfo: null - }); - } + each(newCmptOptions, function (cmptOption) { + if (!cmptOption) { + return; + } // Find the first place that not mapped by id and not internal component (consider the "hole"). + + + var resultItem; + var nextIdx = 0; + + while ( // Be `!resultItem` only when `nextIdx >= result.length`. + (resultItem = result[nextIdx]) && ( // (1) Existing models that already have id should be able to mapped to. Because + // after mapping performed, model will always be assigned with an id if user not given. + // After that all models have id. + // (2) If new option has id, it can only set to a hole or append to the last. It should + // not be merged to the existings with different id. Because id should not be overwritten. + // (3) Name can be overwritten, because axis use name as 'show label text'. + resultItem.newOption || isComponentIdInternal(resultItem.existing) || // In mode "replaceMerge", here no not-mapped-non-internal-existing. + resultItem.existing && cmptOption.id != null && !keyExistAndEqual('id', cmptOption, resultItem.existing))) { + nextIdx++; + } + + if (resultItem) { + resultItem.newOption = cmptOption; + resultItem.brandNew = brandNew; + } else { + result.push({ + newOption: cmptOption, + brandNew: brandNew, + existing: null, + keyInfo: null + }); + } - nextIdx++; - }); + nextIdx++; + }); } function mappingInReplaceAllMode(result, newCmptOptions) { - each(newCmptOptions, function (cmptOption) { - // The feature "reproduce" requires "hole" will also reproduced - // in case that compoennt index referring are broken. - result.push({ - newOption: cmptOption, - brandNew: true, - existing: null, - keyInfo: null - }); + each(newCmptOptions, function (cmptOption) { + // The feature "reproduce" requires "hole" will also reproduced + // in case that compoennt index referring are broken. + result.push({ + newOption: cmptOption, + brandNew: true, + existing: null, + keyInfo: null }); + }); } /** * Make id and name for mapping result (result of mappingToExists) @@ -8117,71 +8117,71 @@ function makeIdAndName(mapResult) { - // We use this id to hash component models and view instances - // in echarts. id can be specified by user, or auto generated. - // The id generation rule ensures new view instance are able - // to mapped to old instance when setOption are called in - // no-merge mode. So we generate model id by name and plus - // type in view id. - // name can be duplicated among components, which is convenient - // to specify multi components (like series) by one name. - // Ensure that each id is distinct. - var idMap = createHashMap(); - each(mapResult, function (item) { - var existing = item.existing; - existing && idMap.set(existing.id, item); - }); - each(mapResult, function (item) { - var opt = item.newOption; // Force ensure id not duplicated. - - assert(!opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, 'id duplicates: ' + (opt && opt.id)); - opt && opt.id != null && idMap.set(opt.id, item); - !item.keyInfo && (item.keyInfo = {}); - }); // Make name and id. - - each(mapResult, function (item, index) { - var existing = item.existing; - var opt = item.newOption; - var keyInfo = item.keyInfo; - - if (!isObject(opt)) { - return; - } // name can be overwitten. Consider case: axis.name = '20km'. - // But id generated by name will not be changed, which affect - // only in that case: setOption with 'not merge mode' and view - // instance will be recreated, which can be accepted. - - - keyInfo.name = opt.name != null ? makeComparableKey(opt.name) : existing ? existing.name // Avoid diffferent series has the same name, - // because name may be used like in color pallet. - : DUMMY_COMPONENT_NAME_PREFIX + index; - - if (existing) { - keyInfo.id = makeComparableKey(existing.id); - } else if (opt.id != null) { - keyInfo.id = makeComparableKey(opt.id); - } else { - // Consider this situatoin: - // optionA: [{name: 'a'}, {name: 'a'}, {..}] - // optionB [{..}, {name: 'a'}, {name: 'a'}] - // Series with the same name between optionA and optionB - // should be mapped. - var idNum = 0; + // We use this id to hash component models and view instances + // in echarts. id can be specified by user, or auto generated. + // The id generation rule ensures new view instance are able + // to mapped to old instance when setOption are called in + // no-merge mode. So we generate model id by name and plus + // type in view id. + // name can be duplicated among components, which is convenient + // to specify multi components (like series) by one name. + // Ensure that each id is distinct. + var idMap = createHashMap(); + each(mapResult, function (item) { + var existing = item.existing; + existing && idMap.set(existing.id, item); + }); + each(mapResult, function (item) { + var opt = item.newOption; // Force ensure id not duplicated. + + assert(!opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, 'id duplicates: ' + (opt && opt.id)); + opt && opt.id != null && idMap.set(opt.id, item); + !item.keyInfo && (item.keyInfo = {}); + }); // Make name and id. + + each(mapResult, function (item, index) { + var existing = item.existing; + var opt = item.newOption; + var keyInfo = item.keyInfo; + + if (!isObject(opt)) { + return; + } // name can be overwitten. Consider case: axis.name = '20km'. + // But id generated by name will not be changed, which affect + // only in that case: setOption with 'not merge mode' and view + // instance will be recreated, which can be accepted. + + + keyInfo.name = opt.name != null ? makeComparableKey(opt.name) : existing ? existing.name // Avoid diffferent series has the same name, + // because name may be used like in color pallet. + : DUMMY_COMPONENT_NAME_PREFIX + index; + + if (existing) { + keyInfo.id = makeComparableKey(existing.id); + } else if (opt.id != null) { + keyInfo.id = makeComparableKey(opt.id); + } else { + // Consider this situatoin: + // optionA: [{name: 'a'}, {name: 'a'}, {..}] + // optionB [{..}, {name: 'a'}, {name: 'a'}] + // Series with the same name between optionA and optionB + // should be mapped. + var idNum = 0; - do { - keyInfo.id = '\0' + keyInfo.name + '\0' + idNum++; - } while (idMap.get(keyInfo.id)); - } + do { + keyInfo.id = '\0' + keyInfo.name + '\0' + idNum++; + } while (idMap.get(keyInfo.id)); + } - idMap.set(keyInfo.id, item); - }); + idMap.set(keyInfo.id, item); + }); } function keyExistAndEqual(attr, obj1, obj2) { - var key1 = convertOptionIdName(obj1[attr], null); - var key2 = convertOptionIdName(obj2[attr], null); // See `MappingExistingItem`. `id` and `name` trade string equals to number. + var key1 = convertOptionIdName(obj1[attr], null); + var key2 = convertOptionIdName(obj2[attr], null); // See `MappingExistingItem`. `id` and `name` trade string equals to number. - return key1 != null && key2 != null && key1 === key2; + return key1 != null && key2 != null && key1 === key2; } /** * @return return null if not exist. @@ -8189,37 +8189,37 @@ function makeComparableKey(val) { - if ("development" !== 'production') { - if (val == null) { - throw new Error(); - } + if ("development" !== 'production') { + if (val == null) { + throw new Error(); } + } - return convertOptionIdName(val, ''); + return convertOptionIdName(val, ''); } function convertOptionIdName(idOrName, defaultValue) { - if (idOrName == null) { - return defaultValue; - } + if (idOrName == null) { + return defaultValue; + } - return isString(idOrName) ? idOrName : isNumber(idOrName) || isStringSafe(idOrName) ? idOrName + '' : defaultValue; + return isString(idOrName) ? idOrName : isNumber(idOrName) || isStringSafe(idOrName) ? idOrName + '' : defaultValue; } function warnInvalidateIdOrName(idOrName) { - if ("development" !== 'production') { - warn('`' + idOrName + '` is invalid id or name. Must be a string or number.'); - } + if ("development" !== 'production') { + warn('`' + idOrName + '` is invalid id or name. Must be a string or number.'); + } } function isValidIdOrName(idOrName) { - return isStringSafe(idOrName) || isNumeric(idOrName); + return isStringSafe(idOrName) || isNumeric(idOrName); } function isNameSpecified(componentModel) { - var name = componentModel.name; // Is specified when `indexOf` get -1 or > 0. + var name = componentModel.name; // Is specified when `indexOf` get -1 or > 0. - return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX)); + return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX)); } /** * @public @@ -8228,28 +8228,28 @@ */ function isComponentIdInternal(cmptOption) { - return cmptOption && cmptOption.id != null && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0; + return cmptOption && cmptOption.id != null && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0; } function makeInternalComponentId(idSuffix) { - return INTERNAL_COMPONENT_ID_PREFIX + idSuffix; + return INTERNAL_COMPONENT_ID_PREFIX + idSuffix; } function setComponentTypeToKeyInfo(mappingResult, mainType, componentModelCtor) { - // Set mainType and complete subType. - each(mappingResult, function (item) { - var newOption = item.newOption; + // Set mainType and complete subType. + each(mappingResult, function (item) { + var newOption = item.newOption; - if (isObject(newOption)) { - item.keyInfo.mainType = mainType; - item.keyInfo.subType = determineSubType(mainType, newOption, item.existing, componentModelCtor); - } - }); + if (isObject(newOption)) { + item.keyInfo.mainType = mainType; + item.keyInfo.subType = determineSubType(mainType, newOption, item.existing, componentModelCtor); + } + }); } function determineSubType(mainType, newCmptOption, existComponent, componentModelCtor) { - var subType = newCmptOption.type ? newCmptOption.type : existComponent ? existComponent.subType // Use determineSubType only when there is no existComponent. - : componentModelCtor.determineSubType(mainType, newCmptOption); // tooltip, markline, markpoint may always has no subType + var subType = newCmptOption.type ? newCmptOption.type : existComponent ? existComponent.subType // Use determineSubType only when there is no existComponent. + : componentModelCtor.determineSubType(mainType, newCmptOption); // tooltip, markline, markpoint may always has no subType - return subType; + return subType; } /** * A helper for removing duplicate items between batchA and batchB, @@ -8262,54 +8262,54 @@ function compressBatches(batchA, batchB) { - var mapA = {}; - var mapB = {}; - makeMap(batchA || [], mapA); - makeMap(batchB || [], mapB, mapA); - return [mapToArray(mapA), mapToArray(mapB)]; + var mapA = {}; + var mapB = {}; + makeMap(batchA || [], mapA); + makeMap(batchB || [], mapB, mapA); + return [mapToArray(mapA), mapToArray(mapB)]; - function makeMap(sourceBatch, map, otherMap) { - for (var i = 0, len = sourceBatch.length; i < len; i++) { - var seriesId = convertOptionIdName(sourceBatch[i].seriesId, null); + function makeMap(sourceBatch, map, otherMap) { + for (var i = 0, len = sourceBatch.length; i < len; i++) { + var seriesId = convertOptionIdName(sourceBatch[i].seriesId, null); - if (seriesId == null) { - return; - } + if (seriesId == null) { + return; + } - var dataIndices = normalizeToArray(sourceBatch[i].dataIndex); - var otherDataIndices = otherMap && otherMap[seriesId]; + var dataIndices = normalizeToArray(sourceBatch[i].dataIndex); + var otherDataIndices = otherMap && otherMap[seriesId]; - for (var j = 0, lenj = dataIndices.length; j < lenj; j++) { - var dataIndex = dataIndices[j]; + for (var j = 0, lenj = dataIndices.length; j < lenj; j++) { + var dataIndex = dataIndices[j]; - if (otherDataIndices && otherDataIndices[dataIndex]) { - otherDataIndices[dataIndex] = null; - } else { - (map[seriesId] || (map[seriesId] = {}))[dataIndex] = 1; - } - } + if (otherDataIndices && otherDataIndices[dataIndex]) { + otherDataIndices[dataIndex] = null; + } else { + (map[seriesId] || (map[seriesId] = {}))[dataIndex] = 1; } + } } + } - function mapToArray(map, isData) { - var result = []; + function mapToArray(map, isData) { + var result = []; - for (var i in map) { - if (map.hasOwnProperty(i) && map[i] != null) { - if (isData) { - result.push(+i); - } else { - var dataIndices = mapToArray(map[i], true); - dataIndices.length && result.push({ - seriesId: i, - dataIndex: dataIndices - }); - } - } + for (var i in map) { + if (map.hasOwnProperty(i) && map[i] != null) { + if (isData) { + result.push(+i); + } else { + var dataIndices = mapToArray(map[i], true); + dataIndices.length && result.push({ + seriesId: i, + dataIndex: dataIndices + }); } - - return result; + } } + + return result; + } } /** * @param payload Contains dataIndex (means rawIndex) / dataIndexInside / name @@ -8318,17 +8318,17 @@ */ function queryDataIndex(data, payload) { - if (payload.dataIndexInside != null) { - return payload.dataIndexInside; - } else if (payload.dataIndex != null) { - return isArray(payload.dataIndex) ? map(payload.dataIndex, function (value) { - return data.indexOfRawIndex(value); - }) : data.indexOfRawIndex(payload.dataIndex); - } else if (payload.name != null) { - return isArray(payload.name) ? map(payload.name, function (value) { - return data.indexOfName(value); - }) : data.indexOfName(payload.name); - } + if (payload.dataIndexInside != null) { + return payload.dataIndexInside; + } else if (payload.dataIndex != null) { + return isArray(payload.dataIndex) ? map(payload.dataIndex, function (value) { + return data.indexOfRawIndex(value); + }) : data.indexOfRawIndex(payload.dataIndex); + } else if (payload.name != null) { + return isArray(payload.name) ? map(payload.name, function (value) { + return data.indexOfName(value); + }) : data.indexOfName(payload.name); + } } /** * Enable property storage to any host object. @@ -8352,10 +8352,10 @@ */ function makeInner() { - var key = '__ec_inner_' + innerUniqueIndex++; - return function (hostObj) { - return hostObj[key] || (hostObj[key] = {}); - }; + var key = '__ec_inner_' + innerUniqueIndex++; + return function (hostObj) { + return hostObj[key] || (hostObj[key] = {}); + }; } var innerUniqueIndex = getRandomIdBase(); /** @@ -8363,129 +8363,129 @@ */ function parseFinder(ecModel, finderInput, opt) { - var _a = preParseFinder(finderInput, opt), - mainTypeSpecified = _a.mainTypeSpecified, - queryOptionMap = _a.queryOptionMap, - others = _a.others; - - var result = others; - var defaultMainType = opt ? opt.defaultMainType : null; - - if (!mainTypeSpecified && defaultMainType) { - queryOptionMap.set(defaultMainType, {}); - } - - queryOptionMap.each(function (queryOption, mainType) { - var queryResult = queryReferringComponents(ecModel, mainType, queryOption, { - useDefault: defaultMainType === mainType, - enableAll: opt && opt.enableAll != null ? opt.enableAll : true, - enableNone: opt && opt.enableNone != null ? opt.enableNone : true - }); - result[mainType + 'Models'] = queryResult.models; - result[mainType + 'Model'] = queryResult.models[0]; + var _a = preParseFinder(finderInput, opt), + mainTypeSpecified = _a.mainTypeSpecified, + queryOptionMap = _a.queryOptionMap, + others = _a.others; + + var result = others; + var defaultMainType = opt ? opt.defaultMainType : null; + + if (!mainTypeSpecified && defaultMainType) { + queryOptionMap.set(defaultMainType, {}); + } + + queryOptionMap.each(function (queryOption, mainType) { + var queryResult = queryReferringComponents(ecModel, mainType, queryOption, { + useDefault: defaultMainType === mainType, + enableAll: opt && opt.enableAll != null ? opt.enableAll : true, + enableNone: opt && opt.enableNone != null ? opt.enableNone : true }); - return result; + result[mainType + 'Models'] = queryResult.models; + result[mainType + 'Model'] = queryResult.models[0]; + }); + return result; } function preParseFinder(finderInput, opt) { - var finder; - - if (isString(finderInput)) { - var obj = {}; - obj[finderInput + 'Index'] = 0; - finder = obj; - } else { - finder = finderInput; - } - - var queryOptionMap = createHashMap(); - var others = {}; - var mainTypeSpecified = false; - each(finder, function (value, key) { - // Exclude 'dataIndex' and other illgal keys. - if (key === 'dataIndex' || key === 'dataIndexInside') { - others[key] = value; - return; - } - - var parsedKey = key.match(/^(\w+)(Index|Id|Name)$/) || []; - var mainType = parsedKey[1]; - var queryType = (parsedKey[2] || '').toLowerCase(); - - if (!mainType || !queryType || opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0) { - return; - } - - mainTypeSpecified = mainTypeSpecified || !!mainType; - var queryOption = queryOptionMap.get(mainType) || queryOptionMap.set(mainType, {}); - queryOption[queryType] = value; - }); - return { - mainTypeSpecified: mainTypeSpecified, - queryOptionMap: queryOptionMap, - others: others - }; + var finder; + + if (isString(finderInput)) { + var obj = {}; + obj[finderInput + 'Index'] = 0; + finder = obj; + } else { + finder = finderInput; + } + + var queryOptionMap = createHashMap(); + var others = {}; + var mainTypeSpecified = false; + each(finder, function (value, key) { + // Exclude 'dataIndex' and other illgal keys. + if (key === 'dataIndex' || key === 'dataIndexInside') { + others[key] = value; + return; + } + + var parsedKey = key.match(/^(\w+)(Index|Id|Name)$/) || []; + var mainType = parsedKey[1]; + var queryType = (parsedKey[2] || '').toLowerCase(); + + if (!mainType || !queryType || opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0) { + return; + } + + mainTypeSpecified = mainTypeSpecified || !!mainType; + var queryOption = queryOptionMap.get(mainType) || queryOptionMap.set(mainType, {}); + queryOption[queryType] = value; + }); + return { + mainTypeSpecified: mainTypeSpecified, + queryOptionMap: queryOptionMap, + others: others + }; } var SINGLE_REFERRING = { - useDefault: true, - enableAll: false, - enableNone: false + useDefault: true, + enableAll: false, + enableNone: false }; var MULTIPLE_REFERRING = { - useDefault: false, - enableAll: true, - enableNone: true + useDefault: false, + enableAll: true, + enableNone: true }; function queryReferringComponents(ecModel, mainType, userOption, opt) { - opt = opt || SINGLE_REFERRING; - var indexOption = userOption.index; - var idOption = userOption.id; - var nameOption = userOption.name; - var result = { - models: null, - specified: indexOption != null || idOption != null || nameOption != null - }; + opt = opt || SINGLE_REFERRING; + var indexOption = userOption.index; + var idOption = userOption.id; + var nameOption = userOption.name; + var result = { + models: null, + specified: indexOption != null || idOption != null || nameOption != null + }; + + if (!result.specified) { + // Use the first as default if `useDefault`. + var firstCmpt = void 0; + result.models = opt.useDefault && (firstCmpt = ecModel.getComponent(mainType)) ? [firstCmpt] : []; + return result; + } - if (!result.specified) { - // Use the first as default if `useDefault`. - var firstCmpt = void 0; - result.models = opt.useDefault && (firstCmpt = ecModel.getComponent(mainType)) ? [firstCmpt] : []; - return result; - } + if (indexOption === 'none' || indexOption === false) { + assert(opt.enableNone, '`"none"` or `false` is not a valid value on index option.'); + result.models = []; + return result; + } // `queryComponents` will return all components if + // both all of index/id/name are null/undefined. - if (indexOption === 'none' || indexOption === false) { - assert(opt.enableNone, '`"none"` or `false` is not a valid value on index option.'); - result.models = []; - return result; - } // `queryComponents` will return all components if - // both all of index/id/name are null/undefined. + if (indexOption === 'all') { + assert(opt.enableAll, '`"all"` is not a valid value on index option.'); + indexOption = idOption = nameOption = null; + } - if (indexOption === 'all') { - assert(opt.enableAll, '`"all"` is not a valid value on index option.'); - indexOption = idOption = nameOption = null; - } - - result.models = ecModel.queryComponents({ - mainType: mainType, - index: indexOption, - id: idOption, - name: nameOption - }); - return result; + result.models = ecModel.queryComponents({ + mainType: mainType, + index: indexOption, + id: idOption, + name: nameOption + }); + return result; } function setAttribute(dom, key, value) { - dom.setAttribute ? dom.setAttribute(key, value) : dom[key] = value; + dom.setAttribute ? dom.setAttribute(key, value) : dom[key] = value; } function getAttribute(dom, key) { - return dom.getAttribute ? dom.getAttribute(key) : dom[key]; + return dom.getAttribute ? dom.getAttribute(key) : dom[key]; } function getTooltipRenderMode(renderModeOption) { - if (renderModeOption === 'auto') { - // Using html when `document` exists, use richText otherwise - return env.domSupported ? 'html' : 'richText'; - } else { - return renderModeOption || 'html'; - } + if (renderModeOption === 'auto') { + // Using html when `document` exists, use richText otherwise + return env.domSupported ? 'html' : 'richText'; + } else { + return renderModeOption || 'html'; + } } /** * Group a list by key. @@ -8493,16 +8493,16 @@ function groupData(array, getKey // return key ) { - var buckets = createHashMap(); - var keys = []; - each(array, function (item) { - var key = getKey(item); - (buckets.get(key) || (keys.push(key), buckets.set(key, []))).push(item); - }); - return { - keys: keys, - buckets: buckets - }; + var buckets = createHashMap(); + var keys = []; + each(array, function (item) { + var key = getKey(item); + (buckets.get(key) || (keys.push(key), buckets.set(key, []))).push(item); + }); + return { + keys: keys, + buckets: buckets + }; } /** * Interpolate raw values of a series with percent @@ -8520,39 +8520,39 @@ */ function interpolateRawValues(data, precision, sourceValue, targetValue, percent) { - var isAutoPrecision = precision == null || precision === 'auto'; - - if (targetValue == null) { - return targetValue; - } + var isAutoPrecision = precision == null || precision === 'auto'; - if (isNumber(targetValue)) { - var value = interpolateNumber$1(sourceValue || 0, targetValue, percent); - return round(value, isAutoPrecision ? Math.max(getPrecision(sourceValue || 0), getPrecision(targetValue)) : precision); - } else if (isString(targetValue)) { - return percent < 1 ? sourceValue : targetValue; - } else { - var interpolated = []; - var leftArr = sourceValue; - var rightArr = targetValue; - var length_1 = Math.max(leftArr ? leftArr.length : 0, rightArr.length); + if (targetValue == null) { + return targetValue; + } - for (var i = 0; i < length_1; ++i) { - var info = data.getDimensionInfo(i); // Don't interpolate ordinal dims + if (isNumber(targetValue)) { + var value = interpolateNumber$1(sourceValue || 0, targetValue, percent); + return round(value, isAutoPrecision ? Math.max(getPrecision(sourceValue || 0), getPrecision(targetValue)) : precision); + } else if (isString(targetValue)) { + return percent < 1 ? sourceValue : targetValue; + } else { + var interpolated = []; + var leftArr = sourceValue; + var rightArr = targetValue; + var length_1 = Math.max(leftArr ? leftArr.length : 0, rightArr.length); - if (info && info.type === 'ordinal') { - // In init, there is no `sourceValue`, but should better not to get undefined result. - interpolated[i] = (percent < 1 && leftArr ? leftArr : rightArr)[i]; - } else { - var leftVal = leftArr && leftArr[i] ? leftArr[i] : 0; - var rightVal = rightArr[i]; - var value = interpolateNumber$1(leftVal, rightVal, percent); - interpolated[i] = round(value, isAutoPrecision ? Math.max(getPrecision(leftVal), getPrecision(rightVal)) : precision); - } - } + for (var i = 0; i < length_1; ++i) { + var info = data.getDimensionInfo(i); // Don't interpolate ordinal dims - return interpolated; + if (info && info.type === 'ordinal') { + // In init, there is no `sourceValue`, but should better not to get undefined result. + interpolated[i] = (percent < 1 && leftArr ? leftArr : rightArr)[i]; + } else { + var leftVal = leftArr && leftArr[i] ? leftArr[i] : 0; + var rightVal = rightArr[i]; + var value = interpolateNumber$1(leftVal, rightVal, percent); + interpolated[i] = round(value, isAutoPrecision ? Math.max(getPrecision(leftVal), getPrecision(rightVal)) : precision); + } } + + return interpolated; + } } var TYPE_DELIMITER = '.'; @@ -8564,29 +8564,29 @@ */ function parseClassType(componentType) { - var ret = { - main: '', - sub: '' - }; + var ret = { + main: '', + sub: '' + }; - if (componentType) { - var typeArr = componentType.split(TYPE_DELIMITER); - ret.main = typeArr[0] || ''; - ret.sub = typeArr[1] || ''; - } + if (componentType) { + var typeArr = componentType.split(TYPE_DELIMITER); + ret.main = typeArr[0] || ''; + ret.sub = typeArr[1] || ''; + } - return ret; + return ret; } /** * @public */ function checkClassType(componentType) { - assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType "' + componentType + '" illegal'); + assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType "' + componentType + '" illegal'); } function isExtendedClass(clz) { - return !!(clz && clz[IS_EXTENDED_CLASS]); + return !!(clz && clz[IS_EXTENDED_CLASS]); } /** * Implements `ExtendableConstructor` for `rootClz`. @@ -8600,59 +8600,59 @@ */ function enableClassExtend(rootClz, mandatoryMethods) { - rootClz.$constructor = rootClz; // FIXME: not necessary? + rootClz.$constructor = rootClz; // FIXME: not necessary? - rootClz.extend = function (proto) { - if ("development" !== 'production') { - each(mandatoryMethods, function (method) { - if (!proto[method]) { - console.warn('Method `' + method + '` should be implemented' + (proto.type ? ' in ' + proto.type : '') + '.'); - } - }); + rootClz.extend = function (proto) { + if ("development" !== 'production') { + each(mandatoryMethods, function (method) { + if (!proto[method]) { + console.warn('Method `' + method + '` should be implemented' + (proto.type ? ' in ' + proto.type : '') + '.'); } + }); + } - var superClass = this; - var ExtendedClass; - - if (isESClass(superClass)) { - ExtendedClass = - /** @class */ - function (_super) { - __extends(class_1, _super); - - function class_1() { - return _super.apply(this, arguments) || this; - } + var superClass = this; + var ExtendedClass; - return class_1; - }(superClass); - } else { - // For backward compat, we both support ts class inheritance and this - // "extend" approach. - // The constructor should keep the same behavior as ts class inheritance: - // If this constructor/$constructor is not declared, auto invoke the super - // constructor. - // If this constructor/$constructor is declared, it is responsible for - // calling the super constructor. - ExtendedClass = function () { - (proto.$constructor || superClass).apply(this, arguments); - }; + if (isESClass(superClass)) { + ExtendedClass = + /** @class */ + function (_super) { + __extends(class_1, _super); - inherits(ExtendedClass, this); + function class_1() { + return _super.apply(this, arguments) || this; } - extend(ExtendedClass.prototype, proto); - ExtendedClass[IS_EXTENDED_CLASS] = true; - ExtendedClass.extend = this.extend; - ExtendedClass.superCall = superCall; - ExtendedClass.superApply = superApply; - ExtendedClass.superClass = superClass; - return ExtendedClass; - }; + return class_1; + }(superClass); + } else { + // For backward compat, we both support ts class inheritance and this + // "extend" approach. + // The constructor should keep the same behavior as ts class inheritance: + // If this constructor/$constructor is not declared, auto invoke the super + // constructor. + // If this constructor/$constructor is declared, it is responsible for + // calling the super constructor. + ExtendedClass = function () { + (proto.$constructor || superClass).apply(this, arguments); + }; + + inherits(ExtendedClass, this); + } + + extend(ExtendedClass.prototype, proto); + ExtendedClass[IS_EXTENDED_CLASS] = true; + ExtendedClass.extend = this.extend; + ExtendedClass.superCall = superCall; + ExtendedClass.superApply = superApply; + ExtendedClass.superClass = superClass; + return ExtendedClass; + }; } function isESClass(fn) { - return isFunction(fn) && /^class\s/.test(Function.prototype.toString.call(fn)); + return isFunction(fn) && /^class\s/.test(Function.prototype.toString.call(fn)); } /** * A work around to both support ts extend and this extend mechanism. @@ -8671,7 +8671,7 @@ function mountExtend(SubClz, SupperClz) { - SubClz.extend = SupperClz.extend; + SubClz.extend = SupperClz.extend; } // A random offset. var classBase = Math.round(Math.random() * 10); @@ -8690,16 +8690,16 @@ */ function enableClassCheck(target) { - var classAttr = ['__\0is_clz', classBase++].join('_'); - target.prototype[classAttr] = true; + var classAttr = ['__\0is_clz', classBase++].join('_'); + target.prototype[classAttr] = true; - if ("development" !== 'production') { - assert(!target.isInstance, 'The method "is" can not be defined.'); - } + if ("development" !== 'production') { + assert(!target.isInstance, 'The method "is" can not be defined.'); + } - target.isInstance = function (obj) { - return !!(obj && obj[classAttr]); - }; + target.isInstance = function (obj) { + return !!(obj && obj[classAttr]); + }; } // superCall should have class info, which can not be fetch from 'this'. // Consider this case: // class A has method f, @@ -8708,17 +8708,17 @@ // then when method of class C is called, dead loop occured. function superCall(context, methodName) { - var args = []; + var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } - return this.superClass.prototype[methodName].apply(context, args); + return this.superClass.prototype[methodName].apply(context, args); } function superApply(context, methodName, args) { - return this.superClass.prototype[methodName].apply(context, args); + return this.superClass.prototype[methodName].apply(context, args); } /** * Implements `ClassManager` for `target` @@ -8733,114 +8733,114 @@ function enableClassManagement(target) { - /** - * Component model classes - * key: componentType, - * value: - * componentClass, when componentType is 'xxx' - * or Object., when componentType is 'xxx.yy' - */ - var storage = {}; - - target.registerClass = function (clz) { - // `type` should not be a "instance memeber". - // If using TS class, should better declared as `static type = 'series.pie'`. - // otherwise users have to mount `type` on prototype manually. - // For backward compat and enable instance visit type via `this.type`, - // we stil support fetch `type` from prototype. - var componentFullType = clz.type || clz.prototype.type; - - if (componentFullType) { - checkClassType(componentFullType); // If only static type declared, we assign it to prototype mandatorily. - - clz.prototype.type = componentFullType; - var componentTypeInfo = parseClassType(componentFullType); - - if (!componentTypeInfo.sub) { - if ("development" !== 'production') { - if (storage[componentTypeInfo.main]) { - console.warn(componentTypeInfo.main + ' exists.'); - } - } + /** + * Component model classes + * key: componentType, + * value: + * componentClass, when componentType is 'xxx' + * or Object., when componentType is 'xxx.yy' + */ + var storage = {}; - storage[componentTypeInfo.main] = clz; - } else if (componentTypeInfo.sub !== IS_CONTAINER) { - var container = makeContainer(componentTypeInfo); - container[componentTypeInfo.sub] = clz; - } - } + target.registerClass = function (clz) { + // `type` should not be a "instance memeber". + // If using TS class, should better declared as `static type = 'series.pie'`. + // otherwise users have to mount `type` on prototype manually. + // For backward compat and enable instance visit type via `this.type`, + // we stil support fetch `type` from prototype. + var componentFullType = clz.type || clz.prototype.type; - return clz; - }; + if (componentFullType) { + checkClassType(componentFullType); // If only static type declared, we assign it to prototype mandatorily. - target.getClass = function (mainType, subType, throwWhenNotFound) { - var clz = storage[mainType]; + clz.prototype.type = componentFullType; + var componentTypeInfo = parseClassType(componentFullType); - if (clz && clz[IS_CONTAINER]) { - clz = subType ? clz[subType] : null; + if (!componentTypeInfo.sub) { + if ("development" !== 'production') { + if (storage[componentTypeInfo.main]) { + console.warn(componentTypeInfo.main + ' exists.'); + } } - if (throwWhenNotFound && !clz) { - throw new Error(!subType ? mainType + '.' + 'type should be specified.' : 'Component ' + mainType + '.' + (subType || '') + ' is used but not imported.'); - } + storage[componentTypeInfo.main] = clz; + } else if (componentTypeInfo.sub !== IS_CONTAINER) { + var container = makeContainer(componentTypeInfo); + container[componentTypeInfo.sub] = clz; + } + } - return clz; - }; + return clz; + }; - target.getClassesByMainType = function (componentType) { - var componentTypeInfo = parseClassType(componentType); - var result = []; - var obj = storage[componentTypeInfo.main]; + target.getClass = function (mainType, subType, throwWhenNotFound) { + var clz = storage[mainType]; - if (obj && obj[IS_CONTAINER]) { - each(obj, function (o, type) { - type !== IS_CONTAINER && result.push(o); - }); - } else { - result.push(obj); - } + if (clz && clz[IS_CONTAINER]) { + clz = subType ? clz[subType] : null; + } - return result; - }; + if (throwWhenNotFound && !clz) { + throw new Error(!subType ? mainType + '.' + 'type should be specified.' : 'Component ' + mainType + '.' + (subType || '') + ' is used but not imported.'); + } - target.hasClass = function (componentType) { - // Just consider componentType.main. - var componentTypeInfo = parseClassType(componentType); - return !!storage[componentTypeInfo.main]; - }; - /** - * @return Like ['aa', 'bb'], but can not be ['aa.xx'] - */ + return clz; + }; + target.getClassesByMainType = function (componentType) { + var componentTypeInfo = parseClassType(componentType); + var result = []; + var obj = storage[componentTypeInfo.main]; - target.getAllClassMainTypes = function () { - var types = []; - each(storage, function (obj, type) { - types.push(type); - }); - return types; - }; - /** - * If a main type is container and has sub types - */ + if (obj && obj[IS_CONTAINER]) { + each(obj, function (o, type) { + type !== IS_CONTAINER && result.push(o); + }); + } else { + result.push(obj); + } + return result; + }; + + target.hasClass = function (componentType) { + // Just consider componentType.main. + var componentTypeInfo = parseClassType(componentType); + return !!storage[componentTypeInfo.main]; + }; + /** + * @return Like ['aa', 'bb'], but can not be ['aa.xx'] + */ - target.hasSubTypes = function (componentType) { - var componentTypeInfo = parseClassType(componentType); - var obj = storage[componentTypeInfo.main]; - return obj && obj[IS_CONTAINER]; - }; - function makeContainer(componentTypeInfo) { - var container = storage[componentTypeInfo.main]; + target.getAllClassMainTypes = function () { + var types = []; + each(storage, function (obj, type) { + types.push(type); + }); + return types; + }; + /** + * If a main type is container and has sub types + */ - if (!container || !container[IS_CONTAINER]) { - container = storage[componentTypeInfo.main] = {}; - container[IS_CONTAINER] = true; - } - return container; + target.hasSubTypes = function (componentType) { + var componentTypeInfo = parseClassType(componentType); + var obj = storage[componentTypeInfo.main]; + return obj && obj[IS_CONTAINER]; + }; + + function makeContainer(componentTypeInfo) { + var container = storage[componentTypeInfo.main]; + + if (!container || !container[IS_CONTAINER]) { + container = storage[componentTypeInfo.main] = {}; + container[IS_CONTAINER] = true; } + + return container; + } } // /** // * @param {string|Array.} properties // */ @@ -8862,52 +8862,52 @@ // } function makeStyleMapper(properties, ignoreParent) { - // Normalize - for (var i = 0; i < properties.length; i++) { - if (!properties[i][1]) { - properties[i][1] = properties[i][0]; - } + // Normalize + for (var i = 0; i < properties.length; i++) { + if (!properties[i][1]) { + properties[i][1] = properties[i][0]; } + } - ignoreParent = ignoreParent || false; - return function (model, excludes, includes) { - var style = {}; + ignoreParent = ignoreParent || false; + return function (model, excludes, includes) { + var style = {}; - for (var i = 0; i < properties.length; i++) { - var propName = properties[i][1]; + for (var i = 0; i < properties.length; i++) { + var propName = properties[i][1]; - if (excludes && indexOf(excludes, propName) >= 0 || includes && indexOf(includes, propName) < 0) { - continue; - } + if (excludes && indexOf(excludes, propName) >= 0 || includes && indexOf(includes, propName) < 0) { + continue; + } - var val = model.getShallow(propName, ignoreParent); + var val = model.getShallow(propName, ignoreParent); - if (val != null) { - style[properties[i][0]] = val; - } - } // TODO Text or image? + if (val != null) { + style[properties[i][0]] = val; + } + } // TODO Text or image? - return style; - }; + return style; + }; } var AREA_STYLE_KEY_MAP = [['fill', 'color'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['opacity'], ['shadowColor'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`. - // So do not transfer decal directly. + // So do not transfer decal directly. ]; var getAreaStyle = makeStyleMapper(AREA_STYLE_KEY_MAP); var AreaStyleMixin = - /** @class */ - function () { - function AreaStyleMixin() {} + /** @class */ + function () { + function AreaStyleMixin() {} - AreaStyleMixin.prototype.getAreaStyle = function (excludes, includes) { - return getAreaStyle(this, excludes, includes); - }; + AreaStyleMixin.prototype.getAreaStyle = function (excludes, includes) { + return getAreaStyle(this, excludes, includes); + }; - return AreaStyleMixin; - }(); + return AreaStyleMixin; + }(); var globalImageCache = new LRU(50); function findExistImage(newImageOrSrc) { @@ -11971,14 +11971,14 @@ var rightIndex = tokenCount - 1; var token = void 0; while (leftIndex < tokenCount - && (token = tokens[leftIndex], !token.align || token.align === 'left')) { + && (token = tokens[leftIndex], !token.align || token.align === 'left')) { this._placeToken(token, style, lineHeight, lineTop, lineXLeft, 'left', bgColorDrawn); remainedWidth -= token.width; lineXLeft += token.width; leftIndex++; } while (rightIndex >= 0 - && (token = tokens[rightIndex], token.align === 'right')) { + && (token = tokens[rightIndex], token.align === 'right')) { this._placeToken(token, style, lineHeight, lineTop, lineXRight, 'right', bgColorDrawn); remainedWidth -= token.width; lineXRight -= token.width; @@ -12217,23 +12217,23 @@ var getECData = makeInner(); var setCommonECData = function (seriesIndex, dataType, dataIdx, el) { - if (el) { - var ecData = getECData(el); // Add data index and series index for indexing the data by element - // Useful in tooltip - - ecData.dataIndex = dataIdx; - ecData.dataType = dataType; - ecData.seriesIndex = seriesIndex; // TODO: not store dataIndex on children. - - if (el.type === 'group') { - el.traverse(function (child) { - var childECData = getECData(child); - childECData.seriesIndex = seriesIndex; - childECData.dataIndex = dataIdx; - childECData.dataType = dataType; - }); - } - } + if (el) { + var ecData = getECData(el); // Add data index and series index for indexing the data by element + // Useful in tooltip + + ecData.dataIndex = dataIdx; + ecData.dataType = dataType; + ecData.seriesIndex = seriesIndex; // TODO: not store dataIndex on children. + + if (el.type === 'group') { + el.traverse(function (child) { + var childECData = getECData(child); + childECData.seriesIndex = seriesIndex; + childECData.dataIndex = dataIdx; + childECData.dataType = dataType; + }); + } + } }; var _highlightNextDigit = 1; @@ -12254,234 +12254,234 @@ var TOGGLE_SELECT_ACTION_TYPE = 'toggleSelect'; function hasFillOrStroke(fillOrStroke) { - return fillOrStroke != null && fillOrStroke !== 'none'; + return fillOrStroke != null && fillOrStroke !== 'none'; } // Most lifted color are duplicated. var liftedColorCache = new LRU(100); function liftColor(color$1) { - if (isString(color$1)) { - var liftedColor = liftedColorCache.get(color$1); - - if (!liftedColor) { - liftedColor = lift(color$1, -0.1); - liftedColorCache.put(color$1, liftedColor); - } - - return liftedColor; - } else if (isGradientObject(color$1)) { - var ret = extend({}, color$1); - ret.colorStops = map(color$1.colorStops, function (stop) { - return { - offset: stop.offset, - color: lift(stop.color, -0.1) - }; - }); - return ret; - } // Change nothing. + if (isString(color$1)) { + var liftedColor = liftedColorCache.get(color$1); + + if (!liftedColor) { + liftedColor = lift(color$1, -0.1); + liftedColorCache.put(color$1, liftedColor); + } + + return liftedColor; + } else if (isGradientObject(color$1)) { + var ret = extend({}, color$1); + ret.colorStops = map(color$1.colorStops, function (stop) { + return { + offset: stop.offset, + color: lift(stop.color, -0.1) + }; + }); + return ret; + } // Change nothing. - return color$1; + return color$1; } function doChangeHoverState(el, stateName, hoverStateEnum) { - if (el.onHoverStateChange && (el.hoverState || 0) !== hoverStateEnum) { - el.onHoverStateChange(stateName); - } + if (el.onHoverStateChange && (el.hoverState || 0) !== hoverStateEnum) { + el.onHoverStateChange(stateName); + } - el.hoverState = hoverStateEnum; + el.hoverState = hoverStateEnum; } function singleEnterEmphasis(el) { - // Only mark the flag. - // States will be applied in the echarts.ts in next frame. - doChangeHoverState(el, 'emphasis', HOVER_STATE_EMPHASIS); + // Only mark the flag. + // States will be applied in the echarts.ts in next frame. + doChangeHoverState(el, 'emphasis', HOVER_STATE_EMPHASIS); } function singleLeaveEmphasis(el) { - // Only mark the flag. - // States will be applied in the echarts.ts in next frame. - if (el.hoverState === HOVER_STATE_EMPHASIS) { - doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL); - } + // Only mark the flag. + // States will be applied in the echarts.ts in next frame. + if (el.hoverState === HOVER_STATE_EMPHASIS) { + doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL); + } } function singleEnterBlur(el) { - doChangeHoverState(el, 'blur', HOVER_STATE_BLUR); + doChangeHoverState(el, 'blur', HOVER_STATE_BLUR); } function singleLeaveBlur(el) { - if (el.hoverState === HOVER_STATE_BLUR) { - doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL); - } + if (el.hoverState === HOVER_STATE_BLUR) { + doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL); + } } function singleEnterSelect(el) { - el.selected = true; + el.selected = true; } function singleLeaveSelect(el) { - el.selected = false; + el.selected = false; } function updateElementState(el, updater, commonParam) { - updater(el, commonParam); + updater(el, commonParam); } function traverseUpdateState(el, updater, commonParam) { - updateElementState(el, updater, commonParam); - el.isGroup && el.traverse(function (child) { - updateElementState(child, updater, commonParam); - }); + updateElementState(el, updater, commonParam); + el.isGroup && el.traverse(function (child) { + updateElementState(child, updater, commonParam); + }); } function setStatesFlag(el, stateName) { - switch (stateName) { - case 'emphasis': - el.hoverState = HOVER_STATE_EMPHASIS; - break; + switch (stateName) { + case 'emphasis': + el.hoverState = HOVER_STATE_EMPHASIS; + break; - case 'normal': - el.hoverState = HOVER_STATE_NORMAL; - break; + case 'normal': + el.hoverState = HOVER_STATE_NORMAL; + break; - case 'blur': - el.hoverState = HOVER_STATE_BLUR; - break; + case 'blur': + el.hoverState = HOVER_STATE_BLUR; + break; - case 'select': - el.selected = true; - } + case 'select': + el.selected = true; + } } function getFromStateStyle(el, props, toStateName, defaultValue) { - var style = el.style; - var fromState = {}; + var style = el.style; + var fromState = {}; - for (var i = 0; i < props.length; i++) { - var propName = props[i]; - var val = style[propName]; - fromState[propName] = val == null ? defaultValue && defaultValue[propName] : val; - } + for (var i = 0; i < props.length; i++) { + var propName = props[i]; + var val = style[propName]; + fromState[propName] = val == null ? defaultValue && defaultValue[propName] : val; + } - for (var i = 0; i < el.animators.length; i++) { - var animator = el.animators[i]; + for (var i = 0; i < el.animators.length; i++) { + var animator = el.animators[i]; - if (animator.__fromStateTransition // Dont consider the animation to emphasis state. - && animator.__fromStateTransition.indexOf(toStateName) < 0 && animator.targetName === 'style') { - animator.saveTo(fromState, props); - } + if (animator.__fromStateTransition // Dont consider the animation to emphasis state. + && animator.__fromStateTransition.indexOf(toStateName) < 0 && animator.targetName === 'style') { + animator.saveTo(fromState, props); } + } - return fromState; + return fromState; } function createEmphasisDefaultState(el, stateName, targetStates, state) { - var hasSelect = targetStates && indexOf(targetStates, 'select') >= 0; - var cloned = false; + var hasSelect = targetStates && indexOf(targetStates, 'select') >= 0; + var cloned = false; - if (el instanceof Path) { - var store = getSavedStates(el); - var fromFill = hasSelect ? store.selectFill || store.normalFill : store.normalFill; - var fromStroke = hasSelect ? store.selectStroke || store.normalStroke : store.normalStroke; - - if (hasFillOrStroke(fromFill) || hasFillOrStroke(fromStroke)) { - state = state || {}; - var emphasisStyle = state.style || {}; // inherit case - - if (emphasisStyle.fill === 'inherit') { - cloned = true; - state = extend({}, state); - emphasisStyle = extend({}, emphasisStyle); - emphasisStyle.fill = fromFill; - } // Apply default color lift - else if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) { - cloned = true; // Not modify the original value. - - state = extend({}, state); - emphasisStyle = extend({}, emphasisStyle); // Already being applied 'emphasis'. DON'T lift color multiple times. - - emphasisStyle.fill = liftColor(fromFill); - } // Not highlight stroke if fill has been highlighted. - else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) { - if (!cloned) { - state = extend({}, state); - emphasisStyle = extend({}, emphasisStyle); - } + if (el instanceof Path) { + var store = getSavedStates(el); + var fromFill = hasSelect ? store.selectFill || store.normalFill : store.normalFill; + var fromStroke = hasSelect ? store.selectStroke || store.normalStroke : store.normalStroke; - emphasisStyle.stroke = liftColor(fromStroke); + if (hasFillOrStroke(fromFill) || hasFillOrStroke(fromStroke)) { + state = state || {}; + var emphasisStyle = state.style || {}; // inherit case + + if (emphasisStyle.fill === 'inherit') { + cloned = true; + state = extend({}, state); + emphasisStyle = extend({}, emphasisStyle); + emphasisStyle.fill = fromFill; + } // Apply default color lift + else if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) { + cloned = true; // Not modify the original value. + + state = extend({}, state); + emphasisStyle = extend({}, emphasisStyle); // Already being applied 'emphasis'. DON'T lift color multiple times. + + emphasisStyle.fill = liftColor(fromFill); + } // Not highlight stroke if fill has been highlighted. + else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) { + if (!cloned) { + state = extend({}, state); + emphasisStyle = extend({}, emphasisStyle); } - state.style = emphasisStyle; - } + emphasisStyle.stroke = liftColor(fromStroke); + } + + state.style = emphasisStyle; } + } - if (state) { - // TODO Share with textContent? - if (state.z2 == null) { - if (!cloned) { - state = extend({}, state); - } + if (state) { + // TODO Share with textContent? + if (state.z2 == null) { + if (!cloned) { + state = extend({}, state); + } - var z2EmphasisLift = el.z2EmphasisLift; - state.z2 = el.z2 + (z2EmphasisLift != null ? z2EmphasisLift : Z2_EMPHASIS_LIFT); - } + var z2EmphasisLift = el.z2EmphasisLift; + state.z2 = el.z2 + (z2EmphasisLift != null ? z2EmphasisLift : Z2_EMPHASIS_LIFT); } + } - return state; + return state; } function createSelectDefaultState(el, stateName, state) { - // const hasSelect = indexOf(el.currentStates, stateName) >= 0; - if (state) { - // TODO Share with textContent? - if (state.z2 == null) { - state = extend({}, state); - var z2SelectLift = el.z2SelectLift; - state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT); - } + // const hasSelect = indexOf(el.currentStates, stateName) >= 0; + if (state) { + // TODO Share with textContent? + if (state.z2 == null) { + state = extend({}, state); + var z2SelectLift = el.z2SelectLift; + state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT); } + } - return state; + return state; } function createBlurDefaultState(el, stateName, state) { - var hasBlur = indexOf(el.currentStates, stateName) >= 0; - var currentOpacity = el.style.opacity; - var fromState = !hasBlur ? getFromStateStyle(el, ['opacity'], stateName, { - opacity: 1 - }) : null; - state = state || {}; - var blurStyle = state.style || {}; - - if (blurStyle.opacity == null) { - // clone state - state = extend({}, state); - blurStyle = extend({ - // Already being applied 'emphasis'. DON'T mul opacity multiple times. - opacity: hasBlur ? currentOpacity : fromState.opacity * 0.1 - }, blurStyle); - state.style = blurStyle; - } - - return state; + var hasBlur = indexOf(el.currentStates, stateName) >= 0; + var currentOpacity = el.style.opacity; + var fromState = !hasBlur ? getFromStateStyle(el, ['opacity'], stateName, { + opacity: 1 + }) : null; + state = state || {}; + var blurStyle = state.style || {}; + + if (blurStyle.opacity == null) { + // clone state + state = extend({}, state); + blurStyle = extend({ + // Already being applied 'emphasis'. DON'T mul opacity multiple times. + opacity: hasBlur ? currentOpacity : fromState.opacity * 0.1 + }, blurStyle); + state.style = blurStyle; + } + + return state; } function elementStateProxy(stateName, targetStates) { - var state = this.states[stateName]; + var state = this.states[stateName]; - if (this.style) { - if (stateName === 'emphasis') { - return createEmphasisDefaultState(this, stateName, targetStates, state); - } else if (stateName === 'blur') { - return createBlurDefaultState(this, stateName, state); - } else if (stateName === 'select') { - return createSelectDefaultState(this, stateName, state); - } + if (this.style) { + if (stateName === 'emphasis') { + return createEmphasisDefaultState(this, stateName, targetStates, state); + } else if (stateName === 'blur') { + return createBlurDefaultState(this, stateName, state); + } else if (stateName === 'select') { + return createSelectDefaultState(this, stateName, state); } + } - return state; + return state; } /**FI * Set hover style (namely "emphasis style") of element. @@ -12491,356 +12491,356 @@ function setDefaultStateProxy(el) { - el.stateProxy = elementStateProxy; - var textContent = el.getTextContent(); - var textGuide = el.getTextGuideLine(); + el.stateProxy = elementStateProxy; + var textContent = el.getTextContent(); + var textGuide = el.getTextGuideLine(); - if (textContent) { - textContent.stateProxy = elementStateProxy; - } + if (textContent) { + textContent.stateProxy = elementStateProxy; + } - if (textGuide) { - textGuide.stateProxy = elementStateProxy; - } + if (textGuide) { + textGuide.stateProxy = elementStateProxy; + } } function enterEmphasisWhenMouseOver(el, e) { - !shouldSilent(el, e) // "emphasis" event highlight has higher priority than mouse highlight. - && !el.__highByOuter && traverseUpdateState(el, singleEnterEmphasis); + !shouldSilent(el, e) // "emphasis" event highlight has higher priority than mouse highlight. + && !el.__highByOuter && traverseUpdateState(el, singleEnterEmphasis); } function leaveEmphasisWhenMouseOut(el, e) { - !shouldSilent(el, e) // "emphasis" event highlight has higher priority than mouse highlight. - && !el.__highByOuter && traverseUpdateState(el, singleLeaveEmphasis); + !shouldSilent(el, e) // "emphasis" event highlight has higher priority than mouse highlight. + && !el.__highByOuter && traverseUpdateState(el, singleLeaveEmphasis); } function enterEmphasis(el, highlightDigit) { - el.__highByOuter |= 1 << (highlightDigit || 0); - traverseUpdateState(el, singleEnterEmphasis); + el.__highByOuter |= 1 << (highlightDigit || 0); + traverseUpdateState(el, singleEnterEmphasis); } function leaveEmphasis(el, highlightDigit) { - !(el.__highByOuter &= ~(1 << (highlightDigit || 0))) && traverseUpdateState(el, singleLeaveEmphasis); + !(el.__highByOuter &= ~(1 << (highlightDigit || 0))) && traverseUpdateState(el, singleLeaveEmphasis); } function enterBlur(el) { - traverseUpdateState(el, singleEnterBlur); + traverseUpdateState(el, singleEnterBlur); } function leaveBlur(el) { - traverseUpdateState(el, singleLeaveBlur); + traverseUpdateState(el, singleLeaveBlur); } function enterSelect(el) { - traverseUpdateState(el, singleEnterSelect); + traverseUpdateState(el, singleEnterSelect); } function leaveSelect(el) { - traverseUpdateState(el, singleLeaveSelect); + traverseUpdateState(el, singleLeaveSelect); } function shouldSilent(el, e) { - return el.__highDownSilentOnTouch && e.zrByTouch; + return el.__highDownSilentOnTouch && e.zrByTouch; } function allLeaveBlur(api) { - var model = api.getModel(); - var leaveBlurredSeries = []; - var allComponentViews = []; - model.eachComponent(function (componentType, componentModel) { - var componentStates = getComponentStates(componentModel); - var isSeries = componentType === 'series'; - var view = isSeries ? api.getViewOfSeriesModel(componentModel) : api.getViewOfComponentModel(componentModel); - !isSeries && allComponentViews.push(view); - - if (componentStates.isBlured) { - // Leave blur anyway - view.group.traverse(function (child) { - singleLeaveBlur(child); - }); - isSeries && leaveBlurredSeries.push(componentModel); - } - - componentStates.isBlured = false; - }); - each(allComponentViews, function (view) { - if (view && view.toggleBlurSeries) { - view.toggleBlurSeries(leaveBlurredSeries, false, model); - } - }); + var model = api.getModel(); + var leaveBlurredSeries = []; + var allComponentViews = []; + model.eachComponent(function (componentType, componentModel) { + var componentStates = getComponentStates(componentModel); + var isSeries = componentType === 'series'; + var view = isSeries ? api.getViewOfSeriesModel(componentModel) : api.getViewOfComponentModel(componentModel); + !isSeries && allComponentViews.push(view); + + if (componentStates.isBlured) { + // Leave blur anyway + view.group.traverse(function (child) { + singleLeaveBlur(child); + }); + isSeries && leaveBlurredSeries.push(componentModel); + } + + componentStates.isBlured = false; + }); + each(allComponentViews, function (view) { + if (view && view.toggleBlurSeries) { + view.toggleBlurSeries(leaveBlurredSeries, false, model); + } + }); } function blurSeries(targetSeriesIndex, focus, blurScope, api) { - var ecModel = api.getModel(); - blurScope = blurScope || 'coordinateSystem'; - - function leaveBlurOfIndices(data, dataIndices) { - for (var i = 0; i < dataIndices.length; i++) { - var itemEl = data.getItemGraphicEl(dataIndices[i]); - itemEl && leaveBlur(itemEl); - } - } + var ecModel = api.getModel(); + blurScope = blurScope || 'coordinateSystem'; - if (targetSeriesIndex == null) { - return; + function leaveBlurOfIndices(data, dataIndices) { + for (var i = 0; i < dataIndices.length; i++) { + var itemEl = data.getItemGraphicEl(dataIndices[i]); + itemEl && leaveBlur(itemEl); } + } - if (!focus || focus === 'none') { - return; - } + if (targetSeriesIndex == null) { + return; + } - var targetSeriesModel = ecModel.getSeriesByIndex(targetSeriesIndex); - var targetCoordSys = targetSeriesModel.coordinateSystem; + if (!focus || focus === 'none') { + return; + } - if (targetCoordSys && targetCoordSys.master) { - targetCoordSys = targetCoordSys.master; - } + var targetSeriesModel = ecModel.getSeriesByIndex(targetSeriesIndex); + var targetCoordSys = targetSeriesModel.coordinateSystem; - var blurredSeries = []; - ecModel.eachSeries(function (seriesModel) { - var sameSeries = targetSeriesModel === seriesModel; - var coordSys = seriesModel.coordinateSystem; + if (targetCoordSys && targetCoordSys.master) { + targetCoordSys = targetCoordSys.master; + } - if (coordSys && coordSys.master) { - coordSys = coordSys.master; - } + var blurredSeries = []; + ecModel.eachSeries(function (seriesModel) { + var sameSeries = targetSeriesModel === seriesModel; + var coordSys = seriesModel.coordinateSystem; - var sameCoordSys = coordSys && targetCoordSys ? coordSys === targetCoordSys : sameSeries; // If there is no coordinate system. use sameSeries instead. + if (coordSys && coordSys.master) { + coordSys = coordSys.master; + } - if (!( // Not blur other series if blurScope series - blurScope === 'series' && !sameSeries // Not blur other coordinate system if blurScope is coordinateSystem - || blurScope === 'coordinateSystem' && !sameCoordSys // Not blur self series if focus is series. - || focus === 'series' && sameSeries // TODO blurScope: coordinate system - )) { - var view = api.getViewOfSeriesModel(seriesModel); - view.group.traverse(function (child) { - singleEnterBlur(child); - }); + var sameCoordSys = coordSys && targetCoordSys ? coordSys === targetCoordSys : sameSeries; // If there is no coordinate system. use sameSeries instead. - if (isArrayLike(focus)) { - leaveBlurOfIndices(seriesModel.getData(), focus); - } else if (isObject(focus)) { - var dataTypes = keys(focus); + if (!( // Not blur other series if blurScope series + blurScope === 'series' && !sameSeries // Not blur other coordinate system if blurScope is coordinateSystem + || blurScope === 'coordinateSystem' && !sameCoordSys // Not blur self series if focus is series. + || focus === 'series' && sameSeries // TODO blurScope: coordinate system + )) { + var view = api.getViewOfSeriesModel(seriesModel); + view.group.traverse(function (child) { + singleEnterBlur(child); + }); - for (var d = 0; d < dataTypes.length; d++) { - leaveBlurOfIndices(seriesModel.getData(dataTypes[d]), focus[dataTypes[d]]); - } - } + if (isArrayLike(focus)) { + leaveBlurOfIndices(seriesModel.getData(), focus); + } else if (isObject(focus)) { + var dataTypes = keys(focus); - blurredSeries.push(seriesModel); - getComponentStates(seriesModel).isBlured = true; - } - }); - ecModel.eachComponent(function (componentType, componentModel) { - if (componentType === 'series') { - return; + for (var d = 0; d < dataTypes.length; d++) { + leaveBlurOfIndices(seriesModel.getData(dataTypes[d]), focus[dataTypes[d]]); } + } + + blurredSeries.push(seriesModel); + getComponentStates(seriesModel).isBlured = true; + } + }); + ecModel.eachComponent(function (componentType, componentModel) { + if (componentType === 'series') { + return; + } - var view = api.getViewOfComponentModel(componentModel); + var view = api.getViewOfComponentModel(componentModel); - if (view && view.toggleBlurSeries) { - view.toggleBlurSeries(blurredSeries, true, ecModel); - } - }); + if (view && view.toggleBlurSeries) { + view.toggleBlurSeries(blurredSeries, true, ecModel); + } + }); } function blurComponent(componentMainType, componentIndex, api) { - if (componentMainType == null || componentIndex == null) { - return; - } + if (componentMainType == null || componentIndex == null) { + return; + } - var componentModel = api.getModel().getComponent(componentMainType, componentIndex); + var componentModel = api.getModel().getComponent(componentMainType, componentIndex); - if (!componentModel) { - return; - } + if (!componentModel) { + return; + } - getComponentStates(componentModel).isBlured = true; - var view = api.getViewOfComponentModel(componentModel); + getComponentStates(componentModel).isBlured = true; + var view = api.getViewOfComponentModel(componentModel); - if (!view || !view.focusBlurEnabled) { - return; - } + if (!view || !view.focusBlurEnabled) { + return; + } - view.group.traverse(function (child) { - singleEnterBlur(child); - }); + view.group.traverse(function (child) { + singleEnterBlur(child); + }); } function blurSeriesFromHighlightPayload(seriesModel, payload, api) { - var seriesIndex = seriesModel.seriesIndex; - var data = seriesModel.getData(payload.dataType); - - if (!data) { - if ("development" !== 'production') { - error("Unknown dataType " + payload.dataType); - } + var seriesIndex = seriesModel.seriesIndex; + var data = seriesModel.getData(payload.dataType); - return; + if (!data) { + if ("development" !== 'production') { + error("Unknown dataType " + payload.dataType); } - var dataIndex = queryDataIndex(data, payload); // Pick the first one if there is multiple/none exists. + return; + } - dataIndex = (isArray(dataIndex) ? dataIndex[0] : dataIndex) || 0; - var el = data.getItemGraphicEl(dataIndex); + var dataIndex = queryDataIndex(data, payload); // Pick the first one if there is multiple/none exists. - if (!el) { - var count = data.count(); - var current = 0; // If data on dataIndex is NaN. + dataIndex = (isArray(dataIndex) ? dataIndex[0] : dataIndex) || 0; + var el = data.getItemGraphicEl(dataIndex); - while (!el && current < count) { - el = data.getItemGraphicEl(current++); - } + if (!el) { + var count = data.count(); + var current = 0; // If data on dataIndex is NaN. + + while (!el && current < count) { + el = data.getItemGraphicEl(current++); } + } - if (el) { - var ecData = getECData(el); - blurSeries(seriesIndex, ecData.focus, ecData.blurScope, api); - } else { - // If there is no element put on the data. Try getting it from raw option - // TODO Should put it on seriesModel? - var focus_1 = seriesModel.get(['emphasis', 'focus']); - var blurScope = seriesModel.get(['emphasis', 'blurScope']); + if (el) { + var ecData = getECData(el); + blurSeries(seriesIndex, ecData.focus, ecData.blurScope, api); + } else { + // If there is no element put on the data. Try getting it from raw option + // TODO Should put it on seriesModel? + var focus_1 = seriesModel.get(['emphasis', 'focus']); + var blurScope = seriesModel.get(['emphasis', 'blurScope']); - if (focus_1 != null) { - blurSeries(seriesIndex, focus_1, blurScope, api); - } + if (focus_1 != null) { + blurSeries(seriesIndex, focus_1, blurScope, api); } + } } function findComponentHighDownDispatchers(componentMainType, componentIndex, name, api) { - var ret = { - focusSelf: false, - dispatchers: null - }; + var ret = { + focusSelf: false, + dispatchers: null + }; - if (componentMainType == null || componentMainType === 'series' || componentIndex == null || name == null) { - return ret; - } + if (componentMainType == null || componentMainType === 'series' || componentIndex == null || name == null) { + return ret; + } - var componentModel = api.getModel().getComponent(componentMainType, componentIndex); + var componentModel = api.getModel().getComponent(componentMainType, componentIndex); - if (!componentModel) { - return ret; - } + if (!componentModel) { + return ret; + } - var view = api.getViewOfComponentModel(componentModel); + var view = api.getViewOfComponentModel(componentModel); - if (!view || !view.findHighDownDispatchers) { - return ret; - } + if (!view || !view.findHighDownDispatchers) { + return ret; + } - var dispatchers = view.findHighDownDispatchers(name); // At presnet, the component (like Geo) only blur inside itself. - // So we do not use `blurScope` in component. + var dispatchers = view.findHighDownDispatchers(name); // At presnet, the component (like Geo) only blur inside itself. + // So we do not use `blurScope` in component. - var focusSelf; + var focusSelf; - for (var i = 0; i < dispatchers.length; i++) { - if ("development" !== 'production' && !isHighDownDispatcher(dispatchers[i])) { - error('param should be highDownDispatcher'); - } + for (var i = 0; i < dispatchers.length; i++) { + if ("development" !== 'production' && !isHighDownDispatcher(dispatchers[i])) { + error('param should be highDownDispatcher'); + } - if (getECData(dispatchers[i]).focus === 'self') { - focusSelf = true; - break; - } + if (getECData(dispatchers[i]).focus === 'self') { + focusSelf = true; + break; } + } - return { - focusSelf: focusSelf, - dispatchers: dispatchers - }; + return { + focusSelf: focusSelf, + dispatchers: dispatchers + }; } function handleGlobalMouseOverForHighDown(dispatcher, e, api) { - if ("development" !== 'production' && !isHighDownDispatcher(dispatcher)) { - error('param should be highDownDispatcher'); - } + if ("development" !== 'production' && !isHighDownDispatcher(dispatcher)) { + error('param should be highDownDispatcher'); + } - var ecData = getECData(dispatcher); + var ecData = getECData(dispatcher); - var _a = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api), - dispatchers = _a.dispatchers, - focusSelf = _a.focusSelf; // If `findHighDownDispatchers` is supported on the component, - // highlight/downplay elements with the same name. + var _a = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api), + dispatchers = _a.dispatchers, + focusSelf = _a.focusSelf; // If `findHighDownDispatchers` is supported on the component, + // highlight/downplay elements with the same name. - if (dispatchers) { - if (focusSelf) { - blurComponent(ecData.componentMainType, ecData.componentIndex, api); - } + if (dispatchers) { + if (focusSelf) { + blurComponent(ecData.componentMainType, ecData.componentIndex, api); + } - each(dispatchers, function (dispatcher) { - return enterEmphasisWhenMouseOver(dispatcher, e); - }); - } else { - // Try blur all in the related series. Then emphasis the hoverred. - // TODO. progressive mode. - blurSeries(ecData.seriesIndex, ecData.focus, ecData.blurScope, api); + each(dispatchers, function (dispatcher) { + return enterEmphasisWhenMouseOver(dispatcher, e); + }); + } else { + // Try blur all in the related series. Then emphasis the hoverred. + // TODO. progressive mode. + blurSeries(ecData.seriesIndex, ecData.focus, ecData.blurScope, api); - if (ecData.focus === 'self') { - blurComponent(ecData.componentMainType, ecData.componentIndex, api); - } // Other than series, component that not support `findHighDownDispatcher` will - // also use it. But in this case, highlight/downplay are only supported in - // mouse hover but not in dispatchAction. + if (ecData.focus === 'self') { + blurComponent(ecData.componentMainType, ecData.componentIndex, api); + } // Other than series, component that not support `findHighDownDispatcher` will + // also use it. But in this case, highlight/downplay are only supported in + // mouse hover but not in dispatchAction. - enterEmphasisWhenMouseOver(dispatcher, e); - } + enterEmphasisWhenMouseOver(dispatcher, e); + } } function handleGlobalMouseOutForHighDown(dispatcher, e, api) { - if ("development" !== 'production' && !isHighDownDispatcher(dispatcher)) { - error('param should be highDownDispatcher'); - } + if ("development" !== 'production' && !isHighDownDispatcher(dispatcher)) { + error('param should be highDownDispatcher'); + } - allLeaveBlur(api); - var ecData = getECData(dispatcher); - var dispatchers = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api).dispatchers; + allLeaveBlur(api); + var ecData = getECData(dispatcher); + var dispatchers = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api).dispatchers; - if (dispatchers) { - each(dispatchers, function (dispatcher) { - return leaveEmphasisWhenMouseOut(dispatcher, e); - }); - } else { - leaveEmphasisWhenMouseOut(dispatcher, e); - } + if (dispatchers) { + each(dispatchers, function (dispatcher) { + return leaveEmphasisWhenMouseOut(dispatcher, e); + }); + } else { + leaveEmphasisWhenMouseOut(dispatcher, e); + } } function toggleSelectionFromPayload(seriesModel, payload, api) { - if (!isSelectChangePayload(payload)) { - return; - } + if (!isSelectChangePayload(payload)) { + return; + } - var dataType = payload.dataType; - var data = seriesModel.getData(dataType); - var dataIndex = queryDataIndex(data, payload); + var dataType = payload.dataType; + var data = seriesModel.getData(dataType); + var dataIndex = queryDataIndex(data, payload); - if (!isArray(dataIndex)) { - dataIndex = [dataIndex]; - } + if (!isArray(dataIndex)) { + dataIndex = [dataIndex]; + } - seriesModel[payload.type === TOGGLE_SELECT_ACTION_TYPE ? 'toggleSelect' : payload.type === SELECT_ACTION_TYPE ? 'select' : 'unselect'](dataIndex, dataType); + seriesModel[payload.type === TOGGLE_SELECT_ACTION_TYPE ? 'toggleSelect' : payload.type === SELECT_ACTION_TYPE ? 'select' : 'unselect'](dataIndex, dataType); } function updateSeriesElementSelection(seriesModel) { - var allData = seriesModel.getAllData(); - each(allData, function (_a) { - var data = _a.data, - type = _a.type; - data.eachItemGraphicEl(function (el, idx) { - seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el); - }); + var allData = seriesModel.getAllData(); + each(allData, function (_a) { + var data = _a.data, + type = _a.type; + data.eachItemGraphicEl(function (el, idx) { + seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el); }); + }); } function getAllSelectedIndices(ecModel) { - var ret = []; - ecModel.eachSeries(function (seriesModel) { - var allData = seriesModel.getAllData(); - each(allData, function (_a) { - var data = _a.data, - type = _a.type; - var dataIndices = seriesModel.getSelectedDataIndices(); - - if (dataIndices.length > 0) { - var item = { - dataIndex: dataIndices, - seriesIndex: seriesModel.seriesIndex - }; + var ret = []; + ecModel.eachSeries(function (seriesModel) { + var allData = seriesModel.getAllData(); + each(allData, function (_a) { + var data = _a.data, + type = _a.type; + var dataIndices = seriesModel.getSelectedDataIndices(); - if (type != null) { - item.dataType = type; - } + if (dataIndices.length > 0) { + var item = { + dataIndex: dataIndices, + seriesIndex: seriesModel.seriesIndex + }; - ret.push(item); - } - }); + if (type != null) { + item.dataType = type; + } + + ret.push(item); + } }); - return ret; + }); + return ret; } /** * Enable the function that mouseover will trigger the emphasis state. @@ -12851,54 +12851,54 @@ */ function enableHoverEmphasis(el, focus, blurScope) { - setAsHighDownDispatcher(el, true); - traverseUpdateState(el, setDefaultStateProxy); - enableHoverFocus(el, focus, blurScope); + setAsHighDownDispatcher(el, true); + traverseUpdateState(el, setDefaultStateProxy); + enableHoverFocus(el, focus, blurScope); } function disableHoverEmphasis(el) { - setAsHighDownDispatcher(el, false); + setAsHighDownDispatcher(el, false); } function toggleHoverEmphasis(el, focus, blurScope, isDisabled) { - isDisabled ? disableHoverEmphasis(el) : enableHoverEmphasis(el, focus, blurScope); + isDisabled ? disableHoverEmphasis(el) : enableHoverEmphasis(el, focus, blurScope); } function enableHoverFocus(el, focus, blurScope) { - var ecData = getECData(el); + var ecData = getECData(el); - if (focus != null) { - // TODO dataIndex may be set after this function. This check is not useful. - // if (ecData.dataIndex == null) { - // if (__DEV__) { - // console.warn('focus can only been set on element with dataIndex'); - // } - // } - // else { - ecData.focus = focus; - ecData.blurScope = blurScope; // } - } else if (ecData.focus) { - ecData.focus = null; - } + if (focus != null) { + // TODO dataIndex may be set after this function. This check is not useful. + // if (ecData.dataIndex == null) { + // if (__DEV__) { + // console.warn('focus can only been set on element with dataIndex'); + // } + // } + // else { + ecData.focus = focus; + ecData.blurScope = blurScope; // } + } else if (ecData.focus) { + ecData.focus = null; + } } var OTHER_STATES = ['emphasis', 'blur', 'select']; var defaultStyleGetterMap = { - itemStyle: 'getItemStyle', - lineStyle: 'getLineStyle', - areaStyle: 'getAreaStyle' + itemStyle: 'getItemStyle', + lineStyle: 'getLineStyle', + areaStyle: 'getAreaStyle' }; /** * Set emphasis/blur/selected states of element. */ function setStatesStylesFromModel(el, itemModel, styleType, // default itemStyle - getter) { - styleType = styleType || 'itemStyle'; + getter) { + styleType = styleType || 'itemStyle'; - for (var i = 0; i < OTHER_STATES.length; i++) { - var stateName = OTHER_STATES[i]; - var model = itemModel.getModel([stateName, styleType]); - var state = el.ensureState(stateName); // Let it throw error if getterType is not found. + for (var i = 0; i < OTHER_STATES.length; i++) { + var stateName = OTHER_STATES[i]; + var model = itemModel.getModel([stateName, styleType]); + var state = el.ensureState(stateName); // Let it throw error if getterType is not found. - state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType]](); - } + state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType]](); + } } /** * @@ -12921,26 +12921,26 @@ */ function setAsHighDownDispatcher(el, asDispatcher) { - var disable = asDispatcher === false; - var extendedEl = el; // Make `highDownSilentOnTouch` and `onStateChange` only work after - // `setAsHighDownDispatcher` called. Avoid it is modified by user unexpectedly. + var disable = asDispatcher === false; + var extendedEl = el; // Make `highDownSilentOnTouch` and `onStateChange` only work after + // `setAsHighDownDispatcher` called. Avoid it is modified by user unexpectedly. - if (el.highDownSilentOnTouch) { - extendedEl.__highDownSilentOnTouch = el.highDownSilentOnTouch; - } // Simple optimize, since this method might be - // called for each elements of a group in some cases. + if (el.highDownSilentOnTouch) { + extendedEl.__highDownSilentOnTouch = el.highDownSilentOnTouch; + } // Simple optimize, since this method might be + // called for each elements of a group in some cases. - if (!disable || extendedEl.__highDownDispatcher) { - // Emphasis, normal can be triggered manually by API or other components like hover link. - // el[method]('emphasis', onElementEmphasisEvent)[method]('normal', onElementNormalEvent); - // Also keep previous record. - extendedEl.__highByOuter = extendedEl.__highByOuter || 0; - extendedEl.__highDownDispatcher = !disable; - } + if (!disable || extendedEl.__highDownDispatcher) { + // Emphasis, normal can be triggered manually by API or other components like hover link. + // el[method]('emphasis', onElementEmphasisEvent)[method]('normal', onElementNormalEvent); + // Also keep previous record. + extendedEl.__highByOuter = extendedEl.__highByOuter || 0; + extendedEl.__highDownDispatcher = !disable; + } } function isHighDownDispatcher(el) { - return !!(el && el.__highDownDispatcher); + return !!(el && el.__highDownDispatcher); } /** * Enable component highlight/downplay features: @@ -12949,10 +12949,10 @@ */ function enableComponentHighDownFeatures(el, componentModel, componentHighDownName) { - var ecData = getECData(el); - ecData.componentMainType = componentModel.mainType; - ecData.componentIndex = componentModel.componentIndex; - ecData.componentHighDownName = componentHighDownName; + var ecData = getECData(el); + ecData.componentMainType = componentModel.mainType; + ecData.componentIndex = componentModel.componentIndex; + ecData.componentHighDownName = componentHighDownName; } /** * Support hightlight/downplay record on each elements. @@ -12964,29 +12964,29 @@ */ function getHighlightDigit(highlightKey) { - var highlightDigit = _highlightKeyMap[highlightKey]; + var highlightDigit = _highlightKeyMap[highlightKey]; - if (highlightDigit == null && _highlightNextDigit <= 32) { - highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++; - } + if (highlightDigit == null && _highlightNextDigit <= 32) { + highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++; + } - return highlightDigit; + return highlightDigit; } function isSelectChangePayload(payload) { - var payloadType = payload.type; - return payloadType === SELECT_ACTION_TYPE || payloadType === UNSELECT_ACTION_TYPE || payloadType === TOGGLE_SELECT_ACTION_TYPE; + var payloadType = payload.type; + return payloadType === SELECT_ACTION_TYPE || payloadType === UNSELECT_ACTION_TYPE || payloadType === TOGGLE_SELECT_ACTION_TYPE; } function isHighDownPayload(payload) { - var payloadType = payload.type; - return payloadType === HIGHLIGHT_ACTION_TYPE || payloadType === DOWNPLAY_ACTION_TYPE; + var payloadType = payload.type; + return payloadType === HIGHLIGHT_ACTION_TYPE || payloadType === DOWNPLAY_ACTION_TYPE; } function savePathStates(el) { - var store = getSavedStates(el); - store.normalFill = el.style.fill; - store.normalStroke = el.style.stroke; - var selectState = el.states.select || {}; - store.selectFill = selectState.style && selectState.style.fill || null; - store.selectStroke = selectState.style && selectState.style.stroke || null; + var store = getSavedStates(el); + store.normalFill = el.style.fill; + store.normalStroke = el.style.stroke; + var selectState = el.states.select || {}; + store.selectFill = selectState.style && selectState.style.fill || null; + store.selectStroke = selectState.style && selectState.style.stroke || null; } var CMD$2 = PathProxy.CMD; @@ -14446,111 +14446,111 @@ */ function getAnimationConfig(animationType, animatableModel, dataIndex, // Extra opts can override the option in animatable model. - extraOpts, // TODO It's only for pictorial bar now. - extraDelayParams) { - var animationPayload; // Check if there is global animation configuration from dataZoom/resize can override the config in option. - // If animation is enabled. Will use this animation config in payload. - // If animation is disabled. Just ignore it. - - if (animatableModel && animatableModel.ecModel) { - var updatePayload = animatableModel.ecModel.getUpdatePayload(); - animationPayload = updatePayload && updatePayload.animation; - } - - var animationEnabled = animatableModel && animatableModel.isAnimationEnabled(); - var isUpdate = animationType === 'update'; - - if (animationEnabled) { - var duration = void 0; - var easing = void 0; - var delay = void 0; - - if (extraOpts) { - duration = retrieve2(extraOpts.duration, 200); - easing = retrieve2(extraOpts.easing, 'cubicOut'); - delay = 0; - } else { - duration = animatableModel.getShallow(isUpdate ? 'animationDurationUpdate' : 'animationDuration'); - easing = animatableModel.getShallow(isUpdate ? 'animationEasingUpdate' : 'animationEasing'); - delay = animatableModel.getShallow(isUpdate ? 'animationDelayUpdate' : 'animationDelay'); - } // animation from payload has highest priority. - + extraOpts, // TODO It's only for pictorial bar now. + extraDelayParams) { + var animationPayload; // Check if there is global animation configuration from dataZoom/resize can override the config in option. + // If animation is enabled. Will use this animation config in payload. + // If animation is disabled. Just ignore it. + + if (animatableModel && animatableModel.ecModel) { + var updatePayload = animatableModel.ecModel.getUpdatePayload(); + animationPayload = updatePayload && updatePayload.animation; + } + + var animationEnabled = animatableModel && animatableModel.isAnimationEnabled(); + var isUpdate = animationType === 'update'; + + if (animationEnabled) { + var duration = void 0; + var easing = void 0; + var delay = void 0; + + if (extraOpts) { + duration = retrieve2(extraOpts.duration, 200); + easing = retrieve2(extraOpts.easing, 'cubicOut'); + delay = 0; + } else { + duration = animatableModel.getShallow(isUpdate ? 'animationDurationUpdate' : 'animationDuration'); + easing = animatableModel.getShallow(isUpdate ? 'animationEasingUpdate' : 'animationEasing'); + delay = animatableModel.getShallow(isUpdate ? 'animationDelayUpdate' : 'animationDelay'); + } // animation from payload has highest priority. - if (animationPayload) { - animationPayload.duration != null && (duration = animationPayload.duration); - animationPayload.easing != null && (easing = animationPayload.easing); - animationPayload.delay != null && (delay = animationPayload.delay); - } - if (isFunction(delay)) { - delay = delay(dataIndex, extraDelayParams); - } + if (animationPayload) { + animationPayload.duration != null && (duration = animationPayload.duration); + animationPayload.easing != null && (easing = animationPayload.easing); + animationPayload.delay != null && (delay = animationPayload.delay); + } - if (isFunction(duration)) { - duration = duration(dataIndex); - } + if (isFunction(delay)) { + delay = delay(dataIndex, extraDelayParams); + } - var config = { - duration: duration || 0, - delay: delay, - easing: easing - }; - return config; - } else { - return null; + if (isFunction(duration)) { + duration = duration(dataIndex); } + + var config = { + duration: duration || 0, + delay: delay, + easing: easing + }; + return config; + } else { + return null; + } } function animateOrSetProps(animationType, el, props, animatableModel, dataIndex, cb, during) { - var isFrom = false; - var removeOpt; - - if (isFunction(dataIndex)) { - during = cb; - cb = dataIndex; - dataIndex = null; - } else if (isObject(dataIndex)) { - cb = dataIndex.cb; - during = dataIndex.during; - isFrom = dataIndex.isFrom; - removeOpt = dataIndex.removeOpt; - dataIndex = dataIndex.dataIndex; - } - - var isRemove = animationType === 'leave'; - - if (!isRemove) { - // Must stop the remove animation. - el.stopAnimation('leave'); - } - - var animationConfig = getAnimationConfig(animationType, animatableModel, dataIndex, isRemove ? removeOpt || {} : null, animatableModel && animatableModel.getAnimationDelayParams ? animatableModel.getAnimationDelayParams(el, dataIndex) : null); - - if (animationConfig && animationConfig.duration > 0) { - var duration = animationConfig.duration; - var animationDelay = animationConfig.delay; - var animationEasing = animationConfig.easing; - var animateConfig = { - duration: duration, - delay: animationDelay || 0, - easing: animationEasing, - done: cb, - force: !!cb || !!during, - // Set to final state in update/init animation. - // So the post processing based on the path shape can be done correctly. - setToFinal: !isRemove, - scope: animationType, - during: during - }; - isFrom ? el.animateFrom(props, animateConfig) : el.animateTo(props, animateConfig); - } else { - el.stopAnimation(); // If `isFrom`, the props is the "from" props. - - !isFrom && el.attr(props); // Call during at least once. - - during && during(1); - cb && cb(); - } + var isFrom = false; + var removeOpt; + + if (isFunction(dataIndex)) { + during = cb; + cb = dataIndex; + dataIndex = null; + } else if (isObject(dataIndex)) { + cb = dataIndex.cb; + during = dataIndex.during; + isFrom = dataIndex.isFrom; + removeOpt = dataIndex.removeOpt; + dataIndex = dataIndex.dataIndex; + } + + var isRemove = animationType === 'leave'; + + if (!isRemove) { + // Must stop the remove animation. + el.stopAnimation('leave'); + } + + var animationConfig = getAnimationConfig(animationType, animatableModel, dataIndex, isRemove ? removeOpt || {} : null, animatableModel && animatableModel.getAnimationDelayParams ? animatableModel.getAnimationDelayParams(el, dataIndex) : null); + + if (animationConfig && animationConfig.duration > 0) { + var duration = animationConfig.duration; + var animationDelay = animationConfig.delay; + var animationEasing = animationConfig.easing; + var animateConfig = { + duration: duration, + delay: animationDelay || 0, + easing: animationEasing, + done: cb, + force: !!cb || !!during, + // Set to final state in update/init animation. + // So the post processing based on the path shape can be done correctly. + setToFinal: !isRemove, + scope: animationType, + during: during + }; + isFrom ? el.animateFrom(props, animateConfig) : el.animateTo(props, animateConfig); + } else { + el.stopAnimation(); // If `isFrom`, the props is the "from" props. + + !isFrom && el.attr(props); // Call during at least once. + + during && during(1); + cb && cb(); + } } /** * Update graphic element properties with or without animation according to the @@ -14571,8 +14571,8 @@ function updateProps(el, props, // TODO: TYPE AnimatableModel - animatableModel, dataIndex, cb, during) { - animateOrSetProps('update', el, props, animatableModel, dataIndex, cb, during); + animatableModel, dataIndex, cb, during) { + animateOrSetProps('update', el, props, animatableModel, dataIndex, cb, during); } /** * Init graphic element properties with or without animation according to the @@ -14584,7 +14584,7 @@ */ function initProps(el, props, animatableModel, dataIndex, cb, during) { - animateOrSetProps('enter', el, props, animatableModel, dataIndex, cb, during); + animateOrSetProps('enter', el, props, animatableModel, dataIndex, cb, during); } /** * If element is removed. @@ -14592,60 +14592,60 @@ */ function isElementRemoved(el) { - if (!el.__zr) { - return true; - } + if (!el.__zr) { + return true; + } - for (var i = 0; i < el.animators.length; i++) { - var animator = el.animators[i]; + for (var i = 0; i < el.animators.length; i++) { + var animator = el.animators[i]; - if (animator.scope === 'leave') { - return true; - } + if (animator.scope === 'leave') { + return true; } + } - return false; + return false; } /** * Remove graphic element */ function removeElement(el, props, animatableModel, dataIndex, cb, during) { - // Don't do remove animation twice. - if (isElementRemoved(el)) { - return; - } + // Don't do remove animation twice. + if (isElementRemoved(el)) { + return; + } - animateOrSetProps('leave', el, props, animatableModel, dataIndex, cb, during); + animateOrSetProps('leave', el, props, animatableModel, dataIndex, cb, during); } function fadeOutDisplayable(el, animatableModel, dataIndex, done) { - el.removeTextContent(); - el.removeTextGuideLine(); - removeElement(el, { - style: { - opacity: 0 - } - }, animatableModel, dataIndex, done); + el.removeTextContent(); + el.removeTextGuideLine(); + removeElement(el, { + style: { + opacity: 0 + } + }, animatableModel, dataIndex, done); } function removeElementWithFadeOut(el, animatableModel, dataIndex) { - function doRemove() { - el.parent && el.parent.remove(el); - } // Hide label and labelLine first - // TODO Also use fade out animation? - - - if (!el.isGroup) { - fadeOutDisplayable(el, animatableModel, dataIndex, doRemove); - } else { - el.traverse(function (disp) { - if (!disp.isGroup) { - // Can invoke doRemove multiple times. - fadeOutDisplayable(disp, animatableModel, dataIndex, doRemove); - } - }); - } + function doRemove() { + el.parent && el.parent.remove(el); + } // Hide label and labelLine first + // TODO Also use fade out animation? + + + if (!el.isGroup) { + fadeOutDisplayable(el, animatableModel, dataIndex, doRemove); + } else { + el.traverse(function (disp) { + if (!disp.isGroup) { + // Can invoke doRemove multiple times. + fadeOutDisplayable(disp, animatableModel, dataIndex, doRemove); + } + }); + } } /** * Save old style for style transition in universalTransition module. @@ -14655,10 +14655,10 @@ */ function saveOldStyle(el) { - transitionStore(el).oldStyle = el.style; + transitionStore(el).oldStyle = el.style; } function getOldStyle(el) { - return transitionStore(el).oldStyle; + return transitionStore(el).oldStyle; } var mathMax$4 = Math.max; @@ -14669,7 +14669,7 @@ */ function extendShape(opts) { - return Path.extend(opts); + return Path.extend(opts); } var extendPathFromString = extendFromString; /** @@ -14677,7 +14677,7 @@ */ function extendPath(pathData, opts) { - return extendPathFromString(pathData, opts); + return extendPathFromString(pathData, opts); } /** * Register a user defined shape. @@ -14692,7 +14692,7 @@ */ function registerShape(name, ShapeClass) { - _customShapeMap[name] = ShapeClass; + _customShapeMap[name] = ShapeClass; } /** * Find shape class registered by `registerShape`. Usually used in @@ -14723,9 +14723,9 @@ */ function getShapeClass(name) { - if (_customShapeMap.hasOwnProperty(name)) { - return _customShapeMap[name]; - } + if (_customShapeMap.hasOwnProperty(name)) { + return _customShapeMap[name]; + } } /** * Create a path element from path data string @@ -14736,17 +14736,17 @@ */ function makePath(pathData, opts, rect, layout) { - var path = createFromString(pathData, opts); - - if (rect) { - if (layout === 'center') { - rect = centerGraphic(rect, path.getBoundingRect()); - } + var path = createFromString(pathData, opts); - resizePath(path, rect); + if (rect) { + if (layout === 'center') { + rect = centerGraphic(rect, path.getBoundingRect()); } - return path; + resizePath(path, rect); + } + + return path; } /** * Create a image element from image url @@ -14757,25 +14757,25 @@ */ function makeImage(imageUrl, rect, layout) { - var zrImg = new ZRImage({ - style: { - image: imageUrl, - x: rect.x, - y: rect.y, - width: rect.width, - height: rect.height - }, - onload: function (img) { - if (layout === 'center') { - var boundingRect = { - width: img.width, - height: img.height - }; - zrImg.setStyle(centerGraphic(rect, boundingRect)); - } - } - }); - return zrImg; + var zrImg = new ZRImage({ + style: { + image: imageUrl, + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height + }, + onload: function (img) { + if (layout === 'center') { + var boundingRect = { + width: img.width, + height: img.height + }; + zrImg.setStyle(centerGraphic(rect, boundingRect)); + } + } + }); + return zrImg; } /** * Get position of centered element in bounding box. @@ -14786,26 +14786,26 @@ */ function centerGraphic(rect, boundingRect) { - // Set rect to center, keep width / height ratio. - var aspect = boundingRect.width / boundingRect.height; - var width = rect.height * aspect; - var height; - - if (width <= rect.width) { - height = rect.height; - } else { - width = rect.width; - height = width / aspect; - } - - var cx = rect.x + rect.width / 2; - var cy = rect.y + rect.height / 2; - return { - x: cx - width / 2, - y: cy - height / 2, - width: width, - height: height - }; + // Set rect to center, keep width / height ratio. + var aspect = boundingRect.width / boundingRect.height; + var width = rect.height * aspect; + var height; + + if (width <= rect.width) { + height = rect.height; + } else { + width = rect.width; + height = width / aspect; + } + + var cx = rect.x + rect.width / 2; + var cy = rect.y + rect.height / 2; + return { + x: cx - width / 2, + y: cy - height / 2, + width: width, + height: height + }; } var mergePath$1 = mergePath; @@ -14816,29 +14816,29 @@ */ function resizePath(path, rect) { - if (!path.applyTransform) { - return; - } + if (!path.applyTransform) { + return; + } - var pathRect = path.getBoundingRect(); - var m = pathRect.calculateTransform(rect); - path.applyTransform(m); + var pathRect = path.getBoundingRect(); + var m = pathRect.calculateTransform(rect); + path.applyTransform(m); } /** * Sub pixel optimize line for canvas */ function subPixelOptimizeLine$1(param) { - subPixelOptimizeLine(param.shape, param.shape, param.style); - return param; + subPixelOptimizeLine(param.shape, param.shape, param.style); + return param; } /** * Sub pixel optimize rect for canvas */ function subPixelOptimizeRect$1(param) { - subPixelOptimizeRect(param.shape, param.shape, param.style); - return param; + subPixelOptimizeRect(param.shape, param.shape, param.style); + return param; } /** * Sub pixel optimize for canvas @@ -14859,14 +14859,14 @@ */ function getTransform(target, ancestor) { - var mat = identity([]); + var mat = identity([]); - while (target && target !== ancestor) { - mul$1(mat, target.getLocalTransform(), mat); - target = target.parent; - } + while (target && target !== ancestor) { + mul$1(mat, target.getLocalTransform(), mat); + target = target.parent; + } - return mat; + return mat; } /** * Apply transform to an vertex. @@ -14879,15 +14879,15 @@ */ function applyTransform$1(target, transform, invert$1) { - if (transform && !isArrayLike(transform)) { - transform = Transformable.getLocalTransform(transform); - } + if (transform && !isArrayLike(transform)) { + transform = Transformable.getLocalTransform(transform); + } - if (invert$1) { - transform = invert([], transform); - } + if (invert$1) { + transform = invert([], transform); + } - return applyTransform([], target, transform); + return applyTransform([], target, transform); } /** * @param direction 'left' 'right' 'top' 'bottom' @@ -14897,20 +14897,20 @@ */ function transformDirection(direction, transform, invert) { - // Pick a base, ensure that transform result will not be (0, 0). - var hBase = transform[4] === 0 || transform[5] === 0 || transform[0] === 0 ? 1 : Math.abs(2 * transform[4] / transform[0]); - var vBase = transform[4] === 0 || transform[5] === 0 || transform[2] === 0 ? 1 : Math.abs(2 * transform[4] / transform[2]); - var vertex = [direction === 'left' ? -hBase : direction === 'right' ? hBase : 0, direction === 'top' ? -vBase : direction === 'bottom' ? vBase : 0]; - vertex = applyTransform$1(vertex, transform, invert); - return Math.abs(vertex[0]) > Math.abs(vertex[1]) ? vertex[0] > 0 ? 'right' : 'left' : vertex[1] > 0 ? 'bottom' : 'top'; + // Pick a base, ensure that transform result will not be (0, 0). + var hBase = transform[4] === 0 || transform[5] === 0 || transform[0] === 0 ? 1 : Math.abs(2 * transform[4] / transform[0]); + var vBase = transform[4] === 0 || transform[5] === 0 || transform[2] === 0 ? 1 : Math.abs(2 * transform[4] / transform[2]); + var vertex = [direction === 'left' ? -hBase : direction === 'right' ? hBase : 0, direction === 'top' ? -vBase : direction === 'bottom' ? vBase : 0]; + vertex = applyTransform$1(vertex, transform, invert); + return Math.abs(vertex[0]) > Math.abs(vertex[1]) ? vertex[0] > 0 ? 'right' : 'left' : vertex[1] > 0 ? 'bottom' : 'top'; } function isNotGroup(el) { - return !el.isGroup; + return !el.isGroup; } function isPath(el) { - return el.shape != null; + return el.shape != null; } /** * Apply group transition animation from g1 to g2. @@ -14919,98 +14919,98 @@ function groupTransition(g1, g2, animatableModel) { - if (!g1 || !g2) { - return; - } + if (!g1 || !g2) { + return; + } + + function getElMap(g) { + var elMap = {}; + g.traverse(function (el) { + if (isNotGroup(el) && el.anid) { + elMap[el.anid] = el; + } + }); + return elMap; + } - function getElMap(g) { - var elMap = {}; - g.traverse(function (el) { - if (isNotGroup(el) && el.anid) { - elMap[el.anid] = el; - } - }); - return elMap; + function getAnimatableProps(el) { + var obj = { + x: el.x, + y: el.y, + rotation: el.rotation + }; + + if (isPath(el)) { + obj.shape = extend({}, el.shape); } - function getAnimatableProps(el) { - var obj = { - x: el.x, - y: el.y, - rotation: el.rotation - }; + return obj; + } - if (isPath(el)) { - obj.shape = extend({}, el.shape); - } + var elMap1 = getElMap(g1); + g2.traverse(function (el) { + if (isNotGroup(el) && el.anid) { + var oldEl = elMap1[el.anid]; - return obj; + if (oldEl) { + var newProp = getAnimatableProps(el); + el.attr(getAnimatableProps(oldEl)); + updateProps(el, newProp, animatableModel, getECData(el).dataIndex); + } } - - var elMap1 = getElMap(g1); - g2.traverse(function (el) { - if (isNotGroup(el) && el.anid) { - var oldEl = elMap1[el.anid]; - - if (oldEl) { - var newProp = getAnimatableProps(el); - el.attr(getAnimatableProps(oldEl)); - updateProps(el, newProp, animatableModel, getECData(el).dataIndex); - } - } - }); + }); } function clipPointsByRect(points, rect) { - // FIXME: this way migth be incorrect when grpahic clipped by a corner. - // and when element have border. - return map(points, function (point) { - var x = point[0]; - x = mathMax$4(x, rect.x); - x = mathMin$4(x, rect.x + rect.width); - var y = point[1]; - y = mathMax$4(y, rect.y); - y = mathMin$4(y, rect.y + rect.height); - return [x, y]; - }); + // FIXME: this way migth be incorrect when grpahic clipped by a corner. + // and when element have border. + return map(points, function (point) { + var x = point[0]; + x = mathMax$4(x, rect.x); + x = mathMin$4(x, rect.x + rect.width); + var y = point[1]; + y = mathMax$4(y, rect.y); + y = mathMin$4(y, rect.y + rect.height); + return [x, y]; + }); } /** * Return a new clipped rect. If rect size are negative, return undefined. */ function clipRectByRect(targetRect, rect) { - var x = mathMax$4(targetRect.x, rect.x); - var x2 = mathMin$4(targetRect.x + targetRect.width, rect.x + rect.width); - var y = mathMax$4(targetRect.y, rect.y); - var y2 = mathMin$4(targetRect.y + targetRect.height, rect.y + rect.height); // If the total rect is cliped, nothing, including the border, - // should be painted. So return undefined. + var x = mathMax$4(targetRect.x, rect.x); + var x2 = mathMin$4(targetRect.x + targetRect.width, rect.x + rect.width); + var y = mathMax$4(targetRect.y, rect.y); + var y2 = mathMin$4(targetRect.y + targetRect.height, rect.y + rect.height); // If the total rect is cliped, nothing, including the border, + // should be painted. So return undefined. - if (x2 >= x && y2 >= y) { - return { - x: x, - y: y, - width: x2 - x, - height: y2 - y - }; - } + if (x2 >= x && y2 >= y) { + return { + x: x, + y: y, + width: x2 - x, + height: y2 - y + }; + } } function createIcon(iconStr, // Support 'image://' or 'path://' or direct svg path. - opt, rect) { - var innerOpts = extend({ - rectHover: true - }, opt); - var style = innerOpts.style = { - strokeNoScale: true - }; - rect = rect || { - x: -1, - y: -1, - width: 2, - height: 2 - }; - - if (iconStr) { - return iconStr.indexOf('image://') === 0 ? (style.image = iconStr.slice(8), defaults(style, rect), new ZRImage(innerOpts)) : makePath(iconStr.replace('path://', ''), innerOpts, rect, 'center'); - } + opt, rect) { + var innerOpts = extend({ + rectHover: true + }, opt); + var style = innerOpts.style = { + strokeNoScale: true + }; + rect = rect || { + x: -1, + y: -1, + width: 2, + height: 2 + }; + + if (iconStr) { + return iconStr.indexOf('image://') === 0 ? (style.image = iconStr.slice(8), defaults(style, rect), new ZRImage(innerOpts)) : makePath(iconStr.replace('path://', ''), innerOpts, rect, 'center'); + } } /** * Return `true` if the given line (line `a`) and the given polygon @@ -15020,15 +15020,15 @@ */ function linePolygonIntersect(a1x, a1y, a2x, a2y, points) { - for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) { - var p = points[i]; + for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) { + var p = points[i]; - if (lineLineIntersect(a1x, a1y, a2x, a2y, p[0], p[1], p2[0], p2[1])) { - return true; - } - - p2 = p; + if (lineLineIntersect(a1x, a1y, a2x, a2y, p[0], p[1], p2[0], p2[1])) { + return true; } + + p2 = p; + } } /** * Return `true` if the given two lines (line `a` and line `b`) @@ -15038,112 +15038,112 @@ */ function lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) { - // let `vec_m` to be `vec_a2 - vec_a1` and `vec_n` to be `vec_b2 - vec_b1`. - var mx = a2x - a1x; - var my = a2y - a1y; - var nx = b2x - b1x; - var ny = b2y - b1y; // `vec_m` and `vec_n` are parallel iff - // exising `k` such that `vec_m = k · vec_n`, equivalent to `vec_m X vec_n = 0`. + // let `vec_m` to be `vec_a2 - vec_a1` and `vec_n` to be `vec_b2 - vec_b1`. + var mx = a2x - a1x; + var my = a2y - a1y; + var nx = b2x - b1x; + var ny = b2y - b1y; // `vec_m` and `vec_n` are parallel iff + // exising `k` such that `vec_m = k · vec_n`, equivalent to `vec_m X vec_n = 0`. - var nmCrossProduct = crossProduct2d(nx, ny, mx, my); + var nmCrossProduct = crossProduct2d(nx, ny, mx, my); - if (nearZero(nmCrossProduct)) { - return false; - } // `vec_m` and `vec_n` are intersect iff - // existing `p` and `q` in [0, 1] such that `vec_a1 + p * vec_m = vec_b1 + q * vec_n`, - // such that `q = ((vec_a1 - vec_b1) X vec_m) / (vec_n X vec_m)` - // and `p = ((vec_a1 - vec_b1) X vec_n) / (vec_n X vec_m)`. + if (nearZero(nmCrossProduct)) { + return false; + } // `vec_m` and `vec_n` are intersect iff + // existing `p` and `q` in [0, 1] such that `vec_a1 + p * vec_m = vec_b1 + q * vec_n`, + // such that `q = ((vec_a1 - vec_b1) X vec_m) / (vec_n X vec_m)` + // and `p = ((vec_a1 - vec_b1) X vec_n) / (vec_n X vec_m)`. - var b1a1x = a1x - b1x; - var b1a1y = a1y - b1y; - var q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct; + var b1a1x = a1x - b1x; + var b1a1y = a1y - b1y; + var q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct; - if (q < 0 || q > 1) { - return false; - } + if (q < 0 || q > 1) { + return false; + } - var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct; + var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct; - if (p < 0 || p > 1) { - return false; - } + if (p < 0 || p > 1) { + return false; + } - return true; + return true; } /** * Cross product of 2-dimension vector. */ function crossProduct2d(x1, y1, x2, y2) { - return x1 * y2 - x2 * y1; + return x1 * y2 - x2 * y1; } function nearZero(val) { - return val <= 1e-6 && val >= -1e-6; + return val <= 1e-6 && val >= -1e-6; } function setTooltipConfig(opt) { - var itemTooltipOption = opt.itemTooltipOption; - var componentModel = opt.componentModel; - var itemName = opt.itemName; - var itemTooltipOptionObj = isString(itemTooltipOption) ? { - formatter: itemTooltipOption - } : itemTooltipOption; - var mainType = componentModel.mainType; - var componentIndex = componentModel.componentIndex; - var formatterParams = { - componentType: mainType, - name: itemName, - $vars: ['name'] - }; - formatterParams[mainType + 'Index'] = componentIndex; - var formatterParamsExtra = opt.formatterParamsExtra; - - if (formatterParamsExtra) { - each(keys(formatterParamsExtra), function (key) { - if (!hasOwn(formatterParams, key)) { - formatterParams[key] = formatterParamsExtra[key]; - formatterParams.$vars.push(key); - } - }); - } + var itemTooltipOption = opt.itemTooltipOption; + var componentModel = opt.componentModel; + var itemName = opt.itemName; + var itemTooltipOptionObj = isString(itemTooltipOption) ? { + formatter: itemTooltipOption + } : itemTooltipOption; + var mainType = componentModel.mainType; + var componentIndex = componentModel.componentIndex; + var formatterParams = { + componentType: mainType, + name: itemName, + $vars: ['name'] + }; + formatterParams[mainType + 'Index'] = componentIndex; + var formatterParamsExtra = opt.formatterParamsExtra; + + if (formatterParamsExtra) { + each(keys(formatterParamsExtra), function (key) { + if (!hasOwn(formatterParams, key)) { + formatterParams[key] = formatterParamsExtra[key]; + formatterParams.$vars.push(key); + } + }); + } - var ecData = getECData(opt.el); - ecData.componentMainType = mainType; - ecData.componentIndex = componentIndex; - ecData.tooltipConfig = { - name: itemName, - option: defaults({ - content: itemName, - formatterParams: formatterParams - }, itemTooltipOptionObj) - }; + var ecData = getECData(opt.el); + ecData.componentMainType = mainType; + ecData.componentIndex = componentIndex; + ecData.tooltipConfig = { + name: itemName, + option: defaults({ + content: itemName, + formatterParams: formatterParams + }, itemTooltipOptionObj) + }; } function traverseElement(el, cb) { - var stopped; // TODO - // Polyfill for fixing zrender group traverse don't visit it's root issue. + var stopped; // TODO + // Polyfill for fixing zrender group traverse don't visit it's root issue. - if (el.isGroup) { - stopped = cb(el); - } + if (el.isGroup) { + stopped = cb(el); + } - if (!stopped) { - el.traverse(cb); - } + if (!stopped) { + el.traverse(cb); + } } function traverseElements(els, cb) { - if (els) { - if (isArray(els)) { - for (var i = 0; i < els.length; i++) { - traverseElement(els[i], cb); - } - } else { - traverseElement(els, cb); - } + if (els) { + if (isArray(els)) { + for (var i = 0; i < els.length; i++) { + traverseElement(els[i], cb); + } + } else { + traverseElement(els, cb); } + } } // Register built-in shapes. These shapes might be overwirtten // by users, although we do not recommend that. @@ -15212,205 +15212,205 @@ var EMPTY_OBJ = {}; function setLabelText(label, labelTexts) { - for (var i = 0; i < SPECIAL_STATES.length; i++) { - var stateName = SPECIAL_STATES[i]; - var text = labelTexts[stateName]; - var state = label.ensureState(stateName); - state.style = state.style || {}; - state.style.text = text; - } - - var oldStates = label.currentStates.slice(); - label.clearStates(true); - label.setStyle({ - text: labelTexts.normal - }); - label.useStates(oldStates, true); + for (var i = 0; i < SPECIAL_STATES.length; i++) { + var stateName = SPECIAL_STATES[i]; + var text = labelTexts[stateName]; + var state = label.ensureState(stateName); + state.style = state.style || {}; + state.style.text = text; + } + + var oldStates = label.currentStates.slice(); + label.clearStates(true); + label.setStyle({ + text: labelTexts.normal + }); + label.useStates(oldStates, true); } function getLabelText(opt, stateModels, interpolatedValue) { - var labelFetcher = opt.labelFetcher; - var labelDataIndex = opt.labelDataIndex; - var labelDimIndex = opt.labelDimIndex; - var normalModel = stateModels.normal; - var baseText; - - if (labelFetcher) { - baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, normalModel && normalModel.get('formatter'), interpolatedValue != null ? { - interpolatedValue: interpolatedValue - } : null); - } + var labelFetcher = opt.labelFetcher; + var labelDataIndex = opt.labelDataIndex; + var labelDimIndex = opt.labelDimIndex; + var normalModel = stateModels.normal; + var baseText; - if (baseText == null) { - baseText = isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt, interpolatedValue) : opt.defaultText; - } + if (labelFetcher) { + baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, normalModel && normalModel.get('formatter'), interpolatedValue != null ? { + interpolatedValue: interpolatedValue + } : null); + } - var statesText = { - normal: baseText - }; + if (baseText == null) { + baseText = isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt, interpolatedValue) : opt.defaultText; + } - for (var i = 0; i < SPECIAL_STATES.length; i++) { - var stateName = SPECIAL_STATES[i]; - var stateModel = stateModels[stateName]; - statesText[stateName] = retrieve2(labelFetcher ? labelFetcher.getFormattedLabel(labelDataIndex, stateName, null, labelDimIndex, stateModel && stateModel.get('formatter')) : null, baseText); - } + var statesText = { + normal: baseText + }; + + for (var i = 0; i < SPECIAL_STATES.length; i++) { + var stateName = SPECIAL_STATES[i]; + var stateModel = stateModels[stateName]; + statesText[stateName] = retrieve2(labelFetcher ? labelFetcher.getFormattedLabel(labelDataIndex, stateName, null, labelDimIndex, stateModel && stateModel.get('formatter')) : null, baseText); + } - return statesText; + return statesText; } function setLabelStyle(targetEl, labelStatesModels, opt, stateSpecified // TODO specified position? ) { - opt = opt || EMPTY_OBJ; - var isSetOnText = targetEl instanceof ZRText; - var needsCreateText = false; + opt = opt || EMPTY_OBJ; + var isSetOnText = targetEl instanceof ZRText; + var needsCreateText = false; - for (var i = 0; i < DISPLAY_STATES.length; i++) { - var stateModel = labelStatesModels[DISPLAY_STATES[i]]; + for (var i = 0; i < DISPLAY_STATES.length; i++) { + var stateModel = labelStatesModels[DISPLAY_STATES[i]]; - if (stateModel && stateModel.getShallow('show')) { - needsCreateText = true; - break; - } + if (stateModel && stateModel.getShallow('show')) { + needsCreateText = true; + break; } + } - var textContent = isSetOnText ? targetEl : targetEl.getTextContent(); + var textContent = isSetOnText ? targetEl : targetEl.getTextContent(); - if (needsCreateText) { - if (!isSetOnText) { - // Reuse the previous - if (!textContent) { - textContent = new ZRText(); - targetEl.setTextContent(textContent); - } // Use same state proxy + if (needsCreateText) { + if (!isSetOnText) { + // Reuse the previous + if (!textContent) { + textContent = new ZRText(); + targetEl.setTextContent(textContent); + } // Use same state proxy - if (targetEl.stateProxy) { - textContent.stateProxy = targetEl.stateProxy; - } - } + if (targetEl.stateProxy) { + textContent.stateProxy = targetEl.stateProxy; + } + } - var labelStatesTexts = getLabelText(opt, labelStatesModels); - var normalModel = labelStatesModels.normal; - var showNormal = !!normalModel.getShallow('show'); - var normalStyle = createTextStyle(normalModel, stateSpecified && stateSpecified.normal, opt, false, !isSetOnText); - normalStyle.text = labelStatesTexts.normal; + var labelStatesTexts = getLabelText(opt, labelStatesModels); + var normalModel = labelStatesModels.normal; + var showNormal = !!normalModel.getShallow('show'); + var normalStyle = createTextStyle(normalModel, stateSpecified && stateSpecified.normal, opt, false, !isSetOnText); + normalStyle.text = labelStatesTexts.normal; - if (!isSetOnText) { - // Always create new - targetEl.setTextConfig(createTextConfig(normalModel, opt, false)); - } + if (!isSetOnText) { + // Always create new + targetEl.setTextConfig(createTextConfig(normalModel, opt, false)); + } - for (var i = 0; i < SPECIAL_STATES.length; i++) { - var stateName = SPECIAL_STATES[i]; - var stateModel = labelStatesModels[stateName]; + for (var i = 0; i < SPECIAL_STATES.length; i++) { + var stateName = SPECIAL_STATES[i]; + var stateModel = labelStatesModels[stateName]; - if (stateModel) { - var stateObj = textContent.ensureState(stateName); - var stateShow = !!retrieve2(stateModel.getShallow('show'), showNormal); + if (stateModel) { + var stateObj = textContent.ensureState(stateName); + var stateShow = !!retrieve2(stateModel.getShallow('show'), showNormal); - if (stateShow !== showNormal) { - stateObj.ignore = !stateShow; - } + if (stateShow !== showNormal) { + stateObj.ignore = !stateShow; + } - stateObj.style = createTextStyle(stateModel, stateSpecified && stateSpecified[stateName], opt, true, !isSetOnText); - stateObj.style.text = labelStatesTexts[stateName]; + stateObj.style = createTextStyle(stateModel, stateSpecified && stateSpecified[stateName], opt, true, !isSetOnText); + stateObj.style.text = labelStatesTexts[stateName]; - if (!isSetOnText) { - var targetElEmphasisState = targetEl.ensureState(stateName); - targetElEmphasisState.textConfig = createTextConfig(stateModel, opt, true); - } - } - } // PENDING: if there is many requirements that emphasis position - // need to be different from normal position, we might consider - // auto slient is those cases. + if (!isSetOnText) { + var targetElEmphasisState = targetEl.ensureState(stateName); + targetElEmphasisState.textConfig = createTextConfig(stateModel, opt, true); + } + } + } // PENDING: if there is many requirements that emphasis position + // need to be different from normal position, we might consider + // auto slient is those cases. - textContent.silent = !!normalModel.getShallow('silent'); // Keep x and y + textContent.silent = !!normalModel.getShallow('silent'); // Keep x and y - if (textContent.style.x != null) { - normalStyle.x = textContent.style.x; - } + if (textContent.style.x != null) { + normalStyle.x = textContent.style.x; + } - if (textContent.style.y != null) { - normalStyle.y = textContent.style.y; - } + if (textContent.style.y != null) { + normalStyle.y = textContent.style.y; + } - textContent.ignore = !showNormal; // Always create new style. + textContent.ignore = !showNormal; // Always create new style. - textContent.useStyle(normalStyle); - textContent.dirty(); + textContent.useStyle(normalStyle); + textContent.dirty(); - if (opt.enableTextSetter) { - labelInner(textContent).setLabelText = function (interpolatedValue) { - var labelStatesTexts = getLabelText(opt, labelStatesModels, interpolatedValue); - setLabelText(textContent, labelStatesTexts); - }; - } - } else if (textContent) { - // Not display rich text. - textContent.ignore = true; + if (opt.enableTextSetter) { + labelInner(textContent).setLabelText = function (interpolatedValue) { + var labelStatesTexts = getLabelText(opt, labelStatesModels, interpolatedValue); + setLabelText(textContent, labelStatesTexts); + }; } + } else if (textContent) { + // Not display rich text. + textContent.ignore = true; + } - targetEl.dirty(); + targetEl.dirty(); } function getLabelStatesModels(itemModel, labelName) { - labelName = labelName || 'label'; - var statesModels = { - normal: itemModel.getModel(labelName) - }; + labelName = labelName || 'label'; + var statesModels = { + normal: itemModel.getModel(labelName) + }; - for (var i = 0; i < SPECIAL_STATES.length; i++) { - var stateName = SPECIAL_STATES[i]; - statesModels[stateName] = itemModel.getModel([stateName, labelName]); - } + for (var i = 0; i < SPECIAL_STATES.length; i++) { + var stateName = SPECIAL_STATES[i]; + statesModels[stateName] = itemModel.getModel([stateName, labelName]); + } - return statesModels; + return statesModels; } /** * Set basic textStyle properties. */ function createTextStyle(textStyleModel, specifiedTextStyle, // Fixed style in the code. Can't be set by model. - opt, isNotNormal, isAttached // If text is attached on an element. If so, auto color will handling in zrender. + opt, isNotNormal, isAttached // If text is attached on an element. If so, auto color will handling in zrender. ) { - var textStyle = {}; - setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached); - specifiedTextStyle && extend(textStyle, specifiedTextStyle); // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false); + var textStyle = {}; + setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached); + specifiedTextStyle && extend(textStyle, specifiedTextStyle); // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false); - return textStyle; + return textStyle; } function createTextConfig(textStyleModel, opt, isNotNormal) { - opt = opt || {}; - var textConfig = {}; - var labelPosition; - var labelRotate = textStyleModel.getShallow('rotate'); - var labelDistance = retrieve2(textStyleModel.getShallow('distance'), isNotNormal ? null : 5); - var labelOffset = textStyleModel.getShallow('offset'); - labelPosition = textStyleModel.getShallow('position') || (isNotNormal ? null : 'inside'); // 'outside' is not a valid zr textPostion value, but used - // in bar series, and magric type should be considered. + opt = opt || {}; + var textConfig = {}; + var labelPosition; + var labelRotate = textStyleModel.getShallow('rotate'); + var labelDistance = retrieve2(textStyleModel.getShallow('distance'), isNotNormal ? null : 5); + var labelOffset = textStyleModel.getShallow('offset'); + labelPosition = textStyleModel.getShallow('position') || (isNotNormal ? null : 'inside'); // 'outside' is not a valid zr textPostion value, but used + // in bar series, and magric type should be considered. - labelPosition === 'outside' && (labelPosition = opt.defaultOutsidePosition || 'top'); + labelPosition === 'outside' && (labelPosition = opt.defaultOutsidePosition || 'top'); - if (labelPosition != null) { - textConfig.position = labelPosition; - } + if (labelPosition != null) { + textConfig.position = labelPosition; + } - if (labelOffset != null) { - textConfig.offset = labelOffset; - } + if (labelOffset != null) { + textConfig.offset = labelOffset; + } - if (labelRotate != null) { - labelRotate *= Math.PI / 180; - textConfig.rotation = labelRotate; - } + if (labelRotate != null) { + labelRotate *= Math.PI / 180; + textConfig.rotation = labelRotate; + } - if (labelDistance != null) { - textConfig.distance = labelDistance; - } // fill and auto is determined by the color of path fill if it's not specified by developers. + if (labelDistance != null) { + textConfig.distance = labelDistance; + } // fill and auto is determined by the color of path fill if it's not specified by developers. - textConfig.outsideFill = textStyleModel.get('color') === 'inherit' ? opt.inheritColor || null : 'auto'; - return textConfig; + textConfig.outsideFill = textStyleModel.get('color') === 'inherit' ? opt.inheritColor || null : 'auto'; + return textConfig; } /** * The uniform entry of set text style, that is, retrieve style definitions @@ -15423,61 +15423,61 @@ */ function setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached) { - // Consider there will be abnormal when merge hover style to normal style if given default value. - opt = opt || EMPTY_OBJ; - var ecModel = textStyleModel.ecModel; - var globalTextStyle = ecModel && ecModel.option.textStyle; // Consider case: - // { - // data: [{ - // value: 12, - // label: { - // rich: { - // // no 'a' here but using parent 'a'. - // } - // } - // }], - // rich: { - // a: { ... } - // } - // } - - var richItemNames = getRichItemNames(textStyleModel); - var richResult; - - if (richItemNames) { - richResult = {}; - - for (var name_1 in richItemNames) { - if (richItemNames.hasOwnProperty(name_1)) { - // Cascade is supported in rich. - var richTextStyle = textStyleModel.getModel(['rich', name_1]); // In rich, never `disableBox`. - // FIXME: consider `label: {formatter: '{a|xx}', color: 'blue', rich: {a: {}}}`, - // the default color `'blue'` will not be adopted if no color declared in `rich`. - // That might confuses users. So probably we should put `textStyleModel` as the - // root ancestor of the `richTextStyle`. But that would be a break change. - - setTokenTextStyle(richResult[name_1] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true); - } - } - } - - if (richResult) { - textStyle.rich = richResult; - } - - var overflow = textStyleModel.get('overflow'); - - if (overflow) { - textStyle.overflow = overflow; - } - - var margin = textStyleModel.get('minMargin'); - - if (margin != null) { - textStyle.margin = margin; - } - - setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false); + // Consider there will be abnormal when merge hover style to normal style if given default value. + opt = opt || EMPTY_OBJ; + var ecModel = textStyleModel.ecModel; + var globalTextStyle = ecModel && ecModel.option.textStyle; // Consider case: + // { + // data: [{ + // value: 12, + // label: { + // rich: { + // // no 'a' here but using parent 'a'. + // } + // } + // }], + // rich: { + // a: { ... } + // } + // } + + var richItemNames = getRichItemNames(textStyleModel); + var richResult; + + if (richItemNames) { + richResult = {}; + + for (var name_1 in richItemNames) { + if (richItemNames.hasOwnProperty(name_1)) { + // Cascade is supported in rich. + var richTextStyle = textStyleModel.getModel(['rich', name_1]); // In rich, never `disableBox`. + // FIXME: consider `label: {formatter: '{a|xx}', color: 'blue', rich: {a: {}}}`, + // the default color `'blue'` will not be adopted if no color declared in `rich`. + // That might confuses users. So probably we should put `textStyleModel` as the + // root ancestor of the `richTextStyle`. But that would be a break change. + + setTokenTextStyle(richResult[name_1] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true); + } + } + } + + if (richResult) { + textStyle.rich = richResult; + } + + var overflow = textStyleModel.get('overflow'); + + if (overflow) { + textStyle.overflow = overflow; + } + + var margin = textStyleModel.get('minMargin'); + + if (margin != null) { + textStyle.margin = margin; + } + + setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false); } // Consider case: // { // data: [{ @@ -15496,26 +15496,26 @@ function getRichItemNames(textStyleModel) { - // Use object to remove duplicated names. - var richItemNameMap; - - while (textStyleModel && textStyleModel !== textStyleModel.ecModel) { - var rich = (textStyleModel.option || EMPTY_OBJ).rich; + // Use object to remove duplicated names. + var richItemNameMap; - if (rich) { - richItemNameMap = richItemNameMap || {}; - var richKeys = keys(rich); + while (textStyleModel && textStyleModel !== textStyleModel.ecModel) { + var rich = (textStyleModel.option || EMPTY_OBJ).rich; - for (var i = 0; i < richKeys.length; i++) { - var richKey = richKeys[i]; - richItemNameMap[richKey] = 1; - } - } + if (rich) { + richItemNameMap = richItemNameMap || {}; + var richKeys = keys(rich); - textStyleModel = textStyleModel.parentModel; + for (var i = 0; i < richKeys.length; i++) { + var richKey = richKeys[i]; + richItemNameMap[richKey] = 1; + } } - return richItemNameMap; + textStyleModel = textStyleModel.parentModel; + } + + return richItemNameMap; } var TEXT_PROPS_WITH_GLOBAL = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY']; @@ -15523,210 +15523,210 @@ var TEXT_PROPS_BOX = ['padding', 'borderWidth', 'borderRadius', 'borderDashOffset', 'backgroundColor', 'borderColor', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY']; function setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, isBlock, inRich) { - // In merge mode, default value should not be given. - globalTextStyle = !isNotNormal && globalTextStyle || EMPTY_OBJ; - var inheritColor = opt && opt.inheritColor; - var fillColor = textStyleModel.getShallow('color'); - var strokeColor = textStyleModel.getShallow('textBorderColor'); - var opacity = retrieve2(textStyleModel.getShallow('opacity'), globalTextStyle.opacity); - - if (fillColor === 'inherit' || fillColor === 'auto') { - if ("development" !== 'production') { - if (fillColor === 'auto') { - deprecateReplaceLog('color: \'auto\'', 'color: \'inherit\''); - } - } - - if (inheritColor) { - fillColor = inheritColor; - } else { - fillColor = null; - } + // In merge mode, default value should not be given. + globalTextStyle = !isNotNormal && globalTextStyle || EMPTY_OBJ; + var inheritColor = opt && opt.inheritColor; + var fillColor = textStyleModel.getShallow('color'); + var strokeColor = textStyleModel.getShallow('textBorderColor'); + var opacity = retrieve2(textStyleModel.getShallow('opacity'), globalTextStyle.opacity); + + if (fillColor === 'inherit' || fillColor === 'auto') { + if ("development" !== 'production') { + if (fillColor === 'auto') { + deprecateReplaceLog('color: \'auto\'', 'color: \'inherit\''); + } } - if (strokeColor === 'inherit' || strokeColor === 'auto') { - if ("development" !== 'production') { - if (strokeColor === 'auto') { - deprecateReplaceLog('color: \'auto\'', 'color: \'inherit\''); - } - } - - if (inheritColor) { - strokeColor = inheritColor; - } else { - strokeColor = null; - } + if (inheritColor) { + fillColor = inheritColor; + } else { + fillColor = null; } + } - if (!isAttached) { - // Only use default global textStyle.color if text is individual. - // Otherwise it will use the strategy of attached text color because text may be on a path. - fillColor = fillColor || globalTextStyle.color; - strokeColor = strokeColor || globalTextStyle.textBorderColor; + if (strokeColor === 'inherit' || strokeColor === 'auto') { + if ("development" !== 'production') { + if (strokeColor === 'auto') { + deprecateReplaceLog('color: \'auto\'', 'color: \'inherit\''); + } } - if (fillColor != null) { - textStyle.fill = fillColor; + if (inheritColor) { + strokeColor = inheritColor; + } else { + strokeColor = null; } + } - if (strokeColor != null) { - textStyle.stroke = strokeColor; - } + if (!isAttached) { + // Only use default global textStyle.color if text is individual. + // Otherwise it will use the strategy of attached text color because text may be on a path. + fillColor = fillColor || globalTextStyle.color; + strokeColor = strokeColor || globalTextStyle.textBorderColor; + } - var textBorderWidth = retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth); + if (fillColor != null) { + textStyle.fill = fillColor; + } - if (textBorderWidth != null) { - textStyle.lineWidth = textBorderWidth; - } + if (strokeColor != null) { + textStyle.stroke = strokeColor; + } - var textBorderType = retrieve2(textStyleModel.getShallow('textBorderType'), globalTextStyle.textBorderType); + var textBorderWidth = retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth); - if (textBorderType != null) { - textStyle.lineDash = textBorderType; - } + if (textBorderWidth != null) { + textStyle.lineWidth = textBorderWidth; + } - var textBorderDashOffset = retrieve2(textStyleModel.getShallow('textBorderDashOffset'), globalTextStyle.textBorderDashOffset); + var textBorderType = retrieve2(textStyleModel.getShallow('textBorderType'), globalTextStyle.textBorderType); - if (textBorderDashOffset != null) { - textStyle.lineDashOffset = textBorderDashOffset; - } + if (textBorderType != null) { + textStyle.lineDash = textBorderType; + } - if (!isNotNormal && opacity == null && !inRich) { - opacity = opt && opt.defaultOpacity; - } + var textBorderDashOffset = retrieve2(textStyleModel.getShallow('textBorderDashOffset'), globalTextStyle.textBorderDashOffset); - if (opacity != null) { - textStyle.opacity = opacity; - } // TODO + if (textBorderDashOffset != null) { + textStyle.lineDashOffset = textBorderDashOffset; + } + if (!isNotNormal && opacity == null && !inRich) { + opacity = opt && opt.defaultOpacity; + } - if (!isNotNormal && !isAttached) { - // Set default finally. - if (textStyle.fill == null && opt.inheritColor) { - textStyle.fill = opt.inheritColor; - } - } // Do not use `getFont` here, because merge should be supported, where - // part of these properties may be changed in emphasis style, and the - // others should remain their original value got from normal style. + if (opacity != null) { + textStyle.opacity = opacity; + } // TODO - for (var i = 0; i < TEXT_PROPS_WITH_GLOBAL.length; i++) { - var key = TEXT_PROPS_WITH_GLOBAL[i]; - var val = retrieve2(textStyleModel.getShallow(key), globalTextStyle[key]); - - if (val != null) { - textStyle[key] = val; - } + if (!isNotNormal && !isAttached) { + // Set default finally. + if (textStyle.fill == null && opt.inheritColor) { + textStyle.fill = opt.inheritColor; } + } // Do not use `getFont` here, because merge should be supported, where + // part of these properties may be changed in emphasis style, and the + // others should remain their original value got from normal style. - for (var i = 0; i < TEXT_PROPS_SELF.length; i++) { - var key = TEXT_PROPS_SELF[i]; - var val = textStyleModel.getShallow(key); - if (val != null) { - textStyle[key] = val; - } + for (var i = 0; i < TEXT_PROPS_WITH_GLOBAL.length; i++) { + var key = TEXT_PROPS_WITH_GLOBAL[i]; + var val = retrieve2(textStyleModel.getShallow(key), globalTextStyle[key]); + + if (val != null) { + textStyle[key] = val; } + } - if (textStyle.verticalAlign == null) { - var baseline = textStyleModel.getShallow('baseline'); + for (var i = 0; i < TEXT_PROPS_SELF.length; i++) { + var key = TEXT_PROPS_SELF[i]; + var val = textStyleModel.getShallow(key); - if (baseline != null) { - textStyle.verticalAlign = baseline; - } + if (val != null) { + textStyle[key] = val; } + } - if (!isBlock || !opt.disableBox) { - for (var i = 0; i < TEXT_PROPS_BOX.length; i++) { - var key = TEXT_PROPS_BOX[i]; - var val = textStyleModel.getShallow(key); + if (textStyle.verticalAlign == null) { + var baseline = textStyleModel.getShallow('baseline'); - if (val != null) { - textStyle[key] = val; - } - } + if (baseline != null) { + textStyle.verticalAlign = baseline; + } + } - var borderType = textStyleModel.getShallow('borderType'); + if (!isBlock || !opt.disableBox) { + for (var i = 0; i < TEXT_PROPS_BOX.length; i++) { + var key = TEXT_PROPS_BOX[i]; + var val = textStyleModel.getShallow(key); - if (borderType != null) { - textStyle.borderDash = borderType; - } + if (val != null) { + textStyle[key] = val; + } + } - if ((textStyle.backgroundColor === 'auto' || textStyle.backgroundColor === 'inherit') && inheritColor) { - if ("development" !== 'production') { - if (textStyle.backgroundColor === 'auto') { - deprecateReplaceLog('backgroundColor: \'auto\'', 'backgroundColor: \'inherit\''); - } - } + var borderType = textStyleModel.getShallow('borderType'); + + if (borderType != null) { + textStyle.borderDash = borderType; + } - textStyle.backgroundColor = inheritColor; + if ((textStyle.backgroundColor === 'auto' || textStyle.backgroundColor === 'inherit') && inheritColor) { + if ("development" !== 'production') { + if (textStyle.backgroundColor === 'auto') { + deprecateReplaceLog('backgroundColor: \'auto\'', 'backgroundColor: \'inherit\''); } + } - if ((textStyle.borderColor === 'auto' || textStyle.borderColor === 'inherit') && inheritColor) { - if ("development" !== 'production') { - if (textStyle.borderColor === 'auto') { - deprecateReplaceLog('borderColor: \'auto\'', 'borderColor: \'inherit\''); - } - } + textStyle.backgroundColor = inheritColor; + } - textStyle.borderColor = inheritColor; + if ((textStyle.borderColor === 'auto' || textStyle.borderColor === 'inherit') && inheritColor) { + if ("development" !== 'production') { + if (textStyle.borderColor === 'auto') { + deprecateReplaceLog('borderColor: \'auto\'', 'borderColor: \'inherit\''); } + } + + textStyle.borderColor = inheritColor; } + } } function getFont(opt, ecModel) { - var gTextStyleModel = ecModel && ecModel.getModel('textStyle'); - return trim([// FIXME in node-canvas fontWeight is before fontStyle - opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '', opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '', (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px', opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif'].join(' ')); + var gTextStyleModel = ecModel && ecModel.getModel('textStyle'); + return trim([// FIXME in node-canvas fontWeight is before fontStyle + opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '', opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '', (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px', opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif'].join(' ')); } var labelInner = makeInner(); function setLabelValueAnimation(label, labelStatesModels, value, getDefaultText) { - if (!label) { - return; - } + if (!label) { + return; + } - var obj = labelInner(label); - obj.prevValue = obj.value; - obj.value = value; - var normalLabelModel = labelStatesModels.normal; - obj.valueAnimation = normalLabelModel.get('valueAnimation'); + var obj = labelInner(label); + obj.prevValue = obj.value; + obj.value = value; + var normalLabelModel = labelStatesModels.normal; + obj.valueAnimation = normalLabelModel.get('valueAnimation'); - if (obj.valueAnimation) { - obj.precision = normalLabelModel.get('precision'); - obj.defaultInterpolatedText = getDefaultText; - obj.statesModels = labelStatesModels; - } + if (obj.valueAnimation) { + obj.precision = normalLabelModel.get('precision'); + obj.defaultInterpolatedText = getDefaultText; + obj.statesModels = labelStatesModels; + } } function animateLabelValue(textEl, dataIndex, data, animatableModel, labelFetcher) { - var labelInnerStore = labelInner(textEl); + var labelInnerStore = labelInner(textEl); - if (!labelInnerStore.valueAnimation || labelInnerStore.prevValue === labelInnerStore.value) { - // Value not changed, no new label animation - return; - } + if (!labelInnerStore.valueAnimation || labelInnerStore.prevValue === labelInnerStore.value) { + // Value not changed, no new label animation + return; + } - var defaultInterpolatedText = labelInnerStore.defaultInterpolatedText; // Consider the case that being animating, do not use the `obj.value`, - // Otherwise it will jump to the `obj.value` when this new animation started. + var defaultInterpolatedText = labelInnerStore.defaultInterpolatedText; // Consider the case that being animating, do not use the `obj.value`, + // Otherwise it will jump to the `obj.value` when this new animation started. - var currValue = retrieve2(labelInnerStore.interpolatedValue, labelInnerStore.prevValue); - var targetValue = labelInnerStore.value; + var currValue = retrieve2(labelInnerStore.interpolatedValue, labelInnerStore.prevValue); + var targetValue = labelInnerStore.value; - function during(percent) { - var interpolated = interpolateRawValues(data, labelInnerStore.precision, currValue, targetValue, percent); - labelInnerStore.interpolatedValue = percent === 1 ? null : interpolated; - var labelText = getLabelText({ - labelDataIndex: dataIndex, - labelFetcher: labelFetcher, - defaultText: defaultInterpolatedText ? defaultInterpolatedText(interpolated) : interpolated + '' - }, labelInnerStore.statesModels, interpolated); - setLabelText(textEl, labelText); - } + function during(percent) { + var interpolated = interpolateRawValues(data, labelInnerStore.precision, currValue, targetValue, percent); + labelInnerStore.interpolatedValue = percent === 1 ? null : interpolated; + var labelText = getLabelText({ + labelDataIndex: dataIndex, + labelFetcher: labelFetcher, + defaultText: defaultInterpolatedText ? defaultInterpolatedText(interpolated) : interpolated + '' + }, labelInnerStore.statesModels, interpolated); + setLabelText(textEl, labelText); + } - textEl.percent = 0; - (labelInnerStore.prevValue == null ? initProps : updateProps)(textEl, { - // percent is used to prevent animation from being aborted #15916 - percent: 1 - }, animatableModel, dataIndex, null, during); + textEl.percent = 0; + (labelInnerStore.prevValue == null ? initProps : updateProps)(textEl, { + // percent is used to prevent animation from being aborted #15916 + percent: 1 + }, animatableModel, dataIndex, null, during); } var PATH_COLOR = ['textStyle', 'color']; @@ -15735,233 +15735,233 @@ var tmpText = new ZRText(); var TextStyleMixin = - /** @class */ - function () { - function TextStyleMixin() {} - /** - * Get color property or get color from option.textStyle.color - */ - // TODO Callback + /** @class */ + function () { + function TextStyleMixin() {} + /** + * Get color property or get color from option.textStyle.color + */ + // TODO Callback - TextStyleMixin.prototype.getTextColor = function (isEmphasis) { - var ecModel = this.ecModel; - return this.getShallow('color') || (!isEmphasis && ecModel ? ecModel.get(PATH_COLOR) : null); - }; - /** - * Create font string from fontStyle, fontWeight, fontSize, fontFamily - * @return {string} - */ + TextStyleMixin.prototype.getTextColor = function (isEmphasis) { + var ecModel = this.ecModel; + return this.getShallow('color') || (!isEmphasis && ecModel ? ecModel.get(PATH_COLOR) : null); + }; + /** + * Create font string from fontStyle, fontWeight, fontSize, fontFamily + * @return {string} + */ - TextStyleMixin.prototype.getFont = function () { - return getFont({ - fontStyle: this.getShallow('fontStyle'), - fontWeight: this.getShallow('fontWeight'), - fontSize: this.getShallow('fontSize'), - fontFamily: this.getShallow('fontFamily') - }, this.ecModel); - }; + TextStyleMixin.prototype.getFont = function () { + return getFont({ + fontStyle: this.getShallow('fontStyle'), + fontWeight: this.getShallow('fontWeight'), + fontSize: this.getShallow('fontSize'), + fontFamily: this.getShallow('fontFamily') + }, this.ecModel); + }; - TextStyleMixin.prototype.getTextRect = function (text) { - var style = { - text: text, - verticalAlign: this.getShallow('verticalAlign') || this.getShallow('baseline') - }; + TextStyleMixin.prototype.getTextRect = function (text) { + var style = { + text: text, + verticalAlign: this.getShallow('verticalAlign') || this.getShallow('baseline') + }; - for (var i = 0; i < textStyleParams.length; i++) { - style[textStyleParams[i]] = this.getShallow(textStyleParams[i]); - } + for (var i = 0; i < textStyleParams.length; i++) { + style[textStyleParams[i]] = this.getShallow(textStyleParams[i]); + } - tmpText.useStyle(style); - tmpText.update(); - return tmpText.getBoundingRect(); - }; + tmpText.useStyle(style); + tmpText.update(); + return tmpText.getBoundingRect(); + }; - return TextStyleMixin; - }(); + return TextStyleMixin; + }(); var LINE_STYLE_KEY_MAP = [['lineWidth', 'width'], ['stroke', 'color'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'], ['lineDash', 'type'], ['lineDashOffset', 'dashOffset'], ['lineCap', 'cap'], ['lineJoin', 'join'], ['miterLimit'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`. - // So do not transfer decal directly. + // So do not transfer decal directly. ]; var getLineStyle = makeStyleMapper(LINE_STYLE_KEY_MAP); var LineStyleMixin = - /** @class */ - function () { - function LineStyleMixin() {} + /** @class */ + function () { + function LineStyleMixin() {} - LineStyleMixin.prototype.getLineStyle = function (excludes) { - return getLineStyle(this, excludes); - }; + LineStyleMixin.prototype.getLineStyle = function (excludes) { + return getLineStyle(this, excludes); + }; - return LineStyleMixin; - }(); + return LineStyleMixin; + }(); var ITEM_STYLE_KEY_MAP = [['fill', 'color'], ['stroke', 'borderColor'], ['lineWidth', 'borderWidth'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'], ['lineDash', 'borderType'], ['lineDashOffset', 'borderDashOffset'], ['lineCap', 'borderCap'], ['lineJoin', 'borderJoin'], ['miterLimit', 'borderMiterLimit'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`. - // So do not transfer decal directly. + // So do not transfer decal directly. ]; var getItemStyle = makeStyleMapper(ITEM_STYLE_KEY_MAP); var ItemStyleMixin = - /** @class */ - function () { - function ItemStyleMixin() {} + /** @class */ + function () { + function ItemStyleMixin() {} - ItemStyleMixin.prototype.getItemStyle = function (excludes, includes) { - return getItemStyle(this, excludes, includes); - }; + ItemStyleMixin.prototype.getItemStyle = function (excludes, includes) { + return getItemStyle(this, excludes, includes); + }; - return ItemStyleMixin; - }(); + return ItemStyleMixin; + }(); var Model = - /** @class */ - function () { - function Model(option, parentModel, ecModel) { - this.parentModel = parentModel; - this.ecModel = ecModel; - this.option = option; // Simple optimization - // if (this.init) { - // if (arguments.length <= 4) { - // this.init(option, parentModel, ecModel, extraOpt); - // } - // else { - // this.init.apply(this, arguments); - // } - // } - } - - Model.prototype.init = function (option, parentModel, ecModel) { - var rest = []; - - for (var _i = 3; _i < arguments.length; _i++) { - rest[_i - 3] = arguments[_i]; - } - }; - /** - * Merge the input option to me. - */ + /** @class */ + function () { + function Model(option, parentModel, ecModel) { + this.parentModel = parentModel; + this.ecModel = ecModel; + this.option = option; // Simple optimization + // if (this.init) { + // if (arguments.length <= 4) { + // this.init(option, parentModel, ecModel, extraOpt); + // } + // else { + // this.init.apply(this, arguments); + // } + // } + } + Model.prototype.init = function (option, parentModel, ecModel) { + var rest = []; - Model.prototype.mergeOption = function (option, ecModel) { - merge(this.option, option, true); - }; // `path` can be 'xxx.yyy.zzz', so the return value type have to be `ModelOption` - // TODO: TYPE strict key check? - // get(path: string | string[], ignoreParent?: boolean): ModelOption; + for (var _i = 3; _i < arguments.length; _i++) { + rest[_i - 3] = arguments[_i]; + } + }; + /** + * Merge the input option to me. + */ - Model.prototype.get = function (path, ignoreParent) { - if (path == null) { - return this.option; - } + Model.prototype.mergeOption = function (option, ecModel) { + merge(this.option, option, true); + }; // `path` can be 'xxx.yyy.zzz', so the return value type have to be `ModelOption` + // TODO: TYPE strict key check? + // get(path: string | string[], ignoreParent?: boolean): ModelOption; - return this._doGet(this.parsePath(path), !ignoreParent && this.parentModel); - }; - Model.prototype.getShallow = function (key, ignoreParent) { - var option = this.option; - var val = option == null ? option : option[key]; + Model.prototype.get = function (path, ignoreParent) { + if (path == null) { + return this.option; + } - if (val == null && !ignoreParent) { - var parentModel = this.parentModel; + return this._doGet(this.parsePath(path), !ignoreParent && this.parentModel); + }; - if (parentModel) { - // FIXME:TS do not know how to make it works - val = parentModel.getShallow(key); - } - } + Model.prototype.getShallow = function (key, ignoreParent) { + var option = this.option; + var val = option == null ? option : option[key]; - return val; - }; // `path` can be 'xxx.yyy.zzz', so the return value type have to be `Model` - // getModel(path: string | string[], parentModel?: Model): Model; - // TODO 'xxx.yyy.zzz' is deprecated + if (val == null && !ignoreParent) { + var parentModel = this.parentModel; + if (parentModel) { + // FIXME:TS do not know how to make it works + val = parentModel.getShallow(key); + } + } - Model.prototype.getModel = function (path, parentModel) { - var hasPath = path != null; - var pathFinal = hasPath ? this.parsePath(path) : null; - var obj = hasPath ? this._doGet(pathFinal) : this.option; - parentModel = parentModel || this.parentModel && this.parentModel.getModel(this.resolveParentPath(pathFinal)); - return new Model(obj, parentModel, this.ecModel); - }; - /** - * If model has option - */ + return val; + }; // `path` can be 'xxx.yyy.zzz', so the return value type have to be `Model` + // getModel(path: string | string[], parentModel?: Model): Model; + // TODO 'xxx.yyy.zzz' is deprecated + + + Model.prototype.getModel = function (path, parentModel) { + var hasPath = path != null; + var pathFinal = hasPath ? this.parsePath(path) : null; + var obj = hasPath ? this._doGet(pathFinal) : this.option; + parentModel = parentModel || this.parentModel && this.parentModel.getModel(this.resolveParentPath(pathFinal)); + return new Model(obj, parentModel, this.ecModel); + }; + /** + * If model has option + */ - Model.prototype.isEmpty = function () { - return this.option == null; - }; + Model.prototype.isEmpty = function () { + return this.option == null; + }; - Model.prototype.restoreData = function () {}; // Pending + Model.prototype.restoreData = function () {}; // Pending - Model.prototype.clone = function () { - var Ctor = this.constructor; - return new Ctor(clone(this.option)); - }; // setReadOnly(properties): void { - // clazzUtil.setReadOnly(this, properties); - // } - // If path is null/undefined, return null/undefined. + Model.prototype.clone = function () { + var Ctor = this.constructor; + return new Ctor(clone(this.option)); + }; // setReadOnly(properties): void { + // clazzUtil.setReadOnly(this, properties); + // } + // If path is null/undefined, return null/undefined. - Model.prototype.parsePath = function (path) { - if (typeof path === 'string') { - return path.split('.'); - } + Model.prototype.parsePath = function (path) { + if (typeof path === 'string') { + return path.split('.'); + } - return path; - }; // Resolve path for parent. Perhaps useful when parent use a different property. - // Default to be a identity resolver. - // Can be modified to a different resolver. + return path; + }; // Resolve path for parent. Perhaps useful when parent use a different property. + // Default to be a identity resolver. + // Can be modified to a different resolver. - Model.prototype.resolveParentPath = function (path) { - return path; - }; // FIXME:TS check whether put this method here + Model.prototype.resolveParentPath = function (path) { + return path; + }; // FIXME:TS check whether put this method here - Model.prototype.isAnimationEnabled = function () { - if (!env.node && this.option) { - if (this.option.animation != null) { - return !!this.option.animation; - } else if (this.parentModel) { - return this.parentModel.isAnimationEnabled(); - } - } - }; + Model.prototype.isAnimationEnabled = function () { + if (!env.node && this.option) { + if (this.option.animation != null) { + return !!this.option.animation; + } else if (this.parentModel) { + return this.parentModel.isAnimationEnabled(); + } + } + }; - Model.prototype._doGet = function (pathArr, parentModel) { - var obj = this.option; + Model.prototype._doGet = function (pathArr, parentModel) { + var obj = this.option; - if (!pathArr) { - return obj; - } + if (!pathArr) { + return obj; + } - for (var i = 0; i < pathArr.length; i++) { - // Ignore empty - if (!pathArr[i]) { - continue; - } // obj could be number/string/... (like 0) + for (var i = 0; i < pathArr.length; i++) { + // Ignore empty + if (!pathArr[i]) { + continue; + } // obj could be number/string/... (like 0) - obj = obj && typeof obj === 'object' ? obj[pathArr[i]] : null; + obj = obj && typeof obj === 'object' ? obj[pathArr[i]] : null; - if (obj == null) { - break; - } - } + if (obj == null) { + break; + } + } - if (obj == null && parentModel) { - obj = parentModel._doGet(this.resolveParentPath(pathArr), parentModel.parentModel); - } + if (obj == null && parentModel) { + obj = parentModel._doGet(this.resolveParentPath(pathArr), parentModel.parentModel); + } - return obj; - }; + return obj; + }; - return Model; - }(); + return Model; + }(); enableClassExtend(Model); enableClassCheck(Model); @@ -15978,35 +15978,35 @@ */ function getUID(type) { - // Considering the case of crossing js context, - // use Math.random to make id as unique as possible. - return [type || '', base++].join('_'); + // Considering the case of crossing js context, + // use Math.random to make id as unique as possible. + return [type || '', base++].join('_'); } /** * Implements `SubTypeDefaulterManager` for `target`. */ function enableSubTypeDefaulter(target) { - var subTypeDefaulters = {}; + var subTypeDefaulters = {}; - target.registerSubTypeDefaulter = function (componentType, defaulter) { - var componentTypeInfo = parseClassType(componentType); - subTypeDefaulters[componentTypeInfo.main] = defaulter; - }; + target.registerSubTypeDefaulter = function (componentType, defaulter) { + var componentTypeInfo = parseClassType(componentType); + subTypeDefaulters[componentTypeInfo.main] = defaulter; + }; - target.determineSubType = function (componentType, option) { - var type = option.type; + target.determineSubType = function (componentType, option) { + var type = option.type; - if (!type) { - var componentTypeMain = parseClassType(componentType).main; + if (!type) { + var componentTypeMain = parseClassType(componentType).main; - if (target.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) { - type = subTypeDefaulters[componentTypeMain](option); - } - } + if (target.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) { + type = subTypeDefaulters[componentTypeMain](option); + } + } - return type; - }; + return type; + }; } /** * Implements `TopologicalTravelable` for `entity`. @@ -16018,122 +16018,122 @@ */ function enableTopologicalTravel(entity, dependencyGetter) { - /** - * @param targetNameList Target Component type list. - * Can be ['aa', 'bb', 'aa.xx'] - * @param fullNameList By which we can build dependency graph. - * @param callback Params: componentType, dependencies. - * @param context Scope of callback. - */ - entity.topologicalTravel = function (targetNameList, fullNameList, callback, context) { - if (!targetNameList.length) { - return; - } - - var result = makeDepndencyGraph(fullNameList); - var graph = result.graph; - var noEntryList = result.noEntryList; - var targetNameSet = {}; - each(targetNameList, function (name) { - targetNameSet[name] = true; - }); + /** + * @param targetNameList Target Component type list. + * Can be ['aa', 'bb', 'aa.xx'] + * @param fullNameList By which we can build dependency graph. + * @param callback Params: componentType, dependencies. + * @param context Scope of callback. + */ + entity.topologicalTravel = function (targetNameList, fullNameList, callback, context) { + if (!targetNameList.length) { + return; + } - while (noEntryList.length) { - var currComponentType = noEntryList.pop(); - var currVertex = graph[currComponentType]; - var isInTargetNameSet = !!targetNameSet[currComponentType]; + var result = makeDepndencyGraph(fullNameList); + var graph = result.graph; + var noEntryList = result.noEntryList; + var targetNameSet = {}; + each(targetNameList, function (name) { + targetNameSet[name] = true; + }); - if (isInTargetNameSet) { - callback.call(context, currComponentType, currVertex.originalDeps.slice()); - delete targetNameSet[currComponentType]; - } + while (noEntryList.length) { + var currComponentType = noEntryList.pop(); + var currVertex = graph[currComponentType]; + var isInTargetNameSet = !!targetNameSet[currComponentType]; - each(currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge); - } + if (isInTargetNameSet) { + callback.call(context, currComponentType, currVertex.originalDeps.slice()); + delete targetNameSet[currComponentType]; + } - each(targetNameSet, function () { - var errMsg = ''; + each(currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge); + } - if ("development" !== 'production') { - errMsg = makePrintable('Circular dependency may exists: ', targetNameSet, targetNameList, fullNameList); - } + each(targetNameSet, function () { + var errMsg = ''; - throw new Error(errMsg); - }); + if ("development" !== 'production') { + errMsg = makePrintable('Circular dependency may exists: ', targetNameSet, targetNameList, fullNameList); + } - function removeEdge(succComponentType) { - graph[succComponentType].entryCount--; + throw new Error(errMsg); + }); - if (graph[succComponentType].entryCount === 0) { - noEntryList.push(succComponentType); - } - } // Consider this case: legend depends on series, and we call - // chart.setOption({series: [...]}), where only series is in option. - // If we do not have 'removeEdgeAndAdd', legendModel.mergeOption will - // not be called, but only sereis.mergeOption is called. Thus legend - // have no chance to update its local record about series (like which - // name of series is available in legend). + function removeEdge(succComponentType) { + graph[succComponentType].entryCount--; + if (graph[succComponentType].entryCount === 0) { + noEntryList.push(succComponentType); + } + } // Consider this case: legend depends on series, and we call + // chart.setOption({series: [...]}), where only series is in option. + // If we do not have 'removeEdgeAndAdd', legendModel.mergeOption will + // not be called, but only sereis.mergeOption is called. Thus legend + // have no chance to update its local record about series (like which + // name of series is available in legend). - function removeEdgeAndAdd(succComponentType) { - targetNameSet[succComponentType] = true; - removeEdge(succComponentType); - } - }; - function makeDepndencyGraph(fullNameList) { - var graph = {}; - var noEntryList = []; - each(fullNameList, function (name) { - var thisItem = createDependencyGraphItem(graph, name); - var originalDeps = thisItem.originalDeps = dependencyGetter(name); - var availableDeps = getAvailableDependencies(originalDeps, fullNameList); - thisItem.entryCount = availableDeps.length; + function removeEdgeAndAdd(succComponentType) { + targetNameSet[succComponentType] = true; + removeEdge(succComponentType); + } + }; - if (thisItem.entryCount === 0) { - noEntryList.push(name); - } + function makeDepndencyGraph(fullNameList) { + var graph = {}; + var noEntryList = []; + each(fullNameList, function (name) { + var thisItem = createDependencyGraphItem(graph, name); + var originalDeps = thisItem.originalDeps = dependencyGetter(name); + var availableDeps = getAvailableDependencies(originalDeps, fullNameList); + thisItem.entryCount = availableDeps.length; - each(availableDeps, function (dependentName) { - if (indexOf(thisItem.predecessor, dependentName) < 0) { - thisItem.predecessor.push(dependentName); - } + if (thisItem.entryCount === 0) { + noEntryList.push(name); + } - var thatItem = createDependencyGraphItem(graph, dependentName); + each(availableDeps, function (dependentName) { + if (indexOf(thisItem.predecessor, dependentName) < 0) { + thisItem.predecessor.push(dependentName); + } - if (indexOf(thatItem.successor, dependentName) < 0) { - thatItem.successor.push(name); - } - }); - }); - return { - graph: graph, - noEntryList: noEntryList - }; - } + var thatItem = createDependencyGraphItem(graph, dependentName); - function createDependencyGraphItem(graph, name) { - if (!graph[name]) { - graph[name] = { - predecessor: [], - successor: [] - }; + if (indexOf(thatItem.successor, dependentName) < 0) { + thatItem.successor.push(name); } + }); + }); + return { + graph: graph, + noEntryList: noEntryList + }; + } - return graph[name]; + function createDependencyGraphItem(graph, name) { + if (!graph[name]) { + graph[name] = { + predecessor: [], + successor: [] + }; } - function getAvailableDependencies(originalDeps, fullNameList) { - var availableDeps = []; - each(originalDeps, function (dep) { - indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep); - }); - return availableDeps; - } + return graph[name]; + } + + function getAvailableDependencies(originalDeps, fullNameList) { + var availableDeps = []; + each(originalDeps, function (dep) { + indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep); + }); + return availableDeps; + } } function inheritDefaultOption(superOption, subOption) { - // See also `model/Component.ts#getDefaultOption` - return merge(merge({}, superOption, true), subOption, true); + // See also `model/Component.ts#getDefaultOption` + return merge(merge({}, superOption, true), subOption, true); } /* @@ -16183,113 +16183,113 @@ * Language: English. */ var langEN = { - time: { - month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - monthAbbr: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], - dayOfWeek: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], - dayOfWeekAbbr: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] + time: { + month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + monthAbbr: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + dayOfWeek: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + dayOfWeekAbbr: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] + }, + legend: { + selector: { + all: 'All', + inverse: 'Inv' + } + }, + toolbox: { + brush: { + title: { + rect: 'Box Select', + polygon: 'Lasso Select', + lineX: 'Horizontally Select', + lineY: 'Vertically Select', + keep: 'Keep Selections', + clear: 'Clear Selections' + } }, - legend: { - selector: { - all: 'All', - inverse: 'Inv' - } + dataView: { + title: 'Data View', + lang: ['Data View', 'Close', 'Refresh'] }, - toolbox: { - brush: { - title: { - rect: 'Box Select', - polygon: 'Lasso Select', - lineX: 'Horizontally Select', - lineY: 'Vertically Select', - keep: 'Keep Selections', - clear: 'Clear Selections' - } - }, - dataView: { - title: 'Data View', - lang: ['Data View', 'Close', 'Refresh'] - }, - dataZoom: { - title: { - zoom: 'Zoom', - back: 'Zoom Reset' - } - }, - magicType: { - title: { - line: 'Switch to Line Chart', - bar: 'Switch to Bar Chart', - stack: 'Stack', - tiled: 'Tile' - } - }, - restore: { - title: 'Restore' - }, - saveAsImage: { - title: 'Save as Image', - lang: ['Right Click to Save Image'] - } + dataZoom: { + title: { + zoom: 'Zoom', + back: 'Zoom Reset' + } + }, + magicType: { + title: { + line: 'Switch to Line Chart', + bar: 'Switch to Bar Chart', + stack: 'Stack', + tiled: 'Tile' + } + }, + restore: { + title: 'Restore' + }, + saveAsImage: { + title: 'Save as Image', + lang: ['Right Click to Save Image'] + } + }, + series: { + typeNames: { + pie: 'Pie chart', + bar: 'Bar chart', + line: 'Line chart', + scatter: 'Scatter plot', + effectScatter: 'Ripple scatter plot', + radar: 'Radar chart', + tree: 'Tree', + treemap: 'Treemap', + boxplot: 'Boxplot', + candlestick: 'Candlestick', + k: 'K line chart', + heatmap: 'Heat map', + map: 'Map', + parallel: 'Parallel coordinate map', + lines: 'Line graph', + graph: 'Relationship graph', + sankey: 'Sankey diagram', + funnel: 'Funnel chart', + gauge: 'Gauge', + pictorialBar: 'Pictorial bar', + themeRiver: 'Theme River Map', + sunburst: 'Sunburst' + } + }, + aria: { + general: { + withTitle: 'This is a chart about "{title}"', + withoutTitle: 'This is a chart' }, series: { - typeNames: { - pie: 'Pie chart', - bar: 'Bar chart', - line: 'Line chart', - scatter: 'Scatter plot', - effectScatter: 'Ripple scatter plot', - radar: 'Radar chart', - tree: 'Tree', - treemap: 'Treemap', - boxplot: 'Boxplot', - candlestick: 'Candlestick', - k: 'K line chart', - heatmap: 'Heat map', - map: 'Map', - parallel: 'Parallel coordinate map', - lines: 'Line graph', - graph: 'Relationship graph', - sankey: 'Sankey diagram', - funnel: 'Funnel chart', - gauge: 'Gauge', - pictorialBar: 'Pictorial bar', - themeRiver: 'Theme River Map', - sunburst: 'Sunburst' - } + single: { + prefix: '', + withName: ' with type {seriesType} named {seriesName}.', + withoutName: ' with type {seriesType}.' + }, + multiple: { + prefix: '. It consists of {seriesCount} series count.', + withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.', + withoutName: ' The {seriesId} series is a {seriesType}.', + separator: { + middle: '', + end: '' + } + } }, - aria: { - general: { - withTitle: 'This is a chart about "{title}"', - withoutTitle: 'This is a chart' - }, - series: { - single: { - prefix: '', - withName: ' with type {seriesType} named {seriesName}.', - withoutName: ' with type {seriesType}.' - }, - multiple: { - prefix: '. It consists of {seriesCount} series count.', - withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.', - withoutName: ' The {seriesId} series is a {seriesType}.', - separator: { - middle: '', - end: '' - } - } - }, - data: { - allData: 'The data is as follows: ', - partialData: 'The first {displayCnt} items are: ', - withName: 'the data for {name} is {value}', - withoutName: '{value}', - separator: { - middle: ', ', - end: '. ' - } - } - } + data: { + allData: 'The data is as follows: ', + partialData: 'The first {displayCnt} items are: ', + withName: 'the data for {name} is {value}', + withoutName: '{value}', + separator: { + middle: ', ', + end: '. ' + } + } + } }; /* @@ -16335,113 +16335,113 @@ * under the License. */ var langZH = { - time: { - month: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], - monthAbbr: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], - dayOfWeek: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], - dayOfWeekAbbr: ['日', '一', '二', '三', '四', '五', '六'] + time: { + month: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], + monthAbbr: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], + dayOfWeek: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], + dayOfWeekAbbr: ['日', '一', '二', '三', '四', '五', '六'] + }, + legend: { + selector: { + all: '全选', + inverse: '反选' + } + }, + toolbox: { + brush: { + title: { + rect: '矩形选择', + polygon: '圈选', + lineX: '横向选择', + lineY: '纵向选择', + keep: '保持选择', + clear: '清除选择' + } }, - legend: { - selector: { - all: '全选', - inverse: '反选' - } + dataView: { + title: '数据视图', + lang: ['数据视图', '关闭', '刷新'] }, - 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: ['右键另存为图片'] - } + 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: { - 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: '旭日图' - } + single: { + prefix: '', + withName: '图表类型是{seriesType},表示{seriesName}。', + withoutName: '图表类型是{seriesType}。' + }, + multiple: { + prefix: '它由{seriesCount}个图表系列组成。', + withName: '第{seriesId}个系列是一个表示{seriesName}的{seriesType},', + withoutName: '第{seriesId}个系列是一个{seriesType},', + separator: { + middle: ';', + end: '。' + } + } }, - 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: '' - } - } - } + data: { + allData: '其数据是——', + partialData: '其中,前{displayCnt}项是——', + withName: '{name}的数据是{value}', + withoutName: '{value}', + separator: { + middle: ',', + end: '' + } + } + } }; var LOCALE_ZH = 'ZH'; @@ -16450,37 +16450,37 @@ var localeStorage = {}; var localeModels = {}; var SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : function () { - var langStr = ( - /* eslint-disable-next-line */ - document.documentElement.lang || navigator.language || navigator.browserLanguage).toUpperCase(); - return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE; + var langStr = ( + /* eslint-disable-next-line */ + document.documentElement.lang || navigator.language || navigator.browserLanguage).toUpperCase(); + return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE; }(); function registerLocale(locale, localeObj) { - locale = locale.toUpperCase(); - localeModels[locale] = new Model(localeObj); - localeStorage[locale] = localeObj; + locale = locale.toUpperCase(); + localeModels[locale] = new Model(localeObj); + localeStorage[locale] = localeObj; } // export function getLocale(locale: string) { // return localeStorage[locale]; // } function createLocaleObject(locale) { - if (isString(locale)) { - var localeObj = localeStorage[locale.toUpperCase()] || {}; + if (isString(locale)) { + var localeObj = localeStorage[locale.toUpperCase()] || {}; - if (locale === LOCALE_ZH || locale === LOCALE_EN) { - return clone(localeObj); - } else { - return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false); - } + if (locale === LOCALE_ZH || locale === LOCALE_EN) { + return clone(localeObj); } else { - return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false); + return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false); } + } else { + return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false); + } } function getLocaleModel(lang) { - return localeModels[lang]; + return localeModels[lang]; } function getDefaultLocaleModel() { - return localeModels[DEFAULT_LOCALE]; + return localeModels[DEFAULT_LOCALE]; } // Default locale registerLocale(LOCALE_EN, langEN); @@ -16492,262 +16492,262 @@ var ONE_DAY = ONE_HOUR * 24; var ONE_YEAR = ONE_DAY * 365; var defaultLeveledFormatter = { - year: '{yyyy}', - month: '{MMM}', - day: '{d}', - hour: '{HH}:{mm}', - minute: '{HH}:{mm}', - second: '{HH}:{mm}:{ss}', - millisecond: '{HH}:{mm}:{ss} {SSS}', - none: '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}' + year: '{yyyy}', + month: '{MMM}', + day: '{d}', + hour: '{HH}:{mm}', + minute: '{HH}:{mm}', + second: '{HH}:{mm}:{ss}', + millisecond: '{HH}:{mm}:{ss} {SSS}', + none: '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}' }; var fullDayFormatter = '{yyyy}-{MM}-{dd}'; var fullLeveledFormatter = { - year: '{yyyy}', - month: '{yyyy}-{MM}', - day: fullDayFormatter, - hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour, - minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute, - second: fullDayFormatter + ' ' + defaultLeveledFormatter.second, - millisecond: defaultLeveledFormatter.none + year: '{yyyy}', + month: '{yyyy}-{MM}', + day: fullDayFormatter, + hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour, + minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute, + second: fullDayFormatter + ' ' + defaultLeveledFormatter.second, + millisecond: defaultLeveledFormatter.none }; var primaryTimeUnits = ['year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond']; var timeUnits = ['year', 'half-year', 'quarter', 'month', 'week', 'half-week', 'day', 'half-day', 'quarter-day', 'hour', 'minute', 'second', 'millisecond']; function pad(str, len) { - str += ''; - return '0000'.substr(0, len - str.length) + str; + str += ''; + return '0000'.substr(0, len - str.length) + str; } function getPrimaryTimeUnit(timeUnit) { - switch (timeUnit) { - case 'half-year': - case 'quarter': - return 'month'; + switch (timeUnit) { + case 'half-year': + case 'quarter': + return 'month'; - case 'week': - case 'half-week': - return 'day'; + case 'week': + case 'half-week': + return 'day'; - case 'half-day': - case 'quarter-day': - return 'hour'; + case 'half-day': + case 'quarter-day': + return 'hour'; - default: - // year, minutes, second, milliseconds - return timeUnit; - } + default: + // year, minutes, second, milliseconds + return timeUnit; + } } function isPrimaryTimeUnit(timeUnit) { - return timeUnit === getPrimaryTimeUnit(timeUnit); + return timeUnit === getPrimaryTimeUnit(timeUnit); } function getDefaultFormatPrecisionOfInterval(timeUnit) { - switch (timeUnit) { - case 'year': - case 'month': - return 'day'; + switch (timeUnit) { + case 'year': + case 'month': + return 'day'; - case 'millisecond': - return 'millisecond'; + case 'millisecond': + return 'millisecond'; - default: - // Also for day, hour, minute, second - return 'second'; - } + default: + // Also for day, hour, minute, second + return 'second'; + } } function format( // Note: The result based on `isUTC` are totally different, which can not be just simply - // substituted by the result without `isUTC`. So we make the param `isUTC` mandatory. - time, template, isUTC, lang) { - var date = parseDate(time); - var y = date[fullYearGetterName(isUTC)](); - var M = date[monthGetterName(isUTC)]() + 1; - var q = Math.floor((M - 1) / 4) + 1; - var d = date[dateGetterName(isUTC)](); - var e = date['get' + (isUTC ? 'UTC' : '') + 'Day'](); - var H = date[hoursGetterName(isUTC)](); - var h = (H - 1) % 12 + 1; - var m = date[minutesGetterName(isUTC)](); - var s = date[secondsGetterName(isUTC)](); - var S = date[millisecondsGetterName(isUTC)](); - var localeModel = lang instanceof Model ? lang : getLocaleModel(lang || SYSTEM_LANG) || getDefaultLocaleModel(); - var timeModel = localeModel.getModel('time'); - var month = timeModel.get('month'); - var monthAbbr = timeModel.get('monthAbbr'); - var dayOfWeek = timeModel.get('dayOfWeek'); - var dayOfWeekAbbr = timeModel.get('dayOfWeekAbbr'); - return (template || '').replace(/{yyyy}/g, y + '').replace(/{yy}/g, y % 100 + '').replace(/{Q}/g, q + '').replace(/{MMMM}/g, month[M - 1]).replace(/{MMM}/g, monthAbbr[M - 1]).replace(/{MM}/g, pad(M, 2)).replace(/{M}/g, M + '').replace(/{dd}/g, pad(d, 2)).replace(/{d}/g, d + '').replace(/{eeee}/g, dayOfWeek[e]).replace(/{ee}/g, dayOfWeekAbbr[e]).replace(/{e}/g, e + '').replace(/{HH}/g, pad(H, 2)).replace(/{H}/g, H + '').replace(/{hh}/g, pad(h + '', 2)).replace(/{h}/g, h + '').replace(/{mm}/g, pad(m, 2)).replace(/{m}/g, m + '').replace(/{ss}/g, pad(s, 2)).replace(/{s}/g, s + '').replace(/{SSS}/g, pad(S, 3)).replace(/{S}/g, S + ''); + // substituted by the result without `isUTC`. So we make the param `isUTC` mandatory. + time, template, isUTC, lang) { + var date = parseDate(time); + var y = date[fullYearGetterName(isUTC)](); + var M = date[monthGetterName(isUTC)]() + 1; + var q = Math.floor((M - 1) / 4) + 1; + var d = date[dateGetterName(isUTC)](); + var e = date['get' + (isUTC ? 'UTC' : '') + 'Day'](); + var H = date[hoursGetterName(isUTC)](); + var h = (H - 1) % 12 + 1; + var m = date[minutesGetterName(isUTC)](); + var s = date[secondsGetterName(isUTC)](); + var S = date[millisecondsGetterName(isUTC)](); + var localeModel = lang instanceof Model ? lang : getLocaleModel(lang || SYSTEM_LANG) || getDefaultLocaleModel(); + var timeModel = localeModel.getModel('time'); + var month = timeModel.get('month'); + var monthAbbr = timeModel.get('monthAbbr'); + var dayOfWeek = timeModel.get('dayOfWeek'); + var dayOfWeekAbbr = timeModel.get('dayOfWeekAbbr'); + return (template || '').replace(/{yyyy}/g, y + '').replace(/{yy}/g, y % 100 + '').replace(/{Q}/g, q + '').replace(/{MMMM}/g, month[M - 1]).replace(/{MMM}/g, monthAbbr[M - 1]).replace(/{MM}/g, pad(M, 2)).replace(/{M}/g, M + '').replace(/{dd}/g, pad(d, 2)).replace(/{d}/g, d + '').replace(/{eeee}/g, dayOfWeek[e]).replace(/{ee}/g, dayOfWeekAbbr[e]).replace(/{e}/g, e + '').replace(/{HH}/g, pad(H, 2)).replace(/{H}/g, H + '').replace(/{hh}/g, pad(h + '', 2)).replace(/{h}/g, h + '').replace(/{mm}/g, pad(m, 2)).replace(/{m}/g, m + '').replace(/{ss}/g, pad(s, 2)).replace(/{s}/g, s + '').replace(/{SSS}/g, pad(S, 3)).replace(/{S}/g, S + ''); } function leveledFormat(tick, idx, formatter, lang, isUTC) { - var template = null; + var template = null; + + if (isString(formatter)) { + // Single formatter for all units at all levels + template = formatter; + } else if (isFunction(formatter)) { + // Callback formatter + template = formatter(tick.value, idx, { + level: tick.level + }); + } else { + var defaults$1 = extend({}, defaultLeveledFormatter); - if (isString(formatter)) { - // Single formatter for all units at all levels - template = formatter; - } else if (isFunction(formatter)) { - // Callback formatter - template = formatter(tick.value, idx, { - level: tick.level - }); - } else { - var defaults$1 = extend({}, defaultLeveledFormatter); + if (tick.level > 0) { + for (var i = 0; i < primaryTimeUnits.length; ++i) { + defaults$1[primaryTimeUnits[i]] = "{primary|" + defaults$1[primaryTimeUnits[i]] + "}"; + } + } - if (tick.level > 0) { - for (var i = 0; i < primaryTimeUnits.length; ++i) { - defaults$1[primaryTimeUnits[i]] = "{primary|" + defaults$1[primaryTimeUnits[i]] + "}"; - } - } + var mergedFormatter = formatter ? formatter.inherit === false ? formatter // Use formatter with bigger units + : defaults(formatter, defaults$1) : defaults$1; + var unit = getUnitFromValue(tick.value, isUTC); - var mergedFormatter = formatter ? formatter.inherit === false ? formatter // Use formatter with bigger units - : defaults(formatter, defaults$1) : defaults$1; - var unit = getUnitFromValue(tick.value, isUTC); + if (mergedFormatter[unit]) { + template = mergedFormatter[unit]; + } else if (mergedFormatter.inherit) { + // Unit formatter is not defined and should inherit from bigger units + var targetId = timeUnits.indexOf(unit); + for (var i = targetId - 1; i >= 0; --i) { if (mergedFormatter[unit]) { - template = mergedFormatter[unit]; - } else if (mergedFormatter.inherit) { - // Unit formatter is not defined and should inherit from bigger units - var targetId = timeUnits.indexOf(unit); - - for (var i = targetId - 1; i >= 0; --i) { - if (mergedFormatter[unit]) { - template = mergedFormatter[unit]; - break; - } - } - - template = template || defaults$1.none; + template = mergedFormatter[unit]; + break; } + } - if (isArray(template)) { - var levelId = tick.level == null ? 0 : tick.level >= 0 ? tick.level : template.length + tick.level; - levelId = Math.min(levelId, template.length - 1); - template = template[levelId]; - } + template = template || defaults$1.none; + } + + if (isArray(template)) { + var levelId = tick.level == null ? 0 : tick.level >= 0 ? tick.level : template.length + tick.level; + levelId = Math.min(levelId, template.length - 1); + template = template[levelId]; } + } - return format(new Date(tick.value), template, isUTC, lang); + return format(new Date(tick.value), template, isUTC, lang); } function getUnitFromValue(value, isUTC) { - var date = parseDate(value); - var M = date[monthGetterName(isUTC)]() + 1; - var d = date[dateGetterName(isUTC)](); - var h = date[hoursGetterName(isUTC)](); - var m = date[minutesGetterName(isUTC)](); - var s = date[secondsGetterName(isUTC)](); - var S = date[millisecondsGetterName(isUTC)](); - var isSecond = S === 0; - var isMinute = isSecond && s === 0; - var isHour = isMinute && m === 0; - var isDay = isHour && h === 0; - var isMonth = isDay && d === 1; - var isYear = isMonth && M === 1; - - if (isYear) { - return 'year'; - } else if (isMonth) { - return 'month'; - } else if (isDay) { - return 'day'; - } else if (isHour) { - return 'hour'; - } else if (isMinute) { - return 'minute'; - } else if (isSecond) { - return 'second'; - } else { - return 'millisecond'; - } + var date = parseDate(value); + var M = date[monthGetterName(isUTC)]() + 1; + var d = date[dateGetterName(isUTC)](); + var h = date[hoursGetterName(isUTC)](); + var m = date[minutesGetterName(isUTC)](); + var s = date[secondsGetterName(isUTC)](); + var S = date[millisecondsGetterName(isUTC)](); + var isSecond = S === 0; + var isMinute = isSecond && s === 0; + var isHour = isMinute && m === 0; + var isDay = isHour && h === 0; + var isMonth = isDay && d === 1; + var isYear = isMonth && M === 1; + + if (isYear) { + return 'year'; + } else if (isMonth) { + return 'month'; + } else if (isDay) { + return 'day'; + } else if (isHour) { + return 'hour'; + } else if (isMinute) { + return 'minute'; + } else if (isSecond) { + return 'second'; + } else { + return 'millisecond'; + } } function getUnitValue(value, unit, isUTC) { - var date = isNumber(value) ? parseDate(value) : value; - unit = unit || getUnitFromValue(value, isUTC); + var date = isNumber(value) ? parseDate(value) : value; + unit = unit || getUnitFromValue(value, isUTC); - switch (unit) { - case 'year': - return date[fullYearGetterName(isUTC)](); + switch (unit) { + case 'year': + return date[fullYearGetterName(isUTC)](); - case 'half-year': - return date[monthGetterName(isUTC)]() >= 6 ? 1 : 0; + case 'half-year': + return date[monthGetterName(isUTC)]() >= 6 ? 1 : 0; - case 'quarter': - return Math.floor((date[monthGetterName(isUTC)]() + 1) / 4); + case 'quarter': + return Math.floor((date[monthGetterName(isUTC)]() + 1) / 4); - case 'month': - return date[monthGetterName(isUTC)](); + case 'month': + return date[monthGetterName(isUTC)](); - case 'day': - return date[dateGetterName(isUTC)](); + case 'day': + return date[dateGetterName(isUTC)](); - case 'half-day': - return date[hoursGetterName(isUTC)]() / 24; + case 'half-day': + return date[hoursGetterName(isUTC)]() / 24; - case 'hour': - return date[hoursGetterName(isUTC)](); + case 'hour': + return date[hoursGetterName(isUTC)](); - case 'minute': - return date[minutesGetterName(isUTC)](); + case 'minute': + return date[minutesGetterName(isUTC)](); - case 'second': - return date[secondsGetterName(isUTC)](); + case 'second': + return date[secondsGetterName(isUTC)](); - case 'millisecond': - return date[millisecondsGetterName(isUTC)](); - } + case 'millisecond': + return date[millisecondsGetterName(isUTC)](); + } } function fullYearGetterName(isUTC) { - return isUTC ? 'getUTCFullYear' : 'getFullYear'; + return isUTC ? 'getUTCFullYear' : 'getFullYear'; } function monthGetterName(isUTC) { - return isUTC ? 'getUTCMonth' : 'getMonth'; + return isUTC ? 'getUTCMonth' : 'getMonth'; } function dateGetterName(isUTC) { - return isUTC ? 'getUTCDate' : 'getDate'; + return isUTC ? 'getUTCDate' : 'getDate'; } function hoursGetterName(isUTC) { - return isUTC ? 'getUTCHours' : 'getHours'; + return isUTC ? 'getUTCHours' : 'getHours'; } function minutesGetterName(isUTC) { - return isUTC ? 'getUTCMinutes' : 'getMinutes'; + return isUTC ? 'getUTCMinutes' : 'getMinutes'; } function secondsGetterName(isUTC) { - return isUTC ? 'getUTCSeconds' : 'getSeconds'; + return isUTC ? 'getUTCSeconds' : 'getSeconds'; } function millisecondsGetterName(isUTC) { - return isUTC ? 'getUTCMilliseconds' : 'getMilliseconds'; + return isUTC ? 'getUTCMilliseconds' : 'getMilliseconds'; } function fullYearSetterName(isUTC) { - return isUTC ? 'setUTCFullYear' : 'setFullYear'; + return isUTC ? 'setUTCFullYear' : 'setFullYear'; } function monthSetterName(isUTC) { - return isUTC ? 'setUTCMonth' : 'setMonth'; + return isUTC ? 'setUTCMonth' : 'setMonth'; } function dateSetterName(isUTC) { - return isUTC ? 'setUTCDate' : 'setDate'; + return isUTC ? 'setUTCDate' : 'setDate'; } function hoursSetterName(isUTC) { - return isUTC ? 'setUTCHours' : 'setHours'; + return isUTC ? 'setUTCHours' : 'setHours'; } function minutesSetterName(isUTC) { - return isUTC ? 'setUTCMinutes' : 'setMinutes'; + return isUTC ? 'setUTCMinutes' : 'setMinutes'; } function secondsSetterName(isUTC) { - return isUTC ? 'setUTCSeconds' : 'setSeconds'; + return isUTC ? 'setUTCSeconds' : 'setSeconds'; } function millisecondsSetterName(isUTC) { - return isUTC ? 'setUTCMilliseconds' : 'setMilliseconds'; + return isUTC ? 'setUTCMilliseconds' : 'setMilliseconds'; } function getTextRect(text, font, align, verticalAlign, padding, rich, truncate, lineHeight) { - var textEl = new ZRText({ - style: { - text: text, - font: font, - align: align, - verticalAlign: verticalAlign, - padding: padding, - rich: rich, - overflow: truncate ? 'truncate' : null, - lineHeight: lineHeight - } - }); - return textEl.getBoundingRect(); + var textEl = new ZRText({ + style: { + text: text, + font: font, + align: align, + verticalAlign: verticalAlign, + padding: padding, + rich: rich, + overflow: truncate ? 'truncate' : null, + lineHeight: lineHeight + } + }); + return textEl.getBoundingRect(); } /** @@ -16755,37 +16755,37 @@ */ function addCommas(x) { - if (!isNumeric(x)) { - return isString(x) ? x : '-'; - } + if (!isNumeric(x)) { + return isString(x) ? x : '-'; + } - var parts = (x + '').split('.'); - return parts[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,') + (parts.length > 1 ? '.' + parts[1] : ''); + var parts = (x + '').split('.'); + return parts[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,') + (parts.length > 1 ? '.' + parts[1] : ''); } function toCamelCase(str, upperCaseFirst) { - str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) { - return group1.toUpperCase(); - }); + str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) { + return group1.toUpperCase(); + }); - if (upperCaseFirst && str) { - str = str.charAt(0).toUpperCase() + str.slice(1); - } + if (upperCaseFirst && str) { + str = str.charAt(0).toUpperCase() + str.slice(1); + } - return str; + return str; } var normalizeCssArray$1 = normalizeCssArray; var replaceReg = /([&<>"'])/g; var replaceMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - '\'': ''' + '&': '&', + '<': '<', + '>': '>', + '"': '"', + '\'': ''' }; function encodeHTML(source) { - return source == null ? '' : (source + '').replace(replaceReg, function (str, c) { - return replaceMap[c]; - }); + return source == null ? '' : (source + '').replace(replaceReg, function (str, c) { + return replaceMap[c]; + }); } /** * Make value user readable for tooltip and label. @@ -16796,42 +16796,42 @@ */ function makeValueReadable(value, valueType, useUTC) { - var USER_READABLE_DEFUALT_TIME_PATTERN = '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}'; + var USER_READABLE_DEFUALT_TIME_PATTERN = '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}'; - function stringToUserReadable(str) { - return str && trim(str) ? str : '-'; - } + function stringToUserReadable(str) { + return str && trim(str) ? str : '-'; + } - function isNumberUserReadable(num) { - return !!(num != null && !isNaN(num) && isFinite(num)); - } + function isNumberUserReadable(num) { + return !!(num != null && !isNaN(num) && isFinite(num)); + } - var isTypeTime = valueType === 'time'; - var isValueDate = value instanceof Date; + var isTypeTime = valueType === 'time'; + var isValueDate = value instanceof Date; - if (isTypeTime || isValueDate) { - var date = isTypeTime ? parseDate(value) : value; + if (isTypeTime || isValueDate) { + var date = isTypeTime ? parseDate(value) : value; - if (!isNaN(+date)) { - return format(date, USER_READABLE_DEFUALT_TIME_PATTERN, useUTC); - } else if (isValueDate) { - return '-'; - } // In other cases, continue to try to display the value in the following code. + if (!isNaN(+date)) { + return format(date, USER_READABLE_DEFUALT_TIME_PATTERN, useUTC); + } else if (isValueDate) { + return '-'; + } // In other cases, continue to try to display the value in the following code. - } + } - if (valueType === 'ordinal') { - return isStringSafe(value) ? stringToUserReadable(value) : isNumber(value) ? isNumberUserReadable(value) ? value + '' : '-' : '-'; - } // By default. + if (valueType === 'ordinal') { + return isStringSafe(value) ? stringToUserReadable(value) : isNumber(value) ? isNumberUserReadable(value) ? value + '' : '-' : '-'; + } // By default. - var numericResult = numericToNumber(value); - return isNumberUserReadable(numericResult) ? addCommas(numericResult) : isStringSafe(value) ? stringToUserReadable(value) : typeof value === 'boolean' ? value + '' : '-'; + var numericResult = numericToNumber(value); + return isNumberUserReadable(numericResult) ? addCommas(numericResult) : isStringSafe(value) ? stringToUserReadable(value) : typeof value === 'boolean' ? value + '' : '-'; } var TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g']; var wrapVar = function (varName, seriesIdx) { - return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}'; + return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}'; }; /** * Template formatter @@ -16840,81 +16840,81 @@ function formatTpl(tpl, paramsList, encode) { - if (!isArray(paramsList)) { - paramsList = [paramsList]; - } + if (!isArray(paramsList)) { + paramsList = [paramsList]; + } - var seriesLen = paramsList.length; + var seriesLen = paramsList.length; - if (!seriesLen) { - return ''; - } + if (!seriesLen) { + return ''; + } - var $vars = paramsList[0].$vars || []; + var $vars = paramsList[0].$vars || []; - for (var i = 0; i < $vars.length; i++) { - var alias = TPL_VAR_ALIAS[i]; - tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0)); - } + for (var i = 0; i < $vars.length; i++) { + var alias = TPL_VAR_ALIAS[i]; + tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0)); + } - for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) { - for (var k = 0; k < $vars.length; k++) { - var val = paramsList[seriesIdx][$vars[k]]; - tpl = tpl.replace(wrapVar(TPL_VAR_ALIAS[k], seriesIdx), encode ? encodeHTML(val) : val); - } + for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) { + for (var k = 0; k < $vars.length; k++) { + var val = paramsList[seriesIdx][$vars[k]]; + tpl = tpl.replace(wrapVar(TPL_VAR_ALIAS[k], seriesIdx), encode ? encodeHTML(val) : val); } + } - return tpl; + return tpl; } /** * simple Template formatter */ function formatTplSimple(tpl, param, encode) { - each(param, function (value, key) { - tpl = tpl.replace('{' + key + '}', encode ? encodeHTML(value) : value); - }); - return tpl; + each(param, function (value, key) { + tpl = tpl.replace('{' + key + '}', encode ? encodeHTML(value) : value); + }); + return tpl; } function getTooltipMarker(inOpt, extraCssText) { - var opt = isString(inOpt) ? { - color: inOpt, - extraCssText: extraCssText - } : inOpt || {}; - var color = opt.color; - var type = opt.type; - extraCssText = opt.extraCssText; - var renderMode = opt.renderMode || 'html'; - - if (!color) { - return ''; - } - - if (renderMode === 'html') { - return type === 'subItem' ? '' : ''; - } else { - // Should better not to auto generate style name by auto-increment number here. - // Because this util is usually called in tooltip formatter, which is probably - // called repeatly when mouse move and the auto-increment number increases fast. - // Users can make their own style name by theirselves, make it unique and readable. - var markerId = opt.markerId || 'markerX'; - return { - renderMode: renderMode, - content: '{' + markerId + '|} ', - style: type === 'subItem' ? { - width: 4, - height: 4, - borderRadius: 2, - backgroundColor: color - } : { - width: 10, - height: 10, - borderRadius: 5, - backgroundColor: color - } - }; - } + var opt = isString(inOpt) ? { + color: inOpt, + extraCssText: extraCssText + } : inOpt || {}; + var color = opt.color; + var type = opt.type; + extraCssText = opt.extraCssText; + var renderMode = opt.renderMode || 'html'; + + if (!color) { + return ''; + } + + if (renderMode === 'html') { + return type === 'subItem' ? '' : ''; + } else { + // Should better not to auto generate style name by auto-increment number here. + // Because this util is usually called in tooltip formatter, which is probably + // called repeatly when mouse move and the auto-increment number increases fast. + // Users can make their own style name by theirselves, make it unique and readable. + var markerId = opt.markerId || 'markerX'; + return { + renderMode: renderMode, + content: '{' + markerId + '|} ', + style: type === 'subItem' ? { + width: 4, + height: 4, + borderRadius: 2, + backgroundColor: color + } : { + width: 10, + height: 10, + borderRadius: 5, + backgroundColor: color + } + }; + } } /** * @deprecated Use `time/format` instead. @@ -16928,25 +16928,25 @@ */ function formatTime(tpl, value, isUTC) { - if ("development" !== 'production') { - deprecateReplaceLog('echarts.format.formatTime', 'echarts.time.format'); - } - - if (tpl === 'week' || tpl === 'month' || tpl === 'quarter' || tpl === 'half-year' || tpl === 'year') { - tpl = 'MM-dd\nyyyy'; - } - - var date = parseDate(value); - var getUTC = isUTC ? 'getUTC' : 'get'; - var y = date[getUTC + 'FullYear'](); - var M = date[getUTC + 'Month']() + 1; - var d = date[getUTC + 'Date'](); - var h = date[getUTC + 'Hours'](); - var m = date[getUTC + 'Minutes'](); - var s = date[getUTC + 'Seconds'](); - var S = date[getUTC + 'Milliseconds'](); - tpl = tpl.replace('MM', pad(M, 2)).replace('M', M).replace('yyyy', y).replace('yy', y % 100 + '').replace('dd', pad(d, 2)).replace('d', d).replace('hh', pad(h, 2)).replace('h', h).replace('mm', pad(m, 2)).replace('m', m).replace('ss', pad(s, 2)).replace('s', s).replace('SSS', pad(S, 3)); - return tpl; + if ("development" !== 'production') { + deprecateReplaceLog('echarts.format.formatTime', 'echarts.time.format'); + } + + if (tpl === 'week' || tpl === 'month' || tpl === 'quarter' || tpl === 'half-year' || tpl === 'year') { + tpl = 'MM-dd\nyyyy'; + } + + var date = parseDate(value); + var getUTC = isUTC ? 'getUTC' : 'get'; + var y = date[getUTC + 'FullYear'](); + var M = date[getUTC + 'Month']() + 1; + var d = date[getUTC + 'Date'](); + var h = date[getUTC + 'Hours'](); + var m = date[getUTC + 'Minutes'](); + var s = date[getUTC + 'Seconds'](); + var S = date[getUTC + 'Milliseconds'](); + tpl = tpl.replace('MM', pad(M, 2)).replace('M', M).replace('yyyy', y).replace('yy', y % 100 + '').replace('dd', pad(d, 2)).replace('d', d).replace('hh', pad(h, 2)).replace('h', h).replace('mm', pad(m, 2)).replace('m', m).replace('ss', pad(s, 2)).replace('s', s).replace('SSS', pad(S, 3)); + return tpl; } /** * Capital first @@ -16955,15 +16955,15 @@ */ function capitalFirst(str) { - return str ? str.charAt(0).toUpperCase() + str.substr(1) : str; + return str ? str.charAt(0).toUpperCase() + str.substr(1) : str; } /** * @return Never be null/undefined. */ function convertToColorString(color, defaultColor) { - defaultColor = defaultColor || 'transparent'; - return isString(color) ? color : isObject(color) ? color.colorStops && (color.colorStops[0] || {}).color || defaultColor : defaultColor; + defaultColor = defaultColor || 'transparent'; + return isString(color) ? color : isObject(color) ? color.colorStops && (color.colorStops[0] || {}).color || defaultColor : defaultColor; } /** * open new tab @@ -16972,14 +16972,14 @@ */ function windowOpen(link, target) { - /* global window */ - if (target === '_blank' || target === 'blank') { - var blank = window.open(); - blank.opener = null; - blank.location.href = link; - } else { - window.open(link, target); - } + /* global window */ + if (target === '_blank' || target === 'blank') { + var blank = window.open(); + blank.opener = null; + blank.location.href = link; + } else { + window.open(link, target); + } } var each$1 = each; @@ -16995,62 +16995,62 @@ var HV_NAMES = [['width', 'left', 'right'], ['height', 'top', 'bottom']]; function boxLayout(orient, group, gap, maxWidth, maxHeight) { - var x = 0; - var y = 0; + var x = 0; + var y = 0; + + if (maxWidth == null) { + maxWidth = Infinity; + } + + if (maxHeight == null) { + maxHeight = Infinity; + } + + var currentLineMaxSize = 0; + group.eachChild(function (child, idx) { + var rect = child.getBoundingRect(); + var nextChild = group.childAt(idx + 1); + var nextChildRect = nextChild && nextChild.getBoundingRect(); + var nextX; + var nextY; + + if (orient === 'horizontal') { + var moveX = rect.width + (nextChildRect ? -nextChildRect.x + rect.x : 0); + nextX = x + moveX; // Wrap when width exceeds maxWidth or meet a `newline` group + // FIXME compare before adding gap? + + if (nextX > maxWidth || child.newline) { + x = 0; + nextX = moveX; + y += currentLineMaxSize + gap; + currentLineMaxSize = rect.height; + } else { + // FIXME: consider rect.y is not `0`? + currentLineMaxSize = Math.max(currentLineMaxSize, rect.height); + } + } else { + var moveY = rect.height + (nextChildRect ? -nextChildRect.y + rect.y : 0); + nextY = y + moveY; // Wrap when width exceeds maxHeight or meet a `newline` group - if (maxWidth == null) { - maxWidth = Infinity; + if (nextY > maxHeight || child.newline) { + x += currentLineMaxSize + gap; + y = 0; + nextY = moveY; + currentLineMaxSize = rect.width; + } else { + currentLineMaxSize = Math.max(currentLineMaxSize, rect.width); + } } - if (maxHeight == null) { - maxHeight = Infinity; + if (child.newline) { + return; } - var currentLineMaxSize = 0; - group.eachChild(function (child, idx) { - var rect = child.getBoundingRect(); - var nextChild = group.childAt(idx + 1); - var nextChildRect = nextChild && nextChild.getBoundingRect(); - var nextX; - var nextY; - - if (orient === 'horizontal') { - var moveX = rect.width + (nextChildRect ? -nextChildRect.x + rect.x : 0); - nextX = x + moveX; // Wrap when width exceeds maxWidth or meet a `newline` group - // FIXME compare before adding gap? - - if (nextX > maxWidth || child.newline) { - x = 0; - nextX = moveX; - y += currentLineMaxSize + gap; - currentLineMaxSize = rect.height; - } else { - // FIXME: consider rect.y is not `0`? - currentLineMaxSize = Math.max(currentLineMaxSize, rect.height); - } - } else { - var moveY = rect.height + (nextChildRect ? -nextChildRect.y + rect.y : 0); - nextY = y + moveY; // Wrap when width exceeds maxHeight or meet a `newline` group - - if (nextY > maxHeight || child.newline) { - x += currentLineMaxSize + gap; - y = 0; - nextY = moveY; - currentLineMaxSize = rect.width; - } else { - currentLineMaxSize = Math.max(currentLineMaxSize, rect.width); - } - } - - if (child.newline) { - return; - } - - child.x = x; - child.y = y; - child.markRedraw(); - orient === 'horizontal' ? x = nextX + gap : y = nextY + gap; - }); + child.x = x; + child.y = y; + child.markRedraw(); + orient === 'horizontal' ? x = nextX + gap : y = nextY + gap; + }); } /** * VBox or HBox layouting @@ -17089,122 +17089,122 @@ */ function getAvailableSize(positionInfo, containerRect, margin) { - var containerWidth = containerRect.width; - var containerHeight = containerRect.height; - var x = parsePercent$1(positionInfo.left, containerWidth); - var y = parsePercent$1(positionInfo.top, containerHeight); - var x2 = parsePercent$1(positionInfo.right, containerWidth); - var y2 = parsePercent$1(positionInfo.bottom, containerHeight); - (isNaN(x) || isNaN(parseFloat(positionInfo.left))) && (x = 0); - (isNaN(x2) || isNaN(parseFloat(positionInfo.right))) && (x2 = containerWidth); - (isNaN(y) || isNaN(parseFloat(positionInfo.top))) && (y = 0); - (isNaN(y2) || isNaN(parseFloat(positionInfo.bottom))) && (y2 = containerHeight); - margin = normalizeCssArray$1(margin || 0); - return { - width: Math.max(x2 - x - margin[1] - margin[3], 0), - height: Math.max(y2 - y - margin[0] - margin[2], 0) - }; + var containerWidth = containerRect.width; + var containerHeight = containerRect.height; + var x = parsePercent$1(positionInfo.left, containerWidth); + var y = parsePercent$1(positionInfo.top, containerHeight); + var x2 = parsePercent$1(positionInfo.right, containerWidth); + var y2 = parsePercent$1(positionInfo.bottom, containerHeight); + (isNaN(x) || isNaN(parseFloat(positionInfo.left))) && (x = 0); + (isNaN(x2) || isNaN(parseFloat(positionInfo.right))) && (x2 = containerWidth); + (isNaN(y) || isNaN(parseFloat(positionInfo.top))) && (y = 0); + (isNaN(y2) || isNaN(parseFloat(positionInfo.bottom))) && (y2 = containerHeight); + margin = normalizeCssArray$1(margin || 0); + return { + width: Math.max(x2 - x - margin[1] - margin[3], 0), + height: Math.max(y2 - y - margin[0] - margin[2], 0) + }; } /** * Parse position info. */ function getLayoutRect(positionInfo, containerRect, margin) { - margin = normalizeCssArray$1(margin || 0); - var containerWidth = containerRect.width; - var containerHeight = containerRect.height; - var left = parsePercent$1(positionInfo.left, containerWidth); - var top = parsePercent$1(positionInfo.top, containerHeight); - var right = parsePercent$1(positionInfo.right, containerWidth); - var bottom = parsePercent$1(positionInfo.bottom, containerHeight); - var width = parsePercent$1(positionInfo.width, containerWidth); - var height = parsePercent$1(positionInfo.height, containerHeight); - var verticalMargin = margin[2] + margin[0]; - var horizontalMargin = margin[1] + margin[3]; - var aspect = positionInfo.aspect; // If width is not specified, calculate width from left and right + margin = normalizeCssArray$1(margin || 0); + var containerWidth = containerRect.width; + var containerHeight = containerRect.height; + var left = parsePercent$1(positionInfo.left, containerWidth); + var top = parsePercent$1(positionInfo.top, containerHeight); + var right = parsePercent$1(positionInfo.right, containerWidth); + var bottom = parsePercent$1(positionInfo.bottom, containerHeight); + var width = parsePercent$1(positionInfo.width, containerWidth); + var height = parsePercent$1(positionInfo.height, containerHeight); + var verticalMargin = margin[2] + margin[0]; + var horizontalMargin = margin[1] + margin[3]; + var aspect = positionInfo.aspect; // If width is not specified, calculate width from left and right + + if (isNaN(width)) { + width = containerWidth - right - horizontalMargin - left; + } + + if (isNaN(height)) { + height = containerHeight - bottom - verticalMargin - top; + } + + if (aspect != null) { + // If width and height are not given + // 1. Graph should not exceeds the container + // 2. Aspect must be keeped + // 3. Graph should take the space as more as possible + // FIXME + // Margin is not considered, because there is no case that both + // using margin and aspect so far. + if (isNaN(width) && isNaN(height)) { + if (aspect > containerWidth / containerHeight) { + width = containerWidth * 0.8; + } else { + height = containerHeight * 0.8; + } + } // Calculate width or height with given aspect + if (isNaN(width)) { - width = containerWidth - right - horizontalMargin - left; + width = aspect * height; } if (isNaN(height)) { - height = containerHeight - bottom - verticalMargin - top; + height = width / aspect; } - - if (aspect != null) { - // If width and height are not given - // 1. Graph should not exceeds the container - // 2. Aspect must be keeped - // 3. Graph should take the space as more as possible - // FIXME - // Margin is not considered, because there is no case that both - // using margin and aspect so far. - if (isNaN(width) && isNaN(height)) { - if (aspect > containerWidth / containerHeight) { - width = containerWidth * 0.8; - } else { - height = containerHeight * 0.8; - } - } // Calculate width or height with given aspect + } // If left is not specified, calculate left from right and width - if (isNaN(width)) { - width = aspect * height; - } + if (isNaN(left)) { + left = containerWidth - right - width - horizontalMargin; + } - if (isNaN(height)) { - height = width / aspect; - } - } // If left is not specified, calculate left from right and width + if (isNaN(top)) { + top = containerHeight - bottom - height - verticalMargin; + } // Align left and top - if (isNaN(left)) { - left = containerWidth - right - width - horizontalMargin; - } + switch (positionInfo.left || positionInfo.right) { + case 'center': + left = containerWidth / 2 - width / 2 - margin[3]; + break; - if (isNaN(top)) { - top = containerHeight - bottom - height - verticalMargin; - } // Align left and top + case 'right': + left = containerWidth - width - horizontalMargin; + break; + } + switch (positionInfo.top || positionInfo.bottom) { + case 'middle': + case 'center': + top = containerHeight / 2 - height / 2 - margin[0]; + break; - switch (positionInfo.left || positionInfo.right) { - case 'center': - left = containerWidth / 2 - width / 2 - margin[3]; - break; + case 'bottom': + top = containerHeight - height - verticalMargin; + break; + } // If something is wrong and left, top, width, height are calculated as NaN - case 'right': - left = containerWidth - width - horizontalMargin; - break; - } - - switch (positionInfo.top || positionInfo.bottom) { - case 'middle': - case 'center': - top = containerHeight / 2 - height / 2 - margin[0]; - break; - - case 'bottom': - top = containerHeight - height - verticalMargin; - break; - } // If something is wrong and left, top, width, height are calculated as NaN + left = left || 0; + top = top || 0; - left = left || 0; - top = top || 0; + if (isNaN(width)) { + // Width may be NaN if only one value is given except width + width = containerWidth - horizontalMargin - left - (right || 0); + } - if (isNaN(width)) { - // Width may be NaN if only one value is given except width - width = containerWidth - horizontalMargin - left - (right || 0); - } + if (isNaN(height)) { + // Height may be NaN if only one value is given except height + height = containerHeight - verticalMargin - top - (bottom || 0); + } - if (isNaN(height)) { - // Height may be NaN if only one value is given except height - height = containerHeight - verticalMargin - top - (bottom || 0); - } - - var rect = new BoundingRect(left + margin[3], top + margin[0], width, height); - rect.margin = margin; - return rect; + var rect = new BoundingRect(left + margin[3], top + margin[0], width, height); + rect.margin = margin; + return rect; } /** * Position a zr element in viewport @@ -17248,57 +17248,57 @@ */ function positionElement(el, positionInfo, containerRect, margin, opt, out) { - var h = !opt || !opt.hv || opt.hv[0]; - var v = !opt || !opt.hv || opt.hv[1]; - var boundingMode = opt && opt.boundingMode || 'all'; - out = out || el; - out.x = el.x; - out.y = el.y; - - if (!h && !v) { - return false; - } + var h = !opt || !opt.hv || opt.hv[0]; + var v = !opt || !opt.hv || opt.hv[1]; + var boundingMode = opt && opt.boundingMode || 'all'; + out = out || el; + out.x = el.x; + out.y = el.y; + + if (!h && !v) { + return false; + } - var rect; + var rect; - if (boundingMode === 'raw') { - rect = el.type === 'group' ? new BoundingRect(0, 0, +positionInfo.width || 0, +positionInfo.height || 0) : el.getBoundingRect(); - } else { - rect = el.getBoundingRect(); + if (boundingMode === 'raw') { + rect = el.type === 'group' ? new BoundingRect(0, 0, +positionInfo.width || 0, +positionInfo.height || 0) : el.getBoundingRect(); + } else { + rect = el.getBoundingRect(); - if (el.needLocalTransform()) { - var transform = el.getLocalTransform(); // Notice: raw rect may be inner object of el, - // which should not be modified. + if (el.needLocalTransform()) { + var transform = el.getLocalTransform(); // Notice: raw rect may be inner object of el, + // which should not be modified. - rect = rect.clone(); - rect.applyTransform(transform); - } - } // The real width and height can not be specified but calculated by the given el. + rect = rect.clone(); + rect.applyTransform(transform); + } + } // The real width and height can not be specified but calculated by the given el. - var layoutRect = getLayoutRect(defaults({ - width: rect.width, - height: rect.height - }, positionInfo), containerRect, margin); // Because 'tranlate' is the last step in transform - // (see zrender/core/Transformable#getLocalTransform), - // we can just only modify el.position to get final result. - - var dx = h ? layoutRect.x - rect.x : 0; - var dy = v ? layoutRect.y - rect.y : 0; - - if (boundingMode === 'raw') { - out.x = dx; - out.y = dy; - } else { - out.x += dx; - out.y += dy; - } + var layoutRect = getLayoutRect(defaults({ + width: rect.width, + height: rect.height + }, positionInfo), containerRect, margin); // Because 'tranlate' is the last step in transform + // (see zrender/core/Transformable#getLocalTransform), + // we can just only modify el.position to get final result. - if (out === el) { - el.markRedraw(); - } + var dx = h ? layoutRect.x - rect.x : 0; + var dy = v ? layoutRect.y - rect.y : 0; - return true; + if (boundingMode === 'raw') { + out.x = dx; + out.y = dy; + } else { + out.x += dx; + out.y += dy; + } + + if (out === el) { + el.markRedraw(); + } + + return true; } /** * @param option Contains some of the properties in HV_NAMES. @@ -17306,13 +17306,13 @@ */ function sizeCalculable(option, hvIdx) { - return option[HV_NAMES[hvIdx][0]] != null || option[HV_NAMES[hvIdx][1]] != null && option[HV_NAMES[hvIdx][2]] != null; + return option[HV_NAMES[hvIdx][0]] != null || option[HV_NAMES[hvIdx][1]] != null && option[HV_NAMES[hvIdx][2]] != null; } function fetchLayoutMode(ins) { - var layoutMode = ins.layoutMode || ins.constructor.layoutMode; - return isObject(layoutMode) ? layoutMode : layoutMode ? { - type: layoutMode - } : null; + var layoutMode = ins.layoutMode || ins.constructor.layoutMode; + return isObject(layoutMode) ? layoutMode : layoutMode ? { + type: layoutMode + } : null; } /** * Consider Case: @@ -17339,87 +17339,87 @@ */ function mergeLayoutParam(targetOption, newOption, opt) { - var ignoreSize = opt && opt.ignoreSize; - !isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]); - var hResult = merge(HV_NAMES[0], 0); - var vResult = merge(HV_NAMES[1], 1); - copy(HV_NAMES[0], targetOption, hResult); - copy(HV_NAMES[1], targetOption, vResult); - - function merge(names, hvIdx) { - var newParams = {}; - var newValueCount = 0; - var merged = {}; - var mergedValueCount = 0; - var enoughParamNumber = 2; - each$1(names, function (name) { - merged[name] = targetOption[name]; - }); - each$1(names, function (name) { - // Consider case: newOption.width is null, which is - // set by user for removing width setting. - hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]); - hasValue(newParams, name) && newValueCount++; - hasValue(merged, name) && mergedValueCount++; - }); - - if (ignoreSize[hvIdx]) { - // Only one of left/right is premitted to exist. - if (hasValue(newOption, names[1])) { - merged[names[2]] = null; - } else if (hasValue(newOption, names[2])) { - merged[names[1]] = null; - } - - return merged; - } // Case: newOption: {width: ..., right: ...}, - // or targetOption: {right: ...} and newOption: {width: ...}, - // There is no conflict when merged only has params count - // little than enoughParamNumber. - - - if (mergedValueCount === enoughParamNumber || !newValueCount) { - return merged; - } // Case: newOption: {width: ..., right: ...}, - // Than we can make sure user only want those two, and ignore - // all origin params in targetOption. - else if (newValueCount >= enoughParamNumber) { - return newParams; - } else { - // Chose another param from targetOption by priority. - for (var i = 0; i < names.length; i++) { - var name_1 = names[i]; - - if (!hasProp(newParams, name_1) && hasProp(targetOption, name_1)) { - newParams[name_1] = targetOption[name_1]; - break; - } - } + var ignoreSize = opt && opt.ignoreSize; + !isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]); + var hResult = merge(HV_NAMES[0], 0); + var vResult = merge(HV_NAMES[1], 1); + copy(HV_NAMES[0], targetOption, hResult); + copy(HV_NAMES[1], targetOption, vResult); + + function merge(names, hvIdx) { + var newParams = {}; + var newValueCount = 0; + var merged = {}; + var mergedValueCount = 0; + var enoughParamNumber = 2; + each$1(names, function (name) { + merged[name] = targetOption[name]; + }); + each$1(names, function (name) { + // Consider case: newOption.width is null, which is + // set by user for removing width setting. + hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]); + hasValue(newParams, name) && newValueCount++; + hasValue(merged, name) && mergedValueCount++; + }); - return newParams; + if (ignoreSize[hvIdx]) { + // Only one of left/right is premitted to exist. + if (hasValue(newOption, names[1])) { + merged[names[2]] = null; + } else if (hasValue(newOption, names[2])) { + merged[names[1]] = null; + } + + return merged; + } // Case: newOption: {width: ..., right: ...}, + // or targetOption: {right: ...} and newOption: {width: ...}, + // There is no conflict when merged only has params count + // little than enoughParamNumber. + + + if (mergedValueCount === enoughParamNumber || !newValueCount) { + return merged; + } // Case: newOption: {width: ..., right: ...}, + // Than we can make sure user only want those two, and ignore + // all origin params in targetOption. + else if (newValueCount >= enoughParamNumber) { + return newParams; + } else { + // Chose another param from targetOption by priority. + for (var i = 0; i < names.length; i++) { + var name_1 = names[i]; + + if (!hasProp(newParams, name_1) && hasProp(targetOption, name_1)) { + newParams[name_1] = targetOption[name_1]; + break; + } } - } - function hasProp(obj, name) { - return obj.hasOwnProperty(name); - } + return newParams; + } + } - function hasValue(obj, name) { - return obj[name] != null && obj[name] !== 'auto'; - } + function hasProp(obj, name) { + return obj.hasOwnProperty(name); + } - function copy(names, target, source) { - each$1(names, function (name) { - target[name] = source[name]; - }); - } + function hasValue(obj, name) { + return obj[name] != null && obj[name] !== 'auto'; + } + + function copy(names, target, source) { + each$1(names, function (name) { + target[name] = source[name]; + }); + } } /** * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object. */ function getLayoutParams(source) { - return copyLayoutParams({}, source); + return copyLayoutParams({}, source); } /** * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object. @@ -17428,204 +17428,204 @@ */ function copyLayoutParams(target, source) { - source && target && each$1(LOCATION_PARAMS, function (name) { - source.hasOwnProperty(name) && (target[name] = source[name]); - }); - return target; + source && target && each$1(LOCATION_PARAMS, function (name) { + source.hasOwnProperty(name) && (target[name] = source[name]); + }); + return target; } var inner = makeInner(); var ComponentModel = - /** @class */ - function (_super) { - __extends(ComponentModel, _super); + /** @class */ + function (_super) { + __extends(ComponentModel, _super); - function ComponentModel(option, parentModel, ecModel) { - var _this = _super.call(this, option, parentModel, ecModel) || this; + function ComponentModel(option, parentModel, ecModel) { + var _this = _super.call(this, option, parentModel, ecModel) || this; - _this.uid = getUID('ec_cpt_model'); - return _this; - } + _this.uid = getUID('ec_cpt_model'); + return _this; + } - ComponentModel.prototype.init = function (option, parentModel, ecModel) { - this.mergeDefaultAndTheme(option, ecModel); - }; + ComponentModel.prototype.init = function (option, parentModel, ecModel) { + this.mergeDefaultAndTheme(option, ecModel); + }; - ComponentModel.prototype.mergeDefaultAndTheme = function (option, ecModel) { - var layoutMode = fetchLayoutMode(this); - var inputPositionParams = layoutMode ? getLayoutParams(option) : {}; - var themeModel = ecModel.getTheme(); - merge(option, themeModel.get(this.mainType)); - merge(option, this.getDefaultOption()); + ComponentModel.prototype.mergeDefaultAndTheme = function (option, ecModel) { + var layoutMode = fetchLayoutMode(this); + var inputPositionParams = layoutMode ? getLayoutParams(option) : {}; + var themeModel = ecModel.getTheme(); + merge(option, themeModel.get(this.mainType)); + merge(option, this.getDefaultOption()); - if (layoutMode) { - mergeLayoutParam(option, inputPositionParams, layoutMode); - } - }; + if (layoutMode) { + mergeLayoutParam(option, inputPositionParams, layoutMode); + } + }; - ComponentModel.prototype.mergeOption = function (option, ecModel) { - merge(this.option, option, true); - var layoutMode = fetchLayoutMode(this); + ComponentModel.prototype.mergeOption = function (option, ecModel) { + merge(this.option, option, true); + var layoutMode = fetchLayoutMode(this); - if (layoutMode) { - mergeLayoutParam(this.option, option, layoutMode); - } - }; - /** - * Called immediately after `init` or `mergeOption` of this instance called. - */ + if (layoutMode) { + mergeLayoutParam(this.option, option, layoutMode); + } + }; + /** + * Called immediately after `init` or `mergeOption` of this instance called. + */ - ComponentModel.prototype.optionUpdated = function (newCptOption, isInit) {}; - /** - * [How to declare defaultOption]: - * - * (A) If using class declaration in typescript (since echarts 5): - * ```ts - * import {ComponentOption} from '../model/option.js'; - * export interface XxxOption extends ComponentOption { - * aaa: number - * } - * export class XxxModel extends Component { - * static type = 'xxx'; - * static defaultOption: XxxOption = { - * aaa: 123 - * } - * } - * Component.registerClass(XxxModel); - * ``` - * ```ts - * import {inheritDefaultOption} from '../util/component.js'; - * import {XxxModel, XxxOption} from './XxxModel.js'; - * export interface XxxSubOption extends XxxOption { - * bbb: number - * } - * class XxxSubModel extends XxxModel { - * static defaultOption: XxxSubOption = inheritDefaultOption(XxxModel.defaultOption, { - * bbb: 456 - * }) - * fn() { - * let opt = this.getDefaultOption(); - * // opt is {aaa: 123, bbb: 456} - * } - * } - * ``` - * - * (B) If using class extend (previous approach in echarts 3 & 4): - * ```js - * let XxxComponent = Component.extend({ - * defaultOption: { - * xx: 123 - * } - * }) - * ``` - * ```js - * let XxxSubComponent = XxxComponent.extend({ - * defaultOption: { - * yy: 456 - * }, - * fn: function () { - * let opt = this.getDefaultOption(); - * // opt is {xx: 123, yy: 456} - * } - * }) - * ``` - */ + ComponentModel.prototype.optionUpdated = function (newCptOption, isInit) {}; + /** + * [How to declare defaultOption]: + * + * (A) If using class declaration in typescript (since echarts 5): + * ```ts + * import {ComponentOption} from '../model/option.js'; + * export interface XxxOption extends ComponentOption { + * aaa: number + * } + * export class XxxModel extends Component { + * static type = 'xxx'; + * static defaultOption: XxxOption = { + * aaa: 123 + * } + * } + * Component.registerClass(XxxModel); + * ``` + * ```ts + * import {inheritDefaultOption} from '../util/component.js'; + * import {XxxModel, XxxOption} from './XxxModel.js'; + * export interface XxxSubOption extends XxxOption { + * bbb: number + * } + * class XxxSubModel extends XxxModel { + * static defaultOption: XxxSubOption = inheritDefaultOption(XxxModel.defaultOption, { + * bbb: 456 + * }) + * fn() { + * let opt = this.getDefaultOption(); + * // opt is {aaa: 123, bbb: 456} + * } + * } + * ``` + * + * (B) If using class extend (previous approach in echarts 3 & 4): + * ```js + * let XxxComponent = Component.extend({ + * defaultOption: { + * xx: 123 + * } + * }) + * ``` + * ```js + * let XxxSubComponent = XxxComponent.extend({ + * defaultOption: { + * yy: 456 + * }, + * fn: function () { + * let opt = this.getDefaultOption(); + * // opt is {xx: 123, yy: 456} + * } + * }) + * ``` + */ - ComponentModel.prototype.getDefaultOption = function () { - var ctor = this.constructor; // If using class declaration, it is different to travel super class - // in legacy env and auto merge defaultOption. So if using class - // declaration, defaultOption should be merged manually. + ComponentModel.prototype.getDefaultOption = function () { + var ctor = this.constructor; // If using class declaration, it is different to travel super class + // in legacy env and auto merge defaultOption. So if using class + // declaration, defaultOption should be merged manually. - if (!isExtendedClass(ctor)) { - // When using ts class, defaultOption must be declared as static. - return ctor.defaultOption; - } // FIXME: remove this approach? + if (!isExtendedClass(ctor)) { + // When using ts class, defaultOption must be declared as static. + return ctor.defaultOption; + } // FIXME: remove this approach? - var fields = inner(this); + var fields = inner(this); - if (!fields.defaultOption) { - var optList = []; - var clz = ctor; + if (!fields.defaultOption) { + var optList = []; + var clz = ctor; - while (clz) { - var opt = clz.prototype.defaultOption; - opt && optList.push(opt); - clz = clz.superClass; - } + while (clz) { + var opt = clz.prototype.defaultOption; + opt && optList.push(opt); + clz = clz.superClass; + } - var defaultOption = {}; + var defaultOption = {}; - for (var i = optList.length - 1; i >= 0; i--) { - defaultOption = merge(defaultOption, optList[i], true); - } + for (var i = optList.length - 1; i >= 0; i--) { + defaultOption = merge(defaultOption, optList[i], true); + } - fields.defaultOption = defaultOption; - } + fields.defaultOption = defaultOption; + } - return fields.defaultOption; - }; - /** - * Notice: always force to input param `useDefault` in case that forget to consider it. - * The same behavior as `modelUtil.parseFinder`. - * - * @param useDefault In many cases like series refer axis and axis refer grid, - * If axis index / axis id not specified, use the first target as default. - * In other cases like dataZoom refer axis, if not specified, measn no refer. - */ + return fields.defaultOption; + }; + /** + * Notice: always force to input param `useDefault` in case that forget to consider it. + * The same behavior as `modelUtil.parseFinder`. + * + * @param useDefault In many cases like series refer axis and axis refer grid, + * If axis index / axis id not specified, use the first target as default. + * In other cases like dataZoom refer axis, if not specified, measn no refer. + */ - ComponentModel.prototype.getReferringComponents = function (mainType, opt) { - var indexKey = mainType + 'Index'; - var idKey = mainType + 'Id'; - return queryReferringComponents(this.ecModel, mainType, { - index: this.get(indexKey, true), - id: this.get(idKey, true) - }, opt); - }; + ComponentModel.prototype.getReferringComponents = function (mainType, opt) { + var indexKey = mainType + 'Index'; + var idKey = mainType + 'Id'; + return queryReferringComponents(this.ecModel, mainType, { + index: this.get(indexKey, true), + id: this.get(idKey, true) + }, opt); + }; - ComponentModel.prototype.getBoxLayoutParams = function () { - // Consider itself having box layout configs. - var boxLayoutModel = this; - return { - left: boxLayoutModel.get('left'), - top: boxLayoutModel.get('top'), - right: boxLayoutModel.get('right'), - bottom: boxLayoutModel.get('bottom'), - width: boxLayoutModel.get('width'), - height: boxLayoutModel.get('height') - }; - }; - /** - * Get key for zlevel. - * If developers don't configure zlevel. We will assign zlevel to series based on the key. - * For example, lines with trail effect and progressive series will in an individual zlevel. - */ + ComponentModel.prototype.getBoxLayoutParams = function () { + // Consider itself having box layout configs. + var boxLayoutModel = this; + return { + left: boxLayoutModel.get('left'), + top: boxLayoutModel.get('top'), + right: boxLayoutModel.get('right'), + bottom: boxLayoutModel.get('bottom'), + width: boxLayoutModel.get('width'), + height: boxLayoutModel.get('height') + }; + }; + /** + * Get key for zlevel. + * If developers don't configure zlevel. We will assign zlevel to series based on the key. + * For example, lines with trail effect and progressive series will in an individual zlevel. + */ - ComponentModel.prototype.getZLevelKey = function () { - return ''; - }; + ComponentModel.prototype.getZLevelKey = function () { + return ''; + }; - ComponentModel.prototype.setZLevel = function (zlevel) { - this.option.zlevel = zlevel; - }; + ComponentModel.prototype.setZLevel = function (zlevel) { + this.option.zlevel = zlevel; + }; - ComponentModel.protoInitialize = function () { - var proto = ComponentModel.prototype; - proto.type = 'component'; - proto.id = ''; - proto.name = ''; - proto.mainType = ''; - proto.subType = ''; - proto.componentIndex = 0; - }(); + ComponentModel.protoInitialize = function () { + var proto = ComponentModel.prototype; + proto.type = 'component'; + proto.id = ''; + proto.name = ''; + proto.mainType = ''; + proto.subType = ''; + proto.componentIndex = 0; + }(); - return ComponentModel; - }(Model); + return ComponentModel; + }(Model); mountExtend(ComponentModel, Model); enableClassManagement(ComponentModel); @@ -17633,20 +17633,20 @@ enableTopologicalTravel(ComponentModel, getDependencies); function getDependencies(componentType) { - var deps = []; - each(ComponentModel.getClassesByMainType(componentType), function (clz) { - deps = deps.concat(clz.dependencies || clz.prototype.dependencies || []); - }); // Ensure main type. + var deps = []; + each(ComponentModel.getClassesByMainType(componentType), function (clz) { + deps = deps.concat(clz.dependencies || clz.prototype.dependencies || []); + }); // Ensure main type. - deps = map(deps, function (type) { - return parseClassType(type).main; - }); // Hack dataset for convenience. + deps = map(deps, function (type) { + return parseClassType(type).main; + }); // Hack dataset for convenience. - if (componentType !== 'dataset' && indexOf(deps, 'dataset') <= 0) { - deps.unshift('dataset'); - } + if (componentType !== 'dataset' && indexOf(deps, 'dataset') <= 0) { + deps.unshift('dataset'); + } - return deps; + return deps; } /* @@ -17694,91 +17694,91 @@ var platform = ''; // Navigator not exists in node if (typeof navigator !== 'undefined') { - /* global navigator */ - platform = navigator.platform || ''; + /* global navigator */ + platform = navigator.platform || ''; } var decalColor = 'rgba(0, 0, 0, 0.2)'; var globalDefault = { - darkMode: 'auto', - // backgroundColor: 'rgba(0,0,0,0)', - colorBy: 'series', - color: ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'], - gradientColor: ['#f6efa6', '#d88273', '#bf444c'], - aria: { - decal: { - decals: [{ - color: decalColor, - dashArrayX: [1, 0], - dashArrayY: [2, 5], - symbolSize: 1, - rotation: Math.PI / 6 - }, { - color: decalColor, - symbol: 'circle', - dashArrayX: [[8, 8], [0, 8, 8, 0]], - dashArrayY: [6, 0], - symbolSize: 0.8 - }, { - color: decalColor, - dashArrayX: [1, 0], - dashArrayY: [4, 3], - rotation: -Math.PI / 4 - }, { - color: decalColor, - dashArrayX: [[6, 6], [0, 6, 6, 0]], - dashArrayY: [6, 0] - }, { - color: decalColor, - dashArrayX: [[1, 0], [1, 6]], - dashArrayY: [1, 0, 6, 0], - rotation: Math.PI / 4 - }, { - color: decalColor, - symbol: 'triangle', - dashArrayX: [[9, 9], [0, 9, 9, 0]], - dashArrayY: [7, 2], - symbolSize: 0.75 - }] - } - }, - // If xAxis and yAxis declared, grid is created by default. - // grid: {}, - textStyle: { - // color: '#000', - // decoration: 'none', - // PENDING - fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif', - // fontFamily: 'Arial, Verdana, sans-serif', - fontSize: 12, - fontStyle: 'normal', - fontWeight: 'normal' - }, - // http://blogs.adobe.com/webplatform/2014/02/24/using-blend-modes-in-html-canvas/ - // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation - // Default is source-over - blendMode: null, - stateAnimation: { - duration: 300, - easing: 'cubicOut' - }, - animation: 'auto', - animationDuration: 1000, - animationDurationUpdate: 500, - animationEasing: 'cubicInOut', - animationEasingUpdate: 'cubicInOut', - animationThreshold: 2000, - // Configuration for progressive/incremental rendering - progressiveThreshold: 3000, - progressive: 400, - // Threshold of if use single hover layer to optimize. - // It is recommended that `hoverLayerThreshold` is equivalent to or less than - // `progressiveThreshold`, otherwise hover will cause restart of progressive, - // which is unexpected. - // see example . - hoverLayerThreshold: 3000, - // See: module:echarts/scale/Time - useUTC: false + darkMode: 'auto', + // backgroundColor: 'rgba(0,0,0,0)', + colorBy: 'series', + color: ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'], + gradientColor: ['#f6efa6', '#d88273', '#bf444c'], + aria: { + decal: { + decals: [{ + color: decalColor, + dashArrayX: [1, 0], + dashArrayY: [2, 5], + symbolSize: 1, + rotation: Math.PI / 6 + }, { + color: decalColor, + symbol: 'circle', + dashArrayX: [[8, 8], [0, 8, 8, 0]], + dashArrayY: [6, 0], + symbolSize: 0.8 + }, { + color: decalColor, + dashArrayX: [1, 0], + dashArrayY: [4, 3], + rotation: -Math.PI / 4 + }, { + color: decalColor, + dashArrayX: [[6, 6], [0, 6, 6, 0]], + dashArrayY: [6, 0] + }, { + color: decalColor, + dashArrayX: [[1, 0], [1, 6]], + dashArrayY: [1, 0, 6, 0], + rotation: Math.PI / 4 + }, { + color: decalColor, + symbol: 'triangle', + dashArrayX: [[9, 9], [0, 9, 9, 0]], + dashArrayY: [7, 2], + symbolSize: 0.75 + }] + } + }, + // If xAxis and yAxis declared, grid is created by default. + // grid: {}, + textStyle: { + // color: '#000', + // decoration: 'none', + // PENDING + fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif', + // fontFamily: 'Arial, Verdana, sans-serif', + fontSize: 12, + fontStyle: 'normal', + fontWeight: 'normal' + }, + // http://blogs.adobe.com/webplatform/2014/02/24/using-blend-modes-in-html-canvas/ + // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation + // Default is source-over + blendMode: null, + stateAnimation: { + duration: 300, + easing: 'cubicOut' + }, + animation: 'auto', + animationDuration: 1000, + animationDurationUpdate: 500, + animationEasing: 'cubicInOut', + animationEasingUpdate: 'cubicInOut', + animationThreshold: 2000, + // Configuration for progressive/incremental rendering + progressiveThreshold: 3000, + progressive: 400, + // Threshold of if use single hover layer to optimize. + // It is recommended that `hoverLayerThreshold` is equivalent to or less than + // `progressiveThreshold`, otherwise hover will cause restart of progressive, + // which is unexpected. + // see example . + hoverLayerThreshold: 3000, + // See: module:echarts/scale/Time + useUTC: false }; var VISUAL_DIMENSIONS = createHashMap(['tooltip', 'label', 'itemName', 'itemId', 'itemGroupId', 'seriesName']); @@ -17792,9 +17792,9 @@ var SERIES_LAYOUT_BY_ROW = 'row'; var BE_ORDINAL = { - Must: 1, - Might: 2, - Not: 3 // Other cases + Must: 1, + Might: 2, + Not: 3 // Other cases }; var innerGlobalModel = makeInner(); @@ -17803,8 +17803,8 @@ */ function resetSourceDefaulter(ecModel) { - // `datasetMap` is used to make default encode. - innerGlobalModel(ecModel).datasetMap = createHashMap(); + // `datasetMap` is used to make default encode. + innerGlobalModel(ecModel).datasetMap = createHashMap(); } /** * [The strategy of the arrengment of data dimensions for dataset]: @@ -17823,80 +17823,80 @@ */ function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) { - var encode = {}; - var datasetModel = querySeriesUpstreamDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur. + var encode = {}; + var datasetModel = querySeriesUpstreamDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur. - if (!datasetModel || !coordDimensions) { - return encode; - } - - var encodeItemName = []; - var encodeSeriesName = []; - var ecModel = seriesModel.ecModel; - var datasetMap = innerGlobalModel(ecModel).datasetMap; - var key = datasetModel.uid + '_' + source.seriesLayoutBy; - var baseCategoryDimIndex; - var categoryWayValueDimStart; - coordDimensions = coordDimensions.slice(); - each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) { - var coordDimInfo = isObject(coordDimInfoLoose) ? coordDimInfoLoose : coordDimensions[coordDimIdx] = { - name: coordDimInfoLoose - }; - - if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) { - baseCategoryDimIndex = coordDimIdx; - categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo); - } - - encode[coordDimInfo.name] = []; - }); - var datasetRecord = datasetMap.get(key) || datasetMap.set(key, { - categoryWayDim: categoryWayValueDimStart, - valueWayDim: 0 - }); // TODO - // Auto detect first time axis and do arrangement. - - each(coordDimensions, function (coordDimInfo, coordDimIdx) { - var coordDimName = coordDimInfo.name; - var count = getDataDimCountOnCoordDim(coordDimInfo); // In value way. - - if (baseCategoryDimIndex == null) { - var start = datasetRecord.valueWayDim; - pushDim(encode[coordDimName], start, count); - pushDim(encodeSeriesName, start, count); - datasetRecord.valueWayDim += count; // ??? TODO give a better default series name rule? - // especially when encode x y specified. - // consider: when mutiple series share one dimension - // category axis, series name should better use - // the other dimsion name. On the other hand, use - // both dimensions name. - } // In category way, the first category axis. - else if (baseCategoryDimIndex === coordDimIdx) { - pushDim(encode[coordDimName], 0, count); - pushDim(encodeItemName, 0, count); - } // In category way, the other axis. - else { - var start = datasetRecord.categoryWayDim; - pushDim(encode[coordDimName], start, count); - pushDim(encodeSeriesName, start, count); - datasetRecord.categoryWayDim += count; - } - }); - - function pushDim(dimIdxArr, idxFrom, idxCount) { - for (var i = 0; i < idxCount; i++) { - dimIdxArr.push(idxFrom + i); - } - } - - function getDataDimCountOnCoordDim(coordDimInfo) { - var dimsDef = coordDimInfo.dimsDef; - return dimsDef ? dimsDef.length : 1; - } - - encodeItemName.length && (encode.itemName = encodeItemName); - encodeSeriesName.length && (encode.seriesName = encodeSeriesName); + if (!datasetModel || !coordDimensions) { return encode; + } + + var encodeItemName = []; + var encodeSeriesName = []; + var ecModel = seriesModel.ecModel; + var datasetMap = innerGlobalModel(ecModel).datasetMap; + var key = datasetModel.uid + '_' + source.seriesLayoutBy; + var baseCategoryDimIndex; + var categoryWayValueDimStart; + coordDimensions = coordDimensions.slice(); + each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) { + var coordDimInfo = isObject(coordDimInfoLoose) ? coordDimInfoLoose : coordDimensions[coordDimIdx] = { + name: coordDimInfoLoose + }; + + if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) { + baseCategoryDimIndex = coordDimIdx; + categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo); + } + + encode[coordDimInfo.name] = []; + }); + var datasetRecord = datasetMap.get(key) || datasetMap.set(key, { + categoryWayDim: categoryWayValueDimStart, + valueWayDim: 0 + }); // TODO + // Auto detect first time axis and do arrangement. + + each(coordDimensions, function (coordDimInfo, coordDimIdx) { + var coordDimName = coordDimInfo.name; + var count = getDataDimCountOnCoordDim(coordDimInfo); // In value way. + + if (baseCategoryDimIndex == null) { + var start = datasetRecord.valueWayDim; + pushDim(encode[coordDimName], start, count); + pushDim(encodeSeriesName, start, count); + datasetRecord.valueWayDim += count; // ??? TODO give a better default series name rule? + // especially when encode x y specified. + // consider: when mutiple series share one dimension + // category axis, series name should better use + // the other dimsion name. On the other hand, use + // both dimensions name. + } // In category way, the first category axis. + else if (baseCategoryDimIndex === coordDimIdx) { + pushDim(encode[coordDimName], 0, count); + pushDim(encodeItemName, 0, count); + } // In category way, the other axis. + else { + var start = datasetRecord.categoryWayDim; + pushDim(encode[coordDimName], start, count); + pushDim(encodeSeriesName, start, count); + datasetRecord.categoryWayDim += count; + } + }); + + function pushDim(dimIdxArr, idxFrom, idxCount) { + for (var i = 0; i < idxCount; i++) { + dimIdxArr.push(idxFrom + i); + } + } + + function getDataDimCountOnCoordDim(coordDimInfo) { + var dimsDef = coordDimInfo.dimsDef; + return dimsDef ? dimsDef.length : 1; + } + + encodeItemName.length && (encode.itemName = encodeItemName); + encodeSeriesName.length && (encode.seriesName = encodeSeriesName); + return encode; } /** * Work for data like [{name: ..., value: ...}, ...]. @@ -17905,119 +17905,119 @@ */ function makeSeriesEncodeForNameBased(seriesModel, source, dimCount) { - var encode = {}; - var datasetModel = querySeriesUpstreamDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur. - - if (!datasetModel) { - return encode; - } + var encode = {}; + var datasetModel = querySeriesUpstreamDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur. - var sourceFormat = source.sourceFormat; - var dimensionsDefine = source.dimensionsDefine; - var potentialNameDimIndex; + if (!datasetModel) { + return encode; + } - if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) { - each(dimensionsDefine, function (dim, idx) { - if ((isObject(dim) ? dim.name : dim) === 'name') { - potentialNameDimIndex = idx; - } - }); - } + var sourceFormat = source.sourceFormat; + var dimensionsDefine = source.dimensionsDefine; + var potentialNameDimIndex; - var idxResult = function () { - var idxRes0 = {}; - var idxRes1 = {}; - var guessRecords = []; // 5 is an experience value. + if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) { + each(dimensionsDefine, function (dim, idx) { + if ((isObject(dim) ? dim.name : dim) === 'name') { + potentialNameDimIndex = idx; + } + }); + } - for (var i = 0, len = Math.min(5, dimCount); i < len; i++) { - var guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i); - guessRecords.push(guessResult); - var isPureNumber = guessResult === BE_ORDINAL.Not; // [Strategy of idxRes0]: find the first BE_ORDINAL.Not as the value dim, - // and then find a name dim with the priority: - // "BE_ORDINAL.Might|BE_ORDINAL.Must" > "other dim" > "the value dim itself". + var idxResult = function () { + var idxRes0 = {}; + var idxRes1 = {}; + var guessRecords = []; // 5 is an experience value. - if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) { - idxRes0.v = i; - } + for (var i = 0, len = Math.min(5, dimCount); i < len; i++) { + var guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i); + guessRecords.push(guessResult); + var isPureNumber = guessResult === BE_ORDINAL.Not; // [Strategy of idxRes0]: find the first BE_ORDINAL.Not as the value dim, + // and then find a name dim with the priority: + // "BE_ORDINAL.Might|BE_ORDINAL.Must" > "other dim" > "the value dim itself". - if (idxRes0.n == null || idxRes0.n === idxRes0.v || !isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not) { - idxRes0.n = i; - } + if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) { + idxRes0.v = i; + } - if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) { - return idxRes0; - } // [Strategy of idxRes1]: if idxRes0 not satisfied (that is, no BE_ORDINAL.Not), - // find the first BE_ORDINAL.Might as the value dim, - // and then find a name dim with the priority: - // "other dim" > "the value dim itself". - // That is for backward compat: number-like (e.g., `'3'`, `'55'`) can be - // treated as number. + if (idxRes0.n == null || idxRes0.n === idxRes0.v || !isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not) { + idxRes0.n = i; + } + if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) { + return idxRes0; + } // [Strategy of idxRes1]: if idxRes0 not satisfied (that is, no BE_ORDINAL.Not), + // find the first BE_ORDINAL.Might as the value dim, + // and then find a name dim with the priority: + // "other dim" > "the value dim itself". + // That is for backward compat: number-like (e.g., `'3'`, `'55'`) can be + // treated as number. - if (!isPureNumber) { - if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) { - idxRes1.v = i; - } - if (idxRes1.n == null || idxRes1.n === idxRes1.v) { - idxRes1.n = i; - } - } + if (!isPureNumber) { + if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) { + idxRes1.v = i; } - function fulfilled(idxResult) { - return idxResult.v != null && idxResult.n != null; + if (idxRes1.n == null || idxRes1.n === idxRes1.v) { + idxRes1.n = i; } + } + } + + function fulfilled(idxResult) { + return idxResult.v != null && idxResult.n != null; + } - return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null; - }(); + return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null; + }(); - if (idxResult) { - encode.value = [idxResult.v]; // `potentialNameDimIndex` has highest priority. + if (idxResult) { + encode.value = [idxResult.v]; // `potentialNameDimIndex` has highest priority. - var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n; // By default, label use itemName in charts. - // So we dont set encodeLabel here. + var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n; // By default, label use itemName in charts. + // So we dont set encodeLabel here. - encode.itemName = [nameDimIndex]; - encode.seriesName = [nameDimIndex]; - } + encode.itemName = [nameDimIndex]; + encode.seriesName = [nameDimIndex]; + } - return encode; + return encode; } /** * @return If return null/undefined, indicate that should not use datasetModel. */ function querySeriesUpstreamDatasetModel(seriesModel) { - // Caution: consider the scenario: - // A dataset is declared and a series is not expected to use the dataset, - // and at the beginning `setOption({series: { noData })` (just prepare other - // option but no data), then `setOption({series: {data: [...]}); In this case, - // the user should set an empty array to avoid that dataset is used by default. - var thisData = seriesModel.get('data', true); - - if (!thisData) { - return queryReferringComponents(seriesModel.ecModel, 'dataset', { - index: seriesModel.get('datasetIndex', true), - id: seriesModel.get('datasetId', true) - }, SINGLE_REFERRING).models[0]; - } + // Caution: consider the scenario: + // A dataset is declared and a series is not expected to use the dataset, + // and at the beginning `setOption({series: { noData })` (just prepare other + // option but no data), then `setOption({series: {data: [...]}); In this case, + // the user should set an empty array to avoid that dataset is used by default. + var thisData = seriesModel.get('data', true); + + if (!thisData) { + return queryReferringComponents(seriesModel.ecModel, 'dataset', { + index: seriesModel.get('datasetIndex', true), + id: seriesModel.get('datasetId', true) + }, SINGLE_REFERRING).models[0]; + } } /** * @return Always return an array event empty. */ function queryDatasetUpstreamDatasetModels(datasetModel) { - // Only these attributes declared, we by defualt reference to `datasetIndex: 0`. - // Otherwise, no reference. - if (!datasetModel.get('transform', true) && !datasetModel.get('fromTransformResult', true)) { - return []; - } + // Only these attributes declared, we by defualt reference to `datasetIndex: 0`. + // Otherwise, no reference. + if (!datasetModel.get('transform', true) && !datasetModel.get('fromTransformResult', true)) { + return []; + } - return queryReferringComponents(datasetModel.ecModel, 'dataset', { - index: datasetModel.get('fromDatasetIndex', true), - id: datasetModel.get('fromDatasetId', true) - }, SINGLE_REFERRING).models; + return queryReferringComponents(datasetModel.ecModel, 'dataset', { + index: datasetModel.get('fromDatasetIndex', true), + id: datasetModel.get('fromDatasetId', true) + }, SINGLE_REFERRING).models; } /** * The rule should not be complex, otherwise user might not @@ -18026,185 +18026,185 @@ */ function guessOrdinal(source, dimIndex) { - return doGuessOrdinal(source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex); + return doGuessOrdinal(source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex); } // dimIndex may be overflow source data. // return {BE_ORDINAL} function doGuessOrdinal(data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex) { - var result; // Experience value. - - var maxLoop = 5; + var result; // Experience value. - if (isTypedArray(data)) { - return BE_ORDINAL.Not; - } // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine - // always exists in source. + var maxLoop = 5; + if (isTypedArray(data)) { + return BE_ORDINAL.Not; + } // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine + // always exists in source. - var dimName; - var dimType; - if (dimensionsDefine) { - var dimDefItem = dimensionsDefine[dimIndex]; + var dimName; + var dimType; - if (isObject(dimDefItem)) { - dimName = dimDefItem.name; - dimType = dimDefItem.type; - } else if (isString(dimDefItem)) { - dimName = dimDefItem; - } - } + if (dimensionsDefine) { + var dimDefItem = dimensionsDefine[dimIndex]; - if (dimType != null) { - return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not; + if (isObject(dimDefItem)) { + dimName = dimDefItem.name; + dimType = dimDefItem.type; + } else if (isString(dimDefItem)) { + dimName = dimDefItem; } + } - if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) { - var dataArrayRows = data; + if (dimType != null) { + return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not; + } - if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) { - var sample = dataArrayRows[dimIndex]; + if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) { + var dataArrayRows = data; - for (var i = 0; i < (sample || []).length && i < maxLoop; i++) { - if ((result = detectValue(sample[startIndex + i])) != null) { - return result; - } - } - } else { - for (var i = 0; i < dataArrayRows.length && i < maxLoop; i++) { - var row = dataArrayRows[startIndex + i]; + if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) { + var sample = dataArrayRows[dimIndex]; - if (row && (result = detectValue(row[dimIndex])) != null) { - return result; - } - } + for (var i = 0; i < (sample || []).length && i < maxLoop; i++) { + if ((result = detectValue(sample[startIndex + i])) != null) { + return result; } - } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) { - var dataObjectRows = data; + } + } else { + for (var i = 0; i < dataArrayRows.length && i < maxLoop; i++) { + var row = dataArrayRows[startIndex + i]; - if (!dimName) { - return BE_ORDINAL.Not; + if (row && (result = detectValue(row[dimIndex])) != null) { + return result; } + } + } + } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) { + var dataObjectRows = data; - for (var i = 0; i < dataObjectRows.length && i < maxLoop; i++) { - var item = dataObjectRows[i]; + if (!dimName) { + return BE_ORDINAL.Not; + } - if (item && (result = detectValue(item[dimName])) != null) { - return result; - } - } - } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) { - var dataKeyedColumns = data; + for (var i = 0; i < dataObjectRows.length && i < maxLoop; i++) { + var item = dataObjectRows[i]; - if (!dimName) { - return BE_ORDINAL.Not; - } + if (item && (result = detectValue(item[dimName])) != null) { + return result; + } + } + } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) { + var dataKeyedColumns = data; - var sample = dataKeyedColumns[dimName]; + if (!dimName) { + return BE_ORDINAL.Not; + } - if (!sample || isTypedArray(sample)) { - return BE_ORDINAL.Not; - } + var sample = dataKeyedColumns[dimName]; - for (var i = 0; i < sample.length && i < maxLoop; i++) { - if ((result = detectValue(sample[i])) != null) { - return result; - } - } - } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) { - var dataOriginal = data; + if (!sample || isTypedArray(sample)) { + return BE_ORDINAL.Not; + } - for (var i = 0; i < dataOriginal.length && i < maxLoop; i++) { - var item = dataOriginal[i]; - var val = getDataItemValue(item); + for (var i = 0; i < sample.length && i < maxLoop; i++) { + if ((result = detectValue(sample[i])) != null) { + return result; + } + } + } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) { + var dataOriginal = data; - if (!isArray(val)) { - return BE_ORDINAL.Not; - } + for (var i = 0; i < dataOriginal.length && i < maxLoop; i++) { + var item = dataOriginal[i]; + var val = getDataItemValue(item); - if ((result = detectValue(val[dimIndex])) != null) { - return result; - } - } + if (!isArray(val)) { + return BE_ORDINAL.Not; + } + + if ((result = detectValue(val[dimIndex])) != null) { + return result; + } } + } - function detectValue(val) { - var beStr = isString(val); // Consider usage convenience, '1', '2' will be treated as "number". - // `isFinit('')` get `true`. + function detectValue(val) { + var beStr = isString(val); // Consider usage convenience, '1', '2' will be treated as "number". + // `isFinit('')` get `true`. - if (val != null && isFinite(val) && val !== '') { - return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not; - } else if (beStr && val !== '-') { - return BE_ORDINAL.Must; - } + if (val != null && isFinite(val) && val !== '') { + return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not; + } else if (beStr && val !== '-') { + return BE_ORDINAL.Must; } + } - return BE_ORDINAL.Not; + return BE_ORDINAL.Not; } var internalOptionCreatorMap = createHashMap(); function registerInternalOptionCreator(mainType, creator) { - assert(internalOptionCreatorMap.get(mainType) == null && creator); - internalOptionCreatorMap.set(mainType, creator); + assert(internalOptionCreatorMap.get(mainType) == null && creator); + internalOptionCreatorMap.set(mainType, creator); } function concatInternalOptions(ecModel, mainType, newCmptOptionList) { - var internalOptionCreator = internalOptionCreatorMap.get(mainType); + var internalOptionCreator = internalOptionCreatorMap.get(mainType); - if (!internalOptionCreator) { - return newCmptOptionList; - } + if (!internalOptionCreator) { + return newCmptOptionList; + } - var internalOptions = internalOptionCreator(ecModel); + var internalOptions = internalOptionCreator(ecModel); - if (!internalOptions) { - return newCmptOptionList; - } + if (!internalOptions) { + return newCmptOptionList; + } - if ("development" !== 'production') { - for (var i = 0; i < internalOptions.length; i++) { - assert(isComponentIdInternal(internalOptions[i])); - } + if ("development" !== 'production') { + for (var i = 0; i < internalOptions.length; i++) { + assert(isComponentIdInternal(internalOptions[i])); } + } - return newCmptOptionList.concat(internalOptions); + return newCmptOptionList.concat(internalOptions); } var innerColor = makeInner(); var innerDecal = makeInner(); var PaletteMixin = - /** @class */ - function () { - function PaletteMixin() {} + /** @class */ + function () { + function PaletteMixin() {} - PaletteMixin.prototype.getColorFromPalette = function (name, scope, requestNum) { - var defaultPalette = normalizeToArray(this.get('color', true)); - var layeredPalette = this.get('colorLayer', true); - return getFromPalette(this, innerColor, defaultPalette, layeredPalette, name, scope, requestNum); - }; + PaletteMixin.prototype.getColorFromPalette = function (name, scope, requestNum) { + var defaultPalette = normalizeToArray(this.get('color', true)); + var layeredPalette = this.get('colorLayer', true); + return getFromPalette(this, innerColor, defaultPalette, layeredPalette, name, scope, requestNum); + }; - PaletteMixin.prototype.clearColorPalette = function () { - clearPalette(this, innerColor); - }; + PaletteMixin.prototype.clearColorPalette = function () { + clearPalette(this, innerColor); + }; - return PaletteMixin; - }(); + return PaletteMixin; + }(); function getDecalFromPalette(ecModel, name, scope, requestNum) { - var defaultDecals = normalizeToArray(ecModel.get(['aria', 'decal', 'decals'])); - return getFromPalette(ecModel, innerDecal, defaultDecals, null, name, scope, requestNum); + var defaultDecals = normalizeToArray(ecModel.get(['aria', 'decal', 'decals'])); + return getFromPalette(ecModel, innerDecal, defaultDecals, null, name, scope, requestNum); } function getNearestPalette(palettes, requestColorNum) { - var paletteNum = palettes.length; // TODO palettes must be in order + var paletteNum = palettes.length; // TODO palettes must be in order - for (var i = 0; i < paletteNum; i++) { - if (palettes[i].length > requestColorNum) { - return palettes[i]; - } + for (var i = 0; i < paletteNum; i++) { + if (palettes[i].length > requestColorNum) { + return palettes[i]; } + } - return palettes[paletteNum - 1]; + return palettes[paletteNum - 1]; } /** * @param name MUST NOT be null/undefined. Otherwise call this function @@ -18215,36 +18215,36 @@ function getFromPalette(that, inner, defaultPalette, layeredPalette, name, scope, requestNum) { - scope = scope || that; - var scopeFields = inner(scope); - var paletteIdx = scopeFields.paletteIdx || 0; - var paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {}; // Use `hasOwnProperty` to avoid conflict with Object.prototype. + scope = scope || that; + var scopeFields = inner(scope); + var paletteIdx = scopeFields.paletteIdx || 0; + var paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {}; // Use `hasOwnProperty` to avoid conflict with Object.prototype. - if (paletteNameMap.hasOwnProperty(name)) { - return paletteNameMap[name]; - } + if (paletteNameMap.hasOwnProperty(name)) { + return paletteNameMap[name]; + } - var palette = requestNum == null || !layeredPalette ? defaultPalette : getNearestPalette(layeredPalette, requestNum); // In case can't find in layered color palette. + var palette = requestNum == null || !layeredPalette ? defaultPalette : getNearestPalette(layeredPalette, requestNum); // In case can't find in layered color palette. - palette = palette || defaultPalette; + palette = palette || defaultPalette; - if (!palette || !palette.length) { - return; - } + if (!palette || !palette.length) { + return; + } - var pickedPaletteItem = palette[paletteIdx]; + var pickedPaletteItem = palette[paletteIdx]; - if (name) { - paletteNameMap[name] = pickedPaletteItem; - } + if (name) { + paletteNameMap[name] = pickedPaletteItem; + } - scopeFields.paletteIdx = (paletteIdx + 1) % palette.length; - return pickedPaletteItem; + scopeFields.paletteIdx = (paletteIdx + 1) % palette.length; + return pickedPaletteItem; } function clearPalette(that, inner) { - inner(that).paletteIdx = 0; - inner(that).paletteNameMap = {}; + inner(that).paletteIdx = 0; + inner(that).paletteNameMap = {}; } // Internal method names: @@ -18256,845 +18256,845 @@ var OPTION_INNER_KEY = '\0_ec_inner'; var OPTION_INNER_VALUE = 1; var BUITIN_COMPONENTS_MAP = { - grid: 'GridComponent', - polar: 'PolarComponent', - geo: 'GeoComponent', - singleAxis: 'SingleAxisComponent', - parallel: 'ParallelComponent', - calendar: 'CalendarComponent', - graphic: 'GraphicComponent', - toolbox: 'ToolboxComponent', - tooltip: 'TooltipComponent', - axisPointer: 'AxisPointerComponent', - brush: 'BrushComponent', - title: 'TitleComponent', - timeline: 'TimelineComponent', - markPoint: 'MarkPointComponent', - markLine: 'MarkLineComponent', - markArea: 'MarkAreaComponent', - legend: 'LegendComponent', - dataZoom: 'DataZoomComponent', - visualMap: 'VisualMapComponent', - // aria: 'AriaComponent', - // dataset: 'DatasetComponent', - // Dependencies - xAxis: 'GridComponent', - yAxis: 'GridComponent', - angleAxis: 'PolarComponent', - radiusAxis: 'PolarComponent' + grid: 'GridComponent', + polar: 'PolarComponent', + geo: 'GeoComponent', + singleAxis: 'SingleAxisComponent', + parallel: 'ParallelComponent', + calendar: 'CalendarComponent', + graphic: 'GraphicComponent', + toolbox: 'ToolboxComponent', + tooltip: 'TooltipComponent', + axisPointer: 'AxisPointerComponent', + brush: 'BrushComponent', + title: 'TitleComponent', + timeline: 'TimelineComponent', + markPoint: 'MarkPointComponent', + markLine: 'MarkLineComponent', + markArea: 'MarkAreaComponent', + legend: 'LegendComponent', + dataZoom: 'DataZoomComponent', + visualMap: 'VisualMapComponent', + // aria: 'AriaComponent', + // dataset: 'DatasetComponent', + // Dependencies + xAxis: 'GridComponent', + yAxis: 'GridComponent', + angleAxis: 'PolarComponent', + radiusAxis: 'PolarComponent' }; var BUILTIN_CHARTS_MAP = { - line: 'LineChart', - bar: 'BarChart', - pie: 'PieChart', - scatter: 'ScatterChart', - radar: 'RadarChart', - map: 'MapChart', - tree: 'TreeChart', - treemap: 'TreemapChart', - graph: 'GraphChart', - gauge: 'GaugeChart', - funnel: 'FunnelChart', - parallel: 'ParallelChart', - sankey: 'SankeyChart', - boxplot: 'BoxplotChart', - candlestick: 'CandlestickChart', - effectScatter: 'EffectScatterChart', - lines: 'LinesChart', - heatmap: 'HeatmapChart', - pictorialBar: 'PictorialBarChart', - themeRiver: 'ThemeRiverChart', - sunburst: 'SunburstChart', - custom: 'CustomChart' + line: 'LineChart', + bar: 'BarChart', + pie: 'PieChart', + scatter: 'ScatterChart', + radar: 'RadarChart', + map: 'MapChart', + tree: 'TreeChart', + treemap: 'TreemapChart', + graph: 'GraphChart', + gauge: 'GaugeChart', + funnel: 'FunnelChart', + parallel: 'ParallelChart', + sankey: 'SankeyChart', + boxplot: 'BoxplotChart', + candlestick: 'CandlestickChart', + effectScatter: 'EffectScatterChart', + lines: 'LinesChart', + heatmap: 'HeatmapChart', + pictorialBar: 'PictorialBarChart', + themeRiver: 'ThemeRiverChart', + sunburst: 'SunburstChart', + custom: 'CustomChart' }; var componetsMissingLogPrinted = {}; function checkMissingComponents(option) { - each(option, function (componentOption, mainType) { - if (!ComponentModel.hasClass(mainType)) { - var componentImportName = BUITIN_COMPONENTS_MAP[mainType]; + each(option, function (componentOption, mainType) { + if (!ComponentModel.hasClass(mainType)) { + var componentImportName = BUITIN_COMPONENTS_MAP[mainType]; - if (componentImportName && !componetsMissingLogPrinted[componentImportName]) { - error("Component " + mainType + " is used but not imported.\nimport { " + componentImportName + " } from 'echarts/components';\necharts.use([" + componentImportName + "]);"); - componetsMissingLogPrinted[componentImportName] = true; - } - } - }); + if (componentImportName && !componetsMissingLogPrinted[componentImportName]) { + error("Component " + mainType + " is used but not imported.\nimport { " + componentImportName + " } from 'echarts/components';\necharts.use([" + componentImportName + "]);"); + componetsMissingLogPrinted[componentImportName] = true; + } + } + }); } var GlobalModel = - /** @class */ - function (_super) { - __extends(GlobalModel, _super); + /** @class */ + function (_super) { + __extends(GlobalModel, _super); - function GlobalModel() { - return _super !== null && _super.apply(this, arguments) || this; - } + function GlobalModel() { + return _super !== null && _super.apply(this, arguments) || this; + } - GlobalModel.prototype.init = function (option, parentModel, ecModel, theme, locale, optionManager) { - theme = theme || {}; - this.option = null; // Mark as not initialized. + GlobalModel.prototype.init = function (option, parentModel, ecModel, theme, locale, optionManager) { + theme = theme || {}; + this.option = null; // Mark as not initialized. - this._theme = new Model(theme); - this._locale = new Model(locale); - this._optionManager = optionManager; - }; + this._theme = new Model(theme); + this._locale = new Model(locale); + this._optionManager = optionManager; + }; - GlobalModel.prototype.setOption = function (option, opts, optionPreprocessorFuncs) { - if ("development" !== 'production') { - assert(option != null, 'option is null/undefined'); - assert(option[OPTION_INNER_KEY] !== OPTION_INNER_VALUE, 'please use chart.getOption()'); - } + GlobalModel.prototype.setOption = function (option, opts, optionPreprocessorFuncs) { + if ("development" !== 'production') { + assert(option != null, 'option is null/undefined'); + assert(option[OPTION_INNER_KEY] !== OPTION_INNER_VALUE, 'please use chart.getOption()'); + } - var innerOpt = normalizeSetOptionInput(opts); + var innerOpt = normalizeSetOptionInput(opts); - this._optionManager.setOption(option, optionPreprocessorFuncs, innerOpt); + this._optionManager.setOption(option, optionPreprocessorFuncs, innerOpt); - this._resetOption(null, innerOpt); - }; - /** - * @param type null/undefined: reset all. - * 'recreate': force recreate all. - * 'timeline': only reset timeline option - * 'media': only reset media query option - * @return Whether option changed. - */ + this._resetOption(null, innerOpt); + }; + /** + * @param type null/undefined: reset all. + * 'recreate': force recreate all. + * 'timeline': only reset timeline option + * 'media': only reset media query option + * @return Whether option changed. + */ - GlobalModel.prototype.resetOption = function (type, opt) { - return this._resetOption(type, normalizeSetOptionInput(opt)); - }; + GlobalModel.prototype.resetOption = function (type, opt) { + return this._resetOption(type, normalizeSetOptionInput(opt)); + }; - GlobalModel.prototype._resetOption = function (type, opt) { - var optionChanged = false; - var optionManager = this._optionManager; + GlobalModel.prototype._resetOption = function (type, opt) { + var optionChanged = false; + var optionManager = this._optionManager; - if (!type || type === 'recreate') { - var baseOption = optionManager.mountOption(type === 'recreate'); + if (!type || type === 'recreate') { + var baseOption = optionManager.mountOption(type === 'recreate'); - if ("development" !== 'production') { - checkMissingComponents(baseOption); - } + if ("development" !== 'production') { + checkMissingComponents(baseOption); + } - if (!this.option || type === 'recreate') { - initBase(this, baseOption); - } else { - this.restoreData(); + if (!this.option || type === 'recreate') { + initBase(this, baseOption); + } else { + this.restoreData(); - this._mergeOption(baseOption, opt); - } + this._mergeOption(baseOption, opt); + } - optionChanged = true; - } + optionChanged = true; + } - if (type === 'timeline' || type === 'media') { - this.restoreData(); - } // By design, if `setOption(option2)` at the second time, and `option2` is a `ECUnitOption`, - // it should better not have the same props with `MediaUnit['option']`. - // Becuase either `option2` or `MediaUnit['option']` will be always merged to "current option" - // rather than original "baseOption". If they both override a prop, the result might be - // unexpected when media state changed after `setOption` called. - // If we really need to modify a props in each `MediaUnit['option']`, use the full version - // (`{baseOption, media}`) in `setOption`. - // For `timeline`, the case is the same. + if (type === 'timeline' || type === 'media') { + this.restoreData(); + } // By design, if `setOption(option2)` at the second time, and `option2` is a `ECUnitOption`, + // it should better not have the same props with `MediaUnit['option']`. + // Becuase either `option2` or `MediaUnit['option']` will be always merged to "current option" + // rather than original "baseOption". If they both override a prop, the result might be + // unexpected when media state changed after `setOption` called. + // If we really need to modify a props in each `MediaUnit['option']`, use the full version + // (`{baseOption, media}`) in `setOption`. + // For `timeline`, the case is the same. - if (!type || type === 'recreate' || type === 'timeline') { - var timelineOption = optionManager.getTimelineOption(this); + if (!type || type === 'recreate' || type === 'timeline') { + var timelineOption = optionManager.getTimelineOption(this); - if (timelineOption) { - optionChanged = true; + if (timelineOption) { + optionChanged = true; - this._mergeOption(timelineOption, opt); - } - } + this._mergeOption(timelineOption, opt); + } + } - if (!type || type === 'recreate' || type === 'media') { - var mediaOptions = optionManager.getMediaOption(this); + if (!type || type === 'recreate' || type === 'media') { + var mediaOptions = optionManager.getMediaOption(this); - if (mediaOptions.length) { - each(mediaOptions, function (mediaOption) { - optionChanged = true; + if (mediaOptions.length) { + each(mediaOptions, function (mediaOption) { + optionChanged = true; - this._mergeOption(mediaOption, opt); - }, this); - } - } + this._mergeOption(mediaOption, opt); + }, this); + } + } - return optionChanged; - }; + return optionChanged; + }; - GlobalModel.prototype.mergeOption = function (option) { - this._mergeOption(option, null); - }; + GlobalModel.prototype.mergeOption = function (option) { + this._mergeOption(option, null); + }; - GlobalModel.prototype._mergeOption = function (newOption, opt) { - var option = this.option; - var componentsMap = this._componentsMap; - var componentsCount = this._componentsCount; - var newCmptTypes = []; - var newCmptTypeMap = createHashMap(); - var replaceMergeMainTypeMap = opt && opt.replaceMergeMainTypeMap; - resetSourceDefaulter(this); // If no component class, merge directly. - // For example: color, animaiton options, etc. - - each(newOption, function (componentOption, mainType) { - if (componentOption == null) { - return; - } + GlobalModel.prototype._mergeOption = function (newOption, opt) { + var option = this.option; + var componentsMap = this._componentsMap; + var componentsCount = this._componentsCount; + var newCmptTypes = []; + var newCmptTypeMap = createHashMap(); + var replaceMergeMainTypeMap = opt && opt.replaceMergeMainTypeMap; + resetSourceDefaulter(this); // If no component class, merge directly. + // For example: color, animaiton options, etc. - if (!ComponentModel.hasClass(mainType)) { - // globalSettingTask.dirty(); - option[mainType] = option[mainType] == null ? clone(componentOption) : merge(option[mainType], componentOption, true); - } else if (mainType) { - newCmptTypes.push(mainType); - newCmptTypeMap.set(mainType, true); - } - }); + each(newOption, function (componentOption, mainType) { + if (componentOption == null) { + return; + } + + if (!ComponentModel.hasClass(mainType)) { + // globalSettingTask.dirty(); + option[mainType] = option[mainType] == null ? clone(componentOption) : merge(option[mainType], componentOption, true); + } else if (mainType) { + newCmptTypes.push(mainType); + newCmptTypeMap.set(mainType, true); + } + }); - if (replaceMergeMainTypeMap) { - // If there is a mainType `xxx` in `replaceMerge` but not declared in option, - // we trade it as it is declared in option as `{xxx: []}`. Because: - // (1) for normal merge, `{xxx: null/undefined}` are the same meaning as `{xxx: []}`. - // (2) some preprocessor may convert some of `{xxx: null/undefined}` to `{xxx: []}`. - replaceMergeMainTypeMap.each(function (val, mainTypeInReplaceMerge) { - if (ComponentModel.hasClass(mainTypeInReplaceMerge) && !newCmptTypeMap.get(mainTypeInReplaceMerge)) { - newCmptTypes.push(mainTypeInReplaceMerge); - newCmptTypeMap.set(mainTypeInReplaceMerge, true); - } - }); - } + if (replaceMergeMainTypeMap) { + // If there is a mainType `xxx` in `replaceMerge` but not declared in option, + // we trade it as it is declared in option as `{xxx: []}`. Because: + // (1) for normal merge, `{xxx: null/undefined}` are the same meaning as `{xxx: []}`. + // (2) some preprocessor may convert some of `{xxx: null/undefined}` to `{xxx: []}`. + replaceMergeMainTypeMap.each(function (val, mainTypeInReplaceMerge) { + if (ComponentModel.hasClass(mainTypeInReplaceMerge) && !newCmptTypeMap.get(mainTypeInReplaceMerge)) { + newCmptTypes.push(mainTypeInReplaceMerge); + newCmptTypeMap.set(mainTypeInReplaceMerge, true); + } + }); + } + + ComponentModel.topologicalTravel(newCmptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this); + + function visitComponent(mainType) { + var newCmptOptionList = concatInternalOptions(this, mainType, normalizeToArray(newOption[mainType])); + var oldCmptList = componentsMap.get(mainType); + var mergeMode = // `!oldCmptList` means init. See the comment in `mappingToExists` + !oldCmptList ? 'replaceAll' : replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType) ? 'replaceMerge' : 'normalMerge'; + var mappingResult = mappingToExists(oldCmptList, newCmptOptionList, mergeMode); // Set mainType and complete subType. + + setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel); // Empty it before the travel, in order to prevent `this._componentsMap` + // from being used in the `init`/`mergeOption`/`optionUpdated` of some + // components, which is probably incorrect logic. + + option[mainType] = null; + componentsMap.set(mainType, null); + componentsCount.set(mainType, 0); + var optionsByMainType = []; + var cmptsByMainType = []; + var cmptsCountByMainType = 0; + var tooltipExists; + var tooltipWarningLogged; + each(mappingResult, function (resultItem, index) { + var componentModel = resultItem.existing; + var newCmptOption = resultItem.newOption; + + if (!newCmptOption) { + if (componentModel) { + // Consider where is no new option and should be merged using {}, + // see removeEdgeAndAdd in topologicalTravel and + // ComponentModel.getAllClassMainTypes. + componentModel.mergeOption({}, this); + componentModel.optionUpdated({}, false); + } // If no both `resultItem.exist` and `resultItem.option`, + // either it is in `replaceMerge` and not matched by any id, + // or it has been removed in previous `replaceMerge` and left a "hole" in this component index. - ComponentModel.topologicalTravel(newCmptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this); - - function visitComponent(mainType) { - var newCmptOptionList = concatInternalOptions(this, mainType, normalizeToArray(newOption[mainType])); - var oldCmptList = componentsMap.get(mainType); - var mergeMode = // `!oldCmptList` means init. See the comment in `mappingToExists` - !oldCmptList ? 'replaceAll' : replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType) ? 'replaceMerge' : 'normalMerge'; - var mappingResult = mappingToExists(oldCmptList, newCmptOptionList, mergeMode); // Set mainType and complete subType. - - setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel); // Empty it before the travel, in order to prevent `this._componentsMap` - // from being used in the `init`/`mergeOption`/`optionUpdated` of some - // components, which is probably incorrect logic. - - option[mainType] = null; - componentsMap.set(mainType, null); - componentsCount.set(mainType, 0); - var optionsByMainType = []; - var cmptsByMainType = []; - var cmptsCountByMainType = 0; - var tooltipExists; - var tooltipWarningLogged; - each(mappingResult, function (resultItem, index) { - var componentModel = resultItem.existing; - var newCmptOption = resultItem.newOption; - - if (!newCmptOption) { - if (componentModel) { - // Consider where is no new option and should be merged using {}, - // see removeEdgeAndAdd in topologicalTravel and - // ComponentModel.getAllClassMainTypes. - componentModel.mergeOption({}, this); - componentModel.optionUpdated({}, false); - } // If no both `resultItem.exist` and `resultItem.option`, - // either it is in `replaceMerge` and not matched by any id, - // or it has been removed in previous `replaceMerge` and left a "hole" in this component index. - - } else { - var isSeriesType = mainType === 'series'; - var ComponentModelClass = ComponentModel.getClass(mainType, resultItem.keyInfo.subType, !isSeriesType // Give a more detailed warn later if series don't exists - ); - - if (!ComponentModelClass) { - if ("development" !== 'production') { - var subType = resultItem.keyInfo.subType; - var seriesImportName = BUILTIN_CHARTS_MAP[subType]; - - if (!componetsMissingLogPrinted[subType]) { - componetsMissingLogPrinted[subType] = true; - - if (seriesImportName) { - error("Series " + subType + " is used but not imported.\nimport { " + seriesImportName + " } from 'echarts/charts';\necharts.use([" + seriesImportName + "]);"); - } else { - error("Unkown series " + subType); - } - } - } + } else { + var isSeriesType = mainType === 'series'; + var ComponentModelClass = ComponentModel.getClass(mainType, resultItem.keyInfo.subType, !isSeriesType // Give a more detailed warn later if series don't exists + ); - return; - } // TODO Before multiple tooltips get supported, we do this check to avoid unexpected exception. + if (!ComponentModelClass) { + if ("development" !== 'production') { + var subType = resultItem.keyInfo.subType; + var seriesImportName = BUILTIN_CHARTS_MAP[subType]; + if (!componetsMissingLogPrinted[subType]) { + componetsMissingLogPrinted[subType] = true; - if (mainType === 'tooltip') { - if (tooltipExists) { - if ("development" !== 'production') { - if (!tooltipWarningLogged) { - warn('Currently only one tooltip component is allowed.'); - tooltipWarningLogged = true; - } - } + if (seriesImportName) { + error("Series " + subType + " is used but not imported.\nimport { " + seriesImportName + " } from 'echarts/charts';\necharts.use([" + seriesImportName + "]);"); + } else { + error("Unkown series " + subType); + } + } + } - return; - } + return; + } // TODO Before multiple tooltips get supported, we do this check to avoid unexpected exception. - tooltipExists = true; - } - if (componentModel && componentModel.constructor === ComponentModelClass) { - componentModel.name = resultItem.keyInfo.name; // componentModel.settingTask && componentModel.settingTask.dirty(); + if (mainType === 'tooltip') { + if (tooltipExists) { + if ("development" !== 'production') { + if (!tooltipWarningLogged) { + warn('Currently only one tooltip component is allowed.'); + tooltipWarningLogged = true; + } + } - componentModel.mergeOption(newCmptOption, this); - componentModel.optionUpdated(newCmptOption, false); - } else { - // PENDING Global as parent ? - var extraOpt = extend({ - componentIndex: index - }, resultItem.keyInfo); - componentModel = new ComponentModelClass(newCmptOption, this, this, extraOpt); // Assign `keyInfo` + return; + } - extend(componentModel, extraOpt); + tooltipExists = true; + } - if (resultItem.brandNew) { - componentModel.__requireNewView = true; - } + if (componentModel && componentModel.constructor === ComponentModelClass) { + componentModel.name = resultItem.keyInfo.name; // componentModel.settingTask && componentModel.settingTask.dirty(); - componentModel.init(newCmptOption, this, this); // Call optionUpdated after init. - // newCmptOption has been used as componentModel.option - // and may be merged with theme and default, so pass null - // to avoid confusion. + componentModel.mergeOption(newCmptOption, this); + componentModel.optionUpdated(newCmptOption, false); + } else { + // PENDING Global as parent ? + var extraOpt = extend({ + componentIndex: index + }, resultItem.keyInfo); + componentModel = new ComponentModelClass(newCmptOption, this, this, extraOpt); // Assign `keyInfo` - componentModel.optionUpdated(null, true); - } - } + extend(componentModel, extraOpt); - if (componentModel) { - optionsByMainType.push(componentModel.option); - cmptsByMainType.push(componentModel); - cmptsCountByMainType++; - } else { - // Always do assign to avoid elided item in array. - optionsByMainType.push(void 0); - cmptsByMainType.push(void 0); - } - }, this); - option[mainType] = optionsByMainType; - componentsMap.set(mainType, cmptsByMainType); - componentsCount.set(mainType, cmptsCountByMainType); // Backup series for filtering. + if (resultItem.brandNew) { + componentModel.__requireNewView = true; + } - if (mainType === 'series') { - reCreateSeriesIndices(this); - } - } // If no series declared, ensure `_seriesIndices` initialized. + componentModel.init(newCmptOption, this, this); // Call optionUpdated after init. + // newCmptOption has been used as componentModel.option + // and may be merged with theme and default, so pass null + // to avoid confusion. + componentModel.optionUpdated(null, true); + } + } - if (!this._seriesIndices) { - reCreateSeriesIndices(this); - } - }; - /** - * Get option for output (cloned option and inner info removed) - */ + if (componentModel) { + optionsByMainType.push(componentModel.option); + cmptsByMainType.push(componentModel); + cmptsCountByMainType++; + } else { + // Always do assign to avoid elided item in array. + optionsByMainType.push(void 0); + cmptsByMainType.push(void 0); + } + }, this); + option[mainType] = optionsByMainType; + componentsMap.set(mainType, cmptsByMainType); + componentsCount.set(mainType, cmptsCountByMainType); // Backup series for filtering. + if (mainType === 'series') { + reCreateSeriesIndices(this); + } + } // If no series declared, ensure `_seriesIndices` initialized. - GlobalModel.prototype.getOption = function () { - var option = clone(this.option); - each(option, function (optInMainType, mainType) { - if (ComponentModel.hasClass(mainType)) { - var opts = normalizeToArray(optInMainType); // Inner cmpts need to be removed. - // Inner cmpts might not be at last since ec5.0, but still - // compatible for users: if inner cmpt at last, splice the returned array. - - var realLen = opts.length; - var metNonInner = false; - - for (var i = realLen - 1; i >= 0; i--) { - // Remove options with inner id. - if (opts[i] && !isComponentIdInternal(opts[i])) { - metNonInner = true; - } else { - opts[i] = null; - !metNonInner && realLen--; - } - } - opts.length = realLen; - option[mainType] = opts; - } - }); - delete option[OPTION_INNER_KEY]; - return option; - }; + if (!this._seriesIndices) { + reCreateSeriesIndices(this); + } + }; + /** + * Get option for output (cloned option and inner info removed) + */ - GlobalModel.prototype.getTheme = function () { - return this._theme; - }; - GlobalModel.prototype.getLocaleModel = function () { - return this._locale; - }; + GlobalModel.prototype.getOption = function () { + var option = clone(this.option); + each(option, function (optInMainType, mainType) { + if (ComponentModel.hasClass(mainType)) { + var opts = normalizeToArray(optInMainType); // Inner cmpts need to be removed. + // Inner cmpts might not be at last since ec5.0, but still + // compatible for users: if inner cmpt at last, splice the returned array. - GlobalModel.prototype.setUpdatePayload = function (payload) { - this._payload = payload; - }; + var realLen = opts.length; + var metNonInner = false; - GlobalModel.prototype.getUpdatePayload = function () { - return this._payload; - }; - /** - * @param idx If not specified, return the first one. - */ + for (var i = realLen - 1; i >= 0; i--) { + // Remove options with inner id. + if (opts[i] && !isComponentIdInternal(opts[i])) { + metNonInner = true; + } else { + opts[i] = null; + !metNonInner && realLen--; + } + } + opts.length = realLen; + option[mainType] = opts; + } + }); + delete option[OPTION_INNER_KEY]; + return option; + }; - GlobalModel.prototype.getComponent = function (mainType, idx) { - var list = this._componentsMap.get(mainType); + GlobalModel.prototype.getTheme = function () { + return this._theme; + }; - if (list) { - var cmpt = list[idx || 0]; + GlobalModel.prototype.getLocaleModel = function () { + return this._locale; + }; - if (cmpt) { - return cmpt; - } else if (idx == null) { - for (var i = 0; i < list.length; i++) { - if (list[i]) { - return list[i]; - } - } - } - } - }; - /** - * @return Never be null/undefined. - */ + GlobalModel.prototype.setUpdatePayload = function (payload) { + this._payload = payload; + }; + GlobalModel.prototype.getUpdatePayload = function () { + return this._payload; + }; + /** + * @param idx If not specified, return the first one. + */ - GlobalModel.prototype.queryComponents = function (condition) { - var mainType = condition.mainType; - if (!mainType) { - return []; - } + GlobalModel.prototype.getComponent = function (mainType, idx) { + var list = this._componentsMap.get(mainType); - var index = condition.index; - var id = condition.id; - var name = condition.name; + if (list) { + var cmpt = list[idx || 0]; - var cmpts = this._componentsMap.get(mainType); + if (cmpt) { + return cmpt; + } else if (idx == null) { + for (var i = 0; i < list.length; i++) { + if (list[i]) { + return list[i]; + } + } + } + } + }; + /** + * @return Never be null/undefined. + */ - if (!cmpts || !cmpts.length) { - return []; - } - var result; + GlobalModel.prototype.queryComponents = function (condition) { + var mainType = condition.mainType; - if (index != null) { - result = []; - each(normalizeToArray(index), function (idx) { - cmpts[idx] && result.push(cmpts[idx]); - }); - } else if (id != null) { - result = queryByIdOrName('id', id, cmpts); - } else if (name != null) { - result = queryByIdOrName('name', name, cmpts); - } else { - // Return all non-empty components in that mainType - result = filter(cmpts, function (cmpt) { - return !!cmpt; - }); - } + if (!mainType) { + return []; + } - return filterBySubType(result, condition); - }; - /** - * The interface is different from queryComponents, - * which is convenient for inner usage. - * - * @usage - * let result = findComponents( - * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}} - * ); - * let result = findComponents( - * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}} - * ); - * let result = findComponents( - * {mainType: 'series', - * filter: function (model, index) {...}} - * ); - * // result like [component0, componnet1, ...] - */ + var index = condition.index; + var id = condition.id; + var name = condition.name; + var cmpts = this._componentsMap.get(mainType); - GlobalModel.prototype.findComponents = function (condition) { - var query = condition.query; - var mainType = condition.mainType; - var queryCond = getQueryCond(query); - var result = queryCond ? this.queryComponents(queryCond) // Retrieve all non-empty components. - : filter(this._componentsMap.get(mainType), function (cmpt) { - return !!cmpt; - }); - return doFilter(filterBySubType(result, condition)); + if (!cmpts || !cmpts.length) { + return []; + } - function getQueryCond(q) { - var indexAttr = mainType + 'Index'; - var idAttr = mainType + 'Id'; - var nameAttr = mainType + 'Name'; - return q && (q[indexAttr] != null || q[idAttr] != null || q[nameAttr] != null) ? { - mainType: mainType, - // subType will be filtered finally. - index: q[indexAttr], - id: q[idAttr], - name: q[nameAttr] - } : null; - } + var result; - function doFilter(res) { - return condition.filter ? filter(res, condition.filter) : res; - } - }; + if (index != null) { + result = []; + each(normalizeToArray(index), function (idx) { + cmpts[idx] && result.push(cmpts[idx]); + }); + } else if (id != null) { + result = queryByIdOrName('id', id, cmpts); + } else if (name != null) { + result = queryByIdOrName('name', name, cmpts); + } else { + // Return all non-empty components in that mainType + result = filter(cmpts, function (cmpt) { + return !!cmpt; + }); + } + + return filterBySubType(result, condition); + }; + /** + * The interface is different from queryComponents, + * which is convenient for inner usage. + * + * @usage + * let result = findComponents( + * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}} + * ); + * let result = findComponents( + * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}} + * ); + * let result = findComponents( + * {mainType: 'series', + * filter: function (model, index) {...}} + * ); + * // result like [component0, componnet1, ...] + */ - GlobalModel.prototype.eachComponent = function (mainType, cb, context) { - var componentsMap = this._componentsMap; - if (isFunction(mainType)) { - var ctxForAll_1 = cb; - var cbForAll_1 = mainType; - componentsMap.each(function (cmpts, componentType) { - for (var i = 0; cmpts && i < cmpts.length; i++) { - var cmpt = cmpts[i]; - cmpt && cbForAll_1.call(ctxForAll_1, componentType, cmpt, cmpt.componentIndex); - } - }); - } else { - var cmpts = isString(mainType) ? componentsMap.get(mainType) : isObject(mainType) ? this.findComponents(mainType) : null; + GlobalModel.prototype.findComponents = function (condition) { + var query = condition.query; + var mainType = condition.mainType; + var queryCond = getQueryCond(query); + var result = queryCond ? this.queryComponents(queryCond) // Retrieve all non-empty components. + : filter(this._componentsMap.get(mainType), function (cmpt) { + return !!cmpt; + }); + return doFilter(filterBySubType(result, condition)); - for (var i = 0; cmpts && i < cmpts.length; i++) { - var cmpt = cmpts[i]; - cmpt && cb.call(context, cmpt, cmpt.componentIndex); - } - } - }; - /** - * Get series list before filtered by name. - */ + function getQueryCond(q) { + var indexAttr = mainType + 'Index'; + var idAttr = mainType + 'Id'; + var nameAttr = mainType + 'Name'; + return q && (q[indexAttr] != null || q[idAttr] != null || q[nameAttr] != null) ? { + mainType: mainType, + // subType will be filtered finally. + index: q[indexAttr], + id: q[idAttr], + name: q[nameAttr] + } : null; + } + function doFilter(res) { + return condition.filter ? filter(res, condition.filter) : res; + } + }; - GlobalModel.prototype.getSeriesByName = function (name) { - var nameStr = convertOptionIdName(name, null); - return filter(this._componentsMap.get('series'), function (oneSeries) { - return !!oneSeries && nameStr != null && oneSeries.name === nameStr; - }); - }; - /** - * Get series list before filtered by index. - */ + GlobalModel.prototype.eachComponent = function (mainType, cb, context) { + var componentsMap = this._componentsMap; + if (isFunction(mainType)) { + var ctxForAll_1 = cb; + var cbForAll_1 = mainType; + componentsMap.each(function (cmpts, componentType) { + for (var i = 0; cmpts && i < cmpts.length; i++) { + var cmpt = cmpts[i]; + cmpt && cbForAll_1.call(ctxForAll_1, componentType, cmpt, cmpt.componentIndex); + } + }); + } else { + var cmpts = isString(mainType) ? componentsMap.get(mainType) : isObject(mainType) ? this.findComponents(mainType) : null; - GlobalModel.prototype.getSeriesByIndex = function (seriesIndex) { - return this._componentsMap.get('series')[seriesIndex]; - }; - /** - * Get series list before filtered by type. - * FIXME: rename to getRawSeriesByType? - */ + for (var i = 0; cmpts && i < cmpts.length; i++) { + var cmpt = cmpts[i]; + cmpt && cb.call(context, cmpt, cmpt.componentIndex); + } + } + }; + /** + * Get series list before filtered by name. + */ - GlobalModel.prototype.getSeriesByType = function (subType) { - return filter(this._componentsMap.get('series'), function (oneSeries) { - return !!oneSeries && oneSeries.subType === subType; - }); - }; - /** - * Get all series before filtered. - */ + GlobalModel.prototype.getSeriesByName = function (name) { + var nameStr = convertOptionIdName(name, null); + return filter(this._componentsMap.get('series'), function (oneSeries) { + return !!oneSeries && nameStr != null && oneSeries.name === nameStr; + }); + }; + /** + * Get series list before filtered by index. + */ - GlobalModel.prototype.getSeries = function () { - return filter(this._componentsMap.get('series'), function (oneSeries) { - return !!oneSeries; - }); - }; - /** - * Count series before filtered. - */ + GlobalModel.prototype.getSeriesByIndex = function (seriesIndex) { + return this._componentsMap.get('series')[seriesIndex]; + }; + /** + * Get series list before filtered by type. + * FIXME: rename to getRawSeriesByType? + */ - GlobalModel.prototype.getSeriesCount = function () { - return this._componentsCount.get('series'); - }; - /** - * After filtering, series may be different - * frome raw series. - */ + GlobalModel.prototype.getSeriesByType = function (subType) { + return filter(this._componentsMap.get('series'), function (oneSeries) { + return !!oneSeries && oneSeries.subType === subType; + }); + }; + /** + * Get all series before filtered. + */ - GlobalModel.prototype.eachSeries = function (cb, context) { - assertSeriesInitialized(this); - each(this._seriesIndices, function (rawSeriesIndex) { - var series = this._componentsMap.get('series')[rawSeriesIndex]; + GlobalModel.prototype.getSeries = function () { + return filter(this._componentsMap.get('series'), function (oneSeries) { + return !!oneSeries; + }); + }; + /** + * Count series before filtered. + */ - cb.call(context, series, rawSeriesIndex); - }, this); - }; - /** - * Iterate raw series before filtered. - * - * @param {Function} cb - * @param {*} context - */ + GlobalModel.prototype.getSeriesCount = function () { + return this._componentsCount.get('series'); + }; + /** + * After filtering, series may be different + * frome raw series. + */ - GlobalModel.prototype.eachRawSeries = function (cb, context) { - each(this._componentsMap.get('series'), function (series) { - series && cb.call(context, series, series.componentIndex); - }); - }; - /** - * After filtering, series may be different. - * frome raw series. - */ + GlobalModel.prototype.eachSeries = function (cb, context) { + assertSeriesInitialized(this); + each(this._seriesIndices, function (rawSeriesIndex) { + var series = this._componentsMap.get('series')[rawSeriesIndex]; - GlobalModel.prototype.eachSeriesByType = function (subType, cb, context) { - assertSeriesInitialized(this); - each(this._seriesIndices, function (rawSeriesIndex) { - var series = this._componentsMap.get('series')[rawSeriesIndex]; + cb.call(context, series, rawSeriesIndex); + }, this); + }; + /** + * Iterate raw series before filtered. + * + * @param {Function} cb + * @param {*} context + */ - if (series.subType === subType) { - cb.call(context, series, rawSeriesIndex); - } - }, this); - }; - /** - * Iterate raw series before filtered of given type. - */ + GlobalModel.prototype.eachRawSeries = function (cb, context) { + each(this._componentsMap.get('series'), function (series) { + series && cb.call(context, series, series.componentIndex); + }); + }; + /** + * After filtering, series may be different. + * frome raw series. + */ - GlobalModel.prototype.eachRawSeriesByType = function (subType, cb, context) { - return each(this.getSeriesByType(subType), cb, context); - }; - GlobalModel.prototype.isSeriesFiltered = function (seriesModel) { - assertSeriesInitialized(this); - return this._seriesIndicesMap.get(seriesModel.componentIndex) == null; - }; + GlobalModel.prototype.eachSeriesByType = function (subType, cb, context) { + assertSeriesInitialized(this); + each(this._seriesIndices, function (rawSeriesIndex) { + var series = this._componentsMap.get('series')[rawSeriesIndex]; - GlobalModel.prototype.getCurrentSeriesIndices = function () { - return (this._seriesIndices || []).slice(); - }; + if (series.subType === subType) { + cb.call(context, series, rawSeriesIndex); + } + }, this); + }; + /** + * Iterate raw series before filtered of given type. + */ - GlobalModel.prototype.filterSeries = function (cb, context) { - assertSeriesInitialized(this); - var newSeriesIndices = []; - each(this._seriesIndices, function (seriesRawIdx) { - var series = this._componentsMap.get('series')[seriesRawIdx]; - cb.call(context, series, seriesRawIdx) && newSeriesIndices.push(seriesRawIdx); - }, this); - this._seriesIndices = newSeriesIndices; - this._seriesIndicesMap = createHashMap(newSeriesIndices); - }; + GlobalModel.prototype.eachRawSeriesByType = function (subType, cb, context) { + return each(this.getSeriesByType(subType), cb, context); + }; - GlobalModel.prototype.restoreData = function (payload) { - reCreateSeriesIndices(this); - var componentsMap = this._componentsMap; - var componentTypes = []; - componentsMap.each(function (components, componentType) { - if (ComponentModel.hasClass(componentType)) { - componentTypes.push(componentType); - } - }); - ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType) { - each(componentsMap.get(componentType), function (component) { - if (component && (componentType !== 'series' || !isNotTargetSeries(component, payload))) { - component.restoreData(); - } - }); - }); - }; + GlobalModel.prototype.isSeriesFiltered = function (seriesModel) { + assertSeriesInitialized(this); + return this._seriesIndicesMap.get(seriesModel.componentIndex) == null; + }; - GlobalModel.internalField = function () { - reCreateSeriesIndices = function (ecModel) { - var seriesIndices = ecModel._seriesIndices = []; - each(ecModel._componentsMap.get('series'), function (series) { - // series may have been removed by `replaceMerge`. - series && seriesIndices.push(series.componentIndex); - }); - ecModel._seriesIndicesMap = createHashMap(seriesIndices); - }; + GlobalModel.prototype.getCurrentSeriesIndices = function () { + return (this._seriesIndices || []).slice(); + }; - assertSeriesInitialized = function (ecModel) { - // Components that use _seriesIndices should depends on series component, - // which make sure that their initialization is after series. - if ("development" !== 'production') { - if (!ecModel._seriesIndices) { - throw new Error('Option should contains series.'); - } - } - }; + GlobalModel.prototype.filterSeries = function (cb, context) { + assertSeriesInitialized(this); + var newSeriesIndices = []; + each(this._seriesIndices, function (seriesRawIdx) { + var series = this._componentsMap.get('series')[seriesRawIdx]; - initBase = function (ecModel, baseOption) { - // Using OPTION_INNER_KEY to mark that this option can not be used outside, - // i.e. `chart.setOption(chart.getModel().option);` is forbiden. - ecModel.option = {}; - ecModel.option[OPTION_INNER_KEY] = OPTION_INNER_VALUE; // Init with series: [], in case of calling findSeries method - // before series initialized. + cb.call(context, series, seriesRawIdx) && newSeriesIndices.push(seriesRawIdx); + }, this); + this._seriesIndices = newSeriesIndices; + this._seriesIndicesMap = createHashMap(newSeriesIndices); + }; + + GlobalModel.prototype.restoreData = function (payload) { + reCreateSeriesIndices(this); + var componentsMap = this._componentsMap; + var componentTypes = []; + componentsMap.each(function (components, componentType) { + if (ComponentModel.hasClass(componentType)) { + componentTypes.push(componentType); + } + }); + ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType) { + each(componentsMap.get(componentType), function (component) { + if (component && (componentType !== 'series' || !isNotTargetSeries(component, payload))) { + component.restoreData(); + } + }); + }); + }; - ecModel._componentsMap = createHashMap({ - series: [] - }); - ecModel._componentsCount = createHashMap(); // If user spefied `option.aria`, aria will be enable. This detection should be - // performed before theme and globalDefault merge. + GlobalModel.internalField = function () { + reCreateSeriesIndices = function (ecModel) { + var seriesIndices = ecModel._seriesIndices = []; + each(ecModel._componentsMap.get('series'), function (series) { + // series may have been removed by `replaceMerge`. + series && seriesIndices.push(series.componentIndex); + }); + ecModel._seriesIndicesMap = createHashMap(seriesIndices); + }; - var airaOption = baseOption.aria; + assertSeriesInitialized = function (ecModel) { + // Components that use _seriesIndices should depends on series component, + // which make sure that their initialization is after series. + if ("development" !== 'production') { + if (!ecModel._seriesIndices) { + throw new Error('Option should contains series.'); + } + } + }; - if (isObject(airaOption) && airaOption.enabled == null) { - airaOption.enabled = true; - } + initBase = function (ecModel, baseOption) { + // Using OPTION_INNER_KEY to mark that this option can not be used outside, + // i.e. `chart.setOption(chart.getModel().option);` is forbiden. + ecModel.option = {}; + ecModel.option[OPTION_INNER_KEY] = OPTION_INNER_VALUE; // Init with series: [], in case of calling findSeries method + // before series initialized. - mergeTheme(baseOption, ecModel._theme.option); // TODO Needs clone when merging to the unexisted property + ecModel._componentsMap = createHashMap({ + series: [] + }); + ecModel._componentsCount = createHashMap(); // If user spefied `option.aria`, aria will be enable. This detection should be + // performed before theme and globalDefault merge. - merge(baseOption, globalDefault, false); + var airaOption = baseOption.aria; - ecModel._mergeOption(baseOption, null); - }; - }(); + if (isObject(airaOption) && airaOption.enabled == null) { + airaOption.enabled = true; + } - return GlobalModel; - }(Model); + mergeTheme(baseOption, ecModel._theme.option); // TODO Needs clone when merging to the unexisted property + + merge(baseOption, globalDefault, false); + + ecModel._mergeOption(baseOption, null); + }; + }(); + + return GlobalModel; + }(Model); function isNotTargetSeries(seriesModel, payload) { - if (payload) { - var index = payload.seriesIndex; - var id = payload.seriesId; - var name_1 = payload.seriesName; - return index != null && seriesModel.componentIndex !== index || id != null && seriesModel.id !== id || name_1 != null && seriesModel.name !== name_1; - } + if (payload) { + var index = payload.seriesIndex; + var id = payload.seriesId; + var name_1 = payload.seriesName; + return index != null && seriesModel.componentIndex !== index || id != null && seriesModel.id !== id || name_1 != null && seriesModel.name !== name_1; + } } function mergeTheme(option, theme) { - // PENDING - // NOT use `colorLayer` in theme if option has `color` - var notMergeColorLayer = option.color && !option.colorLayer; - each(theme, function (themeItem, name) { - if (name === 'colorLayer' && notMergeColorLayer) { - return; - } // If it is component model mainType, the model handles that merge later. - // otherwise, merge them here. + // PENDING + // NOT use `colorLayer` in theme if option has `color` + var notMergeColorLayer = option.color && !option.colorLayer; + each(theme, function (themeItem, name) { + if (name === 'colorLayer' && notMergeColorLayer) { + return; + } // If it is component model mainType, the model handles that merge later. + // otherwise, merge them here. - if (!ComponentModel.hasClass(name)) { - if (typeof themeItem === 'object') { - option[name] = !option[name] ? clone(themeItem) : merge(option[name], themeItem, false); - } else { - if (option[name] == null) { - option[name] = themeItem; - } - } + if (!ComponentModel.hasClass(name)) { + if (typeof themeItem === 'object') { + option[name] = !option[name] ? clone(themeItem) : merge(option[name], themeItem, false); + } else { + if (option[name] == null) { + option[name] = themeItem; } - }); + } + } + }); } function queryByIdOrName(attr, idOrName, cmpts) { - // Here is a break from echarts4: string and number are - // treated as equal. - if (isArray(idOrName)) { - var keyMap_1 = createHashMap(); - each(idOrName, function (idOrNameItem) { - if (idOrNameItem != null) { - var idName = convertOptionIdName(idOrNameItem, null); - idName != null && keyMap_1.set(idOrNameItem, true); - } - }); - return filter(cmpts, function (cmpt) { - return cmpt && keyMap_1.get(cmpt[attr]); - }); - } else { - var idName_1 = convertOptionIdName(idOrName, null); - return filter(cmpts, function (cmpt) { - return cmpt && idName_1 != null && cmpt[attr] === idName_1; - }); - } + // Here is a break from echarts4: string and number are + // treated as equal. + if (isArray(idOrName)) { + var keyMap_1 = createHashMap(); + each(idOrName, function (idOrNameItem) { + if (idOrNameItem != null) { + var idName = convertOptionIdName(idOrNameItem, null); + idName != null && keyMap_1.set(idOrNameItem, true); + } + }); + return filter(cmpts, function (cmpt) { + return cmpt && keyMap_1.get(cmpt[attr]); + }); + } else { + var idName_1 = convertOptionIdName(idOrName, null); + return filter(cmpts, function (cmpt) { + return cmpt && idName_1 != null && cmpt[attr] === idName_1; + }); + } } function filterBySubType(components, condition) { - // Using hasOwnProperty for restrict. Consider - // subType is undefined in user payload. - return condition.hasOwnProperty('subType') ? filter(components, function (cmpt) { - return cmpt && cmpt.subType === condition.subType; - }) : components; + // Using hasOwnProperty for restrict. Consider + // subType is undefined in user payload. + return condition.hasOwnProperty('subType') ? filter(components, function (cmpt) { + return cmpt && cmpt.subType === condition.subType; + }) : components; } function normalizeSetOptionInput(opts) { - var replaceMergeMainTypeMap = createHashMap(); - opts && each(normalizeToArray(opts.replaceMerge), function (mainType) { - if ("development" !== 'production') { - assert(ComponentModel.hasClass(mainType), '"' + mainType + '" is not valid component main type in "replaceMerge"'); - } + var replaceMergeMainTypeMap = createHashMap(); + opts && each(normalizeToArray(opts.replaceMerge), function (mainType) { + if ("development" !== 'production') { + assert(ComponentModel.hasClass(mainType), '"' + mainType + '" is not valid component main type in "replaceMerge"'); + } - replaceMergeMainTypeMap.set(mainType, true); - }); - return { - replaceMergeMainTypeMap: replaceMergeMainTypeMap - }; + replaceMergeMainTypeMap.set(mainType, true); + }); + return { + replaceMergeMainTypeMap: replaceMergeMainTypeMap + }; } mixin(GlobalModel, PaletteMixin); var availableMethods = ['getDom', 'getZr', 'getWidth', 'getHeight', 'getDevicePixelRatio', 'dispatchAction', 'isSSR', 'isDisposed', 'on', 'off', 'getDataURL', 'getConnectedDataURL', // 'getModel', - 'getOption', // 'getViewOfComponentModel', - // 'getViewOfSeriesModel', - 'getId', 'updateLabelLayout']; + 'getOption', // 'getViewOfComponentModel', + // 'getViewOfSeriesModel', + 'getId', 'updateLabelLayout']; var ExtensionAPI = - /** @class */ - function () { - function ExtensionAPI(ecInstance) { - each(availableMethods, function (methodName) { - this[methodName] = bind(ecInstance[methodName], ecInstance); - }, this); - } + /** @class */ + function () { + function ExtensionAPI(ecInstance) { + each(availableMethods, function (methodName) { + this[methodName] = bind(ecInstance[methodName], ecInstance); + }, this); + } - return ExtensionAPI; - }(); + return ExtensionAPI; + }(); var coordinateSystemCreators = {}; var CoordinateSystemManager = - /** @class */ - function () { - function CoordinateSystemManager() { - this._coordinateSystems = []; - } - - CoordinateSystemManager.prototype.create = function (ecModel, api) { - var coordinateSystems = []; - each(coordinateSystemCreators, function (creater, type) { - var list = creater.create(ecModel, api); - coordinateSystems = coordinateSystems.concat(list || []); - }); - this._coordinateSystems = coordinateSystems; - }; + /** @class */ + function () { + function CoordinateSystemManager() { + this._coordinateSystems = []; + } + + CoordinateSystemManager.prototype.create = function (ecModel, api) { + var coordinateSystems = []; + each(coordinateSystemCreators, function (creater, type) { + var list = creater.create(ecModel, api); + coordinateSystems = coordinateSystems.concat(list || []); + }); + this._coordinateSystems = coordinateSystems; + }; - CoordinateSystemManager.prototype.update = function (ecModel, api) { - each(this._coordinateSystems, function (coordSys) { - coordSys.update && coordSys.update(ecModel, api); - }); - }; + CoordinateSystemManager.prototype.update = function (ecModel, api) { + each(this._coordinateSystems, function (coordSys) { + coordSys.update && coordSys.update(ecModel, api); + }); + }; - CoordinateSystemManager.prototype.getCoordinateSystems = function () { - return this._coordinateSystems.slice(); - }; + CoordinateSystemManager.prototype.getCoordinateSystems = function () { + return this._coordinateSystems.slice(); + }; - CoordinateSystemManager.register = function (type, creator) { - coordinateSystemCreators[type] = creator; - }; + CoordinateSystemManager.register = function (type, creator) { + coordinateSystemCreators[type] = creator; + }; - CoordinateSystemManager.get = function (type) { - return coordinateSystemCreators[type]; - }; + CoordinateSystemManager.get = function (type) { + return coordinateSystemCreators[type]; + }; - return CoordinateSystemManager; - }(); + return CoordinateSystemManager; + }(); var QUERY_REG = /^(min|max)?(.+)$/; // Key: mainType // type FakeComponentsMap = HashMap<(MappingExistingItem & { subType: string })[]>; @@ -19105,156 +19105,156 @@ */ var OptionManager = - /** @class */ - function () { - // timeline.notMerge is not supported in ec3. Firstly there is rearly - // case that notMerge is needed. Secondly supporting 'notMerge' requires - // rawOption cloned and backuped when timeline changed, which does no - // good to performance. What's more, that both timeline and setOption - // method supply 'notMerge' brings complex and some problems. - // Consider this case: - // (step1) chart.setOption({timeline: {notMerge: false}, ...}, false); - // (step2) chart.setOption({timeline: {notMerge: true}, ...}, false); - function OptionManager(api) { - this._timelineOptions = []; - this._mediaList = []; - /** - * -1, means default. - * empty means no media. - */ - - this._currentMediaIndices = []; - this._api = api; - } - - OptionManager.prototype.setOption = function (rawOption, optionPreprocessorFuncs, opt) { - if (rawOption) { - // That set dat primitive is dangerous if user reuse the data when setOption again. - each(normalizeToArray(rawOption.series), function (series) { - series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data); - }); - each(normalizeToArray(rawOption.dataset), function (dataset) { - dataset && dataset.source && isTypedArray(dataset.source) && setAsPrimitive(dataset.source); - }); - } // Caution: some series modify option data, if do not clone, - // it should ensure that the repeat modify correctly - // (create a new object when modify itself). - - - rawOption = clone(rawOption); // FIXME - // If some property is set in timeline options or media option but - // not set in baseOption, a warning should be given. - - var optionBackup = this._optionBackup; - var newParsedOption = parseRawOption(rawOption, optionPreprocessorFuncs, !optionBackup); - this._newBaseOption = newParsedOption.baseOption; // For setOption at second time (using merge mode); - - if (optionBackup) { - // FIXME - // the restore merge solution is essentially incorrect. - // the mapping can not be 100% consistent with ecModel, which probably brings - // potential bug! - // The first merge is delayed, becuase in most cases, users do not call `setOption` twice. - // let fakeCmptsMap = this._fakeCmptsMap; - // if (!fakeCmptsMap) { - // fakeCmptsMap = this._fakeCmptsMap = createHashMap(); - // mergeToBackupOption(fakeCmptsMap, null, optionBackup.baseOption, null); - // } - // mergeToBackupOption( - // fakeCmptsMap, optionBackup.baseOption, newParsedOption.baseOption, opt - // ); - // For simplicity, timeline options and media options do not support merge, - // that is, if you `setOption` twice and both has timeline options, the latter - // timeline opitons will not be merged to the formers, but just substitude them. - if (newParsedOption.timelineOptions.length) { - optionBackup.timelineOptions = newParsedOption.timelineOptions; - } - - if (newParsedOption.mediaList.length) { - optionBackup.mediaList = newParsedOption.mediaList; - } - - if (newParsedOption.mediaDefault) { - optionBackup.mediaDefault = newParsedOption.mediaDefault; - } - } else { - this._optionBackup = newParsedOption; - } - }; - - OptionManager.prototype.mountOption = function (isRecreate) { - var optionBackup = this._optionBackup; - this._timelineOptions = optionBackup.timelineOptions; - this._mediaList = optionBackup.mediaList; - this._mediaDefault = optionBackup.mediaDefault; - this._currentMediaIndices = []; - return clone(isRecreate // this._optionBackup.baseOption, which is created at the first `setOption` - // called, and is merged into every new option by inner method `mergeToBackupOption` - // each time `setOption` called, can be only used in `isRecreate`, because - // its reliability is under suspicion. In other cases option merge is - // performed by `model.mergeOption`. - ? optionBackup.baseOption : this._newBaseOption); - }; - - OptionManager.prototype.getTimelineOption = function (ecModel) { - var option; - var timelineOptions = this._timelineOptions; - - if (timelineOptions.length) { - // getTimelineOption can only be called after ecModel inited, - // so we can get currentIndex from timelineModel. - var timelineModel = ecModel.getComponent('timeline'); + /** @class */ + function () { + // timeline.notMerge is not supported in ec3. Firstly there is rearly + // case that notMerge is needed. Secondly supporting 'notMerge' requires + // rawOption cloned and backuped when timeline changed, which does no + // good to performance. What's more, that both timeline and setOption + // method supply 'notMerge' brings complex and some problems. + // Consider this case: + // (step1) chart.setOption({timeline: {notMerge: false}, ...}, false); + // (step2) chart.setOption({timeline: {notMerge: true}, ...}, false); + function OptionManager(api) { + this._timelineOptions = []; + this._mediaList = []; + /** + * -1, means default. + * empty means no media. + */ - if (timelineModel) { - option = clone( // FIXME:TS as TimelineModel or quivlant interface - timelineOptions[timelineModel.getCurrentIndex()]); - } - } + this._currentMediaIndices = []; + this._api = api; + } + + OptionManager.prototype.setOption = function (rawOption, optionPreprocessorFuncs, opt) { + if (rawOption) { + // That set dat primitive is dangerous if user reuse the data when setOption again. + each(normalizeToArray(rawOption.series), function (series) { + series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data); + }); + each(normalizeToArray(rawOption.dataset), function (dataset) { + dataset && dataset.source && isTypedArray(dataset.source) && setAsPrimitive(dataset.source); + }); + } // Caution: some series modify option data, if do not clone, + // it should ensure that the repeat modify correctly + // (create a new object when modify itself). + + + rawOption = clone(rawOption); // FIXME + // If some property is set in timeline options or media option but + // not set in baseOption, a warning should be given. + + var optionBackup = this._optionBackup; + var newParsedOption = parseRawOption(rawOption, optionPreprocessorFuncs, !optionBackup); + this._newBaseOption = newParsedOption.baseOption; // For setOption at second time (using merge mode); + + if (optionBackup) { + // FIXME + // the restore merge solution is essentially incorrect. + // the mapping can not be 100% consistent with ecModel, which probably brings + // potential bug! + // The first merge is delayed, becuase in most cases, users do not call `setOption` twice. + // let fakeCmptsMap = this._fakeCmptsMap; + // if (!fakeCmptsMap) { + // fakeCmptsMap = this._fakeCmptsMap = createHashMap(); + // mergeToBackupOption(fakeCmptsMap, null, optionBackup.baseOption, null); + // } + // mergeToBackupOption( + // fakeCmptsMap, optionBackup.baseOption, newParsedOption.baseOption, opt + // ); + // For simplicity, timeline options and media options do not support merge, + // that is, if you `setOption` twice and both has timeline options, the latter + // timeline opitons will not be merged to the formers, but just substitude them. + if (newParsedOption.timelineOptions.length) { + optionBackup.timelineOptions = newParsedOption.timelineOptions; + } + + if (newParsedOption.mediaList.length) { + optionBackup.mediaList = newParsedOption.mediaList; + } + + if (newParsedOption.mediaDefault) { + optionBackup.mediaDefault = newParsedOption.mediaDefault; + } + } else { + this._optionBackup = newParsedOption; + } + }; + + OptionManager.prototype.mountOption = function (isRecreate) { + var optionBackup = this._optionBackup; + this._timelineOptions = optionBackup.timelineOptions; + this._mediaList = optionBackup.mediaList; + this._mediaDefault = optionBackup.mediaDefault; + this._currentMediaIndices = []; + return clone(isRecreate // this._optionBackup.baseOption, which is created at the first `setOption` + // called, and is merged into every new option by inner method `mergeToBackupOption` + // each time `setOption` called, can be only used in `isRecreate`, because + // its reliability is under suspicion. In other cases option merge is + // performed by `model.mergeOption`. + ? optionBackup.baseOption : this._newBaseOption); + }; + + OptionManager.prototype.getTimelineOption = function (ecModel) { + var option; + var timelineOptions = this._timelineOptions; + + if (timelineOptions.length) { + // getTimelineOption can only be called after ecModel inited, + // so we can get currentIndex from timelineModel. + var timelineModel = ecModel.getComponent('timeline'); + + if (timelineModel) { + option = clone( // FIXME:TS as TimelineModel or quivlant interface + timelineOptions[timelineModel.getCurrentIndex()]); + } + } - return option; - }; + return option; + }; - OptionManager.prototype.getMediaOption = function (ecModel) { - var ecWidth = this._api.getWidth(); + OptionManager.prototype.getMediaOption = function (ecModel) { + var ecWidth = this._api.getWidth(); - var ecHeight = this._api.getHeight(); + var ecHeight = this._api.getHeight(); - var mediaList = this._mediaList; - var mediaDefault = this._mediaDefault; - var indices = []; - var result = []; // No media defined. + var mediaList = this._mediaList; + var mediaDefault = this._mediaDefault; + var indices = []; + var result = []; // No media defined. - if (!mediaList.length && !mediaDefault) { - return result; - } // Multi media may be applied, the latter defined media has higher priority. + if (!mediaList.length && !mediaDefault) { + return result; + } // Multi media may be applied, the latter defined media has higher priority. - for (var i = 0, len = mediaList.length; i < len; i++) { - if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) { - indices.push(i); - } - } // FIXME - // Whether mediaDefault should force users to provide? Otherwise - // the change by media query can not be recorvered. + for (var i = 0, len = mediaList.length; i < len; i++) { + if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) { + indices.push(i); + } + } // FIXME + // Whether mediaDefault should force users to provide? Otherwise + // the change by media query can not be recorvered. - if (!indices.length && mediaDefault) { - indices = [-1]; - } + if (!indices.length && mediaDefault) { + indices = [-1]; + } - if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) { - result = map(indices, function (index) { - return clone(index === -1 ? mediaDefault.option : mediaList[index].option); - }); - } // Otherwise return nothing. + if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) { + result = map(indices, function (index) { + return clone(index === -1 ? mediaDefault.option : mediaList[index].option); + }); + } // Otherwise return nothing. - this._currentMediaIndices = indices; - return result; - }; + this._currentMediaIndices = indices; + return result; + }; - return OptionManager; - }(); + return OptionManager; + }(); /** * [RAW_OPTION_PATTERNS] * (Note: "series: []" represents all other props in `ECUnitOption`) @@ -19319,81 +19319,81 @@ function parseRawOption( // `rawOption` May be modified - rawOption, optionPreprocessorFuncs, isNew) { - var mediaList = []; - var mediaDefault; - var baseOption; - var declaredBaseOption = rawOption.baseOption; // Compatible with ec2, [RAW_OPTION_PATTERNS] above. - - var timelineOnRoot = rawOption.timeline; - var timelineOptionsOnRoot = rawOption.options; - var mediaOnRoot = rawOption.media; - var hasMedia = !!rawOption.media; - var hasTimeline = !!(timelineOptionsOnRoot || timelineOnRoot || declaredBaseOption && declaredBaseOption.timeline); - - if (declaredBaseOption) { - baseOption = declaredBaseOption; // For merge option. - - if (!baseOption.timeline) { - baseOption.timeline = timelineOnRoot; - } - } // For convenience, enable to use the root option as the `baseOption`: - // `{ ...normalOptionProps, media: [{ ... }, { ... }] }` - else { - if (hasTimeline || hasMedia) { - rawOption.options = rawOption.media = null; - } + rawOption, optionPreprocessorFuncs, isNew) { + var mediaList = []; + var mediaDefault; + var baseOption; + var declaredBaseOption = rawOption.baseOption; // Compatible with ec2, [RAW_OPTION_PATTERNS] above. - baseOption = rawOption; + var timelineOnRoot = rawOption.timeline; + var timelineOptionsOnRoot = rawOption.options; + var mediaOnRoot = rawOption.media; + var hasMedia = !!rawOption.media; + var hasTimeline = !!(timelineOptionsOnRoot || timelineOnRoot || declaredBaseOption && declaredBaseOption.timeline); + + if (declaredBaseOption) { + baseOption = declaredBaseOption; // For merge option. + + if (!baseOption.timeline) { + baseOption.timeline = timelineOnRoot; } + } // For convenience, enable to use the root option as the `baseOption`: + // `{ ...normalOptionProps, media: [{ ... }, { ... }] }` + else { + if (hasTimeline || hasMedia) { + rawOption.options = rawOption.media = null; + } - if (hasMedia) { - if (isArray(mediaOnRoot)) { - each(mediaOnRoot, function (singleMedia) { - if ("development" !== 'production') { - // Real case of wrong config. - if (singleMedia && !singleMedia.option && isObject(singleMedia.query) && isObject(singleMedia.query.option)) { - error('Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }'); - } - } + baseOption = rawOption; + } - if (singleMedia && singleMedia.option) { - if (singleMedia.query) { - mediaList.push(singleMedia); - } else if (!mediaDefault) { - // Use the first media default. - mediaDefault = singleMedia; - } - } - }); - } else { - if ("development" !== 'production') { - // Real case of wrong config. - error('Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }'); - } + if (hasMedia) { + if (isArray(mediaOnRoot)) { + each(mediaOnRoot, function (singleMedia) { + if ("development" !== 'production') { + // Real case of wrong config. + if (singleMedia && !singleMedia.option && isObject(singleMedia.query) && isObject(singleMedia.query.option)) { + error('Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }'); + } } - } - doPreprocess(baseOption); - each(timelineOptionsOnRoot, function (option) { - return doPreprocess(option); - }); - each(mediaList, function (media) { - return doPreprocess(media.option); + if (singleMedia && singleMedia.option) { + if (singleMedia.query) { + mediaList.push(singleMedia); + } else if (!mediaDefault) { + // Use the first media default. + mediaDefault = singleMedia; + } + } + }); + } else { + if ("development" !== 'production') { + // Real case of wrong config. + error('Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }'); + } + } + } + + doPreprocess(baseOption); + each(timelineOptionsOnRoot, function (option) { + return doPreprocess(option); + }); + each(mediaList, function (media) { + return doPreprocess(media.option); + }); + + function doPreprocess(option) { + each(optionPreprocessorFuncs, function (preProcess) { + preProcess(option, isNew); }); + } - function doPreprocess(option) { - each(optionPreprocessorFuncs, function (preProcess) { - preProcess(option, isNew); - }); - } - - return { - baseOption: baseOption, - timelineOptions: timelineOptionsOnRoot || [], - mediaDefault: mediaDefault, - mediaList: mediaList - }; + return { + baseOption: baseOption, + timelineOptions: timelineOptionsOnRoot || [], + mediaDefault: mediaDefault, + mediaList: mediaList + }; } /** * @see @@ -19403,44 +19403,44 @@ function applyMediaQuery(query, ecWidth, ecHeight) { - var realMap = { - width: ecWidth, - height: ecHeight, - aspectratio: ecWidth / ecHeight // lowser case for convenientce. + var realMap = { + width: ecWidth, + height: ecHeight, + aspectratio: ecWidth / ecHeight // lowser case for convenientce. - }; - var applicatable = true; - each(query, function (value, attr) { - var matched = attr.match(QUERY_REG); + }; + var applicatable = true; + each(query, function (value, attr) { + var matched = attr.match(QUERY_REG); - if (!matched || !matched[1] || !matched[2]) { - return; - } + if (!matched || !matched[1] || !matched[2]) { + return; + } - var operator = matched[1]; - var realAttr = matched[2].toLowerCase(); + var operator = matched[1]; + var realAttr = matched[2].toLowerCase(); - if (!compare(realMap[realAttr], value, operator)) { - applicatable = false; - } - }); - return applicatable; + if (!compare(realMap[realAttr], value, operator)) { + applicatable = false; + } + }); + return applicatable; } function compare(real, expect, operator) { - if (operator === 'min') { - return real >= expect; - } else if (operator === 'max') { - return real <= expect; - } else { - // Equals - return real === expect; - } + if (operator === 'min') { + return real >= expect; + } else if (operator === 'max') { + return real <= expect; + } else { + // Equals + return real === expect; + } } function indicesEquals(indices1, indices2) { - // indices is always order by asc and has only finite number. - return indices1.join(',') === indices2.join(','); + // indices is always order by asc and has only finite number. + return indices1.join(',') === indices2.join(','); } var each$2 = each; @@ -19448,377 +19448,377 @@ var POSSIBLE_STYLES = ['areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle', 'chordStyle', 'label', 'labelLine']; function compatEC2ItemStyle(opt) { - var itemStyleOpt = opt && opt.itemStyle; + var itemStyleOpt = opt && opt.itemStyle; - if (!itemStyleOpt) { - return; - } + if (!itemStyleOpt) { + return; + } - for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) { - var styleName = POSSIBLE_STYLES[i]; - var normalItemStyleOpt = itemStyleOpt.normal; - var emphasisItemStyleOpt = itemStyleOpt.emphasis; + for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) { + var styleName = POSSIBLE_STYLES[i]; + var normalItemStyleOpt = itemStyleOpt.normal; + var emphasisItemStyleOpt = itemStyleOpt.emphasis; - if (normalItemStyleOpt && normalItemStyleOpt[styleName]) { - if ("development" !== 'production') { - deprecateReplaceLog("itemStyle.normal." + styleName, styleName); - } + if (normalItemStyleOpt && normalItemStyleOpt[styleName]) { + if ("development" !== 'production') { + deprecateReplaceLog("itemStyle.normal." + styleName, styleName); + } - opt[styleName] = opt[styleName] || {}; + opt[styleName] = opt[styleName] || {}; - if (!opt[styleName].normal) { - opt[styleName].normal = normalItemStyleOpt[styleName]; - } else { - merge(opt[styleName].normal, normalItemStyleOpt[styleName]); - } + if (!opt[styleName].normal) { + opt[styleName].normal = normalItemStyleOpt[styleName]; + } else { + merge(opt[styleName].normal, normalItemStyleOpt[styleName]); + } - normalItemStyleOpt[styleName] = null; - } + normalItemStyleOpt[styleName] = null; + } - if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) { - if ("development" !== 'production') { - deprecateReplaceLog("itemStyle.emphasis." + styleName, "emphasis." + styleName); - } + if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) { + if ("development" !== 'production') { + deprecateReplaceLog("itemStyle.emphasis." + styleName, "emphasis." + styleName); + } - opt[styleName] = opt[styleName] || {}; + opt[styleName] = opt[styleName] || {}; - if (!opt[styleName].emphasis) { - opt[styleName].emphasis = emphasisItemStyleOpt[styleName]; - } else { - merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]); - } + if (!opt[styleName].emphasis) { + opt[styleName].emphasis = emphasisItemStyleOpt[styleName]; + } else { + merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]); + } - emphasisItemStyleOpt[styleName] = null; - } + emphasisItemStyleOpt[styleName] = null; } + } } function convertNormalEmphasis(opt, optType, useExtend) { - if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) { - var normalOpt = opt[optType].normal; - var emphasisOpt = opt[optType].emphasis; + if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) { + var normalOpt = opt[optType].normal; + var emphasisOpt = opt[optType].emphasis; - if (normalOpt) { - if ("development" !== 'production') { - // eslint-disable-next-line max-len - deprecateLog("'normal' hierarchy in " + optType + " has been removed since 4.0. All style properties are configured in " + optType + " directly now."); - } // Timeline controlStyle has other properties besides normal and emphasis + if (normalOpt) { + if ("development" !== 'production') { + // eslint-disable-next-line max-len + deprecateLog("'normal' hierarchy in " + optType + " has been removed since 4.0. All style properties are configured in " + optType + " directly now."); + } // Timeline controlStyle has other properties besides normal and emphasis - if (useExtend) { - opt[optType].normal = opt[optType].emphasis = null; - defaults(opt[optType], normalOpt); - } else { - opt[optType] = normalOpt; - } - } + if (useExtend) { + opt[optType].normal = opt[optType].emphasis = null; + defaults(opt[optType], normalOpt); + } else { + opt[optType] = normalOpt; + } + } - if (emphasisOpt) { - if ("development" !== 'production') { - deprecateLog(optType + ".emphasis has been changed to emphasis." + optType + " since 4.0"); - } + if (emphasisOpt) { + if ("development" !== 'production') { + deprecateLog(optType + ".emphasis has been changed to emphasis." + optType + " since 4.0"); + } - opt.emphasis = opt.emphasis || {}; - opt.emphasis[optType] = emphasisOpt; // Also compat the case user mix the style and focus together in ec3 style - // for example: { itemStyle: { normal: {}, emphasis: {focus, shadowBlur} } } + opt.emphasis = opt.emphasis || {}; + opt.emphasis[optType] = emphasisOpt; // Also compat the case user mix the style and focus together in ec3 style + // for example: { itemStyle: { normal: {}, emphasis: {focus, shadowBlur} } } - if (emphasisOpt.focus) { - opt.emphasis.focus = emphasisOpt.focus; - } + if (emphasisOpt.focus) { + opt.emphasis.focus = emphasisOpt.focus; + } - if (emphasisOpt.blurScope) { - opt.emphasis.blurScope = emphasisOpt.blurScope; - } - } + if (emphasisOpt.blurScope) { + opt.emphasis.blurScope = emphasisOpt.blurScope; + } } + } } function removeEC3NormalStatus(opt) { - convertNormalEmphasis(opt, 'itemStyle'); - convertNormalEmphasis(opt, 'lineStyle'); - convertNormalEmphasis(opt, 'areaStyle'); - convertNormalEmphasis(opt, 'label'); - convertNormalEmphasis(opt, 'labelLine'); // treemap + convertNormalEmphasis(opt, 'itemStyle'); + convertNormalEmphasis(opt, 'lineStyle'); + convertNormalEmphasis(opt, 'areaStyle'); + convertNormalEmphasis(opt, 'label'); + convertNormalEmphasis(opt, 'labelLine'); // treemap - convertNormalEmphasis(opt, 'upperLabel'); // graph + convertNormalEmphasis(opt, 'upperLabel'); // graph - convertNormalEmphasis(opt, 'edgeLabel'); + convertNormalEmphasis(opt, 'edgeLabel'); } function compatTextStyle(opt, propName) { - // Check whether is not object (string\null\undefined ...) - var labelOptSingle = isObject$1(opt) && opt[propName]; - var textStyle = isObject$1(labelOptSingle) && labelOptSingle.textStyle; + // Check whether is not object (string\null\undefined ...) + var labelOptSingle = isObject$1(opt) && opt[propName]; + var textStyle = isObject$1(labelOptSingle) && labelOptSingle.textStyle; - if (textStyle) { - if ("development" !== 'production') { - // eslint-disable-next-line max-len - deprecateLog("textStyle hierarchy in " + propName + " has been removed since 4.0. All textStyle properties are configured in " + propName + " directly now."); - } + if (textStyle) { + if ("development" !== 'production') { + // eslint-disable-next-line max-len + deprecateLog("textStyle hierarchy in " + propName + " has been removed since 4.0. All textStyle properties are configured in " + propName + " directly now."); + } - for (var i = 0, len = TEXT_STYLE_OPTIONS.length; i < len; i++) { - var textPropName = TEXT_STYLE_OPTIONS[i]; + for (var i = 0, len = TEXT_STYLE_OPTIONS.length; i < len; i++) { + var textPropName = TEXT_STYLE_OPTIONS[i]; - if (textStyle.hasOwnProperty(textPropName)) { - labelOptSingle[textPropName] = textStyle[textPropName]; - } - } + if (textStyle.hasOwnProperty(textPropName)) { + labelOptSingle[textPropName] = textStyle[textPropName]; + } } + } } function compatEC3CommonStyles(opt) { - if (opt) { - removeEC3NormalStatus(opt); - compatTextStyle(opt, 'label'); - opt.emphasis && compatTextStyle(opt.emphasis, 'label'); - } + if (opt) { + removeEC3NormalStatus(opt); + compatTextStyle(opt, 'label'); + opt.emphasis && compatTextStyle(opt.emphasis, 'label'); + } } function processSeries(seriesOpt) { - if (!isObject$1(seriesOpt)) { - return; - } - - compatEC2ItemStyle(seriesOpt); - removeEC3NormalStatus(seriesOpt); - compatTextStyle(seriesOpt, 'label'); // treemap + if (!isObject$1(seriesOpt)) { + return; + } - compatTextStyle(seriesOpt, 'upperLabel'); // graph + compatEC2ItemStyle(seriesOpt); + removeEC3NormalStatus(seriesOpt); + compatTextStyle(seriesOpt, 'label'); // treemap - compatTextStyle(seriesOpt, 'edgeLabel'); + compatTextStyle(seriesOpt, 'upperLabel'); // graph - if (seriesOpt.emphasis) { - compatTextStyle(seriesOpt.emphasis, 'label'); // treemap + compatTextStyle(seriesOpt, 'edgeLabel'); - compatTextStyle(seriesOpt.emphasis, 'upperLabel'); // graph + if (seriesOpt.emphasis) { + compatTextStyle(seriesOpt.emphasis, 'label'); // treemap - compatTextStyle(seriesOpt.emphasis, 'edgeLabel'); - } + compatTextStyle(seriesOpt.emphasis, 'upperLabel'); // graph - var markPoint = seriesOpt.markPoint; + compatTextStyle(seriesOpt.emphasis, 'edgeLabel'); + } - if (markPoint) { - compatEC2ItemStyle(markPoint); - compatEC3CommonStyles(markPoint); - } + var markPoint = seriesOpt.markPoint; - var markLine = seriesOpt.markLine; + if (markPoint) { + compatEC2ItemStyle(markPoint); + compatEC3CommonStyles(markPoint); + } - if (markLine) { - compatEC2ItemStyle(markLine); - compatEC3CommonStyles(markLine); - } + var markLine = seriesOpt.markLine; - var markArea = seriesOpt.markArea; + if (markLine) { + compatEC2ItemStyle(markLine); + compatEC3CommonStyles(markLine); + } - if (markArea) { - compatEC3CommonStyles(markArea); - } + var markArea = seriesOpt.markArea; - var data = seriesOpt.data; // Break with ec3: if `setOption` again, there may be no `type` in option, - // then the backward compat based on option type will not be performed. + if (markArea) { + compatEC3CommonStyles(markArea); + } - if (seriesOpt.type === 'graph') { - data = data || seriesOpt.nodes; - var edgeData = seriesOpt.links || seriesOpt.edges; + var data = seriesOpt.data; // Break with ec3: if `setOption` again, there may be no `type` in option, + // then the backward compat based on option type will not be performed. - if (edgeData && !isTypedArray(edgeData)) { - for (var i = 0; i < edgeData.length; i++) { - compatEC3CommonStyles(edgeData[i]); - } - } + if (seriesOpt.type === 'graph') { + data = data || seriesOpt.nodes; + var edgeData = seriesOpt.links || seriesOpt.edges; - each(seriesOpt.categories, function (opt) { - removeEC3NormalStatus(opt); - }); + if (edgeData && !isTypedArray(edgeData)) { + for (var i = 0; i < edgeData.length; i++) { + compatEC3CommonStyles(edgeData[i]); + } } - if (data && !isTypedArray(data)) { - for (var i = 0; i < data.length; i++) { - compatEC3CommonStyles(data[i]); - } - } // mark point data + each(seriesOpt.categories, function (opt) { + removeEC3NormalStatus(opt); + }); + } + if (data && !isTypedArray(data)) { + for (var i = 0; i < data.length; i++) { + compatEC3CommonStyles(data[i]); + } + } // mark point data - markPoint = seriesOpt.markPoint; - if (markPoint && markPoint.data) { - var mpData = markPoint.data; + markPoint = seriesOpt.markPoint; - for (var i = 0; i < mpData.length; i++) { - compatEC3CommonStyles(mpData[i]); - } - } // mark line data + if (markPoint && markPoint.data) { + var mpData = markPoint.data; + + for (var i = 0; i < mpData.length; i++) { + compatEC3CommonStyles(mpData[i]); + } + } // mark line data - markLine = seriesOpt.markLine; + markLine = seriesOpt.markLine; - if (markLine && markLine.data) { - var mlData = markLine.data; + if (markLine && markLine.data) { + var mlData = markLine.data; - for (var i = 0; i < mlData.length; i++) { - if (isArray(mlData[i])) { - compatEC3CommonStyles(mlData[i][0]); - compatEC3CommonStyles(mlData[i][1]); - } else { - compatEC3CommonStyles(mlData[i]); - } - } - } // Series + for (var i = 0; i < mlData.length; i++) { + if (isArray(mlData[i])) { + compatEC3CommonStyles(mlData[i][0]); + compatEC3CommonStyles(mlData[i][1]); + } else { + compatEC3CommonStyles(mlData[i]); + } + } + } // Series - if (seriesOpt.type === 'gauge') { - compatTextStyle(seriesOpt, 'axisLabel'); - compatTextStyle(seriesOpt, 'title'); - compatTextStyle(seriesOpt, 'detail'); - } else if (seriesOpt.type === 'treemap') { - convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle'); - each(seriesOpt.levels, function (opt) { - removeEC3NormalStatus(opt); - }); - } else if (seriesOpt.type === 'tree') { - removeEC3NormalStatus(seriesOpt.leaves); - } // sunburst starts from ec4, so it does not need to compat levels. + if (seriesOpt.type === 'gauge') { + compatTextStyle(seriesOpt, 'axisLabel'); + compatTextStyle(seriesOpt, 'title'); + compatTextStyle(seriesOpt, 'detail'); + } else if (seriesOpt.type === 'treemap') { + convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle'); + each(seriesOpt.levels, function (opt) { + removeEC3NormalStatus(opt); + }); + } else if (seriesOpt.type === 'tree') { + removeEC3NormalStatus(seriesOpt.leaves); + } // sunburst starts from ec4, so it does not need to compat levels. } function toArr(o) { - return isArray(o) ? o : o ? [o] : []; + return isArray(o) ? o : o ? [o] : []; } function toObj(o) { - return (isArray(o) ? o[0] : o) || {}; + return (isArray(o) ? o[0] : o) || {}; } function globalCompatStyle(option, isTheme) { - each$2(toArr(option.series), function (seriesOpt) { - isObject$1(seriesOpt) && processSeries(seriesOpt); - }); - var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar']; - isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis'); - each$2(axes, function (axisName) { - each$2(toArr(option[axisName]), function (axisOpt) { - if (axisOpt) { - compatTextStyle(axisOpt, 'axisLabel'); - compatTextStyle(axisOpt.axisPointer, 'label'); - } - }); + each$2(toArr(option.series), function (seriesOpt) { + isObject$1(seriesOpt) && processSeries(seriesOpt); + }); + var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar']; + isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis'); + each$2(axes, function (axisName) { + each$2(toArr(option[axisName]), function (axisOpt) { + if (axisOpt) { + compatTextStyle(axisOpt, 'axisLabel'); + compatTextStyle(axisOpt.axisPointer, 'label'); + } }); - each$2(toArr(option.parallel), function (parallelOpt) { - var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault; - compatTextStyle(parallelAxisDefault, 'axisLabel'); - compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label'); - }); - each$2(toArr(option.calendar), function (calendarOpt) { - convertNormalEmphasis(calendarOpt, 'itemStyle'); - compatTextStyle(calendarOpt, 'dayLabel'); - compatTextStyle(calendarOpt, 'monthLabel'); - compatTextStyle(calendarOpt, 'yearLabel'); - }); // radar.name.textStyle + }); + each$2(toArr(option.parallel), function (parallelOpt) { + var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault; + compatTextStyle(parallelAxisDefault, 'axisLabel'); + compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label'); + }); + each$2(toArr(option.calendar), function (calendarOpt) { + convertNormalEmphasis(calendarOpt, 'itemStyle'); + compatTextStyle(calendarOpt, 'dayLabel'); + compatTextStyle(calendarOpt, 'monthLabel'); + compatTextStyle(calendarOpt, 'yearLabel'); + }); // radar.name.textStyle - each$2(toArr(option.radar), function (radarOpt) { - compatTextStyle(radarOpt, 'name'); // Use axisName instead of name because component has name property + each$2(toArr(option.radar), function (radarOpt) { + compatTextStyle(radarOpt, 'name'); // Use axisName instead of name because component has name property - if (radarOpt.name && radarOpt.axisName == null) { - radarOpt.axisName = radarOpt.name; - delete radarOpt.name; + if (radarOpt.name && radarOpt.axisName == null) { + radarOpt.axisName = radarOpt.name; + delete radarOpt.name; - if ("development" !== 'production') { - deprecateLog('name property in radar component has been changed to axisName'); - } - } + if ("development" !== 'production') { + deprecateLog('name property in radar component has been changed to axisName'); + } + } - if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) { - radarOpt.axisNameGap = radarOpt.nameGap; - delete radarOpt.nameGap; + if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) { + radarOpt.axisNameGap = radarOpt.nameGap; + delete radarOpt.nameGap; - if ("development" !== 'production') { - deprecateLog('nameGap property in radar component has been changed to axisNameGap'); - } - } + if ("development" !== 'production') { + deprecateLog('nameGap property in radar component has been changed to axisNameGap'); + } + } - if ("development" !== 'production') { - each$2(radarOpt.indicator, function (indicatorOpt) { - if (indicatorOpt.text) { - deprecateReplaceLog('text', 'name', 'radar.indicator'); - } - }); - } - }); - each$2(toArr(option.geo), function (geoOpt) { - if (isObject$1(geoOpt)) { - compatEC3CommonStyles(geoOpt); - each$2(toArr(geoOpt.regions), function (regionObj) { - compatEC3CommonStyles(regionObj); - }); - } - }); - each$2(toArr(option.timeline), function (timelineOpt) { - compatEC3CommonStyles(timelineOpt); - convertNormalEmphasis(timelineOpt, 'label'); - convertNormalEmphasis(timelineOpt, 'itemStyle'); - convertNormalEmphasis(timelineOpt, 'controlStyle', true); - var data = timelineOpt.data; - isArray(data) && each(data, function (item) { - if (isObject(item)) { - convertNormalEmphasis(item, 'label'); - convertNormalEmphasis(item, 'itemStyle'); - } - }); + if ("development" !== 'production') { + each$2(radarOpt.indicator, function (indicatorOpt) { + if (indicatorOpt.text) { + deprecateReplaceLog('text', 'name', 'radar.indicator'); + } + }); + } + }); + each$2(toArr(option.geo), function (geoOpt) { + if (isObject$1(geoOpt)) { + compatEC3CommonStyles(geoOpt); + each$2(toArr(geoOpt.regions), function (regionObj) { + compatEC3CommonStyles(regionObj); + }); + } + }); + each$2(toArr(option.timeline), function (timelineOpt) { + compatEC3CommonStyles(timelineOpt); + convertNormalEmphasis(timelineOpt, 'label'); + convertNormalEmphasis(timelineOpt, 'itemStyle'); + convertNormalEmphasis(timelineOpt, 'controlStyle', true); + var data = timelineOpt.data; + isArray(data) && each(data, function (item) { + if (isObject(item)) { + convertNormalEmphasis(item, 'label'); + convertNormalEmphasis(item, 'itemStyle'); + } }); - each$2(toArr(option.toolbox), function (toolboxOpt) { - convertNormalEmphasis(toolboxOpt, 'iconStyle'); - each$2(toolboxOpt.feature, function (featureOpt) { - convertNormalEmphasis(featureOpt, 'iconStyle'); - }); + }); + each$2(toArr(option.toolbox), function (toolboxOpt) { + convertNormalEmphasis(toolboxOpt, 'iconStyle'); + each$2(toolboxOpt.feature, function (featureOpt) { + convertNormalEmphasis(featureOpt, 'iconStyle'); }); - compatTextStyle(toObj(option.axisPointer), 'label'); - compatTextStyle(toObj(option.tooltip).axisPointer, 'label'); // Clean logs - // storedLogs = {}; + }); + compatTextStyle(toObj(option.axisPointer), 'label'); + compatTextStyle(toObj(option.tooltip).axisPointer, 'label'); // Clean logs + // storedLogs = {}; } function get(opt, path) { - var pathArr = path.split(','); - var obj = opt; + var pathArr = path.split(','); + var obj = opt; - for (var i = 0; i < pathArr.length; i++) { - obj = obj && obj[pathArr[i]]; + for (var i = 0; i < pathArr.length; i++) { + obj = obj && obj[pathArr[i]]; - if (obj == null) { - break; - } + if (obj == null) { + break; } + } - return obj; + return obj; } function set$1(opt, path, val, overwrite) { - var pathArr = path.split(','); - var obj = opt; - var key; - var i = 0; - - for (; i < pathArr.length - 1; i++) { - key = pathArr[i]; + var pathArr = path.split(','); + var obj = opt; + var key; + var i = 0; - if (obj[key] == null) { - obj[key] = {}; - } + for (; i < pathArr.length - 1; i++) { + key = pathArr[i]; - obj = obj[key]; + if (obj[key] == null) { + obj[key] = {}; } - if (overwrite || obj[pathArr[i]] == null) { - obj[pathArr[i]] = val; - } + obj = obj[key]; + } + + if (overwrite || obj[pathArr[i]] == null) { + obj[pathArr[i]] = val; + } } function compatLayoutProperties(option) { - option && each(LAYOUT_PROPERTIES, function (prop) { - if (prop[0] in option && !(prop[1] in option)) { - option[prop[1]] = option[prop[0]]; - } - }); + option && each(LAYOUT_PROPERTIES, function (prop) { + if (prop[0] in option && !(prop[1] in option)) { + option[prop[1]] = option[prop[0]]; + } + }); } var LAYOUT_PROPERTIES = [['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom']]; @@ -19826,213 +19826,213 @@ var BAR_ITEM_STYLE_MAP = [['borderRadius', 'barBorderRadius'], ['borderColor', 'barBorderColor'], ['borderWidth', 'barBorderWidth']]; function compatBarItemStyle(option) { - var itemStyle = option && option.itemStyle; + var itemStyle = option && option.itemStyle; - if (itemStyle) { - for (var i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) { - var oldName = BAR_ITEM_STYLE_MAP[i][1]; - var newName = BAR_ITEM_STYLE_MAP[i][0]; + if (itemStyle) { + for (var i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) { + var oldName = BAR_ITEM_STYLE_MAP[i][1]; + var newName = BAR_ITEM_STYLE_MAP[i][0]; - if (itemStyle[oldName] != null) { - itemStyle[newName] = itemStyle[oldName]; + if (itemStyle[oldName] != null) { + itemStyle[newName] = itemStyle[oldName]; - if ("development" !== 'production') { - deprecateReplaceLog(oldName, newName); - } - } + if ("development" !== 'production') { + deprecateReplaceLog(oldName, newName); } + } } + } } function compatPieLabel(option) { - if (!option) { - return; - } - - if (option.alignTo === 'edge' && option.margin != null && option.edgeDistance == null) { - if ("development" !== 'production') { - deprecateReplaceLog('label.margin', 'label.edgeDistance', 'pie'); - } + if (!option) { + return; + } - option.edgeDistance = option.margin; + if (option.alignTo === 'edge' && option.margin != null && option.edgeDistance == null) { + if ("development" !== 'production') { + deprecateReplaceLog('label.margin', 'label.edgeDistance', 'pie'); } + + option.edgeDistance = option.margin; + } } function compatSunburstState(option) { - if (!option) { - return; - } + if (!option) { + return; + } - if (option.downplay && !option.blur) { - option.blur = option.downplay; + if (option.downplay && !option.blur) { + option.blur = option.downplay; - if ("development" !== 'production') { - deprecateReplaceLog('downplay', 'blur', 'sunburst'); - } + if ("development" !== 'production') { + deprecateReplaceLog('downplay', 'blur', 'sunburst'); } + } } function compatGraphFocus(option) { - if (!option) { - return; - } + if (!option) { + return; + } - if (option.focusNodeAdjacency != null) { - option.emphasis = option.emphasis || {}; + if (option.focusNodeAdjacency != null) { + option.emphasis = option.emphasis || {}; - if (option.emphasis.focus == null) { - if ("development" !== 'production') { - deprecateReplaceLog('focusNodeAdjacency', 'emphasis: { focus: \'adjacency\'}', 'graph/sankey'); - } + if (option.emphasis.focus == null) { + if ("development" !== 'production') { + deprecateReplaceLog('focusNodeAdjacency', 'emphasis: { focus: \'adjacency\'}', 'graph/sankey'); + } - option.emphasis.focus = 'adjacency'; - } + option.emphasis.focus = 'adjacency'; } + } } function traverseTree(data, cb) { - if (data) { - for (var i = 0; i < data.length; i++) { - cb(data[i]); - data[i] && traverseTree(data[i].children, cb); - } + if (data) { + for (var i = 0; i < data.length; i++) { + cb(data[i]); + data[i] && traverseTree(data[i].children, cb); } + } } function globalBackwardCompat(option, isTheme) { - globalCompatStyle(option, isTheme); // Make sure series array for model initialization. + globalCompatStyle(option, isTheme); // Make sure series array for model initialization. - option.series = normalizeToArray(option.series); - each(option.series, function (seriesOpt) { - if (!isObject(seriesOpt)) { - return; - } + option.series = normalizeToArray(option.series); + each(option.series, function (seriesOpt) { + if (!isObject(seriesOpt)) { + return; + } - var seriesType = seriesOpt.type; + var seriesType = seriesOpt.type; - if (seriesType === 'line') { - if (seriesOpt.clipOverflow != null) { - seriesOpt.clip = seriesOpt.clipOverflow; + if (seriesType === 'line') { + if (seriesOpt.clipOverflow != null) { + seriesOpt.clip = seriesOpt.clipOverflow; - if ("development" !== 'production') { - deprecateReplaceLog('clipOverflow', 'clip', 'line'); - } - } - } else if (seriesType === 'pie' || seriesType === 'gauge') { - if (seriesOpt.clockWise != null) { - seriesOpt.clockwise = seriesOpt.clockWise; + if ("development" !== 'production') { + deprecateReplaceLog('clipOverflow', 'clip', 'line'); + } + } + } else if (seriesType === 'pie' || seriesType === 'gauge') { + if (seriesOpt.clockWise != null) { + seriesOpt.clockwise = seriesOpt.clockWise; - if ("development" !== 'production') { - deprecateReplaceLog('clockWise', 'clockwise'); - } - } + if ("development" !== 'production') { + deprecateReplaceLog('clockWise', 'clockwise'); + } + } - compatPieLabel(seriesOpt.label); - var data = seriesOpt.data; + compatPieLabel(seriesOpt.label); + var data = seriesOpt.data; - if (data && !isTypedArray(data)) { - for (var i = 0; i < data.length; i++) { - compatPieLabel(data[i]); - } - } + if (data && !isTypedArray(data)) { + for (var i = 0; i < data.length; i++) { + compatPieLabel(data[i]); + } + } - if (seriesOpt.hoverOffset != null) { - seriesOpt.emphasis = seriesOpt.emphasis || {}; + if (seriesOpt.hoverOffset != null) { + seriesOpt.emphasis = seriesOpt.emphasis || {}; - if (seriesOpt.emphasis.scaleSize = null) { - if ("development" !== 'production') { - deprecateReplaceLog('hoverOffset', 'emphasis.scaleSize'); - } + if (seriesOpt.emphasis.scaleSize = null) { + if ("development" !== 'production') { + deprecateReplaceLog('hoverOffset', 'emphasis.scaleSize'); + } - seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset; - } - } - } else if (seriesType === 'gauge') { - var pointerColor = get(seriesOpt, 'pointer.color'); - pointerColor != null && set$1(seriesOpt, 'itemStyle.color', pointerColor); - } else if (seriesType === 'bar') { - compatBarItemStyle(seriesOpt); - compatBarItemStyle(seriesOpt.backgroundStyle); - compatBarItemStyle(seriesOpt.emphasis); - var data = seriesOpt.data; - - if (data && !isTypedArray(data)) { - for (var i = 0; i < data.length; i++) { - if (typeof data[i] === 'object') { - compatBarItemStyle(data[i]); - compatBarItemStyle(data[i] && data[i].emphasis); - } - } - } - } else if (seriesType === 'sunburst') { - var highlightPolicy = seriesOpt.highlightPolicy; + seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset; + } + } + } else if (seriesType === 'gauge') { + var pointerColor = get(seriesOpt, 'pointer.color'); + pointerColor != null && set$1(seriesOpt, 'itemStyle.color', pointerColor); + } else if (seriesType === 'bar') { + compatBarItemStyle(seriesOpt); + compatBarItemStyle(seriesOpt.backgroundStyle); + compatBarItemStyle(seriesOpt.emphasis); + var data = seriesOpt.data; - if (highlightPolicy) { - seriesOpt.emphasis = seriesOpt.emphasis || {}; + if (data && !isTypedArray(data)) { + for (var i = 0; i < data.length; i++) { + if (typeof data[i] === 'object') { + compatBarItemStyle(data[i]); + compatBarItemStyle(data[i] && data[i].emphasis); + } + } + } + } else if (seriesType === 'sunburst') { + var highlightPolicy = seriesOpt.highlightPolicy; - if (!seriesOpt.emphasis.focus) { - seriesOpt.emphasis.focus = highlightPolicy; + if (highlightPolicy) { + seriesOpt.emphasis = seriesOpt.emphasis || {}; - if ("development" !== 'production') { - deprecateReplaceLog('highlightPolicy', 'emphasis.focus', 'sunburst'); - } - } - } + if (!seriesOpt.emphasis.focus) { + seriesOpt.emphasis.focus = highlightPolicy; - compatSunburstState(seriesOpt); - traverseTree(seriesOpt.data, compatSunburstState); - } else if (seriesType === 'graph' || seriesType === 'sankey') { - compatGraphFocus(seriesOpt); // TODO nodes, edges? - } else if (seriesType === 'map') { - if (seriesOpt.mapType && !seriesOpt.map) { - if ("development" !== 'production') { - deprecateReplaceLog('mapType', 'map', 'map'); - } + if ("development" !== 'production') { + deprecateReplaceLog('highlightPolicy', 'emphasis.focus', 'sunburst'); + } + } + } - seriesOpt.map = seriesOpt.mapType; - } + compatSunburstState(seriesOpt); + traverseTree(seriesOpt.data, compatSunburstState); + } else if (seriesType === 'graph' || seriesType === 'sankey') { + compatGraphFocus(seriesOpt); // TODO nodes, edges? + } else if (seriesType === 'map') { + if (seriesOpt.mapType && !seriesOpt.map) { + if ("development" !== 'production') { + deprecateReplaceLog('mapType', 'map', 'map'); + } - if (seriesOpt.mapLocation) { - if ("development" !== 'production') { - deprecateLog('`mapLocation` is not used anymore.'); - } + seriesOpt.map = seriesOpt.mapType; + } - defaults(seriesOpt, seriesOpt.mapLocation); - } + if (seriesOpt.mapLocation) { + if ("development" !== 'production') { + deprecateLog('`mapLocation` is not used anymore.'); } - if (seriesOpt.hoverAnimation != null) { - seriesOpt.emphasis = seriesOpt.emphasis || {}; + defaults(seriesOpt, seriesOpt.mapLocation); + } + } - if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) { - if ("development" !== 'production') { - deprecateReplaceLog('hoverAnimation', 'emphasis.scale'); - } + if (seriesOpt.hoverAnimation != null) { + seriesOpt.emphasis = seriesOpt.emphasis || {}; - seriesOpt.emphasis.scale = seriesOpt.hoverAnimation; - } + if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) { + if ("development" !== 'production') { + deprecateReplaceLog('hoverAnimation', 'emphasis.scale'); } - compatLayoutProperties(seriesOpt); - }); // dataRange has changed to visualMap - - if (option.dataRange) { - option.visualMap = option.dataRange; + seriesOpt.emphasis.scale = seriesOpt.hoverAnimation; + } } - each(COMPATITABLE_COMPONENTS, function (componentName) { - var options = option[componentName]; + compatLayoutProperties(seriesOpt); + }); // dataRange has changed to visualMap - if (options) { - if (!isArray(options)) { - options = [options]; - } + if (option.dataRange) { + option.visualMap = option.dataRange; + } - each(options, function (option) { - compatLayoutProperties(option); - }); - } - }); + each(COMPATITABLE_COMPONENTS, function (componentName) { + var options = option[componentName]; + + if (options) { + if (!isArray(options)) { + options = [options]; + } + + each(options, function (option) { + compatLayoutProperties(option); + }); + } + }); } // data processing stage is blocked in stream. @@ -20041,126 +20041,126 @@ // Should be executed after series filtered and before stack calculation. function dataStack(ecModel) { - var stackInfoMap = createHashMap(); - ecModel.eachSeries(function (seriesModel) { - var stack = seriesModel.get('stack'); // Compatibal: when `stack` is set as '', do not stack. - - if (stack) { - var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []); - var data = seriesModel.getData(); - var stackInfo = { - // Used for calculate axis extent automatically. - // TODO: Type getCalculationInfo return more specific type? - stackResultDimension: data.getCalculationInfo('stackResultDimension'), - stackedOverDimension: data.getCalculationInfo('stackedOverDimension'), - stackedDimension: data.getCalculationInfo('stackedDimension'), - stackedByDimension: data.getCalculationInfo('stackedByDimension'), - isStackedByIndex: data.getCalculationInfo('isStackedByIndex'), - data: data, - seriesModel: seriesModel - }; // If stacked on axis that do not support data stack. - - if (!stackInfo.stackedDimension || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) { - return; - } + var stackInfoMap = createHashMap(); + ecModel.eachSeries(function (seriesModel) { + var stack = seriesModel.get('stack'); // Compatibal: when `stack` is set as '', do not stack. + + if (stack) { + var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []); + var data = seriesModel.getData(); + var stackInfo = { + // Used for calculate axis extent automatically. + // TODO: Type getCalculationInfo return more specific type? + stackResultDimension: data.getCalculationInfo('stackResultDimension'), + stackedOverDimension: data.getCalculationInfo('stackedOverDimension'), + stackedDimension: data.getCalculationInfo('stackedDimension'), + stackedByDimension: data.getCalculationInfo('stackedByDimension'), + isStackedByIndex: data.getCalculationInfo('isStackedByIndex'), + data: data, + seriesModel: seriesModel + }; // If stacked on axis that do not support data stack. - stackInfoList.length && data.setCalculationInfo('stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel); - stackInfoList.push(stackInfo); - } - }); - stackInfoMap.each(calculateStack); + if (!stackInfo.stackedDimension || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) { + return; + } + + stackInfoList.length && data.setCalculationInfo('stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel); + stackInfoList.push(stackInfo); + } + }); + stackInfoMap.each(calculateStack); } function calculateStack(stackInfoList) { - each(stackInfoList, function (targetStackInfo, idxInStack) { - var resultVal = []; - var resultNaN = [NaN, NaN]; - var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension]; - var targetData = targetStackInfo.data; - var isStackedByIndex = targetStackInfo.isStackedByIndex; // Should not write on raw data, because stack series model list changes - // depending on legend selection. + each(stackInfoList, function (targetStackInfo, idxInStack) { + var resultVal = []; + var resultNaN = [NaN, NaN]; + var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension]; + var targetData = targetStackInfo.data; + var isStackedByIndex = targetStackInfo.isStackedByIndex; // Should not write on raw data, because stack series model list changes + // depending on legend selection. - targetData.modify(dims, function (v0, v1, dataIndex) { - var sum = targetData.get(targetStackInfo.stackedDimension, dataIndex); // Consider `connectNulls` of line area, if value is NaN, stackedOver - // should also be NaN, to draw a appropriate belt area. + targetData.modify(dims, function (v0, v1, dataIndex) { + var sum = targetData.get(targetStackInfo.stackedDimension, dataIndex); // Consider `connectNulls` of line area, if value is NaN, stackedOver + // should also be NaN, to draw a appropriate belt area. - if (isNaN(sum)) { - return resultNaN; - } + if (isNaN(sum)) { + return resultNaN; + } - var byValue; - var stackedDataRawIndex; + var byValue; + var stackedDataRawIndex; - if (isStackedByIndex) { - stackedDataRawIndex = targetData.getRawIndex(dataIndex); - } else { - byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex); - } // If stackOver is NaN, chart view will render point on value start. + if (isStackedByIndex) { + stackedDataRawIndex = targetData.getRawIndex(dataIndex); + } else { + byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex); + } // If stackOver is NaN, chart view will render point on value start. - var stackedOver = NaN; + var stackedOver = NaN; - for (var j = idxInStack - 1; j >= 0; j--) { - var stackInfo = stackInfoList[j]; // Has been optimized by inverted indices on `stackedByDimension`. + for (var j = idxInStack - 1; j >= 0; j--) { + var stackInfo = stackInfoList[j]; // Has been optimized by inverted indices on `stackedByDimension`. - if (!isStackedByIndex) { - stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue); - } + if (!isStackedByIndex) { + stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue); + } - if (stackedDataRawIndex >= 0) { - var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex); // Considering positive stack, negative stack and empty data - - if (sum >= 0 && val > 0 || // Positive stack - sum <= 0 && val < 0 // Negative stack - ) { - // The sum should be as less as possible to be effected - // by floating arithmetic problem. A wrong result probably - // filtered incorrectly by axis min/max. - sum = addSafe(sum, val); - stackedOver = val; - break; - } - } + if (stackedDataRawIndex >= 0) { + var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex); // Considering positive stack, negative stack and empty data + + if (sum >= 0 && val > 0 || // Positive stack + sum <= 0 && val < 0 // Negative stack + ) { + // The sum should be as less as possible to be effected + // by floating arithmetic problem. A wrong result probably + // filtered incorrectly by axis min/max. + sum = addSafe(sum, val); + stackedOver = val; + break; } + } + } - resultVal[0] = sum; - resultVal[1] = stackedOver; - return resultVal; - }); + resultVal[0] = sum; + resultVal[1] = stackedOver; + return resultVal; }); + }); } var SourceImpl = - /** @class */ - function () { - function SourceImpl(fields) { - this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []); - this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN; // Visit config - - this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN; - this.startIndex = fields.startIndex || 0; - this.dimensionsDetectedCount = fields.dimensionsDetectedCount; - this.metaRawOption = fields.metaRawOption; - var dimensionsDefine = this.dimensionsDefine = fields.dimensionsDefine; - - if (dimensionsDefine) { - for (var i = 0; i < dimensionsDefine.length; i++) { - var dim = dimensionsDefine[i]; - - if (dim.type == null) { - if (guessOrdinal(this, i) === BE_ORDINAL.Must) { - dim.type = 'ordinal'; - } - } - } - } + /** @class */ + function () { + function SourceImpl(fields) { + this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []); + this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN; // Visit config + + this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN; + this.startIndex = fields.startIndex || 0; + this.dimensionsDetectedCount = fields.dimensionsDetectedCount; + this.metaRawOption = fields.metaRawOption; + var dimensionsDefine = this.dimensionsDefine = fields.dimensionsDefine; + + if (dimensionsDefine) { + for (var i = 0; i < dimensionsDefine.length; i++) { + var dim = dimensionsDefine[i]; + + if (dim.type == null) { + if (guessOrdinal(this, i) === BE_ORDINAL.Must) { + dim.type = 'ordinal'; + } } + } + } + } - return SourceImpl; - }(); + return SourceImpl; + }(); function isSourceInstance(val) { - return val instanceof SourceImpl; + return val instanceof SourceImpl; } /** * Create a source from option. @@ -20168,83 +20168,83 @@ */ function createSource(sourceData, thisMetaRawOption, // can be null. If not provided, auto detect it from `sourceData`. - sourceFormat) { - sourceFormat = sourceFormat || detectSourceFormat(sourceData); - var seriesLayoutBy = thisMetaRawOption.seriesLayoutBy; - var determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions); - var source = new SourceImpl({ - data: sourceData, - sourceFormat: sourceFormat, - seriesLayoutBy: seriesLayoutBy, - dimensionsDefine: determined.dimensionsDefine, - startIndex: determined.startIndex, - dimensionsDetectedCount: determined.dimensionsDetectedCount, - metaRawOption: clone(thisMetaRawOption) - }); - return source; + sourceFormat) { + sourceFormat = sourceFormat || detectSourceFormat(sourceData); + var seriesLayoutBy = thisMetaRawOption.seriesLayoutBy; + var determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions); + var source = new SourceImpl({ + data: sourceData, + sourceFormat: sourceFormat, + seriesLayoutBy: seriesLayoutBy, + dimensionsDefine: determined.dimensionsDefine, + startIndex: determined.startIndex, + dimensionsDetectedCount: determined.dimensionsDetectedCount, + metaRawOption: clone(thisMetaRawOption) + }); + return source; } /** * Wrap original series data for some compatibility cases. */ function createSourceFromSeriesDataOption(data) { - return new SourceImpl({ - data: data, - sourceFormat: isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL - }); + return new SourceImpl({ + data: data, + sourceFormat: isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL + }); } /** * Clone source but excludes source data. */ function cloneSourceShallow(source) { - return new SourceImpl({ - data: source.data, - sourceFormat: source.sourceFormat, - seriesLayoutBy: source.seriesLayoutBy, - dimensionsDefine: clone(source.dimensionsDefine), - startIndex: source.startIndex, - dimensionsDetectedCount: source.dimensionsDetectedCount - }); + return new SourceImpl({ + data: source.data, + sourceFormat: source.sourceFormat, + seriesLayoutBy: source.seriesLayoutBy, + dimensionsDefine: clone(source.dimensionsDefine), + startIndex: source.startIndex, + dimensionsDetectedCount: source.dimensionsDetectedCount + }); } /** * Note: An empty array will be detected as `SOURCE_FORMAT_ARRAY_ROWS`. */ function detectSourceFormat(data) { - var sourceFormat = SOURCE_FORMAT_UNKNOWN; + var sourceFormat = SOURCE_FORMAT_UNKNOWN; - if (isTypedArray(data)) { - sourceFormat = SOURCE_FORMAT_TYPED_ARRAY; - } else if (isArray(data)) { - // FIXME Whether tolerate null in top level array? - if (data.length === 0) { - sourceFormat = SOURCE_FORMAT_ARRAY_ROWS; - } + if (isTypedArray(data)) { + sourceFormat = SOURCE_FORMAT_TYPED_ARRAY; + } else if (isArray(data)) { + // FIXME Whether tolerate null in top level array? + if (data.length === 0) { + sourceFormat = SOURCE_FORMAT_ARRAY_ROWS; + } - for (var i = 0, len = data.length; i < len; i++) { - var item = data[i]; + for (var i = 0, len = data.length; i < len; i++) { + var item = data[i]; - if (item == null) { - continue; - } else if (isArray(item)) { - sourceFormat = SOURCE_FORMAT_ARRAY_ROWS; - break; - } else if (isObject(item)) { - sourceFormat = SOURCE_FORMAT_OBJECT_ROWS; - break; - } - } - } else if (isObject(data)) { - for (var key in data) { - if (hasOwn(data, key) && isArrayLike(data[key])) { - sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS; - break; - } - } + if (item == null) { + continue; + } else if (isArray(item)) { + sourceFormat = SOURCE_FORMAT_ARRAY_ROWS; + break; + } else if (isObject(item)) { + sourceFormat = SOURCE_FORMAT_OBJECT_ROWS; + break; + } + } + } else if (isObject(data)) { + for (var key in data) { + if (hasOwn(data, key) && isArrayLike(data[key])) { + sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS; + break; + } } + } - return sourceFormat; + return sourceFormat; } /** * Determine the source definitions from data standalone dimensions definitions @@ -20252,167 +20252,167 @@ */ function determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader, // standalone raw dimensions definition, like: - // { - // dimensions: ['aa', 'bb', { name: 'cc', type: 'time' }] - // } - // in `dataset` or `series` - dimensionsDefine) { - var dimensionsDetectedCount; - var startIndex; // PEDING: could data be null/undefined here? - // currently, if `dataset.source` not specified, error thrown. - // if `series.data` not specified, nothing rendered without error thrown. - // Should test these cases. - - if (!data) { - return { - dimensionsDefine: normalizeDimensionsOption(dimensionsDefine), - startIndex: startIndex, - dimensionsDetectedCount: dimensionsDetectedCount - }; + // { + // dimensions: ['aa', 'bb', { name: 'cc', type: 'time' }] + // } + // in `dataset` or `series` + dimensionsDefine) { + var dimensionsDetectedCount; + var startIndex; // PEDING: could data be null/undefined here? + // currently, if `dataset.source` not specified, error thrown. + // if `series.data` not specified, nothing rendered without error thrown. + // Should test these cases. + + if (!data) { + return { + dimensionsDefine: normalizeDimensionsOption(dimensionsDefine), + startIndex: startIndex, + dimensionsDetectedCount: dimensionsDetectedCount + }; + } + + if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) { + var dataArrayRows = data; // Rule: Most of the first line are string: it is header. + // Caution: consider a line with 5 string and 1 number, + // it still can not be sure it is a head, because the + // 5 string may be 5 values of category columns. + + if (sourceHeader === 'auto' || sourceHeader == null) { + arrayRowsTravelFirst(function (val) { + // '-' is regarded as null/undefined. + if (val != null && val !== '-') { + if (isString(val)) { + startIndex == null && (startIndex = 1); + } else { + startIndex = 0; + } + } // 10 is an experience number, avoid long loop. + + }, seriesLayoutBy, dataArrayRows, 10); + } else { + startIndex = isNumber(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0; } - if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) { - var dataArrayRows = data; // Rule: Most of the first line are string: it is header. - // Caution: consider a line with 5 string and 1 number, - // it still can not be sure it is a head, because the - // 5 string may be 5 values of category columns. - - if (sourceHeader === 'auto' || sourceHeader == null) { - arrayRowsTravelFirst(function (val) { - // '-' is regarded as null/undefined. - if (val != null && val !== '-') { - if (isString(val)) { - startIndex == null && (startIndex = 1); - } else { - startIndex = 0; - } - } // 10 is an experience number, avoid long loop. - - }, seriesLayoutBy, dataArrayRows, 10); - } else { - startIndex = isNumber(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0; - } - - if (!dimensionsDefine && startIndex === 1) { - dimensionsDefine = []; - arrayRowsTravelFirst(function (val, index) { - dimensionsDefine[index] = val != null ? val + '' : ''; - }, seriesLayoutBy, dataArrayRows, Infinity); - } + if (!dimensionsDefine && startIndex === 1) { + dimensionsDefine = []; + arrayRowsTravelFirst(function (val, index) { + dimensionsDefine[index] = val != null ? val + '' : ''; + }, seriesLayoutBy, dataArrayRows, Infinity); + } - dimensionsDetectedCount = dimensionsDefine ? dimensionsDefine.length : seriesLayoutBy === SERIES_LAYOUT_BY_ROW ? dataArrayRows.length : dataArrayRows[0] ? dataArrayRows[0].length : null; - } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) { - if (!dimensionsDefine) { - dimensionsDefine = objectRowsCollectDimensions(data); - } - } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) { - if (!dimensionsDefine) { - dimensionsDefine = []; - each(data, function (colArr, key) { - dimensionsDefine.push(key); - }); - } - } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) { - var value0 = getDataItemValue(data[0]); - dimensionsDetectedCount = isArray(value0) && value0.length || 1; - } else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) { - if ("development" !== 'production') { - assert(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.'); - } + dimensionsDetectedCount = dimensionsDefine ? dimensionsDefine.length : seriesLayoutBy === SERIES_LAYOUT_BY_ROW ? dataArrayRows.length : dataArrayRows[0] ? dataArrayRows[0].length : null; + } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) { + if (!dimensionsDefine) { + dimensionsDefine = objectRowsCollectDimensions(data); + } + } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) { + if (!dimensionsDefine) { + dimensionsDefine = []; + each(data, function (colArr, key) { + dimensionsDefine.push(key); + }); + } + } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) { + var value0 = getDataItemValue(data[0]); + dimensionsDetectedCount = isArray(value0) && value0.length || 1; + } else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) { + if ("development" !== 'production') { + assert(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.'); } + } - return { - startIndex: startIndex, - dimensionsDefine: normalizeDimensionsOption(dimensionsDefine), - dimensionsDetectedCount: dimensionsDetectedCount - }; + return { + startIndex: startIndex, + dimensionsDefine: normalizeDimensionsOption(dimensionsDefine), + dimensionsDetectedCount: dimensionsDetectedCount + }; } function objectRowsCollectDimensions(data) { - var firstIndex = 0; - var obj; + var firstIndex = 0; + var obj; - while (firstIndex < data.length && !(obj = data[firstIndex++])) {} // jshint ignore: line + while (firstIndex < data.length && !(obj = data[firstIndex++])) {} // jshint ignore: line - if (obj) { - var dimensions_1 = []; - each(obj, function (value, key) { - dimensions_1.push(key); - }); - return dimensions_1; - } + if (obj) { + var dimensions_1 = []; + each(obj, function (value, key) { + dimensions_1.push(key); + }); + return dimensions_1; + } } // Consider dimensions defined like ['A', 'price', 'B', 'price', 'C', 'price'], // which is reasonable. But dimension name is duplicated. // Returns undefined or an array contains only object without null/undefiend or string. function normalizeDimensionsOption(dimensionsDefine) { - if (!dimensionsDefine) { - // The meaning of null/undefined is different from empty array. - return; - } + if (!dimensionsDefine) { + // The meaning of null/undefined is different from empty array. + return; + } - var nameMap = createHashMap(); - return map(dimensionsDefine, function (rawItem, index) { - rawItem = isObject(rawItem) ? rawItem : { - name: rawItem - }; // Other fields will be discarded. + var nameMap = createHashMap(); + return map(dimensionsDefine, function (rawItem, index) { + rawItem = isObject(rawItem) ? rawItem : { + name: rawItem + }; // Other fields will be discarded. - var item = { - name: rawItem.name, - displayName: rawItem.displayName, - type: rawItem.type - }; // User can set null in dimensions. - // We dont auto specify name, othewise a given name may - // cause it be refered unexpectedly. + var item = { + name: rawItem.name, + displayName: rawItem.displayName, + type: rawItem.type + }; // User can set null in dimensions. + // We dont auto specify name, othewise a given name may + // cause it be refered unexpectedly. - if (item.name == null) { - return item; - } // Also consider number form like 2012. + if (item.name == null) { + return item; + } // Also consider number form like 2012. - item.name += ''; // User may also specify displayName. - // displayName will always exists except user not - // specified or dim name is not specified or detected. - // (A auto generated dim name will not be used as - // displayName). + item.name += ''; // User may also specify displayName. + // displayName will always exists except user not + // specified or dim name is not specified or detected. + // (A auto generated dim name will not be used as + // displayName). - if (item.displayName == null) { - item.displayName = item.name; - } + if (item.displayName == null) { + item.displayName = item.name; + } - var exist = nameMap.get(item.name); + var exist = nameMap.get(item.name); - if (!exist) { - nameMap.set(item.name, { - count: 1 - }); - } else { - item.name += '-' + exist.count++; - } + if (!exist) { + nameMap.set(item.name, { + count: 1 + }); + } else { + item.name += '-' + exist.count++; + } - return item; - }); + return item; + }); } function arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) { - if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) { - for (var i = 0; i < data.length && i < maxLoop; i++) { - cb(data[i] ? data[i][0] : null, i); - } - } else { - var value0 = data[0] || []; + if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) { + for (var i = 0; i < data.length && i < maxLoop; i++) { + cb(data[i] ? data[i][0] : null, i); + } + } else { + var value0 = data[0] || []; - for (var i = 0; i < value0.length && i < maxLoop; i++) { - cb(value0[i], i); - } + for (var i = 0; i < value0.length && i < maxLoop; i++) { + cb(value0[i], i); } + } } function shouldRetrieveDataByName(source) { - var sourceFormat = source.sourceFormat; - return sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS; + var sourceFormat = source.sourceFormat; + return sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS; } /* @@ -20466,277 +20466,277 @@ */ var DefaultDataProvider = - /** @class */ - function () { - function DefaultDataProvider(sourceParam, dimSize) { - // let source: Source; - var source = !isSourceInstance(sourceParam) ? createSourceFromSeriesDataOption(sourceParam) : sourceParam; // declare source is Source; - - this._source = source; - var data = this._data = source.data; // Typed array. TODO IE10+? - - if (source.sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) { - if ("development" !== 'production') { - if (dimSize == null) { - throw new Error('Typed array data must specify dimension size'); - } - } + /** @class */ + function () { + function DefaultDataProvider(sourceParam, dimSize) { + // let source: Source; + var source = !isSourceInstance(sourceParam) ? createSourceFromSeriesDataOption(sourceParam) : sourceParam; // declare source is Source; - this._offset = 0; - this._dimSize = dimSize; - this._data = data; - } + this._source = source; + var data = this._data = source.data; // Typed array. TODO IE10+? - mountMethods(this, data, source); + if (source.sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) { + if ("development" !== 'production') { + if (dimSize == null) { + throw new Error('Typed array data must specify dimension size'); } + } - DefaultDataProvider.prototype.getSource = function () { - return this._source; - }; - - DefaultDataProvider.prototype.count = function () { - return 0; - }; - - DefaultDataProvider.prototype.getItem = function (idx, out) { - return; - }; - - DefaultDataProvider.prototype.appendData = function (newData) {}; - - DefaultDataProvider.prototype.clean = function () {}; - - DefaultDataProvider.protoInitialize = function () { - // PENDING: To avoid potential incompat (e.g., prototype - // is visited somewhere), still init them on prototype. - var proto = DefaultDataProvider.prototype; - proto.pure = false; - proto.persistent = true; - }(); - - DefaultDataProvider.internalField = function () { - var _a; - - mountMethods = function (provider, data, source) { - var sourceFormat = source.sourceFormat; - var seriesLayoutBy = source.seriesLayoutBy; - var startIndex = source.startIndex; - var dimsDef = source.dimensionsDefine; - var methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)]; - - if ("development" !== 'production') { - assert(methods, 'Invalide sourceFormat: ' + sourceFormat); - } + this._offset = 0; + this._dimSize = dimSize; + this._data = data; + } - extend(provider, methods); + mountMethods(this, data, source); + } - if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) { - provider.getItem = getItemForTypedArray; - provider.count = countForTypedArray; - provider.fillStorage = fillStorageForTypedArray; - } else { - var rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy); - provider.getItem = bind(rawItemGetter, null, data, startIndex, dimsDef); - var rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy); - provider.count = bind(rawCounter, null, data, startIndex, dimsDef); - } - }; + DefaultDataProvider.prototype.getSource = function () { + return this._source; + }; - var getItemForTypedArray = function (idx, out) { - idx = idx - this._offset; - out = out || []; - var data = this._data; - var dimSize = this._dimSize; - var offset = dimSize * idx; + DefaultDataProvider.prototype.count = function () { + return 0; + }; - for (var i = 0; i < dimSize; i++) { - out[i] = data[offset + i]; - } + DefaultDataProvider.prototype.getItem = function (idx, out) { + return; + }; - return out; - }; + DefaultDataProvider.prototype.appendData = function (newData) {}; - var fillStorageForTypedArray = function (start, end, storage, extent) { - var data = this._data; - var dimSize = this._dimSize; - - for (var dim = 0; dim < dimSize; dim++) { - var dimExtent = extent[dim]; - var min = dimExtent[0] == null ? Infinity : dimExtent[0]; - var max = dimExtent[1] == null ? -Infinity : dimExtent[1]; - var count = end - start; - var arr = storage[dim]; - - for (var i = 0; i < count; i++) { - // appendData with TypedArray will always do replace in provider. - var val = data[i * dimSize + dim]; - arr[start + i] = val; - val < min && (min = val); - val > max && (max = val); - } + DefaultDataProvider.prototype.clean = function () {}; - dimExtent[0] = min; - dimExtent[1] = max; - } - }; + DefaultDataProvider.protoInitialize = function () { + // PENDING: To avoid potential incompat (e.g., prototype + // is visited somewhere), still init them on prototype. + var proto = DefaultDataProvider.prototype; + proto.pure = false; + proto.persistent = true; + }(); - var countForTypedArray = function () { - return this._data ? this._data.length / this._dimSize : 0; - }; + DefaultDataProvider.internalField = function () { + var _a; - providerMethods = (_a = {}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = { - pure: true, - appendData: appendDataSimply - }, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = { - pure: true, - appendData: function () { - throw new Error('Do not support appendData when set seriesLayoutBy: "row".'); - } - }, _a[SOURCE_FORMAT_OBJECT_ROWS] = { - pure: true, - appendData: appendDataSimply - }, _a[SOURCE_FORMAT_KEYED_COLUMNS] = { - pure: true, - appendData: function (newData) { - var data = this._data; - each(newData, function (newCol, key) { - var oldCol = data[key] || (data[key] = []); - - for (var i = 0; i < (newCol || []).length; i++) { - oldCol.push(newCol[i]); - } - }); - } - }, _a[SOURCE_FORMAT_ORIGINAL] = { - appendData: appendDataSimply - }, _a[SOURCE_FORMAT_TYPED_ARRAY] = { - persistent: false, - pure: true, - appendData: function (newData) { - if ("development" !== 'production') { - assert(isTypedArray(newData), 'Added data must be TypedArray if data in initialization is TypedArray'); - } + mountMethods = function (provider, data, source) { + var sourceFormat = source.sourceFormat; + var seriesLayoutBy = source.seriesLayoutBy; + var startIndex = source.startIndex; + var dimsDef = source.dimensionsDefine; + var methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)]; + + if ("development" !== 'production') { + assert(methods, 'Invalide sourceFormat: ' + sourceFormat); + } + + extend(provider, methods); + + if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) { + provider.getItem = getItemForTypedArray; + provider.count = countForTypedArray; + provider.fillStorage = fillStorageForTypedArray; + } else { + var rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy); + provider.getItem = bind(rawItemGetter, null, data, startIndex, dimsDef); + var rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy); + provider.count = bind(rawCounter, null, data, startIndex, dimsDef); + } + }; + + var getItemForTypedArray = function (idx, out) { + idx = idx - this._offset; + out = out || []; + var data = this._data; + var dimSize = this._dimSize; + var offset = dimSize * idx; + + for (var i = 0; i < dimSize; i++) { + out[i] = data[offset + i]; + } + + return out; + }; + + var fillStorageForTypedArray = function (start, end, storage, extent) { + var data = this._data; + var dimSize = this._dimSize; + + for (var dim = 0; dim < dimSize; dim++) { + var dimExtent = extent[dim]; + var min = dimExtent[0] == null ? Infinity : dimExtent[0]; + var max = dimExtent[1] == null ? -Infinity : dimExtent[1]; + var count = end - start; + var arr = storage[dim]; + + for (var i = 0; i < count; i++) { + // appendData with TypedArray will always do replace in provider. + var val = data[i * dimSize + dim]; + arr[start + i] = val; + val < min && (min = val); + val > max && (max = val); + } + + dimExtent[0] = min; + dimExtent[1] = max; + } + }; + + var countForTypedArray = function () { + return this._data ? this._data.length / this._dimSize : 0; + }; + + providerMethods = (_a = {}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = { + pure: true, + appendData: appendDataSimply + }, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = { + pure: true, + appendData: function () { + throw new Error('Do not support appendData when set seriesLayoutBy: "row".'); + } + }, _a[SOURCE_FORMAT_OBJECT_ROWS] = { + pure: true, + appendData: appendDataSimply + }, _a[SOURCE_FORMAT_KEYED_COLUMNS] = { + pure: true, + appendData: function (newData) { + var data = this._data; + each(newData, function (newCol, key) { + var oldCol = data[key] || (data[key] = []); + + for (var i = 0; i < (newCol || []).length; i++) { + oldCol.push(newCol[i]); + } + }); + } + }, _a[SOURCE_FORMAT_ORIGINAL] = { + appendData: appendDataSimply + }, _a[SOURCE_FORMAT_TYPED_ARRAY] = { + persistent: false, + pure: true, + appendData: function (newData) { + if ("development" !== 'production') { + assert(isTypedArray(newData), 'Added data must be TypedArray if data in initialization is TypedArray'); + } - this._data = newData; - }, - // Clean self if data is already used. - clean: function () { - // PENDING - this._offset += this.count(); - this._data = null; - } - }, _a); + this._data = newData; + }, + // Clean self if data is already used. + clean: function () { + // PENDING + this._offset += this.count(); + this._data = null; + } + }, _a); - function appendDataSimply(newData) { - for (var i = 0; i < newData.length; i++) { - this._data.push(newData[i]); - } - } - }(); + function appendDataSimply(newData) { + for (var i = 0; i < newData.length; i++) { + this._data.push(newData[i]); + } + } + }(); - return DefaultDataProvider; - }(); + return DefaultDataProvider; + }(); var getItemSimply = function (rawData, startIndex, dimsDef, idx) { - return rawData[idx]; + return rawData[idx]; }; var rawSourceItemGetterMap = (_a = {}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef, idx) { - return rawData[idx + startIndex]; + return rawData[idx + startIndex]; }, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef, idx, out) { - idx += startIndex; - var item = out || []; - var data = rawData; + idx += startIndex; + var item = out || []; + var data = rawData; - for (var i = 0; i < data.length; i++) { - var row = data[i]; - item[i] = row ? row[idx] : null; - } + for (var i = 0; i < data.length; i++) { + var row = data[i]; + item[i] = row ? row[idx] : null; + } - return item; + return item; }, _a[SOURCE_FORMAT_OBJECT_ROWS] = getItemSimply, _a[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef, idx, out) { - var item = out || []; - - for (var i = 0; i < dimsDef.length; i++) { - var dimName = dimsDef[i].name; + var item = out || []; - if ("development" !== 'production') { - if (dimName == null) { - throw new Error(); - } - } + for (var i = 0; i < dimsDef.length; i++) { + var dimName = dimsDef[i].name; - var col = rawData[dimName]; - item[i] = col ? col[idx] : null; + if ("development" !== 'production') { + if (dimName == null) { + throw new Error(); + } } - return item; + var col = rawData[dimName]; + item[i] = col ? col[idx] : null; + } + + return item; }, _a[SOURCE_FORMAT_ORIGINAL] = getItemSimply, _a); function getRawSourceItemGetter(sourceFormat, seriesLayoutBy) { - var method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)]; + var method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)]; - if ("development" !== 'production') { - assert(method, 'Do not support get item on "' + sourceFormat + '", "' + seriesLayoutBy + '".'); - } + if ("development" !== 'production') { + assert(method, 'Do not support get item on "' + sourceFormat + '", "' + seriesLayoutBy + '".'); + } - return method; + return method; } var countSimply = function (rawData, startIndex, dimsDef) { - return rawData.length; + return rawData.length; }; var rawSourceDataCounterMap = (_b = {}, _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef) { - return Math.max(0, rawData.length - startIndex); + return Math.max(0, rawData.length - startIndex); }, _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef) { - var row = rawData[0]; - return row ? Math.max(0, row.length - startIndex) : 0; + var row = rawData[0]; + return row ? Math.max(0, row.length - startIndex) : 0; }, _b[SOURCE_FORMAT_OBJECT_ROWS] = countSimply, _b[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef) { - var dimName = dimsDef[0].name; + var dimName = dimsDef[0].name; - if ("development" !== 'production') { - if (dimName == null) { - throw new Error(); - } + if ("development" !== 'production') { + if (dimName == null) { + throw new Error(); } + } - var col = rawData[dimName]; - return col ? col.length : 0; + var col = rawData[dimName]; + return col ? col.length : 0; }, _b[SOURCE_FORMAT_ORIGINAL] = countSimply, _b); function getRawSourceDataCounter(sourceFormat, seriesLayoutBy) { - var method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)]; + var method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)]; - if ("development" !== 'production') { - assert(method, 'Do not suppport count on "' + sourceFormat + '", "' + seriesLayoutBy + '".'); - } + if ("development" !== 'production') { + assert(method, 'Do not suppport count on "' + sourceFormat + '", "' + seriesLayoutBy + '".'); + } - return method; + return method; } var getRawValueSimply = function (dataItem, dimIndex, property) { - return dataItem[dimIndex]; + return dataItem[dimIndex]; }; var rawSourceValueGetterMap = (_c = {}, _c[SOURCE_FORMAT_ARRAY_ROWS] = getRawValueSimply, _c[SOURCE_FORMAT_OBJECT_ROWS] = function (dataItem, dimIndex, property) { - return dataItem[property]; + return dataItem[property]; }, _c[SOURCE_FORMAT_KEYED_COLUMNS] = getRawValueSimply, _c[SOURCE_FORMAT_ORIGINAL] = function (dataItem, dimIndex, property) { - // FIXME: In some case (markpoint in geo (geo-map.html)), - // dataItem is {coord: [...]} - var value = getDataItemValue(dataItem); - return !(value instanceof Array) ? value : value[dimIndex]; + // FIXME: In some case (markpoint in geo (geo-map.html)), + // dataItem is {coord: [...]} + var value = getDataItemValue(dataItem); + return !(value instanceof Array) ? value : value[dimIndex]; }, _c[SOURCE_FORMAT_TYPED_ARRAY] = getRawValueSimply, _c); function getRawSourceValueGetter(sourceFormat) { - var method = rawSourceValueGetterMap[sourceFormat]; + var method = rawSourceValueGetterMap[sourceFormat]; - if ("development" !== 'production') { - assert(method, 'Do not suppport get value on "' + sourceFormat + '".'); - } + if ("development" !== 'production') { + assert(method, 'Do not suppport get value on "' + sourceFormat + '".'); + } - return method; + return method; } function getMethodMapKey(sourceFormat, seriesLayoutBy) { - return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS ? sourceFormat + '_' + seriesLayoutBy : sourceFormat; + return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS ? sourceFormat + '_' + seriesLayoutBy : sourceFormat; } // ??? FIXME can these logic be more neat: getRawValue, getRawDataItem, // Consider persistent. // Caution: why use raw value to display on label or tooltip? @@ -20747,171 +20747,171 @@ function retrieveRawValue(data, dataIndex, // If dimIndex is null/undefined, return OptionDataItem. - // Otherwise, return OptionDataValue. - dim) { - if (!data) { - return; - } // Consider data may be not persistent. - + // Otherwise, return OptionDataValue. + dim) { + if (!data) { + return; + } // Consider data may be not persistent. - var dataItem = data.getRawDataItem(dataIndex); - if (dataItem == null) { - return; - } + var dataItem = data.getRawDataItem(dataIndex); - var store = data.getStore(); - var sourceFormat = store.getSource().sourceFormat; + if (dataItem == null) { + return; + } - if (dim != null) { - var dimIndex = data.getDimensionIndex(dim); - var property = store.getDimensionProperty(dimIndex); - return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, property); - } else { - var result = dataItem; + var store = data.getStore(); + var sourceFormat = store.getSource().sourceFormat; - if (sourceFormat === SOURCE_FORMAT_ORIGINAL) { - result = getDataItemValue(dataItem); - } + if (dim != null) { + var dimIndex = data.getDimensionIndex(dim); + var property = store.getDimensionProperty(dimIndex); + return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, property); + } else { + var result = dataItem; - return result; + if (sourceFormat === SOURCE_FORMAT_ORIGINAL) { + result = getDataItemValue(dataItem); } + + return result; + } } var DIMENSION_LABEL_REG = /\{@(.+?)\}/g; var DataFormatMixin = - /** @class */ - function () { - function DataFormatMixin() {} - /** - * Get params for formatter - */ + /** @class */ + function () { + function DataFormatMixin() {} + /** + * Get params for formatter + */ - DataFormatMixin.prototype.getDataParams = function (dataIndex, dataType) { - var data = this.getData(dataType); - var rawValue = this.getRawValue(dataIndex, dataType); - var rawDataIndex = data.getRawIndex(dataIndex); - var name = data.getName(dataIndex); - var itemOpt = data.getRawDataItem(dataIndex); - var style = data.getItemVisual(dataIndex, 'style'); - var color = style && style[data.getItemVisual(dataIndex, 'drawType') || 'fill']; - var borderColor = style && style.stroke; - var mainType = this.mainType; - var isSeries = mainType === 'series'; - var userOutput = data.userOutput && data.userOutput.get(); - return { - componentType: mainType, - componentSubType: this.subType, - componentIndex: this.componentIndex, - seriesType: isSeries ? this.subType : null, - seriesIndex: this.seriesIndex, - seriesId: isSeries ? this.id : null, - seriesName: isSeries ? this.name : null, - name: name, - dataIndex: rawDataIndex, - data: itemOpt, - dataType: dataType, - value: rawValue, - color: color, - borderColor: borderColor, - dimensionNames: userOutput ? userOutput.fullDimensions : null, - encode: userOutput ? userOutput.encode : null, - // Param name list for mapping `a`, `b`, `c`, `d`, `e` - $vars: ['seriesName', 'name', 'value'] - }; - }; - /** - * Format label - * @param dataIndex - * @param status 'normal' by default - * @param dataType - * @param labelDimIndex Only used in some chart that - * use formatter in different dimensions, like radar. - * @param formatter Formatter given outside. - * @return return null/undefined if no formatter - */ + DataFormatMixin.prototype.getDataParams = function (dataIndex, dataType) { + var data = this.getData(dataType); + var rawValue = this.getRawValue(dataIndex, dataType); + var rawDataIndex = data.getRawIndex(dataIndex); + var name = data.getName(dataIndex); + var itemOpt = data.getRawDataItem(dataIndex); + var style = data.getItemVisual(dataIndex, 'style'); + var color = style && style[data.getItemVisual(dataIndex, 'drawType') || 'fill']; + var borderColor = style && style.stroke; + var mainType = this.mainType; + var isSeries = mainType === 'series'; + var userOutput = data.userOutput && data.userOutput.get(); + return { + componentType: mainType, + componentSubType: this.subType, + componentIndex: this.componentIndex, + seriesType: isSeries ? this.subType : null, + seriesIndex: this.seriesIndex, + seriesId: isSeries ? this.id : null, + seriesName: isSeries ? this.name : null, + name: name, + dataIndex: rawDataIndex, + data: itemOpt, + dataType: dataType, + value: rawValue, + color: color, + borderColor: borderColor, + dimensionNames: userOutput ? userOutput.fullDimensions : null, + encode: userOutput ? userOutput.encode : null, + // Param name list for mapping `a`, `b`, `c`, `d`, `e` + $vars: ['seriesName', 'name', 'value'] + }; + }; + /** + * Format label + * @param dataIndex + * @param status 'normal' by default + * @param dataType + * @param labelDimIndex Only used in some chart that + * use formatter in different dimensions, like radar. + * @param formatter Formatter given outside. + * @return return null/undefined if no formatter + */ - DataFormatMixin.prototype.getFormattedLabel = function (dataIndex, status, dataType, labelDimIndex, formatter, extendParams) { - status = status || 'normal'; - var data = this.getData(dataType); - var params = this.getDataParams(dataIndex, dataType); + DataFormatMixin.prototype.getFormattedLabel = function (dataIndex, status, dataType, labelDimIndex, formatter, extendParams) { + status = status || 'normal'; + var data = this.getData(dataType); + var params = this.getDataParams(dataIndex, dataType); - if (extendParams) { - params.value = extendParams.interpolatedValue; - } + if (extendParams) { + params.value = extendParams.interpolatedValue; + } - if (labelDimIndex != null && isArray(params.value)) { - params.value = params.value[labelDimIndex]; - } + if (labelDimIndex != null && isArray(params.value)) { + params.value = params.value[labelDimIndex]; + } - if (!formatter) { - var itemModel = data.getItemModel(dataIndex); // @ts-ignore + if (!formatter) { + var itemModel = data.getItemModel(dataIndex); // @ts-ignore - formatter = itemModel.get(status === 'normal' ? ['label', 'formatter'] : [status, 'label', 'formatter']); - } + formatter = itemModel.get(status === 'normal' ? ['label', 'formatter'] : [status, 'label', 'formatter']); + } - if (isFunction(formatter)) { - params.status = status; - params.dimensionIndex = labelDimIndex; - return formatter(params); - } else if (isString(formatter)) { - var str = formatTpl(formatter, params); // Support 'aaa{@[3]}bbb{@product}ccc'. - // Do not support '}' in dim name util have to. + if (isFunction(formatter)) { + params.status = status; + params.dimensionIndex = labelDimIndex; + return formatter(params); + } else if (isString(formatter)) { + var str = formatTpl(formatter, params); // Support 'aaa{@[3]}bbb{@product}ccc'. + // Do not support '}' in dim name util have to. - return str.replace(DIMENSION_LABEL_REG, function (origin, dimStr) { - var len = dimStr.length; - var dimLoose = dimStr; + return str.replace(DIMENSION_LABEL_REG, function (origin, dimStr) { + var len = dimStr.length; + var dimLoose = dimStr; - if (dimLoose.charAt(0) === '[' && dimLoose.charAt(len - 1) === ']') { - dimLoose = +dimLoose.slice(1, len - 1); // Also support: '[]' => 0 + if (dimLoose.charAt(0) === '[' && dimLoose.charAt(len - 1) === ']') { + dimLoose = +dimLoose.slice(1, len - 1); // Also support: '[]' => 0 - if ("development" !== 'production') { - if (isNaN(dimLoose)) { - error("Invalide label formatter: @" + dimStr + ", only support @[0], @[1], @[2], ..."); - } - } - } + if ("development" !== 'production') { + if (isNaN(dimLoose)) { + error("Invalide label formatter: @" + dimStr + ", only support @[0], @[1], @[2], ..."); + } + } + } - var val = retrieveRawValue(data, dataIndex, dimLoose); + var val = retrieveRawValue(data, dataIndex, dimLoose); - if (extendParams && isArray(extendParams.interpolatedValue)) { - var dimIndex = data.getDimensionIndex(dimLoose); + if (extendParams && isArray(extendParams.interpolatedValue)) { + var dimIndex = data.getDimensionIndex(dimLoose); - if (dimIndex >= 0) { - val = extendParams.interpolatedValue[dimIndex]; - } - } + if (dimIndex >= 0) { + val = extendParams.interpolatedValue[dimIndex]; + } + } - return val != null ? val + '' : ''; - }); - } - }; - /** - * Get raw value in option - */ + return val != null ? val + '' : ''; + }); + } + }; + /** + * Get raw value in option + */ - DataFormatMixin.prototype.getRawValue = function (idx, dataType) { - return retrieveRawValue(this.getData(dataType), idx); - }; - /** - * Should be implemented. - * @param {number} dataIndex - * @param {boolean} [multipleSeries=false] - * @param {string} [dataType] - */ + DataFormatMixin.prototype.getRawValue = function (idx, dataType) { + return retrieveRawValue(this.getData(dataType), idx); + }; + /** + * Should be implemented. + * @param {number} dataIndex + * @param {boolean} [multipleSeries=false] + * @param {string} [dataType] + */ - DataFormatMixin.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - // Empty function - return; - }; + DataFormatMixin.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { + // Empty function + return; + }; - return DataFormatMixin; - }(); + return DataFormatMixin; + }(); // but guess little chance has been used outside. Do we need to backward // compat it? // type TooltipFormatResultLegacyObject = { @@ -20927,34 +20927,34 @@ */ function normalizeTooltipFormatResult(result) { - var markupText; // let markers: Dictionary; + var markupText; // let markers: Dictionary; - var markupFragment; - - if (isObject(result)) { - if (result.type) { - markupFragment = result; - } else { - if ("development" !== 'production') { - console.warn('The return type of `formatTooltip` is not supported: ' + makePrintable(result)); - } - } // else { - // markupText = (result as TooltipFormatResultLegacyObject).html; - // markers = (result as TooltipFormatResultLegacyObject).markers; - // if (markersExisting) { - // markers = zrUtil.merge(markersExisting, markers); - // } - // } + var markupFragment; + if (isObject(result)) { + if (result.type) { + markupFragment = result; } else { - markupText = result; - } + if ("development" !== 'production') { + console.warn('The return type of `formatTooltip` is not supported: ' + makePrintable(result)); + } + } // else { + // markupText = (result as TooltipFormatResultLegacyObject).html; + // markers = (result as TooltipFormatResultLegacyObject).markers; + // if (markersExisting) { + // markers = zrUtil.merge(markersExisting, markers); + // } + // } - return { - text: markupText, - // markers: markers || markersExisting, - frag: markupFragment - }; + } else { + markupText = result; + } + + return { + text: markupText, + // markers: markers || markersExisting, + frag: markupFragment + }; } /** @@ -20963,259 +20963,259 @@ */ function createTask(define) { - return new Task(define); + return new Task(define); } var Task = - /** @class */ - function () { - function Task(define) { - define = define || {}; - this._reset = define.reset; - this._plan = define.plan; - this._count = define.count; - this._onDirty = define.onDirty; - this._dirty = true; - } - /** - * @param step Specified step. - * @param skip Skip customer perform call. - * @param modBy Sampling window size. - * @param modDataCount Sampling count. - * @return whether unfinished. - */ - - - Task.prototype.perform = function (performArgs) { - var upTask = this._upstream; - var skip = performArgs && performArgs.skip; // TODO some refactor. - // Pull data. Must pull data each time, because context.data - // may be updated by Series.setData. - - if (this._dirty && upTask) { - var context = this.context; - context.data = context.outputData = upTask.context.outputData; - } - - if (this.__pipeline) { - this.__pipeline.currentTask = this; - } - - var planResult; - - if (this._plan && !skip) { - planResult = this._plan(this.context); - } // Support sharding by mod, which changes the render sequence and makes the rendered graphic - // elements uniformed distributed when progress, especially when moving or zooming. - - - var lastModBy = normalizeModBy(this._modBy); - var lastModDataCount = this._modDataCount || 0; - var modBy = normalizeModBy(performArgs && performArgs.modBy); - var modDataCount = performArgs && performArgs.modDataCount || 0; - - if (lastModBy !== modBy || lastModDataCount !== modDataCount) { - planResult = 'reset'; - } - - function normalizeModBy(val) { - !(val >= 1) && (val = 1); // jshint ignore:line - - return val; - } + /** @class */ + function () { + function Task(define) { + define = define || {}; + this._reset = define.reset; + this._plan = define.plan; + this._count = define.count; + this._onDirty = define.onDirty; + this._dirty = true; + } + /** + * @param step Specified step. + * @param skip Skip customer perform call. + * @param modBy Sampling window size. + * @param modDataCount Sampling count. + * @return whether unfinished. + */ - var forceFirstProgress; - if (this._dirty || planResult === 'reset') { - this._dirty = false; - forceFirstProgress = this._doReset(skip); - } + Task.prototype.perform = function (performArgs) { + var upTask = this._upstream; + var skip = performArgs && performArgs.skip; // TODO some refactor. + // Pull data. Must pull data each time, because context.data + // may be updated by Series.setData. - this._modBy = modBy; - this._modDataCount = modDataCount; - var step = performArgs && performArgs.step; + if (this._dirty && upTask) { + var context = this.context; + context.data = context.outputData = upTask.context.outputData; + } - if (upTask) { - if ("development" !== 'production') { - assert(upTask._outputDueEnd != null); - } + if (this.__pipeline) { + this.__pipeline.currentTask = this; + } - this._dueEnd = upTask._outputDueEnd; - } // DataTask or overallTask - else { - if ("development" !== 'production') { - assert(!this._progress || this._count); - } + var planResult; - this._dueEnd = this._count ? this._count(this.context) : Infinity; - } // Note: Stubs, that its host overall task let it has progress, has progress. - // If no progress, pass index from upstream to downstream each time plan called. + if (this._plan && !skip) { + planResult = this._plan(this.context); + } // Support sharding by mod, which changes the render sequence and makes the rendered graphic + // elements uniformed distributed when progress, especially when moving or zooming. - if (this._progress) { - var start = this._dueIndex; - var end = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd); + var lastModBy = normalizeModBy(this._modBy); + var lastModDataCount = this._modDataCount || 0; + var modBy = normalizeModBy(performArgs && performArgs.modBy); + var modDataCount = performArgs && performArgs.modDataCount || 0; - if (!skip && (forceFirstProgress || start < end)) { - var progress = this._progress; + if (lastModBy !== modBy || lastModDataCount !== modDataCount) { + planResult = 'reset'; + } - if (isArray(progress)) { - for (var i = 0; i < progress.length; i++) { - this._doProgress(progress[i], start, end, modBy, modDataCount); - } - } else { - this._doProgress(progress, start, end, modBy, modDataCount); - } - } + function normalizeModBy(val) { + !(val >= 1) && (val = 1); // jshint ignore:line - this._dueIndex = end; // If no `outputDueEnd`, assume that output data and - // input data is the same, so use `dueIndex` as `outputDueEnd`. + return val; + } - var outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : end; + var forceFirstProgress; - if ("development" !== 'production') { - // ??? Can not rollback. - assert(outputDueEnd >= this._outputDueEnd); - } + if (this._dirty || planResult === 'reset') { + this._dirty = false; + forceFirstProgress = this._doReset(skip); + } - this._outputDueEnd = outputDueEnd; - } else { - // (1) Some overall task has no progress. - // (2) Stubs, that its host overall task do not let it has progress, has no progress. - // This should always be performed so it can be passed to downstream. - this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : this._dueEnd; - } + this._modBy = modBy; + this._modDataCount = modDataCount; + var step = performArgs && performArgs.step; - return this.unfinished(); - }; + if (upTask) { + if ("development" !== 'production') { + assert(upTask._outputDueEnd != null); + } - Task.prototype.dirty = function () { - this._dirty = true; - this._onDirty && this._onDirty(this.context); - }; + this._dueEnd = upTask._outputDueEnd; + } // DataTask or overallTask + else { + if ("development" !== 'production') { + assert(!this._progress || this._count); + } - Task.prototype._doProgress = function (progress, start, end, modBy, modDataCount) { - iterator.reset(start, end, modBy, modDataCount); - this._callingProgress = progress; + this._dueEnd = this._count ? this._count(this.context) : Infinity; + } // Note: Stubs, that its host overall task let it has progress, has progress. + // If no progress, pass index from upstream to downstream each time plan called. - this._callingProgress({ - start: start, - end: end, - count: end - start, - next: iterator.next - }, this.context); - }; - Task.prototype._doReset = function (skip) { - this._dueIndex = this._outputDueEnd = this._dueEnd = 0; - this._settedOutputEnd = null; - var progress; - var forceFirstProgress; + if (this._progress) { + var start = this._dueIndex; + var end = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd); - if (!skip && this._reset) { - progress = this._reset(this.context); + if (!skip && (forceFirstProgress || start < end)) { + var progress = this._progress; - if (progress && progress.progress) { - forceFirstProgress = progress.forceFirstProgress; - progress = progress.progress; - } // To simplify no progress checking, array must has item. + if (isArray(progress)) { + for (var i = 0; i < progress.length; i++) { + this._doProgress(progress[i], start, end, modBy, modDataCount); + } + } else { + this._doProgress(progress, start, end, modBy, modDataCount); + } + } + this._dueIndex = end; // If no `outputDueEnd`, assume that output data and + // input data is the same, so use `dueIndex` as `outputDueEnd`. - if (isArray(progress) && !progress.length) { - progress = null; - } - } + var outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : end; - this._progress = progress; - this._modBy = this._modDataCount = null; - var downstream = this._downstream; - downstream && downstream.dirty(); - return forceFirstProgress; - }; + if ("development" !== 'production') { + // ??? Can not rollback. + assert(outputDueEnd >= this._outputDueEnd); + } - Task.prototype.unfinished = function () { - return this._progress && this._dueIndex < this._dueEnd; - }; - /** - * @param downTask The downstream task. - * @return The downstream task. - */ + this._outputDueEnd = outputDueEnd; + } else { + // (1) Some overall task has no progress. + // (2) Stubs, that its host overall task do not let it has progress, has no progress. + // This should always be performed so it can be passed to downstream. + this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : this._dueEnd; + } + + return this.unfinished(); + }; + + Task.prototype.dirty = function () { + this._dirty = true; + this._onDirty && this._onDirty(this.context); + }; + + Task.prototype._doProgress = function (progress, start, end, modBy, modDataCount) { + iterator.reset(start, end, modBy, modDataCount); + this._callingProgress = progress; + + this._callingProgress({ + start: start, + end: end, + count: end - start, + next: iterator.next + }, this.context); + }; + + Task.prototype._doReset = function (skip) { + this._dueIndex = this._outputDueEnd = this._dueEnd = 0; + this._settedOutputEnd = null; + var progress; + var forceFirstProgress; + + if (!skip && this._reset) { + progress = this._reset(this.context); + + if (progress && progress.progress) { + forceFirstProgress = progress.forceFirstProgress; + progress = progress.progress; + } // To simplify no progress checking, array must has item. + + + if (isArray(progress) && !progress.length) { + progress = null; + } + } + + this._progress = progress; + this._modBy = this._modDataCount = null; + var downstream = this._downstream; + downstream && downstream.dirty(); + return forceFirstProgress; + }; + + Task.prototype.unfinished = function () { + return this._progress && this._dueIndex < this._dueEnd; + }; + /** + * @param downTask The downstream task. + * @return The downstream task. + */ - Task.prototype.pipe = function (downTask) { - if ("development" !== 'production') { - assert(downTask && !downTask._disposed && downTask !== this); - } // If already downstream, do not dirty downTask. + Task.prototype.pipe = function (downTask) { + if ("development" !== 'production') { + assert(downTask && !downTask._disposed && downTask !== this); + } // If already downstream, do not dirty downTask. - if (this._downstream !== downTask || this._dirty) { - this._downstream = downTask; - downTask._upstream = this; - downTask.dirty(); - } - }; + if (this._downstream !== downTask || this._dirty) { + this._downstream = downTask; + downTask._upstream = this; + downTask.dirty(); + } + }; - Task.prototype.dispose = function () { - if (this._disposed) { - return; - } + Task.prototype.dispose = function () { + if (this._disposed) { + return; + } - this._upstream && (this._upstream._downstream = null); - this._downstream && (this._downstream._upstream = null); - this._dirty = false; - this._disposed = true; - }; + this._upstream && (this._upstream._downstream = null); + this._downstream && (this._downstream._upstream = null); + this._dirty = false; + this._disposed = true; + }; - Task.prototype.getUpstream = function () { - return this._upstream; - }; + Task.prototype.getUpstream = function () { + return this._upstream; + }; - Task.prototype.getDownstream = function () { - return this._downstream; - }; + Task.prototype.getDownstream = function () { + return this._downstream; + }; - Task.prototype.setOutputEnd = function (end) { - // This only happend in dataTask, dataZoom, map, currently. - // where dataZoom do not set end each time, but only set - // when reset. So we should record the setted end, in case - // that the stub of dataZoom perform again and earse the - // setted end by upstream. - this._outputDueEnd = this._settedOutputEnd = end; - }; + Task.prototype.setOutputEnd = function (end) { + // This only happend in dataTask, dataZoom, map, currently. + // where dataZoom do not set end each time, but only set + // when reset. So we should record the setted end, in case + // that the stub of dataZoom perform again and earse the + // setted end by upstream. + this._outputDueEnd = this._settedOutputEnd = end; + }; - return Task; - }(); + return Task; + }(); var iterator = function () { - var end; - var current; - var modBy; - var modDataCount; - var winCount; - var it = { - reset: function (s, e, sStep, sCount) { - current = s; - end = e; - modBy = sStep; - modDataCount = sCount; - winCount = Math.ceil(modDataCount / modBy); - it.next = modBy > 1 && modDataCount > 0 ? modNext : sequentialNext; - } - }; - return it; - - function sequentialNext() { - return current < end ? current++ : null; - } - - function modNext() { - var dataIndex = current % winCount * modBy + Math.ceil(current / winCount); - var result = current >= end ? null : dataIndex < modDataCount ? dataIndex // If modDataCount is smaller than data.count() (consider `appendData` case), - // Use normal linear rendering mode. - : current; - current++; - return result; - } + var end; + var current; + var modBy; + var modDataCount; + var winCount; + var it = { + reset: function (s, e, sStep, sCount) { + current = s; + end = e; + modBy = sStep; + modDataCount = sCount; + winCount = Math.ceil(modDataCount / modBy); + it.next = modBy > 1 && modDataCount > 0 ? modNext : sequentialNext; + } + }; + return it; + + function sequentialNext() { + return current < end ? current++ : null; + } + + function modNext() { + var dataIndex = current % winCount * modBy + Math.ceil(current / winCount); + var result = current >= end ? null : dataIndex < modDataCount ? dataIndex // If modDataCount is smaller than data.count() (consider `appendData` case), + // Use normal linear rendering mode. + : current; + current++; + return result; + } }(); /////////////////////////////////////////////////////////// // For stream debug (Should be commented out after used!) // @usage: printTask(this, 'begin'); @@ -21311,172 +21311,172 @@ */ function parseDataValue(value, // For high performance, do not omit the second param. - opt) { - // Performance sensitive. - var dimType = opt && opt.type; + opt) { + // Performance sensitive. + var dimType = opt && opt.type; - if (dimType === 'ordinal') { - // If given value is a category string - return value; - } + if (dimType === 'ordinal') { + // If given value is a category string + return value; + } - if (dimType === 'time' // spead up when using timestamp - && !isNumber(value) && value != null && value !== '-') { - value = +parseDate(value); - } // dimType defaults 'number'. - // If dimType is not ordinal and value is null or undefined or NaN or '-', - // parse to NaN. - // number-like string (like ' 123 ') can be converted to a number. - // where null/undefined or other string will be converted to NaN. + if (dimType === 'time' // spead up when using timestamp + && !isNumber(value) && value != null && value !== '-') { + value = +parseDate(value); + } // dimType defaults 'number'. + // If dimType is not ordinal and value is null or undefined or NaN or '-', + // parse to NaN. + // number-like string (like ' 123 ') can be converted to a number. + // where null/undefined or other string will be converted to NaN. - return value == null || value === '' ? NaN // If string (like '-'), using '+' parse to NaN - // If object, also parse to NaN - : +value; + return value == null || value === '' ? NaN // If string (like '-'), using '+' parse to NaN + // If object, also parse to NaN + : +value; } var valueParserMap = createHashMap({ - 'number': function (val) { - // Do not use `numericToNumber` here. We have by defualt `numericToNumber`. - // Here the number parser can have loose rule: - // enable to cut suffix: "120px" => 120, "14%" => 14. - return parseFloat(val); - }, - 'time': function (val) { - // return timestamp. - return +parseDate(val); - }, - 'trim': function (val) { - return isString(val) ? trim(val) : val; - } + 'number': function (val) { + // Do not use `numericToNumber` here. We have by defualt `numericToNumber`. + // Here the number parser can have loose rule: + // enable to cut suffix: "120px" => 120, "14%" => 14. + return parseFloat(val); + }, + 'time': function (val) { + // return timestamp. + return +parseDate(val); + }, + 'trim': function (val) { + return isString(val) ? trim(val) : val; + } }); function getRawValueParser(type) { - return valueParserMap.get(type); + return valueParserMap.get(type); } var ORDER_COMPARISON_OP_MAP = { - lt: function (lval, rval) { - return lval < rval; - }, - lte: function (lval, rval) { - return lval <= rval; - }, - gt: function (lval, rval) { - return lval > rval; - }, - gte: function (lval, rval) { - return lval >= rval; - } + lt: function (lval, rval) { + return lval < rval; + }, + lte: function (lval, rval) { + return lval <= rval; + }, + gt: function (lval, rval) { + return lval > rval; + }, + gte: function (lval, rval) { + return lval >= rval; + } }; var FilterOrderComparator = - /** @class */ - function () { - function FilterOrderComparator(op, rval) { - if (!isNumber(rval)) { - var errMsg = ''; + /** @class */ + function () { + function FilterOrderComparator(op, rval) { + if (!isNumber(rval)) { + var errMsg = ''; - if ("development" !== 'production') { - errMsg = 'rvalue of "<", ">", "<=", ">=" can only be number in filter.'; - } + if ("development" !== 'production') { + errMsg = 'rvalue of "<", ">", "<=", ">=" can only be number in filter.'; + } - throwError(errMsg); - } + throwError(errMsg); + } - this._opFn = ORDER_COMPARISON_OP_MAP[op]; - this._rvalFloat = numericToNumber(rval); - } // Performance sensitive. + this._opFn = ORDER_COMPARISON_OP_MAP[op]; + this._rvalFloat = numericToNumber(rval); + } // Performance sensitive. - FilterOrderComparator.prototype.evaluate = function (lval) { - // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat. - return isNumber(lval) ? this._opFn(lval, this._rvalFloat) : this._opFn(numericToNumber(lval), this._rvalFloat); - }; + FilterOrderComparator.prototype.evaluate = function (lval) { + // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat. + return isNumber(lval) ? this._opFn(lval, this._rvalFloat) : this._opFn(numericToNumber(lval), this._rvalFloat); + }; - return FilterOrderComparator; - }(); + return FilterOrderComparator; + }(); var SortOrderComparator = - /** @class */ - function () { - /** - * @param order by defualt: 'asc' - * @param incomparable by defualt: Always on the tail. - * That is, if 'asc' => 'max', if 'desc' => 'min' - * See the definition of "incomparable" in [SORT_COMPARISON_RULE] - */ - function SortOrderComparator(order, incomparable) { - var isDesc = order === 'desc'; - this._resultLT = isDesc ? 1 : -1; + /** @class */ + function () { + /** + * @param order by defualt: 'asc' + * @param incomparable by defualt: Always on the tail. + * That is, if 'asc' => 'max', if 'desc' => 'min' + * See the definition of "incomparable" in [SORT_COMPARISON_RULE] + */ + function SortOrderComparator(order, incomparable) { + var isDesc = order === 'desc'; + this._resultLT = isDesc ? 1 : -1; - if (incomparable == null) { - incomparable = isDesc ? 'min' : 'max'; - } + if (incomparable == null) { + incomparable = isDesc ? 'min' : 'max'; + } - this._incomparable = incomparable === 'min' ? -Infinity : Infinity; - } // See [SORT_COMPARISON_RULE]. - // Performance sensitive. + this._incomparable = incomparable === 'min' ? -Infinity : Infinity; + } // See [SORT_COMPARISON_RULE]. + // Performance sensitive. - SortOrderComparator.prototype.evaluate = function (lval, rval) { - // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat. - var lvalFloat = isNumber(lval) ? lval : numericToNumber(lval); - var rvalFloat = isNumber(rval) ? rval : numericToNumber(rval); - var lvalNotNumeric = isNaN(lvalFloat); - var rvalNotNumeric = isNaN(rvalFloat); + SortOrderComparator.prototype.evaluate = function (lval, rval) { + // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat. + var lvalFloat = isNumber(lval) ? lval : numericToNumber(lval); + var rvalFloat = isNumber(rval) ? rval : numericToNumber(rval); + var lvalNotNumeric = isNaN(lvalFloat); + var rvalNotNumeric = isNaN(rvalFloat); - if (lvalNotNumeric) { - lvalFloat = this._incomparable; - } + if (lvalNotNumeric) { + lvalFloat = this._incomparable; + } - if (rvalNotNumeric) { - rvalFloat = this._incomparable; - } + if (rvalNotNumeric) { + rvalFloat = this._incomparable; + } - if (lvalNotNumeric && rvalNotNumeric) { - var lvalIsStr = isString(lval); - var rvalIsStr = isString(rval); + if (lvalNotNumeric && rvalNotNumeric) { + var lvalIsStr = isString(lval); + var rvalIsStr = isString(rval); - if (lvalIsStr) { - lvalFloat = rvalIsStr ? lval : 0; - } + if (lvalIsStr) { + lvalFloat = rvalIsStr ? lval : 0; + } - if (rvalIsStr) { - rvalFloat = lvalIsStr ? rval : 0; - } - } + if (rvalIsStr) { + rvalFloat = lvalIsStr ? rval : 0; + } + } - return lvalFloat < rvalFloat ? this._resultLT : lvalFloat > rvalFloat ? -this._resultLT : 0; - }; + return lvalFloat < rvalFloat ? this._resultLT : lvalFloat > rvalFloat ? -this._resultLT : 0; + }; - return SortOrderComparator; - }(); + return SortOrderComparator; + }(); var FilterEqualityComparator = - /** @class */ - function () { - function FilterEqualityComparator(isEq, rval) { - this._rval = rval; - this._isEQ = isEq; - this._rvalTypeof = typeof rval; - this._rvalFloat = numericToNumber(rval); - } // Performance sensitive. + /** @class */ + function () { + function FilterEqualityComparator(isEq, rval) { + this._rval = rval; + this._isEQ = isEq; + this._rvalTypeof = typeof rval; + this._rvalFloat = numericToNumber(rval); + } // Performance sensitive. - FilterEqualityComparator.prototype.evaluate = function (lval) { - var eqResult = lval === this._rval; + FilterEqualityComparator.prototype.evaluate = function (lval) { + var eqResult = lval === this._rval; - if (!eqResult) { - var lvalTypeof = typeof lval; + if (!eqResult) { + var lvalTypeof = typeof lval; - if (lvalTypeof !== this._rvalTypeof && (lvalTypeof === 'number' || this._rvalTypeof === 'number')) { - eqResult = numericToNumber(lval) === this._rvalFloat; - } - } + if (lvalTypeof !== this._rvalTypeof && (lvalTypeof === 'number' || this._rvalTypeof === 'number')) { + eqResult = numericToNumber(lval) === this._rvalFloat; + } + } - return this._isEQ ? eqResult : !eqResult; - }; + return this._isEQ ? eqResult : !eqResult; + }; - return FilterEqualityComparator; - }(); + return FilterEqualityComparator; + }(); /** * [FILTER_COMPARISON_RULE] * `lt`|`lte`|`gt`|`gte`: @@ -21521,7 +21521,7 @@ function createFilterComparator(op, rval) { - return op === 'eq' || op === 'ne' ? new FilterEqualityComparator(op === 'eq', rval) : hasOwn(ORDER_COMPARISON_OP_MAP, op) ? new FilterOrderComparator(op, rval) : null; + return op === 'eq' || op === 'ne' ? new FilterEqualityComparator(op === 'eq', rval) : hasOwn(ORDER_COMPARISON_OP_MAP, op) ? new FilterOrderComparator(op, rval) : null; } /** @@ -21530,446 +21530,446 @@ */ var ExternalSource = - /** @class */ - function () { - function ExternalSource() {} + /** @class */ + function () { + function ExternalSource() {} - ExternalSource.prototype.getRawData = function () { - // Only built-in transform available. - throw new Error('not supported'); - }; + ExternalSource.prototype.getRawData = function () { + // Only built-in transform available. + throw new Error('not supported'); + }; - ExternalSource.prototype.getRawDataItem = function (dataIndex) { - // Only built-in transform available. - throw new Error('not supported'); - }; + ExternalSource.prototype.getRawDataItem = function (dataIndex) { + // Only built-in transform available. + throw new Error('not supported'); + }; - ExternalSource.prototype.cloneRawData = function () { - return; - }; - /** - * @return If dimension not found, return null/undefined. - */ + ExternalSource.prototype.cloneRawData = function () { + return; + }; + /** + * @return If dimension not found, return null/undefined. + */ - ExternalSource.prototype.getDimensionInfo = function (dim) { - return; - }; - /** - * dimensions defined if and only if either: - * (a) dataset.dimensions are declared. - * (b) dataset data include dimensions definitions in data (detected or via specified `sourceHeader`). - * If dimensions are defined, `dimensionInfoAll` is corresponding to - * the defined dimensions. - * Otherwise, `dimensionInfoAll` is determined by data columns. - * @return Always return an array (even empty array). - */ + ExternalSource.prototype.getDimensionInfo = function (dim) { + return; + }; + /** + * dimensions defined if and only if either: + * (a) dataset.dimensions are declared. + * (b) dataset data include dimensions definitions in data (detected or via specified `sourceHeader`). + * If dimensions are defined, `dimensionInfoAll` is corresponding to + * the defined dimensions. + * Otherwise, `dimensionInfoAll` is determined by data columns. + * @return Always return an array (even empty array). + */ - ExternalSource.prototype.cloneAllDimensionInfo = function () { - return; - }; + ExternalSource.prototype.cloneAllDimensionInfo = function () { + return; + }; - ExternalSource.prototype.count = function () { - return; - }; - /** - * Only support by dimension index. - * No need to support by dimension name in transform function, - * becuase transform function is not case-specific, no need to use name literally. - */ + ExternalSource.prototype.count = function () { + return; + }; + /** + * Only support by dimension index. + * No need to support by dimension name in transform function, + * becuase transform function is not case-specific, no need to use name literally. + */ - ExternalSource.prototype.retrieveValue = function (dataIndex, dimIndex) { - return; - }; + ExternalSource.prototype.retrieveValue = function (dataIndex, dimIndex) { + return; + }; - ExternalSource.prototype.retrieveValueFromItem = function (dataItem, dimIndex) { - return; - }; + ExternalSource.prototype.retrieveValueFromItem = function (dataItem, dimIndex) { + return; + }; - ExternalSource.prototype.convertValue = function (rawVal, dimInfo) { - return parseDataValue(rawVal, dimInfo); - }; + ExternalSource.prototype.convertValue = function (rawVal, dimInfo) { + return parseDataValue(rawVal, dimInfo); + }; - return ExternalSource; - }(); + return ExternalSource; + }(); function createExternalSource(internalSource, externalTransform) { - var extSource = new ExternalSource(); - var data = internalSource.data; - var sourceFormat = extSource.sourceFormat = internalSource.sourceFormat; - var sourceHeaderCount = internalSource.startIndex; - var errMsg = ''; + var extSource = new ExternalSource(); + var data = internalSource.data; + var sourceFormat = extSource.sourceFormat = internalSource.sourceFormat; + var sourceHeaderCount = internalSource.startIndex; + var errMsg = ''; + + if (internalSource.seriesLayoutBy !== SERIES_LAYOUT_BY_COLUMN) { + // For the logic simplicity in transformer, only 'culumn' is + // supported in data transform. Otherwise, the `dimensionsDefine` + // might be detected by 'row', which probably confuses users. + if ("development" !== 'production') { + errMsg = '`seriesLayoutBy` of upstream dataset can only be "column" in data transform.'; + } - if (internalSource.seriesLayoutBy !== SERIES_LAYOUT_BY_COLUMN) { - // For the logic simplicity in transformer, only 'culumn' is - // supported in data transform. Otherwise, the `dimensionsDefine` - // might be detected by 'row', which probably confuses users. - if ("development" !== 'production') { - errMsg = '`seriesLayoutBy` of upstream dataset can only be "column" in data transform.'; - } + throwError(errMsg); + } // [MEMO] + // Create a new dimensions structure for exposing. + // Do not expose all dimension info to users directly. + // Becuase the dimension is probably auto detected from data and not might reliable. + // Should not lead the transformers to think that is relialbe and return it. + // See [DIMENSION_INHERIT_RULE] in `sourceManager.ts`. - throwError(errMsg); - } // [MEMO] - // Create a new dimensions structure for exposing. - // Do not expose all dimension info to users directly. - // Becuase the dimension is probably auto detected from data and not might reliable. - // Should not lead the transformers to think that is relialbe and return it. - // See [DIMENSION_INHERIT_RULE] in `sourceManager.ts`. - - - var dimensions = []; - var dimsByName = {}; - var dimsDef = internalSource.dimensionsDefine; - - if (dimsDef) { - each(dimsDef, function (dimDef, idx) { - var name = dimDef.name; - var dimDefExt = { - index: idx, - name: name, - displayName: dimDef.displayName - }; - dimensions.push(dimDefExt); // Users probably not sepcify dimension name. For simplicity, data transform - // do not generate dimension name. - if (name != null) { - // Dimension name should not be duplicated. - // For simplicity, data transform forbid name duplication, do not generate - // new name like module `completeDimensions.ts` did, but just tell users. - var errMsg_1 = ''; + var dimensions = []; + var dimsByName = {}; + var dimsDef = internalSource.dimensionsDefine; - if (hasOwn(dimsByName, name)) { - if ("development" !== 'production') { - errMsg_1 = 'dimension name "' + name + '" duplicated.'; - } + if (dimsDef) { + each(dimsDef, function (dimDef, idx) { + var name = dimDef.name; + var dimDefExt = { + index: idx, + name: name, + displayName: dimDef.displayName + }; + dimensions.push(dimDefExt); // Users probably not sepcify dimension name. For simplicity, data transform + // do not generate dimension name. - throwError(errMsg_1); - } + if (name != null) { + // Dimension name should not be duplicated. + // For simplicity, data transform forbid name duplication, do not generate + // new name like module `completeDimensions.ts` did, but just tell users. + var errMsg_1 = ''; - dimsByName[name] = dimDefExt; - } - }); - } // If dimension definitions are not defined and can not be detected. - // e.g., pure data `[[11, 22], ...]`. - else { - for (var i = 0; i < internalSource.dimensionsDetectedCount || 0; i++) { - // Do not generete name or anything others. The consequence process in - // `transform` or `series` probably have there own name generation strategry. - dimensions.push({ - index: i - }); + if (hasOwn(dimsByName, name)) { + if ("development" !== 'production') { + errMsg_1 = 'dimension name "' + name + '" duplicated.'; + } + + throwError(errMsg_1); } + + dimsByName[name] = dimDefExt; + } + }); + } // If dimension definitions are not defined and can not be detected. + // e.g., pure data `[[11, 22], ...]`. + else { + for (var i = 0; i < internalSource.dimensionsDetectedCount || 0; i++) { + // Do not generete name or anything others. The consequence process in + // `transform` or `series` probably have there own name generation strategry. + dimensions.push({ + index: i + }); + } } // Implement public methods: - var rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN); + var rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN); - if (externalTransform.__isBuiltIn) { - extSource.getRawDataItem = function (dataIndex) { - return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex); - }; + if (externalTransform.__isBuiltIn) { + extSource.getRawDataItem = function (dataIndex) { + return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex); + }; - extSource.getRawData = bind(getRawData, null, internalSource); - } + extSource.getRawData = bind(getRawData, null, internalSource); + } - extSource.cloneRawData = bind(cloneRawData, null, internalSource); - var rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN); - extSource.count = bind(rawCounter, null, data, sourceHeaderCount, dimensions); - var rawValueGetter = getRawSourceValueGetter(sourceFormat); + extSource.cloneRawData = bind(cloneRawData, null, internalSource); + var rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN); + extSource.count = bind(rawCounter, null, data, sourceHeaderCount, dimensions); + var rawValueGetter = getRawSourceValueGetter(sourceFormat); - extSource.retrieveValue = function (dataIndex, dimIndex) { - var rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex); - return retrieveValueFromItem(rawItem, dimIndex); - }; + extSource.retrieveValue = function (dataIndex, dimIndex) { + var rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex); + return retrieveValueFromItem(rawItem, dimIndex); + }; - var retrieveValueFromItem = extSource.retrieveValueFromItem = function (dataItem, dimIndex) { - if (dataItem == null) { - return; - } + var retrieveValueFromItem = extSource.retrieveValueFromItem = function (dataItem, dimIndex) { + if (dataItem == null) { + return; + } - var dimDef = dimensions[dimIndex]; // When `dimIndex` is `null`, `rawValueGetter` return the whole item. + var dimDef = dimensions[dimIndex]; // When `dimIndex` is `null`, `rawValueGetter` return the whole item. - if (dimDef) { - return rawValueGetter(dataItem, dimIndex, dimDef.name); - } - }; + if (dimDef) { + return rawValueGetter(dataItem, dimIndex, dimDef.name); + } + }; - extSource.getDimensionInfo = bind(getDimensionInfo, null, dimensions, dimsByName); - extSource.cloneAllDimensionInfo = bind(cloneAllDimensionInfo, null, dimensions); - return extSource; + extSource.getDimensionInfo = bind(getDimensionInfo, null, dimensions, dimsByName); + extSource.cloneAllDimensionInfo = bind(cloneAllDimensionInfo, null, dimensions); + return extSource; } function getRawData(upstream) { - var sourceFormat = upstream.sourceFormat; - - if (!isSupportedSourceFormat(sourceFormat)) { - var errMsg = ''; + var sourceFormat = upstream.sourceFormat; - if ("development" !== 'production') { - errMsg = '`getRawData` is not supported in source format ' + sourceFormat; - } + if (!isSupportedSourceFormat(sourceFormat)) { + var errMsg = ''; - throwError(errMsg); + if ("development" !== 'production') { + errMsg = '`getRawData` is not supported in source format ' + sourceFormat; } - return upstream.data; + throwError(errMsg); + } + + return upstream.data; } function cloneRawData(upstream) { - var sourceFormat = upstream.sourceFormat; - var data = upstream.data; - - if (!isSupportedSourceFormat(sourceFormat)) { - var errMsg = ''; + var sourceFormat = upstream.sourceFormat; + var data = upstream.data; - if ("development" !== 'production') { - errMsg = '`cloneRawData` is not supported in source format ' + sourceFormat; - } + if (!isSupportedSourceFormat(sourceFormat)) { + var errMsg = ''; - throwError(errMsg); + if ("development" !== 'production') { + errMsg = '`cloneRawData` is not supported in source format ' + sourceFormat; } - if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) { - var result = []; + throwError(errMsg); + } - for (var i = 0, len = data.length; i < len; i++) { - // Not strictly clone for performance - result.push(data[i].slice()); - } + if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) { + var result = []; - return result; - } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) { - var result = []; + for (var i = 0, len = data.length; i < len; i++) { + // Not strictly clone for performance + result.push(data[i].slice()); + } - for (var i = 0, len = data.length; i < len; i++) { - // Not strictly clone for performance - result.push(extend({}, data[i])); - } + return result; + } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) { + var result = []; - return result; + for (var i = 0, len = data.length; i < len; i++) { + // Not strictly clone for performance + result.push(extend({}, data[i])); } + + return result; + } } function getDimensionInfo(dimensions, dimsByName, dim) { - if (dim == null) { - return; - } // Keep the same logic as `List::getDimension` did. + if (dim == null) { + return; + } // Keep the same logic as `List::getDimension` did. - if (isNumber(dim) // If being a number-like string but not being defined a dimension name. - || !isNaN(dim) && !hasOwn(dimsByName, dim)) { - return dimensions[dim]; - } else if (hasOwn(dimsByName, dim)) { - return dimsByName[dim]; - } + if (isNumber(dim) // If being a number-like string but not being defined a dimension name. + || !isNaN(dim) && !hasOwn(dimsByName, dim)) { + return dimensions[dim]; + } else if (hasOwn(dimsByName, dim)) { + return dimsByName[dim]; + } } function cloneAllDimensionInfo(dimensions) { - return clone(dimensions); + return clone(dimensions); } var externalTransformMap = createHashMap(); function registerExternalTransform(externalTransform) { - externalTransform = clone(externalTransform); - var type = externalTransform.type; - var errMsg = ''; - - if (!type) { - if ("development" !== 'production') { - errMsg = 'Must have a `type` when `registerTransform`.'; - } + externalTransform = clone(externalTransform); + var type = externalTransform.type; + var errMsg = ''; - throwError(errMsg); + if (!type) { + if ("development" !== 'production') { + errMsg = 'Must have a `type` when `registerTransform`.'; } - var typeParsed = type.split(':'); + throwError(errMsg); + } - if (typeParsed.length !== 2) { - if ("development" !== 'production') { - errMsg = 'Name must include namespace like "ns:regression".'; - } + var typeParsed = type.split(':'); - throwError(errMsg); - } // Namespace 'echarts:xxx' is official namespace, where the transforms should - // be called directly via 'xxx' rather than 'echarts:xxx'. + if (typeParsed.length !== 2) { + if ("development" !== 'production') { + errMsg = 'Name must include namespace like "ns:regression".'; + } + throwError(errMsg); + } // Namespace 'echarts:xxx' is official namespace, where the transforms should + // be called directly via 'xxx' rather than 'echarts:xxx'. - var isBuiltIn = false; - if (typeParsed[0] === 'echarts') { - type = typeParsed[1]; - isBuiltIn = true; - } + var isBuiltIn = false; - externalTransform.__isBuiltIn = isBuiltIn; - externalTransformMap.set(type, externalTransform); + if (typeParsed[0] === 'echarts') { + type = typeParsed[1]; + isBuiltIn = true; + } + + externalTransform.__isBuiltIn = isBuiltIn; + externalTransformMap.set(type, externalTransform); } function applyDataTransform(rawTransOption, sourceList, infoForPrint) { - var pipedTransOption = normalizeToArray(rawTransOption); - var pipeLen = pipedTransOption.length; - var errMsg = ''; - - if (!pipeLen) { - if ("development" !== 'production') { - errMsg = 'If `transform` declared, it should at least contain one transform.'; - } + var pipedTransOption = normalizeToArray(rawTransOption); + var pipeLen = pipedTransOption.length; + var errMsg = ''; - throwError(errMsg); + if (!pipeLen) { + if ("development" !== 'production') { + errMsg = 'If `transform` declared, it should at least contain one transform.'; } - for (var i = 0, len = pipeLen; i < len; i++) { - var transOption = pipedTransOption[i]; - sourceList = applySingleDataTransform(transOption, sourceList, infoForPrint, pipeLen === 1 ? null : i); // piped transform only support single input, except the fist one. - // piped transform only support single output, except the last one. + throwError(errMsg); + } - if (i !== len - 1) { - sourceList.length = Math.max(sourceList.length, 1); - } + for (var i = 0, len = pipeLen; i < len; i++) { + var transOption = pipedTransOption[i]; + sourceList = applySingleDataTransform(transOption, sourceList, infoForPrint, pipeLen === 1 ? null : i); // piped transform only support single input, except the fist one. + // piped transform only support single output, except the last one. + + if (i !== len - 1) { + sourceList.length = Math.max(sourceList.length, 1); } + } - return sourceList; + return sourceList; } function applySingleDataTransform(transOption, upSourceList, infoForPrint, // If `pipeIndex` is null/undefined, no piped transform. - pipeIndex) { - var errMsg = ''; - - if (!upSourceList.length) { - if ("development" !== 'production') { - errMsg = 'Must have at least one upstream dataset.'; - } + pipeIndex) { + var errMsg = ''; - throwError(errMsg); + if (!upSourceList.length) { + if ("development" !== 'production') { + errMsg = 'Must have at least one upstream dataset.'; } - if (!isObject(transOption)) { - if ("development" !== 'production') { - errMsg = 'transform declaration must be an object rather than ' + typeof transOption + '.'; - } + throwError(errMsg); + } - throwError(errMsg); + if (!isObject(transOption)) { + if ("development" !== 'production') { + errMsg = 'transform declaration must be an object rather than ' + typeof transOption + '.'; } - var transType = transOption.type; - var externalTransform = externalTransformMap.get(transType); - - if (!externalTransform) { - if ("development" !== 'production') { - errMsg = 'Can not find transform on type "' + transType + '".'; - } - - throwError(errMsg); - } // Prepare source - + throwError(errMsg); + } - var extUpSourceList = map(upSourceList, function (upSource) { - return createExternalSource(upSource, externalTransform); - }); - var resultList = normalizeToArray(externalTransform.transform({ - upstream: extUpSourceList[0], - upstreamList: extUpSourceList, - config: clone(transOption.config) - })); + var transType = transOption.type; + var externalTransform = externalTransformMap.get(transType); + if (!externalTransform) { if ("development" !== 'production') { - if (transOption.print) { - var printStrArr = map(resultList, function (extSource) { - var pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : ''; - return ['=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===', '- transform result data:', makePrintable(extSource.data), '- transform result dimensions:', makePrintable(extSource.dimensions)].join('\n'); - }).join('\n'); - log(printStrArr); - } + errMsg = 'Can not find transform on type "' + transType + '".'; } - return map(resultList, function (result, resultIndex) { - var errMsg = ''; + throwError(errMsg); + } // Prepare source - if (!isObject(result)) { - if ("development" !== 'production') { - errMsg = 'A transform should not return some empty results.'; - } - throwError(errMsg); - } + var extUpSourceList = map(upSourceList, function (upSource) { + return createExternalSource(upSource, externalTransform); + }); + var resultList = normalizeToArray(externalTransform.transform({ + upstream: extUpSourceList[0], + upstreamList: extUpSourceList, + config: clone(transOption.config) + })); - if (!result.data) { - if ("development" !== 'production') { - errMsg = 'Transform result data should be not be null or undefined'; - } + if ("development" !== 'production') { + if (transOption.print) { + var printStrArr = map(resultList, function (extSource) { + var pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : ''; + return ['=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===', '- transform result data:', makePrintable(extSource.data), '- transform result dimensions:', makePrintable(extSource.dimensions)].join('\n'); + }).join('\n'); + log(printStrArr); + } + } - throwError(errMsg); - } + return map(resultList, function (result, resultIndex) { + var errMsg = ''; - var sourceFormat = detectSourceFormat(result.data); + if (!isObject(result)) { + if ("development" !== 'production') { + errMsg = 'A transform should not return some empty results.'; + } - if (!isSupportedSourceFormat(sourceFormat)) { - if ("development" !== 'production') { - errMsg = 'Transform result data should be array rows or object rows.'; - } + throwError(errMsg); + } - throwError(errMsg); - } + if (!result.data) { + if ("development" !== 'production') { + errMsg = 'Transform result data should be not be null or undefined'; + } - var resultMetaRawOption; - var firstUpSource = upSourceList[0]; - /** - * Intuitively, the end users known the content of the original `dataset.source`, - * calucating the transform result in mind. - * Suppose the original `dataset.source` is: - * ```js - * [ - * ['product', '2012', '2013', '2014', '2015'], - * ['AAA', 41.1, 30.4, 65.1, 53.3], - * ['BBB', 86.5, 92.1, 85.7, 83.1], - * ['CCC', 24.1, 67.2, 79.5, 86.4] - * ] - * ``` - * The dimension info have to be detected from the source data. - * Some of the transformers (like filter, sort) will follow the dimension info - * of upstream, while others use new dimensions (like aggregate). - * Transformer can output a field `dimensions` to define the its own output dimensions. - * We also allow transformers to ignore the output `dimensions` field, and - * inherit the upstream dimensions definition. It can reduce the burden of handling - * dimensions in transformers. - * - * See also [DIMENSION_INHERIT_RULE] in `sourceManager.ts`. - */ + throwError(errMsg); + } - if (firstUpSource && resultIndex === 0 // If transformer returns `dimensions`, it means that the transformer has different - // dimensions definitions. We do not inherit anything from upstream. - && !result.dimensions) { - var startIndex = firstUpSource.startIndex; // We copy the header of upstream to the result becuase: - // (1) The returned data always does not contain header line and can not be used - // as dimension-detection. In this case we can not use "detected dimensions" of - // upstream directly, because it might be detected based on different `seriesLayoutBy`. - // (2) We should support that the series read the upstream source in `seriesLayoutBy: 'row'`. - // So the original detected header should be add to the result, otherwise they can not be read. + var sourceFormat = detectSourceFormat(result.data); - if (startIndex) { - result.data = firstUpSource.data.slice(0, startIndex).concat(result.data); - } + if (!isSupportedSourceFormat(sourceFormat)) { + if ("development" !== 'production') { + errMsg = 'Transform result data should be array rows or object rows.'; + } - resultMetaRawOption = { - seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN, - sourceHeader: startIndex, - dimensions: firstUpSource.metaRawOption.dimensions - }; - } else { - resultMetaRawOption = { - seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN, - sourceHeader: 0, - dimensions: result.dimensions - }; - } + throwError(errMsg); + } - return createSource(result.data, resultMetaRawOption, null); - }); + var resultMetaRawOption; + var firstUpSource = upSourceList[0]; + /** + * Intuitively, the end users known the content of the original `dataset.source`, + * calucating the transform result in mind. + * Suppose the original `dataset.source` is: + * ```js + * [ + * ['product', '2012', '2013', '2014', '2015'], + * ['AAA', 41.1, 30.4, 65.1, 53.3], + * ['BBB', 86.5, 92.1, 85.7, 83.1], + * ['CCC', 24.1, 67.2, 79.5, 86.4] + * ] + * ``` + * The dimension info have to be detected from the source data. + * Some of the transformers (like filter, sort) will follow the dimension info + * of upstream, while others use new dimensions (like aggregate). + * Transformer can output a field `dimensions` to define the its own output dimensions. + * We also allow transformers to ignore the output `dimensions` field, and + * inherit the upstream dimensions definition. It can reduce the burden of handling + * dimensions in transformers. + * + * See also [DIMENSION_INHERIT_RULE] in `sourceManager.ts`. + */ + + if (firstUpSource && resultIndex === 0 // If transformer returns `dimensions`, it means that the transformer has different + // dimensions definitions. We do not inherit anything from upstream. + && !result.dimensions) { + var startIndex = firstUpSource.startIndex; // We copy the header of upstream to the result becuase: + // (1) The returned data always does not contain header line and can not be used + // as dimension-detection. In this case we can not use "detected dimensions" of + // upstream directly, because it might be detected based on different `seriesLayoutBy`. + // (2) We should support that the series read the upstream source in `seriesLayoutBy: 'row'`. + // So the original detected header should be add to the result, otherwise they can not be read. + + if (startIndex) { + result.data = firstUpSource.data.slice(0, startIndex).concat(result.data); + } + + resultMetaRawOption = { + seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN, + sourceHeader: startIndex, + dimensions: firstUpSource.metaRawOption.dimensions + }; + } else { + resultMetaRawOption = { + seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN, + sourceHeader: 0, + dimensions: result.dimensions + }; + } + + return createSource(result.data, resultMetaRawOption, null); + }); } function isSupportedSourceFormat(sourceFormat) { - return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS; + return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS; } var UNDEFINED = 'undefined'; @@ -21986,1151 +21986,1151 @@ */ var dataCtors = { - 'float': CtorFloat64Array, - 'int': CtorInt32Array, - // Ordinal data type can be string or int - 'ordinal': Array, - 'number': Array, - 'time': CtorFloat64Array + 'float': CtorFloat64Array, + 'int': CtorInt32Array, + // Ordinal data type can be string or int + 'ordinal': Array, + 'number': Array, + 'time': CtorFloat64Array }; var defaultDimValueGetters; function getIndicesCtor(rawCount) { - // The possible max value in this._indicies is always this._rawCount despite of filtering. - return rawCount > 65535 ? CtorUint32Array : CtorUint16Array; + // The possible max value in this._indicies is always this._rawCount despite of filtering. + return rawCount > 65535 ? CtorUint32Array : CtorUint16Array; } function getInitialExtent() { - return [Infinity, -Infinity]; + return [Infinity, -Infinity]; } function cloneChunk(originalChunk) { - var Ctor = originalChunk.constructor; // Only shallow clone is enough when Array. + var Ctor = originalChunk.constructor; // Only shallow clone is enough when Array. - return Ctor === Array ? originalChunk.slice() : new Ctor(originalChunk); + return Ctor === Array ? originalChunk.slice() : new Ctor(originalChunk); } function prepareStore(store, dimIdx, dimType, end, append) { - var DataCtor = dataCtors[dimType || 'float']; + var DataCtor = dataCtors[dimType || 'float']; - if (append) { - var oldStore = store[dimIdx]; - var oldLen = oldStore && oldStore.length; + if (append) { + var oldStore = store[dimIdx]; + var oldLen = oldStore && oldStore.length; - if (!(oldLen === end)) { - var newStore = new DataCtor(end); // The cost of the copy is probably inconsiderable - // within the initial chunkSize. + if (!(oldLen === end)) { + var newStore = new DataCtor(end); // The cost of the copy is probably inconsiderable + // within the initial chunkSize. - for (var j = 0; j < oldLen; j++) { - newStore[j] = oldStore[j]; - } + for (var j = 0; j < oldLen; j++) { + newStore[j] = oldStore[j]; + } - store[dimIdx] = newStore; - } - } else { - store[dimIdx] = new DataCtor(end); + store[dimIdx] = newStore; } + } else { + store[dimIdx] = new DataCtor(end); + } } /** * Basically, DataStore API keep immutable. */ var DataStore = - /** @class */ - function () { - function DataStore() { - this._chunks = []; // It will not be calculated util needed. + /** @class */ + function () { + function DataStore() { + this._chunks = []; // It will not be calculated util needed. + + this._rawExtent = []; + this._extent = []; + this._count = 0; + this._rawCount = 0; + this._calcDimNameToIdx = createHashMap(); + } + /** + * Initialize from data + */ + + + DataStore.prototype.initData = function (provider, inputDimensions, dimValueGetter) { + if ("development" !== 'production') { + assert(isFunction(provider.getItem) && isFunction(provider.count), 'Inavlid data provider.'); + } + + this._provider = provider; // Clear + + this._chunks = []; + this._indices = null; + this.getRawIndex = this._getRawIdxIdentity; + var source = provider.getSource(); + var defaultGetter = this.defaultDimValueGetter = defaultDimValueGetters[source.sourceFormat]; // Default dim value getter - this._rawExtent = []; - this._extent = []; - this._count = 0; - this._rawCount = 0; - this._calcDimNameToIdx = createHashMap(); + this._dimValueGetter = dimValueGetter || defaultGetter; // Reset raw extent. + + this._rawExtent = []; + var willRetrieveDataByName = shouldRetrieveDataByName(source); + this._dimensions = map(inputDimensions, function (dim) { + if ("development" !== 'production') { + if (willRetrieveDataByName) { + assert(dim.property != null); } - /** - * Initialize from data - */ + } + return { + // Only pick these two props. Not leak other properties like orderMeta. + type: dim.type, + property: dim.property + }; + }); - DataStore.prototype.initData = function (provider, inputDimensions, dimValueGetter) { - if ("development" !== 'production') { - assert(isFunction(provider.getItem) && isFunction(provider.count), 'Inavlid data provider.'); - } + this._initDataFromProvider(0, provider.count()); + }; + + DataStore.prototype.getProvider = function () { + return this._provider; + }; + /** + * Caution: even when a `source` instance owned by a series, the created data store + * may still be shared by different sereis (the source hash does not use all `source` + * props, see `sourceManager`). In this case, the `source` props that are not used in + * hash (like `source.dimensionDefine`) probably only belongs to a certain series and + * thus should not be fetch here. + */ - this._provider = provider; // Clear - this._chunks = []; - this._indices = null; - this.getRawIndex = this._getRawIdxIdentity; - var source = provider.getSource(); - var defaultGetter = this.defaultDimValueGetter = defaultDimValueGetters[source.sourceFormat]; // Default dim value getter + DataStore.prototype.getSource = function () { + return this._provider.getSource(); + }; + /** + * @caution Only used in dataStack. + */ - this._dimValueGetter = dimValueGetter || defaultGetter; // Reset raw extent. - this._rawExtent = []; - var willRetrieveDataByName = shouldRetrieveDataByName(source); - this._dimensions = map(inputDimensions, function (dim) { - if ("development" !== 'production') { - if (willRetrieveDataByName) { - assert(dim.property != null); - } - } + DataStore.prototype.ensureCalculationDimension = function (dimName, type) { + var calcDimNameToIdx = this._calcDimNameToIdx; + var dimensions = this._dimensions; + var calcDimIdx = calcDimNameToIdx.get(dimName); - return { - // Only pick these two props. Not leak other properties like orderMeta. - type: dim.type, - property: dim.property - }; - }); + if (calcDimIdx != null) { + if (dimensions[calcDimIdx].type === type) { + return calcDimIdx; + } + } else { + calcDimIdx = dimensions.length; + } - this._initDataFromProvider(0, provider.count()); - }; + dimensions[calcDimIdx] = { + type: type + }; + calcDimNameToIdx.set(dimName, calcDimIdx); + this._chunks[calcDimIdx] = new dataCtors[type || 'float'](this._rawCount); + this._rawExtent[calcDimIdx] = getInitialExtent(); + return calcDimIdx; + }; - DataStore.prototype.getProvider = function () { - return this._provider; - }; - /** - * Caution: even when a `source` instance owned by a series, the created data store - * may still be shared by different sereis (the source hash does not use all `source` - * props, see `sourceManager`). In this case, the `source` props that are not used in - * hash (like `source.dimensionDefine`) probably only belongs to a certain series and - * thus should not be fetch here. - */ + DataStore.prototype.collectOrdinalMeta = function (dimIdx, ordinalMeta) { + var chunk = this._chunks[dimIdx]; + var dim = this._dimensions[dimIdx]; + var rawExtents = this._rawExtent; + var offset = dim.ordinalOffset || 0; + var len = chunk.length; + if (offset === 0) { + // We need to reset the rawExtent if collect is from start. + // Because this dimension may be guessed as number and calcuating a wrong extent. + rawExtents[dimIdx] = getInitialExtent(); + } - DataStore.prototype.getSource = function () { - return this._provider.getSource(); - }; - /** - * @caution Only used in dataStack. - */ + var dimRawExtent = rawExtents[dimIdx]; // Parse from previous data offset. len may be changed after appendData + for (var i = offset; i < len; i++) { + var val = chunk[i] = ordinalMeta.parseAndCollect(chunk[i]); - DataStore.prototype.ensureCalculationDimension = function (dimName, type) { - var calcDimNameToIdx = this._calcDimNameToIdx; - var dimensions = this._dimensions; - var calcDimIdx = calcDimNameToIdx.get(dimName); + if (!isNaN(val)) { + dimRawExtent[0] = Math.min(val, dimRawExtent[0]); + dimRawExtent[1] = Math.max(val, dimRawExtent[1]); + } + } - if (calcDimIdx != null) { - if (dimensions[calcDimIdx].type === type) { - return calcDimIdx; - } - } else { - calcDimIdx = dimensions.length; - } + dim.ordinalMeta = ordinalMeta; + dim.ordinalOffset = len; + dim.type = 'ordinal'; // Force to be ordinal + }; - dimensions[calcDimIdx] = { - type: type - }; - calcDimNameToIdx.set(dimName, calcDimIdx); - this._chunks[calcDimIdx] = new dataCtors[type || 'float'](this._rawCount); - this._rawExtent[calcDimIdx] = getInitialExtent(); - return calcDimIdx; - }; + DataStore.prototype.getOrdinalMeta = function (dimIdx) { + var dimInfo = this._dimensions[dimIdx]; + var ordinalMeta = dimInfo.ordinalMeta; + return ordinalMeta; + }; - DataStore.prototype.collectOrdinalMeta = function (dimIdx, ordinalMeta) { - var chunk = this._chunks[dimIdx]; - var dim = this._dimensions[dimIdx]; - var rawExtents = this._rawExtent; - var offset = dim.ordinalOffset || 0; - var len = chunk.length; + DataStore.prototype.getDimensionProperty = function (dimIndex) { + var item = this._dimensions[dimIndex]; + return item && item.property; + }; + /** + * Caution: Can be only called on raw data (before `this._indices` created). + */ - if (offset === 0) { - // We need to reset the rawExtent if collect is from start. - // Because this dimension may be guessed as number and calcuating a wrong extent. - rawExtents[dimIdx] = getInitialExtent(); - } - var dimRawExtent = rawExtents[dimIdx]; // Parse from previous data offset. len may be changed after appendData + DataStore.prototype.appendData = function (data) { + if ("development" !== 'production') { + assert(!this._indices, 'appendData can only be called on raw data.'); + } - for (var i = offset; i < len; i++) { - var val = chunk[i] = ordinalMeta.parseAndCollect(chunk[i]); + var provider = this._provider; + var start = this.count(); + provider.appendData(data); + var end = provider.count(); - if (!isNaN(val)) { - dimRawExtent[0] = Math.min(val, dimRawExtent[0]); - dimRawExtent[1] = Math.max(val, dimRawExtent[1]); - } - } + if (!provider.persistent) { + end += start; + } - dim.ordinalMeta = ordinalMeta; - dim.ordinalOffset = len; - dim.type = 'ordinal'; // Force to be ordinal - }; + if (start < end) { + this._initDataFromProvider(start, end, true); + } - DataStore.prototype.getOrdinalMeta = function (dimIdx) { - var dimInfo = this._dimensions[dimIdx]; - var ordinalMeta = dimInfo.ordinalMeta; - return ordinalMeta; - }; + return [start, end]; + }; - DataStore.prototype.getDimensionProperty = function (dimIndex) { - var item = this._dimensions[dimIndex]; - return item && item.property; - }; - /** - * Caution: Can be only called on raw data (before `this._indices` created). - */ + DataStore.prototype.appendValues = function (values, minFillLen) { + var chunks = this._chunks; + var dimensions = this._dimensions; + var dimLen = dimensions.length; + var rawExtent = this._rawExtent; + var start = this.count(); + var end = start + Math.max(values.length, minFillLen || 0); + for (var i = 0; i < dimLen; i++) { + var dim = dimensions[i]; + prepareStore(chunks, i, dim.type, end, true); + } - DataStore.prototype.appendData = function (data) { - if ("development" !== 'production') { - assert(!this._indices, 'appendData can only be called on raw data.'); - } + var emptyDataItem = []; - var provider = this._provider; - var start = this.count(); - provider.appendData(data); - var end = provider.count(); + for (var idx = start; idx < end; idx++) { + var sourceIdx = idx - start; // Store the data by dimensions - if (!provider.persistent) { - end += start; - } + for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) { + var dim = dimensions[dimIdx]; + var val = defaultDimValueGetters.arrayRows.call(this, values[sourceIdx] || emptyDataItem, dim.property, sourceIdx, dimIdx); + chunks[dimIdx][idx] = val; + var dimRawExtent = rawExtent[dimIdx]; + val < dimRawExtent[0] && (dimRawExtent[0] = val); + val > dimRawExtent[1] && (dimRawExtent[1] = val); + } + } - if (start < end) { - this._initDataFromProvider(start, end, true); - } + this._rawCount = this._count = end; + return { + start: start, + end: end + }; + }; + + DataStore.prototype._initDataFromProvider = function (start, end, append) { + var provider = this._provider; + var chunks = this._chunks; + var dimensions = this._dimensions; + var dimLen = dimensions.length; + var rawExtent = this._rawExtent; + var dimNames = map(dimensions, function (dim) { + return dim.property; + }); - return [start, end]; - }; + for (var i = 0; i < dimLen; i++) { + var dim = dimensions[i]; - DataStore.prototype.appendValues = function (values, minFillLen) { - var chunks = this._chunks; - var dimensions = this._dimensions; - var dimLen = dimensions.length; - var rawExtent = this._rawExtent; - var start = this.count(); - var end = start + Math.max(values.length, minFillLen || 0); + if (!rawExtent[i]) { + rawExtent[i] = getInitialExtent(); + } - for (var i = 0; i < dimLen; i++) { - var dim = dimensions[i]; - prepareStore(chunks, i, dim.type, end, true); - } + prepareStore(chunks, i, dim.type, end, append); + } - var emptyDataItem = []; + if (provider.fillStorage) { + provider.fillStorage(start, end, chunks, rawExtent); + } else { + var dataItem = []; - for (var idx = start; idx < end; idx++) { - var sourceIdx = idx - start; // Store the data by dimensions + for (var idx = start; idx < end; idx++) { + // NOTICE: Try not to write things into dataItem + dataItem = provider.getItem(idx, dataItem); // Each data item is value + // [1, 2] + // 2 + // Bar chart, line chart which uses category axis + // only gives the 'y' value. 'x' value is the indices of category + // Use a tempValue to normalize the value to be a (x, y) value + // Store the data by dimensions - for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) { - var dim = dimensions[dimIdx]; - var val = defaultDimValueGetters.arrayRows.call(this, values[sourceIdx] || emptyDataItem, dim.property, sourceIdx, dimIdx); - chunks[dimIdx][idx] = val; - var dimRawExtent = rawExtent[dimIdx]; - val < dimRawExtent[0] && (dimRawExtent[0] = val); - val > dimRawExtent[1] && (dimRawExtent[1] = val); - } - } + for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) { + var dimStorage = chunks[dimIdx]; // PENDING NULL is empty or zero - this._rawCount = this._count = end; - return { - start: start, - end: end - }; - }; + var val = this._dimValueGetter(dataItem, dimNames[dimIdx], idx, dimIdx); - DataStore.prototype._initDataFromProvider = function (start, end, append) { - var provider = this._provider; - var chunks = this._chunks; - var dimensions = this._dimensions; - var dimLen = dimensions.length; - var rawExtent = this._rawExtent; - var dimNames = map(dimensions, function (dim) { - return dim.property; - }); + dimStorage[idx] = val; + var dimRawExtent = rawExtent[dimIdx]; + val < dimRawExtent[0] && (dimRawExtent[0] = val); + val > dimRawExtent[1] && (dimRawExtent[1] = val); + } + } + } - for (var i = 0; i < dimLen; i++) { - var dim = dimensions[i]; + if (!provider.persistent && provider.clean) { + // Clean unused data if data source is typed array. + provider.clean(); + } - if (!rawExtent[i]) { - rawExtent[i] = getInitialExtent(); - } + this._rawCount = this._count = end; // Reset data extent - prepareStore(chunks, i, dim.type, end, append); - } + this._extent = []; + }; - if (provider.fillStorage) { - provider.fillStorage(start, end, chunks, rawExtent); - } else { - var dataItem = []; - - for (var idx = start; idx < end; idx++) { - // NOTICE: Try not to write things into dataItem - dataItem = provider.getItem(idx, dataItem); // Each data item is value - // [1, 2] - // 2 - // Bar chart, line chart which uses category axis - // only gives the 'y' value. 'x' value is the indices of category - // Use a tempValue to normalize the value to be a (x, y) value - // Store the data by dimensions - - for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) { - var dimStorage = chunks[dimIdx]; // PENDING NULL is empty or zero - - var val = this._dimValueGetter(dataItem, dimNames[dimIdx], idx, dimIdx); - - dimStorage[idx] = val; - var dimRawExtent = rawExtent[dimIdx]; - val < dimRawExtent[0] && (dimRawExtent[0] = val); - val > dimRawExtent[1] && (dimRawExtent[1] = val); - } - } - } + DataStore.prototype.count = function () { + return this._count; + }; + /** + * Get value. Return NaN if idx is out of range. + */ - if (!provider.persistent && provider.clean) { - // Clean unused data if data source is typed array. - provider.clean(); - } - this._rawCount = this._count = end; // Reset data extent + DataStore.prototype.get = function (dim, idx) { + if (!(idx >= 0 && idx < this._count)) { + return NaN; + } - this._extent = []; - }; + var dimStore = this._chunks[dim]; + return dimStore ? dimStore[this.getRawIndex(idx)] : NaN; + }; - DataStore.prototype.count = function () { - return this._count; - }; - /** - * Get value. Return NaN if idx is out of range. - */ + DataStore.prototype.getValues = function (dimensions, idx) { + var values = []; + var dimArr = []; + if (idx == null) { + idx = dimensions; // TODO get all from store? - DataStore.prototype.get = function (dim, idx) { - if (!(idx >= 0 && idx < this._count)) { - return NaN; - } + dimensions = []; // All dimensions - var dimStore = this._chunks[dim]; - return dimStore ? dimStore[this.getRawIndex(idx)] : NaN; - }; + for (var i = 0; i < this._dimensions.length; i++) { + dimArr.push(i); + } + } else { + dimArr = dimensions; + } - DataStore.prototype.getValues = function (dimensions, idx) { - var values = []; - var dimArr = []; + for (var i = 0, len = dimArr.length; i < len; i++) { + values.push(this.get(dimArr[i], idx)); + } - if (idx == null) { - idx = dimensions; // TODO get all from store? + return values; + }; + /** + * @param dim concrete dim + */ - dimensions = []; // All dimensions - for (var i = 0; i < this._dimensions.length; i++) { - dimArr.push(i); - } - } else { - dimArr = dimensions; - } + DataStore.prototype.getByRawIndex = function (dim, rawIdx) { + if (!(rawIdx >= 0 && rawIdx < this._rawCount)) { + return NaN; + } - for (var i = 0, len = dimArr.length; i < len; i++) { - values.push(this.get(dimArr[i], idx)); - } + var dimStore = this._chunks[dim]; + return dimStore ? dimStore[rawIdx] : NaN; + }; + /** + * Get sum of data in one dimension + */ - return values; - }; - /** - * @param dim concrete dim - */ + DataStore.prototype.getSum = function (dim) { + var dimData = this._chunks[dim]; + var sum = 0; - DataStore.prototype.getByRawIndex = function (dim, rawIdx) { - if (!(rawIdx >= 0 && rawIdx < this._rawCount)) { - return NaN; - } + if (dimData) { + for (var i = 0, len = this.count(); i < len; i++) { + var value = this.get(dim, i); - var dimStore = this._chunks[dim]; - return dimStore ? dimStore[rawIdx] : NaN; - }; - /** - * Get sum of data in one dimension - */ + if (!isNaN(value)) { + sum += value; + } + } + } + return sum; + }; + /** + * Get median of data in one dimension + */ - DataStore.prototype.getSum = function (dim) { - var dimData = this._chunks[dim]; - var sum = 0; - if (dimData) { - for (var i = 0, len = this.count(); i < len; i++) { - var value = this.get(dim, i); + DataStore.prototype.getMedian = function (dim) { + var dimDataArray = []; // map all data of one dimension - if (!isNaN(value)) { - sum += value; - } - } - } + this.each([dim], function (val) { + if (!isNaN(val)) { + dimDataArray.push(val); + } + }); // TODO + // Use quick select? - return sum; - }; - /** - * Get median of data in one dimension - */ + var sortedDimDataArray = dimDataArray.sort(function (a, b) { + return a - b; + }); + var len = this.count(); // calculate median + return len === 0 ? 0 : len % 2 === 1 ? sortedDimDataArray[(len - 1) / 2] : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2; + }; + /** + * Retreive the index with given raw data index + */ - DataStore.prototype.getMedian = function (dim) { - var dimDataArray = []; // map all data of one dimension - this.each([dim], function (val) { - if (!isNaN(val)) { - dimDataArray.push(val); - } - }); // TODO - // Use quick select? + DataStore.prototype.indexOfRawIndex = function (rawIndex) { + if (rawIndex >= this._rawCount || rawIndex < 0) { + return -1; + } - var sortedDimDataArray = dimDataArray.sort(function (a, b) { - return a - b; - }); - var len = this.count(); // calculate median + if (!this._indices) { + return rawIndex; + } // Indices are ascending - return len === 0 ? 0 : len % 2 === 1 ? sortedDimDataArray[(len - 1) / 2] : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2; - }; - /** - * Retreive the index with given raw data index - */ + var indices = this._indices; // If rawIndex === dataIndex - DataStore.prototype.indexOfRawIndex = function (rawIndex) { - if (rawIndex >= this._rawCount || rawIndex < 0) { - return -1; - } + var rawDataIndex = indices[rawIndex]; - if (!this._indices) { - return rawIndex; - } // Indices are ascending + if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) { + return rawIndex; + } + var left = 0; + var right = this._count - 1; - var indices = this._indices; // If rawIndex === dataIndex + while (left <= right) { + var mid = (left + right) / 2 | 0; - var rawDataIndex = indices[rawIndex]; + if (indices[mid] < rawIndex) { + left = mid + 1; + } else if (indices[mid] > rawIndex) { + right = mid - 1; + } else { + return mid; + } + } - if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) { - return rawIndex; - } + return -1; + }; + /** + * Retreive the index of nearest value + * @param dim + * @param value + * @param [maxDistance=Infinity] + * @return If and only if multiple indices has + * the same value, they are put to the result. + */ - var left = 0; - var right = this._count - 1; - while (left <= right) { - var mid = (left + right) / 2 | 0; + DataStore.prototype.indicesOfNearest = function (dim, value, maxDistance) { + var chunks = this._chunks; + var dimData = chunks[dim]; + var nearestIndices = []; - if (indices[mid] < rawIndex) { - left = mid + 1; - } else if (indices[mid] > rawIndex) { - right = mid - 1; - } else { - return mid; - } - } + if (!dimData) { + return nearestIndices; + } - return -1; - }; - /** - * Retreive the index of nearest value - * @param dim - * @param value - * @param [maxDistance=Infinity] - * @return If and only if multiple indices has - * the same value, they are put to the result. - */ + if (maxDistance == null) { + maxDistance = Infinity; + } + var minDist = Infinity; + var minDiff = -1; + var nearestIndicesLen = 0; // Check the test case of `test/ut/spec/data/SeriesData.js`. - DataStore.prototype.indicesOfNearest = function (dim, value, maxDistance) { - var chunks = this._chunks; - var dimData = chunks[dim]; - var nearestIndices = []; + for (var i = 0, len = this.count(); i < len; i++) { + var dataIndex = this.getRawIndex(i); + var diff = value - dimData[dataIndex]; + var dist = Math.abs(diff); - if (!dimData) { - return nearestIndices; - } + if (dist <= maxDistance) { + // When the `value` is at the middle of `this.get(dim, i)` and `this.get(dim, i+1)`, + // we'd better not push both of them to `nearestIndices`, otherwise it is easy to + // get more than one item in `nearestIndices` (more specifically, in `tooltip`). + // So we chose the one that `diff >= 0` in this csae. + // But if `this.get(dim, i)` and `this.get(dim, j)` get the same value, both of them + // should be push to `nearestIndices`. + if (dist < minDist || dist === minDist && diff >= 0 && minDiff < 0) { + minDist = dist; + minDiff = diff; + nearestIndicesLen = 0; + } - if (maxDistance == null) { - maxDistance = Infinity; - } + if (diff === minDiff) { + nearestIndices[nearestIndicesLen++] = i; + } + } + } - var minDist = Infinity; - var minDiff = -1; - var nearestIndicesLen = 0; // Check the test case of `test/ut/spec/data/SeriesData.js`. + nearestIndices.length = nearestIndicesLen; + return nearestIndices; + }; - for (var i = 0, len = this.count(); i < len; i++) { - var dataIndex = this.getRawIndex(i); - var diff = value - dimData[dataIndex]; - var dist = Math.abs(diff); + DataStore.prototype.getIndices = function () { + var newIndices; + var indices = this._indices; - if (dist <= maxDistance) { - // When the `value` is at the middle of `this.get(dim, i)` and `this.get(dim, i+1)`, - // we'd better not push both of them to `nearestIndices`, otherwise it is easy to - // get more than one item in `nearestIndices` (more specifically, in `tooltip`). - // So we chose the one that `diff >= 0` in this csae. - // But if `this.get(dim, i)` and `this.get(dim, j)` get the same value, both of them - // should be push to `nearestIndices`. - if (dist < minDist || dist === minDist && diff >= 0 && minDiff < 0) { - minDist = dist; - minDiff = diff; - nearestIndicesLen = 0; - } + if (indices) { + var Ctor = indices.constructor; + var thisCount = this._count; // `new Array(a, b, c)` is different from `new Uint32Array(a, b, c)`. - if (diff === minDiff) { - nearestIndices[nearestIndicesLen++] = i; - } - } - } + if (Ctor === Array) { + newIndices = new Ctor(thisCount); - nearestIndices.length = nearestIndicesLen; - return nearestIndices; - }; + for (var i = 0; i < thisCount; i++) { + newIndices[i] = indices[i]; + } + } else { + newIndices = new Ctor(indices.buffer, 0, thisCount); + } + } else { + var Ctor = getIndicesCtor(this._rawCount); + newIndices = new Ctor(this.count()); - DataStore.prototype.getIndices = function () { - var newIndices; - var indices = this._indices; + for (var i = 0; i < newIndices.length; i++) { + newIndices[i] = i; + } + } - if (indices) { - var Ctor = indices.constructor; - var thisCount = this._count; // `new Array(a, b, c)` is different from `new Uint32Array(a, b, c)`. + return newIndices; + }; + /** + * Data filter. + */ - if (Ctor === Array) { - newIndices = new Ctor(thisCount); - for (var i = 0; i < thisCount; i++) { - newIndices[i] = indices[i]; - } - } else { - newIndices = new Ctor(indices.buffer, 0, thisCount); - } - } else { - var Ctor = getIndicesCtor(this._rawCount); - newIndices = new Ctor(this.count()); + DataStore.prototype.filter = function (dims, cb) { + if (!this._count) { + return this; + } - for (var i = 0; i < newIndices.length; i++) { - newIndices[i] = i; - } - } + var newStore = this.clone(); + var count = newStore.count(); + var Ctor = getIndicesCtor(newStore._rawCount); + var newIndices = new Ctor(count); + var value = []; + var dimSize = dims.length; + var offset = 0; + var dim0 = dims[0]; + var chunks = newStore._chunks; - return newIndices; - }; - /** - * Data filter. - */ + for (var i = 0; i < count; i++) { + var keep = void 0; + var rawIdx = newStore.getRawIndex(i); // Simple optimization + if (dimSize === 0) { + keep = cb(i); + } else if (dimSize === 1) { + var val = chunks[dim0][rawIdx]; + keep = cb(val, i); + } else { + var k = 0; - DataStore.prototype.filter = function (dims, cb) { - if (!this._count) { - return this; - } + for (; k < dimSize; k++) { + value[k] = chunks[dims[k]][rawIdx]; + } - var newStore = this.clone(); - var count = newStore.count(); - var Ctor = getIndicesCtor(newStore._rawCount); - var newIndices = new Ctor(count); - var value = []; - var dimSize = dims.length; - var offset = 0; - var dim0 = dims[0]; - var chunks = newStore._chunks; - - for (var i = 0; i < count; i++) { - var keep = void 0; - var rawIdx = newStore.getRawIndex(i); // Simple optimization - - if (dimSize === 0) { - keep = cb(i); - } else if (dimSize === 1) { - var val = chunks[dim0][rawIdx]; - keep = cb(val, i); - } else { - var k = 0; + value[k] = i; + keep = cb.apply(null, value); + } - for (; k < dimSize; k++) { - value[k] = chunks[dims[k]][rawIdx]; - } + if (keep) { + newIndices[offset++] = rawIdx; + } + } // Set indices after filtered. - value[k] = i; - keep = cb.apply(null, value); - } - if (keep) { - newIndices[offset++] = rawIdx; - } - } // Set indices after filtered. + if (offset < count) { + newStore._indices = newIndices; + } + newStore._count = offset; // Reset data extent - if (offset < count) { - newStore._indices = newIndices; - } + newStore._extent = []; - newStore._count = offset; // Reset data extent + newStore._updateGetRawIdx(); - newStore._extent = []; + return newStore; + }; + /** + * Select data in range. (For optimization of filter) + * (Manually inline code, support 5 million data filtering in data zoom.) + */ - newStore._updateGetRawIdx(); - return newStore; - }; - /** - * Select data in range. (For optimization of filter) - * (Manually inline code, support 5 million data filtering in data zoom.) - */ + DataStore.prototype.selectRange = function (range) { + var newStore = this.clone(); + var len = newStore._count; + if (!len) { + return this; + } - DataStore.prototype.selectRange = function (range) { - var newStore = this.clone(); - var len = newStore._count; + var dims = keys(range); + var dimSize = dims.length; - if (!len) { - return this; - } + if (!dimSize) { + return this; + } - var dims = keys(range); - var dimSize = dims.length; + var originalCount = newStore.count(); + var Ctor = getIndicesCtor(newStore._rawCount); + var newIndices = new Ctor(originalCount); + var offset = 0; + var dim0 = dims[0]; + var min = range[dim0][0]; + var max = range[dim0][1]; + var storeArr = newStore._chunks; + var quickFinished = false; - if (!dimSize) { - return this; - } + if (!newStore._indices) { + // Extreme optimization for common case. About 2x faster in chrome. + var idx = 0; - var originalCount = newStore.count(); - var Ctor = getIndicesCtor(newStore._rawCount); - var newIndices = new Ctor(originalCount); - var offset = 0; - var dim0 = dims[0]; - var min = range[dim0][0]; - var max = range[dim0][1]; - var storeArr = newStore._chunks; - var quickFinished = false; - - if (!newStore._indices) { - // Extreme optimization for common case. About 2x faster in chrome. - var idx = 0; - - if (dimSize === 1) { - var dimStorage = storeArr[dims[0]]; - - for (var i = 0; i < len; i++) { - var val = dimStorage[i]; // NaN will not be filtered. Consider the case, in line chart, empty - // value indicates the line should be broken. But for the case like - // scatter plot, a data item with empty value will not be rendered, - // but the axis extent may be effected if some other dim of the data - // item has value. Fortunately it is not a significant negative effect. - - if (val >= min && val <= max || isNaN(val)) { - newIndices[offset++] = idx; - } + if (dimSize === 1) { + var dimStorage = storeArr[dims[0]]; - idx++; - } + for (var i = 0; i < len; i++) { + var val = dimStorage[i]; // NaN will not be filtered. Consider the case, in line chart, empty + // value indicates the line should be broken. But for the case like + // scatter plot, a data item with empty value will not be rendered, + // but the axis extent may be effected if some other dim of the data + // item has value. Fortunately it is not a significant negative effect. - quickFinished = true; - } else if (dimSize === 2) { - var dimStorage = storeArr[dims[0]]; - var dimStorage2 = storeArr[dims[1]]; - var min2 = range[dims[1]][0]; - var max2 = range[dims[1]][1]; + if (val >= min && val <= max || isNaN(val)) { + newIndices[offset++] = idx; + } - for (var i = 0; i < len; i++) { - var val = dimStorage[i]; - var val2 = dimStorage2[i]; // Do not filter NaN, see comment above. + idx++; + } - if ((val >= min && val <= max || isNaN(val)) && (val2 >= min2 && val2 <= max2 || isNaN(val2))) { - newIndices[offset++] = idx; - } + quickFinished = true; + } else if (dimSize === 2) { + var dimStorage = storeArr[dims[0]]; + var dimStorage2 = storeArr[dims[1]]; + var min2 = range[dims[1]][0]; + var max2 = range[dims[1]][1]; - idx++; - } + for (var i = 0; i < len; i++) { + var val = dimStorage[i]; + var val2 = dimStorage2[i]; // Do not filter NaN, see comment above. - quickFinished = true; - } + if ((val >= min && val <= max || isNaN(val)) && (val2 >= min2 && val2 <= max2 || isNaN(val2))) { + newIndices[offset++] = idx; + } + + idx++; + } + + quickFinished = true; + } + } + + if (!quickFinished) { + if (dimSize === 1) { + for (var i = 0; i < originalCount; i++) { + var rawIndex = newStore.getRawIndex(i); + var val = storeArr[dims[0]][rawIndex]; // Do not filter NaN, see comment above. + + if (val >= min && val <= max || isNaN(val)) { + newIndices[offset++] = rawIndex; + } + } + } else { + for (var i = 0; i < originalCount; i++) { + var keep = true; + var rawIndex = newStore.getRawIndex(i); + + for (var k = 0; k < dimSize; k++) { + var dimk = dims[k]; + var val = storeArr[dimk][rawIndex]; // Do not filter NaN, see comment above. + + if (val < range[dimk][0] || val > range[dimk][1]) { + keep = false; } + } - if (!quickFinished) { - if (dimSize === 1) { - for (var i = 0; i < originalCount; i++) { - var rawIndex = newStore.getRawIndex(i); - var val = storeArr[dims[0]][rawIndex]; // Do not filter NaN, see comment above. + if (keep) { + newIndices[offset++] = newStore.getRawIndex(i); + } + } + } + } // Set indices after filtered. - if (val >= min && val <= max || isNaN(val)) { - newIndices[offset++] = rawIndex; - } - } - } else { - for (var i = 0; i < originalCount; i++) { - var keep = true; - var rawIndex = newStore.getRawIndex(i); - for (var k = 0; k < dimSize; k++) { - var dimk = dims[k]; - var val = storeArr[dimk][rawIndex]; // Do not filter NaN, see comment above. + if (offset < originalCount) { + newStore._indices = newIndices; + } - if (val < range[dimk][0] || val > range[dimk][1]) { - keep = false; - } - } + newStore._count = offset; // Reset data extent - if (keep) { - newIndices[offset++] = newStore.getRawIndex(i); - } - } - } - } // Set indices after filtered. + newStore._extent = []; + newStore._updateGetRawIdx(); - if (offset < originalCount) { - newStore._indices = newIndices; - } + return newStore; + }; // /** + // * Data mapping to a plain array + // */ + // mapArray(dims: DimensionIndex[], cb: MapArrayCb): any[] { + // const result: any[] = []; + // this.each(dims, function () { + // result.push(cb && (cb as MapArrayCb).apply(null, arguments)); + // }); + // return result; + // } - newStore._count = offset; // Reset data extent + /** + * Data mapping to a new List with given dimensions + */ - newStore._extent = []; - newStore._updateGetRawIdx(); + DataStore.prototype.map = function (dims, cb) { + // TODO only clone picked chunks. + var target = this.clone(dims); - return newStore; - }; // /** - // * Data mapping to a plain array - // */ - // mapArray(dims: DimensionIndex[], cb: MapArrayCb): any[] { - // const result: any[] = []; - // this.each(dims, function () { - // result.push(cb && (cb as MapArrayCb).apply(null, arguments)); - // }); - // return result; - // } + this._updateDims(target, dims, cb); - /** - * Data mapping to a new List with given dimensions - */ + return target; + }; + /** + * @caution Danger!! Only used in dataStack. + */ - DataStore.prototype.map = function (dims, cb) { - // TODO only clone picked chunks. - var target = this.clone(dims); + DataStore.prototype.modify = function (dims, cb) { + this._updateDims(this, dims, cb); + }; - this._updateDims(target, dims, cb); + DataStore.prototype._updateDims = function (target, dims, cb) { + var targetChunks = target._chunks; + var tmpRetValue = []; + var dimSize = dims.length; + var dataCount = target.count(); + var values = []; + var rawExtent = target._rawExtent; - return target; - }; - /** - * @caution Danger!! Only used in dataStack. - */ + for (var i = 0; i < dims.length; i++) { + rawExtent[dims[i]] = getInitialExtent(); + } + for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) { + var rawIndex = target.getRawIndex(dataIndex); - DataStore.prototype.modify = function (dims, cb) { - this._updateDims(this, dims, cb); - }; + for (var k = 0; k < dimSize; k++) { + values[k] = targetChunks[dims[k]][rawIndex]; + } - DataStore.prototype._updateDims = function (target, dims, cb) { - var targetChunks = target._chunks; - var tmpRetValue = []; - var dimSize = dims.length; - var dataCount = target.count(); - var values = []; - var rawExtent = target._rawExtent; + values[dimSize] = dataIndex; + var retValue = cb && cb.apply(null, values); - for (var i = 0; i < dims.length; i++) { - rawExtent[dims[i]] = getInitialExtent(); - } + if (retValue != null) { + // a number or string (in oridinal dimension)? + if (typeof retValue !== 'object') { + tmpRetValue[0] = retValue; + retValue = tmpRetValue; + } - for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) { - var rawIndex = target.getRawIndex(dataIndex); + for (var i = 0; i < retValue.length; i++) { + var dim = dims[i]; + var val = retValue[i]; + var rawExtentOnDim = rawExtent[dim]; + var dimStore = targetChunks[dim]; - for (var k = 0; k < dimSize; k++) { - values[k] = targetChunks[dims[k]][rawIndex]; - } + if (dimStore) { + dimStore[rawIndex] = val; + } - values[dimSize] = dataIndex; - var retValue = cb && cb.apply(null, values); + if (val < rawExtentOnDim[0]) { + rawExtentOnDim[0] = val; + } - if (retValue != null) { - // a number or string (in oridinal dimension)? - if (typeof retValue !== 'object') { - tmpRetValue[0] = retValue; - retValue = tmpRetValue; - } + if (val > rawExtentOnDim[1]) { + rawExtentOnDim[1] = val; + } + } + } + } + }; + /** + * Large data down sampling using largest-triangle-three-buckets + * @param {string} valueDimension + * @param {number} targetCount + */ - for (var i = 0; i < retValue.length; i++) { - var dim = dims[i]; - var val = retValue[i]; - var rawExtentOnDim = rawExtent[dim]; - var dimStore = targetChunks[dim]; - if (dimStore) { - dimStore[rawIndex] = val; - } + DataStore.prototype.lttbDownSample = function (valueDimension, rate) { + var target = this.clone([valueDimension], true); + var targetStorage = target._chunks; + var dimStore = targetStorage[valueDimension]; + var len = this.count(); + var sampledIndex = 0; + var frameSize = Math.floor(1 / rate); + var currentRawIndex = this.getRawIndex(0); + var maxArea; + var area; + var nextRawIndex; + var newIndices = new (getIndicesCtor(this._rawCount))(Math.min((Math.ceil(len / frameSize) + 2) * 2, len)); // First frame use the first data. - if (val < rawExtentOnDim[0]) { - rawExtentOnDim[0] = val; - } + newIndices[sampledIndex++] = currentRawIndex; - if (val > rawExtentOnDim[1]) { - rawExtentOnDim[1] = val; - } - } - } - } - }; - /** - * Large data down sampling using largest-triangle-three-buckets - * @param {string} valueDimension - * @param {number} targetCount - */ + for (var i = 1; i < len - 1; i += frameSize) { + var nextFrameStart = Math.min(i + frameSize, len - 1); + var nextFrameEnd = Math.min(i + frameSize * 2, len); + var avgX = (nextFrameEnd + nextFrameStart) / 2; + var avgY = 0; + for (var idx = nextFrameStart; idx < nextFrameEnd; idx++) { + var rawIndex = this.getRawIndex(idx); + var y = dimStore[rawIndex]; - DataStore.prototype.lttbDownSample = function (valueDimension, rate) { - var target = this.clone([valueDimension], true); - var targetStorage = target._chunks; - var dimStore = targetStorage[valueDimension]; - var len = this.count(); - var sampledIndex = 0; - var frameSize = Math.floor(1 / rate); - var currentRawIndex = this.getRawIndex(0); - var maxArea; - var area; - var nextRawIndex; - var newIndices = new (getIndicesCtor(this._rawCount))(Math.min((Math.ceil(len / frameSize) + 2) * 2, len)); // First frame use the first data. - - newIndices[sampledIndex++] = currentRawIndex; - - for (var i = 1; i < len - 1; i += frameSize) { - var nextFrameStart = Math.min(i + frameSize, len - 1); - var nextFrameEnd = Math.min(i + frameSize * 2, len); - var avgX = (nextFrameEnd + nextFrameStart) / 2; - var avgY = 0; - - for (var idx = nextFrameStart; idx < nextFrameEnd; idx++) { - var rawIndex = this.getRawIndex(idx); - var y = dimStore[rawIndex]; - - if (isNaN(y)) { - continue; - } + if (isNaN(y)) { + continue; + } - avgY += y; - } + avgY += y; + } - avgY /= nextFrameEnd - nextFrameStart; - var frameStart = i; - var frameEnd = Math.min(i + frameSize, len); - var pointAX = i - 1; - var pointAY = dimStore[currentRawIndex]; - maxArea = -1; - nextRawIndex = frameStart; - var firstNaNIndex = -1; - var countNaN = 0; // Find a point from current frame that construct a triangel with largest area with previous selected point - // And the average of next frame. - - for (var idx = frameStart; idx < frameEnd; idx++) { - var rawIndex = this.getRawIndex(idx); - var y = dimStore[rawIndex]; - - if (isNaN(y)) { - countNaN++; - - if (firstNaNIndex < 0) { - firstNaNIndex = rawIndex; - } + avgY /= nextFrameEnd - nextFrameStart; + var frameStart = i; + var frameEnd = Math.min(i + frameSize, len); + var pointAX = i - 1; + var pointAY = dimStore[currentRawIndex]; + maxArea = -1; + nextRawIndex = frameStart; + var firstNaNIndex = -1; + var countNaN = 0; // Find a point from current frame that construct a triangel with largest area with previous selected point + // And the average of next frame. - continue; - } // Calculate triangle area over three buckets + for (var idx = frameStart; idx < frameEnd; idx++) { + var rawIndex = this.getRawIndex(idx); + var y = dimStore[rawIndex]; + if (isNaN(y)) { + countNaN++; - area = Math.abs((pointAX - avgX) * (y - pointAY) - (pointAX - idx) * (avgY - pointAY)); + if (firstNaNIndex < 0) { + firstNaNIndex = rawIndex; + } - if (area > maxArea) { - maxArea = area; - nextRawIndex = rawIndex; // Next a is this b - } - } + continue; + } // Calculate triangle area over three buckets - if (countNaN > 0 && countNaN < frameEnd - frameStart) { - // Append first NaN point in every bucket. - // It is necessary to ensure the correct order of indices. - newIndices[sampledIndex++] = Math.min(firstNaNIndex, nextRawIndex); - nextRawIndex = Math.max(firstNaNIndex, nextRawIndex); - } - newIndices[sampledIndex++] = nextRawIndex; - currentRawIndex = nextRawIndex; // This a is the next a (chosen b) - } // First frame use the last data. + area = Math.abs((pointAX - avgX) * (y - pointAY) - (pointAX - idx) * (avgY - pointAY)); + if (area > maxArea) { + maxArea = area; + nextRawIndex = rawIndex; // Next a is this b + } + } - newIndices[sampledIndex++] = this.getRawIndex(len - 1); - target._count = sampledIndex; - target._indices = newIndices; - target.getRawIndex = this._getRawIdx; - return target; - }; - /** - * Large data down sampling on given dimension - * @param sampleIndex Sample index for name and id - */ + if (countNaN > 0 && countNaN < frameEnd - frameStart) { + // Append first NaN point in every bucket. + // It is necessary to ensure the correct order of indices. + newIndices[sampledIndex++] = Math.min(firstNaNIndex, nextRawIndex); + nextRawIndex = Math.max(firstNaNIndex, nextRawIndex); + } + newIndices[sampledIndex++] = nextRawIndex; + currentRawIndex = nextRawIndex; // This a is the next a (chosen b) + } // First frame use the last data. - DataStore.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) { - var target = this.clone([dimension], true); - var targetStorage = target._chunks; - var frameValues = []; - var frameSize = Math.floor(1 / rate); - var dimStore = targetStorage[dimension]; - var len = this.count(); - var rawExtentOnDim = target._rawExtent[dimension] = getInitialExtent(); - var newIndices = new (getIndicesCtor(this._rawCount))(Math.ceil(len / frameSize)); - var offset = 0; - - for (var i = 0; i < len; i += frameSize) { - // Last frame - if (frameSize > len - i) { - frameSize = len - i; - frameValues.length = frameSize; - } - for (var k = 0; k < frameSize; k++) { - var dataIdx = this.getRawIndex(i + k); - frameValues[k] = dimStore[dataIdx]; - } + newIndices[sampledIndex++] = this.getRawIndex(len - 1); + target._count = sampledIndex; + target._indices = newIndices; + target.getRawIndex = this._getRawIdx; + return target; + }; + /** + * Large data down sampling on given dimension + * @param sampleIndex Sample index for name and id + */ - var value = sampleValue(frameValues); - var sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len - 1)); // Only write value on the filtered data - dimStore[sampleFrameIdx] = value; + DataStore.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) { + var target = this.clone([dimension], true); + var targetStorage = target._chunks; + var frameValues = []; + var frameSize = Math.floor(1 / rate); + var dimStore = targetStorage[dimension]; + var len = this.count(); + var rawExtentOnDim = target._rawExtent[dimension] = getInitialExtent(); + var newIndices = new (getIndicesCtor(this._rawCount))(Math.ceil(len / frameSize)); + var offset = 0; - if (value < rawExtentOnDim[0]) { - rawExtentOnDim[0] = value; - } + for (var i = 0; i < len; i += frameSize) { + // Last frame + if (frameSize > len - i) { + frameSize = len - i; + frameValues.length = frameSize; + } - if (value > rawExtentOnDim[1]) { - rawExtentOnDim[1] = value; - } + for (var k = 0; k < frameSize; k++) { + var dataIdx = this.getRawIndex(i + k); + frameValues[k] = dimStore[dataIdx]; + } - newIndices[offset++] = sampleFrameIdx; - } + var value = sampleValue(frameValues); + var sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len - 1)); // Only write value on the filtered data - target._count = offset; - target._indices = newIndices; + dimStore[sampleFrameIdx] = value; - target._updateGetRawIdx(); + if (value < rawExtentOnDim[0]) { + rawExtentOnDim[0] = value; + } - return target; - }; - /** - * Data iteration - * @param ctx default this - * @example - * list.each('x', function (x, idx) {}); - * list.each(['x', 'y'], function (x, y, idx) {}); - * list.each(function (idx) {}) - */ + if (value > rawExtentOnDim[1]) { + rawExtentOnDim[1] = value; + } + newIndices[offset++] = sampleFrameIdx; + } - DataStore.prototype.each = function (dims, cb) { - if (!this._count) { - return; - } + target._count = offset; + target._indices = newIndices; - var dimSize = dims.length; - var chunks = this._chunks; + target._updateGetRawIdx(); - for (var i = 0, len = this.count(); i < len; i++) { - var rawIdx = this.getRawIndex(i); // Simple optimization + return target; + }; + /** + * Data iteration + * @param ctx default this + * @example + * list.each('x', function (x, idx) {}); + * list.each(['x', 'y'], function (x, y, idx) {}); + * list.each(function (idx) {}) + */ - switch (dimSize) { - case 0: - cb(i); - break; - case 1: - cb(chunks[dims[0]][rawIdx], i); - break; + DataStore.prototype.each = function (dims, cb) { + if (!this._count) { + return; + } - case 2: - cb(chunks[dims[0]][rawIdx], chunks[dims[1]][rawIdx], i); - break; + var dimSize = dims.length; + var chunks = this._chunks; - default: - var k = 0; - var value = []; + for (var i = 0, len = this.count(); i < len; i++) { + var rawIdx = this.getRawIndex(i); // Simple optimization - for (; k < dimSize; k++) { - value[k] = chunks[dims[k]][rawIdx]; - } // Index + switch (dimSize) { + case 0: + cb(i); + break; + case 1: + cb(chunks[dims[0]][rawIdx], i); + break; - value[k] = i; - cb.apply(null, value); - } - } - }; - /** - * Get extent of data in one dimension - */ + case 2: + cb(chunks[dims[0]][rawIdx], chunks[dims[1]][rawIdx], i); + break; + default: + var k = 0; + var value = []; - DataStore.prototype.getDataExtent = function (dim) { - // Make sure use concrete dim as cache name. - var dimData = this._chunks[dim]; - var initialExtent = getInitialExtent(); + for (; k < dimSize; k++) { + value[k] = chunks[dims[k]][rawIdx]; + } // Index - if (!dimData) { - return initialExtent; - } // Make more strict checkings to ensure hitting cache. + value[k] = i; + cb.apply(null, value); + } + } + }; + /** + * Get extent of data in one dimension + */ - var currEnd = this.count(); // Consider the most cases when using data zoom, `getDataExtent` - // happened before filtering. We cache raw extent, which is not - // necessary to be cleared and recalculated when restore data. - var useRaw = !this._indices; - var dimExtent; + DataStore.prototype.getDataExtent = function (dim) { + // Make sure use concrete dim as cache name. + var dimData = this._chunks[dim]; + var initialExtent = getInitialExtent(); - if (useRaw) { - return this._rawExtent[dim].slice(); - } + if (!dimData) { + return initialExtent; + } // Make more strict checkings to ensure hitting cache. - dimExtent = this._extent[dim]; - if (dimExtent) { - return dimExtent.slice(); - } + var currEnd = this.count(); // Consider the most cases when using data zoom, `getDataExtent` + // happened before filtering. We cache raw extent, which is not + // necessary to be cleared and recalculated when restore data. - dimExtent = initialExtent; - var min = dimExtent[0]; - var max = dimExtent[1]; + var useRaw = !this._indices; + var dimExtent; - for (var i = 0; i < currEnd; i++) { - var rawIdx = this.getRawIndex(i); - var value = dimData[rawIdx]; - value < min && (min = value); - value > max && (max = value); - } + if (useRaw) { + return this._rawExtent[dim].slice(); + } - dimExtent = [min, max]; - this._extent[dim] = dimExtent; - return dimExtent; - }; - /** - * Get raw data item - */ + dimExtent = this._extent[dim]; + if (dimExtent) { + return dimExtent.slice(); + } - DataStore.prototype.getRawDataItem = function (idx) { - var rawIdx = this.getRawIndex(idx); + dimExtent = initialExtent; + var min = dimExtent[0]; + var max = dimExtent[1]; - if (!this._provider.persistent) { - var val = []; - var chunks = this._chunks; + for (var i = 0; i < currEnd; i++) { + var rawIdx = this.getRawIndex(i); + var value = dimData[rawIdx]; + value < min && (min = value); + value > max && (max = value); + } - for (var i = 0; i < chunks.length; i++) { - val.push(chunks[i][rawIdx]); - } + dimExtent = [min, max]; + this._extent[dim] = dimExtent; + return dimExtent; + }; + /** + * Get raw data item + */ - return val; - } else { - return this._provider.getItem(rawIdx); - } - }; - /** - * Clone shallow. - * - * @param clonedDims Determine which dims to clone. Will share the data if not specified. - */ + DataStore.prototype.getRawDataItem = function (idx) { + var rawIdx = this.getRawIndex(idx); - DataStore.prototype.clone = function (clonedDims, ignoreIndices) { - var target = new DataStore(); - var chunks = this._chunks; - var clonedDimsMap = clonedDims && reduce(clonedDims, function (obj, dimIdx) { - obj[dimIdx] = true; - return obj; - }, {}); + if (!this._provider.persistent) { + var val = []; + var chunks = this._chunks; - if (clonedDimsMap) { - for (var i = 0; i < chunks.length; i++) { - // Not clone if dim is not picked. - target._chunks[i] = !clonedDimsMap[i] ? chunks[i] : cloneChunk(chunks[i]); - } - } else { - target._chunks = chunks; - } + for (var i = 0; i < chunks.length; i++) { + val.push(chunks[i][rawIdx]); + } - this._copyCommonProps(target); + return val; + } else { + return this._provider.getItem(rawIdx); + } + }; + /** + * Clone shallow. + * + * @param clonedDims Determine which dims to clone. Will share the data if not specified. + */ - if (!ignoreIndices) { - target._indices = this._cloneIndices(); - } - target._updateGetRawIdx(); + DataStore.prototype.clone = function (clonedDims, ignoreIndices) { + var target = new DataStore(); + var chunks = this._chunks; + var clonedDimsMap = clonedDims && reduce(clonedDims, function (obj, dimIdx) { + obj[dimIdx] = true; + return obj; + }, {}); - return target; - }; + if (clonedDimsMap) { + for (var i = 0; i < chunks.length; i++) { + // Not clone if dim is not picked. + target._chunks[i] = !clonedDimsMap[i] ? chunks[i] : cloneChunk(chunks[i]); + } + } else { + target._chunks = chunks; + } - DataStore.prototype._copyCommonProps = function (target) { - target._count = this._count; - target._rawCount = this._rawCount; - target._provider = this._provider; - target._dimensions = this._dimensions; - target._extent = clone(this._extent); - target._rawExtent = clone(this._rawExtent); - }; + this._copyCommonProps(target); - DataStore.prototype._cloneIndices = function () { - if (this._indices) { - var Ctor = this._indices.constructor; - var indices = void 0; + if (!ignoreIndices) { + target._indices = this._cloneIndices(); + } - if (Ctor === Array) { - var thisCount = this._indices.length; - indices = new Ctor(thisCount); + target._updateGetRawIdx(); - for (var i = 0; i < thisCount; i++) { - indices[i] = this._indices[i]; - } - } else { - indices = new Ctor(this._indices); - } + return target; + }; - return indices; - } + DataStore.prototype._copyCommonProps = function (target) { + target._count = this._count; + target._rawCount = this._rawCount; + target._provider = this._provider; + target._dimensions = this._dimensions; + target._extent = clone(this._extent); + target._rawExtent = clone(this._rawExtent); + }; - return null; - }; + DataStore.prototype._cloneIndices = function () { + if (this._indices) { + var Ctor = this._indices.constructor; + var indices = void 0; - DataStore.prototype._getRawIdxIdentity = function (idx) { - return idx; - }; + if (Ctor === Array) { + var thisCount = this._indices.length; + indices = new Ctor(thisCount); - DataStore.prototype._getRawIdx = function (idx) { - if (idx < this._count && idx >= 0) { - return this._indices[idx]; - } + for (var i = 0; i < thisCount; i++) { + indices[i] = this._indices[i]; + } + } else { + indices = new Ctor(this._indices); + } - return -1; - }; + return indices; + } - DataStore.prototype._updateGetRawIdx = function () { - this.getRawIndex = this._indices ? this._getRawIdx : this._getRawIdxIdentity; - }; + return null; + }; - DataStore.internalField = function () { - function getDimValueSimply(dataItem, property, dataIndex, dimIndex) { - return parseDataValue(dataItem[dimIndex], this._dimensions[dimIndex]); - } + DataStore.prototype._getRawIdxIdentity = function (idx) { + return idx; + }; - defaultDimValueGetters = { - arrayRows: getDimValueSimply, - objectRows: function (dataItem, property, dataIndex, dimIndex) { - return parseDataValue(dataItem[property], this._dimensions[dimIndex]); - }, - keyedColumns: getDimValueSimply, - original: function (dataItem, property, dataIndex, dimIndex) { - // Performance sensitive, do not use modelUtil.getDataItemValue. - // If dataItem is an plain object with no value field, the let `value` - // will be assigned with the object, but it will be tread correctly - // in the `convertValue`. - var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value); - return parseDataValue(value instanceof Array ? value[dimIndex] // If value is a single number or something else not array. - : value, this._dimensions[dimIndex]); - }, - typedArray: function (dataItem, property, dataIndex, dimIndex) { - return dataItem[dimIndex]; - } - }; - }(); + DataStore.prototype._getRawIdx = function (idx) { + if (idx < this._count && idx >= 0) { + return this._indices[idx]; + } - return DataStore; - }(); + return -1; + }; + + DataStore.prototype._updateGetRawIdx = function () { + this.getRawIndex = this._indices ? this._getRawIdx : this._getRawIdxIdentity; + }; + + DataStore.internalField = function () { + function getDimValueSimply(dataItem, property, dataIndex, dimIndex) { + return parseDataValue(dataItem[dimIndex], this._dimensions[dimIndex]); + } + + defaultDimValueGetters = { + arrayRows: getDimValueSimply, + objectRows: function (dataItem, property, dataIndex, dimIndex) { + return parseDataValue(dataItem[property], this._dimensions[dimIndex]); + }, + keyedColumns: getDimValueSimply, + original: function (dataItem, property, dataIndex, dimIndex) { + // Performance sensitive, do not use modelUtil.getDataItemValue. + // If dataItem is an plain object with no value field, the let `value` + // will be assigned with the object, but it will be tread correctly + // in the `convertValue`. + var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value); + return parseDataValue(value instanceof Array ? value[dimIndex] // If value is a single number or something else not array. + : value, this._dimensions[dimIndex]); + }, + typedArray: function (dataItem, property, dataIndex, dimIndex) { + return dataItem[dimIndex]; + } + }; + }(); + + return DataStore; + }(); /** * [REQUIREMENT_MEMO]: @@ -23224,370 +23224,370 @@ */ var SourceManager = - /** @class */ - function () { - function SourceManager(sourceHost) { - // Cached source. Do not repeat calculating if not dirty. - this._sourceList = []; - this._storeList = []; // version sign of each upstream source manager. + /** @class */ + function () { + function SourceManager(sourceHost) { + // Cached source. Do not repeat calculating if not dirty. + this._sourceList = []; + this._storeList = []; // version sign of each upstream source manager. + + this._upstreamSignList = []; + this._versionSignBase = 0; + this._dirty = true; + this._sourceHost = sourceHost; + } + /** + * Mark dirty. + */ - this._upstreamSignList = []; - this._versionSignBase = 0; - this._dirty = true; - this._sourceHost = sourceHost; - } - /** - * Mark dirty. - */ + SourceManager.prototype.dirty = function () { + this._setLocalSource([], []); - SourceManager.prototype.dirty = function () { - this._setLocalSource([], []); + this._storeList = []; + this._dirty = true; + }; - this._storeList = []; - this._dirty = true; - }; + SourceManager.prototype._setLocalSource = function (sourceList, upstreamSignList) { + this._sourceList = sourceList; + this._upstreamSignList = upstreamSignList; + this._versionSignBase++; - SourceManager.prototype._setLocalSource = function (sourceList, upstreamSignList) { - this._sourceList = sourceList; - this._upstreamSignList = upstreamSignList; - this._versionSignBase++; + if (this._versionSignBase > 9e10) { + this._versionSignBase = 0; + } + }; + /** + * For detecting whether the upstream source is dirty, so that + * the local cached source (in `_sourceList`) should be discarded. + */ - if (this._versionSignBase > 9e10) { - this._versionSignBase = 0; - } - }; - /** - * For detecting whether the upstream source is dirty, so that - * the local cached source (in `_sourceList`) should be discarded. - */ + SourceManager.prototype._getVersionSign = function () { + return this._sourceHost.uid + '_' + this._versionSignBase; + }; + /** + * Always return a source instance. Otherwise throw error. + */ - SourceManager.prototype._getVersionSign = function () { - return this._sourceHost.uid + '_' + this._versionSignBase; - }; - /** - * Always return a source instance. Otherwise throw error. - */ + SourceManager.prototype.prepareSource = function () { + // For the case that call `setOption` multiple time but no data changed, + // cache the result source to prevent from repeating transform. + if (this._isDirty()) { + this._createSource(); - SourceManager.prototype.prepareSource = function () { - // For the case that call `setOption` multiple time but no data changed, - // cache the result source to prevent from repeating transform. - if (this._isDirty()) { - this._createSource(); + this._dirty = false; + } + }; - this._dirty = false; - } - }; + SourceManager.prototype._createSource = function () { + this._setLocalSource([], []); - SourceManager.prototype._createSource = function () { - this._setLocalSource([], []); + var sourceHost = this._sourceHost; - var sourceHost = this._sourceHost; + var upSourceMgrList = this._getUpstreamSourceManagers(); - var upSourceMgrList = this._getUpstreamSourceManagers(); + var hasUpstream = !!upSourceMgrList.length; + var resultSourceList; + var upstreamSignList; - var hasUpstream = !!upSourceMgrList.length; - var resultSourceList; - var upstreamSignList; + if (isSeries(sourceHost)) { + var seriesModel = sourceHost; + var data = void 0; + var sourceFormat = void 0; + var upSource = void 0; // Has upstream dataset - if (isSeries(sourceHost)) { - var seriesModel = sourceHost; - var data = void 0; - var sourceFormat = void 0; - var upSource = void 0; // Has upstream dataset + if (hasUpstream) { + var upSourceMgr = upSourceMgrList[0]; + upSourceMgr.prepareSource(); + upSource = upSourceMgr.getSource(); + data = upSource.data; + sourceFormat = upSource.sourceFormat; + upstreamSignList = [upSourceMgr._getVersionSign()]; + } // Series data is from own. + else { + data = seriesModel.get('data', true); + sourceFormat = isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL; + upstreamSignList = []; + } // See [REQUIREMENT_MEMO], merge settings on series and parent dataset if it is root. - if (hasUpstream) { - var upSourceMgr = upSourceMgrList[0]; - upSourceMgr.prepareSource(); - upSource = upSourceMgr.getSource(); - data = upSource.data; - sourceFormat = upSource.sourceFormat; - upstreamSignList = [upSourceMgr._getVersionSign()]; - } // Series data is from own. - else { - data = seriesModel.get('data', true); - sourceFormat = isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL; - upstreamSignList = []; - } // See [REQUIREMENT_MEMO], merge settings on series and parent dataset if it is root. - - - var newMetaRawOption = this._getSourceMetaRawOption() || {}; - var upMetaRawOption = upSource && upSource.metaRawOption || {}; - var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, upMetaRawOption.seriesLayoutBy) || null; - var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upMetaRawOption.sourceHeader); // Note here we should not use `upSource.dimensionsDefine`. Consider the case: - // `upSource.dimensionsDefine` is detected by `seriesLayoutBy: 'column'`, - // but series need `seriesLayoutBy: 'row'`. - - var dimensions = retrieve2(newMetaRawOption.dimensions, upMetaRawOption.dimensions); // We share source with dataset as much as possible - // to avoid extra memroy cost of high dimensional data. - - var needsCreateSource = seriesLayoutBy !== upMetaRawOption.seriesLayoutBy || !!sourceHeader !== !!upMetaRawOption.sourceHeader || dimensions; - resultSourceList = needsCreateSource ? [createSource(data, { - seriesLayoutBy: seriesLayoutBy, - sourceHeader: sourceHeader, - dimensions: dimensions - }, sourceFormat)] : []; - } else { - var datasetModel = sourceHost; // Has upstream dataset. - if (hasUpstream) { - var result = this._applyTransform(upSourceMgrList); + var newMetaRawOption = this._getSourceMetaRawOption() || {}; + var upMetaRawOption = upSource && upSource.metaRawOption || {}; + var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, upMetaRawOption.seriesLayoutBy) || null; + var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upMetaRawOption.sourceHeader); // Note here we should not use `upSource.dimensionsDefine`. Consider the case: + // `upSource.dimensionsDefine` is detected by `seriesLayoutBy: 'column'`, + // but series need `seriesLayoutBy: 'row'`. - resultSourceList = result.sourceList; - upstreamSignList = result.upstreamSignList; - } // Is root dataset. - else { - var sourceData = datasetModel.get('source', true); - resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null)]; - upstreamSignList = []; - } - } + var dimensions = retrieve2(newMetaRawOption.dimensions, upMetaRawOption.dimensions); // We share source with dataset as much as possible + // to avoid extra memroy cost of high dimensional data. - if ("development" !== 'production') { - assert(resultSourceList && upstreamSignList); - } + var needsCreateSource = seriesLayoutBy !== upMetaRawOption.seriesLayoutBy || !!sourceHeader !== !!upMetaRawOption.sourceHeader || dimensions; + resultSourceList = needsCreateSource ? [createSource(data, { + seriesLayoutBy: seriesLayoutBy, + sourceHeader: sourceHeader, + dimensions: dimensions + }, sourceFormat)] : []; + } else { + var datasetModel = sourceHost; // Has upstream dataset. - this._setLocalSource(resultSourceList, upstreamSignList); - }; + if (hasUpstream) { + var result = this._applyTransform(upSourceMgrList); - SourceManager.prototype._applyTransform = function (upMgrList) { - var datasetModel = this._sourceHost; - var transformOption = datasetModel.get('transform', true); - var fromTransformResult = datasetModel.get('fromTransformResult', true); + resultSourceList = result.sourceList; + upstreamSignList = result.upstreamSignList; + } // Is root dataset. + else { + var sourceData = datasetModel.get('source', true); + resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null)]; + upstreamSignList = []; + } + } - if ("development" !== 'production') { - assert(fromTransformResult != null || transformOption != null); - } + if ("development" !== 'production') { + assert(resultSourceList && upstreamSignList); + } - if (fromTransformResult != null) { - var errMsg = ''; + this._setLocalSource(resultSourceList, upstreamSignList); + }; - if (upMgrList.length !== 1) { - if ("development" !== 'production') { - errMsg = 'When using `fromTransformResult`, there should be only one upstream dataset'; - } + SourceManager.prototype._applyTransform = function (upMgrList) { + var datasetModel = this._sourceHost; + var transformOption = datasetModel.get('transform', true); + var fromTransformResult = datasetModel.get('fromTransformResult', true); - doThrow(errMsg); - } - } + if ("development" !== 'production') { + assert(fromTransformResult != null || transformOption != null); + } - var sourceList; - var upSourceList = []; - var upstreamSignList = []; - each(upMgrList, function (upMgr) { - upMgr.prepareSource(); - var upSource = upMgr.getSource(fromTransformResult || 0); - var errMsg = ''; + if (fromTransformResult != null) { + var errMsg = ''; - if (fromTransformResult != null && !upSource) { - if ("development" !== 'production') { - errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult; - } + if (upMgrList.length !== 1) { + if ("development" !== 'production') { + errMsg = 'When using `fromTransformResult`, there should be only one upstream dataset'; + } - doThrow(errMsg); - } + doThrow(errMsg); + } + } - upSourceList.push(upSource); - upstreamSignList.push(upMgr._getVersionSign()); - }); + var sourceList; + var upSourceList = []; + var upstreamSignList = []; + each(upMgrList, function (upMgr) { + upMgr.prepareSource(); + var upSource = upMgr.getSource(fromTransformResult || 0); + var errMsg = ''; - if (transformOption) { - sourceList = applyDataTransform(transformOption, upSourceList, { - datasetIndex: datasetModel.componentIndex - }); - } else if (fromTransformResult != null) { - sourceList = [cloneSourceShallow(upSourceList[0])]; - } + if (fromTransformResult != null && !upSource) { + if ("development" !== 'production') { + errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult; + } - return { - sourceList: sourceList, - upstreamSignList: upstreamSignList - }; - }; + doThrow(errMsg); + } - SourceManager.prototype._isDirty = function () { - if (this._dirty) { - return true; - } // All sourceList is from the some upsteam. + upSourceList.push(upSource); + upstreamSignList.push(upMgr._getVersionSign()); + }); + + if (transformOption) { + sourceList = applyDataTransform(transformOption, upSourceList, { + datasetIndex: datasetModel.componentIndex + }); + } else if (fromTransformResult != null) { + sourceList = [cloneSourceShallow(upSourceList[0])]; + } + return { + sourceList: sourceList, + upstreamSignList: upstreamSignList + }; + }; - var upSourceMgrList = this._getUpstreamSourceManagers(); + SourceManager.prototype._isDirty = function () { + if (this._dirty) { + return true; + } // All sourceList is from the some upsteam. - for (var i = 0; i < upSourceMgrList.length; i++) { - var upSrcMgr = upSourceMgrList[i]; - if ( // Consider the case that there is ancestor diry, call it recursively. - // The performance is probably not an issue because usually the chain is not long. - upSrcMgr._isDirty() || this._upstreamSignList[i] !== upSrcMgr._getVersionSign()) { - return true; - } - } - }; - /** - * @param sourceIndex By defualt 0, means "main source". - * Most cases there is only one source. - */ + var upSourceMgrList = this._getUpstreamSourceManagers(); + for (var i = 0; i < upSourceMgrList.length; i++) { + var upSrcMgr = upSourceMgrList[i]; - SourceManager.prototype.getSource = function (sourceIndex) { - sourceIndex = sourceIndex || 0; - var source = this._sourceList[sourceIndex]; + if ( // Consider the case that there is ancestor diry, call it recursively. + // The performance is probably not an issue because usually the chain is not long. + upSrcMgr._isDirty() || this._upstreamSignList[i] !== upSrcMgr._getVersionSign()) { + return true; + } + } + }; + /** + * @param sourceIndex By defualt 0, means "main source". + * Most cases there is only one source. + */ - if (!source) { - // Series may share source instance with dataset. - var upSourceMgrList = this._getUpstreamSourceManagers(); - return upSourceMgrList[0] && upSourceMgrList[0].getSource(sourceIndex); - } + SourceManager.prototype.getSource = function (sourceIndex) { + sourceIndex = sourceIndex || 0; + var source = this._sourceList[sourceIndex]; - return source; - }; - /** - * - * Get a data store which can be shared across series. - * Only available for series. - * - * @param seriesDimRequest Dimensions that are generated in series. - * Should have been sorted by `storeDimIndex` asc. - */ + if (!source) { + // Series may share source instance with dataset. + var upSourceMgrList = this._getUpstreamSourceManagers(); + return upSourceMgrList[0] && upSourceMgrList[0].getSource(sourceIndex); + } - SourceManager.prototype.getSharedDataStore = function (seriesDimRequest) { - if ("development" !== 'production') { - assert(isSeries(this._sourceHost), 'Can only call getDataStore on series source manager.'); - } + return source; + }; + /** + * + * Get a data store which can be shared across series. + * Only available for series. + * + * @param seriesDimRequest Dimensions that are generated in series. + * Should have been sorted by `storeDimIndex` asc. + */ - var schema = seriesDimRequest.makeStoreSchema(); - return this._innerGetDataStore(schema.dimensions, seriesDimRequest.source, schema.hash); - }; - SourceManager.prototype._innerGetDataStore = function (storeDims, seriesSource, sourceReadKey) { - // TODO Can use other sourceIndex? - var sourceIndex = 0; - var storeList = this._storeList; - var cachedStoreMap = storeList[sourceIndex]; + SourceManager.prototype.getSharedDataStore = function (seriesDimRequest) { + if ("development" !== 'production') { + assert(isSeries(this._sourceHost), 'Can only call getDataStore on series source manager.'); + } - if (!cachedStoreMap) { - cachedStoreMap = storeList[sourceIndex] = {}; - } + var schema = seriesDimRequest.makeStoreSchema(); + return this._innerGetDataStore(schema.dimensions, seriesDimRequest.source, schema.hash); + }; - var cachedStore = cachedStoreMap[sourceReadKey]; + SourceManager.prototype._innerGetDataStore = function (storeDims, seriesSource, sourceReadKey) { + // TODO Can use other sourceIndex? + var sourceIndex = 0; + var storeList = this._storeList; + var cachedStoreMap = storeList[sourceIndex]; - if (!cachedStore) { - var upSourceMgr = this._getUpstreamSourceManagers()[0]; + if (!cachedStoreMap) { + cachedStoreMap = storeList[sourceIndex] = {}; + } - if (isSeries(this._sourceHost) && upSourceMgr) { - cachedStore = upSourceMgr._innerGetDataStore(storeDims, seriesSource, sourceReadKey); - } else { - cachedStore = new DataStore(); // Always create store from source of series. + var cachedStore = cachedStoreMap[sourceReadKey]; - cachedStore.initData(new DefaultDataProvider(seriesSource, storeDims.length), storeDims); - } + if (!cachedStore) { + var upSourceMgr = this._getUpstreamSourceManagers()[0]; - cachedStoreMap[sourceReadKey] = cachedStore; - } + if (isSeries(this._sourceHost) && upSourceMgr) { + cachedStore = upSourceMgr._innerGetDataStore(storeDims, seriesSource, sourceReadKey); + } else { + cachedStore = new DataStore(); // Always create store from source of series. - return cachedStore; - }; - /** - * PEDING: Is it fast enough? - * If no upstream, return empty array. - */ + cachedStore.initData(new DefaultDataProvider(seriesSource, storeDims.length), storeDims); + } + cachedStoreMap[sourceReadKey] = cachedStore; + } - SourceManager.prototype._getUpstreamSourceManagers = function () { - // Always get the relationship from the raw option. - // Do not cache the link of the dependency graph, so that - // no need to update them when change happen. - var sourceHost = this._sourceHost; + return cachedStore; + }; + /** + * PEDING: Is it fast enough? + * If no upstream, return empty array. + */ - if (isSeries(sourceHost)) { - var datasetModel = querySeriesUpstreamDatasetModel(sourceHost); - return !datasetModel ? [] : [datasetModel.getSourceManager()]; - } else { - return map(queryDatasetUpstreamDatasetModels(sourceHost), function (datasetModel) { - return datasetModel.getSourceManager(); - }); - } - }; - SourceManager.prototype._getSourceMetaRawOption = function () { - var sourceHost = this._sourceHost; - var seriesLayoutBy; - var sourceHeader; - var dimensions; + SourceManager.prototype._getUpstreamSourceManagers = function () { + // Always get the relationship from the raw option. + // Do not cache the link of the dependency graph, so that + // no need to update them when change happen. + var sourceHost = this._sourceHost; - if (isSeries(sourceHost)) { - seriesLayoutBy = sourceHost.get('seriesLayoutBy', true); - sourceHeader = sourceHost.get('sourceHeader', true); - dimensions = sourceHost.get('dimensions', true); - } // See [REQUIREMENT_MEMO], `non-root-dataset` do not support them. - else if (!this._getUpstreamSourceManagers().length) { - var model = sourceHost; - seriesLayoutBy = model.get('seriesLayoutBy', true); - sourceHeader = model.get('sourceHeader', true); - dimensions = model.get('dimensions', true); - } + if (isSeries(sourceHost)) { + var datasetModel = querySeriesUpstreamDatasetModel(sourceHost); + return !datasetModel ? [] : [datasetModel.getSourceManager()]; + } else { + return map(queryDatasetUpstreamDatasetModels(sourceHost), function (datasetModel) { + return datasetModel.getSourceManager(); + }); + } + }; + + SourceManager.prototype._getSourceMetaRawOption = function () { + var sourceHost = this._sourceHost; + var seriesLayoutBy; + var sourceHeader; + var dimensions; + + if (isSeries(sourceHost)) { + seriesLayoutBy = sourceHost.get('seriesLayoutBy', true); + sourceHeader = sourceHost.get('sourceHeader', true); + dimensions = sourceHost.get('dimensions', true); + } // See [REQUIREMENT_MEMO], `non-root-dataset` do not support them. + else if (!this._getUpstreamSourceManagers().length) { + var model = sourceHost; + seriesLayoutBy = model.get('seriesLayoutBy', true); + sourceHeader = model.get('sourceHeader', true); + dimensions = model.get('dimensions', true); + } - return { - seriesLayoutBy: seriesLayoutBy, - sourceHeader: sourceHeader, - dimensions: dimensions - }; - }; + return { + seriesLayoutBy: seriesLayoutBy, + sourceHeader: sourceHeader, + dimensions: dimensions + }; + }; - return SourceManager; - }(); + return SourceManager; + }(); // disable the transform merge, but do not disable transfrom clone from rawOption. function disableTransformOptionMerge(datasetModel) { - var transformOption = datasetModel.option.transform; - transformOption && setAsPrimitive(datasetModel.option.transform); + var transformOption = datasetModel.option.transform; + transformOption && setAsPrimitive(datasetModel.option.transform); } function isSeries(sourceHost) { - // Avoid circular dependency with Series.ts - return sourceHost.mainType === 'series'; + // Avoid circular dependency with Series.ts + return sourceHost.mainType === 'series'; } function doThrow(errMsg) { - throw new Error(errMsg); + throw new Error(errMsg); } var TOOLTIP_LINE_HEIGHT_CSS = 'line-height:1'; // TODO: more textStyle option function getTooltipTextStyle(textStyle, renderMode) { - var nameFontColor = textStyle.color || '#6e7079'; - var nameFontSize = textStyle.fontSize || 12; - var nameFontWeight = textStyle.fontWeight || '400'; - var valueFontColor = textStyle.color || '#464646'; - var valueFontSize = textStyle.fontSize || 14; - var valueFontWeight = textStyle.fontWeight || '900'; - - if (renderMode === 'html') { - // `textStyle` is probably from user input, should be encoded to reduce security risk. - return { - // eslint-disable-next-line max-len - nameStyle: "font-size:" + encodeHTML(nameFontSize + '') + "px;color:" + encodeHTML(nameFontColor) + ";font-weight:" + encodeHTML(nameFontWeight + ''), - // eslint-disable-next-line max-len - valueStyle: "font-size:" + encodeHTML(valueFontSize + '') + "px;color:" + encodeHTML(valueFontColor) + ";font-weight:" + encodeHTML(valueFontWeight + '') - }; - } else { - return { - nameStyle: { - fontSize: nameFontSize, - fill: nameFontColor, - fontWeight: nameFontWeight - }, - valueStyle: { - fontSize: valueFontSize, - fill: valueFontColor, - fontWeight: valueFontWeight - } - }; - } + var nameFontColor = textStyle.color || '#6e7079'; + var nameFontSize = textStyle.fontSize || 12; + var nameFontWeight = textStyle.fontWeight || '400'; + var valueFontColor = textStyle.color || '#464646'; + var valueFontSize = textStyle.fontSize || 14; + var valueFontWeight = textStyle.fontWeight || '900'; + + if (renderMode === 'html') { + // `textStyle` is probably from user input, should be encoded to reduce security risk. + return { + // eslint-disable-next-line max-len + nameStyle: "font-size:" + encodeHTML(nameFontSize + '') + "px;color:" + encodeHTML(nameFontColor) + ";font-weight:" + encodeHTML(nameFontWeight + ''), + // eslint-disable-next-line max-len + valueStyle: "font-size:" + encodeHTML(valueFontSize + '') + "px;color:" + encodeHTML(valueFontColor) + ";font-weight:" + encodeHTML(valueFontWeight + '') + }; + } else { + return { + nameStyle: { + fontSize: nameFontSize, + fill: nameFontColor, + fontWeight: nameFontWeight + }, + valueStyle: { + fontSize: valueFontSize, + fill: valueFontColor, + fontWeight: valueFontWeight + } + }; + } } // See `TooltipMarkupLayoutIntent['innerGapLevel']`. // (value from UI design) @@ -23596,124 +23596,124 @@ var RICH_TEXT_GAPS = ['', '\n', '\n\n', '\n\n\n']; // eslint-disable-next-line max-len function createTooltipMarkup(type, option) { - option.type = type; - return option; + option.type = type; + return option; } function isSectionFragment(frag) { - return frag.type === 'section'; + return frag.type === 'section'; } function getBuilder(frag) { - return isSectionFragment(frag) ? buildSection : buildNameValue; + return isSectionFragment(frag) ? buildSection : buildNameValue; } function getBlockGapLevel(frag) { - if (isSectionFragment(frag)) { - var gapLevel_1 = 0; - var subBlockLen = frag.blocks.length; - var hasInnerGap_1 = subBlockLen > 1 || subBlockLen > 0 && !frag.noHeader; - each(frag.blocks, function (subBlock) { - var subGapLevel = getBlockGapLevel(subBlock); // If the some of the sub-blocks have some gaps (like 10px) inside, this block - // should use a larger gap (like 20px) to distinguish those sub-blocks. - - if (subGapLevel >= gapLevel_1) { - gapLevel_1 = subGapLevel + +(hasInnerGap_1 && ( // 0 always can not be readable gap level. - !subGapLevel // If no header, always keep the sub gap level. Otherwise - // look weird in case `multipleSeries`. - || isSectionFragment(subBlock) && !subBlock.noHeader)); - } - }); - return gapLevel_1; - } + if (isSectionFragment(frag)) { + var gapLevel_1 = 0; + var subBlockLen = frag.blocks.length; + var hasInnerGap_1 = subBlockLen > 1 || subBlockLen > 0 && !frag.noHeader; + each(frag.blocks, function (subBlock) { + var subGapLevel = getBlockGapLevel(subBlock); // If the some of the sub-blocks have some gaps (like 10px) inside, this block + // should use a larger gap (like 20px) to distinguish those sub-blocks. + + if (subGapLevel >= gapLevel_1) { + gapLevel_1 = subGapLevel + +(hasInnerGap_1 && ( // 0 always can not be readable gap level. + !subGapLevel // If no header, always keep the sub gap level. Otherwise + // look weird in case `multipleSeries`. + || isSectionFragment(subBlock) && !subBlock.noHeader)); + } + }); + return gapLevel_1; + } - return 0; + return 0; } function buildSection(ctx, fragment, topMarginForOuterGap, toolTipTextStyle) { - var noHeader = fragment.noHeader; - var gaps = getGap(getBlockGapLevel(fragment)); - var subMarkupTextList = []; - var subBlocks = fragment.blocks || []; - assert(!subBlocks || isArray(subBlocks)); - subBlocks = subBlocks || []; - var orderMode = ctx.orderMode; - - if (fragment.sortBlocks && orderMode) { - subBlocks = subBlocks.slice(); - var orderMap = { - valueAsc: 'asc', - valueDesc: 'desc' - }; - - if (hasOwn(orderMap, orderMode)) { - var comparator_1 = new SortOrderComparator(orderMap[orderMode], null); - subBlocks.sort(function (a, b) { - return comparator_1.evaluate(a.sortParam, b.sortParam); - }); - } // FIXME 'seriesDesc' necessary? - else if (orderMode === 'seriesDesc') { - subBlocks.reverse(); - } - } - - each(subBlocks, function (subBlock, idx) { - var valueFormatter = fragment.valueFormatter; - var subMarkupText = getBuilder(subBlock)( // Inherit valueFormatter - valueFormatter ? extend(extend({}, ctx), { - valueFormatter: valueFormatter - }) : ctx, subBlock, idx > 0 ? gaps.html : 0, toolTipTextStyle); - subMarkupText != null && subMarkupTextList.push(subMarkupText); - }); - var subMarkupText = ctx.renderMode === 'richText' ? subMarkupTextList.join(gaps.richText) : wrapBlockHTML(subMarkupTextList.join(''), noHeader ? topMarginForOuterGap : gaps.html); - - if (noHeader) { - return subMarkupText; - } - - var displayableHeader = makeValueReadable(fragment.header, 'ordinal', ctx.useUTC); - var nameStyle = getTooltipTextStyle(toolTipTextStyle, ctx.renderMode).nameStyle; - - if (ctx.renderMode === 'richText') { - return wrapInlineNameRichText(ctx, displayableHeader, nameStyle) + gaps.richText + subMarkupText; - } else { - return wrapBlockHTML("
              " + encodeHTML(displayableHeader) + '
              ' + subMarkupText, topMarginForOuterGap); - } - } + var noHeader = fragment.noHeader; + var gaps = getGap(getBlockGapLevel(fragment)); + var subMarkupTextList = []; + var subBlocks = fragment.blocks || []; + assert(!subBlocks || isArray(subBlocks)); + subBlocks = subBlocks || []; + var orderMode = ctx.orderMode; + + if (fragment.sortBlocks && orderMode) { + subBlocks = subBlocks.slice(); + var orderMap = { + valueAsc: 'asc', + valueDesc: 'desc' + }; + + if (hasOwn(orderMap, orderMode)) { + var comparator_1 = new SortOrderComparator(orderMap[orderMode], null); + subBlocks.sort(function (a, b) { + return comparator_1.evaluate(a.sortParam, b.sortParam); + }); + } // FIXME 'seriesDesc' necessary? + else if (orderMode === 'seriesDesc') { + subBlocks.reverse(); + } + } + + each(subBlocks, function (subBlock, idx) { + var valueFormatter = fragment.valueFormatter; + var subMarkupText = getBuilder(subBlock)( // Inherit valueFormatter + valueFormatter ? extend(extend({}, ctx), { + valueFormatter: valueFormatter + }) : ctx, subBlock, idx > 0 ? gaps.html : 0, toolTipTextStyle); + subMarkupText != null && subMarkupTextList.push(subMarkupText); + }); + var subMarkupText = ctx.renderMode === 'richText' ? subMarkupTextList.join(gaps.richText) : wrapBlockHTML(subMarkupTextList.join(''), noHeader ? topMarginForOuterGap : gaps.html); + + if (noHeader) { + return subMarkupText; + } + + var displayableHeader = makeValueReadable(fragment.header, 'ordinal', ctx.useUTC); + var nameStyle = getTooltipTextStyle(toolTipTextStyle, ctx.renderMode).nameStyle; + + if (ctx.renderMode === 'richText') { + return wrapInlineNameRichText(ctx, displayableHeader, nameStyle) + gaps.richText + subMarkupText; + } else { + return wrapBlockHTML("
              " + encodeHTML(displayableHeader) + '
              ' + subMarkupText, topMarginForOuterGap); + } + } function buildNameValue(ctx, fragment, topMarginForOuterGap, toolTipTextStyle) { - var renderMode = ctx.renderMode; - var noName = fragment.noName; - var noValue = fragment.noValue; - var noMarker = !fragment.markerType; - var name = fragment.name; - var useUTC = ctx.useUTC; - - var valueFormatter = fragment.valueFormatter || ctx.valueFormatter || function (value) { - value = isArray(value) ? value : [value]; - return map(value, function (val, idx) { - return makeValueReadable(val, isArray(valueTypeOption) ? valueTypeOption[idx] : valueTypeOption, useUTC); - }); - }; + var renderMode = ctx.renderMode; + var noName = fragment.noName; + var noValue = fragment.noValue; + var noMarker = !fragment.markerType; + var name = fragment.name; + var useUTC = ctx.useUTC; + + var valueFormatter = fragment.valueFormatter || ctx.valueFormatter || function (value) { + value = isArray(value) ? value : [value]; + return map(value, function (val, idx) { + return makeValueReadable(val, isArray(valueTypeOption) ? valueTypeOption[idx] : valueTypeOption, useUTC); + }); + }; - if (noName && noValue) { - return; - } + if (noName && noValue) { + return; + } - var markerStr = noMarker ? '' : ctx.markupStyleCreator.makeTooltipMarker(fragment.markerType, fragment.markerColor || '#333', renderMode); - var readableName = noName ? '' : makeValueReadable(name, 'ordinal', useUTC); - var valueTypeOption = fragment.valueType; - var readableValueList = noValue ? [] : valueFormatter(fragment.value); - var valueAlignRight = !noMarker || !noName; // It little weird if only value next to marker but far from marker. + var markerStr = noMarker ? '' : ctx.markupStyleCreator.makeTooltipMarker(fragment.markerType, fragment.markerColor || '#333', renderMode); + var readableName = noName ? '' : makeValueReadable(name, 'ordinal', useUTC); + var valueTypeOption = fragment.valueType; + var readableValueList = noValue ? [] : valueFormatter(fragment.value); + var valueAlignRight = !noMarker || !noName; // It little weird if only value next to marker but far from marker. - var valueCloseToMarker = !noMarker && noName; + var valueCloseToMarker = !noMarker && noName; - var _a = getTooltipTextStyle(toolTipTextStyle, renderMode), - nameStyle = _a.nameStyle, - valueStyle = _a.valueStyle; + var _a = getTooltipTextStyle(toolTipTextStyle, renderMode), + nameStyle = _a.nameStyle, + valueStyle = _a.valueStyle; - return renderMode === 'richText' ? (noMarker ? '' : markerStr) + (noName ? '' : wrapInlineNameRichText(ctx, readableName, nameStyle)) // Value has commas inside, so use ' ' as delimiter for multiple values. - + (noValue ? '' : wrapInlineValueRichText(ctx, readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)) : wrapBlockHTML((noMarker ? '' : markerStr) + (noName ? '' : wrapInlineNameHTML(readableName, !noMarker, nameStyle)) + (noValue ? '' : wrapInlineValueHTML(readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)), topMarginForOuterGap); + return renderMode === 'richText' ? (noMarker ? '' : markerStr) + (noName ? '' : wrapInlineNameRichText(ctx, readableName, nameStyle)) // Value has commas inside, so use ' ' as delimiter for multiple values. + + (noValue ? '' : wrapInlineValueRichText(ctx, readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)) : wrapBlockHTML((noMarker ? '' : markerStr) + (noName ? '' : wrapInlineNameHTML(readableName, !noMarker, nameStyle)) + (noValue ? '' : wrapInlineValueHTML(readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)), topMarginForOuterGap); } /** * @return markupText. null/undefined means no content. @@ -23721,74 +23721,74 @@ function buildTooltipMarkup(fragment, markupStyleCreator, renderMode, orderMode, useUTC, toolTipTextStyle) { - if (!fragment) { - return; - } + if (!fragment) { + return; + } - var builder = getBuilder(fragment); - var ctx = { - useUTC: useUTC, - renderMode: renderMode, - orderMode: orderMode, - markupStyleCreator: markupStyleCreator, - valueFormatter: fragment.valueFormatter - }; - return builder(ctx, fragment, 0, toolTipTextStyle); + var builder = getBuilder(fragment); + var ctx = { + useUTC: useUTC, + renderMode: renderMode, + orderMode: orderMode, + markupStyleCreator: markupStyleCreator, + valueFormatter: fragment.valueFormatter + }; + return builder(ctx, fragment, 0, toolTipTextStyle); } function getGap(gapLevel) { - return { - html: HTML_GAPS[gapLevel], - richText: RICH_TEXT_GAPS[gapLevel] - }; + return { + html: HTML_GAPS[gapLevel], + richText: RICH_TEXT_GAPS[gapLevel] + }; } function wrapBlockHTML(encodedContent, topGap) { - var clearfix = '
              '; - var marginCSS = "margin: " + topGap + "px 0 0"; - return "
              " + encodedContent + clearfix + '
              '; + var clearfix = '
              '; + var marginCSS = "margin: " + topGap + "px 0 0"; + return "
              " + encodedContent + clearfix + '
              '; } function wrapInlineNameHTML(name, leftHasMarker, style) { - var marginCss = leftHasMarker ? 'margin-left:2px' : ''; - return "" + encodeHTML(name) + ''; + var marginCss = leftHasMarker ? 'margin-left:2px' : ''; + return "" + encodeHTML(name) + ''; } function wrapInlineValueHTML(valueList, alignRight, valueCloseToMarker, style) { - // Do not too close to marker, considering there are multiple values separated by spaces. - var paddingStr = valueCloseToMarker ? '10px' : '20px'; - var alignCSS = alignRight ? "float:right;margin-left:" + paddingStr : ''; - valueList = isArray(valueList) ? valueList : [valueList]; - return "" // Value has commas inside, so use ' ' as delimiter for multiple values. - + map(valueList, function (value) { - return encodeHTML(value); - }).join('  ') + ''; + // Do not too close to marker, considering there are multiple values separated by spaces. + var paddingStr = valueCloseToMarker ? '10px' : '20px'; + var alignCSS = alignRight ? "float:right;margin-left:" + paddingStr : ''; + valueList = isArray(valueList) ? valueList : [valueList]; + return "" // Value has commas inside, so use ' ' as delimiter for multiple values. + + map(valueList, function (value) { + return encodeHTML(value); + }).join('  ') + ''; } function wrapInlineNameRichText(ctx, name, style) { - return ctx.markupStyleCreator.wrapRichTextStyle(name, style); + return ctx.markupStyleCreator.wrapRichTextStyle(name, style); } function wrapInlineValueRichText(ctx, values, alignRight, valueCloseToMarker, style) { - var styles = [style]; - var paddingLeft = valueCloseToMarker ? 10 : 20; - alignRight && styles.push({ - padding: [0, 0, 0, paddingLeft], - align: 'right' - }); // Value has commas inside, so use ' ' as delimiter for multiple values. + var styles = [style]; + var paddingLeft = valueCloseToMarker ? 10 : 20; + alignRight && styles.push({ + padding: [0, 0, 0, paddingLeft], + align: 'right' + }); // Value has commas inside, so use ' ' as delimiter for multiple values. - return ctx.markupStyleCreator.wrapRichTextStyle(isArray(values) ? values.join(' ') : values, styles); + return ctx.markupStyleCreator.wrapRichTextStyle(isArray(values) ? values.join(' ') : values, styles); } function retrieveVisualColorForTooltipMarker(series, dataIndex) { - var style = series.getData().getItemVisual(dataIndex, 'style'); - var color = style[series.visualDrawType]; - return convertToColorString(color); + var style = series.getData().getItemVisual(dataIndex, 'style'); + var color = style[series.visualDrawType]; + return convertToColorString(color); } function getPaddingFromTooltipModel(model, renderMode) { - var padding = model.get('padding'); - return padding != null ? padding // We give slightly different to look pretty. - : renderMode === 'richText' ? [8, 10] : 10; + var padding = model.get('padding'); + return padding != null ? padding // We give slightly different to look pretty. + : renderMode === 'richText' ? [8, 10] : 10; } /** * The major feature is generate styles for `renderMode: 'richText'`. @@ -23797,686 +23797,686 @@ */ var TooltipMarkupStyleCreator = - /** @class */ - function () { - function TooltipMarkupStyleCreator() { - this.richTextStyles = {}; // Notice that "generate a style name" usuall happens repeatly when mouse moving and - // displaying a tooltip. So we put the `_nextStyleNameId` as a member of each creator - // rather than static shared by all creators (which will cause it increase to fast). - - this._nextStyleNameId = getRandomIdBase(); - } - - TooltipMarkupStyleCreator.prototype._generateStyleName = function () { - return '__EC_aUTo_' + this._nextStyleNameId++; - }; - - TooltipMarkupStyleCreator.prototype.makeTooltipMarker = function (markerType, colorStr, renderMode) { - var markerId = renderMode === 'richText' ? this._generateStyleName() : null; - var marker = getTooltipMarker({ - color: colorStr, - type: markerType, - renderMode: renderMode, - markerId: markerId - }); - - if (isString(marker)) { - return marker; - } else { - if ("development" !== 'production') { - assert(markerId); - } + /** @class */ + function () { + function TooltipMarkupStyleCreator() { + this.richTextStyles = {}; // Notice that "generate a style name" usuall happens repeatly when mouse moving and + // displaying a tooltip. So we put the `_nextStyleNameId` as a member of each creator + // rather than static shared by all creators (which will cause it increase to fast). + + this._nextStyleNameId = getRandomIdBase(); + } + + TooltipMarkupStyleCreator.prototype._generateStyleName = function () { + return '__EC_aUTo_' + this._nextStyleNameId++; + }; + + TooltipMarkupStyleCreator.prototype.makeTooltipMarker = function (markerType, colorStr, renderMode) { + var markerId = renderMode === 'richText' ? this._generateStyleName() : null; + var marker = getTooltipMarker({ + color: colorStr, + type: markerType, + renderMode: renderMode, + markerId: markerId + }); - this.richTextStyles[markerId] = marker.style; - return marker.content; - } - }; - /** - * @usage - * ```ts - * const styledText = markupStyleCreator.wrapRichTextStyle([ - * // The styles will be auto merged. - * { - * fontSize: 12, - * color: 'blue' - * }, - * { - * padding: 20 - * } - * ]); - * ``` - */ + if (isString(marker)) { + return marker; + } else { + if ("development" !== 'production') { + assert(markerId); + } + + this.richTextStyles[markerId] = marker.style; + return marker.content; + } + }; + /** + * @usage + * ```ts + * const styledText = markupStyleCreator.wrapRichTextStyle([ + * // The styles will be auto merged. + * { + * fontSize: 12, + * color: 'blue' + * }, + * { + * padding: 20 + * } + * ]); + * ``` + */ - TooltipMarkupStyleCreator.prototype.wrapRichTextStyle = function (text, styles) { - var finalStl = {}; + TooltipMarkupStyleCreator.prototype.wrapRichTextStyle = function (text, styles) { + var finalStl = {}; - if (isArray(styles)) { - each(styles, function (stl) { - return extend(finalStl, stl); - }); - } else { - extend(finalStl, styles); - } + if (isArray(styles)) { + each(styles, function (stl) { + return extend(finalStl, stl); + }); + } else { + extend(finalStl, styles); + } - var styleName = this._generateStyleName(); + var styleName = this._generateStyleName(); - this.richTextStyles[styleName] = finalStl; - return "{" + styleName + "|" + text + "}"; - }; + this.richTextStyles[styleName] = finalStl; + return "{" + styleName + "|" + text + "}"; + }; - return TooltipMarkupStyleCreator; - }(); + return TooltipMarkupStyleCreator; + }(); function defaultSeriesFormatTooltip(opt) { - var series = opt.series; - var dataIndex = opt.dataIndex; - var multipleSeries = opt.multipleSeries; - var data = series.getData(); - var tooltipDims = data.mapDimensionsAll('defaultedTooltip'); - var tooltipDimLen = tooltipDims.length; - var value = series.getRawValue(dataIndex); - var isValueArr = isArray(value); - var markerColor = retrieveVisualColorForTooltipMarker(series, dataIndex); // Complicated rule for pretty tooltip. - - var inlineValue; - var inlineValueType; - var subBlocks; - var sortParam; - - if (tooltipDimLen > 1 || isValueArr && !tooltipDimLen) { - var formatArrResult = formatTooltipArrayValue(value, series, dataIndex, tooltipDims, markerColor); - inlineValue = formatArrResult.inlineValues; - inlineValueType = formatArrResult.inlineValueTypes; - subBlocks = formatArrResult.blocks; // Only support tooltip sort by the first inline value. It's enough in most cases. - - sortParam = formatArrResult.inlineValues[0]; - } else if (tooltipDimLen) { - var dimInfo = data.getDimensionInfo(tooltipDims[0]); - sortParam = inlineValue = retrieveRawValue(data, dataIndex, tooltipDims[0]); - inlineValueType = dimInfo.type; - } else { - sortParam = inlineValue = isValueArr ? value[0] : value; - } // Do not show generated series name. It might not be readable. - - - var seriesNameSpecified = isNameSpecified(series); - var seriesName = seriesNameSpecified && series.name || ''; - var itemName = data.getName(dataIndex); - var inlineName = multipleSeries ? seriesName : itemName; - return createTooltipMarkup('section', { - header: seriesName, - // When series name not specified, do not show a header line with only '-'. - // This case alway happen in tooltip.trigger: 'item'. - noHeader: multipleSeries || !seriesNameSpecified, - sortParam: sortParam, - blocks: [createTooltipMarkup('nameValue', { - markerType: 'item', - markerColor: markerColor, - // Do not mix display seriesName and itemName in one tooltip, - // which might confuses users. - name: inlineName, - // name dimension might be auto assigned, where the name might - // be not readable. So we check trim here. - noName: !trim(inlineName), - value: inlineValue, - valueType: inlineValueType - })].concat(subBlocks || []) - }); + var series = opt.series; + var dataIndex = opt.dataIndex; + var multipleSeries = opt.multipleSeries; + var data = series.getData(); + var tooltipDims = data.mapDimensionsAll('defaultedTooltip'); + var tooltipDimLen = tooltipDims.length; + var value = series.getRawValue(dataIndex); + var isValueArr = isArray(value); + var markerColor = retrieveVisualColorForTooltipMarker(series, dataIndex); // Complicated rule for pretty tooltip. + + var inlineValue; + var inlineValueType; + var subBlocks; + var sortParam; + + if (tooltipDimLen > 1 || isValueArr && !tooltipDimLen) { + var formatArrResult = formatTooltipArrayValue(value, series, dataIndex, tooltipDims, markerColor); + inlineValue = formatArrResult.inlineValues; + inlineValueType = formatArrResult.inlineValueTypes; + subBlocks = formatArrResult.blocks; // Only support tooltip sort by the first inline value. It's enough in most cases. + + sortParam = formatArrResult.inlineValues[0]; + } else if (tooltipDimLen) { + var dimInfo = data.getDimensionInfo(tooltipDims[0]); + sortParam = inlineValue = retrieveRawValue(data, dataIndex, tooltipDims[0]); + inlineValueType = dimInfo.type; + } else { + sortParam = inlineValue = isValueArr ? value[0] : value; + } // Do not show generated series name. It might not be readable. + + + var seriesNameSpecified = isNameSpecified(series); + var seriesName = seriesNameSpecified && series.name || ''; + var itemName = data.getName(dataIndex); + var inlineName = multipleSeries ? seriesName : itemName; + return createTooltipMarkup('section', { + header: seriesName, + // When series name not specified, do not show a header line with only '-'. + // This case alway happen in tooltip.trigger: 'item'. + noHeader: multipleSeries || !seriesNameSpecified, + sortParam: sortParam, + blocks: [createTooltipMarkup('nameValue', { + markerType: 'item', + markerColor: markerColor, + // Do not mix display seriesName and itemName in one tooltip, + // which might confuses users. + name: inlineName, + // name dimension might be auto assigned, where the name might + // be not readable. So we check trim here. + noName: !trim(inlineName), + value: inlineValue, + valueType: inlineValueType + })].concat(subBlocks || []) + }); } function formatTooltipArrayValue(value, series, dataIndex, tooltipDims, colorStr) { - // check: category-no-encode-has-axis-data in dataset.html - var data = series.getData(); - var isValueMultipleLine = reduce(value, function (isValueMultipleLine, val, idx) { - var dimItem = data.getDimensionInfo(idx); - return isValueMultipleLine = isValueMultipleLine || dimItem && dimItem.tooltip !== false && dimItem.displayName != null; - }, false); - var inlineValues = []; - var inlineValueTypes = []; - var blocks = []; - tooltipDims.length ? each(tooltipDims, function (dim) { - setEachItem(retrieveRawValue(data, dataIndex, dim), dim); - }) // By default, all dims is used on tooltip. - : each(value, setEachItem); - - function setEachItem(val, dim) { - var dimInfo = data.getDimensionInfo(dim); // If `dimInfo.tooltip` is not set, show tooltip. - - if (!dimInfo || dimInfo.otherDims.tooltip === false) { - return; - } - - if (isValueMultipleLine) { - blocks.push(createTooltipMarkup('nameValue', { - markerType: 'subItem', - markerColor: colorStr, - name: dimInfo.displayName, - value: val, - valueType: dimInfo.type - })); - } else { - inlineValues.push(val); - inlineValueTypes.push(dimInfo.type); - } + // check: category-no-encode-has-axis-data in dataset.html + var data = series.getData(); + var isValueMultipleLine = reduce(value, function (isValueMultipleLine, val, idx) { + var dimItem = data.getDimensionInfo(idx); + return isValueMultipleLine = isValueMultipleLine || dimItem && dimItem.tooltip !== false && dimItem.displayName != null; + }, false); + var inlineValues = []; + var inlineValueTypes = []; + var blocks = []; + tooltipDims.length ? each(tooltipDims, function (dim) { + setEachItem(retrieveRawValue(data, dataIndex, dim), dim); + }) // By default, all dims is used on tooltip. + : each(value, setEachItem); + + function setEachItem(val, dim) { + var dimInfo = data.getDimensionInfo(dim); // If `dimInfo.tooltip` is not set, show tooltip. + + if (!dimInfo || dimInfo.otherDims.tooltip === false) { + return; + } + + if (isValueMultipleLine) { + blocks.push(createTooltipMarkup('nameValue', { + markerType: 'subItem', + markerColor: colorStr, + name: dimInfo.displayName, + value: val, + valueType: dimInfo.type + })); + } else { + inlineValues.push(val); + inlineValueTypes.push(dimInfo.type); } + } - return { - inlineValues: inlineValues, - inlineValueTypes: inlineValueTypes, - blocks: blocks - }; + return { + inlineValues: inlineValues, + inlineValueTypes: inlineValueTypes, + blocks: blocks + }; } var inner$1 = makeInner(); function getSelectionKey(data, dataIndex) { - return data.getName(dataIndex) || data.getId(dataIndex); + return data.getName(dataIndex) || data.getId(dataIndex); } var SERIES_UNIVERSAL_TRANSITION_PROP = '__universalTransitionEnabled'; var SeriesModel = - /** @class */ - function (_super) { - __extends(SeriesModel, _super); - - function SeriesModel() { - // [Caution]: Becuase this class or desecendants can be used as `XXX.extend(subProto)`, - // the class members must not be initialized in constructor or declaration place. - // Otherwise there is bad case: - // class A {xxx = 1;} - // enableClassExtend(A); - // class B extends A {} - // var C = B.extend({xxx: 5}); - // var c = new C(); - // console.log(c.xxx); // expect 5 but always 1. - var _this = _super !== null && _super.apply(this, arguments) || this; // --------------------------------------- - // Props about data selection - // --------------------------------------- - - - _this._selectedDataIndicesMap = {}; - return _this; - } - - SeriesModel.prototype.init = function (option, parentModel, ecModel) { - this.seriesIndex = this.componentIndex; - this.dataTask = createTask({ - count: dataTaskCount, - reset: dataTaskReset - }); - this.dataTask.context = { - model: this - }; - this.mergeDefaultAndTheme(option, ecModel); - var sourceManager = inner$1(this).sourceManager = new SourceManager(this); - sourceManager.prepareSource(); - var data = this.getInitialData(option, ecModel); - wrapData(data, this); - this.dataTask.context.data = data; - - if ("development" !== 'production') { - assert(data, 'getInitialData returned invalid data.'); - } - - inner$1(this).dataBeforeProcessed = data; // If we reverse the order (make data firstly, and then make - // dataBeforeProcessed by cloneShallow), cloneShallow will - // cause data.graph.data !== data when using - // module:echarts/data/Graph or module:echarts/data/Tree. - // See module:echarts/data/helper/linkSeriesData - // Theoretically, it is unreasonable to call `seriesModel.getData()` in the model - // init or merge stage, because the data can be restored. So we do not `restoreData` - // and `setData` here, which forbids calling `seriesModel.getData()` in this stage. - // Call `seriesModel.getRawData()` instead. - // this.restoreData(); - - autoSeriesName(this); - - this._initSelectedMapFromData(data); - }; - /** - * Util for merge default and theme to option - */ - - - SeriesModel.prototype.mergeDefaultAndTheme = function (option, ecModel) { - var layoutMode = fetchLayoutMode(this); - var inputPositionParams = layoutMode ? getLayoutParams(option) : {}; // Backward compat: using subType on theme. - // But if name duplicate between series subType - // (for example: parallel) add component mainType, - // add suffix 'Series'. - - var themeSubType = this.subType; - - if (ComponentModel.hasClass(themeSubType)) { - themeSubType += 'Series'; - } - - merge(option, ecModel.getTheme().get(this.subType)); - merge(option, this.getDefaultOption()); // Default label emphasis `show` + /** @class */ + function (_super) { + __extends(SeriesModel, _super); + + function SeriesModel() { + // [Caution]: Becuase this class or desecendants can be used as `XXX.extend(subProto)`, + // the class members must not be initialized in constructor or declaration place. + // Otherwise there is bad case: + // class A {xxx = 1;} + // enableClassExtend(A); + // class B extends A {} + // var C = B.extend({xxx: 5}); + // var c = new C(); + // console.log(c.xxx); // expect 5 but always 1. + var _this = _super !== null && _super.apply(this, arguments) || this; // --------------------------------------- + // Props about data selection + // --------------------------------------- + + + _this._selectedDataIndicesMap = {}; + return _this; + } + + SeriesModel.prototype.init = function (option, parentModel, ecModel) { + this.seriesIndex = this.componentIndex; + this.dataTask = createTask({ + count: dataTaskCount, + reset: dataTaskReset + }); + this.dataTask.context = { + model: this + }; + this.mergeDefaultAndTheme(option, ecModel); + var sourceManager = inner$1(this).sourceManager = new SourceManager(this); + sourceManager.prepareSource(); + var data = this.getInitialData(option, ecModel); + wrapData(data, this); + this.dataTask.context.data = data; - defaultEmphasis(option, 'label', ['show']); - this.fillDataTextStyle(option.data); + if ("development" !== 'production') { + assert(data, 'getInitialData returned invalid data.'); + } + + inner$1(this).dataBeforeProcessed = data; // If we reverse the order (make data firstly, and then make + // dataBeforeProcessed by cloneShallow), cloneShallow will + // cause data.graph.data !== data when using + // module:echarts/data/Graph or module:echarts/data/Tree. + // See module:echarts/data/helper/linkSeriesData + // Theoretically, it is unreasonable to call `seriesModel.getData()` in the model + // init or merge stage, because the data can be restored. So we do not `restoreData` + // and `setData` here, which forbids calling `seriesModel.getData()` in this stage. + // Call `seriesModel.getRawData()` instead. + // this.restoreData(); + + autoSeriesName(this); + + this._initSelectedMapFromData(data); + }; + /** + * Util for merge default and theme to option + */ - if (layoutMode) { - mergeLayoutParam(option, inputPositionParams, layoutMode); - } - }; - SeriesModel.prototype.mergeOption = function (newSeriesOption, ecModel) { - // this.settingTask.dirty(); - newSeriesOption = merge(this.option, newSeriesOption, true); - this.fillDataTextStyle(newSeriesOption.data); - var layoutMode = fetchLayoutMode(this); + SeriesModel.prototype.mergeDefaultAndTheme = function (option, ecModel) { + var layoutMode = fetchLayoutMode(this); + var inputPositionParams = layoutMode ? getLayoutParams(option) : {}; // Backward compat: using subType on theme. + // But if name duplicate between series subType + // (for example: parallel) add component mainType, + // add suffix 'Series'. - if (layoutMode) { - mergeLayoutParam(this.option, newSeriesOption, layoutMode); - } + var themeSubType = this.subType; - var sourceManager = inner$1(this).sourceManager; - sourceManager.dirty(); - sourceManager.prepareSource(); - var data = this.getInitialData(newSeriesOption, ecModel); - wrapData(data, this); - this.dataTask.dirty(); - this.dataTask.context.data = data; - inner$1(this).dataBeforeProcessed = data; - autoSeriesName(this); + if (ComponentModel.hasClass(themeSubType)) { + themeSubType += 'Series'; + } - this._initSelectedMapFromData(data); - }; + merge(option, ecModel.getTheme().get(this.subType)); + merge(option, this.getDefaultOption()); // Default label emphasis `show` - SeriesModel.prototype.fillDataTextStyle = function (data) { - // Default data label emphasis `show` - // FIXME Tree structure data ? - // FIXME Performance ? - if (data && !isTypedArray(data)) { - var props = ['show']; + defaultEmphasis(option, 'label', ['show']); + this.fillDataTextStyle(option.data); - for (var i = 0; i < data.length; i++) { - if (data[i] && data[i].label) { - defaultEmphasis(data[i], 'label', props); - } - } - } - }; - /** - * Init a data structure from data related option in series - * Must be overriden. - */ + if (layoutMode) { + mergeLayoutParam(option, inputPositionParams, layoutMode); + } + }; + SeriesModel.prototype.mergeOption = function (newSeriesOption, ecModel) { + // this.settingTask.dirty(); + newSeriesOption = merge(this.option, newSeriesOption, true); + this.fillDataTextStyle(newSeriesOption.data); + var layoutMode = fetchLayoutMode(this); - SeriesModel.prototype.getInitialData = function (option, ecModel) { - return; - }; - /** - * Append data to list - */ + if (layoutMode) { + mergeLayoutParam(this.option, newSeriesOption, layoutMode); + } + var sourceManager = inner$1(this).sourceManager; + sourceManager.dirty(); + sourceManager.prepareSource(); + var data = this.getInitialData(newSeriesOption, ecModel); + wrapData(data, this); + this.dataTask.dirty(); + this.dataTask.context.data = data; + inner$1(this).dataBeforeProcessed = data; + autoSeriesName(this); - SeriesModel.prototype.appendData = function (params) { - // FIXME ??? - // (1) If data from dataset, forbidden append. - // (2) support append data of dataset. - var data = this.getRawData(); - data.appendData(params.data); - }; - /** - * Consider some method like `filter`, `map` need make new data, - * We should make sure that `seriesModel.getData()` get correct - * data in the stream procedure. So we fetch data from upstream - * each time `task.perform` called. - */ + this._initSelectedMapFromData(data); + }; + SeriesModel.prototype.fillDataTextStyle = function (data) { + // Default data label emphasis `show` + // FIXME Tree structure data ? + // FIXME Performance ? + if (data && !isTypedArray(data)) { + var props = ['show']; - SeriesModel.prototype.getData = function (dataType) { - var task = getCurrentTask(this); + for (var i = 0; i < data.length; i++) { + if (data[i] && data[i].label) { + defaultEmphasis(data[i], 'label', props); + } + } + } + }; + /** + * Init a data structure from data related option in series + * Must be overriden. + */ - if (task) { - var data = task.context.data; - return dataType == null ? data : data.getLinkedData(dataType); - } else { - // When series is not alive (that may happen when click toolbox - // restore or setOption with not merge mode), series data may - // be still need to judge animation or something when graphic - // elements want to know whether fade out. - return inner$1(this).data; - } - }; - SeriesModel.prototype.getAllData = function () { - var mainData = this.getData(); - return mainData && mainData.getLinkedDataAll ? mainData.getLinkedDataAll() : [{ - data: mainData - }]; - }; + SeriesModel.prototype.getInitialData = function (option, ecModel) { + return; + }; + /** + * Append data to list + */ - SeriesModel.prototype.setData = function (data) { - var task = getCurrentTask(this); - - if (task) { - var context = task.context; // Consider case: filter, data sample. - // FIXME:TS never used, so comment it - // if (context.data !== data && task.modifyOutputEnd) { - // task.setOutputEnd(data.count()); - // } - - context.outputData = data; // Caution: setData should update context.data, - // Because getData may be called multiply in a - // single stage and expect to get the data just - // set. (For example, AxisProxy, x y both call - // getData and setDate sequentially). - // So the context.data should be fetched from - // upstream each time when a stage starts to be - // performed. - - if (task !== this.dataTask) { - context.data = data; - } - } - inner$1(this).data = data; - }; + SeriesModel.prototype.appendData = function (params) { + // FIXME ??? + // (1) If data from dataset, forbidden append. + // (2) support append data of dataset. + var data = this.getRawData(); + data.appendData(params.data); + }; + /** + * Consider some method like `filter`, `map` need make new data, + * We should make sure that `seriesModel.getData()` get correct + * data in the stream procedure. So we fetch data from upstream + * each time `task.perform` called. + */ - SeriesModel.prototype.getEncode = function () { - var encode = this.get('encode', true); - if (encode) { - return createHashMap(encode); - } - }; + SeriesModel.prototype.getData = function (dataType) { + var task = getCurrentTask(this); - SeriesModel.prototype.getSourceManager = function () { - return inner$1(this).sourceManager; - }; + if (task) { + var data = task.context.data; + return dataType == null ? data : data.getLinkedData(dataType); + } else { + // When series is not alive (that may happen when click toolbox + // restore or setOption with not merge mode), series data may + // be still need to judge animation or something when graphic + // elements want to know whether fade out. + return inner$1(this).data; + } + }; + + SeriesModel.prototype.getAllData = function () { + var mainData = this.getData(); + return mainData && mainData.getLinkedDataAll ? mainData.getLinkedDataAll() : [{ + data: mainData + }]; + }; - SeriesModel.prototype.getSource = function () { - return this.getSourceManager().getSource(); - }; - /** - * Get data before processed - */ + SeriesModel.prototype.setData = function (data) { + var task = getCurrentTask(this); + if (task) { + var context = task.context; // Consider case: filter, data sample. + // FIXME:TS never used, so comment it + // if (context.data !== data && task.modifyOutputEnd) { + // task.setOutputEnd(data.count()); + // } + + context.outputData = data; // Caution: setData should update context.data, + // Because getData may be called multiply in a + // single stage and expect to get the data just + // set. (For example, AxisProxy, x y both call + // getData and setDate sequentially). + // So the context.data should be fetched from + // upstream each time when a stage starts to be + // performed. + + if (task !== this.dataTask) { + context.data = data; + } + } + + inner$1(this).data = data; + }; + + SeriesModel.prototype.getEncode = function () { + var encode = this.get('encode', true); + + if (encode) { + return createHashMap(encode); + } + }; + + SeriesModel.prototype.getSourceManager = function () { + return inner$1(this).sourceManager; + }; + + SeriesModel.prototype.getSource = function () { + return this.getSourceManager().getSource(); + }; + /** + * Get data before processed + */ - SeriesModel.prototype.getRawData = function () { - return inner$1(this).dataBeforeProcessed; - }; - SeriesModel.prototype.getColorBy = function () { - var colorBy = this.get('colorBy'); - return colorBy || 'series'; - }; + SeriesModel.prototype.getRawData = function () { + return inner$1(this).dataBeforeProcessed; + }; - SeriesModel.prototype.isColorBySeries = function () { - return this.getColorBy() === 'series'; - }; - /** - * Get base axis if has coordinate system and has axis. - * By default use coordSys.getBaseAxis(); - * Can be overrided for some chart. - * @return {type} description - */ + SeriesModel.prototype.getColorBy = function () { + var colorBy = this.get('colorBy'); + return colorBy || 'series'; + }; + SeriesModel.prototype.isColorBySeries = function () { + return this.getColorBy() === 'series'; + }; + /** + * Get base axis if has coordinate system and has axis. + * By default use coordSys.getBaseAxis(); + * Can be overrided for some chart. + * @return {type} description + */ - SeriesModel.prototype.getBaseAxis = function () { - var coordSys = this.coordinateSystem; // @ts-ignore - return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis(); - }; - /** - * Default tooltip formatter - * - * @param dataIndex - * @param multipleSeries - * @param dataType - * @param renderMode valid values: 'html'(by default) and 'richText'. - * 'html' is used for rendering tooltip in extra DOM form, and the result - * string is used as DOM HTML content. - * 'richText' is used for rendering tooltip in rich text form, for those where - * DOM operation is not supported. - * @return formatted tooltip with `html` and `markers` - * Notice: The override method can also return string - */ + SeriesModel.prototype.getBaseAxis = function () { + var coordSys = this.coordinateSystem; // @ts-ignore + + return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis(); + }; + /** + * Default tooltip formatter + * + * @param dataIndex + * @param multipleSeries + * @param dataType + * @param renderMode valid values: 'html'(by default) and 'richText'. + * 'html' is used for rendering tooltip in extra DOM form, and the result + * string is used as DOM HTML content. + * 'richText' is used for rendering tooltip in rich text form, for those where + * DOM operation is not supported. + * @return formatted tooltip with `html` and `markers` + * Notice: The override method can also return string + */ - SeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - return defaultSeriesFormatTooltip({ - series: this, - dataIndex: dataIndex, - multipleSeries: multipleSeries - }); - }; + SeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { + return defaultSeriesFormatTooltip({ + series: this, + dataIndex: dataIndex, + multipleSeries: multipleSeries + }); + }; - SeriesModel.prototype.isAnimationEnabled = function () { - var ecModel = this.ecModel; // Disable animation if using echarts in node but not give ssr flag. - // In ssr mode, renderToString will generate svg with css animation. + SeriesModel.prototype.isAnimationEnabled = function () { + var ecModel = this.ecModel; // Disable animation if using echarts in node but not give ssr flag. + // In ssr mode, renderToString will generate svg with css animation. - if (env.node && !(ecModel && ecModel.ssr)) { - return false; - } + if (env.node && !(ecModel && ecModel.ssr)) { + return false; + } - var animationEnabled = this.getShallow('animation'); + var animationEnabled = this.getShallow('animation'); - if (animationEnabled) { - if (this.getData().count() > this.getShallow('animationThreshold')) { - animationEnabled = false; - } - } + if (animationEnabled) { + if (this.getData().count() > this.getShallow('animationThreshold')) { + animationEnabled = false; + } + } - return !!animationEnabled; - }; + return !!animationEnabled; + }; - SeriesModel.prototype.restoreData = function () { - this.dataTask.dirty(); - }; + SeriesModel.prototype.restoreData = function () { + this.dataTask.dirty(); + }; - SeriesModel.prototype.getColorFromPalette = function (name, scope, requestColorNum) { - var ecModel = this.ecModel; // PENDING + SeriesModel.prototype.getColorFromPalette = function (name, scope, requestColorNum) { + var ecModel = this.ecModel; // PENDING - var color = PaletteMixin.prototype.getColorFromPalette.call(this, name, scope, requestColorNum); + var color = PaletteMixin.prototype.getColorFromPalette.call(this, name, scope, requestColorNum); - if (!color) { - color = ecModel.getColorFromPalette(name, scope, requestColorNum); - } + if (!color) { + color = ecModel.getColorFromPalette(name, scope, requestColorNum); + } - return color; - }; - /** - * Use `data.mapDimensionsAll(coordDim)` instead. - * @deprecated - */ + return color; + }; + /** + * Use `data.mapDimensionsAll(coordDim)` instead. + * @deprecated + */ - SeriesModel.prototype.coordDimToDataDim = function (coordDim) { - return this.getRawData().mapDimensionsAll(coordDim); - }; - /** - * Get progressive rendering count each step - */ + SeriesModel.prototype.coordDimToDataDim = function (coordDim) { + return this.getRawData().mapDimensionsAll(coordDim); + }; + /** + * Get progressive rendering count each step + */ - SeriesModel.prototype.getProgressive = function () { - return this.get('progressive'); - }; - /** - * Get progressive rendering count each step - */ + SeriesModel.prototype.getProgressive = function () { + return this.get('progressive'); + }; + /** + * Get progressive rendering count each step + */ - SeriesModel.prototype.getProgressiveThreshold = function () { - return this.get('progressiveThreshold'); - }; // PENGING If selectedMode is null ? + SeriesModel.prototype.getProgressiveThreshold = function () { + return this.get('progressiveThreshold'); + }; // PENGING If selectedMode is null ? - SeriesModel.prototype.select = function (innerDataIndices, dataType) { - this._innerSelect(this.getData(dataType), innerDataIndices); - }; + SeriesModel.prototype.select = function (innerDataIndices, dataType) { + this._innerSelect(this.getData(dataType), innerDataIndices); + }; - SeriesModel.prototype.unselect = function (innerDataIndices, dataType) { - var selectedMap = this.option.selectedMap; + SeriesModel.prototype.unselect = function (innerDataIndices, dataType) { + var selectedMap = this.option.selectedMap; - if (!selectedMap) { - return; - } + if (!selectedMap) { + return; + } - var selectedMode = this.option.selectedMode; - var data = this.getData(dataType); + var selectedMode = this.option.selectedMode; + var data = this.getData(dataType); - if (selectedMode === 'series' || selectedMap === 'all') { - this.option.selectedMap = {}; - this._selectedDataIndicesMap = {}; - return; - } + if (selectedMode === 'series' || selectedMap === 'all') { + this.option.selectedMap = {}; + this._selectedDataIndicesMap = {}; + return; + } - for (var i = 0; i < innerDataIndices.length; i++) { - var dataIndex = innerDataIndices[i]; - var nameOrId = getSelectionKey(data, dataIndex); - selectedMap[nameOrId] = false; - this._selectedDataIndicesMap[nameOrId] = -1; - } - }; + for (var i = 0; i < innerDataIndices.length; i++) { + var dataIndex = innerDataIndices[i]; + var nameOrId = getSelectionKey(data, dataIndex); + selectedMap[nameOrId] = false; + this._selectedDataIndicesMap[nameOrId] = -1; + } + }; - SeriesModel.prototype.toggleSelect = function (innerDataIndices, dataType) { - var tmpArr = []; + SeriesModel.prototype.toggleSelect = function (innerDataIndices, dataType) { + var tmpArr = []; - for (var i = 0; i < innerDataIndices.length; i++) { - tmpArr[0] = innerDataIndices[i]; - this.isSelected(innerDataIndices[i], dataType) ? this.unselect(tmpArr, dataType) : this.select(tmpArr, dataType); - } - }; + for (var i = 0; i < innerDataIndices.length; i++) { + tmpArr[0] = innerDataIndices[i]; + this.isSelected(innerDataIndices[i], dataType) ? this.unselect(tmpArr, dataType) : this.select(tmpArr, dataType); + } + }; - SeriesModel.prototype.getSelectedDataIndices = function () { - if (this.option.selectedMap === 'all') { - return [].slice.call(this.getData().getIndices()); - } + SeriesModel.prototype.getSelectedDataIndices = function () { + if (this.option.selectedMap === 'all') { + return [].slice.call(this.getData().getIndices()); + } - var selectedDataIndicesMap = this._selectedDataIndicesMap; - var nameOrIds = keys(selectedDataIndicesMap); - var dataIndices = []; + var selectedDataIndicesMap = this._selectedDataIndicesMap; + var nameOrIds = keys(selectedDataIndicesMap); + var dataIndices = []; - for (var i = 0; i < nameOrIds.length; i++) { - var dataIndex = selectedDataIndicesMap[nameOrIds[i]]; + for (var i = 0; i < nameOrIds.length; i++) { + var dataIndex = selectedDataIndicesMap[nameOrIds[i]]; - if (dataIndex >= 0) { - dataIndices.push(dataIndex); - } - } + if (dataIndex >= 0) { + dataIndices.push(dataIndex); + } + } - return dataIndices; - }; + return dataIndices; + }; - SeriesModel.prototype.isSelected = function (dataIndex, dataType) { - var selectedMap = this.option.selectedMap; + SeriesModel.prototype.isSelected = function (dataIndex, dataType) { + var selectedMap = this.option.selectedMap; - if (!selectedMap) { - return false; - } + if (!selectedMap) { + return false; + } - var data = this.getData(dataType); - return (selectedMap === 'all' || selectedMap[getSelectionKey(data, dataIndex)]) && !data.getItemModel(dataIndex).get(['select', 'disabled']); - }; + var data = this.getData(dataType); + return (selectedMap === 'all' || selectedMap[getSelectionKey(data, dataIndex)]) && !data.getItemModel(dataIndex).get(['select', 'disabled']); + }; - SeriesModel.prototype.isUniversalTransitionEnabled = function () { - if (this[SERIES_UNIVERSAL_TRANSITION_PROP]) { - return true; - } + SeriesModel.prototype.isUniversalTransitionEnabled = function () { + if (this[SERIES_UNIVERSAL_TRANSITION_PROP]) { + return true; + } - var universalTransitionOpt = this.option.universalTransition; // Quick reject + var universalTransitionOpt = this.option.universalTransition; // Quick reject - if (!universalTransitionOpt) { - return false; - } + if (!universalTransitionOpt) { + return false; + } - if (universalTransitionOpt === true) { - return true; - } // Can be simply 'universalTransition: true' + if (universalTransitionOpt === true) { + return true; + } // Can be simply 'universalTransition: true' - return universalTransitionOpt && universalTransitionOpt.enabled; - }; + return universalTransitionOpt && universalTransitionOpt.enabled; + }; - SeriesModel.prototype._innerSelect = function (data, innerDataIndices) { - var _a, _b; + SeriesModel.prototype._innerSelect = function (data, innerDataIndices) { + var _a, _b; - var option = this.option; - var selectedMode = option.selectedMode; - var len = innerDataIndices.length; + var option = this.option; + var selectedMode = option.selectedMode; + var len = innerDataIndices.length; - if (!selectedMode || !len) { - return; - } + if (!selectedMode || !len) { + return; + } - if (selectedMode === 'series') { - option.selectedMap = 'all'; - } else if (selectedMode === 'multiple') { - if (!isObject(option.selectedMap)) { - option.selectedMap = {}; - } + if (selectedMode === 'series') { + option.selectedMap = 'all'; + } else if (selectedMode === 'multiple') { + if (!isObject(option.selectedMap)) { + option.selectedMap = {}; + } - var selectedMap = option.selectedMap; + var selectedMap = option.selectedMap; - for (var i = 0; i < len; i++) { - var dataIndex = innerDataIndices[i]; // TODO diffrent types of data share same object. + for (var i = 0; i < len; i++) { + var dataIndex = innerDataIndices[i]; // TODO diffrent types of data share same object. - var nameOrId = getSelectionKey(data, dataIndex); - selectedMap[nameOrId] = true; - this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex); - } - } else if (selectedMode === 'single' || selectedMode === true) { - var lastDataIndex = innerDataIndices[len - 1]; - var nameOrId = getSelectionKey(data, lastDataIndex); - option.selectedMap = (_a = {}, _a[nameOrId] = true, _a); - this._selectedDataIndicesMap = (_b = {}, _b[nameOrId] = data.getRawIndex(lastDataIndex), _b); - } - }; + var nameOrId = getSelectionKey(data, dataIndex); + selectedMap[nameOrId] = true; + this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex); + } + } else if (selectedMode === 'single' || selectedMode === true) { + var lastDataIndex = innerDataIndices[len - 1]; + var nameOrId = getSelectionKey(data, lastDataIndex); + option.selectedMap = (_a = {}, _a[nameOrId] = true, _a); + this._selectedDataIndicesMap = (_b = {}, _b[nameOrId] = data.getRawIndex(lastDataIndex), _b); + } + }; - SeriesModel.prototype._initSelectedMapFromData = function (data) { - // Ignore select info in data if selectedMap exists. - // NOTE It's only for legacy usage. edge data is not supported. - if (this.option.selectedMap) { - return; - } + SeriesModel.prototype._initSelectedMapFromData = function (data) { + // Ignore select info in data if selectedMap exists. + // NOTE It's only for legacy usage. edge data is not supported. + if (this.option.selectedMap) { + return; + } - var dataIndices = []; + var dataIndices = []; - if (data.hasItemOption) { - data.each(function (idx) { - var rawItem = data.getRawDataItem(idx); + if (data.hasItemOption) { + data.each(function (idx) { + var rawItem = data.getRawDataItem(idx); - if (rawItem && rawItem.selected) { - dataIndices.push(idx); - } - }); - } + if (rawItem && rawItem.selected) { + dataIndices.push(idx); + } + }); + } - if (dataIndices.length > 0) { - this._innerSelect(data, dataIndices); - } - }; // /** - // * @see {module:echarts/stream/Scheduler} - // */ - // abstract pipeTask: null + if (dataIndices.length > 0) { + this._innerSelect(data, dataIndices); + } + }; // /** + // * @see {module:echarts/stream/Scheduler} + // */ + // abstract pipeTask: null - SeriesModel.registerClass = function (clz) { - return ComponentModel.registerClass(clz); - }; + SeriesModel.registerClass = function (clz) { + return ComponentModel.registerClass(clz); + }; - SeriesModel.protoInitialize = function () { - var proto = SeriesModel.prototype; - proto.type = 'series.__base__'; - proto.seriesIndex = 0; - proto.ignoreStyleOnData = false; - proto.hasSymbolVisual = false; - proto.defaultSymbol = 'circle'; // Make sure the values can be accessed! + SeriesModel.protoInitialize = function () { + var proto = SeriesModel.prototype; + proto.type = 'series.__base__'; + proto.seriesIndex = 0; + proto.ignoreStyleOnData = false; + proto.hasSymbolVisual = false; + proto.defaultSymbol = 'circle'; // Make sure the values can be accessed! - proto.visualStyleAccessPath = 'itemStyle'; - proto.visualDrawType = 'fill'; - }(); + proto.visualStyleAccessPath = 'itemStyle'; + proto.visualDrawType = 'fill'; + }(); - return SeriesModel; - }(ComponentModel); + return SeriesModel; + }(ComponentModel); mixin(SeriesModel, DataFormatMixin); mixin(SeriesModel, PaletteMixin); @@ -24488,130 +24488,130 @@ */ function autoSeriesName(seriesModel) { - // User specified name has higher priority, otherwise it may cause - // series can not be queried unexpectedly. - var name = seriesModel.name; + // User specified name has higher priority, otherwise it may cause + // series can not be queried unexpectedly. + var name = seriesModel.name; - if (!isNameSpecified(seriesModel)) { - seriesModel.name = getSeriesAutoName(seriesModel) || name; - } + if (!isNameSpecified(seriesModel)) { + seriesModel.name = getSeriesAutoName(seriesModel) || name; + } } function getSeriesAutoName(seriesModel) { - var data = seriesModel.getRawData(); - var dataDims = data.mapDimensionsAll('seriesName'); - var nameArr = []; - each(dataDims, function (dataDim) { - var dimInfo = data.getDimensionInfo(dataDim); - dimInfo.displayName && nameArr.push(dimInfo.displayName); - }); - return nameArr.join(' '); + var data = seriesModel.getRawData(); + var dataDims = data.mapDimensionsAll('seriesName'); + var nameArr = []; + each(dataDims, function (dataDim) { + var dimInfo = data.getDimensionInfo(dataDim); + dimInfo.displayName && nameArr.push(dimInfo.displayName); + }); + return nameArr.join(' '); } function dataTaskCount(context) { - return context.model.getRawData().count(); + return context.model.getRawData().count(); } function dataTaskReset(context) { - var seriesModel = context.model; - seriesModel.setData(seriesModel.getRawData().cloneShallow()); - return dataTaskProgress; + var seriesModel = context.model; + seriesModel.setData(seriesModel.getRawData().cloneShallow()); + return dataTaskProgress; } function dataTaskProgress(param, context) { - // Avoid repead cloneShallow when data just created in reset. - if (context.outputData && param.end > context.outputData.count()) { - context.model.getRawData().cloneShallow(context.outputData); - } + // Avoid repead cloneShallow when data just created in reset. + if (context.outputData && param.end > context.outputData.count()) { + context.model.getRawData().cloneShallow(context.outputData); + } } // TODO refactor function wrapData(data, seriesModel) { - each(concatArray(data.CHANGABLE_METHODS, data.DOWNSAMPLE_METHODS), function (methodName) { - data.wrapMethod(methodName, curry(onDataChange, seriesModel)); - }); + each(concatArray(data.CHANGABLE_METHODS, data.DOWNSAMPLE_METHODS), function (methodName) { + data.wrapMethod(methodName, curry(onDataChange, seriesModel)); + }); } function onDataChange(seriesModel, newList) { - var task = getCurrentTask(seriesModel); + var task = getCurrentTask(seriesModel); - if (task) { - // Consider case: filter, selectRange - task.setOutputEnd((newList || this).count()); - } + if (task) { + // Consider case: filter, selectRange + task.setOutputEnd((newList || this).count()); + } - return newList; + return newList; } function getCurrentTask(seriesModel) { - var scheduler = (seriesModel.ecModel || {}).scheduler; - var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid); - - if (pipeline) { - // When pipline finished, the currrentTask keep the last - // task (renderTask). - var task = pipeline.currentTask; + var scheduler = (seriesModel.ecModel || {}).scheduler; + var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid); - if (task) { - var agentStubMap = task.agentStubMap; + if (pipeline) { + // When pipline finished, the currrentTask keep the last + // task (renderTask). + var task = pipeline.currentTask; - if (agentStubMap) { - task = agentStubMap.get(seriesModel.uid); - } - } + if (task) { + var agentStubMap = task.agentStubMap; - return task; + if (agentStubMap) { + task = agentStubMap.get(seriesModel.uid); + } } + + return task; + } } var ComponentView = - /** @class */ - function () { - function ComponentView() { - this.group = new Group(); - this.uid = getUID('viewComponent'); - } + /** @class */ + function () { + function ComponentView() { + this.group = new Group(); + this.uid = getUID('viewComponent'); + } - ComponentView.prototype.init = function (ecModel, api) {}; + ComponentView.prototype.init = function (ecModel, api) {}; - ComponentView.prototype.render = function (model, ecModel, api, payload) {}; + ComponentView.prototype.render = function (model, ecModel, api, payload) {}; - ComponentView.prototype.dispose = function (ecModel, api) {}; + ComponentView.prototype.dispose = function (ecModel, api) {}; - ComponentView.prototype.updateView = function (model, ecModel, api, payload) {// Do nothing; - }; + ComponentView.prototype.updateView = function (model, ecModel, api, payload) {// Do nothing; + }; - ComponentView.prototype.updateLayout = function (model, ecModel, api, payload) {// Do nothing; - }; + ComponentView.prototype.updateLayout = function (model, ecModel, api, payload) {// Do nothing; + }; - ComponentView.prototype.updateVisual = function (model, ecModel, api, payload) {// Do nothing; - }; - /** - * Hook for toggle blur target series. - * Can be used in marker for blur or leave blur the markers - */ + ComponentView.prototype.updateVisual = function (model, ecModel, api, payload) {// Do nothing; + }; + /** + * Hook for toggle blur target series. + * Can be used in marker for blur or leave blur the markers + */ - ComponentView.prototype.toggleBlurSeries = function (seriesModels, isBlur, ecModel) {// Do nothing; - }; - /** - * Traverse the new rendered elements. - * - * It will traverse the new added element in progressive rendering. - * And traverse all in normal rendering. - */ + ComponentView.prototype.toggleBlurSeries = function (seriesModels, isBlur, ecModel) {// Do nothing; + }; + /** + * Traverse the new rendered elements. + * + * It will traverse the new added element in progressive rendering. + * And traverse all in normal rendering. + */ - ComponentView.prototype.eachRendered = function (cb) { - var group = this.group; + ComponentView.prototype.eachRendered = function (cb) { + var group = this.group; - if (group) { - group.traverse(cb); - } - }; + if (group) { + group.traverse(cb); + } + }; - return ComponentView; - }(); + return ComponentView; + }(); enableClassExtend(ComponentView); enableClassManagement(ComponentView); @@ -24620,201 +24620,201 @@ */ function createRenderPlanner() { - var inner = makeInner(); - return function (seriesModel) { - var fields = inner(seriesModel); - var pipelineContext = seriesModel.pipelineContext; - var originalLarge = !!fields.large; - var originalProgressive = !!fields.progressiveRender; // FIXME: if the planner works on a filtered series, `pipelineContext` does not - // exists. See #11611 . Probably we need to modify this structure, see the comment - // on `performRawSeries` in `Schedular.js`. + var inner = makeInner(); + return function (seriesModel) { + var fields = inner(seriesModel); + var pipelineContext = seriesModel.pipelineContext; + var originalLarge = !!fields.large; + var originalProgressive = !!fields.progressiveRender; // FIXME: if the planner works on a filtered series, `pipelineContext` does not + // exists. See #11611 . Probably we need to modify this structure, see the comment + // on `performRawSeries` in `Schedular.js`. - var large = fields.large = !!(pipelineContext && pipelineContext.large); - var progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender); - return !!(originalLarge !== large || originalProgressive !== progressive) && 'reset'; - }; + var large = fields.large = !!(pipelineContext && pipelineContext.large); + var progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender); + return !!(originalLarge !== large || originalProgressive !== progressive) && 'reset'; + }; } var inner$2 = makeInner(); var renderPlanner = createRenderPlanner(); var ChartView = - /** @class */ - function () { - function ChartView() { - this.group = new Group(); - this.uid = getUID('viewChart'); - this.renderTask = createTask({ - plan: renderTaskPlan, - reset: renderTaskReset - }); - this.renderTask.context = { - view: this - }; - } + /** @class */ + function () { + function ChartView() { + this.group = new Group(); + this.uid = getUID('viewChart'); + this.renderTask = createTask({ + plan: renderTaskPlan, + reset: renderTaskReset + }); + this.renderTask.context = { + view: this + }; + } - ChartView.prototype.init = function (ecModel, api) {}; + ChartView.prototype.init = function (ecModel, api) {}; - ChartView.prototype.render = function (seriesModel, ecModel, api, payload) { - if ("development" !== 'production') { - throw new Error('render method must been implemented'); - } - }; - /** - * Highlight series or specified data item. - */ + ChartView.prototype.render = function (seriesModel, ecModel, api, payload) { + if ("development" !== 'production') { + throw new Error('render method must been implemented'); + } + }; + /** + * Highlight series or specified data item. + */ - ChartView.prototype.highlight = function (seriesModel, ecModel, api, payload) { - var data = seriesModel.getData(payload && payload.dataType); + ChartView.prototype.highlight = function (seriesModel, ecModel, api, payload) { + var data = seriesModel.getData(payload && payload.dataType); - if (!data) { - if ("development" !== 'production') { - error("Unknown dataType " + payload.dataType); - } + if (!data) { + if ("development" !== 'production') { + error("Unknown dataType " + payload.dataType); + } - return; - } + return; + } - toggleHighlight(data, payload, 'emphasis'); - }; - /** - * Downplay series or specified data item. - */ + toggleHighlight(data, payload, 'emphasis'); + }; + /** + * Downplay series or specified data item. + */ - ChartView.prototype.downplay = function (seriesModel, ecModel, api, payload) { - var data = seriesModel.getData(payload && payload.dataType); + ChartView.prototype.downplay = function (seriesModel, ecModel, api, payload) { + var data = seriesModel.getData(payload && payload.dataType); - if (!data) { - if ("development" !== 'production') { - error("Unknown dataType " + payload.dataType); - } + if (!data) { + if ("development" !== 'production') { + error("Unknown dataType " + payload.dataType); + } - return; - } + return; + } - toggleHighlight(data, payload, 'normal'); - }; - /** - * Remove self. - */ + toggleHighlight(data, payload, 'normal'); + }; + /** + * Remove self. + */ - ChartView.prototype.remove = function (ecModel, api) { - this.group.removeAll(); - }; - /** - * Dispose self. - */ + ChartView.prototype.remove = function (ecModel, api) { + this.group.removeAll(); + }; + /** + * Dispose self. + */ - ChartView.prototype.dispose = function (ecModel, api) {}; + ChartView.prototype.dispose = function (ecModel, api) {}; - ChartView.prototype.updateView = function (seriesModel, ecModel, api, payload) { - this.render(seriesModel, ecModel, api, payload); - }; // FIXME never used? + ChartView.prototype.updateView = function (seriesModel, ecModel, api, payload) { + this.render(seriesModel, ecModel, api, payload); + }; // FIXME never used? - ChartView.prototype.updateLayout = function (seriesModel, ecModel, api, payload) { - this.render(seriesModel, ecModel, api, payload); - }; // FIXME never used? + ChartView.prototype.updateLayout = function (seriesModel, ecModel, api, payload) { + this.render(seriesModel, ecModel, api, payload); + }; // FIXME never used? - ChartView.prototype.updateVisual = function (seriesModel, ecModel, api, payload) { - this.render(seriesModel, ecModel, api, payload); - }; - /** - * Traverse the new rendered elements. - * - * It will traverse the new added element in progressive rendering. - * And traverse all in normal rendering. - */ + ChartView.prototype.updateVisual = function (seriesModel, ecModel, api, payload) { + this.render(seriesModel, ecModel, api, payload); + }; + /** + * Traverse the new rendered elements. + * + * It will traverse the new added element in progressive rendering. + * And traverse all in normal rendering. + */ - ChartView.prototype.eachRendered = function (cb) { - traverseElements(this.group, cb); - }; + ChartView.prototype.eachRendered = function (cb) { + traverseElements(this.group, cb); + }; - ChartView.markUpdateMethod = function (payload, methodName) { - inner$2(payload).updateMethod = methodName; - }; + ChartView.markUpdateMethod = function (payload, methodName) { + inner$2(payload).updateMethod = methodName; + }; - ChartView.protoInitialize = function () { - var proto = ChartView.prototype; - proto.type = 'chart'; - }(); + ChartView.protoInitialize = function () { + var proto = ChartView.prototype; + proto.type = 'chart'; + }(); - return ChartView; - }(); + return ChartView; + }(); /** * Set state of single element */ function elSetState(el, state, highlightDigit) { - if (el && isHighDownDispatcher(el)) { - (state === 'emphasis' ? enterEmphasis : leaveEmphasis)(el, highlightDigit); - } + if (el && isHighDownDispatcher(el)) { + (state === 'emphasis' ? enterEmphasis : leaveEmphasis)(el, highlightDigit); + } } function toggleHighlight(data, payload, state) { - var dataIndex = queryDataIndex(data, payload); - var highlightDigit = payload && payload.highlightKey != null ? getHighlightDigit(payload.highlightKey) : null; + var dataIndex = queryDataIndex(data, payload); + var highlightDigit = payload && payload.highlightKey != null ? getHighlightDigit(payload.highlightKey) : null; - if (dataIndex != null) { - each(normalizeToArray(dataIndex), function (dataIdx) { - elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit); - }); - } else { - data.eachItemGraphicEl(function (el) { - elSetState(el, state, highlightDigit); - }); - } + if (dataIndex != null) { + each(normalizeToArray(dataIndex), function (dataIdx) { + elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit); + }); + } else { + data.eachItemGraphicEl(function (el) { + elSetState(el, state, highlightDigit); + }); + } } enableClassExtend(ChartView, ['dispose']); enableClassManagement(ChartView); function renderTaskPlan(context) { - return renderPlanner(context.model); + return renderPlanner(context.model); } function renderTaskReset(context) { - var seriesModel = context.model; - var ecModel = context.ecModel; - var api = context.api; - var payload = context.payload; // FIXME: remove updateView updateVisual + var seriesModel = context.model; + var ecModel = context.ecModel; + var api = context.api; + var payload = context.payload; // FIXME: remove updateView updateVisual - var progressiveRender = seriesModel.pipelineContext.progressiveRender; - var view = context.view; - var updateMethod = payload && inner$2(payload).updateMethod; - var methodName = progressiveRender ? 'incrementalPrepareRender' : updateMethod && view[updateMethod] ? updateMethod // `appendData` is also supported when data amount - // is less than progressive threshold. - : 'render'; + var progressiveRender = seriesModel.pipelineContext.progressiveRender; + var view = context.view; + var updateMethod = payload && inner$2(payload).updateMethod; + var methodName = progressiveRender ? 'incrementalPrepareRender' : updateMethod && view[updateMethod] ? updateMethod // `appendData` is also supported when data amount + // is less than progressive threshold. + : 'render'; - if (methodName !== 'render') { - view[methodName](seriesModel, ecModel, api, payload); - } + if (methodName !== 'render') { + view[methodName](seriesModel, ecModel, api, payload); + } - return progressMethodMap[methodName]; + return progressMethodMap[methodName]; } var progressMethodMap = { - incrementalPrepareRender: { - progress: function (params, context) { - context.view.incrementalRender(params, context.model, context.ecModel, context.api, context.payload); - } - }, - render: { - // Put view.render in `progress` to support appendData. But in this case - // view.render should not be called in reset, otherwise it will be called - // twise. Use `forceFirstProgress` to make sure that view.render is called - // in any cases. - forceFirstProgress: true, - progress: function (params, context) { - context.view.render(context.model, context.ecModel, context.api, context.payload); - } - } + incrementalPrepareRender: { + progress: function (params, context) { + context.view.incrementalRender(params, context.model, context.ecModel, context.api, context.payload); + } + }, + render: { + // Put view.render in `progress` to support appendData. But in this case + // view.render should not be called in reset, otherwise it will be called + // twise. Use `forceFirstProgress` to make sure that view.render is called + // in any cases. + forceFirstProgress: true, + progress: function (params, context) { + context.view.render(context.model, context.ecModel, context.api, context.payload); + } + } }; /* @@ -24873,79 +24873,79 @@ */ function throttle(fn, delay, debounce) { - var currCall; - var lastCall = 0; - var lastExec = 0; - var timer = null; - var diff; - var scope; - var args; - var debounceNextCall; - delay = delay || 0; - - function exec() { - lastExec = new Date().getTime(); - timer = null; - fn.apply(scope, args || []); - } - - var cb = function () { - var cbArgs = []; - - for (var _i = 0; _i < arguments.length; _i++) { - cbArgs[_i] = arguments[_i]; - } - - currCall = new Date().getTime(); - scope = this; - args = cbArgs; - var thisDelay = debounceNextCall || delay; - var thisDebounce = debounceNextCall || debounce; - debounceNextCall = null; - diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay; - clearTimeout(timer); // Here we should make sure that: the `exec` SHOULD NOT be called later - // than a new call of `cb`, that is, preserving the command order. Consider - // calculating "scale rate" when roaming as an example. When a call of `cb` - // happens, either the `exec` is called dierectly, or the call is delayed. - // But the delayed call should never be later than next call of `cb`. Under - // this assurance, we can simply update view state each time `dispatchAction` - // triggered by user roaming, but not need to add extra code to avoid the - // state being "rolled-back". - - if (thisDebounce) { - timer = setTimeout(exec, thisDelay); - } else { - if (diff >= 0) { - exec(); - } else { - timer = setTimeout(exec, -diff); - } - } + var currCall; + var lastCall = 0; + var lastExec = 0; + var timer = null; + var diff; + var scope; + var args; + var debounceNextCall; + delay = delay || 0; + + function exec() { + lastExec = new Date().getTime(); + timer = null; + fn.apply(scope, args || []); + } + + var cb = function () { + var cbArgs = []; - lastCall = currCall; - }; - /** - * Clear throttle. - * @public - */ + for (var _i = 0; _i < arguments.length; _i++) { + cbArgs[_i] = arguments[_i]; + } + + currCall = new Date().getTime(); + scope = this; + args = cbArgs; + var thisDelay = debounceNextCall || delay; + var thisDebounce = debounceNextCall || debounce; + debounceNextCall = null; + diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay; + clearTimeout(timer); // Here we should make sure that: the `exec` SHOULD NOT be called later + // than a new call of `cb`, that is, preserving the command order. Consider + // calculating "scale rate" when roaming as an example. When a call of `cb` + // happens, either the `exec` is called dierectly, or the call is delayed. + // But the delayed call should never be later than next call of `cb`. Under + // this assurance, we can simply update view state each time `dispatchAction` + // triggered by user roaming, but not need to add extra code to avoid the + // state being "rolled-back". + + if (thisDebounce) { + timer = setTimeout(exec, thisDelay); + } else { + if (diff >= 0) { + exec(); + } else { + timer = setTimeout(exec, -diff); + } + } + + lastCall = currCall; + }; + /** + * Clear throttle. + * @public + */ - cb.clear = function () { - if (timer) { - clearTimeout(timer); - timer = null; - } - }; - /** - * Enable debounce once. - */ + cb.clear = function () { + if (timer) { + clearTimeout(timer); + timer = null; + } + }; + /** + * Enable debounce once. + */ - cb.debounceNextCall = function (debounceDelay) { - debounceNextCall = debounceDelay; - }; + cb.debounceNextCall = function (debounceDelay) { + debounceNextCall = debounceDelay; + }; - return cb; + return cb; } /** * Create throttle method or update throttle rate. @@ -24970,228 +24970,228 @@ */ function createOrUpdate(obj, fnAttr, rate, throttleType) { - var fn = obj[fnAttr]; - - if (!fn) { - return; - } + var fn = obj[fnAttr]; - var originFn = fn[ORIGIN_METHOD] || fn; - var lastThrottleType = fn[THROTTLE_TYPE]; - var lastRate = fn[RATE]; + if (!fn) { + return; + } - if (lastRate !== rate || lastThrottleType !== throttleType) { - if (rate == null || !throttleType) { - return obj[fnAttr] = originFn; - } + var originFn = fn[ORIGIN_METHOD] || fn; + var lastThrottleType = fn[THROTTLE_TYPE]; + var lastRate = fn[RATE]; - fn = obj[fnAttr] = throttle(originFn, rate, throttleType === 'debounce'); - fn[ORIGIN_METHOD] = originFn; - fn[THROTTLE_TYPE] = throttleType; - fn[RATE] = rate; + if (lastRate !== rate || lastThrottleType !== throttleType) { + if (rate == null || !throttleType) { + return obj[fnAttr] = originFn; } - return fn; + fn = obj[fnAttr] = throttle(originFn, rate, throttleType === 'debounce'); + fn[ORIGIN_METHOD] = originFn; + fn[THROTTLE_TYPE] = throttleType; + fn[RATE] = rate; + } + + return fn; } /** * Clear throttle. Example see throttle.createOrUpdate. */ function clear(obj, fnAttr) { - var fn = obj[fnAttr]; + var fn = obj[fnAttr]; - if (fn && fn[ORIGIN_METHOD]) { - // Clear throttle - fn.clear && fn.clear(); - obj[fnAttr] = fn[ORIGIN_METHOD]; - } + if (fn && fn[ORIGIN_METHOD]) { + // Clear throttle + fn.clear && fn.clear(); + obj[fnAttr] = fn[ORIGIN_METHOD]; + } } var inner$3 = makeInner(); var defaultStyleMappers = { - itemStyle: makeStyleMapper(ITEM_STYLE_KEY_MAP, true), - lineStyle: makeStyleMapper(LINE_STYLE_KEY_MAP, true) + itemStyle: makeStyleMapper(ITEM_STYLE_KEY_MAP, true), + lineStyle: makeStyleMapper(LINE_STYLE_KEY_MAP, true) }; var defaultColorKey = { - lineStyle: 'stroke', - itemStyle: 'fill' + lineStyle: 'stroke', + itemStyle: 'fill' }; function getStyleMapper(seriesModel, stylePath) { - var styleMapper = seriesModel.visualStyleMapper || defaultStyleMappers[stylePath]; + var styleMapper = seriesModel.visualStyleMapper || defaultStyleMappers[stylePath]; - if (!styleMapper) { - console.warn("Unkown style type '" + stylePath + "'."); - return defaultStyleMappers.itemStyle; - } + if (!styleMapper) { + console.warn("Unkown style type '" + stylePath + "'."); + return defaultStyleMappers.itemStyle; + } - return styleMapper; + return styleMapper; } function getDefaultColorKey(seriesModel, stylePath) { - // return defaultColorKey[stylePath] || - var colorKey = seriesModel.visualDrawType || defaultColorKey[stylePath]; + // return defaultColorKey[stylePath] || + var colorKey = seriesModel.visualDrawType || defaultColorKey[stylePath]; - if (!colorKey) { - console.warn("Unkown style type '" + stylePath + "'."); - return 'fill'; - } + if (!colorKey) { + console.warn("Unkown style type '" + stylePath + "'."); + return 'fill'; + } - return colorKey; + return colorKey; } var seriesStyleTask = { - createOnAllSeries: true, - performRawSeries: true, - reset: function (seriesModel, ecModel) { - var data = seriesModel.getData(); - var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle'; // Set in itemStyle + createOnAllSeries: true, + performRawSeries: true, + reset: function (seriesModel, ecModel) { + var data = seriesModel.getData(); + var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle'; // Set in itemStyle - var styleModel = seriesModel.getModel(stylePath); - var getStyle = getStyleMapper(seriesModel, stylePath); - var globalStyle = getStyle(styleModel); - var decalOption = styleModel.getShallow('decal'); + var styleModel = seriesModel.getModel(stylePath); + var getStyle = getStyleMapper(seriesModel, stylePath); + var globalStyle = getStyle(styleModel); + var decalOption = styleModel.getShallow('decal'); - if (decalOption) { - data.setVisual('decal', decalOption); - decalOption.dirty = true; - } // TODO + if (decalOption) { + data.setVisual('decal', decalOption); + decalOption.dirty = true; + } // TODO - var colorKey = getDefaultColorKey(seriesModel, stylePath); - var color = globalStyle[colorKey]; // TODO style callback + var colorKey = getDefaultColorKey(seriesModel, stylePath); + var color = globalStyle[colorKey]; // TODO style callback - var colorCallback = isFunction(color) ? color : null; - var hasAutoColor = globalStyle.fill === 'auto' || globalStyle.stroke === 'auto'; // Get from color palette by default. + var colorCallback = isFunction(color) ? color : null; + var hasAutoColor = globalStyle.fill === 'auto' || globalStyle.stroke === 'auto'; // Get from color palette by default. - if (!globalStyle[colorKey] || colorCallback || hasAutoColor) { - // Note: if some series has color specified (e.g., by itemStyle.color), we DO NOT - // make it effect palette. Bacause some scenarios users need to make some series - // transparent or as background, which should better not effect the palette. - var colorPalette = seriesModel.getColorFromPalette( // TODO series count changed. - seriesModel.name, null, ecModel.getSeriesCount()); + if (!globalStyle[colorKey] || colorCallback || hasAutoColor) { + // Note: if some series has color specified (e.g., by itemStyle.color), we DO NOT + // make it effect palette. Bacause some scenarios users need to make some series + // transparent or as background, which should better not effect the palette. + var colorPalette = seriesModel.getColorFromPalette( // TODO series count changed. + seriesModel.name, null, ecModel.getSeriesCount()); - if (!globalStyle[colorKey]) { - globalStyle[colorKey] = colorPalette; - data.setVisual('colorFromPalette', true); - } + if (!globalStyle[colorKey]) { + globalStyle[colorKey] = colorPalette; + data.setVisual('colorFromPalette', true); + } - globalStyle.fill = globalStyle.fill === 'auto' || isFunction(globalStyle.fill) ? colorPalette : globalStyle.fill; - globalStyle.stroke = globalStyle.stroke === 'auto' || isFunction(globalStyle.stroke) ? colorPalette : globalStyle.stroke; - } + globalStyle.fill = globalStyle.fill === 'auto' || isFunction(globalStyle.fill) ? colorPalette : globalStyle.fill; + globalStyle.stroke = globalStyle.stroke === 'auto' || isFunction(globalStyle.stroke) ? colorPalette : globalStyle.stroke; + } - data.setVisual('style', globalStyle); - data.setVisual('drawType', colorKey); // Only visible series has each data be visual encoded + data.setVisual('style', globalStyle); + data.setVisual('drawType', colorKey); // Only visible series has each data be visual encoded - if (!ecModel.isSeriesFiltered(seriesModel) && colorCallback) { - data.setVisual('colorFromPalette', false); - return { - dataEach: function (data, idx) { - var dataParams = seriesModel.getDataParams(idx); - var itemStyle = extend({}, globalStyle); - itemStyle[colorKey] = colorCallback(dataParams); - data.setItemVisual(idx, 'style', itemStyle); - } - }; + if (!ecModel.isSeriesFiltered(seriesModel) && colorCallback) { + data.setVisual('colorFromPalette', false); + return { + dataEach: function (data, idx) { + var dataParams = seriesModel.getDataParams(idx); + var itemStyle = extend({}, globalStyle); + itemStyle[colorKey] = colorCallback(dataParams); + data.setItemVisual(idx, 'style', itemStyle); } + }; } + } }; var sharedModel = new Model(); var dataStyleTask = { - createOnAllSeries: true, - performRawSeries: true, - reset: function (seriesModel, ecModel) { - if (seriesModel.ignoreStyleOnData || ecModel.isSeriesFiltered(seriesModel)) { - return; - } + createOnAllSeries: true, + performRawSeries: true, + reset: function (seriesModel, ecModel) { + if (seriesModel.ignoreStyleOnData || ecModel.isSeriesFiltered(seriesModel)) { + return; + } - var data = seriesModel.getData(); - var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle'; // Set in itemStyle + var data = seriesModel.getData(); + var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle'; // Set in itemStyle - var getStyle = getStyleMapper(seriesModel, stylePath); - var colorKey = data.getVisual('drawType'); - return { - dataEach: data.hasItemOption ? function (data, idx) { - // Not use getItemModel for performance considuration - var rawItem = data.getRawDataItem(idx); - - if (rawItem && rawItem[stylePath]) { - sharedModel.option = rawItem[stylePath]; - var style = getStyle(sharedModel); - var existsStyle = data.ensureUniqueItemVisual(idx, 'style'); - extend(existsStyle, style); - - if (sharedModel.option.decal) { - data.setItemVisual(idx, 'decal', sharedModel.option.decal); - sharedModel.option.decal.dirty = true; - } + var getStyle = getStyleMapper(seriesModel, stylePath); + var colorKey = data.getVisual('drawType'); + return { + dataEach: data.hasItemOption ? function (data, idx) { + // Not use getItemModel for performance considuration + var rawItem = data.getRawDataItem(idx); - if (colorKey in style) { - data.setItemVisual(idx, 'colorFromPalette', false); - } - } - } : null - }; - } + if (rawItem && rawItem[stylePath]) { + sharedModel.option = rawItem[stylePath]; + var style = getStyle(sharedModel); + var existsStyle = data.ensureUniqueItemVisual(idx, 'style'); + extend(existsStyle, style); + + if (sharedModel.option.decal) { + data.setItemVisual(idx, 'decal', sharedModel.option.decal); + sharedModel.option.decal.dirty = true; + } + + if (colorKey in style) { + data.setItemVisual(idx, 'colorFromPalette', false); + } + } + } : null + }; + } }; // Pick color from palette for the data which has not been set with color yet. // Note: do not support stream rendering. No such cases yet. var dataColorPaletteTask = { - performRawSeries: true, - overallReset: function (ecModel) { - // Each type of series use one scope. - // Pie and funnel are using diferrent scopes - var paletteScopeGroupByType = createHashMap(); - ecModel.eachSeries(function (seriesModel) { - var colorBy = seriesModel.getColorBy(); - - if (seriesModel.isColorBySeries()) { - return; - } + performRawSeries: true, + overallReset: function (ecModel) { + // Each type of series use one scope. + // Pie and funnel are using diferrent scopes + var paletteScopeGroupByType = createHashMap(); + ecModel.eachSeries(function (seriesModel) { + var colorBy = seriesModel.getColorBy(); - var key = seriesModel.type + '-' + colorBy; - var colorScope = paletteScopeGroupByType.get(key); + if (seriesModel.isColorBySeries()) { + return; + } - if (!colorScope) { - colorScope = {}; - paletteScopeGroupByType.set(key, colorScope); - } + var key = seriesModel.type + '-' + colorBy; + var colorScope = paletteScopeGroupByType.get(key); - inner$3(seriesModel).scope = colorScope; - }); - ecModel.eachSeries(function (seriesModel) { - if (seriesModel.isColorBySeries() || ecModel.isSeriesFiltered(seriesModel)) { - return; - } + if (!colorScope) { + colorScope = {}; + paletteScopeGroupByType.set(key, colorScope); + } - var dataAll = seriesModel.getRawData(); - var idxMap = {}; - var data = seriesModel.getData(); - var colorScope = inner$3(seriesModel).scope; - var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle'; - var colorKey = getDefaultColorKey(seriesModel, stylePath); - data.each(function (idx) { - var rawIdx = data.getRawIndex(idx); - idxMap[rawIdx] = idx; - }); // Iterate on data before filtered. To make sure color from palette can be - // Consistent when toggling legend. - - dataAll.each(function (rawIdx) { - var idx = idxMap[rawIdx]; - var fromPalette = data.getItemVisual(idx, 'colorFromPalette'); // Get color from palette for each data only when the color is inherited from series color, which is - // also picked from color palette. So following situation is not in the case: - // 1. series.itemStyle.color is set - // 2. color is encoded by visualMap - - if (fromPalette) { - var itemStyle = data.ensureUniqueItemVisual(idx, 'style'); - var name_1 = dataAll.getName(rawIdx) || rawIdx + ''; - var dataCount = dataAll.count(); - itemStyle[colorKey] = seriesModel.getColorFromPalette(name_1, colorScope, dataCount); - } - }); - }); - } + inner$3(seriesModel).scope = colorScope; + }); + ecModel.eachSeries(function (seriesModel) { + if (seriesModel.isColorBySeries() || ecModel.isSeriesFiltered(seriesModel)) { + return; + } + + var dataAll = seriesModel.getRawData(); + var idxMap = {}; + var data = seriesModel.getData(); + var colorScope = inner$3(seriesModel).scope; + var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle'; + var colorKey = getDefaultColorKey(seriesModel, stylePath); + data.each(function (idx) { + var rawIdx = data.getRawIndex(idx); + idxMap[rawIdx] = idx; + }); // Iterate on data before filtered. To make sure color from palette can be + // Consistent when toggling legend. + + dataAll.each(function (rawIdx) { + var idx = idxMap[rawIdx]; + var fromPalette = data.getItemVisual(idx, 'colorFromPalette'); // Get color from palette for each data only when the color is inherited from series color, which is + // also picked from color palette. So following situation is not in the case: + // 1. series.itemStyle.color is set + // 2. color is encoded by visualMap + + if (fromPalette) { + var itemStyle = data.ensureUniqueItemVisual(idx, 'style'); + var name_1 = dataAll.getName(rawIdx) || rawIdx + ''; + var dataCount = dataAll.count(); + itemStyle[colorKey] = seriesModel.getColorFromPalette(name_1, colorScope, dataCount); + } + }); + }); + } }; var PI$3 = Math.PI; @@ -25205,588 +25205,588 @@ */ function defaultLoading(api, opts) { - opts = opts || {}; - defaults(opts, { - text: 'loading', - textColor: '#000', - fontSize: 12, - fontWeight: 'normal', - fontStyle: 'normal', - fontFamily: 'sans-serif', - maskColor: 'rgba(255, 255, 255, 0.8)', - showSpinner: true, - color: '#5470c6', - spinnerRadius: 10, - lineWidth: 5, - zlevel: 0 + opts = opts || {}; + defaults(opts, { + text: 'loading', + textColor: '#000', + fontSize: 12, + fontWeight: 'normal', + fontStyle: 'normal', + fontFamily: 'sans-serif', + maskColor: 'rgba(255, 255, 255, 0.8)', + showSpinner: true, + color: '#5470c6', + spinnerRadius: 10, + lineWidth: 5, + zlevel: 0 + }); + var group = new Group(); + var mask = new Rect({ + style: { + fill: opts.maskColor + }, + zlevel: opts.zlevel, + z: 10000 + }); + group.add(mask); + var textContent = new ZRText({ + style: { + text: opts.text, + fill: opts.textColor, + fontSize: opts.fontSize, + fontWeight: opts.fontWeight, + fontStyle: opts.fontStyle, + fontFamily: opts.fontFamily + }, + zlevel: opts.zlevel, + z: 10001 + }); + var labelRect = new Rect({ + style: { + fill: 'none' + }, + textContent: textContent, + textConfig: { + position: 'right', + distance: 10 + }, + zlevel: opts.zlevel, + z: 10001 + }); + group.add(labelRect); + var arc; + + if (opts.showSpinner) { + arc = new Arc({ + shape: { + startAngle: -PI$3 / 2, + endAngle: -PI$3 / 2 + 0.1, + r: opts.spinnerRadius + }, + style: { + stroke: opts.color, + lineCap: 'round', + lineWidth: opts.lineWidth + }, + zlevel: opts.zlevel, + z: 10001 }); - var group = new Group(); - var mask = new Rect({ - style: { - fill: opts.maskColor - }, - zlevel: opts.zlevel, - z: 10000 + arc.animateShape(true).when(1000, { + endAngle: PI$3 * 3 / 2 + }).start('circularInOut'); + arc.animateShape(true).when(1000, { + startAngle: PI$3 * 3 / 2 + }).delay(300).start('circularInOut'); + group.add(arc); + } // Inject resize + + + group.resize = function () { + var textWidth = textContent.getBoundingRect().width; + var r = opts.showSpinner ? opts.spinnerRadius : 0; // cx = (containerWidth - arcDiameter - textDistance - textWidth) / 2 + // textDistance needs to be calculated when both animation and text exist + + var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2 - (opts.showSpinner && textWidth ? 0 : 5 + textWidth / 2) // only show the text + + (opts.showSpinner ? 0 : textWidth / 2) // only show the spinner + + (textWidth ? 0 : r); + var cy = api.getHeight() / 2; + opts.showSpinner && arc.setShape({ + cx: cx, + cy: cy }); - group.add(mask); - var textContent = new ZRText({ - style: { - text: opts.text, - fill: opts.textColor, - fontSize: opts.fontSize, - fontWeight: opts.fontWeight, - fontStyle: opts.fontStyle, - fontFamily: opts.fontFamily - }, - zlevel: opts.zlevel, - z: 10001 + labelRect.setShape({ + x: cx - r, + y: cy - r, + width: r * 2, + height: r * 2 }); - var labelRect = new Rect({ - style: { - fill: 'none' - }, - textContent: textContent, - textConfig: { - position: 'right', - distance: 10 - }, - zlevel: opts.zlevel, - z: 10001 + mask.setShape({ + x: 0, + y: 0, + width: api.getWidth(), + height: api.getHeight() }); - group.add(labelRect); - var arc; - - if (opts.showSpinner) { - arc = new Arc({ - shape: { - startAngle: -PI$3 / 2, - endAngle: -PI$3 / 2 + 0.1, - r: opts.spinnerRadius - }, - style: { - stroke: opts.color, - lineCap: 'round', - lineWidth: opts.lineWidth - }, - zlevel: opts.zlevel, - z: 10001 - }); - arc.animateShape(true).when(1000, { - endAngle: PI$3 * 3 / 2 - }).start('circularInOut'); - arc.animateShape(true).when(1000, { - startAngle: PI$3 * 3 / 2 - }).delay(300).start('circularInOut'); - group.add(arc); - } // Inject resize - - - group.resize = function () { - var textWidth = textContent.getBoundingRect().width; - var r = opts.showSpinner ? opts.spinnerRadius : 0; // cx = (containerWidth - arcDiameter - textDistance - textWidth) / 2 - // textDistance needs to be calculated when both animation and text exist - - var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2 - (opts.showSpinner && textWidth ? 0 : 5 + textWidth / 2) // only show the text - + (opts.showSpinner ? 0 : textWidth / 2) // only show the spinner - + (textWidth ? 0 : r); - var cy = api.getHeight() / 2; - opts.showSpinner && arc.setShape({ - cx: cx, - cy: cy - }); - labelRect.setShape({ - x: cx - r, - y: cy - r, - width: r * 2, - height: r * 2 - }); - mask.setShape({ - x: 0, - y: 0, - width: api.getWidth(), - height: api.getHeight() - }); - }; + }; - group.resize(); - return group; + group.resize(); + return group; } var Scheduler = - /** @class */ - function () { - function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) { - // key: handlerUID - this._stageTaskMap = createHashMap(); - this.ecInstance = ecInstance; - this.api = api; // Fix current processors in case that in some rear cases that - // processors might be registered after echarts instance created. - // Register processors incrementally for a echarts instance is - // not supported by this stream architecture. - - dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice(); - visualHandlers = this._visualHandlers = visualHandlers.slice(); - this._allHandlers = dataProcessorHandlers.concat(visualHandlers); - } - - Scheduler.prototype.restoreData = function (ecModel, payload) { - // TODO: Only restore needed series and components, but not all components. - // Currently `restoreData` of all of the series and component will be called. - // But some independent components like `title`, `legend`, `graphic`, `toolbox`, - // `tooltip`, `axisPointer`, etc, do not need series refresh when `setOption`, - // and some components like coordinate system, axes, dataZoom, visualMap only - // need their target series refresh. - // (1) If we are implementing this feature some day, we should consider these cases: - // if a data processor depends on a component (e.g., dataZoomProcessor depends - // on the settings of `dataZoom`), it should be re-performed if the component - // is modified by `setOption`. - // (2) If a processor depends on sevral series, speicified by its `getTargetSeries`, - // it should be re-performed when the result array of `getTargetSeries` changed. - // We use `dependencies` to cover these issues. - // (3) How to update target series when coordinate system related components modified. - // TODO: simply the dirty mechanism? Check whether only the case here can set tasks dirty, - // and this case all of the tasks will be set as dirty. - ecModel.restoreData(payload); // Theoretically an overall task not only depends on each of its target series, but also - // depends on all of the series. - // The overall task is not in pipeline, and `ecModel.restoreData` only set pipeline tasks - // dirty. If `getTargetSeries` of an overall task returns nothing, we should also ensure - // that the overall task is set as dirty and to be performed, otherwise it probably cause - // state chaos. So we have to set dirty of all of the overall tasks manually, otherwise it - // probably cause state chaos (consider `dataZoomProcessor`). - - this._stageTaskMap.each(function (taskRecord) { - var overallTask = taskRecord.overallTask; - overallTask && overallTask.dirty(); - }); - }; // If seriesModel provided, incremental threshold is check by series data. + /** @class */ + function () { + function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) { + // key: handlerUID + this._stageTaskMap = createHashMap(); + this.ecInstance = ecInstance; + this.api = api; // Fix current processors in case that in some rear cases that + // processors might be registered after echarts instance created. + // Register processors incrementally for a echarts instance is + // not supported by this stream architecture. + + dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice(); + visualHandlers = this._visualHandlers = visualHandlers.slice(); + this._allHandlers = dataProcessorHandlers.concat(visualHandlers); + } + + Scheduler.prototype.restoreData = function (ecModel, payload) { + // TODO: Only restore needed series and components, but not all components. + // Currently `restoreData` of all of the series and component will be called. + // But some independent components like `title`, `legend`, `graphic`, `toolbox`, + // `tooltip`, `axisPointer`, etc, do not need series refresh when `setOption`, + // and some components like coordinate system, axes, dataZoom, visualMap only + // need their target series refresh. + // (1) If we are implementing this feature some day, we should consider these cases: + // if a data processor depends on a component (e.g., dataZoomProcessor depends + // on the settings of `dataZoom`), it should be re-performed if the component + // is modified by `setOption`. + // (2) If a processor depends on sevral series, speicified by its `getTargetSeries`, + // it should be re-performed when the result array of `getTargetSeries` changed. + // We use `dependencies` to cover these issues. + // (3) How to update target series when coordinate system related components modified. + // TODO: simply the dirty mechanism? Check whether only the case here can set tasks dirty, + // and this case all of the tasks will be set as dirty. + ecModel.restoreData(payload); // Theoretically an overall task not only depends on each of its target series, but also + // depends on all of the series. + // The overall task is not in pipeline, and `ecModel.restoreData` only set pipeline tasks + // dirty. If `getTargetSeries` of an overall task returns nothing, we should also ensure + // that the overall task is set as dirty and to be performed, otherwise it probably cause + // state chaos. So we have to set dirty of all of the overall tasks manually, otherwise it + // probably cause state chaos (consider `dataZoomProcessor`). + + this._stageTaskMap.each(function (taskRecord) { + var overallTask = taskRecord.overallTask; + overallTask && overallTask.dirty(); + }); + }; // If seriesModel provided, incremental threshold is check by series data. - Scheduler.prototype.getPerformArgs = function (task, isBlock) { - // For overall task - if (!task.__pipeline) { - return; - } + Scheduler.prototype.getPerformArgs = function (task, isBlock) { + // For overall task + if (!task.__pipeline) { + return; + } - var pipeline = this._pipelineMap.get(task.__pipeline.id); + var pipeline = this._pipelineMap.get(task.__pipeline.id); - var pCtx = pipeline.context; - var incremental = !isBlock && pipeline.progressiveEnabled && (!pCtx || pCtx.progressiveRender) && task.__idxInPipeline > pipeline.blockIndex; - var step = incremental ? pipeline.step : null; - var modDataCount = pCtx && pCtx.modDataCount; - var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null; - return { - step: step, - modBy: modBy, - modDataCount: modDataCount - }; - }; + var pCtx = pipeline.context; + var incremental = !isBlock && pipeline.progressiveEnabled && (!pCtx || pCtx.progressiveRender) && task.__idxInPipeline > pipeline.blockIndex; + var step = incremental ? pipeline.step : null; + var modDataCount = pCtx && pCtx.modDataCount; + var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null; + return { + step: step, + modBy: modBy, + modDataCount: modDataCount + }; + }; + + Scheduler.prototype.getPipeline = function (pipelineId) { + return this._pipelineMap.get(pipelineId); + }; + /** + * Current, progressive rendering starts from visual and layout. + * Always detect render mode in the same stage, avoiding that incorrect + * detection caused by data filtering. + * Caution: + * `updateStreamModes` use `seriesModel.getData()`. + */ - Scheduler.prototype.getPipeline = function (pipelineId) { - return this._pipelineMap.get(pipelineId); - }; - /** - * Current, progressive rendering starts from visual and layout. - * Always detect render mode in the same stage, avoiding that incorrect - * detection caused by data filtering. - * Caution: - * `updateStreamModes` use `seriesModel.getData()`. - */ + Scheduler.prototype.updateStreamModes = function (seriesModel, view) { + var pipeline = this._pipelineMap.get(seriesModel.uid); - Scheduler.prototype.updateStreamModes = function (seriesModel, view) { - var pipeline = this._pipelineMap.get(seriesModel.uid); + var data = seriesModel.getData(); + var dataLen = data.count(); // `progressiveRender` means that can render progressively in each + // animation frame. Note that some types of series do not provide + // `view.incrementalPrepareRender` but support `chart.appendData`. We + // use the term `incremental` but not `progressive` to describe the + // case that `chart.appendData`. + + var progressiveRender = pipeline.progressiveEnabled && view.incrementalPrepareRender && dataLen >= pipeline.threshold; + var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold'); // TODO: modDataCount should not updated if `appendData`, otherwise cause whole repaint. + // see `test/candlestick-large3.html` + + var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null; + seriesModel.pipelineContext = pipeline.context = { + progressiveRender: progressiveRender, + modDataCount: modDataCount, + large: large + }; + }; + + Scheduler.prototype.restorePipelines = function (ecModel) { + var scheduler = this; + var pipelineMap = scheduler._pipelineMap = createHashMap(); + ecModel.eachSeries(function (seriesModel) { + var progressive = seriesModel.getProgressive(); + var pipelineId = seriesModel.uid; + pipelineMap.set(pipelineId, { + id: pipelineId, + head: null, + tail: null, + threshold: seriesModel.getProgressiveThreshold(), + progressiveEnabled: progressive && !(seriesModel.preventIncremental && seriesModel.preventIncremental()), + blockIndex: -1, + step: Math.round(progressive || 700), + count: 0 + }); - var data = seriesModel.getData(); - var dataLen = data.count(); // `progressiveRender` means that can render progressively in each - // animation frame. Note that some types of series do not provide - // `view.incrementalPrepareRender` but support `chart.appendData`. We - // use the term `incremental` but not `progressive` to describe the - // case that `chart.appendData`. + scheduler._pipe(seriesModel, seriesModel.dataTask); + }); + }; + + Scheduler.prototype.prepareStageTasks = function () { + var stageTaskMap = this._stageTaskMap; + var ecModel = this.api.getModel(); + var api = this.api; + each(this._allHandlers, function (handler) { + var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {}); + var errMsg = ''; + + if ("development" !== 'production') { + // Currently do not need to support to sepecify them both. + errMsg = '"reset" and "overallReset" must not be both specified.'; + } + + assert(!(handler.reset && handler.overallReset), errMsg); + handler.reset && this._createSeriesStageTask(handler, record, ecModel, api); + handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api); + }, this); + }; + + Scheduler.prototype.prepareView = function (view, model, ecModel, api) { + var renderTask = view.renderTask; + var context = renderTask.context; + context.model = model; + context.ecModel = ecModel; + context.api = api; + renderTask.__block = !view.incrementalPrepareRender; + + this._pipe(model, renderTask); + }; + + Scheduler.prototype.performDataProcessorTasks = function (ecModel, payload) { + // If we do not use `block` here, it should be considered when to update modes. + this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, { + block: true + }); + }; - var progressiveRender = pipeline.progressiveEnabled && view.incrementalPrepareRender && dataLen >= pipeline.threshold; - var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold'); // TODO: modDataCount should not updated if `appendData`, otherwise cause whole repaint. - // see `test/candlestick-large3.html` + Scheduler.prototype.performVisualTasks = function (ecModel, payload, opt) { + this._performStageTasks(this._visualHandlers, ecModel, payload, opt); + }; - var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null; - seriesModel.pipelineContext = pipeline.context = { - progressiveRender: progressiveRender, - modDataCount: modDataCount, - large: large - }; - }; + Scheduler.prototype._performStageTasks = function (stageHandlers, ecModel, payload, opt) { + opt = opt || {}; + var unfinished = false; + var scheduler = this; + each(stageHandlers, function (stageHandler, idx) { + if (opt.visualType && opt.visualType !== stageHandler.visualType) { + return; + } - Scheduler.prototype.restorePipelines = function (ecModel) { - var scheduler = this; - var pipelineMap = scheduler._pipelineMap = createHashMap(); - ecModel.eachSeries(function (seriesModel) { - var progressive = seriesModel.getProgressive(); - var pipelineId = seriesModel.uid; - pipelineMap.set(pipelineId, { - id: pipelineId, - head: null, - tail: null, - threshold: seriesModel.getProgressiveThreshold(), - progressiveEnabled: progressive && !(seriesModel.preventIncremental && seriesModel.preventIncremental()), - blockIndex: -1, - step: Math.round(progressive || 700), - count: 0 - }); + var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid); - scheduler._pipe(seriesModel, seriesModel.dataTask); - }); - }; + var seriesTaskMap = stageHandlerRecord.seriesTaskMap; + var overallTask = stageHandlerRecord.overallTask; - Scheduler.prototype.prepareStageTasks = function () { - var stageTaskMap = this._stageTaskMap; - var ecModel = this.api.getModel(); - var api = this.api; - each(this._allHandlers, function (handler) { - var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {}); - var errMsg = ''; - - if ("development" !== 'production') { - // Currently do not need to support to sepecify them both. - errMsg = '"reset" and "overallReset" must not be both specified.'; - } + if (overallTask) { + var overallNeedDirty_1; + var agentStubMap = overallTask.agentStubMap; + agentStubMap.each(function (stub) { + if (needSetDirty(opt, stub)) { + stub.dirty(); + overallNeedDirty_1 = true; + } + }); + overallNeedDirty_1 && overallTask.dirty(); + scheduler.updatePayload(overallTask, payload); + var performArgs_1 = scheduler.getPerformArgs(overallTask, opt.block); // Execute stubs firstly, which may set the overall task dirty, + // then execute the overall task. And stub will call seriesModel.setData, + // which ensures that in the overallTask seriesModel.getData() will not + // return incorrect data. + + agentStubMap.each(function (stub) { + stub.perform(performArgs_1); + }); - assert(!(handler.reset && handler.overallReset), errMsg); - handler.reset && this._createSeriesStageTask(handler, record, ecModel, api); - handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api); - }, this); - }; + if (overallTask.perform(performArgs_1)) { + unfinished = true; + } + } else if (seriesTaskMap) { + seriesTaskMap.each(function (task, pipelineId) { + if (needSetDirty(opt, task)) { + task.dirty(); + } + + var performArgs = scheduler.getPerformArgs(task, opt.block); // FIXME + // if intending to decalare `performRawSeries` in handlers, only + // stream-independent (specifically, data item independent) operations can be + // performed. Because is a series is filtered, most of the tasks will not + // be performed. A stream-dependent operation probably cause wrong biz logic. + // Perhaps we should not provide a separate callback for this case instead + // of providing the config `performRawSeries`. The stream-dependent operaions + // and stream-independent operations should better not be mixed. + + performArgs.skip = !stageHandler.performRawSeries && ecModel.isSeriesFiltered(task.context.model); + scheduler.updatePayload(task, payload); + + if (task.perform(performArgs)) { + unfinished = true; + } + }); + } + }); - Scheduler.prototype.prepareView = function (view, model, ecModel, api) { - var renderTask = view.renderTask; - var context = renderTask.context; - context.model = model; - context.ecModel = ecModel; - context.api = api; - renderTask.__block = !view.incrementalPrepareRender; + function needSetDirty(opt, task) { + return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id)); + } - this._pipe(model, renderTask); - }; + this.unfinished = unfinished || this.unfinished; + }; - Scheduler.prototype.performDataProcessorTasks = function (ecModel, payload) { - // If we do not use `block` here, it should be considered when to update modes. - this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, { - block: true - }); - }; + Scheduler.prototype.performSeriesTasks = function (ecModel) { + var unfinished; + ecModel.eachSeries(function (seriesModel) { + // Progress to the end for dataInit and dataRestore. + unfinished = seriesModel.dataTask.perform() || unfinished; + }); + this.unfinished = unfinished || this.unfinished; + }; - Scheduler.prototype.performVisualTasks = function (ecModel, payload, opt) { - this._performStageTasks(this._visualHandlers, ecModel, payload, opt); - }; + Scheduler.prototype.plan = function () { + // Travel pipelines, check block. + this._pipelineMap.each(function (pipeline) { + var task = pipeline.tail; - Scheduler.prototype._performStageTasks = function (stageHandlers, ecModel, payload, opt) { - opt = opt || {}; - var unfinished = false; - var scheduler = this; - each(stageHandlers, function (stageHandler, idx) { - if (opt.visualType && opt.visualType !== stageHandler.visualType) { - return; - } + do { + if (task.__block) { + pipeline.blockIndex = task.__idxInPipeline; + break; + } - var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid); + task = task.getUpstream(); + } while (task); + }); + }; + + Scheduler.prototype.updatePayload = function (task, payload) { + payload !== 'remain' && (task.context.payload = payload); + }; + + Scheduler.prototype._createSeriesStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) { + var scheduler = this; + var oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap; // The count of stages are totally about only several dozen, so + // do not need to reuse the map. + + var newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap(); + var seriesType = stageHandler.seriesType; + var getTargetSeries = stageHandler.getTargetSeries; // If a stageHandler should cover all series, `createOnAllSeries` should be declared mandatorily, + // to avoid some typo or abuse. Otherwise if an extension do not specify a `seriesType`, + // it works but it may cause other irrelevant charts blocked. + + if (stageHandler.createOnAllSeries) { + ecModel.eachRawSeries(create); + } else if (seriesType) { + ecModel.eachRawSeriesByType(seriesType, create); + } else if (getTargetSeries) { + getTargetSeries(ecModel, api).each(create); + } + + function create(seriesModel) { + var pipelineId = seriesModel.uid; // Init tasks for each seriesModel only once. + // Reuse original task instance. + + var task = newSeriesTaskMap.set(pipelineId, oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId) || createTask({ + plan: seriesTaskPlan, + reset: seriesTaskReset, + count: seriesTaskCount + })); + task.context = { + model: seriesModel, + ecModel: ecModel, + api: api, + // PENDING: `useClearVisual` not used? + useClearVisual: stageHandler.isVisual && !stageHandler.isLayout, + plan: stageHandler.plan, + reset: stageHandler.reset, + scheduler: scheduler + }; + + scheduler._pipe(seriesModel, task); + } + }; + + Scheduler.prototype._createOverallStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) { + var scheduler = this; + var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask // For overall task, the function only be called on reset stage. + || createTask({ + reset: overallTaskReset + }); + overallTask.context = { + ecModel: ecModel, + api: api, + overallReset: stageHandler.overallReset, + scheduler: scheduler + }; + var oldAgentStubMap = overallTask.agentStubMap; // The count of stages are totally about only several dozen, so + // do not need to reuse the map. + + var newAgentStubMap = overallTask.agentStubMap = createHashMap(); + var seriesType = stageHandler.seriesType; + var getTargetSeries = stageHandler.getTargetSeries; + var overallProgress = true; + var shouldOverallTaskDirty = false; // FIXME:TS never used, so comment it + // let modifyOutputEnd = stageHandler.modifyOutputEnd; + // An overall task with seriesType detected or has `getTargetSeries`, we add + // stub in each pipelines, it will set the overall task dirty when the pipeline + // progress. Moreover, to avoid call the overall task each frame (too frequent), + // we set the pipeline block. - var seriesTaskMap = stageHandlerRecord.seriesTaskMap; - var overallTask = stageHandlerRecord.overallTask; + var errMsg = ''; - if (overallTask) { - var overallNeedDirty_1; - var agentStubMap = overallTask.agentStubMap; - agentStubMap.each(function (stub) { - if (needSetDirty(opt, stub)) { - stub.dirty(); - overallNeedDirty_1 = true; - } - }); - overallNeedDirty_1 && overallTask.dirty(); - scheduler.updatePayload(overallTask, payload); - var performArgs_1 = scheduler.getPerformArgs(overallTask, opt.block); // Execute stubs firstly, which may set the overall task dirty, - // then execute the overall task. And stub will call seriesModel.setData, - // which ensures that in the overallTask seriesModel.getData() will not - // return incorrect data. - - agentStubMap.each(function (stub) { - stub.perform(performArgs_1); - }); + if ("development" !== 'production') { + errMsg = '"createOnAllSeries" do not supported for "overallReset", ' + 'becuase it will block all streams.'; + } - if (overallTask.perform(performArgs_1)) { - unfinished = true; - } - } else if (seriesTaskMap) { - seriesTaskMap.each(function (task, pipelineId) { - if (needSetDirty(opt, task)) { - task.dirty(); - } + assert(!stageHandler.createOnAllSeries, errMsg); - var performArgs = scheduler.getPerformArgs(task, opt.block); // FIXME - // if intending to decalare `performRawSeries` in handlers, only - // stream-independent (specifically, data item independent) operations can be - // performed. Because is a series is filtered, most of the tasks will not - // be performed. A stream-dependent operation probably cause wrong biz logic. - // Perhaps we should not provide a separate callback for this case instead - // of providing the config `performRawSeries`. The stream-dependent operaions - // and stream-independent operations should better not be mixed. + if (seriesType) { + ecModel.eachRawSeriesByType(seriesType, createStub); + } else if (getTargetSeries) { + getTargetSeries(ecModel, api).each(createStub); + } // Otherwise, (usually it is legancy case), the overall task will only be + // executed when upstream dirty. Otherwise the progressive rendering of all + // pipelines will be disabled unexpectedly. But it still needs stubs to receive + // dirty info from upsteam. + else { + overallProgress = false; + each(ecModel.getSeries(), createStub); + } + + function createStub(seriesModel) { + var pipelineId = seriesModel.uid; + var stub = newAgentStubMap.set(pipelineId, oldAgentStubMap && oldAgentStubMap.get(pipelineId) || ( // When the result of `getTargetSeries` changed, the overallTask + // should be set as dirty and re-performed. + shouldOverallTaskDirty = true, createTask({ + reset: stubReset, + onDirty: stubOnDirty + }))); + stub.context = { + model: seriesModel, + overallProgress: overallProgress // FIXME:TS never used, so comment it + // modifyOutputEnd: modifyOutputEnd + + }; + stub.agent = overallTask; + stub.__block = overallProgress; + + scheduler._pipe(seriesModel, stub); + } + + if (shouldOverallTaskDirty) { + overallTask.dirty(); + } + }; + + Scheduler.prototype._pipe = function (seriesModel, task) { + var pipelineId = seriesModel.uid; + + var pipeline = this._pipelineMap.get(pipelineId); + + !pipeline.head && (pipeline.head = task); + pipeline.tail && pipeline.tail.pipe(task); + pipeline.tail = task; + task.__idxInPipeline = pipeline.count++; + task.__pipeline = pipeline; + }; + + Scheduler.wrapStageHandler = function (stageHandler, visualType) { + if (isFunction(stageHandler)) { + stageHandler = { + overallReset: stageHandler, + seriesType: detectSeriseType(stageHandler) + }; + } + + stageHandler.uid = getUID('stageHandler'); + visualType && (stageHandler.visualType = visualType); + return stageHandler; + }; + return Scheduler; + }(); - performArgs.skip = !stageHandler.performRawSeries && ecModel.isSeriesFiltered(task.context.model); - scheduler.updatePayload(task, payload); + function overallTaskReset(context) { + context.overallReset(context.ecModel, context.api, context.payload); + } - if (task.perform(performArgs)) { - unfinished = true; - } - }); - } - }); + function stubReset(context) { + return context.overallProgress && stubProgress; + } - function needSetDirty(opt, task) { - return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id)); - } + function stubProgress() { + this.agent.dirty(); + this.getDownstream().dirty(); + } - this.unfinished = unfinished || this.unfinished; - }; + function stubOnDirty() { + this.agent && this.agent.dirty(); + } - Scheduler.prototype.performSeriesTasks = function (ecModel) { - var unfinished; - ecModel.eachSeries(function (seriesModel) { - // Progress to the end for dataInit and dataRestore. - unfinished = seriesModel.dataTask.perform() || unfinished; - }); - this.unfinished = unfinished || this.unfinished; - }; + function seriesTaskPlan(context) { + return context.plan ? context.plan(context.model, context.ecModel, context.api, context.payload) : null; + } - Scheduler.prototype.plan = function () { - // Travel pipelines, check block. - this._pipelineMap.each(function (pipeline) { - var task = pipeline.tail; + function seriesTaskReset(context) { + if (context.useClearVisual) { + context.data.clearAllVisual(); + } - do { - if (task.__block) { - pipeline.blockIndex = task.__idxInPipeline; - break; - } + var resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload)); + return resetDefines.length > 1 ? map(resetDefines, function (v, idx) { + return makeSeriesTaskProgress(idx); + }) : singleSeriesTaskProgress; + } - task = task.getUpstream(); - } while (task); - }); - }; + var singleSeriesTaskProgress = makeSeriesTaskProgress(0); - Scheduler.prototype.updatePayload = function (task, payload) { - payload !== 'remain' && (task.context.payload = payload); - }; + function makeSeriesTaskProgress(resetDefineIdx) { + return function (params, context) { + var data = context.data; + var resetDefine = context.resetDefines[resetDefineIdx]; - Scheduler.prototype._createSeriesStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) { - var scheduler = this; - var oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap; // The count of stages are totally about only several dozen, so - // do not need to reuse the map. - - var newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap(); - var seriesType = stageHandler.seriesType; - var getTargetSeries = stageHandler.getTargetSeries; // If a stageHandler should cover all series, `createOnAllSeries` should be declared mandatorily, - // to avoid some typo or abuse. Otherwise if an extension do not specify a `seriesType`, - // it works but it may cause other irrelevant charts blocked. - - if (stageHandler.createOnAllSeries) { - ecModel.eachRawSeries(create); - } else if (seriesType) { - ecModel.eachRawSeriesByType(seriesType, create); - } else if (getTargetSeries) { - getTargetSeries(ecModel, api).each(create); - } - - function create(seriesModel) { - var pipelineId = seriesModel.uid; // Init tasks for each seriesModel only once. - // Reuse original task instance. - - var task = newSeriesTaskMap.set(pipelineId, oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId) || createTask({ - plan: seriesTaskPlan, - reset: seriesTaskReset, - count: seriesTaskCount - })); - task.context = { - model: seriesModel, - ecModel: ecModel, - api: api, - // PENDING: `useClearVisual` not used? - useClearVisual: stageHandler.isVisual && !stageHandler.isLayout, - plan: stageHandler.plan, - reset: stageHandler.reset, - scheduler: scheduler - }; + if (resetDefine && resetDefine.dataEach) { + for (var i = params.start; i < params.end; i++) { + resetDefine.dataEach(data, i); + } + } else if (resetDefine && resetDefine.progress) { + resetDefine.progress(params, data); + } + }; + } - scheduler._pipe(seriesModel, task); - } - }; + function seriesTaskCount(context) { + return context.data.count(); + } + /** + * Only some legacy stage handlers (usually in echarts extensions) are pure function. + * To ensure that they can work normally, they should work in block mode, that is, + * they should not be started util the previous tasks finished. So they cause the + * progressive rendering disabled. We try to detect the series type, to narrow down + * the block range to only the series type they concern, but not all series. + */ - Scheduler.prototype._createOverallStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) { - var scheduler = this; - var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask // For overall task, the function only be called on reset stage. - || createTask({ - reset: overallTaskReset - }); - overallTask.context = { - ecModel: ecModel, - api: api, - overallReset: stageHandler.overallReset, - scheduler: scheduler - }; - var oldAgentStubMap = overallTask.agentStubMap; // The count of stages are totally about only several dozen, so - // do not need to reuse the map. - - var newAgentStubMap = overallTask.agentStubMap = createHashMap(); - var seriesType = stageHandler.seriesType; - var getTargetSeries = stageHandler.getTargetSeries; - var overallProgress = true; - var shouldOverallTaskDirty = false; // FIXME:TS never used, so comment it - // let modifyOutputEnd = stageHandler.modifyOutputEnd; - // An overall task with seriesType detected or has `getTargetSeries`, we add - // stub in each pipelines, it will set the overall task dirty when the pipeline - // progress. Moreover, to avoid call the overall task each frame (too frequent), - // we set the pipeline block. - - var errMsg = ''; - if ("development" !== 'production') { - errMsg = '"createOnAllSeries" do not supported for "overallReset", ' + 'becuase it will block all streams.'; - } + function detectSeriseType(legacyFunc) { + seriesType = null; - assert(!stageHandler.createOnAllSeries, errMsg); + try { + // Assume there is no async when calling `eachSeriesByType`. + legacyFunc(ecModelMock, apiMock); + } catch (e) {} - if (seriesType) { - ecModel.eachRawSeriesByType(seriesType, createStub); - } else if (getTargetSeries) { - getTargetSeries(ecModel, api).each(createStub); - } // Otherwise, (usually it is legancy case), the overall task will only be - // executed when upstream dirty. Otherwise the progressive rendering of all - // pipelines will be disabled unexpectedly. But it still needs stubs to receive - // dirty info from upsteam. - else { - overallProgress = false; - each(ecModel.getSeries(), createStub); - } - - function createStub(seriesModel) { - var pipelineId = seriesModel.uid; - var stub = newAgentStubMap.set(pipelineId, oldAgentStubMap && oldAgentStubMap.get(pipelineId) || ( // When the result of `getTargetSeries` changed, the overallTask - // should be set as dirty and re-performed. - shouldOverallTaskDirty = true, createTask({ - reset: stubReset, - onDirty: stubOnDirty - }))); - stub.context = { - model: seriesModel, - overallProgress: overallProgress // FIXME:TS never used, so comment it - // modifyOutputEnd: modifyOutputEnd - - }; - stub.agent = overallTask; - stub.__block = overallProgress; - - scheduler._pipe(seriesModel, stub); - } - - if (shouldOverallTaskDirty) { - overallTask.dirty(); - } - }; - - Scheduler.prototype._pipe = function (seriesModel, task) { - var pipelineId = seriesModel.uid; - - var pipeline = this._pipelineMap.get(pipelineId); - - !pipeline.head && (pipeline.head = task); - pipeline.tail && pipeline.tail.pipe(task); - pipeline.tail = task; - task.__idxInPipeline = pipeline.count++; - task.__pipeline = pipeline; - }; - - Scheduler.wrapStageHandler = function (stageHandler, visualType) { - if (isFunction(stageHandler)) { - stageHandler = { - overallReset: stageHandler, - seriesType: detectSeriseType(stageHandler) - }; - } - - stageHandler.uid = getUID('stageHandler'); - visualType && (stageHandler.visualType = visualType); - return stageHandler; - }; - return Scheduler; - }(); - - function overallTaskReset(context) { - context.overallReset(context.ecModel, context.api, context.payload); - } - - function stubReset(context) { - return context.overallProgress && stubProgress; - } - - function stubProgress() { - this.agent.dirty(); - this.getDownstream().dirty(); - } - - function stubOnDirty() { - this.agent && this.agent.dirty(); - } - - function seriesTaskPlan(context) { - return context.plan ? context.plan(context.model, context.ecModel, context.api, context.payload) : null; - } - - function seriesTaskReset(context) { - if (context.useClearVisual) { - context.data.clearAllVisual(); - } - - var resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload)); - return resetDefines.length > 1 ? map(resetDefines, function (v, idx) { - return makeSeriesTaskProgress(idx); - }) : singleSeriesTaskProgress; - } - - var singleSeriesTaskProgress = makeSeriesTaskProgress(0); - - function makeSeriesTaskProgress(resetDefineIdx) { - return function (params, context) { - var data = context.data; - var resetDefine = context.resetDefines[resetDefineIdx]; - - if (resetDefine && resetDefine.dataEach) { - for (var i = params.start; i < params.end; i++) { - resetDefine.dataEach(data, i); - } - } else if (resetDefine && resetDefine.progress) { - resetDefine.progress(params, data); - } - }; - } - - function seriesTaskCount(context) { - return context.data.count(); - } - /** - * Only some legacy stage handlers (usually in echarts extensions) are pure function. - * To ensure that they can work normally, they should work in block mode, that is, - * they should not be started util the previous tasks finished. So they cause the - * progressive rendering disabled. We try to detect the series type, to narrow down - * the block range to only the series type they concern, but not all series. - */ - - - function detectSeriseType(legacyFunc) { - seriesType = null; - - try { - // Assume there is no async when calling `eachSeriesByType`. - legacyFunc(ecModelMock, apiMock); - } catch (e) {} - - return seriesType; + return seriesType; } var ecModelMock = {}; @@ -25796,22 +25796,22 @@ mockMethods(apiMock, ExtensionAPI); ecModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) { - seriesType = type; + seriesType = type; }; ecModelMock.eachComponent = function (cond) { - if (cond.mainType === 'series' && cond.subType) { - seriesType = cond.subType; - } + if (cond.mainType === 'series' && cond.subType) { + seriesType = cond.subType; + } }; function mockMethods(target, Clz) { - /* eslint-disable */ - for (var name_1 in Clz.prototype) { - // Do not use hasOwnProperty - target[name_1] = noop; - } - /* eslint-enable */ + /* eslint-disable */ + for (var name_1 in Clz.prototype) { + // Do not use hasOwnProperty + target[name_1] = noop; + } + /* eslint-enable */ } @@ -25859,8 +25859,8 @@ */ var colorAll = ['#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF']; var lightTheme = { - color: colorAll, - colorLayer: [['#37A2DA', '#ffd85c', '#fd7b5f'], ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'], ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'], colorAll] + color: colorAll, + colorLayer: [['#37A2DA', '#ffd85c', '#fd7b5f'], ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'], ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'], colorAll] }; /* @@ -25909,180 +25909,180 @@ var backgroundColor = '#100C2A'; var axisCommon = function () { - return { - axisLine: { - lineStyle: { - color: contrastColor - } - }, - splitLine: { - lineStyle: { - color: '#484753' - } - }, - splitArea: { - areaStyle: { - color: ['rgba(255,255,255,0.02)', 'rgba(255,255,255,0.05)'] - } - }, - minorSplitLine: { - lineStyle: { - color: '#20203B' - } - } - }; + return { + axisLine: { + lineStyle: { + color: contrastColor + } + }, + splitLine: { + lineStyle: { + color: '#484753' + } + }, + splitArea: { + areaStyle: { + color: ['rgba(255,255,255,0.02)', 'rgba(255,255,255,0.05)'] + } + }, + minorSplitLine: { + lineStyle: { + color: '#20203B' + } + } + }; }; var colorPalette = ['#4992ff', '#7cffb2', '#fddd60', '#ff6e76', '#58d9f9', '#05c091', '#ff8a45', '#8d48e3', '#dd79ff']; var theme = { - darkMode: true, - color: colorPalette, - backgroundColor: backgroundColor, - axisPointer: { - lineStyle: { - color: '#817f91' - }, - crossStyle: { - color: '#817f91' - }, - label: { - // TODO Contrast of label backgorundColor - color: '#fff' - } + darkMode: true, + color: colorPalette, + backgroundColor: backgroundColor, + axisPointer: { + lineStyle: { + color: '#817f91' }, - legend: { - textStyle: { - color: contrastColor - } + crossStyle: { + color: '#817f91' }, + label: { + // TODO Contrast of label backgorundColor + color: '#fff' + } + }, + legend: { textStyle: { - color: contrastColor + color: contrastColor + } + }, + textStyle: { + color: contrastColor + }, + title: { + textStyle: { + color: '#EEF1FA' }, - title: { - textStyle: { - color: '#EEF1FA' - }, - subtextStyle: { - color: '#B9B8CE' - } + subtextStyle: { + color: '#B9B8CE' + } + }, + toolbox: { + iconStyle: { + borderColor: contrastColor + } + }, + dataZoom: { + borderColor: '#71708A', + textStyle: { + color: contrastColor }, - toolbox: { - iconStyle: { - borderColor: contrastColor - } + brushStyle: { + color: 'rgba(135,163,206,0.3)' }, - dataZoom: { - borderColor: '#71708A', - textStyle: { - color: contrastColor - }, - brushStyle: { - color: 'rgba(135,163,206,0.3)' - }, - handleStyle: { - color: '#353450', - borderColor: '#C5CBE3' - }, - moveHandleStyle: { - color: '#B0B6C3', - opacity: 0.3 - }, - fillerColor: 'rgba(135,163,206,0.2)', - emphasis: { - handleStyle: { - borderColor: '#91B7F2', - color: '#4D587D' - }, - moveHandleStyle: { - color: '#636D9A', - opacity: 0.7 - } - }, - dataBackground: { - lineStyle: { - color: '#71708A', - width: 1 - }, - areaStyle: { - color: '#71708A' - } - }, - selectedDataBackground: { - lineStyle: { - color: '#87A3CE' - }, - areaStyle: { - color: '#87A3CE' - } - } + handleStyle: { + color: '#353450', + borderColor: '#C5CBE3' }, - visualMap: { - textStyle: { - color: contrastColor - } + moveHandleStyle: { + color: '#B0B6C3', + opacity: 0.3 }, - timeline: { - lineStyle: { - color: contrastColor - }, - label: { - color: contrastColor - }, - controlStyle: { - color: contrastColor, - borderColor: contrastColor - } + fillerColor: 'rgba(135,163,206,0.2)', + emphasis: { + handleStyle: { + borderColor: '#91B7F2', + color: '#4D587D' + }, + moveHandleStyle: { + color: '#636D9A', + opacity: 0.7 + } }, - calendar: { - itemStyle: { - color: backgroundColor - }, - dayLabel: { - color: contrastColor - }, - monthLabel: { - color: contrastColor - }, - yearLabel: { - color: contrastColor - } + dataBackground: { + lineStyle: { + color: '#71708A', + width: 1 + }, + areaStyle: { + color: '#71708A' + } }, - timeAxis: axisCommon(), - logAxis: axisCommon(), - valueAxis: axisCommon(), - categoryAxis: axisCommon(), - line: { - symbol: 'circle' + selectedDataBackground: { + lineStyle: { + color: '#87A3CE' + }, + areaStyle: { + color: '#87A3CE' + } + } + }, + visualMap: { + textStyle: { + color: contrastColor + } + }, + timeline: { + lineStyle: { + color: contrastColor }, - graph: { - color: colorPalette + label: { + color: contrastColor }, - gauge: { - title: { - color: contrastColor - }, - axisLine: { - lineStyle: { - color: [[1, 'rgba(207,212,219,0.2)']] - } - }, - axisLabel: { - color: contrastColor - }, - detail: { - color: '#EEF1FA' - } + controlStyle: { + color: contrastColor, + borderColor: contrastColor + } + }, + calendar: { + itemStyle: { + color: backgroundColor }, - candlestick: { - itemStyle: { - color: '#f64e56', - color0: '#54ea92', - borderColor: '#f64e56', - borderColor0: '#54ea92' // borderColor: '#ca2824', - // borderColor0: '#09a443' + dayLabel: { + color: contrastColor + }, + monthLabel: { + color: contrastColor + }, + yearLabel: { + color: contrastColor + } + }, + timeAxis: axisCommon(), + logAxis: axisCommon(), + valueAxis: axisCommon(), + categoryAxis: axisCommon(), + line: { + symbol: 'circle' + }, + graph: { + color: colorPalette + }, + gauge: { + title: { + color: contrastColor + }, + axisLine: { + lineStyle: { + color: [[1, 'rgba(207,212,219,0.2)']] + } + }, + axisLabel: { + color: contrastColor + }, + detail: { + color: '#EEF1FA' + } + }, + candlestick: { + itemStyle: { + color: '#f64e56', + color0: '#54ea92', + borderColor: '#f64e56', + borderColor0: '#54ea92' // borderColor: '#ca2824', + // borderColor0: '#09a443' - } } + } }; theme.categoryAxis.splitLine.show = false; @@ -26105,194 +26105,194 @@ */ var ECEventProcessor = - /** @class */ - function () { - function ECEventProcessor() {} - - ECEventProcessor.prototype.normalizeQuery = function (query) { - var cptQuery = {}; - var dataQuery = {}; - var otherQuery = {}; // `query` is `mainType` or `mainType.subType` of component. - - if (isString(query)) { - var condCptType = parseClassType(query); // `.main` and `.sub` may be ''. - - cptQuery.mainType = condCptType.main || null; - cptQuery.subType = condCptType.sub || null; - } // `query` is an object, convert to {mainType, index, name, id}. - else { - // `xxxIndex`, `xxxName`, `xxxId`, `name`, `dataIndex`, `dataType` is reserved, - // can not be used in `compomentModel.filterForExposedEvent`. - var suffixes_1 = ['Index', 'Name', 'Id']; - var dataKeys_1 = { - name: 1, - dataIndex: 1, - dataType: 1 - }; - each(query, function (val, key) { - var reserved = false; - - for (var i = 0; i < suffixes_1.length; i++) { - var propSuffix = suffixes_1[i]; - var suffixPos = key.lastIndexOf(propSuffix); + /** @class */ + function () { + function ECEventProcessor() {} - if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) { - var mainType = key.slice(0, suffixPos); // Consider `dataIndex`. + ECEventProcessor.prototype.normalizeQuery = function (query) { + var cptQuery = {}; + var dataQuery = {}; + var otherQuery = {}; // `query` is `mainType` or `mainType.subType` of component. - if (mainType !== 'data') { - cptQuery.mainType = mainType; - cptQuery[propSuffix.toLowerCase()] = val; - reserved = true; - } - } - } + if (isString(query)) { + var condCptType = parseClassType(query); // `.main` and `.sub` may be ''. - if (dataKeys_1.hasOwnProperty(key)) { - dataQuery[key] = val; - reserved = true; - } - - if (!reserved) { - otherQuery[key] = val; - } - }); - } + cptQuery.mainType = condCptType.main || null; + cptQuery.subType = condCptType.sub || null; + } // `query` is an object, convert to {mainType, index, name, id}. + else { + // `xxxIndex`, `xxxName`, `xxxId`, `name`, `dataIndex`, `dataType` is reserved, + // can not be used in `compomentModel.filterForExposedEvent`. + var suffixes_1 = ['Index', 'Name', 'Id']; + var dataKeys_1 = { + name: 1, + dataIndex: 1, + dataType: 1 + }; + each(query, function (val, key) { + var reserved = false; + + for (var i = 0; i < suffixes_1.length; i++) { + var propSuffix = suffixes_1[i]; + var suffixPos = key.lastIndexOf(propSuffix); + + if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) { + var mainType = key.slice(0, suffixPos); // Consider `dataIndex`. + + if (mainType !== 'data') { + cptQuery.mainType = mainType; + cptQuery[propSuffix.toLowerCase()] = val; + reserved = true; + } + } + } + + if (dataKeys_1.hasOwnProperty(key)) { + dataQuery[key] = val; + reserved = true; + } + + if (!reserved) { + otherQuery[key] = val; + } + }); + } - return { - cptQuery: cptQuery, - dataQuery: dataQuery, - otherQuery: otherQuery - }; - }; + return { + cptQuery: cptQuery, + dataQuery: dataQuery, + otherQuery: otherQuery + }; + }; - ECEventProcessor.prototype.filter = function (eventType, query) { - // They should be assigned before each trigger call. - var eventInfo = this.eventInfo; + ECEventProcessor.prototype.filter = function (eventType, query) { + // They should be assigned before each trigger call. + var eventInfo = this.eventInfo; - if (!eventInfo) { - return true; - } + if (!eventInfo) { + return true; + } - var targetEl = eventInfo.targetEl; - var packedEvent = eventInfo.packedEvent; - var model = eventInfo.model; - var view = eventInfo.view; // For event like 'globalout'. + var targetEl = eventInfo.targetEl; + var packedEvent = eventInfo.packedEvent; + var model = eventInfo.model; + var view = eventInfo.view; // For event like 'globalout'. - if (!model || !view) { - return true; - } + if (!model || !view) { + return true; + } - var cptQuery = query.cptQuery; - var dataQuery = query.dataQuery; - return check(cptQuery, model, 'mainType') && check(cptQuery, model, 'subType') && check(cptQuery, model, 'index', 'componentIndex') && check(cptQuery, model, 'name') && check(cptQuery, model, 'id') && check(dataQuery, packedEvent, 'name') && check(dataQuery, packedEvent, 'dataIndex') && check(dataQuery, packedEvent, 'dataType') && (!view.filterForExposedEvent || view.filterForExposedEvent(eventType, query.otherQuery, targetEl, packedEvent)); + var cptQuery = query.cptQuery; + var dataQuery = query.dataQuery; + return check(cptQuery, model, 'mainType') && check(cptQuery, model, 'subType') && check(cptQuery, model, 'index', 'componentIndex') && check(cptQuery, model, 'name') && check(cptQuery, model, 'id') && check(dataQuery, packedEvent, 'name') && check(dataQuery, packedEvent, 'dataIndex') && check(dataQuery, packedEvent, 'dataType') && (!view.filterForExposedEvent || view.filterForExposedEvent(eventType, query.otherQuery, targetEl, packedEvent)); - function check(query, host, prop, propOnHost) { - return query[prop] == null || host[propOnHost || prop] === query[prop]; - } - }; + function check(query, host, prop, propOnHost) { + return query[prop] == null || host[propOnHost || prop] === query[prop]; + } + }; - ECEventProcessor.prototype.afterTrigger = function () { - // Make sure the eventInfo wont be used in next trigger. - this.eventInfo = null; - }; + ECEventProcessor.prototype.afterTrigger = function () { + // Make sure the eventInfo wont be used in next trigger. + this.eventInfo = null; + }; - return ECEventProcessor; - }(); + return ECEventProcessor; + }(); var SYMBOL_PROPS_WITH_CB = ['symbol', 'symbolSize', 'symbolRotate', 'symbolOffset']; var SYMBOL_PROPS = SYMBOL_PROPS_WITH_CB.concat(['symbolKeepAspect']); // Encoding visual for all series include which is filtered for legend drawing var seriesSymbolTask = { - createOnAllSeries: true, - // For legend. - performRawSeries: true, - reset: function (seriesModel, ecModel) { - var data = seriesModel.getData(); + createOnAllSeries: true, + // For legend. + performRawSeries: true, + reset: function (seriesModel, ecModel) { + var data = seriesModel.getData(); - if (seriesModel.legendIcon) { - data.setVisual('legendIcon', seriesModel.legendIcon); - } + if (seriesModel.legendIcon) { + data.setVisual('legendIcon', seriesModel.legendIcon); + } - if (!seriesModel.hasSymbolVisual) { - return; - } + if (!seriesModel.hasSymbolVisual) { + return; + } - var symbolOptions = {}; - var symbolOptionsCb = {}; - var hasCallback = false; + var symbolOptions = {}; + var symbolOptionsCb = {}; + var hasCallback = false; - for (var i = 0; i < SYMBOL_PROPS_WITH_CB.length; i++) { - var symbolPropName = SYMBOL_PROPS_WITH_CB[i]; - var val = seriesModel.get(symbolPropName); + for (var i = 0; i < SYMBOL_PROPS_WITH_CB.length; i++) { + var symbolPropName = SYMBOL_PROPS_WITH_CB[i]; + var val = seriesModel.get(symbolPropName); - if (isFunction(val)) { - hasCallback = true; - symbolOptionsCb[symbolPropName] = val; - } else { - symbolOptions[symbolPropName] = val; - } - } + if (isFunction(val)) { + hasCallback = true; + symbolOptionsCb[symbolPropName] = val; + } else { + symbolOptions[symbolPropName] = val; + } + } - symbolOptions.symbol = symbolOptions.symbol || seriesModel.defaultSymbol; - data.setVisual(extend({ - legendIcon: seriesModel.legendIcon || symbolOptions.symbol, - symbolKeepAspect: seriesModel.get('symbolKeepAspect') - }, symbolOptions)); // Only visible series has each data be visual encoded + symbolOptions.symbol = symbolOptions.symbol || seriesModel.defaultSymbol; + data.setVisual(extend({ + legendIcon: seriesModel.legendIcon || symbolOptions.symbol, + symbolKeepAspect: seriesModel.get('symbolKeepAspect') + }, symbolOptions)); // Only visible series has each data be visual encoded - if (ecModel.isSeriesFiltered(seriesModel)) { - return; - } - - var symbolPropsCb = keys(symbolOptionsCb); + if (ecModel.isSeriesFiltered(seriesModel)) { + return; + } - function dataEach(data, idx) { - var rawValue = seriesModel.getRawValue(idx); - var params = seriesModel.getDataParams(idx); + var symbolPropsCb = keys(symbolOptionsCb); - for (var i = 0; i < symbolPropsCb.length; i++) { - var symbolPropName = symbolPropsCb[i]; - data.setItemVisual(idx, symbolPropName, symbolOptionsCb[symbolPropName](rawValue, params)); - } - } + function dataEach(data, idx) { + var rawValue = seriesModel.getRawValue(idx); + var params = seriesModel.getDataParams(idx); - return { - dataEach: hasCallback ? dataEach : null - }; + for (var i = 0; i < symbolPropsCb.length; i++) { + var symbolPropName = symbolPropsCb[i]; + data.setItemVisual(idx, symbolPropName, symbolOptionsCb[symbolPropName](rawValue, params)); + } } + + return { + dataEach: hasCallback ? dataEach : null + }; + } }; var dataSymbolTask = { - createOnAllSeries: true, - // For legend. - performRawSeries: true, - reset: function (seriesModel, ecModel) { - if (!seriesModel.hasSymbolVisual) { - return; - } // Only visible series has each data be visual encoded + createOnAllSeries: true, + // For legend. + performRawSeries: true, + reset: function (seriesModel, ecModel) { + if (!seriesModel.hasSymbolVisual) { + return; + } // Only visible series has each data be visual encoded - if (ecModel.isSeriesFiltered(seriesModel)) { - return; - } + if (ecModel.isSeriesFiltered(seriesModel)) { + return; + } - var data = seriesModel.getData(); + var data = seriesModel.getData(); - function dataEach(data, idx) { - var itemModel = data.getItemModel(idx); + function dataEach(data, idx) { + var itemModel = data.getItemModel(idx); - for (var i = 0; i < SYMBOL_PROPS.length; i++) { - var symbolPropName = SYMBOL_PROPS[i]; - var val = itemModel.getShallow(symbolPropName, true); + for (var i = 0; i < SYMBOL_PROPS.length; i++) { + var symbolPropName = SYMBOL_PROPS[i]; + var val = itemModel.getShallow(symbolPropName, true); - if (val != null) { - data.setItemVisual(idx, symbolPropName, val); - } - } + if (val != null) { + data.setItemVisual(idx, symbolPropName, val); } - - return { - dataEach: data.hasItemOption ? dataEach : null - }; + } } + + return { + dataEach: data.hasItemOption ? dataEach : null + }; + } }; /* @@ -26338,153 +26338,153 @@ * under the License. */ function getItemVisualFromData(data, dataIndex, key) { - switch (key) { - case 'color': - var style = data.getItemVisual(dataIndex, 'style'); - return style[data.getVisual('drawType')]; + switch (key) { + case 'color': + var style = data.getItemVisual(dataIndex, 'style'); + return style[data.getVisual('drawType')]; - case 'opacity': - return data.getItemVisual(dataIndex, 'style').opacity; + case 'opacity': + return data.getItemVisual(dataIndex, 'style').opacity; - case 'symbol': - case 'symbolSize': - case 'liftZ': - return data.getItemVisual(dataIndex, key); + case 'symbol': + case 'symbolSize': + case 'liftZ': + return data.getItemVisual(dataIndex, key); - default: - if ("development" !== 'production') { - console.warn("Unknown visual type " + key); - } + default: + if ("development" !== 'production') { + console.warn("Unknown visual type " + key); + } - } + } } function getVisualFromData(data, key) { - switch (key) { - case 'color': - var style = data.getVisual('style'); - return style[data.getVisual('drawType')]; + switch (key) { + case 'color': + var style = data.getVisual('style'); + return style[data.getVisual('drawType')]; - case 'opacity': - return data.getVisual('style').opacity; + case 'opacity': + return data.getVisual('style').opacity; - case 'symbol': - case 'symbolSize': - case 'liftZ': - return data.getVisual(key); + case 'symbol': + case 'symbolSize': + case 'liftZ': + return data.getVisual(key); - default: - if ("development" !== 'production') { - console.warn("Unknown visual type " + key); - } + default: + if ("development" !== 'production') { + console.warn("Unknown visual type " + key); + } - } + } } function setItemVisualFromData(data, dataIndex, key, value) { - switch (key) { - case 'color': - // Make sure not sharing style object. - var style = data.ensureUniqueItemVisual(dataIndex, 'style'); - style[data.getVisual('drawType')] = value; // Mark the color has been changed, not from palette anymore + switch (key) { + case 'color': + // Make sure not sharing style object. + var style = data.ensureUniqueItemVisual(dataIndex, 'style'); + style[data.getVisual('drawType')] = value; // Mark the color has been changed, not from palette anymore - data.setItemVisual(dataIndex, 'colorFromPalette', false); - break; + data.setItemVisual(dataIndex, 'colorFromPalette', false); + break; - case 'opacity': - data.ensureUniqueItemVisual(dataIndex, 'style').opacity = value; - break; + case 'opacity': + data.ensureUniqueItemVisual(dataIndex, 'style').opacity = value; + break; - case 'symbol': - case 'symbolSize': - case 'liftZ': - data.setItemVisual(dataIndex, key, value); - break; + case 'symbol': + case 'symbolSize': + case 'liftZ': + data.setItemVisual(dataIndex, key, value); + break; - default: - if ("development" !== 'production') { - console.warn("Unknown visual type " + key); - } + default: + if ("development" !== 'production') { + console.warn("Unknown visual type " + key); + } - } + } } // Inlucdes: pieSelect, pieUnSelect, pieToggleSelect, mapSelect, mapUnSelect, mapToggleSelect function createLegacyDataSelectAction(seriesType, ecRegisterAction) { - function getSeriesIndices(ecModel, payload) { - var seriesIndices = []; - ecModel.eachComponent({ - mainType: 'series', - subType: seriesType, - query: payload - }, function (seriesModel) { - seriesIndices.push(seriesModel.seriesIndex); - }); - return seriesIndices; - } + function getSeriesIndices(ecModel, payload) { + var seriesIndices = []; + ecModel.eachComponent({ + mainType: 'series', + subType: seriesType, + query: payload + }, function (seriesModel) { + seriesIndices.push(seriesModel.seriesIndex); + }); + return seriesIndices; + } - each([[seriesType + 'ToggleSelect', 'toggleSelect'], [seriesType + 'Select', 'select'], [seriesType + 'UnSelect', 'unselect']], function (eventsMap) { - ecRegisterAction(eventsMap[0], function (payload, ecModel, api) { - payload = extend({}, payload); + each([[seriesType + 'ToggleSelect', 'toggleSelect'], [seriesType + 'Select', 'select'], [seriesType + 'UnSelect', 'unselect']], function (eventsMap) { + ecRegisterAction(eventsMap[0], function (payload, ecModel, api) { + payload = extend({}, payload); - if ("development" !== 'production') { - deprecateReplaceLog(payload.type, eventsMap[1]); - } + if ("development" !== 'production') { + deprecateReplaceLog(payload.type, eventsMap[1]); + } - api.dispatchAction(extend(payload, { - type: eventsMap[1], - seriesIndex: getSeriesIndices(ecModel, payload) - })); - }); + api.dispatchAction(extend(payload, { + type: eventsMap[1], + seriesIndex: getSeriesIndices(ecModel, payload) + })); }); + }); } function handleSeriesLegacySelectEvents(type, eventPostfix, ecIns, ecModel, payload) { - var legacyEventName = type + eventPostfix; + var legacyEventName = type + eventPostfix; - if (!ecIns.isSilent(legacyEventName)) { - if ("development" !== 'production') { - deprecateLog("event " + legacyEventName + " is deprecated."); - } - - ecModel.eachComponent({ - mainType: 'series', - subType: 'pie' - }, function (seriesModel) { - var seriesIndex = seriesModel.seriesIndex; - var selectedMap = seriesModel.option.selectedMap; - var selected = payload.selected; - - for (var i = 0; i < selected.length; i++) { - if (selected[i].seriesIndex === seriesIndex) { - var data = seriesModel.getData(); - var dataIndex = queryDataIndex(data, payload.fromActionPayload); - ecIns.trigger(legacyEventName, { - type: legacyEventName, - seriesId: seriesModel.id, - name: isArray(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex), - selected: isString(selectedMap) ? selectedMap : extend({}, selectedMap) - }); - } - } - }); + if (!ecIns.isSilent(legacyEventName)) { + if ("development" !== 'production') { + deprecateLog("event " + legacyEventName + " is deprecated."); } + + ecModel.eachComponent({ + mainType: 'series', + subType: 'pie' + }, function (seriesModel) { + var seriesIndex = seriesModel.seriesIndex; + var selectedMap = seriesModel.option.selectedMap; + var selected = payload.selected; + + for (var i = 0; i < selected.length; i++) { + if (selected[i].seriesIndex === seriesIndex) { + var data = seriesModel.getData(); + var dataIndex = queryDataIndex(data, payload.fromActionPayload); + ecIns.trigger(legacyEventName, { + type: legacyEventName, + seriesId: seriesModel.id, + name: isArray(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex), + selected: isString(selectedMap) ? selectedMap : extend({}, selectedMap) + }); + } + } + }); + } } function handleLegacySelectEvents(messageCenter, ecIns, api) { - messageCenter.on('selectchanged', function (params) { - var ecModel = api.getModel(); + messageCenter.on('selectchanged', function (params) { + var ecModel = api.getModel(); - if (params.isFromClick) { - handleSeriesLegacySelectEvents('map', 'selectchanged', ecIns, ecModel, params); - handleSeriesLegacySelectEvents('pie', 'selectchanged', ecIns, ecModel, params); - } else if (params.fromAction === 'select') { - handleSeriesLegacySelectEvents('map', 'selected', ecIns, ecModel, params); - handleSeriesLegacySelectEvents('pie', 'selected', ecIns, ecModel, params); - } else if (params.fromAction === 'unselect') { - handleSeriesLegacySelectEvents('map', 'unselected', ecIns, ecModel, params); - handleSeriesLegacySelectEvents('pie', 'unselected', ecIns, ecModel, params); - } - }); + if (params.isFromClick) { + handleSeriesLegacySelectEvents('map', 'selectchanged', ecIns, ecModel, params); + handleSeriesLegacySelectEvents('pie', 'selectchanged', ecIns, ecModel, params); + } else if (params.fromAction === 'select') { + handleSeriesLegacySelectEvents('map', 'selected', ecIns, ecModel, params); + handleSeriesLegacySelectEvents('pie', 'selected', ecIns, ecModel, params); + } else if (params.fromAction === 'unselect') { + handleSeriesLegacySelectEvents('map', 'unselected', ecIns, ecModel, params); + handleSeriesLegacySelectEvents('pie', 'unselected', ecIns, ecModel, params); + } + }); } /* @@ -26530,21 +26530,21 @@ * under the License. */ function findEventDispatcher(target, det, returnFirstMatch) { - var found; - - while (target) { - if (det(target)) { - found = target; + var found; - if (returnFirstMatch) { - break; - } - } + while (target) { + if (det(target)) { + found = target; - target = target.__hostTarget || target.parent; + if (returnFirstMatch) { + break; + } } - return found; + target = target.__hostTarget || target.parent; + } + + return found; } var wmUniqueIndex = Math.round(Math.random() * 9); @@ -26595,23 +26595,23 @@ */ var Triangle = Path.extend({ - type: 'triangle', - shape: { - cx: 0, - cy: 0, - width: 0, - height: 0 - }, - buildPath: function (path, shape) { - var cx = shape.cx; - var cy = shape.cy; - var width = shape.width / 2; - var height = shape.height / 2; - path.moveTo(cx, cy - height); - path.lineTo(cx + width, cy + height); - path.lineTo(cx - width, cy + height); - path.closePath(); - } + type: 'triangle', + shape: { + cx: 0, + cy: 0, + width: 0, + height: 0 + }, + buildPath: function (path, shape) { + var cx = shape.cx; + var cy = shape.cy; + var width = shape.width / 2; + var height = shape.height / 2; + path.moveTo(cx, cy - height); + path.lineTo(cx + width, cy + height); + path.lineTo(cx - width, cy + height); + path.closePath(); + } }); /** * Diamond shape @@ -26619,24 +26619,24 @@ */ var Diamond = Path.extend({ - type: 'diamond', - shape: { - cx: 0, - cy: 0, - width: 0, - height: 0 - }, - buildPath: function (path, shape) { - var cx = shape.cx; - var cy = shape.cy; - var width = shape.width / 2; - var height = shape.height / 2; - path.moveTo(cx, cy - height); - path.lineTo(cx + width, cy); - path.lineTo(cx, cy + height); - path.lineTo(cx - width, cy); - path.closePath(); - } + type: 'diamond', + shape: { + cx: 0, + cy: 0, + width: 0, + height: 0 + }, + buildPath: function (path, shape) { + var cx = shape.cx; + var cy = shape.cy; + var width = shape.width / 2; + var height = shape.height / 2; + path.moveTo(cx, cy - height); + path.lineTo(cx + width, cy); + path.lineTo(cx, cy + height); + path.lineTo(cx - width, cy); + path.closePath(); + } }); /** * Pin shape @@ -26644,37 +26644,37 @@ */ var Pin = Path.extend({ - type: 'pin', - shape: { - // x, y on the cusp - x: 0, - y: 0, - width: 0, - height: 0 - }, - buildPath: function (path, shape) { - var x = shape.x; - var y = shape.y; - var w = shape.width / 5 * 3; // Height must be larger than width - - var h = Math.max(w, shape.height); - var r = w / 2; // Dist on y with tangent point and circle center - - var dy = r * r / (h - r); - var cy = y - h + r + dy; - var angle = Math.asin(dy / r); // Dist on x with tangent point and circle center - - var dx = Math.cos(angle) * r; - var tanX = Math.sin(angle); - var tanY = Math.cos(angle); - var cpLen = r * 0.6; - var cpLen2 = r * 0.7; - path.moveTo(x - dx, cy + dy); - path.arc(x, cy, r, Math.PI - angle, Math.PI * 2 + angle); - path.bezierCurveTo(x + dx - tanX * cpLen, cy + dy + tanY * cpLen, x, y - cpLen2, x, y); - path.bezierCurveTo(x, y - cpLen2, x - dx + tanX * cpLen, cy + dy + tanY * cpLen, x - dx, cy + dy); - path.closePath(); - } + type: 'pin', + shape: { + // x, y on the cusp + x: 0, + y: 0, + width: 0, + height: 0 + }, + buildPath: function (path, shape) { + var x = shape.x; + var y = shape.y; + var w = shape.width / 5 * 3; // Height must be larger than width + + var h = Math.max(w, shape.height); + var r = w / 2; // Dist on y with tangent point and circle center + + var dy = r * r / (h - r); + var cy = y - h + r + dy; + var angle = Math.asin(dy / r); // Dist on x with tangent point and circle center + + var dx = Math.cos(angle) * r; + var tanX = Math.sin(angle); + var tanY = Math.cos(angle); + var cpLen = r * 0.6; + var cpLen2 = r * 0.7; + path.moveTo(x - dx, cy + dy); + path.arc(x, cy, r, Math.PI - angle, Math.PI * 2 + angle); + path.bezierCurveTo(x + dx - tanX * cpLen, cy + dy + tanY * cpLen, x, y - cpLen2, x, y); + path.bezierCurveTo(x, y - cpLen2, x - dx + tanX * cpLen, cy + dy + tanY * cpLen, x - dx, cy + dy); + path.closePath(); + } }); /** * Arrow shape @@ -26682,159 +26682,159 @@ */ var Arrow = Path.extend({ - type: 'arrow', - shape: { - x: 0, - y: 0, - width: 0, - height: 0 - }, - buildPath: function (ctx, shape) { - var height = shape.height; - var width = shape.width; - var x = shape.x; - var y = shape.y; - var dx = width / 3 * 2; - ctx.moveTo(x, y); - ctx.lineTo(x + dx, y + height); - ctx.lineTo(x, y + height / 4 * 3); - ctx.lineTo(x - dx, y + height); - ctx.lineTo(x, y); - ctx.closePath(); - } + type: 'arrow', + shape: { + x: 0, + y: 0, + width: 0, + height: 0 + }, + buildPath: function (ctx, shape) { + var height = shape.height; + var width = shape.width; + var x = shape.x; + var y = shape.y; + var dx = width / 3 * 2; + ctx.moveTo(x, y); + ctx.lineTo(x + dx, y + height); + ctx.lineTo(x, y + height / 4 * 3); + ctx.lineTo(x - dx, y + height); + ctx.lineTo(x, y); + ctx.closePath(); + } }); /** * Map of path contructors */ - // TODO Use function to build symbol path. + // TODO Use function to build symbol path. var symbolCtors = { - line: Line, - rect: Rect, - roundRect: Rect, - square: Rect, - circle: Circle, - diamond: Diamond, - pin: Pin, - arrow: Arrow, - triangle: Triangle - }; + line: Line, + rect: Rect, + roundRect: Rect, + square: Rect, + circle: Circle, + diamond: Diamond, + pin: Pin, + arrow: Arrow, + triangle: Triangle + }; var symbolShapeMakers = { - line: function (x, y, w, h, shape) { - shape.x1 = x; - shape.y1 = y + h / 2; - shape.x2 = x + w; - shape.y2 = y + h / 2; - }, - rect: function (x, y, w, h, shape) { - shape.x = x; - shape.y = y; - shape.width = w; - shape.height = h; - }, - roundRect: function (x, y, w, h, shape) { - shape.x = x; - shape.y = y; - shape.width = w; - shape.height = h; - shape.r = Math.min(w, h) / 4; - }, - square: function (x, y, w, h, shape) { - var size = Math.min(w, h); - shape.x = x; - shape.y = y; - shape.width = size; - shape.height = size; - }, - circle: function (x, y, w, h, shape) { - // Put circle in the center of square - shape.cx = x + w / 2; - shape.cy = y + h / 2; - shape.r = Math.min(w, h) / 2; - }, - diamond: function (x, y, w, h, shape) { - shape.cx = x + w / 2; - shape.cy = y + h / 2; - shape.width = w; - shape.height = h; - }, - pin: function (x, y, w, h, shape) { - shape.x = x + w / 2; - shape.y = y + h / 2; - shape.width = w; - shape.height = h; - }, - arrow: function (x, y, w, h, shape) { - shape.x = x + w / 2; - shape.y = y + h / 2; - shape.width = w; - shape.height = h; - }, - triangle: function (x, y, w, h, shape) { - shape.cx = x + w / 2; - shape.cy = y + h / 2; - shape.width = w; - shape.height = h; - } + line: function (x, y, w, h, shape) { + shape.x1 = x; + shape.y1 = y + h / 2; + shape.x2 = x + w; + shape.y2 = y + h / 2; + }, + rect: function (x, y, w, h, shape) { + shape.x = x; + shape.y = y; + shape.width = w; + shape.height = h; + }, + roundRect: function (x, y, w, h, shape) { + shape.x = x; + shape.y = y; + shape.width = w; + shape.height = h; + shape.r = Math.min(w, h) / 4; + }, + square: function (x, y, w, h, shape) { + var size = Math.min(w, h); + shape.x = x; + shape.y = y; + shape.width = size; + shape.height = size; + }, + circle: function (x, y, w, h, shape) { + // Put circle in the center of square + shape.cx = x + w / 2; + shape.cy = y + h / 2; + shape.r = Math.min(w, h) / 2; + }, + diamond: function (x, y, w, h, shape) { + shape.cx = x + w / 2; + shape.cy = y + h / 2; + shape.width = w; + shape.height = h; + }, + pin: function (x, y, w, h, shape) { + shape.x = x + w / 2; + shape.y = y + h / 2; + shape.width = w; + shape.height = h; + }, + arrow: function (x, y, w, h, shape) { + shape.x = x + w / 2; + shape.y = y + h / 2; + shape.width = w; + shape.height = h; + }, + triangle: function (x, y, w, h, shape) { + shape.cx = x + w / 2; + shape.cy = y + h / 2; + shape.width = w; + shape.height = h; + } }; var symbolBuildProxies = {}; each(symbolCtors, function (Ctor, name) { - symbolBuildProxies[name] = new Ctor(); + symbolBuildProxies[name] = new Ctor(); }); var SymbolClz = Path.extend({ - type: 'symbol', - shape: { - symbolType: '', - x: 0, - y: 0, - width: 0, - height: 0 - }, - calculateTextPosition: function (out, config, rect) { - var res = calculateTextPosition(out, config, rect); - var shape = this.shape; + type: 'symbol', + shape: { + symbolType: '', + x: 0, + y: 0, + width: 0, + height: 0 + }, + calculateTextPosition: function (out, config, rect) { + var res = calculateTextPosition(out, config, rect); + var shape = this.shape; - if (shape && shape.symbolType === 'pin' && config.position === 'inside') { - res.y = rect.y + rect.height * 0.4; - } + if (shape && shape.symbolType === 'pin' && config.position === 'inside') { + res.y = rect.y + rect.height * 0.4; + } - return res; - }, - buildPath: function (ctx, shape, inBundle) { - var symbolType = shape.symbolType; + return res; + }, + buildPath: function (ctx, shape, inBundle) { + var symbolType = shape.symbolType; - if (symbolType !== 'none') { - var proxySymbol = symbolBuildProxies[symbolType]; + if (symbolType !== 'none') { + var proxySymbol = symbolBuildProxies[symbolType]; - if (!proxySymbol) { - // Default rect - symbolType = 'rect'; - proxySymbol = symbolBuildProxies[symbolType]; - } + if (!proxySymbol) { + // Default rect + symbolType = 'rect'; + proxySymbol = symbolBuildProxies[symbolType]; + } - symbolShapeMakers[symbolType](shape.x, shape.y, shape.width, shape.height, proxySymbol.shape); - proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle); - } + symbolShapeMakers[symbolType](shape.x, shape.y, shape.width, shape.height, proxySymbol.shape); + proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle); } + } }); // Provide setColor helper method to avoid determine if set the fill or stroke outside function symbolPathSetColor(color, innerColor) { - if (this.type !== 'image') { - var symbolStyle = this.style; - - if (this.__isEmptyBrush) { - symbolStyle.stroke = color; - symbolStyle.fill = innerColor || '#fff'; // TODO Same width with lineStyle in LineView + if (this.type !== 'image') { + var symbolStyle = this.style; - symbolStyle.lineWidth = 2; - } else if (this.shape.symbolType === 'line') { - symbolStyle.stroke = color; - } else { - symbolStyle.fill = color; - } + if (this.__isEmptyBrush) { + symbolStyle.stroke = color; + symbolStyle.fill = innerColor || '#fff'; // TODO Same width with lineStyle in LineView - this.markRedraw(); + symbolStyle.lineWidth = 2; + } else if (this.shape.symbolType === 'line') { + symbolStyle.stroke = color; + } else { + symbolStyle.fill = color; } + + this.markRedraw(); + } } /** * Create a symbol element with given symbol configuration: shape, x, y, width, height, color @@ -26842,59 +26842,59 @@ function createSymbol(symbolType, x, y, w, h, color, // whether to keep the ratio of w/h, - keepAspect) { - // TODO Support image object, DynamicImage. - var isEmpty = symbolType.indexOf('empty') === 0; - - if (isEmpty) { - symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6); - } - - var symbolPath; - - if (symbolType.indexOf('image://') === 0) { - symbolPath = makeImage(symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover'); - } else if (symbolType.indexOf('path://') === 0) { - symbolPath = makePath(symbolType.slice(7), {}, new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover'); - } else { - symbolPath = new SymbolClz({ - shape: { - symbolType: symbolType, - x: x, - y: y, - width: w, - height: h - } - }); - } + keepAspect) { + // TODO Support image object, DynamicImage. + var isEmpty = symbolType.indexOf('empty') === 0; + + if (isEmpty) { + symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6); + } + + var symbolPath; + + if (symbolType.indexOf('image://') === 0) { + symbolPath = makeImage(symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover'); + } else if (symbolType.indexOf('path://') === 0) { + symbolPath = makePath(symbolType.slice(7), {}, new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover'); + } else { + symbolPath = new SymbolClz({ + shape: { + symbolType: symbolType, + x: x, + y: y, + width: w, + height: h + } + }); + } - symbolPath.__isEmptyBrush = isEmpty; // TODO Should deprecate setColor + symbolPath.__isEmptyBrush = isEmpty; // TODO Should deprecate setColor - symbolPath.setColor = symbolPathSetColor; + symbolPath.setColor = symbolPathSetColor; - if (color) { - symbolPath.setColor(color); - } + if (color) { + symbolPath.setColor(color); + } - return symbolPath; + return symbolPath; } function normalizeSymbolSize(symbolSize) { - if (!isArray(symbolSize)) { - symbolSize = [+symbolSize, +symbolSize]; - } + if (!isArray(symbolSize)) { + symbolSize = [+symbolSize, +symbolSize]; + } - return [symbolSize[0] || 0, symbolSize[1] || 0]; + return [symbolSize[0] || 0, symbolSize[1] || 0]; } function normalizeSymbolOffset(symbolOffset, symbolSize) { - if (symbolOffset == null) { - return; - } + if (symbolOffset == null) { + return; + } - if (!isArray(symbolOffset)) { - symbolOffset = [symbolOffset, symbolOffset]; - } + if (!isArray(symbolOffset)) { + symbolOffset = [symbolOffset, symbolOffset]; + } - return [parsePercent$1(symbolOffset[0], symbolSize[0]) || 0, parsePercent$1(retrieve2(symbolOffset[1], symbolOffset[0]), symbolSize[1]) || 0]; + return [parsePercent$1(symbolOffset[0], symbolSize[0]) || 0, parsePercent$1(retrieve2(symbolOffset[1], symbolOffset[0]), symbolSize[1]) || 0]; } function createLinearGradient(ctx, obj, rect) { @@ -27557,260 +27557,260 @@ */ function createOrUpdatePatternFromDecal(decalObject, api) { - if (decalObject === 'none') { - return null; - } - - var dpr = api.getDevicePixelRatio(); - var zr = api.getZr(); - var isSVG = zr.painter.type === 'svg'; - - if (decalObject.dirty) { - decalMap["delete"](decalObject); - } - - var oldPattern = decalMap.get(decalObject); - - if (oldPattern) { - return oldPattern; - } + if (decalObject === 'none') { + return null; + } - var decalOpt = defaults(decalObject, { - symbol: 'rect', - symbolSize: 1, - symbolKeepAspect: true, - color: 'rgba(0, 0, 0, 0.2)', - backgroundColor: null, - dashArrayX: 5, - dashArrayY: 5, - rotation: 0, - maxTileWidth: 512, - maxTileHeight: 512 - }); + var dpr = api.getDevicePixelRatio(); + var zr = api.getZr(); + var isSVG = zr.painter.type === 'svg'; - if (decalOpt.backgroundColor === 'none') { - decalOpt.backgroundColor = null; - } + if (decalObject.dirty) { + decalMap["delete"](decalObject); + } - var pattern = { - repeat: 'repeat' - }; - setPatternnSource(pattern); - pattern.rotation = decalOpt.rotation; - pattern.scaleX = pattern.scaleY = isSVG ? 1 : 1 / dpr; - decalMap.set(decalObject, pattern); - decalObject.dirty = false; - return pattern; + var oldPattern = decalMap.get(decalObject); - function setPatternnSource(pattern) { - var keys = [dpr]; - var isValidKey = true; + if (oldPattern) { + return oldPattern; + } - for (var i = 0; i < decalKeys.length; ++i) { - var value = decalOpt[decalKeys[i]]; + var decalOpt = defaults(decalObject, { + symbol: 'rect', + symbolSize: 1, + symbolKeepAspect: true, + color: 'rgba(0, 0, 0, 0.2)', + backgroundColor: null, + dashArrayX: 5, + dashArrayY: 5, + rotation: 0, + maxTileWidth: 512, + maxTileHeight: 512 + }); + + if (decalOpt.backgroundColor === 'none') { + decalOpt.backgroundColor = null; + } + + var pattern = { + repeat: 'repeat' + }; + setPatternnSource(pattern); + pattern.rotation = decalOpt.rotation; + pattern.scaleX = pattern.scaleY = isSVG ? 1 : 1 / dpr; + decalMap.set(decalObject, pattern); + decalObject.dirty = false; + return pattern; + + function setPatternnSource(pattern) { + var keys = [dpr]; + var isValidKey = true; + + for (var i = 0; i < decalKeys.length; ++i) { + var value = decalOpt[decalKeys[i]]; + + if (value != null && !isArray(value) && !isString(value) && !isNumber(value) && typeof value !== 'boolean') { + isValidKey = false; + break; + } + + keys.push(value); + } + + var cacheKey; + + if (isValidKey) { + cacheKey = keys.join(',') + (isSVG ? '-svg' : ''); + var cache = decalCache.get(cacheKey); + + if (cache) { + isSVG ? pattern.svgElement = cache : pattern.image = cache; + } + } + + var dashArrayX = normalizeDashArrayX(decalOpt.dashArrayX); + var dashArrayY = normalizeDashArrayY(decalOpt.dashArrayY); + var symbolArray = normalizeSymbolArray(decalOpt.symbol); + var lineBlockLengthsX = getLineBlockLengthX(dashArrayX); + var lineBlockLengthY = getLineBlockLengthY(dashArrayY); + var canvas = !isSVG && platformApi.createCanvas(); + var svgRoot = isSVG && { + tag: 'g', + attrs: {}, + key: 'dcl', + children: [] + }; + var pSize = getPatternSize(); + var ctx; + + if (canvas) { + canvas.width = pSize.width * dpr; + canvas.height = pSize.height * dpr; + ctx = canvas.getContext('2d'); + } + + brushDecal(); + + if (isValidKey) { + decalCache.put(cacheKey, canvas || svgRoot); + } + + pattern.image = canvas; + pattern.svgElement = svgRoot; + pattern.svgWidth = pSize.width; + pattern.svgHeight = pSize.height; + /** + * Get minumum length that can make a repeatable pattern. + * + * @return {Object} pattern width and height + */ - if (value != null && !isArray(value) && !isString(value) && !isNumber(value) && typeof value !== 'boolean') { - isValidKey = false; - break; - } + function getPatternSize() { + /** + * For example, if dash is [[3, 2], [2, 1]] for X, it looks like + * |--- --- --- --- --- ... + * |-- -- -- -- -- -- -- -- ... + * |--- --- --- --- --- ... + * |-- -- -- -- -- -- -- -- ... + * So the minumum length of X is 15, + * which is the least common multiple of `3 + 2` and `2 + 1` + * |--- --- --- |--- --- ... + * |-- -- -- -- -- |-- -- -- ... + */ + var width = 1; - keys.push(value); - } + for (var i = 0, xlen = lineBlockLengthsX.length; i < xlen; ++i) { + width = getLeastCommonMultiple(width, lineBlockLengthsX[i]); + } - var cacheKey; + var symbolRepeats = 1; - if (isValidKey) { - cacheKey = keys.join(',') + (isSVG ? '-svg' : ''); - var cache = decalCache.get(cacheKey); + for (var i = 0, xlen = symbolArray.length; i < xlen; ++i) { + symbolRepeats = getLeastCommonMultiple(symbolRepeats, symbolArray[i].length); + } - if (cache) { - isSVG ? pattern.svgElement = cache : pattern.image = cache; - } - } + width *= symbolRepeats; + var height = lineBlockLengthY * lineBlockLengthsX.length * symbolArray.length; - var dashArrayX = normalizeDashArrayX(decalOpt.dashArrayX); - var dashArrayY = normalizeDashArrayY(decalOpt.dashArrayY); - var symbolArray = normalizeSymbolArray(decalOpt.symbol); - var lineBlockLengthsX = getLineBlockLengthX(dashArrayX); - var lineBlockLengthY = getLineBlockLengthY(dashArrayY); - var canvas = !isSVG && platformApi.createCanvas(); - var svgRoot = isSVG && { - tag: 'g', - attrs: {}, - key: 'dcl', - children: [] + if ("development" !== 'production') { + var warn = function (attrName) { + /* eslint-disable-next-line */ + console.warn("Calculated decal size is greater than " + attrName + " due to decal option settings so " + attrName + " is used for the decal size. Please consider changing the decal option to make a smaller decal or set " + attrName + " to be larger to avoid incontinuity."); }; - var pSize = getPatternSize(); - var ctx; - if (canvas) { - canvas.width = pSize.width * dpr; - canvas.height = pSize.height * dpr; - ctx = canvas.getContext('2d'); + if (width > decalOpt.maxTileWidth) { + warn('maxTileWidth'); } - brushDecal(); - - if (isValidKey) { - decalCache.put(cacheKey, canvas || svgRoot); + if (height > decalOpt.maxTileHeight) { + warn('maxTileHeight'); } + } - pattern.image = canvas; - pattern.svgElement = svgRoot; - pattern.svgWidth = pSize.width; - pattern.svgHeight = pSize.height; - /** - * Get minumum length that can make a repeatable pattern. - * - * @return {Object} pattern width and height - */ - - function getPatternSize() { - /** - * For example, if dash is [[3, 2], [2, 1]] for X, it looks like - * |--- --- --- --- --- ... - * |-- -- -- -- -- -- -- -- ... - * |--- --- --- --- --- ... - * |-- -- -- -- -- -- -- -- ... - * So the minumum length of X is 15, - * which is the least common multiple of `3 + 2` and `2 + 1` - * |--- --- --- |--- --- ... - * |-- -- -- -- -- |-- -- -- ... - */ - var width = 1; - - for (var i = 0, xlen = lineBlockLengthsX.length; i < xlen; ++i) { - width = getLeastCommonMultiple(width, lineBlockLengthsX[i]); - } + return { + width: Math.max(1, Math.min(width, decalOpt.maxTileWidth)), + height: Math.max(1, Math.min(height, decalOpt.maxTileHeight)) + }; + } - var symbolRepeats = 1; + function brushDecal() { + if (ctx) { + ctx.clearRect(0, 0, canvas.width, canvas.height); - for (var i = 0, xlen = symbolArray.length; i < xlen; ++i) { - symbolRepeats = getLeastCommonMultiple(symbolRepeats, symbolArray[i].length); - } + if (decalOpt.backgroundColor) { + ctx.fillStyle = decalOpt.backgroundColor; + ctx.fillRect(0, 0, canvas.width, canvas.height); + } + } - width *= symbolRepeats; - var height = lineBlockLengthY * lineBlockLengthsX.length * symbolArray.length; + var ySum = 0; - if ("development" !== 'production') { - var warn = function (attrName) { - /* eslint-disable-next-line */ - console.warn("Calculated decal size is greater than " + attrName + " due to decal option settings so " + attrName + " is used for the decal size. Please consider changing the decal option to make a smaller decal or set " + attrName + " to be larger to avoid incontinuity."); - }; + for (var i = 0; i < dashArrayY.length; ++i) { + ySum += dashArrayY[i]; + } - if (width > decalOpt.maxTileWidth) { - warn('maxTileWidth'); - } + if (ySum <= 0) { + // dashArrayY is 0, draw nothing + return; + } - if (height > decalOpt.maxTileHeight) { - warn('maxTileHeight'); - } - } + var y = -lineBlockLengthY; + var yId = 0; + var yIdTotal = 0; + var xId0 = 0; - return { - width: Math.max(1, Math.min(width, decalOpt.maxTileWidth)), - height: Math.max(1, Math.min(height, decalOpt.maxTileHeight)) - }; - } + while (y < pSize.height) { + if (yId % 2 === 0) { + var symbolYId = yIdTotal / 2 % symbolArray.length; + var x = 0; + var xId1 = 0; + var xId1Total = 0; - function brushDecal() { - if (ctx) { - ctx.clearRect(0, 0, canvas.width, canvas.height); + while (x < pSize.width * 2) { + var xSum = 0; - if (decalOpt.backgroundColor) { - ctx.fillStyle = decalOpt.backgroundColor; - ctx.fillRect(0, 0, canvas.width, canvas.height); - } + for (var i = 0; i < dashArrayX[xId0].length; ++i) { + xSum += dashArrayX[xId0][i]; } - var ySum = 0; + if (xSum <= 0) { + // Skip empty line + break; + } // E.g., [15, 5, 20, 5] draws only for 15 and 20 - for (var i = 0; i < dashArrayY.length; ++i) { - ySum += dashArrayY[i]; - } - if (ySum <= 0) { - // dashArrayY is 0, draw nothing - return; + if (xId1 % 2 === 0) { + var size = (1 - decalOpt.symbolSize) * 0.5; + var left = x + dashArrayX[xId0][xId1] * size; + var top_1 = y + dashArrayY[yId] * size; + var width = dashArrayX[xId0][xId1] * decalOpt.symbolSize; + var height = dashArrayY[yId] * decalOpt.symbolSize; + var symbolXId = xId1Total / 2 % symbolArray[symbolYId].length; + brushSymbol(left, top_1, width, height, symbolArray[symbolYId][symbolXId]); } - var y = -lineBlockLengthY; - var yId = 0; - var yIdTotal = 0; - var xId0 = 0; + x += dashArrayX[xId0][xId1]; + ++xId1Total; + ++xId1; - while (y < pSize.height) { - if (yId % 2 === 0) { - var symbolYId = yIdTotal / 2 % symbolArray.length; - var x = 0; - var xId1 = 0; - var xId1Total = 0; - - while (x < pSize.width * 2) { - var xSum = 0; - - for (var i = 0; i < dashArrayX[xId0].length; ++i) { - xSum += dashArrayX[xId0][i]; - } - - if (xSum <= 0) { - // Skip empty line - break; - } // E.g., [15, 5, 20, 5] draws only for 15 and 20 - - - if (xId1 % 2 === 0) { - var size = (1 - decalOpt.symbolSize) * 0.5; - var left = x + dashArrayX[xId0][xId1] * size; - var top_1 = y + dashArrayY[yId] * size; - var width = dashArrayX[xId0][xId1] * decalOpt.symbolSize; - var height = dashArrayY[yId] * decalOpt.symbolSize; - var symbolXId = xId1Total / 2 % symbolArray[symbolYId].length; - brushSymbol(left, top_1, width, height, symbolArray[symbolYId][symbolXId]); - } - - x += dashArrayX[xId0][xId1]; - ++xId1Total; - ++xId1; - - if (xId1 === dashArrayX[xId0].length) { - xId1 = 0; - } - } + if (xId1 === dashArrayX[xId0].length) { + xId1 = 0; + } + } - ++xId0; + ++xId0; - if (xId0 === dashArrayX.length) { - xId0 = 0; - } - } + if (xId0 === dashArrayX.length) { + xId0 = 0; + } + } - y += dashArrayY[yId]; - ++yIdTotal; - ++yId; + y += dashArrayY[yId]; + ++yIdTotal; + ++yId; - if (yId === dashArrayY.length) { - yId = 0; - } - } + if (yId === dashArrayY.length) { + yId = 0; + } + } - function brushSymbol(x, y, width, height, symbolType) { - var scale = isSVG ? 1 : dpr; - var symbol = createSymbol(symbolType, x * scale, y * scale, width * scale, height * scale, decalOpt.color, decalOpt.symbolKeepAspect); + function brushSymbol(x, y, width, height, symbolType) { + var scale = isSVG ? 1 : dpr; + var symbol = createSymbol(symbolType, x * scale, y * scale, width * scale, height * scale, decalOpt.color, decalOpt.symbolKeepAspect); - if (isSVG) { - var symbolVNode = zr.painter.renderOneToVNode(symbol); + if (isSVG) { + var symbolVNode = zr.painter.renderOneToVNode(symbol); - if (symbolVNode) { - svgRoot.children.push(symbolVNode); - } - } else { - // Paint to canvas for all other renderers. - brushSingle(ctx, symbol); - } - } + if (symbolVNode) { + svgRoot.children.push(symbolVNode); + } + } else { + // Paint to canvas for all other renderers. + brushSingle(ctx, symbol); } + } } + } } /** * Convert symbol array into normalized array @@ -27820,38 +27820,38 @@ */ function normalizeSymbolArray(symbol) { - if (!symbol || symbol.length === 0) { - return [['rect']]; - } + if (!symbol || symbol.length === 0) { + return [['rect']]; + } - if (isString(symbol)) { - return [[symbol]]; - } + if (isString(symbol)) { + return [[symbol]]; + } - var isAllString = true; + var isAllString = true; - for (var i = 0; i < symbol.length; ++i) { - if (!isString(symbol[i])) { - isAllString = false; - break; - } + for (var i = 0; i < symbol.length; ++i) { + if (!isString(symbol[i])) { + isAllString = false; + break; } + } - if (isAllString) { - return normalizeSymbolArray([symbol]); - } + if (isAllString) { + return normalizeSymbolArray([symbol]); + } - var result = []; + var result = []; - for (var i = 0; i < symbol.length; ++i) { - if (isString(symbol[i])) { - result.push([symbol[i]]); - } else { - result.push(symbol[i]); - } + for (var i = 0; i < symbol.length; ++i) { + if (isString(symbol[i])) { + result.push([symbol[i]]); + } else { + result.push(symbol[i]); } + } - return result; + return result; } /** * Convert dash input into dashArray @@ -27862,55 +27862,55 @@ function normalizeDashArrayX(dash) { - if (!dash || dash.length === 0) { - return [[0, 0]]; - } - - if (isNumber(dash)) { - var dashValue = Math.ceil(dash); - return [[dashValue, dashValue]]; - } - /** - * [20, 5] should be normalized into [[20, 5]], - * while [20, [5, 10]] should be normalized into [[20, 20], [5, 10]] - */ + if (!dash || dash.length === 0) { + return [[0, 0]]; + } + + if (isNumber(dash)) { + var dashValue = Math.ceil(dash); + return [[dashValue, dashValue]]; + } + /** + * [20, 5] should be normalized into [[20, 5]], + * while [20, [5, 10]] should be normalized into [[20, 20], [5, 10]] + */ - var isAllNumber = true; + var isAllNumber = true; - for (var i = 0; i < dash.length; ++i) { - if (!isNumber(dash[i])) { - isAllNumber = false; - break; - } + for (var i = 0; i < dash.length; ++i) { + if (!isNumber(dash[i])) { + isAllNumber = false; + break; } + } - if (isAllNumber) { - return normalizeDashArrayX([dash]); - } + if (isAllNumber) { + return normalizeDashArrayX([dash]); + } - var result = []; + var result = []; - for (var i = 0; i < dash.length; ++i) { - if (isNumber(dash[i])) { - var dashValue = Math.ceil(dash[i]); - result.push([dashValue, dashValue]); - } else { - var dashValue = map(dash[i], function (n) { - return Math.ceil(n); - }); + for (var i = 0; i < dash.length; ++i) { + if (isNumber(dash[i])) { + var dashValue = Math.ceil(dash[i]); + result.push([dashValue, dashValue]); + } else { + var dashValue = map(dash[i], function (n) { + return Math.ceil(n); + }); - if (dashValue.length % 2 === 1) { - // [4, 2, 1] means |---- - -- |---- - -- | - // so normalize it to be [4, 2, 1, 4, 2, 1] - result.push(dashValue.concat(dashValue)); - } else { - result.push(dashValue); - } - } + if (dashValue.length % 2 === 1) { + // [4, 2, 1] means |---- - -- |---- - -- | + // so normalize it to be [4, 2, 1, 4, 2, 1] + result.push(dashValue.concat(dashValue)); + } else { + result.push(dashValue); + } } + } - return result; + return result; } /** * Convert dash input into dashArray @@ -27921,19 +27921,19 @@ function normalizeDashArrayY(dash) { - if (!dash || typeof dash === 'object' && dash.length === 0) { - return [0, 0]; - } + if (!dash || typeof dash === 'object' && dash.length === 0) { + return [0, 0]; + } - if (isNumber(dash)) { - var dashValue_1 = Math.ceil(dash); - return [dashValue_1, dashValue_1]; - } + if (isNumber(dash)) { + var dashValue_1 = Math.ceil(dash); + return [dashValue_1, dashValue_1]; + } - var dashValue = map(dash, function (n) { - return Math.ceil(n); - }); - return dash.length % 2 ? dashValue.concat(dashValue) : dashValue; + var dashValue = map(dash, function (n) { + return Math.ceil(n); + }); + return dash.length % 2 ? dashValue.concat(dashValue) : dashValue; } /** * Get block length of each line. A block is the length of dash line and space. @@ -27946,53 +27946,53 @@ function getLineBlockLengthX(dash) { - return map(dash, function (line) { - return getLineBlockLengthY(line); - }); + return map(dash, function (line) { + return getLineBlockLengthY(line); + }); } function getLineBlockLengthY(dash) { - var blockLength = 0; + var blockLength = 0; - for (var i = 0; i < dash.length; ++i) { - blockLength += dash[i]; - } + for (var i = 0; i < dash.length; ++i) { + blockLength += dash[i]; + } - if (dash.length % 2 === 1) { - // [4, 2, 1] means |---- - -- |---- - -- | - // So total length is (4 + 2 + 1) * 2 - return blockLength * 2; - } + if (dash.length % 2 === 1) { + // [4, 2, 1] means |---- - -- |---- - -- | + // So total length is (4 + 2 + 1) * 2 + return blockLength * 2; + } - return blockLength; + return blockLength; } function decalVisual(ecModel, api) { - ecModel.eachRawSeries(function (seriesModel) { - if (ecModel.isSeriesFiltered(seriesModel)) { - return; - } + ecModel.eachRawSeries(function (seriesModel) { + if (ecModel.isSeriesFiltered(seriesModel)) { + return; + } - var data = seriesModel.getData(); + var data = seriesModel.getData(); - if (data.hasItemVisual()) { - data.each(function (idx) { - var decal = data.getItemVisual(idx, 'decal'); + if (data.hasItemVisual()) { + data.each(function (idx) { + var decal = data.getItemVisual(idx, 'decal'); - if (decal) { - var itemStyle = data.ensureUniqueItemVisual(idx, 'style'); - itemStyle.decal = createOrUpdatePatternFromDecal(decal, api); - } - }); + if (decal) { + var itemStyle = data.ensureUniqueItemVisual(idx, 'style'); + itemStyle.decal = createOrUpdatePatternFromDecal(decal, api); } + }); + } - var decal = data.getVisual('decal'); + var decal = data.getVisual('decal'); - if (decal) { - var style = data.getVisual('style'); - style.decal = createOrUpdatePatternFromDecal(decal, api); - } - }); + if (decal) { + var style = data.getVisual('style'); + style.decal = createOrUpdatePatternFromDecal(decal, api); + } + }); } var lifecycle = new Eventful(); @@ -28003,28 +28003,28 @@ var implsStore = {}; // TODO Type function registerImpl(name, impl) { - if ("development" !== 'production') { - if (implsStore[name]) { - error("Already has an implementation of " + name + "."); - } + if ("development" !== 'production') { + if (implsStore[name]) { + error("Already has an implementation of " + name + "."); } + } - implsStore[name] = impl; + implsStore[name] = impl; } function getImpl(name) { - if ("development" !== 'production') { - if (!implsStore[name]) { - error("Implementation of " + name + " doesn't exists."); - } + if ("development" !== 'production') { + if (!implsStore[name]) { + error("Implementation of " + name + " doesn't exists."); } + } - return implsStore[name]; + return implsStore[name]; } var hasWindow = typeof window !== 'undefined'; var version$1 = '5.3.2'; var dependencies = { - zrender: '5.3.1' + zrender: '5.3.1' }; var TEST_FRAME_REMAIN_TIME = 1; var PRIORITY_PROCESSOR_SERIES_FILTER = 800; // Some data processors depends on the stack result dimension (to calculate data extent). @@ -28052,23 +28052,23 @@ var PRIORITY_VISUAL_ARIA = 6000; var PRIORITY_VISUAL_DECAL = 7000; var PRIORITY = { - PROCESSOR: { - FILTER: PRIORITY_PROCESSOR_FILTER, - SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER, - STATISTIC: PRIORITY_PROCESSOR_STATISTIC - }, - VISUAL: { - LAYOUT: PRIORITY_VISUAL_LAYOUT, - PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT, - GLOBAL: PRIORITY_VISUAL_GLOBAL, - CHART: PRIORITY_VISUAL_CHART, - POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT, - COMPONENT: PRIORITY_VISUAL_COMPONENT, - BRUSH: PRIORITY_VISUAL_BRUSH, - CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM, - ARIA: PRIORITY_VISUAL_ARIA, - DECAL: PRIORITY_VISUAL_DECAL - } + PROCESSOR: { + FILTER: PRIORITY_PROCESSOR_FILTER, + SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER, + STATISTIC: PRIORITY_PROCESSOR_STATISTIC + }, + VISUAL: { + LAYOUT: PRIORITY_VISUAL_LAYOUT, + PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT, + GLOBAL: PRIORITY_VISUAL_GLOBAL, + CHART: PRIORITY_VISUAL_CHART, + POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT, + COMPONENT: PRIORITY_VISUAL_COMPONENT, + BRUSH: PRIORITY_VISUAL_BRUSH, + CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM, + ARIA: PRIORITY_VISUAL_ARIA, + DECAL: PRIORITY_VISUAL_DECAL + } }; // Main process have three entries: `setOption`, `dispatchAction` and `resize`, // where they must not be invoked nestedly, except the only case: invoke // dispatchAction with updateMethod "none" in main process. @@ -28085,51 +28085,51 @@ var CONNECT_STATUS_UPDATED = 2; function createRegisterEventWithLowercaseECharts(method) { - return function () { - var args = []; + return function () { + var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } - if (this.isDisposed()) { - disposedWarning(this.id); - return; - } + if (this.isDisposed()) { + disposedWarning(this.id); + return; + } - return toLowercaseNameAndCallEventful(this, method, args); - }; + return toLowercaseNameAndCallEventful(this, method, args); + }; } function createRegisterEventWithLowercaseMessageCenter(method) { - return function () { - var args = []; + return function () { + var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } - return toLowercaseNameAndCallEventful(this, method, args); - }; + return toLowercaseNameAndCallEventful(this, method, args); + }; } function toLowercaseNameAndCallEventful(host, method, args) { - // `args[0]` is event name. Event name is all lowercase. - args[0] = args[0] && args[0].toLowerCase(); - return Eventful.prototype[method].apply(host, args); + // `args[0]` is event name. Event name is all lowercase. + args[0] = args[0] && args[0].toLowerCase(); + return Eventful.prototype[method].apply(host, args); } var MessageCenter = - /** @class */ - function (_super) { - __extends(MessageCenter, _super); + /** @class */ + function (_super) { + __extends(MessageCenter, _super); - function MessageCenter() { - return _super !== null && _super.apply(this, arguments) || this; - } + function MessageCenter() { + return _super !== null && _super.apply(this, arguments) || this; + } - return MessageCenter; - }(Eventful); + return MessageCenter; + }(Eventful); var messageCenterProto = MessageCenter.prototype; messageCenterProto.on = createRegisterEventWithLowercaseMessageCenter('on'); @@ -28157,1969 +28157,1969 @@ var applyChangedStates; var ECharts = - /** @class */ - function (_super) { - __extends(ECharts, _super); + /** @class */ + function (_super) { + __extends(ECharts, _super); - function ECharts(dom, // Theme name or themeOption. - theme, opts) { - var _this = _super.call(this, new ECEventProcessor()) || this; + function ECharts(dom, // Theme name or themeOption. + theme, opts) { + var _this = _super.call(this, new ECEventProcessor()) || this; - _this._chartsViews = []; - _this._chartsMap = {}; - _this._componentsViews = []; - _this._componentsMap = {}; // Can't dispatch action during rendering procedure + _this._chartsViews = []; + _this._chartsMap = {}; + _this._componentsViews = []; + _this._componentsMap = {}; // Can't dispatch action during rendering procedure - _this._pendingActions = []; - opts = opts || {}; // Get theme by name + _this._pendingActions = []; + opts = opts || {}; // Get theme by name - if (isString(theme)) { - theme = themeStorage[theme]; - } - - _this._dom = dom; - var defaultRenderer = 'canvas'; - var defaultUseDirtyRect = false; + if (isString(theme)) { + theme = themeStorage[theme]; + } - if ("development" !== 'production') { - var root = - /* eslint-disable-next-line */ - hasWindow ? window : global; - defaultRenderer = root.__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer; - var devUseDirtyRect = root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__; - defaultUseDirtyRect = devUseDirtyRect == null ? defaultUseDirtyRect : devUseDirtyRect; - } - - var zr = _this._zr = init(dom, { - renderer: opts.renderer || defaultRenderer, - devicePixelRatio: opts.devicePixelRatio, - width: opts.width, - height: opts.height, - ssr: opts.ssr, - useDirtyRect: opts.useDirtyRect == null ? defaultUseDirtyRect : opts.useDirtyRect - }); - _this._ssr = opts.ssr; // Expect 60 fps. + _this._dom = dom; + var defaultRenderer = 'canvas'; + var defaultUseDirtyRect = false; - _this._throttledZrFlush = throttle(bind(zr.flush, zr), 17); - theme = clone(theme); - theme && globalBackwardCompat(theme, true); - _this._theme = theme; - _this._locale = createLocaleObject(opts.locale || SYSTEM_LANG); - _this._coordSysMgr = new CoordinateSystemManager(); - var api = _this._api = createExtensionAPI(_this); // Sort on demand + if ("development" !== 'production') { + var root = + /* eslint-disable-next-line */ + hasWindow ? window : global; + defaultRenderer = root.__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer; + var devUseDirtyRect = root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__; + defaultUseDirtyRect = devUseDirtyRect == null ? defaultUseDirtyRect : devUseDirtyRect; + } + + var zr = _this._zr = init(dom, { + renderer: opts.renderer || defaultRenderer, + devicePixelRatio: opts.devicePixelRatio, + width: opts.width, + height: opts.height, + ssr: opts.ssr, + useDirtyRect: opts.useDirtyRect == null ? defaultUseDirtyRect : opts.useDirtyRect + }); + _this._ssr = opts.ssr; // Expect 60 fps. + + _this._throttledZrFlush = throttle(bind(zr.flush, zr), 17); + theme = clone(theme); + theme && globalBackwardCompat(theme, true); + _this._theme = theme; + _this._locale = createLocaleObject(opts.locale || SYSTEM_LANG); + _this._coordSysMgr = new CoordinateSystemManager(); + var api = _this._api = createExtensionAPI(_this); // Sort on demand + + function prioritySortFunc(a, b) { + return a.__prio - b.__prio; + } + + sort(visualFuncs, prioritySortFunc); + sort(dataProcessorFuncs, prioritySortFunc); + _this._scheduler = new Scheduler(_this, api, dataProcessorFuncs, visualFuncs); + _this._messageCenter = new MessageCenter(); // Init mouse events + + _this._initEvents(); // In case some people write `window.onresize = chart.resize` + + + _this.resize = bind(_this.resize, _this); + zr.animation.on('frame', _this._onframe, _this); + bindRenderedEvent(zr, _this); + bindMouseEvent(zr, _this); // ECharts instance can be used as value. + + setAsPrimitive(_this); + return _this; + } + + ECharts.prototype._onframe = function () { + if (this._disposed) { + return; + } + + applyChangedStates(this); + var scheduler = this._scheduler; // Lazy update + + if (this[PENDING_UPDATE]) { + var silent = this[PENDING_UPDATE].silent; + this[IN_MAIN_PROCESS_KEY] = true; + + try { + prepare(this); + updateMethods.update.call(this, null, this[PENDING_UPDATE].updateParams); + } catch (e) { + this[IN_MAIN_PROCESS_KEY] = false; + this[PENDING_UPDATE] = null; + throw e; + } // At present, in each frame, zrender performs: + // (1) animation step forward. + // (2) trigger('frame') (where this `_onframe` is called) + // (3) zrender flush (render). + // If we do nothing here, since we use `setToFinal: true`, the step (3) above + // will render the final state of the elements before the real animation started. + + + this._zr.flush(); + + this[IN_MAIN_PROCESS_KEY] = false; + this[PENDING_UPDATE] = null; + flushPendingActions.call(this, silent); + triggerUpdatedEvent.call(this, silent); + } // Avoid do both lazy update and progress in one frame. + else if (scheduler.unfinished) { + // Stream progress. + var remainTime = TEST_FRAME_REMAIN_TIME; + var ecModel = this._model; + var api = this._api; + scheduler.unfinished = false; - function prioritySortFunc(a, b) { - return a.__prio - b.__prio; - } + do { + var startTime = +new Date(); + scheduler.performSeriesTasks(ecModel); // Currently dataProcessorFuncs do not check threshold. - sort(visualFuncs, prioritySortFunc); - sort(dataProcessorFuncs, prioritySortFunc); - _this._scheduler = new Scheduler(_this, api, dataProcessorFuncs, visualFuncs); - _this._messageCenter = new MessageCenter(); // Init mouse events + scheduler.performDataProcessorTasks(ecModel); + updateStreamModes(this, ecModel); // Do not update coordinate system here. Because that coord system update in + // each frame is not a good user experience. So we follow the rule that + // the extent of the coordinate system is determin in the first frame (the + // frame is executed immedietely after task reset. + // this._coordSysMgr.update(ecModel, api); + // console.log('--- ec frame visual ---', remainTime); - _this._initEvents(); // In case some people write `window.onresize = chart.resize` + scheduler.performVisualTasks(ecModel); + renderSeries(this, this._model, api, 'remain', {}); + remainTime -= +new Date() - startTime; + } while (remainTime > 0 && scheduler.unfinished); // Call flush explicitly for trigger finished event. - _this.resize = bind(_this.resize, _this); - zr.animation.on('frame', _this._onframe, _this); - bindRenderedEvent(zr, _this); - bindMouseEvent(zr, _this); // ECharts instance can be used as value. + if (!scheduler.unfinished) { + this._zr.flush(); + } // Else, zr flushing be ensue within the same frame, + // because zr flushing is after onframe event. - setAsPrimitive(_this); - return _this; - } + } + }; - ECharts.prototype._onframe = function () { - if (this._disposed) { - return; - } + ECharts.prototype.getDom = function () { + return this._dom; + }; - applyChangedStates(this); - var scheduler = this._scheduler; // Lazy update - - if (this[PENDING_UPDATE]) { - var silent = this[PENDING_UPDATE].silent; - this[IN_MAIN_PROCESS_KEY] = true; - - try { - prepare(this); - updateMethods.update.call(this, null, this[PENDING_UPDATE].updateParams); - } catch (e) { - this[IN_MAIN_PROCESS_KEY] = false; - this[PENDING_UPDATE] = null; - throw e; - } // At present, in each frame, zrender performs: - // (1) animation step forward. - // (2) trigger('frame') (where this `_onframe` is called) - // (3) zrender flush (render). - // If we do nothing here, since we use `setToFinal: true`, the step (3) above - // will render the final state of the elements before the real animation started. - - - this._zr.flush(); - - this[IN_MAIN_PROCESS_KEY] = false; - this[PENDING_UPDATE] = null; - flushPendingActions.call(this, silent); - triggerUpdatedEvent.call(this, silent); - } // Avoid do both lazy update and progress in one frame. - else if (scheduler.unfinished) { - // Stream progress. - var remainTime = TEST_FRAME_REMAIN_TIME; - var ecModel = this._model; - var api = this._api; - scheduler.unfinished = false; - - do { - var startTime = +new Date(); - scheduler.performSeriesTasks(ecModel); // Currently dataProcessorFuncs do not check threshold. - - scheduler.performDataProcessorTasks(ecModel); - updateStreamModes(this, ecModel); // Do not update coordinate system here. Because that coord system update in - // each frame is not a good user experience. So we follow the rule that - // the extent of the coordinate system is determin in the first frame (the - // frame is executed immedietely after task reset. - // this._coordSysMgr.update(ecModel, api); - // console.log('--- ec frame visual ---', remainTime); - - scheduler.performVisualTasks(ecModel); - renderSeries(this, this._model, api, 'remain', {}); - remainTime -= +new Date() - startTime; - } while (remainTime > 0 && scheduler.unfinished); // Call flush explicitly for trigger finished event. - - - if (!scheduler.unfinished) { - this._zr.flush(); - } // Else, zr flushing be ensue within the same frame, - // because zr flushing is after onframe event. + ECharts.prototype.getId = function () { + return this.id; + }; - } - }; + ECharts.prototype.getZr = function () { + return this._zr; + }; - ECharts.prototype.getDom = function () { - return this._dom; - }; + ECharts.prototype.isSSR = function () { + return this._ssr; + }; + /* eslint-disable-next-line */ - ECharts.prototype.getId = function () { - return this.id; - }; - ECharts.prototype.getZr = function () { - return this._zr; - }; + ECharts.prototype.setOption = function (option, notMerge, lazyUpdate) { + if (this[IN_MAIN_PROCESS_KEY]) { + if ("development" !== 'production') { + error('`setOption` should not be called during main process.'); + } - ECharts.prototype.isSSR = function () { - return this._ssr; - }; - /* eslint-disable-next-line */ + return; + } + if (this._disposed) { + disposedWarning(this.id); + return; + } - ECharts.prototype.setOption = function (option, notMerge, lazyUpdate) { - if (this[IN_MAIN_PROCESS_KEY]) { - if ("development" !== 'production') { - error('`setOption` should not be called during main process.'); - } + var silent; + var replaceMerge; + var transitionOpt; - return; - } + if (isObject(notMerge)) { + lazyUpdate = notMerge.lazyUpdate; + silent = notMerge.silent; + replaceMerge = notMerge.replaceMerge; + transitionOpt = notMerge.transition; + notMerge = notMerge.notMerge; + } - if (this._disposed) { - disposedWarning(this.id); - return; - } + this[IN_MAIN_PROCESS_KEY] = true; - var silent; - var replaceMerge; - var transitionOpt; + if (!this._model || notMerge) { + var optionManager = new OptionManager(this._api); + var theme = this._theme; + var ecModel = this._model = new GlobalModel(); + ecModel.scheduler = this._scheduler; + ecModel.ssr = this._ssr; + ecModel.init(null, null, null, theme, this._locale, optionManager); + } - if (isObject(notMerge)) { - lazyUpdate = notMerge.lazyUpdate; - silent = notMerge.silent; - replaceMerge = notMerge.replaceMerge; - transitionOpt = notMerge.transition; - notMerge = notMerge.notMerge; - } + this._model.setOption(option, { + replaceMerge: replaceMerge + }, optionPreprocessorFuncs); - this[IN_MAIN_PROCESS_KEY] = true; + var updateParams = { + seriesTransition: transitionOpt, + optionChanged: true + }; - if (!this._model || notMerge) { - var optionManager = new OptionManager(this._api); - var theme = this._theme; - var ecModel = this._model = new GlobalModel(); - ecModel.scheduler = this._scheduler; - ecModel.ssr = this._ssr; - ecModel.init(null, null, null, theme, this._locale, optionManager); - } + if (lazyUpdate) { + this[PENDING_UPDATE] = { + silent: silent, + updateParams: updateParams + }; + this[IN_MAIN_PROCESS_KEY] = false; // `setOption(option, {lazyMode: true})` may be called when zrender has been slept. + // It should wake it up to make sure zrender start to render at the next frame. - this._model.setOption(option, { - replaceMerge: replaceMerge - }, optionPreprocessorFuncs); + this.getZr().wakeUp(); + } else { + try { + prepare(this); + updateMethods.update.call(this, null, updateParams); + } catch (e) { + this[PENDING_UPDATE] = null; + this[IN_MAIN_PROCESS_KEY] = false; + throw e; + } // Ensure zr refresh sychronously, and then pixel in canvas can be + // fetched after `setOption`. + + + if (!this._ssr) { + // not use flush when using ssr mode. + this._zr.flush(); + } + + this[PENDING_UPDATE] = null; + this[IN_MAIN_PROCESS_KEY] = false; + flushPendingActions.call(this, silent); + triggerUpdatedEvent.call(this, silent); + } + }; + /** + * @deprecated + */ - var updateParams = { - seriesTransition: transitionOpt, - optionChanged: true - }; - if (lazyUpdate) { - this[PENDING_UPDATE] = { - silent: silent, - updateParams: updateParams - }; - this[IN_MAIN_PROCESS_KEY] = false; // `setOption(option, {lazyMode: true})` may be called when zrender has been slept. - // It should wake it up to make sure zrender start to render at the next frame. + ECharts.prototype.setTheme = function () { + deprecateLog('ECharts#setTheme() is DEPRECATED in ECharts 3.0'); + }; // We don't want developers to use getModel directly. - this.getZr().wakeUp(); - } else { - try { - prepare(this); - updateMethods.update.call(this, null, updateParams); - } catch (e) { - this[PENDING_UPDATE] = null; - this[IN_MAIN_PROCESS_KEY] = false; - throw e; - } // Ensure zr refresh sychronously, and then pixel in canvas can be - // fetched after `setOption`. - - - if (!this._ssr) { - // not use flush when using ssr mode. - this._zr.flush(); - } - this[PENDING_UPDATE] = null; - this[IN_MAIN_PROCESS_KEY] = false; - flushPendingActions.call(this, silent); - triggerUpdatedEvent.call(this, silent); - } - }; - /** - * @deprecated - */ + ECharts.prototype.getModel = function () { + return this._model; + }; + ECharts.prototype.getOption = function () { + return this._model && this._model.getOption(); + }; - ECharts.prototype.setTheme = function () { - deprecateLog('ECharts#setTheme() is DEPRECATED in ECharts 3.0'); - }; // We don't want developers to use getModel directly. + ECharts.prototype.getWidth = function () { + return this._zr.getWidth(); + }; + ECharts.prototype.getHeight = function () { + return this._zr.getHeight(); + }; - ECharts.prototype.getModel = function () { - return this._model; - }; + ECharts.prototype.getDevicePixelRatio = function () { + return this._zr.painter.dpr + /* eslint-disable-next-line */ + || hasWindow && window.devicePixelRatio || 1; + }; + /** + * Get canvas which has all thing rendered + * @deprecated Use renderToCanvas instead. + */ - ECharts.prototype.getOption = function () { - return this._model && this._model.getOption(); - }; - ECharts.prototype.getWidth = function () { - return this._zr.getWidth(); - }; + ECharts.prototype.getRenderedCanvas = function (opts) { + if ("development" !== 'production') { + deprecateReplaceLog('getRenderedCanvas', 'renderToCanvas'); + } - ECharts.prototype.getHeight = function () { - return this._zr.getHeight(); - }; + return this.renderToCanvas(opts); + }; - ECharts.prototype.getDevicePixelRatio = function () { - return this._zr.painter.dpr - /* eslint-disable-next-line */ - || hasWindow && window.devicePixelRatio || 1; - }; - /** - * Get canvas which has all thing rendered - * @deprecated Use renderToCanvas instead. - */ + ECharts.prototype.renderToCanvas = function (opts) { + opts = opts || {}; + var painter = this._zr.painter; + if ("development" !== 'production') { + if (painter.type !== 'canvas') { + throw new Error('renderToCanvas can only be used in the canvas renderer.'); + } + } - ECharts.prototype.getRenderedCanvas = function (opts) { - if ("development" !== 'production') { - deprecateReplaceLog('getRenderedCanvas', 'renderToCanvas'); - } + return painter.getRenderedCanvas({ + backgroundColor: opts.backgroundColor || this._model.get('backgroundColor'), + pixelRatio: opts.pixelRatio || this.getDevicePixelRatio() + }); + }; - return this.renderToCanvas(opts); - }; + ECharts.prototype.renderToSVGString = function (opts) { + opts = opts || {}; + var painter = this._zr.painter; - ECharts.prototype.renderToCanvas = function (opts) { - opts = opts || {}; - var painter = this._zr.painter; + if ("development" !== 'production') { + if (painter.type !== 'svg') { + throw new Error('renderToSVGString can only be used in the svg renderer.'); + } + } - if ("development" !== 'production') { - if (painter.type !== 'canvas') { - throw new Error('renderToCanvas can only be used in the canvas renderer.'); - } - } + return painter.renderToString({ + useViewBox: opts.useViewBox + }); + }; + /** + * Get svg data url + */ - return painter.getRenderedCanvas({ - backgroundColor: opts.backgroundColor || this._model.get('backgroundColor'), - pixelRatio: opts.pixelRatio || this.getDevicePixelRatio() - }); - }; - ECharts.prototype.renderToSVGString = function (opts) { - opts = opts || {}; - var painter = this._zr.painter; + ECharts.prototype.getSvgDataURL = function () { + if (!env.svgSupported) { + return; + } - if ("development" !== 'production') { - if (painter.type !== 'svg') { - throw new Error('renderToSVGString can only be used in the svg renderer.'); - } - } + var zr = this._zr; + var list = zr.storage.getDisplayList(); // Stop animations - return painter.renderToString({ - useViewBox: opts.useViewBox - }); - }; - /** - * Get svg data url - */ + each(list, function (el) { + el.stopAnimation(null, true); + }); + return zr.painter.toDataURL(); + }; + ECharts.prototype.getDataURL = function (opts) { + if (this._disposed) { + disposedWarning(this.id); + return; + } - ECharts.prototype.getSvgDataURL = function () { - if (!env.svgSupported) { - return; - } + opts = opts || {}; + var excludeComponents = opts.excludeComponents; + var ecModel = this._model; + var excludesComponentViews = []; + var self = this; + each(excludeComponents, function (componentType) { + ecModel.eachComponent({ + mainType: componentType + }, function (component) { + var view = self._componentsMap[component.__viewId]; - var zr = this._zr; - var list = zr.storage.getDisplayList(); // Stop animations + if (!view.group.ignore) { + excludesComponentViews.push(view); + view.group.ignore = true; + } + }); + }); + var url = this._zr.painter.getType() === 'svg' ? this.getSvgDataURL() : this.renderToCanvas(opts).toDataURL('image/' + (opts && opts.type || 'png')); + each(excludesComponentViews, function (view) { + view.group.ignore = false; + }); + return url; + }; + + ECharts.prototype.getConnectedDataURL = function (opts) { + if (this._disposed) { + disposedWarning(this.id); + return; + } + + var isSvg = opts.type === 'svg'; + var groupId = this.group; + var mathMin = Math.min; + var mathMax = Math.max; + var MAX_NUMBER = Infinity; + + if (connectedGroups[groupId]) { + var left_1 = MAX_NUMBER; + var top_1 = MAX_NUMBER; + var right_1 = -MAX_NUMBER; + var bottom_1 = -MAX_NUMBER; + var canvasList_1 = []; + var dpr_1 = opts && opts.pixelRatio || this.getDevicePixelRatio(); + each(instances$1, function (chart, id) { + if (chart.group === groupId) { + var canvas = isSvg ? chart.getZr().painter.getSvgDom().innerHTML : chart.renderToCanvas(clone(opts)); + var boundingRect = chart.getDom().getBoundingClientRect(); + left_1 = mathMin(boundingRect.left, left_1); + top_1 = mathMin(boundingRect.top, top_1); + right_1 = mathMax(boundingRect.right, right_1); + bottom_1 = mathMax(boundingRect.bottom, bottom_1); + canvasList_1.push({ + dom: canvas, + left: boundingRect.left, + top: boundingRect.top + }); + } + }); + left_1 *= dpr_1; + top_1 *= dpr_1; + right_1 *= dpr_1; + bottom_1 *= dpr_1; + var width = right_1 - left_1; + var height = bottom_1 - top_1; + var targetCanvas = platformApi.createCanvas(); + var zr_1 = init(targetCanvas, { + renderer: isSvg ? 'svg' : 'canvas' + }); + zr_1.resize({ + width: width, + height: height + }); + + if (isSvg) { + var content_1 = ''; + each(canvasList_1, function (item) { + var x = item.left - left_1; + var y = item.top - top_1; + content_1 += '' + item.dom + ''; + }); + zr_1.painter.getSvgRoot().innerHTML = content_1; - each(list, function (el) { - el.stopAnimation(null, true); - }); - return zr.painter.toDataURL(); - }; + if (opts.connectedBackgroundColor) { + zr_1.painter.setBackgroundColor(opts.connectedBackgroundColor); + } - ECharts.prototype.getDataURL = function (opts) { - if (this._disposed) { - disposedWarning(this.id); - return; + zr_1.refreshImmediately(); + return zr_1.painter.toDataURL(); + } else { + // Background between the charts + if (opts.connectedBackgroundColor) { + zr_1.add(new Rect({ + shape: { + x: 0, + y: 0, + width: width, + height: height + }, + style: { + fill: opts.connectedBackgroundColor } + })); + } - opts = opts || {}; - var excludeComponents = opts.excludeComponents; - var ecModel = this._model; - var excludesComponentViews = []; - var self = this; - each(excludeComponents, function (componentType) { - ecModel.eachComponent({ - mainType: componentType - }, function (component) { - var view = self._componentsMap[component.__viewId]; - - if (!view.group.ignore) { - excludesComponentViews.push(view); - view.group.ignore = true; - } - }); - }); - var url = this._zr.painter.getType() === 'svg' ? this.getSvgDataURL() : this.renderToCanvas(opts).toDataURL('image/' + (opts && opts.type || 'png')); - each(excludesComponentViews, function (view) { - view.group.ignore = false; - }); - return url; - }; - - ECharts.prototype.getConnectedDataURL = function (opts) { - if (this._disposed) { - disposedWarning(this.id); - return; + each(canvasList_1, function (item) { + var img = new ZRImage({ + style: { + x: item.left * dpr_1 - left_1, + y: item.top * dpr_1 - top_1, + image: item.dom } + }); + zr_1.add(img); + }); + zr_1.refreshImmediately(); + return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png')); + } + } else { + return this.getDataURL(opts); + } + }; - var isSvg = opts.type === 'svg'; - var groupId = this.group; - var mathMin = Math.min; - var mathMax = Math.max; - var MAX_NUMBER = Infinity; - - if (connectedGroups[groupId]) { - var left_1 = MAX_NUMBER; - var top_1 = MAX_NUMBER; - var right_1 = -MAX_NUMBER; - var bottom_1 = -MAX_NUMBER; - var canvasList_1 = []; - var dpr_1 = opts && opts.pixelRatio || this.getDevicePixelRatio(); - each(instances$1, function (chart, id) { - if (chart.group === groupId) { - var canvas = isSvg ? chart.getZr().painter.getSvgDom().innerHTML : chart.renderToCanvas(clone(opts)); - var boundingRect = chart.getDom().getBoundingClientRect(); - left_1 = mathMin(boundingRect.left, left_1); - top_1 = mathMin(boundingRect.top, top_1); - right_1 = mathMax(boundingRect.right, right_1); - bottom_1 = mathMax(boundingRect.bottom, bottom_1); - canvasList_1.push({ - dom: canvas, - left: boundingRect.left, - top: boundingRect.top - }); - } - }); - left_1 *= dpr_1; - top_1 *= dpr_1; - right_1 *= dpr_1; - bottom_1 *= dpr_1; - var width = right_1 - left_1; - var height = bottom_1 - top_1; - var targetCanvas = platformApi.createCanvas(); - var zr_1 = init(targetCanvas, { - renderer: isSvg ? 'svg' : 'canvas' - }); - zr_1.resize({ - width: width, - height: height - }); + ECharts.prototype.convertToPixel = function (finder, value) { + return doConvertPixel(this, 'convertToPixel', finder, value); + }; - if (isSvg) { - var content_1 = ''; - each(canvasList_1, function (item) { - var x = item.left - left_1; - var y = item.top - top_1; - content_1 += '' + item.dom + ''; - }); - zr_1.painter.getSvgRoot().innerHTML = content_1; + ECharts.prototype.convertFromPixel = function (finder, value) { + return doConvertPixel(this, 'convertFromPixel', finder, value); + }; + /** + * Is the specified coordinate systems or components contain the given pixel point. + * @param {Array|number} value + * @return {boolean} result + */ - if (opts.connectedBackgroundColor) { - zr_1.painter.setBackgroundColor(opts.connectedBackgroundColor); - } - zr_1.refreshImmediately(); - return zr_1.painter.toDataURL(); - } else { - // Background between the charts - if (opts.connectedBackgroundColor) { - zr_1.add(new Rect({ - shape: { - x: 0, - y: 0, - width: width, - height: height - }, - style: { - fill: opts.connectedBackgroundColor - } - })); - } + ECharts.prototype.containPixel = function (finder, value) { + if (this._disposed) { + disposedWarning(this.id); + return; + } - each(canvasList_1, function (item) { - var img = new ZRImage({ - style: { - x: item.left * dpr_1 - left_1, - y: item.top * dpr_1 - top_1, - image: item.dom - } - }); - zr_1.add(img); - }); - zr_1.refreshImmediately(); - return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png')); - } - } else { - return this.getDataURL(opts); + var ecModel = this._model; + var result; + var findResult = parseFinder(ecModel, finder); + each(findResult, function (models, key) { + key.indexOf('Models') >= 0 && each(models, function (model) { + var coordSys = model.coordinateSystem; + + if (coordSys && coordSys.containPoint) { + result = result || !!coordSys.containPoint(value); + } else if (key === 'seriesModels') { + var view = this._chartsMap[model.__viewId]; + + if (view && view.containPoint) { + result = result || view.containPoint(value, model); + } else { + if ("development" !== 'production') { + console.warn(key + ': ' + (view ? 'The found component do not support containPoint.' : 'No view mapping to the found component.')); } - }; - - ECharts.prototype.convertToPixel = function (finder, value) { - return doConvertPixel(this, 'convertToPixel', finder, value); - }; + } + } else { + if ("development" !== 'production') { + console.warn(key + ': containPoint is not supported'); + } + } + }, this); + }, this); + return !!result; + }; + /** + * Get visual from series or data. + * @param finder + * If string, e.g., 'series', means {seriesIndex: 0}. + * If Object, could contain some of these properties below: + * { + * seriesIndex / seriesId / seriesName, + * dataIndex / dataIndexInside + * } + * If dataIndex is not specified, series visual will be fetched, + * but not data item visual. + * If all of seriesIndex, seriesId, seriesName are not specified, + * visual will be fetched from first series. + * @param visualType 'color', 'symbol', 'symbolSize' + */ - ECharts.prototype.convertFromPixel = function (finder, value) { - return doConvertPixel(this, 'convertFromPixel', finder, value); - }; - /** - * Is the specified coordinate systems or components contain the given pixel point. - * @param {Array|number} value - * @return {boolean} result - */ + ECharts.prototype.getVisual = function (finder, visualType) { + var ecModel = this._model; + var parsedFinder = parseFinder(ecModel, finder, { + defaultMainType: 'series' + }); + var seriesModel = parsedFinder.seriesModel; - ECharts.prototype.containPixel = function (finder, value) { - if (this._disposed) { - disposedWarning(this.id); - return; - } + if ("development" !== 'production') { + if (!seriesModel) { + console.warn('There is no specified seires model'); + } + } - var ecModel = this._model; - var result; - var findResult = parseFinder(ecModel, finder); - each(findResult, function (models, key) { - key.indexOf('Models') >= 0 && each(models, function (model) { - var coordSys = model.coordinateSystem; + var data = seriesModel.getData(); + var dataIndexInside = parsedFinder.hasOwnProperty('dataIndexInside') ? parsedFinder.dataIndexInside : parsedFinder.hasOwnProperty('dataIndex') ? data.indexOfRawIndex(parsedFinder.dataIndex) : null; + return dataIndexInside != null ? getItemVisualFromData(data, dataIndexInside, visualType) : getVisualFromData(data, visualType); + }; + /** + * Get view of corresponding component model + */ - if (coordSys && coordSys.containPoint) { - result = result || !!coordSys.containPoint(value); - } else if (key === 'seriesModels') { - var view = this._chartsMap[model.__viewId]; - if (view && view.containPoint) { - result = result || view.containPoint(value, model); - } else { - if ("development" !== 'production') { - console.warn(key + ': ' + (view ? 'The found component do not support containPoint.' : 'No view mapping to the found component.')); - } - } - } else { - if ("development" !== 'production') { - console.warn(key + ': containPoint is not supported'); - } - } - }, this); - }, this); - return !!result; - }; - /** - * Get visual from series or data. - * @param finder - * If string, e.g., 'series', means {seriesIndex: 0}. - * If Object, could contain some of these properties below: - * { - * seriesIndex / seriesId / seriesName, - * dataIndex / dataIndexInside - * } - * If dataIndex is not specified, series visual will be fetched, - * but not data item visual. - * If all of seriesIndex, seriesId, seriesName are not specified, - * visual will be fetched from first series. - * @param visualType 'color', 'symbol', 'symbolSize' - */ + ECharts.prototype.getViewOfComponentModel = function (componentModel) { + return this._componentsMap[componentModel.__viewId]; + }; + /** + * Get view of corresponding series model + */ - ECharts.prototype.getVisual = function (finder, visualType) { - var ecModel = this._model; - var parsedFinder = parseFinder(ecModel, finder, { - defaultMainType: 'series' - }); - var seriesModel = parsedFinder.seriesModel; + ECharts.prototype.getViewOfSeriesModel = function (seriesModel) { + return this._chartsMap[seriesModel.__viewId]; + }; - if ("development" !== 'production') { - if (!seriesModel) { - console.warn('There is no specified seires model'); - } - } + ECharts.prototype._initEvents = function () { + var _this = this; - var data = seriesModel.getData(); - var dataIndexInside = parsedFinder.hasOwnProperty('dataIndexInside') ? parsedFinder.dataIndexInside : parsedFinder.hasOwnProperty('dataIndex') ? data.indexOfRawIndex(parsedFinder.dataIndex) : null; - return dataIndexInside != null ? getItemVisualFromData(data, dataIndexInside, visualType) : getVisualFromData(data, visualType); - }; - /** - * Get view of corresponding component model - */ + each(MOUSE_EVENT_NAMES, function (eveName) { + var handler = function (e) { + var ecModel = _this.getModel(); + var el = e.target; + var params; + var isGlobalOut = eveName === 'globalout'; // no e.target when 'globalout'. - ECharts.prototype.getViewOfComponentModel = function (componentModel) { - return this._componentsMap[componentModel.__viewId]; - }; - /** - * Get view of corresponding series model - */ + if (isGlobalOut) { + params = {}; + } else { + el && findEventDispatcher(el, function (parent) { + var ecData = getECData(parent); + + if (ecData && ecData.dataIndex != null) { + var dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex); + params = dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType) || {}; + return true; + } // If element has custom eventData of components + else if (ecData.eventData) { + params = extend({}, ecData.eventData); + return true; + } + }, true); + } // Contract: if params prepared in mouse event, + // these properties must be specified: + // { + // componentType: string (component main type) + // componentIndex: number + // } + // Otherwise event query can not work. - ECharts.prototype.getViewOfSeriesModel = function (seriesModel) { - return this._chartsMap[seriesModel.__viewId]; - }; + if (params) { + var componentType = params.componentType; + var componentIndex = params.componentIndex; // Special handling for historic reason: when trigger by + // markLine/markPoint/markArea, the componentType is + // 'markLine'/'markPoint'/'markArea', but we should better + // enable them to be queried by seriesIndex, since their + // option is set in each series. - ECharts.prototype._initEvents = function () { - var _this = this; - - each(MOUSE_EVENT_NAMES, function (eveName) { - var handler = function (e) { - var ecModel = _this.getModel(); - - var el = e.target; - var params; - var isGlobalOut = eveName === 'globalout'; // no e.target when 'globalout'. - - if (isGlobalOut) { - params = {}; - } else { - el && findEventDispatcher(el, function (parent) { - var ecData = getECData(parent); - - if (ecData && ecData.dataIndex != null) { - var dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex); - params = dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType) || {}; - return true; - } // If element has custom eventData of components - else if (ecData.eventData) { - params = extend({}, ecData.eventData); - return true; - } - }, true); - } // Contract: if params prepared in mouse event, - // these properties must be specified: - // { - // componentType: string (component main type) - // componentIndex: number - // } - // Otherwise event query can not work. - - - if (params) { - var componentType = params.componentType; - var componentIndex = params.componentIndex; // Special handling for historic reason: when trigger by - // markLine/markPoint/markArea, the componentType is - // 'markLine'/'markPoint'/'markArea', but we should better - // enable them to be queried by seriesIndex, since their - // option is set in each series. - - if (componentType === 'markLine' || componentType === 'markPoint' || componentType === 'markArea') { - componentType = 'series'; - componentIndex = params.seriesIndex; - } + if (componentType === 'markLine' || componentType === 'markPoint' || componentType === 'markArea') { + componentType = 'series'; + componentIndex = params.seriesIndex; + } - var model = componentType && componentIndex != null && ecModel.getComponent(componentType, componentIndex); - var view = model && _this[model.mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]; + var model = componentType && componentIndex != null && ecModel.getComponent(componentType, componentIndex); + var view = model && _this[model.mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]; - if ("development" !== 'production') { - // `event.componentType` and `event[componentTpype + 'Index']` must not - // be missed, otherwise there is no way to distinguish source component. - // See `dataFormat.getDataParams`. - if (!isGlobalOut && !(model && view)) { - console.warn('model or view can not be found by params'); - } - } + if ("development" !== 'production') { + // `event.componentType` and `event[componentTpype + 'Index']` must not + // be missed, otherwise there is no way to distinguish source component. + // See `dataFormat.getDataParams`. + if (!isGlobalOut && !(model && view)) { + console.warn('model or view can not be found by params'); + } + } - params.event = e; - params.type = eveName; - _this._$eventProcessor.eventInfo = { - targetEl: el, - packedEvent: params, - model: model, - view: view - }; + params.event = e; + params.type = eveName; + _this._$eventProcessor.eventInfo = { + targetEl: el, + packedEvent: params, + model: model, + view: view + }; - _this.trigger(eveName, params); - } - }; // Consider that some component (like tooltip, brush, ...) - // register zr event handler, but user event handler might - // do anything, such as call `setOption` or `dispatchAction`, - // which probably update any of the content and probably - // cause problem if it is called previous other inner handlers. + _this.trigger(eveName, params); + } + }; // Consider that some component (like tooltip, brush, ...) + // register zr event handler, but user event handler might + // do anything, such as call `setOption` or `dispatchAction`, + // which probably update any of the content and probably + // cause problem if it is called previous other inner handlers. - handler.zrEventfulCallAtLast = true; + handler.zrEventfulCallAtLast = true; - _this._zr.on(eveName, handler, _this); - }); - each(eventActionMap, function (actionType, eventType) { - _this._messageCenter.on(eventType, function (event) { - this.trigger(eventType, event); - }, _this); - }); // Extra events - // TODO register? - - each(['selectchanged'], function (eventType) { - _this._messageCenter.on(eventType, function (event) { - this.trigger(eventType, event); - }, _this); - }); - handleLegacySelectEvents(this._messageCenter, this, this._api); - }; + _this._zr.on(eveName, handler, _this); + }); + each(eventActionMap, function (actionType, eventType) { + _this._messageCenter.on(eventType, function (event) { + this.trigger(eventType, event); + }, _this); + }); // Extra events + // TODO register? + + each(['selectchanged'], function (eventType) { + _this._messageCenter.on(eventType, function (event) { + this.trigger(eventType, event); + }, _this); + }); + handleLegacySelectEvents(this._messageCenter, this, this._api); + }; - ECharts.prototype.isDisposed = function () { - return this._disposed; - }; + ECharts.prototype.isDisposed = function () { + return this._disposed; + }; - ECharts.prototype.clear = function () { - if (this._disposed) { - disposedWarning(this.id); - return; - } + ECharts.prototype.clear = function () { + if (this._disposed) { + disposedWarning(this.id); + return; + } - this.setOption({ - series: [] - }, true); - }; + this.setOption({ + series: [] + }, true); + }; - ECharts.prototype.dispose = function () { - if (this._disposed) { - disposedWarning(this.id); - return; - } + ECharts.prototype.dispose = function () { + if (this._disposed) { + disposedWarning(this.id); + return; + } - this._disposed = true; - var dom = this.getDom(); + this._disposed = true; + var dom = this.getDom(); - if (dom) { - setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, ''); - } + if (dom) { + setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, ''); + } - var chart = this; - var api = chart._api; - var ecModel = chart._model; - each(chart._componentsViews, function (component) { - component.dispose(ecModel, api); - }); - each(chart._chartsViews, function (chart) { - chart.dispose(ecModel, api); - }); // Dispose after all views disposed + var chart = this; + var api = chart._api; + var ecModel = chart._model; + each(chart._componentsViews, function (component) { + component.dispose(ecModel, api); + }); + each(chart._chartsViews, function (chart) { + chart.dispose(ecModel, api); + }); // Dispose after all views disposed - chart._zr.dispose(); // Set properties to null. - // To reduce the memory cost in case the top code still holds this instance unexpectedly. + chart._zr.dispose(); // Set properties to null. + // To reduce the memory cost in case the top code still holds this instance unexpectedly. - chart._dom = chart._model = chart._chartsMap = chart._componentsMap = chart._chartsViews = chart._componentsViews = chart._scheduler = chart._api = chart._zr = chart._throttledZrFlush = chart._theme = chart._coordSysMgr = chart._messageCenter = null; - delete instances$1[chart.id]; - }; - /** - * Resize the chart - */ + chart._dom = chart._model = chart._chartsMap = chart._componentsMap = chart._chartsViews = chart._componentsViews = chart._scheduler = chart._api = chart._zr = chart._throttledZrFlush = chart._theme = chart._coordSysMgr = chart._messageCenter = null; + delete instances$1[chart.id]; + }; + /** + * Resize the chart + */ - ECharts.prototype.resize = function (opts) { - if (this[IN_MAIN_PROCESS_KEY]) { - if ("development" !== 'production') { - error('`resize` should not be called during main process.'); - } + ECharts.prototype.resize = function (opts) { + if (this[IN_MAIN_PROCESS_KEY]) { + if ("development" !== 'production') { + error('`resize` should not be called during main process.'); + } - return; - } + return; + } - if (this._disposed) { - disposedWarning(this.id); - return; - } + if (this._disposed) { + disposedWarning(this.id); + return; + } - this._zr.resize(opts); + this._zr.resize(opts); - var ecModel = this._model; // Resize loading effect + var ecModel = this._model; // Resize loading effect - this._loadingFX && this._loadingFX.resize(); + this._loadingFX && this._loadingFX.resize(); - if (!ecModel) { - return; - } + if (!ecModel) { + return; + } - var needPrepare = ecModel.resetOption('media'); - var silent = opts && opts.silent; // There is some real cases that: - // chart.setOption(option, { lazyUpdate: true }); - // chart.resize(); + var needPrepare = ecModel.resetOption('media'); + var silent = opts && opts.silent; // There is some real cases that: + // chart.setOption(option, { lazyUpdate: true }); + // chart.resize(); - if (this[PENDING_UPDATE]) { - if (silent == null) { - silent = this[PENDING_UPDATE].silent; - } + if (this[PENDING_UPDATE]) { + if (silent == null) { + silent = this[PENDING_UPDATE].silent; + } - needPrepare = true; - this[PENDING_UPDATE] = null; - } + needPrepare = true; + this[PENDING_UPDATE] = null; + } - this[IN_MAIN_PROCESS_KEY] = true; + this[IN_MAIN_PROCESS_KEY] = true; - try { - needPrepare && prepare(this); - updateMethods.update.call(this, { - type: 'resize', - animation: extend({ - // Disable animation - duration: 0 - }, opts && opts.animation) - }); - } catch (e) { - this[IN_MAIN_PROCESS_KEY] = false; - throw e; - } + try { + needPrepare && prepare(this); + updateMethods.update.call(this, { + type: 'resize', + animation: extend({ + // Disable animation + duration: 0 + }, opts && opts.animation) + }); + } catch (e) { + this[IN_MAIN_PROCESS_KEY] = false; + throw e; + } - this[IN_MAIN_PROCESS_KEY] = false; - flushPendingActions.call(this, silent); - triggerUpdatedEvent.call(this, silent); - }; + this[IN_MAIN_PROCESS_KEY] = false; + flushPendingActions.call(this, silent); + triggerUpdatedEvent.call(this, silent); + }; - ECharts.prototype.showLoading = function (name, cfg) { - if (this._disposed) { - disposedWarning(this.id); - return; - } + ECharts.prototype.showLoading = function (name, cfg) { + if (this._disposed) { + disposedWarning(this.id); + return; + } - if (isObject(name)) { - cfg = name; - name = ''; - } + if (isObject(name)) { + cfg = name; + name = ''; + } - name = name || 'default'; - this.hideLoading(); + name = name || 'default'; + this.hideLoading(); - if (!loadingEffects[name]) { - if ("development" !== 'production') { - console.warn('Loading effects ' + name + ' not exists.'); - } + if (!loadingEffects[name]) { + if ("development" !== 'production') { + console.warn('Loading effects ' + name + ' not exists.'); + } - return; - } + return; + } - var el = loadingEffects[name](this._api, cfg); - var zr = this._zr; - this._loadingFX = el; - zr.add(el); - }; - /** - * Hide loading effect - */ + var el = loadingEffects[name](this._api, cfg); + var zr = this._zr; + this._loadingFX = el; + zr.add(el); + }; + /** + * Hide loading effect + */ - ECharts.prototype.hideLoading = function () { - if (this._disposed) { - disposedWarning(this.id); - return; - } + ECharts.prototype.hideLoading = function () { + if (this._disposed) { + disposedWarning(this.id); + return; + } + + this._loadingFX && this._zr.remove(this._loadingFX); + this._loadingFX = null; + }; + + ECharts.prototype.makeActionFromEvent = function (eventObj) { + var payload = extend({}, eventObj); + payload.type = eventActionMap[eventObj.type]; + return payload; + }; + /** + * @param opt If pass boolean, means opt.silent + * @param opt.silent Default `false`. Whether trigger events. + * @param opt.flush Default `undefined`. + * true: Flush immediately, and then pixel in canvas can be fetched + * immediately. Caution: it might affect performance. + * false: Not flush. + * undefined: Auto decide whether perform flush. + */ - this._loadingFX && this._zr.remove(this._loadingFX); - this._loadingFX = null; - }; - ECharts.prototype.makeActionFromEvent = function (eventObj) { - var payload = extend({}, eventObj); - payload.type = eventActionMap[eventObj.type]; - return payload; - }; - /** - * @param opt If pass boolean, means opt.silent - * @param opt.silent Default `false`. Whether trigger events. - * @param opt.flush Default `undefined`. - * true: Flush immediately, and then pixel in canvas can be fetched - * immediately. Caution: it might affect performance. - * false: Not flush. - * undefined: Auto decide whether perform flush. - */ + ECharts.prototype.dispatchAction = function (payload, opt) { + if (this._disposed) { + disposedWarning(this.id); + return; + } + if (!isObject(opt)) { + opt = { + silent: !!opt + }; + } - ECharts.prototype.dispatchAction = function (payload, opt) { - if (this._disposed) { - disposedWarning(this.id); - return; - } + if (!actions[payload.type]) { + return; + } // Avoid dispatch action before setOption. Especially in `connect`. - if (!isObject(opt)) { - opt = { - silent: !!opt - }; - } - if (!actions[payload.type]) { - return; - } // Avoid dispatch action before setOption. Especially in `connect`. + if (!this._model) { + return; + } // May dispatchAction in rendering procedure - if (!this._model) { - return; - } // May dispatchAction in rendering procedure + if (this[IN_MAIN_PROCESS_KEY]) { + this._pendingActions.push(payload); + return; + } - if (this[IN_MAIN_PROCESS_KEY]) { - this._pendingActions.push(payload); + var silent = opt.silent; + doDispatchAction.call(this, payload, silent); + var flush = opt.flush; - return; - } + if (flush) { + this._zr.flush(); + } else if (flush !== false && env.browser.weChat) { + // In WeChat embeded browser, `requestAnimationFrame` and `setInterval` + // hang when sliding page (on touch event), which cause that zr does not + // refresh util user interaction finished, which is not expected. + // But `dispatchAction` may be called too frequently when pan on touch + // screen, which impacts performance if do not throttle them. + this._throttledZrFlush(); + } - var silent = opt.silent; - doDispatchAction.call(this, payload, silent); - var flush = opt.flush; + flushPendingActions.call(this, silent); + triggerUpdatedEvent.call(this, silent); + }; - if (flush) { - this._zr.flush(); - } else if (flush !== false && env.browser.weChat) { - // In WeChat embeded browser, `requestAnimationFrame` and `setInterval` - // hang when sliding page (on touch event), which cause that zr does not - // refresh util user interaction finished, which is not expected. - // But `dispatchAction` may be called too frequently when pan on touch - // screen, which impacts performance if do not throttle them. - this._throttledZrFlush(); - } + ECharts.prototype.updateLabelLayout = function () { + lifecycle.trigger('series:layoutlabels', this._model, this._api, { + // Not adding series labels. + // TODO + updatedSeries: [] + }); + }; - flushPendingActions.call(this, silent); - triggerUpdatedEvent.call(this, silent); - }; + ECharts.prototype.appendData = function (params) { + if (this._disposed) { + disposedWarning(this.id); + return; + } - ECharts.prototype.updateLabelLayout = function () { - lifecycle.trigger('series:layoutlabels', this._model, this._api, { - // Not adding series labels. - // TODO - updatedSeries: [] - }); - }; + var seriesIndex = params.seriesIndex; + var ecModel = this.getModel(); + var seriesModel = ecModel.getSeriesByIndex(seriesIndex); - ECharts.prototype.appendData = function (params) { - if (this._disposed) { - disposedWarning(this.id); - return; - } + if ("development" !== 'production') { + assert(params.data && seriesModel); + } - var seriesIndex = params.seriesIndex; - var ecModel = this.getModel(); - var seriesModel = ecModel.getSeriesByIndex(seriesIndex); + seriesModel.appendData(params); // Note: `appendData` does not support that update extent of coordinate + // system, util some scenario require that. In the expected usage of + // `appendData`, the initial extent of coordinate system should better + // be fixed by axis `min`/`max` setting or initial data, otherwise if + // the extent changed while `appendData`, the location of the painted + // graphic elements have to be changed, which make the usage of + // `appendData` meaningless. - if ("development" !== 'production') { - assert(params.data && seriesModel); - } - - seriesModel.appendData(params); // Note: `appendData` does not support that update extent of coordinate - // system, util some scenario require that. In the expected usage of - // `appendData`, the initial extent of coordinate system should better - // be fixed by axis `min`/`max` setting or initial data, otherwise if - // the extent changed while `appendData`, the location of the painted - // graphic elements have to be changed, which make the usage of - // `appendData` meaningless. - - this._scheduler.unfinished = true; - this.getZr().wakeUp(); - }; // A work around for no `internal` modifier in ts yet but - // need to strictly hide private methods to JS users. - - - ECharts.internalField = function () { - prepare = function (ecIns) { - var scheduler = ecIns._scheduler; - scheduler.restorePipelines(ecIns._model); - scheduler.prepareStageTasks(); - prepareView(ecIns, true); - prepareView(ecIns, false); - scheduler.plan(); - }; - /** - * Prepare view instances of charts and components - */ + this._scheduler.unfinished = true; + this.getZr().wakeUp(); + }; // A work around for no `internal` modifier in ts yet but + // need to strictly hide private methods to JS users. - prepareView = function (ecIns, isComponent) { - var ecModel = ecIns._model; - var scheduler = ecIns._scheduler; - var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews; - var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap; - var zr = ecIns._zr; - var api = ecIns._api; + ECharts.internalField = function () { + prepare = function (ecIns) { + var scheduler = ecIns._scheduler; + scheduler.restorePipelines(ecIns._model); + scheduler.prepareStageTasks(); + prepareView(ecIns, true); + prepareView(ecIns, false); + scheduler.plan(); + }; + /** + * Prepare view instances of charts and components + */ - for (var i = 0; i < viewList.length; i++) { - viewList[i].__alive = false; - } - isComponent ? ecModel.eachComponent(function (componentType, model) { - componentType !== 'series' && doPrepare(model); - }) : ecModel.eachSeries(doPrepare); - - function doPrepare(model) { - // By defaut view will be reused if possible for the case that `setOption` with "notMerge" - // mode and need to enable transition animation. (Usually, when they have the same id, or - // especially no id but have the same type & name & index. See the `model.id` generation - // rule in `makeIdAndName` and `viewId` generation rule here). - // But in `replaceMerge` mode, this feature should be able to disabled when it is clear that - // the new model has nothing to do with the old model. - var requireNewView = model.__requireNewView; // This command should not work twice. - - model.__requireNewView = false; // Consider: id same and type changed. - - var viewId = '_ec_' + model.id + '_' + model.type; - var view = !requireNewView && viewMap[viewId]; - - if (!view) { - var classType = parseClassType(model.type); - var Clazz = isComponent ? ComponentView.getClass(classType.main, classType.sub) : // FIXME:TS - // (ChartView as ChartViewConstructor).getClass('series', classType.sub) - // For backward compat, still support a chart type declared as only subType - // like "liquidfill", but recommend "series.liquidfill" - // But need a base class to make a type series. - ChartView.getClass(classType.sub); - - if ("development" !== 'production') { - assert(Clazz, classType.sub + ' does not exist.'); - } + prepareView = function (ecIns, isComponent) { + var ecModel = ecIns._model; + var scheduler = ecIns._scheduler; + var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews; + var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap; + var zr = ecIns._zr; + var api = ecIns._api; + + for (var i = 0; i < viewList.length; i++) { + viewList[i].__alive = false; + } + + isComponent ? ecModel.eachComponent(function (componentType, model) { + componentType !== 'series' && doPrepare(model); + }) : ecModel.eachSeries(doPrepare); + + function doPrepare(model) { + // By defaut view will be reused if possible for the case that `setOption` with "notMerge" + // mode and need to enable transition animation. (Usually, when they have the same id, or + // especially no id but have the same type & name & index. See the `model.id` generation + // rule in `makeIdAndName` and `viewId` generation rule here). + // But in `replaceMerge` mode, this feature should be able to disabled when it is clear that + // the new model has nothing to do with the old model. + var requireNewView = model.__requireNewView; // This command should not work twice. + + model.__requireNewView = false; // Consider: id same and type changed. + + var viewId = '_ec_' + model.id + '_' + model.type; + var view = !requireNewView && viewMap[viewId]; + + if (!view) { + var classType = parseClassType(model.type); + var Clazz = isComponent ? ComponentView.getClass(classType.main, classType.sub) : // FIXME:TS + // (ChartView as ChartViewConstructor).getClass('series', classType.sub) + // For backward compat, still support a chart type declared as only subType + // like "liquidfill", but recommend "series.liquidfill" + // But need a base class to make a type series. + ChartView.getClass(classType.sub); + + if ("development" !== 'production') { + assert(Clazz, classType.sub + ' does not exist.'); + } + + view = new Clazz(); + view.init(ecModel, api); + viewMap[viewId] = view; + viewList.push(view); + zr.add(view.group); + } + + model.__viewId = view.__id = viewId; + view.__alive = true; + view.__model = model; + view.group.__ecComponentInfo = { + mainType: model.mainType, + index: model.componentIndex + }; + !isComponent && scheduler.prepareView(view, model, ecModel, api); + } + + for (var i = 0; i < viewList.length;) { + var view = viewList[i]; + + if (!view.__alive) { + !isComponent && view.renderTask.dispose(); + zr.remove(view.group); + view.dispose(ecModel, api); + viewList.splice(i, 1); + + if (viewMap[view.__id] === view) { + delete viewMap[view.__id]; + } + + view.__id = view.group.__ecComponentInfo = null; + } else { + i++; + } + } + }; - view = new Clazz(); - view.init(ecModel, api); - viewMap[viewId] = view; - viewList.push(view); - zr.add(view.group); - } + updateDirectly = function (ecIns, method, payload, mainType, subType) { + var ecModel = ecIns._model; + ecModel.setUpdatePayload(payload); // broadcast - model.__viewId = view.__id = viewId; - view.__alive = true; - view.__model = model; - view.group.__ecComponentInfo = { - mainType: model.mainType, - index: model.componentIndex - }; - !isComponent && scheduler.prepareView(view, model, ecModel, api); - } + if (!mainType) { + // FIXME + // Chart will not be update directly here, except set dirty. + // But there is no such scenario now. + each([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView); + return; + } - for (var i = 0; i < viewList.length;) { - var view = viewList[i]; + var query = {}; + query[mainType + 'Id'] = payload[mainType + 'Id']; + query[mainType + 'Index'] = payload[mainType + 'Index']; + query[mainType + 'Name'] = payload[mainType + 'Name']; + var condition = { + mainType: mainType, + query: query + }; + subType && (condition.subType = subType); // subType may be '' by parseClassType; - if (!view.__alive) { - !isComponent && view.renderTask.dispose(); - zr.remove(view.group); - view.dispose(ecModel, api); - viewList.splice(i, 1); + var excludeSeriesId = payload.excludeSeriesId; + var excludeSeriesIdMap; - if (viewMap[view.__id] === view) { - delete viewMap[view.__id]; - } + if (excludeSeriesId != null) { + excludeSeriesIdMap = createHashMap(); + each(normalizeToArray(excludeSeriesId), function (id) { + var modelId = convertOptionIdName(id, null); - view.__id = view.group.__ecComponentInfo = null; - } else { - i++; - } - } - }; + if (modelId != null) { + excludeSeriesIdMap.set(modelId, true); + } + }); + } // If dispatchAction before setOption, do nothing. - updateDirectly = function (ecIns, method, payload, mainType, subType) { - var ecModel = ecIns._model; - ecModel.setUpdatePayload(payload); // broadcast - if (!mainType) { - // FIXME - // Chart will not be update directly here, except set dirty. - // But there is no such scenario now. - each([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView); - return; - } + ecModel && ecModel.eachComponent(condition, function (model) { + var isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) !== null; - var query = {}; - query[mainType + 'Id'] = payload[mainType + 'Id']; - query[mainType + 'Index'] = payload[mainType + 'Index']; - query[mainType + 'Name'] = payload[mainType + 'Name']; - var condition = { - mainType: mainType, - query: query - }; - subType && (condition.subType = subType); // subType may be '' by parseClassType; + if (isExcluded) { + return; + } - var excludeSeriesId = payload.excludeSeriesId; - var excludeSeriesIdMap; + if (isHighDownPayload(payload)) { + if (model instanceof SeriesModel) { + if (payload.type === HIGHLIGHT_ACTION_TYPE && !payload.notBlur && !model.get(['emphasis', 'disabled'])) { + blurSeriesFromHighlightPayload(model, payload, ecIns._api); + } + } else { + var _a = findComponentHighDownDispatchers(model.mainType, model.componentIndex, payload.name, ecIns._api), + focusSelf = _a.focusSelf, + dispatchers = _a.dispatchers; - if (excludeSeriesId != null) { - excludeSeriesIdMap = createHashMap(); - each(normalizeToArray(excludeSeriesId), function (id) { - var modelId = convertOptionIdName(id, null); + if (payload.type === HIGHLIGHT_ACTION_TYPE && focusSelf && !payload.notBlur) { + blurComponent(model.mainType, model.componentIndex, ecIns._api); + } // PENDING: + // Whether to put this "enter emphasis" code in `ComponentView`, + // which will be the same as `ChartView` but might be not necessary + // and will be far from this logic. - if (modelId != null) { - excludeSeriesIdMap.set(modelId, true); - } - }); - } // If dispatchAction before setOption, do nothing. + if (dispatchers) { + each(dispatchers, function (dispatcher) { + payload.type === HIGHLIGHT_ACTION_TYPE ? enterEmphasis(dispatcher) : leaveEmphasis(dispatcher); + }); + } + } + } else if (isSelectChangePayload(payload)) { + // TODO geo + if (model instanceof SeriesModel) { + toggleSelectionFromPayload(model, payload, ecIns._api); + updateSeriesElementSelection(model); + markStatusToUpdate(ecIns); + } + } + }, ecIns); + ecModel && ecModel.eachComponent(condition, function (model) { + var isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) !== null; - ecModel && ecModel.eachComponent(condition, function (model) { - var isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) !== null; + if (isExcluded) { + return; + } + callView(ecIns[mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]); + }, ecIns); - if (isExcluded) { - return; - } + function callView(view) { + view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload); + } + }; - if (isHighDownPayload(payload)) { - if (model instanceof SeriesModel) { - if (payload.type === HIGHLIGHT_ACTION_TYPE && !payload.notBlur && !model.get(['emphasis', 'disabled'])) { - blurSeriesFromHighlightPayload(model, payload, ecIns._api); - } - } else { - var _a = findComponentHighDownDispatchers(model.mainType, model.componentIndex, payload.name, ecIns._api), - focusSelf = _a.focusSelf, - dispatchers = _a.dispatchers; - - if (payload.type === HIGHLIGHT_ACTION_TYPE && focusSelf && !payload.notBlur) { - blurComponent(model.mainType, model.componentIndex, ecIns._api); - } // PENDING: - // Whether to put this "enter emphasis" code in `ComponentView`, - // which will be the same as `ChartView` but might be not necessary - // and will be far from this logic. - - - if (dispatchers) { - each(dispatchers, function (dispatcher) { - payload.type === HIGHLIGHT_ACTION_TYPE ? enterEmphasis(dispatcher) : leaveEmphasis(dispatcher); - }); - } - } - } else if (isSelectChangePayload(payload)) { - // TODO geo - if (model instanceof SeriesModel) { - toggleSelectionFromPayload(model, payload, ecIns._api); - updateSeriesElementSelection(model); - markStatusToUpdate(ecIns); - } - } - }, ecIns); - ecModel && ecModel.eachComponent(condition, function (model) { - var isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) !== null; + updateMethods = { + prepareAndUpdate: function (payload) { + prepare(this); + updateMethods.update.call(this, payload, { + // Needs to mark option changed if newOption is given. + // It's from MagicType. + // TODO If use a separate flag optionChanged in payload? + optionChanged: payload.newOption != null + }); + }, + update: function (payload, updateParams) { + var ecModel = this._model; + var api = this._api; + var zr = this._zr; + var coordSysMgr = this._coordSysMgr; + var scheduler = this._scheduler; // update before setOption + + if (!ecModel) { + return; + } + + ecModel.setUpdatePayload(payload); + scheduler.restoreData(ecModel, payload); + scheduler.performSeriesTasks(ecModel); // TODO + // Save total ecModel here for undo/redo (after restoring data and before processing data). + // Undo (restoration of total ecModel) can be carried out in 'action' or outside API call. + // Create new coordinate system each update + // In LineView may save the old coordinate system and use it to get the orignal point + + coordSysMgr.create(ecModel, api); + scheduler.performDataProcessorTasks(ecModel, payload); // Current stream render is not supported in data process. So we can update + // stream modes after data processing, where the filtered data is used to + // deteming whether use progressive rendering. + + updateStreamModes(this, ecModel); // We update stream modes before coordinate system updated, then the modes info + // can be fetched when coord sys updating (consider the barGrid extent fix). But + // the drawback is the full coord info can not be fetched. Fortunately this full + // coord is not requied in stream mode updater currently. + + coordSysMgr.update(ecModel, api); + clearColorPalette(ecModel); + scheduler.performVisualTasks(ecModel, payload); + render(this, ecModel, api, payload, updateParams); // Set background + + var backgroundColor = ecModel.get('backgroundColor') || 'transparent'; + var darkMode = ecModel.get('darkMode'); + zr.setBackgroundColor(backgroundColor); // Force set dark mode. + + if (darkMode != null && darkMode !== 'auto') { + zr.setDarkMode(darkMode); + } + + lifecycle.trigger('afterupdate', ecModel, api); + }, + updateTransform: function (payload) { + var _this = this; - if (isExcluded) { - return; - } - callView(ecIns[mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]); - }, ecIns); + var ecModel = this._model; + var api = this._api; // update before setOption - function callView(view) { - view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload); - } - }; + if (!ecModel) { + return; + } - updateMethods = { - prepareAndUpdate: function (payload) { - prepare(this); - updateMethods.update.call(this, payload, { - // Needs to mark option changed if newOption is given. - // It's from MagicType. - // TODO If use a separate flag optionChanged in payload? - optionChanged: payload.newOption != null - }); - }, - update: function (payload, updateParams) { - var ecModel = this._model; - var api = this._api; - var zr = this._zr; - var coordSysMgr = this._coordSysMgr; - var scheduler = this._scheduler; // update before setOption - - if (!ecModel) { - return; - } + ecModel.setUpdatePayload(payload); // ChartView.markUpdateMethod(payload, 'updateTransform'); - ecModel.setUpdatePayload(payload); - scheduler.restoreData(ecModel, payload); - scheduler.performSeriesTasks(ecModel); // TODO - // Save total ecModel here for undo/redo (after restoring data and before processing data). - // Undo (restoration of total ecModel) can be carried out in 'action' or outside API call. - // Create new coordinate system each update - // In LineView may save the old coordinate system and use it to get the orignal point - - coordSysMgr.create(ecModel, api); - scheduler.performDataProcessorTasks(ecModel, payload); // Current stream render is not supported in data process. So we can update - // stream modes after data processing, where the filtered data is used to - // deteming whether use progressive rendering. - - updateStreamModes(this, ecModel); // We update stream modes before coordinate system updated, then the modes info - // can be fetched when coord sys updating (consider the barGrid extent fix). But - // the drawback is the full coord info can not be fetched. Fortunately this full - // coord is not requied in stream mode updater currently. - - coordSysMgr.update(ecModel, api); - clearColorPalette(ecModel); - scheduler.performVisualTasks(ecModel, payload); - render(this, ecModel, api, payload, updateParams); // Set background - - var backgroundColor = ecModel.get('backgroundColor') || 'transparent'; - var darkMode = ecModel.get('darkMode'); - zr.setBackgroundColor(backgroundColor); // Force set dark mode. - - if (darkMode != null && darkMode !== 'auto') { - zr.setDarkMode(darkMode); - } + var componentDirtyList = []; + ecModel.eachComponent(function (componentType, componentModel) { + if (componentType === 'series') { + return; + } - lifecycle.trigger('afterupdate', ecModel, api); - }, - updateTransform: function (payload) { - var _this = this; + var componentView = _this.getViewOfComponentModel(componentModel); - var ecModel = this._model; - var api = this._api; // update before setOption + if (componentView && componentView.__alive) { + if (componentView.updateTransform) { + var result = componentView.updateTransform(componentModel, ecModel, api, payload); + result && result.update && componentDirtyList.push(componentView); + } else { + componentDirtyList.push(componentView); + } + } + }); + var seriesDirtyMap = createHashMap(); + ecModel.eachSeries(function (seriesModel) { + var chartView = _this._chartsMap[seriesModel.__viewId]; + + if (chartView.updateTransform) { + var result = chartView.updateTransform(seriesModel, ecModel, api, payload); + result && result.update && seriesDirtyMap.set(seriesModel.uid, 1); + } else { + seriesDirtyMap.set(seriesModel.uid, 1); + } + }); + clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline. + // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true); - if (!ecModel) { - return; - } + this._scheduler.performVisualTasks(ecModel, payload, { + setDirty: true, + dirtyMap: seriesDirtyMap + }); // Currently, not call render of components. Geo render cost a lot. + // renderComponents(ecIns, ecModel, api, payload, componentDirtyList); - ecModel.setUpdatePayload(payload); // ChartView.markUpdateMethod(payload, 'updateTransform'); - var componentDirtyList = []; - ecModel.eachComponent(function (componentType, componentModel) { - if (componentType === 'series') { - return; - } + renderSeries(this, ecModel, api, payload, {}, seriesDirtyMap); + lifecycle.trigger('afterupdate', ecModel, api); + }, + updateView: function (payload) { + var ecModel = this._model; // update before setOption - var componentView = _this.getViewOfComponentModel(componentModel); + if (!ecModel) { + return; + } - if (componentView && componentView.__alive) { - if (componentView.updateTransform) { - var result = componentView.updateTransform(componentModel, ecModel, api, payload); - result && result.update && componentDirtyList.push(componentView); - } else { - componentDirtyList.push(componentView); - } - } - }); - var seriesDirtyMap = createHashMap(); - ecModel.eachSeries(function (seriesModel) { - var chartView = _this._chartsMap[seriesModel.__viewId]; - - if (chartView.updateTransform) { - var result = chartView.updateTransform(seriesModel, ecModel, api, payload); - result && result.update && seriesDirtyMap.set(seriesModel.uid, 1); - } else { - seriesDirtyMap.set(seriesModel.uid, 1); - } - }); - clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline. - // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true); + ecModel.setUpdatePayload(payload); + ChartView.markUpdateMethod(payload, 'updateView'); + clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline. - this._scheduler.performVisualTasks(ecModel, payload, { - setDirty: true, - dirtyMap: seriesDirtyMap - }); // Currently, not call render of components. Geo render cost a lot. - // renderComponents(ecIns, ecModel, api, payload, componentDirtyList); + this._scheduler.performVisualTasks(ecModel, payload, { + setDirty: true + }); + render(this, ecModel, this._api, payload, {}); + lifecycle.trigger('afterupdate', ecModel, this._api); + }, + updateVisual: function (payload) { + // updateMethods.update.call(this, payload); + var _this = this; - renderSeries(this, ecModel, api, payload, {}, seriesDirtyMap); - lifecycle.trigger('afterupdate', ecModel, api); - }, - updateView: function (payload) { - var ecModel = this._model; // update before setOption + var ecModel = this._model; // update before setOption - if (!ecModel) { - return; - } + if (!ecModel) { + return; + } - ecModel.setUpdatePayload(payload); - ChartView.markUpdateMethod(payload, 'updateView'); - clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline. + ecModel.setUpdatePayload(payload); // clear all visual - this._scheduler.performVisualTasks(ecModel, payload, { - setDirty: true - }); + ecModel.eachSeries(function (seriesModel) { + seriesModel.getData().clearAllVisual(); + }); // Perform visual - render(this, ecModel, this._api, payload, {}); - lifecycle.trigger('afterupdate', ecModel, this._api); - }, - updateVisual: function (payload) { - // updateMethods.update.call(this, payload); - var _this = this; + ChartView.markUpdateMethod(payload, 'updateVisual'); + clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline. - var ecModel = this._model; // update before setOption + this._scheduler.performVisualTasks(ecModel, payload, { + visualType: 'visual', + setDirty: true + }); - if (!ecModel) { - return; - } + ecModel.eachComponent(function (componentType, componentModel) { + if (componentType !== 'series') { + var componentView = _this.getViewOfComponentModel(componentModel); - ecModel.setUpdatePayload(payload); // clear all visual + componentView && componentView.__alive && componentView.updateVisual(componentModel, ecModel, _this._api, payload); + } + }); + ecModel.eachSeries(function (seriesModel) { + var chartView = _this._chartsMap[seriesModel.__viewId]; + chartView.updateVisual(seriesModel, ecModel, _this._api, payload); + }); + lifecycle.trigger('afterupdate', ecModel, this._api); + }, + updateLayout: function (payload) { + updateMethods.update.call(this, payload); + } + }; - ecModel.eachSeries(function (seriesModel) { - seriesModel.getData().clearAllVisual(); - }); // Perform visual + doConvertPixel = function (ecIns, methodName, finder, value) { + if (ecIns._disposed) { + disposedWarning(ecIns.id); + return; + } - ChartView.markUpdateMethod(payload, 'updateVisual'); - clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline. + var ecModel = ecIns._model; - this._scheduler.performVisualTasks(ecModel, payload, { - visualType: 'visual', - setDirty: true - }); + var coordSysList = ecIns._coordSysMgr.getCoordinateSystems(); - ecModel.eachComponent(function (componentType, componentModel) { - if (componentType !== 'series') { - var componentView = _this.getViewOfComponentModel(componentModel); + var result; + var parsedFinder = parseFinder(ecModel, finder); - componentView && componentView.__alive && componentView.updateVisual(componentModel, ecModel, _this._api, payload); - } - }); - ecModel.eachSeries(function (seriesModel) { - var chartView = _this._chartsMap[seriesModel.__viewId]; - chartView.updateVisual(seriesModel, ecModel, _this._api, payload); - }); - lifecycle.trigger('afterupdate', ecModel, this._api); - }, - updateLayout: function (payload) { - updateMethods.update.call(this, payload); - } - }; + for (var i = 0; i < coordSysList.length; i++) { + var coordSys = coordSysList[i]; - doConvertPixel = function (ecIns, methodName, finder, value) { - if (ecIns._disposed) { - disposedWarning(ecIns.id); - return; - } + if (coordSys[methodName] && (result = coordSys[methodName](ecModel, parsedFinder, value)) != null) { + return result; + } + } - var ecModel = ecIns._model; + if ("development" !== 'production') { + console.warn('No coordinate system that supports ' + methodName + ' found by the given finder.'); + } + }; - var coordSysList = ecIns._coordSysMgr.getCoordinateSystems(); + updateStreamModes = function (ecIns, ecModel) { + var chartsMap = ecIns._chartsMap; + var scheduler = ecIns._scheduler; + ecModel.eachSeries(function (seriesModel) { + scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]); + }); + }; - var result; - var parsedFinder = parseFinder(ecModel, finder); + doDispatchAction = function (payload, silent) { + var _this = this; - for (var i = 0; i < coordSysList.length; i++) { - var coordSys = coordSysList[i]; + var ecModel = this.getModel(); + var payloadType = payload.type; + var escapeConnect = payload.escapeConnect; + var actionWrap = actions[payloadType]; + var actionInfo = actionWrap.actionInfo; + var cptTypeTmp = (actionInfo.update || 'update').split(':'); + var updateMethod = cptTypeTmp.pop(); + var cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]); + this[IN_MAIN_PROCESS_KEY] = true; + var payloads = [payload]; + var batched = false; // Batch action - if (coordSys[methodName] && (result = coordSys[methodName](ecModel, parsedFinder, value)) != null) { - return result; - } - } + if (payload.batch) { + batched = true; + payloads = map(payload.batch, function (item) { + item = defaults(extend({}, item), payload); + item.batch = null; + return item; + }); + } + + var eventObjBatch = []; + var eventObj; + var isSelectChange = isSelectChangePayload(payload); + var isHighDown = isHighDownPayload(payload); // Only leave blur once if there are multiple batches. + + if (isHighDown) { + allLeaveBlur(this._api); + } + + each(payloads, function (batchItem) { + // Action can specify the event by return it. + eventObj = actionWrap.action(batchItem, _this._model, _this._api); // Emit event outside + + eventObj = eventObj || extend({}, batchItem); // Convert type to eventType + + eventObj.type = actionInfo.event || eventObj.type; + eventObjBatch.push(eventObj); // light update does not perform data process, layout and visual. + + if (isHighDown) { + var _a = preParseFinder(payload), + queryOptionMap = _a.queryOptionMap, + mainTypeSpecified = _a.mainTypeSpecified; + + var componentMainType = mainTypeSpecified ? queryOptionMap.keys()[0] : 'series'; + updateDirectly(_this, updateMethod, batchItem, componentMainType); + markStatusToUpdate(_this); + } else if (isSelectChange) { + // At present `dispatchAction({ type: 'select', ... })` is not supported on components. + // geo still use 'geoselect'. + updateDirectly(_this, updateMethod, batchItem, 'series'); + markStatusToUpdate(_this); + } else if (cptType) { + updateDirectly(_this, updateMethod, batchItem, cptType.main, cptType.sub); + } + }); + + if (updateMethod !== 'none' && !isHighDown && !isSelectChange && !cptType) { + try { + // Still dirty + if (this[PENDING_UPDATE]) { + prepare(this); + updateMethods.update.call(this, payload); + this[PENDING_UPDATE] = null; + } else { + updateMethods[updateMethod].call(this, payload); + } + } catch (e) { + this[IN_MAIN_PROCESS_KEY] = false; + throw e; + } + } // Follow the rule of action batch + + + if (batched) { + eventObj = { + type: actionInfo.event || payloadType, + escapeConnect: escapeConnect, + batch: eventObjBatch + }; + } else { + eventObj = eventObjBatch[0]; + } + + this[IN_MAIN_PROCESS_KEY] = false; + + if (!silent) { + var messageCenter = this._messageCenter; + messageCenter.trigger(eventObj.type, eventObj); // Extra triggered 'selectchanged' event + + if (isSelectChange) { + var newObj = { + type: 'selectchanged', + escapeConnect: escapeConnect, + selected: getAllSelectedIndices(ecModel), + isFromClick: payload.isFromClick || false, + fromAction: payload.type, + fromActionPayload: payload + }; + messageCenter.trigger(newObj.type, newObj); + } + } + }; + + flushPendingActions = function (silent) { + var pendingActions = this._pendingActions; + + while (pendingActions.length) { + var payload = pendingActions.shift(); + doDispatchAction.call(this, payload, silent); + } + }; + + triggerUpdatedEvent = function (silent) { + !silent && this.trigger('updated'); + }; + /** + * Event `rendered` is triggered when zr + * rendered. It is useful for realtime + * snapshot (reflect animation). + * + * Event `finished` is triggered when: + * (1) zrender rendering finished. + * (2) initial animation finished. + * (3) progressive rendering finished. + * (4) no pending action. + * (5) no delayed setOption needs to be processed. + */ - if ("development" !== 'production') { - console.warn('No coordinate system that supports ' + methodName + ' found by the given finder.'); - } - }; - updateStreamModes = function (ecIns, ecModel) { - var chartsMap = ecIns._chartsMap; - var scheduler = ecIns._scheduler; - ecModel.eachSeries(function (seriesModel) { - scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]); - }); - }; + bindRenderedEvent = function (zr, ecIns) { + zr.on('rendered', function (params) { + ecIns.trigger('rendered', params); // The `finished` event should not be triggered repeatly, + // so it should only be triggered when rendering indeed happend + // in zrender. (Consider the case that dipatchAction is keep + // triggering when mouse move). - doDispatchAction = function (payload, silent) { - var _this = this; - - var ecModel = this.getModel(); - var payloadType = payload.type; - var escapeConnect = payload.escapeConnect; - var actionWrap = actions[payloadType]; - var actionInfo = actionWrap.actionInfo; - var cptTypeTmp = (actionInfo.update || 'update').split(':'); - var updateMethod = cptTypeTmp.pop(); - var cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]); - this[IN_MAIN_PROCESS_KEY] = true; - var payloads = [payload]; - var batched = false; // Batch action - - if (payload.batch) { - batched = true; - payloads = map(payload.batch, function (item) { - item = defaults(extend({}, item), payload); - item.batch = null; - return item; - }); - } - - var eventObjBatch = []; - var eventObj; - var isSelectChange = isSelectChangePayload(payload); - var isHighDown = isHighDownPayload(payload); // Only leave blur once if there are multiple batches. - - if (isHighDown) { - allLeaveBlur(this._api); - } - - each(payloads, function (batchItem) { - // Action can specify the event by return it. - eventObj = actionWrap.action(batchItem, _this._model, _this._api); // Emit event outside - - eventObj = eventObj || extend({}, batchItem); // Convert type to eventType - - eventObj.type = actionInfo.event || eventObj.type; - eventObjBatch.push(eventObj); // light update does not perform data process, layout and visual. - - if (isHighDown) { - var _a = preParseFinder(payload), - queryOptionMap = _a.queryOptionMap, - mainTypeSpecified = _a.mainTypeSpecified; - - var componentMainType = mainTypeSpecified ? queryOptionMap.keys()[0] : 'series'; - updateDirectly(_this, updateMethod, batchItem, componentMainType); - markStatusToUpdate(_this); - } else if (isSelectChange) { - // At present `dispatchAction({ type: 'select', ... })` is not supported on components. - // geo still use 'geoselect'. - updateDirectly(_this, updateMethod, batchItem, 'series'); - markStatusToUpdate(_this); - } else if (cptType) { - updateDirectly(_this, updateMethod, batchItem, cptType.main, cptType.sub); - } - }); - - if (updateMethod !== 'none' && !isHighDown && !isSelectChange && !cptType) { - try { - // Still dirty - if (this[PENDING_UPDATE]) { - prepare(this); - updateMethods.update.call(this, payload); - this[PENDING_UPDATE] = null; - } else { - updateMethods[updateMethod].call(this, payload); - } - } catch (e) { - this[IN_MAIN_PROCESS_KEY] = false; - throw e; - } - } // Follow the rule of action batch - - - if (batched) { - eventObj = { - type: actionInfo.event || payloadType, - escapeConnect: escapeConnect, - batch: eventObjBatch - }; - } else { - eventObj = eventObjBatch[0]; - } - - this[IN_MAIN_PROCESS_KEY] = false; - - if (!silent) { - var messageCenter = this._messageCenter; - messageCenter.trigger(eventObj.type, eventObj); // Extra triggered 'selectchanged' event - - if (isSelectChange) { - var newObj = { - type: 'selectchanged', - escapeConnect: escapeConnect, - selected: getAllSelectedIndices(ecModel), - isFromClick: payload.isFromClick || false, - fromAction: payload.type, - fromActionPayload: payload - }; - messageCenter.trigger(newObj.type, newObj); - } - } - }; - - flushPendingActions = function (silent) { - var pendingActions = this._pendingActions; - - while (pendingActions.length) { - var payload = pendingActions.shift(); - doDispatchAction.call(this, payload, silent); - } - }; - - triggerUpdatedEvent = function (silent) { - !silent && this.trigger('updated'); - }; - /** - * Event `rendered` is triggered when zr - * rendered. It is useful for realtime - * snapshot (reflect animation). - * - * Event `finished` is triggered when: - * (1) zrender rendering finished. - * (2) initial animation finished. - * (3) progressive rendering finished. - * (4) no pending action. - * (5) no delayed setOption needs to be processed. - */ + if ( // Although zr is dirty if initial animation is not finished + // and this checking is called on frame, we also check + // animation finished for robustness. + zr.animation.isFinished() && !ecIns[PENDING_UPDATE] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length) { + ecIns.trigger('finished'); + } + }); + }; + bindMouseEvent = function (zr, ecIns) { + zr.on('mouseover', function (e) { + var el = e.target; + var dispatcher = findEventDispatcher(el, isHighDownDispatcher); - bindRenderedEvent = function (zr, ecIns) { - zr.on('rendered', function (params) { - ecIns.trigger('rendered', params); // The `finished` event should not be triggered repeatly, - // so it should only be triggered when rendering indeed happend - // in zrender. (Consider the case that dipatchAction is keep - // triggering when mouse move). + if (dispatcher) { + handleGlobalMouseOverForHighDown(dispatcher, e, ecIns._api); + markStatusToUpdate(ecIns); + } + }).on('mouseout', function (e) { + var el = e.target; + var dispatcher = findEventDispatcher(el, isHighDownDispatcher); - if ( // Although zr is dirty if initial animation is not finished - // and this checking is called on frame, we also check - // animation finished for robustness. - zr.animation.isFinished() && !ecIns[PENDING_UPDATE] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length) { - ecIns.trigger('finished'); - } - }); - }; + if (dispatcher) { + handleGlobalMouseOutForHighDown(dispatcher, e, ecIns._api); + markStatusToUpdate(ecIns); + } + }).on('click', function (e) { + var el = e.target; + var dispatcher = findEventDispatcher(el, function (target) { + return getECData(target).dataIndex != null; + }, true); - bindMouseEvent = function (zr, ecIns) { - zr.on('mouseover', function (e) { - var el = e.target; - var dispatcher = findEventDispatcher(el, isHighDownDispatcher); + if (dispatcher) { + var actionType = dispatcher.selected ? 'unselect' : 'select'; + var ecData = getECData(dispatcher); + + ecIns._api.dispatchAction({ + type: actionType, + dataType: ecData.dataType, + dataIndexInside: ecData.dataIndex, + seriesIndex: ecData.seriesIndex, + isFromClick: true + }); + } + }); + }; + + function clearColorPalette(ecModel) { + ecModel.clearColorPalette(); + ecModel.eachSeries(function (seriesModel) { + seriesModel.clearColorPalette(); + }); + } + + function allocateZlevels(ecModel) { + var componentZLevels = []; + var seriesZLevels = []; + var hasSeperateZLevel = false; + ecModel.eachComponent(function (componentType, componentModel) { + var zlevel = componentModel.get('zlevel') || 0; + var z = componentModel.get('z') || 0; + var zlevelKey = componentModel.getZLevelKey(); + hasSeperateZLevel = hasSeperateZLevel || !!zlevelKey; + (componentType === 'series' ? seriesZLevels : componentZLevels).push({ + zlevel: zlevel, + z: z, + idx: componentModel.componentIndex, + type: componentType, + key: zlevelKey + }); + }); + + if (hasSeperateZLevel) { + // Series after component + var zLevels = componentZLevels.concat(seriesZLevels); + var lastSeriesZLevel_1; + var lastSeriesKey_1; + sort(zLevels, function (a, b) { + if (a.zlevel === b.zlevel) { + return a.z - b.z; + } + + return a.zlevel - b.zlevel; + }); + each(zLevels, function (item) { + var componentModel = ecModel.getComponent(item.type, item.idx); + var zlevel = item.zlevel; + var key = item.key; - if (dispatcher) { - handleGlobalMouseOverForHighDown(dispatcher, e, ecIns._api); - markStatusToUpdate(ecIns); - } - }).on('mouseout', function (e) { - var el = e.target; - var dispatcher = findEventDispatcher(el, isHighDownDispatcher); + if (lastSeriesZLevel_1 != null) { + zlevel = Math.max(lastSeriesZLevel_1, zlevel); + } - if (dispatcher) { - handleGlobalMouseOutForHighDown(dispatcher, e, ecIns._api); - markStatusToUpdate(ecIns); - } - }).on('click', function (e) { - var el = e.target; - var dispatcher = findEventDispatcher(el, function (target) { - return getECData(target).dataIndex != null; - }, true); - - if (dispatcher) { - var actionType = dispatcher.selected ? 'unselect' : 'select'; - var ecData = getECData(dispatcher); - - ecIns._api.dispatchAction({ - type: actionType, - dataType: ecData.dataType, - dataIndexInside: ecData.dataIndex, - seriesIndex: ecData.seriesIndex, - isFromClick: true - }); - } - }); - }; + if (key) { + if (zlevel === lastSeriesZLevel_1 && key !== lastSeriesKey_1) { + zlevel++; + } - function clearColorPalette(ecModel) { - ecModel.clearColorPalette(); - ecModel.eachSeries(function (seriesModel) { - seriesModel.clearColorPalette(); - }); + lastSeriesKey_1 = key; + } else if (lastSeriesKey_1) { + if (zlevel === lastSeriesZLevel_1) { + zlevel++; } - function allocateZlevels(ecModel) { - var componentZLevels = []; - var seriesZLevels = []; - var hasSeperateZLevel = false; - ecModel.eachComponent(function (componentType, componentModel) { - var zlevel = componentModel.get('zlevel') || 0; - var z = componentModel.get('z') || 0; - var zlevelKey = componentModel.getZLevelKey(); - hasSeperateZLevel = hasSeperateZLevel || !!zlevelKey; - (componentType === 'series' ? seriesZLevels : componentZLevels).push({ - zlevel: zlevel, - z: z, - idx: componentModel.componentIndex, - type: componentType, - key: zlevelKey - }); - }); + lastSeriesKey_1 = ''; + } - if (hasSeperateZLevel) { - // Series after component - var zLevels = componentZLevels.concat(seriesZLevels); - var lastSeriesZLevel_1; - var lastSeriesKey_1; - sort(zLevels, function (a, b) { - if (a.zlevel === b.zlevel) { - return a.z - b.z; - } + lastSeriesZLevel_1 = zlevel; + componentModel.setZLevel(zlevel); + }); + } + } - return a.zlevel - b.zlevel; - }); - each(zLevels, function (item) { - var componentModel = ecModel.getComponent(item.type, item.idx); - var zlevel = item.zlevel; - var key = item.key; + render = function (ecIns, ecModel, api, payload, updateParams) { + allocateZlevels(ecModel); + renderComponents(ecIns, ecModel, api, payload, updateParams); + each(ecIns._chartsViews, function (chart) { + chart.__alive = false; + }); + renderSeries(ecIns, ecModel, api, payload, updateParams); // Remove groups of unrendered charts - if (lastSeriesZLevel_1 != null) { - zlevel = Math.max(lastSeriesZLevel_1, zlevel); - } + each(ecIns._chartsViews, function (chart) { + if (!chart.__alive) { + chart.remove(ecModel, api); + } + }); + }; - if (key) { - if (zlevel === lastSeriesZLevel_1 && key !== lastSeriesKey_1) { - zlevel++; - } + renderComponents = function (ecIns, ecModel, api, payload, updateParams, dirtyList) { + each(dirtyList || ecIns._componentsViews, function (componentView) { + var componentModel = componentView.__model; + clearStates(componentModel, componentView); + componentView.render(componentModel, ecModel, api, payload); + updateZ(componentModel, componentView); + updateStates(componentModel, componentView); + }); + }; + /** + * Render each chart and component + */ - lastSeriesKey_1 = key; - } else if (lastSeriesKey_1) { - if (zlevel === lastSeriesZLevel_1) { - zlevel++; - } - lastSeriesKey_1 = ''; - } + renderSeries = function (ecIns, ecModel, api, payload, updateParams, dirtyMap) { + // Render all charts + var scheduler = ecIns._scheduler; + updateParams = extend(updateParams || {}, { + updatedSeries: ecModel.getSeries() + }); // TODO progressive? - lastSeriesZLevel_1 = zlevel; - componentModel.setZLevel(zlevel); - }); - } - } + lifecycle.trigger('series:beforeupdate', ecModel, api, updateParams); + var unfinished = false; + ecModel.eachSeries(function (seriesModel) { + var chartView = ecIns._chartsMap[seriesModel.__viewId]; + chartView.__alive = true; + var renderTask = chartView.renderTask; + scheduler.updatePayload(renderTask, payload); // TODO states on marker. - render = function (ecIns, ecModel, api, payload, updateParams) { - allocateZlevels(ecModel); - renderComponents(ecIns, ecModel, api, payload, updateParams); - each(ecIns._chartsViews, function (chart) { - chart.__alive = false; - }); - renderSeries(ecIns, ecModel, api, payload, updateParams); // Remove groups of unrendered charts + clearStates(seriesModel, chartView); - each(ecIns._chartsViews, function (chart) { - if (!chart.__alive) { - chart.remove(ecModel, api); - } - }); - }; + if (dirtyMap && dirtyMap.get(seriesModel.uid)) { + renderTask.dirty(); + } - renderComponents = function (ecIns, ecModel, api, payload, updateParams, dirtyList) { - each(dirtyList || ecIns._componentsViews, function (componentView) { - var componentModel = componentView.__model; - clearStates(componentModel, componentView); - componentView.render(componentModel, ecModel, api, payload); - updateZ(componentModel, componentView); - updateStates(componentModel, componentView); - }); - }; - /** - * Render each chart and component - */ + if (renderTask.perform(scheduler.getPerformArgs(renderTask))) { + unfinished = true; + } + chartView.group.silent = !!seriesModel.get('silent'); // Should not call markRedraw on group, because it will disable zrender + // increamental render (alway render from the __startIndex each frame) + // chartView.group.markRedraw(); - renderSeries = function (ecIns, ecModel, api, payload, updateParams, dirtyMap) { - // Render all charts - var scheduler = ecIns._scheduler; - updateParams = extend(updateParams || {}, { - updatedSeries: ecModel.getSeries() - }); // TODO progressive? + updateBlend(seriesModel, chartView); + updateSeriesElementSelection(seriesModel); + }); + scheduler.unfinished = unfinished || scheduler.unfinished; + lifecycle.trigger('series:layoutlabels', ecModel, api, updateParams); // transition after label is layouted. - lifecycle.trigger('series:beforeupdate', ecModel, api, updateParams); - var unfinished = false; - ecModel.eachSeries(function (seriesModel) { - var chartView = ecIns._chartsMap[seriesModel.__viewId]; - chartView.__alive = true; - var renderTask = chartView.renderTask; - scheduler.updatePayload(renderTask, payload); // TODO states on marker. + lifecycle.trigger('series:transition', ecModel, api, updateParams); + ecModel.eachSeries(function (seriesModel) { + var chartView = ecIns._chartsMap[seriesModel.__viewId]; // Update Z after labels updated. Before applying states. - clearStates(seriesModel, chartView); + updateZ(seriesModel, chartView); // NOTE: Update states after label is updated. + // label should be in normal status when layouting. - if (dirtyMap && dirtyMap.get(seriesModel.uid)) { - renderTask.dirty(); - } + updateStates(seriesModel, chartView); + }); // If use hover layer - if (renderTask.perform(scheduler.getPerformArgs(renderTask))) { - unfinished = true; - } + updateHoverLayerStatus(ecIns, ecModel); + lifecycle.trigger('series:afterupdate', ecModel, api, updateParams); + }; - chartView.group.silent = !!seriesModel.get('silent'); // Should not call markRedraw on group, because it will disable zrender - // increamental render (alway render from the __startIndex each frame) - // chartView.group.markRedraw(); + markStatusToUpdate = function (ecIns) { + ecIns[STATUS_NEEDS_UPDATE_KEY] = true; // Wake up zrender if it's sleep. Let it update states in the next frame. - updateBlend(seriesModel, chartView); - updateSeriesElementSelection(seriesModel); - }); - scheduler.unfinished = unfinished || scheduler.unfinished; - lifecycle.trigger('series:layoutlabels', ecModel, api, updateParams); // transition after label is layouted. + ecIns.getZr().wakeUp(); + }; - lifecycle.trigger('series:transition', ecModel, api, updateParams); - ecModel.eachSeries(function (seriesModel) { - var chartView = ecIns._chartsMap[seriesModel.__viewId]; // Update Z after labels updated. Before applying states. + applyChangedStates = function (ecIns) { + if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) { + return; + } - updateZ(seriesModel, chartView); // NOTE: Update states after label is updated. - // label should be in normal status when layouting. + ecIns.getZr().storage.traverse(function (el) { + // Not applied on removed elements, it may still in fading. + if (isElementRemoved(el)) { + return; + } - updateStates(seriesModel, chartView); - }); // If use hover layer + applyElementStates(el); + }); + ecIns[STATUS_NEEDS_UPDATE_KEY] = false; + }; - updateHoverLayerStatus(ecIns, ecModel); - lifecycle.trigger('series:afterupdate', ecModel, api, updateParams); - }; + function applyElementStates(el) { + var newStates = []; + var oldStates = el.currentStates; // Keep other states. - markStatusToUpdate = function (ecIns) { - ecIns[STATUS_NEEDS_UPDATE_KEY] = true; // Wake up zrender if it's sleep. Let it update states in the next frame. + for (var i = 0; i < oldStates.length; i++) { + var stateName = oldStates[i]; - ecIns.getZr().wakeUp(); - }; + if (!(stateName === 'emphasis' || stateName === 'blur' || stateName === 'select')) { + newStates.push(stateName); + } + } // Only use states when it's exists. - applyChangedStates = function (ecIns) { - if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) { - return; - } - ecIns.getZr().storage.traverse(function (el) { - // Not applied on removed elements, it may still in fading. - if (isElementRemoved(el)) { - return; - } + if (el.selected && el.states.select) { + newStates.push('select'); + } - applyElementStates(el); - }); - ecIns[STATUS_NEEDS_UPDATE_KEY] = false; - }; + if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) { + newStates.push('emphasis'); + } else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) { + newStates.push('blur'); + } - function applyElementStates(el) { - var newStates = []; - var oldStates = el.currentStates; // Keep other states. + el.useStates(newStates); + } - for (var i = 0; i < oldStates.length; i++) { - var stateName = oldStates[i]; + function updateHoverLayerStatus(ecIns, ecModel) { + var zr = ecIns._zr; + var storage = zr.storage; + var elCount = 0; + storage.traverse(function (el) { + if (!el.isGroup) { + elCount++; + } + }); - if (!(stateName === 'emphasis' || stateName === 'blur' || stateName === 'select')) { - newStates.push(stateName); - } - } // Only use states when it's exists. + if (elCount > ecModel.get('hoverLayerThreshold') && !env.node && !env.worker) { + ecModel.eachSeries(function (seriesModel) { + if (seriesModel.preventUsingHoverLayer) { + return; + } + var chartView = ecIns._chartsMap[seriesModel.__viewId]; - if (el.selected && el.states.select) { - newStates.push('select'); - } + if (chartView.__alive) { + chartView.eachRendered(function (el) { + if (el.states.emphasis) { + el.states.emphasis.hoverLayer = true; + } + }); + } + }); + } + } + /** + * Update chart and blend. + */ - if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) { - newStates.push('emphasis'); - } else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) { - newStates.push('blur'); - } + function updateBlend(seriesModel, chartView) { + var blendMode = seriesModel.get('blendMode') || null; + chartView.eachRendered(function (el) { + // FIXME marker and other components + if (!el.isGroup) { + // DONT mark the element dirty. In case element is incremental and don't wan't to rerender. + el.style.blend = blendMode; + } + }); + } - el.useStates(newStates); - } + function updateZ(model, view) { + if (model.preventAutoZ) { + return; + } - function updateHoverLayerStatus(ecIns, ecModel) { - var zr = ecIns._zr; - var storage = zr.storage; - var elCount = 0; - storage.traverse(function (el) { - if (!el.isGroup) { - elCount++; - } - }); + var z = model.get('z') || 0; + var zlevel = model.get('zlevel') || 0; // Set z and zlevel - if (elCount > ecModel.get('hoverLayerThreshold') && !env.node && !env.worker) { - ecModel.eachSeries(function (seriesModel) { - if (seriesModel.preventUsingHoverLayer) { - return; - } + view.eachRendered(function (el) { + doUpdateZ(el, z, zlevel, -Infinity); // Don't traverse the children because it has been traversed in _updateZ. - var chartView = ecIns._chartsMap[seriesModel.__viewId]; + return true; + }); + } - if (chartView.__alive) { - chartView.eachRendered(function (el) { - if (el.states.emphasis) { - el.states.emphasis.hoverLayer = true; - } - }); - } - }); - } - } - /** - * Update chart and blend. - */ + function doUpdateZ(el, z, zlevel, maxZ2) { + // Group may also have textContent + var label = el.getTextContent(); + var labelLine = el.getTextGuideLine(); + var isGroup = el.isGroup; - function updateBlend(seriesModel, chartView) { - var blendMode = seriesModel.get('blendMode') || null; - chartView.eachRendered(function (el) { - // FIXME marker and other components - if (!el.isGroup) { - // DONT mark the element dirty. In case element is incremental and don't wan't to rerender. - el.style.blend = blendMode; - } - }); - } + if (isGroup) { + // set z & zlevel of children elements of Group + var children = el.childrenRef(); - function updateZ(model, view) { - if (model.preventAutoZ) { - return; - } + for (var i = 0; i < children.length; i++) { + maxZ2 = Math.max(doUpdateZ(children[i], z, zlevel, maxZ2), maxZ2); + } + } else { + // not Group + el.z = z; + el.zlevel = zlevel; + maxZ2 = Math.max(el.z2, maxZ2); + } // always set z and zlevel if label/labelLine exists - var z = model.get('z') || 0; - var zlevel = model.get('zlevel') || 0; // Set z and zlevel - view.eachRendered(function (el) { - doUpdateZ(el, z, zlevel, -Infinity); // Don't traverse the children because it has been traversed in _updateZ. + if (label) { + label.z = z; + label.zlevel = zlevel; // lift z2 of text content + // TODO if el.emphasis.z2 is spcefied, what about textContent. - return true; - }); - } + isFinite(maxZ2) && (label.z2 = maxZ2 + 2); + } - function doUpdateZ(el, z, zlevel, maxZ2) { - // Group may also have textContent - var label = el.getTextContent(); - var labelLine = el.getTextGuideLine(); - var isGroup = el.isGroup; + if (labelLine) { + var textGuideLineConfig = el.textGuideLineConfig; + labelLine.z = z; + labelLine.zlevel = zlevel; + isFinite(maxZ2) && (labelLine.z2 = maxZ2 + (textGuideLineConfig && textGuideLineConfig.showAbove ? 1 : -1)); + } - if (isGroup) { - // set z & zlevel of children elements of Group - var children = el.childrenRef(); + return maxZ2; + } // Clear states without animation. + // TODO States on component. - for (var i = 0; i < children.length; i++) { - maxZ2 = Math.max(doUpdateZ(children[i], z, zlevel, maxZ2), maxZ2); - } - } else { - // not Group - el.z = z; - el.zlevel = zlevel; - maxZ2 = Math.max(el.z2, maxZ2); - } // always set z and zlevel if label/labelLine exists + function clearStates(model, view) { + view.eachRendered(function (el) { + // Not applied on removed elements, it may still in fading. + if (isElementRemoved(el)) { + return; + } - if (label) { - label.z = z; - label.zlevel = zlevel; // lift z2 of text content - // TODO if el.emphasis.z2 is spcefied, what about textContent. + var textContent = el.getTextContent(); + var textGuide = el.getTextGuideLine(); - isFinite(maxZ2) && (label.z2 = maxZ2 + 2); - } + if (el.stateTransition) { + el.stateTransition = null; + } - if (labelLine) { - var textGuideLineConfig = el.textGuideLineConfig; - labelLine.z = z; - labelLine.zlevel = zlevel; - isFinite(maxZ2) && (labelLine.z2 = maxZ2 + (textGuideLineConfig && textGuideLineConfig.showAbove ? 1 : -1)); - } + if (textContent && textContent.stateTransition) { + textContent.stateTransition = null; + } - return maxZ2; - } // Clear states without animation. - // TODO States on component. + if (textGuide && textGuide.stateTransition) { + textGuide.stateTransition = null; + } // TODO If el is incremental. - function clearStates(model, view) { - view.eachRendered(function (el) { - // Not applied on removed elements, it may still in fading. - if (isElementRemoved(el)) { - return; - } + if (el.hasState()) { + el.prevStates = el.currentStates; + el.clearStates(); + } else if (el.prevStates) { + el.prevStates = null; + } + }); + } - var textContent = el.getTextContent(); - var textGuide = el.getTextGuideLine(); + function updateStates(model, view) { + var stateAnimationModel = model.getModel('stateAnimation'); + var enableAnimation = model.isAnimationEnabled(); + var duration = stateAnimationModel.get('duration'); + var stateTransition = duration > 0 ? { + duration: duration, + delay: stateAnimationModel.get('delay'), + easing: stateAnimationModel.get('easing') // additive: stateAnimationModel.get('additive') - if (el.stateTransition) { - el.stateTransition = null; - } + } : null; + view.eachRendered(function (el) { + if (el.states && el.states.emphasis) { + // Not applied on removed elements, it may still in fading. + if (isElementRemoved(el)) { + return; + } - if (textContent && textContent.stateTransition) { - textContent.stateTransition = null; - } + if (el instanceof Path) { + savePathStates(el); + } // Only updated on changed element. In case element is incremental and don't wan't to rerender. + // TODO, a more proper way? - if (textGuide && textGuide.stateTransition) { - textGuide.stateTransition = null; - } // TODO If el is incremental. + if (el.__dirty) { + var prevStates = el.prevStates; // Restore states without animation - if (el.hasState()) { - el.prevStates = el.currentStates; - el.clearStates(); - } else if (el.prevStates) { - el.prevStates = null; - } - }); + if (prevStates) { + el.useStates(prevStates); } + } // Update state transition and enable animation again. - function updateStates(model, view) { - var stateAnimationModel = model.getModel('stateAnimation'); - var enableAnimation = model.isAnimationEnabled(); - var duration = stateAnimationModel.get('duration'); - var stateTransition = duration > 0 ? { - duration: duration, - delay: stateAnimationModel.get('delay'), - easing: stateAnimationModel.get('easing') // additive: stateAnimationModel.get('additive') - - } : null; - view.eachRendered(function (el) { - if (el.states && el.states.emphasis) { - // Not applied on removed elements, it may still in fading. - if (isElementRemoved(el)) { - return; - } - if (el instanceof Path) { - savePathStates(el); - } // Only updated on changed element. In case element is incremental and don't wan't to rerender. - // TODO, a more proper way? + if (enableAnimation) { + el.stateTransition = stateTransition; + var textContent = el.getTextContent(); + var textGuide = el.getTextGuideLine(); // TODO Is it necessary to animate label? + if (textContent) { + textContent.stateTransition = stateTransition; + } - if (el.__dirty) { - var prevStates = el.prevStates; // Restore states without animation + if (textGuide) { + textGuide.stateTransition = stateTransition; + } + } // The use higlighted and selected flag to toggle states. - if (prevStates) { - el.useStates(prevStates); - } - } // Update state transition and enable animation again. + if (el.__dirty) { + applyElementStates(el); + } + } + }); + } - if (enableAnimation) { - el.stateTransition = stateTransition; - var textContent = el.getTextContent(); - var textGuide = el.getTextGuideLine(); // TODO Is it necessary to animate label? + createExtensionAPI = function (ecIns) { + return new ( + /** @class */ + function (_super) { + __extends(class_1, _super); - if (textContent) { - textContent.stateTransition = stateTransition; - } + function class_1() { + return _super !== null && _super.apply(this, arguments) || this; + } - if (textGuide) { - textGuide.stateTransition = stateTransition; - } - } // The use higlighted and selected flag to toggle states. + class_1.prototype.getCoordinateSystems = function () { + return ecIns._coordSysMgr.getCoordinateSystems(); + }; + class_1.prototype.getComponentByElement = function (el) { + while (el) { + var modelInfo = el.__ecComponentInfo; - if (el.__dirty) { - applyElementStates(el); - } - } - }); + if (modelInfo != null) { + return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index); } - createExtensionAPI = function (ecIns) { - return new ( - /** @class */ - function (_super) { - __extends(class_1, _super); - - function class_1() { - return _super !== null && _super.apply(this, arguments) || this; - } - - class_1.prototype.getCoordinateSystems = function () { - return ecIns._coordSysMgr.getCoordinateSystems(); - }; - - class_1.prototype.getComponentByElement = function (el) { - while (el) { - var modelInfo = el.__ecComponentInfo; - - if (modelInfo != null) { - return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index); - } - - el = el.parent; - } - }; + el = el.parent; + } + }; - class_1.prototype.enterEmphasis = function (el, highlightDigit) { - enterEmphasis(el, highlightDigit); - markStatusToUpdate(ecIns); - }; + class_1.prototype.enterEmphasis = function (el, highlightDigit) { + enterEmphasis(el, highlightDigit); + markStatusToUpdate(ecIns); + }; - class_1.prototype.leaveEmphasis = function (el, highlightDigit) { - leaveEmphasis(el, highlightDigit); - markStatusToUpdate(ecIns); - }; + class_1.prototype.leaveEmphasis = function (el, highlightDigit) { + leaveEmphasis(el, highlightDigit); + markStatusToUpdate(ecIns); + }; - class_1.prototype.enterBlur = function (el) { - enterBlur(el); - markStatusToUpdate(ecIns); - }; + class_1.prototype.enterBlur = function (el) { + enterBlur(el); + markStatusToUpdate(ecIns); + }; - class_1.prototype.leaveBlur = function (el) { - leaveBlur(el); - markStatusToUpdate(ecIns); - }; + class_1.prototype.leaveBlur = function (el) { + leaveBlur(el); + markStatusToUpdate(ecIns); + }; - class_1.prototype.enterSelect = function (el) { - enterSelect(el); - markStatusToUpdate(ecIns); - }; + class_1.prototype.enterSelect = function (el) { + enterSelect(el); + markStatusToUpdate(ecIns); + }; - class_1.prototype.leaveSelect = function (el) { - leaveSelect(el); - markStatusToUpdate(ecIns); - }; + class_1.prototype.leaveSelect = function (el) { + leaveSelect(el); + markStatusToUpdate(ecIns); + }; - class_1.prototype.getModel = function () { - return ecIns.getModel(); - }; + class_1.prototype.getModel = function () { + return ecIns.getModel(); + }; - class_1.prototype.getViewOfComponentModel = function (componentModel) { - return ecIns.getViewOfComponentModel(componentModel); - }; + class_1.prototype.getViewOfComponentModel = function (componentModel) { + return ecIns.getViewOfComponentModel(componentModel); + }; - class_1.prototype.getViewOfSeriesModel = function (seriesModel) { - return ecIns.getViewOfSeriesModel(seriesModel); - }; + class_1.prototype.getViewOfSeriesModel = function (seriesModel) { + return ecIns.getViewOfSeriesModel(seriesModel); + }; - return class_1; - }(ExtensionAPI))(ecIns); - }; + return class_1; + }(ExtensionAPI))(ecIns); + }; - enableConnect = function (chart) { - function updateConnectedChartsStatus(charts, status) { - for (var i = 0; i < charts.length; i++) { - var otherChart = charts[i]; - otherChart[CONNECT_STATUS_KEY] = status; - } - } + enableConnect = function (chart) { + function updateConnectedChartsStatus(charts, status) { + for (var i = 0; i < charts.length; i++) { + var otherChart = charts[i]; + otherChart[CONNECT_STATUS_KEY] = status; + } + } - each(eventActionMap, function (actionType, eventType) { - chart._messageCenter.on(eventType, function (event) { - if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) { - if (event && event.escapeConnect) { - return; - } + each(eventActionMap, function (actionType, eventType) { + chart._messageCenter.on(eventType, function (event) { + if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) { + if (event && event.escapeConnect) { + return; + } - var action_1 = chart.makeActionFromEvent(event); - var otherCharts_1 = []; - each(instances$1, function (otherChart) { - if (otherChart !== chart && otherChart.group === chart.group) { - otherCharts_1.push(otherChart); - } - }); - updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_PENDING); - each(otherCharts_1, function (otherChart) { - if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) { - otherChart.dispatchAction(action_1); - } - }); - updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_UPDATED); - } - }); - }); - }; - }(); + var action_1 = chart.makeActionFromEvent(event); + var otherCharts_1 = []; + each(instances$1, function (otherChart) { + if (otherChart !== chart && otherChart.group === chart.group) { + otherCharts_1.push(otherChart); + } + }); + updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_PENDING); + each(otherCharts_1, function (otherChart) { + if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) { + otherChart.dispatchAction(action_1); + } + }); + updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_UPDATED); + } + }); + }); + }; + }(); - return ECharts; - }(Eventful); + return ECharts; + }(Eventful); var echartsProto = ECharts.prototype; echartsProto.on = createRegisterEventWithLowercaseECharts('on'); @@ -30130,30 +30130,30 @@ // @ts-ignore echartsProto.one = function (eventName, cb, ctx) { - var self = this; - deprecateLog('ECharts#one is deprecated.'); + var self = this; + deprecateLog('ECharts#one is deprecated.'); - function wrapped() { - var args2 = []; + function wrapped() { + var args2 = []; - for (var _i = 0; _i < arguments.length; _i++) { - args2[_i] = arguments[_i]; - } + for (var _i = 0; _i < arguments.length; _i++) { + args2[_i] = arguments[_i]; + } - cb && cb.apply && cb.apply(this, args2); // @ts-ignore + cb && cb.apply && cb.apply(this, args2); // @ts-ignore - self.off(eventName, wrapped); - } + self.off(eventName, wrapped); + } - this.on.call(this, eventName, wrapped, ctx); + this.on.call(this, eventName, wrapped, ctx); }; var MOUSE_EVENT_NAMES = ['click', 'dblclick', 'mouseover', 'mouseout', 'mousemove', 'mousedown', 'mouseup', 'globalout', 'contextmenu']; function disposedWarning(id) { - if ("development" !== 'production') { - console.warn('Instance ' + id + ' has been disposed'); - } + if ("development" !== 'production') { + console.warn('Instance ' + id + ' has been disposed'); + } } var actions = {}; @@ -30184,39 +30184,39 @@ */ function init$1(dom, theme, opts) { - var isClient = !(opts && opts.ssr); + var isClient = !(opts && opts.ssr); - if (isClient) { - if ("development" !== 'production') { - if (!dom) { - throw new Error('Initialize failed: invalid dom.'); - } - } + if (isClient) { + if ("development" !== 'production') { + if (!dom) { + throw new Error('Initialize failed: invalid dom.'); + } + } - var existInstance = getInstanceByDom(dom); + var existInstance = getInstanceByDom(dom); - if (existInstance) { - if ("development" !== 'production') { - console.warn('There is a chart instance already initialized on the dom.'); - } + if (existInstance) { + if ("development" !== 'production') { + console.warn('There is a chart instance already initialized on the dom.'); + } - return existInstance; - } + return existInstance; + } - if ("development" !== 'production') { - if (isDom(dom) && dom.nodeName.toUpperCase() !== 'CANVAS' && (!dom.clientWidth && (!opts || opts.width == null) || !dom.clientHeight && (!opts || opts.height == null))) { - console.warn('Can\'t get DOM width or height. Please check ' + 'dom.clientWidth and dom.clientHeight. They should not be 0.' + 'For example, you may need to call this in the callback ' + 'of window.onload.'); - } - } + if ("development" !== 'production') { + if (isDom(dom) && dom.nodeName.toUpperCase() !== 'CANVAS' && (!dom.clientWidth && (!opts || opts.width == null) || !dom.clientHeight && (!opts || opts.height == null))) { + console.warn('Can\'t get DOM width or height. Please check ' + 'dom.clientWidth and dom.clientHeight. They should not be 0.' + 'For example, you may need to call this in the callback ' + 'of window.onload.'); + } } + } - var chart = new ECharts(dom, theme, opts); - chart.id = 'ec_' + idBase++; - instances$1[chart.id] = chart; - isClient && setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id); - enableConnect(chart); - lifecycle.trigger('afterinit', chart); - return chart; + var chart = new ECharts(dom, theme, opts); + chart.id = 'ec_' + idBase++; + instances$1[chart.id] = chart; + isClient && setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id); + enableConnect(chart); + lifecycle.trigger('afterinit', chart); + return chart; } /** * @usage @@ -30237,31 +30237,31 @@ */ function connect(groupId) { - // Is array of charts - if (isArray(groupId)) { - var charts = groupId; - groupId = null; // If any chart has group - - each(charts, function (chart) { - if (chart.group != null) { - groupId = chart.group; - } - }); - groupId = groupId || 'g_' + groupIdBase++; - each(charts, function (chart) { - chart.group = groupId; - }); - } + // Is array of charts + if (isArray(groupId)) { + var charts = groupId; + groupId = null; // If any chart has group + + each(charts, function (chart) { + if (chart.group != null) { + groupId = chart.group; + } + }); + groupId = groupId || 'g_' + groupIdBase++; + each(charts, function (chart) { + chart.group = groupId; + }); + } - connectedGroups[groupId] = true; - return groupId; + connectedGroups[groupId] = true; + return groupId; } /** * @deprecated */ function disConnect(groupId) { - connectedGroups[groupId] = false; + connectedGroups[groupId] = false; } /** * Alias and backword compat @@ -30273,41 +30273,41 @@ */ function dispose$1(chart) { - if (isString(chart)) { - chart = instances$1[chart]; - } else if (!(chart instanceof ECharts)) { - // Try to treat as dom - chart = getInstanceByDom(chart); - } + if (isString(chart)) { + chart = instances$1[chart]; + } else if (!(chart instanceof ECharts)) { + // Try to treat as dom + chart = getInstanceByDom(chart); + } - if (chart instanceof ECharts && !chart.isDisposed()) { - chart.dispose(); - } + if (chart instanceof ECharts && !chart.isDisposed()) { + chart.dispose(); + } } function getInstanceByDom(dom) { - return instances$1[getAttribute(dom, DOM_ATTRIBUTE_KEY)]; + return instances$1[getAttribute(dom, DOM_ATTRIBUTE_KEY)]; } function getInstanceById(key) { - return instances$1[key]; + return instances$1[key]; } /** * Register theme */ function registerTheme(name, theme) { - themeStorage[name] = theme; + themeStorage[name] = theme; } /** * Register option preprocessor */ function registerPreprocessor(preprocessorFunc) { - if (indexOf(optionPreprocessorFuncs, preprocessorFunc) < 0) { - optionPreprocessorFuncs.push(preprocessorFunc); - } + if (indexOf(optionPreprocessorFuncs, preprocessorFunc) < 0) { + optionPreprocessorFuncs.push(preprocessorFunc); + } } function registerProcessor(priority, processor) { - normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT); + normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT); } /** * Register postIniter @@ -30315,7 +30315,7 @@ */ function registerPostInit(postInitFunc) { - registerUpdateLifecycle('afterinit', postInitFunc); + registerUpdateLifecycle('afterinit', postInitFunc); } /** * Register postUpdater @@ -30323,43 +30323,43 @@ */ function registerPostUpdate(postUpdateFunc) { - registerUpdateLifecycle('afterupdate', postUpdateFunc); + registerUpdateLifecycle('afterupdate', postUpdateFunc); } function registerUpdateLifecycle(name, cb) { - lifecycle.on(name, cb); + lifecycle.on(name, cb); } function registerAction(actionInfo, eventName, action) { - if (isFunction(eventName)) { - action = eventName; - eventName = ''; - } + if (isFunction(eventName)) { + action = eventName; + eventName = ''; + } - var actionType = isObject(actionInfo) ? actionInfo.type : [actionInfo, actionInfo = { - event: eventName - }][0]; // Event name is all lowercase + var actionType = isObject(actionInfo) ? actionInfo.type : [actionInfo, actionInfo = { + event: eventName + }][0]; // Event name is all lowercase - actionInfo.event = (actionInfo.event || actionType).toLowerCase(); - eventName = actionInfo.event; + actionInfo.event = (actionInfo.event || actionType).toLowerCase(); + eventName = actionInfo.event; - if (eventActionMap[eventName]) { - // Already registered. - return; - } // Validate action type and event name. + if (eventActionMap[eventName]) { + // Already registered. + return; + } // Validate action type and event name. - assert(ACTION_REG.test(actionType) && ACTION_REG.test(eventName)); + assert(ACTION_REG.test(actionType) && ACTION_REG.test(eventName)); - if (!actions[actionType]) { - actions[actionType] = { - action: action, - actionInfo: actionInfo - }; - } + if (!actions[actionType]) { + actions[actionType] = { + action: action, + actionInfo: actionInfo + }; + } - eventActionMap[eventName] = actionType; + eventActionMap[eventName] = actionType; } function registerCoordinateSystem(type, coordSysCreator) { - CoordinateSystemManager.register(type, coordSysCreator); + CoordinateSystemManager.register(type, coordSysCreator); } /** * Get dimensions of specified coordinate system. @@ -30368,53 +30368,53 @@ */ function getCoordinateSystemDimensions(type) { - var coordSysCreator = CoordinateSystemManager.get(type); + var coordSysCreator = CoordinateSystemManager.get(type); - if (coordSysCreator) { - return coordSysCreator.getDimensionsInfo ? coordSysCreator.getDimensionsInfo() : coordSysCreator.dimensions.slice(); - } + if (coordSysCreator) { + return coordSysCreator.getDimensionsInfo ? coordSysCreator.getDimensionsInfo() : coordSysCreator.dimensions.slice(); + } } function registerLayout(priority, layoutTask) { - normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout'); + normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout'); } function registerVisual(priority, visualTask) { - normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual'); + normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual'); } var registeredTasks = []; function normalizeRegister(targetList, priority, fn, defaultPriority, visualType) { - if (isFunction(priority) || isObject(priority)) { - fn = priority; - priority = defaultPriority; - } + if (isFunction(priority) || isObject(priority)) { + fn = priority; + priority = defaultPriority; + } - if ("development" !== 'production') { - if (isNaN(priority) || priority == null) { - throw new Error('Illegal priority'); - } // Check duplicate + if ("development" !== 'production') { + if (isNaN(priority) || priority == null) { + throw new Error('Illegal priority'); + } // Check duplicate - each(targetList, function (wrap) { - assert(wrap.__raw !== fn); - }); - } // Already registered + each(targetList, function (wrap) { + assert(wrap.__raw !== fn); + }); + } // Already registered - if (indexOf(registeredTasks, fn) >= 0) { - return; - } + if (indexOf(registeredTasks, fn) >= 0) { + return; + } - registeredTasks.push(fn); - var stageHandler = Scheduler.wrapStageHandler(fn, visualType); - stageHandler.__prio = priority; - stageHandler.__raw = fn; - targetList.push(stageHandler); + registeredTasks.push(fn); + var stageHandler = Scheduler.wrapStageHandler(fn, visualType); + stageHandler.__prio = priority; + stageHandler.__raw = fn; + targetList.push(stageHandler); } function registerLoading(name, loadingFx) { - loadingEffects[name] = loadingFx; + loadingEffects[name] = loadingFx; } /** * ZRender need a canvas context to do measureText. @@ -30434,13 +30434,13 @@ */ function setCanvasCreator(creator) { - if ("development" !== 'production') { - deprecateLog('setCanvasCreator is deprecated. Use setPlatformAPI({ createCanvas }) instead.'); - } + if ("development" !== 'production') { + deprecateLog('setCanvasCreator is deprecated. Use setPlatformAPI({ createCanvas }) instead.'); + } - setPlatformAPI({ - createCanvas: creator - }); + setPlatformAPI({ + createCanvas: creator + }); } /** * The parameters and usage: see `geoSourceManager.registerMap`. @@ -30448,12 +30448,12 @@ */ function registerMap(mapName, geoJson, specialAreas) { - var registerMap = getImpl('registerMap'); - registerMap && registerMap(mapName, geoJson, specialAreas); + var registerMap = getImpl('registerMap'); + registerMap && registerMap(mapName, geoJson, specialAreas); } function getMap(mapName) { - var getMap = getImpl('getMap'); - return getMap && getMap(mapName); + var getMap = getImpl('getMap'); + return getMap && getMap(mapName); } var registerTransform = registerExternalTransform; /** @@ -30482,29 +30482,29 @@ registerLoading('default', defaultLoading); // Default actions registerAction({ - type: HIGHLIGHT_ACTION_TYPE, - event: HIGHLIGHT_ACTION_TYPE, - update: HIGHLIGHT_ACTION_TYPE + type: HIGHLIGHT_ACTION_TYPE, + event: HIGHLIGHT_ACTION_TYPE, + update: HIGHLIGHT_ACTION_TYPE }, noop); registerAction({ - type: DOWNPLAY_ACTION_TYPE, - event: DOWNPLAY_ACTION_TYPE, - update: DOWNPLAY_ACTION_TYPE + type: DOWNPLAY_ACTION_TYPE, + event: DOWNPLAY_ACTION_TYPE, + update: DOWNPLAY_ACTION_TYPE }, noop); registerAction({ - type: SELECT_ACTION_TYPE, - event: SELECT_ACTION_TYPE, - update: SELECT_ACTION_TYPE + type: SELECT_ACTION_TYPE, + event: SELECT_ACTION_TYPE, + update: SELECT_ACTION_TYPE }, noop); registerAction({ - type: UNSELECT_ACTION_TYPE, - event: UNSELECT_ACTION_TYPE, - update: UNSELECT_ACTION_TYPE + type: UNSELECT_ACTION_TYPE, + event: UNSELECT_ACTION_TYPE, + update: UNSELECT_ACTION_TYPE }, noop); registerAction({ - type: TOGGLE_SELECT_ACTION_TYPE, - event: TOGGLE_SELECT_ACTION_TYPE, - update: TOGGLE_SELECT_ACTION_TYPE + type: TOGGLE_SELECT_ACTION_TYPE, + event: TOGGLE_SELECT_ACTION_TYPE, + update: TOGGLE_SELECT_ACTION_TYPE }, noop); // Default theme registerTheme('light', lightTheme); @@ -30515,66 +30515,66 @@ var extensions = []; var extensionRegisters = { - registerPreprocessor: registerPreprocessor, - registerProcessor: registerProcessor, - registerPostInit: registerPostInit, - registerPostUpdate: registerPostUpdate, - registerUpdateLifecycle: registerUpdateLifecycle, - registerAction: registerAction, - registerCoordinateSystem: registerCoordinateSystem, - registerLayout: registerLayout, - registerVisual: registerVisual, - registerTransform: registerTransform, - registerLoading: registerLoading, - registerMap: registerMap, - registerImpl: registerImpl, - PRIORITY: PRIORITY, - ComponentModel: ComponentModel, - ComponentView: ComponentView, - SeriesModel: SeriesModel, - ChartView: ChartView, - // TODO Use ComponentModel and SeriesModel instead of Constructor - registerComponentModel: function (ComponentModelClass) { - ComponentModel.registerClass(ComponentModelClass); - }, - registerComponentView: function (ComponentViewClass) { - ComponentView.registerClass(ComponentViewClass); - }, - registerSeriesModel: function (SeriesModelClass) { - SeriesModel.registerClass(SeriesModelClass); - }, - registerChartView: function (ChartViewClass) { - ChartView.registerClass(ChartViewClass); - }, - registerSubTypeDefaulter: function (componentType, defaulter) { - ComponentModel.registerSubTypeDefaulter(componentType, defaulter); - }, - registerPainter: function (painterType, PainterCtor) { - registerPainter(painterType, PainterCtor); - } + registerPreprocessor: registerPreprocessor, + registerProcessor: registerProcessor, + registerPostInit: registerPostInit, + registerPostUpdate: registerPostUpdate, + registerUpdateLifecycle: registerUpdateLifecycle, + registerAction: registerAction, + registerCoordinateSystem: registerCoordinateSystem, + registerLayout: registerLayout, + registerVisual: registerVisual, + registerTransform: registerTransform, + registerLoading: registerLoading, + registerMap: registerMap, + registerImpl: registerImpl, + PRIORITY: PRIORITY, + ComponentModel: ComponentModel, + ComponentView: ComponentView, + SeriesModel: SeriesModel, + ChartView: ChartView, + // TODO Use ComponentModel and SeriesModel instead of Constructor + registerComponentModel: function (ComponentModelClass) { + ComponentModel.registerClass(ComponentModelClass); + }, + registerComponentView: function (ComponentViewClass) { + ComponentView.registerClass(ComponentViewClass); + }, + registerSeriesModel: function (SeriesModelClass) { + SeriesModel.registerClass(SeriesModelClass); + }, + registerChartView: function (ChartViewClass) { + ChartView.registerClass(ChartViewClass); + }, + registerSubTypeDefaulter: function (componentType, defaulter) { + ComponentModel.registerSubTypeDefaulter(componentType, defaulter); + }, + registerPainter: function (painterType, PainterCtor) { + registerPainter(painterType, PainterCtor); + } }; function use(ext) { - if (isArray(ext)) { - // use([ChartLine, ChartBar]); - each(ext, function (singleExt) { - use(singleExt); - }); - return; - } + if (isArray(ext)) { + // use([ChartLine, ChartBar]); + each(ext, function (singleExt) { + use(singleExt); + }); + return; + } - if (indexOf(extensions, ext) >= 0) { - return; - } + if (indexOf(extensions, ext) >= 0) { + return; + } - extensions.push(ext); + extensions.push(ext); - if (isFunction(ext)) { - ext = { - install: ext - }; - } + if (isFunction(ext)) { + ext = { + install: ext + }; + } - ext.install(extensionRegisters); + ext.install(extensionRegisters); } /* @@ -30620,388 +30620,388 @@ * under the License. */ function dataIndexMapValueLength(valNumOrArrLengthMoreThan2) { - return valNumOrArrLengthMoreThan2 == null ? 0 : valNumOrArrLengthMoreThan2.length || 1; + return valNumOrArrLengthMoreThan2 == null ? 0 : valNumOrArrLengthMoreThan2.length || 1; } function defaultKeyGetter(item) { - return item; + return item; } var DataDiffer = - /** @class */ - function () { - /** - * @param context Can be visited by this.context in callback. - */ - function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context, // By default: 'oneToOne'. - diffMode) { - this._old = oldArr; - this._new = newArr; - this._oldKeyGetter = oldKeyGetter || defaultKeyGetter; - this._newKeyGetter = newKeyGetter || defaultKeyGetter; // Visible in callback via `this.context`; - - this.context = context; - this._diffModeMultiple = diffMode === 'multiple'; - } - /** - * Callback function when add a data - */ - - - DataDiffer.prototype.add = function (func) { - this._add = func; - return this; - }; - /** - * Callback function when update a data - */ - - - DataDiffer.prototype.update = function (func) { - this._update = func; - return this; - }; - /** - * Callback function when update a data and only work in `cbMode: 'byKey'`. - */ - - - DataDiffer.prototype.updateManyToOne = function (func) { - this._updateManyToOne = func; - return this; - }; - /** - * Callback function when update a data and only work in `cbMode: 'byKey'`. - */ - - - DataDiffer.prototype.updateOneToMany = function (func) { - this._updateOneToMany = func; - return this; - }; - /** - * Callback function when update a data and only work in `cbMode: 'byKey'`. - */ - - - DataDiffer.prototype.updateManyToMany = function (func) { - this._updateManyToMany = func; - return this; - }; - /** - * Callback function when remove a data - */ - - - DataDiffer.prototype.remove = function (func) { - this._remove = func; - return this; - }; - - DataDiffer.prototype.execute = function () { - this[this._diffModeMultiple ? '_executeMultiple' : '_executeOneToOne'](); - }; - - DataDiffer.prototype._executeOneToOne = function () { - var oldArr = this._old; - var newArr = this._new; - var newDataIndexMap = {}; - var oldDataKeyArr = new Array(oldArr.length); - var newDataKeyArr = new Array(newArr.length); - - this._initIndexMap(oldArr, null, oldDataKeyArr, '_oldKeyGetter'); - - this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter'); + /** @class */ + function () { + /** + * @param context Can be visited by this.context in callback. + */ + function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context, // By default: 'oneToOne'. + diffMode) { + this._old = oldArr; + this._new = newArr; + this._oldKeyGetter = oldKeyGetter || defaultKeyGetter; + this._newKeyGetter = newKeyGetter || defaultKeyGetter; // Visible in callback via `this.context`; + + this.context = context; + this._diffModeMultiple = diffMode === 'multiple'; + } + /** + * Callback function when add a data + */ - for (var i = 0; i < oldArr.length; i++) { - var oldKey = oldDataKeyArr[i]; - var newIdxMapVal = newDataIndexMap[oldKey]; - var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal); // idx can never be empty array here. see 'set null' logic below. - if (newIdxMapValLen > 1) { - // Consider there is duplicate key (for example, use dataItem.name as key). - // We should make sure every item in newArr and oldArr can be visited. - var newIdx = newIdxMapVal.shift(); + DataDiffer.prototype.add = function (func) { + this._add = func; + return this; + }; + /** + * Callback function when update a data + */ - if (newIdxMapVal.length === 1) { - newDataIndexMap[oldKey] = newIdxMapVal[0]; - } - this._update && this._update(newIdx, i); - } else if (newIdxMapValLen === 1) { - newDataIndexMap[oldKey] = null; - this._update && this._update(newIdxMapVal, i); - } else { - this._remove && this._remove(i); - } - } + DataDiffer.prototype.update = function (func) { + this._update = func; + return this; + }; + /** + * Callback function when update a data and only work in `cbMode: 'byKey'`. + */ - this._performRestAdd(newDataKeyArr, newDataIndexMap); - }; - /** - * For example, consider the case: - * oldData: [o0, o1, o2, o3, o4, o5, o6, o7], - * newData: [n0, n1, n2, n3, n4, n5, n6, n7, n8], - * Where: - * o0, o1, n0 has key 'a' (many to one) - * o5, n4, n5, n6 has key 'b' (one to many) - * o2, n1 has key 'c' (one to one) - * n2, n3 has key 'd' (add) - * o3, o4 has key 'e' (remove) - * o6, o7, n7, n8 has key 'f' (many to many, treated as add and remove) - * Then: - * (The order of the following directives are not ensured.) - * this._updateManyToOne(n0, [o0, o1]); - * this._updateOneToMany([n4, n5, n6], o5); - * this._update(n1, o2); - * this._remove(o3); - * this._remove(o4); - * this._remove(o6); - * this._remove(o7); - * this._add(n2); - * this._add(n3); - * this._add(n7); - * this._add(n8); - */ + DataDiffer.prototype.updateManyToOne = function (func) { + this._updateManyToOne = func; + return this; + }; + /** + * Callback function when update a data and only work in `cbMode: 'byKey'`. + */ - DataDiffer.prototype._executeMultiple = function () { - var oldArr = this._old; - var newArr = this._new; - var oldDataIndexMap = {}; - var newDataIndexMap = {}; - var oldDataKeyArr = []; - var newDataKeyArr = []; - - this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter'); - - this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter'); - - for (var i = 0; i < oldDataKeyArr.length; i++) { - var oldKey = oldDataKeyArr[i]; - var oldIdxMapVal = oldDataIndexMap[oldKey]; - var newIdxMapVal = newDataIndexMap[oldKey]; - var oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal); - var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal); - - if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) { - this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal); - newDataIndexMap[oldKey] = null; - } else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) { - this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal); - newDataIndexMap[oldKey] = null; - } else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) { - this._update && this._update(newIdxMapVal, oldIdxMapVal); - newDataIndexMap[oldKey] = null; - } else if (oldIdxMapValLen > 1 && newIdxMapValLen > 1) { - this._updateManyToMany && this._updateManyToMany(newIdxMapVal, oldIdxMapVal); - newDataIndexMap[oldKey] = null; - } else if (oldIdxMapValLen > 1) { - for (var i_1 = 0; i_1 < oldIdxMapValLen; i_1++) { - this._remove && this._remove(oldIdxMapVal[i_1]); - } - } else { - this._remove && this._remove(oldIdxMapVal); - } - } - this._performRestAdd(newDataKeyArr, newDataIndexMap); - }; + DataDiffer.prototype.updateOneToMany = function (func) { + this._updateOneToMany = func; + return this; + }; + /** + * Callback function when update a data and only work in `cbMode: 'byKey'`. + */ - DataDiffer.prototype._performRestAdd = function (newDataKeyArr, newDataIndexMap) { - for (var i = 0; i < newDataKeyArr.length; i++) { - var newKey = newDataKeyArr[i]; - var newIdxMapVal = newDataIndexMap[newKey]; - var idxMapValLen = dataIndexMapValueLength(newIdxMapVal); - if (idxMapValLen > 1) { - for (var j = 0; j < idxMapValLen; j++) { - this._add && this._add(newIdxMapVal[j]); - } - } else if (idxMapValLen === 1) { - this._add && this._add(newIdxMapVal); - } // Support both `newDataKeyArr` are duplication removed or not removed. + DataDiffer.prototype.updateManyToMany = function (func) { + this._updateManyToMany = func; + return this; + }; + /** + * Callback function when remove a data + */ - newDataIndexMap[newKey] = null; - } - }; + DataDiffer.prototype.remove = function (func) { + this._remove = func; + return this; + }; + + DataDiffer.prototype.execute = function () { + this[this._diffModeMultiple ? '_executeMultiple' : '_executeOneToOne'](); + }; + + DataDiffer.prototype._executeOneToOne = function () { + var oldArr = this._old; + var newArr = this._new; + var newDataIndexMap = {}; + var oldDataKeyArr = new Array(oldArr.length); + var newDataKeyArr = new Array(newArr.length); + + this._initIndexMap(oldArr, null, oldDataKeyArr, '_oldKeyGetter'); + + this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter'); + + for (var i = 0; i < oldArr.length; i++) { + var oldKey = oldDataKeyArr[i]; + var newIdxMapVal = newDataIndexMap[oldKey]; + var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal); // idx can never be empty array here. see 'set null' logic below. + + if (newIdxMapValLen > 1) { + // Consider there is duplicate key (for example, use dataItem.name as key). + // We should make sure every item in newArr and oldArr can be visited. + var newIdx = newIdxMapVal.shift(); + + if (newIdxMapVal.length === 1) { + newDataIndexMap[oldKey] = newIdxMapVal[0]; + } + + this._update && this._update(newIdx, i); + } else if (newIdxMapValLen === 1) { + newDataIndexMap[oldKey] = null; + this._update && this._update(newIdxMapVal, i); + } else { + this._remove && this._remove(i); + } + } + + this._performRestAdd(newDataKeyArr, newDataIndexMap); + }; + /** + * For example, consider the case: + * oldData: [o0, o1, o2, o3, o4, o5, o6, o7], + * newData: [n0, n1, n2, n3, n4, n5, n6, n7, n8], + * Where: + * o0, o1, n0 has key 'a' (many to one) + * o5, n4, n5, n6 has key 'b' (one to many) + * o2, n1 has key 'c' (one to one) + * n2, n3 has key 'd' (add) + * o3, o4 has key 'e' (remove) + * o6, o7, n7, n8 has key 'f' (many to many, treated as add and remove) + * Then: + * (The order of the following directives are not ensured.) + * this._updateManyToOne(n0, [o0, o1]); + * this._updateOneToMany([n4, n5, n6], o5); + * this._update(n1, o2); + * this._remove(o3); + * this._remove(o4); + * this._remove(o6); + * this._remove(o7); + * this._add(n2); + * this._add(n3); + * this._add(n7); + * this._add(n8); + */ - DataDiffer.prototype._initIndexMap = function (arr, // Can be null. - map, // In 'byKey', the output `keyArr` is duplication removed. - // In 'byIndex', the output `keyArr` is not duplication removed and - // its indices are accurately corresponding to `arr`. - keyArr, keyGetterName) { - var cbModeMultiple = this._diffModeMultiple; - for (var i = 0; i < arr.length; i++) { - // Add prefix to avoid conflict with Object.prototype. - var key = '_ec_' + this[keyGetterName](arr[i], i); + DataDiffer.prototype._executeMultiple = function () { + var oldArr = this._old; + var newArr = this._new; + var oldDataIndexMap = {}; + var newDataIndexMap = {}; + var oldDataKeyArr = []; + var newDataKeyArr = []; - if (!cbModeMultiple) { - keyArr[i] = key; - } + this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter'); - if (!map) { - continue; - } + this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter'); - var idxMapVal = map[key]; - var idxMapValLen = dataIndexMapValueLength(idxMapVal); + for (var i = 0; i < oldDataKeyArr.length; i++) { + var oldKey = oldDataKeyArr[i]; + var oldIdxMapVal = oldDataIndexMap[oldKey]; + var newIdxMapVal = newDataIndexMap[oldKey]; + var oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal); + var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal); - if (idxMapValLen === 0) { - // Simple optimize: in most cases, one index has one key, - // do not need array. - map[key] = i; + if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) { + this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal); + newDataIndexMap[oldKey] = null; + } else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) { + this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal); + newDataIndexMap[oldKey] = null; + } else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) { + this._update && this._update(newIdxMapVal, oldIdxMapVal); + newDataIndexMap[oldKey] = null; + } else if (oldIdxMapValLen > 1 && newIdxMapValLen > 1) { + this._updateManyToMany && this._updateManyToMany(newIdxMapVal, oldIdxMapVal); + newDataIndexMap[oldKey] = null; + } else if (oldIdxMapValLen > 1) { + for (var i_1 = 0; i_1 < oldIdxMapValLen; i_1++) { + this._remove && this._remove(oldIdxMapVal[i_1]); + } + } else { + this._remove && this._remove(oldIdxMapVal); + } + } - if (cbModeMultiple) { - keyArr.push(key); - } - } else if (idxMapValLen === 1) { - map[key] = [idxMapVal, i]; - } else { - idxMapVal.push(i); - } - } - }; + this._performRestAdd(newDataKeyArr, newDataIndexMap); + }; - return DataDiffer; - }(); + DataDiffer.prototype._performRestAdd = function (newDataKeyArr, newDataIndexMap) { + for (var i = 0; i < newDataKeyArr.length; i++) { + var newKey = newDataKeyArr[i]; + var newIdxMapVal = newDataIndexMap[newKey]; + var idxMapValLen = dataIndexMapValueLength(newIdxMapVal); - var DimensionUserOuput = - /** @class */ - function () { - function DimensionUserOuput(encode, dimRequest) { - this._encode = encode; - this._schema = dimRequest; + if (idxMapValLen > 1) { + for (var j = 0; j < idxMapValLen; j++) { + this._add && this._add(newIdxMapVal[j]); } + } else if (idxMapValLen === 1) { + this._add && this._add(newIdxMapVal); + } // Support both `newDataKeyArr` are duplication removed or not removed. - DimensionUserOuput.prototype.get = function () { - return { - // Do not generate full dimension name until fist used. - fullDimensions: this._getFullDimensionNames(), - encode: this._encode - }; - }; - /** - * Get all data store dimension names. - * Theoretically a series data store is defined both by series and used dataset (if any). - * If some dimensions are omitted for performance reason in `this.dimensions`, - * the dimension name may not be auto-generated if user does not specify a dimension name. - * In this case, the dimension name is `null`/`undefined`. - */ - - - DimensionUserOuput.prototype._getFullDimensionNames = function () { - if (!this._cachedDimNames) { - this._cachedDimNames = this._schema ? this._schema.makeOutputDimensionNames() : []; - } - return this._cachedDimNames; - }; + newDataIndexMap[newKey] = null; + } + }; - return DimensionUserOuput; - }(); - function summarizeDimensions(data, schema) { - var summary = {}; - var encode = summary.encode = {}; - var notExtraCoordDimMap = createHashMap(); - var defaultedLabel = []; - var defaultedTooltip = []; - var userOutputEncode = {}; - each(data.dimensions, function (dimName) { - var dimItem = data.getDimensionInfo(dimName); - var coordDim = dimItem.coordDim; - - if (coordDim) { - if ("development" !== 'production') { - assert(VISUAL_DIMENSIONS.get(coordDim) == null); - } + DataDiffer.prototype._initIndexMap = function (arr, // Can be null. + map, // In 'byKey', the output `keyArr` is duplication removed. + // In 'byIndex', the output `keyArr` is not duplication removed and + // its indices are accurately corresponding to `arr`. + keyArr, keyGetterName) { + var cbModeMultiple = this._diffModeMultiple; - var coordDimIndex = dimItem.coordDimIndex; - getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName; + for (var i = 0; i < arr.length; i++) { + // Add prefix to avoid conflict with Object.prototype. + var key = '_ec_' + this[keyGetterName](arr[i], i); - if (!dimItem.isExtraCoord) { - notExtraCoordDimMap.set(coordDim, 1); // Use the last coord dim (and label friendly) as default label, - // because when dataset is used, it is hard to guess which dimension - // can be value dimension. If both show x, y on label is not look good, - // and conventionally y axis is focused more. + if (!cbModeMultiple) { + keyArr[i] = key; + } - if (mayLabelDimType(dimItem.type)) { - defaultedLabel[0] = dimName; - } // User output encode do not contain generated coords. - // And it only has index. User can use index to retrieve value from the raw item array. + if (!map) { + continue; + } + var idxMapVal = map[key]; + var idxMapValLen = dataIndexMapValueLength(idxMapVal); - getOrCreateEncodeArr(userOutputEncode, coordDim)[coordDimIndex] = data.getDimensionIndex(dimItem.name); - } + if (idxMapValLen === 0) { + // Simple optimize: in most cases, one index has one key, + // do not need array. + map[key] = i; - if (dimItem.defaultTooltip) { - defaultedTooltip.push(dimName); - } + if (cbModeMultiple) { + keyArr.push(key); } + } else if (idxMapValLen === 1) { + map[key] = [idxMapVal, i]; + } else { + idxMapVal.push(i); + } + } + }; + + return DataDiffer; + }(); - VISUAL_DIMENSIONS.each(function (v, otherDim) { - var encodeArr = getOrCreateEncodeArr(encode, otherDim); - var dimIndex = dimItem.otherDims[otherDim]; - - if (dimIndex != null && dimIndex !== false) { - encodeArr[dimIndex] = dimItem.name; - } - }); - }); - var dataDimsOnCoord = []; - var encodeFirstDimNotExtra = {}; - notExtraCoordDimMap.each(function (v, coordDim) { - var dimArr = encode[coordDim]; - encodeFirstDimNotExtra[coordDim] = dimArr[0]; // Not necessary to remove duplicate, because a data - // dim canot on more than one coordDim. + var DimensionUserOuput = + /** @class */ + function () { + function DimensionUserOuput(encode, dimRequest) { + this._encode = encode; + this._schema = dimRequest; + } + + DimensionUserOuput.prototype.get = function () { + return { + // Do not generate full dimension name until fist used. + fullDimensions: this._getFullDimensionNames(), + encode: this._encode + }; + }; + /** + * Get all data store dimension names. + * Theoretically a series data store is defined both by series and used dataset (if any). + * If some dimensions are omitted for performance reason in `this.dimensions`, + * the dimension name may not be auto-generated if user does not specify a dimension name. + * In this case, the dimension name is `null`/`undefined`. + */ - dataDimsOnCoord = dataDimsOnCoord.concat(dimArr); - }); - summary.dataDimsOnCoord = dataDimsOnCoord; - summary.dataDimIndicesOnCoord = map(dataDimsOnCoord, function (dimName) { - return data.getDimensionInfo(dimName).storeDimIndex; - }); - summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra; - var encodeLabel = encode.label; // FIXME `encode.label` is not recommanded, because formatter can not be set - // in this way. Use label.formatter instead. May be remove this approach someday. - if (encodeLabel && encodeLabel.length) { - defaultedLabel = encodeLabel.slice(); + DimensionUserOuput.prototype._getFullDimensionNames = function () { + if (!this._cachedDimNames) { + this._cachedDimNames = this._schema ? this._schema.makeOutputDimensionNames() : []; } - var encodeTooltip = encode.tooltip; - - if (encodeTooltip && encodeTooltip.length) { - defaultedTooltip = encodeTooltip.slice(); - } else if (!defaultedTooltip.length) { - defaultedTooltip = defaultedLabel.slice(); - } + return this._cachedDimNames; + }; - encode.defaultedLabel = defaultedLabel; - encode.defaultedTooltip = defaultedTooltip; - summary.userOutput = new DimensionUserOuput(userOutputEncode, schema); - return summary; + return DimensionUserOuput; + }(); + function summarizeDimensions(data, schema) { + var summary = {}; + var encode = summary.encode = {}; + var notExtraCoordDimMap = createHashMap(); + var defaultedLabel = []; + var defaultedTooltip = []; + var userOutputEncode = {}; + each(data.dimensions, function (dimName) { + var dimItem = data.getDimensionInfo(dimName); + var coordDim = dimItem.coordDim; + + if (coordDim) { + if ("development" !== 'production') { + assert(VISUAL_DIMENSIONS.get(coordDim) == null); + } + + var coordDimIndex = dimItem.coordDimIndex; + getOrCreateEncodeArr(encode, coordDim)[coordDimIndex] = dimName; + + if (!dimItem.isExtraCoord) { + notExtraCoordDimMap.set(coordDim, 1); // Use the last coord dim (and label friendly) as default label, + // because when dataset is used, it is hard to guess which dimension + // can be value dimension. If both show x, y on label is not look good, + // and conventionally y axis is focused more. + + if (mayLabelDimType(dimItem.type)) { + defaultedLabel[0] = dimName; + } // User output encode do not contain generated coords. + // And it only has index. User can use index to retrieve value from the raw item array. + + + getOrCreateEncodeArr(userOutputEncode, coordDim)[coordDimIndex] = data.getDimensionIndex(dimItem.name); + } + + if (dimItem.defaultTooltip) { + defaultedTooltip.push(dimName); + } + } + + VISUAL_DIMENSIONS.each(function (v, otherDim) { + var encodeArr = getOrCreateEncodeArr(encode, otherDim); + var dimIndex = dimItem.otherDims[otherDim]; + + if (dimIndex != null && dimIndex !== false) { + encodeArr[dimIndex] = dimItem.name; + } + }); + }); + var dataDimsOnCoord = []; + var encodeFirstDimNotExtra = {}; + notExtraCoordDimMap.each(function (v, coordDim) { + var dimArr = encode[coordDim]; + encodeFirstDimNotExtra[coordDim] = dimArr[0]; // Not necessary to remove duplicate, because a data + // dim canot on more than one coordDim. + + dataDimsOnCoord = dataDimsOnCoord.concat(dimArr); + }); + summary.dataDimsOnCoord = dataDimsOnCoord; + summary.dataDimIndicesOnCoord = map(dataDimsOnCoord, function (dimName) { + return data.getDimensionInfo(dimName).storeDimIndex; + }); + summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra; + var encodeLabel = encode.label; // FIXME `encode.label` is not recommanded, because formatter can not be set + // in this way. Use label.formatter instead. May be remove this approach someday. + + if (encodeLabel && encodeLabel.length) { + defaultedLabel = encodeLabel.slice(); + } + + var encodeTooltip = encode.tooltip; + + if (encodeTooltip && encodeTooltip.length) { + defaultedTooltip = encodeTooltip.slice(); + } else if (!defaultedTooltip.length) { + defaultedTooltip = defaultedLabel.slice(); + } + + encode.defaultedLabel = defaultedLabel; + encode.defaultedTooltip = defaultedTooltip; + summary.userOutput = new DimensionUserOuput(userOutputEncode, schema); + return summary; } function getOrCreateEncodeArr(encode, dim) { - if (!encode.hasOwnProperty(dim)) { - encode[dim] = []; - } + if (!encode.hasOwnProperty(dim)) { + encode[dim] = []; + } - return encode[dim]; + return encode[dim]; } // FIXME:TS should be type `AxisType` function getDimensionTypeByAxis(axisType) { - return axisType === 'category' ? 'ordinal' : axisType === 'time' ? 'time' : 'float'; + return axisType === 'category' ? 'ordinal' : axisType === 'time' ? 'time' : 'float'; } function mayLabelDimType(dimType) { - // In most cases, ordinal and time do not suitable for label. - // Ordinal info can be displayed on axis. Time is too long. - return !(dimType === 'ordinal' || dimType === 'time'); + // In most cases, ordinal and time do not suitable for label. + // Ordinal info can be displayed on axis. Time is too long. + return !(dimType === 'ordinal' || dimType === 'time'); } // function findTheLastDimMayLabel(data) { // // Get last value dim // let dimensions = data.dimensions.slice(); @@ -31016,62 +31016,62 @@ // } var SeriesDimensionDefine = - /** @class */ - function () { - /** - * @param opt All of the fields will be shallow copied. - */ - function SeriesDimensionDefine(opt) { - /** - * The format of `otherDims` is: - * ```js - * { - * tooltip?: number - * label?: number - * itemName?: number - * seriesName?: number - * } - * ``` - * - * A `series.encode` can specified these fields: - * ```js - * encode: { - * // "3, 1, 5" is the index of data dimension. - * tooltip: [3, 1, 5], - * label: [0, 3], - * ... - * } - * ``` - * `otherDims` is the parse result of the `series.encode` above, like: - * ```js - * // Suppose the index of this data dimension is `3`. - * this.otherDims = { - * // `3` is at the index `0` of the `encode.tooltip` - * tooltip: 0, - * // `3` is at the index `1` of the `encode.label` - * label: 1 - * }; - * ``` - * - * This prop should never be `null`/`undefined` after initialized. - */ - this.otherDims = {}; + /** @class */ + function () { + /** + * @param opt All of the fields will be shallow copied. + */ + function SeriesDimensionDefine(opt) { + /** + * The format of `otherDims` is: + * ```js + * { + * tooltip?: number + * label?: number + * itemName?: number + * seriesName?: number + * } + * ``` + * + * A `series.encode` can specified these fields: + * ```js + * encode: { + * // "3, 1, 5" is the index of data dimension. + * tooltip: [3, 1, 5], + * label: [0, 3], + * ... + * } + * ``` + * `otherDims` is the parse result of the `series.encode` above, like: + * ```js + * // Suppose the index of this data dimension is `3`. + * this.otherDims = { + * // `3` is at the index `0` of the `encode.tooltip` + * tooltip: 0, + * // `3` is at the index `1` of the `encode.label` + * label: 1 + * }; + * ``` + * + * This prop should never be `null`/`undefined` after initialized. + */ + this.otherDims = {}; - if (opt != null) { - extend(this, opt); - } - } + if (opt != null) { + extend(this, opt); + } + } - return SeriesDimensionDefine; - }(); + return SeriesDimensionDefine; + }(); var inner$4 = makeInner(); var dimTypeShort = { - float: 'f', - int: 'i', - ordinal: 'o', - number: 'n', - time: 't' + float: 'f', + int: 'i', + ordinal: 'o', + number: 'n', + time: 't' }; /** * Represents the dimension requirement of a series. @@ -31086,190 +31086,190 @@ */ var SeriesDataSchema = - /** @class */ - function () { - function SeriesDataSchema(opt) { - this.dimensions = opt.dimensions; - this._dimOmitted = opt.dimensionOmitted; - this.source = opt.source; - this._fullDimCount = opt.fullDimensionCount; - - this._updateDimOmitted(opt.dimensionOmitted); - } - - SeriesDataSchema.prototype.isDimensionOmitted = function () { - return this._dimOmitted; - }; - - SeriesDataSchema.prototype._updateDimOmitted = function (dimensionOmitted) { - this._dimOmitted = dimensionOmitted; - - if (!dimensionOmitted) { - return; - } - - if (!this._dimNameMap) { - this._dimNameMap = ensureSourceDimNameMap(this.source); - } - }; - /** - * @caution Can only be used when `dimensionOmitted: true`. - * - * Get index by user defined dimension name (i.e., not internal generate name). - * That is, get index from `dimensionsDefine`. - * If no `dimensionsDefine`, or no name get, return -1. - */ - - - SeriesDataSchema.prototype.getSourceDimensionIndex = function (dimName) { - return retrieve2(this._dimNameMap.get(dimName), -1); - }; - /** - * @caution Can only be used when `dimensionOmitted: true`. - * - * Notice: may return `null`/`undefined` if user not specify dimension names. - */ - - - SeriesDataSchema.prototype.getSourceDimension = function (dimIndex) { - var dimensionsDefine = this.source.dimensionsDefine; - - if (dimensionsDefine) { - return dimensionsDefine[dimIndex]; - } - }; - - SeriesDataSchema.prototype.makeStoreSchema = function () { - var dimCount = this._fullDimCount; - var willRetrieveDataByName = shouldRetrieveDataByName(this.source); - var makeHashStrict = !shouldOmitUnusedDimensions(dimCount); // If source don't have dimensions or series don't omit unsed dimensions. - // Generate from seriesDimList directly - - var dimHash = ''; - var dims = []; - - for (var fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < dimCount; fullDimIdx++) { - var property = void 0; - var type = void 0; - var ordinalMeta = void 0; - var seriesDimDef = this.dimensions[seriesDimIdx]; // The list has been sorted by `storeDimIndex` asc. - - if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) { - property = willRetrieveDataByName ? seriesDimDef.name : null; - type = seriesDimDef.type; - ordinalMeta = seriesDimDef.ordinalMeta; - seriesDimIdx++; - } else { - var sourceDimDef = this.getSourceDimension(fullDimIdx); - - if (sourceDimDef) { - property = willRetrieveDataByName ? sourceDimDef.name : null; - type = sourceDimDef.type; - } - } - - dims.push({ - property: property, - type: type, - ordinalMeta: ordinalMeta - }); // If retrieving data by index, - // use to determine whether data can be shared. - // (Becuase in this case there might be no dimension name defined in dataset, but indices always exists). - // (indices are always 0, 1, 2, ..., so we can ignore them to shorten the hash). - // Otherwise if retrieving data by property name (like `data: [{aa: 123, bb: 765}, ...]`), - // use in hash. - - if (willRetrieveDataByName && property != null // For data stack, we have make sure each series has its own dim on this store. - // So we do not add property to hash to make sure they can share this store. - && (!seriesDimDef || !seriesDimDef.isCalculationCoord)) { - dimHash += makeHashStrict // Use escape character '`' in case that property name contains '$'. - ? property.replace(/\`/g, '`1').replace(/\$/g, '`2') // For better performance, when there are large dimensions, tolerant this defects that hardly meet. - : property; - } + /** @class */ + function () { + function SeriesDataSchema(opt) { + this.dimensions = opt.dimensions; + this._dimOmitted = opt.dimensionOmitted; + this.source = opt.source; + this._fullDimCount = opt.fullDimensionCount; + + this._updateDimOmitted(opt.dimensionOmitted); + } + + SeriesDataSchema.prototype.isDimensionOmitted = function () { + return this._dimOmitted; + }; + + SeriesDataSchema.prototype._updateDimOmitted = function (dimensionOmitted) { + this._dimOmitted = dimensionOmitted; + + if (!dimensionOmitted) { + return; + } + + if (!this._dimNameMap) { + this._dimNameMap = ensureSourceDimNameMap(this.source); + } + }; + /** + * @caution Can only be used when `dimensionOmitted: true`. + * + * Get index by user defined dimension name (i.e., not internal generate name). + * That is, get index from `dimensionsDefine`. + * If no `dimensionsDefine`, or no name get, return -1. + */ - dimHash += '$'; - dimHash += dimTypeShort[type] || 'f'; - if (ordinalMeta) { - dimHash += ordinalMeta.uid; - } + SeriesDataSchema.prototype.getSourceDimensionIndex = function (dimName) { + return retrieve2(this._dimNameMap.get(dimName), -1); + }; + /** + * @caution Can only be used when `dimensionOmitted: true`. + * + * Notice: may return `null`/`undefined` if user not specify dimension names. + */ - dimHash += '$'; - } // Source from endpoint(usually series) will be read differently - // when seriesLayoutBy or startIndex(which is affected by sourceHeader) are different. - // So we use this three props as key. + SeriesDataSchema.prototype.getSourceDimension = function (dimIndex) { + var dimensionsDefine = this.source.dimensionsDefine; - var source = this.source; - var hash = [source.seriesLayoutBy, source.startIndex, dimHash].join('$$'); - return { - dimensions: dims, - hash: hash - }; - }; + if (dimensionsDefine) { + return dimensionsDefine[dimIndex]; + } + }; + + SeriesDataSchema.prototype.makeStoreSchema = function () { + var dimCount = this._fullDimCount; + var willRetrieveDataByName = shouldRetrieveDataByName(this.source); + var makeHashStrict = !shouldOmitUnusedDimensions(dimCount); // If source don't have dimensions or series don't omit unsed dimensions. + // Generate from seriesDimList directly + + var dimHash = ''; + var dims = []; + + for (var fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < dimCount; fullDimIdx++) { + var property = void 0; + var type = void 0; + var ordinalMeta = void 0; + var seriesDimDef = this.dimensions[seriesDimIdx]; // The list has been sorted by `storeDimIndex` asc. + + if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) { + property = willRetrieveDataByName ? seriesDimDef.name : null; + type = seriesDimDef.type; + ordinalMeta = seriesDimDef.ordinalMeta; + seriesDimIdx++; + } else { + var sourceDimDef = this.getSourceDimension(fullDimIdx); + + if (sourceDimDef) { + property = willRetrieveDataByName ? sourceDimDef.name : null; + type = sourceDimDef.type; + } + } + + dims.push({ + property: property, + type: type, + ordinalMeta: ordinalMeta + }); // If retrieving data by index, + // use to determine whether data can be shared. + // (Becuase in this case there might be no dimension name defined in dataset, but indices always exists). + // (indices are always 0, 1, 2, ..., so we can ignore them to shorten the hash). + // Otherwise if retrieving data by property name (like `data: [{aa: 123, bb: 765}, ...]`), + // use in hash. + + if (willRetrieveDataByName && property != null // For data stack, we have make sure each series has its own dim on this store. + // So we do not add property to hash to make sure they can share this store. + && (!seriesDimDef || !seriesDimDef.isCalculationCoord)) { + dimHash += makeHashStrict // Use escape character '`' in case that property name contains '$'. + ? property.replace(/\`/g, '`1').replace(/\$/g, '`2') // For better performance, when there are large dimensions, tolerant this defects that hardly meet. + : property; + } + + dimHash += '$'; + dimHash += dimTypeShort[type] || 'f'; + + if (ordinalMeta) { + dimHash += ordinalMeta.uid; + } + + dimHash += '$'; + } // Source from endpoint(usually series) will be read differently + // when seriesLayoutBy or startIndex(which is affected by sourceHeader) are different. + // So we use this three props as key. + + + var source = this.source; + var hash = [source.seriesLayoutBy, source.startIndex, dimHash].join('$$'); + return { + dimensions: dims, + hash: hash + }; + }; - SeriesDataSchema.prototype.makeOutputDimensionNames = function () { - var result = []; + SeriesDataSchema.prototype.makeOutputDimensionNames = function () { + var result = []; - for (var fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < this._fullDimCount; fullDimIdx++) { - var name_1 = void 0; - var seriesDimDef = this.dimensions[seriesDimIdx]; // The list has been sorted by `storeDimIndex` asc. + for (var fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < this._fullDimCount; fullDimIdx++) { + var name_1 = void 0; + var seriesDimDef = this.dimensions[seriesDimIdx]; // The list has been sorted by `storeDimIndex` asc. - if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) { - if (!seriesDimDef.isCalculationCoord) { - name_1 = seriesDimDef.name; - } + if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) { + if (!seriesDimDef.isCalculationCoord) { + name_1 = seriesDimDef.name; + } - seriesDimIdx++; - } else { - var sourceDimDef = this.getSourceDimension(fullDimIdx); + seriesDimIdx++; + } else { + var sourceDimDef = this.getSourceDimension(fullDimIdx); - if (sourceDimDef) { - name_1 = sourceDimDef.name; - } - } + if (sourceDimDef) { + name_1 = sourceDimDef.name; + } + } - result.push(name_1); - } + result.push(name_1); + } - return result; - }; + return result; + }; - SeriesDataSchema.prototype.appendCalculationDimension = function (dimDef) { - this.dimensions.push(dimDef); - dimDef.isCalculationCoord = true; - this._fullDimCount++; // If append dimension on a data store, consider the store - // might be shared by different series, series dimensions not - // really map to store dimensions. + SeriesDataSchema.prototype.appendCalculationDimension = function (dimDef) { + this.dimensions.push(dimDef); + dimDef.isCalculationCoord = true; + this._fullDimCount++; // If append dimension on a data store, consider the store + // might be shared by different series, series dimensions not + // really map to store dimensions. - this._updateDimOmitted(true); - }; + this._updateDimOmitted(true); + }; - return SeriesDataSchema; - }(); + return SeriesDataSchema; + }(); function isSeriesDataSchema(schema) { - return schema instanceof SeriesDataSchema; + return schema instanceof SeriesDataSchema; } function createDimNameMap(dimsDef) { - var dataDimNameMap = createHashMap(); + var dataDimNameMap = createHashMap(); - for (var i = 0; i < (dimsDef || []).length; i++) { - var dimDefItemRaw = dimsDef[i]; - var userDimName = isObject(dimDefItemRaw) ? dimDefItemRaw.name : dimDefItemRaw; + for (var i = 0; i < (dimsDef || []).length; i++) { + var dimDefItemRaw = dimsDef[i]; + var userDimName = isObject(dimDefItemRaw) ? dimDefItemRaw.name : dimDefItemRaw; - if (userDimName != null && dataDimNameMap.get(userDimName) == null) { - dataDimNameMap.set(userDimName, i); - } + if (userDimName != null && dataDimNameMap.get(userDimName) == null) { + dataDimNameMap.set(userDimName, i); } + } - return dataDimNameMap; + return dataDimNameMap; } function ensureSourceDimNameMap(source) { - var innerSource = inner$4(source); - return innerSource.dimNameMap || (innerSource.dimNameMap = createDimNameMap(source.dimensionsDefine)); + var innerSource = inner$4(source); + return innerSource.dimNameMap || (innerSource.dimNameMap = createDimNameMap(source.dimensionsDefine)); } function shouldOmitUnusedDimensions(dimCount) { - return dimCount > 30; + return dimCount > 30; } var isObject$2 = isObject; @@ -31294,1132 +31294,1132 @@ var makeIdFromName; var SeriesData = - /** @class */ - function () { - /** - * @param dimensionsInput.dimensions - * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...]. - * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius - */ - function SeriesData(dimensionsInput, hostModel) { - this.type = 'list'; - this._dimOmitted = false; - this._nameList = []; - this._idList = []; // Models of data option is stored sparse for optimizing memory cost - // Never used yet (not used yet). - // private _optionModels: Model[] = []; - // Global visual properties after visual coding + /** @class */ + function () { + /** + * @param dimensionsInput.dimensions + * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...]. + * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius + */ + function SeriesData(dimensionsInput, hostModel) { + this.type = 'list'; + this._dimOmitted = false; + this._nameList = []; + this._idList = []; // Models of data option is stored sparse for optimizing memory cost + // Never used yet (not used yet). + // private _optionModels: Model[] = []; + // Global visual properties after visual coding - this._visual = {}; // Globel layout properties. + this._visual = {}; // Globel layout properties. - this._layout = {}; // Item visual properties after visual coding + this._layout = {}; // Item visual properties after visual coding - this._itemVisuals = []; // Item layout properties after layout + this._itemVisuals = []; // Item layout properties after layout - this._itemLayouts = []; // Graphic elemnents + this._itemLayouts = []; // Graphic elemnents - this._graphicEls = []; // key: dim, value: extent + this._graphicEls = []; // key: dim, value: extent - this._approximateExtent = {}; - this._calculationInfo = {}; // Having detected that there is data item is non primitive type - // (in type `OptionDataItemObject`). - // Like `data: [ { value: xx, itemStyle: {...} }, ...]` - // At present it only happen in `SOURCE_FORMAT_ORIGINAL`. + this._approximateExtent = {}; + this._calculationInfo = {}; // Having detected that there is data item is non primitive type + // (in type `OptionDataItemObject`). + // Like `data: [ { value: xx, itemStyle: {...} }, ...]` + // At present it only happen in `SOURCE_FORMAT_ORIGINAL`. - this.hasItemOption = false; // Methods that create a new list based on this list should be listed here. - // Notice that those method should `RETURN` the new list. + this.hasItemOption = false; // Methods that create a new list based on this list should be listed here. + // Notice that those method should `RETURN` the new list. - this.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'lttbDownSample', 'map']; // Methods that change indices of this list should be listed here. + this.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'lttbDownSample', 'map']; // Methods that change indices of this list should be listed here. - this.CHANGABLE_METHODS = ['filterSelf', 'selectRange']; - this.DOWNSAMPLE_METHODS = ['downSample', 'lttbDownSample']; - var dimensions; - var assignStoreDimIdx = false; + this.CHANGABLE_METHODS = ['filterSelf', 'selectRange']; + this.DOWNSAMPLE_METHODS = ['downSample', 'lttbDownSample']; + var dimensions; + var assignStoreDimIdx = false; - if (isSeriesDataSchema(dimensionsInput)) { - dimensions = dimensionsInput.dimensions; - this._dimOmitted = dimensionsInput.isDimensionOmitted(); - this._schema = dimensionsInput; - } else { - assignStoreDimIdx = true; - dimensions = dimensionsInput; - } - - dimensions = dimensions || ['x', 'y']; - var dimensionInfos = {}; - var dimensionNames = []; - var invertedIndicesMap = {}; - var needsHasOwn = false; - var emptyObj = {}; - - for (var i = 0; i < dimensions.length; i++) { - // Use the original dimensions[i], where other flag props may exists. - var dimInfoInput = dimensions[i]; - var dimensionInfo = isString(dimInfoInput) ? new SeriesDimensionDefine({ - name: dimInfoInput - }) : !(dimInfoInput instanceof SeriesDimensionDefine) ? new SeriesDimensionDefine(dimInfoInput) : dimInfoInput; - var dimensionName = dimensionInfo.name; - dimensionInfo.type = dimensionInfo.type || 'float'; - - if (!dimensionInfo.coordDim) { - dimensionInfo.coordDim = dimensionName; - dimensionInfo.coordDimIndex = 0; - } + if (isSeriesDataSchema(dimensionsInput)) { + dimensions = dimensionsInput.dimensions; + this._dimOmitted = dimensionsInput.isDimensionOmitted(); + this._schema = dimensionsInput; + } else { + assignStoreDimIdx = true; + dimensions = dimensionsInput; + } - var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {}; - dimensionNames.push(dimensionName); - dimensionInfos[dimensionName] = dimensionInfo; + dimensions = dimensions || ['x', 'y']; + var dimensionInfos = {}; + var dimensionNames = []; + var invertedIndicesMap = {}; + var needsHasOwn = false; + var emptyObj = {}; - if (emptyObj[dimensionName] != null) { - needsHasOwn = true; - } + for (var i = 0; i < dimensions.length; i++) { + // Use the original dimensions[i], where other flag props may exists. + var dimInfoInput = dimensions[i]; + var dimensionInfo = isString(dimInfoInput) ? new SeriesDimensionDefine({ + name: dimInfoInput + }) : !(dimInfoInput instanceof SeriesDimensionDefine) ? new SeriesDimensionDefine(dimInfoInput) : dimInfoInput; + var dimensionName = dimensionInfo.name; + dimensionInfo.type = dimensionInfo.type || 'float'; + + if (!dimensionInfo.coordDim) { + dimensionInfo.coordDim = dimensionName; + dimensionInfo.coordDimIndex = 0; + } + + var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {}; + dimensionNames.push(dimensionName); + dimensionInfos[dimensionName] = dimensionInfo; + + if (emptyObj[dimensionName] != null) { + needsHasOwn = true; + } + + if (dimensionInfo.createInvertedIndices) { + invertedIndicesMap[dimensionName] = []; + } + + if (otherDims.itemName === 0) { + this._nameDimIdx = i; + } + + if (otherDims.itemId === 0) { + this._idDimIdx = i; + } + + if ("development" !== 'production') { + assert(assignStoreDimIdx || dimensionInfo.storeDimIndex >= 0); + } + + if (assignStoreDimIdx) { + dimensionInfo.storeDimIndex = i; + } + } + + this.dimensions = dimensionNames; + this._dimInfos = dimensionInfos; + + this._initGetDimensionInfo(needsHasOwn); + + this.hostModel = hostModel; + this._invertedIndicesMap = invertedIndicesMap; + + if (this._dimOmitted) { + var dimIdxToName_1 = this._dimIdxToName = createHashMap(); + each(dimensionNames, function (dimName) { + dimIdxToName_1.set(dimensionInfos[dimName].storeDimIndex, dimName); + }); + } + } + /** + * + * Get concrete dimension name by dimension name or dimension index. + * If input a dimension name, do not validate whether the dimension name exits. + * + * @caution + * @param dim Must make sure the dimension is `SeriesDimensionLoose`. + * Because only those dimensions will have auto-generated dimension names if not + * have a user-specified name, and other dimensions will get a return of null/undefined. + * + * @notice Becuause of this reason, should better use `getDimensionIndex` instead, for examples: + * ```js + * const val = data.getStore().get(data.getDimensionIndex(dim), dataIdx); + * ``` + * + * @return Concrete dim name. + */ - if (dimensionInfo.createInvertedIndices) { - invertedIndicesMap[dimensionName] = []; - } - if (otherDims.itemName === 0) { - this._nameDimIdx = i; - } + SeriesData.prototype.getDimension = function (dim) { + var dimIdx = this._recognizeDimIndex(dim); - if (otherDims.itemId === 0) { - this._idDimIdx = i; - } + if (dimIdx == null) { + return dim; + } - if ("development" !== 'production') { - assert(assignStoreDimIdx || dimensionInfo.storeDimIndex >= 0); - } + dimIdx = dim; - if (assignStoreDimIdx) { - dimensionInfo.storeDimIndex = i; - } - } + if (!this._dimOmitted) { + return this.dimensions[dimIdx]; + } // Retrieve from series dimension definition becuase it probably contains + // generated dimension name (like 'x', 'y'). - this.dimensions = dimensionNames; - this._dimInfos = dimensionInfos; - this._initGetDimensionInfo(needsHasOwn); + var dimName = this._dimIdxToName.get(dimIdx); - this.hostModel = hostModel; - this._invertedIndicesMap = invertedIndicesMap; + if (dimName != null) { + return dimName; + } - if (this._dimOmitted) { - var dimIdxToName_1 = this._dimIdxToName = createHashMap(); - each(dimensionNames, function (dimName) { - dimIdxToName_1.set(dimensionInfos[dimName].storeDimIndex, dimName); - }); - } - } - /** - * - * Get concrete dimension name by dimension name or dimension index. - * If input a dimension name, do not validate whether the dimension name exits. - * - * @caution - * @param dim Must make sure the dimension is `SeriesDimensionLoose`. - * Because only those dimensions will have auto-generated dimension names if not - * have a user-specified name, and other dimensions will get a return of null/undefined. - * - * @notice Becuause of this reason, should better use `getDimensionIndex` instead, for examples: - * ```js - * const val = data.getStore().get(data.getDimensionIndex(dim), dataIdx); - * ``` - * - * @return Concrete dim name. - */ + var sourceDimDef = this._schema.getSourceDimension(dimIdx); + if (sourceDimDef) { + return sourceDimDef.name; + } + }; + /** + * Get dimension index in data store. Return -1 if not found. + * Can be used to index value from getRawValue. + */ - SeriesData.prototype.getDimension = function (dim) { - var dimIdx = this._recognizeDimIndex(dim); - if (dimIdx == null) { - return dim; - } + SeriesData.prototype.getDimensionIndex = function (dim) { + var dimIdx = this._recognizeDimIndex(dim); - dimIdx = dim; + if (dimIdx != null) { + return dimIdx; + } - if (!this._dimOmitted) { - return this.dimensions[dimIdx]; - } // Retrieve from series dimension definition becuase it probably contains - // generated dimension name (like 'x', 'y'). + if (dim == null) { + return -1; + } + + var dimInfo = this._getDimInfo(dim); + + return dimInfo ? dimInfo.storeDimIndex : this._dimOmitted ? this._schema.getSourceDimensionIndex(dim) : -1; + }; + /** + * The meanings of the input parameter `dim`: + * + * + If dim is a number (e.g., `1`), it means the index of the dimension. + * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'. + * + If dim is a number-like string (e.g., `"1"`): + * + If there is the same concrete dim name defined in `series.dimensions` or `dataset.dimensions`, + * it means that concrete name. + * + If not, it will be converted to a number, which means the index of the dimension. + * (why? because of the backward compatbility. We have been tolerating number-like string in + * dimension setting, although now it seems that it is not a good idea.) + * For example, `visualMap[i].dimension: "1"` is the same meaning as `visualMap[i].dimension: 1`, + * if no dimension name is defined as `"1"`. + * + If dim is a not-number-like string, it means the concrete dim name. + * For example, it can be be default name `"x"`, `"y"`, `"z"`, `"lng"`, `"lat"`, `"angle"`, `"radius"`, + * or customized in `dimensions` property of option like `"age"`. + * + * @return recogonized `DimensionIndex`. Otherwise return null/undefined (means that dim is `DimensionName`). + */ - var dimName = this._dimIdxToName.get(dimIdx); + SeriesData.prototype._recognizeDimIndex = function (dim) { + if (isNumber(dim) // If being a number-like string but not being defined as a dimension name. + || dim != null && !isNaN(dim) && !this._getDimInfo(dim) && (!this._dimOmitted || this._schema.getSourceDimensionIndex(dim) < 0)) { + return +dim; + } + }; - if (dimName != null) { - return dimName; - } + SeriesData.prototype._getStoreDimIndex = function (dim) { + var dimIdx = this.getDimensionIndex(dim); - var sourceDimDef = this._schema.getSourceDimension(dimIdx); + if ("development" !== 'production') { + if (dimIdx == null) { + throw new Error('Unkown dimension ' + dim); + } + } + + return dimIdx; + }; + /** + * Get type and calculation info of particular dimension + * @param dim + * Dimension can be concrete names like x, y, z, lng, lat, angle, radius + * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius' + */ - if (sourceDimDef) { - return sourceDimDef.name; - } - }; - /** - * Get dimension index in data store. Return -1 if not found. - * Can be used to index value from getRawValue. - */ + SeriesData.prototype.getDimensionInfo = function (dim) { + // Do not clone, because there may be categories in dimInfo. + return this._getDimInfo(this.getDimension(dim)); + }; - SeriesData.prototype.getDimensionIndex = function (dim) { - var dimIdx = this._recognizeDimIndex(dim); + SeriesData.prototype._initGetDimensionInfo = function (needsHasOwn) { + var dimensionInfos = this._dimInfos; + this._getDimInfo = needsHasOwn ? function (dimName) { + return dimensionInfos.hasOwnProperty(dimName) ? dimensionInfos[dimName] : undefined; + } : function (dimName) { + return dimensionInfos[dimName]; + }; + }; + /** + * concrete dimension name list on coord. + */ - if (dimIdx != null) { - return dimIdx; - } - if (dim == null) { - return -1; - } + SeriesData.prototype.getDimensionsOnCoord = function () { + return this._dimSummary.dataDimsOnCoord.slice(); + }; - var dimInfo = this._getDimInfo(dim); + SeriesData.prototype.mapDimension = function (coordDim, idx) { + var dimensionsSummary = this._dimSummary; - return dimInfo ? dimInfo.storeDimIndex : this._dimOmitted ? this._schema.getSourceDimensionIndex(dim) : -1; - }; - /** - * The meanings of the input parameter `dim`: - * - * + If dim is a number (e.g., `1`), it means the index of the dimension. - * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'. - * + If dim is a number-like string (e.g., `"1"`): - * + If there is the same concrete dim name defined in `series.dimensions` or `dataset.dimensions`, - * it means that concrete name. - * + If not, it will be converted to a number, which means the index of the dimension. - * (why? because of the backward compatbility. We have been tolerating number-like string in - * dimension setting, although now it seems that it is not a good idea.) - * For example, `visualMap[i].dimension: "1"` is the same meaning as `visualMap[i].dimension: 1`, - * if no dimension name is defined as `"1"`. - * + If dim is a not-number-like string, it means the concrete dim name. - * For example, it can be be default name `"x"`, `"y"`, `"z"`, `"lng"`, `"lat"`, `"angle"`, `"radius"`, - * or customized in `dimensions` property of option like `"age"`. - * - * @return recogonized `DimensionIndex`. Otherwise return null/undefined (means that dim is `DimensionName`). - */ + if (idx == null) { + return dimensionsSummary.encodeFirstDimNotExtra[coordDim]; + } + var dims = dimensionsSummary.encode[coordDim]; + return dims ? dims[idx] : null; + }; - SeriesData.prototype._recognizeDimIndex = function (dim) { - if (isNumber(dim) // If being a number-like string but not being defined as a dimension name. - || dim != null && !isNaN(dim) && !this._getDimInfo(dim) && (!this._dimOmitted || this._schema.getSourceDimensionIndex(dim) < 0)) { - return +dim; - } - }; + SeriesData.prototype.mapDimensionsAll = function (coordDim) { + var dimensionsSummary = this._dimSummary; + var dims = dimensionsSummary.encode[coordDim]; + return (dims || []).slice(); + }; - SeriesData.prototype._getStoreDimIndex = function (dim) { - var dimIdx = this.getDimensionIndex(dim); - - if ("development" !== 'production') { - if (dimIdx == null) { - throw new Error('Unkown dimension ' + dim); - } - } - - return dimIdx; - }; - /** - * Get type and calculation info of particular dimension - * @param dim - * Dimension can be concrete names like x, y, z, lng, lat, angle, radius - * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius' - */ - - - SeriesData.prototype.getDimensionInfo = function (dim) { - // Do not clone, because there may be categories in dimInfo. - return this._getDimInfo(this.getDimension(dim)); - }; - - SeriesData.prototype._initGetDimensionInfo = function (needsHasOwn) { - var dimensionInfos = this._dimInfos; - this._getDimInfo = needsHasOwn ? function (dimName) { - return dimensionInfos.hasOwnProperty(dimName) ? dimensionInfos[dimName] : undefined; - } : function (dimName) { - return dimensionInfos[dimName]; - }; - }; - /** - * concrete dimension name list on coord. - */ - - - SeriesData.prototype.getDimensionsOnCoord = function () { - return this._dimSummary.dataDimsOnCoord.slice(); - }; + SeriesData.prototype.getStore = function () { + return this._store; + }; + /** + * Initialize from data + * @param data source or data or data store. + * @param nameList The name of a datum is used on data diff and + * default label/tooltip. + * A name can be specified in encode.itemName, + * or dataItem.name (only for series option data), + * or provided in nameList from outside. + */ - SeriesData.prototype.mapDimension = function (coordDim, idx) { - var dimensionsSummary = this._dimSummary; - if (idx == null) { - return dimensionsSummary.encodeFirstDimNotExtra[coordDim]; - } + SeriesData.prototype.initData = function (data, nameList, dimValueGetter) { + var _this = this; - var dims = dimensionsSummary.encode[coordDim]; - return dims ? dims[idx] : null; - }; + var store; - SeriesData.prototype.mapDimensionsAll = function (coordDim) { - var dimensionsSummary = this._dimSummary; - var dims = dimensionsSummary.encode[coordDim]; - return (dims || []).slice(); - }; + if (data instanceof DataStore) { + store = data; + } - SeriesData.prototype.getStore = function () { - return this._store; + if (!store) { + var dimensions = this.dimensions; + var provider = isSourceInstance(data) || isArrayLike(data) ? new DefaultDataProvider(data, dimensions.length) : data; + store = new DataStore(); + var dimensionInfos = map$1(dimensions, function (dimName) { + return { + type: _this._dimInfos[dimName].type, + property: dimName }; - /** - * Initialize from data - * @param data source or data or data store. - * @param nameList The name of a datum is used on data diff and - * default label/tooltip. - * A name can be specified in encode.itemName, - * or dataItem.name (only for series option data), - * or provided in nameList from outside. - */ - - - SeriesData.prototype.initData = function (data, nameList, dimValueGetter) { - var _this = this; - - var store; - - if (data instanceof DataStore) { - store = data; - } - - if (!store) { - var dimensions = this.dimensions; - var provider = isSourceInstance(data) || isArrayLike(data) ? new DefaultDataProvider(data, dimensions.length) : data; - store = new DataStore(); - var dimensionInfos = map$1(dimensions, function (dimName) { - return { - type: _this._dimInfos[dimName].type, - property: dimName - }; - }); - store.initData(provider, dimensionInfos, dimValueGetter); - } - - this._store = store; // Reset - - this._nameList = (nameList || []).slice(); - this._idList = []; - this._nameRepeatCount = {}; - - this._doInit(0, store.count()); // Cache summary info for fast visit. See "dimensionHelper". - // Needs to be initialized after store is prepared. + }); + store.initData(provider, dimensionInfos, dimValueGetter); + } + this._store = store; // Reset - this._dimSummary = summarizeDimensions(this, this._schema); - this.userOutput = this._dimSummary.userOutput; - }; - /** - * Caution: Can be only called on raw data (before `this._indices` created). - */ + this._nameList = (nameList || []).slice(); + this._idList = []; + this._nameRepeatCount = {}; + this._doInit(0, store.count()); // Cache summary info for fast visit. See "dimensionHelper". + // Needs to be initialized after store is prepared. - SeriesData.prototype.appendData = function (data) { - var range = this._store.appendData(data); - this._doInit(range[0], range[1]); - }; - /** - * Caution: Can be only called on raw data (before `this._indices` created). - * This method does not modify `rawData` (`dataProvider`), but only - * add values to store. - * - * The final count will be increased by `Math.max(values.length, names.length)`. - * - * @param values That is the SourceType: 'arrayRows', like - * [ - * [12, 33, 44], - * [NaN, 43, 1], - * ['-', 'asdf', 0] - * ] - * Each item is exaclty cooresponding to a dimension. - */ + this._dimSummary = summarizeDimensions(this, this._schema); + this.userOutput = this._dimSummary.userOutput; + }; + /** + * Caution: Can be only called on raw data (before `this._indices` created). + */ - SeriesData.prototype.appendValues = function (values, names) { - var _a = this._store.appendValues(values, names.length), - start = _a.start, - end = _a.end; + SeriesData.prototype.appendData = function (data) { + var range = this._store.appendData(data); + + this._doInit(range[0], range[1]); + }; + /** + * Caution: Can be only called on raw data (before `this._indices` created). + * This method does not modify `rawData` (`dataProvider`), but only + * add values to store. + * + * The final count will be increased by `Math.max(values.length, names.length)`. + * + * @param values That is the SourceType: 'arrayRows', like + * [ + * [12, 33, 44], + * [NaN, 43, 1], + * ['-', 'asdf', 0] + * ] + * Each item is exaclty cooresponding to a dimension. + */ - var shouldMakeIdFromName = this._shouldMakeIdFromName(); - this._updateOrdinalMeta(); + SeriesData.prototype.appendValues = function (values, names) { + var _a = this._store.appendValues(values, names.length), + start = _a.start, + end = _a.end; - if (names) { - for (var idx = start; idx < end; idx++) { - var sourceIdx = idx - start; - this._nameList[idx] = names[sourceIdx]; + var shouldMakeIdFromName = this._shouldMakeIdFromName(); - if (shouldMakeIdFromName) { - makeIdFromName(this, idx); - } - } - } - }; + this._updateOrdinalMeta(); - SeriesData.prototype._updateOrdinalMeta = function () { - var store = this._store; - var dimensions = this.dimensions; + if (names) { + for (var idx = start; idx < end; idx++) { + var sourceIdx = idx - start; + this._nameList[idx] = names[sourceIdx]; - for (var i = 0; i < dimensions.length; i++) { - var dimInfo = this._dimInfos[dimensions[i]]; + if (shouldMakeIdFromName) { + makeIdFromName(this, idx); + } + } + } + }; - if (dimInfo.ordinalMeta) { - store.collectOrdinalMeta(dimInfo.storeDimIndex, dimInfo.ordinalMeta); - } - } - }; + SeriesData.prototype._updateOrdinalMeta = function () { + var store = this._store; + var dimensions = this.dimensions; - SeriesData.prototype._shouldMakeIdFromName = function () { - var provider = this._store.getProvider(); + for (var i = 0; i < dimensions.length; i++) { + var dimInfo = this._dimInfos[dimensions[i]]; - return this._idDimIdx == null && provider.getSource().sourceFormat !== SOURCE_FORMAT_TYPED_ARRAY && !provider.fillStorage; - }; + if (dimInfo.ordinalMeta) { + store.collectOrdinalMeta(dimInfo.storeDimIndex, dimInfo.ordinalMeta); + } + } + }; - SeriesData.prototype._doInit = function (start, end) { - if (start >= end) { - return; - } + SeriesData.prototype._shouldMakeIdFromName = function () { + var provider = this._store.getProvider(); - var store = this._store; - var provider = store.getProvider(); + return this._idDimIdx == null && provider.getSource().sourceFormat !== SOURCE_FORMAT_TYPED_ARRAY && !provider.fillStorage; + }; - this._updateOrdinalMeta(); + SeriesData.prototype._doInit = function (start, end) { + if (start >= end) { + return; + } - var nameList = this._nameList; - var idList = this._idList; - var sourceFormat = provider.getSource().sourceFormat; - var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL; // Each data item is value - // [1, 2] - // 2 - // Bar chart, line chart which uses category axis - // only gives the 'y' value. 'x' value is the indices of category - // Use a tempValue to normalize the value to be a (x, y) value - // If dataItem is {name: ...} or {id: ...}, it has highest priority. - // This kind of ids and names are always stored `_nameList` and `_idList`. + var store = this._store; + var provider = store.getProvider(); - if (isFormatOriginal && !provider.pure) { - var sharedDataItem = []; + this._updateOrdinalMeta(); - for (var idx = start; idx < end; idx++) { - // NOTICE: Try not to write things into dataItem - var dataItem = provider.getItem(idx, sharedDataItem); + var nameList = this._nameList; + var idList = this._idList; + var sourceFormat = provider.getSource().sourceFormat; + var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL; // Each data item is value + // [1, 2] + // 2 + // Bar chart, line chart which uses category axis + // only gives the 'y' value. 'x' value is the indices of category + // Use a tempValue to normalize the value to be a (x, y) value + // If dataItem is {name: ...} or {id: ...}, it has highest priority. + // This kind of ids and names are always stored `_nameList` and `_idList`. - if (!this.hasItemOption && isDataItemOption(dataItem)) { - this.hasItemOption = true; - } + if (isFormatOriginal && !provider.pure) { + var sharedDataItem = []; - if (dataItem) { - var itemName = dataItem.name; + for (var idx = start; idx < end; idx++) { + // NOTICE: Try not to write things into dataItem + var dataItem = provider.getItem(idx, sharedDataItem); - if (nameList[idx] == null && itemName != null) { - nameList[idx] = convertOptionIdName(itemName, null); - } + if (!this.hasItemOption && isDataItemOption(dataItem)) { + this.hasItemOption = true; + } - var itemId = dataItem.id; + if (dataItem) { + var itemName = dataItem.name; - if (idList[idx] == null && itemId != null) { - idList[idx] = convertOptionIdName(itemId, null); - } - } - } - } + if (nameList[idx] == null && itemName != null) { + nameList[idx] = convertOptionIdName(itemName, null); + } - if (this._shouldMakeIdFromName()) { - for (var idx = start; idx < end; idx++) { - makeIdFromName(this, idx); - } - } + var itemId = dataItem.id; - prepareInvertedIndex(this); - }; - /** - * PENDING: In fact currently this function is only used to short-circuit - * the calling of `scale.unionExtentFromData` when data have been filtered by modules - * like "dataZoom". `scale.unionExtentFromData` is used to calculate data extent for series on - * an axis, but if a "axis related data filter module" is used, the extent of the axis have - * been fixed and no need to calling `scale.unionExtentFromData` actually. - * But if we add "custom data filter" in future, which is not "axis related", this method may - * be still needed. - * - * Optimize for the scenario that data is filtered by a given extent. - * Consider that if data amount is more than hundreds of thousand, - * extent calculation will cost more than 10ms and the cache will - * be erased because of the filtering. - */ + if (idList[idx] == null && itemId != null) { + idList[idx] = convertOptionIdName(itemId, null); + } + } + } + } + if (this._shouldMakeIdFromName()) { + for (var idx = start; idx < end; idx++) { + makeIdFromName(this, idx); + } + } - SeriesData.prototype.getApproximateExtent = function (dim) { - return this._approximateExtent[dim] || this._store.getDataExtent(this._getStoreDimIndex(dim)); - }; - /** - * Calculate extent on a filtered data might be time consuming. - * Approximate extent is only used for: calculte extent of filtered data outside. - */ + prepareInvertedIndex(this); + }; + /** + * PENDING: In fact currently this function is only used to short-circuit + * the calling of `scale.unionExtentFromData` when data have been filtered by modules + * like "dataZoom". `scale.unionExtentFromData` is used to calculate data extent for series on + * an axis, but if a "axis related data filter module" is used, the extent of the axis have + * been fixed and no need to calling `scale.unionExtentFromData` actually. + * But if we add "custom data filter" in future, which is not "axis related", this method may + * be still needed. + * + * Optimize for the scenario that data is filtered by a given extent. + * Consider that if data amount is more than hundreds of thousand, + * extent calculation will cost more than 10ms and the cache will + * be erased because of the filtering. + */ - SeriesData.prototype.setApproximateExtent = function (extent, dim) { - dim = this.getDimension(dim); - this._approximateExtent[dim] = extent.slice(); - }; + SeriesData.prototype.getApproximateExtent = function (dim) { + return this._approximateExtent[dim] || this._store.getDataExtent(this._getStoreDimIndex(dim)); + }; + /** + * Calculate extent on a filtered data might be time consuming. + * Approximate extent is only used for: calculte extent of filtered data outside. + */ - SeriesData.prototype.getCalculationInfo = function (key) { - return this._calculationInfo[key]; - }; - SeriesData.prototype.setCalculationInfo = function (key, value) { - isObject$2(key) ? extend(this._calculationInfo, key) : this._calculationInfo[key] = value; - }; - /** - * @return Never be null/undefined. `number` will be converted to string. Becuase: - * In most cases, name is used in display, where returning a string is more convenient. - * In other cases, name is used in query (see `indexOfName`), where we can keep the - * rule that name `2` equals to name `'2'`. - */ + SeriesData.prototype.setApproximateExtent = function (extent, dim) { + dim = this.getDimension(dim); + this._approximateExtent[dim] = extent.slice(); + }; + SeriesData.prototype.getCalculationInfo = function (key) { + return this._calculationInfo[key]; + }; - SeriesData.prototype.getName = function (idx) { - var rawIndex = this.getRawIndex(idx); - var name = this._nameList[rawIndex]; + SeriesData.prototype.setCalculationInfo = function (key, value) { + isObject$2(key) ? extend(this._calculationInfo, key) : this._calculationInfo[key] = value; + }; + /** + * @return Never be null/undefined. `number` will be converted to string. Becuase: + * In most cases, name is used in display, where returning a string is more convenient. + * In other cases, name is used in query (see `indexOfName`), where we can keep the + * rule that name `2` equals to name `'2'`. + */ - if (name == null && this._nameDimIdx != null) { - name = getIdNameFromStore(this, this._nameDimIdx, rawIndex); - } - if (name == null) { - name = ''; - } + SeriesData.prototype.getName = function (idx) { + var rawIndex = this.getRawIndex(idx); + var name = this._nameList[rawIndex]; - return name; - }; + if (name == null && this._nameDimIdx != null) { + name = getIdNameFromStore(this, this._nameDimIdx, rawIndex); + } - SeriesData.prototype._getCategory = function (dimIdx, idx) { - var ordinal = this._store.get(dimIdx, idx); + if (name == null) { + name = ''; + } - var ordinalMeta = this._store.getOrdinalMeta(dimIdx); + return name; + }; - if (ordinalMeta) { - return ordinalMeta.categories[ordinal]; - } + SeriesData.prototype._getCategory = function (dimIdx, idx) { + var ordinal = this._store.get(dimIdx, idx); - return ordinal; - }; - /** - * @return Never null/undefined. `number` will be converted to string. Becuase: - * In all cases having encountered at present, id is used in making diff comparison, which - * are usually based on hash map. We can keep the rule that the internal id are always string - * (treat `2` is the same as `'2'`) to make the related logic simple. - */ + var ordinalMeta = this._store.getOrdinalMeta(dimIdx); + if (ordinalMeta) { + return ordinalMeta.categories[ordinal]; + } - SeriesData.prototype.getId = function (idx) { - return getId(this, this.getRawIndex(idx)); - }; + return ordinal; + }; + /** + * @return Never null/undefined. `number` will be converted to string. Becuase: + * In all cases having encountered at present, id is used in making diff comparison, which + * are usually based on hash map. We can keep the rule that the internal id are always string + * (treat `2` is the same as `'2'`) to make the related logic simple. + */ - SeriesData.prototype.count = function () { - return this._store.count(); - }; - /** - * Get value. Return NaN if idx is out of range. - * - * @notice Should better to use `data.getStore().get(dimIndex, dataIdx)` instead. - */ + SeriesData.prototype.getId = function (idx) { + return getId(this, this.getRawIndex(idx)); + }; - SeriesData.prototype.get = function (dim, idx) { - var store = this._store; - var dimInfo = this._dimInfos[dim]; + SeriesData.prototype.count = function () { + return this._store.count(); + }; + /** + * Get value. Return NaN if idx is out of range. + * + * @notice Should better to use `data.getStore().get(dimIndex, dataIdx)` instead. + */ - if (dimInfo) { - return store.get(dimInfo.storeDimIndex, idx); - } - }; - /** - * @notice Should better to use `data.getStore().getByRawIndex(dimIndex, dataIdx)` instead. - */ + SeriesData.prototype.get = function (dim, idx) { + var store = this._store; + var dimInfo = this._dimInfos[dim]; - SeriesData.prototype.getByRawIndex = function (dim, rawIdx) { - var store = this._store; - var dimInfo = this._dimInfos[dim]; + if (dimInfo) { + return store.get(dimInfo.storeDimIndex, idx); + } + }; + /** + * @notice Should better to use `data.getStore().getByRawIndex(dimIndex, dataIdx)` instead. + */ - if (dimInfo) { - return store.getByRawIndex(dimInfo.storeDimIndex, rawIdx); - } - }; - SeriesData.prototype.getIndices = function () { - return this._store.getIndices(); - }; + SeriesData.prototype.getByRawIndex = function (dim, rawIdx) { + var store = this._store; + var dimInfo = this._dimInfos[dim]; - SeriesData.prototype.getDataExtent = function (dim) { - return this._store.getDataExtent(this._getStoreDimIndex(dim)); - }; + if (dimInfo) { + return store.getByRawIndex(dimInfo.storeDimIndex, rawIdx); + } + }; - SeriesData.prototype.getSum = function (dim) { - return this._store.getSum(this._getStoreDimIndex(dim)); - }; + SeriesData.prototype.getIndices = function () { + return this._store.getIndices(); + }; - SeriesData.prototype.getMedian = function (dim) { - return this._store.getMedian(this._getStoreDimIndex(dim)); - }; + SeriesData.prototype.getDataExtent = function (dim) { + return this._store.getDataExtent(this._getStoreDimIndex(dim)); + }; - SeriesData.prototype.getValues = function (dimensions, idx) { - var _this = this; + SeriesData.prototype.getSum = function (dim) { + return this._store.getSum(this._getStoreDimIndex(dim)); + }; - var store = this._store; - return isArray(dimensions) ? store.getValues(map$1(dimensions, function (dim) { - return _this._getStoreDimIndex(dim); - }), idx) : store.getValues(dimensions); - }; - /** - * If value is NaN. Inlcuding '-' - * Only check the coord dimensions. - */ + SeriesData.prototype.getMedian = function (dim) { + return this._store.getMedian(this._getStoreDimIndex(dim)); + }; + SeriesData.prototype.getValues = function (dimensions, idx) { + var _this = this; - SeriesData.prototype.hasValue = function (idx) { - var dataDimIndicesOnCoord = this._dimSummary.dataDimIndicesOnCoord; + var store = this._store; + return isArray(dimensions) ? store.getValues(map$1(dimensions, function (dim) { + return _this._getStoreDimIndex(dim); + }), idx) : store.getValues(dimensions); + }; + /** + * If value is NaN. Inlcuding '-' + * Only check the coord dimensions. + */ - for (var i = 0, len = dataDimIndicesOnCoord.length; i < len; i++) { - // Ordinal type originally can be string or number. - // But when an ordinal type is used on coord, it can - // not be string but only number. So we can also use isNaN. - if (isNaN(this._store.get(dataDimIndicesOnCoord[i], idx))) { - return false; - } - } - return true; - }; - /** - * Retreive the index with given name - */ + SeriesData.prototype.hasValue = function (idx) { + var dataDimIndicesOnCoord = this._dimSummary.dataDimIndicesOnCoord; + for (var i = 0, len = dataDimIndicesOnCoord.length; i < len; i++) { + // Ordinal type originally can be string or number. + // But when an ordinal type is used on coord, it can + // not be string but only number. So we can also use isNaN. + if (isNaN(this._store.get(dataDimIndicesOnCoord[i], idx))) { + return false; + } + } - SeriesData.prototype.indexOfName = function (name) { - for (var i = 0, len = this._store.count(); i < len; i++) { - if (this.getName(i) === name) { - return i; - } - } + return true; + }; + /** + * Retreive the index with given name + */ - return -1; - }; - SeriesData.prototype.getRawIndex = function (idx) { - return this._store.getRawIndex(idx); - }; + SeriesData.prototype.indexOfName = function (name) { + for (var i = 0, len = this._store.count(); i < len; i++) { + if (this.getName(i) === name) { + return i; + } + } - SeriesData.prototype.indexOfRawIndex = function (rawIndex) { - return this._store.indexOfRawIndex(rawIndex); - }; - /** - * Only support the dimension which inverted index created. - * Do not support other cases until required. - * @param dim concrete dim - * @param value ordinal index - * @return rawIndex - */ + return -1; + }; + + SeriesData.prototype.getRawIndex = function (idx) { + return this._store.getRawIndex(idx); + }; + + SeriesData.prototype.indexOfRawIndex = function (rawIndex) { + return this._store.indexOfRawIndex(rawIndex); + }; + /** + * Only support the dimension which inverted index created. + * Do not support other cases until required. + * @param dim concrete dim + * @param value ordinal index + * @return rawIndex + */ - SeriesData.prototype.rawIndexOf = function (dim, value) { - var invertedIndices = dim && this._invertedIndicesMap[dim]; + SeriesData.prototype.rawIndexOf = function (dim, value) { + var invertedIndices = dim && this._invertedIndicesMap[dim]; - if ("development" !== 'production') { - if (!invertedIndices) { - throw new Error('Do not supported yet'); - } - } + if ("development" !== 'production') { + if (!invertedIndices) { + throw new Error('Do not supported yet'); + } + } - var rawIndex = invertedIndices[value]; + var rawIndex = invertedIndices[value]; - if (rawIndex == null || isNaN(rawIndex)) { - return INDEX_NOT_FOUND; - } + if (rawIndex == null || isNaN(rawIndex)) { + return INDEX_NOT_FOUND; + } - return rawIndex; - }; - /** - * Retreive the index of nearest value - * @param dim - * @param value - * @param [maxDistance=Infinity] - * @return If and only if multiple indices has - * the same value, they are put to the result. - */ + return rawIndex; + }; + /** + * Retreive the index of nearest value + * @param dim + * @param value + * @param [maxDistance=Infinity] + * @return If and only if multiple indices has + * the same value, they are put to the result. + */ - SeriesData.prototype.indicesOfNearest = function (dim, value, maxDistance) { - return this._store.indicesOfNearest(this._getStoreDimIndex(dim), value, maxDistance); - }; + SeriesData.prototype.indicesOfNearest = function (dim, value, maxDistance) { + return this._store.indicesOfNearest(this._getStoreDimIndex(dim), value, maxDistance); + }; - SeriesData.prototype.each = function (dims, cb, ctx) { + SeriesData.prototype.each = function (dims, cb, ctx) { - if (isFunction(dims)) { - ctx = cb; - cb = dims; - dims = []; - } // ctxCompat just for compat echarts3 + if (isFunction(dims)) { + ctx = cb; + cb = dims; + dims = []; + } // ctxCompat just for compat echarts3 - var fCtx = ctx || this; - var dimIndices = map$1(normalizeDimensions(dims), this._getStoreDimIndex, this); + var fCtx = ctx || this; + var dimIndices = map$1(normalizeDimensions(dims), this._getStoreDimIndex, this); - this._store.each(dimIndices, fCtx ? bind(cb, fCtx) : cb); - }; + this._store.each(dimIndices, fCtx ? bind(cb, fCtx) : cb); + }; - SeriesData.prototype.filterSelf = function (dims, cb, ctx) { + SeriesData.prototype.filterSelf = function (dims, cb, ctx) { - if (isFunction(dims)) { - ctx = cb; - cb = dims; - dims = []; - } // ctxCompat just for compat echarts3 + if (isFunction(dims)) { + ctx = cb; + cb = dims; + dims = []; + } // ctxCompat just for compat echarts3 - var fCtx = ctx || this; - var dimIndices = map$1(normalizeDimensions(dims), this._getStoreDimIndex, this); - this._store = this._store.filter(dimIndices, fCtx ? bind(cb, fCtx) : cb); - return this; - }; - /** - * Select data in range. (For optimization of filter) - * (Manually inline code, support 5 million data filtering in data zoom.) - */ + var fCtx = ctx || this; + var dimIndices = map$1(normalizeDimensions(dims), this._getStoreDimIndex, this); + this._store = this._store.filter(dimIndices, fCtx ? bind(cb, fCtx) : cb); + return this; + }; + /** + * Select data in range. (For optimization of filter) + * (Manually inline code, support 5 million data filtering in data zoom.) + */ - SeriesData.prototype.selectRange = function (range) { + SeriesData.prototype.selectRange = function (range) { - var _this = this; + var _this = this; - var innerRange = {}; - var dims = keys(range); - each(dims, function (dim) { - var dimIdx = _this._getStoreDimIndex(dim); + var innerRange = {}; + var dims = keys(range); + each(dims, function (dim) { + var dimIdx = _this._getStoreDimIndex(dim); - innerRange[dimIdx] = range[dim]; - }); - this._store = this._store.selectRange(innerRange); - return this; - }; - /* eslint-enable max-len */ + innerRange[dimIdx] = range[dim]; + }); + this._store = this._store.selectRange(innerRange); + return this; + }; + /* eslint-enable max-len */ - SeriesData.prototype.mapArray = function (dims, cb, ctx) { + SeriesData.prototype.mapArray = function (dims, cb, ctx) { - if (isFunction(dims)) { - ctx = cb; - cb = dims; - dims = []; - } // ctxCompat just for compat echarts3 + if (isFunction(dims)) { + ctx = cb; + cb = dims; + dims = []; + } // ctxCompat just for compat echarts3 - ctx = ctx || this; - var result = []; - this.each(dims, function () { - result.push(cb && cb.apply(this, arguments)); - }, ctx); - return result; - }; + ctx = ctx || this; + var result = []; + this.each(dims, function () { + result.push(cb && cb.apply(this, arguments)); + }, ctx); + return result; + }; - SeriesData.prototype.map = function (dims, cb, ctx, ctxCompat) { + SeriesData.prototype.map = function (dims, cb, ctx, ctxCompat) { - var fCtx = ctx || ctxCompat || this; - var dimIndices = map$1(normalizeDimensions(dims), this._getStoreDimIndex, this); - var list = cloneListForMapAndSample(this); - list._store = this._store.map(dimIndices, fCtx ? bind(cb, fCtx) : cb); - return list; - }; + var fCtx = ctx || ctxCompat || this; + var dimIndices = map$1(normalizeDimensions(dims), this._getStoreDimIndex, this); + var list = cloneListForMapAndSample(this); + list._store = this._store.map(dimIndices, fCtx ? bind(cb, fCtx) : cb); + return list; + }; - SeriesData.prototype.modify = function (dims, cb, ctx, ctxCompat) { - var _this = this; // ctxCompat just for compat echarts3 + SeriesData.prototype.modify = function (dims, cb, ctx, ctxCompat) { + var _this = this; // ctxCompat just for compat echarts3 - var fCtx = ctx || ctxCompat || this; + var fCtx = ctx || ctxCompat || this; - if ("development" !== 'production') { - each(normalizeDimensions(dims), function (dim) { - var dimInfo = _this.getDimensionInfo(dim); + if ("development" !== 'production') { + each(normalizeDimensions(dims), function (dim) { + var dimInfo = _this.getDimensionInfo(dim); - if (!dimInfo.isCalculationCoord) { - console.error('Danger: only stack dimension can be modified'); - } - }); - } + if (!dimInfo.isCalculationCoord) { + console.error('Danger: only stack dimension can be modified'); + } + }); + } - var dimIndices = map$1(normalizeDimensions(dims), this._getStoreDimIndex, this); // If do shallow clone here, if there are too many stacked series, - // it still cost lots of memory, becuase `_store.dimensions` are not shared. - // We should consider there probably be shallow clone happen in each sereis - // in consequent filter/map. + var dimIndices = map$1(normalizeDimensions(dims), this._getStoreDimIndex, this); // If do shallow clone here, if there are too many stacked series, + // it still cost lots of memory, becuase `_store.dimensions` are not shared. + // We should consider there probably be shallow clone happen in each sereis + // in consequent filter/map. - this._store.modify(dimIndices, fCtx ? bind(cb, fCtx) : cb); - }; - /** - * Large data down sampling on given dimension - * @param sampleIndex Sample index for name and id - */ + this._store.modify(dimIndices, fCtx ? bind(cb, fCtx) : cb); + }; + /** + * Large data down sampling on given dimension + * @param sampleIndex Sample index for name and id + */ - SeriesData.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) { - var list = cloneListForMapAndSample(this); - list._store = this._store.downSample(this._getStoreDimIndex(dimension), rate, sampleValue, sampleIndex); - return list; - }; - /** - * Large data down sampling using largest-triangle-three-buckets - * @param {string} valueDimension - * @param {number} targetCount - */ + SeriesData.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) { + var list = cloneListForMapAndSample(this); + list._store = this._store.downSample(this._getStoreDimIndex(dimension), rate, sampleValue, sampleIndex); + return list; + }; + /** + * Large data down sampling using largest-triangle-three-buckets + * @param {string} valueDimension + * @param {number} targetCount + */ - SeriesData.prototype.lttbDownSample = function (valueDimension, rate) { - var list = cloneListForMapAndSample(this); - list._store = this._store.lttbDownSample(this._getStoreDimIndex(valueDimension), rate); - return list; - }; + SeriesData.prototype.lttbDownSample = function (valueDimension, rate) { + var list = cloneListForMapAndSample(this); + list._store = this._store.lttbDownSample(this._getStoreDimIndex(valueDimension), rate); + return list; + }; - SeriesData.prototype.getRawDataItem = function (idx) { - return this._store.getRawDataItem(idx); - }; - /** - * Get model of one data item. - */ - // TODO: Type of data item + SeriesData.prototype.getRawDataItem = function (idx) { + return this._store.getRawDataItem(idx); + }; + /** + * Get model of one data item. + */ + // TODO: Type of data item - SeriesData.prototype.getItemModel = function (idx) { - var hostModel = this.hostModel; - var dataItem = this.getRawDataItem(idx); - return new Model(dataItem, hostModel, hostModel && hostModel.ecModel); - }; - /** - * Create a data differ - */ + SeriesData.prototype.getItemModel = function (idx) { + var hostModel = this.hostModel; + var dataItem = this.getRawDataItem(idx); + return new Model(dataItem, hostModel, hostModel && hostModel.ecModel); + }; + /** + * Create a data differ + */ - SeriesData.prototype.diff = function (otherList) { - var thisList = this; - return new DataDiffer(otherList ? otherList.getStore().getIndices() : [], this.getStore().getIndices(), function (idx) { - return getId(otherList, idx); - }, function (idx) { - return getId(thisList, idx); - }); - }; - /** - * Get visual property. - */ + SeriesData.prototype.diff = function (otherList) { + var thisList = this; + return new DataDiffer(otherList ? otherList.getStore().getIndices() : [], this.getStore().getIndices(), function (idx) { + return getId(otherList, idx); + }, function (idx) { + return getId(thisList, idx); + }); + }; + /** + * Get visual property. + */ - SeriesData.prototype.getVisual = function (key) { - var visual = this._visual; - return visual && visual[key]; - }; + SeriesData.prototype.getVisual = function (key) { + var visual = this._visual; + return visual && visual[key]; + }; - SeriesData.prototype.setVisual = function (kvObj, val) { - this._visual = this._visual || {}; + SeriesData.prototype.setVisual = function (kvObj, val) { + this._visual = this._visual || {}; - if (isObject$2(kvObj)) { - extend(this._visual, kvObj); - } else { - this._visual[kvObj] = val; - } - }; - /** - * Get visual property of single data item - */ - // eslint-disable-next-line + if (isObject$2(kvObj)) { + extend(this._visual, kvObj); + } else { + this._visual[kvObj] = val; + } + }; + /** + * Get visual property of single data item + */ + // eslint-disable-next-line - SeriesData.prototype.getItemVisual = function (idx, key) { - var itemVisual = this._itemVisuals[idx]; - var val = itemVisual && itemVisual[key]; + SeriesData.prototype.getItemVisual = function (idx, key) { + var itemVisual = this._itemVisuals[idx]; + var val = itemVisual && itemVisual[key]; - if (val == null) { - // Use global visual property - return this.getVisual(key); - } + if (val == null) { + // Use global visual property + return this.getVisual(key); + } - return val; - }; - /** - * If exists visual property of single data item - */ + return val; + }; + /** + * If exists visual property of single data item + */ - SeriesData.prototype.hasItemVisual = function () { - return this._itemVisuals.length > 0; - }; - /** - * Make sure itemVisual property is unique - */ - // TODO: use key to save visual to reduce memory. + SeriesData.prototype.hasItemVisual = function () { + return this._itemVisuals.length > 0; + }; + /** + * Make sure itemVisual property is unique + */ + // TODO: use key to save visual to reduce memory. - SeriesData.prototype.ensureUniqueItemVisual = function (idx, key) { - var itemVisuals = this._itemVisuals; - var itemVisual = itemVisuals[idx]; + SeriesData.prototype.ensureUniqueItemVisual = function (idx, key) { + var itemVisuals = this._itemVisuals; + var itemVisual = itemVisuals[idx]; - if (!itemVisual) { - itemVisual = itemVisuals[idx] = {}; - } + if (!itemVisual) { + itemVisual = itemVisuals[idx] = {}; + } - var val = itemVisual[key]; + var val = itemVisual[key]; - if (val == null) { - val = this.getVisual(key); // TODO Performance? + if (val == null) { + val = this.getVisual(key); // TODO Performance? - if (isArray(val)) { - val = val.slice(); - } else if (isObject$2(val)) { - val = extend({}, val); - } + if (isArray(val)) { + val = val.slice(); + } else if (isObject$2(val)) { + val = extend({}, val); + } - itemVisual[key] = val; - } + itemVisual[key] = val; + } - return val; - }; // eslint-disable-next-line + return val; + }; // eslint-disable-next-line - SeriesData.prototype.setItemVisual = function (idx, key, value) { - var itemVisual = this._itemVisuals[idx] || {}; - this._itemVisuals[idx] = itemVisual; + SeriesData.prototype.setItemVisual = function (idx, key, value) { + var itemVisual = this._itemVisuals[idx] || {}; + this._itemVisuals[idx] = itemVisual; - if (isObject$2(key)) { - extend(itemVisual, key); - } else { - itemVisual[key] = value; - } - }; - /** - * Clear itemVisuals and list visual. - */ + if (isObject$2(key)) { + extend(itemVisual, key); + } else { + itemVisual[key] = value; + } + }; + /** + * Clear itemVisuals and list visual. + */ - SeriesData.prototype.clearAllVisual = function () { - this._visual = {}; - this._itemVisuals = []; - }; + SeriesData.prototype.clearAllVisual = function () { + this._visual = {}; + this._itemVisuals = []; + }; - SeriesData.prototype.setLayout = function (key, val) { - isObject$2(key) ? extend(this._layout, key) : this._layout[key] = val; - }; - /** - * Get layout property. - */ + SeriesData.prototype.setLayout = function (key, val) { + isObject$2(key) ? extend(this._layout, key) : this._layout[key] = val; + }; + /** + * Get layout property. + */ - SeriesData.prototype.getLayout = function (key) { - return this._layout[key]; - }; - /** - * Get layout of single data item - */ + SeriesData.prototype.getLayout = function (key) { + return this._layout[key]; + }; + /** + * Get layout of single data item + */ - SeriesData.prototype.getItemLayout = function (idx) { - return this._itemLayouts[idx]; - }; - /** - * Set layout of single data item - */ + SeriesData.prototype.getItemLayout = function (idx) { + return this._itemLayouts[idx]; + }; + /** + * Set layout of single data item + */ - SeriesData.prototype.setItemLayout = function (idx, layout, merge) { - this._itemLayouts[idx] = merge ? extend(this._itemLayouts[idx] || {}, layout) : layout; - }; - /** - * Clear all layout of single data item - */ + SeriesData.prototype.setItemLayout = function (idx, layout, merge) { + this._itemLayouts[idx] = merge ? extend(this._itemLayouts[idx] || {}, layout) : layout; + }; + /** + * Clear all layout of single data item + */ - SeriesData.prototype.clearItemLayouts = function () { - this._itemLayouts.length = 0; - }; - /** - * Set graphic element relative to data. It can be set as null - */ + SeriesData.prototype.clearItemLayouts = function () { + this._itemLayouts.length = 0; + }; + /** + * Set graphic element relative to data. It can be set as null + */ - SeriesData.prototype.setItemGraphicEl = function (idx, el) { - var seriesIndex = this.hostModel && this.hostModel.seriesIndex; - setCommonECData(seriesIndex, this.dataType, idx, el); - this._graphicEls[idx] = el; - }; + SeriesData.prototype.setItemGraphicEl = function (idx, el) { + var seriesIndex = this.hostModel && this.hostModel.seriesIndex; + setCommonECData(seriesIndex, this.dataType, idx, el); + this._graphicEls[idx] = el; + }; - SeriesData.prototype.getItemGraphicEl = function (idx) { - return this._graphicEls[idx]; - }; + SeriesData.prototype.getItemGraphicEl = function (idx) { + return this._graphicEls[idx]; + }; - SeriesData.prototype.eachItemGraphicEl = function (cb, context) { - each(this._graphicEls, function (el, idx) { - if (el) { - cb && cb.call(context, el, idx); - } - }); - }; - /** - * Shallow clone a new list except visual and layout properties, and graph elements. - * New list only change the indices. - */ + SeriesData.prototype.eachItemGraphicEl = function (cb, context) { + each(this._graphicEls, function (el, idx) { + if (el) { + cb && cb.call(context, el, idx); + } + }); + }; + /** + * Shallow clone a new list except visual and layout properties, and graph elements. + * New list only change the indices. + */ - SeriesData.prototype.cloneShallow = function (list) { - if (!list) { - list = new SeriesData(this._schema ? this._schema : map$1(this.dimensions, this._getDimInfo, this), this.hostModel); - } + SeriesData.prototype.cloneShallow = function (list) { + if (!list) { + list = new SeriesData(this._schema ? this._schema : map$1(this.dimensions, this._getDimInfo, this), this.hostModel); + } - transferProperties(list, this); - list._store = this._store; - return list; - }; - /** - * Wrap some method to add more feature - */ + transferProperties(list, this); + list._store = this._store; + return list; + }; + /** + * Wrap some method to add more feature + */ - SeriesData.prototype.wrapMethod = function (methodName, injectFunction) { - var originalMethod = this[methodName]; + SeriesData.prototype.wrapMethod = function (methodName, injectFunction) { + var originalMethod = this[methodName]; - if (!isFunction(originalMethod)) { - return; - } + if (!isFunction(originalMethod)) { + return; + } - this.__wrappedMethods = this.__wrappedMethods || []; + this.__wrappedMethods = this.__wrappedMethods || []; - this.__wrappedMethods.push(methodName); + this.__wrappedMethods.push(methodName); - this[methodName] = function () { - var res = originalMethod.apply(this, arguments); - return injectFunction.apply(this, [res].concat(slice(arguments))); - }; - }; // ---------------------------------------------------------- - // A work around for internal method visiting private member. - // ---------------------------------------------------------- + this[methodName] = function () { + var res = originalMethod.apply(this, arguments); + return injectFunction.apply(this, [res].concat(slice(arguments))); + }; + }; // ---------------------------------------------------------- + // A work around for internal method visiting private member. + // ---------------------------------------------------------- - SeriesData.internalField = function () { - prepareInvertedIndex = function (data) { - var invertedIndicesMap = data._invertedIndicesMap; - each(invertedIndicesMap, function (invertedIndices, dim) { - var dimInfo = data._dimInfos[dim]; // Currently, only dimensions that has ordinalMeta can create inverted indices. + SeriesData.internalField = function () { + prepareInvertedIndex = function (data) { + var invertedIndicesMap = data._invertedIndicesMap; + each(invertedIndicesMap, function (invertedIndices, dim) { + var dimInfo = data._dimInfos[dim]; // Currently, only dimensions that has ordinalMeta can create inverted indices. - var ordinalMeta = dimInfo.ordinalMeta; - var store = data._store; + var ordinalMeta = dimInfo.ordinalMeta; + var store = data._store; - if (ordinalMeta) { - invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array$1(ordinalMeta.categories.length); // The default value of TypedArray is 0. To avoid miss - // mapping to 0, we should set it as INDEX_NOT_FOUND. + if (ordinalMeta) { + invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array$1(ordinalMeta.categories.length); // The default value of TypedArray is 0. To avoid miss + // mapping to 0, we should set it as INDEX_NOT_FOUND. - for (var i = 0; i < invertedIndices.length; i++) { - invertedIndices[i] = INDEX_NOT_FOUND; - } + for (var i = 0; i < invertedIndices.length; i++) { + invertedIndices[i] = INDEX_NOT_FOUND; + } - for (var i = 0; i < store.count(); i++) { - // Only support the case that all values are distinct. - invertedIndices[store.get(dimInfo.storeDimIndex, i)] = i; - } - } - }); - }; + for (var i = 0; i < store.count(); i++) { + // Only support the case that all values are distinct. + invertedIndices[store.get(dimInfo.storeDimIndex, i)] = i; + } + } + }); + }; - getIdNameFromStore = function (data, dimIdx, idx) { - return convertOptionIdName(data._getCategory(dimIdx, idx), null); - }; - /** - * @see the comment of `List['getId']`. - */ + getIdNameFromStore = function (data, dimIdx, idx) { + return convertOptionIdName(data._getCategory(dimIdx, idx), null); + }; + /** + * @see the comment of `List['getId']`. + */ - getId = function (data, rawIndex) { - var id = data._idList[rawIndex]; + getId = function (data, rawIndex) { + var id = data._idList[rawIndex]; - if (id == null && data._idDimIdx != null) { - id = getIdNameFromStore(data, data._idDimIdx, rawIndex); - } + if (id == null && data._idDimIdx != null) { + id = getIdNameFromStore(data, data._idDimIdx, rawIndex); + } - if (id == null) { - id = ID_PREFIX + rawIndex; - } + if (id == null) { + id = ID_PREFIX + rawIndex; + } - return id; - }; + return id; + }; - normalizeDimensions = function (dimensions) { - if (!isArray(dimensions)) { - dimensions = dimensions != null ? [dimensions] : []; - } + normalizeDimensions = function (dimensions) { + if (!isArray(dimensions)) { + dimensions = dimensions != null ? [dimensions] : []; + } - return dimensions; - }; - /** - * Data in excludeDimensions is copied, otherwise transfered. - */ + return dimensions; + }; + /** + * Data in excludeDimensions is copied, otherwise transfered. + */ - cloneListForMapAndSample = function (original) { - var list = new SeriesData(original._schema ? original._schema : map$1(original.dimensions, original._getDimInfo, original), original.hostModel); // FIXME If needs stackedOn, value may already been stacked + cloneListForMapAndSample = function (original) { + var list = new SeriesData(original._schema ? original._schema : map$1(original.dimensions, original._getDimInfo, original), original.hostModel); // FIXME If needs stackedOn, value may already been stacked - transferProperties(list, original); - return list; - }; + transferProperties(list, original); + return list; + }; - transferProperties = function (target, source) { - each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) { - if (source.hasOwnProperty(propName)) { - target[propName] = source[propName]; - } - }); - target.__wrappedMethods = source.__wrappedMethods; - each(CLONE_PROPERTIES, function (propName) { - target[propName] = clone(source[propName]); - }); - target._calculationInfo = extend({}, source._calculationInfo); - }; + transferProperties = function (target, source) { + each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) { + if (source.hasOwnProperty(propName)) { + target[propName] = source[propName]; + } + }); + target.__wrappedMethods = source.__wrappedMethods; + each(CLONE_PROPERTIES, function (propName) { + target[propName] = clone(source[propName]); + }); + target._calculationInfo = extend({}, source._calculationInfo); + }; - makeIdFromName = function (data, idx) { - var nameList = data._nameList; - var idList = data._idList; - var nameDimIdx = data._nameDimIdx; - var idDimIdx = data._idDimIdx; - var name = nameList[idx]; - var id = idList[idx]; + makeIdFromName = function (data, idx) { + var nameList = data._nameList; + var idList = data._idList; + var nameDimIdx = data._nameDimIdx; + var idDimIdx = data._idDimIdx; + var name = nameList[idx]; + var id = idList[idx]; - if (name == null && nameDimIdx != null) { - nameList[idx] = name = getIdNameFromStore(data, nameDimIdx, idx); - } + if (name == null && nameDimIdx != null) { + nameList[idx] = name = getIdNameFromStore(data, nameDimIdx, idx); + } - if (id == null && idDimIdx != null) { - idList[idx] = id = getIdNameFromStore(data, idDimIdx, idx); - } + if (id == null && idDimIdx != null) { + idList[idx] = id = getIdNameFromStore(data, idDimIdx, idx); + } - if (id == null && name != null) { - var nameRepeatCount = data._nameRepeatCount; - var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1; - id = name; + if (id == null && name != null) { + var nameRepeatCount = data._nameRepeatCount; + var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1; + id = name; - if (nmCnt > 1) { - id += '__ec__' + nmCnt; - } + if (nmCnt > 1) { + id += '__ec__' + nmCnt; + } - idList[idx] = id; - } - }; - }(); + idList[idx] = id; + } + }; + }(); - return SeriesData; - }(); + return SeriesData; + }(); /** * For outside usage compat (like echarts-gl are using it). */ function createDimensions(source, opt) { - return prepareSeriesDataSchema(source, opt).dimensions; + return prepareSeriesDataSchema(source, opt).dimensions; } /** * This method builds the relationship between: @@ -32435,256 +32435,256 @@ */ function prepareSeriesDataSchema( // TODO: TYPE completeDimensions type - source, opt) { - if (!isSourceInstance(source)) { - source = createSourceFromSeriesDataOption(source); - } + source, opt) { + if (!isSourceInstance(source)) { + source = createSourceFromSeriesDataOption(source); + } + + opt = opt || {}; + var sysDims = opt.coordDimensions || []; + var dimsDef = opt.dimensionsDefine || source.dimensionsDefine || []; + var coordDimNameMap = createHashMap(); + var resultList = []; + var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimensionsCount); // Try to ignore unsed dimensions if sharing a high dimension datastore + // 30 is an experience value. + + var omitUnusedDimensions = opt.canOmitUnusedDimensions && shouldOmitUnusedDimensions(dimCount); + var isUsingSourceDimensionsDef = dimsDef === source.dimensionsDefine; + var dataDimNameMap = isUsingSourceDimensionsDef ? ensureSourceDimNameMap(source) : createDimNameMap(dimsDef); + var encodeDef = opt.encodeDefine; + + if (!encodeDef && opt.encodeDefaulter) { + encodeDef = opt.encodeDefaulter(source, dimCount); + } + + var encodeDefMap = createHashMap(encodeDef); + var indicesMap = new CtorInt32Array(dimCount); + + for (var i = 0; i < indicesMap.length; i++) { + indicesMap[i] = -1; + } + + function getResultItem(dimIdx) { + var idx = indicesMap[dimIdx]; + + if (idx < 0) { + var dimDefItemRaw = dimsDef[dimIdx]; + var dimDefItem = isObject(dimDefItemRaw) ? dimDefItemRaw : { + name: dimDefItemRaw + }; + var resultItem = new SeriesDimensionDefine(); + var userDimName = dimDefItem.name; + + if (userDimName != null && dataDimNameMap.get(userDimName) != null) { + // Only if `series.dimensions` is defined in option + // displayName, will be set, and dimension will be diplayed vertically in + // tooltip by default. + resultItem.name = resultItem.displayName = userDimName; + } + + dimDefItem.type != null && (resultItem.type = dimDefItem.type); + dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName); + var newIdx = resultList.length; + indicesMap[dimIdx] = newIdx; + resultItem.storeDimIndex = dimIdx; + resultList.push(resultItem); + return resultItem; + } + + return resultList[idx]; + } + + if (!omitUnusedDimensions) { + for (var i = 0; i < dimCount; i++) { + getResultItem(i); + } + } // Set `coordDim` and `coordDimIndex` by `encodeDefMap` and normalize `encodeDefMap`. + + + encodeDefMap.each(function (dataDimsRaw, coordDim) { + var dataDims = normalizeToArray(dataDimsRaw).slice(); // Note: It is allowed that `dataDims.length` is `0`, e.g., options is + // `{encode: {x: -1, y: 1}}`. Should not filter anything in + // this case. + + if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) { + encodeDefMap.set(coordDim, false); + return; + } + + var validDataDims = encodeDefMap.set(coordDim, []); + each(dataDims, function (resultDimIdxOrName, idx) { + // The input resultDimIdx can be dim name or index. + var resultDimIdx = isString(resultDimIdxOrName) ? dataDimNameMap.get(resultDimIdxOrName) : resultDimIdxOrName; + + if (resultDimIdx != null && resultDimIdx < dimCount) { + validDataDims[idx] = resultDimIdx; + applyDim(getResultItem(resultDimIdx), coordDim, idx); + } + }); + }); // Apply templetes and default order from `sysDims`. - opt = opt || {}; - var sysDims = opt.coordDimensions || []; - var dimsDef = opt.dimensionsDefine || source.dimensionsDefine || []; - var coordDimNameMap = createHashMap(); - var resultList = []; - var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimensionsCount); // Try to ignore unsed dimensions if sharing a high dimension datastore - // 30 is an experience value. + var availDimIdx = 0; + each(sysDims, function (sysDimItemRaw) { + var coordDim; + var sysDimItemDimsDef; + var sysDimItemOtherDims; + var sysDimItem; - var omitUnusedDimensions = opt.canOmitUnusedDimensions && shouldOmitUnusedDimensions(dimCount); - var isUsingSourceDimensionsDef = dimsDef === source.dimensionsDefine; - var dataDimNameMap = isUsingSourceDimensionsDef ? ensureSourceDimNameMap(source) : createDimNameMap(dimsDef); - var encodeDef = opt.encodeDefine; + if (isString(sysDimItemRaw)) { + coordDim = sysDimItemRaw; + sysDimItem = {}; + } else { + sysDimItem = sysDimItemRaw; + coordDim = sysDimItem.name; + var ordinalMeta = sysDimItem.ordinalMeta; + sysDimItem.ordinalMeta = null; + sysDimItem = extend({}, sysDimItem); + sysDimItem.ordinalMeta = ordinalMeta; // `coordDimIndex` should not be set directly. - if (!encodeDef && opt.encodeDefaulter) { - encodeDef = opt.encodeDefaulter(source, dimCount); + sysDimItemDimsDef = sysDimItem.dimsDef; + sysDimItemOtherDims = sysDimItem.otherDims; + sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex = sysDimItem.dimsDef = sysDimItem.otherDims = null; } - var encodeDefMap = createHashMap(encodeDef); - var indicesMap = new CtorInt32Array(dimCount); + var dataDims = encodeDefMap.get(coordDim); // negative resultDimIdx means no need to mapping. - for (var i = 0; i < indicesMap.length; i++) { - indicesMap[i] = -1; + if (dataDims === false) { + return; } - function getResultItem(dimIdx) { - var idx = indicesMap[dimIdx]; - - if (idx < 0) { - var dimDefItemRaw = dimsDef[dimIdx]; - var dimDefItem = isObject(dimDefItemRaw) ? dimDefItemRaw : { - name: dimDefItemRaw - }; - var resultItem = new SeriesDimensionDefine(); - var userDimName = dimDefItem.name; - - if (userDimName != null && dataDimNameMap.get(userDimName) != null) { - // Only if `series.dimensions` is defined in option - // displayName, will be set, and dimension will be diplayed vertically in - // tooltip by default. - resultItem.name = resultItem.displayName = userDimName; - } + dataDims = normalizeToArray(dataDims); // dimensions provides default dim sequences. - dimDefItem.type != null && (resultItem.type = dimDefItem.type); - dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName); - var newIdx = resultList.length; - indicesMap[dimIdx] = newIdx; - resultItem.storeDimIndex = dimIdx; - resultList.push(resultItem); - return resultItem; + if (!dataDims.length) { + for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) { + while (availDimIdx < dimCount && getResultItem(availDimIdx).coordDim != null) { + availDimIdx++; } - return resultList[idx]; - } - - if (!omitUnusedDimensions) { - for (var i = 0; i < dimCount; i++) { - getResultItem(i); - } - } // Set `coordDim` and `coordDimIndex` by `encodeDefMap` and normalize `encodeDefMap`. + availDimIdx < dimCount && dataDims.push(availDimIdx++); + } + } // Apply templates. - encodeDefMap.each(function (dataDimsRaw, coordDim) { - var dataDims = normalizeToArray(dataDimsRaw).slice(); // Note: It is allowed that `dataDims.length` is `0`, e.g., options is - // `{encode: {x: -1, y: 1}}`. Should not filter anything in - // this case. + each(dataDims, function (resultDimIdx, coordDimIndex) { + var resultItem = getResultItem(resultDimIdx); // Coordinate system has a higher priority on dim type than source. - if (dataDims.length === 1 && !isString(dataDims[0]) && dataDims[0] < 0) { - encodeDefMap.set(coordDim, false); - return; - } + if (isUsingSourceDimensionsDef && sysDimItem.type != null) { + resultItem.type = sysDimItem.type; + } - var validDataDims = encodeDefMap.set(coordDim, []); - each(dataDims, function (resultDimIdxOrName, idx) { - // The input resultDimIdx can be dim name or index. - var resultDimIdx = isString(resultDimIdxOrName) ? dataDimNameMap.get(resultDimIdxOrName) : resultDimIdxOrName; + applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex); - if (resultDimIdx != null && resultDimIdx < dimCount) { - validDataDims[idx] = resultDimIdx; - applyDim(getResultItem(resultDimIdx), coordDim, idx); - } + if (resultItem.name == null && sysDimItemDimsDef) { + var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex]; + !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = { + name: sysDimItemDimsDefItem }); - }); // Apply templetes and default order from `sysDims`. - - var availDimIdx = 0; - each(sysDims, function (sysDimItemRaw) { - var coordDim; - var sysDimItemDimsDef; - var sysDimItemOtherDims; - var sysDimItem; - - if (isString(sysDimItemRaw)) { - coordDim = sysDimItemRaw; - sysDimItem = {}; - } else { - sysDimItem = sysDimItemRaw; - coordDim = sysDimItem.name; - var ordinalMeta = sysDimItem.ordinalMeta; - sysDimItem.ordinalMeta = null; - sysDimItem = extend({}, sysDimItem); - sysDimItem.ordinalMeta = ordinalMeta; // `coordDimIndex` should not be set directly. - - sysDimItemDimsDef = sysDimItem.dimsDef; - sysDimItemOtherDims = sysDimItem.otherDims; - sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex = sysDimItem.dimsDef = sysDimItem.otherDims = null; - } - - var dataDims = encodeDefMap.get(coordDim); // negative resultDimIdx means no need to mapping. - - if (dataDims === false) { - return; - } - - dataDims = normalizeToArray(dataDims); // dimensions provides default dim sequences. - - if (!dataDims.length) { - for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) { - while (availDimIdx < dimCount && getResultItem(availDimIdx).coordDim != null) { - availDimIdx++; - } - - availDimIdx < dimCount && dataDims.push(availDimIdx++); - } - } // Apply templates. - - - each(dataDims, function (resultDimIdx, coordDimIndex) { - var resultItem = getResultItem(resultDimIdx); // Coordinate system has a higher priority on dim type than source. + resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name; + resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip; + } // FIXME refactor, currently only used in case: {otherDims: {tooltip: false}} - if (isUsingSourceDimensionsDef && sysDimItem.type != null) { - resultItem.type = sysDimItem.type; - } - - applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex); - - if (resultItem.name == null && sysDimItemDimsDef) { - var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex]; - !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = { - name: sysDimItemDimsDefItem - }); - resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name; - resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip; - } // FIXME refactor, currently only used in case: {otherDims: {tooltip: false}} - - sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims); - }); + sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims); }); + }); - function applyDim(resultItem, coordDim, coordDimIndex) { - if (VISUAL_DIMENSIONS.get(coordDim) != null) { - resultItem.otherDims[coordDim] = coordDimIndex; - } else { - resultItem.coordDim = coordDim; - resultItem.coordDimIndex = coordDimIndex; - coordDimNameMap.set(coordDim, true); - } - } // Make sure the first extra dim is 'value'. - - - var generateCoord = opt.generateCoord; - var generateCoordCount = opt.generateCoordCount; - var fromZero = generateCoordCount != null; - generateCoordCount = generateCoord ? generateCoordCount || 1 : 0; - var extra = generateCoord || 'value'; - - function ifNoNameFillWithCoordName(resultItem) { - if (resultItem.name == null) { - // Duplication will be removed in the next step. - resultItem.name = resultItem.coordDim; - } - } // Set dim `name` and other `coordDim` and other props. - - - if (!omitUnusedDimensions) { - for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) { - var resultItem = getResultItem(resultDimIdx); - var coordDim = resultItem.coordDim; - - if (coordDim == null) { - // TODO no need to generate coordDim for isExtraCoord? - resultItem.coordDim = genCoordDimName(extra, coordDimNameMap, fromZero); - resultItem.coordDimIndex = 0; // Series specified generateCoord is using out. - - if (!generateCoord || generateCoordCount <= 0) { - resultItem.isExtraCoord = true; - } - - generateCoordCount--; - } - - ifNoNameFillWithCoordName(resultItem); - - if (resultItem.type == null && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must // Consider the case: - // { - // dataset: {source: [ - // ['2001', 123], - // ['2002', 456], - // ... - // ['The others', 987], - // ]}, - // series: {type: 'pie'} - // } - // The first colum should better be treated as a "ordinal" although it - // might not able to be detected as an "ordinal" by `guessOrdinal`. - || resultItem.isExtraCoord && (resultItem.otherDims.itemName != null || resultItem.otherDims.seriesName != null))) { - resultItem.type = 'ordinal'; - } - } + function applyDim(resultItem, coordDim, coordDimIndex) { + if (VISUAL_DIMENSIONS.get(coordDim) != null) { + resultItem.otherDims[coordDim] = coordDimIndex; } else { - each(resultList, function (resultItem) { - // PENDING: guessOrdinal or let user specify type: 'ordinal' manually? - ifNoNameFillWithCoordName(resultItem); - }); // Sort dimensions: there are some rule that use the last dim as label, - // and for some latter travel process easier. - - resultList.sort(function (item0, item1) { - return item0.storeDimIndex - item1.storeDimIndex; - }); - } - - removeDuplication(resultList); - return new SeriesDataSchema({ - source: source, - dimensions: resultList, - fullDimensionCount: dimCount, - dimensionOmitted: omitUnusedDimensions + resultItem.coordDim = coordDim; + resultItem.coordDimIndex = coordDimIndex; + coordDimNameMap.set(coordDim, true); + } + } // Make sure the first extra dim is 'value'. + + + var generateCoord = opt.generateCoord; + var generateCoordCount = opt.generateCoordCount; + var fromZero = generateCoordCount != null; + generateCoordCount = generateCoord ? generateCoordCount || 1 : 0; + var extra = generateCoord || 'value'; + + function ifNoNameFillWithCoordName(resultItem) { + if (resultItem.name == null) { + // Duplication will be removed in the next step. + resultItem.name = resultItem.coordDim; + } + } // Set dim `name` and other `coordDim` and other props. + + + if (!omitUnusedDimensions) { + for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) { + var resultItem = getResultItem(resultDimIdx); + var coordDim = resultItem.coordDim; + + if (coordDim == null) { + // TODO no need to generate coordDim for isExtraCoord? + resultItem.coordDim = genCoordDimName(extra, coordDimNameMap, fromZero); + resultItem.coordDimIndex = 0; // Series specified generateCoord is using out. + + if (!generateCoord || generateCoordCount <= 0) { + resultItem.isExtraCoord = true; + } + + generateCoordCount--; + } + + ifNoNameFillWithCoordName(resultItem); + + if (resultItem.type == null && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must // Consider the case: + // { + // dataset: {source: [ + // ['2001', 123], + // ['2002', 456], + // ... + // ['The others', 987], + // ]}, + // series: {type: 'pie'} + // } + // The first colum should better be treated as a "ordinal" although it + // might not able to be detected as an "ordinal" by `guessOrdinal`. + || resultItem.isExtraCoord && (resultItem.otherDims.itemName != null || resultItem.otherDims.seriesName != null))) { + resultItem.type = 'ordinal'; + } + } + } else { + each(resultList, function (resultItem) { + // PENDING: guessOrdinal or let user specify type: 'ordinal' manually? + ifNoNameFillWithCoordName(resultItem); + }); // Sort dimensions: there are some rule that use the last dim as label, + // and for some latter travel process easier. + + resultList.sort(function (item0, item1) { + return item0.storeDimIndex - item1.storeDimIndex; }); + } + + removeDuplication(resultList); + return new SeriesDataSchema({ + source: source, + dimensions: resultList, + fullDimensionCount: dimCount, + dimensionOmitted: omitUnusedDimensions + }); } function removeDuplication(result) { - var duplicationMap = createHashMap(); - - for (var i = 0; i < result.length; i++) { - var dim = result[i]; - var dimOriginalName = dim.name; - var count = duplicationMap.get(dimOriginalName) || 0; + var duplicationMap = createHashMap(); - if (count > 0) { - // Starts from 0. - dim.name = dimOriginalName + (count - 1); - } + for (var i = 0; i < result.length; i++) { + var dim = result[i]; + var dimOriginalName = dim.name; + var count = duplicationMap.get(dimOriginalName) || 0; - count++; - duplicationMap.set(dimOriginalName, count); + if (count > 0) { + // Starts from 0. + dim.name = dimOriginalName + (count - 1); } + + count++; + duplicationMap.set(dimOriginalName, count); + } } // ??? TODO // Originally detect dimCount by data[0]. Should we // optimize it to only by sysDims and dimensions and encode. @@ -32698,34 +32698,34 @@ function getDimCount(source, sysDims, dimsDef, optDimCount) { - // Note that the result dimCount should not small than columns count - // of data, otherwise `dataDimNameMap` checking will be incorrect. - var dimCount = Math.max(source.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0); - each(sysDims, function (sysDimItem) { - var sysDimItemDimsDef; + // Note that the result dimCount should not small than columns count + // of data, otherwise `dataDimNameMap` checking will be incorrect. + var dimCount = Math.max(source.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0); + each(sysDims, function (sysDimItem) { + var sysDimItemDimsDef; - if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) { - dimCount = Math.max(dimCount, sysDimItemDimsDef.length); - } - }); - return dimCount; + if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) { + dimCount = Math.max(dimCount, sysDimItemDimsDef.length); + } + }); + return dimCount; } function genCoordDimName(name, map, fromZero) { - var mapData = map.data; + var mapData = map.data; - if (fromZero || mapData.hasOwnProperty(name)) { - var i = 0; - - while (mapData.hasOwnProperty(name + i)) { - i++; - } + if (fromZero || mapData.hasOwnProperty(name)) { + var i = 0; - name += i; + while (mapData.hasOwnProperty(name + i)) { + i++; } - map.set(name, true); - return name; + name += i; + } + + map.set(name, true); + return name; } /** @@ -32750,128 +32750,128 @@ */ var CoordSysInfo = - /** @class */ - function () { - function CoordSysInfo(coordSysName) { - this.coordSysDims = []; - this.axisMap = createHashMap(); - this.categoryAxisMap = createHashMap(); - this.coordSysName = coordSysName; - } - - return CoordSysInfo; - }(); + /** @class */ + function () { + function CoordSysInfo(coordSysName) { + this.coordSysDims = []; + this.axisMap = createHashMap(); + this.categoryAxisMap = createHashMap(); + this.coordSysName = coordSysName; + } + + return CoordSysInfo; + }(); function getCoordSysInfoBySeries(seriesModel) { - var coordSysName = seriesModel.get('coordinateSystem'); - var result = new CoordSysInfo(coordSysName); - var fetch = fetchers[coordSysName]; + var coordSysName = seriesModel.get('coordinateSystem'); + var result = new CoordSysInfo(coordSysName); + var fetch = fetchers[coordSysName]; - if (fetch) { - fetch(seriesModel, result, result.axisMap, result.categoryAxisMap); - return result; - } + if (fetch) { + fetch(seriesModel, result, result.axisMap, result.categoryAxisMap); + return result; + } } var fetchers = { - cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) { - var xAxisModel = seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0]; - var yAxisModel = seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0]; + cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) { + var xAxisModel = seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0]; + var yAxisModel = seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0]; - if ("development" !== 'production') { - if (!xAxisModel) { - throw new Error('xAxis "' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('xAxisId'), 0) + '" not found'); - } + if ("development" !== 'production') { + if (!xAxisModel) { + throw new Error('xAxis "' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('xAxisId'), 0) + '" not found'); + } - if (!yAxisModel) { - throw new Error('yAxis "' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('yAxisId'), 0) + '" not found'); - } - } + if (!yAxisModel) { + throw new Error('yAxis "' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('yAxisId'), 0) + '" not found'); + } + } - result.coordSysDims = ['x', 'y']; - axisMap.set('x', xAxisModel); - axisMap.set('y', yAxisModel); + result.coordSysDims = ['x', 'y']; + axisMap.set('x', xAxisModel); + axisMap.set('y', yAxisModel); - if (isCategory(xAxisModel)) { - categoryAxisMap.set('x', xAxisModel); - result.firstCategoryDimIndex = 0; - } + if (isCategory(xAxisModel)) { + categoryAxisMap.set('x', xAxisModel); + result.firstCategoryDimIndex = 0; + } - if (isCategory(yAxisModel)) { - categoryAxisMap.set('y', yAxisModel); - result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1); - } - }, - singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) { - var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0]; + if (isCategory(yAxisModel)) { + categoryAxisMap.set('y', yAxisModel); + result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1); + } + }, + singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) { + var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0]; - if ("development" !== 'production') { - if (!singleAxisModel) { - throw new Error('singleAxis should be specified.'); - } - } + if ("development" !== 'production') { + if (!singleAxisModel) { + throw new Error('singleAxis should be specified.'); + } + } - result.coordSysDims = ['single']; - axisMap.set('single', singleAxisModel); + result.coordSysDims = ['single']; + axisMap.set('single', singleAxisModel); - if (isCategory(singleAxisModel)) { - categoryAxisMap.set('single', singleAxisModel); - result.firstCategoryDimIndex = 0; - } - }, - polar: function (seriesModel, result, axisMap, categoryAxisMap) { - var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0]; - var radiusAxisModel = polarModel.findAxisModel('radiusAxis'); - var angleAxisModel = polarModel.findAxisModel('angleAxis'); + if (isCategory(singleAxisModel)) { + categoryAxisMap.set('single', singleAxisModel); + result.firstCategoryDimIndex = 0; + } + }, + polar: function (seriesModel, result, axisMap, categoryAxisMap) { + var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0]; + var radiusAxisModel = polarModel.findAxisModel('radiusAxis'); + var angleAxisModel = polarModel.findAxisModel('angleAxis'); - if ("development" !== 'production') { - if (!angleAxisModel) { - throw new Error('angleAxis option not found'); - } + if ("development" !== 'production') { + if (!angleAxisModel) { + throw new Error('angleAxis option not found'); + } - if (!radiusAxisModel) { - throw new Error('radiusAxis option not found'); - } - } + if (!radiusAxisModel) { + throw new Error('radiusAxis option not found'); + } + } - result.coordSysDims = ['radius', 'angle']; - axisMap.set('radius', radiusAxisModel); - axisMap.set('angle', angleAxisModel); + result.coordSysDims = ['radius', 'angle']; + axisMap.set('radius', radiusAxisModel); + axisMap.set('angle', angleAxisModel); - if (isCategory(radiusAxisModel)) { - categoryAxisMap.set('radius', radiusAxisModel); - result.firstCategoryDimIndex = 0; - } + if (isCategory(radiusAxisModel)) { + categoryAxisMap.set('radius', radiusAxisModel); + result.firstCategoryDimIndex = 0; + } - if (isCategory(angleAxisModel)) { - categoryAxisMap.set('angle', angleAxisModel); - result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1); - } - }, - geo: function (seriesModel, result, axisMap, categoryAxisMap) { - result.coordSysDims = ['lng', 'lat']; - }, - parallel: function (seriesModel, result, axisMap, categoryAxisMap) { - var ecModel = seriesModel.ecModel; - var parallelModel = ecModel.getComponent('parallel', seriesModel.get('parallelIndex')); - var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice(); - each(parallelModel.parallelAxisIndex, function (axisIndex, index) { - var axisModel = ecModel.getComponent('parallelAxis', axisIndex); - var axisDim = coordSysDims[index]; - axisMap.set(axisDim, axisModel); - - if (isCategory(axisModel)) { - categoryAxisMap.set(axisDim, axisModel); - - if (result.firstCategoryDimIndex == null) { - result.firstCategoryDimIndex = index; - } - } - }); + if (isCategory(angleAxisModel)) { + categoryAxisMap.set('angle', angleAxisModel); + result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1); } + }, + geo: function (seriesModel, result, axisMap, categoryAxisMap) { + result.coordSysDims = ['lng', 'lat']; + }, + parallel: function (seriesModel, result, axisMap, categoryAxisMap) { + var ecModel = seriesModel.ecModel; + var parallelModel = ecModel.getComponent('parallel', seriesModel.get('parallelIndex')); + var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice(); + each(parallelModel.parallelAxisIndex, function (axisIndex, index) { + var axisModel = ecModel.getComponent('parallelAxis', axisIndex); + var axisDim = coordSysDims[index]; + axisMap.set(axisDim, axisModel); + + if (isCategory(axisModel)) { + categoryAxisMap.set(axisDim, axisModel); + + if (result.firstCategoryDimIndex == null) { + result.firstCategoryDimIndex = index; + } + } + }); + } }; function isCategory(axisModel) { - return axisModel.get('type') === 'category'; + return axisModel.get('type') === 'category'; } /** @@ -32896,190 +32896,190 @@ */ function enableDataStack(seriesModel, dimensionsInput, opt) { - opt = opt || {}; - var byIndex = opt.byIndex; - var stackedCoordDimension = opt.stackedCoordDimension; - var dimensionDefineList; - var schema; - var store; - - if (isLegacyDimensionsInput(dimensionsInput)) { - dimensionDefineList = dimensionsInput; - } else { - schema = dimensionsInput.schema; - dimensionDefineList = schema.dimensions; - store = dimensionsInput.store; - } // Compatibal: when `stack` is set as '', do not stack. - - - var mayStack = !!(seriesModel && seriesModel.get('stack')); - var stackedByDimInfo; - var stackedDimInfo; - var stackResultDimension; - var stackedOverDimension; - each(dimensionDefineList, function (dimensionInfo, index) { - if (isString(dimensionInfo)) { - dimensionDefineList[index] = dimensionInfo = { - name: dimensionInfo - }; - } - - if (mayStack && !dimensionInfo.isExtraCoord) { - // Find the first ordinal dimension as the stackedByDimInfo. - if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) { - stackedByDimInfo = dimensionInfo; - } // Find the first stackable dimension as the stackedDimInfo. - - - if (!stackedDimInfo && dimensionInfo.type !== 'ordinal' && dimensionInfo.type !== 'time' && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) { - stackedDimInfo = dimensionInfo; - } - } + opt = opt || {}; + var byIndex = opt.byIndex; + var stackedCoordDimension = opt.stackedCoordDimension; + var dimensionDefineList; + var schema; + var store; + + if (isLegacyDimensionsInput(dimensionsInput)) { + dimensionDefineList = dimensionsInput; + } else { + schema = dimensionsInput.schema; + dimensionDefineList = schema.dimensions; + store = dimensionsInput.store; + } // Compatibal: when `stack` is set as '', do not stack. + + + var mayStack = !!(seriesModel && seriesModel.get('stack')); + var stackedByDimInfo; + var stackedDimInfo; + var stackResultDimension; + var stackedOverDimension; + each(dimensionDefineList, function (dimensionInfo, index) { + if (isString(dimensionInfo)) { + dimensionDefineList[index] = dimensionInfo = { + name: dimensionInfo + }; + } + + if (mayStack && !dimensionInfo.isExtraCoord) { + // Find the first ordinal dimension as the stackedByDimInfo. + if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) { + stackedByDimInfo = dimensionInfo; + } // Find the first stackable dimension as the stackedDimInfo. + + + if (!stackedDimInfo && dimensionInfo.type !== 'ordinal' && dimensionInfo.type !== 'time' && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) { + stackedDimInfo = dimensionInfo; + } + } + }); + + if (stackedDimInfo && !byIndex && !stackedByDimInfo) { + // Compatible with previous design, value axis (time axis) only stack by index. + // It may make sense if the user provides elaborately constructed data. + byIndex = true; + } // Add stack dimension, they can be both calculated by coordinate system in `unionExtent`. + // That put stack logic in List is for using conveniently in echarts extensions, but it + // might not be a good way. + + + if (stackedDimInfo) { + // Use a weird name that not duplicated with other names. + // Also need to use seriesModel.id as postfix because different + // series may share same data store. The stack dimension needs to be distinguished. + stackResultDimension = '__\0ecstackresult_' + seriesModel.id; + stackedOverDimension = '__\0ecstackedover_' + seriesModel.id; // Create inverted index to fast query index by value. + + if (stackedByDimInfo) { + stackedByDimInfo.createInvertedIndices = true; + } + + var stackedDimCoordDim_1 = stackedDimInfo.coordDim; + var stackedDimType = stackedDimInfo.type; + var stackedDimCoordIndex_1 = 0; + each(dimensionDefineList, function (dimensionInfo) { + if (dimensionInfo.coordDim === stackedDimCoordDim_1) { + stackedDimCoordIndex_1++; + } }); - - if (stackedDimInfo && !byIndex && !stackedByDimInfo) { - // Compatible with previous design, value axis (time axis) only stack by index. - // It may make sense if the user provides elaborately constructed data. - byIndex = true; - } // Add stack dimension, they can be both calculated by coordinate system in `unionExtent`. - // That put stack logic in List is for using conveniently in echarts extensions, but it - // might not be a good way. - - - if (stackedDimInfo) { - // Use a weird name that not duplicated with other names. - // Also need to use seriesModel.id as postfix because different - // series may share same data store. The stack dimension needs to be distinguished. - stackResultDimension = '__\0ecstackresult_' + seriesModel.id; - stackedOverDimension = '__\0ecstackedover_' + seriesModel.id; // Create inverted index to fast query index by value. - - if (stackedByDimInfo) { - stackedByDimInfo.createInvertedIndices = true; - } - - var stackedDimCoordDim_1 = stackedDimInfo.coordDim; - var stackedDimType = stackedDimInfo.type; - var stackedDimCoordIndex_1 = 0; - each(dimensionDefineList, function (dimensionInfo) { - if (dimensionInfo.coordDim === stackedDimCoordDim_1) { - stackedDimCoordIndex_1++; - } - }); - var stackedOverDimensionDefine = { - name: stackResultDimension, - coordDim: stackedDimCoordDim_1, - coordDimIndex: stackedDimCoordIndex_1, - type: stackedDimType, - isExtraCoord: true, - isCalculationCoord: true, - storeDimIndex: dimensionDefineList.length - }; - var stackResultDimensionDefine = { - name: stackedOverDimension, - // This dimension contains stack base (generally, 0), so do not set it as - // `stackedDimCoordDim` to avoid extent calculation, consider log scale. - coordDim: stackedOverDimension, - coordDimIndex: stackedDimCoordIndex_1 + 1, - type: stackedDimType, - isExtraCoord: true, - isCalculationCoord: true, - storeDimIndex: dimensionDefineList.length + 1 - }; - - if (schema) { - if (store) { - stackedOverDimensionDefine.storeDimIndex = store.ensureCalculationDimension(stackedOverDimension, stackedDimType); - stackResultDimensionDefine.storeDimIndex = store.ensureCalculationDimension(stackResultDimension, stackedDimType); - } - - schema.appendCalculationDimension(stackedOverDimensionDefine); - schema.appendCalculationDimension(stackResultDimensionDefine); - } else { - dimensionDefineList.push(stackedOverDimensionDefine); - dimensionDefineList.push(stackResultDimensionDefine); - } + var stackedOverDimensionDefine = { + name: stackResultDimension, + coordDim: stackedDimCoordDim_1, + coordDimIndex: stackedDimCoordIndex_1, + type: stackedDimType, + isExtraCoord: true, + isCalculationCoord: true, + storeDimIndex: dimensionDefineList.length + }; + var stackResultDimensionDefine = { + name: stackedOverDimension, + // This dimension contains stack base (generally, 0), so do not set it as + // `stackedDimCoordDim` to avoid extent calculation, consider log scale. + coordDim: stackedOverDimension, + coordDimIndex: stackedDimCoordIndex_1 + 1, + type: stackedDimType, + isExtraCoord: true, + isCalculationCoord: true, + storeDimIndex: dimensionDefineList.length + 1 + }; + + if (schema) { + if (store) { + stackedOverDimensionDefine.storeDimIndex = store.ensureCalculationDimension(stackedOverDimension, stackedDimType); + stackResultDimensionDefine.storeDimIndex = store.ensureCalculationDimension(stackResultDimension, stackedDimType); + } + + schema.appendCalculationDimension(stackedOverDimensionDefine); + schema.appendCalculationDimension(stackResultDimensionDefine); + } else { + dimensionDefineList.push(stackedOverDimensionDefine); + dimensionDefineList.push(stackResultDimensionDefine); } + } - return { - stackedDimension: stackedDimInfo && stackedDimInfo.name, - stackedByDimension: stackedByDimInfo && stackedByDimInfo.name, - isStackedByIndex: byIndex, - stackedOverDimension: stackedOverDimension, - stackResultDimension: stackResultDimension - }; + return { + stackedDimension: stackedDimInfo && stackedDimInfo.name, + stackedByDimension: stackedByDimInfo && stackedByDimInfo.name, + isStackedByIndex: byIndex, + stackedOverDimension: stackedOverDimension, + stackResultDimension: stackResultDimension + }; } function isLegacyDimensionsInput(dimensionsInput) { - return !isSeriesDataSchema(dimensionsInput.schema); + return !isSeriesDataSchema(dimensionsInput.schema); } function isDimensionStacked(data, stackedDim) { - // Each single series only maps to one pair of axis. So we do not need to - // check stackByDim, whatever stacked by a dimension or stacked by index. - return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension'); + // Each single series only maps to one pair of axis. So we do not need to + // check stackByDim, whatever stacked by a dimension or stacked by index. + return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension'); } function getStackedDimension(data, targetDim) { - return isDimensionStacked(data, targetDim) ? data.getCalculationInfo('stackResultDimension') : targetDim; + return isDimensionStacked(data, targetDim) ? data.getCalculationInfo('stackResultDimension') : targetDim; } function getCoordSysDimDefs(seriesModel, coordSysInfo) { - var coordSysName = seriesModel.get('coordinateSystem'); - var registeredCoordSys = CoordinateSystemManager.get(coordSysName); - var coordSysDimDefs; - - if (coordSysInfo && coordSysInfo.coordSysDims) { - coordSysDimDefs = map(coordSysInfo.coordSysDims, function (dim) { - var dimInfo = { - name: dim - }; - var axisModel = coordSysInfo.axisMap.get(dim); - - if (axisModel) { - var axisType = axisModel.get('type'); - dimInfo.type = getDimensionTypeByAxis(axisType); - } - - return dimInfo; - }); - } + var coordSysName = seriesModel.get('coordinateSystem'); + var registeredCoordSys = CoordinateSystemManager.get(coordSysName); + var coordSysDimDefs; + + if (coordSysInfo && coordSysInfo.coordSysDims) { + coordSysDimDefs = map(coordSysInfo.coordSysDims, function (dim) { + var dimInfo = { + name: dim + }; + var axisModel = coordSysInfo.axisMap.get(dim); + + if (axisModel) { + var axisType = axisModel.get('type'); + dimInfo.type = getDimensionTypeByAxis(axisType); + } + + return dimInfo; + }); + } - if (!coordSysDimDefs) { - // Get dimensions from registered coordinate system - coordSysDimDefs = registeredCoordSys && (registeredCoordSys.getDimensionsInfo ? registeredCoordSys.getDimensionsInfo() : registeredCoordSys.dimensions.slice()) || ['x', 'y']; - } + if (!coordSysDimDefs) { + // Get dimensions from registered coordinate system + coordSysDimDefs = registeredCoordSys && (registeredCoordSys.getDimensionsInfo ? registeredCoordSys.getDimensionsInfo() : registeredCoordSys.dimensions.slice()) || ['x', 'y']; + } - return coordSysDimDefs; + return coordSysDimDefs; } function injectOrdinalMeta(dimInfoList, createInvertedIndices, coordSysInfo) { - var firstCategoryDimIndex; - var hasNameEncode; - coordSysInfo && each(dimInfoList, function (dimInfo, dimIndex) { - var coordDim = dimInfo.coordDim; - var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim); - - if (categoryAxisModel) { - if (firstCategoryDimIndex == null) { - firstCategoryDimIndex = dimIndex; - } + var firstCategoryDimIndex; + var hasNameEncode; + coordSysInfo && each(dimInfoList, function (dimInfo, dimIndex) { + var coordDim = dimInfo.coordDim; + var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim); - dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta(); + if (categoryAxisModel) { + if (firstCategoryDimIndex == null) { + firstCategoryDimIndex = dimIndex; + } - if (createInvertedIndices) { - dimInfo.createInvertedIndices = true; - } - } + dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta(); - if (dimInfo.otherDims.itemName != null) { - hasNameEncode = true; - } - }); + if (createInvertedIndices) { + dimInfo.createInvertedIndices = true; + } + } - if (!hasNameEncode && firstCategoryDimIndex != null) { - dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0; + if (dimInfo.otherDims.itemName != null) { + hasNameEncode = true; } + }); - return firstCategoryDimIndex; + if (!hasNameEncode && firstCategoryDimIndex != null) { + dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0; + } + + return firstCategoryDimIndex; } /** * Caution: there are side effects to `sourceManager` in this method. @@ -33088,256 +33088,256 @@ function createSeriesData(sourceRaw, seriesModel, opt) { - opt = opt || {}; - var sourceManager = seriesModel.getSourceManager(); - var source; - var isOriginalSource = false; - - if (sourceRaw) { - isOriginalSource = true; - source = createSourceFromSeriesDataOption(sourceRaw); - } else { - source = sourceManager.getSource(); // Is series.data. not dataset. - - isOriginalSource = source.sourceFormat === SOURCE_FORMAT_ORIGINAL; - } - - var coordSysInfo = getCoordSysInfoBySeries(seriesModel); - var coordSysDimDefs = getCoordSysDimDefs(seriesModel, coordSysInfo); - var useEncodeDefaulter = opt.useEncodeDefaulter; - var encodeDefaulter = isFunction(useEncodeDefaulter) ? useEncodeDefaulter : useEncodeDefaulter ? curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel) : null; - var createDimensionOptions = { - coordDimensions: coordSysDimDefs, - generateCoord: opt.generateCoord, - encodeDefine: seriesModel.getEncode(), - encodeDefaulter: encodeDefaulter, - canOmitUnusedDimensions: !isOriginalSource - }; - var schema = prepareSeriesDataSchema(source, createDimensionOptions); - var firstCategoryDimIndex = injectOrdinalMeta(schema.dimensions, opt.createInvertedIndices, coordSysInfo); - var store = !isOriginalSource ? sourceManager.getSharedDataStore(schema) : null; - var stackCalculationInfo = enableDataStack(seriesModel, { - schema: schema, - store: store - }); - var data = new SeriesData(schema, seriesModel); - data.setCalculationInfo(stackCalculationInfo); - var dimValueGetter = firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source) ? function (itemOpt, dimName, dataIndex, dimIndex) { - // Use dataIndex as ordinal value in categoryAxis - return dimIndex === firstCategoryDimIndex ? dataIndex : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex); - } : null; - data.hasItemOption = false; - data.initData( // Try to reuse the data store in sourceManager if using dataset. - isOriginalSource ? source : store, null, dimValueGetter); - return data; + opt = opt || {}; + var sourceManager = seriesModel.getSourceManager(); + var source; + var isOriginalSource = false; + + if (sourceRaw) { + isOriginalSource = true; + source = createSourceFromSeriesDataOption(sourceRaw); + } else { + source = sourceManager.getSource(); // Is series.data. not dataset. + + isOriginalSource = source.sourceFormat === SOURCE_FORMAT_ORIGINAL; + } + + var coordSysInfo = getCoordSysInfoBySeries(seriesModel); + var coordSysDimDefs = getCoordSysDimDefs(seriesModel, coordSysInfo); + var useEncodeDefaulter = opt.useEncodeDefaulter; + var encodeDefaulter = isFunction(useEncodeDefaulter) ? useEncodeDefaulter : useEncodeDefaulter ? curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel) : null; + var createDimensionOptions = { + coordDimensions: coordSysDimDefs, + generateCoord: opt.generateCoord, + encodeDefine: seriesModel.getEncode(), + encodeDefaulter: encodeDefaulter, + canOmitUnusedDimensions: !isOriginalSource + }; + var schema = prepareSeriesDataSchema(source, createDimensionOptions); + var firstCategoryDimIndex = injectOrdinalMeta(schema.dimensions, opt.createInvertedIndices, coordSysInfo); + var store = !isOriginalSource ? sourceManager.getSharedDataStore(schema) : null; + var stackCalculationInfo = enableDataStack(seriesModel, { + schema: schema, + store: store + }); + var data = new SeriesData(schema, seriesModel); + data.setCalculationInfo(stackCalculationInfo); + var dimValueGetter = firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source) ? function (itemOpt, dimName, dataIndex, dimIndex) { + // Use dataIndex as ordinal value in categoryAxis + return dimIndex === firstCategoryDimIndex ? dataIndex : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex); + } : null; + data.hasItemOption = false; + data.initData( // Try to reuse the data store in sourceManager if using dataset. + isOriginalSource ? source : store, null, dimValueGetter); + return data; } function isNeedCompleteOrdinalData(source) { - if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) { - var sampleItem = firstDataNotNull(source.data || []); - return !isArray(getDataItemValue(sampleItem)); - } + if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) { + var sampleItem = firstDataNotNull(source.data || []); + return !isArray(getDataItemValue(sampleItem)); + } } function firstDataNotNull(arr) { - var i = 0; + var i = 0; - while (i < arr.length && arr[i] == null) { - i++; - } + while (i < arr.length && arr[i] == null) { + i++; + } - return arr[i]; + return arr[i]; } var Scale = - /** @class */ - function () { - function Scale(setting) { - this._setting = setting || {}; - this._extent = [Infinity, -Infinity]; - } + /** @class */ + function () { + function Scale(setting) { + this._setting = setting || {}; + this._extent = [Infinity, -Infinity]; + } + + Scale.prototype.getSetting = function (name) { + return this._setting[name]; + }; + /** + * Set extent from data + */ - Scale.prototype.getSetting = function (name) { - return this._setting[name]; - }; - /** - * Set extent from data - */ + Scale.prototype.unionExtent = function (other) { + var extent = this._extent; + other[0] < extent[0] && (extent[0] = other[0]); + other[1] > extent[1] && (extent[1] = other[1]); // not setExtent because in log axis it may transformed to power + // this.setExtent(extent[0], extent[1]); + }; + /** + * Set extent from data + */ - Scale.prototype.unionExtent = function (other) { - var extent = this._extent; - other[0] < extent[0] && (extent[0] = other[0]); - other[1] > extent[1] && (extent[1] = other[1]); // not setExtent because in log axis it may transformed to power - // this.setExtent(extent[0], extent[1]); - }; - /** - * Set extent from data - */ + Scale.prototype.unionExtentFromData = function (data, dim) { + this.unionExtent(data.getApproximateExtent(dim)); + }; + /** + * Get extent + * + * Extent is always in increase order. + */ - Scale.prototype.unionExtentFromData = function (data, dim) { - this.unionExtent(data.getApproximateExtent(dim)); - }; - /** - * Get extent - * - * Extent is always in increase order. - */ + Scale.prototype.getExtent = function () { + return this._extent.slice(); + }; + /** + * Set extent + */ - Scale.prototype.getExtent = function () { - return this._extent.slice(); - }; - /** - * Set extent - */ + Scale.prototype.setExtent = function (start, end) { + var thisExtent = this._extent; - Scale.prototype.setExtent = function (start, end) { - var thisExtent = this._extent; + if (!isNaN(start)) { + thisExtent[0] = start; + } - if (!isNaN(start)) { - thisExtent[0] = start; - } - - if (!isNaN(end)) { - thisExtent[1] = end; - } - }; - /** - * If value is in extent range - */ + if (!isNaN(end)) { + thisExtent[1] = end; + } + }; + /** + * If value is in extent range + */ - Scale.prototype.isInExtentRange = function (value) { - return this._extent[0] <= value && this._extent[1] >= value; - }; - /** - * When axis extent depends on data and no data exists, - * axis ticks should not be drawn, which is named 'blank'. - */ + Scale.prototype.isInExtentRange = function (value) { + return this._extent[0] <= value && this._extent[1] >= value; + }; + /** + * When axis extent depends on data and no data exists, + * axis ticks should not be drawn, which is named 'blank'. + */ - Scale.prototype.isBlank = function () { - return this._isBlank; - }; - /** - * When axis extent depends on data and no data exists, - * axis ticks should not be drawn, which is named 'blank'. - */ + Scale.prototype.isBlank = function () { + return this._isBlank; + }; + /** + * When axis extent depends on data and no data exists, + * axis ticks should not be drawn, which is named 'blank'. + */ - Scale.prototype.setBlank = function (isBlank) { - this._isBlank = isBlank; - }; + Scale.prototype.setBlank = function (isBlank) { + this._isBlank = isBlank; + }; - return Scale; - }(); + return Scale; + }(); enableClassManagement(Scale); var uidBase = 0; var OrdinalMeta = - /** @class */ - function () { - function OrdinalMeta(opt) { - this.categories = opt.categories || []; - this._needCollect = opt.needCollect; - this._deduplication = opt.deduplication; - this.uid = ++uidBase; - } - - OrdinalMeta.createByAxisModel = function (axisModel) { - var option = axisModel.option; - var data = option.data; - var categories = data && map(data, getName); - return new OrdinalMeta({ - categories: categories, - needCollect: !categories, - // deduplication is default in axis. - deduplication: option.dedplication !== false - }); - }; + /** @class */ + function () { + function OrdinalMeta(opt) { + this.categories = opt.categories || []; + this._needCollect = opt.needCollect; + this._deduplication = opt.deduplication; + this.uid = ++uidBase; + } + + OrdinalMeta.createByAxisModel = function (axisModel) { + var option = axisModel.option; + var data = option.data; + var categories = data && map(data, getName); + return new OrdinalMeta({ + categories: categories, + needCollect: !categories, + // deduplication is default in axis. + deduplication: option.dedplication !== false + }); + }; - OrdinalMeta.prototype.getOrdinal = function (category) { - // @ts-ignore - return this._getOrCreateMap().get(category); - }; - /** - * @return The ordinal. If not found, return NaN. - */ + OrdinalMeta.prototype.getOrdinal = function (category) { + // @ts-ignore + return this._getOrCreateMap().get(category); + }; + /** + * @return The ordinal. If not found, return NaN. + */ - OrdinalMeta.prototype.parseAndCollect = function (category) { - var index; - var needCollect = this._needCollect; // The value of category dim can be the index of the given category set. - // This feature is only supported when !needCollect, because we should - // consider a common case: a value is 2017, which is a number but is - // expected to be tread as a category. This case usually happen in dataset, - // where it happent to be no need of the index feature. + OrdinalMeta.prototype.parseAndCollect = function (category) { + var index; + var needCollect = this._needCollect; // The value of category dim can be the index of the given category set. + // This feature is only supported when !needCollect, because we should + // consider a common case: a value is 2017, which is a number but is + // expected to be tread as a category. This case usually happen in dataset, + // where it happent to be no need of the index feature. - if (!isString(category) && !needCollect) { - return category; - } // Optimize for the scenario: - // category is ['2012-01-01', '2012-01-02', ...], where the input - // data has been ensured not duplicate and is large data. - // Notice, if a dataset dimension provide categroies, usually echarts - // should remove duplication except user tell echarts dont do that - // (set axis.deduplication = false), because echarts do not know whether - // the values in the category dimension has duplication (consider the - // parallel-aqi example) + if (!isString(category) && !needCollect) { + return category; + } // Optimize for the scenario: + // category is ['2012-01-01', '2012-01-02', ...], where the input + // data has been ensured not duplicate and is large data. + // Notice, if a dataset dimension provide categroies, usually echarts + // should remove duplication except user tell echarts dont do that + // (set axis.deduplication = false), because echarts do not know whether + // the values in the category dimension has duplication (consider the + // parallel-aqi example) - if (needCollect && !this._deduplication) { - index = this.categories.length; - this.categories[index] = category; - return index; - } + if (needCollect && !this._deduplication) { + index = this.categories.length; + this.categories[index] = category; + return index; + } - var map = this._getOrCreateMap(); // @ts-ignore + var map = this._getOrCreateMap(); // @ts-ignore - index = map.get(category); + index = map.get(category); - if (index == null) { - if (needCollect) { - index = this.categories.length; - this.categories[index] = category; // @ts-ignore + if (index == null) { + if (needCollect) { + index = this.categories.length; + this.categories[index] = category; // @ts-ignore - map.set(category, index); - } else { - index = NaN; - } - } + map.set(category, index); + } else { + index = NaN; + } + } - return index; - }; // Consider big data, do not create map until needed. + return index; + }; // Consider big data, do not create map until needed. - OrdinalMeta.prototype._getOrCreateMap = function () { - return this._map || (this._map = createHashMap(this.categories)); - }; + OrdinalMeta.prototype._getOrCreateMap = function () { + return this._map || (this._map = createHashMap(this.categories)); + }; - return OrdinalMeta; - }(); + return OrdinalMeta; + }(); function getName(obj) { - if (isObject(obj) && obj.value != null) { - return obj.value; - } else { - return obj + ''; - } + if (isObject(obj) && obj.value != null) { + return obj.value; + } else { + return obj + ''; + } } function isValueNice(val) { - var exp10 = Math.pow(10, quantityExponent(Math.abs(val))); - var f = Math.abs(val / exp10); - return f === 0 || f === 1 || f === 2 || f === 3 || f === 5; + var exp10 = Math.pow(10, quantityExponent(Math.abs(val))); + var f = Math.abs(val / exp10); + return f === 0 || f === 1 || f === 2 || f === 3 || f === 5; } function isIntervalOrLogScale(scale) { - return scale.type === 'interval' || scale.type === 'log'; + return scale.type === 'interval' || scale.type === 'log'; } /** * @param extent Both extent[0] and extent[1] should be valid number. @@ -33346,543 +33346,543 @@ */ function intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval) { - var result = {}; - var span = extent[1] - extent[0]; - var interval = result.interval = nice(span / splitNumber, true); + var result = {}; + var span = extent[1] - extent[0]; + var interval = result.interval = nice(span / splitNumber, true); - if (minInterval != null && interval < minInterval) { - interval = result.interval = minInterval; - } + if (minInterval != null && interval < minInterval) { + interval = result.interval = minInterval; + } - if (maxInterval != null && interval > maxInterval) { - interval = result.interval = maxInterval; - } // Tow more digital for tick. + if (maxInterval != null && interval > maxInterval) { + interval = result.interval = maxInterval; + } // Tow more digital for tick. - var precision = result.intervalPrecision = getIntervalPrecision(interval); // Niced extent inside original extent + var precision = result.intervalPrecision = getIntervalPrecision(interval); // Niced extent inside original extent - var niceTickExtent = result.niceTickExtent = [round(Math.ceil(extent[0] / interval) * interval, precision), round(Math.floor(extent[1] / interval) * interval, precision)]; - fixExtent(niceTickExtent, extent); - return result; + var niceTickExtent = result.niceTickExtent = [round(Math.ceil(extent[0] / interval) * interval, precision), round(Math.floor(extent[1] / interval) * interval, precision)]; + fixExtent(niceTickExtent, extent); + return result; } function increaseInterval(interval) { - var exp10 = Math.pow(10, quantityExponent(interval)); // Increase interval + var exp10 = Math.pow(10, quantityExponent(interval)); // Increase interval - var f = interval / exp10; + var f = interval / exp10; - if (!f) { - f = 1; - } else if (f === 2) { - f = 3; - } else if (f === 3) { - f = 5; - } else { - // f is 1 or 5 - f *= 2; - } + if (!f) { + f = 1; + } else if (f === 2) { + f = 3; + } else if (f === 3) { + f = 5; + } else { + // f is 1 or 5 + f *= 2; + } - return round(f * exp10); + return round(f * exp10); } /** * @return interval precision */ function getIntervalPrecision(interval) { - // Tow more digital for tick. - return getPrecision(interval) + 2; + // Tow more digital for tick. + return getPrecision(interval) + 2; } function clamp(niceTickExtent, idx, extent) { - niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]); + niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]); } // In some cases (e.g., splitNumber is 1), niceTickExtent may be out of extent. function fixExtent(niceTickExtent, extent) { - !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]); - !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]); - clamp(niceTickExtent, 0, extent); - clamp(niceTickExtent, 1, extent); + !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]); + !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]); + clamp(niceTickExtent, 0, extent); + clamp(niceTickExtent, 1, extent); - if (niceTickExtent[0] > niceTickExtent[1]) { - niceTickExtent[0] = niceTickExtent[1]; - } + if (niceTickExtent[0] > niceTickExtent[1]) { + niceTickExtent[0] = niceTickExtent[1]; + } } function contain$1(val, extent) { - return val >= extent[0] && val <= extent[1]; + return val >= extent[0] && val <= extent[1]; } function normalize$1(val, extent) { - if (extent[1] === extent[0]) { - return 0.5; - } + if (extent[1] === extent[0]) { + return 0.5; + } - return (val - extent[0]) / (extent[1] - extent[0]); + return (val - extent[0]) / (extent[1] - extent[0]); } function scale$2(val, extent) { - return val * (extent[1] - extent[0]) + extent[0]; + return val * (extent[1] - extent[0]) + extent[0]; } var OrdinalScale = - /** @class */ - function (_super) { - __extends(OrdinalScale, _super); - - function OrdinalScale(setting) { - var _this = _super.call(this, setting) || this; + /** @class */ + function (_super) { + __extends(OrdinalScale, _super); - _this.type = 'ordinal'; + function OrdinalScale(setting) { + var _this = _super.call(this, setting) || this; - var ordinalMeta = _this.getSetting('ordinalMeta'); // Caution: Should not use instanceof, consider ec-extensions using - // import approach to get OrdinalMeta class. - - - if (!ordinalMeta) { - ordinalMeta = new OrdinalMeta({}); - } - - if (isArray(ordinalMeta)) { - ordinalMeta = new OrdinalMeta({ - categories: map(ordinalMeta, function (item) { - return isObject(item) ? item.value : item; - }) - }); - } - - _this._ordinalMeta = ordinalMeta; - _this._extent = _this.getSetting('extent') || [0, ordinalMeta.categories.length - 1]; - return _this; - } - - OrdinalScale.prototype.parse = function (val) { - // Caution: Math.round(null) will return `0` rather than `NaN` - if (val == null) { - return NaN; - } - - return isString(val) ? this._ordinalMeta.getOrdinal(val) // val might be float. - : Math.round(val); - }; - - OrdinalScale.prototype.contain = function (rank) { - rank = this.parse(rank); - return contain$1(rank, this._extent) && this._ordinalMeta.categories[rank] != null; - }; - /** - * Normalize given rank or name to linear [0, 1] - * @param val raw ordinal number. - * @return normalized value in [0, 1]. - */ + _this.type = 'ordinal'; + var ordinalMeta = _this.getSetting('ordinalMeta'); // Caution: Should not use instanceof, consider ec-extensions using + // import approach to get OrdinalMeta class. - OrdinalScale.prototype.normalize = function (val) { - val = this._getTickNumber(this.parse(val)); - return normalize$1(val, this._extent); - }; - /** - * @param val normalized value in [0, 1]. - * @return raw ordinal number. - */ + if (!ordinalMeta) { + ordinalMeta = new OrdinalMeta({}); + } - OrdinalScale.prototype.scale = function (val) { - val = Math.round(scale$2(val, this._extent)); - return this.getRawOrdinalNumber(val); - }; + if (isArray(ordinalMeta)) { + ordinalMeta = new OrdinalMeta({ + categories: map(ordinalMeta, function (item) { + return isObject(item) ? item.value : item; + }) + }); + } - OrdinalScale.prototype.getTicks = function () { - var ticks = []; - var extent = this._extent; - var rank = extent[0]; + _this._ordinalMeta = ordinalMeta; + _this._extent = _this.getSetting('extent') || [0, ordinalMeta.categories.length - 1]; + return _this; + } - while (rank <= extent[1]) { - ticks.push({ - value: rank - }); - rank++; - } + OrdinalScale.prototype.parse = function (val) { + // Caution: Math.round(null) will return `0` rather than `NaN` + if (val == null) { + return NaN; + } - return ticks; - }; + return isString(val) ? this._ordinalMeta.getOrdinal(val) // val might be float. + : Math.round(val); + }; - OrdinalScale.prototype.getMinorTicks = function (splitNumber) { - // Not support. - return; - }; - /** - * @see `Ordinal['_ordinalNumbersByTick']` - */ + OrdinalScale.prototype.contain = function (rank) { + rank = this.parse(rank); + return contain$1(rank, this._extent) && this._ordinalMeta.categories[rank] != null; + }; + /** + * Normalize given rank or name to linear [0, 1] + * @param val raw ordinal number. + * @return normalized value in [0, 1]. + */ - OrdinalScale.prototype.setSortInfo = function (info) { - if (info == null) { - this._ordinalNumbersByTick = this._ticksByOrdinalNumber = null; - return; - } + OrdinalScale.prototype.normalize = function (val) { + val = this._getTickNumber(this.parse(val)); + return normalize$1(val, this._extent); + }; + /** + * @param val normalized value in [0, 1]. + * @return raw ordinal number. + */ - var infoOrdinalNumbers = info.ordinalNumbers; - var ordinalsByTick = this._ordinalNumbersByTick = []; - var ticksByOrdinal = this._ticksByOrdinalNumber = []; // Unnecessary support negative tick in `realtimeSort`. - var tickNum = 0; - var allCategoryLen = this._ordinalMeta.categories.length; + OrdinalScale.prototype.scale = function (val) { + val = Math.round(scale$2(val, this._extent)); + return this.getRawOrdinalNumber(val); + }; - for (var len = Math.min(allCategoryLen, infoOrdinalNumbers.length); tickNum < len; ++tickNum) { - var ordinalNumber = infoOrdinalNumbers[tickNum]; - ordinalsByTick[tickNum] = ordinalNumber; - ticksByOrdinal[ordinalNumber] = tickNum; - } // Handle that `series.data` only covers part of the `axis.category.data`. + OrdinalScale.prototype.getTicks = function () { + var ticks = []; + var extent = this._extent; + var rank = extent[0]; + while (rank <= extent[1]) { + ticks.push({ + value: rank + }); + rank++; + } - var unusedOrdinal = 0; + return ticks; + }; - for (; tickNum < allCategoryLen; ++tickNum) { - while (ticksByOrdinal[unusedOrdinal] != null) { - unusedOrdinal++; - } - ordinalsByTick.push(unusedOrdinal); - ticksByOrdinal[unusedOrdinal] = tickNum; - } - }; + OrdinalScale.prototype.getMinorTicks = function (splitNumber) { + // Not support. + return; + }; + /** + * @see `Ordinal['_ordinalNumbersByTick']` + */ - OrdinalScale.prototype._getTickNumber = function (ordinal) { - var ticksByOrdinalNumber = this._ticksByOrdinalNumber; // also support ordinal out of range of `ordinalMeta.categories.length`, - // where ordinal numbers are used as tick value directly. - return ticksByOrdinalNumber && ordinal >= 0 && ordinal < ticksByOrdinalNumber.length ? ticksByOrdinalNumber[ordinal] : ordinal; - }; - /** - * @usage - * ```js - * const ordinalNumber = ordinalScale.getRawOrdinalNumber(tickVal); - * - * // case0 - * const rawOrdinalValue = axisModel.getCategories()[ordinalNumber]; - * // case1 - * const rawOrdinalValue = this._ordinalMeta.categories[ordinalNumber]; - * // case2 - * const coord = axis.dataToCoord(ordinalNumber); - * ``` - * - * @param {OrdinalNumber} tickNumber index of display - */ + OrdinalScale.prototype.setSortInfo = function (info) { + if (info == null) { + this._ordinalNumbersByTick = this._ticksByOrdinalNumber = null; + return; + } + + var infoOrdinalNumbers = info.ordinalNumbers; + var ordinalsByTick = this._ordinalNumbersByTick = []; + var ticksByOrdinal = this._ticksByOrdinalNumber = []; // Unnecessary support negative tick in `realtimeSort`. + + var tickNum = 0; + var allCategoryLen = this._ordinalMeta.categories.length; + + for (var len = Math.min(allCategoryLen, infoOrdinalNumbers.length); tickNum < len; ++tickNum) { + var ordinalNumber = infoOrdinalNumbers[tickNum]; + ordinalsByTick[tickNum] = ordinalNumber; + ticksByOrdinal[ordinalNumber] = tickNum; + } // Handle that `series.data` only covers part of the `axis.category.data`. + + + var unusedOrdinal = 0; + + for (; tickNum < allCategoryLen; ++tickNum) { + while (ticksByOrdinal[unusedOrdinal] != null) { + unusedOrdinal++; + } + ordinalsByTick.push(unusedOrdinal); + ticksByOrdinal[unusedOrdinal] = tickNum; + } + }; + + OrdinalScale.prototype._getTickNumber = function (ordinal) { + var ticksByOrdinalNumber = this._ticksByOrdinalNumber; // also support ordinal out of range of `ordinalMeta.categories.length`, + // where ordinal numbers are used as tick value directly. + + return ticksByOrdinalNumber && ordinal >= 0 && ordinal < ticksByOrdinalNumber.length ? ticksByOrdinalNumber[ordinal] : ordinal; + }; + /** + * @usage + * ```js + * const ordinalNumber = ordinalScale.getRawOrdinalNumber(tickVal); + * + * // case0 + * const rawOrdinalValue = axisModel.getCategories()[ordinalNumber]; + * // case1 + * const rawOrdinalValue = this._ordinalMeta.categories[ordinalNumber]; + * // case2 + * const coord = axis.dataToCoord(ordinalNumber); + * ``` + * + * @param {OrdinalNumber} tickNumber index of display + */ - OrdinalScale.prototype.getRawOrdinalNumber = function (tickNumber) { - var ordinalNumbersByTick = this._ordinalNumbersByTick; // tickNumber may be out of range, e.g., when axis max is larger than `ordinalMeta.categories.length`., - // where ordinal numbers are used as tick value directly. + OrdinalScale.prototype.getRawOrdinalNumber = function (tickNumber) { + var ordinalNumbersByTick = this._ordinalNumbersByTick; // tickNumber may be out of range, e.g., when axis max is larger than `ordinalMeta.categories.length`., + // where ordinal numbers are used as tick value directly. - return ordinalNumbersByTick && tickNumber >= 0 && tickNumber < ordinalNumbersByTick.length ? ordinalNumbersByTick[tickNumber] : tickNumber; - }; - /** - * Get item on tick - */ + return ordinalNumbersByTick && tickNumber >= 0 && tickNumber < ordinalNumbersByTick.length ? ordinalNumbersByTick[tickNumber] : tickNumber; + }; + /** + * Get item on tick + */ - OrdinalScale.prototype.getLabel = function (tick) { - if (!this.isBlank()) { - var ordinalNumber = this.getRawOrdinalNumber(tick.value); - var cateogry = this._ordinalMeta.categories[ordinalNumber]; // Note that if no data, ordinalMeta.categories is an empty array. - // Return empty if it's not exist. + OrdinalScale.prototype.getLabel = function (tick) { + if (!this.isBlank()) { + var ordinalNumber = this.getRawOrdinalNumber(tick.value); + var cateogry = this._ordinalMeta.categories[ordinalNumber]; // Note that if no data, ordinalMeta.categories is an empty array. + // Return empty if it's not exist. - return cateogry == null ? '' : cateogry + ''; - } - }; + return cateogry == null ? '' : cateogry + ''; + } + }; - OrdinalScale.prototype.count = function () { - return this._extent[1] - this._extent[0] + 1; - }; + OrdinalScale.prototype.count = function () { + return this._extent[1] - this._extent[0] + 1; + }; - OrdinalScale.prototype.unionExtentFromData = function (data, dim) { - this.unionExtent(data.getApproximateExtent(dim)); - }; - /** - * @override - * If value is in extent range - */ + OrdinalScale.prototype.unionExtentFromData = function (data, dim) { + this.unionExtent(data.getApproximateExtent(dim)); + }; + /** + * @override + * If value is in extent range + */ - OrdinalScale.prototype.isInExtentRange = function (value) { - value = this._getTickNumber(value); - return this._extent[0] <= value && this._extent[1] >= value; - }; + OrdinalScale.prototype.isInExtentRange = function (value) { + value = this._getTickNumber(value); + return this._extent[0] <= value && this._extent[1] >= value; + }; - OrdinalScale.prototype.getOrdinalMeta = function () { - return this._ordinalMeta; - }; + OrdinalScale.prototype.getOrdinalMeta = function () { + return this._ordinalMeta; + }; - OrdinalScale.prototype.calcNiceTicks = function () {}; + OrdinalScale.prototype.calcNiceTicks = function () {}; - OrdinalScale.prototype.calcNiceExtent = function () {}; + OrdinalScale.prototype.calcNiceExtent = function () {}; - OrdinalScale.type = 'ordinal'; - return OrdinalScale; - }(Scale); + OrdinalScale.type = 'ordinal'; + return OrdinalScale; + }(Scale); Scale.registerClass(OrdinalScale); var roundNumber = round; var IntervalScale = - /** @class */ - function (_super) { - __extends(IntervalScale, _super); + /** @class */ + function (_super) { + __extends(IntervalScale, _super); - function IntervalScale() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function IntervalScale() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = 'interval'; // Step is calculated in adjustExtent. + _this.type = 'interval'; // Step is calculated in adjustExtent. - _this._interval = 0; - _this._intervalPrecision = 2; - return _this; - } + _this._interval = 0; + _this._intervalPrecision = 2; + return _this; + } - IntervalScale.prototype.parse = function (val) { - return val; - }; + IntervalScale.prototype.parse = function (val) { + return val; + }; - IntervalScale.prototype.contain = function (val) { - return contain$1(val, this._extent); - }; + IntervalScale.prototype.contain = function (val) { + return contain$1(val, this._extent); + }; - IntervalScale.prototype.normalize = function (val) { - return normalize$1(val, this._extent); - }; + IntervalScale.prototype.normalize = function (val) { + return normalize$1(val, this._extent); + }; - IntervalScale.prototype.scale = function (val) { - return scale$2(val, this._extent); - }; + IntervalScale.prototype.scale = function (val) { + return scale$2(val, this._extent); + }; - IntervalScale.prototype.setExtent = function (start, end) { - var thisExtent = this._extent; // start,end may be a Number like '25',so... + IntervalScale.prototype.setExtent = function (start, end) { + var thisExtent = this._extent; // start,end may be a Number like '25',so... - if (!isNaN(start)) { - thisExtent[0] = parseFloat(start); - } + if (!isNaN(start)) { + thisExtent[0] = parseFloat(start); + } - if (!isNaN(end)) { - thisExtent[1] = parseFloat(end); - } - }; + if (!isNaN(end)) { + thisExtent[1] = parseFloat(end); + } + }; - IntervalScale.prototype.unionExtent = function (other) { - var extent = this._extent; - other[0] < extent[0] && (extent[0] = other[0]); - other[1] > extent[1] && (extent[1] = other[1]); // unionExtent may called by it's sub classes + IntervalScale.prototype.unionExtent = function (other) { + var extent = this._extent; + other[0] < extent[0] && (extent[0] = other[0]); + other[1] > extent[1] && (extent[1] = other[1]); // unionExtent may called by it's sub classes - this.setExtent(extent[0], extent[1]); - }; + this.setExtent(extent[0], extent[1]); + }; - IntervalScale.prototype.getInterval = function () { - return this._interval; - }; + IntervalScale.prototype.getInterval = function () { + return this._interval; + }; - IntervalScale.prototype.setInterval = function (interval) { - this._interval = interval; // Dropped auto calculated niceExtent and use user setted extent - // We assume user wan't to set both interval, min, max to get a better result + IntervalScale.prototype.setInterval = function (interval) { + this._interval = interval; // Dropped auto calculated niceExtent and use user setted extent + // We assume user wan't to set both interval, min, max to get a better result - this._niceExtent = this._extent.slice(); - this._intervalPrecision = getIntervalPrecision(interval); - }; - /** - * @param expandToNicedExtent Whether expand the ticks to niced extent. - */ + this._niceExtent = this._extent.slice(); + this._intervalPrecision = getIntervalPrecision(interval); + }; + /** + * @param expandToNicedExtent Whether expand the ticks to niced extent. + */ - IntervalScale.prototype.getTicks = function (expandToNicedExtent) { - var interval = this._interval; - var extent = this._extent; - var niceTickExtent = this._niceExtent; - var intervalPrecision = this._intervalPrecision; - var ticks = []; // If interval is 0, return []; + IntervalScale.prototype.getTicks = function (expandToNicedExtent) { + var interval = this._interval; + var extent = this._extent; + var niceTickExtent = this._niceExtent; + var intervalPrecision = this._intervalPrecision; + var ticks = []; // If interval is 0, return []; - if (!interval) { - return ticks; - } // Consider this case: using dataZoom toolbox, zoom and zoom. + if (!interval) { + return ticks; + } // Consider this case: using dataZoom toolbox, zoom and zoom. - var safeLimit = 10000; + var safeLimit = 10000; - if (extent[0] < niceTickExtent[0]) { - if (expandToNicedExtent) { - ticks.push({ - value: roundNumber(niceTickExtent[0] - interval, intervalPrecision) - }); - } else { - ticks.push({ - value: extent[0] - }); - } - } + if (extent[0] < niceTickExtent[0]) { + if (expandToNicedExtent) { + ticks.push({ + value: roundNumber(niceTickExtent[0] - interval, intervalPrecision) + }); + } else { + ticks.push({ + value: extent[0] + }); + } + } - var tick = niceTickExtent[0]; + var tick = niceTickExtent[0]; - while (tick <= niceTickExtent[1]) { - ticks.push({ - value: tick - }); // Avoid rounding error + while (tick <= niceTickExtent[1]) { + ticks.push({ + value: tick + }); // Avoid rounding error - tick = roundNumber(tick + interval, intervalPrecision); + tick = roundNumber(tick + interval, intervalPrecision); - if (tick === ticks[ticks.length - 1].value) { - // Consider out of safe float point, e.g., - // -3711126.9907707 + 2e-10 === -3711126.9907707 - break; - } + if (tick === ticks[ticks.length - 1].value) { + // Consider out of safe float point, e.g., + // -3711126.9907707 + 2e-10 === -3711126.9907707 + break; + } - if (ticks.length > safeLimit) { - return []; - } - } // Consider this case: the last item of ticks is smaller - // than niceTickExtent[1] and niceTickExtent[1] === extent[1]. + if (ticks.length > safeLimit) { + return []; + } + } // Consider this case: the last item of ticks is smaller + // than niceTickExtent[1] and niceTickExtent[1] === extent[1]. - var lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1]; + var lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1]; - if (extent[1] > lastNiceTick) { - if (expandToNicedExtent) { - ticks.push({ - value: roundNumber(lastNiceTick + interval, intervalPrecision) - }); - } else { - ticks.push({ - value: extent[1] - }); - } - } + if (extent[1] > lastNiceTick) { + if (expandToNicedExtent) { + ticks.push({ + value: roundNumber(lastNiceTick + interval, intervalPrecision) + }); + } else { + ticks.push({ + value: extent[1] + }); + } + } - return ticks; - }; + return ticks; + }; - IntervalScale.prototype.getMinorTicks = function (splitNumber) { - var ticks = this.getTicks(true); - var minorTicks = []; - var extent = this.getExtent(); + IntervalScale.prototype.getMinorTicks = function (splitNumber) { + var ticks = this.getTicks(true); + var minorTicks = []; + var extent = this.getExtent(); - for (var i = 1; i < ticks.length; i++) { - var nextTick = ticks[i]; - var prevTick = ticks[i - 1]; - var count = 0; - var minorTicksGroup = []; - var interval = nextTick.value - prevTick.value; - var minorInterval = interval / splitNumber; + for (var i = 1; i < ticks.length; i++) { + var nextTick = ticks[i]; + var prevTick = ticks[i - 1]; + var count = 0; + var minorTicksGroup = []; + var interval = nextTick.value - prevTick.value; + var minorInterval = interval / splitNumber; - while (count < splitNumber - 1) { - var minorTick = roundNumber(prevTick.value + (count + 1) * minorInterval); // For the first and last interval. The count may be less than splitNumber. + while (count < splitNumber - 1) { + var minorTick = roundNumber(prevTick.value + (count + 1) * minorInterval); // For the first and last interval. The count may be less than splitNumber. - if (minorTick > extent[0] && minorTick < extent[1]) { - minorTicksGroup.push(minorTick); - } + if (minorTick > extent[0] && minorTick < extent[1]) { + minorTicksGroup.push(minorTick); + } - count++; - } + count++; + } - minorTicks.push(minorTicksGroup); - } + minorTicks.push(minorTicksGroup); + } - return minorTicks; - }; - /** - * @param opt.precision If 'auto', use nice presision. - * @param opt.pad returns 1.50 but not 1.5 if precision is 2. - */ + return minorTicks; + }; + /** + * @param opt.precision If 'auto', use nice presision. + * @param opt.pad returns 1.50 but not 1.5 if precision is 2. + */ - IntervalScale.prototype.getLabel = function (data, opt) { - if (data == null) { - return ''; - } + IntervalScale.prototype.getLabel = function (data, opt) { + if (data == null) { + return ''; + } - var precision = opt && opt.precision; + var precision = opt && opt.precision; - if (precision == null) { - precision = getPrecision(data.value) || 0; - } else if (precision === 'auto') { - // Should be more precise then tick. - precision = this._intervalPrecision; - } // (1) If `precision` is set, 12.005 should be display as '12.00500'. - // (2) Use roundNumber (toFixed) to avoid scientific notation like '3.5e-7'. + if (precision == null) { + precision = getPrecision(data.value) || 0; + } else if (precision === 'auto') { + // Should be more precise then tick. + precision = this._intervalPrecision; + } // (1) If `precision` is set, 12.005 should be display as '12.00500'. + // (2) Use roundNumber (toFixed) to avoid scientific notation like '3.5e-7'. + + + var dataNum = roundNumber(data.value, precision, true); + return addCommas(dataNum); + }; + /** + * @param splitNumber By default `5`. + */ - var dataNum = roundNumber(data.value, precision, true); - return addCommas(dataNum); - }; - /** - * @param splitNumber By default `5`. - */ + IntervalScale.prototype.calcNiceTicks = function (splitNumber, minInterval, maxInterval) { + splitNumber = splitNumber || 5; + var extent = this._extent; + var span = extent[1] - extent[0]; + if (!isFinite(span)) { + return; + } // User may set axis min 0 and data are all negative + // FIXME If it needs to reverse ? - IntervalScale.prototype.calcNiceTicks = function (splitNumber, minInterval, maxInterval) { - splitNumber = splitNumber || 5; - var extent = this._extent; - var span = extent[1] - extent[0]; - if (!isFinite(span)) { - return; - } // User may set axis min 0 and data are all negative - // FIXME If it needs to reverse ? + if (span < 0) { + span = -span; + extent.reverse(); + } + var result = intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval); + this._intervalPrecision = result.intervalPrecision; + this._interval = result.interval; + this._niceExtent = result.niceTickExtent; + }; - if (span < 0) { - span = -span; - extent.reverse(); - } + IntervalScale.prototype.calcNiceExtent = function (opt) { + var extent = this._extent; // If extent start and end are same, expand them - var result = intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval); - this._intervalPrecision = result.intervalPrecision; - this._interval = result.interval; - this._niceExtent = result.niceTickExtent; - }; + if (extent[0] === extent[1]) { + if (extent[0] !== 0) { + // Expand extent + var expandSize = extent[0]; // In the fowllowing case + // Axis has been fixed max 100 + // Plus data are all 100 and axis extent are [100, 100]. + // Extend to the both side will cause expanded max is larger than fixed max. + // So only expand to the smaller side. - IntervalScale.prototype.calcNiceExtent = function (opt) { - var extent = this._extent; // If extent start and end are same, expand them - - if (extent[0] === extent[1]) { - if (extent[0] !== 0) { - // Expand extent - var expandSize = extent[0]; // In the fowllowing case - // Axis has been fixed max 100 - // Plus data are all 100 and axis extent are [100, 100]. - // Extend to the both side will cause expanded max is larger than fixed max. - // So only expand to the smaller side. - - if (!opt.fixMax) { - extent[1] += expandSize / 2; - extent[0] -= expandSize / 2; - } else { - extent[0] -= expandSize / 2; - } - } else { - extent[1] = 1; - } - } + if (!opt.fixMax) { + extent[1] += expandSize / 2; + extent[0] -= expandSize / 2; + } else { + extent[0] -= expandSize / 2; + } + } else { + extent[1] = 1; + } + } - var span = extent[1] - extent[0]; // If there are no data and extent are [Infinity, -Infinity] + var span = extent[1] - extent[0]; // If there are no data and extent are [Infinity, -Infinity] - if (!isFinite(span)) { - extent[0] = 0; - extent[1] = 1; - } + if (!isFinite(span)) { + extent[0] = 0; + extent[1] = 1; + } - this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval); // let extent = this._extent; + this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval); // let extent = this._extent; - var interval = this._interval; + var interval = this._interval; - if (!opt.fixMin) { - extent[0] = roundNumber(Math.floor(extent[0] / interval) * interval); - } + if (!opt.fixMin) { + extent[0] = roundNumber(Math.floor(extent[0] / interval) * interval); + } - if (!opt.fixMax) { - extent[1] = roundNumber(Math.ceil(extent[1] / interval) * interval); - } - }; + if (!opt.fixMax) { + extent[1] = roundNumber(Math.ceil(extent[1] / interval) * interval); + } + }; - IntervalScale.prototype.setNiceExtent = function (min, max) { - this._niceExtent = [min, max]; - }; + IntervalScale.prototype.setNiceExtent = function (min, max) { + this._niceExtent = [min, max]; + }; - IntervalScale.type = 'interval'; - return IntervalScale; - }(Scale); + IntervalScale.type = 'interval'; + return IntervalScale; + }(Scale); Scale.registerClass(IntervalScale); @@ -33891,23 +33891,23 @@ var supportFloat32Array = typeof Float32Array !== 'undefined'; var Float32ArrayCtor = !supportFloat32Array ? Array : Float32Array; function createFloat32Array(arg) { - if (isArray(arg)) { - // Return self directly if don't support TypedArray. - return supportFloat32Array ? new Float32Array(arg) : arg; - } // Else is number + if (isArray(arg)) { + // Return self directly if don't support TypedArray. + return supportFloat32Array ? new Float32Array(arg) : arg; + } // Else is number - return new Float32ArrayCtor(arg); + return new Float32ArrayCtor(arg); } var STACK_PREFIX = '__ec_stack_'; function getSeriesStackId(seriesModel) { - return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex; + return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex; } function getAxisKey(axis) { - return axis.dim + axis.index; + return axis.dim + axis.index; } /** * @return {Object} {width, offset, offsetCenter} If axis.type is not 'category', return undefined. @@ -33915,44 +33915,44 @@ function getLayoutOnAxis(opt) { - var params = []; - var baseAxis = opt.axis; - var axisKey = 'axis0'; + var params = []; + var baseAxis = opt.axis; + var axisKey = 'axis0'; - if (baseAxis.type !== 'category') { - return; - } + if (baseAxis.type !== 'category') { + return; + } - var bandWidth = baseAxis.getBandWidth(); + var bandWidth = baseAxis.getBandWidth(); - for (var i = 0; i < opt.count || 0; i++) { - params.push(defaults({ - bandWidth: bandWidth, - axisKey: axisKey, - stackId: STACK_PREFIX + i - }, opt)); - } + for (var i = 0; i < opt.count || 0; i++) { + params.push(defaults({ + bandWidth: bandWidth, + axisKey: axisKey, + stackId: STACK_PREFIX + i + }, opt)); + } - var widthAndOffsets = doCalBarWidthAndOffset(params); - var result = []; + var widthAndOffsets = doCalBarWidthAndOffset(params); + var result = []; - for (var i = 0; i < opt.count; i++) { - var item = widthAndOffsets[axisKey][STACK_PREFIX + i]; - item.offsetCenter = item.offset + item.width / 2; - result.push(item); - } + for (var i = 0; i < opt.count; i++) { + var item = widthAndOffsets[axisKey][STACK_PREFIX + i]; + item.offsetCenter = item.offset + item.width / 2; + result.push(item); + } - return result; + return result; } function prepareLayoutBarSeries(seriesType, ecModel) { - var seriesModels = []; - ecModel.eachSeriesByType(seriesType, function (seriesModel) { - // Check series coordinate, do layout for cartesian2d only - if (isOnCartesian(seriesModel)) { - seriesModels.push(seriesModel); - } - }); - return seriesModels; + var seriesModels = []; + ecModel.eachSeriesByType(seriesType, function (seriesModel) { + // Check series coordinate, do layout for cartesian2d only + if (isOnCartesian(seriesModel)) { + seriesModels.push(seriesModel); + } + }); + return seriesModels; } /** * Map from (baseAxis.dim + '_' + baseAxis.index) to min gap of two adjacent @@ -33964,561 +33964,561 @@ */ function getValueAxesMinGaps(barSeries) { - /** - * Map from axis.index to values. - * For a single time axis, axisValues is in the form like - * {'x_0': [1495555200000, 1495641600000, 1495728000000]}. - * Items in axisValues[x], e.g. 1495555200000, are time values of all - * series. - */ - var axisValues = {}; - each(barSeries, function (seriesModel) { - var cartesian = seriesModel.coordinateSystem; - var baseAxis = cartesian.getBaseAxis(); + /** + * Map from axis.index to values. + * For a single time axis, axisValues is in the form like + * {'x_0': [1495555200000, 1495641600000, 1495728000000]}. + * Items in axisValues[x], e.g. 1495555200000, are time values of all + * series. + */ + var axisValues = {}; + each(barSeries, function (seriesModel) { + var cartesian = seriesModel.coordinateSystem; + var baseAxis = cartesian.getBaseAxis(); - if (baseAxis.type !== 'time' && baseAxis.type !== 'value') { - return; - } + if (baseAxis.type !== 'time' && baseAxis.type !== 'value') { + return; + } - var data = seriesModel.getData(); - var key = baseAxis.dim + '_' + baseAxis.index; - var dimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim)); - var store = data.getStore(); + var data = seriesModel.getData(); + var key = baseAxis.dim + '_' + baseAxis.index; + var dimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim)); + var store = data.getStore(); - for (var i = 0, cnt = store.count(); i < cnt; ++i) { - var value = store.get(dimIdx, i); + for (var i = 0, cnt = store.count(); i < cnt; ++i) { + var value = store.get(dimIdx, i); - if (!axisValues[key]) { - // No previous data for the axis - axisValues[key] = [value]; - } else { - // No value in previous series - axisValues[key].push(value); - } // Ignore duplicated time values in the same axis + if (!axisValues[key]) { + // No previous data for the axis + axisValues[key] = [value]; + } else { + // No value in previous series + axisValues[key].push(value); + } // Ignore duplicated time values in the same axis - } - }); - var axisMinGaps = {}; + } + }); + var axisMinGaps = {}; - for (var key in axisValues) { - if (axisValues.hasOwnProperty(key)) { - var valuesInAxis = axisValues[key]; + for (var key in axisValues) { + if (axisValues.hasOwnProperty(key)) { + var valuesInAxis = axisValues[key]; - if (valuesInAxis) { - // Sort axis values into ascending order to calculate gaps - valuesInAxis.sort(function (a, b) { - return a - b; - }); - var min = null; + if (valuesInAxis) { + // Sort axis values into ascending order to calculate gaps + valuesInAxis.sort(function (a, b) { + return a - b; + }); + var min = null; - for (var j = 1; j < valuesInAxis.length; ++j) { - var delta = valuesInAxis[j] - valuesInAxis[j - 1]; + for (var j = 1; j < valuesInAxis.length; ++j) { + var delta = valuesInAxis[j] - valuesInAxis[j - 1]; - if (delta > 0) { - // Ignore 0 delta because they are of the same axis value - min = min === null ? delta : Math.min(min, delta); - } - } // Set to null if only have one data + if (delta > 0) { + // Ignore 0 delta because they are of the same axis value + min = min === null ? delta : Math.min(min, delta); + } + } // Set to null if only have one data - axisMinGaps[key] = min; - } - } + axisMinGaps[key] = min; + } } + } - return axisMinGaps; + return axisMinGaps; } function makeColumnLayout(barSeries) { - var axisMinGaps = getValueAxesMinGaps(barSeries); - var seriesInfoList = []; - each(barSeries, function (seriesModel) { - var cartesian = seriesModel.coordinateSystem; - var baseAxis = cartesian.getBaseAxis(); - var axisExtent = baseAxis.getExtent(); - var bandWidth; - - if (baseAxis.type === 'category') { - bandWidth = baseAxis.getBandWidth(); - } else if (baseAxis.type === 'value' || baseAxis.type === 'time') { - var key = baseAxis.dim + '_' + baseAxis.index; - var minGap = axisMinGaps[key]; - var extentSpan = Math.abs(axisExtent[1] - axisExtent[0]); - var scale = baseAxis.scale.getExtent(); - var scaleSpan = Math.abs(scale[1] - scale[0]); - bandWidth = minGap ? extentSpan / scaleSpan * minGap : extentSpan; // When there is only one data value - } else { - var data = seriesModel.getData(); - bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count(); - } - - var barWidth = parsePercent$1(seriesModel.get('barWidth'), bandWidth); - var barMaxWidth = parsePercent$1(seriesModel.get('barMaxWidth'), bandWidth); - var barMinWidth = parsePercent$1( // barMinWidth by default is 0.5 / 1 in cartesian. Because in value axis, - // the auto-calculated bar width might be less than 0.5 / 1. - seriesModel.get('barMinWidth') || (isInLargeMode(seriesModel) ? 0.5 : 1), bandWidth); - var barGap = seriesModel.get('barGap'); - var barCategoryGap = seriesModel.get('barCategoryGap'); - seriesInfoList.push({ - bandWidth: bandWidth, - barWidth: barWidth, - barMaxWidth: barMaxWidth, - barMinWidth: barMinWidth, - barGap: barGap, - barCategoryGap: barCategoryGap, - axisKey: getAxisKey(baseAxis), - stackId: getSeriesStackId(seriesModel) - }); + var axisMinGaps = getValueAxesMinGaps(barSeries); + var seriesInfoList = []; + each(barSeries, function (seriesModel) { + var cartesian = seriesModel.coordinateSystem; + var baseAxis = cartesian.getBaseAxis(); + var axisExtent = baseAxis.getExtent(); + var bandWidth; + + if (baseAxis.type === 'category') { + bandWidth = baseAxis.getBandWidth(); + } else if (baseAxis.type === 'value' || baseAxis.type === 'time') { + var key = baseAxis.dim + '_' + baseAxis.index; + var minGap = axisMinGaps[key]; + var extentSpan = Math.abs(axisExtent[1] - axisExtent[0]); + var scale = baseAxis.scale.getExtent(); + var scaleSpan = Math.abs(scale[1] - scale[0]); + bandWidth = minGap ? extentSpan / scaleSpan * minGap : extentSpan; // When there is only one data value + } else { + var data = seriesModel.getData(); + bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count(); + } + + var barWidth = parsePercent$1(seriesModel.get('barWidth'), bandWidth); + var barMaxWidth = parsePercent$1(seriesModel.get('barMaxWidth'), bandWidth); + var barMinWidth = parsePercent$1( // barMinWidth by default is 0.5 / 1 in cartesian. Because in value axis, + // the auto-calculated bar width might be less than 0.5 / 1. + seriesModel.get('barMinWidth') || (isInLargeMode(seriesModel) ? 0.5 : 1), bandWidth); + var barGap = seriesModel.get('barGap'); + var barCategoryGap = seriesModel.get('barCategoryGap'); + seriesInfoList.push({ + bandWidth: bandWidth, + barWidth: barWidth, + barMaxWidth: barMaxWidth, + barMinWidth: barMinWidth, + barGap: barGap, + barCategoryGap: barCategoryGap, + axisKey: getAxisKey(baseAxis), + stackId: getSeriesStackId(seriesModel) }); - return doCalBarWidthAndOffset(seriesInfoList); + }); + return doCalBarWidthAndOffset(seriesInfoList); } function doCalBarWidthAndOffset(seriesInfoList) { - // Columns info on each category axis. Key is cartesian name - var columnsMap = {}; - each(seriesInfoList, function (seriesInfo, idx) { - var axisKey = seriesInfo.axisKey; - var bandWidth = seriesInfo.bandWidth; - var columnsOnAxis = columnsMap[axisKey] || { - bandWidth: bandWidth, - remainedWidth: bandWidth, - autoWidthCount: 0, - categoryGap: null, - gap: '20%', - stacks: {} - }; - var stacks = columnsOnAxis.stacks; - columnsMap[axisKey] = columnsOnAxis; - var stackId = seriesInfo.stackId; - - if (!stacks[stackId]) { - columnsOnAxis.autoWidthCount++; - } - - stacks[stackId] = stacks[stackId] || { - width: 0, - maxWidth: 0 - }; // Caution: In a single coordinate system, these barGrid attributes - // will be shared by series. Consider that they have default values, - // only the attributes set on the last series will work. - // Do not change this fact unless there will be a break change. - - var barWidth = seriesInfo.barWidth; - - if (barWidth && !stacks[stackId].width) { - // See #6312, do not restrict width. - stacks[stackId].width = barWidth; - barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth); - columnsOnAxis.remainedWidth -= barWidth; - } - - var barMaxWidth = seriesInfo.barMaxWidth; - barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth); - var barMinWidth = seriesInfo.barMinWidth; - barMinWidth && (stacks[stackId].minWidth = barMinWidth); - var barGap = seriesInfo.barGap; - barGap != null && (columnsOnAxis.gap = barGap); - var barCategoryGap = seriesInfo.barCategoryGap; - barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap); - }); - var result = {}; - each(columnsMap, function (columnsOnAxis, coordSysName) { - result[coordSysName] = {}; - var stacks = columnsOnAxis.stacks; - var bandWidth = columnsOnAxis.bandWidth; - var categoryGapPercent = columnsOnAxis.categoryGap; - - if (categoryGapPercent == null) { - var columnCount = keys(stacks).length; // More columns in one group - // the spaces between group is smaller. Or the column will be too thin. - - categoryGapPercent = Math.max(35 - columnCount * 4, 15) + '%'; - } - - var categoryGap = parsePercent$1(categoryGapPercent, bandWidth); - var barGapPercent = parsePercent$1(columnsOnAxis.gap, 1); - var remainedWidth = columnsOnAxis.remainedWidth; - var autoWidthCount = columnsOnAxis.autoWidthCount; - var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); - autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth - - each(stacks, function (column) { - var maxWidth = column.maxWidth; - var minWidth = column.minWidth; - - if (!column.width) { - var finalWidth = autoWidth; - - if (maxWidth && maxWidth < finalWidth) { - finalWidth = Math.min(maxWidth, remainedWidth); - } // `minWidth` has higher priority. `minWidth` decide that wheter the - // bar is able to be visible. So `minWidth` should not be restricted - // by `maxWidth` or `remainedWidth` (which is from `bandWidth`). In - // the extreme cases for `value` axis, bars are allowed to overlap - // with each other if `minWidth` specified. - - - if (minWidth && minWidth > finalWidth) { - finalWidth = minWidth; - } - - if (finalWidth !== autoWidth) { - column.width = finalWidth; - remainedWidth -= finalWidth + barGapPercent * finalWidth; - autoWidthCount--; - } - } else { - // `barMinWidth/barMaxWidth` has higher priority than `barWidth`, as - // CSS does. Becuase barWidth can be a percent value, where - // `barMaxWidth` can be used to restrict the final width. - var finalWidth = column.width; - - if (maxWidth) { - finalWidth = Math.min(finalWidth, maxWidth); - } // `minWidth` has higher priority, as described above - - - if (minWidth) { - finalWidth = Math.max(finalWidth, minWidth); - } - - column.width = finalWidth; - remainedWidth -= finalWidth + barGapPercent * finalWidth; - autoWidthCount--; - } - }); // Recalculate width again - - autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); - autoWidth = Math.max(autoWidth, 0); - var widthSum = 0; - var lastColumn; - each(stacks, function (column, idx) { - if (!column.width) { - column.width = autoWidth; - } - - lastColumn = column; - widthSum += column.width * (1 + barGapPercent); - }); + // Columns info on each category axis. Key is cartesian name + var columnsMap = {}; + each(seriesInfoList, function (seriesInfo, idx) { + var axisKey = seriesInfo.axisKey; + var bandWidth = seriesInfo.bandWidth; + var columnsOnAxis = columnsMap[axisKey] || { + bandWidth: bandWidth, + remainedWidth: bandWidth, + autoWidthCount: 0, + categoryGap: null, + gap: '20%', + stacks: {} + }; + var stacks = columnsOnAxis.stacks; + columnsMap[axisKey] = columnsOnAxis; + var stackId = seriesInfo.stackId; + + if (!stacks[stackId]) { + columnsOnAxis.autoWidthCount++; + } + + stacks[stackId] = stacks[stackId] || { + width: 0, + maxWidth: 0 + }; // Caution: In a single coordinate system, these barGrid attributes + // will be shared by series. Consider that they have default values, + // only the attributes set on the last series will work. + // Do not change this fact unless there will be a break change. + + var barWidth = seriesInfo.barWidth; + + if (barWidth && !stacks[stackId].width) { + // See #6312, do not restrict width. + stacks[stackId].width = barWidth; + barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth); + columnsOnAxis.remainedWidth -= barWidth; + } + + var barMaxWidth = seriesInfo.barMaxWidth; + barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth); + var barMinWidth = seriesInfo.barMinWidth; + barMinWidth && (stacks[stackId].minWidth = barMinWidth); + var barGap = seriesInfo.barGap; + barGap != null && (columnsOnAxis.gap = barGap); + var barCategoryGap = seriesInfo.barCategoryGap; + barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap); + }); + var result = {}; + each(columnsMap, function (columnsOnAxis, coordSysName) { + result[coordSysName] = {}; + var stacks = columnsOnAxis.stacks; + var bandWidth = columnsOnAxis.bandWidth; + var categoryGapPercent = columnsOnAxis.categoryGap; + + if (categoryGapPercent == null) { + var columnCount = keys(stacks).length; // More columns in one group + // the spaces between group is smaller. Or the column will be too thin. + + categoryGapPercent = Math.max(35 - columnCount * 4, 15) + '%'; + } + + var categoryGap = parsePercent$1(categoryGapPercent, bandWidth); + var barGapPercent = parsePercent$1(columnsOnAxis.gap, 1); + var remainedWidth = columnsOnAxis.remainedWidth; + var autoWidthCount = columnsOnAxis.autoWidthCount; + var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); + autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth + + each(stacks, function (column) { + var maxWidth = column.maxWidth; + var minWidth = column.minWidth; + + if (!column.width) { + var finalWidth = autoWidth; + + if (maxWidth && maxWidth < finalWidth) { + finalWidth = Math.min(maxWidth, remainedWidth); + } // `minWidth` has higher priority. `minWidth` decide that wheter the + // bar is able to be visible. So `minWidth` should not be restricted + // by `maxWidth` or `remainedWidth` (which is from `bandWidth`). In + // the extreme cases for `value` axis, bars are allowed to overlap + // with each other if `minWidth` specified. + + + if (minWidth && minWidth > finalWidth) { + finalWidth = minWidth; + } + + if (finalWidth !== autoWidth) { + column.width = finalWidth; + remainedWidth -= finalWidth + barGapPercent * finalWidth; + autoWidthCount--; + } + } else { + // `barMinWidth/barMaxWidth` has higher priority than `barWidth`, as + // CSS does. Becuase barWidth can be a percent value, where + // `barMaxWidth` can be used to restrict the final width. + var finalWidth = column.width; + + if (maxWidth) { + finalWidth = Math.min(finalWidth, maxWidth); + } // `minWidth` has higher priority, as described above + + + if (minWidth) { + finalWidth = Math.max(finalWidth, minWidth); + } + + column.width = finalWidth; + remainedWidth -= finalWidth + barGapPercent * finalWidth; + autoWidthCount--; + } + }); // Recalculate width again + + autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); + autoWidth = Math.max(autoWidth, 0); + var widthSum = 0; + var lastColumn; + each(stacks, function (column, idx) { + if (!column.width) { + column.width = autoWidth; + } + + lastColumn = column; + widthSum += column.width * (1 + barGapPercent); + }); - if (lastColumn) { - widthSum -= lastColumn.width * barGapPercent; - } + if (lastColumn) { + widthSum -= lastColumn.width * barGapPercent; + } - var offset = -widthSum / 2; - each(stacks, function (column, stackId) { - result[coordSysName][stackId] = result[coordSysName][stackId] || { - bandWidth: bandWidth, - offset: offset, - width: column.width - }; - offset += column.width * (1 + barGapPercent); - }); + var offset = -widthSum / 2; + each(stacks, function (column, stackId) { + result[coordSysName][stackId] = result[coordSysName][stackId] || { + bandWidth: bandWidth, + offset: offset, + width: column.width + }; + offset += column.width * (1 + barGapPercent); }); - return result; + }); + return result; } function retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) { - if (barWidthAndOffset && axis) { - var result = barWidthAndOffset[getAxisKey(axis)]; + if (barWidthAndOffset && axis) { + var result = barWidthAndOffset[getAxisKey(axis)]; - if (result != null && seriesModel != null) { - return result[getSeriesStackId(seriesModel)]; - } - - return result; + if (result != null && seriesModel != null) { + return result[getSeriesStackId(seriesModel)]; } + + return result; + } } function layout(seriesType, ecModel) { - var seriesModels = prepareLayoutBarSeries(seriesType, ecModel); - var barWidthAndOffset = makeColumnLayout(seriesModels); - each(seriesModels, function (seriesModel) { - var data = seriesModel.getData(); - var cartesian = seriesModel.coordinateSystem; - var baseAxis = cartesian.getBaseAxis(); - var stackId = getSeriesStackId(seriesModel); - var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId]; - var columnOffset = columnLayoutInfo.offset; - var columnWidth = columnLayoutInfo.width; - data.setLayout({ - bandWidth: columnLayoutInfo.bandWidth, - offset: columnOffset, - size: columnWidth - }); + var seriesModels = prepareLayoutBarSeries(seriesType, ecModel); + var barWidthAndOffset = makeColumnLayout(seriesModels); + each(seriesModels, function (seriesModel) { + var data = seriesModel.getData(); + var cartesian = seriesModel.coordinateSystem; + var baseAxis = cartesian.getBaseAxis(); + var stackId = getSeriesStackId(seriesModel); + var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId]; + var columnOffset = columnLayoutInfo.offset; + var columnWidth = columnLayoutInfo.width; + data.setLayout({ + bandWidth: columnLayoutInfo.bandWidth, + offset: columnOffset, + size: columnWidth }); + }); } // TODO: Do not support stack in large mode yet. function createProgressiveLayout(seriesType) { - return { - seriesType: seriesType, - plan: createRenderPlanner(), - reset: function (seriesModel) { - if (!isOnCartesian(seriesModel)) { - return; + return { + seriesType: seriesType, + plan: createRenderPlanner(), + reset: function (seriesModel) { + if (!isOnCartesian(seriesModel)) { + return; + } + + var data = seriesModel.getData(); + var cartesian = seriesModel.coordinateSystem; + var baseAxis = cartesian.getBaseAxis(); + var valueAxis = cartesian.getOtherAxis(baseAxis); + var valueDimIdx = data.getDimensionIndex(data.mapDimension(valueAxis.dim)); + var baseDimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim)); + var drawBackground = seriesModel.get('showBackground', true); + var valueDim = data.mapDimension(valueAxis.dim); + var stackResultDim = data.getCalculationInfo('stackResultDimension'); + var stacked = isDimensionStacked(data, valueDim) && !!data.getCalculationInfo('stackedOnSeries'); + var isValueAxisH = valueAxis.isHorizontal(); + var valueAxisStart = getValueAxisStart(baseAxis, valueAxis); + var isLarge = isInLargeMode(seriesModel); + var barMinHeight = seriesModel.get('barMinHeight') || 0; + var stackedDimIdx = stackResultDim && data.getDimensionIndex(stackResultDim); // Layout info. + + var columnWidth = data.getLayout('size'); + var columnOffset = data.getLayout('offset'); + return { + progress: function (params, data) { + var count = params.count; + var largePoints = isLarge && createFloat32Array(count * 3); + var largeBackgroundPoints = isLarge && drawBackground && createFloat32Array(count * 3); + var largeDataIndices = isLarge && createFloat32Array(count); + var coordLayout = cartesian.master.getRect(); + var bgSize = isValueAxisH ? coordLayout.width : coordLayout.height; + var dataIndex; + var store = data.getStore(); + var idxOffset = 0; + + while ((dataIndex = params.next()) != null) { + var value = store.get(stacked ? stackedDimIdx : valueDimIdx, dataIndex); + var baseValue = store.get(baseDimIdx, dataIndex); + var baseCoord = valueAxisStart; + var startValue = void 0; // Because of the barMinHeight, we can not use the value in + // stackResultDimension directly. + + if (stacked) { + startValue = +value - store.get(valueDimIdx, dataIndex); } - var data = seriesModel.getData(); - var cartesian = seriesModel.coordinateSystem; - var baseAxis = cartesian.getBaseAxis(); - var valueAxis = cartesian.getOtherAxis(baseAxis); - var valueDimIdx = data.getDimensionIndex(data.mapDimension(valueAxis.dim)); - var baseDimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim)); - var drawBackground = seriesModel.get('showBackground', true); - var valueDim = data.mapDimension(valueAxis.dim); - var stackResultDim = data.getCalculationInfo('stackResultDimension'); - var stacked = isDimensionStacked(data, valueDim) && !!data.getCalculationInfo('stackedOnSeries'); - var isValueAxisH = valueAxis.isHorizontal(); - var valueAxisStart = getValueAxisStart(baseAxis, valueAxis); - var isLarge = isInLargeMode(seriesModel); - var barMinHeight = seriesModel.get('barMinHeight') || 0; - var stackedDimIdx = stackResultDim && data.getDimensionIndex(stackResultDim); // Layout info. - - var columnWidth = data.getLayout('size'); - var columnOffset = data.getLayout('offset'); - return { - progress: function (params, data) { - var count = params.count; - var largePoints = isLarge && createFloat32Array(count * 3); - var largeBackgroundPoints = isLarge && drawBackground && createFloat32Array(count * 3); - var largeDataIndices = isLarge && createFloat32Array(count); - var coordLayout = cartesian.master.getRect(); - var bgSize = isValueAxisH ? coordLayout.width : coordLayout.height; - var dataIndex; - var store = data.getStore(); - var idxOffset = 0; - - while ((dataIndex = params.next()) != null) { - var value = store.get(stacked ? stackedDimIdx : valueDimIdx, dataIndex); - var baseValue = store.get(baseDimIdx, dataIndex); - var baseCoord = valueAxisStart; - var startValue = void 0; // Because of the barMinHeight, we can not use the value in - // stackResultDimension directly. - - if (stacked) { - startValue = +value - store.get(valueDimIdx, dataIndex); - } + var x = void 0; + var y = void 0; + var width = void 0; + var height = void 0; - var x = void 0; - var y = void 0; - var width = void 0; - var height = void 0; + if (isValueAxisH) { + var coord = cartesian.dataToPoint([value, baseValue]); - if (isValueAxisH) { - var coord = cartesian.dataToPoint([value, baseValue]); + if (stacked) { + var startCoord = cartesian.dataToPoint([startValue, baseValue]); + baseCoord = startCoord[0]; + } - if (stacked) { - var startCoord = cartesian.dataToPoint([startValue, baseValue]); - baseCoord = startCoord[0]; - } + x = baseCoord; + y = coord[1] + columnOffset; + width = coord[0] - baseCoord; + height = columnWidth; - x = baseCoord; - y = coord[1] + columnOffset; - width = coord[0] - baseCoord; - height = columnWidth; + if (Math.abs(width) < barMinHeight) { + width = (width < 0 ? -1 : 1) * barMinHeight; + } + } else { + var coord = cartesian.dataToPoint([baseValue, value]); - if (Math.abs(width) < barMinHeight) { - width = (width < 0 ? -1 : 1) * barMinHeight; - } - } else { - var coord = cartesian.dataToPoint([baseValue, value]); + if (stacked) { + var startCoord = cartesian.dataToPoint([baseValue, startValue]); + baseCoord = startCoord[1]; + } - if (stacked) { - var startCoord = cartesian.dataToPoint([baseValue, startValue]); - baseCoord = startCoord[1]; - } + x = coord[0] + columnOffset; + y = baseCoord; + width = columnWidth; + height = coord[1] - baseCoord; - x = coord[0] + columnOffset; - y = baseCoord; - width = columnWidth; - height = coord[1] - baseCoord; + if (Math.abs(height) < barMinHeight) { + // Include zero to has a positive bar + height = (height <= 0 ? -1 : 1) * barMinHeight; + } + } - if (Math.abs(height) < barMinHeight) { - // Include zero to has a positive bar - height = (height <= 0 ? -1 : 1) * barMinHeight; - } - } + if (!isLarge) { + data.setItemLayout(dataIndex, { + x: x, + y: y, + width: width, + height: height + }); + } else { + largePoints[idxOffset] = x; + largePoints[idxOffset + 1] = y; + largePoints[idxOffset + 2] = isValueAxisH ? width : height; - if (!isLarge) { - data.setItemLayout(dataIndex, { - x: x, - y: y, - width: width, - height: height - }); - } else { - largePoints[idxOffset] = x; - largePoints[idxOffset + 1] = y; - largePoints[idxOffset + 2] = isValueAxisH ? width : height; - - if (largeBackgroundPoints) { - largeBackgroundPoints[idxOffset] = isValueAxisH ? coordLayout.x : x; - largeBackgroundPoints[idxOffset + 1] = isValueAxisH ? y : coordLayout.y; - largeBackgroundPoints[idxOffset + 2] = bgSize; - } + if (largeBackgroundPoints) { + largeBackgroundPoints[idxOffset] = isValueAxisH ? coordLayout.x : x; + largeBackgroundPoints[idxOffset + 1] = isValueAxisH ? y : coordLayout.y; + largeBackgroundPoints[idxOffset + 2] = bgSize; + } - largeDataIndices[dataIndex] = dataIndex; - } + largeDataIndices[dataIndex] = dataIndex; + } - idxOffset += 3; - } + idxOffset += 3; + } - if (isLarge) { - data.setLayout({ - largePoints: largePoints, - largeDataIndices: largeDataIndices, - largeBackgroundPoints: largeBackgroundPoints, - valueAxisHorizontal: isValueAxisH - }); - } - } - }; + if (isLarge) { + data.setLayout({ + largePoints: largePoints, + largeDataIndices: largeDataIndices, + largeBackgroundPoints: largeBackgroundPoints, + valueAxisHorizontal: isValueAxisH + }); + } } - }; + }; + } + }; } function isOnCartesian(seriesModel) { - return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d'; + return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d'; } function isInLargeMode(seriesModel) { - return seriesModel.pipelineContext && seriesModel.pipelineContext.large; + return seriesModel.pipelineContext && seriesModel.pipelineContext.large; } // See cases in `test/bar-start.html` and `#7412`, `#8747`. function getValueAxisStart(baseAxis, valueAxis) { - return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type === 'log' ? 1 : 0)); + return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type === 'log' ? 1 : 0)); } var bisect = function (a, x, lo, hi) { - while (lo < hi) { - var mid = lo + hi >>> 1; + while (lo < hi) { + var mid = lo + hi >>> 1; - if (a[mid][1] < x) { - lo = mid + 1; - } else { - hi = mid; - } + if (a[mid][1] < x) { + lo = mid + 1; + } else { + hi = mid; } + } - return lo; + return lo; }; var TimeScale = - /** @class */ - function (_super) { - __extends(TimeScale, _super); - - function TimeScale(settings) { - var _this = _super.call(this, settings) || this; - - _this.type = 'time'; - return _this; - } - /** - * Get label is mainly for other components like dataZoom, tooltip. - */ + /** @class */ + function (_super) { + __extends(TimeScale, _super); + + function TimeScale(settings) { + var _this = _super.call(this, settings) || this; + + _this.type = 'time'; + return _this; + } + /** + * Get label is mainly for other components like dataZoom, tooltip. + */ - TimeScale.prototype.getLabel = function (tick) { - var useUTC = this.getSetting('useUTC'); - return format(tick.value, fullLeveledFormatter[getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))] || fullLeveledFormatter.second, useUTC, this.getSetting('locale')); - }; + TimeScale.prototype.getLabel = function (tick) { + var useUTC = this.getSetting('useUTC'); + return format(tick.value, fullLeveledFormatter[getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))] || fullLeveledFormatter.second, useUTC, this.getSetting('locale')); + }; - TimeScale.prototype.getFormattedLabel = function (tick, idx, labelFormatter) { - var isUTC = this.getSetting('useUTC'); - var lang = this.getSetting('locale'); - return leveledFormat(tick, idx, labelFormatter, lang, isUTC); - }; - /** - * @override - */ + TimeScale.prototype.getFormattedLabel = function (tick, idx, labelFormatter) { + var isUTC = this.getSetting('useUTC'); + var lang = this.getSetting('locale'); + return leveledFormat(tick, idx, labelFormatter, lang, isUTC); + }; + /** + * @override + */ - TimeScale.prototype.getTicks = function () { - var interval = this._interval; - var extent = this._extent; - var ticks = []; // If interval is 0, return []; + TimeScale.prototype.getTicks = function () { + var interval = this._interval; + var extent = this._extent; + var ticks = []; // If interval is 0, return []; - if (!interval) { - return ticks; - } + if (!interval) { + return ticks; + } - ticks.push({ - value: extent[0], - level: 0 - }); - var useUTC = this.getSetting('useUTC'); - var innerTicks = getIntervalTicks(this._minLevelUnit, this._approxInterval, useUTC, extent); - ticks = ticks.concat(innerTicks); - ticks.push({ - value: extent[1], - level: 0 - }); - return ticks; - }; + ticks.push({ + value: extent[0], + level: 0 + }); + var useUTC = this.getSetting('useUTC'); + var innerTicks = getIntervalTicks(this._minLevelUnit, this._approxInterval, useUTC, extent); + ticks = ticks.concat(innerTicks); + ticks.push({ + value: extent[1], + level: 0 + }); + return ticks; + }; - TimeScale.prototype.calcNiceExtent = function (opt) { - var extent = this._extent; // If extent start and end are same, expand them + TimeScale.prototype.calcNiceExtent = function (opt) { + var extent = this._extent; // If extent start and end are same, expand them - if (extent[0] === extent[1]) { - // Expand extent - extent[0] -= ONE_DAY; - extent[1] += ONE_DAY; - } // If there are no data and extent are [Infinity, -Infinity] + if (extent[0] === extent[1]) { + // Expand extent + extent[0] -= ONE_DAY; + extent[1] += ONE_DAY; + } // If there are no data and extent are [Infinity, -Infinity] - if (extent[1] === -Infinity && extent[0] === Infinity) { - var d = new Date(); - extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate()); - extent[0] = extent[1] - ONE_DAY; - } + if (extent[1] === -Infinity && extent[0] === Infinity) { + var d = new Date(); + extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate()); + extent[0] = extent[1] - ONE_DAY; + } - this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval); - }; + this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval); + }; - TimeScale.prototype.calcNiceTicks = function (approxTickNum, minInterval, maxInterval) { - approxTickNum = approxTickNum || 10; - var extent = this._extent; - var span = extent[1] - extent[0]; - this._approxInterval = span / approxTickNum; + TimeScale.prototype.calcNiceTicks = function (approxTickNum, minInterval, maxInterval) { + approxTickNum = approxTickNum || 10; + var extent = this._extent; + var span = extent[1] - extent[0]; + this._approxInterval = span / approxTickNum; - if (minInterval != null && this._approxInterval < minInterval) { - this._approxInterval = minInterval; - } + if (minInterval != null && this._approxInterval < minInterval) { + this._approxInterval = minInterval; + } - if (maxInterval != null && this._approxInterval > maxInterval) { - this._approxInterval = maxInterval; - } + if (maxInterval != null && this._approxInterval > maxInterval) { + this._approxInterval = maxInterval; + } - var scaleIntervalsLen = scaleIntervals.length; - var idx = Math.min(bisect(scaleIntervals, this._approxInterval, 0, scaleIntervalsLen), scaleIntervalsLen - 1); // Interval that can be used to calculate ticks + var scaleIntervalsLen = scaleIntervals.length; + var idx = Math.min(bisect(scaleIntervals, this._approxInterval, 0, scaleIntervalsLen), scaleIntervalsLen - 1); // Interval that can be used to calculate ticks - this._interval = scaleIntervals[idx][1]; // Min level used when picking ticks from top down. - // We check one more level to avoid the ticks are to sparse in some case. + this._interval = scaleIntervals[idx][1]; // Min level used when picking ticks from top down. + // We check one more level to avoid the ticks are to sparse in some case. - this._minLevelUnit = scaleIntervals[Math.max(idx - 1, 0)][0]; - }; + this._minLevelUnit = scaleIntervals[Math.max(idx - 1, 0)][0]; + }; - TimeScale.prototype.parse = function (val) { - // val might be float. - return isNumber(val) ? val : +parseDate(val); - }; + TimeScale.prototype.parse = function (val) { + // val might be float. + return isNumber(val) ? val : +parseDate(val); + }; - TimeScale.prototype.contain = function (val) { - return contain$1(this.parse(val), this._extent); - }; + TimeScale.prototype.contain = function (val) { + return contain$1(this.parse(val), this._extent); + }; - TimeScale.prototype.normalize = function (val) { - return normalize$1(this.parse(val), this._extent); - }; + TimeScale.prototype.normalize = function (val) { + return normalize$1(this.parse(val), this._extent); + }; - TimeScale.prototype.scale = function (val) { - return scale$2(val, this._extent); - }; + TimeScale.prototype.scale = function (val) { + return scale$2(val, this._extent); + }; - TimeScale.type = 'time'; - return TimeScale; - }(IntervalScale); + TimeScale.type = 'time'; + return TimeScale; + }(IntervalScale); /** * This implementation was originally copied from "d3.js" * @@ -34528,70 +34528,70 @@ var scaleIntervals = [// Format interval - ['second', ONE_SECOND], ['minute', ONE_MINUTE], ['hour', ONE_HOUR], ['quarter-day', ONE_HOUR * 6], ['half-day', ONE_HOUR * 12], ['day', ONE_DAY * 1.2], ['half-week', ONE_DAY * 3.5], ['week', ONE_DAY * 7], ['month', ONE_DAY * 31], ['quarter', ONE_DAY * 95], ['half-year', ONE_YEAR / 2], ['year', ONE_YEAR] // 1Y + ['second', ONE_SECOND], ['minute', ONE_MINUTE], ['hour', ONE_HOUR], ['quarter-day', ONE_HOUR * 6], ['half-day', ONE_HOUR * 12], ['day', ONE_DAY * 1.2], ['half-week', ONE_DAY * 3.5], ['week', ONE_DAY * 7], ['month', ONE_DAY * 31], ['quarter', ONE_DAY * 95], ['half-year', ONE_YEAR / 2], ['year', ONE_YEAR] // 1Y ]; function isUnitValueSame(unit, valueA, valueB, isUTC) { - var dateA = parseDate(valueA); - var dateB = parseDate(valueB); + var dateA = parseDate(valueA); + var dateB = parseDate(valueB); - var isSame = function (unit) { - return getUnitValue(dateA, unit, isUTC) === getUnitValue(dateB, unit, isUTC); - }; + var isSame = function (unit) { + return getUnitValue(dateA, unit, isUTC) === getUnitValue(dateB, unit, isUTC); + }; - var isSameYear = function () { - return isSame('year'); - }; // const isSameHalfYear = () => isSameYear() && isSame('half-year'); - // const isSameQuater = () => isSameYear() && isSame('quarter'); + var isSameYear = function () { + return isSame('year'); + }; // const isSameHalfYear = () => isSameYear() && isSame('half-year'); + // const isSameQuater = () => isSameYear() && isSame('quarter'); - var isSameMonth = function () { - return isSameYear() && isSame('month'); - }; + var isSameMonth = function () { + return isSameYear() && isSame('month'); + }; - var isSameDay = function () { - return isSameMonth() && isSame('day'); - }; // const isSameHalfDay = () => isSameDay() && isSame('half-day'); + var isSameDay = function () { + return isSameMonth() && isSame('day'); + }; // const isSameHalfDay = () => isSameDay() && isSame('half-day'); - var isSameHour = function () { - return isSameDay() && isSame('hour'); - }; + var isSameHour = function () { + return isSameDay() && isSame('hour'); + }; - var isSameMinute = function () { - return isSameHour() && isSame('minute'); - }; + var isSameMinute = function () { + return isSameHour() && isSame('minute'); + }; - var isSameSecond = function () { - return isSameMinute() && isSame('second'); - }; + var isSameSecond = function () { + return isSameMinute() && isSame('second'); + }; - var isSameMilliSecond = function () { - return isSameSecond() && isSame('millisecond'); - }; + var isSameMilliSecond = function () { + return isSameSecond() && isSame('millisecond'); + }; - switch (unit) { - case 'year': - return isSameYear(); + switch (unit) { + case 'year': + return isSameYear(); - case 'month': - return isSameMonth(); + case 'month': + return isSameMonth(); - case 'day': - return isSameDay(); + case 'day': + return isSameDay(); - case 'hour': - return isSameHour(); + case 'hour': + return isSameHour(); - case 'minute': - return isSameMinute(); + case 'minute': + return isSameMinute(); - case 'second': - return isSameSecond(); + case 'second': + return isSameSecond(); - case 'millisecond': - return isSameMilliSecond(); - } + case 'millisecond': + return isSameMilliSecond(); + } } // const primaryUnitGetters = { // year: fullYearGetterName(), // month: monthGetterName(), @@ -34643,282 +34643,282 @@ function getDateInterval(approxInterval, daysInMonth) { - approxInterval /= ONE_DAY; - return approxInterval > 16 ? 16 // Math.floor(daysInMonth / 2) + 1 // In this case we only want one tick betwen two month. - : approxInterval > 7.5 ? 7 // TODO week 7 or day 8? - : approxInterval > 3.5 ? 4 : approxInterval > 1.5 ? 2 : 1; + approxInterval /= ONE_DAY; + return approxInterval > 16 ? 16 // Math.floor(daysInMonth / 2) + 1 // In this case we only want one tick betwen two month. + : approxInterval > 7.5 ? 7 // TODO week 7 or day 8? + : approxInterval > 3.5 ? 4 : approxInterval > 1.5 ? 2 : 1; } function getMonthInterval(approxInterval) { - var APPROX_ONE_MONTH = 30 * ONE_DAY; - approxInterval /= APPROX_ONE_MONTH; - return approxInterval > 6 ? 6 : approxInterval > 3 ? 3 : approxInterval > 2 ? 2 : 1; + var APPROX_ONE_MONTH = 30 * ONE_DAY; + approxInterval /= APPROX_ONE_MONTH; + return approxInterval > 6 ? 6 : approxInterval > 3 ? 3 : approxInterval > 2 ? 2 : 1; } function getHourInterval(approxInterval) { - approxInterval /= ONE_HOUR; - return approxInterval > 12 ? 12 : approxInterval > 6 ? 6 : approxInterval > 3.5 ? 4 : approxInterval > 2 ? 2 : 1; + approxInterval /= ONE_HOUR; + return approxInterval > 12 ? 12 : approxInterval > 6 ? 6 : approxInterval > 3.5 ? 4 : approxInterval > 2 ? 2 : 1; } function getMinutesAndSecondsInterval(approxInterval, isMinutes) { - approxInterval /= isMinutes ? ONE_MINUTE : ONE_SECOND; - return approxInterval > 30 ? 30 : approxInterval > 20 ? 20 : approxInterval > 15 ? 15 : approxInterval > 10 ? 10 : approxInterval > 5 ? 5 : approxInterval > 2 ? 2 : 1; + approxInterval /= isMinutes ? ONE_MINUTE : ONE_SECOND; + return approxInterval > 30 ? 30 : approxInterval > 20 ? 20 : approxInterval > 15 ? 15 : approxInterval > 10 ? 10 : approxInterval > 5 ? 5 : approxInterval > 2 ? 2 : 1; } function getMillisecondsInterval(approxInterval) { - return nice(approxInterval, true); + return nice(approxInterval, true); } function getFirstTimestampOfUnit(date, unitName, isUTC) { - var outDate = new Date(date); + var outDate = new Date(date); - switch (getPrimaryTimeUnit(unitName)) { - case 'year': - case 'month': - outDate[monthSetterName(isUTC)](0); + switch (getPrimaryTimeUnit(unitName)) { + case 'year': + case 'month': + outDate[monthSetterName(isUTC)](0); - case 'day': - outDate[dateSetterName(isUTC)](1); + case 'day': + outDate[dateSetterName(isUTC)](1); - case 'hour': - outDate[hoursSetterName(isUTC)](0); + case 'hour': + outDate[hoursSetterName(isUTC)](0); - case 'minute': - outDate[minutesSetterName(isUTC)](0); + case 'minute': + outDate[minutesSetterName(isUTC)](0); - case 'second': - outDate[secondsSetterName(isUTC)](0); - outDate[millisecondsSetterName(isUTC)](0); - } + case 'second': + outDate[secondsSetterName(isUTC)](0); + outDate[millisecondsSetterName(isUTC)](0); + } - return outDate.getTime(); + return outDate.getTime(); } function getIntervalTicks(bottomUnitName, approxInterval, isUTC, extent) { - var safeLimit = 10000; - var unitNames = timeUnits; - var iter = 0; - - function addTicksInSpan(interval, minTimestamp, maxTimestamp, getMethodName, setMethodName, isDate, out) { - var date = new Date(minTimestamp); - var dateTime = minTimestamp; - var d = date[getMethodName](); // if (isDate) { - // d -= 1; // Starts with 0; PENDING - // } - - while (dateTime < maxTimestamp && dateTime <= extent[1]) { - out.push({ - value: dateTime - }); - d += interval; - date[setMethodName](d); - dateTime = date.getTime(); - } // This extra tick is for calcuating ticks of next level. Will not been added to the final result - + var safeLimit = 10000; + var unitNames = timeUnits; + var iter = 0; + + function addTicksInSpan(interval, minTimestamp, maxTimestamp, getMethodName, setMethodName, isDate, out) { + var date = new Date(minTimestamp); + var dateTime = minTimestamp; + var d = date[getMethodName](); // if (isDate) { + // d -= 1; // Starts with 0; PENDING + // } - out.push({ - value: dateTime, - notAdd: true - }); - } + while (dateTime < maxTimestamp && dateTime <= extent[1]) { + out.push({ + value: dateTime + }); + d += interval; + date[setMethodName](d); + dateTime = date.getTime(); + } // This extra tick is for calcuating ticks of next level. Will not been added to the final result - function addLevelTicks(unitName, lastLevelTicks, levelTicks) { - var newAddedTicks = []; - var isFirstLevel = !lastLevelTicks.length; - if (isUnitValueSame(getPrimaryTimeUnit(unitName), extent[0], extent[1], isUTC)) { - return; - } + out.push({ + value: dateTime, + notAdd: true + }); + } - if (isFirstLevel) { - lastLevelTicks = [{ - // TODO Optimize. Not include so may ticks. - value: getFirstTimestampOfUnit(new Date(extent[0]), unitName, isUTC) - }, { - value: extent[1] - }]; - } + function addLevelTicks(unitName, lastLevelTicks, levelTicks) { + var newAddedTicks = []; + var isFirstLevel = !lastLevelTicks.length; - for (var i = 0; i < lastLevelTicks.length - 1; i++) { - var startTick = lastLevelTicks[i].value; - var endTick = lastLevelTicks[i + 1].value; + if (isUnitValueSame(getPrimaryTimeUnit(unitName), extent[0], extent[1], isUTC)) { + return; + } - if (startTick === endTick) { - continue; - } + if (isFirstLevel) { + lastLevelTicks = [{ + // TODO Optimize. Not include so may ticks. + value: getFirstTimestampOfUnit(new Date(extent[0]), unitName, isUTC) + }, { + value: extent[1] + }]; + } - var interval = void 0; - var getterName = void 0; - var setterName = void 0; - var isDate = false; + for (var i = 0; i < lastLevelTicks.length - 1; i++) { + var startTick = lastLevelTicks[i].value; + var endTick = lastLevelTicks[i + 1].value; - switch (unitName) { - case 'year': - interval = Math.max(1, Math.round(approxInterval / ONE_DAY / 365)); - getterName = fullYearGetterName(isUTC); - setterName = fullYearSetterName(isUTC); - break; + if (startTick === endTick) { + continue; + } - case 'half-year': - case 'quarter': - case 'month': - interval = getMonthInterval(approxInterval); - getterName = monthGetterName(isUTC); - setterName = monthSetterName(isUTC); - break; + var interval = void 0; + var getterName = void 0; + var setterName = void 0; + var isDate = false; - case 'week': // PENDING If week is added. Ignore day. + switch (unitName) { + case 'year': + interval = Math.max(1, Math.round(approxInterval / ONE_DAY / 365)); + getterName = fullYearGetterName(isUTC); + setterName = fullYearSetterName(isUTC); + break; - case 'half-week': - case 'day': - interval = getDateInterval(approxInterval); // Use 32 days and let interval been 16 + case 'half-year': + case 'quarter': + case 'month': + interval = getMonthInterval(approxInterval); + getterName = monthGetterName(isUTC); + setterName = monthSetterName(isUTC); + break; - getterName = dateGetterName(isUTC); - setterName = dateSetterName(isUTC); - isDate = true; - break; + case 'week': // PENDING If week is added. Ignore day. - case 'half-day': - case 'quarter-day': - case 'hour': - interval = getHourInterval(approxInterval); - getterName = hoursGetterName(isUTC); - setterName = hoursSetterName(isUTC); - break; + case 'half-week': + case 'day': + interval = getDateInterval(approxInterval); // Use 32 days and let interval been 16 - case 'minute': - interval = getMinutesAndSecondsInterval(approxInterval, true); - getterName = minutesGetterName(isUTC); - setterName = minutesSetterName(isUTC); - break; + getterName = dateGetterName(isUTC); + setterName = dateSetterName(isUTC); + isDate = true; + break; - case 'second': - interval = getMinutesAndSecondsInterval(approxInterval, false); - getterName = secondsGetterName(isUTC); - setterName = secondsSetterName(isUTC); - break; + case 'half-day': + case 'quarter-day': + case 'hour': + interval = getHourInterval(approxInterval); + getterName = hoursGetterName(isUTC); + setterName = hoursSetterName(isUTC); + break; - case 'millisecond': - interval = getMillisecondsInterval(approxInterval); - getterName = millisecondsGetterName(isUTC); - setterName = millisecondsSetterName(isUTC); - break; - } + case 'minute': + interval = getMinutesAndSecondsInterval(approxInterval, true); + getterName = minutesGetterName(isUTC); + setterName = minutesSetterName(isUTC); + break; - addTicksInSpan(interval, startTick, endTick, getterName, setterName, isDate, newAddedTicks); + case 'second': + interval = getMinutesAndSecondsInterval(approxInterval, false); + getterName = secondsGetterName(isUTC); + setterName = secondsSetterName(isUTC); + break; - if (unitName === 'year' && levelTicks.length > 1 && i === 0) { - // Add nearest years to the left extent. - levelTicks.unshift({ - value: levelTicks[0].value - interval - }); - } - } + case 'millisecond': + interval = getMillisecondsInterval(approxInterval); + getterName = millisecondsGetterName(isUTC); + setterName = millisecondsSetterName(isUTC); + break; + } + + addTicksInSpan(interval, startTick, endTick, getterName, setterName, isDate, newAddedTicks); + + if (unitName === 'year' && levelTicks.length > 1 && i === 0) { + // Add nearest years to the left extent. + levelTicks.unshift({ + value: levelTicks[0].value - interval + }); + } + } - for (var i = 0; i < newAddedTicks.length; i++) { - levelTicks.push(newAddedTicks[i]); - } // newAddedTicks.length && console.log(unitName, newAddedTicks); + for (var i = 0; i < newAddedTicks.length; i++) { + levelTicks.push(newAddedTicks[i]); + } // newAddedTicks.length && console.log(unitName, newAddedTicks); - return newAddedTicks; - } + return newAddedTicks; + } - var levelsTicks = []; - var currentLevelTicks = []; - var tickCount = 0; - var lastLevelTickCount = 0; + var levelsTicks = []; + var currentLevelTicks = []; + var tickCount = 0; + var lastLevelTickCount = 0; - for (var i = 0; i < unitNames.length && iter++ < safeLimit; ++i) { - var primaryTimeUnit = getPrimaryTimeUnit(unitNames[i]); + for (var i = 0; i < unitNames.length && iter++ < safeLimit; ++i) { + var primaryTimeUnit = getPrimaryTimeUnit(unitNames[i]); - if (!isPrimaryTimeUnit(unitNames[i])) { - // TODO - continue; - } + if (!isPrimaryTimeUnit(unitNames[i])) { + // TODO + continue; + } - addLevelTicks(unitNames[i], levelsTicks[levelsTicks.length - 1] || [], currentLevelTicks); - var nextPrimaryTimeUnit = unitNames[i + 1] ? getPrimaryTimeUnit(unitNames[i + 1]) : null; + addLevelTicks(unitNames[i], levelsTicks[levelsTicks.length - 1] || [], currentLevelTicks); + var nextPrimaryTimeUnit = unitNames[i + 1] ? getPrimaryTimeUnit(unitNames[i + 1]) : null; - if (primaryTimeUnit !== nextPrimaryTimeUnit) { - if (currentLevelTicks.length) { - lastLevelTickCount = tickCount; // Remove the duplicate so the tick count can be precisely. + if (primaryTimeUnit !== nextPrimaryTimeUnit) { + if (currentLevelTicks.length) { + lastLevelTickCount = tickCount; // Remove the duplicate so the tick count can be precisely. - currentLevelTicks.sort(function (a, b) { - return a.value - b.value; - }); - var levelTicksRemoveDuplicated = []; + currentLevelTicks.sort(function (a, b) { + return a.value - b.value; + }); + var levelTicksRemoveDuplicated = []; - for (var i_1 = 0; i_1 < currentLevelTicks.length; ++i_1) { - var tickValue = currentLevelTicks[i_1].value; + for (var i_1 = 0; i_1 < currentLevelTicks.length; ++i_1) { + var tickValue = currentLevelTicks[i_1].value; - if (i_1 === 0 || currentLevelTicks[i_1 - 1].value !== tickValue) { - levelTicksRemoveDuplicated.push(currentLevelTicks[i_1]); + if (i_1 === 0 || currentLevelTicks[i_1 - 1].value !== tickValue) { + levelTicksRemoveDuplicated.push(currentLevelTicks[i_1]); - if (tickValue >= extent[0] && tickValue <= extent[1]) { - tickCount++; - } - } - } + if (tickValue >= extent[0] && tickValue <= extent[1]) { + tickCount++; + } + } + } - var targetTickNum = (extent[1] - extent[0]) / approxInterval; // Added too much in this level and not too less in last level + var targetTickNum = (extent[1] - extent[0]) / approxInterval; // Added too much in this level and not too less in last level - if (tickCount > targetTickNum * 1.5 && lastLevelTickCount > targetTickNum / 1.5) { - break; - } // Only treat primary time unit as one level. + if (tickCount > targetTickNum * 1.5 && lastLevelTickCount > targetTickNum / 1.5) { + break; + } // Only treat primary time unit as one level. - levelsTicks.push(levelTicksRemoveDuplicated); + levelsTicks.push(levelTicksRemoveDuplicated); - if (tickCount > targetTickNum || bottomUnitName === unitNames[i]) { - break; - } - } // Reset if next unitName is primary + if (tickCount > targetTickNum || bottomUnitName === unitNames[i]) { + break; + } + } // Reset if next unitName is primary - currentLevelTicks = []; - } + currentLevelTicks = []; } + } - if ("development" !== 'production') { - if (iter >= safeLimit) { - warn('Exceed safe limit.'); - } + if ("development" !== 'production') { + if (iter >= safeLimit) { + warn('Exceed safe limit.'); } + } - var levelsTicksInExtent = filter(map(levelsTicks, function (levelTicks) { - return filter(levelTicks, function (tick) { - return tick.value >= extent[0] && tick.value <= extent[1] && !tick.notAdd; - }); - }), function (levelTicks) { - return levelTicks.length > 0; + var levelsTicksInExtent = filter(map(levelsTicks, function (levelTicks) { + return filter(levelTicks, function (tick) { + return tick.value >= extent[0] && tick.value <= extent[1] && !tick.notAdd; }); - var ticks = []; - var maxLevel = levelsTicksInExtent.length - 1; + }), function (levelTicks) { + return levelTicks.length > 0; + }); + var ticks = []; + var maxLevel = levelsTicksInExtent.length - 1; - for (var i = 0; i < levelsTicksInExtent.length; ++i) { - var levelTicks = levelsTicksInExtent[i]; + for (var i = 0; i < levelsTicksInExtent.length; ++i) { + var levelTicks = levelsTicksInExtent[i]; - for (var k = 0; k < levelTicks.length; ++k) { - ticks.push({ - value: levelTicks[k].value, - level: maxLevel - i - }); - } + for (var k = 0; k < levelTicks.length; ++k) { + ticks.push({ + value: levelTicks[k].value, + level: maxLevel - i + }); } + } - ticks.sort(function (a, b) { - return a.value - b.value; - }); // Remove duplicates + ticks.sort(function (a, b) { + return a.value - b.value; + }); // Remove duplicates - var result = []; + var result = []; - for (var i = 0; i < ticks.length; ++i) { - if (i === 0 || ticks[i].value !== ticks[i - 1].value) { - result.push(ticks[i]); - } + for (var i = 0; i < ticks.length; ++i) { + if (i === 0 || ticks[i].value !== ticks[i - 1].value) { + result.push(ticks[i]); } + } - return result; + return result; } Scale.registerClass(TimeScale); @@ -34933,335 +34933,335 @@ var mathLog = Math.log; var LogScale = - /** @class */ - function (_super) { - __extends(LogScale, _super); - - function LogScale() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = 'log'; - _this.base = 10; - _this._originalScale = new IntervalScale(); // FIXME:TS actually used by `IntervalScale` - - _this._interval = 0; - return _this; - } - /** - * @param Whether expand the ticks to niced extent. - */ - - - LogScale.prototype.getTicks = function (expandToNicedExtent) { - var originalScale = this._originalScale; - var extent = this._extent; - var originalExtent = originalScale.getExtent(); - var ticks = intervalScaleProto.getTicks.call(this, expandToNicedExtent); - return map(ticks, function (tick) { - var val = tick.value; - var powVal = round(mathPow$1(this.base, val)); // Fix #4158 + /** @class */ + function (_super) { + __extends(LogScale, _super); + + function LogScale() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = 'log'; + _this.base = 10; + _this._originalScale = new IntervalScale(); // FIXME:TS actually used by `IntervalScale` + + _this._interval = 0; + return _this; + } + /** + * @param Whether expand the ticks to niced extent. + */ - powVal = val === extent[0] && this._fixMin ? fixRoundingError(powVal, originalExtent[0]) : powVal; - powVal = val === extent[1] && this._fixMax ? fixRoundingError(powVal, originalExtent[1]) : powVal; - return { - value: powVal - }; - }, this); - }; - LogScale.prototype.setExtent = function (start, end) { - var base = this.base; - start = mathLog(start) / mathLog(base); - end = mathLog(end) / mathLog(base); - intervalScaleProto.setExtent.call(this, start, end); - }; - /** - * @return {number} end - */ + LogScale.prototype.getTicks = function (expandToNicedExtent) { + var originalScale = this._originalScale; + var extent = this._extent; + var originalExtent = originalScale.getExtent(); + var ticks = intervalScaleProto.getTicks.call(this, expandToNicedExtent); + return map(ticks, function (tick) { + var val = tick.value; + var powVal = round(mathPow$1(this.base, val)); // Fix #4158 + + powVal = val === extent[0] && this._fixMin ? fixRoundingError(powVal, originalExtent[0]) : powVal; + powVal = val === extent[1] && this._fixMax ? fixRoundingError(powVal, originalExtent[1]) : powVal; + return { + value: powVal + }; + }, this); + }; + + LogScale.prototype.setExtent = function (start, end) { + var base = this.base; + start = mathLog(start) / mathLog(base); + end = mathLog(end) / mathLog(base); + intervalScaleProto.setExtent.call(this, start, end); + }; + /** + * @return {number} end + */ - LogScale.prototype.getExtent = function () { - var base = this.base; - var extent = scaleProto.getExtent.call(this); - extent[0] = mathPow$1(base, extent[0]); - extent[1] = mathPow$1(base, extent[1]); // Fix #4158 + LogScale.prototype.getExtent = function () { + var base = this.base; + var extent = scaleProto.getExtent.call(this); + extent[0] = mathPow$1(base, extent[0]); + extent[1] = mathPow$1(base, extent[1]); // Fix #4158 - var originalScale = this._originalScale; - var originalExtent = originalScale.getExtent(); - this._fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0])); - this._fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1])); - return extent; - }; + var originalScale = this._originalScale; + var originalExtent = originalScale.getExtent(); + this._fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0])); + this._fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1])); + return extent; + }; - LogScale.prototype.unionExtent = function (extent) { - this._originalScale.unionExtent(extent); + LogScale.prototype.unionExtent = function (extent) { + this._originalScale.unionExtent(extent); - var base = this.base; - extent[0] = mathLog(extent[0]) / mathLog(base); - extent[1] = mathLog(extent[1]) / mathLog(base); - scaleProto.unionExtent.call(this, extent); - }; + var base = this.base; + extent[0] = mathLog(extent[0]) / mathLog(base); + extent[1] = mathLog(extent[1]) / mathLog(base); + scaleProto.unionExtent.call(this, extent); + }; - LogScale.prototype.unionExtentFromData = function (data, dim) { - // TODO - // filter value that <= 0 - this.unionExtent(data.getApproximateExtent(dim)); - }; - /** - * Update interval and extent of intervals for nice ticks - * @param approxTickNum default 10 Given approx tick number - */ + LogScale.prototype.unionExtentFromData = function (data, dim) { + // TODO + // filter value that <= 0 + this.unionExtent(data.getApproximateExtent(dim)); + }; + /** + * Update interval and extent of intervals for nice ticks + * @param approxTickNum default 10 Given approx tick number + */ - LogScale.prototype.calcNiceTicks = function (approxTickNum) { - approxTickNum = approxTickNum || 10; - var extent = this._extent; - var span = extent[1] - extent[0]; + LogScale.prototype.calcNiceTicks = function (approxTickNum) { + approxTickNum = approxTickNum || 10; + var extent = this._extent; + var span = extent[1] - extent[0]; - if (span === Infinity || span <= 0) { - return; - } + if (span === Infinity || span <= 0) { + return; + } - var interval = quantity(span); - var err = approxTickNum / span * interval; // Filter ticks to get closer to the desired count. + var interval = quantity(span); + var err = approxTickNum / span * interval; // Filter ticks to get closer to the desired count. - if (err <= 0.5) { - interval *= 10; - } // Interval should be integer + if (err <= 0.5) { + interval *= 10; + } // Interval should be integer - while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) { - interval *= 10; - } + while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) { + interval *= 10; + } - var niceExtent = [round(mathCeil(extent[0] / interval) * interval), round(mathFloor(extent[1] / interval) * interval)]; - this._interval = interval; - this._niceExtent = niceExtent; - }; + var niceExtent = [round(mathCeil(extent[0] / interval) * interval), round(mathFloor(extent[1] / interval) * interval)]; + this._interval = interval; + this._niceExtent = niceExtent; + }; - LogScale.prototype.calcNiceExtent = function (opt) { - intervalScaleProto.calcNiceExtent.call(this, opt); - this._fixMin = opt.fixMin; - this._fixMax = opt.fixMax; - }; + LogScale.prototype.calcNiceExtent = function (opt) { + intervalScaleProto.calcNiceExtent.call(this, opt); + this._fixMin = opt.fixMin; + this._fixMax = opt.fixMax; + }; - LogScale.prototype.parse = function (val) { - return val; - }; + LogScale.prototype.parse = function (val) { + return val; + }; - LogScale.prototype.contain = function (val) { - val = mathLog(val) / mathLog(this.base); - return contain$1(val, this._extent); - }; + LogScale.prototype.contain = function (val) { + val = mathLog(val) / mathLog(this.base); + return contain$1(val, this._extent); + }; - LogScale.prototype.normalize = function (val) { - val = mathLog(val) / mathLog(this.base); - return normalize$1(val, this._extent); - }; + LogScale.prototype.normalize = function (val) { + val = mathLog(val) / mathLog(this.base); + return normalize$1(val, this._extent); + }; - LogScale.prototype.scale = function (val) { - val = scale$2(val, this._extent); - return mathPow$1(this.base, val); - }; + LogScale.prototype.scale = function (val) { + val = scale$2(val, this._extent); + return mathPow$1(this.base, val); + }; - LogScale.type = 'log'; - return LogScale; - }(Scale); + LogScale.type = 'log'; + return LogScale; + }(Scale); var proto = LogScale.prototype; proto.getMinorTicks = intervalScaleProto.getMinorTicks; proto.getLabel = intervalScaleProto.getLabel; function fixRoundingError(val, originalVal) { - return roundingErrorFix(val, getPrecision(originalVal)); + return roundingErrorFix(val, getPrecision(originalVal)); } Scale.registerClass(LogScale); var ScaleRawExtentInfo = - /** @class */ - function () { - function ScaleRawExtentInfo(scale, model, // Usually: data extent from all series on this axis. - originalExtent) { - this._prepareParams(scale, model, originalExtent); - } - /** - * Parameters depending on ouside (like model, user callback) - * are prepared and fixed here. - */ + /** @class */ + function () { + function ScaleRawExtentInfo(scale, model, // Usually: data extent from all series on this axis. + originalExtent) { + this._prepareParams(scale, model, originalExtent); + } + /** + * Parameters depending on ouside (like model, user callback) + * are prepared and fixed here. + */ - ScaleRawExtentInfo.prototype._prepareParams = function (scale, model, // Usually: data extent from all series on this axis. - dataExtent) { - if (dataExtent[1] < dataExtent[0]) { - dataExtent = [NaN, NaN]; - } + ScaleRawExtentInfo.prototype._prepareParams = function (scale, model, // Usually: data extent from all series on this axis. + dataExtent) { + if (dataExtent[1] < dataExtent[0]) { + dataExtent = [NaN, NaN]; + } - this._dataMin = dataExtent[0]; - this._dataMax = dataExtent[1]; - var isOrdinal = this._isOrdinal = scale.type === 'ordinal'; - this._needCrossZero = scale.type === 'interval' && model.getNeedCrossZero && model.getNeedCrossZero(); - var modelMinRaw = this._modelMinRaw = model.get('min', true); + this._dataMin = dataExtent[0]; + this._dataMax = dataExtent[1]; + var isOrdinal = this._isOrdinal = scale.type === 'ordinal'; + this._needCrossZero = scale.type === 'interval' && model.getNeedCrossZero && model.getNeedCrossZero(); + var modelMinRaw = this._modelMinRaw = model.get('min', true); - if (isFunction(modelMinRaw)) { - // This callback alway provide users the full data extent (before data filtered). - this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw({ - min: dataExtent[0], - max: dataExtent[1] - })); - } else if (modelMinRaw !== 'dataMin') { - this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw); - } + if (isFunction(modelMinRaw)) { + // This callback alway provide users the full data extent (before data filtered). + this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw({ + min: dataExtent[0], + max: dataExtent[1] + })); + } else if (modelMinRaw !== 'dataMin') { + this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw); + } - var modelMaxRaw = this._modelMaxRaw = model.get('max', true); + var modelMaxRaw = this._modelMaxRaw = model.get('max', true); - if (isFunction(modelMaxRaw)) { - // This callback alway provide users the full data extent (before data filtered). - this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw({ - min: dataExtent[0], - max: dataExtent[1] - })); - } else if (modelMaxRaw !== 'dataMax') { - this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw); - } + if (isFunction(modelMaxRaw)) { + // This callback alway provide users the full data extent (before data filtered). + this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw({ + min: dataExtent[0], + max: dataExtent[1] + })); + } else if (modelMaxRaw !== 'dataMax') { + this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw); + } - if (isOrdinal) { - // FIXME: there is a flaw here: if there is no "block" data processor like `dataZoom`, - // and progressive rendering is using, here the category result might just only contain - // the processed chunk rather than the entire result. - this._axisDataLen = model.getCategories().length; - } else { - var boundaryGap = model.get('boundaryGap'); - var boundaryGapArr = isArray(boundaryGap) ? boundaryGap : [boundaryGap || 0, boundaryGap || 0]; + if (isOrdinal) { + // FIXME: there is a flaw here: if there is no "block" data processor like `dataZoom`, + // and progressive rendering is using, here the category result might just only contain + // the processed chunk rather than the entire result. + this._axisDataLen = model.getCategories().length; + } else { + var boundaryGap = model.get('boundaryGap'); + var boundaryGapArr = isArray(boundaryGap) ? boundaryGap : [boundaryGap || 0, boundaryGap || 0]; - if (typeof boundaryGapArr[0] === 'boolean' || typeof boundaryGapArr[1] === 'boolean') { - if ("development" !== 'production') { - console.warn('Boolean type for boundaryGap is only ' + 'allowed for ordinal axis. Please use string in ' + 'percentage instead, e.g., "20%". Currently, ' + 'boundaryGap is set to be 0.'); - } + if (typeof boundaryGapArr[0] === 'boolean' || typeof boundaryGapArr[1] === 'boolean') { + if ("development" !== 'production') { + console.warn('Boolean type for boundaryGap is only ' + 'allowed for ordinal axis. Please use string in ' + 'percentage instead, e.g., "20%". Currently, ' + 'boundaryGap is set to be 0.'); + } - this._boundaryGapInner = [0, 0]; - } else { - this._boundaryGapInner = [parsePercent(boundaryGapArr[0], 1), parsePercent(boundaryGapArr[1], 1)]; - } - } - }; - /** - * Calculate extent by prepared parameters. - * This method has no external dependency and can be called duplicatedly, - * getting the same result. - * If parameters changed, should call this method to recalcuate. - */ + this._boundaryGapInner = [0, 0]; + } else { + this._boundaryGapInner = [parsePercent(boundaryGapArr[0], 1), parsePercent(boundaryGapArr[1], 1)]; + } + } + }; + /** + * Calculate extent by prepared parameters. + * This method has no external dependency and can be called duplicatedly, + * getting the same result. + * If parameters changed, should call this method to recalcuate. + */ - ScaleRawExtentInfo.prototype.calculate = function () { - // Notice: When min/max is not set (that is, when there are null/undefined, - // which is the most common case), these cases should be ensured: - // (1) For 'ordinal', show all axis.data. - // (2) For others: - // + `boundaryGap` is applied (if min/max set, boundaryGap is - // disabled). - // + If `needCrossZero`, min/max should be zero, otherwise, min/max should - // be the result that originalExtent enlarged by boundaryGap. - // (3) If no data, it should be ensured that `scale.setBlank` is set. - var isOrdinal = this._isOrdinal; - var dataMin = this._dataMin; - var dataMax = this._dataMax; - var axisDataLen = this._axisDataLen; - var boundaryGapInner = this._boundaryGapInner; - var span = !isOrdinal ? dataMax - dataMin || Math.abs(dataMin) : null; // Currently if a `'value'` axis model min is specified as 'dataMin'/'dataMax', - // `boundaryGap` will not be used. It's the different from specifying as `null`/`undefined`. + ScaleRawExtentInfo.prototype.calculate = function () { + // Notice: When min/max is not set (that is, when there are null/undefined, + // which is the most common case), these cases should be ensured: + // (1) For 'ordinal', show all axis.data. + // (2) For others: + // + `boundaryGap` is applied (if min/max set, boundaryGap is + // disabled). + // + If `needCrossZero`, min/max should be zero, otherwise, min/max should + // be the result that originalExtent enlarged by boundaryGap. + // (3) If no data, it should be ensured that `scale.setBlank` is set. + var isOrdinal = this._isOrdinal; + var dataMin = this._dataMin; + var dataMax = this._dataMax; + var axisDataLen = this._axisDataLen; + var boundaryGapInner = this._boundaryGapInner; + var span = !isOrdinal ? dataMax - dataMin || Math.abs(dataMin) : null; // Currently if a `'value'` axis model min is specified as 'dataMin'/'dataMax', + // `boundaryGap` will not be used. It's the different from specifying as `null`/`undefined`. - var min = this._modelMinRaw === 'dataMin' ? dataMin : this._modelMinNum; - var max = this._modelMaxRaw === 'dataMax' ? dataMax : this._modelMaxNum; // If `_modelMinNum`/`_modelMaxNum` is `null`/`undefined`, should not be fixed. + var min = this._modelMinRaw === 'dataMin' ? dataMin : this._modelMinNum; + var max = this._modelMaxRaw === 'dataMax' ? dataMax : this._modelMaxNum; // If `_modelMinNum`/`_modelMaxNum` is `null`/`undefined`, should not be fixed. - var minFixed = min != null; - var maxFixed = max != null; + var minFixed = min != null; + var maxFixed = max != null; - if (min == null) { - min = isOrdinal ? axisDataLen ? 0 : NaN : dataMin - boundaryGapInner[0] * span; - } + if (min == null) { + min = isOrdinal ? axisDataLen ? 0 : NaN : dataMin - boundaryGapInner[0] * span; + } - if (max == null) { - max = isOrdinal ? axisDataLen ? axisDataLen - 1 : NaN : dataMax + boundaryGapInner[1] * span; - } + if (max == null) { + max = isOrdinal ? axisDataLen ? axisDataLen - 1 : NaN : dataMax + boundaryGapInner[1] * span; + } - (min == null || !isFinite(min)) && (min = NaN); - (max == null || !isFinite(max)) && (max = NaN); - var isBlank = eqNaN(min) || eqNaN(max) || isOrdinal && !axisDataLen; // If data extent modified, need to recalculated to ensure cross zero. + (min == null || !isFinite(min)) && (min = NaN); + (max == null || !isFinite(max)) && (max = NaN); + var isBlank = eqNaN(min) || eqNaN(max) || isOrdinal && !axisDataLen; // If data extent modified, need to recalculated to ensure cross zero. - if (this._needCrossZero) { - // Axis is over zero and min is not set - if (min > 0 && max > 0 && !minFixed) { - min = 0; // minFixed = true; - } // Axis is under zero and max is not set + if (this._needCrossZero) { + // Axis is over zero and min is not set + if (min > 0 && max > 0 && !minFixed) { + min = 0; // minFixed = true; + } // Axis is under zero and max is not set - if (min < 0 && max < 0 && !maxFixed) { - max = 0; // maxFixed = true; - } // PENDING: - // When `needCrossZero` and all data is positive/negative, should it be ensured - // that the results processed by boundaryGap are positive/negative? - // If so, here `minFixed`/`maxFixed` need to be set. + if (min < 0 && max < 0 && !maxFixed) { + max = 0; // maxFixed = true; + } // PENDING: + // When `needCrossZero` and all data is positive/negative, should it be ensured + // that the results processed by boundaryGap are positive/negative? + // If so, here `minFixed`/`maxFixed` need to be set. - } + } - var determinedMin = this._determinedMin; - var determinedMax = this._determinedMax; + var determinedMin = this._determinedMin; + var determinedMax = this._determinedMax; - if (determinedMin != null) { - min = determinedMin; - minFixed = true; - } + if (determinedMin != null) { + min = determinedMin; + minFixed = true; + } - if (determinedMax != null) { - max = determinedMax; - maxFixed = true; - } // Ensure min/max be finite number or NaN here. (not to be null/undefined) - // `NaN` means min/max axis is blank. + if (determinedMax != null) { + max = determinedMax; + maxFixed = true; + } // Ensure min/max be finite number or NaN here. (not to be null/undefined) + // `NaN` means min/max axis is blank. - return { - min: min, - max: max, - minFixed: minFixed, - maxFixed: maxFixed, - isBlank: isBlank - }; - }; + return { + min: min, + max: max, + minFixed: minFixed, + maxFixed: maxFixed, + isBlank: isBlank + }; + }; - ScaleRawExtentInfo.prototype.modifyDataMinMax = function (minMaxName, val) { - if ("development" !== 'production') { - assert(!this.frozen); - } + ScaleRawExtentInfo.prototype.modifyDataMinMax = function (minMaxName, val) { + if ("development" !== 'production') { + assert(!this.frozen); + } - this[DATA_MIN_MAX_ATTR[minMaxName]] = val; - }; + this[DATA_MIN_MAX_ATTR[minMaxName]] = val; + }; - ScaleRawExtentInfo.prototype.setDeterminedMinMax = function (minMaxName, val) { - var attr = DETERMINED_MIN_MAX_ATTR[minMaxName]; + ScaleRawExtentInfo.prototype.setDeterminedMinMax = function (minMaxName, val) { + var attr = DETERMINED_MIN_MAX_ATTR[minMaxName]; - if ("development" !== 'production') { - assert(!this.frozen // Earse them usually means logic flaw. - && this[attr] == null); - } + if ("development" !== 'production') { + assert(!this.frozen // Earse them usually means logic flaw. + && this[attr] == null); + } - this[attr] = val; - }; + this[attr] = val; + }; - ScaleRawExtentInfo.prototype.freeze = function () { - // @ts-ignore - this.frozen = true; - }; + ScaleRawExtentInfo.prototype.freeze = function () { + // @ts-ignore + this.frozen = true; + }; - return ScaleRawExtentInfo; - }(); + return ScaleRawExtentInfo; + }(); var DETERMINED_MIN_MAX_ATTR = { - min: '_determinedMin', - max: '_determinedMax' + min: '_determinedMin', + max: '_determinedMax' }; var DATA_MIN_MAX_ATTR = { - min: '_dataMin', - max: '_dataMax' + min: '_dataMin', + max: '_dataMax' }; /** * Get scale min max and related info only depends on model settings. @@ -35280,21 +35280,21 @@ */ function ensureScaleRawExtentInfo(scale, model, // Usually: data extent from all series on this axis. - originalExtent) { - // Do not permit to recreate. - var rawExtentInfo = scale.rawExtentInfo; + originalExtent) { + // Do not permit to recreate. + var rawExtentInfo = scale.rawExtentInfo; - if (rawExtentInfo) { - return rawExtentInfo; - } + if (rawExtentInfo) { + return rawExtentInfo; + } - rawExtentInfo = new ScaleRawExtentInfo(scale, model, originalExtent); // @ts-ignore + rawExtentInfo = new ScaleRawExtentInfo(scale, model, originalExtent); // @ts-ignore - scale.rawExtentInfo = rawExtentInfo; - return rawExtentInfo; + scale.rawExtentInfo = rawExtentInfo; + return rawExtentInfo; } function parseAxisModelMinMax(scale, minMax) { - return minMax == null ? null : eqNaN(minMax) ? NaN : scale.parse(minMax); + return minMax == null ? null : eqNaN(minMax) ? NaN : scale.parse(minMax); } /** @@ -35308,159 +35308,159 @@ */ function getScaleExtent(scale, model) { - var scaleType = scale.type; - var rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate(); - scale.setBlank(rawExtentResult.isBlank); - var min = rawExtentResult.min; - var max = rawExtentResult.max; // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis - // is base axis - // FIXME - // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly. - // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent? - // Should not depend on series type `bar`? - // (3) Fix that might overlap when using dataZoom. - // (4) Consider other chart types using `barGrid`? - // See #6728, #4862, `test/bar-overflow-time-plot.html` - - var ecModel = model.ecModel; - - if (ecModel && scaleType === 'time' - /*|| scaleType === 'interval' */ - ) { - var barSeriesModels = prepareLayoutBarSeries('bar', ecModel); - var isBaseAxisAndHasBarSeries_1 = false; - each(barSeriesModels, function (seriesModel) { - isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis; - }); + var scaleType = scale.type; + var rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate(); + scale.setBlank(rawExtentResult.isBlank); + var min = rawExtentResult.min; + var max = rawExtentResult.max; // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis + // is base axis + // FIXME + // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly. + // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent? + // Should not depend on series type `bar`? + // (3) Fix that might overlap when using dataZoom. + // (4) Consider other chart types using `barGrid`? + // See #6728, #4862, `test/bar-overflow-time-plot.html` + + var ecModel = model.ecModel; + + if (ecModel && scaleType === 'time' + /*|| scaleType === 'interval' */ + ) { + var barSeriesModels = prepareLayoutBarSeries('bar', ecModel); + var isBaseAxisAndHasBarSeries_1 = false; + each(barSeriesModels, function (seriesModel) { + isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis; + }); - if (isBaseAxisAndHasBarSeries_1) { - // Calculate placement of bars on axis. TODO should be decoupled - // with barLayout - var barWidthAndOffset = makeColumnLayout(barSeriesModels); // Adjust axis min and max to account for overflow + if (isBaseAxisAndHasBarSeries_1) { + // Calculate placement of bars on axis. TODO should be decoupled + // with barLayout + var barWidthAndOffset = makeColumnLayout(barSeriesModels); // Adjust axis min and max to account for overflow - var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset); - min = adjustedScale.min; - max = adjustedScale.max; - } + var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset); + min = adjustedScale.min; + max = adjustedScale.max; } + } - return { - extent: [min, max], - // "fix" means "fixed", the value should not be - // changed in the subsequent steps. - fixMin: rawExtentResult.minFixed, - fixMax: rawExtentResult.maxFixed - }; + return { + extent: [min, max], + // "fix" means "fixed", the value should not be + // changed in the subsequent steps. + fixMin: rawExtentResult.minFixed, + fixMax: rawExtentResult.maxFixed + }; } function adjustScaleForOverflow(min, max, model, // Only support cartesian coord yet. - barWidthAndOffset) { - // Get Axis Length - var axisExtent = model.axis.getExtent(); - var axisLength = axisExtent[1] - axisExtent[0]; // Get bars on current base axis and calculate min and max overflow - - var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis); - - if (barsOnCurrentAxis === undefined) { - return { - min: min, - max: max - }; - } + barWidthAndOffset) { + // Get Axis Length + var axisExtent = model.axis.getExtent(); + var axisLength = axisExtent[1] - axisExtent[0]; // Get bars on current base axis and calculate min and max overflow - var minOverflow = Infinity; - each(barsOnCurrentAxis, function (item) { - minOverflow = Math.min(item.offset, minOverflow); - }); - var maxOverflow = -Infinity; - each(barsOnCurrentAxis, function (item) { - maxOverflow = Math.max(item.offset + item.width, maxOverflow); - }); - minOverflow = Math.abs(minOverflow); - maxOverflow = Math.abs(maxOverflow); - var totalOverFlow = minOverflow + maxOverflow; // Calculate required buffer based on old range and overflow + var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis); - var oldRange = max - min; - var oldRangePercentOfNew = 1 - (minOverflow + maxOverflow) / axisLength; - var overflowBuffer = oldRange / oldRangePercentOfNew - oldRange; - max += overflowBuffer * (maxOverflow / totalOverFlow); - min -= overflowBuffer * (minOverflow / totalOverFlow); + if (barsOnCurrentAxis === undefined) { return { - min: min, - max: max - }; + min: min, + max: max + }; + } + + var minOverflow = Infinity; + each(barsOnCurrentAxis, function (item) { + minOverflow = Math.min(item.offset, minOverflow); + }); + var maxOverflow = -Infinity; + each(barsOnCurrentAxis, function (item) { + maxOverflow = Math.max(item.offset + item.width, maxOverflow); + }); + minOverflow = Math.abs(minOverflow); + maxOverflow = Math.abs(maxOverflow); + var totalOverFlow = minOverflow + maxOverflow; // Calculate required buffer based on old range and overflow + + var oldRange = max - min; + var oldRangePercentOfNew = 1 - (minOverflow + maxOverflow) / axisLength; + var overflowBuffer = oldRange / oldRangePercentOfNew - oldRange; + max += overflowBuffer * (maxOverflow / totalOverFlow); + min -= overflowBuffer * (minOverflow / totalOverFlow); + return { + min: min, + max: max + }; } // Precondition of calling this method: // The scale extent has been initailized using series data extent via // `scale.setExtent` or `scale.unionExtentFromData`; function niceScaleExtent(scale, inModel) { - var model = inModel; - var extentInfo = getScaleExtent(scale, model); - var extent = extentInfo.extent; - var splitNumber = model.get('splitNumber'); - - if (scale instanceof LogScale) { - scale.base = model.get('logBase'); - } - - var scaleType = scale.type; - var interval = model.get('interval'); - var isIntervalOrTime = scaleType === 'interval' || scaleType === 'time'; - scale.setExtent(extent[0], extent[1]); - scale.calcNiceExtent({ - splitNumber: splitNumber, - fixMin: extentInfo.fixMin, - fixMax: extentInfo.fixMax, - minInterval: isIntervalOrTime ? model.get('minInterval') : null, - maxInterval: isIntervalOrTime ? model.get('maxInterval') : null - }); // If some one specified the min, max. And the default calculated interval - // is not good enough. He can specify the interval. It is often appeared - // in angle axis with angle 0 - 360. Interval calculated in interval scale is hard - // to be 60. - // FIXME - - if (interval != null) { - scale.setInterval && scale.setInterval(interval); - } + var model = inModel; + var extentInfo = getScaleExtent(scale, model); + var extent = extentInfo.extent; + var splitNumber = model.get('splitNumber'); + + if (scale instanceof LogScale) { + scale.base = model.get('logBase'); + } + + var scaleType = scale.type; + var interval = model.get('interval'); + var isIntervalOrTime = scaleType === 'interval' || scaleType === 'time'; + scale.setExtent(extent[0], extent[1]); + scale.calcNiceExtent({ + splitNumber: splitNumber, + fixMin: extentInfo.fixMin, + fixMax: extentInfo.fixMax, + minInterval: isIntervalOrTime ? model.get('minInterval') : null, + maxInterval: isIntervalOrTime ? model.get('maxInterval') : null + }); // If some one specified the min, max. And the default calculated interval + // is not good enough. He can specify the interval. It is often appeared + // in angle axis with angle 0 - 360. Interval calculated in interval scale is hard + // to be 60. + // FIXME + + if (interval != null) { + scale.setInterval && scale.setInterval(interval); + } } /** * @param axisType Default retrieve from model.type */ function createScaleByModel(model, axisType) { - axisType = axisType || model.get('type'); - - if (axisType) { - switch (axisType) { - // Buildin scale - case 'category': - return new OrdinalScale({ - ordinalMeta: model.getOrdinalMeta ? model.getOrdinalMeta() : model.getCategories(), - extent: [Infinity, -Infinity] - }); + axisType = axisType || model.get('type'); + + if (axisType) { + switch (axisType) { + // Buildin scale + case 'category': + return new OrdinalScale({ + ordinalMeta: model.getOrdinalMeta ? model.getOrdinalMeta() : model.getCategories(), + extent: [Infinity, -Infinity] + }); - case 'time': - return new TimeScale({ - locale: model.ecModel.getLocaleModel(), - useUTC: model.ecModel.get('useUTC') - }); + case 'time': + return new TimeScale({ + locale: model.ecModel.getLocaleModel(), + useUTC: model.ecModel.get('useUTC') + }); - default: - // case 'value'/'interval', 'log', or others. - return new (Scale.getClass(axisType) || IntervalScale)(); - } + default: + // case 'value'/'interval', 'log', or others. + return new (Scale.getClass(axisType) || IntervalScale)(); } + } } /** * Check if the axis cross 0 */ function ifAxisCrossZero(axis) { - var dataExtent = axis.scale.getExtent(); - var min = dataExtent[0]; - var max = dataExtent[1]; - return !(min > 0 && max > 0 || min < 0 && max < 0); + var dataExtent = axis.scale.getExtent(); + var min = dataExtent[0]; + var max = dataExtent[1]; + return !(min > 0 && max > 0 || min < 0 && max < 0); } /** * @param axis @@ -35472,54 +35472,54 @@ */ function makeLabelFormatter(axis) { - var labelFormatter = axis.getLabelModel().get('formatter'); - var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null; - - if (axis.scale.type === 'time') { - return function (tpl) { - return function (tick, idx) { - return axis.scale.getFormattedLabel(tick, idx, tpl); - }; - }(labelFormatter); - } else if (isString(labelFormatter)) { - return function (tpl) { - return function (tick) { - // For category axis, get raw value; for numeric axis, - // get formatted label like '1,333,444'. - var label = axis.scale.getLabel(tick); - var text = tpl.replace('{value}', label != null ? label : ''); - return text; - }; - }(labelFormatter); - } else if (isFunction(labelFormatter)) { - return function (cb) { - return function (tick, idx) { - // The original intention of `idx` is "the index of the tick in all ticks". - // But the previous implementation of category axis do not consider the - // `axisLabel.interval`, which cause that, for example, the `interval` is - // `1`, then the ticks "name5", "name7", "name9" are displayed, where the - // corresponding `idx` are `0`, `2`, `4`, but not `0`, `1`, `2`. So we keep - // the definition here for back compatibility. - if (categoryTickStart != null) { - idx = tick.value - categoryTickStart; - } - - return cb(getAxisRawValue(axis, tick), idx, tick.level != null ? { - level: tick.level - } : null); - }; - }(labelFormatter); - } else { - return function (tick) { - return axis.scale.getLabel(tick); - }; - } + var labelFormatter = axis.getLabelModel().get('formatter'); + var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null; + + if (axis.scale.type === 'time') { + return function (tpl) { + return function (tick, idx) { + return axis.scale.getFormattedLabel(tick, idx, tpl); + }; + }(labelFormatter); + } else if (isString(labelFormatter)) { + return function (tpl) { + return function (tick) { + // For category axis, get raw value; for numeric axis, + // get formatted label like '1,333,444'. + var label = axis.scale.getLabel(tick); + var text = tpl.replace('{value}', label != null ? label : ''); + return text; + }; + }(labelFormatter); + } else if (isFunction(labelFormatter)) { + return function (cb) { + return function (tick, idx) { + // The original intention of `idx` is "the index of the tick in all ticks". + // But the previous implementation of category axis do not consider the + // `axisLabel.interval`, which cause that, for example, the `interval` is + // `1`, then the ticks "name5", "name7", "name9" are displayed, where the + // corresponding `idx` are `0`, `2`, `4`, but not `0`, `1`, `2`. So we keep + // the definition here for back compatibility. + if (categoryTickStart != null) { + idx = tick.value - categoryTickStart; + } + + return cb(getAxisRawValue(axis, tick), idx, tick.level != null ? { + level: tick.level + } : null); + }; + }(labelFormatter); + } else { + return function (tick) { + return axis.scale.getLabel(tick); + }; + } } function getAxisRawValue(axis, tick) { - // In category axis with data zoom, tick is not the original - // index of axis.data. So tick should not be exposed to user - // in category axis. - return axis.type === 'category' ? axis.scale.getLabel(tick) : tick.value; + // In category axis with data zoom, tick is not the original + // index of axis.data. So tick should not be exposed to user + // in category axis. + return axis.type === 'category' ? axis.scale.getLabel(tick) : tick.value; } /** * @param axis @@ -35527,54 +35527,54 @@ */ function estimateLabelUnionRect(axis) { - var axisModel = axis.model; - var scale = axis.scale; + var axisModel = axis.model; + var scale = axis.scale; - if (!axisModel.get(['axisLabel', 'show']) || scale.isBlank()) { - return; - } + if (!axisModel.get(['axisLabel', 'show']) || scale.isBlank()) { + return; + } - var realNumberScaleTicks; - var tickCount; - var categoryScaleExtent = scale.getExtent(); // Optimize for large category data, avoid call `getTicks()`. + var realNumberScaleTicks; + var tickCount; + var categoryScaleExtent = scale.getExtent(); // Optimize for large category data, avoid call `getTicks()`. - if (scale instanceof OrdinalScale) { - tickCount = scale.count(); - } else { - realNumberScaleTicks = scale.getTicks(); - tickCount = realNumberScaleTicks.length; - } + if (scale instanceof OrdinalScale) { + tickCount = scale.count(); + } else { + realNumberScaleTicks = scale.getTicks(); + tickCount = realNumberScaleTicks.length; + } - var axisLabelModel = axis.getLabelModel(); - var labelFormatter = makeLabelFormatter(axis); - var rect; - var step = 1; // Simple optimization for large amount of labels + var axisLabelModel = axis.getLabelModel(); + var labelFormatter = makeLabelFormatter(axis); + var rect; + var step = 1; // Simple optimization for large amount of labels - if (tickCount > 40) { - step = Math.ceil(tickCount / 40); - } + if (tickCount > 40) { + step = Math.ceil(tickCount / 40); + } - for (var i = 0; i < tickCount; i += step) { - var tick = realNumberScaleTicks ? realNumberScaleTicks[i] : { - value: categoryScaleExtent[0] + i - }; - var label = labelFormatter(tick, i); - var unrotatedSingleRect = axisLabelModel.getTextRect(label); - var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0); - rect ? rect.union(singleRect) : rect = singleRect; - } + for (var i = 0; i < tickCount; i += step) { + var tick = realNumberScaleTicks ? realNumberScaleTicks[i] : { + value: categoryScaleExtent[0] + i + }; + var label = labelFormatter(tick, i); + var unrotatedSingleRect = axisLabelModel.getTextRect(label); + var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0); + rect ? rect.union(singleRect) : rect = singleRect; + } - return rect; + return rect; } function rotateTextRect(textRect, rotate) { - var rotateRadians = rotate * Math.PI / 180; - var beforeWidth = textRect.width; - var beforeHeight = textRect.height; - var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians)) + Math.abs(beforeHeight * Math.sin(rotateRadians)); - var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians)) + Math.abs(beforeHeight * Math.cos(rotateRadians)); - var rotatedRect = new BoundingRect(textRect.x, textRect.y, afterWidth, afterHeight); - return rotatedRect; + var rotateRadians = rotate * Math.PI / 180; + var beforeWidth = textRect.width; + var beforeHeight = textRect.height; + var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians)) + Math.abs(beforeHeight * Math.sin(rotateRadians)); + var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians)) + Math.abs(beforeHeight * Math.cos(rotateRadians)); + var rotatedRect = new BoundingRect(textRect.x, textRect.y, afterWidth, afterHeight); + return rotatedRect; } /** * @param model axisLabelModel or axisTickModel @@ -35583,8 +35583,8 @@ function getOptionCategoryInterval(model) { - var interval = model.get('interval'); - return interval == null ? 'auto' : interval; + var interval = model.get('interval'); + return interval == null ? 'auto' : interval; } /** * Set `categoryInterval` as 0 implicitly indicates that @@ -35593,33 +35593,33 @@ */ function shouldShowAllLabels(axis) { - return axis.type === 'category' && getOptionCategoryInterval(axis.getLabelModel()) === 0; + return axis.type === 'category' && getOptionCategoryInterval(axis.getLabelModel()) === 0; } function getDataDimensionsOnAxis(data, axisDim) { - // Remove duplicated dat dimensions caused by `getStackedDimension`. - var dataDimMap = {}; // Currently `mapDimensionsAll` will contain stack result dimension ('__\0ecstackresult'). - // PENDING: is it reasonable? Do we need to remove the original dim from "coord dim" since - // there has been stacked result dim? - - each(data.mapDimensionsAll(axisDim), function (dataDim) { - // For example, the extent of the original dimension - // is [0.1, 0.5], the extent of the `stackResultDimension` - // is [7, 9], the final extent should NOT include [0.1, 0.5], - // because there is no graphic corresponding to [0.1, 0.5]. - // See the case in `test/area-stack.html` `main1`, where area line - // stack needs `yAxis` not start from 0. - dataDimMap[getStackedDimension(data, dataDim)] = true; - }); - return keys(dataDimMap); + // Remove duplicated dat dimensions caused by `getStackedDimension`. + var dataDimMap = {}; // Currently `mapDimensionsAll` will contain stack result dimension ('__\0ecstackresult'). + // PENDING: is it reasonable? Do we need to remove the original dim from "coord dim" since + // there has been stacked result dim? + + each(data.mapDimensionsAll(axisDim), function (dataDim) { + // For example, the extent of the original dimension + // is [0.1, 0.5], the extent of the `stackResultDimension` + // is [7, 9], the final extent should NOT include [0.1, 0.5], + // because there is no graphic corresponding to [0.1, 0.5]. + // See the case in `test/area-stack.html` `main1`, where area line + // stack needs `yAxis` not start from 0. + dataDimMap[getStackedDimension(data, dataDim)] = true; + }); + return keys(dataDimMap); } function unionAxisExtentFromData(dataExtent, data, axisDim) { - if (data) { - each(getDataDimensionsOnAxis(data, axisDim), function (dim) { - var seriesExtent = data.getApproximateExtent(dim); - seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]); - seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]); - }); - } + if (data) { + each(getDataDimensionsOnAxis(data, axisDim), function (dim) { + var seriesExtent = data.getApproximateExtent(dim); + seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]); + seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]); + }); + } } /* @@ -35666,38 +35666,38 @@ */ // eslint-disable-next-line @typescript-eslint/no-unused-vars var AxisModelCommonMixin = - /** @class */ - function () { - function AxisModelCommonMixin() {} - - AxisModelCommonMixin.prototype.getNeedCrossZero = function () { - var option = this.option; - return !option.scale; - }; - /** - * Should be implemented by each axis model if necessary. - * @return coordinate system model - */ + /** @class */ + function () { + function AxisModelCommonMixin() {} + + AxisModelCommonMixin.prototype.getNeedCrossZero = function () { + var option = this.option; + return !option.scale; + }; + /** + * Should be implemented by each axis model if necessary. + * @return coordinate system model + */ - AxisModelCommonMixin.prototype.getCoordSysModel = function () { - return; - }; + AxisModelCommonMixin.prototype.getCoordSysModel = function () { + return; + }; - return AxisModelCommonMixin; - }(); + return AxisModelCommonMixin; + }(); /** * Create a muti dimension List structure from seriesModel. */ function createList(seriesModel) { - return createSeriesData(null, seriesModel); + return createSeriesData(null, seriesModel); } // export function createGraph(seriesModel) { var dataStack$1 = { - isDimensionStacked: isDimensionStacked, - enableDataStack: enableDataStack, - getStackedDimension: getStackedDimension + isDimensionStacked: isDimensionStacked, + enableDataStack: enableDataStack, + getStackedDimension: getStackedDimension }; /** * Create scale @@ -35707,23 +35707,23 @@ */ function createScale(dataExtent, option) { - var axisModel = option; - - if (!(option instanceof Model)) { - axisModel = new Model(option); // FIXME - // Currently AxisModelCommonMixin has nothing to do with the - // the requirements of `axisHelper.createScaleByModel`. For - // example the method `getCategories` and `getOrdinalMeta` - // are required for `'category'` axis, and ecModel are required - // for `'time'` axis. But occationally echarts-gl happened - // to only use `'value'` axis. - // zrUtil.mixin(axisModel, AxisModelCommonMixin); - } - - var scale = createScaleByModel(axisModel); - scale.setExtent(dataExtent[0], dataExtent[1]); - niceScaleExtent(scale, axisModel); - return scale; + var axisModel = option; + + if (!(option instanceof Model)) { + axisModel = new Model(option); // FIXME + // Currently AxisModelCommonMixin has nothing to do with the + // the requirements of `axisHelper.createScaleByModel`. For + // example the method `getCategories` and `getOrdinalMeta` + // are required for `'category'` axis, and ecModel are required + // for `'time'` axis. But occationally echarts-gl happened + // to only use `'value'` axis. + // zrUtil.mixin(axisModel, AxisModelCommonMixin); + } + + var scale = createScaleByModel(axisModel); + scale.setExtent(dataExtent[0], dataExtent[1]); + niceScaleExtent(scale, axisModel); + return scale; } /** * Mixin common methods to axis model, @@ -35737,11 +35737,11 @@ */ function mixinAxisModelCommonMethods(Model) { - mixin(Model, AxisModelCommonMixin); + mixin(Model, AxisModelCommonMixin); } function createTextStyle$1(textStyleModel, opts) { - opts = opts || {}; - return createTextStyle(textStyleModel, null, null, opts.state !== 'normal'); + opts = opts || {}; + return createTextStyle(textStyleModel, null, null, opts.state !== 'normal'); } var helper = /*#__PURE__*/Object.freeze({ @@ -35783,414 +35783,414 @@ var TMP_TRANSFORM = []; function transformPoints(points, transform) { - for (var p = 0; p < points.length; p++) { - applyTransform(points[p], points[p], transform); - } + for (var p = 0; p < points.length; p++) { + applyTransform(points[p], points[p], transform); + } } function updateBBoxFromPoints(points, min$1, max$1, projection) { - for (var i = 0; i < points.length; i++) { - var p = points[i]; + for (var i = 0; i < points.length; i++) { + var p = points[i]; - if (projection) { - // projection may return null point. - p = projection.project(p); - } + if (projection) { + // projection may return null point. + p = projection.project(p); + } - if (p && isFinite(p[0]) && isFinite(p[1])) { - min(min$1, min$1, p); - max(max$1, max$1, p); - } + if (p && isFinite(p[0]) && isFinite(p[1])) { + min(min$1, min$1, p); + max(max$1, max$1, p); } + } } function centroid(points) { - var signedArea = 0; - var cx = 0; - var cy = 0; - var len = points.length; - var x0 = points[len - 1][0]; - var y0 = points[len - 1][1]; // Polygon should been closed. - - for (var i = 0; i < len; i++) { - var x1 = points[i][0]; - var y1 = points[i][1]; - var a = x0 * y1 - x1 * y0; - signedArea += a; - cx += (x0 + x1) * a; - cy += (y0 + y1) * a; - x0 = x1; - y0 = y1; - } - - return signedArea ? [cx / signedArea / 3, cy / signedArea / 3, signedArea] : [points[0][0] || 0, points[0][1] || 0]; + var signedArea = 0; + var cx = 0; + var cy = 0; + var len = points.length; + var x0 = points[len - 1][0]; + var y0 = points[len - 1][1]; // Polygon should been closed. + + for (var i = 0; i < len; i++) { + var x1 = points[i][0]; + var y1 = points[i][1]; + var a = x0 * y1 - x1 * y0; + signedArea += a; + cx += (x0 + x1) * a; + cy += (y0 + y1) * a; + x0 = x1; + y0 = y1; + } + + return signedArea ? [cx / signedArea / 3, cy / signedArea / 3, signedArea] : [points[0][0] || 0, points[0][1] || 0]; } var Region = - /** @class */ - function () { - function Region(name) { - this.name = name; - } - - Region.prototype.setCenter = function (center) { - this._center = center; - }; - /** - * Get center point in data unit. That is, - * for GeoJSONRegion, the unit is lat/lng, - * for GeoSVGRegion, the unit is SVG local coord. - */ + /** @class */ + function () { + function Region(name) { + this.name = name; + } + + Region.prototype.setCenter = function (center) { + this._center = center; + }; + /** + * Get center point in data unit. That is, + * for GeoJSONRegion, the unit is lat/lng, + * for GeoSVGRegion, the unit is SVG local coord. + */ - Region.prototype.getCenter = function () { - var center = this._center; + Region.prototype.getCenter = function () { + var center = this._center; - if (!center) { - // In most cases there are no need to calculate this center. - // So calculate only when called. - center = this._center = this.calcCenter(); - } + if (!center) { + // In most cases there are no need to calculate this center. + // So calculate only when called. + center = this._center = this.calcCenter(); + } - return center; - }; + return center; + }; - return Region; - }(); + return Region; + }(); var GeoJSONPolygonGeometry = - /** @class */ - function () { - function GeoJSONPolygonGeometry(exterior, interiors) { - this.type = 'polygon'; - this.exterior = exterior; - this.interiors = interiors; - } - - return GeoJSONPolygonGeometry; - }(); + /** @class */ + function () { + function GeoJSONPolygonGeometry(exterior, interiors) { + this.type = 'polygon'; + this.exterior = exterior; + this.interiors = interiors; + } + + return GeoJSONPolygonGeometry; + }(); var GeoJSONLineStringGeometry = - /** @class */ - function () { - function GeoJSONLineStringGeometry(points) { - this.type = 'linestring'; - this.points = points; - } - - return GeoJSONLineStringGeometry; - }(); + /** @class */ + function () { + function GeoJSONLineStringGeometry(points) { + this.type = 'linestring'; + this.points = points; + } + + return GeoJSONLineStringGeometry; + }(); var GeoJSONRegion = - /** @class */ - function (_super) { - __extends(GeoJSONRegion, _super); - - function GeoJSONRegion(name, geometries, cp) { - var _this = _super.call(this, name) || this; - - _this.type = 'geoJSON'; - _this.geometries = geometries; - _this._center = cp && [cp[0], cp[1]]; - return _this; - } - - GeoJSONRegion.prototype.calcCenter = function () { - var geometries = this.geometries; - var largestGeo; - var largestGeoSize = 0; + /** @class */ + function (_super) { + __extends(GeoJSONRegion, _super); - for (var i = 0; i < geometries.length; i++) { - var geo = geometries[i]; - var exterior = geo.exterior; // Simple trick to use points count instead of polygon area as region size. - // Ignore linestring + function GeoJSONRegion(name, geometries, cp) { + var _this = _super.call(this, name) || this; - var size = exterior && exterior.length; + _this.type = 'geoJSON'; + _this.geometries = geometries; + _this._center = cp && [cp[0], cp[1]]; + return _this; + } - if (size > largestGeoSize) { - largestGeo = geo; - largestGeoSize = size; - } - } + GeoJSONRegion.prototype.calcCenter = function () { + var geometries = this.geometries; + var largestGeo; + var largestGeoSize = 0; - if (largestGeo) { - return centroid(largestGeo.exterior); - } // from bounding rect by default. + for (var i = 0; i < geometries.length; i++) { + var geo = geometries[i]; + var exterior = geo.exterior; // Simple trick to use points count instead of polygon area as region size. + // Ignore linestring + var size = exterior && exterior.length; - var rect = this.getBoundingRect(); - return [rect.x + rect.width / 2, rect.y + rect.height / 2]; - }; + if (size > largestGeoSize) { + largestGeo = geo; + largestGeoSize = size; + } + } - GeoJSONRegion.prototype.getBoundingRect = function (projection) { - var rect = this._rect; // Always recalculate if using projection. + if (largestGeo) { + return centroid(largestGeo.exterior); + } // from bounding rect by default. - if (rect && !projection) { - return rect; - } - var min = [Infinity, Infinity]; - var max = [-Infinity, -Infinity]; - var geometries = this.geometries; - each(geometries, function (geo) { - if (geo.type === 'polygon') { - // Doesn't consider hole - updateBBoxFromPoints(geo.exterior, min, max, projection); - } else { - each(geo.points, function (points) { - updateBBoxFromPoints(points, min, max, projection); - }); - } - }); // Normalie invalid bounding. + var rect = this.getBoundingRect(); + return [rect.x + rect.width / 2, rect.y + rect.height / 2]; + }; + + GeoJSONRegion.prototype.getBoundingRect = function (projection) { + var rect = this._rect; // Always recalculate if using projection. + + if (rect && !projection) { + return rect; + } + + var min = [Infinity, Infinity]; + var max = [-Infinity, -Infinity]; + var geometries = this.geometries; + each(geometries, function (geo) { + if (geo.type === 'polygon') { + // Doesn't consider hole + updateBBoxFromPoints(geo.exterior, min, max, projection); + } else { + each(geo.points, function (points) { + updateBBoxFromPoints(points, min, max, projection); + }); + } + }); // Normalie invalid bounding. - if (!(isFinite(min[0]) && isFinite(min[1]) && isFinite(max[0]) && isFinite(max[1]))) { - min[0] = min[1] = max[0] = max[1] = 0; - } + if (!(isFinite(min[0]) && isFinite(min[1]) && isFinite(max[0]) && isFinite(max[1]))) { + min[0] = min[1] = max[0] = max[1] = 0; + } - rect = new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]); + rect = new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]); - if (!projection) { - this._rect = rect; - } + if (!projection) { + this._rect = rect; + } - return rect; - }; + return rect; + }; - GeoJSONRegion.prototype.contain = function (coord) { - var rect = this.getBoundingRect(); - var geometries = this.geometries; + GeoJSONRegion.prototype.contain = function (coord) { + var rect = this.getBoundingRect(); + var geometries = this.geometries; - if (!rect.contain(coord[0], coord[1])) { - return false; - } + if (!rect.contain(coord[0], coord[1])) { + return false; + } - loopGeo: for (var i = 0, len = geometries.length; i < len; i++) { - var geo = geometries[i]; // Only support polygon. + loopGeo: for (var i = 0, len = geometries.length; i < len; i++) { + var geo = geometries[i]; // Only support polygon. - if (geo.type !== 'polygon') { - continue; - } + if (geo.type !== 'polygon') { + continue; + } - var exterior = geo.exterior; - var interiors = geo.interiors; + var exterior = geo.exterior; + var interiors = geo.interiors; - if (contain$2(exterior, coord[0], coord[1])) { - // Not in the region if point is in the hole. - for (var k = 0; k < (interiors ? interiors.length : 0); k++) { - if (contain$2(interiors[k], coord[0], coord[1])) { - continue loopGeo; - } - } + if (contain$2(exterior, coord[0], coord[1])) { + // Not in the region if point is in the hole. + for (var k = 0; k < (interiors ? interiors.length : 0); k++) { + if (contain$2(interiors[k], coord[0], coord[1])) { + continue loopGeo; + } + } - return true; - } - } + return true; + } + } - return false; - }; - /** - * Transform the raw coords to target bounding. - * @param x - * @param y - * @param width - * @param height - */ + return false; + }; + /** + * Transform the raw coords to target bounding. + * @param x + * @param y + * @param width + * @param height + */ - GeoJSONRegion.prototype.transformTo = function (x, y, width, height) { - var rect = this.getBoundingRect(); - var aspect = rect.width / rect.height; + GeoJSONRegion.prototype.transformTo = function (x, y, width, height) { + var rect = this.getBoundingRect(); + var aspect = rect.width / rect.height; - if (!width) { - width = aspect * height; - } else if (!height) { - height = width / aspect; - } + if (!width) { + width = aspect * height; + } else if (!height) { + height = width / aspect; + } - var target = new BoundingRect(x, y, width, height); - var transform = rect.calculateTransform(target); - var geometries = this.geometries; + var target = new BoundingRect(x, y, width, height); + var transform = rect.calculateTransform(target); + var geometries = this.geometries; - for (var i = 0; i < geometries.length; i++) { - var geo = geometries[i]; + for (var i = 0; i < geometries.length; i++) { + var geo = geometries[i]; - if (geo.type === 'polygon') { - transformPoints(geo.exterior, transform); - each(geo.interiors, function (interior) { - transformPoints(interior, transform); - }); - } else { - each(geo.points, function (points) { - transformPoints(points, transform); - }); - } - } + if (geo.type === 'polygon') { + transformPoints(geo.exterior, transform); + each(geo.interiors, function (interior) { + transformPoints(interior, transform); + }); + } else { + each(geo.points, function (points) { + transformPoints(points, transform); + }); + } + } - rect = this._rect; - rect.copy(target); // Update center + rect = this._rect; + rect.copy(target); // Update center - this._center = [rect.x + rect.width / 2, rect.y + rect.height / 2]; - }; + this._center = [rect.x + rect.width / 2, rect.y + rect.height / 2]; + }; - GeoJSONRegion.prototype.cloneShallow = function (name) { - name == null && (name = this.name); - var newRegion = new GeoJSONRegion(name, this.geometries, this._center); - newRegion._rect = this._rect; - newRegion.transformTo = null; // Simply avoid to be called. + GeoJSONRegion.prototype.cloneShallow = function (name) { + name == null && (name = this.name); + var newRegion = new GeoJSONRegion(name, this.geometries, this._center); + newRegion._rect = this._rect; + newRegion.transformTo = null; // Simply avoid to be called. - return newRegion; - }; + return newRegion; + }; - return GeoJSONRegion; - }(Region); + return GeoJSONRegion; + }(Region); var GeoSVGRegion = - /** @class */ - function (_super) { - __extends(GeoSVGRegion, _super); + /** @class */ + function (_super) { + __extends(GeoSVGRegion, _super); - function GeoSVGRegion(name, elOnlyForCalculate) { - var _this = _super.call(this, name) || this; + function GeoSVGRegion(name, elOnlyForCalculate) { + var _this = _super.call(this, name) || this; - _this.type = 'geoSVG'; - _this._elOnlyForCalculate = elOnlyForCalculate; - return _this; - } + _this.type = 'geoSVG'; + _this._elOnlyForCalculate = elOnlyForCalculate; + return _this; + } - GeoSVGRegion.prototype.calcCenter = function () { - var el = this._elOnlyForCalculate; - var rect = el.getBoundingRect(); - var center = [rect.x + rect.width / 2, rect.y + rect.height / 2]; - var mat = identity(TMP_TRANSFORM); - var target = el; + GeoSVGRegion.prototype.calcCenter = function () { + var el = this._elOnlyForCalculate; + var rect = el.getBoundingRect(); + var center = [rect.x + rect.width / 2, rect.y + rect.height / 2]; + var mat = identity(TMP_TRANSFORM); + var target = el; - while (target && !target.isGeoSVGGraphicRoot) { - mul$1(mat, target.getLocalTransform(), mat); - target = target.parent; - } + while (target && !target.isGeoSVGGraphicRoot) { + mul$1(mat, target.getLocalTransform(), mat); + target = target.parent; + } - invert(mat, mat); - applyTransform(center, center, mat); - return center; - }; + invert(mat, mat); + applyTransform(center, center, mat); + return center; + }; - return GeoSVGRegion; - }(Region); + return GeoSVGRegion; + }(Region); function decode(json) { - if (!json.UTF8Encoding) { - return json; - } + if (!json.UTF8Encoding) { + return json; + } - var jsonCompressed = json; - var encodeScale = jsonCompressed.UTF8Scale; + var jsonCompressed = json; + var encodeScale = jsonCompressed.UTF8Scale; - if (encodeScale == null) { - encodeScale = 1024; - } + if (encodeScale == null) { + encodeScale = 1024; + } - var features = jsonCompressed.features; - each(features, function (feature) { - var geometry = feature.geometry; - var encodeOffsets = geometry.encodeOffsets; - var coordinates = geometry.coordinates; // Geometry may be appeded manually in the script after json loaded. - // In this case this geometry is usually not encoded. + var features = jsonCompressed.features; + each(features, function (feature) { + var geometry = feature.geometry; + var encodeOffsets = geometry.encodeOffsets; + var coordinates = geometry.coordinates; // Geometry may be appeded manually in the script after json loaded. + // In this case this geometry is usually not encoded. - if (!encodeOffsets) { - return; - } + if (!encodeOffsets) { + return; + } - switch (geometry.type) { - case 'LineString': - geometry.coordinates = decodeRing(coordinates, encodeOffsets, encodeScale); - break; + switch (geometry.type) { + case 'LineString': + geometry.coordinates = decodeRing(coordinates, encodeOffsets, encodeScale); + break; - case 'Polygon': - decodeRings(coordinates, encodeOffsets, encodeScale); - break; + case 'Polygon': + decodeRings(coordinates, encodeOffsets, encodeScale); + break; - case 'MultiLineString': - decodeRings(coordinates, encodeOffsets, encodeScale); - break; + case 'MultiLineString': + decodeRings(coordinates, encodeOffsets, encodeScale); + break; - case 'MultiPolygon': - each(coordinates, function (rings, idx) { - return decodeRings(rings, encodeOffsets[idx], encodeScale); - }); - } - }); // Has been decoded + case 'MultiPolygon': + each(coordinates, function (rings, idx) { + return decodeRings(rings, encodeOffsets[idx], encodeScale); + }); + } + }); // Has been decoded - jsonCompressed.UTF8Encoding = false; - return jsonCompressed; + jsonCompressed.UTF8Encoding = false; + return jsonCompressed; } function decodeRings(rings, encodeOffsets, encodeScale) { - for (var c = 0; c < rings.length; c++) { - rings[c] = decodeRing(rings[c], encodeOffsets[c], encodeScale); - } + for (var c = 0; c < rings.length; c++) { + rings[c] = decodeRing(rings[c], encodeOffsets[c], encodeScale); + } } function decodeRing(coordinate, encodeOffsets, encodeScale) { - var result = []; - var prevX = encodeOffsets[0]; - var prevY = encodeOffsets[1]; + var result = []; + var prevX = encodeOffsets[0]; + var prevY = encodeOffsets[1]; - for (var i = 0; i < coordinate.length; i += 2) { - var x = coordinate.charCodeAt(i) - 64; - var y = coordinate.charCodeAt(i + 1) - 64; // ZigZag decoding + for (var i = 0; i < coordinate.length; i += 2) { + var x = coordinate.charCodeAt(i) - 64; + var y = coordinate.charCodeAt(i + 1) - 64; // ZigZag decoding - x = x >> 1 ^ -(x & 1); - y = y >> 1 ^ -(y & 1); // Delta deocding + x = x >> 1 ^ -(x & 1); + y = y >> 1 ^ -(y & 1); // Delta deocding - x += prevX; - y += prevY; - prevX = x; - prevY = y; // Dequantize + x += prevX; + y += prevY; + prevX = x; + prevY = y; // Dequantize - result.push([x / encodeScale, y / encodeScale]); - } + result.push([x / encodeScale, y / encodeScale]); + } - return result; + return result; } function parseGeoJSON(geoJson, nameProperty) { - geoJson = decode(geoJson); - return map(filter(geoJson.features, function (featureObj) { - // Output of mapshaper may have geometry null - return featureObj.geometry && featureObj.properties && featureObj.geometry.coordinates.length > 0; - }), function (featureObj) { - var properties = featureObj.properties; - var geo = featureObj.geometry; - var geometries = []; - - switch (geo.type) { - case 'Polygon': - var coordinates = geo.coordinates; // According to the GeoJSON specification. - // First must be exterior, and the rest are all interior(holes). - - geometries.push(new GeoJSONPolygonGeometry(coordinates[0], coordinates.slice(1))); - break; - - case 'MultiPolygon': - each(geo.coordinates, function (item) { - if (item[0]) { - geometries.push(new GeoJSONPolygonGeometry(item[0], item.slice(1))); - } - }); - break; + geoJson = decode(geoJson); + return map(filter(geoJson.features, function (featureObj) { + // Output of mapshaper may have geometry null + return featureObj.geometry && featureObj.properties && featureObj.geometry.coordinates.length > 0; + }), function (featureObj) { + var properties = featureObj.properties; + var geo = featureObj.geometry; + var geometries = []; + + switch (geo.type) { + case 'Polygon': + var coordinates = geo.coordinates; // According to the GeoJSON specification. + // First must be exterior, and the rest are all interior(holes). + + geometries.push(new GeoJSONPolygonGeometry(coordinates[0], coordinates.slice(1))); + break; + + case 'MultiPolygon': + each(geo.coordinates, function (item) { + if (item[0]) { + geometries.push(new GeoJSONPolygonGeometry(item[0], item.slice(1))); + } + }); + break; - case 'LineString': - geometries.push(new GeoJSONLineStringGeometry([geo.coordinates])); - break; + case 'LineString': + geometries.push(new GeoJSONLineStringGeometry([geo.coordinates])); + break; - case 'MultiLineString': - geometries.push(new GeoJSONLineStringGeometry(geo.coordinates)); - } + case 'MultiLineString': + geometries.push(new GeoJSONLineStringGeometry(geo.coordinates)); + } - var region = new GeoJSONRegion(properties[nameProperty || 'name'], geometries, properties.cp); - region.properties = properties; - return region; - }); + var region = new GeoJSONRegion(properties[nameProperty || 'name'], geometries, properties.cp); + region.properties = properties; + return region; + }); } var number = /*#__PURE__*/Object.freeze({ @@ -36293,8 +36293,8 @@ var inner$5 = makeInner(); function createAxisLabels(axis) { - // Only ordinal scale support tick interval - return axis.type === 'category' ? makeCategoryLabels(axis) : makeRealNumberLabels(axis); + // Only ordinal scale support tick interval + return axis.type === 'category' ? makeCategoryLabels(axis) : makeRealNumberLabels(axis); } /** * @param {module:echats/coord/Axis} axis @@ -36306,128 +36306,128 @@ */ function createAxisTicks(axis, tickModel) { - // Only ordinal scale support tick interval - return axis.type === 'category' ? makeCategoryTicks(axis, tickModel) : { - ticks: map(axis.scale.getTicks(), function (tick) { - return tick.value; - }) - }; + // Only ordinal scale support tick interval + return axis.type === 'category' ? makeCategoryTicks(axis, tickModel) : { + ticks: map(axis.scale.getTicks(), function (tick) { + return tick.value; + }) + }; } function makeCategoryLabels(axis) { - var labelModel = axis.getLabelModel(); - var result = makeCategoryLabelsActually(axis, labelModel); - return !labelModel.get('show') || axis.scale.isBlank() ? { - labels: [], - labelCategoryInterval: result.labelCategoryInterval - } : result; + var labelModel = axis.getLabelModel(); + var result = makeCategoryLabelsActually(axis, labelModel); + return !labelModel.get('show') || axis.scale.isBlank() ? { + labels: [], + labelCategoryInterval: result.labelCategoryInterval + } : result; } function makeCategoryLabelsActually(axis, labelModel) { - var labelsCache = getListCache(axis, 'labels'); - var optionLabelInterval = getOptionCategoryInterval(labelModel); - var result = listCacheGet(labelsCache, optionLabelInterval); + var labelsCache = getListCache(axis, 'labels'); + var optionLabelInterval = getOptionCategoryInterval(labelModel); + var result = listCacheGet(labelsCache, optionLabelInterval); - if (result) { - return result; - } + if (result) { + return result; + } - var labels; - var numericLabelInterval; + var labels; + var numericLabelInterval; - if (isFunction(optionLabelInterval)) { - labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval); - } else { - numericLabelInterval = optionLabelInterval === 'auto' ? makeAutoCategoryInterval(axis) : optionLabelInterval; - labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval); - } // Cache to avoid calling interval function repeatly. + if (isFunction(optionLabelInterval)) { + labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval); + } else { + numericLabelInterval = optionLabelInterval === 'auto' ? makeAutoCategoryInterval(axis) : optionLabelInterval; + labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval); + } // Cache to avoid calling interval function repeatly. - return listCacheSet(labelsCache, optionLabelInterval, { - labels: labels, - labelCategoryInterval: numericLabelInterval - }); + return listCacheSet(labelsCache, optionLabelInterval, { + labels: labels, + labelCategoryInterval: numericLabelInterval + }); } function makeCategoryTicks(axis, tickModel) { - var ticksCache = getListCache(axis, 'ticks'); - var optionTickInterval = getOptionCategoryInterval(tickModel); - var result = listCacheGet(ticksCache, optionTickInterval); - - if (result) { - return result; - } - - var ticks; - var tickCategoryInterval; // Optimize for the case that large category data and no label displayed, - // we should not return all ticks. - - if (!tickModel.get('show') || axis.scale.isBlank()) { - ticks = []; - } + var ticksCache = getListCache(axis, 'ticks'); + var optionTickInterval = getOptionCategoryInterval(tickModel); + var result = listCacheGet(ticksCache, optionTickInterval); - if (isFunction(optionTickInterval)) { - ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true); - } // Always use label interval by default despite label show. Consider this - // scenario, Use multiple grid with the xAxis sync, and only one xAxis shows - // labels. `splitLine` and `axisTick` should be consistent in this case. - else if (optionTickInterval === 'auto') { - var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel()); - tickCategoryInterval = labelsResult.labelCategoryInterval; - ticks = map(labelsResult.labels, function (labelItem) { - return labelItem.tickValue; - }); + if (result) { + return result; + } + + var ticks; + var tickCategoryInterval; // Optimize for the case that large category data and no label displayed, + // we should not return all ticks. + + if (!tickModel.get('show') || axis.scale.isBlank()) { + ticks = []; + } + + if (isFunction(optionTickInterval)) { + ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true); + } // Always use label interval by default despite label show. Consider this + // scenario, Use multiple grid with the xAxis sync, and only one xAxis shows + // labels. `splitLine` and `axisTick` should be consistent in this case. + else if (optionTickInterval === 'auto') { + var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel()); + tickCategoryInterval = labelsResult.labelCategoryInterval; + ticks = map(labelsResult.labels, function (labelItem) { + return labelItem.tickValue; + }); } else { - tickCategoryInterval = optionTickInterval; - ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true); + tickCategoryInterval = optionTickInterval; + ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true); } // Cache to avoid calling interval function repeatly. - return listCacheSet(ticksCache, optionTickInterval, { - ticks: ticks, - tickCategoryInterval: tickCategoryInterval - }); + return listCacheSet(ticksCache, optionTickInterval, { + ticks: ticks, + tickCategoryInterval: tickCategoryInterval + }); } function makeRealNumberLabels(axis) { - var ticks = axis.scale.getTicks(); - var labelFormatter = makeLabelFormatter(axis); - return { - labels: map(ticks, function (tick, idx) { - return { - level: tick.level, - formattedLabel: labelFormatter(tick, idx), - rawLabel: axis.scale.getLabel(tick), - tickValue: tick.value - }; - }) - }; + var ticks = axis.scale.getTicks(); + var labelFormatter = makeLabelFormatter(axis); + return { + labels: map(ticks, function (tick, idx) { + return { + level: tick.level, + formattedLabel: labelFormatter(tick, idx), + rawLabel: axis.scale.getLabel(tick), + tickValue: tick.value + }; + }) + }; } function getListCache(axis, prop) { - // Because key can be funciton, and cache size always be small, we use array cache. - return inner$5(axis)[prop] || (inner$5(axis)[prop] = []); + // Because key can be funciton, and cache size always be small, we use array cache. + return inner$5(axis)[prop] || (inner$5(axis)[prop] = []); } function listCacheGet(cache, key) { - for (var i = 0; i < cache.length; i++) { - if (cache[i].key === key) { - return cache[i].value; - } + for (var i = 0; i < cache.length; i++) { + if (cache[i].key === key) { + return cache[i].value; } + } } function listCacheSet(cache, key, value) { - cache.push({ - key: key, - value: value - }); - return value; + cache.push({ + key: key, + value: value + }); + return value; } function makeAutoCategoryInterval(axis) { - var result = inner$5(axis).autoInterval; - return result != null ? result : inner$5(axis).autoInterval = axis.calculateCategoryInterval(); + var result = inner$5(axis).autoInterval; + return result != null ? result : inner$5(axis).autoInterval = axis.calculateCategoryInterval(); } /** * Calculate interval for category axis ticks and labels. @@ -36437,166 +36437,166 @@ function calculateCategoryInterval(axis) { - var params = fetchAutoCategoryIntervalCalculationParams(axis); - var labelFormatter = makeLabelFormatter(axis); - var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI; - var ordinalScale = axis.scale; - var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization: - // avoid generating a long array by `getTicks` - // in large category data case. - - var tickCount = ordinalScale.count(); - - if (ordinalExtent[1] - ordinalExtent[0] < 1) { - return 0; - } - - var step = 1; // Simple optimization. Empirical value: tick count should less than 40. - - if (tickCount > 40) { - step = Math.max(1, Math.floor(tickCount / 40)); - } - - var tickValue = ordinalExtent[0]; - var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue); - var unitW = Math.abs(unitSpan * Math.cos(rotation)); - var unitH = Math.abs(unitSpan * Math.sin(rotation)); - var maxW = 0; - var maxH = 0; // Caution: Performance sensitive for large category data. - // Consider dataZoom, we should make appropriate step to avoid O(n) loop. - - for (; tickValue <= ordinalExtent[1]; tickValue += step) { - var width = 0; - var height = 0; // Not precise, do not consider align and vertical align - // and each distance from axis line yet. - - var rect = getBoundingRect(labelFormatter({ - value: tickValue - }), params.font, 'center', 'top'); // Magic number + var params = fetchAutoCategoryIntervalCalculationParams(axis); + var labelFormatter = makeLabelFormatter(axis); + var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI; + var ordinalScale = axis.scale; + var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization: + // avoid generating a long array by `getTicks` + // in large category data case. - width = rect.width * 1.3; - height = rect.height * 1.3; // Min size, void long loop. + var tickCount = ordinalScale.count(); - maxW = Math.max(maxW, width, 7); - maxH = Math.max(maxH, height, 7); - } + if (ordinalExtent[1] - ordinalExtent[0] < 1) { + return 0; + } - var dw = maxW / unitW; - var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity. + var step = 1; // Simple optimization. Empirical value: tick count should less than 40. - isNaN(dw) && (dw = Infinity); - isNaN(dh) && (dh = Infinity); - var interval = Math.max(0, Math.floor(Math.min(dw, dh))); - var cache = inner$5(axis.model); - var axisExtent = axis.getExtent(); - var lastAutoInterval = cache.lastAutoInterval; - var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window, - // otherwise the calculated interval might jitter when the zoom - // window size is close to the interval-changing size. - // For example, if all of the axis labels are `a, b, c, d, e, f, g`. - // The jitter will cause that sometimes the displayed labels are - // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1). + if (tickCount > 40) { + step = Math.max(1, Math.floor(tickCount / 40)); + } - if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical - // point is not the same when zooming in or zooming out. - && lastAutoInterval > interval // If the axis change is caused by chart resize, the cache should not - // be used. Otherwise some hiden labels might not be shown again. - && cache.axisExtent0 === axisExtent[0] && cache.axisExtent1 === axisExtent[1]) { - interval = lastAutoInterval; - } // Only update cache if cache not used, otherwise the - // changing of interval is too insensitive. - else { - cache.lastTickCount = tickCount; - cache.lastAutoInterval = interval; - cache.axisExtent0 = axisExtent[0]; - cache.axisExtent1 = axisExtent[1]; - } + var tickValue = ordinalExtent[0]; + var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue); + var unitW = Math.abs(unitSpan * Math.cos(rotation)); + var unitH = Math.abs(unitSpan * Math.sin(rotation)); + var maxW = 0; + var maxH = 0; // Caution: Performance sensitive for large category data. + // Consider dataZoom, we should make appropriate step to avoid O(n) loop. - return interval; + for (; tickValue <= ordinalExtent[1]; tickValue += step) { + var width = 0; + var height = 0; // Not precise, do not consider align and vertical align + // and each distance from axis line yet. + + var rect = getBoundingRect(labelFormatter({ + value: tickValue + }), params.font, 'center', 'top'); // Magic number + + width = rect.width * 1.3; + height = rect.height * 1.3; // Min size, void long loop. + + maxW = Math.max(maxW, width, 7); + maxH = Math.max(maxH, height, 7); + } + + var dw = maxW / unitW; + var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity. + + isNaN(dw) && (dw = Infinity); + isNaN(dh) && (dh = Infinity); + var interval = Math.max(0, Math.floor(Math.min(dw, dh))); + var cache = inner$5(axis.model); + var axisExtent = axis.getExtent(); + var lastAutoInterval = cache.lastAutoInterval; + var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window, + // otherwise the calculated interval might jitter when the zoom + // window size is close to the interval-changing size. + // For example, if all of the axis labels are `a, b, c, d, e, f, g`. + // The jitter will cause that sometimes the displayed labels are + // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1). + + if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical + // point is not the same when zooming in or zooming out. + && lastAutoInterval > interval // If the axis change is caused by chart resize, the cache should not + // be used. Otherwise some hiden labels might not be shown again. + && cache.axisExtent0 === axisExtent[0] && cache.axisExtent1 === axisExtent[1]) { + interval = lastAutoInterval; + } // Only update cache if cache not used, otherwise the + // changing of interval is too insensitive. + else { + cache.lastTickCount = tickCount; + cache.lastAutoInterval = interval; + cache.axisExtent0 = axisExtent[0]; + cache.axisExtent1 = axisExtent[1]; + } + + return interval; } function fetchAutoCategoryIntervalCalculationParams(axis) { - var labelModel = axis.getLabelModel(); - return { - axisRotate: axis.getRotate ? axis.getRotate() : axis.isHorizontal && !axis.isHorizontal() ? 90 : 0, - labelRotate: labelModel.get('rotate') || 0, - font: labelModel.getFont() - }; + var labelModel = axis.getLabelModel(); + return { + axisRotate: axis.getRotate ? axis.getRotate() : axis.isHorizontal && !axis.isHorizontal() ? 90 : 0, + labelRotate: labelModel.get('rotate') || 0, + font: labelModel.getFont() + }; } function makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) { - var labelFormatter = makeLabelFormatter(axis); - var ordinalScale = axis.scale; - var ordinalExtent = ordinalScale.getExtent(); - var labelModel = axis.getLabelModel(); - var result = []; // TODO: axisType: ordinalTime, pick the tick from each month/day/year/... - - var step = Math.max((categoryInterval || 0) + 1, 1); - var startTick = ordinalExtent[0]; - var tickCount = ordinalScale.count(); // Calculate start tick based on zero if possible to keep label consistent - // while zooming and moving while interval > 0. Otherwise the selection - // of displayable ticks and symbols probably keep changing. - // 3 is empirical value. - - if (startTick !== 0 && step > 1 && tickCount / step > 2) { - startTick = Math.round(Math.ceil(startTick / step) * step); - } // (1) Only add min max label here but leave overlap checking - // to render stage, which also ensure the returned list - // suitable for splitLine and splitArea rendering. - // (2) Scales except category always contain min max label so - // do not need to perform this process. - - - var showAllLabel = shouldShowAllLabels(axis); - var includeMinLabel = labelModel.get('showMinLabel') || showAllLabel; - var includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel; - - if (includeMinLabel && startTick !== ordinalExtent[0]) { - addItem(ordinalExtent[0]); - } // Optimize: avoid generating large array by `ordinalScale.getTicks()`. - - - var tickValue = startTick; - - for (; tickValue <= ordinalExtent[1]; tickValue += step) { - addItem(tickValue); - } - - if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) { - addItem(ordinalExtent[1]); - } - - function addItem(tickValue) { - var tickObj = { - value: tickValue - }; - result.push(onlyTick ? tickValue : { - formattedLabel: labelFormatter(tickObj), - rawLabel: ordinalScale.getLabel(tickObj), - tickValue: tickValue - }); - } + var labelFormatter = makeLabelFormatter(axis); + var ordinalScale = axis.scale; + var ordinalExtent = ordinalScale.getExtent(); + var labelModel = axis.getLabelModel(); + var result = []; // TODO: axisType: ordinalTime, pick the tick from each month/day/year/... + + var step = Math.max((categoryInterval || 0) + 1, 1); + var startTick = ordinalExtent[0]; + var tickCount = ordinalScale.count(); // Calculate start tick based on zero if possible to keep label consistent + // while zooming and moving while interval > 0. Otherwise the selection + // of displayable ticks and symbols probably keep changing. + // 3 is empirical value. + + if (startTick !== 0 && step > 1 && tickCount / step > 2) { + startTick = Math.round(Math.ceil(startTick / step) * step); + } // (1) Only add min max label here but leave overlap checking + // to render stage, which also ensure the returned list + // suitable for splitLine and splitArea rendering. + // (2) Scales except category always contain min max label so + // do not need to perform this process. + + + var showAllLabel = shouldShowAllLabels(axis); + var includeMinLabel = labelModel.get('showMinLabel') || showAllLabel; + var includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel; + + if (includeMinLabel && startTick !== ordinalExtent[0]) { + addItem(ordinalExtent[0]); + } // Optimize: avoid generating large array by `ordinalScale.getTicks()`. + + + var tickValue = startTick; + + for (; tickValue <= ordinalExtent[1]; tickValue += step) { + addItem(tickValue); + } + + if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) { + addItem(ordinalExtent[1]); + } + + function addItem(tickValue) { + var tickObj = { + value: tickValue + }; + result.push(onlyTick ? tickValue : { + formattedLabel: labelFormatter(tickObj), + rawLabel: ordinalScale.getLabel(tickObj), + tickValue: tickValue + }); + } - return result; + return result; } function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) { - var ordinalScale = axis.scale; - var labelFormatter = makeLabelFormatter(axis); - var result = []; - each(ordinalScale.getTicks(), function (tick) { - var rawLabel = ordinalScale.getLabel(tick); - var tickValue = tick.value; - - if (categoryInterval(tick.value, rawLabel)) { - result.push(onlyTick ? tickValue : { - formattedLabel: labelFormatter(tick), - rawLabel: rawLabel, - tickValue: tickValue - }); - } - }); - return result; + var ordinalScale = axis.scale; + var labelFormatter = makeLabelFormatter(axis); + var result = []; + each(ordinalScale.getTicks(), function (tick) { + var rawLabel = ordinalScale.getLabel(tick); + var tickValue = tick.value; + + if (categoryInterval(tick.value, rawLabel)) { + result.push(onlyTick ? tickValue : { + formattedLabel: labelFormatter(tick), + rawLabel: rawLabel, + tickValue: tickValue + }); + } + }); + return result; } var NORMALIZED_EXTENT = [0, 1]; @@ -36605,208 +36605,208 @@ */ var Axis = - /** @class */ - function () { - function Axis(dim, scale, extent) { - this.onBand = false; - this.inverse = false; - this.dim = dim; - this.scale = scale; - this._extent = extent || [0, 0]; - } - /** - * If axis extent contain given coord - */ - - - Axis.prototype.contain = function (coord) { - var extent = this._extent; - var min = Math.min(extent[0], extent[1]); - var max = Math.max(extent[0], extent[1]); - return coord >= min && coord <= max; - }; - /** - * If axis extent contain given data - */ + /** @class */ + function () { + function Axis(dim, scale, extent) { + this.onBand = false; + this.inverse = false; + this.dim = dim; + this.scale = scale; + this._extent = extent || [0, 0]; + } + /** + * If axis extent contain given coord + */ - Axis.prototype.containData = function (data) { - return this.scale.contain(data); - }; - /** - * Get coord extent. - */ + Axis.prototype.contain = function (coord) { + var extent = this._extent; + var min = Math.min(extent[0], extent[1]); + var max = Math.max(extent[0], extent[1]); + return coord >= min && coord <= max; + }; + /** + * If axis extent contain given data + */ - Axis.prototype.getExtent = function () { - return this._extent.slice(); - }; - /** - * Get precision used for formatting - */ + Axis.prototype.containData = function (data) { + return this.scale.contain(data); + }; + /** + * Get coord extent. + */ - Axis.prototype.getPixelPrecision = function (dataExtent) { - return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent); - }; - /** - * Set coord extent - */ + Axis.prototype.getExtent = function () { + return this._extent.slice(); + }; + /** + * Get precision used for formatting + */ - Axis.prototype.setExtent = function (start, end) { - var extent = this._extent; - extent[0] = start; - extent[1] = end; - }; - /** - * Convert data to coord. Data is the rank if it has an ordinal scale - */ + Axis.prototype.getPixelPrecision = function (dataExtent) { + return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent); + }; + /** + * Set coord extent + */ - Axis.prototype.dataToCoord = function (data, clamp) { - var extent = this._extent; - var scale = this.scale; - data = scale.normalize(data); + Axis.prototype.setExtent = function (start, end) { + var extent = this._extent; + extent[0] = start; + extent[1] = end; + }; + /** + * Convert data to coord. Data is the rank if it has an ordinal scale + */ - if (this.onBand && scale.type === 'ordinal') { - extent = extent.slice(); - fixExtentWithBands(extent, scale.count()); - } - return linearMap(data, NORMALIZED_EXTENT, extent, clamp); - }; - /** - * Convert coord to data. Data is the rank if it has an ordinal scale - */ + Axis.prototype.dataToCoord = function (data, clamp) { + var extent = this._extent; + var scale = this.scale; + data = scale.normalize(data); + if (this.onBand && scale.type === 'ordinal') { + extent = extent.slice(); + fixExtentWithBands(extent, scale.count()); + } - Axis.prototype.coordToData = function (coord, clamp) { - var extent = this._extent; - var scale = this.scale; + return linearMap(data, NORMALIZED_EXTENT, extent, clamp); + }; + /** + * Convert coord to data. Data is the rank if it has an ordinal scale + */ - if (this.onBand && scale.type === 'ordinal') { - extent = extent.slice(); - fixExtentWithBands(extent, scale.count()); - } - var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp); - return this.scale.scale(t); - }; - /** - * Convert pixel point to data in axis - */ + Axis.prototype.coordToData = function (coord, clamp) { + var extent = this._extent; + var scale = this.scale; + if (this.onBand && scale.type === 'ordinal') { + extent = extent.slice(); + fixExtentWithBands(extent, scale.count()); + } - Axis.prototype.pointToData = function (point, clamp) { - // Should be implemented in derived class if necessary. - return; - }; - /** - * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`, - * `axis.getTicksCoords` considers `onBand`, which is used by - * `boundaryGap:true` of category axis and splitLine and splitArea. - * @param opt.tickModel default: axis.model.getModel('axisTick') - * @param opt.clamp If `true`, the first and the last - * tick must be at the axis end points. Otherwise, clip ticks - * that outside the axis extent. - */ + var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp); + return this.scale.scale(t); + }; + /** + * Convert pixel point to data in axis + */ - Axis.prototype.getTicksCoords = function (opt) { - opt = opt || {}; - var tickModel = opt.tickModel || this.getTickModel(); - var result = createAxisTicks(this, tickModel); - var ticks = result.ticks; - var ticksCoords = map(ticks, function (tickVal) { - return { - coord: this.dataToCoord(this.scale.type === 'ordinal' ? this.scale.getRawOrdinalNumber(tickVal) : tickVal), - tickValue: tickVal - }; - }, this); - var alignWithLabel = tickModel.get('alignWithLabel'); - fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp); - return ticksCoords; - }; + Axis.prototype.pointToData = function (point, clamp) { + // Should be implemented in derived class if necessary. + return; + }; + /** + * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`, + * `axis.getTicksCoords` considers `onBand`, which is used by + * `boundaryGap:true` of category axis and splitLine and splitArea. + * @param opt.tickModel default: axis.model.getModel('axisTick') + * @param opt.clamp If `true`, the first and the last + * tick must be at the axis end points. Otherwise, clip ticks + * that outside the axis extent. + */ - Axis.prototype.getMinorTicksCoords = function () { - if (this.scale.type === 'ordinal') { - // Category axis doesn't support minor ticks - return []; - } - var minorTickModel = this.model.getModel('minorTick'); - var splitNumber = minorTickModel.get('splitNumber'); // Protection. + Axis.prototype.getTicksCoords = function (opt) { + opt = opt || {}; + var tickModel = opt.tickModel || this.getTickModel(); + var result = createAxisTicks(this, tickModel); + var ticks = result.ticks; + var ticksCoords = map(ticks, function (tickVal) { + return { + coord: this.dataToCoord(this.scale.type === 'ordinal' ? this.scale.getRawOrdinalNumber(tickVal) : tickVal), + tickValue: tickVal + }; + }, this); + var alignWithLabel = tickModel.get('alignWithLabel'); + fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp); + return ticksCoords; + }; - if (!(splitNumber > 0 && splitNumber < 100)) { - splitNumber = 5; - } + Axis.prototype.getMinorTicksCoords = function () { + if (this.scale.type === 'ordinal') { + // Category axis doesn't support minor ticks + return []; + } - var minorTicks = this.scale.getMinorTicks(splitNumber); - var minorTicksCoords = map(minorTicks, function (minorTicksGroup) { - return map(minorTicksGroup, function (minorTick) { - return { - coord: this.dataToCoord(minorTick), - tickValue: minorTick - }; - }, this); - }, this); - return minorTicksCoords; - }; + var minorTickModel = this.model.getModel('minorTick'); + var splitNumber = minorTickModel.get('splitNumber'); // Protection. - Axis.prototype.getViewLabels = function () { - return createAxisLabels(this).labels; - }; + if (!(splitNumber > 0 && splitNumber < 100)) { + splitNumber = 5; + } - Axis.prototype.getLabelModel = function () { - return this.model.getModel('axisLabel'); + var minorTicks = this.scale.getMinorTicks(splitNumber); + var minorTicksCoords = map(minorTicks, function (minorTicksGroup) { + return map(minorTicksGroup, function (minorTick) { + return { + coord: this.dataToCoord(minorTick), + tickValue: minorTick }; - /** - * Notice here we only get the default tick model. For splitLine - * or splitArea, we should pass the splitLineModel or splitAreaModel - * manually when calling `getTicksCoords`. - * In GL, this method may be overrided to: - * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));` - */ + }, this); + }, this); + return minorTicksCoords; + }; + + Axis.prototype.getViewLabels = function () { + return createAxisLabels(this).labels; + }; + + Axis.prototype.getLabelModel = function () { + return this.model.getModel('axisLabel'); + }; + /** + * Notice here we only get the default tick model. For splitLine + * or splitArea, we should pass the splitLineModel or splitAreaModel + * manually when calling `getTicksCoords`. + * In GL, this method may be overrided to: + * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));` + */ - Axis.prototype.getTickModel = function () { - return this.model.getModel('axisTick'); - }; - /** - * Get width of band - */ + Axis.prototype.getTickModel = function () { + return this.model.getModel('axisTick'); + }; + /** + * Get width of band + */ - Axis.prototype.getBandWidth = function () { - var axisExtent = this._extent; - var dataExtent = this.scale.getExtent(); - var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0); // Fix #2728, avoid NaN when only one data. + Axis.prototype.getBandWidth = function () { + var axisExtent = this._extent; + var dataExtent = this.scale.getExtent(); + var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0); // Fix #2728, avoid NaN when only one data. - len === 0 && (len = 1); - var size = Math.abs(axisExtent[1] - axisExtent[0]); - return Math.abs(size) / len; - }; - /** - * Only be called in category axis. - * Can be overrided, consider other axes like in 3D. - * @return Auto interval for cateogry axis tick and label - */ + len === 0 && (len = 1); + var size = Math.abs(axisExtent[1] - axisExtent[0]); + return Math.abs(size) / len; + }; + /** + * Only be called in category axis. + * Can be overrided, consider other axes like in 3D. + * @return Auto interval for cateogry axis tick and label + */ - Axis.prototype.calculateCategoryInterval = function () { - return calculateCategoryInterval(this); - }; + Axis.prototype.calculateCategoryInterval = function () { + return calculateCategoryInterval(this); + }; - return Axis; - }(); + return Axis; + }(); function fixExtentWithBands(extent, nTick) { - var size = extent[1] - extent[0]; - var len = nTick; - var margin = size / len / 2; - extent[0] += margin; - extent[1] -= margin; + var size = extent[1] - extent[0]; + var len = nTick; + var margin = size / len / 2; + extent[0] += margin; + extent[1] -= margin; } // If axis has labels [1, 2, 3, 4]. Bands on the axis are // |---1---|---2---|---3---|---4---|. // So the displayed ticks and splitLine/splitArea should between @@ -36819,64 +36819,64 @@ function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) { - var ticksLen = ticksCoords.length; - - if (!axis.onBand || alignWithLabel || !ticksLen) { - return; - } - - var axisExtent = axis.getExtent(); - var last; - var diffSize; + var ticksLen = ticksCoords.length; - if (ticksLen === 1) { - ticksCoords[0].coord = axisExtent[0]; - last = ticksCoords[1] = { - coord: axisExtent[0] - }; - } else { - var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue; - var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen; - each(ticksCoords, function (ticksItem) { - ticksItem.coord -= shift_1 / 2; - }); - var dataExtent = axis.scale.getExtent(); - diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue; - last = { - coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize - }; - ticksCoords.push(last); - } + if (!axis.onBand || alignWithLabel || !ticksLen) { + return; + } + + var axisExtent = axis.getExtent(); + var last; + var diffSize; + + if (ticksLen === 1) { + ticksCoords[0].coord = axisExtent[0]; + last = ticksCoords[1] = { + coord: axisExtent[0] + }; + } else { + var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue; + var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen; + each(ticksCoords, function (ticksItem) { + ticksItem.coord -= shift_1 / 2; + }); + var dataExtent = axis.scale.getExtent(); + diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue; + last = { + coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize + }; + ticksCoords.push(last); + } - var inverse = axisExtent[0] > axisExtent[1]; // Handling clamp. + var inverse = axisExtent[0] > axisExtent[1]; // Handling clamp. - if (littleThan(ticksCoords[0].coord, axisExtent[0])) { - clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift(); - } + if (littleThan(ticksCoords[0].coord, axisExtent[0])) { + clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift(); + } - if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) { - ticksCoords.unshift({ - coord: axisExtent[0] - }); - } + if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) { + ticksCoords.unshift({ + coord: axisExtent[0] + }); + } - if (littleThan(axisExtent[1], last.coord)) { - clamp ? last.coord = axisExtent[1] : ticksCoords.pop(); - } + if (littleThan(axisExtent[1], last.coord)) { + clamp ? last.coord = axisExtent[1] : ticksCoords.pop(); + } - if (clamp && littleThan(last.coord, axisExtent[1])) { - ticksCoords.push({ - coord: axisExtent[1] - }); - } + if (clamp && littleThan(last.coord, axisExtent[1])) { + ticksCoords.push({ + coord: axisExtent[1] + }); + } - function littleThan(a, b) { - // Avoid rounding error cause calculated tick coord different with extent. - // It may cause an extra unecessary tick added. - a = round(a); - b = round(b); - return inverse ? a > b : a < b; - } + function littleThan(a, b) { + // Avoid rounding error cause calculated tick coord different with extent. + // It may cause an extra unecessary tick added. + a = round(a); + b = round(b); + return inverse ? a > b : a < b; + } } // Should use `ComponentModel.extend` or `class XXXX extend ComponentModel` to create class. @@ -36886,24 +36886,24 @@ // echarts.use(install); function extendComponentModel(proto) { - var Model = ComponentModel.extend(proto); - ComponentModel.registerClass(Model); - return Model; + var Model = ComponentModel.extend(proto); + ComponentModel.registerClass(Model); + return Model; } function extendComponentView(proto) { - var View = ComponentView.extend(proto); - ComponentView.registerClass(View); - return View; + var View = ComponentView.extend(proto); + ComponentView.registerClass(View); + return View; } function extendSeriesModel(proto) { - var Model = SeriesModel.extend(proto); - SeriesModel.registerClass(Model); - return Model; + var Model = SeriesModel.extend(proto); + SeriesModel.registerClass(Model); + return Model; } function extendChartView(proto) { - var View = ChartView.extend(proto); - ChartView.registerClass(View); - return View; + var View = ChartView.extend(proto); + ChartView.registerClass(View); + return View; } var PI2$6 = Math.PI * 2; @@ -36911,139 +36911,139 @@ var DEFAULT_SEARCH_SPACE = ['top', 'right', 'bottom', 'left']; function getCandidateAnchor(pos, distance, rect, outPt, outDir) { - var width = rect.width; - var height = rect.height; + var width = rect.width; + var height = rect.height; - switch (pos) { - case 'top': - outPt.set(rect.x + width / 2, rect.y - distance); - outDir.set(0, -1); - break; + switch (pos) { + case 'top': + outPt.set(rect.x + width / 2, rect.y - distance); + outDir.set(0, -1); + break; - case 'bottom': - outPt.set(rect.x + width / 2, rect.y + height + distance); - outDir.set(0, 1); - break; + case 'bottom': + outPt.set(rect.x + width / 2, rect.y + height + distance); + outDir.set(0, 1); + break; - case 'left': - outPt.set(rect.x - distance, rect.y + height / 2); - outDir.set(-1, 0); - break; + case 'left': + outPt.set(rect.x - distance, rect.y + height / 2); + outDir.set(-1, 0); + break; - case 'right': - outPt.set(rect.x + width + distance, rect.y + height / 2); - outDir.set(1, 0); - break; - } + case 'right': + outPt.set(rect.x + width + distance, rect.y + height / 2); + outDir.set(1, 0); + break; + } } function projectPointToArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y, out) { - x -= cx; - y -= cy; - var d = Math.sqrt(x * x + y * y); - x /= d; - y /= d; // Intersect point. - - var ox = x * r + cx; - var oy = y * r + cy; - - if (Math.abs(startAngle - endAngle) % PI2$6 < 1e-4) { - // Is a circle - out[0] = ox; - out[1] = oy; - return d - r; - } - - if (anticlockwise) { - var tmp = startAngle; - startAngle = normalizeRadian(endAngle); - endAngle = normalizeRadian(tmp); - } else { - startAngle = normalizeRadian(startAngle); - endAngle = normalizeRadian(endAngle); - } - - if (startAngle > endAngle) { - endAngle += PI2$6; - } - - var angle = Math.atan2(y, x); - - if (angle < 0) { - angle += PI2$6; - } - - if (angle >= startAngle && angle <= endAngle || angle + PI2$6 >= startAngle && angle + PI2$6 <= endAngle) { - // Project point is on the arc. - out[0] = ox; - out[1] = oy; - return d - r; - } - - var x1 = r * Math.cos(startAngle) + cx; - var y1 = r * Math.sin(startAngle) + cy; - var x2 = r * Math.cos(endAngle) + cx; - var y2 = r * Math.sin(endAngle) + cy; - var d1 = (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y); - var d2 = (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y); - - if (d1 < d2) { - out[0] = x1; - out[1] = y1; - return Math.sqrt(d1); - } else { - out[0] = x2; - out[1] = y2; - return Math.sqrt(d2); - } + x -= cx; + y -= cy; + var d = Math.sqrt(x * x + y * y); + x /= d; + y /= d; // Intersect point. + + var ox = x * r + cx; + var oy = y * r + cy; + + if (Math.abs(startAngle - endAngle) % PI2$6 < 1e-4) { + // Is a circle + out[0] = ox; + out[1] = oy; + return d - r; + } + + if (anticlockwise) { + var tmp = startAngle; + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(tmp); + } else { + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + + if (startAngle > endAngle) { + endAngle += PI2$6; + } + + var angle = Math.atan2(y, x); + + if (angle < 0) { + angle += PI2$6; + } + + if (angle >= startAngle && angle <= endAngle || angle + PI2$6 >= startAngle && angle + PI2$6 <= endAngle) { + // Project point is on the arc. + out[0] = ox; + out[1] = oy; + return d - r; + } + + var x1 = r * Math.cos(startAngle) + cx; + var y1 = r * Math.sin(startAngle) + cy; + var x2 = r * Math.cos(endAngle) + cx; + var y2 = r * Math.sin(endAngle) + cy; + var d1 = (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y); + var d2 = (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y); + + if (d1 < d2) { + out[0] = x1; + out[1] = y1; + return Math.sqrt(d1); + } else { + out[0] = x2; + out[1] = y2; + return Math.sqrt(d2); + } } function projectPointToLine(x1, y1, x2, y2, x, y, out, limitToEnds) { - var dx = x - x1; - var dy = y - y1; - var dx1 = x2 - x1; - var dy1 = y2 - y1; - var lineLen = Math.sqrt(dx1 * dx1 + dy1 * dy1); - dx1 /= lineLen; - dy1 /= lineLen; // dot product + var dx = x - x1; + var dy = y - y1; + var dx1 = x2 - x1; + var dy1 = y2 - y1; + var lineLen = Math.sqrt(dx1 * dx1 + dy1 * dy1); + dx1 /= lineLen; + dy1 /= lineLen; // dot product - var projectedLen = dx * dx1 + dy * dy1; - var t = projectedLen / lineLen; + var projectedLen = dx * dx1 + dy * dy1; + var t = projectedLen / lineLen; - if (limitToEnds) { - t = Math.min(Math.max(t, 0), 1); - } + if (limitToEnds) { + t = Math.min(Math.max(t, 0), 1); + } - t *= lineLen; - var ox = out[0] = x1 + t * dx1; - var oy = out[1] = y1 + t * dy1; - return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y)); + t *= lineLen; + var ox = out[0] = x1 + t * dx1; + var oy = out[1] = y1 + t * dy1; + return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y)); } function projectPointToRect(x1, y1, width, height, x, y, out) { - if (width < 0) { - x1 = x1 + width; - width = -width; - } + if (width < 0) { + x1 = x1 + width; + width = -width; + } - if (height < 0) { - y1 = y1 + height; - height = -height; - } + if (height < 0) { + y1 = y1 + height; + height = -height; + } - var x2 = x1 + width; - var y2 = y1 + height; - var ox = out[0] = Math.min(Math.max(x, x1), x2); - var oy = out[1] = Math.min(Math.max(y, y1), y2); - return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y)); + var x2 = x1 + width; + var y2 = y1 + height; + var ox = out[0] = Math.min(Math.max(x, x1), x2); + var oy = out[1] = Math.min(Math.max(y, y1), y2); + return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y)); } var tmpPt = []; function nearestPointOnRect(pt, rect, out) { - var dist = projectPointToRect(rect.x, rect.y, rect.width, rect.height, pt.x, pt.y, tmpPt); - out.set(tmpPt[0], tmpPt[1]); - return dist; + var dist = projectPointToRect(rect.x, rect.y, rect.width, rect.height, pt.x, pt.y, tmpPt); + out.set(tmpPt[0], tmpPt[1]); + return dist; } /** * Calculate min distance corresponding point. @@ -37052,107 +37052,107 @@ function nearestPointOnPath(pt, path, out) { - var xi = 0; - var yi = 0; - var x0 = 0; - var y0 = 0; - var x1; - var y1; - var minDist = Infinity; - var data = path.data; - var x = pt.x; - var y = pt.y; - - for (var i = 0; i < data.length;) { - var cmd = data[i++]; - - if (i === 1) { - xi = data[i]; - yi = data[i + 1]; - x0 = xi; - y0 = yi; - } - - var d = minDist; - - switch (cmd) { - case CMD$3.M: - // moveTo 命令重新创建一个新的 subpath, 并且更新新的起点 - // 在 closePath 的时候使用 - x0 = data[i++]; - y0 = data[i++]; - xi = x0; - yi = y0; - break; - - case CMD$3.L: - d = projectPointToLine(xi, yi, data[i], data[i + 1], x, y, tmpPt, true); - xi = data[i++]; - yi = data[i++]; - break; - - case CMD$3.C: - d = cubicProjectPoint(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt); - xi = data[i++]; - yi = data[i++]; - break; - - case CMD$3.Q: - d = quadraticProjectPoint(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt); - xi = data[i++]; - yi = data[i++]; - break; - - case CMD$3.A: - // TODO Arc 判断的开销比较大 - var cx = data[i++]; - var cy = data[i++]; - var rx = data[i++]; - var ry = data[i++]; - var theta = data[i++]; - var dTheta = data[i++]; // TODO Arc 旋转 - - i += 1; - var anticlockwise = !!(1 - data[i++]); - x1 = Math.cos(theta) * rx + cx; - y1 = Math.sin(theta) * ry + cy; // 不是直接使用 arc 命令 - - if (i <= 1) { - // 第一个命令起点还未定义 - x0 = x1; - y0 = y1; - } // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放 - - - var _x = (x - cx) * ry / rx + cx; - - d = projectPointToArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y, tmpPt); - xi = Math.cos(theta + dTheta) * rx + cx; - yi = Math.sin(theta + dTheta) * ry + cy; - break; - - case CMD$3.R: - x0 = xi = data[i++]; - y0 = yi = data[i++]; - var width = data[i++]; - var height = data[i++]; - d = projectPointToRect(x0, y0, width, height, x, y, tmpPt); - break; - - case CMD$3.Z: - d = projectPointToLine(xi, yi, x0, y0, x, y, tmpPt, true); - xi = x0; - yi = y0; - break; - } - - if (d < minDist) { - minDist = d; - out.set(tmpPt[0], tmpPt[1]); - } - } - - return minDist; + var xi = 0; + var yi = 0; + var x0 = 0; + var y0 = 0; + var x1; + var y1; + var minDist = Infinity; + var data = path.data; + var x = pt.x; + var y = pt.y; + + for (var i = 0; i < data.length;) { + var cmd = data[i++]; + + if (i === 1) { + xi = data[i]; + yi = data[i + 1]; + x0 = xi; + y0 = yi; + } + + var d = minDist; + + switch (cmd) { + case CMD$3.M: + // moveTo 命令重新创建一个新的 subpath, 并且更新新的起点 + // 在 closePath 的时候使用 + x0 = data[i++]; + y0 = data[i++]; + xi = x0; + yi = y0; + break; + + case CMD$3.L: + d = projectPointToLine(xi, yi, data[i], data[i + 1], x, y, tmpPt, true); + xi = data[i++]; + yi = data[i++]; + break; + + case CMD$3.C: + d = cubicProjectPoint(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt); + xi = data[i++]; + yi = data[i++]; + break; + + case CMD$3.Q: + d = quadraticProjectPoint(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt); + xi = data[i++]; + yi = data[i++]; + break; + + case CMD$3.A: + // TODO Arc 判断的开销比较大 + var cx = data[i++]; + var cy = data[i++]; + var rx = data[i++]; + var ry = data[i++]; + var theta = data[i++]; + var dTheta = data[i++]; // TODO Arc 旋转 + + i += 1; + var anticlockwise = !!(1 - data[i++]); + x1 = Math.cos(theta) * rx + cx; + y1 = Math.sin(theta) * ry + cy; // 不是直接使用 arc 命令 + + if (i <= 1) { + // 第一个命令起点还未定义 + x0 = x1; + y0 = y1; + } // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放 + + + var _x = (x - cx) * ry / rx + cx; + + d = projectPointToArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y, tmpPt); + xi = Math.cos(theta + dTheta) * rx + cx; + yi = Math.sin(theta + dTheta) * ry + cy; + break; + + case CMD$3.R: + x0 = xi = data[i++]; + y0 = yi = data[i++]; + var width = data[i++]; + var height = data[i++]; + d = projectPointToRect(x0, y0, width, height, x, y, tmpPt); + break; + + case CMD$3.Z: + d = projectPointToLine(xi, yi, x0, y0, x, y, tmpPt, true); + xi = x0; + yi = y0; + break; + } + + if (d < minDist) { + minDist = d; + out.set(tmpPt[0], tmpPt[1]); + } + } + + return minDist; } // Temporal varible for intermediate usage. @@ -37170,57 +37170,57 @@ */ function updateLabelLinePoints(target, labelLineModel) { - if (!target) { - return; - } - - var labelLine = target.getTextGuideLine(); - var label = target.getTextContent(); // Needs to create text guide in each charts. + if (!target) { + return; + } - if (!(label && labelLine)) { - return; - } + var labelLine = target.getTextGuideLine(); + var label = target.getTextContent(); // Needs to create text guide in each charts. - var labelGuideConfig = target.textGuideLineConfig || {}; - var points = [[0, 0], [0, 0], [0, 0]]; - var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE; - var labelRect = label.getBoundingRect().clone(); - labelRect.applyTransform(label.getComputedTransform()); - var minDist = Infinity; - var anchorPoint = labelGuideConfig.anchor; - var targetTransform = target.getComputedTransform(); - var targetInversedTransform = targetTransform && invert([], targetTransform); - var len = labelLineModel.get('length2') || 0; - - if (anchorPoint) { - pt2.copy(anchorPoint); - } - - for (var i = 0; i < searchSpace.length; i++) { - var candidate = searchSpace[i]; - getCandidateAnchor(candidate, 0, labelRect, pt0, dir); - Point.scaleAndAdd(pt1, pt0, dir, len); // Transform to target coord space. - - pt1.transform(targetInversedTransform); // Note: getBoundingRect will ensure the `path` being created. - - var boundingRect = target.getBoundingRect(); - var dist = anchorPoint ? anchorPoint.distance(pt1) : target instanceof Path ? nearestPointOnPath(pt1, target.path, pt2) : nearestPointOnRect(pt1, boundingRect, pt2); // TODO pt2 is in the path - - if (dist < minDist) { - minDist = dist; // Transform back to global space. - - pt1.transform(targetTransform); - pt2.transform(targetTransform); - pt2.toArray(points[0]); - pt1.toArray(points[1]); - pt0.toArray(points[2]); - } - } - - limitTurnAngle(points, labelLineModel.get('minTurnAngle')); - labelLine.setShape({ - points: points - }); + if (!(label && labelLine)) { + return; + } + + var labelGuideConfig = target.textGuideLineConfig || {}; + var points = [[0, 0], [0, 0], [0, 0]]; + var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE; + var labelRect = label.getBoundingRect().clone(); + labelRect.applyTransform(label.getComputedTransform()); + var minDist = Infinity; + var anchorPoint = labelGuideConfig.anchor; + var targetTransform = target.getComputedTransform(); + var targetInversedTransform = targetTransform && invert([], targetTransform); + var len = labelLineModel.get('length2') || 0; + + if (anchorPoint) { + pt2.copy(anchorPoint); + } + + for (var i = 0; i < searchSpace.length; i++) { + var candidate = searchSpace[i]; + getCandidateAnchor(candidate, 0, labelRect, pt0, dir); + Point.scaleAndAdd(pt1, pt0, dir, len); // Transform to target coord space. + + pt1.transform(targetInversedTransform); // Note: getBoundingRect will ensure the `path` being created. + + var boundingRect = target.getBoundingRect(); + var dist = anchorPoint ? anchorPoint.distance(pt1) : target instanceof Path ? nearestPointOnPath(pt1, target.path, pt2) : nearestPointOnRect(pt1, boundingRect, pt2); // TODO pt2 is in the path + + if (dist < minDist) { + minDist = dist; // Transform back to global space. + + pt1.transform(targetTransform); + pt2.transform(targetTransform); + pt2.toArray(points[0]); + pt1.toArray(points[1]); + pt0.toArray(points[2]); + } + } + + limitTurnAngle(points, labelLineModel.get('minTurnAngle')); + labelLine.setShape({ + points: points + }); } // Temporal variable for the limitTurnAngle function var tmpArr = []; @@ -37232,54 +37232,54 @@ */ function limitTurnAngle(linePoints, minTurnAngle) { - if (!(minTurnAngle <= 180 && minTurnAngle > 0)) { - return; - } - - minTurnAngle = minTurnAngle / 180 * Math.PI; // The line points can be - // /pt1----pt2 (label) - // / - // pt0/ - - pt0.fromArray(linePoints[0]); - pt1.fromArray(linePoints[1]); - pt2.fromArray(linePoints[2]); - Point.sub(dir, pt0, pt1); - Point.sub(dir2, pt2, pt1); - var len1 = dir.len(); - var len2 = dir2.len(); - - if (len1 < 1e-3 || len2 < 1e-3) { - return; - } - - dir.scale(1 / len1); - dir2.scale(1 / len2); - var angleCos = dir.dot(dir2); - var minTurnAngleCos = Math.cos(minTurnAngle); + if (!(minTurnAngle <= 180 && minTurnAngle > 0)) { + return; + } + + minTurnAngle = minTurnAngle / 180 * Math.PI; // The line points can be + // /pt1----pt2 (label) + // / + // pt0/ + + pt0.fromArray(linePoints[0]); + pt1.fromArray(linePoints[1]); + pt2.fromArray(linePoints[2]); + Point.sub(dir, pt0, pt1); + Point.sub(dir2, pt2, pt1); + var len1 = dir.len(); + var len2 = dir2.len(); + + if (len1 < 1e-3 || len2 < 1e-3) { + return; + } - if (minTurnAngleCos < angleCos) { - // Smaller than minTurnAngle - // Calculate project point of pt0 on pt1-pt2 - var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false); - tmpProjPoint.fromArray(tmpArr); // Calculate new projected length with limited minTurnAngle and get the new connect point + dir.scale(1 / len1); + dir2.scale(1 / len2); + var angleCos = dir.dot(dir2); + var minTurnAngleCos = Math.cos(minTurnAngle); - tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI - minTurnAngle)); // Limit the new calculated connect point between pt1 and pt2. + if (minTurnAngleCos < angleCos) { + // Smaller than minTurnAngle + // Calculate project point of pt0 on pt1-pt2 + var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false); + tmpProjPoint.fromArray(tmpArr); // Calculate new projected length with limited minTurnAngle and get the new connect point - var t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y); + tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI - minTurnAngle)); // Limit the new calculated connect point between pt1 and pt2. - if (isNaN(t)) { - return; - } + var t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y); - if (t < 0) { - Point.copy(tmpProjPoint, pt1); - } else if (t > 1) { - Point.copy(tmpProjPoint, pt2); - } + if (isNaN(t)) { + return; + } - tmpProjPoint.toArray(linePoints[1]); + if (t < 0) { + Point.copy(tmpProjPoint, pt1); + } else if (t > 1) { + Point.copy(tmpProjPoint, pt2); } + + tmpProjPoint.toArray(linePoints[1]); + } } /** * Limit the angle of line and the surface @@ -37287,113 +37287,113 @@ */ function limitSurfaceAngle(linePoints, surfaceNormal, maxSurfaceAngle) { - if (!(maxSurfaceAngle <= 180 && maxSurfaceAngle > 0)) { - return; - } + if (!(maxSurfaceAngle <= 180 && maxSurfaceAngle > 0)) { + return; + } + + maxSurfaceAngle = maxSurfaceAngle / 180 * Math.PI; + pt0.fromArray(linePoints[0]); + pt1.fromArray(linePoints[1]); + pt2.fromArray(linePoints[2]); + Point.sub(dir, pt1, pt0); + Point.sub(dir2, pt2, pt1); + var len1 = dir.len(); + var len2 = dir2.len(); + + if (len1 < 1e-3 || len2 < 1e-3) { + return; + } + + dir.scale(1 / len1); + dir2.scale(1 / len2); + var angleCos = dir.dot(surfaceNormal); + var maxSurfaceAngleCos = Math.cos(maxSurfaceAngle); + + if (angleCos < maxSurfaceAngleCos) { + // Calculate project point of pt0 on pt1-pt2 + var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false); + tmpProjPoint.fromArray(tmpArr); + var HALF_PI = Math.PI / 2; + var angle2 = Math.acos(dir2.dot(surfaceNormal)); + var newAngle = HALF_PI + angle2 - maxSurfaceAngle; + + if (newAngle >= HALF_PI) { + // parallel + Point.copy(tmpProjPoint, pt2); + } else { + // Calculate new projected length with limited minTurnAngle and get the new connect point + tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI / 2 - newAngle)); // Limit the new calculated connect point between pt1 and pt2. - maxSurfaceAngle = maxSurfaceAngle / 180 * Math.PI; - pt0.fromArray(linePoints[0]); - pt1.fromArray(linePoints[1]); - pt2.fromArray(linePoints[2]); - Point.sub(dir, pt1, pt0); - Point.sub(dir2, pt2, pt1); - var len1 = dir.len(); - var len2 = dir2.len(); + var t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y); - if (len1 < 1e-3 || len2 < 1e-3) { + if (isNaN(t)) { return; - } - - dir.scale(1 / len1); - dir2.scale(1 / len2); - var angleCos = dir.dot(surfaceNormal); - var maxSurfaceAngleCos = Math.cos(maxSurfaceAngle); - - if (angleCos < maxSurfaceAngleCos) { - // Calculate project point of pt0 on pt1-pt2 - var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false); - tmpProjPoint.fromArray(tmpArr); - var HALF_PI = Math.PI / 2; - var angle2 = Math.acos(dir2.dot(surfaceNormal)); - var newAngle = HALF_PI + angle2 - maxSurfaceAngle; - - if (newAngle >= HALF_PI) { - // parallel - Point.copy(tmpProjPoint, pt2); - } else { - // Calculate new projected length with limited minTurnAngle and get the new connect point - tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI / 2 - newAngle)); // Limit the new calculated connect point between pt1 and pt2. - - var t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y); - - if (isNaN(t)) { - return; - } + } - if (t < 0) { - Point.copy(tmpProjPoint, pt1); - } else if (t > 1) { - Point.copy(tmpProjPoint, pt2); - } - } - - tmpProjPoint.toArray(linePoints[1]); + if (t < 0) { + Point.copy(tmpProjPoint, pt1); + } else if (t > 1) { + Point.copy(tmpProjPoint, pt2); + } } + + tmpProjPoint.toArray(linePoints[1]); + } } function setLabelLineState(labelLine, ignore, stateName, stateModel) { - var isNormal = stateName === 'normal'; - var stateObj = isNormal ? labelLine : labelLine.ensureState(stateName); // Make sure display. + var isNormal = stateName === 'normal'; + var stateObj = isNormal ? labelLine : labelLine.ensureState(stateName); // Make sure display. - stateObj.ignore = ignore; // Set smooth + stateObj.ignore = ignore; // Set smooth - var smooth = stateModel.get('smooth'); + var smooth = stateModel.get('smooth'); - if (smooth && smooth === true) { - smooth = 0.3; - } + if (smooth && smooth === true) { + smooth = 0.3; + } - stateObj.shape = stateObj.shape || {}; + stateObj.shape = stateObj.shape || {}; - if (smooth > 0) { - stateObj.shape.smooth = smooth; - } + if (smooth > 0) { + stateObj.shape.smooth = smooth; + } - var styleObj = stateModel.getModel('lineStyle').getLineStyle(); - isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj; + var styleObj = stateModel.getModel('lineStyle').getLineStyle(); + isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj; } function buildLabelLinePath(path, shape) { - var smooth = shape.smooth; - var points = shape.points; + var smooth = shape.smooth; + var points = shape.points; - if (!points) { - return; - } + if (!points) { + return; + } - path.moveTo(points[0][0], points[0][1]); + path.moveTo(points[0][0], points[0][1]); - if (smooth > 0 && points.length >= 3) { - var len1 = dist(points[0], points[1]); - var len2 = dist(points[1], points[2]); + if (smooth > 0 && points.length >= 3) { + var len1 = dist(points[0], points[1]); + var len2 = dist(points[1], points[2]); - if (!len1 || !len2) { - path.lineTo(points[1][0], points[1][1]); - path.lineTo(points[2][0], points[2][1]); - return; - } + if (!len1 || !len2) { + path.lineTo(points[1][0], points[1][1]); + path.lineTo(points[2][0], points[2][1]); + return; + } - var moveLen = Math.min(len1, len2) * smooth; - var midPoint0 = lerp([], points[1], points[0], moveLen / len1); - var midPoint2 = lerp([], points[1], points[2], moveLen / len2); - var midPoint1 = lerp([], midPoint0, midPoint2, 0.5); - path.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]); - path.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points[2][0], points[2][1]); - } else { - for (var i = 1; i < points.length; i++) { - path.lineTo(points[i][0], points[i][1]); - } + var moveLen = Math.min(len1, len2) * smooth; + var midPoint0 = lerp([], points[1], points[0], moveLen / len1); + var midPoint2 = lerp([], points[1], points[2], moveLen / len2); + var midPoint1 = lerp([], midPoint0, midPoint2, 0.5); + path.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]); + path.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points[2][0], points[2][1]); + } else { + for (var i = 1; i < points.length; i++) { + path.lineTo(points[i][0], points[i][1]); } + } } /** * Create a label line if necessary and set it's style. @@ -37401,287 +37401,287 @@ function setLabelLineStyle(targetEl, statesModels, defaultStyle) { - var labelLine = targetEl.getTextGuideLine(); - var label = targetEl.getTextContent(); + var labelLine = targetEl.getTextGuideLine(); + var label = targetEl.getTextContent(); - if (!label) { - // Not show label line if there is no label. - if (labelLine) { - targetEl.removeTextGuideLine(); - } - - return; + if (!label) { + // Not show label line if there is no label. + if (labelLine) { + targetEl.removeTextGuideLine(); } - var normalModel = statesModels.normal; - var showNormal = normalModel.get('show'); - var labelIgnoreNormal = label.ignore; + return; + } - for (var i = 0; i < DISPLAY_STATES.length; i++) { - var stateName = DISPLAY_STATES[i]; - var stateModel = statesModels[stateName]; - var isNormal = stateName === 'normal'; + var normalModel = statesModels.normal; + var showNormal = normalModel.get('show'); + var labelIgnoreNormal = label.ignore; - if (stateModel) { - var stateShow = stateModel.get('show'); - var isLabelIgnored = isNormal ? labelIgnoreNormal : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal); + for (var i = 0; i < DISPLAY_STATES.length; i++) { + var stateName = DISPLAY_STATES[i]; + var stateModel = statesModels[stateName]; + var isNormal = stateName === 'normal'; - if (isLabelIgnored // Not show when label is not shown in this state. - || !retrieve2(stateShow, showNormal) // Use normal state by default if not set. - ) { - var stateObj = isNormal ? labelLine : labelLine && labelLine.states[stateName]; + if (stateModel) { + var stateShow = stateModel.get('show'); + var isLabelIgnored = isNormal ? labelIgnoreNormal : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal); - if (stateObj) { - stateObj.ignore = true; - } + if (isLabelIgnored // Not show when label is not shown in this state. + || !retrieve2(stateShow, showNormal) // Use normal state by default if not set. + ) { + var stateObj = isNormal ? labelLine : labelLine && labelLine.states[stateName]; - continue; - } // Create labelLine if not exists + if (stateObj) { + stateObj.ignore = true; + } + continue; + } // Create labelLine if not exists - if (!labelLine) { - labelLine = new Polyline(); - targetEl.setTextGuideLine(labelLine); // Reset state of normal because it's new created. - // NOTE: NORMAL should always been the first! - if (!isNormal && (labelIgnoreNormal || !showNormal)) { - setLabelLineState(labelLine, true, 'normal', statesModels.normal); - } // Use same state proxy. + if (!labelLine) { + labelLine = new Polyline(); + targetEl.setTextGuideLine(labelLine); // Reset state of normal because it's new created. + // NOTE: NORMAL should always been the first! + if (!isNormal && (labelIgnoreNormal || !showNormal)) { + setLabelLineState(labelLine, true, 'normal', statesModels.normal); + } // Use same state proxy. - if (targetEl.stateProxy) { - labelLine.stateProxy = targetEl.stateProxy; - } - } - setLabelLineState(labelLine, false, stateName, stateModel); + if (targetEl.stateProxy) { + labelLine.stateProxy = targetEl.stateProxy; } + } + + setLabelLineState(labelLine, false, stateName, stateModel); } + } - if (labelLine) { - defaults(labelLine.style, defaultStyle); // Not fill. + if (labelLine) { + defaults(labelLine.style, defaultStyle); // Not fill. - labelLine.style.fill = null; - var showAbove = normalModel.get('showAbove'); - var labelLineConfig = targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {}; - labelLineConfig.showAbove = showAbove || false; // Custom the buildPath. + labelLine.style.fill = null; + var showAbove = normalModel.get('showAbove'); + var labelLineConfig = targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {}; + labelLineConfig.showAbove = showAbove || false; // Custom the buildPath. - labelLine.buildPath = buildLabelLinePath; - } + labelLine.buildPath = buildLabelLinePath; + } } function getLabelLineStatesModels(itemModel, labelLineName) { - labelLineName = labelLineName || 'labelLine'; - var statesModels = { - normal: itemModel.getModel(labelLineName) - }; + labelLineName = labelLineName || 'labelLine'; + var statesModels = { + normal: itemModel.getModel(labelLineName) + }; - for (var i = 0; i < SPECIAL_STATES.length; i++) { - var stateName = SPECIAL_STATES[i]; - statesModels[stateName] = itemModel.getModel([stateName, labelLineName]); - } + for (var i = 0; i < SPECIAL_STATES.length; i++) { + var stateName = SPECIAL_STATES[i]; + statesModels[stateName] = itemModel.getModel([stateName, labelLineName]); + } - return statesModels; + return statesModels; } function prepareLayoutList(input) { - var list = []; - - for (var i = 0; i < input.length; i++) { - var rawItem = input[i]; - - if (rawItem.defaultAttr.ignore) { - continue; - } - - var label = rawItem.label; - var transform = label.getComputedTransform(); // NOTE: Get bounding rect after getComputedTransform, or label may not been updated by the host el. - - var localRect = label.getBoundingRect(); - var isAxisAligned = !transform || transform[1] < 1e-5 && transform[2] < 1e-5; - var minMargin = label.style.margin || 0; - var globalRect = localRect.clone(); - globalRect.applyTransform(transform); - globalRect.x -= minMargin / 2; - globalRect.y -= minMargin / 2; - globalRect.width += minMargin; - globalRect.height += minMargin; - var obb = isAxisAligned ? new OrientedBoundingRect(localRect, transform) : null; - list.push({ - label: label, - labelLine: rawItem.labelLine, - rect: globalRect, - localRect: localRect, - obb: obb, - priority: rawItem.priority, - defaultAttr: rawItem.defaultAttr, - layoutOption: rawItem.computedLayoutOption, - axisAligned: isAxisAligned, - transform: transform - }); - } + var list = []; + + for (var i = 0; i < input.length; i++) { + var rawItem = input[i]; + + if (rawItem.defaultAttr.ignore) { + continue; + } + + var label = rawItem.label; + var transform = label.getComputedTransform(); // NOTE: Get bounding rect after getComputedTransform, or label may not been updated by the host el. + + var localRect = label.getBoundingRect(); + var isAxisAligned = !transform || transform[1] < 1e-5 && transform[2] < 1e-5; + var minMargin = label.style.margin || 0; + var globalRect = localRect.clone(); + globalRect.applyTransform(transform); + globalRect.x -= minMargin / 2; + globalRect.y -= minMargin / 2; + globalRect.width += minMargin; + globalRect.height += minMargin; + var obb = isAxisAligned ? new OrientedBoundingRect(localRect, transform) : null; + list.push({ + label: label, + labelLine: rawItem.labelLine, + rect: globalRect, + localRect: localRect, + obb: obb, + priority: rawItem.priority, + defaultAttr: rawItem.defaultAttr, + layoutOption: rawItem.computedLayoutOption, + axisAligned: isAxisAligned, + transform: transform + }); + } - return list; + return list; } function shiftLayout(list, xyDim, sizeDim, minBound, maxBound, balanceShift) { - var len = list.length; + var len = list.length; - if (len < 2) { - return; - } - - list.sort(function (a, b) { - return a.rect[xyDim] - b.rect[xyDim]; - }); - var lastPos = 0; - var delta; - var adjusted = false; - var totalShifts = 0; + if (len < 2) { + return; + } - for (var i = 0; i < len; i++) { - var item = list[i]; - var rect = item.rect; - delta = rect[xyDim] - lastPos; + list.sort(function (a, b) { + return a.rect[xyDim] - b.rect[xyDim]; + }); + var lastPos = 0; + var delta; + var adjusted = false; + var totalShifts = 0; - if (delta < 0) { - // shiftForward(i, len, -delta); - rect[xyDim] -= delta; - item.label[xyDim] -= delta; - adjusted = true; - } + for (var i = 0; i < len; i++) { + var item = list[i]; + var rect = item.rect; + delta = rect[xyDim] - lastPos; - var shift = Math.max(-delta, 0); - totalShifts += shift; - lastPos = rect[xyDim] + rect[sizeDim]; + if (delta < 0) { + // shiftForward(i, len, -delta); + rect[xyDim] -= delta; + item.label[xyDim] -= delta; + adjusted = true; } - if (totalShifts > 0 && balanceShift) { - // Shift back to make the distribution more equally. - shiftList(-totalShifts / len, 0, len); - } // TODO bleedMargin? + var shift = Math.max(-delta, 0); + totalShifts += shift; + lastPos = rect[xyDim] + rect[sizeDim]; + } + if (totalShifts > 0 && balanceShift) { + // Shift back to make the distribution more equally. + shiftList(-totalShifts / len, 0, len); + } // TODO bleedMargin? - var first = list[0]; - var last = list[len - 1]; - var minGap; - var maxGap; - updateMinMaxGap(); // If ends exceed two bounds, squeeze at most 80%, then take the gap of two bounds. - minGap < 0 && squeezeGaps(-minGap, 0.8); - maxGap < 0 && squeezeGaps(maxGap, 0.8); - updateMinMaxGap(); - takeBoundsGap(minGap, maxGap, 1); - takeBoundsGap(maxGap, minGap, -1); // Handle bailout when there is not enough space. + var first = list[0]; + var last = list[len - 1]; + var minGap; + var maxGap; + updateMinMaxGap(); // If ends exceed two bounds, squeeze at most 80%, then take the gap of two bounds. - updateMinMaxGap(); + minGap < 0 && squeezeGaps(-minGap, 0.8); + maxGap < 0 && squeezeGaps(maxGap, 0.8); + updateMinMaxGap(); + takeBoundsGap(minGap, maxGap, 1); + takeBoundsGap(maxGap, minGap, -1); // Handle bailout when there is not enough space. - if (minGap < 0) { - squeezeWhenBailout(-minGap); - } + updateMinMaxGap(); - if (maxGap < 0) { - squeezeWhenBailout(maxGap); - } + if (minGap < 0) { + squeezeWhenBailout(-minGap); + } - function updateMinMaxGap() { - minGap = first.rect[xyDim] - minBound; - maxGap = maxBound - last.rect[xyDim] - last.rect[sizeDim]; - } + if (maxGap < 0) { + squeezeWhenBailout(maxGap); + } - function takeBoundsGap(gapThisBound, gapOtherBound, moveDir) { - if (gapThisBound < 0) { - // Move from other gap if can. - var moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound); + function updateMinMaxGap() { + minGap = first.rect[xyDim] - minBound; + maxGap = maxBound - last.rect[xyDim] - last.rect[sizeDim]; + } - if (moveFromMaxGap > 0) { - shiftList(moveFromMaxGap * moveDir, 0, len); - var remained = moveFromMaxGap + gapThisBound; + function takeBoundsGap(gapThisBound, gapOtherBound, moveDir) { + if (gapThisBound < 0) { + // Move from other gap if can. + var moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound); - if (remained < 0) { - squeezeGaps(-remained * moveDir, 1); - } - } else { - squeezeGaps(-gapThisBound * moveDir, 1); - } + if (moveFromMaxGap > 0) { + shiftList(moveFromMaxGap * moveDir, 0, len); + var remained = moveFromMaxGap + gapThisBound; + + if (remained < 0) { + squeezeGaps(-remained * moveDir, 1); } + } else { + squeezeGaps(-gapThisBound * moveDir, 1); + } } + } - function shiftList(delta, start, end) { - if (delta !== 0) { - adjusted = true; - } + function shiftList(delta, start, end) { + if (delta !== 0) { + adjusted = true; + } - for (var i = start; i < end; i++) { - var item = list[i]; - var rect = item.rect; - rect[xyDim] += delta; - item.label[xyDim] += delta; - } - } // Squeeze gaps if the labels exceed margin. + for (var i = start; i < end; i++) { + var item = list[i]; + var rect = item.rect; + rect[xyDim] += delta; + item.label[xyDim] += delta; + } + } // Squeeze gaps if the labels exceed margin. - function squeezeGaps(delta, maxSqeezePercent) { - var gaps = []; - var totalGaps = 0; + function squeezeGaps(delta, maxSqeezePercent) { + var gaps = []; + var totalGaps = 0; - for (var i = 1; i < len; i++) { - var prevItemRect = list[i - 1].rect; - var gap = Math.max(list[i].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0); - gaps.push(gap); - totalGaps += gap; - } + for (var i = 1; i < len; i++) { + var prevItemRect = list[i - 1].rect; + var gap = Math.max(list[i].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0); + gaps.push(gap); + totalGaps += gap; + } - if (!totalGaps) { - return; - } + if (!totalGaps) { + return; + } - var squeezePercent = Math.min(Math.abs(delta) / totalGaps, maxSqeezePercent); + var squeezePercent = Math.min(Math.abs(delta) / totalGaps, maxSqeezePercent); - if (delta > 0) { - for (var i = 0; i < len - 1; i++) { - // Distribute the shift delta to all gaps. - var movement = gaps[i] * squeezePercent; // Forward + if (delta > 0) { + for (var i = 0; i < len - 1; i++) { + // Distribute the shift delta to all gaps. + var movement = gaps[i] * squeezePercent; // Forward - shiftList(movement, 0, i + 1); - } - } else { - // Backward - for (var i = len - 1; i > 0; i--) { - // Distribute the shift delta to all gaps. - var movement = gaps[i - 1] * squeezePercent; - shiftList(-movement, i, len); - } - } - } - /** - * Squeeze to allow overlap if there is no more space available. - * Let other overlapping strategy like hideOverlap do the job instead of keep exceeding the bounds. - */ + shiftList(movement, 0, i + 1); + } + } else { + // Backward + for (var i = len - 1; i > 0; i--) { + // Distribute the shift delta to all gaps. + var movement = gaps[i - 1] * squeezePercent; + shiftList(-movement, i, len); + } + } + } + /** + * Squeeze to allow overlap if there is no more space available. + * Let other overlapping strategy like hideOverlap do the job instead of keep exceeding the bounds. + */ - function squeezeWhenBailout(delta) { - var dir = delta < 0 ? -1 : 1; - delta = Math.abs(delta); - var moveForEachLabel = Math.ceil(delta / (len - 1)); + function squeezeWhenBailout(delta) { + var dir = delta < 0 ? -1 : 1; + delta = Math.abs(delta); + var moveForEachLabel = Math.ceil(delta / (len - 1)); - for (var i = 0; i < len - 1; i++) { - if (dir > 0) { - // Forward - shiftList(moveForEachLabel, 0, i + 1); - } else { - // Backward - shiftList(-moveForEachLabel, len - i - 1, len); - } + for (var i = 0; i < len - 1; i++) { + if (dir > 0) { + // Forward + shiftList(moveForEachLabel, 0, i + 1); + } else { + // Backward + shiftList(-moveForEachLabel, len - i - 1, len); + } - delta -= moveForEachLabel; + delta -= moveForEachLabel; - if (delta <= 0) { - return; - } - } + if (delta <= 0) { + return; + } } + } - return adjusted; + return adjusted; } /** * Adjust labels on x direction to avoid overlap. @@ -37689,126 +37689,126 @@ function shiftLayoutOnX(list, leftBound, rightBound, // If average the shifts on all labels and add them to 0 - // TODO: Not sure if should enable it. - // Pros: The angle of lines will distribute more equally - // Cons: In some layout. It may not what user wanted. like in pie. the label of last sector is usually changed unexpectedly. - balanceShift) { - return shiftLayout(list, 'x', 'width', leftBound, rightBound, balanceShift); + // TODO: Not sure if should enable it. + // Pros: The angle of lines will distribute more equally + // Cons: In some layout. It may not what user wanted. like in pie. the label of last sector is usually changed unexpectedly. + balanceShift) { + return shiftLayout(list, 'x', 'width', leftBound, rightBound, balanceShift); } /** * Adjust labels on y direction to avoid overlap. */ function shiftLayoutOnY(list, topBound, bottomBound, // If average the shifts on all labels and add them to 0 - balanceShift) { - return shiftLayout(list, 'y', 'height', topBound, bottomBound, balanceShift); + balanceShift) { + return shiftLayout(list, 'y', 'height', topBound, bottomBound, balanceShift); } function hideOverlap(labelList) { - var displayedLabels = []; // TODO, render overflow visible first, put in the displayedLabels. + var displayedLabels = []; // TODO, render overflow visible first, put in the displayedLabels. - labelList.sort(function (a, b) { - return b.priority - a.priority; - }); - var globalRect = new BoundingRect(0, 0, 0, 0); - - function hideEl(el) { - if (!el.ignore) { - // Show on emphasis. - var emphasisState = el.ensureState('emphasis'); + labelList.sort(function (a, b) { + return b.priority - a.priority; + }); + var globalRect = new BoundingRect(0, 0, 0, 0); - if (emphasisState.ignore == null) { - emphasisState.ignore = false; - } - } + function hideEl(el) { + if (!el.ignore) { + // Show on emphasis. + var emphasisState = el.ensureState('emphasis'); - el.ignore = true; + if (emphasisState.ignore == null) { + emphasisState.ignore = false; + } } - for (var i = 0; i < labelList.length; i++) { - var labelItem = labelList[i]; - var isAxisAligned = labelItem.axisAligned; - var localRect = labelItem.localRect; - var transform = labelItem.transform; - var label = labelItem.label; - var labelLine = labelItem.labelLine; - globalRect.copy(labelItem.rect); // Add a threshold because layout may be aligned precisely. - - globalRect.width -= 0.1; - globalRect.height -= 0.1; - globalRect.x += 0.05; - globalRect.y += 0.05; - var obb = labelItem.obb; - var overlapped = false; - - for (var j = 0; j < displayedLabels.length; j++) { - var existsTextCfg = displayedLabels[j]; // Fast rejection. - - if (!globalRect.intersect(existsTextCfg.rect)) { - continue; - } - - if (isAxisAligned && existsTextCfg.axisAligned) { - // Is overlapped - overlapped = true; - break; - } - - if (!existsTextCfg.obb) { - // If self is not axis aligned. But other is. - existsTextCfg.obb = new OrientedBoundingRect(existsTextCfg.localRect, existsTextCfg.transform); - } + el.ignore = true; + } - if (!obb) { - // If self is axis aligned. But other is not. - obb = new OrientedBoundingRect(localRect, transform); - } - - if (obb.intersect(existsTextCfg.obb)) { - overlapped = true; - break; - } - } // TODO Callback to determine if this overlap should be handled? - - - if (overlapped) { - hideEl(label); - labelLine && hideEl(labelLine); - } else { - label.attr('ignore', labelItem.defaultAttr.ignore); - labelLine && labelLine.attr('ignore', labelItem.defaultAttr.labelGuideIgnore); - displayedLabels.push(labelItem); - } + for (var i = 0; i < labelList.length; i++) { + var labelItem = labelList[i]; + var isAxisAligned = labelItem.axisAligned; + var localRect = labelItem.localRect; + var transform = labelItem.transform; + var label = labelItem.label; + var labelLine = labelItem.labelLine; + globalRect.copy(labelItem.rect); // Add a threshold because layout may be aligned precisely. + + globalRect.width -= 0.1; + globalRect.height -= 0.1; + globalRect.x += 0.05; + globalRect.y += 0.05; + var obb = labelItem.obb; + var overlapped = false; + + for (var j = 0; j < displayedLabels.length; j++) { + var existsTextCfg = displayedLabels[j]; // Fast rejection. + + if (!globalRect.intersect(existsTextCfg.rect)) { + continue; + } + + if (isAxisAligned && existsTextCfg.axisAligned) { + // Is overlapped + overlapped = true; + break; + } + + if (!existsTextCfg.obb) { + // If self is not axis aligned. But other is. + existsTextCfg.obb = new OrientedBoundingRect(existsTextCfg.localRect, existsTextCfg.transform); + } + + if (!obb) { + // If self is axis aligned. But other is not. + obb = new OrientedBoundingRect(localRect, transform); + } + + if (obb.intersect(existsTextCfg.obb)) { + overlapped = true; + break; + } + } // TODO Callback to determine if this overlap should be handled? + + + if (overlapped) { + hideEl(label); + labelLine && hideEl(labelLine); + } else { + label.attr('ignore', labelItem.defaultAttr.ignore); + labelLine && labelLine.attr('ignore', labelItem.defaultAttr.labelGuideIgnore); + displayedLabels.push(labelItem); } + } } function cloneArr(points) { - if (points) { - var newPoints = []; - - for (var i = 0; i < points.length; i++) { - newPoints.push(points[i].slice()); - } + if (points) { + var newPoints = []; - return newPoints; + for (var i = 0; i < points.length; i++) { + newPoints.push(points[i].slice()); } + + return newPoints; + } } function prepareLayoutCallbackParams(labelItem, hostEl) { - var label = labelItem.label; - var labelLine = hostEl && hostEl.getTextGuideLine(); - return { - dataIndex: labelItem.dataIndex, - dataType: labelItem.dataType, - seriesIndex: labelItem.seriesModel.seriesIndex, - text: labelItem.label.style.text, - rect: labelItem.hostRect, - labelRect: labelItem.rect, - // x: labelAttr.x, - // y: labelAttr.y, - align: label.style.align, - verticalAlign: label.style.verticalAlign, - labelLinePoints: cloneArr(labelLine && labelLine.shape.points) - }; + var label = labelItem.label; + var labelLine = hostEl && hostEl.getTextGuideLine(); + return { + dataIndex: labelItem.dataIndex, + dataType: labelItem.dataType, + seriesIndex: labelItem.seriesModel.seriesIndex, + text: labelItem.label.style.text, + rect: labelItem.hostRect, + labelRect: labelItem.rect, + // x: labelAttr.x, + // y: labelAttr.y, + align: label.style.align, + verticalAlign: label.style.verticalAlign, + labelLinePoints: cloneArr(labelLine && labelLine.shape.points) + }; } var LABEL_OPTION_TO_STYLE_KEYS = ['align', 'verticalAlign', 'width', 'height', 'fontSize']; @@ -37817,430 +37817,430 @@ var labelLineAnimationStore = makeInner(); function extendWithKeys(target, source, keys) { - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; - if (source[key] != null) { - target[key] = source[key]; - } + if (source[key] != null) { + target[key] = source[key]; } + } } var LABEL_LAYOUT_PROPS = ['x', 'y', 'rotation']; var LabelManager = - /** @class */ - function () { - function LabelManager() { - this._labelList = []; - this._chartViewList = []; - } - - LabelManager.prototype.clearLabels = function () { - this._labelList = []; - this._chartViewList = []; - }; - /** - * Add label to manager - */ - - - LabelManager.prototype._addLabel = function (dataIndex, dataType, seriesModel, label, layoutOption) { - var labelStyle = label.style; - var hostEl = label.__hostTarget; - var textConfig = hostEl.textConfig || {}; // TODO: If label is in other state. - - var labelTransform = label.getComputedTransform(); - var labelRect = label.getBoundingRect().plain(); - BoundingRect.applyTransform(labelRect, labelRect, labelTransform); + /** @class */ + function () { + function LabelManager() { + this._labelList = []; + this._chartViewList = []; + } + + LabelManager.prototype.clearLabels = function () { + this._labelList = []; + this._chartViewList = []; + }; + /** + * Add label to manager + */ - if (labelTransform) { - dummyTransformable.setLocalTransform(labelTransform); - } else { - // Identity transform. - dummyTransformable.x = dummyTransformable.y = dummyTransformable.rotation = dummyTransformable.originX = dummyTransformable.originY = 0; - dummyTransformable.scaleX = dummyTransformable.scaleY = 1; - } - - var host = label.__hostTarget; - var hostRect; - - if (host) { - hostRect = host.getBoundingRect().plain(); - var transform = host.getComputedTransform(); - BoundingRect.applyTransform(hostRect, hostRect, transform); - } - - var labelGuide = hostRect && host.getTextGuideLine(); - - this._labelList.push({ - label: label, - labelLine: labelGuide, - seriesModel: seriesModel, - dataIndex: dataIndex, - dataType: dataType, - layoutOption: layoutOption, - computedLayoutOption: null, - rect: labelRect, - hostRect: hostRect, - // Label with lower priority will be hidden when overlapped - // Use rect size as default priority - priority: hostRect ? hostRect.width * hostRect.height : 0, - // Save default label attributes. - // For restore if developers want get back to default value in callback. - defaultAttr: { - ignore: label.ignore, - labelGuideIgnore: labelGuide && labelGuide.ignore, - x: dummyTransformable.x, - y: dummyTransformable.y, - scaleX: dummyTransformable.scaleX, - scaleY: dummyTransformable.scaleY, - rotation: dummyTransformable.rotation, - style: { - x: labelStyle.x, - y: labelStyle.y, - align: labelStyle.align, - verticalAlign: labelStyle.verticalAlign, - width: labelStyle.width, - height: labelStyle.height, - fontSize: labelStyle.fontSize - }, - cursor: label.cursor, - attachedPos: textConfig.position, - attachedRot: textConfig.rotation - } - }); - }; - LabelManager.prototype.addLabelsOfSeries = function (chartView) { - var _this = this; + LabelManager.prototype._addLabel = function (dataIndex, dataType, seriesModel, label, layoutOption) { + var labelStyle = label.style; + var hostEl = label.__hostTarget; + var textConfig = hostEl.textConfig || {}; // TODO: If label is in other state. - this._chartViewList.push(chartView); + var labelTransform = label.getComputedTransform(); + var labelRect = label.getBoundingRect().plain(); + BoundingRect.applyTransform(labelRect, labelRect, labelTransform); - var seriesModel = chartView.__model; - var layoutOption = seriesModel.get('labelLayout'); - /** - * Ignore layouting if it's not specified anything. - */ + if (labelTransform) { + dummyTransformable.setLocalTransform(labelTransform); + } else { + // Identity transform. + dummyTransformable.x = dummyTransformable.y = dummyTransformable.rotation = dummyTransformable.originX = dummyTransformable.originY = 0; + dummyTransformable.scaleX = dummyTransformable.scaleY = 1; + } + + var host = label.__hostTarget; + var hostRect; + + if (host) { + hostRect = host.getBoundingRect().plain(); + var transform = host.getComputedTransform(); + BoundingRect.applyTransform(hostRect, hostRect, transform); + } + + var labelGuide = hostRect && host.getTextGuideLine(); + + this._labelList.push({ + label: label, + labelLine: labelGuide, + seriesModel: seriesModel, + dataIndex: dataIndex, + dataType: dataType, + layoutOption: layoutOption, + computedLayoutOption: null, + rect: labelRect, + hostRect: hostRect, + // Label with lower priority will be hidden when overlapped + // Use rect size as default priority + priority: hostRect ? hostRect.width * hostRect.height : 0, + // Save default label attributes. + // For restore if developers want get back to default value in callback. + defaultAttr: { + ignore: label.ignore, + labelGuideIgnore: labelGuide && labelGuide.ignore, + x: dummyTransformable.x, + y: dummyTransformable.y, + scaleX: dummyTransformable.scaleX, + scaleY: dummyTransformable.scaleY, + rotation: dummyTransformable.rotation, + style: { + x: labelStyle.x, + y: labelStyle.y, + align: labelStyle.align, + verticalAlign: labelStyle.verticalAlign, + width: labelStyle.width, + height: labelStyle.height, + fontSize: labelStyle.fontSize + }, + cursor: label.cursor, + attachedPos: textConfig.position, + attachedRot: textConfig.rotation + } + }); + }; - if (!(isFunction(layoutOption) || keys(layoutOption).length)) { - return; - } + LabelManager.prototype.addLabelsOfSeries = function (chartView) { + var _this = this; - chartView.group.traverse(function (child) { - if (child.ignore) { - return true; // Stop traverse descendants. - } // Only support label being hosted on graphic elements. + this._chartViewList.push(chartView); + var seriesModel = chartView.__model; + var layoutOption = seriesModel.get('labelLayout'); + /** + * Ignore layouting if it's not specified anything. + */ - var textEl = child.getTextContent(); - var ecData = getECData(child); // Can only attach the text on the element with dataIndex + if (!(isFunction(layoutOption) || keys(layoutOption).length)) { + return; + } - if (textEl && !textEl.disableLabelLayout) { - _this._addLabel(ecData.dataIndex, ecData.dataType, seriesModel, textEl, layoutOption); - } - }); - }; + chartView.group.traverse(function (child) { + if (child.ignore) { + return true; // Stop traverse descendants. + } // Only support label being hosted on graphic elements. - LabelManager.prototype.updateLayoutConfig = function (api) { - var width = api.getWidth(); - var height = api.getHeight(); - function createDragHandler(el, labelLineModel) { - return function () { - updateLabelLinePoints(el, labelLineModel); - }; - } + var textEl = child.getTextContent(); + var ecData = getECData(child); // Can only attach the text on the element with dataIndex - for (var i = 0; i < this._labelList.length; i++) { - var labelItem = this._labelList[i]; - var label = labelItem.label; - var hostEl = label.__hostTarget; - var defaultLabelAttr = labelItem.defaultAttr; - var layoutOption = void 0; // TODO A global layout option? + if (textEl && !textEl.disableLabelLayout) { + _this._addLabel(ecData.dataIndex, ecData.dataType, seriesModel, textEl, layoutOption); + } + }); + }; - if (isFunction(labelItem.layoutOption)) { - layoutOption = labelItem.layoutOption(prepareLayoutCallbackParams(labelItem, hostEl)); - } else { - layoutOption = labelItem.layoutOption; - } + LabelManager.prototype.updateLayoutConfig = function (api) { + var width = api.getWidth(); + var height = api.getHeight(); - layoutOption = layoutOption || {}; - labelItem.computedLayoutOption = layoutOption; - var degreeToRadian = Math.PI / 180; // TODO hostEl should always exists. - // Or label should not have parent because the x, y is all in global space. - - if (hostEl) { - hostEl.setTextConfig({ - // Force to set local false. - local: false, - // Ignore position and rotation config on the host el if x or y is changed. - position: layoutOption.x != null || layoutOption.y != null ? null : defaultLabelAttr.attachedPos, - // Ignore rotation config on the host el if rotation is changed. - rotation: layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.attachedRot, - offset: [layoutOption.dx || 0, layoutOption.dy || 0] - }); - } + function createDragHandler(el, labelLineModel) { + return function () { + updateLabelLinePoints(el, labelLineModel); + }; + } + + for (var i = 0; i < this._labelList.length; i++) { + var labelItem = this._labelList[i]; + var label = labelItem.label; + var hostEl = label.__hostTarget; + var defaultLabelAttr = labelItem.defaultAttr; + var layoutOption = void 0; // TODO A global layout option? + + if (isFunction(labelItem.layoutOption)) { + layoutOption = labelItem.layoutOption(prepareLayoutCallbackParams(labelItem, hostEl)); + } else { + layoutOption = labelItem.layoutOption; + } + + layoutOption = layoutOption || {}; + labelItem.computedLayoutOption = layoutOption; + var degreeToRadian = Math.PI / 180; // TODO hostEl should always exists. + // Or label should not have parent because the x, y is all in global space. + + if (hostEl) { + hostEl.setTextConfig({ + // Force to set local false. + local: false, + // Ignore position and rotation config on the host el if x or y is changed. + position: layoutOption.x != null || layoutOption.y != null ? null : defaultLabelAttr.attachedPos, + // Ignore rotation config on the host el if rotation is changed. + rotation: layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.attachedRot, + offset: [layoutOption.dx || 0, layoutOption.dy || 0] + }); + } - var needsUpdateLabelLine = false; + var needsUpdateLabelLine = false; - if (layoutOption.x != null) { - // TODO width of chart view. - label.x = parsePercent$1(layoutOption.x, width); - label.setStyle('x', 0); // Ignore movement in style. TODO: origin. + if (layoutOption.x != null) { + // TODO width of chart view. + label.x = parsePercent$1(layoutOption.x, width); + label.setStyle('x', 0); // Ignore movement in style. TODO: origin. - needsUpdateLabelLine = true; - } else { - label.x = defaultLabelAttr.x; - label.setStyle('x', defaultLabelAttr.style.x); - } + needsUpdateLabelLine = true; + } else { + label.x = defaultLabelAttr.x; + label.setStyle('x', defaultLabelAttr.style.x); + } - if (layoutOption.y != null) { - // TODO height of chart view. - label.y = parsePercent$1(layoutOption.y, height); - label.setStyle('y', 0); // Ignore movement in style. + if (layoutOption.y != null) { + // TODO height of chart view. + label.y = parsePercent$1(layoutOption.y, height); + label.setStyle('y', 0); // Ignore movement in style. - needsUpdateLabelLine = true; - } else { - label.y = defaultLabelAttr.y; - label.setStyle('y', defaultLabelAttr.style.y); - } + needsUpdateLabelLine = true; + } else { + label.y = defaultLabelAttr.y; + label.setStyle('y', defaultLabelAttr.style.y); + } - if (layoutOption.labelLinePoints) { - var guideLine = hostEl.getTextGuideLine(); + if (layoutOption.labelLinePoints) { + var guideLine = hostEl.getTextGuideLine(); - if (guideLine) { - guideLine.setShape({ - points: layoutOption.labelLinePoints - }); // Not update + if (guideLine) { + guideLine.setShape({ + points: layoutOption.labelLinePoints + }); // Not update - needsUpdateLabelLine = false; - } - } + needsUpdateLabelLine = false; + } + } - var labelLayoutStore = labelLayoutInnerStore(label); - labelLayoutStore.needsUpdateLabelLine = needsUpdateLabelLine; - label.rotation = layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.rotation; - label.scaleX = defaultLabelAttr.scaleX; - label.scaleY = defaultLabelAttr.scaleY; + var labelLayoutStore = labelLayoutInnerStore(label); + labelLayoutStore.needsUpdateLabelLine = needsUpdateLabelLine; + label.rotation = layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.rotation; + label.scaleX = defaultLabelAttr.scaleX; + label.scaleY = defaultLabelAttr.scaleY; - for (var k = 0; k < LABEL_OPTION_TO_STYLE_KEYS.length; k++) { - var key = LABEL_OPTION_TO_STYLE_KEYS[k]; - label.setStyle(key, layoutOption[key] != null ? layoutOption[key] : defaultLabelAttr.style[key]); - } + for (var k = 0; k < LABEL_OPTION_TO_STYLE_KEYS.length; k++) { + var key = LABEL_OPTION_TO_STYLE_KEYS[k]; + label.setStyle(key, layoutOption[key] != null ? layoutOption[key] : defaultLabelAttr.style[key]); + } - if (layoutOption.draggable) { - label.draggable = true; - label.cursor = 'move'; + if (layoutOption.draggable) { + label.draggable = true; + label.cursor = 'move'; - if (hostEl) { - var hostModel = labelItem.seriesModel; + if (hostEl) { + var hostModel = labelItem.seriesModel; - if (labelItem.dataIndex != null) { - var data = labelItem.seriesModel.getData(labelItem.dataType); - hostModel = data.getItemModel(labelItem.dataIndex); - } - - label.on('drag', createDragHandler(hostEl, hostModel.getModel('labelLine'))); - } - } else { - // TODO Other drag functions? - label.off('drag'); - label.cursor = defaultLabelAttr.cursor; - } - } - }; - - LabelManager.prototype.layout = function (api) { - var width = api.getWidth(); - var height = api.getHeight(); - var labelList = prepareLayoutList(this._labelList); - var labelsNeedsAdjustOnX = filter(labelList, function (item) { - return item.layoutOption.moveOverlap === 'shiftX'; - }); - var labelsNeedsAdjustOnY = filter(labelList, function (item) { - return item.layoutOption.moveOverlap === 'shiftY'; - }); - shiftLayoutOnX(labelsNeedsAdjustOnX, 0, width); - shiftLayoutOnY(labelsNeedsAdjustOnY, 0, height); - var labelsNeedsHideOverlap = filter(labelList, function (item) { - return item.layoutOption.hideOverlap; - }); - hideOverlap(labelsNeedsHideOverlap); - }; - /** - * Process all labels. Not only labels with layoutOption. - */ + if (labelItem.dataIndex != null) { + var data = labelItem.seriesModel.getData(labelItem.dataType); + hostModel = data.getItemModel(labelItem.dataIndex); + } + label.on('drag', createDragHandler(hostEl, hostModel.getModel('labelLine'))); + } + } else { + // TODO Other drag functions? + label.off('drag'); + label.cursor = defaultLabelAttr.cursor; + } + } + }; - LabelManager.prototype.processLabelsOverall = function () { - var _this = this; + LabelManager.prototype.layout = function (api) { + var width = api.getWidth(); + var height = api.getHeight(); + var labelList = prepareLayoutList(this._labelList); + var labelsNeedsAdjustOnX = filter(labelList, function (item) { + return item.layoutOption.moveOverlap === 'shiftX'; + }); + var labelsNeedsAdjustOnY = filter(labelList, function (item) { + return item.layoutOption.moveOverlap === 'shiftY'; + }); + shiftLayoutOnX(labelsNeedsAdjustOnX, 0, width); + shiftLayoutOnY(labelsNeedsAdjustOnY, 0, height); + var labelsNeedsHideOverlap = filter(labelList, function (item) { + return item.layoutOption.hideOverlap; + }); + hideOverlap(labelsNeedsHideOverlap); + }; + /** + * Process all labels. Not only labels with layoutOption. + */ - each(this._chartViewList, function (chartView) { - var seriesModel = chartView.__model; - var ignoreLabelLineUpdate = chartView.ignoreLabelLineUpdate; - var animationEnabled = seriesModel.isAnimationEnabled(); - chartView.group.traverse(function (child) { - if (child.ignore && !child.forceLabelAnimation) { - return true; // Stop traverse descendants. - } - var needsUpdateLabelLine = !ignoreLabelLineUpdate; - var label = child.getTextContent(); + LabelManager.prototype.processLabelsOverall = function () { + var _this = this; - if (!needsUpdateLabelLine && label) { - needsUpdateLabelLine = labelLayoutInnerStore(label).needsUpdateLabelLine; - } + each(this._chartViewList, function (chartView) { + var seriesModel = chartView.__model; + var ignoreLabelLineUpdate = chartView.ignoreLabelLineUpdate; + var animationEnabled = seriesModel.isAnimationEnabled(); + chartView.group.traverse(function (child) { + if (child.ignore && !child.forceLabelAnimation) { + return true; // Stop traverse descendants. + } - if (needsUpdateLabelLine) { - _this._updateLabelLine(child, seriesModel); - } + var needsUpdateLabelLine = !ignoreLabelLineUpdate; + var label = child.getTextContent(); - if (animationEnabled) { - _this._animateLabels(child, seriesModel); - } - }); - }); - }; + if (!needsUpdateLabelLine && label) { + needsUpdateLabelLine = labelLayoutInnerStore(label).needsUpdateLabelLine; + } - LabelManager.prototype._updateLabelLine = function (el, seriesModel) { - // Only support label being hosted on graphic elements. - var textEl = el.getTextContent(); // Update label line style. + if (needsUpdateLabelLine) { + _this._updateLabelLine(child, seriesModel); + } - var ecData = getECData(el); - var dataIndex = ecData.dataIndex; // Only support labelLine on the labels represent data. + if (animationEnabled) { + _this._animateLabels(child, seriesModel); + } + }); + }); + }; - if (textEl && dataIndex != null) { - var data = seriesModel.getData(ecData.dataType); - var itemModel = data.getItemModel(dataIndex); - var defaultStyle = {}; - var visualStyle = data.getItemVisual(dataIndex, 'style'); - var visualType = data.getVisual('drawType'); // Default to be same with main color + LabelManager.prototype._updateLabelLine = function (el, seriesModel) { + // Only support label being hosted on graphic elements. + var textEl = el.getTextContent(); // Update label line style. - defaultStyle.stroke = visualStyle[visualType]; - var labelLineModel = itemModel.getModel('labelLine'); - setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle); - updateLabelLinePoints(el, labelLineModel); + var ecData = getECData(el); + var dataIndex = ecData.dataIndex; // Only support labelLine on the labels represent data. + + if (textEl && dataIndex != null) { + var data = seriesModel.getData(ecData.dataType); + var itemModel = data.getItemModel(dataIndex); + var defaultStyle = {}; + var visualStyle = data.getItemVisual(dataIndex, 'style'); + var visualType = data.getVisual('drawType'); // Default to be same with main color + + defaultStyle.stroke = visualStyle[visualType]; + var labelLineModel = itemModel.getModel('labelLine'); + setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle); + updateLabelLinePoints(el, labelLineModel); + } + }; + + LabelManager.prototype._animateLabels = function (el, seriesModel) { + var textEl = el.getTextContent(); + var guideLine = el.getTextGuideLine(); // Animate + + if (textEl // `forceLabelAnimation` has the highest priority + && (el.forceLabelAnimation || !textEl.ignore && !textEl.invisible && !el.disableLabelAnimation && !isElementRemoved(el))) { + var layoutStore = labelLayoutInnerStore(textEl); + var oldLayout = layoutStore.oldLayout; + var ecData = getECData(el); + var dataIndex = ecData.dataIndex; + var newProps = { + x: textEl.x, + y: textEl.y, + rotation: textEl.rotation + }; + var data = seriesModel.getData(ecData.dataType); + + if (!oldLayout) { + textEl.attr(newProps); // Disable fade in animation if value animation is enabled. + + if (!labelInner(textEl).valueAnimation) { + var oldOpacity = retrieve2(textEl.style.opacity, 1); // Fade in animation + + textEl.style.opacity = 0; + initProps(textEl, { + style: { + opacity: oldOpacity } - }; - - LabelManager.prototype._animateLabels = function (el, seriesModel) { - var textEl = el.getTextContent(); - var guideLine = el.getTextGuideLine(); // Animate - - if (textEl // `forceLabelAnimation` has the highest priority - && (el.forceLabelAnimation || !textEl.ignore && !textEl.invisible && !el.disableLabelAnimation && !isElementRemoved(el))) { - var layoutStore = labelLayoutInnerStore(textEl); - var oldLayout = layoutStore.oldLayout; - var ecData = getECData(el); - var dataIndex = ecData.dataIndex; - var newProps = { - x: textEl.x, - y: textEl.y, - rotation: textEl.rotation - }; - var data = seriesModel.getData(ecData.dataType); + }, seriesModel, dataIndex); + } + } else { + textEl.attr(oldLayout); // Make sure the animation from is in the right status. - if (!oldLayout) { - textEl.attr(newProps); // Disable fade in animation if value animation is enabled. + var prevStates = el.prevStates; - if (!labelInner(textEl).valueAnimation) { - var oldOpacity = retrieve2(textEl.style.opacity, 1); // Fade in animation + if (prevStates) { + if (indexOf(prevStates, 'select') >= 0) { + textEl.attr(layoutStore.oldLayoutSelect); + } - textEl.style.opacity = 0; - initProps(textEl, { - style: { - opacity: oldOpacity - } - }, seriesModel, dataIndex); - } - } else { - textEl.attr(oldLayout); // Make sure the animation from is in the right status. - - var prevStates = el.prevStates; - - if (prevStates) { - if (indexOf(prevStates, 'select') >= 0) { - textEl.attr(layoutStore.oldLayoutSelect); - } - - if (indexOf(prevStates, 'emphasis') >= 0) { - textEl.attr(layoutStore.oldLayoutEmphasis); - } - } + if (indexOf(prevStates, 'emphasis') >= 0) { + textEl.attr(layoutStore.oldLayoutEmphasis); + } + } - updateProps(textEl, newProps, seriesModel, dataIndex); - } + updateProps(textEl, newProps, seriesModel, dataIndex); + } - layoutStore.oldLayout = newProps; + layoutStore.oldLayout = newProps; - if (textEl.states.select) { - var layoutSelect = layoutStore.oldLayoutSelect = {}; - extendWithKeys(layoutSelect, newProps, LABEL_LAYOUT_PROPS); - extendWithKeys(layoutSelect, textEl.states.select, LABEL_LAYOUT_PROPS); - } + if (textEl.states.select) { + var layoutSelect = layoutStore.oldLayoutSelect = {}; + extendWithKeys(layoutSelect, newProps, LABEL_LAYOUT_PROPS); + extendWithKeys(layoutSelect, textEl.states.select, LABEL_LAYOUT_PROPS); + } - if (textEl.states.emphasis) { - var layoutEmphasis = layoutStore.oldLayoutEmphasis = {}; - extendWithKeys(layoutEmphasis, newProps, LABEL_LAYOUT_PROPS); - extendWithKeys(layoutEmphasis, textEl.states.emphasis, LABEL_LAYOUT_PROPS); - } + if (textEl.states.emphasis) { + var layoutEmphasis = layoutStore.oldLayoutEmphasis = {}; + extendWithKeys(layoutEmphasis, newProps, LABEL_LAYOUT_PROPS); + extendWithKeys(layoutEmphasis, textEl.states.emphasis, LABEL_LAYOUT_PROPS); + } - animateLabelValue(textEl, dataIndex, data, seriesModel, seriesModel); - } + animateLabelValue(textEl, dataIndex, data, seriesModel, seriesModel); + } - if (guideLine && !guideLine.ignore && !guideLine.invisible) { - var layoutStore = labelLineAnimationStore(guideLine); - var oldLayout = layoutStore.oldLayout; - var newLayout = { - points: guideLine.shape.points - }; + if (guideLine && !guideLine.ignore && !guideLine.invisible) { + var layoutStore = labelLineAnimationStore(guideLine); + var oldLayout = layoutStore.oldLayout; + var newLayout = { + points: guideLine.shape.points + }; - if (!oldLayout) { - guideLine.setShape(newLayout); - guideLine.style.strokePercent = 0; - initProps(guideLine, { - style: { - strokePercent: 1 - } - }, seriesModel); - } else { - guideLine.attr({ - shape: oldLayout - }); - updateProps(guideLine, { - shape: newLayout - }, seriesModel); - } + if (!oldLayout) { + guideLine.setShape(newLayout); + guideLine.style.strokePercent = 0; + initProps(guideLine, { + style: { + strokePercent: 1 + } + }, seriesModel); + } else { + guideLine.attr({ + shape: oldLayout + }); + updateProps(guideLine, { + shape: newLayout + }, seriesModel); + } - layoutStore.oldLayout = newLayout; - } - }; + layoutStore.oldLayout = newLayout; + } + }; - return LabelManager; - }(); + return LabelManager; + }(); var getLabelManager = makeInner(); function installLabelLayout(registers) { - registers.registerUpdateLifecycle('series:beforeupdate', function (ecModel, api, params) { - // TODO api provide an namespace that can save stuff per instance - var labelManager = getLabelManager(api).labelManager; + registers.registerUpdateLifecycle('series:beforeupdate', function (ecModel, api, params) { + // TODO api provide an namespace that can save stuff per instance + var labelManager = getLabelManager(api).labelManager; - if (!labelManager) { - labelManager = getLabelManager(api).labelManager = new LabelManager(); - } + if (!labelManager) { + labelManager = getLabelManager(api).labelManager = new LabelManager(); + } - labelManager.clearLabels(); - }); - registers.registerUpdateLifecycle('series:layoutlabels', function (ecModel, api, params) { - var labelManager = getLabelManager(api).labelManager; - params.updatedSeries.forEach(function (series) { - labelManager.addLabelsOfSeries(api.getViewOfSeriesModel(series)); - }); - labelManager.updateLayoutConfig(api); - labelManager.layout(api); - labelManager.processLabelsOverall(); + labelManager.clearLabels(); + }); + registers.registerUpdateLifecycle('series:layoutlabels', function (ecModel, api, params) { + var labelManager = getLabelManager(api).labelManager; + params.updatedSeries.forEach(function (series) { + labelManager.addLabelsOfSeries(api.getViewOfSeriesModel(series)); }); + labelManager.updateLayoutConfig(api); + labelManager.layout(api); + labelManager.processLabelsOverall(); + }); } var mathSin$4 = Math.sin; @@ -39699,7 +39699,7 @@ } function install(registers) { - registers.registerPainter('svg', SVGPainter); + registers.registerPainter('svg', SVGPainter); } function createDom(id, painter, dpr) { @@ -40614,903 +40614,903 @@ }()); function install$1(registers) { - registers.registerPainter('canvas', CanvasPainter); + registers.registerPainter('canvas', CanvasPainter); } var LineSeriesModel = - /** @class */ - function (_super) { - __extends(LineSeriesModel, _super); + /** @class */ + function (_super) { + __extends(LineSeriesModel, _super); - function LineSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function LineSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = LineSeriesModel.type; - _this.hasSymbolVisual = true; - return _this; - } + _this.type = LineSeriesModel.type; + _this.hasSymbolVisual = true; + return _this; + } - LineSeriesModel.prototype.getInitialData = function (option) { - if ("development" !== 'production') { - var coordSys = option.coordinateSystem; + LineSeriesModel.prototype.getInitialData = function (option) { + if ("development" !== 'production') { + var coordSys = option.coordinateSystem; - if (coordSys !== 'polar' && coordSys !== 'cartesian2d') { - throw new Error('Line not support coordinateSystem besides cartesian and polar'); - } - } + if (coordSys !== 'polar' && coordSys !== 'cartesian2d') { + throw new Error('Line not support coordinateSystem besides cartesian and polar'); + } + } - return createSeriesData(null, this, { - useEncodeDefaulter: true - }); - }; + return createSeriesData(null, this, { + useEncodeDefaulter: true + }); + }; - LineSeriesModel.prototype.getLegendIcon = function (opt) { - var group = new Group(); - var line = createSymbol('line', 0, opt.itemHeight / 2, opt.itemWidth, 0, opt.lineStyle.stroke, false); - group.add(line); - line.setStyle(opt.lineStyle); - var visualType = this.getData().getVisual('symbol'); - var visualRotate = this.getData().getVisual('symbolRotate'); - var symbolType = visualType === 'none' ? 'circle' : visualType; // Symbol size is 80% when there is a line - - var size = opt.itemHeight * 0.8; - var symbol = createSymbol(symbolType, (opt.itemWidth - size) / 2, (opt.itemHeight - size) / 2, size, size, opt.itemStyle.fill); - group.add(symbol); - symbol.setStyle(opt.itemStyle); - var symbolRotate = opt.iconRotate === 'inherit' ? visualRotate : opt.iconRotate || 0; - symbol.rotation = symbolRotate * Math.PI / 180; - symbol.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]); - - if (symbolType.indexOf('empty') > -1) { - symbol.style.stroke = symbol.style.fill; - symbol.style.fill = '#fff'; - symbol.style.lineWidth = 2; - } - - return group; - }; + LineSeriesModel.prototype.getLegendIcon = function (opt) { + var group = new Group(); + var line = createSymbol('line', 0, opt.itemHeight / 2, opt.itemWidth, 0, opt.lineStyle.stroke, false); + group.add(line); + line.setStyle(opt.lineStyle); + var visualType = this.getData().getVisual('symbol'); + var visualRotate = this.getData().getVisual('symbolRotate'); + var symbolType = visualType === 'none' ? 'circle' : visualType; // Symbol size is 80% when there is a line + + var size = opt.itemHeight * 0.8; + var symbol = createSymbol(symbolType, (opt.itemWidth - size) / 2, (opt.itemHeight - size) / 2, size, size, opt.itemStyle.fill); + group.add(symbol); + symbol.setStyle(opt.itemStyle); + var symbolRotate = opt.iconRotate === 'inherit' ? visualRotate : opt.iconRotate || 0; + symbol.rotation = symbolRotate * Math.PI / 180; + symbol.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]); + + if (symbolType.indexOf('empty') > -1) { + symbol.style.stroke = symbol.style.fill; + symbol.style.fill = '#fff'; + symbol.style.lineWidth = 2; + } - LineSeriesModel.type = 'series.line'; - LineSeriesModel.dependencies = ['grid', 'polar']; - LineSeriesModel.defaultOption = { - // zlevel: 0, - z: 3, - coordinateSystem: 'cartesian2d', - legendHoverLink: true, - clip: true, - label: { - position: 'top' - }, - // itemStyle: { - // }, - endLabel: { - show: false, - valueAnimation: true, - distance: 8 - }, - lineStyle: { - width: 2, - type: 'solid' - }, - emphasis: { - scale: true - }, - // areaStyle: { - // origin of areaStyle. Valid values: - // `'auto'/null/undefined`: from axisLine to data - // `'start'`: from min to data - // `'end'`: from data to max - // origin: 'auto' - // }, - // false, 'start', 'end', 'middle' - step: false, - // Disabled if step is true - smooth: false, - smoothMonotone: null, - symbol: 'emptyCircle', - symbolSize: 4, - symbolRotate: null, - showSymbol: true, - // `false`: follow the label interval strategy. - // `true`: show all symbols. - // `'auto'`: If possible, show all symbols, otherwise - // follow the label interval strategy. - showAllSymbol: 'auto', - // Whether to connect break point. - connectNulls: false, - // Sampling for large data. Can be: 'average', 'max', 'min', 'sum', 'lttb'. - sampling: 'none', - animationEasing: 'linear', - // Disable progressive - progressive: 0, - hoverLayerThreshold: Infinity, - universalTransition: { - divideShape: 'clone' - }, - triggerLineEvent: false - }; - return LineSeriesModel; - }(SeriesModel); + return group; + }; + + LineSeriesModel.type = 'series.line'; + LineSeriesModel.dependencies = ['grid', 'polar']; + LineSeriesModel.defaultOption = { + // zlevel: 0, + z: 3, + coordinateSystem: 'cartesian2d', + legendHoverLink: true, + clip: true, + label: { + position: 'top' + }, + // itemStyle: { + // }, + endLabel: { + show: false, + valueAnimation: true, + distance: 8 + }, + lineStyle: { + width: 2, + type: 'solid' + }, + emphasis: { + scale: true + }, + // areaStyle: { + // origin of areaStyle. Valid values: + // `'auto'/null/undefined`: from axisLine to data + // `'start'`: from min to data + // `'end'`: from data to max + // origin: 'auto' + // }, + // false, 'start', 'end', 'middle' + step: false, + // Disabled if step is true + smooth: false, + smoothMonotone: null, + symbol: 'emptyCircle', + symbolSize: 4, + symbolRotate: null, + showSymbol: true, + // `false`: follow the label interval strategy. + // `true`: show all symbols. + // `'auto'`: If possible, show all symbols, otherwise + // follow the label interval strategy. + showAllSymbol: 'auto', + // Whether to connect break point. + connectNulls: false, + // Sampling for large data. Can be: 'average', 'max', 'min', 'sum', 'lttb'. + sampling: 'none', + animationEasing: 'linear', + // Disable progressive + progressive: 0, + hoverLayerThreshold: Infinity, + universalTransition: { + divideShape: 'clone' + }, + triggerLineEvent: false + }; + return LineSeriesModel; + }(SeriesModel); /** * @return label string. Not null/undefined */ function getDefaultLabel(data, dataIndex) { - var labelDims = data.mapDimensionsAll('defaultedLabel'); - var len = labelDims.length; // Simple optimization (in lots of cases, label dims length is 1) + var labelDims = data.mapDimensionsAll('defaultedLabel'); + var len = labelDims.length; // Simple optimization (in lots of cases, label dims length is 1) - if (len === 1) { - var rawVal = retrieveRawValue(data, dataIndex, labelDims[0]); - return rawVal != null ? rawVal + '' : null; - } else if (len) { - var vals = []; - - for (var i = 0; i < labelDims.length; i++) { - vals.push(retrieveRawValue(data, dataIndex, labelDims[i])); - } + if (len === 1) { + var rawVal = retrieveRawValue(data, dataIndex, labelDims[0]); + return rawVal != null ? rawVal + '' : null; + } else if (len) { + var vals = []; - return vals.join(' '); + for (var i = 0; i < labelDims.length; i++) { + vals.push(retrieveRawValue(data, dataIndex, labelDims[i])); } + + return vals.join(' '); + } } function getDefaultInterpolatedLabel(data, interpolatedValue) { - var labelDims = data.mapDimensionsAll('defaultedLabel'); + var labelDims = data.mapDimensionsAll('defaultedLabel'); - if (!isArray(interpolatedValue)) { - return interpolatedValue + ''; - } + if (!isArray(interpolatedValue)) { + return interpolatedValue + ''; + } - var vals = []; + var vals = []; - for (var i = 0; i < labelDims.length; i++) { - var dimIndex = data.getDimensionIndex(labelDims[i]); + for (var i = 0; i < labelDims.length; i++) { + var dimIndex = data.getDimensionIndex(labelDims[i]); - if (dimIndex >= 0) { - vals.push(interpolatedValue[dimIndex]); - } + if (dimIndex >= 0) { + vals.push(interpolatedValue[dimIndex]); } + } - return vals.join(' '); + return vals.join(' '); } var Symbol = - /** @class */ - function (_super) { - __extends(Symbol, _super); - - function Symbol(data, idx, seriesScope, opts) { - var _this = _super.call(this) || this; - - _this.updateData(data, idx, seriesScope, opts); - - return _this; - } - - Symbol.prototype._createSymbol = function (symbolType, data, idx, symbolSize, keepAspect) { - // Remove paths created before - this.removeAll(); // let symbolPath = createSymbol( - // symbolType, -0.5, -0.5, 1, 1, color - // ); - // If width/height are set too small (e.g., set to 1) on ios10 - // and macOS Sierra, a circle stroke become a rect, no matter what - // the scale is set. So we set width/height as 2. See #4150. - - var symbolPath = createSymbol(symbolType, -1, -1, 2, 2, null, keepAspect); - symbolPath.attr({ - z2: 100, - culling: true, - scaleX: symbolSize[0] / 2, - scaleY: symbolSize[1] / 2 - }); // Rewrite drift method - - symbolPath.drift = driftSymbol; - this._symbolType = symbolType; - this.add(symbolPath); - }; - /** - * Stop animation - * @param {boolean} toLastFrame - */ + /** @class */ + function (_super) { + __extends(Symbol, _super); + + function Symbol(data, idx, seriesScope, opts) { + var _this = _super.call(this) || this; + + _this.updateData(data, idx, seriesScope, opts); + + return _this; + } + + Symbol.prototype._createSymbol = function (symbolType, data, idx, symbolSize, keepAspect) { + // Remove paths created before + this.removeAll(); // let symbolPath = createSymbol( + // symbolType, -0.5, -0.5, 1, 1, color + // ); + // If width/height are set too small (e.g., set to 1) on ios10 + // and macOS Sierra, a circle stroke become a rect, no matter what + // the scale is set. So we set width/height as 2. See #4150. + + var symbolPath = createSymbol(symbolType, -1, -1, 2, 2, null, keepAspect); + symbolPath.attr({ + z2: 100, + culling: true, + scaleX: symbolSize[0] / 2, + scaleY: symbolSize[1] / 2 + }); // Rewrite drift method + + symbolPath.drift = driftSymbol; + this._symbolType = symbolType; + this.add(symbolPath); + }; + /** + * Stop animation + * @param {boolean} toLastFrame + */ - Symbol.prototype.stopSymbolAnimation = function (toLastFrame) { - this.childAt(0).stopAnimation(null, toLastFrame); - }; + Symbol.prototype.stopSymbolAnimation = function (toLastFrame) { + this.childAt(0).stopAnimation(null, toLastFrame); + }; + + Symbol.prototype.getSymbolType = function () { + return this._symbolType; + }; + /** + * FIXME: + * Caution: This method breaks the encapsulation of this module, + * but it indeed brings convenience. So do not use the method + * unless you detailedly know all the implements of `Symbol`, + * especially animation. + * + * Get symbol path element. + */ - Symbol.prototype.getSymbolType = function () { - return this._symbolType; - }; - /** - * FIXME: - * Caution: This method breaks the encapsulation of this module, - * but it indeed brings convenience. So do not use the method - * unless you detailedly know all the implements of `Symbol`, - * especially animation. - * - * Get symbol path element. - */ + Symbol.prototype.getSymbolPath = function () { + return this.childAt(0); + }; + /** + * Highlight symbol + */ - Symbol.prototype.getSymbolPath = function () { - return this.childAt(0); - }; - /** - * Highlight symbol - */ + Symbol.prototype.highlight = function () { + enterEmphasis(this.childAt(0)); + }; + /** + * Downplay symbol + */ - Symbol.prototype.highlight = function () { - enterEmphasis(this.childAt(0)); - }; - /** - * Downplay symbol - */ + Symbol.prototype.downplay = function () { + leaveEmphasis(this.childAt(0)); + }; + /** + * @param {number} zlevel + * @param {number} z + */ - Symbol.prototype.downplay = function () { - leaveEmphasis(this.childAt(0)); - }; - /** - * @param {number} zlevel - * @param {number} z - */ + Symbol.prototype.setZ = function (zlevel, z) { + var symbolPath = this.childAt(0); + symbolPath.zlevel = zlevel; + symbolPath.z = z; + }; - Symbol.prototype.setZ = function (zlevel, z) { - var symbolPath = this.childAt(0); - symbolPath.zlevel = zlevel; - symbolPath.z = z; - }; + Symbol.prototype.setDraggable = function (draggable) { + var symbolPath = this.childAt(0); + symbolPath.draggable = draggable; + symbolPath.cursor = draggable ? 'move' : symbolPath.cursor; + }; + /** + * Update symbol properties + */ - Symbol.prototype.setDraggable = function (draggable) { - var symbolPath = this.childAt(0); - symbolPath.draggable = draggable; - symbolPath.cursor = draggable ? 'move' : symbolPath.cursor; - }; - /** - * Update symbol properties - */ + Symbol.prototype.updateData = function (data, idx, seriesScope, opts) { + this.silent = false; + var symbolType = data.getItemVisual(idx, 'symbol') || 'circle'; + var seriesModel = data.hostModel; + var symbolSize = Symbol.getSymbolSize(data, idx); + var isInit = symbolType !== this._symbolType; + var disableAnimation = opts && opts.disableAnimation; - Symbol.prototype.updateData = function (data, idx, seriesScope, opts) { - this.silent = false; - var symbolType = data.getItemVisual(idx, 'symbol') || 'circle'; - var seriesModel = data.hostModel; - var symbolSize = Symbol.getSymbolSize(data, idx); - var isInit = symbolType !== this._symbolType; - var disableAnimation = opts && opts.disableAnimation; + if (isInit) { + var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect'); - if (isInit) { - var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect'); + this._createSymbol(symbolType, data, idx, symbolSize, keepAspect); + } else { + var symbolPath = this.childAt(0); + symbolPath.silent = false; + var target = { + scaleX: symbolSize[0] / 2, + scaleY: symbolSize[1] / 2 + }; + disableAnimation ? symbolPath.attr(target) : updateProps(symbolPath, target, seriesModel, idx); + saveOldStyle(symbolPath); + } - this._createSymbol(symbolType, data, idx, symbolSize, keepAspect); - } else { - var symbolPath = this.childAt(0); - symbolPath.silent = false; - var target = { - scaleX: symbolSize[0] / 2, - scaleY: symbolSize[1] / 2 - }; - disableAnimation ? symbolPath.attr(target) : updateProps(symbolPath, target, seriesModel, idx); - saveOldStyle(symbolPath); - } + this._updateCommon(data, idx, symbolSize, seriesScope, opts); - this._updateCommon(data, idx, symbolSize, seriesScope, opts); + if (isInit) { + var symbolPath = this.childAt(0); - if (isInit) { - var symbolPath = this.childAt(0); + if (!disableAnimation) { + var target = { + scaleX: this._sizeX, + scaleY: this._sizeY, + style: { + // Always fadeIn. Because it has fadeOut animation when symbol is removed.. + opacity: symbolPath.style.opacity + } + }; + symbolPath.scaleX = symbolPath.scaleY = 0; + symbolPath.style.opacity = 0; + initProps(symbolPath, target, seriesModel, idx); + } + } - if (!disableAnimation) { - var target = { - scaleX: this._sizeX, - scaleY: this._sizeY, - style: { - // Always fadeIn. Because it has fadeOut animation when symbol is removed.. - opacity: symbolPath.style.opacity - } - }; - symbolPath.scaleX = symbolPath.scaleY = 0; - symbolPath.style.opacity = 0; - initProps(symbolPath, target, seriesModel, idx); - } - } + if (disableAnimation) { + // Must stop leave transition manually if don't call initProps or updateProps. + this.childAt(0).stopAnimation('leave'); + } + }; - if (disableAnimation) { - // Must stop leave transition manually if don't call initProps or updateProps. - this.childAt(0).stopAnimation('leave'); - } - }; + Symbol.prototype._updateCommon = function (data, idx, symbolSize, seriesScope, opts) { + var symbolPath = this.childAt(0); + var seriesModel = data.hostModel; + var emphasisItemStyle; + var blurItemStyle; + var selectItemStyle; + var focus; + var blurScope; + var emphasisDisabled; + var labelStatesModels; + var hoverScale; + var cursorStyle; + + if (seriesScope) { + emphasisItemStyle = seriesScope.emphasisItemStyle; + blurItemStyle = seriesScope.blurItemStyle; + selectItemStyle = seriesScope.selectItemStyle; + focus = seriesScope.focus; + blurScope = seriesScope.blurScope; + labelStatesModels = seriesScope.labelStatesModels; + hoverScale = seriesScope.hoverScale; + cursorStyle = seriesScope.cursorStyle; + emphasisDisabled = seriesScope.emphasisDisabled; + } + + if (!seriesScope || data.hasItemOption) { + var itemModel = seriesScope && seriesScope.itemModel ? seriesScope.itemModel : data.getItemModel(idx); + var emphasisModel = itemModel.getModel('emphasis'); + emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle(); + selectItemStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle(); + blurItemStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle(); + focus = emphasisModel.get('focus'); + blurScope = emphasisModel.get('blurScope'); + emphasisDisabled = emphasisModel.get('disabled'); + labelStatesModels = getLabelStatesModels(itemModel); + hoverScale = emphasisModel.getShallow('scale'); + cursorStyle = itemModel.getShallow('cursor'); + } + + var symbolRotate = data.getItemVisual(idx, 'symbolRotate'); + symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0); + var symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, 'symbolOffset'), symbolSize); - Symbol.prototype._updateCommon = function (data, idx, symbolSize, seriesScope, opts) { - var symbolPath = this.childAt(0); - var seriesModel = data.hostModel; - var emphasisItemStyle; - var blurItemStyle; - var selectItemStyle; - var focus; - var blurScope; - var emphasisDisabled; - var labelStatesModels; - var hoverScale; - var cursorStyle; - - if (seriesScope) { - emphasisItemStyle = seriesScope.emphasisItemStyle; - blurItemStyle = seriesScope.blurItemStyle; - selectItemStyle = seriesScope.selectItemStyle; - focus = seriesScope.focus; - blurScope = seriesScope.blurScope; - labelStatesModels = seriesScope.labelStatesModels; - hoverScale = seriesScope.hoverScale; - cursorStyle = seriesScope.cursorStyle; - emphasisDisabled = seriesScope.emphasisDisabled; - } - - if (!seriesScope || data.hasItemOption) { - var itemModel = seriesScope && seriesScope.itemModel ? seriesScope.itemModel : data.getItemModel(idx); - var emphasisModel = itemModel.getModel('emphasis'); - emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle(); - selectItemStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle(); - blurItemStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle(); - focus = emphasisModel.get('focus'); - blurScope = emphasisModel.get('blurScope'); - emphasisDisabled = emphasisModel.get('disabled'); - labelStatesModels = getLabelStatesModels(itemModel); - hoverScale = emphasisModel.getShallow('scale'); - cursorStyle = itemModel.getShallow('cursor'); - } - - var symbolRotate = data.getItemVisual(idx, 'symbolRotate'); - symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0); - var symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, 'symbolOffset'), symbolSize); - - if (symbolOffset) { - symbolPath.x = symbolOffset[0]; - symbolPath.y = symbolOffset[1]; - } - - cursorStyle && symbolPath.attr('cursor', cursorStyle); - var symbolStyle = data.getItemVisual(idx, 'style'); - var visualColor = symbolStyle.fill; - - if (symbolPath instanceof ZRImage) { - var pathStyle = symbolPath.style; - symbolPath.useStyle(extend({ - // TODO other properties like x, y ? - image: pathStyle.image, - x: pathStyle.x, - y: pathStyle.y, - width: pathStyle.width, - height: pathStyle.height - }, symbolStyle)); - } else { - if (symbolPath.__isEmptyBrush) { - // fill and stroke will be swapped if it's empty. - // So we cloned a new style to avoid it affecting the original style in visual storage. - // TODO Better implementation. No empty logic! - symbolPath.useStyle(extend({}, symbolStyle)); - } else { - symbolPath.useStyle(symbolStyle); - } // Disable decal because symbol scale will been applied on the decal. + if (symbolOffset) { + symbolPath.x = symbolOffset[0]; + symbolPath.y = symbolOffset[1]; + } + + cursorStyle && symbolPath.attr('cursor', cursorStyle); + var symbolStyle = data.getItemVisual(idx, 'style'); + var visualColor = symbolStyle.fill; + + if (symbolPath instanceof ZRImage) { + var pathStyle = symbolPath.style; + symbolPath.useStyle(extend({ + // TODO other properties like x, y ? + image: pathStyle.image, + x: pathStyle.x, + y: pathStyle.y, + width: pathStyle.width, + height: pathStyle.height + }, symbolStyle)); + } else { + if (symbolPath.__isEmptyBrush) { + // fill and stroke will be swapped if it's empty. + // So we cloned a new style to avoid it affecting the original style in visual storage. + // TODO Better implementation. No empty logic! + symbolPath.useStyle(extend({}, symbolStyle)); + } else { + symbolPath.useStyle(symbolStyle); + } // Disable decal because symbol scale will been applied on the decal. - symbolPath.style.decal = null; - symbolPath.setColor(visualColor, opts && opts.symbolInnerColor); - symbolPath.style.strokeNoScale = true; - } + symbolPath.style.decal = null; + symbolPath.setColor(visualColor, opts && opts.symbolInnerColor); + symbolPath.style.strokeNoScale = true; + } - var liftZ = data.getItemVisual(idx, 'liftZ'); - var z2Origin = this._z2; + var liftZ = data.getItemVisual(idx, 'liftZ'); + var z2Origin = this._z2; - if (liftZ != null) { - if (z2Origin == null) { - this._z2 = symbolPath.z2; - symbolPath.z2 += liftZ; - } - } else if (z2Origin != null) { - symbolPath.z2 = z2Origin; - this._z2 = null; - } + if (liftZ != null) { + if (z2Origin == null) { + this._z2 = symbolPath.z2; + symbolPath.z2 += liftZ; + } + } else if (z2Origin != null) { + symbolPath.z2 = z2Origin; + this._z2 = null; + } - var useNameLabel = opts && opts.useNameLabel; - setLabelStyle(symbolPath, labelStatesModels, { - labelFetcher: seriesModel, - labelDataIndex: idx, - defaultText: getLabelDefaultText, - inheritColor: visualColor, - defaultOpacity: symbolStyle.opacity - }); // Do not execute util needed. + var useNameLabel = opts && opts.useNameLabel; + setLabelStyle(symbolPath, labelStatesModels, { + labelFetcher: seriesModel, + labelDataIndex: idx, + defaultText: getLabelDefaultText, + inheritColor: visualColor, + defaultOpacity: symbolStyle.opacity + }); // Do not execute util needed. - function getLabelDefaultText(idx) { - return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx); - } + function getLabelDefaultText(idx) { + return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx); + } - this._sizeX = symbolSize[0] / 2; - this._sizeY = symbolSize[1] / 2; - var emphasisState = symbolPath.ensureState('emphasis'); - emphasisState.style = emphasisItemStyle; - symbolPath.ensureState('select').style = selectItemStyle; - symbolPath.ensureState('blur').style = blurItemStyle; + this._sizeX = symbolSize[0] / 2; + this._sizeY = symbolSize[1] / 2; + var emphasisState = symbolPath.ensureState('emphasis'); + emphasisState.style = emphasisItemStyle; + symbolPath.ensureState('select').style = selectItemStyle; + symbolPath.ensureState('blur').style = blurItemStyle; - if (hoverScale) { - var scaleRatio = Math.max(isNumber(hoverScale) ? hoverScale : 1.1, 3 / this._sizeY); - emphasisState.scaleX = this._sizeX * scaleRatio; - emphasisState.scaleY = this._sizeY * scaleRatio; - } + if (hoverScale) { + var scaleRatio = Math.max(isNumber(hoverScale) ? hoverScale : 1.1, 3 / this._sizeY); + emphasisState.scaleX = this._sizeX * scaleRatio; + emphasisState.scaleY = this._sizeY * scaleRatio; + } - this.setSymbolScale(1); - toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled); - }; + this.setSymbolScale(1); + toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled); + }; - Symbol.prototype.setSymbolScale = function (scale) { - this.scaleX = this.scaleY = scale; - }; + Symbol.prototype.setSymbolScale = function (scale) { + this.scaleX = this.scaleY = scale; + }; - Symbol.prototype.fadeOut = function (cb, seriesModel, opt) { - var symbolPath = this.childAt(0); - var dataIndex = getECData(this).dataIndex; - var animationOpt = opt && opt.animation; // Avoid mistaken hover when fading out + Symbol.prototype.fadeOut = function (cb, seriesModel, opt) { + var symbolPath = this.childAt(0); + var dataIndex = getECData(this).dataIndex; + var animationOpt = opt && opt.animation; // Avoid mistaken hover when fading out - this.silent = symbolPath.silent = true; // Not show text when animating + this.silent = symbolPath.silent = true; // Not show text when animating - if (opt && opt.fadeLabel) { - var textContent = symbolPath.getTextContent(); + if (opt && opt.fadeLabel) { + var textContent = symbolPath.getTextContent(); - if (textContent) { - removeElement(textContent, { - style: { - opacity: 0 - } - }, seriesModel, { - dataIndex: dataIndex, - removeOpt: animationOpt, - cb: function () { - symbolPath.removeTextContent(); - } - }); - } - } else { - symbolPath.removeTextContent(); - } + if (textContent) { + removeElement(textContent, { + style: { + opacity: 0 + } + }, seriesModel, { + dataIndex: dataIndex, + removeOpt: animationOpt, + cb: function () { + symbolPath.removeTextContent(); + } + }); + } + } else { + symbolPath.removeTextContent(); + } - removeElement(symbolPath, { - style: { - opacity: 0 - }, - scaleX: 0, - scaleY: 0 - }, seriesModel, { - dataIndex: dataIndex, - cb: cb, - removeOpt: animationOpt - }); - }; + removeElement(symbolPath, { + style: { + opacity: 0 + }, + scaleX: 0, + scaleY: 0 + }, seriesModel, { + dataIndex: dataIndex, + cb: cb, + removeOpt: animationOpt + }); + }; - Symbol.getSymbolSize = function (data, idx) { - return normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize')); - }; + Symbol.getSymbolSize = function (data, idx) { + return normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize')); + }; - return Symbol; - }(Group); + return Symbol; + }(Group); function driftSymbol(dx, dy) { - this.parent.drift(dx, dy); + this.parent.drift(dx, dy); } function symbolNeedsDraw(data, point, idx, opt) { - return point && !isNaN(point[0]) && !isNaN(point[1]) && !(opt.isIgnore && opt.isIgnore(idx)) // We do not set clipShape on group, because it will cut part of - // the symbol element shape. We use the same clip shape here as - // the line clip. - && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1])) && data.getItemVisual(idx, 'symbol') !== 'none'; + return point && !isNaN(point[0]) && !isNaN(point[1]) && !(opt.isIgnore && opt.isIgnore(idx)) // We do not set clipShape on group, because it will cut part of + // the symbol element shape. We use the same clip shape here as + // the line clip. + && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1])) && data.getItemVisual(idx, 'symbol') !== 'none'; } function normalizeUpdateOpt(opt) { - if (opt != null && !isObject(opt)) { - opt = { - isIgnore: opt - }; - } + if (opt != null && !isObject(opt)) { + opt = { + isIgnore: opt + }; + } - return opt || {}; + return opt || {}; } function makeSeriesScope(data) { - var seriesModel = data.hostModel; - var emphasisModel = seriesModel.getModel('emphasis'); - return { - emphasisItemStyle: emphasisModel.getModel('itemStyle').getItemStyle(), - blurItemStyle: seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(), - selectItemStyle: seriesModel.getModel(['select', 'itemStyle']).getItemStyle(), - focus: emphasisModel.get('focus'), - blurScope: emphasisModel.get('blurScope'), - emphasisDisabled: emphasisModel.get('disabled'), - hoverScale: emphasisModel.get('scale'), - labelStatesModels: getLabelStatesModels(seriesModel), - cursorStyle: seriesModel.get('cursor') - }; + var seriesModel = data.hostModel; + var emphasisModel = seriesModel.getModel('emphasis'); + return { + emphasisItemStyle: emphasisModel.getModel('itemStyle').getItemStyle(), + blurItemStyle: seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(), + selectItemStyle: seriesModel.getModel(['select', 'itemStyle']).getItemStyle(), + focus: emphasisModel.get('focus'), + blurScope: emphasisModel.get('blurScope'), + emphasisDisabled: emphasisModel.get('disabled'), + hoverScale: emphasisModel.get('scale'), + labelStatesModels: getLabelStatesModels(seriesModel), + cursorStyle: seriesModel.get('cursor') + }; } var SymbolDraw = - /** @class */ - function () { - function SymbolDraw(SymbolCtor) { - this.group = new Group(); - this._SymbolCtor = SymbolCtor || Symbol; - } - /** - * Update symbols draw by new data - */ - - - SymbolDraw.prototype.updateData = function (data, opt) { - // Remove progressive els. - this._progressiveEls = null; - opt = normalizeUpdateOpt(opt); - var group = this.group; - var seriesModel = data.hostModel; - var oldData = this._data; - var SymbolCtor = this._SymbolCtor; - var disableAnimation = opt.disableAnimation; - var seriesScope = makeSeriesScope(data); - var symbolUpdateOpt = { - disableAnimation: disableAnimation - }; - - var getSymbolPoint = opt.getSymbolPoint || function (idx) { - return data.getItemLayout(idx); - }; // There is no oldLineData only when first rendering or switching from - // stream mode to normal mode, where previous elements should be removed. - - - if (!oldData) { - group.removeAll(); - } + /** @class */ + function () { + function SymbolDraw(SymbolCtor) { + this.group = new Group(); + this._SymbolCtor = SymbolCtor || Symbol; + } + /** + * Update symbols draw by new data + */ - data.diff(oldData).add(function (newIdx) { - var point = getSymbolPoint(newIdx); - if (symbolNeedsDraw(data, point, newIdx, opt)) { - var symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt); - symbolEl.setPosition(point); - data.setItemGraphicEl(newIdx, symbolEl); - group.add(symbolEl); - } - }).update(function (newIdx, oldIdx) { - var symbolEl = oldData.getItemGraphicEl(oldIdx); - var point = getSymbolPoint(newIdx); + SymbolDraw.prototype.updateData = function (data, opt) { + // Remove progressive els. + this._progressiveEls = null; + opt = normalizeUpdateOpt(opt); + var group = this.group; + var seriesModel = data.hostModel; + var oldData = this._data; + var SymbolCtor = this._SymbolCtor; + var disableAnimation = opt.disableAnimation; + var seriesScope = makeSeriesScope(data); + var symbolUpdateOpt = { + disableAnimation: disableAnimation + }; - if (!symbolNeedsDraw(data, point, newIdx, opt)) { - group.remove(symbolEl); - return; - } + var getSymbolPoint = opt.getSymbolPoint || function (idx) { + return data.getItemLayout(idx); + }; // There is no oldLineData only when first rendering or switching from + // stream mode to normal mode, where previous elements should be removed. - var newSymbolType = data.getItemVisual(newIdx, 'symbol') || 'circle'; - var oldSymbolType = symbolEl && symbolEl.getSymbolType && symbolEl.getSymbolType(); - if (!symbolEl // Create a new if symbol type changed. - || oldSymbolType && oldSymbolType !== newSymbolType) { - group.remove(symbolEl); - symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt); - symbolEl.setPosition(point); - } else { - symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt); - var target = { - x: point[0], - y: point[1] - }; - disableAnimation ? symbolEl.attr(target) : updateProps(symbolEl, target, seriesModel); - } // Add back - - - group.add(symbolEl); - data.setItemGraphicEl(newIdx, symbolEl); - }).remove(function (oldIdx) { - var el = oldData.getItemGraphicEl(oldIdx); - el && el.fadeOut(function () { - group.remove(el); - }, seriesModel); - }).execute(); - this._getSymbolPoint = getSymbolPoint; - this._data = data; - }; + if (!oldData) { + group.removeAll(); + } - SymbolDraw.prototype.updateLayout = function () { - var _this = this; + data.diff(oldData).add(function (newIdx) { + var point = getSymbolPoint(newIdx); - var data = this._data; + if (symbolNeedsDraw(data, point, newIdx, opt)) { + var symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt); + symbolEl.setPosition(point); + data.setItemGraphicEl(newIdx, symbolEl); + group.add(symbolEl); + } + }).update(function (newIdx, oldIdx) { + var symbolEl = oldData.getItemGraphicEl(oldIdx); + var point = getSymbolPoint(newIdx); - if (data) { - // Not use animation - data.eachItemGraphicEl(function (el, idx) { - var point = _this._getSymbolPoint(idx); + if (!symbolNeedsDraw(data, point, newIdx, opt)) { + group.remove(symbolEl); + return; + } + + var newSymbolType = data.getItemVisual(newIdx, 'symbol') || 'circle'; + var oldSymbolType = symbolEl && symbolEl.getSymbolType && symbolEl.getSymbolType(); + + if (!symbolEl // Create a new if symbol type changed. + || oldSymbolType && oldSymbolType !== newSymbolType) { + group.remove(symbolEl); + symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt); + symbolEl.setPosition(point); + } else { + symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt); + var target = { + x: point[0], + y: point[1] + }; + disableAnimation ? symbolEl.attr(target) : updateProps(symbolEl, target, seriesModel); + } // Add back + + + group.add(symbolEl); + data.setItemGraphicEl(newIdx, symbolEl); + }).remove(function (oldIdx) { + var el = oldData.getItemGraphicEl(oldIdx); + el && el.fadeOut(function () { + group.remove(el); + }, seriesModel); + }).execute(); + this._getSymbolPoint = getSymbolPoint; + this._data = data; + }; - el.setPosition(point); - el.markRedraw(); - }); - } - }; + SymbolDraw.prototype.updateLayout = function () { + var _this = this; - SymbolDraw.prototype.incrementalPrepareUpdate = function (data) { - this._seriesScope = makeSeriesScope(data); - this._data = null; - this.group.removeAll(); - }; - /** - * Update symbols draw by new data - */ + var data = this._data; - SymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) { - // Clear - this._progressiveEls = []; - opt = normalizeUpdateOpt(opt); + if (data) { + // Not use animation + data.eachItemGraphicEl(function (el, idx) { + var point = _this._getSymbolPoint(idx); - function updateIncrementalAndHover(el) { - if (!el.isGroup) { - el.incremental = true; - el.ensureState('emphasis').hoverLayer = true; - } - } + el.setPosition(point); + el.markRedraw(); + }); + } + }; - for (var idx = taskParams.start; idx < taskParams.end; idx++) { - var point = data.getItemLayout(idx); + SymbolDraw.prototype.incrementalPrepareUpdate = function (data) { + this._seriesScope = makeSeriesScope(data); + this._data = null; + this.group.removeAll(); + }; + /** + * Update symbols draw by new data + */ - if (symbolNeedsDraw(data, point, idx, opt)) { - var el = new this._SymbolCtor(data, idx, this._seriesScope); - el.traverse(updateIncrementalAndHover); - el.setPosition(point); - this.group.add(el); - data.setItemGraphicEl(idx, el); + SymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) { + // Clear + this._progressiveEls = []; + opt = normalizeUpdateOpt(opt); - this._progressiveEls.push(el); - } - } - }; + function updateIncrementalAndHover(el) { + if (!el.isGroup) { + el.incremental = true; + el.ensureState('emphasis').hoverLayer = true; + } + } - SymbolDraw.prototype.eachRendered = function (cb) { - traverseElements(this._progressiveEls || this.group, cb); - }; + for (var idx = taskParams.start; idx < taskParams.end; idx++) { + var point = data.getItemLayout(idx); - SymbolDraw.prototype.remove = function (enableAnimation) { - var group = this.group; - var data = this._data; // Incremental model do not have this._data. + if (symbolNeedsDraw(data, point, idx, opt)) { + var el = new this._SymbolCtor(data, idx, this._seriesScope); + el.traverse(updateIncrementalAndHover); + el.setPosition(point); + this.group.add(el); + data.setItemGraphicEl(idx, el); - if (data && enableAnimation) { - data.eachItemGraphicEl(function (el) { - el.fadeOut(function () { - group.remove(el); - }, data.hostModel); - }); - } else { - group.removeAll(); - } - }; - return SymbolDraw; - }(); + this._progressiveEls.push(el); + } + } + }; - function prepareDataCoordInfo(coordSys, data, valueOrigin) { - var baseAxis = coordSys.getBaseAxis(); - var valueAxis = coordSys.getOtherAxis(baseAxis); - var valueStart = getValueStart(valueAxis, valueOrigin); - var baseAxisDim = baseAxis.dim; - var valueAxisDim = valueAxis.dim; - var valueDim = data.mapDimension(valueAxisDim); - var baseDim = data.mapDimension(baseAxisDim); - var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0; - var dims = map(coordSys.dimensions, function (coordDim) { - return data.mapDimension(coordDim); - }); - var stacked = false; - var stackResultDim = data.getCalculationInfo('stackResultDimension'); + SymbolDraw.prototype.eachRendered = function (cb) { + traverseElements(this._progressiveEls || this.group, cb); + }; - if (isDimensionStacked(data, dims[0] - /*, dims[1]*/ - )) { - // jshint ignore:line - stacked = true; - dims[0] = stackResultDim; - } + SymbolDraw.prototype.remove = function (enableAnimation) { + var group = this.group; + var data = this._data; // Incremental model do not have this._data. - if (isDimensionStacked(data, dims[1] - /*, dims[0]*/ - )) { - // jshint ignore:line - stacked = true; - dims[1] = stackResultDim; + if (data && enableAnimation) { + data.eachItemGraphicEl(function (el) { + el.fadeOut(function () { + group.remove(el); + }, data.hostModel); + }); + } else { + group.removeAll(); } + }; + return SymbolDraw; + }(); - return { - dataDimsForPoint: dims, - valueStart: valueStart, - valueAxisDim: valueAxisDim, - baseAxisDim: baseAxisDim, - stacked: !!stacked, - valueDim: valueDim, - baseDim: baseDim, - baseDataOffset: baseDataOffset, - stackedOverDimension: data.getCalculationInfo('stackedOverDimension') - }; + function prepareDataCoordInfo(coordSys, data, valueOrigin) { + var baseAxis = coordSys.getBaseAxis(); + var valueAxis = coordSys.getOtherAxis(baseAxis); + var valueStart = getValueStart(valueAxis, valueOrigin); + var baseAxisDim = baseAxis.dim; + var valueAxisDim = valueAxis.dim; + var valueDim = data.mapDimension(valueAxisDim); + var baseDim = data.mapDimension(baseAxisDim); + var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0; + var dims = map(coordSys.dimensions, function (coordDim) { + return data.mapDimension(coordDim); + }); + var stacked = false; + var stackResultDim = data.getCalculationInfo('stackResultDimension'); + + if (isDimensionStacked(data, dims[0] + /*, dims[1]*/ + )) { + // jshint ignore:line + stacked = true; + dims[0] = stackResultDim; + } + + if (isDimensionStacked(data, dims[1] + /*, dims[0]*/ + )) { + // jshint ignore:line + stacked = true; + dims[1] = stackResultDim; + } + + return { + dataDimsForPoint: dims, + valueStart: valueStart, + valueAxisDim: valueAxisDim, + baseAxisDim: baseAxisDim, + stacked: !!stacked, + valueDim: valueDim, + baseDim: baseDim, + baseDataOffset: baseDataOffset, + stackedOverDimension: data.getCalculationInfo('stackedOverDimension') + }; } function getValueStart(valueAxis, valueOrigin) { - var valueStart = 0; - var extent = valueAxis.scale.getExtent(); - - if (valueOrigin === 'start') { - valueStart = extent[0]; - } else if (valueOrigin === 'end') { - valueStart = extent[1]; - } // If origin is specified as a number, use it as - // valueStart directly - else if (isNumber(valueOrigin) && !isNaN(valueOrigin)) { - valueStart = valueOrigin; + var valueStart = 0; + var extent = valueAxis.scale.getExtent(); + + if (valueOrigin === 'start') { + valueStart = extent[0]; + } else if (valueOrigin === 'end') { + valueStart = extent[1]; + } // If origin is specified as a number, use it as + // valueStart directly + else if (isNumber(valueOrigin) && !isNaN(valueOrigin)) { + valueStart = valueOrigin; } // auto else { // Both positive if (extent[0] > 0) { - valueStart = extent[0]; + valueStart = extent[0]; } // Both negative else if (extent[1] < 0) { valueStart = extent[1]; - } // If is one positive, and one negative, onZero shall be true + } // If is one positive, and one negative, onZero shall be true - } + } - return valueStart; + return valueStart; } function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) { - var value = NaN; + var value = NaN; - if (dataCoordInfo.stacked) { - value = data.get(data.getCalculationInfo('stackedOverDimension'), idx); - } + if (dataCoordInfo.stacked) { + value = data.get(data.getCalculationInfo('stackedOverDimension'), idx); + } - if (isNaN(value)) { - value = dataCoordInfo.valueStart; - } + if (isNaN(value)) { + value = dataCoordInfo.valueStart; + } - var baseDataOffset = dataCoordInfo.baseDataOffset; - var stackedData = []; - stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx); - stackedData[1 - baseDataOffset] = value; - return coordSys.dataToPoint(stackedData); + var baseDataOffset = dataCoordInfo.baseDataOffset; + var stackedData = []; + stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx); + stackedData[1 - baseDataOffset] = value; + return coordSys.dataToPoint(stackedData); } function diffData(oldData, newData) { - var diffResult = []; - newData.diff(oldData).add(function (idx) { - diffResult.push({ - cmd: '+', - idx: idx - }); - }).update(function (newIdx, oldIdx) { - diffResult.push({ - cmd: '=', - idx: oldIdx, - idx1: newIdx - }); - }).remove(function (idx) { - diffResult.push({ - cmd: '-', - idx: idx - }); - }).execute(); - return diffResult; + var diffResult = []; + newData.diff(oldData).add(function (idx) { + diffResult.push({ + cmd: '+', + idx: idx + }); + }).update(function (newIdx, oldIdx) { + diffResult.push({ + cmd: '=', + idx: oldIdx, + idx1: newIdx + }); + }).remove(function (idx) { + diffResult.push({ + cmd: '-', + idx: idx + }); + }).execute(); + return diffResult; } function lineAnimationDiff(oldData, newData, oldStackedOnPoints, newStackedOnPoints, oldCoordSys, newCoordSys, oldValueOrigin, newValueOrigin) { - var diff = diffData(oldData, newData); // let newIdList = newData.mapArray(newData.getId); - // let oldIdList = oldData.mapArray(oldData.getId); - // convertToIntId(newIdList, oldIdList); - // // FIXME One data ? - // diff = arrayDiff(oldIdList, newIdList); - - var currPoints = []; - var nextPoints = []; // Points for stacking base line - - var currStackedPoints = []; - var nextStackedPoints = []; - var status = []; - var sortedIndices = []; - var rawIndices = []; - var newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin); // const oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin); - - var oldPoints = oldData.getLayout('points') || []; - var newPoints = newData.getLayout('points') || []; - - for (var i = 0; i < diff.length; i++) { - var diffItem = diff[i]; - var pointAdded = true; - var oldIdx2 = void 0; - var newIdx2 = void 0; // FIXME, animation is not so perfect when dataZoom window moves fast - // Which is in case remvoing or add more than one data in the tail or head - - switch (diffItem.cmd) { - case '=': - oldIdx2 = diffItem.idx * 2; - newIdx2 = diffItem.idx1 * 2; - var currentX = oldPoints[oldIdx2]; - var currentY = oldPoints[oldIdx2 + 1]; - var nextX = newPoints[newIdx2]; - var nextY = newPoints[newIdx2 + 1]; // If previous data is NaN, use next point directly - - if (isNaN(currentX) || isNaN(currentY)) { - currentX = nextX; - currentY = nextY; - } - - currPoints.push(currentX, currentY); - nextPoints.push(nextX, nextY); - currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]); - nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]); - rawIndices.push(newData.getRawIndex(diffItem.idx1)); - break; - - case '+': - var newIdx = diffItem.idx; - var newDataDimsForPoint = newDataOldCoordInfo.dataDimsForPoint; - var oldPt = oldCoordSys.dataToPoint([newData.get(newDataDimsForPoint[0], newIdx), newData.get(newDataDimsForPoint[1], newIdx)]); - newIdx2 = newIdx * 2; - currPoints.push(oldPt[0], oldPt[1]); - nextPoints.push(newPoints[newIdx2], newPoints[newIdx2 + 1]); - var stackedOnPoint = getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, newIdx); - currStackedPoints.push(stackedOnPoint[0], stackedOnPoint[1]); - nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]); - rawIndices.push(newData.getRawIndex(newIdx)); - break; - - case '-': - pointAdded = false; - } // Original indices - - - if (pointAdded) { - status.push(diffItem); - sortedIndices.push(sortedIndices.length); - } - } // Diff result may be crossed if all items are changed - // Sort by data index - - - sortedIndices.sort(function (a, b) { - return rawIndices[a] - rawIndices[b]; - }); - var len = currPoints.length; - var sortedCurrPoints = createFloat32Array(len); - var sortedNextPoints = createFloat32Array(len); - var sortedCurrStackedPoints = createFloat32Array(len); - var sortedNextStackedPoints = createFloat32Array(len); - var sortedStatus = []; - - for (var i = 0; i < sortedIndices.length; i++) { - var idx = sortedIndices[i]; - var i2 = i * 2; - var idx2 = idx * 2; - sortedCurrPoints[i2] = currPoints[idx2]; - sortedCurrPoints[i2 + 1] = currPoints[idx2 + 1]; - sortedNextPoints[i2] = nextPoints[idx2]; - sortedNextPoints[i2 + 1] = nextPoints[idx2 + 1]; - sortedCurrStackedPoints[i2] = currStackedPoints[idx2]; - sortedCurrStackedPoints[i2 + 1] = currStackedPoints[idx2 + 1]; - sortedNextStackedPoints[i2] = nextStackedPoints[idx2]; - sortedNextStackedPoints[i2 + 1] = nextStackedPoints[idx2 + 1]; - sortedStatus[i] = status[idx]; - } - - return { - current: sortedCurrPoints, - next: sortedNextPoints, - stackedOnCurrent: sortedCurrStackedPoints, - stackedOnNext: sortedNextStackedPoints, - status: sortedStatus - }; + var diff = diffData(oldData, newData); // let newIdList = newData.mapArray(newData.getId); + // let oldIdList = oldData.mapArray(oldData.getId); + // convertToIntId(newIdList, oldIdList); + // // FIXME One data ? + // diff = arrayDiff(oldIdList, newIdList); + + var currPoints = []; + var nextPoints = []; // Points for stacking base line + + var currStackedPoints = []; + var nextStackedPoints = []; + var status = []; + var sortedIndices = []; + var rawIndices = []; + var newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin); // const oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin); + + var oldPoints = oldData.getLayout('points') || []; + var newPoints = newData.getLayout('points') || []; + + for (var i = 0; i < diff.length; i++) { + var diffItem = diff[i]; + var pointAdded = true; + var oldIdx2 = void 0; + var newIdx2 = void 0; // FIXME, animation is not so perfect when dataZoom window moves fast + // Which is in case remvoing or add more than one data in the tail or head + + switch (diffItem.cmd) { + case '=': + oldIdx2 = diffItem.idx * 2; + newIdx2 = diffItem.idx1 * 2; + var currentX = oldPoints[oldIdx2]; + var currentY = oldPoints[oldIdx2 + 1]; + var nextX = newPoints[newIdx2]; + var nextY = newPoints[newIdx2 + 1]; // If previous data is NaN, use next point directly + + if (isNaN(currentX) || isNaN(currentY)) { + currentX = nextX; + currentY = nextY; + } + + currPoints.push(currentX, currentY); + nextPoints.push(nextX, nextY); + currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]); + nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]); + rawIndices.push(newData.getRawIndex(diffItem.idx1)); + break; + + case '+': + var newIdx = diffItem.idx; + var newDataDimsForPoint = newDataOldCoordInfo.dataDimsForPoint; + var oldPt = oldCoordSys.dataToPoint([newData.get(newDataDimsForPoint[0], newIdx), newData.get(newDataDimsForPoint[1], newIdx)]); + newIdx2 = newIdx * 2; + currPoints.push(oldPt[0], oldPt[1]); + nextPoints.push(newPoints[newIdx2], newPoints[newIdx2 + 1]); + var stackedOnPoint = getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, newIdx); + currStackedPoints.push(stackedOnPoint[0], stackedOnPoint[1]); + nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]); + rawIndices.push(newData.getRawIndex(newIdx)); + break; + + case '-': + pointAdded = false; + } // Original indices + + + if (pointAdded) { + status.push(diffItem); + sortedIndices.push(sortedIndices.length); + } + } // Diff result may be crossed if all items are changed + // Sort by data index + + + sortedIndices.sort(function (a, b) { + return rawIndices[a] - rawIndices[b]; + }); + var len = currPoints.length; + var sortedCurrPoints = createFloat32Array(len); + var sortedNextPoints = createFloat32Array(len); + var sortedCurrStackedPoints = createFloat32Array(len); + var sortedNextStackedPoints = createFloat32Array(len); + var sortedStatus = []; + + for (var i = 0; i < sortedIndices.length; i++) { + var idx = sortedIndices[i]; + var i2 = i * 2; + var idx2 = idx * 2; + sortedCurrPoints[i2] = currPoints[idx2]; + sortedCurrPoints[i2 + 1] = currPoints[idx2 + 1]; + sortedNextPoints[i2] = nextPoints[idx2]; + sortedNextPoints[i2 + 1] = nextPoints[idx2 + 1]; + sortedCurrStackedPoints[i2] = currStackedPoints[idx2]; + sortedCurrStackedPoints[i2 + 1] = currStackedPoints[idx2 + 1]; + sortedNextStackedPoints[i2] = nextStackedPoints[idx2]; + sortedNextStackedPoints[i2 + 1] = nextStackedPoints[idx2 + 1]; + sortedStatus[i] = status[idx]; + } + + return { + current: sortedCurrPoints, + next: sortedNextPoints, + stackedOnCurrent: sortedCurrStackedPoints, + stackedOnNext: sortedNextStackedPoints, + status: sortedStatus + }; } var mathMin$5 = Math.min; var mathMax$5 = Math.max; function isPointNull(x, y) { - return isNaN(x) || isNaN(y); + return isNaN(x) || isNaN(y); } /** * Draw smoothed line in non-monotone, in may cause undesired curve in extreme @@ -41520,460 +41520,460 @@ function drawSegment(ctx, points, start, segLen, allLen, dir, smooth, smoothMonotone, connectNulls) { - var prevX; - var prevY; - var cpx0; - var cpy0; - var cpx1; - var cpy1; - var idx = start; - var k = 0; - - for (; k < segLen; k++) { - var x = points[idx * 2]; - var y = points[idx * 2 + 1]; - - if (idx >= allLen || idx < 0) { - break; - } - - if (isPointNull(x, y)) { - if (connectNulls) { - idx += dir; - continue; - } - - break; - } + var prevX; + var prevY; + var cpx0; + var cpy0; + var cpx1; + var cpy1; + var idx = start; + var k = 0; - if (idx === start) { - ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y); - cpx0 = x; - cpy0 = y; - } else { - var dx = x - prevX; - var dy = y - prevY; // Ignore tiny segment. - - if (dx * dx + dy * dy < 0.5) { - idx += dir; - continue; - } + for (; k < segLen; k++) { + var x = points[idx * 2]; + var y = points[idx * 2 + 1]; - if (smooth > 0) { - var nextIdx = idx + dir; - var nextX = points[nextIdx * 2]; - var nextY = points[nextIdx * 2 + 1]; // Ignore duplicate point - - while (nextX === x && nextY === y && k < segLen) { - k++; - nextIdx += dir; - idx += dir; - nextX = points[nextIdx * 2]; - nextY = points[nextIdx * 2 + 1]; - x = points[idx * 2]; - y = points[idx * 2 + 1]; - dx = x - prevX; - dy = y - prevY; - } - - var tmpK = k + 1; - - if (connectNulls) { - // Find next point not null - while (isPointNull(nextX, nextY) && tmpK < segLen) { - tmpK++; - nextIdx += dir; - nextX = points[nextIdx * 2]; - nextY = points[nextIdx * 2 + 1]; - } - } + if (idx >= allLen || idx < 0) { + break; + } - var ratioNextSeg = 0.5; - var vx = 0; - var vy = 0; - var nextCpx0 = void 0; - var nextCpy0 = void 0; // Is last point + if (isPointNull(x, y)) { + if (connectNulls) { + idx += dir; + continue; + } - if (tmpK >= segLen || isPointNull(nextX, nextY)) { - cpx1 = x; - cpy1 = y; - } else { - vx = nextX - prevX; - vy = nextY - prevY; - var dx0 = x - prevX; - var dx1 = nextX - x; - var dy0 = y - prevY; - var dy1 = nextY - y; - var lenPrevSeg = void 0; - var lenNextSeg = void 0; - - if (smoothMonotone === 'x') { - lenPrevSeg = Math.abs(dx0); - lenNextSeg = Math.abs(dx1); - var dir_1 = vx > 0 ? 1 : -1; - cpx1 = x - dir_1 * lenPrevSeg * smooth; - cpy1 = y; - nextCpx0 = x + dir_1 * lenNextSeg * smooth; - nextCpy0 = y; - } else if (smoothMonotone === 'y') { - lenPrevSeg = Math.abs(dy0); - lenNextSeg = Math.abs(dy1); - var dir_2 = vy > 0 ? 1 : -1; - cpx1 = x; - cpy1 = y - dir_2 * lenPrevSeg * smooth; - nextCpx0 = x; - nextCpy0 = y + dir_2 * lenNextSeg * smooth; - } else { - lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0); - lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1); // Use ratio of seg length - - ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg); - cpx1 = x - vx * smooth * (1 - ratioNextSeg); - cpy1 = y - vy * smooth * (1 - ratioNextSeg); // cp0 of next segment - - nextCpx0 = x + vx * smooth * ratioNextSeg; - nextCpy0 = y + vy * smooth * ratioNextSeg; // Smooth constraint between point and next point. - // Avoid exceeding extreme after smoothing. - - nextCpx0 = mathMin$5(nextCpx0, mathMax$5(nextX, x)); - nextCpy0 = mathMin$5(nextCpy0, mathMax$5(nextY, y)); - nextCpx0 = mathMax$5(nextCpx0, mathMin$5(nextX, x)); - nextCpy0 = mathMax$5(nextCpy0, mathMin$5(nextY, y)); // Reclaculate cp1 based on the adjusted cp0 of next seg. - - vx = nextCpx0 - x; - vy = nextCpy0 - y; - cpx1 = x - vx * lenPrevSeg / lenNextSeg; - cpy1 = y - vy * lenPrevSeg / lenNextSeg; // Smooth constraint between point and prev point. - // Avoid exceeding extreme after smoothing. - - cpx1 = mathMin$5(cpx1, mathMax$5(prevX, x)); - cpy1 = mathMin$5(cpy1, mathMax$5(prevY, y)); - cpx1 = mathMax$5(cpx1, mathMin$5(prevX, x)); - cpy1 = mathMax$5(cpy1, mathMin$5(prevY, y)); // Adjust next cp0 again. - - vx = x - cpx1; - vy = y - cpy1; - nextCpx0 = x + vx * lenNextSeg / lenPrevSeg; - nextCpy0 = y + vy * lenNextSeg / lenPrevSeg; - } - } + break; + } - ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y); - cpx0 = nextCpx0; - cpy0 = nextCpy0; - } else { - ctx.lineTo(x, y); - } - } + if (idx === start) { + ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y); + cpx0 = x; + cpy0 = y; + } else { + var dx = x - prevX; + var dy = y - prevY; // Ignore tiny segment. - prevX = x; - prevY = y; + if (dx * dx + dy * dy < 0.5) { idx += dir; + continue; + } + + if (smooth > 0) { + var nextIdx = idx + dir; + var nextX = points[nextIdx * 2]; + var nextY = points[nextIdx * 2 + 1]; // Ignore duplicate point + + while (nextX === x && nextY === y && k < segLen) { + k++; + nextIdx += dir; + idx += dir; + nextX = points[nextIdx * 2]; + nextY = points[nextIdx * 2 + 1]; + x = points[idx * 2]; + y = points[idx * 2 + 1]; + dx = x - prevX; + dy = y - prevY; + } + + var tmpK = k + 1; + + if (connectNulls) { + // Find next point not null + while (isPointNull(nextX, nextY) && tmpK < segLen) { + tmpK++; + nextIdx += dir; + nextX = points[nextIdx * 2]; + nextY = points[nextIdx * 2 + 1]; + } + } + + var ratioNextSeg = 0.5; + var vx = 0; + var vy = 0; + var nextCpx0 = void 0; + var nextCpy0 = void 0; // Is last point + + if (tmpK >= segLen || isPointNull(nextX, nextY)) { + cpx1 = x; + cpy1 = y; + } else { + vx = nextX - prevX; + vy = nextY - prevY; + var dx0 = x - prevX; + var dx1 = nextX - x; + var dy0 = y - prevY; + var dy1 = nextY - y; + var lenPrevSeg = void 0; + var lenNextSeg = void 0; + + if (smoothMonotone === 'x') { + lenPrevSeg = Math.abs(dx0); + lenNextSeg = Math.abs(dx1); + var dir_1 = vx > 0 ? 1 : -1; + cpx1 = x - dir_1 * lenPrevSeg * smooth; + cpy1 = y; + nextCpx0 = x + dir_1 * lenNextSeg * smooth; + nextCpy0 = y; + } else if (smoothMonotone === 'y') { + lenPrevSeg = Math.abs(dy0); + lenNextSeg = Math.abs(dy1); + var dir_2 = vy > 0 ? 1 : -1; + cpx1 = x; + cpy1 = y - dir_2 * lenPrevSeg * smooth; + nextCpx0 = x; + nextCpy0 = y + dir_2 * lenNextSeg * smooth; + } else { + lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0); + lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1); // Use ratio of seg length + + ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg); + cpx1 = x - vx * smooth * (1 - ratioNextSeg); + cpy1 = y - vy * smooth * (1 - ratioNextSeg); // cp0 of next segment + + nextCpx0 = x + vx * smooth * ratioNextSeg; + nextCpy0 = y + vy * smooth * ratioNextSeg; // Smooth constraint between point and next point. + // Avoid exceeding extreme after smoothing. + + nextCpx0 = mathMin$5(nextCpx0, mathMax$5(nextX, x)); + nextCpy0 = mathMin$5(nextCpy0, mathMax$5(nextY, y)); + nextCpx0 = mathMax$5(nextCpx0, mathMin$5(nextX, x)); + nextCpy0 = mathMax$5(nextCpy0, mathMin$5(nextY, y)); // Reclaculate cp1 based on the adjusted cp0 of next seg. + + vx = nextCpx0 - x; + vy = nextCpy0 - y; + cpx1 = x - vx * lenPrevSeg / lenNextSeg; + cpy1 = y - vy * lenPrevSeg / lenNextSeg; // Smooth constraint between point and prev point. + // Avoid exceeding extreme after smoothing. + + cpx1 = mathMin$5(cpx1, mathMax$5(prevX, x)); + cpy1 = mathMin$5(cpy1, mathMax$5(prevY, y)); + cpx1 = mathMax$5(cpx1, mathMin$5(prevX, x)); + cpy1 = mathMax$5(cpy1, mathMin$5(prevY, y)); // Adjust next cp0 again. + + vx = x - cpx1; + vy = y - cpy1; + nextCpx0 = x + vx * lenNextSeg / lenPrevSeg; + nextCpy0 = y + vy * lenNextSeg / lenPrevSeg; + } + } + + ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y); + cpx0 = nextCpx0; + cpy0 = nextCpy0; + } else { + ctx.lineTo(x, y); + } } - return k; + prevX = x; + prevY = y; + idx += dir; + } + + return k; } var ECPolylineShape = - /** @class */ - function () { - function ECPolylineShape() { - this.smooth = 0; - this.smoothConstraint = true; - } - - return ECPolylineShape; - }(); + /** @class */ + function () { + function ECPolylineShape() { + this.smooth = 0; + this.smoothConstraint = true; + } + + return ECPolylineShape; + }(); var ECPolyline = - /** @class */ - function (_super) { - __extends(ECPolyline, _super); - - function ECPolyline(opts) { - var _this = _super.call(this, opts) || this; - - _this.type = 'ec-polyline'; - return _this; - } - - ECPolyline.prototype.getDefaultStyle = function () { - return { - stroke: '#000', - fill: null - }; - }; - - ECPolyline.prototype.getDefaultShape = function () { - return new ECPolylineShape(); - }; - - ECPolyline.prototype.buildPath = function (ctx, shape) { - var points = shape.points; - var i = 0; - var len = points.length / 2; // const result = getBoundingBox(points, shape.smoothConstraint); + /** @class */ + function (_super) { + __extends(ECPolyline, _super); - if (shape.connectNulls) { - // Must remove first and last null values avoid draw error in polygon - for (; len > 0; len--) { - if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) { - break; - } - } + function ECPolyline(opts) { + var _this = _super.call(this, opts) || this; - for (; i < len; i++) { - if (!isPointNull(points[i * 2], points[i * 2 + 1])) { - break; - } - } - } + _this.type = 'ec-polyline'; + return _this; + } - while (i < len) { - i += drawSegment(ctx, points, i, len, len, 1, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1; - } - }; + ECPolyline.prototype.getDefaultStyle = function () { + return { + stroke: '#000', + fill: null + }; + }; - ECPolyline.prototype.getPointOn = function (xOrY, dim) { - if (!this.path) { - this.createPathProxy(); - this.buildPath(this.path, this.shape); - } + ECPolyline.prototype.getDefaultShape = function () { + return new ECPolylineShape(); + }; - var path = this.path; - var data = path.data; - var CMD = PathProxy.CMD; - var x0; - var y0; - var isDimX = dim === 'x'; - var roots = []; - - for (var i = 0; i < data.length;) { - var cmd = data[i++]; - var x = void 0; - var y = void 0; - var x2 = void 0; - var y2 = void 0; - var x3 = void 0; - var y3 = void 0; - var t = void 0; - - switch (cmd) { - case CMD.M: - x0 = data[i++]; - y0 = data[i++]; - break; + ECPolyline.prototype.buildPath = function (ctx, shape) { + var points = shape.points; + var i = 0; + var len = points.length / 2; // const result = getBoundingBox(points, shape.smoothConstraint); - case CMD.L: - x = data[i++]; - y = data[i++]; - t = isDimX ? (xOrY - x0) / (x - x0) : (xOrY - y0) / (y - y0); + if (shape.connectNulls) { + // Must remove first and last null values avoid draw error in polygon + for (; len > 0; len--) { + if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) { + break; + } + } - if (t <= 1 && t >= 0) { - var val = isDimX ? (y - y0) * t + y0 : (x - x0) * t + x0; - return isDimX ? [xOrY, val] : [val, xOrY]; - } + for (; i < len; i++) { + if (!isPointNull(points[i * 2], points[i * 2 + 1])) { + break; + } + } + } - x0 = x; - y0 = y; - break; + while (i < len) { + i += drawSegment(ctx, points, i, len, len, 1, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1; + } + }; - case CMD.C: - x = data[i++]; - y = data[i++]; - x2 = data[i++]; - y2 = data[i++]; - x3 = data[i++]; - y3 = data[i++]; - var nRoot = isDimX ? cubicRootAt(x0, x, x2, x3, xOrY, roots) : cubicRootAt(y0, y, y2, y3, xOrY, roots); - - if (nRoot > 0) { - for (var i_1 = 0; i_1 < nRoot; i_1++) { - var t_1 = roots[i_1]; - - if (t_1 <= 1 && t_1 >= 0) { - var val = isDimX ? cubicAt(y0, y, y2, y3, t_1) : cubicAt(x0, x, x2, x3, t_1); - return isDimX ? [xOrY, val] : [val, xOrY]; - } - } - } + ECPolyline.prototype.getPointOn = function (xOrY, dim) { + if (!this.path) { + this.createPathProxy(); + this.buildPath(this.path, this.shape); + } - x0 = x3; - y0 = y3; - break; - } - } - }; + var path = this.path; + var data = path.data; + var CMD = PathProxy.CMD; + var x0; + var y0; + var isDimX = dim === 'x'; + var roots = []; - return ECPolyline; - }(Path); + for (var i = 0; i < data.length;) { + var cmd = data[i++]; + var x = void 0; + var y = void 0; + var x2 = void 0; + var y2 = void 0; + var x3 = void 0; + var y3 = void 0; + var t = void 0; + + switch (cmd) { + case CMD.M: + x0 = data[i++]; + y0 = data[i++]; + break; + + case CMD.L: + x = data[i++]; + y = data[i++]; + t = isDimX ? (xOrY - x0) / (x - x0) : (xOrY - y0) / (y - y0); + + if (t <= 1 && t >= 0) { + var val = isDimX ? (y - y0) * t + y0 : (x - x0) * t + x0; + return isDimX ? [xOrY, val] : [val, xOrY]; + } + + x0 = x; + y0 = y; + break; + + case CMD.C: + x = data[i++]; + y = data[i++]; + x2 = data[i++]; + y2 = data[i++]; + x3 = data[i++]; + y3 = data[i++]; + var nRoot = isDimX ? cubicRootAt(x0, x, x2, x3, xOrY, roots) : cubicRootAt(y0, y, y2, y3, xOrY, roots); + + if (nRoot > 0) { + for (var i_1 = 0; i_1 < nRoot; i_1++) { + var t_1 = roots[i_1]; + + if (t_1 <= 1 && t_1 >= 0) { + var val = isDimX ? cubicAt(y0, y, y2, y3, t_1) : cubicAt(x0, x, x2, x3, t_1); + return isDimX ? [xOrY, val] : [val, xOrY]; + } + } + } + + x0 = x3; + y0 = y3; + break; + } + } + }; + + return ECPolyline; + }(Path); var ECPolygonShape = - /** @class */ - function (_super) { - __extends(ECPolygonShape, _super); + /** @class */ + function (_super) { + __extends(ECPolygonShape, _super); - function ECPolygonShape() { - return _super !== null && _super.apply(this, arguments) || this; - } + function ECPolygonShape() { + return _super !== null && _super.apply(this, arguments) || this; + } - return ECPolygonShape; - }(ECPolylineShape); + return ECPolygonShape; + }(ECPolylineShape); var ECPolygon = - /** @class */ - function (_super) { - __extends(ECPolygon, _super); + /** @class */ + function (_super) { + __extends(ECPolygon, _super); - function ECPolygon(opts) { - var _this = _super.call(this, opts) || this; - - _this.type = 'ec-polygon'; - return _this; - } + function ECPolygon(opts) { + var _this = _super.call(this, opts) || this; - ECPolygon.prototype.getDefaultShape = function () { - return new ECPolygonShape(); - }; - - ECPolygon.prototype.buildPath = function (ctx, shape) { - var points = shape.points; - var stackedOnPoints = shape.stackedOnPoints; - var i = 0; - var len = points.length / 2; - var smoothMonotone = shape.smoothMonotone; - - if (shape.connectNulls) { - // Must remove first and last null values avoid draw error in polygon - for (; len > 0; len--) { - if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) { - break; - } - } + _this.type = 'ec-polygon'; + return _this; + } - for (; i < len; i++) { - if (!isPointNull(points[i * 2], points[i * 2 + 1])) { - break; - } - } - } + ECPolygon.prototype.getDefaultShape = function () { + return new ECPolygonShape(); + }; - while (i < len) { - var k = drawSegment(ctx, points, i, len, len, 1, shape.smooth, smoothMonotone, shape.connectNulls); - drawSegment(ctx, stackedOnPoints, i + k - 1, k, len, -1, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls); - i += k + 1; - ctx.closePath(); - } - }; + ECPolygon.prototype.buildPath = function (ctx, shape) { + var points = shape.points; + var stackedOnPoints = shape.stackedOnPoints; + var i = 0; + var len = points.length / 2; + var smoothMonotone = shape.smoothMonotone; - return ECPolygon; - }(Path); + if (shape.connectNulls) { + // Must remove first and last null values avoid draw error in polygon + for (; len > 0; len--) { + if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) { + break; + } + } - function createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) { - var rect = cartesian.getArea(); - var x = rect.x; - var y = rect.y; - var width = rect.width; - var height = rect.height; - var lineWidth = seriesModel.get(['lineStyle', 'width']) || 2; // Expand the clip path a bit to avoid the border is clipped and looks thinner + for (; i < len; i++) { + if (!isPointNull(points[i * 2], points[i * 2 + 1])) { + break; + } + } + } - x -= lineWidth / 2; - y -= lineWidth / 2; - width += lineWidth; - height += lineWidth; // fix: https://github.com/apache/incubator-echarts/issues/11369 + while (i < len) { + var k = drawSegment(ctx, points, i, len, len, 1, shape.smooth, smoothMonotone, shape.connectNulls); + drawSegment(ctx, stackedOnPoints, i + k - 1, k, len, -1, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls); + i += k + 1; + ctx.closePath(); + } + }; - x = Math.floor(x); - width = Math.round(width); - var clipPath = new Rect({ - shape: { - x: x, - y: y, - width: width, - height: height - } - }); + return ECPolygon; + }(Path); - if (hasAnimation) { - var baseAxis = cartesian.getBaseAxis(); - var isHorizontal = baseAxis.isHorizontal(); - var isAxisInversed = baseAxis.inverse; + function createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) { + var rect = cartesian.getArea(); + var x = rect.x; + var y = rect.y; + var width = rect.width; + var height = rect.height; + var lineWidth = seriesModel.get(['lineStyle', 'width']) || 2; // Expand the clip path a bit to avoid the border is clipped and looks thinner + + x -= lineWidth / 2; + y -= lineWidth / 2; + width += lineWidth; + height += lineWidth; // fix: https://github.com/apache/incubator-echarts/issues/11369 + + x = Math.floor(x); + width = Math.round(width); + var clipPath = new Rect({ + shape: { + x: x, + y: y, + width: width, + height: height + } + }); - if (isHorizontal) { - if (isAxisInversed) { - clipPath.shape.x += width; - } + if (hasAnimation) { + var baseAxis = cartesian.getBaseAxis(); + var isHorizontal = baseAxis.isHorizontal(); + var isAxisInversed = baseAxis.inverse; - clipPath.shape.width = 0; - } else { - if (!isAxisInversed) { - clipPath.shape.y += height; - } + if (isHorizontal) { + if (isAxisInversed) { + clipPath.shape.x += width; + } - clipPath.shape.height = 0; - } + clipPath.shape.width = 0; + } else { + if (!isAxisInversed) { + clipPath.shape.y += height; + } - var duringCb = isFunction(during) ? function (percent) { - during(percent, clipPath); - } : null; - initProps(clipPath, { - shape: { - width: width, - height: height, - x: x, - y: y - } - }, seriesModel, null, done, duringCb); + clipPath.shape.height = 0; } - return clipPath; + var duringCb = isFunction(during) ? function (percent) { + during(percent, clipPath); + } : null; + initProps(clipPath, { + shape: { + width: width, + height: height, + x: x, + y: y + } + }, seriesModel, null, done, duringCb); + } + + return clipPath; } function createPolarClipPath(polar, hasAnimation, seriesModel) { - var sectorArea = polar.getArea(); // Avoid float number rounding error for symbol on the edge of axis extent. - - var r0 = round(sectorArea.r0, 1); - var r = round(sectorArea.r, 1); - var clipPath = new Sector({ - shape: { - cx: round(polar.cx, 1), - cy: round(polar.cy, 1), - r0: r0, - r: r, - startAngle: sectorArea.startAngle, - endAngle: sectorArea.endAngle, - clockwise: sectorArea.clockwise - } - }); + var sectorArea = polar.getArea(); // Avoid float number rounding error for symbol on the edge of axis extent. - if (hasAnimation) { - var isRadial = polar.getBaseAxis().dim === 'angle'; + var r0 = round(sectorArea.r0, 1); + var r = round(sectorArea.r, 1); + var clipPath = new Sector({ + shape: { + cx: round(polar.cx, 1), + cy: round(polar.cy, 1), + r0: r0, + r: r, + startAngle: sectorArea.startAngle, + endAngle: sectorArea.endAngle, + clockwise: sectorArea.clockwise + } + }); - if (isRadial) { - clipPath.shape.endAngle = sectorArea.startAngle; - } else { - clipPath.shape.r = r0; - } + if (hasAnimation) { + var isRadial = polar.getBaseAxis().dim === 'angle'; - initProps(clipPath, { - shape: { - endAngle: sectorArea.endAngle, - r: r - } - }, seriesModel); + if (isRadial) { + clipPath.shape.endAngle = sectorArea.startAngle; + } else { + clipPath.shape.r = r0; } - return clipPath; + initProps(clipPath, { + shape: { + endAngle: sectorArea.endAngle, + r: r + } + }, seriesModel); + } + + return clipPath; } function createClipPath(coordSys, hasAnimation, seriesModel, done, during) { - if (!coordSys) { - return null; - } else if (coordSys.type === 'polar') { - return createPolarClipPath(coordSys, hasAnimation, seriesModel); - } else if (coordSys.type === 'cartesian2d') { - return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during); - } - + if (!coordSys) { return null; + } else if (coordSys.type === 'polar') { + return createPolarClipPath(coordSys, hasAnimation, seriesModel); + } else if (coordSys.type === 'cartesian2d') { + return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during); + } + + return null; } /* @@ -42019,136 +42019,136 @@ * under the License. */ function isCoordinateSystemType(coordSys, type) { - return coordSys.type === type; + return coordSys.type === type; } function isPointsSame(points1, points2) { - if (points1.length !== points2.length) { - return; - } + if (points1.length !== points2.length) { + return; + } - for (var i = 0; i < points1.length; i++) { - if (points1[i] !== points2[i]) { - return; - } + for (var i = 0; i < points1.length; i++) { + if (points1[i] !== points2[i]) { + return; } + } - return true; + return true; } function bboxFromPoints(points) { - var minX = Infinity; - var minY = Infinity; - var maxX = -Infinity; - var maxY = -Infinity; + var minX = Infinity; + var minY = Infinity; + var maxX = -Infinity; + var maxY = -Infinity; - for (var i = 0; i < points.length;) { - var x = points[i++]; - var y = points[i++]; + for (var i = 0; i < points.length;) { + var x = points[i++]; + var y = points[i++]; - if (!isNaN(x)) { - minX = Math.min(x, minX); - maxX = Math.max(x, maxX); - } + if (!isNaN(x)) { + minX = Math.min(x, minX); + maxX = Math.max(x, maxX); + } - if (!isNaN(y)) { - minY = Math.min(y, minY); - maxY = Math.max(y, maxY); - } + if (!isNaN(y)) { + minY = Math.min(y, minY); + maxY = Math.max(y, maxY); } + } - return [[minX, minY], [maxX, maxY]]; + return [[minX, minY], [maxX, maxY]]; } function getBoundingDiff(points1, points2) { - var _a = bboxFromPoints(points1), - min1 = _a[0], - max1 = _a[1]; + var _a = bboxFromPoints(points1), + min1 = _a[0], + max1 = _a[1]; - var _b = bboxFromPoints(points2), - min2 = _b[0], - max2 = _b[1]; // Get a max value from each corner of two boundings. + var _b = bboxFromPoints(points2), + min2 = _b[0], + max2 = _b[1]; // Get a max value from each corner of two boundings. - return Math.max(Math.abs(min1[0] - min2[0]), Math.abs(min1[1] - min2[1]), Math.abs(max1[0] - max2[0]), Math.abs(max1[1] - max2[1])); + return Math.max(Math.abs(min1[0] - min2[0]), Math.abs(min1[1] - min2[1]), Math.abs(max1[0] - max2[0]), Math.abs(max1[1] - max2[1])); } function getSmooth(smooth) { - return isNumber(smooth) ? smooth : smooth ? 0.5 : 0; + return isNumber(smooth) ? smooth : smooth ? 0.5 : 0; } function getStackedOnPoints(coordSys, data, dataCoordInfo) { - if (!dataCoordInfo.valueDim) { - return []; - } + if (!dataCoordInfo.valueDim) { + return []; + } - var len = data.count(); - var points = createFloat32Array(len * 2); + var len = data.count(); + var points = createFloat32Array(len * 2); - for (var idx = 0; idx < len; idx++) { - var pt = getStackedOnPoint(dataCoordInfo, coordSys, data, idx); - points[idx * 2] = pt[0]; - points[idx * 2 + 1] = pt[1]; - } + for (var idx = 0; idx < len; idx++) { + var pt = getStackedOnPoint(dataCoordInfo, coordSys, data, idx); + points[idx * 2] = pt[0]; + points[idx * 2 + 1] = pt[1]; + } - return points; + return points; } function turnPointsIntoStep(points, coordSys, stepTurnAt, connectNulls) { - var baseAxis = coordSys.getBaseAxis(); - var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1; - var stepPoints = []; - var i = 0; - var stepPt = []; - var pt = []; - var nextPt = []; - var filteredPoints = []; - - if (connectNulls) { - for (i = 0; i < points.length; i += 2) { - if (!isNaN(points[i]) && !isNaN(points[i + 1])) { - filteredPoints.push(points[i], points[i + 1]); - } - } - - points = filteredPoints; - } - - for (i = 0; i < points.length - 2; i += 2) { - nextPt[0] = points[i + 2]; - nextPt[1] = points[i + 3]; - pt[0] = points[i]; - pt[1] = points[i + 1]; - stepPoints.push(pt[0], pt[1]); - - switch (stepTurnAt) { - case 'end': - stepPt[baseIndex] = nextPt[baseIndex]; - stepPt[1 - baseIndex] = pt[1 - baseIndex]; - stepPoints.push(stepPt[0], stepPt[1]); - break; - - case 'middle': - var middle = (pt[baseIndex] + nextPt[baseIndex]) / 2; - var stepPt2 = []; - stepPt[baseIndex] = stepPt2[baseIndex] = middle; - stepPt[1 - baseIndex] = pt[1 - baseIndex]; - stepPt2[1 - baseIndex] = nextPt[1 - baseIndex]; - stepPoints.push(stepPt[0], stepPt[1]); - stepPoints.push(stepPt2[0], stepPt2[1]); - break; - - default: - // default is start - stepPt[baseIndex] = pt[baseIndex]; - stepPt[1 - baseIndex] = nextPt[1 - baseIndex]; - stepPoints.push(stepPt[0], stepPt[1]); - } - } // Last points - - - stepPoints.push(points[i++], points[i++]); - return stepPoints; + var baseAxis = coordSys.getBaseAxis(); + var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1; + var stepPoints = []; + var i = 0; + var stepPt = []; + var pt = []; + var nextPt = []; + var filteredPoints = []; + + if (connectNulls) { + for (i = 0; i < points.length; i += 2) { + if (!isNaN(points[i]) && !isNaN(points[i + 1])) { + filteredPoints.push(points[i], points[i + 1]); + } + } + + points = filteredPoints; + } + + for (i = 0; i < points.length - 2; i += 2) { + nextPt[0] = points[i + 2]; + nextPt[1] = points[i + 3]; + pt[0] = points[i]; + pt[1] = points[i + 1]; + stepPoints.push(pt[0], pt[1]); + + switch (stepTurnAt) { + case 'end': + stepPt[baseIndex] = nextPt[baseIndex]; + stepPt[1 - baseIndex] = pt[1 - baseIndex]; + stepPoints.push(stepPt[0], stepPt[1]); + break; + + case 'middle': + var middle = (pt[baseIndex] + nextPt[baseIndex]) / 2; + var stepPt2 = []; + stepPt[baseIndex] = stepPt2[baseIndex] = middle; + stepPt[1 - baseIndex] = pt[1 - baseIndex]; + stepPt2[1 - baseIndex] = nextPt[1 - baseIndex]; + stepPoints.push(stepPt[0], stepPt[1]); + stepPoints.push(stepPt2[0], stepPt2[1]); + break; + + default: + // default is start + stepPt[baseIndex] = pt[baseIndex]; + stepPt[1 - baseIndex] = nextPt[1 - baseIndex]; + stepPoints.push(stepPt[0], stepPt[1]); + } + } // Last points + + + stepPoints.push(points[i++], points[i++]); + return stepPoints; } /** * Clip color stops to edge. Avoid creating too large gradients. @@ -42159,2819 +42159,2819 @@ function clipColorStops(colorStops, maxSize) { - var newColorStops = []; - var len = colorStops.length; // coord will always < 0 in prevOutOfRangeColorStop. + var newColorStops = []; + var len = colorStops.length; // coord will always < 0 in prevOutOfRangeColorStop. - var prevOutOfRangeColorStop; - var prevInRangeColorStop; + var prevOutOfRangeColorStop; + var prevInRangeColorStop; - function lerpStop(stop0, stop1, clippedCoord) { - var coord0 = stop0.coord; - var p = (clippedCoord - coord0) / (stop1.coord - coord0); - var color = lerp$1(p, [stop0.color, stop1.color]); - return { - coord: clippedCoord, - color: color - }; - } + function lerpStop(stop0, stop1, clippedCoord) { + var coord0 = stop0.coord; + var p = (clippedCoord - coord0) / (stop1.coord - coord0); + var color = lerp$1(p, [stop0.color, stop1.color]); + return { + coord: clippedCoord, + color: color + }; + } - for (var i = 0; i < len; i++) { - var stop_1 = colorStops[i]; - var coord = stop_1.coord; + for (var i = 0; i < len; i++) { + var stop_1 = colorStops[i]; + var coord = stop_1.coord; - if (coord < 0) { - prevOutOfRangeColorStop = stop_1; - } else if (coord > maxSize) { - if (prevInRangeColorStop) { - newColorStops.push(lerpStop(prevInRangeColorStop, stop_1, maxSize)); - } else if (prevOutOfRangeColorStop) { - // If there are two stops and coord range is between these two stops - newColorStops.push(lerpStop(prevOutOfRangeColorStop, stop_1, 0), lerpStop(prevOutOfRangeColorStop, stop_1, maxSize)); - } // All following stop will be out of range. So just ignore them. + if (coord < 0) { + prevOutOfRangeColorStop = stop_1; + } else if (coord > maxSize) { + if (prevInRangeColorStop) { + newColorStops.push(lerpStop(prevInRangeColorStop, stop_1, maxSize)); + } else if (prevOutOfRangeColorStop) { + // If there are two stops and coord range is between these two stops + newColorStops.push(lerpStop(prevOutOfRangeColorStop, stop_1, 0), lerpStop(prevOutOfRangeColorStop, stop_1, maxSize)); + } // All following stop will be out of range. So just ignore them. - break; - } else { - if (prevOutOfRangeColorStop) { - newColorStops.push(lerpStop(prevOutOfRangeColorStop, stop_1, 0)); // Reset + break; + } else { + if (prevOutOfRangeColorStop) { + newColorStops.push(lerpStop(prevOutOfRangeColorStop, stop_1, 0)); // Reset - prevOutOfRangeColorStop = null; - } + prevOutOfRangeColorStop = null; + } - newColorStops.push(stop_1); - prevInRangeColorStop = stop_1; - } + newColorStops.push(stop_1); + prevInRangeColorStop = stop_1; } + } - return newColorStops; + return newColorStops; } function getVisualGradient(data, coordSys, api) { - var visualMetaList = data.getVisual('visualMeta'); - - if (!visualMetaList || !visualMetaList.length || !data.count()) { - // When data.count() is 0, gradient range can not be calculated. - return; - } - - if (coordSys.type !== 'cartesian2d') { - if ("development" !== 'production') { - console.warn('Visual map on line style is only supported on cartesian2d.'); - } - - return; - } - - var coordDim; - var visualMeta; + var visualMetaList = data.getVisual('visualMeta'); - for (var i = visualMetaList.length - 1; i >= 0; i--) { - var dimInfo = data.getDimensionInfo(visualMetaList[i].dimension); - coordDim = dimInfo && dimInfo.coordDim; // Can only be x or y + if (!visualMetaList || !visualMetaList.length || !data.count()) { + // When data.count() is 0, gradient range can not be calculated. + return; + } - if (coordDim === 'x' || coordDim === 'y') { - visualMeta = visualMetaList[i]; - break; - } + if (coordSys.type !== 'cartesian2d') { + if ("development" !== 'production') { + console.warn('Visual map on line style is only supported on cartesian2d.'); } - if (!visualMeta) { - if ("development" !== 'production') { - console.warn('Visual map on line style only support x or y dimension.'); - } - - return; - } // If the area to be rendered is bigger than area defined by LinearGradient, - // the canvas spec prescribes that the color of the first stop and the last - // stop should be used. But if two stops are added at offset 0, in effect - // browsers use the color of the second stop to render area outside - // LinearGradient. So we can only infinitesimally extend area defined in - // LinearGradient to render `outerColors`. - + return; + } - var axis = coordSys.getAxis(coordDim); // dataToCoord mapping may not be linear, but must be monotonic. + var coordDim; + var visualMeta; - var colorStops = map(visualMeta.stops, function (stop) { - // offset will be calculated later. - return { - coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)), - color: stop.color - }; - }); - var stopLen = colorStops.length; - var outerColors = visualMeta.outerColors.slice(); + for (var i = visualMetaList.length - 1; i >= 0; i--) { + var dimInfo = data.getDimensionInfo(visualMetaList[i].dimension); + coordDim = dimInfo && dimInfo.coordDim; // Can only be x or y - if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) { - colorStops.reverse(); - outerColors.reverse(); + if (coordDim === 'x' || coordDim === 'y') { + visualMeta = visualMetaList[i]; + break; } + } - var colorStopsInRange = clipColorStops(colorStops, coordDim === 'x' ? api.getWidth() : api.getHeight()); - var inRangeStopLen = colorStopsInRange.length; - - if (!inRangeStopLen && stopLen) { - // All stops are out of range. All will be the same color. - return colorStops[0].coord < 0 ? outerColors[1] ? outerColors[1] : colorStops[stopLen - 1].color : outerColors[0] ? outerColors[0] : colorStops[0].color; + if (!visualMeta) { + if ("development" !== 'production') { + console.warn('Visual map on line style only support x or y dimension.'); } - var tinyExtent = 10; // Arbitrary value: 10px + return; + } // If the area to be rendered is bigger than area defined by LinearGradient, + // the canvas spec prescribes that the color of the first stop and the last + // stop should be used. But if two stops are added at offset 0, in effect + // browsers use the color of the second stop to render area outside + // LinearGradient. So we can only infinitesimally extend area defined in + // LinearGradient to render `outerColors`. - var minCoord = colorStopsInRange[0].coord - tinyExtent; - var maxCoord = colorStopsInRange[inRangeStopLen - 1].coord + tinyExtent; - var coordSpan = maxCoord - minCoord; - if (coordSpan < 1e-3) { - return 'transparent'; - } + var axis = coordSys.getAxis(coordDim); // dataToCoord mapping may not be linear, but must be monotonic. - each(colorStopsInRange, function (stop) { - stop.offset = (stop.coord - minCoord) / coordSpan; - }); - colorStopsInRange.push({ - // NOTE: inRangeStopLen may still be 0 if stoplen is zero. - offset: inRangeStopLen ? colorStopsInRange[inRangeStopLen - 1].offset : 0.5, - color: outerColors[1] || 'transparent' - }); - colorStopsInRange.unshift({ - offset: inRangeStopLen ? colorStopsInRange[0].offset : 0.5, - color: outerColors[0] || 'transparent' - }); - var gradient = new LinearGradient(0, 0, 0, 0, colorStopsInRange, true); - gradient[coordDim] = minCoord; - gradient[coordDim + '2'] = maxCoord; - return gradient; + var colorStops = map(visualMeta.stops, function (stop) { + // offset will be calculated later. + return { + coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)), + color: stop.color + }; + }); + var stopLen = colorStops.length; + var outerColors = visualMeta.outerColors.slice(); + + if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) { + colorStops.reverse(); + outerColors.reverse(); + } + + var colorStopsInRange = clipColorStops(colorStops, coordDim === 'x' ? api.getWidth() : api.getHeight()); + var inRangeStopLen = colorStopsInRange.length; + + if (!inRangeStopLen && stopLen) { + // All stops are out of range. All will be the same color. + return colorStops[0].coord < 0 ? outerColors[1] ? outerColors[1] : colorStops[stopLen - 1].color : outerColors[0] ? outerColors[0] : colorStops[0].color; + } + + var tinyExtent = 10; // Arbitrary value: 10px + + var minCoord = colorStopsInRange[0].coord - tinyExtent; + var maxCoord = colorStopsInRange[inRangeStopLen - 1].coord + tinyExtent; + var coordSpan = maxCoord - minCoord; + + if (coordSpan < 1e-3) { + return 'transparent'; + } + + each(colorStopsInRange, function (stop) { + stop.offset = (stop.coord - minCoord) / coordSpan; + }); + colorStopsInRange.push({ + // NOTE: inRangeStopLen may still be 0 if stoplen is zero. + offset: inRangeStopLen ? colorStopsInRange[inRangeStopLen - 1].offset : 0.5, + color: outerColors[1] || 'transparent' + }); + colorStopsInRange.unshift({ + offset: inRangeStopLen ? colorStopsInRange[0].offset : 0.5, + color: outerColors[0] || 'transparent' + }); + var gradient = new LinearGradient(0, 0, 0, 0, colorStopsInRange, true); + gradient[coordDim] = minCoord; + gradient[coordDim + '2'] = maxCoord; + return gradient; } function getIsIgnoreFunc(seriesModel, data, coordSys) { - var showAllSymbol = seriesModel.get('showAllSymbol'); - var isAuto = showAllSymbol === 'auto'; + var showAllSymbol = seriesModel.get('showAllSymbol'); + var isAuto = showAllSymbol === 'auto'; - if (showAllSymbol && !isAuto) { - return; - } + if (showAllSymbol && !isAuto) { + return; + } - var categoryAxis = coordSys.getAxesByScale('ordinal')[0]; + var categoryAxis = coordSys.getAxesByScale('ordinal')[0]; - if (!categoryAxis) { - return; - } // Note that category label interval strategy might bring some weird effect - // in some scenario: users may wonder why some of the symbols are not - // displayed. So we show all symbols as possible as we can. + if (!categoryAxis) { + return; + } // Note that category label interval strategy might bring some weird effect + // in some scenario: users may wonder why some of the symbols are not + // displayed. So we show all symbols as possible as we can. - if (isAuto // Simplify the logic, do not determine label overlap here. - && canShowAllSymbolForCategory(categoryAxis, data)) { - return; - } // Otherwise follow the label interval strategy on category axis. + if (isAuto // Simplify the logic, do not determine label overlap here. + && canShowAllSymbolForCategory(categoryAxis, data)) { + return; + } // Otherwise follow the label interval strategy on category axis. - var categoryDataDim = data.mapDimension(categoryAxis.dim); - var labelMap = {}; - each(categoryAxis.getViewLabels(), function (labelItem) { - var ordinalNumber = categoryAxis.scale.getRawOrdinalNumber(labelItem.tickValue); - labelMap[ordinalNumber] = 1; - }); - return function (dataIndex) { - return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex)); - }; + var categoryDataDim = data.mapDimension(categoryAxis.dim); + var labelMap = {}; + each(categoryAxis.getViewLabels(), function (labelItem) { + var ordinalNumber = categoryAxis.scale.getRawOrdinalNumber(labelItem.tickValue); + labelMap[ordinalNumber] = 1; + }); + return function (dataIndex) { + return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex)); + }; } function canShowAllSymbolForCategory(categoryAxis, data) { - // In mose cases, line is monotonous on category axis, and the label size - // is close with each other. So we check the symbol size and some of the - // label size alone with the category axis to estimate whether all symbol - // can be shown without overlap. - var axisExtent = categoryAxis.getExtent(); - var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count(); - isNaN(availSize) && (availSize = 0); // 0/0 is NaN. - // Sampling some points, max 5. - - var dataLen = data.count(); - var step = Math.max(1, Math.round(dataLen / 5)); - - for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) { - if (Symbol.getSymbolSize(data, dataIndex // Only for cartesian, where `isHorizontal` exists. - )[categoryAxis.isHorizontal() ? 1 : 0] // Empirical number - * 1.5 > availSize) { - return false; - } + // In mose cases, line is monotonous on category axis, and the label size + // is close with each other. So we check the symbol size and some of the + // label size alone with the category axis to estimate whether all symbol + // can be shown without overlap. + var axisExtent = categoryAxis.getExtent(); + var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count(); + isNaN(availSize) && (availSize = 0); // 0/0 is NaN. + // Sampling some points, max 5. + + var dataLen = data.count(); + var step = Math.max(1, Math.round(dataLen / 5)); + + for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) { + if (Symbol.getSymbolSize(data, dataIndex // Only for cartesian, where `isHorizontal` exists. + )[categoryAxis.isHorizontal() ? 1 : 0] // Empirical number + * 1.5 > availSize) { + return false; } + } - return true; + return true; } function isPointNull$1(x, y) { - return isNaN(x) || isNaN(y); + return isNaN(x) || isNaN(y); } function getLastIndexNotNull(points) { - var len = points.length / 2; + var len = points.length / 2; - for (; len > 0; len--) { - if (!isPointNull$1(points[len * 2 - 2], points[len * 2 - 1])) { - break; - } + for (; len > 0; len--) { + if (!isPointNull$1(points[len * 2 - 2], points[len * 2 - 1])) { + break; } + } - return len - 1; + return len - 1; } function getPointAtIndex(points, idx) { - return [points[idx * 2], points[idx * 2 + 1]]; + return [points[idx * 2], points[idx * 2 + 1]]; } function getIndexRange(points, xOrY, dim) { - var len = points.length / 2; - var dimIdx = dim === 'x' ? 0 : 1; - var a; - var b; - var prevIndex = 0; - var nextIndex = -1; - - for (var i = 0; i < len; i++) { - b = points[i * 2 + dimIdx]; + var len = points.length / 2; + var dimIdx = dim === 'x' ? 0 : 1; + var a; + var b; + var prevIndex = 0; + var nextIndex = -1; - if (isNaN(b) || isNaN(points[i * 2 + 1 - dimIdx])) { - continue; - } + for (var i = 0; i < len; i++) { + b = points[i * 2 + dimIdx]; - if (i === 0) { - a = b; - continue; - } + if (isNaN(b) || isNaN(points[i * 2 + 1 - dimIdx])) { + continue; + } - if (a <= xOrY && b >= xOrY || a >= xOrY && b <= xOrY) { - nextIndex = i; - break; - } + if (i === 0) { + a = b; + continue; + } - prevIndex = i; - a = b; + if (a <= xOrY && b >= xOrY || a >= xOrY && b <= xOrY) { + nextIndex = i; + break; } - return { - range: [prevIndex, nextIndex], - t: (xOrY - a) / (b - a) - }; + prevIndex = i; + a = b; + } + + return { + range: [prevIndex, nextIndex], + t: (xOrY - a) / (b - a) + }; } function anyStateShowEndLabel(seriesModel) { - if (seriesModel.get(['endLabel', 'show'])) { - return true; - } + if (seriesModel.get(['endLabel', 'show'])) { + return true; + } - for (var i = 0; i < SPECIAL_STATES.length; i++) { - if (seriesModel.get([SPECIAL_STATES[i], 'endLabel', 'show'])) { - return true; - } + for (var i = 0; i < SPECIAL_STATES.length; i++) { + if (seriesModel.get([SPECIAL_STATES[i], 'endLabel', 'show'])) { + return true; } + } - return false; + return false; } function createLineClipPath(lineView, coordSys, hasAnimation, seriesModel) { - if (isCoordinateSystemType(coordSys, 'cartesian2d')) { - var endLabelModel_1 = seriesModel.getModel('endLabel'); - var valueAnimation_1 = endLabelModel_1.get('valueAnimation'); - var data_1 = seriesModel.getData(); - var labelAnimationRecord_1 = { - lastFrameIndex: 0 - }; - var during = anyStateShowEndLabel(seriesModel) ? function (percent, clipRect) { - lineView._endLabelOnDuring(percent, clipRect, data_1, labelAnimationRecord_1, valueAnimation_1, endLabelModel_1, coordSys); - } : null; - var isHorizontal = coordSys.getBaseAxis().isHorizontal(); - var clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel, function () { - var endLabel = lineView._endLabel; - - if (endLabel && hasAnimation) { - if (labelAnimationRecord_1.originalX != null) { - endLabel.attr({ - x: labelAnimationRecord_1.originalX, - y: labelAnimationRecord_1.originalY - }); - } - } - }, during); // Expand clip shape to avoid clipping when line value exceeds axis + if (isCoordinateSystemType(coordSys, 'cartesian2d')) { + var endLabelModel_1 = seriesModel.getModel('endLabel'); + var valueAnimation_1 = endLabelModel_1.get('valueAnimation'); + var data_1 = seriesModel.getData(); + var labelAnimationRecord_1 = { + lastFrameIndex: 0 + }; + var during = anyStateShowEndLabel(seriesModel) ? function (percent, clipRect) { + lineView._endLabelOnDuring(percent, clipRect, data_1, labelAnimationRecord_1, valueAnimation_1, endLabelModel_1, coordSys); + } : null; + var isHorizontal = coordSys.getBaseAxis().isHorizontal(); + var clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel, function () { + var endLabel = lineView._endLabel; - if (!seriesModel.get('clip', true)) { - var rectShape = clipPath.shape; - var expandSize = Math.max(rectShape.width, rectShape.height); + if (endLabel && hasAnimation) { + if (labelAnimationRecord_1.originalX != null) { + endLabel.attr({ + x: labelAnimationRecord_1.originalX, + y: labelAnimationRecord_1.originalY + }); + } + } + }, during); // Expand clip shape to avoid clipping when line value exceeds axis - if (isHorizontal) { - rectShape.y -= expandSize; - rectShape.height += expandSize * 2; - } else { - rectShape.x -= expandSize; - rectShape.width += expandSize * 2; - } - } // Set to the final frame. To make sure label layout is right. + if (!seriesModel.get('clip', true)) { + var rectShape = clipPath.shape; + var expandSize = Math.max(rectShape.width, rectShape.height); + if (isHorizontal) { + rectShape.y -= expandSize; + rectShape.height += expandSize * 2; + } else { + rectShape.x -= expandSize; + rectShape.width += expandSize * 2; + } + } // Set to the final frame. To make sure label layout is right. - if (during) { - during(1, clipPath); - } - return clipPath; - } else { - if ("development" !== 'production') { - if (seriesModel.get(['endLabel', 'show'])) { - console.warn('endLabel is not supported for lines in polar systems.'); - } - } + if (during) { + during(1, clipPath); + } - return createPolarClipPath(coordSys, hasAnimation, seriesModel); + return clipPath; + } else { + if ("development" !== 'production') { + if (seriesModel.get(['endLabel', 'show'])) { + console.warn('endLabel is not supported for lines in polar systems.'); + } } + + return createPolarClipPath(coordSys, hasAnimation, seriesModel); + } } function getEndLabelStateSpecified(endLabelModel, coordSys) { - var baseAxis = coordSys.getBaseAxis(); - var isHorizontal = baseAxis.isHorizontal(); - var isBaseInversed = baseAxis.inverse; - var align = isHorizontal ? isBaseInversed ? 'right' : 'left' : 'center'; - var verticalAlign = isHorizontal ? 'middle' : isBaseInversed ? 'top' : 'bottom'; - return { - normal: { - align: endLabelModel.get('align') || align, - verticalAlign: endLabelModel.get('verticalAlign') || verticalAlign - } - }; + var baseAxis = coordSys.getBaseAxis(); + var isHorizontal = baseAxis.isHorizontal(); + var isBaseInversed = baseAxis.inverse; + var align = isHorizontal ? isBaseInversed ? 'right' : 'left' : 'center'; + var verticalAlign = isHorizontal ? 'middle' : isBaseInversed ? 'top' : 'bottom'; + return { + normal: { + align: endLabelModel.get('align') || align, + verticalAlign: endLabelModel.get('verticalAlign') || verticalAlign + } + }; } var LineView = - /** @class */ - function (_super) { - __extends(LineView, _super); + /** @class */ + function (_super) { + __extends(LineView, _super); - function LineView() { - return _super !== null && _super.apply(this, arguments) || this; - } + function LineView() { + return _super !== null && _super.apply(this, arguments) || this; + } - LineView.prototype.init = function () { - var lineGroup = new Group(); - var symbolDraw = new SymbolDraw(); - this.group.add(symbolDraw.group); - this._symbolDraw = symbolDraw; - this._lineGroup = lineGroup; - }; + LineView.prototype.init = function () { + var lineGroup = new Group(); + var symbolDraw = new SymbolDraw(); + this.group.add(symbolDraw.group); + this._symbolDraw = symbolDraw; + this._lineGroup = lineGroup; + }; - LineView.prototype.render = function (seriesModel, ecModel, api) { - var _this = this; - - var coordSys = seriesModel.coordinateSystem; - var group = this.group; - var data = seriesModel.getData(); - var lineStyleModel = seriesModel.getModel('lineStyle'); - var areaStyleModel = seriesModel.getModel('areaStyle'); - var points = data.getLayout('points') || []; - var isCoordSysPolar = coordSys.type === 'polar'; - var prevCoordSys = this._coordSys; - var symbolDraw = this._symbolDraw; - var polyline = this._polyline; - var polygon = this._polygon; - var lineGroup = this._lineGroup; - var hasAnimation = seriesModel.get('animation'); - var isAreaChart = !areaStyleModel.isEmpty(); - var valueOrigin = areaStyleModel.get('origin'); - var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin); - var stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo); - var showSymbol = seriesModel.get('showSymbol'); - var connectNulls = seriesModel.get('connectNulls'); - var isIgnoreFunc = showSymbol && !isCoordSysPolar && getIsIgnoreFunc(seriesModel, data, coordSys); // Remove temporary symbols - - var oldData = this._data; - oldData && oldData.eachItemGraphicEl(function (el, idx) { - if (el.__temp) { - group.remove(el); - oldData.setItemGraphicEl(idx, null); - } - }); // Remove previous created symbols if showSymbol changed to false + LineView.prototype.render = function (seriesModel, ecModel, api) { + var _this = this; - if (!showSymbol) { - symbolDraw.remove(); - } + var coordSys = seriesModel.coordinateSystem; + var group = this.group; + var data = seriesModel.getData(); + var lineStyleModel = seriesModel.getModel('lineStyle'); + var areaStyleModel = seriesModel.getModel('areaStyle'); + var points = data.getLayout('points') || []; + var isCoordSysPolar = coordSys.type === 'polar'; + var prevCoordSys = this._coordSys; + var symbolDraw = this._symbolDraw; + var polyline = this._polyline; + var polygon = this._polygon; + var lineGroup = this._lineGroup; + var hasAnimation = seriesModel.get('animation'); + var isAreaChart = !areaStyleModel.isEmpty(); + var valueOrigin = areaStyleModel.get('origin'); + var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin); + var stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo); + var showSymbol = seriesModel.get('showSymbol'); + var connectNulls = seriesModel.get('connectNulls'); + var isIgnoreFunc = showSymbol && !isCoordSysPolar && getIsIgnoreFunc(seriesModel, data, coordSys); // Remove temporary symbols + + var oldData = this._data; + oldData && oldData.eachItemGraphicEl(function (el, idx) { + if (el.__temp) { + group.remove(el); + oldData.setItemGraphicEl(idx, null); + } + }); // Remove previous created symbols if showSymbol changed to false + + if (!showSymbol) { + symbolDraw.remove(); + } + + group.add(lineGroup); // FIXME step not support polar + + var step = !isCoordSysPolar ? seriesModel.get('step') : false; + var clipShapeForSymbol; + + if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) { + clipShapeForSymbol = coordSys.getArea(); // Avoid float number rounding error for symbol on the edge of axis extent. + // See #7913 and `test/dataZoom-clip.html`. + + if (clipShapeForSymbol.width != null) { + clipShapeForSymbol.x -= 0.1; + clipShapeForSymbol.y -= 0.1; + clipShapeForSymbol.width += 0.2; + clipShapeForSymbol.height += 0.2; + } else if (clipShapeForSymbol.r0) { + clipShapeForSymbol.r0 -= 0.5; + clipShapeForSymbol.r += 0.5; + } + } + + this._clipShapeForSymbol = clipShapeForSymbol; + var visualColor = getVisualGradient(data, coordSys, api) || data.getVisual('style')[data.getVisual('drawType')]; // Initialization animation or coordinate system changed + + if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) { + showSymbol && symbolDraw.updateData(data, { + isIgnore: isIgnoreFunc, + clipShape: clipShapeForSymbol, + disableAnimation: true, + getSymbolPoint: function (idx) { + return [points[idx * 2], points[idx * 2 + 1]]; + } + }); + hasAnimation && this._initSymbolLabelAnimation(data, coordSys, clipShapeForSymbol); + + if (step) { + // TODO If stacked series is not step + points = turnPointsIntoStep(points, coordSys, step, connectNulls); + + if (stackedOnPoints) { + stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls); + } + } + + polyline = this._newPolyline(points); + + if (isAreaChart) { + polygon = this._newPolygon(points, stackedOnPoints); + } // NOTE: Must update _endLabel before setClipPath. + + + if (!isCoordSysPolar) { + this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor)); + } + + lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel)); + } else { + if (isAreaChart && !polygon) { + // If areaStyle is added + polygon = this._newPolygon(points, stackedOnPoints); + } else if (polygon && !isAreaChart) { + // If areaStyle is removed + lineGroup.remove(polygon); + polygon = this._polygon = null; + } // NOTE: Must update _endLabel before setClipPath. - group.add(lineGroup); // FIXME step not support polar - var step = !isCoordSysPolar ? seriesModel.get('step') : false; - var clipShapeForSymbol; + if (!isCoordSysPolar) { + this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor)); + } // Update clipPath - if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) { - clipShapeForSymbol = coordSys.getArea(); // Avoid float number rounding error for symbol on the edge of axis extent. - // See #7913 and `test/dataZoom-clip.html`. - if (clipShapeForSymbol.width != null) { - clipShapeForSymbol.x -= 0.1; - clipShapeForSymbol.y -= 0.1; - clipShapeForSymbol.width += 0.2; - clipShapeForSymbol.height += 0.2; - } else if (clipShapeForSymbol.r0) { - clipShapeForSymbol.r0 -= 0.5; - clipShapeForSymbol.r += 0.5; - } - } + var oldClipPath = lineGroup.getClipPath(); - this._clipShapeForSymbol = clipShapeForSymbol; - var visualColor = getVisualGradient(data, coordSys, api) || data.getVisual('style')[data.getVisual('drawType')]; // Initialization animation or coordinate system changed + if (oldClipPath) { + var newClipPath = createLineClipPath(this, coordSys, false, seriesModel); + initProps(oldClipPath, { + shape: newClipPath.shape + }, seriesModel); + } else { + lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel)); + } // Always update, or it is wrong in the case turning on legend + // because points are not changed - if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) { - showSymbol && symbolDraw.updateData(data, { - isIgnore: isIgnoreFunc, - clipShape: clipShapeForSymbol, - disableAnimation: true, - getSymbolPoint: function (idx) { - return [points[idx * 2], points[idx * 2 + 1]]; - } - }); - hasAnimation && this._initSymbolLabelAnimation(data, coordSys, clipShapeForSymbol); - if (step) { - // TODO If stacked series is not step - points = turnPointsIntoStep(points, coordSys, step, connectNulls); + showSymbol && symbolDraw.updateData(data, { + isIgnore: isIgnoreFunc, + clipShape: clipShapeForSymbol, + disableAnimation: true, + getSymbolPoint: function (idx) { + return [points[idx * 2], points[idx * 2 + 1]]; + } + }); // In the case data zoom triggerred refreshing frequently + // Data may not change if line has a category axis. So it should animate nothing - if (stackedOnPoints) { - stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls); - } - } + if (!isPointsSame(this._stackedOnPoints, stackedOnPoints) || !isPointsSame(this._points, points)) { + if (hasAnimation) { + this._doUpdateAnimation(data, stackedOnPoints, coordSys, api, step, valueOrigin, connectNulls); + } else { + // Not do it in update with animation + if (step) { + // TODO If stacked series is not step + points = turnPointsIntoStep(points, coordSys, step, connectNulls); - polyline = this._newPolyline(points); + if (stackedOnPoints) { + stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls); + } + } - if (isAreaChart) { - polygon = this._newPolygon(points, stackedOnPoints); - } // NOTE: Must update _endLabel before setClipPath. + polyline.setShape({ + points: points + }); + polygon && polygon.setShape({ + points: points, + stackedOnPoints: stackedOnPoints + }); + } + } + } + var emphasisModel = seriesModel.getModel('emphasis'); + var focus = emphasisModel.get('focus'); + var blurScope = emphasisModel.get('blurScope'); + var emphasisDisabled = emphasisModel.get('disabled'); + polyline.useStyle(defaults( // Use color in lineStyle first + lineStyleModel.getLineStyle(), { + fill: 'none', + stroke: visualColor, + lineJoin: 'bevel' + })); + setStatesStylesFromModel(polyline, seriesModel, 'lineStyle'); + + if (polyline.style.lineWidth > 0 && seriesModel.get(['emphasis', 'lineStyle', 'width']) === 'bolder') { + var emphasisLineStyle = polyline.getState('emphasis').style; + emphasisLineStyle.lineWidth = +polyline.style.lineWidth + 1; + } // Needs seriesIndex for focus + + + getECData(polyline).seriesIndex = seriesModel.seriesIndex; + toggleHoverEmphasis(polyline, focus, blurScope, emphasisDisabled); + var smooth = getSmooth(seriesModel.get('smooth')); + var smoothMonotone = seriesModel.get('smoothMonotone'); + polyline.setShape({ + smooth: smooth, + smoothMonotone: smoothMonotone, + connectNulls: connectNulls + }); - if (!isCoordSysPolar) { - this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor)); - } + if (polygon) { + var stackedOnSeries = data.getCalculationInfo('stackedOnSeries'); + var stackedOnSmooth = 0; + polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), { + fill: visualColor, + opacity: 0.7, + lineJoin: 'bevel', + decal: data.getVisual('style').decal + })); - lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel)); - } else { - if (isAreaChart && !polygon) { - // If areaStyle is added - polygon = this._newPolygon(points, stackedOnPoints); - } else if (polygon && !isAreaChart) { - // If areaStyle is removed - lineGroup.remove(polygon); - polygon = this._polygon = null; - } // NOTE: Must update _endLabel before setClipPath. + if (stackedOnSeries) { + stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth')); + } + polygon.setShape({ + smooth: smooth, + stackedOnSmooth: stackedOnSmooth, + smoothMonotone: smoothMonotone, + connectNulls: connectNulls + }); + setStatesStylesFromModel(polygon, seriesModel, 'areaStyle'); // Needs seriesIndex for focus - if (!isCoordSysPolar) { - this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor)); - } // Update clipPath + getECData(polygon).seriesIndex = seriesModel.seriesIndex; + toggleHoverEmphasis(polygon, focus, blurScope, emphasisDisabled); + } + var changePolyState = function (toState) { + _this._changePolyState(toState); + }; - var oldClipPath = lineGroup.getClipPath(); + data.eachItemGraphicEl(function (el) { + // Switch polyline / polygon state if element changed its state. + el && (el.onHoverStateChange = changePolyState); + }); + this._polyline.onHoverStateChange = changePolyState; + this._data = data; // Save the coordinate system for transition animation when data changed - if (oldClipPath) { - var newClipPath = createLineClipPath(this, coordSys, false, seriesModel); - initProps(oldClipPath, { - shape: newClipPath.shape - }, seriesModel); - } else { - lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel)); - } // Always update, or it is wrong in the case turning on legend - // because points are not changed + this._coordSys = coordSys; + this._stackedOnPoints = stackedOnPoints; + this._points = points; + this._step = step; + this._valueOrigin = valueOrigin; + if (seriesModel.get('triggerLineEvent')) { + this.packEventData(seriesModel, polyline); + polygon && this.packEventData(seriesModel, polygon); + } + }; - showSymbol && symbolDraw.updateData(data, { - isIgnore: isIgnoreFunc, - clipShape: clipShapeForSymbol, - disableAnimation: true, - getSymbolPoint: function (idx) { - return [points[idx * 2], points[idx * 2 + 1]]; - } - }); // In the case data zoom triggerred refreshing frequently - // Data may not change if line has a category axis. So it should animate nothing - - if (!isPointsSame(this._stackedOnPoints, stackedOnPoints) || !isPointsSame(this._points, points)) { - if (hasAnimation) { - this._doUpdateAnimation(data, stackedOnPoints, coordSys, api, step, valueOrigin, connectNulls); - } else { - // Not do it in update with animation - if (step) { - // TODO If stacked series is not step - points = turnPointsIntoStep(points, coordSys, step, connectNulls); - - if (stackedOnPoints) { - stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls); - } - } + LineView.prototype.packEventData = function (seriesModel, el) { + getECData(el).eventData = { + componentType: 'series', + componentSubType: 'line', + componentIndex: seriesModel.componentIndex, + seriesIndex: seriesModel.seriesIndex, + seriesName: seriesModel.name, + seriesType: 'line' + }; + }; - polyline.setShape({ - points: points - }); - polygon && polygon.setShape({ - points: points, - stackedOnPoints: stackedOnPoints - }); - } - } - } + LineView.prototype.highlight = function (seriesModel, ecModel, api, payload) { + var data = seriesModel.getData(); + var dataIndex = queryDataIndex(data, payload); - var emphasisModel = seriesModel.getModel('emphasis'); - var focus = emphasisModel.get('focus'); - var blurScope = emphasisModel.get('blurScope'); - var emphasisDisabled = emphasisModel.get('disabled'); - polyline.useStyle(defaults( // Use color in lineStyle first - lineStyleModel.getLineStyle(), { - fill: 'none', - stroke: visualColor, - lineJoin: 'bevel' - })); - setStatesStylesFromModel(polyline, seriesModel, 'lineStyle'); - - if (polyline.style.lineWidth > 0 && seriesModel.get(['emphasis', 'lineStyle', 'width']) === 'bolder') { - var emphasisLineStyle = polyline.getState('emphasis').style; - emphasisLineStyle.lineWidth = +polyline.style.lineWidth + 1; - } // Needs seriesIndex for focus - - - getECData(polyline).seriesIndex = seriesModel.seriesIndex; - toggleHoverEmphasis(polyline, focus, blurScope, emphasisDisabled); - var smooth = getSmooth(seriesModel.get('smooth')); - var smoothMonotone = seriesModel.get('smoothMonotone'); - polyline.setShape({ - smooth: smooth, - smoothMonotone: smoothMonotone, - connectNulls: connectNulls - }); + this._changePolyState('emphasis'); - if (polygon) { - var stackedOnSeries = data.getCalculationInfo('stackedOnSeries'); - var stackedOnSmooth = 0; - polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), { - fill: visualColor, - opacity: 0.7, - lineJoin: 'bevel', - decal: data.getVisual('style').decal - })); - - if (stackedOnSeries) { - stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth')); - } + if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) { + var points = data.getLayout('points'); + var symbol = data.getItemGraphicEl(dataIndex); - polygon.setShape({ - smooth: smooth, - stackedOnSmooth: stackedOnSmooth, - smoothMonotone: smoothMonotone, - connectNulls: connectNulls - }); - setStatesStylesFromModel(polygon, seriesModel, 'areaStyle'); // Needs seriesIndex for focus + if (!symbol) { + // Create a temporary symbol if it is not exists + var x = points[dataIndex * 2]; + var y = points[dataIndex * 2 + 1]; - getECData(polygon).seriesIndex = seriesModel.seriesIndex; - toggleHoverEmphasis(polygon, focus, blurScope, emphasisDisabled); - } + if (isNaN(x) || isNaN(y)) { + // Null data + return; + } // fix #11360: should't draw symbol outside clipShapeForSymbol - var changePolyState = function (toState) { - _this._changePolyState(toState); - }; - data.eachItemGraphicEl(function (el) { - // Switch polyline / polygon state if element changed its state. - el && (el.onHoverStateChange = changePolyState); - }); - this._polyline.onHoverStateChange = changePolyState; - this._data = data; // Save the coordinate system for transition animation when data changed + if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) { + return; + } - this._coordSys = coordSys; - this._stackedOnPoints = stackedOnPoints; - this._points = points; - this._step = step; - this._valueOrigin = valueOrigin; + var zlevel = seriesModel.get('zlevel'); + var z = seriesModel.get('z'); + symbol = new Symbol(data, dataIndex); + symbol.x = x; + symbol.y = y; + symbol.setZ(zlevel, z); // ensure label text of the temporary symbol is in front of line and area polygon - if (seriesModel.get('triggerLineEvent')) { - this.packEventData(seriesModel, polyline); - polygon && this.packEventData(seriesModel, polygon); - } - }; + var symbolLabel = symbol.getSymbolPath().getTextContent(); - LineView.prototype.packEventData = function (seriesModel, el) { - getECData(el).eventData = { - componentType: 'series', - componentSubType: 'line', - componentIndex: seriesModel.componentIndex, - seriesIndex: seriesModel.seriesIndex, - seriesName: seriesModel.name, - seriesType: 'line' - }; - }; + if (symbolLabel) { + symbolLabel.zlevel = zlevel; + symbolLabel.z = z; + symbolLabel.z2 = this._polyline.z2 + 1; + } - LineView.prototype.highlight = function (seriesModel, ecModel, api, payload) { - var data = seriesModel.getData(); - var dataIndex = queryDataIndex(data, payload); + symbol.__temp = true; + data.setItemGraphicEl(dataIndex, symbol); // Stop scale animation - this._changePolyState('emphasis'); + symbol.stopSymbolAnimation(true); + this.group.add(symbol); + } - if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) { - var points = data.getLayout('points'); - var symbol = data.getItemGraphicEl(dataIndex); + symbol.highlight(); + } else { + // Highlight whole series + ChartView.prototype.highlight.call(this, seriesModel, ecModel, api, payload); + } + }; - if (!symbol) { - // Create a temporary symbol if it is not exists - var x = points[dataIndex * 2]; - var y = points[dataIndex * 2 + 1]; + LineView.prototype.downplay = function (seriesModel, ecModel, api, payload) { + var data = seriesModel.getData(); + var dataIndex = queryDataIndex(data, payload); - if (isNaN(x) || isNaN(y)) { - // Null data - return; - } // fix #11360: should't draw symbol outside clipShapeForSymbol + this._changePolyState('normal'); + if (dataIndex != null && dataIndex >= 0) { + var symbol = data.getItemGraphicEl(dataIndex); - if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) { - return; - } + if (symbol) { + if (symbol.__temp) { + data.setItemGraphicEl(dataIndex, null); + this.group.remove(symbol); + } else { + symbol.downplay(); + } + } + } else { + // FIXME + // can not downplay completely. + // Downplay whole series + ChartView.prototype.downplay.call(this, seriesModel, ecModel, api, payload); + } + }; - var zlevel = seriesModel.get('zlevel'); - var z = seriesModel.get('z'); - symbol = new Symbol(data, dataIndex); - symbol.x = x; - symbol.y = y; - symbol.setZ(zlevel, z); // ensure label text of the temporary symbol is in front of line and area polygon + LineView.prototype._changePolyState = function (toState) { + var polygon = this._polygon; + setStatesFlag(this._polyline, toState); + polygon && setStatesFlag(polygon, toState); + }; - var symbolLabel = symbol.getSymbolPath().getTextContent(); + LineView.prototype._newPolyline = function (points) { + var polyline = this._polyline; // Remove previous created polyline - if (symbolLabel) { - symbolLabel.zlevel = zlevel; - symbolLabel.z = z; - symbolLabel.z2 = this._polyline.z2 + 1; - } + if (polyline) { + this._lineGroup.remove(polyline); + } - symbol.__temp = true; - data.setItemGraphicEl(dataIndex, symbol); // Stop scale animation + polyline = new ECPolyline({ + shape: { + points: points + }, + segmentIgnoreThreshold: 2, + z2: 10 + }); - symbol.stopSymbolAnimation(true); - this.group.add(symbol); - } + this._lineGroup.add(polyline); - symbol.highlight(); - } else { - // Highlight whole series - ChartView.prototype.highlight.call(this, seriesModel, ecModel, api, payload); - } - }; + this._polyline = polyline; + return polyline; + }; - LineView.prototype.downplay = function (seriesModel, ecModel, api, payload) { - var data = seriesModel.getData(); - var dataIndex = queryDataIndex(data, payload); + LineView.prototype._newPolygon = function (points, stackedOnPoints) { + var polygon = this._polygon; // Remove previous created polygon - this._changePolyState('normal'); + if (polygon) { + this._lineGroup.remove(polygon); + } - if (dataIndex != null && dataIndex >= 0) { - var symbol = data.getItemGraphicEl(dataIndex); + polygon = new ECPolygon({ + shape: { + points: points, + stackedOnPoints: stackedOnPoints + }, + segmentIgnoreThreshold: 2 + }); - if (symbol) { - if (symbol.__temp) { - data.setItemGraphicEl(dataIndex, null); - this.group.remove(symbol); - } else { - symbol.downplay(); - } - } - } else { - // FIXME - // can not downplay completely. - // Downplay whole series - ChartView.prototype.downplay.call(this, seriesModel, ecModel, api, payload); - } - }; + this._lineGroup.add(polygon); - LineView.prototype._changePolyState = function (toState) { - var polygon = this._polygon; - setStatesFlag(this._polyline, toState); - polygon && setStatesFlag(polygon, toState); - }; + this._polygon = polygon; + return polygon; + }; - LineView.prototype._newPolyline = function (points) { - var polyline = this._polyline; // Remove previous created polyline + LineView.prototype._initSymbolLabelAnimation = function (data, coordSys, clipShape) { + var isHorizontalOrRadial; + var isCoordSysPolar; + var baseAxis = coordSys.getBaseAxis(); + var isAxisInverse = baseAxis.inverse; - if (polyline) { - this._lineGroup.remove(polyline); - } + if (coordSys.type === 'cartesian2d') { + isHorizontalOrRadial = baseAxis.isHorizontal(); + isCoordSysPolar = false; + } else if (coordSys.type === 'polar') { + isHorizontalOrRadial = baseAxis.dim === 'angle'; + isCoordSysPolar = true; + } - polyline = new ECPolyline({ - shape: { - points: points - }, - segmentIgnoreThreshold: 2, - z2: 10 - }); + var seriesModel = data.hostModel; + var seriesDuration = seriesModel.get('animationDuration'); + + if (isFunction(seriesDuration)) { + seriesDuration = seriesDuration(null); + } - this._lineGroup.add(polyline); + var seriesDalay = seriesModel.get('animationDelay') || 0; + var seriesDalayValue = isFunction(seriesDalay) ? seriesDalay(null) : seriesDalay; + data.eachItemGraphicEl(function (symbol, idx) { + var el = symbol; - this._polyline = polyline; - return polyline; - }; + if (el) { + var point = [symbol.x, symbol.y]; + var start = void 0; + var end = void 0; + var current = void 0; - LineView.prototype._newPolygon = function (points, stackedOnPoints) { - var polygon = this._polygon; // Remove previous created polygon + if (clipShape) { + if (isCoordSysPolar) { + var polarClip = clipShape; + var coord = coordSys.pointToCoord(point); - if (polygon) { - this._lineGroup.remove(polygon); + if (isHorizontalOrRadial) { + start = polarClip.startAngle; + end = polarClip.endAngle; + current = -coord[1] / 180 * Math.PI; + } else { + start = polarClip.r0; + end = polarClip.r; + current = coord[0]; } + } else { + var gridClip = clipShape; - polygon = new ECPolygon({ - shape: { - points: points, - stackedOnPoints: stackedOnPoints - }, - segmentIgnoreThreshold: 2 - }); + if (isHorizontalOrRadial) { + start = gridClip.x; + end = gridClip.x + gridClip.width; + current = symbol.x; + } else { + start = gridClip.y + gridClip.height; + end = gridClip.y; + current = symbol.y; + } + } + } - this._lineGroup.add(polygon); + var ratio = end === start ? 0 : (current - start) / (end - start); - this._polygon = polygon; - return polygon; - }; + if (isAxisInverse) { + ratio = 1 - ratio; + } - LineView.prototype._initSymbolLabelAnimation = function (data, coordSys, clipShape) { - var isHorizontalOrRadial; - var isCoordSysPolar; - var baseAxis = coordSys.getBaseAxis(); - var isAxisInverse = baseAxis.inverse; - - if (coordSys.type === 'cartesian2d') { - isHorizontalOrRadial = baseAxis.isHorizontal(); - isCoordSysPolar = false; - } else if (coordSys.type === 'polar') { - isHorizontalOrRadial = baseAxis.dim === 'angle'; - isCoordSysPolar = true; - } - - var seriesModel = data.hostModel; - var seriesDuration = seriesModel.get('animationDuration'); - - if (isFunction(seriesDuration)) { - seriesDuration = seriesDuration(null); - } - - var seriesDalay = seriesModel.get('animationDelay') || 0; - var seriesDalayValue = isFunction(seriesDalay) ? seriesDalay(null) : seriesDalay; - data.eachItemGraphicEl(function (symbol, idx) { - var el = symbol; - - if (el) { - var point = [symbol.x, symbol.y]; - var start = void 0; - var end = void 0; - var current = void 0; - - if (clipShape) { - if (isCoordSysPolar) { - var polarClip = clipShape; - var coord = coordSys.pointToCoord(point); - - if (isHorizontalOrRadial) { - start = polarClip.startAngle; - end = polarClip.endAngle; - current = -coord[1] / 180 * Math.PI; - } else { - start = polarClip.r0; - end = polarClip.r; - current = coord[0]; - } - } else { - var gridClip = clipShape; - - if (isHorizontalOrRadial) { - start = gridClip.x; - end = gridClip.x + gridClip.width; - current = symbol.x; - } else { - start = gridClip.y + gridClip.height; - end = gridClip.y; - current = symbol.y; - } - } - } + var delay = isFunction(seriesDalay) ? seriesDalay(idx) : seriesDuration * ratio + seriesDalayValue; + var symbolPath = el.getSymbolPath(); + var text = symbolPath.getTextContent(); + el.attr({ + scaleX: 0, + scaleY: 0 + }); + el.animateTo({ + scaleX: 1, + scaleY: 1 + }, { + duration: 200, + setToFinal: true, + delay: delay + }); - var ratio = end === start ? 0 : (current - start) / (end - start); + if (text) { + text.animateFrom({ + style: { + opacity: 0 + } + }, { + duration: 300, + delay: delay + }); + } - if (isAxisInverse) { - ratio = 1 - ratio; - } + symbolPath.disableLabelAnimation = true; + } + }); + }; - var delay = isFunction(seriesDalay) ? seriesDalay(idx) : seriesDuration * ratio + seriesDalayValue; - var symbolPath = el.getSymbolPath(); - var text = symbolPath.getTextContent(); - el.attr({ - scaleX: 0, - scaleY: 0 - }); - el.animateTo({ - scaleX: 1, - scaleY: 1 - }, { - duration: 200, - setToFinal: true, - delay: delay - }); + LineView.prototype._initOrUpdateEndLabel = function (seriesModel, coordSys, inheritColor) { + var endLabelModel = seriesModel.getModel('endLabel'); - if (text) { - text.animateFrom({ - style: { - opacity: 0 - } - }, { - duration: 300, - delay: delay - }); - } + if (anyStateShowEndLabel(seriesModel)) { + var data_2 = seriesModel.getData(); + var polyline = this._polyline; // series may be filtered. - symbolPath.disableLabelAnimation = true; - } - }); - }; + var points = data_2.getLayout('points'); - LineView.prototype._initOrUpdateEndLabel = function (seriesModel, coordSys, inheritColor) { - var endLabelModel = seriesModel.getModel('endLabel'); + if (!points) { + polyline.removeTextContent(); + this._endLabel = null; + return; + } - if (anyStateShowEndLabel(seriesModel)) { - var data_2 = seriesModel.getData(); - var polyline = this._polyline; // series may be filtered. + var endLabel = this._endLabel; - var points = data_2.getLayout('points'); + if (!endLabel) { + endLabel = this._endLabel = new ZRText({ + z2: 200 // should be higher than item symbol - if (!points) { - polyline.removeTextContent(); - this._endLabel = null; - return; - } + }); + endLabel.ignoreClip = true; + polyline.setTextContent(this._endLabel); + polyline.disableLabelAnimation = true; + } // Find last non-NaN data to display data + + + var dataIndex = getLastIndexNotNull(points); + + if (dataIndex >= 0) { + setLabelStyle(polyline, getLabelStatesModels(seriesModel, 'endLabel'), { + inheritColor: inheritColor, + labelFetcher: seriesModel, + labelDataIndex: dataIndex, + defaultText: function (dataIndex, opt, interpolatedValue) { + return interpolatedValue != null ? getDefaultInterpolatedLabel(data_2, interpolatedValue) : getDefaultLabel(data_2, dataIndex); + }, + enableTextSetter: true + }, getEndLabelStateSpecified(endLabelModel, coordSys)); + polyline.textConfig.position = null; + } + } else if (this._endLabel) { + this._polyline.removeTextContent(); + + this._endLabel = null; + } + }; + + LineView.prototype._endLabelOnDuring = function (percent, clipRect, data, animationRecord, valueAnimation, endLabelModel, coordSys) { + var endLabel = this._endLabel; + var polyline = this._polyline; + + if (endLabel) { + // NOTE: Don't remove percent < 1. percent === 1 means the first frame during render. + // The label is not prepared at this time. + if (percent < 1 && animationRecord.originalX == null) { + animationRecord.originalX = endLabel.x; + animationRecord.originalY = endLabel.y; + } + + var points = data.getLayout('points'); + var seriesModel = data.hostModel; + var connectNulls = seriesModel.get('connectNulls'); + var precision = endLabelModel.get('precision'); + var distance = endLabelModel.get('distance') || 0; + var baseAxis = coordSys.getBaseAxis(); + var isHorizontal = baseAxis.isHorizontal(); + var isBaseInversed = baseAxis.inverse; + var clipShape = clipRect.shape; + var xOrY = isBaseInversed ? isHorizontal ? clipShape.x : clipShape.y + clipShape.height : isHorizontal ? clipShape.x + clipShape.width : clipShape.y; + var distanceX = (isHorizontal ? distance : 0) * (isBaseInversed ? -1 : 1); + var distanceY = (isHorizontal ? 0 : -distance) * (isBaseInversed ? -1 : 1); + var dim = isHorizontal ? 'x' : 'y'; + var dataIndexRange = getIndexRange(points, xOrY, dim); + var indices = dataIndexRange.range; + var diff = indices[1] - indices[0]; + var value = void 0; + + if (diff >= 1) { + // diff > 1 && connectNulls, which is on the null data. + if (diff > 1 && !connectNulls) { + var pt = getPointAtIndex(points, indices[0]); + endLabel.attr({ + x: pt[0] + distanceX, + y: pt[1] + distanceY + }); + valueAnimation && (value = seriesModel.getRawValue(indices[0])); + } else { + var pt = polyline.getPointOn(xOrY, dim); + pt && endLabel.attr({ + x: pt[0] + distanceX, + y: pt[1] + distanceY + }); + var startValue = seriesModel.getRawValue(indices[0]); + var endValue = seriesModel.getRawValue(indices[1]); + valueAnimation && (value = interpolateRawValues(data, precision, startValue, endValue, dataIndexRange.t)); + } + + animationRecord.lastFrameIndex = indices[0]; + } else { + // If diff <= 0, which is the range is not found(Include NaN) + // Choose the first point or last point. + var idx = percent === 1 || animationRecord.lastFrameIndex > 0 ? indices[0] : 0; + var pt = getPointAtIndex(points, idx); + valueAnimation && (value = seriesModel.getRawValue(idx)); + endLabel.attr({ + x: pt[0] + distanceX, + y: pt[1] + distanceY + }); + } - var endLabel = this._endLabel; + if (valueAnimation) { + labelInner(endLabel).setLabelText(value); + } + } + }; + /** + * @private + */ + // FIXME Two value axis - if (!endLabel) { - endLabel = this._endLabel = new ZRText({ - z2: 200 // should be higher than item symbol - }); - endLabel.ignoreClip = true; - polyline.setTextContent(this._endLabel); - polyline.disableLabelAnimation = true; - } // Find last non-NaN data to display data - - - var dataIndex = getLastIndexNotNull(points); - - if (dataIndex >= 0) { - setLabelStyle(polyline, getLabelStatesModels(seriesModel, 'endLabel'), { - inheritColor: inheritColor, - labelFetcher: seriesModel, - labelDataIndex: dataIndex, - defaultText: function (dataIndex, opt, interpolatedValue) { - return interpolatedValue != null ? getDefaultInterpolatedLabel(data_2, interpolatedValue) : getDefaultLabel(data_2, dataIndex); - }, - enableTextSetter: true - }, getEndLabelStateSpecified(endLabelModel, coordSys)); - polyline.textConfig.position = null; - } - } else if (this._endLabel) { - this._polyline.removeTextContent(); + LineView.prototype._doUpdateAnimation = function (data, stackedOnPoints, coordSys, api, step, valueOrigin, connectNulls) { + var polyline = this._polyline; + var polygon = this._polygon; + var seriesModel = data.hostModel; + var diff = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin); + var current = diff.current; + var stackedOnCurrent = diff.stackedOnCurrent; + var next = diff.next; + var stackedOnNext = diff.stackedOnNext; + + if (step) { + // TODO If stacked series is not step + current = turnPointsIntoStep(diff.current, coordSys, step, connectNulls); + stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step, connectNulls); + next = turnPointsIntoStep(diff.next, coordSys, step, connectNulls); + stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step, connectNulls); + } // Don't apply animation if diff is large. + // For better result and avoid memory explosion problems like + // https://github.com/apache/incubator-echarts/issues/12229 + + + if (getBoundingDiff(current, next) > 3000 || polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000) { + polyline.stopAnimation(); + polyline.setShape({ + points: next + }); + + if (polygon) { + polygon.stopAnimation(); + polygon.setShape({ + points: next, + stackedOnPoints: stackedOnNext + }); + } - this._endLabel = null; - } - }; + return; + } - LineView.prototype._endLabelOnDuring = function (percent, clipRect, data, animationRecord, valueAnimation, endLabelModel, coordSys) { - var endLabel = this._endLabel; - var polyline = this._polyline; + polyline.shape.__points = diff.current; + polyline.shape.points = current; + var target = { + shape: { + points: next + } + }; // Also animate the original points. + // If points reference is changed when turning into step line. - if (endLabel) { - // NOTE: Don't remove percent < 1. percent === 1 means the first frame during render. - // The label is not prepared at this time. - if (percent < 1 && animationRecord.originalX == null) { - animationRecord.originalX = endLabel.x; - animationRecord.originalY = endLabel.y; - } + if (diff.current !== current) { + target.shape.__points = diff.next; + } // Stop previous animation. - var points = data.getLayout('points'); - var seriesModel = data.hostModel; - var connectNulls = seriesModel.get('connectNulls'); - var precision = endLabelModel.get('precision'); - var distance = endLabelModel.get('distance') || 0; - var baseAxis = coordSys.getBaseAxis(); - var isHorizontal = baseAxis.isHorizontal(); - var isBaseInversed = baseAxis.inverse; - var clipShape = clipRect.shape; - var xOrY = isBaseInversed ? isHorizontal ? clipShape.x : clipShape.y + clipShape.height : isHorizontal ? clipShape.x + clipShape.width : clipShape.y; - var distanceX = (isHorizontal ? distance : 0) * (isBaseInversed ? -1 : 1); - var distanceY = (isHorizontal ? 0 : -distance) * (isBaseInversed ? -1 : 1); - var dim = isHorizontal ? 'x' : 'y'; - var dataIndexRange = getIndexRange(points, xOrY, dim); - var indices = dataIndexRange.range; - var diff = indices[1] - indices[0]; - var value = void 0; - - if (diff >= 1) { - // diff > 1 && connectNulls, which is on the null data. - if (diff > 1 && !connectNulls) { - var pt = getPointAtIndex(points, indices[0]); - endLabel.attr({ - x: pt[0] + distanceX, - y: pt[1] + distanceY - }); - valueAnimation && (value = seriesModel.getRawValue(indices[0])); - } else { - var pt = polyline.getPointOn(xOrY, dim); - pt && endLabel.attr({ - x: pt[0] + distanceX, - y: pt[1] + distanceY - }); - var startValue = seriesModel.getRawValue(indices[0]); - var endValue = seriesModel.getRawValue(indices[1]); - valueAnimation && (value = interpolateRawValues(data, precision, startValue, endValue, dataIndexRange.t)); - } - animationRecord.lastFrameIndex = indices[0]; - } else { - // If diff <= 0, which is the range is not found(Include NaN) - // Choose the first point or last point. - var idx = percent === 1 || animationRecord.lastFrameIndex > 0 ? indices[0] : 0; - var pt = getPointAtIndex(points, idx); - valueAnimation && (value = seriesModel.getRawValue(idx)); - endLabel.attr({ - x: pt[0] + distanceX, - y: pt[1] + distanceY - }); - } + polyline.stopAnimation(); + updateProps(polyline, target, seriesModel); - if (valueAnimation) { - labelInner(endLabel).setLabelText(value); - } - } - }; - /** - * @private - */ - // FIXME Two value axis - - - LineView.prototype._doUpdateAnimation = function (data, stackedOnPoints, coordSys, api, step, valueOrigin, connectNulls) { - var polyline = this._polyline; - var polygon = this._polygon; - var seriesModel = data.hostModel; - var diff = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin); - var current = diff.current; - var stackedOnCurrent = diff.stackedOnCurrent; - var next = diff.next; - var stackedOnNext = diff.stackedOnNext; - - if (step) { - // TODO If stacked series is not step - current = turnPointsIntoStep(diff.current, coordSys, step, connectNulls); - stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step, connectNulls); - next = turnPointsIntoStep(diff.next, coordSys, step, connectNulls); - stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step, connectNulls); - } // Don't apply animation if diff is large. - // For better result and avoid memory explosion problems like - // https://github.com/apache/incubator-echarts/issues/12229 - - - if (getBoundingDiff(current, next) > 3000 || polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000) { - polyline.stopAnimation(); - polyline.setShape({ - points: next - }); + if (polygon) { + polygon.setShape({ + // Reuse the points with polyline. + points: current, + stackedOnPoints: stackedOnCurrent + }); + polygon.stopAnimation(); + updateProps(polygon, { + shape: { + stackedOnPoints: stackedOnNext + } + }, seriesModel); // If use attr directly in updateProps. - if (polygon) { - polygon.stopAnimation(); - polygon.setShape({ - points: next, - stackedOnPoints: stackedOnNext - }); - } + if (polyline.shape.points !== polygon.shape.points) { + polygon.shape.points = polyline.shape.points; + } + } - return; - } + var updatedDataInfo = []; + var diffStatus = diff.status; - polyline.shape.__points = diff.current; - polyline.shape.points = current; - var target = { - shape: { - points: next - } - }; // Also animate the original points. - // If points reference is changed when turning into step line. + for (var i = 0; i < diffStatus.length; i++) { + var cmd = diffStatus[i].cmd; - if (diff.current !== current) { - target.shape.__points = diff.next; - } // Stop previous animation. + if (cmd === '=') { + var el = data.getItemGraphicEl(diffStatus[i].idx1); + if (el) { + updatedDataInfo.push({ + el: el, + ptIdx: i // Index of points - polyline.stopAnimation(); - updateProps(polyline, target, seriesModel); + }); + } + } + } - if (polygon) { - polygon.setShape({ - // Reuse the points with polyline. - points: current, - stackedOnPoints: stackedOnCurrent - }); - polygon.stopAnimation(); - updateProps(polygon, { - shape: { - stackedOnPoints: stackedOnNext - } - }, seriesModel); // If use attr directly in updateProps. + if (polyline.animators && polyline.animators.length) { + polyline.animators[0].during(function () { + polygon && polygon.dirtyShape(); + var points = polyline.shape.__points; - if (polyline.shape.points !== polygon.shape.points) { - polygon.shape.points = polyline.shape.points; - } - } + for (var i = 0; i < updatedDataInfo.length; i++) { + var el = updatedDataInfo[i].el; + var offset = updatedDataInfo[i].ptIdx * 2; + el.x = points[offset]; + el.y = points[offset + 1]; + el.markRedraw(); + } + }); + } + }; - var updatedDataInfo = []; - var diffStatus = diff.status; + LineView.prototype.remove = function (ecModel) { + var group = this.group; + var oldData = this._data; - for (var i = 0; i < diffStatus.length; i++) { - var cmd = diffStatus[i].cmd; + this._lineGroup.removeAll(); - if (cmd === '=') { - var el = data.getItemGraphicEl(diffStatus[i].idx1); + this._symbolDraw.remove(true); // Remove temporary created elements when highlighting - if (el) { - updatedDataInfo.push({ - el: el, - ptIdx: i // Index of points - }); - } - } - } + oldData && oldData.eachItemGraphicEl(function (el, idx) { + if (el.__temp) { + group.remove(el); + oldData.setItemGraphicEl(idx, null); + } + }); + this._polyline = this._polygon = this._coordSys = this._points = this._stackedOnPoints = this._endLabel = this._data = null; + }; - if (polyline.animators && polyline.animators.length) { - polyline.animators[0].during(function () { - polygon && polygon.dirtyShape(); - var points = polyline.shape.__points; + LineView.type = 'line'; + return LineView; + }(ChartView); - for (var i = 0; i < updatedDataInfo.length; i++) { - var el = updatedDataInfo[i].el; - var offset = updatedDataInfo[i].ptIdx * 2; - el.x = points[offset]; - el.y = points[offset + 1]; - el.markRedraw(); - } - }); - } - }; + function pointsLayout(seriesType, forceStoreInTypedArray) { + return { + seriesType: seriesType, + plan: createRenderPlanner(), + reset: function (seriesModel) { + var data = seriesModel.getData(); + var coordSys = seriesModel.coordinateSystem; + var pipelineContext = seriesModel.pipelineContext; + var useTypedArray = forceStoreInTypedArray || pipelineContext.large; - LineView.prototype.remove = function (ecModel) { - var group = this.group; - var oldData = this._data; + if (!coordSys) { + return; + } - this._lineGroup.removeAll(); + var dims = map(coordSys.dimensions, function (dim) { + return data.mapDimension(dim); + }).slice(0, 2); + var dimLen = dims.length; + var stackResultDim = data.getCalculationInfo('stackResultDimension'); - this._symbolDraw.remove(true); // Remove temporary created elements when highlighting + if (isDimensionStacked(data, dims[0])) { + dims[0] = stackResultDim; + } + if (isDimensionStacked(data, dims[1])) { + dims[1] = stackResultDim; + } - oldData && oldData.eachItemGraphicEl(function (el, idx) { - if (el.__temp) { - group.remove(el); - oldData.setItemGraphicEl(idx, null); - } - }); - this._polyline = this._polygon = this._coordSys = this._points = this._stackedOnPoints = this._endLabel = this._data = null; - }; + var store = data.getStore(); + var dimIdx0 = data.getDimensionIndex(dims[0]); + var dimIdx1 = data.getDimensionIndex(dims[1]); + return dimLen && { + progress: function (params, data) { + var segCount = params.end - params.start; + var points = useTypedArray && createFloat32Array(segCount * dimLen); + var tmpIn = []; + var tmpOut = []; - LineView.type = 'line'; - return LineView; - }(ChartView); + for (var i = params.start, offset = 0; i < params.end; i++) { + var point = void 0; - function pointsLayout(seriesType, forceStoreInTypedArray) { - return { - seriesType: seriesType, - plan: createRenderPlanner(), - reset: function (seriesModel) { - var data = seriesModel.getData(); - var coordSys = seriesModel.coordinateSystem; - var pipelineContext = seriesModel.pipelineContext; - var useTypedArray = forceStoreInTypedArray || pipelineContext.large; - - if (!coordSys) { - return; - } + if (dimLen === 1) { + var x = store.get(dimIdx0, i); // NOTE: Make sure the second parameter is null to use default strategy. - var dims = map(coordSys.dimensions, function (dim) { - return data.mapDimension(dim); - }).slice(0, 2); - var dimLen = dims.length; - var stackResultDim = data.getCalculationInfo('stackResultDimension'); + point = coordSys.dataToPoint(x, null, tmpOut); + } else { + tmpIn[0] = store.get(dimIdx0, i); + tmpIn[1] = store.get(dimIdx1, i); // Let coordinate system to handle the NaN data. - if (isDimensionStacked(data, dims[0])) { - dims[0] = stackResultDim; + point = coordSys.dataToPoint(tmpIn, null, tmpOut); } - if (isDimensionStacked(data, dims[1])) { - dims[1] = stackResultDim; + if (useTypedArray) { + points[offset++] = point[0]; + points[offset++] = point[1]; + } else { + data.setItemLayout(i, point.slice()); } + } - var store = data.getStore(); - var dimIdx0 = data.getDimensionIndex(dims[0]); - var dimIdx1 = data.getDimensionIndex(dims[1]); - return dimLen && { - progress: function (params, data) { - var segCount = params.end - params.start; - var points = useTypedArray && createFloat32Array(segCount * dimLen); - var tmpIn = []; - var tmpOut = []; - - for (var i = params.start, offset = 0; i < params.end; i++) { - var point = void 0; - - if (dimLen === 1) { - var x = store.get(dimIdx0, i); // NOTE: Make sure the second parameter is null to use default strategy. - - point = coordSys.dataToPoint(x, null, tmpOut); - } else { - tmpIn[0] = store.get(dimIdx0, i); - tmpIn[1] = store.get(dimIdx1, i); // Let coordinate system to handle the NaN data. - - point = coordSys.dataToPoint(tmpIn, null, tmpOut); - } - - if (useTypedArray) { - points[offset++] = point[0]; - points[offset++] = point[1]; - } else { - data.setItemLayout(i, point.slice()); - } - } - - useTypedArray && data.setLayout('points', points); - } - }; + useTypedArray && data.setLayout('points', points); } - }; + }; + } + }; } var samplers = { - average: function (frame) { - var sum = 0; - var count = 0; + average: function (frame) { + var sum = 0; + var count = 0; - for (var i = 0; i < frame.length; i++) { - if (!isNaN(frame[i])) { - sum += frame[i]; - count++; - } - } // Return NaN if count is 0 + for (var i = 0; i < frame.length; i++) { + if (!isNaN(frame[i])) { + sum += frame[i]; + count++; + } + } // Return NaN if count is 0 - return count === 0 ? NaN : sum / count; - }, - sum: function (frame) { - var sum = 0; + return count === 0 ? NaN : sum / count; + }, + sum: function (frame) { + var sum = 0; - for (var i = 0; i < frame.length; i++) { - // Ignore NaN - sum += frame[i] || 0; - } + for (var i = 0; i < frame.length; i++) { + // Ignore NaN + sum += frame[i] || 0; + } - return sum; - }, - max: function (frame) { - var max = -Infinity; + return sum; + }, + max: function (frame) { + var max = -Infinity; - for (var i = 0; i < frame.length; i++) { - frame[i] > max && (max = frame[i]); - } // NaN will cause illegal axis extent. + for (var i = 0; i < frame.length; i++) { + frame[i] > max && (max = frame[i]); + } // NaN will cause illegal axis extent. - return isFinite(max) ? max : NaN; - }, - min: function (frame) { - var min = Infinity; + return isFinite(max) ? max : NaN; + }, + min: function (frame) { + var min = Infinity; - for (var i = 0; i < frame.length; i++) { - frame[i] < min && (min = frame[i]); - } // NaN will cause illegal axis extent. + for (var i = 0; i < frame.length; i++) { + frame[i] < min && (min = frame[i]); + } // NaN will cause illegal axis extent. - return isFinite(min) ? min : NaN; - }, - // TODO - // Median - nearest: function (frame) { - return frame[0]; - } + return isFinite(min) ? min : NaN; + }, + // TODO + // Median + nearest: function (frame) { + return frame[0]; + } }; var indexSampler = function (frame) { - return Math.round(frame.length / 2); + return Math.round(frame.length / 2); }; function dataSample(seriesType) { - return { - seriesType: seriesType, - // FIXME:TS never used, so comment it - // modifyOutputEnd: true, - reset: function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - var sampling = seriesModel.get('sampling'); - var coordSys = seriesModel.coordinateSystem; - var count = data.count(); // Only cartesian2d support down sampling. Disable it when there is few data. - - if (count > 10 && coordSys.type === 'cartesian2d' && sampling) { - var baseAxis = coordSys.getBaseAxis(); - var valueAxis = coordSys.getOtherAxis(baseAxis); - var extent = baseAxis.getExtent(); - var dpr = api.getDevicePixelRatio(); // Coordinste system has been resized - - var size = Math.abs(extent[1] - extent[0]) * (dpr || 1); - var rate = Math.round(count / size); - - if (isFinite(rate) && rate > 1) { - if (sampling === 'lttb') { - seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim), 1 / rate)); - } + return { + seriesType: seriesType, + // FIXME:TS never used, so comment it + // modifyOutputEnd: true, + reset: function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); + var sampling = seriesModel.get('sampling'); + var coordSys = seriesModel.coordinateSystem; + var count = data.count(); // Only cartesian2d support down sampling. Disable it when there is few data. + + if (count > 10 && coordSys.type === 'cartesian2d' && sampling) { + var baseAxis = coordSys.getBaseAxis(); + var valueAxis = coordSys.getOtherAxis(baseAxis); + var extent = baseAxis.getExtent(); + var dpr = api.getDevicePixelRatio(); // Coordinste system has been resized - var sampler = void 0; + var size = Math.abs(extent[1] - extent[0]) * (dpr || 1); + var rate = Math.round(count / size); - if (isString(sampling)) { - sampler = samplers[sampling]; - } else if (isFunction(sampling)) { - sampler = sampling; - } + if (isFinite(rate) && rate > 1) { + if (sampling === 'lttb') { + seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim), 1 / rate)); + } - if (sampler) { - // Only support sample the first dim mapped from value axis. - seriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler)); - } - } - } + var sampler = void 0; + + if (isString(sampling)) { + sampler = samplers[sampling]; + } else if (isFunction(sampling)) { + sampler = sampling; + } + + if (sampler) { + // Only support sample the first dim mapped from value axis. + seriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler)); + } } - }; + } + } + }; } function install$2(registers) { - registers.registerChartView(LineView); - registers.registerSeriesModel(LineSeriesModel); - registers.registerLayout(pointsLayout('line', true)); - registers.registerVisual({ - seriesType: 'line', - reset: function (seriesModel) { - var data = seriesModel.getData(); // Visual coding for legend + registers.registerChartView(LineView); + registers.registerSeriesModel(LineSeriesModel); + registers.registerLayout(pointsLayout('line', true)); + registers.registerVisual({ + seriesType: 'line', + reset: function (seriesModel) { + var data = seriesModel.getData(); // Visual coding for legend - var lineStyle = seriesModel.getModel('lineStyle').getLineStyle(); + var lineStyle = seriesModel.getModel('lineStyle').getLineStyle(); - if (lineStyle && !lineStyle.stroke) { - // Fill in visual should be palette color if - // has color callback - lineStyle.stroke = data.getVisual('style').fill; - } + if (lineStyle && !lineStyle.stroke) { + // Fill in visual should be palette color if + // has color callback + lineStyle.stroke = data.getVisual('style').fill; + } - data.setVisual('legendLineStyle', lineStyle); - } - }); // Down sample after filter + data.setVisual('legendLineStyle', lineStyle); + } + }); // Down sample after filter - registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample('line')); + registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample('line')); } var BaseBarSeriesModel = - /** @class */ - function (_super) { - __extends(BaseBarSeriesModel, _super); + /** @class */ + function (_super) { + __extends(BaseBarSeriesModel, _super); - function BaseBarSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function BaseBarSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = BaseBarSeriesModel.type; - return _this; - } + _this.type = BaseBarSeriesModel.type; + return _this; + } - BaseBarSeriesModel.prototype.getInitialData = function (option, ecModel) { - return createSeriesData(null, this, { - useEncodeDefaulter: true - }); - }; + BaseBarSeriesModel.prototype.getInitialData = function (option, ecModel) { + return createSeriesData(null, this, { + useEncodeDefaulter: true + }); + }; - BaseBarSeriesModel.prototype.getMarkerPosition = function (value) { - var coordSys = this.coordinateSystem; + BaseBarSeriesModel.prototype.getMarkerPosition = function (value) { + var coordSys = this.coordinateSystem; - if (coordSys && coordSys.clampData) { - // PENDING if clamp ? - var pt = coordSys.dataToPoint(coordSys.clampData(value)); - var data = this.getData(); - var offset = data.getLayout('offset'); - var size = data.getLayout('size'); - var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1; - pt[offsetIndex] += offset + size / 2; - return pt; - } + if (coordSys && coordSys.clampData) { + // PENDING if clamp ? + var pt = coordSys.dataToPoint(coordSys.clampData(value)); + var data = this.getData(); + var offset = data.getLayout('offset'); + var size = data.getLayout('size'); + var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1; + pt[offsetIndex] += offset + size / 2; + return pt; + } - return [NaN, NaN]; - }; + return [NaN, NaN]; + }; - BaseBarSeriesModel.type = 'series.__base_bar__'; - BaseBarSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - coordinateSystem: 'cartesian2d', - legendHoverLink: true, - // stack: null - // Cartesian coordinate system - // xAxisIndex: 0, - // yAxisIndex: 0, - barMinHeight: 0, - barMinAngle: 0, - // cursor: null, - large: false, - largeThreshold: 400, - progressive: 3e3, - progressiveChunkMode: 'mod' - }; - return BaseBarSeriesModel; - }(SeriesModel); + BaseBarSeriesModel.type = 'series.__base_bar__'; + BaseBarSeriesModel.defaultOption = { + // zlevel: 0, + z: 2, + coordinateSystem: 'cartesian2d', + legendHoverLink: true, + // stack: null + // Cartesian coordinate system + // xAxisIndex: 0, + // yAxisIndex: 0, + barMinHeight: 0, + barMinAngle: 0, + // cursor: null, + large: false, + largeThreshold: 400, + progressive: 3e3, + progressiveChunkMode: 'mod' + }; + return BaseBarSeriesModel; + }(SeriesModel); SeriesModel.registerClass(BaseBarSeriesModel); var BarSeriesModel = - /** @class */ - function (_super) { - __extends(BarSeriesModel, _super); - - function BarSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = BarSeriesModel.type; - return _this; - } - - BarSeriesModel.prototype.getInitialData = function () { - return createSeriesData(null, this, { - useEncodeDefaulter: true, - createInvertedIndices: !!this.get('realtimeSort', true) || null - }); - }; - /** - * @override - */ + /** @class */ + function (_super) { + __extends(BarSeriesModel, _super); + function BarSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - BarSeriesModel.prototype.getProgressive = function () { - // Do not support progressive in normal mode. - return this.get('large') ? this.get('progressive') : false; - }; - /** - * @override - */ - + _this.type = BarSeriesModel.type; + return _this; + } - BarSeriesModel.prototype.getProgressiveThreshold = function () { - // Do not support progressive in normal mode. - var progressiveThreshold = this.get('progressiveThreshold'); - var largeThreshold = this.get('largeThreshold'); + BarSeriesModel.prototype.getInitialData = function () { + return createSeriesData(null, this, { + useEncodeDefaulter: true, + createInvertedIndices: !!this.get('realtimeSort', true) || null + }); + }; + /** + * @override + */ - if (largeThreshold > progressiveThreshold) { - progressiveThreshold = largeThreshold; - } - return progressiveThreshold; - }; + BarSeriesModel.prototype.getProgressive = function () { + // Do not support progressive in normal mode. + return this.get('large') ? this.get('progressive') : false; + }; + /** + * @override + */ - BarSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) { - return selectors.rect(data.getItemLayout(dataIndex)); - }; - BarSeriesModel.type = 'series.bar'; - BarSeriesModel.dependencies = ['grid', 'polar']; - BarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, { - // If clipped - // Only available on cartesian2d - clip: true, - roundCap: false, - showBackground: false, - backgroundStyle: { - color: 'rgba(180, 180, 180, 0.2)', - borderColor: null, - borderWidth: 0, - borderType: 'solid', - borderRadius: 0, - shadowBlur: 0, - shadowColor: null, - shadowOffsetX: 0, - shadowOffsetY: 0, - opacity: 1 - }, - select: { - itemStyle: { - borderColor: '#212121' - } - }, - realtimeSort: false - }); - return BarSeriesModel; - }(BaseBarSeriesModel); + BarSeriesModel.prototype.getProgressiveThreshold = function () { + // Do not support progressive in normal mode. + var progressiveThreshold = this.get('progressiveThreshold'); + var largeThreshold = this.get('largeThreshold'); + + if (largeThreshold > progressiveThreshold) { + progressiveThreshold = largeThreshold; + } + + return progressiveThreshold; + }; + + BarSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) { + return selectors.rect(data.getItemLayout(dataIndex)); + }; + + BarSeriesModel.type = 'series.bar'; + BarSeriesModel.dependencies = ['grid', 'polar']; + BarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, { + // If clipped + // Only available on cartesian2d + clip: true, + roundCap: false, + showBackground: false, + backgroundStyle: { + color: 'rgba(180, 180, 180, 0.2)', + borderColor: null, + borderWidth: 0, + borderType: 'solid', + borderRadius: 0, + shadowBlur: 0, + shadowColor: null, + shadowOffsetX: 0, + shadowOffsetY: 0, + opacity: 1 + }, + select: { + itemStyle: { + borderColor: '#212121' + } + }, + realtimeSort: false + }); + return BarSeriesModel; + }(BaseBarSeriesModel); /** * Sausage: similar to sector, but have half circle on both sides */ var SausageShape = - /** @class */ - function () { - function SausageShape() { - this.cx = 0; - this.cy = 0; - this.r0 = 0; - this.r = 0; - this.startAngle = 0; - this.endAngle = Math.PI * 2; - this.clockwise = true; - } - - return SausageShape; - }(); + /** @class */ + function () { + function SausageShape() { + this.cx = 0; + this.cy = 0; + this.r0 = 0; + this.r = 0; + this.startAngle = 0; + this.endAngle = Math.PI * 2; + this.clockwise = true; + } + + return SausageShape; + }(); var SausagePath = - /** @class */ - function (_super) { - __extends(SausagePath, _super); - - function SausagePath(opts) { - var _this = _super.call(this, opts) || this; - - _this.type = 'sausage'; - return _this; - } - - SausagePath.prototype.getDefaultShape = function () { - return new SausageShape(); - }; - - SausagePath.prototype.buildPath = function (ctx, shape) { - var cx = shape.cx; - var cy = shape.cy; - var r0 = Math.max(shape.r0 || 0, 0); - var r = Math.max(shape.r, 0); - var dr = (r - r0) * 0.5; - var rCenter = r0 + dr; - var startAngle = shape.startAngle; - var endAngle = shape.endAngle; - var clockwise = shape.clockwise; - var PI2 = Math.PI * 2; - var lessThanCircle = clockwise ? endAngle - startAngle < PI2 : startAngle - endAngle < PI2; - - if (!lessThanCircle) { - // Normalize angles - startAngle = endAngle - (clockwise ? PI2 : -PI2); - } - - var unitStartX = Math.cos(startAngle); - var unitStartY = Math.sin(startAngle); - var unitEndX = Math.cos(endAngle); - var unitEndY = Math.sin(endAngle); - - if (lessThanCircle) { - ctx.moveTo(unitStartX * r0 + cx, unitStartY * r0 + cy); - ctx.arc(unitStartX * rCenter + cx, unitStartY * rCenter + cy, dr, -Math.PI + startAngle, startAngle, !clockwise); - } else { - ctx.moveTo(unitStartX * r + cx, unitStartY * r + cy); - } + /** @class */ + function (_super) { + __extends(SausagePath, _super); + + function SausagePath(opts) { + var _this = _super.call(this, opts) || this; + + _this.type = 'sausage'; + return _this; + } + + SausagePath.prototype.getDefaultShape = function () { + return new SausageShape(); + }; + + SausagePath.prototype.buildPath = function (ctx, shape) { + var cx = shape.cx; + var cy = shape.cy; + var r0 = Math.max(shape.r0 || 0, 0); + var r = Math.max(shape.r, 0); + var dr = (r - r0) * 0.5; + var rCenter = r0 + dr; + var startAngle = shape.startAngle; + var endAngle = shape.endAngle; + var clockwise = shape.clockwise; + var PI2 = Math.PI * 2; + var lessThanCircle = clockwise ? endAngle - startAngle < PI2 : startAngle - endAngle < PI2; + + if (!lessThanCircle) { + // Normalize angles + startAngle = endAngle - (clockwise ? PI2 : -PI2); + } + + var unitStartX = Math.cos(startAngle); + var unitStartY = Math.sin(startAngle); + var unitEndX = Math.cos(endAngle); + var unitEndY = Math.sin(endAngle); + + if (lessThanCircle) { + ctx.moveTo(unitStartX * r0 + cx, unitStartY * r0 + cy); + ctx.arc(unitStartX * rCenter + cx, unitStartY * rCenter + cy, dr, -Math.PI + startAngle, startAngle, !clockwise); + } else { + ctx.moveTo(unitStartX * r + cx, unitStartY * r + cy); + } - ctx.arc(cx, cy, r, startAngle, endAngle, !clockwise); - ctx.arc(unitEndX * rCenter + cx, unitEndY * rCenter + cy, dr, endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise); + ctx.arc(cx, cy, r, startAngle, endAngle, !clockwise); + ctx.arc(unitEndX * rCenter + cx, unitEndY * rCenter + cy, dr, endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise); - if (r0 !== 0) { - ctx.arc(cx, cy, r0, endAngle, startAngle, clockwise); - } // ctx.closePath(); + if (r0 !== 0) { + ctx.arc(cx, cy, r0, endAngle, startAngle, clockwise); + } // ctx.closePath(); - }; + }; - return SausagePath; - }(Path); + return SausagePath; + }(Path); function createSectorCalculateTextPosition(positionMapping, opts) { - opts = opts || {}; - var isRoundCap = opts.isRoundCap; - return function (out, opts, boundingRect) { - var textPosition = opts.position; - - if (!textPosition || textPosition instanceof Array) { - return calculateTextPosition(out, opts, boundingRect); - } - - var mappedSectorPosition = positionMapping(textPosition); - var distance = opts.distance != null ? opts.distance : 5; - var sector = this.shape; - var cx = sector.cx; - var cy = sector.cy; - var r = sector.r; - var r0 = sector.r0; - var middleR = (r + r0) / 2; - var startAngle = sector.startAngle; - var endAngle = sector.endAngle; - var middleAngle = (startAngle + endAngle) / 2; - var extraDist = isRoundCap ? Math.abs(r - r0) / 2 : 0; - var mathCos = Math.cos; - var mathSin = Math.sin; // base position: top-left - - var x = cx + r * mathCos(startAngle); - var y = cy + r * mathSin(startAngle); - var textAlign = 'left'; - var textVerticalAlign = 'top'; - - switch (mappedSectorPosition) { - case 'startArc': - x = cx + (r0 - distance) * mathCos(middleAngle); - y = cy + (r0 - distance) * mathSin(middleAngle); - textAlign = 'center'; - textVerticalAlign = 'top'; - break; - - case 'insideStartArc': - x = cx + (r0 + distance) * mathCos(middleAngle); - y = cy + (r0 + distance) * mathSin(middleAngle); - textAlign = 'center'; - textVerticalAlign = 'bottom'; - break; - - case 'startAngle': - x = cx + middleR * mathCos(startAngle) + adjustAngleDistanceX(startAngle, distance + extraDist, false); - y = cy + middleR * mathSin(startAngle) + adjustAngleDistanceY(startAngle, distance + extraDist, false); - textAlign = 'right'; - textVerticalAlign = 'middle'; - break; - - case 'insideStartAngle': - x = cx + middleR * mathCos(startAngle) + adjustAngleDistanceX(startAngle, -distance + extraDist, false); - y = cy + middleR * mathSin(startAngle) + adjustAngleDistanceY(startAngle, -distance + extraDist, false); - textAlign = 'left'; - textVerticalAlign = 'middle'; - break; - - case 'middle': - x = cx + middleR * mathCos(middleAngle); - y = cy + middleR * mathSin(middleAngle); - textAlign = 'center'; - textVerticalAlign = 'middle'; - break; + opts = opts || {}; + var isRoundCap = opts.isRoundCap; + return function (out, opts, boundingRect) { + var textPosition = opts.position; - case 'endArc': - x = cx + (r + distance) * mathCos(middleAngle); - y = cy + (r + distance) * mathSin(middleAngle); - textAlign = 'center'; - textVerticalAlign = 'bottom'; - break; + if (!textPosition || textPosition instanceof Array) { + return calculateTextPosition(out, opts, boundingRect); + } - case 'insideEndArc': - x = cx + (r - distance) * mathCos(middleAngle); - y = cy + (r - distance) * mathSin(middleAngle); - textAlign = 'center'; - textVerticalAlign = 'top'; - break; + var mappedSectorPosition = positionMapping(textPosition); + var distance = opts.distance != null ? opts.distance : 5; + var sector = this.shape; + var cx = sector.cx; + var cy = sector.cy; + var r = sector.r; + var r0 = sector.r0; + var middleR = (r + r0) / 2; + var startAngle = sector.startAngle; + var endAngle = sector.endAngle; + var middleAngle = (startAngle + endAngle) / 2; + var extraDist = isRoundCap ? Math.abs(r - r0) / 2 : 0; + var mathCos = Math.cos; + var mathSin = Math.sin; // base position: top-left - case 'endAngle': - x = cx + middleR * mathCos(endAngle) + adjustAngleDistanceX(endAngle, distance + extraDist, true); - y = cy + middleR * mathSin(endAngle) + adjustAngleDistanceY(endAngle, distance + extraDist, true); - textAlign = 'left'; - textVerticalAlign = 'middle'; - break; + var x = cx + r * mathCos(startAngle); + var y = cy + r * mathSin(startAngle); + var textAlign = 'left'; + var textVerticalAlign = 'top'; - case 'insideEndAngle': - x = cx + middleR * mathCos(endAngle) + adjustAngleDistanceX(endAngle, -distance + extraDist, true); - y = cy + middleR * mathSin(endAngle) + adjustAngleDistanceY(endAngle, -distance + extraDist, true); - textAlign = 'right'; - textVerticalAlign = 'middle'; - break; + switch (mappedSectorPosition) { + case 'startArc': + x = cx + (r0 - distance) * mathCos(middleAngle); + y = cy + (r0 - distance) * mathSin(middleAngle); + textAlign = 'center'; + textVerticalAlign = 'top'; + break; - default: - return calculateTextPosition(out, opts, boundingRect); - } + case 'insideStartArc': + x = cx + (r0 + distance) * mathCos(middleAngle); + y = cy + (r0 + distance) * mathSin(middleAngle); + textAlign = 'center'; + textVerticalAlign = 'bottom'; + break; - out = out || {}; - out.x = x; - out.y = y; - out.align = textAlign; - out.verticalAlign = textVerticalAlign; - return out; - }; - } - function setSectorTextRotation(sector, textPosition, positionMapping, rotateType) { - if (isNumber(rotateType)) { - // user-set rotation - sector.setTextConfig({ - rotation: rotateType - }); - return; - } else if (isArray(textPosition)) { - // user-set position, use 0 as auto rotation - sector.setTextConfig({ - rotation: 0 - }); - return; - } + case 'startAngle': + x = cx + middleR * mathCos(startAngle) + adjustAngleDistanceX(startAngle, distance + extraDist, false); + y = cy + middleR * mathSin(startAngle) + adjustAngleDistanceY(startAngle, distance + extraDist, false); + textAlign = 'right'; + textVerticalAlign = 'middle'; + break; - var shape = sector.shape; - var startAngle = shape.clockwise ? shape.startAngle : shape.endAngle; - var endAngle = shape.clockwise ? shape.endAngle : shape.startAngle; - var middleAngle = (startAngle + endAngle) / 2; - var anchorAngle; - var mappedSectorPosition = positionMapping(textPosition); + case 'insideStartAngle': + x = cx + middleR * mathCos(startAngle) + adjustAngleDistanceX(startAngle, -distance + extraDist, false); + y = cy + middleR * mathSin(startAngle) + adjustAngleDistanceY(startAngle, -distance + extraDist, false); + textAlign = 'left'; + textVerticalAlign = 'middle'; + break; - switch (mappedSectorPosition) { - case 'startArc': - case 'insideStartArc': - case 'middle': - case 'insideEndArc': - case 'endArc': - anchorAngle = middleAngle; - break; + case 'middle': + x = cx + middleR * mathCos(middleAngle); + y = cy + middleR * mathSin(middleAngle); + textAlign = 'center'; + textVerticalAlign = 'middle'; + break; - case 'startAngle': - case 'insideStartAngle': - anchorAngle = startAngle; - break; + case 'endArc': + x = cx + (r + distance) * mathCos(middleAngle); + y = cy + (r + distance) * mathSin(middleAngle); + textAlign = 'center'; + textVerticalAlign = 'bottom'; + break; - case 'endAngle': - case 'insideEndAngle': - anchorAngle = endAngle; - break; + case 'insideEndArc': + x = cx + (r - distance) * mathCos(middleAngle); + y = cy + (r - distance) * mathSin(middleAngle); + textAlign = 'center'; + textVerticalAlign = 'top'; + break; - default: - sector.setTextConfig({ - rotation: 0 - }); - return; - } + case 'endAngle': + x = cx + middleR * mathCos(endAngle) + adjustAngleDistanceX(endAngle, distance + extraDist, true); + y = cy + middleR * mathSin(endAngle) + adjustAngleDistanceY(endAngle, distance + extraDist, true); + textAlign = 'left'; + textVerticalAlign = 'middle'; + break; - var rotate = Math.PI * 1.5 - anchorAngle; - /** - * TODO: labels with rotate > Math.PI / 2 should be rotate another - * half round flipped to increase readability. However, only middle - * position supports this for now, because in other positions, the - * anchor point is not at the center of the text, so the positions - * after rotating is not as expected. - */ + case 'insideEndAngle': + x = cx + middleR * mathCos(endAngle) + adjustAngleDistanceX(endAngle, -distance + extraDist, true); + y = cy + middleR * mathSin(endAngle) + adjustAngleDistanceY(endAngle, -distance + extraDist, true); + textAlign = 'right'; + textVerticalAlign = 'middle'; + break; - if (mappedSectorPosition === 'middle' && rotate > Math.PI / 2 && rotate < Math.PI * 1.5) { - rotate -= Math.PI; + default: + return calculateTextPosition(out, opts, boundingRect); } + out = out || {}; + out.x = x; + out.y = y; + out.align = textAlign; + out.verticalAlign = textVerticalAlign; + return out; + }; + } + function setSectorTextRotation(sector, textPosition, positionMapping, rotateType) { + if (isNumber(rotateType)) { + // user-set rotation + sector.setTextConfig({ + rotation: rotateType + }); + return; + } else if (isArray(textPosition)) { + // user-set position, use 0 as auto rotation sector.setTextConfig({ - rotation: rotate + rotation: 0 }); + return; + } + + var shape = sector.shape; + var startAngle = shape.clockwise ? shape.startAngle : shape.endAngle; + var endAngle = shape.clockwise ? shape.endAngle : shape.startAngle; + var middleAngle = (startAngle + endAngle) / 2; + var anchorAngle; + var mappedSectorPosition = positionMapping(textPosition); + + switch (mappedSectorPosition) { + case 'startArc': + case 'insideStartArc': + case 'middle': + case 'insideEndArc': + case 'endArc': + anchorAngle = middleAngle; + break; + + case 'startAngle': + case 'insideStartAngle': + anchorAngle = startAngle; + break; + + case 'endAngle': + case 'insideEndAngle': + anchorAngle = endAngle; + break; + + default: + sector.setTextConfig({ + rotation: 0 + }); + return; + } + + var rotate = Math.PI * 1.5 - anchorAngle; + /** + * TODO: labels with rotate > Math.PI / 2 should be rotate another + * half round flipped to increase readability. However, only middle + * position supports this for now, because in other positions, the + * anchor point is not at the center of the text, so the positions + * after rotating is not as expected. + */ + + if (mappedSectorPosition === 'middle' && rotate > Math.PI / 2 && rotate < Math.PI * 1.5) { + rotate -= Math.PI; + } + + sector.setTextConfig({ + rotation: rotate + }); } function adjustAngleDistanceX(angle, distance, isEnd) { - return distance * Math.sin(angle) * (isEnd ? -1 : 1); + return distance * Math.sin(angle) * (isEnd ? -1 : 1); } function adjustAngleDistanceY(angle, distance, isEnd) { - return distance * Math.cos(angle) * (isEnd ? 1 : -1); + return distance * Math.cos(angle) * (isEnd ? 1 : -1); } var mathMax$6 = Math.max; var mathMin$6 = Math.min; function getClipArea(coord, data) { - var coordSysClipArea = coord.getArea && coord.getArea(); + var coordSysClipArea = coord.getArea && coord.getArea(); - if (isCoordinateSystemType(coord, 'cartesian2d')) { - var baseAxis = coord.getBaseAxis(); // When boundaryGap is false or using time axis. bar may exceed the grid. - // We should not clip this part. - // See test/bar2.html + if (isCoordinateSystemType(coord, 'cartesian2d')) { + var baseAxis = coord.getBaseAxis(); // When boundaryGap is false or using time axis. bar may exceed the grid. + // We should not clip this part. + // See test/bar2.html - if (baseAxis.type !== 'category' || !baseAxis.onBand) { - var expandWidth = data.getLayout('bandWidth'); + if (baseAxis.type !== 'category' || !baseAxis.onBand) { + var expandWidth = data.getLayout('bandWidth'); - if (baseAxis.isHorizontal()) { - coordSysClipArea.x -= expandWidth; - coordSysClipArea.width += expandWidth * 2; - } else { - coordSysClipArea.y -= expandWidth; - coordSysClipArea.height += expandWidth * 2; - } - } + if (baseAxis.isHorizontal()) { + coordSysClipArea.x -= expandWidth; + coordSysClipArea.width += expandWidth * 2; + } else { + coordSysClipArea.y -= expandWidth; + coordSysClipArea.height += expandWidth * 2; + } } + } - return coordSysClipArea; + return coordSysClipArea; } var BarView = - /** @class */ - function (_super) { - __extends(BarView, _super); - - function BarView() { - var _this = _super.call(this) || this; - - _this.type = BarView.type; - _this._isFirstFrame = true; - return _this; - } - - BarView.prototype.render = function (seriesModel, ecModel, api, payload) { - this._model = seriesModel; - - this._removeOnRenderedListener(api); - - this._updateDrawMode(seriesModel); + /** @class */ + function (_super) { + __extends(BarView, _super); - var coordinateSystemType = seriesModel.get('coordinateSystem'); + function BarView() { + var _this = _super.call(this) || this; - if (coordinateSystemType === 'cartesian2d' || coordinateSystemType === 'polar') { - // Clear previously rendered progressive elements. - this._progressiveEls = null; - this._isLargeDraw ? this._renderLarge(seriesModel, ecModel, api) : this._renderNormal(seriesModel, ecModel, api, payload); - } else if ("development" !== 'production') { - warn('Only cartesian2d and polar supported for bar.'); - } - }; + _this.type = BarView.type; + _this._isFirstFrame = true; + return _this; + } - BarView.prototype.incrementalPrepareRender = function (seriesModel) { - this._clear(); + BarView.prototype.render = function (seriesModel, ecModel, api, payload) { + this._model = seriesModel; - this._updateDrawMode(seriesModel); // incremental also need to clip, otherwise might be overlow. - // But must not set clip in each frame, otherwise all of the children will be marked redraw. + this._removeOnRenderedListener(api); + this._updateDrawMode(seriesModel); - this._updateLargeClip(seriesModel); - }; - - BarView.prototype.incrementalRender = function (params, seriesModel) { - // Reset - this._progressiveEls = []; // Do not support progressive in normal mode. + var coordinateSystemType = seriesModel.get('coordinateSystem'); - this._incrementalRenderLarge(params, seriesModel); - }; + if (coordinateSystemType === 'cartesian2d' || coordinateSystemType === 'polar') { + // Clear previously rendered progressive elements. + this._progressiveEls = null; + this._isLargeDraw ? this._renderLarge(seriesModel, ecModel, api) : this._renderNormal(seriesModel, ecModel, api, payload); + } else if ("development" !== 'production') { + warn('Only cartesian2d and polar supported for bar.'); + } + }; - BarView.prototype.eachRendered = function (cb) { - traverseElements(this._progressiveEls || this.group, cb); - }; + BarView.prototype.incrementalPrepareRender = function (seriesModel) { + this._clear(); - BarView.prototype._updateDrawMode = function (seriesModel) { - var isLargeDraw = seriesModel.pipelineContext.large; + this._updateDrawMode(seriesModel); // incremental also need to clip, otherwise might be overlow. + // But must not set clip in each frame, otherwise all of the children will be marked redraw. - if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) { - this._isLargeDraw = isLargeDraw; - this._clear(); - } - }; + this._updateLargeClip(seriesModel); + }; - BarView.prototype._renderNormal = function (seriesModel, ecModel, api, payload) { - var group = this.group; - var data = seriesModel.getData(); - var oldData = this._data; - var coord = seriesModel.coordinateSystem; - var baseAxis = coord.getBaseAxis(); - var isHorizontalOrRadial; + BarView.prototype.incrementalRender = function (params, seriesModel) { + // Reset + this._progressiveEls = []; // Do not support progressive in normal mode. - if (coord.type === 'cartesian2d') { - isHorizontalOrRadial = baseAxis.isHorizontal(); - } else if (coord.type === 'polar') { - isHorizontalOrRadial = baseAxis.dim === 'angle'; - } + this._incrementalRenderLarge(params, seriesModel); + }; - var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null; - var realtimeSortCfg = shouldRealtimeSort(seriesModel, coord); + BarView.prototype.eachRendered = function (cb) { + traverseElements(this._progressiveEls || this.group, cb); + }; - if (realtimeSortCfg) { - this._enableRealtimeSort(realtimeSortCfg, data, api); - } + BarView.prototype._updateDrawMode = function (seriesModel) { + var isLargeDraw = seriesModel.pipelineContext.large; - var needsClip = seriesModel.get('clip', true) || realtimeSortCfg; - var coordSysClipArea = getClipArea(coord, data); // If there is clipPath created in large mode. Remove it. + if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) { + this._isLargeDraw = isLargeDraw; - group.removeClipPath(); // We don't use clipPath in normal mode because we needs a perfect animation - // And don't want the label are clipped. + this._clear(); + } + }; - var roundCap = seriesModel.get('roundCap', true); - var drawBackground = seriesModel.get('showBackground', true); - var backgroundModel = seriesModel.getModel('backgroundStyle'); - var barBorderRadius = backgroundModel.get('borderRadius') || 0; - var bgEls = []; - var oldBgEls = this._backgroundEls; - var isInitSort = payload && payload.isInitSort; - var isChangeOrder = payload && payload.type === 'changeAxisOrder'; + BarView.prototype._renderNormal = function (seriesModel, ecModel, api, payload) { + var group = this.group; + var data = seriesModel.getData(); + var oldData = this._data; + var coord = seriesModel.coordinateSystem; + var baseAxis = coord.getBaseAxis(); + var isHorizontalOrRadial; - function createBackground(dataIndex) { - var bgLayout = getLayout[coord.type](data, dataIndex); - var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout); - bgEl.useStyle(backgroundModel.getItemStyle()); // Only cartesian2d support borderRadius. + if (coord.type === 'cartesian2d') { + isHorizontalOrRadial = baseAxis.isHorizontal(); + } else if (coord.type === 'polar') { + isHorizontalOrRadial = baseAxis.dim === 'angle'; + } - if (coord.type === 'cartesian2d') { - bgEl.setShape('r', barBorderRadius); - } + var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null; + var realtimeSortCfg = shouldRealtimeSort(seriesModel, coord); - bgEls[dataIndex] = bgEl; - return bgEl; - } - data.diff(oldData).add(function (dataIndex) { - var itemModel = data.getItemModel(dataIndex); - var layout = getLayout[coord.type](data, dataIndex, itemModel); + if (realtimeSortCfg) { + this._enableRealtimeSort(realtimeSortCfg, data, api); + } - if (drawBackground) { - createBackground(dataIndex); - } // If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in "axisProxy". + var needsClip = seriesModel.get('clip', true) || realtimeSortCfg; + var coordSysClipArea = getClipArea(coord, data); // If there is clipPath created in large mode. Remove it. + group.removeClipPath(); // We don't use clipPath in normal mode because we needs a perfect animation + // And don't want the label are clipped. - if (!data.hasValue(dataIndex) || !isValidLayout[coord.type](layout)) { - return; - } + var roundCap = seriesModel.get('roundCap', true); + var drawBackground = seriesModel.get('showBackground', true); + var backgroundModel = seriesModel.getModel('backgroundStyle'); + var barBorderRadius = backgroundModel.get('borderRadius') || 0; + var bgEls = []; + var oldBgEls = this._backgroundEls; + var isInitSort = payload && payload.isInitSort; + var isChangeOrder = payload && payload.type === 'changeAxisOrder'; - var isClipped = false; + function createBackground(dataIndex) { + var bgLayout = getLayout[coord.type](data, dataIndex); + var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout); + bgEl.useStyle(backgroundModel.getItemStyle()); // Only cartesian2d support borderRadius. - if (needsClip) { - // Clip will modify the layout params. - // And return a boolean to determine if the shape are fully clipped. - isClipped = clip[coord.type](coordSysClipArea, layout); - } + if (coord.type === 'cartesian2d') { + bgEl.setShape('r', barBorderRadius); + } - var el = elementCreator[coord.type](seriesModel, data, dataIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, false, roundCap); - - if (realtimeSortCfg) { - /** - * Force label animation because even if the element is - * ignored because it's clipped, it may not be clipped after - * changing order. Then, if not using forceLabelAnimation, - * the label animation was never started, in which case, - * the label will be the final value and doesn't have label - * animation. - */ - el.forceLabelAnimation = true; - } + bgEls[dataIndex] = bgEl; + return bgEl; + } + data.diff(oldData).add(function (dataIndex) { + var itemModel = data.getItemModel(dataIndex); + var layout = getLayout[coord.type](data, dataIndex, itemModel); - updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar'); + if (drawBackground) { + createBackground(dataIndex); + } // If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in "axisProxy". - if (isInitSort) { - el.attr({ - shape: layout - }); - } else if (realtimeSortCfg) { - updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout, dataIndex, isHorizontalOrRadial, false, false); - } else { - initProps(el, { - shape: layout - }, seriesModel, dataIndex); - } - data.setItemGraphicEl(dataIndex, el); - group.add(el); - el.ignore = isClipped; - }).update(function (newIndex, oldIndex) { - var itemModel = data.getItemModel(newIndex); - var layout = getLayout[coord.type](data, newIndex, itemModel); + if (!data.hasValue(dataIndex) || !isValidLayout[coord.type](layout)) { + return; + } - if (drawBackground) { - var bgEl = void 0; + var isClipped = false; - if (oldBgEls.length === 0) { - bgEl = createBackground(oldIndex); - } else { - bgEl = oldBgEls[oldIndex]; - bgEl.useStyle(backgroundModel.getItemStyle()); // Only cartesian2d support borderRadius. + if (needsClip) { + // Clip will modify the layout params. + // And return a boolean to determine if the shape are fully clipped. + isClipped = clip[coord.type](coordSysClipArea, layout); + } - if (coord.type === 'cartesian2d') { - bgEl.setShape('r', barBorderRadius); - } + var el = elementCreator[coord.type](seriesModel, data, dataIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, false, roundCap); - bgEls[newIndex] = bgEl; - } + if (realtimeSortCfg) { + /** + * Force label animation because even if the element is + * ignored because it's clipped, it may not be clipped after + * changing order. Then, if not using forceLabelAnimation, + * the label animation was never started, in which case, + * the label will be the final value and doesn't have label + * animation. + */ + el.forceLabelAnimation = true; + } - var bgLayout = getLayout[coord.type](data, newIndex); - var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord); - updateProps(bgEl, { - shape: shape - }, animationModel, newIndex); - } + updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar'); - var el = oldData.getItemGraphicEl(oldIndex); + if (isInitSort) { + el.attr({ + shape: layout + }); + } else if (realtimeSortCfg) { + updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout, dataIndex, isHorizontalOrRadial, false, false); + } else { + initProps(el, { + shape: layout + }, seriesModel, dataIndex); + } + + data.setItemGraphicEl(dataIndex, el); + group.add(el); + el.ignore = isClipped; + }).update(function (newIndex, oldIndex) { + var itemModel = data.getItemModel(newIndex); + var layout = getLayout[coord.type](data, newIndex, itemModel); + + if (drawBackground) { + var bgEl = void 0; + + if (oldBgEls.length === 0) { + bgEl = createBackground(oldIndex); + } else { + bgEl = oldBgEls[oldIndex]; + bgEl.useStyle(backgroundModel.getItemStyle()); // Only cartesian2d support borderRadius. - if (!data.hasValue(newIndex) || !isValidLayout[coord.type](layout)) { - group.remove(el); - return; - } + if (coord.type === 'cartesian2d') { + bgEl.setShape('r', barBorderRadius); + } - var isClipped = false; + bgEls[newIndex] = bgEl; + } - if (needsClip) { - isClipped = clip[coord.type](coordSysClipArea, layout); + var bgLayout = getLayout[coord.type](data, newIndex); + var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord); + updateProps(bgEl, { + shape: shape + }, animationModel, newIndex); + } - if (isClipped) { - group.remove(el); - } - } + var el = oldData.getItemGraphicEl(oldIndex); - if (!el) { - el = elementCreator[coord.type](seriesModel, data, newIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, !!el, roundCap); - } else { - saveOldStyle(el); - } + if (!data.hasValue(newIndex) || !isValidLayout[coord.type](layout)) { + group.remove(el); + return; + } - if (realtimeSortCfg) { - el.forceLabelAnimation = true; - } + var isClipped = false; - if (isChangeOrder) { - var textEl = el.getTextContent(); + if (needsClip) { + isClipped = clip[coord.type](coordSysClipArea, layout); - if (textEl) { - var labelInnerStore = labelInner(textEl); + if (isClipped) { + group.remove(el); + } + } - if (labelInnerStore.prevValue != null) { - /** - * Set preValue to be value so that no new label - * should be started, otherwise, it will take a full - * `animationDurationUpdate` time to finish the - * animation, which is not expected. - */ - labelInnerStore.prevValue = labelInnerStore.value; - } - } - } // Not change anything if only order changed. - // Especially not change label. - else { - updateStyle(el, data, newIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar'); - } + if (!el) { + el = elementCreator[coord.type](seriesModel, data, newIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, !!el, roundCap); + } else { + saveOldStyle(el); + } - if (isInitSort) { - el.attr({ - shape: layout - }); - } else if (realtimeSortCfg) { - updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout, newIndex, isHorizontalOrRadial, true, isChangeOrder); - } else { - updateProps(el, { - shape: layout - }, seriesModel, newIndex, null); - } + if (realtimeSortCfg) { + el.forceLabelAnimation = true; + } - data.setItemGraphicEl(newIndex, el); - el.ignore = isClipped; - group.add(el); - }).remove(function (dataIndex) { - var el = oldData.getItemGraphicEl(dataIndex); - el && removeElementWithFadeOut(el, seriesModel, dataIndex); - }).execute(); - var bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group()); - bgGroup.removeAll(); + if (isChangeOrder) { + var textEl = el.getTextContent(); - for (var i = 0; i < bgEls.length; ++i) { - bgGroup.add(bgEls[i]); - } + if (textEl) { + var labelInnerStore = labelInner(textEl); - group.add(bgGroup); - this._backgroundEls = bgEls; - this._data = data; - }; + if (labelInnerStore.prevValue != null) { + /** + * Set preValue to be value so that no new label + * should be started, otherwise, it will take a full + * `animationDurationUpdate` time to finish the + * animation, which is not expected. + */ + labelInnerStore.prevValue = labelInnerStore.value; + } + } + } // Not change anything if only order changed. + // Especially not change label. + else { + updateStyle(el, data, newIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar'); + } - BarView.prototype._renderLarge = function (seriesModel, ecModel, api) { - this._clear(); + if (isInitSort) { + el.attr({ + shape: layout + }); + } else if (realtimeSortCfg) { + updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout, newIndex, isHorizontalOrRadial, true, isChangeOrder); + } else { + updateProps(el, { + shape: layout + }, seriesModel, newIndex, null); + } + + data.setItemGraphicEl(newIndex, el); + el.ignore = isClipped; + group.add(el); + }).remove(function (dataIndex) { + var el = oldData.getItemGraphicEl(dataIndex); + el && removeElementWithFadeOut(el, seriesModel, dataIndex); + }).execute(); + var bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group()); + bgGroup.removeAll(); - createLarge(seriesModel, this.group); + for (var i = 0; i < bgEls.length; ++i) { + bgGroup.add(bgEls[i]); + } - this._updateLargeClip(seriesModel); - }; + group.add(bgGroup); + this._backgroundEls = bgEls; + this._data = data; + }; - BarView.prototype._incrementalRenderLarge = function (params, seriesModel) { - this._removeBackground(); + BarView.prototype._renderLarge = function (seriesModel, ecModel, api) { + this._clear(); - createLarge(seriesModel, this.group, this._progressiveEls, true); - }; + createLarge(seriesModel, this.group); - BarView.prototype._updateLargeClip = function (seriesModel) { - // Use clipPath in large mode. - var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel); - var group = this.group; + this._updateLargeClip(seriesModel); + }; - if (clipPath) { - group.setClipPath(clipPath); - } else { - group.removeClipPath(); - } - }; + BarView.prototype._incrementalRenderLarge = function (params, seriesModel) { + this._removeBackground(); - BarView.prototype._enableRealtimeSort = function (realtimeSortCfg, data, api) { - var _this = this; // If no data in the first frame, wait for data to initSort + createLarge(seriesModel, this.group, this._progressiveEls, true); + }; + BarView.prototype._updateLargeClip = function (seriesModel) { + // Use clipPath in large mode. + var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel); + var group = this.group; - if (!data.count()) { - return; - } + if (clipPath) { + group.setClipPath(clipPath); + } else { + group.removeClipPath(); + } + }; - var baseAxis = realtimeSortCfg.baseAxis; + BarView.prototype._enableRealtimeSort = function (realtimeSortCfg, data, api) { + var _this = this; // If no data in the first frame, wait for data to initSort - if (this._isFirstFrame) { - this._dispatchInitSort(data, realtimeSortCfg, api); - this._isFirstFrame = false; - } else { - var orderMapping_1 = function (idx) { - var el = data.getItemGraphicEl(idx); - var shape = el && el.shape; - return shape && // The result should be consistent with the initial sort by data value. - // Do not support the case that both positive and negative exist. - Math.abs(baseAxis.isHorizontal() ? shape.height : shape.width) // If data is NaN, shape.xxx may be NaN, so use || 0 here in case - || 0; - }; + if (!data.count()) { + return; + } - this._onRendered = function () { - _this._updateSortWithinSameData(data, orderMapping_1, baseAxis, api); - }; + var baseAxis = realtimeSortCfg.baseAxis; - api.getZr().on('rendered', this._onRendered); - } - }; + if (this._isFirstFrame) { + this._dispatchInitSort(data, realtimeSortCfg, api); - BarView.prototype._dataSort = function (data, baseAxis, orderMapping) { - var info = []; - data.each(data.mapDimension(baseAxis.dim), function (ordinalNumber, dataIdx) { - var mappedValue = orderMapping(dataIdx); - mappedValue = mappedValue == null ? NaN : mappedValue; - info.push({ - dataIndex: dataIdx, - mappedValue: mappedValue, - ordinalNumber: ordinalNumber - }); - }); - info.sort(function (a, b) { - // If NaN, it will be treated as min val. - return b.mappedValue - a.mappedValue; - }); - return { - ordinalNumbers: map(info, function (item) { - return item.ordinalNumber; - }) - }; - }; + this._isFirstFrame = false; + } else { + var orderMapping_1 = function (idx) { + var el = data.getItemGraphicEl(idx); + var shape = el && el.shape; + return shape && // The result should be consistent with the initial sort by data value. + // Do not support the case that both positive and negative exist. + Math.abs(baseAxis.isHorizontal() ? shape.height : shape.width) // If data is NaN, shape.xxx may be NaN, so use || 0 here in case + || 0; + }; + + this._onRendered = function () { + _this._updateSortWithinSameData(data, orderMapping_1, baseAxis, api); + }; + + api.getZr().on('rendered', this._onRendered); + } + }; + + BarView.prototype._dataSort = function (data, baseAxis, orderMapping) { + var info = []; + data.each(data.mapDimension(baseAxis.dim), function (ordinalNumber, dataIdx) { + var mappedValue = orderMapping(dataIdx); + mappedValue = mappedValue == null ? NaN : mappedValue; + info.push({ + dataIndex: dataIdx, + mappedValue: mappedValue, + ordinalNumber: ordinalNumber + }); + }); + info.sort(function (a, b) { + // If NaN, it will be treated as min val. + return b.mappedValue - a.mappedValue; + }); + return { + ordinalNumbers: map(info, function (item) { + return item.ordinalNumber; + }) + }; + }; - BarView.prototype._isOrderChangedWithinSameData = function (data, orderMapping, baseAxis) { - var scale = baseAxis.scale; - var ordinalDataDim = data.mapDimension(baseAxis.dim); - var lastValue = Number.MAX_VALUE; + BarView.prototype._isOrderChangedWithinSameData = function (data, orderMapping, baseAxis) { + var scale = baseAxis.scale; + var ordinalDataDim = data.mapDimension(baseAxis.dim); + var lastValue = Number.MAX_VALUE; - for (var tickNum = 0, len = scale.getOrdinalMeta().categories.length; tickNum < len; ++tickNum) { - var rawIdx = data.rawIndexOf(ordinalDataDim, scale.getRawOrdinalNumber(tickNum)); - var value = rawIdx < 0 // If some tick have no bar, the tick will be treated as min. - ? Number.MIN_VALUE // PENDING: if dataZoom on baseAxis exits, is it a performance issue? - : orderMapping(data.indexOfRawIndex(rawIdx)); + for (var tickNum = 0, len = scale.getOrdinalMeta().categories.length; tickNum < len; ++tickNum) { + var rawIdx = data.rawIndexOf(ordinalDataDim, scale.getRawOrdinalNumber(tickNum)); + var value = rawIdx < 0 // If some tick have no bar, the tick will be treated as min. + ? Number.MIN_VALUE // PENDING: if dataZoom on baseAxis exits, is it a performance issue? + : orderMapping(data.indexOfRawIndex(rawIdx)); - if (value > lastValue) { - return true; - } + if (value > lastValue) { + return true; + } - lastValue = value; - } + lastValue = value; + } - return false; - }; - /* + return false; + }; + /* * Consider the case when A and B changed order, whose representing * bars are both out of sight, we don't wish to trigger reorder action * as long as the order in the view doesn't change. */ - BarView.prototype._isOrderDifferentInView = function (orderInfo, baseAxis) { - var scale = baseAxis.scale; - var extent = scale.getExtent(); - var tickNum = Math.max(0, extent[0]); - var tickMax = Math.min(extent[1], scale.getOrdinalMeta().categories.length - 1); + BarView.prototype._isOrderDifferentInView = function (orderInfo, baseAxis) { + var scale = baseAxis.scale; + var extent = scale.getExtent(); + var tickNum = Math.max(0, extent[0]); + var tickMax = Math.min(extent[1], scale.getOrdinalMeta().categories.length - 1); - for (; tickNum <= tickMax; ++tickNum) { - if (orderInfo.ordinalNumbers[tickNum] !== scale.getRawOrdinalNumber(tickNum)) { - return true; - } - } - }; + for (; tickNum <= tickMax; ++tickNum) { + if (orderInfo.ordinalNumbers[tickNum] !== scale.getRawOrdinalNumber(tickNum)) { + return true; + } + } + }; - BarView.prototype._updateSortWithinSameData = function (data, orderMapping, baseAxis, api) { - if (!this._isOrderChangedWithinSameData(data, orderMapping, baseAxis)) { - return; - } + BarView.prototype._updateSortWithinSameData = function (data, orderMapping, baseAxis, api) { + if (!this._isOrderChangedWithinSameData(data, orderMapping, baseAxis)) { + return; + } - var sortInfo = this._dataSort(data, baseAxis, orderMapping); + var sortInfo = this._dataSort(data, baseAxis, orderMapping); - if (this._isOrderDifferentInView(sortInfo, baseAxis)) { - this._removeOnRenderedListener(api); + if (this._isOrderDifferentInView(sortInfo, baseAxis)) { + this._removeOnRenderedListener(api); - api.dispatchAction({ - type: 'changeAxisOrder', - componentType: baseAxis.dim + 'Axis', - axisId: baseAxis.index, - sortInfo: sortInfo - }); - } - }; + api.dispatchAction({ + type: 'changeAxisOrder', + componentType: baseAxis.dim + 'Axis', + axisId: baseAxis.index, + sortInfo: sortInfo + }); + } + }; - BarView.prototype._dispatchInitSort = function (data, realtimeSortCfg, api) { - var baseAxis = realtimeSortCfg.baseAxis; + BarView.prototype._dispatchInitSort = function (data, realtimeSortCfg, api) { + var baseAxis = realtimeSortCfg.baseAxis; - var sortResult = this._dataSort(data, baseAxis, function (dataIdx) { - return data.get(data.mapDimension(realtimeSortCfg.otherAxis.dim), dataIdx); - }); + var sortResult = this._dataSort(data, baseAxis, function (dataIdx) { + return data.get(data.mapDimension(realtimeSortCfg.otherAxis.dim), dataIdx); + }); - api.dispatchAction({ - type: 'changeAxisOrder', - componentType: baseAxis.dim + 'Axis', - isInitSort: true, - axisId: baseAxis.index, - sortInfo: sortResult - }); - }; + api.dispatchAction({ + type: 'changeAxisOrder', + componentType: baseAxis.dim + 'Axis', + isInitSort: true, + axisId: baseAxis.index, + sortInfo: sortResult + }); + }; - BarView.prototype.remove = function (ecModel, api) { - this._clear(this._model); + BarView.prototype.remove = function (ecModel, api) { + this._clear(this._model); - this._removeOnRenderedListener(api); - }; + this._removeOnRenderedListener(api); + }; - BarView.prototype.dispose = function (ecModel, api) { - this._removeOnRenderedListener(api); - }; + BarView.prototype.dispose = function (ecModel, api) { + this._removeOnRenderedListener(api); + }; - BarView.prototype._removeOnRenderedListener = function (api) { - if (this._onRendered) { - api.getZr().off('rendered', this._onRendered); - this._onRendered = null; - } - }; + BarView.prototype._removeOnRenderedListener = function (api) { + if (this._onRendered) { + api.getZr().off('rendered', this._onRendered); + this._onRendered = null; + } + }; - BarView.prototype._clear = function (model) { - var group = this.group; - var data = this._data; + BarView.prototype._clear = function (model) { + var group = this.group; + var data = this._data; - if (model && model.isAnimationEnabled() && data && !this._isLargeDraw) { - this._removeBackground(); + if (model && model.isAnimationEnabled() && data && !this._isLargeDraw) { + this._removeBackground(); - this._backgroundEls = []; - data.eachItemGraphicEl(function (el) { - removeElementWithFadeOut(el, model, getECData(el).dataIndex); - }); - } else { - group.removeAll(); - } + this._backgroundEls = []; + data.eachItemGraphicEl(function (el) { + removeElementWithFadeOut(el, model, getECData(el).dataIndex); + }); + } else { + group.removeAll(); + } - this._data = null; - this._isFirstFrame = true; - }; + this._data = null; + this._isFirstFrame = true; + }; - BarView.prototype._removeBackground = function () { - this.group.remove(this._backgroundGroup); - this._backgroundGroup = null; - }; + BarView.prototype._removeBackground = function () { + this.group.remove(this._backgroundGroup); + this._backgroundGroup = null; + }; - BarView.type = 'bar'; - return BarView; - }(ChartView); + BarView.type = 'bar'; + return BarView; + }(ChartView); var clip = { - cartesian2d: function (coordSysBoundingRect, layout) { - var signWidth = layout.width < 0 ? -1 : 1; - var signHeight = layout.height < 0 ? -1 : 1; // Needs positive width and height - - if (signWidth < 0) { - layout.x += layout.width; - layout.width = -layout.width; - } + cartesian2d: function (coordSysBoundingRect, layout) { + var signWidth = layout.width < 0 ? -1 : 1; + var signHeight = layout.height < 0 ? -1 : 1; // Needs positive width and height - if (signHeight < 0) { - layout.y += layout.height; - layout.height = -layout.height; - } + if (signWidth < 0) { + layout.x += layout.width; + layout.width = -layout.width; + } - var coordSysX2 = coordSysBoundingRect.x + coordSysBoundingRect.width; - var coordSysY2 = coordSysBoundingRect.y + coordSysBoundingRect.height; - var x = mathMax$6(layout.x, coordSysBoundingRect.x); - var x2 = mathMin$6(layout.x + layout.width, coordSysX2); - var y = mathMax$6(layout.y, coordSysBoundingRect.y); - var y2 = mathMin$6(layout.y + layout.height, coordSysY2); - var xClipped = x2 < x; - var yClipped = y2 < y; // When xClipped or yClipped, the element will be marked as `ignore`. - // But we should also place the element at the edge of the coord sys bounding rect. - // Beause if data changed and the bar show again, its transition animaiton - // will begin at this place. + if (signHeight < 0) { + layout.y += layout.height; + layout.height = -layout.height; + } - layout.x = xClipped && x > coordSysX2 ? x2 : x; - layout.y = yClipped && y > coordSysY2 ? y2 : y; - layout.width = xClipped ? 0 : x2 - x; - layout.height = yClipped ? 0 : y2 - y; // Reverse back + var coordSysX2 = coordSysBoundingRect.x + coordSysBoundingRect.width; + var coordSysY2 = coordSysBoundingRect.y + coordSysBoundingRect.height; + var x = mathMax$6(layout.x, coordSysBoundingRect.x); + var x2 = mathMin$6(layout.x + layout.width, coordSysX2); + var y = mathMax$6(layout.y, coordSysBoundingRect.y); + var y2 = mathMin$6(layout.y + layout.height, coordSysY2); + var xClipped = x2 < x; + var yClipped = y2 < y; // When xClipped or yClipped, the element will be marked as `ignore`. + // But we should also place the element at the edge of the coord sys bounding rect. + // Beause if data changed and the bar show again, its transition animaiton + // will begin at this place. - if (signWidth < 0) { - layout.x += layout.width; - layout.width = -layout.width; - } + layout.x = xClipped && x > coordSysX2 ? x2 : x; + layout.y = yClipped && y > coordSysY2 ? y2 : y; + layout.width = xClipped ? 0 : x2 - x; + layout.height = yClipped ? 0 : y2 - y; // Reverse back - if (signHeight < 0) { - layout.y += layout.height; - layout.height = -layout.height; - } + if (signWidth < 0) { + layout.x += layout.width; + layout.width = -layout.width; + } - return xClipped || yClipped; - }, - polar: function (coordSysClipArea, layout) { - var signR = layout.r0 <= layout.r ? 1 : -1; // Make sure r is larger than r0 + if (signHeight < 0) { + layout.y += layout.height; + layout.height = -layout.height; + } - if (signR < 0) { - var tmp = layout.r; - layout.r = layout.r0; - layout.r0 = tmp; - } + return xClipped || yClipped; + }, + polar: function (coordSysClipArea, layout) { + var signR = layout.r0 <= layout.r ? 1 : -1; // Make sure r is larger than r0 - var r = mathMin$6(layout.r, coordSysClipArea.r); - var r0 = mathMax$6(layout.r0, coordSysClipArea.r0); - layout.r = r; - layout.r0 = r0; - var clipped = r - r0 < 0; // Reverse back + if (signR < 0) { + var tmp = layout.r; + layout.r = layout.r0; + layout.r0 = tmp; + } - if (signR < 0) { - var tmp = layout.r; - layout.r = layout.r0; - layout.r0 = tmp; - } + var r = mathMin$6(layout.r, coordSysClipArea.r); + var r0 = mathMax$6(layout.r0, coordSysClipArea.r0); + layout.r = r; + layout.r0 = r0; + var clipped = r - r0 < 0; // Reverse back - return clipped; + if (signR < 0) { + var tmp = layout.r; + layout.r = layout.r0; + layout.r0 = tmp; } + + return clipped; + } }; var elementCreator = { - cartesian2d: function (seriesModel, data, newIndex, layout, isHorizontal, animationModel, axisModel, isUpdate, roundCap) { - var rect = new Rect({ - shape: extend({}, layout), - z2: 1 - }); - rect.__dataIndex = newIndex; - rect.name = 'item'; - - if (animationModel) { - var rectShape = rect.shape; - var animateProperty = isHorizontal ? 'height' : 'width'; - rectShape[animateProperty] = 0; - } - - return rect; - }, - polar: function (seriesModel, data, newIndex, layout, isRadial, animationModel, axisModel, isUpdate, roundCap) { - var ShapeClass = !isRadial && roundCap ? SausagePath : Sector; - var sector = new ShapeClass({ - shape: layout, - z2: 1 - }); - sector.name = 'item'; - var positionMap = createPolarPositionMapping(isRadial); - sector.calculateTextPosition = createSectorCalculateTextPosition(positionMap, { - isRoundCap: ShapeClass === SausagePath - }); // Animation - - if (animationModel) { - var sectorShape = sector.shape; - var animateProperty = isRadial ? 'r' : 'endAngle'; - var animateTarget = {}; - sectorShape[animateProperty] = isRadial ? 0 : layout.startAngle; - animateTarget[animateProperty] = layout[animateProperty]; - (isUpdate ? updateProps : initProps)(sector, { - shape: animateTarget // __value: typeof dataValue === 'string' ? parseInt(dataValue, 10) : dataValue - - }, animationModel); - } + cartesian2d: function (seriesModel, data, newIndex, layout, isHorizontal, animationModel, axisModel, isUpdate, roundCap) { + var rect = new Rect({ + shape: extend({}, layout), + z2: 1 + }); + rect.__dataIndex = newIndex; + rect.name = 'item'; - return sector; + if (animationModel) { + var rectShape = rect.shape; + var animateProperty = isHorizontal ? 'height' : 'width'; + rectShape[animateProperty] = 0; } + + return rect; + }, + polar: function (seriesModel, data, newIndex, layout, isRadial, animationModel, axisModel, isUpdate, roundCap) { + var ShapeClass = !isRadial && roundCap ? SausagePath : Sector; + var sector = new ShapeClass({ + shape: layout, + z2: 1 + }); + sector.name = 'item'; + var positionMap = createPolarPositionMapping(isRadial); + sector.calculateTextPosition = createSectorCalculateTextPosition(positionMap, { + isRoundCap: ShapeClass === SausagePath + }); // Animation + + if (animationModel) { + var sectorShape = sector.shape; + var animateProperty = isRadial ? 'r' : 'endAngle'; + var animateTarget = {}; + sectorShape[animateProperty] = isRadial ? 0 : layout.startAngle; + animateTarget[animateProperty] = layout[animateProperty]; + (isUpdate ? updateProps : initProps)(sector, { + shape: animateTarget // __value: typeof dataValue === 'string' ? parseInt(dataValue, 10) : dataValue + + }, animationModel); + } + + return sector; + } }; function shouldRealtimeSort(seriesModel, coordSys) { - var realtimeSortOption = seriesModel.get('realtimeSort', true); - var baseAxis = coordSys.getBaseAxis(); + var realtimeSortOption = seriesModel.get('realtimeSort', true); + var baseAxis = coordSys.getBaseAxis(); - if ("development" !== 'production') { - if (realtimeSortOption) { - if (baseAxis.type !== 'category') { - warn('`realtimeSort` will not work because this bar series is not based on a category axis.'); - } + if ("development" !== 'production') { + if (realtimeSortOption) { + if (baseAxis.type !== 'category') { + warn('`realtimeSort` will not work because this bar series is not based on a category axis.'); + } - if (coordSys.type !== 'cartesian2d') { - warn('`realtimeSort` will not work because this bar series is not on cartesian2d.'); - } - } + if (coordSys.type !== 'cartesian2d') { + warn('`realtimeSort` will not work because this bar series is not on cartesian2d.'); + } } + } - if (realtimeSortOption && baseAxis.type === 'category' && coordSys.type === 'cartesian2d') { - return { - baseAxis: baseAxis, - otherAxis: coordSys.getOtherAxis(baseAxis) - }; - } + if (realtimeSortOption && baseAxis.type === 'category' && coordSys.type === 'cartesian2d') { + return { + baseAxis: baseAxis, + otherAxis: coordSys.getOtherAxis(baseAxis) + }; + } } function updateRealtimeAnimation(realtimeSortCfg, seriesAnimationModel, el, layout, newIndex, isHorizontal, isUpdate, isChangeOrder) { - var seriesTarget; - var axisTarget; - - if (isHorizontal) { - axisTarget = { - x: layout.x, - width: layout.width - }; - seriesTarget = { - y: layout.y, - height: layout.height - }; - } else { - axisTarget = { - y: layout.y, - height: layout.height - }; - seriesTarget = { - x: layout.x, - width: layout.width - }; - } + var seriesTarget; + var axisTarget; - if (!isChangeOrder) { - // Keep the original growth animation if only axis order changed. - // Not start a new animation. - (isUpdate ? updateProps : initProps)(el, { - shape: seriesTarget - }, seriesAnimationModel, newIndex, null); - } + if (isHorizontal) { + axisTarget = { + x: layout.x, + width: layout.width + }; + seriesTarget = { + y: layout.y, + height: layout.height + }; + } else { + axisTarget = { + y: layout.y, + height: layout.height + }; + seriesTarget = { + x: layout.x, + width: layout.width + }; + } - var axisAnimationModel = seriesAnimationModel ? realtimeSortCfg.baseAxis.model : null; + if (!isChangeOrder) { + // Keep the original growth animation if only axis order changed. + // Not start a new animation. (isUpdate ? updateProps : initProps)(el, { - shape: axisTarget - }, axisAnimationModel, newIndex); + shape: seriesTarget + }, seriesAnimationModel, newIndex, null); + } + + var axisAnimationModel = seriesAnimationModel ? realtimeSortCfg.baseAxis.model : null; + (isUpdate ? updateProps : initProps)(el, { + shape: axisTarget + }, axisAnimationModel, newIndex); } function checkPropertiesNotValid(obj, props) { - for (var i = 0; i < props.length; i++) { - if (!isFinite(obj[props[i]])) { - return true; - } + for (var i = 0; i < props.length; i++) { + if (!isFinite(obj[props[i]])) { + return true; } + } - return false; + return false; } var rectPropties = ['x', 'y', 'width', 'height']; var polarPropties = ['cx', 'cy', 'r', 'startAngle', 'endAngle']; var isValidLayout = { - cartesian2d: function (layout) { - return !checkPropertiesNotValid(layout, rectPropties); - }, - polar: function (layout) { - return !checkPropertiesNotValid(layout, polarPropties); - } + cartesian2d: function (layout) { + return !checkPropertiesNotValid(layout, rectPropties); + }, + polar: function (layout) { + return !checkPropertiesNotValid(layout, polarPropties); + } }; var getLayout = { - // itemModel is only used to get borderWidth, which is not needed - // when calculating bar background layout. - cartesian2d: function (data, dataIndex, itemModel) { - var layout = data.getItemLayout(dataIndex); - var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0; // fix layout with lineWidth - - var signX = layout.width > 0 ? 1 : -1; - var signY = layout.height > 0 ? 1 : -1; - return { - x: layout.x + signX * fixedLineWidth / 2, - y: layout.y + signY * fixedLineWidth / 2, - width: layout.width - signX * fixedLineWidth, - height: layout.height - signY * fixedLineWidth - }; - }, - polar: function (data, dataIndex, itemModel) { - var layout = data.getItemLayout(dataIndex); - return { - cx: layout.cx, - cy: layout.cy, - r0: layout.r0, - r: layout.r, - startAngle: layout.startAngle, - endAngle: layout.endAngle, - clockwise: layout.clockwise - }; - } + // itemModel is only used to get borderWidth, which is not needed + // when calculating bar background layout. + cartesian2d: function (data, dataIndex, itemModel) { + var layout = data.getItemLayout(dataIndex); + var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0; // fix layout with lineWidth + + var signX = layout.width > 0 ? 1 : -1; + var signY = layout.height > 0 ? 1 : -1; + return { + x: layout.x + signX * fixedLineWidth / 2, + y: layout.y + signY * fixedLineWidth / 2, + width: layout.width - signX * fixedLineWidth, + height: layout.height - signY * fixedLineWidth + }; + }, + polar: function (data, dataIndex, itemModel) { + var layout = data.getItemLayout(dataIndex); + return { + cx: layout.cx, + cy: layout.cy, + r0: layout.r0, + r: layout.r, + startAngle: layout.startAngle, + endAngle: layout.endAngle, + clockwise: layout.clockwise + }; + } }; function isZeroOnPolar(layout) { - return layout.startAngle != null && layout.endAngle != null && layout.startAngle === layout.endAngle; + return layout.startAngle != null && layout.endAngle != null && layout.startAngle === layout.endAngle; } function createPolarPositionMapping(isRadial) { - return function (isRadial) { - var arcOrAngle = isRadial ? 'Arc' : 'Angle'; - return function (position) { - switch (position) { - case 'start': - case 'insideStart': - case 'end': - case 'insideEnd': - return position + arcOrAngle; - - default: - return position; - } - }; - }(isRadial); + return function (isRadial) { + var arcOrAngle = isRadial ? 'Arc' : 'Angle'; + return function (position) { + switch (position) { + case 'start': + case 'insideStart': + case 'end': + case 'insideEnd': + return position + arcOrAngle; + + default: + return position; + } + }; + }(isRadial); } function updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, isPolar) { - var style = data.getItemVisual(dataIndex, 'style'); - - if (!isPolar) { - el.setShape('r', itemModel.get(['itemStyle', 'borderRadius']) || 0); - } - - el.useStyle(style); - var cursorStyle = itemModel.getShallow('cursor'); - cursorStyle && el.attr('cursor', cursorStyle); - var labelPositionOutside = isPolar ? isHorizontalOrRadial ? layout.r >= layout.r0 ? 'endArc' : 'startArc' : layout.endAngle >= layout.startAngle ? 'endAngle' : 'startAngle' : isHorizontalOrRadial ? layout.height >= 0 ? 'bottom' : 'top' : layout.width >= 0 ? 'right' : 'left'; - var labelStatesModels = getLabelStatesModels(itemModel); - setLabelStyle(el, labelStatesModels, { - labelFetcher: seriesModel, - labelDataIndex: dataIndex, - defaultText: getDefaultLabel(seriesModel.getData(), dataIndex), - inheritColor: style.fill, - defaultOpacity: style.opacity, - defaultOutsidePosition: labelPositionOutside - }); - var label = el.getTextContent(); - - if (isPolar && label) { - var position = itemModel.get(['label', 'position']); - el.textConfig.inside = position === 'middle' ? true : null; - setSectorTextRotation(el, position === 'outside' ? labelPositionOutside : position, createPolarPositionMapping(isHorizontalOrRadial), itemModel.get(['label', 'rotate'])); - } - - setLabelValueAnimation(label, labelStatesModels, seriesModel.getRawValue(dataIndex), function (value) { - return getDefaultInterpolatedLabel(data, value); + var style = data.getItemVisual(dataIndex, 'style'); + + if (!isPolar) { + el.setShape('r', itemModel.get(['itemStyle', 'borderRadius']) || 0); + } + + el.useStyle(style); + var cursorStyle = itemModel.getShallow('cursor'); + cursorStyle && el.attr('cursor', cursorStyle); + var labelPositionOutside = isPolar ? isHorizontalOrRadial ? layout.r >= layout.r0 ? 'endArc' : 'startArc' : layout.endAngle >= layout.startAngle ? 'endAngle' : 'startAngle' : isHorizontalOrRadial ? layout.height >= 0 ? 'bottom' : 'top' : layout.width >= 0 ? 'right' : 'left'; + var labelStatesModels = getLabelStatesModels(itemModel); + setLabelStyle(el, labelStatesModels, { + labelFetcher: seriesModel, + labelDataIndex: dataIndex, + defaultText: getDefaultLabel(seriesModel.getData(), dataIndex), + inheritColor: style.fill, + defaultOpacity: style.opacity, + defaultOutsidePosition: labelPositionOutside + }); + var label = el.getTextContent(); + + if (isPolar && label) { + var position = itemModel.get(['label', 'position']); + el.textConfig.inside = position === 'middle' ? true : null; + setSectorTextRotation(el, position === 'outside' ? labelPositionOutside : position, createPolarPositionMapping(isHorizontalOrRadial), itemModel.get(['label', 'rotate'])); + } + + setLabelValueAnimation(label, labelStatesModels, seriesModel.getRawValue(dataIndex), function (value) { + return getDefaultInterpolatedLabel(data, value); + }); + var emphasisModel = itemModel.getModel(['emphasis']); + toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); + setStatesStylesFromModel(el, itemModel); + + if (isZeroOnPolar(layout)) { + el.style.fill = 'none'; + el.style.stroke = 'none'; + each(el.states, function (state) { + if (state.style) { + state.style.fill = state.style.stroke = 'none'; + } }); - var emphasisModel = itemModel.getModel(['emphasis']); - toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - setStatesStylesFromModel(el, itemModel); - - if (isZeroOnPolar(layout)) { - el.style.fill = 'none'; - el.style.stroke = 'none'; - each(el.states, function (state) { - if (state.style) { - state.style.fill = state.style.stroke = 'none'; - } - }); - } + } } // In case width or height are too small. function getLineWidth(itemModel, rawLayout) { - // Has no border. - var borderColor = itemModel.get(['itemStyle', 'borderColor']); + // Has no border. + var borderColor = itemModel.get(['itemStyle', 'borderColor']); - if (!borderColor || borderColor === 'none') { - return 0; - } + if (!borderColor || borderColor === 'none') { + return 0; + } - var lineWidth = itemModel.get(['itemStyle', 'borderWidth']) || 0; // width or height may be NaN for empty data + var lineWidth = itemModel.get(['itemStyle', 'borderWidth']) || 0; // width or height may be NaN for empty data - var width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width); - var height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height); - return Math.min(lineWidth, width, height); + var width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width); + var height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height); + return Math.min(lineWidth, width, height); } var LagePathShape = - /** @class */ - function () { - function LagePathShape() {} + /** @class */ + function () { + function LagePathShape() {} - return LagePathShape; - }(); + return LagePathShape; + }(); var LargePath = - /** @class */ - function (_super) { - __extends(LargePath, _super); - - function LargePath(opts) { - var _this = _super.call(this, opts) || this; - - _this.type = 'largeBar'; - return _this; - } + /** @class */ + function (_super) { + __extends(LargePath, _super); - LargePath.prototype.getDefaultShape = function () { - return new LagePathShape(); - }; + function LargePath(opts) { + var _this = _super.call(this, opts) || this; - LargePath.prototype.buildPath = function (ctx, shape) { - // Drawing lines is more efficient than drawing - // a whole line or drawing rects. - var points = shape.points; - var baseDimIdx = this.baseDimIdx; - var valueDimIdx = 1 - this.baseDimIdx; - var startPoint = []; - var size = []; - var barWidth = this.barWidth; - - for (var i = 0; i < points.length; i += 3) { - size[baseDimIdx] = barWidth; - size[valueDimIdx] = points[i + 2]; - startPoint[baseDimIdx] = points[i + baseDimIdx]; - startPoint[valueDimIdx] = points[i + valueDimIdx]; - ctx.rect(startPoint[0], startPoint[1], size[0], size[1]); - } - }; + _this.type = 'largeBar'; + return _this; + } - return LargePath; - }(Path); + LargePath.prototype.getDefaultShape = function () { + return new LagePathShape(); + }; - function createLarge(seriesModel, group, progressiveEls, incremental) { - // TODO support polar - var data = seriesModel.getData(); - var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0; - var largeDataIndices = data.getLayout('largeDataIndices'); - var barWidth = data.getLayout('size'); - var backgroundModel = seriesModel.getModel('backgroundStyle'); - var bgPoints = data.getLayout('largeBackgroundPoints'); + LargePath.prototype.buildPath = function (ctx, shape) { + // Drawing lines is more efficient than drawing + // a whole line or drawing rects. + var points = shape.points; + var baseDimIdx = this.baseDimIdx; + var valueDimIdx = 1 - this.baseDimIdx; + var startPoint = []; + var size = []; + var barWidth = this.barWidth; - if (bgPoints) { - var bgEl = new LargePath({ - shape: { - points: bgPoints - }, - incremental: !!incremental, - silent: true, - z2: 0 - }); - bgEl.baseDimIdx = baseDimIdx; - bgEl.largeDataIndices = largeDataIndices; - bgEl.barWidth = barWidth; - bgEl.useStyle(backgroundModel.getItemStyle()); - group.add(bgEl); - progressiveEls && progressiveEls.push(bgEl); + for (var i = 0; i < points.length; i += 3) { + size[baseDimIdx] = barWidth; + size[valueDimIdx] = points[i + 2]; + startPoint[baseDimIdx] = points[i + baseDimIdx]; + startPoint[valueDimIdx] = points[i + valueDimIdx]; + ctx.rect(startPoint[0], startPoint[1], size[0], size[1]); } + }; - var el = new LargePath({ - shape: { - points: data.getLayout('largePoints') - }, - incremental: !!incremental, - z2: 1 - }); - el.baseDimIdx = baseDimIdx; - el.largeDataIndices = largeDataIndices; - el.barWidth = barWidth; - group.add(el); - el.useStyle(data.getVisual('style')); // Enable tooltip and user mouse/touch event handlers. - - getECData(el).seriesIndex = seriesModel.seriesIndex; - - if (!seriesModel.get('silent')) { - el.on('mousedown', largePathUpdateDataIndex); - el.on('mousemove', largePathUpdateDataIndex); - } + return LargePath; + }(Path); - progressiveEls && progressiveEls.push(el); + function createLarge(seriesModel, group, progressiveEls, incremental) { + // TODO support polar + var data = seriesModel.getData(); + var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0; + var largeDataIndices = data.getLayout('largeDataIndices'); + var barWidth = data.getLayout('size'); + var backgroundModel = seriesModel.getModel('backgroundStyle'); + var bgPoints = data.getLayout('largeBackgroundPoints'); + + if (bgPoints) { + var bgEl = new LargePath({ + shape: { + points: bgPoints + }, + incremental: !!incremental, + silent: true, + z2: 0 + }); + bgEl.baseDimIdx = baseDimIdx; + bgEl.largeDataIndices = largeDataIndices; + bgEl.barWidth = barWidth; + bgEl.useStyle(backgroundModel.getItemStyle()); + group.add(bgEl); + progressiveEls && progressiveEls.push(bgEl); + } + + var el = new LargePath({ + shape: { + points: data.getLayout('largePoints') + }, + incremental: !!incremental, + z2: 1 + }); + el.baseDimIdx = baseDimIdx; + el.largeDataIndices = largeDataIndices; + el.barWidth = barWidth; + group.add(el); + el.useStyle(data.getVisual('style')); // Enable tooltip and user mouse/touch event handlers. + + getECData(el).seriesIndex = seriesModel.seriesIndex; + + if (!seriesModel.get('silent')) { + el.on('mousedown', largePathUpdateDataIndex); + el.on('mousemove', largePathUpdateDataIndex); + } + + progressiveEls && progressiveEls.push(el); } // Use throttle to avoid frequently traverse to find dataIndex. var largePathUpdateDataIndex = throttle(function (event) { - var largePath = this; - var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY); - getECData(largePath).dataIndex = dataIndex >= 0 ? dataIndex : null; + var largePath = this; + var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY); + getECData(largePath).dataIndex = dataIndex >= 0 ? dataIndex : null; }, 30, false); function largePathFindDataIndex(largePath, x, y) { - var baseDimIdx = largePath.baseDimIdx; - var valueDimIdx = 1 - baseDimIdx; - var points = largePath.shape.points; - var largeDataIndices = largePath.largeDataIndices; - var startPoint = []; - var size = []; - var barWidth = largePath.barWidth; + var baseDimIdx = largePath.baseDimIdx; + var valueDimIdx = 1 - baseDimIdx; + var points = largePath.shape.points; + var largeDataIndices = largePath.largeDataIndices; + var startPoint = []; + var size = []; + var barWidth = largePath.barWidth; - for (var i = 0, len = points.length / 3; i < len; i++) { - var ii = i * 3; - size[baseDimIdx] = barWidth; - size[valueDimIdx] = points[ii + 2]; - startPoint[baseDimIdx] = points[ii + baseDimIdx]; - startPoint[valueDimIdx] = points[ii + valueDimIdx]; + for (var i = 0, len = points.length / 3; i < len; i++) { + var ii = i * 3; + size[baseDimIdx] = barWidth; + size[valueDimIdx] = points[ii + 2]; + startPoint[baseDimIdx] = points[ii + baseDimIdx]; + startPoint[valueDimIdx] = points[ii + valueDimIdx]; - if (size[valueDimIdx] < 0) { - startPoint[valueDimIdx] += size[valueDimIdx]; - size[valueDimIdx] = -size[valueDimIdx]; - } + if (size[valueDimIdx] < 0) { + startPoint[valueDimIdx] += size[valueDimIdx]; + size[valueDimIdx] = -size[valueDimIdx]; + } - if (x >= startPoint[0] && x <= startPoint[0] + size[0] && y >= startPoint[1] && y <= startPoint[1] + size[1]) { - return largeDataIndices[i]; - } + if (x >= startPoint[0] && x <= startPoint[0] + size[0] && y >= startPoint[1] && y <= startPoint[1] + size[1]) { + return largeDataIndices[i]; } + } - return -1; + return -1; } function createBackgroundShape(isHorizontalOrRadial, layout, coord) { - if (isCoordinateSystemType(coord, 'cartesian2d')) { - var rectShape = layout; - var coordLayout = coord.getArea(); - return { - x: isHorizontalOrRadial ? rectShape.x : coordLayout.x, - y: isHorizontalOrRadial ? coordLayout.y : rectShape.y, - width: isHorizontalOrRadial ? rectShape.width : coordLayout.width, - height: isHorizontalOrRadial ? coordLayout.height : rectShape.height - }; - } else { - var coordLayout = coord.getArea(); - var sectorShape = layout; - return { - cx: coordLayout.cx, - cy: coordLayout.cy, - r0: isHorizontalOrRadial ? coordLayout.r0 : sectorShape.r0, - r: isHorizontalOrRadial ? coordLayout.r : sectorShape.r, - startAngle: isHorizontalOrRadial ? sectorShape.startAngle : 0, - endAngle: isHorizontalOrRadial ? sectorShape.endAngle : Math.PI * 2 - }; - } + if (isCoordinateSystemType(coord, 'cartesian2d')) { + var rectShape = layout; + var coordLayout = coord.getArea(); + return { + x: isHorizontalOrRadial ? rectShape.x : coordLayout.x, + y: isHorizontalOrRadial ? coordLayout.y : rectShape.y, + width: isHorizontalOrRadial ? rectShape.width : coordLayout.width, + height: isHorizontalOrRadial ? coordLayout.height : rectShape.height + }; + } else { + var coordLayout = coord.getArea(); + var sectorShape = layout; + return { + cx: coordLayout.cx, + cy: coordLayout.cy, + r0: isHorizontalOrRadial ? coordLayout.r0 : sectorShape.r0, + r: isHorizontalOrRadial ? coordLayout.r : sectorShape.r, + startAngle: isHorizontalOrRadial ? sectorShape.startAngle : 0, + endAngle: isHorizontalOrRadial ? sectorShape.endAngle : Math.PI * 2 + }; + } } function createBackgroundEl(coord, isHorizontalOrRadial, layout) { - var ElementClz = coord.type === 'polar' ? Sector : Rect; - return new ElementClz({ - shape: createBackgroundShape(isHorizontalOrRadial, layout, coord), - silent: true, - z2: 0 - }); + var ElementClz = coord.type === 'polar' ? Sector : Rect; + return new ElementClz({ + shape: createBackgroundShape(isHorizontalOrRadial, layout, coord), + silent: true, + z2: 0 + }); } function install$3(registers) { - registers.registerChartView(BarView); - registers.registerSeriesModel(BarSeriesModel); - registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, curry(layout, 'bar')); // Do layout after other overall layout, which can preapre some informations. - - registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout('bar')); // Down sample after filter - - registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample('bar')); - /** - * @payload - * @property {string} [componentType=series] - * @property {number} [dx] - * @property {number} [dy] - * @property {number} [zoom] - * @property {number} [originX] - * @property {number} [originY] - */ + registers.registerChartView(BarView); + registers.registerSeriesModel(BarSeriesModel); + registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, curry(layout, 'bar')); // Do layout after other overall layout, which can preapre some informations. + + registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout('bar')); // Down sample after filter + + registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample('bar')); + /** + * @payload + * @property {string} [componentType=series] + * @property {number} [dx] + * @property {number} [dy] + * @property {number} [zoom] + * @property {number} [originX] + * @property {number} [originY] + */ - registers.registerAction({ - type: 'changeAxisOrder', - event: 'changeAxisOrder', - update: 'update' - }, function (payload, ecModel) { - var componentType = payload.componentType || 'series'; - ecModel.eachComponent({ - mainType: componentType, - query: payload - }, function (componentModel) { - if (payload.sortInfo) { - componentModel.axis.setCategorySortInfo(payload.sortInfo); - } - }); + registers.registerAction({ + type: 'changeAxisOrder', + event: 'changeAxisOrder', + update: 'update' + }, function (payload, ecModel) { + var componentType = payload.componentType || 'series'; + ecModel.eachComponent({ + mainType: componentType, + query: payload + }, function (componentModel) { + if (payload.sortInfo) { + componentModel.axis.setCategorySortInfo(payload.sortInfo); + } }); + }); } var PI2$8 = Math.PI * 2; var RADIAN = Math.PI / 180; function getViewRect(seriesModel, api) { - return getLayoutRect(seriesModel.getBoxLayoutParams(), { - width: api.getWidth(), - height: api.getHeight() - }); + return getLayoutRect(seriesModel.getBoxLayoutParams(), { + width: api.getWidth(), + height: api.getHeight() + }); } function getBasicPieLayout(seriesModel, api) { + var viewRect = getViewRect(seriesModel, api); + var center = seriesModel.get('center'); + var radius = seriesModel.get('radius'); + + if (!isArray(radius)) { + radius = [0, radius]; + } + + if (!isArray(center)) { + center = [center, center]; + } + + var width = parsePercent$1(viewRect.width, api.getWidth()); + var height = parsePercent$1(viewRect.height, api.getHeight()); + var size = Math.min(width, height); + var cx = parsePercent$1(center[0], width) + viewRect.x; + var cy = parsePercent$1(center[1], height) + viewRect.y; + var r0 = parsePercent$1(radius[0], size / 2); + var r = parsePercent$1(radius[1], size / 2); + return { + cx: cx, + cy: cy, + r0: r0, + r: r + }; + } + function pieLayout(seriesType, ecModel, api) { + ecModel.eachSeriesByType(seriesType, function (seriesModel) { + var data = seriesModel.getData(); + var valueDim = data.mapDimension('value'); var viewRect = getViewRect(seriesModel, api); - var center = seriesModel.get('center'); - var radius = seriesModel.get('radius'); - - if (!isArray(radius)) { - radius = [0, radius]; - } - - if (!isArray(center)) { - center = [center, center]; - } - var width = parsePercent$1(viewRect.width, api.getWidth()); - var height = parsePercent$1(viewRect.height, api.getHeight()); - var size = Math.min(width, height); - var cx = parsePercent$1(center[0], width) + viewRect.x; - var cy = parsePercent$1(center[1], height) + viewRect.y; - var r0 = parsePercent$1(radius[0], size / 2); - var r = parsePercent$1(radius[1], size / 2); - return { + var _a = getBasicPieLayout(seriesModel, api), + cx = _a.cx, + cy = _a.cy, + r = _a.r, + r0 = _a.r0; + + var startAngle = -seriesModel.get('startAngle') * RADIAN; + var minAngle = seriesModel.get('minAngle') * RADIAN; + var validDataCount = 0; + data.each(valueDim, function (value) { + !isNaN(value) && validDataCount++; + }); + var sum = data.getSum(valueDim); // Sum may be 0 + + var unitRadian = Math.PI / (sum || validDataCount) * 2; + var clockwise = seriesModel.get('clockwise'); + var roseType = seriesModel.get('roseType'); + var stillShowZeroSum = seriesModel.get('stillShowZeroSum'); // [0...max] + + var extent = data.getDataExtent(valueDim); + extent[0] = 0; // In the case some sector angle is smaller than minAngle + + var restAngle = PI2$8; + var valueSumLargerThanMinAngle = 0; + var currentAngle = startAngle; + var dir = clockwise ? 1 : -1; + data.setLayout({ + viewRect: viewRect, + r: r + }); + data.each(valueDim, function (value, idx) { + var angle; + + if (isNaN(value)) { + data.setItemLayout(idx, { + angle: NaN, + startAngle: NaN, + endAngle: NaN, + clockwise: clockwise, + cx: cx, + cy: cy, + r0: r0, + r: roseType ? NaN : r + }); + return; + } // FIXME 兼容 2.0 但是 roseType 是 area 的时候才是这样? + + + if (roseType !== 'area') { + angle = sum === 0 && stillShowZeroSum ? unitRadian : value * unitRadian; + } else { + angle = PI2$8 / validDataCount; + } + + if (angle < minAngle) { + angle = minAngle; + restAngle -= minAngle; + } else { + valueSumLargerThanMinAngle += value; + } + + var endAngle = currentAngle + dir * angle; + data.setItemLayout(idx, { + angle: angle, + startAngle: currentAngle, + endAngle: endAngle, + clockwise: clockwise, cx: cx, cy: cy, r0: r0, - r: r - }; - } - function pieLayout(seriesType, ecModel, api) { - ecModel.eachSeriesByType(seriesType, function (seriesModel) { - var data = seriesModel.getData(); - var valueDim = data.mapDimension('value'); - var viewRect = getViewRect(seriesModel, api); - - var _a = getBasicPieLayout(seriesModel, api), - cx = _a.cx, - cy = _a.cy, - r = _a.r, - r0 = _a.r0; - - var startAngle = -seriesModel.get('startAngle') * RADIAN; - var minAngle = seriesModel.get('minAngle') * RADIAN; - var validDataCount = 0; - data.each(valueDim, function (value) { - !isNaN(value) && validDataCount++; - }); - var sum = data.getSum(valueDim); // Sum may be 0 - - var unitRadian = Math.PI / (sum || validDataCount) * 2; - var clockwise = seriesModel.get('clockwise'); - var roseType = seriesModel.get('roseType'); - var stillShowZeroSum = seriesModel.get('stillShowZeroSum'); // [0...max] - - var extent = data.getDataExtent(valueDim); - extent[0] = 0; // In the case some sector angle is smaller than minAngle - - var restAngle = PI2$8; - var valueSumLargerThanMinAngle = 0; - var currentAngle = startAngle; - var dir = clockwise ? 1 : -1; - data.setLayout({ - viewRect: viewRect, - r: r + r: roseType ? linearMap(value, extent, [r0, r]) : r + }); + currentAngle = endAngle; + }); // Some sector is constrained by minAngle + // Rest sectors needs recalculate angle + + if (restAngle < PI2$8 && validDataCount) { + // Average the angle if rest angle is not enough after all angles is + // Constrained by minAngle + if (restAngle <= 1e-3) { + var angle_1 = PI2$8 / validDataCount; + data.each(valueDim, function (value, idx) { + if (!isNaN(value)) { + var layout_1 = data.getItemLayout(idx); + layout_1.angle = angle_1; + layout_1.startAngle = startAngle + dir * idx * angle_1; + layout_1.endAngle = startAngle + dir * (idx + 1) * angle_1; + } }); + } else { + unitRadian = restAngle / valueSumLargerThanMinAngle; + currentAngle = startAngle; data.each(valueDim, function (value, idx) { - var angle; - - if (isNaN(value)) { - data.setItemLayout(idx, { - angle: NaN, - startAngle: NaN, - endAngle: NaN, - clockwise: clockwise, - cx: cx, - cy: cy, - r0: r0, - r: roseType ? NaN : r - }); - return; - } // FIXME 兼容 2.0 但是 roseType 是 area 的时候才是这样? - - - if (roseType !== 'area') { - angle = sum === 0 && stillShowZeroSum ? unitRadian : value * unitRadian; - } else { - angle = PI2$8 / validDataCount; - } - - if (angle < minAngle) { - angle = minAngle; - restAngle -= minAngle; - } else { - valueSumLargerThanMinAngle += value; - } - - var endAngle = currentAngle + dir * angle; - data.setItemLayout(idx, { - angle: angle, - startAngle: currentAngle, - endAngle: endAngle, - clockwise: clockwise, - cx: cx, - cy: cy, - r0: r0, - r: roseType ? linearMap(value, extent, [r0, r]) : r - }); - currentAngle = endAngle; - }); // Some sector is constrained by minAngle - // Rest sectors needs recalculate angle - - if (restAngle < PI2$8 && validDataCount) { - // Average the angle if rest angle is not enough after all angles is - // Constrained by minAngle - if (restAngle <= 1e-3) { - var angle_1 = PI2$8 / validDataCount; - data.each(valueDim, function (value, idx) { - if (!isNaN(value)) { - var layout_1 = data.getItemLayout(idx); - layout_1.angle = angle_1; - layout_1.startAngle = startAngle + dir * idx * angle_1; - layout_1.endAngle = startAngle + dir * (idx + 1) * angle_1; - } - }); - } else { - unitRadian = restAngle / valueSumLargerThanMinAngle; - currentAngle = startAngle; - data.each(valueDim, function (value, idx) { - if (!isNaN(value)) { - var layout_2 = data.getItemLayout(idx); - var angle = layout_2.angle === minAngle ? minAngle : value * unitRadian; - layout_2.startAngle = currentAngle; - layout_2.endAngle = currentAngle + dir * angle; - currentAngle += dir * angle; - } - }); - } - } - }); + if (!isNaN(value)) { + var layout_2 = data.getItemLayout(idx); + var angle = layout_2.angle === minAngle ? minAngle : value * unitRadian; + layout_2.startAngle = currentAngle; + layout_2.endAngle = currentAngle + dir * angle; + currentAngle += dir * angle; + } + }); + } + } + }); } /* @@ -45017,210 +45017,210 @@ * under the License. */ function dataFilter(seriesType) { - return { - seriesType: seriesType, - reset: function (seriesModel, ecModel) { - var legendModels = ecModel.findComponents({ - mainType: 'legend' - }); - - if (!legendModels || !legendModels.length) { - return; - } + return { + seriesType: seriesType, + reset: function (seriesModel, ecModel) { + var legendModels = ecModel.findComponents({ + mainType: 'legend' + }); - var data = seriesModel.getData(); - data.filterSelf(function (idx) { - var name = data.getName(idx); // If in any legend component the status is not selected. + if (!legendModels || !legendModels.length) { + return; + } - for (var i = 0; i < legendModels.length; i++) { - // @ts-ignore FIXME: LegendModel - if (!legendModels[i].isSelected(name)) { - return false; - } - } + var data = seriesModel.getData(); + data.filterSelf(function (idx) { + var name = data.getName(idx); // If in any legend component the status is not selected. - return true; - }); + for (var i = 0; i < legendModels.length; i++) { + // @ts-ignore FIXME: LegendModel + if (!legendModels[i].isSelected(name)) { + return false; + } } - }; + + return true; + }); + } + }; } var RADIAN$1 = Math.PI / 180; function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight, viewLeft, viewTop, farthestX) { - if (list.length < 2) { - return; - } - - function recalculateXOnSemiToAlignOnEllipseCurve(semi) { - var rB = semi.rB; - var rB2 = rB * rB; + if (list.length < 2) { + return; + } - for (var i = 0; i < semi.list.length; i++) { - var item = semi.list[i]; - var dy = Math.abs(item.label.y - cy); // horizontal r is always same with original r because x is not changed. + function recalculateXOnSemiToAlignOnEllipseCurve(semi) { + var rB = semi.rB; + var rB2 = rB * rB; - var rA = r + item.len; - var rA2 = rA * rA; // Use ellipse implicit function to calculate x + for (var i = 0; i < semi.list.length; i++) { + var item = semi.list[i]; + var dy = Math.abs(item.label.y - cy); // horizontal r is always same with original r because x is not changed. - var dx = Math.sqrt((1 - Math.abs(dy * dy / rB2)) * rA2); - var newX = cx + (dx + item.len2) * dir; - var deltaX = newX - item.label.x; - var newTargetWidth = item.targetTextWidth - deltaX * dir; // text x is changed, so need to recalculate width. + var rA = r + item.len; + var rA2 = rA * rA; // Use ellipse implicit function to calculate x - constrainTextWidth(item, newTargetWidth, true); - item.label.x = newX; - } - } // Adjust X based on the shifted y. Make tight labels aligned on an ellipse curve. + var dx = Math.sqrt((1 - Math.abs(dy * dy / rB2)) * rA2); + var newX = cx + (dx + item.len2) * dir; + var deltaX = newX - item.label.x; + var newTargetWidth = item.targetTextWidth - deltaX * dir; // text x is changed, so need to recalculate width. + constrainTextWidth(item, newTargetWidth, true); + item.label.x = newX; + } + } // Adjust X based on the shifted y. Make tight labels aligned on an ellipse curve. - function recalculateX(items) { - // Extremes of - var topSemi = { - list: [], - maxY: 0 - }; - var bottomSemi = { - list: [], - maxY: 0 - }; - for (var i = 0; i < items.length; i++) { - if (items[i].labelAlignTo !== 'none') { - continue; - } + function recalculateX(items) { + // Extremes of + var topSemi = { + list: [], + maxY: 0 + }; + var bottomSemi = { + list: [], + maxY: 0 + }; - var item = items[i]; - var semi = item.label.y > cy ? bottomSemi : topSemi; - var dy = Math.abs(item.label.y - cy); + for (var i = 0; i < items.length; i++) { + if (items[i].labelAlignTo !== 'none') { + continue; + } - if (dy >= semi.maxY) { - var dx = item.label.x - cx - item.len2 * dir; // horizontal r is always same with original r because x is not changed. + var item = items[i]; + var semi = item.label.y > cy ? bottomSemi : topSemi; + var dy = Math.abs(item.label.y - cy); - var rA = r + item.len; // Canculate rB based on the topest / bottemest label. + if (dy >= semi.maxY) { + var dx = item.label.x - cx - item.len2 * dir; // horizontal r is always same with original r because x is not changed. - var rB = Math.abs(dx) < rA ? Math.sqrt(dy * dy / (1 - dx * dx / rA / rA)) : rA; - semi.rB = rB; - semi.maxY = dy; - } + var rA = r + item.len; // Canculate rB based on the topest / bottemest label. - semi.list.push(item); - } + var rB = Math.abs(dx) < rA ? Math.sqrt(dy * dy / (1 - dx * dx / rA / rA)) : rA; + semi.rB = rB; + semi.maxY = dy; + } - recalculateXOnSemiToAlignOnEllipseCurve(topSemi); - recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi); + semi.list.push(item); } - var len = list.length; + recalculateXOnSemiToAlignOnEllipseCurve(topSemi); + recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi); + } - for (var i = 0; i < len; i++) { - if (list[i].position === 'outer' && list[i].labelAlignTo === 'labelLine') { - var dx = list[i].label.x - farthestX; - list[i].linePoints[1][0] += dx; - list[i].label.x = farthestX; - } - } + var len = list.length; - if (shiftLayoutOnY(list, viewTop, viewTop + viewHeight)) { - recalculateX(list); + for (var i = 0; i < len; i++) { + if (list[i].position === 'outer' && list[i].labelAlignTo === 'labelLine') { + var dx = list[i].label.x - farthestX; + list[i].linePoints[1][0] += dx; + list[i].label.x = farthestX; } + } + + if (shiftLayoutOnY(list, viewTop, viewTop + viewHeight)) { + recalculateX(list); + } } function avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop) { - var leftList = []; - var rightList = []; - var leftmostX = Number.MAX_VALUE; - var rightmostX = -Number.MAX_VALUE; - - for (var i = 0; i < labelLayoutList.length; i++) { - var label = labelLayoutList[i].label; + var leftList = []; + var rightList = []; + var leftmostX = Number.MAX_VALUE; + var rightmostX = -Number.MAX_VALUE; - if (isPositionCenter(labelLayoutList[i])) { - continue; - } + for (var i = 0; i < labelLayoutList.length; i++) { + var label = labelLayoutList[i].label; - if (label.x < cx) { - leftmostX = Math.min(leftmostX, label.x); - leftList.push(labelLayoutList[i]); - } else { - rightmostX = Math.max(rightmostX, label.x); - rightList.push(labelLayoutList[i]); - } + if (isPositionCenter(labelLayoutList[i])) { + continue; } - for (var i = 0; i < labelLayoutList.length; i++) { - var layout = labelLayoutList[i]; + if (label.x < cx) { + leftmostX = Math.min(leftmostX, label.x); + leftList.push(labelLayoutList[i]); + } else { + rightmostX = Math.max(rightmostX, label.x); + rightList.push(labelLayoutList[i]); + } + } - if (!isPositionCenter(layout) && layout.linePoints) { - if (layout.labelStyleWidth != null) { - continue; - } + for (var i = 0; i < labelLayoutList.length; i++) { + var layout = labelLayoutList[i]; - var label = layout.label; - var linePoints = layout.linePoints; - var targetTextWidth = void 0; + if (!isPositionCenter(layout) && layout.linePoints) { + if (layout.labelStyleWidth != null) { + continue; + } - if (layout.labelAlignTo === 'edge') { - if (label.x < cx) { - targetTextWidth = linePoints[2][0] - layout.labelDistance - viewLeft - layout.edgeDistance; - } else { - targetTextWidth = viewLeft + viewWidth - layout.edgeDistance - linePoints[2][0] - layout.labelDistance; - } - } else if (layout.labelAlignTo === 'labelLine') { - if (label.x < cx) { - targetTextWidth = leftmostX - viewLeft - layout.bleedMargin; - } else { - targetTextWidth = viewLeft + viewWidth - rightmostX - layout.bleedMargin; - } - } else { - if (label.x < cx) { - targetTextWidth = label.x - viewLeft - layout.bleedMargin; - } else { - targetTextWidth = viewLeft + viewWidth - label.x - layout.bleedMargin; - } - } + var label = layout.label; + var linePoints = layout.linePoints; + var targetTextWidth = void 0; - layout.targetTextWidth = targetTextWidth; - constrainTextWidth(layout, targetTextWidth); + if (layout.labelAlignTo === 'edge') { + if (label.x < cx) { + targetTextWidth = linePoints[2][0] - layout.labelDistance - viewLeft - layout.edgeDistance; + } else { + targetTextWidth = viewLeft + viewWidth - layout.edgeDistance - linePoints[2][0] - layout.labelDistance; + } + } else if (layout.labelAlignTo === 'labelLine') { + if (label.x < cx) { + targetTextWidth = leftmostX - viewLeft - layout.bleedMargin; + } else { + targetTextWidth = viewLeft + viewWidth - rightmostX - layout.bleedMargin; + } + } else { + if (label.x < cx) { + targetTextWidth = label.x - viewLeft - layout.bleedMargin; + } else { + targetTextWidth = viewLeft + viewWidth - label.x - layout.bleedMargin; } + } + + layout.targetTextWidth = targetTextWidth; + constrainTextWidth(layout, targetTextWidth); } + } - adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX); - adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX); + adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX); + adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX); - for (var i = 0; i < labelLayoutList.length; i++) { - var layout = labelLayoutList[i]; + for (var i = 0; i < labelLayoutList.length; i++) { + var layout = labelLayoutList[i]; - if (!isPositionCenter(layout) && layout.linePoints) { - var label = layout.label; - var linePoints = layout.linePoints; - var isAlignToEdge = layout.labelAlignTo === 'edge'; - var padding = label.style.padding; - var paddingH = padding ? padding[1] + padding[3] : 0; // textRect.width already contains paddingH if bgColor is set + if (!isPositionCenter(layout) && layout.linePoints) { + var label = layout.label; + var linePoints = layout.linePoints; + var isAlignToEdge = layout.labelAlignTo === 'edge'; + var padding = label.style.padding; + var paddingH = padding ? padding[1] + padding[3] : 0; // textRect.width already contains paddingH if bgColor is set - var extraPaddingH = label.style.backgroundColor ? 0 : paddingH; - var realTextWidth = layout.rect.width + extraPaddingH; - var dist = linePoints[1][0] - linePoints[2][0]; + var extraPaddingH = label.style.backgroundColor ? 0 : paddingH; + var realTextWidth = layout.rect.width + extraPaddingH; + var dist = linePoints[1][0] - linePoints[2][0]; - if (isAlignToEdge) { - if (label.x < cx) { - linePoints[2][0] = viewLeft + layout.edgeDistance + realTextWidth + layout.labelDistance; - } else { - linePoints[2][0] = viewLeft + viewWidth - layout.edgeDistance - realTextWidth - layout.labelDistance; - } - } else { - if (label.x < cx) { - linePoints[2][0] = label.x + layout.labelDistance; - } else { - linePoints[2][0] = label.x - layout.labelDistance; - } + if (isAlignToEdge) { + if (label.x < cx) { + linePoints[2][0] = viewLeft + layout.edgeDistance + realTextWidth + layout.labelDistance; + } else { + linePoints[2][0] = viewLeft + viewWidth - layout.edgeDistance - realTextWidth - layout.labelDistance; + } + } else { + if (label.x < cx) { + linePoints[2][0] = label.x + layout.labelDistance; + } else { + linePoints[2][0] = label.x - layout.labelDistance; + } - linePoints[1][0] = linePoints[2][0] + dist; - } + linePoints[1][0] = linePoints[2][0] + dist; + } - linePoints[1][1] = linePoints[2][1] = label.y; - } + linePoints[1][1] = linePoints[2][1] = label.y; } + } } /** * Set max width of each label, and then wrap each label to the max width. @@ -45235,317 +45235,317 @@ function constrainTextWidth(layout, availableWidth, forceRecalculate) { - if (forceRecalculate === void 0) { - forceRecalculate = false; - } + if (forceRecalculate === void 0) { + forceRecalculate = false; + } - if (layout.labelStyleWidth != null) { - // User-defined style.width has the highest priority. - return; - } + if (layout.labelStyleWidth != null) { + // User-defined style.width has the highest priority. + return; + } - var label = layout.label; - var style = label.style; - var textRect = layout.rect; - var bgColor = style.backgroundColor; - var padding = style.padding; - var paddingH = padding ? padding[1] + padding[3] : 0; - var overflow = style.overflow; // textRect.width already contains paddingH if bgColor is set + var label = layout.label; + var style = label.style; + var textRect = layout.rect; + var bgColor = style.backgroundColor; + var padding = style.padding; + var paddingH = padding ? padding[1] + padding[3] : 0; + var overflow = style.overflow; // textRect.width already contains paddingH if bgColor is set - var oldOuterWidth = textRect.width + (bgColor ? 0 : paddingH); + var oldOuterWidth = textRect.width + (bgColor ? 0 : paddingH); - if (availableWidth < oldOuterWidth || forceRecalculate) { - var oldHeight = textRect.height; + if (availableWidth < oldOuterWidth || forceRecalculate) { + var oldHeight = textRect.height; - if (overflow && overflow.match('break')) { - // Temporarily set background to be null to calculate - // the bounding box without backgroud. - label.setStyle('backgroundColor', null); // Set constraining width + if (overflow && overflow.match('break')) { + // Temporarily set background to be null to calculate + // the bounding box without backgroud. + label.setStyle('backgroundColor', null); // Set constraining width - label.setStyle('width', availableWidth - paddingH); // This is the real bounding box of the text without padding + label.setStyle('width', availableWidth - paddingH); // This is the real bounding box of the text without padding - var innerRect = label.getBoundingRect(); - label.setStyle('width', Math.ceil(innerRect.width)); - label.setStyle('backgroundColor', bgColor); - } else { - var availableInnerWidth = availableWidth - paddingH; - var newWidth = availableWidth < oldOuterWidth // Current text is too wide, use `availableWidth` as max width. - ? availableInnerWidth : // Current available width is enough, but the text may have - // already been wrapped with a smaller available width. - forceRecalculate ? availableInnerWidth > layout.unconstrainedWidth // Current available is larger than text width, - // so don't constrain width (otherwise it may have - // empty space in the background). - ? null // Current available is smaller than text width, so - // use the current available width as constraining - // width. - : availableInnerWidth : // Current available width is enough, so no need to - // constrain. - null; - label.setStyle('width', newWidth); - } - - var newRect = label.getBoundingRect(); - textRect.width = newRect.width; - var margin = (label.style.margin || 0) + 2.1; - textRect.height = newRect.height + margin; - textRect.y -= (textRect.height - oldHeight) / 2; - } + var innerRect = label.getBoundingRect(); + label.setStyle('width', Math.ceil(innerRect.width)); + label.setStyle('backgroundColor', bgColor); + } else { + var availableInnerWidth = availableWidth - paddingH; + var newWidth = availableWidth < oldOuterWidth // Current text is too wide, use `availableWidth` as max width. + ? availableInnerWidth : // Current available width is enough, but the text may have + // already been wrapped with a smaller available width. + forceRecalculate ? availableInnerWidth > layout.unconstrainedWidth // Current available is larger than text width, + // so don't constrain width (otherwise it may have + // empty space in the background). + ? null // Current available is smaller than text width, so + // use the current available width as constraining + // width. + : availableInnerWidth : // Current available width is enough, so no need to + // constrain. + null; + label.setStyle('width', newWidth); + } + + var newRect = label.getBoundingRect(); + textRect.width = newRect.width; + var margin = (label.style.margin || 0) + 2.1; + textRect.height = newRect.height + margin; + textRect.y -= (textRect.height - oldHeight) / 2; + } } function isPositionCenter(sectorShape) { - // Not change x for center label - return sectorShape.position === 'center'; + // Not change x for center label + return sectorShape.position === 'center'; } function pieLabelLayout(seriesModel) { - var data = seriesModel.getData(); - var labelLayoutList = []; - var cx; - var cy; - var hasLabelRotate = false; - var minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN$1; - var viewRect = data.getLayout('viewRect'); - var r = data.getLayout('r'); - var viewWidth = viewRect.width; - var viewLeft = viewRect.x; - var viewTop = viewRect.y; - var viewHeight = viewRect.height; - - function setNotShow(el) { - el.ignore = true; + var data = seriesModel.getData(); + var labelLayoutList = []; + var cx; + var cy; + var hasLabelRotate = false; + var minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN$1; + var viewRect = data.getLayout('viewRect'); + var r = data.getLayout('r'); + var viewWidth = viewRect.width; + var viewLeft = viewRect.x; + var viewTop = viewRect.y; + var viewHeight = viewRect.height; + + function setNotShow(el) { + el.ignore = true; + } + + function isLabelShown(label) { + if (!label.ignore) { + return true; + } + + for (var key in label.states) { + if (label.states[key].ignore === false) { + return true; + } } - function isLabelShown(label) { - if (!label.ignore) { - return true; - } + return false; + } - for (var key in label.states) { - if (label.states[key].ignore === false) { - return true; - } + data.each(function (idx) { + var sector = data.getItemGraphicEl(idx); + var sectorShape = sector.shape; + var label = sector.getTextContent(); + var labelLine = sector.getTextGuideLine(); + var itemModel = data.getItemModel(idx); + var labelModel = itemModel.getModel('label'); // Use position in normal or emphasis + + var labelPosition = labelModel.get('position') || itemModel.get(['emphasis', 'label', 'position']); + var labelDistance = labelModel.get('distanceToLabelLine'); + var labelAlignTo = labelModel.get('alignTo'); + var edgeDistance = parsePercent$1(labelModel.get('edgeDistance'), viewWidth); + var bleedMargin = labelModel.get('bleedMargin'); + var labelLineModel = itemModel.getModel('labelLine'); + var labelLineLen = labelLineModel.get('length'); + labelLineLen = parsePercent$1(labelLineLen, viewWidth); + var labelLineLen2 = labelLineModel.get('length2'); + labelLineLen2 = parsePercent$1(labelLineLen2, viewWidth); + + if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) { + each(label.states, setNotShow); + label.ignore = true; + return; + } + + if (!isLabelShown(label)) { + return; + } + + var midAngle = (sectorShape.startAngle + sectorShape.endAngle) / 2; + var nx = Math.cos(midAngle); + var ny = Math.sin(midAngle); + var textX; + var textY; + var linePoints; + var textAlign; + cx = sectorShape.cx; + cy = sectorShape.cy; + var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner'; + + if (labelPosition === 'center') { + textX = sectorShape.cx; + textY = sectorShape.cy; + textAlign = 'center'; + } else { + var x1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * nx : sectorShape.r * nx) + cx; + var y1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * ny : sectorShape.r * ny) + cy; + textX = x1 + nx * 3; + textY = y1 + ny * 3; + + if (!isLabelInside) { + // For roseType + var x2 = x1 + nx * (labelLineLen + r - sectorShape.r); + var y2 = y1 + ny * (labelLineLen + r - sectorShape.r); + var x3 = x2 + (nx < 0 ? -1 : 1) * labelLineLen2; + var y3 = y2; + + if (labelAlignTo === 'edge') { + // Adjust textX because text align of edge is opposite + textX = nx < 0 ? viewLeft + edgeDistance : viewLeft + viewWidth - edgeDistance; + } else { + textX = x3 + (nx < 0 ? -labelDistance : labelDistance); } - return false; + textY = y3; + linePoints = [[x1, y1], [x2, y2], [x3, y3]]; + } + + textAlign = isLabelInside ? 'center' : labelAlignTo === 'edge' ? nx > 0 ? 'right' : 'left' : nx > 0 ? 'left' : 'right'; } - data.each(function (idx) { - var sector = data.getItemGraphicEl(idx); - var sectorShape = sector.shape; - var label = sector.getTextContent(); - var labelLine = sector.getTextGuideLine(); - var itemModel = data.getItemModel(idx); - var labelModel = itemModel.getModel('label'); // Use position in normal or emphasis - - var labelPosition = labelModel.get('position') || itemModel.get(['emphasis', 'label', 'position']); - var labelDistance = labelModel.get('distanceToLabelLine'); - var labelAlignTo = labelModel.get('alignTo'); - var edgeDistance = parsePercent$1(labelModel.get('edgeDistance'), viewWidth); - var bleedMargin = labelModel.get('bleedMargin'); - var labelLineModel = itemModel.getModel('labelLine'); - var labelLineLen = labelLineModel.get('length'); - labelLineLen = parsePercent$1(labelLineLen, viewWidth); - var labelLineLen2 = labelLineModel.get('length2'); - labelLineLen2 = parsePercent$1(labelLineLen2, viewWidth); - - if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) { - each(label.states, setNotShow); - label.ignore = true; - return; - } + var PI = Math.PI; + var labelRotate = 0; + var rotate = labelModel.get('rotate'); - if (!isLabelShown(label)) { - return; - } + if (isNumber(rotate)) { + labelRotate = rotate * (PI / 180); + } else if (labelPosition === 'center') { + labelRotate = 0; + } else if (rotate === 'radial' || rotate === true) { + var radialAngle = nx < 0 ? -midAngle + PI : -midAngle; + labelRotate = radialAngle; + } else if (rotate === 'tangential' && labelPosition !== 'outside' && labelPosition !== 'outer') { + var rad = Math.atan2(nx, ny); - var midAngle = (sectorShape.startAngle + sectorShape.endAngle) / 2; - var nx = Math.cos(midAngle); - var ny = Math.sin(midAngle); - var textX; - var textY; - var linePoints; - var textAlign; - cx = sectorShape.cx; - cy = sectorShape.cy; - var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner'; - - if (labelPosition === 'center') { - textX = sectorShape.cx; - textY = sectorShape.cy; - textAlign = 'center'; - } else { - var x1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * nx : sectorShape.r * nx) + cx; - var y1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * ny : sectorShape.r * ny) + cy; - textX = x1 + nx * 3; - textY = y1 + ny * 3; - - if (!isLabelInside) { - // For roseType - var x2 = x1 + nx * (labelLineLen + r - sectorShape.r); - var y2 = y1 + ny * (labelLineLen + r - sectorShape.r); - var x3 = x2 + (nx < 0 ? -1 : 1) * labelLineLen2; - var y3 = y2; - - if (labelAlignTo === 'edge') { - // Adjust textX because text align of edge is opposite - textX = nx < 0 ? viewLeft + edgeDistance : viewLeft + viewWidth - edgeDistance; - } else { - textX = x3 + (nx < 0 ? -labelDistance : labelDistance); - } + if (rad < 0) { + rad = PI * 2 + rad; + } - textY = y3; - linePoints = [[x1, y1], [x2, y2], [x3, y3]]; - } + var isDown = ny > 0; - textAlign = isLabelInside ? 'center' : labelAlignTo === 'edge' ? nx > 0 ? 'right' : 'left' : nx > 0 ? 'left' : 'right'; - } + if (isDown) { + rad = PI + rad; + } - var PI = Math.PI; - var labelRotate = 0; - var rotate = labelModel.get('rotate'); + labelRotate = rad - PI; + } - if (isNumber(rotate)) { - labelRotate = rotate * (PI / 180); - } else if (labelPosition === 'center') { - labelRotate = 0; - } else if (rotate === 'radial' || rotate === true) { - var radialAngle = nx < 0 ? -midAngle + PI : -midAngle; - labelRotate = radialAngle; - } else if (rotate === 'tangential' && labelPosition !== 'outside' && labelPosition !== 'outer') { - var rad = Math.atan2(nx, ny); + hasLabelRotate = !!labelRotate; + label.x = textX; + label.y = textY; + label.rotation = labelRotate; + label.setStyle({ + verticalAlign: 'middle' + }); // Not sectorShape the inside label + + if (!isLabelInside) { + var textRect = label.getBoundingRect().clone(); + textRect.applyTransform(label.getComputedTransform()); // Text has a default 1px stroke. Exclude this. + + var margin = (label.style.margin || 0) + 2.1; + textRect.y -= margin / 2; + textRect.height += margin; + labelLayoutList.push({ + label: label, + labelLine: labelLine, + position: labelPosition, + len: labelLineLen, + len2: labelLineLen2, + minTurnAngle: labelLineModel.get('minTurnAngle'), + maxSurfaceAngle: labelLineModel.get('maxSurfaceAngle'), + surfaceNormal: new Point(nx, ny), + linePoints: linePoints, + textAlign: textAlign, + labelDistance: labelDistance, + labelAlignTo: labelAlignTo, + edgeDistance: edgeDistance, + bleedMargin: bleedMargin, + rect: textRect, + unconstrainedWidth: textRect.width, + labelStyleWidth: label.style.width + }); + } else { + label.setStyle({ + align: textAlign + }); + var selectState = label.states.select; - if (rad < 0) { - rad = PI * 2 + rad; - } + if (selectState) { + selectState.x += label.x; + selectState.y += label.y; + } + } - var isDown = ny > 0; + sector.setTextConfig({ + inside: isLabelInside + }); + }); - if (isDown) { - rad = PI + rad; - } + if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) { + avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop); + } - labelRotate = rad - PI; - } + for (var i = 0; i < labelLayoutList.length; i++) { + var layout = labelLayoutList[i]; + var label = layout.label; + var labelLine = layout.labelLine; + var notShowLabel = isNaN(label.x) || isNaN(label.y); - hasLabelRotate = !!labelRotate; - label.x = textX; - label.y = textY; - label.rotation = labelRotate; - label.setStyle({ - verticalAlign: 'middle' - }); // Not sectorShape the inside label - - if (!isLabelInside) { - var textRect = label.getBoundingRect().clone(); - textRect.applyTransform(label.getComputedTransform()); // Text has a default 1px stroke. Exclude this. - - var margin = (label.style.margin || 0) + 2.1; - textRect.y -= margin / 2; - textRect.height += margin; - labelLayoutList.push({ - label: label, - labelLine: labelLine, - position: labelPosition, - len: labelLineLen, - len2: labelLineLen2, - minTurnAngle: labelLineModel.get('minTurnAngle'), - maxSurfaceAngle: labelLineModel.get('maxSurfaceAngle'), - surfaceNormal: new Point(nx, ny), - linePoints: linePoints, - textAlign: textAlign, - labelDistance: labelDistance, - labelAlignTo: labelAlignTo, - edgeDistance: edgeDistance, - bleedMargin: bleedMargin, - rect: textRect, - unconstrainedWidth: textRect.width, - labelStyleWidth: label.style.width - }); - } else { - label.setStyle({ - align: textAlign - }); - var selectState = label.states.select; + if (label) { + label.setStyle({ + align: layout.textAlign + }); - if (selectState) { - selectState.x += label.x; - selectState.y += label.y; - } - } + if (notShowLabel) { + each(label.states, setNotShow); + label.ignore = true; + } - sector.setTextConfig({ - inside: isLabelInside - }); - }); + var selectState = label.states.select; - if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) { - avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop); + if (selectState) { + selectState.x += label.x; + selectState.y += label.y; + } } - for (var i = 0; i < labelLayoutList.length; i++) { - var layout = labelLayoutList[i]; - var label = layout.label; - var labelLine = layout.labelLine; - var notShowLabel = isNaN(label.x) || isNaN(label.y); - - if (label) { - label.setStyle({ - align: layout.textAlign - }); - - if (notShowLabel) { - each(label.states, setNotShow); - label.ignore = true; - } - - var selectState = label.states.select; - - if (selectState) { - selectState.x += label.x; - selectState.y += label.y; - } - } + if (labelLine) { + var linePoints = layout.linePoints; - if (labelLine) { - var linePoints = layout.linePoints; + if (notShowLabel || !linePoints) { + each(labelLine.states, setNotShow); + labelLine.ignore = true; + } else { + limitTurnAngle(linePoints, layout.minTurnAngle); + limitSurfaceAngle(linePoints, layout.surfaceNormal, layout.maxSurfaceAngle); + labelLine.setShape({ + points: linePoints + }); // Set the anchor to the midpoint of sector - if (notShowLabel || !linePoints) { - each(labelLine.states, setNotShow); - labelLine.ignore = true; - } else { - limitTurnAngle(linePoints, layout.minTurnAngle); - limitSurfaceAngle(linePoints, layout.surfaceNormal, layout.maxSurfaceAngle); - labelLine.setShape({ - points: linePoints - }); // Set the anchor to the midpoint of sector - - label.__hostTarget.textGuideLineConfig = { - anchor: new Point(linePoints[0][0], linePoints[0][1]) - }; - } - } + label.__hostTarget.textGuideLineConfig = { + anchor: new Point(linePoints[0][0], linePoints[0][1]) + }; + } } + } } function getSectorCornerRadius(model, shape, zeroIfNull) { - var cornerRadius = model.get('borderRadius'); + var cornerRadius = model.get('borderRadius'); - if (cornerRadius == null) { - return zeroIfNull ? { - cornerRadius: 0 - } : null; - } + if (cornerRadius == null) { + return zeroIfNull ? { + cornerRadius: 0 + } : null; + } - if (!isArray(cornerRadius)) { - cornerRadius = [cornerRadius, cornerRadius, cornerRadius, cornerRadius]; - } + if (!isArray(cornerRadius)) { + cornerRadius = [cornerRadius, cornerRadius, cornerRadius, cornerRadius]; + } - var dr = Math.abs(shape.r || 0 - shape.r0 || 0); - return { - cornerRadius: map(cornerRadius, function (cr) { - return parsePercent(cr, dr); - }) - }; + var dr = Math.abs(shape.r || 0 - shape.r0 || 0); + return { + cornerRadius: map(cornerRadius, function (cr) { + return parsePercent(cr, dr); + }) + }; } /** @@ -45553,261 +45553,261 @@ */ var PiePiece = - /** @class */ - function (_super) { - __extends(PiePiece, _super); + /** @class */ + function (_super) { + __extends(PiePiece, _super); - function PiePiece(data, idx, startAngle) { - var _this = _super.call(this) || this; + function PiePiece(data, idx, startAngle) { + var _this = _super.call(this) || this; - _this.z2 = 2; - var text = new ZRText(); + _this.z2 = 2; + var text = new ZRText(); - _this.setTextContent(text); + _this.setTextContent(text); - _this.updateData(data, idx, startAngle, true); + _this.updateData(data, idx, startAngle, true); - return _this; + return _this; + } + + PiePiece.prototype.updateData = function (data, idx, startAngle, firstCreate) { + var sector = this; + var seriesModel = data.hostModel; + var itemModel = data.getItemModel(idx); + var emphasisModel = itemModel.getModel('emphasis'); + var layout = data.getItemLayout(idx); // cornerRadius & innerCornerRadius doesn't exist in the item layout. Use `0` if null value is specified. + // see `setItemLayout` in `pieLayout.ts`. + + var sectorShape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout, true), layout); // Ignore NaN data. + + if (isNaN(sectorShape.startAngle)) { + // Use NaN shape to avoid drawing shape. + sector.setShape(sectorShape); + return; + } + + if (firstCreate) { + sector.setShape(sectorShape); + var animationType = seriesModel.getShallow('animationType'); + + if (seriesModel.ecModel.ssr) { + // Use scale animation in SSR mode(opacity?) + // Because CSS SVG animation doesn't support very customized shape animation. + initProps(sector, { + scaleX: 0, + scaleY: 0 + }, seriesModel, { + dataIndex: idx, + isFrom: true + }); + sector.originX = sectorShape.cx; + sector.originY = sectorShape.cy; + } else if (animationType === 'scale') { + sector.shape.r = layout.r0; + initProps(sector, { + shape: { + r: layout.r + } + }, seriesModel, idx); + } // Expansion + else { + if (startAngle != null) { + sector.setShape({ + startAngle: startAngle, + endAngle: startAngle + }); + initProps(sector, { + shape: { + startAngle: layout.startAngle, + endAngle: layout.endAngle + } + }, seriesModel, idx); + } else { + sector.shape.endAngle = layout.startAngle; + updateProps(sector, { + shape: { + endAngle: layout.endAngle + } + }, seriesModel, idx); + } } + } else { + saveOldStyle(sector); // Transition animation from the old shape - PiePiece.prototype.updateData = function (data, idx, startAngle, firstCreate) { - var sector = this; - var seriesModel = data.hostModel; - var itemModel = data.getItemModel(idx); - var emphasisModel = itemModel.getModel('emphasis'); - var layout = data.getItemLayout(idx); // cornerRadius & innerCornerRadius doesn't exist in the item layout. Use `0` if null value is specified. - // see `setItemLayout` in `pieLayout.ts`. + updateProps(sector, { + shape: sectorShape + }, seriesModel, idx); + } - var sectorShape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout, true), layout); // Ignore NaN data. + sector.useStyle(data.getItemVisual(idx, 'style')); + setStatesStylesFromModel(sector, itemModel); + var midAngle = (layout.startAngle + layout.endAngle) / 2; + var offset = seriesModel.get('selectedOffset'); + var dx = Math.cos(midAngle) * offset; + var dy = Math.sin(midAngle) * offset; + var cursorStyle = itemModel.getShallow('cursor'); + cursorStyle && sector.attr('cursor', cursorStyle); - if (isNaN(sectorShape.startAngle)) { - // Use NaN shape to avoid drawing shape. - sector.setShape(sectorShape); - return; - } + this._updateLabel(seriesModel, data, idx); - if (firstCreate) { - sector.setShape(sectorShape); - var animationType = seriesModel.getShallow('animationType'); + sector.ensureState('emphasis').shape = extend({ + r: layout.r + (emphasisModel.get('scale') ? emphasisModel.get('scaleSize') || 0 : 0) + }, getSectorCornerRadius(emphasisModel.getModel('itemStyle'), layout)); + extend(sector.ensureState('select'), { + x: dx, + y: dy, + shape: getSectorCornerRadius(itemModel.getModel(['select', 'itemStyle']), layout) + }); + extend(sector.ensureState('blur'), { + shape: getSectorCornerRadius(itemModel.getModel(['blur', 'itemStyle']), layout) + }); + var labelLine = sector.getTextGuideLine(); + var labelText = sector.getTextContent(); + labelLine && extend(labelLine.ensureState('select'), { + x: dx, + y: dy + }); // TODO: needs dx, dy in zrender? + + extend(labelText.ensureState('select'), { + x: dx, + y: dy + }); + toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); + }; - if (seriesModel.ecModel.ssr) { - // Use scale animation in SSR mode(opacity?) - // Because CSS SVG animation doesn't support very customized shape animation. - initProps(sector, { - scaleX: 0, - scaleY: 0 - }, seriesModel, { - dataIndex: idx, - isFrom: true - }); - sector.originX = sectorShape.cx; - sector.originY = sectorShape.cy; - } else if (animationType === 'scale') { - sector.shape.r = layout.r0; - initProps(sector, { - shape: { - r: layout.r - } - }, seriesModel, idx); - } // Expansion - else { - if (startAngle != null) { - sector.setShape({ - startAngle: startAngle, - endAngle: startAngle - }); - initProps(sector, { - shape: { - startAngle: layout.startAngle, - endAngle: layout.endAngle - } - }, seriesModel, idx); - } else { - sector.shape.endAngle = layout.startAngle; - updateProps(sector, { - shape: { - endAngle: layout.endAngle - } - }, seriesModel, idx); - } - } - } else { - saveOldStyle(sector); // Transition animation from the old shape - - updateProps(sector, { - shape: sectorShape - }, seriesModel, idx); - } - - sector.useStyle(data.getItemVisual(idx, 'style')); - setStatesStylesFromModel(sector, itemModel); - var midAngle = (layout.startAngle + layout.endAngle) / 2; - var offset = seriesModel.get('selectedOffset'); - var dx = Math.cos(midAngle) * offset; - var dy = Math.sin(midAngle) * offset; - var cursorStyle = itemModel.getShallow('cursor'); - cursorStyle && sector.attr('cursor', cursorStyle); - - this._updateLabel(seriesModel, data, idx); - - sector.ensureState('emphasis').shape = extend({ - r: layout.r + (emphasisModel.get('scale') ? emphasisModel.get('scaleSize') || 0 : 0) - }, getSectorCornerRadius(emphasisModel.getModel('itemStyle'), layout)); - extend(sector.ensureState('select'), { - x: dx, - y: dy, - shape: getSectorCornerRadius(itemModel.getModel(['select', 'itemStyle']), layout) - }); - extend(sector.ensureState('blur'), { - shape: getSectorCornerRadius(itemModel.getModel(['blur', 'itemStyle']), layout) - }); - var labelLine = sector.getTextGuideLine(); - var labelText = sector.getTextContent(); - labelLine && extend(labelLine.ensureState('select'), { - x: dx, - y: dy - }); // TODO: needs dx, dy in zrender? - - extend(labelText.ensureState('select'), { - x: dx, - y: dy - }); - toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - }; + PiePiece.prototype._updateLabel = function (seriesModel, data, idx) { + var sector = this; + var itemModel = data.getItemModel(idx); + var labelLineModel = itemModel.getModel('labelLine'); + var style = data.getItemVisual(idx, 'style'); + var visualColor = style && style.fill; + var visualOpacity = style && style.opacity; + setLabelStyle(sector, getLabelStatesModels(itemModel), { + labelFetcher: data.hostModel, + labelDataIndex: idx, + inheritColor: visualColor, + defaultOpacity: visualOpacity, + defaultText: seriesModel.getFormattedLabel(idx, 'normal') || data.getName(idx) + }); + var labelText = sector.getTextContent(); // Set textConfig on sector. - PiePiece.prototype._updateLabel = function (seriesModel, data, idx) { - var sector = this; - var itemModel = data.getItemModel(idx); - var labelLineModel = itemModel.getModel('labelLine'); - var style = data.getItemVisual(idx, 'style'); - var visualColor = style && style.fill; - var visualOpacity = style && style.opacity; - setLabelStyle(sector, getLabelStatesModels(itemModel), { - labelFetcher: data.hostModel, - labelDataIndex: idx, - inheritColor: visualColor, - defaultOpacity: visualOpacity, - defaultText: seriesModel.getFormattedLabel(idx, 'normal') || data.getName(idx) - }); - var labelText = sector.getTextContent(); // Set textConfig on sector. + sector.setTextConfig({ + // reset position, rotation + position: null, + rotation: null + }); // Make sure update style on labelText after setLabelStyle. + // Because setLabelStyle will replace a new style on it. + + labelText.attr({ + z2: 10 + }); + var labelPosition = seriesModel.get(['label', 'position']); - sector.setTextConfig({ - // reset position, rotation - position: null, - rotation: null - }); // Make sure update style on labelText after setLabelStyle. - // Because setLabelStyle will replace a new style on it. + if (labelPosition !== 'outside' && labelPosition !== 'outer') { + sector.removeTextGuideLine(); + } else { + var polyline = this.getTextGuideLine(); - labelText.attr({ - z2: 10 - }); - var labelPosition = seriesModel.get(['label', 'position']); + if (!polyline) { + polyline = new Polyline(); + this.setTextGuideLine(polyline); + } // Default use item visual color - if (labelPosition !== 'outside' && labelPosition !== 'outer') { - sector.removeTextGuideLine(); - } else { - var polyline = this.getTextGuideLine(); - if (!polyline) { - polyline = new Polyline(); - this.setTextGuideLine(polyline); - } // Default use item visual color + setLabelLineStyle(this, getLabelLineStatesModels(itemModel), { + stroke: visualColor, + opacity: retrieve3(labelLineModel.get(['lineStyle', 'opacity']), visualOpacity, 1) + }); + } + }; + return PiePiece; + }(Sector); // Pie view - setLabelLineStyle(this, getLabelLineStatesModels(itemModel), { - stroke: visualColor, - opacity: retrieve3(labelLineModel.get(['lineStyle', 'opacity']), visualOpacity, 1) - }); - } - }; - return PiePiece; - }(Sector); // Pie view + var PieView = + /** @class */ + function (_super) { + __extends(PieView, _super); + function PieView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - var PieView = - /** @class */ - function (_super) { - __extends(PieView, _super); + _this.ignoreLabelLineUpdate = true; + return _this; + } - function PieView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + PieView.prototype.render = function (seriesModel, ecModel, api, payload) { + var data = seriesModel.getData(); + var oldData = this._data; + var group = this.group; + var startAngle; // First render - _this.ignoreLabelLineUpdate = true; - return _this; - } + if (!oldData && data.count() > 0) { + var shape = data.getItemLayout(0); - PieView.prototype.render = function (seriesModel, ecModel, api, payload) { - var data = seriesModel.getData(); - var oldData = this._data; - var group = this.group; - var startAngle; // First render + for (var s = 1; isNaN(shape && shape.startAngle) && s < data.count(); ++s) { + shape = data.getItemLayout(s); + } - if (!oldData && data.count() > 0) { - var shape = data.getItemLayout(0); + if (shape) { + startAngle = shape.startAngle; + } + } // remove empty-circle if it exists - for (var s = 1; isNaN(shape && shape.startAngle) && s < data.count(); ++s) { - shape = data.getItemLayout(s); - } - if (shape) { - startAngle = shape.startAngle; - } - } // remove empty-circle if it exists + if (this._emptyCircleSector) { + group.remove(this._emptyCircleSector); + } // when all data are filtered, show lightgray empty circle - if (this._emptyCircleSector) { - group.remove(this._emptyCircleSector); - } // when all data are filtered, show lightgray empty circle + if (data.count() === 0 && seriesModel.get('showEmptyCircle')) { + var sector = new Sector({ + shape: getBasicPieLayout(seriesModel, api) + }); + sector.useStyle(seriesModel.getModel('emptyCircleStyle').getItemStyle()); + this._emptyCircleSector = sector; + group.add(sector); + } + data.diff(oldData).add(function (idx) { + var piePiece = new PiePiece(data, idx, startAngle); + data.setItemGraphicEl(idx, piePiece); + group.add(piePiece); + }).update(function (newIdx, oldIdx) { + var piePiece = oldData.getItemGraphicEl(oldIdx); + piePiece.updateData(data, newIdx, startAngle); + piePiece.off('click'); + group.add(piePiece); + data.setItemGraphicEl(newIdx, piePiece); + }).remove(function (idx) { + var piePiece = oldData.getItemGraphicEl(idx); + removeElementWithFadeOut(piePiece, seriesModel, idx); + }).execute(); + pieLabelLayout(seriesModel); // Always use initial animation. - if (data.count() === 0 && seriesModel.get('showEmptyCircle')) { - var sector = new Sector({ - shape: getBasicPieLayout(seriesModel, api) - }); - sector.useStyle(seriesModel.getModel('emptyCircleStyle').getItemStyle()); - this._emptyCircleSector = sector; - group.add(sector); - } - - data.diff(oldData).add(function (idx) { - var piePiece = new PiePiece(data, idx, startAngle); - data.setItemGraphicEl(idx, piePiece); - group.add(piePiece); - }).update(function (newIdx, oldIdx) { - var piePiece = oldData.getItemGraphicEl(oldIdx); - piePiece.updateData(data, newIdx, startAngle); - piePiece.off('click'); - group.add(piePiece); - data.setItemGraphicEl(newIdx, piePiece); - }).remove(function (idx) { - var piePiece = oldData.getItemGraphicEl(idx); - removeElementWithFadeOut(piePiece, seriesModel, idx); - }).execute(); - pieLabelLayout(seriesModel); // Always use initial animation. - - if (seriesModel.get('animationTypeUpdate') !== 'expansion') { - this._data = data; - } - }; + if (seriesModel.get('animationTypeUpdate') !== 'expansion') { + this._data = data; + } + }; - PieView.prototype.dispose = function () {}; + PieView.prototype.dispose = function () {}; - PieView.prototype.containPoint = function (point, seriesModel) { - var data = seriesModel.getData(); - var itemLayout = data.getItemLayout(0); + PieView.prototype.containPoint = function (point, seriesModel) { + var data = seriesModel.getData(); + var itemLayout = data.getItemLayout(0); - if (itemLayout) { - var dx = point[0] - itemLayout.cx; - var dy = point[1] - itemLayout.cy; - var radius = Math.sqrt(dx * dx + dy * dy); - return radius <= itemLayout.r && radius >= itemLayout.r0; - } - }; + if (itemLayout) { + var dx = point[0] - itemLayout.cx; + var dy = point[1] - itemLayout.cy; + var radius = Math.sqrt(dx * dx + dy * dy); + return radius <= itemLayout.r && radius >= itemLayout.r0; + } + }; - PieView.type = 'pie'; - return PieView; - }(ChartView); + PieView.type = 'pie'; + return PieView; + }(ChartView); /** * [Usage]: @@ -45821,16 +45821,16 @@ */ function createSeriesDataSimply(seriesModel, opt, nameList) { - opt = isArray(opt) && { - coordDimensions: opt - } || extend({ - encodeDefine: seriesModel.getEncode() - }, opt); - var source = seriesModel.getSource(); - var dimensions = prepareSeriesDataSchema(source, opt).dimensions; - var list = new SeriesData(dimensions, seriesModel); - list.initData(source, nameList); - return list; + opt = isArray(opt) && { + coordDimensions: opt + } || extend({ + encodeDefine: seriesModel.getEncode() + }, opt); + var source = seriesModel.getSource(); + var dimensions = prepareSeriesDataSchema(source, opt).dimensions; + var list = new SeriesData(dimensions, seriesModel); + list.initData(source, nameList); + return list; } /* @@ -45881,967 +45881,967 @@ * provide to the legend component. */ var LegendVisualProvider = - /** @class */ - function () { - function LegendVisualProvider( // Function to get data after filtered. It stores all the encoding info - getDataWithEncodedVisual, // Function to get raw data before filtered. - getRawData) { - this._getDataWithEncodedVisual = getDataWithEncodedVisual; - this._getRawData = getRawData; - } + /** @class */ + function () { + function LegendVisualProvider( // Function to get data after filtered. It stores all the encoding info + getDataWithEncodedVisual, // Function to get raw data before filtered. + getRawData) { + this._getDataWithEncodedVisual = getDataWithEncodedVisual; + this._getRawData = getRawData; + } - LegendVisualProvider.prototype.getAllNames = function () { - var rawData = this._getRawData(); // We find the name from the raw data. In case it's filtered by the legend component. - // Normally, the name can be found in rawData, but can't be found in filtered data will display as gray. + LegendVisualProvider.prototype.getAllNames = function () { + var rawData = this._getRawData(); // We find the name from the raw data. In case it's filtered by the legend component. + // Normally, the name can be found in rawData, but can't be found in filtered data will display as gray. - return rawData.mapArray(rawData.getName); - }; + return rawData.mapArray(rawData.getName); + }; - LegendVisualProvider.prototype.containName = function (name) { - var rawData = this._getRawData(); + LegendVisualProvider.prototype.containName = function (name) { + var rawData = this._getRawData(); - return rawData.indexOfName(name) >= 0; - }; + return rawData.indexOfName(name) >= 0; + }; - LegendVisualProvider.prototype.indexOfName = function (name) { - // Only get data when necessary. - // Because LegendVisualProvider constructor may be new in the stage that data is not prepared yet. - // Invoking Series#getData immediately will throw an error. - var dataWithEncodedVisual = this._getDataWithEncodedVisual(); + LegendVisualProvider.prototype.indexOfName = function (name) { + // Only get data when necessary. + // Because LegendVisualProvider constructor may be new in the stage that data is not prepared yet. + // Invoking Series#getData immediately will throw an error. + var dataWithEncodedVisual = this._getDataWithEncodedVisual(); - return dataWithEncodedVisual.indexOfName(name); - }; + return dataWithEncodedVisual.indexOfName(name); + }; - LegendVisualProvider.prototype.getItemVisual = function (dataIndex, key) { - // Get encoded visual properties from final filtered data. - var dataWithEncodedVisual = this._getDataWithEncodedVisual(); + LegendVisualProvider.prototype.getItemVisual = function (dataIndex, key) { + // Get encoded visual properties from final filtered data. + var dataWithEncodedVisual = this._getDataWithEncodedVisual(); - return dataWithEncodedVisual.getItemVisual(dataIndex, key); - }; + return dataWithEncodedVisual.getItemVisual(dataIndex, key); + }; - return LegendVisualProvider; - }(); + return LegendVisualProvider; + }(); var PieSeriesModel = - /** @class */ - function (_super) { - __extends(PieSeriesModel, _super); + /** @class */ + function (_super) { + __extends(PieSeriesModel, _super); + + function PieSeriesModel() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * @overwrite + */ - function PieSeriesModel() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * @overwrite - */ + PieSeriesModel.prototype.init = function (option) { + _super.prototype.init.apply(this, arguments); // Enable legend selection for each data item + // Use a function instead of direct access because data reference may changed - PieSeriesModel.prototype.init = function (option) { - _super.prototype.init.apply(this, arguments); // Enable legend selection for each data item - // Use a function instead of direct access because data reference may changed + this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this)); - this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this)); + this._defaultLabelLine(option); + }; + /** + * @overwrite + */ - this._defaultLabelLine(option); - }; - /** - * @overwrite - */ + PieSeriesModel.prototype.mergeOption = function () { + _super.prototype.mergeOption.apply(this, arguments); + }; + /** + * @overwrite + */ - PieSeriesModel.prototype.mergeOption = function () { - _super.prototype.mergeOption.apply(this, arguments); - }; - /** - * @overwrite - */ + PieSeriesModel.prototype.getInitialData = function () { + return createSeriesDataSimply(this, { + coordDimensions: ['value'], + encodeDefaulter: curry(makeSeriesEncodeForNameBased, this) + }); + }; + /** + * @overwrite + */ - PieSeriesModel.prototype.getInitialData = function () { - return createSeriesDataSimply(this, { - coordDimensions: ['value'], - encodeDefaulter: curry(makeSeriesEncodeForNameBased, this) - }); - }; - /** - * @overwrite - */ + PieSeriesModel.prototype.getDataParams = function (dataIndex) { + var data = this.getData(); - PieSeriesModel.prototype.getDataParams = function (dataIndex) { - var data = this.getData(); + var params = _super.prototype.getDataParams.call(this, dataIndex); // FIXME toFixed? - var params = _super.prototype.getDataParams.call(this, dataIndex); // FIXME toFixed? + var valueList = []; + data.each(data.mapDimension('value'), function (value) { + valueList.push(value); + }); + params.percent = getPercentWithPrecision(valueList, dataIndex, data.hostModel.get('percentPrecision')); + params.$vars.push('percent'); + return params; + }; + + PieSeriesModel.prototype._defaultLabelLine = function (option) { + // Extend labelLine emphasis + defaultEmphasis(option, 'labelLine', ['show']); + var labelLineNormalOpt = option.labelLine; + var labelLineEmphasisOpt = option.emphasis.labelLine; // Not show label line if `label.normal.show = false` + + labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show; + labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show; + }; + + PieSeriesModel.type = 'series.pie'; + PieSeriesModel.defaultOption = { + // zlevel: 0, + z: 2, + legendHoverLink: true, + colorBy: 'data', + // 默认全局居中 + center: ['50%', '50%'], + radius: [0, '75%'], + // 默认顺时针 + clockwise: true, + startAngle: 90, + // 最小角度改为0 + minAngle: 0, + // If the angle of a sector less than `minShowLabelAngle`, + // the label will not be displayed. + minShowLabelAngle: 0, + // 选中时扇区偏移量 + selectedOffset: 10, + // 选择模式,默认关闭,可选single,multiple + // selectedMode: false, + // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) + // roseType: null, + percentPrecision: 2, + // If still show when all data zero. + stillShowZeroSum: true, + // cursor: null, + left: 0, + top: 0, + right: 0, + bottom: 0, + width: null, + height: null, + label: { + // color: 'inherit', + // If rotate around circle + rotate: 0, + show: true, + overflow: 'truncate', + // 'outer', 'inside', 'center' + position: 'outer', + // 'none', 'labelLine', 'edge'. Works only when position is 'outer' + alignTo: 'none', + // Closest distance between label and chart edge. + // Works only position is 'outer' and alignTo is 'edge'. + edgeDistance: '25%', + // Works only position is 'outer' and alignTo is not 'edge'. + bleedMargin: 10, + // Distance between text and label line. + distanceToLabelLine: 5 // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // 默认使用全局文本样式,详见TEXTSTYLE + // distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数 - var valueList = []; - data.each(data.mapDimension('value'), function (value) { - valueList.push(value); - }); - params.percent = getPercentWithPrecision(valueList, dataIndex, data.hostModel.get('percentPrecision')); - params.$vars.push('percent'); - return params; - }; + }, + // Enabled when label.normal.position is 'outer' + labelLine: { + show: true, + // 引导线两段中的第一段长度 + length: 15, + // 引导线两段中的第二段长度 + length2: 15, + smooth: false, + minTurnAngle: 90, + maxSurfaceAngle: 90, + lineStyle: { + // color: 各异, + width: 1, + type: 'solid' + } + }, + itemStyle: { + borderWidth: 1, + borderJoin: 'round' + }, + showEmptyCircle: true, + emptyCircleStyle: { + color: 'lightgray', + opacity: 1 + }, + labelLayout: { + // Hide the overlapped label. + hideOverlap: true + }, + emphasis: { + scale: true, + scaleSize: 5 + }, + // If use strategy to avoid label overlapping + avoidLabelOverlap: true, + // Animation type. Valid values: expansion, scale + animationType: 'expansion', + animationDuration: 1000, + // Animation type when update. Valid values: transition, expansion + animationTypeUpdate: 'transition', + animationEasingUpdate: 'cubicInOut', + animationDurationUpdate: 500, + animationEasing: 'cubicInOut' + }; + return PieSeriesModel; + }(SeriesModel); - PieSeriesModel.prototype._defaultLabelLine = function (option) { - // Extend labelLine emphasis - defaultEmphasis(option, 'labelLine', ['show']); - var labelLineNormalOpt = option.labelLine; - var labelLineEmphasisOpt = option.emphasis.labelLine; // Not show label line if `label.normal.show = false` + function negativeDataFilter(seriesType) { + return { + seriesType: seriesType, + reset: function (seriesModel, ecModel) { + var data = seriesModel.getData(); + data.filterSelf(function (idx) { + // handle negative value condition + var valueDim = data.mapDimension('value'); + var curValue = data.get(valueDim, idx); - labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show; - labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show; - }; + if (isNumber(curValue) && !isNaN(curValue) && curValue < 0) { + return false; + } - PieSeriesModel.type = 'series.pie'; - PieSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - legendHoverLink: true, - colorBy: 'data', - // 默认全局居中 - center: ['50%', '50%'], - radius: [0, '75%'], - // 默认顺时针 - clockwise: true, - startAngle: 90, - // 最小角度改为0 - minAngle: 0, - // If the angle of a sector less than `minShowLabelAngle`, - // the label will not be displayed. - minShowLabelAngle: 0, - // 选中时扇区偏移量 - selectedOffset: 10, - // 选择模式,默认关闭,可选single,multiple - // selectedMode: false, - // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) - // roseType: null, - percentPrecision: 2, - // If still show when all data zero. - stillShowZeroSum: true, - // cursor: null, - left: 0, - top: 0, - right: 0, - bottom: 0, - width: null, - height: null, - label: { - // color: 'inherit', - // If rotate around circle - rotate: 0, - show: true, - overflow: 'truncate', - // 'outer', 'inside', 'center' - position: 'outer', - // 'none', 'labelLine', 'edge'. Works only when position is 'outer' - alignTo: 'none', - // Closest distance between label and chart edge. - // Works only position is 'outer' and alignTo is 'edge'. - edgeDistance: '25%', - // Works only position is 'outer' and alignTo is not 'edge'. - bleedMargin: 10, - // Distance between text and label line. - distanceToLabelLine: 5 // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 - // 默认使用全局文本样式,详见TEXTSTYLE - // distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数 + return true; + }); + } + }; + } - }, - // Enabled when label.normal.position is 'outer' - labelLine: { - show: true, - // 引导线两段中的第一段长度 - length: 15, - // 引导线两段中的第二段长度 - length2: 15, - smooth: false, - minTurnAngle: 90, - maxSurfaceAngle: 90, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - }, - itemStyle: { - borderWidth: 1, - borderJoin: 'round' - }, - showEmptyCircle: true, - emptyCircleStyle: { - color: 'lightgray', - opacity: 1 - }, - labelLayout: { - // Hide the overlapped label. - hideOverlap: true - }, - emphasis: { - scale: true, - scaleSize: 5 - }, - // If use strategy to avoid label overlapping - avoidLabelOverlap: true, - // Animation type. Valid values: expansion, scale - animationType: 'expansion', - animationDuration: 1000, - // Animation type when update. Valid values: transition, expansion - animationTypeUpdate: 'transition', - animationEasingUpdate: 'cubicInOut', - animationDurationUpdate: 500, - animationEasing: 'cubicInOut' - }; - return PieSeriesModel; - }(SeriesModel); - - function negativeDataFilter(seriesType) { - return { - seriesType: seriesType, - reset: function (seriesModel, ecModel) { - var data = seriesModel.getData(); - data.filterSelf(function (idx) { - // handle negative value condition - var valueDim = data.mapDimension('value'); - var curValue = data.get(valueDim, idx); - - if (isNumber(curValue) && !isNaN(curValue) && curValue < 0) { - return false; - } - - return true; - }); - } - }; - } - - function install$4(registers) { - registers.registerChartView(PieView); - registers.registerSeriesModel(PieSeriesModel); - createLegacyDataSelectAction('pie', registers.registerAction); - registers.registerLayout(curry(pieLayout, 'pie')); - registers.registerProcessor(dataFilter('pie')); - registers.registerProcessor(negativeDataFilter('pie')); - } + function install$4(registers) { + registers.registerChartView(PieView); + registers.registerSeriesModel(PieSeriesModel); + createLegacyDataSelectAction('pie', registers.registerAction); + registers.registerLayout(curry(pieLayout, 'pie')); + registers.registerProcessor(dataFilter('pie')); + registers.registerProcessor(negativeDataFilter('pie')); + } var ScatterSeriesModel = - /** @class */ - function (_super) { - __extends(ScatterSeriesModel, _super); + /** @class */ + function (_super) { + __extends(ScatterSeriesModel, _super); - function ScatterSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function ScatterSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ScatterSeriesModel.type; - _this.hasSymbolVisual = true; - return _this; - } + _this.type = ScatterSeriesModel.type; + _this.hasSymbolVisual = true; + return _this; + } - ScatterSeriesModel.prototype.getInitialData = function (option, ecModel) { - return createSeriesData(null, this, { - useEncodeDefaulter: true - }); - }; + ScatterSeriesModel.prototype.getInitialData = function (option, ecModel) { + return createSeriesData(null, this, { + useEncodeDefaulter: true + }); + }; - ScatterSeriesModel.prototype.getProgressive = function () { - var progressive = this.option.progressive; + ScatterSeriesModel.prototype.getProgressive = function () { + var progressive = this.option.progressive; - if (progressive == null) { - // PENDING - return this.option.large ? 5e3 : this.get('progressive'); - } + if (progressive == null) { + // PENDING + return this.option.large ? 5e3 : this.get('progressive'); + } - return progressive; - }; + return progressive; + }; - ScatterSeriesModel.prototype.getProgressiveThreshold = function () { - var progressiveThreshold = this.option.progressiveThreshold; + ScatterSeriesModel.prototype.getProgressiveThreshold = function () { + var progressiveThreshold = this.option.progressiveThreshold; - if (progressiveThreshold == null) { - // PENDING - return this.option.large ? 1e4 : this.get('progressiveThreshold'); - } + if (progressiveThreshold == null) { + // PENDING + return this.option.large ? 1e4 : this.get('progressiveThreshold'); + } - return progressiveThreshold; - }; + return progressiveThreshold; + }; - ScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) { - return selectors.point(data.getItemLayout(dataIndex)); - }; + ScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) { + return selectors.point(data.getItemLayout(dataIndex)); + }; - ScatterSeriesModel.prototype.getZLevelKey = function () { - // Each progressive series has individual key. - return this.getData().count() > this.getProgressiveThreshold() ? this.id : ''; - }; + ScatterSeriesModel.prototype.getZLevelKey = function () { + // Each progressive series has individual key. + return this.getData().count() > this.getProgressiveThreshold() ? this.id : ''; + }; - ScatterSeriesModel.type = 'series.scatter'; - ScatterSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar']; - ScatterSeriesModel.defaultOption = { - coordinateSystem: 'cartesian2d', - // zlevel: 0, - z: 2, - legendHoverLink: true, - symbolSize: 10, - // symbolRotate: null, // 图形旋转控制 - large: false, - // Available when large is true - largeThreshold: 2000, - // cursor: null, - itemStyle: { - opacity: 0.8 // color: 各异 + ScatterSeriesModel.type = 'series.scatter'; + ScatterSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar']; + ScatterSeriesModel.defaultOption = { + coordinateSystem: 'cartesian2d', + // zlevel: 0, + z: 2, + legendHoverLink: true, + symbolSize: 10, + // symbolRotate: null, // 图形旋转控制 + large: false, + // Available when large is true + largeThreshold: 2000, + // cursor: null, + itemStyle: { + opacity: 0.8 // color: 各异 - }, - emphasis: { - scale: true - }, - // If clip the overflow graphics - // Works on cartesian / polar series - clip: true, - select: { - itemStyle: { - borderColor: '#212121' - } - }, - universalTransition: { - divideShape: 'clone' - } // progressive: null + }, + emphasis: { + scale: true + }, + // If clip the overflow graphics + // Works on cartesian / polar series + clip: true, + select: { + itemStyle: { + borderColor: '#212121' + } + }, + universalTransition: { + divideShape: 'clone' + } // progressive: null - }; - return ScatterSeriesModel; - }(SeriesModel); + }; + return ScatterSeriesModel; + }(SeriesModel); var BOOST_SIZE_THRESHOLD = 4; var LargeSymbolPathShape = - /** @class */ - function () { - function LargeSymbolPathShape() {} + /** @class */ + function () { + function LargeSymbolPathShape() {} - return LargeSymbolPathShape; - }(); + return LargeSymbolPathShape; + }(); var LargeSymbolPath = - /** @class */ - function (_super) { - __extends(LargeSymbolPath, _super); + /** @class */ + function (_super) { + __extends(LargeSymbolPath, _super); - function LargeSymbolPath(opts) { - var _this = _super.call(this, opts) || this; + function LargeSymbolPath(opts) { + var _this = _super.call(this, opts) || this; - _this._off = 0; - _this.hoverDataIdx = -1; - return _this; - } + _this._off = 0; + _this.hoverDataIdx = -1; + return _this; + } - LargeSymbolPath.prototype.getDefaultShape = function () { - return new LargeSymbolPathShape(); - }; + LargeSymbolPath.prototype.getDefaultShape = function () { + return new LargeSymbolPathShape(); + }; - LargeSymbolPath.prototype.reset = function () { - this.notClear = false; - this._off = 0; - }; + LargeSymbolPath.prototype.reset = function () { + this.notClear = false; + this._off = 0; + }; - LargeSymbolPath.prototype.buildPath = function (path, shape) { - var points = shape.points; - var size = shape.size; - var symbolProxy = this.symbolProxy; - var symbolProxyShape = symbolProxy.shape; - var ctx = path.getContext ? path.getContext() : path; - var canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD; - var softClipShape = this.softClipShape; - var i; // Do draw in afterBrush. - - if (canBoost) { - this._ctx = ctx; - return; - } + LargeSymbolPath.prototype.buildPath = function (path, shape) { + var points = shape.points; + var size = shape.size; + var symbolProxy = this.symbolProxy; + var symbolProxyShape = symbolProxy.shape; + var ctx = path.getContext ? path.getContext() : path; + var canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD; + var softClipShape = this.softClipShape; + var i; // Do draw in afterBrush. - this._ctx = null; + if (canBoost) { + this._ctx = ctx; + return; + } - for (i = this._off; i < points.length;) { - var x = points[i++]; - var y = points[i++]; + this._ctx = null; - if (isNaN(x) || isNaN(y)) { - continue; - } + for (i = this._off; i < points.length;) { + var x = points[i++]; + var y = points[i++]; - if (softClipShape && !softClipShape.contain(x, y)) { - continue; - } + if (isNaN(x) || isNaN(y)) { + continue; + } - symbolProxyShape.x = x - size[0] / 2; - symbolProxyShape.y = y - size[1] / 2; - symbolProxyShape.width = size[0]; - symbolProxyShape.height = size[1]; - symbolProxy.buildPath(path, symbolProxyShape, true); - } + if (softClipShape && !softClipShape.contain(x, y)) { + continue; + } - if (this.incremental) { - this._off = i; - this.notClear = true; - } - }; + symbolProxyShape.x = x - size[0] / 2; + symbolProxyShape.y = y - size[1] / 2; + symbolProxyShape.width = size[0]; + symbolProxyShape.height = size[1]; + symbolProxy.buildPath(path, symbolProxyShape, true); + } - LargeSymbolPath.prototype.afterBrush = function () { - var shape = this.shape; - var points = shape.points; - var size = shape.size; - var ctx = this._ctx; - var softClipShape = this.softClipShape; - var i; + if (this.incremental) { + this._off = i; + this.notClear = true; + } + }; - if (!ctx) { - return; - } // PENDING If style or other canvas status changed? + LargeSymbolPath.prototype.afterBrush = function () { + var shape = this.shape; + var points = shape.points; + var size = shape.size; + var ctx = this._ctx; + var softClipShape = this.softClipShape; + var i; + if (!ctx) { + return; + } // PENDING If style or other canvas status changed? - for (i = this._off; i < points.length;) { - var x = points[i++]; - var y = points[i++]; - if (isNaN(x) || isNaN(y)) { - continue; - } + for (i = this._off; i < points.length;) { + var x = points[i++]; + var y = points[i++]; - if (softClipShape && !softClipShape.contain(x, y)) { - continue; - } // fillRect is faster than building a rect path and draw. - // And it support light globalCompositeOperation. + if (isNaN(x) || isNaN(y)) { + continue; + } + if (softClipShape && !softClipShape.contain(x, y)) { + continue; + } // fillRect is faster than building a rect path and draw. + // And it support light globalCompositeOperation. - ctx.fillRect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]); - } - if (this.incremental) { - this._off = i; - this.notClear = true; - } - }; + ctx.fillRect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]); + } - LargeSymbolPath.prototype.findDataIndex = function (x, y) { - // TODO ??? - // Consider transform - var shape = this.shape; - var points = shape.points; - var size = shape.size; - var w = Math.max(size[0], 4); - var h = Math.max(size[1], 4); // Not consider transform - // Treat each element as a rect - // top down traverse - - for (var idx = points.length / 2 - 1; idx >= 0; idx--) { - var i = idx * 2; - var x0 = points[i] - w / 2; - var y0 = points[i + 1] - h / 2; - - if (x >= x0 && y >= y0 && x <= x0 + w && y <= y0 + h) { - return idx; - } - } + if (this.incremental) { + this._off = i; + this.notClear = true; + } + }; - return -1; - }; + LargeSymbolPath.prototype.findDataIndex = function (x, y) { + // TODO ??? + // Consider transform + var shape = this.shape; + var points = shape.points; + var size = shape.size; + var w = Math.max(size[0], 4); + var h = Math.max(size[1], 4); // Not consider transform + // Treat each element as a rect + // top down traverse - LargeSymbolPath.prototype.contain = function (x, y) { - var localPos = this.transformCoordToLocal(x, y); - var rect = this.getBoundingRect(); - x = localPos[0]; - y = localPos[1]; + for (var idx = points.length / 2 - 1; idx >= 0; idx--) { + var i = idx * 2; + var x0 = points[i] - w / 2; + var y0 = points[i + 1] - h / 2; - if (rect.contain(x, y)) { - // Cache found data index. - var dataIdx = this.hoverDataIdx = this.findDataIndex(x, y); - return dataIdx >= 0; - } + if (x >= x0 && y >= y0 && x <= x0 + w && y <= y0 + h) { + return idx; + } + } - this.hoverDataIdx = -1; - return false; - }; + return -1; + }; - LargeSymbolPath.prototype.getBoundingRect = function () { - // Ignore stroke for large symbol draw. - var rect = this._rect; - - if (!rect) { - var shape = this.shape; - var points = shape.points; - var size = shape.size; - var w = size[0]; - var h = size[1]; - var minX = Infinity; - var minY = Infinity; - var maxX = -Infinity; - var maxY = -Infinity; - - for (var i = 0; i < points.length;) { - var x = points[i++]; - var y = points[i++]; - minX = Math.min(x, minX); - maxX = Math.max(x, maxX); - minY = Math.min(y, minY); - maxY = Math.max(y, maxY); - } + LargeSymbolPath.prototype.contain = function (x, y) { + var localPos = this.transformCoordToLocal(x, y); + var rect = this.getBoundingRect(); + x = localPos[0]; + y = localPos[1]; - rect = this._rect = new BoundingRect(minX - w / 2, minY - h / 2, maxX - minX + w, maxY - minY + h); - } + if (rect.contain(x, y)) { + // Cache found data index. + var dataIdx = this.hoverDataIdx = this.findDataIndex(x, y); + return dataIdx >= 0; + } - return rect; - }; + this.hoverDataIdx = -1; + return false; + }; + + LargeSymbolPath.prototype.getBoundingRect = function () { + // Ignore stroke for large symbol draw. + var rect = this._rect; + + if (!rect) { + var shape = this.shape; + var points = shape.points; + var size = shape.size; + var w = size[0]; + var h = size[1]; + var minX = Infinity; + var minY = Infinity; + var maxX = -Infinity; + var maxY = -Infinity; + + for (var i = 0; i < points.length;) { + var x = points[i++]; + var y = points[i++]; + minX = Math.min(x, minX); + maxX = Math.max(x, maxX); + minY = Math.min(y, minY); + maxY = Math.max(y, maxY); + } + + rect = this._rect = new BoundingRect(minX - w / 2, minY - h / 2, maxX - minX + w, maxY - minY + h); + } + + return rect; + }; - return LargeSymbolPath; - }(Path); + return LargeSymbolPath; + }(Path); var LargeSymbolDraw = - /** @class */ - function () { - function LargeSymbolDraw() { - this.group = new Group(); - } - /** - * Update symbols draw by new data - */ + /** @class */ + function () { + function LargeSymbolDraw() { + this.group = new Group(); + } + /** + * Update symbols draw by new data + */ - LargeSymbolDraw.prototype.updateData = function (data, opt) { - this._clear(); + LargeSymbolDraw.prototype.updateData = function (data, opt) { + this._clear(); - var symbolEl = this._create(); + var symbolEl = this._create(); - symbolEl.setShape({ - points: data.getLayout('points') - }); + symbolEl.setShape({ + points: data.getLayout('points') + }); - this._setCommon(symbolEl, data, opt); - }; + this._setCommon(symbolEl, data, opt); + }; - LargeSymbolDraw.prototype.updateLayout = function (data) { - var points = data.getLayout('points'); - this.group.eachChild(function (child) { - if (child.startIndex != null) { - var len = (child.endIndex - child.startIndex) * 2; - var byteOffset = child.startIndex * 4 * 2; - points = new Float32Array(points.buffer, byteOffset, len); - } + LargeSymbolDraw.prototype.updateLayout = function (data) { + var points = data.getLayout('points'); + this.group.eachChild(function (child) { + if (child.startIndex != null) { + var len = (child.endIndex - child.startIndex) * 2; + var byteOffset = child.startIndex * 4 * 2; + points = new Float32Array(points.buffer, byteOffset, len); + } - child.setShape('points', points); // Reset draw cursor. + child.setShape('points', points); // Reset draw cursor. - child.reset(); - }); - }; + child.reset(); + }); + }; - LargeSymbolDraw.prototype.incrementalPrepareUpdate = function (data) { - this._clear(); - }; + LargeSymbolDraw.prototype.incrementalPrepareUpdate = function (data) { + this._clear(); + }; - LargeSymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) { - var lastAdded = this._newAdded[0]; - var points = data.getLayout('points'); - var oldPoints = lastAdded && lastAdded.shape.points; // Merging the exists. Each element has 1e4 points. - // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization) + LargeSymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) { + var lastAdded = this._newAdded[0]; + var points = data.getLayout('points'); + var oldPoints = lastAdded && lastAdded.shape.points; // Merging the exists. Each element has 1e4 points. + // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization) - if (oldPoints && oldPoints.length < 2e4) { - var oldLen = oldPoints.length; - var newPoints = new Float32Array(oldLen + points.length); // Concat two array + if (oldPoints && oldPoints.length < 2e4) { + var oldLen = oldPoints.length; + var newPoints = new Float32Array(oldLen + points.length); // Concat two array - newPoints.set(oldPoints); - newPoints.set(points, oldLen); // Update endIndex + newPoints.set(oldPoints); + newPoints.set(points, oldLen); // Update endIndex - lastAdded.endIndex = taskParams.end; - lastAdded.setShape({ - points: newPoints - }); - } else { - // Clear - this._newAdded = []; + lastAdded.endIndex = taskParams.end; + lastAdded.setShape({ + points: newPoints + }); + } else { + // Clear + this._newAdded = []; - var symbolEl = this._create(); + var symbolEl = this._create(); - symbolEl.startIndex = taskParams.start; - symbolEl.endIndex = taskParams.end; - symbolEl.incremental = true; - symbolEl.setShape({ - points: points - }); + symbolEl.startIndex = taskParams.start; + symbolEl.endIndex = taskParams.end; + symbolEl.incremental = true; + symbolEl.setShape({ + points: points + }); - this._setCommon(symbolEl, data, opt); - } - }; + this._setCommon(symbolEl, data, opt); + } + }; - LargeSymbolDraw.prototype.eachRendered = function (cb) { - this._newAdded[0] && cb(this._newAdded[0]); - }; + LargeSymbolDraw.prototype.eachRendered = function (cb) { + this._newAdded[0] && cb(this._newAdded[0]); + }; - LargeSymbolDraw.prototype._create = function () { - var symbolEl = new LargeSymbolPath({ - cursor: 'default' - }); - this.group.add(symbolEl); + LargeSymbolDraw.prototype._create = function () { + var symbolEl = new LargeSymbolPath({ + cursor: 'default' + }); + this.group.add(symbolEl); - this._newAdded.push(symbolEl); + this._newAdded.push(symbolEl); - return symbolEl; - }; + return symbolEl; + }; - LargeSymbolDraw.prototype._setCommon = function (symbolEl, data, opt) { - var hostModel = data.hostModel; - opt = opt || {}; - var size = data.getVisual('symbolSize'); - symbolEl.setShape('size', size instanceof Array ? size : [size, size]); - symbolEl.softClipShape = opt.clipShape || null; // Create symbolProxy to build path for each data + LargeSymbolDraw.prototype._setCommon = function (symbolEl, data, opt) { + var hostModel = data.hostModel; + opt = opt || {}; + var size = data.getVisual('symbolSize'); + symbolEl.setShape('size', size instanceof Array ? size : [size, size]); + symbolEl.softClipShape = opt.clipShape || null; // Create symbolProxy to build path for each data - symbolEl.symbolProxy = createSymbol(data.getVisual('symbol'), 0, 0, 0, 0); // Use symbolProxy setColor method + symbolEl.symbolProxy = createSymbol(data.getVisual('symbol'), 0, 0, 0, 0); // Use symbolProxy setColor method - symbolEl.setColor = symbolEl.symbolProxy.setColor; - var extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD; - symbolEl.useStyle( // Draw shadow when doing fillRect is extremely slow. - hostModel.getModel('itemStyle').getItemStyle(extrudeShadow ? ['color', 'shadowBlur', 'shadowColor'] : ['color'])); - var globalStyle = data.getVisual('style'); - var visualColor = globalStyle && globalStyle.fill; + symbolEl.setColor = symbolEl.symbolProxy.setColor; + var extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD; + symbolEl.useStyle( // Draw shadow when doing fillRect is extremely slow. + hostModel.getModel('itemStyle').getItemStyle(extrudeShadow ? ['color', 'shadowBlur', 'shadowColor'] : ['color'])); + var globalStyle = data.getVisual('style'); + var visualColor = globalStyle && globalStyle.fill; - if (visualColor) { - symbolEl.setColor(visualColor); - } + if (visualColor) { + symbolEl.setColor(visualColor); + } - var ecData = getECData(symbolEl); // Enable tooltip - // PENDING May have performance issue when path is extremely large + var ecData = getECData(symbolEl); // Enable tooltip + // PENDING May have performance issue when path is extremely large - ecData.seriesIndex = hostModel.seriesIndex; - symbolEl.on('mousemove', function (e) { - ecData.dataIndex = null; - var dataIndex = symbolEl.hoverDataIdx; + ecData.seriesIndex = hostModel.seriesIndex; + symbolEl.on('mousemove', function (e) { + ecData.dataIndex = null; + var dataIndex = symbolEl.hoverDataIdx; - if (dataIndex >= 0) { - // Provide dataIndex for tooltip - ecData.dataIndex = dataIndex + (symbolEl.startIndex || 0); - } - }); - }; + if (dataIndex >= 0) { + // Provide dataIndex for tooltip + ecData.dataIndex = dataIndex + (symbolEl.startIndex || 0); + } + }); + }; - LargeSymbolDraw.prototype.remove = function () { - this._clear(); - }; + LargeSymbolDraw.prototype.remove = function () { + this._clear(); + }; - LargeSymbolDraw.prototype._clear = function () { - this._newAdded = []; - this.group.removeAll(); - }; + LargeSymbolDraw.prototype._clear = function () { + this._newAdded = []; + this.group.removeAll(); + }; - return LargeSymbolDraw; - }(); + return LargeSymbolDraw; + }(); var ScatterView = - /** @class */ - function (_super) { - __extends(ScatterView, _super); + /** @class */ + function (_super) { + __extends(ScatterView, _super); - function ScatterView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function ScatterView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ScatterView.type; - return _this; - } + _this.type = ScatterView.type; + return _this; + } - ScatterView.prototype.render = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); + ScatterView.prototype.render = function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); - var symbolDraw = this._updateSymbolDraw(data, seriesModel); + var symbolDraw = this._updateSymbolDraw(data, seriesModel); - symbolDraw.updateData(data, { - // TODO - // If this parameter should be a shape or a bounding volume - // shape will be more general. - // But bounding volume like bounding rect will be much faster in the contain calculation - clipShape: this._getClipShape(seriesModel) - }); - this._finished = true; - }; + symbolDraw.updateData(data, { + // TODO + // If this parameter should be a shape or a bounding volume + // shape will be more general. + // But bounding volume like bounding rect will be much faster in the contain calculation + clipShape: this._getClipShape(seriesModel) + }); + this._finished = true; + }; - ScatterView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); + ScatterView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); - var symbolDraw = this._updateSymbolDraw(data, seriesModel); + var symbolDraw = this._updateSymbolDraw(data, seriesModel); - symbolDraw.incrementalPrepareUpdate(data); - this._finished = false; - }; + symbolDraw.incrementalPrepareUpdate(data); + this._finished = false; + }; - ScatterView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) { - this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData(), { - clipShape: this._getClipShape(seriesModel) - }); + ScatterView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) { + this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData(), { + clipShape: this._getClipShape(seriesModel) + }); - this._finished = taskParams.end === seriesModel.getData().count(); - }; + this._finished = taskParams.end === seriesModel.getData().count(); + }; - ScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); // Must mark group dirty and make sure the incremental layer will be cleared - // PENDING + ScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); // Must mark group dirty and make sure the incremental layer will be cleared + // PENDING - this.group.dirty(); + this.group.dirty(); - if (!this._finished || data.count() > 1e4) { - return { - update: true - }; - } else { - var res = pointsLayout('').reset(seriesModel, ecModel, api); - - if (res.progress) { - res.progress({ - start: 0, - end: data.count(), - count: data.count() - }, data); - } + if (!this._finished || data.count() > 1e4) { + return { + update: true + }; + } else { + var res = pointsLayout('').reset(seriesModel, ecModel, api); - this._symbolDraw.updateLayout(data); - } - }; + if (res.progress) { + res.progress({ + start: 0, + end: data.count(), + count: data.count() + }, data); + } - ScatterView.prototype.eachRendered = function (cb) { - this._symbolDraw && this._symbolDraw.eachRendered(cb); - }; + this._symbolDraw.updateLayout(data); + } + }; - ScatterView.prototype._getClipShape = function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; - var clipArea = coordSys && coordSys.getArea && coordSys.getArea(); - return seriesModel.get('clip', true) ? clipArea : null; - }; + ScatterView.prototype.eachRendered = function (cb) { + this._symbolDraw && this._symbolDraw.eachRendered(cb); + }; + + ScatterView.prototype._getClipShape = function (seriesModel) { + var coordSys = seriesModel.coordinateSystem; + var clipArea = coordSys && coordSys.getArea && coordSys.getArea(); + return seriesModel.get('clip', true) ? clipArea : null; + }; - ScatterView.prototype._updateSymbolDraw = function (data, seriesModel) { - var symbolDraw = this._symbolDraw; - var pipelineContext = seriesModel.pipelineContext; - var isLargeDraw = pipelineContext.large; + ScatterView.prototype._updateSymbolDraw = function (data, seriesModel) { + var symbolDraw = this._symbolDraw; + var pipelineContext = seriesModel.pipelineContext; + var isLargeDraw = pipelineContext.large; - if (!symbolDraw || isLargeDraw !== this._isLargeDraw) { - symbolDraw && symbolDraw.remove(); - symbolDraw = this._symbolDraw = isLargeDraw ? new LargeSymbolDraw() : new SymbolDraw(); - this._isLargeDraw = isLargeDraw; - this.group.removeAll(); - } + if (!symbolDraw || isLargeDraw !== this._isLargeDraw) { + symbolDraw && symbolDraw.remove(); + symbolDraw = this._symbolDraw = isLargeDraw ? new LargeSymbolDraw() : new SymbolDraw(); + this._isLargeDraw = isLargeDraw; + this.group.removeAll(); + } - this.group.add(symbolDraw.group); - return symbolDraw; - }; + this.group.add(symbolDraw.group); + return symbolDraw; + }; - ScatterView.prototype.remove = function (ecModel, api) { - this._symbolDraw && this._symbolDraw.remove(true); - this._symbolDraw = null; - }; + ScatterView.prototype.remove = function (ecModel, api) { + this._symbolDraw && this._symbolDraw.remove(true); + this._symbolDraw = null; + }; - ScatterView.prototype.dispose = function () {}; + ScatterView.prototype.dispose = function () {}; - ScatterView.type = 'scatter'; - return ScatterView; - }(ChartView); + ScatterView.type = 'scatter'; + return ScatterView; + }(ChartView); var GridModel = - /** @class */ - function (_super) { - __extends(GridModel, _super); - - function GridModel() { - return _super !== null && _super.apply(this, arguments) || this; - } - - GridModel.type = 'grid'; - GridModel.dependencies = ['xAxis', 'yAxis']; - GridModel.layoutMode = 'box'; - GridModel.defaultOption = { - show: false, - // zlevel: 0, - z: 0, - left: '10%', - top: 60, - right: '10%', - bottom: 70, - // If grid size contain label - containLabel: false, - // width: {totalWidth} - left - right, - // height: {totalHeight} - top - bottom, - backgroundColor: 'rgba(0,0,0,0)', - borderWidth: 1, - borderColor: '#ccc' - }; - return GridModel; - }(ComponentModel); + /** @class */ + function (_super) { + __extends(GridModel, _super); + + function GridModel() { + return _super !== null && _super.apply(this, arguments) || this; + } + + GridModel.type = 'grid'; + GridModel.dependencies = ['xAxis', 'yAxis']; + GridModel.layoutMode = 'box'; + GridModel.defaultOption = { + show: false, + // zlevel: 0, + z: 0, + left: '10%', + top: 60, + right: '10%', + bottom: 70, + // If grid size contain label + containLabel: false, + // width: {totalWidth} - left - right, + // height: {totalHeight} - top - bottom, + backgroundColor: 'rgba(0,0,0,0)', + borderWidth: 1, + borderColor: '#ccc' + }; + return GridModel; + }(ComponentModel); var CartesianAxisModel = - /** @class */ - function (_super) { - __extends(CartesianAxisModel, _super); + /** @class */ + function (_super) { + __extends(CartesianAxisModel, _super); - function CartesianAxisModel() { - return _super !== null && _super.apply(this, arguments) || this; - } + function CartesianAxisModel() { + return _super !== null && _super.apply(this, arguments) || this; + } - CartesianAxisModel.prototype.getCoordSysModel = function () { - return this.getReferringComponents('grid', SINGLE_REFERRING).models[0]; - }; + CartesianAxisModel.prototype.getCoordSysModel = function () { + return this.getReferringComponents('grid', SINGLE_REFERRING).models[0]; + }; - CartesianAxisModel.type = 'cartesian2dAxis'; - return CartesianAxisModel; - }(ComponentModel); + CartesianAxisModel.type = 'cartesian2dAxis'; + return CartesianAxisModel; + }(ComponentModel); mixin(CartesianAxisModel, AxisModelCommonMixin); var defaultOption = { + show: true, + // zlevel: 0, + z: 0, + // Inverse the axis. + inverse: false, + // Axis name displayed. + name: '', + // 'start' | 'middle' | 'end' + nameLocation: 'end', + // By degree. By default auto rotate by nameLocation. + nameRotate: null, + nameTruncate: { + maxWidth: null, + ellipsis: '...', + placeholder: '.' + }, + // Use global text style by default. + nameTextStyle: {}, + // The gap between axisName and axisLine. + nameGap: 15, + // Default `false` to support tooltip. + silent: false, + // Default `false` to avoid legacy user event listener fail. + triggerEvent: false, + tooltip: { + show: false + }, + axisPointer: {}, + axisLine: { show: true, - // zlevel: 0, - z: 0, - // Inverse the axis. - inverse: false, - // Axis name displayed. - name: '', - // 'start' | 'middle' | 'end' - nameLocation: 'end', - // By degree. By default auto rotate by nameLocation. - nameRotate: null, - nameTruncate: { - maxWidth: null, - ellipsis: '...', - placeholder: '.' - }, - // Use global text style by default. - nameTextStyle: {}, - // The gap between axisName and axisLine. - nameGap: 15, - // Default `false` to support tooltip. - silent: false, - // Default `false` to avoid legacy user event listener fail. - triggerEvent: false, - tooltip: { - show: false - }, - axisPointer: {}, - axisLine: { - show: true, - onZero: true, - onZeroAxisIndex: null, - lineStyle: { - color: '#6E7079', - width: 1, - type: 'solid' - }, - // The arrow at both ends the the axis. - symbol: ['none', 'none'], - symbolSize: [10, 15] - }, - axisTick: { - show: true, - // Whether axisTick is inside the grid or outside the grid. - inside: false, - // The length of axisTick. - length: 5, - lineStyle: { - width: 1 - } - }, - axisLabel: { - show: true, - // Whether axisLabel is inside the grid or outside the grid. - inside: false, - rotate: 0, - // true | false | null/undefined (auto) - showMinLabel: null, - // true | false | null/undefined (auto) - showMaxLabel: null, - margin: 8, - // formatter: null, - fontSize: 12 + onZero: true, + onZeroAxisIndex: null, + lineStyle: { + color: '#6E7079', + width: 1, + type: 'solid' }, - splitLine: { - show: true, - lineStyle: { - color: ['#E0E6F1'], - width: 1, - type: 'solid' - } - }, - splitArea: { - show: false, - areaStyle: { - color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)'] - } - } + // The arrow at both ends the the axis. + symbol: ['none', 'none'], + symbolSize: [10, 15] + }, + axisTick: { + show: true, + // Whether axisTick is inside the grid or outside the grid. + inside: false, + // The length of axisTick. + length: 5, + lineStyle: { + width: 1 + } + }, + axisLabel: { + show: true, + // Whether axisLabel is inside the grid or outside the grid. + inside: false, + rotate: 0, + // true | false | null/undefined (auto) + showMinLabel: null, + // true | false | null/undefined (auto) + showMaxLabel: null, + margin: 8, + // formatter: null, + fontSize: 12 + }, + splitLine: { + show: true, + lineStyle: { + color: ['#E0E6F1'], + width: 1, + type: 'solid' + } + }, + splitArea: { + show: false, + areaStyle: { + color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)'] + } + } }; var categoryAxis = merge({ - // The gap at both ends of the axis. For categoryAxis, boolean. - boundaryGap: true, - // Set false to faster category collection. - deduplication: null, - // splitArea: { - // show: false - // }, - splitLine: { - show: false - }, - axisTick: { - // If tick is align with label when boundaryGap is true - alignWithLabel: false, - interval: 'auto' - }, - axisLabel: { - interval: 'auto' - } + // The gap at both ends of the axis. For categoryAxis, boolean. + boundaryGap: true, + // Set false to faster category collection. + deduplication: null, + // splitArea: { + // show: false + // }, + splitLine: { + show: false + }, + axisTick: { + // If tick is align with label when boundaryGap is true + alignWithLabel: false, + interval: 'auto' + }, + axisLabel: { + interval: 'auto' + } }, defaultOption); var valueAxis = merge({ - boundaryGap: [0, 0], - axisLine: { - // Not shown when other axis is categoryAxis in cartesian - show: 'auto' - }, - axisTick: { - // Not shown when other axis is categoryAxis in cartesian - show: 'auto' - }, - // TODO - // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60] + boundaryGap: [0, 0], + axisLine: { + // Not shown when other axis is categoryAxis in cartesian + show: 'auto' + }, + axisTick: { + // Not shown when other axis is categoryAxis in cartesian + show: 'auto' + }, + // TODO + // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60] + splitNumber: 5, + minorTick: { + // Minor tick, not available for cateogry axis. + show: false, + // Split number of minor ticks. The value should be in range of (0, 100) splitNumber: 5, - minorTick: { - // Minor tick, not available for cateogry axis. - show: false, - // Split number of minor ticks. The value should be in range of (0, 100) - splitNumber: 5, - // Lenght of minor tick - length: 3, - // Line style - lineStyle: {// Default to be same with axisTick - } - }, - minorSplitLine: { - show: false, - lineStyle: { - color: '#F4F7FD', - width: 1 - } - } + // Lenght of minor tick + length: 3, + // Line style + lineStyle: {// Default to be same with axisTick + } + }, + minorSplitLine: { + show: false, + lineStyle: { + color: '#F4F7FD', + width: 1 + } + } }, defaultOption); var timeAxis = merge({ - splitNumber: 6, - axisLabel: { - // To eliminate labels that are not nice - showMinLabel: false, - showMaxLabel: false, - rich: { - primary: { - fontWeight: 'bold' - } - } - }, - splitLine: { - show: false - } + splitNumber: 6, + axisLabel: { + // To eliminate labels that are not nice + showMinLabel: false, + showMaxLabel: false, + rich: { + primary: { + fontWeight: 'bold' + } + } + }, + splitLine: { + show: false + } }, valueAxis); var logAxis = defaults({ - logBase: 10 + logBase: 10 }, valueAxis); var axisDefault = { - category: categoryAxis, - value: valueAxis, - time: timeAxis, - log: logAxis + category: categoryAxis, + value: valueAxis, + time: timeAxis, + log: logAxis }; /* @@ -46887,10 +46887,10 @@ * under the License. */ var AXIS_TYPES = { - value: 1, - category: 1, - time: 1, - log: 1 + value: 1, + category: 1, + time: 1, + log: 1 }; /** @@ -46899,314 +46899,314 @@ */ function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) { - each(AXIS_TYPES, function (v, axisType) { - var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true); + each(AXIS_TYPES, function (v, axisType) { + var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true); - var AxisModel = - /** @class */ - function (_super) { - __extends(AxisModel, _super); + var AxisModel = + /** @class */ + function (_super) { + __extends(AxisModel, _super); - function AxisModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function AxisModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = axisName + 'Axis.' + axisType; - return _this; - } + _this.type = axisName + 'Axis.' + axisType; + return _this; + } - AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) { - var layoutMode = fetchLayoutMode(this); - var inputPositionParams = layoutMode ? getLayoutParams(option) : {}; - var themeModel = ecModel.getTheme(); - merge(option, themeModel.get(axisType + 'Axis')); - merge(option, this.getDefaultOption()); - option.type = getAxisType(option); + AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) { + var layoutMode = fetchLayoutMode(this); + var inputPositionParams = layoutMode ? getLayoutParams(option) : {}; + var themeModel = ecModel.getTheme(); + merge(option, themeModel.get(axisType + 'Axis')); + merge(option, this.getDefaultOption()); + option.type = getAxisType(option); - if (layoutMode) { - mergeLayoutParam(option, inputPositionParams, layoutMode); - } - }; + if (layoutMode) { + mergeLayoutParam(option, inputPositionParams, layoutMode); + } + }; - AxisModel.prototype.optionUpdated = function () { - var thisOption = this.option; + AxisModel.prototype.optionUpdated = function () { + var thisOption = this.option; - if (thisOption.type === 'category') { - this.__ordinalMeta = OrdinalMeta.createByAxisModel(this); - } - }; - /** - * Should not be called before all of 'getInitailData' finished. - * Because categories are collected during initializing data. - */ + if (thisOption.type === 'category') { + this.__ordinalMeta = OrdinalMeta.createByAxisModel(this); + } + }; + /** + * Should not be called before all of 'getInitailData' finished. + * Because categories are collected during initializing data. + */ - AxisModel.prototype.getCategories = function (rawData) { - var option = this.option; // FIXME - // warning if called before all of 'getInitailData' finished. + AxisModel.prototype.getCategories = function (rawData) { + var option = this.option; // FIXME + // warning if called before all of 'getInitailData' finished. - if (option.type === 'category') { - if (rawData) { - return option.data; - } + if (option.type === 'category') { + if (rawData) { + return option.data; + } - return this.__ordinalMeta.categories; - } - }; + return this.__ordinalMeta.categories; + } + }; - AxisModel.prototype.getOrdinalMeta = function () { - return this.__ordinalMeta; - }; + AxisModel.prototype.getOrdinalMeta = function () { + return this.__ordinalMeta; + }; - AxisModel.type = axisName + 'Axis.' + axisType; - AxisModel.defaultOption = defaultOption; - return AxisModel; - }(BaseAxisModelClass); + AxisModel.type = axisName + 'Axis.' + axisType; + AxisModel.defaultOption = defaultOption; + return AxisModel; + }(BaseAxisModelClass); - registers.registerComponentModel(AxisModel); - }); - registers.registerSubTypeDefaulter(axisName + 'Axis', getAxisType); + registers.registerComponentModel(AxisModel); + }); + registers.registerSubTypeDefaulter(axisName + 'Axis', getAxisType); } function getAxisType(option) { - // Default axis with data is category axis - return option.type || (option.data ? 'category' : 'value'); + // Default axis with data is category axis + return option.type || (option.data ? 'category' : 'value'); } var Cartesian = - /** @class */ - function () { - function Cartesian(name) { - this.type = 'cartesian'; - this._dimList = []; - this._axes = {}; - this.name = name || ''; - } - - Cartesian.prototype.getAxis = function (dim) { - return this._axes[dim]; - }; - - Cartesian.prototype.getAxes = function () { - return map(this._dimList, function (dim) { - return this._axes[dim]; - }, this); - }; + /** @class */ + function () { + function Cartesian(name) { + this.type = 'cartesian'; + this._dimList = []; + this._axes = {}; + this.name = name || ''; + } + + Cartesian.prototype.getAxis = function (dim) { + return this._axes[dim]; + }; + + Cartesian.prototype.getAxes = function () { + return map(this._dimList, function (dim) { + return this._axes[dim]; + }, this); + }; - Cartesian.prototype.getAxesByScale = function (scaleType) { - scaleType = scaleType.toLowerCase(); - return filter(this.getAxes(), function (axis) { - return axis.scale.type === scaleType; - }); - }; + Cartesian.prototype.getAxesByScale = function (scaleType) { + scaleType = scaleType.toLowerCase(); + return filter(this.getAxes(), function (axis) { + return axis.scale.type === scaleType; + }); + }; - Cartesian.prototype.addAxis = function (axis) { - var dim = axis.dim; - this._axes[dim] = axis; + Cartesian.prototype.addAxis = function (axis) { + var dim = axis.dim; + this._axes[dim] = axis; - this._dimList.push(dim); - }; + this._dimList.push(dim); + }; - return Cartesian; - }(); + return Cartesian; + }(); var cartesian2DDimensions = ['x', 'y']; function canCalculateAffineTransform(scale) { - return scale.type === 'interval' || scale.type === 'time'; + return scale.type === 'interval' || scale.type === 'time'; } var Cartesian2D = - /** @class */ - function (_super) { - __extends(Cartesian2D, _super); - - function Cartesian2D() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = 'cartesian2d'; - _this.dimensions = cartesian2DDimensions; - return _this; - } - /** - * Calculate an affine transform matrix if two axes are time or value. - * It's mainly for accelartion on the large time series data. - */ - - - Cartesian2D.prototype.calcAffineTransform = function () { - this._transform = this._invTransform = null; - var xAxisScale = this.getAxis('x').scale; - var yAxisScale = this.getAxis('y').scale; + /** @class */ + function (_super) { + __extends(Cartesian2D, _super); + + function Cartesian2D() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = 'cartesian2d'; + _this.dimensions = cartesian2DDimensions; + return _this; + } + /** + * Calculate an affine transform matrix if two axes are time or value. + * It's mainly for accelartion on the large time series data. + */ - if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) { - return; - } - var xScaleExtent = xAxisScale.getExtent(); - var yScaleExtent = yAxisScale.getExtent(); - var start = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]); - var end = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]); - var xScaleSpan = xScaleExtent[1] - xScaleExtent[0]; - var yScaleSpan = yScaleExtent[1] - yScaleExtent[0]; + Cartesian2D.prototype.calcAffineTransform = function () { + this._transform = this._invTransform = null; + var xAxisScale = this.getAxis('x').scale; + var yAxisScale = this.getAxis('y').scale; - if (!xScaleSpan || !yScaleSpan) { - return; - } // Accelerate data to point calculation on the special large time series data. + if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) { + return; + } + var xScaleExtent = xAxisScale.getExtent(); + var yScaleExtent = yAxisScale.getExtent(); + var start = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]); + var end = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]); + var xScaleSpan = xScaleExtent[1] - xScaleExtent[0]; + var yScaleSpan = yScaleExtent[1] - yScaleExtent[0]; - var scaleX = (end[0] - start[0]) / xScaleSpan; - var scaleY = (end[1] - start[1]) / yScaleSpan; - var translateX = start[0] - xScaleExtent[0] * scaleX; - var translateY = start[1] - yScaleExtent[0] * scaleY; - var m = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY]; - this._invTransform = invert([], m); - }; - /** - * Base axis will be used on stacking. - */ + if (!xScaleSpan || !yScaleSpan) { + return; + } // Accelerate data to point calculation on the special large time series data. - Cartesian2D.prototype.getBaseAxis = function () { - return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAxis('x'); - }; + var scaleX = (end[0] - start[0]) / xScaleSpan; + var scaleY = (end[1] - start[1]) / yScaleSpan; + var translateX = start[0] - xScaleExtent[0] * scaleX; + var translateY = start[1] - yScaleExtent[0] * scaleY; + var m = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY]; + this._invTransform = invert([], m); + }; + /** + * Base axis will be used on stacking. + */ - Cartesian2D.prototype.containPoint = function (point) { - var axisX = this.getAxis('x'); - var axisY = this.getAxis('y'); - return axisX.contain(axisX.toLocalCoord(point[0])) && axisY.contain(axisY.toLocalCoord(point[1])); - }; - Cartesian2D.prototype.containData = function (data) { - return this.getAxis('x').containData(data[0]) && this.getAxis('y').containData(data[1]); - }; + Cartesian2D.prototype.getBaseAxis = function () { + return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAxis('x'); + }; - Cartesian2D.prototype.dataToPoint = function (data, clamp, out) { - out = out || []; - var xVal = data[0]; - var yVal = data[1]; // Fast path + Cartesian2D.prototype.containPoint = function (point) { + var axisX = this.getAxis('x'); + var axisY = this.getAxis('y'); + return axisX.contain(axisX.toLocalCoord(point[0])) && axisY.contain(axisY.toLocalCoord(point[1])); + }; - if (this._transform // It's supported that if data is like `[Inifity, 123]`, where only Y pixel calculated. - && xVal != null && isFinite(xVal) && yVal != null && isFinite(yVal)) { - return applyTransform(out, data, this._transform); - } + Cartesian2D.prototype.containData = function (data) { + return this.getAxis('x').containData(data[0]) && this.getAxis('y').containData(data[1]); + }; - var xAxis = this.getAxis('x'); - var yAxis = this.getAxis('y'); - out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal, clamp)); - out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal, clamp)); - return out; - }; + Cartesian2D.prototype.dataToPoint = function (data, clamp, out) { + out = out || []; + var xVal = data[0]; + var yVal = data[1]; // Fast path - Cartesian2D.prototype.clampData = function (data, out) { - var xScale = this.getAxis('x').scale; - var yScale = this.getAxis('y').scale; - var xAxisExtent = xScale.getExtent(); - var yAxisExtent = yScale.getExtent(); - var x = xScale.parse(data[0]); - var y = yScale.parse(data[1]); - out = out || []; - out[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1])); - out[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1])); - return out; - }; + if (this._transform // It's supported that if data is like `[Inifity, 123]`, where only Y pixel calculated. + && xVal != null && isFinite(xVal) && yVal != null && isFinite(yVal)) { + return applyTransform(out, data, this._transform); + } - Cartesian2D.prototype.pointToData = function (point, clamp) { - var out = []; + var xAxis = this.getAxis('x'); + var yAxis = this.getAxis('y'); + out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal, clamp)); + out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal, clamp)); + return out; + }; + + Cartesian2D.prototype.clampData = function (data, out) { + var xScale = this.getAxis('x').scale; + var yScale = this.getAxis('y').scale; + var xAxisExtent = xScale.getExtent(); + var yAxisExtent = yScale.getExtent(); + var x = xScale.parse(data[0]); + var y = yScale.parse(data[1]); + out = out || []; + out[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1])); + out[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1])); + return out; + }; - if (this._invTransform) { - return applyTransform(out, point, this._invTransform); - } + Cartesian2D.prototype.pointToData = function (point, clamp) { + var out = []; - var xAxis = this.getAxis('x'); - var yAxis = this.getAxis('y'); - out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]), clamp); - out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]), clamp); - return out; - }; + if (this._invTransform) { + return applyTransform(out, point, this._invTransform); + } - Cartesian2D.prototype.getOtherAxis = function (axis) { - return this.getAxis(axis.dim === 'x' ? 'y' : 'x'); - }; - /** - * Get rect area of cartesian. - * Area will have a contain function to determine if a point is in the coordinate system. - */ + var xAxis = this.getAxis('x'); + var yAxis = this.getAxis('y'); + out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]), clamp); + out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]), clamp); + return out; + }; + + Cartesian2D.prototype.getOtherAxis = function (axis) { + return this.getAxis(axis.dim === 'x' ? 'y' : 'x'); + }; + /** + * Get rect area of cartesian. + * Area will have a contain function to determine if a point is in the coordinate system. + */ - Cartesian2D.prototype.getArea = function () { - var xExtent = this.getAxis('x').getGlobalExtent(); - var yExtent = this.getAxis('y').getGlobalExtent(); - var x = Math.min(xExtent[0], xExtent[1]); - var y = Math.min(yExtent[0], yExtent[1]); - var width = Math.max(xExtent[0], xExtent[1]) - x; - var height = Math.max(yExtent[0], yExtent[1]) - y; - return new BoundingRect(x, y, width, height); - }; + Cartesian2D.prototype.getArea = function () { + var xExtent = this.getAxis('x').getGlobalExtent(); + var yExtent = this.getAxis('y').getGlobalExtent(); + var x = Math.min(xExtent[0], xExtent[1]); + var y = Math.min(yExtent[0], yExtent[1]); + var width = Math.max(xExtent[0], xExtent[1]) - x; + var height = Math.max(yExtent[0], yExtent[1]) - y; + return new BoundingRect(x, y, width, height); + }; - return Cartesian2D; - }(Cartesian); + return Cartesian2D; + }(Cartesian); var Axis2D = - /** @class */ - function (_super) { - __extends(Axis2D, _super); - - function Axis2D(dim, scale, coordExtent, axisType, position) { - var _this = _super.call(this, dim, scale, coordExtent) || this; - /** - * Index of axis, can be used as key - * Injected outside. - */ + /** @class */ + function (_super) { + __extends(Axis2D, _super); + function Axis2D(dim, scale, coordExtent, axisType, position) { + var _this = _super.call(this, dim, scale, coordExtent) || this; + /** + * Index of axis, can be used as key + * Injected outside. + */ - _this.index = 0; - _this.type = axisType || 'value'; - _this.position = position || 'bottom'; - return _this; - } - - Axis2D.prototype.isHorizontal = function () { - var position = this.position; - return position === 'top' || position === 'bottom'; - }; - /** - * Each item cooresponds to this.getExtent(), which - * means globalExtent[0] may greater than globalExtent[1], - * unless `asc` is input. - * - * @param {boolean} [asc] - * @return {Array.} - */ + _this.index = 0; + _this.type = axisType || 'value'; + _this.position = position || 'bottom'; + return _this; + } + + Axis2D.prototype.isHorizontal = function () { + var position = this.position; + return position === 'top' || position === 'bottom'; + }; + /** + * Each item cooresponds to this.getExtent(), which + * means globalExtent[0] may greater than globalExtent[1], + * unless `asc` is input. + * + * @param {boolean} [asc] + * @return {Array.} + */ - Axis2D.prototype.getGlobalExtent = function (asc) { - var ret = this.getExtent(); - ret[0] = this.toGlobalCoord(ret[0]); - ret[1] = this.toGlobalCoord(ret[1]); - asc && ret[0] > ret[1] && ret.reverse(); - return ret; - }; - Axis2D.prototype.pointToData = function (point, clamp) { - return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp); - }; - /** - * Set ordinalSortInfo - * @param info new OrdinalSortInfo - */ + Axis2D.prototype.getGlobalExtent = function (asc) { + var ret = this.getExtent(); + ret[0] = this.toGlobalCoord(ret[0]); + ret[1] = this.toGlobalCoord(ret[1]); + asc && ret[0] > ret[1] && ret.reverse(); + return ret; + }; + + Axis2D.prototype.pointToData = function (point, clamp) { + return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp); + }; + /** + * Set ordinalSortInfo + * @param info new OrdinalSortInfo + */ - Axis2D.prototype.setCategorySortInfo = function (info) { - if (this.type !== 'category') { - return false; - } + Axis2D.prototype.setCategorySortInfo = function (info) { + if (this.type !== 'category') { + return false; + } - this.model.option.categorySortInfo = info; - this.scale.setSortInfo(info); - }; + this.model.option.categorySortInfo = info; + this.scale.setSortInfo(info); + }; - return Axis2D; - }(Axis); + return Axis2D; + }(Axis); /** * Can only be called after coordinate system creation stage. @@ -47214,691 +47214,691 @@ */ function layout$1(gridModel, axisModel, opt) { - opt = opt || {}; - var grid = gridModel.coordinateSystem; - var axis = axisModel.axis; - var layout = {}; - var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0]; - var rawAxisPosition = axis.position; - var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition; - var axisDim = axis.dim; - var rect = grid.getRect(); - var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height]; - var idx = { - left: 0, - right: 1, - top: 0, - bottom: 1, - onZero: 2 - }; - var axisOffset = axisModel.get('offset') || 0; - var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset]; - - if (otherAxisOnZeroOf) { - var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0)); - posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]); - } // Axis position - - - layout.position = [axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]]; // Axis rotation - - layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1); // Tick and label direction, x y is axisDim - - var dirMap = { - top: -1, - bottom: 1, - left: -1, - right: 1 - }; - layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition]; - layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0; - - if (axisModel.get(['axisTick', 'inside'])) { - layout.tickDirection = -layout.tickDirection; - } - - if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) { - layout.labelDirection = -layout.labelDirection; - } // Special label rotation - - - var labelRotate = axisModel.get(['axisLabel', 'rotate']); - layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate; // Over splitLine and splitArea - - layout.z2 = 1; - return layout; + opt = opt || {}; + var grid = gridModel.coordinateSystem; + var axis = axisModel.axis; + var layout = {}; + var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0]; + var rawAxisPosition = axis.position; + var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition; + var axisDim = axis.dim; + var rect = grid.getRect(); + var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height]; + var idx = { + left: 0, + right: 1, + top: 0, + bottom: 1, + onZero: 2 + }; + var axisOffset = axisModel.get('offset') || 0; + var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset]; + + if (otherAxisOnZeroOf) { + var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0)); + posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]); + } // Axis position + + + layout.position = [axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]]; // Axis rotation + + layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1); // Tick and label direction, x y is axisDim + + var dirMap = { + top: -1, + bottom: 1, + left: -1, + right: 1 + }; + layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition]; + layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0; + + if (axisModel.get(['axisTick', 'inside'])) { + layout.tickDirection = -layout.tickDirection; + } + + if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) { + layout.labelDirection = -layout.labelDirection; + } // Special label rotation + + + var labelRotate = axisModel.get(['axisLabel', 'rotate']); + layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate; // Over splitLine and splitArea + + layout.z2 = 1; + return layout; } function isCartesian2DSeries(seriesModel) { - return seriesModel.get('coordinateSystem') === 'cartesian2d'; + return seriesModel.get('coordinateSystem') === 'cartesian2d'; } function findAxisModels(seriesModel) { - var axisModelMap = { - xAxisModel: null, - yAxisModel: null - }; - each(axisModelMap, function (v, key) { - var axisType = key.replace(/Model$/, ''); - var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0]; + var axisModelMap = { + xAxisModel: null, + yAxisModel: null + }; + each(axisModelMap, function (v, key) { + var axisType = key.replace(/Model$/, ''); + var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0]; - if ("development" !== 'production') { - if (!axisModel) { - throw new Error(axisType + ' "' + retrieve3(seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0) + '" not found'); - } - } + if ("development" !== 'production') { + if (!axisModel) { + throw new Error(axisType + ' "' + retrieve3(seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0) + '" not found'); + } + } - axisModelMap[key] = axisModel; - }); - return axisModelMap; + axisModelMap[key] = axisModel; + }); + return axisModelMap; } var mathLog$1 = Math.log; function alignScaleTicks(scale, axisModel, alignToScale) { - var intervalScaleProto = IntervalScale.prototype; // NOTE: There is a precondition for log scale here: - // In log scale we store _interval and _extent of exponent value. - // So if we use the method of InternalScale to set/get these data. - // It process the exponent value, which is linear and what we want here. + var intervalScaleProto = IntervalScale.prototype; // NOTE: There is a precondition for log scale here: + // In log scale we store _interval and _extent of exponent value. + // So if we use the method of InternalScale to set/get these data. + // It process the exponent value, which is linear and what we want here. - var alignToTicks = intervalScaleProto.getTicks.call(alignToScale); - var alignToNicedTicks = intervalScaleProto.getTicks.call(alignToScale, true); - var alignToSplitNumber = alignToTicks.length - 1; - var alignToInterval = intervalScaleProto.getInterval.call(alignToScale); - var scaleExtent = getScaleExtent(scale, axisModel); - var rawExtent = scaleExtent.extent; - var isMinFixed = scaleExtent.fixMin; - var isMaxFixed = scaleExtent.fixMax; + var alignToTicks = intervalScaleProto.getTicks.call(alignToScale); + var alignToNicedTicks = intervalScaleProto.getTicks.call(alignToScale, true); + var alignToSplitNumber = alignToTicks.length - 1; + var alignToInterval = intervalScaleProto.getInterval.call(alignToScale); + var scaleExtent = getScaleExtent(scale, axisModel); + var rawExtent = scaleExtent.extent; + var isMinFixed = scaleExtent.fixMin; + var isMaxFixed = scaleExtent.fixMax; - if (scale.type === 'log') { - var logBase = mathLog$1(scale.base); - rawExtent = [mathLog$1(rawExtent[0]) / logBase, mathLog$1(rawExtent[1]) / logBase]; - } + if (scale.type === 'log') { + var logBase = mathLog$1(scale.base); + rawExtent = [mathLog$1(rawExtent[0]) / logBase, mathLog$1(rawExtent[1]) / logBase]; + } - scale.setExtent(rawExtent[0], rawExtent[1]); - scale.calcNiceExtent({ - splitNumber: alignToSplitNumber, - fixMin: isMinFixed, - fixMax: isMaxFixed - }); - var extent = intervalScaleProto.getExtent.call(scale); // Need to update the rawExtent. - // Because value in rawExtent may be not parsed. e.g. 'dataMin', 'dataMax' + scale.setExtent(rawExtent[0], rawExtent[1]); + scale.calcNiceExtent({ + splitNumber: alignToSplitNumber, + fixMin: isMinFixed, + fixMax: isMaxFixed + }); + var extent = intervalScaleProto.getExtent.call(scale); // Need to update the rawExtent. + // Because value in rawExtent may be not parsed. e.g. 'dataMin', 'dataMax' - if (isMinFixed) { - rawExtent[0] = extent[0]; - } + if (isMinFixed) { + rawExtent[0] = extent[0]; + } - if (isMaxFixed) { - rawExtent[1] = extent[1]; - } + if (isMaxFixed) { + rawExtent[1] = extent[1]; + } - var interval = intervalScaleProto.getInterval.call(scale); - var min = rawExtent[0]; - var max = rawExtent[1]; + var interval = intervalScaleProto.getInterval.call(scale); + var min = rawExtent[0]; + var max = rawExtent[1]; - if (isMinFixed && isMaxFixed) { - // User set min, max, divide to get new interval - interval = (max - min) / alignToSplitNumber; - } else if (isMinFixed) { - max = rawExtent[0] + interval * alignToSplitNumber; // User set min, expand extent on the other side + if (isMinFixed && isMaxFixed) { + // User set min, max, divide to get new interval + interval = (max - min) / alignToSplitNumber; + } else if (isMinFixed) { + max = rawExtent[0] + interval * alignToSplitNumber; // User set min, expand extent on the other side - while (max < rawExtent[1] && isFinite(max) && isFinite(rawExtent[1])) { - interval = increaseInterval(interval); - max = rawExtent[0] + interval * alignToSplitNumber; - } - } else if (isMaxFixed) { - // User set max, expand extent on the other side - min = rawExtent[1] - interval * alignToSplitNumber; + while (max < rawExtent[1] && isFinite(max) && isFinite(rawExtent[1])) { + interval = increaseInterval(interval); + max = rawExtent[0] + interval * alignToSplitNumber; + } + } else if (isMaxFixed) { + // User set max, expand extent on the other side + min = rawExtent[1] - interval * alignToSplitNumber; - while (min > rawExtent[0] && isFinite(min) && isFinite(rawExtent[0])) { - interval = increaseInterval(interval); - min = rawExtent[1] - interval * alignToSplitNumber; - } - } else { - var nicedSplitNumber = scale.getTicks().length - 1; + while (min > rawExtent[0] && isFinite(min) && isFinite(rawExtent[0])) { + interval = increaseInterval(interval); + min = rawExtent[1] - interval * alignToSplitNumber; + } + } else { + var nicedSplitNumber = scale.getTicks().length - 1; - if (nicedSplitNumber > alignToSplitNumber) { - interval = increaseInterval(interval); - } + if (nicedSplitNumber > alignToSplitNumber) { + interval = increaseInterval(interval); + } - var range = interval * alignToSplitNumber; - max = Math.ceil(rawExtent[1] / interval) * interval; - min = round(max - range); // Not change the result that crossing zero. + var range = interval * alignToSplitNumber; + max = Math.ceil(rawExtent[1] / interval) * interval; + min = round(max - range); // Not change the result that crossing zero. - if (min < 0 && rawExtent[0] >= 0) { - min = 0; - max = round(range); - } else if (max > 0 && rawExtent[1] <= 0) { - max = 0; - min = -round(range); - } - } // Adjust min, max based on the extent of alignTo. When min or max is set in alignTo scale + if (min < 0 && rawExtent[0] >= 0) { + min = 0; + max = round(range); + } else if (max > 0 && rawExtent[1] <= 0) { + max = 0; + min = -round(range); + } + } // Adjust min, max based on the extent of alignTo. When min or max is set in alignTo scale - var t0 = (alignToTicks[0].value - alignToNicedTicks[0].value) / alignToInterval; - var t1 = (alignToTicks[alignToSplitNumber].value - alignToNicedTicks[alignToSplitNumber].value) / alignToInterval; // NOTE: Must in setExtent -> setInterval -> setNiceExtent order. + var t0 = (alignToTicks[0].value - alignToNicedTicks[0].value) / alignToInterval; + var t1 = (alignToTicks[alignToSplitNumber].value - alignToNicedTicks[alignToSplitNumber].value) / alignToInterval; // NOTE: Must in setExtent -> setInterval -> setNiceExtent order. - intervalScaleProto.setExtent.call(scale, min + interval * t0, max + interval * t1); - intervalScaleProto.setInterval.call(scale, interval); + intervalScaleProto.setExtent.call(scale, min + interval * t0, max + interval * t1); + intervalScaleProto.setInterval.call(scale, interval); - if (t0 || t1) { - intervalScaleProto.setNiceExtent.call(scale, min + interval, max - interval); - } + if (t0 || t1) { + intervalScaleProto.setNiceExtent.call(scale, min + interval, max - interval); + } - if ("development" !== 'production') { - var ticks = intervalScaleProto.getTicks.call(scale); + if ("development" !== 'production') { + var ticks = intervalScaleProto.getTicks.call(scale); - if (ticks[1] && (!isValueNice(interval) || getPrecisionSafe(ticks[1].value) > getPrecisionSafe(interval))) { - warn( // eslint-disable-next-line - "The ticks may be not readable when set min: " + axisModel.get('min') + ", max: " + axisModel.get('max') + " and alignTicks: true"); - } + if (ticks[1] && (!isValueNice(interval) || getPrecisionSafe(ticks[1].value) > getPrecisionSafe(interval))) { + warn( // eslint-disable-next-line + "The ticks may be not readable when set min: " + axisModel.get('min') + ", max: " + axisModel.get('max') + " and alignTicks: true"); } + } } var Grid = - /** @class */ - function () { - function Grid(gridModel, ecModel, api) { - // FIXME:TS where used (different from registered type 'cartesian2d')? - this.type = 'grid'; - this._coordsMap = {}; - this._coordsList = []; - this._axesMap = {}; - this._axesList = []; - this.axisPointerEnabled = true; - this.dimensions = cartesian2DDimensions; + /** @class */ + function () { + function Grid(gridModel, ecModel, api) { + // FIXME:TS where used (different from registered type 'cartesian2d')? + this.type = 'grid'; + this._coordsMap = {}; + this._coordsList = []; + this._axesMap = {}; + this._axesList = []; + this.axisPointerEnabled = true; + this.dimensions = cartesian2DDimensions; - this._initCartesian(gridModel, ecModel, api); + this._initCartesian(gridModel, ecModel, api); - this.model = gridModel; - } + this.model = gridModel; + } - Grid.prototype.getRect = function () { - return this._rect; - }; + Grid.prototype.getRect = function () { + return this._rect; + }; - Grid.prototype.update = function (ecModel, api) { - var axesMap = this._axesMap; + Grid.prototype.update = function (ecModel, api) { + var axesMap = this._axesMap; - this._updateScale(ecModel, this.model); + this._updateScale(ecModel, this.model); - function updateAxisTicks(axes) { - var alignTo; // Axis is added in order of axisIndex. + function updateAxisTicks(axes) { + var alignTo; // Axis is added in order of axisIndex. - var axesIndices = keys(axes); - var len = axesIndices.length; + var axesIndices = keys(axes); + var len = axesIndices.length; - if (!len) { - return; - } + if (!len) { + return; + } - var axisNeedsAlign = []; // Process once and calculate the ticks for those don't use alignTicks. + var axisNeedsAlign = []; // Process once and calculate the ticks for those don't use alignTicks. - for (var i = len - 1; i >= 0; i--) { - var idx = +axesIndices[i]; // Convert to number. + for (var i = len - 1; i >= 0; i--) { + var idx = +axesIndices[i]; // Convert to number. - var axis = axes[idx]; - var model = axis.model; - var scale = axis.scale; + var axis = axes[idx]; + var model = axis.model; + var scale = axis.scale; - if ( // Only value and log axis without interval support alignTicks. - isIntervalOrLogScale(scale) && model.get('alignTicks') && model.get('interval') == null) { - axisNeedsAlign.push(axis); - } else { - niceScaleExtent(scale, model); + if ( // Only value and log axis without interval support alignTicks. + isIntervalOrLogScale(scale) && model.get('alignTicks') && model.get('interval') == null) { + axisNeedsAlign.push(axis); + } else { + niceScaleExtent(scale, model); - if (isIntervalOrLogScale(scale)) { - // Can only align to interval or log axis. - alignTo = axis; - } - } - } - // PENDING. Should we find the axis that both set interval, min, max and align to this one? + if (isIntervalOrLogScale(scale)) { + // Can only align to interval or log axis. + alignTo = axis; + } + } + } + // PENDING. Should we find the axis that both set interval, min, max and align to this one? - if (axisNeedsAlign.length) { - if (!alignTo) { - alignTo = axisNeedsAlign.pop(); - niceScaleExtent(alignTo.scale, alignTo.model); - } + if (axisNeedsAlign.length) { + if (!alignTo) { + alignTo = axisNeedsAlign.pop(); + niceScaleExtent(alignTo.scale, alignTo.model); + } - each(axisNeedsAlign, function (axis) { - alignScaleTicks(axis.scale, axis.model, alignTo.scale); - }); - } - } + each(axisNeedsAlign, function (axis) { + alignScaleTicks(axis.scale, axis.model, alignTo.scale); + }); + } + } - updateAxisTicks(axesMap.x); - updateAxisTicks(axesMap.y); // Key: axisDim_axisIndex, value: boolean, whether onZero target. + updateAxisTicks(axesMap.x); + updateAxisTicks(axesMap.y); // Key: axisDim_axisIndex, value: boolean, whether onZero target. - var onZeroRecords = {}; - each(axesMap.x, function (xAxis) { - fixAxisOnZero(axesMap, 'y', xAxis, onZeroRecords); - }); - each(axesMap.y, function (yAxis) { - fixAxisOnZero(axesMap, 'x', yAxis, onZeroRecords); - }); // Resize again if containLabel is enabled - // FIXME It may cause getting wrong grid size in data processing stage + var onZeroRecords = {}; + each(axesMap.x, function (xAxis) { + fixAxisOnZero(axesMap, 'y', xAxis, onZeroRecords); + }); + each(axesMap.y, function (yAxis) { + fixAxisOnZero(axesMap, 'x', yAxis, onZeroRecords); + }); // Resize again if containLabel is enabled + // FIXME It may cause getting wrong grid size in data processing stage + + this.resize(this.model, api); + }; + /** + * Resize the grid + */ - this.resize(this.model, api); - }; - /** - * Resize the grid - */ + Grid.prototype.resize = function (gridModel, api, ignoreContainLabel) { + var boxLayoutParams = gridModel.getBoxLayoutParams(); + var isContainLabel = !ignoreContainLabel && gridModel.get('containLabel'); + var gridRect = getLayoutRect(boxLayoutParams, { + width: api.getWidth(), + height: api.getHeight() + }); + this._rect = gridRect; + var axesList = this._axesList; + adjustAxes(); // Minus label size - Grid.prototype.resize = function (gridModel, api, ignoreContainLabel) { - var boxLayoutParams = gridModel.getBoxLayoutParams(); - var isContainLabel = !ignoreContainLabel && gridModel.get('containLabel'); - var gridRect = getLayoutRect(boxLayoutParams, { - width: api.getWidth(), - height: api.getHeight() - }); - this._rect = gridRect; - var axesList = this._axesList; - adjustAxes(); // Minus label size - - if (isContainLabel) { - each(axesList, function (axis) { - if (!axis.model.get(['axisLabel', 'inside'])) { - var labelUnionRect = estimateLabelUnionRect(axis); - - if (labelUnionRect) { - var dim = axis.isHorizontal() ? 'height' : 'width'; - var margin = axis.model.get(['axisLabel', 'margin']); - gridRect[dim] -= labelUnionRect[dim] + margin; - - if (axis.position === 'top') { - gridRect.y += labelUnionRect.height + margin; - } else if (axis.position === 'left') { - gridRect.x += labelUnionRect.width + margin; - } - } - } - }); - adjustAxes(); - } + if (isContainLabel) { + each(axesList, function (axis) { + if (!axis.model.get(['axisLabel', 'inside'])) { + var labelUnionRect = estimateLabelUnionRect(axis); - each(this._coordsList, function (coord) { - // Calculate affine matrix to accelerate the data to point transform. - // If all the axes scales are time or value. - coord.calcAffineTransform(); - }); + if (labelUnionRect) { + var dim = axis.isHorizontal() ? 'height' : 'width'; + var margin = axis.model.get(['axisLabel', 'margin']); + gridRect[dim] -= labelUnionRect[dim] + margin; - function adjustAxes() { - each(axesList, function (axis) { - var isHorizontal = axis.isHorizontal(); - var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height]; - var idx = axis.inverse ? 1 : 0; - axis.setExtent(extent[idx], extent[1 - idx]); - updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y); - }); + if (axis.position === 'top') { + gridRect.y += labelUnionRect.height + margin; + } else if (axis.position === 'left') { + gridRect.x += labelUnionRect.width + margin; } - }; + } + } + }); + adjustAxes(); + } - Grid.prototype.getAxis = function (dim, axisIndex) { - var axesMapOnDim = this._axesMap[dim]; + each(this._coordsList, function (coord) { + // Calculate affine matrix to accelerate the data to point transform. + // If all the axes scales are time or value. + coord.calcAffineTransform(); + }); - if (axesMapOnDim != null) { - return axesMapOnDim[axisIndex || 0]; - } - }; + function adjustAxes() { + each(axesList, function (axis) { + var isHorizontal = axis.isHorizontal(); + var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height]; + var idx = axis.inverse ? 1 : 0; + axis.setExtent(extent[idx], extent[1 - idx]); + updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y); + }); + } + }; - Grid.prototype.getAxes = function () { - return this._axesList.slice(); - }; + Grid.prototype.getAxis = function (dim, axisIndex) { + var axesMapOnDim = this._axesMap[dim]; - Grid.prototype.getCartesian = function (xAxisIndex, yAxisIndex) { - if (xAxisIndex != null && yAxisIndex != null) { - var key = 'x' + xAxisIndex + 'y' + yAxisIndex; - return this._coordsMap[key]; - } + if (axesMapOnDim != null) { + return axesMapOnDim[axisIndex || 0]; + } + }; - if (isObject(xAxisIndex)) { - yAxisIndex = xAxisIndex.yAxisIndex; - xAxisIndex = xAxisIndex.xAxisIndex; - } + Grid.prototype.getAxes = function () { + return this._axesList.slice(); + }; - for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) { - if (coordList[i].getAxis('x').index === xAxisIndex || coordList[i].getAxis('y').index === yAxisIndex) { - return coordList[i]; - } - } - }; + Grid.prototype.getCartesian = function (xAxisIndex, yAxisIndex) { + if (xAxisIndex != null && yAxisIndex != null) { + var key = 'x' + xAxisIndex + 'y' + yAxisIndex; + return this._coordsMap[key]; + } - Grid.prototype.getCartesians = function () { - return this._coordsList.slice(); - }; - /** - * @implements - */ + if (isObject(xAxisIndex)) { + yAxisIndex = xAxisIndex.yAxisIndex; + xAxisIndex = xAxisIndex.xAxisIndex; + } + + for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) { + if (coordList[i].getAxis('x').index === xAxisIndex || coordList[i].getAxis('y').index === yAxisIndex) { + return coordList[i]; + } + } + }; + Grid.prototype.getCartesians = function () { + return this._coordsList.slice(); + }; + /** + * @implements + */ - Grid.prototype.convertToPixel = function (ecModel, finder, value) { - var target = this._findConvertTarget(finder); - return target.cartesian ? target.cartesian.dataToPoint(value) : target.axis ? target.axis.toGlobalCoord(target.axis.dataToCoord(value)) : null; - }; - /** - * @implements - */ + Grid.prototype.convertToPixel = function (ecModel, finder, value) { + var target = this._findConvertTarget(finder); + return target.cartesian ? target.cartesian.dataToPoint(value) : target.axis ? target.axis.toGlobalCoord(target.axis.dataToCoord(value)) : null; + }; + /** + * @implements + */ - Grid.prototype.convertFromPixel = function (ecModel, finder, value) { - var target = this._findConvertTarget(finder); - return target.cartesian ? target.cartesian.pointToData(value) : target.axis ? target.axis.coordToData(target.axis.toLocalCoord(value)) : null; - }; + Grid.prototype.convertFromPixel = function (ecModel, finder, value) { + var target = this._findConvertTarget(finder); - Grid.prototype._findConvertTarget = function (finder) { - var seriesModel = finder.seriesModel; - var xAxisModel = finder.xAxisModel || seriesModel && seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0]; - var yAxisModel = finder.yAxisModel || seriesModel && seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0]; - var gridModel = finder.gridModel; - var coordsList = this._coordsList; - var cartesian; - var axis; - - if (seriesModel) { - cartesian = seriesModel.coordinateSystem; - indexOf(coordsList, cartesian) < 0 && (cartesian = null); - } else if (xAxisModel && yAxisModel) { - cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex); - } else if (xAxisModel) { - axis = this.getAxis('x', xAxisModel.componentIndex); - } else if (yAxisModel) { - axis = this.getAxis('y', yAxisModel.componentIndex); - } // Lowest priority. - else if (gridModel) { - var grid = gridModel.coordinateSystem; - - if (grid === this) { - cartesian = this._coordsList[0]; - } - } + return target.cartesian ? target.cartesian.pointToData(value) : target.axis ? target.axis.coordToData(target.axis.toLocalCoord(value)) : null; + }; - return { - cartesian: cartesian, - axis: axis - }; - }; - /** - * @implements - */ + Grid.prototype._findConvertTarget = function (finder) { + var seriesModel = finder.seriesModel; + var xAxisModel = finder.xAxisModel || seriesModel && seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0]; + var yAxisModel = finder.yAxisModel || seriesModel && seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0]; + var gridModel = finder.gridModel; + var coordsList = this._coordsList; + var cartesian; + var axis; + + if (seriesModel) { + cartesian = seriesModel.coordinateSystem; + indexOf(coordsList, cartesian) < 0 && (cartesian = null); + } else if (xAxisModel && yAxisModel) { + cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex); + } else if (xAxisModel) { + axis = this.getAxis('x', xAxisModel.componentIndex); + } else if (yAxisModel) { + axis = this.getAxis('y', yAxisModel.componentIndex); + } // Lowest priority. + else if (gridModel) { + var grid = gridModel.coordinateSystem; + + if (grid === this) { + cartesian = this._coordsList[0]; + } + } + return { + cartesian: cartesian, + axis: axis + }; + }; + /** + * @implements + */ - Grid.prototype.containPoint = function (point) { - var coord = this._coordsList[0]; - if (coord) { - return coord.containPoint(point); - } - }; - /** - * Initialize cartesian coordinate systems - */ + Grid.prototype.containPoint = function (point) { + var coord = this._coordsList[0]; + if (coord) { + return coord.containPoint(point); + } + }; + /** + * Initialize cartesian coordinate systems + */ - Grid.prototype._initCartesian = function (gridModel, ecModel, api) { - var _this = this; - var grid = this; - var axisPositionUsed = { - left: false, - right: false, - top: false, - bottom: false - }; - var axesMap = { - x: {}, - y: {} - }; - var axesCount = { - x: 0, - y: 0 - }; /// Create axis - - ecModel.eachComponent('xAxis', createAxisCreator('x'), this); - ecModel.eachComponent('yAxis', createAxisCreator('y'), this); - - if (!axesCount.x || !axesCount.y) { - // Roll back when there no either x or y axis - this._axesMap = {}; - this._axesList = []; - return; - } + Grid.prototype._initCartesian = function (gridModel, ecModel, api) { + var _this = this; - this._axesMap = axesMap; /// Create cartesian2d + var grid = this; + var axisPositionUsed = { + left: false, + right: false, + top: false, + bottom: false + }; + var axesMap = { + x: {}, + y: {} + }; + var axesCount = { + x: 0, + y: 0 + }; /// Create axis - each(axesMap.x, function (xAxis, xAxisIndex) { - each(axesMap.y, function (yAxis, yAxisIndex) { - var key = 'x' + xAxisIndex + 'y' + yAxisIndex; - var cartesian = new Cartesian2D(key); - cartesian.master = _this; - cartesian.model = gridModel; - _this._coordsMap[key] = cartesian; + ecModel.eachComponent('xAxis', createAxisCreator('x'), this); + ecModel.eachComponent('yAxis', createAxisCreator('y'), this); - _this._coordsList.push(cartesian); + if (!axesCount.x || !axesCount.y) { + // Roll back when there no either x or y axis + this._axesMap = {}; + this._axesList = []; + return; + } - cartesian.addAxis(xAxis); - cartesian.addAxis(yAxis); - }); - }); + this._axesMap = axesMap; /// Create cartesian2d - function createAxisCreator(dimName) { - return function (axisModel, idx) { - if (!isAxisUsedInTheGrid(axisModel, gridModel)) { - return; - } + each(axesMap.x, function (xAxis, xAxisIndex) { + each(axesMap.y, function (yAxis, yAxisIndex) { + var key = 'x' + xAxisIndex + 'y' + yAxisIndex; + var cartesian = new Cartesian2D(key); + cartesian.master = _this; + cartesian.model = gridModel; + _this._coordsMap[key] = cartesian; - var axisPosition = axisModel.get('position'); + _this._coordsList.push(cartesian); - if (dimName === 'x') { - // Fix position - if (axisPosition !== 'top' && axisPosition !== 'bottom') { - // Default bottom of X - axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom'; - } - } else { - // Fix position - if (axisPosition !== 'left' && axisPosition !== 'right') { - // Default left of Y - axisPosition = axisPositionUsed.left ? 'right' : 'left'; - } - } + cartesian.addAxis(xAxis); + cartesian.addAxis(yAxis); + }); + }); - axisPositionUsed[axisPosition] = true; - var axis = new Axis2D(dimName, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisPosition); - var isCategory = axis.type === 'category'; - axis.onBand = isCategory && axisModel.get('boundaryGap'); - axis.inverse = axisModel.get('inverse'); // Inject axis into axisModel + function createAxisCreator(dimName) { + return function (axisModel, idx) { + if (!isAxisUsedInTheGrid(axisModel, gridModel)) { + return; + } - axisModel.axis = axis; // Inject axisModel into axis + var axisPosition = axisModel.get('position'); - axis.model = axisModel; // Inject grid info axis + if (dimName === 'x') { + // Fix position + if (axisPosition !== 'top' && axisPosition !== 'bottom') { + // Default bottom of X + axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom'; + } + } else { + // Fix position + if (axisPosition !== 'left' && axisPosition !== 'right') { + // Default left of Y + axisPosition = axisPositionUsed.left ? 'right' : 'left'; + } + } - axis.grid = grid; // Index of axis, can be used as key + axisPositionUsed[axisPosition] = true; + var axis = new Axis2D(dimName, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisPosition); + var isCategory = axis.type === 'category'; + axis.onBand = isCategory && axisModel.get('boundaryGap'); + axis.inverse = axisModel.get('inverse'); // Inject axis into axisModel - axis.index = idx; + axisModel.axis = axis; // Inject axisModel into axis - grid._axesList.push(axis); + axis.model = axisModel; // Inject grid info axis - axesMap[dimName][idx] = axis; - axesCount[dimName]++; - }; - } - }; - /** - * Update cartesian properties from series. - */ + axis.grid = grid; // Index of axis, can be used as key + axis.index = idx; - Grid.prototype._updateScale = function (ecModel, gridModel) { - // Reset scale - each(this._axesList, function (axis) { - axis.scale.setExtent(Infinity, -Infinity); + grid._axesList.push(axis); - if (axis.type === 'category') { - var categorySortInfo = axis.model.get('categorySortInfo'); - axis.scale.setSortInfo(categorySortInfo); - } - }); - ecModel.eachSeries(function (seriesModel) { - if (isCartesian2DSeries(seriesModel)) { - var axesModelMap = findAxisModels(seriesModel); - var xAxisModel = axesModelMap.xAxisModel; - var yAxisModel = axesModelMap.yAxisModel; - - if (!isAxisUsedInTheGrid(xAxisModel, gridModel) || !isAxisUsedInTheGrid(yAxisModel, gridModel)) { - return; - } + axesMap[dimName][idx] = axis; + axesCount[dimName]++; + }; + } + }; + /** + * Update cartesian properties from series. + */ - var cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex); - var data = seriesModel.getData(); - var xAxis = cartesian.getAxis('x'); - var yAxis = cartesian.getAxis('y'); - unionExtent(data, xAxis); - unionExtent(data, yAxis); - } - }, this); - function unionExtent(data, axis) { - each(getDataDimensionsOnAxis(data, axis.dim), function (dim) { - axis.scale.unionExtentFromData(data, dim); - }); - } - }; - /** - * @param dim 'x' or 'y' or 'auto' or null/undefined - */ + Grid.prototype._updateScale = function (ecModel, gridModel) { + // Reset scale + each(this._axesList, function (axis) { + axis.scale.setExtent(Infinity, -Infinity); + if (axis.type === 'category') { + var categorySortInfo = axis.model.get('categorySortInfo'); + axis.scale.setSortInfo(categorySortInfo); + } + }); + ecModel.eachSeries(function (seriesModel) { + if (isCartesian2DSeries(seriesModel)) { + var axesModelMap = findAxisModels(seriesModel); + var xAxisModel = axesModelMap.xAxisModel; + var yAxisModel = axesModelMap.yAxisModel; - Grid.prototype.getTooltipAxes = function (dim) { - var baseAxes = []; - var otherAxes = []; - each(this.getCartesians(), function (cartesian) { - var baseAxis = dim != null && dim !== 'auto' ? cartesian.getAxis(dim) : cartesian.getBaseAxis(); - var otherAxis = cartesian.getOtherAxis(baseAxis); - indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis); - indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis); - }); - return { - baseAxes: baseAxes, - otherAxes: otherAxes - }; - }; + if (!isAxisUsedInTheGrid(xAxisModel, gridModel) || !isAxisUsedInTheGrid(yAxisModel, gridModel)) { + return; + } + + var cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex); + var data = seriesModel.getData(); + var xAxis = cartesian.getAxis('x'); + var yAxis = cartesian.getAxis('y'); + unionExtent(data, xAxis); + unionExtent(data, yAxis); + } + }, this); + + function unionExtent(data, axis) { + each(getDataDimensionsOnAxis(data, axis.dim), function (dim) { + axis.scale.unionExtentFromData(data, dim); + }); + } + }; + /** + * @param dim 'x' or 'y' or 'auto' or null/undefined + */ - Grid.create = function (ecModel, api) { - var grids = []; - ecModel.eachComponent('grid', function (gridModel, idx) { - var grid = new Grid(gridModel, ecModel, api); - grid.name = 'grid_' + idx; // dataSampling requires axis extent, so resize - // should be performed in create stage. - grid.resize(gridModel, api, true); - gridModel.coordinateSystem = grid; - grids.push(grid); - }); // Inject the coordinateSystems into seriesModel + Grid.prototype.getTooltipAxes = function (dim) { + var baseAxes = []; + var otherAxes = []; + each(this.getCartesians(), function (cartesian) { + var baseAxis = dim != null && dim !== 'auto' ? cartesian.getAxis(dim) : cartesian.getBaseAxis(); + var otherAxis = cartesian.getOtherAxis(baseAxis); + indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis); + indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis); + }); + return { + baseAxes: baseAxes, + otherAxes: otherAxes + }; + }; - ecModel.eachSeries(function (seriesModel) { - if (!isCartesian2DSeries(seriesModel)) { - return; - } + Grid.create = function (ecModel, api) { + var grids = []; + ecModel.eachComponent('grid', function (gridModel, idx) { + var grid = new Grid(gridModel, ecModel, api); + grid.name = 'grid_' + idx; // dataSampling requires axis extent, so resize + // should be performed in create stage. + + grid.resize(gridModel, api, true); + gridModel.coordinateSystem = grid; + grids.push(grid); + }); // Inject the coordinateSystems into seriesModel - var axesModelMap = findAxisModels(seriesModel); - var xAxisModel = axesModelMap.xAxisModel; - var yAxisModel = axesModelMap.yAxisModel; - var gridModel = xAxisModel.getCoordSysModel(); + ecModel.eachSeries(function (seriesModel) { + if (!isCartesian2DSeries(seriesModel)) { + return; + } - if ("development" !== 'production') { - if (!gridModel) { - throw new Error('Grid "' + retrieve3(xAxisModel.get('gridIndex'), xAxisModel.get('gridId'), 0) + '" not found'); - } + var axesModelMap = findAxisModels(seriesModel); + var xAxisModel = axesModelMap.xAxisModel; + var yAxisModel = axesModelMap.yAxisModel; + var gridModel = xAxisModel.getCoordSysModel(); - if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) { - throw new Error('xAxis and yAxis must use the same grid'); - } - } + if ("development" !== 'production') { + if (!gridModel) { + throw new Error('Grid "' + retrieve3(xAxisModel.get('gridIndex'), xAxisModel.get('gridId'), 0) + '" not found'); + } - var grid = gridModel.coordinateSystem; - seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex); - }); - return grids; - }; // For deciding which dimensions to use when creating list data + if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) { + throw new Error('xAxis and yAxis must use the same grid'); + } + } + + var grid = gridModel.coordinateSystem; + seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex); + }); + return grids; + }; // For deciding which dimensions to use when creating list data - Grid.dimensions = cartesian2DDimensions; - return Grid; - }(); + Grid.dimensions = cartesian2DDimensions; + return Grid; + }(); /** * Check if the axis is used in the specified grid. */ function isAxisUsedInTheGrid(axisModel, gridModel) { - return axisModel.getCoordSysModel() === gridModel; + return axisModel.getCoordSysModel() === gridModel; } function fixAxisOnZero(axesMap, otherAxisDim, axis, // Key: see `getOnZeroRecordKey` - onZeroRecords) { - axis.getAxesOnZeroOf = function () { - // TODO: onZero of multiple axes. - return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : []; - }; // onZero can not be enabled in these two situations: - // 1. When any other axis is a category axis. - // 2. When no axis is cross 0 point. - - - var otherAxes = axesMap[otherAxisDim]; - var otherAxisOnZeroOf; - var axisModel = axis.model; - var onZero = axisModel.get(['axisLine', 'onZero']); - var onZeroAxisIndex = axisModel.get(['axisLine', 'onZeroAxisIndex']); - - if (!onZero) { - return; - } // If target axis is specified. + onZeroRecords) { + axis.getAxesOnZeroOf = function () { + // TODO: onZero of multiple axes. + return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : []; + }; // onZero can not be enabled in these two situations: + // 1. When any other axis is a category axis. + // 2. When no axis is cross 0 point. + + + var otherAxes = axesMap[otherAxisDim]; + var otherAxisOnZeroOf; + var axisModel = axis.model; + var onZero = axisModel.get(['axisLine', 'onZero']); + var onZeroAxisIndex = axisModel.get(['axisLine', 'onZeroAxisIndex']); + + if (!onZero) { + return; + } // If target axis is specified. - if (onZeroAxisIndex != null) { - if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) { - otherAxisOnZeroOf = otherAxes[onZeroAxisIndex]; - } - } else { - // Find the first available other axis. - for (var idx in otherAxes) { - if (otherAxes.hasOwnProperty(idx) && canOnZeroToAxis(otherAxes[idx]) // Consider that two Y axes on one value axis, - // if both onZero, the two Y axes overlap. - && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) { - otherAxisOnZeroOf = otherAxes[idx]; - break; - } - } + if (onZeroAxisIndex != null) { + if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) { + otherAxisOnZeroOf = otherAxes[onZeroAxisIndex]; } - - if (otherAxisOnZeroOf) { - onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true; + } else { + // Find the first available other axis. + for (var idx in otherAxes) { + if (otherAxes.hasOwnProperty(idx) && canOnZeroToAxis(otherAxes[idx]) // Consider that two Y axes on one value axis, + // if both onZero, the two Y axes overlap. + && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) { + otherAxisOnZeroOf = otherAxes[idx]; + break; + } } + } - function getOnZeroRecordKey(axis) { - return axis.dim + '_' + axis.index; - } + if (otherAxisOnZeroOf) { + onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true; + } + + function getOnZeroRecordKey(axis) { + return axis.dim + '_' + axis.index; + } } function canOnZeroToAxis(axis) { - return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis); + return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis); } function updateAxisTransform(axis, coordBase) { - var axisExtent = axis.getExtent(); - var axisExtentSum = axisExtent[0] + axisExtent[1]; // Fast transform + var axisExtent = axis.getExtent(); + var axisExtentSum = axisExtent[0] + axisExtent[1]; // Fast transform - axis.toGlobalCoord = axis.dim === 'x' ? function (coord) { - return coord + coordBase; - } : function (coord) { - return axisExtentSum - coord + coordBase; - }; - axis.toLocalCoord = axis.dim === 'x' ? function (coord) { - return coord - coordBase; - } : function (coord) { - return axisExtentSum - coord + coordBase; - }; + axis.toGlobalCoord = axis.dim === 'x' ? function (coord) { + return coord + coordBase; + } : function (coord) { + return axisExtentSum - coord + coordBase; + }; + axis.toLocalCoord = axis.dim === 'x' ? function (coord) { + return coord - coordBase; + } : function (coord) { + return axisExtentSum - coord + coordBase; + }; } var PI$5 = Math.PI; @@ -47926,738 +47926,738 @@ */ var AxisBuilder = - /** @class */ - function () { - function AxisBuilder(axisModel, opt) { - this.group = new Group(); - this.opt = opt; - this.axisModel = axisModel; // Default value - - defaults(opt, { - labelOffset: 0, - nameDirection: 1, - tickDirection: 1, - labelDirection: 1, - silent: true, - handleAutoShown: function () { - return true; - } - }); // FIXME Not use a seperate text group? - - var transformGroup = new Group({ - x: opt.position[0], - y: opt.position[1], - rotation: opt.rotation - }); // this.group.add(transformGroup); - // this._transformGroup = transformGroup; - - transformGroup.updateTransform(); - this._transformGroup = transformGroup; - } - - AxisBuilder.prototype.hasBuilder = function (name) { - return !!builders[name]; - }; - - AxisBuilder.prototype.add = function (name) { - builders[name](this.opt, this.axisModel, this.group, this._transformGroup); - }; - - AxisBuilder.prototype.getGroup = function () { - return this.group; - }; - - AxisBuilder.innerTextLayout = function (axisRotation, textRotation, direction) { - var rotationDiff = remRadian(textRotation - axisRotation); - var textAlign; - var textVerticalAlign; + /** @class */ + function () { + function AxisBuilder(axisModel, opt) { + this.group = new Group(); + this.opt = opt; + this.axisModel = axisModel; // Default value + + defaults(opt, { + labelOffset: 0, + nameDirection: 1, + tickDirection: 1, + labelDirection: 1, + silent: true, + handleAutoShown: function () { + return true; + } + }); // FIXME Not use a seperate text group? + + var transformGroup = new Group({ + x: opt.position[0], + y: opt.position[1], + rotation: opt.rotation + }); // this.group.add(transformGroup); + // this._transformGroup = transformGroup; + + transformGroup.updateTransform(); + this._transformGroup = transformGroup; + } + + AxisBuilder.prototype.hasBuilder = function (name) { + return !!builders[name]; + }; + + AxisBuilder.prototype.add = function (name) { + builders[name](this.opt, this.axisModel, this.group, this._transformGroup); + }; + + AxisBuilder.prototype.getGroup = function () { + return this.group; + }; + + AxisBuilder.innerTextLayout = function (axisRotation, textRotation, direction) { + var rotationDiff = remRadian(textRotation - axisRotation); + var textAlign; + var textVerticalAlign; - if (isRadianAroundZero(rotationDiff)) { - // Label is parallel with axis line. - textVerticalAlign = direction > 0 ? 'top' : 'bottom'; - textAlign = 'center'; - } else if (isRadianAroundZero(rotationDiff - PI$5)) { - // Label is inverse parallel with axis line. - textVerticalAlign = direction > 0 ? 'bottom' : 'top'; - textAlign = 'center'; - } else { - textVerticalAlign = 'middle'; + if (isRadianAroundZero(rotationDiff)) { + // Label is parallel with axis line. + textVerticalAlign = direction > 0 ? 'top' : 'bottom'; + textAlign = 'center'; + } else if (isRadianAroundZero(rotationDiff - PI$5)) { + // Label is inverse parallel with axis line. + textVerticalAlign = direction > 0 ? 'bottom' : 'top'; + textAlign = 'center'; + } else { + textVerticalAlign = 'middle'; - if (rotationDiff > 0 && rotationDiff < PI$5) { - textAlign = direction > 0 ? 'right' : 'left'; - } else { - textAlign = direction > 0 ? 'left' : 'right'; - } - } + if (rotationDiff > 0 && rotationDiff < PI$5) { + textAlign = direction > 0 ? 'right' : 'left'; + } else { + textAlign = direction > 0 ? 'left' : 'right'; + } + } - return { - rotation: rotationDiff, - textAlign: textAlign, - textVerticalAlign: textVerticalAlign - }; - }; + return { + rotation: rotationDiff, + textAlign: textAlign, + textVerticalAlign: textVerticalAlign + }; + }; - AxisBuilder.makeAxisEventDataBase = function (axisModel) { - var eventData = { - componentType: axisModel.mainType, - componentIndex: axisModel.componentIndex - }; - eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex; - return eventData; - }; + AxisBuilder.makeAxisEventDataBase = function (axisModel) { + var eventData = { + componentType: axisModel.mainType, + componentIndex: axisModel.componentIndex + }; + eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex; + return eventData; + }; - AxisBuilder.isLabelSilent = function (axisModel) { - var tooltipOpt = axisModel.get('tooltip'); - return axisModel.get('silent') // Consider mouse cursor, add these restrictions. - || !(axisModel.get('triggerEvent') || tooltipOpt && tooltipOpt.show); - }; + AxisBuilder.isLabelSilent = function (axisModel) { + var tooltipOpt = axisModel.get('tooltip'); + return axisModel.get('silent') // Consider mouse cursor, add these restrictions. + || !(axisModel.get('triggerEvent') || tooltipOpt && tooltipOpt.show); + }; - return AxisBuilder; - }(); + return AxisBuilder; + }(); var builders = { - axisLine: function (opt, axisModel, group, transformGroup) { - var shown = axisModel.get(['axisLine', 'show']); - - if (shown === 'auto' && opt.handleAutoShown) { - shown = opt.handleAutoShown('axisLine'); - } - - if (!shown) { - return; - } + axisLine: function (opt, axisModel, group, transformGroup) { + var shown = axisModel.get(['axisLine', 'show']); - var extent = axisModel.axis.getExtent(); - var matrix = transformGroup.transform; - var pt1 = [extent[0], 0]; - var pt2 = [extent[1], 0]; - - if (matrix) { - applyTransform(pt1, pt1, matrix); - applyTransform(pt2, pt2, matrix); - } - - var lineStyle = extend({ - lineCap: 'round' - }, axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle()); - var line = new Line({ - // Id for animation - subPixelOptimize: true, - shape: { - x1: pt1[0], - y1: pt1[1], - x2: pt2[0], - y2: pt2[1] - }, - style: lineStyle, - strokeContainThreshold: opt.strokeContainThreshold || 5, + if (shown === 'auto' && opt.handleAutoShown) { + shown = opt.handleAutoShown('axisLine'); + } + + if (!shown) { + return; + } + + var extent = axisModel.axis.getExtent(); + var matrix = transformGroup.transform; + var pt1 = [extent[0], 0]; + var pt2 = [extent[1], 0]; + + if (matrix) { + applyTransform(pt1, pt1, matrix); + applyTransform(pt2, pt2, matrix); + } + + var lineStyle = extend({ + lineCap: 'round' + }, axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle()); + var line = new Line({ + // Id for animation + subPixelOptimize: true, + shape: { + x1: pt1[0], + y1: pt1[1], + x2: pt2[0], + y2: pt2[1] + }, + style: lineStyle, + strokeContainThreshold: opt.strokeContainThreshold || 5, + silent: true, + z2: 1 + }); + line.anid = 'line'; + group.add(line); + var arrows = axisModel.get(['axisLine', 'symbol']); + + if (arrows != null) { + var arrowSize = axisModel.get(['axisLine', 'symbolSize']); + + if (isString(arrows)) { + // Use the same arrow for start and end point + arrows = [arrows, arrows]; + } + + if (isString(arrowSize) || isNumber(arrowSize)) { + // Use the same size for width and height + arrowSize = [arrowSize, arrowSize]; + } + + var arrowOffset = normalizeSymbolOffset(axisModel.get(['axisLine', 'symbolOffset']) || 0, arrowSize); + var symbolWidth_1 = arrowSize[0]; + var symbolHeight_1 = arrowSize[1]; + each([{ + rotate: opt.rotation + Math.PI / 2, + offset: arrowOffset[0], + r: 0 + }, { + rotate: opt.rotation - Math.PI / 2, + offset: arrowOffset[1], + r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0]) + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1])) + }], function (point, index) { + if (arrows[index] !== 'none' && arrows[index] != null) { + var symbol = createSymbol(arrows[index], -symbolWidth_1 / 2, -symbolHeight_1 / 2, symbolWidth_1, symbolHeight_1, lineStyle.stroke, true); // Calculate arrow position with offset + + var r = point.r + point.offset; + symbol.attr({ + rotation: point.rotate, + x: pt1[0] + r * Math.cos(opt.rotation), + y: pt1[1] - r * Math.sin(opt.rotation), silent: true, - z2: 1 - }); - line.anid = 'line'; - group.add(line); - var arrows = axisModel.get(['axisLine', 'symbol']); - - if (arrows != null) { - var arrowSize = axisModel.get(['axisLine', 'symbolSize']); - - if (isString(arrows)) { - // Use the same arrow for start and end point - arrows = [arrows, arrows]; - } + z2: 11 + }); + group.add(symbol); + } + }); + } + }, + axisTickLabel: function (opt, axisModel, group, transformGroup) { + var ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt); + var labelEls = buildAxisLabel(group, transformGroup, axisModel, opt); + fixMinMaxLabelShow(axisModel, labelEls, ticksEls); + buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection); // This bit fixes the label overlap issue for the time chart. + // See https://github.com/apache/echarts/issues/14266 for more. + + if (axisModel.get(['axisLabel', 'hideOverlap'])) { + var labelList = prepareLayoutList(map(labelEls, function (label) { + return { + label: label, + priority: label.z2, + defaultAttr: { + ignore: label.ignore + } + }; + })); + hideOverlap(labelList); + } + }, + axisName: function (opt, axisModel, group, transformGroup) { + var name = retrieve(opt.axisName, axisModel.get('name')); - if (isString(arrowSize) || isNumber(arrowSize)) { - // Use the same size for width and height - arrowSize = [arrowSize, arrowSize]; - } + if (!name) { + return; + } - var arrowOffset = normalizeSymbolOffset(axisModel.get(['axisLine', 'symbolOffset']) || 0, arrowSize); - var symbolWidth_1 = arrowSize[0]; - var symbolHeight_1 = arrowSize[1]; - each([{ - rotate: opt.rotation + Math.PI / 2, - offset: arrowOffset[0], - r: 0 - }, { - rotate: opt.rotation - Math.PI / 2, - offset: arrowOffset[1], - r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0]) + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1])) - }], function (point, index) { - if (arrows[index] !== 'none' && arrows[index] != null) { - var symbol = createSymbol(arrows[index], -symbolWidth_1 / 2, -symbolHeight_1 / 2, symbolWidth_1, symbolHeight_1, lineStyle.stroke, true); // Calculate arrow position with offset - - var r = point.r + point.offset; - symbol.attr({ - rotation: point.rotate, - x: pt1[0] + r * Math.cos(opt.rotation), - y: pt1[1] - r * Math.sin(opt.rotation), - silent: true, - z2: 11 - }); - group.add(symbol); - } - }); - } - }, - axisTickLabel: function (opt, axisModel, group, transformGroup) { - var ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt); - var labelEls = buildAxisLabel(group, transformGroup, axisModel, opt); - fixMinMaxLabelShow(axisModel, labelEls, ticksEls); - buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection); // This bit fixes the label overlap issue for the time chart. - // See https://github.com/apache/echarts/issues/14266 for more. - - if (axisModel.get(['axisLabel', 'hideOverlap'])) { - var labelList = prepareLayoutList(map(labelEls, function (label) { - return { - label: label, - priority: label.z2, - defaultAttr: { - ignore: label.ignore - } - }; - })); - hideOverlap(labelList); - } - }, - axisName: function (opt, axisModel, group, transformGroup) { - var name = retrieve(opt.axisName, axisModel.get('name')); + var nameLocation = axisModel.get('nameLocation'); + var nameDirection = opt.nameDirection; + var textStyleModel = axisModel.getModel('nameTextStyle'); + var gap = axisModel.get('nameGap') || 0; + var extent = axisModel.axis.getExtent(); + var gapSignal = extent[0] > extent[1] ? -1 : 1; + var pos = [nameLocation === 'start' ? extent[0] - gapSignal * gap : nameLocation === 'end' ? extent[1] + gapSignal * gap : (extent[0] + extent[1]) / 2, // Reuse labelOffset. + isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0]; + var labelLayout; + var nameRotation = axisModel.get('nameRotate'); - if (!name) { - return; - } + if (nameRotation != null) { + nameRotation = nameRotation * PI$5 / 180; // To radian. + } - var nameLocation = axisModel.get('nameLocation'); - var nameDirection = opt.nameDirection; - var textStyleModel = axisModel.getModel('nameTextStyle'); - var gap = axisModel.get('nameGap') || 0; - var extent = axisModel.axis.getExtent(); - var gapSignal = extent[0] > extent[1] ? -1 : 1; - var pos = [nameLocation === 'start' ? extent[0] - gapSignal * gap : nameLocation === 'end' ? extent[1] + gapSignal * gap : (extent[0] + extent[1]) / 2, // Reuse labelOffset. - isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0]; - var labelLayout; - var nameRotation = axisModel.get('nameRotate'); + var axisNameAvailableWidth; - if (nameRotation != null) { - nameRotation = nameRotation * PI$5 / 180; // To radian. - } + if (isNameLocationCenter(nameLocation)) { + labelLayout = AxisBuilder.innerTextLayout(opt.rotation, nameRotation != null ? nameRotation : opt.rotation, // Adapt to axis. + nameDirection); + } else { + labelLayout = endTextLayout(opt.rotation, nameLocation, nameRotation || 0, extent); + axisNameAvailableWidth = opt.axisNameAvailableWidth; - var axisNameAvailableWidth; + if (axisNameAvailableWidth != null) { + axisNameAvailableWidth = Math.abs(axisNameAvailableWidth / Math.sin(labelLayout.rotation)); + !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null); + } + } - if (isNameLocationCenter(nameLocation)) { - labelLayout = AxisBuilder.innerTextLayout(opt.rotation, nameRotation != null ? nameRotation : opt.rotation, // Adapt to axis. - nameDirection); - } else { - labelLayout = endTextLayout(opt.rotation, nameLocation, nameRotation || 0, extent); - axisNameAvailableWidth = opt.axisNameAvailableWidth; - - if (axisNameAvailableWidth != null) { - axisNameAvailableWidth = Math.abs(axisNameAvailableWidth / Math.sin(labelLayout.rotation)); - !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null); - } - } - - var textFont = textStyleModel.getFont(); - var truncateOpt = axisModel.get('nameTruncate', true) || {}; - var ellipsis = truncateOpt.ellipsis; - var maxWidth = retrieve(opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth); - var textEl = new ZRText({ - x: pos[0], - y: pos[1], - rotation: labelLayout.rotation, - silent: AxisBuilder.isLabelSilent(axisModel), - style: createTextStyle(textStyleModel, { - text: name, - font: textFont, - overflow: 'truncate', - width: maxWidth, - ellipsis: ellipsis, - fill: textStyleModel.getTextColor() || axisModel.get(['axisLine', 'lineStyle', 'color']), - align: textStyleModel.get('align') || labelLayout.textAlign, - verticalAlign: textStyleModel.get('verticalAlign') || labelLayout.textVerticalAlign - }), - z2: 1 - }); - setTooltipConfig({ - el: textEl, - componentModel: axisModel, - itemName: name - }); - textEl.__fullText = name; // Id for animation + var textFont = textStyleModel.getFont(); + var truncateOpt = axisModel.get('nameTruncate', true) || {}; + var ellipsis = truncateOpt.ellipsis; + var maxWidth = retrieve(opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth); + var textEl = new ZRText({ + x: pos[0], + y: pos[1], + rotation: labelLayout.rotation, + silent: AxisBuilder.isLabelSilent(axisModel), + style: createTextStyle(textStyleModel, { + text: name, + font: textFont, + overflow: 'truncate', + width: maxWidth, + ellipsis: ellipsis, + fill: textStyleModel.getTextColor() || axisModel.get(['axisLine', 'lineStyle', 'color']), + align: textStyleModel.get('align') || labelLayout.textAlign, + verticalAlign: textStyleModel.get('verticalAlign') || labelLayout.textVerticalAlign + }), + z2: 1 + }); + setTooltipConfig({ + el: textEl, + componentModel: axisModel, + itemName: name + }); + textEl.__fullText = name; // Id for animation - textEl.anid = 'name'; + textEl.anid = 'name'; - if (axisModel.get('triggerEvent')) { - var eventData = AxisBuilder.makeAxisEventDataBase(axisModel); - eventData.targetType = 'axisName'; - eventData.name = name; - getECData(textEl).eventData = eventData; - } // FIXME + if (axisModel.get('triggerEvent')) { + var eventData = AxisBuilder.makeAxisEventDataBase(axisModel); + eventData.targetType = 'axisName'; + eventData.name = name; + getECData(textEl).eventData = eventData; + } // FIXME - transformGroup.add(textEl); - textEl.updateTransform(); - group.add(textEl); - textEl.decomposeTransform(); - } + transformGroup.add(textEl); + textEl.updateTransform(); + group.add(textEl); + textEl.decomposeTransform(); + } }; function endTextLayout(rotation, textPosition, textRotate, extent) { - var rotationDiff = remRadian(textRotate - rotation); - var textAlign; - var textVerticalAlign; - var inverse = extent[0] > extent[1]; - var onLeft = textPosition === 'start' && !inverse || textPosition !== 'start' && inverse; - - if (isRadianAroundZero(rotationDiff - PI$5 / 2)) { - textVerticalAlign = onLeft ? 'bottom' : 'top'; - textAlign = 'center'; - } else if (isRadianAroundZero(rotationDiff - PI$5 * 1.5)) { - textVerticalAlign = onLeft ? 'top' : 'bottom'; - textAlign = 'center'; + var rotationDiff = remRadian(textRotate - rotation); + var textAlign; + var textVerticalAlign; + var inverse = extent[0] > extent[1]; + var onLeft = textPosition === 'start' && !inverse || textPosition !== 'start' && inverse; + + if (isRadianAroundZero(rotationDiff - PI$5 / 2)) { + textVerticalAlign = onLeft ? 'bottom' : 'top'; + textAlign = 'center'; + } else if (isRadianAroundZero(rotationDiff - PI$5 * 1.5)) { + textVerticalAlign = onLeft ? 'top' : 'bottom'; + textAlign = 'center'; + } else { + textVerticalAlign = 'middle'; + + if (rotationDiff < PI$5 * 1.5 && rotationDiff > PI$5 / 2) { + textAlign = onLeft ? 'left' : 'right'; } else { - textVerticalAlign = 'middle'; - - if (rotationDiff < PI$5 * 1.5 && rotationDiff > PI$5 / 2) { - textAlign = onLeft ? 'left' : 'right'; - } else { - textAlign = onLeft ? 'right' : 'left'; - } + textAlign = onLeft ? 'right' : 'left'; } + } - return { - rotation: rotationDiff, - textAlign: textAlign, - textVerticalAlign: textVerticalAlign - }; + return { + rotation: rotationDiff, + textAlign: textAlign, + textVerticalAlign: textVerticalAlign + }; } function fixMinMaxLabelShow(axisModel, labelEls, tickEls) { - if (shouldShowAllLabels(axisModel.axis)) { - return; - } // If min or max are user set, we need to check - // If the tick on min(max) are overlap on their neighbour tick - // If they are overlapped, we need to hide the min(max) tick label - - - var showMinLabel = axisModel.get(['axisLabel', 'showMinLabel']); - var showMaxLabel = axisModel.get(['axisLabel', 'showMaxLabel']); // FIXME - // Have not consider onBand yet, where tick els is more than label els. - - labelEls = labelEls || []; - tickEls = tickEls || []; - var firstLabel = labelEls[0]; - var nextLabel = labelEls[1]; - var lastLabel = labelEls[labelEls.length - 1]; - var prevLabel = labelEls[labelEls.length - 2]; - var firstTick = tickEls[0]; - var nextTick = tickEls[1]; - var lastTick = tickEls[tickEls.length - 1]; - var prevTick = tickEls[tickEls.length - 2]; - - if (showMinLabel === false) { - ignoreEl(firstLabel); - ignoreEl(firstTick); - } else if (isTwoLabelOverlapped(firstLabel, nextLabel)) { - if (showMinLabel) { - ignoreEl(nextLabel); - ignoreEl(nextTick); - } else { - ignoreEl(firstLabel); - ignoreEl(firstTick); - } - } - - if (showMaxLabel === false) { - ignoreEl(lastLabel); - ignoreEl(lastTick); - } else if (isTwoLabelOverlapped(prevLabel, lastLabel)) { - if (showMaxLabel) { - ignoreEl(prevLabel); - ignoreEl(prevTick); - } else { - ignoreEl(lastLabel); - ignoreEl(lastTick); - } + if (shouldShowAllLabels(axisModel.axis)) { + return; + } // If min or max are user set, we need to check + // If the tick on min(max) are overlap on their neighbour tick + // If they are overlapped, we need to hide the min(max) tick label + + + var showMinLabel = axisModel.get(['axisLabel', 'showMinLabel']); + var showMaxLabel = axisModel.get(['axisLabel', 'showMaxLabel']); // FIXME + // Have not consider onBand yet, where tick els is more than label els. + + labelEls = labelEls || []; + tickEls = tickEls || []; + var firstLabel = labelEls[0]; + var nextLabel = labelEls[1]; + var lastLabel = labelEls[labelEls.length - 1]; + var prevLabel = labelEls[labelEls.length - 2]; + var firstTick = tickEls[0]; + var nextTick = tickEls[1]; + var lastTick = tickEls[tickEls.length - 1]; + var prevTick = tickEls[tickEls.length - 2]; + + if (showMinLabel === false) { + ignoreEl(firstLabel); + ignoreEl(firstTick); + } else if (isTwoLabelOverlapped(firstLabel, nextLabel)) { + if (showMinLabel) { + ignoreEl(nextLabel); + ignoreEl(nextTick); + } else { + ignoreEl(firstLabel); + ignoreEl(firstTick); + } + } + + if (showMaxLabel === false) { + ignoreEl(lastLabel); + ignoreEl(lastTick); + } else if (isTwoLabelOverlapped(prevLabel, lastLabel)) { + if (showMaxLabel) { + ignoreEl(prevLabel); + ignoreEl(prevTick); + } else { + ignoreEl(lastLabel); + ignoreEl(lastTick); } + } } function ignoreEl(el) { - el && (el.ignore = true); + el && (el.ignore = true); } function isTwoLabelOverlapped(current, next) { - // current and next has the same rotation. - var firstRect = current && current.getBoundingRect().clone(); - var nextRect = next && next.getBoundingRect().clone(); + // current and next has the same rotation. + var firstRect = current && current.getBoundingRect().clone(); + var nextRect = next && next.getBoundingRect().clone(); - if (!firstRect || !nextRect) { - return; - } // When checking intersect of two rotated labels, we use mRotationBack - // to avoid that boundingRect is enlarge when using `boundingRect.applyTransform`. + if (!firstRect || !nextRect) { + return; + } // When checking intersect of two rotated labels, we use mRotationBack + // to avoid that boundingRect is enlarge when using `boundingRect.applyTransform`. - var mRotationBack = identity([]); - rotate(mRotationBack, mRotationBack, -current.rotation); - firstRect.applyTransform(mul$1([], mRotationBack, current.getLocalTransform())); - nextRect.applyTransform(mul$1([], mRotationBack, next.getLocalTransform())); - return firstRect.intersect(nextRect); + var mRotationBack = identity([]); + rotate(mRotationBack, mRotationBack, -current.rotation); + firstRect.applyTransform(mul$1([], mRotationBack, current.getLocalTransform())); + nextRect.applyTransform(mul$1([], mRotationBack, next.getLocalTransform())); + return firstRect.intersect(nextRect); } function isNameLocationCenter(nameLocation) { - return nameLocation === 'middle' || nameLocation === 'center'; + return nameLocation === 'middle' || nameLocation === 'center'; } function createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, anidPrefix) { - var tickEls = []; - var pt1 = []; - var pt2 = []; - - for (var i = 0; i < ticksCoords.length; i++) { - var tickCoord = ticksCoords[i].coord; - pt1[0] = tickCoord; - pt1[1] = 0; - pt2[0] = tickCoord; - pt2[1] = tickEndCoord; - - if (tickTransform) { - applyTransform(pt1, pt1, tickTransform); - applyTransform(pt2, pt2, tickTransform); - } // Tick line, Not use group transform to have better line draw - - - var tickEl = new Line({ - subPixelOptimize: true, - shape: { - x1: pt1[0], - y1: pt1[1], - x2: pt2[0], - y2: pt2[1] - }, - style: tickLineStyle, - z2: 2, - autoBatch: true, - silent: true - }); - tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue; - tickEls.push(tickEl); - } + var tickEls = []; + var pt1 = []; + var pt2 = []; + + for (var i = 0; i < ticksCoords.length; i++) { + var tickCoord = ticksCoords[i].coord; + pt1[0] = tickCoord; + pt1[1] = 0; + pt2[0] = tickCoord; + pt2[1] = tickEndCoord; + + if (tickTransform) { + applyTransform(pt1, pt1, tickTransform); + applyTransform(pt2, pt2, tickTransform); + } // Tick line, Not use group transform to have better line draw + + + var tickEl = new Line({ + subPixelOptimize: true, + shape: { + x1: pt1[0], + y1: pt1[1], + x2: pt2[0], + y2: pt2[1] + }, + style: tickLineStyle, + z2: 2, + autoBatch: true, + silent: true + }); + tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue; + tickEls.push(tickEl); + } - return tickEls; + return tickEls; } function buildAxisMajorTicks(group, transformGroup, axisModel, opt) { - var axis = axisModel.axis; - var tickModel = axisModel.getModel('axisTick'); - var shown = tickModel.get('show'); + var axis = axisModel.axis; + var tickModel = axisModel.getModel('axisTick'); + var shown = tickModel.get('show'); - if (shown === 'auto' && opt.handleAutoShown) { - shown = opt.handleAutoShown('axisTick'); - } + if (shown === 'auto' && opt.handleAutoShown) { + shown = opt.handleAutoShown('axisTick'); + } - if (!shown || axis.scale.isBlank()) { - return; - } + if (!shown || axis.scale.isBlank()) { + return; + } - var lineStyleModel = tickModel.getModel('lineStyle'); - var tickEndCoord = opt.tickDirection * tickModel.get('length'); - var ticksCoords = axis.getTicksCoords(); - var ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), { - stroke: axisModel.get(['axisLine', 'lineStyle', 'color']) - }), 'ticks'); + var lineStyleModel = tickModel.getModel('lineStyle'); + var tickEndCoord = opt.tickDirection * tickModel.get('length'); + var ticksCoords = axis.getTicksCoords(); + var ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), { + stroke: axisModel.get(['axisLine', 'lineStyle', 'color']) + }), 'ticks'); - for (var i = 0; i < ticksEls.length; i++) { - group.add(ticksEls[i]); - } + for (var i = 0; i < ticksEls.length; i++) { + group.add(ticksEls[i]); + } - return ticksEls; + return ticksEls; } function buildAxisMinorTicks(group, transformGroup, axisModel, tickDirection) { - var axis = axisModel.axis; - var minorTickModel = axisModel.getModel('minorTick'); + var axis = axisModel.axis; + var minorTickModel = axisModel.getModel('minorTick'); - if (!minorTickModel.get('show') || axis.scale.isBlank()) { - return; - } + if (!minorTickModel.get('show') || axis.scale.isBlank()) { + return; + } - var minorTicksCoords = axis.getMinorTicksCoords(); + var minorTicksCoords = axis.getMinorTicksCoords(); - if (!minorTicksCoords.length) { - return; - } + if (!minorTicksCoords.length) { + return; + } - var lineStyleModel = minorTickModel.getModel('lineStyle'); - var tickEndCoord = tickDirection * minorTickModel.get('length'); - var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel('axisTick').getLineStyle(), { - stroke: axisModel.get(['axisLine', 'lineStyle', 'color']) - })); + var lineStyleModel = minorTickModel.getModel('lineStyle'); + var tickEndCoord = tickDirection * minorTickModel.get('length'); + var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel('axisTick').getLineStyle(), { + stroke: axisModel.get(['axisLine', 'lineStyle', 'color']) + })); - for (var i = 0; i < minorTicksCoords.length; i++) { - var minorTicksEls = createTicks(minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i); + for (var i = 0; i < minorTicksCoords.length; i++) { + var minorTicksEls = createTicks(minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i); - for (var k = 0; k < minorTicksEls.length; k++) { - group.add(minorTicksEls[k]); - } + for (var k = 0; k < minorTicksEls.length; k++) { + group.add(minorTicksEls[k]); } + } } function buildAxisLabel(group, transformGroup, axisModel, opt) { - var axis = axisModel.axis; - var show = retrieve(opt.axisLabelShow, axisModel.get(['axisLabel', 'show'])); + var axis = axisModel.axis; + var show = retrieve(opt.axisLabelShow, axisModel.get(['axisLabel', 'show'])); - if (!show || axis.scale.isBlank()) { - return; - } - - var labelModel = axisModel.getModel('axisLabel'); - var labelMargin = labelModel.get('margin'); - var labels = axis.getViewLabels(); // Special label rotate. - - var labelRotation = (retrieve(opt.labelRotate, labelModel.get('rotate')) || 0) * PI$5 / 180; - var labelLayout = AxisBuilder.innerTextLayout(opt.rotation, labelRotation, opt.labelDirection); - var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true); - var labelEls = []; - var silent = AxisBuilder.isLabelSilent(axisModel); - var triggerEvent = axisModel.get('triggerEvent'); - each(labels, function (labelItem, index) { - var tickValue = axis.scale.type === 'ordinal' ? axis.scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue; - var formattedLabel = labelItem.formattedLabel; - var rawLabel = labelItem.rawLabel; - var itemLabelModel = labelModel; - - if (rawCategoryData && rawCategoryData[tickValue]) { - var rawCategoryItem = rawCategoryData[tickValue]; - - if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) { - itemLabelModel = new Model(rawCategoryItem.textStyle, labelModel, axisModel.ecModel); - } - } - - var textColor = itemLabelModel.getTextColor() || axisModel.get(['axisLine', 'lineStyle', 'color']); - var tickCoord = axis.dataToCoord(tickValue); - var textEl = new ZRText({ - x: tickCoord, - y: opt.labelOffset + opt.labelDirection * labelMargin, - rotation: labelLayout.rotation, - silent: silent, - z2: 10 + (labelItem.level || 0), - style: createTextStyle(itemLabelModel, { - text: formattedLabel, - align: itemLabelModel.getShallow('align', true) || labelLayout.textAlign, - verticalAlign: itemLabelModel.getShallow('verticalAlign', true) || itemLabelModel.getShallow('baseline', true) || labelLayout.textVerticalAlign, - fill: isFunction(textColor) ? textColor( // (1) In category axis with data zoom, tick is not the original - // index of axis.data. So tick should not be exposed to user - // in category axis. - // (2) Compatible with previous version, which always use formatted label as - // input. But in interval scale the formatted label is like '223,445', which - // maked user repalce ','. So we modify it to return original val but remain - // it as 'string' to avoid error in replacing. - axis.type === 'category' ? rawLabel : axis.type === 'value' ? tickValue + '' : tickValue, index) : textColor - }) - }); - textEl.anid = 'label_' + tickValue; // Pack data for mouse event + if (!show || axis.scale.isBlank()) { + return; + } + + var labelModel = axisModel.getModel('axisLabel'); + var labelMargin = labelModel.get('margin'); + var labels = axis.getViewLabels(); // Special label rotate. + + var labelRotation = (retrieve(opt.labelRotate, labelModel.get('rotate')) || 0) * PI$5 / 180; + var labelLayout = AxisBuilder.innerTextLayout(opt.rotation, labelRotation, opt.labelDirection); + var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true); + var labelEls = []; + var silent = AxisBuilder.isLabelSilent(axisModel); + var triggerEvent = axisModel.get('triggerEvent'); + each(labels, function (labelItem, index) { + var tickValue = axis.scale.type === 'ordinal' ? axis.scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue; + var formattedLabel = labelItem.formattedLabel; + var rawLabel = labelItem.rawLabel; + var itemLabelModel = labelModel; + + if (rawCategoryData && rawCategoryData[tickValue]) { + var rawCategoryItem = rawCategoryData[tickValue]; + + if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) { + itemLabelModel = new Model(rawCategoryItem.textStyle, labelModel, axisModel.ecModel); + } + } + + var textColor = itemLabelModel.getTextColor() || axisModel.get(['axisLine', 'lineStyle', 'color']); + var tickCoord = axis.dataToCoord(tickValue); + var textEl = new ZRText({ + x: tickCoord, + y: opt.labelOffset + opt.labelDirection * labelMargin, + rotation: labelLayout.rotation, + silent: silent, + z2: 10 + (labelItem.level || 0), + style: createTextStyle(itemLabelModel, { + text: formattedLabel, + align: itemLabelModel.getShallow('align', true) || labelLayout.textAlign, + verticalAlign: itemLabelModel.getShallow('verticalAlign', true) || itemLabelModel.getShallow('baseline', true) || labelLayout.textVerticalAlign, + fill: isFunction(textColor) ? textColor( // (1) In category axis with data zoom, tick is not the original + // index of axis.data. So tick should not be exposed to user + // in category axis. + // (2) Compatible with previous version, which always use formatted label as + // input. But in interval scale the formatted label is like '223,445', which + // maked user repalce ','. So we modify it to return original val but remain + // it as 'string' to avoid error in replacing. + axis.type === 'category' ? rawLabel : axis.type === 'value' ? tickValue + '' : tickValue, index) : textColor + }) + }); + textEl.anid = 'label_' + tickValue; // Pack data for mouse event - if (triggerEvent) { - var eventData = AxisBuilder.makeAxisEventDataBase(axisModel); - eventData.targetType = 'axisLabel'; - eventData.value = rawLabel; - eventData.tickIndex = index; + if (triggerEvent) { + var eventData = AxisBuilder.makeAxisEventDataBase(axisModel); + eventData.targetType = 'axisLabel'; + eventData.value = rawLabel; + eventData.tickIndex = index; - if (axis.type === 'category') { - eventData.dataIndex = tickValue; - } + if (axis.type === 'category') { + eventData.dataIndex = tickValue; + } - getECData(textEl).eventData = eventData; - } // FIXME + getECData(textEl).eventData = eventData; + } // FIXME - transformGroup.add(textEl); - textEl.updateTransform(); - labelEls.push(textEl); - group.add(textEl); - textEl.decomposeTransform(); - }); - return labelEls; + transformGroup.add(textEl); + textEl.updateTransform(); + labelEls.push(textEl); + group.add(textEl); + textEl.decomposeTransform(); + }); + return labelEls; } // allAxesInfo should be updated when setOption performed. function collect(ecModel, api) { - var result = { - /** - * key: makeKey(axis.model) - * value: { - * axis, - * coordSys, - * axisPointerModel, - * triggerTooltip, - * involveSeries, - * snap, - * seriesModels, - * seriesDataCount - * } - */ - axesInfo: {}, - seriesInvolved: false, + var result = { + /** + * key: makeKey(axis.model) + * value: { + * axis, + * coordSys, + * axisPointerModel, + * triggerTooltip, + * involveSeries, + * snap, + * seriesModels, + * seriesDataCount + * } + */ + axesInfo: {}, + seriesInvolved: false, - /** - * key: makeKey(coordSys.model) - * value: Object: key makeKey(axis.model), value: axisInfo - */ - coordSysAxesInfo: {}, - coordSysMap: {} - }; - collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart. + /** + * key: makeKey(coordSys.model) + * value: Object: key makeKey(axis.model), value: axisInfo + */ + coordSysAxesInfo: {}, + coordSysMap: {} + }; + collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart. - result.seriesInvolved && collectSeriesInfo(result, ecModel); - return result; + result.seriesInvolved && collectSeriesInfo(result, ecModel); + return result; } function collectAxesInfo(result, ecModel, api) { - var globalTooltipModel = ecModel.getComponent('tooltip'); - var globalAxisPointerModel = ecModel.getComponent('axisPointer'); // links can only be set on global. - - var linksOption = globalAxisPointerModel.get('link', true) || []; - var linkGroups = []; // Collect axes info. - - each(api.getCoordinateSystems(), function (coordSys) { - // Some coordinate system do not support axes, like geo. - if (!coordSys.axisPointerEnabled) { - return; - } - - var coordSysKey = makeKey(coordSys.model); - var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {}; - result.coordSysMap[coordSysKey] = coordSys; // Set tooltip (like 'cross') is a convienent way to show axisPointer - // for user. So we enable seting tooltip on coordSys model. + var globalTooltipModel = ecModel.getComponent('tooltip'); + var globalAxisPointerModel = ecModel.getComponent('axisPointer'); // links can only be set on global. - var coordSysModel = coordSys.model; - var baseTooltipModel = coordSysModel.getModel('tooltip', globalTooltipModel); - each(coordSys.getAxes(), curry(saveTooltipAxisInfo, false, null)); // If axis tooltip used, choose tooltip axis for each coordSys. - // Notice this case: coordSys is `grid` but not `cartesian2D` here. + var linksOption = globalAxisPointerModel.get('link', true) || []; + var linkGroups = []; // Collect axes info. - if (coordSys.getTooltipAxes && globalTooltipModel // If tooltip.showContent is set as false, tooltip will not - // show but axisPointer will show as normal. - && baseTooltipModel.get('show')) { - // Compatible with previous logic. But series.tooltip.trigger: 'axis' - // or series.data[n].tooltip.trigger: 'axis' are not support any more. - var triggerAxis = baseTooltipModel.get('trigger') === 'axis'; - var cross = baseTooltipModel.get(['axisPointer', 'type']) === 'cross'; - var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(['axisPointer', 'axis'])); - - if (triggerAxis || cross) { - each(tooltipAxes.baseAxes, curry(saveTooltipAxisInfo, cross ? 'cross' : true, triggerAxis)); - } + each(api.getCoordinateSystems(), function (coordSys) { + // Some coordinate system do not support axes, like geo. + if (!coordSys.axisPointerEnabled) { + return; + } - if (cross) { - each(tooltipAxes.otherAxes, curry(saveTooltipAxisInfo, 'cross', false)); - } - } // fromTooltip: true | false | 'cross' - // triggerTooltip: true | false | null + var coordSysKey = makeKey(coordSys.model); + var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {}; + result.coordSysMap[coordSysKey] = coordSys; // Set tooltip (like 'cross') is a convienent way to show axisPointer + // for user. So we enable seting tooltip on coordSys model. + var coordSysModel = coordSys.model; + var baseTooltipModel = coordSysModel.getModel('tooltip', globalTooltipModel); + each(coordSys.getAxes(), curry(saveTooltipAxisInfo, false, null)); // If axis tooltip used, choose tooltip axis for each coordSys. + // Notice this case: coordSys is `grid` but not `cartesian2D` here. - function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) { - var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel); - var axisPointerShow = axisPointerModel.get('show'); + if (coordSys.getTooltipAxes && globalTooltipModel // If tooltip.showContent is set as false, tooltip will not + // show but axisPointer will show as normal. + && baseTooltipModel.get('show')) { + // Compatible with previous logic. But series.tooltip.trigger: 'axis' + // or series.data[n].tooltip.trigger: 'axis' are not support any more. + var triggerAxis = baseTooltipModel.get('trigger') === 'axis'; + var cross = baseTooltipModel.get(['axisPointer', 'type']) === 'cross'; + var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(['axisPointer', 'axis'])); - if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) { - return; - } + if (triggerAxis || cross) { + each(tooltipAxes.baseAxes, curry(saveTooltipAxisInfo, cross ? 'cross' : true, triggerAxis)); + } - if (triggerTooltip == null) { - triggerTooltip = axisPointerModel.get('triggerTooltip'); - } + if (cross) { + each(tooltipAxes.otherAxes, curry(saveTooltipAxisInfo, 'cross', false)); + } + } // fromTooltip: true | false | 'cross' + // triggerTooltip: true | false | null - axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel; - var snap = axisPointerModel.get('snap'); - var axisKey = makeKey(axis.model); - var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority). - var axisInfo = result.axesInfo[axisKey] = { - key: axisKey, - axis: axis, - coordSys: coordSys, - axisPointerModel: axisPointerModel, - triggerTooltip: triggerTooltip, - involveSeries: involveSeries, - snap: snap, - useHandle: isHandleTrigger(axisPointerModel), - seriesModels: [], - linkGroup: null - }; - axesInfoInCoordSys[axisKey] = axisInfo; - result.seriesInvolved = result.seriesInvolved || involveSeries; - var groupIndex = getLinkGroupIndex(linksOption, axis); + function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) { + var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel); + var axisPointerShow = axisPointerModel.get('show'); - if (groupIndex != null) { - var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = { - axesInfo: {} - }); - linkGroup.axesInfo[axisKey] = axisInfo; - linkGroup.mapper = linksOption[groupIndex].mapper; - axisInfo.linkGroup = linkGroup; - } - } - }); + if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) { + return; + } + + if (triggerTooltip == null) { + triggerTooltip = axisPointerModel.get('triggerTooltip'); + } + + axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel; + var snap = axisPointerModel.get('snap'); + var axisKey = makeKey(axis.model); + var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority). + + var axisInfo = result.axesInfo[axisKey] = { + key: axisKey, + axis: axis, + coordSys: coordSys, + axisPointerModel: axisPointerModel, + triggerTooltip: triggerTooltip, + involveSeries: involveSeries, + snap: snap, + useHandle: isHandleTrigger(axisPointerModel), + seriesModels: [], + linkGroup: null + }; + axesInfoInCoordSys[axisKey] = axisInfo; + result.seriesInvolved = result.seriesInvolved || involveSeries; + var groupIndex = getLinkGroupIndex(linksOption, axis); + + if (groupIndex != null) { + var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = { + axesInfo: {} + }); + linkGroup.axesInfo[axisKey] = axisInfo; + linkGroup.mapper = linksOption[groupIndex].mapper; + axisInfo.linkGroup = linkGroup; + } + } + }); } function makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) { - var tooltipAxisPointerModel = baseTooltipModel.getModel('axisPointer'); - var fields = ['type', 'snap', 'lineStyle', 'shadowStyle', 'label', 'animation', 'animationDurationUpdate', 'animationEasingUpdate', 'z']; - var volatileOption = {}; - each(fields, function (field) { - volatileOption[field] = clone(tooltipAxisPointerModel.get(field)); - }); // category axis do not auto snap, otherwise some tick that do not - // has value can not be hovered. value/time/log axis default snap if - // triggered from tooltip and trigger tooltip. + var tooltipAxisPointerModel = baseTooltipModel.getModel('axisPointer'); + var fields = ['type', 'snap', 'lineStyle', 'shadowStyle', 'label', 'animation', 'animationDurationUpdate', 'animationEasingUpdate', 'z']; + var volatileOption = {}; + each(fields, function (field) { + volatileOption[field] = clone(tooltipAxisPointerModel.get(field)); + }); // category axis do not auto snap, otherwise some tick that do not + // has value can not be hovered. value/time/log axis default snap if + // triggered from tooltip and trigger tooltip. - volatileOption.snap = axis.type !== 'category' && !!triggerTooltip; // Compatibel with previous behavior, tooltip axis do not show label by default. - // Only these properties can be overrided from tooltip to axisPointer. + volatileOption.snap = axis.type !== 'category' && !!triggerTooltip; // Compatibel with previous behavior, tooltip axis do not show label by default. + // Only these properties can be overrided from tooltip to axisPointer. - if (tooltipAxisPointerModel.get('type') === 'cross') { - volatileOption.type = 'line'; - } + if (tooltipAxisPointerModel.get('type') === 'cross') { + volatileOption.type = 'line'; + } - var labelOption = volatileOption.label || (volatileOption.label = {}); // Follow the convention, do not show label when triggered by tooltip by default. + var labelOption = volatileOption.label || (volatileOption.label = {}); // Follow the convention, do not show label when triggered by tooltip by default. - labelOption.show == null && (labelOption.show = false); + labelOption.show == null && (labelOption.show = false); - if (fromTooltip === 'cross') { - // When 'cross', both axes show labels. - var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(['label', 'show']); - labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true; // If triggerTooltip, this is a base axis, which should better not use cross style - // (cross style is dashed by default) + if (fromTooltip === 'cross') { + // When 'cross', both axes show labels. + var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(['label', 'show']); + labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true; // If triggerTooltip, this is a base axis, which should better not use cross style + // (cross style is dashed by default) - if (!triggerTooltip) { - var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle'); - crossStyle && defaults(labelOption, crossStyle.textStyle); - } + if (!triggerTooltip) { + var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle'); + crossStyle && defaults(labelOption, crossStyle.textStyle); } + } - return axis.model.getModel('axisPointer', new Model(volatileOption, globalAxisPointerModel, ecModel)); + return axis.model.getModel('axisPointer', new Model(volatileOption, globalAxisPointerModel, ecModel)); } function collectSeriesInfo(result, ecModel) { - // Prepare data for axis trigger - ecModel.eachSeries(function (seriesModel) { - // Notice this case: this coordSys is `cartesian2D` but not `grid`. - var coordSys = seriesModel.coordinateSystem; - var seriesTooltipTrigger = seriesModel.get(['tooltip', 'trigger'], true); - var seriesTooltipShow = seriesModel.get(['tooltip', 'show'], true); + // Prepare data for axis trigger + ecModel.eachSeries(function (seriesModel) { + // Notice this case: this coordSys is `cartesian2D` but not `grid`. + var coordSys = seriesModel.coordinateSystem; + var seriesTooltipTrigger = seriesModel.get(['tooltip', 'trigger'], true); + var seriesTooltipShow = seriesModel.get(['tooltip', 'show'], true); - if (!coordSys || seriesTooltipTrigger === 'none' || seriesTooltipTrigger === false || seriesTooltipTrigger === 'item' || seriesTooltipShow === false || seriesModel.get(['axisPointer', 'show'], true) === false) { - return; - } + if (!coordSys || seriesTooltipTrigger === 'none' || seriesTooltipTrigger === false || seriesTooltipTrigger === 'item' || seriesTooltipShow === false || seriesModel.get(['axisPointer', 'show'], true) === false) { + return; + } - each(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) { - var axis = axisInfo.axis; + each(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) { + var axis = axisInfo.axis; - if (coordSys.getAxis(axis.dim) === axis) { - axisInfo.seriesModels.push(seriesModel); - axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0); - axisInfo.seriesDataCount += seriesModel.getData().count(); - } - }); + if (coordSys.getAxis(axis.dim) === axis) { + axisInfo.seriesModels.push(seriesModel); + axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0); + axisInfo.seriesDataCount += seriesModel.getData().count(); + } }); + }); } /** * For example: @@ -48676,78 +48676,78 @@ function getLinkGroupIndex(linksOption, axis) { - var axisModel = axis.model; - var dim = axis.dim; + var axisModel = axis.model; + var dim = axis.dim; - for (var i = 0; i < linksOption.length; i++) { - var linkOption = linksOption[i] || {}; + for (var i = 0; i < linksOption.length; i++) { + var linkOption = linksOption[i] || {}; - if (checkPropInLink(linkOption[dim + 'AxisId'], axisModel.id) || checkPropInLink(linkOption[dim + 'AxisIndex'], axisModel.componentIndex) || checkPropInLink(linkOption[dim + 'AxisName'], axisModel.name)) { - return i; - } + if (checkPropInLink(linkOption[dim + 'AxisId'], axisModel.id) || checkPropInLink(linkOption[dim + 'AxisIndex'], axisModel.componentIndex) || checkPropInLink(linkOption[dim + 'AxisName'], axisModel.name)) { + return i; } + } } function checkPropInLink(linkPropValue, axisPropValue) { - return linkPropValue === 'all' || isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0 || linkPropValue === axisPropValue; + return linkPropValue === 'all' || isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0 || linkPropValue === axisPropValue; } function fixValue(axisModel) { - var axisInfo = getAxisInfo(axisModel); + var axisInfo = getAxisInfo(axisModel); - if (!axisInfo) { - return; - } + if (!axisInfo) { + return; + } - var axisPointerModel = axisInfo.axisPointerModel; - var scale = axisInfo.axis.scale; - var option = axisPointerModel.option; - var status = axisPointerModel.get('status'); - var value = axisPointerModel.get('value'); // Parse init value for category and time axis. + var axisPointerModel = axisInfo.axisPointerModel; + var scale = axisInfo.axis.scale; + var option = axisPointerModel.option; + var status = axisPointerModel.get('status'); + var value = axisPointerModel.get('value'); // Parse init value for category and time axis. - if (value != null) { - value = scale.parse(value); - } + if (value != null) { + value = scale.parse(value); + } - var useHandle = isHandleTrigger(axisPointerModel); // If `handle` used, `axisPointer` will always be displayed, so value - // and status should be initialized. + var useHandle = isHandleTrigger(axisPointerModel); // If `handle` used, `axisPointer` will always be displayed, so value + // and status should be initialized. - if (status == null) { - option.status = useHandle ? 'show' : 'hide'; - } + if (status == null) { + option.status = useHandle ? 'show' : 'hide'; + } - var extent = scale.getExtent().slice(); - extent[0] > extent[1] && extent.reverse(); + var extent = scale.getExtent().slice(); + extent[0] > extent[1] && extent.reverse(); - if ( // Pick a value on axis when initializing. - value == null // If both `handle` and `dataZoom` are used, value may be out of axis extent, - // where we should re-pick a value to keep `handle` displaying normally. - || value > extent[1]) { - // Make handle displayed on the end of the axis when init, which looks better. - value = extent[1]; - } + if ( // Pick a value on axis when initializing. + value == null // If both `handle` and `dataZoom` are used, value may be out of axis extent, + // where we should re-pick a value to keep `handle` displaying normally. + || value > extent[1]) { + // Make handle displayed on the end of the axis when init, which looks better. + value = extent[1]; + } - if (value < extent[0]) { - value = extent[0]; - } + if (value < extent[0]) { + value = extent[0]; + } - option.value = value; + option.value = value; - if (useHandle) { - option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show'; - } + if (useHandle) { + option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show'; + } } function getAxisInfo(axisModel) { - var coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') || {}).coordSysAxesInfo; - return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)]; + var coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') || {}).coordSysAxesInfo; + return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)]; } function getAxisPointerModel(axisModel) { - var axisInfo = getAxisInfo(axisModel); - return axisInfo && axisInfo.axisPointerModel; + var axisInfo = getAxisInfo(axisModel); + return axisInfo && axisInfo.axisPointerModel; } function isHandleTrigger(axisPointerModel) { - return !!axisPointerModel.get(['handle', 'show']); + return !!axisPointerModel.get(['handle', 'show']); } /** * @param {module:echarts/model/Model} model @@ -48756,7 +48756,7 @@ function makeKey(model) { - return model.type + '||' + model.id; + return model.type + '||' + model.id; } var axisPointerClazz = {}; @@ -48765,1361 +48765,1361 @@ */ var AxisView = - /** @class */ - function (_super) { - __extends(AxisView, _super); + /** @class */ + function (_super) { + __extends(AxisView, _super); - function AxisView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function AxisView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = AxisView.type; - return _this; - } - /** - * @override - */ - - - AxisView.prototype.render = function (axisModel, ecModel, api, payload) { - // FIXME - // This process should proformed after coordinate systems updated - // (axis scale updated), and should be performed each time update. - // So put it here temporarily, although it is not appropriate to - // put a model-writing procedure in `view`. - this.axisPointerClass && fixValue(axisModel); + _this.type = AxisView.type; + return _this; + } + /** + * @override + */ - _super.prototype.render.apply(this, arguments); - this._doUpdateAxisPointerClass(axisModel, api, true); - }; - /** - * Action handler. - */ + AxisView.prototype.render = function (axisModel, ecModel, api, payload) { + // FIXME + // This process should proformed after coordinate systems updated + // (axis scale updated), and should be performed each time update. + // So put it here temporarily, although it is not appropriate to + // put a model-writing procedure in `view`. + this.axisPointerClass && fixValue(axisModel); + + _super.prototype.render.apply(this, arguments); + + this._doUpdateAxisPointerClass(axisModel, api, true); + }; + /** + * Action handler. + */ - AxisView.prototype.updateAxisPointer = function (axisModel, ecModel, api, payload) { - this._doUpdateAxisPointerClass(axisModel, api, false); - }; - /** - * @override - */ + AxisView.prototype.updateAxisPointer = function (axisModel, ecModel, api, payload) { + this._doUpdateAxisPointerClass(axisModel, api, false); + }; + /** + * @override + */ - AxisView.prototype.remove = function (ecModel, api) { - var axisPointer = this._axisPointer; - axisPointer && axisPointer.remove(api); - }; - /** - * @override - */ + AxisView.prototype.remove = function (ecModel, api) { + var axisPointer = this._axisPointer; + axisPointer && axisPointer.remove(api); + }; + /** + * @override + */ - AxisView.prototype.dispose = function (ecModel, api) { - this._disposeAxisPointer(api); + AxisView.prototype.dispose = function (ecModel, api) { + this._disposeAxisPointer(api); - _super.prototype.dispose.apply(this, arguments); - }; + _super.prototype.dispose.apply(this, arguments); + }; - AxisView.prototype._doUpdateAxisPointerClass = function (axisModel, api, forceRender) { - var Clazz = AxisView.getAxisPointerClass(this.axisPointerClass); + AxisView.prototype._doUpdateAxisPointerClass = function (axisModel, api, forceRender) { + var Clazz = AxisView.getAxisPointerClass(this.axisPointerClass); - if (!Clazz) { - return; - } + if (!Clazz) { + return; + } - var axisPointerModel = getAxisPointerModel(axisModel); - axisPointerModel ? (this._axisPointer || (this._axisPointer = new Clazz())).render(axisModel, axisPointerModel, api, forceRender) : this._disposeAxisPointer(api); - }; + var axisPointerModel = getAxisPointerModel(axisModel); + axisPointerModel ? (this._axisPointer || (this._axisPointer = new Clazz())).render(axisModel, axisPointerModel, api, forceRender) : this._disposeAxisPointer(api); + }; - AxisView.prototype._disposeAxisPointer = function (api) { - this._axisPointer && this._axisPointer.dispose(api); - this._axisPointer = null; - }; + AxisView.prototype._disposeAxisPointer = function (api) { + this._axisPointer && this._axisPointer.dispose(api); + this._axisPointer = null; + }; - AxisView.registerAxisPointerClass = function (type, clazz) { - if ("development" !== 'production') { - if (axisPointerClazz[type]) { - throw new Error('axisPointer ' + type + ' exists'); - } - } + AxisView.registerAxisPointerClass = function (type, clazz) { + if ("development" !== 'production') { + if (axisPointerClazz[type]) { + throw new Error('axisPointer ' + type + ' exists'); + } + } - axisPointerClazz[type] = clazz; - }; + axisPointerClazz[type] = clazz; + }; - AxisView.getAxisPointerClass = function (type) { - return type && axisPointerClazz[type]; - }; - AxisView.type = 'axis'; - return AxisView; - }(ComponentView); + AxisView.getAxisPointerClass = function (type) { + return type && axisPointerClazz[type]; + }; + AxisView.type = 'axis'; + return AxisView; + }(ComponentView); var inner$6 = makeInner(); function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) { - var axis = axisModel.axis; - - if (axis.scale.isBlank()) { - return; - } // TODO: TYPE - - - var splitAreaModel = axisModel.getModel('splitArea'); - var areaStyleModel = splitAreaModel.getModel('areaStyle'); - var areaColors = areaStyleModel.get('color'); - var gridRect = gridModel.coordinateSystem.getRect(); - var ticksCoords = axis.getTicksCoords({ - tickModel: splitAreaModel, - clamp: true - }); - - if (!ticksCoords.length) { - return; - } // For Making appropriate splitArea animation, the color and anid - // should be corresponding to previous one if possible. + var axis = axisModel.axis; + if (axis.scale.isBlank()) { + return; + } // TODO: TYPE - var areaColorsLen = areaColors.length; - var lastSplitAreaColors = inner$6(axisView).splitAreaColors; - var newSplitAreaColors = createHashMap(); - var colorIndex = 0; - if (lastSplitAreaColors) { - for (var i = 0; i < ticksCoords.length; i++) { - var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue); + var splitAreaModel = axisModel.getModel('splitArea'); + var areaStyleModel = splitAreaModel.getModel('areaStyle'); + var areaColors = areaStyleModel.get('color'); + var gridRect = gridModel.coordinateSystem.getRect(); + var ticksCoords = axis.getTicksCoords({ + tickModel: splitAreaModel, + clamp: true + }); - if (cIndex != null) { - colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen; - break; - } - } - } + if (!ticksCoords.length) { + return; + } // For Making appropriate splitArea animation, the color and anid + // should be corresponding to previous one if possible. - var prev = axis.toGlobalCoord(ticksCoords[0].coord); - var areaStyle = areaStyleModel.getAreaStyle(); - areaColors = isArray(areaColors) ? areaColors : [areaColors]; - for (var i = 1; i < ticksCoords.length; i++) { - var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord); - var x = void 0; - var y = void 0; - var width = void 0; - var height = void 0; - - if (axis.isHorizontal()) { - x = prev; - y = gridRect.y; - width = tickCoord - x; - height = gridRect.height; - prev = x + width; - } else { - x = gridRect.x; - y = prev; - width = gridRect.width; - height = tickCoord - y; - prev = y + height; - } + var areaColorsLen = areaColors.length; + var lastSplitAreaColors = inner$6(axisView).splitAreaColors; + var newSplitAreaColors = createHashMap(); + var colorIndex = 0; - var tickValue = ticksCoords[i - 1].tickValue; - tickValue != null && newSplitAreaColors.set(tickValue, colorIndex); - axisGroup.add(new Rect({ - anid: tickValue != null ? 'area_' + tickValue : null, - shape: { - x: x, - y: y, - width: width, - height: height - }, - style: defaults({ - fill: areaColors[colorIndex] - }, areaStyle), - autoBatch: true, - silent: true - })); - colorIndex = (colorIndex + 1) % areaColorsLen; - } + if (lastSplitAreaColors) { + for (var i = 0; i < ticksCoords.length; i++) { + var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue); + + if (cIndex != null) { + colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen; + break; + } + } + } + + var prev = axis.toGlobalCoord(ticksCoords[0].coord); + var areaStyle = areaStyleModel.getAreaStyle(); + areaColors = isArray(areaColors) ? areaColors : [areaColors]; + + for (var i = 1; i < ticksCoords.length; i++) { + var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord); + var x = void 0; + var y = void 0; + var width = void 0; + var height = void 0; + + if (axis.isHorizontal()) { + x = prev; + y = gridRect.y; + width = tickCoord - x; + height = gridRect.height; + prev = x + width; + } else { + x = gridRect.x; + y = prev; + width = gridRect.width; + height = tickCoord - y; + prev = y + height; + } + + var tickValue = ticksCoords[i - 1].tickValue; + tickValue != null && newSplitAreaColors.set(tickValue, colorIndex); + axisGroup.add(new Rect({ + anid: tickValue != null ? 'area_' + tickValue : null, + shape: { + x: x, + y: y, + width: width, + height: height + }, + style: defaults({ + fill: areaColors[colorIndex] + }, areaStyle), + autoBatch: true, + silent: true + })); + colorIndex = (colorIndex + 1) % areaColorsLen; + } - inner$6(axisView).splitAreaColors = newSplitAreaColors; + inner$6(axisView).splitAreaColors = newSplitAreaColors; } function rectCoordAxisHandleRemove(axisView) { - inner$6(axisView).splitAreaColors = null; + inner$6(axisView).splitAreaColors = null; } var axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName']; var selfBuilderAttrs = ['splitArea', 'splitLine', 'minorSplitLine']; var CartesianAxisView = - /** @class */ - function (_super) { - __extends(CartesianAxisView, _super); - - function CartesianAxisView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = CartesianAxisView.type; - _this.axisPointerClass = 'CartesianAxisPointer'; - return _this; - } - /** - * @override - */ + /** @class */ + function (_super) { + __extends(CartesianAxisView, _super); + + function CartesianAxisView() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = CartesianAxisView.type; + _this.axisPointerClass = 'CartesianAxisPointer'; + return _this; + } + /** + * @override + */ - CartesianAxisView.prototype.render = function (axisModel, ecModel, api, payload) { - this.group.removeAll(); - var oldAxisGroup = this._axisGroup; - this._axisGroup = new Group(); - this.group.add(this._axisGroup); + CartesianAxisView.prototype.render = function (axisModel, ecModel, api, payload) { + this.group.removeAll(); + var oldAxisGroup = this._axisGroup; + this._axisGroup = new Group(); + this.group.add(this._axisGroup); - if (!axisModel.get('show')) { - return; - } + if (!axisModel.get('show')) { + return; + } - var gridModel = axisModel.getCoordSysModel(); - var layout = layout$1(gridModel, axisModel); - var axisBuilder = new AxisBuilder(axisModel, extend({ - handleAutoShown: function (elementType) { - var cartesians = gridModel.coordinateSystem.getCartesians(); + var gridModel = axisModel.getCoordSysModel(); + var layout = layout$1(gridModel, axisModel); + var axisBuilder = new AxisBuilder(axisModel, extend({ + handleAutoShown: function (elementType) { + var cartesians = gridModel.coordinateSystem.getCartesians(); - for (var i = 0; i < cartesians.length; i++) { - if (isIntervalOrLogScale(cartesians[i].getOtherAxis(axisModel.axis).scale)) { - // Still show axis tick or axisLine if other axis is value / log - return true; - } - } // Not show axisTick or axisLine if other axis is category / time + for (var i = 0; i < cartesians.length; i++) { + if (isIntervalOrLogScale(cartesians[i].getOtherAxis(axisModel.axis).scale)) { + // Still show axis tick or axisLine if other axis is value / log + return true; + } + } // Not show axisTick or axisLine if other axis is category / time - return false; - } - }, layout)); - each(axisBuilderAttrs, axisBuilder.add, axisBuilder); + return false; + } + }, layout)); + each(axisBuilderAttrs, axisBuilder.add, axisBuilder); - this._axisGroup.add(axisBuilder.getGroup()); + this._axisGroup.add(axisBuilder.getGroup()); - each(selfBuilderAttrs, function (name) { - if (axisModel.get([name, 'show'])) { - axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel); - } - }, this); // THIS is a special case for bar racing chart. - // Update the axis label from the natural initial layout to - // sorted layout should has no animation. + each(selfBuilderAttrs, function (name) { + if (axisModel.get([name, 'show'])) { + axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel); + } + }, this); // THIS is a special case for bar racing chart. + // Update the axis label from the natural initial layout to + // sorted layout should has no animation. - var isInitialSortFromBarRacing = payload && payload.type === 'changeAxisOrder' && payload.isInitSort; + var isInitialSortFromBarRacing = payload && payload.type === 'changeAxisOrder' && payload.isInitSort; - if (!isInitialSortFromBarRacing) { - groupTransition(oldAxisGroup, this._axisGroup, axisModel); - } + if (!isInitialSortFromBarRacing) { + groupTransition(oldAxisGroup, this._axisGroup, axisModel); + } - _super.prototype.render.call(this, axisModel, ecModel, api, payload); - }; + _super.prototype.render.call(this, axisModel, ecModel, api, payload); + }; - CartesianAxisView.prototype.remove = function () { - rectCoordAxisHandleRemove(this); - }; + CartesianAxisView.prototype.remove = function () { + rectCoordAxisHandleRemove(this); + }; - CartesianAxisView.type = 'cartesianAxis'; - return CartesianAxisView; - }(AxisView); + CartesianAxisView.type = 'cartesianAxis'; + return CartesianAxisView; + }(AxisView); var axisElementBuilders = { - splitLine: function (axisView, axisGroup, axisModel, gridModel) { - var axis = axisModel.axis; + splitLine: function (axisView, axisGroup, axisModel, gridModel) { + var axis = axisModel.axis; - if (axis.scale.isBlank()) { - return; - } + if (axis.scale.isBlank()) { + return; + } - var splitLineModel = axisModel.getModel('splitLine'); - var lineStyleModel = splitLineModel.getModel('lineStyle'); - var lineColors = lineStyleModel.get('color'); - lineColors = isArray(lineColors) ? lineColors : [lineColors]; - var gridRect = gridModel.coordinateSystem.getRect(); - var isHorizontal = axis.isHorizontal(); - var lineCount = 0; - var ticksCoords = axis.getTicksCoords({ - tickModel: splitLineModel - }); - var p1 = []; - var p2 = []; - var lineStyle = lineStyleModel.getLineStyle(); - - for (var i = 0; i < ticksCoords.length; i++) { - var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord); - - if (isHorizontal) { - p1[0] = tickCoord; - p1[1] = gridRect.y; - p2[0] = tickCoord; - p2[1] = gridRect.y + gridRect.height; - } else { - p1[0] = gridRect.x; - p1[1] = tickCoord; - p2[0] = gridRect.x + gridRect.width; - p2[1] = tickCoord; - } - - var colorIndex = lineCount++ % lineColors.length; - var tickValue = ticksCoords[i].tickValue; - axisGroup.add(new Line({ - anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null, - subPixelOptimize: true, - autoBatch: true, - shape: { - x1: p1[0], - y1: p1[1], - x2: p2[0], - y2: p2[1] - }, - style: defaults({ - stroke: lineColors[colorIndex] - }, lineStyle), - silent: true - })); - } - }, - minorSplitLine: function (axisView, axisGroup, axisModel, gridModel) { - var axis = axisModel.axis; - var minorSplitLineModel = axisModel.getModel('minorSplitLine'); - var lineStyleModel = minorSplitLineModel.getModel('lineStyle'); - var gridRect = gridModel.coordinateSystem.getRect(); - var isHorizontal = axis.isHorizontal(); - var minorTicksCoords = axis.getMinorTicksCoords(); + var splitLineModel = axisModel.getModel('splitLine'); + var lineStyleModel = splitLineModel.getModel('lineStyle'); + var lineColors = lineStyleModel.get('color'); + lineColors = isArray(lineColors) ? lineColors : [lineColors]; + var gridRect = gridModel.coordinateSystem.getRect(); + var isHorizontal = axis.isHorizontal(); + var lineCount = 0; + var ticksCoords = axis.getTicksCoords({ + tickModel: splitLineModel + }); + var p1 = []; + var p2 = []; + var lineStyle = lineStyleModel.getLineStyle(); - if (!minorTicksCoords.length) { - return; - } + for (var i = 0; i < ticksCoords.length; i++) { + var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord); + + if (isHorizontal) { + p1[0] = tickCoord; + p1[1] = gridRect.y; + p2[0] = tickCoord; + p2[1] = gridRect.y + gridRect.height; + } else { + p1[0] = gridRect.x; + p1[1] = tickCoord; + p2[0] = gridRect.x + gridRect.width; + p2[1] = tickCoord; + } + + var colorIndex = lineCount++ % lineColors.length; + var tickValue = ticksCoords[i].tickValue; + axisGroup.add(new Line({ + anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null, + subPixelOptimize: true, + autoBatch: true, + shape: { + x1: p1[0], + y1: p1[1], + x2: p2[0], + y2: p2[1] + }, + style: defaults({ + stroke: lineColors[colorIndex] + }, lineStyle), + silent: true + })); + } + }, + minorSplitLine: function (axisView, axisGroup, axisModel, gridModel) { + var axis = axisModel.axis; + var minorSplitLineModel = axisModel.getModel('minorSplitLine'); + var lineStyleModel = minorSplitLineModel.getModel('lineStyle'); + var gridRect = gridModel.coordinateSystem.getRect(); + var isHorizontal = axis.isHorizontal(); + var minorTicksCoords = axis.getMinorTicksCoords(); - var p1 = []; - var p2 = []; - var lineStyle = lineStyleModel.getLineStyle(); + if (!minorTicksCoords.length) { + return; + } - for (var i = 0; i < minorTicksCoords.length; i++) { - for (var k = 0; k < minorTicksCoords[i].length; k++) { - var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord); + var p1 = []; + var p2 = []; + var lineStyle = lineStyleModel.getLineStyle(); - if (isHorizontal) { - p1[0] = tickCoord; - p1[1] = gridRect.y; - p2[0] = tickCoord; - p2[1] = gridRect.y + gridRect.height; - } else { - p1[0] = gridRect.x; - p1[1] = tickCoord; - p2[0] = gridRect.x + gridRect.width; - p2[1] = tickCoord; - } + for (var i = 0; i < minorTicksCoords.length; i++) { + for (var k = 0; k < minorTicksCoords[i].length; k++) { + var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord); - axisGroup.add(new Line({ - anid: 'minor_line_' + minorTicksCoords[i][k].tickValue, - subPixelOptimize: true, - autoBatch: true, - shape: { - x1: p1[0], - y1: p1[1], - x2: p2[0], - y2: p2[1] - }, - style: lineStyle, - silent: true - })); - } - } - }, - splitArea: function (axisView, axisGroup, axisModel, gridModel) { - rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel); + if (isHorizontal) { + p1[0] = tickCoord; + p1[1] = gridRect.y; + p2[0] = tickCoord; + p2[1] = gridRect.y + gridRect.height; + } else { + p1[0] = gridRect.x; + p1[1] = tickCoord; + p2[0] = gridRect.x + gridRect.width; + p2[1] = tickCoord; + } + + axisGroup.add(new Line({ + anid: 'minor_line_' + minorTicksCoords[i][k].tickValue, + subPixelOptimize: true, + autoBatch: true, + shape: { + x1: p1[0], + y1: p1[1], + x2: p2[0], + y2: p2[1] + }, + style: lineStyle, + silent: true + })); + } } + }, + splitArea: function (axisView, axisGroup, axisModel, gridModel) { + rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel); + } }; var CartesianXAxisView = - /** @class */ - function (_super) { - __extends(CartesianXAxisView, _super); + /** @class */ + function (_super) { + __extends(CartesianXAxisView, _super); - function CartesianXAxisView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function CartesianXAxisView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = CartesianXAxisView.type; - return _this; - } + _this.type = CartesianXAxisView.type; + return _this; + } - CartesianXAxisView.type = 'xAxis'; - return CartesianXAxisView; - }(CartesianAxisView); + CartesianXAxisView.type = 'xAxis'; + return CartesianXAxisView; + }(CartesianAxisView); var CartesianYAxisView = - /** @class */ - function (_super) { - __extends(CartesianYAxisView, _super); + /** @class */ + function (_super) { + __extends(CartesianYAxisView, _super); - function CartesianYAxisView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function CartesianYAxisView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = CartesianXAxisView.type; - return _this; - } + _this.type = CartesianXAxisView.type; + return _this; + } - CartesianYAxisView.type = 'yAxis'; - return CartesianYAxisView; - }(CartesianAxisView); + CartesianYAxisView.type = 'yAxis'; + return CartesianYAxisView; + }(CartesianAxisView); var GridView = - /** @class */ - function (_super) { - __extends(GridView, _super); - - function GridView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = 'grid'; - return _this; - } - - GridView.prototype.render = function (gridModel, ecModel) { - this.group.removeAll(); - - if (gridModel.get('show')) { - this.group.add(new Rect({ - shape: gridModel.coordinateSystem.getRect(), - style: defaults({ - fill: gridModel.get('backgroundColor') - }, gridModel.getItemStyle()), - silent: true, - z2: -1 - })); - } - }; + /** @class */ + function (_super) { + __extends(GridView, _super); + + function GridView() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = 'grid'; + return _this; + } + + GridView.prototype.render = function (gridModel, ecModel) { + this.group.removeAll(); + + if (gridModel.get('show')) { + this.group.add(new Rect({ + shape: gridModel.coordinateSystem.getRect(), + style: defaults({ + fill: gridModel.get('backgroundColor') + }, gridModel.getItemStyle()), + silent: true, + z2: -1 + })); + } + }; - GridView.type = 'grid'; - return GridView; - }(ComponentView); + GridView.type = 'grid'; + return GridView; + }(ComponentView); var extraOption = { - // gridIndex: 0, - // gridId: '', - offset: 0 + // gridIndex: 0, + // gridId: '', + offset: 0 }; function install$5(registers) { - registers.registerComponentView(GridView); - registers.registerComponentModel(GridModel); - registers.registerCoordinateSystem('cartesian2d', Grid); - axisModelCreator(registers, 'x', CartesianAxisModel, extraOption); - axisModelCreator(registers, 'y', CartesianAxisModel, extraOption); - registers.registerComponentView(CartesianXAxisView); - registers.registerComponentView(CartesianYAxisView); - registers.registerPreprocessor(function (option) { - // Only create grid when need - if (option.xAxis && option.yAxis && !option.grid) { - option.grid = {}; - } - }); + registers.registerComponentView(GridView); + registers.registerComponentModel(GridModel); + registers.registerCoordinateSystem('cartesian2d', Grid); + axisModelCreator(registers, 'x', CartesianAxisModel, extraOption); + axisModelCreator(registers, 'y', CartesianAxisModel, extraOption); + registers.registerComponentView(CartesianXAxisView); + registers.registerComponentView(CartesianYAxisView); + registers.registerPreprocessor(function (option) { + // Only create grid when need + if (option.xAxis && option.yAxis && !option.grid) { + option.grid = {}; + } + }); } function install$6(registers) { - // In case developer forget to include grid component - use(install$5); - registers.registerSeriesModel(ScatterSeriesModel); - registers.registerChartView(ScatterView); - registers.registerLayout(pointsLayout('scatter')); + // In case developer forget to include grid component + use(install$5); + registers.registerSeriesModel(ScatterSeriesModel); + registers.registerChartView(ScatterView); + registers.registerLayout(pointsLayout('scatter')); } function radarLayout(ecModel) { - ecModel.eachSeriesByType('radar', function (seriesModel) { - var data = seriesModel.getData(); - var points = []; - var coordSys = seriesModel.coordinateSystem; + ecModel.eachSeriesByType('radar', function (seriesModel) { + var data = seriesModel.getData(); + var points = []; + var coordSys = seriesModel.coordinateSystem; - if (!coordSys) { - return; - } + if (!coordSys) { + return; + } - var axes = coordSys.getIndicatorAxes(); - each(axes, function (axis, axisIndex) { - data.each(data.mapDimension(axes[axisIndex].dim), function (val, dataIndex) { - points[dataIndex] = points[dataIndex] || []; - var point = coordSys.dataToPoint(val, axisIndex); - points[dataIndex][axisIndex] = isValidPoint(point) ? point : getValueMissingPoint(coordSys); - }); - }); // Close polygon - - data.each(function (idx) { - // TODO - // Is it appropriate to connect to the next data when some data is missing? - // Or, should trade it like `connectNull` in line chart? - var firstPoint = find(points[idx], function (point) { - return isValidPoint(point); - }) || getValueMissingPoint(coordSys); // Copy the first actual point to the end of the array - - points[idx].push(firstPoint.slice()); - data.setItemLayout(idx, points[idx]); - }); + var axes = coordSys.getIndicatorAxes(); + each(axes, function (axis, axisIndex) { + data.each(data.mapDimension(axes[axisIndex].dim), function (val, dataIndex) { + points[dataIndex] = points[dataIndex] || []; + var point = coordSys.dataToPoint(val, axisIndex); + points[dataIndex][axisIndex] = isValidPoint(point) ? point : getValueMissingPoint(coordSys); + }); + }); // Close polygon + + data.each(function (idx) { + // TODO + // Is it appropriate to connect to the next data when some data is missing? + // Or, should trade it like `connectNull` in line chart? + var firstPoint = find(points[idx], function (point) { + return isValidPoint(point); + }) || getValueMissingPoint(coordSys); // Copy the first actual point to the end of the array + + points[idx].push(firstPoint.slice()); + data.setItemLayout(idx, points[idx]); }); + }); } function isValidPoint(point) { - return !isNaN(point[0]) && !isNaN(point[1]); + return !isNaN(point[0]) && !isNaN(point[1]); } function getValueMissingPoint(coordSys) { - // It is error-prone to input [NaN, NaN] into polygon, polygon. - // (probably cause problem when refreshing or animating) - return [coordSys.cx, coordSys.cy]; + // It is error-prone to input [NaN, NaN] into polygon, polygon. + // (probably cause problem when refreshing or animating) + return [coordSys.cx, coordSys.cy]; } function radarBackwardCompat(option) { - var polarOptArr = option.polar; + var polarOptArr = option.polar; + + if (polarOptArr) { + if (!isArray(polarOptArr)) { + polarOptArr = [polarOptArr]; + } - if (polarOptArr) { - if (!isArray(polarOptArr)) { - polarOptArr = [polarOptArr]; + var polarNotRadar_1 = []; + each(polarOptArr, function (polarOpt, idx) { + if (polarOpt.indicator) { + if (polarOpt.type && !polarOpt.shape) { + polarOpt.shape = polarOpt.type; } - var polarNotRadar_1 = []; - each(polarOptArr, function (polarOpt, idx) { - if (polarOpt.indicator) { - if (polarOpt.type && !polarOpt.shape) { - polarOpt.shape = polarOpt.type; - } + option.radar = option.radar || []; - option.radar = option.radar || []; + if (!isArray(option.radar)) { + option.radar = [option.radar]; + } - if (!isArray(option.radar)) { - option.radar = [option.radar]; - } + option.radar.push(polarOpt); + } else { + polarNotRadar_1.push(polarOpt); + } + }); + option.polar = polarNotRadar_1; + } - option.radar.push(polarOpt); - } else { - polarNotRadar_1.push(polarOpt); - } - }); - option.polar = polarNotRadar_1; + each(option.series, function (seriesOpt) { + if (seriesOpt && seriesOpt.type === 'radar' && seriesOpt.polarIndex) { + seriesOpt.radarIndex = seriesOpt.polarIndex; } - - each(option.series, function (seriesOpt) { - if (seriesOpt && seriesOpt.type === 'radar' && seriesOpt.polarIndex) { - seriesOpt.radarIndex = seriesOpt.polarIndex; - } - }); + }); } var RadarView = - /** @class */ - function (_super) { - __extends(RadarView, _super); - - function RadarView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = RadarView.type; - return _this; - } + /** @class */ + function (_super) { + __extends(RadarView, _super); - RadarView.prototype.render = function (seriesModel, ecModel, api) { - var polar = seriesModel.coordinateSystem; - var group = this.group; - var data = seriesModel.getData(); - var oldData = this._data; + function RadarView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - function createSymbol$1(data, idx) { - var symbolType = data.getItemVisual(idx, 'symbol') || 'circle'; + _this.type = RadarView.type; + return _this; + } - if (symbolType === 'none') { - return; - } + RadarView.prototype.render = function (seriesModel, ecModel, api) { + var polar = seriesModel.coordinateSystem; + var group = this.group; + var data = seriesModel.getData(); + var oldData = this._data; - var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize')); - var symbolPath = createSymbol(symbolType, -1, -1, 2, 2); - var symbolRotate = data.getItemVisual(idx, 'symbolRotate') || 0; - symbolPath.attr({ - style: { - strokeNoScale: true - }, - z2: 100, - scaleX: symbolSize[0] / 2, - scaleY: symbolSize[1] / 2, - rotation: symbolRotate * Math.PI / 180 || 0 - }); - return symbolPath; - } + function createSymbol$1(data, idx) { + var symbolType = data.getItemVisual(idx, 'symbol') || 'circle'; - function updateSymbols(oldPoints, newPoints, symbolGroup, data, idx, isInit) { - // Simply rerender all - symbolGroup.removeAll(); + if (symbolType === 'none') { + return; + } - for (var i = 0; i < newPoints.length - 1; i++) { - var symbolPath = createSymbol$1(data, idx); + var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize')); + var symbolPath = createSymbol(symbolType, -1, -1, 2, 2); + var symbolRotate = data.getItemVisual(idx, 'symbolRotate') || 0; + symbolPath.attr({ + style: { + strokeNoScale: true + }, + z2: 100, + scaleX: symbolSize[0] / 2, + scaleY: symbolSize[1] / 2, + rotation: symbolRotate * Math.PI / 180 || 0 + }); + return symbolPath; + } - if (symbolPath) { - symbolPath.__dimIdx = i; + function updateSymbols(oldPoints, newPoints, symbolGroup, data, idx, isInit) { + // Simply rerender all + symbolGroup.removeAll(); - if (oldPoints[i]) { - symbolPath.setPosition(oldPoints[i]); - graphic[isInit ? 'initProps' : 'updateProps'](symbolPath, { - x: newPoints[i][0], - y: newPoints[i][1] - }, seriesModel, idx); - } else { - symbolPath.setPosition(newPoints[i]); - } + for (var i = 0; i < newPoints.length - 1; i++) { + var symbolPath = createSymbol$1(data, idx); - symbolGroup.add(symbolPath); - } - } - } + if (symbolPath) { + symbolPath.__dimIdx = i; - function getInitialPoints(points) { - return map(points, function (pt) { - return [polar.cx, polar.cy]; - }); - } + if (oldPoints[i]) { + symbolPath.setPosition(oldPoints[i]); + graphic[isInit ? 'initProps' : 'updateProps'](symbolPath, { + x: newPoints[i][0], + y: newPoints[i][1] + }, seriesModel, idx); + } else { + symbolPath.setPosition(newPoints[i]); + } - data.diff(oldData).add(function (idx) { - var points = data.getItemLayout(idx); + symbolGroup.add(symbolPath); + } + } + } - if (!points) { - return; - } + function getInitialPoints(points) { + return map(points, function (pt) { + return [polar.cx, polar.cy]; + }); + } - var polygon = new Polygon(); - var polyline = new Polyline(); - var target = { - shape: { - points: points - } - }; - polygon.shape.points = getInitialPoints(points); - polyline.shape.points = getInitialPoints(points); - initProps(polygon, target, seriesModel, idx); - initProps(polyline, target, seriesModel, idx); - var itemGroup = new Group(); - var symbolGroup = new Group(); - itemGroup.add(polyline); - itemGroup.add(polygon); - itemGroup.add(symbolGroup); - updateSymbols(polyline.shape.points, points, symbolGroup, data, idx, true); - data.setItemGraphicEl(idx, itemGroup); - }).update(function (newIdx, oldIdx) { - var itemGroup = oldData.getItemGraphicEl(oldIdx); - var polyline = itemGroup.childAt(0); - var polygon = itemGroup.childAt(1); - var symbolGroup = itemGroup.childAt(2); - var target = { - shape: { - points: data.getItemLayout(newIdx) - } - }; + data.diff(oldData).add(function (idx) { + var points = data.getItemLayout(idx); - if (!target.shape.points) { - return; - } + if (!points) { + return; + } - updateSymbols(polyline.shape.points, target.shape.points, symbolGroup, data, newIdx, false); - saveOldStyle(polygon); - saveOldStyle(polyline); - updateProps(polyline, target, seriesModel); - updateProps(polygon, target, seriesModel); - data.setItemGraphicEl(newIdx, itemGroup); - }).remove(function (idx) { - group.remove(oldData.getItemGraphicEl(idx)); - }).execute(); - data.eachItemGraphicEl(function (itemGroup, idx) { - var itemModel = data.getItemModel(idx); - var polyline = itemGroup.childAt(0); - var polygon = itemGroup.childAt(1); - var symbolGroup = itemGroup.childAt(2); // Radar uses the visual encoded from itemStyle. - - var itemStyle = data.getItemVisual(idx, 'style'); - var color = itemStyle.fill; - group.add(itemGroup); - polyline.useStyle(defaults(itemModel.getModel('lineStyle').getLineStyle(), { - fill: 'none', - stroke: color - })); - setStatesStylesFromModel(polyline, itemModel, 'lineStyle'); - setStatesStylesFromModel(polygon, itemModel, 'areaStyle'); - var areaStyleModel = itemModel.getModel('areaStyle'); - var polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty(); - polygon.ignore = polygonIgnore; - each(['emphasis', 'select', 'blur'], function (stateName) { - var stateModel = itemModel.getModel([stateName, 'areaStyle']); - var stateIgnore = stateModel.isEmpty() && stateModel.parentModel.isEmpty(); // Won't be ignore if normal state is not ignore. - - polygon.ensureState(stateName).ignore = stateIgnore && polygonIgnore; - }); - polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), { - fill: color, - opacity: 0.7, - decal: itemStyle.decal - })); - var emphasisModel = itemModel.getModel('emphasis'); - var itemHoverStyle = emphasisModel.getModel('itemStyle').getItemStyle(); - symbolGroup.eachChild(function (symbolPath) { - if (symbolPath instanceof ZRImage) { - var pathStyle = symbolPath.style; - symbolPath.useStyle(extend({ - // TODO other properties like x, y ? - image: pathStyle.image, - x: pathStyle.x, - y: pathStyle.y, - width: pathStyle.width, - height: pathStyle.height - }, itemStyle)); - } else { - symbolPath.useStyle(itemStyle); - symbolPath.setColor(color); - symbolPath.style.strokeNoScale = true; - } + var polygon = new Polygon(); + var polyline = new Polyline(); + var target = { + shape: { + points: points + } + }; + polygon.shape.points = getInitialPoints(points); + polyline.shape.points = getInitialPoints(points); + initProps(polygon, target, seriesModel, idx); + initProps(polyline, target, seriesModel, idx); + var itemGroup = new Group(); + var symbolGroup = new Group(); + itemGroup.add(polyline); + itemGroup.add(polygon); + itemGroup.add(symbolGroup); + updateSymbols(polyline.shape.points, points, symbolGroup, data, idx, true); + data.setItemGraphicEl(idx, itemGroup); + }).update(function (newIdx, oldIdx) { + var itemGroup = oldData.getItemGraphicEl(oldIdx); + var polyline = itemGroup.childAt(0); + var polygon = itemGroup.childAt(1); + var symbolGroup = itemGroup.childAt(2); + var target = { + shape: { + points: data.getItemLayout(newIdx) + } + }; - var pathEmphasisState = symbolPath.ensureState('emphasis'); - pathEmphasisState.style = clone(itemHoverStyle); - var defaultText = data.getStore().get(data.getDimensionIndex(symbolPath.__dimIdx), idx); - (defaultText == null || isNaN(defaultText)) && (defaultText = ''); - setLabelStyle(symbolPath, getLabelStatesModels(itemModel), { - labelFetcher: data.hostModel, - labelDataIndex: idx, - labelDimIndex: symbolPath.__dimIdx, - defaultText: defaultText, - inheritColor: color, - defaultOpacity: itemStyle.opacity - }); - }); - toggleHoverEmphasis(itemGroup, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - }); - this._data = data; - }; + if (!target.shape.points) { + return; + } + + updateSymbols(polyline.shape.points, target.shape.points, symbolGroup, data, newIdx, false); + saveOldStyle(polygon); + saveOldStyle(polyline); + updateProps(polyline, target, seriesModel); + updateProps(polygon, target, seriesModel); + data.setItemGraphicEl(newIdx, itemGroup); + }).remove(function (idx) { + group.remove(oldData.getItemGraphicEl(idx)); + }).execute(); + data.eachItemGraphicEl(function (itemGroup, idx) { + var itemModel = data.getItemModel(idx); + var polyline = itemGroup.childAt(0); + var polygon = itemGroup.childAt(1); + var symbolGroup = itemGroup.childAt(2); // Radar uses the visual encoded from itemStyle. + + var itemStyle = data.getItemVisual(idx, 'style'); + var color = itemStyle.fill; + group.add(itemGroup); + polyline.useStyle(defaults(itemModel.getModel('lineStyle').getLineStyle(), { + fill: 'none', + stroke: color + })); + setStatesStylesFromModel(polyline, itemModel, 'lineStyle'); + setStatesStylesFromModel(polygon, itemModel, 'areaStyle'); + var areaStyleModel = itemModel.getModel('areaStyle'); + var polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty(); + polygon.ignore = polygonIgnore; + each(['emphasis', 'select', 'blur'], function (stateName) { + var stateModel = itemModel.getModel([stateName, 'areaStyle']); + var stateIgnore = stateModel.isEmpty() && stateModel.parentModel.isEmpty(); // Won't be ignore if normal state is not ignore. + + polygon.ensureState(stateName).ignore = stateIgnore && polygonIgnore; + }); + polygon.useStyle(defaults(areaStyleModel.getAreaStyle(), { + fill: color, + opacity: 0.7, + decal: itemStyle.decal + })); + var emphasisModel = itemModel.getModel('emphasis'); + var itemHoverStyle = emphasisModel.getModel('itemStyle').getItemStyle(); + symbolGroup.eachChild(function (symbolPath) { + if (symbolPath instanceof ZRImage) { + var pathStyle = symbolPath.style; + symbolPath.useStyle(extend({ + // TODO other properties like x, y ? + image: pathStyle.image, + x: pathStyle.x, + y: pathStyle.y, + width: pathStyle.width, + height: pathStyle.height + }, itemStyle)); + } else { + symbolPath.useStyle(itemStyle); + symbolPath.setColor(color); + symbolPath.style.strokeNoScale = true; + } + + var pathEmphasisState = symbolPath.ensureState('emphasis'); + pathEmphasisState.style = clone(itemHoverStyle); + var defaultText = data.getStore().get(data.getDimensionIndex(symbolPath.__dimIdx), idx); + (defaultText == null || isNaN(defaultText)) && (defaultText = ''); + setLabelStyle(symbolPath, getLabelStatesModels(itemModel), { + labelFetcher: data.hostModel, + labelDataIndex: idx, + labelDimIndex: symbolPath.__dimIdx, + defaultText: defaultText, + inheritColor: color, + defaultOpacity: itemStyle.opacity + }); + }); + toggleHoverEmphasis(itemGroup, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); + }); + this._data = data; + }; - RadarView.prototype.remove = function () { - this.group.removeAll(); - this._data = null; - }; + RadarView.prototype.remove = function () { + this.group.removeAll(); + this._data = null; + }; - RadarView.type = 'radar'; - return RadarView; - }(ChartView); + RadarView.type = 'radar'; + return RadarView; + }(ChartView); var RadarSeriesModel = - /** @class */ - function (_super) { - __extends(RadarSeriesModel, _super); + /** @class */ + function (_super) { + __extends(RadarSeriesModel, _super); - function RadarSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function RadarSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = RadarSeriesModel.type; - _this.hasSymbolVisual = true; - return _this; - } // Overwrite + _this.type = RadarSeriesModel.type; + _this.hasSymbolVisual = true; + return _this; + } // Overwrite - RadarSeriesModel.prototype.init = function (option) { - _super.prototype.init.apply(this, arguments); // Enable legend selection for each data item - // Use a function instead of direct access because data reference may changed + RadarSeriesModel.prototype.init = function (option) { + _super.prototype.init.apply(this, arguments); // Enable legend selection for each data item + // Use a function instead of direct access because data reference may changed - this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this)); - }; + this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this)); + }; - RadarSeriesModel.prototype.getInitialData = function (option, ecModel) { - return createSeriesDataSimply(this, { - generateCoord: 'indicator_', - generateCoordCount: Infinity - }); - }; + RadarSeriesModel.prototype.getInitialData = function (option, ecModel) { + return createSeriesDataSimply(this, { + generateCoord: 'indicator_', + generateCoordCount: Infinity + }); + }; + + RadarSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { + var data = this.getData(); + var coordSys = this.coordinateSystem; + var indicatorAxes = coordSys.getIndicatorAxes(); + var name = this.getData().getName(dataIndex); + var nameToDisplay = name === '' ? this.name : name; + var markerColor = retrieveVisualColorForTooltipMarker(this, dataIndex); + return createTooltipMarkup('section', { + header: nameToDisplay, + sortBlocks: true, + blocks: map(indicatorAxes, function (axis) { + var val = data.get(data.mapDimension(axis.dim), dataIndex); + return createTooltipMarkup('nameValue', { + markerType: 'subItem', + markerColor: markerColor, + name: axis.name, + value: val, + sortParam: val + }); + }) + }); + }; - RadarSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - var data = this.getData(); - var coordSys = this.coordinateSystem; - var indicatorAxes = coordSys.getIndicatorAxes(); - var name = this.getData().getName(dataIndex); - var nameToDisplay = name === '' ? this.name : name; - var markerColor = retrieveVisualColorForTooltipMarker(this, dataIndex); - return createTooltipMarkup('section', { - header: nameToDisplay, - sortBlocks: true, - blocks: map(indicatorAxes, function (axis) { - var val = data.get(data.mapDimension(axis.dim), dataIndex); - return createTooltipMarkup('nameValue', { - markerType: 'subItem', - markerColor: markerColor, - name: axis.name, - value: val, - sortParam: val - }); - }) - }); - }; + RadarSeriesModel.prototype.getTooltipPosition = function (dataIndex) { + if (dataIndex != null) { + var data_1 = this.getData(); + var coordSys = this.coordinateSystem; + var values = data_1.getValues(map(coordSys.dimensions, function (dim) { + return data_1.mapDimension(dim); + }), dataIndex); - RadarSeriesModel.prototype.getTooltipPosition = function (dataIndex) { - if (dataIndex != null) { - var data_1 = this.getData(); - var coordSys = this.coordinateSystem; - var values = data_1.getValues(map(coordSys.dimensions, function (dim) { - return data_1.mapDimension(dim); - }), dataIndex); - - for (var i = 0, len = values.length; i < len; i++) { - if (!isNaN(values[i])) { - var indicatorAxes = coordSys.getIndicatorAxes(); - return coordSys.coordToPoint(indicatorAxes[i].dataToCoord(values[i]), i); - } - } - } - }; + for (var i = 0, len = values.length; i < len; i++) { + if (!isNaN(values[i])) { + var indicatorAxes = coordSys.getIndicatorAxes(); + return coordSys.coordToPoint(indicatorAxes[i].dataToCoord(values[i]), i); + } + } + } + }; - RadarSeriesModel.type = 'series.radar'; - RadarSeriesModel.dependencies = ['radar']; - RadarSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - colorBy: 'data', - coordinateSystem: 'radar', - legendHoverLink: true, - radarIndex: 0, - lineStyle: { - width: 2, - type: 'solid', - join: 'round' - }, - label: { - position: 'top' - }, - // areaStyle: { - // }, - // itemStyle: {} - symbolSize: 8 // symbolRotate: null + RadarSeriesModel.type = 'series.radar'; + RadarSeriesModel.dependencies = ['radar']; + RadarSeriesModel.defaultOption = { + // zlevel: 0, + z: 2, + colorBy: 'data', + coordinateSystem: 'radar', + legendHoverLink: true, + radarIndex: 0, + lineStyle: { + width: 2, + type: 'solid', + join: 'round' + }, + label: { + position: 'top' + }, + // areaStyle: { + // }, + // itemStyle: {} + symbolSize: 8 // symbolRotate: null - }; - return RadarSeriesModel; - }(SeriesModel); + }; + return RadarSeriesModel; + }(SeriesModel); var valueAxisDefault = axisDefault.value; function defaultsShow(opt, show) { - return defaults({ - show: show - }, opt); + return defaults({ + show: show + }, opt); } var RadarModel = - /** @class */ - function (_super) { - __extends(RadarModel, _super); - - function RadarModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + /** @class */ + function (_super) { + __extends(RadarModel, _super); + + function RadarModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = RadarModel.type; + return _this; + } + + RadarModel.prototype.optionUpdated = function () { + var boundaryGap = this.get('boundaryGap'); + var splitNumber = this.get('splitNumber'); + var scale = this.get('scale'); + var axisLine = this.get('axisLine'); + var axisTick = this.get('axisTick'); // let axisType = this.get('axisType'); + + var axisLabel = this.get('axisLabel'); + var nameTextStyle = this.get('axisName'); + var showName = this.get(['axisName', 'show']); + var nameFormatter = this.get(['axisName', 'formatter']); + var nameGap = this.get('axisNameGap'); + var triggerEvent = this.get('triggerEvent'); + var indicatorModels = map(this.get('indicator') || [], function (indicatorOpt) { + // PENDING + if (indicatorOpt.max != null && indicatorOpt.max > 0 && !indicatorOpt.min) { + indicatorOpt.min = 0; + } else if (indicatorOpt.min != null && indicatorOpt.min < 0 && !indicatorOpt.max) { + indicatorOpt.max = 0; + } + + var iNameTextStyle = nameTextStyle; + + if (indicatorOpt.color != null) { + iNameTextStyle = defaults({ + color: indicatorOpt.color + }, nameTextStyle); + } // Use same configuration + + + var innerIndicatorOpt = merge(clone(indicatorOpt), { + boundaryGap: boundaryGap, + splitNumber: splitNumber, + scale: scale, + axisLine: axisLine, + axisTick: axisTick, + // axisType: axisType, + axisLabel: axisLabel, + // Compatible with 2 and use text + name: indicatorOpt.text, + showName: showName, + nameLocation: 'end', + nameGap: nameGap, + // min: 0, + nameTextStyle: iNameTextStyle, + triggerEvent: triggerEvent + }, false); + + if (!showName) { + innerIndicatorOpt.name = ''; + } + + if (isString(nameFormatter)) { + var indName = innerIndicatorOpt.name; + innerIndicatorOpt.name = nameFormatter.replace('{value}', indName != null ? indName : ''); + } else if (isFunction(nameFormatter)) { + innerIndicatorOpt.name = nameFormatter(innerIndicatorOpt.name, innerIndicatorOpt); + } + + var model = new Model(innerIndicatorOpt, null, this.ecModel); + mixin(model, AxisModelCommonMixin.prototype); // For triggerEvent. + + model.mainType = 'radar'; + model.componentIndex = this.componentIndex; + return model; + }, this); + this._indicatorModels = indicatorModels; + }; - _this.type = RadarModel.type; - return _this; - } + RadarModel.prototype.getIndicatorModels = function () { + return this._indicatorModels; + }; - RadarModel.prototype.optionUpdated = function () { - var boundaryGap = this.get('boundaryGap'); - var splitNumber = this.get('splitNumber'); - var scale = this.get('scale'); - var axisLine = this.get('axisLine'); - var axisTick = this.get('axisTick'); // let axisType = this.get('axisType'); - - var axisLabel = this.get('axisLabel'); - var nameTextStyle = this.get('axisName'); - var showName = this.get(['axisName', 'show']); - var nameFormatter = this.get(['axisName', 'formatter']); - var nameGap = this.get('axisNameGap'); - var triggerEvent = this.get('triggerEvent'); - var indicatorModels = map(this.get('indicator') || [], function (indicatorOpt) { - // PENDING - if (indicatorOpt.max != null && indicatorOpt.max > 0 && !indicatorOpt.min) { - indicatorOpt.min = 0; - } else if (indicatorOpt.min != null && indicatorOpt.min < 0 && !indicatorOpt.max) { - indicatorOpt.max = 0; - } + RadarModel.type = 'radar'; + RadarModel.defaultOption = { + // zlevel: 0, + z: 0, + center: ['50%', '50%'], + radius: '75%', + startAngle: 90, + axisName: { + show: true // formatter: null + // textStyle: {} - var iNameTextStyle = nameTextStyle; - - if (indicatorOpt.color != null) { - iNameTextStyle = defaults({ - color: indicatorOpt.color - }, nameTextStyle); - } // Use same configuration - - - var innerIndicatorOpt = merge(clone(indicatorOpt), { - boundaryGap: boundaryGap, - splitNumber: splitNumber, - scale: scale, - axisLine: axisLine, - axisTick: axisTick, - // axisType: axisType, - axisLabel: axisLabel, - // Compatible with 2 and use text - name: indicatorOpt.text, - showName: showName, - nameLocation: 'end', - nameGap: nameGap, - // min: 0, - nameTextStyle: iNameTextStyle, - triggerEvent: triggerEvent - }, false); - - if (!showName) { - innerIndicatorOpt.name = ''; - } + }, + boundaryGap: [0, 0], + splitNumber: 5, + axisNameGap: 15, + scale: false, + // Polygon or circle + shape: 'polygon', + axisLine: merge({ + lineStyle: { + color: '#bbb' + } + }, valueAxisDefault.axisLine), + axisLabel: defaultsShow(valueAxisDefault.axisLabel, false), + axisTick: defaultsShow(valueAxisDefault.axisTick, false), + // axisType: 'value', + splitLine: defaultsShow(valueAxisDefault.splitLine, true), + splitArea: defaultsShow(valueAxisDefault.splitArea, true), + // {text, min, max} + indicator: [] + }; + return RadarModel; + }(ComponentModel); - if (isString(nameFormatter)) { - var indName = innerIndicatorOpt.name; - innerIndicatorOpt.name = nameFormatter.replace('{value}', indName != null ? indName : ''); - } else if (isFunction(nameFormatter)) { - innerIndicatorOpt.name = nameFormatter(innerIndicatorOpt.name, innerIndicatorOpt); - } + var axisBuilderAttrs$1 = ['axisLine', 'axisTickLabel', 'axisName']; - var model = new Model(innerIndicatorOpt, null, this.ecModel); - mixin(model, AxisModelCommonMixin.prototype); // For triggerEvent. + var RadarView$1 = + /** @class */ + function (_super) { + __extends(RadarView, _super); - model.mainType = 'radar'; - model.componentIndex = this.componentIndex; - return model; - }, this); - this._indicatorModels = indicatorModels; - }; + function RadarView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - RadarModel.prototype.getIndicatorModels = function () { - return this._indicatorModels; - }; + _this.type = RadarView.type; + return _this; + } - RadarModel.type = 'radar'; - RadarModel.defaultOption = { - // zlevel: 0, - z: 0, - center: ['50%', '50%'], - radius: '75%', - startAngle: 90, - axisName: { - show: true // formatter: null - // textStyle: {} + RadarView.prototype.render = function (radarModel, ecModel, api) { + var group = this.group; + group.removeAll(); - }, - boundaryGap: [0, 0], - splitNumber: 5, - axisNameGap: 15, - scale: false, - // Polygon or circle - shape: 'polygon', - axisLine: merge({ - lineStyle: { - color: '#bbb' - } - }, valueAxisDefault.axisLine), - axisLabel: defaultsShow(valueAxisDefault.axisLabel, false), - axisTick: defaultsShow(valueAxisDefault.axisTick, false), - // axisType: 'value', - splitLine: defaultsShow(valueAxisDefault.splitLine, true), - splitArea: defaultsShow(valueAxisDefault.splitArea, true), - // {text, min, max} - indicator: [] - }; - return RadarModel; - }(ComponentModel); + this._buildAxes(radarModel); - var axisBuilderAttrs$1 = ['axisLine', 'axisTickLabel', 'axisName']; + this._buildSplitLineAndArea(radarModel); + }; - var RadarView$1 = - /** @class */ - function (_super) { - __extends(RadarView, _super); + RadarView.prototype._buildAxes = function (radarModel) { + var radar = radarModel.coordinateSystem; + var indicatorAxes = radar.getIndicatorAxes(); + var axisBuilders = map(indicatorAxes, function (indicatorAxis) { + var axisName = indicatorAxis.model.get('showName') ? indicatorAxis.name : ''; // hide name - function RadarView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + var axisBuilder = new AxisBuilder(indicatorAxis.model, { + axisName: axisName, + position: [radar.cx, radar.cy], + rotation: indicatorAxis.angle, + labelDirection: -1, + tickDirection: -1, + nameDirection: 1 + }); + return axisBuilder; + }); + each(axisBuilders, function (axisBuilder) { + each(axisBuilderAttrs$1, axisBuilder.add, axisBuilder); + this.group.add(axisBuilder.getGroup()); + }, this); + }; - _this.type = RadarView.type; - return _this; - } + RadarView.prototype._buildSplitLineAndArea = function (radarModel) { + var radar = radarModel.coordinateSystem; + var indicatorAxes = radar.getIndicatorAxes(); - RadarView.prototype.render = function (radarModel, ecModel, api) { - var group = this.group; - group.removeAll(); + if (!indicatorAxes.length) { + return; + } - this._buildAxes(radarModel); - - this._buildSplitLineAndArea(radarModel); - }; - - RadarView.prototype._buildAxes = function (radarModel) { - var radar = radarModel.coordinateSystem; - var indicatorAxes = radar.getIndicatorAxes(); - var axisBuilders = map(indicatorAxes, function (indicatorAxis) { - var axisName = indicatorAxis.model.get('showName') ? indicatorAxis.name : ''; // hide name - - var axisBuilder = new AxisBuilder(indicatorAxis.model, { - axisName: axisName, - position: [radar.cx, radar.cy], - rotation: indicatorAxis.angle, - labelDirection: -1, - tickDirection: -1, - nameDirection: 1 - }); - return axisBuilder; - }); - each(axisBuilders, function (axisBuilder) { - each(axisBuilderAttrs$1, axisBuilder.add, axisBuilder); - this.group.add(axisBuilder.getGroup()); - }, this); - }; - - RadarView.prototype._buildSplitLineAndArea = function (radarModel) { - var radar = radarModel.coordinateSystem; - var indicatorAxes = radar.getIndicatorAxes(); - - if (!indicatorAxes.length) { - return; + var shape = radarModel.get('shape'); + var splitLineModel = radarModel.getModel('splitLine'); + var splitAreaModel = radarModel.getModel('splitArea'); + var lineStyleModel = splitLineModel.getModel('lineStyle'); + var areaStyleModel = splitAreaModel.getModel('areaStyle'); + var showSplitLine = splitLineModel.get('show'); + var showSplitArea = splitAreaModel.get('show'); + var splitLineColors = lineStyleModel.get('color'); + var splitAreaColors = areaStyleModel.get('color'); + var splitLineColorsArr = isArray(splitLineColors) ? splitLineColors : [splitLineColors]; + var splitAreaColorsArr = isArray(splitAreaColors) ? splitAreaColors : [splitAreaColors]; + var splitLines = []; + var splitAreas = []; + + function getColorIndex(areaOrLine, areaOrLineColorList, idx) { + var colorIndex = idx % areaOrLineColorList.length; + areaOrLine[colorIndex] = areaOrLine[colorIndex] || []; + return colorIndex; + } + + if (shape === 'circle') { + var ticksRadius = indicatorAxes[0].getTicksCoords(); + var cx = radar.cx; + var cy = radar.cy; + + for (var i = 0; i < ticksRadius.length; i++) { + if (showSplitLine) { + var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i); + splitLines[colorIndex].push(new Circle({ + shape: { + cx: cx, + cy: cy, + r: ticksRadius[i].coord } + })); + } - var shape = radarModel.get('shape'); - var splitLineModel = radarModel.getModel('splitLine'); - var splitAreaModel = radarModel.getModel('splitArea'); - var lineStyleModel = splitLineModel.getModel('lineStyle'); - var areaStyleModel = splitAreaModel.getModel('areaStyle'); - var showSplitLine = splitLineModel.get('show'); - var showSplitArea = splitAreaModel.get('show'); - var splitLineColors = lineStyleModel.get('color'); - var splitAreaColors = areaStyleModel.get('color'); - var splitLineColorsArr = isArray(splitLineColors) ? splitLineColors : [splitLineColors]; - var splitAreaColorsArr = isArray(splitAreaColors) ? splitAreaColors : [splitAreaColors]; - var splitLines = []; - var splitAreas = []; - - function getColorIndex(areaOrLine, areaOrLineColorList, idx) { - var colorIndex = idx % areaOrLineColorList.length; - areaOrLine[colorIndex] = areaOrLine[colorIndex] || []; - return colorIndex; - } - - if (shape === 'circle') { - var ticksRadius = indicatorAxes[0].getTicksCoords(); - var cx = radar.cx; - var cy = radar.cy; - - for (var i = 0; i < ticksRadius.length; i++) { - if (showSplitLine) { - var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i); - splitLines[colorIndex].push(new Circle({ - shape: { - cx: cx, - cy: cy, - r: ticksRadius[i].coord - } - })); - } - - if (showSplitArea && i < ticksRadius.length - 1) { - var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i); - splitAreas[colorIndex].push(new Ring({ - shape: { - cx: cx, - cy: cy, - r0: ticksRadius[i].coord, - r: ticksRadius[i + 1].coord - } - })); - } - } - } // Polyyon - else { - var realSplitNumber_1; - var axesTicksPoints = map(indicatorAxes, function (indicatorAxis, idx) { - var ticksCoords = indicatorAxis.getTicksCoords(); - realSplitNumber_1 = realSplitNumber_1 == null ? ticksCoords.length - 1 : Math.min(ticksCoords.length - 1, realSplitNumber_1); - return map(ticksCoords, function (tickCoord) { - return radar.coordToPoint(tickCoord.coord, idx); - }); - }); - var prevPoints = []; - - for (var i = 0; i <= realSplitNumber_1; i++) { - var points = []; + if (showSplitArea && i < ticksRadius.length - 1) { + var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i); + splitAreas[colorIndex].push(new Ring({ + shape: { + cx: cx, + cy: cy, + r0: ticksRadius[i].coord, + r: ticksRadius[i + 1].coord + } + })); + } + } + } // Polyyon + else { + var realSplitNumber_1; + var axesTicksPoints = map(indicatorAxes, function (indicatorAxis, idx) { + var ticksCoords = indicatorAxis.getTicksCoords(); + realSplitNumber_1 = realSplitNumber_1 == null ? ticksCoords.length - 1 : Math.min(ticksCoords.length - 1, realSplitNumber_1); + return map(ticksCoords, function (tickCoord) { + return radar.coordToPoint(tickCoord.coord, idx); + }); + }); + var prevPoints = []; - for (var j = 0; j < indicatorAxes.length; j++) { - points.push(axesTicksPoints[j][i]); - } // Close + for (var i = 0; i <= realSplitNumber_1; i++) { + var points = []; + for (var j = 0; j < indicatorAxes.length; j++) { + points.push(axesTicksPoints[j][i]); + } // Close - if (points[0]) { - points.push(points[0].slice()); - } else { - if ("development" !== 'production') { - console.error('Can\'t draw value axis ' + i); - } - } - if (showSplitLine) { - var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i); - splitLines[colorIndex].push(new Polyline({ - shape: { - points: points - } - })); - } + if (points[0]) { + points.push(points[0].slice()); + } else { + if ("development" !== 'production') { + console.error('Can\'t draw value axis ' + i); + } + } - if (showSplitArea && prevPoints) { - var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i - 1); - splitAreas[colorIndex].push(new Polygon({ - shape: { - points: points.concat(prevPoints) - } - })); - } + if (showSplitLine) { + var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i); + splitLines[colorIndex].push(new Polyline({ + shape: { + points: points + } + })); + } + + if (showSplitArea && prevPoints) { + var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i - 1); + splitAreas[colorIndex].push(new Polygon({ + shape: { + points: points.concat(prevPoints) + } + })); + } - prevPoints = points.slice().reverse(); - } - } + prevPoints = points.slice().reverse(); + } + } - var lineStyle = lineStyleModel.getLineStyle(); - var areaStyle = areaStyleModel.getAreaStyle(); // Add splitArea before splitLine + var lineStyle = lineStyleModel.getLineStyle(); + var areaStyle = areaStyleModel.getAreaStyle(); // Add splitArea before splitLine - each(splitAreas, function (splitAreas, idx) { - this.group.add(mergePath$1(splitAreas, { - style: defaults({ - stroke: 'none', - fill: splitAreaColorsArr[idx % splitAreaColorsArr.length] - }, areaStyle), - silent: true - })); - }, this); - each(splitLines, function (splitLines, idx) { - this.group.add(mergePath$1(splitLines, { - style: defaults({ - fill: 'none', - stroke: splitLineColorsArr[idx % splitLineColorsArr.length] - }, lineStyle), - silent: true - })); - }, this); - }; + each(splitAreas, function (splitAreas, idx) { + this.group.add(mergePath$1(splitAreas, { + style: defaults({ + stroke: 'none', + fill: splitAreaColorsArr[idx % splitAreaColorsArr.length] + }, areaStyle), + silent: true + })); + }, this); + each(splitLines, function (splitLines, idx) { + this.group.add(mergePath$1(splitLines, { + style: defaults({ + fill: 'none', + stroke: splitLineColorsArr[idx % splitLineColorsArr.length] + }, lineStyle), + silent: true + })); + }, this); + }; - RadarView.type = 'radar'; - return RadarView; - }(ComponentView); + RadarView.type = 'radar'; + return RadarView; + }(ComponentView); var IndicatorAxis = - /** @class */ - function (_super) { - __extends(IndicatorAxis, _super); + /** @class */ + function (_super) { + __extends(IndicatorAxis, _super); - function IndicatorAxis(dim, scale, radiusExtent) { - var _this = _super.call(this, dim, scale, radiusExtent) || this; + function IndicatorAxis(dim, scale, radiusExtent) { + var _this = _super.call(this, dim, scale, radiusExtent) || this; - _this.type = 'value'; - _this.angle = 0; - _this.name = ''; - return _this; - } + _this.type = 'value'; + _this.angle = 0; + _this.name = ''; + return _this; + } - return IndicatorAxis; - }(Axis); + return IndicatorAxis; + }(Axis); var Radar = - /** @class */ - function () { - function Radar(radarModel, ecModel, api) { - /** - * - * Radar dimensions - */ - this.dimensions = []; - this._model = radarModel; - this._indicatorAxes = map(radarModel.getIndicatorModels(), function (indicatorModel, idx) { - var dim = 'indicator_' + idx; - var indicatorAxis = new IndicatorAxis(dim, new IntervalScale() // (indicatorModel.get('axisType') === 'log') ? new LogScale() : new IntervalScale() - ); - indicatorAxis.name = indicatorModel.get('name'); // Inject model and axis - - indicatorAxis.model = indicatorModel; - indicatorModel.axis = indicatorAxis; - this.dimensions.push(dim); - return indicatorAxis; - }, this); - this.resize(radarModel, api); - } + /** @class */ + function () { + function Radar(radarModel, ecModel, api) { + /** + * + * Radar dimensions + */ + this.dimensions = []; + this._model = radarModel; + this._indicatorAxes = map(radarModel.getIndicatorModels(), function (indicatorModel, idx) { + var dim = 'indicator_' + idx; + var indicatorAxis = new IndicatorAxis(dim, new IntervalScale() // (indicatorModel.get('axisType') === 'log') ? new LogScale() : new IntervalScale() + ); + indicatorAxis.name = indicatorModel.get('name'); // Inject model and axis + + indicatorAxis.model = indicatorModel; + indicatorModel.axis = indicatorAxis; + this.dimensions.push(dim); + return indicatorAxis; + }, this); + this.resize(radarModel, api); + } - Radar.prototype.getIndicatorAxes = function () { - return this._indicatorAxes; - }; + Radar.prototype.getIndicatorAxes = function () { + return this._indicatorAxes; + }; - Radar.prototype.dataToPoint = function (value, indicatorIndex) { - var indicatorAxis = this._indicatorAxes[indicatorIndex]; - return this.coordToPoint(indicatorAxis.dataToCoord(value), indicatorIndex); - }; // TODO: API should be coordToPoint([coord, indicatorIndex]) + Radar.prototype.dataToPoint = function (value, indicatorIndex) { + var indicatorAxis = this._indicatorAxes[indicatorIndex]; + return this.coordToPoint(indicatorAxis.dataToCoord(value), indicatorIndex); + }; // TODO: API should be coordToPoint([coord, indicatorIndex]) - Radar.prototype.coordToPoint = function (coord, indicatorIndex) { - var indicatorAxis = this._indicatorAxes[indicatorIndex]; - var angle = indicatorAxis.angle; - var x = this.cx + coord * Math.cos(angle); - var y = this.cy - coord * Math.sin(angle); - return [x, y]; - }; + Radar.prototype.coordToPoint = function (coord, indicatorIndex) { + var indicatorAxis = this._indicatorAxes[indicatorIndex]; + var angle = indicatorAxis.angle; + var x = this.cx + coord * Math.cos(angle); + var y = this.cy - coord * Math.sin(angle); + return [x, y]; + }; - Radar.prototype.pointToData = function (pt) { - var dx = pt[0] - this.cx; - var dy = pt[1] - this.cy; - var radius = Math.sqrt(dx * dx + dy * dy); - dx /= radius; - dy /= radius; - var radian = Math.atan2(-dy, dx); // Find the closest angle - // FIXME index can calculated directly - - var minRadianDiff = Infinity; - var closestAxis; - var closestAxisIdx = -1; - - for (var i = 0; i < this._indicatorAxes.length; i++) { - var indicatorAxis = this._indicatorAxes[i]; - var diff = Math.abs(radian - indicatorAxis.angle); - - if (diff < minRadianDiff) { - closestAxis = indicatorAxis; - closestAxisIdx = i; - minRadianDiff = diff; - } - } + Radar.prototype.pointToData = function (pt) { + var dx = pt[0] - this.cx; + var dy = pt[1] - this.cy; + var radius = Math.sqrt(dx * dx + dy * dy); + dx /= radius; + dy /= radius; + var radian = Math.atan2(-dy, dx); // Find the closest angle + // FIXME index can calculated directly - return [closestAxisIdx, +(closestAxis && closestAxis.coordToData(radius))]; - }; + var minRadianDiff = Infinity; + var closestAxis; + var closestAxisIdx = -1; - Radar.prototype.resize = function (radarModel, api) { - var center = radarModel.get('center'); - var viewWidth = api.getWidth(); - var viewHeight = api.getHeight(); - var viewSize = Math.min(viewWidth, viewHeight) / 2; - this.cx = parsePercent$1(center[0], viewWidth); - this.cy = parsePercent$1(center[1], viewHeight); - this.startAngle = radarModel.get('startAngle') * Math.PI / 180; // radius may be single value like `20`, `'80%'`, or array like `[10, '80%']` + for (var i = 0; i < this._indicatorAxes.length; i++) { + var indicatorAxis = this._indicatorAxes[i]; + var diff = Math.abs(radian - indicatorAxis.angle); - var radius = radarModel.get('radius'); + if (diff < minRadianDiff) { + closestAxis = indicatorAxis; + closestAxisIdx = i; + minRadianDiff = diff; + } + } - if (isString(radius) || isNumber(radius)) { - radius = [0, radius]; - } + return [closestAxisIdx, +(closestAxis && closestAxis.coordToData(radius))]; + }; - this.r0 = parsePercent$1(radius[0], viewSize); - this.r = parsePercent$1(radius[1], viewSize); - each(this._indicatorAxes, function (indicatorAxis, idx) { - indicatorAxis.setExtent(this.r0, this.r); - var angle = this.startAngle + idx * Math.PI * 2 / this._indicatorAxes.length; // Normalize to [-PI, PI] + Radar.prototype.resize = function (radarModel, api) { + var center = radarModel.get('center'); + var viewWidth = api.getWidth(); + var viewHeight = api.getHeight(); + var viewSize = Math.min(viewWidth, viewHeight) / 2; + this.cx = parsePercent$1(center[0], viewWidth); + this.cy = parsePercent$1(center[1], viewHeight); + this.startAngle = radarModel.get('startAngle') * Math.PI / 180; // radius may be single value like `20`, `'80%'`, or array like `[10, '80%']` - angle = Math.atan2(Math.sin(angle), Math.cos(angle)); - indicatorAxis.angle = angle; - }, this); - }; + var radius = radarModel.get('radius'); - Radar.prototype.update = function (ecModel, api) { - var indicatorAxes = this._indicatorAxes; - var radarModel = this._model; - each(indicatorAxes, function (indicatorAxis) { - indicatorAxis.scale.setExtent(Infinity, -Infinity); - }); - ecModel.eachSeriesByType('radar', function (radarSeries, idx) { - if (radarSeries.get('coordinateSystem') !== 'radar' // @ts-ignore - || ecModel.getComponent('radar', radarSeries.get('radarIndex')) !== radarModel) { - return; - } + if (isString(radius) || isNumber(radius)) { + radius = [0, radius]; + } - var data = radarSeries.getData(); - each(indicatorAxes, function (indicatorAxis) { - indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(indicatorAxis.dim)); - }); - }, this); - var splitNumber = radarModel.get('splitNumber'); - var dummyScale = new IntervalScale(); - dummyScale.setExtent(0, splitNumber); - dummyScale.setInterval(1); // Force all the axis fixing the maxSplitNumber. + this.r0 = parsePercent$1(radius[0], viewSize); + this.r = parsePercent$1(radius[1], viewSize); + each(this._indicatorAxes, function (indicatorAxis, idx) { + indicatorAxis.setExtent(this.r0, this.r); + var angle = this.startAngle + idx * Math.PI * 2 / this._indicatorAxes.length; // Normalize to [-PI, PI] - each(indicatorAxes, function (indicatorAxis, idx) { - alignScaleTicks(indicatorAxis.scale, indicatorAxis.model, dummyScale); - }); - }; + angle = Math.atan2(Math.sin(angle), Math.cos(angle)); + indicatorAxis.angle = angle; + }, this); + }; - Radar.prototype.convertToPixel = function (ecModel, finder, value) { - console.warn('Not implemented.'); - return null; - }; + Radar.prototype.update = function (ecModel, api) { + var indicatorAxes = this._indicatorAxes; + var radarModel = this._model; + each(indicatorAxes, function (indicatorAxis) { + indicatorAxis.scale.setExtent(Infinity, -Infinity); + }); + ecModel.eachSeriesByType('radar', function (radarSeries, idx) { + if (radarSeries.get('coordinateSystem') !== 'radar' // @ts-ignore + || ecModel.getComponent('radar', radarSeries.get('radarIndex')) !== radarModel) { + return; + } - Radar.prototype.convertFromPixel = function (ecModel, finder, pixel) { - console.warn('Not implemented.'); - return null; - }; + var data = radarSeries.getData(); + each(indicatorAxes, function (indicatorAxis) { + indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(indicatorAxis.dim)); + }); + }, this); + var splitNumber = radarModel.get('splitNumber'); + var dummyScale = new IntervalScale(); + dummyScale.setExtent(0, splitNumber); + dummyScale.setInterval(1); // Force all the axis fixing the maxSplitNumber. - Radar.prototype.containPoint = function (point) { - console.warn('Not implemented.'); - return false; - }; + each(indicatorAxes, function (indicatorAxis, idx) { + alignScaleTicks(indicatorAxis.scale, indicatorAxis.model, dummyScale); + }); + }; - Radar.create = function (ecModel, api) { - var radarList = []; - ecModel.eachComponent('radar', function (radarModel) { - var radar = new Radar(radarModel, ecModel, api); - radarList.push(radar); - radarModel.coordinateSystem = radar; - }); - ecModel.eachSeriesByType('radar', function (radarSeries) { - if (radarSeries.get('coordinateSystem') === 'radar') { - // Inject coordinate system - // @ts-ignore - radarSeries.coordinateSystem = radarList[radarSeries.get('radarIndex') || 0]; - } - }); - return radarList; - }; - /** - * Radar dimensions is based on the data - */ + Radar.prototype.convertToPixel = function (ecModel, finder, value) { + console.warn('Not implemented.'); + return null; + }; + + Radar.prototype.convertFromPixel = function (ecModel, finder, pixel) { + console.warn('Not implemented.'); + return null; + }; + + Radar.prototype.containPoint = function (point) { + console.warn('Not implemented.'); + return false; + }; + + Radar.create = function (ecModel, api) { + var radarList = []; + ecModel.eachComponent('radar', function (radarModel) { + var radar = new Radar(radarModel, ecModel, api); + radarList.push(radar); + radarModel.coordinateSystem = radar; + }); + ecModel.eachSeriesByType('radar', function (radarSeries) { + if (radarSeries.get('coordinateSystem') === 'radar') { + // Inject coordinate system + // @ts-ignore + radarSeries.coordinateSystem = radarList[radarSeries.get('radarIndex') || 0]; + } + }); + return radarList; + }; + /** + * Radar dimensions is based on the data + */ - Radar.dimensions = []; - return Radar; - }(); + Radar.dimensions = []; + return Radar; + }(); function install$7(registers) { - registers.registerCoordinateSystem('radar', Radar); - registers.registerComponentModel(RadarModel); - registers.registerComponentView(RadarView$1); - registers.registerVisual({ - seriesType: 'radar', - reset: function (seriesModel) { - var data = seriesModel.getData(); // itemVisual symbol is for selected data + registers.registerCoordinateSystem('radar', Radar); + registers.registerComponentModel(RadarModel); + registers.registerComponentView(RadarView$1); + registers.registerVisual({ + seriesType: 'radar', + reset: function (seriesModel) { + var data = seriesModel.getData(); // itemVisual symbol is for selected data - data.each(function (idx) { - data.setItemVisual(idx, 'legendIcon', 'roundRect'); - }); // visual is for unselected data + data.each(function (idx) { + data.setItemVisual(idx, 'legendIcon', 'roundRect'); + }); // visual is for unselected data - data.setVisual('legendIcon', 'roundRect'); - } - }); + data.setVisual('legendIcon', 'roundRect'); + } + }); } function install$8(registers) { - use(install$7); - registers.registerChartView(RadarView); - registers.registerSeriesModel(RadarSeriesModel); - registers.registerLayout(radarLayout); - registers.registerProcessor(dataFilter('radar')); - registers.registerPreprocessor(radarBackwardCompat); + use(install$7); + registers.registerChartView(RadarView); + registers.registerSeriesModel(RadarSeriesModel); + registers.registerLayout(radarLayout); + registers.registerProcessor(dataFilter('radar')); + registers.registerPreprocessor(radarBackwardCompat); } var ATTR = '\0_ec_interaction_mutex'; function take(zr, resourceKey, userKey) { - var store = getStore(zr); - store[resourceKey] = userKey; + var store = getStore(zr); + store[resourceKey] = userKey; } function release(zr, resourceKey, userKey) { - var store = getStore(zr); - var uKey = store[resourceKey]; + var store = getStore(zr); + var uKey = store[resourceKey]; - if (uKey === userKey) { - store[resourceKey] = null; - } + if (uKey === userKey) { + store[resourceKey] = null; + } } function isTaken(zr, resourceKey) { - return !!getStore(zr)[resourceKey]; + return !!getStore(zr)[resourceKey]; } function getStore(zr) { - return zr[ATTR] || (zr[ATTR] = {}); + return zr[ATTR] || (zr[ATTR] = {}); } /** * payload: { @@ -50132,214 +50132,214 @@ registerAction({ - type: 'takeGlobalCursor', - event: 'globalCursorTaken', - update: 'update' + type: 'takeGlobalCursor', + event: 'globalCursorTaken', + update: 'update' }, noop); var RoamController = - /** @class */ - function (_super) { - __extends(RoamController, _super); - - function RoamController(zr) { - var _this = _super.call(this) || this; - - _this._zr = zr; // Avoid two roamController bind the same handler - - var mousedownHandler = bind(_this._mousedownHandler, _this); - var mousemoveHandler = bind(_this._mousemoveHandler, _this); - var mouseupHandler = bind(_this._mouseupHandler, _this); - var mousewheelHandler = bind(_this._mousewheelHandler, _this); - var pinchHandler = bind(_this._pinchHandler, _this); - /** - * Notice: only enable needed types. For example, if 'zoom' - * is not needed, 'zoom' should not be enabled, otherwise - * default mousewheel behaviour (scroll page) will be disabled. - */ - - _this.enable = function (controlType, opt) { - // Disable previous first - this.disable(); - this._opt = defaults(clone(opt) || {}, { - zoomOnMouseWheel: true, - moveOnMouseMove: true, - // By default, wheel do not trigger move. - moveOnMouseWheel: false, - preventDefaultMouseMove: true - }); - - if (controlType == null) { - controlType = true; - } - - if (controlType === true || controlType === 'move' || controlType === 'pan') { - zr.on('mousedown', mousedownHandler); - zr.on('mousemove', mousemoveHandler); - zr.on('mouseup', mouseupHandler); - } - - if (controlType === true || controlType === 'scale' || controlType === 'zoom') { - zr.on('mousewheel', mousewheelHandler); - zr.on('pinch', pinchHandler); - } - }; - - _this.disable = function () { - zr.off('mousedown', mousedownHandler); - zr.off('mousemove', mousemoveHandler); - zr.off('mouseup', mouseupHandler); - zr.off('mousewheel', mousewheelHandler); - zr.off('pinch', pinchHandler); - }; - - return _this; - } - - RoamController.prototype.isDragging = function () { - return this._dragging; - }; - - RoamController.prototype.isPinching = function () { - return this._pinching; - }; - - RoamController.prototype.setPointerChecker = function (pointerChecker) { - this.pointerChecker = pointerChecker; - }; - - RoamController.prototype.dispose = function () { - this.disable(); - }; - - RoamController.prototype._mousedownHandler = function (e) { - if (isMiddleOrRightButtonOnMouseUpDown(e) || e.target && e.target.draggable) { - return; - } - - var x = e.offsetX; - var y = e.offsetY; // Only check on mosedown, but not mousemove. - // Mouse can be out of target when mouse moving. - - if (this.pointerChecker && this.pointerChecker(e, x, y)) { - this._x = x; - this._y = y; - this._dragging = true; - } - }; + /** @class */ + function (_super) { + __extends(RoamController, _super); - RoamController.prototype._mousemoveHandler = function (e) { - if (!this._dragging || !isAvailableBehavior('moveOnMouseMove', e, this._opt) || e.gestureEvent === 'pinch' || isTaken(this._zr, 'globalPan')) { - return; - } + function RoamController(zr) { + var _this = _super.call(this) || this; - var x = e.offsetX; - var y = e.offsetY; - var oldX = this._x; - var oldY = this._y; - var dx = x - oldX; - var dy = y - oldY; - this._x = x; - this._y = y; - this._opt.preventDefaultMouseMove && stop(e.event); - trigger(this, 'pan', 'moveOnMouseMove', e, { - dx: dx, - dy: dy, - oldX: oldX, - oldY: oldY, - newX: x, - newY: y, - isAvailableBehavior: null - }); - }; + _this._zr = zr; // Avoid two roamController bind the same handler - RoamController.prototype._mouseupHandler = function (e) { - if (!isMiddleOrRightButtonOnMouseUpDown(e)) { - this._dragging = false; - } - }; - - RoamController.prototype._mousewheelHandler = function (e) { - var shouldZoom = isAvailableBehavior('zoomOnMouseWheel', e, this._opt); - var shouldMove = isAvailableBehavior('moveOnMouseWheel', e, this._opt); - var wheelDelta = e.wheelDelta; - var absWheelDeltaDelta = Math.abs(wheelDelta); - var originX = e.offsetX; - var originY = e.offsetY; // wheelDelta maybe -0 in chrome mac. + var mousedownHandler = bind(_this._mousedownHandler, _this); + var mousemoveHandler = bind(_this._mousemoveHandler, _this); + var mouseupHandler = bind(_this._mouseupHandler, _this); + var mousewheelHandler = bind(_this._mousewheelHandler, _this); + var pinchHandler = bind(_this._pinchHandler, _this); + /** + * Notice: only enable needed types. For example, if 'zoom' + * is not needed, 'zoom' should not be enabled, otherwise + * default mousewheel behaviour (scroll page) will be disabled. + */ - if (wheelDelta === 0 || !shouldZoom && !shouldMove) { - return; - } // If both `shouldZoom` and `shouldMove` is true, trigger - // their event both, and the final behavior is determined - // by event listener themselves. - - - if (shouldZoom) { - // Convenience: - // Mac and VM Windows on Mac: scroll up: zoom out. - // Windows: scroll up: zoom in. - // FIXME: Should do more test in different environment. - // wheelDelta is too complicated in difference nvironment - // (https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel), - // although it has been normallized by zrender. - // wheelDelta of mouse wheel is bigger than touch pad. - var factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1; - var scale = wheelDelta > 0 ? factor : 1 / factor; - checkPointerAndTrigger(this, 'zoom', 'zoomOnMouseWheel', e, { - scale: scale, - originX: originX, - originY: originY, - isAvailableBehavior: null - }); - } + _this.enable = function (controlType, opt) { + // Disable previous first + this.disable(); + this._opt = defaults(clone(opt) || {}, { + zoomOnMouseWheel: true, + moveOnMouseMove: true, + // By default, wheel do not trigger move. + moveOnMouseWheel: false, + preventDefaultMouseMove: true + }); + + if (controlType == null) { + controlType = true; + } + + if (controlType === true || controlType === 'move' || controlType === 'pan') { + zr.on('mousedown', mousedownHandler); + zr.on('mousemove', mousemoveHandler); + zr.on('mouseup', mouseupHandler); + } + + if (controlType === true || controlType === 'scale' || controlType === 'zoom') { + zr.on('mousewheel', mousewheelHandler); + zr.on('pinch', pinchHandler); + } + }; + + _this.disable = function () { + zr.off('mousedown', mousedownHandler); + zr.off('mousemove', mousemoveHandler); + zr.off('mouseup', mouseupHandler); + zr.off('mousewheel', mousewheelHandler); + zr.off('pinch', pinchHandler); + }; + + return _this; + } + + RoamController.prototype.isDragging = function () { + return this._dragging; + }; + + RoamController.prototype.isPinching = function () { + return this._pinching; + }; + + RoamController.prototype.setPointerChecker = function (pointerChecker) { + this.pointerChecker = pointerChecker; + }; + + RoamController.prototype.dispose = function () { + this.disable(); + }; + + RoamController.prototype._mousedownHandler = function (e) { + if (isMiddleOrRightButtonOnMouseUpDown(e) || e.target && e.target.draggable) { + return; + } + + var x = e.offsetX; + var y = e.offsetY; // Only check on mosedown, but not mousemove. + // Mouse can be out of target when mouse moving. + + if (this.pointerChecker && this.pointerChecker(e, x, y)) { + this._x = x; + this._y = y; + this._dragging = true; + } + }; + + RoamController.prototype._mousemoveHandler = function (e) { + if (!this._dragging || !isAvailableBehavior('moveOnMouseMove', e, this._opt) || e.gestureEvent === 'pinch' || isTaken(this._zr, 'globalPan')) { + return; + } + + var x = e.offsetX; + var y = e.offsetY; + var oldX = this._x; + var oldY = this._y; + var dx = x - oldX; + var dy = y - oldY; + this._x = x; + this._y = y; + this._opt.preventDefaultMouseMove && stop(e.event); + trigger(this, 'pan', 'moveOnMouseMove', e, { + dx: dx, + dy: dy, + oldX: oldX, + oldY: oldY, + newX: x, + newY: y, + isAvailableBehavior: null + }); + }; + + RoamController.prototype._mouseupHandler = function (e) { + if (!isMiddleOrRightButtonOnMouseUpDown(e)) { + this._dragging = false; + } + }; + + RoamController.prototype._mousewheelHandler = function (e) { + var shouldZoom = isAvailableBehavior('zoomOnMouseWheel', e, this._opt); + var shouldMove = isAvailableBehavior('moveOnMouseWheel', e, this._opt); + var wheelDelta = e.wheelDelta; + var absWheelDeltaDelta = Math.abs(wheelDelta); + var originX = e.offsetX; + var originY = e.offsetY; // wheelDelta maybe -0 in chrome mac. + + if (wheelDelta === 0 || !shouldZoom && !shouldMove) { + return; + } // If both `shouldZoom` and `shouldMove` is true, trigger + // their event both, and the final behavior is determined + // by event listener themselves. + + + if (shouldZoom) { + // Convenience: + // Mac and VM Windows on Mac: scroll up: zoom out. + // Windows: scroll up: zoom in. + // FIXME: Should do more test in different environment. + // wheelDelta is too complicated in difference nvironment + // (https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel), + // although it has been normallized by zrender. + // wheelDelta of mouse wheel is bigger than touch pad. + var factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1; + var scale = wheelDelta > 0 ? factor : 1 / factor; + checkPointerAndTrigger(this, 'zoom', 'zoomOnMouseWheel', e, { + scale: scale, + originX: originX, + originY: originY, + isAvailableBehavior: null + }); + } - if (shouldMove) { - // FIXME: Should do more test in different environment. - var absDelta = Math.abs(wheelDelta); // wheelDelta of mouse wheel is bigger than touch pad. + if (shouldMove) { + // FIXME: Should do more test in different environment. + var absDelta = Math.abs(wheelDelta); // wheelDelta of mouse wheel is bigger than touch pad. - var scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05); - checkPointerAndTrigger(this, 'scrollMove', 'moveOnMouseWheel', e, { - scrollDelta: scrollDelta, - originX: originX, - originY: originY, - isAvailableBehavior: null - }); - } - }; + var scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05); + checkPointerAndTrigger(this, 'scrollMove', 'moveOnMouseWheel', e, { + scrollDelta: scrollDelta, + originX: originX, + originY: originY, + isAvailableBehavior: null + }); + } + }; - RoamController.prototype._pinchHandler = function (e) { - if (isTaken(this._zr, 'globalPan')) { - return; - } + RoamController.prototype._pinchHandler = function (e) { + if (isTaken(this._zr, 'globalPan')) { + return; + } - var scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1; - checkPointerAndTrigger(this, 'zoom', null, e, { - scale: scale, - originX: e.pinchX, - originY: e.pinchY, - isAvailableBehavior: null - }); - }; + var scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1; + checkPointerAndTrigger(this, 'zoom', null, e, { + scale: scale, + originX: e.pinchX, + originY: e.pinchY, + isAvailableBehavior: null + }); + }; - return RoamController; - }(Eventful); + return RoamController; + }(Eventful); function checkPointerAndTrigger(controller, eventName, behaviorToCheck, e, contollerEvent) { - if (controller.pointerChecker && controller.pointerChecker(e, contollerEvent.originX, contollerEvent.originY)) { - // When mouse is out of roamController rect, - // default befavoius should not be be disabled, otherwise - // page sliding is disabled, contrary to expectation. - stop(e.event); - trigger(controller, eventName, behaviorToCheck, e, contollerEvent); - } + if (controller.pointerChecker && controller.pointerChecker(e, contollerEvent.originX, contollerEvent.originY)) { + // When mouse is out of roamController rect, + // default befavoius should not be be disabled, otherwise + // page sliding is disabled, contrary to expectation. + stop(e.event); + trigger(controller, eventName, behaviorToCheck, e, contollerEvent); + } } function trigger(controller, eventName, behaviorToCheck, e, contollerEvent) { - // Also provide behavior checker for event listener, for some case that - // multiple components share one listener. - contollerEvent.isAvailableBehavior = bind(isAvailableBehavior, null, behaviorToCheck, e); // TODO should not have type issue. + // Also provide behavior checker for event listener, for some case that + // multiple components share one listener. + contollerEvent.isAvailableBehavior = bind(isAvailableBehavior, null, behaviorToCheck, e); // TODO should not have type issue. - controller.trigger(eventName, contollerEvent); + controller.trigger(eventName, contollerEvent); } // settings: { // zoomOnMouseWheel // moveOnMouseMove @@ -50349,8 +50349,8 @@ function isAvailableBehavior(behaviorToCheck, e, settings) { - var setting = settings[behaviorToCheck]; - return !behaviorToCheck || setting && (!isString(setting) || e.event[setting + 'Key']); + var setting = settings[behaviorToCheck]; + return !behaviorToCheck || setting && (!isString(setting) || e.event[setting + 'Key']); } /* @@ -50400,35 +50400,35 @@ * For geo and graph. */ function updateViewOnPan(controllerHost, dx, dy) { - var target = controllerHost.target; - target.x += dx; - target.y += dy; - target.dirty(); + var target = controllerHost.target; + target.x += dx; + target.y += dy; + target.dirty(); } /** * For geo and graph. */ function updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) { - var target = controllerHost.target; - var zoomLimit = controllerHost.zoomLimit; - var newZoom = controllerHost.zoom = controllerHost.zoom || 1; - newZoom *= zoomDelta; + var target = controllerHost.target; + var zoomLimit = controllerHost.zoomLimit; + var newZoom = controllerHost.zoom = controllerHost.zoom || 1; + newZoom *= zoomDelta; - if (zoomLimit) { - var zoomMin = zoomLimit.min || 0; - var zoomMax = zoomLimit.max || Infinity; - newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin); - } + if (zoomLimit) { + var zoomMin = zoomLimit.min || 0; + var zoomMax = zoomLimit.max || Infinity; + newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin); + } - var zoomScale = newZoom / controllerHost.zoom; - controllerHost.zoom = newZoom; // Keep the mouse center when scaling + var zoomScale = newZoom / controllerHost.zoom; + controllerHost.zoom = newZoom; // Keep the mouse center when scaling - target.x -= (zoomX - target.x) * (zoomScale - 1); - target.y -= (zoomY - target.y) * (zoomScale - 1); - target.scaleX *= zoomScale; - target.scaleY *= zoomScale; - target.dirty(); + target.x -= (zoomX - target.x) * (zoomScale - 1); + target.y -= (zoomY - target.y) * (zoomScale - 1); + target.scaleX *= zoomScale; + target.scaleY *= zoomScale; + target.dirty(); } /* @@ -50474,9 +50474,9 @@ * under the License. */ var IRRELEVANT_EXCLUDES = { - 'axisPointer': 1, - 'tooltip': 1, - 'brush': 1 + 'axisPointer': 1, + 'tooltip': 1, + 'brush': 1 }; /** * Avoid that: mouse click on a elements that is over geo or graph, @@ -50484,10 +50484,10 @@ */ function onIrrelevantElement(e, api, targetCoordSysModel) { - var model = api.getComponentByElement(e.topTarget); // If model is axisModel, it works only if it is injected with coordinateSystem. + var model = api.getComponentByElement(e.topTarget); // If model is axisModel, it works only if it is injected with coordinateSystem. - var coordSys = model && model.coordinateSystem; - return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType) && coordSys && coordSys.model !== targetCoordSysModel; + var coordSys = model && model.coordinateSystem; + return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType) && coordSys && coordSys.model !== targetCoordSysModel; } function parseXML(svg) { @@ -51145,276 +51145,276 @@ */ var REGION_AVAILABLE_SVG_TAG_MAP = createHashMap(['rect', 'circle', 'line', 'ellipse', 'polygon', 'polyline', 'path', // are also enabled becuase some SVG might paint text itself, - // but still need to trigger events or tooltip. - 'text', 'tspan', // is also enabled because this case: if multiple tags share one name - // and need label displayed, every tags will display the name, which is not - // expected. So we can put them into a . Thereby only one label - // displayed and located based on the bounding rect of the . - 'g']); + // but still need to trigger events or tooltip. + 'text', 'tspan', // is also enabled because this case: if multiple tags share one name + // and need label displayed, every tags will display the name, which is not + // expected. So we can put them into a . Thereby only one label + // displayed and located based on the bounding rect of the . + 'g']); var GeoSVGResource = - /** @class */ - function () { - function GeoSVGResource(mapName, svg) { - this.type = 'geoSVG'; // All used graphics. key: hostKey, value: root + /** @class */ + function () { + function GeoSVGResource(mapName, svg) { + this.type = 'geoSVG'; // All used graphics. key: hostKey, value: root - this._usedGraphicMap = createHashMap(); // All unused graphics. + this._usedGraphicMap = createHashMap(); // All unused graphics. - this._freedGraphics = []; - this._mapName = mapName; // Only perform parse to XML object here, which might be time - // consiming for large SVG. - // Although convert XML to zrender element is also time consiming, - // if we do it here, the clone of zrender elements has to be - // required. So we do it once for each geo instance, util real - // performance issues call for optimizing it. + this._freedGraphics = []; + this._mapName = mapName; // Only perform parse to XML object here, which might be time + // consiming for large SVG. + // Although convert XML to zrender element is also time consiming, + // if we do it here, the clone of zrender elements has to be + // required. So we do it once for each geo instance, util real + // performance issues call for optimizing it. - this._parsedXML = parseXML(svg); - } + this._parsedXML = parseXML(svg); + } - GeoSVGResource.prototype.load = function () - /* nameMap: NameMap */ - { - // In the "load" stage, graphic need to be built to - // get boundingRect for geo coordinate system. - var firstGraphic = this._firstGraphic; // Create the return data structure only when first graphic created. - // Because they will be used in geo coordinate system update stage, - // and `regions` will be mounted at `geo` coordinate system, - // in which there is no "view" info, so that it should better not to - // make references to graphic elements. + GeoSVGResource.prototype.load = function () + /* nameMap: NameMap */ + { + // In the "load" stage, graphic need to be built to + // get boundingRect for geo coordinate system. + var firstGraphic = this._firstGraphic; // Create the return data structure only when first graphic created. + // Because they will be used in geo coordinate system update stage, + // and `regions` will be mounted at `geo` coordinate system, + // in which there is no "view" info, so that it should better not to + // make references to graphic elements. - if (!firstGraphic) { - firstGraphic = this._firstGraphic = this._buildGraphic(this._parsedXML); + if (!firstGraphic) { + firstGraphic = this._firstGraphic = this._buildGraphic(this._parsedXML); - this._freedGraphics.push(firstGraphic); + this._freedGraphics.push(firstGraphic); - this._boundingRect = this._firstGraphic.boundingRect.clone(); // PENDING: `nameMap` will not be supported until some real requirement come. - // if (nameMap) { - // named = applyNameMap(named, nameMap); - // } + this._boundingRect = this._firstGraphic.boundingRect.clone(); // PENDING: `nameMap` will not be supported until some real requirement come. + // if (nameMap) { + // named = applyNameMap(named, nameMap); + // } - var _a = createRegions(firstGraphic.named), - regions = _a.regions, - regionsMap = _a.regionsMap; + var _a = createRegions(firstGraphic.named), + regions = _a.regions, + regionsMap = _a.regionsMap; - this._regions = regions; - this._regionsMap = regionsMap; - } - - return { - boundingRect: this._boundingRect, - regions: this._regions, - regionsMap: this._regionsMap - }; - }; - - GeoSVGResource.prototype._buildGraphic = function (svgXML) { - var result; - var rootFromParse; - - try { - result = svgXML && parseSVG(svgXML, { - ignoreViewBox: true, - ignoreRootClip: true - }) || {}; - rootFromParse = result.root; - assert(rootFromParse != null); - } catch (e) { - throw new Error('Invalid svg format\n' + e.message); - } // Note: we keep the covenant that the root has no transform. So always add an extra root. - - - var root = new Group(); - root.add(rootFromParse); - root.isGeoSVGGraphicRoot = true; // [THE_RULE_OF_VIEWPORT_AND_VIEWBOX] - // - // Consider: `` - // - the `width/height` we call it `svgWidth/svgHeight` for short. - // - `(0, 0, svgWidth, svgHeight)` defines the viewport of the SVG, or say, - // "viewport boundingRect", or `boundingRect` for short. - // - `viewBox` defines the transform from the real content ot the viewport. - // `viewBox` has the same unit as the content of SVG. - // If `viewBox` exists, a transform is defined, so the unit of `svgWidth/svgHeight` become - // different from the content of SVG. Otherwise, they are the same. - // - // If both `svgWidth/svgHeight/viewBox` are specified in a SVG file, the transform rule will be: - // 0. `boundingRect` is `(0, 0, svgWidth, svgHeight)`. Set it to Geo['_rect'] (View['_rect']). - // 1. Make a transform from `viewBox` to `boundingRect`. - // Note: only suport `preserveAspectRatio 'xMidYMid'` here. That is, this transform will preserve - // the aspect ratio. - // 2. Make a transform from boundingRect to Geo['_viewRect'] (View['_viewRect']) - // (`Geo`/`View` will do this job). - // Note: this transform might not preserve aspect radio, which depending on how users specify - // viewRect in echarts option (e.g., `geo.left/top/width/height` will not preserve aspect ratio, - // but `geo.layoutCenter/layoutSize` will preserve aspect ratio). - // - // If `svgWidth/svgHeight` not specified, we use `viewBox` as the `boundingRect` to make the SVG - // layout look good. - // - // If neither `svgWidth/svgHeight` nor `viewBox` are not specified, we calculate the boundingRect - // of the SVG content and use them to make SVG layout look good. - - var svgWidth = result.width; - var svgHeight = result.height; - var viewBoxRect = result.viewBoxRect; - var boundingRect = this._boundingRect; - - if (!boundingRect) { - var bRectX = void 0; - var bRectY = void 0; - var bRectWidth = void 0; - var bRectHeight = void 0; - - if (svgWidth != null) { - bRectX = 0; - bRectWidth = svgWidth; - } else if (viewBoxRect) { - bRectX = viewBoxRect.x; - bRectWidth = viewBoxRect.width; - } - - if (svgHeight != null) { - bRectY = 0; - bRectHeight = svgHeight; - } else if (viewBoxRect) { - bRectY = viewBoxRect.y; - bRectHeight = viewBoxRect.height; - } // If both viewBox and svgWidth/svgHeight not specified, - // we have to determine how to layout those element to make them look good. - - - if (bRectX == null || bRectY == null) { - var calculatedBoundingRect = rootFromParse.getBoundingRect(); - - if (bRectX == null) { - bRectX = calculatedBoundingRect.x; - bRectWidth = calculatedBoundingRect.width; - } - - if (bRectY == null) { - bRectY = calculatedBoundingRect.y; - bRectHeight = calculatedBoundingRect.height; - } - } - - boundingRect = this._boundingRect = new BoundingRect(bRectX, bRectY, bRectWidth, bRectHeight); - } - - if (viewBoxRect) { - var viewBoxTransform = makeViewBoxTransform(viewBoxRect, boundingRect); // Only support `preserveAspectRatio 'xMidYMid'` + this._regions = regions; + this._regionsMap = regionsMap; + } - rootFromParse.scaleX = rootFromParse.scaleY = viewBoxTransform.scale; - rootFromParse.x = viewBoxTransform.x; - rootFromParse.y = viewBoxTransform.y; - } // SVG needs to clip based on `viewBox`. And some SVG files really rely on this feature. - // They do not strictly confine all of the content inside a display rect, but deliberately - // use a `viewBox` to define a displayable rect. - // PENDING: - // The drawback of the `setClipPath` here is: the region label (genereted by echarts) near the - // edge might also be clipped, because region labels are put as `textContent` of the SVG path. + return { + boundingRect: this._boundingRect, + regions: this._regions, + regionsMap: this._regionsMap + }; + }; + GeoSVGResource.prototype._buildGraphic = function (svgXML) { + var result; + var rootFromParse; - root.setClipPath(new Rect({ - shape: boundingRect.plain() - })); - var named = []; - each(result.named, function (namedItem) { - if (REGION_AVAILABLE_SVG_TAG_MAP.get(namedItem.svgNodeTagLower) != null) { - named.push(namedItem); - setSilent(namedItem.el); - } - }); - return { - root: root, - boundingRect: boundingRect, - named: named - }; - }; - /** - * Consider: - * (1) One graphic element can not be shared by different `geoView` running simultaneously. - * Notice, also need to consider multiple echarts instances share a `mapRecord`. - * (2) Converting SVG to graphic elements is time consuming. - * (3) In the current architecture, `load` should be called frequently to get boundingRect, - * and it is called without view info. - * So we maintain graphic elements in this module, and enables `view` to use/return these - * graphics from/to the pool with it's uid. - */ + try { + result = svgXML && parseSVG(svgXML, { + ignoreViewBox: true, + ignoreRootClip: true + }) || {}; + rootFromParse = result.root; + assert(rootFromParse != null); + } catch (e) { + throw new Error('Invalid svg format\n' + e.message); + } // Note: we keep the covenant that the root has no transform. So always add an extra root. + + + var root = new Group(); + root.add(rootFromParse); + root.isGeoSVGGraphicRoot = true; // [THE_RULE_OF_VIEWPORT_AND_VIEWBOX] + // + // Consider: `` + // - the `width/height` we call it `svgWidth/svgHeight` for short. + // - `(0, 0, svgWidth, svgHeight)` defines the viewport of the SVG, or say, + // "viewport boundingRect", or `boundingRect` for short. + // - `viewBox` defines the transform from the real content ot the viewport. + // `viewBox` has the same unit as the content of SVG. + // If `viewBox` exists, a transform is defined, so the unit of `svgWidth/svgHeight` become + // different from the content of SVG. Otherwise, they are the same. + // + // If both `svgWidth/svgHeight/viewBox` are specified in a SVG file, the transform rule will be: + // 0. `boundingRect` is `(0, 0, svgWidth, svgHeight)`. Set it to Geo['_rect'] (View['_rect']). + // 1. Make a transform from `viewBox` to `boundingRect`. + // Note: only suport `preserveAspectRatio 'xMidYMid'` here. That is, this transform will preserve + // the aspect ratio. + // 2. Make a transform from boundingRect to Geo['_viewRect'] (View['_viewRect']) + // (`Geo`/`View` will do this job). + // Note: this transform might not preserve aspect radio, which depending on how users specify + // viewRect in echarts option (e.g., `geo.left/top/width/height` will not preserve aspect ratio, + // but `geo.layoutCenter/layoutSize` will preserve aspect ratio). + // + // If `svgWidth/svgHeight` not specified, we use `viewBox` as the `boundingRect` to make the SVG + // layout look good. + // + // If neither `svgWidth/svgHeight` nor `viewBox` are not specified, we calculate the boundingRect + // of the SVG content and use them to make SVG layout look good. + + var svgWidth = result.width; + var svgHeight = result.height; + var viewBoxRect = result.viewBoxRect; + var boundingRect = this._boundingRect; + + if (!boundingRect) { + var bRectX = void 0; + var bRectY = void 0; + var bRectWidth = void 0; + var bRectHeight = void 0; + + if (svgWidth != null) { + bRectX = 0; + bRectWidth = svgWidth; + } else if (viewBoxRect) { + bRectX = viewBoxRect.x; + bRectWidth = viewBoxRect.width; + } + + if (svgHeight != null) { + bRectY = 0; + bRectHeight = svgHeight; + } else if (viewBoxRect) { + bRectY = viewBoxRect.y; + bRectHeight = viewBoxRect.height; + } // If both viewBox and svgWidth/svgHeight not specified, + // we have to determine how to layout those element to make them look good. + + + if (bRectX == null || bRectY == null) { + var calculatedBoundingRect = rootFromParse.getBoundingRect(); + + if (bRectX == null) { + bRectX = calculatedBoundingRect.x; + bRectWidth = calculatedBoundingRect.width; + } + + if (bRectY == null) { + bRectY = calculatedBoundingRect.y; + bRectHeight = calculatedBoundingRect.height; + } + } + + boundingRect = this._boundingRect = new BoundingRect(bRectX, bRectY, bRectWidth, bRectHeight); + } + + if (viewBoxRect) { + var viewBoxTransform = makeViewBoxTransform(viewBoxRect, boundingRect); // Only support `preserveAspectRatio 'xMidYMid'` + + rootFromParse.scaleX = rootFromParse.scaleY = viewBoxTransform.scale; + rootFromParse.x = viewBoxTransform.x; + rootFromParse.y = viewBoxTransform.y; + } // SVG needs to clip based on `viewBox`. And some SVG files really rely on this feature. + // They do not strictly confine all of the content inside a display rect, but deliberately + // use a `viewBox` to define a displayable rect. + // PENDING: + // The drawback of the `setClipPath` here is: the region label (genereted by echarts) near the + // edge might also be clipped, because region labels are put as `textContent` of the SVG path. + + + root.setClipPath(new Rect({ + shape: boundingRect.plain() + })); + var named = []; + each(result.named, function (namedItem) { + if (REGION_AVAILABLE_SVG_TAG_MAP.get(namedItem.svgNodeTagLower) != null) { + named.push(namedItem); + setSilent(namedItem.el); + } + }); + return { + root: root, + boundingRect: boundingRect, + named: named + }; + }; + /** + * Consider: + * (1) One graphic element can not be shared by different `geoView` running simultaneously. + * Notice, also need to consider multiple echarts instances share a `mapRecord`. + * (2) Converting SVG to graphic elements is time consuming. + * (3) In the current architecture, `load` should be called frequently to get boundingRect, + * and it is called without view info. + * So we maintain graphic elements in this module, and enables `view` to use/return these + * graphics from/to the pool with it's uid. + */ - GeoSVGResource.prototype.useGraphic = function (hostKey - /*, nameMap: NameMap */ - ) { - var usedRootMap = this._usedGraphicMap; - var svgGraphic = usedRootMap.get(hostKey); + GeoSVGResource.prototype.useGraphic = function (hostKey + /*, nameMap: NameMap */ + ) { + var usedRootMap = this._usedGraphicMap; + var svgGraphic = usedRootMap.get(hostKey); - if (svgGraphic) { - return svgGraphic; - } + if (svgGraphic) { + return svgGraphic; + } - svgGraphic = this._freedGraphics.pop() // use the first boundingRect to avoid duplicated boundingRect calculation. - || this._buildGraphic(this._parsedXML); - usedRootMap.set(hostKey, svgGraphic); // PENDING: `nameMap` will not be supported until some real requirement come. - // `nameMap` can only be obtained from echarts option. - // The original `named` must not be modified. - // if (nameMap) { - // svgGraphic = extend({}, svgGraphic); - // svgGraphic.named = applyNameMap(svgGraphic.named, nameMap); - // } + svgGraphic = this._freedGraphics.pop() // use the first boundingRect to avoid duplicated boundingRect calculation. + || this._buildGraphic(this._parsedXML); + usedRootMap.set(hostKey, svgGraphic); // PENDING: `nameMap` will not be supported until some real requirement come. + // `nameMap` can only be obtained from echarts option. + // The original `named` must not be modified. + // if (nameMap) { + // svgGraphic = extend({}, svgGraphic); + // svgGraphic.named = applyNameMap(svgGraphic.named, nameMap); + // } - return svgGraphic; - }; + return svgGraphic; + }; - GeoSVGResource.prototype.freeGraphic = function (hostKey) { - var usedRootMap = this._usedGraphicMap; - var svgGraphic = usedRootMap.get(hostKey); + GeoSVGResource.prototype.freeGraphic = function (hostKey) { + var usedRootMap = this._usedGraphicMap; + var svgGraphic = usedRootMap.get(hostKey); - if (svgGraphic) { - usedRootMap.removeKey(hostKey); + if (svgGraphic) { + usedRootMap.removeKey(hostKey); - this._freedGraphics.push(svgGraphic); - } - }; + this._freedGraphics.push(svgGraphic); + } + }; - return GeoSVGResource; - }(); + return GeoSVGResource; + }(); function setSilent(el) { - // Only named element has silent: false, other elements should - // act as background and has no user interaction. - el.silent = false; // text|tspan will be converted to group. + // Only named element has silent: false, other elements should + // act as background and has no user interaction. + el.silent = false; // text|tspan will be converted to group. - if (el.isGroup) { - el.traverse(function (child) { - child.silent = false; - }); - } + if (el.isGroup) { + el.traverse(function (child) { + child.silent = false; + }); + } } function createRegions(named) { - var regions = []; - var regionsMap = createHashMap(); // Create resions only for the first graphic. - - each(named, function (namedItem) { - // Region has feature to calculate center for tooltip or other features. - // If there is a , the center should be the center of the - // bounding rect of the g. - if (namedItem.namedFrom != null) { - return; - } - - var region = new GeoSVGRegion(namedItem.name, namedItem.el); // PENDING: if `nameMap` supported, this region can not be mounted on - // `this`, but can only be created each time `load()` called. - - regions.push(region); // PENDING: if multiple tag named with the same name, only one will be - // found by `_regionsMap`. `_regionsMap` is used to find a coordinate - // by name. We use `region.getCenter()` as the coordinate. - - regionsMap.set(namedItem.name, region); - }); - return { - regions: regions, - regionsMap: regionsMap - }; + var regions = []; + var regionsMap = createHashMap(); // Create resions only for the first graphic. + + each(named, function (namedItem) { + // Region has feature to calculate center for tooltip or other features. + // If there is a , the center should be the center of the + // bounding rect of the g. + if (namedItem.namedFrom != null) { + return; + } + + var region = new GeoSVGRegion(namedItem.name, namedItem.el); // PENDING: if `nameMap` supported, this region can not be mounted on + // `this`, but can only be created each time `load()` called. + + regions.push(region); // PENDING: if multiple tag named with the same name, only one will be + // found by `_regionsMap`. `_regionsMap` is used to find a coordinate + // by name. We use `region.getCenter()` as the coordinate. + + regionsMap.set(namedItem.name, region); + }); + return { + regions: regions, + regionsMap: regionsMap + }; } // PENDING: `nameMap` will not be supported until some real requirement come. // /** // * Use the alias in geoNameMap. @@ -51442,94 +51442,94 @@ var points$1 = [[[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, 0.7], [52, 0.7], [56, 7.7], [59, 0.7], [64, 0.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]]]; for (var i = 0; i < points$1.length; i++) { - for (var k = 0; k < points$1[i].length; k++) { - points$1[i][k][0] /= 10.5; - points$1[i][k][1] /= -10.5 / 0.75; - points$1[i][k][0] += geoCoord[0]; - points$1[i][k][1] += geoCoord[1]; - } + for (var k = 0; k < points$1[i].length; k++) { + points$1[i][k][0] /= 10.5; + points$1[i][k][1] /= -10.5 / 0.75; + points$1[i][k][0] += geoCoord[0]; + points$1[i][k][1] += geoCoord[1]; + } } function fixNanhai(mapType, regions) { - if (mapType === 'china') { - for (var i = 0; i < regions.length; i++) { - // Already exists. - if (regions[i].name === nanhaiName) { - return; - } - } + if (mapType === 'china') { + for (var i = 0; i < regions.length; i++) { + // Already exists. + if (regions[i].name === nanhaiName) { + return; + } + } - regions.push(new GeoJSONRegion(nanhaiName, map(points$1, function (exterior) { - return { - type: 'polygon', - exterior: exterior - }; - }), geoCoord)); - } - } - - /* - * 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. - */ - - - /** - * AUTO-GENERATED FILE. DO NOT MODIFY. - */ - - /* - * 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. - */ - var coordsOffsetMap = { - '南海诸岛': [32, 80], - // 全国 - '广东': [0, -10], - '香港': [10, 5], - '澳门': [-10, 10], - //'北京': [-10, 0], - '天津': [5, 5] - }; - function fixTextCoords(mapType, region) { - if (mapType === 'china') { - var coordFix = coordsOffsetMap[region.name]; - - if (coordFix) { - var cp = region.getCenter(); - cp[0] += coordFix[0] / 10.5; - cp[1] += -coordFix[1] / (10.5 / 0.75); - region.setCenter(cp); - } + regions.push(new GeoJSONRegion(nanhaiName, map(points$1, function (exterior) { + return { + type: 'polygon', + exterior: exterior + }; + }), geoCoord)); + } + } + + /* + * 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. + */ + + + /** + * AUTO-GENERATED FILE. DO NOT MODIFY. + */ + + /* + * 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. + */ + var coordsOffsetMap = { + '南海诸岛': [32, 80], + // 全国 + '广东': [0, -10], + '香港': [10, 5], + '澳门': [-10, 10], + //'北京': [-10, 0], + '天津': [5, 5] + }; + function fixTextCoords(mapType, region) { + if (mapType === 'china') { + var coordFix = coordsOffsetMap[region.name]; + + if (coordFix) { + var cp = region.getCenter(); + cp[0] += coordFix[0] / 10.5; + cp[1] += -coordFix[1] / (10.5 / 0.75); + region.setCenter(cp); } + } } /* @@ -51580,208 +51580,208 @@ // let geoCoord = [126, 25]; var points$2 = [[[123.45165252685547, 25.73527164402261], [123.49731445312499, 25.73527164402261], [123.49731445312499, 25.750734064600884], [123.45165252685547, 25.750734064600884], [123.45165252685547, 25.73527164402261]]]; function fixDiaoyuIsland(mapType, region) { - if (mapType === 'china' && region.name === '台湾') { - region.geometries.push({ - type: 'polygon', - exterior: points$2[0] - }); - } + if (mapType === 'china' && region.name === '台湾') { + region.geometries.push({ + type: 'polygon', + exterior: points$2[0] + }); + } } var DEFAULT_NAME_PROPERTY = 'name'; var GeoJSONResource = - /** @class */ - function () { - function GeoJSONResource(mapName, geoJSON, specialAreas) { - this.type = 'geoJSON'; - this._parsedMap = createHashMap(); - this._mapName = mapName; - this._specialAreas = specialAreas; // PENDING: delay the parse to the first usage to rapid up the FMP? - - this._geoJSON = parseInput(geoJSON); - } - /** - * @param nameMap can be null/undefined - * @param nameProperty can be null/undefined - */ + /** @class */ + function () { + function GeoJSONResource(mapName, geoJSON, specialAreas) { + this.type = 'geoJSON'; + this._parsedMap = createHashMap(); + this._mapName = mapName; + this._specialAreas = specialAreas; // PENDING: delay the parse to the first usage to rapid up the FMP? + + this._geoJSON = parseInput(geoJSON); + } + /** + * @param nameMap can be null/undefined + * @param nameProperty can be null/undefined + */ - GeoJSONResource.prototype.load = function (nameMap, nameProperty) { - nameProperty = nameProperty || DEFAULT_NAME_PROPERTY; + GeoJSONResource.prototype.load = function (nameMap, nameProperty) { + nameProperty = nameProperty || DEFAULT_NAME_PROPERTY; - var parsed = this._parsedMap.get(nameProperty); + var parsed = this._parsedMap.get(nameProperty); - if (!parsed) { - var rawRegions = this._parseToRegions(nameProperty); + if (!parsed) { + var rawRegions = this._parseToRegions(nameProperty); - parsed = this._parsedMap.set(nameProperty, { - regions: rawRegions, - boundingRect: calculateBoundingRect(rawRegions) - }); - } + parsed = this._parsedMap.set(nameProperty, { + regions: rawRegions, + boundingRect: calculateBoundingRect(rawRegions) + }); + } - var regionsMap = createHashMap(); - var finalRegions = []; - each(parsed.regions, function (region) { - var regionName = region.name; // Try use the alias in geoNameMap + var regionsMap = createHashMap(); + var finalRegions = []; + each(parsed.regions, function (region) { + var regionName = region.name; // Try use the alias in geoNameMap - if (nameMap && hasOwn(nameMap, regionName)) { - region = region.cloneShallow(regionName = nameMap[regionName]); - } + if (nameMap && hasOwn(nameMap, regionName)) { + region = region.cloneShallow(regionName = nameMap[regionName]); + } - finalRegions.push(region); - regionsMap.set(regionName, region); - }); - return { - regions: finalRegions, - boundingRect: parsed.boundingRect || new BoundingRect(0, 0, 0, 0), - regionsMap: regionsMap - }; - }; + finalRegions.push(region); + regionsMap.set(regionName, region); + }); + return { + regions: finalRegions, + boundingRect: parsed.boundingRect || new BoundingRect(0, 0, 0, 0), + regionsMap: regionsMap + }; + }; - GeoJSONResource.prototype._parseToRegions = function (nameProperty) { - var mapName = this._mapName; - var geoJSON = this._geoJSON; - var rawRegions; // https://jsperf.com/try-catch-performance-overhead + GeoJSONResource.prototype._parseToRegions = function (nameProperty) { + var mapName = this._mapName; + var geoJSON = this._geoJSON; + var rawRegions; // https://jsperf.com/try-catch-performance-overhead - try { - rawRegions = geoJSON ? parseGeoJSON(geoJSON, nameProperty) : []; - } catch (e) { - throw new Error('Invalid geoJson format\n' + e.message); - } + try { + rawRegions = geoJSON ? parseGeoJSON(geoJSON, nameProperty) : []; + } catch (e) { + throw new Error('Invalid geoJson format\n' + e.message); + } - fixNanhai(mapName, rawRegions); - each(rawRegions, function (region) { - var regionName = region.name; - fixTextCoords(mapName, region); - fixDiaoyuIsland(mapName, region); // Some area like Alaska in USA map needs to be tansformed - // to look better + fixNanhai(mapName, rawRegions); + each(rawRegions, function (region) { + var regionName = region.name; + fixTextCoords(mapName, region); + fixDiaoyuIsland(mapName, region); // Some area like Alaska in USA map needs to be tansformed + // to look better - var specialArea = this._specialAreas && this._specialAreas[regionName]; + var specialArea = this._specialAreas && this._specialAreas[regionName]; - if (specialArea) { - region.transformTo(specialArea.left, specialArea.top, specialArea.width, specialArea.height); - } - }, this); - return rawRegions; - }; - /** - * Only for exporting to users. - * **MUST NOT** used internally. - */ + if (specialArea) { + region.transformTo(specialArea.left, specialArea.top, specialArea.width, specialArea.height); + } + }, this); + return rawRegions; + }; + /** + * Only for exporting to users. + * **MUST NOT** used internally. + */ - GeoJSONResource.prototype.getMapForUser = function () { - return { - // For backward compatibility, use geoJson - // PENDING: it has been returning them without clone. - // do we need to avoid outsite modification? - geoJson: this._geoJSON, - geoJSON: this._geoJSON, - specialAreas: this._specialAreas - }; - }; + GeoJSONResource.prototype.getMapForUser = function () { + return { + // For backward compatibility, use geoJson + // PENDING: it has been returning them without clone. + // do we need to avoid outsite modification? + geoJson: this._geoJSON, + geoJSON: this._geoJSON, + specialAreas: this._specialAreas + }; + }; - return GeoJSONResource; - }(); + return GeoJSONResource; + }(); function calculateBoundingRect(regions) { - var rect; + var rect; - for (var i = 0; i < regions.length; i++) { - var regionRect = regions[i].getBoundingRect(); - rect = rect || regionRect.clone(); - rect.union(regionRect); - } + for (var i = 0; i < regions.length; i++) { + var regionRect = regions[i].getBoundingRect(); + rect = rect || regionRect.clone(); + rect.union(regionRect); + } - return rect; + return rect; } function parseInput(source) { - return !isString(source) ? source : typeof JSON !== 'undefined' && JSON.parse ? JSON.parse(source) : new Function('return (' + source + ');')(); + return !isString(source) ? source : typeof JSON !== 'undefined' && JSON.parse ? JSON.parse(source) : new Function('return (' + source + ');')(); } var storage = createHashMap(); var geoSourceManager = { - /** - * Compatible with previous `echarts.registerMap`. - * - * @usage - * ```js - * - * echarts.registerMap('USA', geoJson, specialAreas); - * - * echarts.registerMap('USA', { - * geoJson: geoJson, - * specialAreas: {...} - * }); - * echarts.registerMap('USA', { - * geoJSON: geoJson, - * specialAreas: {...} - * }); - * - * echarts.registerMap('airport', { - * svg: svg - * } - * ``` - * - * Note: - * Do not support that register multiple geoJSON or SVG - * one map name. Because different geoJSON and SVG have - * different unit. It's not easy to make sure how those - * units are mapping/normalize. - * If intending to use multiple geoJSON or SVG, we can - * use multiple geo coordinate system. - */ - registerMap: function (mapName, rawDef, rawSpecialAreas) { - if (rawDef.svg) { - var resource = new GeoSVGResource(mapName, rawDef.svg); - storage.set(mapName, resource); - } else { - // Recommend: - // echarts.registerMap('eu', { geoJSON: xxx, specialAreas: xxx }); - // Backward compatibility: - // echarts.registerMap('eu', geoJSON, specialAreas); - // echarts.registerMap('eu', { geoJson: xxx, specialAreas: xxx }); - var geoJSON = rawDef.geoJson || rawDef.geoJSON; - - if (geoJSON && !rawDef.features) { - rawSpecialAreas = rawDef.specialAreas; - } else { - geoJSON = rawDef; - } - - var resource = new GeoJSONResource(mapName, geoJSON, rawSpecialAreas); - storage.set(mapName, resource); - } - }, - getGeoResource: function (mapName) { - return storage.get(mapName); - }, - - /** - * Only for exporting to users. - * **MUST NOT** used internally. - */ - getMapForUser: function (mapName) { - var resource = storage.get(mapName); // Do not support return SVG until some real requirement come. - - return resource && resource.type === 'geoJSON' && resource.getMapForUser(); - }, - load: function (mapName, nameMap, nameProperty) { - var resource = storage.get(mapName); + /** + * Compatible with previous `echarts.registerMap`. + * + * @usage + * ```js + * + * echarts.registerMap('USA', geoJson, specialAreas); + * + * echarts.registerMap('USA', { + * geoJson: geoJson, + * specialAreas: {...} + * }); + * echarts.registerMap('USA', { + * geoJSON: geoJson, + * specialAreas: {...} + * }); + * + * echarts.registerMap('airport', { + * svg: svg + * } + * ``` + * + * Note: + * Do not support that register multiple geoJSON or SVG + * one map name. Because different geoJSON and SVG have + * different unit. It's not easy to make sure how those + * units are mapping/normalize. + * If intending to use multiple geoJSON or SVG, we can + * use multiple geo coordinate system. + */ + registerMap: function (mapName, rawDef, rawSpecialAreas) { + if (rawDef.svg) { + var resource = new GeoSVGResource(mapName, rawDef.svg); + storage.set(mapName, resource); + } else { + // Recommend: + // echarts.registerMap('eu', { geoJSON: xxx, specialAreas: xxx }); + // Backward compatibility: + // echarts.registerMap('eu', geoJSON, specialAreas); + // echarts.registerMap('eu', { geoJson: xxx, specialAreas: xxx }); + var geoJSON = rawDef.geoJson || rawDef.geoJSON; + + if (geoJSON && !rawDef.features) { + rawSpecialAreas = rawDef.specialAreas; + } else { + geoJSON = rawDef; + } + + var resource = new GeoJSONResource(mapName, geoJSON, rawSpecialAreas); + storage.set(mapName, resource); + } + }, + getGeoResource: function (mapName) { + return storage.get(mapName); + }, + + /** + * Only for exporting to users. + * **MUST NOT** used internally. + */ + getMapForUser: function (mapName) { + var resource = storage.get(mapName); // Do not support return SVG until some real requirement come. - if (!resource) { - if ("development" !== 'production') { - console.error('Map ' + mapName + ' not exists. The GeoJSON of the map must be provided.'); - } + return resource && resource.type === 'geoJSON' && resource.getMapForUser(); + }, + load: function (mapName, nameMap, nameProperty) { + var resource = storage.get(mapName); - return; - } + if (!resource) { + if ("development" !== 'production') { + console.error('Map ' + mapName + ' not exists. The GeoJSON of the map must be provided.'); + } - return resource.load(nameMap, nameProperty); + return; } + + return resource.load(nameMap, nameProperty); + } }; /** @@ -51797,1631 +51797,1631 @@ var mapLabelRaw = makeInner(); function getFixedItemStyle(model) { - var itemStyle = model.getItemStyle(); - var areaColor = model.get('areaColor'); // If user want the color not to be changed when hover, - // they should both set areaColor and color to be null. + var itemStyle = model.getItemStyle(); + var areaColor = model.get('areaColor'); // If user want the color not to be changed when hover, + // they should both set areaColor and color to be null. - if (areaColor != null) { - itemStyle.fill = areaColor; - } + if (areaColor != null) { + itemStyle.fill = areaColor; + } - return itemStyle; + return itemStyle; } // Only stroke can be used for line. // Using fill in style if stroke not exits. // TODO Not sure yet. Perhaps a separate `lineStyle`? function fixLineStyle(styleHost) { - var style = styleHost.style; + var style = styleHost.style; - if (style) { - style.stroke = style.stroke || style.fill; - style.fill = null; - } + if (style) { + style.stroke = style.stroke || style.fill; + style.fill = null; + } } var MapDraw = - /** @class */ - function () { - function MapDraw(api) { - var group = new Group(); - this.uid = getUID('ec_map_draw'); - this._controller = new RoamController(api.getZr()); - this._controllerHost = { - target: group - }; - this.group = group; - group.add(this._regionsGroup = new Group()); - group.add(this._svgGroup = new Group()); - } - - MapDraw.prototype.draw = function (mapOrGeoModel, ecModel, api, fromView, payload) { - var isGeo = mapOrGeoModel.mainType === 'geo'; // Map series has data. GEO model that controlled by map series - // will be assigned with map data. Other GEO model has no data. - - var data = mapOrGeoModel.getData && mapOrGeoModel.getData(); - isGeo && ecModel.eachComponent({ - mainType: 'series', - subType: 'map' - }, function (mapSeries) { - if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) { - data = mapSeries.getData(); - } - }); - var geo = mapOrGeoModel.coordinateSystem; - var regionsGroup = this._regionsGroup; - var group = this.group; - var transformInfo = geo.getTransformInfo(); - var transformInfoRaw = transformInfo.raw; - var transformInfoRoam = transformInfo.roam; // No animation when first draw or in action - - var isFirstDraw = !regionsGroup.childAt(0) || payload; - - if (isFirstDraw) { - group.x = transformInfoRoam.x; - group.y = transformInfoRoam.y; - group.scaleX = transformInfoRoam.scaleX; - group.scaleY = transformInfoRoam.scaleY; - group.dirty(); - } else { - updateProps(group, transformInfoRoam, mapOrGeoModel); - } - - var isVisualEncodedByVisualMap = data && data.getVisual('visualMeta') && data.getVisual('visualMeta').length > 0; - var viewBuildCtx = { - api: api, - geo: geo, - mapOrGeoModel: mapOrGeoModel, - data: data, - isVisualEncodedByVisualMap: isVisualEncodedByVisualMap, - isGeo: isGeo, - transformInfoRaw: transformInfoRaw - }; - - if (geo.resourceType === 'geoJSON') { - this._buildGeoJSON(viewBuildCtx); - } else if (geo.resourceType === 'geoSVG') { - this._buildSVG(viewBuildCtx); - } - - this._updateController(mapOrGeoModel, ecModel, api); - - this._updateMapSelectHandler(mapOrGeoModel, regionsGroup, api, fromView); - }; - - MapDraw.prototype._buildGeoJSON = function (viewBuildCtx) { - var regionsGroupByName = this._regionsGroupByName = createHashMap(); - var regionsInfoByName = createHashMap(); - var regionsGroup = this._regionsGroup; - var transformInfoRaw = viewBuildCtx.transformInfoRaw; - var mapOrGeoModel = viewBuildCtx.mapOrGeoModel; - var data = viewBuildCtx.data; - var projection = viewBuildCtx.geo.projection; - var projectionStream = projection && projection.stream; - - function transformPoint(point, project) { - if (project) { - // projection may return null point. - point = project(point); - } + /** @class */ + function () { + function MapDraw(api) { + var group = new Group(); + this.uid = getUID('ec_map_draw'); + this._controller = new RoamController(api.getZr()); + this._controllerHost = { + target: group + }; + this.group = group; + group.add(this._regionsGroup = new Group()); + group.add(this._svgGroup = new Group()); + } + + MapDraw.prototype.draw = function (mapOrGeoModel, ecModel, api, fromView, payload) { + var isGeo = mapOrGeoModel.mainType === 'geo'; // Map series has data. GEO model that controlled by map series + // will be assigned with map data. Other GEO model has no data. + + var data = mapOrGeoModel.getData && mapOrGeoModel.getData(); + isGeo && ecModel.eachComponent({ + mainType: 'series', + subType: 'map' + }, function (mapSeries) { + if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) { + data = mapSeries.getData(); + } + }); + var geo = mapOrGeoModel.coordinateSystem; + var regionsGroup = this._regionsGroup; + var group = this.group; + var transformInfo = geo.getTransformInfo(); + var transformInfoRaw = transformInfo.raw; + var transformInfoRoam = transformInfo.roam; // No animation when first draw or in action + + var isFirstDraw = !regionsGroup.childAt(0) || payload; + + if (isFirstDraw) { + group.x = transformInfoRoam.x; + group.y = transformInfoRoam.y; + group.scaleX = transformInfoRoam.scaleX; + group.scaleY = transformInfoRoam.scaleY; + group.dirty(); + } else { + updateProps(group, transformInfoRoam, mapOrGeoModel); + } - return point && [point[0] * transformInfoRaw.scaleX + transformInfoRaw.x, point[1] * transformInfoRaw.scaleY + transformInfoRaw.y]; - } + var isVisualEncodedByVisualMap = data && data.getVisual('visualMeta') && data.getVisual('visualMeta').length > 0; + var viewBuildCtx = { + api: api, + geo: geo, + mapOrGeoModel: mapOrGeoModel, + data: data, + isVisualEncodedByVisualMap: isVisualEncodedByVisualMap, + isGeo: isGeo, + transformInfoRaw: transformInfoRaw + }; - function transformPolygonPoints(inPoints) { - var outPoints = []; // If projectionStream is provided. Use it instead of single point project. + if (geo.resourceType === 'geoJSON') { + this._buildGeoJSON(viewBuildCtx); + } else if (geo.resourceType === 'geoSVG') { + this._buildSVG(viewBuildCtx); + } - var project = !projectionStream && projection && projection.project; + this._updateController(mapOrGeoModel, ecModel, api); - for (var i = 0; i < inPoints.length; ++i) { - var newPt = transformPoint(inPoints[i], project); - newPt && outPoints.push(newPt); - } + this._updateMapSelectHandler(mapOrGeoModel, regionsGroup, api, fromView); + }; - return outPoints; - } + MapDraw.prototype._buildGeoJSON = function (viewBuildCtx) { + var regionsGroupByName = this._regionsGroupByName = createHashMap(); + var regionsInfoByName = createHashMap(); + var regionsGroup = this._regionsGroup; + var transformInfoRaw = viewBuildCtx.transformInfoRaw; + var mapOrGeoModel = viewBuildCtx.mapOrGeoModel; + var data = viewBuildCtx.data; + var projection = viewBuildCtx.geo.projection; + var projectionStream = projection && projection.stream; - function getPolyShape(points) { - return { - shape: { - points: transformPolygonPoints(points) - } - }; - } + function transformPoint(point, project) { + if (project) { + // projection may return null point. + point = project(point); + } - regionsGroup.removeAll(); // Only when the resource is GeoJSON, there is `geo.regions`. + return point && [point[0] * transformInfoRaw.scaleX + transformInfoRaw.x, point[1] * transformInfoRaw.scaleY + transformInfoRaw.y]; + } - each(viewBuildCtx.geo.regions, function (region) { - var regionName = region.name; // Consider in GeoJson properties.name may be duplicated, for example, - // there is multiple region named "United Kindom" or "France" (so many - // colonies). And it is not appropriate to merge them in geo, which - // will make them share the same label and bring trouble in label - // location calculation. + function transformPolygonPoints(inPoints) { + var outPoints = []; // If projectionStream is provided. Use it instead of single point project. - var regionGroup = regionsGroupByName.get(regionName); + var project = !projectionStream && projection && projection.project; - var _a = regionsInfoByName.get(regionName) || {}, - dataIdx = _a.dataIdx, - regionModel = _a.regionModel; + for (var i = 0; i < inPoints.length; ++i) { + var newPt = transformPoint(inPoints[i], project); + newPt && outPoints.push(newPt); + } - if (!regionGroup) { - regionGroup = regionsGroupByName.set(regionName, new Group()); - regionsGroup.add(regionGroup); - dataIdx = data ? data.indexOfName(regionName) : null; - regionModel = viewBuildCtx.isGeo ? mapOrGeoModel.getRegionModel(regionName) : data ? data.getItemModel(dataIdx) : null; - regionsInfoByName.set(regionName, { - dataIdx: dataIdx, - regionModel: regionModel - }); - } + return outPoints; + } - var polygonSubpaths = []; - var polylineSubpaths = []; - each(region.geometries, function (geometry) { - // Polygon and MultiPolygon - if (geometry.type === 'polygon') { - var polys = [geometry.exterior].concat(geometry.interiors || []); + function getPolyShape(points) { + return { + shape: { + points: transformPolygonPoints(points) + } + }; + } - if (projectionStream) { - polys = projectPolys(polys, projectionStream); - } + regionsGroup.removeAll(); // Only when the resource is GeoJSON, there is `geo.regions`. - each(polys, function (poly) { - polygonSubpaths.push(new Polygon(getPolyShape(poly))); - }); - } // LineString and MultiLineString - else { - var points = geometry.points; + each(viewBuildCtx.geo.regions, function (region) { + var regionName = region.name; // Consider in GeoJson properties.name may be duplicated, for example, + // there is multiple region named "United Kindom" or "France" (so many + // colonies). And it is not appropriate to merge them in geo, which + // will make them share the same label and bring trouble in label + // location calculation. - if (projectionStream) { - points = projectPolys(points, projectionStream, true); - } + var regionGroup = regionsGroupByName.get(regionName); - each(points, function (points) { - polylineSubpaths.push(new Polyline(getPolyShape(points))); - }); - } - }); - var centerPt = transformPoint(region.getCenter(), projection && projection.project); + var _a = regionsInfoByName.get(regionName) || {}, + dataIdx = _a.dataIdx, + regionModel = _a.regionModel; - function createCompoundPath(subpaths, isLine) { - if (!subpaths.length) { - return; - } + if (!regionGroup) { + regionGroup = regionsGroupByName.set(regionName, new Group()); + regionsGroup.add(regionGroup); + dataIdx = data ? data.indexOfName(regionName) : null; + regionModel = viewBuildCtx.isGeo ? mapOrGeoModel.getRegionModel(regionName) : data ? data.getItemModel(dataIdx) : null; + regionsInfoByName.set(regionName, { + dataIdx: dataIdx, + regionModel: regionModel + }); + } + + var polygonSubpaths = []; + var polylineSubpaths = []; + each(region.geometries, function (geometry) { + // Polygon and MultiPolygon + if (geometry.type === 'polygon') { + var polys = [geometry.exterior].concat(geometry.interiors || []); + + if (projectionStream) { + polys = projectPolys(polys, projectionStream); + } + + each(polys, function (poly) { + polygonSubpaths.push(new Polygon(getPolyShape(poly))); + }); + } // LineString and MultiLineString + else { + var points = geometry.points; - var compoundPath = new CompoundPath({ - culling: true, - segmentIgnoreThreshold: 1, - shape: { - paths: subpaths - } - }); - regionGroup.add(compoundPath); - applyOptionStyleForRegion(viewBuildCtx, compoundPath, dataIdx, regionModel); - resetLabelForRegion(viewBuildCtx, compoundPath, regionName, regionModel, mapOrGeoModel, dataIdx, centerPt); + if (projectionStream) { + points = projectPolys(points, projectionStream, true); + } - if (isLine) { - fixLineStyle(compoundPath); - each(compoundPath.states, fixLineStyle); - } - } + each(points, function (points) { + polylineSubpaths.push(new Polyline(getPolyShape(points))); + }); + } + }); + var centerPt = transformPoint(region.getCenter(), projection && projection.project); - createCompoundPath(polygonSubpaths); - createCompoundPath(polylineSubpaths, true); - }); // Ensure children have been added to `regionGroup` before calling them. + function createCompoundPath(subpaths, isLine) { + if (!subpaths.length) { + return; + } - regionsGroupByName.each(function (regionGroup, regionName) { - var _a = regionsInfoByName.get(regionName), - dataIdx = _a.dataIdx, - regionModel = _a.regionModel; + var compoundPath = new CompoundPath({ + culling: true, + segmentIgnoreThreshold: 1, + shape: { + paths: subpaths + } + }); + regionGroup.add(compoundPath); + applyOptionStyleForRegion(viewBuildCtx, compoundPath, dataIdx, regionModel); + resetLabelForRegion(viewBuildCtx, compoundPath, regionName, regionModel, mapOrGeoModel, dataIdx, centerPt); - resetEventTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel, dataIdx); - resetTooltipForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel); - resetStateTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel); - }, this); - }; + if (isLine) { + fixLineStyle(compoundPath); + each(compoundPath.states, fixLineStyle); + } + } - MapDraw.prototype._buildSVG = function (viewBuildCtx) { - var mapName = viewBuildCtx.geo.map; - var transformInfoRaw = viewBuildCtx.transformInfoRaw; - this._svgGroup.x = transformInfoRaw.x; - this._svgGroup.y = transformInfoRaw.y; - this._svgGroup.scaleX = transformInfoRaw.scaleX; - this._svgGroup.scaleY = transformInfoRaw.scaleY; - - if (this._svgResourceChanged(mapName)) { - this._freeSVG(); - - this._useSVG(mapName); - } - - var svgDispatcherMap = this._svgDispatcherMap = createHashMap(); - var focusSelf = false; - each(this._svgGraphicRecord.named, function (namedItem) { - // Note that we also allow different elements have the same name. - // For example, a glyph of a city and the label of the city have - // the same name and their tooltip info can be defined in a single - // region option. - var regionName = namedItem.name; - var mapOrGeoModel = viewBuildCtx.mapOrGeoModel; - var data = viewBuildCtx.data; - var svgNodeTagLower = namedItem.svgNodeTagLower; - var el = namedItem.el; - var dataIdx = data ? data.indexOfName(regionName) : null; - var regionModel = mapOrGeoModel.getRegionModel(regionName); - - if (OPTION_STYLE_ENABLED_TAG_MAP.get(svgNodeTagLower) != null && el instanceof Displayable) { - applyOptionStyleForRegion(viewBuildCtx, el, dataIdx, regionModel); - } + createCompoundPath(polygonSubpaths); + createCompoundPath(polylineSubpaths, true); + }); // Ensure children have been added to `regionGroup` before calling them. - if (el instanceof Displayable) { - el.culling = true; - } // We do not know how the SVG like so we'd better not to change z2. - // Otherwise it might bring some unexpected result. For example, - // an area hovered that make some inner city can not be clicked. + regionsGroupByName.each(function (regionGroup, regionName) { + var _a = regionsInfoByName.get(regionName), + dataIdx = _a.dataIdx, + regionModel = _a.regionModel; + resetEventTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel, dataIdx); + resetTooltipForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel); + resetStateTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel); + }, this); + }; - el.z2EmphasisLift = 0; // If self named: + MapDraw.prototype._buildSVG = function (viewBuildCtx) { + var mapName = viewBuildCtx.geo.map; + var transformInfoRaw = viewBuildCtx.transformInfoRaw; + this._svgGroup.x = transformInfoRaw.x; + this._svgGroup.y = transformInfoRaw.y; + this._svgGroup.scaleX = transformInfoRaw.scaleX; + this._svgGroup.scaleY = transformInfoRaw.scaleY; - if (!namedItem.namedFrom) { - // label should batter to be displayed based on the center of - // if it is named rather than displayed on each child. - if (LABEL_HOST_MAP.get(svgNodeTagLower) != null) { - resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx, null); - } + if (this._svgResourceChanged(mapName)) { + this._freeSVG(); - resetEventTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx); - resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel); + this._useSVG(mapName); + } - if (STATE_TRIGGER_TAG_MAP.get(svgNodeTagLower) != null) { - var focus_1 = resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel); + var svgDispatcherMap = this._svgDispatcherMap = createHashMap(); + var focusSelf = false; + each(this._svgGraphicRecord.named, function (namedItem) { + // Note that we also allow different elements have the same name. + // For example, a glyph of a city and the label of the city have + // the same name and their tooltip info can be defined in a single + // region option. + var regionName = namedItem.name; + var mapOrGeoModel = viewBuildCtx.mapOrGeoModel; + var data = viewBuildCtx.data; + var svgNodeTagLower = namedItem.svgNodeTagLower; + var el = namedItem.el; + var dataIdx = data ? data.indexOfName(regionName) : null; + var regionModel = mapOrGeoModel.getRegionModel(regionName); - if (focus_1 === 'self') { - focusSelf = true; - } + if (OPTION_STYLE_ENABLED_TAG_MAP.get(svgNodeTagLower) != null && el instanceof Displayable) { + applyOptionStyleForRegion(viewBuildCtx, el, dataIdx, regionModel); + } - var els = svgDispatcherMap.get(regionName) || svgDispatcherMap.set(regionName, []); - els.push(el); - } - } - }, this); + if (el instanceof Displayable) { + el.culling = true; + } // We do not know how the SVG like so we'd better not to change z2. + // Otherwise it might bring some unexpected result. For example, + // an area hovered that make some inner city can not be clicked. - this._enableBlurEntireSVG(focusSelf, viewBuildCtx); - }; - MapDraw.prototype._enableBlurEntireSVG = function (focusSelf, viewBuildCtx) { - // It's a little complicated to support blurring the entire geoSVG in series-map. - // So do not suport it until some requirements come. - // At present, in series-map, only regions can be blurred. - if (focusSelf && viewBuildCtx.isGeo) { - var blurStyle = viewBuildCtx.mapOrGeoModel.getModel(['blur', 'itemStyle']).getItemStyle(); // Only suport `opacity` here. Because not sure that other props are suitable for - // all of the elements generated by SVG (especially for Text/TSpan/Image/... ). + el.z2EmphasisLift = 0; // If self named: - var opacity_1 = blurStyle.opacity; + if (!namedItem.namedFrom) { + // label should batter to be displayed based on the center of + // if it is named rather than displayed on each child. + if (LABEL_HOST_MAP.get(svgNodeTagLower) != null) { + resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx, null); + } - this._svgGraphicRecord.root.traverse(function (el) { - if (!el.isGroup) { - // PENDING: clear those settings to SVG elements when `_freeSVG`. - // (Currently it happen not to be needed.) - setDefaultStateProxy(el); - var style = el.ensureState('blur').style || {}; // Do not overwrite the region style that already set from region option. + resetEventTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx); + resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel); - if (style.opacity == null && opacity_1 != null) { - style.opacity = opacity_1; - } // If `ensureState('blur').style = {}`, there will be default opacity. - // Enable `stateTransition` (animation). + if (STATE_TRIGGER_TAG_MAP.get(svgNodeTagLower) != null) { + var focus_1 = resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel); + if (focus_1 === 'self') { + focusSelf = true; + } - el.ensureState('emphasis'); - } - }); - } - }; + var els = svgDispatcherMap.get(regionName) || svgDispatcherMap.set(regionName, []); + els.push(el); + } + } + }, this); - MapDraw.prototype.remove = function () { - this._regionsGroup.removeAll(); + this._enableBlurEntireSVG(focusSelf, viewBuildCtx); + }; - this._regionsGroupByName = null; + MapDraw.prototype._enableBlurEntireSVG = function (focusSelf, viewBuildCtx) { + // It's a little complicated to support blurring the entire geoSVG in series-map. + // So do not suport it until some requirements come. + // At present, in series-map, only regions can be blurred. + if (focusSelf && viewBuildCtx.isGeo) { + var blurStyle = viewBuildCtx.mapOrGeoModel.getModel(['blur', 'itemStyle']).getItemStyle(); // Only suport `opacity` here. Because not sure that other props are suitable for + // all of the elements generated by SVG (especially for Text/TSpan/Image/... ). - this._svgGroup.removeAll(); + var opacity_1 = blurStyle.opacity; - this._freeSVG(); + this._svgGraphicRecord.root.traverse(function (el) { + if (!el.isGroup) { + // PENDING: clear those settings to SVG elements when `_freeSVG`. + // (Currently it happen not to be needed.) + setDefaultStateProxy(el); + var style = el.ensureState('blur').style || {}; // Do not overwrite the region style that already set from region option. - this._controller.dispose(); + if (style.opacity == null && opacity_1 != null) { + style.opacity = opacity_1; + } // If `ensureState('blur').style = {}`, there will be default opacity. + // Enable `stateTransition` (animation). - this._controllerHost = null; - }; - MapDraw.prototype.findHighDownDispatchers = function (name, geoModel) { - if (name == null) { - return []; - } + el.ensureState('emphasis'); + } + }); + } + }; - var geo = geoModel.coordinateSystem; + MapDraw.prototype.remove = function () { + this._regionsGroup.removeAll(); - if (geo.resourceType === 'geoJSON') { - var regionsGroupByName = this._regionsGroupByName; + this._regionsGroupByName = null; - if (regionsGroupByName) { - var regionGroup = regionsGroupByName.get(name); - return regionGroup ? [regionGroup] : []; - } - } else if (geo.resourceType === 'geoSVG') { - return this._svgDispatcherMap && this._svgDispatcherMap.get(name) || []; - } - }; + this._svgGroup.removeAll(); - MapDraw.prototype._svgResourceChanged = function (mapName) { - return this._svgMapName !== mapName; - }; + this._freeSVG(); - MapDraw.prototype._useSVG = function (mapName) { - var resource = geoSourceManager.getGeoResource(mapName); + this._controller.dispose(); - if (resource && resource.type === 'geoSVG') { - var svgGraphic = resource.useGraphic(this.uid); + this._controllerHost = null; + }; - this._svgGroup.add(svgGraphic.root); + MapDraw.prototype.findHighDownDispatchers = function (name, geoModel) { + if (name == null) { + return []; + } - this._svgGraphicRecord = svgGraphic; - this._svgMapName = mapName; - } - }; + var geo = geoModel.coordinateSystem; - MapDraw.prototype._freeSVG = function () { - var mapName = this._svgMapName; + if (geo.resourceType === 'geoJSON') { + var regionsGroupByName = this._regionsGroupByName; - if (mapName == null) { - return; - } + if (regionsGroupByName) { + var regionGroup = regionsGroupByName.get(name); + return regionGroup ? [regionGroup] : []; + } + } else if (geo.resourceType === 'geoSVG') { + return this._svgDispatcherMap && this._svgDispatcherMap.get(name) || []; + } + }; - var resource = geoSourceManager.getGeoResource(mapName); + MapDraw.prototype._svgResourceChanged = function (mapName) { + return this._svgMapName !== mapName; + }; - if (resource && resource.type === 'geoSVG') { - resource.freeGraphic(this.uid); - } + MapDraw.prototype._useSVG = function (mapName) { + var resource = geoSourceManager.getGeoResource(mapName); - this._svgGraphicRecord = null; - this._svgDispatcherMap = null; + if (resource && resource.type === 'geoSVG') { + var svgGraphic = resource.useGraphic(this.uid); - this._svgGroup.removeAll(); + this._svgGroup.add(svgGraphic.root); - this._svgMapName = null; - }; + this._svgGraphicRecord = svgGraphic; + this._svgMapName = mapName; + } + }; - MapDraw.prototype._updateController = function (mapOrGeoModel, ecModel, api) { - var geo = mapOrGeoModel.coordinateSystem; - var controller = this._controller; - var controllerHost = this._controllerHost; // @ts-ignore FIXME:TS + MapDraw.prototype._freeSVG = function () { + var mapName = this._svgMapName; - controllerHost.zoomLimit = mapOrGeoModel.get('scaleLimit'); - controllerHost.zoom = geo.getZoom(); // roamType is will be set default true if it is null - // @ts-ignore FIXME:TS + if (mapName == null) { + return; + } - controller.enable(mapOrGeoModel.get('roam') || false); - var mainType = mapOrGeoModel.mainType; + var resource = geoSourceManager.getGeoResource(mapName); - function makeActionBase() { - var action = { - type: 'geoRoam', - componentType: mainType - }; - action[mainType + 'Id'] = mapOrGeoModel.id; - return action; - } - - controller.off('pan').on('pan', function (e) { - this._mouseDownFlag = false; - updateViewOnPan(controllerHost, e.dx, e.dy); - api.dispatchAction(extend(makeActionBase(), { - dx: e.dx, - dy: e.dy, - animation: { - duration: 0 - } - })); - }, this); - controller.off('zoom').on('zoom', function (e) { - this._mouseDownFlag = false; - updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY); - api.dispatchAction(extend(makeActionBase(), { - zoom: e.scale, - originX: e.originX, - originY: e.originY, - animation: { - duration: 0 - } - })); - }, this); - controller.setPointerChecker(function (e, x, y) { - return geo.containPoint([x, y]) && !onIrrelevantElement(e, api, mapOrGeoModel); - }); - }; - /** - * FIXME: this is a temporarily workaround. - * When `geoRoam` the elements need to be reset in `MapView['render']`, because the props like - * `ignore` might have been modified by `LabelManager`, and `LabelManager#addLabelsOfSeries` - * will subsequently cache `defaultAttr` like `ignore`. If do not do this reset, the modified - * props will have no chance to be restored. - * Note: this reset should be after `clearStates` in `renderSeries` becuase `useStates` in - * `renderSeries` will cache the modified `ignore` to `el._normalState`. - * TODO: - * Use clone/immutable in `LabelManager`? - */ + if (resource && resource.type === 'geoSVG') { + resource.freeGraphic(this.uid); + } + this._svgGraphicRecord = null; + this._svgDispatcherMap = null; - MapDraw.prototype.resetForLabelLayout = function () { - this.group.traverse(function (el) { - var label = el.getTextContent(); + this._svgGroup.removeAll(); - if (label) { - label.ignore = mapLabelRaw(label).ignore; - } - }); - }; + this._svgMapName = null; + }; - MapDraw.prototype._updateMapSelectHandler = function (mapOrGeoModel, regionsGroup, api, fromView) { - var mapDraw = this; - regionsGroup.off('mousedown'); - regionsGroup.off('click'); // @ts-ignore FIXME:TS resolve type conflict + MapDraw.prototype._updateController = function (mapOrGeoModel, ecModel, api) { + var geo = mapOrGeoModel.coordinateSystem; + var controller = this._controller; + var controllerHost = this._controllerHost; // @ts-ignore FIXME:TS - if (mapOrGeoModel.get('selectedMode')) { - regionsGroup.on('mousedown', function () { - mapDraw._mouseDownFlag = true; - }); - regionsGroup.on('click', function (e) { - if (!mapDraw._mouseDownFlag) { - return; - } + controllerHost.zoomLimit = mapOrGeoModel.get('scaleLimit'); + controllerHost.zoom = geo.getZoom(); // roamType is will be set default true if it is null + // @ts-ignore FIXME:TS - mapDraw._mouseDownFlag = false; - }); - } - }; + controller.enable(mapOrGeoModel.get('roam') || false); + var mainType = mapOrGeoModel.mainType; - return MapDraw; - }(); + function makeActionBase() { + var action = { + type: 'geoRoam', + componentType: mainType + }; + action[mainType + 'Id'] = mapOrGeoModel.id; + return action; + } + + controller.off('pan').on('pan', function (e) { + this._mouseDownFlag = false; + updateViewOnPan(controllerHost, e.dx, e.dy); + api.dispatchAction(extend(makeActionBase(), { + dx: e.dx, + dy: e.dy, + animation: { + duration: 0 + } + })); + }, this); + controller.off('zoom').on('zoom', function (e) { + this._mouseDownFlag = false; + updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY); + api.dispatchAction(extend(makeActionBase(), { + zoom: e.scale, + originX: e.originX, + originY: e.originY, + animation: { + duration: 0 + } + })); + }, this); + controller.setPointerChecker(function (e, x, y) { + return geo.containPoint([x, y]) && !onIrrelevantElement(e, api, mapOrGeoModel); + }); + }; + /** + * FIXME: this is a temporarily workaround. + * When `geoRoam` the elements need to be reset in `MapView['render']`, because the props like + * `ignore` might have been modified by `LabelManager`, and `LabelManager#addLabelsOfSeries` + * will subsequently cache `defaultAttr` like `ignore`. If do not do this reset, the modified + * props will have no chance to be restored. + * Note: this reset should be after `clearStates` in `renderSeries` becuase `useStates` in + * `renderSeries` will cache the modified `ignore` to `el._normalState`. + * TODO: + * Use clone/immutable in `LabelManager`? + */ - function applyOptionStyleForRegion(viewBuildCtx, el, dataIndex, regionModel) { - // All of the path are using `itemStyle`, becuase - // (1) Some SVG also use fill on polyline (The different between - // polyline and polygon is "open" or "close" but not fill or not). - // (2) For the common props like opacity, if some use itemStyle - // and some use `lineStyle`, it might confuse users. - // (3) Most SVG use , where can not detect wether draw a "line" - // or a filled shape, so use `itemStyle` for . - var normalStyleModel = regionModel.getModel('itemStyle'); - var emphasisStyleModel = regionModel.getModel(['emphasis', 'itemStyle']); - var blurStyleModel = regionModel.getModel(['blur', 'itemStyle']); - var selectStyleModel = regionModel.getModel(['select', 'itemStyle']); // NOTE: DONT use 'style' in visual when drawing map. - // This component is used for drawing underlying map for both geo component and map series. - - var normalStyle = getFixedItemStyle(normalStyleModel); - var emphasisStyle = getFixedItemStyle(emphasisStyleModel); - var selectStyle = getFixedItemStyle(selectStyleModel); - var blurStyle = getFixedItemStyle(blurStyleModel); // Update the itemStyle if has data visual - var data = viewBuildCtx.data; + MapDraw.prototype.resetForLabelLayout = function () { + this.group.traverse(function (el) { + var label = el.getTextContent(); - if (data) { - // Only visual color of each item will be used. It can be encoded by visualMap - // But visual color of series is used in symbol drawing - // Visual color for each series is for the symbol draw - var style = data.getItemVisual(dataIndex, 'style'); - var decal = data.getItemVisual(dataIndex, 'decal'); + if (label) { + label.ignore = mapLabelRaw(label).ignore; + } + }); + }; - if (viewBuildCtx.isVisualEncodedByVisualMap && style.fill) { - normalStyle.fill = style.fill; - } + MapDraw.prototype._updateMapSelectHandler = function (mapOrGeoModel, regionsGroup, api, fromView) { + var mapDraw = this; + regionsGroup.off('mousedown'); + regionsGroup.off('click'); // @ts-ignore FIXME:TS resolve type conflict - if (decal) { - normalStyle.decal = createOrUpdatePatternFromDecal(decal, viewBuildCtx.api); + if (mapOrGeoModel.get('selectedMode')) { + regionsGroup.on('mousedown', function () { + mapDraw._mouseDownFlag = true; + }); + regionsGroup.on('click', function (e) { + if (!mapDraw._mouseDownFlag) { + return; } - } // SVG text, tspan and image can be named but not supporeted - // to be styled by region option yet. + mapDraw._mouseDownFlag = false; + }); + } + }; - el.setStyle(normalStyle); - el.style.strokeNoScale = true; - el.ensureState('emphasis').style = emphasisStyle; - el.ensureState('select').style = selectStyle; - el.ensureState('blur').style = blurStyle; // Enable blur + return MapDraw; + }(); - setDefaultStateProxy(el); - } + function applyOptionStyleForRegion(viewBuildCtx, el, dataIndex, regionModel) { + // All of the path are using `itemStyle`, becuase + // (1) Some SVG also use fill on polyline (The different between + // polyline and polygon is "open" or "close" but not fill or not). + // (2) For the common props like opacity, if some use itemStyle + // and some use `lineStyle`, it might confuse users. + // (3) Most SVG use , where can not detect wether draw a "line" + // or a filled shape, so use `itemStyle` for . + var normalStyleModel = regionModel.getModel('itemStyle'); + var emphasisStyleModel = regionModel.getModel(['emphasis', 'itemStyle']); + var blurStyleModel = regionModel.getModel(['blur', 'itemStyle']); + var selectStyleModel = regionModel.getModel(['select', 'itemStyle']); // NOTE: DONT use 'style' in visual when drawing map. + // This component is used for drawing underlying map for both geo component and map series. + + var normalStyle = getFixedItemStyle(normalStyleModel); + var emphasisStyle = getFixedItemStyle(emphasisStyleModel); + var selectStyle = getFixedItemStyle(selectStyleModel); + var blurStyle = getFixedItemStyle(blurStyleModel); // Update the itemStyle if has data visual + + var data = viewBuildCtx.data; + + if (data) { + // Only visual color of each item will be used. It can be encoded by visualMap + // But visual color of series is used in symbol drawing + // Visual color for each series is for the symbol draw + var style = data.getItemVisual(dataIndex, 'style'); + var decal = data.getItemVisual(dataIndex, 'decal'); - function resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, // Exist only if `viewBuildCtx.data` exists. - dataIdx, // If labelXY not provided, use `textConfig.position: 'inside'` - labelXY) { - var data = viewBuildCtx.data; - var isGeo = viewBuildCtx.isGeo; - var isDataNaN = data && isNaN(data.get(data.mapDimension('value'), dataIdx)); - var itemLayout = data && data.getItemLayout(dataIdx); // In the following cases label will be drawn - // 1. In map series and data value is NaN - // 2. In geo component - // 3. Region has no series legendIcon, which will be add a showLabel flag in mapSymbolLayout - - if (isGeo || isDataNaN || itemLayout && itemLayout.showLabel) { - var query = !isGeo ? dataIdx : regionName; - var labelFetcher = void 0; // Consider dataIdx not found. - - if (!data || dataIdx >= 0) { - labelFetcher = mapOrGeoModel; - } - - var specifiedTextOpt = labelXY ? { - normal: { - align: 'center', - verticalAlign: 'middle' - } - } : null; // Caveat: must be called after `setDefaultStateProxy(el);` called. - // because textContent will be assign with `el.stateProxy` inside. - - setLabelStyle(el, getLabelStatesModels(regionModel), { - labelFetcher: labelFetcher, - labelDataIndex: query, - defaultText: regionName - }, specifiedTextOpt); - var textEl = el.getTextContent(); + if (viewBuildCtx.isVisualEncodedByVisualMap && style.fill) { + normalStyle.fill = style.fill; + } - if (textEl) { - mapLabelRaw(textEl).ignore = textEl.ignore; + if (decal) { + normalStyle.decal = createOrUpdatePatternFromDecal(decal, viewBuildCtx.api); + } + } // SVG text, tspan and image can be named but not supporeted + // to be styled by region option yet. - if (el.textConfig && labelXY) { - // Compute a relative offset based on the el bounding rect. - var rect = el.getBoundingRect().clone(); // Need to make sure the percent position base on the same rect in normal and - // emphasis state. Otherwise if using boundingRect of el, but the emphasis state - // has borderWidth (even 0.5px), the text position will be changed obviously - // if the position is very big like ['1234%', '1345%']. - el.textConfig.layoutRect = rect; - el.textConfig.position = [(labelXY[0] - rect.x) / rect.width * 100 + '%', (labelXY[1] - rect.y) / rect.height * 100 + '%']; - } - } // PENDING: - // If labelLayout is enabled (test/label-layout.html), el.dataIndex should be specified. - // But el.dataIndex is also used to determine whether user event should be triggered, - // where el.seriesIndex or el.dataModel must be specified. At present for a single el - // there is not case that "only label layout enabled but user event disabled", so here - // we depends `resetEventTriggerForRegion` to do the job of setting `el.dataIndex`. + el.setStyle(normalStyle); + el.style.strokeNoScale = true; + el.ensureState('emphasis').style = emphasisStyle; + el.ensureState('select').style = selectStyle; + el.ensureState('blur').style = blurStyle; // Enable blur + setDefaultStateProxy(el); + } - el.disableLabelAnimation = true; - } else { - el.removeTextContent(); - el.removeTextConfig(); - el.disableLabelAnimation = null; - } + function resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, // Exist only if `viewBuildCtx.data` exists. + dataIdx, // If labelXY not provided, use `textConfig.position: 'inside'` + labelXY) { + var data = viewBuildCtx.data; + var isGeo = viewBuildCtx.isGeo; + var isDataNaN = data && isNaN(data.get(data.mapDimension('value'), dataIdx)); + var itemLayout = data && data.getItemLayout(dataIdx); // In the following cases label will be drawn + // 1. In map series and data value is NaN + // 2. In geo component + // 3. Region has no series legendIcon, which will be add a showLabel flag in mapSymbolLayout + + if (isGeo || isDataNaN || itemLayout && itemLayout.showLabel) { + var query = !isGeo ? dataIdx : regionName; + var labelFetcher = void 0; // Consider dataIdx not found. + + if (!data || dataIdx >= 0) { + labelFetcher = mapOrGeoModel; + } + + var specifiedTextOpt = labelXY ? { + normal: { + align: 'center', + verticalAlign: 'middle' + } + } : null; // Caveat: must be called after `setDefaultStateProxy(el);` called. + // because textContent will be assign with `el.stateProxy` inside. + + setLabelStyle(el, getLabelStatesModels(regionModel), { + labelFetcher: labelFetcher, + labelDataIndex: query, + defaultText: regionName + }, specifiedTextOpt); + var textEl = el.getTextContent(); + + if (textEl) { + mapLabelRaw(textEl).ignore = textEl.ignore; + + if (el.textConfig && labelXY) { + // Compute a relative offset based on the el bounding rect. + var rect = el.getBoundingRect().clone(); // Need to make sure the percent position base on the same rect in normal and + // emphasis state. Otherwise if using boundingRect of el, but the emphasis state + // has borderWidth (even 0.5px), the text position will be changed obviously + // if the position is very big like ['1234%', '1345%']. + + el.textConfig.layoutRect = rect; + el.textConfig.position = [(labelXY[0] - rect.x) / rect.width * 100 + '%', (labelXY[1] - rect.y) / rect.height * 100 + '%']; + } + } // PENDING: + // If labelLayout is enabled (test/label-layout.html), el.dataIndex should be specified. + // But el.dataIndex is also used to determine whether user event should be triggered, + // where el.seriesIndex or el.dataModel must be specified. At present for a single el + // there is not case that "only label layout enabled but user event disabled", so here + // we depends `resetEventTriggerForRegion` to do the job of setting `el.dataIndex`. + + + el.disableLabelAnimation = true; + } else { + el.removeTextContent(); + el.removeTextConfig(); + el.disableLabelAnimation = null; + } } function resetEventTriggerForRegion(viewBuildCtx, eventTrigger, regionName, regionModel, mapOrGeoModel, // Exist only if `viewBuildCtx.data` exists. - dataIdx) { - // setItemGraphicEl, setHoverStyle after all polygons and labels - // are added to the rigionGroup - if (viewBuildCtx.data) { - // FIXME: when series-map use a SVG map, and there are duplicated name specified - // on different SVG elements, after `data.setItemGraphicEl(...)`: - // (1) all of them will be mounted with `dataIndex`, `seriesIndex`, so that tooltip - // can be triggered only mouse hover. That's correct. - // (2) only the last element will be kept in `data`, so that if trigger tooltip - // by `dispatchAction`, only the last one can be found and triggered. That might be - // not correct. We will fix it in future if anyone demanding that. - viewBuildCtx.data.setItemGraphicEl(dataIdx, eventTrigger); - } // series-map will not trigger "geoselectchange" no matter it is - // based on a declared geo component. Becuause series-map will - // trigger "selectchange". If it trigger both the two events, - // If users call `chart.dispatchAction({type: 'toggleSelect'})`, - // it not easy to also fire event "geoselectchanged". - else { - // Package custom mouse event for geo component - getECData(eventTrigger).eventData = { - componentType: 'geo', - componentIndex: mapOrGeoModel.componentIndex, - geoIndex: mapOrGeoModel.componentIndex, - name: regionName, - region: regionModel && regionModel.option || {} - }; + dataIdx) { + // setItemGraphicEl, setHoverStyle after all polygons and labels + // are added to the rigionGroup + if (viewBuildCtx.data) { + // FIXME: when series-map use a SVG map, and there are duplicated name specified + // on different SVG elements, after `data.setItemGraphicEl(...)`: + // (1) all of them will be mounted with `dataIndex`, `seriesIndex`, so that tooltip + // can be triggered only mouse hover. That's correct. + // (2) only the last element will be kept in `data`, so that if trigger tooltip + // by `dispatchAction`, only the last one can be found and triggered. That might be + // not correct. We will fix it in future if anyone demanding that. + viewBuildCtx.data.setItemGraphicEl(dataIdx, eventTrigger); + } // series-map will not trigger "geoselectchange" no matter it is + // based on a declared geo component. Becuause series-map will + // trigger "selectchange". If it trigger both the two events, + // If users call `chart.dispatchAction({type: 'toggleSelect'})`, + // it not easy to also fire event "geoselectchanged". + else { + // Package custom mouse event for geo component + getECData(eventTrigger).eventData = { + componentType: 'geo', + componentIndex: mapOrGeoModel.componentIndex, + geoIndex: mapOrGeoModel.componentIndex, + name: regionName, + region: regionModel && regionModel.option || {} + }; } } function resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) { - if (!viewBuildCtx.data) { - setTooltipConfig({ - el: el, - componentModel: mapOrGeoModel, - itemName: regionName, - // @ts-ignore FIXME:TS fix the "compatible with each other"? - itemTooltipOption: regionModel.get('tooltip') - }); - } + if (!viewBuildCtx.data) { + setTooltipConfig({ + el: el, + componentModel: mapOrGeoModel, + itemName: regionName, + // @ts-ignore FIXME:TS fix the "compatible with each other"? + itemTooltipOption: regionModel.get('tooltip') + }); + } } function resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) { - // @ts-ignore FIXME:TS fix the "compatible with each other"? - el.highDownSilentOnTouch = !!mapOrGeoModel.get('selectedMode'); // @ts-ignore FIXME:TS fix the "compatible with each other"? + // @ts-ignore FIXME:TS fix the "compatible with each other"? + el.highDownSilentOnTouch = !!mapOrGeoModel.get('selectedMode'); // @ts-ignore FIXME:TS fix the "compatible with each other"? - var emphasisModel = regionModel.getModel('emphasis'); - var focus = emphasisModel.get('focus'); - toggleHoverEmphasis(el, focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled')); + var emphasisModel = regionModel.getModel('emphasis'); + var focus = emphasisModel.get('focus'); + toggleHoverEmphasis(el, focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - if (viewBuildCtx.isGeo) { - enableComponentHighDownFeatures(el, mapOrGeoModel, regionName); - } + if (viewBuildCtx.isGeo) { + enableComponentHighDownFeatures(el, mapOrGeoModel, regionName); + } - return focus; + return focus; } function projectPolys(rings, // Polygons include exterior and interiors. Or polylines. - createStream, isLine) { - var polygons = []; - var curPoly; - - function startPolygon() { - curPoly = []; - } + createStream, isLine) { + var polygons = []; + var curPoly; + + function startPolygon() { + curPoly = []; + } + + function endPolygon() { + if (curPoly.length) { + polygons.push(curPoly); + curPoly = []; + } + } + + var stream = createStream({ + polygonStart: startPolygon, + polygonEnd: endPolygon, + lineStart: startPolygon, + lineEnd: endPolygon, + point: function (x, y) { + // May have NaN values from stream. + if (isFinite(x) && isFinite(y)) { + curPoly.push([x, y]); + } + }, + sphere: function () {} + }); + !isLine && stream.polygonStart(); + each(rings, function (ring) { + stream.lineStart(); - function endPolygon() { - if (curPoly.length) { - polygons.push(curPoly); - curPoly = []; - } + for (var i = 0; i < ring.length; i++) { + stream.point(ring[i][0], ring[i][1]); } - var stream = createStream({ - polygonStart: startPolygon, - polygonEnd: endPolygon, - lineStart: startPolygon, - lineEnd: endPolygon, - point: function (x, y) { - // May have NaN values from stream. - if (isFinite(x) && isFinite(y)) { - curPoly.push([x, y]); - } - }, - sphere: function () {} - }); - !isLine && stream.polygonStart(); - each(rings, function (ring) { - stream.lineStart(); - - for (var i = 0; i < ring.length; i++) { - stream.point(ring[i][0], ring[i][1]); - } - - stream.lineEnd(); - }); - !isLine && stream.polygonEnd(); - return polygons; + stream.lineEnd(); + }); + !isLine && stream.polygonEnd(); + return polygons; } - // @ts-ignore FIXME:TS fix the "compatible with each other"? + // @ts-ignore FIXME:TS fix the "compatible with each other"? var MapView = - /** @class */ - function (_super) { - __extends(MapView, _super); + /** @class */ + function (_super) { + __extends(MapView, _super); - function MapView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function MapView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = MapView.type; - return _this; - } - - MapView.prototype.render = function (mapModel, ecModel, api, payload) { - // Not render if it is an toggleSelect action from self - if (payload && payload.type === 'mapToggleSelect' && payload.from === this.uid) { - return; - } + _this.type = MapView.type; + return _this; + } - var group = this.group; - group.removeAll(); + MapView.prototype.render = function (mapModel, ecModel, api, payload) { + // Not render if it is an toggleSelect action from self + if (payload && payload.type === 'mapToggleSelect' && payload.from === this.uid) { + return; + } - if (mapModel.getHostGeoModel()) { - return; - } + var group = this.group; + group.removeAll(); - if (this._mapDraw && payload && payload.type === 'geoRoam') { - this._mapDraw.resetForLabelLayout(); - } // Not update map if it is an roam action from self + if (mapModel.getHostGeoModel()) { + return; + } + if (this._mapDraw && payload && payload.type === 'geoRoam') { + this._mapDraw.resetForLabelLayout(); + } // Not update map if it is an roam action from self - if (!(payload && payload.type === 'geoRoam' && payload.componentType === 'series' && payload.seriesId === mapModel.id)) { - if (mapModel.needsDrawMap) { - var mapDraw = this._mapDraw || new MapDraw(api); - group.add(mapDraw.group); - mapDraw.draw(mapModel, ecModel, api, this, payload); - this._mapDraw = mapDraw; - } else { - // Remove drawed map - this._mapDraw && this._mapDraw.remove(); - this._mapDraw = null; - } - } else { - var mapDraw = this._mapDraw; - mapDraw && group.add(mapDraw.group); - } - mapModel.get('showLegendSymbol') && ecModel.getComponent('legend') && this._renderSymbols(mapModel, ecModel, api); - }; + if (!(payload && payload.type === 'geoRoam' && payload.componentType === 'series' && payload.seriesId === mapModel.id)) { + if (mapModel.needsDrawMap) { + var mapDraw = this._mapDraw || new MapDraw(api); + group.add(mapDraw.group); + mapDraw.draw(mapModel, ecModel, api, this, payload); + this._mapDraw = mapDraw; + } else { + // Remove drawed map + this._mapDraw && this._mapDraw.remove(); + this._mapDraw = null; + } + } else { + var mapDraw = this._mapDraw; + mapDraw && group.add(mapDraw.group); + } - MapView.prototype.remove = function () { - this._mapDraw && this._mapDraw.remove(); - this._mapDraw = null; - this.group.removeAll(); - }; + mapModel.get('showLegendSymbol') && ecModel.getComponent('legend') && this._renderSymbols(mapModel, ecModel, api); + }; - MapView.prototype.dispose = function () { - this._mapDraw && this._mapDraw.remove(); - this._mapDraw = null; - }; + MapView.prototype.remove = function () { + this._mapDraw && this._mapDraw.remove(); + this._mapDraw = null; + this.group.removeAll(); + }; - MapView.prototype._renderSymbols = function (mapModel, ecModel, api) { - var originalData = mapModel.originalData; - var group = this.group; - originalData.each(originalData.mapDimension('value'), function (value, originalDataIndex) { - if (isNaN(value)) { - return; - } + MapView.prototype.dispose = function () { + this._mapDraw && this._mapDraw.remove(); + this._mapDraw = null; + }; - var layout = originalData.getItemLayout(originalDataIndex); + MapView.prototype._renderSymbols = function (mapModel, ecModel, api) { + var originalData = mapModel.originalData; + var group = this.group; + originalData.each(originalData.mapDimension('value'), function (value, originalDataIndex) { + if (isNaN(value)) { + return; + } - if (!layout || !layout.point) { - // Not exists in map - return; - } + var layout = originalData.getItemLayout(originalDataIndex); - var point = layout.point; - var offset = layout.offset; - var circle = new Circle({ - style: { - // Because the special of map draw. - // Which needs statistic of multiple series and draw on one map. - // And each series also need a symbol with legend color - // - // Layout and visual are put one the different data - // TODO - fill: mapModel.getData().getVisual('style').fill - }, - shape: { - cx: point[0] + offset * 9, - cy: point[1], - r: 3 - }, - silent: true, - // Do not overlap the first series, on which labels are displayed. - z2: 8 + (!offset ? Z2_EMPHASIS_LIFT + 1 : 0) - }); // Only the series that has the first value on the same region is in charge of rendering the label. - // But consider the case: - // series: [ - // {id: 'X', type: 'map', map: 'm', {data: [{name: 'A', value: 11}, {name: 'B', {value: 22}]}, - // {id: 'Y', type: 'map', map: 'm', {data: [{name: 'A', value: 21}, {name: 'C', {value: 33}]} - // ] - // The offset `0` of item `A` is at series `X`, but of item `C` is at series `Y`. - // For backward compatibility, we follow the rule that render label `A` by the - // settings on series `X` but render label `C` by the settings on series `Y`. - - if (!offset) { - var fullData = mapModel.mainSeries.getData(); - var name_1 = originalData.getName(originalDataIndex); - var fullIndex_1 = fullData.indexOfName(name_1); - var itemModel = originalData.getItemModel(originalDataIndex); - var labelModel = itemModel.getModel('label'); - var regionGroup = fullData.getItemGraphicEl(fullIndex_1); // `getFormattedLabel` needs to use `getData` inside. Here - // `mapModel.getData()` is shallow cloned from `mainSeries.getData()`. - // FIXME - // If this is not the `mainSeries`, the item model (like label formatter) - // set on original data item will never get. But it has been working - // like that from the begining, and this scenario is rarely encountered. - // So it won't be fixed until have to. - - setLabelStyle(circle, getLabelStatesModels(itemModel), { - labelFetcher: { - getFormattedLabel: function (idx, state) { - return mapModel.getFormattedLabel(fullIndex_1, state); - } - }, - defaultText: name_1 - }); - circle.disableLabelAnimation = true; + if (!layout || !layout.point) { + // Not exists in map + return; + } - if (!labelModel.get('position')) { - circle.setTextConfig({ - position: 'bottom' - }); - } + var point = layout.point; + var offset = layout.offset; + var circle = new Circle({ + style: { + // Because the special of map draw. + // Which needs statistic of multiple series and draw on one map. + // And each series also need a symbol with legend color + // + // Layout and visual are put one the different data + // TODO + fill: mapModel.getData().getVisual('style').fill + }, + shape: { + cx: point[0] + offset * 9, + cy: point[1], + r: 3 + }, + silent: true, + // Do not overlap the first series, on which labels are displayed. + z2: 8 + (!offset ? Z2_EMPHASIS_LIFT + 1 : 0) + }); // Only the series that has the first value on the same region is in charge of rendering the label. + // But consider the case: + // series: [ + // {id: 'X', type: 'map', map: 'm', {data: [{name: 'A', value: 11}, {name: 'B', {value: 22}]}, + // {id: 'Y', type: 'map', map: 'm', {data: [{name: 'A', value: 21}, {name: 'C', {value: 33}]} + // ] + // The offset `0` of item `A` is at series `X`, but of item `C` is at series `Y`. + // For backward compatibility, we follow the rule that render label `A` by the + // settings on series `X` but render label `C` by the settings on series `Y`. + + if (!offset) { + var fullData = mapModel.mainSeries.getData(); + var name_1 = originalData.getName(originalDataIndex); + var fullIndex_1 = fullData.indexOfName(name_1); + var itemModel = originalData.getItemModel(originalDataIndex); + var labelModel = itemModel.getModel('label'); + var regionGroup = fullData.getItemGraphicEl(fullIndex_1); // `getFormattedLabel` needs to use `getData` inside. Here + // `mapModel.getData()` is shallow cloned from `mainSeries.getData()`. + // FIXME + // If this is not the `mainSeries`, the item model (like label formatter) + // set on original data item will never get. But it has been working + // like that from the begining, and this scenario is rarely encountered. + // So it won't be fixed until have to. + + setLabelStyle(circle, getLabelStatesModels(itemModel), { + labelFetcher: { + getFormattedLabel: function (idx, state) { + return mapModel.getFormattedLabel(fullIndex_1, state); + } + }, + defaultText: name_1 + }); + circle.disableLabelAnimation = true; - regionGroup.onHoverStateChange = function (toState) { - setStatesFlag(circle, toState); - }; - } + if (!labelModel.get('position')) { + circle.setTextConfig({ + position: 'bottom' + }); + } - group.add(circle); - }); + regionGroup.onHoverStateChange = function (toState) { + setStatesFlag(circle, toState); }; + } - MapView.type = 'map'; - return MapView; - }(ChartView); - - var MapSeries = - /** @class */ - function (_super) { - __extends(MapSeries, _super); - - function MapSeries() { - var _this = _super !== null && _super.apply(this, arguments) || this; + group.add(circle); + }); + }; - _this.type = MapSeries.type; // Only first map series of same mapType will drawMap. + MapView.type = 'map'; + return MapView; + }(ChartView); - _this.needsDrawMap = false; // Group of all map series with same mapType + var MapSeries = + /** @class */ + function (_super) { + __extends(MapSeries, _super); - _this.seriesGroup = []; + function MapSeries() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.getTooltipPosition = function (dataIndex) { - if (dataIndex != null) { - var name_1 = this.getData().getName(dataIndex); - var geo = this.coordinateSystem; - var region = geo.getRegion(name_1); - return region && geo.dataToPoint(region.getCenter()); - } - }; + _this.type = MapSeries.type; // Only first map series of same mapType will drawMap. - return _this; - } + _this.needsDrawMap = false; // Group of all map series with same mapType - MapSeries.prototype.getInitialData = function (option) { - var data = createSeriesDataSimply(this, { - coordDimensions: ['value'], - encodeDefaulter: curry(makeSeriesEncodeForNameBased, this) - }); - var dataNameMap = createHashMap(); - var toAppendNames = []; + _this.seriesGroup = []; - for (var i = 0, len = data.count(); i < len; i++) { - var name_2 = data.getName(i); - dataNameMap.set(name_2, true); - } + _this.getTooltipPosition = function (dataIndex) { + if (dataIndex != null) { + var name_1 = this.getData().getName(dataIndex); + var geo = this.coordinateSystem; + var region = geo.getRegion(name_1); + return region && geo.dataToPoint(region.getCenter()); + } + }; - var geoSource = geoSourceManager.load(this.getMapType(), this.option.nameMap, this.option.nameProperty); - each(geoSource.regions, function (region) { - var name = region.name; + return _this; + } - if (!dataNameMap.get(name)) { - toAppendNames.push(name); - } - }); // Complete data with missing regions. The consequent processes (like visual - // map and render) can not be performed without a "full data". For example, - // find `dataIndex` by name. + MapSeries.prototype.getInitialData = function (option) { + var data = createSeriesDataSimply(this, { + coordDimensions: ['value'], + encodeDefaulter: curry(makeSeriesEncodeForNameBased, this) + }); + var dataNameMap = createHashMap(); + var toAppendNames = []; - data.appendValues([], toAppendNames); - return data; - }; - /** - * If no host geo model, return null, which means using a - * inner exclusive geo model. - */ + for (var i = 0, len = data.count(); i < len; i++) { + var name_2 = data.getName(i); + dataNameMap.set(name_2, true); + } + var geoSource = geoSourceManager.load(this.getMapType(), this.option.nameMap, this.option.nameProperty); + each(geoSource.regions, function (region) { + var name = region.name; - MapSeries.prototype.getHostGeoModel = function () { - var geoIndex = this.option.geoIndex; - return geoIndex != null ? this.ecModel.getComponent('geo', geoIndex) : null; - }; + if (!dataNameMap.get(name)) { + toAppendNames.push(name); + } + }); // Complete data with missing regions. The consequent processes (like visual + // map and render) can not be performed without a "full data". For example, + // find `dataIndex` by name. - MapSeries.prototype.getMapType = function () { - return (this.getHostGeoModel() || this).option.map; - }; // _fillOption(option, mapName) { - // Shallow clone - // option = zrUtil.extend({}, option); - // option.data = geoCreator.getFilledRegions(option.data, mapName, option.nameMap); - // return option; - // } + data.appendValues([], toAppendNames); + return data; + }; + /** + * If no host geo model, return null, which means using a + * inner exclusive geo model. + */ - MapSeries.prototype.getRawValue = function (dataIndex) { - // Use value stored in data instead because it is calculated from multiple series - // FIXME Provide all value of multiple series ? - var data = this.getData(); - return data.get(data.mapDimension('value'), dataIndex); - }; - /** - * Get model of region - */ + MapSeries.prototype.getHostGeoModel = function () { + var geoIndex = this.option.geoIndex; + return geoIndex != null ? this.ecModel.getComponent('geo', geoIndex) : null; + }; + + MapSeries.prototype.getMapType = function () { + return (this.getHostGeoModel() || this).option.map; + }; // _fillOption(option, mapName) { + // Shallow clone + // option = zrUtil.extend({}, option); + // option.data = geoCreator.getFilledRegions(option.data, mapName, option.nameMap); + // return option; + // } + + + MapSeries.prototype.getRawValue = function (dataIndex) { + // Use value stored in data instead because it is calculated from multiple series + // FIXME Provide all value of multiple series ? + var data = this.getData(); + return data.get(data.mapDimension('value'), dataIndex); + }; + /** + * Get model of region + */ - MapSeries.prototype.getRegionModel = function (regionName) { - var data = this.getData(); - return data.getItemModel(data.indexOfName(regionName)); - }; - /** - * Map tooltip formatter - */ + MapSeries.prototype.getRegionModel = function (regionName) { + var data = this.getData(); + return data.getItemModel(data.indexOfName(regionName)); + }; + /** + * Map tooltip formatter + */ - MapSeries.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - // FIXME orignalData and data is a bit confusing - var data = this.getData(); - var value = this.getRawValue(dataIndex); - var name = data.getName(dataIndex); - var seriesGroup = this.seriesGroup; - var seriesNames = []; + MapSeries.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { + // FIXME orignalData and data is a bit confusing + var data = this.getData(); + var value = this.getRawValue(dataIndex); + var name = data.getName(dataIndex); + var seriesGroup = this.seriesGroup; + var seriesNames = []; - for (var i = 0; i < seriesGroup.length; i++) { - var otherIndex = seriesGroup[i].originalData.indexOfName(name); - var valueDim = data.mapDimension('value'); + for (var i = 0; i < seriesGroup.length; i++) { + var otherIndex = seriesGroup[i].originalData.indexOfName(name); + var valueDim = data.mapDimension('value'); - if (!isNaN(seriesGroup[i].originalData.get(valueDim, otherIndex))) { - seriesNames.push(seriesGroup[i].name); - } - } + if (!isNaN(seriesGroup[i].originalData.get(valueDim, otherIndex))) { + seriesNames.push(seriesGroup[i].name); + } + } - return createTooltipMarkup('section', { - header: seriesNames.join(', '), - noHeader: !seriesNames.length, - blocks: [createTooltipMarkup('nameValue', { - name: name, - value: value - })] - }); - }; + return createTooltipMarkup('section', { + header: seriesNames.join(', '), + noHeader: !seriesNames.length, + blocks: [createTooltipMarkup('nameValue', { + name: name, + value: value + })] + }); + }; - MapSeries.prototype.setZoom = function (zoom) { - this.option.zoom = zoom; - }; + MapSeries.prototype.setZoom = function (zoom) { + this.option.zoom = zoom; + }; - MapSeries.prototype.setCenter = function (center) { - this.option.center = center; - }; + MapSeries.prototype.setCenter = function (center) { + this.option.center = center; + }; - MapSeries.prototype.getLegendIcon = function (opt) { - var iconType = opt.icon || 'roundRect'; - var icon = createSymbol(iconType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill); - icon.setStyle(opt.itemStyle); // Map do not use itemStyle.borderWidth as border width + MapSeries.prototype.getLegendIcon = function (opt) { + var iconType = opt.icon || 'roundRect'; + var icon = createSymbol(iconType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill); + icon.setStyle(opt.itemStyle); // Map do not use itemStyle.borderWidth as border width - icon.style.stroke = 'none'; // No rotation because no series visual symbol for map + icon.style.stroke = 'none'; // No rotation because no series visual symbol for map - if (iconType.indexOf('empty') > -1) { - icon.style.stroke = icon.style.fill; - icon.style.fill = '#fff'; - icon.style.lineWidth = 2; - } + if (iconType.indexOf('empty') > -1) { + icon.style.stroke = icon.style.fill; + icon.style.fill = '#fff'; + icon.style.lineWidth = 2; + } - return icon; - }; + return icon; + }; - MapSeries.type = 'series.map'; - MapSeries.dependencies = ['geo']; - MapSeries.layoutMode = 'box'; - MapSeries.defaultOption = { - // 一级层叠 - // zlevel: 0, - // 二级层叠 - z: 2, - coordinateSystem: 'geo', - // map should be explicitly specified since ec3. - map: '', - // If `geoIndex` is not specified, a exclusive geo will be - // created. Otherwise use the specified geo component, and - // `map` and `mapType` are ignored. - // geoIndex: 0, - // 'center' | 'left' | 'right' | 'x%' | {number} - left: 'center', - // 'center' | 'top' | 'bottom' | 'x%' | {number} - top: 'center', - // right - // bottom - // width: - // height - // Aspect is width / height. Inited to be geoJson bbox aspect - // This parameter is used for scale this aspect - // Default value: - // for geoSVG source: 1, - // for geoJSON source: 0.75. - aspectScale: null, - ///// Layout with center and size - // If you wan't to put map in a fixed size box with right aspect ratio - // This two properties may more conveninet - // layoutCenter: [50%, 50%] - // layoutSize: 100 - showLegendSymbol: true, - // Define left-top, right-bottom coords to control view - // For example, [ [180, 90], [-180, -90] ], - // higher priority than center and zoom - boundingCoords: null, - // Default on center of map - center: null, - zoom: 1, - scaleLimit: null, - selectedMode: true, - label: { - show: false, - color: '#000' - }, - // scaleLimit: null, - itemStyle: { - borderWidth: 0.5, - borderColor: '#444', - areaColor: '#eee' - }, - emphasis: { - label: { - show: true, - color: 'rgb(100,0,0)' - }, - itemStyle: { - areaColor: 'rgba(255,215,0,0.8)' - } - }, - select: { - label: { - show: true, - color: 'rgb(100,0,0)' - }, - itemStyle: { - color: 'rgba(255,215,0,0.8)' - } - }, - nameProperty: 'name' - }; - return MapSeries; - }(SeriesModel); + MapSeries.type = 'series.map'; + MapSeries.dependencies = ['geo']; + MapSeries.layoutMode = 'box'; + MapSeries.defaultOption = { + // 一级层叠 + // zlevel: 0, + // 二级层叠 + z: 2, + coordinateSystem: 'geo', + // map should be explicitly specified since ec3. + map: '', + // If `geoIndex` is not specified, a exclusive geo will be + // created. Otherwise use the specified geo component, and + // `map` and `mapType` are ignored. + // geoIndex: 0, + // 'center' | 'left' | 'right' | 'x%' | {number} + left: 'center', + // 'center' | 'top' | 'bottom' | 'x%' | {number} + top: 'center', + // right + // bottom + // width: + // height + // Aspect is width / height. Inited to be geoJson bbox aspect + // This parameter is used for scale this aspect + // Default value: + // for geoSVG source: 1, + // for geoJSON source: 0.75. + aspectScale: null, + ///// Layout with center and size + // If you wan't to put map in a fixed size box with right aspect ratio + // This two properties may more conveninet + // layoutCenter: [50%, 50%] + // layoutSize: 100 + showLegendSymbol: true, + // Define left-top, right-bottom coords to control view + // For example, [ [180, 90], [-180, -90] ], + // higher priority than center and zoom + boundingCoords: null, + // Default on center of map + center: null, + zoom: 1, + scaleLimit: null, + selectedMode: true, + label: { + show: false, + color: '#000' + }, + // scaleLimit: null, + itemStyle: { + borderWidth: 0.5, + borderColor: '#444', + areaColor: '#eee' + }, + emphasis: { + label: { + show: true, + color: 'rgb(100,0,0)' + }, + itemStyle: { + areaColor: 'rgba(255,215,0,0.8)' + } + }, + select: { + label: { + show: true, + color: 'rgb(100,0,0)' + }, + itemStyle: { + color: 'rgba(255,215,0,0.8)' + } + }, + nameProperty: 'name' + }; + return MapSeries; + }(SeriesModel); function dataStatistics(datas, statisticType) { - var dataNameMap = {}; - each(datas, function (data) { - data.each(data.mapDimension('value'), function (value, idx) { - // Add prefix to avoid conflict with Object.prototype. - var mapKey = 'ec-' + data.getName(idx); - dataNameMap[mapKey] = dataNameMap[mapKey] || []; - - if (!isNaN(value)) { - dataNameMap[mapKey].push(value); - } - }); + var dataNameMap = {}; + each(datas, function (data) { + data.each(data.mapDimension('value'), function (value, idx) { + // Add prefix to avoid conflict with Object.prototype. + var mapKey = 'ec-' + data.getName(idx); + dataNameMap[mapKey] = dataNameMap[mapKey] || []; + + if (!isNaN(value)) { + dataNameMap[mapKey].push(value); + } }); - return datas[0].map(datas[0].mapDimension('value'), function (value, idx) { - var mapKey = 'ec-' + datas[0].getName(idx); - var sum = 0; - var min = Infinity; - var max = -Infinity; - var len = dataNameMap[mapKey].length; + }); + return datas[0].map(datas[0].mapDimension('value'), function (value, idx) { + var mapKey = 'ec-' + datas[0].getName(idx); + var sum = 0; + var min = Infinity; + var max = -Infinity; + var len = dataNameMap[mapKey].length; - for (var i = 0; i < len; i++) { - min = Math.min(min, dataNameMap[mapKey][i]); - max = Math.max(max, dataNameMap[mapKey][i]); - sum += dataNameMap[mapKey][i]; - } + for (var i = 0; i < len; i++) { + min = Math.min(min, dataNameMap[mapKey][i]); + max = Math.max(max, dataNameMap[mapKey][i]); + sum += dataNameMap[mapKey][i]; + } - var result; + var result; - if (statisticType === 'min') { - result = min; - } else if (statisticType === 'max') { - result = max; - } else if (statisticType === 'average') { - result = sum / len; - } else { - result = sum; - } + if (statisticType === 'min') { + result = min; + } else if (statisticType === 'max') { + result = max; + } else if (statisticType === 'average') { + result = sum / len; + } else { + result = sum; + } - return len === 0 ? NaN : result; - }); + return len === 0 ? NaN : result; + }); } function mapDataStatistic(ecModel) { - var seriesGroups = {}; - ecModel.eachSeriesByType('map', function (seriesModel) { - var hostGeoModel = seriesModel.getHostGeoModel(); - var key = hostGeoModel ? 'o' + hostGeoModel.id : 'i' + seriesModel.getMapType(); - (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel); - }); - each(seriesGroups, function (seriesList, key) { - var data = dataStatistics(map(seriesList, function (seriesModel) { - return seriesModel.getData(); - }), seriesList[0].get('mapValueCalculation')); + var seriesGroups = {}; + ecModel.eachSeriesByType('map', function (seriesModel) { + var hostGeoModel = seriesModel.getHostGeoModel(); + var key = hostGeoModel ? 'o' + hostGeoModel.id : 'i' + seriesModel.getMapType(); + (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel); + }); + each(seriesGroups, function (seriesList, key) { + var data = dataStatistics(map(seriesList, function (seriesModel) { + return seriesModel.getData(); + }), seriesList[0].get('mapValueCalculation')); - for (var i = 0; i < seriesList.length; i++) { - seriesList[i].originalData = seriesList[i].getData(); - } // FIXME Put where? + for (var i = 0; i < seriesList.length; i++) { + seriesList[i].originalData = seriesList[i].getData(); + } // FIXME Put where? - for (var i = 0; i < seriesList.length; i++) { - seriesList[i].seriesGroup = seriesList; - seriesList[i].needsDrawMap = i === 0 && !seriesList[i].getHostGeoModel(); - seriesList[i].setData(data.cloneShallow()); - seriesList[i].mainSeries = seriesList[0]; - } - }); + for (var i = 0; i < seriesList.length; i++) { + seriesList[i].seriesGroup = seriesList; + seriesList[i].needsDrawMap = i === 0 && !seriesList[i].getHostGeoModel(); + seriesList[i].setData(data.cloneShallow()); + seriesList[i].mainSeries = seriesList[0]; + } + }); } function mapSymbolLayout(ecModel) { - var processedMapType = {}; - ecModel.eachSeriesByType('map', function (mapSeries) { - var mapType = mapSeries.getMapType(); - - if (mapSeries.getHostGeoModel() || processedMapType[mapType]) { - return; - } - - var mapSymbolOffsets = {}; - each(mapSeries.seriesGroup, function (subMapSeries) { - var geo = subMapSeries.coordinateSystem; - var data = subMapSeries.originalData; + var processedMapType = {}; + ecModel.eachSeriesByType('map', function (mapSeries) { + var mapType = mapSeries.getMapType(); - if (subMapSeries.get('showLegendSymbol') && ecModel.getComponent('legend')) { - data.each(data.mapDimension('value'), function (value, idx) { - var name = data.getName(idx); - var region = geo.getRegion(name); // If input series.data is [11, 22, '-'/null/undefined, 44], - // it will be filled with NaN: [11, 22, NaN, 44] and NaN will - // not be drawn. So here must validate if value is NaN. + if (mapSeries.getHostGeoModel() || processedMapType[mapType]) { + return; + } - if (!region || isNaN(value)) { - return; - } + var mapSymbolOffsets = {}; + each(mapSeries.seriesGroup, function (subMapSeries) { + var geo = subMapSeries.coordinateSystem; + var data = subMapSeries.originalData; - var offset = mapSymbolOffsets[name] || 0; - var point = geo.dataToPoint(region.getCenter()); - mapSymbolOffsets[name] = offset + 1; - data.setItemLayout(idx, { - point: point, - offset: offset - }); - }); - } - }); // Show label of those region not has legendIcon (which is offset 0) + if (subMapSeries.get('showLegendSymbol') && ecModel.getComponent('legend')) { + data.each(data.mapDimension('value'), function (value, idx) { + var name = data.getName(idx); + var region = geo.getRegion(name); // If input series.data is [11, 22, '-'/null/undefined, 44], + // it will be filled with NaN: [11, 22, NaN, 44] and NaN will + // not be drawn. So here must validate if value is NaN. - var data = mapSeries.getData(); - data.each(function (idx) { - var name = data.getName(idx); - var layout = data.getItemLayout(idx) || {}; - layout.showLabel = !mapSymbolOffsets[name]; - data.setItemLayout(idx, layout); + if (!region || isNaN(value)) { + return; + } + + var offset = mapSymbolOffsets[name] || 0; + var point = geo.dataToPoint(region.getCenter()); + mapSymbolOffsets[name] = offset + 1; + data.setItemLayout(idx, { + point: point, + offset: offset + }); }); - processedMapType[mapType] = true; + } + }); // Show label of those region not has legendIcon (which is offset 0) + + var data = mapSeries.getData(); + data.each(function (idx) { + var name = data.getName(idx); + var layout = data.getItemLayout(idx) || {}; + layout.showLabel = !mapSymbolOffsets[name]; + data.setItemLayout(idx, layout); }); + processedMapType[mapType] = true; + }); } var v2ApplyTransform = applyTransform; var View = - /** @class */ - function (_super) { - __extends(View, _super); + /** @class */ + function (_super) { + __extends(View, _super); - function View(name) { - var _this = _super.call(this) || this; + function View(name) { + var _this = _super.call(this) || this; - _this.type = 'view'; - _this.dimensions = ['x', 'y']; - /** - * Represents the transform brought by roam/zoom. - * If `View['_viewRect']` applies roam transform, - * we can get the final displayed rect. - */ + _this.type = 'view'; + _this.dimensions = ['x', 'y']; + /** + * Represents the transform brought by roam/zoom. + * If `View['_viewRect']` applies roam transform, + * we can get the final displayed rect. + */ - _this._roamTransformable = new Transformable(); - /** - * Represents the transform from `View['_rect']` to `View['_viewRect']`. - */ + _this._roamTransformable = new Transformable(); + /** + * Represents the transform from `View['_rect']` to `View['_viewRect']`. + */ - _this._rawTransformable = new Transformable(); - _this.name = name; - return _this; - } + _this._rawTransformable = new Transformable(); + _this.name = name; + return _this; + } + + View.prototype.setBoundingRect = function (x, y, width, height) { + this._rect = new BoundingRect(x, y, width, height); + return this._rect; + }; + /** + * @return {module:zrender/core/BoundingRect} + */ - View.prototype.setBoundingRect = function (x, y, width, height) { - this._rect = new BoundingRect(x, y, width, height); - return this._rect; - }; - /** - * @return {module:zrender/core/BoundingRect} - */ + View.prototype.getBoundingRect = function () { + return this._rect; + }; - View.prototype.getBoundingRect = function () { - return this._rect; - }; + View.prototype.setViewRect = function (x, y, width, height) { + this._transformTo(x, y, width, height); - View.prototype.setViewRect = function (x, y, width, height) { - this._transformTo(x, y, width, height); + this._viewRect = new BoundingRect(x, y, width, height); + }; + /** + * Transformed to particular position and size + */ - this._viewRect = new BoundingRect(x, y, width, height); - }; - /** - * Transformed to particular position and size - */ + View.prototype._transformTo = function (x, y, width, height) { + var rect = this.getBoundingRect(); + var rawTransform = this._rawTransformable; + rawTransform.transform = rect.calculateTransform(new BoundingRect(x, y, width, height)); + var rawParent = rawTransform.parent; + rawTransform.parent = null; + rawTransform.decomposeTransform(); + rawTransform.parent = rawParent; + + this._updateTransform(); + }; + /** + * Set center of view + */ - View.prototype._transformTo = function (x, y, width, height) { - var rect = this.getBoundingRect(); - var rawTransform = this._rawTransformable; - rawTransform.transform = rect.calculateTransform(new BoundingRect(x, y, width, height)); - var rawParent = rawTransform.parent; - rawTransform.parent = null; - rawTransform.decomposeTransform(); - rawTransform.parent = rawParent; - this._updateTransform(); - }; - /** - * Set center of view - */ + View.prototype.setCenter = function (centerCoord) { + if (!centerCoord) { + return; + } + this._center = centerCoord; - View.prototype.setCenter = function (centerCoord) { - if (!centerCoord) { - return; - } + this._updateCenterAndZoom(); + }; - this._center = centerCoord; + View.prototype.setZoom = function (zoom) { + zoom = zoom || 1; + var zoomLimit = this.zoomLimit; - this._updateCenterAndZoom(); - }; + if (zoomLimit) { + if (zoomLimit.max != null) { + zoom = Math.min(zoomLimit.max, zoom); + } - View.prototype.setZoom = function (zoom) { - zoom = zoom || 1; - var zoomLimit = this.zoomLimit; + if (zoomLimit.min != null) { + zoom = Math.max(zoomLimit.min, zoom); + } + } - if (zoomLimit) { - if (zoomLimit.max != null) { - zoom = Math.min(zoomLimit.max, zoom); - } + this._zoom = zoom; - if (zoomLimit.min != null) { - zoom = Math.max(zoomLimit.min, zoom); - } - } + this._updateCenterAndZoom(); + }; + /** + * Get default center without roam + */ - this._zoom = zoom; - this._updateCenterAndZoom(); - }; - /** - * Get default center without roam - */ + View.prototype.getDefaultCenter = function () { + // Rect before any transform + var rawRect = this.getBoundingRect(); + var cx = rawRect.x + rawRect.width / 2; + var cy = rawRect.y + rawRect.height / 2; + return [cx, cy]; + }; + View.prototype.getCenter = function () { + return this._center || this.getDefaultCenter(); + }; - View.prototype.getDefaultCenter = function () { - // Rect before any transform - var rawRect = this.getBoundingRect(); - var cx = rawRect.x + rawRect.width / 2; - var cy = rawRect.y + rawRect.height / 2; - return [cx, cy]; - }; + View.prototype.getZoom = function () { + return this._zoom || 1; + }; - View.prototype.getCenter = function () { - return this._center || this.getDefaultCenter(); - }; + View.prototype.getRoamTransform = function () { + return this._roamTransformable.getLocalTransform(); + }; + /** + * Remove roam + */ - View.prototype.getZoom = function () { - return this._zoom || 1; - }; - View.prototype.getRoamTransform = function () { - return this._roamTransformable.getLocalTransform(); - }; - /** - * Remove roam - */ + View.prototype._updateCenterAndZoom = function () { + // Must update after view transform updated + var rawTransformMatrix = this._rawTransformable.getLocalTransform(); + + var roamTransform = this._roamTransformable; + var defaultCenter = this.getDefaultCenter(); + var center = this.getCenter(); + var zoom = this.getZoom(); + center = applyTransform([], center, rawTransformMatrix); + defaultCenter = applyTransform([], defaultCenter, rawTransformMatrix); + roamTransform.originX = center[0]; + roamTransform.originY = center[1]; + roamTransform.x = defaultCenter[0] - center[0]; + roamTransform.y = defaultCenter[1] - center[1]; + roamTransform.scaleX = roamTransform.scaleY = zoom; + + this._updateTransform(); + }; + /** + * Update transform props on `this` based on the current + * `this._roamTransformable` and `this._rawTransformable`. + */ - View.prototype._updateCenterAndZoom = function () { - // Must update after view transform updated - var rawTransformMatrix = this._rawTransformable.getLocalTransform(); + View.prototype._updateTransform = function () { + var roamTransformable = this._roamTransformable; + var rawTransformable = this._rawTransformable; + rawTransformable.parent = roamTransformable; + roamTransformable.updateTransform(); + rawTransformable.updateTransform(); + copy$1(this.transform || (this.transform = []), rawTransformable.transform || create$1()); + this._rawTransform = rawTransformable.getLocalTransform(); + this.invTransform = this.invTransform || []; + invert(this.invTransform, this.transform); + this.decomposeTransform(); + }; + + View.prototype.getTransformInfo = function () { + var rawTransformable = this._rawTransformable; + var roamTransformable = this._roamTransformable; // Becuase roamTransformabel has `originX/originY` modified, + // but the caller of `getTransformInfo` can not handle `originX/originY`, + // so need to recalcualte them. + + var dummyTransformable = new Transformable(); + dummyTransformable.transform = roamTransformable.transform; + dummyTransformable.decomposeTransform(); + return { + roam: { + x: dummyTransformable.x, + y: dummyTransformable.y, + scaleX: dummyTransformable.scaleX, + scaleY: dummyTransformable.scaleY + }, + raw: { + x: rawTransformable.x, + y: rawTransformable.y, + scaleX: rawTransformable.scaleX, + scaleY: rawTransformable.scaleY + } + }; + }; + + View.prototype.getViewRect = function () { + return this._viewRect; + }; + /** + * Get view rect after roam transform + */ - var roamTransform = this._roamTransformable; - var defaultCenter = this.getDefaultCenter(); - var center = this.getCenter(); - var zoom = this.getZoom(); - center = applyTransform([], center, rawTransformMatrix); - defaultCenter = applyTransform([], defaultCenter, rawTransformMatrix); - roamTransform.originX = center[0]; - roamTransform.originY = center[1]; - roamTransform.x = defaultCenter[0] - center[0]; - roamTransform.y = defaultCenter[1] - center[1]; - roamTransform.scaleX = roamTransform.scaleY = zoom; - this._updateTransform(); - }; - /** - * Update transform props on `this` based on the current - * `this._roamTransformable` and `this._rawTransformable`. - */ + View.prototype.getViewRectAfterRoam = function () { + var rect = this.getBoundingRect().clone(); + rect.applyTransform(this.transform); + return rect; + }; + /** + * Convert a single (lon, lat) data item to (x, y) point. + */ - View.prototype._updateTransform = function () { - var roamTransformable = this._roamTransformable; - var rawTransformable = this._rawTransformable; - rawTransformable.parent = roamTransformable; - roamTransformable.updateTransform(); - rawTransformable.updateTransform(); - copy$1(this.transform || (this.transform = []), rawTransformable.transform || create$1()); - this._rawTransform = rawTransformable.getLocalTransform(); - this.invTransform = this.invTransform || []; - invert(this.invTransform, this.transform); - this.decomposeTransform(); - }; + View.prototype.dataToPoint = function (data, noRoam, out) { + var transform = noRoam ? this._rawTransform : this.transform; + out = out || []; + return transform ? v2ApplyTransform(out, data, transform) : copy(out, data); + }; + /** + * Convert a (x, y) point to (lon, lat) data + */ - View.prototype.getTransformInfo = function () { - var rawTransformable = this._rawTransformable; - var roamTransformable = this._roamTransformable; // Becuase roamTransformabel has `originX/originY` modified, - // but the caller of `getTransformInfo` can not handle `originX/originY`, - // so need to recalcualte them. - var dummyTransformable = new Transformable(); - dummyTransformable.transform = roamTransformable.transform; - dummyTransformable.decomposeTransform(); - return { - roam: { - x: dummyTransformable.x, - y: dummyTransformable.y, - scaleX: dummyTransformable.scaleX, - scaleY: dummyTransformable.scaleY - }, - raw: { - x: rawTransformable.x, - y: rawTransformable.y, - scaleX: rawTransformable.scaleX, - scaleY: rawTransformable.scaleY - } - }; - }; + View.prototype.pointToData = function (point) { + var invTransform = this.invTransform; + return invTransform ? v2ApplyTransform([], point, invTransform) : [point[0], point[1]]; + }; - View.prototype.getViewRect = function () { - return this._viewRect; - }; - /** - * Get view rect after roam transform - */ + View.prototype.convertToPixel = function (ecModel, finder, value) { + var coordSys = getCoordSys(finder); + return coordSys === this ? coordSys.dataToPoint(value) : null; + }; + View.prototype.convertFromPixel = function (ecModel, finder, pixel) { + var coordSys = getCoordSys(finder); + return coordSys === this ? coordSys.pointToData(pixel) : null; + }; + /** + * @implements + */ - View.prototype.getViewRectAfterRoam = function () { - var rect = this.getBoundingRect().clone(); - rect.applyTransform(this.transform); - return rect; - }; - /** - * Convert a single (lon, lat) data item to (x, y) point. - */ + View.prototype.containPoint = function (point) { + return this.getViewRectAfterRoam().contain(point[0], point[1]); + }; - View.prototype.dataToPoint = function (data, noRoam, out) { - var transform = noRoam ? this._rawTransform : this.transform; - out = out || []; - return transform ? v2ApplyTransform(out, data, transform) : copy(out, data); - }; - /** - * Convert a (x, y) point to (lon, lat) data - */ + View.dimensions = ['x', 'y']; + return View; + }(Transformable); + function getCoordSys(finder) { + var seriesModel = finder.seriesModel; + return seriesModel ? seriesModel.coordinateSystem : null; // e.g., graph. + } - View.prototype.pointToData = function (point) { - var invTransform = this.invTransform; - return invTransform ? v2ApplyTransform([], point, invTransform) : [point[0], point[1]]; - }; + var GEO_DEFAULT_PARAMS = { + 'geoJSON': { + aspectScale: 0.75, + invertLongitute: true + }, + 'geoSVG': { + aspectScale: 1, + invertLongitute: false + } + }; + var geo2DDimensions = ['lng', 'lat']; - View.prototype.convertToPixel = function (ecModel, finder, value) { - var coordSys = getCoordSys(finder); - return coordSys === this ? coordSys.dataToPoint(value) : null; - }; + var Geo = + /** @class */ + function (_super) { + __extends(Geo, _super); + + function Geo(name, map, opt) { + var _this = _super.call(this, name) || this; + + _this.dimensions = geo2DDimensions; + _this.type = 'geo'; // Only store specified name coord via `addGeoCoord`. + + _this._nameCoordMap = createHashMap(); + _this.map = map; + var projection = opt.projection; + var source = geoSourceManager.load(map, opt.nameMap, opt.nameProperty); + var resource = geoSourceManager.getGeoResource(map); + var resourceType = _this.resourceType = resource ? resource.type : null; + var regions = _this.regions = source.regions; + var defaultParams = GEO_DEFAULT_PARAMS[resource.type]; + _this._regionsMap = source.regionsMap; + _this.regions = source.regions; + + if ("development" !== 'production' && projection) { + // Do some check + if (resourceType === 'geoSVG') { + if ("development" !== 'production') { + warn("Map " + map + " with SVG source can't use projection. Only GeoJSON source supports projection."); + } - View.prototype.convertFromPixel = function (ecModel, finder, pixel) { - var coordSys = getCoordSys(finder); - return coordSys === this ? coordSys.pointToData(pixel) : null; - }; - /** - * @implements - */ + projection = null; + } + if (!(projection.project && projection.unproject)) { + if ("development" !== 'production') { + warn('project and unproject must be both provided in the projeciton.'); + } - View.prototype.containPoint = function (point) { - return this.getViewRectAfterRoam().contain(point[0], point[1]); - }; - - View.dimensions = ['x', 'y']; - return View; - }(Transformable); - - function getCoordSys(finder) { - var seriesModel = finder.seriesModel; - return seriesModel ? seriesModel.coordinateSystem : null; // e.g., graph. - } - - var GEO_DEFAULT_PARAMS = { - 'geoJSON': { - aspectScale: 0.75, - invertLongitute: true - }, - 'geoSVG': { - aspectScale: 1, - invertLongitute: false + projection = null; + } } - }; - var geo2DDimensions = ['lng', 'lat']; - - var Geo = - /** @class */ - function (_super) { - __extends(Geo, _super); - - function Geo(name, map, opt) { - var _this = _super.call(this, name) || this; - - _this.dimensions = geo2DDimensions; - _this.type = 'geo'; // Only store specified name coord via `addGeoCoord`. - - _this._nameCoordMap = createHashMap(); - _this.map = map; - var projection = opt.projection; - var source = geoSourceManager.load(map, opt.nameMap, opt.nameProperty); - var resource = geoSourceManager.getGeoResource(map); - var resourceType = _this.resourceType = resource ? resource.type : null; - var regions = _this.regions = source.regions; - var defaultParams = GEO_DEFAULT_PARAMS[resource.type]; - _this._regionsMap = source.regionsMap; - _this.regions = source.regions; - - if ("development" !== 'production' && projection) { - // Do some check - if (resourceType === 'geoSVG') { - if ("development" !== 'production') { - warn("Map " + map + " with SVG source can't use projection. Only GeoJSON source supports projection."); - } - - projection = null; - } - - if (!(projection.project && projection.unproject)) { - if ("development" !== 'production') { - warn('project and unproject must be both provided in the projeciton.'); - } - - projection = null; - } - } - _this.projection = projection; - var boundingRect; + _this.projection = projection; + var boundingRect; - if (projection) { - // Can't reuse the raw bounding rect - for (var i = 0; i < regions.length; i++) { - var regionRect = regions[i].getBoundingRect(projection); - boundingRect = boundingRect || regionRect.clone(); - boundingRect.union(regionRect); - } - } else { - boundingRect = source.boundingRect; - } + if (projection) { + // Can't reuse the raw bounding rect + for (var i = 0; i < regions.length; i++) { + var regionRect = regions[i].getBoundingRect(projection); + boundingRect = boundingRect || regionRect.clone(); + boundingRect.union(regionRect); + } + } else { + boundingRect = source.boundingRect; + } - _this.setBoundingRect(boundingRect.x, boundingRect.y, boundingRect.width, boundingRect.height); // aspectScale and invertLongitute actually is the parameters default raw projection. - // So we ignore them if projection is given. - // Ignore default aspect scale if projection exits. + _this.setBoundingRect(boundingRect.x, boundingRect.y, boundingRect.width, boundingRect.height); // aspectScale and invertLongitute actually is the parameters default raw projection. + // So we ignore them if projection is given. + // Ignore default aspect scale if projection exits. - _this.aspectScale = projection ? 1 : retrieve2(opt.aspectScale, defaultParams.aspectScale); // Not invert longitute if projection exits. + _this.aspectScale = projection ? 1 : retrieve2(opt.aspectScale, defaultParams.aspectScale); // Not invert longitute if projection exits. - _this._invertLongitute = projection ? false : defaultParams.invertLongitute; - return _this; - } + _this._invertLongitute = projection ? false : defaultParams.invertLongitute; + return _this; + } - Geo.prototype._transformTo = function (x, y, width, height) { - var rect = this.getBoundingRect(); - var invertLongitute = this._invertLongitute; - rect = rect.clone(); + Geo.prototype._transformTo = function (x, y, width, height) { + var rect = this.getBoundingRect(); + var invertLongitute = this._invertLongitute; + rect = rect.clone(); - if (invertLongitute) { - // Longitute is inverted - rect.y = -rect.y - rect.height; - } + if (invertLongitute) { + // Longitute is inverted + rect.y = -rect.y - rect.height; + } - var rawTransformable = this._rawTransformable; - rawTransformable.transform = rect.calculateTransform(new BoundingRect(x, y, width, height)); - var rawParent = rawTransformable.parent; - rawTransformable.parent = null; - rawTransformable.decomposeTransform(); - rawTransformable.parent = rawParent; + var rawTransformable = this._rawTransformable; + rawTransformable.transform = rect.calculateTransform(new BoundingRect(x, y, width, height)); + var rawParent = rawTransformable.parent; + rawTransformable.parent = null; + rawTransformable.decomposeTransform(); + rawTransformable.parent = rawParent; - if (invertLongitute) { - rawTransformable.scaleY = -rawTransformable.scaleY; - } + if (invertLongitute) { + rawTransformable.scaleY = -rawTransformable.scaleY; + } - this._updateTransform(); - }; + this._updateTransform(); + }; - Geo.prototype.getRegion = function (name) { - return this._regionsMap.get(name); - }; + Geo.prototype.getRegion = function (name) { + return this._regionsMap.get(name); + }; - Geo.prototype.getRegionByCoord = function (coord) { - var regions = this.regions; + Geo.prototype.getRegionByCoord = function (coord) { + var regions = this.regions; - for (var i = 0; i < regions.length; i++) { - var region = regions[i]; + for (var i = 0; i < regions.length; i++) { + var region = regions[i]; - if (region.type === 'geoJSON' && region.contain(coord)) { - return regions[i]; - } - } - }; - /** - * Add geoCoord for indexing by name - */ + if (region.type === 'geoJSON' && region.contain(coord)) { + return regions[i]; + } + } + }; + /** + * Add geoCoord for indexing by name + */ - Geo.prototype.addGeoCoord = function (name, geoCoord) { - this._nameCoordMap.set(name, geoCoord); - }; - /** - * Get geoCoord by name - */ + Geo.prototype.addGeoCoord = function (name, geoCoord) { + this._nameCoordMap.set(name, geoCoord); + }; + /** + * Get geoCoord by name + */ - Geo.prototype.getGeoCoord = function (name) { - var region = this._regionsMap.get(name); // calcualte center only on demand. + Geo.prototype.getGeoCoord = function (name) { + var region = this._regionsMap.get(name); // calcualte center only on demand. - return this._nameCoordMap.get(name) || region && region.getCenter(); - }; + return this._nameCoordMap.get(name) || region && region.getCenter(); + }; - Geo.prototype.dataToPoint = function (data, noRoam, out) { - if (isString(data)) { - // Map area name to geoCoord - data = this.getGeoCoord(data); - } + Geo.prototype.dataToPoint = function (data, noRoam, out) { + if (isString(data)) { + // Map area name to geoCoord + data = this.getGeoCoord(data); + } - if (data) { - var projection = this.projection; + if (data) { + var projection = this.projection; - if (projection) { - // projection may return null point. - data = projection.project(data); - } + if (projection) { + // projection may return null point. + data = projection.project(data); + } - return data && this.projectedToPoint(data); - } - }; + return data && this.projectedToPoint(data); + } + }; - Geo.prototype.pointToData = function (point) { - var projection = this.projection; + Geo.prototype.pointToData = function (point) { + var projection = this.projection; - if (projection) { - // projection may return null point. - point = projection.unproject(point); - } + if (projection) { + // projection may return null point. + point = projection.unproject(point); + } - return point && this.pointToProjected(point); - }; - /** - * Point to projected data. Same with pointToData when projection is used. - */ + return point && this.pointToProjected(point); + }; + /** + * Point to projected data. Same with pointToData when projection is used. + */ - Geo.prototype.pointToProjected = function (point) { - return _super.prototype.pointToData.call(this, point); - }; + Geo.prototype.pointToProjected = function (point) { + return _super.prototype.pointToData.call(this, point); + }; - Geo.prototype.projectedToPoint = function (projected, noRoam, out) { - return _super.prototype.dataToPoint.call(this, projected, noRoam, out); - }; + Geo.prototype.projectedToPoint = function (projected, noRoam, out) { + return _super.prototype.dataToPoint.call(this, projected, noRoam, out); + }; - Geo.prototype.convertToPixel = function (ecModel, finder, value) { - var coordSys = getCoordSys$1(finder); - return coordSys === this ? coordSys.dataToPoint(value) : null; - }; + Geo.prototype.convertToPixel = function (ecModel, finder, value) { + var coordSys = getCoordSys$1(finder); + return coordSys === this ? coordSys.dataToPoint(value) : null; + }; - Geo.prototype.convertFromPixel = function (ecModel, finder, pixel) { - var coordSys = getCoordSys$1(finder); - return coordSys === this ? coordSys.pointToData(pixel) : null; - }; + Geo.prototype.convertFromPixel = function (ecModel, finder, pixel) { + var coordSys = getCoordSys$1(finder); + return coordSys === this ? coordSys.pointToData(pixel) : null; + }; - return Geo; - }(View); + return Geo; + }(View); mixin(Geo, View); function getCoordSys$1(finder) { - var geoModel = finder.geoModel; - var seriesModel = finder.seriesModel; - return geoModel ? geoModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem // For map series. - || (seriesModel.getReferringComponents('geo', SINGLE_REFERRING).models[0] || {}).coordinateSystem : null; + var geoModel = finder.geoModel; + var seriesModel = finder.seriesModel; + return geoModel ? geoModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem // For map series. + || (seriesModel.getReferringComponents('geo', SINGLE_REFERRING).models[0] || {}).coordinateSystem : null; } /** @@ -53429,405 +53429,405 @@ */ function resizeGeo(geoModel, api) { - var boundingCoords = geoModel.get('boundingCoords'); + var boundingCoords = geoModel.get('boundingCoords'); - if (boundingCoords != null) { - var leftTop_1 = boundingCoords[0]; - var rightBottom_1 = boundingCoords[1]; + if (boundingCoords != null) { + var leftTop_1 = boundingCoords[0]; + var rightBottom_1 = boundingCoords[1]; - if (!(isFinite(leftTop_1[0]) && isFinite(leftTop_1[1]) && isFinite(rightBottom_1[0]) && isFinite(rightBottom_1[1]))) { - if ("development" !== 'production') { - console.error('Invalid boundingCoords'); - } - } else { - // Sample around the lng/lat rect and use projection to calculate actual bounding rect. - var projection_1 = this.projection; - - if (projection_1) { - var xMin = leftTop_1[0]; - var yMin = leftTop_1[1]; - var xMax = rightBottom_1[0]; - var yMax = rightBottom_1[1]; - leftTop_1 = [Infinity, Infinity]; - rightBottom_1 = [-Infinity, -Infinity]; // TODO better way? - - var sampleLine = function (x0, y0, x1, y1) { - var dx = x1 - x0; - var dy = y1 - y0; - - for (var i = 0; i <= 100; i++) { - var p = i / 100; - var pt = projection_1.project([x0 + dx * p, y0 + dy * p]); - min(leftTop_1, leftTop_1, pt); - max(rightBottom_1, rightBottom_1, pt); - } - }; // Top + if (!(isFinite(leftTop_1[0]) && isFinite(leftTop_1[1]) && isFinite(rightBottom_1[0]) && isFinite(rightBottom_1[1]))) { + if ("development" !== 'production') { + console.error('Invalid boundingCoords'); + } + } else { + // Sample around the lng/lat rect and use projection to calculate actual bounding rect. + var projection_1 = this.projection; + if (projection_1) { + var xMin = leftTop_1[0]; + var yMin = leftTop_1[1]; + var xMax = rightBottom_1[0]; + var yMax = rightBottom_1[1]; + leftTop_1 = [Infinity, Infinity]; + rightBottom_1 = [-Infinity, -Infinity]; // TODO better way? - sampleLine(xMin, yMin, xMax, yMin); // Right + var sampleLine = function (x0, y0, x1, y1) { + var dx = x1 - x0; + var dy = y1 - y0; - sampleLine(xMax, yMin, xMax, yMax); // Bottom + for (var i = 0; i <= 100; i++) { + var p = i / 100; + var pt = projection_1.project([x0 + dx * p, y0 + dy * p]); + min(leftTop_1, leftTop_1, pt); + max(rightBottom_1, rightBottom_1, pt); + } + }; // Top - sampleLine(xMax, yMax, xMin, yMax); // Left - sampleLine(xMin, yMax, xMax, yMin); - } + sampleLine(xMin, yMin, xMax, yMin); // Right - this.setBoundingRect(leftTop_1[0], leftTop_1[1], rightBottom_1[0] - leftTop_1[0], rightBottom_1[1] - leftTop_1[1]); - } - } + sampleLine(xMax, yMin, xMax, yMax); // Bottom - var rect = this.getBoundingRect(); - var centerOption = geoModel.get('layoutCenter'); - var sizeOption = geoModel.get('layoutSize'); - var viewWidth = api.getWidth(); - var viewHeight = api.getHeight(); - var aspect = rect.width / rect.height * this.aspectScale; - var useCenterAndSize = false; - var center; - var size; + sampleLine(xMax, yMax, xMin, yMax); // Left - if (centerOption && sizeOption) { - center = [parsePercent$1(centerOption[0], viewWidth), parsePercent$1(centerOption[1], viewHeight)]; - size = parsePercent$1(sizeOption, Math.min(viewWidth, viewHeight)); + sampleLine(xMin, yMax, xMax, yMin); + } - if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) { - useCenterAndSize = true; - } else { - if ("development" !== 'production') { - console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.'); - } - } + this.setBoundingRect(leftTop_1[0], leftTop_1[1], rightBottom_1[0] - leftTop_1[0], rightBottom_1[1] - leftTop_1[1]); } + } - var viewRect; - - if (useCenterAndSize) { - viewRect = {}; + var rect = this.getBoundingRect(); + var centerOption = geoModel.get('layoutCenter'); + var sizeOption = geoModel.get('layoutSize'); + var viewWidth = api.getWidth(); + var viewHeight = api.getHeight(); + var aspect = rect.width / rect.height * this.aspectScale; + var useCenterAndSize = false; + var center; + var size; - if (aspect > 1) { - // Width is same with size - viewRect.width = size; - viewRect.height = size / aspect; - } else { - viewRect.height = size; - viewRect.width = size * aspect; - } + if (centerOption && sizeOption) { + center = [parsePercent$1(centerOption[0], viewWidth), parsePercent$1(centerOption[1], viewHeight)]; + size = parsePercent$1(sizeOption, Math.min(viewWidth, viewHeight)); - viewRect.y = center[1] - viewRect.height / 2; - viewRect.x = center[0] - viewRect.width / 2; + if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) { + useCenterAndSize = true; } else { - // Use left/top/width/height - var boxLayoutOption = geoModel.getBoxLayoutParams(); - boxLayoutOption.aspect = aspect; - viewRect = getLayoutRect(boxLayoutOption, { - width: viewWidth, - height: viewHeight - }); + if ("development" !== 'production') { + console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.'); + } } + } + + var viewRect; + + if (useCenterAndSize) { + viewRect = {}; + + if (aspect > 1) { + // Width is same with size + viewRect.width = size; + viewRect.height = size / aspect; + } else { + viewRect.height = size; + viewRect.width = size * aspect; + } + + viewRect.y = center[1] - viewRect.height / 2; + viewRect.x = center[0] - viewRect.width / 2; + } else { + // Use left/top/width/height + var boxLayoutOption = geoModel.getBoxLayoutParams(); + boxLayoutOption.aspect = aspect; + viewRect = getLayoutRect(boxLayoutOption, { + width: viewWidth, + height: viewHeight + }); + } - this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height); - this.setCenter(geoModel.get('center')); - this.setZoom(geoModel.get('zoom')); + this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height); + this.setCenter(geoModel.get('center')); + this.setZoom(geoModel.get('zoom')); } // Back compat for ECharts2, where the coord map is set on map series: // {type: 'map', geoCoord: {'cityA': [116.46,39.92], 'cityA': [119.12,24.61]}}, function setGeoCoords(geo, model) { - each(model.get('geoCoord'), function (geoCoord, name) { - geo.addGeoCoord(name, geoCoord); - }); + each(model.get('geoCoord'), function (geoCoord, name) { + geo.addGeoCoord(name, geoCoord); + }); } var GeoCreator = - /** @class */ - function () { - function GeoCreator() { - // For deciding which dimensions to use when creating list data - this.dimensions = geo2DDimensions; - } - - GeoCreator.prototype.create = function (ecModel, api) { - var geoList = []; - - function getCommonGeoProperties(model) { - return { - nameProperty: model.get('nameProperty'), - aspectScale: model.get('aspectScale'), - projection: model.get('projection') - }; - } // FIXME Create each time may be slow - - - ecModel.eachComponent('geo', function (geoModel, idx) { - var mapName = geoModel.get('map'); - var geo = new Geo(mapName + idx, mapName, extend({ - nameMap: geoModel.get('nameMap') - }, getCommonGeoProperties(geoModel))); - geo.zoomLimit = geoModel.get('scaleLimit'); - geoList.push(geo); // setGeoCoords(geo, geoModel); - - geoModel.coordinateSystem = geo; - geo.model = geoModel; // Inject resize method + /** @class */ + function () { + function GeoCreator() { + // For deciding which dimensions to use when creating list data + this.dimensions = geo2DDimensions; + } + + GeoCreator.prototype.create = function (ecModel, api) { + var geoList = []; + + function getCommonGeoProperties(model) { + return { + nameProperty: model.get('nameProperty'), + aspectScale: model.get('aspectScale'), + projection: model.get('projection') + }; + } // FIXME Create each time may be slow + + + ecModel.eachComponent('geo', function (geoModel, idx) { + var mapName = geoModel.get('map'); + var geo = new Geo(mapName + idx, mapName, extend({ + nameMap: geoModel.get('nameMap') + }, getCommonGeoProperties(geoModel))); + geo.zoomLimit = geoModel.get('scaleLimit'); + geoList.push(geo); // setGeoCoords(geo, geoModel); + + geoModel.coordinateSystem = geo; + geo.model = geoModel; // Inject resize method + + geo.resize = resizeGeo; + geo.resize(geoModel, api); + }); + ecModel.eachSeries(function (seriesModel) { + var coordSys = seriesModel.get('coordinateSystem'); - geo.resize = resizeGeo; - geo.resize(geoModel, api); - }); - ecModel.eachSeries(function (seriesModel) { - var coordSys = seriesModel.get('coordinateSystem'); + if (coordSys === 'geo') { + var geoIndex = seriesModel.get('geoIndex') || 0; + seriesModel.coordinateSystem = geoList[geoIndex]; + } + }); // If has map series - if (coordSys === 'geo') { - var geoIndex = seriesModel.get('geoIndex') || 0; - seriesModel.coordinateSystem = geoList[geoIndex]; - } - }); // If has map series - - var mapModelGroupBySeries = {}; - ecModel.eachSeriesByType('map', function (seriesModel) { - if (!seriesModel.getHostGeoModel()) { - var mapType = seriesModel.getMapType(); - mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || []; - mapModelGroupBySeries[mapType].push(seriesModel); - } - }); - each(mapModelGroupBySeries, function (mapSeries, mapType) { - var nameMapList = map(mapSeries, function (singleMapSeries) { - return singleMapSeries.get('nameMap'); - }); - var geo = new Geo(mapType, mapType, extend({ - nameMap: mergeAll(nameMapList) - }, getCommonGeoProperties(mapSeries[0]))); - geo.zoomLimit = retrieve.apply(null, map(mapSeries, function (singleMapSeries) { - return singleMapSeries.get('scaleLimit'); - })); - geoList.push(geo); // Inject resize method - - geo.resize = resizeGeo; - geo.resize(mapSeries[0], api); - each(mapSeries, function (singleMapSeries) { - singleMapSeries.coordinateSystem = geo; - setGeoCoords(geo, singleMapSeries); - }); - }); - return geoList; - }; - /** - * Fill given regions array - */ + var mapModelGroupBySeries = {}; + ecModel.eachSeriesByType('map', function (seriesModel) { + if (!seriesModel.getHostGeoModel()) { + var mapType = seriesModel.getMapType(); + mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || []; + mapModelGroupBySeries[mapType].push(seriesModel); + } + }); + each(mapModelGroupBySeries, function (mapSeries, mapType) { + var nameMapList = map(mapSeries, function (singleMapSeries) { + return singleMapSeries.get('nameMap'); + }); + var geo = new Geo(mapType, mapType, extend({ + nameMap: mergeAll(nameMapList) + }, getCommonGeoProperties(mapSeries[0]))); + geo.zoomLimit = retrieve.apply(null, map(mapSeries, function (singleMapSeries) { + return singleMapSeries.get('scaleLimit'); + })); + geoList.push(geo); // Inject resize method + + geo.resize = resizeGeo; + geo.resize(mapSeries[0], api); + each(mapSeries, function (singleMapSeries) { + singleMapSeries.coordinateSystem = geo; + setGeoCoords(geo, singleMapSeries); + }); + }); + return geoList; + }; + /** + * Fill given regions array + */ - GeoCreator.prototype.getFilledRegions = function (originRegionArr, mapName, nameMap, nameProperty) { - // Not use the original - var regionsArr = (originRegionArr || []).slice(); - var dataNameMap = createHashMap(); + GeoCreator.prototype.getFilledRegions = function (originRegionArr, mapName, nameMap, nameProperty) { + // Not use the original + var regionsArr = (originRegionArr || []).slice(); + var dataNameMap = createHashMap(); - for (var i = 0; i < regionsArr.length; i++) { - dataNameMap.set(regionsArr[i].name, regionsArr[i]); - } + for (var i = 0; i < regionsArr.length; i++) { + dataNameMap.set(regionsArr[i].name, regionsArr[i]); + } - var source = geoSourceManager.load(mapName, nameMap, nameProperty); - each(source.regions, function (region) { - var name = region.name; - !dataNameMap.get(name) && regionsArr.push({ - name: name - }); - }); - return regionsArr; - }; + var source = geoSourceManager.load(mapName, nameMap, nameProperty); + each(source.regions, function (region) { + var name = region.name; + !dataNameMap.get(name) && regionsArr.push({ + name: name + }); + }); + return regionsArr; + }; - return GeoCreator; - }(); + return GeoCreator; + }(); var geoCreator = new GeoCreator(); var GeoModel = - /** @class */ - function (_super) { - __extends(GeoModel, _super); + /** @class */ + function (_super) { + __extends(GeoModel, _super); - function GeoModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function GeoModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = GeoModel.type; - return _this; - } + _this.type = GeoModel.type; + return _this; + } - GeoModel.prototype.init = function (option, parentModel, ecModel) { - var source = geoSourceManager.getGeoResource(option.map); + GeoModel.prototype.init = function (option, parentModel, ecModel) { + var source = geoSourceManager.getGeoResource(option.map); - if (source && source.type === 'geoJSON') { - var itemStyle = option.itemStyle = option.itemStyle || {}; + if (source && source.type === 'geoJSON') { + var itemStyle = option.itemStyle = option.itemStyle || {}; - if (!('color' in itemStyle)) { - itemStyle.color = '#eee'; - } - } + if (!('color' in itemStyle)) { + itemStyle.color = '#eee'; + } + } - this.mergeDefaultAndTheme(option, ecModel); // Default label emphasis `show` + this.mergeDefaultAndTheme(option, ecModel); // Default label emphasis `show` - defaultEmphasis(option, 'label', ['show']); - }; + defaultEmphasis(option, 'label', ['show']); + }; - GeoModel.prototype.optionUpdated = function () { - var _this = this; + GeoModel.prototype.optionUpdated = function () { + var _this = this; - var option = this.option; - option.regions = geoCreator.getFilledRegions(option.regions, option.map, option.nameMap, option.nameProperty); - var selectedMap = {}; - this._optionModelMap = reduce(option.regions || [], function (optionModelMap, regionOpt) { - var regionName = regionOpt.name; + var option = this.option; + option.regions = geoCreator.getFilledRegions(option.regions, option.map, option.nameMap, option.nameProperty); + var selectedMap = {}; + this._optionModelMap = reduce(option.regions || [], function (optionModelMap, regionOpt) { + var regionName = regionOpt.name; - if (regionName) { - optionModelMap.set(regionName, new Model(regionOpt, _this, _this.ecModel)); + if (regionName) { + optionModelMap.set(regionName, new Model(regionOpt, _this, _this.ecModel)); - if (regionOpt.selected) { - selectedMap[regionName] = true; - } - } + if (regionOpt.selected) { + selectedMap[regionName] = true; + } + } - return optionModelMap; - }, createHashMap()); + return optionModelMap; + }, createHashMap()); - if (!option.selectedMap) { - option.selectedMap = selectedMap; - } - }; - /** - * Get model of region. - */ + if (!option.selectedMap) { + option.selectedMap = selectedMap; + } + }; + /** + * Get model of region. + */ - GeoModel.prototype.getRegionModel = function (name) { - return this._optionModelMap.get(name) || new Model(null, this, this.ecModel); - }; - /** - * Format label - * @param name Region name - */ + GeoModel.prototype.getRegionModel = function (name) { + return this._optionModelMap.get(name) || new Model(null, this, this.ecModel); + }; + /** + * Format label + * @param name Region name + */ - GeoModel.prototype.getFormattedLabel = function (name, status) { - var regionModel = this.getRegionModel(name); - var formatter = status === 'normal' ? regionModel.get(['label', 'formatter']) : regionModel.get(['emphasis', 'label', 'formatter']); - var params = { - name: name - }; + GeoModel.prototype.getFormattedLabel = function (name, status) { + var regionModel = this.getRegionModel(name); + var formatter = status === 'normal' ? regionModel.get(['label', 'formatter']) : regionModel.get(['emphasis', 'label', 'formatter']); + var params = { + name: name + }; - if (isFunction(formatter)) { - params.status = status; - return formatter(params); - } else if (isString(formatter)) { - return formatter.replace('{a}', name != null ? name : ''); - } - }; + if (isFunction(formatter)) { + params.status = status; + return formatter(params); + } else if (isString(formatter)) { + return formatter.replace('{a}', name != null ? name : ''); + } + }; - GeoModel.prototype.setZoom = function (zoom) { - this.option.zoom = zoom; - }; + GeoModel.prototype.setZoom = function (zoom) { + this.option.zoom = zoom; + }; - GeoModel.prototype.setCenter = function (center) { - this.option.center = center; - }; // PENGING If selectedMode is null ? + GeoModel.prototype.setCenter = function (center) { + this.option.center = center; + }; // PENGING If selectedMode is null ? - GeoModel.prototype.select = function (name) { - var option = this.option; - var selectedMode = option.selectedMode; + GeoModel.prototype.select = function (name) { + var option = this.option; + var selectedMode = option.selectedMode; - if (!selectedMode) { - return; - } + if (!selectedMode) { + return; + } - if (selectedMode !== 'multiple') { - option.selectedMap = null; - } + if (selectedMode !== 'multiple') { + option.selectedMap = null; + } - var selectedMap = option.selectedMap || (option.selectedMap = {}); - selectedMap[name] = true; - }; + var selectedMap = option.selectedMap || (option.selectedMap = {}); + selectedMap[name] = true; + }; - GeoModel.prototype.unSelect = function (name) { - var selectedMap = this.option.selectedMap; + GeoModel.prototype.unSelect = function (name) { + var selectedMap = this.option.selectedMap; - if (selectedMap) { - selectedMap[name] = false; - } - }; + if (selectedMap) { + selectedMap[name] = false; + } + }; - GeoModel.prototype.toggleSelected = function (name) { - this[this.isSelected(name) ? 'unSelect' : 'select'](name); - }; + GeoModel.prototype.toggleSelected = function (name) { + this[this.isSelected(name) ? 'unSelect' : 'select'](name); + }; - GeoModel.prototype.isSelected = function (name) { - var selectedMap = this.option.selectedMap; - return !!(selectedMap && selectedMap[name]); - }; + GeoModel.prototype.isSelected = function (name) { + var selectedMap = this.option.selectedMap; + return !!(selectedMap && selectedMap[name]); + }; - GeoModel.type = 'geo'; - GeoModel.layoutMode = 'box'; - GeoModel.defaultOption = { - // zlevel: 0, - z: 0, - show: true, - left: 'center', - top: 'center', - // Default value: - // for geoSVG source: 1, - // for geoJSON source: 0.75. - aspectScale: null, - ///// Layout with center and size - // If you wan't to put map in a fixed size box with right aspect ratio - // This two properties may more conveninet - // layoutCenter: [50%, 50%] - // layoutSize: 100 - silent: false, - // Map type - map: '', - // Define left-top, right-bottom coords to control view - // For example, [ [180, 90], [-180, -90] ] - boundingCoords: null, - // Default on center of map - center: null, - zoom: 1, - scaleLimit: null, - // selectedMode: false - label: { - show: false, - color: '#000' - }, - itemStyle: { - borderWidth: 0.5, - borderColor: '#444' // Default color: - // + geoJSON: #eee - // + geoSVG: null (use SVG original `fill`) - // color: '#eee' + GeoModel.type = 'geo'; + GeoModel.layoutMode = 'box'; + GeoModel.defaultOption = { + // zlevel: 0, + z: 0, + show: true, + left: 'center', + top: 'center', + // Default value: + // for geoSVG source: 1, + // for geoJSON source: 0.75. + aspectScale: null, + ///// Layout with center and size + // If you wan't to put map in a fixed size box with right aspect ratio + // This two properties may more conveninet + // layoutCenter: [50%, 50%] + // layoutSize: 100 + silent: false, + // Map type + map: '', + // Define left-top, right-bottom coords to control view + // For example, [ [180, 90], [-180, -90] ] + boundingCoords: null, + // Default on center of map + center: null, + zoom: 1, + scaleLimit: null, + // selectedMode: false + label: { + show: false, + color: '#000' + }, + itemStyle: { + borderWidth: 0.5, + borderColor: '#444' // Default color: + // + geoJSON: #eee + // + geoSVG: null (use SVG original `fill`) + // color: '#eee' - }, - emphasis: { - label: { - show: true, - color: 'rgb(100,0,0)' - }, - itemStyle: { - color: 'rgba(255,215,0,0.8)' - } - }, - select: { - label: { - show: true, - color: 'rgb(100,0,0)' - }, - itemStyle: { - color: 'rgba(255,215,0,0.8)' - } - }, - regions: [] // tooltip: { - // show: false - // } + }, + emphasis: { + label: { + show: true, + color: 'rgb(100,0,0)' + }, + itemStyle: { + color: 'rgba(255,215,0,0.8)' + } + }, + select: { + label: { + show: true, + color: 'rgb(100,0,0)' + }, + itemStyle: { + color: 'rgba(255,215,0,0.8)' + } + }, + regions: [] // tooltip: { + // show: false + // } - }; - return GeoModel; - }(ComponentModel); + }; + return GeoModel; + }(ComponentModel); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -53872,233 +53872,233 @@ * under the License. */ function getCenterCoord(view, point) { - // Use projected coord as center because it's linear. - return view.pointToProjected ? view.pointToProjected(point) : view.pointToData(point); + // Use projected coord as center because it's linear. + return view.pointToProjected ? view.pointToProjected(point) : view.pointToData(point); } function updateCenterAndZoom(view, payload, zoomLimit) { - var previousZoom = view.getZoom(); - var center = view.getCenter(); - var zoom = payload.zoom; - var point = view.projectedToPoint ? view.projectedToPoint(center) : view.dataToPoint(center); - - if (payload.dx != null && payload.dy != null) { - point[0] -= payload.dx; - point[1] -= payload.dy; - view.setCenter(getCenterCoord(view, point)); - } - - if (zoom != null) { - if (zoomLimit) { - var zoomMin = zoomLimit.min || 0; - var zoomMax = zoomLimit.max || Infinity; - zoom = Math.max(Math.min(previousZoom * zoom, zoomMax), zoomMin) / previousZoom; - } // Zoom on given point(originX, originY) + var previousZoom = view.getZoom(); + var center = view.getCenter(); + var zoom = payload.zoom; + var point = view.projectedToPoint ? view.projectedToPoint(center) : view.dataToPoint(center); + + if (payload.dx != null && payload.dy != null) { + point[0] -= payload.dx; + point[1] -= payload.dy; + view.setCenter(getCenterCoord(view, point)); + } + + if (zoom != null) { + if (zoomLimit) { + var zoomMin = zoomLimit.min || 0; + var zoomMax = zoomLimit.max || Infinity; + zoom = Math.max(Math.min(previousZoom * zoom, zoomMax), zoomMin) / previousZoom; + } // Zoom on given point(originX, originY) - view.scaleX *= zoom; - view.scaleY *= zoom; - var fixX = (payload.originX - view.x) * (zoom - 1); - var fixY = (payload.originY - view.y) * (zoom - 1); - view.x -= fixX; - view.y -= fixY; - view.updateTransform(); // Get the new center + view.scaleX *= zoom; + view.scaleY *= zoom; + var fixX = (payload.originX - view.x) * (zoom - 1); + var fixY = (payload.originY - view.y) * (zoom - 1); + view.x -= fixX; + view.y -= fixY; + view.updateTransform(); // Get the new center - view.setCenter(getCenterCoord(view, point)); - view.setZoom(zoom * previousZoom); - } + view.setCenter(getCenterCoord(view, point)); + view.setZoom(zoom * previousZoom); + } - return { - center: view.getCenter(), - zoom: view.getZoom() - }; + return { + center: view.getCenter(), + zoom: view.getZoom() + }; } var GeoView = - /** @class */ - function (_super) { - __extends(GeoView, _super); + /** @class */ + function (_super) { + __extends(GeoView, _super); - function GeoView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function GeoView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = GeoView.type; - _this.focusBlurEnabled = true; - return _this; - } + _this.type = GeoView.type; + _this.focusBlurEnabled = true; + return _this; + } - GeoView.prototype.init = function (ecModel, api) { - this._api = api; - }; + GeoView.prototype.init = function (ecModel, api) { + this._api = api; + }; - GeoView.prototype.render = function (geoModel, ecModel, api, payload) { - this._model = geoModel; + GeoView.prototype.render = function (geoModel, ecModel, api, payload) { + this._model = geoModel; - if (!geoModel.get('show')) { - this._mapDraw && this._mapDraw.remove(); - this._mapDraw = null; - return; - } + if (!geoModel.get('show')) { + this._mapDraw && this._mapDraw.remove(); + this._mapDraw = null; + return; + } - if (!this._mapDraw) { - this._mapDraw = new MapDraw(api); - } + if (!this._mapDraw) { + this._mapDraw = new MapDraw(api); + } - var mapDraw = this._mapDraw; - mapDraw.draw(geoModel, ecModel, api, this, payload); - mapDraw.group.on('click', this._handleRegionClick, this); - mapDraw.group.silent = geoModel.get('silent'); - this.group.add(mapDraw.group); - this.updateSelectStatus(geoModel, ecModel, api); - }; + var mapDraw = this._mapDraw; + mapDraw.draw(geoModel, ecModel, api, this, payload); + mapDraw.group.on('click', this._handleRegionClick, this); + mapDraw.group.silent = geoModel.get('silent'); + this.group.add(mapDraw.group); + this.updateSelectStatus(geoModel, ecModel, api); + }; - GeoView.prototype._handleRegionClick = function (e) { - var eventData; - findEventDispatcher(e.target, function (current) { - return (eventData = getECData(current).eventData) != null; - }, true); - - if (eventData) { - this._api.dispatchAction({ - type: 'geoToggleSelect', - geoId: this._model.id, - name: eventData.name - }); - } - }; + GeoView.prototype._handleRegionClick = function (e) { + var eventData; + findEventDispatcher(e.target, function (current) { + return (eventData = getECData(current).eventData) != null; + }, true); - GeoView.prototype.updateSelectStatus = function (model, ecModel, api) { - var _this = this; + if (eventData) { + this._api.dispatchAction({ + type: 'geoToggleSelect', + geoId: this._model.id, + name: eventData.name + }); + } + }; - this._mapDraw.group.traverse(function (node) { - var eventData = getECData(node).eventData; + GeoView.prototype.updateSelectStatus = function (model, ecModel, api) { + var _this = this; - if (eventData) { - _this._model.isSelected(eventData.name) ? api.enterSelect(node) : api.leaveSelect(node); // No need to traverse children. + this._mapDraw.group.traverse(function (node) { + var eventData = getECData(node).eventData; - return true; - } - }); - }; + if (eventData) { + _this._model.isSelected(eventData.name) ? api.enterSelect(node) : api.leaveSelect(node); // No need to traverse children. - GeoView.prototype.findHighDownDispatchers = function (name) { - return this._mapDraw && this._mapDraw.findHighDownDispatchers(name, this._model); - }; + return true; + } + }); + }; - GeoView.prototype.dispose = function () { - this._mapDraw && this._mapDraw.remove(); - }; + GeoView.prototype.findHighDownDispatchers = function (name) { + return this._mapDraw && this._mapDraw.findHighDownDispatchers(name, this._model); + }; + + GeoView.prototype.dispose = function () { + this._mapDraw && this._mapDraw.remove(); + }; - GeoView.type = 'geo'; - return GeoView; - }(ComponentView); + GeoView.type = 'geo'; + return GeoView; + }(ComponentView); function registerMap$1(mapName, geoJson, specialAreas) { - geoSourceManager.registerMap(mapName, geoJson, specialAreas); + geoSourceManager.registerMap(mapName, geoJson, specialAreas); } function install$9(registers) { - registers.registerCoordinateSystem('geo', geoCreator); - registers.registerComponentModel(GeoModel); - registers.registerComponentView(GeoView); - registers.registerImpl('registerMap', registerMap$1); - registers.registerImpl('getMap', function (mapName) { - return geoSourceManager.getMapForUser(mapName); - }); - - function makeAction(method, actionInfo) { - actionInfo.update = 'geo:updateSelectStatus'; - registers.registerAction(actionInfo, function (payload, ecModel) { - var selected = {}; - var allSelected = []; - ecModel.eachComponent({ - mainType: 'geo', - query: payload - }, function (geoModel) { - geoModel[method](payload.name); - var geo = geoModel.coordinateSystem; - each(geo.regions, function (region) { - selected[region.name] = geoModel.isSelected(region.name) || false; - }); // Notice: there might be duplicated name in different regions. - - var names = []; - each(selected, function (v, name) { - selected[name] && names.push(name); - }); - allSelected.push({ - geoIndex: geoModel.componentIndex, - // Use singular, the same naming convention as the event `selectchanged`. - name: names - }); - }); - return { - selected: selected, - allSelected: allSelected, - name: payload.name - }; + registers.registerCoordinateSystem('geo', geoCreator); + registers.registerComponentModel(GeoModel); + registers.registerComponentView(GeoView); + registers.registerImpl('registerMap', registerMap$1); + registers.registerImpl('getMap', function (mapName) { + return geoSourceManager.getMapForUser(mapName); + }); + + function makeAction(method, actionInfo) { + actionInfo.update = 'geo:updateSelectStatus'; + registers.registerAction(actionInfo, function (payload, ecModel) { + var selected = {}; + var allSelected = []; + ecModel.eachComponent({ + mainType: 'geo', + query: payload + }, function (geoModel) { + geoModel[method](payload.name); + var geo = geoModel.coordinateSystem; + each(geo.regions, function (region) { + selected[region.name] = geoModel.isSelected(region.name) || false; + }); // Notice: there might be duplicated name in different regions. + + var names = []; + each(selected, function (v, name) { + selected[name] && names.push(name); }); - } - - makeAction('toggleSelected', { - type: 'geoToggleSelect', - event: 'geoselectchanged' - }); - makeAction('select', { - type: 'geoSelect', - event: 'geoselected' - }); - makeAction('unSelect', { - type: 'geoUnSelect', - event: 'geounselected' + allSelected.push({ + geoIndex: geoModel.componentIndex, + // Use singular, the same naming convention as the event `selectchanged`. + name: names + }); + }); + return { + selected: selected, + allSelected: allSelected, + name: payload.name + }; }); - /** - * @payload - * @property {string} [componentType=series] - * @property {number} [dx] - * @property {number} [dy] - * @property {number} [zoom] - * @property {number} [originX] - * @property {number} [originY] - */ + } + + makeAction('toggleSelected', { + type: 'geoToggleSelect', + event: 'geoselectchanged' + }); + makeAction('select', { + type: 'geoSelect', + event: 'geoselected' + }); + makeAction('unSelect', { + type: 'geoUnSelect', + event: 'geounselected' + }); + /** + * @payload + * @property {string} [componentType=series] + * @property {number} [dx] + * @property {number} [dy] + * @property {number} [zoom] + * @property {number} [originX] + * @property {number} [originY] + */ - registers.registerAction({ - type: 'geoRoam', - event: 'geoRoam', - update: 'updateTransform' - }, function (payload, ecModel) { - var componentType = payload.componentType || 'series'; - ecModel.eachComponent({ - mainType: componentType, - query: payload - }, function (componentModel) { - var geo = componentModel.coordinateSystem; - - if (geo.type !== 'geo') { - return; - } + registers.registerAction({ + type: 'geoRoam', + event: 'geoRoam', + update: 'updateTransform' + }, function (payload, ecModel) { + var componentType = payload.componentType || 'series'; + ecModel.eachComponent({ + mainType: componentType, + query: payload + }, function (componentModel) { + var geo = componentModel.coordinateSystem; - var res = updateCenterAndZoom(geo, payload, componentModel.get('scaleLimit')); - componentModel.setCenter && componentModel.setCenter(res.center); - componentModel.setZoom && componentModel.setZoom(res.zoom); // All map series with same `map` use the same geo coordinate system - // So the center and zoom must be in sync. Include the series not selected by legend + if (geo.type !== 'geo') { + return; + } - if (componentType === 'series') { - each(componentModel.seriesGroup, function (seriesModel) { - seriesModel.setCenter(res.center); - seriesModel.setZoom(res.zoom); - }); - } + var res = updateCenterAndZoom(geo, payload, componentModel.get('scaleLimit')); + componentModel.setCenter && componentModel.setCenter(res.center); + componentModel.setZoom && componentModel.setZoom(res.zoom); // All map series with same `map` use the same geo coordinate system + // So the center and zoom must be in sync. Include the series not selected by legend + + if (componentType === 'series') { + each(componentModel.seriesGroup, function (seriesModel) { + seriesModel.setCenter(res.center); + seriesModel.setZoom(res.zoom); }); + } }); + }); } function install$a(registers) { - use(install$9); - registers.registerChartView(MapView); - registers.registerSeriesModel(MapSeries); - registers.registerLayout(mapSymbolLayout); - registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic); - createLegacyDataSelectAction('map', registers.registerAction); + use(install$9); + registers.registerChartView(MapView); + registers.registerSeriesModel(MapSeries); + registers.registerLayout(mapSymbolLayout); + registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic); + createLegacyDataSelectAction('map', registers.registerAction); } /** @@ -54106,44 +54106,44 @@ */ function init$2(inRoot) { - var root = inRoot; - root.hierNode = { - defaultAncestor: null, - ancestor: root, - prelim: 0, - modifier: 0, - change: 0, - shift: 0, - i: 0, - thread: null - }; - var nodes = [root]; - var node; - var children; - - while (node = nodes.pop()) { - // jshint ignore:line - children = node.children; - - if (node.isExpand && children.length) { - var n = children.length; - - for (var i = n - 1; i >= 0; i--) { - var child = children[i]; - child.hierNode = { - defaultAncestor: null, - ancestor: child, - prelim: 0, - modifier: 0, - change: 0, - shift: 0, - i: i, - thread: null - }; - nodes.push(child); - } - } - } + var root = inRoot; + root.hierNode = { + defaultAncestor: null, + ancestor: root, + prelim: 0, + modifier: 0, + change: 0, + shift: 0, + i: 0, + thread: null + }; + var nodes = [root]; + var node; + var children; + + while (node = nodes.pop()) { + // jshint ignore:line + children = node.children; + + if (node.isExpand && children.length) { + var n = children.length; + + for (var i = n - 1; i >= 0; i--) { + var child = children[i]; + child.hierNode = { + defaultAncestor: null, + ancestor: child, + prelim: 0, + modifier: 0, + change: 0, + shift: 0, + i: i, + thread: null + }; + nodes.push(child); + } + } + } } /** * The implementation of this function was originally copied from "d3.js" @@ -54158,25 +54158,25 @@ */ function firstWalk(node, separation) { - var children = node.isExpand ? node.children : []; - var siblings = node.parentNode.children; - var subtreeW = node.hierNode.i ? siblings[node.hierNode.i - 1] : null; + var children = node.isExpand ? node.children : []; + var siblings = node.parentNode.children; + var subtreeW = node.hierNode.i ? siblings[node.hierNode.i - 1] : null; - if (children.length) { - executeShifts(node); - var midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2; + if (children.length) { + executeShifts(node); + var midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2; - if (subtreeW) { - node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW); - node.hierNode.modifier = node.hierNode.prelim - midPoint; - } else { - node.hierNode.prelim = midPoint; - } - } else if (subtreeW) { - node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW); + if (subtreeW) { + node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW); + node.hierNode.modifier = node.hierNode.prelim - midPoint; + } else { + node.hierNode.prelim = midPoint; } + } else if (subtreeW) { + node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW); + } - node.parentNode.hierNode.defaultAncestor = apportion(node, subtreeW, node.parentNode.hierNode.defaultAncestor || siblings[0], separation); + node.parentNode.hierNode.defaultAncestor = apportion(node, subtreeW, node.parentNode.hierNode.defaultAncestor || siblings[0], separation); } /** * The implementation of this function was originally copied from "d3.js" @@ -54188,35 +54188,35 @@ */ function secondWalk(node) { - var nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier; - node.setLayout({ - x: nodeX - }, true); - node.hierNode.modifier += node.parentNode.hierNode.modifier; + var nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier; + node.setLayout({ + x: nodeX + }, true); + node.hierNode.modifier += node.parentNode.hierNode.modifier; } function separation(cb) { - return arguments.length ? cb : defaultSeparation; + return arguments.length ? cb : defaultSeparation; } /** * Transform the common coordinate to radial coordinate. */ function radialCoordinate(rad, r) { - rad -= Math.PI / 2; - return { - x: r * Math.cos(rad), - y: r * Math.sin(rad) - }; + rad -= Math.PI / 2; + return { + x: r * Math.cos(rad), + y: r * Math.sin(rad) + }; } /** * Get the layout position of the whole view. */ function getViewRect$1(seriesModel, api) { - return getLayoutRect(seriesModel.getBoxLayoutParams(), { - width: api.getWidth(), - height: api.getHeight() - }); + return getLayoutRect(seriesModel.getBoxLayoutParams(), { + width: api.getWidth(), + height: api.getHeight() + }); } /** * All other shifts, applied to the smaller subtrees between w- and w+, are @@ -54229,18 +54229,18 @@ */ function executeShifts(node) { - var children = node.children; - var n = children.length; - var shift = 0; - var change = 0; - - while (--n >= 0) { - var child = children[n]; - child.hierNode.prelim += shift; - child.hierNode.modifier += shift; - change += child.hierNode.change; - shift += child.hierNode.shift + change; - } + var children = node.children; + var n = children.length; + var shift = 0; + var change = 0; + + while (--n >= 0) { + var child = children[n]; + child.hierNode.prelim += shift; + child.hierNode.modifier += shift; + change += child.hierNode.change; + shift += child.hierNode.shift + change; + } } /** * The implementation of this function was originally copied from "d3.js" @@ -54259,47 +54259,47 @@ function apportion(subtreeV, subtreeW, ancestor, separation) { - if (subtreeW) { - var nodeOutRight = subtreeV; - var nodeInRight = subtreeV; - var nodeOutLeft = nodeInRight.parentNode.children[0]; - var nodeInLeft = subtreeW; - var sumOutRight = nodeOutRight.hierNode.modifier; - var sumInRight = nodeInRight.hierNode.modifier; - var sumOutLeft = nodeOutLeft.hierNode.modifier; - var sumInLeft = nodeInLeft.hierNode.modifier; + if (subtreeW) { + var nodeOutRight = subtreeV; + var nodeInRight = subtreeV; + var nodeOutLeft = nodeInRight.parentNode.children[0]; + var nodeInLeft = subtreeW; + var sumOutRight = nodeOutRight.hierNode.modifier; + var sumInRight = nodeInRight.hierNode.modifier; + var sumOutLeft = nodeOutLeft.hierNode.modifier; + var sumInLeft = nodeInLeft.hierNode.modifier; - while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) { - nodeOutRight = nextRight(nodeOutRight); - nodeOutLeft = nextLeft(nodeOutLeft); - nodeOutRight.hierNode.ancestor = subtreeV; - var shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim - sumInRight + separation(nodeInLeft, nodeInRight); + while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) { + nodeOutRight = nextRight(nodeOutRight); + nodeOutLeft = nextLeft(nodeOutLeft); + nodeOutRight.hierNode.ancestor = subtreeV; + var shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim - sumInRight + separation(nodeInLeft, nodeInRight); - if (shift > 0) { - moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift); - sumInRight += shift; - sumOutRight += shift; - } + if (shift > 0) { + moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift); + sumInRight += shift; + sumOutRight += shift; + } - sumInLeft += nodeInLeft.hierNode.modifier; - sumInRight += nodeInRight.hierNode.modifier; - sumOutRight += nodeOutRight.hierNode.modifier; - sumOutLeft += nodeOutLeft.hierNode.modifier; - } + sumInLeft += nodeInLeft.hierNode.modifier; + sumInRight += nodeInRight.hierNode.modifier; + sumOutRight += nodeOutRight.hierNode.modifier; + sumOutLeft += nodeOutLeft.hierNode.modifier; + } - if (nodeInLeft && !nextRight(nodeOutRight)) { - nodeOutRight.hierNode.thread = nodeInLeft; - nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight; - } + if (nodeInLeft && !nextRight(nodeOutRight)) { + nodeOutRight.hierNode.thread = nodeInLeft; + nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight; + } - if (nodeInRight && !nextLeft(nodeOutLeft)) { - nodeOutLeft.hierNode.thread = nodeInRight; - nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft; - ancestor = subtreeV; - } + if (nodeInRight && !nextLeft(nodeOutLeft)) { + nodeOutLeft.hierNode.thread = nodeInRight; + nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft; + ancestor = subtreeV; } + } - return ancestor; + return ancestor; } /** * This function is used to traverse the right contour of a subtree. @@ -54309,8 +54309,8 @@ function nextRight(node) { - var children = node.children; - return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread; + var children = node.children; + return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread; } /** * This function is used to traverse the left contour of a subtree (or a subforest). @@ -54320,8 +54320,8 @@ function nextLeft(node) { - var children = node.children; - return children.length && node.isExpand ? children[0] : node.hierNode.thread; + var children = node.children; + return children.length && node.isExpand ? children[0] : node.hierNode.thread; } /** * If nodeInLeft’s ancestor is a sibling of node, returns nodeInLeft’s ancestor. @@ -54330,7 +54330,7 @@ function nextAncestor(nodeInLeft, node, ancestor) { - return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode ? nodeInLeft.hierNode.ancestor : ancestor; + return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode ? nodeInLeft.hierNode.ancestor : ancestor; } /** * The implementation of this function was originally copied from "d3.js" @@ -54344,12 +54344,12 @@ function moveSubtree(wl, wr, shift) { - var change = shift / (wr.hierNode.i - wl.hierNode.i); - wr.hierNode.change -= change; - wr.hierNode.shift += shift; - wr.hierNode.modifier += shift; - wr.hierNode.prelim += shift; - wl.hierNode.change += change; + var change = shift / (wr.hierNode.i - wl.hierNode.i); + wr.hierNode.change -= change; + wr.hierNode.shift += shift; + wr.hierNode.modifier += shift; + wr.hierNode.prelim += shift; + wl.hierNode.change += change; } /** * The implementation of this function was originally copied from "d3.js" @@ -54360,722 +54360,722 @@ function defaultSeparation(node1, node2) { - return node1.parentNode === node2.parentNode ? 1 : 2; + return node1.parentNode === node2.parentNode ? 1 : 2; } var TreeEdgeShape = - /** @class */ - function () { - function TreeEdgeShape() { - this.parentPoint = []; - this.childPoints = []; - } - - return TreeEdgeShape; - }(); + /** @class */ + function () { + function TreeEdgeShape() { + this.parentPoint = []; + this.childPoints = []; + } + + return TreeEdgeShape; + }(); var TreePath = - /** @class */ - function (_super) { - __extends(TreePath, _super); - - function TreePath(opts) { - return _super.call(this, opts) || this; - } - - TreePath.prototype.getDefaultStyle = function () { - return { - stroke: '#000', - fill: null - }; - }; - - TreePath.prototype.getDefaultShape = function () { - return new TreeEdgeShape(); - }; - - TreePath.prototype.buildPath = function (ctx, shape) { - var childPoints = shape.childPoints; - var childLen = childPoints.length; - var parentPoint = shape.parentPoint; - var firstChildPos = childPoints[0]; - var lastChildPos = childPoints[childLen - 1]; - - if (childLen === 1) { - ctx.moveTo(parentPoint[0], parentPoint[1]); - ctx.lineTo(firstChildPos[0], firstChildPos[1]); - return; - } + /** @class */ + function (_super) { + __extends(TreePath, _super); - var orient = shape.orient; - var forkDim = orient === 'TB' || orient === 'BT' ? 0 : 1; - var otherDim = 1 - forkDim; - var forkPosition = parsePercent$1(shape.forkPosition, 1); - var tmpPoint = []; - tmpPoint[forkDim] = parentPoint[forkDim]; - tmpPoint[otherDim] = parentPoint[otherDim] + (lastChildPos[otherDim] - parentPoint[otherDim]) * forkPosition; - ctx.moveTo(parentPoint[0], parentPoint[1]); - ctx.lineTo(tmpPoint[0], tmpPoint[1]); - ctx.moveTo(firstChildPos[0], firstChildPos[1]); - tmpPoint[forkDim] = firstChildPos[forkDim]; - ctx.lineTo(tmpPoint[0], tmpPoint[1]); - tmpPoint[forkDim] = lastChildPos[forkDim]; - ctx.lineTo(tmpPoint[0], tmpPoint[1]); - ctx.lineTo(lastChildPos[0], lastChildPos[1]); - - for (var i = 1; i < childLen - 1; i++) { - var point = childPoints[i]; - ctx.moveTo(point[0], point[1]); - tmpPoint[forkDim] = point[forkDim]; - ctx.lineTo(tmpPoint[0], tmpPoint[1]); - } - }; + function TreePath(opts) { + return _super.call(this, opts) || this; + } - return TreePath; - }(Path); + TreePath.prototype.getDefaultStyle = function () { + return { + stroke: '#000', + fill: null + }; + }; + + TreePath.prototype.getDefaultShape = function () { + return new TreeEdgeShape(); + }; + + TreePath.prototype.buildPath = function (ctx, shape) { + var childPoints = shape.childPoints; + var childLen = childPoints.length; + var parentPoint = shape.parentPoint; + var firstChildPos = childPoints[0]; + var lastChildPos = childPoints[childLen - 1]; + + if (childLen === 1) { + ctx.moveTo(parentPoint[0], parentPoint[1]); + ctx.lineTo(firstChildPos[0], firstChildPos[1]); + return; + } + + var orient = shape.orient; + var forkDim = orient === 'TB' || orient === 'BT' ? 0 : 1; + var otherDim = 1 - forkDim; + var forkPosition = parsePercent$1(shape.forkPosition, 1); + var tmpPoint = []; + tmpPoint[forkDim] = parentPoint[forkDim]; + tmpPoint[otherDim] = parentPoint[otherDim] + (lastChildPos[otherDim] - parentPoint[otherDim]) * forkPosition; + ctx.moveTo(parentPoint[0], parentPoint[1]); + ctx.lineTo(tmpPoint[0], tmpPoint[1]); + ctx.moveTo(firstChildPos[0], firstChildPos[1]); + tmpPoint[forkDim] = firstChildPos[forkDim]; + ctx.lineTo(tmpPoint[0], tmpPoint[1]); + tmpPoint[forkDim] = lastChildPos[forkDim]; + ctx.lineTo(tmpPoint[0], tmpPoint[1]); + ctx.lineTo(lastChildPos[0], lastChildPos[1]); + + for (var i = 1; i < childLen - 1; i++) { + var point = childPoints[i]; + ctx.moveTo(point[0], point[1]); + tmpPoint[forkDim] = point[forkDim]; + ctx.lineTo(tmpPoint[0], tmpPoint[1]); + } + }; + + return TreePath; + }(Path); var TreeView = - /** @class */ - function (_super) { - __extends(TreeView, _super); - - function TreeView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = TreeView.type; - _this._mainGroup = new Group(); - return _this; - } + /** @class */ + function (_super) { + __extends(TreeView, _super); - TreeView.prototype.init = function (ecModel, api) { - this._controller = new RoamController(api.getZr()); - this._controllerHost = { - target: this.group - }; - this.group.add(this._mainGroup); - }; + function TreeView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - TreeView.prototype.render = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - var layoutInfo = seriesModel.layoutInfo; - var group = this._mainGroup; - var layout = seriesModel.get('layout'); + _this.type = TreeView.type; + _this._mainGroup = new Group(); + return _this; + } - if (layout === 'radial') { - group.x = layoutInfo.x + layoutInfo.width / 2; - group.y = layoutInfo.y + layoutInfo.height / 2; - } else { - group.x = layoutInfo.x; - group.y = layoutInfo.y; - } + TreeView.prototype.init = function (ecModel, api) { + this._controller = new RoamController(api.getZr()); + this._controllerHost = { + target: this.group + }; + this.group.add(this._mainGroup); + }; - this._updateViewCoordSys(seriesModel); + TreeView.prototype.render = function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); + var layoutInfo = seriesModel.layoutInfo; + var group = this._mainGroup; + var layout = seriesModel.get('layout'); - this._updateController(seriesModel, ecModel, api); + if (layout === 'radial') { + group.x = layoutInfo.x + layoutInfo.width / 2; + group.y = layoutInfo.y + layoutInfo.height / 2; + } else { + group.x = layoutInfo.x; + group.y = layoutInfo.y; + } - var oldData = this._data; - data.diff(oldData).add(function (newIdx) { - if (symbolNeedsDraw$1(data, newIdx)) { - // Create node and edge - updateNode(data, newIdx, null, group, seriesModel); - } - }).update(function (newIdx, oldIdx) { - var symbolEl = oldData.getItemGraphicEl(oldIdx); + this._updateViewCoordSys(seriesModel); - if (!symbolNeedsDraw$1(data, newIdx)) { - symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel); - return; - } // Update node and edge + this._updateController(seriesModel, ecModel, api); + var oldData = this._data; + data.diff(oldData).add(function (newIdx) { + if (symbolNeedsDraw$1(data, newIdx)) { + // Create node and edge + updateNode(data, newIdx, null, group, seriesModel); + } + }).update(function (newIdx, oldIdx) { + var symbolEl = oldData.getItemGraphicEl(oldIdx); - updateNode(data, newIdx, symbolEl, group, seriesModel); - }).remove(function (oldIdx) { - var symbolEl = oldData.getItemGraphicEl(oldIdx); // When remove a collapsed node of subtree, since the collapsed - // node haven't been initialized with a symbol element, - // you can't found it's symbol element through index. - // so if we want to remove the symbol element we should insure - // that the symbol element is not null. + if (!symbolNeedsDraw$1(data, newIdx)) { + symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel); + return; + } // Update node and edge - if (symbolEl) { - removeNode(oldData, oldIdx, symbolEl, group, seriesModel); - } - }).execute(); - this._nodeScaleRatio = seriesModel.get('nodeScaleRatio'); - - this._updateNodeAndLinkScale(seriesModel); - - if (seriesModel.get('expandAndCollapse') === true) { - data.eachItemGraphicEl(function (el, dataIndex) { - el.off('click').on('click', function () { - api.dispatchAction({ - type: 'treeExpandAndCollapse', - seriesId: seriesModel.id, - dataIndex: dataIndex - }); - }); - }); - } - this._data = data; - }; + updateNode(data, newIdx, symbolEl, group, seriesModel); + }).remove(function (oldIdx) { + var symbolEl = oldData.getItemGraphicEl(oldIdx); // When remove a collapsed node of subtree, since the collapsed + // node haven't been initialized with a symbol element, + // you can't found it's symbol element through index. + // so if we want to remove the symbol element we should insure + // that the symbol element is not null. - TreeView.prototype._updateViewCoordSys = function (seriesModel) { - var data = seriesModel.getData(); - var points = []; - data.each(function (idx) { - var layout = data.getItemLayout(idx); + if (symbolEl) { + removeNode(oldData, oldIdx, symbolEl, group, seriesModel); + } + }).execute(); + this._nodeScaleRatio = seriesModel.get('nodeScaleRatio'); + + this._updateNodeAndLinkScale(seriesModel); + + if (seriesModel.get('expandAndCollapse') === true) { + data.eachItemGraphicEl(function (el, dataIndex) { + el.off('click').on('click', function () { + api.dispatchAction({ + type: 'treeExpandAndCollapse', + seriesId: seriesModel.id, + dataIndex: dataIndex + }); + }); + }); + } - if (layout && !isNaN(layout.x) && !isNaN(layout.y)) { - points.push([+layout.x, +layout.y]); - } - }); - var min = []; - var max = []; - fromPoints(points, min, max); // If don't Store min max when collapse the root node after roam, - // the root node will disappear. + this._data = data; + }; - var oldMin = this._min; - var oldMax = this._max; // If width or height is 0 + TreeView.prototype._updateViewCoordSys = function (seriesModel) { + var data = seriesModel.getData(); + var points = []; + data.each(function (idx) { + var layout = data.getItemLayout(idx); - if (max[0] - min[0] === 0) { - min[0] = oldMin ? oldMin[0] : min[0] - 1; - max[0] = oldMax ? oldMax[0] : max[0] + 1; - } + if (layout && !isNaN(layout.x) && !isNaN(layout.y)) { + points.push([+layout.x, +layout.y]); + } + }); + var min = []; + var max = []; + fromPoints(points, min, max); // If don't Store min max when collapse the root node after roam, + // the root node will disappear. - if (max[1] - min[1] === 0) { - min[1] = oldMin ? oldMin[1] : min[1] - 1; - max[1] = oldMax ? oldMax[1] : max[1] + 1; - } + var oldMin = this._min; + var oldMax = this._max; // If width or height is 0 - var viewCoordSys = seriesModel.coordinateSystem = new View(); - viewCoordSys.zoomLimit = seriesModel.get('scaleLimit'); - viewCoordSys.setBoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]); - viewCoordSys.setCenter(seriesModel.get('center')); - viewCoordSys.setZoom(seriesModel.get('zoom')); // Here we use viewCoordSys just for computing the 'position' and 'scale' of the group + if (max[0] - min[0] === 0) { + min[0] = oldMin ? oldMin[0] : min[0] - 1; + max[0] = oldMax ? oldMax[0] : max[0] + 1; + } - this.group.attr({ - x: viewCoordSys.x, - y: viewCoordSys.y, - scaleX: viewCoordSys.scaleX, - scaleY: viewCoordSys.scaleY - }); - this._min = min; - this._max = max; - }; + if (max[1] - min[1] === 0) { + min[1] = oldMin ? oldMin[1] : min[1] - 1; + max[1] = oldMax ? oldMax[1] : max[1] + 1; + } - TreeView.prototype._updateController = function (seriesModel, ecModel, api) { - var _this = this; + var viewCoordSys = seriesModel.coordinateSystem = new View(); + viewCoordSys.zoomLimit = seriesModel.get('scaleLimit'); + viewCoordSys.setBoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]); + viewCoordSys.setCenter(seriesModel.get('center')); + viewCoordSys.setZoom(seriesModel.get('zoom')); // Here we use viewCoordSys just for computing the 'position' and 'scale' of the group - var controller = this._controller; - var controllerHost = this._controllerHost; - var group = this.group; - controller.setPointerChecker(function (e, x, y) { - var rect = group.getBoundingRect(); - rect.applyTransform(group.transform); - return rect.contain(x, y) && !onIrrelevantElement(e, api, seriesModel); - }); - controller.enable(seriesModel.get('roam')); - controllerHost.zoomLimit = seriesModel.get('scaleLimit'); - controllerHost.zoom = seriesModel.coordinateSystem.getZoom(); - controller.off('pan').off('zoom').on('pan', function (e) { - updateViewOnPan(controllerHost, e.dx, e.dy); - api.dispatchAction({ - seriesId: seriesModel.id, - type: 'treeRoam', - dx: e.dx, - dy: e.dy - }); - }).on('zoom', function (e) { - updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY); - api.dispatchAction({ - seriesId: seriesModel.id, - type: 'treeRoam', - zoom: e.scale, - originX: e.originX, - originY: e.originY - }); + this.group.attr({ + x: viewCoordSys.x, + y: viewCoordSys.y, + scaleX: viewCoordSys.scaleX, + scaleY: viewCoordSys.scaleY + }); + this._min = min; + this._max = max; + }; + + TreeView.prototype._updateController = function (seriesModel, ecModel, api) { + var _this = this; + + var controller = this._controller; + var controllerHost = this._controllerHost; + var group = this.group; + controller.setPointerChecker(function (e, x, y) { + var rect = group.getBoundingRect(); + rect.applyTransform(group.transform); + return rect.contain(x, y) && !onIrrelevantElement(e, api, seriesModel); + }); + controller.enable(seriesModel.get('roam')); + controllerHost.zoomLimit = seriesModel.get('scaleLimit'); + controllerHost.zoom = seriesModel.coordinateSystem.getZoom(); + controller.off('pan').off('zoom').on('pan', function (e) { + updateViewOnPan(controllerHost, e.dx, e.dy); + api.dispatchAction({ + seriesId: seriesModel.id, + type: 'treeRoam', + dx: e.dx, + dy: e.dy + }); + }).on('zoom', function (e) { + updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY); + api.dispatchAction({ + seriesId: seriesModel.id, + type: 'treeRoam', + zoom: e.scale, + originX: e.originX, + originY: e.originY + }); - _this._updateNodeAndLinkScale(seriesModel); // Only update label layout on zoom + _this._updateNodeAndLinkScale(seriesModel); // Only update label layout on zoom - api.updateLabelLayout(); - }); - }; + api.updateLabelLayout(); + }); + }; - TreeView.prototype._updateNodeAndLinkScale = function (seriesModel) { - var data = seriesModel.getData(); + TreeView.prototype._updateNodeAndLinkScale = function (seriesModel) { + var data = seriesModel.getData(); - var nodeScale = this._getNodeGlobalScale(seriesModel); + var nodeScale = this._getNodeGlobalScale(seriesModel); - data.eachItemGraphicEl(function (el, idx) { - el.setSymbolScale(nodeScale); - }); - }; + data.eachItemGraphicEl(function (el, idx) { + el.setSymbolScale(nodeScale); + }); + }; - TreeView.prototype._getNodeGlobalScale = function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; + TreeView.prototype._getNodeGlobalScale = function (seriesModel) { + var coordSys = seriesModel.coordinateSystem; - if (coordSys.type !== 'view') { - return 1; - } + if (coordSys.type !== 'view') { + return 1; + } - var nodeScaleRatio = this._nodeScaleRatio; - var groupZoom = coordSys.scaleX || 1; // Scale node when zoom changes + var nodeScaleRatio = this._nodeScaleRatio; + var groupZoom = coordSys.scaleX || 1; // Scale node when zoom changes - var roamZoom = coordSys.getZoom(); - var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1; - return nodeScale / groupZoom; - }; + var roamZoom = coordSys.getZoom(); + var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1; + return nodeScale / groupZoom; + }; - TreeView.prototype.dispose = function () { - this._controller && this._controller.dispose(); - this._controllerHost = null; - }; + TreeView.prototype.dispose = function () { + this._controller && this._controller.dispose(); + this._controllerHost = null; + }; - TreeView.prototype.remove = function () { - this._mainGroup.removeAll(); + TreeView.prototype.remove = function () { + this._mainGroup.removeAll(); - this._data = null; - }; + this._data = null; + }; - TreeView.type = 'tree'; - return TreeView; - }(ChartView); + TreeView.type = 'tree'; + return TreeView; + }(ChartView); function symbolNeedsDraw$1(data, dataIndex) { - var layout = data.getItemLayout(dataIndex); - return layout && !isNaN(layout.x) && !isNaN(layout.y); + var layout = data.getItemLayout(dataIndex); + return layout && !isNaN(layout.x) && !isNaN(layout.y); } function updateNode(data, dataIndex, symbolEl, group, seriesModel) { - var isInit = !symbolEl; - var node = data.tree.getNodeByDataIndex(dataIndex); - var itemModel = node.getModel(); - var visualColor = node.getVisual('style').fill; - var symbolInnerColor = node.isExpand === false && node.children.length !== 0 ? visualColor : '#fff'; - var virtualRoot = data.tree.root; - var source = node.parentNode === virtualRoot ? node : node.parentNode || node; - var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex); - var sourceLayout = source.getLayout(); - var sourceOldLayout = sourceSymbolEl ? { - x: sourceSymbolEl.__oldX, - y: sourceSymbolEl.__oldY, - rawX: sourceSymbolEl.__radialOldRawX, - rawY: sourceSymbolEl.__radialOldRawY - } : sourceLayout; - var targetLayout = node.getLayout(); - - if (isInit) { - symbolEl = new Symbol(data, dataIndex, null, { - symbolInnerColor: symbolInnerColor, - useNameLabel: true - }); - symbolEl.x = sourceOldLayout.x; - symbolEl.y = sourceOldLayout.y; + var isInit = !symbolEl; + var node = data.tree.getNodeByDataIndex(dataIndex); + var itemModel = node.getModel(); + var visualColor = node.getVisual('style').fill; + var symbolInnerColor = node.isExpand === false && node.children.length !== 0 ? visualColor : '#fff'; + var virtualRoot = data.tree.root; + var source = node.parentNode === virtualRoot ? node : node.parentNode || node; + var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex); + var sourceLayout = source.getLayout(); + var sourceOldLayout = sourceSymbolEl ? { + x: sourceSymbolEl.__oldX, + y: sourceSymbolEl.__oldY, + rawX: sourceSymbolEl.__radialOldRawX, + rawY: sourceSymbolEl.__radialOldRawY + } : sourceLayout; + var targetLayout = node.getLayout(); + + if (isInit) { + symbolEl = new Symbol(data, dataIndex, null, { + symbolInnerColor: symbolInnerColor, + useNameLabel: true + }); + symbolEl.x = sourceOldLayout.x; + symbolEl.y = sourceOldLayout.y; + } else { + symbolEl.updateData(data, dataIndex, null, { + symbolInnerColor: symbolInnerColor, + useNameLabel: true + }); + } + + symbolEl.__radialOldRawX = symbolEl.__radialRawX; + symbolEl.__radialOldRawY = symbolEl.__radialRawY; + symbolEl.__radialRawX = targetLayout.rawX; + symbolEl.__radialRawY = targetLayout.rawY; + group.add(symbolEl); + data.setItemGraphicEl(dataIndex, symbolEl); + symbolEl.__oldX = symbolEl.x; + symbolEl.__oldY = symbolEl.y; + updateProps(symbolEl, { + x: targetLayout.x, + y: targetLayout.y + }, seriesModel); + var symbolPath = symbolEl.getSymbolPath(); + + if (seriesModel.get('layout') === 'radial') { + var realRoot = virtualRoot.children[0]; + var rootLayout = realRoot.getLayout(); + var length_1 = realRoot.children.length; + var rad = void 0; + var isLeft = void 0; + + if (targetLayout.x === rootLayout.x && node.isExpand === true) { + var center = { + x: (realRoot.children[0].getLayout().x + realRoot.children[length_1 - 1].getLayout().x) / 2, + y: (realRoot.children[0].getLayout().y + realRoot.children[length_1 - 1].getLayout().y) / 2 + }; + rad = Math.atan2(center.y - rootLayout.y, center.x - rootLayout.x); + + if (rad < 0) { + rad = Math.PI * 2 + rad; + } + + isLeft = center.x < rootLayout.x; + + if (isLeft) { + rad = rad - Math.PI; + } } else { - symbolEl.updateData(data, dataIndex, null, { - symbolInnerColor: symbolInnerColor, - useNameLabel: true - }); - } - - symbolEl.__radialOldRawX = symbolEl.__radialRawX; - symbolEl.__radialOldRawY = symbolEl.__radialRawY; - symbolEl.__radialRawX = targetLayout.rawX; - symbolEl.__radialRawY = targetLayout.rawY; - group.add(symbolEl); - data.setItemGraphicEl(dataIndex, symbolEl); - symbolEl.__oldX = symbolEl.x; - symbolEl.__oldY = symbolEl.y; - updateProps(symbolEl, { - x: targetLayout.x, - y: targetLayout.y - }, seriesModel); - var symbolPath = symbolEl.getSymbolPath(); - - if (seriesModel.get('layout') === 'radial') { - var realRoot = virtualRoot.children[0]; - var rootLayout = realRoot.getLayout(); - var length_1 = realRoot.children.length; - var rad = void 0; - var isLeft = void 0; - - if (targetLayout.x === rootLayout.x && node.isExpand === true) { - var center = { - x: (realRoot.children[0].getLayout().x + realRoot.children[length_1 - 1].getLayout().x) / 2, - y: (realRoot.children[0].getLayout().y + realRoot.children[length_1 - 1].getLayout().y) / 2 - }; - rad = Math.atan2(center.y - rootLayout.y, center.x - rootLayout.x); - - if (rad < 0) { - rad = Math.PI * 2 + rad; - } - - isLeft = center.x < rootLayout.x; + rad = Math.atan2(targetLayout.y - rootLayout.y, targetLayout.x - rootLayout.x); - if (isLeft) { - rad = rad - Math.PI; - } - } else { - rad = Math.atan2(targetLayout.y - rootLayout.y, targetLayout.x - rootLayout.x); - - if (rad < 0) { - rad = Math.PI * 2 + rad; - } + if (rad < 0) { + rad = Math.PI * 2 + rad; + } - if (node.children.length === 0 || node.children.length !== 0 && node.isExpand === false) { - isLeft = targetLayout.x < rootLayout.x; + if (node.children.length === 0 || node.children.length !== 0 && node.isExpand === false) { + isLeft = targetLayout.x < rootLayout.x; - if (isLeft) { - rad = rad - Math.PI; - } - } else { - isLeft = targetLayout.x > rootLayout.x; + if (isLeft) { + rad = rad - Math.PI; + } + } else { + isLeft = targetLayout.x > rootLayout.x; - if (!isLeft) { - rad = rad - Math.PI; - } - } + if (!isLeft) { + rad = rad - Math.PI; } + } + } - var textPosition = isLeft ? 'left' : 'right'; - var normalLabelModel = itemModel.getModel('label'); - var rotate = normalLabelModel.get('rotate'); - var labelRotateRadian = rotate * (Math.PI / 180); - var textContent = symbolPath.getTextContent(); + var textPosition = isLeft ? 'left' : 'right'; + var normalLabelModel = itemModel.getModel('label'); + var rotate = normalLabelModel.get('rotate'); + var labelRotateRadian = rotate * (Math.PI / 180); + var textContent = symbolPath.getTextContent(); - if (textContent) { - symbolPath.setTextConfig({ - position: normalLabelModel.get('position') || textPosition, - rotation: rotate == null ? -rad : labelRotateRadian, - origin: 'center' - }); - textContent.setStyle('verticalAlign', 'middle'); - } - } // Handle status + if (textContent) { + symbolPath.setTextConfig({ + position: normalLabelModel.get('position') || textPosition, + rotation: rotate == null ? -rad : labelRotateRadian, + origin: 'center' + }); + textContent.setStyle('verticalAlign', 'middle'); + } + } // Handle status - var focus = itemModel.get(['emphasis', 'focus']); - var focusDataIndices = focus === 'ancestor' ? node.getAncestorsIndices() : focus === 'descendant' ? node.getDescendantIndices() : null; + var focus = itemModel.get(['emphasis', 'focus']); + var focusDataIndices = focus === 'ancestor' ? node.getAncestorsIndices() : focus === 'descendant' ? node.getDescendantIndices() : null; - if (focusDataIndices) { - // Modify the focus to data indices. - getECData(symbolEl).focus = focusDataIndices; - } + if (focusDataIndices) { + // Modify the focus to data indices. + getECData(symbolEl).focus = focusDataIndices; + } - drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group); + drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group); - if (symbolEl.__edge) { - symbolEl.onHoverStateChange = function (toState) { - if (toState !== 'blur') { - // NOTE: Ensure the parent elements will been blurred firstly. - // According to the return of getAncestorsIndices and getDescendantIndices - // TODO: A bit tricky. - var parentEl = node.parentNode && data.getItemGraphicEl(node.parentNode.dataIndex); + if (symbolEl.__edge) { + symbolEl.onHoverStateChange = function (toState) { + if (toState !== 'blur') { + // NOTE: Ensure the parent elements will been blurred firstly. + // According to the return of getAncestorsIndices and getDescendantIndices + // TODO: A bit tricky. + var parentEl = node.parentNode && data.getItemGraphicEl(node.parentNode.dataIndex); - if (!(parentEl && parentEl.hoverState === HOVER_STATE_BLUR)) { - setStatesFlag(symbolEl.__edge, toState); - } - } - }; - } + if (!(parentEl && parentEl.hoverState === HOVER_STATE_BLUR)) { + setStatesFlag(symbolEl.__edge, toState); + } + } + }; + } } function drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group) { - var itemModel = node.getModel(); - var edgeShape = seriesModel.get('edgeShape'); - var layout = seriesModel.get('layout'); - var orient = seriesModel.getOrient(); - var curvature = seriesModel.get(['lineStyle', 'curveness']); - var edgeForkPosition = seriesModel.get('edgeForkPosition'); - var lineStyle = itemModel.getModel('lineStyle').getLineStyle(); - var edge = symbolEl.__edge; + var itemModel = node.getModel(); + var edgeShape = seriesModel.get('edgeShape'); + var layout = seriesModel.get('layout'); + var orient = seriesModel.getOrient(); + var curvature = seriesModel.get(['lineStyle', 'curveness']); + var edgeForkPosition = seriesModel.get('edgeForkPosition'); + var lineStyle = itemModel.getModel('lineStyle').getLineStyle(); + var edge = symbolEl.__edge; + + if (edgeShape === 'curve') { + if (node.parentNode && node.parentNode !== virtualRoot) { + if (!edge) { + edge = symbolEl.__edge = new BezierCurve({ + shape: getEdgeShape(layout, orient, curvature, sourceOldLayout, sourceOldLayout) + }); + } - if (edgeShape === 'curve') { - if (node.parentNode && node.parentNode !== virtualRoot) { - if (!edge) { - edge = symbolEl.__edge = new BezierCurve({ - shape: getEdgeShape(layout, orient, curvature, sourceOldLayout, sourceOldLayout) - }); - } + updateProps(edge, { + shape: getEdgeShape(layout, orient, curvature, sourceLayout, targetLayout) + }, seriesModel); + } + } else if (edgeShape === 'polyline') { + if (layout === 'orthogonal') { + if (node !== virtualRoot && node.children && node.children.length !== 0 && node.isExpand === true) { + var children = node.children; + var childPoints = []; - updateProps(edge, { - shape: getEdgeShape(layout, orient, curvature, sourceLayout, targetLayout) - }, seriesModel); + for (var i = 0; i < children.length; i++) { + var childLayout = children[i].getLayout(); + childPoints.push([childLayout.x, childLayout.y]); } - } else if (edgeShape === 'polyline') { - if (layout === 'orthogonal') { - if (node !== virtualRoot && node.children && node.children.length !== 0 && node.isExpand === true) { - var children = node.children; - var childPoints = []; - - for (var i = 0; i < children.length; i++) { - var childLayout = children[i].getLayout(); - childPoints.push([childLayout.x, childLayout.y]); - } - - if (!edge) { - edge = symbolEl.__edge = new TreePath({ - shape: { - parentPoint: [targetLayout.x, targetLayout.y], - childPoints: [[targetLayout.x, targetLayout.y]], - orient: orient, - forkPosition: edgeForkPosition - } - }); - } - updateProps(edge, { - shape: { - parentPoint: [targetLayout.x, targetLayout.y], - childPoints: childPoints - } - }, seriesModel); - } - } else { - if ("development" !== 'production') { - throw new Error('The polyline edgeShape can only be used in orthogonal layout'); + if (!edge) { + edge = symbolEl.__edge = new TreePath({ + shape: { + parentPoint: [targetLayout.x, targetLayout.y], + childPoints: [[targetLayout.x, targetLayout.y]], + orient: orient, + forkPosition: edgeForkPosition } + }); } - } - if (edge) { - edge.useStyle(defaults({ - strokeNoScale: true, - fill: null - }, lineStyle)); - setStatesStylesFromModel(edge, itemModel, 'lineStyle'); - setDefaultStateProxy(edge); - group.add(edge); + updateProps(edge, { + shape: { + parentPoint: [targetLayout.x, targetLayout.y], + childPoints: childPoints + } + }, seriesModel); + } + } else { + if ("development" !== 'production') { + throw new Error('The polyline edgeShape can only be used in orthogonal layout'); + } } + } + + if (edge) { + edge.useStyle(defaults({ + strokeNoScale: true, + fill: null + }, lineStyle)); + setStatesStylesFromModel(edge, itemModel, 'lineStyle'); + setDefaultStateProxy(edge); + group.add(edge); + } } function removeNodeEdge(node, data, group, seriesModel, removeAnimationOpt) { - var virtualRoot = data.tree.root; + var virtualRoot = data.tree.root; - var _a = getSourceNode(virtualRoot, node), - source = _a.source, - sourceLayout = _a.sourceLayout; + var _a = getSourceNode(virtualRoot, node), + source = _a.source, + sourceLayout = _a.sourceLayout; - var symbolEl = data.getItemGraphicEl(node.dataIndex); + var symbolEl = data.getItemGraphicEl(node.dataIndex); - if (!symbolEl) { - return; - } + if (!symbolEl) { + return; + } - var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex); - var sourceEdge = sourceSymbolEl.__edge; // 1. when expand the sub tree, delete the children node should delete the edge of - // the source at the same time. because the polyline edge shape is only owned by the source. - // 2.when the node is the only children of the source, delete the node should delete the edge of - // the source at the same time. the same reason as above. + var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex); + var sourceEdge = sourceSymbolEl.__edge; // 1. when expand the sub tree, delete the children node should delete the edge of + // the source at the same time. because the polyline edge shape is only owned by the source. + // 2.when the node is the only children of the source, delete the node should delete the edge of + // the source at the same time. the same reason as above. - var edge = symbolEl.__edge || (source.isExpand === false || source.children.length === 1 ? sourceEdge : undefined); - var edgeShape = seriesModel.get('edgeShape'); - var layoutOpt = seriesModel.get('layout'); - var orient = seriesModel.get('orient'); - var curvature = seriesModel.get(['lineStyle', 'curveness']); + var edge = symbolEl.__edge || (source.isExpand === false || source.children.length === 1 ? sourceEdge : undefined); + var edgeShape = seriesModel.get('edgeShape'); + var layoutOpt = seriesModel.get('layout'); + var orient = seriesModel.get('orient'); + var curvature = seriesModel.get(['lineStyle', 'curveness']); - if (edge) { - if (edgeShape === 'curve') { - removeElement(edge, { - shape: getEdgeShape(layoutOpt, orient, curvature, sourceLayout, sourceLayout), - style: { - opacity: 0 - } - }, seriesModel, { - cb: function () { - group.remove(edge); - }, - removeOpt: removeAnimationOpt - }); - } else if (edgeShape === 'polyline' && seriesModel.get('layout') === 'orthogonal') { - removeElement(edge, { - shape: { - parentPoint: [sourceLayout.x, sourceLayout.y], - childPoints: [[sourceLayout.x, sourceLayout.y]] - }, - style: { - opacity: 0 - } - }, seriesModel, { - cb: function () { - group.remove(edge); - }, - removeOpt: removeAnimationOpt - }); + if (edge) { + if (edgeShape === 'curve') { + removeElement(edge, { + shape: getEdgeShape(layoutOpt, orient, curvature, sourceLayout, sourceLayout), + style: { + opacity: 0 + } + }, seriesModel, { + cb: function () { + group.remove(edge); + }, + removeOpt: removeAnimationOpt + }); + } else if (edgeShape === 'polyline' && seriesModel.get('layout') === 'orthogonal') { + removeElement(edge, { + shape: { + parentPoint: [sourceLayout.x, sourceLayout.y], + childPoints: [[sourceLayout.x, sourceLayout.y]] + }, + style: { + opacity: 0 } + }, seriesModel, { + cb: function () { + group.remove(edge); + }, + removeOpt: removeAnimationOpt + }); } + } } function getSourceNode(virtualRoot, node) { - var source = node.parentNode === virtualRoot ? node : node.parentNode || node; - var sourceLayout; + var source = node.parentNode === virtualRoot ? node : node.parentNode || node; + var sourceLayout; - while (sourceLayout = source.getLayout(), sourceLayout == null) { - source = source.parentNode === virtualRoot ? source : source.parentNode || source; - } + while (sourceLayout = source.getLayout(), sourceLayout == null) { + source = source.parentNode === virtualRoot ? source : source.parentNode || source; + } - return { - source: source, - sourceLayout: sourceLayout - }; + return { + source: source, + sourceLayout: sourceLayout + }; } function removeNode(data, dataIndex, symbolEl, group, seriesModel) { - var node = data.tree.getNodeByDataIndex(dataIndex); - var virtualRoot = data.tree.root; - var sourceLayout = getSourceNode(virtualRoot, node).sourceLayout; // Use same duration and easing with update to have more consistent animation. - - var removeAnimationOpt = { - duration: seriesModel.get('animationDurationUpdate'), - easing: seriesModel.get('animationEasingUpdate') - }; - removeElement(symbolEl, { - x: sourceLayout.x + 1, - y: sourceLayout.y + 1 - }, seriesModel, { - cb: function () { - group.remove(symbolEl); - data.setItemGraphicEl(dataIndex, null); - }, - removeOpt: removeAnimationOpt - }); - symbolEl.fadeOut(null, data.hostModel, { - fadeLabel: true, - animation: removeAnimationOpt - }); // remove edge as parent node + var node = data.tree.getNodeByDataIndex(dataIndex); + var virtualRoot = data.tree.root; + var sourceLayout = getSourceNode(virtualRoot, node).sourceLayout; // Use same duration and easing with update to have more consistent animation. + + var removeAnimationOpt = { + duration: seriesModel.get('animationDurationUpdate'), + easing: seriesModel.get('animationEasingUpdate') + }; + removeElement(symbolEl, { + x: sourceLayout.x + 1, + y: sourceLayout.y + 1 + }, seriesModel, { + cb: function () { + group.remove(symbolEl); + data.setItemGraphicEl(dataIndex, null); + }, + removeOpt: removeAnimationOpt + }); + symbolEl.fadeOut(null, data.hostModel, { + fadeLabel: true, + animation: removeAnimationOpt + }); // remove edge as parent node - node.children.forEach(function (childNode) { - removeNodeEdge(childNode, data, group, seriesModel, removeAnimationOpt); - }); // remove edge as child node + node.children.forEach(function (childNode) { + removeNodeEdge(childNode, data, group, seriesModel, removeAnimationOpt); + }); // remove edge as child node - removeNodeEdge(node, data, group, seriesModel, removeAnimationOpt); + removeNodeEdge(node, data, group, seriesModel, removeAnimationOpt); } function getEdgeShape(layoutOpt, orient, curvature, sourceLayout, targetLayout) { - var cpx1; - var cpy1; - var cpx2; - var cpy2; - var x1; - var x2; - var y1; - var y2; - - if (layoutOpt === 'radial') { - x1 = sourceLayout.rawX; - y1 = sourceLayout.rawY; - x2 = targetLayout.rawX; - y2 = targetLayout.rawY; - var radialCoor1 = radialCoordinate(x1, y1); - var radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * curvature); - var radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * curvature); - var radialCoor4 = radialCoordinate(x2, y2); - return { - x1: radialCoor1.x || 0, - y1: radialCoor1.y || 0, - x2: radialCoor4.x || 0, - y2: radialCoor4.y || 0, - cpx1: radialCoor2.x || 0, - cpy1: radialCoor2.y || 0, - cpx2: radialCoor3.x || 0, - cpy2: radialCoor3.y || 0 - }; - } else { - x1 = sourceLayout.x; - y1 = sourceLayout.y; - x2 = targetLayout.x; - y2 = targetLayout.y; - - if (orient === 'LR' || orient === 'RL') { - cpx1 = x1 + (x2 - x1) * curvature; - cpy1 = y1; - cpx2 = x2 + (x1 - x2) * curvature; - cpy2 = y2; - } - - if (orient === 'TB' || orient === 'BT') { - cpx1 = x1; - cpy1 = y1 + (y2 - y1) * curvature; - cpx2 = x2; - cpy2 = y2 + (y1 - y2) * curvature; - } - } - + var cpx1; + var cpy1; + var cpx2; + var cpy2; + var x1; + var x2; + var y1; + var y2; + + if (layoutOpt === 'radial') { + x1 = sourceLayout.rawX; + y1 = sourceLayout.rawY; + x2 = targetLayout.rawX; + y2 = targetLayout.rawY; + var radialCoor1 = radialCoordinate(x1, y1); + var radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * curvature); + var radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * curvature); + var radialCoor4 = radialCoordinate(x2, y2); return { - x1: x1, - y1: y1, - x2: x2, - y2: y2, - cpx1: cpx1, - cpy1: cpy1, - cpx2: cpx2, - cpy2: cpy2 - }; + x1: radialCoor1.x || 0, + y1: radialCoor1.y || 0, + x2: radialCoor4.x || 0, + y2: radialCoor4.y || 0, + cpx1: radialCoor2.x || 0, + cpy1: radialCoor2.y || 0, + cpx2: radialCoor3.x || 0, + cpy2: radialCoor3.y || 0 + }; + } else { + x1 = sourceLayout.x; + y1 = sourceLayout.y; + x2 = targetLayout.x; + y2 = targetLayout.y; + + if (orient === 'LR' || orient === 'RL') { + cpx1 = x1 + (x2 - x1) * curvature; + cpy1 = y1; + cpx2 = x2 + (x1 - x2) * curvature; + cpy2 = y2; + } + + if (orient === 'TB' || orient === 'BT') { + cpx1 = x1; + cpy1 = y1 + (y2 - y1) * curvature; + cpx2 = x2; + cpy2 = y2 + (y1 - y2) * curvature; + } + } + + return { + x1: x1, + y1: y1, + x2: x2, + y2: y2, + cpx1: cpx1, + cpy1: cpy1, + cpx2: cpx2, + cpy2: cpy2 + }; } var inner$7 = makeInner(); function linkSeriesData(opt) { - var mainData = opt.mainData; - var datas = opt.datas; + var mainData = opt.mainData; + var datas = opt.datas; - if (!datas) { - datas = { - main: mainData - }; - opt.datasAttr = { - main: 'data' - }; - } + if (!datas) { + datas = { + main: mainData + }; + opt.datasAttr = { + main: 'data' + }; + } - opt.datas = opt.mainData = null; - linkAll(mainData, datas, opt); // Porxy data original methods. + opt.datas = opt.mainData = null; + linkAll(mainData, datas, opt); // Porxy data original methods. - each(datas, function (data) { - each(mainData.TRANSFERABLE_METHODS, function (methodName) { - data.wrapMethod(methodName, curry(transferInjection, opt)); - }); - }); // Beyond transfer, additional features should be added to `cloneShallow`. + each(datas, function (data) { + each(mainData.TRANSFERABLE_METHODS, function (methodName) { + data.wrapMethod(methodName, curry(transferInjection, opt)); + }); + }); // Beyond transfer, additional features should be added to `cloneShallow`. - mainData.wrapMethod('cloneShallow', curry(cloneShallowInjection, opt)); // Only mainData trigger change, because struct.update may trigger - // another changable methods, which may bring about dead lock. + mainData.wrapMethod('cloneShallow', curry(cloneShallowInjection, opt)); // Only mainData trigger change, because struct.update may trigger + // another changable methods, which may bring about dead lock. - each(mainData.CHANGABLE_METHODS, function (methodName) { - mainData.wrapMethod(methodName, curry(changeInjection, opt)); - }); // Make sure datas contains mainData. + each(mainData.CHANGABLE_METHODS, function (methodName) { + mainData.wrapMethod(methodName, curry(changeInjection, opt)); + }); // Make sure datas contains mainData. - assert(datas[mainData.dataType] === mainData); + assert(datas[mainData.dataType] === mainData); } function transferInjection(opt, res) { - if (isMainData(this)) { - // Transfer datas to new main data. - var datas = extend({}, inner$7(this).datas); - datas[this.dataType] = res; - linkAll(res, datas, opt); - } else { - // Modify the reference in main data to point newData. - linkSingle(res, this.dataType, inner$7(this).mainData, opt); - } + if (isMainData(this)) { + // Transfer datas to new main data. + var datas = extend({}, inner$7(this).datas); + datas[this.dataType] = res; + linkAll(res, datas, opt); + } else { + // Modify the reference in main data to point newData. + linkSingle(res, this.dataType, inner$7(this).mainData, opt); + } - return res; + return res; } function changeInjection(opt, res) { - opt.struct && opt.struct.update(); - return res; + opt.struct && opt.struct.update(); + return res; } function cloneShallowInjection(opt, res) { - // cloneShallow, which brings about some fragilities, may be inappropriate - // to be exposed as an API. So for implementation simplicity we can make - // the restriction that cloneShallow of not-mainData should not be invoked - // outside, but only be invoked here. - each(inner$7(res).datas, function (data, dataType) { - data !== res && linkSingle(data.cloneShallow(), dataType, res, opt); - }); - return res; + // cloneShallow, which brings about some fragilities, may be inappropriate + // to be exposed as an API. So for implementation simplicity we can make + // the restriction that cloneShallow of not-mainData should not be invoked + // outside, but only be invoked here. + each(inner$7(res).datas, function (data, dataType) { + data !== res && linkSingle(data.cloneShallow(), dataType, res, opt); + }); + return res; } /** * Supplement method to List. @@ -55086,8 +55086,8 @@ function getLinkedData(dataType) { - var mainData = inner$7(this).mainData; - return dataType == null || mainData == null ? mainData : inner$7(mainData).datas[dataType]; + var mainData = inner$7(this).mainData; + return dataType == null || mainData == null ? mainData : inner$7(mainData).datas[dataType]; } /** * Get list of all linked data @@ -55095,405 +55095,405 @@ function getLinkedDataAll() { - var mainData = inner$7(this).mainData; - return mainData == null ? [{ - data: mainData - }] : map(keys(inner$7(mainData).datas), function (type) { - return { - type: type, - data: inner$7(mainData).datas[type] - }; - }); + var mainData = inner$7(this).mainData; + return mainData == null ? [{ + data: mainData + }] : map(keys(inner$7(mainData).datas), function (type) { + return { + type: type, + data: inner$7(mainData).datas[type] + }; + }); } function isMainData(data) { - return inner$7(data).mainData === data; + return inner$7(data).mainData === data; } function linkAll(mainData, datas, opt) { - inner$7(mainData).datas = {}; - each(datas, function (data, dataType) { - linkSingle(data, dataType, mainData, opt); - }); + inner$7(mainData).datas = {}; + each(datas, function (data, dataType) { + linkSingle(data, dataType, mainData, opt); + }); } function linkSingle(data, dataType, mainData, opt) { - inner$7(mainData).datas[dataType] = data; - inner$7(data).mainData = mainData; - data.dataType = dataType; + inner$7(mainData).datas[dataType] = data; + inner$7(data).mainData = mainData; + data.dataType = dataType; - if (opt.struct) { - data[opt.structAttr] = opt.struct; - opt.struct[opt.datasAttr[dataType]] = data; - } // Supplement method. + if (opt.struct) { + data[opt.structAttr] = opt.struct; + opt.struct[opt.datasAttr[dataType]] = data; + } // Supplement method. - data.getLinkedData = getLinkedData; - data.getLinkedDataAll = getLinkedDataAll; + data.getLinkedData = getLinkedData; + data.getLinkedDataAll = getLinkedDataAll; } var TreeNode = - /** @class */ - function () { - function TreeNode(name, hostTree) { - this.depth = 0; - this.height = 0; - /** - * Reference to list item. - * Do not persistent dataIndex outside, - * besause it may be changed by list. - * If dataIndex -1, - * this node is logical deleted (filtered) in list. - */ - - this.dataIndex = -1; - this.children = []; - this.viewChildren = []; - this.isExpand = false; - this.name = name || ''; - this.hostTree = hostTree; - } - /** - * The node is removed. - */ - + /** @class */ + function () { + function TreeNode(name, hostTree) { + this.depth = 0; + this.height = 0; + /** + * Reference to list item. + * Do not persistent dataIndex outside, + * besause it may be changed by list. + * If dataIndex -1, + * this node is logical deleted (filtered) in list. + */ - TreeNode.prototype.isRemoved = function () { - return this.dataIndex < 0; - }; + this.dataIndex = -1; + this.children = []; + this.viewChildren = []; + this.isExpand = false; + this.name = name || ''; + this.hostTree = hostTree; + } + /** + * The node is removed. + */ - TreeNode.prototype.eachNode = function (options, cb, context) { - if (isFunction(options)) { - context = cb; - cb = options; - options = null; - } - options = options || {}; + TreeNode.prototype.isRemoved = function () { + return this.dataIndex < 0; + }; - if (isString(options)) { - options = { - order: options - }; - } + TreeNode.prototype.eachNode = function (options, cb, context) { + if (isFunction(options)) { + context = cb; + cb = options; + options = null; + } - var order = options.order || 'preorder'; - var children = this[options.attr || 'children']; - var suppressVisitSub; - order === 'preorder' && (suppressVisitSub = cb.call(context, this)); + options = options || {}; - for (var i = 0; !suppressVisitSub && i < children.length; i++) { - children[i].eachNode(options, cb, context); - } + if (isString(options)) { + options = { + order: options + }; + } - order === 'postorder' && cb.call(context, this); - }; - /** - * Update depth and height of this subtree. - */ + var order = options.order || 'preorder'; + var children = this[options.attr || 'children']; + var suppressVisitSub; + order === 'preorder' && (suppressVisitSub = cb.call(context, this)); + for (var i = 0; !suppressVisitSub && i < children.length; i++) { + children[i].eachNode(options, cb, context); + } - TreeNode.prototype.updateDepthAndHeight = function (depth) { - var height = 0; - this.depth = depth; + order === 'postorder' && cb.call(context, this); + }; + /** + * Update depth and height of this subtree. + */ - for (var i = 0; i < this.children.length; i++) { - var child = this.children[i]; - child.updateDepthAndHeight(depth + 1); - if (child.height > height) { - height = child.height; - } - } + TreeNode.prototype.updateDepthAndHeight = function (depth) { + var height = 0; + this.depth = depth; - this.height = height + 1; - }; + for (var i = 0; i < this.children.length; i++) { + var child = this.children[i]; + child.updateDepthAndHeight(depth + 1); - TreeNode.prototype.getNodeById = function (id) { - if (this.getId() === id) { - return this; - } + if (child.height > height) { + height = child.height; + } + } - for (var i = 0, children = this.children, len = children.length; i < len; i++) { - var res = children[i].getNodeById(id); + this.height = height + 1; + }; - if (res) { - return res; - } - } - }; + TreeNode.prototype.getNodeById = function (id) { + if (this.getId() === id) { + return this; + } - TreeNode.prototype.contains = function (node) { - if (node === this) { - return true; - } + for (var i = 0, children = this.children, len = children.length; i < len; i++) { + var res = children[i].getNodeById(id); - for (var i = 0, children = this.children, len = children.length; i < len; i++) { - var res = children[i].contains(node); + if (res) { + return res; + } + } + }; - if (res) { - return res; - } - } - }; - /** - * @param includeSelf Default false. - * @return order: [root, child, grandchild, ...] - */ + TreeNode.prototype.contains = function (node) { + if (node === this) { + return true; + } + for (var i = 0, children = this.children, len = children.length; i < len; i++) { + var res = children[i].contains(node); - TreeNode.prototype.getAncestors = function (includeSelf) { - var ancestors = []; - var node = includeSelf ? this : this.parentNode; + if (res) { + return res; + } + } + }; + /** + * @param includeSelf Default false. + * @return order: [root, child, grandchild, ...] + */ - while (node) { - ancestors.push(node); - node = node.parentNode; - } - ancestors.reverse(); - return ancestors; - }; + TreeNode.prototype.getAncestors = function (includeSelf) { + var ancestors = []; + var node = includeSelf ? this : this.parentNode; - TreeNode.prototype.getAncestorsIndices = function () { - var indices = []; - var currNode = this; + while (node) { + ancestors.push(node); + node = node.parentNode; + } - while (currNode) { - indices.push(currNode.dataIndex); - currNode = currNode.parentNode; - } + ancestors.reverse(); + return ancestors; + }; - indices.reverse(); - return indices; - }; + TreeNode.prototype.getAncestorsIndices = function () { + var indices = []; + var currNode = this; - TreeNode.prototype.getDescendantIndices = function () { - var indices = []; - this.eachNode(function (childNode) { - indices.push(childNode.dataIndex); - }); - return indices; - }; + while (currNode) { + indices.push(currNode.dataIndex); + currNode = currNode.parentNode; + } - TreeNode.prototype.getValue = function (dimension) { - var data = this.hostTree.data; - return data.getStore().get(data.getDimensionIndex(dimension || 'value'), this.dataIndex); - }; + indices.reverse(); + return indices; + }; - TreeNode.prototype.setLayout = function (layout, merge) { - this.dataIndex >= 0 && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge); - }; - /** - * @return {Object} layout - */ + TreeNode.prototype.getDescendantIndices = function () { + var indices = []; + this.eachNode(function (childNode) { + indices.push(childNode.dataIndex); + }); + return indices; + }; + + TreeNode.prototype.getValue = function (dimension) { + var data = this.hostTree.data; + return data.getStore().get(data.getDimensionIndex(dimension || 'value'), this.dataIndex); + }; + + TreeNode.prototype.setLayout = function (layout, merge) { + this.dataIndex >= 0 && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge); + }; + /** + * @return {Object} layout + */ - TreeNode.prototype.getLayout = function () { - return this.hostTree.data.getItemLayout(this.dataIndex); - }; // @depcrecated - // getModel(path: S): Model - // eslint-disable-next-line @typescript-eslint/no-unused-vars + TreeNode.prototype.getLayout = function () { + return this.hostTree.data.getItemLayout(this.dataIndex); + }; // @depcrecated + // getModel(path: S): Model + // eslint-disable-next-line @typescript-eslint/no-unused-vars - TreeNode.prototype.getModel = function (path) { - if (this.dataIndex < 0) { - return; - } + TreeNode.prototype.getModel = function (path) { + if (this.dataIndex < 0) { + return; + } - var hostTree = this.hostTree; - var itemModel = hostTree.data.getItemModel(this.dataIndex); - return itemModel.getModel(path); - }; // TODO: TYPE More specific model + var hostTree = this.hostTree; + var itemModel = hostTree.data.getItemModel(this.dataIndex); + return itemModel.getModel(path); + }; // TODO: TYPE More specific model - TreeNode.prototype.getLevelModel = function () { - return (this.hostTree.levelModels || [])[this.depth]; - }; + TreeNode.prototype.getLevelModel = function () { + return (this.hostTree.levelModels || [])[this.depth]; + }; - TreeNode.prototype.setVisual = function (key, value) { - this.dataIndex >= 0 && this.hostTree.data.setItemVisual(this.dataIndex, key, value); - }; - /** - * Get item visual - * FIXME: make return type better - */ + TreeNode.prototype.setVisual = function (key, value) { + this.dataIndex >= 0 && this.hostTree.data.setItemVisual(this.dataIndex, key, value); + }; + /** + * Get item visual + * FIXME: make return type better + */ - TreeNode.prototype.getVisual = function (key) { - return this.hostTree.data.getItemVisual(this.dataIndex, key); - }; + TreeNode.prototype.getVisual = function (key) { + return this.hostTree.data.getItemVisual(this.dataIndex, key); + }; - TreeNode.prototype.getRawIndex = function () { - return this.hostTree.data.getRawIndex(this.dataIndex); - }; + TreeNode.prototype.getRawIndex = function () { + return this.hostTree.data.getRawIndex(this.dataIndex); + }; - TreeNode.prototype.getId = function () { - return this.hostTree.data.getId(this.dataIndex); - }; - /** - * index in parent's children - */ + TreeNode.prototype.getId = function () { + return this.hostTree.data.getId(this.dataIndex); + }; + /** + * index in parent's children + */ - TreeNode.prototype.getChildIndex = function () { - if (this.parentNode) { - var children = this.parentNode.children; + TreeNode.prototype.getChildIndex = function () { + if (this.parentNode) { + var children = this.parentNode.children; - for (var i = 0; i < children.length; ++i) { - if (children[i] === this) { - return i; - } - } + for (var i = 0; i < children.length; ++i) { + if (children[i] === this) { + return i; + } + } - return -1; - } + return -1; + } - return -1; - }; - /** - * if this is an ancestor of another node - * - * @param node another node - * @return if is ancestor - */ + return -1; + }; + /** + * if this is an ancestor of another node + * + * @param node another node + * @return if is ancestor + */ - TreeNode.prototype.isAncestorOf = function (node) { - var parent = node.parentNode; + TreeNode.prototype.isAncestorOf = function (node) { + var parent = node.parentNode; - while (parent) { - if (parent === this) { - return true; - } + while (parent) { + if (parent === this) { + return true; + } - parent = parent.parentNode; - } + parent = parent.parentNode; + } - return false; - }; - /** - * if this is an descendant of another node - * - * @param node another node - * @return if is descendant - */ + return false; + }; + /** + * if this is an descendant of another node + * + * @param node another node + * @return if is descendant + */ - TreeNode.prototype.isDescendantOf = function (node) { - return node !== this && node.isAncestorOf(this); - }; + TreeNode.prototype.isDescendantOf = function (node) { + return node !== this && node.isAncestorOf(this); + }; - return TreeNode; - }(); + return TreeNode; + }(); var Tree = - /** @class */ - function () { - function Tree(hostModel) { - this.type = 'tree'; - this._nodes = []; - this.hostModel = hostModel; - } - - Tree.prototype.eachNode = function (options, cb, context) { - this.root.eachNode(options, cb, context); - }; - - Tree.prototype.getNodeByDataIndex = function (dataIndex) { - var rawIndex = this.data.getRawIndex(dataIndex); - return this._nodes[rawIndex]; - }; - - Tree.prototype.getNodeById = function (name) { - return this.root.getNodeById(name); - }; - /** - * Update item available by list, - * when list has been performed options like 'filterSelf' or 'map'. - */ + /** @class */ + function () { + function Tree(hostModel) { + this.type = 'tree'; + this._nodes = []; + this.hostModel = hostModel; + } + + Tree.prototype.eachNode = function (options, cb, context) { + this.root.eachNode(options, cb, context); + }; + + Tree.prototype.getNodeByDataIndex = function (dataIndex) { + var rawIndex = this.data.getRawIndex(dataIndex); + return this._nodes[rawIndex]; + }; + + Tree.prototype.getNodeById = function (name) { + return this.root.getNodeById(name); + }; + /** + * Update item available by list, + * when list has been performed options like 'filterSelf' or 'map'. + */ - Tree.prototype.update = function () { - var data = this.data; - var nodes = this._nodes; + Tree.prototype.update = function () { + var data = this.data; + var nodes = this._nodes; - for (var i = 0, len = nodes.length; i < len; i++) { - nodes[i].dataIndex = -1; - } + for (var i = 0, len = nodes.length; i < len; i++) { + nodes[i].dataIndex = -1; + } - for (var i = 0, len = data.count(); i < len; i++) { - nodes[data.getRawIndex(i)].dataIndex = i; - } - }; - /** - * Clear all layouts - */ + for (var i = 0, len = data.count(); i < len; i++) { + nodes[data.getRawIndex(i)].dataIndex = i; + } + }; + /** + * Clear all layouts + */ - Tree.prototype.clearLayouts = function () { - this.data.clearItemLayouts(); - }; - /** - * data node format: - * { - * name: ... - * value: ... - * children: [ - * { - * name: ... - * value: ... - * children: ... - * }, - * ... - * ] - * } - */ + Tree.prototype.clearLayouts = function () { + this.data.clearItemLayouts(); + }; + /** + * data node format: + * { + * name: ... + * value: ... + * children: [ + * { + * name: ... + * value: ... + * children: ... + * }, + * ... + * ] + * } + */ - Tree.createTree = function (dataRoot, hostModel, beforeLink) { - var tree = new Tree(hostModel); - var listData = []; - var dimMax = 1; - buildHierarchy(dataRoot); + Tree.createTree = function (dataRoot, hostModel, beforeLink) { + var tree = new Tree(hostModel); + var listData = []; + var dimMax = 1; + buildHierarchy(dataRoot); - function buildHierarchy(dataNode, parentNode) { - var value = dataNode.value; - dimMax = Math.max(dimMax, isArray(value) ? value.length : 1); - listData.push(dataNode); - var node = new TreeNode(convertOptionIdName(dataNode.name, ''), tree); - parentNode ? addChild(node, parentNode) : tree.root = node; + function buildHierarchy(dataNode, parentNode) { + var value = dataNode.value; + dimMax = Math.max(dimMax, isArray(value) ? value.length : 1); + listData.push(dataNode); + var node = new TreeNode(convertOptionIdName(dataNode.name, ''), tree); + parentNode ? addChild(node, parentNode) : tree.root = node; - tree._nodes.push(node); + tree._nodes.push(node); - var children = dataNode.children; + var children = dataNode.children; - if (children) { - for (var i = 0; i < children.length; i++) { - buildHierarchy(children[i], node); - } - } - } + if (children) { + for (var i = 0; i < children.length; i++) { + buildHierarchy(children[i], node); + } + } + } - tree.root.updateDepthAndHeight(0); - var dimensions = prepareSeriesDataSchema(listData, { - coordDimensions: ['value'], - dimensionsCount: dimMax - }).dimensions; - var list = new SeriesData(dimensions, hostModel); - list.initData(listData); - beforeLink && beforeLink(list); - linkSeriesData({ - mainData: list, - struct: tree, - structAttr: 'tree' - }); - tree.update(); - return tree; - }; + tree.root.updateDepthAndHeight(0); + var dimensions = prepareSeriesDataSchema(listData, { + coordDimensions: ['value'], + dimensionsCount: dimMax + }).dimensions; + var list = new SeriesData(dimensions, hostModel); + list.initData(listData); + beforeLink && beforeLink(list); + linkSeriesData({ + mainData: list, + struct: tree, + structAttr: 'tree' + }); + tree.update(); + return tree; + }; - return Tree; - }(); + return Tree; + }(); /** * It is needed to consider the mess of 'list', 'hostModel' when creating a TreeNote, * so this function is not ready and not necessary to be public. @@ -55501,232 +55501,232 @@ function addChild(child, node) { - var children = node.children; + var children = node.children; - if (child.parentNode === node) { - return; - } + if (child.parentNode === node) { + return; + } - children.push(child); - child.parentNode = node; + children.push(child); + child.parentNode = node; } function retrieveTargetInfo(payload, validPayloadTypes, seriesModel) { - if (payload && indexOf(validPayloadTypes, payload.type) >= 0) { - var root = seriesModel.getData().tree.root; - var targetNode = payload.targetNode; + if (payload && indexOf(validPayloadTypes, payload.type) >= 0) { + var root = seriesModel.getData().tree.root; + var targetNode = payload.targetNode; - if (isString(targetNode)) { - targetNode = root.getNodeById(targetNode); - } + if (isString(targetNode)) { + targetNode = root.getNodeById(targetNode); + } - if (targetNode && root.contains(targetNode)) { - return { - node: targetNode - }; - } + if (targetNode && root.contains(targetNode)) { + return { + node: targetNode + }; + } - var targetNodeId = payload.targetNodeId; + var targetNodeId = payload.targetNodeId; - if (targetNodeId != null && (targetNode = root.getNodeById(targetNodeId))) { - return { - node: targetNode - }; - } + if (targetNodeId != null && (targetNode = root.getNodeById(targetNodeId))) { + return { + node: targetNode + }; } + } } // Not includes the given node at the last item. function getPathToRoot(node) { - var path = []; + var path = []; - while (node) { - node = node.parentNode; - node && path.push(node); - } + while (node) { + node = node.parentNode; + node && path.push(node); + } - return path.reverse(); + return path.reverse(); } function aboveViewRoot(viewRoot, node) { - var viewPath = getPathToRoot(viewRoot); - return indexOf(viewPath, node) >= 0; + var viewPath = getPathToRoot(viewRoot); + return indexOf(viewPath, node) >= 0; } // From root to the input node (the input node will be included). function wrapTreePathInfo(node, seriesModel) { - var treePathInfo = []; - - while (node) { - var nodeDataIndex = node.dataIndex; - treePathInfo.push({ - name: node.name, - dataIndex: nodeDataIndex, - value: seriesModel.getRawValue(nodeDataIndex) - }); - node = node.parentNode; - } + var treePathInfo = []; + + while (node) { + var nodeDataIndex = node.dataIndex; + treePathInfo.push({ + name: node.name, + dataIndex: nodeDataIndex, + value: seriesModel.getRawValue(nodeDataIndex) + }); + node = node.parentNode; + } - treePathInfo.reverse(); - return treePathInfo; + treePathInfo.reverse(); + return treePathInfo; } var TreeSeriesModel = - /** @class */ - function (_super) { - __extends(TreeSeriesModel, _super); + /** @class */ + function (_super) { + __extends(TreeSeriesModel, _super); - function TreeSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function TreeSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.hasSymbolVisual = true; // Do it self. + _this.hasSymbolVisual = true; // Do it self. - _this.ignoreStyleOnData = true; - return _this; - } - /** - * Init a tree data structure from data in option series - */ + _this.ignoreStyleOnData = true; + return _this; + } + /** + * Init a tree data structure from data in option series + */ - TreeSeriesModel.prototype.getInitialData = function (option) { - //create an virtual root - var root = { - name: option.name, - children: option.data - }; - var leaves = option.leaves || {}; - var leavesModel = new Model(leaves, this, this.ecModel); - var tree = Tree.createTree(root, this, beforeLink); + TreeSeriesModel.prototype.getInitialData = function (option) { + //create an virtual root + var root = { + name: option.name, + children: option.data + }; + var leaves = option.leaves || {}; + var leavesModel = new Model(leaves, this, this.ecModel); + var tree = Tree.createTree(root, this, beforeLink); - function beforeLink(nodeData) { - nodeData.wrapMethod('getItemModel', function (model, idx) { - var node = tree.getNodeByDataIndex(idx); + function beforeLink(nodeData) { + nodeData.wrapMethod('getItemModel', function (model, idx) { + var node = tree.getNodeByDataIndex(idx); - if (!(node && node.children.length && node.isExpand)) { - model.parentModel = leavesModel; - } + if (!(node && node.children.length && node.isExpand)) { + model.parentModel = leavesModel; + } - return model; - }); - } + return model; + }); + } - var treeDepth = 0; - tree.eachNode('preorder', function (node) { - if (node.depth > treeDepth) { - treeDepth = node.depth; - } - }); - var expandAndCollapse = option.expandAndCollapse; - var expandTreeDepth = expandAndCollapse && option.initialTreeDepth >= 0 ? option.initialTreeDepth : treeDepth; - tree.root.eachNode('preorder', function (node) { - var item = node.hostTree.data.getRawDataItem(node.dataIndex); // Add item.collapsed != null, because users can collapse node original in the series.data. + var treeDepth = 0; + tree.eachNode('preorder', function (node) { + if (node.depth > treeDepth) { + treeDepth = node.depth; + } + }); + var expandAndCollapse = option.expandAndCollapse; + var expandTreeDepth = expandAndCollapse && option.initialTreeDepth >= 0 ? option.initialTreeDepth : treeDepth; + tree.root.eachNode('preorder', function (node) { + var item = node.hostTree.data.getRawDataItem(node.dataIndex); // Add item.collapsed != null, because users can collapse node original in the series.data. - node.isExpand = item && item.collapsed != null ? !item.collapsed : node.depth <= expandTreeDepth; - }); - return tree.data; - }; - /** - * Make the configuration 'orient' backward compatibly, with 'horizontal = LR', 'vertical = TB'. - * @returns {string} orient - */ + node.isExpand = item && item.collapsed != null ? !item.collapsed : node.depth <= expandTreeDepth; + }); + return tree.data; + }; + /** + * Make the configuration 'orient' backward compatibly, with 'horizontal = LR', 'vertical = TB'. + * @returns {string} orient + */ - TreeSeriesModel.prototype.getOrient = function () { - var orient = this.get('orient'); + TreeSeriesModel.prototype.getOrient = function () { + var orient = this.get('orient'); - if (orient === 'horizontal') { - orient = 'LR'; - } else if (orient === 'vertical') { - orient = 'TB'; - } + if (orient === 'horizontal') { + orient = 'LR'; + } else if (orient === 'vertical') { + orient = 'TB'; + } - return orient; - }; + return orient; + }; - TreeSeriesModel.prototype.setZoom = function (zoom) { - this.option.zoom = zoom; - }; + TreeSeriesModel.prototype.setZoom = function (zoom) { + this.option.zoom = zoom; + }; - TreeSeriesModel.prototype.setCenter = function (center) { - this.option.center = center; - }; + TreeSeriesModel.prototype.setCenter = function (center) { + this.option.center = center; + }; - TreeSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - var tree = this.getData().tree; - var realRoot = tree.root.children[0]; - var node = tree.getNodeByDataIndex(dataIndex); - var value = node.getValue(); - var name = node.name; + TreeSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { + var tree = this.getData().tree; + var realRoot = tree.root.children[0]; + var node = tree.getNodeByDataIndex(dataIndex); + var value = node.getValue(); + var name = node.name; - while (node && node !== realRoot) { - name = node.parentNode.name + '.' + name; - node = node.parentNode; - } + while (node && node !== realRoot) { + name = node.parentNode.name + '.' + name; + node = node.parentNode; + } - return createTooltipMarkup('nameValue', { - name: name, - value: value, - noValue: isNaN(value) || value == null - }); - }; // Add tree path to tooltip param + return createTooltipMarkup('nameValue', { + name: name, + value: value, + noValue: isNaN(value) || value == null + }); + }; // Add tree path to tooltip param - TreeSeriesModel.prototype.getDataParams = function (dataIndex) { - var params = _super.prototype.getDataParams.apply(this, arguments); + TreeSeriesModel.prototype.getDataParams = function (dataIndex) { + var params = _super.prototype.getDataParams.apply(this, arguments); - var node = this.getData().tree.getNodeByDataIndex(dataIndex); - params.treeAncestors = wrapTreePathInfo(node, this); - params.collapsed = !node.isExpand; - return params; - }; + var node = this.getData().tree.getNodeByDataIndex(dataIndex); + params.treeAncestors = wrapTreePathInfo(node, this); + params.collapsed = !node.isExpand; + return params; + }; - TreeSeriesModel.type = 'series.tree'; // can support the position parameters 'left', 'top','right','bottom', 'width', - // 'height' in the setOption() with 'merge' mode normal. - - TreeSeriesModel.layoutMode = 'box'; - TreeSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - coordinateSystem: 'view', - // the position of the whole view - left: '12%', - top: '12%', - right: '12%', - bottom: '12%', - // the layout of the tree, two value can be selected, 'orthogonal' or 'radial' - layout: 'orthogonal', - // value can be 'polyline' - edgeShape: 'curve', - edgeForkPosition: '50%', - // true | false | 'move' | 'scale', see module:component/helper/RoamController. - roam: false, - // Symbol size scale ratio in roam - nodeScaleRatio: 0.4, - // Default on center of graph - center: null, - zoom: 1, - orient: 'LR', - symbol: 'emptyCircle', - symbolSize: 7, - expandAndCollapse: true, - initialTreeDepth: 2, - lineStyle: { - color: '#ccc', - width: 1.5, - curveness: 0.5 - }, - itemStyle: { - color: 'lightsteelblue', - // borderColor: '#c23531', - borderWidth: 1.5 - }, - label: { - show: true - }, - animationEasing: 'linear', - animationDuration: 700, - animationDurationUpdate: 500 - }; - return TreeSeriesModel; - }(SeriesModel); + TreeSeriesModel.type = 'series.tree'; // can support the position parameters 'left', 'top','right','bottom', 'width', + // 'height' in the setOption() with 'merge' mode normal. + + TreeSeriesModel.layoutMode = 'box'; + TreeSeriesModel.defaultOption = { + // zlevel: 0, + z: 2, + coordinateSystem: 'view', + // the position of the whole view + left: '12%', + top: '12%', + right: '12%', + bottom: '12%', + // the layout of the tree, two value can be selected, 'orthogonal' or 'radial' + layout: 'orthogonal', + // value can be 'polyline' + edgeShape: 'curve', + edgeForkPosition: '50%', + // true | false | 'move' | 'scale', see module:component/helper/RoamController. + roam: false, + // Symbol size scale ratio in roam + nodeScaleRatio: 0.4, + // Default on center of graph + center: null, + zoom: 1, + orient: 'LR', + symbol: 'emptyCircle', + symbolSize: 7, + expandAndCollapse: true, + initialTreeDepth: 2, + lineStyle: { + color: '#ccc', + width: 1.5, + curveness: 0.5 + }, + itemStyle: { + color: 'lightsteelblue', + // borderColor: '#c23531', + borderWidth: 1.5 + }, + label: { + show: true + }, + animationEasing: 'linear', + animationDuration: 700, + animationDurationUpdate: 500 + }; + return TreeSeriesModel; + }(SeriesModel); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -55775,29 +55775,29 @@ * Traverse the tree from bottom to top and do something */ function eachAfter(root, callback, separation) { - var nodes = [root]; - var next = []; - var node; + var nodes = [root]; + var next = []; + var node; - while (node = nodes.pop()) { - // jshint ignore:line - next.push(node); + while (node = nodes.pop()) { + // jshint ignore:line + next.push(node); - if (node.isExpand) { - var children = node.children; + if (node.isExpand) { + var children = node.children; - if (children.length) { - for (var i = 0; i < children.length; i++) { - nodes.push(children[i]); - } - } + if (children.length) { + for (var i = 0; i < children.length; i++) { + nodes.push(children[i]); } + } } + } - while (node = next.pop()) { - // jshint ignore:line - callback(node, separation); - } + while (node = next.pop()) { + // jshint ignore:line + callback(node, separation); + } } /** * Traverse the tree from top to bottom and do something @@ -55805,558 +55805,558 @@ function eachBefore(root, callback) { - var nodes = [root]; - var node; + var nodes = [root]; + var node; - while (node = nodes.pop()) { - // jshint ignore:line - callback(node); + while (node = nodes.pop()) { + // jshint ignore:line + callback(node); - if (node.isExpand) { - var children = node.children; + if (node.isExpand) { + var children = node.children; - if (children.length) { - for (var i = children.length - 1; i >= 0; i--) { - nodes.push(children[i]); - } - } + if (children.length) { + for (var i = children.length - 1; i >= 0; i--) { + nodes.push(children[i]); } + } } + } } function treeLayout(ecModel, api) { - ecModel.eachSeriesByType('tree', function (seriesModel) { - commonLayout(seriesModel, api); - }); + ecModel.eachSeriesByType('tree', function (seriesModel) { + commonLayout(seriesModel, api); + }); } function commonLayout(seriesModel, api) { - var layoutInfo = getViewRect$1(seriesModel, api); - seriesModel.layoutInfo = layoutInfo; - var layout = seriesModel.get('layout'); - var width = 0; - var height = 0; - var separation$1 = null; + var layoutInfo = getViewRect$1(seriesModel, api); + seriesModel.layoutInfo = layoutInfo; + var layout = seriesModel.get('layout'); + var width = 0; + var height = 0; + var separation$1 = null; + + if (layout === 'radial') { + width = 2 * Math.PI; + height = Math.min(layoutInfo.height, layoutInfo.width) / 2; + separation$1 = separation(function (node1, node2) { + return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth; + }); + } else { + width = layoutInfo.width; + height = layoutInfo.height; + separation$1 = separation(); + } + + var virtualRoot = seriesModel.getData().tree.root; + var realRoot = virtualRoot.children[0]; + + if (realRoot) { + init$2(virtualRoot); + eachAfter(realRoot, firstWalk, separation$1); + virtualRoot.hierNode.modifier = -realRoot.hierNode.prelim; + eachBefore(realRoot, secondWalk); + var left_1 = realRoot; + var right_1 = realRoot; + var bottom_1 = realRoot; + eachBefore(realRoot, function (node) { + var x = node.getLayout().x; + + if (x < left_1.getLayout().x) { + left_1 = node; + } + + if (x > right_1.getLayout().x) { + right_1 = node; + } + + if (node.depth > bottom_1.depth) { + bottom_1 = node; + } + }); + var delta = left_1 === right_1 ? 1 : separation$1(left_1, right_1) / 2; + var tx_1 = delta - left_1.getLayout().x; + var kx_1 = 0; + var ky_1 = 0; + var coorX_1 = 0; + var coorY_1 = 0; if (layout === 'radial') { - width = 2 * Math.PI; - height = Math.min(layoutInfo.height, layoutInfo.width) / 2; - separation$1 = separation(function (node1, node2) { - return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth; - }); - } else { - width = layoutInfo.width; - height = layoutInfo.height; - separation$1 = separation(); - } + kx_1 = width / (right_1.getLayout().x + delta + tx_1); // here we use (node.depth - 1), bucause the real root's depth is 1 - var virtualRoot = seriesModel.getData().tree.root; - var realRoot = virtualRoot.children[0]; + ky_1 = height / (bottom_1.depth - 1 || 1); + eachBefore(realRoot, function (node) { + coorX_1 = (node.getLayout().x + tx_1) * kx_1; + coorY_1 = (node.depth - 1) * ky_1; + var finalCoor = radialCoordinate(coorX_1, coorY_1); + node.setLayout({ + x: finalCoor.x, + y: finalCoor.y, + rawX: coorX_1, + rawY: coorY_1 + }, true); + }); + } else { + var orient_1 = seriesModel.getOrient(); - if (realRoot) { - init$2(virtualRoot); - eachAfter(realRoot, firstWalk, separation$1); - virtualRoot.hierNode.modifier = -realRoot.hierNode.prelim; - eachBefore(realRoot, secondWalk); - var left_1 = realRoot; - var right_1 = realRoot; - var bottom_1 = realRoot; + if (orient_1 === 'RL' || orient_1 === 'LR') { + ky_1 = height / (right_1.getLayout().x + delta + tx_1); + kx_1 = width / (bottom_1.depth - 1 || 1); eachBefore(realRoot, function (node) { - var x = node.getLayout().x; - - if (x < left_1.getLayout().x) { - left_1 = node; - } - - if (x > right_1.getLayout().x) { - right_1 = node; - } - - if (node.depth > bottom_1.depth) { - bottom_1 = node; - } + coorY_1 = (node.getLayout().x + tx_1) * ky_1; + coorX_1 = orient_1 === 'LR' ? (node.depth - 1) * kx_1 : width - (node.depth - 1) * kx_1; + node.setLayout({ + x: coorX_1, + y: coorY_1 + }, true); }); - var delta = left_1 === right_1 ? 1 : separation$1(left_1, right_1) / 2; - var tx_1 = delta - left_1.getLayout().x; - var kx_1 = 0; - var ky_1 = 0; - var coorX_1 = 0; - var coorY_1 = 0; - - if (layout === 'radial') { - kx_1 = width / (right_1.getLayout().x + delta + tx_1); // here we use (node.depth - 1), bucause the real root's depth is 1 - - ky_1 = height / (bottom_1.depth - 1 || 1); - eachBefore(realRoot, function (node) { - coorX_1 = (node.getLayout().x + tx_1) * kx_1; - coorY_1 = (node.depth - 1) * ky_1; - var finalCoor = radialCoordinate(coorX_1, coorY_1); - node.setLayout({ - x: finalCoor.x, - y: finalCoor.y, - rawX: coorX_1, - rawY: coorY_1 - }, true); - }); - } else { - var orient_1 = seriesModel.getOrient(); - - if (orient_1 === 'RL' || orient_1 === 'LR') { - ky_1 = height / (right_1.getLayout().x + delta + tx_1); - kx_1 = width / (bottom_1.depth - 1 || 1); - eachBefore(realRoot, function (node) { - coorY_1 = (node.getLayout().x + tx_1) * ky_1; - coorX_1 = orient_1 === 'LR' ? (node.depth - 1) * kx_1 : width - (node.depth - 1) * kx_1; - node.setLayout({ - x: coorX_1, - y: coorY_1 - }, true); - }); - } else if (orient_1 === 'TB' || orient_1 === 'BT') { - kx_1 = width / (right_1.getLayout().x + delta + tx_1); - ky_1 = height / (bottom_1.depth - 1 || 1); - eachBefore(realRoot, function (node) { - coorX_1 = (node.getLayout().x + tx_1) * kx_1; - coorY_1 = orient_1 === 'TB' ? (node.depth - 1) * ky_1 : height - (node.depth - 1) * ky_1; - node.setLayout({ - x: coorX_1, - y: coorY_1 - }, true); - }); - } - } + } else if (orient_1 === 'TB' || orient_1 === 'BT') { + kx_1 = width / (right_1.getLayout().x + delta + tx_1); + ky_1 = height / (bottom_1.depth - 1 || 1); + eachBefore(realRoot, function (node) { + coorX_1 = (node.getLayout().x + tx_1) * kx_1; + coorY_1 = orient_1 === 'TB' ? (node.depth - 1) * ky_1 : height - (node.depth - 1) * ky_1; + node.setLayout({ + x: coorX_1, + y: coorY_1 + }, true); + }); + } } + } } function treeVisual(ecModel) { - ecModel.eachSeriesByType('tree', function (seriesModel) { - var data = seriesModel.getData(); - var tree = data.tree; - tree.eachNode(function (node) { - var model = node.getModel(); // TODO Optimize + ecModel.eachSeriesByType('tree', function (seriesModel) { + var data = seriesModel.getData(); + var tree = data.tree; + tree.eachNode(function (node) { + var model = node.getModel(); // TODO Optimize - var style = model.getModel('itemStyle').getItemStyle(); - var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style'); - extend(existsStyle, style); - }); + var style = model.getModel('itemStyle').getItemStyle(); + var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style'); + extend(existsStyle, style); }); + }); } function installTreeAction(registers) { - registers.registerAction({ - type: 'treeExpandAndCollapse', - event: 'treeExpandAndCollapse', - update: 'update' - }, function (payload, ecModel) { - ecModel.eachComponent({ - mainType: 'series', - subType: 'tree', - query: payload - }, function (seriesModel) { - var dataIndex = payload.dataIndex; - var tree = seriesModel.getData().tree; - var node = tree.getNodeByDataIndex(dataIndex); - node.isExpand = !node.isExpand; - }); + registers.registerAction({ + type: 'treeExpandAndCollapse', + event: 'treeExpandAndCollapse', + update: 'update' + }, function (payload, ecModel) { + ecModel.eachComponent({ + mainType: 'series', + subType: 'tree', + query: payload + }, function (seriesModel) { + var dataIndex = payload.dataIndex; + var tree = seriesModel.getData().tree; + var node = tree.getNodeByDataIndex(dataIndex); + node.isExpand = !node.isExpand; }); - registers.registerAction({ - type: 'treeRoam', - event: 'treeRoam', - // Here we set 'none' instead of 'update', because roam action - // just need to update the transform matrix without having to recalculate - // the layout. So don't need to go through the whole update process, such - // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on. - update: 'none' - }, function (payload, ecModel) { - ecModel.eachComponent({ - mainType: 'series', - subType: 'tree', - query: payload - }, function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; - var res = updateCenterAndZoom(coordSys, payload); - seriesModel.setCenter && seriesModel.setCenter(res.center); - seriesModel.setZoom && seriesModel.setZoom(res.zoom); - }); + }); + registers.registerAction({ + type: 'treeRoam', + event: 'treeRoam', + // Here we set 'none' instead of 'update', because roam action + // just need to update the transform matrix without having to recalculate + // the layout. So don't need to go through the whole update process, such + // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on. + update: 'none' + }, function (payload, ecModel) { + ecModel.eachComponent({ + mainType: 'series', + subType: 'tree', + query: payload + }, function (seriesModel) { + var coordSys = seriesModel.coordinateSystem; + var res = updateCenterAndZoom(coordSys, payload); + seriesModel.setCenter && seriesModel.setCenter(res.center); + seriesModel.setZoom && seriesModel.setZoom(res.zoom); }); + }); } function install$b(registers) { - registers.registerChartView(TreeView); - registers.registerSeriesModel(TreeSeriesModel); - registers.registerLayout(treeLayout); - registers.registerVisual(treeVisual); - installTreeAction(registers); + registers.registerChartView(TreeView); + registers.registerSeriesModel(TreeSeriesModel); + registers.registerLayout(treeLayout); + registers.registerVisual(treeVisual); + installTreeAction(registers); } var actionTypes = ['treemapZoomToNode', 'treemapRender', 'treemapMove']; function installTreemapAction(registers) { - for (var i = 0; i < actionTypes.length; i++) { - registers.registerAction({ - type: actionTypes[i], - update: 'updateView' - }, noop); - } - + for (var i = 0; i < actionTypes.length; i++) { registers.registerAction({ - type: 'treemapRootToNode', - update: 'updateView' - }, function (payload, ecModel) { - ecModel.eachComponent({ - mainType: 'series', - subType: 'treemap', - query: payload - }, handleRootToNode); - - function handleRootToNode(model, index) { - var types = ['treemapZoomToNode', 'treemapRootToNode']; - var targetInfo = retrieveTargetInfo(payload, types, model); - - if (targetInfo) { - var originViewRoot = model.getViewRoot(); - - if (originViewRoot) { - payload.direction = aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown'; - } - - model.resetViewRoot(targetInfo.node); - } - } - }); - } - - function enableAriaDecalForTree(seriesModel) { - var data = seriesModel.getData(); - var tree = data.tree; - var decalPaletteScope = {}; - tree.eachNode(function (node) { - // Use decal of level 1 node - var current = node; - - while (current && current.depth > 1) { - current = current.parentNode; - } + type: actionTypes[i], + update: 'updateView' + }, noop); + } - var decal = getDecalFromPalette(seriesModel.ecModel, current.name || current.dataIndex + '', decalPaletteScope); - node.setVisual('decal', decal); - }); - } + registers.registerAction({ + type: 'treemapRootToNode', + update: 'updateView' + }, function (payload, ecModel) { + ecModel.eachComponent({ + mainType: 'series', + subType: 'treemap', + query: payload + }, handleRootToNode); - var TreemapSeriesModel = - /** @class */ - function (_super) { - __extends(TreemapSeriesModel, _super); + function handleRootToNode(model, index) { + var types = ['treemapZoomToNode', 'treemapRootToNode']; + var targetInfo = retrieveTargetInfo(payload, types, model); - function TreemapSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + if (targetInfo) { + var originViewRoot = model.getViewRoot(); - _this.type = TreemapSeriesModel.type; - _this.preventUsingHoverLayer = true; - return _this; + if (originViewRoot) { + payload.direction = aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown'; } - /** - * @override - */ - - - TreemapSeriesModel.prototype.getInitialData = function (option, ecModel) { - // Create a virtual root. - var root = { - name: option.name, - children: option.data - }; - completeTreeValue(root); - var levels = option.levels || []; // Used in "visual priority" in `treemapVisual.js`. - // This way is a little tricky, must satisfy the precondition: - // 1. There is no `treeNode.getModel('itemStyle.xxx')` used. - // 2. The `Model.prototype.getModel()` will not use any clone-like way. - - var designatedVisualItemStyle = this.designatedVisualItemStyle = {}; - var designatedVisualModel = new Model({ - itemStyle: designatedVisualItemStyle - }, this, ecModel); - levels = option.levels = setDefault(levels, ecModel); - var levelModels = map(levels || [], function (levelDefine) { - return new Model(levelDefine, designatedVisualModel, ecModel); - }, this); // Make sure always a new tree is created when setOption, - // in TreemapView, we check whether oldTree === newTree - // to choose mappings approach among old shapes and new shapes. - - var tree = Tree.createTree(root, this, beforeLink); - - function beforeLink(nodeData) { - nodeData.wrapMethod('getItemModel', function (model, idx) { - var node = tree.getNodeByDataIndex(idx); - var levelModel = node ? levelModels[node.depth] : null; // If no levelModel, we also need `designatedVisualModel`. - - model.parentModel = levelModel || designatedVisualModel; - return model; - }); - } - - return tree.data; - }; - - TreemapSeriesModel.prototype.optionUpdated = function () { - this.resetViewRoot(); - }; - /** - * @override - * @param {number} dataIndex - * @param {boolean} [mutipleSeries=false] - */ - - - TreemapSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - var data = this.getData(); - var value = this.getRawValue(dataIndex); - var name = data.getName(dataIndex); - return createTooltipMarkup('nameValue', { - name: name, - value: value - }); - }; - /** - * Add tree path to tooltip param - * - * @override - * @param {number} dataIndex - * @return {Object} - */ - - TreemapSeriesModel.prototype.getDataParams = function (dataIndex) { - var params = _super.prototype.getDataParams.apply(this, arguments); + model.resetViewRoot(targetInfo.node); + } + } + }); + } - var node = this.getData().tree.getNodeByDataIndex(dataIndex); - params.treeAncestors = wrapTreePathInfo(node, this); // compatitable the previous code. + function enableAriaDecalForTree(seriesModel) { + var data = seriesModel.getData(); + var tree = data.tree; + var decalPaletteScope = {}; + tree.eachNode(function (node) { + // Use decal of level 1 node + var current = node; - params.treePathInfo = params.treeAncestors; - return params; - }; - /** - * @public - * @param {Object} layoutInfo { - * x: containerGroup x - * y: containerGroup y - * width: containerGroup width - * height: containerGroup height - * } - */ + while (current && current.depth > 1) { + current = current.parentNode; + } + var decal = getDecalFromPalette(seriesModel.ecModel, current.name || current.dataIndex + '', decalPaletteScope); + node.setVisual('decal', decal); + }); + } - TreemapSeriesModel.prototype.setLayoutInfo = function (layoutInfo) { - /** - * @readOnly - * @type {Object} - */ - this.layoutInfo = this.layoutInfo || {}; - extend(this.layoutInfo, layoutInfo); - }; - /** - * @param {string} id - * @return {number} index - */ + var TreemapSeriesModel = + /** @class */ + function (_super) { + __extends(TreemapSeriesModel, _super); + + function TreemapSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = TreemapSeriesModel.type; + _this.preventUsingHoverLayer = true; + return _this; + } + /** + * @override + */ - TreemapSeriesModel.prototype.mapIdToIndex = function (id) { - // A feature is implemented: - // index is monotone increasing with the sequence of - // input id at the first time. - // This feature can make sure that each data item and its - // mapped color have the same index between data list and - // color list at the beginning, which is useful for user - // to adjust data-color mapping. + TreemapSeriesModel.prototype.getInitialData = function (option, ecModel) { + // Create a virtual root. + var root = { + name: option.name, + children: option.data + }; + completeTreeValue(root); + var levels = option.levels || []; // Used in "visual priority" in `treemapVisual.js`. + // This way is a little tricky, must satisfy the precondition: + // 1. There is no `treeNode.getModel('itemStyle.xxx')` used. + // 2. The `Model.prototype.getModel()` will not use any clone-like way. + + var designatedVisualItemStyle = this.designatedVisualItemStyle = {}; + var designatedVisualModel = new Model({ + itemStyle: designatedVisualItemStyle + }, this, ecModel); + levels = option.levels = setDefault(levels, ecModel); + var levelModels = map(levels || [], function (levelDefine) { + return new Model(levelDefine, designatedVisualModel, ecModel); + }, this); // Make sure always a new tree is created when setOption, + // in TreemapView, we check whether oldTree === newTree + // to choose mappings approach among old shapes and new shapes. + + var tree = Tree.createTree(root, this, beforeLink); + + function beforeLink(nodeData) { + nodeData.wrapMethod('getItemModel', function (model, idx) { + var node = tree.getNodeByDataIndex(idx); + var levelModel = node ? levelModels[node.depth] : null; // If no levelModel, we also need `designatedVisualModel`. + + model.parentModel = levelModel || designatedVisualModel; + return model; + }); + } + + return tree.data; + }; + + TreemapSeriesModel.prototype.optionUpdated = function () { + this.resetViewRoot(); + }; + /** + * @override + * @param {number} dataIndex + * @param {boolean} [mutipleSeries=false] + */ - /** - * @private - * @type {Object} - */ - var idIndexMap = this._idIndexMap; - if (!idIndexMap) { - idIndexMap = this._idIndexMap = createHashMap(); - /** - * @private - * @type {number} - */ + TreemapSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { + var data = this.getData(); + var value = this.getRawValue(dataIndex); + var name = data.getName(dataIndex); + return createTooltipMarkup('nameValue', { + name: name, + value: value + }); + }; + /** + * Add tree path to tooltip param + * + * @override + * @param {number} dataIndex + * @return {Object} + */ - this._idIndexMapCount = 0; - } - var index = idIndexMap.get(id); + TreemapSeriesModel.prototype.getDataParams = function (dataIndex) { + var params = _super.prototype.getDataParams.apply(this, arguments); - if (index == null) { - idIndexMap.set(id, index = this._idIndexMapCount++); - } + var node = this.getData().tree.getNodeByDataIndex(dataIndex); + params.treeAncestors = wrapTreePathInfo(node, this); // compatitable the previous code. - return index; - }; + params.treePathInfo = params.treeAncestors; + return params; + }; + /** + * @public + * @param {Object} layoutInfo { + * x: containerGroup x + * y: containerGroup y + * width: containerGroup width + * height: containerGroup height + * } + */ - TreemapSeriesModel.prototype.getViewRoot = function () { - return this._viewRoot; - }; - TreemapSeriesModel.prototype.resetViewRoot = function (viewRoot) { - viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot; - var root = this.getRawData().tree.root; + TreemapSeriesModel.prototype.setLayoutInfo = function (layoutInfo) { + /** + * @readOnly + * @type {Object} + */ + this.layoutInfo = this.layoutInfo || {}; + extend(this.layoutInfo, layoutInfo); + }; + /** + * @param {string} id + * @return {number} index + */ - if (!viewRoot || viewRoot !== root && !root.contains(viewRoot)) { - this._viewRoot = root; - } - }; - TreemapSeriesModel.prototype.enableAriaDecal = function () { - enableAriaDecalForTree(this); - }; + TreemapSeriesModel.prototype.mapIdToIndex = function (id) { + // A feature is implemented: + // index is monotone increasing with the sequence of + // input id at the first time. + // This feature can make sure that each data item and its + // mapped color have the same index between data list and + // color list at the beginning, which is useful for user + // to adjust data-color mapping. - TreemapSeriesModel.type = 'series.treemap'; - TreemapSeriesModel.layoutMode = 'box'; - TreemapSeriesModel.defaultOption = { - // Disable progressive rendering - progressive: 0, - // size: ['80%', '80%'], // deprecated, compatible with ec2. - left: 'center', - top: 'middle', - width: '80%', - height: '80%', - sort: true, - clipWindow: 'origin', - squareRatio: 0.5 * (1 + Math.sqrt(5)), - leafDepth: null, - drillDownIcon: '▶', - // to align specialized icon. ▷▶❒❐▼✚ - zoomToNodeRatio: 0.32 * 0.32, - roam: true, - nodeClick: 'zoomToNode', - animation: true, - animationDurationUpdate: 900, - animationEasing: 'quinticInOut', - breadcrumb: { - show: true, - height: 22, - left: 'center', - top: 'bottom', - // right - // bottom - emptyItemWidth: 25, - itemStyle: { - color: 'rgba(0,0,0,0.7)', - textStyle: { - color: '#fff' - } - } - }, - label: { - show: true, - // Do not use textDistance, for ellipsis rect just the same as treemap node rect. - distance: 0, - padding: 5, - position: 'inside', - // formatter: null, - color: '#fff', - overflow: 'truncate' // align - // verticalAlign + /** + * @private + * @type {Object} + */ + var idIndexMap = this._idIndexMap; + + if (!idIndexMap) { + idIndexMap = this._idIndexMap = createHashMap(); + /** + * @private + * @type {number} + */ + + this._idIndexMapCount = 0; + } + + var index = idIndexMap.get(id); + + if (index == null) { + idIndexMap.set(id, index = this._idIndexMapCount++); + } + + return index; + }; + + TreemapSeriesModel.prototype.getViewRoot = function () { + return this._viewRoot; + }; + + TreemapSeriesModel.prototype.resetViewRoot = function (viewRoot) { + viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot; + var root = this.getRawData().tree.root; + + if (!viewRoot || viewRoot !== root && !root.contains(viewRoot)) { + this._viewRoot = root; + } + }; + + TreemapSeriesModel.prototype.enableAriaDecal = function () { + enableAriaDecalForTree(this); + }; + + TreemapSeriesModel.type = 'series.treemap'; + TreemapSeriesModel.layoutMode = 'box'; + TreemapSeriesModel.defaultOption = { + // Disable progressive rendering + progressive: 0, + // size: ['80%', '80%'], // deprecated, compatible with ec2. + left: 'center', + top: 'middle', + width: '80%', + height: '80%', + sort: true, + clipWindow: 'origin', + squareRatio: 0.5 * (1 + Math.sqrt(5)), + leafDepth: null, + drillDownIcon: '▶', + // to align specialized icon. ▷▶❒❐▼✚ + zoomToNodeRatio: 0.32 * 0.32, + roam: true, + nodeClick: 'zoomToNode', + animation: true, + animationDurationUpdate: 900, + animationEasing: 'quinticInOut', + breadcrumb: { + show: true, + height: 22, + left: 'center', + top: 'bottom', + // right + // bottom + emptyItemWidth: 25, + itemStyle: { + color: 'rgba(0,0,0,0.7)', + textStyle: { + color: '#fff' + } + } + }, + label: { + show: true, + // Do not use textDistance, for ellipsis rect just the same as treemap node rect. + distance: 0, + padding: 5, + position: 'inside', + // formatter: null, + color: '#fff', + overflow: 'truncate' // align + // verticalAlign - }, - upperLabel: { - show: false, - position: [0, '50%'], - height: 20, - // formatter: null, - // color: '#fff', - overflow: 'truncate', - // align: null, - verticalAlign: 'middle' - }, - itemStyle: { - color: null, - colorAlpha: null, - colorSaturation: null, - borderWidth: 0, - gapWidth: 0, - borderColor: '#fff', - borderColorSaturation: null // If specified, borderColor will be ineffective, and the - // border color is evaluated by color of current node and - // borderColorSaturation. + }, + upperLabel: { + show: false, + position: [0, '50%'], + height: 20, + // formatter: null, + // color: '#fff', + overflow: 'truncate', + // align: null, + verticalAlign: 'middle' + }, + itemStyle: { + color: null, + colorAlpha: null, + colorSaturation: null, + borderWidth: 0, + gapWidth: 0, + borderColor: '#fff', + borderColorSaturation: null // If specified, borderColor will be ineffective, and the + // border color is evaluated by color of current node and + // borderColorSaturation. - }, - emphasis: { - upperLabel: { - show: true, - position: [0, '50%'], - overflow: 'truncate', - verticalAlign: 'middle' - } - }, - visualDimension: 0, - visualMin: null, - visualMax: null, - color: [], - // level[n].color (if necessary). - // + Specify color list of each level. level[0].color would be global - // color list if not specified. (see method `setDefault`). - // + But set as a empty array to forbid fetch color from global palette - // when using nodeModel.get('color'), otherwise nodes on deep level - // will always has color palette set and are not able to inherit color - // from parent node. - // + TreemapSeries.color can not be set as 'none', otherwise effect - // legend color fetching (see seriesColor.js). - colorAlpha: null, - colorSaturation: null, - colorMappingBy: 'index', - visibleMin: 10, - // be rendered. Only works when sort is 'asc' or 'desc'. - childrenVisibleMin: null, - // grandchildren will not show. - // Why grandchildren? If not grandchildren but children, - // some siblings show children and some not, - // the appearance may be mess and not consistent, - levels: [] // Each item: { - // visibleMin, itemStyle, visualDimension, label - // } - // data: { - // value: [], - // children: [], - // link: 'http://xxx.xxx.xxx', - // target: 'blank' or 'self' - // } + }, + emphasis: { + upperLabel: { + show: true, + position: [0, '50%'], + overflow: 'truncate', + verticalAlign: 'middle' + } + }, + visualDimension: 0, + visualMin: null, + visualMax: null, + color: [], + // level[n].color (if necessary). + // + Specify color list of each level. level[0].color would be global + // color list if not specified. (see method `setDefault`). + // + But set as a empty array to forbid fetch color from global palette + // when using nodeModel.get('color'), otherwise nodes on deep level + // will always has color palette set and are not able to inherit color + // from parent node. + // + TreemapSeries.color can not be set as 'none', otherwise effect + // legend color fetching (see seriesColor.js). + colorAlpha: null, + colorSaturation: null, + colorMappingBy: 'index', + visibleMin: 10, + // be rendered. Only works when sort is 'asc' or 'desc'. + childrenVisibleMin: null, + // grandchildren will not show. + // Why grandchildren? If not grandchildren but children, + // some siblings show children and some not, + // the appearance may be mess and not consistent, + levels: [] // Each item: { + // visibleMin, itemStyle, visualDimension, label + // } + // data: { + // value: [], + // children: [], + // link: 'http://xxx.xxx.xxx', + // target: 'blank' or 'self' + // } - }; - return TreemapSeriesModel; - }(SeriesModel); + }; + return TreemapSeriesModel; + }(SeriesModel); /** * @param {Object} dataNode */ function completeTreeValue(dataNode) { - // Postorder travel tree. - // If value of none-leaf node is not set, - // calculate it by suming up the value of all children. - var sum = 0; - each(dataNode.children, function (child) { - completeTreeValue(child); - var childValue = child.value; - isArray(childValue) && (childValue = childValue[0]); - sum += childValue; - }); - var thisValue = dataNode.value; + // Postorder travel tree. + // If value of none-leaf node is not set, + // calculate it by suming up the value of all children. + var sum = 0; + each(dataNode.children, function (child) { + completeTreeValue(child); + var childValue = child.value; + isArray(childValue) && (childValue = childValue[0]); + sum += childValue; + }); + var thisValue = dataNode.value; - if (isArray(thisValue)) { - thisValue = thisValue[0]; - } + if (isArray(thisValue)) { + thisValue = thisValue[0]; + } - if (thisValue == null || isNaN(thisValue)) { - thisValue = sum; - } // Value should not less than 0. + if (thisValue == null || isNaN(thisValue)) { + thisValue = sum; + } // Value should not less than 0. - if (thisValue < 0) { - thisValue = 0; - } + if (thisValue < 0) { + thisValue = 0; + } - isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue; + isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue; } /** * set default to level configuration @@ -56364,40 +56364,40 @@ function setDefault(levels, ecModel) { - var globalColorList = normalizeToArray(ecModel.get('color')); - var globalDecalList = normalizeToArray(ecModel.get(['aria', 'decal', 'decals'])); - - if (!globalColorList) { - return; - } - - levels = levels || []; - var hasColorDefine; - var hasDecalDefine; - each(levels, function (levelDefine) { - var model = new Model(levelDefine); - var modelColor = model.get('color'); - var modelDecal = model.get('decal'); + var globalColorList = normalizeToArray(ecModel.get('color')); + var globalDecalList = normalizeToArray(ecModel.get(['aria', 'decal', 'decals'])); - if (model.get(['itemStyle', 'color']) || modelColor && modelColor !== 'none') { - hasColorDefine = true; - } + if (!globalColorList) { + return; + } - if (model.get(['itemStyle', 'decal']) || modelDecal && modelDecal !== 'none') { - hasDecalDefine = true; - } - }); - var level0 = levels[0] || (levels[0] = {}); + levels = levels || []; + var hasColorDefine; + var hasDecalDefine; + each(levels, function (levelDefine) { + var model = new Model(levelDefine); + var modelColor = model.get('color'); + var modelDecal = model.get('decal'); - if (!hasColorDefine) { - level0.color = globalColorList.slice(); + if (model.get(['itemStyle', 'color']) || modelColor && modelColor !== 'none') { + hasColorDefine = true; } - if (!hasDecalDefine && globalDecalList) { - level0.decal = globalDecalList.slice(); + if (model.get(['itemStyle', 'decal']) || modelDecal && modelDecal !== 'none') { + hasDecalDefine = true; } + }); + var level0 = levels[0] || (levels[0] = {}); + + if (!hasColorDefine) { + level0.color = globalColorList.slice(); + } + + if (!hasDecalDefine && globalDecalList) { + level0.decal = globalDecalList.slice(); + } - return levels; + return levels; } var TEXT_PADDING = 8; @@ -56405,149 +56405,149 @@ var ARRAY_LENGTH = 5; var Breadcrumb = - /** @class */ - function () { - function Breadcrumb(containerGroup) { - this.group = new Group(); - containerGroup.add(this.group); - } - - Breadcrumb.prototype.render = function (seriesModel, api, targetNode, onSelect) { - var model = seriesModel.getModel('breadcrumb'); - var thisGroup = this.group; - thisGroup.removeAll(); - - if (!model.get('show') || !targetNode) { - return; - } - - var normalStyleModel = model.getModel('itemStyle'); // let emphasisStyleModel = model.getModel('emphasis.itemStyle'); - - var textStyleModel = normalStyleModel.getModel('textStyle'); - var layoutParam = { - pos: { - left: model.get('left'), - right: model.get('right'), - top: model.get('top'), - bottom: model.get('bottom') - }, - box: { - width: api.getWidth(), - height: api.getHeight() - }, - emptyItemWidth: model.get('emptyItemWidth'), - totalWidth: 0, - renderList: [] - }; - - this._prepare(targetNode, layoutParam, textStyleModel); + /** @class */ + function () { + function Breadcrumb(containerGroup) { + this.group = new Group(); + containerGroup.add(this.group); + } + + Breadcrumb.prototype.render = function (seriesModel, api, targetNode, onSelect) { + var model = seriesModel.getModel('breadcrumb'); + var thisGroup = this.group; + thisGroup.removeAll(); + + if (!model.get('show') || !targetNode) { + return; + } + + var normalStyleModel = model.getModel('itemStyle'); // let emphasisStyleModel = model.getModel('emphasis.itemStyle'); + + var textStyleModel = normalStyleModel.getModel('textStyle'); + var layoutParam = { + pos: { + left: model.get('left'), + right: model.get('right'), + top: model.get('top'), + bottom: model.get('bottom') + }, + box: { + width: api.getWidth(), + height: api.getHeight() + }, + emptyItemWidth: model.get('emptyItemWidth'), + totalWidth: 0, + renderList: [] + }; - this._renderContent(seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect); + this._prepare(targetNode, layoutParam, textStyleModel); - positionElement(thisGroup, layoutParam.pos, layoutParam.box); - }; - /** - * Prepare render list and total width - * @private - */ + this._renderContent(seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect); + positionElement(thisGroup, layoutParam.pos, layoutParam.box); + }; + /** + * Prepare render list and total width + * @private + */ - Breadcrumb.prototype._prepare = function (targetNode, layoutParam, textStyleModel) { - for (var node = targetNode; node; node = node.parentNode) { - var text = convertOptionIdName(node.getModel().get('name'), ''); - var textRect = textStyleModel.getTextRect(text); - var itemWidth = Math.max(textRect.width + TEXT_PADDING * 2, layoutParam.emptyItemWidth); - layoutParam.totalWidth += itemWidth + ITEM_GAP; - layoutParam.renderList.push({ - node: node, - text: text, - width: itemWidth - }); - } - }; - /** - * @private - */ + Breadcrumb.prototype._prepare = function (targetNode, layoutParam, textStyleModel) { + for (var node = targetNode; node; node = node.parentNode) { + var text = convertOptionIdName(node.getModel().get('name'), ''); + var textRect = textStyleModel.getTextRect(text); + var itemWidth = Math.max(textRect.width + TEXT_PADDING * 2, layoutParam.emptyItemWidth); + layoutParam.totalWidth += itemWidth + ITEM_GAP; + layoutParam.renderList.push({ + node: node, + text: text, + width: itemWidth + }); + } + }; + /** + * @private + */ - Breadcrumb.prototype._renderContent = function (seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect) { - // Start rendering. - var lastX = 0; - var emptyItemWidth = layoutParam.emptyItemWidth; - var height = seriesModel.get(['breadcrumb', 'height']); - var availableSize = getAvailableSize(layoutParam.pos, layoutParam.box); - var totalWidth = layoutParam.totalWidth; - var renderList = layoutParam.renderList; - - for (var i = renderList.length - 1; i >= 0; i--) { - var item = renderList[i]; - var itemNode = item.node; - var itemWidth = item.width; - var text = item.text; // Hdie text and shorten width if necessary. - - if (totalWidth > availableSize.width) { - totalWidth -= itemWidth - emptyItemWidth; - itemWidth = emptyItemWidth; - text = null; - } - var el = new Polygon({ - shape: { - points: makeItemPoints(lastX, 0, itemWidth, height, i === renderList.length - 1, i === 0) - }, - style: defaults(normalStyleModel.getItemStyle(), { - lineJoin: 'bevel' - }), - textContent: new ZRText({ - style: { - text: text, - fill: textStyleModel.getTextColor(), - font: textStyleModel.getFont() - } - }), - textConfig: { - position: 'inside' - }, - z2: Z2_EMPHASIS_LIFT * 1e4, - onclick: curry(onSelect, itemNode) - }); - el.disableLabelAnimation = true; - this.group.add(el); - packEventData(el, seriesModel, itemNode); - lastX += itemWidth + ITEM_GAP; - } - }; + Breadcrumb.prototype._renderContent = function (seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect) { + // Start rendering. + var lastX = 0; + var emptyItemWidth = layoutParam.emptyItemWidth; + var height = seriesModel.get(['breadcrumb', 'height']); + var availableSize = getAvailableSize(layoutParam.pos, layoutParam.box); + var totalWidth = layoutParam.totalWidth; + var renderList = layoutParam.renderList; + + for (var i = renderList.length - 1; i >= 0; i--) { + var item = renderList[i]; + var itemNode = item.node; + var itemWidth = item.width; + var text = item.text; // Hdie text and shorten width if necessary. + + if (totalWidth > availableSize.width) { + totalWidth -= itemWidth - emptyItemWidth; + itemWidth = emptyItemWidth; + text = null; + } + + var el = new Polygon({ + shape: { + points: makeItemPoints(lastX, 0, itemWidth, height, i === renderList.length - 1, i === 0) + }, + style: defaults(normalStyleModel.getItemStyle(), { + lineJoin: 'bevel' + }), + textContent: new ZRText({ + style: { + text: text, + fill: textStyleModel.getTextColor(), + font: textStyleModel.getFont() + } + }), + textConfig: { + position: 'inside' + }, + z2: Z2_EMPHASIS_LIFT * 1e4, + onclick: curry(onSelect, itemNode) + }); + el.disableLabelAnimation = true; + this.group.add(el); + packEventData(el, seriesModel, itemNode); + lastX += itemWidth + ITEM_GAP; + } + }; - Breadcrumb.prototype.remove = function () { - this.group.removeAll(); - }; + Breadcrumb.prototype.remove = function () { + this.group.removeAll(); + }; - return Breadcrumb; - }(); + return Breadcrumb; + }(); function makeItemPoints(x, y, itemWidth, itemHeight, head, tail) { - var points = [[head ? x : x - ARRAY_LENGTH, y], [x + itemWidth, y], [x + itemWidth, y + itemHeight], [head ? x : x - ARRAY_LENGTH, y + itemHeight]]; - !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]); - !head && points.push([x, y + itemHeight / 2]); - return points; + var points = [[head ? x : x - ARRAY_LENGTH, y], [x + itemWidth, y], [x + itemWidth, y + itemHeight], [head ? x : x - ARRAY_LENGTH, y + itemHeight]]; + !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]); + !head && points.push([x, y + itemHeight / 2]); + return points; } // Package custom mouse event. function packEventData(el, seriesModel, itemNode) { - getECData(el).eventData = { - componentType: 'series', - componentSubType: 'treemap', - componentIndex: seriesModel.componentIndex, - seriesIndex: seriesModel.seriesIndex, - seriesName: seriesModel.name, - seriesType: 'treemap', - selfType: 'breadcrumb', - nodeData: { - dataIndex: itemNode && itemNode.dataIndex, - name: itemNode && itemNode.name - }, - treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel) - }; + getECData(el).eventData = { + componentType: 'series', + componentSubType: 'treemap', + componentIndex: seriesModel.componentIndex, + seriesIndex: seriesModel.seriesIndex, + seriesName: seriesModel.name, + seriesType: 'treemap', + selfType: 'breadcrumb', + nodeData: { + dataIndex: itemNode && itemNode.dataIndex, + name: itemNode && itemNode.name + }, + treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel) + }; } /* @@ -56605,88 +56605,88 @@ * .start('cubicOut'); */ var AnimationWrap = - /** @class */ - function () { - function AnimationWrap() { - this._storage = []; - this._elExistsMap = {}; - } - /** - * Caution: a el can only be added once, otherwise 'done' - * might not be called. This method checks this (by el.id), - * suppresses adding and returns false when existing el found. - * - * @return Whether adding succeeded. - */ + /** @class */ + function () { + function AnimationWrap() { + this._storage = []; + this._elExistsMap = {}; + } + /** + * Caution: a el can only be added once, otherwise 'done' + * might not be called. This method checks this (by el.id), + * suppresses adding and returns false when existing el found. + * + * @return Whether adding succeeded. + */ - AnimationWrap.prototype.add = function (el, target, duration, delay, easing) { - if (this._elExistsMap[el.id]) { - return false; - } + AnimationWrap.prototype.add = function (el, target, duration, delay, easing) { + if (this._elExistsMap[el.id]) { + return false; + } - this._elExistsMap[el.id] = true; + this._elExistsMap[el.id] = true; - this._storage.push({ - el: el, - target: target, - duration: duration, - delay: delay, - easing: easing - }); + this._storage.push({ + el: el, + target: target, + duration: duration, + delay: delay, + easing: easing + }); - return true; - }; - /** - * Only execute when animation done/aborted. - */ + return true; + }; + /** + * Only execute when animation done/aborted. + */ - AnimationWrap.prototype.finished = function (callback) { - this._finishedCallback = callback; - return this; - }; - /** - * Will stop exist animation firstly. - */ + AnimationWrap.prototype.finished = function (callback) { + this._finishedCallback = callback; + return this; + }; + /** + * Will stop exist animation firstly. + */ - AnimationWrap.prototype.start = function () { - var _this = this; + AnimationWrap.prototype.start = function () { + var _this = this; - var count = this._storage.length; + var count = this._storage.length; - var checkTerminate = function () { - count--; + var checkTerminate = function () { + count--; - if (count <= 0) { - // Guard. - _this._storage.length = 0; - _this._elExistsMap = {}; - _this._finishedCallback && _this._finishedCallback(); - } - }; + if (count <= 0) { + // Guard. + _this._storage.length = 0; + _this._elExistsMap = {}; + _this._finishedCallback && _this._finishedCallback(); + } + }; - for (var i = 0, len = this._storage.length; i < len; i++) { - var item = this._storage[i]; - item.el.animateTo(item.target, { - duration: item.duration, - delay: item.delay, - easing: item.easing, - setToFinal: true, - done: checkTerminate, - aborted: checkTerminate - }); - } + for (var i = 0, len = this._storage.length; i < len; i++) { + var item = this._storage[i]; + item.el.animateTo(item.target, { + duration: item.duration, + delay: item.delay, + easing: item.easing, + setToFinal: true, + done: checkTerminate, + aborted: checkTerminate + }); + } - return this; - }; + return this; + }; - return AnimationWrap; - }(); + return AnimationWrap; + }(); function createWrap() { - return new AnimationWrap(); + return new AnimationWrap(); } var Group$1 = Group; @@ -56700,549 +56700,549 @@ var Z2_BG = Z2_EMPHASIS_LIFT * 2; var Z2_CONTENT = Z2_EMPHASIS_LIFT * 3; var getStateItemStyle = makeStyleMapper([['fill', 'color'], // `borderColor` and `borderWidth` has been occupied, - // so use `stroke` to indicate the stroke of the rect. - ['stroke', 'strokeColor'], ['lineWidth', 'strokeWidth'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`. - // So do not transfer decal directly. + // so use `stroke` to indicate the stroke of the rect. + ['stroke', 'strokeColor'], ['lineWidth', 'strokeWidth'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`. + // So do not transfer decal directly. ]); var getItemStyleNormal = function (model) { - // Normal style props should include emphasis style props. - var itemStyle = getStateItemStyle(model); // Clear styles set by emphasis. + // Normal style props should include emphasis style props. + var itemStyle = getStateItemStyle(model); // Clear styles set by emphasis. - itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null; - return itemStyle; + itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null; + return itemStyle; }; var inner$8 = makeInner(); var TreemapView = - /** @class */ - function (_super) { - __extends(TreemapView, _super); + /** @class */ + function (_super) { + __extends(TreemapView, _super); + + function TreemapView() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = TreemapView.type; + _this._state = 'ready'; + _this._storage = createStorage(); + return _this; + } + /** + * @override + */ - function TreemapView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = TreemapView.type; - _this._state = 'ready'; - _this._storage = createStorage(); - return _this; - } - /** - * @override - */ + TreemapView.prototype.render = function (seriesModel, ecModel, api, payload) { + var models = ecModel.findComponents({ + mainType: 'series', + subType: 'treemap', + query: payload + }); + if (indexOf(models, seriesModel) < 0) { + return; + } - TreemapView.prototype.render = function (seriesModel, ecModel, api, payload) { - var models = ecModel.findComponents({ - mainType: 'series', - subType: 'treemap', - query: payload - }); + this.seriesModel = seriesModel; + this.api = api; + this.ecModel = ecModel; + var types = ['treemapZoomToNode', 'treemapRootToNode']; + var targetInfo = retrieveTargetInfo(payload, types, seriesModel); + var payloadType = payload && payload.type; + var layoutInfo = seriesModel.layoutInfo; + var isInit = !this._oldTree; + var thisStorage = this._storage; // Mark new root when action is treemapRootToNode. - if (indexOf(models, seriesModel) < 0) { - return; - } + var reRoot = payloadType === 'treemapRootToNode' && targetInfo && thisStorage ? { + rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()], + direction: payload.direction + } : null; - this.seriesModel = seriesModel; - this.api = api; - this.ecModel = ecModel; - var types = ['treemapZoomToNode', 'treemapRootToNode']; - var targetInfo = retrieveTargetInfo(payload, types, seriesModel); - var payloadType = payload && payload.type; - var layoutInfo = seriesModel.layoutInfo; - var isInit = !this._oldTree; - var thisStorage = this._storage; // Mark new root when action is treemapRootToNode. + var containerGroup = this._giveContainerGroup(layoutInfo); - var reRoot = payloadType === 'treemapRootToNode' && targetInfo && thisStorage ? { - rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()], - direction: payload.direction - } : null; + var hasAnimation = seriesModel.get('animation'); - var containerGroup = this._giveContainerGroup(layoutInfo); + var renderResult = this._doRender(containerGroup, seriesModel, reRoot); - var hasAnimation = seriesModel.get('animation'); + hasAnimation && !isInit && (!payloadType || payloadType === 'treemapZoomToNode' || payloadType === 'treemapRootToNode') ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot) : renderResult.renderFinally(); - var renderResult = this._doRender(containerGroup, seriesModel, reRoot); + this._resetController(api); - hasAnimation && !isInit && (!payloadType || payloadType === 'treemapZoomToNode' || payloadType === 'treemapRootToNode') ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot) : renderResult.renderFinally(); + this._renderBreadcrumb(seriesModel, api, targetInfo); + }; - this._resetController(api); + TreemapView.prototype._giveContainerGroup = function (layoutInfo) { + var containerGroup = this._containerGroup; - this._renderBreadcrumb(seriesModel, api, targetInfo); - }; + if (!containerGroup) { + // FIXME + // 加一层containerGroup是为了clip,但是现在clip功能并没有实现。 + containerGroup = this._containerGroup = new Group$1(); - TreemapView.prototype._giveContainerGroup = function (layoutInfo) { - var containerGroup = this._containerGroup; + this._initEvents(containerGroup); - if (!containerGroup) { - // FIXME - // 加一层containerGroup是为了clip,但是现在clip功能并没有实现。 - containerGroup = this._containerGroup = new Group$1(); + this.group.add(containerGroup); + } - this._initEvents(containerGroup); + containerGroup.x = layoutInfo.x; + containerGroup.y = layoutInfo.y; + return containerGroup; + }; - this.group.add(containerGroup); - } + TreemapView.prototype._doRender = function (containerGroup, seriesModel, reRoot) { + var thisTree = seriesModel.getData().tree; + var oldTree = this._oldTree; // Clear last shape records. - containerGroup.x = layoutInfo.x; - containerGroup.y = layoutInfo.y; - return containerGroup; - }; + var lastsForAnimation = createStorage(); + var thisStorage = createStorage(); + var oldStorage = this._storage; + var willInvisibleEls = []; - TreemapView.prototype._doRender = function (containerGroup, seriesModel, reRoot) { - var thisTree = seriesModel.getData().tree; - var oldTree = this._oldTree; // Clear last shape records. + function doRenderNode(thisNode, oldNode, parentGroup, depth) { + return renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth); + } // Notice: when thisTree and oldTree are the same tree (see list.cloneShallow), + // the oldTree is actually losted, so we can not find all of the old graphic + // elements from tree. So we use this stragegy: make element storage, move + // from old storage to new storage, clear old storage. - var lastsForAnimation = createStorage(); - var thisStorage = createStorage(); - var oldStorage = this._storage; - var willInvisibleEls = []; - function doRenderNode(thisNode, oldNode, parentGroup, depth) { - return renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth); - } // Notice: when thisTree and oldTree are the same tree (see list.cloneShallow), - // the oldTree is actually losted, so we can not find all of the old graphic - // elements from tree. So we use this stragegy: make element storage, move - // from old storage to new storage, clear old storage. + dualTravel(thisTree.root ? [thisTree.root] : [], oldTree && oldTree.root ? [oldTree.root] : [], containerGroup, thisTree === oldTree || !oldTree, 0); // Process all removing. + var willDeleteEls = clearStorage(oldStorage); + this._oldTree = thisTree; + this._storage = thisStorage; + return { + lastsForAnimation: lastsForAnimation, + willDeleteEls: willDeleteEls, + renderFinally: renderFinally + }; + + function dualTravel(thisViewChildren, oldViewChildren, parentGroup, sameTree, depth) { + // When 'render' is triggered by action, + // 'this' and 'old' may be the same tree, + // we use rawIndex in that case. + if (sameTree) { + oldViewChildren = thisViewChildren; + each(thisViewChildren, function (child, index) { + !child.isRemoved() && processNode(index, index); + }); + } // Diff hierarchically (diff only in each subtree, but not whole). + // because, consistency of view is important. + else { + new DataDiffer(oldViewChildren, thisViewChildren, getKey, getKey).add(processNode).update(processNode).remove(curry(processNode, null)).execute(); + } + + function getKey(node) { + // Identify by name or raw index. + return node.getId(); + } + + function processNode(newIndex, oldIndex) { + var thisNode = newIndex != null ? thisViewChildren[newIndex] : null; + var oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null; + var group = doRenderNode(thisNode, oldNode, parentGroup, depth); + group && dualTravel(thisNode && thisNode.viewChildren || [], oldNode && oldNode.viewChildren || [], group, sameTree, depth + 1); + } + } + + function clearStorage(storage) { + var willDeleteEls = createStorage(); + storage && each(storage, function (store, storageName) { + var delEls = willDeleteEls[storageName]; + each(store, function (el) { + el && (delEls.push(el), inner$8(el).willDelete = true); + }); + }); + return willDeleteEls; + } - dualTravel(thisTree.root ? [thisTree.root] : [], oldTree && oldTree.root ? [oldTree.root] : [], containerGroup, thisTree === oldTree || !oldTree, 0); // Process all removing. + function renderFinally() { + each(willDeleteEls, function (els) { + each(els, function (el) { + el.parent && el.parent.remove(el); + }); + }); + each(willInvisibleEls, function (el) { + el.invisible = true; // Setting invisible is for optimizing, so no need to set dirty, + // just mark as invisible. - var willDeleteEls = clearStorage(oldStorage); - this._oldTree = thisTree; - this._storage = thisStorage; - return { - lastsForAnimation: lastsForAnimation, - willDeleteEls: willDeleteEls, - renderFinally: renderFinally - }; + el.dirty(); + }); + } + }; - function dualTravel(thisViewChildren, oldViewChildren, parentGroup, sameTree, depth) { - // When 'render' is triggered by action, - // 'this' and 'old' may be the same tree, - // we use rawIndex in that case. - if (sameTree) { - oldViewChildren = thisViewChildren; - each(thisViewChildren, function (child, index) { - !child.isRemoved() && processNode(index, index); - }); - } // Diff hierarchically (diff only in each subtree, but not whole). - // because, consistency of view is important. - else { - new DataDiffer(oldViewChildren, thisViewChildren, getKey, getKey).add(processNode).update(processNode).remove(curry(processNode, null)).execute(); - } + TreemapView.prototype._doAnimation = function (containerGroup, renderResult, seriesModel, reRoot) { + var durationOption = seriesModel.get('animationDurationUpdate'); + var easingOption = seriesModel.get('animationEasing'); // TODO: do not support function until necessary. - function getKey(node) { - // Identify by name or raw index. - return node.getId(); - } + var duration = (isFunction(durationOption) ? 0 : durationOption) || 0; + var easing = (isFunction(easingOption) ? null : easingOption) || 'cubicOut'; + var animationWrap = createWrap(); // Make delete animations. - function processNode(newIndex, oldIndex) { - var thisNode = newIndex != null ? thisViewChildren[newIndex] : null; - var oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null; - var group = doRenderNode(thisNode, oldNode, parentGroup, depth); - group && dualTravel(thisNode && thisNode.viewChildren || [], oldNode && oldNode.viewChildren || [], group, sameTree, depth + 1); - } - } + each(renderResult.willDeleteEls, function (store, storageName) { + each(store, function (el, rawIndex) { + if (el.invisible) { + return; + } - function clearStorage(storage) { - var willDeleteEls = createStorage(); - storage && each(storage, function (store, storageName) { - var delEls = willDeleteEls[storageName]; - each(store, function (el) { - el && (delEls.push(el), inner$8(el).willDelete = true); - }); - }); - return willDeleteEls; - } + var parent = el.parent; // Always has parent, and parent is nodeGroup. - function renderFinally() { - each(willDeleteEls, function (els) { - each(els, function (el) { - el.parent && el.parent.remove(el); - }); - }); - each(willInvisibleEls, function (el) { - el.invisible = true; // Setting invisible is for optimizing, so no need to set dirty, - // just mark as invisible. + var target; + var innerStore = inner$8(parent); - el.dirty(); - }); + if (reRoot && reRoot.direction === 'drillDown') { + target = parent === reRoot.rootNodeGroup // This is the content element of view root. + // Only `content` will enter this branch, because + // `background` and `nodeGroup` will not be deleted. + ? { + shape: { + x: 0, + y: 0, + width: innerStore.nodeWidth, + height: innerStore.nodeHeight + }, + style: { + opacity: 0 } - }; + } // Others. + : { + style: { + opacity: 0 + } + }; + } else { + var targetX = 0; + var targetY = 0; + + if (!innerStore.willDelete) { + // Let node animate to right-bottom corner, cooperating with fadeout, + // which is appropriate for user understanding. + // Divided by 2 for reRoot rolling up effect. + targetX = innerStore.nodeWidth / 2; + targetY = innerStore.nodeHeight / 2; + } + + target = storageName === 'nodeGroup' ? { + x: targetX, + y: targetY, + style: { + opacity: 0 + } + } : { + shape: { + x: targetX, + y: targetY, + width: 0, + height: 0 + }, + style: { + opacity: 0 + } + }; + } // TODO: do not support delay until necessary. - TreemapView.prototype._doAnimation = function (containerGroup, renderResult, seriesModel, reRoot) { - var durationOption = seriesModel.get('animationDurationUpdate'); - var easingOption = seriesModel.get('animationEasing'); // TODO: do not support function until necessary. - var duration = (isFunction(durationOption) ? 0 : durationOption) || 0; - var easing = (isFunction(easingOption) ? null : easingOption) || 'cubicOut'; - var animationWrap = createWrap(); // Make delete animations. + target && animationWrap.add(el, target, duration, 0, easing); + }); + }); // Make other animations - each(renderResult.willDeleteEls, function (store, storageName) { - each(store, function (el, rawIndex) { - if (el.invisible) { - return; - } + each(this._storage, function (store, storageName) { + each(store, function (el, rawIndex) { + var last = renderResult.lastsForAnimation[storageName][rawIndex]; + var target = {}; - var parent = el.parent; // Always has parent, and parent is nodeGroup. - - var target; - var innerStore = inner$8(parent); - - if (reRoot && reRoot.direction === 'drillDown') { - target = parent === reRoot.rootNodeGroup // This is the content element of view root. - // Only `content` will enter this branch, because - // `background` and `nodeGroup` will not be deleted. - ? { - shape: { - x: 0, - y: 0, - width: innerStore.nodeWidth, - height: innerStore.nodeHeight - }, - style: { - opacity: 0 - } - } // Others. - : { - style: { - opacity: 0 - } - }; - } else { - var targetX = 0; - var targetY = 0; - - if (!innerStore.willDelete) { - // Let node animate to right-bottom corner, cooperating with fadeout, - // which is appropriate for user understanding. - // Divided by 2 for reRoot rolling up effect. - targetX = innerStore.nodeWidth / 2; - targetY = innerStore.nodeHeight / 2; - } + if (!last) { + return; + } - target = storageName === 'nodeGroup' ? { - x: targetX, - y: targetY, - style: { - opacity: 0 - } - } : { - shape: { - x: targetX, - y: targetY, - width: 0, - height: 0 - }, - style: { - opacity: 0 - } - }; - } // TODO: do not support delay until necessary. + if (el instanceof Group) { + if (last.oldX != null) { + target.x = el.x; + target.y = el.y; + el.x = last.oldX; + el.y = last.oldY; + } + } else { + if (last.oldShape) { + target.shape = extend({}, el.shape); + el.setShape(last.oldShape); + } + + if (last.fadein) { + el.setStyle('opacity', 0); + target.style = { + opacity: 1 + }; + } // When animation is stopped for succedent animation starting, + // el.style.opacity might not be 1 + else if (el.style.opacity !== 1) { + target.style = { + opacity: 1 + }; + } + } + animationWrap.add(el, target, duration, 0, easing); + }); + }, this); + this._state = 'animating'; + animationWrap.finished(bind(function () { + this._state = 'ready'; + renderResult.renderFinally(); + }, this)).start(); + }; + + TreemapView.prototype._resetController = function (api) { + var controller = this._controller; // Init controller. + + if (!controller) { + controller = this._controller = new RoamController(api.getZr()); + controller.enable(this.seriesModel.get('roam')); + controller.on('pan', bind(this._onPan, this)); + controller.on('zoom', bind(this._onZoom, this)); + } + + var rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight()); + controller.setPointerChecker(function (e, x, y) { + return rect.contain(x, y); + }); + }; - target && animationWrap.add(el, target, duration, 0, easing); - }); - }); // Make other animations - - each(this._storage, function (store, storageName) { - each(store, function (el, rawIndex) { - var last = renderResult.lastsForAnimation[storageName][rawIndex]; - var target = {}; - - if (!last) { - return; - } - - if (el instanceof Group) { - if (last.oldX != null) { - target.x = el.x; - target.y = el.y; - el.x = last.oldX; - el.y = last.oldY; - } - } else { - if (last.oldShape) { - target.shape = extend({}, el.shape); - el.setShape(last.oldShape); - } - - if (last.fadein) { - el.setStyle('opacity', 0); - target.style = { - opacity: 1 - }; - } // When animation is stopped for succedent animation starting, - // el.style.opacity might not be 1 - else if (el.style.opacity !== 1) { - target.style = { - opacity: 1 - }; - } - } - - animationWrap.add(el, target, duration, 0, easing); - }); - }, this); - this._state = 'animating'; - animationWrap.finished(bind(function () { - this._state = 'ready'; - renderResult.renderFinally(); - }, this)).start(); - }; - - TreemapView.prototype._resetController = function (api) { - var controller = this._controller; // Init controller. - - if (!controller) { - controller = this._controller = new RoamController(api.getZr()); - controller.enable(this.seriesModel.get('roam')); - controller.on('pan', bind(this._onPan, this)); - controller.on('zoom', bind(this._onZoom, this)); - } - - var rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight()); - controller.setPointerChecker(function (e, x, y) { - return rect.contain(x, y); - }); - }; - - TreemapView.prototype._clearController = function () { - var controller = this._controller; - - if (controller) { - controller.dispose(); - controller = null; - } - }; - - TreemapView.prototype._onPan = function (e) { - if (this._state !== 'animating' && (Math.abs(e.dx) > DRAG_THRESHOLD || Math.abs(e.dy) > DRAG_THRESHOLD)) { - // These param must not be cached. - var root = this.seriesModel.getData().tree.root; - - if (!root) { - return; - } - - var rootLayout = root.getLayout(); - - if (!rootLayout) { - return; - } - - this.api.dispatchAction({ - type: 'treemapMove', - from: this.uid, - seriesId: this.seriesModel.id, - rootRect: { - x: rootLayout.x + e.dx, - y: rootLayout.y + e.dy, - width: rootLayout.width, - height: rootLayout.height - } - }); - } - }; - - TreemapView.prototype._onZoom = function (e) { - var mouseX = e.originX; - var mouseY = e.originY; - - if (this._state !== 'animating') { - // These param must not be cached. - var root = this.seriesModel.getData().tree.root; + TreemapView.prototype._clearController = function () { + var controller = this._controller; - if (!root) { - return; - } + if (controller) { + controller.dispose(); + controller = null; + } + }; - var rootLayout = root.getLayout(); + TreemapView.prototype._onPan = function (e) { + if (this._state !== 'animating' && (Math.abs(e.dx) > DRAG_THRESHOLD || Math.abs(e.dy) > DRAG_THRESHOLD)) { + // These param must not be cached. + var root = this.seriesModel.getData().tree.root; - if (!rootLayout) { - return; - } + if (!root) { + return; + } - var rect = new BoundingRect(rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height); - var layoutInfo = this.seriesModel.layoutInfo; // Transform mouse coord from global to containerGroup. - - mouseX -= layoutInfo.x; - mouseY -= layoutInfo.y; // Scale root bounding rect. - - var m = create$1(); - translate(m, m, [-mouseX, -mouseY]); - scale$1(m, m, [e.scale, e.scale]); - translate(m, m, [mouseX, mouseY]); - rect.applyTransform(m); - this.api.dispatchAction({ - type: 'treemapRender', - from: this.uid, - seriesId: this.seriesModel.id, - rootRect: { - x: rect.x, - y: rect.y, - width: rect.width, - height: rect.height - } - }); - } - }; + var rootLayout = root.getLayout(); - TreemapView.prototype._initEvents = function (containerGroup) { - var _this = this; + if (!rootLayout) { + return; + } - containerGroup.on('click', function (e) { - if (_this._state !== 'ready') { - return; - } + this.api.dispatchAction({ + type: 'treemapMove', + from: this.uid, + seriesId: this.seriesModel.id, + rootRect: { + x: rootLayout.x + e.dx, + y: rootLayout.y + e.dy, + width: rootLayout.width, + height: rootLayout.height + } + }); + } + }; - var nodeClick = _this.seriesModel.get('nodeClick', true); + TreemapView.prototype._onZoom = function (e) { + var mouseX = e.originX; + var mouseY = e.originY; - if (!nodeClick) { - return; - } + if (this._state !== 'animating') { + // These param must not be cached. + var root = this.seriesModel.getData().tree.root; - var targetInfo = _this.findTarget(e.offsetX, e.offsetY); + if (!root) { + return; + } - if (!targetInfo) { - return; - } + var rootLayout = root.getLayout(); - var node = targetInfo.node; + if (!rootLayout) { + return; + } + + var rect = new BoundingRect(rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height); + var layoutInfo = this.seriesModel.layoutInfo; // Transform mouse coord from global to containerGroup. + + mouseX -= layoutInfo.x; + mouseY -= layoutInfo.y; // Scale root bounding rect. + + var m = create$1(); + translate(m, m, [-mouseX, -mouseY]); + scale$1(m, m, [e.scale, e.scale]); + translate(m, m, [mouseX, mouseY]); + rect.applyTransform(m); + this.api.dispatchAction({ + type: 'treemapRender', + from: this.uid, + seriesId: this.seriesModel.id, + rootRect: { + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height + } + }); + } + }; + + TreemapView.prototype._initEvents = function (containerGroup) { + var _this = this; + + containerGroup.on('click', function (e) { + if (_this._state !== 'ready') { + return; + } - if (node.getLayout().isLeafRoot) { - _this._rootToNode(targetInfo); - } else { - if (nodeClick === 'zoomToNode') { - _this._zoomToNode(targetInfo); - } else if (nodeClick === 'link') { - var itemModel = node.hostTree.data.getItemModel(node.dataIndex); - var link = itemModel.get('link', true); - var linkTarget = itemModel.get('target', true) || 'blank'; - link && windowOpen(link, linkTarget); - } - } - }, this); - }; + var nodeClick = _this.seriesModel.get('nodeClick', true); - TreemapView.prototype._renderBreadcrumb = function (seriesModel, api, targetInfo) { - var _this = this; + if (!nodeClick) { + return; + } - if (!targetInfo) { - targetInfo = seriesModel.get('leafDepth', true) != null ? { - node: seriesModel.getViewRoot() - } // FIXME - // better way? - // Find breadcrumb tail on center of containerGroup. - : this.findTarget(api.getWidth() / 2, api.getHeight() / 2); + var targetInfo = _this.findTarget(e.offsetX, e.offsetY); - if (!targetInfo) { - targetInfo = { - node: seriesModel.getData().tree.root - }; - } - } + if (!targetInfo) { + return; + } + + var node = targetInfo.node; + + if (node.getLayout().isLeafRoot) { + _this._rootToNode(targetInfo); + } else { + if (nodeClick === 'zoomToNode') { + _this._zoomToNode(targetInfo); + } else if (nodeClick === 'link') { + var itemModel = node.hostTree.data.getItemModel(node.dataIndex); + var link = itemModel.get('link', true); + var linkTarget = itemModel.get('target', true) || 'blank'; + link && windowOpen(link, linkTarget); + } + } + }, this); + }; - (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group))).render(seriesModel, api, targetInfo.node, function (node) { - if (_this._state !== 'animating') { - aboveViewRoot(seriesModel.getViewRoot(), node) ? _this._rootToNode({ - node: node - }) : _this._zoomToNode({ - node: node - }); - } - }); - }; - /** - * @override - */ + TreemapView.prototype._renderBreadcrumb = function (seriesModel, api, targetInfo) { + var _this = this; + if (!targetInfo) { + targetInfo = seriesModel.get('leafDepth', true) != null ? { + node: seriesModel.getViewRoot() + } // FIXME + // better way? + // Find breadcrumb tail on center of containerGroup. + : this.findTarget(api.getWidth() / 2, api.getHeight() / 2); + + if (!targetInfo) { + targetInfo = { + node: seriesModel.getData().tree.root + }; + } + } + + (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group))).render(seriesModel, api, targetInfo.node, function (node) { + if (_this._state !== 'animating') { + aboveViewRoot(seriesModel.getViewRoot(), node) ? _this._rootToNode({ + node: node + }) : _this._zoomToNode({ + node: node + }); + } + }); + }; + /** + * @override + */ - TreemapView.prototype.remove = function () { - this._clearController(); - this._containerGroup && this._containerGroup.removeAll(); - this._storage = createStorage(); - this._state = 'ready'; - this._breadcrumb && this._breadcrumb.remove(); - }; + TreemapView.prototype.remove = function () { + this._clearController(); - TreemapView.prototype.dispose = function () { - this._clearController(); - }; + this._containerGroup && this._containerGroup.removeAll(); + this._storage = createStorage(); + this._state = 'ready'; + this._breadcrumb && this._breadcrumb.remove(); + }; - TreemapView.prototype._zoomToNode = function (targetInfo) { - this.api.dispatchAction({ - type: 'treemapZoomToNode', - from: this.uid, - seriesId: this.seriesModel.id, - targetNode: targetInfo.node - }); - }; + TreemapView.prototype.dispose = function () { + this._clearController(); + }; - TreemapView.prototype._rootToNode = function (targetInfo) { - this.api.dispatchAction({ - type: 'treemapRootToNode', - from: this.uid, - seriesId: this.seriesModel.id, - targetNode: targetInfo.node - }); - }; - /** - * @public - * @param {number} x Global coord x. - * @param {number} y Global coord y. - * @return {Object} info If not found, return undefined; - * @return {number} info.node Target node. - * @return {number} info.offsetX x refer to target node. - * @return {number} info.offsetY y refer to target node. - */ + TreemapView.prototype._zoomToNode = function (targetInfo) { + this.api.dispatchAction({ + type: 'treemapZoomToNode', + from: this.uid, + seriesId: this.seriesModel.id, + targetNode: targetInfo.node + }); + }; + + TreemapView.prototype._rootToNode = function (targetInfo) { + this.api.dispatchAction({ + type: 'treemapRootToNode', + from: this.uid, + seriesId: this.seriesModel.id, + targetNode: targetInfo.node + }); + }; + /** + * @public + * @param {number} x Global coord x. + * @param {number} y Global coord y. + * @return {Object} info If not found, return undefined; + * @return {number} info.node Target node. + * @return {number} info.offsetX x refer to target node. + * @return {number} info.offsetY y refer to target node. + */ - TreemapView.prototype.findTarget = function (x, y) { - var targetInfo; - var viewRoot = this.seriesModel.getViewRoot(); - viewRoot.eachNode({ - attr: 'viewChildren', - order: 'preorder' - }, function (node) { - var bgEl = this._storage.background[node.getRawIndex()]; // If invisible, there might be no element. + TreemapView.prototype.findTarget = function (x, y) { + var targetInfo; + var viewRoot = this.seriesModel.getViewRoot(); + viewRoot.eachNode({ + attr: 'viewChildren', + order: 'preorder' + }, function (node) { + var bgEl = this._storage.background[node.getRawIndex()]; // If invisible, there might be no element. - if (bgEl) { - var point = bgEl.transformCoordToLocal(x, y); - var shape = bgEl.shape; // For performance consideration, dont use 'getBoundingRect'. + if (bgEl) { + var point = bgEl.transformCoordToLocal(x, y); + var shape = bgEl.shape; // For performance consideration, dont use 'getBoundingRect'. - if (shape.x <= point[0] && point[0] <= shape.x + shape.width && shape.y <= point[1] && point[1] <= shape.y + shape.height) { - targetInfo = { - node: node, - offsetX: point[0], - offsetY: point[1] - }; - } else { - return false; // Suppress visit subtree. - } - } - }, this); - return targetInfo; - }; + if (shape.x <= point[0] && point[0] <= shape.x + shape.width && shape.y <= point[1] && point[1] <= shape.y + shape.height) { + targetInfo = { + node: node, + offsetX: point[0], + offsetY: point[1] + }; + } else { + return false; // Suppress visit subtree. + } + } + }, this); + return targetInfo; + }; - TreemapView.type = 'treemap'; - return TreemapView; - }(ChartView); + TreemapView.type = 'treemap'; + return TreemapView; + }(ChartView); /** * @inner */ function createStorage() { - return { - nodeGroup: [], - background: [], - content: [] - }; + return { + nodeGroup: [], + background: [], + content: [] + }; } /** * @inner @@ -57251,335 +57251,335 @@ function renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth) { - // Whether under viewRoot. - if (!thisNode) { - // Deleting nodes will be performed finally. This method just find - // element from old storage, or create new element, set them to new - // storage, and set styles. - return; - } // ------------------------------------------------------------------- - // Start of closure variables available in "Procedures in renderNode". - + // Whether under viewRoot. + if (!thisNode) { + // Deleting nodes will be performed finally. This method just find + // element from old storage, or create new element, set them to new + // storage, and set styles. + return; + } // ------------------------------------------------------------------- + // Start of closure variables available in "Procedures in renderNode". - var thisLayout = thisNode.getLayout(); - var data = seriesModel.getData(); - var nodeModel = thisNode.getModel(); // Only for enabling highlight/downplay. Clear firstly. - // Because some node will not be rendered. - data.setItemGraphicEl(thisNode.dataIndex, null); + var thisLayout = thisNode.getLayout(); + var data = seriesModel.getData(); + var nodeModel = thisNode.getModel(); // Only for enabling highlight/downplay. Clear firstly. + // Because some node will not be rendered. - if (!thisLayout || !thisLayout.isInView) { - return; - } + data.setItemGraphicEl(thisNode.dataIndex, null); - var thisWidth = thisLayout.width; - var thisHeight = thisLayout.height; - var borderWidth = thisLayout.borderWidth; - var thisInvisible = thisLayout.invisible; - var thisRawIndex = thisNode.getRawIndex(); - var oldRawIndex = oldNode && oldNode.getRawIndex(); - var thisViewChildren = thisNode.viewChildren; - var upperHeight = thisLayout.upperHeight; - var isParent = thisViewChildren && thisViewChildren.length; - var itemStyleNormalModel = nodeModel.getModel('itemStyle'); - var itemStyleEmphasisModel = nodeModel.getModel(['emphasis', 'itemStyle']); - var itemStyleBlurModel = nodeModel.getModel(['blur', 'itemStyle']); - var itemStyleSelectModel = nodeModel.getModel(['select', 'itemStyle']); - var borderRadius = itemStyleNormalModel.get('borderRadius') || 0; // End of closure ariables available in "Procedures in renderNode". - // ----------------------------------------------------------------- - // Node group - - var group = giveGraphic('nodeGroup', Group$1); + if (!thisLayout || !thisLayout.isInView) { + return; + } + + var thisWidth = thisLayout.width; + var thisHeight = thisLayout.height; + var borderWidth = thisLayout.borderWidth; + var thisInvisible = thisLayout.invisible; + var thisRawIndex = thisNode.getRawIndex(); + var oldRawIndex = oldNode && oldNode.getRawIndex(); + var thisViewChildren = thisNode.viewChildren; + var upperHeight = thisLayout.upperHeight; + var isParent = thisViewChildren && thisViewChildren.length; + var itemStyleNormalModel = nodeModel.getModel('itemStyle'); + var itemStyleEmphasisModel = nodeModel.getModel(['emphasis', 'itemStyle']); + var itemStyleBlurModel = nodeModel.getModel(['blur', 'itemStyle']); + var itemStyleSelectModel = nodeModel.getModel(['select', 'itemStyle']); + var borderRadius = itemStyleNormalModel.get('borderRadius') || 0; // End of closure ariables available in "Procedures in renderNode". + // ----------------------------------------------------------------- + // Node group + + var group = giveGraphic('nodeGroup', Group$1); + + if (!group) { + return; + } - if (!group) { - return; - } + parentGroup.add(group); // x,y are not set when el is above view root. - parentGroup.add(group); // x,y are not set when el is above view root. + group.x = thisLayout.x || 0; + group.y = thisLayout.y || 0; + group.markRedraw(); + inner$8(group).nodeWidth = thisWidth; + inner$8(group).nodeHeight = thisHeight; - group.x = thisLayout.x || 0; - group.y = thisLayout.y || 0; - group.markRedraw(); - inner$8(group).nodeWidth = thisWidth; - inner$8(group).nodeHeight = thisHeight; + if (thisLayout.isAboveViewRoot) { + return group; + } // Background - if (thisLayout.isAboveViewRoot) { - return group; - } // Background + var bg = giveGraphic('background', Rect$1, depth, Z2_BG); + bg && renderBackground(group, bg, isParent && thisLayout.upperLabelHeight); + var emphasisModel = nodeModel.getModel('emphasis'); + var focus = emphasisModel.get('focus'); + var blurScope = emphasisModel.get('blurScope'); + var isDisabled = emphasisModel.get('disabled'); + var focusOrIndices = focus === 'ancestor' ? thisNode.getAncestorsIndices() : focus === 'descendant' ? thisNode.getDescendantIndices() : focus; // No children, render content. - var bg = giveGraphic('background', Rect$1, depth, Z2_BG); - bg && renderBackground(group, bg, isParent && thisLayout.upperLabelHeight); - var emphasisModel = nodeModel.getModel('emphasis'); - var focus = emphasisModel.get('focus'); - var blurScope = emphasisModel.get('blurScope'); - var isDisabled = emphasisModel.get('disabled'); - var focusOrIndices = focus === 'ancestor' ? thisNode.getAncestorsIndices() : focus === 'descendant' ? thisNode.getDescendantIndices() : focus; // No children, render content. + if (isParent) { + // Because of the implementation about "traverse" in graphic hover style, we + // can not set hover listener on the "group" of non-leaf node. Otherwise the + // hover event from the descendents will be listenered. + if (isHighDownDispatcher(group)) { + setAsHighDownDispatcher(group, false); + } - if (isParent) { - // Because of the implementation about "traverse" in graphic hover style, we - // can not set hover listener on the "group" of non-leaf node. Otherwise the - // hover event from the descendents will be listenered. - if (isHighDownDispatcher(group)) { - setAsHighDownDispatcher(group, false); - } + if (bg) { + setAsHighDownDispatcher(bg, !isDisabled); // Only for enabling highlight/downplay. - if (bg) { - setAsHighDownDispatcher(bg, !isDisabled); // Only for enabling highlight/downplay. + data.setItemGraphicEl(thisNode.dataIndex, bg); + enableHoverFocus(bg, focusOrIndices, blurScope); + } + } else { + var content = giveGraphic('content', Rect$1, depth, Z2_CONTENT); + content && renderContent(group, content); + bg.disableMorphing = true; - data.setItemGraphicEl(thisNode.dataIndex, bg); - enableHoverFocus(bg, focusOrIndices, blurScope); - } - } else { - var content = giveGraphic('content', Rect$1, depth, Z2_CONTENT); - content && renderContent(group, content); - bg.disableMorphing = true; + if (bg && isHighDownDispatcher(bg)) { + setAsHighDownDispatcher(bg, false); + } - if (bg && isHighDownDispatcher(bg)) { - setAsHighDownDispatcher(bg, false); - } + setAsHighDownDispatcher(group, !isDisabled); // Only for enabling highlight/downplay. - setAsHighDownDispatcher(group, !isDisabled); // Only for enabling highlight/downplay. + data.setItemGraphicEl(thisNode.dataIndex, group); + enableHoverFocus(group, focusOrIndices, blurScope); + } - data.setItemGraphicEl(thisNode.dataIndex, group); - enableHoverFocus(group, focusOrIndices, blurScope); - } + return group; // ---------------------------- + // | Procedures in renderNode | + // ---------------------------- - return group; // ---------------------------- - // | Procedures in renderNode | - // ---------------------------- + function renderBackground(group, bg, useUpperLabel) { + var ecData = getECData(bg); // For tooltip. - function renderBackground(group, bg, useUpperLabel) { - var ecData = getECData(bg); // For tooltip. + ecData.dataIndex = thisNode.dataIndex; + ecData.seriesIndex = seriesModel.seriesIndex; + bg.setShape({ + x: 0, + y: 0, + width: thisWidth, + height: thisHeight, + r: borderRadius + }); - ecData.dataIndex = thisNode.dataIndex; - ecData.seriesIndex = seriesModel.seriesIndex; - bg.setShape({ - x: 0, - y: 0, - width: thisWidth, - height: thisHeight, - r: borderRadius + if (thisInvisible) { + // If invisible, do not set visual, otherwise the element will + // change immediately before animation. We think it is OK to + // remain its origin color when moving out of the view window. + processInvisible(bg); + } else { + bg.invisible = false; + var style = thisNode.getVisual('style'); + var visualBorderColor = style.stroke; + var normalStyle = getItemStyleNormal(itemStyleNormalModel); + normalStyle.fill = visualBorderColor; + var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel); + emphasisStyle.fill = itemStyleEmphasisModel.get('borderColor'); + var blurStyle = getStateItemStyle(itemStyleBlurModel); + blurStyle.fill = itemStyleBlurModel.get('borderColor'); + var selectStyle = getStateItemStyle(itemStyleSelectModel); + selectStyle.fill = itemStyleSelectModel.get('borderColor'); + + if (useUpperLabel) { + var upperLabelWidth = thisWidth - 2 * borderWidth; + prepareText( // PENDING: convert ZRColor to ColorString for text. + bg, visualBorderColor, style.opacity, { + x: borderWidth, + y: 0, + width: upperLabelWidth, + height: upperHeight }); + } // For old bg. + else { + bg.removeTextContent(); + } + + bg.setStyle(normalStyle); + bg.ensureState('emphasis').style = emphasisStyle; + bg.ensureState('blur').style = blurStyle; + bg.ensureState('select').style = selectStyle; + setDefaultStateProxy(bg); + } + + group.add(bg); + } + + function renderContent(group, content) { + var ecData = getECData(content); // For tooltip. + + ecData.dataIndex = thisNode.dataIndex; + ecData.seriesIndex = seriesModel.seriesIndex; + var contentWidth = Math.max(thisWidth - 2 * borderWidth, 0); + var contentHeight = Math.max(thisHeight - 2 * borderWidth, 0); + content.culling = true; + content.setShape({ + x: borderWidth, + y: borderWidth, + width: contentWidth, + height: contentHeight, + r: borderRadius + }); - if (thisInvisible) { - // If invisible, do not set visual, otherwise the element will - // change immediately before animation. We think it is OK to - // remain its origin color when moving out of the view window. - processInvisible(bg); - } else { - bg.invisible = false; - var style = thisNode.getVisual('style'); - var visualBorderColor = style.stroke; - var normalStyle = getItemStyleNormal(itemStyleNormalModel); - normalStyle.fill = visualBorderColor; - var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel); - emphasisStyle.fill = itemStyleEmphasisModel.get('borderColor'); - var blurStyle = getStateItemStyle(itemStyleBlurModel); - blurStyle.fill = itemStyleBlurModel.get('borderColor'); - var selectStyle = getStateItemStyle(itemStyleSelectModel); - selectStyle.fill = itemStyleSelectModel.get('borderColor'); - - if (useUpperLabel) { - var upperLabelWidth = thisWidth - 2 * borderWidth; - prepareText( // PENDING: convert ZRColor to ColorString for text. - bg, visualBorderColor, style.opacity, { - x: borderWidth, - y: 0, - width: upperLabelWidth, - height: upperHeight - }); - } // For old bg. - else { - bg.removeTextContent(); - } - - bg.setStyle(normalStyle); - bg.ensureState('emphasis').style = emphasisStyle; - bg.ensureState('blur').style = blurStyle; - bg.ensureState('select').style = selectStyle; - setDefaultStateProxy(bg); - } + if (thisInvisible) { + // If invisible, do not set visual, otherwise the element will + // change immediately before animation. We think it is OK to + // remain its origin color when moving out of the view window. + processInvisible(content); + } else { + content.invisible = false; + var nodeStyle = thisNode.getVisual('style'); + var visualColor = nodeStyle.fill; + var normalStyle = getItemStyleNormal(itemStyleNormalModel); + normalStyle.fill = visualColor; + normalStyle.decal = nodeStyle.decal; + var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel); + var blurStyle = getStateItemStyle(itemStyleBlurModel); + var selectStyle = getStateItemStyle(itemStyleSelectModel); // PENDING: convert ZRColor to ColorString for text. + + prepareText(content, visualColor, nodeStyle.opacity, null); + content.setStyle(normalStyle); + content.ensureState('emphasis').style = emphasisStyle; + content.ensureState('blur').style = blurStyle; + content.ensureState('select').style = selectStyle; + setDefaultStateProxy(content); + } + + group.add(content); + } + + function processInvisible(element) { + // Delay invisible setting utill animation finished, + // avoid element vanish suddenly before animation. + !element.invisible && willInvisibleEls.push(element); + } + + function prepareText(rectEl, visualColor, visualOpacity, // Can be null/undefined + upperLabelRect) { + var normalLabelModel = nodeModel.getModel(upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL); + var defaultText = convertOptionIdName(nodeModel.get('name'), null); + var isShow = normalLabelModel.getShallow('show'); + setLabelStyle(rectEl, getLabelStatesModels(nodeModel, upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL), { + defaultText: isShow ? defaultText : null, + inheritColor: visualColor, + defaultOpacity: visualOpacity, + labelFetcher: seriesModel, + labelDataIndex: thisNode.dataIndex + }); + var textEl = rectEl.getTextContent(); - group.add(bg); + if (!textEl) { + return; } - function renderContent(group, content) { - var ecData = getECData(content); // For tooltip. - - ecData.dataIndex = thisNode.dataIndex; - ecData.seriesIndex = seriesModel.seriesIndex; - var contentWidth = Math.max(thisWidth - 2 * borderWidth, 0); - var contentHeight = Math.max(thisHeight - 2 * borderWidth, 0); - content.culling = true; - content.setShape({ - x: borderWidth, - y: borderWidth, - width: contentWidth, - height: contentHeight, - r: borderRadius - }); - - if (thisInvisible) { - // If invisible, do not set visual, otherwise the element will - // change immediately before animation. We think it is OK to - // remain its origin color when moving out of the view window. - processInvisible(content); - } else { - content.invisible = false; - var nodeStyle = thisNode.getVisual('style'); - var visualColor = nodeStyle.fill; - var normalStyle = getItemStyleNormal(itemStyleNormalModel); - normalStyle.fill = visualColor; - normalStyle.decal = nodeStyle.decal; - var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel); - var blurStyle = getStateItemStyle(itemStyleBlurModel); - var selectStyle = getStateItemStyle(itemStyleSelectModel); // PENDING: convert ZRColor to ColorString for text. - - prepareText(content, visualColor, nodeStyle.opacity, null); - content.setStyle(normalStyle); - content.ensureState('emphasis').style = emphasisStyle; - content.ensureState('blur').style = blurStyle; - content.ensureState('select').style = selectStyle; - setDefaultStateProxy(content); - } - - group.add(content); - } - - function processInvisible(element) { - // Delay invisible setting utill animation finished, - // avoid element vanish suddenly before animation. - !element.invisible && willInvisibleEls.push(element); - } - - function prepareText(rectEl, visualColor, visualOpacity, // Can be null/undefined - upperLabelRect) { - var normalLabelModel = nodeModel.getModel(upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL); - var defaultText = convertOptionIdName(nodeModel.get('name'), null); - var isShow = normalLabelModel.getShallow('show'); - setLabelStyle(rectEl, getLabelStatesModels(nodeModel, upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL), { - defaultText: isShow ? defaultText : null, - inheritColor: visualColor, - defaultOpacity: visualOpacity, - labelFetcher: seriesModel, - labelDataIndex: thisNode.dataIndex - }); - var textEl = rectEl.getTextContent(); + var textStyle = textEl.style; + var textPadding = normalizeCssArray(textStyle.padding || 0); - if (!textEl) { - return; - } + if (upperLabelRect) { + rectEl.setTextConfig({ + layoutRect: upperLabelRect + }); + textEl.disableLabelLayout = true; + } - var textStyle = textEl.style; - var textPadding = normalizeCssArray(textStyle.padding || 0); + textEl.beforeUpdate = function () { + var width = Math.max((upperLabelRect ? upperLabelRect.width : rectEl.shape.width) - textPadding[1] - textPadding[3], 0); + var height = Math.max((upperLabelRect ? upperLabelRect.height : rectEl.shape.height) - textPadding[0] - textPadding[2], 0); - if (upperLabelRect) { - rectEl.setTextConfig({ - layoutRect: upperLabelRect - }); - textEl.disableLabelLayout = true; - } + if (textStyle.width !== width || textStyle.height !== height) { + textEl.setStyle({ + width: width, + height: height + }); + } + }; - textEl.beforeUpdate = function () { - var width = Math.max((upperLabelRect ? upperLabelRect.width : rectEl.shape.width) - textPadding[1] - textPadding[3], 0); - var height = Math.max((upperLabelRect ? upperLabelRect.height : rectEl.shape.height) - textPadding[0] - textPadding[2], 0); + textStyle.truncateMinChar = 2; + textStyle.lineOverflow = 'truncate'; + addDrillDownIcon(textStyle, upperLabelRect, thisLayout); + var textEmphasisState = textEl.getState('emphasis'); + addDrillDownIcon(textEmphasisState ? textEmphasisState.style : null, upperLabelRect, thisLayout); + } - if (textStyle.width !== width || textStyle.height !== height) { - textEl.setStyle({ - width: width, - height: height - }); - } - }; + function addDrillDownIcon(style, upperLabelRect, thisLayout) { + var text = style ? style.text : null; - textStyle.truncateMinChar = 2; - textStyle.lineOverflow = 'truncate'; - addDrillDownIcon(textStyle, upperLabelRect, thisLayout); - var textEmphasisState = textEl.getState('emphasis'); - addDrillDownIcon(textEmphasisState ? textEmphasisState.style : null, upperLabelRect, thisLayout); + if (!upperLabelRect && thisLayout.isLeafRoot && text != null) { + var iconChar = seriesModel.get('drillDownIcon', true); + style.text = iconChar ? iconChar + ' ' + text : text; } + } - function addDrillDownIcon(style, upperLabelRect, thisLayout) { - var text = style ? style.text : null; + function giveGraphic(storageName, Ctor, depth, z) { + var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex]; + var lasts = lastsForAnimation[storageName]; - if (!upperLabelRect && thisLayout.isLeafRoot && text != null) { - var iconChar = seriesModel.get('drillDownIcon', true); - style.text = iconChar ? iconChar + ' ' + text : text; - } - } + if (element) { + // Remove from oldStorage + oldStorage[storageName][oldRawIndex] = null; + prepareAnimationWhenHasOld(lasts, element); + } // If invisible and no old element, do not create new element (for optimizing). + else if (!thisInvisible) { + element = new Ctor(); - function giveGraphic(storageName, Ctor, depth, z) { - var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex]; - var lasts = lastsForAnimation[storageName]; + if (element instanceof Displayable) { + element.z2 = calculateZ2(depth, z); + } - if (element) { - // Remove from oldStorage - oldStorage[storageName][oldRawIndex] = null; - prepareAnimationWhenHasOld(lasts, element); - } // If invisible and no old element, do not create new element (for optimizing). - else if (!thisInvisible) { - element = new Ctor(); + prepareAnimationWhenNoOld(lasts, element); + } // Set to thisStorage - if (element instanceof Displayable) { - element.z2 = calculateZ2(depth, z); - } - prepareAnimationWhenNoOld(lasts, element); - } // Set to thisStorage + return thisStorage[storageName][thisRawIndex] = element; + } + function prepareAnimationWhenHasOld(lasts, element) { + var lastCfg = lasts[thisRawIndex] = {}; - return thisStorage[storageName][thisRawIndex] = element; + if (element instanceof Group$1) { + lastCfg.oldX = element.x; + lastCfg.oldY = element.y; + } else { + lastCfg.oldShape = extend({}, element.shape); } - - function prepareAnimationWhenHasOld(lasts, element) { - var lastCfg = lasts[thisRawIndex] = {}; - - if (element instanceof Group$1) { - lastCfg.oldX = element.x; - lastCfg.oldY = element.y; - } else { - lastCfg.oldShape = extend({}, element.shape); - } - } // If a element is new, we need to find the animation start point carefully, - // otherwise it will looks strange when 'zoomToNode'. + } // If a element is new, we need to find the animation start point carefully, + // otherwise it will looks strange when 'zoomToNode'. - function prepareAnimationWhenNoOld(lasts, element) { - var lastCfg = lasts[thisRawIndex] = {}; - var parentNode = thisNode.parentNode; - var isGroup = element instanceof Group; + function prepareAnimationWhenNoOld(lasts, element) { + var lastCfg = lasts[thisRawIndex] = {}; + var parentNode = thisNode.parentNode; + var isGroup = element instanceof Group; - if (parentNode && (!reRoot || reRoot.direction === 'drillDown')) { - var parentOldX = 0; - var parentOldY = 0; // New nodes appear from right-bottom corner in 'zoomToNode' animation. - // For convenience, get old bounding rect from background. + if (parentNode && (!reRoot || reRoot.direction === 'drillDown')) { + var parentOldX = 0; + var parentOldY = 0; // New nodes appear from right-bottom corner in 'zoomToNode' animation. + // For convenience, get old bounding rect from background. - var parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()]; + var parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()]; - if (!reRoot && parentOldBg && parentOldBg.oldShape) { - parentOldX = parentOldBg.oldShape.width; - parentOldY = parentOldBg.oldShape.height; - } // When no parent old shape found, its parent is new too, - // so we can just use {x:0, y:0}. + if (!reRoot && parentOldBg && parentOldBg.oldShape) { + parentOldX = parentOldBg.oldShape.width; + parentOldY = parentOldBg.oldShape.height; + } // When no parent old shape found, its parent is new too, + // so we can just use {x:0, y:0}. - if (isGroup) { - lastCfg.oldX = 0; - lastCfg.oldY = parentOldY; - } else { - lastCfg.oldShape = { - x: parentOldX, - y: parentOldY, - width: 0, - height: 0 - }; - } - } // Fade in, user can be aware that these nodes are new. + if (isGroup) { + lastCfg.oldX = 0; + lastCfg.oldY = parentOldY; + } else { + lastCfg.oldShape = { + x: parentOldX, + y: parentOldY, + width: 0, + height: 0 + }; + } + } // Fade in, user can be aware that these nodes are new. - lastCfg.fadein = !isGroup; - } + lastCfg.fadein = !isGroup; + } } // We can not set all backgroud with the same z, Because the behaviour of // drill down and roll up differ background creation sequence from tree // hierarchy sequence, which cause that lowser background element overlap @@ -57589,7 +57589,7 @@ function calculateZ2(depth, z2InLevel) { - return depth * Z2_BASE + z2InLevel; + return depth * Z2_BASE + z2InLevel; } var each$3 = each; @@ -57597,413 +57597,413 @@ var CATEGORY_DEFAULT_VISUAL_INDEX = -1; var VisualMapping = - /** @class */ - function () { - function VisualMapping(option) { - var mappingMethod = option.mappingMethod; - var visualType = option.type; - var thisOption = this.option = clone(option); - this.type = visualType; - this.mappingMethod = mappingMethod; - this._normalizeData = normalizers[mappingMethod]; - var visualHandler = VisualMapping.visualHandlers[visualType]; - this.applyVisual = visualHandler.applyVisual; - this.getColorMapper = visualHandler.getColorMapper; - this._normalizedToVisual = visualHandler._normalizedToVisual[mappingMethod]; - - if (mappingMethod === 'piecewise') { - normalizeVisualRange(thisOption); - preprocessForPiecewise(thisOption); - } else if (mappingMethod === 'category') { - thisOption.categories ? preprocessForSpecifiedCategory(thisOption) // categories is ordinal when thisOption.categories not specified, - // which need no more preprocess except normalize visual. - : normalizeVisualRange(thisOption, true); - } else { - // mappingMethod === 'linear' or 'fixed' - assert(mappingMethod !== 'linear' || thisOption.dataExtent); - normalizeVisualRange(thisOption); - } - } - - VisualMapping.prototype.mapValueToVisual = function (value) { - var normalized = this._normalizeData(value); - - return this._normalizedToVisual(normalized, value); - }; + /** @class */ + function () { + function VisualMapping(option) { + var mappingMethod = option.mappingMethod; + var visualType = option.type; + var thisOption = this.option = clone(option); + this.type = visualType; + this.mappingMethod = mappingMethod; + this._normalizeData = normalizers[mappingMethod]; + var visualHandler = VisualMapping.visualHandlers[visualType]; + this.applyVisual = visualHandler.applyVisual; + this.getColorMapper = visualHandler.getColorMapper; + this._normalizedToVisual = visualHandler._normalizedToVisual[mappingMethod]; + + if (mappingMethod === 'piecewise') { + normalizeVisualRange(thisOption); + preprocessForPiecewise(thisOption); + } else if (mappingMethod === 'category') { + thisOption.categories ? preprocessForSpecifiedCategory(thisOption) // categories is ordinal when thisOption.categories not specified, + // which need no more preprocess except normalize visual. + : normalizeVisualRange(thisOption, true); + } else { + // mappingMethod === 'linear' or 'fixed' + assert(mappingMethod !== 'linear' || thisOption.dataExtent); + normalizeVisualRange(thisOption); + } + } + + VisualMapping.prototype.mapValueToVisual = function (value) { + var normalized = this._normalizeData(value); + + return this._normalizedToVisual(normalized, value); + }; + + VisualMapping.prototype.getNormalizer = function () { + return bind(this._normalizeData, this); + }; + /** + * List available visual types. + * + * @public + * @return {Array.} + */ - VisualMapping.prototype.getNormalizer = function () { - return bind(this._normalizeData, this); - }; - /** - * List available visual types. - * - * @public - * @return {Array.} - */ + VisualMapping.listVisualTypes = function () { + return keys(VisualMapping.visualHandlers); + }; // /** + // * @public + // */ + // static addVisualHandler(name, handler) { + // visualHandlers[name] = handler; + // } - VisualMapping.listVisualTypes = function () { - return keys(VisualMapping.visualHandlers); - }; // /** - // * @public - // */ - // static addVisualHandler(name, handler) { - // visualHandlers[name] = handler; - // } + /** + * @public + */ - /** - * @public - */ + VisualMapping.isValidType = function (visualType) { + return VisualMapping.visualHandlers.hasOwnProperty(visualType); + }; + /** + * Convinent method. + * Visual can be Object or Array or primary type. + */ - VisualMapping.isValidType = function (visualType) { - return VisualMapping.visualHandlers.hasOwnProperty(visualType); - }; - /** - * Convinent method. - * Visual can be Object or Array or primary type. - */ + VisualMapping.eachVisual = function (visual, callback, context) { + if (isObject(visual)) { + each(visual, callback, context); + } else { + callback.call(context, visual); + } + }; - VisualMapping.eachVisual = function (visual, callback, context) { - if (isObject(visual)) { - each(visual, callback, context); - } else { - callback.call(context, visual); - } - }; + VisualMapping.mapVisual = function (visual, callback, context) { + var isPrimary; + var newVisual = isArray(visual) ? [] : isObject(visual) ? {} : (isPrimary = true, null); + VisualMapping.eachVisual(visual, function (v, key) { + var newVal = callback.call(context, v, key); + isPrimary ? newVisual = newVal : newVisual[key] = newVal; + }); + return newVisual; + }; + /** + * Retrieve visual properties from given object. + */ - VisualMapping.mapVisual = function (visual, callback, context) { - var isPrimary; - var newVisual = isArray(visual) ? [] : isObject(visual) ? {} : (isPrimary = true, null); - VisualMapping.eachVisual(visual, function (v, key) { - var newVal = callback.call(context, v, key); - isPrimary ? newVisual = newVal : newVisual[key] = newVal; - }); - return newVisual; - }; - /** - * Retrieve visual properties from given object. - */ + VisualMapping.retrieveVisuals = function (obj) { + var ret = {}; + var hasVisual; + obj && each$3(VisualMapping.visualHandlers, function (h, visualType) { + if (obj.hasOwnProperty(visualType)) { + ret[visualType] = obj[visualType]; + hasVisual = true; + } + }); + return hasVisual ? ret : null; + }; + /** + * Give order to visual types, considering colorSaturation, colorAlpha depends on color. + * + * @public + * @param {(Object|Array)} visualTypes If Object, like: {color: ..., colorSaturation: ...} + * IF Array, like: ['color', 'symbol', 'colorSaturation'] + * @return {Array.} Sorted visual types. + */ - VisualMapping.retrieveVisuals = function (obj) { - var ret = {}; - var hasVisual; - obj && each$3(VisualMapping.visualHandlers, function (h, visualType) { - if (obj.hasOwnProperty(visualType)) { - ret[visualType] = obj[visualType]; - hasVisual = true; - } - }); - return hasVisual ? ret : null; - }; - /** - * Give order to visual types, considering colorSaturation, colorAlpha depends on color. - * - * @public - * @param {(Object|Array)} visualTypes If Object, like: {color: ..., colorSaturation: ...} - * IF Array, like: ['color', 'symbol', 'colorSaturation'] - * @return {Array.} Sorted visual types. - */ + VisualMapping.prepareVisualTypes = function (visualTypes) { + if (isArray(visualTypes)) { + visualTypes = visualTypes.slice(); + } else if (isObject$3(visualTypes)) { + var types_1 = []; + each$3(visualTypes, function (item, type) { + types_1.push(type); + }); + visualTypes = types_1; + } else { + return []; + } - VisualMapping.prepareVisualTypes = function (visualTypes) { - if (isArray(visualTypes)) { - visualTypes = visualTypes.slice(); - } else if (isObject$3(visualTypes)) { - var types_1 = []; - each$3(visualTypes, function (item, type) { - types_1.push(type); - }); - visualTypes = types_1; - } else { - return []; - } + visualTypes.sort(function (type1, type2) { + // color should be front of colorSaturation, colorAlpha, ... + // symbol and symbolSize do not matter. + return type2 === 'color' && type1 !== 'color' && type1.indexOf('color') === 0 ? 1 : -1; + }); + return visualTypes; + }; + /** + * 'color', 'colorSaturation', 'colorAlpha', ... are depends on 'color'. + * Other visuals are only depends on themself. + */ - visualTypes.sort(function (type1, type2) { - // color should be front of colorSaturation, colorAlpha, ... - // symbol and symbolSize do not matter. - return type2 === 'color' && type1 !== 'color' && type1.indexOf('color') === 0 ? 1 : -1; - }); - return visualTypes; - }; - /** - * 'color', 'colorSaturation', 'colorAlpha', ... are depends on 'color'. - * Other visuals are only depends on themself. - */ + VisualMapping.dependsOn = function (visualType1, visualType2) { + return visualType2 === 'color' ? !!(visualType1 && visualType1.indexOf(visualType2) === 0) : visualType1 === visualType2; + }; + /** + * @param value + * @param pieceList [{value: ..., interval: [min, max]}, ...] + * Always from small to big. + * @param findClosestWhenOutside Default to be false + * @return index + */ - VisualMapping.dependsOn = function (visualType1, visualType2) { - return visualType2 === 'color' ? !!(visualType1 && visualType1.indexOf(visualType2) === 0) : visualType1 === visualType2; - }; - /** - * @param value - * @param pieceList [{value: ..., interval: [min, max]}, ...] - * Always from small to big. - * @param findClosestWhenOutside Default to be false - * @return index - */ + VisualMapping.findPieceIndex = function (value, pieceList, findClosestWhenOutside) { + var possibleI; + var abs = Infinity; // value has the higher priority. - VisualMapping.findPieceIndex = function (value, pieceList, findClosestWhenOutside) { - var possibleI; - var abs = Infinity; // value has the higher priority. + for (var i = 0, len = pieceList.length; i < len; i++) { + var pieceValue = pieceList[i].value; - for (var i = 0, len = pieceList.length; i < len; i++) { - var pieceValue = pieceList[i].value; + if (pieceValue != null) { + if (pieceValue === value // FIXME + // It is supposed to compare value according to value type of dimension, + // but currently value type can exactly be string or number. + // Compromise for numeric-like string (like '12'), especially + // in the case that visualMap.categories is ['22', '33']. + || isString(pieceValue) && pieceValue === value + '') { + return i; + } - if (pieceValue != null) { - if (pieceValue === value // FIXME - // It is supposed to compare value according to value type of dimension, - // but currently value type can exactly be string or number. - // Compromise for numeric-like string (like '12'), especially - // in the case that visualMap.categories is ['22', '33']. - || isString(pieceValue) && pieceValue === value + '') { - return i; - } + findClosestWhenOutside && updatePossible(pieceValue, i); + } + } - findClosestWhenOutside && updatePossible(pieceValue, i); - } - } + for (var i = 0, len = pieceList.length; i < len; i++) { + var piece = pieceList[i]; + var interval = piece.interval; + var close_1 = piece.close; - for (var i = 0, len = pieceList.length; i < len; i++) { - var piece = pieceList[i]; - var interval = piece.interval; - var close_1 = piece.close; + if (interval) { + if (interval[0] === -Infinity) { + if (littleThan(close_1[1], value, interval[1])) { + return i; + } + } else if (interval[1] === Infinity) { + if (littleThan(close_1[0], interval[0], value)) { + return i; + } + } else if (littleThan(close_1[0], interval[0], value) && littleThan(close_1[1], value, interval[1])) { + return i; + } - if (interval) { - if (interval[0] === -Infinity) { - if (littleThan(close_1[1], value, interval[1])) { - return i; - } - } else if (interval[1] === Infinity) { - if (littleThan(close_1[0], interval[0], value)) { - return i; - } - } else if (littleThan(close_1[0], interval[0], value) && littleThan(close_1[1], value, interval[1])) { - return i; - } + findClosestWhenOutside && updatePossible(interval[0], i); + findClosestWhenOutside && updatePossible(interval[1], i); + } + } - findClosestWhenOutside && updatePossible(interval[0], i); - findClosestWhenOutside && updatePossible(interval[1], i); - } - } + if (findClosestWhenOutside) { + return value === Infinity ? pieceList.length - 1 : value === -Infinity ? 0 : possibleI; + } - if (findClosestWhenOutside) { - return value === Infinity ? pieceList.length - 1 : value === -Infinity ? 0 : possibleI; - } + function updatePossible(val, index) { + var newAbs = Math.abs(val - value); - function updatePossible(val, index) { - var newAbs = Math.abs(val - value); + if (newAbs < abs) { + abs = newAbs; + possibleI = index; + } + } + }; - if (newAbs < abs) { - abs = newAbs; - possibleI = index; - } - } - }; + VisualMapping.visualHandlers = { + color: { + applyVisual: makeApplyVisual('color'), + getColorMapper: function () { + var thisOption = this.option; + return bind(thisOption.mappingMethod === 'category' ? function (value, isNormalized) { + !isNormalized && (value = this._normalizeData(value)); + return doMapCategory.call(this, value); + } : function (value, isNormalized, out) { + // If output rgb array + // which will be much faster and useful in pixel manipulation + var returnRGBArray = !!out; + !isNormalized && (value = this._normalizeData(value)); + out = fastLerp(value, thisOption.parsedVisual, out); + return returnRGBArray ? out : stringify(out, 'rgba'); + }, this); + }, + _normalizedToVisual: { + linear: function (normalized) { + return stringify(fastLerp(normalized, this.option.parsedVisual), 'rgba'); + }, + category: doMapCategory, + piecewise: function (normalized, value) { + var result = getSpecifiedVisual.call(this, value); - VisualMapping.visualHandlers = { - color: { - applyVisual: makeApplyVisual('color'), - getColorMapper: function () { - var thisOption = this.option; - return bind(thisOption.mappingMethod === 'category' ? function (value, isNormalized) { - !isNormalized && (value = this._normalizeData(value)); - return doMapCategory.call(this, value); - } : function (value, isNormalized, out) { - // If output rgb array - // which will be much faster and useful in pixel manipulation - var returnRGBArray = !!out; - !isNormalized && (value = this._normalizeData(value)); - out = fastLerp(value, thisOption.parsedVisual, out); - return returnRGBArray ? out : stringify(out, 'rgba'); - }, this); - }, - _normalizedToVisual: { - linear: function (normalized) { - return stringify(fastLerp(normalized, this.option.parsedVisual), 'rgba'); - }, - category: doMapCategory, - piecewise: function (normalized, value) { - var result = getSpecifiedVisual.call(this, value); + if (result == null) { + result = stringify(fastLerp(normalized, this.option.parsedVisual), 'rgba'); + } - if (result == null) { - result = stringify(fastLerp(normalized, this.option.parsedVisual), 'rgba'); - } + return result; + }, + fixed: doMapFixed + } + }, + colorHue: makePartialColorVisualHandler(function (color$1, value) { + return modifyHSL(color$1, value); + }), + colorSaturation: makePartialColorVisualHandler(function (color$1, value) { + return modifyHSL(color$1, null, value); + }), + colorLightness: makePartialColorVisualHandler(function (color$1, value) { + return modifyHSL(color$1, null, null, value); + }), + colorAlpha: makePartialColorVisualHandler(function (color$1, value) { + return modifyAlpha(color$1, value); + }), + decal: { + applyVisual: makeApplyVisual('decal'), + _normalizedToVisual: { + linear: null, + category: doMapCategory, + piecewise: null, + fixed: null + } + }, + opacity: { + applyVisual: makeApplyVisual('opacity'), + _normalizedToVisual: createNormalizedToNumericVisual([0, 1]) + }, + liftZ: { + applyVisual: makeApplyVisual('liftZ'), + _normalizedToVisual: { + linear: doMapFixed, + category: doMapFixed, + piecewise: doMapFixed, + fixed: doMapFixed + } + }, + symbol: { + applyVisual: function (value, getter, setter) { + var symbolCfg = this.mapValueToVisual(value); + setter('symbol', symbolCfg); + }, + _normalizedToVisual: { + linear: doMapToArray, + category: doMapCategory, + piecewise: function (normalized, value) { + var result = getSpecifiedVisual.call(this, value); - return result; - }, - fixed: doMapFixed - } - }, - colorHue: makePartialColorVisualHandler(function (color$1, value) { - return modifyHSL(color$1, value); - }), - colorSaturation: makePartialColorVisualHandler(function (color$1, value) { - return modifyHSL(color$1, null, value); - }), - colorLightness: makePartialColorVisualHandler(function (color$1, value) { - return modifyHSL(color$1, null, null, value); - }), - colorAlpha: makePartialColorVisualHandler(function (color$1, value) { - return modifyAlpha(color$1, value); - }), - decal: { - applyVisual: makeApplyVisual('decal'), - _normalizedToVisual: { - linear: null, - category: doMapCategory, - piecewise: null, - fixed: null - } - }, - opacity: { - applyVisual: makeApplyVisual('opacity'), - _normalizedToVisual: createNormalizedToNumericVisual([0, 1]) - }, - liftZ: { - applyVisual: makeApplyVisual('liftZ'), - _normalizedToVisual: { - linear: doMapFixed, - category: doMapFixed, - piecewise: doMapFixed, - fixed: doMapFixed - } - }, - symbol: { - applyVisual: function (value, getter, setter) { - var symbolCfg = this.mapValueToVisual(value); - setter('symbol', symbolCfg); - }, - _normalizedToVisual: { - linear: doMapToArray, - category: doMapCategory, - piecewise: function (normalized, value) { - var result = getSpecifiedVisual.call(this, value); - - if (result == null) { - result = doMapToArray.call(this, normalized); - } + if (result == null) { + result = doMapToArray.call(this, normalized); + } - return result; - }, - fixed: doMapFixed - } - }, - symbolSize: { - applyVisual: makeApplyVisual('symbolSize'), - _normalizedToVisual: createNormalizedToNumericVisual([0, 1]) - } - }; - return VisualMapping; - }(); + return result; + }, + fixed: doMapFixed + } + }, + symbolSize: { + applyVisual: makeApplyVisual('symbolSize'), + _normalizedToVisual: createNormalizedToNumericVisual([0, 1]) + } + }; + return VisualMapping; + }(); function preprocessForPiecewise(thisOption) { - var pieceList = thisOption.pieceList; - thisOption.hasSpecialVisual = false; - each(pieceList, function (piece, index) { - piece.originIndex = index; // piece.visual is "result visual value" but not - // a visual range, so it does not need to be normalized. + var pieceList = thisOption.pieceList; + thisOption.hasSpecialVisual = false; + each(pieceList, function (piece, index) { + piece.originIndex = index; // piece.visual is "result visual value" but not + // a visual range, so it does not need to be normalized. - if (piece.visual != null) { - thisOption.hasSpecialVisual = true; - } - }); + if (piece.visual != null) { + thisOption.hasSpecialVisual = true; + } + }); } function preprocessForSpecifiedCategory(thisOption) { - // Hash categories. - var categories = thisOption.categories; - var categoryMap = thisOption.categoryMap = {}; - var visual = thisOption.visual; - each$3(categories, function (cate, index) { - categoryMap[cate] = index; - }); // Process visual map input. - - if (!isArray(visual)) { - var visualArr_1 = []; - - if (isObject(visual)) { - each$3(visual, function (v, cate) { - var index = categoryMap[cate]; - visualArr_1[index != null ? index : CATEGORY_DEFAULT_VISUAL_INDEX] = v; - }); - } else { - // Is primary type, represents default visual. - visualArr_1[CATEGORY_DEFAULT_VISUAL_INDEX] = visual; - } + // Hash categories. + var categories = thisOption.categories; + var categoryMap = thisOption.categoryMap = {}; + var visual = thisOption.visual; + each$3(categories, function (cate, index) { + categoryMap[cate] = index; + }); // Process visual map input. - visual = setVisualToOption(thisOption, visualArr_1); - } // Remove categories that has no visual, - // then we can mapping them to CATEGORY_DEFAULT_VISUAL_INDEX. + if (!isArray(visual)) { + var visualArr_1 = []; + if (isObject(visual)) { + each$3(visual, function (v, cate) { + var index = categoryMap[cate]; + visualArr_1[index != null ? index : CATEGORY_DEFAULT_VISUAL_INDEX] = v; + }); + } else { + // Is primary type, represents default visual. + visualArr_1[CATEGORY_DEFAULT_VISUAL_INDEX] = visual; + } - for (var i = categories.length - 1; i >= 0; i--) { - if (visual[i] == null) { - delete categoryMap[categories[i]]; - categories.pop(); - } + visual = setVisualToOption(thisOption, visualArr_1); + } // Remove categories that has no visual, + // then we can mapping them to CATEGORY_DEFAULT_VISUAL_INDEX. + + + for (var i = categories.length - 1; i >= 0; i--) { + if (visual[i] == null) { + delete categoryMap[categories[i]]; + categories.pop(); } + } } function normalizeVisualRange(thisOption, isCategory) { - var visual = thisOption.visual; - var visualArr = []; + var visual = thisOption.visual; + var visualArr = []; - if (isObject(visual)) { - each$3(visual, function (v) { - visualArr.push(v); - }); - } else if (visual != null) { - visualArr.push(visual); - } + if (isObject(visual)) { + each$3(visual, function (v) { + visualArr.push(v); + }); + } else if (visual != null) { + visualArr.push(visual); + } - var doNotNeedPair = { - color: 1, - symbol: 1 - }; + var doNotNeedPair = { + color: 1, + symbol: 1 + }; - if (!isCategory && visualArr.length === 1 && !doNotNeedPair.hasOwnProperty(thisOption.type)) { - // Do not care visualArr.length === 0, which is illegal. - visualArr[1] = visualArr[0]; - } + if (!isCategory && visualArr.length === 1 && !doNotNeedPair.hasOwnProperty(thisOption.type)) { + // Do not care visualArr.length === 0, which is illegal. + visualArr[1] = visualArr[0]; + } - setVisualToOption(thisOption, visualArr); + setVisualToOption(thisOption, visualArr); } function makePartialColorVisualHandler(applyValue) { - return { - applyVisual: function (value, getter, setter) { - // Only used in HSL - var colorChannel = this.mapValueToVisual(value); // Must not be array value + return { + applyVisual: function (value, getter, setter) { + // Only used in HSL + var colorChannel = this.mapValueToVisual(value); // Must not be array value - setter('color', applyValue(getter('color'), colorChannel)); - }, - _normalizedToVisual: createNormalizedToNumericVisual([0, 1]) - }; + setter('color', applyValue(getter('color'), colorChannel)); + }, + _normalizedToVisual: createNormalizedToNumericVisual([0, 1]) + }; } function doMapToArray(normalized) { - var visual = this.option.visual; - return visual[Math.round(linearMap(normalized, [0, 1], [0, visual.length - 1], true))] || {}; // TODO {}? + var visual = this.option.visual; + return visual[Math.round(linearMap(normalized, [0, 1], [0, visual.length - 1], true))] || {}; // TODO {}? } function makeApplyVisual(visualType) { - return function (value, getter, setter) { - setter(visualType, this.mapValueToVisual(value)); - }; + return function (value, getter, setter) { + setter(visualType, this.mapValueToVisual(value)); + }; } function doMapCategory(normalized) { - var visual = this.option.visual; - return visual[this.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX ? normalized % visual.length : normalized]; + var visual = this.option.visual; + return visual[this.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX ? normalized % visual.length : normalized]; } function doMapFixed() { - // visual will be convert to array. - return this.option.visual[0]; + // visual will be convert to array. + return this.option.visual[0]; } /** * Create mapped to numeric visual @@ -58011,54 +58011,54 @@ function createNormalizedToNumericVisual(sourceExtent) { - return { - linear: function (normalized) { - return linearMap(normalized, sourceExtent, this.option.visual, true); - }, - category: doMapCategory, - piecewise: function (normalized, value) { - var result = getSpecifiedVisual.call(this, value); + return { + linear: function (normalized) { + return linearMap(normalized, sourceExtent, this.option.visual, true); + }, + category: doMapCategory, + piecewise: function (normalized, value) { + var result = getSpecifiedVisual.call(this, value); - if (result == null) { - result = linearMap(normalized, sourceExtent, this.option.visual, true); - } + if (result == null) { + result = linearMap(normalized, sourceExtent, this.option.visual, true); + } - return result; - }, - fixed: doMapFixed - }; + return result; + }, + fixed: doMapFixed + }; } function getSpecifiedVisual(value) { - var thisOption = this.option; - var pieceList = thisOption.pieceList; + var thisOption = this.option; + var pieceList = thisOption.pieceList; - if (thisOption.hasSpecialVisual) { - var pieceIndex = VisualMapping.findPieceIndex(value, pieceList); - var piece = pieceList[pieceIndex]; + if (thisOption.hasSpecialVisual) { + var pieceIndex = VisualMapping.findPieceIndex(value, pieceList); + var piece = pieceList[pieceIndex]; - if (piece && piece.visual) { - return piece.visual[this.type]; - } + if (piece && piece.visual) { + return piece.visual[this.type]; } + } } function setVisualToOption(thisOption, visualArr) { - thisOption.visual = visualArr; + thisOption.visual = visualArr; - if (thisOption.type === 'color') { - thisOption.parsedVisual = map(visualArr, function (item) { - var color$1 = parse(item); + if (thisOption.type === 'color') { + thisOption.parsedVisual = map(visualArr, function (item) { + var color$1 = parse(item); - if (!color$1 && "development" !== 'production') { - warn("'" + item + "' is an illegal color, fallback to '#000000'", true); - } + if (!color$1 && "development" !== 'production') { + warn("'" + item + "' is an illegal color, fallback to '#000000'", true); + } - return color$1 || [0, 0, 0, 1]; - }); - } + return color$1 || [0, 0, 0, 1]; + }); + } - return visualArr; + return visualArr; } /** * Normalizers by mapping methods. @@ -58066,167 +58066,167 @@ var normalizers = { - linear: function (value) { - return linearMap(value, this.option.dataExtent, [0, 1], true); - }, - piecewise: function (value) { - var pieceList = this.option.pieceList; - var pieceIndex = VisualMapping.findPieceIndex(value, pieceList, true); - - if (pieceIndex != null) { - return linearMap(pieceIndex, [0, pieceList.length - 1], [0, 1], true); - } - }, - category: function (value) { - var index = this.option.categories ? this.option.categoryMap[value] : value; // ordinal value - - return index == null ? CATEGORY_DEFAULT_VISUAL_INDEX : index; - }, - fixed: noop + linear: function (value) { + return linearMap(value, this.option.dataExtent, [0, 1], true); + }, + piecewise: function (value) { + var pieceList = this.option.pieceList; + var pieceIndex = VisualMapping.findPieceIndex(value, pieceList, true); + + if (pieceIndex != null) { + return linearMap(pieceIndex, [0, pieceList.length - 1], [0, 1], true); + } + }, + category: function (value) { + var index = this.option.categories ? this.option.categoryMap[value] : value; // ordinal value + + return index == null ? CATEGORY_DEFAULT_VISUAL_INDEX : index; + }, + fixed: noop }; function littleThan(close, a, b) { - return close ? a <= b : a < b; + return close ? a <= b : a < b; } var ITEM_STYLE_NORMAL = 'itemStyle'; var inner$9 = makeInner(); var treemapVisual = { - seriesType: 'treemap', - reset: function (seriesModel) { - var tree = seriesModel.getData().tree; - var root = tree.root; - - if (root.isRemoved()) { - return; - } + seriesType: 'treemap', + reset: function (seriesModel) { + var tree = seriesModel.getData().tree; + var root = tree.root; - travelTree(root, // Visual should calculate from tree root but not view root. - {}, seriesModel.getViewRoot().getAncestors(), seriesModel); + if (root.isRemoved()) { + return; } + + travelTree(root, // Visual should calculate from tree root but not view root. + {}, seriesModel.getViewRoot().getAncestors(), seriesModel); + } }; function travelTree(node, designatedVisual, viewRootAncestors, seriesModel) { - var nodeModel = node.getModel(); - var nodeLayout = node.getLayout(); - var data = node.hostTree.data; // Optimize - - if (!nodeLayout || nodeLayout.invisible || !nodeLayout.isInView) { - return; - } - - var nodeItemStyleModel = nodeModel.getModel(ITEM_STYLE_NORMAL); - var visuals = buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel); - var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style'); // calculate border color - - var borderColor = nodeItemStyleModel.get('borderColor'); - var borderColorSaturation = nodeItemStyleModel.get('borderColorSaturation'); - var thisNodeColor; + var nodeModel = node.getModel(); + var nodeLayout = node.getLayout(); + var data = node.hostTree.data; // Optimize - if (borderColorSaturation != null) { - // For performance, do not always execute 'calculateColor'. - thisNodeColor = calculateColor(visuals); - borderColor = calculateBorderColor(borderColorSaturation, thisNodeColor); - } - - existsStyle.stroke = borderColor; - var viewChildren = node.viewChildren; - - if (!viewChildren || !viewChildren.length) { - thisNodeColor = calculateColor(visuals); // Apply visual to this node. - - existsStyle.fill = thisNodeColor; - } else { - var mapping_1 = buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren); // Designate visual to children. - - each(viewChildren, function (child, index) { - // If higher than viewRoot, only ancestors of viewRoot is needed to visit. - if (child.depth >= viewRootAncestors.length || child === viewRootAncestors[child.depth]) { - var childVisual = mapVisual(nodeModel, visuals, child, index, mapping_1, seriesModel); - travelTree(child, childVisual, viewRootAncestors, seriesModel); - } - }); - } + if (!nodeLayout || nodeLayout.invisible || !nodeLayout.isInView) { + return; + } + + var nodeItemStyleModel = nodeModel.getModel(ITEM_STYLE_NORMAL); + var visuals = buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel); + var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style'); // calculate border color + + var borderColor = nodeItemStyleModel.get('borderColor'); + var borderColorSaturation = nodeItemStyleModel.get('borderColorSaturation'); + var thisNodeColor; + + if (borderColorSaturation != null) { + // For performance, do not always execute 'calculateColor'. + thisNodeColor = calculateColor(visuals); + borderColor = calculateBorderColor(borderColorSaturation, thisNodeColor); + } + + existsStyle.stroke = borderColor; + var viewChildren = node.viewChildren; + + if (!viewChildren || !viewChildren.length) { + thisNodeColor = calculateColor(visuals); // Apply visual to this node. + + existsStyle.fill = thisNodeColor; + } else { + var mapping_1 = buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren); // Designate visual to children. + + each(viewChildren, function (child, index) { + // If higher than viewRoot, only ancestors of viewRoot is needed to visit. + if (child.depth >= viewRootAncestors.length || child === viewRootAncestors[child.depth]) { + var childVisual = mapVisual(nodeModel, visuals, child, index, mapping_1, seriesModel); + travelTree(child, childVisual, viewRootAncestors, seriesModel); + } + }); + } } function buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel) { - var visuals = extend({}, designatedVisual); - var designatedVisualItemStyle = seriesModel.designatedVisualItemStyle; - each(['color', 'colorAlpha', 'colorSaturation'], function (visualName) { - // Priority: thisNode > thisLevel > parentNodeDesignated > seriesModel - designatedVisualItemStyle[visualName] = designatedVisual[visualName]; - var val = nodeItemStyleModel.get(visualName); - designatedVisualItemStyle[visualName] = null; - val != null && (visuals[visualName] = val); - }); - return visuals; + var visuals = extend({}, designatedVisual); + var designatedVisualItemStyle = seriesModel.designatedVisualItemStyle; + each(['color', 'colorAlpha', 'colorSaturation'], function (visualName) { + // Priority: thisNode > thisLevel > parentNodeDesignated > seriesModel + designatedVisualItemStyle[visualName] = designatedVisual[visualName]; + var val = nodeItemStyleModel.get(visualName); + designatedVisualItemStyle[visualName] = null; + val != null && (visuals[visualName] = val); + }); + return visuals; } function calculateColor(visuals) { - var color = getValueVisualDefine(visuals, 'color'); + var color = getValueVisualDefine(visuals, 'color'); - if (color) { - var colorAlpha = getValueVisualDefine(visuals, 'colorAlpha'); - var colorSaturation = getValueVisualDefine(visuals, 'colorSaturation'); - - if (colorSaturation) { - color = modifyHSL(color, null, null, colorSaturation); - } + if (color) { + var colorAlpha = getValueVisualDefine(visuals, 'colorAlpha'); + var colorSaturation = getValueVisualDefine(visuals, 'colorSaturation'); - if (colorAlpha) { - color = modifyAlpha(color, colorAlpha); - } + if (colorSaturation) { + color = modifyHSL(color, null, null, colorSaturation); + } - return color; + if (colorAlpha) { + color = modifyAlpha(color, colorAlpha); } + + return color; + } } function calculateBorderColor(borderColorSaturation, thisNodeColor) { - return thisNodeColor != null // Can only be string - ? modifyHSL(thisNodeColor, null, null, borderColorSaturation) : null; + return thisNodeColor != null // Can only be string + ? modifyHSL(thisNodeColor, null, null, borderColorSaturation) : null; } function getValueVisualDefine(visuals, name) { - var value = visuals[name]; + var value = visuals[name]; - if (value != null && value !== 'none') { - return value; - } + if (value != null && value !== 'none') { + return value; + } } function buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren) { - if (!viewChildren || !viewChildren.length) { - return; - } - - var rangeVisual = getRangeVisual(nodeModel, 'color') || visuals.color != null && visuals.color !== 'none' && (getRangeVisual(nodeModel, 'colorAlpha') || getRangeVisual(nodeModel, 'colorSaturation')); - - if (!rangeVisual) { - return; - } - - var visualMin = nodeModel.get('visualMin'); - var visualMax = nodeModel.get('visualMax'); - var dataExtent = nodeLayout.dataExtent.slice(); - visualMin != null && visualMin < dataExtent[0] && (dataExtent[0] = visualMin); - visualMax != null && visualMax > dataExtent[1] && (dataExtent[1] = visualMax); - var colorMappingBy = nodeModel.get('colorMappingBy'); - var opt = { - type: rangeVisual.name, - dataExtent: dataExtent, - visual: rangeVisual.range - }; + if (!viewChildren || !viewChildren.length) { + return; + } - if (opt.type === 'color' && (colorMappingBy === 'index' || colorMappingBy === 'id')) { - opt.mappingMethod = 'category'; - opt.loop = true; // categories is ordinal, so do not set opt.categories. - } else { - opt.mappingMethod = 'linear'; - } + var rangeVisual = getRangeVisual(nodeModel, 'color') || visuals.color != null && visuals.color !== 'none' && (getRangeVisual(nodeModel, 'colorAlpha') || getRangeVisual(nodeModel, 'colorSaturation')); - var mapping = new VisualMapping(opt); - inner$9(mapping).drColorMappingBy = colorMappingBy; - return mapping; + if (!rangeVisual) { + return; + } + + var visualMin = nodeModel.get('visualMin'); + var visualMax = nodeModel.get('visualMax'); + var dataExtent = nodeLayout.dataExtent.slice(); + visualMin != null && visualMin < dataExtent[0] && (dataExtent[0] = visualMin); + visualMax != null && visualMax > dataExtent[1] && (dataExtent[1] = visualMax); + var colorMappingBy = nodeModel.get('colorMappingBy'); + var opt = { + type: rangeVisual.name, + dataExtent: dataExtent, + visual: rangeVisual.range + }; + + if (opt.type === 'color' && (colorMappingBy === 'index' || colorMappingBy === 'id')) { + opt.mappingMethod = 'category'; + opt.loop = true; // categories is ordinal, so do not set opt.categories. + } else { + opt.mappingMethod = 'linear'; + } + + var mapping = new VisualMapping(opt); + inner$9(mapping).drColorMappingBy = colorMappingBy; + return mapping; } // Notice: If we dont have the attribute 'colorRange', but only use // attribute 'color' to represent both concepts of 'colorRange' and 'color', // (It means 'colorRange' when 'color' is Array, means 'color' when not array), @@ -58237,27 +58237,27 @@ function getRangeVisual(nodeModel, name) { - // 'colorRange', 'colorARange', 'colorSRange'. - // If not exsits on this node, fetch from levels and series. - var range = nodeModel.get(name); - return isArray(range) && range.length ? { - name: name, - range: range - } : null; + // 'colorRange', 'colorARange', 'colorSRange'. + // If not exsits on this node, fetch from levels and series. + var range = nodeModel.get(name); + return isArray(range) && range.length ? { + name: name, + range: range + } : null; } function mapVisual(nodeModel, visuals, child, index, mapping, seriesModel) { - var childVisuals = extend({}, visuals); + var childVisuals = extend({}, visuals); - if (mapping) { - // Only support color, colorAlpha, colorSaturation. - var mappingType = mapping.type; - var colorMappingBy = mappingType === 'color' && inner$9(mapping).drColorMappingBy; - var value = colorMappingBy === 'index' ? index : colorMappingBy === 'id' ? seriesModel.mapIdToIndex(child.getId()) : child.getValue(nodeModel.get('visualDimension')); - childVisuals[mappingType] = mapping.mapValueToVisual(value); - } + if (mapping) { + // Only support color, colorAlpha, colorSaturation. + var mappingType = mapping.type; + var colorMappingBy = mappingType === 'color' && inner$9(mapping).drColorMappingBy; + var value = colorMappingBy === 'index' ? index : colorMappingBy === 'id' ? seriesModel.mapIdToIndex(child.getId()) : child.getValue(nodeModel.get('visualDimension')); + childVisuals[mappingType] = mapping.mapValueToVisual(value); + } - return childVisuals; + return childVisuals; } var mathMax$7 = Math.max; @@ -58273,78 +58273,78 @@ */ var treemapLayout = { - seriesType: 'treemap', - reset: function (seriesModel, ecModel, api, payload) { - // Layout result in each node: - // {x, y, width, height, area, borderWidth} - var ecWidth = api.getWidth(); - var ecHeight = api.getHeight(); - var seriesOption = seriesModel.option; - var layoutInfo = getLayoutRect(seriesModel.getBoxLayoutParams(), { - width: api.getWidth(), - height: api.getHeight() - }); - var size = seriesOption.size || []; // Compatible with ec2. - - var containerWidth = parsePercent$1(retrieveValue(layoutInfo.width, size[0]), ecWidth); - var containerHeight = parsePercent$1(retrieveValue(layoutInfo.height, size[1]), ecHeight); // Fetch payload info. - - var payloadType = payload && payload.type; - var types = ['treemapZoomToNode', 'treemapRootToNode']; - var targetInfo = retrieveTargetInfo(payload, types, seriesModel); - var rootRect = payloadType === 'treemapRender' || payloadType === 'treemapMove' ? payload.rootRect : null; - var viewRoot = seriesModel.getViewRoot(); - var viewAbovePath = getPathToRoot(viewRoot); - - if (payloadType !== 'treemapMove') { - var rootSize = payloadType === 'treemapZoomToNode' ? estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) : rootRect ? [rootRect.width, rootRect.height] : [containerWidth, containerHeight]; - var sort_1 = seriesOption.sort; - - if (sort_1 && sort_1 !== 'asc' && sort_1 !== 'desc') { - // Default to be desc order. - sort_1 = 'desc'; - } - - var options = { - squareRatio: seriesOption.squareRatio, - sort: sort_1, - leafDepth: seriesOption.leafDepth - }; // layout should be cleared because using updateView but not update. - - viewRoot.hostTree.clearLayouts(); // TODO - // optimize: if out of view clip, do not layout. - // But take care that if do not render node out of view clip, - // how to calculate start po - - var viewRootLayout_1 = { - x: 0, - y: 0, - width: rootSize[0], - height: rootSize[1], - area: rootSize[0] * rootSize[1] - }; - viewRoot.setLayout(viewRootLayout_1); - squarify(viewRoot, options, false, 0); // Supplement layout. - - viewRootLayout_1 = viewRoot.getLayout(); - each$4(viewAbovePath, function (node, index) { - var childValue = (viewAbovePath[index + 1] || viewRoot).getValue(); - node.setLayout(extend({ - dataExtent: [childValue, childValue], - borderWidth: 0, - upperHeight: 0 - }, viewRootLayout_1)); - }); - } - - var treeRoot = seriesModel.getData().tree.root; - treeRoot.setLayout(calculateRootPosition(layoutInfo, rootRect, targetInfo), true); - seriesModel.setLayoutInfo(layoutInfo); // FIXME - // 现在没有clip功能,暂时取ec高宽。 - - prunning(treeRoot, // Transform to base element coordinate system. - new BoundingRect(-layoutInfo.x, -layoutInfo.y, ecWidth, ecHeight), viewAbovePath, viewRoot, 0); - } + seriesType: 'treemap', + reset: function (seriesModel, ecModel, api, payload) { + // Layout result in each node: + // {x, y, width, height, area, borderWidth} + var ecWidth = api.getWidth(); + var ecHeight = api.getHeight(); + var seriesOption = seriesModel.option; + var layoutInfo = getLayoutRect(seriesModel.getBoxLayoutParams(), { + width: api.getWidth(), + height: api.getHeight() + }); + var size = seriesOption.size || []; // Compatible with ec2. + + var containerWidth = parsePercent$1(retrieveValue(layoutInfo.width, size[0]), ecWidth); + var containerHeight = parsePercent$1(retrieveValue(layoutInfo.height, size[1]), ecHeight); // Fetch payload info. + + var payloadType = payload && payload.type; + var types = ['treemapZoomToNode', 'treemapRootToNode']; + var targetInfo = retrieveTargetInfo(payload, types, seriesModel); + var rootRect = payloadType === 'treemapRender' || payloadType === 'treemapMove' ? payload.rootRect : null; + var viewRoot = seriesModel.getViewRoot(); + var viewAbovePath = getPathToRoot(viewRoot); + + if (payloadType !== 'treemapMove') { + var rootSize = payloadType === 'treemapZoomToNode' ? estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) : rootRect ? [rootRect.width, rootRect.height] : [containerWidth, containerHeight]; + var sort_1 = seriesOption.sort; + + if (sort_1 && sort_1 !== 'asc' && sort_1 !== 'desc') { + // Default to be desc order. + sort_1 = 'desc'; + } + + var options = { + squareRatio: seriesOption.squareRatio, + sort: sort_1, + leafDepth: seriesOption.leafDepth + }; // layout should be cleared because using updateView but not update. + + viewRoot.hostTree.clearLayouts(); // TODO + // optimize: if out of view clip, do not layout. + // But take care that if do not render node out of view clip, + // how to calculate start po + + var viewRootLayout_1 = { + x: 0, + y: 0, + width: rootSize[0], + height: rootSize[1], + area: rootSize[0] * rootSize[1] + }; + viewRoot.setLayout(viewRootLayout_1); + squarify(viewRoot, options, false, 0); // Supplement layout. + + viewRootLayout_1 = viewRoot.getLayout(); + each$4(viewAbovePath, function (node, index) { + var childValue = (viewAbovePath[index + 1] || viewRoot).getValue(); + node.setLayout(extend({ + dataExtent: [childValue, childValue], + borderWidth: 0, + upperHeight: 0 + }, viewRootLayout_1)); + }); + } + + var treeRoot = seriesModel.getData().tree.root; + treeRoot.setLayout(calculateRootPosition(layoutInfo, rootRect, targetInfo), true); + seriesModel.setLayoutInfo(layoutInfo); // FIXME + // 现在没有clip功能,暂时取ec高宽。 + + prunning(treeRoot, // Transform to base element coordinate system. + new BoundingRect(-layoutInfo.x, -layoutInfo.y, ecWidth, ecHeight), viewAbovePath, viewRoot, 0); + } }; /** * Layout treemap with squarify algorithm. @@ -58366,84 +58366,84 @@ */ function squarify(node, options, hideChildren, depth) { - var width; - var height; - - if (node.isRemoved()) { - return; - } - - var thisLayout = node.getLayout(); - width = thisLayout.width; - height = thisLayout.height; // Considering border and gap - - var nodeModel = node.getModel(); - var borderWidth = nodeModel.get(PATH_BORDER_WIDTH); - var halfGapWidth = nodeModel.get(PATH_GAP_WIDTH) / 2; - var upperLabelHeight = getUpperLabelHeight(nodeModel); - var upperHeight = Math.max(borderWidth, upperLabelHeight); - var layoutOffset = borderWidth - halfGapWidth; - var layoutOffsetUpper = upperHeight - halfGapWidth; - node.setLayout({ - borderWidth: borderWidth, - upperHeight: upperHeight, - upperLabelHeight: upperLabelHeight - }, true); - width = mathMax$7(width - 2 * layoutOffset, 0); - height = mathMax$7(height - layoutOffset - layoutOffsetUpper, 0); - var totalArea = width * height; - var viewChildren = initChildren(node, nodeModel, totalArea, options, hideChildren, depth); - - if (!viewChildren.length) { - return; - } - - var rect = { - x: layoutOffset, - y: layoutOffsetUpper, - width: width, - height: height - }; - var rowFixedLength = mathMin$7(width, height); - var best = Infinity; // the best row score so far - - var row = []; - row.area = 0; + var width; + var height; - for (var i = 0, len = viewChildren.length; i < len;) { - var child = viewChildren[i]; - row.push(child); - row.area += child.getLayout().area; - var score = worst(row, rowFixedLength, options.squareRatio); // continue with this orientation - - if (score <= best) { - i++; - best = score; - } // abort, and try a different orientation - else { - row.area -= row.pop().getLayout().area; - position(row, rowFixedLength, rect, halfGapWidth, false); - rowFixedLength = mathMin$7(rect.width, rect.height); - row.length = row.area = 0; - best = Infinity; - } - } + if (node.isRemoved()) { + return; + } + + var thisLayout = node.getLayout(); + width = thisLayout.width; + height = thisLayout.height; // Considering border and gap + + var nodeModel = node.getModel(); + var borderWidth = nodeModel.get(PATH_BORDER_WIDTH); + var halfGapWidth = nodeModel.get(PATH_GAP_WIDTH) / 2; + var upperLabelHeight = getUpperLabelHeight(nodeModel); + var upperHeight = Math.max(borderWidth, upperLabelHeight); + var layoutOffset = borderWidth - halfGapWidth; + var layoutOffsetUpper = upperHeight - halfGapWidth; + node.setLayout({ + borderWidth: borderWidth, + upperHeight: upperHeight, + upperLabelHeight: upperLabelHeight + }, true); + width = mathMax$7(width - 2 * layoutOffset, 0); + height = mathMax$7(height - layoutOffset - layoutOffsetUpper, 0); + var totalArea = width * height; + var viewChildren = initChildren(node, nodeModel, totalArea, options, hideChildren, depth); + + if (!viewChildren.length) { + return; + } + + var rect = { + x: layoutOffset, + y: layoutOffsetUpper, + width: width, + height: height + }; + var rowFixedLength = mathMin$7(width, height); + var best = Infinity; // the best row score so far + + var row = []; + row.area = 0; + + for (var i = 0, len = viewChildren.length; i < len;) { + var child = viewChildren[i]; + row.push(child); + row.area += child.getLayout().area; + var score = worst(row, rowFixedLength, options.squareRatio); // continue with this orientation + + if (score <= best) { + i++; + best = score; + } // abort, and try a different orientation + else { + row.area -= row.pop().getLayout().area; + position(row, rowFixedLength, rect, halfGapWidth, false); + rowFixedLength = mathMin$7(rect.width, rect.height); + row.length = row.area = 0; + best = Infinity; + } + } - if (row.length) { - position(row, rowFixedLength, rect, halfGapWidth, true); - } + if (row.length) { + position(row, rowFixedLength, rect, halfGapWidth, true); + } - if (!hideChildren) { - var childrenVisibleMin = nodeModel.get('childrenVisibleMin'); + if (!hideChildren) { + var childrenVisibleMin = nodeModel.get('childrenVisibleMin'); - if (childrenVisibleMin != null && totalArea < childrenVisibleMin) { - hideChildren = true; - } + if (childrenVisibleMin != null && totalArea < childrenVisibleMin) { + hideChildren = true; } + } - for (var i = 0, len = viewChildren.length; i < len; i++) { - squarify(viewChildren[i], options, hideChildren, depth + 1); - } + for (var i = 0, len = viewChildren.length; i < len; i++) { + squarify(viewChildren[i], options, hideChildren, depth + 1); + } } /** * Set area to each child, and calculate data extent for visual coding. @@ -58451,53 +58451,53 @@ function initChildren(node, nodeModel, totalArea, options, hideChildren, depth) { - var viewChildren = node.children || []; - var orderBy = options.sort; - orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null); - var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth; // leafDepth has higher priority. + var viewChildren = node.children || []; + var orderBy = options.sort; + orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null); + var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth; // leafDepth has higher priority. - if (hideChildren && !overLeafDepth) { - return node.viewChildren = []; - } // Sort children, order by desc. + if (hideChildren && !overLeafDepth) { + return node.viewChildren = []; + } // Sort children, order by desc. - viewChildren = filter(viewChildren, function (child) { - return !child.isRemoved(); - }); - sort$1(viewChildren, orderBy); - var info = statistic(nodeModel, viewChildren, orderBy); - - if (info.sum === 0) { - return node.viewChildren = []; - } + viewChildren = filter(viewChildren, function (child) { + return !child.isRemoved(); + }); + sort$1(viewChildren, orderBy); + var info = statistic(nodeModel, viewChildren, orderBy); - info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren); + if (info.sum === 0) { + return node.viewChildren = []; + } - if (info.sum === 0) { - return node.viewChildren = []; - } // Set area to each child. + info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren); + if (info.sum === 0) { + return node.viewChildren = []; + } // Set area to each child. - for (var i = 0, len = viewChildren.length; i < len; i++) { - var area = viewChildren[i].getValue() / info.sum * totalArea; // Do not use setLayout({...}, true), because it is needed to clear last layout. - viewChildren[i].setLayout({ - area: area - }); - } + for (var i = 0, len = viewChildren.length; i < len; i++) { + var area = viewChildren[i].getValue() / info.sum * totalArea; // Do not use setLayout({...}, true), because it is needed to clear last layout. - if (overLeafDepth) { - viewChildren.length && node.setLayout({ - isLeafRoot: true - }, true); - viewChildren.length = 0; - } + viewChildren[i].setLayout({ + area: area + }); + } - node.viewChildren = viewChildren; - node.setLayout({ - dataExtent: info.dataExtent + if (overLeafDepth) { + viewChildren.length && node.setLayout({ + isLeafRoot: true }, true); - return viewChildren; + viewChildren.length = 0; + } + + node.viewChildren = viewChildren; + node.setLayout({ + dataExtent: info.dataExtent + }, true); + return viewChildren; } /** * Consider 'visibleMin'. Modify viewChildren and get new sum. @@ -58505,26 +58505,26 @@ function filterByThreshold(nodeModel, totalArea, sum, orderBy, orderedChildren) { - // visibleMin is not supported yet when no option.sort. - if (!orderBy) { - return sum; - } + // visibleMin is not supported yet when no option.sort. + if (!orderBy) { + return sum; + } - var visibleMin = nodeModel.get('visibleMin'); - var len = orderedChildren.length; - var deletePoint = len; // Always travel from little value to big value. + var visibleMin = nodeModel.get('visibleMin'); + var len = orderedChildren.length; + var deletePoint = len; // Always travel from little value to big value. - for (var i = len - 1; i >= 0; i--) { - var value = orderedChildren[orderBy === 'asc' ? len - i - 1 : i].getValue(); + for (var i = len - 1; i >= 0; i--) { + var value = orderedChildren[orderBy === 'asc' ? len - i - 1 : i].getValue(); - if (value / sum * totalArea < visibleMin) { - deletePoint = i; - sum -= value; - } + if (value / sum * totalArea < visibleMin) { + deletePoint = i; + sum -= value; } + } - orderBy === 'asc' ? orderedChildren.splice(0, len - deletePoint) : orderedChildren.splice(deletePoint, len - deletePoint); - return sum; + orderBy === 'asc' ? orderedChildren.splice(0, len - deletePoint) : orderedChildren.splice(deletePoint, len - deletePoint); + return sum; } /** * Sort @@ -58532,14 +58532,14 @@ function sort$1(viewChildren, orderBy) { - if (orderBy) { - viewChildren.sort(function (a, b) { - var diff = orderBy === 'asc' ? a.getValue() - b.getValue() : b.getValue() - a.getValue(); - return diff === 0 ? orderBy === 'asc' ? a.dataIndex - b.dataIndex : b.dataIndex - a.dataIndex : diff; - }); - } + if (orderBy) { + viewChildren.sort(function (a, b) { + var diff = orderBy === 'asc' ? a.getValue() - b.getValue() : b.getValue() - a.getValue(); + return diff === 0 ? orderBy === 'asc' ? a.dataIndex - b.dataIndex : b.dataIndex - a.dataIndex : diff; + }); + } - return viewChildren; + return viewChildren; } /** * Statistic @@ -58547,39 +58547,39 @@ function statistic(nodeModel, children, orderBy) { - // Calculate sum. - var sum = 0; - - for (var i = 0, len = children.length; i < len; i++) { - sum += children[i].getValue(); - } // Statistic data extent for latter visual coding. - // Notice: data extent should be calculate based on raw children - // but not filtered view children, otherwise visual mapping will not - // be stable when zoom (where children is filtered by visibleMin). - - - var dimension = nodeModel.get('visualDimension'); - var dataExtent; // The same as area dimension. - - if (!children || !children.length) { - dataExtent = [NaN, NaN]; - } else if (dimension === 'value' && orderBy) { - dataExtent = [children[children.length - 1].getValue(), children[0].getValue()]; - orderBy === 'asc' && dataExtent.reverse(); - } // Other dimension. - else { - dataExtent = [Infinity, -Infinity]; - each$4(children, function (child) { - var value = child.getValue(dimension); - value < dataExtent[0] && (dataExtent[0] = value); - value > dataExtent[1] && (dataExtent[1] = value); - }); - } - - return { - sum: sum, - dataExtent: dataExtent - }; + // Calculate sum. + var sum = 0; + + for (var i = 0, len = children.length; i < len; i++) { + sum += children[i].getValue(); + } // Statistic data extent for latter visual coding. + // Notice: data extent should be calculate based on raw children + // but not filtered view children, otherwise visual mapping will not + // be stable when zoom (where children is filtered by visibleMin). + + + var dimension = nodeModel.get('visualDimension'); + var dataExtent; // The same as area dimension. + + if (!children || !children.length) { + dataExtent = [NaN, NaN]; + } else if (dimension === 'value' && orderBy) { + dataExtent = [children[children.length - 1].getValue(), children[0].getValue()]; + orderBy === 'asc' && dataExtent.reverse(); + } // Other dimension. + else { + dataExtent = [Infinity, -Infinity]; + each$4(children, function (child) { + var value = child.getValue(dimension); + value < dataExtent[0] && (dataExtent[0] = value); + value > dataExtent[1] && (dataExtent[1] = value); + }); + } + + return { + sum: sum, + dataExtent: dataExtent + }; } /** * Computes the score for the specified row, @@ -58588,21 +58588,21 @@ function worst(row, rowFixedLength, ratio) { - var areaMax = 0; - var areaMin = Infinity; + var areaMax = 0; + var areaMin = Infinity; - for (var i = 0, area = void 0, len = row.length; i < len; i++) { - area = row[i].getLayout().area; + for (var i = 0, area = void 0, len = row.length; i < len; i++) { + area = row[i].getLayout().area; - if (area) { - area < areaMin && (areaMin = area); - area > areaMax && (areaMax = area); - } + if (area) { + area < areaMin && (areaMin = area); + area > areaMax && (areaMax = area); } + } - var squareArea = row.area * row.area; - var f = rowFixedLength * rowFixedLength * ratio; - return squareArea ? mathMax$7(f * areaMax / squareArea, squareArea / (f * areaMin)) : Infinity; + var squareArea = row.area * row.area; + var f = rowFixedLength * rowFixedLength * ratio; + return squareArea ? mathMax$7(f * areaMax / squareArea, squareArea / (f * areaMin)) : Infinity; } /** * Positions the specified row of nodes. Modifies `rect`. @@ -58610,315 +58610,315 @@ function position(row, rowFixedLength, rect, halfGapWidth, flush) { - // When rowFixedLength === rect.width, - // it is horizontal subdivision, - // rowFixedLength is the width of the subdivision, - // rowOtherLength is the height of the subdivision, - // and nodes will be positioned from left to right. - // wh[idx0WhenH] means: when horizontal, - // wh[idx0WhenH] => wh[0] => 'width'. - // xy[idx1WhenH] => xy[1] => 'y'. - var idx0WhenH = rowFixedLength === rect.width ? 0 : 1; - var idx1WhenH = 1 - idx0WhenH; - var xy = ['x', 'y']; - var wh = ['width', 'height']; - var last = rect[xy[idx0WhenH]]; - var rowOtherLength = rowFixedLength ? row.area / rowFixedLength : 0; - - if (flush || rowOtherLength > rect[wh[idx1WhenH]]) { - rowOtherLength = rect[wh[idx1WhenH]]; // over+underflow - } - - for (var i = 0, rowLen = row.length; i < rowLen; i++) { - var node = row[i]; - var nodeLayout = {}; - var step = rowOtherLength ? node.getLayout().area / rowOtherLength : 0; - var wh1 = nodeLayout[wh[idx1WhenH]] = mathMax$7(rowOtherLength - 2 * halfGapWidth, 0); // We use Math.max/min to avoid negative width/height when considering gap width. - - var remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last; - var modWH = i === rowLen - 1 || remain < step ? remain : step; - var wh0 = nodeLayout[wh[idx0WhenH]] = mathMax$7(modWH - 2 * halfGapWidth, 0); - nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin$7(halfGapWidth, wh1 / 2); - nodeLayout[xy[idx0WhenH]] = last + mathMin$7(halfGapWidth, wh0 / 2); - last += modWH; - node.setLayout(nodeLayout, true); - } - - rect[xy[idx1WhenH]] += rowOtherLength; - rect[wh[idx1WhenH]] -= rowOtherLength; + // When rowFixedLength === rect.width, + // it is horizontal subdivision, + // rowFixedLength is the width of the subdivision, + // rowOtherLength is the height of the subdivision, + // and nodes will be positioned from left to right. + // wh[idx0WhenH] means: when horizontal, + // wh[idx0WhenH] => wh[0] => 'width'. + // xy[idx1WhenH] => xy[1] => 'y'. + var idx0WhenH = rowFixedLength === rect.width ? 0 : 1; + var idx1WhenH = 1 - idx0WhenH; + var xy = ['x', 'y']; + var wh = ['width', 'height']; + var last = rect[xy[idx0WhenH]]; + var rowOtherLength = rowFixedLength ? row.area / rowFixedLength : 0; + + if (flush || rowOtherLength > rect[wh[idx1WhenH]]) { + rowOtherLength = rect[wh[idx1WhenH]]; // over+underflow + } + + for (var i = 0, rowLen = row.length; i < rowLen; i++) { + var node = row[i]; + var nodeLayout = {}; + var step = rowOtherLength ? node.getLayout().area / rowOtherLength : 0; + var wh1 = nodeLayout[wh[idx1WhenH]] = mathMax$7(rowOtherLength - 2 * halfGapWidth, 0); // We use Math.max/min to avoid negative width/height when considering gap width. + + var remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last; + var modWH = i === rowLen - 1 || remain < step ? remain : step; + var wh0 = nodeLayout[wh[idx0WhenH]] = mathMax$7(modWH - 2 * halfGapWidth, 0); + nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin$7(halfGapWidth, wh1 / 2); + nodeLayout[xy[idx0WhenH]] = last + mathMin$7(halfGapWidth, wh0 / 2); + last += modWH; + node.setLayout(nodeLayout, true); + } + + rect[xy[idx1WhenH]] += rowOtherLength; + rect[wh[idx1WhenH]] -= rowOtherLength; } // Return [containerWidth, containerHeight] as default. function estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) { - // If targetInfo.node exists, we zoom to the node, - // so estimate whold width and heigth by target node. - var currNode = (targetInfo || {}).node; - var defaultSize = [containerWidth, containerHeight]; + // If targetInfo.node exists, we zoom to the node, + // so estimate whold width and heigth by target node. + var currNode = (targetInfo || {}).node; + var defaultSize = [containerWidth, containerHeight]; - if (!currNode || currNode === viewRoot) { - return defaultSize; - } + if (!currNode || currNode === viewRoot) { + return defaultSize; + } - var parent; - var viewArea = containerWidth * containerHeight; - var area = viewArea * seriesModel.option.zoomToNodeRatio; + var parent; + var viewArea = containerWidth * containerHeight; + var area = viewArea * seriesModel.option.zoomToNodeRatio; - while (parent = currNode.parentNode) { - // jshint ignore:line - var sum = 0; - var siblings = parent.children; + while (parent = currNode.parentNode) { + // jshint ignore:line + var sum = 0; + var siblings = parent.children; - for (var i = 0, len = siblings.length; i < len; i++) { - sum += siblings[i].getValue(); - } + for (var i = 0, len = siblings.length; i < len; i++) { + sum += siblings[i].getValue(); + } - var currNodeValue = currNode.getValue(); + var currNodeValue = currNode.getValue(); - if (currNodeValue === 0) { - return defaultSize; - } + if (currNodeValue === 0) { + return defaultSize; + } - area *= sum / currNodeValue; // Considering border, suppose aspect ratio is 1. + area *= sum / currNodeValue; // Considering border, suppose aspect ratio is 1. - var parentModel = parent.getModel(); - var borderWidth = parentModel.get(PATH_BORDER_WIDTH); - var upperHeight = Math.max(borderWidth, getUpperLabelHeight(parentModel)); - area += 4 * borderWidth * borderWidth + (3 * borderWidth + upperHeight) * Math.pow(area, 0.5); - area > MAX_SAFE_INTEGER && (area = MAX_SAFE_INTEGER); - currNode = parent; - } + var parentModel = parent.getModel(); + var borderWidth = parentModel.get(PATH_BORDER_WIDTH); + var upperHeight = Math.max(borderWidth, getUpperLabelHeight(parentModel)); + area += 4 * borderWidth * borderWidth + (3 * borderWidth + upperHeight) * Math.pow(area, 0.5); + area > MAX_SAFE_INTEGER && (area = MAX_SAFE_INTEGER); + currNode = parent; + } - area < viewArea && (area = viewArea); - var scale = Math.pow(area / viewArea, 0.5); - return [containerWidth * scale, containerHeight * scale]; + area < viewArea && (area = viewArea); + var scale = Math.pow(area / viewArea, 0.5); + return [containerWidth * scale, containerHeight * scale]; } // Root postion base on coord of containerGroup function calculateRootPosition(layoutInfo, rootRect, targetInfo) { - if (rootRect) { - return { - x: rootRect.x, - y: rootRect.y - }; - } - - var defaultPosition = { - x: 0, - y: 0 + if (rootRect) { + return { + x: rootRect.x, + y: rootRect.y }; + } - if (!targetInfo) { - return defaultPosition; - } // If targetInfo is fetched by 'retrieveTargetInfo', - // old tree and new tree are the same tree, - // so the node still exists and we can visit it. + var defaultPosition = { + x: 0, + y: 0 + }; + if (!targetInfo) { + return defaultPosition; + } // If targetInfo is fetched by 'retrieveTargetInfo', + // old tree and new tree are the same tree, + // so the node still exists and we can visit it. - var targetNode = targetInfo.node; - var layout = targetNode.getLayout(); - if (!layout) { - return defaultPosition; - } // Transform coord from local to container. + var targetNode = targetInfo.node; + var layout = targetNode.getLayout(); + if (!layout) { + return defaultPosition; + } // Transform coord from local to container. - var targetCenter = [layout.width / 2, layout.height / 2]; - var node = targetNode; - while (node) { - var nodeLayout = node.getLayout(); - targetCenter[0] += nodeLayout.x; - targetCenter[1] += nodeLayout.y; - node = node.parentNode; - } + var targetCenter = [layout.width / 2, layout.height / 2]; + var node = targetNode; - return { - x: layoutInfo.width / 2 - targetCenter[0], - y: layoutInfo.height / 2 - targetCenter[1] - }; + while (node) { + var nodeLayout = node.getLayout(); + targetCenter[0] += nodeLayout.x; + targetCenter[1] += nodeLayout.y; + node = node.parentNode; + } + + return { + x: layoutInfo.width / 2 - targetCenter[0], + y: layoutInfo.height / 2 - targetCenter[1] + }; } // Mark nodes visible for prunning when visual coding and rendering. // Prunning depends on layout and root position, so we have to do it after layout. function prunning(node, clipRect, viewAbovePath, viewRoot, depth) { - var nodeLayout = node.getLayout(); - var nodeInViewAbovePath = viewAbovePath[depth]; - var isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node; + var nodeLayout = node.getLayout(); + var nodeInViewAbovePath = viewAbovePath[depth]; + var isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node; - if (nodeInViewAbovePath && !isAboveViewRoot || depth === viewAbovePath.length && node !== viewRoot) { - return; - } + if (nodeInViewAbovePath && !isAboveViewRoot || depth === viewAbovePath.length && node !== viewRoot) { + return; + } - node.setLayout({ - // isInView means: viewRoot sub tree + viewAbovePath - isInView: true, - // invisible only means: outside view clip so that the node can not - // see but still layout for animation preparation but not render. - invisible: !isAboveViewRoot && !clipRect.intersect(nodeLayout), - isAboveViewRoot: isAboveViewRoot - }, true); // Transform to child coordinate. + node.setLayout({ + // isInView means: viewRoot sub tree + viewAbovePath + isInView: true, + // invisible only means: outside view clip so that the node can not + // see but still layout for animation preparation but not render. + invisible: !isAboveViewRoot && !clipRect.intersect(nodeLayout), + isAboveViewRoot: isAboveViewRoot + }, true); // Transform to child coordinate. - var childClipRect = new BoundingRect(clipRect.x - nodeLayout.x, clipRect.y - nodeLayout.y, clipRect.width, clipRect.height); - each$4(node.viewChildren || [], function (child) { - prunning(child, childClipRect, viewAbovePath, viewRoot, depth + 1); - }); + var childClipRect = new BoundingRect(clipRect.x - nodeLayout.x, clipRect.y - nodeLayout.y, clipRect.width, clipRect.height); + each$4(node.viewChildren || [], function (child) { + prunning(child, childClipRect, viewAbovePath, viewRoot, depth + 1); + }); } function getUpperLabelHeight(model) { - return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0; + return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0; } function install$c(registers) { - registers.registerSeriesModel(TreemapSeriesModel); - registers.registerChartView(TreemapView); - registers.registerVisual(treemapVisual); - registers.registerLayout(treemapLayout); - installTreemapAction(registers); + registers.registerSeriesModel(TreemapSeriesModel); + registers.registerChartView(TreemapView); + registers.registerVisual(treemapVisual); + registers.registerLayout(treemapLayout); + installTreemapAction(registers); } function categoryFilter(ecModel) { - var legendModels = ecModel.findComponents({ - mainType: 'legend' - }); + var legendModels = ecModel.findComponents({ + mainType: 'legend' + }); - if (!legendModels || !legendModels.length) { - return; - } + if (!legendModels || !legendModels.length) { + return; + } - ecModel.eachSeriesByType('graph', function (graphSeries) { - var categoriesData = graphSeries.getCategoriesData(); - var graph = graphSeries.getGraph(); - var data = graph.data; - var categoryNames = categoriesData.mapArray(categoriesData.getName); - data.filterSelf(function (idx) { - var model = data.getItemModel(idx); - var category = model.getShallow('category'); + ecModel.eachSeriesByType('graph', function (graphSeries) { + var categoriesData = graphSeries.getCategoriesData(); + var graph = graphSeries.getGraph(); + var data = graph.data; + var categoryNames = categoriesData.mapArray(categoriesData.getName); + data.filterSelf(function (idx) { + var model = data.getItemModel(idx); + var category = model.getShallow('category'); - if (category != null) { - if (isNumber(category)) { - category = categoryNames[category]; - } // If in any legend component the status is not selected. + if (category != null) { + if (isNumber(category)) { + category = categoryNames[category]; + } // If in any legend component the status is not selected. - for (var i = 0; i < legendModels.length; i++) { - if (!legendModels[i].isSelected(category)) { - return false; - } - } - } + for (var i = 0; i < legendModels.length; i++) { + if (!legendModels[i].isSelected(category)) { + return false; + } + } + } - return true; - }); + return true; }); + }); } function categoryVisual(ecModel) { - var paletteScope = {}; - ecModel.eachSeriesByType('graph', function (seriesModel) { - var categoriesData = seriesModel.getCategoriesData(); - var data = seriesModel.getData(); - var categoryNameIdxMap = {}; - categoriesData.each(function (idx) { - var name = categoriesData.getName(idx); // Add prefix to avoid conflict with Object.prototype. + var paletteScope = {}; + ecModel.eachSeriesByType('graph', function (seriesModel) { + var categoriesData = seriesModel.getCategoriesData(); + var data = seriesModel.getData(); + var categoryNameIdxMap = {}; + categoriesData.each(function (idx) { + var name = categoriesData.getName(idx); // Add prefix to avoid conflict with Object.prototype. - categoryNameIdxMap['ec-' + name] = idx; - var itemModel = categoriesData.getItemModel(idx); - var style = itemModel.getModel('itemStyle').getItemStyle(); + categoryNameIdxMap['ec-' + name] = idx; + var itemModel = categoriesData.getItemModel(idx); + var style = itemModel.getModel('itemStyle').getItemStyle(); - if (!style.fill) { - // Get color from palette. - style.fill = seriesModel.getColorFromPalette(name, paletteScope); - } + if (!style.fill) { + // Get color from palette. + style.fill = seriesModel.getColorFromPalette(name, paletteScope); + } - categoriesData.setItemVisual(idx, 'style', style); - var symbolVisualList = ['symbol', 'symbolSize', 'symbolKeepAspect']; + categoriesData.setItemVisual(idx, 'style', style); + var symbolVisualList = ['symbol', 'symbolSize', 'symbolKeepAspect']; - for (var i = 0; i < symbolVisualList.length; i++) { - var symbolVisual = itemModel.getShallow(symbolVisualList[i], true); + for (var i = 0; i < symbolVisualList.length; i++) { + var symbolVisual = itemModel.getShallow(symbolVisualList[i], true); - if (symbolVisual != null) { - categoriesData.setItemVisual(idx, symbolVisualList[i], symbolVisual); - } - } - }); // Assign category color to visual + if (symbolVisual != null) { + categoriesData.setItemVisual(idx, symbolVisualList[i], symbolVisual); + } + } + }); // Assign category color to visual - if (categoriesData.count()) { - data.each(function (idx) { - var model = data.getItemModel(idx); - var categoryIdx = model.getShallow('category'); + if (categoriesData.count()) { + data.each(function (idx) { + var model = data.getItemModel(idx); + var categoryIdx = model.getShallow('category'); - if (categoryIdx != null) { - if (isString(categoryIdx)) { - categoryIdx = categoryNameIdxMap['ec-' + categoryIdx]; - } + if (categoryIdx != null) { + if (isString(categoryIdx)) { + categoryIdx = categoryNameIdxMap['ec-' + categoryIdx]; + } - var categoryStyle = categoriesData.getItemVisual(categoryIdx, 'style'); - var style = data.ensureUniqueItemVisual(idx, 'style'); - extend(style, categoryStyle); - var visualList = ['symbol', 'symbolSize', 'symbolKeepAspect']; + var categoryStyle = categoriesData.getItemVisual(categoryIdx, 'style'); + var style = data.ensureUniqueItemVisual(idx, 'style'); + extend(style, categoryStyle); + var visualList = ['symbol', 'symbolSize', 'symbolKeepAspect']; - for (var i = 0; i < visualList.length; i++) { - data.setItemVisual(idx, visualList[i], categoriesData.getItemVisual(categoryIdx, visualList[i])); - } - } - }); + for (var i = 0; i < visualList.length; i++) { + data.setItemVisual(idx, visualList[i], categoriesData.getItemVisual(categoryIdx, visualList[i])); + } } - }); + }); + } + }); } function normalize$2(a) { - if (!(a instanceof Array)) { - a = [a, a]; - } + if (!(a instanceof Array)) { + a = [a, a]; + } - return a; + return a; } function graphEdgeVisual(ecModel) { - ecModel.eachSeriesByType('graph', function (seriesModel) { - var graph = seriesModel.getGraph(); - var edgeData = seriesModel.getEdgeData(); - var symbolType = normalize$2(seriesModel.get('edgeSymbol')); - var symbolSize = normalize$2(seriesModel.get('edgeSymbolSize')); // const colorQuery = ['lineStyle', 'color'] as const; - // const opacityQuery = ['lineStyle', 'opacity'] as const; - - edgeData.setVisual('fromSymbol', symbolType && symbolType[0]); - edgeData.setVisual('toSymbol', symbolType && symbolType[1]); - edgeData.setVisual('fromSymbolSize', symbolSize && symbolSize[0]); - edgeData.setVisual('toSymbolSize', symbolSize && symbolSize[1]); - edgeData.setVisual('style', seriesModel.getModel('lineStyle').getLineStyle()); - edgeData.each(function (idx) { - var itemModel = edgeData.getItemModel(idx); - var edge = graph.getEdgeByIndex(idx); - var symbolType = normalize$2(itemModel.getShallow('symbol', true)); - var symbolSize = normalize$2(itemModel.getShallow('symbolSize', true)); // Edge visual must after node visual - - var style = itemModel.getModel('lineStyle').getLineStyle(); - var existsStyle = edgeData.ensureUniqueItemVisual(idx, 'style'); - extend(existsStyle, style); - - switch (existsStyle.stroke) { - case 'source': - { - var nodeStyle = edge.node1.getVisual('style'); - existsStyle.stroke = nodeStyle && nodeStyle.fill; - break; - } + ecModel.eachSeriesByType('graph', function (seriesModel) { + var graph = seriesModel.getGraph(); + var edgeData = seriesModel.getEdgeData(); + var symbolType = normalize$2(seriesModel.get('edgeSymbol')); + var symbolSize = normalize$2(seriesModel.get('edgeSymbolSize')); // const colorQuery = ['lineStyle', 'color'] as const; + // const opacityQuery = ['lineStyle', 'opacity'] as const; + + edgeData.setVisual('fromSymbol', symbolType && symbolType[0]); + edgeData.setVisual('toSymbol', symbolType && symbolType[1]); + edgeData.setVisual('fromSymbolSize', symbolSize && symbolSize[0]); + edgeData.setVisual('toSymbolSize', symbolSize && symbolSize[1]); + edgeData.setVisual('style', seriesModel.getModel('lineStyle').getLineStyle()); + edgeData.each(function (idx) { + var itemModel = edgeData.getItemModel(idx); + var edge = graph.getEdgeByIndex(idx); + var symbolType = normalize$2(itemModel.getShallow('symbol', true)); + var symbolSize = normalize$2(itemModel.getShallow('symbolSize', true)); // Edge visual must after node visual + + var style = itemModel.getModel('lineStyle').getLineStyle(); + var existsStyle = edgeData.ensureUniqueItemVisual(idx, 'style'); + extend(existsStyle, style); + + switch (existsStyle.stroke) { + case 'source': + { + var nodeStyle = edge.node1.getVisual('style'); + existsStyle.stroke = nodeStyle && nodeStyle.fill; + break; + } - case 'target': - { - var nodeStyle = edge.node2.getVisual('style'); - existsStyle.stroke = nodeStyle && nodeStyle.fill; - break; - } - } + case 'target': + { + var nodeStyle = edge.node2.getVisual('style'); + existsStyle.stroke = nodeStyle && nodeStyle.fill; + break; + } + } - symbolType[0] && edge.setVisual('fromSymbol', symbolType[0]); - symbolType[1] && edge.setVisual('toSymbol', symbolType[1]); - symbolSize[0] && edge.setVisual('fromSymbolSize', symbolSize[0]); - symbolSize[1] && edge.setVisual('toSymbolSize', symbolSize[1]); - }); + symbolType[0] && edge.setVisual('fromSymbol', symbolType[0]); + symbolType[1] && edge.setVisual('toSymbol', symbolType[1]); + symbolSize[0] && edge.setVisual('fromSymbolSize', symbolSize[0]); + symbolSize[1] && edge.setVisual('toSymbolSize', symbolSize[1]); }); + }); } var KEY_DELIMITER = '-->'; @@ -58929,7 +58929,7 @@ */ var getAutoCurvenessParams = function (seriesModel) { - return seriesModel.get('autoCurveness') || null; + return seriesModel.get('autoCurveness') || null; }; /** * Generate a list of edge curvatures, 20 is the default @@ -58940,31 +58940,31 @@ var createCurveness = function (seriesModel, appendLength) { - var autoCurvenessParmas = getAutoCurvenessParams(seriesModel); - var length = 20; - var curvenessList = []; // handler the function set - - if (isNumber(autoCurvenessParmas)) { - length = autoCurvenessParmas; - } else if (isArray(autoCurvenessParmas)) { - seriesModel.__curvenessList = autoCurvenessParmas; - return; - } // append length + var autoCurvenessParmas = getAutoCurvenessParams(seriesModel); + var length = 20; + var curvenessList = []; // handler the function set + + if (isNumber(autoCurvenessParmas)) { + length = autoCurvenessParmas; + } else if (isArray(autoCurvenessParmas)) { + seriesModel.__curvenessList = autoCurvenessParmas; + return; + } // append length - if (appendLength > length) { - length = appendLength; - } // make sure the length is even + if (appendLength > length) { + length = appendLength; + } // make sure the length is even - var len = length % 2 ? length + 2 : length + 3; - curvenessList = []; + var len = length % 2 ? length + 2 : length + 3; + curvenessList = []; - for (var i = 0; i < len; i++) { - curvenessList.push((i % 2 ? i + 1 : i) / 10 * (i % 2 ? -1 : 1)); - } + for (var i = 0; i < len; i++) { + curvenessList.push((i % 2 ? i + 1 : i) / 10 * (i % 2 ? -1 : 1)); + } - seriesModel.__curvenessList = curvenessList; + seriesModel.__curvenessList = curvenessList; }; /** * Create different cache key data in the positive and negative directions, in order to set the curvature later @@ -58976,9 +58976,9 @@ var getKeyOfEdges = function (n1, n2, seriesModel) { - var source = [n1.id, n1.dataIndex].join('.'); - var target = [n2.id, n2.dataIndex].join('.'); - return [seriesModel.uid, source, target].join(KEY_DELIMITER); + var source = [n1.id, n1.dataIndex].join('.'); + var target = [n2.id, n2.dataIndex].join('.'); + return [seriesModel.uid, source, target].join(KEY_DELIMITER); }; /** * get opposite key @@ -58988,8 +58988,8 @@ var getOppositeKey = function (key) { - var keys = key.split(KEY_DELIMITER); - return [keys[0], keys[2], keys[1]].join(KEY_DELIMITER); + var keys = key.split(KEY_DELIMITER); + return [keys[0], keys[2], keys[1]].join(KEY_DELIMITER); }; /** * get edgeMap with key @@ -58999,8 +58999,8 @@ var getEdgeFromMap = function (edge, seriesModel) { - var key = getKeyOfEdges(edge.node1, edge.node2, seriesModel); - return seriesModel.__edgeMap[key]; + var key = getKeyOfEdges(edge.node1, edge.node2, seriesModel); + return seriesModel.__edgeMap[key]; }; /** * calculate all cases total length @@ -59011,9 +59011,9 @@ var getTotalLengthBetweenNodes = function (edge, seriesModel) { - var len = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node1, edge.node2, seriesModel), seriesModel); - var lenV = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node2, edge.node1, seriesModel), seriesModel); - return len + lenV; + var len = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node1, edge.node2, seriesModel), seriesModel); + var lenV = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node2, edge.node1, seriesModel), seriesModel); + return len + lenV; }; /** * @@ -59022,8 +59022,8 @@ var getEdgeMapLengthWithKey = function (key, seriesModel) { - var edgeMap = seriesModel.__edgeMap; - return edgeMap[key] ? edgeMap[key].length : 0; + var edgeMap = seriesModel.__edgeMap; + return edgeMap[key] ? edgeMap[key].length : 0; }; /** * Count the number of edges between the same two points, used to obtain the curvature table and the parity of the edge @@ -59033,14 +59033,14 @@ function initCurvenessList(seriesModel) { - if (!getAutoCurvenessParams(seriesModel)) { - return; - } + if (!getAutoCurvenessParams(seriesModel)) { + return; + } - seriesModel.__curvenessList = []; - seriesModel.__edgeMap = {}; // calc the array of curveness List + seriesModel.__curvenessList = []; + seriesModel.__edgeMap = {}; // calc the array of curveness List - createCurveness(seriesModel); + createCurveness(seriesModel); } /** * set edgeMap with key @@ -59051,23 +59051,23 @@ */ function createEdgeMapForCurveness(n1, n2, seriesModel, index) { - if (!getAutoCurvenessParams(seriesModel)) { - return; - } + if (!getAutoCurvenessParams(seriesModel)) { + return; + } - var key = getKeyOfEdges(n1, n2, seriesModel); - var edgeMap = seriesModel.__edgeMap; - var oppositeEdges = edgeMap[getOppositeKey(key)]; // set direction + var key = getKeyOfEdges(n1, n2, seriesModel); + var edgeMap = seriesModel.__edgeMap; + var oppositeEdges = edgeMap[getOppositeKey(key)]; // set direction - if (edgeMap[key] && !oppositeEdges) { - edgeMap[key].isForward = true; - } else if (oppositeEdges && edgeMap[key]) { - oppositeEdges.isForward = true; - edgeMap[key].isForward = false; - } + if (edgeMap[key] && !oppositeEdges) { + edgeMap[key].isForward = true; + } else if (oppositeEdges && edgeMap[key]) { + oppositeEdges.isForward = true; + edgeMap[key].isForward = false; + } - edgeMap[key] = edgeMap[key] || []; - edgeMap[key].push(index); + edgeMap[key] = edgeMap[key] || []; + edgeMap[key].push(index); } /** * get curvature for edge @@ -59077,131 +59077,131 @@ */ function getCurvenessForEdge(edge, seriesModel, index, needReverse) { - var autoCurvenessParams = getAutoCurvenessParams(seriesModel); - var isArrayParam = isArray(autoCurvenessParams); + var autoCurvenessParams = getAutoCurvenessParams(seriesModel); + var isArrayParam = isArray(autoCurvenessParams); - if (!autoCurvenessParams) { - return null; - } + if (!autoCurvenessParams) { + return null; + } - var edgeArray = getEdgeFromMap(edge, seriesModel); + var edgeArray = getEdgeFromMap(edge, seriesModel); - if (!edgeArray) { - return null; - } + if (!edgeArray) { + return null; + } - var edgeIndex = -1; + var edgeIndex = -1; - for (var i = 0; i < edgeArray.length; i++) { - if (edgeArray[i] === index) { - edgeIndex = i; - break; - } - } // if totalLen is Longer createCurveness + for (var i = 0; i < edgeArray.length; i++) { + if (edgeArray[i] === index) { + edgeIndex = i; + break; + } + } // if totalLen is Longer createCurveness - var totalLen = getTotalLengthBetweenNodes(edge, seriesModel); - createCurveness(seriesModel, totalLen); - edge.lineStyle = edge.lineStyle || {}; // if is opposite edge, must set curvenss to opposite number + var totalLen = getTotalLengthBetweenNodes(edge, seriesModel); + createCurveness(seriesModel, totalLen); + edge.lineStyle = edge.lineStyle || {}; // if is opposite edge, must set curvenss to opposite number - var curKey = getKeyOfEdges(edge.node1, edge.node2, seriesModel); - var curvenessList = seriesModel.__curvenessList; // if pass array no need parity + var curKey = getKeyOfEdges(edge.node1, edge.node2, seriesModel); + var curvenessList = seriesModel.__curvenessList; // if pass array no need parity - var parityCorrection = isArrayParam ? 0 : totalLen % 2 ? 0 : 1; + var parityCorrection = isArrayParam ? 0 : totalLen % 2 ? 0 : 1; - if (!edgeArray.isForward) { - // the opposite edge show outside - var oppositeKey = getOppositeKey(curKey); - var len = getEdgeMapLengthWithKey(oppositeKey, seriesModel); - var resValue = curvenessList[edgeIndex + len + parityCorrection]; // isNeedReverse, simple, force type need reverse the curveness in the junction of the forword and the opposite + if (!edgeArray.isForward) { + // the opposite edge show outside + var oppositeKey = getOppositeKey(curKey); + var len = getEdgeMapLengthWithKey(oppositeKey, seriesModel); + var resValue = curvenessList[edgeIndex + len + parityCorrection]; // isNeedReverse, simple, force type need reverse the curveness in the junction of the forword and the opposite - if (needReverse) { - // set as array may make the parity handle with the len of opposite - if (isArrayParam) { - if (autoCurvenessParams && autoCurvenessParams[0] === 0) { - return (len + parityCorrection) % 2 ? resValue : -resValue; - } else { - return ((len % 2 ? 0 : 1) + parityCorrection) % 2 ? resValue : -resValue; - } - } else { - return (len + parityCorrection) % 2 ? resValue : -resValue; - } + if (needReverse) { + // set as array may make the parity handle with the len of opposite + if (isArrayParam) { + if (autoCurvenessParams && autoCurvenessParams[0] === 0) { + return (len + parityCorrection) % 2 ? resValue : -resValue; } else { - return curvenessList[edgeIndex + len + parityCorrection]; + return ((len % 2 ? 0 : 1) + parityCorrection) % 2 ? resValue : -resValue; } + } else { + return (len + parityCorrection) % 2 ? resValue : -resValue; + } } else { - return curvenessList[parityCorrection + edgeIndex]; + return curvenessList[edgeIndex + len + parityCorrection]; } + } else { + return curvenessList[parityCorrection + edgeIndex]; + } } function simpleLayout(seriesModel) { - var coordSys = seriesModel.coordinateSystem; + var coordSys = seriesModel.coordinateSystem; - if (coordSys && coordSys.type !== 'view') { - return; - } + if (coordSys && coordSys.type !== 'view') { + return; + } - var graph = seriesModel.getGraph(); - graph.eachNode(function (node) { - var model = node.getModel(); - node.setLayout([+model.get('x'), +model.get('y')]); - }); - simpleLayoutEdge(graph, seriesModel); + var graph = seriesModel.getGraph(); + graph.eachNode(function (node) { + var model = node.getModel(); + node.setLayout([+model.get('x'), +model.get('y')]); + }); + simpleLayoutEdge(graph, seriesModel); } function simpleLayoutEdge(graph, seriesModel) { - graph.eachEdge(function (edge, index) { - var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, seriesModel, index, true), 0); - var p1 = clone$1(edge.node1.getLayout()); - var p2 = clone$1(edge.node2.getLayout()); - var points = [p1, p2]; + graph.eachEdge(function (edge, index) { + var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, seriesModel, index, true), 0); + var p1 = clone$1(edge.node1.getLayout()); + var p2 = clone$1(edge.node2.getLayout()); + var points = [p1, p2]; - if (+curveness) { - points.push([(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness]); - } + if (+curveness) { + points.push([(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness]); + } - edge.setLayout(points); - }); + edge.setLayout(points); + }); } function graphSimpleLayout(ecModel, api) { - ecModel.eachSeriesByType('graph', function (seriesModel) { - var layout = seriesModel.get('layout'); - var coordSys = seriesModel.coordinateSystem; - - if (coordSys && coordSys.type !== 'view') { - var data_1 = seriesModel.getData(); - var dimensions_1 = []; - each(coordSys.dimensions, function (coordDim) { - dimensions_1 = dimensions_1.concat(data_1.mapDimensionsAll(coordDim)); - }); + ecModel.eachSeriesByType('graph', function (seriesModel) { + var layout = seriesModel.get('layout'); + var coordSys = seriesModel.coordinateSystem; - for (var dataIndex = 0; dataIndex < data_1.count(); dataIndex++) { - var value = []; - var hasValue = false; + if (coordSys && coordSys.type !== 'view') { + var data_1 = seriesModel.getData(); + var dimensions_1 = []; + each(coordSys.dimensions, function (coordDim) { + dimensions_1 = dimensions_1.concat(data_1.mapDimensionsAll(coordDim)); + }); - for (var i = 0; i < dimensions_1.length; i++) { - var val = data_1.get(dimensions_1[i], dataIndex); + for (var dataIndex = 0; dataIndex < data_1.count(); dataIndex++) { + var value = []; + var hasValue = false; - if (!isNaN(val)) { - hasValue = true; - } + for (var i = 0; i < dimensions_1.length; i++) { + var val = data_1.get(dimensions_1[i], dataIndex); - value.push(val); - } + if (!isNaN(val)) { + hasValue = true; + } - if (hasValue) { - data_1.setItemLayout(dataIndex, coordSys.dataToPoint(value)); - } else { - // Also {Array.}, not undefined to avoid if...else... statement - data_1.setItemLayout(dataIndex, [NaN, NaN]); - } - } + value.push(val); + } - simpleLayoutEdge(data_1.graph, seriesModel); - } else if (!layout || layout === 'none') { - simpleLayout(seriesModel); + if (hasValue) { + data_1.setItemLayout(dataIndex, coordSys.dataToPoint(value)); + } else { + // Also {Array.}, not undefined to avoid if...else... statement + data_1.setItemLayout(dataIndex, [NaN, NaN]); } - }); + } + + simpleLayoutEdge(data_1.graph, seriesModel); + } else if (!layout || layout === 'none') { + simpleLayout(seriesModel); + } + }); } /* @@ -59247,27 +59247,27 @@ * under the License. */ function getNodeGlobalScale(seriesModel) { - var coordSys = seriesModel.coordinateSystem; + var coordSys = seriesModel.coordinateSystem; - if (coordSys.type !== 'view') { - return 1; - } + if (coordSys.type !== 'view') { + return 1; + } - var nodeScaleRatio = seriesModel.option.nodeScaleRatio; - var groupZoom = coordSys.scaleX; // Scale node when zoom changes + var nodeScaleRatio = seriesModel.option.nodeScaleRatio; + var groupZoom = coordSys.scaleX; // Scale node when zoom changes - var roamZoom = coordSys.getZoom(); - var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1; - return nodeScale / groupZoom; + var roamZoom = coordSys.getZoom(); + var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1; + return nodeScale / groupZoom; } function getSymbolSize(node) { - var symbolSize = node.getVisual('symbolSize'); + var symbolSize = node.getVisual('symbolSize'); - if (symbolSize instanceof Array) { - symbolSize = (symbolSize[0] + symbolSize[1]) / 2; - } + if (symbolSize instanceof Array) { + symbolSize = (symbolSize[0] + symbolSize[1]) / 2; + } - return +symbolSize; + return +symbolSize; } var PI$6 = Math.PI; @@ -59293,93 +59293,93 @@ */ function circularLayout(seriesModel, basedOn) { - var coordSys = seriesModel.coordinateSystem; + var coordSys = seriesModel.coordinateSystem; - if (coordSys && coordSys.type !== 'view') { - return; - } + if (coordSys && coordSys.type !== 'view') { + return; + } + + var rect = coordSys.getBoundingRect(); + var nodeData = seriesModel.getData(); + var graph = nodeData.graph; + var cx = rect.width / 2 + rect.x; + var cy = rect.height / 2 + rect.y; + var r = Math.min(rect.width, rect.height) / 2; + var count = nodeData.count(); + nodeData.setLayout({ + cx: cx, + cy: cy + }); + + if (!count) { + return; + } - var rect = coordSys.getBoundingRect(); - var nodeData = seriesModel.getData(); - var graph = nodeData.graph; - var cx = rect.width / 2 + rect.x; - var cy = rect.height / 2 + rect.y; - var r = Math.min(rect.width, rect.height) / 2; - var count = nodeData.count(); - nodeData.setLayout({ - cx: cx, - cy: cy - }); + _layoutNodesBasedOn[basedOn](seriesModel, graph, nodeData, r, cx, cy, count); - if (!count) { - return; - } + graph.eachEdge(function (edge, index) { + var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), getCurvenessForEdge(edge, seriesModel, index), 0); + var p1 = clone$1(edge.node1.getLayout()); + var p2 = clone$1(edge.node2.getLayout()); + var cp1; + var x12 = (p1[0] + p2[0]) / 2; + var y12 = (p1[1] + p2[1]) / 2; - _layoutNodesBasedOn[basedOn](seriesModel, graph, nodeData, r, cx, cy, count); + if (+curveness) { + curveness *= 3; + cp1 = [cx * curveness + x12 * (1 - curveness), cy * curveness + y12 * (1 - curveness)]; + } - graph.eachEdge(function (edge, index) { - var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), getCurvenessForEdge(edge, seriesModel, index), 0); - var p1 = clone$1(edge.node1.getLayout()); - var p2 = clone$1(edge.node2.getLayout()); - var cp1; - var x12 = (p1[0] + p2[0]) / 2; - var y12 = (p1[1] + p2[1]) / 2; + edge.setLayout([p1, p2, cp1]); + }); + } + var _layoutNodesBasedOn = { + value: function (seriesModel, graph, nodeData, r, cx, cy, count) { + var angle = 0; + var sum = nodeData.getSum('value'); + var unitAngle = Math.PI * 2 / (sum || count); + graph.eachNode(function (node) { + var value = node.getValue('value'); + var radianHalf = unitAngle * (sum ? value : 1) / 2; + angle += radianHalf; + node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]); + angle += radianHalf; + }); + }, + symbolSize: function (seriesModel, graph, nodeData, r, cx, cy, count) { + var sumRadian = 0; + _symbolRadiansHalf.length = count; + var nodeScale = getNodeGlobalScale(seriesModel); + graph.eachNode(function (node) { + var symbolSize = getSymbolSize(node); // Normally this case will not happen, but we still add + // some the defensive code (2px is an arbitrary value). - if (+curveness) { - curveness *= 3; - cp1 = [cx * curveness + x12 * (1 - curveness), cy * curveness + y12 * (1 - curveness)]; - } + isNaN(symbolSize) && (symbolSize = 2); + symbolSize < 0 && (symbolSize = 0); + symbolSize *= nodeScale; + var symbolRadianHalf = Math.asin(symbolSize / 2 / r); // when `symbolSize / 2` is bigger than `r`. - edge.setLayout([p1, p2, cp1]); + isNaN(symbolRadianHalf) && (symbolRadianHalf = PI$6 / 2); + _symbolRadiansHalf[node.dataIndex] = symbolRadianHalf; + sumRadian += symbolRadianHalf * 2; }); - } - var _layoutNodesBasedOn = { - value: function (seriesModel, graph, nodeData, r, cx, cy, count) { - var angle = 0; - var sum = nodeData.getSum('value'); - var unitAngle = Math.PI * 2 / (sum || count); - graph.eachNode(function (node) { - var value = node.getValue('value'); - var radianHalf = unitAngle * (sum ? value : 1) / 2; - angle += radianHalf; - node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]); - angle += radianHalf; - }); - }, - symbolSize: function (seriesModel, graph, nodeData, r, cx, cy, count) { - var sumRadian = 0; - _symbolRadiansHalf.length = count; - var nodeScale = getNodeGlobalScale(seriesModel); - graph.eachNode(function (node) { - var symbolSize = getSymbolSize(node); // Normally this case will not happen, but we still add - // some the defensive code (2px is an arbitrary value). - - isNaN(symbolSize) && (symbolSize = 2); - symbolSize < 0 && (symbolSize = 0); - symbolSize *= nodeScale; - var symbolRadianHalf = Math.asin(symbolSize / 2 / r); // when `symbolSize / 2` is bigger than `r`. - - isNaN(symbolRadianHalf) && (symbolRadianHalf = PI$6 / 2); - _symbolRadiansHalf[node.dataIndex] = symbolRadianHalf; - sumRadian += symbolRadianHalf * 2; - }); - var halfRemainRadian = (2 * PI$6 - sumRadian) / count / 2; - var angle = 0; - graph.eachNode(function (node) { - var radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex]; - angle += radianHalf; - node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]); - angle += radianHalf; - }); - } + var halfRemainRadian = (2 * PI$6 - sumRadian) / count / 2; + var angle = 0; + graph.eachNode(function (node) { + var radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex]; + angle += radianHalf; + node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]); + angle += radianHalf; + }); + } }; function graphCircularLayout(ecModel) { - ecModel.eachSeriesByType('graph', function (seriesModel) { - if (seriesModel.get('layout') === 'circular') { - circularLayout(seriesModel, 'symbolSize'); - } - }); + ecModel.eachSeriesByType('graph', function (seriesModel) { + if (seriesModel.get('layout') === 'circular') { + circularLayout(seriesModel, 'symbolSize'); + } + }); } var scaleAndAdd$1 = scaleAndAdd; // function adjacentNode(n, e) { @@ -59387,426 +59387,426 @@ // } function forceLayout(inNodes, inEdges, opts) { - var nodes = inNodes; - var edges = inEdges; - var rect = opts.rect; - var width = rect.width; - var height = rect.height; - var center = [rect.x + width / 2, rect.y + height / 2]; // let scale = opts.scale || 1; - - var gravity = opts.gravity == null ? 0.1 : opts.gravity; // for (let i = 0; i < edges.length; i++) { - // let e = edges[i]; - // let n1 = e.n1; - // let n2 = e.n2; - // n1.edges = n1.edges || []; - // n2.edges = n2.edges || []; - // n1.edges.push(e); - // n2.edges.push(e); - // } - // Init position - - for (var i = 0; i < nodes.length; i++) { - var n = nodes[i]; - - if (!n.p) { - n.p = create(width * (Math.random() - 0.5) + center[0], height * (Math.random() - 0.5) + center[1]); - } - - n.pp = clone$1(n.p); - n.edges = null; - } // Formula in 'Graph Drawing by Force-directed Placement' - // let k = scale * Math.sqrt(width * height / nodes.length); - // let k2 = k * k; - - - var initialFriction = opts.friction == null ? 0.6 : opts.friction; - var friction = initialFriction; - var beforeStepCallback; - var afterStepCallback; - return { - warmUp: function () { - friction = initialFriction * 0.8; - }, - setFixed: function (idx) { - nodes[idx].fixed = true; - }, - setUnfixed: function (idx) { - nodes[idx].fixed = false; - }, - - /** - * Before step hook - */ - beforeStep: function (cb) { - beforeStepCallback = cb; - }, + var nodes = inNodes; + var edges = inEdges; + var rect = opts.rect; + var width = rect.width; + var height = rect.height; + var center = [rect.x + width / 2, rect.y + height / 2]; // let scale = opts.scale || 1; + + var gravity = opts.gravity == null ? 0.1 : opts.gravity; // for (let i = 0; i < edges.length; i++) { + // let e = edges[i]; + // let n1 = e.n1; + // let n2 = e.n2; + // n1.edges = n1.edges || []; + // n2.edges = n2.edges || []; + // n1.edges.push(e); + // n2.edges.push(e); + // } + // Init position + + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + + if (!n.p) { + n.p = create(width * (Math.random() - 0.5) + center[0], height * (Math.random() - 0.5) + center[1]); + } + + n.pp = clone$1(n.p); + n.edges = null; + } // Formula in 'Graph Drawing by Force-directed Placement' + // let k = scale * Math.sqrt(width * height / nodes.length); + // let k2 = k * k; + + + var initialFriction = opts.friction == null ? 0.6 : opts.friction; + var friction = initialFriction; + var beforeStepCallback; + var afterStepCallback; + return { + warmUp: function () { + friction = initialFriction * 0.8; + }, + setFixed: function (idx) { + nodes[idx].fixed = true; + }, + setUnfixed: function (idx) { + nodes[idx].fixed = false; + }, - /** - * After step hook - */ - afterStep: function (cb) { - afterStepCallback = cb; - }, + /** + * Before step hook + */ + beforeStep: function (cb) { + beforeStepCallback = cb; + }, - /** - * Some formulas were originally copied from "d3.js" - * https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/layout/force.js - * with some modifications made for this project. - * See the license statement at the head of this file. - */ - step: function (cb) { - beforeStepCallback && beforeStepCallback(nodes, edges); - var v12 = []; - var nLen = nodes.length; + /** + * After step hook + */ + afterStep: function (cb) { + afterStepCallback = cb; + }, - for (var i = 0; i < edges.length; i++) { - var e = edges[i]; + /** + * Some formulas were originally copied from "d3.js" + * https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/layout/force.js + * with some modifications made for this project. + * See the license statement at the head of this file. + */ + step: function (cb) { + beforeStepCallback && beforeStepCallback(nodes, edges); + var v12 = []; + var nLen = nodes.length; - if (e.ignoreForceLayout) { - continue; - } + for (var i = 0; i < edges.length; i++) { + var e = edges[i]; - var n1 = e.n1; - var n2 = e.n2; - sub(v12, n2.p, n1.p); - var d = len(v12) - e.d; - var w = n2.w / (n1.w + n2.w); + if (e.ignoreForceLayout) { + continue; + } - if (isNaN(w)) { - w = 0; - } + var n1 = e.n1; + var n2 = e.n2; + sub(v12, n2.p, n1.p); + var d = len(v12) - e.d; + var w = n2.w / (n1.w + n2.w); - normalize(v12, v12); - !n1.fixed && scaleAndAdd$1(n1.p, n1.p, v12, w * d * friction); - !n2.fixed && scaleAndAdd$1(n2.p, n2.p, v12, -(1 - w) * d * friction); - } // Gravity + if (isNaN(w)) { + w = 0; + } + normalize(v12, v12); + !n1.fixed && scaleAndAdd$1(n1.p, n1.p, v12, w * d * friction); + !n2.fixed && scaleAndAdd$1(n2.p, n2.p, v12, -(1 - w) * d * friction); + } // Gravity - for (var i = 0; i < nLen; i++) { - var n = nodes[i]; - if (!n.fixed) { - sub(v12, center, n.p); // let d = vec2.len(v12); - // vec2.scale(v12, v12, 1 / d); - // let gravityFactor = gravity; + for (var i = 0; i < nLen; i++) { + var n = nodes[i]; - scaleAndAdd$1(n.p, n.p, v12, gravity * friction); - } - } // Repulsive - // PENDING + if (!n.fixed) { + sub(v12, center, n.p); // let d = vec2.len(v12); + // vec2.scale(v12, v12, 1 / d); + // let gravityFactor = gravity; + scaleAndAdd$1(n.p, n.p, v12, gravity * friction); + } + } // Repulsive + // PENDING - for (var i = 0; i < nLen; i++) { - var n1 = nodes[i]; - for (var j = i + 1; j < nLen; j++) { - var n2 = nodes[j]; - sub(v12, n2.p, n1.p); - var d = len(v12); + for (var i = 0; i < nLen; i++) { + var n1 = nodes[i]; - if (d === 0) { - // Random repulse - set(v12, Math.random() - 0.5, Math.random() - 0.5); - d = 1; - } + for (var j = i + 1; j < nLen; j++) { + var n2 = nodes[j]; + sub(v12, n2.p, n1.p); + var d = len(v12); - var repFact = (n1.rep + n2.rep) / d / d; - !n1.fixed && scaleAndAdd$1(n1.pp, n1.pp, v12, repFact); - !n2.fixed && scaleAndAdd$1(n2.pp, n2.pp, v12, -repFact); - } - } + if (d === 0) { + // Random repulse + set(v12, Math.random() - 0.5, Math.random() - 0.5); + d = 1; + } - var v = []; + var repFact = (n1.rep + n2.rep) / d / d; + !n1.fixed && scaleAndAdd$1(n1.pp, n1.pp, v12, repFact); + !n2.fixed && scaleAndAdd$1(n2.pp, n2.pp, v12, -repFact); + } + } - for (var i = 0; i < nLen; i++) { - var n = nodes[i]; + var v = []; - if (!n.fixed) { - sub(v, n.p, n.pp); - scaleAndAdd$1(n.p, n.p, v, friction); - copy(n.pp, n.p); - } - } + for (var i = 0; i < nLen; i++) { + var n = nodes[i]; - friction = friction * 0.992; - var finished = friction < 0.01; - afterStepCallback && afterStepCallback(nodes, edges, finished); - cb && cb(finished); + if (!n.fixed) { + sub(v, n.p, n.pp); + scaleAndAdd$1(n.p, n.p, v, friction); + copy(n.pp, n.p); } - }; + } + + friction = friction * 0.992; + var finished = friction < 0.01; + afterStepCallback && afterStepCallback(nodes, edges, finished); + cb && cb(finished); + } + }; } function graphForceLayout(ecModel) { - ecModel.eachSeriesByType('graph', function (graphSeries) { - var coordSys = graphSeries.coordinateSystem; - - if (coordSys && coordSys.type !== 'view') { - return; - } - - if (graphSeries.get('layout') === 'force') { - var preservedPoints_1 = graphSeries.preservedPoints || {}; - var graph_1 = graphSeries.getGraph(); - var nodeData_1 = graph_1.data; - var edgeData = graph_1.edgeData; - var forceModel = graphSeries.getModel('force'); - var initLayout = forceModel.get('initLayout'); + ecModel.eachSeriesByType('graph', function (graphSeries) { + var coordSys = graphSeries.coordinateSystem; - if (graphSeries.preservedPoints) { - nodeData_1.each(function (idx) { - var id = nodeData_1.getId(idx); - nodeData_1.setItemLayout(idx, preservedPoints_1[id] || [NaN, NaN]); - }); - } else if (!initLayout || initLayout === 'none') { - simpleLayout(graphSeries); - } else if (initLayout === 'circular') { - circularLayout(graphSeries, 'value'); - } - - var nodeDataExtent_1 = nodeData_1.getDataExtent('value'); - var edgeDataExtent_1 = edgeData.getDataExtent('value'); // let edgeDataExtent = edgeData.getDataExtent('value'); - - var repulsion = forceModel.get('repulsion'); - var edgeLength = forceModel.get('edgeLength'); - var repulsionArr_1 = isArray(repulsion) ? repulsion : [repulsion, repulsion]; - var edgeLengthArr_1 = isArray(edgeLength) ? edgeLength : [edgeLength, edgeLength]; // Larger value has smaller length - - edgeLengthArr_1 = [edgeLengthArr_1[1], edgeLengthArr_1[0]]; - var nodes_1 = nodeData_1.mapArray('value', function (value, idx) { - var point = nodeData_1.getItemLayout(idx); - var rep = linearMap(value, nodeDataExtent_1, repulsionArr_1); - - if (isNaN(rep)) { - rep = (repulsionArr_1[0] + repulsionArr_1[1]) / 2; - } + if (coordSys && coordSys.type !== 'view') { + return; + } - return { - w: rep, - rep: rep, - fixed: nodeData_1.getItemModel(idx).get('fixed'), - p: !point || isNaN(point[0]) || isNaN(point[1]) ? null : point - }; - }); - var edges = edgeData.mapArray('value', function (value, idx) { - var edge = graph_1.getEdgeByIndex(idx); - var d = linearMap(value, edgeDataExtent_1, edgeLengthArr_1); + if (graphSeries.get('layout') === 'force') { + var preservedPoints_1 = graphSeries.preservedPoints || {}; + var graph_1 = graphSeries.getGraph(); + var nodeData_1 = graph_1.data; + var edgeData = graph_1.edgeData; + var forceModel = graphSeries.getModel('force'); + var initLayout = forceModel.get('initLayout'); - if (isNaN(d)) { - d = (edgeLengthArr_1[0] + edgeLengthArr_1[1]) / 2; - } + if (graphSeries.preservedPoints) { + nodeData_1.each(function (idx) { + var id = nodeData_1.getId(idx); + nodeData_1.setItemLayout(idx, preservedPoints_1[id] || [NaN, NaN]); + }); + } else if (!initLayout || initLayout === 'none') { + simpleLayout(graphSeries); + } else if (initLayout === 'circular') { + circularLayout(graphSeries, 'value'); + } - var edgeModel = edge.getModel(); - var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, graphSeries, idx, true), 0); - return { - n1: nodes_1[edge.node1.dataIndex], - n2: nodes_1[edge.node2.dataIndex], - d: d, - curveness: curveness, - ignoreForceLayout: edgeModel.get('ignoreForceLayout') - }; - }); // let coordSys = graphSeries.coordinateSystem; + var nodeDataExtent_1 = nodeData_1.getDataExtent('value'); + var edgeDataExtent_1 = edgeData.getDataExtent('value'); // let edgeDataExtent = edgeData.getDataExtent('value'); - var rect = coordSys.getBoundingRect(); - var forceInstance = forceLayout(nodes_1, edges, { - rect: rect, - gravity: forceModel.get('gravity'), - friction: forceModel.get('friction') - }); - forceInstance.beforeStep(function (nodes, edges) { - for (var i = 0, l = nodes.length; i < l; i++) { - if (nodes[i].fixed) { - // Write back to layout instance - copy(nodes[i].p, graph_1.getNodeByIndex(i).getLayout()); - } - } - }); - forceInstance.afterStep(function (nodes, edges, stopped) { - for (var i = 0, l = nodes.length; i < l; i++) { - if (!nodes[i].fixed) { - graph_1.getNodeByIndex(i).setLayout(nodes[i].p); - } + var repulsion = forceModel.get('repulsion'); + var edgeLength = forceModel.get('edgeLength'); + var repulsionArr_1 = isArray(repulsion) ? repulsion : [repulsion, repulsion]; + var edgeLengthArr_1 = isArray(edgeLength) ? edgeLength : [edgeLength, edgeLength]; // Larger value has smaller length - preservedPoints_1[nodeData_1.getId(i)] = nodes[i].p; - } + edgeLengthArr_1 = [edgeLengthArr_1[1], edgeLengthArr_1[0]]; + var nodes_1 = nodeData_1.mapArray('value', function (value, idx) { + var point = nodeData_1.getItemLayout(idx); + var rep = linearMap(value, nodeDataExtent_1, repulsionArr_1); - for (var i = 0, l = edges.length; i < l; i++) { - var e = edges[i]; - var edge = graph_1.getEdgeByIndex(i); - var p1 = e.n1.p; - var p2 = e.n2.p; - var points = edge.getLayout(); - points = points ? points.slice() : []; - points[0] = points[0] || []; - points[1] = points[1] || []; - copy(points[0], p1); - copy(points[1], p2); - - if (+e.curveness) { - points[2] = [(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e.curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e.curveness]; - } + if (isNaN(rep)) { + rep = (repulsionArr_1[0] + repulsionArr_1[1]) / 2; + } - edge.setLayout(points); - } - }); - graphSeries.forceLayout = forceInstance; - graphSeries.preservedPoints = preservedPoints_1; // Step to get the layout + return { + w: rep, + rep: rep, + fixed: nodeData_1.getItemModel(idx).get('fixed'), + p: !point || isNaN(point[0]) || isNaN(point[1]) ? null : point + }; + }); + var edges = edgeData.mapArray('value', function (value, idx) { + var edge = graph_1.getEdgeByIndex(idx); + var d = linearMap(value, edgeDataExtent_1, edgeLengthArr_1); - forceInstance.step(); - } else { - // Remove prev injected forceLayout instance - graphSeries.forceLayout = null; + if (isNaN(d)) { + d = (edgeLengthArr_1[0] + edgeLengthArr_1[1]) / 2; } - }); + + var edgeModel = edge.getModel(); + var curveness = retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, graphSeries, idx, true), 0); + return { + n1: nodes_1[edge.node1.dataIndex], + n2: nodes_1[edge.node2.dataIndex], + d: d, + curveness: curveness, + ignoreForceLayout: edgeModel.get('ignoreForceLayout') + }; + }); // let coordSys = graphSeries.coordinateSystem; + + var rect = coordSys.getBoundingRect(); + var forceInstance = forceLayout(nodes_1, edges, { + rect: rect, + gravity: forceModel.get('gravity'), + friction: forceModel.get('friction') + }); + forceInstance.beforeStep(function (nodes, edges) { + for (var i = 0, l = nodes.length; i < l; i++) { + if (nodes[i].fixed) { + // Write back to layout instance + copy(nodes[i].p, graph_1.getNodeByIndex(i).getLayout()); + } + } + }); + forceInstance.afterStep(function (nodes, edges, stopped) { + for (var i = 0, l = nodes.length; i < l; i++) { + if (!nodes[i].fixed) { + graph_1.getNodeByIndex(i).setLayout(nodes[i].p); + } + + preservedPoints_1[nodeData_1.getId(i)] = nodes[i].p; + } + + for (var i = 0, l = edges.length; i < l; i++) { + var e = edges[i]; + var edge = graph_1.getEdgeByIndex(i); + var p1 = e.n1.p; + var p2 = e.n2.p; + var points = edge.getLayout(); + points = points ? points.slice() : []; + points[0] = points[0] || []; + points[1] = points[1] || []; + copy(points[0], p1); + copy(points[1], p2); + + if (+e.curveness) { + points[2] = [(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e.curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e.curveness]; + } + + edge.setLayout(points); + } + }); + graphSeries.forceLayout = forceInstance; + graphSeries.preservedPoints = preservedPoints_1; // Step to get the layout + + forceInstance.step(); + } else { + // Remove prev injected forceLayout instance + graphSeries.forceLayout = null; + } + }); } function getViewRect$2(seriesModel, api, aspect) { - var option = extend(seriesModel.getBoxLayoutParams(), { - aspect: aspect - }); - return getLayoutRect(option, { - width: api.getWidth(), - height: api.getHeight() - }); + var option = extend(seriesModel.getBoxLayoutParams(), { + aspect: aspect + }); + return getLayoutRect(option, { + width: api.getWidth(), + height: api.getHeight() + }); } function createViewCoordSys(ecModel, api) { - var viewList = []; - ecModel.eachSeriesByType('graph', function (seriesModel) { - var coordSysType = seriesModel.get('coordinateSystem'); - - if (!coordSysType || coordSysType === 'view') { - var data_1 = seriesModel.getData(); - var positions = data_1.mapArray(function (idx) { - var itemModel = data_1.getItemModel(idx); - return [+itemModel.get('x'), +itemModel.get('y')]; - }); - var min = []; - var max = []; - fromPoints(positions, min, max); // If width or height is 0 - - if (max[0] - min[0] === 0) { - max[0] += 1; - min[0] -= 1; - } - - if (max[1] - min[1] === 0) { - max[1] += 1; - min[1] -= 1; - } - - var aspect = (max[0] - min[0]) / (max[1] - min[1]); // FIXME If get view rect after data processed? - - var viewRect = getViewRect$2(seriesModel, api, aspect); // Position may be NaN, use view rect instead - - if (isNaN(aspect)) { - min = [viewRect.x, viewRect.y]; - max = [viewRect.x + viewRect.width, viewRect.y + viewRect.height]; - } - - var bbWidth = max[0] - min[0]; - var bbHeight = max[1] - min[1]; - var viewWidth = viewRect.width; - var viewHeight = viewRect.height; - var viewCoordSys = seriesModel.coordinateSystem = new View(); - viewCoordSys.zoomLimit = seriesModel.get('scaleLimit'); - viewCoordSys.setBoundingRect(min[0], min[1], bbWidth, bbHeight); - viewCoordSys.setViewRect(viewRect.x, viewRect.y, viewWidth, viewHeight); // Update roam info - - viewCoordSys.setCenter(seriesModel.get('center')); - viewCoordSys.setZoom(seriesModel.get('zoom')); - viewList.push(viewCoordSys); - } - }); - return viewList; + var viewList = []; + ecModel.eachSeriesByType('graph', function (seriesModel) { + var coordSysType = seriesModel.get('coordinateSystem'); + + if (!coordSysType || coordSysType === 'view') { + var data_1 = seriesModel.getData(); + var positions = data_1.mapArray(function (idx) { + var itemModel = data_1.getItemModel(idx); + return [+itemModel.get('x'), +itemModel.get('y')]; + }); + var min = []; + var max = []; + fromPoints(positions, min, max); // If width or height is 0 + + if (max[0] - min[0] === 0) { + max[0] += 1; + min[0] -= 1; + } + + if (max[1] - min[1] === 0) { + max[1] += 1; + min[1] -= 1; + } + + var aspect = (max[0] - min[0]) / (max[1] - min[1]); // FIXME If get view rect after data processed? + + var viewRect = getViewRect$2(seriesModel, api, aspect); // Position may be NaN, use view rect instead + + if (isNaN(aspect)) { + min = [viewRect.x, viewRect.y]; + max = [viewRect.x + viewRect.width, viewRect.y + viewRect.height]; + } + + var bbWidth = max[0] - min[0]; + var bbHeight = max[1] - min[1]; + var viewWidth = viewRect.width; + var viewHeight = viewRect.height; + var viewCoordSys = seriesModel.coordinateSystem = new View(); + viewCoordSys.zoomLimit = seriesModel.get('scaleLimit'); + viewCoordSys.setBoundingRect(min[0], min[1], bbWidth, bbHeight); + viewCoordSys.setViewRect(viewRect.x, viewRect.y, viewWidth, viewHeight); // Update roam info + + viewCoordSys.setCenter(seriesModel.get('center')); + viewCoordSys.setZoom(seriesModel.get('zoom')); + viewList.push(viewCoordSys); + } + }); + return viewList; } var straightLineProto = Line.prototype; var bezierCurveProto = BezierCurve.prototype; var StraightLineShape = - /** @class */ - function () { - function StraightLineShape() { - // Start point - this.x1 = 0; - this.y1 = 0; // End point - - this.x2 = 0; - this.y2 = 0; - this.percent = 1; - } - - return StraightLineShape; - }(); + /** @class */ + function () { + function StraightLineShape() { + // Start point + this.x1 = 0; + this.y1 = 0; // End point + + this.x2 = 0; + this.y2 = 0; + this.percent = 1; + } + + return StraightLineShape; + }(); var CurveShape = - /** @class */ - function (_super) { - __extends(CurveShape, _super); + /** @class */ + function (_super) { + __extends(CurveShape, _super); - function CurveShape() { - return _super !== null && _super.apply(this, arguments) || this; - } + function CurveShape() { + return _super !== null && _super.apply(this, arguments) || this; + } - return CurveShape; - }(StraightLineShape); + return CurveShape; + }(StraightLineShape); function isStraightLine(shape) { - return isNaN(+shape.cpx1) || isNaN(+shape.cpy1); + return isNaN(+shape.cpx1) || isNaN(+shape.cpy1); } var ECLinePath = - /** @class */ - function (_super) { - __extends(ECLinePath, _super); + /** @class */ + function (_super) { + __extends(ECLinePath, _super); - function ECLinePath(opts) { - var _this = _super.call(this, opts) || this; + function ECLinePath(opts) { + var _this = _super.call(this, opts) || this; - _this.type = 'ec-line'; - return _this; - } + _this.type = 'ec-line'; + return _this; + } - ECLinePath.prototype.getDefaultStyle = function () { - return { - stroke: '#000', - fill: null - }; - }; + ECLinePath.prototype.getDefaultStyle = function () { + return { + stroke: '#000', + fill: null + }; + }; - ECLinePath.prototype.getDefaultShape = function () { - return new StraightLineShape(); - }; + ECLinePath.prototype.getDefaultShape = function () { + return new StraightLineShape(); + }; - ECLinePath.prototype.buildPath = function (ctx, shape) { - if (isStraightLine(shape)) { - straightLineProto.buildPath.call(this, ctx, shape); - } else { - bezierCurveProto.buildPath.call(this, ctx, shape); - } - }; + ECLinePath.prototype.buildPath = function (ctx, shape) { + if (isStraightLine(shape)) { + straightLineProto.buildPath.call(this, ctx, shape); + } else { + bezierCurveProto.buildPath.call(this, ctx, shape); + } + }; - ECLinePath.prototype.pointAt = function (t) { - if (isStraightLine(this.shape)) { - return straightLineProto.pointAt.call(this, t); - } else { - return bezierCurveProto.pointAt.call(this, t); - } - }; + ECLinePath.prototype.pointAt = function (t) { + if (isStraightLine(this.shape)) { + return straightLineProto.pointAt.call(this, t); + } else { + return bezierCurveProto.pointAt.call(this, t); + } + }; - ECLinePath.prototype.tangentAt = function (t) { - var shape = this.shape; - var p = isStraightLine(shape) ? [shape.x2 - shape.x1, shape.y2 - shape.y1] : bezierCurveProto.tangentAt.call(this, t); - return normalize(p, p); - }; + ECLinePath.prototype.tangentAt = function (t) { + var shape = this.shape; + var p = isStraightLine(shape) ? [shape.x2 - shape.x1, shape.y2 - shape.y1] : bezierCurveProto.tangentAt.call(this, t); + return normalize(p, p); + }; - return ECLinePath; - }(Path); + return ECLinePath; + }(Path); var SYMBOL_CATEGORIES = ['fromSymbol', 'toSymbol']; function makeSymbolTypeKey(symbolCategory) { - return '_' + symbolCategory + 'Type'; + return '_' + symbolCategory + 'Type'; } /** * @inner @@ -59814,550 +59814,550 @@ function createSymbol$1(name, lineData, idx) { - var symbolType = lineData.getItemVisual(idx, name); + var symbolType = lineData.getItemVisual(idx, name); - if (!symbolType || symbolType === 'none') { - return; - } + if (!symbolType || symbolType === 'none') { + return; + } - var symbolSize = lineData.getItemVisual(idx, name + 'Size'); - var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate'); - var symbolOffset = lineData.getItemVisual(idx, name + 'Offset'); - var symbolKeepAspect = lineData.getItemVisual(idx, name + 'KeepAspect'); - var symbolSizeArr = normalizeSymbolSize(symbolSize); - var symbolOffsetArr = normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr); - var symbolPath = createSymbol(symbolType, -symbolSizeArr[0] / 2 + symbolOffsetArr[0], -symbolSizeArr[1] / 2 + symbolOffsetArr[1], symbolSizeArr[0], symbolSizeArr[1], null, symbolKeepAspect); - symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate) ? void 0 : +symbolRotate * Math.PI / 180 || 0; - symbolPath.name = name; - return symbolPath; + var symbolSize = lineData.getItemVisual(idx, name + 'Size'); + var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate'); + var symbolOffset = lineData.getItemVisual(idx, name + 'Offset'); + var symbolKeepAspect = lineData.getItemVisual(idx, name + 'KeepAspect'); + var symbolSizeArr = normalizeSymbolSize(symbolSize); + var symbolOffsetArr = normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr); + var symbolPath = createSymbol(symbolType, -symbolSizeArr[0] / 2 + symbolOffsetArr[0], -symbolSizeArr[1] / 2 + symbolOffsetArr[1], symbolSizeArr[0], symbolSizeArr[1], null, symbolKeepAspect); + symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate) ? void 0 : +symbolRotate * Math.PI / 180 || 0; + symbolPath.name = name; + return symbolPath; } function createLine(points) { - var line = new ECLinePath({ - name: 'line', - subPixelOptimize: true - }); - setLinePoints(line.shape, points); - return line; + var line = new ECLinePath({ + name: 'line', + subPixelOptimize: true + }); + setLinePoints(line.shape, points); + return line; } function setLinePoints(targetShape, points) { - targetShape.x1 = points[0][0]; - targetShape.y1 = points[0][1]; - targetShape.x2 = points[1][0]; - targetShape.y2 = points[1][1]; - targetShape.percent = 1; - var cp1 = points[2]; - - if (cp1) { - targetShape.cpx1 = cp1[0]; - targetShape.cpy1 = cp1[1]; - } else { - targetShape.cpx1 = NaN; - targetShape.cpy1 = NaN; - } + targetShape.x1 = points[0][0]; + targetShape.y1 = points[0][1]; + targetShape.x2 = points[1][0]; + targetShape.y2 = points[1][1]; + targetShape.percent = 1; + var cp1 = points[2]; + + if (cp1) { + targetShape.cpx1 = cp1[0]; + targetShape.cpy1 = cp1[1]; + } else { + targetShape.cpx1 = NaN; + targetShape.cpy1 = NaN; + } } var Line$1 = - /** @class */ - function (_super) { - __extends(Line, _super); - - function Line(lineData, idx, seriesScope) { - var _this = _super.call(this) || this; + /** @class */ + function (_super) { + __extends(Line, _super); - _this._createLine(lineData, idx, seriesScope); + function Line(lineData, idx, seriesScope) { + var _this = _super.call(this) || this; - return _this; - } - - Line.prototype._createLine = function (lineData, idx, seriesScope) { - var seriesModel = lineData.hostModel; - var linePoints = lineData.getItemLayout(idx); - var line = createLine(linePoints); - line.shape.percent = 0; - initProps(line, { - shape: { - percent: 1 - } - }, seriesModel, idx); - this.add(line); - each(SYMBOL_CATEGORIES, function (symbolCategory) { - var symbol = createSymbol$1(symbolCategory, lineData, idx); // symbols must added after line to make sure - // it will be updated after line#update. - // Or symbol position and rotation update in line#beforeUpdate will be one frame slow - - this.add(symbol); - this[makeSymbolTypeKey(symbolCategory)] = lineData.getItemVisual(idx, symbolCategory); - }, this); + _this._createLine(lineData, idx, seriesScope); - this._updateCommonStl(lineData, idx, seriesScope); - }; // TODO More strict on the List type in parameters? + return _this; + } + Line.prototype._createLine = function (lineData, idx, seriesScope) { + var seriesModel = lineData.hostModel; + var linePoints = lineData.getItemLayout(idx); + var line = createLine(linePoints); + line.shape.percent = 0; + initProps(line, { + shape: { + percent: 1 + } + }, seriesModel, idx); + this.add(line); + each(SYMBOL_CATEGORIES, function (symbolCategory) { + var symbol = createSymbol$1(symbolCategory, lineData, idx); // symbols must added after line to make sure + // it will be updated after line#update. + // Or symbol position and rotation update in line#beforeUpdate will be one frame slow + + this.add(symbol); + this[makeSymbolTypeKey(symbolCategory)] = lineData.getItemVisual(idx, symbolCategory); + }, this); - Line.prototype.updateData = function (lineData, idx, seriesScope) { - var seriesModel = lineData.hostModel; - var line = this.childOfName('line'); - var linePoints = lineData.getItemLayout(idx); - var target = { - shape: {} - }; - setLinePoints(target.shape, linePoints); - updateProps(line, target, seriesModel, idx); - each(SYMBOL_CATEGORIES, function (symbolCategory) { - var symbolType = lineData.getItemVisual(idx, symbolCategory); - var key = makeSymbolTypeKey(symbolCategory); // Symbol changed - - if (this[key] !== symbolType) { - this.remove(this.childOfName(symbolCategory)); - var symbol = createSymbol$1(symbolCategory, lineData, idx); - this.add(symbol); - } - - this[key] = symbolType; - }, this); + this._updateCommonStl(lineData, idx, seriesScope); + }; // TODO More strict on the List type in parameters? - this._updateCommonStl(lineData, idx, seriesScope); - }; - Line.prototype.getLinePath = function () { - return this.childAt(0); - }; + Line.prototype.updateData = function (lineData, idx, seriesScope) { + var seriesModel = lineData.hostModel; + var line = this.childOfName('line'); + var linePoints = lineData.getItemLayout(idx); + var target = { + shape: {} + }; + setLinePoints(target.shape, linePoints); + updateProps(line, target, seriesModel, idx); + each(SYMBOL_CATEGORIES, function (symbolCategory) { + var symbolType = lineData.getItemVisual(idx, symbolCategory); + var key = makeSymbolTypeKey(symbolCategory); // Symbol changed - Line.prototype._updateCommonStl = function (lineData, idx, seriesScope) { - var seriesModel = lineData.hostModel; - var line = this.childOfName('line'); - var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle; - var blurLineStyle = seriesScope && seriesScope.blurLineStyle; - var selectLineStyle = seriesScope && seriesScope.selectLineStyle; - var labelStatesModels = seriesScope && seriesScope.labelStatesModels; - var emphasisDisabled = seriesScope && seriesScope.emphasisDisabled; - var focus = seriesScope && seriesScope.focus; - var blurScope = seriesScope && seriesScope.blurScope; // Optimization for large dataset - - if (!seriesScope || lineData.hasItemOption) { - var itemModel = lineData.getItemModel(idx); - var emphasisModel = itemModel.getModel('emphasis'); - emphasisLineStyle = emphasisModel.getModel('lineStyle').getLineStyle(); - blurLineStyle = itemModel.getModel(['blur', 'lineStyle']).getLineStyle(); - selectLineStyle = itemModel.getModel(['select', 'lineStyle']).getLineStyle(); - emphasisDisabled = emphasisModel.get('disabled'); - focus = emphasisModel.get('focus'); - blurScope = emphasisModel.get('blurScope'); - labelStatesModels = getLabelStatesModels(itemModel); - } - - var lineStyle = lineData.getItemVisual(idx, 'style'); - var visualColor = lineStyle.stroke; - line.useStyle(lineStyle); - line.style.fill = null; - line.style.strokeNoScale = true; - line.ensureState('emphasis').style = emphasisLineStyle; - line.ensureState('blur').style = blurLineStyle; - line.ensureState('select').style = selectLineStyle; // Update symbol - - each(SYMBOL_CATEGORIES, function (symbolCategory) { - var symbol = this.childOfName(symbolCategory); - - if (symbol) { - // Share opacity and color with line. - symbol.setColor(visualColor); - symbol.style.opacity = lineStyle.opacity; - - for (var i = 0; i < SPECIAL_STATES.length; i++) { - var stateName = SPECIAL_STATES[i]; - var lineState = line.getState(stateName); - - if (lineState) { - var lineStateStyle = lineState.style || {}; - var state = symbol.ensureState(stateName); - var stateStyle = state.style || (state.style = {}); - - if (lineStateStyle.stroke != null) { - stateStyle[symbol.__isEmptyBrush ? 'stroke' : 'fill'] = lineStateStyle.stroke; - } + if (this[key] !== symbolType) { + this.remove(this.childOfName(symbolCategory)); + var symbol = createSymbol$1(symbolCategory, lineData, idx); + this.add(symbol); + } - if (lineStateStyle.opacity != null) { - stateStyle.opacity = lineStateStyle.opacity; - } - } - } + this[key] = symbolType; + }, this); - symbol.markRedraw(); - } - }, this); - var rawVal = seriesModel.getRawValue(idx); - setLabelStyle(this, labelStatesModels, { - labelDataIndex: idx, - labelFetcher: { - getFormattedLabel: function (dataIndex, stateName) { - return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType); - } - }, - inheritColor: visualColor || '#000', - defaultOpacity: lineStyle.opacity, - defaultText: (rawVal == null ? lineData.getName(idx) : isFinite(rawVal) ? round(rawVal) : rawVal) + '' - }); - var label = this.getTextContent(); // Always set `textStyle` even if `normalStyle.text` is null, because default - // values have to be set on `normalStyle`. + this._updateCommonStl(lineData, idx, seriesScope); + }; + + Line.prototype.getLinePath = function () { + return this.childAt(0); + }; + + Line.prototype._updateCommonStl = function (lineData, idx, seriesScope) { + var seriesModel = lineData.hostModel; + var line = this.childOfName('line'); + var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle; + var blurLineStyle = seriesScope && seriesScope.blurLineStyle; + var selectLineStyle = seriesScope && seriesScope.selectLineStyle; + var labelStatesModels = seriesScope && seriesScope.labelStatesModels; + var emphasisDisabled = seriesScope && seriesScope.emphasisDisabled; + var focus = seriesScope && seriesScope.focus; + var blurScope = seriesScope && seriesScope.blurScope; // Optimization for large dataset + + if (!seriesScope || lineData.hasItemOption) { + var itemModel = lineData.getItemModel(idx); + var emphasisModel = itemModel.getModel('emphasis'); + emphasisLineStyle = emphasisModel.getModel('lineStyle').getLineStyle(); + blurLineStyle = itemModel.getModel(['blur', 'lineStyle']).getLineStyle(); + selectLineStyle = itemModel.getModel(['select', 'lineStyle']).getLineStyle(); + emphasisDisabled = emphasisModel.get('disabled'); + focus = emphasisModel.get('focus'); + blurScope = emphasisModel.get('blurScope'); + labelStatesModels = getLabelStatesModels(itemModel); + } + + var lineStyle = lineData.getItemVisual(idx, 'style'); + var visualColor = lineStyle.stroke; + line.useStyle(lineStyle); + line.style.fill = null; + line.style.strokeNoScale = true; + line.ensureState('emphasis').style = emphasisLineStyle; + line.ensureState('blur').style = blurLineStyle; + line.ensureState('select').style = selectLineStyle; // Update symbol + + each(SYMBOL_CATEGORIES, function (symbolCategory) { + var symbol = this.childOfName(symbolCategory); + + if (symbol) { + // Share opacity and color with line. + symbol.setColor(visualColor); + symbol.style.opacity = lineStyle.opacity; - if (label) { - var labelNormalModel = labelStatesModels.normal; - label.__align = label.style.align; - label.__verticalAlign = label.style.verticalAlign; // 'start', 'middle', 'end' + for (var i = 0; i < SPECIAL_STATES.length; i++) { + var stateName = SPECIAL_STATES[i]; + var lineState = line.getState(stateName); - label.__position = labelNormalModel.get('position') || 'middle'; - var distance = labelNormalModel.get('distance'); + if (lineState) { + var lineStateStyle = lineState.style || {}; + var state = symbol.ensureState(stateName); + var stateStyle = state.style || (state.style = {}); - if (!isArray(distance)) { - distance = [distance, distance]; - } + if (lineStateStyle.stroke != null) { + stateStyle[symbol.__isEmptyBrush ? 'stroke' : 'fill'] = lineStateStyle.stroke; + } - label.__labelDistance = distance; + if (lineStateStyle.opacity != null) { + stateStyle.opacity = lineStateStyle.opacity; } + } + } - this.setTextConfig({ - position: null, - local: true, - inside: false // Can't be inside for stroke element. + symbol.markRedraw(); + } + }, this); + var rawVal = seriesModel.getRawValue(idx); + setLabelStyle(this, labelStatesModels, { + labelDataIndex: idx, + labelFetcher: { + getFormattedLabel: function (dataIndex, stateName) { + return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType); + } + }, + inheritColor: visualColor || '#000', + defaultOpacity: lineStyle.opacity, + defaultText: (rawVal == null ? lineData.getName(idx) : isFinite(rawVal) ? round(rawVal) : rawVal) + '' + }); + var label = this.getTextContent(); // Always set `textStyle` even if `normalStyle.text` is null, because default + // values have to be set on `normalStyle`. - }); - toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled); - }; + if (label) { + var labelNormalModel = labelStatesModels.normal; + label.__align = label.style.align; + label.__verticalAlign = label.style.verticalAlign; // 'start', 'middle', 'end' - Line.prototype.highlight = function () { - enterEmphasis(this); - }; + label.__position = labelNormalModel.get('position') || 'middle'; + var distance = labelNormalModel.get('distance'); - Line.prototype.downplay = function () { - leaveEmphasis(this); - }; + if (!isArray(distance)) { + distance = [distance, distance]; + } - Line.prototype.updateLayout = function (lineData, idx) { - this.setLinePoints(lineData.getItemLayout(idx)); - }; + label.__labelDistance = distance; + } - Line.prototype.setLinePoints = function (points) { - var linePath = this.childOfName('line'); - setLinePoints(linePath.shape, points); - linePath.dirty(); - }; + this.setTextConfig({ + position: null, + local: true, + inside: false // Can't be inside for stroke element. - Line.prototype.beforeUpdate = function () { - var lineGroup = this; - var symbolFrom = lineGroup.childOfName('fromSymbol'); - var symbolTo = lineGroup.childOfName('toSymbol'); - var label = lineGroup.getTextContent(); // Quick reject + }); + toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled); + }; - if (!symbolFrom && !symbolTo && (!label || label.ignore)) { - return; - } + Line.prototype.highlight = function () { + enterEmphasis(this); + }; - var invScale = 1; - var parentNode = this.parent; + Line.prototype.downplay = function () { + leaveEmphasis(this); + }; - while (parentNode) { - if (parentNode.scaleX) { - invScale /= parentNode.scaleX; - } + Line.prototype.updateLayout = function (lineData, idx) { + this.setLinePoints(lineData.getItemLayout(idx)); + }; - parentNode = parentNode.parent; - } + Line.prototype.setLinePoints = function (points) { + var linePath = this.childOfName('line'); + setLinePoints(linePath.shape, points); + linePath.dirty(); + }; - var line = lineGroup.childOfName('line'); // If line not changed - // FIXME Parent scale changed + Line.prototype.beforeUpdate = function () { + var lineGroup = this; + var symbolFrom = lineGroup.childOfName('fromSymbol'); + var symbolTo = lineGroup.childOfName('toSymbol'); + var label = lineGroup.getTextContent(); // Quick reject - if (!this.__dirty && !line.__dirty) { - return; - } + if (!symbolFrom && !symbolTo && (!label || label.ignore)) { + return; + } - var percent = line.shape.percent; - var fromPos = line.pointAt(0); - var toPos = line.pointAt(percent); - var d = sub([], toPos, fromPos); - normalize(d, d); + var invScale = 1; + var parentNode = this.parent; - function setSymbolRotation(symbol, percent) { - // Fix #12388 - // when symbol is set to be 'arrow' in markLine, - // symbolRotate value will be ignored, and compulsively use tangent angle. - // rotate by default if symbol rotation is not specified - var specifiedRotation = symbol.__specifiedRotation; + while (parentNode) { + if (parentNode.scaleX) { + invScale /= parentNode.scaleX; + } - if (specifiedRotation == null) { - var tangent = line.tangentAt(percent); - symbol.attr('rotation', (percent === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(tangent[1], tangent[0])); - } else { - symbol.attr('rotation', specifiedRotation); - } - } + parentNode = parentNode.parent; + } - if (symbolFrom) { - symbolFrom.setPosition(fromPos); - setSymbolRotation(symbolFrom, 0); - symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent; - symbolFrom.markRedraw(); - } - - if (symbolTo) { - symbolTo.setPosition(toPos); - setSymbolRotation(symbolTo, 1); - symbolTo.scaleX = symbolTo.scaleY = invScale * percent; - symbolTo.markRedraw(); - } - - if (label && !label.ignore) { - label.x = label.y = 0; - label.originX = label.originY = 0; - var textAlign = void 0; - var textVerticalAlign = void 0; - var distance = label.__labelDistance; - var distanceX = distance[0] * invScale; - var distanceY = distance[1] * invScale; - var halfPercent = percent / 2; - var tangent = line.tangentAt(halfPercent); - var n = [tangent[1], -tangent[0]]; - var cp = line.pointAt(halfPercent); - - if (n[1] > 0) { - n[0] = -n[0]; - n[1] = -n[1]; - } + var line = lineGroup.childOfName('line'); // If line not changed + // FIXME Parent scale changed - var dir = tangent[0] < 0 ? -1 : 1; + if (!this.__dirty && !line.__dirty) { + return; + } - if (label.__position !== 'start' && label.__position !== 'end') { - var rotation = -Math.atan2(tangent[1], tangent[0]); + var percent = line.shape.percent; + var fromPos = line.pointAt(0); + var toPos = line.pointAt(percent); + var d = sub([], toPos, fromPos); + normalize(d, d); - if (toPos[0] < fromPos[0]) { - rotation = Math.PI + rotation; - } + function setSymbolRotation(symbol, percent) { + // Fix #12388 + // when symbol is set to be 'arrow' in markLine, + // symbolRotate value will be ignored, and compulsively use tangent angle. + // rotate by default if symbol rotation is not specified + var specifiedRotation = symbol.__specifiedRotation; - label.rotation = rotation; - } + if (specifiedRotation == null) { + var tangent = line.tangentAt(percent); + symbol.attr('rotation', (percent === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(tangent[1], tangent[0])); + } else { + symbol.attr('rotation', specifiedRotation); + } + } - var dy = void 0; + if (symbolFrom) { + symbolFrom.setPosition(fromPos); + setSymbolRotation(symbolFrom, 0); + symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent; + symbolFrom.markRedraw(); + } - switch (label.__position) { - case 'insideStartTop': - case 'insideMiddleTop': - case 'insideEndTop': - case 'middle': - dy = -distanceY; - textVerticalAlign = 'bottom'; - break; + if (symbolTo) { + symbolTo.setPosition(toPos); + setSymbolRotation(symbolTo, 1); + symbolTo.scaleX = symbolTo.scaleY = invScale * percent; + symbolTo.markRedraw(); + } - case 'insideStartBottom': - case 'insideMiddleBottom': - case 'insideEndBottom': - dy = distanceY; - textVerticalAlign = 'top'; - break; + if (label && !label.ignore) { + label.x = label.y = 0; + label.originX = label.originY = 0; + var textAlign = void 0; + var textVerticalAlign = void 0; + var distance = label.__labelDistance; + var distanceX = distance[0] * invScale; + var distanceY = distance[1] * invScale; + var halfPercent = percent / 2; + var tangent = line.tangentAt(halfPercent); + var n = [tangent[1], -tangent[0]]; + var cp = line.pointAt(halfPercent); - default: - dy = 0; - textVerticalAlign = 'middle'; - } + if (n[1] > 0) { + n[0] = -n[0]; + n[1] = -n[1]; + } - switch (label.__position) { - case 'end': - label.x = d[0] * distanceX + toPos[0]; - label.y = d[1] * distanceY + toPos[1]; - textAlign = d[0] > 0.8 ? 'left' : d[0] < -0.8 ? 'right' : 'center'; - textVerticalAlign = d[1] > 0.8 ? 'top' : d[1] < -0.8 ? 'bottom' : 'middle'; - break; + var dir = tangent[0] < 0 ? -1 : 1; - case 'start': - label.x = -d[0] * distanceX + fromPos[0]; - label.y = -d[1] * distanceY + fromPos[1]; - textAlign = d[0] > 0.8 ? 'right' : d[0] < -0.8 ? 'left' : 'center'; - textVerticalAlign = d[1] > 0.8 ? 'bottom' : d[1] < -0.8 ? 'top' : 'middle'; - break; + if (label.__position !== 'start' && label.__position !== 'end') { + var rotation = -Math.atan2(tangent[1], tangent[0]); - case 'insideStartTop': - case 'insideStart': - case 'insideStartBottom': - label.x = distanceX * dir + fromPos[0]; - label.y = fromPos[1] + dy; - textAlign = tangent[0] < 0 ? 'right' : 'left'; - label.originX = -distanceX * dir; - label.originY = -dy; - break; + if (toPos[0] < fromPos[0]) { + rotation = Math.PI + rotation; + } - case 'insideMiddleTop': - case 'insideMiddle': - case 'insideMiddleBottom': - case 'middle': - label.x = cp[0]; - label.y = cp[1] + dy; - textAlign = 'center'; - label.originY = -dy; - break; + label.rotation = rotation; + } - case 'insideEndTop': - case 'insideEnd': - case 'insideEndBottom': - label.x = -distanceX * dir + toPos[0]; - label.y = toPos[1] + dy; - textAlign = tangent[0] >= 0 ? 'right' : 'left'; - label.originX = distanceX * dir; - label.originY = -dy; - break; - } + var dy = void 0; - label.scaleX = label.scaleY = invScale; - label.setStyle({ - // Use the user specified text align and baseline first - verticalAlign: label.__verticalAlign || textVerticalAlign, - align: label.__align || textAlign - }); - } - }; + switch (label.__position) { + case 'insideStartTop': + case 'insideMiddleTop': + case 'insideEndTop': + case 'middle': + dy = -distanceY; + textVerticalAlign = 'bottom'; + break; - return Line; - }(Group); + case 'insideStartBottom': + case 'insideMiddleBottom': + case 'insideEndBottom': + dy = distanceY; + textVerticalAlign = 'top'; + break; + + default: + dy = 0; + textVerticalAlign = 'middle'; + } + + switch (label.__position) { + case 'end': + label.x = d[0] * distanceX + toPos[0]; + label.y = d[1] * distanceY + toPos[1]; + textAlign = d[0] > 0.8 ? 'left' : d[0] < -0.8 ? 'right' : 'center'; + textVerticalAlign = d[1] > 0.8 ? 'top' : d[1] < -0.8 ? 'bottom' : 'middle'; + break; + + case 'start': + label.x = -d[0] * distanceX + fromPos[0]; + label.y = -d[1] * distanceY + fromPos[1]; + textAlign = d[0] > 0.8 ? 'right' : d[0] < -0.8 ? 'left' : 'center'; + textVerticalAlign = d[1] > 0.8 ? 'bottom' : d[1] < -0.8 ? 'top' : 'middle'; + break; + + case 'insideStartTop': + case 'insideStart': + case 'insideStartBottom': + label.x = distanceX * dir + fromPos[0]; + label.y = fromPos[1] + dy; + textAlign = tangent[0] < 0 ? 'right' : 'left'; + label.originX = -distanceX * dir; + label.originY = -dy; + break; + + case 'insideMiddleTop': + case 'insideMiddle': + case 'insideMiddleBottom': + case 'middle': + label.x = cp[0]; + label.y = cp[1] + dy; + textAlign = 'center'; + label.originY = -dy; + break; + + case 'insideEndTop': + case 'insideEnd': + case 'insideEndBottom': + label.x = -distanceX * dir + toPos[0]; + label.y = toPos[1] + dy; + textAlign = tangent[0] >= 0 ? 'right' : 'left'; + label.originX = distanceX * dir; + label.originY = -dy; + break; + } + + label.scaleX = label.scaleY = invScale; + label.setStyle({ + // Use the user specified text align and baseline first + verticalAlign: label.__verticalAlign || textVerticalAlign, + align: label.__align || textAlign + }); + } + }; + + return Line; + }(Group); var LineDraw = - /** @class */ - function () { - function LineDraw(LineCtor) { - this.group = new Group(); - this._LineCtor = LineCtor || Line$1; - } + /** @class */ + function () { + function LineDraw(LineCtor) { + this.group = new Group(); + this._LineCtor = LineCtor || Line$1; + } - LineDraw.prototype.updateData = function (lineData) { - var _this = this; // Remove progressive els. + LineDraw.prototype.updateData = function (lineData) { + var _this = this; // Remove progressive els. - this._progressiveEls = null; - var lineDraw = this; - var group = lineDraw.group; - var oldLineData = lineDraw._lineData; - lineDraw._lineData = lineData; // There is no oldLineData only when first rendering or switching from - // stream mode to normal mode, where previous elements should be removed. + this._progressiveEls = null; + var lineDraw = this; + var group = lineDraw.group; + var oldLineData = lineDraw._lineData; + lineDraw._lineData = lineData; // There is no oldLineData only when first rendering or switching from + // stream mode to normal mode, where previous elements should be removed. - if (!oldLineData) { - group.removeAll(); - } + if (!oldLineData) { + group.removeAll(); + } - var seriesScope = makeSeriesScope$1(lineData); - lineData.diff(oldLineData).add(function (idx) { - _this._doAdd(lineData, idx, seriesScope); - }).update(function (newIdx, oldIdx) { - _this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope); - }).remove(function (idx) { - group.remove(oldLineData.getItemGraphicEl(idx)); - }).execute(); - }; + var seriesScope = makeSeriesScope$1(lineData); + lineData.diff(oldLineData).add(function (idx) { + _this._doAdd(lineData, idx, seriesScope); + }).update(function (newIdx, oldIdx) { + _this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope); + }).remove(function (idx) { + group.remove(oldLineData.getItemGraphicEl(idx)); + }).execute(); + }; - LineDraw.prototype.updateLayout = function () { - var lineData = this._lineData; // Do not support update layout in incremental mode. + LineDraw.prototype.updateLayout = function () { + var lineData = this._lineData; // Do not support update layout in incremental mode. - if (!lineData) { - return; - } + if (!lineData) { + return; + } - lineData.eachItemGraphicEl(function (el, idx) { - el.updateLayout(lineData, idx); - }, this); - }; + lineData.eachItemGraphicEl(function (el, idx) { + el.updateLayout(lineData, idx); + }, this); + }; - LineDraw.prototype.incrementalPrepareUpdate = function (lineData) { - this._seriesScope = makeSeriesScope$1(lineData); - this._lineData = null; - this.group.removeAll(); - }; + LineDraw.prototype.incrementalPrepareUpdate = function (lineData) { + this._seriesScope = makeSeriesScope$1(lineData); + this._lineData = null; + this.group.removeAll(); + }; - LineDraw.prototype.incrementalUpdate = function (taskParams, lineData) { - this._progressiveEls = []; + LineDraw.prototype.incrementalUpdate = function (taskParams, lineData) { + this._progressiveEls = []; - function updateIncrementalAndHover(el) { - if (!el.isGroup && !isEffectObject(el)) { - el.incremental = true; - el.ensureState('emphasis').hoverLayer = true; - } - } + function updateIncrementalAndHover(el) { + if (!el.isGroup && !isEffectObject(el)) { + el.incremental = true; + el.ensureState('emphasis').hoverLayer = true; + } + } - for (var idx = taskParams.start; idx < taskParams.end; idx++) { - var itemLayout = lineData.getItemLayout(idx); + for (var idx = taskParams.start; idx < taskParams.end; idx++) { + var itemLayout = lineData.getItemLayout(idx); - if (lineNeedsDraw(itemLayout)) { - var el = new this._LineCtor(lineData, idx, this._seriesScope); - el.traverse(updateIncrementalAndHover); - this.group.add(el); - lineData.setItemGraphicEl(idx, el); + if (lineNeedsDraw(itemLayout)) { + var el = new this._LineCtor(lineData, idx, this._seriesScope); + el.traverse(updateIncrementalAndHover); + this.group.add(el); + lineData.setItemGraphicEl(idx, el); - this._progressiveEls.push(el); - } - } - }; + this._progressiveEls.push(el); + } + } + }; - LineDraw.prototype.remove = function () { - this.group.removeAll(); - }; + LineDraw.prototype.remove = function () { + this.group.removeAll(); + }; - LineDraw.prototype.eachRendered = function (cb) { - traverseElements(this._progressiveEls || this.group, cb); - }; + LineDraw.prototype.eachRendered = function (cb) { + traverseElements(this._progressiveEls || this.group, cb); + }; - LineDraw.prototype._doAdd = function (lineData, idx, seriesScope) { - var itemLayout = lineData.getItemLayout(idx); + LineDraw.prototype._doAdd = function (lineData, idx, seriesScope) { + var itemLayout = lineData.getItemLayout(idx); - if (!lineNeedsDraw(itemLayout)) { - return; - } + if (!lineNeedsDraw(itemLayout)) { + return; + } - var el = new this._LineCtor(lineData, idx, seriesScope); - lineData.setItemGraphicEl(idx, el); - this.group.add(el); - }; + var el = new this._LineCtor(lineData, idx, seriesScope); + lineData.setItemGraphicEl(idx, el); + this.group.add(el); + }; - LineDraw.prototype._doUpdate = function (oldLineData, newLineData, oldIdx, newIdx, seriesScope) { - var itemEl = oldLineData.getItemGraphicEl(oldIdx); + LineDraw.prototype._doUpdate = function (oldLineData, newLineData, oldIdx, newIdx, seriesScope) { + var itemEl = oldLineData.getItemGraphicEl(oldIdx); - if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) { - this.group.remove(itemEl); - return; - } + if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) { + this.group.remove(itemEl); + return; + } - if (!itemEl) { - itemEl = new this._LineCtor(newLineData, newIdx, seriesScope); - } else { - itemEl.updateData(newLineData, newIdx, seriesScope); - } + if (!itemEl) { + itemEl = new this._LineCtor(newLineData, newIdx, seriesScope); + } else { + itemEl.updateData(newLineData, newIdx, seriesScope); + } - newLineData.setItemGraphicEl(newIdx, itemEl); - this.group.add(itemEl); - }; + newLineData.setItemGraphicEl(newIdx, itemEl); + this.group.add(itemEl); + }; - return LineDraw; - }(); + return LineDraw; + }(); function isEffectObject(el) { - return el.animators && el.animators.length > 0; + return el.animators && el.animators.length > 0; } function makeSeriesScope$1(lineData) { - var hostModel = lineData.hostModel; - var emphasisModel = hostModel.getModel('emphasis'); - return { - lineStyle: hostModel.getModel('lineStyle').getLineStyle(), - emphasisLineStyle: emphasisModel.getModel(['lineStyle']).getLineStyle(), - blurLineStyle: hostModel.getModel(['blur', 'lineStyle']).getLineStyle(), - selectLineStyle: hostModel.getModel(['select', 'lineStyle']).getLineStyle(), - emphasisDisabled: emphasisModel.get('disabled'), - blurScope: emphasisModel.get('blurScope'), - focus: emphasisModel.get('focus'), - labelStatesModels: getLabelStatesModels(hostModel) - }; + var hostModel = lineData.hostModel; + var emphasisModel = hostModel.getModel('emphasis'); + return { + lineStyle: hostModel.getModel('lineStyle').getLineStyle(), + emphasisLineStyle: emphasisModel.getModel(['lineStyle']).getLineStyle(), + blurLineStyle: hostModel.getModel(['blur', 'lineStyle']).getLineStyle(), + selectLineStyle: hostModel.getModel(['select', 'lineStyle']).getLineStyle(), + emphasisDisabled: emphasisModel.get('disabled'), + blurScope: emphasisModel.get('blurScope'), + focus: emphasisModel.get('focus'), + labelStatesModels: getLabelStatesModels(hostModel) + }; } function isPointNaN(pt) { - return isNaN(pt[0]) || isNaN(pt[1]); + return isNaN(pt[0]) || isNaN(pt[1]); } function lineNeedsDraw(pts) { - return pts && !isPointNaN(pts[0]) && !isPointNaN(pts[1]); + return pts && !isPointNaN(pts[0]) && !isPointNaN(pts[1]); } var v1 = []; @@ -60368,1891 +60368,1891 @@ var mathAbs$2 = Math.abs; function intersectCurveCircle(curvePoints, center, radius) { - var p0 = curvePoints[0]; - var p1 = curvePoints[1]; - var p2 = curvePoints[2]; - var d = Infinity; - var t; - var radiusSquare = radius * radius; - var interval = 0.1; - - for (var _t = 0.1; _t <= 0.9; _t += 0.1) { - v1[0] = quadraticAt$1(p0[0], p1[0], p2[0], _t); - v1[1] = quadraticAt$1(p0[1], p1[1], p2[1], _t); - var diff = mathAbs$2(v2DistSquare(v1, center) - radiusSquare); + var p0 = curvePoints[0]; + var p1 = curvePoints[1]; + var p2 = curvePoints[2]; + var d = Infinity; + var t; + var radiusSquare = radius * radius; + var interval = 0.1; + + for (var _t = 0.1; _t <= 0.9; _t += 0.1) { + v1[0] = quadraticAt$1(p0[0], p1[0], p2[0], _t); + v1[1] = quadraticAt$1(p0[1], p1[1], p2[1], _t); + var diff = mathAbs$2(v2DistSquare(v1, center) - radiusSquare); + + if (diff < d) { + d = diff; + t = _t; + } + } // Assume the segment is monotone,Find root through Bisection method + // At most 32 iteration + + + for (var i = 0; i < 32; i++) { + // let prev = t - interval; + var next = t + interval; // v1[0] = quadraticAt(p0[0], p1[0], p2[0], prev); + // v1[1] = quadraticAt(p0[1], p1[1], p2[1], prev); + + v2[0] = quadraticAt$1(p0[0], p1[0], p2[0], t); + v2[1] = quadraticAt$1(p0[1], p1[1], p2[1], t); + v3[0] = quadraticAt$1(p0[0], p1[0], p2[0], next); + v3[1] = quadraticAt$1(p0[1], p1[1], p2[1], next); + var diff = v2DistSquare(v2, center) - radiusSquare; + + if (mathAbs$2(diff) < 1e-2) { + break; + } // let prevDiff = v2DistSquare(v1, center) - radiusSquare; + + + var nextDiff = v2DistSquare(v3, center) - radiusSquare; + interval /= 2; + + if (diff < 0) { + if (nextDiff >= 0) { + t = t + interval; + } else { + t = t - interval; + } + } else { + if (nextDiff >= 0) { + t = t - interval; + } else { + t = t + interval; + } + } + } - if (diff < d) { - d = diff; - t = _t; - } - } // Assume the segment is monotone,Find root through Bisection method - // At most 32 iteration + return t; + } // Adjust edge to avoid - for (var i = 0; i < 32; i++) { - // let prev = t - interval; - var next = t + interval; // v1[0] = quadraticAt(p0[0], p1[0], p2[0], prev); - // v1[1] = quadraticAt(p0[1], p1[1], p2[1], prev); + function adjustEdge(graph, scale) { + var tmp0 = []; + var quadraticSubdivide$1 = quadraticSubdivide; + var pts = [[], [], []]; + var pts2 = [[], []]; + var v = []; + scale /= 2; + graph.eachEdge(function (edge, idx) { + var linePoints = edge.getLayout(); + var fromSymbol = edge.getVisual('fromSymbol'); + var toSymbol = edge.getVisual('toSymbol'); + + if (!linePoints.__original) { + linePoints.__original = [clone$1(linePoints[0]), clone$1(linePoints[1])]; + + if (linePoints[2]) { + linePoints.__original.push(clone$1(linePoints[2])); + } + } + + var originalPoints = linePoints.__original; // Quadratic curve + + if (linePoints[2] != null) { + copy(pts[0], originalPoints[0]); + copy(pts[1], originalPoints[2]); + copy(pts[2], originalPoints[1]); + + if (fromSymbol && fromSymbol !== 'none') { + var symbolSize = getSymbolSize(edge.node1); + var t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale); // Subdivide and get the second + + quadraticSubdivide$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0); + pts[0][0] = tmp0[3]; + pts[1][0] = tmp0[4]; + quadraticSubdivide$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0); + pts[0][1] = tmp0[3]; + pts[1][1] = tmp0[4]; + } + + if (toSymbol && toSymbol !== 'none') { + var symbolSize = getSymbolSize(edge.node2); + var t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale); // Subdivide and get the first + + quadraticSubdivide$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0); + pts[1][0] = tmp0[1]; + pts[2][0] = tmp0[2]; + quadraticSubdivide$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0); + pts[1][1] = tmp0[1]; + pts[2][1] = tmp0[2]; + } // Copy back to layout + + + copy(linePoints[0], pts[0]); + copy(linePoints[1], pts[2]); + copy(linePoints[2], pts[1]); + } // Line + else { + copy(pts2[0], originalPoints[0]); + copy(pts2[1], originalPoints[1]); + sub(v, pts2[1], pts2[0]); + normalize(v, v); - v2[0] = quadraticAt$1(p0[0], p1[0], p2[0], t); - v2[1] = quadraticAt$1(p0[1], p1[1], p2[1], t); - v3[0] = quadraticAt$1(p0[0], p1[0], p2[0], next); - v3[1] = quadraticAt$1(p0[1], p1[1], p2[1], next); - var diff = v2DistSquare(v2, center) - radiusSquare; + if (fromSymbol && fromSymbol !== 'none') { + var symbolSize = getSymbolSize(edge.node1); + scaleAndAdd(pts2[0], pts2[0], v, symbolSize * scale); + } - if (mathAbs$2(diff) < 1e-2) { - break; - } // let prevDiff = v2DistSquare(v1, center) - radiusSquare; + if (toSymbol && toSymbol !== 'none') { + var symbolSize = getSymbolSize(edge.node2); + scaleAndAdd(pts2[1], pts2[1], v, -symbolSize * scale); + } + copy(linePoints[0], pts2[0]); + copy(linePoints[1], pts2[1]); + } + }); + } - var nextDiff = v2DistSquare(v3, center) - radiusSquare; - interval /= 2; + function isViewCoordSys(coordSys) { + return coordSys.type === 'view'; + } - if (diff < 0) { - if (nextDiff >= 0) { - t = t + interval; - } else { - t = t - interval; - } - } else { - if (nextDiff >= 0) { - t = t - interval; - } else { - t = t + interval; - } - } - } + var GraphView = + /** @class */ + function (_super) { + __extends(GraphView, _super); + + function GraphView() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = GraphView.type; + return _this; + } + + GraphView.prototype.init = function (ecModel, api) { + var symbolDraw = new SymbolDraw(); + var lineDraw = new LineDraw(); + var group = this.group; + this._controller = new RoamController(api.getZr()); + this._controllerHost = { + target: group + }; + group.add(symbolDraw.group); + group.add(lineDraw.group); + this._symbolDraw = symbolDraw; + this._lineDraw = lineDraw; + this._firstRender = true; + }; + + GraphView.prototype.render = function (seriesModel, ecModel, api) { + var _this = this; - return t; - } // Adjust edge to avoid + var coordSys = seriesModel.coordinateSystem; + this._model = seriesModel; + var symbolDraw = this._symbolDraw; + var lineDraw = this._lineDraw; + var group = this.group; + + if (isViewCoordSys(coordSys)) { + var groupNewProp = { + x: coordSys.x, + y: coordSys.y, + scaleX: coordSys.scaleX, + scaleY: coordSys.scaleY + }; + + if (this._firstRender) { + group.attr(groupNewProp); + } else { + updateProps(group, groupNewProp, seriesModel); + } + } // Fix edge contact point with node + + + adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel)); + var data = seriesModel.getData(); + symbolDraw.updateData(data); + var edgeData = seriesModel.getEdgeData(); // TODO: TYPE + lineDraw.updateData(edgeData); - function adjustEdge(graph, scale) { - var tmp0 = []; - var quadraticSubdivide$1 = quadraticSubdivide; - var pts = [[], [], []]; - var pts2 = [[], []]; - var v = []; - scale /= 2; - graph.eachEdge(function (edge, idx) { - var linePoints = edge.getLayout(); - var fromSymbol = edge.getVisual('fromSymbol'); - var toSymbol = edge.getVisual('toSymbol'); + this._updateNodeAndLinkScale(); - if (!linePoints.__original) { - linePoints.__original = [clone$1(linePoints[0]), clone$1(linePoints[1])]; + this._updateController(seriesModel, ecModel, api); - if (linePoints[2]) { - linePoints.__original.push(clone$1(linePoints[2])); - } - } + clearTimeout(this._layoutTimeout); + var forceLayout = seriesModel.forceLayout; + var layoutAnimation = seriesModel.get(['force', 'layoutAnimation']); - var originalPoints = linePoints.__original; // Quadratic curve + if (forceLayout) { + this._startForceLayoutIteration(forceLayout, layoutAnimation); + } - if (linePoints[2] != null) { - copy(pts[0], originalPoints[0]); - copy(pts[1], originalPoints[2]); - copy(pts[2], originalPoints[1]); + data.graph.eachNode(function (node) { + var idx = node.dataIndex; + var el = node.getGraphicEl(); + var itemModel = node.getModel(); - if (fromSymbol && fromSymbol !== 'none') { - var symbolSize = getSymbolSize(edge.node1); - var t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale); // Subdivide and get the second + if (!el) { + return; + } // Update draggable - quadraticSubdivide$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0); - pts[0][0] = tmp0[3]; - pts[1][0] = tmp0[4]; - quadraticSubdivide$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0); - pts[0][1] = tmp0[3]; - pts[1][1] = tmp0[4]; - } - if (toSymbol && toSymbol !== 'none') { - var symbolSize = getSymbolSize(edge.node2); - var t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale); // Subdivide and get the first + el.off('drag').off('dragend'); + var draggable = itemModel.get('draggable'); - quadraticSubdivide$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0); - pts[1][0] = tmp0[1]; - pts[2][0] = tmp0[2]; - quadraticSubdivide$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0); - pts[1][1] = tmp0[1]; - pts[2][1] = tmp0[2]; - } // Copy back to layout + if (draggable) { + el.on('drag', function () { + if (forceLayout) { + forceLayout.warmUp(); + !_this._layouting && _this._startForceLayoutIteration(forceLayout, layoutAnimation); + forceLayout.setFixed(idx); // Write position back to layout + data.setItemLayout(idx, [el.x, el.y]); + } + }).on('dragend', function () { + if (forceLayout) { + forceLayout.setUnfixed(idx); + } + }); + } - copy(linePoints[0], pts[0]); - copy(linePoints[1], pts[2]); - copy(linePoints[2], pts[1]); - } // Line - else { - copy(pts2[0], originalPoints[0]); - copy(pts2[1], originalPoints[1]); - sub(v, pts2[1], pts2[0]); - normalize(v, v); + el.setDraggable(draggable && !!forceLayout); + var focus = itemModel.get(['emphasis', 'focus']); - if (fromSymbol && fromSymbol !== 'none') { - var symbolSize = getSymbolSize(edge.node1); - scaleAndAdd(pts2[0], pts2[0], v, symbolSize * scale); - } + if (focus === 'adjacency') { + getECData(el).focus = node.getAdjacentDataIndices(); + } + }); + data.graph.eachEdge(function (edge) { + var el = edge.getGraphicEl(); + var focus = edge.getModel().get(['emphasis', 'focus']); - if (toSymbol && toSymbol !== 'none') { - var symbolSize = getSymbolSize(edge.node2); - scaleAndAdd(pts2[1], pts2[1], v, -symbolSize * scale); - } + if (!el) { + return; + } - copy(linePoints[0], pts2[0]); - copy(linePoints[1], pts2[1]); - } + if (focus === 'adjacency') { + getECData(el).focus = { + edge: [edge.dataIndex], + node: [edge.node1.dataIndex, edge.node2.dataIndex] + }; + } }); - } + var circularRotateLabel = seriesModel.get('layout') === 'circular' && seriesModel.get(['circular', 'rotateLabel']); + var cx = data.getLayout('cx'); + var cy = data.getLayout('cy'); + data.eachItemGraphicEl(function (el, idx) { + var itemModel = data.getItemModel(idx); + var labelRotate = itemModel.get(['label', 'rotate']) || 0; + var symbolPath = el.getSymbolPath(); - function isViewCoordSys(coordSys) { - return coordSys.type === 'view'; - } + if (circularRotateLabel) { + var pos = data.getItemLayout(idx); + var rad = Math.atan2(pos[1] - cy, pos[0] - cx); - var GraphView = - /** @class */ - function (_super) { - __extends(GraphView, _super); + if (rad < 0) { + rad = Math.PI * 2 + rad; + } - function GraphView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + var isLeft = pos[0] < cx; - _this.type = GraphView.type; - return _this; + if (isLeft) { + rad = rad - Math.PI; } - GraphView.prototype.init = function (ecModel, api) { - var symbolDraw = new SymbolDraw(); - var lineDraw = new LineDraw(); - var group = this.group; - this._controller = new RoamController(api.getZr()); - this._controllerHost = { - target: group - }; - group.add(symbolDraw.group); - group.add(lineDraw.group); - this._symbolDraw = symbolDraw; - this._lineDraw = lineDraw; - this._firstRender = true; - }; + var textPosition = isLeft ? 'left' : 'right'; + symbolPath.setTextConfig({ + rotation: -rad, + position: textPosition, + origin: 'center' + }); + var emphasisState = symbolPath.ensureState('emphasis'); + extend(emphasisState.textConfig || (emphasisState.textConfig = {}), { + position: textPosition + }); + } else { + symbolPath.setTextConfig({ + rotation: labelRotate *= Math.PI / 180 + }); + } + }); + this._firstRender = false; + }; - GraphView.prototype.render = function (seriesModel, ecModel, api) { - var _this = this; - - var coordSys = seriesModel.coordinateSystem; - this._model = seriesModel; - var symbolDraw = this._symbolDraw; - var lineDraw = this._lineDraw; - var group = this.group; - - if (isViewCoordSys(coordSys)) { - var groupNewProp = { - x: coordSys.x, - y: coordSys.y, - scaleX: coordSys.scaleX, - scaleY: coordSys.scaleY - }; + GraphView.prototype.dispose = function () { + this._controller && this._controller.dispose(); + this._controllerHost = null; + }; - if (this._firstRender) { - group.attr(groupNewProp); - } else { - updateProps(group, groupNewProp, seriesModel); - } - } // Fix edge contact point with node + GraphView.prototype._startForceLayoutIteration = function (forceLayout, layoutAnimation) { + var self = this; + (function step() { + forceLayout.step(function (stopped) { + self.updateLayout(self._model); + (self._layouting = !stopped) && (layoutAnimation ? self._layoutTimeout = setTimeout(step, 16) : step()); + }); + })(); + }; + + GraphView.prototype._updateController = function (seriesModel, ecModel, api) { + var _this = this; + + var controller = this._controller; + var controllerHost = this._controllerHost; + var group = this.group; + controller.setPointerChecker(function (e, x, y) { + var rect = group.getBoundingRect(); + rect.applyTransform(group.transform); + return rect.contain(x, y) && !onIrrelevantElement(e, api, seriesModel); + }); - adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel)); - var data = seriesModel.getData(); - symbolDraw.updateData(data); - var edgeData = seriesModel.getEdgeData(); // TODO: TYPE + if (!isViewCoordSys(seriesModel.coordinateSystem)) { + controller.disable(); + return; + } - lineDraw.updateData(edgeData); + controller.enable(seriesModel.get('roam')); + controllerHost.zoomLimit = seriesModel.get('scaleLimit'); + controllerHost.zoom = seriesModel.coordinateSystem.getZoom(); + controller.off('pan').off('zoom').on('pan', function (e) { + updateViewOnPan(controllerHost, e.dx, e.dy); + api.dispatchAction({ + seriesId: seriesModel.id, + type: 'graphRoam', + dx: e.dx, + dy: e.dy + }); + }).on('zoom', function (e) { + updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY); + api.dispatchAction({ + seriesId: seriesModel.id, + type: 'graphRoam', + zoom: e.scale, + originX: e.originX, + originY: e.originY + }); - this._updateNodeAndLinkScale(); + _this._updateNodeAndLinkScale(); - this._updateController(seriesModel, ecModel, api); + adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel)); - clearTimeout(this._layoutTimeout); - var forceLayout = seriesModel.forceLayout; - var layoutAnimation = seriesModel.get(['force', 'layoutAnimation']); + _this._lineDraw.updateLayout(); // Only update label layout on zoom - if (forceLayout) { - this._startForceLayoutIteration(forceLayout, layoutAnimation); - } - data.graph.eachNode(function (node) { - var idx = node.dataIndex; - var el = node.getGraphicEl(); - var itemModel = node.getModel(); + api.updateLabelLayout(); + }); + }; - if (!el) { - return; - } // Update draggable + GraphView.prototype._updateNodeAndLinkScale = function () { + var seriesModel = this._model; + var data = seriesModel.getData(); + var nodeScale = getNodeGlobalScale(seriesModel); + data.eachItemGraphicEl(function (el, idx) { + el && el.setSymbolScale(nodeScale); + }); + }; + GraphView.prototype.updateLayout = function (seriesModel) { + adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel)); - el.off('drag').off('dragend'); - var draggable = itemModel.get('draggable'); + this._symbolDraw.updateLayout(); - if (draggable) { - el.on('drag', function () { - if (forceLayout) { - forceLayout.warmUp(); - !_this._layouting && _this._startForceLayoutIteration(forceLayout, layoutAnimation); - forceLayout.setFixed(idx); // Write position back to layout + this._lineDraw.updateLayout(); + }; - data.setItemLayout(idx, [el.x, el.y]); - } - }).on('dragend', function () { - if (forceLayout) { - forceLayout.setUnfixed(idx); - } - }); - } + GraphView.prototype.remove = function (ecModel, api) { + this._symbolDraw && this._symbolDraw.remove(); + this._lineDraw && this._lineDraw.remove(); + }; - el.setDraggable(draggable && !!forceLayout); - var focus = itemModel.get(['emphasis', 'focus']); + GraphView.type = 'graph'; + return GraphView; + }(ChartView); - if (focus === 'adjacency') { - getECData(el).focus = node.getAdjacentDataIndices(); - } - }); - data.graph.eachEdge(function (edge) { - var el = edge.getGraphicEl(); - var focus = edge.getModel().get(['emphasis', 'focus']); + function generateNodeKey(id) { + return '_EC_' + id; + } - if (!el) { - return; - } + var Graph = + /** @class */ + function () { + function Graph(directed) { + this.type = 'graph'; + this.nodes = []; + this.edges = []; + this._nodesMap = {}; + /** + * @type {Object.} + * @private + */ - if (focus === 'adjacency') { - getECData(el).focus = { - edge: [edge.dataIndex], - node: [edge.node1.dataIndex, edge.node2.dataIndex] - }; - } - }); - var circularRotateLabel = seriesModel.get('layout') === 'circular' && seriesModel.get(['circular', 'rotateLabel']); - var cx = data.getLayout('cx'); - var cy = data.getLayout('cy'); - data.eachItemGraphicEl(function (el, idx) { - var itemModel = data.getItemModel(idx); - var labelRotate = itemModel.get(['label', 'rotate']) || 0; - var symbolPath = el.getSymbolPath(); - - if (circularRotateLabel) { - var pos = data.getItemLayout(idx); - var rad = Math.atan2(pos[1] - cy, pos[0] - cx); - - if (rad < 0) { - rad = Math.PI * 2 + rad; - } + this._edgesMap = {}; + this._directed = directed || false; + } + /** + * If is directed graph + */ - var isLeft = pos[0] < cx; - if (isLeft) { - rad = rad - Math.PI; - } + Graph.prototype.isDirected = function () { + return this._directed; + }; + /** + * Add a new node + */ - var textPosition = isLeft ? 'left' : 'right'; - symbolPath.setTextConfig({ - rotation: -rad, - position: textPosition, - origin: 'center' - }); - var emphasisState = symbolPath.ensureState('emphasis'); - extend(emphasisState.textConfig || (emphasisState.textConfig = {}), { - position: textPosition - }); - } else { - symbolPath.setTextConfig({ - rotation: labelRotate *= Math.PI / 180 - }); - } - }); - this._firstRender = false; - }; + Graph.prototype.addNode = function (id, dataIndex) { + id = id == null ? '' + dataIndex : '' + id; + var nodesMap = this._nodesMap; - GraphView.prototype.dispose = function () { - this._controller && this._controller.dispose(); - this._controllerHost = null; - }; + if (nodesMap[generateNodeKey(id)]) { + if ("development" !== 'production') { + console.error('Graph nodes have duplicate name or id'); + } - GraphView.prototype._startForceLayoutIteration = function (forceLayout, layoutAnimation) { - var self = this; + return; + } - (function step() { - forceLayout.step(function (stopped) { - self.updateLayout(self._model); - (self._layouting = !stopped) && (layoutAnimation ? self._layoutTimeout = setTimeout(step, 16) : step()); - }); - })(); - }; + var node = new GraphNode(id, dataIndex); + node.hostGraph = this; + this.nodes.push(node); + nodesMap[generateNodeKey(id)] = node; + return node; + }; + /** + * Get node by data index + */ - GraphView.prototype._updateController = function (seriesModel, ecModel, api) { - var _this = this; + Graph.prototype.getNodeByIndex = function (dataIndex) { + var rawIdx = this.data.getRawIndex(dataIndex); + return this.nodes[rawIdx]; + }; + /** + * Get node by id + */ - var controller = this._controller; - var controllerHost = this._controllerHost; - var group = this.group; - controller.setPointerChecker(function (e, x, y) { - var rect = group.getBoundingRect(); - rect.applyTransform(group.transform); - return rect.contain(x, y) && !onIrrelevantElement(e, api, seriesModel); - }); + Graph.prototype.getNodeById = function (id) { + return this._nodesMap[generateNodeKey(id)]; + }; + /** + * Add a new edge + */ - if (!isViewCoordSys(seriesModel.coordinateSystem)) { - controller.disable(); - return; - } + Graph.prototype.addEdge = function (n1, n2, dataIndex) { + var nodesMap = this._nodesMap; + var edgesMap = this._edgesMap; // PNEDING - controller.enable(seriesModel.get('roam')); - controllerHost.zoomLimit = seriesModel.get('scaleLimit'); - controllerHost.zoom = seriesModel.coordinateSystem.getZoom(); - controller.off('pan').off('zoom').on('pan', function (e) { - updateViewOnPan(controllerHost, e.dx, e.dy); - api.dispatchAction({ - seriesId: seriesModel.id, - type: 'graphRoam', - dx: e.dx, - dy: e.dy - }); - }).on('zoom', function (e) { - updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY); - api.dispatchAction({ - seriesId: seriesModel.id, - type: 'graphRoam', - zoom: e.scale, - originX: e.originX, - originY: e.originY - }); + if (isNumber(n1)) { + n1 = this.nodes[n1]; + } - _this._updateNodeAndLinkScale(); + if (isNumber(n2)) { + n2 = this.nodes[n2]; + } - adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel)); + if (!(n1 instanceof GraphNode)) { + n1 = nodesMap[generateNodeKey(n1)]; + } - _this._lineDraw.updateLayout(); // Only update label layout on zoom + if (!(n2 instanceof GraphNode)) { + n2 = nodesMap[generateNodeKey(n2)]; + } + if (!n1 || !n2) { + return; + } - api.updateLabelLayout(); - }); - }; + var key = n1.id + '-' + n2.id; + var edge = new GraphEdge(n1, n2, dataIndex); + edge.hostGraph = this; - GraphView.prototype._updateNodeAndLinkScale = function () { - var seriesModel = this._model; - var data = seriesModel.getData(); - var nodeScale = getNodeGlobalScale(seriesModel); - data.eachItemGraphicEl(function (el, idx) { - el && el.setSymbolScale(nodeScale); - }); - }; + if (this._directed) { + n1.outEdges.push(edge); + n2.inEdges.push(edge); + } - GraphView.prototype.updateLayout = function (seriesModel) { - adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel)); + n1.edges.push(edge); - this._symbolDraw.updateLayout(); + if (n1 !== n2) { + n2.edges.push(edge); + } - this._lineDraw.updateLayout(); - }; + this.edges.push(edge); + edgesMap[key] = edge; + return edge; + }; + /** + * Get edge by data index + */ - GraphView.prototype.remove = function (ecModel, api) { - this._symbolDraw && this._symbolDraw.remove(); - this._lineDraw && this._lineDraw.remove(); - }; + Graph.prototype.getEdgeByIndex = function (dataIndex) { + var rawIdx = this.edgeData.getRawIndex(dataIndex); + return this.edges[rawIdx]; + }; + /** + * Get edge by two linked nodes + */ - GraphView.type = 'graph'; - return GraphView; - }(ChartView); + Graph.prototype.getEdge = function (n1, n2) { + if (n1 instanceof GraphNode) { + n1 = n1.id; + } - function generateNodeKey(id) { - return '_EC_' + id; - } + if (n2 instanceof GraphNode) { + n2 = n2.id; + } - var Graph = - /** @class */ - function () { - function Graph(directed) { - this.type = 'graph'; - this.nodes = []; - this.edges = []; - this._nodesMap = {}; - /** - * @type {Object.} - * @private - */ + var edgesMap = this._edgesMap; - this._edgesMap = {}; - this._directed = directed || false; - } - /** - * If is directed graph - */ + if (this._directed) { + return edgesMap[n1 + '-' + n2]; + } else { + return edgesMap[n1 + '-' + n2] || edgesMap[n2 + '-' + n1]; + } + }; + /** + * Iterate all nodes + */ + Graph.prototype.eachNode = function (cb, context) { + var nodes = this.nodes; + var len = nodes.length; - Graph.prototype.isDirected = function () { - return this._directed; - }; - /** - * Add a new node - */ + for (var i = 0; i < len; i++) { + if (nodes[i].dataIndex >= 0) { + cb.call(context, nodes[i], i); + } + } + }; + /** + * Iterate all edges + */ - Graph.prototype.addNode = function (id, dataIndex) { - id = id == null ? '' + dataIndex : '' + id; - var nodesMap = this._nodesMap; + Graph.prototype.eachEdge = function (cb, context) { + var edges = this.edges; + var len = edges.length; - if (nodesMap[generateNodeKey(id)]) { - if ("development" !== 'production') { - console.error('Graph nodes have duplicate name or id'); - } + for (var i = 0; i < len; i++) { + if (edges[i].dataIndex >= 0 && edges[i].node1.dataIndex >= 0 && edges[i].node2.dataIndex >= 0) { + cb.call(context, edges[i], i); + } + } + }; + /** + * Breadth first traverse + * Return true to stop traversing + */ - return; - } + Graph.prototype.breadthFirstTraverse = function (cb, startNode, direction, context) { + if (!(startNode instanceof GraphNode)) { + startNode = this._nodesMap[generateNodeKey(startNode)]; + } - var node = new GraphNode(id, dataIndex); - node.hostGraph = this; - this.nodes.push(node); - nodesMap[generateNodeKey(id)] = node; - return node; - }; - /** - * Get node by data index - */ - - Graph.prototype.getNodeByIndex = function (dataIndex) { - var rawIdx = this.data.getRawIndex(dataIndex); - return this.nodes[rawIdx]; - }; - /** - * Get node by id - */ - - Graph.prototype.getNodeById = function (id) { - return this._nodesMap[generateNodeKey(id)]; - }; - /** - * Add a new edge - */ - - Graph.prototype.addEdge = function (n1, n2, dataIndex) { - var nodesMap = this._nodesMap; - var edgesMap = this._edgesMap; // PNEDING - - if (isNumber(n1)) { - n1 = this.nodes[n1]; - } - - if (isNumber(n2)) { - n2 = this.nodes[n2]; - } - - if (!(n1 instanceof GraphNode)) { - n1 = nodesMap[generateNodeKey(n1)]; - } - - if (!(n2 instanceof GraphNode)) { - n2 = nodesMap[generateNodeKey(n2)]; - } - - if (!n1 || !n2) { - return; - } - - var key = n1.id + '-' + n2.id; - var edge = new GraphEdge(n1, n2, dataIndex); - edge.hostGraph = this; - - if (this._directed) { - n1.outEdges.push(edge); - n2.inEdges.push(edge); - } - - n1.edges.push(edge); - - if (n1 !== n2) { - n2.edges.push(edge); - } - - this.edges.push(edge); - edgesMap[key] = edge; - return edge; - }; - /** - * Get edge by data index - */ - - Graph.prototype.getEdgeByIndex = function (dataIndex) { - var rawIdx = this.edgeData.getRawIndex(dataIndex); - return this.edges[rawIdx]; - }; - /** - * Get edge by two linked nodes - */ - - Graph.prototype.getEdge = function (n1, n2) { - if (n1 instanceof GraphNode) { - n1 = n1.id; - } - - if (n2 instanceof GraphNode) { - n2 = n2.id; - } - - var edgesMap = this._edgesMap; - - if (this._directed) { - return edgesMap[n1 + '-' + n2]; - } else { - return edgesMap[n1 + '-' + n2] || edgesMap[n2 + '-' + n1]; - } - }; - /** - * Iterate all nodes - */ - - Graph.prototype.eachNode = function (cb, context) { - var nodes = this.nodes; - var len = nodes.length; - - for (var i = 0; i < len; i++) { - if (nodes[i].dataIndex >= 0) { - cb.call(context, nodes[i], i); - } - } - }; - /** - * Iterate all edges - */ - - Graph.prototype.eachEdge = function (cb, context) { - var edges = this.edges; - var len = edges.length; - - for (var i = 0; i < len; i++) { - if (edges[i].dataIndex >= 0 && edges[i].node1.dataIndex >= 0 && edges[i].node2.dataIndex >= 0) { - cb.call(context, edges[i], i); - } - } - }; - /** - * Breadth first traverse - * Return true to stop traversing - */ - - Graph.prototype.breadthFirstTraverse = function (cb, startNode, direction, context) { - if (!(startNode instanceof GraphNode)) { - startNode = this._nodesMap[generateNodeKey(startNode)]; - } - - if (!startNode) { - return; - } + if (!startNode) { + return; + } - var edgeType = direction === 'out' ? 'outEdges' : direction === 'in' ? 'inEdges' : 'edges'; + var edgeType = direction === 'out' ? 'outEdges' : direction === 'in' ? 'inEdges' : 'edges'; - for (var i = 0; i < this.nodes.length; i++) { - this.nodes[i].__visited = false; - } + for (var i = 0; i < this.nodes.length; i++) { + this.nodes[i].__visited = false; + } - if (cb.call(context, startNode, null)) { - return; - } + if (cb.call(context, startNode, null)) { + return; + } - var queue = [startNode]; + var queue = [startNode]; - while (queue.length) { - var currentNode = queue.shift(); - var edges = currentNode[edgeType]; + while (queue.length) { + var currentNode = queue.shift(); + var edges = currentNode[edgeType]; - for (var i = 0; i < edges.length; i++) { - var e = edges[i]; - var otherNode = e.node1 === currentNode ? e.node2 : e.node1; + for (var i = 0; i < edges.length; i++) { + var e = edges[i]; + var otherNode = e.node1 === currentNode ? e.node2 : e.node1; - if (!otherNode.__visited) { - if (cb.call(context, otherNode, currentNode)) { - // Stop traversing - return; - } + if (!otherNode.__visited) { + if (cb.call(context, otherNode, currentNode)) { + // Stop traversing + return; + } - queue.push(otherNode); - otherNode.__visited = true; - } - } - } - }; - // depthFirstTraverse( - // cb, startNode, direction, context - // ) { - // }; - // Filter update + queue.push(otherNode); + otherNode.__visited = true; + } + } + } + }; + // depthFirstTraverse( + // cb, startNode, direction, context + // ) { + // }; + // Filter update - Graph.prototype.update = function () { - var data = this.data; - var edgeData = this.edgeData; - var nodes = this.nodes; - var edges = this.edges; + Graph.prototype.update = function () { + var data = this.data; + var edgeData = this.edgeData; + var nodes = this.nodes; + var edges = this.edges; - for (var i = 0, len = nodes.length; i < len; i++) { - nodes[i].dataIndex = -1; - } + for (var i = 0, len = nodes.length; i < len; i++) { + nodes[i].dataIndex = -1; + } - for (var i = 0, len = data.count(); i < len; i++) { - nodes[data.getRawIndex(i)].dataIndex = i; - } + for (var i = 0, len = data.count(); i < len; i++) { + nodes[data.getRawIndex(i)].dataIndex = i; + } - edgeData.filterSelf(function (idx) { - var edge = edges[edgeData.getRawIndex(idx)]; - return edge.node1.dataIndex >= 0 && edge.node2.dataIndex >= 0; - }); // Update edge + edgeData.filterSelf(function (idx) { + var edge = edges[edgeData.getRawIndex(idx)]; + return edge.node1.dataIndex >= 0 && edge.node2.dataIndex >= 0; + }); // Update edge - for (var i = 0, len = edges.length; i < len; i++) { - edges[i].dataIndex = -1; - } + for (var i = 0, len = edges.length; i < len; i++) { + edges[i].dataIndex = -1; + } - for (var i = 0, len = edgeData.count(); i < len; i++) { - edges[edgeData.getRawIndex(i)].dataIndex = i; - } - }; - /** - * @return {module:echarts/data/Graph} - */ + for (var i = 0, len = edgeData.count(); i < len; i++) { + edges[edgeData.getRawIndex(i)].dataIndex = i; + } + }; + /** + * @return {module:echarts/data/Graph} + */ - Graph.prototype.clone = function () { - var graph = new Graph(this._directed); - var nodes = this.nodes; - var edges = this.edges; + Graph.prototype.clone = function () { + var graph = new Graph(this._directed); + var nodes = this.nodes; + var edges = this.edges; - for (var i = 0; i < nodes.length; i++) { - graph.addNode(nodes[i].id, nodes[i].dataIndex); - } + for (var i = 0; i < nodes.length; i++) { + graph.addNode(nodes[i].id, nodes[i].dataIndex); + } - for (var i = 0; i < edges.length; i++) { - var e = edges[i]; - graph.addEdge(e.node1.id, e.node2.id, e.dataIndex); - } + for (var i = 0; i < edges.length; i++) { + var e = edges[i]; + graph.addEdge(e.node1.id, e.node2.id, e.dataIndex); + } - return graph; - }; - return Graph; - }(); + return graph; + }; + return Graph; + }(); var GraphNode = - /** @class */ - function () { - function GraphNode(id, dataIndex) { - this.inEdges = []; - this.outEdges = []; - this.edges = []; - this.dataIndex = -1; - this.id = id == null ? '' : id; - this.dataIndex = dataIndex == null ? -1 : dataIndex; - } - /** - * @return {number} - */ + /** @class */ + function () { + function GraphNode(id, dataIndex) { + this.inEdges = []; + this.outEdges = []; + this.edges = []; + this.dataIndex = -1; + this.id = id == null ? '' : id; + this.dataIndex = dataIndex == null ? -1 : dataIndex; + } + /** + * @return {number} + */ - GraphNode.prototype.degree = function () { - return this.edges.length; - }; - /** - * @return {number} - */ + GraphNode.prototype.degree = function () { + return this.edges.length; + }; + /** + * @return {number} + */ - GraphNode.prototype.inDegree = function () { - return this.inEdges.length; - }; - /** - * @return {number} - */ + GraphNode.prototype.inDegree = function () { + return this.inEdges.length; + }; + /** + * @return {number} + */ - GraphNode.prototype.outDegree = function () { - return this.outEdges.length; - }; + GraphNode.prototype.outDegree = function () { + return this.outEdges.length; + }; - GraphNode.prototype.getModel = function (path) { - if (this.dataIndex < 0) { - return; - } + GraphNode.prototype.getModel = function (path) { + if (this.dataIndex < 0) { + return; + } - var graph = this.hostGraph; - var itemModel = graph.data.getItemModel(this.dataIndex); - return itemModel.getModel(path); - }; + var graph = this.hostGraph; + var itemModel = graph.data.getItemModel(this.dataIndex); + return itemModel.getModel(path); + }; - GraphNode.prototype.getAdjacentDataIndices = function () { - var dataIndices = { - edge: [], - node: [] - }; + GraphNode.prototype.getAdjacentDataIndices = function () { + var dataIndices = { + edge: [], + node: [] + }; - for (var i = 0; i < this.edges.length; i++) { - var adjacentEdge = this.edges[i]; + for (var i = 0; i < this.edges.length; i++) { + var adjacentEdge = this.edges[i]; - if (adjacentEdge.dataIndex < 0) { - continue; - } + if (adjacentEdge.dataIndex < 0) { + continue; + } - dataIndices.edge.push(adjacentEdge.dataIndex); - dataIndices.node.push(adjacentEdge.node1.dataIndex, adjacentEdge.node2.dataIndex); - } + dataIndices.edge.push(adjacentEdge.dataIndex); + dataIndices.node.push(adjacentEdge.node1.dataIndex, adjacentEdge.node2.dataIndex); + } - return dataIndices; - }; + return dataIndices; + }; - return GraphNode; - }(); + return GraphNode; + }(); var GraphEdge = - /** @class */ - function () { - function GraphEdge(n1, n2, dataIndex) { - this.dataIndex = -1; - this.node1 = n1; - this.node2 = n2; - this.dataIndex = dataIndex == null ? -1 : dataIndex; - } // eslint-disable-next-line @typescript-eslint/no-unused-vars + /** @class */ + function () { + function GraphEdge(n1, n2, dataIndex) { + this.dataIndex = -1; + this.node1 = n1; + this.node2 = n2; + this.dataIndex = dataIndex == null ? -1 : dataIndex; + } // eslint-disable-next-line @typescript-eslint/no-unused-vars - GraphEdge.prototype.getModel = function (path) { - if (this.dataIndex < 0) { - return; - } + GraphEdge.prototype.getModel = function (path) { + if (this.dataIndex < 0) { + return; + } - var graph = this.hostGraph; - var itemModel = graph.edgeData.getItemModel(this.dataIndex); - return itemModel.getModel(path); - }; + var graph = this.hostGraph; + var itemModel = graph.edgeData.getItemModel(this.dataIndex); + return itemModel.getModel(path); + }; - GraphEdge.prototype.getAdjacentDataIndices = function () { - return { - edge: [this.dataIndex], - node: [this.node1.dataIndex, this.node2.dataIndex] - }; - }; + GraphEdge.prototype.getAdjacentDataIndices = function () { + return { + edge: [this.dataIndex], + node: [this.node1.dataIndex, this.node2.dataIndex] + }; + }; - return GraphEdge; - }(); + return GraphEdge; + }(); function createGraphDataProxyMixin(hostName, dataName) { - return { - /** - * @param Default 'value'. can be 'a', 'b', 'c', 'd', 'e'. - */ - getValue: function (dimension) { - var data = this[hostName][dataName]; - return data.getStore().get(data.getDimensionIndex(dimension || 'value'), this.dataIndex); - }, - // TODO: TYPE stricter type. - setVisual: function (key, value) { - this.dataIndex >= 0 && this[hostName][dataName].setItemVisual(this.dataIndex, key, value); - }, - getVisual: function (key) { - return this[hostName][dataName].getItemVisual(this.dataIndex, key); - }, - setLayout: function (layout, merge) { - this.dataIndex >= 0 && this[hostName][dataName].setItemLayout(this.dataIndex, layout, merge); - }, - getLayout: function () { - return this[hostName][dataName].getItemLayout(this.dataIndex); - }, - getGraphicEl: function () { - return this[hostName][dataName].getItemGraphicEl(this.dataIndex); - }, - getRawIndex: function () { - return this[hostName][dataName].getRawIndex(this.dataIndex); - } - }; + return { + /** + * @param Default 'value'. can be 'a', 'b', 'c', 'd', 'e'. + */ + getValue: function (dimension) { + var data = this[hostName][dataName]; + return data.getStore().get(data.getDimensionIndex(dimension || 'value'), this.dataIndex); + }, + // TODO: TYPE stricter type. + setVisual: function (key, value) { + this.dataIndex >= 0 && this[hostName][dataName].setItemVisual(this.dataIndex, key, value); + }, + getVisual: function (key) { + return this[hostName][dataName].getItemVisual(this.dataIndex, key); + }, + setLayout: function (layout, merge) { + this.dataIndex >= 0 && this[hostName][dataName].setItemLayout(this.dataIndex, layout, merge); + }, + getLayout: function () { + return this[hostName][dataName].getItemLayout(this.dataIndex); + }, + getGraphicEl: function () { + return this[hostName][dataName].getItemGraphicEl(this.dataIndex); + }, + getRawIndex: function () { + return this[hostName][dataName].getRawIndex(this.dataIndex); + } + }; } mixin(GraphNode, createGraphDataProxyMixin('hostGraph', 'data')); mixin(GraphEdge, createGraphDataProxyMixin('hostGraph', 'edgeData')); function createGraphFromNodeEdge(nodes, edges, seriesModel, directed, beforeLink) { - // ??? TODO - // support dataset? - var graph = new Graph(directed); - - for (var i = 0; i < nodes.length; i++) { - graph.addNode(retrieve( // Id, name, dataIndex - nodes[i].id, nodes[i].name, i), i); - } - - var linkNameList = []; - var validEdges = []; - var linkCount = 0; - - for (var i = 0; i < edges.length; i++) { - var link = edges[i]; - var source = link.source; - var target = link.target; // addEdge may fail when source or target not exists - - if (graph.addEdge(source, target, linkCount)) { - validEdges.push(link); - linkNameList.push(retrieve(convertOptionIdName(link.id, null), source + ' > ' + target)); - linkCount++; - } - } - - var coordSys = seriesModel.get('coordinateSystem'); - var nodeData; - - if (coordSys === 'cartesian2d' || coordSys === 'polar') { - nodeData = createSeriesData(nodes, seriesModel); - } else { - var coordSysCtor = CoordinateSystemManager.get(coordSys); - var coordDimensions = coordSysCtor ? coordSysCtor.dimensions || [] : []; // FIXME: Some geo do not need `value` dimenson, whereas `calendar` needs - // `value` dimension, but graph need `value` dimension. It's better to - // uniform this behavior. - - if (indexOf(coordDimensions, 'value') < 0) { - coordDimensions.concat(['value']); - } - - var dimensions = prepareSeriesDataSchema(nodes, { - coordDimensions: coordDimensions, - encodeDefine: seriesModel.getEncode() - }).dimensions; - nodeData = new SeriesData(dimensions, seriesModel); - nodeData.initData(nodes); + // ??? TODO + // support dataset? + var graph = new Graph(directed); + + for (var i = 0; i < nodes.length; i++) { + graph.addNode(retrieve( // Id, name, dataIndex + nodes[i].id, nodes[i].name, i), i); + } + + var linkNameList = []; + var validEdges = []; + var linkCount = 0; + + for (var i = 0; i < edges.length; i++) { + var link = edges[i]; + var source = link.source; + var target = link.target; // addEdge may fail when source or target not exists + + if (graph.addEdge(source, target, linkCount)) { + validEdges.push(link); + linkNameList.push(retrieve(convertOptionIdName(link.id, null), source + ' > ' + target)); + linkCount++; + } + } + + var coordSys = seriesModel.get('coordinateSystem'); + var nodeData; + + if (coordSys === 'cartesian2d' || coordSys === 'polar') { + nodeData = createSeriesData(nodes, seriesModel); + } else { + var coordSysCtor = CoordinateSystemManager.get(coordSys); + var coordDimensions = coordSysCtor ? coordSysCtor.dimensions || [] : []; // FIXME: Some geo do not need `value` dimenson, whereas `calendar` needs + // `value` dimension, but graph need `value` dimension. It's better to + // uniform this behavior. + + if (indexOf(coordDimensions, 'value') < 0) { + coordDimensions.concat(['value']); + } + + var dimensions = prepareSeriesDataSchema(nodes, { + coordDimensions: coordDimensions, + encodeDefine: seriesModel.getEncode() + }).dimensions; + nodeData = new SeriesData(dimensions, seriesModel); + nodeData.initData(nodes); + } + + var edgeData = new SeriesData(['value'], seriesModel); + edgeData.initData(validEdges, linkNameList); + beforeLink && beforeLink(nodeData, edgeData); + linkSeriesData({ + mainData: nodeData, + struct: graph, + structAttr: 'graph', + datas: { + node: nodeData, + edge: edgeData + }, + datasAttr: { + node: 'data', + edge: 'edgeData' } + }); // Update dataIndex of nodes and edges because invalid edge may be removed - var edgeData = new SeriesData(['value'], seriesModel); - edgeData.initData(validEdges, linkNameList); - beforeLink && beforeLink(nodeData, edgeData); - linkSeriesData({ - mainData: nodeData, - struct: graph, - structAttr: 'graph', - datas: { - node: nodeData, - edge: edgeData - }, - datasAttr: { - node: 'data', - edge: 'edgeData' - } - }); // Update dataIndex of nodes and edges because invalid edge may be removed - - graph.update(); - return graph; + graph.update(); + return graph; } var GraphSeriesModel = - /** @class */ - function (_super) { - __extends(GraphSeriesModel, _super); - - function GraphSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = GraphSeriesModel.type; - _this.hasSymbolVisual = true; - return _this; - } - - GraphSeriesModel.prototype.init = function (option) { - _super.prototype.init.apply(this, arguments); - - var self = this; + /** @class */ + function (_super) { + __extends(GraphSeriesModel, _super); - function getCategoriesData() { - return self._categoriesData; - } // Provide data for legend select + function GraphSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.type = GraphSeriesModel.type; + _this.hasSymbolVisual = true; + return _this; + } - this.legendVisualProvider = new LegendVisualProvider(getCategoriesData, getCategoriesData); - this.fillDataTextStyle(option.edges || option.links); - - this._updateCategoriesData(); - }; - - GraphSeriesModel.prototype.mergeOption = function (option) { - _super.prototype.mergeOption.apply(this, arguments); - - this.fillDataTextStyle(option.edges || option.links); - - this._updateCategoriesData(); - }; + GraphSeriesModel.prototype.init = function (option) { + _super.prototype.init.apply(this, arguments); - GraphSeriesModel.prototype.mergeDefaultAndTheme = function (option) { - _super.prototype.mergeDefaultAndTheme.apply(this, arguments); + var self = this; - defaultEmphasis(option, 'edgeLabel', ['show']); - }; + function getCategoriesData() { + return self._categoriesData; + } // Provide data for legend select - GraphSeriesModel.prototype.getInitialData = function (option, ecModel) { - var edges = option.edges || option.links || []; - var nodes = option.data || option.nodes || []; - var self = this; - - if (nodes && edges) { - // auto curveness - initCurvenessList(this); - var graph = createGraphFromNodeEdge(nodes, edges, this, true, beforeLink); - each(graph.edges, function (edge) { - createEdgeMapForCurveness(edge.node1, edge.node2, this, edge.dataIndex); - }, this); - return graph.data; - } - - function beforeLink(nodeData, edgeData) { - // Overwrite nodeData.getItemModel to - nodeData.wrapMethod('getItemModel', function (model) { - var categoriesModels = self._categoriesModels; - var categoryIdx = model.getShallow('category'); - var categoryModel = categoriesModels[categoryIdx]; - - if (categoryModel) { - categoryModel.parentModel = model.parentModel; - model.parentModel = categoryModel; - } - return model; - }); // TODO Inherit resolveParentPath by default in Model#getModel? + this.legendVisualProvider = new LegendVisualProvider(getCategoriesData, getCategoriesData); + this.fillDataTextStyle(option.edges || option.links); - var oldGetModel = Model.prototype.getModel; + this._updateCategoriesData(); + }; - function newGetModel(path, parentModel) { - var model = oldGetModel.call(this, path, parentModel); - model.resolveParentPath = resolveParentPath; - return model; - } + GraphSeriesModel.prototype.mergeOption = function (option) { + _super.prototype.mergeOption.apply(this, arguments); - edgeData.wrapMethod('getItemModel', function (model) { - model.resolveParentPath = resolveParentPath; - model.getModel = newGetModel; - return model; - }); + this.fillDataTextStyle(option.edges || option.links); - function resolveParentPath(pathArr) { - if (pathArr && (pathArr[0] === 'label' || pathArr[1] === 'label')) { - var newPathArr = pathArr.slice(); + this._updateCategoriesData(); + }; - if (pathArr[0] === 'label') { - newPathArr[0] = 'edgeLabel'; - } else if (pathArr[1] === 'label') { - newPathArr[1] = 'edgeLabel'; - } - - return newPathArr; - } + GraphSeriesModel.prototype.mergeDefaultAndTheme = function (option) { + _super.prototype.mergeDefaultAndTheme.apply(this, arguments); - return pathArr; - } - } - }; - - GraphSeriesModel.prototype.getGraph = function () { - return this.getData().graph; - }; - - GraphSeriesModel.prototype.getEdgeData = function () { - return this.getGraph().edgeData; - }; - - GraphSeriesModel.prototype.getCategoriesData = function () { - return this._categoriesData; - }; + defaultEmphasis(option, 'edgeLabel', ['show']); + }; - GraphSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - if (dataType === 'edge') { - var nodeData = this.getData(); - var params = this.getDataParams(dataIndex, dataType); - var edge = nodeData.graph.getEdgeByIndex(dataIndex); - var sourceName = nodeData.getName(edge.node1.dataIndex); - var targetName = nodeData.getName(edge.node2.dataIndex); - var nameArr = []; - sourceName != null && nameArr.push(sourceName); - targetName != null && nameArr.push(targetName); - return createTooltipMarkup('nameValue', { - name: nameArr.join(' > '), - value: params.value, - noValue: params.value == null - }); - } // dataType === 'node' or empty - - - var nodeMarkup = defaultSeriesFormatTooltip({ - series: this, - dataIndex: dataIndex, - multipleSeries: multipleSeries - }); - return nodeMarkup; - }; + GraphSeriesModel.prototype.getInitialData = function (option, ecModel) { + var edges = option.edges || option.links || []; + var nodes = option.data || option.nodes || []; + var self = this; - GraphSeriesModel.prototype._updateCategoriesData = function () { - var categories = map(this.option.categories || [], function (category) { - // Data must has value - return category.value != null ? category : extend({ - value: 0 - }, category); - }); - var categoriesData = new SeriesData(['value'], this); - categoriesData.initData(categories); - this._categoriesData = categoriesData; - this._categoriesModels = categoriesData.mapArray(function (idx) { - return categoriesData.getItemModel(idx); - }); - }; + if (nodes && edges) { + // auto curveness + initCurvenessList(this); + var graph = createGraphFromNodeEdge(nodes, edges, this, true, beforeLink); + each(graph.edges, function (edge) { + createEdgeMapForCurveness(edge.node1, edge.node2, this, edge.dataIndex); + }, this); + return graph.data; + } + + function beforeLink(nodeData, edgeData) { + // Overwrite nodeData.getItemModel to + nodeData.wrapMethod('getItemModel', function (model) { + var categoriesModels = self._categoriesModels; + var categoryIdx = model.getShallow('category'); + var categoryModel = categoriesModels[categoryIdx]; + + if (categoryModel) { + categoryModel.parentModel = model.parentModel; + model.parentModel = categoryModel; + } + + return model; + }); // TODO Inherit resolveParentPath by default in Model#getModel? + + var oldGetModel = Model.prototype.getModel; + + function newGetModel(path, parentModel) { + var model = oldGetModel.call(this, path, parentModel); + model.resolveParentPath = resolveParentPath; + return model; + } + + edgeData.wrapMethod('getItemModel', function (model) { + model.resolveParentPath = resolveParentPath; + model.getModel = newGetModel; + return model; + }); + + function resolveParentPath(pathArr) { + if (pathArr && (pathArr[0] === 'label' || pathArr[1] === 'label')) { + var newPathArr = pathArr.slice(); + + if (pathArr[0] === 'label') { + newPathArr[0] = 'edgeLabel'; + } else if (pathArr[1] === 'label') { + newPathArr[1] = 'edgeLabel'; + } + + return newPathArr; + } + + return pathArr; + } + } + }; + + GraphSeriesModel.prototype.getGraph = function () { + return this.getData().graph; + }; + + GraphSeriesModel.prototype.getEdgeData = function () { + return this.getGraph().edgeData; + }; + + GraphSeriesModel.prototype.getCategoriesData = function () { + return this._categoriesData; + }; + + GraphSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { + if (dataType === 'edge') { + var nodeData = this.getData(); + var params = this.getDataParams(dataIndex, dataType); + var edge = nodeData.graph.getEdgeByIndex(dataIndex); + var sourceName = nodeData.getName(edge.node1.dataIndex); + var targetName = nodeData.getName(edge.node2.dataIndex); + var nameArr = []; + sourceName != null && nameArr.push(sourceName); + targetName != null && nameArr.push(targetName); + return createTooltipMarkup('nameValue', { + name: nameArr.join(' > '), + value: params.value, + noValue: params.value == null + }); + } // dataType === 'node' or empty + + + var nodeMarkup = defaultSeriesFormatTooltip({ + series: this, + dataIndex: dataIndex, + multipleSeries: multipleSeries + }); + return nodeMarkup; + }; + + GraphSeriesModel.prototype._updateCategoriesData = function () { + var categories = map(this.option.categories || [], function (category) { + // Data must has value + return category.value != null ? category : extend({ + value: 0 + }, category); + }); + var categoriesData = new SeriesData(['value'], this); + categoriesData.initData(categories); + this._categoriesData = categoriesData; + this._categoriesModels = categoriesData.mapArray(function (idx) { + return categoriesData.getItemModel(idx); + }); + }; - GraphSeriesModel.prototype.setZoom = function (zoom) { - this.option.zoom = zoom; - }; + GraphSeriesModel.prototype.setZoom = function (zoom) { + this.option.zoom = zoom; + }; - GraphSeriesModel.prototype.setCenter = function (center) { - this.option.center = center; - }; + GraphSeriesModel.prototype.setCenter = function (center) { + this.option.center = center; + }; - GraphSeriesModel.prototype.isAnimationEnabled = function () { - return _super.prototype.isAnimationEnabled.call(this) // Not enable animation when do force layout - && !(this.get('layout') === 'force' && this.get(['force', 'layoutAnimation'])); - }; + GraphSeriesModel.prototype.isAnimationEnabled = function () { + return _super.prototype.isAnimationEnabled.call(this) // Not enable animation when do force layout + && !(this.get('layout') === 'force' && this.get(['force', 'layoutAnimation'])); + }; - GraphSeriesModel.type = 'series.graph'; - GraphSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar']; - GraphSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - coordinateSystem: 'view', - // Default option for all coordinate systems - // xAxisIndex: 0, - // yAxisIndex: 0, - // polarIndex: 0, - // geoIndex: 0, - legendHoverLink: true, - layout: null, - // Configuration of circular layout - circular: { - rotateLabel: false - }, - // Configuration of force directed layout - force: { - initLayout: null, - // Node repulsion. Can be an array to represent range. - repulsion: [0, 50], - gravity: 0.1, - // Initial friction - friction: 0.6, - // Edge length. Can be an array to represent range. - edgeLength: 30, - layoutAnimation: true - }, - left: 'center', - top: 'center', - // right: null, - // bottom: null, - // width: '80%', - // height: '80%', - symbol: 'circle', - symbolSize: 10, - edgeSymbol: ['none', 'none'], - edgeSymbolSize: 10, - edgeLabel: { - position: 'middle', - distance: 5 - }, - draggable: false, - roam: false, - // Default on center of graph - center: null, - zoom: 1, - // Symbol size scale ratio in roam - nodeScaleRatio: 0.6, - // cursor: null, - // categories: [], - // data: [] - // Or - // nodes: [] - // - // links: [] - // Or - // edges: [] - label: { - show: false, - formatter: '{b}' - }, - itemStyle: {}, - lineStyle: { - color: '#aaa', - width: 1, - opacity: 0.5 - }, - emphasis: { - scale: true, - label: { - show: true - } - }, - select: { - itemStyle: { - borderColor: '#212121' - } - } - }; - return GraphSeriesModel; - }(SeriesModel); + GraphSeriesModel.type = 'series.graph'; + GraphSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar']; + GraphSeriesModel.defaultOption = { + // zlevel: 0, + z: 2, + coordinateSystem: 'view', + // Default option for all coordinate systems + // xAxisIndex: 0, + // yAxisIndex: 0, + // polarIndex: 0, + // geoIndex: 0, + legendHoverLink: true, + layout: null, + // Configuration of circular layout + circular: { + rotateLabel: false + }, + // Configuration of force directed layout + force: { + initLayout: null, + // Node repulsion. Can be an array to represent range. + repulsion: [0, 50], + gravity: 0.1, + // Initial friction + friction: 0.6, + // Edge length. Can be an array to represent range. + edgeLength: 30, + layoutAnimation: true + }, + left: 'center', + top: 'center', + // right: null, + // bottom: null, + // width: '80%', + // height: '80%', + symbol: 'circle', + symbolSize: 10, + edgeSymbol: ['none', 'none'], + edgeSymbolSize: 10, + edgeLabel: { + position: 'middle', + distance: 5 + }, + draggable: false, + roam: false, + // Default on center of graph + center: null, + zoom: 1, + // Symbol size scale ratio in roam + nodeScaleRatio: 0.6, + // cursor: null, + // categories: [], + // data: [] + // Or + // nodes: [] + // + // links: [] + // Or + // edges: [] + label: { + show: false, + formatter: '{b}' + }, + itemStyle: {}, + lineStyle: { + color: '#aaa', + width: 1, + opacity: 0.5 + }, + emphasis: { + scale: true, + label: { + show: true + } + }, + select: { + itemStyle: { + borderColor: '#212121' + } + } + }; + return GraphSeriesModel; + }(SeriesModel); var actionInfo = { - type: 'graphRoam', - event: 'graphRoam', - update: 'none' + type: 'graphRoam', + event: 'graphRoam', + update: 'none' }; function install$d(registers) { - registers.registerChartView(GraphView); - registers.registerSeriesModel(GraphSeriesModel); - registers.registerProcessor(categoryFilter); - registers.registerVisual(categoryVisual); - registers.registerVisual(graphEdgeVisual); - registers.registerLayout(graphSimpleLayout); - registers.registerLayout(registers.PRIORITY.VISUAL.POST_CHART_LAYOUT, graphCircularLayout); - registers.registerLayout(graphForceLayout); - registers.registerCoordinateSystem('graphView', { - dimensions: View.dimensions, - create: createViewCoordSys - }); // Register legacy focus actions - - registers.registerAction({ - type: 'focusNodeAdjacency', - event: 'focusNodeAdjacency', - update: 'series:focusNodeAdjacency' - }, noop); - registers.registerAction({ - type: 'unfocusNodeAdjacency', - event: 'unfocusNodeAdjacency', - update: 'series:unfocusNodeAdjacency' - }, noop); // Register roam action. - - registers.registerAction(actionInfo, function (payload, ecModel) { - ecModel.eachComponent({ - mainType: 'series', - query: payload - }, function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; - var res = updateCenterAndZoom(coordSys, payload); - seriesModel.setCenter && seriesModel.setCenter(res.center); - seriesModel.setZoom && seriesModel.setZoom(res.zoom); - }); + registers.registerChartView(GraphView); + registers.registerSeriesModel(GraphSeriesModel); + registers.registerProcessor(categoryFilter); + registers.registerVisual(categoryVisual); + registers.registerVisual(graphEdgeVisual); + registers.registerLayout(graphSimpleLayout); + registers.registerLayout(registers.PRIORITY.VISUAL.POST_CHART_LAYOUT, graphCircularLayout); + registers.registerLayout(graphForceLayout); + registers.registerCoordinateSystem('graphView', { + dimensions: View.dimensions, + create: createViewCoordSys + }); // Register legacy focus actions + + registers.registerAction({ + type: 'focusNodeAdjacency', + event: 'focusNodeAdjacency', + update: 'series:focusNodeAdjacency' + }, noop); + registers.registerAction({ + type: 'unfocusNodeAdjacency', + event: 'unfocusNodeAdjacency', + update: 'series:unfocusNodeAdjacency' + }, noop); // Register roam action. + + registers.registerAction(actionInfo, function (payload, ecModel) { + ecModel.eachComponent({ + mainType: 'series', + query: payload + }, function (seriesModel) { + var coordSys = seriesModel.coordinateSystem; + var res = updateCenterAndZoom(coordSys, payload); + seriesModel.setCenter && seriesModel.setCenter(res.center); + seriesModel.setZoom && seriesModel.setZoom(res.zoom); }); + }); } var PointerShape = - /** @class */ - function () { - function PointerShape() { - this.angle = 0; - this.width = 10; - this.r = 10; - this.x = 0; - this.y = 0; - } - - return PointerShape; - }(); + /** @class */ + function () { + function PointerShape() { + this.angle = 0; + this.width = 10; + this.r = 10; + this.x = 0; + this.y = 0; + } + + return PointerShape; + }(); var PointerPath = - /** @class */ - function (_super) { - __extends(PointerPath, _super); + /** @class */ + function (_super) { + __extends(PointerPath, _super); - function PointerPath(opts) { - var _this = _super.call(this, opts) || this; + function PointerPath(opts) { + var _this = _super.call(this, opts) || this; - _this.type = 'pointer'; - return _this; - } + _this.type = 'pointer'; + return _this; + } - PointerPath.prototype.getDefaultShape = function () { - return new PointerShape(); - }; + PointerPath.prototype.getDefaultShape = function () { + return new PointerShape(); + }; - PointerPath.prototype.buildPath = function (ctx, shape) { - var mathCos = Math.cos; - var mathSin = Math.sin; - var r = shape.r; - var width = shape.width; - var angle = shape.angle; - var x = shape.x - mathCos(angle) * width * (width >= r / 3 ? 1 : 2); - var y = shape.y - mathSin(angle) * width * (width >= r / 3 ? 1 : 2); - angle = shape.angle - Math.PI / 2; - ctx.moveTo(x, y); - ctx.lineTo(shape.x + mathCos(angle) * width, shape.y + mathSin(angle) * width); - ctx.lineTo(shape.x + mathCos(shape.angle) * r, shape.y + mathSin(shape.angle) * r); - ctx.lineTo(shape.x - mathCos(angle) * width, shape.y - mathSin(angle) * width); - ctx.lineTo(x, y); - }; - - return PointerPath; - }(Path); + PointerPath.prototype.buildPath = function (ctx, shape) { + var mathCos = Math.cos; + var mathSin = Math.sin; + var r = shape.r; + var width = shape.width; + var angle = shape.angle; + var x = shape.x - mathCos(angle) * width * (width >= r / 3 ? 1 : 2); + var y = shape.y - mathSin(angle) * width * (width >= r / 3 ? 1 : 2); + angle = shape.angle - Math.PI / 2; + ctx.moveTo(x, y); + ctx.lineTo(shape.x + mathCos(angle) * width, shape.y + mathSin(angle) * width); + ctx.lineTo(shape.x + mathCos(shape.angle) * r, shape.y + mathSin(shape.angle) * r); + ctx.lineTo(shape.x - mathCos(angle) * width, shape.y - mathSin(angle) * width); + ctx.lineTo(x, y); + }; + + return PointerPath; + }(Path); function parsePosition(seriesModel, api) { - var center = seriesModel.get('center'); - var width = api.getWidth(); - var height = api.getHeight(); - var size = Math.min(width, height); - var cx = parsePercent$1(center[0], api.getWidth()); - var cy = parsePercent$1(center[1], api.getHeight()); - var r = parsePercent$1(seriesModel.get('radius'), size / 2); - return { - cx: cx, - cy: cy, - r: r - }; + var center = seriesModel.get('center'); + var width = api.getWidth(); + var height = api.getHeight(); + var size = Math.min(width, height); + var cx = parsePercent$1(center[0], api.getWidth()); + var cy = parsePercent$1(center[1], api.getHeight()); + var r = parsePercent$1(seriesModel.get('radius'), size / 2); + return { + cx: cx, + cy: cy, + r: r + }; } function formatLabel(value, labelFormatter) { - var label = value == null ? '' : value + ''; + var label = value == null ? '' : value + ''; - if (labelFormatter) { - if (isString(labelFormatter)) { - label = labelFormatter.replace('{value}', label); - } else if (isFunction(labelFormatter)) { - label = labelFormatter(value); - } + if (labelFormatter) { + if (isString(labelFormatter)) { + label = labelFormatter.replace('{value}', label); + } else if (isFunction(labelFormatter)) { + label = labelFormatter(value); } + } - return label; + return label; } var GaugeView = - /** @class */ - function (_super) { - __extends(GaugeView, _super); - - function GaugeView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = GaugeView.type; - return _this; - } - - GaugeView.prototype.render = function (seriesModel, ecModel, api) { - this.group.removeAll(); - var colorList = seriesModel.get(['axisLine', 'lineStyle', 'color']); - var posInfo = parsePosition(seriesModel, api); - - this._renderMain(seriesModel, ecModel, api, colorList, posInfo); - - this._data = seriesModel.getData(); - }; - - GaugeView.prototype.dispose = function () {}; - - GaugeView.prototype._renderMain = function (seriesModel, ecModel, api, colorList, posInfo) { - var group = this.group; - var clockwise = seriesModel.get('clockwise'); - var startAngle = -seriesModel.get('startAngle') / 180 * Math.PI; - var endAngle = -seriesModel.get('endAngle') / 180 * Math.PI; - var axisLineModel = seriesModel.getModel('axisLine'); - var roundCap = axisLineModel.get('roundCap'); - var MainPath = roundCap ? SausagePath : Sector; - var showAxis = axisLineModel.get('show'); - var lineStyleModel = axisLineModel.getModel('lineStyle'); - var axisLineWidth = lineStyleModel.get('width'); - var angles = [startAngle, endAngle]; - normalizeArcAngles(angles, !clockwise); - startAngle = angles[0]; - endAngle = angles[1]; - var angleRangeSpan = endAngle - startAngle; - var prevEndAngle = startAngle; - - for (var i = 0; showAxis && i < colorList.length; i++) { - // Clamp - var percent = Math.min(Math.max(colorList[i][0], 0), 1); - endAngle = startAngle + angleRangeSpan * percent; - var sector = new MainPath({ - shape: { - startAngle: prevEndAngle, - endAngle: endAngle, - cx: posInfo.cx, - cy: posInfo.cy, - clockwise: clockwise, - r0: posInfo.r - axisLineWidth, - r: posInfo.r - }, - silent: true - }); - sector.setStyle({ - fill: colorList[i][1] - }); - sector.setStyle(lineStyleModel.getLineStyle( // Because we use sector to simulate arc - // so the properties for stroking are useless - ['color', 'width'])); - group.add(sector); - prevEndAngle = endAngle; - } - - var getColor = function (percent) { - // Less than 0 - if (percent <= 0) { - return colorList[0][1]; - } - - var i; - - for (i = 0; i < colorList.length; i++) { - if (colorList[i][0] >= percent && (i === 0 ? 0 : colorList[i - 1][0]) < percent) { - return colorList[i][1]; - } - } // More than 1 - - - return colorList[i - 1][1]; - }; - - this._renderTicks(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth); - - this._renderTitleAndDetail(seriesModel, ecModel, api, getColor, posInfo); - - this._renderAnchor(seriesModel, posInfo); - - this._renderPointer(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth); - }; - - GaugeView.prototype._renderTicks = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) { - var group = this.group; - var cx = posInfo.cx; - var cy = posInfo.cy; - var r = posInfo.r; - var minVal = +seriesModel.get('min'); - var maxVal = +seriesModel.get('max'); - var splitLineModel = seriesModel.getModel('splitLine'); - var tickModel = seriesModel.getModel('axisTick'); - var labelModel = seriesModel.getModel('axisLabel'); - var splitNumber = seriesModel.get('splitNumber'); - var subSplitNumber = tickModel.get('splitNumber'); - var splitLineLen = parsePercent$1(splitLineModel.get('length'), r); - var tickLen = parsePercent$1(tickModel.get('length'), r); - var angle = startAngle; - var step = (endAngle - startAngle) / splitNumber; - var subStep = step / subSplitNumber; - var splitLineStyle = splitLineModel.getModel('lineStyle').getLineStyle(); - var tickLineStyle = tickModel.getModel('lineStyle').getLineStyle(); - var splitLineDistance = splitLineModel.get('distance'); - var unitX; - var unitY; - - for (var i = 0; i <= splitNumber; i++) { - unitX = Math.cos(angle); - unitY = Math.sin(angle); // Split line - - if (splitLineModel.get('show')) { - var distance = splitLineDistance ? splitLineDistance + axisLineWidth : axisLineWidth; - var splitLine = new Line({ - shape: { - x1: unitX * (r - distance) + cx, - y1: unitY * (r - distance) + cy, - x2: unitX * (r - splitLineLen - distance) + cx, - y2: unitY * (r - splitLineLen - distance) + cy - }, - style: splitLineStyle, - silent: true - }); - - if (splitLineStyle.stroke === 'auto') { - splitLine.setStyle({ - stroke: getColor(i / splitNumber) - }); - } - - group.add(splitLine); - } // Label - - - if (labelModel.get('show')) { - var distance = labelModel.get('distance') + splitLineDistance; - var label = formatLabel(round(i / splitNumber * (maxVal - minVal) + minVal), labelModel.get('formatter')); - var autoColor = getColor(i / splitNumber); - group.add(new ZRText({ - style: createTextStyle(labelModel, { - text: label, - x: unitX * (r - splitLineLen - distance) + cx, - y: unitY * (r - splitLineLen - distance) + cy, - verticalAlign: unitY < -0.8 ? 'top' : unitY > 0.8 ? 'bottom' : 'middle', - align: unitX < -0.4 ? 'left' : unitX > 0.4 ? 'right' : 'center' - }, { - inheritColor: autoColor - }), - silent: true - })); - } // Axis tick - - - if (tickModel.get('show') && i !== splitNumber) { - var distance = tickModel.get('distance'); - distance = distance ? distance + axisLineWidth : axisLineWidth; - - for (var j = 0; j <= subSplitNumber; j++) { - unitX = Math.cos(angle); - unitY = Math.sin(angle); - var tickLine = new Line({ - shape: { - x1: unitX * (r - distance) + cx, - y1: unitY * (r - distance) + cy, - x2: unitX * (r - tickLen - distance) + cx, - y2: unitY * (r - tickLen - distance) + cy - }, - silent: true, - style: tickLineStyle - }); - - if (tickLineStyle.stroke === 'auto') { - tickLine.setStyle({ - stroke: getColor((i + j / subSplitNumber) / splitNumber) - }); - } - - group.add(tickLine); - angle += subStep; - } - - angle -= subStep; - } else { - angle += step; - } - } - }; - - GaugeView.prototype._renderPointer = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) { - var group = this.group; - var oldData = this._data; - var oldProgressData = this._progressEls; - var progressList = []; - var showPointer = seriesModel.get(['pointer', 'show']); - var progressModel = seriesModel.getModel('progress'); - var showProgress = progressModel.get('show'); - var data = seriesModel.getData(); - var valueDim = data.mapDimension('value'); - var minVal = +seriesModel.get('min'); - var maxVal = +seriesModel.get('max'); - var valueExtent = [minVal, maxVal]; - var angleExtent = [startAngle, endAngle]; - - function createPointer(idx, angle) { - var itemModel = data.getItemModel(idx); - var pointerModel = itemModel.getModel('pointer'); - var pointerWidth = parsePercent$1(pointerModel.get('width'), posInfo.r); - var pointerLength = parsePercent$1(pointerModel.get('length'), posInfo.r); - var pointerStr = seriesModel.get(['pointer', 'icon']); - var pointerOffset = pointerModel.get('offsetCenter'); - var pointerOffsetX = parsePercent$1(pointerOffset[0], posInfo.r); - var pointerOffsetY = parsePercent$1(pointerOffset[1], posInfo.r); - var pointerKeepAspect = pointerModel.get('keepAspect'); - var pointer; // not exist icon type will be set 'rect' - - if (pointerStr) { - pointer = createSymbol(pointerStr, pointerOffsetX - pointerWidth / 2, pointerOffsetY - pointerLength, pointerWidth, pointerLength, null, pointerKeepAspect); - } else { - pointer = new PointerPath({ - shape: { - angle: -Math.PI / 2, - width: pointerWidth, - r: pointerLength, - x: pointerOffsetX, - y: pointerOffsetY - } - }); - } - - pointer.rotation = -(angle + Math.PI / 2); - pointer.x = posInfo.cx; - pointer.y = posInfo.cy; - return pointer; - } - - function createProgress(idx, endAngle) { - var roundCap = progressModel.get('roundCap'); - var ProgressPath = roundCap ? SausagePath : Sector; - var isOverlap = progressModel.get('overlap'); - var progressWidth = isOverlap ? progressModel.get('width') : axisLineWidth / data.count(); - var r0 = isOverlap ? posInfo.r - progressWidth : posInfo.r - (idx + 1) * progressWidth; - var r = isOverlap ? posInfo.r : posInfo.r - idx * progressWidth; - var progress = new ProgressPath({ - shape: { - startAngle: startAngle, - endAngle: endAngle, - cx: posInfo.cx, - cy: posInfo.cy, - clockwise: clockwise, - r0: r0, - r: r - } - }); - isOverlap && (progress.z2 = maxVal - data.get(valueDim, idx) % maxVal); - return progress; - } - - if (showProgress || showPointer) { - data.diff(oldData).add(function (idx) { - var val = data.get(valueDim, idx); + /** @class */ + function (_super) { + __extends(GaugeView, _super); + + function GaugeView() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = GaugeView.type; + return _this; + } + + GaugeView.prototype.render = function (seriesModel, ecModel, api) { + this.group.removeAll(); + var colorList = seriesModel.get(['axisLine', 'lineStyle', 'color']); + var posInfo = parsePosition(seriesModel, api); + + this._renderMain(seriesModel, ecModel, api, colorList, posInfo); + + this._data = seriesModel.getData(); + }; + + GaugeView.prototype.dispose = function () {}; + + GaugeView.prototype._renderMain = function (seriesModel, ecModel, api, colorList, posInfo) { + var group = this.group; + var clockwise = seriesModel.get('clockwise'); + var startAngle = -seriesModel.get('startAngle') / 180 * Math.PI; + var endAngle = -seriesModel.get('endAngle') / 180 * Math.PI; + var axisLineModel = seriesModel.getModel('axisLine'); + var roundCap = axisLineModel.get('roundCap'); + var MainPath = roundCap ? SausagePath : Sector; + var showAxis = axisLineModel.get('show'); + var lineStyleModel = axisLineModel.getModel('lineStyle'); + var axisLineWidth = lineStyleModel.get('width'); + var angles = [startAngle, endAngle]; + normalizeArcAngles(angles, !clockwise); + startAngle = angles[0]; + endAngle = angles[1]; + var angleRangeSpan = endAngle - startAngle; + var prevEndAngle = startAngle; + + for (var i = 0; showAxis && i < colorList.length; i++) { + // Clamp + var percent = Math.min(Math.max(colorList[i][0], 0), 1); + endAngle = startAngle + angleRangeSpan * percent; + var sector = new MainPath({ + shape: { + startAngle: prevEndAngle, + endAngle: endAngle, + cx: posInfo.cx, + cy: posInfo.cy, + clockwise: clockwise, + r0: posInfo.r - axisLineWidth, + r: posInfo.r + }, + silent: true + }); + sector.setStyle({ + fill: colorList[i][1] + }); + sector.setStyle(lineStyleModel.getLineStyle( // Because we use sector to simulate arc + // so the properties for stroking are useless + ['color', 'width'])); + group.add(sector); + prevEndAngle = endAngle; + } + + var getColor = function (percent) { + // Less than 0 + if (percent <= 0) { + return colorList[0][1]; + } + + var i; + + for (i = 0; i < colorList.length; i++) { + if (colorList[i][0] >= percent && (i === 0 ? 0 : colorList[i - 1][0]) < percent) { + return colorList[i][1]; + } + } // More than 1 + + + return colorList[i - 1][1]; + }; + + this._renderTicks(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth); + + this._renderTitleAndDetail(seriesModel, ecModel, api, getColor, posInfo); + + this._renderAnchor(seriesModel, posInfo); + + this._renderPointer(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth); + }; + + GaugeView.prototype._renderTicks = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) { + var group = this.group; + var cx = posInfo.cx; + var cy = posInfo.cy; + var r = posInfo.r; + var minVal = +seriesModel.get('min'); + var maxVal = +seriesModel.get('max'); + var splitLineModel = seriesModel.getModel('splitLine'); + var tickModel = seriesModel.getModel('axisTick'); + var labelModel = seriesModel.getModel('axisLabel'); + var splitNumber = seriesModel.get('splitNumber'); + var subSplitNumber = tickModel.get('splitNumber'); + var splitLineLen = parsePercent$1(splitLineModel.get('length'), r); + var tickLen = parsePercent$1(tickModel.get('length'), r); + var angle = startAngle; + var step = (endAngle - startAngle) / splitNumber; + var subStep = step / subSplitNumber; + var splitLineStyle = splitLineModel.getModel('lineStyle').getLineStyle(); + var tickLineStyle = tickModel.getModel('lineStyle').getLineStyle(); + var splitLineDistance = splitLineModel.get('distance'); + var unitX; + var unitY; + + for (var i = 0; i <= splitNumber; i++) { + unitX = Math.cos(angle); + unitY = Math.sin(angle); // Split line + + if (splitLineModel.get('show')) { + var distance = splitLineDistance ? splitLineDistance + axisLineWidth : axisLineWidth; + var splitLine = new Line({ + shape: { + x1: unitX * (r - distance) + cx, + y1: unitY * (r - distance) + cy, + x2: unitX * (r - splitLineLen - distance) + cx, + y2: unitY * (r - splitLineLen - distance) + cy + }, + style: splitLineStyle, + silent: true + }); - if (showPointer) { - var pointer = createPointer(idx, startAngle); // TODO hide pointer on NaN value? + if (splitLineStyle.stroke === 'auto') { + splitLine.setStyle({ + stroke: getColor(i / splitNumber) + }); + } + + group.add(splitLine); + } // Label + + + if (labelModel.get('show')) { + var distance = labelModel.get('distance') + splitLineDistance; + var label = formatLabel(round(i / splitNumber * (maxVal - minVal) + minVal), labelModel.get('formatter')); + var autoColor = getColor(i / splitNumber); + group.add(new ZRText({ + style: createTextStyle(labelModel, { + text: label, + x: unitX * (r - splitLineLen - distance) + cx, + y: unitY * (r - splitLineLen - distance) + cy, + verticalAlign: unitY < -0.8 ? 'top' : unitY > 0.8 ? 'bottom' : 'middle', + align: unitX < -0.4 ? 'left' : unitX > 0.4 ? 'right' : 'center' + }, { + inheritColor: autoColor + }), + silent: true + })); + } // Axis tick - initProps(pointer, { - rotation: -((isNaN(+val) ? angleExtent[0] : linearMap(val, valueExtent, angleExtent, true)) + Math.PI / 2) - }, seriesModel); - group.add(pointer); - data.setItemGraphicEl(idx, pointer); - } - if (showProgress) { - var progress = createProgress(idx, startAngle); - var isClip = progressModel.get('clip'); - initProps(progress, { - shape: { - endAngle: linearMap(val, valueExtent, angleExtent, isClip) - } - }, seriesModel); - group.add(progress); // Add data index and series index for indexing the data by element - // Useful in tooltip + if (tickModel.get('show') && i !== splitNumber) { + var distance = tickModel.get('distance'); + distance = distance ? distance + axisLineWidth : axisLineWidth; - setCommonECData(seriesModel.seriesIndex, data.dataType, idx, progress); - progressList[idx] = progress; - } - }).update(function (newIdx, oldIdx) { - var val = data.get(valueDim, newIdx); - - if (showPointer) { - var previousPointer = oldData.getItemGraphicEl(oldIdx); - var previousRotate = previousPointer ? previousPointer.rotation : startAngle; - var pointer = createPointer(newIdx, previousRotate); - pointer.rotation = previousRotate; - updateProps(pointer, { - rotation: -((isNaN(+val) ? angleExtent[0] : linearMap(val, valueExtent, angleExtent, true)) + Math.PI / 2) - }, seriesModel); - group.add(pointer); - data.setItemGraphicEl(newIdx, pointer); - } + for (var j = 0; j <= subSplitNumber; j++) { + unitX = Math.cos(angle); + unitY = Math.sin(angle); + var tickLine = new Line({ + shape: { + x1: unitX * (r - distance) + cx, + y1: unitY * (r - distance) + cy, + x2: unitX * (r - tickLen - distance) + cx, + y2: unitY * (r - tickLen - distance) + cy + }, + silent: true, + style: tickLineStyle + }); - if (showProgress) { - var previousProgress = oldProgressData[oldIdx]; - var previousEndAngle = previousProgress ? previousProgress.shape.endAngle : startAngle; - var progress = createProgress(newIdx, previousEndAngle); - var isClip = progressModel.get('clip'); - updateProps(progress, { - shape: { - endAngle: linearMap(val, valueExtent, angleExtent, isClip) - } - }, seriesModel); - group.add(progress); // Add data index and series index for indexing the data by element - // Useful in tooltip + if (tickLineStyle.stroke === 'auto') { + tickLine.setStyle({ + stroke: getColor((i + j / subSplitNumber) / splitNumber) + }); + } - setCommonECData(seriesModel.seriesIndex, data.dataType, newIdx, progress); - progressList[newIdx] = progress; - } - }).execute(); - data.each(function (idx) { - var itemModel = data.getItemModel(idx); - var emphasisModel = itemModel.getModel('emphasis'); - var focus = emphasisModel.get('focus'); - var blurScope = emphasisModel.get('blurScope'); - var emphasisDisabled = emphasisModel.get('disabled'); - - if (showPointer) { - var pointer = data.getItemGraphicEl(idx); - var symbolStyle = data.getItemVisual(idx, 'style'); - var visualColor = symbolStyle.fill; - - if (pointer instanceof ZRImage) { - var pathStyle = pointer.style; - pointer.useStyle(extend({ - image: pathStyle.image, - x: pathStyle.x, - y: pathStyle.y, - width: pathStyle.width, - height: pathStyle.height - }, symbolStyle)); - } else { - pointer.useStyle(symbolStyle); - pointer.type !== 'pointer' && pointer.setColor(visualColor); - } + group.add(tickLine); + angle += subStep; + } - pointer.setStyle(itemModel.getModel(['pointer', 'itemStyle']).getItemStyle()); + angle -= subStep; + } else { + angle += step; + } + } + }; - if (pointer.style.fill === 'auto') { - pointer.setStyle('fill', getColor(linearMap(data.get(valueDim, idx), valueExtent, [0, 1], true))); - } + GaugeView.prototype._renderPointer = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) { + var group = this.group; + var oldData = this._data; + var oldProgressData = this._progressEls; + var progressList = []; + var showPointer = seriesModel.get(['pointer', 'show']); + var progressModel = seriesModel.getModel('progress'); + var showProgress = progressModel.get('show'); + var data = seriesModel.getData(); + var valueDim = data.mapDimension('value'); + var minVal = +seriesModel.get('min'); + var maxVal = +seriesModel.get('max'); + var valueExtent = [minVal, maxVal]; + var angleExtent = [startAngle, endAngle]; + + function createPointer(idx, angle) { + var itemModel = data.getItemModel(idx); + var pointerModel = itemModel.getModel('pointer'); + var pointerWidth = parsePercent$1(pointerModel.get('width'), posInfo.r); + var pointerLength = parsePercent$1(pointerModel.get('length'), posInfo.r); + var pointerStr = seriesModel.get(['pointer', 'icon']); + var pointerOffset = pointerModel.get('offsetCenter'); + var pointerOffsetX = parsePercent$1(pointerOffset[0], posInfo.r); + var pointerOffsetY = parsePercent$1(pointerOffset[1], posInfo.r); + var pointerKeepAspect = pointerModel.get('keepAspect'); + var pointer; // not exist icon type will be set 'rect' + + if (pointerStr) { + pointer = createSymbol(pointerStr, pointerOffsetX - pointerWidth / 2, pointerOffsetY - pointerLength, pointerWidth, pointerLength, null, pointerKeepAspect); + } else { + pointer = new PointerPath({ + shape: { + angle: -Math.PI / 2, + width: pointerWidth, + r: pointerLength, + x: pointerOffsetX, + y: pointerOffsetY + } + }); + } + + pointer.rotation = -(angle + Math.PI / 2); + pointer.x = posInfo.cx; + pointer.y = posInfo.cy; + return pointer; + } + + function createProgress(idx, endAngle) { + var roundCap = progressModel.get('roundCap'); + var ProgressPath = roundCap ? SausagePath : Sector; + var isOverlap = progressModel.get('overlap'); + var progressWidth = isOverlap ? progressModel.get('width') : axisLineWidth / data.count(); + var r0 = isOverlap ? posInfo.r - progressWidth : posInfo.r - (idx + 1) * progressWidth; + var r = isOverlap ? posInfo.r : posInfo.r - idx * progressWidth; + var progress = new ProgressPath({ + shape: { + startAngle: startAngle, + endAngle: endAngle, + cx: posInfo.cx, + cy: posInfo.cy, + clockwise: clockwise, + r0: r0, + r: r + } + }); + isOverlap && (progress.z2 = maxVal - data.get(valueDim, idx) % maxVal); + return progress; + } - pointer.z2EmphasisLift = 0; - setStatesStylesFromModel(pointer, itemModel); - toggleHoverEmphasis(pointer, focus, blurScope, emphasisDisabled); - } + if (showProgress || showPointer) { + data.diff(oldData).add(function (idx) { + var val = data.get(valueDim, idx); - if (showProgress) { - var progress = progressList[idx]; - progress.useStyle(data.getItemVisual(idx, 'style')); - progress.setStyle(itemModel.getModel(['progress', 'itemStyle']).getItemStyle()); - progress.z2EmphasisLift = 0; - setStatesStylesFromModel(progress, itemModel); - toggleHoverEmphasis(progress, focus, blurScope, emphasisDisabled); - } - }); - this._progressEls = progressList; - } - }; + if (showPointer) { + var pointer = createPointer(idx, startAngle); // TODO hide pointer on NaN value? - GaugeView.prototype._renderAnchor = function (seriesModel, posInfo) { - var anchorModel = seriesModel.getModel('anchor'); - var showAnchor = anchorModel.get('show'); + initProps(pointer, { + rotation: -((isNaN(+val) ? angleExtent[0] : linearMap(val, valueExtent, angleExtent, true)) + Math.PI / 2) + }, seriesModel); + group.add(pointer); + data.setItemGraphicEl(idx, pointer); + } - if (showAnchor) { - var anchorSize = anchorModel.get('size'); - var anchorType = anchorModel.get('icon'); - var offsetCenter = anchorModel.get('offsetCenter'); - var anchorKeepAspect = anchorModel.get('keepAspect'); - var anchor = createSymbol(anchorType, posInfo.cx - anchorSize / 2 + parsePercent$1(offsetCenter[0], posInfo.r), posInfo.cy - anchorSize / 2 + parsePercent$1(offsetCenter[1], posInfo.r), anchorSize, anchorSize, null, anchorKeepAspect); - anchor.z2 = anchorModel.get('showAbove') ? 1 : 0; - anchor.setStyle(anchorModel.getModel('itemStyle').getItemStyle()); - this.group.add(anchor); + if (showProgress) { + var progress = createProgress(idx, startAngle); + var isClip = progressModel.get('clip'); + initProps(progress, { + shape: { + endAngle: linearMap(val, valueExtent, angleExtent, isClip) + } + }, seriesModel); + group.add(progress); // Add data index and series index for indexing the data by element + // Useful in tooltip + + setCommonECData(seriesModel.seriesIndex, data.dataType, idx, progress); + progressList[idx] = progress; + } + }).update(function (newIdx, oldIdx) { + var val = data.get(valueDim, newIdx); + + if (showPointer) { + var previousPointer = oldData.getItemGraphicEl(oldIdx); + var previousRotate = previousPointer ? previousPointer.rotation : startAngle; + var pointer = createPointer(newIdx, previousRotate); + pointer.rotation = previousRotate; + updateProps(pointer, { + rotation: -((isNaN(+val) ? angleExtent[0] : linearMap(val, valueExtent, angleExtent, true)) + Math.PI / 2) + }, seriesModel); + group.add(pointer); + data.setItemGraphicEl(newIdx, pointer); + } + + if (showProgress) { + var previousProgress = oldProgressData[oldIdx]; + var previousEndAngle = previousProgress ? previousProgress.shape.endAngle : startAngle; + var progress = createProgress(newIdx, previousEndAngle); + var isClip = progressModel.get('clip'); + updateProps(progress, { + shape: { + endAngle: linearMap(val, valueExtent, angleExtent, isClip) } - }; + }, seriesModel); + group.add(progress); // Add data index and series index for indexing the data by element + // Useful in tooltip - GaugeView.prototype._renderTitleAndDetail = function (seriesModel, ecModel, api, getColor, posInfo) { - var _this = this; - - var data = seriesModel.getData(); - var valueDim = data.mapDimension('value'); - var minVal = +seriesModel.get('min'); - var maxVal = +seriesModel.get('max'); - var contentGroup = new Group(); - var newTitleEls = []; - var newDetailEls = []; - var hasAnimation = seriesModel.isAnimationEnabled(); - var showPointerAbove = seriesModel.get(['pointer', 'showAbove']); - data.diff(this._data).add(function (idx) { - newTitleEls[idx] = new ZRText({ - silent: true - }); - newDetailEls[idx] = new ZRText({ - silent: true - }); - }).update(function (idx, oldIdx) { - newTitleEls[idx] = _this._titleEls[oldIdx]; - newDetailEls[idx] = _this._detailEls[oldIdx]; - }).execute(); - data.each(function (idx) { - var itemModel = data.getItemModel(idx); - var value = data.get(valueDim, idx); - var itemGroup = new Group(); - var autoColor = getColor(linearMap(value, [minVal, maxVal], [0, 1], true)); - var itemTitleModel = itemModel.getModel('title'); - - if (itemTitleModel.get('show')) { - var titleOffsetCenter = itemTitleModel.get('offsetCenter'); - var titleX = posInfo.cx + parsePercent$1(titleOffsetCenter[0], posInfo.r); - var titleY = posInfo.cy + parsePercent$1(titleOffsetCenter[1], posInfo.r); - var labelEl = newTitleEls[idx]; - labelEl.attr({ - z2: showPointerAbove ? 0 : 2, - style: createTextStyle(itemTitleModel, { - x: titleX, - y: titleY, - text: data.getName(idx), - align: 'center', - verticalAlign: 'middle' - }, { - inheritColor: autoColor - }) - }); - itemGroup.add(labelEl); - } + setCommonECData(seriesModel.seriesIndex, data.dataType, newIdx, progress); + progressList[newIdx] = progress; + } + }).execute(); + data.each(function (idx) { + var itemModel = data.getItemModel(idx); + var emphasisModel = itemModel.getModel('emphasis'); + var focus = emphasisModel.get('focus'); + var blurScope = emphasisModel.get('blurScope'); + var emphasisDisabled = emphasisModel.get('disabled'); + + if (showPointer) { + var pointer = data.getItemGraphicEl(idx); + var symbolStyle = data.getItemVisual(idx, 'style'); + var visualColor = symbolStyle.fill; + + if (pointer instanceof ZRImage) { + var pathStyle = pointer.style; + pointer.useStyle(extend({ + image: pathStyle.image, + x: pathStyle.x, + y: pathStyle.y, + width: pathStyle.width, + height: pathStyle.height + }, symbolStyle)); + } else { + pointer.useStyle(symbolStyle); + pointer.type !== 'pointer' && pointer.setColor(visualColor); + } + + pointer.setStyle(itemModel.getModel(['pointer', 'itemStyle']).getItemStyle()); + + if (pointer.style.fill === 'auto') { + pointer.setStyle('fill', getColor(linearMap(data.get(valueDim, idx), valueExtent, [0, 1], true))); + } + + pointer.z2EmphasisLift = 0; + setStatesStylesFromModel(pointer, itemModel); + toggleHoverEmphasis(pointer, focus, blurScope, emphasisDisabled); + } + + if (showProgress) { + var progress = progressList[idx]; + progress.useStyle(data.getItemVisual(idx, 'style')); + progress.setStyle(itemModel.getModel(['progress', 'itemStyle']).getItemStyle()); + progress.z2EmphasisLift = 0; + setStatesStylesFromModel(progress, itemModel); + toggleHoverEmphasis(progress, focus, blurScope, emphasisDisabled); + } + }); + this._progressEls = progressList; + } + }; + + GaugeView.prototype._renderAnchor = function (seriesModel, posInfo) { + var anchorModel = seriesModel.getModel('anchor'); + var showAnchor = anchorModel.get('show'); + + if (showAnchor) { + var anchorSize = anchorModel.get('size'); + var anchorType = anchorModel.get('icon'); + var offsetCenter = anchorModel.get('offsetCenter'); + var anchorKeepAspect = anchorModel.get('keepAspect'); + var anchor = createSymbol(anchorType, posInfo.cx - anchorSize / 2 + parsePercent$1(offsetCenter[0], posInfo.r), posInfo.cy - anchorSize / 2 + parsePercent$1(offsetCenter[1], posInfo.r), anchorSize, anchorSize, null, anchorKeepAspect); + anchor.z2 = anchorModel.get('showAbove') ? 1 : 0; + anchor.setStyle(anchorModel.getModel('itemStyle').getItemStyle()); + this.group.add(anchor); + } + }; + + GaugeView.prototype._renderTitleAndDetail = function (seriesModel, ecModel, api, getColor, posInfo) { + var _this = this; - var itemDetailModel = itemModel.getModel('detail'); - - if (itemDetailModel.get('show')) { - var detailOffsetCenter = itemDetailModel.get('offsetCenter'); - var detailX = posInfo.cx + parsePercent$1(detailOffsetCenter[0], posInfo.r); - var detailY = posInfo.cy + parsePercent$1(detailOffsetCenter[1], posInfo.r); - var width = parsePercent$1(itemDetailModel.get('width'), posInfo.r); - var height = parsePercent$1(itemDetailModel.get('height'), posInfo.r); - var detailColor = seriesModel.get(['progress', 'show']) ? data.getItemVisual(idx, 'style').fill : autoColor; - var labelEl = newDetailEls[idx]; - var formatter_1 = itemDetailModel.get('formatter'); - labelEl.attr({ - z2: showPointerAbove ? 0 : 2, - style: createTextStyle(itemDetailModel, { - x: detailX, - y: detailY, - text: formatLabel(value, formatter_1), - width: isNaN(width) ? null : width, - height: isNaN(height) ? null : height, - align: 'center', - verticalAlign: 'middle' - }, { - inheritColor: detailColor - }) - }); - setLabelValueAnimation(labelEl, { - normal: itemDetailModel - }, value, function (value) { - return formatLabel(value, formatter_1); - }); - hasAnimation && animateLabelValue(labelEl, idx, data, seriesModel, { - getFormattedLabel: function (labelDataIndex, status, dataType, labelDimIndex, fmt, extendParams) { - return formatLabel(extendParams ? extendParams.interpolatedValue : value, formatter_1); - } - }); - itemGroup.add(labelEl); - } + var data = seriesModel.getData(); + var valueDim = data.mapDimension('value'); + var minVal = +seriesModel.get('min'); + var maxVal = +seriesModel.get('max'); + var contentGroup = new Group(); + var newTitleEls = []; + var newDetailEls = []; + var hasAnimation = seriesModel.isAnimationEnabled(); + var showPointerAbove = seriesModel.get(['pointer', 'showAbove']); + data.diff(this._data).add(function (idx) { + newTitleEls[idx] = new ZRText({ + silent: true + }); + newDetailEls[idx] = new ZRText({ + silent: true + }); + }).update(function (idx, oldIdx) { + newTitleEls[idx] = _this._titleEls[oldIdx]; + newDetailEls[idx] = _this._detailEls[oldIdx]; + }).execute(); + data.each(function (idx) { + var itemModel = data.getItemModel(idx); + var value = data.get(valueDim, idx); + var itemGroup = new Group(); + var autoColor = getColor(linearMap(value, [minVal, maxVal], [0, 1], true)); + var itemTitleModel = itemModel.getModel('title'); + + if (itemTitleModel.get('show')) { + var titleOffsetCenter = itemTitleModel.get('offsetCenter'); + var titleX = posInfo.cx + parsePercent$1(titleOffsetCenter[0], posInfo.r); + var titleY = posInfo.cy + parsePercent$1(titleOffsetCenter[1], posInfo.r); + var labelEl = newTitleEls[idx]; + labelEl.attr({ + z2: showPointerAbove ? 0 : 2, + style: createTextStyle(itemTitleModel, { + x: titleX, + y: titleY, + text: data.getName(idx), + align: 'center', + verticalAlign: 'middle' + }, { + inheritColor: autoColor + }) + }); + itemGroup.add(labelEl); + } + + var itemDetailModel = itemModel.getModel('detail'); + + if (itemDetailModel.get('show')) { + var detailOffsetCenter = itemDetailModel.get('offsetCenter'); + var detailX = posInfo.cx + parsePercent$1(detailOffsetCenter[0], posInfo.r); + var detailY = posInfo.cy + parsePercent$1(detailOffsetCenter[1], posInfo.r); + var width = parsePercent$1(itemDetailModel.get('width'), posInfo.r); + var height = parsePercent$1(itemDetailModel.get('height'), posInfo.r); + var detailColor = seriesModel.get(['progress', 'show']) ? data.getItemVisual(idx, 'style').fill : autoColor; + var labelEl = newDetailEls[idx]; + var formatter_1 = itemDetailModel.get('formatter'); + labelEl.attr({ + z2: showPointerAbove ? 0 : 2, + style: createTextStyle(itemDetailModel, { + x: detailX, + y: detailY, + text: formatLabel(value, formatter_1), + width: isNaN(width) ? null : width, + height: isNaN(height) ? null : height, + align: 'center', + verticalAlign: 'middle' + }, { + inheritColor: detailColor + }) + }); + setLabelValueAnimation(labelEl, { + normal: itemDetailModel + }, value, function (value) { + return formatLabel(value, formatter_1); + }); + hasAnimation && animateLabelValue(labelEl, idx, data, seriesModel, { + getFormattedLabel: function (labelDataIndex, status, dataType, labelDimIndex, fmt, extendParams) { + return formatLabel(extendParams ? extendParams.interpolatedValue : value, formatter_1); + } + }); + itemGroup.add(labelEl); + } - contentGroup.add(itemGroup); - }); - this.group.add(contentGroup); - this._titleEls = newTitleEls; - this._detailEls = newDetailEls; - }; + contentGroup.add(itemGroup); + }); + this.group.add(contentGroup); + this._titleEls = newTitleEls; + this._detailEls = newDetailEls; + }; - GaugeView.type = 'gauge'; - return GaugeView; - }(ChartView); + GaugeView.type = 'gauge'; + return GaugeView; + }(ChartView); var GaugeSeriesModel = - /** @class */ - function (_super) { - __extends(GaugeSeriesModel, _super); + /** @class */ + function (_super) { + __extends(GaugeSeriesModel, _super); - function GaugeSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function GaugeSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = GaugeSeriesModel.type; - _this.visualStyleAccessPath = 'itemStyle'; - return _this; - } + _this.type = GaugeSeriesModel.type; + _this.visualStyleAccessPath = 'itemStyle'; + return _this; + } - GaugeSeriesModel.prototype.getInitialData = function (option, ecModel) { - return createSeriesDataSimply(this, ['value']); - }; + GaugeSeriesModel.prototype.getInitialData = function (option, ecModel) { + return createSeriesDataSimply(this, ['value']); + }; - GaugeSeriesModel.type = 'series.gauge'; - GaugeSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - colorBy: 'data', - // 默认全局居中 - center: ['50%', '50%'], - legendHoverLink: true, - radius: '75%', - startAngle: 225, - endAngle: -45, - clockwise: true, - // 最小值 - min: 0, - // 最大值 - max: 100, - // 分割段数,默认为10 - splitNumber: 10, - // 坐标轴线 - axisLine: { - // 默认显示,属性show控制显示与否 - show: true, - roundCap: false, - lineStyle: { - color: [[1, '#E6EBF8']], - width: 10 - } - }, - // 坐标轴线 - progress: { - // 默认显示,属性show控制显示与否 - show: false, - overlap: true, - width: 10, - roundCap: false, - clip: true - }, - // 分隔线 - splitLine: { - // 默认显示,属性show控制显示与否 - show: true, - // 属性length控制线长 - length: 10, - distance: 10, - // 属性lineStyle(详见lineStyle)控制线条样式 - lineStyle: { - color: '#63677A', - width: 3, - type: 'solid' - } - }, - // 坐标轴小标记 - axisTick: { - // 属性show控制显示与否,默认不显示 - show: true, - // 每份split细分多少段 - splitNumber: 5, - // 属性length控制线长 - length: 6, - distance: 10, - // 属性lineStyle控制线条样式 - lineStyle: { - color: '#63677A', - width: 1, - type: 'solid' - } - }, - axisLabel: { - show: true, - distance: 15, - // formatter: null, - color: '#464646', - fontSize: 12 - }, - pointer: { - icon: null, - offsetCenter: [0, 0], - show: true, - showAbove: true, - length: '60%', - width: 6, - keepAspect: false - }, - anchor: { - show: false, - showAbove: false, - size: 6, - icon: 'circle', - offsetCenter: [0, 0], - keepAspect: false, - itemStyle: { - color: '#fff', - borderWidth: 0, - borderColor: '#5470c6' - } - }, - title: { - show: true, - // x, y,单位px - offsetCenter: [0, '20%'], - // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#464646', - fontSize: 16, - valueAnimation: false - }, - detail: { - show: true, - backgroundColor: 'rgba(0,0,0,0)', - borderWidth: 0, - borderColor: '#ccc', - width: 100, - height: null, - padding: [5, 10], - // x, y,单位px - offsetCenter: [0, '40%'], - // formatter: null, - // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#464646', - fontSize: 30, - fontWeight: 'bold', - lineHeight: 30, - valueAnimation: false - } - }; - return GaugeSeriesModel; - }(SeriesModel); + GaugeSeriesModel.type = 'series.gauge'; + GaugeSeriesModel.defaultOption = { + // zlevel: 0, + z: 2, + colorBy: 'data', + // 默认全局居中 + center: ['50%', '50%'], + legendHoverLink: true, + radius: '75%', + startAngle: 225, + endAngle: -45, + clockwise: true, + // 最小值 + min: 0, + // 最大值 + max: 100, + // 分割段数,默认为10 + splitNumber: 10, + // 坐标轴线 + axisLine: { + // 默认显示,属性show控制显示与否 + show: true, + roundCap: false, + lineStyle: { + color: [[1, '#E6EBF8']], + width: 10 + } + }, + // 坐标轴线 + progress: { + // 默认显示,属性show控制显示与否 + show: false, + overlap: true, + width: 10, + roundCap: false, + clip: true + }, + // 分隔线 + splitLine: { + // 默认显示,属性show控制显示与否 + show: true, + // 属性length控制线长 + length: 10, + distance: 10, + // 属性lineStyle(详见lineStyle)控制线条样式 + lineStyle: { + color: '#63677A', + width: 3, + type: 'solid' + } + }, + // 坐标轴小标记 + axisTick: { + // 属性show控制显示与否,默认不显示 + show: true, + // 每份split细分多少段 + splitNumber: 5, + // 属性length控制线长 + length: 6, + distance: 10, + // 属性lineStyle控制线条样式 + lineStyle: { + color: '#63677A', + width: 1, + type: 'solid' + } + }, + axisLabel: { + show: true, + distance: 15, + // formatter: null, + color: '#464646', + fontSize: 12 + }, + pointer: { + icon: null, + offsetCenter: [0, 0], + show: true, + showAbove: true, + length: '60%', + width: 6, + keepAspect: false + }, + anchor: { + show: false, + showAbove: false, + size: 6, + icon: 'circle', + offsetCenter: [0, 0], + keepAspect: false, + itemStyle: { + color: '#fff', + borderWidth: 0, + borderColor: '#5470c6' + } + }, + title: { + show: true, + // x, y,单位px + offsetCenter: [0, '20%'], + // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#464646', + fontSize: 16, + valueAnimation: false + }, + detail: { + show: true, + backgroundColor: 'rgba(0,0,0,0)', + borderWidth: 0, + borderColor: '#ccc', + width: 100, + height: null, + padding: [5, 10], + // x, y,单位px + offsetCenter: [0, '40%'], + // formatter: null, + // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#464646', + fontSize: 30, + fontWeight: 'bold', + lineHeight: 30, + valueAnimation: false + } + }; + return GaugeSeriesModel; + }(SeriesModel); function install$e(registers) { - registers.registerChartView(GaugeView); - registers.registerSeriesModel(GaugeSeriesModel); + registers.registerChartView(GaugeView); + registers.registerSeriesModel(GaugeSeriesModel); } var opacityAccessPath = ['itemStyle', 'opacity']; @@ -62261,802 +62261,802 @@ */ var FunnelPiece = - /** @class */ - function (_super) { - __extends(FunnelPiece, _super); + /** @class */ + function (_super) { + __extends(FunnelPiece, _super); - function FunnelPiece(data, idx) { - var _this = _super.call(this) || this; + function FunnelPiece(data, idx) { + var _this = _super.call(this) || this; - var polygon = _this; - var labelLine = new Polyline(); - var text = new ZRText(); - polygon.setTextContent(text); + var polygon = _this; + var labelLine = new Polyline(); + var text = new ZRText(); + polygon.setTextContent(text); - _this.setTextGuideLine(labelLine); + _this.setTextGuideLine(labelLine); - _this.updateData(data, idx, true); + _this.updateData(data, idx, true); - return _this; - } + return _this; + } - FunnelPiece.prototype.updateData = function (data, idx, firstCreate) { - var polygon = this; - var seriesModel = data.hostModel; - var itemModel = data.getItemModel(idx); - var layout = data.getItemLayout(idx); - var emphasisModel = itemModel.getModel('emphasis'); - var opacity = itemModel.get(opacityAccessPath); - opacity = opacity == null ? 1 : opacity; + FunnelPiece.prototype.updateData = function (data, idx, firstCreate) { + var polygon = this; + var seriesModel = data.hostModel; + var itemModel = data.getItemModel(idx); + var layout = data.getItemLayout(idx); + var emphasisModel = itemModel.getModel('emphasis'); + var opacity = itemModel.get(opacityAccessPath); + opacity = opacity == null ? 1 : opacity; - if (!firstCreate) { - saveOldStyle(polygon); - } // Update common style + if (!firstCreate) { + saveOldStyle(polygon); + } // Update common style - polygon.useStyle(data.getItemVisual(idx, 'style')); - polygon.style.lineJoin = 'round'; + polygon.useStyle(data.getItemVisual(idx, 'style')); + polygon.style.lineJoin = 'round'; - if (firstCreate) { - polygon.setShape({ - points: layout.points - }); - polygon.style.opacity = 0; - initProps(polygon, { - style: { - opacity: opacity - } - }, seriesModel, idx); - } else { - updateProps(polygon, { - style: { - opacity: opacity - }, - shape: { - points: layout.points - } - }, seriesModel, idx); - } + if (firstCreate) { + polygon.setShape({ + points: layout.points + }); + polygon.style.opacity = 0; + initProps(polygon, { + style: { + opacity: opacity + } + }, seriesModel, idx); + } else { + updateProps(polygon, { + style: { + opacity: opacity + }, + shape: { + points: layout.points + } + }, seriesModel, idx); + } - setStatesStylesFromModel(polygon, itemModel); + setStatesStylesFromModel(polygon, itemModel); - this._updateLabel(data, idx); + this._updateLabel(data, idx); - toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - }; + toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); + }; - FunnelPiece.prototype._updateLabel = function (data, idx) { - var polygon = this; - var labelLine = this.getTextGuideLine(); - var labelText = polygon.getTextContent(); - var seriesModel = data.hostModel; - var itemModel = data.getItemModel(idx); - var layout = data.getItemLayout(idx); - var labelLayout = layout.label; - var style = data.getItemVisual(idx, 'style'); - var visualColor = style.fill; - setLabelStyle( // position will not be used in setLabelStyle - labelText, getLabelStatesModels(itemModel), { - labelFetcher: data.hostModel, - labelDataIndex: idx, - defaultOpacity: style.opacity, - defaultText: data.getName(idx) - }, { - normal: { - align: labelLayout.textAlign, - verticalAlign: labelLayout.verticalAlign - } - }); - polygon.setTextConfig({ - local: true, - inside: !!labelLayout.inside, - insideStroke: visualColor, - // insideFill: 'auto', - outsideFill: visualColor - }); - var linePoints = labelLayout.linePoints; - labelLine.setShape({ - points: linePoints - }); - polygon.textGuideLineConfig = { - anchor: linePoints ? new Point(linePoints[0][0], linePoints[0][1]) : null - }; // Make sure update style on labelText after setLabelStyle. - // Because setLabelStyle will replace a new style on it. - - updateProps(labelText, { - style: { - x: labelLayout.x, - y: labelLayout.y - } - }, seriesModel, idx); - labelText.attr({ - rotation: labelLayout.rotation, - originX: labelLayout.x, - originY: labelLayout.y, - z2: 10 - }); - setLabelLineStyle(polygon, getLabelLineStatesModels(itemModel), { - // Default use item visual color - stroke: visualColor - }); - }; + FunnelPiece.prototype._updateLabel = function (data, idx) { + var polygon = this; + var labelLine = this.getTextGuideLine(); + var labelText = polygon.getTextContent(); + var seriesModel = data.hostModel; + var itemModel = data.getItemModel(idx); + var layout = data.getItemLayout(idx); + var labelLayout = layout.label; + var style = data.getItemVisual(idx, 'style'); + var visualColor = style.fill; + setLabelStyle( // position will not be used in setLabelStyle + labelText, getLabelStatesModels(itemModel), { + labelFetcher: data.hostModel, + labelDataIndex: idx, + defaultOpacity: style.opacity, + defaultText: data.getName(idx) + }, { + normal: { + align: labelLayout.textAlign, + verticalAlign: labelLayout.verticalAlign + } + }); + polygon.setTextConfig({ + local: true, + inside: !!labelLayout.inside, + insideStroke: visualColor, + // insideFill: 'auto', + outsideFill: visualColor + }); + var linePoints = labelLayout.linePoints; + labelLine.setShape({ + points: linePoints + }); + polygon.textGuideLineConfig = { + anchor: linePoints ? new Point(linePoints[0][0], linePoints[0][1]) : null + }; // Make sure update style on labelText after setLabelStyle. + // Because setLabelStyle will replace a new style on it. + + updateProps(labelText, { + style: { + x: labelLayout.x, + y: labelLayout.y + } + }, seriesModel, idx); + labelText.attr({ + rotation: labelLayout.rotation, + originX: labelLayout.x, + originY: labelLayout.y, + z2: 10 + }); + setLabelLineStyle(polygon, getLabelLineStatesModels(itemModel), { + // Default use item visual color + stroke: visualColor + }); + }; - return FunnelPiece; - }(Polygon); + return FunnelPiece; + }(Polygon); var FunnelView = - /** @class */ - function (_super) { - __extends(FunnelView, _super); + /** @class */ + function (_super) { + __extends(FunnelView, _super); - function FunnelView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function FunnelView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = FunnelView.type; - _this.ignoreLabelLineUpdate = true; - return _this; - } + _this.type = FunnelView.type; + _this.ignoreLabelLineUpdate = true; + return _this; + } - FunnelView.prototype.render = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - var oldData = this._data; - var group = this.group; - data.diff(oldData).add(function (idx) { - var funnelPiece = new FunnelPiece(data, idx); - data.setItemGraphicEl(idx, funnelPiece); - group.add(funnelPiece); - }).update(function (newIdx, oldIdx) { - var piece = oldData.getItemGraphicEl(oldIdx); - piece.updateData(data, newIdx); - group.add(piece); - data.setItemGraphicEl(newIdx, piece); - }).remove(function (idx) { - var piece = oldData.getItemGraphicEl(idx); - removeElementWithFadeOut(piece, seriesModel, idx); - }).execute(); - this._data = data; - }; + FunnelView.prototype.render = function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); + var oldData = this._data; + var group = this.group; + data.diff(oldData).add(function (idx) { + var funnelPiece = new FunnelPiece(data, idx); + data.setItemGraphicEl(idx, funnelPiece); + group.add(funnelPiece); + }).update(function (newIdx, oldIdx) { + var piece = oldData.getItemGraphicEl(oldIdx); + piece.updateData(data, newIdx); + group.add(piece); + data.setItemGraphicEl(newIdx, piece); + }).remove(function (idx) { + var piece = oldData.getItemGraphicEl(idx); + removeElementWithFadeOut(piece, seriesModel, idx); + }).execute(); + this._data = data; + }; - FunnelView.prototype.remove = function () { - this.group.removeAll(); - this._data = null; - }; + FunnelView.prototype.remove = function () { + this.group.removeAll(); + this._data = null; + }; - FunnelView.prototype.dispose = function () {}; + FunnelView.prototype.dispose = function () {}; - FunnelView.type = 'funnel'; - return FunnelView; - }(ChartView); + FunnelView.type = 'funnel'; + return FunnelView; + }(ChartView); var FunnelSeriesModel = - /** @class */ - function (_super) { - __extends(FunnelSeriesModel, _super); + /** @class */ + function (_super) { + __extends(FunnelSeriesModel, _super); - function FunnelSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function FunnelSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = FunnelSeriesModel.type; - return _this; - } + _this.type = FunnelSeriesModel.type; + return _this; + } - FunnelSeriesModel.prototype.init = function (option) { - _super.prototype.init.apply(this, arguments); // Enable legend selection for each data item - // Use a function instead of direct access because data reference may changed + FunnelSeriesModel.prototype.init = function (option) { + _super.prototype.init.apply(this, arguments); // Enable legend selection for each data item + // Use a function instead of direct access because data reference may changed - this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this)); // Extend labelLine emphasis + this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this)); // Extend labelLine emphasis - this._defaultLabelLine(option); - }; - - FunnelSeriesModel.prototype.getInitialData = function (option, ecModel) { - return createSeriesDataSimply(this, { - coordDimensions: ['value'], - encodeDefaulter: curry(makeSeriesEncodeForNameBased, this) - }); - }; + this._defaultLabelLine(option); + }; - FunnelSeriesModel.prototype._defaultLabelLine = function (option) { - // Extend labelLine emphasis - defaultEmphasis(option, 'labelLine', ['show']); - var labelLineNormalOpt = option.labelLine; - var labelLineEmphasisOpt = option.emphasis.labelLine; // Not show label line if `label.normal.show = false` - - labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show; - labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show; - }; // Overwrite + FunnelSeriesModel.prototype.getInitialData = function (option, ecModel) { + return createSeriesDataSimply(this, { + coordDimensions: ['value'], + encodeDefaulter: curry(makeSeriesEncodeForNameBased, this) + }); + }; + FunnelSeriesModel.prototype._defaultLabelLine = function (option) { + // Extend labelLine emphasis + defaultEmphasis(option, 'labelLine', ['show']); + var labelLineNormalOpt = option.labelLine; + var labelLineEmphasisOpt = option.emphasis.labelLine; // Not show label line if `label.normal.show = false` - FunnelSeriesModel.prototype.getDataParams = function (dataIndex) { - var data = this.getData(); + labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show; + labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show; + }; // Overwrite - var params = _super.prototype.getDataParams.call(this, dataIndex); - var valueDim = data.mapDimension('value'); - var sum = data.getSum(valueDim); // Percent is 0 if sum is 0 + FunnelSeriesModel.prototype.getDataParams = function (dataIndex) { + var data = this.getData(); - params.percent = !sum ? 0 : +(data.get(valueDim, dataIndex) / sum * 100).toFixed(2); - params.$vars.push('percent'); - return params; - }; + var params = _super.prototype.getDataParams.call(this, dataIndex); - FunnelSeriesModel.type = 'series.funnel'; - FunnelSeriesModel.defaultOption = { - // zlevel: 0, // 一级层叠 - z: 2, - legendHoverLink: true, - colorBy: 'data', - left: 80, - top: 60, - right: 80, - bottom: 60, - // width: {totalWidth} - left - right, - // height: {totalHeight} - top - bottom, - // 默认取数据最小最大值 - // min: 0, - // max: 100, - minSize: '0%', - maxSize: '100%', - sort: 'descending', - orient: 'vertical', - gap: 0, - funnelAlign: 'center', - label: { - show: true, - position: 'outer' // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + var valueDim = data.mapDimension('value'); + var sum = data.getSum(valueDim); // Percent is 0 if sum is 0 + + params.percent = !sum ? 0 : +(data.get(valueDim, dataIndex) / sum * 100).toFixed(2); + params.$vars.push('percent'); + return params; + }; + + FunnelSeriesModel.type = 'series.funnel'; + FunnelSeriesModel.defaultOption = { + // zlevel: 0, // 一级层叠 + z: 2, + legendHoverLink: true, + colorBy: 'data', + left: 80, + top: 60, + right: 80, + bottom: 60, + // width: {totalWidth} - left - right, + // height: {totalHeight} - top - bottom, + // 默认取数据最小最大值 + // min: 0, + // max: 100, + minSize: '0%', + maxSize: '100%', + sort: 'descending', + orient: 'vertical', + gap: 0, + funnelAlign: 'center', + label: { + show: true, + position: 'outer' // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 - }, - labelLine: { - show: true, - length: 20, - lineStyle: { - // color: 各异, - width: 1 - } - }, - itemStyle: { - // color: 各异, - borderColor: '#fff', - borderWidth: 1 - }, - emphasis: { - label: { - show: true - } - }, - select: { - itemStyle: { - borderColor: '#212121' - } - } - }; - return FunnelSeriesModel; - }(SeriesModel); + }, + labelLine: { + show: true, + length: 20, + lineStyle: { + // color: 各异, + width: 1 + } + }, + itemStyle: { + // color: 各异, + borderColor: '#fff', + borderWidth: 1 + }, + emphasis: { + label: { + show: true + } + }, + select: { + itemStyle: { + borderColor: '#212121' + } + } + }; + return FunnelSeriesModel; + }(SeriesModel); function getViewRect$3(seriesModel, api) { - return getLayoutRect(seriesModel.getBoxLayoutParams(), { - width: api.getWidth(), - height: api.getHeight() - }); + return getLayoutRect(seriesModel.getBoxLayoutParams(), { + width: api.getWidth(), + height: api.getHeight() + }); } function getSortedIndices(data, sort) { - var valueDim = data.mapDimension('value'); - var valueArr = data.mapArray(valueDim, function (val) { - return val; - }); - var indices = []; - var isAscending = sort === 'ascending'; + var valueDim = data.mapDimension('value'); + var valueArr = data.mapArray(valueDim, function (val) { + return val; + }); + var indices = []; + var isAscending = sort === 'ascending'; - for (var i = 0, len = data.count(); i < len; i++) { - indices[i] = i; - } // Add custom sortable function & none sortable opetion by "options.sort" + for (var i = 0, len = data.count(); i < len; i++) { + indices[i] = i; + } // Add custom sortable function & none sortable opetion by "options.sort" - if (isFunction(sort)) { - indices.sort(sort); - } else if (sort !== 'none') { - indices.sort(function (a, b) { - return isAscending ? valueArr[a] - valueArr[b] : valueArr[b] - valueArr[a]; - }); - } + if (isFunction(sort)) { + indices.sort(sort); + } else if (sort !== 'none') { + indices.sort(function (a, b) { + return isAscending ? valueArr[a] - valueArr[b] : valueArr[b] - valueArr[a]; + }); + } - return indices; + return indices; } function labelLayout(data) { - var seriesModel = data.hostModel; - var orient = seriesModel.get('orient'); - data.each(function (idx) { - var itemModel = data.getItemModel(idx); - var labelModel = itemModel.getModel('label'); - var labelPosition = labelModel.get('position'); - var labelLineModel = itemModel.getModel('labelLine'); - var layout = data.getItemLayout(idx); - var points = layout.points; - var isLabelInside = labelPosition === 'inner' || labelPosition === 'inside' || labelPosition === 'center' || labelPosition === 'insideLeft' || labelPosition === 'insideRight'; - var textAlign; - var textX; - var textY; - var linePoints; - - if (isLabelInside) { - if (labelPosition === 'insideLeft') { - textX = (points[0][0] + points[3][0]) / 2 + 5; - textY = (points[0][1] + points[3][1]) / 2; - textAlign = 'left'; - } else if (labelPosition === 'insideRight') { - textX = (points[1][0] + points[2][0]) / 2 - 5; - textY = (points[1][1] + points[2][1]) / 2; - textAlign = 'right'; - } else { - textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4; - textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4; - textAlign = 'center'; - } + var seriesModel = data.hostModel; + var orient = seriesModel.get('orient'); + data.each(function (idx) { + var itemModel = data.getItemModel(idx); + var labelModel = itemModel.getModel('label'); + var labelPosition = labelModel.get('position'); + var labelLineModel = itemModel.getModel('labelLine'); + var layout = data.getItemLayout(idx); + var points = layout.points; + var isLabelInside = labelPosition === 'inner' || labelPosition === 'inside' || labelPosition === 'center' || labelPosition === 'insideLeft' || labelPosition === 'insideRight'; + var textAlign; + var textX; + var textY; + var linePoints; + + if (isLabelInside) { + if (labelPosition === 'insideLeft') { + textX = (points[0][0] + points[3][0]) / 2 + 5; + textY = (points[0][1] + points[3][1]) / 2; + textAlign = 'left'; + } else if (labelPosition === 'insideRight') { + textX = (points[1][0] + points[2][0]) / 2 - 5; + textY = (points[1][1] + points[2][1]) / 2; + textAlign = 'right'; + } else { + textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4; + textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4; + textAlign = 'center'; + } - linePoints = [[textX, textY], [textX, textY]]; - } else { - var x1 = void 0; - var y1 = void 0; - var x2 = void 0; - var y2 = void 0; - var labelLineLen = labelLineModel.get('length'); + linePoints = [[textX, textY], [textX, textY]]; + } else { + var x1 = void 0; + var y1 = void 0; + var x2 = void 0; + var y2 = void 0; + var labelLineLen = labelLineModel.get('length'); + + if ("development" !== 'production') { + if (orient === 'vertical' && ['top', 'bottom'].indexOf(labelPosition) > -1) { + labelPosition = 'left'; + console.warn('Position error: Funnel chart on vertical orient dose not support top and bottom.'); + } + + if (orient === 'horizontal' && ['left', 'right'].indexOf(labelPosition) > -1) { + labelPosition = 'bottom'; + console.warn('Position error: Funnel chart on horizontal orient dose not support left and right.'); + } + } + + if (labelPosition === 'left') { + // Left side + x1 = (points[3][0] + points[0][0]) / 2; + y1 = (points[3][1] + points[0][1]) / 2; + x2 = x1 - labelLineLen; + textX = x2 - 5; + textAlign = 'right'; + } else if (labelPosition === 'right') { + // Right side + x1 = (points[1][0] + points[2][0]) / 2; + y1 = (points[1][1] + points[2][1]) / 2; + x2 = x1 + labelLineLen; + textX = x2 + 5; + textAlign = 'left'; + } else if (labelPosition === 'top') { + // Top side + x1 = (points[3][0] + points[0][0]) / 2; + y1 = (points[3][1] + points[0][1]) / 2; + y2 = y1 - labelLineLen; + textY = y2 - 5; + textAlign = 'center'; + } else if (labelPosition === 'bottom') { + // Bottom side + x1 = (points[1][0] + points[2][0]) / 2; + y1 = (points[1][1] + points[2][1]) / 2; + y2 = y1 + labelLineLen; + textY = y2 + 5; + textAlign = 'center'; + } else if (labelPosition === 'rightTop') { + // RightTop side + x1 = orient === 'horizontal' ? points[3][0] : points[1][0]; + y1 = orient === 'horizontal' ? points[3][1] : points[1][1]; - if ("development" !== 'production') { - if (orient === 'vertical' && ['top', 'bottom'].indexOf(labelPosition) > -1) { - labelPosition = 'left'; - console.warn('Position error: Funnel chart on vertical orient dose not support top and bottom.'); - } + if (orient === 'horizontal') { + y2 = y1 - labelLineLen; + textY = y2 - 5; + textAlign = 'center'; + } else { + x2 = x1 + labelLineLen; + textX = x2 + 5; + textAlign = 'top'; + } + } else if (labelPosition === 'rightBottom') { + // RightBottom side + x1 = points[2][0]; + y1 = points[2][1]; - if (orient === 'horizontal' && ['left', 'right'].indexOf(labelPosition) > -1) { - labelPosition = 'bottom'; - console.warn('Position error: Funnel chart on horizontal orient dose not support left and right.'); - } - } + if (orient === 'horizontal') { + y2 = y1 + labelLineLen; + textY = y2 + 5; + textAlign = 'center'; + } else { + x2 = x1 + labelLineLen; + textX = x2 + 5; + textAlign = 'bottom'; + } + } else if (labelPosition === 'leftTop') { + // LeftTop side + x1 = points[0][0]; + y1 = orient === 'horizontal' ? points[0][1] : points[1][1]; - if (labelPosition === 'left') { - // Left side - x1 = (points[3][0] + points[0][0]) / 2; - y1 = (points[3][1] + points[0][1]) / 2; - x2 = x1 - labelLineLen; - textX = x2 - 5; - textAlign = 'right'; - } else if (labelPosition === 'right') { - // Right side - x1 = (points[1][0] + points[2][0]) / 2; - y1 = (points[1][1] + points[2][1]) / 2; - x2 = x1 + labelLineLen; - textX = x2 + 5; - textAlign = 'left'; - } else if (labelPosition === 'top') { - // Top side - x1 = (points[3][0] + points[0][0]) / 2; - y1 = (points[3][1] + points[0][1]) / 2; - y2 = y1 - labelLineLen; - textY = y2 - 5; - textAlign = 'center'; - } else if (labelPosition === 'bottom') { - // Bottom side - x1 = (points[1][0] + points[2][0]) / 2; - y1 = (points[1][1] + points[2][1]) / 2; - y2 = y1 + labelLineLen; - textY = y2 + 5; - textAlign = 'center'; - } else if (labelPosition === 'rightTop') { - // RightTop side - x1 = orient === 'horizontal' ? points[3][0] : points[1][0]; - y1 = orient === 'horizontal' ? points[3][1] : points[1][1]; - - if (orient === 'horizontal') { - y2 = y1 - labelLineLen; - textY = y2 - 5; - textAlign = 'center'; - } else { - x2 = x1 + labelLineLen; - textX = x2 + 5; - textAlign = 'top'; - } - } else if (labelPosition === 'rightBottom') { - // RightBottom side - x1 = points[2][0]; - y1 = points[2][1]; - - if (orient === 'horizontal') { - y2 = y1 + labelLineLen; - textY = y2 + 5; - textAlign = 'center'; - } else { - x2 = x1 + labelLineLen; - textX = x2 + 5; - textAlign = 'bottom'; - } - } else if (labelPosition === 'leftTop') { - // LeftTop side - x1 = points[0][0]; - y1 = orient === 'horizontal' ? points[0][1] : points[1][1]; - - if (orient === 'horizontal') { - y2 = y1 - labelLineLen; - textY = y2 - 5; - textAlign = 'center'; - } else { - x2 = x1 - labelLineLen; - textX = x2 - 5; - textAlign = 'right'; - } - } else if (labelPosition === 'leftBottom') { - // LeftBottom side - x1 = orient === 'horizontal' ? points[1][0] : points[3][0]; - y1 = orient === 'horizontal' ? points[1][1] : points[2][1]; - - if (orient === 'horizontal') { - y2 = y1 + labelLineLen; - textY = y2 + 5; - textAlign = 'center'; - } else { - x2 = x1 - labelLineLen; - textX = x2 - 5; - textAlign = 'right'; - } - } else { - // Right side or Bottom side - x1 = (points[1][0] + points[2][0]) / 2; - y1 = (points[1][1] + points[2][1]) / 2; - - if (orient === 'horizontal') { - y2 = y1 + labelLineLen; - textY = y2 + 5; - textAlign = 'center'; - } else { - x2 = x1 + labelLineLen; - textX = x2 + 5; - textAlign = 'left'; - } - } + if (orient === 'horizontal') { + y2 = y1 - labelLineLen; + textY = y2 - 5; + textAlign = 'center'; + } else { + x2 = x1 - labelLineLen; + textX = x2 - 5; + textAlign = 'right'; + } + } else if (labelPosition === 'leftBottom') { + // LeftBottom side + x1 = orient === 'horizontal' ? points[1][0] : points[3][0]; + y1 = orient === 'horizontal' ? points[1][1] : points[2][1]; - if (orient === 'horizontal') { - x2 = x1; - textX = x2; - } else { - y2 = y1; - textY = y2; - } + if (orient === 'horizontal') { + y2 = y1 + labelLineLen; + textY = y2 + 5; + textAlign = 'center'; + } else { + x2 = x1 - labelLineLen; + textX = x2 - 5; + textAlign = 'right'; + } + } else { + // Right side or Bottom side + x1 = (points[1][0] + points[2][0]) / 2; + y1 = (points[1][1] + points[2][1]) / 2; - linePoints = [[x1, y1], [x2, y2]]; + if (orient === 'horizontal') { + y2 = y1 + labelLineLen; + textY = y2 + 5; + textAlign = 'center'; + } else { + x2 = x1 + labelLineLen; + textX = x2 + 5; + textAlign = 'left'; } + } - layout.label = { - linePoints: linePoints, - x: textX, - y: textY, - verticalAlign: 'middle', - textAlign: textAlign, - inside: isLabelInside - }; - }); + if (orient === 'horizontal') { + x2 = x1; + textX = x2; + } else { + y2 = y1; + textY = y2; + } + + linePoints = [[x1, y1], [x2, y2]]; + } + + layout.label = { + linePoints: linePoints, + x: textX, + y: textY, + verticalAlign: 'middle', + textAlign: textAlign, + inside: isLabelInside + }; + }); } function funnelLayout(ecModel, api) { - ecModel.eachSeriesByType('funnel', function (seriesModel) { - var data = seriesModel.getData(); - var valueDim = data.mapDimension('value'); - var sort = seriesModel.get('sort'); - var viewRect = getViewRect$3(seriesModel, api); - var orient = seriesModel.get('orient'); - var viewWidth = viewRect.width; - var viewHeight = viewRect.height; - var indices = getSortedIndices(data, sort); - var x = viewRect.x; - var y = viewRect.y; - var sizeExtent = orient === 'horizontal' ? [parsePercent$1(seriesModel.get('minSize'), viewHeight), parsePercent$1(seriesModel.get('maxSize'), viewHeight)] : [parsePercent$1(seriesModel.get('minSize'), viewWidth), parsePercent$1(seriesModel.get('maxSize'), viewWidth)]; - var dataExtent = data.getDataExtent(valueDim); - var min = seriesModel.get('min'); - var max = seriesModel.get('max'); - - if (min == null) { - min = Math.min(dataExtent[0], 0); - } - - if (max == null) { - max = dataExtent[1]; - } - - var funnelAlign = seriesModel.get('funnelAlign'); - var gap = seriesModel.get('gap'); - var viewSize = orient === 'horizontal' ? viewWidth : viewHeight; - var itemSize = (viewSize - gap * (data.count() - 1)) / data.count(); - - var getLinePoints = function (idx, offset) { - // End point index is data.count() and we assign it 0 - if (orient === 'horizontal') { - var val_1 = data.get(valueDim, idx) || 0; - var itemHeight = linearMap(val_1, [min, max], sizeExtent, true); - var y0 = void 0; - - switch (funnelAlign) { - case 'top': - y0 = y; - break; + ecModel.eachSeriesByType('funnel', function (seriesModel) { + var data = seriesModel.getData(); + var valueDim = data.mapDimension('value'); + var sort = seriesModel.get('sort'); + var viewRect = getViewRect$3(seriesModel, api); + var orient = seriesModel.get('orient'); + var viewWidth = viewRect.width; + var viewHeight = viewRect.height; + var indices = getSortedIndices(data, sort); + var x = viewRect.x; + var y = viewRect.y; + var sizeExtent = orient === 'horizontal' ? [parsePercent$1(seriesModel.get('minSize'), viewHeight), parsePercent$1(seriesModel.get('maxSize'), viewHeight)] : [parsePercent$1(seriesModel.get('minSize'), viewWidth), parsePercent$1(seriesModel.get('maxSize'), viewWidth)]; + var dataExtent = data.getDataExtent(valueDim); + var min = seriesModel.get('min'); + var max = seriesModel.get('max'); - case 'center': - y0 = y + (viewHeight - itemHeight) / 2; - break; + if (min == null) { + min = Math.min(dataExtent[0], 0); + } - case 'bottom': - y0 = y + (viewHeight - itemHeight); - break; - } + if (max == null) { + max = dataExtent[1]; + } - return [[offset, y0], [offset, y0 + itemHeight]]; - } + var funnelAlign = seriesModel.get('funnelAlign'); + var gap = seriesModel.get('gap'); + var viewSize = orient === 'horizontal' ? viewWidth : viewHeight; + var itemSize = (viewSize - gap * (data.count() - 1)) / data.count(); - var val = data.get(valueDim, idx) || 0; - var itemWidth = linearMap(val, [min, max], sizeExtent, true); - var x0; + var getLinePoints = function (idx, offset) { + // End point index is data.count() and we assign it 0 + if (orient === 'horizontal') { + var val_1 = data.get(valueDim, idx) || 0; + var itemHeight = linearMap(val_1, [min, max], sizeExtent, true); + var y0 = void 0; - switch (funnelAlign) { - case 'left': - x0 = x; - break; + switch (funnelAlign) { + case 'top': + y0 = y; + break; - case 'center': - x0 = x + (viewWidth - itemWidth) / 2; - break; + case 'center': + y0 = y + (viewHeight - itemHeight) / 2; + break; - case 'right': - x0 = x + viewWidth - itemWidth; - break; - } + case 'bottom': + y0 = y + (viewHeight - itemHeight); + break; + } - return [[x0, offset], [x0 + itemWidth, offset]]; - }; + return [[offset, y0], [offset, y0 + itemHeight]]; + } - if (sort === 'ascending') { - // From bottom to top - itemSize = -itemSize; - gap = -gap; + var val = data.get(valueDim, idx) || 0; + var itemWidth = linearMap(val, [min, max], sizeExtent, true); + var x0; - if (orient === 'horizontal') { - x += viewWidth; - } else { - y += viewHeight; - } + switch (funnelAlign) { + case 'left': + x0 = x; + break; - indices = indices.reverse(); - } + case 'center': + x0 = x + (viewWidth - itemWidth) / 2; + break; - for (var i = 0; i < indices.length; i++) { - var idx = indices[i]; - var nextIdx = indices[i + 1]; - var itemModel = data.getItemModel(idx); + case 'right': + x0 = x + viewWidth - itemWidth; + break; + } - if (orient === 'horizontal') { - var width = itemModel.get(['itemStyle', 'width']); + return [[x0, offset], [x0 + itemWidth, offset]]; + }; - if (width == null) { - width = itemSize; - } else { - width = parsePercent$1(width, viewWidth); + if (sort === 'ascending') { + // From bottom to top + itemSize = -itemSize; + gap = -gap; - if (sort === 'ascending') { - width = -width; - } - } + if (orient === 'horizontal') { + x += viewWidth; + } else { + y += viewHeight; + } - var start = getLinePoints(idx, x); - var end = getLinePoints(nextIdx, x + width); - x += width + gap; - data.setItemLayout(idx, { - points: start.concat(end.slice().reverse()) - }); - } else { - var height = itemModel.get(['itemStyle', 'height']); + indices = indices.reverse(); + } - if (height == null) { - height = itemSize; - } else { - height = parsePercent$1(height, viewHeight); + for (var i = 0; i < indices.length; i++) { + var idx = indices[i]; + var nextIdx = indices[i + 1]; + var itemModel = data.getItemModel(idx); - if (sort === 'ascending') { - height = -height; - } - } + if (orient === 'horizontal') { + var width = itemModel.get(['itemStyle', 'width']); - var start = getLinePoints(idx, y); - var end = getLinePoints(nextIdx, y + height); - y += height + gap; - data.setItemLayout(idx, { - points: start.concat(end.slice().reverse()) - }); - } + if (width == null) { + width = itemSize; + } else { + width = parsePercent$1(width, viewWidth); + + if (sort === 'ascending') { + width = -width; + } } - labelLayout(data); - }); + var start = getLinePoints(idx, x); + var end = getLinePoints(nextIdx, x + width); + x += width + gap; + data.setItemLayout(idx, { + points: start.concat(end.slice().reverse()) + }); + } else { + var height = itemModel.get(['itemStyle', 'height']); + + if (height == null) { + height = itemSize; + } else { + height = parsePercent$1(height, viewHeight); + + if (sort === 'ascending') { + height = -height; + } + } + + var start = getLinePoints(idx, y); + var end = getLinePoints(nextIdx, y + height); + y += height + gap; + data.setItemLayout(idx, { + points: start.concat(end.slice().reverse()) + }); + } + } + + labelLayout(data); + }); } function install$f(registers) { - registers.registerChartView(FunnelView); - registers.registerSeriesModel(FunnelSeriesModel); - registers.registerLayout(funnelLayout); - registers.registerProcessor(dataFilter('funnel')); + registers.registerChartView(FunnelView); + registers.registerSeriesModel(FunnelSeriesModel); + registers.registerLayout(funnelLayout); + registers.registerProcessor(dataFilter('funnel')); } var DEFAULT_SMOOTH = 0.3; var ParallelView = - /** @class */ - function (_super) { - __extends(ParallelView, _super); - - function ParallelView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = ParallelView.type; - _this._dataGroup = new Group(); - _this._initialized = false; - return _this; - } - - ParallelView.prototype.init = function () { - this.group.add(this._dataGroup); - }; - /** - * @override - */ + /** @class */ + function (_super) { + __extends(ParallelView, _super); + + function ParallelView() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = ParallelView.type; + _this._dataGroup = new Group(); + _this._initialized = false; + return _this; + } + + ParallelView.prototype.init = function () { + this.group.add(this._dataGroup); + }; + /** + * @override + */ - ParallelView.prototype.render = function (seriesModel, ecModel, api, payload) { - // Clear previously rendered progressive elements. - this._progressiveEls = null; - var dataGroup = this._dataGroup; - var data = seriesModel.getData(); - var oldData = this._data; - var coordSys = seriesModel.coordinateSystem; - var dimensions = coordSys.dimensions; - var seriesScope = makeSeriesScope$2(seriesModel); - data.diff(oldData).add(add).update(update).remove(remove).execute(); + ParallelView.prototype.render = function (seriesModel, ecModel, api, payload) { + // Clear previously rendered progressive elements. + this._progressiveEls = null; + var dataGroup = this._dataGroup; + var data = seriesModel.getData(); + var oldData = this._data; + var coordSys = seriesModel.coordinateSystem; + var dimensions = coordSys.dimensions; + var seriesScope = makeSeriesScope$2(seriesModel); + data.diff(oldData).add(add).update(update).remove(remove).execute(); - function add(newDataIndex) { - var line = addEl(data, dataGroup, newDataIndex, dimensions, coordSys); - updateElCommon(line, data, newDataIndex, seriesScope); - } + function add(newDataIndex) { + var line = addEl(data, dataGroup, newDataIndex, dimensions, coordSys); + updateElCommon(line, data, newDataIndex, seriesScope); + } - function update(newDataIndex, oldDataIndex) { - var line = oldData.getItemGraphicEl(oldDataIndex); - var points = createLinePoints(data, newDataIndex, dimensions, coordSys); - data.setItemGraphicEl(newDataIndex, line); - updateProps(line, { - shape: { - points: points - } - }, seriesModel, newDataIndex); - saveOldStyle(line); - updateElCommon(line, data, newDataIndex, seriesScope); - } + function update(newDataIndex, oldDataIndex) { + var line = oldData.getItemGraphicEl(oldDataIndex); + var points = createLinePoints(data, newDataIndex, dimensions, coordSys); + data.setItemGraphicEl(newDataIndex, line); + updateProps(line, { + shape: { + points: points + } + }, seriesModel, newDataIndex); + saveOldStyle(line); + updateElCommon(line, data, newDataIndex, seriesScope); + } - function remove(oldDataIndex) { - var line = oldData.getItemGraphicEl(oldDataIndex); - dataGroup.remove(line); - } // First create + function remove(oldDataIndex) { + var line = oldData.getItemGraphicEl(oldDataIndex); + dataGroup.remove(line); + } // First create - if (!this._initialized) { - this._initialized = true; - var clipPath = createGridClipShape(coordSys, seriesModel, function () { - // Callback will be invoked immediately if there is no animation - setTimeout(function () { - dataGroup.removeClipPath(); - }); - }); - dataGroup.setClipPath(clipPath); - } + if (!this._initialized) { + this._initialized = true; + var clipPath = createGridClipShape(coordSys, seriesModel, function () { + // Callback will be invoked immediately if there is no animation + setTimeout(function () { + dataGroup.removeClipPath(); + }); + }); + dataGroup.setClipPath(clipPath); + } - this._data = data; - }; + this._data = data; + }; - ParallelView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) { - this._initialized = true; - this._data = null; + ParallelView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) { + this._initialized = true; + this._data = null; - this._dataGroup.removeAll(); - }; + this._dataGroup.removeAll(); + }; - ParallelView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) { - var data = seriesModel.getData(); - var coordSys = seriesModel.coordinateSystem; - var dimensions = coordSys.dimensions; - var seriesScope = makeSeriesScope$2(seriesModel); - var progressiveEls = this._progressiveEls = []; + ParallelView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) { + var data = seriesModel.getData(); + var coordSys = seriesModel.coordinateSystem; + var dimensions = coordSys.dimensions; + var seriesScope = makeSeriesScope$2(seriesModel); + var progressiveEls = this._progressiveEls = []; - for (var dataIndex = taskParams.start; dataIndex < taskParams.end; dataIndex++) { - var line = addEl(data, this._dataGroup, dataIndex, dimensions, coordSys); - line.incremental = true; - updateElCommon(line, data, dataIndex, seriesScope); - progressiveEls.push(line); - } - }; + for (var dataIndex = taskParams.start; dataIndex < taskParams.end; dataIndex++) { + var line = addEl(data, this._dataGroup, dataIndex, dimensions, coordSys); + line.incremental = true; + updateElCommon(line, data, dataIndex, seriesScope); + progressiveEls.push(line); + } + }; - ParallelView.prototype.remove = function () { - this._dataGroup && this._dataGroup.removeAll(); - this._data = null; - }; + ParallelView.prototype.remove = function () { + this._dataGroup && this._dataGroup.removeAll(); + this._data = null; + }; - ParallelView.type = 'parallel'; - return ParallelView; - }(ChartView); + ParallelView.type = 'parallel'; + return ParallelView; + }(ChartView); function createGridClipShape(coordSys, seriesModel, cb) { - var parallelModel = coordSys.model; - var rect = coordSys.getRect(); - var rectEl = new Rect({ - shape: { - x: rect.x, - y: rect.y, - width: rect.width, - height: rect.height - } - }); - var dim = parallelModel.get('layout') === 'horizontal' ? 'width' : 'height'; - rectEl.setShape(dim, 0); - initProps(rectEl, { - shape: { - width: rect.width, - height: rect.height - } - }, seriesModel, cb); - return rectEl; + var parallelModel = coordSys.model; + var rect = coordSys.getRect(); + var rectEl = new Rect({ + shape: { + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height + } + }); + var dim = parallelModel.get('layout') === 'horizontal' ? 'width' : 'height'; + rectEl.setShape(dim, 0); + initProps(rectEl, { + shape: { + width: rect.width, + height: rect.height + } + }, seriesModel, cb); + return rectEl; } function createLinePoints(data, dataIndex, dimensions, coordSys) { - var points = []; + var points = []; - for (var i = 0; i < dimensions.length; i++) { - var dimName = dimensions[i]; - var value = data.get(data.mapDimension(dimName), dataIndex); + for (var i = 0; i < dimensions.length; i++) { + var dimName = dimensions[i]; + var value = data.get(data.mapDimension(dimName), dataIndex); - if (!isEmptyValue(value, coordSys.getAxis(dimName).type)) { - points.push(coordSys.dataToPoint(value, dimName)); - } + if (!isEmptyValue(value, coordSys.getAxis(dimName).type)) { + points.push(coordSys.dataToPoint(value, dimName)); } + } - return points; + return points; } function addEl(data, dataGroup, dataIndex, dimensions, coordSys) { - var points = createLinePoints(data, dataIndex, dimensions, coordSys); - var line = new Polyline({ - shape: { - points: points - }, - // silent: true, - z2: 10 - }); - dataGroup.add(line); - data.setItemGraphicEl(dataIndex, line); - return line; + var points = createLinePoints(data, dataIndex, dimensions, coordSys); + var line = new Polyline({ + shape: { + points: points + }, + // silent: true, + z2: 10 + }); + dataGroup.add(line); + data.setItemGraphicEl(dataIndex, line); + return line; } function makeSeriesScope$2(seriesModel) { - var smooth = seriesModel.get('smooth', true); - smooth === true && (smooth = DEFAULT_SMOOTH); - smooth = numericToNumber(smooth); - eqNaN(smooth) && (smooth = 0); - return { - smooth: smooth - }; + var smooth = seriesModel.get('smooth', true); + smooth === true && (smooth = DEFAULT_SMOOTH); + smooth = numericToNumber(smooth); + eqNaN(smooth) && (smooth = 0); + return { + smooth: smooth + }; } function updateElCommon(el, data, dataIndex, seriesScope) { - el.useStyle(data.getItemVisual(dataIndex, 'style')); - el.style.fill = null; - el.setShape('smooth', seriesScope.smooth); - var itemModel = data.getItemModel(dataIndex); - var emphasisModel = itemModel.getModel('emphasis'); - setStatesStylesFromModel(el, itemModel, 'lineStyle'); - toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); + el.useStyle(data.getItemVisual(dataIndex, 'style')); + el.style.fill = null; + el.setShape('smooth', seriesScope.smooth); + var itemModel = data.getItemModel(dataIndex); + var emphasisModel = itemModel.getModel('emphasis'); + setStatesStylesFromModel(el, itemModel, 'lineStyle'); + toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); } // function simpleDiff(oldData, newData, dimensions) { // let oldLen; // if (!oldData @@ -63079,99 +63079,99 @@ function isEmptyValue(val, axisType) { - return axisType === 'category' ? val == null : val == null || isNaN(val); // axisType === 'value' + return axisType === 'category' ? val == null : val == null || isNaN(val); // axisType === 'value' } var ParallelSeriesModel = - /** @class */ - function (_super) { - __extends(ParallelSeriesModel, _super); - - function ParallelSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = ParallelSeriesModel.type; - _this.visualStyleAccessPath = 'lineStyle'; - _this.visualDrawType = 'stroke'; - return _this; - } - - ParallelSeriesModel.prototype.getInitialData = function (option, ecModel) { - return createSeriesData(null, this, { - useEncodeDefaulter: bind(makeDefaultEncode, null, this) - }); - }; - /** - * User can get data raw indices on 'axisAreaSelected' event received. - * - * @return Raw indices - */ + /** @class */ + function (_super) { + __extends(ParallelSeriesModel, _super); + + function ParallelSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = ParallelSeriesModel.type; + _this.visualStyleAccessPath = 'lineStyle'; + _this.visualDrawType = 'stroke'; + return _this; + } + + ParallelSeriesModel.prototype.getInitialData = function (option, ecModel) { + return createSeriesData(null, this, { + useEncodeDefaulter: bind(makeDefaultEncode, null, this) + }); + }; + /** + * User can get data raw indices on 'axisAreaSelected' event received. + * + * @return Raw indices + */ - ParallelSeriesModel.prototype.getRawIndicesByActiveState = function (activeState) { - var coordSys = this.coordinateSystem; - var data = this.getData(); - var indices = []; - coordSys.eachActiveState(data, function (theActiveState, dataIndex) { - if (activeState === theActiveState) { - indices.push(data.getRawIndex(dataIndex)); - } - }); - return indices; - }; + ParallelSeriesModel.prototype.getRawIndicesByActiveState = function (activeState) { + var coordSys = this.coordinateSystem; + var data = this.getData(); + var indices = []; + coordSys.eachActiveState(data, function (theActiveState, dataIndex) { + if (activeState === theActiveState) { + indices.push(data.getRawIndex(dataIndex)); + } + }); + return indices; + }; - ParallelSeriesModel.type = 'series.parallel'; - ParallelSeriesModel.dependencies = ['parallel']; - ParallelSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - coordinateSystem: 'parallel', - parallelIndex: 0, - label: { - show: false - }, - inactiveOpacity: 0.05, - activeOpacity: 1, - lineStyle: { - width: 1, - opacity: 0.45, - type: 'solid' - }, - emphasis: { - label: { - show: false - } - }, - progressive: 500, - smooth: false, - animationEasing: 'linear' - }; - return ParallelSeriesModel; - }(SeriesModel); + ParallelSeriesModel.type = 'series.parallel'; + ParallelSeriesModel.dependencies = ['parallel']; + ParallelSeriesModel.defaultOption = { + // zlevel: 0, + z: 2, + coordinateSystem: 'parallel', + parallelIndex: 0, + label: { + show: false + }, + inactiveOpacity: 0.05, + activeOpacity: 1, + lineStyle: { + width: 1, + opacity: 0.45, + type: 'solid' + }, + emphasis: { + label: { + show: false + } + }, + progressive: 500, + smooth: false, + animationEasing: 'linear' + }; + return ParallelSeriesModel; + }(SeriesModel); function makeDefaultEncode(seriesModel) { - // The mapping of parallelAxis dimension to data dimension can - // be specified in parallelAxis.option.dim. For example, if - // parallelAxis.option.dim is 'dim3', it mapping to the third - // dimension of data. But `data.encode` has higher priority. - // Moreover, parallelModel.dimension should not be regarded as data - // dimensions. Consider dimensions = ['dim4', 'dim2', 'dim6']; - var parallelModel = seriesModel.ecModel.getComponent('parallel', seriesModel.get('parallelIndex')); - - if (!parallelModel) { - return; - } + // The mapping of parallelAxis dimension to data dimension can + // be specified in parallelAxis.option.dim. For example, if + // parallelAxis.option.dim is 'dim3', it mapping to the third + // dimension of data. But `data.encode` has higher priority. + // Moreover, parallelModel.dimension should not be regarded as data + // dimensions. Consider dimensions = ['dim4', 'dim2', 'dim6']; + var parallelModel = seriesModel.ecModel.getComponent('parallel', seriesModel.get('parallelIndex')); + + if (!parallelModel) { + return; + } - var encodeDefine = {}; - each(parallelModel.dimensions, function (axisDim) { - var dataDimIndex = convertDimNameToNumber(axisDim); - encodeDefine[axisDim] = dataDimIndex; - }); - return encodeDefine; + var encodeDefine = {}; + each(parallelModel.dimensions, function (axisDim) { + var dataDimIndex = convertDimNameToNumber(axisDim); + encodeDefine[axisDim] = dataDimIndex; + }); + return encodeDefine; } function convertDimNameToNumber(dimName) { - return +dimName.replace('dim', ''); + return +dimName.replace('dim', ''); } /* @@ -63218,35 +63218,35 @@ */ var opacityAccessPath$1 = ['lineStyle', 'opacity']; var parallelVisual = { - seriesType: 'parallel', - reset: function (seriesModel, ecModel) { - var coordSys = seriesModel.coordinateSystem; - var opacityMap = { - normal: seriesModel.get(['lineStyle', 'opacity']), - active: seriesModel.get('activeOpacity'), - inactive: seriesModel.get('inactiveOpacity') - }; - return { - progress: function (params, data) { - coordSys.eachActiveState(data, function (activeState, dataIndex) { - var opacity = opacityMap[activeState]; + seriesType: 'parallel', + reset: function (seriesModel, ecModel) { + var coordSys = seriesModel.coordinateSystem; + var opacityMap = { + normal: seriesModel.get(['lineStyle', 'opacity']), + active: seriesModel.get('activeOpacity'), + inactive: seriesModel.get('inactiveOpacity') + }; + return { + progress: function (params, data) { + coordSys.eachActiveState(data, function (activeState, dataIndex) { + var opacity = opacityMap[activeState]; - if (activeState === 'normal' && data.hasItemOption) { - var itemOpacity = data.getItemModel(dataIndex).get(opacityAccessPath$1, true); - itemOpacity != null && (opacity = itemOpacity); - } + if (activeState === 'normal' && data.hasItemOption) { + var itemOpacity = data.getItemModel(dataIndex).get(opacityAccessPath$1, true); + itemOpacity != null && (opacity = itemOpacity); + } - var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style'); - existsStyle.opacity = opacity; - }, params.start, params.end); - } - }; - } + var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style'); + existsStyle.opacity = opacity; + }, params.start, params.end); + } + }; + } }; function parallelPreprocessor(option) { - createParallelIfNeeded(option); - mergeAxisOptionFromParallel(option); + createParallelIfNeeded(option); + mergeAxisOptionFromParallel(option); } /** * Create a parallel coordinate if not exists. @@ -63254,20 +63254,20 @@ */ function createParallelIfNeeded(option) { - if (option.parallel) { - return; - } - - var hasParallelSeries = false; - each(option.series, function (seriesOpt) { - if (seriesOpt && seriesOpt.type === 'parallel') { - hasParallelSeries = true; - } - }); + if (option.parallel) { + return; + } - if (hasParallelSeries) { - option.parallel = [{}]; + var hasParallelSeries = false; + each(option.series, function (seriesOpt) { + if (seriesOpt && seriesOpt.type === 'parallel') { + hasParallelSeries = true; } + }); + + if (hasParallelSeries) { + option.parallel = [{}]; + } } /** * Merge aixs definition from parallel option (if exists) to axis option. @@ -63276,242 +63276,242 @@ function mergeAxisOptionFromParallel(option) { - var axes = normalizeToArray(option.parallelAxis); - each(axes, function (axisOption) { - if (!isObject(axisOption)) { - return; - } + var axes = normalizeToArray(option.parallelAxis); + each(axes, function (axisOption) { + if (!isObject(axisOption)) { + return; + } - var parallelIndex = axisOption.parallelIndex || 0; - var parallelOption = normalizeToArray(option.parallel)[parallelIndex]; + var parallelIndex = axisOption.parallelIndex || 0; + var parallelOption = normalizeToArray(option.parallel)[parallelIndex]; - if (parallelOption && parallelOption.parallelAxisDefault) { - merge(axisOption, parallelOption.parallelAxisDefault, false); - } - }); + if (parallelOption && parallelOption.parallelAxisDefault) { + merge(axisOption, parallelOption.parallelAxisDefault, false); + } + }); } var CLICK_THRESHOLD = 5; // > 4 var ParallelView$1 = - /** @class */ - function (_super) { - __extends(ParallelView, _super); + /** @class */ + function (_super) { + __extends(ParallelView, _super); - function ParallelView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function ParallelView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ParallelView.type; - return _this; - } + _this.type = ParallelView.type; + return _this; + } - ParallelView.prototype.render = function (parallelModel, ecModel, api) { - this._model = parallelModel; - this._api = api; + ParallelView.prototype.render = function (parallelModel, ecModel, api) { + this._model = parallelModel; + this._api = api; - if (!this._handlers) { - this._handlers = {}; - each(handlers, function (handler, eventName) { - api.getZr().on(eventName, this._handlers[eventName] = bind(handler, this)); - }, this); - } + if (!this._handlers) { + this._handlers = {}; + each(handlers, function (handler, eventName) { + api.getZr().on(eventName, this._handlers[eventName] = bind(handler, this)); + }, this); + } - createOrUpdate(this, '_throttledDispatchExpand', parallelModel.get('axisExpandRate'), 'fixRate'); - }; + createOrUpdate(this, '_throttledDispatchExpand', parallelModel.get('axisExpandRate'), 'fixRate'); + }; - ParallelView.prototype.dispose = function (ecModel, api) { - clear(this, '_throttledDispatchExpand'); - each(this._handlers, function (handler, eventName) { - api.getZr().off(eventName, handler); - }); - this._handlers = null; - }; - /** - * @internal - * @param {Object} [opt] If null, cancle the last action triggering for debounce. - */ + ParallelView.prototype.dispose = function (ecModel, api) { + clear(this, '_throttledDispatchExpand'); + each(this._handlers, function (handler, eventName) { + api.getZr().off(eventName, handler); + }); + this._handlers = null; + }; + /** + * @internal + * @param {Object} [opt] If null, cancle the last action triggering for debounce. + */ - ParallelView.prototype._throttledDispatchExpand = function (opt) { - this._dispatchExpand(opt); - }; - /** - * @internal - */ + ParallelView.prototype._throttledDispatchExpand = function (opt) { + this._dispatchExpand(opt); + }; + /** + * @internal + */ - ParallelView.prototype._dispatchExpand = function (opt) { - opt && this._api.dispatchAction(extend({ - type: 'parallelAxisExpand' - }, opt)); - }; + ParallelView.prototype._dispatchExpand = function (opt) { + opt && this._api.dispatchAction(extend({ + type: 'parallelAxisExpand' + }, opt)); + }; - ParallelView.type = 'parallel'; - return ParallelView; - }(ComponentView); + ParallelView.type = 'parallel'; + return ParallelView; + }(ComponentView); var handlers = { - mousedown: function (e) { - if (checkTrigger(this, 'click')) { - this._mouseDownPoint = [e.offsetX, e.offsetY]; - } - }, - mouseup: function (e) { - var mouseDownPoint = this._mouseDownPoint; + mousedown: function (e) { + if (checkTrigger(this, 'click')) { + this._mouseDownPoint = [e.offsetX, e.offsetY]; + } + }, + mouseup: function (e) { + var mouseDownPoint = this._mouseDownPoint; - if (checkTrigger(this, 'click') && mouseDownPoint) { - var point = [e.offsetX, e.offsetY]; - var dist = Math.pow(mouseDownPoint[0] - point[0], 2) + Math.pow(mouseDownPoint[1] - point[1], 2); + if (checkTrigger(this, 'click') && mouseDownPoint) { + var point = [e.offsetX, e.offsetY]; + var dist = Math.pow(mouseDownPoint[0] - point[0], 2) + Math.pow(mouseDownPoint[1] - point[1], 2); - if (dist > CLICK_THRESHOLD) { - return; - } + if (dist > CLICK_THRESHOLD) { + return; + } - var result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]); + var result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]); - result.behavior !== 'none' && this._dispatchExpand({ - axisExpandWindow: result.axisExpandWindow - }); - } + result.behavior !== 'none' && this._dispatchExpand({ + axisExpandWindow: result.axisExpandWindow + }); + } - this._mouseDownPoint = null; - }, - mousemove: function (e) { - // Should do nothing when brushing. - if (this._mouseDownPoint || !checkTrigger(this, 'mousemove')) { - return; - } + this._mouseDownPoint = null; + }, + mousemove: function (e) { + // Should do nothing when brushing. + if (this._mouseDownPoint || !checkTrigger(this, 'mousemove')) { + return; + } - var model = this._model; - var result = model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]); - var behavior = result.behavior; - behavior === 'jump' && this._throttledDispatchExpand.debounceNextCall(model.get('axisExpandDebounce')); + var model = this._model; + var result = model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]); + var behavior = result.behavior; + behavior === 'jump' && this._throttledDispatchExpand.debounceNextCall(model.get('axisExpandDebounce')); - this._throttledDispatchExpand(behavior === 'none' ? null // Cancle the last trigger, in case that mouse slide out of the area quickly. - : { - axisExpandWindow: result.axisExpandWindow, - // Jumping uses animation, and sliding suppresses animation. - animation: behavior === 'jump' ? null : { - duration: 0 // Disable animation. + this._throttledDispatchExpand(behavior === 'none' ? null // Cancle the last trigger, in case that mouse slide out of the area quickly. + : { + axisExpandWindow: result.axisExpandWindow, + // Jumping uses animation, and sliding suppresses animation. + animation: behavior === 'jump' ? null : { + duration: 0 // Disable animation. - } - }); - } + } + }); + } }; function checkTrigger(view, triggerOn) { - var model = view._model; - return model.get('axisExpandable') && model.get('axisExpandTriggerOn') === triggerOn; + var model = view._model; + return model.get('axisExpandable') && model.get('axisExpandTriggerOn') === triggerOn; } var ParallelModel = - /** @class */ - function (_super) { - __extends(ParallelModel, _super); + /** @class */ + function (_super) { + __extends(ParallelModel, _super); - function ParallelModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = ParallelModel.type; - return _this; - } + function ParallelModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - ParallelModel.prototype.init = function () { - _super.prototype.init.apply(this, arguments); + _this.type = ParallelModel.type; + return _this; + } - this.mergeOption({}); - }; + ParallelModel.prototype.init = function () { + _super.prototype.init.apply(this, arguments); - ParallelModel.prototype.mergeOption = function (newOption) { - var thisOption = this.option; - newOption && merge(thisOption, newOption, true); + this.mergeOption({}); + }; - this._initDimensions(); - }; - /** - * Whether series or axis is in this coordinate system. - */ + ParallelModel.prototype.mergeOption = function (newOption) { + var thisOption = this.option; + newOption && merge(thisOption, newOption, true); + this._initDimensions(); + }; + /** + * Whether series or axis is in this coordinate system. + */ - ParallelModel.prototype.contains = function (model, ecModel) { - var parallelIndex = model.get('parallelIndex'); - return parallelIndex != null && ecModel.getComponent('parallel', parallelIndex) === this; - }; - ParallelModel.prototype.setAxisExpand = function (opt) { - each(['axisExpandable', 'axisExpandCenter', 'axisExpandCount', 'axisExpandWidth', 'axisExpandWindow'], function (name) { - if (opt.hasOwnProperty(name)) { - // @ts-ignore FIXME: why "never" inferred in this.option[name]? - this.option[name] = opt[name]; - } - }, this); - }; + ParallelModel.prototype.contains = function (model, ecModel) { + var parallelIndex = model.get('parallelIndex'); + return parallelIndex != null && ecModel.getComponent('parallel', parallelIndex) === this; + }; - ParallelModel.prototype._initDimensions = function () { - var dimensions = this.dimensions = []; - var parallelAxisIndex = this.parallelAxisIndex = []; - var axisModels = filter(this.ecModel.queryComponents({ - mainType: 'parallelAxis' - }), function (axisModel) { - // Can not use this.contains here, because - // initialization has not been completed yet. - return (axisModel.get('parallelIndex') || 0) === this.componentIndex; - }, this); - each(axisModels, function (axisModel) { - dimensions.push('dim' + axisModel.get('dim')); - parallelAxisIndex.push(axisModel.componentIndex); - }); - }; + ParallelModel.prototype.setAxisExpand = function (opt) { + each(['axisExpandable', 'axisExpandCenter', 'axisExpandCount', 'axisExpandWidth', 'axisExpandWindow'], function (name) { + if (opt.hasOwnProperty(name)) { + // @ts-ignore FIXME: why "never" inferred in this.option[name]? + this.option[name] = opt[name]; + } + }, this); + }; + + ParallelModel.prototype._initDimensions = function () { + var dimensions = this.dimensions = []; + var parallelAxisIndex = this.parallelAxisIndex = []; + var axisModels = filter(this.ecModel.queryComponents({ + mainType: 'parallelAxis' + }), function (axisModel) { + // Can not use this.contains here, because + // initialization has not been completed yet. + return (axisModel.get('parallelIndex') || 0) === this.componentIndex; + }, this); + each(axisModels, function (axisModel) { + dimensions.push('dim' + axisModel.get('dim')); + parallelAxisIndex.push(axisModel.componentIndex); + }); + }; - ParallelModel.type = 'parallel'; - ParallelModel.dependencies = ['parallelAxis']; - ParallelModel.layoutMode = 'box'; - ParallelModel.defaultOption = { - // zlevel: 0, - z: 0, - left: 80, - top: 60, - right: 80, - bottom: 60, - // width: {totalWidth} - left - right, - // height: {totalHeight} - top - bottom, - layout: 'horizontal', - // FIXME - // naming? - axisExpandable: false, - axisExpandCenter: null, - axisExpandCount: 0, - axisExpandWidth: 50, - axisExpandRate: 17, - axisExpandDebounce: 50, - // [out, in, jumpTarget]. In percentage. If use [null, 0.05], null means full. - // Do not doc to user until necessary. - axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4], - axisExpandTriggerOn: 'click', - parallelAxisDefault: null - }; - return ParallelModel; - }(ComponentModel); + ParallelModel.type = 'parallel'; + ParallelModel.dependencies = ['parallelAxis']; + ParallelModel.layoutMode = 'box'; + ParallelModel.defaultOption = { + // zlevel: 0, + z: 0, + left: 80, + top: 60, + right: 80, + bottom: 60, + // width: {totalWidth} - left - right, + // height: {totalHeight} - top - bottom, + layout: 'horizontal', + // FIXME + // naming? + axisExpandable: false, + axisExpandCenter: null, + axisExpandCount: 0, + axisExpandWidth: 50, + axisExpandRate: 17, + axisExpandDebounce: 50, + // [out, in, jumpTarget]. In percentage. If use [null, 0.05], null means full. + // Do not doc to user until necessary. + axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4], + axisExpandTriggerOn: 'click', + parallelAxisDefault: null + }; + return ParallelModel; + }(ComponentModel); var ParallelAxis = - /** @class */ - function (_super) { - __extends(ParallelAxis, _super); + /** @class */ + function (_super) { + __extends(ParallelAxis, _super); - function ParallelAxis(dim, scale, coordExtent, axisType, axisIndex) { - var _this = _super.call(this, dim, scale, coordExtent) || this; + function ParallelAxis(dim, scale, coordExtent, axisType, axisIndex) { + var _this = _super.call(this, dim, scale, coordExtent) || this; - _this.type = axisType || 'value'; - _this.axisIndex = axisIndex; - return _this; - } + _this.type = axisType || 'value'; + _this.axisIndex = axisIndex; + return _this; + } - ParallelAxis.prototype.isHorizontal = function () { - return this.coordinateSystem.getModel().get('layout') !== 'horizontal'; - }; + ParallelAxis.prototype.isHorizontal = function () { + return this.coordinateSystem.getModel().get('layout') !== 'horizontal'; + }; - return ParallelAxis; - }(Axis); + return ParallelAxis; + }(Axis); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -63577,64 +63577,64 @@ * @return The input handleEnds. */ function sliderMove(delta, handleEnds, extent, handleIndex, minSpan, maxSpan) { - delta = delta || 0; - var extentSpan = extent[1] - extent[0]; // Notice maxSpan and minSpan can be null/undefined. + delta = delta || 0; + var extentSpan = extent[1] - extent[0]; // Notice maxSpan and minSpan can be null/undefined. - if (minSpan != null) { - minSpan = restrict(minSpan, [0, extentSpan]); - } + if (minSpan != null) { + minSpan = restrict(minSpan, [0, extentSpan]); + } - if (maxSpan != null) { - maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0); - } + if (maxSpan != null) { + maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0); + } - if (handleIndex === 'all') { - var handleSpan = Math.abs(handleEnds[1] - handleEnds[0]); - handleSpan = restrict(handleSpan, [0, extentSpan]); - minSpan = maxSpan = restrict(handleSpan, [minSpan, maxSpan]); - handleIndex = 0; - } + if (handleIndex === 'all') { + var handleSpan = Math.abs(handleEnds[1] - handleEnds[0]); + handleSpan = restrict(handleSpan, [0, extentSpan]); + minSpan = maxSpan = restrict(handleSpan, [minSpan, maxSpan]); + handleIndex = 0; + } - handleEnds[0] = restrict(handleEnds[0], extent); - handleEnds[1] = restrict(handleEnds[1], extent); - var originalDistSign = getSpanSign(handleEnds, handleIndex); - handleEnds[handleIndex] += delta; // Restrict in extent. + handleEnds[0] = restrict(handleEnds[0], extent); + handleEnds[1] = restrict(handleEnds[1], extent); + var originalDistSign = getSpanSign(handleEnds, handleIndex); + handleEnds[handleIndex] += delta; // Restrict in extent. - var extentMinSpan = minSpan || 0; - var realExtent = extent.slice(); - originalDistSign.sign < 0 ? realExtent[0] += extentMinSpan : realExtent[1] -= extentMinSpan; - handleEnds[handleIndex] = restrict(handleEnds[handleIndex], realExtent); // Expand span. + var extentMinSpan = minSpan || 0; + var realExtent = extent.slice(); + originalDistSign.sign < 0 ? realExtent[0] += extentMinSpan : realExtent[1] -= extentMinSpan; + handleEnds[handleIndex] = restrict(handleEnds[handleIndex], realExtent); // Expand span. - var currDistSign; - currDistSign = getSpanSign(handleEnds, handleIndex); + var currDistSign; + currDistSign = getSpanSign(handleEnds, handleIndex); - if (minSpan != null && (currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan)) { - // If minSpan exists, 'cross' is forbidden. - handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan; - } // Shrink span. + if (minSpan != null && (currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan)) { + // If minSpan exists, 'cross' is forbidden. + handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan; + } // Shrink span. - currDistSign = getSpanSign(handleEnds, handleIndex); + currDistSign = getSpanSign(handleEnds, handleIndex); - if (maxSpan != null && currDistSign.span > maxSpan) { - handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan; - } + if (maxSpan != null && currDistSign.span > maxSpan) { + handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan; + } - return handleEnds; + return handleEnds; } function getSpanSign(handleEnds, handleIndex) { - var dist = handleEnds[handleIndex] - handleEnds[1 - handleIndex]; // If `handleEnds[0] === handleEnds[1]`, always believe that handleEnd[0] - // is at left of handleEnds[1] for non-cross case. + var dist = handleEnds[handleIndex] - handleEnds[1 - handleIndex]; // If `handleEnds[0] === handleEnds[1]`, always believe that handleEnd[0] + // is at left of handleEnds[1] for non-cross case. - return { - span: Math.abs(dist), - sign: dist > 0 ? -1 : dist < 0 ? 1 : handleIndex ? -1 : 1 - }; + return { + span: Math.abs(dist), + sign: dist > 0 ? -1 : dist < 0 ? 1 : handleIndex ? -1 : 1 + }; } function restrict(value, extend) { - return Math.min(extend[1] != null ? extend[1] : Infinity, Math.max(extend[0] != null ? extend[0] : -Infinity, value)); + return Math.min(extend[1] != null ? extend[1] : Infinity, Math.max(extend[0] != null ? extend[0] : -Infinity, value)); } var each$5 = each; @@ -63646,514 +63646,514 @@ var PI$7 = Math.PI; var Parallel = - /** @class */ - function () { - function Parallel(parallelModel, ecModel, api) { - this.type = 'parallel'; - /** - * key: dimension - */ - - this._axesMap = createHashMap(); - /** - * key: dimension - * value: {position: [], rotation, } - */ - - this._axesLayout = {}; - this.dimensions = parallelModel.dimensions; - this._model = parallelModel; - - this._init(parallelModel, ecModel, api); - } + /** @class */ + function () { + function Parallel(parallelModel, ecModel, api) { + this.type = 'parallel'; + /** + * key: dimension + */ - Parallel.prototype._init = function (parallelModel, ecModel, api) { - var dimensions = parallelModel.dimensions; - var parallelAxisIndex = parallelModel.parallelAxisIndex; - each$5(dimensions, function (dim, idx) { - var axisIndex = parallelAxisIndex[idx]; - var axisModel = ecModel.getComponent('parallelAxis', axisIndex); + this._axesMap = createHashMap(); + /** + * key: dimension + * value: {position: [], rotation, } + */ - var axis = this._axesMap.set(dim, new ParallelAxis(dim, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisIndex)); + this._axesLayout = {}; + this.dimensions = parallelModel.dimensions; + this._model = parallelModel; - var isCategory = axis.type === 'category'; - axis.onBand = isCategory && axisModel.get('boundaryGap'); - axis.inverse = axisModel.get('inverse'); // Injection + this._init(parallelModel, ecModel, api); + } - axisModel.axis = axis; - axis.model = axisModel; - axis.coordinateSystem = axisModel.coordinateSystem = this; - }, this); - }; - /** - * Update axis scale after data processed - */ + Parallel.prototype._init = function (parallelModel, ecModel, api) { + var dimensions = parallelModel.dimensions; + var parallelAxisIndex = parallelModel.parallelAxisIndex; + each$5(dimensions, function (dim, idx) { + var axisIndex = parallelAxisIndex[idx]; + var axisModel = ecModel.getComponent('parallelAxis', axisIndex); + var axis = this._axesMap.set(dim, new ParallelAxis(dim, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisIndex)); - Parallel.prototype.update = function (ecModel, api) { - this._updateAxesFromSeries(this._model, ecModel); - }; + var isCategory = axis.type === 'category'; + axis.onBand = isCategory && axisModel.get('boundaryGap'); + axis.inverse = axisModel.get('inverse'); // Injection - Parallel.prototype.containPoint = function (point) { - var layoutInfo = this._makeLayoutInfo(); + axisModel.axis = axis; + axis.model = axisModel; + axis.coordinateSystem = axisModel.coordinateSystem = this; + }, this); + }; + /** + * Update axis scale after data processed + */ - var axisBase = layoutInfo.axisBase; - var layoutBase = layoutInfo.layoutBase; - var pixelDimIndex = layoutInfo.pixelDimIndex; - var pAxis = point[1 - pixelDimIndex]; - var pLayout = point[pixelDimIndex]; - return pAxis >= axisBase && pAxis <= axisBase + layoutInfo.axisLength && pLayout >= layoutBase && pLayout <= layoutBase + layoutInfo.layoutLength; - }; - Parallel.prototype.getModel = function () { - return this._model; - }; - /** - * Update properties from series - */ + Parallel.prototype.update = function (ecModel, api) { + this._updateAxesFromSeries(this._model, ecModel); + }; + Parallel.prototype.containPoint = function (point) { + var layoutInfo = this._makeLayoutInfo(); - Parallel.prototype._updateAxesFromSeries = function (parallelModel, ecModel) { - ecModel.eachSeries(function (seriesModel) { - if (!parallelModel.contains(seriesModel, ecModel)) { - return; - } + var axisBase = layoutInfo.axisBase; + var layoutBase = layoutInfo.layoutBase; + var pixelDimIndex = layoutInfo.pixelDimIndex; + var pAxis = point[1 - pixelDimIndex]; + var pLayout = point[pixelDimIndex]; + return pAxis >= axisBase && pAxis <= axisBase + layoutInfo.axisLength && pLayout >= layoutBase && pLayout <= layoutBase + layoutInfo.layoutLength; + }; - var data = seriesModel.getData(); - each$5(this.dimensions, function (dim) { - var axis = this._axesMap.get(dim); + Parallel.prototype.getModel = function () { + return this._model; + }; + /** + * Update properties from series + */ - axis.scale.unionExtentFromData(data, data.mapDimension(dim)); - niceScaleExtent(axis.scale, axis.model); - }, this); - }, this); - }; - /** - * Resize the parallel coordinate system. - */ + Parallel.prototype._updateAxesFromSeries = function (parallelModel, ecModel) { + ecModel.eachSeries(function (seriesModel) { + if (!parallelModel.contains(seriesModel, ecModel)) { + return; + } - Parallel.prototype.resize = function (parallelModel, api) { - this._rect = getLayoutRect(parallelModel.getBoxLayoutParams(), { - width: api.getWidth(), - height: api.getHeight() - }); + var data = seriesModel.getData(); + each$5(this.dimensions, function (dim) { + var axis = this._axesMap.get(dim); - this._layoutAxes(); - }; + axis.scale.unionExtentFromData(data, data.mapDimension(dim)); + niceScaleExtent(axis.scale, axis.model); + }, this); + }, this); + }; + /** + * Resize the parallel coordinate system. + */ - Parallel.prototype.getRect = function () { - return this._rect; - }; - Parallel.prototype._makeLayoutInfo = function () { - var parallelModel = this._model; - var rect = this._rect; - var xy = ['x', 'y']; - var wh = ['width', 'height']; - var layout = parallelModel.get('layout'); - var pixelDimIndex = layout === 'horizontal' ? 0 : 1; - var layoutLength = rect[wh[pixelDimIndex]]; - var layoutExtent = [0, layoutLength]; - var axisCount = this.dimensions.length; - var axisExpandWidth = restrict$1(parallelModel.get('axisExpandWidth'), layoutExtent); - var axisExpandCount = restrict$1(parallelModel.get('axisExpandCount') || 0, [0, axisCount]); - var axisExpandable = parallelModel.get('axisExpandable') && axisCount > 3 && axisCount > axisExpandCount && axisExpandCount > 1 && axisExpandWidth > 0 && layoutLength > 0; // `axisExpandWindow` is According to the coordinates of [0, axisExpandLength], - // for sake of consider the case that axisCollapseWidth is 0 (when screen is narrow), - // where collapsed axes should be overlapped. - - var axisExpandWindow = parallelModel.get('axisExpandWindow'); - var winSize; - - if (!axisExpandWindow) { - winSize = restrict$1(axisExpandWidth * (axisExpandCount - 1), layoutExtent); - var axisExpandCenter = parallelModel.get('axisExpandCenter') || mathFloor$1(axisCount / 2); - axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2]; - axisExpandWindow[1] = axisExpandWindow[0] + winSize; - } else { - winSize = restrict$1(axisExpandWindow[1] - axisExpandWindow[0], layoutExtent); - axisExpandWindow[1] = axisExpandWindow[0] + winSize; - } + Parallel.prototype.resize = function (parallelModel, api) { + this._rect = getLayoutRect(parallelModel.getBoxLayoutParams(), { + width: api.getWidth(), + height: api.getHeight() + }); - var axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount); // Avoid axisCollapseWidth is too small. + this._layoutAxes(); + }; - axisCollapseWidth < 3 && (axisCollapseWidth = 0); // Find the first and last indices > ewin[0] and < ewin[1]. + Parallel.prototype.getRect = function () { + return this._rect; + }; - var winInnerIndices = [mathFloor$1(round$3(axisExpandWindow[0] / axisExpandWidth, 1)) + 1, mathCeil$1(round$3(axisExpandWindow[1] / axisExpandWidth, 1)) - 1]; // Pos in ec coordinates. + Parallel.prototype._makeLayoutInfo = function () { + var parallelModel = this._model; + var rect = this._rect; + var xy = ['x', 'y']; + var wh = ['width', 'height']; + var layout = parallelModel.get('layout'); + var pixelDimIndex = layout === 'horizontal' ? 0 : 1; + var layoutLength = rect[wh[pixelDimIndex]]; + var layoutExtent = [0, layoutLength]; + var axisCount = this.dimensions.length; + var axisExpandWidth = restrict$1(parallelModel.get('axisExpandWidth'), layoutExtent); + var axisExpandCount = restrict$1(parallelModel.get('axisExpandCount') || 0, [0, axisCount]); + var axisExpandable = parallelModel.get('axisExpandable') && axisCount > 3 && axisCount > axisExpandCount && axisExpandCount > 1 && axisExpandWidth > 0 && layoutLength > 0; // `axisExpandWindow` is According to the coordinates of [0, axisExpandLength], + // for sake of consider the case that axisCollapseWidth is 0 (when screen is narrow), + // where collapsed axes should be overlapped. + + var axisExpandWindow = parallelModel.get('axisExpandWindow'); + var winSize; + + if (!axisExpandWindow) { + winSize = restrict$1(axisExpandWidth * (axisExpandCount - 1), layoutExtent); + var axisExpandCenter = parallelModel.get('axisExpandCenter') || mathFloor$1(axisCount / 2); + axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2]; + axisExpandWindow[1] = axisExpandWindow[0] + winSize; + } else { + winSize = restrict$1(axisExpandWindow[1] - axisExpandWindow[0], layoutExtent); + axisExpandWindow[1] = axisExpandWindow[0] + winSize; + } - var axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0]; - return { - layout: layout, - pixelDimIndex: pixelDimIndex, - layoutBase: rect[xy[pixelDimIndex]], - layoutLength: layoutLength, - axisBase: rect[xy[1 - pixelDimIndex]], - axisLength: rect[wh[1 - pixelDimIndex]], - axisExpandable: axisExpandable, - axisExpandWidth: axisExpandWidth, - axisCollapseWidth: axisCollapseWidth, - axisExpandWindow: axisExpandWindow, - axisCount: axisCount, - winInnerIndices: winInnerIndices, - axisExpandWindow0Pos: axisExpandWindow0Pos - }; - }; + var axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount); // Avoid axisCollapseWidth is too small. - Parallel.prototype._layoutAxes = function () { - var rect = this._rect; - var axes = this._axesMap; - var dimensions = this.dimensions; + axisCollapseWidth < 3 && (axisCollapseWidth = 0); // Find the first and last indices > ewin[0] and < ewin[1]. - var layoutInfo = this._makeLayoutInfo(); + var winInnerIndices = [mathFloor$1(round$3(axisExpandWindow[0] / axisExpandWidth, 1)) + 1, mathCeil$1(round$3(axisExpandWindow[1] / axisExpandWidth, 1)) - 1]; // Pos in ec coordinates. - var layout = layoutInfo.layout; - axes.each(function (axis) { - var axisExtent = [0, layoutInfo.axisLength]; - var idx = axis.inverse ? 1 : 0; - axis.setExtent(axisExtent[idx], axisExtent[1 - idx]); - }); - each$5(dimensions, function (dim, idx) { - var posInfo = (layoutInfo.axisExpandable ? layoutAxisWithExpand : layoutAxisWithoutExpand)(idx, layoutInfo); - var positionTable = { - horizontal: { - x: posInfo.position, - y: layoutInfo.axisLength - }, - vertical: { - x: 0, - y: posInfo.position - } - }; - var rotationTable = { - horizontal: PI$7 / 2, - vertical: 0 - }; - var position = [positionTable[layout].x + rect.x, positionTable[layout].y + rect.y]; - var rotation = rotationTable[layout]; - var transform = create$1(); - rotate(transform, transform, rotation); - translate(transform, transform, position); // TODO - // tick layout info - // TODO - // update dimensions info based on axis order. - - this._axesLayout[dim] = { - position: position, - rotation: rotation, - transform: transform, - axisNameAvailableWidth: posInfo.axisNameAvailableWidth, - axisLabelShow: posInfo.axisLabelShow, - nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth, - tickDirection: 1, - labelDirection: 1 - }; - }, this); - }; - /** - * Get axis by dim. - */ + var axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0]; + return { + layout: layout, + pixelDimIndex: pixelDimIndex, + layoutBase: rect[xy[pixelDimIndex]], + layoutLength: layoutLength, + axisBase: rect[xy[1 - pixelDimIndex]], + axisLength: rect[wh[1 - pixelDimIndex]], + axisExpandable: axisExpandable, + axisExpandWidth: axisExpandWidth, + axisCollapseWidth: axisCollapseWidth, + axisExpandWindow: axisExpandWindow, + axisCount: axisCount, + winInnerIndices: winInnerIndices, + axisExpandWindow0Pos: axisExpandWindow0Pos + }; + }; + + Parallel.prototype._layoutAxes = function () { + var rect = this._rect; + var axes = this._axesMap; + var dimensions = this.dimensions; + + var layoutInfo = this._makeLayoutInfo(); + + var layout = layoutInfo.layout; + axes.each(function (axis) { + var axisExtent = [0, layoutInfo.axisLength]; + var idx = axis.inverse ? 1 : 0; + axis.setExtent(axisExtent[idx], axisExtent[1 - idx]); + }); + each$5(dimensions, function (dim, idx) { + var posInfo = (layoutInfo.axisExpandable ? layoutAxisWithExpand : layoutAxisWithoutExpand)(idx, layoutInfo); + var positionTable = { + horizontal: { + x: posInfo.position, + y: layoutInfo.axisLength + }, + vertical: { + x: 0, + y: posInfo.position + } + }; + var rotationTable = { + horizontal: PI$7 / 2, + vertical: 0 + }; + var position = [positionTable[layout].x + rect.x, positionTable[layout].y + rect.y]; + var rotation = rotationTable[layout]; + var transform = create$1(); + rotate(transform, transform, rotation); + translate(transform, transform, position); // TODO + // tick layout info + // TODO + // update dimensions info based on axis order. + + this._axesLayout[dim] = { + position: position, + rotation: rotation, + transform: transform, + axisNameAvailableWidth: posInfo.axisNameAvailableWidth, + axisLabelShow: posInfo.axisLabelShow, + nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth, + tickDirection: 1, + labelDirection: 1 + }; + }, this); + }; + /** + * Get axis by dim. + */ - Parallel.prototype.getAxis = function (dim) { - return this._axesMap.get(dim); - }; - /** - * Convert a dim value of a single item of series data to Point. - */ + Parallel.prototype.getAxis = function (dim) { + return this._axesMap.get(dim); + }; + /** + * Convert a dim value of a single item of series data to Point. + */ - Parallel.prototype.dataToPoint = function (value, dim) { - return this.axisCoordToPoint(this._axesMap.get(dim).dataToCoord(value), dim); - }; - /** - * Travel data for one time, get activeState of each data item. - * @param start the start dataIndex that travel from. - * @param end the next dataIndex of the last dataIndex will be travel. - */ + Parallel.prototype.dataToPoint = function (value, dim) { + return this.axisCoordToPoint(this._axesMap.get(dim).dataToCoord(value), dim); + }; + /** + * Travel data for one time, get activeState of each data item. + * @param start the start dataIndex that travel from. + * @param end the next dataIndex of the last dataIndex will be travel. + */ - Parallel.prototype.eachActiveState = function (data, callback, start, end) { - start == null && (start = 0); - end == null && (end = data.count()); - var axesMap = this._axesMap; - var dimensions = this.dimensions; - var dataDimensions = []; - var axisModels = []; - each(dimensions, function (axisDim) { - dataDimensions.push(data.mapDimension(axisDim)); - axisModels.push(axesMap.get(axisDim).model); - }); - var hasActiveSet = this.hasAxisBrushed(); + Parallel.prototype.eachActiveState = function (data, callback, start, end) { + start == null && (start = 0); + end == null && (end = data.count()); + var axesMap = this._axesMap; + var dimensions = this.dimensions; + var dataDimensions = []; + var axisModels = []; + each(dimensions, function (axisDim) { + dataDimensions.push(data.mapDimension(axisDim)); + axisModels.push(axesMap.get(axisDim).model); + }); + var hasActiveSet = this.hasAxisBrushed(); - for (var dataIndex = start; dataIndex < end; dataIndex++) { - var activeState = void 0; + for (var dataIndex = start; dataIndex < end; dataIndex++) { + var activeState = void 0; - if (!hasActiveSet) { - activeState = 'normal'; - } else { - activeState = 'active'; - var values = data.getValues(dataDimensions, dataIndex); + if (!hasActiveSet) { + activeState = 'normal'; + } else { + activeState = 'active'; + var values = data.getValues(dataDimensions, dataIndex); - for (var j = 0, lenj = dimensions.length; j < lenj; j++) { - var state = axisModels[j].getActiveState(values[j]); + for (var j = 0, lenj = dimensions.length; j < lenj; j++) { + var state = axisModels[j].getActiveState(values[j]); - if (state === 'inactive') { - activeState = 'inactive'; - break; - } - } - } + if (state === 'inactive') { + activeState = 'inactive'; + break; + } + } + } - callback(activeState, dataIndex); - } - }; - /** - * Whether has any activeSet. - */ + callback(activeState, dataIndex); + } + }; + /** + * Whether has any activeSet. + */ - Parallel.prototype.hasAxisBrushed = function () { - var dimensions = this.dimensions; - var axesMap = this._axesMap; - var hasActiveSet = false; + Parallel.prototype.hasAxisBrushed = function () { + var dimensions = this.dimensions; + var axesMap = this._axesMap; + var hasActiveSet = false; - for (var j = 0, lenj = dimensions.length; j < lenj; j++) { - if (axesMap.get(dimensions[j]).model.getActiveState() !== 'normal') { - hasActiveSet = true; - } - } + for (var j = 0, lenj = dimensions.length; j < lenj; j++) { + if (axesMap.get(dimensions[j]).model.getActiveState() !== 'normal') { + hasActiveSet = true; + } + } - return hasActiveSet; - }; - /** - * Convert coords of each axis to Point. - * Return point. For example: [10, 20] - */ + return hasActiveSet; + }; + /** + * Convert coords of each axis to Point. + * Return point. For example: [10, 20] + */ - Parallel.prototype.axisCoordToPoint = function (coord, dim) { - var axisLayout = this._axesLayout[dim]; - return applyTransform$1([coord, 0], axisLayout.transform); - }; - /** - * Get axis layout. - */ + Parallel.prototype.axisCoordToPoint = function (coord, dim) { + var axisLayout = this._axesLayout[dim]; + return applyTransform$1([coord, 0], axisLayout.transform); + }; + /** + * Get axis layout. + */ - Parallel.prototype.getAxisLayout = function (dim) { - return clone(this._axesLayout[dim]); - }; - /** - * @return {Object} {axisExpandWindow, delta, behavior: 'jump' | 'slide' | 'none'}. - */ + Parallel.prototype.getAxisLayout = function (dim) { + return clone(this._axesLayout[dim]); + }; + /** + * @return {Object} {axisExpandWindow, delta, behavior: 'jump' | 'slide' | 'none'}. + */ - Parallel.prototype.getSlidedAxisExpandWindow = function (point) { - var layoutInfo = this._makeLayoutInfo(); + Parallel.prototype.getSlidedAxisExpandWindow = function (point) { + var layoutInfo = this._makeLayoutInfo(); - var pixelDimIndex = layoutInfo.pixelDimIndex; - var axisExpandWindow = layoutInfo.axisExpandWindow.slice(); - var winSize = axisExpandWindow[1] - axisExpandWindow[0]; - var extent = [0, layoutInfo.axisExpandWidth * (layoutInfo.axisCount - 1)]; // Out of the area of coordinate system. + var pixelDimIndex = layoutInfo.pixelDimIndex; + var axisExpandWindow = layoutInfo.axisExpandWindow.slice(); + var winSize = axisExpandWindow[1] - axisExpandWindow[0]; + var extent = [0, layoutInfo.axisExpandWidth * (layoutInfo.axisCount - 1)]; // Out of the area of coordinate system. - if (!this.containPoint(point)) { - return { - behavior: 'none', - axisExpandWindow: axisExpandWindow - }; - } // Conver the point from global to expand coordinates. + if (!this.containPoint(point)) { + return { + behavior: 'none', + axisExpandWindow: axisExpandWindow + }; + } // Conver the point from global to expand coordinates. - var pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos; // For dragging operation convenience, the window should not be - // slided when mouse is the center area of the window. + var pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos; // For dragging operation convenience, the window should not be + // slided when mouse is the center area of the window. - var delta; - var behavior = 'slide'; - var axisCollapseWidth = layoutInfo.axisCollapseWidth; + var delta; + var behavior = 'slide'; + var axisCollapseWidth = layoutInfo.axisCollapseWidth; - var triggerArea = this._model.get('axisExpandSlideTriggerArea'); // But consider touch device, jump is necessary. + var triggerArea = this._model.get('axisExpandSlideTriggerArea'); // But consider touch device, jump is necessary. - var useJump = triggerArea[0] != null; + var useJump = triggerArea[0] != null; - if (axisCollapseWidth) { - if (useJump && axisCollapseWidth && pointCoord < winSize * triggerArea[0]) { - behavior = 'jump'; - delta = pointCoord - winSize * triggerArea[2]; - } else if (useJump && axisCollapseWidth && pointCoord > winSize * (1 - triggerArea[0])) { - behavior = 'jump'; - delta = pointCoord - winSize * (1 - triggerArea[2]); - } else { - (delta = pointCoord - winSize * triggerArea[1]) >= 0 && (delta = pointCoord - winSize * (1 - triggerArea[1])) <= 0 && (delta = 0); - } + if (axisCollapseWidth) { + if (useJump && axisCollapseWidth && pointCoord < winSize * triggerArea[0]) { + behavior = 'jump'; + delta = pointCoord - winSize * triggerArea[2]; + } else if (useJump && axisCollapseWidth && pointCoord > winSize * (1 - triggerArea[0])) { + behavior = 'jump'; + delta = pointCoord - winSize * (1 - triggerArea[2]); + } else { + (delta = pointCoord - winSize * triggerArea[1]) >= 0 && (delta = pointCoord - winSize * (1 - triggerArea[1])) <= 0 && (delta = 0); + } - delta *= layoutInfo.axisExpandWidth / axisCollapseWidth; - delta ? sliderMove(delta, axisExpandWindow, extent, 'all') // Avoid nonsense triger on mousemove. - : behavior = 'none'; - } // When screen is too narrow, make it visible and slidable, although it is hard to interact. - else { - var winSize2 = axisExpandWindow[1] - axisExpandWindow[0]; - var pos = extent[1] * pointCoord / winSize2; - axisExpandWindow = [mathMax$8(0, pos - winSize2 / 2)]; - axisExpandWindow[1] = mathMin$8(extent[1], axisExpandWindow[0] + winSize2); - axisExpandWindow[0] = axisExpandWindow[1] - winSize2; - } + delta *= layoutInfo.axisExpandWidth / axisCollapseWidth; + delta ? sliderMove(delta, axisExpandWindow, extent, 'all') // Avoid nonsense triger on mousemove. + : behavior = 'none'; + } // When screen is too narrow, make it visible and slidable, although it is hard to interact. + else { + var winSize2 = axisExpandWindow[1] - axisExpandWindow[0]; + var pos = extent[1] * pointCoord / winSize2; + axisExpandWindow = [mathMax$8(0, pos - winSize2 / 2)]; + axisExpandWindow[1] = mathMin$8(extent[1], axisExpandWindow[0] + winSize2); + axisExpandWindow[0] = axisExpandWindow[1] - winSize2; + } - return { - axisExpandWindow: axisExpandWindow, - behavior: behavior - }; - }; + return { + axisExpandWindow: axisExpandWindow, + behavior: behavior + }; + }; - return Parallel; - }(); + return Parallel; + }(); function restrict$1(len, extent) { - return mathMin$8(mathMax$8(len, extent[0]), extent[1]); + return mathMin$8(mathMax$8(len, extent[0]), extent[1]); } function layoutAxisWithoutExpand(axisIndex, layoutInfo) { - var step = layoutInfo.layoutLength / (layoutInfo.axisCount - 1); - return { - position: step * axisIndex, - axisNameAvailableWidth: step, - axisLabelShow: true - }; + var step = layoutInfo.layoutLength / (layoutInfo.axisCount - 1); + return { + position: step * axisIndex, + axisNameAvailableWidth: step, + axisLabelShow: true + }; } function layoutAxisWithExpand(axisIndex, layoutInfo) { - var layoutLength = layoutInfo.layoutLength; - var axisExpandWidth = layoutInfo.axisExpandWidth; - var axisCount = layoutInfo.axisCount; - var axisCollapseWidth = layoutInfo.axisCollapseWidth; - var winInnerIndices = layoutInfo.winInnerIndices; - var position; - var axisNameAvailableWidth = axisCollapseWidth; - var axisLabelShow = false; - var nameTruncateMaxWidth; - - if (axisIndex < winInnerIndices[0]) { - position = axisIndex * axisCollapseWidth; - nameTruncateMaxWidth = axisCollapseWidth; - } else if (axisIndex <= winInnerIndices[1]) { - position = layoutInfo.axisExpandWindow0Pos + axisIndex * axisExpandWidth - layoutInfo.axisExpandWindow[0]; - axisNameAvailableWidth = axisExpandWidth; - axisLabelShow = true; - } else { - position = layoutLength - (axisCount - 1 - axisIndex) * axisCollapseWidth; - nameTruncateMaxWidth = axisCollapseWidth; - } - - return { - position: position, - axisNameAvailableWidth: axisNameAvailableWidth, - axisLabelShow: axisLabelShow, - nameTruncateMaxWidth: nameTruncateMaxWidth - }; + var layoutLength = layoutInfo.layoutLength; + var axisExpandWidth = layoutInfo.axisExpandWidth; + var axisCount = layoutInfo.axisCount; + var axisCollapseWidth = layoutInfo.axisCollapseWidth; + var winInnerIndices = layoutInfo.winInnerIndices; + var position; + var axisNameAvailableWidth = axisCollapseWidth; + var axisLabelShow = false; + var nameTruncateMaxWidth; + + if (axisIndex < winInnerIndices[0]) { + position = axisIndex * axisCollapseWidth; + nameTruncateMaxWidth = axisCollapseWidth; + } else if (axisIndex <= winInnerIndices[1]) { + position = layoutInfo.axisExpandWindow0Pos + axisIndex * axisExpandWidth - layoutInfo.axisExpandWindow[0]; + axisNameAvailableWidth = axisExpandWidth; + axisLabelShow = true; + } else { + position = layoutLength - (axisCount - 1 - axisIndex) * axisCollapseWidth; + nameTruncateMaxWidth = axisCollapseWidth; + } + + return { + position: position, + axisNameAvailableWidth: axisNameAvailableWidth, + axisLabelShow: axisLabelShow, + nameTruncateMaxWidth: nameTruncateMaxWidth + }; } function createParallelCoordSys(ecModel, api) { - var coordSysList = []; - ecModel.eachComponent('parallel', function (parallelModel, idx) { - var coordSys = new Parallel(parallelModel, ecModel, api); - coordSys.name = 'parallel_' + idx; - coordSys.resize(parallelModel, api); - parallelModel.coordinateSystem = coordSys; - coordSys.model = parallelModel; - coordSysList.push(coordSys); - }); // Inject the coordinateSystems into seriesModel + var coordSysList = []; + ecModel.eachComponent('parallel', function (parallelModel, idx) { + var coordSys = new Parallel(parallelModel, ecModel, api); + coordSys.name = 'parallel_' + idx; + coordSys.resize(parallelModel, api); + parallelModel.coordinateSystem = coordSys; + coordSys.model = parallelModel; + coordSysList.push(coordSys); + }); // Inject the coordinateSystems into seriesModel - ecModel.eachSeries(function (seriesModel) { - if (seriesModel.get('coordinateSystem') === 'parallel') { - var parallelModel = seriesModel.getReferringComponents('parallel', SINGLE_REFERRING).models[0]; - seriesModel.coordinateSystem = parallelModel.coordinateSystem; - } - }); - return coordSysList; + ecModel.eachSeries(function (seriesModel) { + if (seriesModel.get('coordinateSystem') === 'parallel') { + var parallelModel = seriesModel.getReferringComponents('parallel', SINGLE_REFERRING).models[0]; + seriesModel.coordinateSystem = parallelModel.coordinateSystem; + } + }); + return coordSysList; } var parallelCoordSysCreator = { - create: createParallelCoordSys + create: createParallelCoordSys }; var ParallelAxisModel = - /** @class */ - function (_super) { - __extends(ParallelAxisModel, _super); + /** @class */ + function (_super) { + __extends(ParallelAxisModel, _super); - function ParallelAxisModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function ParallelAxisModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ParallelAxisModel.type; - /** - * @readOnly - */ + _this.type = ParallelAxisModel.type; + /** + * @readOnly + */ - _this.activeIntervals = []; - return _this; - } + _this.activeIntervals = []; + return _this; + } - ParallelAxisModel.prototype.getAreaSelectStyle = function () { - return makeStyleMapper([['fill', 'color'], ['lineWidth', 'borderWidth'], ['stroke', 'borderColor'], ['width', 'width'], ['opacity', 'opacity'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`. - // So do not transfer decal directly. - ])(this.getModel('areaSelectStyle')); - }; - /** - * The code of this feature is put on AxisModel but not ParallelAxis, - * because axisModel can be alive after echarts updating but instance of - * ParallelAxis having been disposed. this._activeInterval should be kept - * when action dispatched (i.e. legend click). - * - * @param intervals `interval.length === 0` means set all active. - */ + ParallelAxisModel.prototype.getAreaSelectStyle = function () { + return makeStyleMapper([['fill', 'color'], ['lineWidth', 'borderWidth'], ['stroke', 'borderColor'], ['width', 'width'], ['opacity', 'opacity'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`. + // So do not transfer decal directly. + ])(this.getModel('areaSelectStyle')); + }; + /** + * The code of this feature is put on AxisModel but not ParallelAxis, + * because axisModel can be alive after echarts updating but instance of + * ParallelAxis having been disposed. this._activeInterval should be kept + * when action dispatched (i.e. legend click). + * + * @param intervals `interval.length === 0` means set all active. + */ - ParallelAxisModel.prototype.setActiveIntervals = function (intervals) { - var activeIntervals = this.activeIntervals = clone(intervals); // Normalize + ParallelAxisModel.prototype.setActiveIntervals = function (intervals) { + var activeIntervals = this.activeIntervals = clone(intervals); // Normalize - if (activeIntervals) { - for (var i = activeIntervals.length - 1; i >= 0; i--) { - asc(activeIntervals[i]); - } - } - }; - /** - * @param value When only attempting detect whether 'no activeIntervals set', - * `value` is not needed to be input. - */ + if (activeIntervals) { + for (var i = activeIntervals.length - 1; i >= 0; i--) { + asc(activeIntervals[i]); + } + } + }; + /** + * @param value When only attempting detect whether 'no activeIntervals set', + * `value` is not needed to be input. + */ - ParallelAxisModel.prototype.getActiveState = function (value) { - var activeIntervals = this.activeIntervals; + ParallelAxisModel.prototype.getActiveState = function (value) { + var activeIntervals = this.activeIntervals; - if (!activeIntervals.length) { - return 'normal'; - } + if (!activeIntervals.length) { + return 'normal'; + } - if (value == null || isNaN(+value)) { - return 'inactive'; - } // Simple optimization + if (value == null || isNaN(+value)) { + return 'inactive'; + } // Simple optimization - if (activeIntervals.length === 1) { - var interval = activeIntervals[0]; + if (activeIntervals.length === 1) { + var interval = activeIntervals[0]; - if (interval[0] <= value && value <= interval[1]) { - return 'active'; - } - } else { - for (var i = 0, len = activeIntervals.length; i < len; i++) { - if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) { - return 'active'; - } - } - } + if (interval[0] <= value && value <= interval[1]) { + return 'active'; + } + } else { + for (var i = 0, len = activeIntervals.length; i < len; i++) { + if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) { + return 'active'; + } + } + } - return 'inactive'; - }; + return 'inactive'; + }; - return ParallelAxisModel; - }(ComponentModel); + return ParallelAxisModel; + }(ComponentModel); mixin(ParallelAxisModel, AxisModelCommonMixin); @@ -64166,30 +64166,30 @@ var MIN_RESIZE_LINE_WIDTH = 6; var MUTEX_RESOURCE_KEY = 'globalPan'; var DIRECTION_MAP = { - w: [0, 0], - e: [0, 1], - n: [1, 0], - s: [1, 1] + w: [0, 0], + e: [0, 1], + n: [1, 0], + s: [1, 1] }; var CURSOR_MAP = { - w: 'ew', - e: 'ew', - n: 'ns', - s: 'ns', - ne: 'nesw', - sw: 'nesw', - nw: 'nwse', - se: 'nwse' + w: 'ew', + e: 'ew', + n: 'ns', + s: 'ns', + ne: 'nesw', + sw: 'nesw', + nw: 'nwse', + se: 'nwse' }; var DEFAULT_BRUSH_OPT = { - brushStyle: { - lineWidth: 2, - stroke: 'rgba(210,219,238,0.3)', - fill: '#D2DBEE' - }, - transformable: true, - brushMode: 'single', - removeOnClick: false + brushStyle: { + lineWidth: 2, + stroke: 'rgba(210,219,238,0.3)', + fill: '#D2DBEE' + }, + transformable: true, + brushMode: 'single', + removeOnClick: false }; var baseUID = 0; /** @@ -64203,645 +64203,645 @@ */ var BrushController = - /** @class */ - function (_super) { - __extends(BrushController, _super); + /** @class */ + function (_super) { + __extends(BrushController, _super); - function BrushController(zr) { - var _this = _super.call(this) || this; - /** - * @internal - */ - - - _this._track = []; - /** - * @internal - */ - - _this._covers = []; - _this._handlers = {}; + function BrushController(zr) { + var _this = _super.call(this) || this; + /** + * @internal + */ - if ("development" !== 'production') { - assert(zr); - } - _this._zr = zr; - _this.group = new Group(); - _this._uid = 'brushController_' + baseUID++; - each(pointerHandlers, function (handler, eventName) { - this._handlers[eventName] = bind(handler, this); - }, _this); - return _this; - } - /** - * If set to `false`, select disabled. - */ + _this._track = []; + /** + * @internal + */ + _this._covers = []; + _this._handlers = {}; - BrushController.prototype.enableBrush = function (brushOption) { - if ("development" !== 'production') { - assert(this._mounted); - } + if ("development" !== 'production') { + assert(zr); + } + + _this._zr = zr; + _this.group = new Group(); + _this._uid = 'brushController_' + baseUID++; + each(pointerHandlers, function (handler, eventName) { + this._handlers[eventName] = bind(handler, this); + }, _this); + return _this; + } + /** + * If set to `false`, select disabled. + */ - this._brushType && this._doDisableBrush(); - brushOption.brushType && this._doEnableBrush(brushOption); - return this; - }; - BrushController.prototype._doEnableBrush = function (brushOption) { - var zr = this._zr; // Consider roam, which takes globalPan too. + BrushController.prototype.enableBrush = function (brushOption) { + if ("development" !== 'production') { + assert(this._mounted); + } - if (!this._enableGlobalPan) { - take(zr, MUTEX_RESOURCE_KEY, this._uid); - } + this._brushType && this._doDisableBrush(); + brushOption.brushType && this._doEnableBrush(brushOption); + return this; + }; - each(this._handlers, function (handler, eventName) { - zr.on(eventName, handler); - }); - this._brushType = brushOption.brushType; - this._brushOption = merge(clone(DEFAULT_BRUSH_OPT), brushOption, true); - }; + BrushController.prototype._doEnableBrush = function (brushOption) { + var zr = this._zr; // Consider roam, which takes globalPan too. - BrushController.prototype._doDisableBrush = function () { - var zr = this._zr; - release(zr, MUTEX_RESOURCE_KEY, this._uid); - each(this._handlers, function (handler, eventName) { - zr.off(eventName, handler); - }); - this._brushType = this._brushOption = null; - }; - /** - * @param panelOpts If not pass, it is global brush. - */ + if (!this._enableGlobalPan) { + take(zr, MUTEX_RESOURCE_KEY, this._uid); + } + each(this._handlers, function (handler, eventName) { + zr.on(eventName, handler); + }); + this._brushType = brushOption.brushType; + this._brushOption = merge(clone(DEFAULT_BRUSH_OPT), brushOption, true); + }; + + BrushController.prototype._doDisableBrush = function () { + var zr = this._zr; + release(zr, MUTEX_RESOURCE_KEY, this._uid); + each(this._handlers, function (handler, eventName) { + zr.off(eventName, handler); + }); + this._brushType = this._brushOption = null; + }; + /** + * @param panelOpts If not pass, it is global brush. + */ - BrushController.prototype.setPanels = function (panelOpts) { - if (panelOpts && panelOpts.length) { - var panels_1 = this._panels = {}; - each(panelOpts, function (panelOpts) { - panels_1[panelOpts.panelId] = clone(panelOpts); - }); - } else { - this._panels = null; - } - return this; - }; + BrushController.prototype.setPanels = function (panelOpts) { + if (panelOpts && panelOpts.length) { + var panels_1 = this._panels = {}; + each(panelOpts, function (panelOpts) { + panels_1[panelOpts.panelId] = clone(panelOpts); + }); + } else { + this._panels = null; + } - BrushController.prototype.mount = function (opt) { - opt = opt || {}; + return this; + }; - if ("development" !== 'production') { - this._mounted = true; // should be at first. - } + BrushController.prototype.mount = function (opt) { + opt = opt || {}; - this._enableGlobalPan = opt.enableGlobalPan; - var thisGroup = this.group; + if ("development" !== 'production') { + this._mounted = true; // should be at first. + } - this._zr.add(thisGroup); + this._enableGlobalPan = opt.enableGlobalPan; + var thisGroup = this.group; - thisGroup.attr({ - x: opt.x || 0, - y: opt.y || 0, - rotation: opt.rotation || 0, - scaleX: opt.scaleX || 1, - scaleY: opt.scaleY || 1 - }); - this._transform = thisGroup.getLocalTransform(); - return this; - }; // eachCover(cb, context): void { - // each(this._covers, cb, context); - // } + this._zr.add(thisGroup); - /** - * Update covers. - * @param coverConfigList - * If coverConfigList is null/undefined, all covers removed. - */ + thisGroup.attr({ + x: opt.x || 0, + y: opt.y || 0, + rotation: opt.rotation || 0, + scaleX: opt.scaleX || 1, + scaleY: opt.scaleY || 1 + }); + this._transform = thisGroup.getLocalTransform(); + return this; + }; // eachCover(cb, context): void { + // each(this._covers, cb, context); + // } + + /** + * Update covers. + * @param coverConfigList + * If coverConfigList is null/undefined, all covers removed. + */ - BrushController.prototype.updateCovers = function (coverConfigList) { - if ("development" !== 'production') { - assert(this._mounted); - } + BrushController.prototype.updateCovers = function (coverConfigList) { + if ("development" !== 'production') { + assert(this._mounted); + } - coverConfigList = map(coverConfigList, function (coverConfig) { - return merge(clone(DEFAULT_BRUSH_OPT), coverConfig, true); - }); - var tmpIdPrefix = '\0-brush-index-'; - var oldCovers = this._covers; - var newCovers = this._covers = []; - var controller = this; - var creatingCover = this._creatingCover; - new DataDiffer(oldCovers, coverConfigList, oldGetKey, getKey).add(addOrUpdate).update(addOrUpdate).remove(remove).execute(); - return this; + coverConfigList = map(coverConfigList, function (coverConfig) { + return merge(clone(DEFAULT_BRUSH_OPT), coverConfig, true); + }); + var tmpIdPrefix = '\0-brush-index-'; + var oldCovers = this._covers; + var newCovers = this._covers = []; + var controller = this; + var creatingCover = this._creatingCover; + new DataDiffer(oldCovers, coverConfigList, oldGetKey, getKey).add(addOrUpdate).update(addOrUpdate).remove(remove).execute(); + return this; - function getKey(brushOption, index) { - return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index) + '-' + brushOption.brushType; - } + function getKey(brushOption, index) { + return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index) + '-' + brushOption.brushType; + } - function oldGetKey(cover, index) { - return getKey(cover.__brushOption, index); - } + function oldGetKey(cover, index) { + return getKey(cover.__brushOption, index); + } - function addOrUpdate(newIndex, oldIndex) { - var newBrushInternal = coverConfigList[newIndex]; // Consider setOption in event listener of brushSelect, - // where updating cover when creating should be forbiden. + function addOrUpdate(newIndex, oldIndex) { + var newBrushInternal = coverConfigList[newIndex]; // Consider setOption in event listener of brushSelect, + // where updating cover when creating should be forbiden. - if (oldIndex != null && oldCovers[oldIndex] === creatingCover) { - newCovers[newIndex] = oldCovers[oldIndex]; - } else { - var cover = newCovers[newIndex] = oldIndex != null ? (oldCovers[oldIndex].__brushOption = newBrushInternal, oldCovers[oldIndex]) : endCreating(controller, createCover(controller, newBrushInternal)); - updateCoverAfterCreation(controller, cover); - } - } + if (oldIndex != null && oldCovers[oldIndex] === creatingCover) { + newCovers[newIndex] = oldCovers[oldIndex]; + } else { + var cover = newCovers[newIndex] = oldIndex != null ? (oldCovers[oldIndex].__brushOption = newBrushInternal, oldCovers[oldIndex]) : endCreating(controller, createCover(controller, newBrushInternal)); + updateCoverAfterCreation(controller, cover); + } + } - function remove(oldIndex) { - if (oldCovers[oldIndex] !== creatingCover) { - controller.group.remove(oldCovers[oldIndex]); - } - } - }; + function remove(oldIndex) { + if (oldCovers[oldIndex] !== creatingCover) { + controller.group.remove(oldCovers[oldIndex]); + } + } + }; - BrushController.prototype.unmount = function () { - if ("development" !== 'production') { - if (!this._mounted) { - return; - } - } + BrushController.prototype.unmount = function () { + if ("development" !== 'production') { + if (!this._mounted) { + return; + } + } - this.enableBrush(false); // container may 'removeAll' outside. + this.enableBrush(false); // container may 'removeAll' outside. - clearCovers(this); + clearCovers(this); - this._zr.remove(this.group); + this._zr.remove(this.group); - if ("development" !== 'production') { - this._mounted = false; // should be at last. - } + if ("development" !== 'production') { + this._mounted = false; // should be at last. + } - return this; - }; + return this; + }; - BrushController.prototype.dispose = function () { - this.unmount(); - this.off(); - }; + BrushController.prototype.dispose = function () { + this.unmount(); + this.off(); + }; - return BrushController; - }(Eventful); + return BrushController; + }(Eventful); function createCover(controller, brushOption) { - var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption); - cover.__brushOption = brushOption; - updateZ(cover, brushOption); - controller.group.add(cover); - return cover; + var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption); + cover.__brushOption = brushOption; + updateZ(cover, brushOption); + controller.group.add(cover); + return cover; } function endCreating(controller, creatingCover) { - var coverRenderer = getCoverRenderer(creatingCover); + var coverRenderer = getCoverRenderer(creatingCover); - if (coverRenderer.endCreating) { - coverRenderer.endCreating(controller, creatingCover); - updateZ(creatingCover, creatingCover.__brushOption); - } + if (coverRenderer.endCreating) { + coverRenderer.endCreating(controller, creatingCover); + updateZ(creatingCover, creatingCover.__brushOption); + } - return creatingCover; + return creatingCover; } function updateCoverShape(controller, cover) { - var brushOption = cover.__brushOption; - getCoverRenderer(cover).updateCoverShape(controller, cover, brushOption.range, brushOption); + var brushOption = cover.__brushOption; + getCoverRenderer(cover).updateCoverShape(controller, cover, brushOption.range, brushOption); } function updateZ(cover, brushOption) { - var z = brushOption.z; - z == null && (z = COVER_Z); - cover.traverse(function (el) { - el.z = z; - el.z2 = z; // Consider in given container. - }); + var z = brushOption.z; + z == null && (z = COVER_Z); + cover.traverse(function (el) { + el.z = z; + el.z2 = z; // Consider in given container. + }); } function updateCoverAfterCreation(controller, cover) { - getCoverRenderer(cover).updateCommon(controller, cover); - updateCoverShape(controller, cover); + getCoverRenderer(cover).updateCommon(controller, cover); + updateCoverShape(controller, cover); } function getCoverRenderer(cover) { - return coverRenderers[cover.__brushOption.brushType]; + return coverRenderers[cover.__brushOption.brushType]; } // return target panel or `true` (means global panel) function getPanelByPoint(controller, e, localCursorPoint) { - var panels = controller._panels; - - if (!panels) { - return BRUSH_PANEL_GLOBAL; // Global panel - } - - var panel; - var transform = controller._transform; - each(panels, function (pn) { - pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn); - }); - return panel; + var panels = controller._panels; + + if (!panels) { + return BRUSH_PANEL_GLOBAL; // Global panel + } + + var panel; + var transform = controller._transform; + each(panels, function (pn) { + pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn); + }); + return panel; } // Return a panel or true function getPanelByCover(controller, cover) { - var panels = controller._panels; + var panels = controller._panels; - if (!panels) { - return BRUSH_PANEL_GLOBAL; // Global panel - } + if (!panels) { + return BRUSH_PANEL_GLOBAL; // Global panel + } - var panelId = cover.__brushOption.panelId; // User may give cover without coord sys info, - // which is then treated as global panel. + var panelId = cover.__brushOption.panelId; // User may give cover without coord sys info, + // which is then treated as global panel. - return panelId != null ? panels[panelId] : BRUSH_PANEL_GLOBAL; + return panelId != null ? panels[panelId] : BRUSH_PANEL_GLOBAL; } function clearCovers(controller) { - var covers = controller._covers; - var originalLength = covers.length; - each(covers, function (cover) { - controller.group.remove(cover); - }, controller); - covers.length = 0; - return !!originalLength; + var covers = controller._covers; + var originalLength = covers.length; + each(covers, function (cover) { + controller.group.remove(cover); + }, controller); + covers.length = 0; + return !!originalLength; } function trigger$1(controller, opt) { - var areas = map(controller._covers, function (cover) { - var brushOption = cover.__brushOption; - var range = clone(brushOption.range); - return { - brushType: brushOption.brushType, - panelId: brushOption.panelId, - range: range - }; - }); - controller.trigger('brush', { - areas: areas, - isEnd: !!opt.isEnd, - removeOnClick: !!opt.removeOnClick - }); + var areas = map(controller._covers, function (cover) { + var brushOption = cover.__brushOption; + var range = clone(brushOption.range); + return { + brushType: brushOption.brushType, + panelId: brushOption.panelId, + range: range + }; + }); + controller.trigger('brush', { + areas: areas, + isEnd: !!opt.isEnd, + removeOnClick: !!opt.removeOnClick + }); } function shouldShowCover(controller) { - var track = controller._track; + var track = controller._track; - if (!track.length) { - return false; - } + if (!track.length) { + return false; + } - var p2 = track[track.length - 1]; - var p1 = track[0]; - var dx = p2[0] - p1[0]; - var dy = p2[1] - p1[1]; - var dist = mathPow$2(dx * dx + dy * dy, 0.5); - return dist > UNSELECT_THRESHOLD; + var p2 = track[track.length - 1]; + var p1 = track[0]; + var dx = p2[0] - p1[0]; + var dy = p2[1] - p1[1]; + var dist = mathPow$2(dx * dx + dy * dy, 0.5); + return dist > UNSELECT_THRESHOLD; } function getTrackEnds(track) { - var tail = track.length - 1; - tail < 0 && (tail = 0); - return [track[0], track[tail]]; + var tail = track.length - 1; + tail < 0 && (tail = 0); + return [track[0], track[tail]]; } function createBaseRectCover(rectRangeConverter, controller, brushOption, edgeNameSequences) { - var cover = new Group(); + var cover = new Group(); + cover.add(new Rect({ + name: 'main', + style: makeStyle(brushOption), + silent: true, + draggable: true, + cursor: 'move', + drift: curry(driftRect, rectRangeConverter, controller, cover, ['n', 's', 'w', 'e']), + ondragend: curry(trigger$1, controller, { + isEnd: true + }) + })); + each(edgeNameSequences, function (nameSequence) { cover.add(new Rect({ - name: 'main', - style: makeStyle(brushOption), - silent: true, - draggable: true, - cursor: 'move', - drift: curry(driftRect, rectRangeConverter, controller, cover, ['n', 's', 'w', 'e']), - ondragend: curry(trigger$1, controller, { - isEnd: true - }) + name: nameSequence.join(''), + style: { + opacity: 0 + }, + draggable: true, + silent: true, + invisible: true, + drift: curry(driftRect, rectRangeConverter, controller, cover, nameSequence), + ondragend: curry(trigger$1, controller, { + isEnd: true + }) })); - each(edgeNameSequences, function (nameSequence) { - cover.add(new Rect({ - name: nameSequence.join(''), - style: { - opacity: 0 - }, - draggable: true, - silent: true, - invisible: true, - drift: curry(driftRect, rectRangeConverter, controller, cover, nameSequence), - ondragend: curry(trigger$1, controller, { - isEnd: true - }) - })); - }); - return cover; + }); + return cover; } function updateBaseRect(controller, cover, localRange, brushOption) { - var lineWidth = brushOption.brushStyle.lineWidth || 0; - var handleSize = mathMax$9(lineWidth, MIN_RESIZE_LINE_WIDTH); - var x = localRange[0][0]; - var y = localRange[1][0]; - var xa = x - lineWidth / 2; - var ya = y - lineWidth / 2; - var x2 = localRange[0][1]; - var y2 = localRange[1][1]; - var x2a = x2 - handleSize + lineWidth / 2; - var y2a = y2 - handleSize + lineWidth / 2; - var width = x2 - x; - var height = y2 - y; - var widtha = width + lineWidth; - var heighta = height + lineWidth; - updateRectShape(controller, cover, 'main', x, y, width, height); - - if (brushOption.transformable) { - updateRectShape(controller, cover, 'w', xa, ya, handleSize, heighta); - updateRectShape(controller, cover, 'e', x2a, ya, handleSize, heighta); - updateRectShape(controller, cover, 'n', xa, ya, widtha, handleSize); - updateRectShape(controller, cover, 's', xa, y2a, widtha, handleSize); - updateRectShape(controller, cover, 'nw', xa, ya, handleSize, handleSize); - updateRectShape(controller, cover, 'ne', x2a, ya, handleSize, handleSize); - updateRectShape(controller, cover, 'sw', xa, y2a, handleSize, handleSize); - updateRectShape(controller, cover, 'se', x2a, y2a, handleSize, handleSize); - } + var lineWidth = brushOption.brushStyle.lineWidth || 0; + var handleSize = mathMax$9(lineWidth, MIN_RESIZE_LINE_WIDTH); + var x = localRange[0][0]; + var y = localRange[1][0]; + var xa = x - lineWidth / 2; + var ya = y - lineWidth / 2; + var x2 = localRange[0][1]; + var y2 = localRange[1][1]; + var x2a = x2 - handleSize + lineWidth / 2; + var y2a = y2 - handleSize + lineWidth / 2; + var width = x2 - x; + var height = y2 - y; + var widtha = width + lineWidth; + var heighta = height + lineWidth; + updateRectShape(controller, cover, 'main', x, y, width, height); + + if (brushOption.transformable) { + updateRectShape(controller, cover, 'w', xa, ya, handleSize, heighta); + updateRectShape(controller, cover, 'e', x2a, ya, handleSize, heighta); + updateRectShape(controller, cover, 'n', xa, ya, widtha, handleSize); + updateRectShape(controller, cover, 's', xa, y2a, widtha, handleSize); + updateRectShape(controller, cover, 'nw', xa, ya, handleSize, handleSize); + updateRectShape(controller, cover, 'ne', x2a, ya, handleSize, handleSize); + updateRectShape(controller, cover, 'sw', xa, y2a, handleSize, handleSize); + updateRectShape(controller, cover, 'se', x2a, y2a, handleSize, handleSize); + } } function updateCommon(controller, cover) { - var brushOption = cover.__brushOption; - var transformable = brushOption.transformable; - var mainEl = cover.childAt(0); - mainEl.useStyle(makeStyle(brushOption)); - mainEl.attr({ - silent: !transformable, - cursor: transformable ? 'move' : 'default' - }); - each([['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']], function (nameSequence) { - var el = cover.childOfName(nameSequence.join('')); - var globalDir = nameSequence.length === 1 ? getGlobalDirection1(controller, nameSequence[0]) : getGlobalDirection2(controller, nameSequence); - el && el.attr({ - silent: !transformable, - invisible: !transformable, - cursor: transformable ? CURSOR_MAP[globalDir] + '-resize' : null - }); + var brushOption = cover.__brushOption; + var transformable = brushOption.transformable; + var mainEl = cover.childAt(0); + mainEl.useStyle(makeStyle(brushOption)); + mainEl.attr({ + silent: !transformable, + cursor: transformable ? 'move' : 'default' + }); + each([['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']], function (nameSequence) { + var el = cover.childOfName(nameSequence.join('')); + var globalDir = nameSequence.length === 1 ? getGlobalDirection1(controller, nameSequence[0]) : getGlobalDirection2(controller, nameSequence); + el && el.attr({ + silent: !transformable, + invisible: !transformable, + cursor: transformable ? CURSOR_MAP[globalDir] + '-resize' : null }); + }); } function updateRectShape(controller, cover, name, x, y, w, h) { - var el = cover.childOfName(name); - el && el.setShape(pointsToRect(clipByPanel(controller, cover, [[x, y], [x + w, y + h]]))); + var el = cover.childOfName(name); + el && el.setShape(pointsToRect(clipByPanel(controller, cover, [[x, y], [x + w, y + h]]))); } function makeStyle(brushOption) { - return defaults({ - strokeNoScale: true - }, brushOption.brushStyle); + return defaults({ + strokeNoScale: true + }, brushOption.brushStyle); } function formatRectRange(x, y, x2, y2) { - var min = [mathMin$9(x, x2), mathMin$9(y, y2)]; - var max = [mathMax$9(x, x2), mathMax$9(y, y2)]; - return [[min[0], max[0]], [min[1], max[1]] // y range - ]; + var min = [mathMin$9(x, x2), mathMin$9(y, y2)]; + var max = [mathMax$9(x, x2), mathMax$9(y, y2)]; + return [[min[0], max[0]], [min[1], max[1]] // y range + ]; } function getTransform$1(controller) { - return getTransform(controller.group); + return getTransform(controller.group); } function getGlobalDirection1(controller, localDirName) { - var map = { - w: 'left', - e: 'right', - n: 'top', - s: 'bottom' - }; - var inverseMap = { - left: 'w', - right: 'e', - top: 'n', - bottom: 's' - }; - var dir = transformDirection(map[localDirName], getTransform$1(controller)); - return inverseMap[dir]; + var map = { + w: 'left', + e: 'right', + n: 'top', + s: 'bottom' + }; + var inverseMap = { + left: 'w', + right: 'e', + top: 'n', + bottom: 's' + }; + var dir = transformDirection(map[localDirName], getTransform$1(controller)); + return inverseMap[dir]; } function getGlobalDirection2(controller, localDirNameSeq) { - var globalDir = [getGlobalDirection1(controller, localDirNameSeq[0]), getGlobalDirection1(controller, localDirNameSeq[1])]; - (globalDir[0] === 'e' || globalDir[0] === 'w') && globalDir.reverse(); - return globalDir.join(''); + var globalDir = [getGlobalDirection1(controller, localDirNameSeq[0]), getGlobalDirection1(controller, localDirNameSeq[1])]; + (globalDir[0] === 'e' || globalDir[0] === 'w') && globalDir.reverse(); + return globalDir.join(''); } function driftRect(rectRangeConverter, controller, cover, dirNameSequence, dx, dy) { - var brushOption = cover.__brushOption; - var rectRange = rectRangeConverter.toRectRange(brushOption.range); - var localDelta = toLocalDelta(controller, dx, dy); - each(dirNameSequence, function (dirName) { - var ind = DIRECTION_MAP[dirName]; - rectRange[ind[0]][ind[1]] += localDelta[ind[0]]; - }); - brushOption.range = rectRangeConverter.fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1])); - updateCoverAfterCreation(controller, cover); - trigger$1(controller, { - isEnd: false - }); + var brushOption = cover.__brushOption; + var rectRange = rectRangeConverter.toRectRange(brushOption.range); + var localDelta = toLocalDelta(controller, dx, dy); + each(dirNameSequence, function (dirName) { + var ind = DIRECTION_MAP[dirName]; + rectRange[ind[0]][ind[1]] += localDelta[ind[0]]; + }); + brushOption.range = rectRangeConverter.fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1])); + updateCoverAfterCreation(controller, cover); + trigger$1(controller, { + isEnd: false + }); } function driftPolygon(controller, cover, dx, dy) { - var range = cover.__brushOption.range; - var localDelta = toLocalDelta(controller, dx, dy); - each(range, function (point) { - point[0] += localDelta[0]; - point[1] += localDelta[1]; - }); - updateCoverAfterCreation(controller, cover); - trigger$1(controller, { - isEnd: false - }); + var range = cover.__brushOption.range; + var localDelta = toLocalDelta(controller, dx, dy); + each(range, function (point) { + point[0] += localDelta[0]; + point[1] += localDelta[1]; + }); + updateCoverAfterCreation(controller, cover); + trigger$1(controller, { + isEnd: false + }); } function toLocalDelta(controller, dx, dy) { - var thisGroup = controller.group; - var localD = thisGroup.transformCoordToLocal(dx, dy); - var localZero = thisGroup.transformCoordToLocal(0, 0); - return [localD[0] - localZero[0], localD[1] - localZero[1]]; + var thisGroup = controller.group; + var localD = thisGroup.transformCoordToLocal(dx, dy); + var localZero = thisGroup.transformCoordToLocal(0, 0); + return [localD[0] - localZero[0], localD[1] - localZero[1]]; } function clipByPanel(controller, cover, data) { - var panel = getPanelByCover(controller, cover); - return panel && panel !== BRUSH_PANEL_GLOBAL ? panel.clipPath(data, controller._transform) : clone(data); + var panel = getPanelByCover(controller, cover); + return panel && panel !== BRUSH_PANEL_GLOBAL ? panel.clipPath(data, controller._transform) : clone(data); } function pointsToRect(points) { - var xmin = mathMin$9(points[0][0], points[1][0]); - var ymin = mathMin$9(points[0][1], points[1][1]); - var xmax = mathMax$9(points[0][0], points[1][0]); - var ymax = mathMax$9(points[0][1], points[1][1]); - return { - x: xmin, - y: ymin, - width: xmax - xmin, - height: ymax - ymin - }; + var xmin = mathMin$9(points[0][0], points[1][0]); + var ymin = mathMin$9(points[0][1], points[1][1]); + var xmax = mathMax$9(points[0][0], points[1][0]); + var ymax = mathMax$9(points[0][1], points[1][1]); + return { + x: xmin, + y: ymin, + width: xmax - xmin, + height: ymax - ymin + }; } function resetCursor(controller, e, localCursorPoint) { - if ( // Check active - !controller._brushType // resetCursor should be always called when mouse is in zr area, - // but not called when mouse is out of zr area to avoid bad influence - // if `mousemove`, `mouseup` are triggered from `document` event. - || isOutsideZrArea(controller, e.offsetX, e.offsetY)) { - return; - } + if ( // Check active + !controller._brushType // resetCursor should be always called when mouse is in zr area, + // but not called when mouse is out of zr area to avoid bad influence + // if `mousemove`, `mouseup` are triggered from `document` event. + || isOutsideZrArea(controller, e.offsetX, e.offsetY)) { + return; + } - var zr = controller._zr; - var covers = controller._covers; - var currPanel = getPanelByPoint(controller, e, localCursorPoint); // Check whether in covers. + var zr = controller._zr; + var covers = controller._covers; + var currPanel = getPanelByPoint(controller, e, localCursorPoint); // Check whether in covers. - if (!controller._dragging) { - for (var i = 0; i < covers.length; i++) { - var brushOption = covers[i].__brushOption; + if (!controller._dragging) { + for (var i = 0; i < covers.length; i++) { + var brushOption = covers[i].__brushOption; - if (currPanel && (currPanel === BRUSH_PANEL_GLOBAL || brushOption.panelId === currPanel.panelId) && coverRenderers[brushOption.brushType].contain(covers[i], localCursorPoint[0], localCursorPoint[1])) { - // Use cursor style set on cover. - return; - } - } + if (currPanel && (currPanel === BRUSH_PANEL_GLOBAL || brushOption.panelId === currPanel.panelId) && coverRenderers[brushOption.brushType].contain(covers[i], localCursorPoint[0], localCursorPoint[1])) { + // Use cursor style set on cover. + return; + } } + } - currPanel && zr.setCursorStyle('crosshair'); + currPanel && zr.setCursorStyle('crosshair'); } function preventDefault(e) { - var rawE = e.event; - rawE.preventDefault && rawE.preventDefault(); + var rawE = e.event; + rawE.preventDefault && rawE.preventDefault(); } function mainShapeContain(cover, x, y) { - return cover.childOfName('main').contain(x, y); + return cover.childOfName('main').contain(x, y); } function updateCoverByMouse(controller, e, localCursorPoint, isEnd) { - var creatingCover = controller._creatingCover; - var panel = controller._creatingPanel; - var thisBrushOption = controller._brushOption; - var eventParams; + var creatingCover = controller._creatingCover; + var panel = controller._creatingPanel; + var thisBrushOption = controller._brushOption; + var eventParams; - controller._track.push(localCursorPoint.slice()); + controller._track.push(localCursorPoint.slice()); - if (shouldShowCover(controller) || creatingCover) { - if (panel && !creatingCover) { - thisBrushOption.brushMode === 'single' && clearCovers(controller); - var brushOption = clone(thisBrushOption); - brushOption.brushType = determineBrushType(brushOption.brushType, panel); - brushOption.panelId = panel === BRUSH_PANEL_GLOBAL ? null : panel.panelId; - creatingCover = controller._creatingCover = createCover(controller, brushOption); + if (shouldShowCover(controller) || creatingCover) { + if (panel && !creatingCover) { + thisBrushOption.brushMode === 'single' && clearCovers(controller); + var brushOption = clone(thisBrushOption); + brushOption.brushType = determineBrushType(brushOption.brushType, panel); + brushOption.panelId = panel === BRUSH_PANEL_GLOBAL ? null : panel.panelId; + creatingCover = controller._creatingCover = createCover(controller, brushOption); - controller._covers.push(creatingCover); - } + controller._covers.push(creatingCover); + } - if (creatingCover) { - var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)]; - var coverBrushOption = creatingCover.__brushOption; - coverBrushOption.range = coverRenderer.getCreatingRange(clipByPanel(controller, creatingCover, controller._track)); + if (creatingCover) { + var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)]; + var coverBrushOption = creatingCover.__brushOption; + coverBrushOption.range = coverRenderer.getCreatingRange(clipByPanel(controller, creatingCover, controller._track)); - if (isEnd) { - endCreating(controller, creatingCover); - coverRenderer.updateCommon(controller, creatingCover); - } + if (isEnd) { + endCreating(controller, creatingCover); + coverRenderer.updateCommon(controller, creatingCover); + } - updateCoverShape(controller, creatingCover); - eventParams = { - isEnd: isEnd - }; - } - } else if (isEnd && thisBrushOption.brushMode === 'single' && thisBrushOption.removeOnClick) { - // Help user to remove covers easily, only by a tiny drag, in 'single' mode. - // But a single click do not clear covers, because user may have casual - // clicks (for example, click on other component and do not expect covers - // disappear). - // Only some cover removed, trigger action, but not every click trigger action. - if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) { - eventParams = { - isEnd: isEnd, - removeOnClick: true - }; - } + updateCoverShape(controller, creatingCover); + eventParams = { + isEnd: isEnd + }; } + } else if (isEnd && thisBrushOption.brushMode === 'single' && thisBrushOption.removeOnClick) { + // Help user to remove covers easily, only by a tiny drag, in 'single' mode. + // But a single click do not clear covers, because user may have casual + // clicks (for example, click on other component and do not expect covers + // disappear). + // Only some cover removed, trigger action, but not every click trigger action. + if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) { + eventParams = { + isEnd: isEnd, + removeOnClick: true + }; + } + } - return eventParams; + return eventParams; } function determineBrushType(brushType, panel) { - if (brushType === 'auto') { - if ("development" !== 'production') { - assert(panel && panel.defaultBrushType, 'MUST have defaultBrushType when brushType is "atuo"'); - } - - return panel.defaultBrushType; + if (brushType === 'auto') { + if ("development" !== 'production') { + assert(panel && panel.defaultBrushType, 'MUST have defaultBrushType when brushType is "atuo"'); } - return brushType; + return panel.defaultBrushType; + } + + return brushType; } var pointerHandlers = { - mousedown: function (e) { - if (this._dragging) { - // In case some browser do not support globalOut, - // and release mouse out side the browser. - handleDragEnd(this, e); - } else if (!e.target || !e.target.draggable) { - preventDefault(e); - var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY); - this._creatingCover = null; - var panel = this._creatingPanel = getPanelByPoint(this, e, localCursorPoint); - - if (panel) { - this._dragging = true; - this._track = [localCursorPoint.slice()]; - } - } - }, - mousemove: function (e) { - var x = e.offsetX; - var y = e.offsetY; - var localCursorPoint = this.group.transformCoordToLocal(x, y); - resetCursor(this, e, localCursorPoint); - - if (this._dragging) { - preventDefault(e); - var eventParams = updateCoverByMouse(this, e, localCursorPoint, false); - eventParams && trigger$1(this, eventParams); - } - }, - mouseup: function (e) { - handleDragEnd(this, e); - } + mousedown: function (e) { + if (this._dragging) { + // In case some browser do not support globalOut, + // and release mouse out side the browser. + handleDragEnd(this, e); + } else if (!e.target || !e.target.draggable) { + preventDefault(e); + var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY); + this._creatingCover = null; + var panel = this._creatingPanel = getPanelByPoint(this, e, localCursorPoint); + + if (panel) { + this._dragging = true; + this._track = [localCursorPoint.slice()]; + } + } + }, + mousemove: function (e) { + var x = e.offsetX; + var y = e.offsetY; + var localCursorPoint = this.group.transformCoordToLocal(x, y); + resetCursor(this, e, localCursorPoint); + + if (this._dragging) { + preventDefault(e); + var eventParams = updateCoverByMouse(this, e, localCursorPoint, false); + eventParams && trigger$1(this, eventParams); + } + }, + mouseup: function (e) { + handleDragEnd(this, e); + } }; function handleDragEnd(controller, e) { - if (controller._dragging) { - preventDefault(e); - var x = e.offsetX; - var y = e.offsetY; - var localCursorPoint = controller.group.transformCoordToLocal(x, y); - var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true); - controller._dragging = false; - controller._track = []; - controller._creatingCover = null; // trigger event shoule be at final, after procedure will be nested. + if (controller._dragging) { + preventDefault(e); + var x = e.offsetX; + var y = e.offsetY; + var localCursorPoint = controller.group.transformCoordToLocal(x, y); + var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true); + controller._dragging = false; + controller._track = []; + controller._creatingCover = null; // trigger event shoule be at final, after procedure will be nested. - eventParams && trigger$1(controller, eventParams); - } + eventParams && trigger$1(controller, eventParams); + } } function isOutsideZrArea(controller, x, y) { - var zr = controller._zr; - return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight(); + var zr = controller._zr; + return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight(); } /** * key: brushType @@ -64849,278 +64849,278 @@ var coverRenderers = { - lineX: getLineRenderer(0), - lineY: getLineRenderer(1), - rect: { - createCover: function (controller, brushOption) { - function returnInput(range) { - return range; - } - - return createBaseRectCover({ - toRectRange: returnInput, - fromRectRange: returnInput - }, controller, brushOption, [['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']]); - }, - getCreatingRange: function (localTrack) { - var ends = getTrackEnds(localTrack); - return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]); - }, - updateCoverShape: function (controller, cover, localRange, brushOption) { - updateBaseRect(controller, cover, localRange, brushOption); - }, - updateCommon: updateCommon, - contain: mainShapeContain + lineX: getLineRenderer(0), + lineY: getLineRenderer(1), + rect: { + createCover: function (controller, brushOption) { + function returnInput(range) { + return range; + } + + return createBaseRectCover({ + toRectRange: returnInput, + fromRectRange: returnInput + }, controller, brushOption, [['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']]); }, - polygon: { - createCover: function (controller, brushOption) { - var cover = new Group(); // Do not use graphic.Polygon because graphic.Polyline do not close the - // border of the shape when drawing, which is a better experience for user. - - cover.add(new Polyline({ - name: 'main', - style: makeStyle(brushOption), - silent: true - })); - return cover; - }, - getCreatingRange: function (localTrack) { - return localTrack; - }, - endCreating: function (controller, cover) { - cover.remove(cover.childAt(0)); // Use graphic.Polygon close the shape. - - cover.add(new Polygon({ - name: 'main', - draggable: true, - drift: curry(driftPolygon, controller, cover), - ondragend: curry(trigger$1, controller, { - isEnd: true - }) - })); - }, - updateCoverShape: function (controller, cover, localRange, brushOption) { - cover.childAt(0).setShape({ - points: clipByPanel(controller, cover, localRange) - }); - }, - updateCommon: updateCommon, - contain: mainShapeContain - } + getCreatingRange: function (localTrack) { + var ends = getTrackEnds(localTrack); + return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]); + }, + updateCoverShape: function (controller, cover, localRange, brushOption) { + updateBaseRect(controller, cover, localRange, brushOption); + }, + updateCommon: updateCommon, + contain: mainShapeContain + }, + polygon: { + createCover: function (controller, brushOption) { + var cover = new Group(); // Do not use graphic.Polygon because graphic.Polyline do not close the + // border of the shape when drawing, which is a better experience for user. + + cover.add(new Polyline({ + name: 'main', + style: makeStyle(brushOption), + silent: true + })); + return cover; + }, + getCreatingRange: function (localTrack) { + return localTrack; + }, + endCreating: function (controller, cover) { + cover.remove(cover.childAt(0)); // Use graphic.Polygon close the shape. + + cover.add(new Polygon({ + name: 'main', + draggable: true, + drift: curry(driftPolygon, controller, cover), + ondragend: curry(trigger$1, controller, { + isEnd: true + }) + })); + }, + updateCoverShape: function (controller, cover, localRange, brushOption) { + cover.childAt(0).setShape({ + points: clipByPanel(controller, cover, localRange) + }); + }, + updateCommon: updateCommon, + contain: mainShapeContain + } }; function getLineRenderer(xyIndex) { - return { - createCover: function (controller, brushOption) { - return createBaseRectCover({ - toRectRange: function (range) { - var rectRange = [range, [0, 100]]; - xyIndex && rectRange.reverse(); - return rectRange; - }, - fromRectRange: function (rectRange) { - return rectRange[xyIndex]; - } - }, controller, brushOption, [[['w'], ['e']], [['n'], ['s']]][xyIndex]); + return { + createCover: function (controller, brushOption) { + return createBaseRectCover({ + toRectRange: function (range) { + var rectRange = [range, [0, 100]]; + xyIndex && rectRange.reverse(); + return rectRange; }, - getCreatingRange: function (localTrack) { - var ends = getTrackEnds(localTrack); - var min = mathMin$9(ends[0][xyIndex], ends[1][xyIndex]); - var max = mathMax$9(ends[0][xyIndex], ends[1][xyIndex]); - return [min, max]; - }, - updateCoverShape: function (controller, cover, localRange, brushOption) { - var otherExtent; // If brushWidth not specified, fit the panel. + fromRectRange: function (rectRange) { + return rectRange[xyIndex]; + } + }, controller, brushOption, [[['w'], ['e']], [['n'], ['s']]][xyIndex]); + }, + getCreatingRange: function (localTrack) { + var ends = getTrackEnds(localTrack); + var min = mathMin$9(ends[0][xyIndex], ends[1][xyIndex]); + var max = mathMax$9(ends[0][xyIndex], ends[1][xyIndex]); + return [min, max]; + }, + updateCoverShape: function (controller, cover, localRange, brushOption) { + var otherExtent; // If brushWidth not specified, fit the panel. - var panel = getPanelByCover(controller, cover); + var panel = getPanelByCover(controller, cover); - if (panel !== BRUSH_PANEL_GLOBAL && panel.getLinearBrushOtherExtent) { - otherExtent = panel.getLinearBrushOtherExtent(xyIndex); - } else { - var zr = controller._zr; - otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]]; - } + if (panel !== BRUSH_PANEL_GLOBAL && panel.getLinearBrushOtherExtent) { + otherExtent = panel.getLinearBrushOtherExtent(xyIndex); + } else { + var zr = controller._zr; + otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]]; + } - var rectRange = [localRange, otherExtent]; - xyIndex && rectRange.reverse(); - updateBaseRect(controller, cover, rectRange, brushOption); - }, - updateCommon: updateCommon, - contain: mainShapeContain - }; + var rectRange = [localRange, otherExtent]; + xyIndex && rectRange.reverse(); + updateBaseRect(controller, cover, rectRange, brushOption); + }, + updateCommon: updateCommon, + contain: mainShapeContain + }; } function makeRectPanelClipPath(rect) { - rect = normalizeRect(rect); - return function (localPoints) { - return clipPointsByRect(localPoints, rect); - }; + rect = normalizeRect(rect); + return function (localPoints) { + return clipPointsByRect(localPoints, rect); + }; } function makeLinearBrushOtherExtent(rect, specifiedXYIndex) { - rect = normalizeRect(rect); - return function (xyIndex) { - var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex; - var brushWidth = idx ? rect.width : rect.height; - var base = idx ? rect.x : rect.y; - return [base, base + (brushWidth || 0)]; - }; + rect = normalizeRect(rect); + return function (xyIndex) { + var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex; + var brushWidth = idx ? rect.width : rect.height; + var base = idx ? rect.x : rect.y; + return [base, base + (brushWidth || 0)]; + }; } function makeRectIsTargetByCursor(rect, api, targetModel) { - var boundingRect = normalizeRect(rect); - return function (e, localCursorPoint) { - return boundingRect.contain(localCursorPoint[0], localCursorPoint[1]) && !onIrrelevantElement(e, api, targetModel); - }; + var boundingRect = normalizeRect(rect); + return function (e, localCursorPoint) { + return boundingRect.contain(localCursorPoint[0], localCursorPoint[1]) && !onIrrelevantElement(e, api, targetModel); + }; } // Consider width/height is negative. function normalizeRect(rect) { - return BoundingRect.create(rect); + return BoundingRect.create(rect); } var elementList = ['axisLine', 'axisTickLabel', 'axisName']; var ParallelAxisView = - /** @class */ - function (_super) { - __extends(ParallelAxisView, _super); - - function ParallelAxisView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = ParallelAxisView.type; - return _this; - } - - ParallelAxisView.prototype.init = function (ecModel, api) { - _super.prototype.init.apply(this, arguments); - - (this._brushController = new BrushController(api.getZr())).on('brush', bind(this._onBrush, this)); - }; - - ParallelAxisView.prototype.render = function (axisModel, ecModel, api, payload) { - if (fromAxisAreaSelect(axisModel, ecModel, payload)) { - return; - } - - this.axisModel = axisModel; - this.api = api; - this.group.removeAll(); - var oldAxisGroup = this._axisGroup; - this._axisGroup = new Group(); - this.group.add(this._axisGroup); - - if (!axisModel.get('show')) { - return; - } - - var coordSysModel = getCoordSysModel(axisModel, ecModel); - var coordSys = coordSysModel.coordinateSystem; - var areaSelectStyle = axisModel.getAreaSelectStyle(); - var areaWidth = areaSelectStyle.width; - var dim = axisModel.axis.dim; - var axisLayout = coordSys.getAxisLayout(dim); - var builderOpt = extend({ - strokeContainThreshold: areaWidth - }, axisLayout); - var axisBuilder = new AxisBuilder(axisModel, builderOpt); - each(elementList, axisBuilder.add, axisBuilder); - - this._axisGroup.add(axisBuilder.getGroup()); - - this._refreshBrushController(builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api); - - groupTransition(oldAxisGroup, this._axisGroup, axisModel); - }; // /** - // * @override - // */ - // updateVisual(axisModel, ecModel, api, payload) { - // this._brushController && this._brushController - // .updateCovers(getCoverInfoList(axisModel)); - // } - - - ParallelAxisView.prototype._refreshBrushController = function (builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api) { - // After filtering, axis may change, select area needs to be update. - var extent = axisModel.axis.getExtent(); - var extentLen = extent[1] - extent[0]; - var extra = Math.min(30, Math.abs(extentLen) * 0.1); // Arbitrary value. - // width/height might be negative, which will be - // normalized in BoundingRect. - - var rect = BoundingRect.create({ - x: extent[0], - y: -areaWidth / 2, - width: extentLen, - height: areaWidth - }); - rect.x -= extra; - rect.width += 2 * extra; - - this._brushController.mount({ - enableGlobalPan: true, - rotation: builderOpt.rotation, - x: builderOpt.position[0], - y: builderOpt.position[1] - }).setPanels([{ - panelId: 'pl', - clipPath: makeRectPanelClipPath(rect), - isTargetByCursor: makeRectIsTargetByCursor(rect, api, coordSysModel), - getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect, 0) - }]).enableBrush({ - brushType: 'lineX', - brushStyle: areaSelectStyle, - removeOnClick: true - }).updateCovers(getCoverInfoList(axisModel)); - }; - - ParallelAxisView.prototype._onBrush = function (eventParam) { - var coverInfoList = eventParam.areas; // Do not cache these object, because the mey be changed. - - var axisModel = this.axisModel; - var axis = axisModel.axis; - var intervals = map(coverInfoList, function (coverInfo) { - return [axis.coordToData(coverInfo.range[0], true), axis.coordToData(coverInfo.range[1], true)]; - }); // If realtime is true, action is not dispatched on drag end, because - // the drag end emits the same params with the last drag move event, - // and may have some delay when using touch pad. - - if (!axisModel.option.realtime === eventParam.isEnd || eventParam.removeOnClick) { - // jshint ignore:line - this.api.dispatchAction({ - type: 'axisAreaSelect', - parallelAxisId: axisModel.id, - intervals: intervals - }); - } - }; - - ParallelAxisView.prototype.dispose = function () { - this._brushController.dispose(); - }; - - ParallelAxisView.type = 'parallelAxis'; - return ParallelAxisView; - }(ComponentView); + /** @class */ + function (_super) { + __extends(ParallelAxisView, _super); + + function ParallelAxisView() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = ParallelAxisView.type; + return _this; + } + + ParallelAxisView.prototype.init = function (ecModel, api) { + _super.prototype.init.apply(this, arguments); + + (this._brushController = new BrushController(api.getZr())).on('brush', bind(this._onBrush, this)); + }; + + ParallelAxisView.prototype.render = function (axisModel, ecModel, api, payload) { + if (fromAxisAreaSelect(axisModel, ecModel, payload)) { + return; + } + + this.axisModel = axisModel; + this.api = api; + this.group.removeAll(); + var oldAxisGroup = this._axisGroup; + this._axisGroup = new Group(); + this.group.add(this._axisGroup); + + if (!axisModel.get('show')) { + return; + } + + var coordSysModel = getCoordSysModel(axisModel, ecModel); + var coordSys = coordSysModel.coordinateSystem; + var areaSelectStyle = axisModel.getAreaSelectStyle(); + var areaWidth = areaSelectStyle.width; + var dim = axisModel.axis.dim; + var axisLayout = coordSys.getAxisLayout(dim); + var builderOpt = extend({ + strokeContainThreshold: areaWidth + }, axisLayout); + var axisBuilder = new AxisBuilder(axisModel, builderOpt); + each(elementList, axisBuilder.add, axisBuilder); + + this._axisGroup.add(axisBuilder.getGroup()); + + this._refreshBrushController(builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api); + + groupTransition(oldAxisGroup, this._axisGroup, axisModel); + }; // /** + // * @override + // */ + // updateVisual(axisModel, ecModel, api, payload) { + // this._brushController && this._brushController + // .updateCovers(getCoverInfoList(axisModel)); + // } + + + ParallelAxisView.prototype._refreshBrushController = function (builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api) { + // After filtering, axis may change, select area needs to be update. + var extent = axisModel.axis.getExtent(); + var extentLen = extent[1] - extent[0]; + var extra = Math.min(30, Math.abs(extentLen) * 0.1); // Arbitrary value. + // width/height might be negative, which will be + // normalized in BoundingRect. + + var rect = BoundingRect.create({ + x: extent[0], + y: -areaWidth / 2, + width: extentLen, + height: areaWidth + }); + rect.x -= extra; + rect.width += 2 * extra; + + this._brushController.mount({ + enableGlobalPan: true, + rotation: builderOpt.rotation, + x: builderOpt.position[0], + y: builderOpt.position[1] + }).setPanels([{ + panelId: 'pl', + clipPath: makeRectPanelClipPath(rect), + isTargetByCursor: makeRectIsTargetByCursor(rect, api, coordSysModel), + getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect, 0) + }]).enableBrush({ + brushType: 'lineX', + brushStyle: areaSelectStyle, + removeOnClick: true + }).updateCovers(getCoverInfoList(axisModel)); + }; + + ParallelAxisView.prototype._onBrush = function (eventParam) { + var coverInfoList = eventParam.areas; // Do not cache these object, because the mey be changed. + + var axisModel = this.axisModel; + var axis = axisModel.axis; + var intervals = map(coverInfoList, function (coverInfo) { + return [axis.coordToData(coverInfo.range[0], true), axis.coordToData(coverInfo.range[1], true)]; + }); // If realtime is true, action is not dispatched on drag end, because + // the drag end emits the same params with the last drag move event, + // and may have some delay when using touch pad. + + if (!axisModel.option.realtime === eventParam.isEnd || eventParam.removeOnClick) { + // jshint ignore:line + this.api.dispatchAction({ + type: 'axisAreaSelect', + parallelAxisId: axisModel.id, + intervals: intervals + }); + } + }; + + ParallelAxisView.prototype.dispose = function () { + this._brushController.dispose(); + }; + + ParallelAxisView.type = 'parallelAxis'; + return ParallelAxisView; + }(ComponentView); function fromAxisAreaSelect(axisModel, ecModel, payload) { - return payload && payload.type === 'axisAreaSelect' && ecModel.findComponents({ - mainType: 'parallelAxis', - query: payload - })[0] === axisModel; + return payload && payload.type === 'axisAreaSelect' && ecModel.findComponents({ + mainType: 'parallelAxis', + query: payload + })[0] === axisModel; } function getCoverInfoList(axisModel) { - var axis = axisModel.axis; - return map(axisModel.activeIntervals, function (interval) { - return { - brushType: 'lineX', - panelId: 'pl', - range: [axis.dataToCoord(interval[0], true), axis.dataToCoord(interval[1], true)] - }; - }); + var axis = axisModel.axis; + return map(axisModel.activeIntervals, function (interval) { + return { + brushType: 'lineX', + panelId: 'pl', + range: [axis.dataToCoord(interval[0], true), axis.dataToCoord(interval[1], true)] + }; + }); } function getCoordSysModel(axisModel, ecModel) { - return ecModel.getComponent('parallel', axisModel.get('parallelIndex')); + return ecModel.getComponent('parallel', axisModel.get('parallelIndex')); } /* @@ -65166,566 +65166,566 @@ * under the License. */ var actionInfo$1 = { - type: 'axisAreaSelect', - event: 'axisAreaSelected' // update: 'updateVisual' + type: 'axisAreaSelect', + event: 'axisAreaSelected' // update: 'updateVisual' }; function installParallelActions(registers) { - registers.registerAction(actionInfo$1, function (payload, ecModel) { - ecModel.eachComponent({ - mainType: 'parallelAxis', - query: payload - }, function (parallelAxisModel) { - parallelAxisModel.axis.model.setActiveIntervals(payload.intervals); - }); + registers.registerAction(actionInfo$1, function (payload, ecModel) { + ecModel.eachComponent({ + mainType: 'parallelAxis', + query: payload + }, function (parallelAxisModel) { + parallelAxisModel.axis.model.setActiveIntervals(payload.intervals); }); - /** - * @payload - */ + }); + /** + * @payload + */ - registers.registerAction('parallelAxisExpand', function (payload, ecModel) { - ecModel.eachComponent({ - mainType: 'parallel', - query: payload - }, function (parallelModel) { - parallelModel.setAxisExpand(payload); - }); + registers.registerAction('parallelAxisExpand', function (payload, ecModel) { + ecModel.eachComponent({ + mainType: 'parallel', + query: payload + }, function (parallelModel) { + parallelModel.setAxisExpand(payload); }); + }); } var defaultAxisOption = { - type: 'value', - areaSelectStyle: { - width: 20, - borderWidth: 1, - borderColor: 'rgba(160,197,232)', - color: 'rgba(160,197,232)', - opacity: 0.3 - }, - realtime: true, - z: 10 + type: 'value', + areaSelectStyle: { + width: 20, + borderWidth: 1, + borderColor: 'rgba(160,197,232)', + color: 'rgba(160,197,232)', + opacity: 0.3 + }, + realtime: true, + z: 10 }; function install$g(registers) { - registers.registerComponentView(ParallelView$1); - registers.registerComponentModel(ParallelModel); - registers.registerCoordinateSystem('parallel', parallelCoordSysCreator); - registers.registerPreprocessor(parallelPreprocessor); - registers.registerComponentModel(ParallelAxisModel); - registers.registerComponentView(ParallelAxisView); - axisModelCreator(registers, 'parallel', ParallelAxisModel, defaultAxisOption); - installParallelActions(registers); + registers.registerComponentView(ParallelView$1); + registers.registerComponentModel(ParallelModel); + registers.registerCoordinateSystem('parallel', parallelCoordSysCreator); + registers.registerPreprocessor(parallelPreprocessor); + registers.registerComponentModel(ParallelAxisModel); + registers.registerComponentView(ParallelAxisView); + axisModelCreator(registers, 'parallel', ParallelAxisModel, defaultAxisOption); + installParallelActions(registers); } function install$h(registers) { - use(install$g); - registers.registerChartView(ParallelView); - registers.registerSeriesModel(ParallelSeriesModel); - registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, parallelVisual); + use(install$g); + registers.registerChartView(ParallelView); + registers.registerSeriesModel(ParallelSeriesModel); + registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, parallelVisual); } var SankeyPathShape = - /** @class */ - function () { - function SankeyPathShape() { - this.x1 = 0; - this.y1 = 0; - this.x2 = 0; - this.y2 = 0; - this.cpx1 = 0; - this.cpy1 = 0; - this.cpx2 = 0; - this.cpy2 = 0; - this.extent = 0; - } - - return SankeyPathShape; - }(); + /** @class */ + function () { + function SankeyPathShape() { + this.x1 = 0; + this.y1 = 0; + this.x2 = 0; + this.y2 = 0; + this.cpx1 = 0; + this.cpy1 = 0; + this.cpx2 = 0; + this.cpy2 = 0; + this.extent = 0; + } + + return SankeyPathShape; + }(); var SankeyPath = - /** @class */ - function (_super) { - __extends(SankeyPath, _super); - - function SankeyPath(opts) { - return _super.call(this, opts) || this; - } - - SankeyPath.prototype.getDefaultShape = function () { - return new SankeyPathShape(); - }; - - SankeyPath.prototype.buildPath = function (ctx, shape) { - var extent = shape.extent; - ctx.moveTo(shape.x1, shape.y1); - ctx.bezierCurveTo(shape.cpx1, shape.cpy1, shape.cpx2, shape.cpy2, shape.x2, shape.y2); - - if (shape.orient === 'vertical') { - ctx.lineTo(shape.x2 + extent, shape.y2); - ctx.bezierCurveTo(shape.cpx2 + extent, shape.cpy2, shape.cpx1 + extent, shape.cpy1, shape.x1 + extent, shape.y1); - } else { - ctx.lineTo(shape.x2, shape.y2 + extent); - ctx.bezierCurveTo(shape.cpx2, shape.cpy2 + extent, shape.cpx1, shape.cpy1 + extent, shape.x1, shape.y1 + extent); - } + /** @class */ + function (_super) { + __extends(SankeyPath, _super); + + function SankeyPath(opts) { + return _super.call(this, opts) || this; + } + + SankeyPath.prototype.getDefaultShape = function () { + return new SankeyPathShape(); + }; + + SankeyPath.prototype.buildPath = function (ctx, shape) { + var extent = shape.extent; + ctx.moveTo(shape.x1, shape.y1); + ctx.bezierCurveTo(shape.cpx1, shape.cpy1, shape.cpx2, shape.cpy2, shape.x2, shape.y2); + + if (shape.orient === 'vertical') { + ctx.lineTo(shape.x2 + extent, shape.y2); + ctx.bezierCurveTo(shape.cpx2 + extent, shape.cpy2, shape.cpx1 + extent, shape.cpy1, shape.x1 + extent, shape.y1); + } else { + ctx.lineTo(shape.x2, shape.y2 + extent); + ctx.bezierCurveTo(shape.cpx2, shape.cpy2 + extent, shape.cpx1, shape.cpy1 + extent, shape.x1, shape.y1 + extent); + } - ctx.closePath(); - }; + ctx.closePath(); + }; - SankeyPath.prototype.highlight = function () { - enterEmphasis(this); - }; + SankeyPath.prototype.highlight = function () { + enterEmphasis(this); + }; - SankeyPath.prototype.downplay = function () { - leaveEmphasis(this); - }; + SankeyPath.prototype.downplay = function () { + leaveEmphasis(this); + }; - return SankeyPath; - }(Path); + return SankeyPath; + }(Path); var SankeyView = - /** @class */ - function (_super) { - __extends(SankeyView, _super); - - function SankeyView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = SankeyView.type; - _this._focusAdjacencyDisabled = false; - return _this; - } - - SankeyView.prototype.render = function (seriesModel, ecModel, api) { - var sankeyView = this; - var graph = seriesModel.getGraph(); - var group = this.group; - var layoutInfo = seriesModel.layoutInfo; // view width - - var width = layoutInfo.width; // view height - - var height = layoutInfo.height; - var nodeData = seriesModel.getData(); - var edgeData = seriesModel.getData('edge'); - var orient = seriesModel.get('orient'); - this._model = seriesModel; - group.removeAll(); - group.x = layoutInfo.x; - group.y = layoutInfo.y; // generate a bezire Curve for each edge - - graph.eachEdge(function (edge) { - var curve = new SankeyPath(); - var ecData = getECData(curve); - ecData.dataIndex = edge.dataIndex; - ecData.seriesIndex = seriesModel.seriesIndex; - ecData.dataType = 'edge'; - var edgeModel = edge.getModel(); - var lineStyleModel = edgeModel.getModel('lineStyle'); - var curvature = lineStyleModel.get('curveness'); - var n1Layout = edge.node1.getLayout(); - var node1Model = edge.node1.getModel(); - var dragX1 = node1Model.get('localX'); - var dragY1 = node1Model.get('localY'); - var n2Layout = edge.node2.getLayout(); - var node2Model = edge.node2.getModel(); - var dragX2 = node2Model.get('localX'); - var dragY2 = node2Model.get('localY'); - var edgeLayout = edge.getLayout(); - var x1; - var y1; - var x2; - var y2; - var cpx1; - var cpy1; - var cpx2; - var cpy2; - curve.shape.extent = Math.max(1, edgeLayout.dy); - curve.shape.orient = orient; - - if (orient === 'vertical') { - x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + edgeLayout.sy; - y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + n1Layout.dy; - x2 = (dragX2 != null ? dragX2 * width : n2Layout.x) + edgeLayout.ty; - y2 = dragY2 != null ? dragY2 * height : n2Layout.y; - cpx1 = x1; - cpy1 = y1 * (1 - curvature) + y2 * curvature; - cpx2 = x2; - cpy2 = y1 * curvature + y2 * (1 - curvature); - } else { - x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx; - y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy; - x2 = dragX2 != null ? dragX2 * width : n2Layout.x; - y2 = (dragY2 != null ? dragY2 * height : n2Layout.y) + edgeLayout.ty; - cpx1 = x1 * (1 - curvature) + x2 * curvature; - cpy1 = y1; - cpx2 = x1 * curvature + x2 * (1 - curvature); - cpy2 = y2; - } - - curve.setShape({ - x1: x1, - y1: y1, - x2: x2, - y2: y2, - cpx1: cpx1, - cpy1: cpy1, - cpx2: cpx2, - cpy2: cpy2 - }); - curve.useStyle(lineStyleModel.getItemStyle()); // Special color, use source node color or target node color - - switch (curve.style.fill) { - case 'source': - curve.style.fill = edge.node1.getVisual('color'); - curve.style.decal = edge.node1.getVisual('style').decal; - break; + /** @class */ + function (_super) { + __extends(SankeyView, _super); - case 'target': - curve.style.fill = edge.node2.getVisual('color'); - curve.style.decal = edge.node2.getVisual('style').decal; - break; + function SankeyView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - case 'gradient': - var sourceColor = edge.node1.getVisual('color'); - var targetColor = edge.node2.getVisual('color'); - - if (isString(sourceColor) && isString(targetColor)) { - curve.style.fill = new LinearGradient(0, 0, +(orient === 'horizontal'), +(orient === 'vertical'), [{ - color: sourceColor, - offset: 0 - }, { - color: targetColor, - offset: 1 - }]); - } + _this.type = SankeyView.type; + _this._focusAdjacencyDisabled = false; + return _this; + } - } + SankeyView.prototype.render = function (seriesModel, ecModel, api) { + var sankeyView = this; + var graph = seriesModel.getGraph(); + var group = this.group; + var layoutInfo = seriesModel.layoutInfo; // view width - var emphasisModel = edgeModel.getModel('emphasis'); - setStatesStylesFromModel(curve, edgeModel, 'lineStyle', function (model) { - return model.getItemStyle(); - }); - group.add(curve); - edgeData.setItemGraphicEl(edge.dataIndex, curve); - var focus = emphasisModel.get('focus'); - toggleHoverEmphasis(curve, focus === 'adjacency' ? edge.getAdjacentDataIndices() : focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - getECData(curve).dataType = 'edge'; - }); // Generate a rect for each node - - graph.eachNode(function (node) { - var layout = node.getLayout(); - var itemModel = node.getModel(); - var dragX = itemModel.get('localX'); - var dragY = itemModel.get('localY'); - var emphasisModel = itemModel.getModel('emphasis'); - var rect = new Rect({ - shape: { - x: dragX != null ? dragX * width : layout.x, - y: dragY != null ? dragY * height : layout.y, - width: layout.dx, - height: layout.dy - }, - style: itemModel.getModel('itemStyle').getItemStyle(), - z2: 10 - }); - setLabelStyle(rect, getLabelStatesModels(itemModel), { - labelFetcher: seriesModel, - labelDataIndex: node.dataIndex, - defaultText: node.id - }); - rect.disableLabelAnimation = true; - rect.setStyle('fill', node.getVisual('color')); - rect.setStyle('decal', node.getVisual('style').decal); - setStatesStylesFromModel(rect, itemModel); - group.add(rect); - nodeData.setItemGraphicEl(node.dataIndex, rect); - getECData(rect).dataType = 'node'; - var focus = emphasisModel.get('focus'); - toggleHoverEmphasis(rect, focus === 'adjacency' ? node.getAdjacentDataIndices() : focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - }); - nodeData.eachItemGraphicEl(function (el, dataIndex) { - var itemModel = nodeData.getItemModel(dataIndex); - - if (itemModel.get('draggable')) { - el.drift = function (dx, dy) { - sankeyView._focusAdjacencyDisabled = true; - this.shape.x += dx; - this.shape.y += dy; - this.dirty(); - api.dispatchAction({ - type: 'dragNode', - seriesId: seriesModel.id, - dataIndex: nodeData.getRawIndex(dataIndex), - localX: this.shape.x / width, - localY: this.shape.y / height - }); - }; + var width = layoutInfo.width; // view height - el.ondragend = function () { - sankeyView._focusAdjacencyDisabled = false; - }; + var height = layoutInfo.height; + var nodeData = seriesModel.getData(); + var edgeData = seriesModel.getData('edge'); + var orient = seriesModel.get('orient'); + this._model = seriesModel; + group.removeAll(); + group.x = layoutInfo.x; + group.y = layoutInfo.y; // generate a bezire Curve for each edge + + graph.eachEdge(function (edge) { + var curve = new SankeyPath(); + var ecData = getECData(curve); + ecData.dataIndex = edge.dataIndex; + ecData.seriesIndex = seriesModel.seriesIndex; + ecData.dataType = 'edge'; + var edgeModel = edge.getModel(); + var lineStyleModel = edgeModel.getModel('lineStyle'); + var curvature = lineStyleModel.get('curveness'); + var n1Layout = edge.node1.getLayout(); + var node1Model = edge.node1.getModel(); + var dragX1 = node1Model.get('localX'); + var dragY1 = node1Model.get('localY'); + var n2Layout = edge.node2.getLayout(); + var node2Model = edge.node2.getModel(); + var dragX2 = node2Model.get('localX'); + var dragY2 = node2Model.get('localY'); + var edgeLayout = edge.getLayout(); + var x1; + var y1; + var x2; + var y2; + var cpx1; + var cpy1; + var cpx2; + var cpy2; + curve.shape.extent = Math.max(1, edgeLayout.dy); + curve.shape.orient = orient; + + if (orient === 'vertical') { + x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + edgeLayout.sy; + y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + n1Layout.dy; + x2 = (dragX2 != null ? dragX2 * width : n2Layout.x) + edgeLayout.ty; + y2 = dragY2 != null ? dragY2 * height : n2Layout.y; + cpx1 = x1; + cpy1 = y1 * (1 - curvature) + y2 * curvature; + cpx2 = x2; + cpy2 = y1 * curvature + y2 * (1 - curvature); + } else { + x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx; + y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy; + x2 = dragX2 != null ? dragX2 * width : n2Layout.x; + y2 = (dragY2 != null ? dragY2 * height : n2Layout.y) + edgeLayout.ty; + cpx1 = x1 * (1 - curvature) + x2 * curvature; + cpy1 = y1; + cpx2 = x1 * curvature + x2 * (1 - curvature); + cpy2 = y2; + } + + curve.setShape({ + x1: x1, + y1: y1, + x2: x2, + y2: y2, + cpx1: cpx1, + cpy1: cpy1, + cpx2: cpx2, + cpy2: cpy2 + }); + curve.useStyle(lineStyleModel.getItemStyle()); // Special color, use source node color or target node color + + switch (curve.style.fill) { + case 'source': + curve.style.fill = edge.node1.getVisual('color'); + curve.style.decal = edge.node1.getVisual('style').decal; + break; + + case 'target': + curve.style.fill = edge.node2.getVisual('color'); + curve.style.decal = edge.node2.getVisual('style').decal; + break; + + case 'gradient': + var sourceColor = edge.node1.getVisual('color'); + var targetColor = edge.node2.getVisual('color'); + + if (isString(sourceColor) && isString(targetColor)) { + curve.style.fill = new LinearGradient(0, 0, +(orient === 'horizontal'), +(orient === 'vertical'), [{ + color: sourceColor, + offset: 0 + }, { + color: targetColor, + offset: 1 + }]); + } + + } + + var emphasisModel = edgeModel.getModel('emphasis'); + setStatesStylesFromModel(curve, edgeModel, 'lineStyle', function (model) { + return model.getItemStyle(); + }); + group.add(curve); + edgeData.setItemGraphicEl(edge.dataIndex, curve); + var focus = emphasisModel.get('focus'); + toggleHoverEmphasis(curve, focus === 'adjacency' ? edge.getAdjacentDataIndices() : focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled')); + getECData(curve).dataType = 'edge'; + }); // Generate a rect for each node - el.draggable = true; - el.cursor = 'move'; - } - }); + graph.eachNode(function (node) { + var layout = node.getLayout(); + var itemModel = node.getModel(); + var dragX = itemModel.get('localX'); + var dragY = itemModel.get('localY'); + var emphasisModel = itemModel.getModel('emphasis'); + var rect = new Rect({ + shape: { + x: dragX != null ? dragX * width : layout.x, + y: dragY != null ? dragY * height : layout.y, + width: layout.dx, + height: layout.dy + }, + style: itemModel.getModel('itemStyle').getItemStyle(), + z2: 10 + }); + setLabelStyle(rect, getLabelStatesModels(itemModel), { + labelFetcher: seriesModel, + labelDataIndex: node.dataIndex, + defaultText: node.id + }); + rect.disableLabelAnimation = true; + rect.setStyle('fill', node.getVisual('color')); + rect.setStyle('decal', node.getVisual('style').decal); + setStatesStylesFromModel(rect, itemModel); + group.add(rect); + nodeData.setItemGraphicEl(node.dataIndex, rect); + getECData(rect).dataType = 'node'; + var focus = emphasisModel.get('focus'); + toggleHoverEmphasis(rect, focus === 'adjacency' ? node.getAdjacentDataIndices() : focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled')); + }); + nodeData.eachItemGraphicEl(function (el, dataIndex) { + var itemModel = nodeData.getItemModel(dataIndex); + + if (itemModel.get('draggable')) { + el.drift = function (dx, dy) { + sankeyView._focusAdjacencyDisabled = true; + this.shape.x += dx; + this.shape.y += dy; + this.dirty(); + api.dispatchAction({ + type: 'dragNode', + seriesId: seriesModel.id, + dataIndex: nodeData.getRawIndex(dataIndex), + localX: this.shape.x / width, + localY: this.shape.y / height + }); + }; + + el.ondragend = function () { + sankeyView._focusAdjacencyDisabled = false; + }; + + el.draggable = true; + el.cursor = 'move'; + } + }); - if (!this._data && seriesModel.isAnimationEnabled()) { - group.setClipPath(createGridClipShape$1(group.getBoundingRect(), seriesModel, function () { - group.removeClipPath(); - })); - } + if (!this._data && seriesModel.isAnimationEnabled()) { + group.setClipPath(createGridClipShape$1(group.getBoundingRect(), seriesModel, function () { + group.removeClipPath(); + })); + } - this._data = seriesModel.getData(); - }; + this._data = seriesModel.getData(); + }; - SankeyView.prototype.dispose = function () {}; + SankeyView.prototype.dispose = function () {}; - SankeyView.type = 'sankey'; - return SankeyView; - }(ChartView); // Add animation to the view + SankeyView.type = 'sankey'; + return SankeyView; + }(ChartView); // Add animation to the view function createGridClipShape$1(rect, seriesModel, cb) { - var rectEl = new Rect({ - shape: { - x: rect.x - 10, - y: rect.y - 10, - width: 0, - height: rect.height + 20 - } - }); - initProps(rectEl, { - shape: { - width: rect.width + 20 - } - }, seriesModel, cb); - return rectEl; + var rectEl = new Rect({ + shape: { + x: rect.x - 10, + y: rect.y - 10, + width: 0, + height: rect.height + 20 + } + }); + initProps(rectEl, { + shape: { + width: rect.width + 20 + } + }, seriesModel, cb); + return rectEl; } var SankeySeriesModel = - /** @class */ - function (_super) { - __extends(SankeySeriesModel, _super); + /** @class */ + function (_super) { + __extends(SankeySeriesModel, _super); + + function SankeySeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = SankeySeriesModel.type; + return _this; + } + /** + * Init a graph data structure from data in option series + */ - function SankeySeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SankeySeriesModel.type; - return _this; - } - /** - * Init a graph data structure from data in option series - */ + SankeySeriesModel.prototype.getInitialData = function (option, ecModel) { + var links = option.edges || option.links; + var nodes = option.data || option.nodes; + var levels = option.levels; + this.levelModels = []; + var levelModels = this.levelModels; + for (var i = 0; i < levels.length; i++) { + if (levels[i].depth != null && levels[i].depth >= 0) { + levelModels[levels[i].depth] = new Model(levels[i], this, ecModel); + } else { + if ("development" !== 'production') { + throw new Error('levels[i].depth is mandatory and should be natural number'); + } + } + } - SankeySeriesModel.prototype.getInitialData = function (option, ecModel) { - var links = option.edges || option.links; - var nodes = option.data || option.nodes; - var levels = option.levels; - this.levelModels = []; - var levelModels = this.levelModels; + if (nodes && links) { + var graph = createGraphFromNodeEdge(nodes, links, this, true, beforeLink); + return graph.data; + } - for (var i = 0; i < levels.length; i++) { - if (levels[i].depth != null && levels[i].depth >= 0) { - levelModels[levels[i].depth] = new Model(levels[i], this, ecModel); - } else { - if ("development" !== 'production') { - throw new Error('levels[i].depth is mandatory and should be natural number'); - } - } - } + function beforeLink(nodeData, edgeData) { + nodeData.wrapMethod('getItemModel', function (model, idx) { + var seriesModel = model.parentModel; + var layout = seriesModel.getData().getItemLayout(idx); - if (nodes && links) { - var graph = createGraphFromNodeEdge(nodes, links, this, true, beforeLink); - return graph.data; - } + if (layout) { + var nodeDepth = layout.depth; + var levelModel = seriesModel.levelModels[nodeDepth]; - function beforeLink(nodeData, edgeData) { - nodeData.wrapMethod('getItemModel', function (model, idx) { - var seriesModel = model.parentModel; - var layout = seriesModel.getData().getItemLayout(idx); + if (levelModel) { + model.parentModel = levelModel; + } + } - if (layout) { - var nodeDepth = layout.depth; - var levelModel = seriesModel.levelModels[nodeDepth]; + return model; + }); + edgeData.wrapMethod('getItemModel', function (model, idx) { + var seriesModel = model.parentModel; + var edge = seriesModel.getGraph().getEdgeByIndex(idx); + var layout = edge.node1.getLayout(); - if (levelModel) { - model.parentModel = levelModel; - } - } + if (layout) { + var depth = layout.depth; + var levelModel = seriesModel.levelModels[depth]; - return model; - }); - edgeData.wrapMethod('getItemModel', function (model, idx) { - var seriesModel = model.parentModel; - var edge = seriesModel.getGraph().getEdgeByIndex(idx); - var layout = edge.node1.getLayout(); + if (levelModel) { + model.parentModel = levelModel; + } + } - if (layout) { - var depth = layout.depth; - var levelModel = seriesModel.levelModels[depth]; + return model; + }); + } + }; - if (levelModel) { - model.parentModel = levelModel; - } - } + SankeySeriesModel.prototype.setNodePosition = function (dataIndex, localPosition) { + var nodes = this.option.data || this.option.nodes; + var dataItem = nodes[dataIndex]; + dataItem.localX = localPosition[0]; + dataItem.localY = localPosition[1]; + }; + /** + * Return the graphic data structure + * + * @return graphic data structure + */ - return model; - }); - } - }; - SankeySeriesModel.prototype.setNodePosition = function (dataIndex, localPosition) { - var nodes = this.option.data || this.option.nodes; - var dataItem = nodes[dataIndex]; - dataItem.localX = localPosition[0]; - dataItem.localY = localPosition[1]; - }; - /** - * Return the graphic data structure - * - * @return graphic data structure - */ + SankeySeriesModel.prototype.getGraph = function () { + return this.getData().graph; + }; + /** + * Get edge data of graphic data structure + * + * @return data structure of list + */ - SankeySeriesModel.prototype.getGraph = function () { - return this.getData().graph; - }; - /** - * Get edge data of graphic data structure - * - * @return data structure of list - */ + SankeySeriesModel.prototype.getEdgeData = function () { + return this.getGraph().edgeData; + }; + SankeySeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { + function noValue(val) { + return isNaN(val) || val == null; + } // dataType === 'node' or empty do not show tooltip by default - SankeySeriesModel.prototype.getEdgeData = function () { - return this.getGraph().edgeData; - }; - SankeySeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - function noValue(val) { - return isNaN(val) || val == null; - } // dataType === 'node' or empty do not show tooltip by default - - - if (dataType === 'edge') { - var params = this.getDataParams(dataIndex, dataType); - var rawDataOpt = params.data; - var edgeValue = params.value; - var edgeName = rawDataOpt.source + ' -- ' + rawDataOpt.target; - return createTooltipMarkup('nameValue', { - name: edgeName, - value: edgeValue, - noValue: noValue(edgeValue) - }); - } // dataType === 'node' - else { - var node = this.getGraph().getNodeByIndex(dataIndex); - var value = node.getLayout().value; - var name_1 = this.getDataParams(dataIndex, dataType).data.name; - return createTooltipMarkup('nameValue', { - name: name_1 != null ? name_1 + '' : null, - value: value, - noValue: noValue(value) - }); - } - }; + if (dataType === 'edge') { + var params = this.getDataParams(dataIndex, dataType); + var rawDataOpt = params.data; + var edgeValue = params.value; + var edgeName = rawDataOpt.source + ' -- ' + rawDataOpt.target; + return createTooltipMarkup('nameValue', { + name: edgeName, + value: edgeValue, + noValue: noValue(edgeValue) + }); + } // dataType === 'node' + else { + var node = this.getGraph().getNodeByIndex(dataIndex); + var value = node.getLayout().value; + var name_1 = this.getDataParams(dataIndex, dataType).data.name; + return createTooltipMarkup('nameValue', { + name: name_1 != null ? name_1 + '' : null, + value: value, + noValue: noValue(value) + }); + } + }; - SankeySeriesModel.prototype.optionUpdated = function () {}; // Override Series.getDataParams() + SankeySeriesModel.prototype.optionUpdated = function () {}; // Override Series.getDataParams() - SankeySeriesModel.prototype.getDataParams = function (dataIndex, dataType) { - var params = _super.prototype.getDataParams.call(this, dataIndex, dataType); + SankeySeriesModel.prototype.getDataParams = function (dataIndex, dataType) { + var params = _super.prototype.getDataParams.call(this, dataIndex, dataType); - if (params.value == null && dataType === 'node') { - var node = this.getGraph().getNodeByIndex(dataIndex); - var nodeValue = node.getLayout().value; - params.value = nodeValue; - } + if (params.value == null && dataType === 'node') { + var node = this.getGraph().getNodeByIndex(dataIndex); + var nodeValue = node.getLayout().value; + params.value = nodeValue; + } - return params; - }; + return params; + }; - SankeySeriesModel.type = 'series.sankey'; - SankeySeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - coordinateSystem: 'view', - left: '5%', - top: '5%', - right: '20%', - bottom: '5%', - orient: 'horizontal', - nodeWidth: 20, - nodeGap: 8, - draggable: true, - layoutIterations: 32, - label: { - show: true, - position: 'right', - fontSize: 12 - }, - levels: [], - nodeAlign: 'justify', - lineStyle: { - color: '#314656', - opacity: 0.2, - curveness: 0.5 - }, - emphasis: { - label: { - show: true - }, - lineStyle: { - opacity: 0.5 - } - }, - select: { - itemStyle: { - borderColor: '#212121' - } - }, - animationEasing: 'linear', - animationDuration: 1000 - }; - return SankeySeriesModel; - }(SeriesModel); + SankeySeriesModel.type = 'series.sankey'; + SankeySeriesModel.defaultOption = { + // zlevel: 0, + z: 2, + coordinateSystem: 'view', + left: '5%', + top: '5%', + right: '20%', + bottom: '5%', + orient: 'horizontal', + nodeWidth: 20, + nodeGap: 8, + draggable: true, + layoutIterations: 32, + label: { + show: true, + position: 'right', + fontSize: 12 + }, + levels: [], + nodeAlign: 'justify', + lineStyle: { + color: '#314656', + opacity: 0.2, + curveness: 0.5 + }, + emphasis: { + label: { + show: true + }, + lineStyle: { + opacity: 0.5 + } + }, + select: { + itemStyle: { + borderColor: '#212121' + } + }, + animationEasing: 'linear', + animationDuration: 1000 + }; + return SankeySeriesModel; + }(SeriesModel); function sankeyLayout(ecModel, api) { - ecModel.eachSeriesByType('sankey', function (seriesModel) { - var nodeWidth = seriesModel.get('nodeWidth'); - var nodeGap = seriesModel.get('nodeGap'); - var layoutInfo = getViewRect$4(seriesModel, api); - seriesModel.layoutInfo = layoutInfo; - var width = layoutInfo.width; - var height = layoutInfo.height; - var graph = seriesModel.getGraph(); - var nodes = graph.nodes; - var edges = graph.edges; - computeNodeValues(nodes); - var filteredNodes = filter(nodes, function (node) { - return node.getLayout().value === 0; - }); - var iterations = filteredNodes.length !== 0 ? 0 : seriesModel.get('layoutIterations'); - var orient = seriesModel.get('orient'); - var nodeAlign = seriesModel.get('nodeAlign'); - layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign); + ecModel.eachSeriesByType('sankey', function (seriesModel) { + var nodeWidth = seriesModel.get('nodeWidth'); + var nodeGap = seriesModel.get('nodeGap'); + var layoutInfo = getViewRect$4(seriesModel, api); + seriesModel.layoutInfo = layoutInfo; + var width = layoutInfo.width; + var height = layoutInfo.height; + var graph = seriesModel.getGraph(); + var nodes = graph.nodes; + var edges = graph.edges; + computeNodeValues(nodes); + var filteredNodes = filter(nodes, function (node) { + return node.getLayout().value === 0; }); + var iterations = filteredNodes.length !== 0 ? 0 : seriesModel.get('layoutIterations'); + var orient = seriesModel.get('orient'); + var nodeAlign = seriesModel.get('nodeAlign'); + layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign); + }); } /** * Get the layout position of the whole view */ function getViewRect$4(seriesModel, api) { - return getLayoutRect(seriesModel.getBoxLayoutParams(), { - width: api.getWidth(), - height: api.getHeight() - }); + return getLayoutRect(seriesModel.getBoxLayoutParams(), { + width: api.getWidth(), + height: api.getHeight() + }); } function layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign) { - computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign); - computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient); - computeEdgeDepths(nodes, orient); + computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign); + computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient); + computeEdgeDepths(nodes, orient); } /** * Compute the value of each node by summing the associated edge's value @@ -65733,15 +65733,15 @@ function computeNodeValues(nodes) { - each(nodes, function (node) { - var value1 = sum(node.outEdges, getEdgeValue); - var value2 = sum(node.inEdges, getEdgeValue); - var nodeRawValue = node.getValue() || 0; - var value = Math.max(value1, value2, nodeRawValue); - node.setLayout({ - value: value - }, true); - }); + each(nodes, function (node) { + var value1 = sum(node.outEdges, getEdgeValue); + var value2 = sum(node.inEdges, getEdgeValue); + var nodeRawValue = node.getValue() || 0; + var value = Math.max(value1, value2, nodeRawValue); + node.setLayout({ + value: value + }, true); + }); } /** * Compute the x-position for each node. @@ -65752,127 +65752,127 @@ function computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) { - // Used to mark whether the edge is deleted. if it is deleted, - // the value is 0, otherwise it is 1. - var remainEdges = []; // Storage each node's indegree. + // Used to mark whether the edge is deleted. if it is deleted, + // the value is 0, otherwise it is 1. + var remainEdges = []; // Storage each node's indegree. - var indegreeArr = []; //Used to storage the node with indegree is equal to 0. + var indegreeArr = []; //Used to storage the node with indegree is equal to 0. - var zeroIndegrees = []; - var nextTargetNode = []; - var x = 0; // let kx = 0; + var zeroIndegrees = []; + var nextTargetNode = []; + var x = 0; // let kx = 0; - for (var i = 0; i < edges.length; i++) { - remainEdges[i] = 1; - } + for (var i = 0; i < edges.length; i++) { + remainEdges[i] = 1; + } - for (var i = 0; i < nodes.length; i++) { - indegreeArr[i] = nodes[i].inEdges.length; + for (var i = 0; i < nodes.length; i++) { + indegreeArr[i] = nodes[i].inEdges.length; - if (indegreeArr[i] === 0) { - zeroIndegrees.push(nodes[i]); - } + if (indegreeArr[i] === 0) { + zeroIndegrees.push(nodes[i]); } + } - var maxNodeDepth = -1; // Traversing nodes using topological sorting to calculate the - // horizontal(if orient === 'horizontal') or vertical(if orient === 'vertical') - // position of the nodes. + var maxNodeDepth = -1; // Traversing nodes using topological sorting to calculate the + // horizontal(if orient === 'horizontal') or vertical(if orient === 'vertical') + // position of the nodes. - while (zeroIndegrees.length) { - for (var idx = 0; idx < zeroIndegrees.length; idx++) { - var node = zeroIndegrees[idx]; - var item = node.hostGraph.data.getRawDataItem(node.dataIndex); - var isItemDepth = item.depth != null && item.depth >= 0; + while (zeroIndegrees.length) { + for (var idx = 0; idx < zeroIndegrees.length; idx++) { + var node = zeroIndegrees[idx]; + var item = node.hostGraph.data.getRawDataItem(node.dataIndex); + var isItemDepth = item.depth != null && item.depth >= 0; - if (isItemDepth && item.depth > maxNodeDepth) { - maxNodeDepth = item.depth; - } + if (isItemDepth && item.depth > maxNodeDepth) { + maxNodeDepth = item.depth; + } - node.setLayout({ - depth: isItemDepth ? item.depth : x - }, true); - orient === 'vertical' ? node.setLayout({ - dy: nodeWidth - }, true) : node.setLayout({ - dx: nodeWidth - }, true); + node.setLayout({ + depth: isItemDepth ? item.depth : x + }, true); + orient === 'vertical' ? node.setLayout({ + dy: nodeWidth + }, true) : node.setLayout({ + dx: nodeWidth + }, true); - for (var edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) { - var edge = node.outEdges[edgeIdx]; - var indexEdge = edges.indexOf(edge); - remainEdges[indexEdge] = 0; - var targetNode = edge.node2; - var nodeIndex = nodes.indexOf(targetNode); + for (var edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) { + var edge = node.outEdges[edgeIdx]; + var indexEdge = edges.indexOf(edge); + remainEdges[indexEdge] = 0; + var targetNode = edge.node2; + var nodeIndex = nodes.indexOf(targetNode); - if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) { - nextTargetNode.push(targetNode); - } - } + if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) { + nextTargetNode.push(targetNode); } - - ++x; - zeroIndegrees = nextTargetNode; - nextTargetNode = []; + } } - for (var i = 0; i < remainEdges.length; i++) { - if (remainEdges[i] === 1) { - throw new Error('Sankey is a DAG, the original data has cycle!'); - } + ++x; + zeroIndegrees = nextTargetNode; + nextTargetNode = []; + } + + for (var i = 0; i < remainEdges.length; i++) { + if (remainEdges[i] === 1) { + throw new Error('Sankey is a DAG, the original data has cycle!'); } + } - var maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1; + var maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1; - if (nodeAlign && nodeAlign !== 'left') { - adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth); - } + if (nodeAlign && nodeAlign !== 'left') { + adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth); + } - var kx = orient === 'vertical' ? (height - nodeWidth) / maxDepth : (width - nodeWidth) / maxDepth; - scaleNodeBreadths(nodes, kx, orient); + var kx = orient === 'vertical' ? (height - nodeWidth) / maxDepth : (width - nodeWidth) / maxDepth; + scaleNodeBreadths(nodes, kx, orient); } function isNodeDepth(node) { - var item = node.hostGraph.data.getRawDataItem(node.dataIndex); - return item.depth != null && item.depth >= 0; + var item = node.hostGraph.data.getRawDataItem(node.dataIndex); + return item.depth != null && item.depth >= 0; } function adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth) { - if (nodeAlign === 'right') { - var nextSourceNode = []; - var remainNodes = nodes; - var nodeHeight = 0; - - while (remainNodes.length) { - for (var i = 0; i < remainNodes.length; i++) { - var node = remainNodes[i]; - node.setLayout({ - skNodeHeight: nodeHeight - }, true); - - for (var j = 0; j < node.inEdges.length; j++) { - var edge = node.inEdges[j]; - - if (nextSourceNode.indexOf(edge.node1) < 0) { - nextSourceNode.push(edge.node1); - } - } - } + if (nodeAlign === 'right') { + var nextSourceNode = []; + var remainNodes = nodes; + var nodeHeight = 0; + + while (remainNodes.length) { + for (var i = 0; i < remainNodes.length; i++) { + var node = remainNodes[i]; + node.setLayout({ + skNodeHeight: nodeHeight + }, true); - remainNodes = nextSourceNode; - nextSourceNode = []; - ++nodeHeight; + for (var j = 0; j < node.inEdges.length; j++) { + var edge = node.inEdges[j]; + + if (nextSourceNode.indexOf(edge.node1) < 0) { + nextSourceNode.push(edge.node1); + } } + } - each(nodes, function (node) { - if (!isNodeDepth(node)) { - node.setLayout({ - depth: Math.max(0, maxDepth - node.getLayout().skNodeHeight) - }, true); - } - }); - } else if (nodeAlign === 'justify') { - moveSinksRight(nodes, maxDepth); + remainNodes = nextSourceNode; + nextSourceNode = []; + ++nodeHeight; } + + each(nodes, function (node) { + if (!isNodeDepth(node)) { + node.setLayout({ + depth: Math.max(0, maxDepth - node.getLayout().skNodeHeight) + }, true); + } + }); + } else if (nodeAlign === 'justify') { + moveSinksRight(nodes, maxDepth); + } } /** * All the node without outEgdes are assigned maximum x-position and @@ -65884,13 +65884,13 @@ function moveSinksRight(nodes, maxDepth) { - each(nodes, function (node) { - if (!isNodeDepth(node) && !node.outEdges.length) { - node.setLayout({ - depth: maxDepth - }, true); - } - }); + each(nodes, function (node) { + if (!isNodeDepth(node) && !node.outEdges.length) { + node.setLayout({ + depth: maxDepth + }, true); + } + }); } /** * Scale node x-position to the width @@ -65901,14 +65901,14 @@ function scaleNodeBreadths(nodes, kx, orient) { - each(nodes, function (node) { - var nodeDepth = node.getLayout().depth * kx; - orient === 'vertical' ? node.setLayout({ - y: nodeDepth - }, true) : node.setLayout({ - x: nodeDepth - }, true); - }); + each(nodes, function (node) { + var nodeDepth = node.getLayout().depth * kx; + orient === 'vertical' ? node.setLayout({ + y: nodeDepth + }, true) : node.setLayout({ + x: nodeDepth + }, true); + }); } /** * Using Gauss-Seidel iterations method to compute the node depth(y-position) @@ -65923,34 +65923,34 @@ function computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient) { - var nodesByBreadth = prepareNodesByBreadth(nodes, orient); - initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient); + var nodesByBreadth = prepareNodesByBreadth(nodes, orient); + initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient); + resolveCollisions(nodesByBreadth, nodeGap, height, width, orient); + + for (var alpha = 1; iterations > 0; iterations--) { + // 0.99 is a experience parameter, ensure that each iterations of + // changes as small as possible. + alpha *= 0.99; + relaxRightToLeft(nodesByBreadth, alpha, orient); resolveCollisions(nodesByBreadth, nodeGap, height, width, orient); - - for (var alpha = 1; iterations > 0; iterations--) { - // 0.99 is a experience parameter, ensure that each iterations of - // changes as small as possible. - alpha *= 0.99; - relaxRightToLeft(nodesByBreadth, alpha, orient); - resolveCollisions(nodesByBreadth, nodeGap, height, width, orient); - relaxLeftToRight(nodesByBreadth, alpha, orient); - resolveCollisions(nodesByBreadth, nodeGap, height, width, orient); - } + relaxLeftToRight(nodesByBreadth, alpha, orient); + resolveCollisions(nodesByBreadth, nodeGap, height, width, orient); + } } function prepareNodesByBreadth(nodes, orient) { - var nodesByBreadth = []; - var keyAttr = orient === 'vertical' ? 'y' : 'x'; - var groupResult = groupData(nodes, function (node) { - return node.getLayout()[keyAttr]; - }); - groupResult.keys.sort(function (a, b) { - return a - b; - }); - each(groupResult.keys, function (key) { - nodesByBreadth.push(groupResult.buckets.get(key)); - }); - return nodesByBreadth; + var nodesByBreadth = []; + var keyAttr = orient === 'vertical' ? 'y' : 'x'; + var groupResult = groupData(nodes, function (node) { + return node.getLayout()[keyAttr]; + }); + groupResult.keys.sort(function (a, b) { + return a - b; + }); + each(groupResult.keys, function (key) { + nodesByBreadth.push(groupResult.buckets.get(key)); + }); + return nodesByBreadth; } /** * Compute the original y-position for each node @@ -65958,46 +65958,46 @@ function initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) { - var minKy = Infinity; - each(nodesByBreadth, function (nodes) { - var n = nodes.length; - var sum = 0; - each(nodes, function (node) { - sum += node.getLayout().value; - }); - var ky = orient === 'vertical' ? (width - (n - 1) * nodeGap) / sum : (height - (n - 1) * nodeGap) / sum; - - if (ky < minKy) { - minKy = ky; - } + var minKy = Infinity; + each(nodesByBreadth, function (nodes) { + var n = nodes.length; + var sum = 0; + each(nodes, function (node) { + sum += node.getLayout().value; }); - each(nodesByBreadth, function (nodes) { - each(nodes, function (node, i) { - var nodeDy = node.getLayout().value * minKy; + var ky = orient === 'vertical' ? (width - (n - 1) * nodeGap) / sum : (height - (n - 1) * nodeGap) / sum; - if (orient === 'vertical') { - node.setLayout({ - x: i - }, true); - node.setLayout({ - dx: nodeDy - }, true); - } else { - node.setLayout({ - y: i - }, true); - node.setLayout({ - dy: nodeDy - }, true); - } - }); - }); - each(edges, function (edge) { - var edgeDy = +edge.getValue() * minKy; - edge.setLayout({ - dy: edgeDy + if (ky < minKy) { + minKy = ky; + } + }); + each(nodesByBreadth, function (nodes) { + each(nodes, function (node, i) { + var nodeDy = node.getLayout().value * minKy; + + if (orient === 'vertical') { + node.setLayout({ + x: i + }, true); + node.setLayout({ + dx: nodeDy + }, true); + } else { + node.setLayout({ + y: i }, true); + node.setLayout({ + dy: nodeDy + }, true); + } }); + }); + each(edges, function (edge) { + var edgeDy = +edge.getValue() * minKy; + edge.setLayout({ + dy: edgeDy + }, true); + }); } /** * Resolve the collision of initialized depth (y-position) @@ -66005,64 +66005,64 @@ function resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) { - var keyAttr = orient === 'vertical' ? 'x' : 'y'; - each(nodesByBreadth, function (nodes) { - nodes.sort(function (a, b) { - return a.getLayout()[keyAttr] - b.getLayout()[keyAttr]; - }); - var nodeX; - var node; - var dy; - var y0 = 0; - var n = nodes.length; - var nodeDyAttr = orient === 'vertical' ? 'dx' : 'dy'; + var keyAttr = orient === 'vertical' ? 'x' : 'y'; + each(nodesByBreadth, function (nodes) { + nodes.sort(function (a, b) { + return a.getLayout()[keyAttr] - b.getLayout()[keyAttr]; + }); + var nodeX; + var node; + var dy; + var y0 = 0; + var n = nodes.length; + var nodeDyAttr = orient === 'vertical' ? 'dx' : 'dy'; - for (var i = 0; i < n; i++) { - node = nodes[i]; - dy = y0 - node.getLayout()[keyAttr]; + for (var i = 0; i < n; i++) { + node = nodes[i]; + dy = y0 - node.getLayout()[keyAttr]; - if (dy > 0) { - nodeX = node.getLayout()[keyAttr] + dy; - orient === 'vertical' ? node.setLayout({ - x: nodeX - }, true) : node.setLayout({ - y: nodeX - }, true); - } + if (dy > 0) { + nodeX = node.getLayout()[keyAttr] + dy; + orient === 'vertical' ? node.setLayout({ + x: nodeX + }, true) : node.setLayout({ + y: nodeX + }, true); + } - y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap; - } + y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap; + } - var viewWidth = orient === 'vertical' ? width : height; // If the bottommost node goes outside the bounds, push it back up + var viewWidth = orient === 'vertical' ? width : height; // If the bottommost node goes outside the bounds, push it back up - dy = y0 - nodeGap - viewWidth; + dy = y0 - nodeGap - viewWidth; - if (dy > 0) { - nodeX = node.getLayout()[keyAttr] - dy; - orient === 'vertical' ? node.setLayout({ - x: nodeX - }, true) : node.setLayout({ - y: nodeX - }, true); - y0 = nodeX; - - for (var i = n - 2; i >= 0; --i) { - node = nodes[i]; - dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0; - - if (dy > 0) { - nodeX = node.getLayout()[keyAttr] - dy; - orient === 'vertical' ? node.setLayout({ - x: nodeX - }, true) : node.setLayout({ - y: nodeX - }, true); - } + if (dy > 0) { + nodeX = node.getLayout()[keyAttr] - dy; + orient === 'vertical' ? node.setLayout({ + x: nodeX + }, true) : node.setLayout({ + y: nodeX + }, true); + y0 = nodeX; - y0 = node.getLayout()[keyAttr]; - } + for (var i = n - 2; i >= 0; --i) { + node = nodes[i]; + dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0; + + if (dy > 0) { + nodeX = node.getLayout()[keyAttr] - dy; + orient === 'vertical' ? node.setLayout({ + x: nodeX + }, true) : node.setLayout({ + y: nodeX + }, true); } - }); + + y0 = node.getLayout()[keyAttr]; + } + } + }); } /** * Change the y-position of the nodes, except most the right side nodes @@ -66072,70 +66072,70 @@ function relaxRightToLeft(nodesByBreadth, alpha, orient) { - each(nodesByBreadth.slice().reverse(), function (nodes) { - each(nodes, function (node) { - if (node.outEdges.length) { - var y = sum(node.outEdges, weightedTarget, orient) / sum(node.outEdges, getEdgeValue); - - if (isNaN(y)) { - var len = node.outEdges.length; - y = len ? sum(node.outEdges, centerTarget, orient) / len : 0; - } + each(nodesByBreadth.slice().reverse(), function (nodes) { + each(nodes, function (node) { + if (node.outEdges.length) { + var y = sum(node.outEdges, weightedTarget, orient) / sum(node.outEdges, getEdgeValue); - if (orient === 'vertical') { - var nodeX = node.getLayout().x + (y - center$1(node, orient)) * alpha; - node.setLayout({ - x: nodeX - }, true); - } else { - var nodeY = node.getLayout().y + (y - center$1(node, orient)) * alpha; - node.setLayout({ - y: nodeY - }, true); - } - } - }); + if (isNaN(y)) { + var len = node.outEdges.length; + y = len ? sum(node.outEdges, centerTarget, orient) / len : 0; + } + + if (orient === 'vertical') { + var nodeX = node.getLayout().x + (y - center$1(node, orient)) * alpha; + node.setLayout({ + x: nodeX + }, true); + } else { + var nodeY = node.getLayout().y + (y - center$1(node, orient)) * alpha; + node.setLayout({ + y: nodeY + }, true); + } + } }); + }); } function weightedTarget(edge, orient) { - return center$1(edge.node2, orient) * edge.getValue(); + return center$1(edge.node2, orient) * edge.getValue(); } function centerTarget(edge, orient) { - return center$1(edge.node2, orient); + return center$1(edge.node2, orient); } function weightedSource(edge, orient) { - return center$1(edge.node1, orient) * edge.getValue(); + return center$1(edge.node1, orient) * edge.getValue(); } function centerSource(edge, orient) { - return center$1(edge.node1, orient); + return center$1(edge.node1, orient); } function center$1(node, orient) { - return orient === 'vertical' ? node.getLayout().x + node.getLayout().dx / 2 : node.getLayout().y + node.getLayout().dy / 2; + return orient === 'vertical' ? node.getLayout().x + node.getLayout().dx / 2 : node.getLayout().y + node.getLayout().dy / 2; } function getEdgeValue(edge) { - return edge.getValue(); + return edge.getValue(); } function sum(array, cb, orient) { - var sum = 0; - var len = array.length; - var i = -1; + var sum = 0; + var len = array.length; + var i = -1; - while (++i < len) { - var value = +cb(array[i], orient); + while (++i < len) { + var value = +cb(array[i], orient); - if (!isNaN(value)) { - sum += value; - } + if (!isNaN(value)) { + sum += value; } + } - return sum; + return sum; } /** * Change the y-position of the nodes, except most the left side nodes @@ -66143,30 +66143,30 @@ function relaxLeftToRight(nodesByBreadth, alpha, orient) { - each(nodesByBreadth, function (nodes) { - each(nodes, function (node) { - if (node.inEdges.length) { - var y = sum(node.inEdges, weightedSource, orient) / sum(node.inEdges, getEdgeValue); - - if (isNaN(y)) { - var len = node.inEdges.length; - y = len ? sum(node.inEdges, centerSource, orient) / len : 0; - } + each(nodesByBreadth, function (nodes) { + each(nodes, function (node) { + if (node.inEdges.length) { + var y = sum(node.inEdges, weightedSource, orient) / sum(node.inEdges, getEdgeValue); - if (orient === 'vertical') { - var nodeX = node.getLayout().x + (y - center$1(node, orient)) * alpha; - node.setLayout({ - x: nodeX - }, true); - } else { - var nodeY = node.getLayout().y + (y - center$1(node, orient)) * alpha; - node.setLayout({ - y: nodeY - }, true); - } - } - }); + if (isNaN(y)) { + var len = node.inEdges.length; + y = len ? sum(node.inEdges, centerSource, orient) / len : 0; + } + + if (orient === 'vertical') { + var nodeX = node.getLayout().x + (y - center$1(node, orient)) * alpha; + node.setLayout({ + x: nodeX + }, true); + } else { + var nodeY = node.getLayout().y + (y - center$1(node, orient)) * alpha; + node.setLayout({ + y: nodeY + }, true); + } + } }); + }); } /** * Compute the depth(y-position) of each edge @@ -66174,417 +66174,417 @@ function computeEdgeDepths(nodes, orient) { - var keyAttr = orient === 'vertical' ? 'x' : 'y'; - each(nodes, function (node) { - node.outEdges.sort(function (a, b) { - return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr]; - }); - node.inEdges.sort(function (a, b) { - return a.node1.getLayout()[keyAttr] - b.node1.getLayout()[keyAttr]; - }); + var keyAttr = orient === 'vertical' ? 'x' : 'y'; + each(nodes, function (node) { + node.outEdges.sort(function (a, b) { + return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr]; }); - each(nodes, function (node) { - var sy = 0; - var ty = 0; - each(node.outEdges, function (edge) { - edge.setLayout({ - sy: sy - }, true); - sy += edge.getLayout().dy; - }); - each(node.inEdges, function (edge) { - edge.setLayout({ - ty: ty - }, true); - ty += edge.getLayout().dy; - }); + node.inEdges.sort(function (a, b) { + return a.node1.getLayout()[keyAttr] - b.node1.getLayout()[keyAttr]; + }); + }); + each(nodes, function (node) { + var sy = 0; + var ty = 0; + each(node.outEdges, function (edge) { + edge.setLayout({ + sy: sy + }, true); + sy += edge.getLayout().dy; }); + each(node.inEdges, function (edge) { + edge.setLayout({ + ty: ty + }, true); + ty += edge.getLayout().dy; + }); + }); } function sankeyVisual(ecModel) { - ecModel.eachSeriesByType('sankey', function (seriesModel) { - var graph = seriesModel.getGraph(); - var nodes = graph.nodes; - - if (nodes.length) { - var minValue_1 = Infinity; - var maxValue_1 = -Infinity; - each(nodes, function (node) { - var nodeValue = node.getLayout().value; - - if (nodeValue < minValue_1) { - minValue_1 = nodeValue; - } + ecModel.eachSeriesByType('sankey', function (seriesModel) { + var graph = seriesModel.getGraph(); + var nodes = graph.nodes; - if (nodeValue > maxValue_1) { - maxValue_1 = nodeValue; - } - }); - each(nodes, function (node) { - var mapping = new VisualMapping({ - type: 'color', - mappingMethod: 'linear', - dataExtent: [minValue_1, maxValue_1], - visual: seriesModel.get('color') - }); - var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value); - var customColor = node.getModel().get(['itemStyle', 'color']); + if (nodes.length) { + var minValue_1 = Infinity; + var maxValue_1 = -Infinity; + each(nodes, function (node) { + var nodeValue = node.getLayout().value; - if (customColor != null) { - node.setVisual('color', customColor); - node.setVisual('style', { - fill: customColor - }); - } else { - node.setVisual('color', mapValueToColor); - node.setVisual('style', { - fill: mapValueToColor - }); - } - }); + if (nodeValue < minValue_1) { + minValue_1 = nodeValue; } - }); + + if (nodeValue > maxValue_1) { + maxValue_1 = nodeValue; + } + }); + each(nodes, function (node) { + var mapping = new VisualMapping({ + type: 'color', + mappingMethod: 'linear', + dataExtent: [minValue_1, maxValue_1], + visual: seriesModel.get('color') + }); + var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value); + var customColor = node.getModel().get(['itemStyle', 'color']); + + if (customColor != null) { + node.setVisual('color', customColor); + node.setVisual('style', { + fill: customColor + }); + } else { + node.setVisual('color', mapValueToColor); + node.setVisual('style', { + fill: mapValueToColor + }); + } + }); + } + }); } function install$i(registers) { - registers.registerChartView(SankeyView); - registers.registerSeriesModel(SankeySeriesModel); - registers.registerLayout(sankeyLayout); - registers.registerVisual(sankeyVisual); - registers.registerAction({ - type: 'dragNode', - event: 'dragnode', - // here can only use 'update' now, other value is not support in echarts. - update: 'update' - }, function (payload, ecModel) { - ecModel.eachComponent({ - mainType: 'series', - subType: 'sankey', - query: payload - }, function (seriesModel) { - seriesModel.setNodePosition(payload.dataIndex, [payload.localX, payload.localY]); - }); + registers.registerChartView(SankeyView); + registers.registerSeriesModel(SankeySeriesModel); + registers.registerLayout(sankeyLayout); + registers.registerVisual(sankeyVisual); + registers.registerAction({ + type: 'dragNode', + event: 'dragnode', + // here can only use 'update' now, other value is not support in echarts. + update: 'update' + }, function (payload, ecModel) { + ecModel.eachComponent({ + mainType: 'series', + subType: 'sankey', + query: payload + }, function (seriesModel) { + seriesModel.setNodePosition(payload.dataIndex, [payload.localX, payload.localY]); }); + }); } var WhiskerBoxCommonMixin = - /** @class */ - function () { - function WhiskerBoxCommonMixin() {} - /** - * @override - */ - - - WhiskerBoxCommonMixin.prototype.getInitialData = function (option, ecModel) { - // When both types of xAxis and yAxis are 'value', layout is - // needed to be specified by user. Otherwise, layout can be - // judged by which axis is category. - var ordinalMeta; - var xAxisModel = ecModel.getComponent('xAxis', this.get('xAxisIndex')); - var yAxisModel = ecModel.getComponent('yAxis', this.get('yAxisIndex')); - var xAxisType = xAxisModel.get('type'); - var yAxisType = yAxisModel.get('type'); - var addOrdinal; // FIXME - // Consider time axis. - - if (xAxisType === 'category') { - option.layout = 'horizontal'; - ordinalMeta = xAxisModel.getOrdinalMeta(); - addOrdinal = true; - } else if (yAxisType === 'category') { - option.layout = 'vertical'; - ordinalMeta = yAxisModel.getOrdinalMeta(); - addOrdinal = true; - } else { - option.layout = option.layout || 'horizontal'; - } - - var coordDims = ['x', 'y']; - var baseAxisDimIndex = option.layout === 'horizontal' ? 0 : 1; - var baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex]; - var otherAxisDim = coordDims[1 - baseAxisDimIndex]; - var axisModels = [xAxisModel, yAxisModel]; - var baseAxisType = axisModels[baseAxisDimIndex].get('type'); - var otherAxisType = axisModels[1 - baseAxisDimIndex].get('type'); - var data = option.data; // Clone a new data for next setOption({}) usage. - // Avoid modifying current data will affect further update. - - if (data && addOrdinal) { - var newOptionData_1 = []; - each(data, function (item, index) { - var newItem; - - if (isArray(item)) { - newItem = item.slice(); // Modify current using data. - - item.unshift(index); - } else if (isArray(item.value)) { - newItem = extend({}, item); - newItem.value = newItem.value.slice(); // Modify current using data. - - item.value.unshift(index); - } else { - newItem = item; - } - - newOptionData_1.push(newItem); - }); - option.data = newOptionData_1; - } - - var defaultValueDimensions = this.defaultValueDimensions; - var coordDimensions = [{ - name: baseAxisDim, - type: getDimensionTypeByAxis(baseAxisType), - ordinalMeta: ordinalMeta, - otherDims: { - tooltip: false, - itemName: 0 - }, - dimsDef: ['base'] - }, { - name: otherAxisDim, - type: getDimensionTypeByAxis(otherAxisType), - dimsDef: defaultValueDimensions.slice() - }]; - return createSeriesDataSimply(this, { - coordDimensions: coordDimensions, - dimensionsCount: defaultValueDimensions.length + 1, - encodeDefaulter: curry(makeSeriesEncodeForAxisCoordSys, coordDimensions, this) - }); - }; - /** - * If horizontal, base axis is x, otherwise y. - * @override - */ - + /** @class */ + function () { + function WhiskerBoxCommonMixin() {} + /** + * @override + */ - WhiskerBoxCommonMixin.prototype.getBaseAxis = function () { - var dim = this._baseAxisDim; - return this.ecModel.getComponent(dim + 'Axis', this.get(dim + 'AxisIndex')).axis; - }; - return WhiskerBoxCommonMixin; - }(); + WhiskerBoxCommonMixin.prototype.getInitialData = function (option, ecModel) { + // When both types of xAxis and yAxis are 'value', layout is + // needed to be specified by user. Otherwise, layout can be + // judged by which axis is category. + var ordinalMeta; + var xAxisModel = ecModel.getComponent('xAxis', this.get('xAxisIndex')); + var yAxisModel = ecModel.getComponent('yAxis', this.get('yAxisIndex')); + var xAxisType = xAxisModel.get('type'); + var yAxisType = yAxisModel.get('type'); + var addOrdinal; // FIXME + // Consider time axis. + + if (xAxisType === 'category') { + option.layout = 'horizontal'; + ordinalMeta = xAxisModel.getOrdinalMeta(); + addOrdinal = true; + } else if (yAxisType === 'category') { + option.layout = 'vertical'; + ordinalMeta = yAxisModel.getOrdinalMeta(); + addOrdinal = true; + } else { + option.layout = option.layout || 'horizontal'; + } - var BoxplotSeriesModel = - /** @class */ - function (_super) { - __extends(BoxplotSeriesModel, _super); + var coordDims = ['x', 'y']; + var baseAxisDimIndex = option.layout === 'horizontal' ? 0 : 1; + var baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex]; + var otherAxisDim = coordDims[1 - baseAxisDimIndex]; + var axisModels = [xAxisModel, yAxisModel]; + var baseAxisType = axisModels[baseAxisDimIndex].get('type'); + var otherAxisType = axisModels[1 - baseAxisDimIndex].get('type'); + var data = option.data; // Clone a new data for next setOption({}) usage. + // Avoid modifying current data will affect further update. + + if (data && addOrdinal) { + var newOptionData_1 = []; + each(data, function (item, index) { + var newItem; + + if (isArray(item)) { + newItem = item.slice(); // Modify current using data. + + item.unshift(index); + } else if (isArray(item.value)) { + newItem = extend({}, item); + newItem.value = newItem.value.slice(); // Modify current using data. + + item.value.unshift(index); + } else { + newItem = item; + } - function BoxplotSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + newOptionData_1.push(newItem); + }); + option.data = newOptionData_1; + } - _this.type = BoxplotSeriesModel.type; // TODO - // box width represents group size, so dimension should have 'size'. + var defaultValueDimensions = this.defaultValueDimensions; + var coordDimensions = [{ + name: baseAxisDim, + type: getDimensionTypeByAxis(baseAxisType), + ordinalMeta: ordinalMeta, + otherDims: { + tooltip: false, + itemName: 0 + }, + dimsDef: ['base'] + }, { + name: otherAxisDim, + type: getDimensionTypeByAxis(otherAxisType), + dimsDef: defaultValueDimensions.slice() + }]; + return createSeriesDataSimply(this, { + coordDimensions: coordDimensions, + dimensionsCount: defaultValueDimensions.length + 1, + encodeDefaulter: curry(makeSeriesEncodeForAxisCoordSys, coordDimensions, this) + }); + }; + /** + * If horizontal, base axis is x, otherwise y. + * @override + */ - /** - * @see - * The meanings of 'min' and 'max' depend on user, - * and echarts do not need to know it. - * @readOnly - */ - _this.defaultValueDimensions = [{ - name: 'min', - defaultTooltip: true - }, { - name: 'Q1', - defaultTooltip: true - }, { - name: 'median', - defaultTooltip: true - }, { - name: 'Q3', - defaultTooltip: true - }, { - name: 'max', - defaultTooltip: true - }]; - _this.visualDrawType = 'stroke'; - return _this; - } + WhiskerBoxCommonMixin.prototype.getBaseAxis = function () { + var dim = this._baseAxisDim; + return this.ecModel.getComponent(dim + 'Axis', this.get(dim + 'AxisIndex')).axis; + }; - BoxplotSeriesModel.type = 'series.boxplot'; - BoxplotSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid']; - BoxplotSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - coordinateSystem: 'cartesian2d', - legendHoverLink: true, - layout: null, - boxWidth: [7, 50], - itemStyle: { - color: '#fff', - borderWidth: 1 - }, - emphasis: { - scale: true, - itemStyle: { - borderWidth: 2, - shadowBlur: 5, - shadowOffsetX: 1, - shadowOffsetY: 1, - shadowColor: 'rgba(0,0,0,0.2)' - } - }, - animationDuration: 800 - }; - return BoxplotSeriesModel; - }(SeriesModel); + return WhiskerBoxCommonMixin; + }(); - mixin(BoxplotSeriesModel, WhiskerBoxCommonMixin, true); + var BoxplotSeriesModel = + /** @class */ + function (_super) { + __extends(BoxplotSeriesModel, _super); - var BoxplotView = - /** @class */ - function (_super) { - __extends(BoxplotView, _super); + function BoxplotSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - function BoxplotView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + _this.type = BoxplotSeriesModel.type; // TODO + // box width represents group size, so dimension should have 'size'. - _this.type = BoxplotView.type; - return _this; - } + /** + * @see + * The meanings of 'min' and 'max' depend on user, + * and echarts do not need to know it. + * @readOnly + */ - BoxplotView.prototype.render = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - var group = this.group; - var oldData = this._data; // There is no old data only when first rendering or switching from - // stream mode to normal mode, where previous elements should be removed. + _this.defaultValueDimensions = [{ + name: 'min', + defaultTooltip: true + }, { + name: 'Q1', + defaultTooltip: true + }, { + name: 'median', + defaultTooltip: true + }, { + name: 'Q3', + defaultTooltip: true + }, { + name: 'max', + defaultTooltip: true + }]; + _this.visualDrawType = 'stroke'; + return _this; + } - if (!this._data) { - group.removeAll(); - } + BoxplotSeriesModel.type = 'series.boxplot'; + BoxplotSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid']; + BoxplotSeriesModel.defaultOption = { + // zlevel: 0, + z: 2, + coordinateSystem: 'cartesian2d', + legendHoverLink: true, + layout: null, + boxWidth: [7, 50], + itemStyle: { + color: '#fff', + borderWidth: 1 + }, + emphasis: { + scale: true, + itemStyle: { + borderWidth: 2, + shadowBlur: 5, + shadowOffsetX: 1, + shadowOffsetY: 1, + shadowColor: 'rgba(0,0,0,0.2)' + } + }, + animationDuration: 800 + }; + return BoxplotSeriesModel; + }(SeriesModel); - var constDim = seriesModel.get('layout') === 'horizontal' ? 1 : 0; - data.diff(oldData).add(function (newIdx) { - if (data.hasValue(newIdx)) { - var itemLayout = data.getItemLayout(newIdx); - var symbolEl = createNormalBox(itemLayout, data, newIdx, constDim, true); - data.setItemGraphicEl(newIdx, symbolEl); - group.add(symbolEl); - } - }).update(function (newIdx, oldIdx) { - var symbolEl = oldData.getItemGraphicEl(oldIdx); // Empty data + mixin(BoxplotSeriesModel, WhiskerBoxCommonMixin, true); - if (!data.hasValue(newIdx)) { - group.remove(symbolEl); - return; - } + var BoxplotView = + /** @class */ + function (_super) { + __extends(BoxplotView, _super); - var itemLayout = data.getItemLayout(newIdx); + function BoxplotView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - if (!symbolEl) { - symbolEl = createNormalBox(itemLayout, data, newIdx, constDim); - } else { - saveOldStyle(symbolEl); - updateNormalBoxData(itemLayout, symbolEl, data, newIdx); - } + _this.type = BoxplotView.type; + return _this; + } - group.add(symbolEl); - data.setItemGraphicEl(newIdx, symbolEl); - }).remove(function (oldIdx) { - var el = oldData.getItemGraphicEl(oldIdx); - el && group.remove(el); - }).execute(); - this._data = data; - }; + BoxplotView.prototype.render = function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); + var group = this.group; + var oldData = this._data; // There is no old data only when first rendering or switching from + // stream mode to normal mode, where previous elements should be removed. + + if (!this._data) { + group.removeAll(); + } + + var constDim = seriesModel.get('layout') === 'horizontal' ? 1 : 0; + data.diff(oldData).add(function (newIdx) { + if (data.hasValue(newIdx)) { + var itemLayout = data.getItemLayout(newIdx); + var symbolEl = createNormalBox(itemLayout, data, newIdx, constDim, true); + data.setItemGraphicEl(newIdx, symbolEl); + group.add(symbolEl); + } + }).update(function (newIdx, oldIdx) { + var symbolEl = oldData.getItemGraphicEl(oldIdx); // Empty data - BoxplotView.prototype.remove = function (ecModel) { - var group = this.group; - var data = this._data; - this._data = null; - data && data.eachItemGraphicEl(function (el) { - el && group.remove(el); - }); - }; + if (!data.hasValue(newIdx)) { + group.remove(symbolEl); + return; + } + + var itemLayout = data.getItemLayout(newIdx); + + if (!symbolEl) { + symbolEl = createNormalBox(itemLayout, data, newIdx, constDim); + } else { + saveOldStyle(symbolEl); + updateNormalBoxData(itemLayout, symbolEl, data, newIdx); + } + + group.add(symbolEl); + data.setItemGraphicEl(newIdx, symbolEl); + }).remove(function (oldIdx) { + var el = oldData.getItemGraphicEl(oldIdx); + el && group.remove(el); + }).execute(); + this._data = data; + }; + + BoxplotView.prototype.remove = function (ecModel) { + var group = this.group; + var data = this._data; + this._data = null; + data && data.eachItemGraphicEl(function (el) { + el && group.remove(el); + }); + }; - BoxplotView.type = 'boxplot'; - return BoxplotView; - }(ChartView); + BoxplotView.type = 'boxplot'; + return BoxplotView; + }(ChartView); var BoxPathShape = - /** @class */ - function () { - function BoxPathShape() {} + /** @class */ + function () { + function BoxPathShape() {} - return BoxPathShape; - }(); + return BoxPathShape; + }(); var BoxPath = - /** @class */ - function (_super) { - __extends(BoxPath, _super); + /** @class */ + function (_super) { + __extends(BoxPath, _super); - function BoxPath(opts) { - var _this = _super.call(this, opts) || this; + function BoxPath(opts) { + var _this = _super.call(this, opts) || this; - _this.type = 'boxplotBoxPath'; - return _this; - } + _this.type = 'boxplotBoxPath'; + return _this; + } - BoxPath.prototype.getDefaultShape = function () { - return new BoxPathShape(); - }; + BoxPath.prototype.getDefaultShape = function () { + return new BoxPathShape(); + }; - BoxPath.prototype.buildPath = function (ctx, shape) { - var ends = shape.points; - var i = 0; - ctx.moveTo(ends[i][0], ends[i][1]); - i++; + BoxPath.prototype.buildPath = function (ctx, shape) { + var ends = shape.points; + var i = 0; + ctx.moveTo(ends[i][0], ends[i][1]); + i++; - for (; i < 4; i++) { - ctx.lineTo(ends[i][0], ends[i][1]); - } + for (; i < 4; i++) { + ctx.lineTo(ends[i][0], ends[i][1]); + } - ctx.closePath(); + ctx.closePath(); - for (; i < ends.length; i++) { - ctx.moveTo(ends[i][0], ends[i][1]); - i++; - ctx.lineTo(ends[i][0], ends[i][1]); - } - }; + for (; i < ends.length; i++) { + ctx.moveTo(ends[i][0], ends[i][1]); + i++; + ctx.lineTo(ends[i][0], ends[i][1]); + } + }; - return BoxPath; - }(Path); + return BoxPath; + }(Path); function createNormalBox(itemLayout, data, dataIndex, constDim, isInit) { - var ends = itemLayout.ends; - var el = new BoxPath({ - shape: { - points: isInit ? transInit(ends, constDim, itemLayout) : ends - } - }); - updateNormalBoxData(itemLayout, el, data, dataIndex, isInit); - return el; + var ends = itemLayout.ends; + var el = new BoxPath({ + shape: { + points: isInit ? transInit(ends, constDim, itemLayout) : ends + } + }); + updateNormalBoxData(itemLayout, el, data, dataIndex, isInit); + return el; } function updateNormalBoxData(itemLayout, el, data, dataIndex, isInit) { - var seriesModel = data.hostModel; - var updateMethod = graphic[isInit ? 'initProps' : 'updateProps']; - updateMethod(el, { - shape: { - points: itemLayout.ends - } - }, seriesModel, dataIndex); - el.useStyle(data.getItemVisual(dataIndex, 'style')); - el.style.strokeNoScale = true; - el.z2 = 100; - var itemModel = data.getItemModel(dataIndex); - var emphasisModel = itemModel.getModel('emphasis'); - setStatesStylesFromModel(el, itemModel); - toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); + var seriesModel = data.hostModel; + var updateMethod = graphic[isInit ? 'initProps' : 'updateProps']; + updateMethod(el, { + shape: { + points: itemLayout.ends + } + }, seriesModel, dataIndex); + el.useStyle(data.getItemVisual(dataIndex, 'style')); + el.style.strokeNoScale = true; + el.z2 = 100; + var itemModel = data.getItemModel(dataIndex); + var emphasisModel = itemModel.getModel('emphasis'); + setStatesStylesFromModel(el, itemModel); + toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); } function transInit(points, dim, itemLayout) { - return map(points, function (point) { - point = point.slice(); - point[dim] = itemLayout.initBaseline; - return point; - }); + return map(points, function (point) { + point = point.slice(); + point[dim] = itemLayout.initBaseline; + return point; + }); } /* @@ -66633,43 +66633,43 @@ var each$6 = each; function boxplotLayout(ecModel) { - var groupResult = groupSeriesByAxis(ecModel); - each$6(groupResult, function (groupItem) { - var seriesModels = groupItem.seriesModels; + var groupResult = groupSeriesByAxis(ecModel); + each$6(groupResult, function (groupItem) { + var seriesModels = groupItem.seriesModels; - if (!seriesModels.length) { - return; - } + if (!seriesModels.length) { + return; + } - calculateBase(groupItem); - each$6(seriesModels, function (seriesModel, idx) { - layoutSingleSeries(seriesModel, groupItem.boxOffsetList[idx], groupItem.boxWidthList[idx]); - }); + calculateBase(groupItem); + each$6(seriesModels, function (seriesModel, idx) { + layoutSingleSeries(seriesModel, groupItem.boxOffsetList[idx], groupItem.boxWidthList[idx]); }); + }); } /** * Group series by axis. */ function groupSeriesByAxis(ecModel) { - var result = []; - var axisList = []; - ecModel.eachSeriesByType('boxplot', function (seriesModel) { - var baseAxis = seriesModel.getBaseAxis(); - var idx = indexOf(axisList, baseAxis); + var result = []; + var axisList = []; + ecModel.eachSeriesByType('boxplot', function (seriesModel) { + var baseAxis = seriesModel.getBaseAxis(); + var idx = indexOf(axisList, baseAxis); - if (idx < 0) { - idx = axisList.length; - axisList[idx] = baseAxis; - result[idx] = { - axis: baseAxis, - seriesModels: [] - }; - } + if (idx < 0) { + idx = axisList.length; + axisList[idx] = baseAxis; + result[idx] = { + axis: baseAxis, + seriesModels: [] + }; + } - result[idx].seriesModels.push(seriesModel); - }); - return result; + result[idx].seriesModels.push(seriesModel); + }); + return result; } /** * Calculate offset and box width for each series. @@ -66677,43 +66677,43 @@ function calculateBase(groupItem) { - var baseAxis = groupItem.axis; - var seriesModels = groupItem.seriesModels; - var seriesCount = seriesModels.length; - var boxWidthList = groupItem.boxWidthList = []; - var boxOffsetList = groupItem.boxOffsetList = []; - var boundList = []; - var bandWidth; - - if (baseAxis.type === 'category') { - bandWidth = baseAxis.getBandWidth(); - } else { - var maxDataCount_1 = 0; - each$6(seriesModels, function (seriesModel) { - maxDataCount_1 = Math.max(maxDataCount_1, seriesModel.getData().count()); - }); - var extent = baseAxis.getExtent(); - bandWidth = Math.abs(extent[1] - extent[0]) / maxDataCount_1; - } - + var baseAxis = groupItem.axis; + var seriesModels = groupItem.seriesModels; + var seriesCount = seriesModels.length; + var boxWidthList = groupItem.boxWidthList = []; + var boxOffsetList = groupItem.boxOffsetList = []; + var boundList = []; + var bandWidth; + + if (baseAxis.type === 'category') { + bandWidth = baseAxis.getBandWidth(); + } else { + var maxDataCount_1 = 0; each$6(seriesModels, function (seriesModel) { - var boxWidthBound = seriesModel.get('boxWidth'); + maxDataCount_1 = Math.max(maxDataCount_1, seriesModel.getData().count()); + }); + var extent = baseAxis.getExtent(); + bandWidth = Math.abs(extent[1] - extent[0]) / maxDataCount_1; + } - if (!isArray(boxWidthBound)) { - boxWidthBound = [boxWidthBound, boxWidthBound]; - } + each$6(seriesModels, function (seriesModel) { + var boxWidthBound = seriesModel.get('boxWidth'); - boundList.push([parsePercent$1(boxWidthBound[0], bandWidth) || 0, parsePercent$1(boxWidthBound[1], bandWidth) || 0]); - }); - var availableWidth = bandWidth * 0.8 - 2; - var boxGap = availableWidth / seriesCount * 0.3; - var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount; - var base = boxWidth / 2 - availableWidth / 2; - each$6(seriesModels, function (seriesModel, idx) { - boxOffsetList.push(base); - base += boxGap + boxWidth; - boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1])); - }); + if (!isArray(boxWidthBound)) { + boxWidthBound = [boxWidthBound, boxWidthBound]; + } + + boundList.push([parsePercent$1(boxWidthBound[0], bandWidth) || 0, parsePercent$1(boxWidthBound[1], bandWidth) || 0]); + }); + var availableWidth = bandWidth * 0.8 - 2; + var boxGap = availableWidth / seriesCount * 0.3; + var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount; + var base = boxWidth / 2 - availableWidth / 2; + each$6(seriesModels, function (seriesModel, idx) { + boxOffsetList.push(base); + base += boxGap + boxWidth; + boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1])); + }); } /** * Calculate points location for each series. @@ -66721,71 +66721,71 @@ function layoutSingleSeries(seriesModel, offset, boxWidth) { - var coordSys = seriesModel.coordinateSystem; - var data = seriesModel.getData(); - var halfWidth = boxWidth / 2; - var cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1; - var vDimIdx = 1 - cDimIdx; - var coordDims = ['x', 'y']; - var cDim = data.mapDimension(coordDims[cDimIdx]); - var vDims = data.mapDimensionsAll(coordDims[vDimIdx]); + var coordSys = seriesModel.coordinateSystem; + var data = seriesModel.getData(); + var halfWidth = boxWidth / 2; + var cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1; + var vDimIdx = 1 - cDimIdx; + var coordDims = ['x', 'y']; + var cDim = data.mapDimension(coordDims[cDimIdx]); + var vDims = data.mapDimensionsAll(coordDims[vDimIdx]); + + if (cDim == null || vDims.length < 5) { + return; + } + + for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) { + var axisDimVal = data.get(cDim, dataIndex); + var median = getPoint(axisDimVal, vDims[2], dataIndex); + var end1 = getPoint(axisDimVal, vDims[0], dataIndex); + var end2 = getPoint(axisDimVal, vDims[1], dataIndex); + var end4 = getPoint(axisDimVal, vDims[3], dataIndex); + var end5 = getPoint(axisDimVal, vDims[4], dataIndex); + var ends = []; + addBodyEnd(ends, end2, false); + addBodyEnd(ends, end4, true); + ends.push(end1, end2, end5, end4); + layEndLine(ends, end1); + layEndLine(ends, end5); + layEndLine(ends, median); + data.setItemLayout(dataIndex, { + initBaseline: median[vDimIdx], + ends: ends + }); + } - if (cDim == null || vDims.length < 5) { - return; - } + function getPoint(axisDimVal, dim, dataIndex) { + var val = data.get(dim, dataIndex); + var p = []; + p[cDimIdx] = axisDimVal; + p[vDimIdx] = val; + var point; - for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) { - var axisDimVal = data.get(cDim, dataIndex); - var median = getPoint(axisDimVal, vDims[2], dataIndex); - var end1 = getPoint(axisDimVal, vDims[0], dataIndex); - var end2 = getPoint(axisDimVal, vDims[1], dataIndex); - var end4 = getPoint(axisDimVal, vDims[3], dataIndex); - var end5 = getPoint(axisDimVal, vDims[4], dataIndex); - var ends = []; - addBodyEnd(ends, end2, false); - addBodyEnd(ends, end4, true); - ends.push(end1, end2, end5, end4); - layEndLine(ends, end1); - layEndLine(ends, end5); - layEndLine(ends, median); - data.setItemLayout(dataIndex, { - initBaseline: median[vDimIdx], - ends: ends - }); + if (isNaN(axisDimVal) || isNaN(val)) { + point = [NaN, NaN]; + } else { + point = coordSys.dataToPoint(p); + point[cDimIdx] += offset; } - function getPoint(axisDimVal, dim, dataIndex) { - var val = data.get(dim, dataIndex); - var p = []; - p[cDimIdx] = axisDimVal; - p[vDimIdx] = val; - var point; - - if (isNaN(axisDimVal) || isNaN(val)) { - point = [NaN, NaN]; - } else { - point = coordSys.dataToPoint(p); - point[cDimIdx] += offset; - } - - return point; - } + return point; + } - function addBodyEnd(ends, point, start) { - var point1 = point.slice(); - var point2 = point.slice(); - point1[cDimIdx] += halfWidth; - point2[cDimIdx] -= halfWidth; - start ? ends.push(point1, point2) : ends.push(point2, point1); - } + function addBodyEnd(ends, point, start) { + var point1 = point.slice(); + var point2 = point.slice(); + point1[cDimIdx] += halfWidth; + point2[cDimIdx] -= halfWidth; + start ? ends.push(point1, point2) : ends.push(point2, point1); + } - function layEndLine(ends, endCenter) { - var from = endCenter.slice(); - var to = endCenter.slice(); - from[cDimIdx] -= halfWidth; - to[cDimIdx] += halfWidth; - ends.push(from, to); - } + function layEndLine(ends, endCenter) { + var from = endCenter.slice(); + var to = endCenter.slice(); + from[cDimIdx] -= halfWidth; + to[cDimIdx] += halfWidth; + ends.push(from, to); + } } /** @@ -66807,503 +66807,503 @@ */ function prepareBoxplotData(rawData, opt) { - opt = opt || {}; - var boxData = []; - var outliers = []; - var boundIQR = opt.boundIQR; - var useExtreme = boundIQR === 'none' || boundIQR === 0; - - for (var i = 0; i < rawData.length; i++) { - var ascList = asc(rawData[i].slice()); - var Q1 = quantile(ascList, 0.25); - var Q2 = quantile(ascList, 0.5); - var Q3 = quantile(ascList, 0.75); - var min = ascList[0]; - var max = ascList[ascList.length - 1]; - var bound = (boundIQR == null ? 1.5 : boundIQR) * (Q3 - Q1); - var low = useExtreme ? min : Math.max(min, Q1 - bound); - var high = useExtreme ? max : Math.min(max, Q3 + bound); - var itemNameFormatter = opt.itemNameFormatter; - var itemName = isFunction(itemNameFormatter) ? itemNameFormatter({ - value: i - }) : isString(itemNameFormatter) ? itemNameFormatter.replace('{value}', i + '') : i + ''; - boxData.push([itemName, low, Q1, Q2, Q3, high]); - - for (var j = 0; j < ascList.length; j++) { - var dataItem = ascList[j]; - - if (dataItem < low || dataItem > high) { - var outlier = [itemName, dataItem]; - outliers.push(outlier); - } - } - } - - return { - boxData: boxData, - outliers: outliers - }; + opt = opt || {}; + var boxData = []; + var outliers = []; + var boundIQR = opt.boundIQR; + var useExtreme = boundIQR === 'none' || boundIQR === 0; + + for (var i = 0; i < rawData.length; i++) { + var ascList = asc(rawData[i].slice()); + var Q1 = quantile(ascList, 0.25); + var Q2 = quantile(ascList, 0.5); + var Q3 = quantile(ascList, 0.75); + var min = ascList[0]; + var max = ascList[ascList.length - 1]; + var bound = (boundIQR == null ? 1.5 : boundIQR) * (Q3 - Q1); + var low = useExtreme ? min : Math.max(min, Q1 - bound); + var high = useExtreme ? max : Math.min(max, Q3 + bound); + var itemNameFormatter = opt.itemNameFormatter; + var itemName = isFunction(itemNameFormatter) ? itemNameFormatter({ + value: i + }) : isString(itemNameFormatter) ? itemNameFormatter.replace('{value}', i + '') : i + ''; + boxData.push([itemName, low, Q1, Q2, Q3, high]); + + for (var j = 0; j < ascList.length; j++) { + var dataItem = ascList[j]; + + if (dataItem < low || dataItem > high) { + var outlier = [itemName, dataItem]; + outliers.push(outlier); + } + } + } + + return { + boxData: boxData, + outliers: outliers + }; } var boxplotTransform = { - type: 'echarts:boxplot', - transform: function transform(params) { - var upstream = params.upstream; - - if (upstream.sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS) { - var errMsg = ''; + type: 'echarts:boxplot', + transform: function transform(params) { + var upstream = params.upstream; - if ("development" !== 'production') { - errMsg = makePrintable('source data is not applicable for this boxplot transform. Expect number[][].'); - } + if (upstream.sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS) { + var errMsg = ''; - throwError(errMsg); - } + if ("development" !== 'production') { + errMsg = makePrintable('source data is not applicable for this boxplot transform. Expect number[][].'); + } - var result = prepareBoxplotData(upstream.getRawData(), params.config); - return [{ - dimensions: ['ItemName', 'Low', 'Q1', 'Q2', 'Q3', 'High'], - data: result.boxData - }, { - data: result.outliers - }]; + throwError(errMsg); } + + var result = prepareBoxplotData(upstream.getRawData(), params.config); + return [{ + dimensions: ['ItemName', 'Low', 'Q1', 'Q2', 'Q3', 'High'], + data: result.boxData + }, { + data: result.outliers + }]; + } }; function install$j(registers) { - registers.registerSeriesModel(BoxplotSeriesModel); - registers.registerChartView(BoxplotView); - registers.registerVisual(boxplotVisual); - registers.registerLayout(boxplotLayout); - registers.registerTransform(boxplotTransform); + registers.registerSeriesModel(BoxplotSeriesModel); + registers.registerChartView(BoxplotView); + registers.registerVisual(boxplotVisual); + registers.registerLayout(boxplotLayout); + registers.registerTransform(boxplotTransform); } var SKIP_PROPS = ['color', 'borderColor']; var CandlestickView = - /** @class */ - function (_super) { - __extends(CandlestickView, _super); - - function CandlestickView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + /** @class */ + function (_super) { + __extends(CandlestickView, _super); - _this.type = CandlestickView.type; - return _this; - } + function CandlestickView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - CandlestickView.prototype.render = function (seriesModel, ecModel, api) { - // If there is clipPath created in large mode. Remove it. - this.group.removeClipPath(); // Clear previously rendered progressive elements. + _this.type = CandlestickView.type; + return _this; + } - this._progressiveEls = null; + CandlestickView.prototype.render = function (seriesModel, ecModel, api) { + // If there is clipPath created in large mode. Remove it. + this.group.removeClipPath(); // Clear previously rendered progressive elements. - this._updateDrawMode(seriesModel); + this._progressiveEls = null; - this._isLargeDraw ? this._renderLarge(seriesModel) : this._renderNormal(seriesModel); - }; + this._updateDrawMode(seriesModel); - CandlestickView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) { - this._clear(); + this._isLargeDraw ? this._renderLarge(seriesModel) : this._renderNormal(seriesModel); + }; - this._updateDrawMode(seriesModel); - }; + CandlestickView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) { + this._clear(); - CandlestickView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) { - this._progressiveEls = []; - this._isLargeDraw ? this._incrementalRenderLarge(params, seriesModel) : this._incrementalRenderNormal(params, seriesModel); - }; + this._updateDrawMode(seriesModel); + }; - CandlestickView.prototype.eachRendered = function (cb) { - traverseElements(this._progressiveEls || this.group, cb); - }; + CandlestickView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) { + this._progressiveEls = []; + this._isLargeDraw ? this._incrementalRenderLarge(params, seriesModel) : this._incrementalRenderNormal(params, seriesModel); + }; - CandlestickView.prototype._updateDrawMode = function (seriesModel) { - var isLargeDraw = seriesModel.pipelineContext.large; + CandlestickView.prototype.eachRendered = function (cb) { + traverseElements(this._progressiveEls || this.group, cb); + }; - if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) { - this._isLargeDraw = isLargeDraw; + CandlestickView.prototype._updateDrawMode = function (seriesModel) { + var isLargeDraw = seriesModel.pipelineContext.large; - this._clear(); - } - }; + if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) { + this._isLargeDraw = isLargeDraw; - CandlestickView.prototype._renderNormal = function (seriesModel) { - var data = seriesModel.getData(); - var oldData = this._data; - var group = this.group; - var isSimpleBox = data.getLayout('isSimpleBox'); - var needsClip = seriesModel.get('clip', true); - var coord = seriesModel.coordinateSystem; - var clipArea = coord.getArea && coord.getArea(); // There is no old data only when first rendering or switching from - // stream mode to normal mode, where previous elements should be removed. + this._clear(); + } + }; - if (!this._data) { - group.removeAll(); - } + CandlestickView.prototype._renderNormal = function (seriesModel) { + var data = seriesModel.getData(); + var oldData = this._data; + var group = this.group; + var isSimpleBox = data.getLayout('isSimpleBox'); + var needsClip = seriesModel.get('clip', true); + var coord = seriesModel.coordinateSystem; + var clipArea = coord.getArea && coord.getArea(); // There is no old data only when first rendering or switching from + // stream mode to normal mode, where previous elements should be removed. - data.diff(oldData).add(function (newIdx) { - if (data.hasValue(newIdx)) { - var itemLayout = data.getItemLayout(newIdx); + if (!this._data) { + group.removeAll(); + } - if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) { - return; - } + data.diff(oldData).add(function (newIdx) { + if (data.hasValue(newIdx)) { + var itemLayout = data.getItemLayout(newIdx); - var el = createNormalBox$1(itemLayout, newIdx, true); - initProps(el, { - shape: { - points: itemLayout.ends - } - }, seriesModel, newIdx); - setBoxCommon(el, data, newIdx, isSimpleBox); - group.add(el); - data.setItemGraphicEl(newIdx, el); - } - }).update(function (newIdx, oldIdx) { - var el = oldData.getItemGraphicEl(oldIdx); // Empty data + if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) { + return; + } - if (!data.hasValue(newIdx)) { - group.remove(el); - return; - } + var el = createNormalBox$1(itemLayout, newIdx, true); + initProps(el, { + shape: { + points: itemLayout.ends + } + }, seriesModel, newIdx); + setBoxCommon(el, data, newIdx, isSimpleBox); + group.add(el); + data.setItemGraphicEl(newIdx, el); + } + }).update(function (newIdx, oldIdx) { + var el = oldData.getItemGraphicEl(oldIdx); // Empty data - var itemLayout = data.getItemLayout(newIdx); + if (!data.hasValue(newIdx)) { + group.remove(el); + return; + } - if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) { - group.remove(el); - return; - } + var itemLayout = data.getItemLayout(newIdx); - if (!el) { - el = createNormalBox$1(itemLayout); - } else { - updateProps(el, { - shape: { - points: itemLayout.ends - } - }, seriesModel, newIdx); - saveOldStyle(el); - } + if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) { + group.remove(el); + return; + } - setBoxCommon(el, data, newIdx, isSimpleBox); - group.add(el); - data.setItemGraphicEl(newIdx, el); - }).remove(function (oldIdx) { - var el = oldData.getItemGraphicEl(oldIdx); - el && group.remove(el); - }).execute(); - this._data = data; - }; + if (!el) { + el = createNormalBox$1(itemLayout); + } else { + updateProps(el, { + shape: { + points: itemLayout.ends + } + }, seriesModel, newIdx); + saveOldStyle(el); + } + + setBoxCommon(el, data, newIdx, isSimpleBox); + group.add(el); + data.setItemGraphicEl(newIdx, el); + }).remove(function (oldIdx) { + var el = oldData.getItemGraphicEl(oldIdx); + el && group.remove(el); + }).execute(); + this._data = data; + }; - CandlestickView.prototype._renderLarge = function (seriesModel) { - this._clear(); + CandlestickView.prototype._renderLarge = function (seriesModel) { + this._clear(); - createLarge$1(seriesModel, this.group); - var clipPath = seriesModel.get('clip', true) ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) : null; + createLarge$1(seriesModel, this.group); + var clipPath = seriesModel.get('clip', true) ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) : null; - if (clipPath) { - this.group.setClipPath(clipPath); - } else { - this.group.removeClipPath(); - } - }; + if (clipPath) { + this.group.setClipPath(clipPath); + } else { + this.group.removeClipPath(); + } + }; - CandlestickView.prototype._incrementalRenderNormal = function (params, seriesModel) { - var data = seriesModel.getData(); - var isSimpleBox = data.getLayout('isSimpleBox'); - var dataIndex; + CandlestickView.prototype._incrementalRenderNormal = function (params, seriesModel) { + var data = seriesModel.getData(); + var isSimpleBox = data.getLayout('isSimpleBox'); + var dataIndex; - while ((dataIndex = params.next()) != null) { - var itemLayout = data.getItemLayout(dataIndex); - var el = createNormalBox$1(itemLayout); - setBoxCommon(el, data, dataIndex, isSimpleBox); - el.incremental = true; - this.group.add(el); + while ((dataIndex = params.next()) != null) { + var itemLayout = data.getItemLayout(dataIndex); + var el = createNormalBox$1(itemLayout); + setBoxCommon(el, data, dataIndex, isSimpleBox); + el.incremental = true; + this.group.add(el); - this._progressiveEls.push(el); - } - }; + this._progressiveEls.push(el); + } + }; - CandlestickView.prototype._incrementalRenderLarge = function (params, seriesModel) { - createLarge$1(seriesModel, this.group, this._progressiveEls, true); - }; + CandlestickView.prototype._incrementalRenderLarge = function (params, seriesModel) { + createLarge$1(seriesModel, this.group, this._progressiveEls, true); + }; - CandlestickView.prototype.remove = function (ecModel) { - this._clear(); - }; + CandlestickView.prototype.remove = function (ecModel) { + this._clear(); + }; - CandlestickView.prototype._clear = function () { - this.group.removeAll(); - this._data = null; - }; + CandlestickView.prototype._clear = function () { + this.group.removeAll(); + this._data = null; + }; - CandlestickView.type = 'candlestick'; - return CandlestickView; - }(ChartView); + CandlestickView.type = 'candlestick'; + return CandlestickView; + }(ChartView); var NormalBoxPathShape = - /** @class */ - function () { - function NormalBoxPathShape() {} + /** @class */ + function () { + function NormalBoxPathShape() {} - return NormalBoxPathShape; - }(); + return NormalBoxPathShape; + }(); var NormalBoxPath = - /** @class */ - function (_super) { - __extends(NormalBoxPath, _super); + /** @class */ + function (_super) { + __extends(NormalBoxPath, _super); - function NormalBoxPath(opts) { - var _this = _super.call(this, opts) || this; + function NormalBoxPath(opts) { + var _this = _super.call(this, opts) || this; - _this.type = 'normalCandlestickBox'; - return _this; - } + _this.type = 'normalCandlestickBox'; + return _this; + } - NormalBoxPath.prototype.getDefaultShape = function () { - return new NormalBoxPathShape(); - }; + NormalBoxPath.prototype.getDefaultShape = function () { + return new NormalBoxPathShape(); + }; - NormalBoxPath.prototype.buildPath = function (ctx, shape) { - var ends = shape.points; + NormalBoxPath.prototype.buildPath = function (ctx, shape) { + var ends = shape.points; - if (this.__simpleBox) { - ctx.moveTo(ends[4][0], ends[4][1]); - ctx.lineTo(ends[6][0], ends[6][1]); - } else { - ctx.moveTo(ends[0][0], ends[0][1]); - ctx.lineTo(ends[1][0], ends[1][1]); - ctx.lineTo(ends[2][0], ends[2][1]); - ctx.lineTo(ends[3][0], ends[3][1]); - ctx.closePath(); - ctx.moveTo(ends[4][0], ends[4][1]); - ctx.lineTo(ends[5][0], ends[5][1]); - ctx.moveTo(ends[6][0], ends[6][1]); - ctx.lineTo(ends[7][0], ends[7][1]); - } - }; + if (this.__simpleBox) { + ctx.moveTo(ends[4][0], ends[4][1]); + ctx.lineTo(ends[6][0], ends[6][1]); + } else { + ctx.moveTo(ends[0][0], ends[0][1]); + ctx.lineTo(ends[1][0], ends[1][1]); + ctx.lineTo(ends[2][0], ends[2][1]); + ctx.lineTo(ends[3][0], ends[3][1]); + ctx.closePath(); + ctx.moveTo(ends[4][0], ends[4][1]); + ctx.lineTo(ends[5][0], ends[5][1]); + ctx.moveTo(ends[6][0], ends[6][1]); + ctx.lineTo(ends[7][0], ends[7][1]); + } + }; - return NormalBoxPath; - }(Path); + return NormalBoxPath; + }(Path); function createNormalBox$1(itemLayout, dataIndex, isInit) { - var ends = itemLayout.ends; - return new NormalBoxPath({ - shape: { - points: isInit ? transInit$1(ends, itemLayout) : ends - }, - z2: 100 - }); + var ends = itemLayout.ends; + return new NormalBoxPath({ + shape: { + points: isInit ? transInit$1(ends, itemLayout) : ends + }, + z2: 100 + }); } function isNormalBoxClipped(clipArea, itemLayout) { - var clipped = true; + var clipped = true; - for (var i = 0; i < itemLayout.ends.length; i++) { - // If any point are in the region. - if (clipArea.contain(itemLayout.ends[i][0], itemLayout.ends[i][1])) { - clipped = false; - break; - } + for (var i = 0; i < itemLayout.ends.length; i++) { + // If any point are in the region. + if (clipArea.contain(itemLayout.ends[i][0], itemLayout.ends[i][1])) { + clipped = false; + break; } + } - return clipped; + return clipped; } function setBoxCommon(el, data, dataIndex, isSimpleBox) { - var itemModel = data.getItemModel(dataIndex); - el.useStyle(data.getItemVisual(dataIndex, 'style')); - el.style.strokeNoScale = true; - el.__simpleBox = isSimpleBox; - setStatesStylesFromModel(el, itemModel); + var itemModel = data.getItemModel(dataIndex); + el.useStyle(data.getItemVisual(dataIndex, 'style')); + el.style.strokeNoScale = true; + el.__simpleBox = isSimpleBox; + setStatesStylesFromModel(el, itemModel); } function transInit$1(points, itemLayout) { - return map(points, function (point) { - point = point.slice(); - point[1] = itemLayout.initBaseline; - return point; - }); + return map(points, function (point) { + point = point.slice(); + point[1] = itemLayout.initBaseline; + return point; + }); } var LargeBoxPathShape = - /** @class */ - function () { - function LargeBoxPathShape() {} + /** @class */ + function () { + function LargeBoxPathShape() {} - return LargeBoxPathShape; - }(); + return LargeBoxPathShape; + }(); var LargeBoxPath = - /** @class */ - function (_super) { - __extends(LargeBoxPath, _super); + /** @class */ + function (_super) { + __extends(LargeBoxPath, _super); - function LargeBoxPath(opts) { - var _this = _super.call(this, opts) || this; + function LargeBoxPath(opts) { + var _this = _super.call(this, opts) || this; - _this.type = 'largeCandlestickBox'; - return _this; - } + _this.type = 'largeCandlestickBox'; + return _this; + } - LargeBoxPath.prototype.getDefaultShape = function () { - return new LargeBoxPathShape(); - }; + LargeBoxPath.prototype.getDefaultShape = function () { + return new LargeBoxPathShape(); + }; - LargeBoxPath.prototype.buildPath = function (ctx, shape) { - // Drawing lines is more efficient than drawing - // a whole line or drawing rects. - var points = shape.points; + LargeBoxPath.prototype.buildPath = function (ctx, shape) { + // Drawing lines is more efficient than drawing + // a whole line or drawing rects. + var points = shape.points; - for (var i = 0; i < points.length;) { - if (this.__sign === points[i++]) { - var x = points[i++]; - ctx.moveTo(x, points[i++]); - ctx.lineTo(x, points[i++]); - } else { - i += 3; - } - } - }; + for (var i = 0; i < points.length;) { + if (this.__sign === points[i++]) { + var x = points[i++]; + ctx.moveTo(x, points[i++]); + ctx.lineTo(x, points[i++]); + } else { + i += 3; + } + } + }; - return LargeBoxPath; - }(Path); + return LargeBoxPath; + }(Path); function createLarge$1(seriesModel, group, progressiveEls, incremental) { - var data = seriesModel.getData(); - var largePoints = data.getLayout('largePoints'); - var elP = new LargeBoxPath({ - shape: { - points: largePoints - }, - __sign: 1 - }); - group.add(elP); - var elN = new LargeBoxPath({ - shape: { - points: largePoints - }, - __sign: -1 - }); - group.add(elN); - setLargeStyle(1, elP, seriesModel); - setLargeStyle(-1, elN, seriesModel); + var data = seriesModel.getData(); + var largePoints = data.getLayout('largePoints'); + var elP = new LargeBoxPath({ + shape: { + points: largePoints + }, + __sign: 1 + }); + group.add(elP); + var elN = new LargeBoxPath({ + shape: { + points: largePoints + }, + __sign: -1 + }); + group.add(elN); + setLargeStyle(1, elP, seriesModel); + setLargeStyle(-1, elN, seriesModel); - if (incremental) { - elP.incremental = true; - elN.incremental = true; - } + if (incremental) { + elP.incremental = true; + elN.incremental = true; + } - if (progressiveEls) { - progressiveEls.push(elP, elN); - } + if (progressiveEls) { + progressiveEls.push(elP, elN); + } } function setLargeStyle(sign, el, seriesModel, data) { - // TODO put in visual? - var borderColor = seriesModel.get(['itemStyle', sign > 0 ? 'borderColor' : 'borderColor0']) || seriesModel.get(['itemStyle', sign > 0 ? 'color' : 'color0']); // Color must be excluded. - // Because symbol provide setColor individually to set fill and stroke + // TODO put in visual? + var borderColor = seriesModel.get(['itemStyle', sign > 0 ? 'borderColor' : 'borderColor0']) || seriesModel.get(['itemStyle', sign > 0 ? 'color' : 'color0']); // Color must be excluded. + // Because symbol provide setColor individually to set fill and stroke - var itemStyle = seriesModel.getModel('itemStyle').getItemStyle(SKIP_PROPS); - el.useStyle(itemStyle); - el.style.fill = null; - el.style.stroke = borderColor; + var itemStyle = seriesModel.getModel('itemStyle').getItemStyle(SKIP_PROPS); + el.useStyle(itemStyle); + el.style.fill = null; + el.style.stroke = borderColor; } var CandlestickSeriesModel = - /** @class */ - function (_super) { - __extends(CandlestickSeriesModel, _super); + /** @class */ + function (_super) { + __extends(CandlestickSeriesModel, _super); - function CandlestickSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function CandlestickSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = CandlestickSeriesModel.type; - _this.defaultValueDimensions = [{ - name: 'open', - defaultTooltip: true - }, { - name: 'close', - defaultTooltip: true - }, { - name: 'lowest', - defaultTooltip: true - }, { - name: 'highest', - defaultTooltip: true - }]; - return _this; - } - /** - * Get dimension for shadow in dataZoom - * @return dimension name - */ + _this.type = CandlestickSeriesModel.type; + _this.defaultValueDimensions = [{ + name: 'open', + defaultTooltip: true + }, { + name: 'close', + defaultTooltip: true + }, { + name: 'lowest', + defaultTooltip: true + }, { + name: 'highest', + defaultTooltip: true + }]; + return _this; + } + /** + * Get dimension for shadow in dataZoom + * @return dimension name + */ - CandlestickSeriesModel.prototype.getShadowDim = function () { - return 'open'; - }; + CandlestickSeriesModel.prototype.getShadowDim = function () { + return 'open'; + }; - CandlestickSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) { - var itemLayout = data.getItemLayout(dataIndex); - return itemLayout && selectors.rect(itemLayout.brushRect); - }; + CandlestickSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) { + var itemLayout = data.getItemLayout(dataIndex); + return itemLayout && selectors.rect(itemLayout.brushRect); + }; - CandlestickSeriesModel.type = 'series.candlestick'; - CandlestickSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid']; - CandlestickSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - coordinateSystem: 'cartesian2d', - legendHoverLink: true, - // xAxisIndex: 0, - // yAxisIndex: 0, - layout: null, - clip: true, - itemStyle: { - color: '#eb5454', - color0: '#47b262', - borderColor: '#eb5454', - borderColor0: '#47b262', - // borderColor: '#d24040', - // borderColor0: '#398f4f', - borderWidth: 1 - }, - emphasis: { - scale: true, - itemStyle: { - borderWidth: 2 - } - }, - barMaxWidth: null, - barMinWidth: null, - barWidth: null, - large: true, - largeThreshold: 600, - progressive: 3e3, - progressiveThreshold: 1e4, - progressiveChunkMode: 'mod', - animationEasing: 'linear', - animationDuration: 300 - }; - return CandlestickSeriesModel; - }(SeriesModel); + CandlestickSeriesModel.type = 'series.candlestick'; + CandlestickSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid']; + CandlestickSeriesModel.defaultOption = { + // zlevel: 0, + z: 2, + coordinateSystem: 'cartesian2d', + legendHoverLink: true, + // xAxisIndex: 0, + // yAxisIndex: 0, + layout: null, + clip: true, + itemStyle: { + color: '#eb5454', + color0: '#47b262', + borderColor: '#eb5454', + borderColor0: '#47b262', + // borderColor: '#d24040', + // borderColor0: '#398f4f', + borderWidth: 1 + }, + emphasis: { + scale: true, + itemStyle: { + borderWidth: 2 + } + }, + barMaxWidth: null, + barMinWidth: null, + barWidth: null, + large: true, + largeThreshold: 600, + progressive: 3e3, + progressiveThreshold: 1e4, + progressiveChunkMode: 'mod', + animationEasing: 'linear', + animationDuration: 300 + }; + return CandlestickSeriesModel; + }(SeriesModel); mixin(CandlestickSeriesModel, WhiskerBoxCommonMixin, true); function candlestickPreprocessor(option) { - if (!option || !isArray(option.series)) { - return; - } // Translate 'k' to 'candlestick'. + if (!option || !isArray(option.series)) { + return; + } // Translate 'k' to 'candlestick'. - each(option.series, function (seriesItem) { - if (isObject(seriesItem) && seriesItem.type === 'k') { - seriesItem.type = 'candlestick'; - } - }); + each(option.series, function (seriesItem) { + if (isObject(seriesItem) && seriesItem.type === 'k') { + seriesItem.type = 'candlestick'; + } + }); } var positiveBorderColorQuery = ['itemStyle', 'borderColor']; @@ -67311,1770 +67311,1770 @@ var positiveColorQuery = ['itemStyle', 'color']; var negativeColorQuery = ['itemStyle', 'color0']; var candlestickVisual = { - seriesType: 'candlestick', - plan: createRenderPlanner(), - // For legend. - performRawSeries: true, - reset: function (seriesModel, ecModel) { - function getColor(sign, model) { - return model.get(sign > 0 ? positiveColorQuery : negativeColorQuery); - } - - function getBorderColor(sign, model) { - return model.get(sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery); - } // Only visible series has each data be visual encoded - + seriesType: 'candlestick', + plan: createRenderPlanner(), + // For legend. + performRawSeries: true, + reset: function (seriesModel, ecModel) { + function getColor(sign, model) { + return model.get(sign > 0 ? positiveColorQuery : negativeColorQuery); + } - if (ecModel.isSeriesFiltered(seriesModel)) { - return; - } + function getBorderColor(sign, model) { + return model.get(sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery); + } // Only visible series has each data be visual encoded - var isLargeRender = seriesModel.pipelineContext.large; - return !isLargeRender && { - progress: function (params, data) { - var dataIndex; - while ((dataIndex = params.next()) != null) { - var itemModel = data.getItemModel(dataIndex); - var sign = data.getItemLayout(dataIndex).sign; - var style = itemModel.getItemStyle(); - style.fill = getColor(sign, itemModel); - style.stroke = getBorderColor(sign, itemModel) || style.fill; - var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style'); - extend(existsStyle, style); - } - } - }; + if (ecModel.isSeriesFiltered(seriesModel)) { + return; } - }; - var candlestickLayout = { - seriesType: 'candlestick', - plan: createRenderPlanner(), - reset: function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; - var data = seriesModel.getData(); - var candleWidth = calculateCandleWidth(seriesModel, data); - var cDimIdx = 0; - var vDimIdx = 1; - var coordDims = ['x', 'y']; - var cDimI = data.getDimensionIndex(data.mapDimension(coordDims[cDimIdx])); - var vDimsI = map(data.mapDimensionsAll(coordDims[vDimIdx]), data.getDimensionIndex, data); - var openDimI = vDimsI[0]; - var closeDimI = vDimsI[1]; - var lowestDimI = vDimsI[2]; - var highestDimI = vDimsI[3]; - data.setLayout({ - candleWidth: candleWidth, - // The value is experimented visually. - isSimpleBox: candleWidth <= 1.3 - }); + var isLargeRender = seriesModel.pipelineContext.large; + return !isLargeRender && { + progress: function (params, data) { + var dataIndex; - if (cDimI < 0 || vDimsI.length < 4) { - return; + while ((dataIndex = params.next()) != null) { + var itemModel = data.getItemModel(dataIndex); + var sign = data.getItemLayout(dataIndex).sign; + var style = itemModel.getItemStyle(); + style.fill = getColor(sign, itemModel); + style.stroke = getBorderColor(sign, itemModel) || style.fill; + var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style'); + extend(existsStyle, style); } + } + }; + } + }; - return { - progress: seriesModel.pipelineContext.large ? largeProgress : normalProgress - }; - - function normalProgress(params, data) { - var dataIndex; - var store = data.getStore(); - - while ((dataIndex = params.next()) != null) { - var axisDimVal = store.get(cDimI, dataIndex); - var openVal = store.get(openDimI, dataIndex); - var closeVal = store.get(closeDimI, dataIndex); - var lowestVal = store.get(lowestDimI, dataIndex); - var highestVal = store.get(highestDimI, dataIndex); - var ocLow = Math.min(openVal, closeVal); - var ocHigh = Math.max(openVal, closeVal); - var ocLowPoint = getPoint(ocLow, axisDimVal); - var ocHighPoint = getPoint(ocHigh, axisDimVal); - var lowestPoint = getPoint(lowestVal, axisDimVal); - var highestPoint = getPoint(highestVal, axisDimVal); - var ends = []; - addBodyEnd(ends, ocHighPoint, 0); - addBodyEnd(ends, ocLowPoint, 1); - ends.push(subPixelOptimizePoint(highestPoint), subPixelOptimizePoint(ocHighPoint), subPixelOptimizePoint(lowestPoint), subPixelOptimizePoint(ocLowPoint)); - data.setItemLayout(dataIndex, { - sign: getSign(store, dataIndex, openVal, closeVal, closeDimI), - initBaseline: openVal > closeVal ? ocHighPoint[vDimIdx] : ocLowPoint[vDimIdx], - ends: ends, - brushRect: makeBrushRect(lowestVal, highestVal, axisDimVal) - }); - } - - function getPoint(val, axisDimVal) { - var p = []; - p[cDimIdx] = axisDimVal; - p[vDimIdx] = val; - return isNaN(axisDimVal) || isNaN(val) ? [NaN, NaN] : coordSys.dataToPoint(p); - } - - function addBodyEnd(ends, point, start) { - var point1 = point.slice(); - var point2 = point.slice(); - point1[cDimIdx] = subPixelOptimize$1(point1[cDimIdx] + candleWidth / 2, 1, false); - point2[cDimIdx] = subPixelOptimize$1(point2[cDimIdx] - candleWidth / 2, 1, true); - start ? ends.push(point1, point2) : ends.push(point2, point1); - } - - function makeBrushRect(lowestVal, highestVal, axisDimVal) { - var pmin = getPoint(lowestVal, axisDimVal); - var pmax = getPoint(highestVal, axisDimVal); - pmin[cDimIdx] -= candleWidth / 2; - pmax[cDimIdx] -= candleWidth / 2; - return { - x: pmin[0], - y: pmin[1], - width: candleWidth , - height: pmax[1] - pmin[1] - }; - } + var candlestickLayout = { + seriesType: 'candlestick', + plan: createRenderPlanner(), + reset: function (seriesModel) { + var coordSys = seriesModel.coordinateSystem; + var data = seriesModel.getData(); + var candleWidth = calculateCandleWidth(seriesModel, data); + var cDimIdx = 0; + var vDimIdx = 1; + var coordDims = ['x', 'y']; + var cDimI = data.getDimensionIndex(data.mapDimension(coordDims[cDimIdx])); + var vDimsI = map(data.mapDimensionsAll(coordDims[vDimIdx]), data.getDimensionIndex, data); + var openDimI = vDimsI[0]; + var closeDimI = vDimsI[1]; + var lowestDimI = vDimsI[2]; + var highestDimI = vDimsI[3]; + data.setLayout({ + candleWidth: candleWidth, + // The value is experimented visually. + isSimpleBox: candleWidth <= 1.3 + }); - function subPixelOptimizePoint(point) { - point[cDimIdx] = subPixelOptimize$1(point[cDimIdx], 1); - return point; - } - } + if (cDimI < 0 || vDimsI.length < 4) { + return; + } - function largeProgress(params, data) { - // Structure: [sign, x, yhigh, ylow, sign, x, yhigh, ylow, ...] - var points = createFloat32Array(params.count * 4); - var offset = 0; - var point; - var tmpIn = []; - var tmpOut = []; - var dataIndex; - var store = data.getStore(); + return { + progress: seriesModel.pipelineContext.large ? largeProgress : normalProgress + }; + + function normalProgress(params, data) { + var dataIndex; + var store = data.getStore(); + + while ((dataIndex = params.next()) != null) { + var axisDimVal = store.get(cDimI, dataIndex); + var openVal = store.get(openDimI, dataIndex); + var closeVal = store.get(closeDimI, dataIndex); + var lowestVal = store.get(lowestDimI, dataIndex); + var highestVal = store.get(highestDimI, dataIndex); + var ocLow = Math.min(openVal, closeVal); + var ocHigh = Math.max(openVal, closeVal); + var ocLowPoint = getPoint(ocLow, axisDimVal); + var ocHighPoint = getPoint(ocHigh, axisDimVal); + var lowestPoint = getPoint(lowestVal, axisDimVal); + var highestPoint = getPoint(highestVal, axisDimVal); + var ends = []; + addBodyEnd(ends, ocHighPoint, 0); + addBodyEnd(ends, ocLowPoint, 1); + ends.push(subPixelOptimizePoint(highestPoint), subPixelOptimizePoint(ocHighPoint), subPixelOptimizePoint(lowestPoint), subPixelOptimizePoint(ocLowPoint)); + data.setItemLayout(dataIndex, { + sign: getSign(store, dataIndex, openVal, closeVal, closeDimI), + initBaseline: openVal > closeVal ? ocHighPoint[vDimIdx] : ocLowPoint[vDimIdx], + ends: ends, + brushRect: makeBrushRect(lowestVal, highestVal, axisDimVal) + }); + } - while ((dataIndex = params.next()) != null) { - var axisDimVal = store.get(cDimI, dataIndex); - var openVal = store.get(openDimI, dataIndex); - var closeVal = store.get(closeDimI, dataIndex); - var lowestVal = store.get(lowestDimI, dataIndex); - var highestVal = store.get(highestDimI, dataIndex); + function getPoint(val, axisDimVal) { + var p = []; + p[cDimIdx] = axisDimVal; + p[vDimIdx] = val; + return isNaN(axisDimVal) || isNaN(val) ? [NaN, NaN] : coordSys.dataToPoint(p); + } - if (isNaN(axisDimVal) || isNaN(lowestVal) || isNaN(highestVal)) { - points[offset++] = NaN; - offset += 3; - continue; - } + function addBodyEnd(ends, point, start) { + var point1 = point.slice(); + var point2 = point.slice(); + point1[cDimIdx] = subPixelOptimize$1(point1[cDimIdx] + candleWidth / 2, 1, false); + point2[cDimIdx] = subPixelOptimize$1(point2[cDimIdx] - candleWidth / 2, 1, true); + start ? ends.push(point1, point2) : ends.push(point2, point1); + } - points[offset++] = getSign(store, dataIndex, openVal, closeVal, closeDimI); - tmpIn[cDimIdx] = axisDimVal; - tmpIn[vDimIdx] = lowestVal; - point = coordSys.dataToPoint(tmpIn, null, tmpOut); - points[offset++] = point ? point[0] : NaN; - points[offset++] = point ? point[1] : NaN; - tmpIn[vDimIdx] = highestVal; - point = coordSys.dataToPoint(tmpIn, null, tmpOut); - points[offset++] = point ? point[1] : NaN; - } + function makeBrushRect(lowestVal, highestVal, axisDimVal) { + var pmin = getPoint(lowestVal, axisDimVal); + var pmax = getPoint(highestVal, axisDimVal); + pmin[cDimIdx] -= candleWidth / 2; + pmax[cDimIdx] -= candleWidth / 2; + return { + x: pmin[0], + y: pmin[1], + width: candleWidth , + height: pmax[1] - pmin[1] + }; + } - data.setLayout('largePoints', points); - } - } + function subPixelOptimizePoint(point) { + point[cDimIdx] = subPixelOptimize$1(point[cDimIdx], 1); + return point; + } + } + + function largeProgress(params, data) { + // Structure: [sign, x, yhigh, ylow, sign, x, yhigh, ylow, ...] + var points = createFloat32Array(params.count * 4); + var offset = 0; + var point; + var tmpIn = []; + var tmpOut = []; + var dataIndex; + var store = data.getStore(); + + while ((dataIndex = params.next()) != null) { + var axisDimVal = store.get(cDimI, dataIndex); + var openVal = store.get(openDimI, dataIndex); + var closeVal = store.get(closeDimI, dataIndex); + var lowestVal = store.get(lowestDimI, dataIndex); + var highestVal = store.get(highestDimI, dataIndex); + + if (isNaN(axisDimVal) || isNaN(lowestVal) || isNaN(highestVal)) { + points[offset++] = NaN; + offset += 3; + continue; + } + + points[offset++] = getSign(store, dataIndex, openVal, closeVal, closeDimI); + tmpIn[cDimIdx] = axisDimVal; + tmpIn[vDimIdx] = lowestVal; + point = coordSys.dataToPoint(tmpIn, null, tmpOut); + points[offset++] = point ? point[0] : NaN; + points[offset++] = point ? point[1] : NaN; + tmpIn[vDimIdx] = highestVal; + point = coordSys.dataToPoint(tmpIn, null, tmpOut); + points[offset++] = point ? point[1] : NaN; + } + + data.setLayout('largePoints', points); + } + } }; function getSign(store, dataIndex, openVal, closeVal, closeDimI) { - var sign; + var sign; - if (openVal > closeVal) { - sign = -1; - } else if (openVal < closeVal) { - sign = 1; - } else { - sign = dataIndex > 0 // If close === open, compare with close of last record - ? store.get(closeDimI, dataIndex - 1) <= closeVal ? 1 : -1 : // No record of previous, set to be positive - 1; - } + if (openVal > closeVal) { + sign = -1; + } else if (openVal < closeVal) { + sign = 1; + } else { + sign = dataIndex > 0 // If close === open, compare with close of last record + ? store.get(closeDimI, dataIndex - 1) <= closeVal ? 1 : -1 : // No record of previous, set to be positive + 1; + } - return sign; + return sign; } function calculateCandleWidth(seriesModel, data) { - var baseAxis = seriesModel.getBaseAxis(); - var extent; - var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : (extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / data.count()); - var barMaxWidth = parsePercent$1(retrieve2(seriesModel.get('barMaxWidth'), bandWidth), bandWidth); - var barMinWidth = parsePercent$1(retrieve2(seriesModel.get('barMinWidth'), 1), bandWidth); - var barWidth = seriesModel.get('barWidth'); - return barWidth != null ? parsePercent$1(barWidth, bandWidth) // Put max outer to ensure bar visible in spite of overlap. - : Math.max(Math.min(bandWidth / 2, barMaxWidth), barMinWidth); + var baseAxis = seriesModel.getBaseAxis(); + var extent; + var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : (extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / data.count()); + var barMaxWidth = parsePercent$1(retrieve2(seriesModel.get('barMaxWidth'), bandWidth), bandWidth); + var barMinWidth = parsePercent$1(retrieve2(seriesModel.get('barMinWidth'), 1), bandWidth); + var barWidth = seriesModel.get('barWidth'); + return barWidth != null ? parsePercent$1(barWidth, bandWidth) // Put max outer to ensure bar visible in spite of overlap. + : Math.max(Math.min(bandWidth / 2, barMaxWidth), barMinWidth); } function install$k(registers) { - registers.registerChartView(CandlestickView); - registers.registerSeriesModel(CandlestickSeriesModel); - registers.registerPreprocessor(candlestickPreprocessor); - registers.registerVisual(candlestickVisual); - registers.registerLayout(candlestickLayout); + registers.registerChartView(CandlestickView); + registers.registerSeriesModel(CandlestickSeriesModel); + registers.registerPreprocessor(candlestickPreprocessor); + registers.registerVisual(candlestickVisual); + registers.registerLayout(candlestickLayout); } function updateRipplePath(rippleGroup, effectCfg) { - var color = effectCfg.rippleEffectColor || effectCfg.color; - rippleGroup.eachChild(function (ripplePath) { - ripplePath.attr({ - z: effectCfg.z, - zlevel: effectCfg.zlevel, - style: { - stroke: effectCfg.brushType === 'stroke' ? color : null, - fill: effectCfg.brushType === 'fill' ? color : null - } - }); + var color = effectCfg.rippleEffectColor || effectCfg.color; + rippleGroup.eachChild(function (ripplePath) { + ripplePath.attr({ + z: effectCfg.z, + zlevel: effectCfg.zlevel, + style: { + stroke: effectCfg.brushType === 'stroke' ? color : null, + fill: effectCfg.brushType === 'fill' ? color : null + } }); + }); } var EffectSymbol = - /** @class */ - function (_super) { - __extends(EffectSymbol, _super); + /** @class */ + function (_super) { + __extends(EffectSymbol, _super); - function EffectSymbol(data, idx) { - var _this = _super.call(this) || this; + function EffectSymbol(data, idx) { + var _this = _super.call(this) || this; - var symbol = new Symbol(data, idx); - var rippleGroup = new Group(); + var symbol = new Symbol(data, idx); + var rippleGroup = new Group(); - _this.add(symbol); + _this.add(symbol); - _this.add(rippleGroup); + _this.add(rippleGroup); - _this.updateData(data, idx); + _this.updateData(data, idx); - return _this; - } + return _this; + } - EffectSymbol.prototype.stopEffectAnimation = function () { - this.childAt(1).removeAll(); - }; + EffectSymbol.prototype.stopEffectAnimation = function () { + this.childAt(1).removeAll(); + }; - EffectSymbol.prototype.startEffectAnimation = function (effectCfg) { - var symbolType = effectCfg.symbolType; - var color = effectCfg.color; - var rippleNumber = effectCfg.rippleNumber; - var rippleGroup = this.childAt(1); - - for (var i = 0; i < rippleNumber; i++) { - // If width/height are set too small (e.g., set to 1) on ios10 - // and macOS Sierra, a circle stroke become a rect, no matter what - // the scale is set. So we set width/height as 2. See #4136. - var ripplePath = createSymbol(symbolType, -1, -1, 2, 2, color); - ripplePath.attr({ - style: { - strokeNoScale: true - }, - z2: 99, - silent: true, - scaleX: 0.5, - scaleY: 0.5 - }); - var delay = -i / rippleNumber * effectCfg.period + effectCfg.effectOffset; - ripplePath.animate('', true).when(effectCfg.period, { - scaleX: effectCfg.rippleScale / 2, - scaleY: effectCfg.rippleScale / 2 - }).delay(delay).start(); - ripplePath.animateStyle(true).when(effectCfg.period, { - opacity: 0 - }).delay(delay).start(); - rippleGroup.add(ripplePath); - } - - updateRipplePath(rippleGroup, effectCfg); - }; - /** - * Update effect symbol - */ + EffectSymbol.prototype.startEffectAnimation = function (effectCfg) { + var symbolType = effectCfg.symbolType; + var color = effectCfg.color; + var rippleNumber = effectCfg.rippleNumber; + var rippleGroup = this.childAt(1); + for (var i = 0; i < rippleNumber; i++) { + // If width/height are set too small (e.g., set to 1) on ios10 + // and macOS Sierra, a circle stroke become a rect, no matter what + // the scale is set. So we set width/height as 2. See #4136. + var ripplePath = createSymbol(symbolType, -1, -1, 2, 2, color); + ripplePath.attr({ + style: { + strokeNoScale: true + }, + z2: 99, + silent: true, + scaleX: 0.5, + scaleY: 0.5 + }); + var delay = -i / rippleNumber * effectCfg.period + effectCfg.effectOffset; + ripplePath.animate('', true).when(effectCfg.period, { + scaleX: effectCfg.rippleScale / 2, + scaleY: effectCfg.rippleScale / 2 + }).delay(delay).start(); + ripplePath.animateStyle(true).when(effectCfg.period, { + opacity: 0 + }).delay(delay).start(); + rippleGroup.add(ripplePath); + } + + updateRipplePath(rippleGroup, effectCfg); + }; + /** + * Update effect symbol + */ - EffectSymbol.prototype.updateEffectAnimation = function (effectCfg) { - var oldEffectCfg = this._effectCfg; - var rippleGroup = this.childAt(1); // Must reinitialize effect if following configuration changed - var DIFFICULT_PROPS = ['symbolType', 'period', 'rippleScale', 'rippleNumber']; + EffectSymbol.prototype.updateEffectAnimation = function (effectCfg) { + var oldEffectCfg = this._effectCfg; + var rippleGroup = this.childAt(1); // Must reinitialize effect if following configuration changed - for (var i = 0; i < DIFFICULT_PROPS.length; i++) { - var propName = DIFFICULT_PROPS[i]; + var DIFFICULT_PROPS = ['symbolType', 'period', 'rippleScale', 'rippleNumber']; - if (oldEffectCfg[propName] !== effectCfg[propName]) { - this.stopEffectAnimation(); - this.startEffectAnimation(effectCfg); - return; - } - } + for (var i = 0; i < DIFFICULT_PROPS.length; i++) { + var propName = DIFFICULT_PROPS[i]; - updateRipplePath(rippleGroup, effectCfg); - }; - /** - * Highlight symbol - */ + if (oldEffectCfg[propName] !== effectCfg[propName]) { + this.stopEffectAnimation(); + this.startEffectAnimation(effectCfg); + return; + } + } + updateRipplePath(rippleGroup, effectCfg); + }; + /** + * Highlight symbol + */ - EffectSymbol.prototype.highlight = function () { - enterEmphasis(this); - }; - /** - * Downplay symbol - */ + EffectSymbol.prototype.highlight = function () { + enterEmphasis(this); + }; + /** + * Downplay symbol + */ - EffectSymbol.prototype.downplay = function () { - leaveEmphasis(this); - }; - EffectSymbol.prototype.getSymbolType = function () { - var symbol = this.childAt(0); - return symbol && symbol.getSymbolType(); - }; - /** - * Update symbol properties - */ + EffectSymbol.prototype.downplay = function () { + leaveEmphasis(this); + }; + + EffectSymbol.prototype.getSymbolType = function () { + var symbol = this.childAt(0); + return symbol && symbol.getSymbolType(); + }; + /** + * Update symbol properties + */ - EffectSymbol.prototype.updateData = function (data, idx) { - var _this = this; - - var seriesModel = data.hostModel; - this.childAt(0).updateData(data, idx); - var rippleGroup = this.childAt(1); - var itemModel = data.getItemModel(idx); - var symbolType = data.getItemVisual(idx, 'symbol'); - var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize')); - var symbolStyle = data.getItemVisual(idx, 'style'); - var color = symbolStyle && symbolStyle.fill; - var emphasisModel = itemModel.getModel('emphasis'); - rippleGroup.setScale(symbolSize); - rippleGroup.traverse(function (ripplePath) { - ripplePath.setStyle('fill', color); - }); - var symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, 'symbolOffset'), symbolSize); - - if (symbolOffset) { - rippleGroup.x = symbolOffset[0]; - rippleGroup.y = symbolOffset[1]; - } - - var symbolRotate = data.getItemVisual(idx, 'symbolRotate'); - rippleGroup.rotation = (symbolRotate || 0) * Math.PI / 180 || 0; - var effectCfg = {}; - effectCfg.showEffectOn = seriesModel.get('showEffectOn'); - effectCfg.rippleScale = itemModel.get(['rippleEffect', 'scale']); - effectCfg.brushType = itemModel.get(['rippleEffect', 'brushType']); - effectCfg.period = itemModel.get(['rippleEffect', 'period']) * 1000; - effectCfg.effectOffset = idx / data.count(); - effectCfg.z = seriesModel.getShallow('z') || 0; - effectCfg.zlevel = seriesModel.getShallow('zlevel') || 0; - effectCfg.symbolType = symbolType; - effectCfg.color = color; - effectCfg.rippleEffectColor = itemModel.get(['rippleEffect', 'color']); - effectCfg.rippleNumber = itemModel.get(['rippleEffect', 'number']); - - if (effectCfg.showEffectOn === 'render') { - this._effectCfg ? this.updateEffectAnimation(effectCfg) : this.startEffectAnimation(effectCfg); - this._effectCfg = effectCfg; - } else { - // Not keep old effect config - this._effectCfg = null; - this.stopEffectAnimation(); - - this.onHoverStateChange = function (toState) { - if (toState === 'emphasis') { - if (effectCfg.showEffectOn !== 'render') { - _this.startEffectAnimation(effectCfg); - } - } else if (toState === 'normal') { - if (effectCfg.showEffectOn !== 'render') { - _this.stopEffectAnimation(); - } - } - }; - } + EffectSymbol.prototype.updateData = function (data, idx) { + var _this = this; - this._effectCfg = effectCfg; - toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - }; + var seriesModel = data.hostModel; + this.childAt(0).updateData(data, idx); + var rippleGroup = this.childAt(1); + var itemModel = data.getItemModel(idx); + var symbolType = data.getItemVisual(idx, 'symbol'); + var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize')); + var symbolStyle = data.getItemVisual(idx, 'style'); + var color = symbolStyle && symbolStyle.fill; + var emphasisModel = itemModel.getModel('emphasis'); + rippleGroup.setScale(symbolSize); + rippleGroup.traverse(function (ripplePath) { + ripplePath.setStyle('fill', color); + }); + var symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, 'symbolOffset'), symbolSize); - EffectSymbol.prototype.fadeOut = function (cb) { - cb && cb(); - }; - return EffectSymbol; - }(Group); + if (symbolOffset) { + rippleGroup.x = symbolOffset[0]; + rippleGroup.y = symbolOffset[1]; + } + + var symbolRotate = data.getItemVisual(idx, 'symbolRotate'); + rippleGroup.rotation = (symbolRotate || 0) * Math.PI / 180 || 0; + var effectCfg = {}; + effectCfg.showEffectOn = seriesModel.get('showEffectOn'); + effectCfg.rippleScale = itemModel.get(['rippleEffect', 'scale']); + effectCfg.brushType = itemModel.get(['rippleEffect', 'brushType']); + effectCfg.period = itemModel.get(['rippleEffect', 'period']) * 1000; + effectCfg.effectOffset = idx / data.count(); + effectCfg.z = seriesModel.getShallow('z') || 0; + effectCfg.zlevel = seriesModel.getShallow('zlevel') || 0; + effectCfg.symbolType = symbolType; + effectCfg.color = color; + effectCfg.rippleEffectColor = itemModel.get(['rippleEffect', 'color']); + effectCfg.rippleNumber = itemModel.get(['rippleEffect', 'number']); + + if (effectCfg.showEffectOn === 'render') { + this._effectCfg ? this.updateEffectAnimation(effectCfg) : this.startEffectAnimation(effectCfg); + this._effectCfg = effectCfg; + } else { + // Not keep old effect config + this._effectCfg = null; + this.stopEffectAnimation(); + + this.onHoverStateChange = function (toState) { + if (toState === 'emphasis') { + if (effectCfg.showEffectOn !== 'render') { + _this.startEffectAnimation(effectCfg); + } + } else if (toState === 'normal') { + if (effectCfg.showEffectOn !== 'render') { + _this.stopEffectAnimation(); + } + } + }; + } + + this._effectCfg = effectCfg; + toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); + }; + + EffectSymbol.prototype.fadeOut = function (cb) { + cb && cb(); + }; + return EffectSymbol; + }(Group); var EffectScatterView = - /** @class */ - function (_super) { - __extends(EffectScatterView, _super); + /** @class */ + function (_super) { + __extends(EffectScatterView, _super); - function EffectScatterView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function EffectScatterView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = EffectScatterView.type; - return _this; - } + _this.type = EffectScatterView.type; + return _this; + } - EffectScatterView.prototype.init = function () { - this._symbolDraw = new SymbolDraw(EffectSymbol); - }; + EffectScatterView.prototype.init = function () { + this._symbolDraw = new SymbolDraw(EffectSymbol); + }; - EffectScatterView.prototype.render = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - var effectSymbolDraw = this._symbolDraw; - effectSymbolDraw.updateData(data, { - clipShape: this._getClipShape(seriesModel) - }); - this.group.add(effectSymbolDraw.group); - }; + EffectScatterView.prototype.render = function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); + var effectSymbolDraw = this._symbolDraw; + effectSymbolDraw.updateData(data, { + clipShape: this._getClipShape(seriesModel) + }); + this.group.add(effectSymbolDraw.group); + }; - EffectScatterView.prototype._getClipShape = function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; - var clipArea = coordSys && coordSys.getArea && coordSys.getArea(); - return seriesModel.get('clip', true) ? clipArea : null; - }; + EffectScatterView.prototype._getClipShape = function (seriesModel) { + var coordSys = seriesModel.coordinateSystem; + var clipArea = coordSys && coordSys.getArea && coordSys.getArea(); + return seriesModel.get('clip', true) ? clipArea : null; + }; - EffectScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - this.group.dirty(); - var res = pointsLayout('').reset(seriesModel, ecModel, api); + EffectScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); + this.group.dirty(); + var res = pointsLayout('').reset(seriesModel, ecModel, api); - if (res.progress) { - res.progress({ - start: 0, - end: data.count(), - count: data.count() - }, data); - } + if (res.progress) { + res.progress({ + start: 0, + end: data.count(), + count: data.count() + }, data); + } - this._symbolDraw.updateLayout(); - }; + this._symbolDraw.updateLayout(); + }; - EffectScatterView.prototype._updateGroupTransform = function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; + EffectScatterView.prototype._updateGroupTransform = function (seriesModel) { + var coordSys = seriesModel.coordinateSystem; - if (coordSys && coordSys.getRoamTransform) { - this.group.transform = clone$2(coordSys.getRoamTransform()); - this.group.decomposeTransform(); - } - }; + if (coordSys && coordSys.getRoamTransform) { + this.group.transform = clone$2(coordSys.getRoamTransform()); + this.group.decomposeTransform(); + } + }; - EffectScatterView.prototype.remove = function (ecModel, api) { - this._symbolDraw && this._symbolDraw.remove(true); - }; + EffectScatterView.prototype.remove = function (ecModel, api) { + this._symbolDraw && this._symbolDraw.remove(true); + }; - EffectScatterView.type = 'effectScatter'; - return EffectScatterView; - }(ChartView); + EffectScatterView.type = 'effectScatter'; + return EffectScatterView; + }(ChartView); var EffectScatterSeriesModel = - /** @class */ - function (_super) { - __extends(EffectScatterSeriesModel, _super); + /** @class */ + function (_super) { + __extends(EffectScatterSeriesModel, _super); - function EffectScatterSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function EffectScatterSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = EffectScatterSeriesModel.type; - _this.hasSymbolVisual = true; - return _this; - } + _this.type = EffectScatterSeriesModel.type; + _this.hasSymbolVisual = true; + return _this; + } - EffectScatterSeriesModel.prototype.getInitialData = function (option, ecModel) { - return createSeriesData(null, this, { - useEncodeDefaulter: true - }); - }; + EffectScatterSeriesModel.prototype.getInitialData = function (option, ecModel) { + return createSeriesData(null, this, { + useEncodeDefaulter: true + }); + }; - EffectScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) { - return selectors.point(data.getItemLayout(dataIndex)); - }; + EffectScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) { + return selectors.point(data.getItemLayout(dataIndex)); + }; - EffectScatterSeriesModel.type = 'series.effectScatter'; - EffectScatterSeriesModel.dependencies = ['grid', 'polar']; - EffectScatterSeriesModel.defaultOption = { - coordinateSystem: 'cartesian2d', - // zlevel: 0, - z: 2, - legendHoverLink: true, - effectType: 'ripple', - progressive: 0, - // When to show the effect, option: 'render'|'emphasis' - showEffectOn: 'render', - clip: true, - // Ripple effect config - rippleEffect: { - period: 4, - // Scale of ripple - scale: 2.5, - // Brush type can be fill or stroke - brushType: 'fill', - // Ripple number - number: 3 - }, - universalTransition: { - divideShape: 'clone' - }, - // Cartesian coordinate system - // xAxisIndex: 0, - // yAxisIndex: 0, - // Polar coordinate system - // polarIndex: 0, - // Geo coordinate system - // geoIndex: 0, - // symbol: null, // 图形类型 - symbolSize: 10 // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - // symbolRotate: null, // 图形旋转控制 - // itemStyle: { - // opacity: 1 - // } + EffectScatterSeriesModel.type = 'series.effectScatter'; + EffectScatterSeriesModel.dependencies = ['grid', 'polar']; + EffectScatterSeriesModel.defaultOption = { + coordinateSystem: 'cartesian2d', + // zlevel: 0, + z: 2, + legendHoverLink: true, + effectType: 'ripple', + progressive: 0, + // When to show the effect, option: 'render'|'emphasis' + showEffectOn: 'render', + clip: true, + // Ripple effect config + rippleEffect: { + period: 4, + // Scale of ripple + scale: 2.5, + // Brush type can be fill or stroke + brushType: 'fill', + // Ripple number + number: 3 + }, + universalTransition: { + divideShape: 'clone' + }, + // Cartesian coordinate system + // xAxisIndex: 0, + // yAxisIndex: 0, + // Polar coordinate system + // polarIndex: 0, + // Geo coordinate system + // geoIndex: 0, + // symbol: null, // 图形类型 + symbolSize: 10 // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + // symbolRotate: null, // 图形旋转控制 + // itemStyle: { + // opacity: 1 + // } - }; - return EffectScatterSeriesModel; - }(SeriesModel); + }; + return EffectScatterSeriesModel; + }(SeriesModel); function install$l(registers) { - registers.registerChartView(EffectScatterView); - registers.registerSeriesModel(EffectScatterSeriesModel); - registers.registerLayout(pointsLayout('effectScatter')); + registers.registerChartView(EffectScatterView); + registers.registerSeriesModel(EffectScatterSeriesModel); + registers.registerLayout(pointsLayout('effectScatter')); } var EffectLine = - /** @class */ - function (_super) { - __extends(EffectLine, _super); - - function EffectLine(lineData, idx, seriesScope) { - var _this = _super.call(this) || this; - - _this.add(_this.createLine(lineData, idx, seriesScope)); + /** @class */ + function (_super) { + __extends(EffectLine, _super); - _this._updateEffectSymbol(lineData, idx); + function EffectLine(lineData, idx, seriesScope) { + var _this = _super.call(this) || this; - return _this; - } + _this.add(_this.createLine(lineData, idx, seriesScope)); - EffectLine.prototype.createLine = function (lineData, idx, seriesScope) { - return new Line$1(lineData, idx, seriesScope); - }; + _this._updateEffectSymbol(lineData, idx); - EffectLine.prototype._updateEffectSymbol = function (lineData, idx) { - var itemModel = lineData.getItemModel(idx); - var effectModel = itemModel.getModel('effect'); - var size = effectModel.get('symbolSize'); - var symbolType = effectModel.get('symbol'); + return _this; + } - if (!isArray(size)) { - size = [size, size]; - } + EffectLine.prototype.createLine = function (lineData, idx, seriesScope) { + return new Line$1(lineData, idx, seriesScope); + }; - var lineStyle = lineData.getItemVisual(idx, 'style'); - var color = effectModel.get('color') || lineStyle && lineStyle.stroke; - var symbol = this.childAt(1); + EffectLine.prototype._updateEffectSymbol = function (lineData, idx) { + var itemModel = lineData.getItemModel(idx); + var effectModel = itemModel.getModel('effect'); + var size = effectModel.get('symbolSize'); + var symbolType = effectModel.get('symbol'); - if (this._symbolType !== symbolType) { - // Remove previous - this.remove(symbol); - symbol = createSymbol(symbolType, -0.5, -0.5, 1, 1, color); - symbol.z2 = 100; - symbol.culling = true; - this.add(symbol); - } // Symbol may be removed if loop is false + if (!isArray(size)) { + size = [size, size]; + } + var lineStyle = lineData.getItemVisual(idx, 'style'); + var color = effectModel.get('color') || lineStyle && lineStyle.stroke; + var symbol = this.childAt(1); - if (!symbol) { - return; - } // Shadow color is same with color in default + if (this._symbolType !== symbolType) { + // Remove previous + this.remove(symbol); + symbol = createSymbol(symbolType, -0.5, -0.5, 1, 1, color); + symbol.z2 = 100; + symbol.culling = true; + this.add(symbol); + } // Symbol may be removed if loop is false - symbol.setStyle('shadowColor', color); - symbol.setStyle(effectModel.getItemStyle(['color'])); - symbol.scaleX = size[0]; - symbol.scaleY = size[1]; - symbol.setColor(color); - this._symbolType = symbolType; - this._symbolScale = size; + if (!symbol) { + return; + } // Shadow color is same with color in default - this._updateEffectAnimation(lineData, effectModel, idx); - }; - EffectLine.prototype._updateEffectAnimation = function (lineData, effectModel, idx) { - var symbol = this.childAt(1); + symbol.setStyle('shadowColor', color); + symbol.setStyle(effectModel.getItemStyle(['color'])); + symbol.scaleX = size[0]; + symbol.scaleY = size[1]; + symbol.setColor(color); + this._symbolType = symbolType; + this._symbolScale = size; - if (!symbol) { - return; - } + this._updateEffectAnimation(lineData, effectModel, idx); + }; - var points = lineData.getItemLayout(idx); - var period = effectModel.get('period') * 1000; - var loop = effectModel.get('loop'); - var constantSpeed = effectModel.get('constantSpeed'); - var delayExpr = retrieve(effectModel.get('delay'), function (idx) { - return idx / lineData.count() * period / 3; - }); // Ignore when updating + EffectLine.prototype._updateEffectAnimation = function (lineData, effectModel, idx) { + var symbol = this.childAt(1); - symbol.ignore = true; + if (!symbol) { + return; + } - this._updateAnimationPoints(symbol, points); + var points = lineData.getItemLayout(idx); + var period = effectModel.get('period') * 1000; + var loop = effectModel.get('loop'); + var constantSpeed = effectModel.get('constantSpeed'); + var delayExpr = retrieve(effectModel.get('delay'), function (idx) { + return idx / lineData.count() * period / 3; + }); // Ignore when updating - if (constantSpeed > 0) { - period = this._getLineLength(symbol) / constantSpeed * 1000; - } + symbol.ignore = true; - if (period !== this._period || loop !== this._loop) { - symbol.stopAnimation(); - var delayNum = void 0; + this._updateAnimationPoints(symbol, points); - if (isFunction(delayExpr)) { - delayNum = delayExpr(idx); - } else { - delayNum = delayExpr; - } + if (constantSpeed > 0) { + period = this._getLineLength(symbol) / constantSpeed * 1000; + } - if (symbol.__t > 0) { - delayNum = -period * symbol.__t; - } + if (period !== this._period || loop !== this._loop) { + symbol.stopAnimation(); + var delayNum = void 0; - this._animateSymbol(symbol, period, delayNum, loop); - } + if (isFunction(delayExpr)) { + delayNum = delayExpr(idx); + } else { + delayNum = delayExpr; + } - this._period = period; - this._loop = loop; - }; + if (symbol.__t > 0) { + delayNum = -period * symbol.__t; + } - EffectLine.prototype._animateSymbol = function (symbol, period, delayNum, loop) { - if (period > 0) { - symbol.__t = 0; - var self_1 = this; - var animator = symbol.animate('', loop).when(period, { - __t: 1 - }).delay(delayNum).during(function () { - self_1._updateSymbolPosition(symbol); - }); + this._animateSymbol(symbol, period, delayNum, loop); + } - if (!loop) { - animator.done(function () { - self_1.remove(symbol); - }); - } + this._period = period; + this._loop = loop; + }; - animator.start(); - } - }; + EffectLine.prototype._animateSymbol = function (symbol, period, delayNum, loop) { + if (period > 0) { + symbol.__t = 0; + var self_1 = this; + var animator = symbol.animate('', loop).when(period, { + __t: 1 + }).delay(delayNum).during(function () { + self_1._updateSymbolPosition(symbol); + }); - EffectLine.prototype._getLineLength = function (symbol) { - // Not so accurate - return dist(symbol.__p1, symbol.__cp1) + dist(symbol.__cp1, symbol.__p2); - }; + if (!loop) { + animator.done(function () { + self_1.remove(symbol); + }); + } - EffectLine.prototype._updateAnimationPoints = function (symbol, points) { - symbol.__p1 = points[0]; - symbol.__p2 = points[1]; - symbol.__cp1 = points[2] || [(points[0][0] + points[1][0]) / 2, (points[0][1] + points[1][1]) / 2]; - }; + animator.start(); + } + }; - EffectLine.prototype.updateData = function (lineData, idx, seriesScope) { - this.childAt(0).updateData(lineData, idx, seriesScope); + EffectLine.prototype._getLineLength = function (symbol) { + // Not so accurate + return dist(symbol.__p1, symbol.__cp1) + dist(symbol.__cp1, symbol.__p2); + }; - this._updateEffectSymbol(lineData, idx); - }; + EffectLine.prototype._updateAnimationPoints = function (symbol, points) { + symbol.__p1 = points[0]; + symbol.__p2 = points[1]; + symbol.__cp1 = points[2] || [(points[0][0] + points[1][0]) / 2, (points[0][1] + points[1][1]) / 2]; + }; - EffectLine.prototype._updateSymbolPosition = function (symbol) { - var p1 = symbol.__p1; - var p2 = symbol.__p2; - var cp1 = symbol.__cp1; - var t = symbol.__t; - var pos = [symbol.x, symbol.y]; - var lastPos = pos.slice(); - var quadraticAt$1 = quadraticAt; - var quadraticDerivativeAt$1 = quadraticDerivativeAt; - pos[0] = quadraticAt$1(p1[0], cp1[0], p2[0], t); - pos[1] = quadraticAt$1(p1[1], cp1[1], p2[1], t); // Tangent - - var tx = quadraticDerivativeAt$1(p1[0], cp1[0], p2[0], t); - var ty = quadraticDerivativeAt$1(p1[1], cp1[1], p2[1], t); - symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; // enable continuity trail for 'line', 'rect', 'roundRect' symbolType - - if (this._symbolType === 'line' || this._symbolType === 'rect' || this._symbolType === 'roundRect') { - if (symbol.__lastT !== undefined && symbol.__lastT < symbol.__t) { - symbol.scaleY = dist(lastPos, pos) * 1.05; // make sure the last segment render within endPoint - - if (t === 1) { - pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2; - pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2; - } - } else if (symbol.__lastT === 1) { - // After first loop, symbol.__t does NOT start with 0, so connect p1 to pos directly. - symbol.scaleY = 2 * dist(p1, pos); - } else { - symbol.scaleY = this._symbolScale[1]; - } - } + EffectLine.prototype.updateData = function (lineData, idx, seriesScope) { + this.childAt(0).updateData(lineData, idx, seriesScope); - symbol.__lastT = symbol.__t; - symbol.ignore = false; - symbol.x = pos[0]; - symbol.y = pos[1]; - }; + this._updateEffectSymbol(lineData, idx); + }; - EffectLine.prototype.updateLayout = function (lineData, idx) { - this.childAt(0).updateLayout(lineData, idx); - var effectModel = lineData.getItemModel(idx).getModel('effect'); + EffectLine.prototype._updateSymbolPosition = function (symbol) { + var p1 = symbol.__p1; + var p2 = symbol.__p2; + var cp1 = symbol.__cp1; + var t = symbol.__t; + var pos = [symbol.x, symbol.y]; + var lastPos = pos.slice(); + var quadraticAt$1 = quadraticAt; + var quadraticDerivativeAt$1 = quadraticDerivativeAt; + pos[0] = quadraticAt$1(p1[0], cp1[0], p2[0], t); + pos[1] = quadraticAt$1(p1[1], cp1[1], p2[1], t); // Tangent - this._updateEffectAnimation(lineData, effectModel, idx); - }; + var tx = quadraticDerivativeAt$1(p1[0], cp1[0], p2[0], t); + var ty = quadraticDerivativeAt$1(p1[1], cp1[1], p2[1], t); + symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; // enable continuity trail for 'line', 'rect', 'roundRect' symbolType - return EffectLine; - }(Group); + if (this._symbolType === 'line' || this._symbolType === 'rect' || this._symbolType === 'roundRect') { + if (symbol.__lastT !== undefined && symbol.__lastT < symbol.__t) { + symbol.scaleY = dist(lastPos, pos) * 1.05; // make sure the last segment render within endPoint - var Polyline$1 = - /** @class */ - function (_super) { - __extends(Polyline$1, _super); + if (t === 1) { + pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2; + pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2; + } + } else if (symbol.__lastT === 1) { + // After first loop, symbol.__t does NOT start with 0, so connect p1 to pos directly. + symbol.scaleY = 2 * dist(p1, pos); + } else { + symbol.scaleY = this._symbolScale[1]; + } + } - function Polyline$1(lineData, idx, seriesScope) { - var _this = _super.call(this) || this; + symbol.__lastT = symbol.__t; + symbol.ignore = false; + symbol.x = pos[0]; + symbol.y = pos[1]; + }; - _this._createPolyline(lineData, idx, seriesScope); + EffectLine.prototype.updateLayout = function (lineData, idx) { + this.childAt(0).updateLayout(lineData, idx); + var effectModel = lineData.getItemModel(idx).getModel('effect'); - return _this; - } + this._updateEffectAnimation(lineData, effectModel, idx); + }; - Polyline$1.prototype._createPolyline = function (lineData, idx, seriesScope) { - // let seriesModel = lineData.hostModel; - var points = lineData.getItemLayout(idx); - var line = new Polyline({ - shape: { - points: points - } - }); - this.add(line); + return EffectLine; + }(Group); - this._updateCommonStl(lineData, idx, seriesScope); - }; + var Polyline$1 = + /** @class */ + function (_super) { + __extends(Polyline$1, _super); - Polyline$1.prototype.updateData = function (lineData, idx, seriesScope) { - var seriesModel = lineData.hostModel; - var line = this.childAt(0); - var target = { - shape: { - points: lineData.getItemLayout(idx) - } - }; - updateProps(line, target, seriesModel, idx); + function Polyline$1(lineData, idx, seriesScope) { + var _this = _super.call(this) || this; - this._updateCommonStl(lineData, idx, seriesScope); - }; + _this._createPolyline(lineData, idx, seriesScope); - Polyline$1.prototype._updateCommonStl = function (lineData, idx, seriesScope) { - var line = this.childAt(0); - var itemModel = lineData.getItemModel(idx); - var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle; - var focus = seriesScope && seriesScope.focus; - var blurScope = seriesScope && seriesScope.blurScope; - var emphasisDisabled = seriesScope && seriesScope.emphasisDisabled; - - if (!seriesScope || lineData.hasItemOption) { - var emphasisModel = itemModel.getModel('emphasis'); - emphasisLineStyle = emphasisModel.getModel('lineStyle').getLineStyle(); - emphasisDisabled = emphasisModel.get('disabled'); - focus = emphasisModel.get('focus'); - blurScope = emphasisModel.get('blurScope'); - } - - line.useStyle(lineData.getItemVisual(idx, 'style')); - line.style.fill = null; - line.style.strokeNoScale = true; - var lineEmphasisState = line.ensureState('emphasis'); - lineEmphasisState.style = emphasisLineStyle; - toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled); - }; + return _this; + } - Polyline$1.prototype.updateLayout = function (lineData, idx) { - var polyline = this.childAt(0); - polyline.setShape('points', lineData.getItemLayout(idx)); - }; - return Polyline$1; - }(Group); + Polyline$1.prototype._createPolyline = function (lineData, idx, seriesScope) { + // let seriesModel = lineData.hostModel; + var points = lineData.getItemLayout(idx); + var line = new Polyline({ + shape: { + points: points + } + }); + this.add(line); + + this._updateCommonStl(lineData, idx, seriesScope); + }; + + Polyline$1.prototype.updateData = function (lineData, idx, seriesScope) { + var seriesModel = lineData.hostModel; + var line = this.childAt(0); + var target = { + shape: { + points: lineData.getItemLayout(idx) + } + }; + updateProps(line, target, seriesModel, idx); + + this._updateCommonStl(lineData, idx, seriesScope); + }; + + Polyline$1.prototype._updateCommonStl = function (lineData, idx, seriesScope) { + var line = this.childAt(0); + var itemModel = lineData.getItemModel(idx); + var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle; + var focus = seriesScope && seriesScope.focus; + var blurScope = seriesScope && seriesScope.blurScope; + var emphasisDisabled = seriesScope && seriesScope.emphasisDisabled; + + if (!seriesScope || lineData.hasItemOption) { + var emphasisModel = itemModel.getModel('emphasis'); + emphasisLineStyle = emphasisModel.getModel('lineStyle').getLineStyle(); + emphasisDisabled = emphasisModel.get('disabled'); + focus = emphasisModel.get('focus'); + blurScope = emphasisModel.get('blurScope'); + } + + line.useStyle(lineData.getItemVisual(idx, 'style')); + line.style.fill = null; + line.style.strokeNoScale = true; + var lineEmphasisState = line.ensureState('emphasis'); + lineEmphasisState.style = emphasisLineStyle; + toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled); + }; + + Polyline$1.prototype.updateLayout = function (lineData, idx) { + var polyline = this.childAt(0); + polyline.setShape('points', lineData.getItemLayout(idx)); + }; + return Polyline$1; + }(Group); var EffectPolyline = - /** @class */ - function (_super) { - __extends(EffectPolyline, _super); - - function EffectPolyline() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this._lastFrame = 0; - _this._lastFramePercent = 0; - return _this; - } // Override + /** @class */ + function (_super) { + __extends(EffectPolyline, _super); + function EffectPolyline() { + var _this = _super !== null && _super.apply(this, arguments) || this; - EffectPolyline.prototype.createLine = function (lineData, idx, seriesScope) { - return new Polyline$1(lineData, idx, seriesScope); - }; + _this._lastFrame = 0; + _this._lastFramePercent = 0; + return _this; + } // Override - EffectPolyline.prototype._updateAnimationPoints = function (symbol, points) { - this._points = points; - var accLenArr = [0]; - var len = 0; - for (var i = 1; i < points.length; i++) { - var p1 = points[i - 1]; - var p2 = points[i]; - len += dist(p1, p2); - accLenArr.push(len); - } + EffectPolyline.prototype.createLine = function (lineData, idx, seriesScope) { + return new Polyline$1(lineData, idx, seriesScope); + }; - if (len === 0) { - this._length = 0; - return; - } + EffectPolyline.prototype._updateAnimationPoints = function (symbol, points) { + this._points = points; + var accLenArr = [0]; + var len = 0; - for (var i = 0; i < accLenArr.length; i++) { - accLenArr[i] /= len; - } + for (var i = 1; i < points.length; i++) { + var p1 = points[i - 1]; + var p2 = points[i]; + len += dist(p1, p2); + accLenArr.push(len); + } - this._offsets = accLenArr; - this._length = len; - }; + if (len === 0) { + this._length = 0; + return; + } - EffectPolyline.prototype._getLineLength = function () { - return this._length; - }; + for (var i = 0; i < accLenArr.length; i++) { + accLenArr[i] /= len; + } - EffectPolyline.prototype._updateSymbolPosition = function (symbol) { - var t = symbol.__t; - var points = this._points; - var offsets = this._offsets; - var len = points.length; + this._offsets = accLenArr; + this._length = len; + }; - if (!offsets) { - // Has length 0 - return; - } + EffectPolyline.prototype._getLineLength = function () { + return this._length; + }; - var lastFrame = this._lastFrame; - var frame; + EffectPolyline.prototype._updateSymbolPosition = function (symbol) { + var t = symbol.__t; + var points = this._points; + var offsets = this._offsets; + var len = points.length; - if (t < this._lastFramePercent) { - // Start from the next frame - // PENDING start from lastFrame ? - var start = Math.min(lastFrame + 1, len - 1); + if (!offsets) { + // Has length 0 + return; + } - for (frame = start; frame >= 0; frame--) { - if (offsets[frame] <= t) { - break; - } - } // PENDING really need to do this ? + var lastFrame = this._lastFrame; + var frame; + if (t < this._lastFramePercent) { + // Start from the next frame + // PENDING start from lastFrame ? + var start = Math.min(lastFrame + 1, len - 1); - frame = Math.min(frame, len - 2); - } else { - for (frame = lastFrame; frame < len; frame++) { - if (offsets[frame] > t) { - break; - } - } + for (frame = start; frame >= 0; frame--) { + if (offsets[frame] <= t) { + break; + } + } // PENDING really need to do this ? - frame = Math.min(frame - 1, len - 2); - } - var p = (t - offsets[frame]) / (offsets[frame + 1] - offsets[frame]); - var p0 = points[frame]; - var p1 = points[frame + 1]; - symbol.x = p0[0] * (1 - p) + p * p1[0]; - symbol.y = p0[1] * (1 - p) + p * p1[1]; - var tx = p1[0] - p0[0]; - var ty = p1[1] - p0[1]; - symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; - this._lastFrame = frame; - this._lastFramePercent = t; - symbol.ignore = false; - }; - return EffectPolyline; - }(EffectLine); + frame = Math.min(frame, len - 2); + } else { + for (frame = lastFrame; frame < len; frame++) { + if (offsets[frame] > t) { + break; + } + } + + frame = Math.min(frame - 1, len - 2); + } + + var p = (t - offsets[frame]) / (offsets[frame + 1] - offsets[frame]); + var p0 = points[frame]; + var p1 = points[frame + 1]; + symbol.x = p0[0] * (1 - p) + p * p1[0]; + symbol.y = p0[1] * (1 - p) + p * p1[1]; + var tx = p1[0] - p0[0]; + var ty = p1[1] - p0[1]; + symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; + this._lastFrame = frame; + this._lastFramePercent = t; + symbol.ignore = false; + }; + return EffectPolyline; + }(EffectLine); var LargeLinesPathShape = - /** @class */ - function () { - function LargeLinesPathShape() { - this.polyline = false; - this.curveness = 0; - this.segs = []; - } - - return LargeLinesPathShape; - }(); + /** @class */ + function () { + function LargeLinesPathShape() { + this.polyline = false; + this.curveness = 0; + this.segs = []; + } + + return LargeLinesPathShape; + }(); var LargeLinesPath = - /** @class */ - function (_super) { - __extends(LargeLinesPath, _super); + /** @class */ + function (_super) { + __extends(LargeLinesPath, _super); - function LargeLinesPath(opts) { - var _this = _super.call(this, opts) || this; + function LargeLinesPath(opts) { + var _this = _super.call(this, opts) || this; - _this._off = 0; - _this.hoverDataIdx = -1; - return _this; - } + _this._off = 0; + _this.hoverDataIdx = -1; + return _this; + } - LargeLinesPath.prototype.reset = function () { - this.notClear = false; - this._off = 0; - }; + LargeLinesPath.prototype.reset = function () { + this.notClear = false; + this._off = 0; + }; - LargeLinesPath.prototype.getDefaultStyle = function () { - return { - stroke: '#000', - fill: null - }; - }; + LargeLinesPath.prototype.getDefaultStyle = function () { + return { + stroke: '#000', + fill: null + }; + }; - LargeLinesPath.prototype.getDefaultShape = function () { - return new LargeLinesPathShape(); - }; + LargeLinesPath.prototype.getDefaultShape = function () { + return new LargeLinesPathShape(); + }; - LargeLinesPath.prototype.buildPath = function (ctx, shape) { - var segs = shape.segs; - var curveness = shape.curveness; - var i; + LargeLinesPath.prototype.buildPath = function (ctx, shape) { + var segs = shape.segs; + var curveness = shape.curveness; + var i; - if (shape.polyline) { - for (i = this._off; i < segs.length;) { - var count = segs[i++]; + if (shape.polyline) { + for (i = this._off; i < segs.length;) { + var count = segs[i++]; - if (count > 0) { - ctx.moveTo(segs[i++], segs[i++]); + if (count > 0) { + ctx.moveTo(segs[i++], segs[i++]); - for (var k = 1; k < count; k++) { - ctx.lineTo(segs[i++], segs[i++]); - } - } - } - } else { - for (i = this._off; i < segs.length;) { - var x0 = segs[i++]; - var y0 = segs[i++]; - var x1 = segs[i++]; - var y1 = segs[i++]; - ctx.moveTo(x0, y0); - - if (curveness > 0) { - var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness; - var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness; - ctx.quadraticCurveTo(x2, y2, x1, y1); - } else { - ctx.lineTo(x1, y1); - } - } - } + for (var k = 1; k < count; k++) { + ctx.lineTo(segs[i++], segs[i++]); + } + } + } + } else { + for (i = this._off; i < segs.length;) { + var x0 = segs[i++]; + var y0 = segs[i++]; + var x1 = segs[i++]; + var y1 = segs[i++]; + ctx.moveTo(x0, y0); + + if (curveness > 0) { + var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness; + var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness; + ctx.quadraticCurveTo(x2, y2, x1, y1); + } else { + ctx.lineTo(x1, y1); + } + } + } - if (this.incremental) { - this._off = i; - this.notClear = true; - } - }; + if (this.incremental) { + this._off = i; + this.notClear = true; + } + }; - LargeLinesPath.prototype.findDataIndex = function (x, y) { - var shape = this.shape; - var segs = shape.segs; - var curveness = shape.curveness; - var lineWidth = this.style.lineWidth; + LargeLinesPath.prototype.findDataIndex = function (x, y) { + var shape = this.shape; + var segs = shape.segs; + var curveness = shape.curveness; + var lineWidth = this.style.lineWidth; - if (shape.polyline) { - var dataIndex = 0; + if (shape.polyline) { + var dataIndex = 0; - for (var i = 0; i < segs.length;) { - var count = segs[i++]; + for (var i = 0; i < segs.length;) { + var count = segs[i++]; - if (count > 0) { - var x0 = segs[i++]; - var y0 = segs[i++]; + if (count > 0) { + var x0 = segs[i++]; + var y0 = segs[i++]; - for (var k = 1; k < count; k++) { - var x1 = segs[i++]; - var y1 = segs[i++]; + for (var k = 1; k < count; k++) { + var x1 = segs[i++]; + var y1 = segs[i++]; - if (containStroke(x0, y0, x1, y1, lineWidth, x, y)) { - return dataIndex; - } - } - } + if (containStroke(x0, y0, x1, y1, lineWidth, x, y)) { + return dataIndex; + } + } + } - dataIndex++; - } - } else { - var dataIndex = 0; + dataIndex++; + } + } else { + var dataIndex = 0; - for (var i = 0; i < segs.length;) { - var x0 = segs[i++]; - var y0 = segs[i++]; - var x1 = segs[i++]; - var y1 = segs[i++]; + for (var i = 0; i < segs.length;) { + var x0 = segs[i++]; + var y0 = segs[i++]; + var x1 = segs[i++]; + var y1 = segs[i++]; - if (curveness > 0) { - var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness; - var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness; + if (curveness > 0) { + var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness; + var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness; - if (containStroke$2(x0, y0, x2, y2, x1, y1, lineWidth, x, y)) { - return dataIndex; - } - } else { - if (containStroke(x0, y0, x1, y1, lineWidth, x, y)) { - return dataIndex; - } - } + if (containStroke$2(x0, y0, x2, y2, x1, y1, lineWidth, x, y)) { + return dataIndex; + } + } else { + if (containStroke(x0, y0, x1, y1, lineWidth, x, y)) { + return dataIndex; + } + } - dataIndex++; - } - } + dataIndex++; + } + } - return -1; - }; + return -1; + }; - LargeLinesPath.prototype.contain = function (x, y) { - var localPos = this.transformCoordToLocal(x, y); - var rect = this.getBoundingRect(); - x = localPos[0]; - y = localPos[1]; + LargeLinesPath.prototype.contain = function (x, y) { + var localPos = this.transformCoordToLocal(x, y); + var rect = this.getBoundingRect(); + x = localPos[0]; + y = localPos[1]; - if (rect.contain(x, y)) { - // Cache found data index. - var dataIdx = this.hoverDataIdx = this.findDataIndex(x, y); - return dataIdx >= 0; - } + if (rect.contain(x, y)) { + // Cache found data index. + var dataIdx = this.hoverDataIdx = this.findDataIndex(x, y); + return dataIdx >= 0; + } - this.hoverDataIdx = -1; - return false; - }; + this.hoverDataIdx = -1; + return false; + }; - LargeLinesPath.prototype.getBoundingRect = function () { - // Ignore stroke for large symbol draw. - var rect = this._rect; - - if (!rect) { - var shape = this.shape; - var points = shape.segs; - var minX = Infinity; - var minY = Infinity; - var maxX = -Infinity; - var maxY = -Infinity; - - for (var i = 0; i < points.length;) { - var x = points[i++]; - var y = points[i++]; - minX = Math.min(x, minX); - maxX = Math.max(x, maxX); - minY = Math.min(y, minY); - maxY = Math.max(y, maxY); - } + LargeLinesPath.prototype.getBoundingRect = function () { + // Ignore stroke for large symbol draw. + var rect = this._rect; - rect = this._rect = new BoundingRect(minX, minY, maxX, maxY); - } + if (!rect) { + var shape = this.shape; + var points = shape.segs; + var minX = Infinity; + var minY = Infinity; + var maxX = -Infinity; + var maxY = -Infinity; - return rect; - }; + for (var i = 0; i < points.length;) { + var x = points[i++]; + var y = points[i++]; + minX = Math.min(x, minX); + maxX = Math.max(x, maxX); + minY = Math.min(y, minY); + maxY = Math.max(y, maxY); + } - return LargeLinesPath; - }(Path); + rect = this._rect = new BoundingRect(minX, minY, maxX, maxY); + } - var LargeLineDraw = - /** @class */ - function () { - function LargeLineDraw() { - this.group = new Group(); - } - /** - * Update symbols draw by new data - */ + return rect; + }; + return LargeLinesPath; + }(Path); - LargeLineDraw.prototype.updateData = function (data) { - this._clear(); + var LargeLineDraw = + /** @class */ + function () { + function LargeLineDraw() { + this.group = new Group(); + } + /** + * Update symbols draw by new data + */ - var lineEl = this._create(); - lineEl.setShape({ - segs: data.getLayout('linesPoints') - }); + LargeLineDraw.prototype.updateData = function (data) { + this._clear(); - this._setCommon(lineEl, data); - }; - /** - * @override - */ + var lineEl = this._create(); - LargeLineDraw.prototype.incrementalPrepareUpdate = function (data) { - this.group.removeAll(); + lineEl.setShape({ + segs: data.getLayout('linesPoints') + }); - this._clear(); - }; - /** - * @override - */ + this._setCommon(lineEl, data); + }; + /** + * @override + */ - LargeLineDraw.prototype.incrementalUpdate = function (taskParams, data) { - var lastAdded = this._newAdded[0]; - var linePoints = data.getLayout('linesPoints'); - var oldSegs = lastAdded && lastAdded.shape.segs; // Merging the exists. Each element has 1e4 points. - // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization) + LargeLineDraw.prototype.incrementalPrepareUpdate = function (data) { + this.group.removeAll(); - if (oldSegs && oldSegs.length < 2e4) { - var oldLen = oldSegs.length; - var newSegs = new Float32Array(oldLen + linePoints.length); // Concat two array + this._clear(); + }; + /** + * @override + */ - newSegs.set(oldSegs); - newSegs.set(linePoints, oldLen); - lastAdded.setShape({ - segs: newSegs - }); - } else { - // Clear - this._newAdded = []; + LargeLineDraw.prototype.incrementalUpdate = function (taskParams, data) { + var lastAdded = this._newAdded[0]; + var linePoints = data.getLayout('linesPoints'); + var oldSegs = lastAdded && lastAdded.shape.segs; // Merging the exists. Each element has 1e4 points. + // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization) + + if (oldSegs && oldSegs.length < 2e4) { + var oldLen = oldSegs.length; + var newSegs = new Float32Array(oldLen + linePoints.length); // Concat two array + + newSegs.set(oldSegs); + newSegs.set(linePoints, oldLen); + lastAdded.setShape({ + segs: newSegs + }); + } else { + // Clear + this._newAdded = []; - var lineEl = this._create(); + var lineEl = this._create(); - lineEl.incremental = true; - lineEl.setShape({ - segs: linePoints - }); + lineEl.incremental = true; + lineEl.setShape({ + segs: linePoints + }); - this._setCommon(lineEl, data); + this._setCommon(lineEl, data); - lineEl.__startIndex = taskParams.start; - } - }; - /** - * @override - */ + lineEl.__startIndex = taskParams.start; + } + }; + /** + * @override + */ - LargeLineDraw.prototype.remove = function () { - this._clear(); - }; + LargeLineDraw.prototype.remove = function () { + this._clear(); + }; - LargeLineDraw.prototype.eachRendered = function (cb) { - this._newAdded[0] && cb(this._newAdded[0]); - }; + LargeLineDraw.prototype.eachRendered = function (cb) { + this._newAdded[0] && cb(this._newAdded[0]); + }; - LargeLineDraw.prototype._create = function () { - var lineEl = new LargeLinesPath({ - cursor: 'default' - }); + LargeLineDraw.prototype._create = function () { + var lineEl = new LargeLinesPath({ + cursor: 'default' + }); - this._newAdded.push(lineEl); + this._newAdded.push(lineEl); - this.group.add(lineEl); - return lineEl; - }; + this.group.add(lineEl); + return lineEl; + }; - LargeLineDraw.prototype._setCommon = function (lineEl, data, isIncremental) { - var hostModel = data.hostModel; - lineEl.setShape({ - polyline: hostModel.get('polyline'), - curveness: hostModel.get(['lineStyle', 'curveness']) - }); - lineEl.useStyle(hostModel.getModel('lineStyle').getLineStyle()); - lineEl.style.strokeNoScale = true; - var style = data.getVisual('style'); + LargeLineDraw.prototype._setCommon = function (lineEl, data, isIncremental) { + var hostModel = data.hostModel; + lineEl.setShape({ + polyline: hostModel.get('polyline'), + curveness: hostModel.get(['lineStyle', 'curveness']) + }); + lineEl.useStyle(hostModel.getModel('lineStyle').getLineStyle()); + lineEl.style.strokeNoScale = true; + var style = data.getVisual('style'); - if (style && style.stroke) { - lineEl.setStyle('stroke', style.stroke); - } + if (style && style.stroke) { + lineEl.setStyle('stroke', style.stroke); + } - lineEl.setStyle('fill', null); - var ecData = getECData(lineEl); // Enable tooltip - // PENDING May have performance issue when path is extremely large + lineEl.setStyle('fill', null); + var ecData = getECData(lineEl); // Enable tooltip + // PENDING May have performance issue when path is extremely large - ecData.seriesIndex = hostModel.seriesIndex; - lineEl.on('mousemove', function (e) { - ecData.dataIndex = null; - var dataIndex = lineEl.hoverDataIdx; + ecData.seriesIndex = hostModel.seriesIndex; + lineEl.on('mousemove', function (e) { + ecData.dataIndex = null; + var dataIndex = lineEl.hoverDataIdx; - if (dataIndex > 0) { - // Provide dataIndex for tooltip - ecData.dataIndex = dataIndex + lineEl.__startIndex; - } - }); - }; + if (dataIndex > 0) { + // Provide dataIndex for tooltip + ecData.dataIndex = dataIndex + lineEl.__startIndex; + } + }); + }; - LargeLineDraw.prototype._clear = function () { - this._newAdded = []; - this.group.removeAll(); - }; - return LargeLineDraw; - }(); + LargeLineDraw.prototype._clear = function () { + this._newAdded = []; + this.group.removeAll(); + }; + return LargeLineDraw; + }(); var linesLayout = { - seriesType: 'lines', - plan: createRenderPlanner(), - reset: function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; - - if (!coordSys) { - if ("development" !== 'production') { - error('The lines series must have a coordinate system.'); - } + seriesType: 'lines', + plan: createRenderPlanner(), + reset: function (seriesModel) { + var coordSys = seriesModel.coordinateSystem; - return; - } + if (!coordSys) { + if ("development" !== 'production') { + error('The lines series must have a coordinate system.'); + } - var isPolyline = seriesModel.get('polyline'); - var isLarge = seriesModel.pipelineContext.large; - return { - progress: function (params, lineData) { - var lineCoords = []; + return; + } - if (isLarge) { - var points = void 0; - var segCount = params.end - params.start; + var isPolyline = seriesModel.get('polyline'); + var isLarge = seriesModel.pipelineContext.large; + return { + progress: function (params, lineData) { + var lineCoords = []; - if (isPolyline) { - var totalCoordsCount = 0; + if (isLarge) { + var points = void 0; + var segCount = params.end - params.start; - for (var i = params.start; i < params.end; i++) { - totalCoordsCount += seriesModel.getLineCoordsCount(i); - } + if (isPolyline) { + var totalCoordsCount = 0; - points = new Float32Array(segCount + totalCoordsCount * 2); - } else { - points = new Float32Array(segCount * 4); - } + for (var i = params.start; i < params.end; i++) { + totalCoordsCount += seriesModel.getLineCoordsCount(i); + } - var offset = 0; - var pt = []; + points = new Float32Array(segCount + totalCoordsCount * 2); + } else { + points = new Float32Array(segCount * 4); + } - for (var i = params.start; i < params.end; i++) { - var len = seriesModel.getLineCoords(i, lineCoords); + var offset = 0; + var pt = []; - if (isPolyline) { - points[offset++] = len; - } + for (var i = params.start; i < params.end; i++) { + var len = seriesModel.getLineCoords(i, lineCoords); - for (var k = 0; k < len; k++) { - pt = coordSys.dataToPoint(lineCoords[k], false, pt); - points[offset++] = pt[0]; - points[offset++] = pt[1]; - } - } + if (isPolyline) { + points[offset++] = len; + } - lineData.setLayout('linesPoints', points); - } else { - for (var i = params.start; i < params.end; i++) { - var itemModel = lineData.getItemModel(i); - var len = seriesModel.getLineCoords(i, lineCoords); - var pts = []; - - if (isPolyline) { - for (var j = 0; j < len; j++) { - pts.push(coordSys.dataToPoint(lineCoords[j])); - } - } else { - pts[0] = coordSys.dataToPoint(lineCoords[0]); - pts[1] = coordSys.dataToPoint(lineCoords[1]); - var curveness = itemModel.get(['lineStyle', 'curveness']); + for (var k = 0; k < len; k++) { + pt = coordSys.dataToPoint(lineCoords[k], false, pt); + points[offset++] = pt[0]; + points[offset++] = pt[1]; + } + } - if (+curveness) { - pts[2] = [(pts[0][0] + pts[1][0]) / 2 - (pts[0][1] - pts[1][1]) * curveness, (pts[0][1] + pts[1][1]) / 2 - (pts[1][0] - pts[0][0]) * curveness]; - } - } + lineData.setLayout('linesPoints', points); + } else { + for (var i = params.start; i < params.end; i++) { + var itemModel = lineData.getItemModel(i); + var len = seriesModel.getLineCoords(i, lineCoords); + var pts = []; + + if (isPolyline) { + for (var j = 0; j < len; j++) { + pts.push(coordSys.dataToPoint(lineCoords[j])); + } + } else { + pts[0] = coordSys.dataToPoint(lineCoords[0]); + pts[1] = coordSys.dataToPoint(lineCoords[1]); + var curveness = itemModel.get(['lineStyle', 'curveness']); - lineData.setItemLayout(i, pts); - } - } + if (+curveness) { + pts[2] = [(pts[0][0] + pts[1][0]) / 2 - (pts[0][1] - pts[1][1]) * curveness, (pts[0][1] + pts[1][1]) / 2 - (pts[1][0] - pts[0][0]) * curveness]; + } } - }; - } + + lineData.setItemLayout(i, pts); + } + } + } + }; + } }; var LinesView = - /** @class */ - function (_super) { - __extends(LinesView, _super); + /** @class */ + function (_super) { + __extends(LinesView, _super); - function LinesView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function LinesView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = LinesView.type; - return _this; - } + _this.type = LinesView.type; + return _this; + } - LinesView.prototype.render = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); + LinesView.prototype.render = function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); - var lineDraw = this._updateLineDraw(data, seriesModel); + var lineDraw = this._updateLineDraw(data, seriesModel); - var zlevel = seriesModel.get('zlevel'); - var trailLength = seriesModel.get(['effect', 'trailLength']); - var zr = api.getZr(); // Avoid the drag cause ghost shadow - // FIXME Better way ? - // SVG doesn't support + var zlevel = seriesModel.get('zlevel'); + var trailLength = seriesModel.get(['effect', 'trailLength']); + var zr = api.getZr(); // Avoid the drag cause ghost shadow + // FIXME Better way ? + // SVG doesn't support - var isSvg = zr.painter.getType() === 'svg'; + var isSvg = zr.painter.getType() === 'svg'; - if (!isSvg) { - zr.painter.getLayer(zlevel).clear(true); - } // Config layer with motion blur + if (!isSvg) { + zr.painter.getLayer(zlevel).clear(true); + } // Config layer with motion blur - if (this._lastZlevel != null && !isSvg) { - zr.configLayer(this._lastZlevel, { - motionBlur: false - }); - } + if (this._lastZlevel != null && !isSvg) { + zr.configLayer(this._lastZlevel, { + motionBlur: false + }); + } - if (this._showEffect(seriesModel) && trailLength > 0) { - if (!isSvg) { - zr.configLayer(zlevel, { - motionBlur: true, - lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0) - }); - } else if ("development" !== 'production') { - console.warn('SVG render mode doesn\'t support lines with trail effect'); - } - } + if (this._showEffect(seriesModel) && trailLength > 0) { + if (!isSvg) { + zr.configLayer(zlevel, { + motionBlur: true, + lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0) + }); + } else if ("development" !== 'production') { + console.warn('SVG render mode doesn\'t support lines with trail effect'); + } + } - lineDraw.updateData(data); - var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel); + lineDraw.updateData(data); + var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel); - if (clipPath) { - this.group.setClipPath(clipPath); - } else { - this.group.removeClipPath(); - } + if (clipPath) { + this.group.setClipPath(clipPath); + } else { + this.group.removeClipPath(); + } - this._lastZlevel = zlevel; - this._finished = true; - }; + this._lastZlevel = zlevel; + this._finished = true; + }; - LinesView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); + LinesView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); - var lineDraw = this._updateLineDraw(data, seriesModel); + var lineDraw = this._updateLineDraw(data, seriesModel); - lineDraw.incrementalPrepareUpdate(data); + lineDraw.incrementalPrepareUpdate(data); - this._clearLayer(api); + this._clearLayer(api); - this._finished = false; - }; + this._finished = false; + }; - LinesView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) { - this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData()); + LinesView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) { + this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData()); - this._finished = taskParams.end === seriesModel.getData().count(); - }; + this._finished = taskParams.end === seriesModel.getData().count(); + }; - LinesView.prototype.eachRendered = function (cb) { - this._lineDraw && this._lineDraw.eachRendered(cb); - }; + LinesView.prototype.eachRendered = function (cb) { + this._lineDraw && this._lineDraw.eachRendered(cb); + }; - LinesView.prototype.updateTransform = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - var pipelineContext = seriesModel.pipelineContext; + LinesView.prototype.updateTransform = function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); + var pipelineContext = seriesModel.pipelineContext; - if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) { - // TODO Don't have to do update in large mode. Only do it when there are millions of data. - return { - update: true - }; - } else { - // TODO Use same logic with ScatterView. - // Manually update layout - var res = linesLayout.reset(seriesModel, ecModel, api); + if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) { + // TODO Don't have to do update in large mode. Only do it when there are millions of data. + return { + update: true + }; + } else { + // TODO Use same logic with ScatterView. + // Manually update layout + var res = linesLayout.reset(seriesModel, ecModel, api); - if (res.progress) { - res.progress({ - start: 0, - end: data.count(), - count: data.count() - }, data); - } // Not in large mode + if (res.progress) { + res.progress({ + start: 0, + end: data.count(), + count: data.count() + }, data); + } // Not in large mode - this._lineDraw.updateLayout(); + this._lineDraw.updateLayout(); - this._clearLayer(api); - } - }; + this._clearLayer(api); + } + }; - LinesView.prototype._updateLineDraw = function (data, seriesModel) { - var lineDraw = this._lineDraw; + LinesView.prototype._updateLineDraw = function (data, seriesModel) { + var lineDraw = this._lineDraw; - var hasEffect = this._showEffect(seriesModel); + var hasEffect = this._showEffect(seriesModel); - var isPolyline = !!seriesModel.get('polyline'); - var pipelineContext = seriesModel.pipelineContext; - var isLargeDraw = pipelineContext.large; + var isPolyline = !!seriesModel.get('polyline'); + var pipelineContext = seriesModel.pipelineContext; + var isLargeDraw = pipelineContext.large; - if ("development" !== 'production') { - if (hasEffect && isLargeDraw) { - console.warn('Large lines not support effect'); - } - } + if ("development" !== 'production') { + if (hasEffect && isLargeDraw) { + console.warn('Large lines not support effect'); + } + } - if (!lineDraw || hasEffect !== this._hasEffet || isPolyline !== this._isPolyline || isLargeDraw !== this._isLargeDraw) { - if (lineDraw) { - lineDraw.remove(); - } + if (!lineDraw || hasEffect !== this._hasEffet || isPolyline !== this._isPolyline || isLargeDraw !== this._isLargeDraw) { + if (lineDraw) { + lineDraw.remove(); + } - lineDraw = this._lineDraw = isLargeDraw ? new LargeLineDraw() : new LineDraw(isPolyline ? hasEffect ? EffectPolyline : Polyline$1 : hasEffect ? EffectLine : Line$1); - this._hasEffet = hasEffect; - this._isPolyline = isPolyline; - this._isLargeDraw = isLargeDraw; - } + lineDraw = this._lineDraw = isLargeDraw ? new LargeLineDraw() : new LineDraw(isPolyline ? hasEffect ? EffectPolyline : Polyline$1 : hasEffect ? EffectLine : Line$1); + this._hasEffet = hasEffect; + this._isPolyline = isPolyline; + this._isLargeDraw = isLargeDraw; + } - this.group.add(lineDraw.group); - return lineDraw; - }; + this.group.add(lineDraw.group); + return lineDraw; + }; - LinesView.prototype._showEffect = function (seriesModel) { - return !!seriesModel.get(['effect', 'show']); - }; + LinesView.prototype._showEffect = function (seriesModel) { + return !!seriesModel.get(['effect', 'show']); + }; - LinesView.prototype._clearLayer = function (api) { - // Not use motion when dragging or zooming - var zr = api.getZr(); - var isSvg = zr.painter.getType() === 'svg'; + LinesView.prototype._clearLayer = function (api) { + // Not use motion when dragging or zooming + var zr = api.getZr(); + var isSvg = zr.painter.getType() === 'svg'; - if (!isSvg && this._lastZlevel != null) { - zr.painter.getLayer(this._lastZlevel).clear(true); - } - }; + if (!isSvg && this._lastZlevel != null) { + zr.painter.getLayer(this._lastZlevel).clear(true); + } + }; - LinesView.prototype.remove = function (ecModel, api) { - this._lineDraw && this._lineDraw.remove(); - this._lineDraw = null; // Clear motion when lineDraw is removed + LinesView.prototype.remove = function (ecModel, api) { + this._lineDraw && this._lineDraw.remove(); + this._lineDraw = null; // Clear motion when lineDraw is removed - this._clearLayer(api); - }; + this._clearLayer(api); + }; - LinesView.prototype.dispose = function (ecModel, api) { - this.remove(ecModel, api); - }; + LinesView.prototype.dispose = function (ecModel, api) { + this.remove(ecModel, api); + }; - LinesView.type = 'lines'; - return LinesView; - }(ChartView); + LinesView.type = 'lines'; + return LinesView; + }(ChartView); var Uint32Arr = typeof Uint32Array === 'undefined' ? Array : Uint32Array; var Float64Arr = typeof Float64Array === 'undefined' ? Array : Float64Array; function compatEc2(seriesOpt) { - var data = seriesOpt.data; + var data = seriesOpt.data; - if (data && data[0] && data[0][0] && data[0][0].coord) { - if ("development" !== 'production') { - console.warn('Lines data configuration has been changed to' + ' { coords:[[1,2],[2,3]] }'); - } + if (data && data[0] && data[0][0] && data[0][0].coord) { + if ("development" !== 'production') { + console.warn('Lines data configuration has been changed to' + ' { coords:[[1,2],[2,3]] }'); + } - seriesOpt.data = map(data, function (itemOpt) { - var coords = [itemOpt[0].coord, itemOpt[1].coord]; - var target = { - coords: coords - }; + seriesOpt.data = map(data, function (itemOpt) { + var coords = [itemOpt[0].coord, itemOpt[1].coord]; + var target = { + coords: coords + }; - if (itemOpt[0].name) { - target.fromName = itemOpt[0].name; - } + if (itemOpt[0].name) { + target.fromName = itemOpt[0].name; + } - if (itemOpt[1].name) { - target.toName = itemOpt[1].name; - } + if (itemOpt[1].name) { + target.toName = itemOpt[1].name; + } - return mergeAll([target, itemOpt[0], itemOpt[1]]); - }); - } + return mergeAll([target, itemOpt[0], itemOpt[1]]); + }); + } } var LinesSeriesModel = - /** @class */ - function (_super) { - __extends(LinesSeriesModel, _super); + /** @class */ + function (_super) { + __extends(LinesSeriesModel, _super); - function LinesSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = LinesSeriesModel.type; - _this.visualStyleAccessPath = 'lineStyle'; - _this.visualDrawType = 'stroke'; - return _this; - } + function LinesSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - LinesSeriesModel.prototype.init = function (option) { - // The input data may be null/undefined. - option.data = option.data || []; // Not using preprocessor because mergeOption may not have series.type + _this.type = LinesSeriesModel.type; + _this.visualStyleAccessPath = 'lineStyle'; + _this.visualDrawType = 'stroke'; + return _this; + } - compatEc2(option); + LinesSeriesModel.prototype.init = function (option) { + // The input data may be null/undefined. + option.data = option.data || []; // Not using preprocessor because mergeOption may not have series.type - var result = this._processFlatCoordsArray(option.data); + compatEc2(option); - this._flatCoords = result.flatCoords; - this._flatCoordsOffset = result.flatCoordsOffset; + var result = this._processFlatCoordsArray(option.data); - if (result.flatCoords) { - option.data = new Float32Array(result.count); - } + this._flatCoords = result.flatCoords; + this._flatCoordsOffset = result.flatCoordsOffset; - _super.prototype.init.apply(this, arguments); - }; + if (result.flatCoords) { + option.data = new Float32Array(result.count); + } - LinesSeriesModel.prototype.mergeOption = function (option) { - compatEc2(option); + _super.prototype.init.apply(this, arguments); + }; - if (option.data) { - // Only update when have option data to merge. - var result = this._processFlatCoordsArray(option.data); + LinesSeriesModel.prototype.mergeOption = function (option) { + compatEc2(option); - this._flatCoords = result.flatCoords; - this._flatCoordsOffset = result.flatCoordsOffset; + if (option.data) { + // Only update when have option data to merge. + var result = this._processFlatCoordsArray(option.data); - if (result.flatCoords) { - option.data = new Float32Array(result.count); - } - } + this._flatCoords = result.flatCoords; + this._flatCoordsOffset = result.flatCoordsOffset; - _super.prototype.mergeOption.apply(this, arguments); - }; + if (result.flatCoords) { + option.data = new Float32Array(result.count); + } + } - LinesSeriesModel.prototype.appendData = function (params) { - var result = this._processFlatCoordsArray(params.data); + _super.prototype.mergeOption.apply(this, arguments); + }; - if (result.flatCoords) { - if (!this._flatCoords) { - this._flatCoords = result.flatCoords; - this._flatCoordsOffset = result.flatCoordsOffset; - } else { - this._flatCoords = concatArray(this._flatCoords, result.flatCoords); - this._flatCoordsOffset = concatArray(this._flatCoordsOffset, result.flatCoordsOffset); - } + LinesSeriesModel.prototype.appendData = function (params) { + var result = this._processFlatCoordsArray(params.data); - params.data = new Float32Array(result.count); - } + if (result.flatCoords) { + if (!this._flatCoords) { + this._flatCoords = result.flatCoords; + this._flatCoordsOffset = result.flatCoordsOffset; + } else { + this._flatCoords = concatArray(this._flatCoords, result.flatCoords); + this._flatCoordsOffset = concatArray(this._flatCoordsOffset, result.flatCoordsOffset); + } - this.getRawData().appendData(params.data); - }; + params.data = new Float32Array(result.count); + } - LinesSeriesModel.prototype._getCoordsFromItemModel = function (idx) { - var itemModel = this.getData().getItemModel(idx); - var coords = itemModel.option instanceof Array ? itemModel.option : itemModel.getShallow('coords'); + this.getRawData().appendData(params.data); + }; - if ("development" !== 'production') { - if (!(coords instanceof Array && coords.length > 0 && coords[0] instanceof Array)) { - throw new Error('Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.'); - } - } + LinesSeriesModel.prototype._getCoordsFromItemModel = function (idx) { + var itemModel = this.getData().getItemModel(idx); + var coords = itemModel.option instanceof Array ? itemModel.option : itemModel.getShallow('coords'); - return coords; - }; + if ("development" !== 'production') { + if (!(coords instanceof Array && coords.length > 0 && coords[0] instanceof Array)) { + throw new Error('Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.'); + } + } - LinesSeriesModel.prototype.getLineCoordsCount = function (idx) { - if (this._flatCoordsOffset) { - return this._flatCoordsOffset[idx * 2 + 1]; - } else { - return this._getCoordsFromItemModel(idx).length; - } - }; + return coords; + }; - LinesSeriesModel.prototype.getLineCoords = function (idx, out) { - if (this._flatCoordsOffset) { - var offset = this._flatCoordsOffset[idx * 2]; - var len = this._flatCoordsOffset[idx * 2 + 1]; + LinesSeriesModel.prototype.getLineCoordsCount = function (idx) { + if (this._flatCoordsOffset) { + return this._flatCoordsOffset[idx * 2 + 1]; + } else { + return this._getCoordsFromItemModel(idx).length; + } + }; - for (var i = 0; i < len; i++) { - out[i] = out[i] || []; - out[i][0] = this._flatCoords[offset + i * 2]; - out[i][1] = this._flatCoords[offset + i * 2 + 1]; - } + LinesSeriesModel.prototype.getLineCoords = function (idx, out) { + if (this._flatCoordsOffset) { + var offset = this._flatCoordsOffset[idx * 2]; + var len = this._flatCoordsOffset[idx * 2 + 1]; - return len; - } else { - var coords = this._getCoordsFromItemModel(idx); + for (var i = 0; i < len; i++) { + out[i] = out[i] || []; + out[i][0] = this._flatCoords[offset + i * 2]; + out[i][1] = this._flatCoords[offset + i * 2 + 1]; + } - for (var i = 0; i < coords.length; i++) { - out[i] = out[i] || []; - out[i][0] = coords[i][0]; - out[i][1] = coords[i][1]; - } + return len; + } else { + var coords = this._getCoordsFromItemModel(idx); - return coords.length; - } - }; + for (var i = 0; i < coords.length; i++) { + out[i] = out[i] || []; + out[i][0] = coords[i][0]; + out[i][1] = coords[i][1]; + } - LinesSeriesModel.prototype._processFlatCoordsArray = function (data) { - var startOffset = 0; + return coords.length; + } + }; - if (this._flatCoords) { - startOffset = this._flatCoords.length; - } // Stored as a typed array. In format - // Points Count(2) | x | y | x | y | Points Count(3) | x | y | x | y | x | y | + LinesSeriesModel.prototype._processFlatCoordsArray = function (data) { + var startOffset = 0; + if (this._flatCoords) { + startOffset = this._flatCoords.length; + } // Stored as a typed array. In format + // Points Count(2) | x | y | x | y | Points Count(3) | x | y | x | y | x | y | - if (isNumber(data[0])) { - var len = data.length; // Store offset and len of each segment - var coordsOffsetAndLenStorage = new Uint32Arr(len); - var coordsStorage = new Float64Arr(len); - var coordsCursor = 0; - var offsetCursor = 0; - var dataCount = 0; + if (isNumber(data[0])) { + var len = data.length; // Store offset and len of each segment - for (var i = 0; i < len;) { - dataCount++; - var count = data[i++]; // Offset + var coordsOffsetAndLenStorage = new Uint32Arr(len); + var coordsStorage = new Float64Arr(len); + var coordsCursor = 0; + var offsetCursor = 0; + var dataCount = 0; - coordsOffsetAndLenStorage[offsetCursor++] = coordsCursor + startOffset; // Len + for (var i = 0; i < len;) { + dataCount++; + var count = data[i++]; // Offset - coordsOffsetAndLenStorage[offsetCursor++] = count; + coordsOffsetAndLenStorage[offsetCursor++] = coordsCursor + startOffset; // Len - for (var k = 0; k < count; k++) { - var x = data[i++]; - var y = data[i++]; - coordsStorage[coordsCursor++] = x; - coordsStorage[coordsCursor++] = y; + coordsOffsetAndLenStorage[offsetCursor++] = count; - if (i > len) { - if ("development" !== 'production') { - throw new Error('Invalid data format.'); - } - } - } - } + for (var k = 0; k < count; k++) { + var x = data[i++]; + var y = data[i++]; + coordsStorage[coordsCursor++] = x; + coordsStorage[coordsCursor++] = y; - return { - flatCoordsOffset: new Uint32Array(coordsOffsetAndLenStorage.buffer, 0, offsetCursor), - flatCoords: coordsStorage, - count: dataCount - }; + if (i > len) { + if ("development" !== 'production') { + throw new Error('Invalid data format.'); } + } + } + } - return { - flatCoordsOffset: null, - flatCoords: null, - count: data.length - }; - }; + return { + flatCoordsOffset: new Uint32Array(coordsOffsetAndLenStorage.buffer, 0, offsetCursor), + flatCoords: coordsStorage, + count: dataCount + }; + } - LinesSeriesModel.prototype.getInitialData = function (option, ecModel) { - if ("development" !== 'production') { - var CoordSys = CoordinateSystemManager.get(option.coordinateSystem); + return { + flatCoordsOffset: null, + flatCoords: null, + count: data.length + }; + }; - if (!CoordSys) { - throw new Error('Unkown coordinate system ' + option.coordinateSystem); - } - } + LinesSeriesModel.prototype.getInitialData = function (option, ecModel) { + if ("development" !== 'production') { + var CoordSys = CoordinateSystemManager.get(option.coordinateSystem); - var lineData = new SeriesData(['value'], this); - lineData.hasItemOption = false; - lineData.initData(option.data, [], function (dataItem, dimName, dataIndex, dimIndex) { - // dataItem is simply coords - if (dataItem instanceof Array) { - return NaN; - } else { - lineData.hasItemOption = true; - var value = dataItem.value; + if (!CoordSys) { + throw new Error('Unkown coordinate system ' + option.coordinateSystem); + } + } - if (value != null) { - return value instanceof Array ? value[dimIndex] : value; - } - } - }); - return lineData; - }; + var lineData = new SeriesData(['value'], this); + lineData.hasItemOption = false; + lineData.initData(option.data, [], function (dataItem, dimName, dataIndex, dimIndex) { + // dataItem is simply coords + if (dataItem instanceof Array) { + return NaN; + } else { + lineData.hasItemOption = true; + var value = dataItem.value; - LinesSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - var data = this.getData(); - var itemModel = data.getItemModel(dataIndex); - var name = itemModel.get('name'); + if (value != null) { + return value instanceof Array ? value[dimIndex] : value; + } + } + }); + return lineData; + }; - if (name) { - return name; - } + LinesSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { + var data = this.getData(); + var itemModel = data.getItemModel(dataIndex); + var name = itemModel.get('name'); - var fromName = itemModel.get('fromName'); - var toName = itemModel.get('toName'); - var nameArr = []; - fromName != null && nameArr.push(fromName); - toName != null && nameArr.push(toName); - return createTooltipMarkup('nameValue', { - name: nameArr.join(' > ') - }); - }; + if (name) { + return name; + } - LinesSeriesModel.prototype.preventIncremental = function () { - return !!this.get(['effect', 'show']); - }; + var fromName = itemModel.get('fromName'); + var toName = itemModel.get('toName'); + var nameArr = []; + fromName != null && nameArr.push(fromName); + toName != null && nameArr.push(toName); + return createTooltipMarkup('nameValue', { + name: nameArr.join(' > ') + }); + }; - LinesSeriesModel.prototype.getProgressive = function () { - var progressive = this.option.progressive; + LinesSeriesModel.prototype.preventIncremental = function () { + return !!this.get(['effect', 'show']); + }; - if (progressive == null) { - return this.option.large ? 1e4 : this.get('progressive'); - } + LinesSeriesModel.prototype.getProgressive = function () { + var progressive = this.option.progressive; - return progressive; - }; + if (progressive == null) { + return this.option.large ? 1e4 : this.get('progressive'); + } - LinesSeriesModel.prototype.getProgressiveThreshold = function () { - var progressiveThreshold = this.option.progressiveThreshold; + return progressive; + }; - if (progressiveThreshold == null) { - return this.option.large ? 2e4 : this.get('progressiveThreshold'); - } + LinesSeriesModel.prototype.getProgressiveThreshold = function () { + var progressiveThreshold = this.option.progressiveThreshold; - return progressiveThreshold; - }; + if (progressiveThreshold == null) { + return this.option.large ? 2e4 : this.get('progressiveThreshold'); + } - LinesSeriesModel.prototype.getZLevelKey = function () { - var effectModel = this.getModel('effect'); - var trailLength = effectModel.get('trailLength'); - return this.getData().count() > this.getProgressiveThreshold() // Each progressive series has individual key. - ? this.id : effectModel.get('show') && trailLength > 0 ? trailLength + '' : ''; - }; + return progressiveThreshold; + }; - LinesSeriesModel.type = 'series.lines'; - LinesSeriesModel.dependencies = ['grid', 'polar', 'geo', 'calendar']; - LinesSeriesModel.defaultOption = { - coordinateSystem: 'geo', - // zlevel: 0, - z: 2, - legendHoverLink: true, - // Cartesian coordinate system - xAxisIndex: 0, - yAxisIndex: 0, - symbol: ['none', 'none'], - symbolSize: [10, 10], - // Geo coordinate system - geoIndex: 0, - effect: { - show: false, - period: 4, - constantSpeed: 0, - symbol: 'circle', - symbolSize: 3, - loop: true, - trailLength: 0.2 - }, - large: false, - // Available when large is true - largeThreshold: 2000, - polyline: false, - clip: true, - label: { - show: false, - position: 'end' // distance: 5, - // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + LinesSeriesModel.prototype.getZLevelKey = function () { + var effectModel = this.getModel('effect'); + var trailLength = effectModel.get('trailLength'); + return this.getData().count() > this.getProgressiveThreshold() // Each progressive series has individual key. + ? this.id : effectModel.get('show') && trailLength > 0 ? trailLength + '' : ''; + }; - }, - lineStyle: { - opacity: 0.5 - } - }; - return LinesSeriesModel; - }(SeriesModel); + LinesSeriesModel.type = 'series.lines'; + LinesSeriesModel.dependencies = ['grid', 'polar', 'geo', 'calendar']; + LinesSeriesModel.defaultOption = { + coordinateSystem: 'geo', + // zlevel: 0, + z: 2, + legendHoverLink: true, + // Cartesian coordinate system + xAxisIndex: 0, + yAxisIndex: 0, + symbol: ['none', 'none'], + symbolSize: [10, 10], + // Geo coordinate system + geoIndex: 0, + effect: { + show: false, + period: 4, + constantSpeed: 0, + symbol: 'circle', + symbolSize: 3, + loop: true, + trailLength: 0.2 + }, + large: false, + // Available when large is true + largeThreshold: 2000, + polyline: false, + clip: true, + label: { + show: false, + position: 'end' // distance: 5, + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + + }, + lineStyle: { + opacity: 0.5 + } + }; + return LinesSeriesModel; + }(SeriesModel); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -69119,1654 +69119,1654 @@ * under the License. */ function normalize$3(a) { - if (!(a instanceof Array)) { - a = [a, a]; - } + if (!(a instanceof Array)) { + a = [a, a]; + } - return a; + return a; } var linesVisual = { - seriesType: 'lines', - reset: function (seriesModel) { - var symbolType = normalize$3(seriesModel.get('symbol')); - var symbolSize = normalize$3(seriesModel.get('symbolSize')); - var data = seriesModel.getData(); - data.setVisual('fromSymbol', symbolType && symbolType[0]); - data.setVisual('toSymbol', symbolType && symbolType[1]); - data.setVisual('fromSymbolSize', symbolSize && symbolSize[0]); - data.setVisual('toSymbolSize', symbolSize && symbolSize[1]); - - function dataEach(data, idx) { - var itemModel = data.getItemModel(idx); - var symbolType = normalize$3(itemModel.getShallow('symbol', true)); - var symbolSize = normalize$3(itemModel.getShallow('symbolSize', true)); - symbolType[0] && data.setItemVisual(idx, 'fromSymbol', symbolType[0]); - symbolType[1] && data.setItemVisual(idx, 'toSymbol', symbolType[1]); - symbolSize[0] && data.setItemVisual(idx, 'fromSymbolSize', symbolSize[0]); - symbolSize[1] && data.setItemVisual(idx, 'toSymbolSize', symbolSize[1]); - } + seriesType: 'lines', + reset: function (seriesModel) { + var symbolType = normalize$3(seriesModel.get('symbol')); + var symbolSize = normalize$3(seriesModel.get('symbolSize')); + var data = seriesModel.getData(); + data.setVisual('fromSymbol', symbolType && symbolType[0]); + data.setVisual('toSymbol', symbolType && symbolType[1]); + data.setVisual('fromSymbolSize', symbolSize && symbolSize[0]); + data.setVisual('toSymbolSize', symbolSize && symbolSize[1]); - return { - dataEach: data.hasItemOption ? dataEach : null - }; + function dataEach(data, idx) { + var itemModel = data.getItemModel(idx); + var symbolType = normalize$3(itemModel.getShallow('symbol', true)); + var symbolSize = normalize$3(itemModel.getShallow('symbolSize', true)); + symbolType[0] && data.setItemVisual(idx, 'fromSymbol', symbolType[0]); + symbolType[1] && data.setItemVisual(idx, 'toSymbol', symbolType[1]); + symbolSize[0] && data.setItemVisual(idx, 'fromSymbolSize', symbolSize[0]); + symbolSize[1] && data.setItemVisual(idx, 'toSymbolSize', symbolSize[1]); } + + return { + dataEach: data.hasItemOption ? dataEach : null + }; + } }; function install$m(registers) { - registers.registerChartView(LinesView); - registers.registerSeriesModel(LinesSeriesModel); - registers.registerLayout(linesLayout); - registers.registerVisual(linesVisual); + registers.registerChartView(LinesView); + registers.registerSeriesModel(LinesSeriesModel); + registers.registerLayout(linesLayout); + registers.registerVisual(linesVisual); } var GRADIENT_LEVELS = 256; var HeatmapLayer = - /** @class */ - function () { - function HeatmapLayer() { - this.blurSize = 30; - this.pointSize = 20; - this.maxOpacity = 1; - this.minOpacity = 0; - this._gradientPixels = { - inRange: null, - outOfRange: null - }; - var canvas = platformApi.createCanvas(); - this.canvas = canvas; - } - /** - * Renders Heatmap and returns the rendered canvas - * @param data array of data, each has x, y, value - * @param width canvas width - * @param height canvas height - */ + /** @class */ + function () { + function HeatmapLayer() { + this.blurSize = 30; + this.pointSize = 20; + this.maxOpacity = 1; + this.minOpacity = 0; + this._gradientPixels = { + inRange: null, + outOfRange: null + }; + var canvas = platformApi.createCanvas(); + this.canvas = canvas; + } + /** + * Renders Heatmap and returns the rendered canvas + * @param data array of data, each has x, y, value + * @param width canvas width + * @param height canvas height + */ - HeatmapLayer.prototype.update = function (data, width, height, normalize, colorFunc, isInRange) { - var brush = this._getBrush(); + HeatmapLayer.prototype.update = function (data, width, height, normalize, colorFunc, isInRange) { + var brush = this._getBrush(); - var gradientInRange = this._getGradient(colorFunc, 'inRange'); + var gradientInRange = this._getGradient(colorFunc, 'inRange'); - var gradientOutOfRange = this._getGradient(colorFunc, 'outOfRange'); + var gradientOutOfRange = this._getGradient(colorFunc, 'outOfRange'); - var r = this.pointSize + this.blurSize; - var canvas = this.canvas; - var ctx = canvas.getContext('2d'); - var len = data.length; - canvas.width = width; - canvas.height = height; + var r = this.pointSize + this.blurSize; + var canvas = this.canvas; + var ctx = canvas.getContext('2d'); + var len = data.length; + canvas.width = width; + canvas.height = height; - for (var i = 0; i < len; ++i) { - var p = data[i]; - var x = p[0]; - var y = p[1]; - var value = p[2]; // calculate alpha using value + for (var i = 0; i < len; ++i) { + var p = data[i]; + var x = p[0]; + var y = p[1]; + var value = p[2]; // calculate alpha using value - var alpha = normalize(value); // draw with the circle brush with alpha + var alpha = normalize(value); // draw with the circle brush with alpha - ctx.globalAlpha = alpha; - ctx.drawImage(brush, x - r, y - r); - } + ctx.globalAlpha = alpha; + ctx.drawImage(brush, x - r, y - r); + } - if (!canvas.width || !canvas.height) { - // Avoid "Uncaught DOMException: Failed to execute 'getImageData' on - // 'CanvasRenderingContext2D': The source height is 0." - return canvas; - } // colorize the canvas using alpha value and set with gradient + if (!canvas.width || !canvas.height) { + // Avoid "Uncaught DOMException: Failed to execute 'getImageData' on + // 'CanvasRenderingContext2D': The source height is 0." + return canvas; + } // colorize the canvas using alpha value and set with gradient - var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); - var pixels = imageData.data; - var offset = 0; - var pixelLen = pixels.length; - var minOpacity = this.minOpacity; - var maxOpacity = this.maxOpacity; - var diffOpacity = maxOpacity - minOpacity; + var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); + var pixels = imageData.data; + var offset = 0; + var pixelLen = pixels.length; + var minOpacity = this.minOpacity; + var maxOpacity = this.maxOpacity; + var diffOpacity = maxOpacity - minOpacity; - while (offset < pixelLen) { - var alpha = pixels[offset + 3] / 256; - var gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4; // Simple optimize to ignore the empty data + while (offset < pixelLen) { + var alpha = pixels[offset + 3] / 256; + var gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4; // Simple optimize to ignore the empty data - if (alpha > 0) { - var gradient = isInRange(alpha) ? gradientInRange : gradientOutOfRange; // Any alpha > 0 will be mapped to [minOpacity, maxOpacity] + if (alpha > 0) { + var gradient = isInRange(alpha) ? gradientInRange : gradientOutOfRange; // Any alpha > 0 will be mapped to [minOpacity, maxOpacity] - alpha > 0 && (alpha = alpha * diffOpacity + minOpacity); - pixels[offset++] = gradient[gradientOffset]; - pixels[offset++] = gradient[gradientOffset + 1]; - pixels[offset++] = gradient[gradientOffset + 2]; - pixels[offset++] = gradient[gradientOffset + 3] * alpha * 256; - } else { - offset += 4; - } - } + alpha > 0 && (alpha = alpha * diffOpacity + minOpacity); + pixels[offset++] = gradient[gradientOffset]; + pixels[offset++] = gradient[gradientOffset + 1]; + pixels[offset++] = gradient[gradientOffset + 2]; + pixels[offset++] = gradient[gradientOffset + 3] * alpha * 256; + } else { + offset += 4; + } + } - ctx.putImageData(imageData, 0, 0); - return canvas; - }; - /** - * get canvas of a black circle brush used for canvas to draw later - */ + ctx.putImageData(imageData, 0, 0); + return canvas; + }; + /** + * get canvas of a black circle brush used for canvas to draw later + */ - HeatmapLayer.prototype._getBrush = function () { - var brushCanvas = this._brushCanvas || (this._brushCanvas = platformApi.createCanvas()); // set brush size + HeatmapLayer.prototype._getBrush = function () { + var brushCanvas = this._brushCanvas || (this._brushCanvas = platformApi.createCanvas()); // set brush size - var r = this.pointSize + this.blurSize; - var d = r * 2; - brushCanvas.width = d; - brushCanvas.height = d; - var ctx = brushCanvas.getContext('2d'); - ctx.clearRect(0, 0, d, d); // in order to render shadow without the distinct circle, - // draw the distinct circle in an invisible place, - // and use shadowOffset to draw shadow in the center of the canvas + var r = this.pointSize + this.blurSize; + var d = r * 2; + brushCanvas.width = d; + brushCanvas.height = d; + var ctx = brushCanvas.getContext('2d'); + ctx.clearRect(0, 0, d, d); // in order to render shadow without the distinct circle, + // draw the distinct circle in an invisible place, + // and use shadowOffset to draw shadow in the center of the canvas - ctx.shadowOffsetX = d; - ctx.shadowBlur = this.blurSize; // draw the shadow in black, and use alpha and shadow blur to generate - // color in color map + ctx.shadowOffsetX = d; + ctx.shadowBlur = this.blurSize; // draw the shadow in black, and use alpha and shadow blur to generate + // color in color map - ctx.shadowColor = '#000'; // draw circle in the left to the canvas + ctx.shadowColor = '#000'; // draw circle in the left to the canvas - ctx.beginPath(); - ctx.arc(-r, r, this.pointSize, 0, Math.PI * 2, true); - ctx.closePath(); - ctx.fill(); - return brushCanvas; - }; - /** - * get gradient color map - * @private - */ + ctx.beginPath(); + ctx.arc(-r, r, this.pointSize, 0, Math.PI * 2, true); + ctx.closePath(); + ctx.fill(); + return brushCanvas; + }; + /** + * get gradient color map + * @private + */ - HeatmapLayer.prototype._getGradient = function (colorFunc, state) { - var gradientPixels = this._gradientPixels; - var pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4)); - var color = [0, 0, 0, 0]; - var off = 0; + HeatmapLayer.prototype._getGradient = function (colorFunc, state) { + var gradientPixels = this._gradientPixels; + var pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4)); + var color = [0, 0, 0, 0]; + var off = 0; - for (var i = 0; i < 256; i++) { - colorFunc[state](i / 255, true, color); - pixelsSingleState[off++] = color[0]; - pixelsSingleState[off++] = color[1]; - pixelsSingleState[off++] = color[2]; - pixelsSingleState[off++] = color[3]; - } + for (var i = 0; i < 256; i++) { + colorFunc[state](i / 255, true, color); + pixelsSingleState[off++] = color[0]; + pixelsSingleState[off++] = color[1]; + pixelsSingleState[off++] = color[2]; + pixelsSingleState[off++] = color[3]; + } - return pixelsSingleState; - }; + return pixelsSingleState; + }; - return HeatmapLayer; - }(); + return HeatmapLayer; + }(); function getIsInPiecewiseRange(dataExtent, pieceList, selected) { - var dataSpan = dataExtent[1] - dataExtent[0]; - pieceList = map(pieceList, function (piece) { - return { - interval: [(piece.interval[0] - dataExtent[0]) / dataSpan, (piece.interval[1] - dataExtent[0]) / dataSpan] - }; - }); - var len = pieceList.length; - var lastIndex = 0; - return function (val) { - var i; // Try to find in the location of the last found + var dataSpan = dataExtent[1] - dataExtent[0]; + pieceList = map(pieceList, function (piece) { + return { + interval: [(piece.interval[0] - dataExtent[0]) / dataSpan, (piece.interval[1] - dataExtent[0]) / dataSpan] + }; + }); + var len = pieceList.length; + var lastIndex = 0; + return function (val) { + var i; // Try to find in the location of the last found - for (i = lastIndex; i < len; i++) { - var interval = pieceList[i].interval; + for (i = lastIndex; i < len; i++) { + var interval = pieceList[i].interval; - if (interval[0] <= val && val <= interval[1]) { - lastIndex = i; - break; - } - } + if (interval[0] <= val && val <= interval[1]) { + lastIndex = i; + break; + } + } - if (i === len) { - // Not found, back interation - for (i = lastIndex - 1; i >= 0; i--) { - var interval = pieceList[i].interval; + if (i === len) { + // Not found, back interation + for (i = lastIndex - 1; i >= 0; i--) { + var interval = pieceList[i].interval; - if (interval[0] <= val && val <= interval[1]) { - lastIndex = i; - break; - } - } + if (interval[0] <= val && val <= interval[1]) { + lastIndex = i; + break; } + } + } - return i >= 0 && i < len && selected[i]; - }; + return i >= 0 && i < len && selected[i]; + }; } function getIsInContinuousRange(dataExtent, range) { - var dataSpan = dataExtent[1] - dataExtent[0]; - range = [(range[0] - dataExtent[0]) / dataSpan, (range[1] - dataExtent[0]) / dataSpan]; - return function (val) { - return val >= range[0] && val <= range[1]; - }; + var dataSpan = dataExtent[1] - dataExtent[0]; + range = [(range[0] - dataExtent[0]) / dataSpan, (range[1] - dataExtent[0]) / dataSpan]; + return function (val) { + return val >= range[0] && val <= range[1]; + }; } function isGeoCoordSys(coordSys) { - var dimensions = coordSys.dimensions; // Not use coorSys.type === 'geo' because coordSys maybe extended + var dimensions = coordSys.dimensions; // Not use coorSys.type === 'geo' because coordSys maybe extended - return dimensions[0] === 'lng' && dimensions[1] === 'lat'; + return dimensions[0] === 'lng' && dimensions[1] === 'lat'; } var HeatmapView = - /** @class */ - function (_super) { - __extends(HeatmapView, _super); + /** @class */ + function (_super) { + __extends(HeatmapView, _super); - function HeatmapView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function HeatmapView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = HeatmapView.type; - return _this; + _this.type = HeatmapView.type; + return _this; + } + + HeatmapView.prototype.render = function (seriesModel, ecModel, api) { + var visualMapOfThisSeries; + ecModel.eachComponent('visualMap', function (visualMap) { + visualMap.eachTargetSeries(function (targetSeries) { + if (targetSeries === seriesModel) { + visualMapOfThisSeries = visualMap; } + }); + }); - HeatmapView.prototype.render = function (seriesModel, ecModel, api) { - var visualMapOfThisSeries; - ecModel.eachComponent('visualMap', function (visualMap) { - visualMap.eachTargetSeries(function (targetSeries) { - if (targetSeries === seriesModel) { - visualMapOfThisSeries = visualMap; - } - }); - }); + if ("development" !== 'production') { + if (!visualMapOfThisSeries) { + throw new Error('Heatmap must use with visualMap'); + } + } // Clear previously rendered progressive elements. - if ("development" !== 'production') { - if (!visualMapOfThisSeries) { - throw new Error('Heatmap must use with visualMap'); - } - } // Clear previously rendered progressive elements. + this._progressiveEls = null; + this.group.removeAll(); + var coordSys = seriesModel.coordinateSystem; - this._progressiveEls = null; - this.group.removeAll(); - var coordSys = seriesModel.coordinateSystem; + if (coordSys.type === 'cartesian2d' || coordSys.type === 'calendar') { + this._renderOnCartesianAndCalendar(seriesModel, api, 0, seriesModel.getData().count()); + } else if (isGeoCoordSys(coordSys)) { + this._renderOnGeo(coordSys, seriesModel, visualMapOfThisSeries, api); + } + }; - if (coordSys.type === 'cartesian2d' || coordSys.type === 'calendar') { - this._renderOnCartesianAndCalendar(seriesModel, api, 0, seriesModel.getData().count()); - } else if (isGeoCoordSys(coordSys)) { - this._renderOnGeo(coordSys, seriesModel, visualMapOfThisSeries, api); - } - }; + HeatmapView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) { + this.group.removeAll(); + }; - HeatmapView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) { - this.group.removeAll(); - }; + HeatmapView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) { + var coordSys = seriesModel.coordinateSystem; - HeatmapView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) { - var coordSys = seriesModel.coordinateSystem; + if (coordSys) { + // geo does not support incremental rendering? + if (isGeoCoordSys(coordSys)) { + this.render(seriesModel, ecModel, api); + } else { + this._progressiveEls = []; - if (coordSys) { - // geo does not support incremental rendering? - if (isGeoCoordSys(coordSys)) { - this.render(seriesModel, ecModel, api); - } else { - this._progressiveEls = []; + this._renderOnCartesianAndCalendar(seriesModel, api, params.start, params.end, true); + } + } + }; - this._renderOnCartesianAndCalendar(seriesModel, api, params.start, params.end, true); - } - } - }; + HeatmapView.prototype.eachRendered = function (cb) { + traverseElements(this._progressiveEls || this.group, cb); + }; - HeatmapView.prototype.eachRendered = function (cb) { - traverseElements(this._progressiveEls || this.group, cb); - }; + HeatmapView.prototype._renderOnCartesianAndCalendar = function (seriesModel, api, start, end, incremental) { + var coordSys = seriesModel.coordinateSystem; + var isCartesian2d = isCoordinateSystemType(coordSys, 'cartesian2d'); + var width; + var height; + var xAxisExtent; + var yAxisExtent; - HeatmapView.prototype._renderOnCartesianAndCalendar = function (seriesModel, api, start, end, incremental) { - var coordSys = seriesModel.coordinateSystem; - var isCartesian2d = isCoordinateSystemType(coordSys, 'cartesian2d'); - var width; - var height; - var xAxisExtent; - var yAxisExtent; - - if (isCartesian2d) { - var xAxis = coordSys.getAxis('x'); - var yAxis = coordSys.getAxis('y'); - - if ("development" !== 'production') { - if (!(xAxis.type === 'category' && yAxis.type === 'category')) { - throw new Error('Heatmap on cartesian must have two category axes'); - } + if (isCartesian2d) { + var xAxis = coordSys.getAxis('x'); + var yAxis = coordSys.getAxis('y'); - if (!(xAxis.onBand && yAxis.onBand)) { - throw new Error('Heatmap on cartesian must have two axes with boundaryGap true'); - } - } // add 0.5px to avoid the gaps + if ("development" !== 'production') { + if (!(xAxis.type === 'category' && yAxis.type === 'category')) { + throw new Error('Heatmap on cartesian must have two category axes'); + } + if (!(xAxis.onBand && yAxis.onBand)) { + throw new Error('Heatmap on cartesian must have two axes with boundaryGap true'); + } + } // add 0.5px to avoid the gaps - width = xAxis.getBandWidth() + .5; - height = yAxis.getBandWidth() + .5; - xAxisExtent = xAxis.scale.getExtent(); - yAxisExtent = yAxis.scale.getExtent(); - } - var group = this.group; - var data = seriesModel.getData(); - var emphasisStyle = seriesModel.getModel(['emphasis', 'itemStyle']).getItemStyle(); - var blurStyle = seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(); - var selectStyle = seriesModel.getModel(['select', 'itemStyle']).getItemStyle(); - var borderRadius = seriesModel.get(['itemStyle', 'borderRadius']); - var labelStatesModels = getLabelStatesModels(seriesModel); - var emphasisModel = seriesModel.getModel('emphasis'); - var focus = emphasisModel.get('focus'); - var blurScope = emphasisModel.get('blurScope'); - var emphasisDisabled = emphasisModel.get('disabled'); - var dataDims = isCartesian2d ? [data.mapDimension('x'), data.mapDimension('y'), data.mapDimension('value')] : [data.mapDimension('time'), data.mapDimension('value')]; + width = xAxis.getBandWidth() + .5; + height = yAxis.getBandWidth() + .5; + xAxisExtent = xAxis.scale.getExtent(); + yAxisExtent = yAxis.scale.getExtent(); + } - for (var idx = start; idx < end; idx++) { - var rect = void 0; - var style = data.getItemVisual(idx, 'style'); + var group = this.group; + var data = seriesModel.getData(); + var emphasisStyle = seriesModel.getModel(['emphasis', 'itemStyle']).getItemStyle(); + var blurStyle = seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(); + var selectStyle = seriesModel.getModel(['select', 'itemStyle']).getItemStyle(); + var borderRadius = seriesModel.get(['itemStyle', 'borderRadius']); + var labelStatesModels = getLabelStatesModels(seriesModel); + var emphasisModel = seriesModel.getModel('emphasis'); + var focus = emphasisModel.get('focus'); + var blurScope = emphasisModel.get('blurScope'); + var emphasisDisabled = emphasisModel.get('disabled'); + var dataDims = isCartesian2d ? [data.mapDimension('x'), data.mapDimension('y'), data.mapDimension('value')] : [data.mapDimension('time'), data.mapDimension('value')]; - if (isCartesian2d) { - var dataDimX = data.get(dataDims[0], idx); - var dataDimY = data.get(dataDims[1], idx); // Ignore empty data and out of extent data + for (var idx = start; idx < end; idx++) { + var rect = void 0; + var style = data.getItemVisual(idx, 'style'); - if (isNaN(data.get(dataDims[2], idx)) || dataDimX < xAxisExtent[0] || dataDimX > xAxisExtent[1] || dataDimY < yAxisExtent[0] || dataDimY > yAxisExtent[1]) { - continue; - } + if (isCartesian2d) { + var dataDimX = data.get(dataDims[0], idx); + var dataDimY = data.get(dataDims[1], idx); // Ignore empty data and out of extent data - var point = coordSys.dataToPoint([dataDimX, dataDimY]); - rect = new Rect({ - shape: { - x: point[0] - width / 2, - y: point[1] - height / 2, - width: width, - height: height - }, - style: style - }); - } else { - // Ignore empty data - if (isNaN(data.get(dataDims[1], idx))) { - continue; - } + if (isNaN(data.get(dataDims[2], idx)) || dataDimX < xAxisExtent[0] || dataDimX > xAxisExtent[1] || dataDimY < yAxisExtent[0] || dataDimY > yAxisExtent[1]) { + continue; + } - rect = new Rect({ - z2: 1, - shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape, - style: style - }); - } // Optimization for large datset - - - if (data.hasItemOption) { - var itemModel = data.getItemModel(idx); - var emphasisModel_1 = itemModel.getModel('emphasis'); - emphasisStyle = emphasisModel_1.getModel('itemStyle').getItemStyle(); - blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle(); - selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle(); // Each item value struct in the data would be firstly - // { - // itemStyle: { borderRadius: [30, 30] }, - // value: [2022, 02, 22] - // } - - borderRadius = itemModel.get(['itemStyle', 'borderRadius']); - focus = emphasisModel_1.get('focus'); - blurScope = emphasisModel_1.get('blurScope'); - emphasisDisabled = emphasisModel_1.get('disabled'); - labelStatesModels = getLabelStatesModels(itemModel); - } + var point = coordSys.dataToPoint([dataDimX, dataDimY]); + rect = new Rect({ + shape: { + x: point[0] - width / 2, + y: point[1] - height / 2, + width: width, + height: height + }, + style: style + }); + } else { + // Ignore empty data + if (isNaN(data.get(dataDims[1], idx))) { + continue; + } - rect.shape.r = borderRadius; - var rawValue = seriesModel.getRawValue(idx); - var defaultText = '-'; + rect = new Rect({ + z2: 1, + shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape, + style: style + }); + } // Optimization for large datset - if (rawValue && rawValue[2] != null) { - defaultText = rawValue[2] + ''; - } - setLabelStyle(rect, labelStatesModels, { - labelFetcher: seriesModel, - labelDataIndex: idx, - defaultOpacity: style.opacity, - defaultText: defaultText - }); - rect.ensureState('emphasis').style = emphasisStyle; - rect.ensureState('blur').style = blurStyle; - rect.ensureState('select').style = selectStyle; - toggleHoverEmphasis(rect, focus, blurScope, emphasisDisabled); - rect.incremental = incremental; // PENDING - - if (incremental) { - // Rect must use hover layer if it's incremental. - rect.states.emphasis.hoverLayer = true; - } + if (data.hasItemOption) { + var itemModel = data.getItemModel(idx); + var emphasisModel_1 = itemModel.getModel('emphasis'); + emphasisStyle = emphasisModel_1.getModel('itemStyle').getItemStyle(); + blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle(); + selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle(); // Each item value struct in the data would be firstly + // { + // itemStyle: { borderRadius: [30, 30] }, + // value: [2022, 02, 22] + // } - group.add(rect); - data.setItemGraphicEl(idx, rect); + borderRadius = itemModel.get(['itemStyle', 'borderRadius']); + focus = emphasisModel_1.get('focus'); + blurScope = emphasisModel_1.get('blurScope'); + emphasisDisabled = emphasisModel_1.get('disabled'); + labelStatesModels = getLabelStatesModels(itemModel); + } - if (this._progressiveEls) { - this._progressiveEls.push(rect); - } - } - }; + rect.shape.r = borderRadius; + var rawValue = seriesModel.getRawValue(idx); + var defaultText = '-'; - HeatmapView.prototype._renderOnGeo = function (geo, seriesModel, visualMapModel, api) { - var inRangeVisuals = visualMapModel.targetVisuals.inRange; - var outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange; // if (!visualMapping) { - // throw new Error('Data range must have color visuals'); - // } - - var data = seriesModel.getData(); - var hmLayer = this._hmLayer || this._hmLayer || new HeatmapLayer(); - hmLayer.blurSize = seriesModel.get('blurSize'); - hmLayer.pointSize = seriesModel.get('pointSize'); - hmLayer.minOpacity = seriesModel.get('minOpacity'); - hmLayer.maxOpacity = seriesModel.get('maxOpacity'); - var rect = geo.getViewRect().clone(); - var roamTransform = geo.getRoamTransform(); - rect.applyTransform(roamTransform); // Clamp on viewport - - var x = Math.max(rect.x, 0); - var y = Math.max(rect.y, 0); - var x2 = Math.min(rect.width + rect.x, api.getWidth()); - var y2 = Math.min(rect.height + rect.y, api.getHeight()); - var width = x2 - x; - var height = y2 - y; - var dims = [data.mapDimension('lng'), data.mapDimension('lat'), data.mapDimension('value')]; - var points = data.mapArray(dims, function (lng, lat, value) { - var pt = geo.dataToPoint([lng, lat]); - pt[0] -= x; - pt[1] -= y; - pt.push(value); - return pt; - }); - var dataExtent = visualMapModel.getExtent(); - var isInRange = visualMapModel.type === 'visualMap.continuous' ? getIsInContinuousRange(dataExtent, visualMapModel.option.range) : getIsInPiecewiseRange(dataExtent, visualMapModel.getPieceList(), visualMapModel.option.selected); - hmLayer.update(points, width, height, inRangeVisuals.color.getNormalizer(), { - inRange: inRangeVisuals.color.getColorMapper(), - outOfRange: outOfRangeVisuals.color.getColorMapper() - }, isInRange); - var img = new ZRImage({ - style: { - width: width, - height: height, - x: x, - y: y, - image: hmLayer.canvas - }, - silent: true - }); - this.group.add(img); - }; + if (rawValue && rawValue[2] != null) { + defaultText = rawValue[2] + ''; + } + + setLabelStyle(rect, labelStatesModels, { + labelFetcher: seriesModel, + labelDataIndex: idx, + defaultOpacity: style.opacity, + defaultText: defaultText + }); + rect.ensureState('emphasis').style = emphasisStyle; + rect.ensureState('blur').style = blurStyle; + rect.ensureState('select').style = selectStyle; + toggleHoverEmphasis(rect, focus, blurScope, emphasisDisabled); + rect.incremental = incremental; // PENDING + + if (incremental) { + // Rect must use hover layer if it's incremental. + rect.states.emphasis.hoverLayer = true; + } + + group.add(rect); + data.setItemGraphicEl(idx, rect); + + if (this._progressiveEls) { + this._progressiveEls.push(rect); + } + } + }; + + HeatmapView.prototype._renderOnGeo = function (geo, seriesModel, visualMapModel, api) { + var inRangeVisuals = visualMapModel.targetVisuals.inRange; + var outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange; // if (!visualMapping) { + // throw new Error('Data range must have color visuals'); + // } + + var data = seriesModel.getData(); + var hmLayer = this._hmLayer || this._hmLayer || new HeatmapLayer(); + hmLayer.blurSize = seriesModel.get('blurSize'); + hmLayer.pointSize = seriesModel.get('pointSize'); + hmLayer.minOpacity = seriesModel.get('minOpacity'); + hmLayer.maxOpacity = seriesModel.get('maxOpacity'); + var rect = geo.getViewRect().clone(); + var roamTransform = geo.getRoamTransform(); + rect.applyTransform(roamTransform); // Clamp on viewport + + var x = Math.max(rect.x, 0); + var y = Math.max(rect.y, 0); + var x2 = Math.min(rect.width + rect.x, api.getWidth()); + var y2 = Math.min(rect.height + rect.y, api.getHeight()); + var width = x2 - x; + var height = y2 - y; + var dims = [data.mapDimension('lng'), data.mapDimension('lat'), data.mapDimension('value')]; + var points = data.mapArray(dims, function (lng, lat, value) { + var pt = geo.dataToPoint([lng, lat]); + pt[0] -= x; + pt[1] -= y; + pt.push(value); + return pt; + }); + var dataExtent = visualMapModel.getExtent(); + var isInRange = visualMapModel.type === 'visualMap.continuous' ? getIsInContinuousRange(dataExtent, visualMapModel.option.range) : getIsInPiecewiseRange(dataExtent, visualMapModel.getPieceList(), visualMapModel.option.selected); + hmLayer.update(points, width, height, inRangeVisuals.color.getNormalizer(), { + inRange: inRangeVisuals.color.getColorMapper(), + outOfRange: outOfRangeVisuals.color.getColorMapper() + }, isInRange); + var img = new ZRImage({ + style: { + width: width, + height: height, + x: x, + y: y, + image: hmLayer.canvas + }, + silent: true + }); + this.group.add(img); + }; - HeatmapView.type = 'heatmap'; - return HeatmapView; - }(ChartView); + HeatmapView.type = 'heatmap'; + return HeatmapView; + }(ChartView); var HeatmapSeriesModel = - /** @class */ - function (_super) { - __extends(HeatmapSeriesModel, _super); + /** @class */ + function (_super) { + __extends(HeatmapSeriesModel, _super); - function HeatmapSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function HeatmapSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = HeatmapSeriesModel.type; - return _this; - } + _this.type = HeatmapSeriesModel.type; + return _this; + } - HeatmapSeriesModel.prototype.getInitialData = function (option, ecModel) { - return createSeriesData(null, this, { - generateCoord: 'value' - }); - }; + HeatmapSeriesModel.prototype.getInitialData = function (option, ecModel) { + return createSeriesData(null, this, { + generateCoord: 'value' + }); + }; - HeatmapSeriesModel.prototype.preventIncremental = function () { - var coordSysCreator = CoordinateSystemManager.get(this.get('coordinateSystem')); + HeatmapSeriesModel.prototype.preventIncremental = function () { + var coordSysCreator = CoordinateSystemManager.get(this.get('coordinateSystem')); - if (coordSysCreator && coordSysCreator.dimensions) { - return coordSysCreator.dimensions[0] === 'lng' && coordSysCreator.dimensions[1] === 'lat'; - } - }; + if (coordSysCreator && coordSysCreator.dimensions) { + return coordSysCreator.dimensions[0] === 'lng' && coordSysCreator.dimensions[1] === 'lat'; + } + }; - HeatmapSeriesModel.type = 'series.heatmap'; - HeatmapSeriesModel.dependencies = ['grid', 'geo', 'calendar']; - HeatmapSeriesModel.defaultOption = { - coordinateSystem: 'cartesian2d', - // zlevel: 0, - z: 2, - // Cartesian coordinate system - // xAxisIndex: 0, - // yAxisIndex: 0, - // Geo coordinate system - geoIndex: 0, - blurSize: 30, - pointSize: 20, - maxOpacity: 1, - minOpacity: 0, - select: { - itemStyle: { - borderColor: '#212121' - } - } - }; - return HeatmapSeriesModel; - }(SeriesModel); + HeatmapSeriesModel.type = 'series.heatmap'; + HeatmapSeriesModel.dependencies = ['grid', 'geo', 'calendar']; + HeatmapSeriesModel.defaultOption = { + coordinateSystem: 'cartesian2d', + // zlevel: 0, + z: 2, + // Cartesian coordinate system + // xAxisIndex: 0, + // yAxisIndex: 0, + // Geo coordinate system + geoIndex: 0, + blurSize: 30, + pointSize: 20, + maxOpacity: 1, + minOpacity: 0, + select: { + itemStyle: { + borderColor: '#212121' + } + } + }; + return HeatmapSeriesModel; + }(SeriesModel); function install$n(registers) { - registers.registerChartView(HeatmapView); - registers.registerSeriesModel(HeatmapSeriesModel); + registers.registerChartView(HeatmapView); + registers.registerSeriesModel(HeatmapSeriesModel); } var BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'borderWidth']; // index: +isHorizontal var LAYOUT_ATTRS = [{ - xy: 'x', - wh: 'width', - index: 0, - posDesc: ['left', 'right'] + xy: 'x', + wh: 'width', + index: 0, + posDesc: ['left', 'right'] }, { - xy: 'y', - wh: 'height', - index: 1, - posDesc: ['top', 'bottom'] + xy: 'y', + wh: 'height', + index: 1, + posDesc: ['top', 'bottom'] }]; var pathForLineWidth = new Circle(); var PictorialBarView = - /** @class */ - function (_super) { - __extends(PictorialBarView, _super); - - function PictorialBarView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = PictorialBarView.type; - return _this; - } - - PictorialBarView.prototype.render = function (seriesModel, ecModel, api) { - var group = this.group; - var data = seriesModel.getData(); - var oldData = this._data; - var cartesian = seriesModel.coordinateSystem; - var baseAxis = cartesian.getBaseAxis(); - var isHorizontal = baseAxis.isHorizontal(); - var coordSysRect = cartesian.master.getRect(); - var opt = { - ecSize: { - width: api.getWidth(), - height: api.getHeight() - }, - seriesModel: seriesModel, - coordSys: cartesian, - coordSysExtent: [[coordSysRect.x, coordSysRect.x + coordSysRect.width], [coordSysRect.y, coordSysRect.y + coordSysRect.height]], - isHorizontal: isHorizontal, - valueDim: LAYOUT_ATTRS[+isHorizontal], - categoryDim: LAYOUT_ATTRS[1 - +isHorizontal] - }; - data.diff(oldData).add(function (dataIndex) { - if (!data.hasValue(dataIndex)) { - return; - } + /** @class */ + function (_super) { + __extends(PictorialBarView, _super); - var itemModel = getItemModel(data, dataIndex); - var symbolMeta = getSymbolMeta(data, dataIndex, itemModel, opt); - var bar = createBar(data, opt, symbolMeta); - data.setItemGraphicEl(dataIndex, bar); - group.add(bar); - updateCommon$1(bar, opt, symbolMeta); - }).update(function (newIndex, oldIndex) { - var bar = oldData.getItemGraphicEl(oldIndex); - - if (!data.hasValue(newIndex)) { - group.remove(bar); - return; - } - - var itemModel = getItemModel(data, newIndex); - var symbolMeta = getSymbolMeta(data, newIndex, itemModel, opt); - var pictorialShapeStr = getShapeStr(data, symbolMeta); - - if (bar && pictorialShapeStr !== bar.__pictorialShapeStr) { - group.remove(bar); - data.setItemGraphicEl(newIndex, null); - bar = null; - } - - if (bar) { - updateBar(bar, opt, symbolMeta); - } else { - bar = createBar(data, opt, symbolMeta, true); - } + function PictorialBarView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - data.setItemGraphicEl(newIndex, bar); - bar.__pictorialSymbolMeta = symbolMeta; // Add back - - group.add(bar); - updateCommon$1(bar, opt, symbolMeta); - }).remove(function (dataIndex) { - var bar = oldData.getItemGraphicEl(dataIndex); - bar && removeBar(oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar); - }).execute(); - this._data = data; - return this.group; - }; - - PictorialBarView.prototype.remove = function (ecModel, api) { - var group = this.group; - var data = this._data; + _this.type = PictorialBarView.type; + return _this; + } - if (ecModel.get('animation')) { - if (data) { - data.eachItemGraphicEl(function (bar) { - removeBar(data, getECData(bar).dataIndex, ecModel, bar); - }); - } - } else { - group.removeAll(); - } - }; + PictorialBarView.prototype.render = function (seriesModel, ecModel, api) { + var group = this.group; + var data = seriesModel.getData(); + var oldData = this._data; + var cartesian = seriesModel.coordinateSystem; + var baseAxis = cartesian.getBaseAxis(); + var isHorizontal = baseAxis.isHorizontal(); + var coordSysRect = cartesian.master.getRect(); + var opt = { + ecSize: { + width: api.getWidth(), + height: api.getHeight() + }, + seriesModel: seriesModel, + coordSys: cartesian, + coordSysExtent: [[coordSysRect.x, coordSysRect.x + coordSysRect.width], [coordSysRect.y, coordSysRect.y + coordSysRect.height]], + isHorizontal: isHorizontal, + valueDim: LAYOUT_ATTRS[+isHorizontal], + categoryDim: LAYOUT_ATTRS[1 - +isHorizontal] + }; + data.diff(oldData).add(function (dataIndex) { + if (!data.hasValue(dataIndex)) { + return; + } + + var itemModel = getItemModel(data, dataIndex); + var symbolMeta = getSymbolMeta(data, dataIndex, itemModel, opt); + var bar = createBar(data, opt, symbolMeta); + data.setItemGraphicEl(dataIndex, bar); + group.add(bar); + updateCommon$1(bar, opt, symbolMeta); + }).update(function (newIndex, oldIndex) { + var bar = oldData.getItemGraphicEl(oldIndex); + + if (!data.hasValue(newIndex)) { + group.remove(bar); + return; + } + + var itemModel = getItemModel(data, newIndex); + var symbolMeta = getSymbolMeta(data, newIndex, itemModel, opt); + var pictorialShapeStr = getShapeStr(data, symbolMeta); + + if (bar && pictorialShapeStr !== bar.__pictorialShapeStr) { + group.remove(bar); + data.setItemGraphicEl(newIndex, null); + bar = null; + } + + if (bar) { + updateBar(bar, opt, symbolMeta); + } else { + bar = createBar(data, opt, symbolMeta, true); + } + + data.setItemGraphicEl(newIndex, bar); + bar.__pictorialSymbolMeta = symbolMeta; // Add back + + group.add(bar); + updateCommon$1(bar, opt, symbolMeta); + }).remove(function (dataIndex) { + var bar = oldData.getItemGraphicEl(dataIndex); + bar && removeBar(oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar); + }).execute(); + this._data = data; + return this.group; + }; + + PictorialBarView.prototype.remove = function (ecModel, api) { + var group = this.group; + var data = this._data; + + if (ecModel.get('animation')) { + if (data) { + data.eachItemGraphicEl(function (bar) { + removeBar(data, getECData(bar).dataIndex, ecModel, bar); + }); + } + } else { + group.removeAll(); + } + }; - PictorialBarView.type = 'pictorialBar'; - return PictorialBarView; - }(ChartView); // Set or calculate default value about symbol, and calculate layout info. + PictorialBarView.type = 'pictorialBar'; + return PictorialBarView; + }(ChartView); // Set or calculate default value about symbol, and calculate layout info. function getSymbolMeta(data, dataIndex, itemModel, opt) { - var layout = data.getItemLayout(dataIndex); - var symbolRepeat = itemModel.get('symbolRepeat'); - var symbolClip = itemModel.get('symbolClip'); - var symbolPosition = itemModel.get('symbolPosition') || 'start'; - var symbolRotate = itemModel.get('symbolRotate'); - var rotation = (symbolRotate || 0) * Math.PI / 180 || 0; - var symbolPatternSize = itemModel.get('symbolPatternSize') || 2; - var isAnimationEnabled = itemModel.isAnimationEnabled(); - var symbolMeta = { - dataIndex: dataIndex, - layout: layout, - itemModel: itemModel, - symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle', - style: data.getItemVisual(dataIndex, 'style'), - symbolClip: symbolClip, - symbolRepeat: symbolRepeat, - symbolRepeatDirection: itemModel.get('symbolRepeatDirection'), - symbolPatternSize: symbolPatternSize, - rotation: rotation, - animationModel: isAnimationEnabled ? itemModel : null, - hoverScale: isAnimationEnabled && itemModel.get(['emphasis', 'scale']), - z2: itemModel.getShallow('z', true) || 0 - }; - prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta); - prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta); - prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta); - var symbolSize = symbolMeta.symbolSize; - var symbolOffset = normalizeSymbolOffset(itemModel.get('symbolOffset'), symbolSize); - prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta); - return symbolMeta; + var layout = data.getItemLayout(dataIndex); + var symbolRepeat = itemModel.get('symbolRepeat'); + var symbolClip = itemModel.get('symbolClip'); + var symbolPosition = itemModel.get('symbolPosition') || 'start'; + var symbolRotate = itemModel.get('symbolRotate'); + var rotation = (symbolRotate || 0) * Math.PI / 180 || 0; + var symbolPatternSize = itemModel.get('symbolPatternSize') || 2; + var isAnimationEnabled = itemModel.isAnimationEnabled(); + var symbolMeta = { + dataIndex: dataIndex, + layout: layout, + itemModel: itemModel, + symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle', + style: data.getItemVisual(dataIndex, 'style'), + symbolClip: symbolClip, + symbolRepeat: symbolRepeat, + symbolRepeatDirection: itemModel.get('symbolRepeatDirection'), + symbolPatternSize: symbolPatternSize, + rotation: rotation, + animationModel: isAnimationEnabled ? itemModel : null, + hoverScale: isAnimationEnabled && itemModel.get(['emphasis', 'scale']), + z2: itemModel.getShallow('z', true) || 0 + }; + prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta); + prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta); + prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta); + var symbolSize = symbolMeta.symbolSize; + var symbolOffset = normalizeSymbolOffset(itemModel.get('symbolOffset'), symbolSize); + prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta); + return symbolMeta; } // bar length can be negative. function prepareBarLength(itemModel, symbolRepeat, layout, opt, outputSymbolMeta) { - var valueDim = opt.valueDim; - var symbolBoundingData = itemModel.get('symbolBoundingData'); - var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis()); - var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0)); - var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0); - var boundingLength; - - if (isArray(symbolBoundingData)) { - var symbolBoundingExtent = [convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx, convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx]; - symbolBoundingExtent[1] < symbolBoundingExtent[0] && symbolBoundingExtent.reverse(); - boundingLength = symbolBoundingExtent[pxSignIdx]; - } else if (symbolBoundingData != null) { - boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx; - } else if (symbolRepeat) { - boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx; - } else { - boundingLength = layout[valueDim.wh]; - } + var valueDim = opt.valueDim; + var symbolBoundingData = itemModel.get('symbolBoundingData'); + var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis()); + var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0)); + var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0); + var boundingLength; + + if (isArray(symbolBoundingData)) { + var symbolBoundingExtent = [convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx, convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx]; + symbolBoundingExtent[1] < symbolBoundingExtent[0] && symbolBoundingExtent.reverse(); + boundingLength = symbolBoundingExtent[pxSignIdx]; + } else if (symbolBoundingData != null) { + boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx; + } else if (symbolRepeat) { + boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx; + } else { + boundingLength = layout[valueDim.wh]; + } - outputSymbolMeta.boundingLength = boundingLength; + outputSymbolMeta.boundingLength = boundingLength; - if (symbolRepeat) { - outputSymbolMeta.repeatCutLength = layout[valueDim.wh]; - } // if 'pxSign' means sign of pixel, it can't be zero, or symbolScale will be zero - // and when borderWidth be settled, the actual linewidth will be NaN + if (symbolRepeat) { + outputSymbolMeta.repeatCutLength = layout[valueDim.wh]; + } // if 'pxSign' means sign of pixel, it can't be zero, or symbolScale will be zero + // and when borderWidth be settled, the actual linewidth will be NaN - outputSymbolMeta.pxSign = boundingLength > 0 ? 1 : -1; + outputSymbolMeta.pxSign = boundingLength > 0 ? 1 : -1; } function convertToCoordOnAxis(axis, value) { - return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value))); + return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value))); } // Support ['100%', '100%'] function prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, boundingLength, pxSign, symbolPatternSize, opt, outputSymbolMeta) { - var valueDim = opt.valueDim; - var categoryDim = opt.categoryDim; - var categorySize = Math.abs(layout[categoryDim.wh]); - var symbolSize = data.getItemVisual(dataIndex, 'symbolSize'); - var parsedSymbolSize; - - if (isArray(symbolSize)) { - parsedSymbolSize = symbolSize.slice(); + var valueDim = opt.valueDim; + var categoryDim = opt.categoryDim; + var categorySize = Math.abs(layout[categoryDim.wh]); + var symbolSize = data.getItemVisual(dataIndex, 'symbolSize'); + var parsedSymbolSize; + + if (isArray(symbolSize)) { + parsedSymbolSize = symbolSize.slice(); + } else { + if (symbolSize == null) { + // will parse to number below + parsedSymbolSize = ['100%', '100%']; } else { - if (symbolSize == null) { - // will parse to number below - parsedSymbolSize = ['100%', '100%']; - } else { - parsedSymbolSize = [symbolSize, symbolSize]; - } - } // Note: percentage symbolSize (like '100%') do not consider lineWidth, because it is - // to complicated to calculate real percent value if considering scaled lineWidth. - // So the actual size will bigger than layout size if lineWidth is bigger than zero, - // which can be tolerated in pictorial chart. + parsedSymbolSize = [symbolSize, symbolSize]; + } + } // Note: percentage symbolSize (like '100%') do not consider lineWidth, because it is + // to complicated to calculate real percent value if considering scaled lineWidth. + // So the actual size will bigger than layout size if lineWidth is bigger than zero, + // which can be tolerated in pictorial chart. - parsedSymbolSize[categoryDim.index] = parsePercent$1(parsedSymbolSize[categoryDim.index], categorySize); - parsedSymbolSize[valueDim.index] = parsePercent$1(parsedSymbolSize[valueDim.index], symbolRepeat ? categorySize : Math.abs(boundingLength)); - outputSymbolMeta.symbolSize = parsedSymbolSize; // If x or y is less than zero, show reversed shape. + parsedSymbolSize[categoryDim.index] = parsePercent$1(parsedSymbolSize[categoryDim.index], categorySize); + parsedSymbolSize[valueDim.index] = parsePercent$1(parsedSymbolSize[valueDim.index], symbolRepeat ? categorySize : Math.abs(boundingLength)); + outputSymbolMeta.symbolSize = parsedSymbolSize; // If x or y is less than zero, show reversed shape. - var symbolScale = outputSymbolMeta.symbolScale = [parsedSymbolSize[0] / symbolPatternSize, parsedSymbolSize[1] / symbolPatternSize]; // Follow convention, 'right' and 'top' is the normal scale. + var symbolScale = outputSymbolMeta.symbolScale = [parsedSymbolSize[0] / symbolPatternSize, parsedSymbolSize[1] / symbolPatternSize]; // Follow convention, 'right' and 'top' is the normal scale. - symbolScale[valueDim.index] *= (opt.isHorizontal ? -1 : 1) * pxSign; + symbolScale[valueDim.index] *= (opt.isHorizontal ? -1 : 1) * pxSign; } function prepareLineWidth(itemModel, symbolScale, rotation, opt, outputSymbolMeta) { - // In symbols are drawn with scale, so do not need to care about the case that width - // or height are too small. But symbol use strokeNoScale, where acture lineWidth should - // be calculated. - var valueLineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0; - - if (valueLineWidth) { - pathForLineWidth.attr({ - scaleX: symbolScale[0], - scaleY: symbolScale[1], - rotation: rotation - }); - pathForLineWidth.updateTransform(); - valueLineWidth /= pathForLineWidth.getLineScale(); - valueLineWidth *= symbolScale[opt.valueDim.index]; - } + // In symbols are drawn with scale, so do not need to care about the case that width + // or height are too small. But symbol use strokeNoScale, where acture lineWidth should + // be calculated. + var valueLineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0; + + if (valueLineWidth) { + pathForLineWidth.attr({ + scaleX: symbolScale[0], + scaleY: symbolScale[1], + rotation: rotation + }); + pathForLineWidth.updateTransform(); + valueLineWidth /= pathForLineWidth.getLineScale(); + valueLineWidth *= symbolScale[opt.valueDim.index]; + } - outputSymbolMeta.valueLineWidth = valueLineWidth || 0; + outputSymbolMeta.valueLineWidth = valueLineWidth || 0; } function prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, valueLineWidth, boundingLength, repeatCutLength, opt, outputSymbolMeta) { - var categoryDim = opt.categoryDim; - var valueDim = opt.valueDim; - var pxSign = outputSymbolMeta.pxSign; - var unitLength = Math.max(symbolSize[valueDim.index] + valueLineWidth, 0); - var pathLen = unitLength; // Note: rotation will not effect the layout of symbols, because user may - // want symbols to rotate on its center, which should not be translated - // when rotating. - - if (symbolRepeat) { - var absBoundingLength = Math.abs(boundingLength); - var symbolMargin = retrieve(itemModel.get('symbolMargin'), '15%') + ''; - var hasEndGap = false; + var categoryDim = opt.categoryDim; + var valueDim = opt.valueDim; + var pxSign = outputSymbolMeta.pxSign; + var unitLength = Math.max(symbolSize[valueDim.index] + valueLineWidth, 0); + var pathLen = unitLength; // Note: rotation will not effect the layout of symbols, because user may + // want symbols to rotate on its center, which should not be translated + // when rotating. - if (symbolMargin.lastIndexOf('!') === symbolMargin.length - 1) { - hasEndGap = true; - symbolMargin = symbolMargin.slice(0, symbolMargin.length - 1); - } + if (symbolRepeat) { + var absBoundingLength = Math.abs(boundingLength); + var symbolMargin = retrieve(itemModel.get('symbolMargin'), '15%') + ''; + var hasEndGap = false; - var symbolMarginNumeric = parsePercent$1(symbolMargin, symbolSize[valueDim.index]); - var uLenWithMargin = Math.max(unitLength + symbolMarginNumeric * 2, 0); // When symbol margin is less than 0, margin at both ends will be subtracted - // to ensure that all of the symbols will not be overflow the given area. + if (symbolMargin.lastIndexOf('!') === symbolMargin.length - 1) { + hasEndGap = true; + symbolMargin = symbolMargin.slice(0, symbolMargin.length - 1); + } - var endFix = hasEndGap ? 0 : symbolMarginNumeric * 2; // Both final repeatTimes and final symbolMarginNumeric area calculated based on - // boundingLength. + var symbolMarginNumeric = parsePercent$1(symbolMargin, symbolSize[valueDim.index]); + var uLenWithMargin = Math.max(unitLength + symbolMarginNumeric * 2, 0); // When symbol margin is less than 0, margin at both ends will be subtracted + // to ensure that all of the symbols will not be overflow the given area. - var repeatSpecified = isNumeric(symbolRepeat); - var repeatTimes = repeatSpecified ? symbolRepeat : toIntTimes((absBoundingLength + endFix) / uLenWithMargin); // Adjust calculate margin, to ensure each symbol is displayed - // entirely in the given layout area. + var endFix = hasEndGap ? 0 : symbolMarginNumeric * 2; // Both final repeatTimes and final symbolMarginNumeric area calculated based on + // boundingLength. - var mDiff = absBoundingLength - repeatTimes * unitLength; - symbolMarginNumeric = mDiff / 2 / (hasEndGap ? repeatTimes : Math.max(repeatTimes - 1, 1)); - uLenWithMargin = unitLength + symbolMarginNumeric * 2; - endFix = hasEndGap ? 0 : symbolMarginNumeric * 2; // Update repeatTimes when not all symbol will be shown. + var repeatSpecified = isNumeric(symbolRepeat); + var repeatTimes = repeatSpecified ? symbolRepeat : toIntTimes((absBoundingLength + endFix) / uLenWithMargin); // Adjust calculate margin, to ensure each symbol is displayed + // entirely in the given layout area. - if (!repeatSpecified && symbolRepeat !== 'fixed') { - repeatTimes = repeatCutLength ? toIntTimes((Math.abs(repeatCutLength) + endFix) / uLenWithMargin) : 0; - } + var mDiff = absBoundingLength - repeatTimes * unitLength; + symbolMarginNumeric = mDiff / 2 / (hasEndGap ? repeatTimes : Math.max(repeatTimes - 1, 1)); + uLenWithMargin = unitLength + symbolMarginNumeric * 2; + endFix = hasEndGap ? 0 : symbolMarginNumeric * 2; // Update repeatTimes when not all symbol will be shown. - pathLen = repeatTimes * uLenWithMargin - endFix; - outputSymbolMeta.repeatTimes = repeatTimes; - outputSymbolMeta.symbolMargin = symbolMarginNumeric; + if (!repeatSpecified && symbolRepeat !== 'fixed') { + repeatTimes = repeatCutLength ? toIntTimes((Math.abs(repeatCutLength) + endFix) / uLenWithMargin) : 0; } - var sizeFix = pxSign * (pathLen / 2); - var pathPosition = outputSymbolMeta.pathPosition = []; - pathPosition[categoryDim.index] = layout[categoryDim.wh] / 2; - pathPosition[valueDim.index] = symbolPosition === 'start' ? sizeFix : symbolPosition === 'end' ? boundingLength - sizeFix : boundingLength / 2; // 'center' + pathLen = repeatTimes * uLenWithMargin - endFix; + outputSymbolMeta.repeatTimes = repeatTimes; + outputSymbolMeta.symbolMargin = symbolMarginNumeric; + } - if (symbolOffset) { - pathPosition[0] += symbolOffset[0]; - pathPosition[1] += symbolOffset[1]; - } + var sizeFix = pxSign * (pathLen / 2); + var pathPosition = outputSymbolMeta.pathPosition = []; + pathPosition[categoryDim.index] = layout[categoryDim.wh] / 2; + pathPosition[valueDim.index] = symbolPosition === 'start' ? sizeFix : symbolPosition === 'end' ? boundingLength - sizeFix : boundingLength / 2; // 'center' + + if (symbolOffset) { + pathPosition[0] += symbolOffset[0]; + pathPosition[1] += symbolOffset[1]; + } - var bundlePosition = outputSymbolMeta.bundlePosition = []; - bundlePosition[categoryDim.index] = layout[categoryDim.xy]; - bundlePosition[valueDim.index] = layout[valueDim.xy]; - var barRectShape = outputSymbolMeta.barRectShape = extend({}, layout); - barRectShape[valueDim.wh] = pxSign * Math.max(Math.abs(layout[valueDim.wh]), Math.abs(pathPosition[valueDim.index] + sizeFix)); - barRectShape[categoryDim.wh] = layout[categoryDim.wh]; - var clipShape = outputSymbolMeta.clipShape = {}; // Consider that symbol may be overflow layout rect. + var bundlePosition = outputSymbolMeta.bundlePosition = []; + bundlePosition[categoryDim.index] = layout[categoryDim.xy]; + bundlePosition[valueDim.index] = layout[valueDim.xy]; + var barRectShape = outputSymbolMeta.barRectShape = extend({}, layout); + barRectShape[valueDim.wh] = pxSign * Math.max(Math.abs(layout[valueDim.wh]), Math.abs(pathPosition[valueDim.index] + sizeFix)); + barRectShape[categoryDim.wh] = layout[categoryDim.wh]; + var clipShape = outputSymbolMeta.clipShape = {}; // Consider that symbol may be overflow layout rect. - clipShape[categoryDim.xy] = -layout[categoryDim.xy]; - clipShape[categoryDim.wh] = opt.ecSize[categoryDim.wh]; - clipShape[valueDim.xy] = 0; - clipShape[valueDim.wh] = layout[valueDim.wh]; + clipShape[categoryDim.xy] = -layout[categoryDim.xy]; + clipShape[categoryDim.wh] = opt.ecSize[categoryDim.wh]; + clipShape[valueDim.xy] = 0; + clipShape[valueDim.wh] = layout[valueDim.wh]; } function createPath(symbolMeta) { - var symbolPatternSize = symbolMeta.symbolPatternSize; - var path = createSymbol( // Consider texture img, make a big size. - symbolMeta.symbolType, -symbolPatternSize / 2, -symbolPatternSize / 2, symbolPatternSize, symbolPatternSize); - path.attr({ - culling: true - }); - path.type !== 'image' && path.setStyle({ - strokeNoScale: true - }); - return path; + var symbolPatternSize = symbolMeta.symbolPatternSize; + var path = createSymbol( // Consider texture img, make a big size. + symbolMeta.symbolType, -symbolPatternSize / 2, -symbolPatternSize / 2, symbolPatternSize, symbolPatternSize); + path.attr({ + culling: true + }); + path.type !== 'image' && path.setStyle({ + strokeNoScale: true + }); + return path; } function createOrUpdateRepeatSymbols(bar, opt, symbolMeta, isUpdate) { - var bundle = bar.__pictorialBundle; - var symbolSize = symbolMeta.symbolSize; - var valueLineWidth = symbolMeta.valueLineWidth; - var pathPosition = symbolMeta.pathPosition; - var valueDim = opt.valueDim; - var repeatTimes = symbolMeta.repeatTimes || 0; - var index = 0; - var unit = symbolSize[opt.valueDim.index] + valueLineWidth + symbolMeta.symbolMargin * 2; - eachPath(bar, function (path) { - path.__pictorialAnimationIndex = index; - path.__pictorialRepeatTimes = repeatTimes; - - if (index < repeatTimes) { - updateAttr(path, null, makeTarget(index), symbolMeta, isUpdate); - } else { - updateAttr(path, null, { - scaleX: 0, - scaleY: 0 - }, symbolMeta, isUpdate, function () { - bundle.remove(path); - }); - } // updateHoverAnimation(path, symbolMeta); - - - index++; - }); - - for (; index < repeatTimes; index++) { - var path = createPath(symbolMeta); - path.__pictorialAnimationIndex = index; - path.__pictorialRepeatTimes = repeatTimes; - bundle.add(path); - var target = makeTarget(index); - updateAttr(path, { - x: target.x, - y: target.y, - scaleX: 0, - scaleY: 0 - }, { - scaleX: target.scaleX, - scaleY: target.scaleY, - rotation: target.rotation - }, symbolMeta, isUpdate); - } - - function makeTarget(index) { - var position = pathPosition.slice(); // (start && pxSign > 0) || (end && pxSign < 0): i = repeatTimes - index - // Otherwise: i = index; + var bundle = bar.__pictorialBundle; + var symbolSize = symbolMeta.symbolSize; + var valueLineWidth = symbolMeta.valueLineWidth; + var pathPosition = symbolMeta.pathPosition; + var valueDim = opt.valueDim; + var repeatTimes = symbolMeta.repeatTimes || 0; + var index = 0; + var unit = symbolSize[opt.valueDim.index] + valueLineWidth + symbolMeta.symbolMargin * 2; + eachPath(bar, function (path) { + path.__pictorialAnimationIndex = index; + path.__pictorialRepeatTimes = repeatTimes; + + if (index < repeatTimes) { + updateAttr(path, null, makeTarget(index), symbolMeta, isUpdate); + } else { + updateAttr(path, null, { + scaleX: 0, + scaleY: 0 + }, symbolMeta, isUpdate, function () { + bundle.remove(path); + }); + } // updateHoverAnimation(path, symbolMeta); + + + index++; + }); + + for (; index < repeatTimes; index++) { + var path = createPath(symbolMeta); + path.__pictorialAnimationIndex = index; + path.__pictorialRepeatTimes = repeatTimes; + bundle.add(path); + var target = makeTarget(index); + updateAttr(path, { + x: target.x, + y: target.y, + scaleX: 0, + scaleY: 0 + }, { + scaleX: target.scaleX, + scaleY: target.scaleY, + rotation: target.rotation + }, symbolMeta, isUpdate); + } - var pxSign = symbolMeta.pxSign; - var i = index; + function makeTarget(index) { + var position = pathPosition.slice(); // (start && pxSign > 0) || (end && pxSign < 0): i = repeatTimes - index + // Otherwise: i = index; - if (symbolMeta.symbolRepeatDirection === 'start' ? pxSign > 0 : pxSign < 0) { - i = repeatTimes - 1 - index; - } + var pxSign = symbolMeta.pxSign; + var i = index; - position[valueDim.index] = unit * (i - repeatTimes / 2 + 0.5) + pathPosition[valueDim.index]; - return { - x: position[0], - y: position[1], - scaleX: symbolMeta.symbolScale[0], - scaleY: symbolMeta.symbolScale[1], - rotation: symbolMeta.rotation - }; + if (symbolMeta.symbolRepeatDirection === 'start' ? pxSign > 0 : pxSign < 0) { + i = repeatTimes - 1 - index; } + + position[valueDim.index] = unit * (i - repeatTimes / 2 + 0.5) + pathPosition[valueDim.index]; + return { + x: position[0], + y: position[1], + scaleX: symbolMeta.symbolScale[0], + scaleY: symbolMeta.symbolScale[1], + rotation: symbolMeta.rotation + }; + } } function createOrUpdateSingleSymbol(bar, opt, symbolMeta, isUpdate) { - var bundle = bar.__pictorialBundle; - var mainPath = bar.__pictorialMainPath; - - if (!mainPath) { - mainPath = bar.__pictorialMainPath = createPath(symbolMeta); - bundle.add(mainPath); - updateAttr(mainPath, { - x: symbolMeta.pathPosition[0], - y: symbolMeta.pathPosition[1], - scaleX: 0, - scaleY: 0, - rotation: symbolMeta.rotation - }, { - scaleX: symbolMeta.symbolScale[0], - scaleY: symbolMeta.symbolScale[1] - }, symbolMeta, isUpdate); - } else { - updateAttr(mainPath, null, { - x: symbolMeta.pathPosition[0], - y: symbolMeta.pathPosition[1], - scaleX: symbolMeta.symbolScale[0], - scaleY: symbolMeta.symbolScale[1], - rotation: symbolMeta.rotation - }, symbolMeta, isUpdate); - } + var bundle = bar.__pictorialBundle; + var mainPath = bar.__pictorialMainPath; + + if (!mainPath) { + mainPath = bar.__pictorialMainPath = createPath(symbolMeta); + bundle.add(mainPath); + updateAttr(mainPath, { + x: symbolMeta.pathPosition[0], + y: symbolMeta.pathPosition[1], + scaleX: 0, + scaleY: 0, + rotation: symbolMeta.rotation + }, { + scaleX: symbolMeta.symbolScale[0], + scaleY: symbolMeta.symbolScale[1] + }, symbolMeta, isUpdate); + } else { + updateAttr(mainPath, null, { + x: symbolMeta.pathPosition[0], + y: symbolMeta.pathPosition[1], + scaleX: symbolMeta.symbolScale[0], + scaleY: symbolMeta.symbolScale[1], + rotation: symbolMeta.rotation + }, symbolMeta, isUpdate); + } } // bar rect is used for label. function createOrUpdateBarRect(bar, symbolMeta, isUpdate) { - var rectShape = extend({}, symbolMeta.barRectShape); - var barRect = bar.__pictorialBarRect; - - if (!barRect) { - barRect = bar.__pictorialBarRect = new Rect({ - z2: 2, - shape: rectShape, - silent: true, - style: { - stroke: 'transparent', - fill: 'transparent', - lineWidth: 0 - } - }); - barRect.disableMorphing = true; - bar.add(barRect); - } else { - updateAttr(barRect, null, { - shape: rectShape - }, symbolMeta, isUpdate); - } + var rectShape = extend({}, symbolMeta.barRectShape); + var barRect = bar.__pictorialBarRect; + + if (!barRect) { + barRect = bar.__pictorialBarRect = new Rect({ + z2: 2, + shape: rectShape, + silent: true, + style: { + stroke: 'transparent', + fill: 'transparent', + lineWidth: 0 + } + }); + barRect.disableMorphing = true; + bar.add(barRect); + } else { + updateAttr(barRect, null, { + shape: rectShape + }, symbolMeta, isUpdate); + } } function createOrUpdateClip(bar, opt, symbolMeta, isUpdate) { - // If not clip, symbol will be remove and rebuilt. - if (symbolMeta.symbolClip) { - var clipPath = bar.__pictorialClipPath; - var clipShape = extend({}, symbolMeta.clipShape); - var valueDim = opt.valueDim; - var animationModel = symbolMeta.animationModel; - var dataIndex = symbolMeta.dataIndex; + // If not clip, symbol will be remove and rebuilt. + if (symbolMeta.symbolClip) { + var clipPath = bar.__pictorialClipPath; + var clipShape = extend({}, symbolMeta.clipShape); + var valueDim = opt.valueDim; + var animationModel = symbolMeta.animationModel; + var dataIndex = symbolMeta.dataIndex; - if (clipPath) { - updateProps(clipPath, { - shape: clipShape - }, animationModel, dataIndex); - } else { - clipShape[valueDim.wh] = 0; - clipPath = new Rect({ - shape: clipShape - }); + if (clipPath) { + updateProps(clipPath, { + shape: clipShape + }, animationModel, dataIndex); + } else { + clipShape[valueDim.wh] = 0; + clipPath = new Rect({ + shape: clipShape + }); - bar.__pictorialBundle.setClipPath(clipPath); + bar.__pictorialBundle.setClipPath(clipPath); - bar.__pictorialClipPath = clipPath; - var target = {}; - target[valueDim.wh] = symbolMeta.clipShape[valueDim.wh]; - graphic[isUpdate ? 'updateProps' : 'initProps'](clipPath, { - shape: target - }, animationModel, dataIndex); - } + bar.__pictorialClipPath = clipPath; + var target = {}; + target[valueDim.wh] = symbolMeta.clipShape[valueDim.wh]; + graphic[isUpdate ? 'updateProps' : 'initProps'](clipPath, { + shape: target + }, animationModel, dataIndex); } + } } function getItemModel(data, dataIndex) { - var itemModel = data.getItemModel(dataIndex); - itemModel.getAnimationDelayParams = getAnimationDelayParams; - itemModel.isAnimationEnabled = isAnimationEnabled; - return itemModel; + var itemModel = data.getItemModel(dataIndex); + itemModel.getAnimationDelayParams = getAnimationDelayParams; + itemModel.isAnimationEnabled = isAnimationEnabled; + return itemModel; } function getAnimationDelayParams(path) { - // The order is the same as the z-order, see `symbolRepeatDiretion`. - return { - index: path.__pictorialAnimationIndex, - count: path.__pictorialRepeatTimes - }; + // The order is the same as the z-order, see `symbolRepeatDiretion`. + return { + index: path.__pictorialAnimationIndex, + count: path.__pictorialRepeatTimes + }; } function isAnimationEnabled() { - // `animation` prop can be set on itemModel in pictorial bar chart. - return this.parentModel.isAnimationEnabled() && !!this.getShallow('animation'); + // `animation` prop can be set on itemModel in pictorial bar chart. + return this.parentModel.isAnimationEnabled() && !!this.getShallow('animation'); } function createBar(data, opt, symbolMeta, isUpdate) { - // bar is the main element for each data. - var bar = new Group(); // bundle is used for location and clip. + // bar is the main element for each data. + var bar = new Group(); // bundle is used for location and clip. - var bundle = new Group(); - bar.add(bundle); - bar.__pictorialBundle = bundle; - bundle.x = symbolMeta.bundlePosition[0]; - bundle.y = symbolMeta.bundlePosition[1]; + var bundle = new Group(); + bar.add(bundle); + bar.__pictorialBundle = bundle; + bundle.x = symbolMeta.bundlePosition[0]; + bundle.y = symbolMeta.bundlePosition[1]; - if (symbolMeta.symbolRepeat) { - createOrUpdateRepeatSymbols(bar, opt, symbolMeta); - } else { - createOrUpdateSingleSymbol(bar, opt, symbolMeta); - } + if (symbolMeta.symbolRepeat) { + createOrUpdateRepeatSymbols(bar, opt, symbolMeta); + } else { + createOrUpdateSingleSymbol(bar, opt, symbolMeta); + } - createOrUpdateBarRect(bar, symbolMeta, isUpdate); - createOrUpdateClip(bar, opt, symbolMeta, isUpdate); - bar.__pictorialShapeStr = getShapeStr(data, symbolMeta); - bar.__pictorialSymbolMeta = symbolMeta; - return bar; + createOrUpdateBarRect(bar, symbolMeta, isUpdate); + createOrUpdateClip(bar, opt, symbolMeta, isUpdate); + bar.__pictorialShapeStr = getShapeStr(data, symbolMeta); + bar.__pictorialSymbolMeta = symbolMeta; + return bar; } function updateBar(bar, opt, symbolMeta) { - var animationModel = symbolMeta.animationModel; - var dataIndex = symbolMeta.dataIndex; - var bundle = bar.__pictorialBundle; - updateProps(bundle, { - x: symbolMeta.bundlePosition[0], - y: symbolMeta.bundlePosition[1] - }, animationModel, dataIndex); - - if (symbolMeta.symbolRepeat) { - createOrUpdateRepeatSymbols(bar, opt, symbolMeta, true); - } else { - createOrUpdateSingleSymbol(bar, opt, symbolMeta, true); - } + var animationModel = symbolMeta.animationModel; + var dataIndex = symbolMeta.dataIndex; + var bundle = bar.__pictorialBundle; + updateProps(bundle, { + x: symbolMeta.bundlePosition[0], + y: symbolMeta.bundlePosition[1] + }, animationModel, dataIndex); - createOrUpdateBarRect(bar, symbolMeta, true); - createOrUpdateClip(bar, opt, symbolMeta, true); + if (symbolMeta.symbolRepeat) { + createOrUpdateRepeatSymbols(bar, opt, symbolMeta, true); + } else { + createOrUpdateSingleSymbol(bar, opt, symbolMeta, true); + } + + createOrUpdateBarRect(bar, symbolMeta, true); + createOrUpdateClip(bar, opt, symbolMeta, true); } function removeBar(data, dataIndex, animationModel, bar) { - // Not show text when animating - var labelRect = bar.__pictorialBarRect; - labelRect && labelRect.removeTextContent(); - var pathes = []; - eachPath(bar, function (path) { - pathes.push(path); - }); - bar.__pictorialMainPath && pathes.push(bar.__pictorialMainPath); // I do not find proper remove animation for clip yet. - - bar.__pictorialClipPath && (animationModel = null); - each(pathes, function (path) { - removeElement(path, { - scaleX: 0, - scaleY: 0 - }, animationModel, dataIndex, function () { - bar.parent && bar.parent.remove(bar); - }); + // Not show text when animating + var labelRect = bar.__pictorialBarRect; + labelRect && labelRect.removeTextContent(); + var pathes = []; + eachPath(bar, function (path) { + pathes.push(path); + }); + bar.__pictorialMainPath && pathes.push(bar.__pictorialMainPath); // I do not find proper remove animation for clip yet. + + bar.__pictorialClipPath && (animationModel = null); + each(pathes, function (path) { + removeElement(path, { + scaleX: 0, + scaleY: 0 + }, animationModel, dataIndex, function () { + bar.parent && bar.parent.remove(bar); }); - data.setItemGraphicEl(dataIndex, null); + }); + data.setItemGraphicEl(dataIndex, null); } function getShapeStr(data, symbolMeta) { - return [data.getItemVisual(symbolMeta.dataIndex, 'symbol') || 'none', !!symbolMeta.symbolRepeat, !!symbolMeta.symbolClip].join(':'); + return [data.getItemVisual(symbolMeta.dataIndex, 'symbol') || 'none', !!symbolMeta.symbolRepeat, !!symbolMeta.symbolClip].join(':'); } function eachPath(bar, cb, context) { - // Do not use Group#eachChild, because it do not support remove. - each(bar.__pictorialBundle.children(), function (el) { - el !== bar.__pictorialBarRect && cb.call(context, el); - }); + // Do not use Group#eachChild, because it do not support remove. + each(bar.__pictorialBundle.children(), function (el) { + el !== bar.__pictorialBarRect && cb.call(context, el); + }); } function updateAttr(el, immediateAttrs, animationAttrs, symbolMeta, isUpdate, cb) { - immediateAttrs && el.attr(immediateAttrs); // when symbolCip used, only clip path has init animation, otherwise it would be weird effect. + immediateAttrs && el.attr(immediateAttrs); // when symbolCip used, only clip path has init animation, otherwise it would be weird effect. - if (symbolMeta.symbolClip && !isUpdate) { - animationAttrs && el.attr(animationAttrs); - } else { - animationAttrs && graphic[isUpdate ? 'updateProps' : 'initProps'](el, animationAttrs, symbolMeta.animationModel, symbolMeta.dataIndex, cb); - } + if (symbolMeta.symbolClip && !isUpdate) { + animationAttrs && el.attr(animationAttrs); + } else { + animationAttrs && graphic[isUpdate ? 'updateProps' : 'initProps'](el, animationAttrs, symbolMeta.animationModel, symbolMeta.dataIndex, cb); + } } function updateCommon$1(bar, opt, symbolMeta) { - var dataIndex = symbolMeta.dataIndex; - var itemModel = symbolMeta.itemModel; // Color must be excluded. - // Because symbol provide setColor individually to set fill and stroke - - var emphasisModel = itemModel.getModel('emphasis'); - var emphasisStyle = emphasisModel.getModel('itemStyle').getItemStyle(); - var blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle(); - var selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle(); - var cursorStyle = itemModel.getShallow('cursor'); - var focus = emphasisModel.get('focus'); - var blurScope = emphasisModel.get('blurScope'); - var hoverScale = emphasisModel.get('scale'); - eachPath(bar, function (path) { - if (path instanceof ZRImage) { - var pathStyle = path.style; - path.useStyle(extend({ - // TODO other properties like dx, dy ? - image: pathStyle.image, - x: pathStyle.x, - y: pathStyle.y, - width: pathStyle.width, - height: pathStyle.height - }, symbolMeta.style)); - } else { - path.useStyle(symbolMeta.style); - } + var dataIndex = symbolMeta.dataIndex; + var itemModel = symbolMeta.itemModel; // Color must be excluded. + // Because symbol provide setColor individually to set fill and stroke + + var emphasisModel = itemModel.getModel('emphasis'); + var emphasisStyle = emphasisModel.getModel('itemStyle').getItemStyle(); + var blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle(); + var selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle(); + var cursorStyle = itemModel.getShallow('cursor'); + var focus = emphasisModel.get('focus'); + var blurScope = emphasisModel.get('blurScope'); + var hoverScale = emphasisModel.get('scale'); + eachPath(bar, function (path) { + if (path instanceof ZRImage) { + var pathStyle = path.style; + path.useStyle(extend({ + // TODO other properties like dx, dy ? + image: pathStyle.image, + x: pathStyle.x, + y: pathStyle.y, + width: pathStyle.width, + height: pathStyle.height + }, symbolMeta.style)); + } else { + path.useStyle(symbolMeta.style); + } - var emphasisState = path.ensureState('emphasis'); - emphasisState.style = emphasisStyle; + var emphasisState = path.ensureState('emphasis'); + emphasisState.style = emphasisStyle; - if (hoverScale) { - // NOTE: Must after scale is set after updateAttr - emphasisState.scaleX = path.scaleX * 1.1; - emphasisState.scaleY = path.scaleY * 1.1; - } + if (hoverScale) { + // NOTE: Must after scale is set after updateAttr + emphasisState.scaleX = path.scaleX * 1.1; + emphasisState.scaleY = path.scaleY * 1.1; + } - path.ensureState('blur').style = blurStyle; - path.ensureState('select').style = selectStyle; - cursorStyle && (path.cursor = cursorStyle); - path.z2 = symbolMeta.z2; - }); - var barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)]; - var barRect = bar.__pictorialBarRect; - setLabelStyle(barRect, getLabelStatesModels(itemModel), { - labelFetcher: opt.seriesModel, - labelDataIndex: dataIndex, - defaultText: getDefaultLabel(opt.seriesModel.getData(), dataIndex), - inheritColor: symbolMeta.style.fill, - defaultOpacity: symbolMeta.style.opacity, - defaultOutsidePosition: barPositionOutside - }); - toggleHoverEmphasis(bar, focus, blurScope, emphasisModel.get('disabled')); + path.ensureState('blur').style = blurStyle; + path.ensureState('select').style = selectStyle; + cursorStyle && (path.cursor = cursorStyle); + path.z2 = symbolMeta.z2; + }); + var barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)]; + var barRect = bar.__pictorialBarRect; + setLabelStyle(barRect, getLabelStatesModels(itemModel), { + labelFetcher: opt.seriesModel, + labelDataIndex: dataIndex, + defaultText: getDefaultLabel(opt.seriesModel.getData(), dataIndex), + inheritColor: symbolMeta.style.fill, + defaultOpacity: symbolMeta.style.opacity, + defaultOutsidePosition: barPositionOutside + }); + toggleHoverEmphasis(bar, focus, blurScope, emphasisModel.get('disabled')); } function toIntTimes(times) { - var roundedTimes = Math.round(times); // Escapse accurate error + var roundedTimes = Math.round(times); // Escapse accurate error - return Math.abs(times - roundedTimes) < 1e-4 ? roundedTimes : Math.ceil(times); + return Math.abs(times - roundedTimes) < 1e-4 ? roundedTimes : Math.ceil(times); } var PictorialBarSeriesModel = - /** @class */ - function (_super) { - __extends(PictorialBarSeriesModel, _super); - - function PictorialBarSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = PictorialBarSeriesModel.type; - _this.hasSymbolVisual = true; - _this.defaultSymbol = 'roundRect'; - return _this; - } - - PictorialBarSeriesModel.prototype.getInitialData = function (option) { - // Disable stack. - option.stack = null; - return _super.prototype.getInitialData.apply(this, arguments); - }; - - PictorialBarSeriesModel.type = 'series.pictorialBar'; - PictorialBarSeriesModel.dependencies = ['grid']; - PictorialBarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, { - symbol: 'circle', - symbolSize: null, - symbolRotate: null, - symbolPosition: null, - symbolOffset: null, - symbolMargin: null, - symbolRepeat: false, - symbolRepeatDirection: 'end', - symbolClip: false, - symbolBoundingData: null, - symbolPatternSize: 400, - barGap: '-100%', - // z can be set in data item, which is z2 actually. - // Disable progressive - progressive: 0, - emphasis: { - // By default pictorialBar do not hover scale. Hover scale is not suitable - // for the case that both has foreground and background. - scale: false - }, - select: { - itemStyle: { - borderColor: '#212121' - } - } - }); - return PictorialBarSeriesModel; - }(BaseBarSeriesModel); + /** @class */ + function (_super) { + __extends(PictorialBarSeriesModel, _super); + + function PictorialBarSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = PictorialBarSeriesModel.type; + _this.hasSymbolVisual = true; + _this.defaultSymbol = 'roundRect'; + return _this; + } + + PictorialBarSeriesModel.prototype.getInitialData = function (option) { + // Disable stack. + option.stack = null; + return _super.prototype.getInitialData.apply(this, arguments); + }; + + PictorialBarSeriesModel.type = 'series.pictorialBar'; + PictorialBarSeriesModel.dependencies = ['grid']; + PictorialBarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, { + symbol: 'circle', + symbolSize: null, + symbolRotate: null, + symbolPosition: null, + symbolOffset: null, + symbolMargin: null, + symbolRepeat: false, + symbolRepeatDirection: 'end', + symbolClip: false, + symbolBoundingData: null, + symbolPatternSize: 400, + barGap: '-100%', + // z can be set in data item, which is z2 actually. + // Disable progressive + progressive: 0, + emphasis: { + // By default pictorialBar do not hover scale. Hover scale is not suitable + // for the case that both has foreground and background. + scale: false + }, + select: { + itemStyle: { + borderColor: '#212121' + } + } + }); + return PictorialBarSeriesModel; + }(BaseBarSeriesModel); function install$o(registers) { - registers.registerChartView(PictorialBarView); - registers.registerSeriesModel(PictorialBarSeriesModel); - registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, curry(layout, 'pictorialBar')); // Do layout after other overall layout, which can preapre some informations. + registers.registerChartView(PictorialBarView); + registers.registerSeriesModel(PictorialBarSeriesModel); + registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, curry(layout, 'pictorialBar')); // Do layout after other overall layout, which can preapre some informations. - registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout('pictorialBar')); + registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout('pictorialBar')); } var ThemeRiverView = - /** @class */ - function (_super) { - __extends(ThemeRiverView, _super); - - function ThemeRiverView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = ThemeRiverView.type; - _this._layers = []; - return _this; - } - - ThemeRiverView.prototype.render = function (seriesModel, ecModel, api) { - var data = seriesModel.getData(); - var self = this; - var group = this.group; - var layersSeries = seriesModel.getLayerSeries(); - var layoutInfo = data.getLayout('layoutInfo'); - var rect = layoutInfo.rect; - var boundaryGap = layoutInfo.boundaryGap; - group.x = 0; - group.y = rect.y + boundaryGap[0]; - - function keyGetter(item) { - return item.name; - } + /** @class */ + function (_super) { + __extends(ThemeRiverView, _super); - var dataDiffer = new DataDiffer(this._layersSeries || [], layersSeries, keyGetter, keyGetter); - var newLayersGroups = []; - dataDiffer.add(bind(process, this, 'add')).update(bind(process, this, 'update')).remove(bind(process, this, 'remove')).execute(); + function ThemeRiverView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - function process(status, idx, oldIdx) { - var oldLayersGroups = self._layers; + _this.type = ThemeRiverView.type; + _this._layers = []; + return _this; + } - if (status === 'remove') { - group.remove(oldLayersGroups[idx]); - return; - } + ThemeRiverView.prototype.render = function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); + var self = this; + var group = this.group; + var layersSeries = seriesModel.getLayerSeries(); + var layoutInfo = data.getLayout('layoutInfo'); + var rect = layoutInfo.rect; + var boundaryGap = layoutInfo.boundaryGap; + group.x = 0; + group.y = rect.y + boundaryGap[0]; - var points0 = []; - var points1 = []; - var style; - var indices = layersSeries[idx].indices; - var j = 0; - - for (; j < indices.length; j++) { - var layout = data.getItemLayout(indices[j]); - var x = layout.x; - var y0 = layout.y0; - var y = layout.y; - points0.push(x, y0); - points1.push(x, y0 + y); - style = data.getItemVisual(indices[j], 'style'); - } + function keyGetter(item) { + return item.name; + } - var polygon; - var textLayout = data.getItemLayout(indices[0]); - var labelModel = seriesModel.getModel('label'); - var margin = labelModel.get('margin'); - var emphasisModel = seriesModel.getModel('emphasis'); - - if (status === 'add') { - var layerGroup = newLayersGroups[idx] = new Group(); - polygon = new ECPolygon({ - shape: { - points: points0, - stackedOnPoints: points1, - smooth: 0.4, - stackedOnSmooth: 0.4, - smoothConstraint: false - }, - z2: 0 - }); - layerGroup.add(polygon); - group.add(layerGroup); + var dataDiffer = new DataDiffer(this._layersSeries || [], layersSeries, keyGetter, keyGetter); + var newLayersGroups = []; + dataDiffer.add(bind(process, this, 'add')).update(bind(process, this, 'update')).remove(bind(process, this, 'remove')).execute(); - if (seriesModel.isAnimationEnabled()) { - polygon.setClipPath(createGridClipShape$2(polygon.getBoundingRect(), seriesModel, function () { - polygon.removeClipPath(); - })); - } - } else { - var layerGroup = oldLayersGroups[oldIdx]; - polygon = layerGroup.childAt(0); - group.add(layerGroup); - newLayersGroups[idx] = layerGroup; - updateProps(polygon, { - shape: { - points: points0, - stackedOnPoints: points1 - } - }, seriesModel); - saveOldStyle(polygon); - } + function process(status, idx, oldIdx) { + var oldLayersGroups = self._layers; - setLabelStyle(polygon, getLabelStatesModels(seriesModel), { - labelDataIndex: indices[j - 1], - defaultText: data.getName(indices[j - 1]), - inheritColor: style.fill - }, { - normal: { - verticalAlign: 'middle' // align: 'right' + if (status === 'remove') { + group.remove(oldLayersGroups[idx]); + return; + } + + var points0 = []; + var points1 = []; + var style; + var indices = layersSeries[idx].indices; + var j = 0; + + for (; j < indices.length; j++) { + var layout = data.getItemLayout(indices[j]); + var x = layout.x; + var y0 = layout.y0; + var y = layout.y; + points0.push(x, y0); + points1.push(x, y0 + y); + style = data.getItemVisual(indices[j], 'style'); + } + + var polygon; + var textLayout = data.getItemLayout(indices[0]); + var labelModel = seriesModel.getModel('label'); + var margin = labelModel.get('margin'); + var emphasisModel = seriesModel.getModel('emphasis'); + + if (status === 'add') { + var layerGroup = newLayersGroups[idx] = new Group(); + polygon = new ECPolygon({ + shape: { + points: points0, + stackedOnPoints: points1, + smooth: 0.4, + stackedOnSmooth: 0.4, + smoothConstraint: false + }, + z2: 0 + }); + layerGroup.add(polygon); + group.add(layerGroup); + + if (seriesModel.isAnimationEnabled()) { + polygon.setClipPath(createGridClipShape$2(polygon.getBoundingRect(), seriesModel, function () { + polygon.removeClipPath(); + })); + } + } else { + var layerGroup = oldLayersGroups[oldIdx]; + polygon = layerGroup.childAt(0); + group.add(layerGroup); + newLayersGroups[idx] = layerGroup; + updateProps(polygon, { + shape: { + points: points0, + stackedOnPoints: points1 + } + }, seriesModel); + saveOldStyle(polygon); + } + + setLabelStyle(polygon, getLabelStatesModels(seriesModel), { + labelDataIndex: indices[j - 1], + defaultText: data.getName(indices[j - 1]), + inheritColor: style.fill + }, { + normal: { + verticalAlign: 'middle' // align: 'right' - } - }); - polygon.setTextConfig({ - position: null, - local: true - }); - var labelEl = polygon.getTextContent(); // TODO More label position options. + } + }); + polygon.setTextConfig({ + position: null, + local: true + }); + var labelEl = polygon.getTextContent(); // TODO More label position options. - if (labelEl) { - labelEl.x = textLayout.x - margin; - labelEl.y = textLayout.y0 + textLayout.y / 2; - } + if (labelEl) { + labelEl.x = textLayout.x - margin; + labelEl.y = textLayout.y0 + textLayout.y / 2; + } - polygon.useStyle(style); - data.setItemGraphicEl(idx, polygon); - setStatesStylesFromModel(polygon, seriesModel); - toggleHoverEmphasis(polygon, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - } + polygon.useStyle(style); + data.setItemGraphicEl(idx, polygon); + setStatesStylesFromModel(polygon, seriesModel); + toggleHoverEmphasis(polygon, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled')); + } - this._layersSeries = layersSeries; - this._layers = newLayersGroups; - }; + this._layersSeries = layersSeries; + this._layers = newLayersGroups; + }; - ThemeRiverView.type = 'themeRiver'; - return ThemeRiverView; - }(ChartView); + ThemeRiverView.type = 'themeRiver'; + return ThemeRiverView; + }(ChartView); function createGridClipShape$2(rect, seriesModel, cb) { - var rectEl = new Rect({ - shape: { - x: rect.x - 10, - y: rect.y - 10, - width: 0, - height: rect.height + 20 - } - }); - initProps(rectEl, { - shape: { - x: rect.x - 50, - width: rect.width + 100, - height: rect.height + 20 - } - }, seriesModel, cb); - return rectEl; + var rectEl = new Rect({ + shape: { + x: rect.x - 10, + y: rect.y - 10, + width: 0, + height: rect.height + 20 + } + }); + initProps(rectEl, { + shape: { + x: rect.x - 50, + width: rect.width + 100, + height: rect.height + 20 + } + }, seriesModel, cb); + return rectEl; } var DATA_NAME_INDEX = 2; var ThemeRiverSeriesModel = - /** @class */ - function (_super) { - __extends(ThemeRiverSeriesModel, _super); - - function ThemeRiverSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + /** @class */ + function (_super) { + __extends(ThemeRiverSeriesModel, _super); - _this.type = ThemeRiverSeriesModel.type; - return _this; - } - /** - * @override - */ + function ThemeRiverSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - - ThemeRiverSeriesModel.prototype.init = function (option) { - // eslint-disable-next-line - _super.prototype.init.apply(this, arguments); // Put this function here is for the sake of consistency of code style. - // Enable legend selection for each data item - // Use a function instead of direct access because data reference may changed + _this.type = ThemeRiverSeriesModel.type; + return _this; + } + /** + * @override + */ - this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this)); - }; - /** - * If there is no value of a certain point in the time for some event,set it value to 0. - * - * @param {Array} data initial data in the option - * @return {Array} - */ + ThemeRiverSeriesModel.prototype.init = function (option) { + // eslint-disable-next-line + _super.prototype.init.apply(this, arguments); // Put this function here is for the sake of consistency of code style. + // Enable legend selection for each data item + // Use a function instead of direct access because data reference may changed - ThemeRiverSeriesModel.prototype.fixData = function (data) { - var rawDataLength = data.length; - /** - * Make sure every layer data get the same keys. - * The value index tells which layer has visited. - * { - * 2014/01/01: -1 - * } - */ + this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this)); + }; + /** + * If there is no value of a certain point in the time for some event,set it value to 0. + * + * @param {Array} data initial data in the option + * @return {Array} + */ - var timeValueKeys = {}; // grouped data by name - var groupResult = groupData(data, function (item) { - if (!timeValueKeys.hasOwnProperty(item[0] + '')) { - timeValueKeys[item[0] + ''] = -1; - } + ThemeRiverSeriesModel.prototype.fixData = function (data) { + var rawDataLength = data.length; + /** + * Make sure every layer data get the same keys. + * The value index tells which layer has visited. + * { + * 2014/01/01: -1 + * } + */ - return item[2]; - }); - var layerData = []; - groupResult.buckets.each(function (items, key) { - layerData.push({ - name: key, - dataList: items - }); - }); - var layerNum = layerData.length; + var timeValueKeys = {}; // grouped data by name - for (var k = 0; k < layerNum; ++k) { - var name_1 = layerData[k].name; + var groupResult = groupData(data, function (item) { + if (!timeValueKeys.hasOwnProperty(item[0] + '')) { + timeValueKeys[item[0] + ''] = -1; + } - for (var j = 0; j < layerData[k].dataList.length; ++j) { - var timeValue = layerData[k].dataList[j][0] + ''; - timeValueKeys[timeValue] = k; - } + return item[2]; + }); + var layerData = []; + groupResult.buckets.each(function (items, key) { + layerData.push({ + name: key, + dataList: items + }); + }); + var layerNum = layerData.length; - for (var timeValue in timeValueKeys) { - if (timeValueKeys.hasOwnProperty(timeValue) && timeValueKeys[timeValue] !== k) { - timeValueKeys[timeValue] = k; - data[rawDataLength] = [timeValue, 0, name_1]; - rawDataLength++; - } - } - } + for (var k = 0; k < layerNum; ++k) { + var name_1 = layerData[k].name; - return data; - }; - /** - * @override - * @param option the initial option that user gived - * @param ecModel the model object for themeRiver option - */ + for (var j = 0; j < layerData[k].dataList.length; ++j) { + var timeValue = layerData[k].dataList[j][0] + ''; + timeValueKeys[timeValue] = k; + } + for (var timeValue in timeValueKeys) { + if (timeValueKeys.hasOwnProperty(timeValue) && timeValueKeys[timeValue] !== k) { + timeValueKeys[timeValue] = k; + data[rawDataLength] = [timeValue, 0, name_1]; + rawDataLength++; + } + } + } - ThemeRiverSeriesModel.prototype.getInitialData = function (option, ecModel) { - var singleAxisModel = this.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0]; - var axisType = singleAxisModel.get('type'); // filter the data item with the value of label is undefined + return data; + }; + /** + * @override + * @param option the initial option that user gived + * @param ecModel the model object for themeRiver option + */ - var filterData = filter(option.data, function (dataItem) { - return dataItem[2] !== undefined; - }); // ??? TODO design a stage to transfer data for themeRiver and lines? - var data = this.fixData(filterData || []); - var nameList = []; - var nameMap = this.nameMap = createHashMap(); - var count = 0; + ThemeRiverSeriesModel.prototype.getInitialData = function (option, ecModel) { + var singleAxisModel = this.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0]; + var axisType = singleAxisModel.get('type'); // filter the data item with the value of label is undefined - for (var i = 0; i < data.length; ++i) { - nameList.push(data[i][DATA_NAME_INDEX]); + var filterData = filter(option.data, function (dataItem) { + return dataItem[2] !== undefined; + }); // ??? TODO design a stage to transfer data for themeRiver and lines? - if (!nameMap.get(data[i][DATA_NAME_INDEX])) { - nameMap.set(data[i][DATA_NAME_INDEX], count); - count++; - } - } + var data = this.fixData(filterData || []); + var nameList = []; + var nameMap = this.nameMap = createHashMap(); + var count = 0; - var dimensions = prepareSeriesDataSchema(data, { - coordDimensions: ['single'], - dimensionsDefine: [{ - name: 'time', - type: getDimensionTypeByAxis(axisType) - }, { - name: 'value', - type: 'float' - }, { - name: 'name', - type: 'ordinal' - }], - encodeDefine: { - single: 0, - value: 1, - itemName: 2 - } - }).dimensions; - var list = new SeriesData(dimensions, this); - list.initData(data); - return list; - }; - /** - * The raw data is divided into multiple layers and each layer - * has same name. - */ + for (var i = 0; i < data.length; ++i) { + nameList.push(data[i][DATA_NAME_INDEX]); + if (!nameMap.get(data[i][DATA_NAME_INDEX])) { + nameMap.set(data[i][DATA_NAME_INDEX], count); + count++; + } + } + + var dimensions = prepareSeriesDataSchema(data, { + coordDimensions: ['single'], + dimensionsDefine: [{ + name: 'time', + type: getDimensionTypeByAxis(axisType) + }, { + name: 'value', + type: 'float' + }, { + name: 'name', + type: 'ordinal' + }], + encodeDefine: { + single: 0, + value: 1, + itemName: 2 + } + }).dimensions; + var list = new SeriesData(dimensions, this); + list.initData(data); + return list; + }; + /** + * The raw data is divided into multiple layers and each layer + * has same name. + */ - ThemeRiverSeriesModel.prototype.getLayerSeries = function () { - var data = this.getData(); - var lenCount = data.count(); - var indexArr = []; - for (var i = 0; i < lenCount; ++i) { - indexArr[i] = i; - } + ThemeRiverSeriesModel.prototype.getLayerSeries = function () { + var data = this.getData(); + var lenCount = data.count(); + var indexArr = []; - var timeDim = data.mapDimension('single'); // data group by name + for (var i = 0; i < lenCount; ++i) { + indexArr[i] = i; + } - var groupResult = groupData(indexArr, function (index) { - return data.get('name', index); - }); - var layerSeries = []; - groupResult.buckets.each(function (items, key) { - items.sort(function (index1, index2) { - return data.get(timeDim, index1) - data.get(timeDim, index2); - }); - layerSeries.push({ - name: key, - indices: items - }); - }); - return layerSeries; - }; - /** - * Get data indices for show tooltip content - */ + var timeDim = data.mapDimension('single'); // data group by name + var groupResult = groupData(indexArr, function (index) { + return data.get('name', index); + }); + var layerSeries = []; + groupResult.buckets.each(function (items, key) { + items.sort(function (index1, index2) { + return data.get(timeDim, index1) - data.get(timeDim, index2); + }); + layerSeries.push({ + name: key, + indices: items + }); + }); + return layerSeries; + }; + /** + * Get data indices for show tooltip content + */ - ThemeRiverSeriesModel.prototype.getAxisTooltipData = function (dim, value, baseAxis) { - if (!isArray(dim)) { - dim = dim ? [dim] : []; - } - var data = this.getData(); - var layerSeries = this.getLayerSeries(); - var indices = []; - var layerNum = layerSeries.length; - var nestestValue; + ThemeRiverSeriesModel.prototype.getAxisTooltipData = function (dim, value, baseAxis) { + if (!isArray(dim)) { + dim = dim ? [dim] : []; + } - for (var i = 0; i < layerNum; ++i) { - var minDist = Number.MAX_VALUE; - var nearestIdx = -1; - var pointNum = layerSeries[i].indices.length; + var data = this.getData(); + var layerSeries = this.getLayerSeries(); + var indices = []; + var layerNum = layerSeries.length; + var nestestValue; - for (var j = 0; j < pointNum; ++j) { - var theValue = data.get(dim[0], layerSeries[i].indices[j]); - var dist = Math.abs(theValue - value); + for (var i = 0; i < layerNum; ++i) { + var minDist = Number.MAX_VALUE; + var nearestIdx = -1; + var pointNum = layerSeries[i].indices.length; - if (dist <= minDist) { - nestestValue = theValue; - minDist = dist; - nearestIdx = layerSeries[i].indices[j]; - } - } + for (var j = 0; j < pointNum; ++j) { + var theValue = data.get(dim[0], layerSeries[i].indices[j]); + var dist = Math.abs(theValue - value); - indices.push(nearestIdx); - } + if (dist <= minDist) { + nestestValue = theValue; + minDist = dist; + nearestIdx = layerSeries[i].indices[j]; + } + } - return { - dataIndices: indices, - nestestValue: nestestValue - }; - }; + indices.push(nearestIdx); + } - ThemeRiverSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - var data = this.getData(); - var name = data.getName(dataIndex); - var value = data.get(data.mapDimension('value'), dataIndex); - return createTooltipMarkup('nameValue', { - name: name, - value: value - }); - }; + return { + dataIndices: indices, + nestestValue: nestestValue + }; + }; + + ThemeRiverSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { + var data = this.getData(); + var name = data.getName(dataIndex); + var value = data.get(data.mapDimension('value'), dataIndex); + return createTooltipMarkup('nameValue', { + name: name, + value: value + }); + }; - ThemeRiverSeriesModel.type = 'series.themeRiver'; - ThemeRiverSeriesModel.dependencies = ['singleAxis']; - ThemeRiverSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - colorBy: 'data', - coordinateSystem: 'singleAxis', - // gap in axis's orthogonal orientation - boundaryGap: ['10%', '10%'], - // legendHoverLink: true, - singleAxisIndex: 0, - animationEasing: 'linear', - label: { - margin: 4, - show: true, - position: 'left', - fontSize: 11 - }, - emphasis: { - label: { - show: true - } - } - }; - return ThemeRiverSeriesModel; - }(SeriesModel); + ThemeRiverSeriesModel.type = 'series.themeRiver'; + ThemeRiverSeriesModel.dependencies = ['singleAxis']; + ThemeRiverSeriesModel.defaultOption = { + // zlevel: 0, + z: 2, + colorBy: 'data', + coordinateSystem: 'singleAxis', + // gap in axis's orthogonal orientation + boundaryGap: ['10%', '10%'], + // legendHoverLink: true, + singleAxisIndex: 0, + animationEasing: 'linear', + label: { + margin: 4, + show: true, + position: 'left', + fontSize: 11 + }, + emphasis: { + label: { + show: true + } + } + }; + return ThemeRiverSeriesModel; + }(SeriesModel); function themeRiverLayout(ecModel, api) { - ecModel.eachSeriesByType('themeRiver', function (seriesModel) { - var data = seriesModel.getData(); - var single = seriesModel.coordinateSystem; - var layoutInfo = {}; // use the axis boundingRect for view - - var rect = single.getRect(); - layoutInfo.rect = rect; - var boundaryGap = seriesModel.get('boundaryGap'); - var axis = single.getAxis(); - layoutInfo.boundaryGap = boundaryGap; - - if (axis.orient === 'horizontal') { - boundaryGap[0] = parsePercent$1(boundaryGap[0], rect.height); - boundaryGap[1] = parsePercent$1(boundaryGap[1], rect.height); - var height = rect.height - boundaryGap[0] - boundaryGap[1]; - doThemeRiverLayout(data, seriesModel, height); - } else { - boundaryGap[0] = parsePercent$1(boundaryGap[0], rect.width); - boundaryGap[1] = parsePercent$1(boundaryGap[1], rect.width); - var width = rect.width - boundaryGap[0] - boundaryGap[1]; - doThemeRiverLayout(data, seriesModel, width); - } + ecModel.eachSeriesByType('themeRiver', function (seriesModel) { + var data = seriesModel.getData(); + var single = seriesModel.coordinateSystem; + var layoutInfo = {}; // use the axis boundingRect for view - data.setLayout('layoutInfo', layoutInfo); - }); + var rect = single.getRect(); + layoutInfo.rect = rect; + var boundaryGap = seriesModel.get('boundaryGap'); + var axis = single.getAxis(); + layoutInfo.boundaryGap = boundaryGap; + + if (axis.orient === 'horizontal') { + boundaryGap[0] = parsePercent$1(boundaryGap[0], rect.height); + boundaryGap[1] = parsePercent$1(boundaryGap[1], rect.height); + var height = rect.height - boundaryGap[0] - boundaryGap[1]; + doThemeRiverLayout(data, seriesModel, height); + } else { + boundaryGap[0] = parsePercent$1(boundaryGap[0], rect.width); + boundaryGap[1] = parsePercent$1(boundaryGap[1], rect.width); + var width = rect.width - boundaryGap[0] - boundaryGap[1]; + doThemeRiverLayout(data, seriesModel, width); + } + + data.setLayout('layoutInfo', layoutInfo); + }); } /** * The layout information about themeriver @@ -70777,50 +70777,50 @@ */ function doThemeRiverLayout(data, seriesModel, height) { - if (!data.count()) { - return; - } + if (!data.count()) { + return; + } - var coordSys = seriesModel.coordinateSystem; // the data in each layer are organized into a series. + var coordSys = seriesModel.coordinateSystem; // the data in each layer are organized into a series. - var layerSeries = seriesModel.getLayerSeries(); // the points in each layer. + var layerSeries = seriesModel.getLayerSeries(); // the points in each layer. - var timeDim = data.mapDimension('single'); - var valueDim = data.mapDimension('value'); - var layerPoints = map(layerSeries, function (singleLayer) { - return map(singleLayer.indices, function (idx) { - var pt = coordSys.dataToPoint(data.get(timeDim, idx)); - pt[1] = data.get(valueDim, idx); - return pt; - }); + var timeDim = data.mapDimension('single'); + var valueDim = data.mapDimension('value'); + var layerPoints = map(layerSeries, function (singleLayer) { + return map(singleLayer.indices, function (idx) { + var pt = coordSys.dataToPoint(data.get(timeDim, idx)); + pt[1] = data.get(valueDim, idx); + return pt; + }); + }); + var base = computeBaseline(layerPoints); + var baseLine = base.y0; + var ky = height / base.max; // set layout information for each item. + + var n = layerSeries.length; + var m = layerSeries[0].indices.length; + var baseY0; + + for (var j = 0; j < m; ++j) { + baseY0 = baseLine[j] * ky; + data.setItemLayout(layerSeries[0].indices[j], { + layerIndex: 0, + x: layerPoints[0][j][0], + y0: baseY0, + y: layerPoints[0][j][1] * ky }); - var base = computeBaseline(layerPoints); - var baseLine = base.y0; - var ky = height / base.max; // set layout information for each item. - - var n = layerSeries.length; - var m = layerSeries[0].indices.length; - var baseY0; - - for (var j = 0; j < m; ++j) { - baseY0 = baseLine[j] * ky; - data.setItemLayout(layerSeries[0].indices[j], { - layerIndex: 0, - x: layerPoints[0][j][0], - y0: baseY0, - y: layerPoints[0][j][1] * ky - }); - for (var i = 1; i < n; ++i) { - baseY0 += layerPoints[i - 1][j][1] * ky; - data.setItemLayout(layerSeries[i].indices[j], { - layerIndex: i, - x: layerPoints[i][j][0], - y0: baseY0, - y: layerPoints[i][j][1] * ky - }); - } + for (var i = 1; i < n; ++i) { + baseY0 += layerPoints[i - 1][j][1] * ky; + data.setItemLayout(layerSeries[i].indices[j], { + layerIndex: i, + x: layerPoints[i][j][0], + y0: baseY0, + y: layerPoints[i][j][1] * ky + }); } + } } /** * Compute the baseLine of the rawdata @@ -70831,51 +70831,51 @@ function computeBaseline(data) { - var layerNum = data.length; - var pointNum = data[0].length; - var sums = []; - var y0 = []; - var max = 0; - - for (var i = 0; i < pointNum; ++i) { - var temp = 0; + var layerNum = data.length; + var pointNum = data[0].length; + var sums = []; + var y0 = []; + var max = 0; - for (var j = 0; j < layerNum; ++j) { - temp += data[j][i][1]; - } - - if (temp > max) { - max = temp; - } + for (var i = 0; i < pointNum; ++i) { + var temp = 0; - sums.push(temp); + for (var j = 0; j < layerNum; ++j) { + temp += data[j][i][1]; } - for (var k = 0; k < pointNum; ++k) { - y0[k] = (max - sums[k]) / 2; + if (temp > max) { + max = temp; } - max = 0; + sums.push(temp); + } - for (var l = 0; l < pointNum; ++l) { - var sum = sums[l] + y0[l]; + for (var k = 0; k < pointNum; ++k) { + y0[k] = (max - sums[k]) / 2; + } - if (sum > max) { - max = sum; - } + max = 0; + + for (var l = 0; l < pointNum; ++l) { + var sum = sums[l] + y0[l]; + + if (sum > max) { + max = sum; } + } - return { - y0: y0, - max: max - }; + return { + y0: y0, + max: max + }; } function install$p(registers) { - registers.registerChartView(ThemeRiverView); - registers.registerSeriesModel(ThemeRiverSeriesModel); - registers.registerLayout(themeRiverLayout); - registers.registerProcessor(dataFilter('themeRiver')); + registers.registerChartView(ThemeRiverView); + registers.registerSeriesModel(ThemeRiverSeriesModel); + registers.registerLayout(themeRiverLayout); + registers.registerProcessor(dataFilter('themeRiver')); } var DEFAULT_SECTOR_Z = 2; @@ -70885,805 +70885,805 @@ */ var SunburstPiece = - /** @class */ - function (_super) { - __extends(SunburstPiece, _super); - - function SunburstPiece(node, seriesModel, ecModel, api) { - var _this = _super.call(this) || this; + /** @class */ + function (_super) { + __extends(SunburstPiece, _super); - _this.z2 = DEFAULT_SECTOR_Z; - _this.textConfig = { - inside: true - }; - getECData(_this).seriesIndex = seriesModel.seriesIndex; - var text = new ZRText({ - z2: DEFAULT_TEXT_Z, - silent: node.getModel().get(['label', 'silent']) - }); - - _this.setTextContent(text); - - _this.updateData(true, node, seriesModel, ecModel, api); - - return _this; - } - - SunburstPiece.prototype.updateData = function (firstCreate, node, // state: 'emphasis' | 'normal' | 'highlight' | 'downplay', - seriesModel, ecModel, api) { - this.node = node; - node.piece = this; - seriesModel = seriesModel || this._seriesModel; - ecModel = ecModel || this._ecModel; - var sector = this; - getECData(sector).dataIndex = node.dataIndex; - var itemModel = node.getModel(); - var emphasisModel = itemModel.getModel('emphasis'); - var layout = node.getLayout(); - var sectorShape = extend({}, layout); - sectorShape.label = null; - var normalStyle = node.getVisual('style'); - normalStyle.lineJoin = 'bevel'; - var decal = node.getVisual('decal'); - - if (decal) { - normalStyle.decal = createOrUpdatePatternFromDecal(decal, api); - } - - var cornerRadius = getSectorCornerRadius(itemModel.getModel('itemStyle'), sectorShape, true); - extend(sectorShape, cornerRadius); - each(SPECIAL_STATES, function (stateName) { - var state = sector.ensureState(stateName); - var itemStyleModel = itemModel.getModel([stateName, 'itemStyle']); - state.style = itemStyleModel.getItemStyle(); // border radius - - var cornerRadius = getSectorCornerRadius(itemStyleModel, sectorShape); - - if (cornerRadius) { - state.shape = cornerRadius; - } - }); - - if (firstCreate) { - sector.setShape(sectorShape); - sector.shape.r = layout.r0; - updateProps(sector, { - shape: { - r: layout.r - } - }, seriesModel, node.dataIndex); - } else { - // Disable animation for gradient since no interpolation method - // is supported for gradient - updateProps(sector, { - shape: sectorShape - }, seriesModel); - saveOldStyle(sector); - } - - sector.useStyle(normalStyle); - - this._updateLabel(seriesModel); - - var cursorStyle = itemModel.getShallow('cursor'); - cursorStyle && sector.attr('cursor', cursorStyle); - this._seriesModel = seriesModel || this._seriesModel; - this._ecModel = ecModel || this._ecModel; - var focus = emphasisModel.get('focus'); - var focusOrIndices = focus === 'ancestor' ? node.getAncestorsIndices() : focus === 'descendant' ? node.getDescendantIndices() : focus; - toggleHoverEmphasis(this, focusOrIndices, emphasisModel.get('blurScope'), emphasisModel.get('disabled')); - }; - - SunburstPiece.prototype._updateLabel = function (seriesModel) { - var _this = this; - - var itemModel = this.node.getModel(); - var normalLabelModel = itemModel.getModel('label'); - var layout = this.node.getLayout(); - var angle = layout.endAngle - layout.startAngle; - var midAngle = (layout.startAngle + layout.endAngle) / 2; - var dx = Math.cos(midAngle); - var dy = Math.sin(midAngle); - var sector = this; - var label = sector.getTextContent(); - var dataIndex = this.node.dataIndex; - var labelMinAngle = normalLabelModel.get('minAngle') / 180 * Math.PI; - var isNormalShown = normalLabelModel.get('show') && !(labelMinAngle != null && Math.abs(angle) < labelMinAngle); - label.ignore = !isNormalShown; // TODO use setLabelStyle - - each(DISPLAY_STATES, function (stateName) { - var labelStateModel = stateName === 'normal' ? itemModel.getModel('label') : itemModel.getModel([stateName, 'label']); - var isNormal = stateName === 'normal'; - var state = isNormal ? label : label.ensureState(stateName); - var text = seriesModel.getFormattedLabel(dataIndex, stateName); - - if (isNormal) { - text = text || _this.node.name; - } - - state.style = createTextStyle(labelStateModel, {}, null, stateName !== 'normal', true); - - if (text) { - state.style.text = text; - } // Not displaying text when angle is too small + function SunburstPiece(node, seriesModel, ecModel, api) { + var _this = _super.call(this) || this; + _this.z2 = DEFAULT_SECTOR_Z; + _this.textConfig = { + inside: true + }; + getECData(_this).seriesIndex = seriesModel.seriesIndex; + var text = new ZRText({ + z2: DEFAULT_TEXT_Z, + silent: node.getModel().get(['label', 'silent']) + }); - var isShown = labelStateModel.get('show'); + _this.setTextContent(text); - if (isShown != null && !isNormal) { - state.ignore = !isShown; - } + _this.updateData(true, node, seriesModel, ecModel, api); - var labelPosition = getLabelAttr(labelStateModel, 'position'); - var sectorState = isNormal ? sector : sector.states[stateName]; - var labelColor = sectorState.style.fill; - sectorState.textConfig = { - outsideFill: labelStateModel.get('color') === 'inherit' ? labelColor : null, - inside: labelPosition !== 'outside' - }; - var r; - var labelPadding = getLabelAttr(labelStateModel, 'distance') || 0; - var textAlign = getLabelAttr(labelStateModel, 'align'); + return _this; + } - if (labelPosition === 'outside') { - r = layout.r + labelPadding; - textAlign = midAngle > Math.PI / 2 ? 'right' : 'left'; - } else { - if (!textAlign || textAlign === 'center') { - // Put label in the center if it's a circle - if (angle === 2 * Math.PI && layout.r0 === 0) { - r = 0; - } else { - r = (layout.r + layout.r0) / 2; - } + SunburstPiece.prototype.updateData = function (firstCreate, node, // state: 'emphasis' | 'normal' | 'highlight' | 'downplay', + seriesModel, ecModel, api) { + this.node = node; + node.piece = this; + seriesModel = seriesModel || this._seriesModel; + ecModel = ecModel || this._ecModel; + var sector = this; + getECData(sector).dataIndex = node.dataIndex; + var itemModel = node.getModel(); + var emphasisModel = itemModel.getModel('emphasis'); + var layout = node.getLayout(); + var sectorShape = extend({}, layout); + sectorShape.label = null; + var normalStyle = node.getVisual('style'); + normalStyle.lineJoin = 'bevel'; + var decal = node.getVisual('decal'); - textAlign = 'center'; - } else if (textAlign === 'left') { - r = layout.r0 + labelPadding; + if (decal) { + normalStyle.decal = createOrUpdatePatternFromDecal(decal, api); + } - if (midAngle > Math.PI / 2) { - textAlign = 'right'; - } - } else if (textAlign === 'right') { - r = layout.r - labelPadding; + var cornerRadius = getSectorCornerRadius(itemModel.getModel('itemStyle'), sectorShape, true); + extend(sectorShape, cornerRadius); + each(SPECIAL_STATES, function (stateName) { + var state = sector.ensureState(stateName); + var itemStyleModel = itemModel.getModel([stateName, 'itemStyle']); + state.style = itemStyleModel.getItemStyle(); // border radius - if (midAngle > Math.PI / 2) { - textAlign = 'left'; - } - } - } + var cornerRadius = getSectorCornerRadius(itemStyleModel, sectorShape); - state.style.align = textAlign; - state.style.verticalAlign = getLabelAttr(labelStateModel, 'verticalAlign') || 'middle'; - state.x = r * dx + layout.cx; - state.y = r * dy + layout.cy; - var rotateType = getLabelAttr(labelStateModel, 'rotate'); - var rotate = 0; + if (cornerRadius) { + state.shape = cornerRadius; + } + }); - if (rotateType === 'radial') { - rotate = -midAngle; + if (firstCreate) { + sector.setShape(sectorShape); + sector.shape.r = layout.r0; + updateProps(sector, { + shape: { + r: layout.r + } + }, seriesModel, node.dataIndex); + } else { + // Disable animation for gradient since no interpolation method + // is supported for gradient + updateProps(sector, { + shape: sectorShape + }, seriesModel); + saveOldStyle(sector); + } - if (rotate < -Math.PI / 2) { - rotate += Math.PI; - } - } else if (rotateType === 'tangential') { - rotate = Math.PI / 2 - midAngle; + sector.useStyle(normalStyle); - if (rotate > Math.PI / 2) { - rotate -= Math.PI; - } else if (rotate < -Math.PI / 2) { - rotate += Math.PI; - } - } else if (isNumber(rotateType)) { - rotate = rotateType * Math.PI / 180; - } + this._updateLabel(seriesModel); - state.rotation = rotate; - }); + var cursorStyle = itemModel.getShallow('cursor'); + cursorStyle && sector.attr('cursor', cursorStyle); + this._seriesModel = seriesModel || this._seriesModel; + this._ecModel = ecModel || this._ecModel; + var focus = emphasisModel.get('focus'); + var focusOrIndices = focus === 'ancestor' ? node.getAncestorsIndices() : focus === 'descendant' ? node.getDescendantIndices() : focus; + toggleHoverEmphasis(this, focusOrIndices, emphasisModel.get('blurScope'), emphasisModel.get('disabled')); + }; + + SunburstPiece.prototype._updateLabel = function (seriesModel) { + var _this = this; + + var itemModel = this.node.getModel(); + var normalLabelModel = itemModel.getModel('label'); + var layout = this.node.getLayout(); + var angle = layout.endAngle - layout.startAngle; + var midAngle = (layout.startAngle + layout.endAngle) / 2; + var dx = Math.cos(midAngle); + var dy = Math.sin(midAngle); + var sector = this; + var label = sector.getTextContent(); + var dataIndex = this.node.dataIndex; + var labelMinAngle = normalLabelModel.get('minAngle') / 180 * Math.PI; + var isNormalShown = normalLabelModel.get('show') && !(labelMinAngle != null && Math.abs(angle) < labelMinAngle); + label.ignore = !isNormalShown; // TODO use setLabelStyle + + each(DISPLAY_STATES, function (stateName) { + var labelStateModel = stateName === 'normal' ? itemModel.getModel('label') : itemModel.getModel([stateName, 'label']); + var isNormal = stateName === 'normal'; + var state = isNormal ? label : label.ensureState(stateName); + var text = seriesModel.getFormattedLabel(dataIndex, stateName); + + if (isNormal) { + text = text || _this.node.name; + } + + state.style = createTextStyle(labelStateModel, {}, null, stateName !== 'normal', true); + + if (text) { + state.style.text = text; + } // Not displaying text when angle is too small + + + var isShown = labelStateModel.get('show'); + + if (isShown != null && !isNormal) { + state.ignore = !isShown; + } + + var labelPosition = getLabelAttr(labelStateModel, 'position'); + var sectorState = isNormal ? sector : sector.states[stateName]; + var labelColor = sectorState.style.fill; + sectorState.textConfig = { + outsideFill: labelStateModel.get('color') === 'inherit' ? labelColor : null, + inside: labelPosition !== 'outside' + }; + var r; + var labelPadding = getLabelAttr(labelStateModel, 'distance') || 0; + var textAlign = getLabelAttr(labelStateModel, 'align'); + + if (labelPosition === 'outside') { + r = layout.r + labelPadding; + textAlign = midAngle > Math.PI / 2 ? 'right' : 'left'; + } else { + if (!textAlign || textAlign === 'center') { + // Put label in the center if it's a circle + if (angle === 2 * Math.PI && layout.r0 === 0) { + r = 0; + } else { + r = (layout.r + layout.r0) / 2; + } + + textAlign = 'center'; + } else if (textAlign === 'left') { + r = layout.r0 + labelPadding; + + if (midAngle > Math.PI / 2) { + textAlign = 'right'; + } + } else if (textAlign === 'right') { + r = layout.r - labelPadding; + + if (midAngle > Math.PI / 2) { + textAlign = 'left'; + } + } + } + + state.style.align = textAlign; + state.style.verticalAlign = getLabelAttr(labelStateModel, 'verticalAlign') || 'middle'; + state.x = r * dx + layout.cx; + state.y = r * dy + layout.cy; + var rotateType = getLabelAttr(labelStateModel, 'rotate'); + var rotate = 0; + + if (rotateType === 'radial') { + rotate = -midAngle; + + if (rotate < -Math.PI / 2) { + rotate += Math.PI; + } + } else if (rotateType === 'tangential') { + rotate = Math.PI / 2 - midAngle; + + if (rotate > Math.PI / 2) { + rotate -= Math.PI; + } else if (rotate < -Math.PI / 2) { + rotate += Math.PI; + } + } else if (isNumber(rotateType)) { + rotate = rotateType * Math.PI / 180; + } + + state.rotation = rotate; + }); - function getLabelAttr(model, name) { - var stateAttr = model.get(name); + function getLabelAttr(model, name) { + var stateAttr = model.get(name); - if (stateAttr == null) { - return normalLabelModel.get(name); - } + if (stateAttr == null) { + return normalLabelModel.get(name); + } - return stateAttr; - } + return stateAttr; + } - label.dirtyStyle(); - }; + label.dirtyStyle(); + }; - return SunburstPiece; - }(Sector); + return SunburstPiece; + }(Sector); var ROOT_TO_NODE_ACTION = 'sunburstRootToNode'; var HIGHLIGHT_ACTION = 'sunburstHighlight'; var UNHIGHLIGHT_ACTION = 'sunburstUnhighlight'; function installSunburstAction(registers) { - registers.registerAction({ - type: ROOT_TO_NODE_ACTION, - update: 'updateView' - }, function (payload, ecModel) { - ecModel.eachComponent({ - mainType: 'series', - subType: 'sunburst', - query: payload - }, handleRootToNode); - - function handleRootToNode(model, index) { - var targetInfo = retrieveTargetInfo(payload, [ROOT_TO_NODE_ACTION], model); - - if (targetInfo) { - var originViewRoot = model.getViewRoot(); - - if (originViewRoot) { - payload.direction = aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown'; - } + registers.registerAction({ + type: ROOT_TO_NODE_ACTION, + update: 'updateView' + }, function (payload, ecModel) { + ecModel.eachComponent({ + mainType: 'series', + subType: 'sunburst', + query: payload + }, handleRootToNode); - model.resetViewRoot(targetInfo.node); - } - } - }); - registers.registerAction({ - type: HIGHLIGHT_ACTION, - update: 'none' - }, function (payload, ecModel, api) { - // Clone - payload = extend({}, payload); - ecModel.eachComponent({ - mainType: 'series', - subType: 'sunburst', - query: payload - }, handleHighlight); + function handleRootToNode(model, index) { + var targetInfo = retrieveTargetInfo(payload, [ROOT_TO_NODE_ACTION], model); - function handleHighlight(model) { - var targetInfo = retrieveTargetInfo(payload, [HIGHLIGHT_ACTION], model); + if (targetInfo) { + var originViewRoot = model.getViewRoot(); - if (targetInfo) { - payload.dataIndex = targetInfo.node.dataIndex; - } + if (originViewRoot) { + payload.direction = aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown'; } - if ("development" !== 'production') { - deprecateReplaceLog('highlight', 'sunburstHighlight'); - } // Fast forward action + model.resetViewRoot(targetInfo.node); + } + } + }); + registers.registerAction({ + type: HIGHLIGHT_ACTION, + update: 'none' + }, function (payload, ecModel, api) { + // Clone + payload = extend({}, payload); + ecModel.eachComponent({ + mainType: 'series', + subType: 'sunburst', + query: payload + }, handleHighlight); + function handleHighlight(model) { + var targetInfo = retrieveTargetInfo(payload, [HIGHLIGHT_ACTION], model); - api.dispatchAction(extend(payload, { - type: 'highlight' - })); - }); - registers.registerAction({ - type: UNHIGHLIGHT_ACTION, - update: 'updateView' - }, function (payload, ecModel, api) { - payload = extend({}, payload); + if (targetInfo) { + payload.dataIndex = targetInfo.node.dataIndex; + } + } - if ("development" !== 'production') { - deprecateReplaceLog('downplay', 'sunburstUnhighlight'); - } + if ("development" !== 'production') { + deprecateReplaceLog('highlight', 'sunburstHighlight'); + } // Fast forward action - api.dispatchAction(extend(payload, { - type: 'downplay' - })); - }); - } - var SunburstView = - /** @class */ - function (_super) { - __extends(SunburstView, _super); + api.dispatchAction(extend(payload, { + type: 'highlight' + })); + }); + registers.registerAction({ + type: UNHIGHLIGHT_ACTION, + update: 'updateView' + }, function (payload, ecModel, api) { + payload = extend({}, payload); - function SunburstView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + if ("development" !== 'production') { + deprecateReplaceLog('downplay', 'sunburstUnhighlight'); + } - _this.type = SunburstView.type; - return _this; - } + api.dispatchAction(extend(payload, { + type: 'downplay' + })); + }); + } - SunburstView.prototype.render = function (seriesModel, ecModel, api, // @ts-ignore - payload) { - var self = this; - this.seriesModel = seriesModel; - this.api = api; - this.ecModel = ecModel; - var data = seriesModel.getData(); - var virtualRoot = data.tree.root; - var newRoot = seriesModel.getViewRoot(); - var group = this.group; - var renderLabelForZeroData = seriesModel.get('renderLabelForZeroData'); - var newChildren = []; - newRoot.eachNode(function (node) { - newChildren.push(node); - }); - var oldChildren = this._oldChildren || []; - dualTravel(newChildren, oldChildren); - renderRollUp(virtualRoot, newRoot); + var SunburstView = + /** @class */ + function (_super) { + __extends(SunburstView, _super); - this._initEvents(); + function SunburstView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - this._oldChildren = newChildren; + _this.type = SunburstView.type; + return _this; + } - function dualTravel(newChildren, oldChildren) { - if (newChildren.length === 0 && oldChildren.length === 0) { - return; - } + SunburstView.prototype.render = function (seriesModel, ecModel, api, // @ts-ignore + payload) { + var self = this; + this.seriesModel = seriesModel; + this.api = api; + this.ecModel = ecModel; + var data = seriesModel.getData(); + var virtualRoot = data.tree.root; + var newRoot = seriesModel.getViewRoot(); + var group = this.group; + var renderLabelForZeroData = seriesModel.get('renderLabelForZeroData'); + var newChildren = []; + newRoot.eachNode(function (node) { + newChildren.push(node); + }); + var oldChildren = this._oldChildren || []; + dualTravel(newChildren, oldChildren); + renderRollUp(virtualRoot, newRoot); - new DataDiffer(oldChildren, newChildren, getKey, getKey).add(processNode).update(processNode).remove(curry(processNode, null)).execute(); + this._initEvents(); - function getKey(node) { - return node.getId(); - } + this._oldChildren = newChildren; - function processNode(newIdx, oldIdx) { - var newNode = newIdx == null ? null : newChildren[newIdx]; - var oldNode = oldIdx == null ? null : oldChildren[oldIdx]; - doRenderNode(newNode, oldNode); - } - } + function dualTravel(newChildren, oldChildren) { + if (newChildren.length === 0 && oldChildren.length === 0) { + return; + } - function doRenderNode(newNode, oldNode) { - if (!renderLabelForZeroData && newNode && !newNode.getValue()) { - // Not render data with value 0 - newNode = null; - } + new DataDiffer(oldChildren, newChildren, getKey, getKey).add(processNode).update(processNode).remove(curry(processNode, null)).execute(); - if (newNode !== virtualRoot && oldNode !== virtualRoot) { - if (oldNode && oldNode.piece) { - if (newNode) { - // Update - oldNode.piece.updateData(false, newNode, seriesModel, ecModel, api); // For tooltip + function getKey(node) { + return node.getId(); + } - data.setItemGraphicEl(newNode.dataIndex, oldNode.piece); - } else { - // Remove - removeNode(oldNode); - } - } else if (newNode) { - // Add - var piece = new SunburstPiece(newNode, seriesModel, ecModel, api); - group.add(piece); // For tooltip + function processNode(newIdx, oldIdx) { + var newNode = newIdx == null ? null : newChildren[newIdx]; + var oldNode = oldIdx == null ? null : oldChildren[oldIdx]; + doRenderNode(newNode, oldNode); + } + } - data.setItemGraphicEl(newNode.dataIndex, piece); - } - } - } + function doRenderNode(newNode, oldNode) { + if (!renderLabelForZeroData && newNode && !newNode.getValue()) { + // Not render data with value 0 + newNode = null; + } - function removeNode(node) { - if (!node) { - return; - } + if (newNode !== virtualRoot && oldNode !== virtualRoot) { + if (oldNode && oldNode.piece) { + if (newNode) { + // Update + oldNode.piece.updateData(false, newNode, seriesModel, ecModel, api); // For tooltip - if (node.piece) { - group.remove(node.piece); - node.piece = null; - } - } + data.setItemGraphicEl(newNode.dataIndex, oldNode.piece); + } else { + // Remove + removeNode(oldNode); + } + } else if (newNode) { + // Add + var piece = new SunburstPiece(newNode, seriesModel, ecModel, api); + group.add(piece); // For tooltip - function renderRollUp(virtualRoot, viewRoot) { - if (viewRoot.depth > 0) { - // Render - if (self.virtualPiece) { - // Update - self.virtualPiece.updateData(false, virtualRoot, seriesModel, ecModel, api); - } else { - // Add - self.virtualPiece = new SunburstPiece(virtualRoot, seriesModel, ecModel, api); - group.add(self.virtualPiece); - } // TODO event scope + data.setItemGraphicEl(newNode.dataIndex, piece); + } + } + } + function removeNode(node) { + if (!node) { + return; + } - viewRoot.piece.off('click'); - self.virtualPiece.on('click', function (e) { - self._rootToNode(viewRoot.parentNode); - }); - } else if (self.virtualPiece) { - // Remove - group.remove(self.virtualPiece); - self.virtualPiece = null; - } - } - }; - /** - * @private - */ + if (node.piece) { + group.remove(node.piece); + node.piece = null; + } + } + function renderRollUp(virtualRoot, viewRoot) { + if (viewRoot.depth > 0) { + // Render + if (self.virtualPiece) { + // Update + self.virtualPiece.updateData(false, virtualRoot, seriesModel, ecModel, api); + } else { + // Add + self.virtualPiece = new SunburstPiece(virtualRoot, seriesModel, ecModel, api); + group.add(self.virtualPiece); + } // TODO event scope - SunburstView.prototype._initEvents = function () { - var _this = this; - this.group.off('click'); - this.group.on('click', function (e) { - var targetFound = false; + viewRoot.piece.off('click'); + self.virtualPiece.on('click', function (e) { + self._rootToNode(viewRoot.parentNode); + }); + } else if (self.virtualPiece) { + // Remove + group.remove(self.virtualPiece); + self.virtualPiece = null; + } + } + }; + /** + * @private + */ - var viewRoot = _this.seriesModel.getViewRoot(); - viewRoot.eachNode(function (node) { - if (!targetFound && node.piece && node.piece === e.target) { - var nodeClick = node.getModel().get('nodeClick'); + SunburstView.prototype._initEvents = function () { + var _this = this; - if (nodeClick === 'rootToNode') { - _this._rootToNode(node); - } else if (nodeClick === 'link') { - var itemModel = node.getModel(); - var link = itemModel.get('link'); + this.group.off('click'); + this.group.on('click', function (e) { + var targetFound = false; - if (link) { - var linkTarget = itemModel.get('target', true) || '_blank'; - windowOpen(link, linkTarget); - } - } + var viewRoot = _this.seriesModel.getViewRoot(); - targetFound = true; - } - }); - }); - }; - /** - * @private - */ + viewRoot.eachNode(function (node) { + if (!targetFound && node.piece && node.piece === e.target) { + var nodeClick = node.getModel().get('nodeClick'); + if (nodeClick === 'rootToNode') { + _this._rootToNode(node); + } else if (nodeClick === 'link') { + var itemModel = node.getModel(); + var link = itemModel.get('link'); - SunburstView.prototype._rootToNode = function (node) { - if (node !== this.seriesModel.getViewRoot()) { - this.api.dispatchAction({ - type: ROOT_TO_NODE_ACTION, - from: this.uid, - seriesId: this.seriesModel.id, - targetNode: node - }); + if (link) { + var linkTarget = itemModel.get('target', true) || '_blank'; + windowOpen(link, linkTarget); } - }; - /** - * @implement - */ - + } - SunburstView.prototype.containPoint = function (point, seriesModel) { - var treeRoot = seriesModel.getData(); - var itemLayout = treeRoot.getItemLayout(0); - - if (itemLayout) { - var dx = point[0] - itemLayout.cx; - var dy = point[1] - itemLayout.cy; - var radius = Math.sqrt(dx * dx + dy * dy); - return radius <= itemLayout.r && radius >= itemLayout.r0; - } - }; + targetFound = true; + } + }); + }); + }; + /** + * @private + */ - SunburstView.type = 'sunburst'; - return SunburstView; - }(ChartView); - var SunburstSeriesModel = - /** @class */ - function (_super) { - __extends(SunburstSeriesModel, _super); + SunburstView.prototype._rootToNode = function (node) { + if (node !== this.seriesModel.getViewRoot()) { + this.api.dispatchAction({ + type: ROOT_TO_NODE_ACTION, + from: this.uid, + seriesId: this.seriesModel.id, + targetNode: node + }); + } + }; + /** + * @implement + */ - function SunburstSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SunburstSeriesModel.type; - _this.ignoreStyleOnData = true; - return _this; - } + SunburstView.prototype.containPoint = function (point, seriesModel) { + var treeRoot = seriesModel.getData(); + var itemLayout = treeRoot.getItemLayout(0); - SunburstSeriesModel.prototype.getInitialData = function (option, ecModel) { - // Create a virtual root. - var root = { - name: option.name, - children: option.data - }; - completeTreeValue$1(root); - var levelModels = this._levelModels = map(option.levels || [], function (levelDefine) { - return new Model(levelDefine, this, ecModel); - }, this); // Make sure always a new tree is created when setOption, - // in TreemapView, we check whether oldTree === newTree - // to choose mappings approach among old shapes and new shapes. - - var tree = Tree.createTree(root, this, beforeLink); - - function beforeLink(nodeData) { - nodeData.wrapMethod('getItemModel', function (model, idx) { - var node = tree.getNodeByDataIndex(idx); - var levelModel = levelModels[node.depth]; - levelModel && (model.parentModel = levelModel); - return model; - }); - } + if (itemLayout) { + var dx = point[0] - itemLayout.cx; + var dy = point[1] - itemLayout.cy; + var radius = Math.sqrt(dx * dx + dy * dy); + return radius <= itemLayout.r && radius >= itemLayout.r0; + } + }; - return tree.data; - }; + SunburstView.type = 'sunburst'; + return SunburstView; + }(ChartView); - SunburstSeriesModel.prototype.optionUpdated = function () { - this.resetViewRoot(); - }; - /* + var SunburstSeriesModel = + /** @class */ + function (_super) { + __extends(SunburstSeriesModel, _super); + + function SunburstSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = SunburstSeriesModel.type; + _this.ignoreStyleOnData = true; + return _this; + } + + SunburstSeriesModel.prototype.getInitialData = function (option, ecModel) { + // Create a virtual root. + var root = { + name: option.name, + children: option.data + }; + completeTreeValue$1(root); + var levelModels = this._levelModels = map(option.levels || [], function (levelDefine) { + return new Model(levelDefine, this, ecModel); + }, this); // Make sure always a new tree is created when setOption, + // in TreemapView, we check whether oldTree === newTree + // to choose mappings approach among old shapes and new shapes. + + var tree = Tree.createTree(root, this, beforeLink); + + function beforeLink(nodeData) { + nodeData.wrapMethod('getItemModel', function (model, idx) { + var node = tree.getNodeByDataIndex(idx); + var levelModel = levelModels[node.depth]; + levelModel && (model.parentModel = levelModel); + return model; + }); + } + + return tree.data; + }; + + SunburstSeriesModel.prototype.optionUpdated = function () { + this.resetViewRoot(); + }; + /* * @override */ - SunburstSeriesModel.prototype.getDataParams = function (dataIndex) { - var params = _super.prototype.getDataParams.apply(this, arguments); + SunburstSeriesModel.prototype.getDataParams = function (dataIndex) { + var params = _super.prototype.getDataParams.apply(this, arguments); - var node = this.getData().tree.getNodeByDataIndex(dataIndex); - params.treePathInfo = wrapTreePathInfo(node, this); - return params; - }; + var node = this.getData().tree.getNodeByDataIndex(dataIndex); + params.treePathInfo = wrapTreePathInfo(node, this); + return params; + }; - SunburstSeriesModel.prototype.getLevelModel = function (node) { - return this._levelModels && this._levelModels[node.depth]; - }; + SunburstSeriesModel.prototype.getLevelModel = function (node) { + return this._levelModels && this._levelModels[node.depth]; + }; - SunburstSeriesModel.prototype.getViewRoot = function () { - return this._viewRoot; - }; + SunburstSeriesModel.prototype.getViewRoot = function () { + return this._viewRoot; + }; - SunburstSeriesModel.prototype.resetViewRoot = function (viewRoot) { - viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot; - var root = this.getRawData().tree.root; + SunburstSeriesModel.prototype.resetViewRoot = function (viewRoot) { + viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot; + var root = this.getRawData().tree.root; - if (!viewRoot || viewRoot !== root && !root.contains(viewRoot)) { - this._viewRoot = root; - } - }; + if (!viewRoot || viewRoot !== root && !root.contains(viewRoot)) { + this._viewRoot = root; + } + }; - SunburstSeriesModel.prototype.enableAriaDecal = function () { - enableAriaDecalForTree(this); - }; + SunburstSeriesModel.prototype.enableAriaDecal = function () { + enableAriaDecalForTree(this); + }; - SunburstSeriesModel.type = 'series.sunburst'; - SunburstSeriesModel.defaultOption = { - // zlevel: 0, - z: 2, - // 默认全局居中 - center: ['50%', '50%'], - radius: [0, '75%'], - // 默认顺时针 - clockwise: true, - startAngle: 90, - // 最小角度改为0 - minAngle: 0, - // If still show when all data zero. - stillShowZeroSum: true, - // 'rootToNode', 'link', or false - nodeClick: 'rootToNode', - renderLabelForZeroData: false, - label: { - // could be: 'radial', 'tangential', or 'none' - rotate: 'radial', - show: true, - opacity: 1, - // 'left' is for inner side of inside, and 'right' is for outter - // side for inside - align: 'center', - position: 'inside', - distance: 5, - silent: true - }, - itemStyle: { - borderWidth: 1, - borderColor: 'white', - borderType: 'solid', - shadowBlur: 0, - shadowColor: 'rgba(0, 0, 0, 0.2)', - shadowOffsetX: 0, - shadowOffsetY: 0, - opacity: 1 - }, - emphasis: { - focus: 'descendant' - }, - blur: { - itemStyle: { - opacity: 0.2 - }, - label: { - opacity: 0.1 - } - }, - // Animation type canbe expansion, scale - animationType: 'expansion', - animationDuration: 1000, - animationDurationUpdate: 500, - data: [], + SunburstSeriesModel.type = 'series.sunburst'; + SunburstSeriesModel.defaultOption = { + // zlevel: 0, + z: 2, + // 默认全局居中 + center: ['50%', '50%'], + radius: [0, '75%'], + // 默认顺时针 + clockwise: true, + startAngle: 90, + // 最小角度改为0 + minAngle: 0, + // If still show when all data zero. + stillShowZeroSum: true, + // 'rootToNode', 'link', or false + nodeClick: 'rootToNode', + renderLabelForZeroData: false, + label: { + // could be: 'radial', 'tangential', or 'none' + rotate: 'radial', + show: true, + opacity: 1, + // 'left' is for inner side of inside, and 'right' is for outter + // side for inside + align: 'center', + position: 'inside', + distance: 5, + silent: true + }, + itemStyle: { + borderWidth: 1, + borderColor: 'white', + borderType: 'solid', + shadowBlur: 0, + shadowColor: 'rgba(0, 0, 0, 0.2)', + shadowOffsetX: 0, + shadowOffsetY: 0, + opacity: 1 + }, + emphasis: { + focus: 'descendant' + }, + blur: { + itemStyle: { + opacity: 0.2 + }, + label: { + opacity: 0.1 + } + }, + // Animation type canbe expansion, scale + animationType: 'expansion', + animationDuration: 1000, + animationDurationUpdate: 500, + data: [], - /** - * Sort order. - * - * Valid values: 'desc', 'asc', null, or callback function. - * 'desc' and 'asc' for descend and ascendant order; - * null for not sorting; - * example of callback function: - * function(nodeA, nodeB) { - * return nodeA.getValue() - nodeB.getValue(); - * } - */ - sort: 'desc' - }; - return SunburstSeriesModel; - }(SeriesModel); + /** + * Sort order. + * + * Valid values: 'desc', 'asc', null, or callback function. + * 'desc' and 'asc' for descend and ascendant order; + * null for not sorting; + * example of callback function: + * function(nodeA, nodeB) { + * return nodeA.getValue() - nodeB.getValue(); + * } + */ + sort: 'desc' + }; + return SunburstSeriesModel; + }(SeriesModel); function completeTreeValue$1(dataNode) { - // Postorder travel tree. - // If value of none-leaf node is not set, - // calculate it by suming up the value of all children. - var sum = 0; - each(dataNode.children, function (child) { - completeTreeValue$1(child); - var childValue = child.value; // TODO First value of array must be a number + // Postorder travel tree. + // If value of none-leaf node is not set, + // calculate it by suming up the value of all children. + var sum = 0; + each(dataNode.children, function (child) { + completeTreeValue$1(child); + var childValue = child.value; // TODO First value of array must be a number - isArray(childValue) && (childValue = childValue[0]); - sum += childValue; - }); - var thisValue = dataNode.value; + isArray(childValue) && (childValue = childValue[0]); + sum += childValue; + }); + var thisValue = dataNode.value; - if (isArray(thisValue)) { - thisValue = thisValue[0]; - } + if (isArray(thisValue)) { + thisValue = thisValue[0]; + } - if (thisValue == null || isNaN(thisValue)) { - thisValue = sum; - } // Value should not less than 0. + if (thisValue == null || isNaN(thisValue)) { + thisValue = sum; + } // Value should not less than 0. - if (thisValue < 0) { - thisValue = 0; - } + if (thisValue < 0) { + thisValue = 0; + } - isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue; + isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue; } var RADIAN$2 = Math.PI / 180; function sunburstLayout(seriesType, ecModel, api) { - ecModel.eachSeriesByType(seriesType, function (seriesModel) { - var center = seriesModel.get('center'); - var radius = seriesModel.get('radius'); + ecModel.eachSeriesByType(seriesType, function (seriesModel) { + var center = seriesModel.get('center'); + var radius = seriesModel.get('radius'); - if (!isArray(radius)) { - radius = [0, radius]; - } + if (!isArray(radius)) { + radius = [0, radius]; + } - if (!isArray(center)) { - center = [center, center]; - } + if (!isArray(center)) { + center = [center, center]; + } - var width = api.getWidth(); - var height = api.getHeight(); - var size = Math.min(width, height); - var cx = parsePercent$1(center[0], width); - var cy = parsePercent$1(center[1], height); - var r0 = parsePercent$1(radius[0], size / 2); - var r = parsePercent$1(radius[1], size / 2); - var startAngle = -seriesModel.get('startAngle') * RADIAN$2; - var minAngle = seriesModel.get('minAngle') * RADIAN$2; - var virtualRoot = seriesModel.getData().tree.root; - var treeRoot = seriesModel.getViewRoot(); - var rootDepth = treeRoot.depth; - var sort = seriesModel.get('sort'); + var width = api.getWidth(); + var height = api.getHeight(); + var size = Math.min(width, height); + var cx = parsePercent$1(center[0], width); + var cy = parsePercent$1(center[1], height); + var r0 = parsePercent$1(radius[0], size / 2); + var r = parsePercent$1(radius[1], size / 2); + var startAngle = -seriesModel.get('startAngle') * RADIAN$2; + var minAngle = seriesModel.get('minAngle') * RADIAN$2; + var virtualRoot = seriesModel.getData().tree.root; + var treeRoot = seriesModel.getViewRoot(); + var rootDepth = treeRoot.depth; + var sort = seriesModel.get('sort'); - if (sort != null) { - initChildren$1(treeRoot, sort); - } + if (sort != null) { + initChildren$1(treeRoot, sort); + } - var validDataCount = 0; - each(treeRoot.children, function (child) { - !isNaN(child.getValue()) && validDataCount++; - }); - var sum = treeRoot.getValue(); // Sum may be 0 - - var unitRadian = Math.PI / (sum || validDataCount) * 2; - var renderRollupNode = treeRoot.depth > 0; - var levels = treeRoot.height - (renderRollupNode ? -1 : 1); - var rPerLevel = (r - r0) / (levels || 1); - var clockwise = seriesModel.get('clockwise'); - var stillShowZeroSum = seriesModel.get('stillShowZeroSum'); // In the case some sector angle is smaller than minAngle - // let restAngle = PI2; - // let valueSumLargerThanMinAngle = 0; - - var dir = clockwise ? 1 : -1; - /** - * Render a tree - * @return increased angle - */ + var validDataCount = 0; + each(treeRoot.children, function (child) { + !isNaN(child.getValue()) && validDataCount++; + }); + var sum = treeRoot.getValue(); // Sum may be 0 + + var unitRadian = Math.PI / (sum || validDataCount) * 2; + var renderRollupNode = treeRoot.depth > 0; + var levels = treeRoot.height - (renderRollupNode ? -1 : 1); + var rPerLevel = (r - r0) / (levels || 1); + var clockwise = seriesModel.get('clockwise'); + var stillShowZeroSum = seriesModel.get('stillShowZeroSum'); // In the case some sector angle is smaller than minAngle + // let restAngle = PI2; + // let valueSumLargerThanMinAngle = 0; + + var dir = clockwise ? 1 : -1; + /** + * Render a tree + * @return increased angle + */ - var renderNode = function (node, startAngle) { - if (!node) { - return; - } + var renderNode = function (node, startAngle) { + if (!node) { + return; + } - var endAngle = startAngle; // Render self + var endAngle = startAngle; // Render self - if (node !== virtualRoot) { - // Tree node is virtual, so it doesn't need to be drawn - var value = node.getValue(); - var angle = sum === 0 && stillShowZeroSum ? unitRadian : value * unitRadian; + if (node !== virtualRoot) { + // Tree node is virtual, so it doesn't need to be drawn + var value = node.getValue(); + var angle = sum === 0 && stillShowZeroSum ? unitRadian : value * unitRadian; - if (angle < minAngle) { - angle = minAngle; // restAngle -= minAngle; - } // else { - // valueSumLargerThanMinAngle += value; - // } + if (angle < minAngle) { + angle = minAngle; // restAngle -= minAngle; + } // else { + // valueSumLargerThanMinAngle += value; + // } - endAngle = startAngle + dir * angle; - var depth = node.depth - rootDepth - (renderRollupNode ? -1 : 1); - var rStart = r0 + rPerLevel * depth; - var rEnd = r0 + rPerLevel * (depth + 1); - var levelModel = seriesModel.getLevelModel(node); + endAngle = startAngle + dir * angle; + var depth = node.depth - rootDepth - (renderRollupNode ? -1 : 1); + var rStart = r0 + rPerLevel * depth; + var rEnd = r0 + rPerLevel * (depth + 1); + var levelModel = seriesModel.getLevelModel(node); - if (levelModel) { - var r0_1 = levelModel.get('r0', true); - var r_1 = levelModel.get('r', true); - var radius_1 = levelModel.get('radius', true); + if (levelModel) { + var r0_1 = levelModel.get('r0', true); + var r_1 = levelModel.get('r', true); + var radius_1 = levelModel.get('radius', true); - if (radius_1 != null) { - r0_1 = radius_1[0]; - r_1 = radius_1[1]; - } + if (radius_1 != null) { + r0_1 = radius_1[0]; + r_1 = radius_1[1]; + } - r0_1 != null && (rStart = parsePercent$1(r0_1, size / 2)); - r_1 != null && (rEnd = parsePercent$1(r_1, size / 2)); - } + r0_1 != null && (rStart = parsePercent$1(r0_1, size / 2)); + r_1 != null && (rEnd = parsePercent$1(r_1, size / 2)); + } - node.setLayout({ - angle: angle, - startAngle: startAngle, - endAngle: endAngle, - clockwise: clockwise, - cx: cx, - cy: cy, - r0: rStart, - r: rEnd - }); - } // Render children + node.setLayout({ + angle: angle, + startAngle: startAngle, + endAngle: endAngle, + clockwise: clockwise, + cx: cx, + cy: cy, + r0: rStart, + r: rEnd + }); + } // Render children - if (node.children && node.children.length) { - // currentAngle = startAngle; - var siblingAngle_1 = 0; - each(node.children, function (node) { - siblingAngle_1 += renderNode(node, startAngle + siblingAngle_1); - }); - } + if (node.children && node.children.length) { + // currentAngle = startAngle; + var siblingAngle_1 = 0; + each(node.children, function (node) { + siblingAngle_1 += renderNode(node, startAngle + siblingAngle_1); + }); + } - return endAngle - startAngle; - }; // Virtual root node for roll up + return endAngle - startAngle; + }; // Virtual root node for roll up - if (renderRollupNode) { - var rStart = r0; - var rEnd = r0 + rPerLevel; - var angle = Math.PI * 2; - virtualRoot.setLayout({ - angle: angle, - startAngle: startAngle, - endAngle: startAngle + angle, - clockwise: clockwise, - cx: cx, - cy: cy, - r0: rStart, - r: rEnd - }); - } + if (renderRollupNode) { + var rStart = r0; + var rEnd = r0 + rPerLevel; + var angle = Math.PI * 2; + virtualRoot.setLayout({ + angle: angle, + startAngle: startAngle, + endAngle: startAngle + angle, + clockwise: clockwise, + cx: cx, + cy: cy, + r0: rStart, + r: rEnd + }); + } - renderNode(treeRoot, startAngle); - }); + renderNode(treeRoot, startAngle); + }); } /** * Init node children by order and update visual */ function initChildren$1(node, sortOrder) { - var children = node.children || []; - node.children = sort$2(children, sortOrder); // Init children recursively + var children = node.children || []; + node.children = sort$2(children, sortOrder); // Init children recursively - if (children.length) { - each(node.children, function (child) { - initChildren$1(child, sortOrder); - }); - } + if (children.length) { + each(node.children, function (child) { + initChildren$1(child, sortOrder); + }); + } } /** * Sort children nodes @@ -71695,290 +71695,290 @@ function sort$2(children, sortOrder) { - if (isFunction(sortOrder)) { - var sortTargets = map(children, function (child, idx) { - var value = child.getValue(); - return { - params: { - depth: child.depth, - height: child.height, - dataIndex: child.dataIndex, - getValue: function () { - return value; - } - }, - index: idx - }; - }); - sortTargets.sort(function (a, b) { - return sortOrder(a.params, b.params); - }); - return map(sortTargets, function (target) { - return children[target.index]; - }); - } else { - var isAsc_1 = sortOrder === 'asc'; - return children.sort(function (a, b) { - var diff = (a.getValue() - b.getValue()) * (isAsc_1 ? 1 : -1); - return diff === 0 ? (a.dataIndex - b.dataIndex) * (isAsc_1 ? -1 : 1) : diff; - }); - } + if (isFunction(sortOrder)) { + var sortTargets = map(children, function (child, idx) { + var value = child.getValue(); + return { + params: { + depth: child.depth, + height: child.height, + dataIndex: child.dataIndex, + getValue: function () { + return value; + } + }, + index: idx + }; + }); + sortTargets.sort(function (a, b) { + return sortOrder(a.params, b.params); + }); + return map(sortTargets, function (target) { + return children[target.index]; + }); + } else { + var isAsc_1 = sortOrder === 'asc'; + return children.sort(function (a, b) { + var diff = (a.getValue() - b.getValue()) * (isAsc_1 ? 1 : -1); + return diff === 0 ? (a.dataIndex - b.dataIndex) * (isAsc_1 ? -1 : 1) : diff; + }); + } } function sunburstVisual(ecModel) { - var paletteScope = {}; // Default color strategy + var paletteScope = {}; // Default color strategy - function pickColor(node, seriesModel, treeHeight) { - // Choose color from palette based on the first level. - var current = node; - - while (current && current.depth > 1) { - current = current.parentNode; - } + function pickColor(node, seriesModel, treeHeight) { + // Choose color from palette based on the first level. + var current = node; - var color = seriesModel.getColorFromPalette(current.name || current.dataIndex + '', paletteScope); + while (current && current.depth > 1) { + current = current.parentNode; + } - if (node.depth > 1 && isString(color)) { - // Lighter on the deeper level. - color = lift(color, (node.depth - 1) / (treeHeight - 1) * 0.5); - } + var color = seriesModel.getColorFromPalette(current.name || current.dataIndex + '', paletteScope); - return color; + if (node.depth > 1 && isString(color)) { + // Lighter on the deeper level. + color = lift(color, (node.depth - 1) / (treeHeight - 1) * 0.5); } - ecModel.eachSeriesByType('sunburst', function (seriesModel) { - var data = seriesModel.getData(); - var tree = data.tree; - tree.eachNode(function (node) { - var model = node.getModel(); - var style = model.getModel('itemStyle').getItemStyle(); + return color; + } - if (!style.fill) { - style.fill = pickColor(node, seriesModel, tree.root.height); - } + ecModel.eachSeriesByType('sunburst', function (seriesModel) { + var data = seriesModel.getData(); + var tree = data.tree; + tree.eachNode(function (node) { + var model = node.getModel(); + var style = model.getModel('itemStyle').getItemStyle(); - var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style'); - extend(existsStyle, style); - }); + if (!style.fill) { + style.fill = pickColor(node, seriesModel, tree.root.height); + } + + var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style'); + extend(existsStyle, style); }); + }); } function install$q(registers) { - registers.registerChartView(SunburstView); - registers.registerSeriesModel(SunburstSeriesModel); - registers.registerLayout(curry(sunburstLayout, 'sunburst')); - registers.registerProcessor(curry(dataFilter, 'sunburst')); - registers.registerVisual(sunburstVisual); - installSunburstAction(registers); + registers.registerChartView(SunburstView); + registers.registerSeriesModel(SunburstSeriesModel); + registers.registerLayout(curry(sunburstLayout, 'sunburst')); + registers.registerProcessor(curry(dataFilter, 'sunburst')); + registers.registerVisual(sunburstVisual); + installSunburstAction(registers); } // `visual('color') visual('borderColor')` is supported. var STYLE_VISUAL_TYPE = { - color: 'fill', - borderColor: 'stroke' + color: 'fill', + borderColor: 'stroke' }; var NON_STYLE_VISUAL_PROPS = { - symbol: 1, - symbolSize: 1, - symbolKeepAspect: 1, - legendIcon: 1, - visualMeta: 1, - liftZ: 1, - decal: 1 + symbol: 1, + symbolSize: 1, + symbolKeepAspect: 1, + legendIcon: 1, + visualMeta: 1, + liftZ: 1, + decal: 1 }; var customInnerStore = makeInner(); var CustomSeriesModel = - /** @class */ - function (_super) { - __extends(CustomSeriesModel, _super); + /** @class */ + function (_super) { + __extends(CustomSeriesModel, _super); - function CustomSeriesModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function CustomSeriesModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = CustomSeriesModel.type; - return _this; - } - - CustomSeriesModel.prototype.optionUpdated = function () { - this.currentZLevel = this.get('zlevel', true); - this.currentZ = this.get('z', true); - }; + _this.type = CustomSeriesModel.type; + return _this; + } - CustomSeriesModel.prototype.getInitialData = function (option, ecModel) { - return createSeriesData(null, this); - }; + CustomSeriesModel.prototype.optionUpdated = function () { + this.currentZLevel = this.get('zlevel', true); + this.currentZ = this.get('z', true); + }; - CustomSeriesModel.prototype.getDataParams = function (dataIndex, dataType, el) { - var params = _super.prototype.getDataParams.call(this, dataIndex, dataType); + CustomSeriesModel.prototype.getInitialData = function (option, ecModel) { + return createSeriesData(null, this); + }; - el && (params.info = customInnerStore(el).info); - return params; - }; + CustomSeriesModel.prototype.getDataParams = function (dataIndex, dataType, el) { + var params = _super.prototype.getDataParams.call(this, dataIndex, dataType); - CustomSeriesModel.type = 'series.custom'; - CustomSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar']; - CustomSeriesModel.defaultOption = { - coordinateSystem: 'cartesian2d', - // zlevel: 0, - z: 2, - legendHoverLink: true, - // Custom series will not clip by default. - // Some case will use custom series to draw label - // For example https://echarts.apache.org/examples/en/editor.html?c=custom-gantt-flight - clip: false // Cartesian coordinate system - // xAxisIndex: 0, - // yAxisIndex: 0, - // Polar coordinate system - // polarIndex: 0, - // Geo coordinate system - // geoIndex: 0, + el && (params.info = customInnerStore(el).info); + return params; + }; - }; - return CustomSeriesModel; - }(SeriesModel); + CustomSeriesModel.type = 'series.custom'; + CustomSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar']; + CustomSeriesModel.defaultOption = { + coordinateSystem: 'cartesian2d', + // zlevel: 0, + z: 2, + legendHoverLink: true, + // Custom series will not clip by default. + // Some case will use custom series to draw label + // For example https://echarts.apache.org/examples/en/editor.html?c=custom-gantt-flight + clip: false // Cartesian coordinate system + // xAxisIndex: 0, + // yAxisIndex: 0, + // Polar coordinate system + // polarIndex: 0, + // Geo coordinate system + // geoIndex: 0, + + }; + return CustomSeriesModel; + }(SeriesModel); function dataToCoordSize(dataSize, dataItem) { - // dataItem is necessary in log axis. - dataItem = dataItem || [0, 0]; - return map(['x', 'y'], function (dim, dimIdx) { - var axis = this.getAxis(dim); - var val = dataItem[dimIdx]; - var halfSize = dataSize[dimIdx] / 2; - return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize)); - }, this); + // dataItem is necessary in log axis. + dataItem = dataItem || [0, 0]; + return map(['x', 'y'], function (dim, dimIdx) { + var axis = this.getAxis(dim); + var val = dataItem[dimIdx]; + var halfSize = dataSize[dimIdx] / 2; + return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize)); + }, this); } - function cartesianPrepareCustom(coordSys) { - var rect = coordSys.master.getRect(); - return { - coordSys: { - // The name exposed to user is always 'cartesian2d' but not 'grid'. - type: 'cartesian2d', - x: rect.x, - y: rect.y, - width: rect.width, - height: rect.height - }, - api: { - coord: function (data) { - // do not provide "out" param - return coordSys.dataToPoint(data); - }, - size: bind(dataToCoordSize, coordSys) - } - }; + function cartesianPrepareCustom(coordSys) { + var rect = coordSys.master.getRect(); + return { + coordSys: { + // The name exposed to user is always 'cartesian2d' but not 'grid'. + type: 'cartesian2d', + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height + }, + api: { + coord: function (data) { + // do not provide "out" param + return coordSys.dataToPoint(data); + }, + size: bind(dataToCoordSize, coordSys) + } + }; } function dataToCoordSize$1(dataSize, dataItem) { - dataItem = dataItem || [0, 0]; - return map([0, 1], function (dimIdx) { - var val = dataItem[dimIdx]; - var halfSize = dataSize[dimIdx] / 2; - var p1 = []; - var p2 = []; - p1[dimIdx] = val - halfSize; - p2[dimIdx] = val + halfSize; - p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx]; - return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]); - }, this); + dataItem = dataItem || [0, 0]; + return map([0, 1], function (dimIdx) { + var val = dataItem[dimIdx]; + var halfSize = dataSize[dimIdx] / 2; + var p1 = []; + var p2 = []; + p1[dimIdx] = val - halfSize; + p2[dimIdx] = val + halfSize; + p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx]; + return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]); + }, this); } function geoPrepareCustom(coordSys) { - var rect = coordSys.getBoundingRect(); - return { - coordSys: { - type: 'geo', - x: rect.x, - y: rect.y, - width: rect.width, - height: rect.height, - zoom: coordSys.getZoom() - }, - api: { - coord: function (data) { - // do not provide "out" and noRoam param, - // Compatible with this usage: - // echarts.util.map(item.points, api.coord) - return coordSys.dataToPoint(data); - }, - size: bind(dataToCoordSize$1, coordSys) - } - }; + var rect = coordSys.getBoundingRect(); + return { + coordSys: { + type: 'geo', + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height, + zoom: coordSys.getZoom() + }, + api: { + coord: function (data) { + // do not provide "out" and noRoam param, + // Compatible with this usage: + // echarts.util.map(item.points, api.coord) + return coordSys.dataToPoint(data); + }, + size: bind(dataToCoordSize$1, coordSys) + } + }; } function dataToCoordSize$2(dataSize, dataItem) { - // dataItem is necessary in log axis. - var axis = this.getAxis(); - var val = dataItem instanceof Array ? dataItem[0] : dataItem; - var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2; - return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize)); + // dataItem is necessary in log axis. + var axis = this.getAxis(); + var val = dataItem instanceof Array ? dataItem[0] : dataItem; + var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2; + return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize)); } function singlePrepareCustom(coordSys) { - var rect = coordSys.getRect(); - return { - coordSys: { - type: 'singleAxis', - x: rect.x, - y: rect.y, - width: rect.width, - height: rect.height - }, - api: { - coord: function (val) { - // do not provide "out" param - return coordSys.dataToPoint(val); - }, - size: bind(dataToCoordSize$2, coordSys) - } - }; + var rect = coordSys.getRect(); + return { + coordSys: { + type: 'singleAxis', + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height + }, + api: { + coord: function (val) { + // do not provide "out" param + return coordSys.dataToPoint(val); + }, + size: bind(dataToCoordSize$2, coordSys) + } + }; } function dataToCoordSize$3(dataSize, dataItem) { - // dataItem is necessary in log axis. - dataItem = dataItem || [0, 0]; - return map(['Radius', 'Angle'], function (dim, dimIdx) { - var getterName = 'get' + dim + 'Axis'; // TODO: TYPE Check Angle Axis + // dataItem is necessary in log axis. + dataItem = dataItem || [0, 0]; + return map(['Radius', 'Angle'], function (dim, dimIdx) { + var getterName = 'get' + dim + 'Axis'; // TODO: TYPE Check Angle Axis - var axis = this[getterName](); - var val = dataItem[dimIdx]; - var halfSize = dataSize[dimIdx] / 2; - var result = axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize)); + var axis = this[getterName](); + var val = dataItem[dimIdx]; + var halfSize = dataSize[dimIdx] / 2; + var result = axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize)); - if (dim === 'Angle') { - result = result * Math.PI / 180; - } + if (dim === 'Angle') { + result = result * Math.PI / 180; + } - return result; - }, this); + return result; + }, this); } function polarPrepareCustom(coordSys) { - var radiusAxis = coordSys.getRadiusAxis(); - var angleAxis = coordSys.getAngleAxis(); - var radius = radiusAxis.getExtent(); - radius[0] > radius[1] && radius.reverse(); - return { - coordSys: { - type: 'polar', - cx: coordSys.cx, - cy: coordSys.cy, - r: radius[1], - r0: radius[0] - }, - api: { - coord: function (data) { - var radius = radiusAxis.dataToRadius(data[0]); - var angle = angleAxis.dataToAngle(data[1]); - var coord = coordSys.coordToPoint([radius, angle]); - coord.push(radius, angle * Math.PI / 180); - return coord; - }, - size: bind(dataToCoordSize$3, coordSys) - } - }; + var radiusAxis = coordSys.getRadiusAxis(); + var angleAxis = coordSys.getAngleAxis(); + var radius = radiusAxis.getExtent(); + radius[0] > radius[1] && radius.reverse(); + return { + coordSys: { + type: 'polar', + cx: coordSys.cx, + cy: coordSys.cy, + r: radius[1], + r0: radius[0] + }, + api: { + coord: function (data) { + var radius = radiusAxis.dataToRadius(data[0]); + var angle = angleAxis.dataToAngle(data[1]); + var coord = coordSys.coordToPoint([radius, angle]); + coord.push(radius, angle * Math.PI / 180); + return coord; + }, + size: bind(dataToCoordSize$3, coordSys) + } + }; } /* @@ -72024,30 +72024,30 @@ * under the License. */ function calendarPrepareCustom(coordSys) { - var rect = coordSys.getRect(); - var rangeInfo = coordSys.getRangeInfo(); - return { - coordSys: { - type: 'calendar', - x: rect.x, - y: rect.y, - width: rect.width, - height: rect.height, - cellWidth: coordSys.getCellWidth(), - cellHeight: coordSys.getCellHeight(), - rangeInfo: { - start: rangeInfo.start, - end: rangeInfo.end, - weeks: rangeInfo.weeks, - dayCount: rangeInfo.allDay - } - }, - api: { - coord: function (data, clamp) { - return coordSys.dataToPoint(data, clamp); - } - } - }; + var rect = coordSys.getRect(); + var rangeInfo = coordSys.getRangeInfo(); + return { + coordSys: { + type: 'calendar', + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height, + cellWidth: coordSys.getCellWidth(), + cellHeight: coordSys.getCellHeight(), + rangeInfo: { + start: rangeInfo.start, + end: rangeInfo.end, + weeks: rangeInfo.weeks, + dayCount: rangeInfo.allDay + } + }, + api: { + coord: function (data, clamp) { + return coordSys.dataToPoint(data, clamp); + } + } + }; } var deprecatedLogs = {}; @@ -72056,17 +72056,17 @@ */ function isEC4CompatibleStyle(style, elType, hasOwnTextContentOption, hasOwnTextConfig) { - // Since echarts5, `RectText` is separated from its host element and style.text - // does not exist any more. The compat work brings some extra burden on performance. - // So we provide: - // `legacy: true` force make compat. - // `legacy: false`, force do not compat. - // `legacy` not set: auto detect wheter legacy. - // But in this case we do not compat (difficult to detect and rare case): - // Becuse custom series and graphic component support "merge", users may firstly - // only set `textStrokeWidth` style or secondly only set `text`. - return style && (style.legacy || style.legacy !== false && !hasOwnTextContentOption && !hasOwnTextConfig && elType !== 'tspan' // Difficult to detect whether legacy for a "text" el. - && (elType === 'text' || hasOwn(style, 'text'))); + // Since echarts5, `RectText` is separated from its host element and style.text + // does not exist any more. The compat work brings some extra burden on performance. + // So we provide: + // `legacy: true` force make compat. + // `legacy: false`, force do not compat. + // `legacy` not set: auto detect wheter legacy. + // But in this case we do not compat (difficult to detect and rare case): + // Becuse custom series and graphic component support "merge", users may firstly + // only set `textStrokeWidth` style or secondly only set `text`. + return style && (style.legacy || style.legacy !== false && !hasOwnTextContentOption && !hasOwnTextConfig && elType !== 'tspan' // Difficult to detect whether legacy for a "text" el. + && (elType === 'text' || hasOwn(style, 'text'))); } /** * `EC4CompatibleStyle` is style that might be in echarts4 format or echarts5 format. @@ -72077,88 +72077,88 @@ */ function convertFromEC4CompatibleStyle(hostStyle, elType, isNormal) { - var srcStyle = hostStyle; - var textConfig; - var textContent; - var textContentStyle; - - if (elType === 'text') { - textContentStyle = srcStyle; + var srcStyle = hostStyle; + var textConfig; + var textContent; + var textContentStyle; + + if (elType === 'text') { + textContentStyle = srcStyle; + } else { + textContentStyle = {}; + hasOwn(srcStyle, 'text') && (textContentStyle.text = srcStyle.text); + hasOwn(srcStyle, 'rich') && (textContentStyle.rich = srcStyle.rich); + hasOwn(srcStyle, 'textFill') && (textContentStyle.fill = srcStyle.textFill); + hasOwn(srcStyle, 'textStroke') && (textContentStyle.stroke = srcStyle.textStroke); + hasOwn(srcStyle, 'fontFamily') && (textContentStyle.fontFamily = srcStyle.fontFamily); + hasOwn(srcStyle, 'fontSize') && (textContentStyle.fontSize = srcStyle.fontSize); + hasOwn(srcStyle, 'fontStyle') && (textContentStyle.fontStyle = srcStyle.fontStyle); + hasOwn(srcStyle, 'fontWeight') && (textContentStyle.fontWeight = srcStyle.fontWeight); + textContent = { + type: 'text', + style: textContentStyle, + // ec4 do not support rectText trigger. + // And when text postion is different in normal and emphasis + // => hover text trigger emphasis; + // => text position changed, leave mouse pointer immediately; + // That might cause state incorrect. + silent: true + }; + textConfig = {}; + var hasOwnPos = hasOwn(srcStyle, 'textPosition'); + + if (isNormal) { + textConfig.position = hasOwnPos ? srcStyle.textPosition : 'inside'; } else { - textContentStyle = {}; - hasOwn(srcStyle, 'text') && (textContentStyle.text = srcStyle.text); - hasOwn(srcStyle, 'rich') && (textContentStyle.rich = srcStyle.rich); - hasOwn(srcStyle, 'textFill') && (textContentStyle.fill = srcStyle.textFill); - hasOwn(srcStyle, 'textStroke') && (textContentStyle.stroke = srcStyle.textStroke); - hasOwn(srcStyle, 'fontFamily') && (textContentStyle.fontFamily = srcStyle.fontFamily); - hasOwn(srcStyle, 'fontSize') && (textContentStyle.fontSize = srcStyle.fontSize); - hasOwn(srcStyle, 'fontStyle') && (textContentStyle.fontStyle = srcStyle.fontStyle); - hasOwn(srcStyle, 'fontWeight') && (textContentStyle.fontWeight = srcStyle.fontWeight); - textContent = { - type: 'text', - style: textContentStyle, - // ec4 do not support rectText trigger. - // And when text postion is different in normal and emphasis - // => hover text trigger emphasis; - // => text position changed, leave mouse pointer immediately; - // That might cause state incorrect. - silent: true - }; - textConfig = {}; - var hasOwnPos = hasOwn(srcStyle, 'textPosition'); - - if (isNormal) { - textConfig.position = hasOwnPos ? srcStyle.textPosition : 'inside'; - } else { - hasOwnPos && (textConfig.position = srcStyle.textPosition); - } - - hasOwn(srcStyle, 'textPosition') && (textConfig.position = srcStyle.textPosition); - hasOwn(srcStyle, 'textOffset') && (textConfig.offset = srcStyle.textOffset); - hasOwn(srcStyle, 'textRotation') && (textConfig.rotation = srcStyle.textRotation); - hasOwn(srcStyle, 'textDistance') && (textConfig.distance = srcStyle.textDistance); + hasOwnPos && (textConfig.position = srcStyle.textPosition); } - convertEC4CompatibleRichItem(textContentStyle, hostStyle); - each(textContentStyle.rich, function (richItem) { - convertEC4CompatibleRichItem(richItem, richItem); - }); - return { - textConfig: textConfig, - textContent: textContent - }; + hasOwn(srcStyle, 'textPosition') && (textConfig.position = srcStyle.textPosition); + hasOwn(srcStyle, 'textOffset') && (textConfig.offset = srcStyle.textOffset); + hasOwn(srcStyle, 'textRotation') && (textConfig.rotation = srcStyle.textRotation); + hasOwn(srcStyle, 'textDistance') && (textConfig.distance = srcStyle.textDistance); + } + + convertEC4CompatibleRichItem(textContentStyle, hostStyle); + each(textContentStyle.rich, function (richItem) { + convertEC4CompatibleRichItem(richItem, richItem); + }); + return { + textConfig: textConfig, + textContent: textContent + }; } /** * The result will be set to `out`. */ function convertEC4CompatibleRichItem(out, richItem) { - if (!richItem) { - return; - } // (1) For simplicity, make textXXX properties (deprecated since ec5) has - // higher priority. For example, consider in ec4 `borderColor: 5, textBorderColor: 10` - // on a rect means `borderColor: 4` on the rect and `borderColor: 10` on an attached - // richText in ec5. - // (2) `out === richItem` if and only if `out` is text el or rich item. - // So we can overwite existing props in `out` since textXXX has higher priority. - - - richItem.font = richItem.textFont || richItem.font; - hasOwn(richItem, 'textStrokeWidth') && (out.lineWidth = richItem.textStrokeWidth); - hasOwn(richItem, 'textAlign') && (out.align = richItem.textAlign); - hasOwn(richItem, 'textVerticalAlign') && (out.verticalAlign = richItem.textVerticalAlign); - hasOwn(richItem, 'textLineHeight') && (out.lineHeight = richItem.textLineHeight); - hasOwn(richItem, 'textWidth') && (out.width = richItem.textWidth); - hasOwn(richItem, 'textHeight') && (out.height = richItem.textHeight); - hasOwn(richItem, 'textBackgroundColor') && (out.backgroundColor = richItem.textBackgroundColor); - hasOwn(richItem, 'textPadding') && (out.padding = richItem.textPadding); - hasOwn(richItem, 'textBorderColor') && (out.borderColor = richItem.textBorderColor); - hasOwn(richItem, 'textBorderWidth') && (out.borderWidth = richItem.textBorderWidth); - hasOwn(richItem, 'textBorderRadius') && (out.borderRadius = richItem.textBorderRadius); - hasOwn(richItem, 'textBoxShadowColor') && (out.shadowColor = richItem.textBoxShadowColor); - hasOwn(richItem, 'textBoxShadowBlur') && (out.shadowBlur = richItem.textBoxShadowBlur); - hasOwn(richItem, 'textBoxShadowOffsetX') && (out.shadowOffsetX = richItem.textBoxShadowOffsetX); - hasOwn(richItem, 'textBoxShadowOffsetY') && (out.shadowOffsetY = richItem.textBoxShadowOffsetY); + if (!richItem) { + return; + } // (1) For simplicity, make textXXX properties (deprecated since ec5) has + // higher priority. For example, consider in ec4 `borderColor: 5, textBorderColor: 10` + // on a rect means `borderColor: 4` on the rect and `borderColor: 10` on an attached + // richText in ec5. + // (2) `out === richItem` if and only if `out` is text el or rich item. + // So we can overwite existing props in `out` since textXXX has higher priority. + + + richItem.font = richItem.textFont || richItem.font; + hasOwn(richItem, 'textStrokeWidth') && (out.lineWidth = richItem.textStrokeWidth); + hasOwn(richItem, 'textAlign') && (out.align = richItem.textAlign); + hasOwn(richItem, 'textVerticalAlign') && (out.verticalAlign = richItem.textVerticalAlign); + hasOwn(richItem, 'textLineHeight') && (out.lineHeight = richItem.textLineHeight); + hasOwn(richItem, 'textWidth') && (out.width = richItem.textWidth); + hasOwn(richItem, 'textHeight') && (out.height = richItem.textHeight); + hasOwn(richItem, 'textBackgroundColor') && (out.backgroundColor = richItem.textBackgroundColor); + hasOwn(richItem, 'textPadding') && (out.padding = richItem.textPadding); + hasOwn(richItem, 'textBorderColor') && (out.borderColor = richItem.textBorderColor); + hasOwn(richItem, 'textBorderWidth') && (out.borderWidth = richItem.textBorderWidth); + hasOwn(richItem, 'textBorderRadius') && (out.borderRadius = richItem.textBorderRadius); + hasOwn(richItem, 'textBoxShadowColor') && (out.shadowColor = richItem.textBoxShadowColor); + hasOwn(richItem, 'textBoxShadowBlur') && (out.shadowBlur = richItem.textBoxShadowBlur); + hasOwn(richItem, 'textBoxShadowOffsetX') && (out.shadowOffsetX = richItem.textBoxShadowOffsetX); + hasOwn(richItem, 'textBoxShadowOffsetY') && (out.shadowOffsetY = richItem.textBoxShadowOffsetY); } /** * Convert to pure echarts4 format style. @@ -72171,93 +72171,93 @@ function convertToEC4StyleForCustomSerise(itemStl, txStl, txCfg) { - var out = itemStl; // See `custom.ts`, a trick to set extra `textPosition` firstly. - - out.textPosition = out.textPosition || txCfg.position || 'inside'; - txCfg.offset != null && (out.textOffset = txCfg.offset); - txCfg.rotation != null && (out.textRotation = txCfg.rotation); - txCfg.distance != null && (out.textDistance = txCfg.distance); - var isInside = out.textPosition.indexOf('inside') >= 0; - var hostFill = itemStl.fill || '#000'; - convertToEC4RichItem(out, txStl); - var textFillNotSet = out.textFill == null; - - if (isInside) { - if (textFillNotSet) { - out.textFill = txCfg.insideFill || '#fff'; - !out.textStroke && txCfg.insideStroke && (out.textStroke = txCfg.insideStroke); - !out.textStroke && (out.textStroke = hostFill); - out.textStrokeWidth == null && (out.textStrokeWidth = 2); - } - } else { - if (textFillNotSet) { - out.textFill = itemStl.fill || txCfg.outsideFill || '#000'; - } + var out = itemStl; // See `custom.ts`, a trick to set extra `textPosition` firstly. + + out.textPosition = out.textPosition || txCfg.position || 'inside'; + txCfg.offset != null && (out.textOffset = txCfg.offset); + txCfg.rotation != null && (out.textRotation = txCfg.rotation); + txCfg.distance != null && (out.textDistance = txCfg.distance); + var isInside = out.textPosition.indexOf('inside') >= 0; + var hostFill = itemStl.fill || '#000'; + convertToEC4RichItem(out, txStl); + var textFillNotSet = out.textFill == null; - !out.textStroke && txCfg.outsideStroke && (out.textStroke = txCfg.outsideStroke); + if (isInside) { + if (textFillNotSet) { + out.textFill = txCfg.insideFill || '#fff'; + !out.textStroke && txCfg.insideStroke && (out.textStroke = txCfg.insideStroke); + !out.textStroke && (out.textStroke = hostFill); + out.textStrokeWidth == null && (out.textStrokeWidth = 2); + } + } else { + if (textFillNotSet) { + out.textFill = itemStl.fill || txCfg.outsideFill || '#000'; } - out.text = txStl.text; - out.rich = txStl.rich; - each(txStl.rich, function (richItem) { - convertToEC4RichItem(richItem, richItem); - }); - return out; + !out.textStroke && txCfg.outsideStroke && (out.textStroke = txCfg.outsideStroke); + } + + out.text = txStl.text; + out.rich = txStl.rich; + each(txStl.rich, function (richItem) { + convertToEC4RichItem(richItem, richItem); + }); + return out; } function convertToEC4RichItem(out, richItem) { - if (!richItem) { - return; - } - - hasOwn(richItem, 'fill') && (out.textFill = richItem.fill); - hasOwn(richItem, 'stroke') && (out.textStroke = richItem.fill); - hasOwn(richItem, 'lineWidth') && (out.textStrokeWidth = richItem.lineWidth); - hasOwn(richItem, 'font') && (out.font = richItem.font); - hasOwn(richItem, 'fontStyle') && (out.fontStyle = richItem.fontStyle); - hasOwn(richItem, 'fontWeight') && (out.fontWeight = richItem.fontWeight); - hasOwn(richItem, 'fontSize') && (out.fontSize = richItem.fontSize); - hasOwn(richItem, 'fontFamily') && (out.fontFamily = richItem.fontFamily); - hasOwn(richItem, 'align') && (out.textAlign = richItem.align); - hasOwn(richItem, 'verticalAlign') && (out.textVerticalAlign = richItem.verticalAlign); - hasOwn(richItem, 'lineHeight') && (out.textLineHeight = richItem.lineHeight); - hasOwn(richItem, 'width') && (out.textWidth = richItem.width); - hasOwn(richItem, 'height') && (out.textHeight = richItem.height); - hasOwn(richItem, 'backgroundColor') && (out.textBackgroundColor = richItem.backgroundColor); - hasOwn(richItem, 'padding') && (out.textPadding = richItem.padding); - hasOwn(richItem, 'borderColor') && (out.textBorderColor = richItem.borderColor); - hasOwn(richItem, 'borderWidth') && (out.textBorderWidth = richItem.borderWidth); - hasOwn(richItem, 'borderRadius') && (out.textBorderRadius = richItem.borderRadius); - hasOwn(richItem, 'shadowColor') && (out.textBoxShadowColor = richItem.shadowColor); - hasOwn(richItem, 'shadowBlur') && (out.textBoxShadowBlur = richItem.shadowBlur); - hasOwn(richItem, 'shadowOffsetX') && (out.textBoxShadowOffsetX = richItem.shadowOffsetX); - hasOwn(richItem, 'shadowOffsetY') && (out.textBoxShadowOffsetY = richItem.shadowOffsetY); - hasOwn(richItem, 'textShadowColor') && (out.textShadowColor = richItem.textShadowColor); - hasOwn(richItem, 'textShadowBlur') && (out.textShadowBlur = richItem.textShadowBlur); - hasOwn(richItem, 'textShadowOffsetX') && (out.textShadowOffsetX = richItem.textShadowOffsetX); - hasOwn(richItem, 'textShadowOffsetY') && (out.textShadowOffsetY = richItem.textShadowOffsetY); + if (!richItem) { + return; + } + + hasOwn(richItem, 'fill') && (out.textFill = richItem.fill); + hasOwn(richItem, 'stroke') && (out.textStroke = richItem.fill); + hasOwn(richItem, 'lineWidth') && (out.textStrokeWidth = richItem.lineWidth); + hasOwn(richItem, 'font') && (out.font = richItem.font); + hasOwn(richItem, 'fontStyle') && (out.fontStyle = richItem.fontStyle); + hasOwn(richItem, 'fontWeight') && (out.fontWeight = richItem.fontWeight); + hasOwn(richItem, 'fontSize') && (out.fontSize = richItem.fontSize); + hasOwn(richItem, 'fontFamily') && (out.fontFamily = richItem.fontFamily); + hasOwn(richItem, 'align') && (out.textAlign = richItem.align); + hasOwn(richItem, 'verticalAlign') && (out.textVerticalAlign = richItem.verticalAlign); + hasOwn(richItem, 'lineHeight') && (out.textLineHeight = richItem.lineHeight); + hasOwn(richItem, 'width') && (out.textWidth = richItem.width); + hasOwn(richItem, 'height') && (out.textHeight = richItem.height); + hasOwn(richItem, 'backgroundColor') && (out.textBackgroundColor = richItem.backgroundColor); + hasOwn(richItem, 'padding') && (out.textPadding = richItem.padding); + hasOwn(richItem, 'borderColor') && (out.textBorderColor = richItem.borderColor); + hasOwn(richItem, 'borderWidth') && (out.textBorderWidth = richItem.borderWidth); + hasOwn(richItem, 'borderRadius') && (out.textBorderRadius = richItem.borderRadius); + hasOwn(richItem, 'shadowColor') && (out.textBoxShadowColor = richItem.shadowColor); + hasOwn(richItem, 'shadowBlur') && (out.textBoxShadowBlur = richItem.shadowBlur); + hasOwn(richItem, 'shadowOffsetX') && (out.textBoxShadowOffsetX = richItem.shadowOffsetX); + hasOwn(richItem, 'shadowOffsetY') && (out.textBoxShadowOffsetY = richItem.shadowOffsetY); + hasOwn(richItem, 'textShadowColor') && (out.textShadowColor = richItem.textShadowColor); + hasOwn(richItem, 'textShadowBlur') && (out.textShadowBlur = richItem.textShadowBlur); + hasOwn(richItem, 'textShadowOffsetX') && (out.textShadowOffsetX = richItem.textShadowOffsetX); + hasOwn(richItem, 'textShadowOffsetY') && (out.textShadowOffsetY = richItem.textShadowOffsetY); } function warnDeprecated(deprecated, insteadApproach) { - if ("development" !== 'production') { - var key = deprecated + '^_^' + insteadApproach; + if ("development" !== 'production') { + var key = deprecated + '^_^' + insteadApproach; - if (!deprecatedLogs[key]) { - console.warn("[ECharts] DEPRECATED: \"" + deprecated + "\" has been deprecated. " + insteadApproach); - deprecatedLogs[key] = true; - } + if (!deprecatedLogs[key]) { + console.warn("[ECharts] DEPRECATED: \"" + deprecated + "\" has been deprecated. " + insteadApproach); + deprecatedLogs[key] = true; } + } } var LEGACY_TRANSFORM_PROPS_MAP = { - position: ['x', 'y'], - scale: ['scaleX', 'scaleY'], - origin: ['originX', 'originY'] + position: ['x', 'y'], + scale: ['scaleX', 'scaleY'], + origin: ['originX', 'originY'] }; var LEGACY_TRANSFORM_PROPS = keys(LEGACY_TRANSFORM_PROPS_MAP); var TRANSFORM_PROPS_MAP = reduce(TRANSFORMABLE_PROPS, function (obj, key) { - obj[key] = 1; - return obj; + obj[key] = 1; + return obj; }, {}); var transformPropNamesStr = TRANSFORMABLE_PROPS.join(', '); // '' means root @@ -72265,494 +72265,494 @@ var transitionInnerStore = makeInner(); function getElementAnimationConfig(animationType, el, elOption, parentModel, dataIndex) { - var animationProp = animationType + "Animation"; - var config = getAnimationConfig(animationType, parentModel, dataIndex) || {}; - var userDuring = transitionInnerStore(el).userDuring; // Only set when duration is > 0 and it's need to be animated. - - if (config.duration > 0) { - // For simplicity, if during not specified, the previous during will not work any more. - config.during = userDuring ? bind(duringCall, { - el: el, - userDuring: userDuring - }) : null; - config.setToFinal = true; - config.scope = animationType; - } + var animationProp = animationType + "Animation"; + var config = getAnimationConfig(animationType, parentModel, dataIndex) || {}; + var userDuring = transitionInnerStore(el).userDuring; // Only set when duration is > 0 and it's need to be animated. + + if (config.duration > 0) { + // For simplicity, if during not specified, the previous during will not work any more. + config.during = userDuring ? bind(duringCall, { + el: el, + userDuring: userDuring + }) : null; + config.setToFinal = true; + config.scope = animationType; + } - extend(config, elOption[animationProp]); - return config; + extend(config, elOption[animationProp]); + return config; } function applyUpdateTransition(el, elOption, animatableModel, opts) { - opts = opts || {}; - var dataIndex = opts.dataIndex, - isInit = opts.isInit, - clearStyle = opts.clearStyle; - var hasAnimation = animatableModel.isAnimationEnabled(); // Save the meta info for further morphing. Like apply on the sub morphing elements. - - var store = transitionInnerStore(el); - var styleOpt = elOption.style; - store.userDuring = elOption.during; - var transFromProps = {}; - var propsToSet = {}; - prepareTransformAllPropsFinal(el, elOption, propsToSet); - prepareShapeOrExtraAllPropsFinal('shape', elOption, propsToSet); - prepareShapeOrExtraAllPropsFinal('extra', elOption, propsToSet); - - if (!isInit && hasAnimation) { - prepareTransformTransitionFrom(el, elOption, transFromProps); - prepareShapeOrExtraTransitionFrom('shape', el, elOption, transFromProps); - prepareShapeOrExtraTransitionFrom('extra', el, elOption, transFromProps); - prepareStyleTransitionFrom(el, elOption, styleOpt, transFromProps); - } - - propsToSet.style = styleOpt; - applyPropsDirectly(el, propsToSet, clearStyle); - applyMiscProps(el, elOption); - - if (hasAnimation) { - if (isInit) { - var enterFromProps_1 = {}; - each(ELEMENT_ANIMATABLE_PROPS, function (propName) { - var prop = propName ? elOption[propName] : elOption; - - if (prop && prop.enterFrom) { - if (propName) { - enterFromProps_1[propName] = enterFromProps_1[propName] || {}; - } + opts = opts || {}; + var dataIndex = opts.dataIndex, + isInit = opts.isInit, + clearStyle = opts.clearStyle; + var hasAnimation = animatableModel.isAnimationEnabled(); // Save the meta info for further morphing. Like apply on the sub morphing elements. + + var store = transitionInnerStore(el); + var styleOpt = elOption.style; + store.userDuring = elOption.during; + var transFromProps = {}; + var propsToSet = {}; + prepareTransformAllPropsFinal(el, elOption, propsToSet); + prepareShapeOrExtraAllPropsFinal('shape', elOption, propsToSet); + prepareShapeOrExtraAllPropsFinal('extra', elOption, propsToSet); + + if (!isInit && hasAnimation) { + prepareTransformTransitionFrom(el, elOption, transFromProps); + prepareShapeOrExtraTransitionFrom('shape', el, elOption, transFromProps); + prepareShapeOrExtraTransitionFrom('extra', el, elOption, transFromProps); + prepareStyleTransitionFrom(el, elOption, styleOpt, transFromProps); + } + + propsToSet.style = styleOpt; + applyPropsDirectly(el, propsToSet, clearStyle); + applyMiscProps(el, elOption); + + if (hasAnimation) { + if (isInit) { + var enterFromProps_1 = {}; + each(ELEMENT_ANIMATABLE_PROPS, function (propName) { + var prop = propName ? elOption[propName] : elOption; - extend(propName ? enterFromProps_1[propName] : enterFromProps_1, prop.enterFrom); - } - }); - var config = getElementAnimationConfig('enter', el, elOption, animatableModel, dataIndex); + if (prop && prop.enterFrom) { + if (propName) { + enterFromProps_1[propName] = enterFromProps_1[propName] || {}; + } - if (config.duration > 0) { - el.animateFrom(enterFromProps_1, config); - } - } else { - applyPropsTransition(el, elOption, dataIndex || 0, animatableModel, transFromProps); + extend(propName ? enterFromProps_1[propName] : enterFromProps_1, prop.enterFrom); } - } // Store leave to be used in leave transition. + }); + var config = getElementAnimationConfig('enter', el, elOption, animatableModel, dataIndex); + + if (config.duration > 0) { + el.animateFrom(enterFromProps_1, config); + } + } else { + applyPropsTransition(el, elOption, dataIndex || 0, animatableModel, transFromProps); + } + } // Store leave to be used in leave transition. - updateLeaveTo(el, elOption); - styleOpt ? el.dirty() : el.markRedraw(); + updateLeaveTo(el, elOption); + styleOpt ? el.dirty() : el.markRedraw(); } function updateLeaveTo(el, elOption) { - // Try merge to previous set leaveTo - var leaveToProps = transitionInnerStore(el).leaveToProps; + // Try merge to previous set leaveTo + var leaveToProps = transitionInnerStore(el).leaveToProps; - for (var i = 0; i < ELEMENT_ANIMATABLE_PROPS.length; i++) { - var propName = ELEMENT_ANIMATABLE_PROPS[i]; - var prop = propName ? elOption[propName] : elOption; + for (var i = 0; i < ELEMENT_ANIMATABLE_PROPS.length; i++) { + var propName = ELEMENT_ANIMATABLE_PROPS[i]; + var prop = propName ? elOption[propName] : elOption; - if (prop && prop.leaveTo) { - if (!leaveToProps) { - leaveToProps = transitionInnerStore(el).leaveToProps = {}; - } + if (prop && prop.leaveTo) { + if (!leaveToProps) { + leaveToProps = transitionInnerStore(el).leaveToProps = {}; + } - if (propName) { - leaveToProps[propName] = leaveToProps[propName] || {}; - } + if (propName) { + leaveToProps[propName] = leaveToProps[propName] || {}; + } - extend(propName ? leaveToProps[propName] : leaveToProps, prop.leaveTo); - } + extend(propName ? leaveToProps[propName] : leaveToProps, prop.leaveTo); } + } } function applyLeaveTransition(el, elOption, animatableModel, onRemove) { - if (el) { - var parent_1 = el.parent; - var leaveToProps = transitionInnerStore(el).leaveToProps; + if (el) { + var parent_1 = el.parent; + var leaveToProps = transitionInnerStore(el).leaveToProps; - if (leaveToProps) { - // TODO TODO use leave after leaveAnimation in series is introduced - // TODO Data index? - var config = getElementAnimationConfig('update', el, elOption, animatableModel, 0); + if (leaveToProps) { + // TODO TODO use leave after leaveAnimation in series is introduced + // TODO Data index? + var config = getElementAnimationConfig('update', el, elOption, animatableModel, 0); - config.done = function () { - parent_1.remove(el); - onRemove && onRemove(); - }; + config.done = function () { + parent_1.remove(el); + onRemove && onRemove(); + }; - el.animateTo(leaveToProps, config); - } else { - parent_1.remove(el); - onRemove && onRemove(); - } + el.animateTo(leaveToProps, config); + } else { + parent_1.remove(el); + onRemove && onRemove(); } + } } function isTransitionAll(transition) { - return transition === 'all'; + return transition === 'all'; } function applyPropsDirectly(el, // Can be null/undefined - allPropsFinal, clearStyle) { - var styleOpt = allPropsFinal.style; - - if (!el.isGroup && styleOpt) { - if (clearStyle) { - el.useStyle({}); // When style object changed, how to trade the existing animation? - // It is probably complicated and not needed to cover all the cases. - // But still need consider the case: - // (1) When using init animation on `style.opacity`, and before the animation - // ended users triggers an update by mousewhel. At that time the init - // animation should better be continued rather than terminated. - // So after `useStyle` called, we should change the animation target manually - // to continue the effect of the init animation. - // (2) PENDING: If the previous animation targeted at a `val1`, and currently we need - // to update the value to `val2` and no animation declared, should be terminate - // the previous animation or just modify the target of the animation? - // Therotically That will happen not only on `style` but also on `shape` and - // `transfrom` props. But we haven't handle this case at present yet. - // (3) PENDING: Is it proper to visit `animators` and `targetName`? + allPropsFinal, clearStyle) { + var styleOpt = allPropsFinal.style; - var animators = el.animators; + if (!el.isGroup && styleOpt) { + if (clearStyle) { + el.useStyle({}); // When style object changed, how to trade the existing animation? + // It is probably complicated and not needed to cover all the cases. + // But still need consider the case: + // (1) When using init animation on `style.opacity`, and before the animation + // ended users triggers an update by mousewhel. At that time the init + // animation should better be continued rather than terminated. + // So after `useStyle` called, we should change the animation target manually + // to continue the effect of the init animation. + // (2) PENDING: If the previous animation targeted at a `val1`, and currently we need + // to update the value to `val2` and no animation declared, should be terminate + // the previous animation or just modify the target of the animation? + // Therotically That will happen not only on `style` but also on `shape` and + // `transfrom` props. But we haven't handle this case at present yet. + // (3) PENDING: Is it proper to visit `animators` and `targetName`? - for (var i = 0; i < animators.length; i++) { - var animator = animators[i]; // targetName is the "topKey". + var animators = el.animators; - if (animator.targetName === 'style') { - animator.changeTarget(el.style); - } - } - } + for (var i = 0; i < animators.length; i++) { + var animator = animators[i]; // targetName is the "topKey". - el.setStyle(styleOpt); + if (animator.targetName === 'style') { + animator.changeTarget(el.style); + } + } } - if (allPropsFinal) { - // Not set style here. - allPropsFinal.style = null; // Set el to the final state firstly. + el.setStyle(styleOpt); + } - allPropsFinal && el.attr(allPropsFinal); - allPropsFinal.style = styleOpt; - } + if (allPropsFinal) { + // Not set style here. + allPropsFinal.style = null; // Set el to the final state firstly. + + allPropsFinal && el.attr(allPropsFinal); + allPropsFinal.style = styleOpt; + } } function applyPropsTransition(el, elOption, dataIndex, model, // Can be null/undefined - transFromProps) { - if (transFromProps) { - var config = getElementAnimationConfig('update', el, elOption, model, dataIndex); + transFromProps) { + if (transFromProps) { + var config = getElementAnimationConfig('update', el, elOption, model, dataIndex); - if (config.duration > 0) { - el.animateFrom(transFromProps, config); - } + if (config.duration > 0) { + el.animateFrom(transFromProps, config); } + } } function applyMiscProps(el, elOption) { - // Merge by default. - hasOwn(elOption, 'silent') && (el.silent = elOption.silent); - hasOwn(elOption, 'ignore') && (el.ignore = elOption.ignore); + // Merge by default. + hasOwn(elOption, 'silent') && (el.silent = elOption.silent); + hasOwn(elOption, 'ignore') && (el.ignore = elOption.ignore); - if (el instanceof Displayable) { - hasOwn(elOption, 'invisible') && (el.invisible = elOption.invisible); - } + if (el instanceof Displayable) { + hasOwn(elOption, 'invisible') && (el.invisible = elOption.invisible); + } - if (el instanceof Path) { - hasOwn(elOption, 'autoBatch') && (el.autoBatch = elOption.autoBatch); - } + if (el instanceof Path) { + hasOwn(elOption, 'autoBatch') && (el.autoBatch = elOption.autoBatch); + } } // Use it to avoid it be exposed to user. var tmpDuringScope = {}; var transitionDuringAPI = { - // Usually other props do not need to be changed in animation during. - setTransform: function (key, val) { - if ("development" !== 'production') { - assert(hasOwn(TRANSFORM_PROPS_MAP, key), 'Only ' + transformPropNamesStr + ' available in `setTransform`.'); - } - - tmpDuringScope.el[key] = val; - return this; - }, - getTransform: function (key) { - if ("development" !== 'production') { - assert(hasOwn(TRANSFORM_PROPS_MAP, key), 'Only ' + transformPropNamesStr + ' available in `getTransform`.'); - } + // Usually other props do not need to be changed in animation during. + setTransform: function (key, val) { + if ("development" !== 'production') { + assert(hasOwn(TRANSFORM_PROPS_MAP, key), 'Only ' + transformPropNamesStr + ' available in `setTransform`.'); + } - return tmpDuringScope.el[key]; - }, - setShape: function (key, val) { - if ("development" !== 'production') { - assertNotReserved(key); - } + tmpDuringScope.el[key] = val; + return this; + }, + getTransform: function (key) { + if ("development" !== 'production') { + assert(hasOwn(TRANSFORM_PROPS_MAP, key), 'Only ' + transformPropNamesStr + ' available in `getTransform`.'); + } - var el = tmpDuringScope.el; - var shape = el.shape || (el.shape = {}); - shape[key] = val; - el.dirtyShape && el.dirtyShape(); - return this; - }, - getShape: function (key) { - if ("development" !== 'production') { - assertNotReserved(key); - } + return tmpDuringScope.el[key]; + }, + setShape: function (key, val) { + if ("development" !== 'production') { + assertNotReserved(key); + } - var shape = tmpDuringScope.el.shape; + var el = tmpDuringScope.el; + var shape = el.shape || (el.shape = {}); + shape[key] = val; + el.dirtyShape && el.dirtyShape(); + return this; + }, + getShape: function (key) { + if ("development" !== 'production') { + assertNotReserved(key); + } - if (shape) { - return shape[key]; - } - }, - setStyle: function (key, val) { - if ("development" !== 'production') { - assertNotReserved(key); - } + var shape = tmpDuringScope.el.shape; - var el = tmpDuringScope.el; - var style = el.style; + if (shape) { + return shape[key]; + } + }, + setStyle: function (key, val) { + if ("development" !== 'production') { + assertNotReserved(key); + } - if (style) { - if ("development" !== 'production') { - if (eqNaN(val)) { - warn('style.' + key + ' must not be assigned with NaN.'); - } - } + var el = tmpDuringScope.el; + var style = el.style; - style[key] = val; - el.dirtyStyle && el.dirtyStyle(); + if (style) { + if ("development" !== 'production') { + if (eqNaN(val)) { + warn('style.' + key + ' must not be assigned with NaN.'); } + } - return this; - }, - getStyle: function (key) { - if ("development" !== 'production') { - assertNotReserved(key); - } + style[key] = val; + el.dirtyStyle && el.dirtyStyle(); + } - var style = tmpDuringScope.el.style; + return this; + }, + getStyle: function (key) { + if ("development" !== 'production') { + assertNotReserved(key); + } - if (style) { - return style[key]; - } - }, - setExtra: function (key, val) { - if ("development" !== 'production') { - assertNotReserved(key); - } + var style = tmpDuringScope.el.style; - var extra = tmpDuringScope.el.extra || (tmpDuringScope.el.extra = {}); - extra[key] = val; - return this; - }, - getExtra: function (key) { - if ("development" !== 'production') { - assertNotReserved(key); - } + if (style) { + return style[key]; + } + }, + setExtra: function (key, val) { + if ("development" !== 'production') { + assertNotReserved(key); + } + + var extra = tmpDuringScope.el.extra || (tmpDuringScope.el.extra = {}); + extra[key] = val; + return this; + }, + getExtra: function (key) { + if ("development" !== 'production') { + assertNotReserved(key); + } - var extra = tmpDuringScope.el.extra; + var extra = tmpDuringScope.el.extra; - if (extra) { - return extra[key]; - } + if (extra) { + return extra[key]; } + } }; function assertNotReserved(key) { - if ("development" !== 'production') { - if (key === 'transition' || key === 'enterFrom' || key === 'leaveTo') { - throw new Error('key must not be "' + key + '"'); - } + if ("development" !== 'production') { + if (key === 'transition' || key === 'enterFrom' || key === 'leaveTo') { + throw new Error('key must not be "' + key + '"'); } + } } function duringCall() { - // Do not provide "percent" until some requirements come. - // Because consider thies case: - // enterFrom: {x: 100, y: 30}, transition: 'x'. - // And enter duration is different from update duration. - // Thus it might be confused about the meaning of "percent" in during callback. - var scope = this; - var el = scope.el; - - if (!el) { - return; - } // If el is remove from zr by reason like legend, during still need to called, - // becuase el will be added back to zr and the prop value should not be incorrect. + // Do not provide "percent" until some requirements come. + // Because consider thies case: + // enterFrom: {x: 100, y: 30}, transition: 'x'. + // And enter duration is different from update duration. + // Thus it might be confused about the meaning of "percent" in during callback. + var scope = this; + var el = scope.el; + + if (!el) { + return; + } // If el is remove from zr by reason like legend, during still need to called, + // becuase el will be added back to zr and the prop value should not be incorrect. - var latestUserDuring = transitionInnerStore(el).userDuring; - var scopeUserDuring = scope.userDuring; // Ensured a during is only called once in each animation frame. - // If a during is called multiple times in one frame, maybe some users' calulation logic - // might be wrong (not sure whether this usage exists). - // The case of a during might be called twice can be: by default there is a animator for - // 'x', 'y' when init. Before the init animation finished, call `setOption` to start - // another animators for 'style'/'shape'/'extra'. + var latestUserDuring = transitionInnerStore(el).userDuring; + var scopeUserDuring = scope.userDuring; // Ensured a during is only called once in each animation frame. + // If a during is called multiple times in one frame, maybe some users' calulation logic + // might be wrong (not sure whether this usage exists). + // The case of a during might be called twice can be: by default there is a animator for + // 'x', 'y' when init. Before the init animation finished, call `setOption` to start + // another animators for 'style'/'shape'/'extra'. - if (latestUserDuring !== scopeUserDuring) { - // release - scope.el = scope.userDuring = null; - return; - } + if (latestUserDuring !== scopeUserDuring) { + // release + scope.el = scope.userDuring = null; + return; + } - tmpDuringScope.el = el; // Give no `this` to user in "during" calling. + tmpDuringScope.el = el; // Give no `this` to user in "during" calling. - scopeUserDuring(transitionDuringAPI); // FIXME: if in future meet the case that some prop will be both modified in `during` and `state`, - // consider the issue that the prop might be incorrect when return to "normal" state. + scopeUserDuring(transitionDuringAPI); // FIXME: if in future meet the case that some prop will be both modified in `during` and `state`, + // consider the issue that the prop might be incorrect when return to "normal" state. } function prepareShapeOrExtraTransitionFrom(mainAttr, fromEl, elOption, transFromProps) { - var attrOpt = elOption[mainAttr]; + var attrOpt = elOption[mainAttr]; - if (!attrOpt) { - return; - } + if (!attrOpt) { + return; + } - var elPropsInAttr = fromEl[mainAttr]; - var transFromPropsInAttr; + var elPropsInAttr = fromEl[mainAttr]; + var transFromPropsInAttr; - if (elPropsInAttr) { - var transition = elOption.transition; - var attrTransition = attrOpt.transition; + if (elPropsInAttr) { + var transition = elOption.transition; + var attrTransition = attrOpt.transition; - if (attrTransition) { - !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {}); + if (attrTransition) { + !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {}); - if (isTransitionAll(attrTransition)) { - extend(transFromPropsInAttr, elPropsInAttr); - } else { - var transitionKeys = normalizeToArray(attrTransition); + if (isTransitionAll(attrTransition)) { + extend(transFromPropsInAttr, elPropsInAttr); + } else { + var transitionKeys = normalizeToArray(attrTransition); - for (var i = 0; i < transitionKeys.length; i++) { - var key = transitionKeys[i]; - var elVal = elPropsInAttr[key]; - transFromPropsInAttr[key] = elVal; - } - } - } else if (isTransitionAll(transition) || indexOf(transition, mainAttr) >= 0) { - !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {}); - var elPropsInAttrKeys = keys(elPropsInAttr); + for (var i = 0; i < transitionKeys.length; i++) { + var key = transitionKeys[i]; + var elVal = elPropsInAttr[key]; + transFromPropsInAttr[key] = elVal; + } + } + } else if (isTransitionAll(transition) || indexOf(transition, mainAttr) >= 0) { + !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {}); + var elPropsInAttrKeys = keys(elPropsInAttr); - for (var i = 0; i < elPropsInAttrKeys.length; i++) { - var key = elPropsInAttrKeys[i]; - var elVal = elPropsInAttr[key]; + for (var i = 0; i < elPropsInAttrKeys.length; i++) { + var key = elPropsInAttrKeys[i]; + var elVal = elPropsInAttr[key]; - if (isNonStyleTransitionEnabled(attrOpt[key], elVal)) { - transFromPropsInAttr[key] = elVal; - } - } + if (isNonStyleTransitionEnabled(attrOpt[key], elVal)) { + transFromPropsInAttr[key] = elVal; } + } } + } } function prepareShapeOrExtraAllPropsFinal(mainAttr, elOption, allProps) { - var attrOpt = elOption[mainAttr]; + var attrOpt = elOption[mainAttr]; - if (!attrOpt) { - return; - } + if (!attrOpt) { + return; + } - var allPropsInAttr = allProps[mainAttr] = {}; - var keysInAttr = keys(attrOpt); + var allPropsInAttr = allProps[mainAttr] = {}; + var keysInAttr = keys(attrOpt); - for (var i = 0; i < keysInAttr.length; i++) { - var key = keysInAttr[i]; // To avoid share one object with different element, and - // to avoid user modify the object inexpectedly, have to clone. + for (var i = 0; i < keysInAttr.length; i++) { + var key = keysInAttr[i]; // To avoid share one object with different element, and + // to avoid user modify the object inexpectedly, have to clone. - allPropsInAttr[key] = cloneValue(attrOpt[key]); - } + allPropsInAttr[key] = cloneValue(attrOpt[key]); + } } function prepareTransformTransitionFrom(el, elOption, transFromProps) { - var transition = elOption.transition; - var transitionKeys = isTransitionAll(transition) ? TRANSFORMABLE_PROPS : normalizeToArray(transition || []); + var transition = elOption.transition; + var transitionKeys = isTransitionAll(transition) ? TRANSFORMABLE_PROPS : normalizeToArray(transition || []); - for (var i = 0; i < transitionKeys.length; i++) { - var key = transitionKeys[i]; + for (var i = 0; i < transitionKeys.length; i++) { + var key = transitionKeys[i]; - if (key === 'style' || key === 'shape' || key === 'extra') { - continue; - } + if (key === 'style' || key === 'shape' || key === 'extra') { + continue; + } - var elVal = el[key]; + var elVal = el[key]; - if ("development" !== 'production') { - checkTransformPropRefer(key, 'el.transition'); - } // Do not clone, animator will perform that clone. + if ("development" !== 'production') { + checkTransformPropRefer(key, 'el.transition'); + } // Do not clone, animator will perform that clone. - transFromProps[key] = elVal; - } + transFromProps[key] = elVal; + } } function prepareTransformAllPropsFinal(el, elOption, allProps) { - for (var i = 0; i < LEGACY_TRANSFORM_PROPS.length; i++) { - var legacyName = LEGACY_TRANSFORM_PROPS[i]; - var xyName = LEGACY_TRANSFORM_PROPS_MAP[legacyName]; - var legacyArr = elOption[legacyName]; + for (var i = 0; i < LEGACY_TRANSFORM_PROPS.length; i++) { + var legacyName = LEGACY_TRANSFORM_PROPS[i]; + var xyName = LEGACY_TRANSFORM_PROPS_MAP[legacyName]; + var legacyArr = elOption[legacyName]; - if (legacyArr) { - allProps[xyName[0]] = legacyArr[0]; - allProps[xyName[1]] = legacyArr[1]; - } + if (legacyArr) { + allProps[xyName[0]] = legacyArr[0]; + allProps[xyName[1]] = legacyArr[1]; } + } - for (var i = 0; i < TRANSFORMABLE_PROPS.length; i++) { - var key = TRANSFORMABLE_PROPS[i]; + for (var i = 0; i < TRANSFORMABLE_PROPS.length; i++) { + var key = TRANSFORMABLE_PROPS[i]; - if (elOption[key] != null) { - allProps[key] = elOption[key]; - } + if (elOption[key] != null) { + allProps[key] = elOption[key]; } + } } function prepareStyleTransitionFrom(fromEl, elOption, styleOpt, transFromProps) { - if (!styleOpt) { - return; - } + if (!styleOpt) { + return; + } - var fromElStyle = fromEl.style; - var transFromStyleProps; + var fromElStyle = fromEl.style; + var transFromStyleProps; - if (fromElStyle) { - var styleTransition = styleOpt.transition; - var elTransition = elOption.transition; + if (fromElStyle) { + var styleTransition = styleOpt.transition; + var elTransition = elOption.transition; - if (styleTransition && !isTransitionAll(styleTransition)) { - var transitionKeys = normalizeToArray(styleTransition); - !transFromStyleProps && (transFromStyleProps = transFromProps.style = {}); + if (styleTransition && !isTransitionAll(styleTransition)) { + var transitionKeys = normalizeToArray(styleTransition); + !transFromStyleProps && (transFromStyleProps = transFromProps.style = {}); - for (var i = 0; i < transitionKeys.length; i++) { - var key = transitionKeys[i]; - var elVal = fromElStyle[key]; // Do not clone, see `checkNonStyleTansitionRefer`. + for (var i = 0; i < transitionKeys.length; i++) { + var key = transitionKeys[i]; + var elVal = fromElStyle[key]; // Do not clone, see `checkNonStyleTansitionRefer`. - transFromStyleProps[key] = elVal; - } - } else if (fromEl.getAnimationStyleProps && (isTransitionAll(elTransition) || isTransitionAll(styleTransition) || indexOf(elTransition, 'style') >= 0)) { - var animationProps = fromEl.getAnimationStyleProps(); - var animationStyleProps = animationProps ? animationProps.style : null; + transFromStyleProps[key] = elVal; + } + } else if (fromEl.getAnimationStyleProps && (isTransitionAll(elTransition) || isTransitionAll(styleTransition) || indexOf(elTransition, 'style') >= 0)) { + var animationProps = fromEl.getAnimationStyleProps(); + var animationStyleProps = animationProps ? animationProps.style : null; - if (animationStyleProps) { - !transFromStyleProps && (transFromStyleProps = transFromProps.style = {}); - var styleKeys = keys(styleOpt); + if (animationStyleProps) { + !transFromStyleProps && (transFromStyleProps = transFromProps.style = {}); + var styleKeys = keys(styleOpt); - for (var i = 0; i < styleKeys.length; i++) { - var key = styleKeys[i]; + for (var i = 0; i < styleKeys.length; i++) { + var key = styleKeys[i]; - if (animationStyleProps[key]) { - var elVal = fromElStyle[key]; - transFromStyleProps[key] = elVal; - } - } - } + if (animationStyleProps[key]) { + var elVal = fromElStyle[key]; + transFromStyleProps[key] = elVal; + } } + } } + } } function isNonStyleTransitionEnabled(optVal, elVal) { - // The same as `checkNonStyleTansitionRefer`. - return !isArrayLike(optVal) ? optVal != null && isFinite(optVal) : optVal !== elVal; + // The same as `checkNonStyleTansitionRefer`. + return !isArrayLike(optVal) ? optVal != null && isFinite(optVal) : optVal !== elVal; } var checkTransformPropRefer; if ("development" !== 'production') { - checkTransformPropRefer = function (key, usedIn) { - if (!hasOwn(TRANSFORM_PROPS_MAP, key)) { - warn('Prop `' + key + '` is not a permitted in `' + usedIn + '`. ' + 'Only `' + keys(TRANSFORM_PROPS_MAP).join('`, `') + '` are permitted.'); - } - }; + checkTransformPropRefer = function (key, usedIn) { + if (!hasOwn(TRANSFORM_PROPS_MAP, key)) { + warn('Prop `' + key + '` is not a permitted in `' + usedIn + '`. ' + 'Only `' + keys(TRANSFORM_PROPS_MAP).join('`, `') + '` are permitted.'); + } + }; } var getStateToRestore = makeInner(); @@ -72763,110 +72763,110 @@ */ function stopPreviousKeyframeAnimationAndRestore(el) { - // Stop previous keyframe animation. - el.stopAnimation('keyframe'); // Restore + // Stop previous keyframe animation. + el.stopAnimation('keyframe'); // Restore - el.attr(getStateToRestore(el)); + el.attr(getStateToRestore(el)); } function applyKeyframeAnimation(el, animationOpts, animatableModel) { - if (!animatableModel.isAnimationEnabled() || !animationOpts) { - return; - } - - if (isArray(animationOpts)) { - each(animationOpts, function (singleAnimationOpts) { - applyKeyframeAnimation(el, singleAnimationOpts, animatableModel); - }); - return; - } - - var keyframes = animationOpts.keyframes; - var duration = animationOpts.duration; - - if (animatableModel && duration == null) { - // Default to use duration of config. - // NOTE: animation config from payload will be ignored because they are mainly for transitions. - var config = getAnimationConfig('enter', animatableModel, 0); - duration = config && config.duration; - } - - if (!keyframes || !duration) { - return; - } + if (!animatableModel.isAnimationEnabled() || !animationOpts) { + return; + } - var stateToRestore = getStateToRestore(el); - each(ELEMENT_ANIMATABLE_PROPS, function (targetPropName) { - if (targetPropName && !el[targetPropName]) { - return; - } + if (isArray(animationOpts)) { + each(animationOpts, function (singleAnimationOpts) { + applyKeyframeAnimation(el, singleAnimationOpts, animatableModel); + }); + return; + } - var animator; - var endFrameIsSet = false; // Sort keyframes by percent. + var keyframes = animationOpts.keyframes; + var duration = animationOpts.duration; - keyframes.sort(function (a, b) { - return a.percent - b.percent; - }); - each(keyframes, function (kf) { - // Stop current animation. - var animators = el.animators; - var kfValues = targetPropName ? kf[targetPropName] : kf; + if (animatableModel && duration == null) { + // Default to use duration of config. + // NOTE: animation config from payload will be ignored because they are mainly for transitions. + var config = getAnimationConfig('enter', animatableModel, 0); + duration = config && config.duration; + } - if ("development" !== 'production') { - if (kf.percent >= 1) { - endFrameIsSet = true; - } - } + if (!keyframes || !duration) { + return; + } - if (!kfValues) { - return; - } + var stateToRestore = getStateToRestore(el); + each(ELEMENT_ANIMATABLE_PROPS, function (targetPropName) { + if (targetPropName && !el[targetPropName]) { + return; + } - var propKeys = keys(kfValues); + var animator; + var endFrameIsSet = false; // Sort keyframes by percent. - if (!targetPropName) { - // PENDING performance? - propKeys = filter(propKeys, function (key) { - return indexOf(KEYFRAME_EXCLUDE_KEYS, key) < 0; - }); - } + keyframes.sort(function (a, b) { + return a.percent - b.percent; + }); + each(keyframes, function (kf) { + // Stop current animation. + var animators = el.animators; + var kfValues = targetPropName ? kf[targetPropName] : kf; - if (!propKeys.length) { - return; - } + if ("development" !== 'production') { + if (kf.percent >= 1) { + endFrameIsSet = true; + } + } - if (!animator) { - animator = el.animate(targetPropName, animationOpts.loop, true); - animator.scope = 'keyframe'; - } + if (!kfValues) { + return; + } - for (var i = 0; i < animators.length; i++) { - // Stop all other animation that is not keyframe. - if (animators[i] !== animator && animators[i].targetName === animator.targetName) { - animators[i].stopTracks(propKeys); - } - } + var propKeys = keys(kfValues); - targetPropName && (stateToRestore[targetPropName] = stateToRestore[targetPropName] || {}); - var savedTarget = targetPropName ? stateToRestore[targetPropName] : stateToRestore; - each(propKeys, function (key) { - // Save original value. - savedTarget[key] = ((targetPropName ? el[targetPropName] : el) || {})[key]; - }); - animator.whenWithKeys(duration * kf.percent, kfValues, propKeys, kf.easing); + if (!targetPropName) { + // PENDING performance? + propKeys = filter(propKeys, function (key) { + return indexOf(KEYFRAME_EXCLUDE_KEYS, key) < 0; }); + } - if (!animator) { - return; - } + if (!propKeys.length) { + return; + } + + if (!animator) { + animator = el.animate(targetPropName, animationOpts.loop, true); + animator.scope = 'keyframe'; + } + + for (var i = 0; i < animators.length; i++) { + // Stop all other animation that is not keyframe. + if (animators[i] !== animator && animators[i].targetName === animator.targetName) { + animators[i].stopTracks(propKeys); + } + } + + targetPropName && (stateToRestore[targetPropName] = stateToRestore[targetPropName] || {}); + var savedTarget = targetPropName ? stateToRestore[targetPropName] : stateToRestore; + each(propKeys, function (key) { + // Save original value. + savedTarget[key] = ((targetPropName ? el[targetPropName] : el) || {})[key]; + }); + animator.whenWithKeys(duration * kf.percent, kfValues, propKeys, kf.easing); + }); - if ("development" !== 'production') { - if (!endFrameIsSet) { - warn('End frame with percent: 1 is missing in the keyframeAnimation.', true); - } - } + if (!animator) { + return; + } - animator.delay(animationOpts.delay || 0).duration(duration).start(animationOpts.easing); - }); + if ("development" !== 'production') { + if (!endFrameIsSet) { + warn('End frame with percent: 1 is missing in the keyframeAnimation.', true); + } + } + + animator.delay(animationOpts.delay || 0).duration(duration).start(animationOpts.easing); + }); } var EMPHASIS = 'emphasis'; @@ -72875,26 +72875,26 @@ var SELECT = 'select'; var STATES = [NORMAL, EMPHASIS, BLUR, SELECT]; var PATH_ITEM_STYLE = { - normal: ['itemStyle'], - emphasis: [EMPHASIS, 'itemStyle'], - blur: [BLUR, 'itemStyle'], - select: [SELECT, 'itemStyle'] + normal: ['itemStyle'], + emphasis: [EMPHASIS, 'itemStyle'], + blur: [BLUR, 'itemStyle'], + select: [SELECT, 'itemStyle'] }; var PATH_LABEL = { - normal: ['label'], - emphasis: [EMPHASIS, 'label'], - blur: [BLUR, 'label'], - select: [SELECT, 'label'] + normal: ['label'], + emphasis: [EMPHASIS, 'label'], + blur: [BLUR, 'label'], + select: [SELECT, 'label'] }; var DEFAULT_TRANSITION = ['x', 'y']; // Use prefix to avoid index to be the same as el.name, // which will cause weird update animation. var GROUP_DIFF_PREFIX = 'e\0\0'; var attachedTxInfoTmp = { - normal: {}, - emphasis: {}, - blur: {}, - select: {} + normal: {}, + emphasis: {}, + blur: {}, + select: {} }; /** * To reduce total package size of each coordinate systems, the modules `prepareCustom` @@ -72909,841 +72909,841 @@ */ var prepareCustoms = { - cartesian2d: cartesianPrepareCustom, - geo: geoPrepareCustom, - singleAxis: singlePrepareCustom, - polar: polarPrepareCustom, - calendar: calendarPrepareCustom + cartesian2d: cartesianPrepareCustom, + geo: geoPrepareCustom, + singleAxis: singlePrepareCustom, + polar: polarPrepareCustom, + calendar: calendarPrepareCustom }; function isPath$1(el) { - return el instanceof Path; + return el instanceof Path; } function isDisplayable(el) { - return el instanceof Displayable; + return el instanceof Displayable; } function copyElement(sourceEl, targetEl) { - targetEl.copyTransform(sourceEl); + targetEl.copyTransform(sourceEl); - if (isDisplayable(targetEl) && isDisplayable(sourceEl)) { - targetEl.setStyle(sourceEl.style); - targetEl.z = sourceEl.z; - targetEl.z2 = sourceEl.z2; - targetEl.zlevel = sourceEl.zlevel; - targetEl.invisible = sourceEl.invisible; - targetEl.ignore = sourceEl.ignore; + if (isDisplayable(targetEl) && isDisplayable(sourceEl)) { + targetEl.setStyle(sourceEl.style); + targetEl.z = sourceEl.z; + targetEl.z2 = sourceEl.z2; + targetEl.zlevel = sourceEl.zlevel; + targetEl.invisible = sourceEl.invisible; + targetEl.ignore = sourceEl.ignore; - if (isPath$1(targetEl) && isPath$1(sourceEl)) { - targetEl.setShape(sourceEl.shape); - } + if (isPath$1(targetEl) && isPath$1(sourceEl)) { + targetEl.setShape(sourceEl.shape); } + } } var CustomChartView = - /** @class */ - function (_super) { - __extends(CustomChartView, _super); - - function CustomChartView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = CustomChartView.type; - return _this; - } - - CustomChartView.prototype.render = function (customSeries, ecModel, api, payload) { - // Clear previously rendered progressive elements. - this._progressiveEls = null; - var oldData = this._data; - var data = customSeries.getData(); - var group = this.group; - var renderItem = makeRenderItem(customSeries, data, ecModel, api); - - if (!oldData) { - // Previous render is incremental render or first render. - // Needs remove the incremental rendered elements. - group.removeAll(); - } - - data.diff(oldData).add(function (newIdx) { - createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data); - }).remove(function (oldIdx) { - var el = oldData.getItemGraphicEl(oldIdx); - applyLeaveTransition(el, customInnerStore(el).option, customSeries); - }).update(function (newIdx, oldIdx) { - var oldEl = oldData.getItemGraphicEl(oldIdx); - createOrUpdateItem(api, oldEl, newIdx, renderItem(newIdx, payload), customSeries, group, data); - }).execute(); // Do clipping + /** @class */ + function (_super) { + __extends(CustomChartView, _super); + + function CustomChartView() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = CustomChartView.type; + return _this; + } + + CustomChartView.prototype.render = function (customSeries, ecModel, api, payload) { + // Clear previously rendered progressive elements. + this._progressiveEls = null; + var oldData = this._data; + var data = customSeries.getData(); + var group = this.group; + var renderItem = makeRenderItem(customSeries, data, ecModel, api); + + if (!oldData) { + // Previous render is incremental render or first render. + // Needs remove the incremental rendered elements. + group.removeAll(); + } + + data.diff(oldData).add(function (newIdx) { + createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data); + }).remove(function (oldIdx) { + var el = oldData.getItemGraphicEl(oldIdx); + applyLeaveTransition(el, customInnerStore(el).option, customSeries); + }).update(function (newIdx, oldIdx) { + var oldEl = oldData.getItemGraphicEl(oldIdx); + createOrUpdateItem(api, oldEl, newIdx, renderItem(newIdx, payload), customSeries, group, data); + }).execute(); // Do clipping - var clipPath = customSeries.get('clip', true) ? createClipPath(customSeries.coordinateSystem, false, customSeries) : null; + var clipPath = customSeries.get('clip', true) ? createClipPath(customSeries.coordinateSystem, false, customSeries) : null; - if (clipPath) { - group.setClipPath(clipPath); - } else { - group.removeClipPath(); - } + if (clipPath) { + group.setClipPath(clipPath); + } else { + group.removeClipPath(); + } - this._data = data; - }; + this._data = data; + }; - CustomChartView.prototype.incrementalPrepareRender = function (customSeries, ecModel, api) { - this.group.removeAll(); - this._data = null; - }; + CustomChartView.prototype.incrementalPrepareRender = function (customSeries, ecModel, api) { + this.group.removeAll(); + this._data = null; + }; - CustomChartView.prototype.incrementalRender = function (params, customSeries, ecModel, api, payload) { - var data = customSeries.getData(); - var renderItem = makeRenderItem(customSeries, data, ecModel, api); - var progressiveEls = this._progressiveEls = []; + CustomChartView.prototype.incrementalRender = function (params, customSeries, ecModel, api, payload) { + var data = customSeries.getData(); + var renderItem = makeRenderItem(customSeries, data, ecModel, api); + var progressiveEls = this._progressiveEls = []; - function setIncrementalAndHoverLayer(el) { - if (!el.isGroup) { - el.incremental = true; - el.ensureState('emphasis').hoverLayer = true; - } - } + function setIncrementalAndHoverLayer(el) { + if (!el.isGroup) { + el.incremental = true; + el.ensureState('emphasis').hoverLayer = true; + } + } - for (var idx = params.start; idx < params.end; idx++) { - var el = createOrUpdateItem(null, null, idx, renderItem(idx, payload), customSeries, this.group, data); + for (var idx = params.start; idx < params.end; idx++) { + var el = createOrUpdateItem(null, null, idx, renderItem(idx, payload), customSeries, this.group, data); - if (el) { - el.traverse(setIncrementalAndHoverLayer); - progressiveEls.push(el); - } - } - }; + if (el) { + el.traverse(setIncrementalAndHoverLayer); + progressiveEls.push(el); + } + } + }; - CustomChartView.prototype.eachRendered = function (cb) { - traverseElements(this._progressiveEls || this.group, cb); - }; + CustomChartView.prototype.eachRendered = function (cb) { + traverseElements(this._progressiveEls || this.group, cb); + }; - CustomChartView.prototype.filterForExposedEvent = function (eventType, query, targetEl, packedEvent) { - var elementName = query.element; + CustomChartView.prototype.filterForExposedEvent = function (eventType, query, targetEl, packedEvent) { + var elementName = query.element; - if (elementName == null || targetEl.name === elementName) { - return true; - } // Enable to give a name on a group made by `renderItem`, and listen - // events that triggerd by its descendents. + if (elementName == null || targetEl.name === elementName) { + return true; + } // Enable to give a name on a group made by `renderItem`, and listen + // events that triggerd by its descendents. - while ((targetEl = targetEl.__hostTarget || targetEl.parent) && targetEl !== this.group) { - if (targetEl.name === elementName) { - return true; - } - } + while ((targetEl = targetEl.__hostTarget || targetEl.parent) && targetEl !== this.group) { + if (targetEl.name === elementName) { + return true; + } + } - return false; - }; + return false; + }; - CustomChartView.type = 'custom'; - return CustomChartView; - }(ChartView); + CustomChartView.type = 'custom'; + return CustomChartView; + }(ChartView); function createEl(elOption) { - var graphicType = elOption.type; - var el; // Those graphic elements are not shapes. They should not be - // overwritten by users, so do them first. - - if (graphicType === 'path') { - var shape = elOption.shape; // Using pathRect brings convenience to users sacle svg path. - - var pathRect = shape.width != null && shape.height != null ? { - x: shape.x || 0, - y: shape.y || 0, - width: shape.width, - height: shape.height - } : null; - var pathData = getPathData(shape); // Path is also used for icon, so layout 'center' by default. - - el = makePath(pathData, null, pathRect, shape.layout || 'center'); - customInnerStore(el).customPathData = pathData; - } else if (graphicType === 'image') { - el = new ZRImage({}); - customInnerStore(el).customImagePath = elOption.style.image; - } else if (graphicType === 'text') { - el = new ZRText({}); // customInnerStore(el).customText = (elOption.style as TextStyleProps).text; - } else if (graphicType === 'group') { - el = new Group(); - } else if (graphicType === 'compoundPath') { - throw new Error('"compoundPath" is not supported yet.'); - } else { - var Clz = getShapeClass(graphicType); + var graphicType = elOption.type; + var el; // Those graphic elements are not shapes. They should not be + // overwritten by users, so do them first. + + if (graphicType === 'path') { + var shape = elOption.shape; // Using pathRect brings convenience to users sacle svg path. + + var pathRect = shape.width != null && shape.height != null ? { + x: shape.x || 0, + y: shape.y || 0, + width: shape.width, + height: shape.height + } : null; + var pathData = getPathData(shape); // Path is also used for icon, so layout 'center' by default. - if (!Clz) { - var errMsg = ''; + el = makePath(pathData, null, pathRect, shape.layout || 'center'); + customInnerStore(el).customPathData = pathData; + } else if (graphicType === 'image') { + el = new ZRImage({}); + customInnerStore(el).customImagePath = elOption.style.image; + } else if (graphicType === 'text') { + el = new ZRText({}); // customInnerStore(el).customText = (elOption.style as TextStyleProps).text; + } else if (graphicType === 'group') { + el = new Group(); + } else if (graphicType === 'compoundPath') { + throw new Error('"compoundPath" is not supported yet.'); + } else { + var Clz = getShapeClass(graphicType); - if ("development" !== 'production') { - errMsg = 'graphic type "' + graphicType + '" can not be found.'; - } + if (!Clz) { + var errMsg = ''; - throwError(errMsg); - } + if ("development" !== 'production') { + errMsg = 'graphic type "' + graphicType + '" can not be found.'; + } - el = new Clz(); + throwError(errMsg); } - customInnerStore(el).customGraphicType = graphicType; - el.name = elOption.name; // Compat ec4: the default z2 lift is 1. If changing the number, - // some cases probably be broken: hierarchy layout along z, like circle packing, - // where emphasis only intending to modify color/border rather than lift z2. + el = new Clz(); + } + + customInnerStore(el).customGraphicType = graphicType; + el.name = elOption.name; // Compat ec4: the default z2 lift is 1. If changing the number, + // some cases probably be broken: hierarchy layout along z, like circle packing, + // where emphasis only intending to modify color/border rather than lift z2. - el.z2EmphasisLift = 1; - el.z2SelectLift = 1; - return el; + el.z2EmphasisLift = 1; + el.z2SelectLift = 1; + return el; } function updateElNormal( // Can be null/undefined - api, el, dataIndex, elOption, attachedTxInfo, seriesModel, isInit) { - // Stop and restore before update any other attributes. - stopPreviousKeyframeAnimationAndRestore(el); - var txCfgOpt = attachedTxInfo && attachedTxInfo.normal.cfg; + api, el, dataIndex, elOption, attachedTxInfo, seriesModel, isInit) { + // Stop and restore before update any other attributes. + stopPreviousKeyframeAnimationAndRestore(el); + var txCfgOpt = attachedTxInfo && attachedTxInfo.normal.cfg; - if (txCfgOpt) { - // PENDING: whether use user object directly rather than clone? - // TODO:5.0 textConfig transition animation? - el.setTextConfig(txCfgOpt); - } // Default transition ['x', 'y'] + if (txCfgOpt) { + // PENDING: whether use user object directly rather than clone? + // TODO:5.0 textConfig transition animation? + el.setTextConfig(txCfgOpt); + } // Default transition ['x', 'y'] - if (elOption && elOption.transition == null) { - elOption.transition = DEFAULT_TRANSITION; - } // Do some normalization on style. + if (elOption && elOption.transition == null) { + elOption.transition = DEFAULT_TRANSITION; + } // Do some normalization on style. - var styleOpt = elOption && elOption.style; + var styleOpt = elOption && elOption.style; - if (styleOpt) { - if (el.type === 'text') { - var textOptionStyle = styleOpt; // Compatible with ec4: if `textFill` or `textStroke` exists use them. + if (styleOpt) { + if (el.type === 'text') { + var textOptionStyle = styleOpt; // Compatible with ec4: if `textFill` or `textStroke` exists use them. - hasOwn(textOptionStyle, 'textFill') && (textOptionStyle.fill = textOptionStyle.textFill); - hasOwn(textOptionStyle, 'textStroke') && (textOptionStyle.stroke = textOptionStyle.textStroke); - } + hasOwn(textOptionStyle, 'textFill') && (textOptionStyle.fill = textOptionStyle.textFill); + hasOwn(textOptionStyle, 'textStroke') && (textOptionStyle.stroke = textOptionStyle.textStroke); + } - var decalPattern = void 0; - var decalObj = isPath$1(el) ? styleOpt.decal : null; + var decalPattern = void 0; + var decalObj = isPath$1(el) ? styleOpt.decal : null; - if (api && decalObj) { - decalObj.dirty = true; - decalPattern = createOrUpdatePatternFromDecal(decalObj, api); - } // Always overwrite in case user specify this prop. + if (api && decalObj) { + decalObj.dirty = true; + decalPattern = createOrUpdatePatternFromDecal(decalObj, api); + } // Always overwrite in case user specify this prop. - styleOpt.__decalPattern = decalPattern; - } + styleOpt.__decalPattern = decalPattern; + } - if (isDisplayable(el)) { - if (styleOpt) { - var decalPattern = styleOpt.__decalPattern; + if (isDisplayable(el)) { + if (styleOpt) { + var decalPattern = styleOpt.__decalPattern; - if (decalPattern) { - styleOpt.decal = decalPattern; - } - } + if (decalPattern) { + styleOpt.decal = decalPattern; + } } + } - applyUpdateTransition(el, elOption, seriesModel, { - dataIndex: dataIndex, - isInit: isInit, - clearStyle: true - }); - applyKeyframeAnimation(el, elOption.keyframeAnimation, seriesModel); + applyUpdateTransition(el, elOption, seriesModel, { + dataIndex: dataIndex, + isInit: isInit, + clearStyle: true + }); + applyKeyframeAnimation(el, elOption.keyframeAnimation, seriesModel); } function updateElOnState(state, el, elStateOpt, styleOpt, attachedTxInfo) { - var elDisplayable = el.isGroup ? null : el; - var txCfgOpt = attachedTxInfo && attachedTxInfo[state].cfg; // PENDING:5.0 support customize scale change and transition animation? - - if (elDisplayable) { - // By default support auto lift color when hover whether `emphasis` specified. - var stateObj = elDisplayable.ensureState(state); + var elDisplayable = el.isGroup ? null : el; + var txCfgOpt = attachedTxInfo && attachedTxInfo[state].cfg; // PENDING:5.0 support customize scale change and transition animation? - if (styleOpt === false) { - var existingEmphasisState = elDisplayable.getState(state); + if (elDisplayable) { + // By default support auto lift color when hover whether `emphasis` specified. + var stateObj = elDisplayable.ensureState(state); - if (existingEmphasisState) { - existingEmphasisState.style = null; - } - } else { - // style is needed to enable defaut emphasis. - stateObj.style = styleOpt || null; - } // If `elOption.styleEmphasis` or `elOption.emphasis.style` is `false`, - // remove hover style. - // If `elOption.textConfig` or `elOption.emphasis.textConfig` is null/undefined, it does not - // make sense. So for simplicity, we do not ditinguish `hasOwnProperty` and null/undefined. + if (styleOpt === false) { + var existingEmphasisState = elDisplayable.getState(state); + if (existingEmphasisState) { + existingEmphasisState.style = null; + } + } else { + // style is needed to enable defaut emphasis. + stateObj.style = styleOpt || null; + } // If `elOption.styleEmphasis` or `elOption.emphasis.style` is `false`, + // remove hover style. + // If `elOption.textConfig` or `elOption.emphasis.textConfig` is null/undefined, it does not + // make sense. So for simplicity, we do not ditinguish `hasOwnProperty` and null/undefined. - if (txCfgOpt) { - stateObj.textConfig = txCfgOpt; - } - setDefaultStateProxy(elDisplayable); + if (txCfgOpt) { + stateObj.textConfig = txCfgOpt; } + + setDefaultStateProxy(elDisplayable); + } } function updateZ$1(el, elOption, seriesModel) { - // Group not support textContent and not support z yet. - if (el.isGroup) { - return; - } + // Group not support textContent and not support z yet. + if (el.isGroup) { + return; + } - var elDisplayable = el; - var currentZ = seriesModel.currentZ; - var currentZLevel = seriesModel.currentZLevel; // Always erase. + var elDisplayable = el; + var currentZ = seriesModel.currentZ; + var currentZLevel = seriesModel.currentZLevel; // Always erase. - elDisplayable.z = currentZ; - elDisplayable.zlevel = currentZLevel; // z2 must not be null/undefined, otherwise sort error may occur. + elDisplayable.z = currentZ; + elDisplayable.zlevel = currentZLevel; // z2 must not be null/undefined, otherwise sort error may occur. - var optZ2 = elOption.z2; - optZ2 != null && (elDisplayable.z2 = optZ2 || 0); + var optZ2 = elOption.z2; + optZ2 != null && (elDisplayable.z2 = optZ2 || 0); - for (var i = 0; i < STATES.length; i++) { - updateZForEachState(elDisplayable, elOption, STATES[i]); - } + for (var i = 0; i < STATES.length; i++) { + updateZForEachState(elDisplayable, elOption, STATES[i]); + } } function updateZForEachState(elDisplayable, elOption, state) { - var isNormal = state === NORMAL; - var elStateOpt = isNormal ? elOption : retrieveStateOption(elOption, state); - var optZ2 = elStateOpt ? elStateOpt.z2 : null; - var stateObj; + var isNormal = state === NORMAL; + var elStateOpt = isNormal ? elOption : retrieveStateOption(elOption, state); + var optZ2 = elStateOpt ? elStateOpt.z2 : null; + var stateObj; - if (optZ2 != null) { - // Do not `ensureState` until required. - stateObj = isNormal ? elDisplayable : elDisplayable.ensureState(state); - stateObj.z2 = optZ2 || 0; - } + if (optZ2 != null) { + // Do not `ensureState` until required. + stateObj = isNormal ? elDisplayable : elDisplayable.ensureState(state); + stateObj.z2 = optZ2 || 0; + } } function makeRenderItem(customSeries, data, ecModel, api) { - var renderItem = customSeries.get('renderItem'); - var coordSys = customSeries.coordinateSystem; - var prepareResult = {}; - - if (coordSys) { - if ("development" !== 'production') { - assert(renderItem, 'series.render is required.'); - assert(coordSys.prepareCustoms || prepareCustoms[coordSys.type], 'This coordSys does not support custom series.'); - } // `coordSys.prepareCustoms` is used for external coord sys like bmap. - - - prepareResult = coordSys.prepareCustoms ? coordSys.prepareCustoms(coordSys) : prepareCustoms[coordSys.type](coordSys); - } - - var userAPI = defaults({ - getWidth: api.getWidth, - getHeight: api.getHeight, - getZr: api.getZr, - getDevicePixelRatio: api.getDevicePixelRatio, - value: value, - style: style, - ordinalRawValue: ordinalRawValue, - styleEmphasis: styleEmphasis, - visual: visual, - barLayout: barLayout, - currentSeriesIndices: currentSeriesIndices, - font: font - }, prepareResult.api || {}); - var userParams = { - // The life cycle of context: current round of rendering. - // The global life cycle is probably not necessary, because - // user can store global status by themselves. - context: {}, - seriesId: customSeries.id, - seriesName: customSeries.name, - seriesIndex: customSeries.seriesIndex, - coordSys: prepareResult.coordSys, - dataInsideLength: data.count(), - encode: wrapEncodeDef(customSeries.getData()) - }; // If someday intending to refactor them to a class, should consider do not - // break change: currently these attribute member are encapsulated in a closure - // so that do not need to force user to call these method with a scope. - // Do not support call `api` asynchronously without dataIndexInside input. - - var currDataIndexInside; - var currItemModel; - var currItemStyleModels = {}; - var currLabelModels = {}; - var seriesItemStyleModels = {}; - var seriesLabelModels = {}; - - for (var i = 0; i < STATES.length; i++) { - var stateName = STATES[i]; - seriesItemStyleModels[stateName] = customSeries.getModel(PATH_ITEM_STYLE[stateName]); - seriesLabelModels[stateName] = customSeries.getModel(PATH_LABEL[stateName]); - } - - function getItemModel(dataIndexInside) { - return dataIndexInside === currDataIndexInside ? currItemModel || (currItemModel = data.getItemModel(dataIndexInside)) : data.getItemModel(dataIndexInside); - } - - function getItemStyleModel(dataIndexInside, state) { - return !data.hasItemOption ? seriesItemStyleModels[state] : dataIndexInside === currDataIndexInside ? currItemStyleModels[state] || (currItemStyleModels[state] = getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state])) : getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state]); - } - - function getLabelModel(dataIndexInside, state) { - return !data.hasItemOption ? seriesLabelModels[state] : dataIndexInside === currDataIndexInside ? currLabelModels[state] || (currLabelModels[state] = getItemModel(dataIndexInside).getModel(PATH_LABEL[state])) : getItemModel(dataIndexInside).getModel(PATH_LABEL[state]); - } - - return function (dataIndexInside, payload) { - currDataIndexInside = dataIndexInside; - currItemModel = null; - currItemStyleModels = {}; - currLabelModels = {}; - return renderItem && renderItem(defaults({ - dataIndexInside: dataIndexInside, - dataIndex: data.getRawIndex(dataIndexInside), - // Can be used for optimization when zoom or roam. - actionType: payload ? payload.type : null - }, userParams), userAPI); - }; - /** - * @public - * @param dim by default 0. - * @param dataIndexInside by default `currDataIndexInside`. - */ - - function value(dim, dataIndexInside) { - dataIndexInside == null && (dataIndexInside = currDataIndexInside); - return data.getStore().get(data.getDimensionIndex(dim || 0), dataIndexInside); - } - /** - * @public - * @param dim by default 0. - * @param dataIndexInside by default `currDataIndexInside`. - */ + var renderItem = customSeries.get('renderItem'); + var coordSys = customSeries.coordinateSystem; + var prepareResult = {}; + if (coordSys) { + if ("development" !== 'production') { + assert(renderItem, 'series.render is required.'); + assert(coordSys.prepareCustoms || prepareCustoms[coordSys.type], 'This coordSys does not support custom series.'); + } // `coordSys.prepareCustoms` is used for external coord sys like bmap. + + + prepareResult = coordSys.prepareCustoms ? coordSys.prepareCustoms(coordSys) : prepareCustoms[coordSys.type](coordSys); + } + + var userAPI = defaults({ + getWidth: api.getWidth, + getHeight: api.getHeight, + getZr: api.getZr, + getDevicePixelRatio: api.getDevicePixelRatio, + value: value, + style: style, + ordinalRawValue: ordinalRawValue, + styleEmphasis: styleEmphasis, + visual: visual, + barLayout: barLayout, + currentSeriesIndices: currentSeriesIndices, + font: font + }, prepareResult.api || {}); + var userParams = { + // The life cycle of context: current round of rendering. + // The global life cycle is probably not necessary, because + // user can store global status by themselves. + context: {}, + seriesId: customSeries.id, + seriesName: customSeries.name, + seriesIndex: customSeries.seriesIndex, + coordSys: prepareResult.coordSys, + dataInsideLength: data.count(), + encode: wrapEncodeDef(customSeries.getData()) + }; // If someday intending to refactor them to a class, should consider do not + // break change: currently these attribute member are encapsulated in a closure + // so that do not need to force user to call these method with a scope. + // Do not support call `api` asynchronously without dataIndexInside input. + + var currDataIndexInside; + var currItemModel; + var currItemStyleModels = {}; + var currLabelModels = {}; + var seriesItemStyleModels = {}; + var seriesLabelModels = {}; + + for (var i = 0; i < STATES.length; i++) { + var stateName = STATES[i]; + seriesItemStyleModels[stateName] = customSeries.getModel(PATH_ITEM_STYLE[stateName]); + seriesLabelModels[stateName] = customSeries.getModel(PATH_LABEL[stateName]); + } + + function getItemModel(dataIndexInside) { + return dataIndexInside === currDataIndexInside ? currItemModel || (currItemModel = data.getItemModel(dataIndexInside)) : data.getItemModel(dataIndexInside); + } + + function getItemStyleModel(dataIndexInside, state) { + return !data.hasItemOption ? seriesItemStyleModels[state] : dataIndexInside === currDataIndexInside ? currItemStyleModels[state] || (currItemStyleModels[state] = getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state])) : getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state]); + } + + function getLabelModel(dataIndexInside, state) { + return !data.hasItemOption ? seriesLabelModels[state] : dataIndexInside === currDataIndexInside ? currLabelModels[state] || (currLabelModels[state] = getItemModel(dataIndexInside).getModel(PATH_LABEL[state])) : getItemModel(dataIndexInside).getModel(PATH_LABEL[state]); + } + + return function (dataIndexInside, payload) { + currDataIndexInside = dataIndexInside; + currItemModel = null; + currItemStyleModels = {}; + currLabelModels = {}; + return renderItem && renderItem(defaults({ + dataIndexInside: dataIndexInside, + dataIndex: data.getRawIndex(dataIndexInside), + // Can be used for optimization when zoom or roam. + actionType: payload ? payload.type : null + }, userParams), userAPI); + }; + /** + * @public + * @param dim by default 0. + * @param dataIndexInside by default `currDataIndexInside`. + */ - function ordinalRawValue(dim, dataIndexInside) { - dataIndexInside == null && (dataIndexInside = currDataIndexInside); - dim = dim || 0; - var dimInfo = data.getDimensionInfo(dim); + function value(dim, dataIndexInside) { + dataIndexInside == null && (dataIndexInside = currDataIndexInside); + return data.getStore().get(data.getDimensionIndex(dim || 0), dataIndexInside); + } + /** + * @public + * @param dim by default 0. + * @param dataIndexInside by default `currDataIndexInside`. + */ - if (!dimInfo) { - var dimIndex = data.getDimensionIndex(dim); - return dimIndex >= 0 ? data.getStore().get(dimIndex, dataIndexInside) : undefined; - } - var val = data.get(dimInfo.name, dataIndexInside); - var ordinalMeta = dimInfo && dimInfo.ordinalMeta; - return ordinalMeta ? ordinalMeta.categories[val] : val; - } - /** - * @deprecated The orgininal intention of `api.style` is enable to set itemStyle - * like other series. But it not necessary and not easy to give a strict definition - * of what it return. And since echarts5 it needs to be make compat work. So - * deprecates it since echarts5. - * - * By default, `visual` is applied to style (to support visualMap). - * `visual.color` is applied at `fill`. If user want apply visual.color on `stroke`, - * it can be implemented as: - * `api.style({stroke: api.visual('color'), fill: null})`; - * - * [Compat]: since ec5, RectText has been separated from its hosts el. - * so `api.style()` will only return the style from `itemStyle` but not handle `label` - * any more. But `series.label` config is never published in doc. - * We still compat it in `api.style()`. But not encourage to use it and will still not - * to pulish it to doc. - * @public - * @param dataIndexInside by default `currDataIndexInside`. - */ + function ordinalRawValue(dim, dataIndexInside) { + dataIndexInside == null && (dataIndexInside = currDataIndexInside); + dim = dim || 0; + var dimInfo = data.getDimensionInfo(dim); + + if (!dimInfo) { + var dimIndex = data.getDimensionIndex(dim); + return dimIndex >= 0 ? data.getStore().get(dimIndex, dataIndexInside) : undefined; + } + + var val = data.get(dimInfo.name, dataIndexInside); + var ordinalMeta = dimInfo && dimInfo.ordinalMeta; + return ordinalMeta ? ordinalMeta.categories[val] : val; + } + /** + * @deprecated The orgininal intention of `api.style` is enable to set itemStyle + * like other series. But it not necessary and not easy to give a strict definition + * of what it return. And since echarts5 it needs to be make compat work. So + * deprecates it since echarts5. + * + * By default, `visual` is applied to style (to support visualMap). + * `visual.color` is applied at `fill`. If user want apply visual.color on `stroke`, + * it can be implemented as: + * `api.style({stroke: api.visual('color'), fill: null})`; + * + * [Compat]: since ec5, RectText has been separated from its hosts el. + * so `api.style()` will only return the style from `itemStyle` but not handle `label` + * any more. But `series.label` config is never published in doc. + * We still compat it in `api.style()`. But not encourage to use it and will still not + * to pulish it to doc. + * @public + * @param dataIndexInside by default `currDataIndexInside`. + */ - function style(userProps, dataIndexInside) { - if ("development" !== 'production') { - warnDeprecated('api.style', 'Please write literal style directly instead.'); - } - - dataIndexInside == null && (dataIndexInside = currDataIndexInside); - var style = data.getItemVisual(dataIndexInside, 'style'); - var visualColor = style && style.fill; - var opacity = style && style.opacity; - var itemStyle = getItemStyleModel(dataIndexInside, NORMAL).getItemStyle(); - visualColor != null && (itemStyle.fill = visualColor); - opacity != null && (itemStyle.opacity = opacity); - var opt = { - inheritColor: isString(visualColor) ? visualColor : '#000' - }; - var labelModel = getLabelModel(dataIndexInside, NORMAL); // Now that the feture of "auto adjust text fill/stroke" has been migrated to zrender - // since ec5, we should set `isAttached` as `false` here and make compat in - // `convertToEC4StyleForCustomSerise`. - - var textStyle = createTextStyle(labelModel, null, opt, false, true); - textStyle.text = labelModel.getShallow('show') ? retrieve2(customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null; - var textConfig = createTextConfig(labelModel, opt, false); - preFetchFromExtra(userProps, itemStyle); - itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig); - userProps && applyUserPropsAfter(itemStyle, userProps); - itemStyle.legacy = true; - return itemStyle; + function style(userProps, dataIndexInside) { + if ("development" !== 'production') { + warnDeprecated('api.style', 'Please write literal style directly instead.'); } - /** - * @deprecated The reason see `api.style()` - * @public - * @param dataIndexInside by default `currDataIndexInside`. - */ - - - function styleEmphasis(userProps, dataIndexInside) { - if ("development" !== 'production') { - warnDeprecated('api.styleEmphasis', 'Please write literal style directly instead.'); - } - dataIndexInside == null && (dataIndexInside = currDataIndexInside); - var itemStyle = getItemStyleModel(dataIndexInside, EMPHASIS).getItemStyle(); - var labelModel = getLabelModel(dataIndexInside, EMPHASIS); - var textStyle = createTextStyle(labelModel, null, null, true, true); - textStyle.text = labelModel.getShallow('show') ? retrieve3(customSeries.getFormattedLabel(dataIndexInside, EMPHASIS), customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null; - var textConfig = createTextConfig(labelModel, null, true); - preFetchFromExtra(userProps, itemStyle); - itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig); - userProps && applyUserPropsAfter(itemStyle, userProps); - itemStyle.legacy = true; - return itemStyle; - } + dataIndexInside == null && (dataIndexInside = currDataIndexInside); + var style = data.getItemVisual(dataIndexInside, 'style'); + var visualColor = style && style.fill; + var opacity = style && style.opacity; + var itemStyle = getItemStyleModel(dataIndexInside, NORMAL).getItemStyle(); + visualColor != null && (itemStyle.fill = visualColor); + opacity != null && (itemStyle.opacity = opacity); + var opt = { + inheritColor: isString(visualColor) ? visualColor : '#000' + }; + var labelModel = getLabelModel(dataIndexInside, NORMAL); // Now that the feture of "auto adjust text fill/stroke" has been migrated to zrender + // since ec5, we should set `isAttached` as `false` here and make compat in + // `convertToEC4StyleForCustomSerise`. + + var textStyle = createTextStyle(labelModel, null, opt, false, true); + textStyle.text = labelModel.getShallow('show') ? retrieve2(customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null; + var textConfig = createTextConfig(labelModel, opt, false); + preFetchFromExtra(userProps, itemStyle); + itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig); + userProps && applyUserPropsAfter(itemStyle, userProps); + itemStyle.legacy = true; + return itemStyle; + } + /** + * @deprecated The reason see `api.style()` + * @public + * @param dataIndexInside by default `currDataIndexInside`. + */ - function applyUserPropsAfter(itemStyle, extra) { - for (var key in extra) { - if (hasOwn(extra, key)) { - itemStyle[key] = extra[key]; - } - } - } - function preFetchFromExtra(extra, itemStyle) { - // A trick to retrieve those props firstly, which are used to - // apply auto inside fill/stroke in `convertToEC4StyleForCustomSerise`. - // (It's not reasonable but only for a degree of compat) - if (extra) { - extra.textFill && (itemStyle.textFill = extra.textFill); - extra.textPosition && (itemStyle.textPosition = extra.textPosition); - } - } - /** - * @public - * @param dataIndexInside by default `currDataIndexInside`. - */ + function styleEmphasis(userProps, dataIndexInside) { + if ("development" !== 'production') { + warnDeprecated('api.styleEmphasis', 'Please write literal style directly instead.'); + } + + dataIndexInside == null && (dataIndexInside = currDataIndexInside); + var itemStyle = getItemStyleModel(dataIndexInside, EMPHASIS).getItemStyle(); + var labelModel = getLabelModel(dataIndexInside, EMPHASIS); + var textStyle = createTextStyle(labelModel, null, null, true, true); + textStyle.text = labelModel.getShallow('show') ? retrieve3(customSeries.getFormattedLabel(dataIndexInside, EMPHASIS), customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null; + var textConfig = createTextConfig(labelModel, null, true); + preFetchFromExtra(userProps, itemStyle); + itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig); + userProps && applyUserPropsAfter(itemStyle, userProps); + itemStyle.legacy = true; + return itemStyle; + } + + function applyUserPropsAfter(itemStyle, extra) { + for (var key in extra) { + if (hasOwn(extra, key)) { + itemStyle[key] = extra[key]; + } + } + } + + function preFetchFromExtra(extra, itemStyle) { + // A trick to retrieve those props firstly, which are used to + // apply auto inside fill/stroke in `convertToEC4StyleForCustomSerise`. + // (It's not reasonable but only for a degree of compat) + if (extra) { + extra.textFill && (itemStyle.textFill = extra.textFill); + extra.textPosition && (itemStyle.textPosition = extra.textPosition); + } + } + /** + * @public + * @param dataIndexInside by default `currDataIndexInside`. + */ - function visual(visualType, dataIndexInside) { - dataIndexInside == null && (dataIndexInside = currDataIndexInside); + function visual(visualType, dataIndexInside) { + dataIndexInside == null && (dataIndexInside = currDataIndexInside); - if (hasOwn(STYLE_VISUAL_TYPE, visualType)) { - var style_1 = data.getItemVisual(dataIndexInside, 'style'); - return style_1 ? style_1[STYLE_VISUAL_TYPE[visualType]] : null; - } // Only support these visuals. Other visual might be inner tricky - // for performance (like `style`), do not expose to users. + if (hasOwn(STYLE_VISUAL_TYPE, visualType)) { + var style_1 = data.getItemVisual(dataIndexInside, 'style'); + return style_1 ? style_1[STYLE_VISUAL_TYPE[visualType]] : null; + } // Only support these visuals. Other visual might be inner tricky + // for performance (like `style`), do not expose to users. - if (hasOwn(NON_STYLE_VISUAL_PROPS, visualType)) { - return data.getItemVisual(dataIndexInside, visualType); - } + if (hasOwn(NON_STYLE_VISUAL_PROPS, visualType)) { + return data.getItemVisual(dataIndexInside, visualType); } - /** - * @public - * @return If not support, return undefined. - */ + } + /** + * @public + * @return If not support, return undefined. + */ - function barLayout(opt) { - if (coordSys.type === 'cartesian2d') { - var baseAxis = coordSys.getBaseAxis(); - return getLayoutOnAxis(defaults({ - axis: baseAxis - }, opt)); - } - } - /** - * @public - */ + function barLayout(opt) { + if (coordSys.type === 'cartesian2d') { + var baseAxis = coordSys.getBaseAxis(); + return getLayoutOnAxis(defaults({ + axis: baseAxis + }, opt)); + } + } + /** + * @public + */ - function currentSeriesIndices() { - return ecModel.getCurrentSeriesIndices(); - } - /** - * @public - * @return font string - */ + function currentSeriesIndices() { + return ecModel.getCurrentSeriesIndices(); + } + /** + * @public + * @return font string + */ - function font(opt) { - return getFont(opt, ecModel); - } + function font(opt) { + return getFont(opt, ecModel); + } } function wrapEncodeDef(data) { - var encodeDef = {}; - each(data.dimensions, function (dimName) { - var dimInfo = data.getDimensionInfo(dimName); + var encodeDef = {}; + each(data.dimensions, function (dimName) { + var dimInfo = data.getDimensionInfo(dimName); - if (!dimInfo.isExtraCoord) { - var coordDim = dimInfo.coordDim; - var dataDims = encodeDef[coordDim] = encodeDef[coordDim] || []; - dataDims[dimInfo.coordDimIndex] = data.getDimensionIndex(dimName); - } - }); - return encodeDef; + if (!dimInfo.isExtraCoord) { + var coordDim = dimInfo.coordDim; + var dataDims = encodeDef[coordDim] = encodeDef[coordDim] || []; + dataDims[dimInfo.coordDimIndex] = data.getDimensionIndex(dimName); + } + }); + return encodeDef; } function createOrUpdateItem(api, existsEl, dataIndex, elOption, seriesModel, group, data) { - // [Rule] - // If `renderItem` returns `null`/`undefined`/`false`, remove the previous el if existing. - // (It seems that violate the "merge" principle, but most of users probably intuitively - // regard "return;" as "show nothing element whatever", so make a exception to meet the - // most cases.) - // The rule or "merge" see [STRATEGY_MERGE]. - // If `elOption` is `null`/`undefined`/`false` (when `renderItem` returns nothing). - if (!elOption) { - group.remove(existsEl); - return; - } + // [Rule] + // If `renderItem` returns `null`/`undefined`/`false`, remove the previous el if existing. + // (It seems that violate the "merge" principle, but most of users probably intuitively + // regard "return;" as "show nothing element whatever", so make a exception to meet the + // most cases.) + // The rule or "merge" see [STRATEGY_MERGE]. + // If `elOption` is `null`/`undefined`/`false` (when `renderItem` returns nothing). + if (!elOption) { + group.remove(existsEl); + return; + } - var el = doCreateOrUpdateEl(api, existsEl, dataIndex, elOption, seriesModel, group); - el && data.setItemGraphicEl(dataIndex, el); - el && toggleHoverEmphasis(el, elOption.focus, elOption.blurScope, elOption.emphasisDisabled); - return el; + var el = doCreateOrUpdateEl(api, existsEl, dataIndex, elOption, seriesModel, group); + el && data.setItemGraphicEl(dataIndex, el); + el && toggleHoverEmphasis(el, elOption.focus, elOption.blurScope, elOption.emphasisDisabled); + return el; } function doCreateOrUpdateEl(api, existsEl, dataIndex, elOption, seriesModel, group) { - if ("development" !== 'production') { - assert(elOption, 'should not have an null/undefined element setting'); - } - - var toBeReplacedIdx = -1; - var oldEl = existsEl; - - if (existsEl && doesElNeedRecreate(existsEl, elOption, seriesModel) // || ( - // // PENDING: even in one-to-one mapping case, if el is marked as morph, - // // do not sure whether the el will be mapped to another el with different - // // hierarchy in Group tree. So always recreate el rather than reuse the el. - // morphHelper && morphHelper.isOneToOneFrom(el) - // ) - ) { - // Should keep at the original index, otherwise "merge by index" will be incorrect. - toBeReplacedIdx = indexOf(group.childrenRef(), existsEl); - existsEl = null; - } - - var isInit = !existsEl; - var el = existsEl; - - if (!el) { - el = createEl(elOption); - - if (oldEl) { - copyElement(oldEl, el); - } - } else { - // FIMXE:NEXT unified clearState? - // If in some case the performance issue arised, consider - // do not clearState but update cached normal state directly. - el.clearStates(); - } // Need to set morph: false explictly to disable automatically morphing. - - - if (elOption.morph === false) { - el.disableMorphing = true; - } else if (el.disableMorphing) { - el.disableMorphing = false; - } - - attachedTxInfoTmp.normal.cfg = attachedTxInfoTmp.normal.conOpt = attachedTxInfoTmp.emphasis.cfg = attachedTxInfoTmp.emphasis.conOpt = attachedTxInfoTmp.blur.cfg = attachedTxInfoTmp.blur.conOpt = attachedTxInfoTmp.select.cfg = attachedTxInfoTmp.select.conOpt = null; - attachedTxInfoTmp.isLegacy = false; - doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfoTmp); - doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit); - updateElNormal(api, el, dataIndex, elOption, attachedTxInfoTmp, seriesModel, isInit); // `elOption.info` enables user to mount some info on - // elements and use them in event handlers. - // Update them only when user specified, otherwise, remain. - - hasOwn(elOption, 'info') && (customInnerStore(el).info = elOption.info); - - for (var i = 0; i < STATES.length; i++) { - var stateName = STATES[i]; - - if (stateName !== NORMAL) { - var otherStateOpt = retrieveStateOption(elOption, stateName); - var otherStyleOpt = retrieveStyleOptionOnState(elOption, otherStateOpt, stateName); - updateElOnState(stateName, el, otherStateOpt, otherStyleOpt, attachedTxInfoTmp); - } - } - - updateZ$1(el, elOption, seriesModel); - - if (elOption.type === 'group') { - mergeChildren(api, el, dataIndex, elOption, seriesModel); - } - - if (toBeReplacedIdx >= 0) { - group.replaceAt(el, toBeReplacedIdx); - } else { - group.add(el); - } + if ("development" !== 'production') { + assert(elOption, 'should not have an null/undefined element setting'); + } + + var toBeReplacedIdx = -1; + var oldEl = existsEl; + + if (existsEl && doesElNeedRecreate(existsEl, elOption, seriesModel) // || ( + // // PENDING: even in one-to-one mapping case, if el is marked as morph, + // // do not sure whether the el will be mapped to another el with different + // // hierarchy in Group tree. So always recreate el rather than reuse the el. + // morphHelper && morphHelper.isOneToOneFrom(el) + // ) + ) { + // Should keep at the original index, otherwise "merge by index" will be incorrect. + toBeReplacedIdx = indexOf(group.childrenRef(), existsEl); + existsEl = null; + } + + var isInit = !existsEl; + var el = existsEl; + + if (!el) { + el = createEl(elOption); + + if (oldEl) { + copyElement(oldEl, el); + } + } else { + // FIMXE:NEXT unified clearState? + // If in some case the performance issue arised, consider + // do not clearState but update cached normal state directly. + el.clearStates(); + } // Need to set morph: false explictly to disable automatically morphing. + + + if (elOption.morph === false) { + el.disableMorphing = true; + } else if (el.disableMorphing) { + el.disableMorphing = false; + } + + attachedTxInfoTmp.normal.cfg = attachedTxInfoTmp.normal.conOpt = attachedTxInfoTmp.emphasis.cfg = attachedTxInfoTmp.emphasis.conOpt = attachedTxInfoTmp.blur.cfg = attachedTxInfoTmp.blur.conOpt = attachedTxInfoTmp.select.cfg = attachedTxInfoTmp.select.conOpt = null; + attachedTxInfoTmp.isLegacy = false; + doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfoTmp); + doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit); + updateElNormal(api, el, dataIndex, elOption, attachedTxInfoTmp, seriesModel, isInit); // `elOption.info` enables user to mount some info on + // elements and use them in event handlers. + // Update them only when user specified, otherwise, remain. + + hasOwn(elOption, 'info') && (customInnerStore(el).info = elOption.info); + + for (var i = 0; i < STATES.length; i++) { + var stateName = STATES[i]; + + if (stateName !== NORMAL) { + var otherStateOpt = retrieveStateOption(elOption, stateName); + var otherStyleOpt = retrieveStyleOptionOnState(elOption, otherStateOpt, stateName); + updateElOnState(stateName, el, otherStateOpt, otherStyleOpt, attachedTxInfoTmp); + } + } + + updateZ$1(el, elOption, seriesModel); + + if (elOption.type === 'group') { + mergeChildren(api, el, dataIndex, elOption, seriesModel); + } + + if (toBeReplacedIdx >= 0) { + group.replaceAt(el, toBeReplacedIdx); + } else { + group.add(el); + } - return el; + return el; } // `el` must not be null/undefined. function doesElNeedRecreate(el, elOption, seriesModel) { - var elInner = customInnerStore(el); - var elOptionType = elOption.type; - var elOptionShape = elOption.shape; - var elOptionStyle = elOption.style; - return (// Always create new if universal transition is enabled. - // Because we do transition after render. It needs to know what old element is. Replacement will loose it. - seriesModel.isUniversalTransitionEnabled() // If `elOptionType` is `null`, follow the merge principle. - || elOptionType != null && elOptionType !== elInner.customGraphicType || elOptionType === 'path' && hasOwnPathData(elOptionShape) && getPathData(elOptionShape) !== elInner.customPathData || elOptionType === 'image' && hasOwn(elOptionStyle, 'image') && elOptionStyle.image !== elInner.customImagePath // // FIXME test and remove this restriction? - // || (elOptionType === 'text' - // && hasOwn(elOptionStyle, 'text') - // && (elOptionStyle as TextStyleProps).text !== elInner.customText - // ) - - ); + var elInner = customInnerStore(el); + var elOptionType = elOption.type; + var elOptionShape = elOption.shape; + var elOptionStyle = elOption.style; + return (// Always create new if universal transition is enabled. + // Because we do transition after render. It needs to know what old element is. Replacement will loose it. + seriesModel.isUniversalTransitionEnabled() // If `elOptionType` is `null`, follow the merge principle. + || elOptionType != null && elOptionType !== elInner.customGraphicType || elOptionType === 'path' && hasOwnPathData(elOptionShape) && getPathData(elOptionShape) !== elInner.customPathData || elOptionType === 'image' && hasOwn(elOptionStyle, 'image') && elOptionStyle.image !== elInner.customImagePath // // FIXME test and remove this restriction? + // || (elOptionType === 'text' + // && hasOwn(elOptionStyle, 'text') + // && (elOptionStyle as TextStyleProps).text !== elInner.customText + // ) + + ); } function doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit) { - // Based on the "merge" principle, if no clipPath provided, - // do nothing. The exists clip will be totally removed only if - // `el.clipPath` is `false`. Otherwise it will be merged/replaced. - var clipPathOpt = elOption.clipPath; + // Based on the "merge" principle, if no clipPath provided, + // do nothing. The exists clip will be totally removed only if + // `el.clipPath` is `false`. Otherwise it will be merged/replaced. + var clipPathOpt = elOption.clipPath; - if (clipPathOpt === false) { - if (el && el.getClipPath()) { - el.removeClipPath(); - } - } else if (clipPathOpt) { - var clipPath = el.getClipPath(); + if (clipPathOpt === false) { + if (el && el.getClipPath()) { + el.removeClipPath(); + } + } else if (clipPathOpt) { + var clipPath = el.getClipPath(); - if (clipPath && doesElNeedRecreate(clipPath, clipPathOpt, seriesModel)) { - clipPath = null; - } + if (clipPath && doesElNeedRecreate(clipPath, clipPathOpt, seriesModel)) { + clipPath = null; + } - if (!clipPath) { - clipPath = createEl(clipPathOpt); + if (!clipPath) { + clipPath = createEl(clipPathOpt); - if ("development" !== 'production') { - assert(isPath$1(clipPath), 'Only any type of `path` can be used in `clipPath`, rather than ' + clipPath.type + '.'); - } + if ("development" !== 'production') { + assert(isPath$1(clipPath), 'Only any type of `path` can be used in `clipPath`, rather than ' + clipPath.type + '.'); + } - el.setClipPath(clipPath); - } + el.setClipPath(clipPath); + } - updateElNormal(null, clipPath, dataIndex, clipPathOpt, null, seriesModel, isInit); - } // If not define `clipPath` in option, do nothing unnecessary. + updateElNormal(null, clipPath, dataIndex, clipPathOpt, null, seriesModel, isInit); + } // If not define `clipPath` in option, do nothing unnecessary. } function doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfo) { - // group do not support textContent temporarily untill necessary. - if (el.isGroup) { - return; - } // Normal must be called before emphasis, for `isLegacy` detection. - - - processTxInfo(elOption, null, attachedTxInfo); - processTxInfo(elOption, EMPHASIS, attachedTxInfo); // If `elOption.textConfig` or `elOption.textContent` is null/undefined, it does not make sence. - // So for simplicity, if "elOption hasOwnProperty of them but be null/undefined", we do not - // trade them as set to null to el. - // Especially: - // `elOption.textContent: false` means remove textContent. - // `elOption.textContent.emphasis.style: false` means remove the style from emphasis state. + // group do not support textContent temporarily untill necessary. + if (el.isGroup) { + return; + } // Normal must be called before emphasis, for `isLegacy` detection. - var txConOptNormal = attachedTxInfo.normal.conOpt; - var txConOptEmphasis = attachedTxInfo.emphasis.conOpt; - var txConOptBlur = attachedTxInfo.blur.conOpt; - var txConOptSelect = attachedTxInfo.select.conOpt; - if (txConOptNormal != null || txConOptEmphasis != null || txConOptSelect != null || txConOptBlur != null) { - var textContent = el.getTextContent(); + processTxInfo(elOption, null, attachedTxInfo); + processTxInfo(elOption, EMPHASIS, attachedTxInfo); // If `elOption.textConfig` or `elOption.textContent` is null/undefined, it does not make sence. + // So for simplicity, if "elOption hasOwnProperty of them but be null/undefined", we do not + // trade them as set to null to el. + // Especially: + // `elOption.textContent: false` means remove textContent. + // `elOption.textContent.emphasis.style: false` means remove the style from emphasis state. - if (txConOptNormal === false) { - textContent && el.removeTextContent(); - } else { - txConOptNormal = attachedTxInfo.normal.conOpt = txConOptNormal || { - type: 'text' - }; + var txConOptNormal = attachedTxInfo.normal.conOpt; + var txConOptEmphasis = attachedTxInfo.emphasis.conOpt; + var txConOptBlur = attachedTxInfo.blur.conOpt; + var txConOptSelect = attachedTxInfo.select.conOpt; - if (!textContent) { - textContent = createEl(txConOptNormal); - el.setTextContent(textContent); - } else { - // If in some case the performance issue arised, consider - // do not clearState but update cached normal state directly. - textContent.clearStates(); - } + if (txConOptNormal != null || txConOptEmphasis != null || txConOptSelect != null || txConOptBlur != null) { + var textContent = el.getTextContent(); - updateElNormal(null, textContent, dataIndex, txConOptNormal, null, seriesModel, isInit); - var txConStlOptNormal = txConOptNormal && txConOptNormal.style; + if (txConOptNormal === false) { + textContent && el.removeTextContent(); + } else { + txConOptNormal = attachedTxInfo.normal.conOpt = txConOptNormal || { + type: 'text' + }; + + if (!textContent) { + textContent = createEl(txConOptNormal); + el.setTextContent(textContent); + } else { + // If in some case the performance issue arised, consider + // do not clearState but update cached normal state directly. + textContent.clearStates(); + } - for (var i = 0; i < STATES.length; i++) { - var stateName = STATES[i]; + updateElNormal(null, textContent, dataIndex, txConOptNormal, null, seriesModel, isInit); + var txConStlOptNormal = txConOptNormal && txConOptNormal.style; - if (stateName !== NORMAL) { - var txConOptOtherState = attachedTxInfo[stateName].conOpt; - updateElOnState(stateName, textContent, txConOptOtherState, retrieveStyleOptionOnState(txConOptNormal, txConOptOtherState, stateName), null); - } - } + for (var i = 0; i < STATES.length; i++) { + var stateName = STATES[i]; - txConStlOptNormal ? textContent.dirty() : textContent.markRedraw(); + if (stateName !== NORMAL) { + var txConOptOtherState = attachedTxInfo[stateName].conOpt; + updateElOnState(stateName, textContent, txConOptOtherState, retrieveStyleOptionOnState(txConOptNormal, txConOptOtherState, stateName), null); } + } + + txConStlOptNormal ? textContent.dirty() : textContent.markRedraw(); } + } } function processTxInfo(elOption, state, attachedTxInfo) { - var stateOpt = !state ? elOption : retrieveStateOption(elOption, state); - var styleOpt = !state ? elOption.style : retrieveStyleOptionOnState(elOption, stateOpt, EMPHASIS); - var elType = elOption.type; - var txCfg = stateOpt ? stateOpt.textConfig : null; - var txConOptNormal = elOption.textContent; - var txConOpt = !txConOptNormal ? null : !state ? txConOptNormal : retrieveStateOption(txConOptNormal, state); + var stateOpt = !state ? elOption : retrieveStateOption(elOption, state); + var styleOpt = !state ? elOption.style : retrieveStyleOptionOnState(elOption, stateOpt, EMPHASIS); + var elType = elOption.type; + var txCfg = stateOpt ? stateOpt.textConfig : null; + var txConOptNormal = elOption.textContent; + var txConOpt = !txConOptNormal ? null : !state ? txConOptNormal : retrieveStateOption(txConOptNormal, state); - if (styleOpt && ( // Because emphasis style has little info to detect legacy, - // if normal is legacy, emphasis is trade as legacy. - attachedTxInfo.isLegacy || isEC4CompatibleStyle(styleOpt, elType, !!txCfg, !!txConOpt))) { - attachedTxInfo.isLegacy = true; - var convertResult = convertFromEC4CompatibleStyle(styleOpt, elType, !state); // Explicitly specified `textConfig` and `textContent` has higher priority than - // the ones generated by legacy style. Otherwise if users use them and `api.style` - // at the same time, they not both work and hardly to known why. + if (styleOpt && ( // Because emphasis style has little info to detect legacy, + // if normal is legacy, emphasis is trade as legacy. + attachedTxInfo.isLegacy || isEC4CompatibleStyle(styleOpt, elType, !!txCfg, !!txConOpt))) { + attachedTxInfo.isLegacy = true; + var convertResult = convertFromEC4CompatibleStyle(styleOpt, elType, !state); // Explicitly specified `textConfig` and `textContent` has higher priority than + // the ones generated by legacy style. Otherwise if users use them and `api.style` + // at the same time, they not both work and hardly to known why. - if (!txCfg && convertResult.textConfig) { - txCfg = convertResult.textConfig; - } + if (!txCfg && convertResult.textConfig) { + txCfg = convertResult.textConfig; + } - if (!txConOpt && convertResult.textContent) { - txConOpt = convertResult.textContent; - } + if (!txConOpt && convertResult.textContent) { + txConOpt = convertResult.textContent; } + } - if (!state && txConOpt) { - var txConOptNormal_1 = txConOpt; // `textContent: {type: 'text'}`, the "type" is easy to be missing. So we tolerate it. + if (!state && txConOpt) { + var txConOptNormal_1 = txConOpt; // `textContent: {type: 'text'}`, the "type" is easy to be missing. So we tolerate it. - !txConOptNormal_1.type && (txConOptNormal_1.type = 'text'); + !txConOptNormal_1.type && (txConOptNormal_1.type = 'text'); - if ("development" !== 'production') { - // Do not tolerate incorret type for forward compat. - assert(txConOptNormal_1.type === 'text', 'textContent.type must be "text"'); - } + if ("development" !== 'production') { + // Do not tolerate incorret type for forward compat. + assert(txConOptNormal_1.type === 'text', 'textContent.type must be "text"'); } + } - var info = !state ? attachedTxInfo.normal : attachedTxInfo[state]; - info.cfg = txCfg; - info.conOpt = txConOpt; + var info = !state ? attachedTxInfo.normal : attachedTxInfo[state]; + info.cfg = txCfg; + info.conOpt = txConOpt; } function retrieveStateOption(elOption, state) { - return !state ? elOption : elOption ? elOption[state] : null; + return !state ? elOption : elOption ? elOption[state] : null; } function retrieveStyleOptionOnState(stateOptionNormal, stateOption, state) { - var style = stateOption && stateOption.style; + var style = stateOption && stateOption.style; - if (style == null && state === EMPHASIS && stateOptionNormal) { - style = stateOptionNormal.styleEmphasis; - } + if (style == null && state === EMPHASIS && stateOptionNormal) { + style = stateOptionNormal.styleEmphasis; + } - return style; + return style; } // Usage: // (1) By default, `elOption.$mergeChildren` is `'byIndex'`, which indicates that // the existing children will not be removed, and enables the feature that @@ -73762,67 +73762,67 @@ function mergeChildren(api, el, dataIndex, elOption, seriesModel) { - var newChildren = elOption.children; - var newLen = newChildren ? newChildren.length : 0; - var mergeChildren = elOption.$mergeChildren; // `diffChildrenByName` has been deprecated. + var newChildren = elOption.children; + var newLen = newChildren ? newChildren.length : 0; + var mergeChildren = elOption.$mergeChildren; // `diffChildrenByName` has been deprecated. - var byName = mergeChildren === 'byName' || elOption.diffChildrenByName; - var notMerge = mergeChildren === false; // For better performance on roam update, only enter if necessary. + var byName = mergeChildren === 'byName' || elOption.diffChildrenByName; + var notMerge = mergeChildren === false; // For better performance on roam update, only enter if necessary. - if (!newLen && !byName && !notMerge) { - return; - } - - if (byName) { - diffGroupChildren({ - api: api, - oldChildren: el.children() || [], - newChildren: newChildren || [], - dataIndex: dataIndex, - seriesModel: seriesModel, - group: el - }); - return; - } + if (!newLen && !byName && !notMerge) { + return; + } + + if (byName) { + diffGroupChildren({ + api: api, + oldChildren: el.children() || [], + newChildren: newChildren || [], + dataIndex: dataIndex, + seriesModel: seriesModel, + group: el + }); + return; + } - notMerge && el.removeAll(); // Mapping children of a group simply by index, which - // might be better performance. + notMerge && el.removeAll(); // Mapping children of a group simply by index, which + // might be better performance. - var index = 0; + var index = 0; - for (; index < newLen; index++) { - newChildren[index] && doCreateOrUpdateEl(api, el.childAt(index), dataIndex, newChildren[index], seriesModel, el); - } + for (; index < newLen; index++) { + newChildren[index] && doCreateOrUpdateEl(api, el.childAt(index), dataIndex, newChildren[index], seriesModel, el); + } - for (var i = el.childCount() - 1; i >= index; i--) { - // Do not supprot leave elements that are not mentioned in the latest - // `renderItem` return. Otherwise users may not have a clear and simple - // concept that how to contorl all of the elements. - var child = el.childAt(i); - applyLeaveTransition(child, customInnerStore(el).option, seriesModel); - } + for (var i = el.childCount() - 1; i >= index; i--) { + // Do not supprot leave elements that are not mentioned in the latest + // `renderItem` return. Otherwise users may not have a clear and simple + // concept that how to contorl all of the elements. + var child = el.childAt(i); + applyLeaveTransition(child, customInnerStore(el).option, seriesModel); + } } function diffGroupChildren(context) { - new DataDiffer(context.oldChildren, context.newChildren, getKey, getKey, context).add(processAddUpdate).update(processAddUpdate).remove(processRemove).execute(); + new DataDiffer(context.oldChildren, context.newChildren, getKey, getKey, context).add(processAddUpdate).update(processAddUpdate).remove(processRemove).execute(); } function getKey(item, idx) { - var name = item && item.name; - return name != null ? name : GROUP_DIFF_PREFIX + idx; + var name = item && item.name; + return name != null ? name : GROUP_DIFF_PREFIX + idx; } function processAddUpdate(newIndex, oldIndex) { - var context = this.context; - var childOption = newIndex != null ? context.newChildren[newIndex] : null; - var child = oldIndex != null ? context.oldChildren[oldIndex] : null; - doCreateOrUpdateEl(context.api, child, context.dataIndex, childOption, context.seriesModel, context.group); + var context = this.context; + var childOption = newIndex != null ? context.newChildren[newIndex] : null; + var child = oldIndex != null ? context.oldChildren[oldIndex] : null; + doCreateOrUpdateEl(context.api, child, context.dataIndex, childOption, context.seriesModel, context.group); } function processRemove(oldIndex) { - var context = this.context; - var child = context.oldChildren[oldIndex]; - applyLeaveTransition(child, customInnerStore(child).option, context.seriesModel); + var context = this.context; + var child = context.oldChildren[oldIndex]; + applyLeaveTransition(child, customInnerStore(child).option, context.seriesModel); } /** * @return SVG Path data. @@ -73830,17 +73830,17 @@ function getPathData(shape) { - // "d" follows the SVG convention. - return shape && (shape.pathData || shape.d); + // "d" follows the SVG convention. + return shape && (shape.pathData || shape.d); } function hasOwnPathData(shape) { - return shape && (hasOwn(shape, 'pathData') || hasOwn(shape, 'd')); + return shape && (hasOwn(shape, 'pathData') || hasOwn(shape, 'd')); } function install$r(registers) { - registers.registerChartView(CustomChartView); - registers.registerSeriesModel(CustomSeriesModel); + registers.registerChartView(CustomChartView); + registers.registerSeriesModel(CustomSeriesModel); } var inner$a = makeInner(); @@ -73851,756 +73851,756 @@ */ var BaseAxisPointer = - /** @class */ - function () { - function BaseAxisPointer() { - this._dragging = false; - /** - * In px, arbitrary value. Do not set too small, - * no animation is ok for most cases. - */ - - this.animationThreshold = 15; - } - /** - * @implement - */ - - - BaseAxisPointer.prototype.render = function (axisModel, axisPointerModel, api, forceRender) { - var value = axisPointerModel.get('value'); - var status = axisPointerModel.get('status'); // Bind them to `this`, not in closure, otherwise they will not - // be replaced when user calling setOption in not merge mode. + /** @class */ + function () { + function BaseAxisPointer() { + this._dragging = false; + /** + * In px, arbitrary value. Do not set too small, + * no animation is ok for most cases. + */ - this._axisModel = axisModel; - this._axisPointerModel = axisPointerModel; - this._api = api; // Optimize: `render` will be called repeatly during mouse move. - // So it is power consuming if performing `render` each time, - // especially on mobile device. + this.animationThreshold = 15; + } + /** + * @implement + */ - if (!forceRender && this._lastValue === value && this._lastStatus === status) { - return; - } - this._lastValue = value; - this._lastStatus = status; - var group = this._group; - var handle = this._handle; + BaseAxisPointer.prototype.render = function (axisModel, axisPointerModel, api, forceRender) { + var value = axisPointerModel.get('value'); + var status = axisPointerModel.get('status'); // Bind them to `this`, not in closure, otherwise they will not + // be replaced when user calling setOption in not merge mode. - if (!status || status === 'hide') { - // Do not clear here, for animation better. - group && group.hide(); - handle && handle.hide(); - return; - } + this._axisModel = axisModel; + this._axisPointerModel = axisPointerModel; + this._api = api; // Optimize: `render` will be called repeatly during mouse move. + // So it is power consuming if performing `render` each time, + // especially on mobile device. - group && group.show(); - handle && handle.show(); // Otherwise status is 'show' + if (!forceRender && this._lastValue === value && this._lastStatus === status) { + return; + } - var elOption = {}; - this.makeElOption(elOption, value, axisModel, axisPointerModel, api); // Enable change axis pointer type. + this._lastValue = value; + this._lastStatus = status; + var group = this._group; + var handle = this._handle; - var graphicKey = elOption.graphicKey; + if (!status || status === 'hide') { + // Do not clear here, for animation better. + group && group.hide(); + handle && handle.hide(); + return; + } - if (graphicKey !== this._lastGraphicKey) { - this.clear(api); - } + group && group.show(); + handle && handle.show(); // Otherwise status is 'show' - this._lastGraphicKey = graphicKey; - var moveAnimation = this._moveAnimation = this.determineAnimation(axisModel, axisPointerModel); + var elOption = {}; + this.makeElOption(elOption, value, axisModel, axisPointerModel, api); // Enable change axis pointer type. - if (!group) { - group = this._group = new Group(); - this.createPointerEl(group, elOption, axisModel, axisPointerModel); - this.createLabelEl(group, elOption, axisModel, axisPointerModel); - api.getZr().add(group); - } else { - var doUpdateProps = curry(updateProps$1, axisPointerModel, moveAnimation); - this.updatePointerEl(group, elOption, doUpdateProps); - this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel); - } + var graphicKey = elOption.graphicKey; - updateMandatoryProps(group, axisPointerModel, true); + if (graphicKey !== this._lastGraphicKey) { + this.clear(api); + } - this._renderHandle(value); - }; - /** - * @implement - */ + this._lastGraphicKey = graphicKey; + var moveAnimation = this._moveAnimation = this.determineAnimation(axisModel, axisPointerModel); + if (!group) { + group = this._group = new Group(); + this.createPointerEl(group, elOption, axisModel, axisPointerModel); + this.createLabelEl(group, elOption, axisModel, axisPointerModel); + api.getZr().add(group); + } else { + var doUpdateProps = curry(updateProps$1, axisPointerModel, moveAnimation); + this.updatePointerEl(group, elOption, doUpdateProps); + this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel); + } - BaseAxisPointer.prototype.remove = function (api) { - this.clear(api); - }; - /** - * @implement - */ + updateMandatoryProps(group, axisPointerModel, true); + this._renderHandle(value); + }; + /** + * @implement + */ - BaseAxisPointer.prototype.dispose = function (api) { - this.clear(api); - }; - /** - * @protected - */ + BaseAxisPointer.prototype.remove = function (api) { + this.clear(api); + }; + /** + * @implement + */ - BaseAxisPointer.prototype.determineAnimation = function (axisModel, axisPointerModel) { - var animation = axisPointerModel.get('animation'); - var axis = axisModel.axis; - var isCategoryAxis = axis.type === 'category'; - var useSnap = axisPointerModel.get('snap'); // Value axis without snap always do not snap. - if (!useSnap && !isCategoryAxis) { - return false; - } + BaseAxisPointer.prototype.dispose = function (api) { + this.clear(api); + }; + /** + * @protected + */ - if (animation === 'auto' || animation == null) { - var animationThreshold = this.animationThreshold; - if (isCategoryAxis && axis.getBandWidth() > animationThreshold) { - return true; - } // It is important to auto animation when snap used. Consider if there is - // a dataZoom, animation will be disabled when too many points exist, while - // it will be enabled for better visual effect when little points exist. + BaseAxisPointer.prototype.determineAnimation = function (axisModel, axisPointerModel) { + var animation = axisPointerModel.get('animation'); + var axis = axisModel.axis; + var isCategoryAxis = axis.type === 'category'; + var useSnap = axisPointerModel.get('snap'); // Value axis without snap always do not snap. + if (!useSnap && !isCategoryAxis) { + return false; + } - if (useSnap) { - var seriesDataCount = getAxisInfo(axisModel).seriesDataCount; - var axisExtent = axis.getExtent(); // Approximate band width + if (animation === 'auto' || animation == null) { + var animationThreshold = this.animationThreshold; - return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold; - } + if (isCategoryAxis && axis.getBandWidth() > animationThreshold) { + return true; + } // It is important to auto animation when snap used. Consider if there is + // a dataZoom, animation will be disabled when too many points exist, while + // it will be enabled for better visual effect when little points exist. - return false; - } - return animation === true; - }; - /** - * add {pointer, label, graphicKey} to elOption - * @protected - */ + if (useSnap) { + var seriesDataCount = getAxisInfo(axisModel).seriesDataCount; + var axisExtent = axis.getExtent(); // Approximate band width + return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold; + } - BaseAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {// Shoule be implemenented by sub-class. - }; - /** - * @protected - */ + return false; + } + return animation === true; + }; + /** + * add {pointer, label, graphicKey} to elOption + * @protected + */ - BaseAxisPointer.prototype.createPointerEl = function (group, elOption, axisModel, axisPointerModel) { - var pointerOption = elOption.pointer; - if (pointerOption) { - var pointerEl = inner$a(group).pointerEl = new graphic[pointerOption.type](clone$3(elOption.pointer)); - group.add(pointerEl); - } - }; - /** - * @protected - */ + BaseAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {// Shoule be implemenented by sub-class. + }; + /** + * @protected + */ - BaseAxisPointer.prototype.createLabelEl = function (group, elOption, axisModel, axisPointerModel) { - if (elOption.label) { - var labelEl = inner$a(group).labelEl = new ZRText(clone$3(elOption.label)); - group.add(labelEl); - updateLabelShowHide(labelEl, axisPointerModel); - } - }; - /** - * @protected - */ + BaseAxisPointer.prototype.createPointerEl = function (group, elOption, axisModel, axisPointerModel) { + var pointerOption = elOption.pointer; + if (pointerOption) { + var pointerEl = inner$a(group).pointerEl = new graphic[pointerOption.type](clone$3(elOption.pointer)); + group.add(pointerEl); + } + }; + /** + * @protected + */ - BaseAxisPointer.prototype.updatePointerEl = function (group, elOption, updateProps) { - var pointerEl = inner$a(group).pointerEl; - if (pointerEl && elOption.pointer) { - pointerEl.setStyle(elOption.pointer.style); - updateProps(pointerEl, { - shape: elOption.pointer.shape - }); - } - }; - /** - * @protected - */ + BaseAxisPointer.prototype.createLabelEl = function (group, elOption, axisModel, axisPointerModel) { + if (elOption.label) { + var labelEl = inner$a(group).labelEl = new ZRText(clone$3(elOption.label)); + group.add(labelEl); + updateLabelShowHide(labelEl, axisPointerModel); + } + }; + /** + * @protected + */ - BaseAxisPointer.prototype.updateLabelEl = function (group, elOption, updateProps, axisPointerModel) { - var labelEl = inner$a(group).labelEl; + BaseAxisPointer.prototype.updatePointerEl = function (group, elOption, updateProps) { + var pointerEl = inner$a(group).pointerEl; - if (labelEl) { - labelEl.setStyle(elOption.label.style); - updateProps(labelEl, { - // Consider text length change in vertical axis, animation should - // be used on shape, otherwise the effect will be weird. - // TODOTODO - // shape: elOption.label.shape, - x: elOption.label.x, - y: elOption.label.y - }); - updateLabelShowHide(labelEl, axisPointerModel); - } - }; - /** - * @private - */ + if (pointerEl && elOption.pointer) { + pointerEl.setStyle(elOption.pointer.style); + updateProps(pointerEl, { + shape: elOption.pointer.shape + }); + } + }; + /** + * @protected + */ - BaseAxisPointer.prototype._renderHandle = function (value) { - if (this._dragging || !this.updateHandleTransform) { - return; - } + BaseAxisPointer.prototype.updateLabelEl = function (group, elOption, updateProps, axisPointerModel) { + var labelEl = inner$a(group).labelEl; + + if (labelEl) { + labelEl.setStyle(elOption.label.style); + updateProps(labelEl, { + // Consider text length change in vertical axis, animation should + // be used on shape, otherwise the effect will be weird. + // TODOTODO + // shape: elOption.label.shape, + x: elOption.label.x, + y: elOption.label.y + }); + updateLabelShowHide(labelEl, axisPointerModel); + } + }; + /** + * @private + */ - var axisPointerModel = this._axisPointerModel; - var zr = this._api.getZr(); + BaseAxisPointer.prototype._renderHandle = function (value) { + if (this._dragging || !this.updateHandleTransform) { + return; + } - var handle = this._handle; - var handleModel = axisPointerModel.getModel('handle'); - var status = axisPointerModel.get('status'); + var axisPointerModel = this._axisPointerModel; - if (!handleModel.get('show') || !status || status === 'hide') { - handle && zr.remove(handle); - this._handle = null; - return; - } + var zr = this._api.getZr(); - var isInit; + var handle = this._handle; + var handleModel = axisPointerModel.getModel('handle'); + var status = axisPointerModel.get('status'); - if (!this._handle) { - isInit = true; - handle = this._handle = createIcon(handleModel.get('icon'), { - cursor: 'move', - draggable: true, - onmousemove: function (e) { - // Fot mobile devicem, prevent screen slider on the button. - stop(e.event); - }, - onmousedown: bind$1(this._onHandleDragMove, this, 0, 0), - drift: bind$1(this._onHandleDragMove, this), - ondragend: bind$1(this._onHandleDragEnd, this) - }); - zr.add(handle); - } + if (!handleModel.get('show') || !status || status === 'hide') { + handle && zr.remove(handle); + this._handle = null; + return; + } - updateMandatoryProps(handle, axisPointerModel, false); // update style + var isInit; - handle.setStyle(handleModel.getItemStyle(null, ['color', 'borderColor', 'borderWidth', 'opacity', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'])); // update position + if (!this._handle) { + isInit = true; + handle = this._handle = createIcon(handleModel.get('icon'), { + cursor: 'move', + draggable: true, + onmousemove: function (e) { + // Fot mobile devicem, prevent screen slider on the button. + stop(e.event); + }, + onmousedown: bind$1(this._onHandleDragMove, this, 0, 0), + drift: bind$1(this._onHandleDragMove, this), + ondragend: bind$1(this._onHandleDragEnd, this) + }); + zr.add(handle); + } - var handleSize = handleModel.get('size'); + updateMandatoryProps(handle, axisPointerModel, false); // update style - if (!isArray(handleSize)) { - handleSize = [handleSize, handleSize]; - } + handle.setStyle(handleModel.getItemStyle(null, ['color', 'borderColor', 'borderWidth', 'opacity', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'])); // update position - handle.scaleX = handleSize[0] / 2; - handle.scaleY = handleSize[1] / 2; - createOrUpdate(this, '_doDispatchAxisPointer', handleModel.get('throttle') || 0, 'fixRate'); + var handleSize = handleModel.get('size'); - this._moveHandleToValue(value, isInit); - }; + if (!isArray(handleSize)) { + handleSize = [handleSize, handleSize]; + } - BaseAxisPointer.prototype._moveHandleToValue = function (value, isInit) { - updateProps$1(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel))); - }; + handle.scaleX = handleSize[0] / 2; + handle.scaleY = handleSize[1] / 2; + createOrUpdate(this, '_doDispatchAxisPointer', handleModel.get('throttle') || 0, 'fixRate'); - BaseAxisPointer.prototype._onHandleDragMove = function (dx, dy) { - var handle = this._handle; + this._moveHandleToValue(value, isInit); + }; - if (!handle) { - return; - } + BaseAxisPointer.prototype._moveHandleToValue = function (value, isInit) { + updateProps$1(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel))); + }; - this._dragging = true; // Persistent for throttle. + BaseAxisPointer.prototype._onHandleDragMove = function (dx, dy) { + var handle = this._handle; - var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel); - this._payloadInfo = trans; - handle.stopAnimation(); - handle.attr(getHandleTransProps(trans)); - inner$a(handle).lastProp = null; + if (!handle) { + return; + } - this._doDispatchAxisPointer(); - }; - /** - * Throttled method. - */ + this._dragging = true; // Persistent for throttle. + var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel); + this._payloadInfo = trans; + handle.stopAnimation(); + handle.attr(getHandleTransProps(trans)); + inner$a(handle).lastProp = null; - BaseAxisPointer.prototype._doDispatchAxisPointer = function () { - var handle = this._handle; + this._doDispatchAxisPointer(); + }; + /** + * Throttled method. + */ - if (!handle) { - return; - } - var payloadInfo = this._payloadInfo; - var axisModel = this._axisModel; + BaseAxisPointer.prototype._doDispatchAxisPointer = function () { + var handle = this._handle; - this._api.dispatchAction({ - type: 'updateAxisPointer', - x: payloadInfo.cursorPoint[0], - y: payloadInfo.cursorPoint[1], - tooltipOption: payloadInfo.tooltipOption, - axesInfo: [{ - axisDim: axisModel.axis.dim, - axisIndex: axisModel.componentIndex - }] - }); - }; + if (!handle) { + return; + } - BaseAxisPointer.prototype._onHandleDragEnd = function () { - this._dragging = false; - var handle = this._handle; + var payloadInfo = this._payloadInfo; + var axisModel = this._axisModel; - if (!handle) { - return; - } + this._api.dispatchAction({ + type: 'updateAxisPointer', + x: payloadInfo.cursorPoint[0], + y: payloadInfo.cursorPoint[1], + tooltipOption: payloadInfo.tooltipOption, + axesInfo: [{ + axisDim: axisModel.axis.dim, + axisIndex: axisModel.componentIndex + }] + }); + }; - var value = this._axisPointerModel.get('value'); // Consider snap or categroy axis, handle may be not consistent with - // axisPointer. So move handle to align the exact value position when - // drag ended. + BaseAxisPointer.prototype._onHandleDragEnd = function () { + this._dragging = false; + var handle = this._handle; + if (!handle) { + return; + } - this._moveHandleToValue(value); // For the effect: tooltip will be shown when finger holding on handle - // button, and will be hidden after finger left handle button. + var value = this._axisPointerModel.get('value'); // Consider snap or categroy axis, handle may be not consistent with + // axisPointer. So move handle to align the exact value position when + // drag ended. - this._api.dispatchAction({ - type: 'hideTip' - }); - }; - /** - * @private - */ + this._moveHandleToValue(value); // For the effect: tooltip will be shown when finger holding on handle + // button, and will be hidden after finger left handle button. - BaseAxisPointer.prototype.clear = function (api) { - this._lastValue = null; - this._lastStatus = null; - var zr = api.getZr(); - var group = this._group; - var handle = this._handle; + this._api.dispatchAction({ + type: 'hideTip' + }); + }; + /** + * @private + */ - if (zr && group) { - this._lastGraphicKey = null; - group && zr.remove(group); - handle && zr.remove(handle); - this._group = null; - this._handle = null; - this._payloadInfo = null; - } - clear(this, '_doDispatchAxisPointer'); - }; - /** - * @protected - */ + BaseAxisPointer.prototype.clear = function (api) { + this._lastValue = null; + this._lastStatus = null; + var zr = api.getZr(); + var group = this._group; + var handle = this._handle; + + if (zr && group) { + this._lastGraphicKey = null; + group && zr.remove(group); + handle && zr.remove(handle); + this._group = null; + this._handle = null; + this._payloadInfo = null; + } + + clear(this, '_doDispatchAxisPointer'); + }; + /** + * @protected + */ - BaseAxisPointer.prototype.doClear = function () {// Implemented by sub-class if necessary. - }; + BaseAxisPointer.prototype.doClear = function () {// Implemented by sub-class if necessary. + }; - BaseAxisPointer.prototype.buildLabel = function (xy, wh, xDimIndex) { - xDimIndex = xDimIndex || 0; - return { - x: xy[xDimIndex], - y: xy[1 - xDimIndex], - width: wh[xDimIndex], - height: wh[1 - xDimIndex] - }; - }; + BaseAxisPointer.prototype.buildLabel = function (xy, wh, xDimIndex) { + xDimIndex = xDimIndex || 0; + return { + x: xy[xDimIndex], + y: xy[1 - xDimIndex], + width: wh[xDimIndex], + height: wh[1 - xDimIndex] + }; + }; - return BaseAxisPointer; - }(); + return BaseAxisPointer; + }(); function updateProps$1(animationModel, moveAnimation, el, props) { - // Animation optimize. - if (!propsEqual(inner$a(el).lastProp, props)) { - inner$a(el).lastProp = props; - moveAnimation ? updateProps(el, props, animationModel) : (el.stopAnimation(), el.attr(props)); - } + // Animation optimize. + if (!propsEqual(inner$a(el).lastProp, props)) { + inner$a(el).lastProp = props; + moveAnimation ? updateProps(el, props, animationModel) : (el.stopAnimation(), el.attr(props)); + } } function propsEqual(lastProps, newProps) { - if (isObject(lastProps) && isObject(newProps)) { - var equals_1 = true; - each(newProps, function (item, key) { - equals_1 = equals_1 && propsEqual(lastProps[key], item); - }); - return !!equals_1; - } else { - return lastProps === newProps; - } + if (isObject(lastProps) && isObject(newProps)) { + var equals_1 = true; + each(newProps, function (item, key) { + equals_1 = equals_1 && propsEqual(lastProps[key], item); + }); + return !!equals_1; + } else { + return lastProps === newProps; + } } function updateLabelShowHide(labelEl, axisPointerModel) { - labelEl[axisPointerModel.get(['label', 'show']) ? 'show' : 'hide'](); + labelEl[axisPointerModel.get(['label', 'show']) ? 'show' : 'hide'](); } function getHandleTransProps(trans) { - return { - x: trans.x || 0, - y: trans.y || 0, - rotation: trans.rotation || 0 - }; + return { + x: trans.x || 0, + y: trans.y || 0, + rotation: trans.rotation || 0 + }; } function updateMandatoryProps(group, axisPointerModel, silent) { - var z = axisPointerModel.get('z'); - var zlevel = axisPointerModel.get('zlevel'); - group && group.traverse(function (el) { - if (el.type !== 'group') { - z != null && (el.z = z); - zlevel != null && (el.zlevel = zlevel); - el.silent = silent; - } - }); + var z = axisPointerModel.get('z'); + var zlevel = axisPointerModel.get('zlevel'); + group && group.traverse(function (el) { + if (el.type !== 'group') { + z != null && (el.z = z); + zlevel != null && (el.zlevel = zlevel); + el.silent = silent; + } + }); } function buildElStyle(axisPointerModel) { - var axisPointerType = axisPointerModel.get('type'); - var styleModel = axisPointerModel.getModel(axisPointerType + 'Style'); - var style; + var axisPointerType = axisPointerModel.get('type'); + var styleModel = axisPointerModel.getModel(axisPointerType + 'Style'); + var style; - if (axisPointerType === 'line') { - style = styleModel.getLineStyle(); - style.fill = null; - } else if (axisPointerType === 'shadow') { - style = styleModel.getAreaStyle(); - style.stroke = null; - } + if (axisPointerType === 'line') { + style = styleModel.getLineStyle(); + style.fill = null; + } else if (axisPointerType === 'shadow') { + style = styleModel.getAreaStyle(); + style.stroke = null; + } - return style; + return style; } /** * @param {Function} labelPos {align, verticalAlign, position} */ function buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos) { - var value = axisPointerModel.get('value'); - var text = getValueLabel(value, axisModel.axis, axisModel.ecModel, axisPointerModel.get('seriesDataIndices'), { - precision: axisPointerModel.get(['label', 'precision']), - formatter: axisPointerModel.get(['label', 'formatter']) - }); - var labelModel = axisPointerModel.getModel('label'); - var paddings = normalizeCssArray$1(labelModel.get('padding') || 0); - var font = labelModel.getFont(); - var textRect = getBoundingRect(text, font); - var position = labelPos.position; - var width = textRect.width + paddings[1] + paddings[3]; - var height = textRect.height + paddings[0] + paddings[2]; // Adjust by align. - - var align = labelPos.align; - align === 'right' && (position[0] -= width); - align === 'center' && (position[0] -= width / 2); - var verticalAlign = labelPos.verticalAlign; - verticalAlign === 'bottom' && (position[1] -= height); - verticalAlign === 'middle' && (position[1] -= height / 2); // Not overflow ec container - - confineInContainer(position, width, height, api); - var bgColor = labelModel.get('backgroundColor'); - - if (!bgColor || bgColor === 'auto') { - bgColor = axisModel.get(['axisLine', 'lineStyle', 'color']); - } - - elOption.label = { - // shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')}, - x: position[0], - y: position[1], - style: createTextStyle(labelModel, { - text: text, - font: font, - fill: labelModel.getTextColor(), - padding: paddings, - backgroundColor: bgColor - }), - // Lable should be over axisPointer. - z2: 10 - }; + var value = axisPointerModel.get('value'); + var text = getValueLabel(value, axisModel.axis, axisModel.ecModel, axisPointerModel.get('seriesDataIndices'), { + precision: axisPointerModel.get(['label', 'precision']), + formatter: axisPointerModel.get(['label', 'formatter']) + }); + var labelModel = axisPointerModel.getModel('label'); + var paddings = normalizeCssArray$1(labelModel.get('padding') || 0); + var font = labelModel.getFont(); + var textRect = getBoundingRect(text, font); + var position = labelPos.position; + var width = textRect.width + paddings[1] + paddings[3]; + var height = textRect.height + paddings[0] + paddings[2]; // Adjust by align. + + var align = labelPos.align; + align === 'right' && (position[0] -= width); + align === 'center' && (position[0] -= width / 2); + var verticalAlign = labelPos.verticalAlign; + verticalAlign === 'bottom' && (position[1] -= height); + verticalAlign === 'middle' && (position[1] -= height / 2); // Not overflow ec container + + confineInContainer(position, width, height, api); + var bgColor = labelModel.get('backgroundColor'); + + if (!bgColor || bgColor === 'auto') { + bgColor = axisModel.get(['axisLine', 'lineStyle', 'color']); + } + + elOption.label = { + // shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')}, + x: position[0], + y: position[1], + style: createTextStyle(labelModel, { + text: text, + font: font, + fill: labelModel.getTextColor(), + padding: paddings, + backgroundColor: bgColor + }), + // Lable should be over axisPointer. + z2: 10 + }; } // Do not overflow ec container function confineInContainer(position, width, height, api) { - var viewWidth = api.getWidth(); - var viewHeight = api.getHeight(); - position[0] = Math.min(position[0] + width, viewWidth) - width; - position[1] = Math.min(position[1] + height, viewHeight) - height; - position[0] = Math.max(position[0], 0); - position[1] = Math.max(position[1], 0); + var viewWidth = api.getWidth(); + var viewHeight = api.getHeight(); + position[0] = Math.min(position[0] + width, viewWidth) - width; + position[1] = Math.min(position[1] + height, viewHeight) - height; + position[0] = Math.max(position[0], 0); + position[1] = Math.max(position[1], 0); } function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) { - value = axis.scale.parse(value); - var text = axis.scale.getLabel({ + value = axis.scale.parse(value); + var text = axis.scale.getLabel({ + value: value + }, { + // If `precision` is set, width can be fixed (like '12.00500'), which + // helps to debounce when when moving label. + precision: opt.precision + }); + var formatter = opt.formatter; + + if (formatter) { + var params_1 = { + value: getAxisRawValue(axis, { value: value - }, { - // If `precision` is set, width can be fixed (like '12.00500'), which - // helps to debounce when when moving label. - precision: opt.precision + }), + axisDimension: axis.dim, + axisIndex: axis.index, + seriesData: [] + }; + each(seriesDataIndices, function (idxItem) { + var series = ecModel.getSeriesByIndex(idxItem.seriesIndex); + var dataIndex = idxItem.dataIndexInside; + var dataParams = series && series.getDataParams(dataIndex); + dataParams && params_1.seriesData.push(dataParams); }); - var formatter = opt.formatter; - - if (formatter) { - var params_1 = { - value: getAxisRawValue(axis, { - value: value - }), - axisDimension: axis.dim, - axisIndex: axis.index, - seriesData: [] - }; - each(seriesDataIndices, function (idxItem) { - var series = ecModel.getSeriesByIndex(idxItem.seriesIndex); - var dataIndex = idxItem.dataIndexInside; - var dataParams = series && series.getDataParams(dataIndex); - dataParams && params_1.seriesData.push(dataParams); - }); - if (isString(formatter)) { - text = formatter.replace('{value}', text); - } else if (isFunction(formatter)) { - text = formatter(params_1); - } + if (isString(formatter)) { + text = formatter.replace('{value}', text); + } else if (isFunction(formatter)) { + text = formatter(params_1); } + } - return text; + return text; } function getTransformedPosition(axis, value, layoutInfo) { - var transform = create$1(); - rotate(transform, transform, layoutInfo.rotation); - translate(transform, transform, layoutInfo.position); - return applyTransform$1([axis.dataToCoord(value), (layoutInfo.labelOffset || 0) + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0)], transform); + var transform = create$1(); + rotate(transform, transform, layoutInfo.rotation); + translate(transform, transform, layoutInfo.position); + return applyTransform$1([axis.dataToCoord(value), (layoutInfo.labelOffset || 0) + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0)], transform); } function buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api) { - // @ts-ignore - var textLayout = AxisBuilder.innerTextLayout(layoutInfo.rotation, 0, layoutInfo.labelDirection); - layoutInfo.labelMargin = axisPointerModel.get(['label', 'margin']); - buildLabelElOption(elOption, axisModel, axisPointerModel, api, { - position: getTransformedPosition(axisModel.axis, value, layoutInfo), - align: textLayout.textAlign, - verticalAlign: textLayout.textVerticalAlign - }); + // @ts-ignore + var textLayout = AxisBuilder.innerTextLayout(layoutInfo.rotation, 0, layoutInfo.labelDirection); + layoutInfo.labelMargin = axisPointerModel.get(['label', 'margin']); + buildLabelElOption(elOption, axisModel, axisPointerModel, api, { + position: getTransformedPosition(axisModel.axis, value, layoutInfo), + align: textLayout.textAlign, + verticalAlign: textLayout.textVerticalAlign + }); } function makeLineShape(p1, p2, xDimIndex) { - xDimIndex = xDimIndex || 0; - return { - x1: p1[xDimIndex], - y1: p1[1 - xDimIndex], - x2: p2[xDimIndex], - y2: p2[1 - xDimIndex] - }; + xDimIndex = xDimIndex || 0; + return { + x1: p1[xDimIndex], + y1: p1[1 - xDimIndex], + x2: p2[xDimIndex], + y2: p2[1 - xDimIndex] + }; } function makeRectShape(xy, wh, xDimIndex) { - xDimIndex = xDimIndex || 0; - return { - x: xy[xDimIndex], - y: xy[1 - xDimIndex], - width: wh[xDimIndex], - height: wh[1 - xDimIndex] - }; + xDimIndex = xDimIndex || 0; + return { + x: xy[xDimIndex], + y: xy[1 - xDimIndex], + width: wh[xDimIndex], + height: wh[1 - xDimIndex] + }; } function makeSectorShape(cx, cy, r0, r, startAngle, endAngle) { - return { - cx: cx, - cy: cy, - r0: r0, - r: r, - startAngle: startAngle, - endAngle: endAngle, - clockwise: true - }; + return { + cx: cx, + cy: cy, + r0: r0, + r: r, + startAngle: startAngle, + endAngle: endAngle, + clockwise: true + }; } var CartesianAxisPointer = - /** @class */ - function (_super) { - __extends(CartesianAxisPointer, _super); - - function CartesianAxisPointer() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * @override - */ - - - CartesianAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) { - var axis = axisModel.axis; - var grid = axis.grid; - var axisPointerType = axisPointerModel.get('type'); - var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent(); - var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true)); + /** @class */ + function (_super) { + __extends(CartesianAxisPointer, _super); + + function CartesianAxisPointer() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * @override + */ - if (axisPointerType && axisPointerType !== 'none') { - var elStyle = buildElStyle(axisPointerModel); - var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent); - pointerOption.style = elStyle; - elOption.graphicKey = pointerOption.type; - elOption.pointer = pointerOption; - } - var layoutInfo = layout$1(grid.model, axisModel); - buildCartesianSingleLabelElOption( // @ts-ignore - value, elOption, layoutInfo, axisModel, axisPointerModel, api); - }; - /** - * @override - */ + CartesianAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) { + var axis = axisModel.axis; + var grid = axis.grid; + var axisPointerType = axisPointerModel.get('type'); + var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent(); + var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true)); + + if (axisPointerType && axisPointerType !== 'none') { + var elStyle = buildElStyle(axisPointerModel); + var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent); + pointerOption.style = elStyle; + elOption.graphicKey = pointerOption.type; + elOption.pointer = pointerOption; + } + + var layoutInfo = layout$1(grid.model, axisModel); + buildCartesianSingleLabelElOption( // @ts-ignore + value, elOption, layoutInfo, axisModel, axisPointerModel, api); + }; + /** + * @override + */ - CartesianAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) { - var layoutInfo = layout$1(axisModel.axis.grid.model, axisModel, { - labelInside: false - }); // @ts-ignore + CartesianAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) { + var layoutInfo = layout$1(axisModel.axis.grid.model, axisModel, { + labelInside: false + }); // @ts-ignore - layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']); - var pos = getTransformedPosition(axisModel.axis, value, layoutInfo); - return { - x: pos[0], - y: pos[1], - rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0) - }; - }; - /** - * @override - */ + layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']); + var pos = getTransformedPosition(axisModel.axis, value, layoutInfo); + return { + x: pos[0], + y: pos[1], + rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0) + }; + }; + /** + * @override + */ - CartesianAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) { - var axis = axisModel.axis; - var grid = axis.grid; - var axisExtent = axis.getGlobalExtent(true); - var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent(); - var dimIndex = axis.dim === 'x' ? 0 : 1; - var currPosition = [transform.x, transform.y]; - currPosition[dimIndex] += delta[dimIndex]; - currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]); - currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]); - var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2; - var cursorPoint = [cursorOtherValue, cursorOtherValue]; - cursorPoint[dimIndex] = currPosition[dimIndex]; // Make tooltip do not overlap axisPointer and in the middle of the grid. - - var tooltipOptions = [{ - verticalAlign: 'middle' - }, { - align: 'center' - }]; - return { - x: currPosition[0], - y: currPosition[1], - rotation: transform.rotation, - cursorPoint: cursorPoint, - tooltipOption: tooltipOptions[dimIndex] - }; - }; + CartesianAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) { + var axis = axisModel.axis; + var grid = axis.grid; + var axisExtent = axis.getGlobalExtent(true); + var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent(); + var dimIndex = axis.dim === 'x' ? 0 : 1; + var currPosition = [transform.x, transform.y]; + currPosition[dimIndex] += delta[dimIndex]; + currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]); + currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]); + var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2; + var cursorPoint = [cursorOtherValue, cursorOtherValue]; + cursorPoint[dimIndex] = currPosition[dimIndex]; // Make tooltip do not overlap axisPointer and in the middle of the grid. + + var tooltipOptions = [{ + verticalAlign: 'middle' + }, { + align: 'center' + }]; + return { + x: currPosition[0], + y: currPosition[1], + rotation: transform.rotation, + cursorPoint: cursorPoint, + tooltipOption: tooltipOptions[dimIndex] + }; + }; - return CartesianAxisPointer; - }(BaseAxisPointer); + return CartesianAxisPointer; + }(BaseAxisPointer); function getCartesian(grid, axis) { - var opt = {}; - opt[axis.dim + 'AxisIndex'] = axis.index; - return grid.getCartesian(opt); + var opt = {}; + opt[axis.dim + 'AxisIndex'] = axis.index; + return grid.getCartesian(opt); } var pointerShapeBuilder = { - line: function (axis, pixelValue, otherExtent) { - var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis)); - return { - type: 'Line', - subPixelOptimize: true, - shape: targetShape - }; - }, - shadow: function (axis, pixelValue, otherExtent) { - var bandWidth = Math.max(1, axis.getBandWidth()); - var span = otherExtent[1] - otherExtent[0]; - return { - type: 'Rect', - shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis)) - }; - } + line: function (axis, pixelValue, otherExtent) { + var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis)); + return { + type: 'Line', + subPixelOptimize: true, + shape: targetShape + }; + }, + shadow: function (axis, pixelValue, otherExtent) { + var bandWidth = Math.max(1, axis.getBandWidth()); + var span = otherExtent[1] - otherExtent[0]; + return { + type: 'Rect', + shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis)) + }; + } }; function getAxisDimIndex(axis) { - return axis.dim === 'x' ? 0 : 1; + return axis.dim === 'x' ? 0 : 1; } var AxisPointerModel = - /** @class */ - function (_super) { - __extends(AxisPointerModel, _super); + /** @class */ + function (_super) { + __extends(AxisPointerModel, _super); - function AxisPointerModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function AxisPointerModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = AxisPointerModel.type; - return _this; - } + _this.type = AxisPointerModel.type; + return _this; + } - AxisPointerModel.type = 'axisPointer'; - AxisPointerModel.defaultOption = { - // 'auto' means that show when triggered by tooltip or handle. - show: 'auto', - // zlevel: 0, - z: 50, - type: 'line', - // axispointer triggered by tootip determine snap automatically, - // see `modelHelper`. - snap: false, - triggerTooltip: true, - value: null, - status: null, - link: [], - // Do not set 'auto' here, otherwise global animation: false - // will not effect at this axispointer. - animation: null, - animationDurationUpdate: 200, - lineStyle: { - color: '#B9BEC9', - width: 1, - type: 'dashed' - }, - shadowStyle: { - color: 'rgba(210,219,238,0.2)' - }, - label: { - show: true, - formatter: null, - precision: 'auto', - margin: 3, - color: '#fff', - padding: [5, 7, 5, 7], - backgroundColor: 'auto', - borderColor: null, - borderWidth: 0, - borderRadius: 3 - }, - handle: { - show: false, - // eslint-disable-next-line - 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, - // handle margin is from symbol center to axis, which is stable when circular move. - margin: 50, - // color: '#1b8bbd' - // color: '#2f4554' - color: '#333', - shadowBlur: 3, - shadowColor: '#aaa', - shadowOffsetX: 0, - shadowOffsetY: 2, - // For mobile performance - throttle: 40 - } - }; - return AxisPointerModel; - }(ComponentModel); + AxisPointerModel.type = 'axisPointer'; + AxisPointerModel.defaultOption = { + // 'auto' means that show when triggered by tooltip or handle. + show: 'auto', + // zlevel: 0, + z: 50, + type: 'line', + // axispointer triggered by tootip determine snap automatically, + // see `modelHelper`. + snap: false, + triggerTooltip: true, + value: null, + status: null, + link: [], + // Do not set 'auto' here, otherwise global animation: false + // will not effect at this axispointer. + animation: null, + animationDurationUpdate: 200, + lineStyle: { + color: '#B9BEC9', + width: 1, + type: 'dashed' + }, + shadowStyle: { + color: 'rgba(210,219,238,0.2)' + }, + label: { + show: true, + formatter: null, + precision: 'auto', + margin: 3, + color: '#fff', + padding: [5, 7, 5, 7], + backgroundColor: 'auto', + borderColor: null, + borderWidth: 0, + borderRadius: 3 + }, + handle: { + show: false, + // eslint-disable-next-line + 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, + // handle margin is from symbol center to axis, which is stable when circular move. + margin: 50, + // color: '#1b8bbd' + // color: '#2f4554' + color: '#333', + shadowBlur: 3, + shadowColor: '#aaa', + shadowOffsetX: 0, + shadowOffsetY: 2, + // For mobile performance + throttle: 40 + } + }; + return AxisPointerModel; + }(ComponentModel); var inner$b = makeInner(); var each$7 = each; @@ -74613,145 +74613,145 @@ */ function register(key, api, handler) { - if (env.node) { - return; - } + if (env.node) { + return; + } - var zr = api.getZr(); - inner$b(zr).records || (inner$b(zr).records = {}); - initGlobalListeners(zr, api); - var record = inner$b(zr).records[key] || (inner$b(zr).records[key] = {}); - record.handler = handler; + var zr = api.getZr(); + inner$b(zr).records || (inner$b(zr).records = {}); + initGlobalListeners(zr, api); + var record = inner$b(zr).records[key] || (inner$b(zr).records[key] = {}); + record.handler = handler; } function initGlobalListeners(zr, api) { - if (inner$b(zr).initialized) { - return; - } + if (inner$b(zr).initialized) { + return; + } - inner$b(zr).initialized = true; - useHandler('click', curry(doEnter, 'click')); - useHandler('mousemove', curry(doEnter, 'mousemove')); // useHandler('mouseout', onLeave); + inner$b(zr).initialized = true; + useHandler('click', curry(doEnter, 'click')); + useHandler('mousemove', curry(doEnter, 'mousemove')); // useHandler('mouseout', onLeave); - useHandler('globalout', onLeave); + useHandler('globalout', onLeave); - function useHandler(eventType, cb) { - zr.on(eventType, function (e) { - var dis = makeDispatchAction(api); - each$7(inner$b(zr).records, function (record) { - record && cb(record, e, dis.dispatchAction); - }); - dispatchTooltipFinally(dis.pendings, api); - }); - } + function useHandler(eventType, cb) { + zr.on(eventType, function (e) { + var dis = makeDispatchAction(api); + each$7(inner$b(zr).records, function (record) { + record && cb(record, e, dis.dispatchAction); + }); + dispatchTooltipFinally(dis.pendings, api); + }); + } } function dispatchTooltipFinally(pendings, api) { - var showLen = pendings.showTip.length; - var hideLen = pendings.hideTip.length; - var actuallyPayload; + var showLen = pendings.showTip.length; + var hideLen = pendings.hideTip.length; + var actuallyPayload; - if (showLen) { - actuallyPayload = pendings.showTip[showLen - 1]; - } else if (hideLen) { - actuallyPayload = pendings.hideTip[hideLen - 1]; - } + if (showLen) { + actuallyPayload = pendings.showTip[showLen - 1]; + } else if (hideLen) { + actuallyPayload = pendings.hideTip[hideLen - 1]; + } - if (actuallyPayload) { - actuallyPayload.dispatchAction = null; - api.dispatchAction(actuallyPayload); - } + if (actuallyPayload) { + actuallyPayload.dispatchAction = null; + api.dispatchAction(actuallyPayload); + } } function onLeave(record, e, dispatchAction) { - record.handler('leave', null, dispatchAction); + record.handler('leave', null, dispatchAction); } function doEnter(currTrigger, record, e, dispatchAction) { - record.handler(currTrigger, e, dispatchAction); + record.handler(currTrigger, e, dispatchAction); } function makeDispatchAction(api) { - var pendings = { - showTip: [], - hideTip: [] - }; // FIXME - // better approach? - // 'showTip' and 'hideTip' can be triggered by axisPointer and tooltip, - // which may be conflict, (axisPointer call showTip but tooltip call hideTip); - // So we have to add "final stage" to merge those dispatched actions. - - var dispatchAction = function (payload) { - var pendingList = pendings[payload.type]; - - if (pendingList) { - pendingList.push(payload); - } else { - payload.dispatchAction = dispatchAction; - api.dispatchAction(payload); - } - }; + var pendings = { + showTip: [], + hideTip: [] + }; // FIXME + // better approach? + // 'showTip' and 'hideTip' can be triggered by axisPointer and tooltip, + // which may be conflict, (axisPointer call showTip but tooltip call hideTip); + // So we have to add "final stage" to merge those dispatched actions. + + var dispatchAction = function (payload) { + var pendingList = pendings[payload.type]; + + if (pendingList) { + pendingList.push(payload); + } else { + payload.dispatchAction = dispatchAction; + api.dispatchAction(payload); + } + }; - return { - dispatchAction: dispatchAction, - pendings: pendings - }; + return { + dispatchAction: dispatchAction, + pendings: pendings + }; } function unregister(key, api) { - if (env.node) { - return; - } + if (env.node) { + return; + } - var zr = api.getZr(); - var record = (inner$b(zr).records || {})[key]; + var zr = api.getZr(); + var record = (inner$b(zr).records || {})[key]; - if (record) { - inner$b(zr).records[key] = null; - } + if (record) { + inner$b(zr).records[key] = null; + } } var AxisPointerView = - /** @class */ - function (_super) { - __extends(AxisPointerView, _super); + /** @class */ + function (_super) { + __extends(AxisPointerView, _super); - function AxisPointerView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function AxisPointerView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = AxisPointerView.type; - return _this; - } + _this.type = AxisPointerView.type; + return _this; + } - AxisPointerView.prototype.render = function (globalAxisPointerModel, ecModel, api) { - var globalTooltipModel = ecModel.getComponent('tooltip'); - var triggerOn = globalAxisPointerModel.get('triggerOn') || globalTooltipModel && globalTooltipModel.get('triggerOn') || 'mousemove|click'; // Register global listener in AxisPointerView to enable - // AxisPointerView to be independent to Tooltip. + AxisPointerView.prototype.render = function (globalAxisPointerModel, ecModel, api) { + var globalTooltipModel = ecModel.getComponent('tooltip'); + var triggerOn = globalAxisPointerModel.get('triggerOn') || globalTooltipModel && globalTooltipModel.get('triggerOn') || 'mousemove|click'; // Register global listener in AxisPointerView to enable + // AxisPointerView to be independent to Tooltip. - register('axisPointer', api, function (currTrigger, e, dispatchAction) { - // If 'none', it is not controlled by mouse totally. - if (triggerOn !== 'none' && (currTrigger === 'leave' || triggerOn.indexOf(currTrigger) >= 0)) { - dispatchAction({ - type: 'updateAxisPointer', - currTrigger: currTrigger, - x: e && e.offsetX, - y: e && e.offsetY - }); - } - }); - }; + register('axisPointer', api, function (currTrigger, e, dispatchAction) { + // If 'none', it is not controlled by mouse totally. + if (triggerOn !== 'none' && (currTrigger === 'leave' || triggerOn.indexOf(currTrigger) >= 0)) { + dispatchAction({ + type: 'updateAxisPointer', + currTrigger: currTrigger, + x: e && e.offsetX, + y: e && e.offsetY + }); + } + }); + }; - AxisPointerView.prototype.remove = function (ecModel, api) { - unregister('axisPointer', api); - }; + AxisPointerView.prototype.remove = function (ecModel, api) { + unregister('axisPointer', api); + }; - AxisPointerView.prototype.dispose = function (ecModel, api) { - unregister('axisPointer', api); - }; + AxisPointerView.prototype.dispose = function (ecModel, api) { + unregister('axisPointer', api); + }; - AxisPointerView.type = 'axisPointer'; - return AxisPointerView; - }(ComponentView); + AxisPointerView.type = 'axisPointer'; + return AxisPointerView; + }(ComponentView); /** * @param finder contains {seriesIndex, dataIndex, dataIndexInside} @@ -74760,58 +74760,58 @@ */ function findPointFromSeries(finder, ecModel) { - var point = []; - var seriesIndex = finder.seriesIndex; - var seriesModel; - - if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) { - return { - point: [] - }; - } - - var data = seriesModel.getData(); - var dataIndex = queryDataIndex(data, finder); + var point = []; + var seriesIndex = finder.seriesIndex; + var seriesModel; - if (dataIndex == null || dataIndex < 0 || isArray(dataIndex)) { - return { - point: [] - }; - } + if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) { + return { + point: [] + }; + } - var el = data.getItemGraphicEl(dataIndex); - var coordSys = seriesModel.coordinateSystem; + var data = seriesModel.getData(); + var dataIndex = queryDataIndex(data, finder); - if (seriesModel.getTooltipPosition) { - point = seriesModel.getTooltipPosition(dataIndex) || []; - } else if (coordSys && coordSys.dataToPoint) { - if (finder.isStacked) { - var baseAxis = coordSys.getBaseAxis(); - var valueAxis = coordSys.getOtherAxis(baseAxis); - var valueAxisDim = valueAxis.dim; - var baseAxisDim = baseAxis.dim; - var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0; - var baseDim = data.mapDimension(baseAxisDim); - var stackedData = []; - stackedData[baseDataOffset] = data.get(baseDim, dataIndex); - stackedData[1 - baseDataOffset] = data.get(data.getCalculationInfo('stackResultDimension'), dataIndex); - point = coordSys.dataToPoint(stackedData) || []; - } else { - point = coordSys.dataToPoint(data.getValues(map(coordSys.dimensions, function (dim) { - return data.mapDimension(dim); - }), dataIndex)) || []; - } - } else if (el) { - // Use graphic bounding rect - var rect = el.getBoundingRect().clone(); - rect.applyTransform(el.transform); - point = [rect.x + rect.width / 2, rect.y + rect.height / 2]; + if (dataIndex == null || dataIndex < 0 || isArray(dataIndex)) { + return { + point: [] + }; + } + + var el = data.getItemGraphicEl(dataIndex); + var coordSys = seriesModel.coordinateSystem; + + if (seriesModel.getTooltipPosition) { + point = seriesModel.getTooltipPosition(dataIndex) || []; + } else if (coordSys && coordSys.dataToPoint) { + if (finder.isStacked) { + var baseAxis = coordSys.getBaseAxis(); + var valueAxis = coordSys.getOtherAxis(baseAxis); + var valueAxisDim = valueAxis.dim; + var baseAxisDim = baseAxis.dim; + var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0; + var baseDim = data.mapDimension(baseAxisDim); + var stackedData = []; + stackedData[baseDataOffset] = data.get(baseDim, dataIndex); + stackedData[1 - baseDataOffset] = data.get(data.getCalculationInfo('stackResultDimension'), dataIndex); + point = coordSys.dataToPoint(stackedData) || []; + } else { + point = coordSys.dataToPoint(data.getValues(map(coordSys.dimensions, function (dim) { + return data.mapDimension(dim); + }), dataIndex)) || []; } + } else if (el) { + // Use graphic bounding rect + var rect = el.getBoundingRect().clone(); + rect.applyTransform(el.transform); + point = [rect.x + rect.width / 2, rect.y + rect.height / 2]; + } - return { - point: point, - el: el - }; + return { + point: point, + el: el + }; } var inner$c = makeInner(); @@ -74823,607 +74823,607 @@ */ function axisTrigger(payload, ecModel, api) { - var currTrigger = payload.currTrigger; - var point = [payload.x, payload.y]; - var finder = payload; - var dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api); - var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; // Pending - // See #6121. But we are not able to reproduce it yet. - - if (!coordSysAxesInfo) { - return; - } - - if (illegalPoint(point)) { - // Used in the default behavior of `connection`: use the sample seriesIndex - // and dataIndex. And also used in the tooltipView trigger. - point = findPointFromSeries({ - seriesIndex: finder.seriesIndex, - // Do not use dataIndexInside from other ec instance. - // FIXME: auto detect it? - dataIndex: finder.dataIndex - }, ecModel).point; - } - - var isIllegalPoint = illegalPoint(point); // Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}). - // Notice: In this case, it is difficult to get the `point` (which is necessary to show - // tooltip, so if point is not given, we just use the point found by sample seriesIndex - // and dataIndex. - - var inputAxesInfo = finder.axesInfo; - var axesInfo = coordSysAxesInfo.axesInfo; - var shouldHide = currTrigger === 'leave' || illegalPoint(point); - var outputPayload = {}; - var showValueMap = {}; - var dataByCoordSys = { - list: [], - map: {} - }; - var updaters = { - showPointer: curry(showPointer, showValueMap), - showTooltip: curry(showTooltip, dataByCoordSys) - }; // Process for triggered axes. - - each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) { - // If a point given, it must be contained by the coordinate system. - var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point); - each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) { - var axis = axisInfo.axis; - var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo); // If no inputAxesInfo, no axis is restricted. - - if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) { - var val = inputAxisInfo && inputAxisInfo.value; - - if (val == null && !isIllegalPoint) { - val = axis.pointToData(point); - } - - val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload); - } - }); - }); // Process for linked axes. + var currTrigger = payload.currTrigger; + var point = [payload.x, payload.y]; + var finder = payload; + var dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api); + var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; // Pending + // See #6121. But we are not able to reproduce it yet. + + if (!coordSysAxesInfo) { + return; + } + + if (illegalPoint(point)) { + // Used in the default behavior of `connection`: use the sample seriesIndex + // and dataIndex. And also used in the tooltipView trigger. + point = findPointFromSeries({ + seriesIndex: finder.seriesIndex, + // Do not use dataIndexInside from other ec instance. + // FIXME: auto detect it? + dataIndex: finder.dataIndex + }, ecModel).point; + } + + var isIllegalPoint = illegalPoint(point); // Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}). + // Notice: In this case, it is difficult to get the `point` (which is necessary to show + // tooltip, so if point is not given, we just use the point found by sample seriesIndex + // and dataIndex. + + var inputAxesInfo = finder.axesInfo; + var axesInfo = coordSysAxesInfo.axesInfo; + var shouldHide = currTrigger === 'leave' || illegalPoint(point); + var outputPayload = {}; + var showValueMap = {}; + var dataByCoordSys = { + list: [], + map: {} + }; + var updaters = { + showPointer: curry(showPointer, showValueMap), + showTooltip: curry(showTooltip, dataByCoordSys) + }; // Process for triggered axes. + + each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) { + // If a point given, it must be contained by the coordinate system. + var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point); + each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) { + var axis = axisInfo.axis; + var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo); // If no inputAxesInfo, no axis is restricted. + + if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) { + var val = inputAxisInfo && inputAxisInfo.value; + + if (val == null && !isIllegalPoint) { + val = axis.pointToData(point); + } + + val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload); + } + }); + }); // Process for linked axes. - var linkTriggers = {}; - each(axesInfo, function (tarAxisInfo, tarKey) { - var linkGroup = tarAxisInfo.linkGroup; // If axis has been triggered in the previous stage, it should not be triggered by link. + var linkTriggers = {}; + each(axesInfo, function (tarAxisInfo, tarKey) { + var linkGroup = tarAxisInfo.linkGroup; // If axis has been triggered in the previous stage, it should not be triggered by link. - if (linkGroup && !showValueMap[tarKey]) { - each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) { - var srcValItem = showValueMap[srcKey]; // If srcValItem exist, source axis is triggered, so link to target axis. + if (linkGroup && !showValueMap[tarKey]) { + each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) { + var srcValItem = showValueMap[srcKey]; // If srcValItem exist, source axis is triggered, so link to target axis. - if (srcAxisInfo !== tarAxisInfo && srcValItem) { - var val = srcValItem.value; - linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo)))); - linkTriggers[tarAxisInfo.key] = val; - } - }); + if (srcAxisInfo !== tarAxisInfo && srcValItem) { + var val = srcValItem.value; + linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo)))); + linkTriggers[tarAxisInfo.key] = val; } - }); - each(linkTriggers, function (val, tarKey) { - processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload); - }); - updateModelActually(showValueMap, axesInfo, outputPayload); - dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction); - dispatchHighDownActually(axesInfo, dispatchAction, api); - return outputPayload; + }); + } + }); + each(linkTriggers, function (val, tarKey) { + processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload); + }); + updateModelActually(showValueMap, axesInfo, outputPayload); + dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction); + dispatchHighDownActually(axesInfo, dispatchAction, api); + return outputPayload; } function processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) { - var axis = axisInfo.axis; + var axis = axisInfo.axis; - if (axis.scale.isBlank() || !axis.containData(newValue)) { - return; - } + if (axis.scale.isBlank() || !axis.containData(newValue)) { + return; + } - if (!axisInfo.involveSeries) { - updaters.showPointer(axisInfo, newValue); - return; - } // Heavy calculation. So put it after axis.containData checking. + if (!axisInfo.involveSeries) { + updaters.showPointer(axisInfo, newValue); + return; + } // Heavy calculation. So put it after axis.containData checking. - var payloadInfo = buildPayloadsBySeries(newValue, axisInfo); - var payloadBatch = payloadInfo.payloadBatch; - var snapToValue = payloadInfo.snapToValue; // Fill content of event obj for echarts.connect. - // By default use the first involved series data as a sample to connect. + var payloadInfo = buildPayloadsBySeries(newValue, axisInfo); + var payloadBatch = payloadInfo.payloadBatch; + var snapToValue = payloadInfo.snapToValue; // Fill content of event obj for echarts.connect. + // By default use the first involved series data as a sample to connect. - if (payloadBatch[0] && outputFinder.seriesIndex == null) { - extend(outputFinder, payloadBatch[0]); - } // If no linkSource input, this process is for collecting link - // target, where snap should not be accepted. + if (payloadBatch[0] && outputFinder.seriesIndex == null) { + extend(outputFinder, payloadBatch[0]); + } // If no linkSource input, this process is for collecting link + // target, where snap should not be accepted. - if (!noSnap && axisInfo.snap) { - if (axis.containData(snapToValue) && snapToValue != null) { - newValue = snapToValue; - } + if (!noSnap && axisInfo.snap) { + if (axis.containData(snapToValue) && snapToValue != null) { + newValue = snapToValue; } + } - updaters.showPointer(axisInfo, newValue, payloadBatch); // Tooltip should always be snapToValue, otherwise there will be - // incorrect "axis value ~ series value" mapping displayed in tooltip. + updaters.showPointer(axisInfo, newValue, payloadBatch); // Tooltip should always be snapToValue, otherwise there will be + // incorrect "axis value ~ series value" mapping displayed in tooltip. - updaters.showTooltip(axisInfo, payloadInfo, snapToValue); + updaters.showTooltip(axisInfo, payloadInfo, snapToValue); } function buildPayloadsBySeries(value, axisInfo) { - var axis = axisInfo.axis; - var dim = axis.dim; - var snapToValue = value; - var payloadBatch = []; - var minDist = Number.MAX_VALUE; - var minDiff = -1; - each(axisInfo.seriesModels, function (series, idx) { - var dataDim = series.getData().mapDimensionsAll(dim); - var seriesNestestValue; - var dataIndices; - - if (series.getAxisTooltipData) { - var result = series.getAxisTooltipData(dataDim, value, axis); - dataIndices = result.dataIndices; - seriesNestestValue = result.nestestValue; - } else { - dataIndices = series.getData().indicesOfNearest(dataDim[0], value, // Add a threshold to avoid find the wrong dataIndex - // when data length is not same. - // false, - axis.type === 'category' ? 0.5 : null); + var axis = axisInfo.axis; + var dim = axis.dim; + var snapToValue = value; + var payloadBatch = []; + var minDist = Number.MAX_VALUE; + var minDiff = -1; + each(axisInfo.seriesModels, function (series, idx) { + var dataDim = series.getData().mapDimensionsAll(dim); + var seriesNestestValue; + var dataIndices; + + if (series.getAxisTooltipData) { + var result = series.getAxisTooltipData(dataDim, value, axis); + dataIndices = result.dataIndices; + seriesNestestValue = result.nestestValue; + } else { + dataIndices = series.getData().indicesOfNearest(dataDim[0], value, // Add a threshold to avoid find the wrong dataIndex + // when data length is not same. + // false, + axis.type === 'category' ? 0.5 : null); - if (!dataIndices.length) { - return; - } + if (!dataIndices.length) { + return; + } - seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]); - } + seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]); + } - if (seriesNestestValue == null || !isFinite(seriesNestestValue)) { - return; - } + if (seriesNestestValue == null || !isFinite(seriesNestestValue)) { + return; + } - var diff = value - seriesNestestValue; - var dist = Math.abs(diff); // Consider category case + var diff = value - seriesNestestValue; + var dist = Math.abs(diff); // Consider category case - if (dist <= minDist) { - if (dist < minDist || diff >= 0 && minDiff < 0) { - minDist = dist; - minDiff = diff; - snapToValue = seriesNestestValue; - payloadBatch.length = 0; - } - - each(dataIndices, function (dataIndex) { - payloadBatch.push({ - seriesIndex: series.seriesIndex, - dataIndexInside: dataIndex, - dataIndex: series.getData().getRawIndex(dataIndex) - }); - }); - } - }); - return { - payloadBatch: payloadBatch, - snapToValue: snapToValue - }; + if (dist <= minDist) { + if (dist < minDist || diff >= 0 && minDiff < 0) { + minDist = dist; + minDiff = diff; + snapToValue = seriesNestestValue; + payloadBatch.length = 0; + } + + each(dataIndices, function (dataIndex) { + payloadBatch.push({ + seriesIndex: series.seriesIndex, + dataIndexInside: dataIndex, + dataIndex: series.getData().getRawIndex(dataIndex) + }); + }); + } + }); + return { + payloadBatch: payloadBatch, + snapToValue: snapToValue + }; } function showPointer(showValueMap, axisInfo, value, payloadBatch) { - showValueMap[axisInfo.key] = { - value: value, - payloadBatch: payloadBatch - }; + showValueMap[axisInfo.key] = { + value: value, + payloadBatch: payloadBatch + }; } function showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) { - var payloadBatch = payloadInfo.payloadBatch; - var axis = axisInfo.axis; - var axisModel = axis.model; - var axisPointerModel = axisInfo.axisPointerModel; // If no data, do not create anything in dataByCoordSys, - // whose length will be used to judge whether dispatch action. - - if (!axisInfo.triggerTooltip || !payloadBatch.length) { - return; - } - - var coordSysModel = axisInfo.coordSys.model; - var coordSysKey = makeKey(coordSysModel); - var coordSysItem = dataByCoordSys.map[coordSysKey]; - - if (!coordSysItem) { - coordSysItem = dataByCoordSys.map[coordSysKey] = { - coordSysId: coordSysModel.id, - coordSysIndex: coordSysModel.componentIndex, - coordSysType: coordSysModel.type, - coordSysMainType: coordSysModel.mainType, - dataByAxis: [] - }; - dataByCoordSys.list.push(coordSysItem); - } + var payloadBatch = payloadInfo.payloadBatch; + var axis = axisInfo.axis; + var axisModel = axis.model; + var axisPointerModel = axisInfo.axisPointerModel; // If no data, do not create anything in dataByCoordSys, + // whose length will be used to judge whether dispatch action. - coordSysItem.dataByAxis.push({ - axisDim: axis.dim, - axisIndex: axisModel.componentIndex, - axisType: axisModel.type, - axisId: axisModel.id, - value: value, - // Caustion: viewHelper.getValueLabel is actually on "view stage", which - // depends that all models have been updated. So it should not be performed - // here. Considering axisPointerModel used here is volatile, which is hard - // to be retrieve in TooltipView, we prepare parameters here. - valueLabelOpt: { - precision: axisPointerModel.get(['label', 'precision']), - formatter: axisPointerModel.get(['label', 'formatter']) - }, - seriesDataIndices: payloadBatch.slice() - }); + if (!axisInfo.triggerTooltip || !payloadBatch.length) { + return; + } + + var coordSysModel = axisInfo.coordSys.model; + var coordSysKey = makeKey(coordSysModel); + var coordSysItem = dataByCoordSys.map[coordSysKey]; + + if (!coordSysItem) { + coordSysItem = dataByCoordSys.map[coordSysKey] = { + coordSysId: coordSysModel.id, + coordSysIndex: coordSysModel.componentIndex, + coordSysType: coordSysModel.type, + coordSysMainType: coordSysModel.mainType, + dataByAxis: [] + }; + dataByCoordSys.list.push(coordSysItem); + } + + coordSysItem.dataByAxis.push({ + axisDim: axis.dim, + axisIndex: axisModel.componentIndex, + axisType: axisModel.type, + axisId: axisModel.id, + value: value, + // Caustion: viewHelper.getValueLabel is actually on "view stage", which + // depends that all models have been updated. So it should not be performed + // here. Considering axisPointerModel used here is volatile, which is hard + // to be retrieve in TooltipView, we prepare parameters here. + valueLabelOpt: { + precision: axisPointerModel.get(['label', 'precision']), + formatter: axisPointerModel.get(['label', 'formatter']) + }, + seriesDataIndices: payloadBatch.slice() + }); } function updateModelActually(showValueMap, axesInfo, outputPayload) { - var outputAxesInfo = outputPayload.axesInfo = []; // Basic logic: If no 'show' required, 'hide' this axisPointer. + var outputAxesInfo = outputPayload.axesInfo = []; // Basic logic: If no 'show' required, 'hide' this axisPointer. - each(axesInfo, function (axisInfo, key) { - var option = axisInfo.axisPointerModel.option; - var valItem = showValueMap[key]; + each(axesInfo, function (axisInfo, key) { + var option = axisInfo.axisPointerModel.option; + var valItem = showValueMap[key]; - if (valItem) { - !axisInfo.useHandle && (option.status = 'show'); - option.value = valItem.value; // For label formatter param and highlight. + if (valItem) { + !axisInfo.useHandle && (option.status = 'show'); + option.value = valItem.value; // For label formatter param and highlight. - option.seriesDataIndices = (valItem.payloadBatch || []).slice(); - } // When always show (e.g., handle used), remain - // original value and status. - else { - // If hide, value still need to be set, consider - // click legend to toggle axis blank. - !axisInfo.useHandle && (option.status = 'hide'); - } // If status is 'hide', should be no info in payload. + option.seriesDataIndices = (valItem.payloadBatch || []).slice(); + } // When always show (e.g., handle used), remain + // original value and status. + else { + // If hide, value still need to be set, consider + // click legend to toggle axis blank. + !axisInfo.useHandle && (option.status = 'hide'); + } // If status is 'hide', should be no info in payload. - option.status === 'show' && outputAxesInfo.push({ - axisDim: axisInfo.axis.dim, - axisIndex: axisInfo.axis.model.componentIndex, - value: option.value - }); + option.status === 'show' && outputAxesInfo.push({ + axisDim: axisInfo.axis.dim, + axisIndex: axisInfo.axis.model.componentIndex, + value: option.value }); + }); } function dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction) { - // Basic logic: If no showTip required, hideTip will be dispatched. - if (illegalPoint(point) || !dataByCoordSys.list.length) { - dispatchAction({ - type: 'hideTip' - }); - return; - } // In most case only one axis (or event one series is used). It is - // convinient to fetch payload.seriesIndex and payload.dataIndex - // dirtectly. So put the first seriesIndex and dataIndex of the first - // axis on the payload. - - - var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {}; + // Basic logic: If no showTip required, hideTip will be dispatched. + if (illegalPoint(point) || !dataByCoordSys.list.length) { dispatchAction({ - type: 'showTip', - escapeConnect: true, - x: point[0], - y: point[1], - tooltipOption: payload.tooltipOption, - position: payload.position, - dataIndexInside: sampleItem.dataIndexInside, - dataIndex: sampleItem.dataIndex, - seriesIndex: sampleItem.seriesIndex, - dataByCoordSys: dataByCoordSys.list + type: 'hideTip' }); + return; + } // In most case only one axis (or event one series is used). It is + // convinient to fetch payload.seriesIndex and payload.dataIndex + // dirtectly. So put the first seriesIndex and dataIndex of the first + // axis on the payload. + + + var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {}; + dispatchAction({ + type: 'showTip', + escapeConnect: true, + x: point[0], + y: point[1], + tooltipOption: payload.tooltipOption, + position: payload.position, + dataIndexInside: sampleItem.dataIndexInside, + dataIndex: sampleItem.dataIndex, + seriesIndex: sampleItem.seriesIndex, + dataByCoordSys: dataByCoordSys.list + }); } function dispatchHighDownActually(axesInfo, dispatchAction, api) { - // FIXME - // highlight status modification shoule be a stage of main process? - // (Consider confilct (e.g., legend and axisPointer) and setOption) - var zr = api.getZr(); - var highDownKey = 'axisPointerLastHighlights'; - var lastHighlights = inner$c(zr)[highDownKey] || {}; - var newHighlights = inner$c(zr)[highDownKey] = {}; // Update highlight/downplay status according to axisPointer model. - // Build hash map and remove duplicate incidentally. - - each(axesInfo, function (axisInfo, key) { - var option = axisInfo.axisPointerModel.option; - option.status === 'show' && each(option.seriesDataIndices, function (batchItem) { - var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex; - newHighlights[key] = batchItem; - }); - }); // Diff. - - var toHighlight = []; - var toDownplay = []; - each(lastHighlights, function (batchItem, key) { - !newHighlights[key] && toDownplay.push(batchItem); - }); - each(newHighlights, function (batchItem, key) { - !lastHighlights[key] && toHighlight.push(batchItem); - }); - toDownplay.length && api.dispatchAction({ - type: 'downplay', - escapeConnect: true, - // Not blur others when highlight in axisPointer. - notBlur: true, - batch: toDownplay - }); - toHighlight.length && api.dispatchAction({ - type: 'highlight', - escapeConnect: true, - // Not blur others when highlight in axisPointer. - notBlur: true, - batch: toHighlight + // FIXME + // highlight status modification shoule be a stage of main process? + // (Consider confilct (e.g., legend and axisPointer) and setOption) + var zr = api.getZr(); + var highDownKey = 'axisPointerLastHighlights'; + var lastHighlights = inner$c(zr)[highDownKey] || {}; + var newHighlights = inner$c(zr)[highDownKey] = {}; // Update highlight/downplay status according to axisPointer model. + // Build hash map and remove duplicate incidentally. + + each(axesInfo, function (axisInfo, key) { + var option = axisInfo.axisPointerModel.option; + option.status === 'show' && each(option.seriesDataIndices, function (batchItem) { + var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex; + newHighlights[key] = batchItem; }); + }); // Diff. + + var toHighlight = []; + var toDownplay = []; + each(lastHighlights, function (batchItem, key) { + !newHighlights[key] && toDownplay.push(batchItem); + }); + each(newHighlights, function (batchItem, key) { + !lastHighlights[key] && toHighlight.push(batchItem); + }); + toDownplay.length && api.dispatchAction({ + type: 'downplay', + escapeConnect: true, + // Not blur others when highlight in axisPointer. + notBlur: true, + batch: toDownplay + }); + toHighlight.length && api.dispatchAction({ + type: 'highlight', + escapeConnect: true, + // Not blur others when highlight in axisPointer. + notBlur: true, + batch: toHighlight + }); } function findInputAxisInfo(inputAxesInfo, axisInfo) { - for (var i = 0; i < (inputAxesInfo || []).length; i++) { - var inputAxisInfo = inputAxesInfo[i]; + for (var i = 0; i < (inputAxesInfo || []).length; i++) { + var inputAxisInfo = inputAxesInfo[i]; - if (axisInfo.axis.dim === inputAxisInfo.axisDim && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) { - return inputAxisInfo; - } + if (axisInfo.axis.dim === inputAxisInfo.axisDim && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) { + return inputAxisInfo; } + } } function makeMapperParam(axisInfo) { - var axisModel = axisInfo.axis.model; - var item = {}; - var dim = item.axisDim = axisInfo.axis.dim; - item.axisIndex = item[dim + 'AxisIndex'] = axisModel.componentIndex; - item.axisName = item[dim + 'AxisName'] = axisModel.name; - item.axisId = item[dim + 'AxisId'] = axisModel.id; - return item; + var axisModel = axisInfo.axis.model; + var item = {}; + var dim = item.axisDim = axisInfo.axis.dim; + item.axisIndex = item[dim + 'AxisIndex'] = axisModel.componentIndex; + item.axisName = item[dim + 'AxisName'] = axisModel.name; + item.axisId = item[dim + 'AxisId'] = axisModel.id; + return item; } function illegalPoint(point) { - return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]); + return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]); } function install$s(registers) { - // CartesianAxisPointer is not supposed to be required here. But consider - // echarts.simple.js and online build tooltip, which only require gridSimple, - // CartesianAxisPointer should be able to required somewhere. - AxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer); - registers.registerComponentModel(AxisPointerModel); - registers.registerComponentView(AxisPointerView); - registers.registerPreprocessor(function (option) { - // Always has a global axisPointerModel for default setting. - if (option) { - (!option.axisPointer || option.axisPointer.length === 0) && (option.axisPointer = {}); - var link = option.axisPointer.link; // Normalize to array to avoid object mergin. But if link - // is not set, remain null/undefined, otherwise it will - // override existent link setting. - - if (link && !isArray(link)) { - option.axisPointer.link = [link]; - } - } - }); // This process should proformed after coordinate systems created - // and series data processed. So put it on statistic processing stage. - - registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) { - // Build axisPointerModel, mergin tooltip.axisPointer model for each axis. - // allAxesInfo should be updated when setOption performed. - ecModel.getComponent('axisPointer').coordSysAxesInfo = collect(ecModel, api); - }); // Broadcast to all views. - - registers.registerAction({ - type: 'updateAxisPointer', - event: 'updateAxisPointer', - update: ':updateAxisPointer' - }, axisTrigger); + // CartesianAxisPointer is not supposed to be required here. But consider + // echarts.simple.js and online build tooltip, which only require gridSimple, + // CartesianAxisPointer should be able to required somewhere. + AxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer); + registers.registerComponentModel(AxisPointerModel); + registers.registerComponentView(AxisPointerView); + registers.registerPreprocessor(function (option) { + // Always has a global axisPointerModel for default setting. + if (option) { + (!option.axisPointer || option.axisPointer.length === 0) && (option.axisPointer = {}); + var link = option.axisPointer.link; // Normalize to array to avoid object mergin. But if link + // is not set, remain null/undefined, otherwise it will + // override existent link setting. + + if (link && !isArray(link)) { + option.axisPointer.link = [link]; + } + } + }); // This process should proformed after coordinate systems created + // and series data processed. So put it on statistic processing stage. + + registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) { + // Build axisPointerModel, mergin tooltip.axisPointer model for each axis. + // allAxesInfo should be updated when setOption performed. + ecModel.getComponent('axisPointer').coordSysAxesInfo = collect(ecModel, api); + }); // Broadcast to all views. + + registers.registerAction({ + type: 'updateAxisPointer', + event: 'updateAxisPointer', + update: ':updateAxisPointer' + }, axisTrigger); } function install$t(registers) { - use(install$5); - use(install$s); + use(install$5); + use(install$s); } var PolarAxisPointer = - /** @class */ - function (_super) { - __extends(PolarAxisPointer, _super); - - function PolarAxisPointer() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * @override - */ + /** @class */ + function (_super) { + __extends(PolarAxisPointer, _super); + + function PolarAxisPointer() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * @override + */ - PolarAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) { - var axis = axisModel.axis; + PolarAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) { + var axis = axisModel.axis; - if (axis.dim === 'angle') { - this.animationThreshold = Math.PI / 18; - } + if (axis.dim === 'angle') { + this.animationThreshold = Math.PI / 18; + } - var polar = axis.polar; - var otherAxis = polar.getOtherAxis(axis); - var otherExtent = otherAxis.getExtent(); - var coordValue = axis.dataToCoord(value); - var axisPointerType = axisPointerModel.get('type'); + var polar = axis.polar; + var otherAxis = polar.getOtherAxis(axis); + var otherExtent = otherAxis.getExtent(); + var coordValue = axis.dataToCoord(value); + var axisPointerType = axisPointerModel.get('type'); - if (axisPointerType && axisPointerType !== 'none') { - var elStyle = buildElStyle(axisPointerModel); - var pointerOption = pointerShapeBuilder$1[axisPointerType](axis, polar, coordValue, otherExtent); - pointerOption.style = elStyle; - elOption.graphicKey = pointerOption.type; - elOption.pointer = pointerOption; - } + if (axisPointerType && axisPointerType !== 'none') { + var elStyle = buildElStyle(axisPointerModel); + var pointerOption = pointerShapeBuilder$1[axisPointerType](axis, polar, coordValue, otherExtent); + pointerOption.style = elStyle; + elOption.graphicKey = pointerOption.type; + elOption.pointer = pointerOption; + } - var labelMargin = axisPointerModel.get(['label', 'margin']); - var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin); - buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos); - }; + var labelMargin = axisPointerModel.get(['label', 'margin']); + var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin); + buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos); + }; - return PolarAxisPointer; - }(BaseAxisPointer); + return PolarAxisPointer; + }(BaseAxisPointer); function getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) { - var axis = axisModel.axis; - var coord = axis.dataToCoord(value); - var axisAngle = polar.getAngleAxis().getExtent()[0]; - axisAngle = axisAngle / 180 * Math.PI; - var radiusExtent = polar.getRadiusAxis().getExtent(); - var position; - var align; - var verticalAlign; - - if (axis.dim === 'radius') { - var transform = create$1(); - rotate(transform, transform, axisAngle); - translate(transform, transform, [polar.cx, polar.cy]); - position = applyTransform$1([coord, -labelMargin], transform); - var labelRotation = axisModel.getModel('axisLabel').get('rotate') || 0; // @ts-ignore - - var labelLayout = AxisBuilder.innerTextLayout(axisAngle, labelRotation * Math.PI / 180, -1); - align = labelLayout.textAlign; - verticalAlign = labelLayout.textVerticalAlign; - } else { - // angle axis - var r = radiusExtent[1]; - position = polar.coordToPoint([r + labelMargin, coord]); - var cx = polar.cx; - var cy = polar.cy; - align = Math.abs(position[0] - cx) / r < 0.3 ? 'center' : position[0] > cx ? 'left' : 'right'; - verticalAlign = Math.abs(position[1] - cy) / r < 0.3 ? 'middle' : position[1] > cy ? 'top' : 'bottom'; - } - - return { - position: position, - align: align, - verticalAlign: verticalAlign - }; + var axis = axisModel.axis; + var coord = axis.dataToCoord(value); + var axisAngle = polar.getAngleAxis().getExtent()[0]; + axisAngle = axisAngle / 180 * Math.PI; + var radiusExtent = polar.getRadiusAxis().getExtent(); + var position; + var align; + var verticalAlign; + + if (axis.dim === 'radius') { + var transform = create$1(); + rotate(transform, transform, axisAngle); + translate(transform, transform, [polar.cx, polar.cy]); + position = applyTransform$1([coord, -labelMargin], transform); + var labelRotation = axisModel.getModel('axisLabel').get('rotate') || 0; // @ts-ignore + + var labelLayout = AxisBuilder.innerTextLayout(axisAngle, labelRotation * Math.PI / 180, -1); + align = labelLayout.textAlign; + verticalAlign = labelLayout.textVerticalAlign; + } else { + // angle axis + var r = radiusExtent[1]; + position = polar.coordToPoint([r + labelMargin, coord]); + var cx = polar.cx; + var cy = polar.cy; + align = Math.abs(position[0] - cx) / r < 0.3 ? 'center' : position[0] > cx ? 'left' : 'right'; + verticalAlign = Math.abs(position[1] - cy) / r < 0.3 ? 'middle' : position[1] > cy ? 'top' : 'bottom'; + } + + return { + position: position, + align: align, + verticalAlign: verticalAlign + }; } var pointerShapeBuilder$1 = { - line: function (axis, polar, coordValue, otherExtent) { - return axis.dim === 'angle' ? { - type: 'Line', - shape: makeLineShape(polar.coordToPoint([otherExtent[0], coordValue]), polar.coordToPoint([otherExtent[1], coordValue])) - } : { - type: 'Circle', - shape: { - cx: polar.cx, - cy: polar.cy, - r: coordValue - } - }; - }, - shadow: function (axis, polar, coordValue, otherExtent) { - var bandWidth = Math.max(1, axis.getBandWidth()); - var radian = Math.PI / 180; - return axis.dim === 'angle' ? { - type: 'Sector', - shape: makeSectorShape(polar.cx, polar.cy, otherExtent[0], otherExtent[1], // In ECharts y is negative if angle is positive - (-coordValue - bandWidth / 2) * radian, (-coordValue + bandWidth / 2) * radian) - } : { - type: 'Sector', - shape: makeSectorShape(polar.cx, polar.cy, coordValue - bandWidth / 2, coordValue + bandWidth / 2, 0, Math.PI * 2) - }; - } + line: function (axis, polar, coordValue, otherExtent) { + return axis.dim === 'angle' ? { + type: 'Line', + shape: makeLineShape(polar.coordToPoint([otherExtent[0], coordValue]), polar.coordToPoint([otherExtent[1], coordValue])) + } : { + type: 'Circle', + shape: { + cx: polar.cx, + cy: polar.cy, + r: coordValue + } + }; + }, + shadow: function (axis, polar, coordValue, otherExtent) { + var bandWidth = Math.max(1, axis.getBandWidth()); + var radian = Math.PI / 180; + return axis.dim === 'angle' ? { + type: 'Sector', + shape: makeSectorShape(polar.cx, polar.cy, otherExtent[0], otherExtent[1], // In ECharts y is negative if angle is positive + (-coordValue - bandWidth / 2) * radian, (-coordValue + bandWidth / 2) * radian) + } : { + type: 'Sector', + shape: makeSectorShape(polar.cx, polar.cy, coordValue - bandWidth / 2, coordValue + bandWidth / 2, 0, Math.PI * 2) + }; + } }; var PolarModel = - /** @class */ - function (_super) { - __extends(PolarModel, _super); - - function PolarModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = PolarModel.type; - return _this; - } - - PolarModel.prototype.findAxisModel = function (axisType) { - var foundAxisModel; - var ecModel = this.ecModel; - ecModel.eachComponent(axisType, function (axisModel) { - if (axisModel.getCoordSysModel() === this) { - foundAxisModel = axisModel; - } - }, this); - return foundAxisModel; - }; + /** @class */ + function (_super) { + __extends(PolarModel, _super); + + function PolarModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = PolarModel.type; + return _this; + } + + PolarModel.prototype.findAxisModel = function (axisType) { + var foundAxisModel; + var ecModel = this.ecModel; + ecModel.eachComponent(axisType, function (axisModel) { + if (axisModel.getCoordSysModel() === this) { + foundAxisModel = axisModel; + } + }, this); + return foundAxisModel; + }; - PolarModel.type = 'polar'; - PolarModel.dependencies = ['radiusAxis', 'angleAxis']; - PolarModel.defaultOption = { - // zlevel: 0, - z: 0, - center: ['50%', '50%'], - radius: '80%' - }; - return PolarModel; - }(ComponentModel); + PolarModel.type = 'polar'; + PolarModel.dependencies = ['radiusAxis', 'angleAxis']; + PolarModel.defaultOption = { + // zlevel: 0, + z: 0, + center: ['50%', '50%'], + radius: '80%' + }; + return PolarModel; + }(ComponentModel); var PolarAxisModel = - /** @class */ - function (_super) { - __extends(PolarAxisModel, _super); + /** @class */ + function (_super) { + __extends(PolarAxisModel, _super); - function PolarAxisModel() { - return _super !== null && _super.apply(this, arguments) || this; - } + function PolarAxisModel() { + return _super !== null && _super.apply(this, arguments) || this; + } - PolarAxisModel.prototype.getCoordSysModel = function () { - return this.getReferringComponents('polar', SINGLE_REFERRING).models[0]; - }; + PolarAxisModel.prototype.getCoordSysModel = function () { + return this.getReferringComponents('polar', SINGLE_REFERRING).models[0]; + }; - PolarAxisModel.type = 'polarAxis'; - return PolarAxisModel; - }(ComponentModel); + PolarAxisModel.type = 'polarAxis'; + return PolarAxisModel; + }(ComponentModel); mixin(PolarAxisModel, AxisModelCommonMixin); var AngleAxisModel = - /** @class */ - function (_super) { - __extends(AngleAxisModel, _super); + /** @class */ + function (_super) { + __extends(AngleAxisModel, _super); - function AngleAxisModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function AngleAxisModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = AngleAxisModel.type; - return _this; - } + _this.type = AngleAxisModel.type; + return _this; + } - AngleAxisModel.type = 'angleAxis'; - return AngleAxisModel; - }(PolarAxisModel); + AngleAxisModel.type = 'angleAxis'; + return AngleAxisModel; + }(PolarAxisModel); var RadiusAxisModel = - /** @class */ - function (_super) { - __extends(RadiusAxisModel, _super); + /** @class */ + function (_super) { + __extends(RadiusAxisModel, _super); - function RadiusAxisModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function RadiusAxisModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = RadiusAxisModel.type; - return _this; - } + _this.type = RadiusAxisModel.type; + return _this; + } - RadiusAxisModel.type = 'radiusAxis'; - return RadiusAxisModel; - }(PolarAxisModel); + RadiusAxisModel.type = 'radiusAxis'; + return RadiusAxisModel; + }(PolarAxisModel); var RadiusAxis = - /** @class */ - function (_super) { - __extends(RadiusAxis, _super); + /** @class */ + function (_super) { + __extends(RadiusAxis, _super); - function RadiusAxis(scale, radiusExtent) { - return _super.call(this, 'radius', scale, radiusExtent) || this; - } + function RadiusAxis(scale, radiusExtent) { + return _super.call(this, 'radius', scale, radiusExtent) || this; + } - RadiusAxis.prototype.pointToData = function (point, clamp) { - return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1]; - }; + RadiusAxis.prototype.pointToData = function (point, clamp) { + return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1]; + }; - return RadiusAxis; - }(Axis); + return RadiusAxis; + }(Axis); RadiusAxis.prototype.dataToRadius = Axis.prototype.dataToCoord; RadiusAxis.prototype.radiusToData = Axis.prototype.coordToData; @@ -75431,73 +75431,73 @@ var inner$d = makeInner(); var AngleAxis = - /** @class */ - function (_super) { - __extends(AngleAxis, _super); + /** @class */ + function (_super) { + __extends(AngleAxis, _super); + + function AngleAxis(scale, angleExtent) { + return _super.call(this, 'angle', scale, angleExtent || [0, 360]) || this; + } + + AngleAxis.prototype.pointToData = function (point, clamp) { + return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1]; + }; + /** + * Only be called in category axis. + * Angle axis uses text height to decide interval + * + * @override + * @return {number} Auto interval for cateogry axis tick and label + */ - function AngleAxis(scale, angleExtent) { - return _super.call(this, 'angle', scale, angleExtent || [0, 360]) || this; - } - AngleAxis.prototype.pointToData = function (point, clamp) { - return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1]; - }; - /** - * Only be called in category axis. - * Angle axis uses text height to decide interval - * - * @override - * @return {number} Auto interval for cateogry axis tick and label - */ + AngleAxis.prototype.calculateCategoryInterval = function () { + var axis = this; + var labelModel = axis.getLabelModel(); + var ordinalScale = axis.scale; + var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization: + // avoid generating a long array by `getTicks` + // in large category data case. + var tickCount = ordinalScale.count(); - AngleAxis.prototype.calculateCategoryInterval = function () { - var axis = this; - var labelModel = axis.getLabelModel(); - var ordinalScale = axis.scale; - var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization: - // avoid generating a long array by `getTicks` - // in large category data case. + if (ordinalExtent[1] - ordinalExtent[0] < 1) { + return 0; + } - var tickCount = ordinalScale.count(); + var tickValue = ordinalExtent[0]; + var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue); + var unitH = Math.abs(unitSpan); // Not precise, just use height as text width + // and each distance from axis line yet. - if (ordinalExtent[1] - ordinalExtent[0] < 1) { - return 0; - } + var rect = getBoundingRect(tickValue == null ? '' : tickValue + '', labelModel.getFont(), 'center', 'top'); + var maxH = Math.max(rect.height, 7); + var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity. - var tickValue = ordinalExtent[0]; - var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue); - var unitH = Math.abs(unitSpan); // Not precise, just use height as text width - // and each distance from axis line yet. - - var rect = getBoundingRect(tickValue == null ? '' : tickValue + '', labelModel.getFont(), 'center', 'top'); - var maxH = Math.max(rect.height, 7); - var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity. - - isNaN(dh) && (dh = Infinity); - var interval = Math.max(0, Math.floor(dh)); - var cache = inner$d(axis.model); - var lastAutoInterval = cache.lastAutoInterval; - var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window, - // otherwise the calculated interval might jitter when the zoom - // window size is close to the interval-changing size. - - if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical - // point is not the same when zooming in or zooming out. - && lastAutoInterval > interval) { - interval = lastAutoInterval; - } // Only update cache if cache not used, otherwise the - // changing of interval is too insensitive. - else { - cache.lastTickCount = tickCount; - cache.lastAutoInterval = interval; - } + isNaN(dh) && (dh = Infinity); + var interval = Math.max(0, Math.floor(dh)); + var cache = inner$d(axis.model); + var lastAutoInterval = cache.lastAutoInterval; + var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window, + // otherwise the calculated interval might jitter when the zoom + // window size is close to the interval-changing size. - return interval; - }; + if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical + // point is not the same when zooming in or zooming out. + && lastAutoInterval > interval) { + interval = lastAutoInterval; + } // Only update cache if cache not used, otherwise the + // changing of interval is too insensitive. + else { + cache.lastTickCount = tickCount; + cache.lastAutoInterval = interval; + } + + return interval; + }; - return AngleAxis; - }(Axis); + return AngleAxis; + }(Axis); AngleAxis.prototype.dataToAngle = Axis.prototype.dataToCoord; AngleAxis.prototype.angleToData = Axis.prototype.coordToData; @@ -75505,207 +75505,207 @@ var polarDimensions = ['radius', 'angle']; var Polar = - /** @class */ - function () { - function Polar(name) { - this.dimensions = polarDimensions; - this.type = 'polar'; - /** - * x of polar center - */ - - this.cx = 0; - /** - * y of polar center - */ - - this.cy = 0; - this._radiusAxis = new RadiusAxis(); - this._angleAxis = new AngleAxis(); - this.axisPointerEnabled = true; - this.name = name || ''; - this._radiusAxis.polar = this._angleAxis.polar = this; - } - /** - * If contain coord - */ - - - Polar.prototype.containPoint = function (point) { - var coord = this.pointToCoord(point); - return this._radiusAxis.contain(coord[0]) && this._angleAxis.contain(coord[1]); - }; - /** - * If contain data - */ - - - Polar.prototype.containData = function (data) { - return this._radiusAxis.containData(data[0]) && this._angleAxis.containData(data[1]); - }; - - Polar.prototype.getAxis = function (dim) { - var key = '_' + dim + 'Axis'; - return this[key]; - }; + /** @class */ + function () { + function Polar(name) { + this.dimensions = polarDimensions; + this.type = 'polar'; + /** + * x of polar center + */ - Polar.prototype.getAxes = function () { - return [this._radiusAxis, this._angleAxis]; - }; - /** - * Get axes by type of scale - */ + this.cx = 0; + /** + * y of polar center + */ + this.cy = 0; + this._radiusAxis = new RadiusAxis(); + this._angleAxis = new AngleAxis(); + this.axisPointerEnabled = true; + this.name = name || ''; + this._radiusAxis.polar = this._angleAxis.polar = this; + } + /** + * If contain coord + */ - Polar.prototype.getAxesByScale = function (scaleType) { - var axes = []; - var angleAxis = this._angleAxis; - var radiusAxis = this._radiusAxis; - angleAxis.scale.type === scaleType && axes.push(angleAxis); - radiusAxis.scale.type === scaleType && axes.push(radiusAxis); - return axes; - }; - Polar.prototype.getAngleAxis = function () { - return this._angleAxis; - }; + Polar.prototype.containPoint = function (point) { + var coord = this.pointToCoord(point); + return this._radiusAxis.contain(coord[0]) && this._angleAxis.contain(coord[1]); + }; + /** + * If contain data + */ - Polar.prototype.getRadiusAxis = function () { - return this._radiusAxis; - }; - Polar.prototype.getOtherAxis = function (axis) { - var angleAxis = this._angleAxis; - return axis === angleAxis ? this._radiusAxis : angleAxis; - }; - /** - * Base axis will be used on stacking. - * - */ + Polar.prototype.containData = function (data) { + return this._radiusAxis.containData(data[0]) && this._angleAxis.containData(data[1]); + }; + Polar.prototype.getAxis = function (dim) { + var key = '_' + dim + 'Axis'; + return this[key]; + }; - Polar.prototype.getBaseAxis = function () { - return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAngleAxis(); - }; + Polar.prototype.getAxes = function () { + return [this._radiusAxis, this._angleAxis]; + }; + /** + * Get axes by type of scale + */ - Polar.prototype.getTooltipAxes = function (dim) { - var baseAxis = dim != null && dim !== 'auto' ? this.getAxis(dim) : this.getBaseAxis(); - return { - baseAxes: [baseAxis], - otherAxes: [this.getOtherAxis(baseAxis)] - }; - }; - /** - * Convert a single data item to (x, y) point. - * Parameter data is an array which the first element is radius and the second is angle - */ + Polar.prototype.getAxesByScale = function (scaleType) { + var axes = []; + var angleAxis = this._angleAxis; + var radiusAxis = this._radiusAxis; + angleAxis.scale.type === scaleType && axes.push(angleAxis); + radiusAxis.scale.type === scaleType && axes.push(radiusAxis); + return axes; + }; + + Polar.prototype.getAngleAxis = function () { + return this._angleAxis; + }; + + Polar.prototype.getRadiusAxis = function () { + return this._radiusAxis; + }; + + Polar.prototype.getOtherAxis = function (axis) { + var angleAxis = this._angleAxis; + return axis === angleAxis ? this._radiusAxis : angleAxis; + }; + /** + * Base axis will be used on stacking. + * + */ - Polar.prototype.dataToPoint = function (data, clamp) { - return this.coordToPoint([this._radiusAxis.dataToRadius(data[0], clamp), this._angleAxis.dataToAngle(data[1], clamp)]); - }; - /** - * Convert a (x, y) point to data - */ + Polar.prototype.getBaseAxis = function () { + return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAngleAxis(); + }; - Polar.prototype.pointToData = function (point, clamp) { - var coord = this.pointToCoord(point); - return [this._radiusAxis.radiusToData(coord[0], clamp), this._angleAxis.angleToData(coord[1], clamp)]; - }; - /** - * Convert a (x, y) point to (radius, angle) coord - */ + Polar.prototype.getTooltipAxes = function (dim) { + var baseAxis = dim != null && dim !== 'auto' ? this.getAxis(dim) : this.getBaseAxis(); + return { + baseAxes: [baseAxis], + otherAxes: [this.getOtherAxis(baseAxis)] + }; + }; + /** + * Convert a single data item to (x, y) point. + * Parameter data is an array which the first element is radius and the second is angle + */ - Polar.prototype.pointToCoord = function (point) { - var dx = point[0] - this.cx; - var dy = point[1] - this.cy; - var angleAxis = this.getAngleAxis(); - var extent = angleAxis.getExtent(); - var minAngle = Math.min(extent[0], extent[1]); - var maxAngle = Math.max(extent[0], extent[1]); // Fix fixed extent in polarCreator - // FIXME + Polar.prototype.dataToPoint = function (data, clamp) { + return this.coordToPoint([this._radiusAxis.dataToRadius(data[0], clamp), this._angleAxis.dataToAngle(data[1], clamp)]); + }; + /** + * Convert a (x, y) point to data + */ - angleAxis.inverse ? minAngle = maxAngle - 360 : maxAngle = minAngle + 360; - var radius = Math.sqrt(dx * dx + dy * dy); - dx /= radius; - dy /= radius; - var radian = Math.atan2(-dy, dx) / Math.PI * 180; // move to angleExtent - var dir = radian < minAngle ? 1 : -1; + Polar.prototype.pointToData = function (point, clamp) { + var coord = this.pointToCoord(point); + return [this._radiusAxis.radiusToData(coord[0], clamp), this._angleAxis.angleToData(coord[1], clamp)]; + }; + /** + * Convert a (x, y) point to (radius, angle) coord + */ - while (radian < minAngle || radian > maxAngle) { - radian += dir * 360; - } - return [radius, radian]; - }; - /** - * Convert a (radius, angle) coord to (x, y) point - */ + Polar.prototype.pointToCoord = function (point) { + var dx = point[0] - this.cx; + var dy = point[1] - this.cy; + var angleAxis = this.getAngleAxis(); + var extent = angleAxis.getExtent(); + var minAngle = Math.min(extent[0], extent[1]); + var maxAngle = Math.max(extent[0], extent[1]); // Fix fixed extent in polarCreator + // FIXME + angleAxis.inverse ? minAngle = maxAngle - 360 : maxAngle = minAngle + 360; + var radius = Math.sqrt(dx * dx + dy * dy); + dx /= radius; + dy /= radius; + var radian = Math.atan2(-dy, dx) / Math.PI * 180; // move to angleExtent - Polar.prototype.coordToPoint = function (coord) { - var radius = coord[0]; - var radian = coord[1] / 180 * Math.PI; - var x = Math.cos(radian) * radius + this.cx; // Inverse the y + var dir = radian < minAngle ? 1 : -1; - var y = -Math.sin(radian) * radius + this.cy; - return [x, y]; - }; - /** - * Get ring area of cartesian. - * Area will have a contain function to determine if a point is in the coordinate system. - */ + while (radian < minAngle || radian > maxAngle) { + radian += dir * 360; + } + return [radius, radian]; + }; + /** + * Convert a (radius, angle) coord to (x, y) point + */ - Polar.prototype.getArea = function () { - var angleAxis = this.getAngleAxis(); - var radiusAxis = this.getRadiusAxis(); - var radiusExtent = radiusAxis.getExtent().slice(); - radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse(); - var angleExtent = angleAxis.getExtent(); - var RADIAN = Math.PI / 180; - return { - cx: this.cx, - cy: this.cy, - r0: radiusExtent[0], - r: radiusExtent[1], - startAngle: -angleExtent[0] * RADIAN, - endAngle: -angleExtent[1] * RADIAN, - clockwise: angleAxis.inverse, - contain: function (x, y) { - // It's a ring shape. - // Start angle and end angle don't matter - var dx = x - this.cx; - var dy = y - this.cy; // minus a tiny value 1e-4 to avoid being clipped unexpectedly - - var d2 = dx * dx + dy * dy - 1e-4; - var r = this.r; - var r0 = this.r0; - return d2 <= r * r && d2 >= r0 * r0; - } - }; - }; - Polar.prototype.convertToPixel = function (ecModel, finder, value) { - var coordSys = getCoordSys$2(finder); - return coordSys === this ? this.dataToPoint(value) : null; - }; + Polar.prototype.coordToPoint = function (coord) { + var radius = coord[0]; + var radian = coord[1] / 180 * Math.PI; + var x = Math.cos(radian) * radius + this.cx; // Inverse the y + + var y = -Math.sin(radian) * radius + this.cy; + return [x, y]; + }; + /** + * Get ring area of cartesian. + * Area will have a contain function to determine if a point is in the coordinate system. + */ - Polar.prototype.convertFromPixel = function (ecModel, finder, pixel) { - var coordSys = getCoordSys$2(finder); - return coordSys === this ? this.pointToData(pixel) : null; - }; - return Polar; - }(); + Polar.prototype.getArea = function () { + var angleAxis = this.getAngleAxis(); + var radiusAxis = this.getRadiusAxis(); + var radiusExtent = radiusAxis.getExtent().slice(); + radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse(); + var angleExtent = angleAxis.getExtent(); + var RADIAN = Math.PI / 180; + return { + cx: this.cx, + cy: this.cy, + r0: radiusExtent[0], + r: radiusExtent[1], + startAngle: -angleExtent[0] * RADIAN, + endAngle: -angleExtent[1] * RADIAN, + clockwise: angleAxis.inverse, + contain: function (x, y) { + // It's a ring shape. + // Start angle and end angle don't matter + var dx = x - this.cx; + var dy = y - this.cy; // minus a tiny value 1e-4 to avoid being clipped unexpectedly + + var d2 = dx * dx + dy * dy - 1e-4; + var r = this.r; + var r0 = this.r0; + return d2 <= r * r && d2 >= r0 * r0; + } + }; + }; + + Polar.prototype.convertToPixel = function (ecModel, finder, value) { + var coordSys = getCoordSys$2(finder); + return coordSys === this ? this.dataToPoint(value) : null; + }; + + Polar.prototype.convertFromPixel = function (ecModel, finder, pixel) { + var coordSys = getCoordSys$2(finder); + return coordSys === this ? this.pointToData(pixel) : null; + }; + + return Polar; + }(); function getCoordSys$2(finder) { - var seriesModel = finder.seriesModel; - var polarModel = finder.polarModel; - return polarModel && polarModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem; + var seriesModel = finder.seriesModel; + var polarModel = finder.polarModel; + return polarModel && polarModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem; } /** @@ -75713,24 +75713,24 @@ */ function resizePolar(polar, polarModel, api) { - var center = polarModel.get('center'); - var width = api.getWidth(); - var height = api.getHeight(); - polar.cx = parsePercent$1(center[0], width); - polar.cy = parsePercent$1(center[1], height); - var radiusAxis = polar.getRadiusAxis(); - var size = Math.min(width, height) / 2; - var radius = polarModel.get('radius'); - - if (radius == null) { - radius = [0, '100%']; - } else if (!isArray(radius)) { - // r0 = 0 - radius = [0, radius]; - } - - var parsedRadius = [parsePercent$1(radius[0], size), parsePercent$1(radius[1], size)]; - radiusAxis.inverse ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0]) : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]); + var center = polarModel.get('center'); + var width = api.getWidth(); + var height = api.getHeight(); + polar.cx = parsePercent$1(center[0], width); + polar.cy = parsePercent$1(center[1], height); + var radiusAxis = polar.getRadiusAxis(); + var size = Math.min(width, height) / 2; + var radius = polarModel.get('radius'); + + if (radius == null) { + radius = [0, '100%']; + } else if (!isArray(radius)) { + // r0 = 0 + radius = [0, radius]; + } + + var parsedRadius = [parsePercent$1(radius[0], size), parsePercent$1(radius[1], size)]; + radiusAxis.inverse ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0]) : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]); } /** * Update polar @@ -75738,36 +75738,36 @@ function updatePolarScale(ecModel, api) { - var polar = this; - var angleAxis = polar.getAngleAxis(); - var radiusAxis = polar.getRadiusAxis(); // Reset scale - - angleAxis.scale.setExtent(Infinity, -Infinity); - radiusAxis.scale.setExtent(Infinity, -Infinity); - ecModel.eachSeries(function (seriesModel) { - if (seriesModel.coordinateSystem === polar) { - var data_1 = seriesModel.getData(); - each(getDataDimensionsOnAxis(data_1, 'radius'), function (dim) { - radiusAxis.scale.unionExtentFromData(data_1, dim); - }); - each(getDataDimensionsOnAxis(data_1, 'angle'), function (dim) { - angleAxis.scale.unionExtentFromData(data_1, dim); - }); - } - }); - niceScaleExtent(angleAxis.scale, angleAxis.model); - niceScaleExtent(radiusAxis.scale, radiusAxis.model); // Fix extent of category angle axis - - if (angleAxis.type === 'category' && !angleAxis.onBand) { - var extent = angleAxis.getExtent(); - var diff = 360 / angleAxis.scale.count(); - angleAxis.inverse ? extent[1] += diff : extent[1] -= diff; - angleAxis.setExtent(extent[0], extent[1]); - } + var polar = this; + var angleAxis = polar.getAngleAxis(); + var radiusAxis = polar.getRadiusAxis(); // Reset scale + + angleAxis.scale.setExtent(Infinity, -Infinity); + radiusAxis.scale.setExtent(Infinity, -Infinity); + ecModel.eachSeries(function (seriesModel) { + if (seriesModel.coordinateSystem === polar) { + var data_1 = seriesModel.getData(); + each(getDataDimensionsOnAxis(data_1, 'radius'), function (dim) { + radiusAxis.scale.unionExtentFromData(data_1, dim); + }); + each(getDataDimensionsOnAxis(data_1, 'angle'), function (dim) { + angleAxis.scale.unionExtentFromData(data_1, dim); + }); + } + }); + niceScaleExtent(angleAxis.scale, angleAxis.model); + niceScaleExtent(radiusAxis.scale, radiusAxis.model); // Fix extent of category angle axis + + if (angleAxis.type === 'category' && !angleAxis.onBand) { + var extent = angleAxis.getExtent(); + var diff = 360 / angleAxis.scale.count(); + angleAxis.inverse ? extent[1] += diff : extent[1] -= diff; + angleAxis.setExtent(extent[0], extent[1]); + } } function isAngleAxisModel(axisModel) { - return axisModel.mainType === 'angleAxis'; + return axisModel.mainType === 'angleAxis'; } /** * Set common axis properties @@ -75775,650 +75775,650 @@ function setAxis(axis, axisModel) { - axis.type = axisModel.get('type'); - axis.scale = createScaleByModel(axisModel); - axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category'; - axis.inverse = axisModel.get('inverse'); + axis.type = axisModel.get('type'); + axis.scale = createScaleByModel(axisModel); + axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category'; + axis.inverse = axisModel.get('inverse'); - if (isAngleAxisModel(axisModel)) { - axis.inverse = axis.inverse !== axisModel.get('clockwise'); - var startAngle = axisModel.get('startAngle'); - axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360)); - } // Inject axis instance + if (isAngleAxisModel(axisModel)) { + axis.inverse = axis.inverse !== axisModel.get('clockwise'); + var startAngle = axisModel.get('startAngle'); + axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360)); + } // Inject axis instance - axisModel.axis = axis; - axis.model = axisModel; + axisModel.axis = axis; + axis.model = axisModel; } var polarCreator = { - dimensions: polarDimensions, - create: function (ecModel, api) { - var polarList = []; - ecModel.eachComponent('polar', function (polarModel, idx) { - var polar = new Polar(idx + ''); // Inject resize and update method - - polar.update = updatePolarScale; - var radiusAxis = polar.getRadiusAxis(); - var angleAxis = polar.getAngleAxis(); - var radiusAxisModel = polarModel.findAxisModel('radiusAxis'); - var angleAxisModel = polarModel.findAxisModel('angleAxis'); - setAxis(radiusAxis, radiusAxisModel); - setAxis(angleAxis, angleAxisModel); - resizePolar(polar, polarModel, api); - polarList.push(polar); - polarModel.coordinateSystem = polar; - polar.model = polarModel; - }); // Inject coordinateSystem to series + dimensions: polarDimensions, + create: function (ecModel, api) { + var polarList = []; + ecModel.eachComponent('polar', function (polarModel, idx) { + var polar = new Polar(idx + ''); // Inject resize and update method + + polar.update = updatePolarScale; + var radiusAxis = polar.getRadiusAxis(); + var angleAxis = polar.getAngleAxis(); + var radiusAxisModel = polarModel.findAxisModel('radiusAxis'); + var angleAxisModel = polarModel.findAxisModel('angleAxis'); + setAxis(radiusAxis, radiusAxisModel); + setAxis(angleAxis, angleAxisModel); + resizePolar(polar, polarModel, api); + polarList.push(polar); + polarModel.coordinateSystem = polar; + polar.model = polarModel; + }); // Inject coordinateSystem to series - ecModel.eachSeries(function (seriesModel) { - if (seriesModel.get('coordinateSystem') === 'polar') { - var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0]; + ecModel.eachSeries(function (seriesModel) { + if (seriesModel.get('coordinateSystem') === 'polar') { + var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0]; - if ("development" !== 'production') { - if (!polarModel) { - throw new Error('Polar "' + retrieve(seriesModel.get('polarIndex'), seriesModel.get('polarId'), 0) + '" not found'); - } - } + if ("development" !== 'production') { + if (!polarModel) { + throw new Error('Polar "' + retrieve(seriesModel.get('polarIndex'), seriesModel.get('polarId'), 0) + '" not found'); + } + } - seriesModel.coordinateSystem = polarModel.coordinateSystem; - } - }); - return polarList; - } + seriesModel.coordinateSystem = polarModel.coordinateSystem; + } + }); + return polarList; + } }; var elementList$1 = ['axisLine', 'axisLabel', 'axisTick', 'minorTick', 'splitLine', 'minorSplitLine', 'splitArea']; function getAxisLineShape(polar, rExtent, angle) { - rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse()); - var start = polar.coordToPoint([rExtent[0], angle]); - var end = polar.coordToPoint([rExtent[1], angle]); - return { - x1: start[0], - y1: start[1], - x2: end[0], - y2: end[1] - }; + rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse()); + var start = polar.coordToPoint([rExtent[0], angle]); + var end = polar.coordToPoint([rExtent[1], angle]); + return { + x1: start[0], + y1: start[1], + x2: end[0], + y2: end[1] + }; } function getRadiusIdx(polar) { - var radiusAxis = polar.getRadiusAxis(); - return radiusAxis.inverse ? 0 : 1; + var radiusAxis = polar.getRadiusAxis(); + return radiusAxis.inverse ? 0 : 1; } // Remove the last tick which will overlap the first tick function fixAngleOverlap(list) { - var firstItem = list[0]; - var lastItem = list[list.length - 1]; + var firstItem = list[0]; + var lastItem = list[list.length - 1]; - if (firstItem && lastItem && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4) { - list.pop(); - } + if (firstItem && lastItem && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4) { + list.pop(); + } } var AngleAxisView = - /** @class */ - function (_super) { - __extends(AngleAxisView, _super); + /** @class */ + function (_super) { + __extends(AngleAxisView, _super); - function AngleAxisView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function AngleAxisView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = AngleAxisView.type; - _this.axisPointerClass = 'PolarAxisPointer'; - return _this; - } + _this.type = AngleAxisView.type; + _this.axisPointerClass = 'PolarAxisPointer'; + return _this; + } - AngleAxisView.prototype.render = function (angleAxisModel, ecModel) { - this.group.removeAll(); + AngleAxisView.prototype.render = function (angleAxisModel, ecModel) { + this.group.removeAll(); - if (!angleAxisModel.get('show')) { - return; - } + if (!angleAxisModel.get('show')) { + return; + } - var angleAxis = angleAxisModel.axis; - var polar = angleAxis.polar; - var radiusExtent = polar.getRadiusAxis().getExtent(); - var ticksAngles = angleAxis.getTicksCoords(); - var minorTickAngles = angleAxis.getMinorTicksCoords(); - var labels = map(angleAxis.getViewLabels(), function (labelItem) { - labelItem = clone(labelItem); - var scale = angleAxis.scale; - var tickValue = scale.type === 'ordinal' ? scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue; - labelItem.coord = angleAxis.dataToCoord(tickValue); - return labelItem; - }); - fixAngleOverlap(labels); - fixAngleOverlap(ticksAngles); - each(elementList$1, function (name) { - if (angleAxisModel.get([name, 'show']) && (!angleAxis.scale.isBlank() || name === 'axisLine')) { - angelAxisElementsBuilders[name](this.group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels); - } - }, this); - }; + var angleAxis = angleAxisModel.axis; + var polar = angleAxis.polar; + var radiusExtent = polar.getRadiusAxis().getExtent(); + var ticksAngles = angleAxis.getTicksCoords(); + var minorTickAngles = angleAxis.getMinorTicksCoords(); + var labels = map(angleAxis.getViewLabels(), function (labelItem) { + labelItem = clone(labelItem); + var scale = angleAxis.scale; + var tickValue = scale.type === 'ordinal' ? scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue; + labelItem.coord = angleAxis.dataToCoord(tickValue); + return labelItem; + }); + fixAngleOverlap(labels); + fixAngleOverlap(ticksAngles); + each(elementList$1, function (name) { + if (angleAxisModel.get([name, 'show']) && (!angleAxis.scale.isBlank() || name === 'axisLine')) { + angelAxisElementsBuilders[name](this.group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels); + } + }, this); + }; - AngleAxisView.type = 'angleAxis'; - return AngleAxisView; - }(AxisView); + AngleAxisView.type = 'angleAxis'; + return AngleAxisView; + }(AxisView); var angelAxisElementsBuilders = { - axisLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { - var lineStyleModel = angleAxisModel.getModel(['axisLine', 'lineStyle']); // extent id of the axis radius (r0 and r) - - var rId = getRadiusIdx(polar); - var r0Id = rId ? 0 : 1; - var shape; - - if (radiusExtent[r0Id] === 0) { - shape = new Circle({ - shape: { - cx: polar.cx, - cy: polar.cy, - r: radiusExtent[rId] - }, - style: lineStyleModel.getLineStyle(), - z2: 1, - silent: true - }); - } else { - shape = new Ring({ - shape: { - cx: polar.cx, - cy: polar.cy, - r: radiusExtent[rId], - r0: radiusExtent[r0Id] - }, - style: lineStyleModel.getLineStyle(), - z2: 1, - silent: true - }); - } + axisLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { + var lineStyleModel = angleAxisModel.getModel(['axisLine', 'lineStyle']); // extent id of the axis radius (r0 and r) - shape.style.fill = null; - group.add(shape); - }, - axisTick: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { - var tickModel = angleAxisModel.getModel('axisTick'); - var tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length'); - var radius = radiusExtent[getRadiusIdx(polar)]; - var lines = map(ticksAngles, function (tickAngleItem) { - return new Line({ - shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord) - }); - }); - group.add(mergePath$1(lines, { - style: defaults(tickModel.getModel('lineStyle').getLineStyle(), { - stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color']) - }) - })); - }, - minorTick: function (group, angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) { - if (!minorTickAngles.length) { - return; - } + var rId = getRadiusIdx(polar); + var r0Id = rId ? 0 : 1; + var shape; - var tickModel = angleAxisModel.getModel('axisTick'); - var minorTickModel = angleAxisModel.getModel('minorTick'); - var tickLen = (tickModel.get('inside') ? -1 : 1) * minorTickModel.get('length'); - var radius = radiusExtent[getRadiusIdx(polar)]; - var lines = []; + if (radiusExtent[r0Id] === 0) { + shape = new Circle({ + shape: { + cx: polar.cx, + cy: polar.cy, + r: radiusExtent[rId] + }, + style: lineStyleModel.getLineStyle(), + z2: 1, + silent: true + }); + } else { + shape = new Ring({ + shape: { + cx: polar.cx, + cy: polar.cy, + r: radiusExtent[rId], + r0: radiusExtent[r0Id] + }, + style: lineStyleModel.getLineStyle(), + z2: 1, + silent: true + }); + } + + shape.style.fill = null; + group.add(shape); + }, + axisTick: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { + var tickModel = angleAxisModel.getModel('axisTick'); + var tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length'); + var radius = radiusExtent[getRadiusIdx(polar)]; + var lines = map(ticksAngles, function (tickAngleItem) { + return new Line({ + shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord) + }); + }); + group.add(mergePath$1(lines, { + style: defaults(tickModel.getModel('lineStyle').getLineStyle(), { + stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color']) + }) + })); + }, + minorTick: function (group, angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) { + if (!minorTickAngles.length) { + return; + } - for (var i = 0; i < minorTickAngles.length; i++) { - for (var k = 0; k < minorTickAngles[i].length; k++) { - lines.push(new Line({ - shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord) - })); - } - } + var tickModel = angleAxisModel.getModel('axisTick'); + var minorTickModel = angleAxisModel.getModel('minorTick'); + var tickLen = (tickModel.get('inside') ? -1 : 1) * minorTickModel.get('length'); + var radius = radiusExtent[getRadiusIdx(polar)]; + var lines = []; - group.add(mergePath$1(lines, { - style: defaults(minorTickModel.getModel('lineStyle').getLineStyle(), defaults(tickModel.getLineStyle(), { - stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color']) - })) + for (var i = 0; i < minorTickAngles.length; i++) { + for (var k = 0; k < minorTickAngles[i].length; k++) { + lines.push(new Line({ + shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord) })); - }, - axisLabel: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) { - var rawCategoryData = angleAxisModel.getCategories(true); - var commonLabelModel = angleAxisModel.getModel('axisLabel'); - var labelMargin = commonLabelModel.get('margin'); - var triggerEvent = angleAxisModel.get('triggerEvent'); // Use length of ticksAngles because it may remove the last tick to avoid overlapping - - each(labels, function (labelItem, idx) { - var labelModel = commonLabelModel; - var tickValue = labelItem.tickValue; - var r = radiusExtent[getRadiusIdx(polar)]; - var p = polar.coordToPoint([r + labelMargin, labelItem.coord]); - var cx = polar.cx; - var cy = polar.cy; - var labelTextAlign = Math.abs(p[0] - cx) / r < 0.3 ? 'center' : p[0] > cx ? 'left' : 'right'; - var labelTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3 ? 'middle' : p[1] > cy ? 'top' : 'bottom'; - - if (rawCategoryData && rawCategoryData[tickValue]) { - var rawCategoryItem = rawCategoryData[tickValue]; - - if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) { - labelModel = new Model(rawCategoryItem.textStyle, commonLabelModel, commonLabelModel.ecModel); - } - } - - var textEl = new ZRText({ - silent: AxisBuilder.isLabelSilent(angleAxisModel), - style: createTextStyle(labelModel, { - x: p[0], - y: p[1], - fill: labelModel.getTextColor() || angleAxisModel.get(['axisLine', 'lineStyle', 'color']), - text: labelItem.formattedLabel, - align: labelTextAlign, - verticalAlign: labelTextVerticalAlign - }) - }); - group.add(textEl); // Pack data for mouse event - - if (triggerEvent) { - var eventData = AxisBuilder.makeAxisEventDataBase(angleAxisModel); - eventData.targetType = 'axisLabel'; - eventData.value = labelItem.rawLabel; - getECData(textEl).eventData = eventData; - } - }, this); - }, - splitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { - var splitLineModel = angleAxisModel.getModel('splitLine'); - var lineStyleModel = splitLineModel.getModel('lineStyle'); - var lineColors = lineStyleModel.get('color'); - var lineCount = 0; - lineColors = lineColors instanceof Array ? lineColors : [lineColors]; - var splitLines = []; - - for (var i = 0; i < ticksAngles.length; i++) { - var colorIndex = lineCount++ % lineColors.length; - splitLines[colorIndex] = splitLines[colorIndex] || []; - splitLines[colorIndex].push(new Line({ - shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord) - })); - } // Simple optimization - // Batching the lines if color are the same - - - for (var i = 0; i < splitLines.length; i++) { - group.add(mergePath$1(splitLines[i], { - style: defaults({ - stroke: lineColors[i % lineColors.length] - }, lineStyleModel.getLineStyle()), - silent: true, - z: angleAxisModel.get('z') - })); - } - }, - minorSplitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { - if (!minorTickAngles.length) { - return; - } + } + } - var minorSplitLineModel = angleAxisModel.getModel('minorSplitLine'); - var lineStyleModel = minorSplitLineModel.getModel('lineStyle'); - var lines = []; + group.add(mergePath$1(lines, { + style: defaults(minorTickModel.getModel('lineStyle').getLineStyle(), defaults(tickModel.getLineStyle(), { + stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color']) + })) + })); + }, + axisLabel: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) { + var rawCategoryData = angleAxisModel.getCategories(true); + var commonLabelModel = angleAxisModel.getModel('axisLabel'); + var labelMargin = commonLabelModel.get('margin'); + var triggerEvent = angleAxisModel.get('triggerEvent'); // Use length of ticksAngles because it may remove the last tick to avoid overlapping + + each(labels, function (labelItem, idx) { + var labelModel = commonLabelModel; + var tickValue = labelItem.tickValue; + var r = radiusExtent[getRadiusIdx(polar)]; + var p = polar.coordToPoint([r + labelMargin, labelItem.coord]); + var cx = polar.cx; + var cy = polar.cy; + var labelTextAlign = Math.abs(p[0] - cx) / r < 0.3 ? 'center' : p[0] > cx ? 'left' : 'right'; + var labelTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3 ? 'middle' : p[1] > cy ? 'top' : 'bottom'; + + if (rawCategoryData && rawCategoryData[tickValue]) { + var rawCategoryItem = rawCategoryData[tickValue]; + + if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) { + labelModel = new Model(rawCategoryItem.textStyle, commonLabelModel, commonLabelModel.ecModel); + } + } + + var textEl = new ZRText({ + silent: AxisBuilder.isLabelSilent(angleAxisModel), + style: createTextStyle(labelModel, { + x: p[0], + y: p[1], + fill: labelModel.getTextColor() || angleAxisModel.get(['axisLine', 'lineStyle', 'color']), + text: labelItem.formattedLabel, + align: labelTextAlign, + verticalAlign: labelTextVerticalAlign + }) + }); + group.add(textEl); // Pack data for mouse event + + if (triggerEvent) { + var eventData = AxisBuilder.makeAxisEventDataBase(angleAxisModel); + eventData.targetType = 'axisLabel'; + eventData.value = labelItem.rawLabel; + getECData(textEl).eventData = eventData; + } + }, this); + }, + splitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { + var splitLineModel = angleAxisModel.getModel('splitLine'); + var lineStyleModel = splitLineModel.getModel('lineStyle'); + var lineColors = lineStyleModel.get('color'); + var lineCount = 0; + lineColors = lineColors instanceof Array ? lineColors : [lineColors]; + var splitLines = []; + + for (var i = 0; i < ticksAngles.length; i++) { + var colorIndex = lineCount++ % lineColors.length; + splitLines[colorIndex] = splitLines[colorIndex] || []; + splitLines[colorIndex].push(new Line({ + shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord) + })); + } // Simple optimization + // Batching the lines if color are the same + + + for (var i = 0; i < splitLines.length; i++) { + group.add(mergePath$1(splitLines[i], { + style: defaults({ + stroke: lineColors[i % lineColors.length] + }, lineStyleModel.getLineStyle()), + silent: true, + z: angleAxisModel.get('z') + })); + } + }, + minorSplitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { + if (!minorTickAngles.length) { + return; + } - for (var i = 0; i < minorTickAngles.length; i++) { - for (var k = 0; k < minorTickAngles[i].length; k++) { - lines.push(new Line({ - shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord) - })); - } - } + var minorSplitLineModel = angleAxisModel.getModel('minorSplitLine'); + var lineStyleModel = minorSplitLineModel.getModel('lineStyle'); + var lines = []; - group.add(mergePath$1(lines, { - style: lineStyleModel.getLineStyle(), - silent: true, - z: angleAxisModel.get('z') + for (var i = 0; i < minorTickAngles.length; i++) { + for (var k = 0; k < minorTickAngles[i].length; k++) { + lines.push(new Line({ + shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord) })); - }, - splitArea: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { - if (!ticksAngles.length) { - return; - } - - var splitAreaModel = angleAxisModel.getModel('splitArea'); - var areaStyleModel = splitAreaModel.getModel('areaStyle'); - var areaColors = areaStyleModel.get('color'); - var lineCount = 0; - areaColors = areaColors instanceof Array ? areaColors : [areaColors]; - var splitAreas = []; - var RADIAN = Math.PI / 180; - var prevAngle = -ticksAngles[0].coord * RADIAN; - var r0 = Math.min(radiusExtent[0], radiusExtent[1]); - var r1 = Math.max(radiusExtent[0], radiusExtent[1]); - var clockwise = angleAxisModel.get('clockwise'); - - for (var i = 1, len = ticksAngles.length; i <= len; i++) { - var coord = i === len ? ticksAngles[0].coord : ticksAngles[i].coord; - var colorIndex = lineCount++ % areaColors.length; - splitAreas[colorIndex] = splitAreas[colorIndex] || []; - splitAreas[colorIndex].push(new Sector({ - shape: { - cx: polar.cx, - cy: polar.cy, - r0: r0, - r: r1, - startAngle: prevAngle, - endAngle: -coord * RADIAN, - clockwise: clockwise - }, - silent: true - })); - prevAngle = -coord * RADIAN; - } // Simple optimization - // Batching the lines if color are the same - + } + } - for (var i = 0; i < splitAreas.length; i++) { - group.add(mergePath$1(splitAreas[i], { - style: defaults({ - fill: areaColors[i % areaColors.length] - }, areaStyleModel.getAreaStyle()), - silent: true - })); - } + group.add(mergePath$1(lines, { + style: lineStyleModel.getLineStyle(), + silent: true, + z: angleAxisModel.get('z') + })); + }, + splitArea: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) { + if (!ticksAngles.length) { + return; } + + var splitAreaModel = angleAxisModel.getModel('splitArea'); + var areaStyleModel = splitAreaModel.getModel('areaStyle'); + var areaColors = areaStyleModel.get('color'); + var lineCount = 0; + areaColors = areaColors instanceof Array ? areaColors : [areaColors]; + var splitAreas = []; + var RADIAN = Math.PI / 180; + var prevAngle = -ticksAngles[0].coord * RADIAN; + var r0 = Math.min(radiusExtent[0], radiusExtent[1]); + var r1 = Math.max(radiusExtent[0], radiusExtent[1]); + var clockwise = angleAxisModel.get('clockwise'); + + for (var i = 1, len = ticksAngles.length; i <= len; i++) { + var coord = i === len ? ticksAngles[0].coord : ticksAngles[i].coord; + var colorIndex = lineCount++ % areaColors.length; + splitAreas[colorIndex] = splitAreas[colorIndex] || []; + splitAreas[colorIndex].push(new Sector({ + shape: { + cx: polar.cx, + cy: polar.cy, + r0: r0, + r: r1, + startAngle: prevAngle, + endAngle: -coord * RADIAN, + clockwise: clockwise + }, + silent: true + })); + prevAngle = -coord * RADIAN; + } // Simple optimization + // Batching the lines if color are the same + + + for (var i = 0; i < splitAreas.length; i++) { + group.add(mergePath$1(splitAreas[i], { + style: defaults({ + fill: areaColors[i % areaColors.length] + }, areaStyleModel.getAreaStyle()), + silent: true + })); + } + } }; var axisBuilderAttrs$2 = ['axisLine', 'axisTickLabel', 'axisName']; var selfBuilderAttrs$1 = ['splitLine', 'splitArea', 'minorSplitLine']; var RadiusAxisView = - /** @class */ - function (_super) { - __extends(RadiusAxisView, _super); + /** @class */ + function (_super) { + __extends(RadiusAxisView, _super); - function RadiusAxisView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function RadiusAxisView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = RadiusAxisView.type; - _this.axisPointerClass = 'PolarAxisPointer'; - return _this; - } + _this.type = RadiusAxisView.type; + _this.axisPointerClass = 'PolarAxisPointer'; + return _this; + } - RadiusAxisView.prototype.render = function (radiusAxisModel, ecModel) { - this.group.removeAll(); + RadiusAxisView.prototype.render = function (radiusAxisModel, ecModel) { + this.group.removeAll(); - if (!radiusAxisModel.get('show')) { - return; - } + if (!radiusAxisModel.get('show')) { + return; + } - var oldAxisGroup = this._axisGroup; - var newAxisGroup = this._axisGroup = new Group(); - this.group.add(newAxisGroup); - var radiusAxis = radiusAxisModel.axis; - var polar = radiusAxis.polar; - var angleAxis = polar.getAngleAxis(); - var ticksCoords = radiusAxis.getTicksCoords(); - var minorTicksCoords = radiusAxis.getMinorTicksCoords(); - var axisAngle = angleAxis.getExtent()[0]; - var radiusExtent = radiusAxis.getExtent(); - var layout = layoutAxis(polar, radiusAxisModel, axisAngle); - var axisBuilder = new AxisBuilder(radiusAxisModel, layout); - each(axisBuilderAttrs$2, axisBuilder.add, axisBuilder); - newAxisGroup.add(axisBuilder.getGroup()); - groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel); - each(selfBuilderAttrs$1, function (name) { - if (radiusAxisModel.get([name, 'show']) && !radiusAxis.scale.isBlank()) { - axisElementBuilders$1[name](this.group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords); - } - }, this); - }; + var oldAxisGroup = this._axisGroup; + var newAxisGroup = this._axisGroup = new Group(); + this.group.add(newAxisGroup); + var radiusAxis = radiusAxisModel.axis; + var polar = radiusAxis.polar; + var angleAxis = polar.getAngleAxis(); + var ticksCoords = radiusAxis.getTicksCoords(); + var minorTicksCoords = radiusAxis.getMinorTicksCoords(); + var axisAngle = angleAxis.getExtent()[0]; + var radiusExtent = radiusAxis.getExtent(); + var layout = layoutAxis(polar, radiusAxisModel, axisAngle); + var axisBuilder = new AxisBuilder(radiusAxisModel, layout); + each(axisBuilderAttrs$2, axisBuilder.add, axisBuilder); + newAxisGroup.add(axisBuilder.getGroup()); + groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel); + each(selfBuilderAttrs$1, function (name) { + if (radiusAxisModel.get([name, 'show']) && !radiusAxis.scale.isBlank()) { + axisElementBuilders$1[name](this.group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords); + } + }, this); + }; - RadiusAxisView.type = 'radiusAxis'; - return RadiusAxisView; - }(AxisView); + RadiusAxisView.type = 'radiusAxis'; + return RadiusAxisView; + }(AxisView); var axisElementBuilders$1 = { - splitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) { - var splitLineModel = radiusAxisModel.getModel('splitLine'); - var lineStyleModel = splitLineModel.getModel('lineStyle'); - var lineColors = lineStyleModel.get('color'); - var lineCount = 0; - lineColors = lineColors instanceof Array ? lineColors : [lineColors]; - var splitLines = []; - - for (var i = 0; i < ticksCoords.length; i++) { - var colorIndex = lineCount++ % lineColors.length; - splitLines[colorIndex] = splitLines[colorIndex] || []; - splitLines[colorIndex].push(new Circle({ - shape: { - cx: polar.cx, - cy: polar.cy, - // ensure circle radius >= 0 - r: Math.max(ticksCoords[i].coord, 0) - } - })); - } // Simple optimization - // Batching the lines if color are the same - - - for (var i = 0; i < splitLines.length; i++) { - group.add(mergePath$1(splitLines[i], { - style: defaults({ - stroke: lineColors[i % lineColors.length], - fill: null - }, lineStyleModel.getLineStyle()), - silent: true - })); - } - }, - minorSplitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) { - if (!minorTicksCoords.length) { - return; - } + splitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) { + var splitLineModel = radiusAxisModel.getModel('splitLine'); + var lineStyleModel = splitLineModel.getModel('lineStyle'); + var lineColors = lineStyleModel.get('color'); + var lineCount = 0; + lineColors = lineColors instanceof Array ? lineColors : [lineColors]; + var splitLines = []; - var minorSplitLineModel = radiusAxisModel.getModel('minorSplitLine'); - var lineStyleModel = minorSplitLineModel.getModel('lineStyle'); - var lines = []; + for (var i = 0; i < ticksCoords.length; i++) { + var colorIndex = lineCount++ % lineColors.length; + splitLines[colorIndex] = splitLines[colorIndex] || []; + splitLines[colorIndex].push(new Circle({ + shape: { + cx: polar.cx, + cy: polar.cy, + // ensure circle radius >= 0 + r: Math.max(ticksCoords[i].coord, 0) + } + })); + } // Simple optimization + // Batching the lines if color are the same + + + for (var i = 0; i < splitLines.length; i++) { + group.add(mergePath$1(splitLines[i], { + style: defaults({ + stroke: lineColors[i % lineColors.length], + fill: null + }, lineStyleModel.getLineStyle()), + silent: true + })); + } + }, + minorSplitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) { + if (!minorTicksCoords.length) { + return; + } - for (var i = 0; i < minorTicksCoords.length; i++) { - for (var k = 0; k < minorTicksCoords[i].length; k++) { - lines.push(new Circle({ - shape: { - cx: polar.cx, - cy: polar.cy, - r: minorTicksCoords[i][k].coord - } - })); - } - } + var minorSplitLineModel = radiusAxisModel.getModel('minorSplitLine'); + var lineStyleModel = minorSplitLineModel.getModel('lineStyle'); + var lines = []; - group.add(mergePath$1(lines, { - style: defaults({ - fill: null - }, lineStyleModel.getLineStyle()), - silent: true + for (var i = 0; i < minorTicksCoords.length; i++) { + for (var k = 0; k < minorTicksCoords[i].length; k++) { + lines.push(new Circle({ + shape: { + cx: polar.cx, + cy: polar.cy, + r: minorTicksCoords[i][k].coord + } })); - }, - splitArea: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) { - if (!ticksCoords.length) { - return; - } + } + } - var splitAreaModel = radiusAxisModel.getModel('splitArea'); - var areaStyleModel = splitAreaModel.getModel('areaStyle'); - var areaColors = areaStyleModel.get('color'); - var lineCount = 0; - areaColors = areaColors instanceof Array ? areaColors : [areaColors]; - var splitAreas = []; - var prevRadius = ticksCoords[0].coord; - - for (var i = 1; i < ticksCoords.length; i++) { - var colorIndex = lineCount++ % areaColors.length; - splitAreas[colorIndex] = splitAreas[colorIndex] || []; - splitAreas[colorIndex].push(new Sector({ - shape: { - cx: polar.cx, - cy: polar.cy, - r0: prevRadius, - r: ticksCoords[i].coord, - startAngle: 0, - endAngle: Math.PI * 2 - }, - silent: true - })); - prevRadius = ticksCoords[i].coord; - } // Simple optimization - // Batching the lines if color are the same + group.add(mergePath$1(lines, { + style: defaults({ + fill: null + }, lineStyleModel.getLineStyle()), + silent: true + })); + }, + splitArea: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) { + if (!ticksCoords.length) { + return; + } + var splitAreaModel = radiusAxisModel.getModel('splitArea'); + var areaStyleModel = splitAreaModel.getModel('areaStyle'); + var areaColors = areaStyleModel.get('color'); + var lineCount = 0; + areaColors = areaColors instanceof Array ? areaColors : [areaColors]; + var splitAreas = []; + var prevRadius = ticksCoords[0].coord; - for (var i = 0; i < splitAreas.length; i++) { - group.add(mergePath$1(splitAreas[i], { - style: defaults({ - fill: areaColors[i % areaColors.length] - }, areaStyleModel.getAreaStyle()), - silent: true - })); - } - } + for (var i = 1; i < ticksCoords.length; i++) { + var colorIndex = lineCount++ % areaColors.length; + splitAreas[colorIndex] = splitAreas[colorIndex] || []; + splitAreas[colorIndex].push(new Sector({ + shape: { + cx: polar.cx, + cy: polar.cy, + r0: prevRadius, + r: ticksCoords[i].coord, + startAngle: 0, + endAngle: Math.PI * 2 + }, + silent: true + })); + prevRadius = ticksCoords[i].coord; + } // Simple optimization + // Batching the lines if color are the same + + + for (var i = 0; i < splitAreas.length; i++) { + group.add(mergePath$1(splitAreas[i], { + style: defaults({ + fill: areaColors[i % areaColors.length] + }, areaStyleModel.getAreaStyle()), + silent: true + })); + } + } }; /** * @inner */ function layoutAxis(polar, radiusAxisModel, axisAngle) { - return { - position: [polar.cx, polar.cy], - rotation: axisAngle / 180 * Math.PI, - labelDirection: -1, - tickDirection: -1, - nameDirection: 1, - labelRotate: radiusAxisModel.getModel('axisLabel').get('rotate'), - // Over splitLine and splitArea - z2: 1 - }; + return { + position: [polar.cx, polar.cy], + rotation: axisAngle / 180 * Math.PI, + labelDirection: -1, + tickDirection: -1, + nameDirection: 1, + labelRotate: radiusAxisModel.getModel('axisLabel').get('rotate'), + // Over splitLine and splitArea + z2: 1 + }; } function getSeriesStackId$1(seriesModel) { - return seriesModel.get('stack') || '__ec_stack_' + seriesModel.seriesIndex; + return seriesModel.get('stack') || '__ec_stack_' + seriesModel.seriesIndex; } function getAxisKey$1(polar, axis) { - return axis.dim + polar.model.componentIndex; + return axis.dim + polar.model.componentIndex; } function barLayoutPolar(seriesType, ecModel, api) { - var lastStackCoords = {}; - var barWidthAndOffset = calRadialBar(filter(ecModel.getSeriesByType(seriesType), function (seriesModel) { - return !ecModel.isSeriesFiltered(seriesModel) && seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'polar'; - })); - ecModel.eachSeriesByType(seriesType, function (seriesModel) { - // Check series coordinate, do layout for polar only - if (seriesModel.coordinateSystem.type !== 'polar') { - return; - } - - var data = seriesModel.getData(); - var polar = seriesModel.coordinateSystem; - var baseAxis = polar.getBaseAxis(); - var axisKey = getAxisKey$1(polar, baseAxis); - var stackId = getSeriesStackId$1(seriesModel); - var columnLayoutInfo = barWidthAndOffset[axisKey][stackId]; - var columnOffset = columnLayoutInfo.offset; - var columnWidth = columnLayoutInfo.width; - var valueAxis = polar.getOtherAxis(baseAxis); - var cx = seriesModel.coordinateSystem.cx; - var cy = seriesModel.coordinateSystem.cy; - var barMinHeight = seriesModel.get('barMinHeight') || 0; - var barMinAngle = seriesModel.get('barMinAngle') || 0; - lastStackCoords[stackId] = lastStackCoords[stackId] || []; - var valueDim = data.mapDimension(valueAxis.dim); - var baseDim = data.mapDimension(baseAxis.dim); - var stacked = isDimensionStacked(data, valueDim - /*, baseDim*/ - ); - var clampLayout = baseAxis.dim !== 'radius' || !seriesModel.get('roundCap', true); - var valueAxisStart = valueAxis.dataToCoord(0); - - for (var idx = 0, len = data.count(); idx < len; idx++) { - var value = data.get(valueDim, idx); - var baseValue = data.get(baseDim, idx); - var sign = value >= 0 ? 'p' : 'n'; - var baseCoord = valueAxisStart; // Because of the barMinHeight, we can not use the value in - // stackResultDimension directly. - // Only ordinal axis can be stacked. - - if (stacked) { - if (!lastStackCoords[stackId][baseValue]) { - lastStackCoords[stackId][baseValue] = { - p: valueAxisStart, - n: valueAxisStart // Negative stack - - }; - } // Should also consider #4243 - - - baseCoord = lastStackCoords[stackId][baseValue][sign]; - } - - var r0 = void 0; - var r = void 0; - var startAngle = void 0; - var endAngle = void 0; // radial sector - - if (valueAxis.dim === 'radius') { - var radiusSpan = valueAxis.dataToCoord(value) - valueAxisStart; - var angle = baseAxis.dataToCoord(baseValue); - - if (Math.abs(radiusSpan) < barMinHeight) { - radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight; - } - - r0 = baseCoord; - r = baseCoord + radiusSpan; - startAngle = angle - columnOffset; - endAngle = startAngle - columnWidth; - stacked && (lastStackCoords[stackId][baseValue][sign] = r); - } // tangential sector - else { - var angleSpan = valueAxis.dataToCoord(value, clampLayout) - valueAxisStart; - var radius = baseAxis.dataToCoord(baseValue); + var lastStackCoords = {}; + var barWidthAndOffset = calRadialBar(filter(ecModel.getSeriesByType(seriesType), function (seriesModel) { + return !ecModel.isSeriesFiltered(seriesModel) && seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'polar'; + })); + ecModel.eachSeriesByType(seriesType, function (seriesModel) { + // Check series coordinate, do layout for polar only + if (seriesModel.coordinateSystem.type !== 'polar') { + return; + } - if (Math.abs(angleSpan) < barMinAngle) { - angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle; - } + var data = seriesModel.getData(); + var polar = seriesModel.coordinateSystem; + var baseAxis = polar.getBaseAxis(); + var axisKey = getAxisKey$1(polar, baseAxis); + var stackId = getSeriesStackId$1(seriesModel); + var columnLayoutInfo = barWidthAndOffset[axisKey][stackId]; + var columnOffset = columnLayoutInfo.offset; + var columnWidth = columnLayoutInfo.width; + var valueAxis = polar.getOtherAxis(baseAxis); + var cx = seriesModel.coordinateSystem.cx; + var cy = seriesModel.coordinateSystem.cy; + var barMinHeight = seriesModel.get('barMinHeight') || 0; + var barMinAngle = seriesModel.get('barMinAngle') || 0; + lastStackCoords[stackId] = lastStackCoords[stackId] || []; + var valueDim = data.mapDimension(valueAxis.dim); + var baseDim = data.mapDimension(baseAxis.dim); + var stacked = isDimensionStacked(data, valueDim + /*, baseDim*/ + ); + var clampLayout = baseAxis.dim !== 'radius' || !seriesModel.get('roundCap', true); + var valueAxisStart = valueAxis.dataToCoord(0); + + for (var idx = 0, len = data.count(); idx < len; idx++) { + var value = data.get(valueDim, idx); + var baseValue = data.get(baseDim, idx); + var sign = value >= 0 ? 'p' : 'n'; + var baseCoord = valueAxisStart; // Because of the barMinHeight, we can not use the value in + // stackResultDimension directly. + // Only ordinal axis can be stacked. + + if (stacked) { + if (!lastStackCoords[stackId][baseValue]) { + lastStackCoords[stackId][baseValue] = { + p: valueAxisStart, + n: valueAxisStart // Negative stack + + }; + } // Should also consider #4243 + + + baseCoord = lastStackCoords[stackId][baseValue][sign]; + } + + var r0 = void 0; + var r = void 0; + var startAngle = void 0; + var endAngle = void 0; // radial sector + + if (valueAxis.dim === 'radius') { + var radiusSpan = valueAxis.dataToCoord(value) - valueAxisStart; + var angle = baseAxis.dataToCoord(baseValue); + + if (Math.abs(radiusSpan) < barMinHeight) { + radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight; + } + + r0 = baseCoord; + r = baseCoord + radiusSpan; + startAngle = angle - columnOffset; + endAngle = startAngle - columnWidth; + stacked && (lastStackCoords[stackId][baseValue][sign] = r); + } // tangential sector + else { + var angleSpan = valueAxis.dataToCoord(value, clampLayout) - valueAxisStart; + var radius = baseAxis.dataToCoord(baseValue); + + if (Math.abs(angleSpan) < barMinAngle) { + angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle; + } + + r0 = radius + columnOffset; + r = r0 + columnWidth; + startAngle = baseCoord; + endAngle = baseCoord + angleSpan; // if the previous stack is at the end of the ring, + // add a round to differentiate it from origin + // let extent = angleAxis.getExtent(); + // let stackCoord = angle; + // if (stackCoord === extent[0] && value > 0) { + // stackCoord = extent[1]; + // } + // else if (stackCoord === extent[1] && value < 0) { + // stackCoord = extent[0]; + // } + + stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle); + } + + data.setItemLayout(idx, { + cx: cx, + cy: cy, + r0: r0, + r: r, + // Consider that positive angle is anti-clockwise, + // while positive radian of sector is clockwise + startAngle: -startAngle * Math.PI / 180, + endAngle: -endAngle * Math.PI / 180, - r0 = radius + columnOffset; - r = r0 + columnWidth; - startAngle = baseCoord; - endAngle = baseCoord + angleSpan; // if the previous stack is at the end of the ring, - // add a round to differentiate it from origin - // let extent = angleAxis.getExtent(); - // let stackCoord = angle; - // if (stackCoord === extent[0] && value > 0) { - // stackCoord = extent[1]; - // } - // else if (stackCoord === extent[1] && value < 0) { - // stackCoord = extent[0]; - // } - - stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle); - } - - data.setItemLayout(idx, { - cx: cx, - cy: cy, - r0: r0, - r: r, - // Consider that positive angle is anti-clockwise, - // while positive radian of sector is clockwise - startAngle: -startAngle * Math.PI / 180, - endAngle: -endAngle * Math.PI / 180, - - /** - * Keep the same logic with bar in catesion: use end value to - * control direction. Notice that if clockwise is true (by - * default), the sector will always draw clockwisely, no matter - * whether endAngle is greater or less than startAngle. - */ - clockwise: startAngle >= endAngle - }); - } - }); + /** + * Keep the same logic with bar in catesion: use end value to + * control direction. Notice that if clockwise is true (by + * default), the sector will always draw clockwisely, no matter + * whether endAngle is greater or less than startAngle. + */ + clockwise: startAngle >= endAngle + }); + } + }); } /** * Calculate bar width and offset for radial bar charts @@ -76426,399 +76426,399 @@ function calRadialBar(barSeries) { - // Columns info on each category axis. Key is polar name - var columnsMap = {}; - each(barSeries, function (seriesModel, idx) { - var data = seriesModel.getData(); - var polar = seriesModel.coordinateSystem; - var baseAxis = polar.getBaseAxis(); - var axisKey = getAxisKey$1(polar, baseAxis); - var axisExtent = baseAxis.getExtent(); - var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count(); - var columnsOnAxis = columnsMap[axisKey] || { - bandWidth: bandWidth, - remainedWidth: bandWidth, - autoWidthCount: 0, - categoryGap: '20%', - gap: '30%', - stacks: {} - }; - var stacks = columnsOnAxis.stacks; - columnsMap[axisKey] = columnsOnAxis; - var stackId = getSeriesStackId$1(seriesModel); - - if (!stacks[stackId]) { - columnsOnAxis.autoWidthCount++; - } - - stacks[stackId] = stacks[stackId] || { - width: 0, - maxWidth: 0 - }; - var barWidth = parsePercent$1(seriesModel.get('barWidth'), bandWidth); - var barMaxWidth = parsePercent$1(seriesModel.get('barMaxWidth'), bandWidth); - var barGap = seriesModel.get('barGap'); - var barCategoryGap = seriesModel.get('barCategoryGap'); - - if (barWidth && !stacks[stackId].width) { - barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth); - stacks[stackId].width = barWidth; - columnsOnAxis.remainedWidth -= barWidth; - } - - barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth); - barGap != null && (columnsOnAxis.gap = barGap); - barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap); - }); - var result = {}; - each(columnsMap, function (columnsOnAxis, coordSysName) { - result[coordSysName] = {}; - var stacks = columnsOnAxis.stacks; - var bandWidth = columnsOnAxis.bandWidth; - var categoryGap = parsePercent$1(columnsOnAxis.categoryGap, bandWidth); - var barGapPercent = parsePercent$1(columnsOnAxis.gap, 1); - var remainedWidth = columnsOnAxis.remainedWidth; - var autoWidthCount = columnsOnAxis.autoWidthCount; - var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); - autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth - - each(stacks, function (column, stack) { - var maxWidth = column.maxWidth; - - if (maxWidth && maxWidth < autoWidth) { - maxWidth = Math.min(maxWidth, remainedWidth); - - if (column.width) { - maxWidth = Math.min(maxWidth, column.width); - } - - remainedWidth -= maxWidth; - column.width = maxWidth; - autoWidthCount--; - } - }); // Recalculate width again - - autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); - autoWidth = Math.max(autoWidth, 0); - var widthSum = 0; - var lastColumn; - each(stacks, function (column, idx) { - if (!column.width) { - column.width = autoWidth; - } - - lastColumn = column; - widthSum += column.width * (1 + barGapPercent); - }); + // Columns info on each category axis. Key is polar name + var columnsMap = {}; + each(barSeries, function (seriesModel, idx) { + var data = seriesModel.getData(); + var polar = seriesModel.coordinateSystem; + var baseAxis = polar.getBaseAxis(); + var axisKey = getAxisKey$1(polar, baseAxis); + var axisExtent = baseAxis.getExtent(); + var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count(); + var columnsOnAxis = columnsMap[axisKey] || { + bandWidth: bandWidth, + remainedWidth: bandWidth, + autoWidthCount: 0, + categoryGap: '20%', + gap: '30%', + stacks: {} + }; + var stacks = columnsOnAxis.stacks; + columnsMap[axisKey] = columnsOnAxis; + var stackId = getSeriesStackId$1(seriesModel); + + if (!stacks[stackId]) { + columnsOnAxis.autoWidthCount++; + } + + stacks[stackId] = stacks[stackId] || { + width: 0, + maxWidth: 0 + }; + var barWidth = parsePercent$1(seriesModel.get('barWidth'), bandWidth); + var barMaxWidth = parsePercent$1(seriesModel.get('barMaxWidth'), bandWidth); + var barGap = seriesModel.get('barGap'); + var barCategoryGap = seriesModel.get('barCategoryGap'); + + if (barWidth && !stacks[stackId].width) { + barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth); + stacks[stackId].width = barWidth; + columnsOnAxis.remainedWidth -= barWidth; + } + + barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth); + barGap != null && (columnsOnAxis.gap = barGap); + barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap); + }); + var result = {}; + each(columnsMap, function (columnsOnAxis, coordSysName) { + result[coordSysName] = {}; + var stacks = columnsOnAxis.stacks; + var bandWidth = columnsOnAxis.bandWidth; + var categoryGap = parsePercent$1(columnsOnAxis.categoryGap, bandWidth); + var barGapPercent = parsePercent$1(columnsOnAxis.gap, 1); + var remainedWidth = columnsOnAxis.remainedWidth; + var autoWidthCount = columnsOnAxis.autoWidthCount; + var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); + autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth + + each(stacks, function (column, stack) { + var maxWidth = column.maxWidth; + + if (maxWidth && maxWidth < autoWidth) { + maxWidth = Math.min(maxWidth, remainedWidth); + + if (column.width) { + maxWidth = Math.min(maxWidth, column.width); + } + + remainedWidth -= maxWidth; + column.width = maxWidth; + autoWidthCount--; + } + }); // Recalculate width again + + autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent); + autoWidth = Math.max(autoWidth, 0); + var widthSum = 0; + var lastColumn; + each(stacks, function (column, idx) { + if (!column.width) { + column.width = autoWidth; + } + + lastColumn = column; + widthSum += column.width * (1 + barGapPercent); + }); - if (lastColumn) { - widthSum -= lastColumn.width * barGapPercent; - } + if (lastColumn) { + widthSum -= lastColumn.width * barGapPercent; + } - var offset = -widthSum / 2; - each(stacks, function (column, stackId) { - result[coordSysName][stackId] = result[coordSysName][stackId] || { - offset: offset, - width: column.width - }; - offset += column.width * (1 + barGapPercent); - }); + var offset = -widthSum / 2; + each(stacks, function (column, stackId) { + result[coordSysName][stackId] = result[coordSysName][stackId] || { + offset: offset, + width: column.width + }; + offset += column.width * (1 + barGapPercent); }); - return result; + }); + return result; } var angleAxisExtraOption = { - startAngle: 90, - clockwise: true, - splitNumber: 12, - axisLabel: { - rotate: 0 - } + startAngle: 90, + clockwise: true, + splitNumber: 12, + axisLabel: { + rotate: 0 + } }; var radiusAxisExtraOption = { - splitNumber: 5 + splitNumber: 5 }; var PolarView = - /** @class */ - function (_super) { - __extends(PolarView, _super); + /** @class */ + function (_super) { + __extends(PolarView, _super); - function PolarView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function PolarView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = PolarView.type; - return _this; - } + _this.type = PolarView.type; + return _this; + } - PolarView.type = 'polar'; - return PolarView; - }(ComponentView); + PolarView.type = 'polar'; + return PolarView; + }(ComponentView); function install$u(registers) { - use(install$s); - AxisView.registerAxisPointerClass('PolarAxisPointer', PolarAxisPointer); - registers.registerCoordinateSystem('polar', polarCreator); - registers.registerComponentModel(PolarModel); - registers.registerComponentView(PolarView); // Model and view for angleAxis and radiusAxis + use(install$s); + AxisView.registerAxisPointerClass('PolarAxisPointer', PolarAxisPointer); + registers.registerCoordinateSystem('polar', polarCreator); + registers.registerComponentModel(PolarModel); + registers.registerComponentView(PolarView); // Model and view for angleAxis and radiusAxis - axisModelCreator(registers, 'angle', AngleAxisModel, angleAxisExtraOption); - axisModelCreator(registers, 'radius', RadiusAxisModel, radiusAxisExtraOption); - registers.registerComponentView(AngleAxisView); - registers.registerComponentView(RadiusAxisView); - registers.registerLayout(curry(barLayoutPolar, 'bar')); + axisModelCreator(registers, 'angle', AngleAxisModel, angleAxisExtraOption); + axisModelCreator(registers, 'radius', RadiusAxisModel, radiusAxisExtraOption); + registers.registerComponentView(AngleAxisView); + registers.registerComponentView(RadiusAxisView); + registers.registerLayout(curry(barLayoutPolar, 'bar')); } function layout$2(axisModel, opt) { - opt = opt || {}; - var single = axisModel.coordinateSystem; - var axis = axisModel.axis; - var layout = {}; - var axisPosition = axis.position; - var orient = axis.orient; - var rect = single.getRect(); - var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height]; - var positionMap = { - horizontal: { - top: rectBound[2], - bottom: rectBound[3] - }, - vertical: { - left: rectBound[0], - right: rectBound[1] - } - }; - layout.position = [orient === 'vertical' ? positionMap.vertical[axisPosition] : rectBound[0], orient === 'horizontal' ? positionMap.horizontal[axisPosition] : rectBound[3]]; - var r = { - horizontal: 0, - vertical: 1 - }; - layout.rotation = Math.PI / 2 * r[orient]; - var directionMap = { - top: -1, - bottom: 1, - right: 1, - left: -1 - }; - layout.labelDirection = layout.tickDirection = layout.nameDirection = directionMap[axisPosition]; - - if (axisModel.get(['axisTick', 'inside'])) { - layout.tickDirection = -layout.tickDirection; - } - - if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) { - layout.labelDirection = -layout.labelDirection; - } - - var labelRotation = opt.rotate; - labelRotation == null && (labelRotation = axisModel.get(['axisLabel', 'rotate'])); - layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation; - layout.z2 = 1; - return layout; + opt = opt || {}; + var single = axisModel.coordinateSystem; + var axis = axisModel.axis; + var layout = {}; + var axisPosition = axis.position; + var orient = axis.orient; + var rect = single.getRect(); + var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height]; + var positionMap = { + horizontal: { + top: rectBound[2], + bottom: rectBound[3] + }, + vertical: { + left: rectBound[0], + right: rectBound[1] + } + }; + layout.position = [orient === 'vertical' ? positionMap.vertical[axisPosition] : rectBound[0], orient === 'horizontal' ? positionMap.horizontal[axisPosition] : rectBound[3]]; + var r = { + horizontal: 0, + vertical: 1 + }; + layout.rotation = Math.PI / 2 * r[orient]; + var directionMap = { + top: -1, + bottom: 1, + right: 1, + left: -1 + }; + layout.labelDirection = layout.tickDirection = layout.nameDirection = directionMap[axisPosition]; + + if (axisModel.get(['axisTick', 'inside'])) { + layout.tickDirection = -layout.tickDirection; + } + + if (retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) { + layout.labelDirection = -layout.labelDirection; + } + + var labelRotation = opt.rotate; + labelRotation == null && (labelRotation = axisModel.get(['axisLabel', 'rotate'])); + layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation; + layout.z2 = 1; + return layout; } var axisBuilderAttrs$3 = ['axisLine', 'axisTickLabel', 'axisName']; var selfBuilderAttrs$2 = ['splitArea', 'splitLine']; var SingleAxisView = - /** @class */ - function (_super) { - __extends(SingleAxisView, _super); - - function SingleAxisView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = SingleAxisView.type; - _this.axisPointerClass = 'SingleAxisPointer'; - return _this; - } - - SingleAxisView.prototype.render = function (axisModel, ecModel, api, payload) { - var group = this.group; - group.removeAll(); - var oldAxisGroup = this._axisGroup; - this._axisGroup = new Group(); - var layout = layout$2(axisModel); - var axisBuilder = new AxisBuilder(axisModel, layout); - each(axisBuilderAttrs$3, axisBuilder.add, axisBuilder); - group.add(this._axisGroup); - group.add(axisBuilder.getGroup()); - each(selfBuilderAttrs$2, function (name) { - if (axisModel.get([name, 'show'])) { - axisElementBuilders$2[name](this, this.group, this._axisGroup, axisModel); - } - }, this); - groupTransition(oldAxisGroup, this._axisGroup, axisModel); + /** @class */ + function (_super) { + __extends(SingleAxisView, _super); + + function SingleAxisView() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = SingleAxisView.type; + _this.axisPointerClass = 'SingleAxisPointer'; + return _this; + } + + SingleAxisView.prototype.render = function (axisModel, ecModel, api, payload) { + var group = this.group; + group.removeAll(); + var oldAxisGroup = this._axisGroup; + this._axisGroup = new Group(); + var layout = layout$2(axisModel); + var axisBuilder = new AxisBuilder(axisModel, layout); + each(axisBuilderAttrs$3, axisBuilder.add, axisBuilder); + group.add(this._axisGroup); + group.add(axisBuilder.getGroup()); + each(selfBuilderAttrs$2, function (name) { + if (axisModel.get([name, 'show'])) { + axisElementBuilders$2[name](this, this.group, this._axisGroup, axisModel); + } + }, this); + groupTransition(oldAxisGroup, this._axisGroup, axisModel); - _super.prototype.render.call(this, axisModel, ecModel, api, payload); - }; + _super.prototype.render.call(this, axisModel, ecModel, api, payload); + }; - SingleAxisView.prototype.remove = function () { - rectCoordAxisHandleRemove(this); - }; + SingleAxisView.prototype.remove = function () { + rectCoordAxisHandleRemove(this); + }; - SingleAxisView.type = 'singleAxis'; - return SingleAxisView; - }(AxisView); + SingleAxisView.type = 'singleAxis'; + return SingleAxisView; + }(AxisView); var axisElementBuilders$2 = { - splitLine: function (axisView, group, axisGroup, axisModel) { - var axis = axisModel.axis; - - if (axis.scale.isBlank()) { - return; - } - - var splitLineModel = axisModel.getModel('splitLine'); - var lineStyleModel = splitLineModel.getModel('lineStyle'); - var lineColors = lineStyleModel.get('color'); - lineColors = lineColors instanceof Array ? lineColors : [lineColors]; - var gridRect = axisModel.coordinateSystem.getRect(); - var isHorizontal = axis.isHorizontal(); - var splitLines = []; - var lineCount = 0; - var ticksCoords = axis.getTicksCoords({ - tickModel: splitLineModel - }); - var p1 = []; - var p2 = []; + splitLine: function (axisView, group, axisGroup, axisModel) { + var axis = axisModel.axis; - for (var i = 0; i < ticksCoords.length; ++i) { - var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord); + if (axis.scale.isBlank()) { + return; + } - if (isHorizontal) { - p1[0] = tickCoord; - p1[1] = gridRect.y; - p2[0] = tickCoord; - p2[1] = gridRect.y + gridRect.height; - } else { - p1[0] = gridRect.x; - p1[1] = tickCoord; - p2[0] = gridRect.x + gridRect.width; - p2[1] = tickCoord; - } - - var colorIndex = lineCount++ % lineColors.length; - splitLines[colorIndex] = splitLines[colorIndex] || []; - splitLines[colorIndex].push(new Line({ - subPixelOptimize: true, - shape: { - x1: p1[0], - y1: p1[1], - x2: p2[0], - y2: p2[1] - }, - silent: true - })); - } + var splitLineModel = axisModel.getModel('splitLine'); + var lineStyleModel = splitLineModel.getModel('lineStyle'); + var lineColors = lineStyleModel.get('color'); + lineColors = lineColors instanceof Array ? lineColors : [lineColors]; + var gridRect = axisModel.coordinateSystem.getRect(); + var isHorizontal = axis.isHorizontal(); + var splitLines = []; + var lineCount = 0; + var ticksCoords = axis.getTicksCoords({ + tickModel: splitLineModel + }); + var p1 = []; + var p2 = []; + + for (var i = 0; i < ticksCoords.length; ++i) { + var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord); + + if (isHorizontal) { + p1[0] = tickCoord; + p1[1] = gridRect.y; + p2[0] = tickCoord; + p2[1] = gridRect.y + gridRect.height; + } else { + p1[0] = gridRect.x; + p1[1] = tickCoord; + p2[0] = gridRect.x + gridRect.width; + p2[1] = tickCoord; + } + + var colorIndex = lineCount++ % lineColors.length; + splitLines[colorIndex] = splitLines[colorIndex] || []; + splitLines[colorIndex].push(new Line({ + subPixelOptimize: true, + shape: { + x1: p1[0], + y1: p1[1], + x2: p2[0], + y2: p2[1] + }, + silent: true + })); + } - var lineStyle = lineStyleModel.getLineStyle(['color']); + var lineStyle = lineStyleModel.getLineStyle(['color']); - for (var i = 0; i < splitLines.length; ++i) { - group.add(mergePath$1(splitLines[i], { - style: defaults({ - stroke: lineColors[i % lineColors.length] - }, lineStyle), - silent: true - })); - } - }, - splitArea: function (axisView, group, axisGroup, axisModel) { - rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, axisModel); + for (var i = 0; i < splitLines.length; ++i) { + group.add(mergePath$1(splitLines[i], { + style: defaults({ + stroke: lineColors[i % lineColors.length] + }, lineStyle), + silent: true + })); } + }, + splitArea: function (axisView, group, axisGroup, axisModel) { + rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, axisModel); + } }; var SingleAxisModel = - /** @class */ - function (_super) { - __extends(SingleAxisModel, _super); - - function SingleAxisModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = SingleAxisModel.type; - return _this; - } - - SingleAxisModel.prototype.getCoordSysModel = function () { - return this; - }; - - SingleAxisModel.type = 'singleAxis'; - SingleAxisModel.layoutMode = 'box'; - SingleAxisModel.defaultOption = { - left: '5%', - top: '5%', - right: '5%', - bottom: '5%', - type: 'value', - position: 'bottom', - orient: 'horizontal', - axisLine: { - show: true, - lineStyle: { - width: 1, - type: 'solid' - } - }, - // Single coordinate system and single axis is the, - // which is used as the parent tooltip model. - // same model, so we set default tooltip show as true. - tooltip: { - show: true - }, - axisTick: { - show: true, - length: 6, - lineStyle: { - width: 1 - } - }, - axisLabel: { - show: true, - interval: 'auto' - }, - splitLine: { - show: true, - lineStyle: { - type: 'dashed', - opacity: 0.2 - } - } - }; - return SingleAxisModel; - }(ComponentModel); + /** @class */ + function (_super) { + __extends(SingleAxisModel, _super); + + function SingleAxisModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = SingleAxisModel.type; + return _this; + } + + SingleAxisModel.prototype.getCoordSysModel = function () { + return this; + }; + + SingleAxisModel.type = 'singleAxis'; + SingleAxisModel.layoutMode = 'box'; + SingleAxisModel.defaultOption = { + left: '5%', + top: '5%', + right: '5%', + bottom: '5%', + type: 'value', + position: 'bottom', + orient: 'horizontal', + axisLine: { + show: true, + lineStyle: { + width: 1, + type: 'solid' + } + }, + // Single coordinate system and single axis is the, + // which is used as the parent tooltip model. + // same model, so we set default tooltip show as true. + tooltip: { + show: true + }, + axisTick: { + show: true, + length: 6, + lineStyle: { + width: 1 + } + }, + axisLabel: { + show: true, + interval: 'auto' + }, + splitLine: { + show: true, + lineStyle: { + type: 'dashed', + opacity: 0.2 + } + } + }; + return SingleAxisModel; + }(ComponentModel); mixin(SingleAxisModel, AxisModelCommonMixin.prototype); var SingleAxis = - /** @class */ - function (_super) { - __extends(SingleAxis, _super); - - function SingleAxis(dim, scale, coordExtent, axisType, position) { - var _this = _super.call(this, dim, scale, coordExtent) || this; - - _this.type = axisType || 'value'; - _this.position = position || 'bottom'; - return _this; - } - /** - * Judge the orient of the axis. - */ + /** @class */ + function (_super) { + __extends(SingleAxis, _super); + + function SingleAxis(dim, scale, coordExtent, axisType, position) { + var _this = _super.call(this, dim, scale, coordExtent) || this; + + _this.type = axisType || 'value'; + _this.position = position || 'bottom'; + return _this; + } + /** + * Judge the orient of the axis. + */ - SingleAxis.prototype.isHorizontal = function () { - var position = this.position; - return position === 'top' || position === 'bottom'; - }; + SingleAxis.prototype.isHorizontal = function () { + var position = this.position; + return position === 'top' || position === 'bottom'; + }; - SingleAxis.prototype.pointToData = function (point, clamp) { - return this.coordinateSystem.pointToData(point)[0]; - }; + SingleAxis.prototype.pointToData = function (point, clamp) { + return this.coordinateSystem.pointToData(point)[0]; + }; - return SingleAxis; - }(Axis); + return SingleAxis; + }(Axis); var singleDimensions = ['single']; /** @@ -76826,192 +76826,192 @@ */ var Single = - /** @class */ - function () { - function Single(axisModel, ecModel, api) { - this.type = 'single'; - this.dimension = 'single'; - /** - * Add it just for draw tooltip. - */ + /** @class */ + function () { + function Single(axisModel, ecModel, api) { + this.type = 'single'; + this.dimension = 'single'; + /** + * Add it just for draw tooltip. + */ - this.dimensions = singleDimensions; - this.axisPointerEnabled = true; - this.model = axisModel; + this.dimensions = singleDimensions; + this.axisPointerEnabled = true; + this.model = axisModel; - this._init(axisModel, ecModel, api); - } - /** - * Initialize single coordinate system. - */ + this._init(axisModel, ecModel, api); + } + /** + * Initialize single coordinate system. + */ - Single.prototype._init = function (axisModel, ecModel, api) { - var dim = this.dimension; - var axis = new SingleAxis(dim, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisModel.get('position')); - var isCategory = axis.type === 'category'; - axis.onBand = isCategory && axisModel.get('boundaryGap'); - axis.inverse = axisModel.get('inverse'); - axis.orient = axisModel.get('orient'); - axisModel.axis = axis; - axis.model = axisModel; - axis.coordinateSystem = this; - this._axis = axis; - }; - /** - * Update axis scale after data processed - */ + Single.prototype._init = function (axisModel, ecModel, api) { + var dim = this.dimension; + var axis = new SingleAxis(dim, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisModel.get('position')); + var isCategory = axis.type === 'category'; + axis.onBand = isCategory && axisModel.get('boundaryGap'); + axis.inverse = axisModel.get('inverse'); + axis.orient = axisModel.get('orient'); + axisModel.axis = axis; + axis.model = axisModel; + axis.coordinateSystem = this; + this._axis = axis; + }; + /** + * Update axis scale after data processed + */ - Single.prototype.update = function (ecModel, api) { - ecModel.eachSeries(function (seriesModel) { - if (seriesModel.coordinateSystem === this) { - var data_1 = seriesModel.getData(); - each(data_1.mapDimensionsAll(this.dimension), function (dim) { - this._axis.scale.unionExtentFromData(data_1, dim); - }, this); - niceScaleExtent(this._axis.scale, this._axis.model); - } - }, this); - }; - /** - * Resize the single coordinate system. - */ + Single.prototype.update = function (ecModel, api) { + ecModel.eachSeries(function (seriesModel) { + if (seriesModel.coordinateSystem === this) { + var data_1 = seriesModel.getData(); + each(data_1.mapDimensionsAll(this.dimension), function (dim) { + this._axis.scale.unionExtentFromData(data_1, dim); + }, this); + niceScaleExtent(this._axis.scale, this._axis.model); + } + }, this); + }; + /** + * Resize the single coordinate system. + */ - Single.prototype.resize = function (axisModel, api) { - this._rect = getLayoutRect({ - left: axisModel.get('left'), - top: axisModel.get('top'), - right: axisModel.get('right'), - bottom: axisModel.get('bottom'), - width: axisModel.get('width'), - height: axisModel.get('height') - }, { - width: api.getWidth(), - height: api.getHeight() - }); + Single.prototype.resize = function (axisModel, api) { + this._rect = getLayoutRect({ + left: axisModel.get('left'), + top: axisModel.get('top'), + right: axisModel.get('right'), + bottom: axisModel.get('bottom'), + width: axisModel.get('width'), + height: axisModel.get('height') + }, { + width: api.getWidth(), + height: api.getHeight() + }); - this._adjustAxis(); - }; + this._adjustAxis(); + }; - Single.prototype.getRect = function () { - return this._rect; - }; + Single.prototype.getRect = function () { + return this._rect; + }; - Single.prototype._adjustAxis = function () { - var rect = this._rect; - var axis = this._axis; - var isHorizontal = axis.isHorizontal(); - var extent = isHorizontal ? [0, rect.width] : [0, rect.height]; - var idx = axis.reverse ? 1 : 0; - axis.setExtent(extent[idx], extent[1 - idx]); + Single.prototype._adjustAxis = function () { + var rect = this._rect; + var axis = this._axis; + var isHorizontal = axis.isHorizontal(); + var extent = isHorizontal ? [0, rect.width] : [0, rect.height]; + var idx = axis.reverse ? 1 : 0; + axis.setExtent(extent[idx], extent[1 - idx]); - this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y); - }; + this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y); + }; - Single.prototype._updateAxisTransform = function (axis, coordBase) { - var axisExtent = axis.getExtent(); - var extentSum = axisExtent[0] + axisExtent[1]; - var isHorizontal = axis.isHorizontal(); - axis.toGlobalCoord = isHorizontal ? function (coord) { - return coord + coordBase; - } : function (coord) { - return extentSum - coord + coordBase; - }; - axis.toLocalCoord = isHorizontal ? function (coord) { - return coord - coordBase; - } : function (coord) { - return extentSum - coord + coordBase; - }; - }; - /** - * Get axis. - */ + Single.prototype._updateAxisTransform = function (axis, coordBase) { + var axisExtent = axis.getExtent(); + var extentSum = axisExtent[0] + axisExtent[1]; + var isHorizontal = axis.isHorizontal(); + axis.toGlobalCoord = isHorizontal ? function (coord) { + return coord + coordBase; + } : function (coord) { + return extentSum - coord + coordBase; + }; + axis.toLocalCoord = isHorizontal ? function (coord) { + return coord - coordBase; + } : function (coord) { + return extentSum - coord + coordBase; + }; + }; + /** + * Get axis. + */ - Single.prototype.getAxis = function () { - return this._axis; - }; - /** - * Get axis, add it just for draw tooltip. - */ + Single.prototype.getAxis = function () { + return this._axis; + }; + /** + * Get axis, add it just for draw tooltip. + */ - Single.prototype.getBaseAxis = function () { - return this._axis; - }; + Single.prototype.getBaseAxis = function () { + return this._axis; + }; - Single.prototype.getAxes = function () { - return [this._axis]; - }; + Single.prototype.getAxes = function () { + return [this._axis]; + }; - Single.prototype.getTooltipAxes = function () { - return { - baseAxes: [this.getAxis()], - // Empty otherAxes - otherAxes: [] - }; - }; - /** - * If contain point. - */ + Single.prototype.getTooltipAxes = function () { + return { + baseAxes: [this.getAxis()], + // Empty otherAxes + otherAxes: [] + }; + }; + /** + * If contain point. + */ - Single.prototype.containPoint = function (point) { - var rect = this.getRect(); - var axis = this.getAxis(); - var orient = axis.orient; + Single.prototype.containPoint = function (point) { + var rect = this.getRect(); + var axis = this.getAxis(); + var orient = axis.orient; - if (orient === 'horizontal') { - return axis.contain(axis.toLocalCoord(point[0])) && point[1] >= rect.y && point[1] <= rect.y + rect.height; - } else { - return axis.contain(axis.toLocalCoord(point[1])) && point[0] >= rect.y && point[0] <= rect.y + rect.height; - } - }; + if (orient === 'horizontal') { + return axis.contain(axis.toLocalCoord(point[0])) && point[1] >= rect.y && point[1] <= rect.y + rect.height; + } else { + return axis.contain(axis.toLocalCoord(point[1])) && point[0] >= rect.y && point[0] <= rect.y + rect.height; + } + }; - Single.prototype.pointToData = function (point) { - var axis = this.getAxis(); - return [axis.coordToData(axis.toLocalCoord(point[axis.orient === 'horizontal' ? 0 : 1]))]; - }; - /** - * Convert the series data to concrete point. - * Can be [val] | val - */ + Single.prototype.pointToData = function (point) { + var axis = this.getAxis(); + return [axis.coordToData(axis.toLocalCoord(point[axis.orient === 'horizontal' ? 0 : 1]))]; + }; + /** + * Convert the series data to concrete point. + * Can be [val] | val + */ - Single.prototype.dataToPoint = function (val) { - var axis = this.getAxis(); - var rect = this.getRect(); - var pt = []; - var idx = axis.orient === 'horizontal' ? 0 : 1; + Single.prototype.dataToPoint = function (val) { + var axis = this.getAxis(); + var rect = this.getRect(); + var pt = []; + var idx = axis.orient === 'horizontal' ? 0 : 1; - if (val instanceof Array) { - val = val[0]; - } + if (val instanceof Array) { + val = val[0]; + } - pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val)); - pt[1 - idx] = idx === 0 ? rect.y + rect.height / 2 : rect.x + rect.width / 2; - return pt; - }; + pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val)); + pt[1 - idx] = idx === 0 ? rect.y + rect.height / 2 : rect.x + rect.width / 2; + return pt; + }; - Single.prototype.convertToPixel = function (ecModel, finder, value) { - var coordSys = getCoordSys$3(finder); - return coordSys === this ? this.dataToPoint(value) : null; - }; + Single.prototype.convertToPixel = function (ecModel, finder, value) { + var coordSys = getCoordSys$3(finder); + return coordSys === this ? this.dataToPoint(value) : null; + }; - Single.prototype.convertFromPixel = function (ecModel, finder, pixel) { - var coordSys = getCoordSys$3(finder); - return coordSys === this ? this.pointToData(pixel) : null; - }; + Single.prototype.convertFromPixel = function (ecModel, finder, pixel) { + var coordSys = getCoordSys$3(finder); + return coordSys === this ? this.pointToData(pixel) : null; + }; - return Single; - }(); + return Single; + }(); function getCoordSys$3(finder) { - var seriesModel = finder.seriesModel; - var singleModel = finder.singleAxisModel; - return singleModel && singleModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem; + var seriesModel = finder.seriesModel; + var singleModel = finder.singleAxisModel; + return singleModel && singleModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem; } /** @@ -77019,1753 +77019,1753 @@ */ function create$2(ecModel, api) { - var singles = []; - ecModel.eachComponent('singleAxis', function (axisModel, idx) { - var single = new Single(axisModel, ecModel, api); - single.name = 'single_' + idx; - single.resize(axisModel, api); - axisModel.coordinateSystem = single; - singles.push(single); - }); - ecModel.eachSeries(function (seriesModel) { - if (seriesModel.get('coordinateSystem') === 'singleAxis') { - var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0]; - seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem; - } - }); - return singles; + var singles = []; + ecModel.eachComponent('singleAxis', function (axisModel, idx) { + var single = new Single(axisModel, ecModel, api); + single.name = 'single_' + idx; + single.resize(axisModel, api); + axisModel.coordinateSystem = single; + singles.push(single); + }); + ecModel.eachSeries(function (seriesModel) { + if (seriesModel.get('coordinateSystem') === 'singleAxis') { + var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0]; + seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem; + } + }); + return singles; } var singleCreator = { - create: create$2, - dimensions: singleDimensions + create: create$2, + dimensions: singleDimensions }; var XY = ['x', 'y']; var WH = ['width', 'height']; var SingleAxisPointer = - /** @class */ - function (_super) { - __extends(SingleAxisPointer, _super); - - function SingleAxisPointer() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * @override - */ + /** @class */ + function (_super) { + __extends(SingleAxisPointer, _super); + + function SingleAxisPointer() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * @override + */ - SingleAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) { - var axis = axisModel.axis; - var coordSys = axis.coordinateSystem; - var otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis)); - var pixelValue = coordSys.dataToPoint(value)[0]; - var axisPointerType = axisPointerModel.get('type'); + SingleAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) { + var axis = axisModel.axis; + var coordSys = axis.coordinateSystem; + var otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis)); + var pixelValue = coordSys.dataToPoint(value)[0]; + var axisPointerType = axisPointerModel.get('type'); - if (axisPointerType && axisPointerType !== 'none') { - var elStyle = buildElStyle(axisPointerModel); - var pointerOption = pointerShapeBuilder$2[axisPointerType](axis, pixelValue, otherExtent); - pointerOption.style = elStyle; - elOption.graphicKey = pointerOption.type; - elOption.pointer = pointerOption; - } + if (axisPointerType && axisPointerType !== 'none') { + var elStyle = buildElStyle(axisPointerModel); + var pointerOption = pointerShapeBuilder$2[axisPointerType](axis, pixelValue, otherExtent); + pointerOption.style = elStyle; + elOption.graphicKey = pointerOption.type; + elOption.pointer = pointerOption; + } - var layoutInfo = layout$2(axisModel); - buildCartesianSingleLabelElOption( // @ts-ignore - value, elOption, layoutInfo, axisModel, axisPointerModel, api); - }; - /** - * @override - */ + var layoutInfo = layout$2(axisModel); + buildCartesianSingleLabelElOption( // @ts-ignore + value, elOption, layoutInfo, axisModel, axisPointerModel, api); + }; + /** + * @override + */ - SingleAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) { - var layoutInfo = layout$2(axisModel, { - labelInside: false - }); // @ts-ignore + SingleAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) { + var layoutInfo = layout$2(axisModel, { + labelInside: false + }); // @ts-ignore - layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']); - var position = getTransformedPosition(axisModel.axis, value, layoutInfo); - return { - x: position[0], - y: position[1], - rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0) - }; - }; - /** - * @override - */ + layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']); + var position = getTransformedPosition(axisModel.axis, value, layoutInfo); + return { + x: position[0], + y: position[1], + rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0) + }; + }; + /** + * @override + */ - SingleAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) { - var axis = axisModel.axis; - var coordSys = axis.coordinateSystem; - var dimIndex = getPointDimIndex(axis); - var axisExtent = getGlobalExtent(coordSys, dimIndex); - var currPosition = [transform.x, transform.y]; - currPosition[dimIndex] += delta[dimIndex]; - currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]); - currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]); - var otherExtent = getGlobalExtent(coordSys, 1 - dimIndex); - var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2; - var cursorPoint = [cursorOtherValue, cursorOtherValue]; - cursorPoint[dimIndex] = currPosition[dimIndex]; - return { - x: currPosition[0], - y: currPosition[1], - rotation: transform.rotation, - cursorPoint: cursorPoint, - tooltipOption: { - verticalAlign: 'middle' - } - }; - }; + SingleAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) { + var axis = axisModel.axis; + var coordSys = axis.coordinateSystem; + var dimIndex = getPointDimIndex(axis); + var axisExtent = getGlobalExtent(coordSys, dimIndex); + var currPosition = [transform.x, transform.y]; + currPosition[dimIndex] += delta[dimIndex]; + currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]); + currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]); + var otherExtent = getGlobalExtent(coordSys, 1 - dimIndex); + var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2; + var cursorPoint = [cursorOtherValue, cursorOtherValue]; + cursorPoint[dimIndex] = currPosition[dimIndex]; + return { + x: currPosition[0], + y: currPosition[1], + rotation: transform.rotation, + cursorPoint: cursorPoint, + tooltipOption: { + verticalAlign: 'middle' + } + }; + }; - return SingleAxisPointer; - }(BaseAxisPointer); + return SingleAxisPointer; + }(BaseAxisPointer); var pointerShapeBuilder$2 = { - line: function (axis, pixelValue, otherExtent) { - var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis)); - return { - type: 'Line', - subPixelOptimize: true, - shape: targetShape - }; - }, - shadow: function (axis, pixelValue, otherExtent) { - var bandWidth = axis.getBandWidth(); - var span = otherExtent[1] - otherExtent[0]; - return { - type: 'Rect', - shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getPointDimIndex(axis)) - }; - } + line: function (axis, pixelValue, otherExtent) { + var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis)); + return { + type: 'Line', + subPixelOptimize: true, + shape: targetShape + }; + }, + shadow: function (axis, pixelValue, otherExtent) { + var bandWidth = axis.getBandWidth(); + var span = otherExtent[1] - otherExtent[0]; + return { + type: 'Rect', + shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getPointDimIndex(axis)) + }; + } }; function getPointDimIndex(axis) { - return axis.isHorizontal() ? 0 : 1; + return axis.isHorizontal() ? 0 : 1; } function getGlobalExtent(coordSys, dimIndex) { - var rect = coordSys.getRect(); - return [rect[XY[dimIndex]], rect[XY[dimIndex]] + rect[WH[dimIndex]]]; + var rect = coordSys.getRect(); + return [rect[XY[dimIndex]], rect[XY[dimIndex]] + rect[WH[dimIndex]]]; } var SingleView = - /** @class */ - function (_super) { - __extends(SingleView, _super); + /** @class */ + function (_super) { + __extends(SingleView, _super); - function SingleView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function SingleView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SingleView.type; - return _this; - } + _this.type = SingleView.type; + return _this; + } - SingleView.type = 'single'; - return SingleView; - }(ComponentView); + SingleView.type = 'single'; + return SingleView; + }(ComponentView); function install$v(registers) { - use(install$s); - AxisView.registerAxisPointerClass('SingleAxisPointer', SingleAxisPointer); - registers.registerComponentView(SingleView); // Axis + use(install$s); + AxisView.registerAxisPointerClass('SingleAxisPointer', SingleAxisPointer); + registers.registerComponentView(SingleView); // Axis - registers.registerComponentView(SingleAxisView); - registers.registerComponentModel(SingleAxisModel); - axisModelCreator(registers, 'single', SingleAxisModel, SingleAxisModel.defaultOption); - registers.registerCoordinateSystem('single', singleCreator); + registers.registerComponentView(SingleAxisView); + registers.registerComponentModel(SingleAxisModel); + axisModelCreator(registers, 'single', SingleAxisModel, SingleAxisModel.defaultOption); + registers.registerCoordinateSystem('single', singleCreator); } var CalendarModel = - /** @class */ - function (_super) { - __extends(CalendarModel, _super); - - function CalendarModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = CalendarModel.type; - return _this; - } - /** - * @override - */ - - - CalendarModel.prototype.init = function (option, parentModel, ecModel) { - var inputPositionParams = getLayoutParams(option); - - _super.prototype.init.apply(this, arguments); - - mergeAndNormalizeLayoutParams(option, inputPositionParams); - }; - /** - * @override - */ - - - CalendarModel.prototype.mergeOption = function (option) { - _super.prototype.mergeOption.apply(this, arguments); - - mergeAndNormalizeLayoutParams(this.option, option); - }; + /** @class */ + function (_super) { + __extends(CalendarModel, _super); - CalendarModel.prototype.getCellSize = function () { - // Has been normalized - return this.option.cellSize; - }; + function CalendarModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - CalendarModel.type = 'calendar'; - CalendarModel.defaultOption = { - // zlevel: 0, - z: 2, - left: 80, - top: 60, - cellSize: 20, - // horizontal vertical - orient: 'horizontal', - // month separate line style - splitLine: { - show: true, - lineStyle: { - color: '#000', - width: 1, - type: 'solid' - } - }, - // rect style temporarily unused emphasis - itemStyle: { - color: '#fff', - borderWidth: 1, - borderColor: '#ccc' - }, - // week text style - dayLabel: { - show: true, - firstDay: 0, - // start end - position: 'start', - margin: '50%', - color: '#000' - }, - // month text style - monthLabel: { - show: true, - // start end - position: 'start', - margin: 5, - // center or left - align: 'center', - formatter: null, - color: '#000' - }, - // year text style - yearLabel: { - show: true, - // top bottom left right - position: null, - margin: 30, - formatter: null, - color: '#ccc', - fontFamily: 'sans-serif', - fontWeight: 'bolder', - fontSize: 20 - } - }; - return CalendarModel; - }(ComponentModel); + _this.type = CalendarModel.type; + return _this; + } + /** + * @override + */ - function mergeAndNormalizeLayoutParams(target, raw) { - // Normalize cellSize - var cellSize = target.cellSize; - var cellSizeArr; - if (!isArray(cellSize)) { - cellSizeArr = target.cellSize = [cellSize, cellSize]; - } else { - cellSizeArr = cellSize; - } + CalendarModel.prototype.init = function (option, parentModel, ecModel) { + var inputPositionParams = getLayoutParams(option); - if (cellSizeArr.length === 1) { - cellSizeArr[1] = cellSizeArr[0]; - } + _super.prototype.init.apply(this, arguments); - var ignoreSize = map([0, 1], function (hvIdx) { - // If user have set `width` or both `left` and `right`, cellSizeArr - // will be automatically set to 'auto', otherwise the default - // setting of cellSizeArr will make `width` setting not work. - if (sizeCalculable(raw, hvIdx)) { - cellSizeArr[hvIdx] = 'auto'; - } + mergeAndNormalizeLayoutParams(option, inputPositionParams); + }; + /** + * @override + */ - return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== 'auto'; - }); - mergeLayoutParam(target, raw, { - type: 'box', - ignoreSize: ignoreSize - }); - } - var CalendarView = - /** @class */ - function (_super) { - __extends(CalendarView, _super); + CalendarModel.prototype.mergeOption = function (option) { + _super.prototype.mergeOption.apply(this, arguments); - function CalendarView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + mergeAndNormalizeLayoutParams(this.option, option); + }; - _this.type = CalendarView.type; - return _this; - } + CalendarModel.prototype.getCellSize = function () { + // Has been normalized + return this.option.cellSize; + }; - CalendarView.prototype.render = function (calendarModel, ecModel, api) { - var group = this.group; - group.removeAll(); - var coordSys = calendarModel.coordinateSystem; // range info + CalendarModel.type = 'calendar'; + CalendarModel.defaultOption = { + // zlevel: 0, + z: 2, + left: 80, + top: 60, + cellSize: 20, + // horizontal vertical + orient: 'horizontal', + // month separate line style + splitLine: { + show: true, + lineStyle: { + color: '#000', + width: 1, + type: 'solid' + } + }, + // rect style temporarily unused emphasis + itemStyle: { + color: '#fff', + borderWidth: 1, + borderColor: '#ccc' + }, + // week text style + dayLabel: { + show: true, + firstDay: 0, + // start end + position: 'start', + margin: '50%', + color: '#000' + }, + // month text style + monthLabel: { + show: true, + // start end + position: 'start', + margin: 5, + // center or left + align: 'center', + formatter: null, + color: '#000' + }, + // year text style + yearLabel: { + show: true, + // top bottom left right + position: null, + margin: 30, + formatter: null, + color: '#ccc', + fontFamily: 'sans-serif', + fontWeight: 'bolder', + fontSize: 20 + } + }; + return CalendarModel; + }(ComponentModel); - var rangeData = coordSys.getRangeInfo(); - var orient = coordSys.getOrient(); // locale + function mergeAndNormalizeLayoutParams(target, raw) { + // Normalize cellSize + var cellSize = target.cellSize; + var cellSizeArr; - var localeModel = ecModel.getLocaleModel(); + if (!isArray(cellSize)) { + cellSizeArr = target.cellSize = [cellSize, cellSize]; + } else { + cellSizeArr = cellSize; + } - this._renderDayRect(calendarModel, rangeData, group); // _renderLines must be called prior to following function + if (cellSizeArr.length === 1) { + cellSizeArr[1] = cellSizeArr[0]; + } + var ignoreSize = map([0, 1], function (hvIdx) { + // If user have set `width` or both `left` and `right`, cellSizeArr + // will be automatically set to 'auto', otherwise the default + // setting of cellSizeArr will make `width` setting not work. + if (sizeCalculable(raw, hvIdx)) { + cellSizeArr[hvIdx] = 'auto'; + } - this._renderLines(calendarModel, rangeData, orient, group); + return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== 'auto'; + }); + mergeLayoutParam(target, raw, { + type: 'box', + ignoreSize: ignoreSize + }); + } - this._renderYearText(calendarModel, rangeData, orient, group); + var CalendarView = + /** @class */ + function (_super) { + __extends(CalendarView, _super); - this._renderMonthText(calendarModel, localeModel, orient, group); + function CalendarView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - this._renderWeekText(calendarModel, localeModel, rangeData, orient, group); - }; // render day rect + _this.type = CalendarView.type; + return _this; + } + CalendarView.prototype.render = function (calendarModel, ecModel, api) { + var group = this.group; + group.removeAll(); + var coordSys = calendarModel.coordinateSystem; // range info - CalendarView.prototype._renderDayRect = function (calendarModel, rangeData, group) { - var coordSys = calendarModel.coordinateSystem; - var itemRectStyleModel = calendarModel.getModel('itemStyle').getItemStyle(); - var sw = coordSys.getCellWidth(); - var sh = coordSys.getCellHeight(); + var rangeData = coordSys.getRangeInfo(); + var orient = coordSys.getOrient(); // locale - for (var i = rangeData.start.time; i <= rangeData.end.time; i = coordSys.getNextNDay(i, 1).time) { - var point = coordSys.dataToRect([i], false).tl; // every rect + var localeModel = ecModel.getLocaleModel(); - var rect = new Rect({ - shape: { - x: point[0], - y: point[1], - width: sw, - height: sh - }, - cursor: 'default', - style: itemRectStyleModel - }); - group.add(rect); - } - }; // render separate line + this._renderDayRect(calendarModel, rangeData, group); // _renderLines must be called prior to following function - CalendarView.prototype._renderLines = function (calendarModel, rangeData, orient, group) { - var self = this; - var coordSys = calendarModel.coordinateSystem; - var lineStyleModel = calendarModel.getModel(['splitLine', 'lineStyle']).getLineStyle(); - var show = calendarModel.get(['splitLine', 'show']); - var lineWidth = lineStyleModel.lineWidth; - this._tlpoints = []; - this._blpoints = []; - this._firstDayOfMonth = []; - this._firstDayPoints = []; - var firstDay = rangeData.start; + this._renderLines(calendarModel, rangeData, orient, group); - for (var i = 0; firstDay.time <= rangeData.end.time; i++) { - addPoints(firstDay.formatedDate); + this._renderYearText(calendarModel, rangeData, orient, group); - if (i === 0) { - firstDay = coordSys.getDateInfo(rangeData.start.y + '-' + rangeData.start.m); - } + this._renderMonthText(calendarModel, localeModel, orient, group); - var date = firstDay.date; - date.setMonth(date.getMonth() + 1); - firstDay = coordSys.getDateInfo(date); - } + this._renderWeekText(calendarModel, localeModel, rangeData, orient, group); + }; // render day rect - addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate); - function addPoints(date) { - self._firstDayOfMonth.push(coordSys.getDateInfo(date)); + CalendarView.prototype._renderDayRect = function (calendarModel, rangeData, group) { + var coordSys = calendarModel.coordinateSystem; + var itemRectStyleModel = calendarModel.getModel('itemStyle').getItemStyle(); + var sw = coordSys.getCellWidth(); + var sh = coordSys.getCellHeight(); - self._firstDayPoints.push(coordSys.dataToRect([date], false).tl); + for (var i = rangeData.start.time; i <= rangeData.end.time; i = coordSys.getNextNDay(i, 1).time) { + var point = coordSys.dataToRect([i], false).tl; // every rect - var points = self._getLinePointsOfOneWeek(calendarModel, date, orient); + var rect = new Rect({ + shape: { + x: point[0], + y: point[1], + width: sw, + height: sh + }, + cursor: 'default', + style: itemRectStyleModel + }); + group.add(rect); + } + }; // render separate line - self._tlpoints.push(points[0]); - self._blpoints.push(points[points.length - 1]); + CalendarView.prototype._renderLines = function (calendarModel, rangeData, orient, group) { + var self = this; + var coordSys = calendarModel.coordinateSystem; + var lineStyleModel = calendarModel.getModel(['splitLine', 'lineStyle']).getLineStyle(); + var show = calendarModel.get(['splitLine', 'show']); + var lineWidth = lineStyleModel.lineWidth; + this._tlpoints = []; + this._blpoints = []; + this._firstDayOfMonth = []; + this._firstDayPoints = []; + var firstDay = rangeData.start; - show && self._drawSplitline(points, lineStyleModel, group); - } // render top/left line + for (var i = 0; firstDay.time <= rangeData.end.time; i++) { + addPoints(firstDay.formatedDate); + if (i === 0) { + firstDay = coordSys.getDateInfo(rangeData.start.y + '-' + rangeData.start.m); + } - show && this._drawSplitline(self._getEdgesPoints(self._tlpoints, lineWidth, orient), lineStyleModel, group); // render bottom/right line + var date = firstDay.date; + date.setMonth(date.getMonth() + 1); + firstDay = coordSys.getDateInfo(date); + } - show && this._drawSplitline(self._getEdgesPoints(self._blpoints, lineWidth, orient), lineStyleModel, group); - }; // get points at both ends + addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate); + function addPoints(date) { + self._firstDayOfMonth.push(coordSys.getDateInfo(date)); - CalendarView.prototype._getEdgesPoints = function (points, lineWidth, orient) { - var rs = [points[0].slice(), points[points.length - 1].slice()]; - var idx = orient === 'horizontal' ? 0 : 1; // both ends of the line are extend half lineWidth + self._firstDayPoints.push(coordSys.dataToRect([date], false).tl); - rs[0][idx] = rs[0][idx] - lineWidth / 2; - rs[1][idx] = rs[1][idx] + lineWidth / 2; - return rs; - }; // render split line + var points = self._getLinePointsOfOneWeek(calendarModel, date, orient); + self._tlpoints.push(points[0]); - CalendarView.prototype._drawSplitline = function (points, lineStyle, group) { - var poyline = new Polyline({ - z2: 20, - shape: { - points: points - }, - style: lineStyle - }); - group.add(poyline); - }; // render month line of one week points + self._blpoints.push(points[points.length - 1]); + show && self._drawSplitline(points, lineStyleModel, group); + } // render top/left line - CalendarView.prototype._getLinePointsOfOneWeek = function (calendarModel, date, orient) { - var coordSys = calendarModel.coordinateSystem; - var parsedDate = coordSys.getDateInfo(date); - var points = []; - for (var i = 0; i < 7; i++) { - var tmpD = coordSys.getNextNDay(parsedDate.time, i); - var point = coordSys.dataToRect([tmpD.time], false); - points[2 * tmpD.day] = point.tl; - points[2 * tmpD.day + 1] = point[orient === 'horizontal' ? 'bl' : 'tr']; - } + show && this._drawSplitline(self._getEdgesPoints(self._tlpoints, lineWidth, orient), lineStyleModel, group); // render bottom/right line - return points; - }; + show && this._drawSplitline(self._getEdgesPoints(self._blpoints, lineWidth, orient), lineStyleModel, group); + }; // get points at both ends - CalendarView.prototype._formatterLabel = function (formatter, params) { - if (isString(formatter) && formatter) { - return formatTplSimple(formatter, params); - } - if (isFunction(formatter)) { - return formatter(params); - } + CalendarView.prototype._getEdgesPoints = function (points, lineWidth, orient) { + var rs = [points[0].slice(), points[points.length - 1].slice()]; + var idx = orient === 'horizontal' ? 0 : 1; // both ends of the line are extend half lineWidth - return params.nameMap; - }; + rs[0][idx] = rs[0][idx] - lineWidth / 2; + rs[1][idx] = rs[1][idx] + lineWidth / 2; + return rs; + }; // render split line - CalendarView.prototype._yearTextPositionControl = function (textEl, point, orient, position, margin) { - var x = point[0]; - var y = point[1]; - var aligns = ['center', 'bottom']; - - if (position === 'bottom') { - y += margin; - aligns = ['center', 'top']; - } else if (position === 'left') { - x -= margin; - } else if (position === 'right') { - x += margin; - aligns = ['center', 'top']; - } else { - // top - y -= margin; - } - var rotate = 0; + CalendarView.prototype._drawSplitline = function (points, lineStyle, group) { + var poyline = new Polyline({ + z2: 20, + shape: { + points: points + }, + style: lineStyle + }); + group.add(poyline); + }; // render month line of one week points - if (position === 'left' || position === 'right') { - rotate = Math.PI / 2; - } - return { - rotation: rotate, - x: x, - y: y, - style: { - align: aligns[0], - verticalAlign: aligns[1] - } - }; - }; // render year + CalendarView.prototype._getLinePointsOfOneWeek = function (calendarModel, date, orient) { + var coordSys = calendarModel.coordinateSystem; + var parsedDate = coordSys.getDateInfo(date); + var points = []; + for (var i = 0; i < 7; i++) { + var tmpD = coordSys.getNextNDay(parsedDate.time, i); + var point = coordSys.dataToRect([tmpD.time], false); + points[2 * tmpD.day] = point.tl; + points[2 * tmpD.day + 1] = point[orient === 'horizontal' ? 'bl' : 'tr']; + } - CalendarView.prototype._renderYearText = function (calendarModel, rangeData, orient, group) { - var yearLabel = calendarModel.getModel('yearLabel'); + return points; + }; - if (!yearLabel.get('show')) { - return; - } + CalendarView.prototype._formatterLabel = function (formatter, params) { + if (isString(formatter) && formatter) { + return formatTplSimple(formatter, params); + } - var margin = yearLabel.get('margin'); - var pos = yearLabel.get('position'); + if (isFunction(formatter)) { + return formatter(params); + } - if (!pos) { - pos = orient !== 'horizontal' ? 'top' : 'left'; - } + return params.nameMap; + }; - var points = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]]; - var xc = (points[0][0] + points[1][0]) / 2; - var yc = (points[0][1] + points[1][1]) / 2; - var idx = orient === 'horizontal' ? 0 : 1; - var posPoints = { - top: [xc, points[idx][1]], - bottom: [xc, points[1 - idx][1]], - left: [points[1 - idx][0], yc], - right: [points[idx][0], yc] - }; - var name = rangeData.start.y; + CalendarView.prototype._yearTextPositionControl = function (textEl, point, orient, position, margin) { + var x = point[0]; + var y = point[1]; + var aligns = ['center', 'bottom']; - if (+rangeData.end.y > +rangeData.start.y) { - name = name + '-' + rangeData.end.y; - } + if (position === 'bottom') { + y += margin; + aligns = ['center', 'top']; + } else if (position === 'left') { + x -= margin; + } else if (position === 'right') { + x += margin; + aligns = ['center', 'top']; + } else { + // top + y -= margin; + } - var formatter = yearLabel.get('formatter'); - var params = { - start: rangeData.start.y, - end: rangeData.end.y, - nameMap: name - }; + var rotate = 0; - var content = this._formatterLabel(formatter, params); + if (position === 'left' || position === 'right') { + rotate = Math.PI / 2; + } - var yearText = new ZRText({ - z2: 30, - style: createTextStyle(yearLabel, { - text: content - }) - }); - yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin)); - group.add(yearText); - }; + return { + rotation: rotate, + x: x, + y: y, + style: { + align: aligns[0], + verticalAlign: aligns[1] + } + }; + }; // render year - CalendarView.prototype._monthTextPositionControl = function (point, isCenter, orient, position, margin) { - var align = 'left'; - var vAlign = 'top'; - var x = point[0]; - var y = point[1]; - if (orient === 'horizontal') { - y = y + margin; + CalendarView.prototype._renderYearText = function (calendarModel, rangeData, orient, group) { + var yearLabel = calendarModel.getModel('yearLabel'); - if (isCenter) { - align = 'center'; - } + if (!yearLabel.get('show')) { + return; + } - if (position === 'start') { - vAlign = 'bottom'; - } - } else { - x = x + margin; + var margin = yearLabel.get('margin'); + var pos = yearLabel.get('position'); - if (isCenter) { - vAlign = 'middle'; - } + if (!pos) { + pos = orient !== 'horizontal' ? 'top' : 'left'; + } - if (position === 'start') { - align = 'right'; - } - } + var points = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]]; + var xc = (points[0][0] + points[1][0]) / 2; + var yc = (points[0][1] + points[1][1]) / 2; + var idx = orient === 'horizontal' ? 0 : 1; + var posPoints = { + top: [xc, points[idx][1]], + bottom: [xc, points[1 - idx][1]], + left: [points[1 - idx][0], yc], + right: [points[idx][0], yc] + }; + var name = rangeData.start.y; - return { - x: x, - y: y, - align: align, - verticalAlign: vAlign - }; - }; // render month and year text + if (+rangeData.end.y > +rangeData.start.y) { + name = name + '-' + rangeData.end.y; + } + var formatter = yearLabel.get('formatter'); + var params = { + start: rangeData.start.y, + end: rangeData.end.y, + nameMap: name + }; - CalendarView.prototype._renderMonthText = function (calendarModel, localeModel, orient, group) { - var monthLabel = calendarModel.getModel('monthLabel'); + var content = this._formatterLabel(formatter, params); - if (!monthLabel.get('show')) { - return; - } + var yearText = new ZRText({ + z2: 30, + style: createTextStyle(yearLabel, { + text: content + }) + }); + yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin)); + group.add(yearText); + }; + + CalendarView.prototype._monthTextPositionControl = function (point, isCenter, orient, position, margin) { + var align = 'left'; + var vAlign = 'top'; + var x = point[0]; + var y = point[1]; + + if (orient === 'horizontal') { + y = y + margin; + + if (isCenter) { + align = 'center'; + } + + if (position === 'start') { + vAlign = 'bottom'; + } + } else { + x = x + margin; - var nameMap = monthLabel.get('nameMap'); - var margin = monthLabel.get('margin'); - var pos = monthLabel.get('position'); - var align = monthLabel.get('align'); - var termPoints = [this._tlpoints, this._blpoints]; + if (isCenter) { + vAlign = 'middle'; + } - if (!nameMap || isString(nameMap)) { - if (nameMap) { - // case-sensitive - localeModel = getLocaleModel(nameMap) || localeModel; - } // PENDING - // for ZH locale, original form is `一月` but current form is `1月` + if (position === 'start') { + align = 'right'; + } + } + return { + x: x, + y: y, + align: align, + verticalAlign: vAlign + }; + }; // render month and year text - nameMap = localeModel.get(['time', 'monthAbbr']) || []; - } - var idx = pos === 'start' ? 0 : 1; - var axis = orient === 'horizontal' ? 0 : 1; - margin = pos === 'start' ? -margin : margin; - var isCenter = align === 'center'; + CalendarView.prototype._renderMonthText = function (calendarModel, localeModel, orient, group) { + var monthLabel = calendarModel.getModel('monthLabel'); - for (var i = 0; i < termPoints[idx].length - 1; i++) { - var tmp = termPoints[idx][i].slice(); - var firstDay = this._firstDayOfMonth[i]; + if (!monthLabel.get('show')) { + return; + } - if (isCenter) { - var firstDayPoints = this._firstDayPoints[i]; - tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2; - } + var nameMap = monthLabel.get('nameMap'); + var margin = monthLabel.get('margin'); + var pos = monthLabel.get('position'); + var align = monthLabel.get('align'); + var termPoints = [this._tlpoints, this._blpoints]; - var formatter = monthLabel.get('formatter'); - var name_1 = nameMap[+firstDay.m - 1]; - var params = { - yyyy: firstDay.y, - yy: (firstDay.y + '').slice(2), - MM: firstDay.m, - M: +firstDay.m, - nameMap: name_1 - }; + if (!nameMap || isString(nameMap)) { + if (nameMap) { + // case-sensitive + localeModel = getLocaleModel(nameMap) || localeModel; + } // PENDING + // for ZH locale, original form is `一月` but current form is `1月` - var content = this._formatterLabel(formatter, params); - var monthText = new ZRText({ - z2: 30, - style: extend(createTextStyle(monthLabel, { - text: content - }), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin)) - }); - group.add(monthText); - } - }; + nameMap = localeModel.get(['time', 'monthAbbr']) || []; + } - CalendarView.prototype._weekTextPositionControl = function (point, orient, position, margin, cellSize) { - var align = 'center'; - var vAlign = 'middle'; - var x = point[0]; - var y = point[1]; - var isStart = position === 'start'; + var idx = pos === 'start' ? 0 : 1; + var axis = orient === 'horizontal' ? 0 : 1; + margin = pos === 'start' ? -margin : margin; + var isCenter = align === 'center'; - if (orient === 'horizontal') { - x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2; - align = isStart ? 'right' : 'left'; - } else { - y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2; - vAlign = isStart ? 'bottom' : 'top'; - } + for (var i = 0; i < termPoints[idx].length - 1; i++) { + var tmp = termPoints[idx][i].slice(); + var firstDay = this._firstDayOfMonth[i]; - return { - x: x, - y: y, - align: align, - verticalAlign: vAlign - }; - }; // render weeks + if (isCenter) { + var firstDayPoints = this._firstDayPoints[i]; + tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2; + } + var formatter = monthLabel.get('formatter'); + var name_1 = nameMap[+firstDay.m - 1]; + var params = { + yyyy: firstDay.y, + yy: (firstDay.y + '').slice(2), + MM: firstDay.m, + M: +firstDay.m, + nameMap: name_1 + }; - CalendarView.prototype._renderWeekText = function (calendarModel, localeModel, rangeData, orient, group) { - var dayLabel = calendarModel.getModel('dayLabel'); + var content = this._formatterLabel(formatter, params); - if (!dayLabel.get('show')) { - return; - } + var monthText = new ZRText({ + z2: 30, + style: extend(createTextStyle(monthLabel, { + text: content + }), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin)) + }); + group.add(monthText); + } + }; - var coordSys = calendarModel.coordinateSystem; - var pos = dayLabel.get('position'); - var nameMap = dayLabel.get('nameMap'); - var margin = dayLabel.get('margin'); - var firstDayOfWeek = coordSys.getFirstDayOfWeek(); + CalendarView.prototype._weekTextPositionControl = function (point, orient, position, margin, cellSize) { + var align = 'center'; + var vAlign = 'middle'; + var x = point[0]; + var y = point[1]; + var isStart = position === 'start'; - if (!nameMap || isString(nameMap)) { - if (nameMap) { - // case-sensitive - localeModel = getLocaleModel(nameMap) || localeModel; - } // Use the first letter of `dayOfWeekAbbr` if `dayOfWeekShort` doesn't exist in the locale file + if (orient === 'horizontal') { + x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2; + align = isStart ? 'right' : 'left'; + } else { + y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2; + vAlign = isStart ? 'bottom' : 'top'; + } + return { + x: x, + y: y, + align: align, + verticalAlign: vAlign + }; + }; // render weeks - var dayOfWeekShort = localeModel.get(['time', 'dayOfWeekShort']); - nameMap = dayOfWeekShort || map(localeModel.get(['time', 'dayOfWeekAbbr']), function (val) { - return val[0]; - }); - } - var start = coordSys.getNextNDay(rangeData.end.time, 7 - rangeData.lweek).time; - var cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()]; - margin = parsePercent$1(margin, Math.min(cellSize[1], cellSize[0])); + CalendarView.prototype._renderWeekText = function (calendarModel, localeModel, rangeData, orient, group) { + var dayLabel = calendarModel.getModel('dayLabel'); - if (pos === 'start') { - start = coordSys.getNextNDay(rangeData.start.time, -(7 + rangeData.fweek)).time; - margin = -margin; - } + if (!dayLabel.get('show')) { + return; + } - for (var i = 0; i < 7; i++) { - var tmpD = coordSys.getNextNDay(start, i); - var point = coordSys.dataToRect([tmpD.time], false).center; - var day = i; - day = Math.abs((i + firstDayOfWeek) % 7); - var weekText = new ZRText({ - z2: 30, - style: extend(createTextStyle(dayLabel, { - text: nameMap[day] - }), this._weekTextPositionControl(point, orient, pos, margin, cellSize)) - }); - group.add(weekText); - } - }; + var coordSys = calendarModel.coordinateSystem; + var pos = dayLabel.get('position'); + var nameMap = dayLabel.get('nameMap'); + var margin = dayLabel.get('margin'); + var firstDayOfWeek = coordSys.getFirstDayOfWeek(); - CalendarView.type = 'calendar'; - return CalendarView; - }(ComponentView); + if (!nameMap || isString(nameMap)) { + if (nameMap) { + // case-sensitive + localeModel = getLocaleModel(nameMap) || localeModel; + } // Use the first letter of `dayOfWeekAbbr` if `dayOfWeekShort` doesn't exist in the locale file - var PROXIMATE_ONE_DAY = 86400000; - var Calendar = - /** @class */ - function () { - function Calendar(calendarModel, ecModel, api) { - this.type = 'calendar'; - this.dimensions = Calendar.dimensions; // Required in createListFromData + var dayOfWeekShort = localeModel.get(['time', 'dayOfWeekShort']); + nameMap = dayOfWeekShort || map(localeModel.get(['time', 'dayOfWeekAbbr']), function (val) { + return val[0]; + }); + } - this.getDimensionsInfo = Calendar.getDimensionsInfo; - this._model = calendarModel; - } + var start = coordSys.getNextNDay(rangeData.end.time, 7 - rangeData.lweek).time; + var cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()]; + margin = parsePercent$1(margin, Math.min(cellSize[1], cellSize[0])); - Calendar.getDimensionsInfo = function () { - return [{ - name: 'time', - type: 'time' - }, 'value']; - }; + if (pos === 'start') { + start = coordSys.getNextNDay(rangeData.start.time, -(7 + rangeData.fweek)).time; + margin = -margin; + } - Calendar.prototype.getRangeInfo = function () { - return this._rangeInfo; - }; + for (var i = 0; i < 7; i++) { + var tmpD = coordSys.getNextNDay(start, i); + var point = coordSys.dataToRect([tmpD.time], false).center; + var day = i; + day = Math.abs((i + firstDayOfWeek) % 7); + var weekText = new ZRText({ + z2: 30, + style: extend(createTextStyle(dayLabel, { + text: nameMap[day] + }), this._weekTextPositionControl(point, orient, pos, margin, cellSize)) + }); + group.add(weekText); + } + }; - Calendar.prototype.getModel = function () { - return this._model; - }; + CalendarView.type = 'calendar'; + return CalendarView; + }(ComponentView); - Calendar.prototype.getRect = function () { - return this._rect; - }; + var PROXIMATE_ONE_DAY = 86400000; - Calendar.prototype.getCellWidth = function () { - return this._sw; - }; + var Calendar = + /** @class */ + function () { + function Calendar(calendarModel, ecModel, api) { + this.type = 'calendar'; + this.dimensions = Calendar.dimensions; // Required in createListFromData - Calendar.prototype.getCellHeight = function () { - return this._sh; - }; + this.getDimensionsInfo = Calendar.getDimensionsInfo; + this._model = calendarModel; + } - Calendar.prototype.getOrient = function () { - return this._orient; - }; - /** - * getFirstDayOfWeek - * - * @example - * 0 : start at Sunday - * 1 : start at Monday - * - * @return {number} - */ + Calendar.getDimensionsInfo = function () { + return [{ + name: 'time', + type: 'time' + }, 'value']; + }; + + Calendar.prototype.getRangeInfo = function () { + return this._rangeInfo; + }; + + Calendar.prototype.getModel = function () { + return this._model; + }; + + Calendar.prototype.getRect = function () { + return this._rect; + }; + + Calendar.prototype.getCellWidth = function () { + return this._sw; + }; + + Calendar.prototype.getCellHeight = function () { + return this._sh; + }; + + Calendar.prototype.getOrient = function () { + return this._orient; + }; + /** + * getFirstDayOfWeek + * + * @example + * 0 : start at Sunday + * 1 : start at Monday + * + * @return {number} + */ - Calendar.prototype.getFirstDayOfWeek = function () { - return this._firstDayOfWeek; - }; - /** - * get date info - * } - */ + Calendar.prototype.getFirstDayOfWeek = function () { + return this._firstDayOfWeek; + }; + /** + * get date info + * } + */ - Calendar.prototype.getDateInfo = function (date) { - date = parseDate(date); - var y = date.getFullYear(); - var m = date.getMonth() + 1; - var mStr = m < 10 ? '0' + m : '' + m; - var d = date.getDate(); - var dStr = d < 10 ? '0' + d : '' + d; - var day = date.getDay(); - day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7); - return { - y: y + '', - m: mStr, - d: dStr, - day: day, - time: date.getTime(), - formatedDate: y + '-' + mStr + '-' + dStr, - date: date - }; - }; + Calendar.prototype.getDateInfo = function (date) { + date = parseDate(date); + var y = date.getFullYear(); + var m = date.getMonth() + 1; + var mStr = m < 10 ? '0' + m : '' + m; + var d = date.getDate(); + var dStr = d < 10 ? '0' + d : '' + d; + var day = date.getDay(); + day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7); + return { + y: y + '', + m: mStr, + d: dStr, + day: day, + time: date.getTime(), + formatedDate: y + '-' + mStr + '-' + dStr, + date: date + }; + }; - Calendar.prototype.getNextNDay = function (date, n) { - n = n || 0; + Calendar.prototype.getNextNDay = function (date, n) { + n = n || 0; - if (n === 0) { - return this.getDateInfo(date); - } + if (n === 0) { + return this.getDateInfo(date); + } - date = new Date(this.getDateInfo(date).time); - date.setDate(date.getDate() + n); - return this.getDateInfo(date); - }; + date = new Date(this.getDateInfo(date).time); + date.setDate(date.getDate() + n); + return this.getDateInfo(date); + }; - Calendar.prototype.update = function (ecModel, api) { - 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 weeks = this._rangeInfo.weeks || 1; - var whNames = ['width', 'height']; + Calendar.prototype.update = function (ecModel, api) { + 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 weeks = this._rangeInfo.weeks || 1; + var whNames = ['width', 'height']; - var cellSize = this._model.getCellSize().slice(); + var cellSize = this._model.getCellSize().slice(); - var layoutParams = this._model.getBoxLayoutParams(); + var layoutParams = this._model.getBoxLayoutParams(); - var cellNumbers = this._orient === 'horizontal' ? [weeks, 7] : [7, weeks]; - each([0, 1], function (idx) { - if (cellSizeSpecified(cellSize, idx)) { - layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx]; - } - }); - var whGlobal = { - width: api.getWidth(), - height: api.getHeight() - }; - var calendarRect = this._rect = getLayoutRect(layoutParams, whGlobal); - each([0, 1], function (idx) { - if (!cellSizeSpecified(cellSize, idx)) { - cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx]; - } - }); + var cellNumbers = this._orient === 'horizontal' ? [weeks, 7] : [7, weeks]; + each([0, 1], function (idx) { + if (cellSizeSpecified(cellSize, idx)) { + layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx]; + } + }); + var whGlobal = { + width: api.getWidth(), + height: api.getHeight() + }; + var calendarRect = this._rect = getLayoutRect(layoutParams, whGlobal); + each([0, 1], function (idx) { + if (!cellSizeSpecified(cellSize, idx)) { + cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx]; + } + }); - function cellSizeSpecified(cellSize, idx) { - return cellSize[idx] != null && cellSize[idx] !== 'auto'; - } // Has been calculated out number. + function cellSizeSpecified(cellSize, idx) { + return cellSize[idx] != null && cellSize[idx] !== 'auto'; + } // Has been calculated out number. - this._sw = cellSize[0]; - this._sh = cellSize[1]; - }; - /** - * Convert a time data(time, value) item to (x, y) point. - */ - // TODO Clamp of calendar is not same with cartesian coordinate systems. - // It will return NaN if data exceeds. + this._sw = cellSize[0]; + this._sh = cellSize[1]; + }; + /** + * Convert a time data(time, value) item to (x, y) point. + */ + // TODO Clamp of calendar is not same with cartesian coordinate systems. + // It will return NaN if data exceeds. - Calendar.prototype.dataToPoint = function (data, clamp) { - isArray(data) && (data = data[0]); - clamp == null && (clamp = true); - var dayInfo = this.getDateInfo(data); - var range = this._rangeInfo; - var date = dayInfo.formatedDate; // if not in range return [NaN, NaN] + Calendar.prototype.dataToPoint = function (data, clamp) { + isArray(data) && (data = data[0]); + clamp == null && (clamp = true); + var dayInfo = this.getDateInfo(data); + var range = this._rangeInfo; + var date = dayInfo.formatedDate; // if not in range return [NaN, NaN] - if (clamp && !(dayInfo.time >= range.start.time && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY)) { - return [NaN, NaN]; - } + if (clamp && !(dayInfo.time >= range.start.time && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY)) { + return [NaN, NaN]; + } - var week = dayInfo.day; + var week = dayInfo.day; - var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek; + var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek; - if (this._orient === 'vertical') { - return [this._rect.x + week * this._sw + this._sw / 2, this._rect.y + nthWeek * this._sh + this._sh / 2]; - } + if (this._orient === 'vertical') { + return [this._rect.x + week * this._sw + this._sw / 2, this._rect.y + nthWeek * this._sh + this._sh / 2]; + } - return [this._rect.x + nthWeek * this._sw + this._sw / 2, this._rect.y + week * this._sh + this._sh / 2]; - }; - /** - * Convert a (x, y) point to time data - */ + return [this._rect.x + nthWeek * this._sw + this._sw / 2, this._rect.y + week * this._sh + this._sh / 2]; + }; + /** + * Convert a (x, y) point to time data + */ - Calendar.prototype.pointToData = function (point) { - var date = this.pointToDate(point); - return date && date.time; - }; - /** - * Convert a time date item to (x, y) four point. - */ + Calendar.prototype.pointToData = function (point) { + var date = this.pointToDate(point); + return date && date.time; + }; + /** + * Convert a time date item to (x, y) four point. + */ - Calendar.prototype.dataToRect = function (data, clamp) { - var point = this.dataToPoint(data, clamp); - return { - contentShape: { - x: point[0] - (this._sw - this._lineWidth) / 2, - y: point[1] - (this._sh - this._lineWidth) / 2, - width: this._sw - this._lineWidth, - height: this._sh - this._lineWidth - }, - center: point, - tl: [point[0] - this._sw / 2, point[1] - this._sh / 2], - tr: [point[0] + this._sw / 2, point[1] - this._sh / 2], - br: [point[0] + this._sw / 2, point[1] + this._sh / 2], - bl: [point[0] - this._sw / 2, point[1] + this._sh / 2] - }; - }; - /** - * Convert a (x, y) point to time date - * - * @param {Array} point point - * @return {Object} date - */ + Calendar.prototype.dataToRect = function (data, clamp) { + var point = this.dataToPoint(data, clamp); + return { + contentShape: { + x: point[0] - (this._sw - this._lineWidth) / 2, + y: point[1] - (this._sh - this._lineWidth) / 2, + width: this._sw - this._lineWidth, + height: this._sh - this._lineWidth + }, + center: point, + tl: [point[0] - this._sw / 2, point[1] - this._sh / 2], + tr: [point[0] + this._sw / 2, point[1] - this._sh / 2], + br: [point[0] + this._sw / 2, point[1] + this._sh / 2], + bl: [point[0] - this._sw / 2, point[1] + this._sh / 2] + }; + }; + /** + * Convert a (x, y) point to time date + * + * @param {Array} point point + * @return {Object} date + */ - Calendar.prototype.pointToDate = function (point) { - var nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1; - var nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1; - var range = this._rangeInfo.range; + Calendar.prototype.pointToDate = function (point) { + var nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1; + var nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1; + var range = this._rangeInfo.range; - if (this._orient === 'vertical') { - return this._getDateByWeeksAndDay(nthY, nthX - 1, range); - } + if (this._orient === 'vertical') { + return this._getDateByWeeksAndDay(nthY, nthX - 1, range); + } - return this._getDateByWeeksAndDay(nthX, nthY - 1, range); - }; + return this._getDateByWeeksAndDay(nthX, nthY - 1, range); + }; - Calendar.prototype.convertToPixel = function (ecModel, finder, value) { - var coordSys = getCoordSys$4(finder); - return coordSys === this ? coordSys.dataToPoint(value) : null; - }; + Calendar.prototype.convertToPixel = function (ecModel, finder, value) { + var coordSys = getCoordSys$4(finder); + return coordSys === this ? coordSys.dataToPoint(value) : null; + }; - Calendar.prototype.convertFromPixel = function (ecModel, finder, pixel) { - var coordSys = getCoordSys$4(finder); - return coordSys === this ? coordSys.pointToData(pixel) : null; - }; + Calendar.prototype.convertFromPixel = function (ecModel, finder, pixel) { + var coordSys = getCoordSys$4(finder); + return coordSys === this ? coordSys.pointToData(pixel) : null; + }; - Calendar.prototype.containPoint = function (point) { - console.warn('Not implemented.'); - return false; - }; - /** - * initRange - * Normalize to an [start, end] array - */ + Calendar.prototype.containPoint = function (point) { + console.warn('Not implemented.'); + return false; + }; + /** + * initRange + * Normalize to an [start, end] array + */ - Calendar.prototype._initRangeOption = function () { - var range = this._model.get('range'); + Calendar.prototype._initRangeOption = function () { + var range = this._model.get('range'); - var normalizedRange; // Convert [1990] to 1990 + var normalizedRange; // Convert [1990] to 1990 - if (isArray(range) && range.length === 1) { - range = range[0]; - } + if (isArray(range) && range.length === 1) { + range = range[0]; + } - if (!isArray(range)) { - var rangeStr = range.toString(); // One year. + if (!isArray(range)) { + var rangeStr = range.toString(); // One year. - if (/^\d{4}$/.test(rangeStr)) { - normalizedRange = [rangeStr + '-01-01', rangeStr + '-12-31']; - } // One month + if (/^\d{4}$/.test(rangeStr)) { + normalizedRange = [rangeStr + '-01-01', rangeStr + '-12-31']; + } // One month - if (/^\d{4}[\/|-]\d{1,2}$/.test(rangeStr)) { - var start = this.getDateInfo(rangeStr); - var firstDay = start.date; - firstDay.setMonth(firstDay.getMonth() + 1); - var end = this.getNextNDay(firstDay, -1); - normalizedRange = [start.formatedDate, end.formatedDate]; - } // One day + if (/^\d{4}[\/|-]\d{1,2}$/.test(rangeStr)) { + var start = this.getDateInfo(rangeStr); + var firstDay = start.date; + firstDay.setMonth(firstDay.getMonth() + 1); + var end = this.getNextNDay(firstDay, -1); + normalizedRange = [start.formatedDate, end.formatedDate]; + } // One day - if (/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(rangeStr)) { - normalizedRange = [rangeStr, rangeStr]; - } - } else { - normalizedRange = range; - } + if (/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(rangeStr)) { + normalizedRange = [rangeStr, rangeStr]; + } + } else { + normalizedRange = range; + } - if (!normalizedRange) { - if ("development" !== 'production') { - logError('Invalid date range.'); - } // Not handling it. + if (!normalizedRange) { + if ("development" !== 'production') { + logError('Invalid date range.'); + } // Not handling it. - return range; - } + return range; + } - var tmp = this._getRangeInfo(normalizedRange); + var tmp = this._getRangeInfo(normalizedRange); - if (tmp.start.time > tmp.end.time) { - normalizedRange.reverse(); - } + if (tmp.start.time > tmp.end.time) { + normalizedRange.reverse(); + } - return normalizedRange; - }; - /** - * range info - * - * @private - * @param {Array} range range ['2017-01-01', '2017-07-08'] - * If range[0] > range[1], they will not be reversed. - * @return {Object} obj - */ + return normalizedRange; + }; + /** + * range info + * + * @private + * @param {Array} range range ['2017-01-01', '2017-07-08'] + * If range[0] > range[1], they will not be reversed. + * @return {Object} obj + */ - Calendar.prototype._getRangeInfo = function (range) { - var parsedRange = [this.getDateInfo(range[0]), this.getDateInfo(range[1])]; - var reversed; + Calendar.prototype._getRangeInfo = function (range) { + var parsedRange = [this.getDateInfo(range[0]), this.getDateInfo(range[1])]; + var reversed; - if (parsedRange[0].time > parsedRange[1].time) { - reversed = true; - parsedRange.reverse(); - } + if (parsedRange[0].time > parsedRange[1].time) { + reversed = true; + parsedRange.reverse(); + } - var allDay = Math.floor(parsedRange[1].time / PROXIMATE_ONE_DAY) - Math.floor(parsedRange[0].time / PROXIMATE_ONE_DAY) + 1; // Consider case1 (#11677 #10430): - // Set the system timezone as "UK", set the range to `['2016-07-01', '2016-12-31']` - // Consider case2: - // Firstly set system timezone as "Time Zone: America/Toronto", - // ``` - // let first = new Date(1478412000000 - 3600 * 1000 * 2.5); - // let second = new Date(1478412000000); - // let allDays = Math.floor(second / ONE_DAY) - Math.floor(first / ONE_DAY) + 1; - // ``` - // will get wrong result because of DST. So we should fix it. + var allDay = Math.floor(parsedRange[1].time / PROXIMATE_ONE_DAY) - Math.floor(parsedRange[0].time / PROXIMATE_ONE_DAY) + 1; // Consider case1 (#11677 #10430): + // Set the system timezone as "UK", set the range to `['2016-07-01', '2016-12-31']` + // Consider case2: + // Firstly set system timezone as "Time Zone: America/Toronto", + // ``` + // let first = new Date(1478412000000 - 3600 * 1000 * 2.5); + // let second = new Date(1478412000000); + // let allDays = Math.floor(second / ONE_DAY) - Math.floor(first / ONE_DAY) + 1; + // ``` + // will get wrong result because of DST. So we should fix it. - var date = new Date(parsedRange[0].time); - var startDateNum = date.getDate(); - var endDateNum = parsedRange[1].date.getDate(); - date.setDate(startDateNum + allDay - 1); // The bias can not over a month, so just compare date. + var date = new Date(parsedRange[0].time); + var startDateNum = date.getDate(); + var endDateNum = parsedRange[1].date.getDate(); + date.setDate(startDateNum + allDay - 1); // The bias can not over a month, so just compare date. - var dateNum = date.getDate(); + var dateNum = date.getDate(); - if (dateNum !== endDateNum) { - var sign = date.getTime() - parsedRange[1].time > 0 ? 1 : -1; + if (dateNum !== endDateNum) { + var sign = date.getTime() - parsedRange[1].time > 0 ? 1 : -1; - while ((dateNum = date.getDate()) !== endDateNum && (date.getTime() - parsedRange[1].time) * sign > 0) { - allDay -= sign; - date.setDate(dateNum - sign); - } - } + while ((dateNum = date.getDate()) !== endDateNum && (date.getTime() - parsedRange[1].time) * sign > 0) { + allDay -= sign; + date.setDate(dateNum - sign); + } + } - var weeks = Math.floor((allDay + parsedRange[0].day + 6) / 7); - var nthWeek = reversed ? -weeks + 1 : weeks - 1; - reversed && parsedRange.reverse(); - return { - range: [parsedRange[0].formatedDate, parsedRange[1].formatedDate], - start: parsedRange[0], - end: parsedRange[1], - allDay: allDay, - weeks: weeks, - // From 0. - nthWeek: nthWeek, - fweek: parsedRange[0].day, - lweek: parsedRange[1].day - }; - }; - /** - * get date by nthWeeks and week day in range - * - * @private - * @param {number} nthWeek the week - * @param {number} day the week day - * @param {Array} range [d1, d2] - * @return {Object} - */ + var weeks = Math.floor((allDay + parsedRange[0].day + 6) / 7); + var nthWeek = reversed ? -weeks + 1 : weeks - 1; + reversed && parsedRange.reverse(); + return { + range: [parsedRange[0].formatedDate, parsedRange[1].formatedDate], + start: parsedRange[0], + end: parsedRange[1], + allDay: allDay, + weeks: weeks, + // From 0. + nthWeek: nthWeek, + fweek: parsedRange[0].day, + lweek: parsedRange[1].day + }; + }; + /** + * get date by nthWeeks and week day in range + * + * @private + * @param {number} nthWeek the week + * @param {number} day the week day + * @param {Array} range [d1, d2] + * @return {Object} + */ - Calendar.prototype._getDateByWeeksAndDay = function (nthWeek, day, range) { - var rangeInfo = this._getRangeInfo(range); + Calendar.prototype._getDateByWeeksAndDay = function (nthWeek, day, range) { + var rangeInfo = this._getRangeInfo(range); - if (nthWeek > rangeInfo.weeks || nthWeek === 0 && day < rangeInfo.fweek || nthWeek === rangeInfo.weeks && day > rangeInfo.lweek) { - return null; - } + if (nthWeek > rangeInfo.weeks || nthWeek === 0 && day < rangeInfo.fweek || nthWeek === rangeInfo.weeks && day > rangeInfo.lweek) { + return null; + } - var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day; - var date = new Date(rangeInfo.start.time); - date.setDate(+rangeInfo.start.d + nthDay); - return this.getDateInfo(date); - }; + var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day; + var date = new Date(rangeInfo.start.time); + date.setDate(+rangeInfo.start.d + nthDay); + return this.getDateInfo(date); + }; - Calendar.create = function (ecModel, api) { - var calendarList = []; - ecModel.eachComponent('calendar', function (calendarModel) { - var calendar = new Calendar(calendarModel, ecModel, api); - calendarList.push(calendar); - calendarModel.coordinateSystem = calendar; - }); - ecModel.eachSeries(function (calendarSeries) { - if (calendarSeries.get('coordinateSystem') === 'calendar') { - // Inject coordinate system - calendarSeries.coordinateSystem = calendarList[calendarSeries.get('calendarIndex') || 0]; - } - }); - return calendarList; - }; + Calendar.create = function (ecModel, api) { + var calendarList = []; + ecModel.eachComponent('calendar', function (calendarModel) { + var calendar = new Calendar(calendarModel, ecModel, api); + calendarList.push(calendar); + calendarModel.coordinateSystem = calendar; + }); + ecModel.eachSeries(function (calendarSeries) { + if (calendarSeries.get('coordinateSystem') === 'calendar') { + // Inject coordinate system + calendarSeries.coordinateSystem = calendarList[calendarSeries.get('calendarIndex') || 0]; + } + }); + return calendarList; + }; - Calendar.dimensions = ['time', 'value']; - return Calendar; - }(); + Calendar.dimensions = ['time', 'value']; + return Calendar; + }(); function getCoordSys$4(finder) { - var calendarModel = finder.calendarModel; - var seriesModel = finder.seriesModel; - var coordSys = calendarModel ? calendarModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem : null; - return coordSys; + var calendarModel = finder.calendarModel; + var seriesModel = finder.seriesModel; + var coordSys = calendarModel ? calendarModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem : null; + return coordSys; } function install$w(registers) { - registers.registerComponentModel(CalendarModel); - registers.registerComponentView(CalendarView); - registers.registerCoordinateSystem('calendar', Calendar); + registers.registerComponentModel(CalendarModel); + registers.registerComponentView(CalendarView); + registers.registerCoordinateSystem('calendar', Calendar); } function setKeyInfoToNewElOption(resultItem, newElOption) { - var existElOption = resultItem.existing; // Set id and type after id assigned. + var existElOption = resultItem.existing; // Set id and type after id assigned. - newElOption.id = resultItem.keyInfo.id; - !newElOption.type && existElOption && (newElOption.type = existElOption.type); // Set parent id if not specified + newElOption.id = resultItem.keyInfo.id; + !newElOption.type && existElOption && (newElOption.type = existElOption.type); // Set parent id if not specified - if (newElOption.parentId == null) { - var newElParentOption = newElOption.parentOption; + if (newElOption.parentId == null) { + var newElParentOption = newElOption.parentOption; - if (newElParentOption) { - newElOption.parentId = newElParentOption.id; - } else if (existElOption) { - newElOption.parentId = existElOption.parentId; - } - } // Clear + if (newElParentOption) { + newElOption.parentId = newElParentOption.id; + } else if (existElOption) { + newElOption.parentId = existElOption.parentId; + } + } // Clear - newElOption.parentOption = null; + newElOption.parentOption = null; } function isSetLoc(obj, props) { - var isSet; - each(props, function (prop) { - obj[prop] != null && obj[prop] !== 'auto' && (isSet = true); - }); - return isSet; + var isSet; + each(props, function (prop) { + obj[prop] != null && obj[prop] !== 'auto' && (isSet = true); + }); + return isSet; } function mergeNewElOptionToExist(existList, index, newElOption) { - // Update existing options, for `getOption` feature. - var newElOptCopy = extend({}, newElOption); - var existElOption = existList[index]; - var $action = newElOption.$action || 'merge'; + // Update existing options, for `getOption` feature. + var newElOptCopy = extend({}, newElOption); + var existElOption = existList[index]; + var $action = newElOption.$action || 'merge'; - if ($action === 'merge') { - if (existElOption) { - if ("development" !== 'production') { - var newType = newElOption.type; - assert(!newType || existElOption.type === newType, 'Please set $action: "replace" to change `type`'); - } // We can ensure that newElOptCopy and existElOption are not - // the same object, so `merge` will not change newElOptCopy. + if ($action === 'merge') { + if (existElOption) { + if ("development" !== 'production') { + var newType = newElOption.type; + assert(!newType || existElOption.type === newType, 'Please set $action: "replace" to change `type`'); + } // We can ensure that newElOptCopy and existElOption are not + // the same object, so `merge` will not change newElOptCopy. - merge(existElOption, newElOptCopy, true); // Rigid body, use ignoreSize. + merge(existElOption, newElOptCopy, true); // Rigid body, use ignoreSize. - mergeLayoutParam(existElOption, newElOptCopy, { - ignoreSize: true - }); // Will be used in render. + mergeLayoutParam(existElOption, newElOptCopy, { + ignoreSize: true + }); // Will be used in render. - copyLayoutParams(newElOption, existElOption); // Copy transition info to new option so it can be used in the transition. - // DO IT AFTER merge + copyLayoutParams(newElOption, existElOption); // Copy transition info to new option so it can be used in the transition. + // DO IT AFTER merge - copyTransitionInfo(newElOption, existElOption); - copyTransitionInfo(newElOption, existElOption, 'shape'); - copyTransitionInfo(newElOption, existElOption, 'style'); - copyTransitionInfo(newElOption, existElOption, 'extra'); // Copy clipPath + copyTransitionInfo(newElOption, existElOption); + copyTransitionInfo(newElOption, existElOption, 'shape'); + copyTransitionInfo(newElOption, existElOption, 'style'); + copyTransitionInfo(newElOption, existElOption, 'extra'); // Copy clipPath - newElOption.clipPath = existElOption.clipPath; - } else { - existList[index] = newElOptCopy; - } - } else if ($action === 'replace') { - existList[index] = newElOptCopy; - } else if ($action === 'remove') { - // null will be cleaned later. - existElOption && (existList[index] = null); + newElOption.clipPath = existElOption.clipPath; + } else { + existList[index] = newElOptCopy; } + } else if ($action === 'replace') { + existList[index] = newElOptCopy; + } else if ($action === 'remove') { + // null will be cleaned later. + existElOption && (existList[index] = null); + } } var TRANSITION_PROPS_TO_COPY = ['transition', 'enterFrom', 'leaveTo']; var ROOT_TRANSITION_PROPS_TO_COPY = TRANSITION_PROPS_TO_COPY.concat(['enterAnimation', 'updateAnimation', 'leaveAnimation']); function copyTransitionInfo(target, source, targetProp) { - if (targetProp) { - if (!target[targetProp] && source[targetProp]) { - // TODO avoid creating this empty object when there is no transition configuration. - target[targetProp] = {}; - } - - target = target[targetProp]; - source = source[targetProp]; + if (targetProp) { + if (!target[targetProp] && source[targetProp]) { + // TODO avoid creating this empty object when there is no transition configuration. + target[targetProp] = {}; } - if (!target || !source) { - return; - } + target = target[targetProp]; + source = source[targetProp]; + } - var props = targetProp ? TRANSITION_PROPS_TO_COPY : ROOT_TRANSITION_PROPS_TO_COPY; + if (!target || !source) { + return; + } - for (var i = 0; i < props.length; i++) { - var prop = props[i]; + var props = targetProp ? TRANSITION_PROPS_TO_COPY : ROOT_TRANSITION_PROPS_TO_COPY; - if (target[prop] == null && source[prop] != null) { - target[prop] = source[prop]; - } + for (var i = 0; i < props.length; i++) { + var prop = props[i]; + + if (target[prop] == null && source[prop] != null) { + target[prop] = source[prop]; } + } } function setLayoutInfoToExist(existItem, newElOption) { - if (!existItem) { - return; - } + if (!existItem) { + return; + } - existItem.hv = newElOption.hv = [// Rigid body, dont care `width`. - isSetLoc(newElOption, ['left', 'right']), // Rigid body, dont care `height`. - isSetLoc(newElOption, ['top', 'bottom'])]; // Give default group size. Otherwise layout error may occur. + existItem.hv = newElOption.hv = [// Rigid body, dont care `width`. + isSetLoc(newElOption, ['left', 'right']), // Rigid body, dont care `height`. + isSetLoc(newElOption, ['top', 'bottom'])]; // Give default group size. Otherwise layout error may occur. - if (existItem.type === 'group') { - var existingGroupOpt = existItem; - var newGroupOpt = newElOption; - existingGroupOpt.width == null && (existingGroupOpt.width = newGroupOpt.width = 0); - existingGroupOpt.height == null && (existingGroupOpt.height = newGroupOpt.height = 0); - } + if (existItem.type === 'group') { + var existingGroupOpt = existItem; + var newGroupOpt = newElOption; + existingGroupOpt.width == null && (existingGroupOpt.width = newGroupOpt.width = 0); + existingGroupOpt.height == null && (existingGroupOpt.height = newGroupOpt.height = 0); + } } var GraphicComponentModel = - /** @class */ - function (_super) { - __extends(GraphicComponentModel, _super); - - function GraphicComponentModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + /** @class */ + function (_super) { + __extends(GraphicComponentModel, _super); - _this.type = GraphicComponentModel.type; - _this.preventAutoZ = true; - return _this; - } + function GraphicComponentModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - GraphicComponentModel.prototype.mergeOption = function (option, ecModel) { - // Prevent default merge to elements - var elements = this.option.elements; - this.option.elements = null; + _this.type = GraphicComponentModel.type; + _this.preventAutoZ = true; + return _this; + } - _super.prototype.mergeOption.call(this, option, ecModel); + GraphicComponentModel.prototype.mergeOption = function (option, ecModel) { + // Prevent default merge to elements + var elements = this.option.elements; + this.option.elements = null; - this.option.elements = elements; - }; + _super.prototype.mergeOption.call(this, option, ecModel); - GraphicComponentModel.prototype.optionUpdated = function (newOption, isInit) { - var thisOption = this.option; - var newList = (isInit ? thisOption : newOption).elements; - var existList = thisOption.elements = isInit ? [] : thisOption.elements; - var flattenedList = []; + this.option.elements = elements; + }; - this._flatten(newList, flattenedList, null); + GraphicComponentModel.prototype.optionUpdated = function (newOption, isInit) { + var thisOption = this.option; + var newList = (isInit ? thisOption : newOption).elements; + var existList = thisOption.elements = isInit ? [] : thisOption.elements; + var flattenedList = []; - var mappingResult = mappingToExists(existList, flattenedList, 'normalMerge'); // Clear elOptionsToUpdate + this._flatten(newList, flattenedList, null); - var elOptionsToUpdate = this._elOptionsToUpdate = []; - each(mappingResult, function (resultItem, index) { - var newElOption = resultItem.newOption; + var mappingResult = mappingToExists(existList, flattenedList, 'normalMerge'); // Clear elOptionsToUpdate - if ("development" !== 'production') { - assert(isObject(newElOption) || resultItem.existing, 'Empty graphic option definition'); - } + var elOptionsToUpdate = this._elOptionsToUpdate = []; + each(mappingResult, function (resultItem, index) { + var newElOption = resultItem.newOption; - if (!newElOption) { - return; - } + if ("development" !== 'production') { + assert(isObject(newElOption) || resultItem.existing, 'Empty graphic option definition'); + } - elOptionsToUpdate.push(newElOption); - setKeyInfoToNewElOption(resultItem, newElOption); - mergeNewElOptionToExist(existList, index, newElOption); - setLayoutInfoToExist(existList[index], newElOption); - }, this); // Clean - - thisOption.elements = filter(existList, function (item) { - // $action should be volatile, otherwise option gotten from - // `getOption` will contain unexpected $action. - item && delete item.$action; - return item != null; - }); - }; - /** - * Convert - * [{ - * type: 'group', - * id: 'xx', - * children: [{type: 'circle'}, {type: 'polygon'}] - * }] - * to - * [ - * {type: 'group', id: 'xx'}, - * {type: 'circle', parentId: 'xx'}, - * {type: 'polygon', parentId: 'xx'} - * ] - */ + if (!newElOption) { + return; + } + + elOptionsToUpdate.push(newElOption); + setKeyInfoToNewElOption(resultItem, newElOption); + mergeNewElOptionToExist(existList, index, newElOption); + setLayoutInfoToExist(existList[index], newElOption); + }, this); // Clean + + thisOption.elements = filter(existList, function (item) { + // $action should be volatile, otherwise option gotten from + // `getOption` will contain unexpected $action. + item && delete item.$action; + return item != null; + }); + }; + /** + * Convert + * [{ + * type: 'group', + * id: 'xx', + * children: [{type: 'circle'}, {type: 'polygon'}] + * }] + * to + * [ + * {type: 'group', id: 'xx'}, + * {type: 'circle', parentId: 'xx'}, + * {type: 'polygon', parentId: 'xx'} + * ] + */ - GraphicComponentModel.prototype._flatten = function (optionList, result, parentOption) { - each(optionList, function (option) { - if (!option) { - return; - } + GraphicComponentModel.prototype._flatten = function (optionList, result, parentOption) { + each(optionList, function (option) { + if (!option) { + return; + } - if (parentOption) { - option.parentOption = parentOption; - } + if (parentOption) { + option.parentOption = parentOption; + } - result.push(option); - var children = option.children; + result.push(option); + var children = option.children; - if (option.type === 'group' && children) { - this._flatten(children, result, option); - } // Deleting for JSON output, and for not affecting group creation. + if (option.type === 'group' && children) { + this._flatten(children, result, option); + } // Deleting for JSON output, and for not affecting group creation. - delete option.children; - }, this); - }; // FIXME - // Pass to view using payload? setOption has a payload? + delete option.children; + }, this); + }; // FIXME + // Pass to view using payload? setOption has a payload? - GraphicComponentModel.prototype.useElOptionsToUpdate = function () { - var els = this._elOptionsToUpdate; // Clear to avoid render duplicately when zooming. + GraphicComponentModel.prototype.useElOptionsToUpdate = function () { + var els = this._elOptionsToUpdate; // Clear to avoid render duplicately when zooming. - this._elOptionsToUpdate = null; - return els; - }; + this._elOptionsToUpdate = null; + return els; + }; - GraphicComponentModel.type = 'graphic'; - GraphicComponentModel.defaultOption = { - elements: [] // parentId: null + GraphicComponentModel.type = 'graphic'; + GraphicComponentModel.defaultOption = { + elements: [] // parentId: null - }; - return GraphicComponentModel; - }(ComponentModel); + }; + return GraphicComponentModel; + }(ComponentModel); var nonShapeGraphicElements = { - // Reserved but not supported in graphic component. - path: null, - compoundPath: null, - // Supported in graphic component. - group: Group, - image: ZRImage, - text: ZRText + // Reserved but not supported in graphic component. + path: null, + compoundPath: null, + // Supported in graphic component. + group: Group, + image: ZRImage, + text: ZRText }; var inner$e = makeInner(); // ------------------------ // View // ------------------------ var GraphicComponentView = - /** @class */ - function (_super) { - __extends(GraphicComponentView, _super); - - function GraphicComponentView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = GraphicComponentView.type; - return _this; - } - - GraphicComponentView.prototype.init = function () { - this._elMap = createHashMap(); - }; - - GraphicComponentView.prototype.render = function (graphicModel, ecModel, api) { - // Having leveraged between use cases and algorithm complexity, a very - // simple layout mechanism is used: - // The size(width/height) can be determined by itself or its parent (not - // implemented yet), but can not by its children. (Top-down travel) - // The location(x/y) can be determined by the bounding rect of itself - // (can including its descendants or not) and the size of its parent. - // (Bottom-up travel) - // When `chart.clear()` or `chart.setOption({...}, true)` with the same id, - // view will be reused. - if (graphicModel !== this._lastGraphicModel) { - this._clear(); - } - - this._lastGraphicModel = graphicModel; - - this._updateElements(graphicModel); - - this._relocate(graphicModel, api); - }; - /** - * Update graphic elements. - */ - - - GraphicComponentView.prototype._updateElements = function (graphicModel) { - var elOptionsToUpdate = graphicModel.useElOptionsToUpdate(); - - if (!elOptionsToUpdate) { - return; - } - - var elMap = this._elMap; - var rootGroup = this.group; - var globalZ = graphicModel.get('z'); - var globalZLevel = graphicModel.get('zlevel'); // Top-down tranverse to assign graphic settings to each elements. - - each(elOptionsToUpdate, function (elOption) { - var id = convertOptionIdName(elOption.id, null); - var elExisting = id != null ? elMap.get(id) : null; - var parentId = convertOptionIdName(elOption.parentId, null); - var targetElParent = parentId != null ? elMap.get(parentId) : rootGroup; - var elType = elOption.type; - var elOptionStyle = elOption.style; - - if (elType === 'text' && elOptionStyle) { - // In top/bottom mode, textVerticalAlign should not be used, which cause - // inaccurately locating. - if (elOption.hv && elOption.hv[1]) { - elOptionStyle.textVerticalAlign = elOptionStyle.textBaseline = elOptionStyle.verticalAlign = elOptionStyle.align = null; - } - } - - var textContentOption = elOption.textContent; - var textConfig = elOption.textConfig; - - if (elOptionStyle && isEC4CompatibleStyle(elOptionStyle, elType, !!textConfig, !!textContentOption)) { - var convertResult = convertFromEC4CompatibleStyle(elOptionStyle, elType, true); - - if (!textConfig && convertResult.textConfig) { - textConfig = elOption.textConfig = convertResult.textConfig; - } - - if (!textContentOption && convertResult.textContent) { - textContentOption = convertResult.textContent; - } - } // Remove unnecessary props to avoid potential problems. - - - var elOptionCleaned = getCleanedElOption(elOption); // For simple, do not support parent change, otherwise reorder is needed. - - if ("development" !== 'production') { - elExisting && assert(targetElParent === elExisting.parent, 'Changing parent is not supported.'); - } - - var $action = elOption.$action || 'merge'; - var isMerge = $action === 'merge'; - var isReplace = $action === 'replace'; + /** @class */ + function (_super) { + __extends(GraphicComponentView, _super); + + function GraphicComponentView() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = GraphicComponentView.type; + return _this; + } + + GraphicComponentView.prototype.init = function () { + this._elMap = createHashMap(); + }; + + GraphicComponentView.prototype.render = function (graphicModel, ecModel, api) { + // Having leveraged between use cases and algorithm complexity, a very + // simple layout mechanism is used: + // The size(width/height) can be determined by itself or its parent (not + // implemented yet), but can not by its children. (Top-down travel) + // The location(x/y) can be determined by the bounding rect of itself + // (can including its descendants or not) and the size of its parent. + // (Bottom-up travel) + // When `chart.clear()` or `chart.setOption({...}, true)` with the same id, + // view will be reused. + if (graphicModel !== this._lastGraphicModel) { + this._clear(); + } + + this._lastGraphicModel = graphicModel; + + this._updateElements(graphicModel); + + this._relocate(graphicModel, api); + }; + /** + * Update graphic elements. + */ - if (isMerge) { - var isInit = !elExisting; - var el_1 = elExisting; - if (isInit) { - el_1 = createEl$1(id, targetElParent, elOption.type, elMap); - } else { - el_1 && (inner$e(el_1).isNew = false); // Stop and restore before update any other attributes. + GraphicComponentView.prototype._updateElements = function (graphicModel) { + var elOptionsToUpdate = graphicModel.useElOptionsToUpdate(); - stopPreviousKeyframeAnimationAndRestore(el_1); - } + if (!elOptionsToUpdate) { + return; + } - if (el_1) { - applyUpdateTransition(el_1, elOptionCleaned, graphicModel, { - isInit: isInit - }); - updateCommonAttrs(el_1, elOption, globalZ, globalZLevel); - } - } else if (isReplace) { - removeEl(elExisting, elOption, elMap, graphicModel); - var el_2 = createEl$1(id, targetElParent, elOption.type, elMap); + var elMap = this._elMap; + var rootGroup = this.group; + var globalZ = graphicModel.get('z'); + var globalZLevel = graphicModel.get('zlevel'); // Top-down tranverse to assign graphic settings to each elements. - if (el_2) { - applyUpdateTransition(el_2, elOptionCleaned, graphicModel, { - isInit: true - }); - updateCommonAttrs(el_2, elOption, globalZ, globalZLevel); - } - } else if ($action === 'remove') { - updateLeaveTo(elExisting, elOption); - removeEl(elExisting, elOption, elMap, graphicModel); - } + each(elOptionsToUpdate, function (elOption) { + var id = convertOptionIdName(elOption.id, null); + var elExisting = id != null ? elMap.get(id) : null; + var parentId = convertOptionIdName(elOption.parentId, null); + var targetElParent = parentId != null ? elMap.get(parentId) : rootGroup; + var elType = elOption.type; + var elOptionStyle = elOption.style; - var el = elMap.get(id); + if (elType === 'text' && elOptionStyle) { + // In top/bottom mode, textVerticalAlign should not be used, which cause + // inaccurately locating. + if (elOption.hv && elOption.hv[1]) { + elOptionStyle.textVerticalAlign = elOptionStyle.textBaseline = elOptionStyle.verticalAlign = elOptionStyle.align = null; + } + } - if (el && textContentOption) { - if (isMerge) { - var textContentExisting = el.getTextContent(); - textContentExisting ? textContentExisting.attr(textContentOption) : el.setTextContent(new ZRText(textContentOption)); - } else if (isReplace) { - el.setTextContent(new ZRText(textContentOption)); - } - } + var textContentOption = elOption.textContent; + var textConfig = elOption.textConfig; - if (el) { - var clipPathOption = elOption.clipPath; - - if (clipPathOption) { - var clipPathType = clipPathOption.type; - var clipPath = void 0; - var isInit = false; - - if (isMerge) { - var oldClipPath = el.getClipPath(); - isInit = !oldClipPath || inner$e(oldClipPath).type !== clipPathType; - clipPath = isInit ? newEl(clipPathType) : oldClipPath; - } else if (isReplace) { - isInit = true; - clipPath = newEl(clipPathType); - } + if (elOptionStyle && isEC4CompatibleStyle(elOptionStyle, elType, !!textConfig, !!textContentOption)) { + var convertResult = convertFromEC4CompatibleStyle(elOptionStyle, elType, true); - el.setClipPath(clipPath); - applyUpdateTransition(clipPath, clipPathOption, graphicModel, { - isInit: isInit - }); - applyKeyframeAnimation(clipPath, clipPathOption.keyframeAnimation, graphicModel); - } + if (!textConfig && convertResult.textConfig) { + textConfig = elOption.textConfig = convertResult.textConfig; + } - var elInner = inner$e(el); - el.setTextConfig(textConfig); - elInner.option = elOption; - setEventData(el, graphicModel, elOption); - setTooltipConfig({ - el: el, - componentModel: graphicModel, - itemName: el.name, - itemTooltipOption: elOption.tooltip - }); - applyKeyframeAnimation(el, elOption.keyframeAnimation, graphicModel); - } - }); - }; - /** - * Locate graphic elements. - */ + if (!textContentOption && convertResult.textContent) { + textContentOption = convertResult.textContent; + } + } // Remove unnecessary props to avoid potential problems. - GraphicComponentView.prototype._relocate = function (graphicModel, api) { - var elOptions = graphicModel.option.elements; - var rootGroup = this.group; - var elMap = this._elMap; - var apiWidth = api.getWidth(); - var apiHeight = api.getHeight(); - var xy = ['x', 'y']; // Top-down to calculate percentage width/height of group + var elOptionCleaned = getCleanedElOption(elOption); // For simple, do not support parent change, otherwise reorder is needed. - for (var i = 0; i < elOptions.length; i++) { - var elOption = elOptions[i]; - var id = convertOptionIdName(elOption.id, null); - var el = id != null ? elMap.get(id) : null; + if ("development" !== 'production') { + elExisting && assert(targetElParent === elExisting.parent, 'Changing parent is not supported.'); + } - if (!el || !el.isGroup) { - continue; - } + var $action = elOption.$action || 'merge'; + var isMerge = $action === 'merge'; + var isReplace = $action === 'replace'; - var parentEl = el.parent; - var isParentRoot = parentEl === rootGroup; // Like 'position:absolut' in css, default 0. + if (isMerge) { + var isInit = !elExisting; + var el_1 = elExisting; - var elInner = inner$e(el); - var parentElInner = inner$e(parentEl); - elInner.width = parsePercent$1(elInner.option.width, isParentRoot ? apiWidth : parentElInner.width) || 0; - elInner.height = parsePercent$1(elInner.option.height, isParentRoot ? apiHeight : parentElInner.height) || 0; - } // Bottom-up tranvese all elements (consider ec resize) to locate elements. + if (isInit) { + el_1 = createEl$1(id, targetElParent, elOption.type, elMap); + } else { + el_1 && (inner$e(el_1).isNew = false); // Stop and restore before update any other attributes. + + stopPreviousKeyframeAnimationAndRestore(el_1); + } + + if (el_1) { + applyUpdateTransition(el_1, elOptionCleaned, graphicModel, { + isInit: isInit + }); + updateCommonAttrs(el_1, elOption, globalZ, globalZLevel); + } + } else if (isReplace) { + removeEl(elExisting, elOption, elMap, graphicModel); + var el_2 = createEl$1(id, targetElParent, elOption.type, elMap); + + if (el_2) { + applyUpdateTransition(el_2, elOptionCleaned, graphicModel, { + isInit: true + }); + updateCommonAttrs(el_2, elOption, globalZ, globalZLevel); + } + } else if ($action === 'remove') { + updateLeaveTo(elExisting, elOption); + removeEl(elExisting, elOption, elMap, graphicModel); + } + + var el = elMap.get(id); + + if (el && textContentOption) { + if (isMerge) { + var textContentExisting = el.getTextContent(); + textContentExisting ? textContentExisting.attr(textContentOption) : el.setTextContent(new ZRText(textContentOption)); + } else if (isReplace) { + el.setTextContent(new ZRText(textContentOption)); + } + } + + if (el) { + var clipPathOption = elOption.clipPath; + + if (clipPathOption) { + var clipPathType = clipPathOption.type; + var clipPath = void 0; + var isInit = false; + + if (isMerge) { + var oldClipPath = el.getClipPath(); + isInit = !oldClipPath || inner$e(oldClipPath).type !== clipPathType; + clipPath = isInit ? newEl(clipPathType) : oldClipPath; + } else if (isReplace) { + isInit = true; + clipPath = newEl(clipPathType); + } + + el.setClipPath(clipPath); + applyUpdateTransition(clipPath, clipPathOption, graphicModel, { + isInit: isInit + }); + applyKeyframeAnimation(clipPath, clipPathOption.keyframeAnimation, graphicModel); + } + + var elInner = inner$e(el); + el.setTextConfig(textConfig); + elInner.option = elOption; + setEventData(el, graphicModel, elOption); + setTooltipConfig({ + el: el, + componentModel: graphicModel, + itemName: el.name, + itemTooltipOption: elOption.tooltip + }); + applyKeyframeAnimation(el, elOption.keyframeAnimation, graphicModel); + } + }); + }; + /** + * Locate graphic elements. + */ - for (var i = elOptions.length - 1; i >= 0; i--) { - var elOption = elOptions[i]; - var id = convertOptionIdName(elOption.id, null); - var el = id != null ? elMap.get(id) : null; + GraphicComponentView.prototype._relocate = function (graphicModel, api) { + var elOptions = graphicModel.option.elements; + var rootGroup = this.group; + var elMap = this._elMap; + var apiWidth = api.getWidth(); + var apiHeight = api.getHeight(); + var xy = ['x', 'y']; // Top-down to calculate percentage width/height of group + + for (var i = 0; i < elOptions.length; i++) { + var elOption = elOptions[i]; + var id = convertOptionIdName(elOption.id, null); + var el = id != null ? elMap.get(id) : null; + + if (!el || !el.isGroup) { + continue; + } + + var parentEl = el.parent; + var isParentRoot = parentEl === rootGroup; // Like 'position:absolut' in css, default 0. + + var elInner = inner$e(el); + var parentElInner = inner$e(parentEl); + elInner.width = parsePercent$1(elInner.option.width, isParentRoot ? apiWidth : parentElInner.width) || 0; + elInner.height = parsePercent$1(elInner.option.height, isParentRoot ? apiHeight : parentElInner.height) || 0; + } // Bottom-up tranvese all elements (consider ec resize) to locate elements. + + + for (var i = elOptions.length - 1; i >= 0; i--) { + var elOption = elOptions[i]; + var id = convertOptionIdName(elOption.id, null); + var el = id != null ? elMap.get(id) : null; + + if (!el) { + continue; + } + + var parentEl = el.parent; + var parentElInner = inner$e(parentEl); + var containerInfo = parentEl === rootGroup ? { + width: apiWidth, + height: apiHeight + } : { + width: parentElInner.width, + height: parentElInner.height + }; // PENDING + // Currently, when `bounding: 'all'`, the union bounding rect of the group + // does not include the rect of [0, 0, group.width, group.height], which + // is probably weird for users. Should we make a break change for it? + + var layoutPos = {}; + var layouted = positionElement(el, elOption, containerInfo, null, { + hv: elOption.hv, + boundingMode: elOption.bounding + }, layoutPos); + + if (!inner$e(el).isNew && layouted) { + var transition = elOption.transition; + var animatePos = {}; - if (!el) { - continue; - } + for (var k = 0; k < xy.length; k++) { + var key = xy[k]; + var val = layoutPos[key]; - var parentEl = el.parent; - var parentElInner = inner$e(parentEl); - var containerInfo = parentEl === rootGroup ? { - width: apiWidth, - height: apiHeight - } : { - width: parentElInner.width, - height: parentElInner.height - }; // PENDING - // Currently, when `bounding: 'all'`, the union bounding rect of the group - // does not include the rect of [0, 0, group.width, group.height], which - // is probably weird for users. Should we make a break change for it? - - var layoutPos = {}; - var layouted = positionElement(el, elOption, containerInfo, null, { - hv: elOption.hv, - boundingMode: elOption.bounding - }, layoutPos); - - if (!inner$e(el).isNew && layouted) { - var transition = elOption.transition; - var animatePos = {}; - - for (var k = 0; k < xy.length; k++) { - var key = xy[k]; - var val = layoutPos[key]; - - if (transition && (isTransitionAll(transition) || indexOf(transition, key) >= 0)) { - animatePos[key] = val; - } else { - el[key] = val; - } - } + if (transition && (isTransitionAll(transition) || indexOf(transition, key) >= 0)) { + animatePos[key] = val; + } else { + el[key] = val; + } + } - updateProps(el, animatePos, graphicModel, 0); - } else { - el.attr(layoutPos); - } - } - }; - /** - * Clear all elements. - */ + updateProps(el, animatePos, graphicModel, 0); + } else { + el.attr(layoutPos); + } + } + }; + /** + * Clear all elements. + */ - GraphicComponentView.prototype._clear = function () { - var _this = this; + GraphicComponentView.prototype._clear = function () { + var _this = this; - var elMap = this._elMap; - elMap.each(function (el) { - removeEl(el, inner$e(el).option, elMap, _this._lastGraphicModel); - }); - this._elMap = createHashMap(); - }; + var elMap = this._elMap; + elMap.each(function (el) { + removeEl(el, inner$e(el).option, elMap, _this._lastGraphicModel); + }); + this._elMap = createHashMap(); + }; - GraphicComponentView.prototype.dispose = function () { - this._clear(); - }; + GraphicComponentView.prototype.dispose = function () { + this._clear(); + }; - GraphicComponentView.type = 'graphic'; - return GraphicComponentView; - }(ComponentView); + GraphicComponentView.type = 'graphic'; + return GraphicComponentView; + }(ComponentView); function newEl(graphicType) { - if ("development" !== 'production') { - assert(graphicType, 'graphic type MUST be set'); - } + if ("development" !== 'production') { + assert(graphicType, 'graphic type MUST be set'); + } - var Clz = hasOwn(nonShapeGraphicElements, graphicType) // Those graphic elements are not shapes. They should not be - // overwritten by users, so do them first. - ? nonShapeGraphicElements[graphicType] : getShapeClass(graphicType); + var Clz = hasOwn(nonShapeGraphicElements, graphicType) // Those graphic elements are not shapes. They should not be + // overwritten by users, so do them first. + ? nonShapeGraphicElements[graphicType] : getShapeClass(graphicType); - if ("development" !== 'production') { - assert(Clz, "graphic type " + graphicType + " can not be found"); - } + if ("development" !== 'production') { + assert(Clz, "graphic type " + graphicType + " can not be found"); + } - var el = new Clz({}); - inner$e(el).type = graphicType; - return el; + var el = new Clz({}); + inner$e(el).type = graphicType; + return el; } function createEl$1(id, targetElParent, graphicType, elMap) { - var el = newEl(graphicType); - targetElParent.add(el); - elMap.set(id, el); - inner$e(el).id = id; - inner$e(el).isNew = true; - return el; + var el = newEl(graphicType); + targetElParent.add(el); + elMap.set(id, el); + inner$e(el).id = id; + inner$e(el).isNew = true; + return el; } function removeEl(elExisting, elOption, elMap, graphicModel) { - var existElParent = elExisting && elExisting.parent; + var existElParent = elExisting && elExisting.parent; - if (existElParent) { - elExisting.type === 'group' && elExisting.traverse(function (el) { - removeEl(el, elOption, elMap, graphicModel); - }); - applyLeaveTransition(elExisting, elOption, graphicModel); - elMap.removeKey(inner$e(elExisting).id); - } + if (existElParent) { + elExisting.type === 'group' && elExisting.traverse(function (el) { + removeEl(el, elOption, elMap, graphicModel); + }); + applyLeaveTransition(elExisting, elOption, graphicModel); + elMap.removeKey(inner$e(elExisting).id); + } } function updateCommonAttrs(el, elOption, defaultZ, defaultZlevel) { - if (!el.isGroup) { - var elDisplayable = el; - elDisplayable.cursor = retrieve2(elOption.cursor, Displayable.prototype.cursor); // We should not support configure z and zlevel in the element level. - // But seems we didn't limit it previously. So here still use it to avoid breaking. + if (!el.isGroup) { + var elDisplayable = el; + elDisplayable.cursor = retrieve2(elOption.cursor, Displayable.prototype.cursor); // We should not support configure z and zlevel in the element level. + // But seems we didn't limit it previously. So here still use it to avoid breaking. - elDisplayable.z = retrieve2(elOption.z, defaultZ || 0); - elDisplayable.zlevel = retrieve2(elOption.zlevel, defaultZlevel || 0); // z2 must not be null/undefined, otherwise sort error may occur. + elDisplayable.z = retrieve2(elOption.z, defaultZ || 0); + elDisplayable.zlevel = retrieve2(elOption.zlevel, defaultZlevel || 0); // z2 must not be null/undefined, otherwise sort error may occur. - var optZ2 = elOption.z2; - optZ2 != null && (elDisplayable.z2 = optZ2 || 0); - } + var optZ2 = elOption.z2; + optZ2 != null && (elDisplayable.z2 = optZ2 || 0); + } - each(keys(elOption), function (key) { - var val = elOption[key]; // Assign event handlers. - // PENDING: should enumerate all event names or use pattern matching? + each(keys(elOption), function (key) { + var val = elOption[key]; // Assign event handlers. + // PENDING: should enumerate all event names or use pattern matching? - if (key.indexOf('on') === 0 && isFunction(val)) { - el[key] = val; - } - }); - el.draggable = elOption.draggable; // Other attributes + if (key.indexOf('on') === 0 && isFunction(val)) { + el[key] = val; + } + }); + el.draggable = elOption.draggable; // Other attributes - elOption.name != null && (el.name = elOption.name); - elOption.id != null && (el.id = elOption.id); + elOption.name != null && (el.name = elOption.name); + elOption.id != null && (el.id = elOption.id); } // Remove unnecessary props to avoid potential problems. function getCleanedElOption(elOption) { - elOption = extend({}, elOption); - each(['id', 'parentId', '$action', 'hv', 'bounding', 'textContent', 'clipPath'].concat(LOCATION_PARAMS), function (name) { - delete elOption[name]; - }); - return elOption; + elOption = extend({}, elOption); + each(['id', 'parentId', '$action', 'hv', 'bounding', 'textContent', 'clipPath'].concat(LOCATION_PARAMS), function (name) { + delete elOption[name]; + }); + return elOption; } function setEventData(el, graphicModel, elOption) { - var eventData = getECData(el).eventData; // Simple optimize for large amount of elements that no need event. + var eventData = getECData(el).eventData; // Simple optimize for large amount of elements that no need event. - if (!el.silent && !el.ignore && !eventData) { - eventData = getECData(el).eventData = { - componentType: 'graphic', - componentIndex: graphicModel.componentIndex, - name: el.name - }; - } // `elOption.info` enables user to mount some info on - // elements and use them in event handlers. + if (!el.silent && !el.ignore && !eventData) { + eventData = getECData(el).eventData = { + componentType: 'graphic', + componentIndex: graphicModel.componentIndex, + name: el.name + }; + } // `elOption.info` enables user to mount some info on + // elements and use them in event handlers. - if (eventData) { - eventData.info = elOption.info; - } + if (eventData) { + eventData.info = elOption.info; + } } function install$x(registers) { - registers.registerComponentModel(GraphicComponentModel); - registers.registerComponentView(GraphicComponentView); - registers.registerPreprocessor(function (option) { - var graphicOption = option.graphic; // Convert - // {graphic: [{left: 10, type: 'circle'}, ...]} - // or - // {graphic: {left: 10, type: 'circle'}} - // to - // {graphic: [{elements: [{left: 10, type: 'circle'}, ...]}]} - - if (isArray(graphicOption)) { - if (!graphicOption[0] || !graphicOption[0].elements) { - option.graphic = [{ - elements: graphicOption - }]; - } else { - // Only one graphic instance can be instantiated. (We dont - // want that too many views are created in echarts._viewMap) - option.graphic = [option.graphic[0]]; - } - } else if (graphicOption && !graphicOption.elements) { - option.graphic = [{ - elements: [graphicOption] - }]; - } - }); + registers.registerComponentModel(GraphicComponentModel); + registers.registerComponentView(GraphicComponentView); + registers.registerPreprocessor(function (option) { + var graphicOption = option.graphic; // Convert + // {graphic: [{left: 10, type: 'circle'}, ...]} + // or + // {graphic: {left: 10, type: 'circle'}} + // to + // {graphic: [{elements: [{left: 10, type: 'circle'}, ...]}]} + + if (isArray(graphicOption)) { + if (!graphicOption[0] || !graphicOption[0].elements) { + option.graphic = [{ + elements: graphicOption + }]; + } else { + // Only one graphic instance can be instantiated. (We dont + // want that too many views are created in echarts._viewMap) + option.graphic = [option.graphic[0]]; + } + } else if (graphicOption && !graphicOption.elements) { + option.graphic = [{ + elements: [graphicOption] + }]; + } + }); } var DATA_ZOOM_AXIS_DIMENSIONS = ['x', 'y', 'radius', 'angle', 'single']; // Supported coords. @@ -78773,15 +78773,15 @@ var SERIES_COORDS = ['cartesian2d', 'polar', 'singleAxis']; function isCoordSupported(seriesModel) { - var coordType = seriesModel.get('coordinateSystem'); - return indexOf(SERIES_COORDS, coordType) >= 0; + var coordType = seriesModel.get('coordinateSystem'); + return indexOf(SERIES_COORDS, coordType) >= 0; } function getAxisMainType(axisDim) { - if ("development" !== 'production') { - assert(axisDim); - } + if ("development" !== 'production') { + assert(axisDim); + } - return axisDim + 'Axis'; + return axisDim + 'Axis'; } /** * If two dataZoomModels has the same axis controlled, we say that they are 'linked'. @@ -78789,61 +78789,61 @@ */ function findEffectedDataZooms(ecModel, payload) { - // Key: `DataZoomAxisDimension` - var axisRecords = createHashMap(); - var effectedModels = []; // Key: uid of dataZoomModel + // Key: `DataZoomAxisDimension` + var axisRecords = createHashMap(); + var effectedModels = []; // Key: uid of dataZoomModel - var effectedModelMap = createHashMap(); // Find the dataZooms specified by payload. + var effectedModelMap = createHashMap(); // Find the dataZooms specified by payload. - ecModel.eachComponent({ - mainType: 'dataZoom', - query: payload - }, function (dataZoomModel) { - if (!effectedModelMap.get(dataZoomModel.uid)) { - addToEffected(dataZoomModel); - } - }); // Start from the given dataZoomModels, travel the graph to find - // all of the linked dataZoom models. + ecModel.eachComponent({ + mainType: 'dataZoom', + query: payload + }, function (dataZoomModel) { + if (!effectedModelMap.get(dataZoomModel.uid)) { + addToEffected(dataZoomModel); + } + }); // Start from the given dataZoomModels, travel the graph to find + // all of the linked dataZoom models. - var foundNewLink; + var foundNewLink; - do { - foundNewLink = false; - ecModel.eachComponent('dataZoom', processSingle); - } while (foundNewLink); + do { + foundNewLink = false; + ecModel.eachComponent('dataZoom', processSingle); + } while (foundNewLink); - function processSingle(dataZoomModel) { - if (!effectedModelMap.get(dataZoomModel.uid) && isLinked(dataZoomModel)) { - addToEffected(dataZoomModel); - foundNewLink = true; - } + function processSingle(dataZoomModel) { + if (!effectedModelMap.get(dataZoomModel.uid) && isLinked(dataZoomModel)) { + addToEffected(dataZoomModel); + foundNewLink = true; } + } - function addToEffected(dataZoom) { - effectedModelMap.set(dataZoom.uid, true); - effectedModels.push(dataZoom); - markAxisControlled(dataZoom); - } + function addToEffected(dataZoom) { + effectedModelMap.set(dataZoom.uid, true); + effectedModels.push(dataZoom); + markAxisControlled(dataZoom); + } - function isLinked(dataZoomModel) { - var isLink = false; - dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { - var axisIdxArr = axisRecords.get(axisDim); + function isLinked(dataZoomModel) { + var isLink = false; + dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { + var axisIdxArr = axisRecords.get(axisDim); - if (axisIdxArr && axisIdxArr[axisIndex]) { - isLink = true; - } - }); - return isLink; - } + if (axisIdxArr && axisIdxArr[axisIndex]) { + isLink = true; + } + }); + return isLink; + } - function markAxisControlled(dataZoomModel) { - dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { - (axisRecords.get(axisDim) || axisRecords.set(axisDim, []))[axisIndex] = true; - }); - } + function markAxisControlled(dataZoomModel) { + dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { + (axisRecords.get(axisDim) || axisRecords.set(axisDim, []))[axisIndex] = true; + }); + } - return effectedModels; + return effectedModels; } /** * Find the first target coordinate system. @@ -78866,483 +78866,483 @@ */ function collectReferCoordSysModelInfo(dataZoomModel) { - var ecModel = dataZoomModel.ecModel; - var coordSysInfoWrap = { - infoList: [], - infoMap: createHashMap() - }; - dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { - var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex); + var ecModel = dataZoomModel.ecModel; + var coordSysInfoWrap = { + infoList: [], + infoMap: createHashMap() + }; + dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { + var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex); - if (!axisModel) { - return; - } + if (!axisModel) { + return; + } - var coordSysModel = axisModel.getCoordSysModel(); + var coordSysModel = axisModel.getCoordSysModel(); - if (!coordSysModel) { - return; - } + if (!coordSysModel) { + return; + } - var coordSysUid = coordSysModel.uid; - var coordSysInfo = coordSysInfoWrap.infoMap.get(coordSysUid); + var coordSysUid = coordSysModel.uid; + var coordSysInfo = coordSysInfoWrap.infoMap.get(coordSysUid); - if (!coordSysInfo) { - coordSysInfo = { - model: coordSysModel, - axisModels: [] - }; - coordSysInfoWrap.infoList.push(coordSysInfo); - coordSysInfoWrap.infoMap.set(coordSysUid, coordSysInfo); - } + if (!coordSysInfo) { + coordSysInfo = { + model: coordSysModel, + axisModels: [] + }; + coordSysInfoWrap.infoList.push(coordSysInfo); + coordSysInfoWrap.infoMap.set(coordSysUid, coordSysInfo); + } - coordSysInfo.axisModels.push(axisModel); - }); - return coordSysInfoWrap; + coordSysInfo.axisModels.push(axisModel); + }); + return coordSysInfoWrap; } var DataZoomAxisInfo = - /** @class */ - function () { - function DataZoomAxisInfo() { - this.indexList = []; - this.indexMap = []; - } - - DataZoomAxisInfo.prototype.add = function (axisCmptIdx) { - // Remove duplication. - if (!this.indexMap[axisCmptIdx]) { - this.indexList.push(axisCmptIdx); - this.indexMap[axisCmptIdx] = true; - } - }; - - return DataZoomAxisInfo; - }(); + /** @class */ + function () { + function DataZoomAxisInfo() { + this.indexList = []; + this.indexMap = []; + } + + DataZoomAxisInfo.prototype.add = function (axisCmptIdx) { + // Remove duplication. + if (!this.indexMap[axisCmptIdx]) { + this.indexList.push(axisCmptIdx); + this.indexMap[axisCmptIdx] = true; + } + }; + + return DataZoomAxisInfo; + }(); var DataZoomModel = - /** @class */ - function (_super) { - __extends(DataZoomModel, _super); - - function DataZoomModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = DataZoomModel.type; - _this._autoThrottle = true; - _this._noTarget = true; - /** - * It is `[rangeModeForMin, rangeModeForMax]`. - * The optional values for `rangeMode`: - * + `'value'` mode: the axis extent will always be determined by - * `dataZoom.startValue` and `dataZoom.endValue`, despite - * how data like and how `axis.min` and `axis.max` are. - * + `'percent'` mode: `100` represents 100% of the `[dMin, dMax]`, - * where `dMin` is `axis.min` if `axis.min` specified, otherwise `data.extent[0]`, - * and `dMax` is `axis.max` if `axis.max` specified, otherwise `data.extent[1]`. - * Axis extent will be determined by the result of the percent of `[dMin, dMax]`. - * - * For example, when users are using dynamic data (update data periodically via `setOption`), - * if in `'value`' mode, the window will be kept in a fixed value range despite how - * data are appended, while if in `'percent'` mode, whe window range will be changed alone with - * the appended data (suppose `axis.min` and `axis.max` are not specified). - */ - - _this._rangePropMode = ['percent', 'percent']; - return _this; - } - - DataZoomModel.prototype.init = function (option, parentModel, ecModel) { - var inputRawOption = retrieveRawOption(option); - /** - * Suppose a "main process" start at the point that model prepared (that is, - * model initialized or merged or method called in `action`). - * We should keep the `main process` idempotent, that is, given a set of values - * on `option`, we get the same result. - * - * But sometimes, values on `option` will be updated for providing users - * a "final calculated value" (`dataZoomProcessor` will do that). Those value - * should not be the base/input of the `main process`. - * - * So in that case we should save and keep the input of the `main process` - * separately, called `settledOption`. - * - * For example, consider the case: - * (Step_1) brush zoom the grid by `toolbox.dataZoom`, - * where the original input `option.startValue`, `option.endValue` are earsed by - * calculated value. - * (Step)2) click the legend to hide and show a series, - * where the new range is calculated by the earsed `startValue` and `endValue`, - * which brings incorrect result. - */ - - this.settledOption = inputRawOption; - this.mergeDefaultAndTheme(option, ecModel); - - this._doInit(inputRawOption); - }; - - DataZoomModel.prototype.mergeOption = function (newOption) { - var inputRawOption = retrieveRawOption(newOption); //FIX #2591 - - merge(this.option, newOption, true); - merge(this.settledOption, inputRawOption, true); - - this._doInit(inputRawOption); - }; - - DataZoomModel.prototype._doInit = function (inputRawOption) { - var thisOption = this.option; + /** @class */ + function (_super) { + __extends(DataZoomModel, _super); - this._setDefaultThrottle(inputRawOption); + function DataZoomModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - this._updateRangeUse(inputRawOption); + _this.type = DataZoomModel.type; + _this._autoThrottle = true; + _this._noTarget = true; + /** + * It is `[rangeModeForMin, rangeModeForMax]`. + * The optional values for `rangeMode`: + * + `'value'` mode: the axis extent will always be determined by + * `dataZoom.startValue` and `dataZoom.endValue`, despite + * how data like and how `axis.min` and `axis.max` are. + * + `'percent'` mode: `100` represents 100% of the `[dMin, dMax]`, + * where `dMin` is `axis.min` if `axis.min` specified, otherwise `data.extent[0]`, + * and `dMax` is `axis.max` if `axis.max` specified, otherwise `data.extent[1]`. + * Axis extent will be determined by the result of the percent of `[dMin, dMax]`. + * + * For example, when users are using dynamic data (update data periodically via `setOption`), + * if in `'value`' mode, the window will be kept in a fixed value range despite how + * data are appended, while if in `'percent'` mode, whe window range will be changed alone with + * the appended data (suppose `axis.min` and `axis.max` are not specified). + */ - var settledOption = this.settledOption; - each([['start', 'startValue'], ['end', 'endValue']], function (names, index) { - // start/end has higher priority over startValue/endValue if they - // both set, but we should make chart.setOption({endValue: 1000}) - // effective, rather than chart.setOption({endValue: 1000, end: null}). - if (this._rangePropMode[index] === 'value') { - thisOption[names[0]] = settledOption[names[0]] = null; - } // Otherwise do nothing and use the merge result. + _this._rangePropMode = ['percent', 'percent']; + return _this; + } - }, this); + DataZoomModel.prototype.init = function (option, parentModel, ecModel) { + var inputRawOption = retrieveRawOption(option); + /** + * Suppose a "main process" start at the point that model prepared (that is, + * model initialized or merged or method called in `action`). + * We should keep the `main process` idempotent, that is, given a set of values + * on `option`, we get the same result. + * + * But sometimes, values on `option` will be updated for providing users + * a "final calculated value" (`dataZoomProcessor` will do that). Those value + * should not be the base/input of the `main process`. + * + * So in that case we should save and keep the input of the `main process` + * separately, called `settledOption`. + * + * For example, consider the case: + * (Step_1) brush zoom the grid by `toolbox.dataZoom`, + * where the original input `option.startValue`, `option.endValue` are earsed by + * calculated value. + * (Step)2) click the legend to hide and show a series, + * where the new range is calculated by the earsed `startValue` and `endValue`, + * which brings incorrect result. + */ - this._resetTarget(); - }; + this.settledOption = inputRawOption; + this.mergeDefaultAndTheme(option, ecModel); - DataZoomModel.prototype._resetTarget = function () { - var optionOrient = this.get('orient', true); - var targetAxisIndexMap = this._targetAxisInfoMap = createHashMap(); + this._doInit(inputRawOption); + }; - var hasAxisSpecified = this._fillSpecifiedTargetAxis(targetAxisIndexMap); + DataZoomModel.prototype.mergeOption = function (newOption) { + var inputRawOption = retrieveRawOption(newOption); //FIX #2591 - if (hasAxisSpecified) { - this._orient = optionOrient || this._makeAutoOrientByTargetAxis(); - } else { - this._orient = optionOrient || 'horizontal'; + merge(this.option, newOption, true); + merge(this.settledOption, inputRawOption, true); - this._fillAutoTargetAxisByOrient(targetAxisIndexMap, this._orient); - } + this._doInit(inputRawOption); + }; - this._noTarget = true; - targetAxisIndexMap.each(function (axisInfo) { - if (axisInfo.indexList.length) { - this._noTarget = false; - } - }, this); - }; + DataZoomModel.prototype._doInit = function (inputRawOption) { + var thisOption = this.option; - DataZoomModel.prototype._fillSpecifiedTargetAxis = function (targetAxisIndexMap) { - var hasAxisSpecified = false; - each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) { - var refering = this.getReferringComponents(getAxisMainType(axisDim), MULTIPLE_REFERRING); // When user set axisIndex as a empty array, we think that user specify axisIndex - // but do not want use auto mode. Because empty array may be encountered when - // some error occured. + this._setDefaultThrottle(inputRawOption); - if (!refering.specified) { - return; - } + this._updateRangeUse(inputRawOption); - hasAxisSpecified = true; - var axisInfo = new DataZoomAxisInfo(); - each(refering.models, function (axisModel) { - axisInfo.add(axisModel.componentIndex); - }); - targetAxisIndexMap.set(axisDim, axisInfo); - }, this); - return hasAxisSpecified; - }; + var settledOption = this.settledOption; + each([['start', 'startValue'], ['end', 'endValue']], function (names, index) { + // start/end has higher priority over startValue/endValue if they + // both set, but we should make chart.setOption({endValue: 1000}) + // effective, rather than chart.setOption({endValue: 1000, end: null}). + if (this._rangePropMode[index] === 'value') { + thisOption[names[0]] = settledOption[names[0]] = null; + } // Otherwise do nothing and use the merge result. - DataZoomModel.prototype._fillAutoTargetAxisByOrient = function (targetAxisIndexMap, orient) { - var ecModel = this.ecModel; - var needAuto = true; // Find axis that parallel to dataZoom as default. + }, this); - if (needAuto) { - var axisDim = orient === 'vertical' ? 'y' : 'x'; - var axisModels = ecModel.findComponents({ - mainType: axisDim + 'Axis' - }); - setParallelAxis(axisModels, axisDim); - } // Find axis that parallel to dataZoom as default. + this._resetTarget(); + }; + DataZoomModel.prototype._resetTarget = function () { + var optionOrient = this.get('orient', true); + var targetAxisIndexMap = this._targetAxisInfoMap = createHashMap(); - if (needAuto) { - var axisModels = ecModel.findComponents({ - mainType: 'singleAxis', - filter: function (axisModel) { - return axisModel.get('orient', true) === orient; - } - }); - setParallelAxis(axisModels, 'single'); - } + var hasAxisSpecified = this._fillSpecifiedTargetAxis(targetAxisIndexMap); - function setParallelAxis(axisModels, axisDim) { - // At least use the first parallel axis as the target axis. - var axisModel = axisModels[0]; + if (hasAxisSpecified) { + this._orient = optionOrient || this._makeAutoOrientByTargetAxis(); + } else { + this._orient = optionOrient || 'horizontal'; - if (!axisModel) { - return; - } + this._fillAutoTargetAxisByOrient(targetAxisIndexMap, this._orient); + } - var axisInfo = new DataZoomAxisInfo(); - axisInfo.add(axisModel.componentIndex); - targetAxisIndexMap.set(axisDim, axisInfo); - needAuto = false; // Find parallel axes in the same grid. + this._noTarget = true; + targetAxisIndexMap.each(function (axisInfo) { + if (axisInfo.indexList.length) { + this._noTarget = false; + } + }, this); + }; - if (axisDim === 'x' || axisDim === 'y') { - var gridModel_1 = axisModel.getReferringComponents('grid', SINGLE_REFERRING).models[0]; - gridModel_1 && each(axisModels, function (axModel) { - if (axisModel.componentIndex !== axModel.componentIndex && gridModel_1 === axModel.getReferringComponents('grid', SINGLE_REFERRING).models[0]) { - axisInfo.add(axModel.componentIndex); - } - }); - } - } + DataZoomModel.prototype._fillSpecifiedTargetAxis = function (targetAxisIndexMap) { + var hasAxisSpecified = false; + each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) { + var refering = this.getReferringComponents(getAxisMainType(axisDim), MULTIPLE_REFERRING); // When user set axisIndex as a empty array, we think that user specify axisIndex + // but do not want use auto mode. Because empty array may be encountered when + // some error occured. - if (needAuto) { - // If no parallel axis, find the first category axis as default. (Also consider polar). - each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) { - if (!needAuto) { - return; - } + if (!refering.specified) { + return; + } + + hasAxisSpecified = true; + var axisInfo = new DataZoomAxisInfo(); + each(refering.models, function (axisModel) { + axisInfo.add(axisModel.componentIndex); + }); + targetAxisIndexMap.set(axisDim, axisInfo); + }, this); + return hasAxisSpecified; + }; - var axisModels = ecModel.findComponents({ - mainType: getAxisMainType(axisDim), - filter: function (axisModel) { - return axisModel.get('type', true) === 'category'; - } - }); + DataZoomModel.prototype._fillAutoTargetAxisByOrient = function (targetAxisIndexMap, orient) { + var ecModel = this.ecModel; + var needAuto = true; // Find axis that parallel to dataZoom as default. - if (axisModels[0]) { - var axisInfo = new DataZoomAxisInfo(); - axisInfo.add(axisModels[0].componentIndex); - targetAxisIndexMap.set(axisDim, axisInfo); - needAuto = false; - } - }, this); - } - }; + if (needAuto) { + var axisDim = orient === 'vertical' ? 'y' : 'x'; + var axisModels = ecModel.findComponents({ + mainType: axisDim + 'Axis' + }); + setParallelAxis(axisModels, axisDim); + } // Find axis that parallel to dataZoom as default. - DataZoomModel.prototype._makeAutoOrientByTargetAxis = function () { - var dim; // Find the first axis - this.eachTargetAxis(function (axisDim) { - !dim && (dim = axisDim); - }, this); - return dim === 'y' ? 'vertical' : 'horizontal'; - }; + if (needAuto) { + var axisModels = ecModel.findComponents({ + mainType: 'singleAxis', + filter: function (axisModel) { + return axisModel.get('orient', true) === orient; + } + }); + setParallelAxis(axisModels, 'single'); + } - DataZoomModel.prototype._setDefaultThrottle = function (inputRawOption) { - // When first time user set throttle, auto throttle ends. - if (inputRawOption.hasOwnProperty('throttle')) { - this._autoThrottle = false; - } + function setParallelAxis(axisModels, axisDim) { + // At least use the first parallel axis as the target axis. + var axisModel = axisModels[0]; - if (this._autoThrottle) { - var globalOption = this.ecModel.option; - this.option.throttle = globalOption.animation && globalOption.animationDurationUpdate > 0 ? 100 : 20; - } - }; + if (!axisModel) { + return; + } + + var axisInfo = new DataZoomAxisInfo(); + axisInfo.add(axisModel.componentIndex); + targetAxisIndexMap.set(axisDim, axisInfo); + needAuto = false; // Find parallel axes in the same grid. + + if (axisDim === 'x' || axisDim === 'y') { + var gridModel_1 = axisModel.getReferringComponents('grid', SINGLE_REFERRING).models[0]; + gridModel_1 && each(axisModels, function (axModel) { + if (axisModel.componentIndex !== axModel.componentIndex && gridModel_1 === axModel.getReferringComponents('grid', SINGLE_REFERRING).models[0]) { + axisInfo.add(axModel.componentIndex); + } + }); + } + } - DataZoomModel.prototype._updateRangeUse = function (inputRawOption) { - var rangePropMode = this._rangePropMode; - var rangeModeInOption = this.get('rangeMode'); - each([['start', 'startValue'], ['end', 'endValue']], function (names, index) { - var percentSpecified = inputRawOption[names[0]] != null; - var valueSpecified = inputRawOption[names[1]] != null; - - if (percentSpecified && !valueSpecified) { - rangePropMode[index] = 'percent'; - } else if (!percentSpecified && valueSpecified) { - rangePropMode[index] = 'value'; - } else if (rangeModeInOption) { - rangePropMode[index] = rangeModeInOption[index]; - } else if (percentSpecified) { - // percentSpecified && valueSpecified - rangePropMode[index] = 'percent'; - } // else remain its original setting. + if (needAuto) { + // If no parallel axis, find the first category axis as default. (Also consider polar). + each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) { + if (!needAuto) { + return; + } - }); - }; + var axisModels = ecModel.findComponents({ + mainType: getAxisMainType(axisDim), + filter: function (axisModel) { + return axisModel.get('type', true) === 'category'; + } + }); - DataZoomModel.prototype.noTarget = function () { - return this._noTarget; - }; + if (axisModels[0]) { + var axisInfo = new DataZoomAxisInfo(); + axisInfo.add(axisModels[0].componentIndex); + targetAxisIndexMap.set(axisDim, axisInfo); + needAuto = false; + } + }, this); + } + }; - DataZoomModel.prototype.getFirstTargetAxisModel = function () { - var firstAxisModel; - this.eachTargetAxis(function (axisDim, axisIndex) { - if (firstAxisModel == null) { - firstAxisModel = this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex); - } - }, this); - return firstAxisModel; - }; - /** - * @param {Function} callback param: axisModel, dimNames, axisIndex, dataZoomModel, ecModel - */ + DataZoomModel.prototype._makeAutoOrientByTargetAxis = function () { + var dim; // Find the first axis + this.eachTargetAxis(function (axisDim) { + !dim && (dim = axisDim); + }, this); + return dim === 'y' ? 'vertical' : 'horizontal'; + }; + + DataZoomModel.prototype._setDefaultThrottle = function (inputRawOption) { + // When first time user set throttle, auto throttle ends. + if (inputRawOption.hasOwnProperty('throttle')) { + this._autoThrottle = false; + } + + if (this._autoThrottle) { + var globalOption = this.ecModel.option; + this.option.throttle = globalOption.animation && globalOption.animationDurationUpdate > 0 ? 100 : 20; + } + }; + + DataZoomModel.prototype._updateRangeUse = function (inputRawOption) { + var rangePropMode = this._rangePropMode; + var rangeModeInOption = this.get('rangeMode'); + each([['start', 'startValue'], ['end', 'endValue']], function (names, index) { + var percentSpecified = inputRawOption[names[0]] != null; + var valueSpecified = inputRawOption[names[1]] != null; + + if (percentSpecified && !valueSpecified) { + rangePropMode[index] = 'percent'; + } else if (!percentSpecified && valueSpecified) { + rangePropMode[index] = 'value'; + } else if (rangeModeInOption) { + rangePropMode[index] = rangeModeInOption[index]; + } else if (percentSpecified) { + // percentSpecified && valueSpecified + rangePropMode[index] = 'percent'; + } // else remain its original setting. - DataZoomModel.prototype.eachTargetAxis = function (callback, context) { - this._targetAxisInfoMap.each(function (axisInfo, axisDim) { - each(axisInfo.indexList, function (axisIndex) { - callback.call(context, axisDim, axisIndex); - }); - }); - }; - /** - * @return If not found, return null/undefined. - */ + }); + }; + + DataZoomModel.prototype.noTarget = function () { + return this._noTarget; + }; + + DataZoomModel.prototype.getFirstTargetAxisModel = function () { + var firstAxisModel; + this.eachTargetAxis(function (axisDim, axisIndex) { + if (firstAxisModel == null) { + firstAxisModel = this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex); + } + }, this); + return firstAxisModel; + }; + /** + * @param {Function} callback param: axisModel, dimNames, axisIndex, dataZoomModel, ecModel + */ - DataZoomModel.prototype.getAxisProxy = function (axisDim, axisIndex) { - var axisModel = this.getAxisModel(axisDim, axisIndex); + DataZoomModel.prototype.eachTargetAxis = function (callback, context) { + this._targetAxisInfoMap.each(function (axisInfo, axisDim) { + each(axisInfo.indexList, function (axisIndex) { + callback.call(context, axisDim, axisIndex); + }); + }); + }; + /** + * @return If not found, return null/undefined. + */ - if (axisModel) { - return axisModel.__dzAxisProxy; - } - }; - /** - * @return If not found, return null/undefined. - */ + DataZoomModel.prototype.getAxisProxy = function (axisDim, axisIndex) { + var axisModel = this.getAxisModel(axisDim, axisIndex); - DataZoomModel.prototype.getAxisModel = function (axisDim, axisIndex) { - if ("development" !== 'production') { - assert(axisDim && axisIndex != null); - } + if (axisModel) { + return axisModel.__dzAxisProxy; + } + }; + /** + * @return If not found, return null/undefined. + */ - var axisInfo = this._targetAxisInfoMap.get(axisDim); - if (axisInfo && axisInfo.indexMap[axisIndex]) { - return this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex); - } - }; - /** - * If not specified, set to undefined. - */ + DataZoomModel.prototype.getAxisModel = function (axisDim, axisIndex) { + if ("development" !== 'production') { + assert(axisDim && axisIndex != null); + } + var axisInfo = this._targetAxisInfoMap.get(axisDim); - DataZoomModel.prototype.setRawRange = function (opt) { - var thisOption = this.option; - var settledOption = this.settledOption; - each([['start', 'startValue'], ['end', 'endValue']], function (names) { - // Consider the pair : - // If one has value and the other one is `null/undefined`, we both set them - // to `settledOption`. This strategy enables the feature to clear the original - // value in `settledOption` to `null/undefined`. - // But if both of them are `null/undefined`, we do not set them to `settledOption` - // and keep `settledOption` with the original value. This strategy enables users to - // only set but not set when calling - // `dispatchAction`. - // The pair is treated in the same way. - if (opt[names[0]] != null || opt[names[1]] != null) { - thisOption[names[0]] = settledOption[names[0]] = opt[names[0]]; - thisOption[names[1]] = settledOption[names[1]] = opt[names[1]]; - } - }, this); + if (axisInfo && axisInfo.indexMap[axisIndex]) { + return this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex); + } + }; + /** + * If not specified, set to undefined. + */ - this._updateRangeUse(opt); - }; - DataZoomModel.prototype.setCalculatedRange = function (opt) { - var option = this.option; - each(['start', 'startValue', 'end', 'endValue'], function (name) { - option[name] = opt[name]; - }); - }; + DataZoomModel.prototype.setRawRange = function (opt) { + var thisOption = this.option; + var settledOption = this.settledOption; + each([['start', 'startValue'], ['end', 'endValue']], function (names) { + // Consider the pair : + // If one has value and the other one is `null/undefined`, we both set them + // to `settledOption`. This strategy enables the feature to clear the original + // value in `settledOption` to `null/undefined`. + // But if both of them are `null/undefined`, we do not set them to `settledOption` + // and keep `settledOption` with the original value. This strategy enables users to + // only set but not set when calling + // `dispatchAction`. + // The pair is treated in the same way. + if (opt[names[0]] != null || opt[names[1]] != null) { + thisOption[names[0]] = settledOption[names[0]] = opt[names[0]]; + thisOption[names[1]] = settledOption[names[1]] = opt[names[1]]; + } + }, this); - DataZoomModel.prototype.getPercentRange = function () { - var axisProxy = this.findRepresentativeAxisProxy(); + this._updateRangeUse(opt); + }; - if (axisProxy) { - return axisProxy.getDataPercentWindow(); - } - }; - /** - * For example, chart.getModel().getComponent('dataZoom').getValueRange('y', 0); - * - * @return [startValue, endValue] value can only be '-' or finite number. - */ + DataZoomModel.prototype.setCalculatedRange = function (opt) { + var option = this.option; + each(['start', 'startValue', 'end', 'endValue'], function (name) { + option[name] = opt[name]; + }); + }; + DataZoomModel.prototype.getPercentRange = function () { + var axisProxy = this.findRepresentativeAxisProxy(); - DataZoomModel.prototype.getValueRange = function (axisDim, axisIndex) { - if (axisDim == null && axisIndex == null) { - var axisProxy = this.findRepresentativeAxisProxy(); + if (axisProxy) { + return axisProxy.getDataPercentWindow(); + } + }; + /** + * For example, chart.getModel().getComponent('dataZoom').getValueRange('y', 0); + * + * @return [startValue, endValue] value can only be '-' or finite number. + */ - if (axisProxy) { - return axisProxy.getDataValueWindow(); - } - } else { - return this.getAxisProxy(axisDim, axisIndex).getDataValueWindow(); - } - }; - /** - * @param axisModel If axisModel given, find axisProxy - * corresponding to the axisModel - */ + DataZoomModel.prototype.getValueRange = function (axisDim, axisIndex) { + if (axisDim == null && axisIndex == null) { + var axisProxy = this.findRepresentativeAxisProxy(); - DataZoomModel.prototype.findRepresentativeAxisProxy = function (axisModel) { - if (axisModel) { - return axisModel.__dzAxisProxy; - } // Find the first hosted axisProxy + if (axisProxy) { + return axisProxy.getDataValueWindow(); + } + } else { + return this.getAxisProxy(axisDim, axisIndex).getDataValueWindow(); + } + }; + /** + * @param axisModel If axisModel given, find axisProxy + * corresponding to the axisModel + */ - var firstProxy; + DataZoomModel.prototype.findRepresentativeAxisProxy = function (axisModel) { + if (axisModel) { + return axisModel.__dzAxisProxy; + } // Find the first hosted axisProxy - var axisDimList = this._targetAxisInfoMap.keys(); - for (var i = 0; i < axisDimList.length; i++) { - var axisDim = axisDimList[i]; + var firstProxy; - var axisInfo = this._targetAxisInfoMap.get(axisDim); + var axisDimList = this._targetAxisInfoMap.keys(); - for (var j = 0; j < axisInfo.indexList.length; j++) { - var proxy = this.getAxisProxy(axisDim, axisInfo.indexList[j]); + for (var i = 0; i < axisDimList.length; i++) { + var axisDim = axisDimList[i]; - if (proxy.hostedBy(this)) { - return proxy; - } + var axisInfo = this._targetAxisInfoMap.get(axisDim); - if (!firstProxy) { - firstProxy = proxy; - } - } - } // If no hosted proxy found, still need to return a proxy. - // This case always happens in toolbox dataZoom, where axes are all hosted by - // other dataZooms. + for (var j = 0; j < axisInfo.indexList.length; j++) { + var proxy = this.getAxisProxy(axisDim, axisInfo.indexList[j]); + if (proxy.hostedBy(this)) { + return proxy; + } - return firstProxy; - }; + if (!firstProxy) { + firstProxy = proxy; + } + } + } // If no hosted proxy found, still need to return a proxy. + // This case always happens in toolbox dataZoom, where axes are all hosted by + // other dataZooms. - DataZoomModel.prototype.getRangePropMode = function () { - return this._rangePropMode.slice(); - }; - DataZoomModel.prototype.getOrient = function () { - if ("development" !== 'production') { - // Should not be called before initialized. - assert(this._orient); - } + return firstProxy; + }; - return this._orient; - }; + DataZoomModel.prototype.getRangePropMode = function () { + return this._rangePropMode.slice(); + }; - DataZoomModel.type = 'dataZoom'; - DataZoomModel.dependencies = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'series', 'toolbox']; - DataZoomModel.defaultOption = { - // zlevel: 0, - z: 4, - filterMode: 'filter', - start: 0, - end: 100 - }; - return DataZoomModel; - }(ComponentModel); + DataZoomModel.prototype.getOrient = function () { + if ("development" !== 'production') { + // Should not be called before initialized. + assert(this._orient); + } + + return this._orient; + }; + + DataZoomModel.type = 'dataZoom'; + DataZoomModel.dependencies = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'series', 'toolbox']; + DataZoomModel.defaultOption = { + // zlevel: 0, + z: 4, + filterMode: 'filter', + start: 0, + end: 100 + }; + return DataZoomModel; + }(ComponentModel); /** * Retrieve the those raw params from option, which will be cached separately. * becasue they will be overwritten by normalized/calculated values in the main @@ -79351,66 +79351,66 @@ function retrieveRawOption(option) { - var ret = {}; - each(['start', 'end', 'startValue', 'endValue', 'throttle'], function (name) { - option.hasOwnProperty(name) && (ret[name] = option[name]); - }); - return ret; + var ret = {}; + each(['start', 'end', 'startValue', 'endValue', 'throttle'], function (name) { + option.hasOwnProperty(name) && (ret[name] = option[name]); + }); + return ret; } var SelectDataZoomModel = - /** @class */ - function (_super) { - __extends(SelectDataZoomModel, _super); + /** @class */ + function (_super) { + __extends(SelectDataZoomModel, _super); - function SelectDataZoomModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function SelectDataZoomModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SelectDataZoomModel.type; - return _this; - } + _this.type = SelectDataZoomModel.type; + return _this; + } - SelectDataZoomModel.type = 'dataZoom.select'; - return SelectDataZoomModel; - }(DataZoomModel); + SelectDataZoomModel.type = 'dataZoom.select'; + return SelectDataZoomModel; + }(DataZoomModel); var DataZoomView = - /** @class */ - function (_super) { - __extends(DataZoomView, _super); + /** @class */ + function (_super) { + __extends(DataZoomView, _super); - function DataZoomView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function DataZoomView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = DataZoomView.type; - return _this; - } + _this.type = DataZoomView.type; + return _this; + } - DataZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) { - this.dataZoomModel = dataZoomModel; - this.ecModel = ecModel; - this.api = api; - }; + DataZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) { + this.dataZoomModel = dataZoomModel; + this.ecModel = ecModel; + this.api = api; + }; - DataZoomView.type = 'dataZoom'; - return DataZoomView; - }(ComponentView); + DataZoomView.type = 'dataZoom'; + return DataZoomView; + }(ComponentView); var SelectDataZoomView = - /** @class */ - function (_super) { - __extends(SelectDataZoomView, _super); + /** @class */ + function (_super) { + __extends(SelectDataZoomView, _super); - function SelectDataZoomView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function SelectDataZoomView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SelectDataZoomView.type; - return _this; - } + _this.type = SelectDataZoomView.type; + return _this; + } - SelectDataZoomView.type = 'dataZoom.select'; - return SelectDataZoomView; - }(DataZoomView); + SelectDataZoomView.type = 'dataZoom.select'; + return SelectDataZoomView; + }(DataZoomView); var each$8 = each; var asc$1 = asc; @@ -79423,449 +79423,449 @@ */ var AxisProxy = - /** @class */ - function () { - function AxisProxy(dimName, axisIndex, dataZoomModel, ecModel) { - this._dimName = dimName; - this._axisIndex = axisIndex; - this.ecModel = ecModel; - this._dataZoomModel = dataZoomModel; // /** - // * @readOnly - // * @private - // */ - // this.hasSeriesStacked; - } - /** - * Whether the axisProxy is hosted by dataZoomModel. - */ + /** @class */ + function () { + function AxisProxy(dimName, axisIndex, dataZoomModel, ecModel) { + this._dimName = dimName; + this._axisIndex = axisIndex; + this.ecModel = ecModel; + this._dataZoomModel = dataZoomModel; // /** + // * @readOnly + // * @private + // */ + // this.hasSeriesStacked; + } + /** + * Whether the axisProxy is hosted by dataZoomModel. + */ - AxisProxy.prototype.hostedBy = function (dataZoomModel) { - return this._dataZoomModel === dataZoomModel; - }; - /** - * @return Value can only be NaN or finite value. - */ + AxisProxy.prototype.hostedBy = function (dataZoomModel) { + return this._dataZoomModel === dataZoomModel; + }; + /** + * @return Value can only be NaN or finite value. + */ - AxisProxy.prototype.getDataValueWindow = function () { - return this._valueWindow.slice(); - }; - /** - * @return {Array.} - */ + AxisProxy.prototype.getDataValueWindow = function () { + return this._valueWindow.slice(); + }; + /** + * @return {Array.} + */ - AxisProxy.prototype.getDataPercentWindow = function () { - return this._percentWindow.slice(); - }; + AxisProxy.prototype.getDataPercentWindow = function () { + return this._percentWindow.slice(); + }; - AxisProxy.prototype.getTargetSeriesModels = function () { - var seriesModels = []; - this.ecModel.eachSeries(function (seriesModel) { - if (isCoordSupported(seriesModel)) { - var axisMainType = getAxisMainType(this._dimName); - var axisModel = seriesModel.getReferringComponents(axisMainType, SINGLE_REFERRING).models[0]; + AxisProxy.prototype.getTargetSeriesModels = function () { + var seriesModels = []; + this.ecModel.eachSeries(function (seriesModel) { + if (isCoordSupported(seriesModel)) { + var axisMainType = getAxisMainType(this._dimName); + var axisModel = seriesModel.getReferringComponents(axisMainType, SINGLE_REFERRING).models[0]; - if (axisModel && this._axisIndex === axisModel.componentIndex) { - seriesModels.push(seriesModel); - } - } - }, this); - return seriesModels; - }; + if (axisModel && this._axisIndex === axisModel.componentIndex) { + seriesModels.push(seriesModel); + } + } + }, this); + return seriesModels; + }; - AxisProxy.prototype.getAxisModel = function () { - return this.ecModel.getComponent(this._dimName + 'Axis', this._axisIndex); - }; + AxisProxy.prototype.getAxisModel = function () { + return this.ecModel.getComponent(this._dimName + 'Axis', this._axisIndex); + }; - AxisProxy.prototype.getMinMaxSpan = function () { - return clone(this._minMaxSpan); - }; - /** - * Only calculate by given range and this._dataExtent, do not change anything. - */ + AxisProxy.prototype.getMinMaxSpan = function () { + return clone(this._minMaxSpan); + }; + /** + * Only calculate by given range and this._dataExtent, do not change anything. + */ - AxisProxy.prototype.calculateDataWindow = function (opt) { - var dataExtent = this._dataExtent; - var axisModel = this.getAxisModel(); - var scale = axisModel.axis.scale; - - var rangePropMode = this._dataZoomModel.getRangePropMode(); - - var percentExtent = [0, 100]; - var percentWindow = []; - var valueWindow = []; - var hasPropModeValue; - each$8(['start', 'end'], function (prop, idx) { - var boundPercent = opt[prop]; - var boundValue = opt[prop + 'Value']; // Notice: dataZoom is based either on `percentProp` ('start', 'end') or - // on `valueProp` ('startValue', 'endValue'). (They are based on the data extent - // but not min/max of axis, which will be calculated by data window then). - // The former one is suitable for cases that a dataZoom component controls multiple - // axes with different unit or extent, and the latter one is suitable for accurate - // zoom by pixel (e.g., in dataZoomSelect). - // we use `getRangePropMode()` to mark which prop is used. `rangePropMode` is updated - // only when setOption or dispatchAction, otherwise it remains its original value. - // (Why not only record `percentProp` and always map to `valueProp`? Because - // the map `valueProp` -> `percentProp` -> `valueProp` probably not the original - // `valueProp`. consider two axes constrolled by one dataZoom. They have different - // data extent. All of values that are overflow the `dataExtent` will be calculated - // to percent '100%'). - - if (rangePropMode[idx] === 'percent') { - boundPercent == null && (boundPercent = percentExtent[idx]); // Use scale.parse to math round for category or time axis. - - boundValue = scale.parse(linearMap(boundPercent, percentExtent, dataExtent)); - } else { - hasPropModeValue = true; - boundValue = boundValue == null ? dataExtent[idx] : scale.parse(boundValue); // Calculating `percent` from `value` may be not accurate, because - // This calculation can not be inversed, because all of values that - // are overflow the `dataExtent` will be calculated to percent '100%' + AxisProxy.prototype.calculateDataWindow = function (opt) { + var dataExtent = this._dataExtent; + var axisModel = this.getAxisModel(); + var scale = axisModel.axis.scale; + + var rangePropMode = this._dataZoomModel.getRangePropMode(); + + var percentExtent = [0, 100]; + var percentWindow = []; + var valueWindow = []; + var hasPropModeValue; + each$8(['start', 'end'], function (prop, idx) { + var boundPercent = opt[prop]; + var boundValue = opt[prop + 'Value']; // Notice: dataZoom is based either on `percentProp` ('start', 'end') or + // on `valueProp` ('startValue', 'endValue'). (They are based on the data extent + // but not min/max of axis, which will be calculated by data window then). + // The former one is suitable for cases that a dataZoom component controls multiple + // axes with different unit or extent, and the latter one is suitable for accurate + // zoom by pixel (e.g., in dataZoomSelect). + // we use `getRangePropMode()` to mark which prop is used. `rangePropMode` is updated + // only when setOption or dispatchAction, otherwise it remains its original value. + // (Why not only record `percentProp` and always map to `valueProp`? Because + // the map `valueProp` -> `percentProp` -> `valueProp` probably not the original + // `valueProp`. consider two axes constrolled by one dataZoom. They have different + // data extent. All of values that are overflow the `dataExtent` will be calculated + // to percent '100%'). + + if (rangePropMode[idx] === 'percent') { + boundPercent == null && (boundPercent = percentExtent[idx]); // Use scale.parse to math round for category or time axis. + + boundValue = scale.parse(linearMap(boundPercent, percentExtent, dataExtent)); + } else { + hasPropModeValue = true; + boundValue = boundValue == null ? dataExtent[idx] : scale.parse(boundValue); // Calculating `percent` from `value` may be not accurate, because + // This calculation can not be inversed, because all of values that + // are overflow the `dataExtent` will be calculated to percent '100%' + + boundPercent = linearMap(boundValue, dataExtent, percentExtent); + } // valueWindow[idx] = round(boundValue); + // percentWindow[idx] = round(boundPercent); + + + valueWindow[idx] = boundValue; + percentWindow[idx] = boundPercent; + }); + asc$1(valueWindow); + asc$1(percentWindow); // The windows from user calling of `dispatchAction` might be out of the extent, + // or do not obey the `min/maxSpan`, `min/maxValueSpan`. But we dont restrict window + // by `zoomLock` here, because we see `zoomLock` just as a interaction constraint, + // where API is able to initialize/modify the window size even though `zoomLock` + // specified. - boundPercent = linearMap(boundValue, dataExtent, percentExtent); - } // valueWindow[idx] = round(boundValue); - // percentWindow[idx] = round(boundPercent); + var spans = this._minMaxSpan; + hasPropModeValue ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false) : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true); + function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) { + var suffix = toValue ? 'Span' : 'ValueSpan'; + sliderMove(0, fromWindow, fromExtent, 'all', spans['min' + suffix], spans['max' + suffix]); - valueWindow[idx] = boundValue; - percentWindow[idx] = boundPercent; - }); - asc$1(valueWindow); - asc$1(percentWindow); // The windows from user calling of `dispatchAction` might be out of the extent, - // or do not obey the `min/maxSpan`, `min/maxValueSpan`. But we dont restrict window - // by `zoomLock` here, because we see `zoomLock` just as a interaction constraint, - // where API is able to initialize/modify the window size even though `zoomLock` - // specified. - - var spans = this._minMaxSpan; - hasPropModeValue ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false) : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true); - - function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) { - var suffix = toValue ? 'Span' : 'ValueSpan'; - sliderMove(0, fromWindow, fromExtent, 'all', spans['min' + suffix], spans['max' + suffix]); - - for (var i = 0; i < 2; i++) { - toWindow[i] = linearMap(fromWindow[i], fromExtent, toExtent, true); - toValue && (toWindow[i] = scale.parse(toWindow[i])); - } - } + for (var i = 0; i < 2; i++) { + toWindow[i] = linearMap(fromWindow[i], fromExtent, toExtent, true); + toValue && (toWindow[i] = scale.parse(toWindow[i])); + } + } - return { - valueWindow: valueWindow, - percentWindow: percentWindow - }; - }; - /** - * Notice: reset should not be called before series.restoreData() called, - * so it is recommanded to be called in "process stage" but not "model init - * stage". - */ + return { + valueWindow: valueWindow, + percentWindow: percentWindow + }; + }; + /** + * Notice: reset should not be called before series.restoreData() called, + * so it is recommanded to be called in "process stage" but not "model init + * stage". + */ - AxisProxy.prototype.reset = function (dataZoomModel) { - if (dataZoomModel !== this._dataZoomModel) { - return; - } + AxisProxy.prototype.reset = function (dataZoomModel) { + if (dataZoomModel !== this._dataZoomModel) { + return; + } - var targetSeries = this.getTargetSeriesModels(); // Culculate data window and data extent, and record them. + var targetSeries = this.getTargetSeriesModels(); // Culculate data window and data extent, and record them. - this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries); // `calculateDataWindow` uses min/maxSpan. + this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries); // `calculateDataWindow` uses min/maxSpan. - this._updateMinMaxSpan(); + this._updateMinMaxSpan(); - var dataWindow = this.calculateDataWindow(dataZoomModel.settledOption); - this._valueWindow = dataWindow.valueWindow; - this._percentWindow = dataWindow.percentWindow; // Update axis setting then. + var dataWindow = this.calculateDataWindow(dataZoomModel.settledOption); + this._valueWindow = dataWindow.valueWindow; + this._percentWindow = dataWindow.percentWindow; // Update axis setting then. - this._setAxisModel(); - }; + this._setAxisModel(); + }; - AxisProxy.prototype.filterData = function (dataZoomModel, api) { - if (dataZoomModel !== this._dataZoomModel) { - return; - } + AxisProxy.prototype.filterData = function (dataZoomModel, api) { + if (dataZoomModel !== this._dataZoomModel) { + return; + } - var axisDim = this._dimName; - var seriesModels = this.getTargetSeriesModels(); - var filterMode = dataZoomModel.get('filterMode'); - var valueWindow = this._valueWindow; + var axisDim = this._dimName; + var seriesModels = this.getTargetSeriesModels(); + var filterMode = dataZoomModel.get('filterMode'); + var valueWindow = this._valueWindow; - if (filterMode === 'none') { - return; - } // FIXME - // Toolbox may has dataZoom injected. And if there are stacked bar chart - // with NaN data, NaN will be filtered and stack will be wrong. - // So we need to force the mode to be set empty. - // In fect, it is not a big deal that do not support filterMode-'filter' - // when using toolbox#dataZoom, utill tooltip#dataZoom support "single axis - // selection" some day, which might need "adapt to data extent on the - // otherAxis", which is disabled by filterMode-'empty'. - // But currently, stack has been fixed to based on value but not index, - // so this is not an issue any more. - // let otherAxisModel = this.getOtherAxisModel(); - // if (dataZoomModel.get('$fromToolbox') - // && otherAxisModel - // && otherAxisModel.hasSeriesStacked - // ) { - // filterMode = 'empty'; - // } - // TODO - // filterMode 'weakFilter' and 'empty' is not optimized for huge data yet. - - - each$8(seriesModels, function (seriesModel) { - var seriesData = seriesModel.getData(); - var dataDims = seriesData.mapDimensionsAll(axisDim); - - if (!dataDims.length) { - return; - } + if (filterMode === 'none') { + return; + } // FIXME + // Toolbox may has dataZoom injected. And if there are stacked bar chart + // with NaN data, NaN will be filtered and stack will be wrong. + // So we need to force the mode to be set empty. + // In fect, it is not a big deal that do not support filterMode-'filter' + // when using toolbox#dataZoom, utill tooltip#dataZoom support "single axis + // selection" some day, which might need "adapt to data extent on the + // otherAxis", which is disabled by filterMode-'empty'. + // But currently, stack has been fixed to based on value but not index, + // so this is not an issue any more. + // let otherAxisModel = this.getOtherAxisModel(); + // if (dataZoomModel.get('$fromToolbox') + // && otherAxisModel + // && otherAxisModel.hasSeriesStacked + // ) { + // filterMode = 'empty'; + // } + // TODO + // filterMode 'weakFilter' and 'empty' is not optimized for huge data yet. - if (filterMode === 'weakFilter') { - var store_1 = seriesData.getStore(); - var dataDimIndices_1 = map(dataDims, function (dim) { - return seriesData.getDimensionIndex(dim); - }, seriesData); - seriesData.filterSelf(function (dataIndex) { - var leftOut; - var rightOut; - var hasValue; - - for (var i = 0; i < dataDims.length; i++) { - var value = store_1.get(dataDimIndices_1[i], dataIndex); - var thisHasValue = !isNaN(value); - var thisLeftOut = value < valueWindow[0]; - var thisRightOut = value > valueWindow[1]; - - if (thisHasValue && !thisLeftOut && !thisRightOut) { - return true; - } - thisHasValue && (hasValue = true); - thisLeftOut && (leftOut = true); - thisRightOut && (rightOut = true); - } // If both left out and right out, do not filter. + each$8(seriesModels, function (seriesModel) { + var seriesData = seriesModel.getData(); + var dataDims = seriesData.mapDimensionsAll(axisDim); + if (!dataDims.length) { + return; + } - return hasValue && leftOut && rightOut; - }); - } else { - each$8(dataDims, function (dim) { - if (filterMode === 'empty') { - seriesModel.setData(seriesData = seriesData.map(dim, function (value) { - return !isInWindow(value) ? NaN : value; - })); - } else { - var range = {}; - range[dim] = valueWindow; // console.time('select'); - - seriesData.selectRange(range); // console.timeEnd('select'); - } - }); - } + if (filterMode === 'weakFilter') { + var store_1 = seriesData.getStore(); + var dataDimIndices_1 = map(dataDims, function (dim) { + return seriesData.getDimensionIndex(dim); + }, seriesData); + seriesData.filterSelf(function (dataIndex) { + var leftOut; + var rightOut; + var hasValue; - each$8(dataDims, function (dim) { - seriesData.setApproximateExtent(valueWindow, dim); - }); - }); + for (var i = 0; i < dataDims.length; i++) { + var value = store_1.get(dataDimIndices_1[i], dataIndex); + var thisHasValue = !isNaN(value); + var thisLeftOut = value < valueWindow[0]; + var thisRightOut = value > valueWindow[1]; - function isInWindow(value) { - return value >= valueWindow[0] && value <= valueWindow[1]; + if (thisHasValue && !thisLeftOut && !thisRightOut) { + return true; } - }; - AxisProxy.prototype._updateMinMaxSpan = function () { - var minMaxSpan = this._minMaxSpan = {}; - var dataZoomModel = this._dataZoomModel; - var dataExtent = this._dataExtent; - each$8(['min', 'max'], function (minMax) { - var percentSpan = dataZoomModel.get(minMax + 'Span'); - var valueSpan = dataZoomModel.get(minMax + 'ValueSpan'); - valueSpan != null && (valueSpan = this.getAxisModel().axis.scale.parse(valueSpan)); // minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan - - if (valueSpan != null) { - percentSpan = linearMap(dataExtent[0] + valueSpan, dataExtent, [0, 100], true); - } else if (percentSpan != null) { - valueSpan = linearMap(percentSpan, [0, 100], dataExtent, true) - dataExtent[0]; - } + thisHasValue && (hasValue = true); + thisLeftOut && (leftOut = true); + thisRightOut && (rightOut = true); + } // If both left out and right out, do not filter. - minMaxSpan[minMax + 'Span'] = percentSpan; - minMaxSpan[minMax + 'ValueSpan'] = valueSpan; - }, this); - }; - AxisProxy.prototype._setAxisModel = function () { - var axisModel = this.getAxisModel(); - var percentWindow = this._percentWindow; - var valueWindow = this._valueWindow; + return hasValue && leftOut && rightOut; + }); + } else { + each$8(dataDims, function (dim) { + if (filterMode === 'empty') { + seriesModel.setData(seriesData = seriesData.map(dim, function (value) { + return !isInWindow(value) ? NaN : value; + })); + } else { + var range = {}; + range[dim] = valueWindow; // console.time('select'); - if (!percentWindow) { - return; - } // [0, 500]: arbitrary value, guess axis extent. + seriesData.selectRange(range); // console.timeEnd('select'); + } + }); + } + each$8(dataDims, function (dim) { + seriesData.setApproximateExtent(valueWindow, dim); + }); + }); - var precision = getPixelPrecision(valueWindow, [0, 500]); - precision = Math.min(precision, 20); // For value axis, if min/max/scale are not set, we just use the extent obtained - // by series data, which may be a little different from the extent calculated by - // `axisHelper.getScaleExtent`. But the different just affects the experience a - // little when zooming. So it will not be fixed until some users require it strongly. + function isInWindow(value) { + return value >= valueWindow[0] && value <= valueWindow[1]; + } + }; - var rawExtentInfo = axisModel.axis.scale.rawExtentInfo; + AxisProxy.prototype._updateMinMaxSpan = function () { + var minMaxSpan = this._minMaxSpan = {}; + var dataZoomModel = this._dataZoomModel; + var dataExtent = this._dataExtent; + each$8(['min', 'max'], function (minMax) { + var percentSpan = dataZoomModel.get(minMax + 'Span'); + var valueSpan = dataZoomModel.get(minMax + 'ValueSpan'); + valueSpan != null && (valueSpan = this.getAxisModel().axis.scale.parse(valueSpan)); // minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan - if (percentWindow[0] !== 0) { - rawExtentInfo.setDeterminedMinMax('min', +valueWindow[0].toFixed(precision)); - } + if (valueSpan != null) { + percentSpan = linearMap(dataExtent[0] + valueSpan, dataExtent, [0, 100], true); + } else if (percentSpan != null) { + valueSpan = linearMap(percentSpan, [0, 100], dataExtent, true) - dataExtent[0]; + } - if (percentWindow[1] !== 100) { - rawExtentInfo.setDeterminedMinMax('max', +valueWindow[1].toFixed(precision)); - } + minMaxSpan[minMax + 'Span'] = percentSpan; + minMaxSpan[minMax + 'ValueSpan'] = valueSpan; + }, this); + }; - rawExtentInfo.freeze(); - }; + AxisProxy.prototype._setAxisModel = function () { + var axisModel = this.getAxisModel(); + var percentWindow = this._percentWindow; + var valueWindow = this._valueWindow; + + if (!percentWindow) { + return; + } // [0, 500]: arbitrary value, guess axis extent. - return AxisProxy; - }(); + + var precision = getPixelPrecision(valueWindow, [0, 500]); + precision = Math.min(precision, 20); // For value axis, if min/max/scale are not set, we just use the extent obtained + // by series data, which may be a little different from the extent calculated by + // `axisHelper.getScaleExtent`. But the different just affects the experience a + // little when zooming. So it will not be fixed until some users require it strongly. + + var rawExtentInfo = axisModel.axis.scale.rawExtentInfo; + + if (percentWindow[0] !== 0) { + rawExtentInfo.setDeterminedMinMax('min', +valueWindow[0].toFixed(precision)); + } + + if (percentWindow[1] !== 100) { + rawExtentInfo.setDeterminedMinMax('max', +valueWindow[1].toFixed(precision)); + } + + rawExtentInfo.freeze(); + }; + + return AxisProxy; + }(); function calculateDataExtent(axisProxy, axisDim, seriesModels) { - var dataExtent = [Infinity, -Infinity]; - each$8(seriesModels, function (seriesModel) { - unionAxisExtentFromData(dataExtent, seriesModel.getData(), axisDim); - }); // It is important to get "consistent" extent when more then one axes is - // controlled by a `dataZoom`, otherwise those axes will not be synchronized - // when zooming. But it is difficult to know what is "consistent", considering - // axes have different type or even different meanings (For example, two - // time axes are used to compare data of the same date in different years). - // So basically dataZoom just obtains extent by series.data (in category axis - // extent can be obtained from axis.data). - // Nevertheless, user can set min/max/scale on axes to make extent of axes - // consistent. - - var axisModel = axisProxy.getAxisModel(); - var rawExtentResult = ensureScaleRawExtentInfo(axisModel.axis.scale, axisModel, dataExtent).calculate(); - return [rawExtentResult.min, rawExtentResult.max]; + var dataExtent = [Infinity, -Infinity]; + each$8(seriesModels, function (seriesModel) { + unionAxisExtentFromData(dataExtent, seriesModel.getData(), axisDim); + }); // It is important to get "consistent" extent when more then one axes is + // controlled by a `dataZoom`, otherwise those axes will not be synchronized + // when zooming. But it is difficult to know what is "consistent", considering + // axes have different type or even different meanings (For example, two + // time axes are used to compare data of the same date in different years). + // So basically dataZoom just obtains extent by series.data (in category axis + // extent can be obtained from axis.data). + // Nevertheless, user can set min/max/scale on axes to make extent of axes + // consistent. + + var axisModel = axisProxy.getAxisModel(); + var rawExtentResult = ensureScaleRawExtentInfo(axisModel.axis.scale, axisModel, dataExtent).calculate(); + return [rawExtentResult.min, rawExtentResult.max]; } var dataZoomProcessor = { - // `dataZoomProcessor` will only be performed in needed series. Consider if - // there is a line series and a pie series, it is better not to update the - // line series if only pie series is needed to be updated. - getTargetSeries: function (ecModel) { - function eachAxisModel(cb) { - ecModel.eachComponent('dataZoom', function (dataZoomModel) { - dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { - var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex); - cb(axisDim, axisIndex, axisModel, dataZoomModel); - }); - }); - } // FIXME: it brings side-effect to `getTargetSeries`. - // Prepare axis proxies. + // `dataZoomProcessor` will only be performed in needed series. Consider if + // there is a line series and a pie series, it is better not to update the + // line series if only pie series is needed to be updated. + getTargetSeries: function (ecModel) { + function eachAxisModel(cb) { + ecModel.eachComponent('dataZoom', function (dataZoomModel) { + dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { + var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex); + cb(axisDim, axisIndex, axisModel, dataZoomModel); + }); + }); + } // FIXME: it brings side-effect to `getTargetSeries`. + // Prepare axis proxies. - eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) { - // dispose all last axis proxy, in case that some axis are deleted. - axisModel.__dzAxisProxy = null; - }); - var proxyList = []; - eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) { - // Different dataZooms may constrol the same axis. In that case, - // an axisProxy serves both of them. - if (!axisModel.__dzAxisProxy) { - // Use the first dataZoomModel as the main model of axisProxy. - axisModel.__dzAxisProxy = new AxisProxy(axisDim, axisIndex, dataZoomModel, ecModel); - proxyList.push(axisModel.__dzAxisProxy); - } - }); - var seriesModelMap = createHashMap(); - each(proxyList, function (axisProxy) { - each(axisProxy.getTargetSeriesModels(), function (seriesModel) { - seriesModelMap.set(seriesModel.uid, seriesModel); - }); - }); - return seriesModelMap; - }, - // Consider appendData, where filter should be performed. Because data process is - // in block mode currently, it is not need to worry about that the overallProgress - // execute every frame. - overallReset: function (ecModel, api) { - ecModel.eachComponent('dataZoom', function (dataZoomModel) { - // We calculate window and reset axis here but not in model - // init stage and not after action dispatch handler, because - // reset should be called after seriesData.restoreData. - dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { - dataZoomModel.getAxisProxy(axisDim, axisIndex).reset(dataZoomModel); - }); // Caution: data zoom filtering is order sensitive when using - // percent range and no min/max/scale set on axis. - // For example, we have dataZoom definition: - // [ - // {xAxisIndex: 0, start: 30, end: 70}, - // {yAxisIndex: 0, start: 20, end: 80} - // ] - // In this case, [20, 80] of y-dataZoom should be based on data - // that have filtered by x-dataZoom using range of [30, 70], - // but should not be based on full raw data. Thus sliding - // x-dataZoom will change both ranges of xAxis and yAxis, - // while sliding y-dataZoom will only change the range of yAxis. - // So we should filter x-axis after reset x-axis immediately, - // and then reset y-axis and filter y-axis. - - dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { - dataZoomModel.getAxisProxy(axisDim, axisIndex).filterData(dataZoomModel, api); - }); - }); - ecModel.eachComponent('dataZoom', function (dataZoomModel) { - // Fullfill all of the range props so that user - // is able to get them from chart.getOption(). - var axisProxy = dataZoomModel.findRepresentativeAxisProxy(); - - if (axisProxy) { - var percentRange = axisProxy.getDataPercentWindow(); - var valueRange = axisProxy.getDataValueWindow(); - dataZoomModel.setCalculatedRange({ - start: percentRange[0], - end: percentRange[1], - startValue: valueRange[0], - endValue: valueRange[1] - }); - } + eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) { + // dispose all last axis proxy, in case that some axis are deleted. + axisModel.__dzAxisProxy = null; + }); + var proxyList = []; + eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) { + // Different dataZooms may constrol the same axis. In that case, + // an axisProxy serves both of them. + if (!axisModel.__dzAxisProxy) { + // Use the first dataZoomModel as the main model of axisProxy. + axisModel.__dzAxisProxy = new AxisProxy(axisDim, axisIndex, dataZoomModel, ecModel); + proxyList.push(axisModel.__dzAxisProxy); + } + }); + var seriesModelMap = createHashMap(); + each(proxyList, function (axisProxy) { + each(axisProxy.getTargetSeriesModels(), function (seriesModel) { + seriesModelMap.set(seriesModel.uid, seriesModel); + }); + }); + return seriesModelMap; + }, + // Consider appendData, where filter should be performed. Because data process is + // in block mode currently, it is not need to worry about that the overallProgress + // execute every frame. + overallReset: function (ecModel, api) { + ecModel.eachComponent('dataZoom', function (dataZoomModel) { + // We calculate window and reset axis here but not in model + // init stage and not after action dispatch handler, because + // reset should be called after seriesData.restoreData. + dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { + dataZoomModel.getAxisProxy(axisDim, axisIndex).reset(dataZoomModel); + }); // Caution: data zoom filtering is order sensitive when using + // percent range and no min/max/scale set on axis. + // For example, we have dataZoom definition: + // [ + // {xAxisIndex: 0, start: 30, end: 70}, + // {yAxisIndex: 0, start: 20, end: 80} + // ] + // In this case, [20, 80] of y-dataZoom should be based on data + // that have filtered by x-dataZoom using range of [30, 70], + // but should not be based on full raw data. Thus sliding + // x-dataZoom will change both ranges of xAxis and yAxis, + // while sliding y-dataZoom will only change the range of yAxis. + // So we should filter x-axis after reset x-axis immediately, + // and then reset y-axis and filter y-axis. + + dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { + dataZoomModel.getAxisProxy(axisDim, axisIndex).filterData(dataZoomModel, api); + }); + }); + ecModel.eachComponent('dataZoom', function (dataZoomModel) { + // Fullfill all of the range props so that user + // is able to get them from chart.getOption(). + var axisProxy = dataZoomModel.findRepresentativeAxisProxy(); + + if (axisProxy) { + var percentRange = axisProxy.getDataPercentWindow(); + var valueRange = axisProxy.getDataValueWindow(); + dataZoomModel.setCalculatedRange({ + start: percentRange[0], + end: percentRange[1], + startValue: valueRange[0], + endValue: valueRange[1] }); - } + } + }); + } }; function installDataZoomAction(registers) { - registers.registerAction('dataZoom', function (payload, ecModel) { - var effectedModels = findEffectedDataZooms(ecModel, payload); - each(effectedModels, function (dataZoomModel) { - dataZoomModel.setRawRange({ - start: payload.start, - end: payload.end, - startValue: payload.startValue, - endValue: payload.endValue - }); - }); + registers.registerAction('dataZoom', function (payload, ecModel) { + var effectedModels = findEffectedDataZooms(ecModel, payload); + each(effectedModels, function (dataZoomModel) { + dataZoomModel.setRawRange({ + start: payload.start, + end: payload.end, + startValue: payload.startValue, + endValue: payload.endValue + }); }); + }); } var installed = false; function installCommon(registers) { - if (installed) { - return; - } + if (installed) { + return; + } - installed = true; - registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, dataZoomProcessor); - installDataZoomAction(registers); - registers.registerSubTypeDefaulter('dataZoom', function () { - // Default 'slider' when no type specified. - return 'slider'; - }); + installed = true; + registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, dataZoomProcessor); + installDataZoomAction(registers); + registers.registerSubTypeDefaulter('dataZoom', function () { + // Default 'slider' when no type specified. + return 'slider'; + }); } function install$y(registers) { - registers.registerComponentModel(SelectDataZoomModel); - registers.registerComponentView(SelectDataZoomView); - installCommon(registers); + registers.registerComponentModel(SelectDataZoomModel); + registers.registerComponentView(SelectDataZoomView); + installCommon(registers); } /* @@ -79893,89 +79893,89 @@ */ var ToolboxFeature = - /** @class */ - function () { - function ToolboxFeature() {} + /** @class */ + function () { + function ToolboxFeature() {} - return ToolboxFeature; - }(); + return ToolboxFeature; + }(); var features = {}; function registerFeature(name, ctor) { - features[name] = ctor; + features[name] = ctor; } function getFeature(name) { - return features[name]; + return features[name]; } var ToolboxModel = - /** @class */ - function (_super) { - __extends(ToolboxModel, _super); + /** @class */ + function (_super) { + __extends(ToolboxModel, _super); - function ToolboxModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function ToolboxModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = ToolboxModel.type; - return _this; - } + _this.type = ToolboxModel.type; + return _this; + } - ToolboxModel.prototype.optionUpdated = function () { - _super.prototype.optionUpdated.apply(this, arguments); + ToolboxModel.prototype.optionUpdated = function () { + _super.prototype.optionUpdated.apply(this, arguments); - var ecModel = this.ecModel; - each(this.option.feature, function (featureOpt, featureName) { - var Feature = getFeature(featureName); - - if (Feature) { - if (Feature.getDefaultOption) { - Feature.defaultOption = Feature.getDefaultOption(ecModel); - } + var ecModel = this.ecModel; + each(this.option.feature, function (featureOpt, featureName) { + var Feature = getFeature(featureName); - merge(featureOpt, Feature.defaultOption); - } - }); - }; + if (Feature) { + if (Feature.getDefaultOption) { + Feature.defaultOption = Feature.getDefaultOption(ecModel); + } - ToolboxModel.type = 'toolbox'; - ToolboxModel.layoutMode = { - type: 'box', - ignoreSize: true - }; - ToolboxModel.defaultOption = { - show: true, - z: 6, - // zlevel: 0, - orient: 'horizontal', - left: 'right', - top: 'top', - // right - // bottom - backgroundColor: 'transparent', - borderColor: '#ccc', - borderRadius: 0, - borderWidth: 0, - padding: 5, - itemSize: 15, - itemGap: 8, - showTitle: true, - iconStyle: { - borderColor: '#666', - color: 'none' - }, - emphasis: { - iconStyle: { - borderColor: '#3E98C5' - } - }, - // textStyle: {}, - // feature - tooltip: { - show: false, - position: 'bottom' - } - }; - return ToolboxModel; - }(ComponentModel); + merge(featureOpt, Feature.defaultOption); + } + }); + }; + + ToolboxModel.type = 'toolbox'; + ToolboxModel.layoutMode = { + type: 'box', + ignoreSize: true + }; + ToolboxModel.defaultOption = { + show: true, + z: 6, + // zlevel: 0, + orient: 'horizontal', + left: 'right', + top: 'top', + // right + // bottom + backgroundColor: 'transparent', + borderColor: '#ccc', + borderRadius: 0, + borderWidth: 0, + padding: 5, + itemSize: 15, + itemGap: 8, + showTitle: true, + iconStyle: { + borderColor: '#666', + color: 'none' + }, + emphasis: { + iconStyle: { + borderColor: '#3E98C5' + } + }, + // textStyle: {}, + // feature + tooltip: { + show: false, + position: 'bottom' + } + }; + return ToolboxModel; + }(ComponentModel); /** * Layout list like component. @@ -79986,592 +79986,592 @@ */ function layout$3(group, componentModel, api) { - var boxLayoutParams = componentModel.getBoxLayoutParams(); - var padding = componentModel.get('padding'); - var viewportSize = { - width: api.getWidth(), - height: api.getHeight() - }; - var rect = getLayoutRect(boxLayoutParams, viewportSize, padding); - box(componentModel.get('orient'), group, componentModel.get('itemGap'), rect.width, rect.height); - positionElement(group, boxLayoutParams, viewportSize, padding); + var boxLayoutParams = componentModel.getBoxLayoutParams(); + var padding = componentModel.get('padding'); + var viewportSize = { + width: api.getWidth(), + height: api.getHeight() + }; + var rect = getLayoutRect(boxLayoutParams, viewportSize, padding); + box(componentModel.get('orient'), group, componentModel.get('itemGap'), rect.width, rect.height); + positionElement(group, boxLayoutParams, viewportSize, padding); } function makeBackground(rect, componentModel) { - var padding = normalizeCssArray$1(componentModel.get('padding')); - var style = componentModel.getItemStyle(['color', 'opacity']); - style.fill = componentModel.get('backgroundColor'); - rect = new Rect({ - shape: { - x: rect.x - padding[3], - y: rect.y - padding[0], - width: rect.width + padding[1] + padding[3], - height: rect.height + padding[0] + padding[2], - r: componentModel.get('borderRadius') - }, - style: style, - silent: true, - z2: -1 - }); // FIXME - // `subPixelOptimizeRect` may bring some gap between edge of viewpart - // and background rect when setting like `left: 0`, `top: 0`. - // graphic.subPixelOptimizeRect(rect); + var padding = normalizeCssArray$1(componentModel.get('padding')); + var style = componentModel.getItemStyle(['color', 'opacity']); + style.fill = componentModel.get('backgroundColor'); + rect = new Rect({ + shape: { + x: rect.x - padding[3], + y: rect.y - padding[0], + width: rect.width + padding[1] + padding[3], + height: rect.height + padding[0] + padding[2], + r: componentModel.get('borderRadius') + }, + style: style, + silent: true, + z2: -1 + }); // FIXME + // `subPixelOptimizeRect` may bring some gap between edge of viewpart + // and background rect when setting like `left: 0`, `top: 0`. + // graphic.subPixelOptimizeRect(rect); - return rect; + return rect; } var ToolboxView = - /** @class */ - function (_super) { - __extends(ToolboxView, _super); - - function ToolboxView() { - return _super !== null && _super.apply(this, arguments) || this; - } - - ToolboxView.prototype.render = function (toolboxModel, ecModel, api, payload) { - var group = this.group; - group.removeAll(); - - if (!toolboxModel.get('show')) { - return; - } - - var itemSize = +toolboxModel.get('itemSize'); - var isVertical = toolboxModel.get('orient') === 'vertical'; - var featureOpts = toolboxModel.get('feature') || {}; - var features = this._features || (this._features = {}); - var featureNames = []; - each(featureOpts, function (opt, name) { - featureNames.push(name); - }); - new DataDiffer(this._featureNames || [], featureNames).add(processFeature).update(processFeature).remove(curry(processFeature, null)).execute(); // Keep for diff. - - this._featureNames = featureNames; - - function processFeature(newIndex, oldIndex) { - var featureName = featureNames[newIndex]; - var oldName = featureNames[oldIndex]; - var featureOpt = featureOpts[featureName]; - var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel); - var feature; // FIX#11236, merge feature title from MagicType newOption. TODO: consider seriesIndex ? - - if (payload && payload.newTitle != null && payload.featureName === featureName) { - featureOpt.title = payload.newTitle; - } - - if (featureName && !oldName) { - // Create - if (isUserFeatureName(featureName)) { - feature = { - onclick: featureModel.option.onclick, - featureName: featureName - }; - } else { - var Feature = getFeature(featureName); - - if (!Feature) { - return; - } - - feature = new Feature(); - } - - features[featureName] = feature; - } else { - feature = features[oldName]; // If feature does not exsit. - - if (!feature) { - return; - } - } + /** @class */ + function (_super) { + __extends(ToolboxView, _super); - feature.uid = getUID('toolbox-feature'); - feature.model = featureModel; - feature.ecModel = ecModel; - feature.api = api; - var isToolboxFeature = feature instanceof ToolboxFeature; - - if (!featureName && oldName) { - isToolboxFeature && feature.dispose && feature.dispose(ecModel, api); - return; - } + function ToolboxView() { + return _super !== null && _super.apply(this, arguments) || this; + } - if (!featureModel.get('show') || isToolboxFeature && feature.unusable) { - isToolboxFeature && feature.remove && feature.remove(ecModel, api); - return; - } + ToolboxView.prototype.render = function (toolboxModel, ecModel, api, payload) { + var group = this.group; + group.removeAll(); - createIconPaths(featureModel, feature, featureName); + if (!toolboxModel.get('show')) { + return; + } - featureModel.setIconStatus = function (iconName, status) { - var option = this.option; - var iconPaths = this.iconPaths; - option.iconStatus = option.iconStatus || {}; - option.iconStatus[iconName] = status; + var itemSize = +toolboxModel.get('itemSize'); + var isVertical = toolboxModel.get('orient') === 'vertical'; + var featureOpts = toolboxModel.get('feature') || {}; + var features = this._features || (this._features = {}); + var featureNames = []; + each(featureOpts, function (opt, name) { + featureNames.push(name); + }); + new DataDiffer(this._featureNames || [], featureNames).add(processFeature).update(processFeature).remove(curry(processFeature, null)).execute(); // Keep for diff. + + this._featureNames = featureNames; + + function processFeature(newIndex, oldIndex) { + var featureName = featureNames[newIndex]; + var oldName = featureNames[oldIndex]; + var featureOpt = featureOpts[featureName]; + var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel); + var feature; // FIX#11236, merge feature title from MagicType newOption. TODO: consider seriesIndex ? + + if (payload && payload.newTitle != null && payload.featureName === featureName) { + featureOpt.title = payload.newTitle; + } + + if (featureName && !oldName) { + // Create + if (isUserFeatureName(featureName)) { + feature = { + onclick: featureModel.option.onclick, + featureName: featureName + }; + } else { + var Feature = getFeature(featureName); - if (iconPaths[iconName]) { - (status === 'emphasis' ? enterEmphasis : leaveEmphasis)(iconPaths[iconName]); - } - }; + if (!Feature) { + return; + } - if (feature instanceof ToolboxFeature) { - if (feature.render) { - feature.render(featureModel, ecModel, api, payload); - } - } - } + feature = new Feature(); + } - function createIconPaths(featureModel, feature, featureName) { - var iconStyleModel = featureModel.getModel('iconStyle'); - var iconStyleEmphasisModel = featureModel.getModel(['emphasis', 'iconStyle']); // If one feature has mutiple icon. they are orginaized as - // { - // icon: { - // foo: '', - // bar: '' - // }, - // title: { - // foo: '', - // bar: '' - // } - // } - - var icons = feature instanceof ToolboxFeature && feature.getIcons ? feature.getIcons() : featureModel.get('icon'); - var titles = featureModel.get('title') || {}; - var iconsMap; - var titlesMap; - - if (isString(icons)) { - iconsMap = {}; - iconsMap[featureName] = icons; - } else { - iconsMap = icons; - } + features[featureName] = feature; + } else { + feature = features[oldName]; // If feature does not exsit. - if (isString(titles)) { - titlesMap = {}; - titlesMap[featureName] = titles; - } else { - titlesMap = titles; - } + if (!feature) { + return; + } + } - var iconPaths = featureModel.iconPaths = {}; - each(iconsMap, function (iconStr, iconName) { - var path = createIcon(iconStr, {}, { - x: -itemSize / 2, - y: -itemSize / 2, - width: itemSize, - height: itemSize - }); // TODO handling image - - path.setStyle(iconStyleModel.getItemStyle()); - var pathEmphasisState = path.ensureState('emphasis'); - pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle(); // Text position calculation - - var textContent = new ZRText({ - style: { - text: titlesMap[iconName], - align: iconStyleEmphasisModel.get('textAlign'), - borderRadius: iconStyleEmphasisModel.get('textBorderRadius'), - padding: iconStyleEmphasisModel.get('textPadding'), - fill: null - }, - ignore: true - }); - path.setTextContent(textContent); - setTooltipConfig({ - el: path, - componentModel: toolboxModel, - itemName: iconName, - formatterParamsExtra: { - title: titlesMap[iconName] - } - }); - path.__title = titlesMap[iconName]; - path.on('mouseover', function () { - // Should not reuse above hoverStyle, which might be modified. - var hoverStyle = iconStyleEmphasisModel.getItemStyle(); - var defaultTextPosition = isVertical ? toolboxModel.get('right') == null && toolboxModel.get('left') !== 'right' ? 'right' : 'left' : toolboxModel.get('bottom') == null && toolboxModel.get('top') !== 'bottom' ? 'bottom' : 'top'; - textContent.setStyle({ - fill: iconStyleEmphasisModel.get('textFill') || hoverStyle.fill || hoverStyle.stroke || '#000', - backgroundColor: iconStyleEmphasisModel.get('textBackgroundColor') - }); - path.setTextConfig({ - position: iconStyleEmphasisModel.get('textPosition') || defaultTextPosition - }); - textContent.ignore = !toolboxModel.get('showTitle'); // Use enterEmphasis and leaveEmphasis provide by ec. - // There are flags managed by the echarts. + feature.uid = getUID('toolbox-feature'); + feature.model = featureModel; + feature.ecModel = ecModel; + feature.api = api; + var isToolboxFeature = feature instanceof ToolboxFeature; - api.enterEmphasis(this); - }).on('mouseout', function () { - if (featureModel.get(['iconStatus', iconName]) !== 'emphasis') { - api.leaveEmphasis(this); - } + if (!featureName && oldName) { + isToolboxFeature && feature.dispose && feature.dispose(ecModel, api); + return; + } - textContent.hide(); - }); - (featureModel.get(['iconStatus', iconName]) === 'emphasis' ? enterEmphasis : leaveEmphasis)(path); - group.add(path); - path.on('click', bind(feature.onclick, feature, ecModel, api, iconName)); - iconPaths[iconName] = path; - }); - } + if (!featureModel.get('show') || isToolboxFeature && feature.unusable) { + isToolboxFeature && feature.remove && feature.remove(ecModel, api); + return; + } + + createIconPaths(featureModel, feature, featureName); + + featureModel.setIconStatus = function (iconName, status) { + var option = this.option; + var iconPaths = this.iconPaths; + option.iconStatus = option.iconStatus || {}; + option.iconStatus[iconName] = status; + + if (iconPaths[iconName]) { + (status === 'emphasis' ? enterEmphasis : leaveEmphasis)(iconPaths[iconName]); + } + }; + + if (feature instanceof ToolboxFeature) { + if (feature.render) { + feature.render(featureModel, ecModel, api, payload); + } + } + } + + function createIconPaths(featureModel, feature, featureName) { + var iconStyleModel = featureModel.getModel('iconStyle'); + var iconStyleEmphasisModel = featureModel.getModel(['emphasis', 'iconStyle']); // If one feature has mutiple icon. they are orginaized as + // { + // icon: { + // foo: '', + // bar: '' + // }, + // title: { + // foo: '', + // bar: '' + // } + // } + + var icons = feature instanceof ToolboxFeature && feature.getIcons ? feature.getIcons() : featureModel.get('icon'); + var titles = featureModel.get('title') || {}; + var iconsMap; + var titlesMap; + + if (isString(icons)) { + iconsMap = {}; + iconsMap[featureName] = icons; + } else { + iconsMap = icons; + } + + if (isString(titles)) { + titlesMap = {}; + titlesMap[featureName] = titles; + } else { + titlesMap = titles; + } + + var iconPaths = featureModel.iconPaths = {}; + each(iconsMap, function (iconStr, iconName) { + var path = createIcon(iconStr, {}, { + x: -itemSize / 2, + y: -itemSize / 2, + width: itemSize, + height: itemSize + }); // TODO handling image + + path.setStyle(iconStyleModel.getItemStyle()); + var pathEmphasisState = path.ensureState('emphasis'); + pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle(); // Text position calculation + + var textContent = new ZRText({ + style: { + text: titlesMap[iconName], + align: iconStyleEmphasisModel.get('textAlign'), + borderRadius: iconStyleEmphasisModel.get('textBorderRadius'), + padding: iconStyleEmphasisModel.get('textPadding'), + fill: null + }, + ignore: true + }); + path.setTextContent(textContent); + setTooltipConfig({ + el: path, + componentModel: toolboxModel, + itemName: iconName, + formatterParamsExtra: { + title: titlesMap[iconName] + } + }); + path.__title = titlesMap[iconName]; + path.on('mouseover', function () { + // Should not reuse above hoverStyle, which might be modified. + var hoverStyle = iconStyleEmphasisModel.getItemStyle(); + var defaultTextPosition = isVertical ? toolboxModel.get('right') == null && toolboxModel.get('left') !== 'right' ? 'right' : 'left' : toolboxModel.get('bottom') == null && toolboxModel.get('top') !== 'bottom' ? 'bottom' : 'top'; + textContent.setStyle({ + fill: iconStyleEmphasisModel.get('textFill') || hoverStyle.fill || hoverStyle.stroke || '#000', + backgroundColor: iconStyleEmphasisModel.get('textBackgroundColor') + }); + path.setTextConfig({ + position: iconStyleEmphasisModel.get('textPosition') || defaultTextPosition + }); + textContent.ignore = !toolboxModel.get('showTitle'); // Use enterEmphasis and leaveEmphasis provide by ec. + // There are flags managed by the echarts. + + api.enterEmphasis(this); + }).on('mouseout', function () { + if (featureModel.get(['iconStatus', iconName]) !== 'emphasis') { + api.leaveEmphasis(this); + } + + textContent.hide(); + }); + (featureModel.get(['iconStatus', iconName]) === 'emphasis' ? enterEmphasis : leaveEmphasis)(path); + group.add(path); + path.on('click', bind(feature.onclick, feature, ecModel, api, iconName)); + iconPaths[iconName] = path; + }); + } - layout$3(group, toolboxModel, api); // Render background after group is layout - // FIXME + layout$3(group, toolboxModel, api); // Render background after group is layout + // FIXME - group.add(makeBackground(group.getBoundingRect(), toolboxModel)); // Adjust icon title positions to avoid them out of screen + group.add(makeBackground(group.getBoundingRect(), toolboxModel)); // Adjust icon title positions to avoid them out of screen - isVertical || group.eachChild(function (icon) { - var titleText = icon.__title; // const hoverStyle = icon.hoverStyle; - // TODO simplify code? + isVertical || group.eachChild(function (icon) { + var titleText = icon.__title; // const hoverStyle = icon.hoverStyle; + // TODO simplify code? - var emphasisState = icon.ensureState('emphasis'); - var emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {}); - var textContent = icon.getTextContent(); - var emphasisTextState = textContent && textContent.ensureState('emphasis'); // May be background element + var emphasisState = icon.ensureState('emphasis'); + var emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {}); + var textContent = icon.getTextContent(); + var emphasisTextState = textContent && textContent.ensureState('emphasis'); // May be background element - if (emphasisTextState && !isFunction(emphasisTextState) && titleText) { - var emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {}); - var rect = getBoundingRect(titleText, ZRText.makeFont(emphasisTextStyle)); - var offsetX = icon.x + group.x; - var offsetY = icon.y + group.y + itemSize; - var needPutOnTop = false; + if (emphasisTextState && !isFunction(emphasisTextState) && titleText) { + var emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {}); + var rect = getBoundingRect(titleText, ZRText.makeFont(emphasisTextStyle)); + var offsetX = icon.x + group.x; + var offsetY = icon.y + group.y + itemSize; + var needPutOnTop = false; - if (offsetY + rect.height > api.getHeight()) { - emphasisTextConfig.position = 'top'; - needPutOnTop = true; - } + if (offsetY + rect.height > api.getHeight()) { + emphasisTextConfig.position = 'top'; + needPutOnTop = true; + } - var topOffset = needPutOnTop ? -5 - rect.height : itemSize + 10; + var topOffset = needPutOnTop ? -5 - rect.height : itemSize + 10; - if (offsetX + rect.width / 2 > api.getWidth()) { - emphasisTextConfig.position = ['100%', topOffset]; - emphasisTextStyle.align = 'right'; - } else if (offsetX - rect.width / 2 < 0) { - emphasisTextConfig.position = [0, topOffset]; - emphasisTextStyle.align = 'left'; - } - } - }); - }; + if (offsetX + rect.width / 2 > api.getWidth()) { + emphasisTextConfig.position = ['100%', topOffset]; + emphasisTextStyle.align = 'right'; + } else if (offsetX - rect.width / 2 < 0) { + emphasisTextConfig.position = [0, topOffset]; + emphasisTextStyle.align = 'left'; + } + } + }); + }; - ToolboxView.prototype.updateView = function (toolboxModel, ecModel, api, payload) { - each(this._features, function (feature) { - feature instanceof ToolboxFeature && feature.updateView && feature.updateView(feature.model, ecModel, api, payload); - }); - }; // updateLayout(toolboxModel, ecModel, api, payload) { - // zrUtil.each(this._features, function (feature) { - // feature.updateLayout && feature.updateLayout(feature.model, ecModel, api, payload); - // }); - // }, + ToolboxView.prototype.updateView = function (toolboxModel, ecModel, api, payload) { + each(this._features, function (feature) { + feature instanceof ToolboxFeature && feature.updateView && feature.updateView(feature.model, ecModel, api, payload); + }); + }; // updateLayout(toolboxModel, ecModel, api, payload) { + // zrUtil.each(this._features, function (feature) { + // feature.updateLayout && feature.updateLayout(feature.model, ecModel, api, payload); + // }); + // }, - ToolboxView.prototype.remove = function (ecModel, api) { - each(this._features, function (feature) { - feature instanceof ToolboxFeature && feature.remove && feature.remove(ecModel, api); - }); - this.group.removeAll(); - }; + ToolboxView.prototype.remove = function (ecModel, api) { + each(this._features, function (feature) { + feature instanceof ToolboxFeature && feature.remove && feature.remove(ecModel, api); + }); + this.group.removeAll(); + }; - ToolboxView.prototype.dispose = function (ecModel, api) { - each(this._features, function (feature) { - feature instanceof ToolboxFeature && feature.dispose && feature.dispose(ecModel, api); - }); - }; + ToolboxView.prototype.dispose = function (ecModel, api) { + each(this._features, function (feature) { + feature instanceof ToolboxFeature && feature.dispose && feature.dispose(ecModel, api); + }); + }; - ToolboxView.type = 'toolbox'; - return ToolboxView; - }(ComponentView); + ToolboxView.type = 'toolbox'; + return ToolboxView; + }(ComponentView); function isUserFeatureName(featureName) { - return featureName.indexOf('my') === 0; + return featureName.indexOf('my') === 0; } /* global window, document */ var SaveAsImage = - /** @class */ - function (_super) { - __extends(SaveAsImage, _super); - - function SaveAsImage() { - return _super !== null && _super.apply(this, arguments) || this; - } - - SaveAsImage.prototype.onclick = function (ecModel, api) { - var model = this.model; - var title = model.get('name') || ecModel.get('title.0.text') || 'echarts'; - var isSvg = api.getZr().painter.getType() === 'svg'; - var type = isSvg ? 'svg' : model.get('type', true) || 'png'; - var url = api.getConnectedDataURL({ - type: type, - backgroundColor: model.get('backgroundColor', true) || ecModel.get('backgroundColor') || '#fff', - connectedBackgroundColor: model.get('connectedBackgroundColor'), - excludeComponents: model.get('excludeComponents'), - pixelRatio: model.get('pixelRatio') - }); - var browser = env.browser; // Chrome, Firefox, New Edge - - if (isFunction(MouseEvent) && (browser.newEdge || !browser.ie && !browser.edge)) { - var $a = document.createElement('a'); - $a.download = title + '.' + type; - $a.target = '_blank'; - $a.href = url; - var evt = new MouseEvent('click', { - // some micro front-end framework, window maybe is a Proxy - view: document.defaultView, - bubbles: true, - cancelable: false - }); - $a.dispatchEvent(evt); - } // IE or old Edge - else { - // @ts-ignore - if (window.navigator.msSaveOrOpenBlob || isSvg) { - var parts = url.split(','); // data:[][;charset=][;base64], - - var base64Encoded = parts[0].indexOf('base64') > -1; - var bstr = isSvg // should decode the svg data uri first - ? decodeURIComponent(parts[1]) : parts[1]; // only `atob` when the data uri is encoded with base64 - // otherwise, like `svg` data uri exported by zrender, - // there will be an error, for it's not encoded with base64. - // (just a url-encoded string through `encodeURIComponent`) - - base64Encoded && (bstr = window.atob(bstr)); - var filename = title + '.' + type; // @ts-ignore - - if (window.navigator.msSaveOrOpenBlob) { - var n = bstr.length; - var u8arr = new Uint8Array(n); - - while (n--) { - u8arr[n] = bstr.charCodeAt(n); - } - - var blob = new Blob([u8arr]); // @ts-ignore - - window.navigator.msSaveOrOpenBlob(blob, filename); - } else { - var frame = document.createElement('iframe'); - document.body.appendChild(frame); - var cw = frame.contentWindow; - var doc = cw.document; - doc.open('image/svg+xml', 'replace'); - doc.write(bstr); - doc.close(); - cw.focus(); - doc.execCommand('SaveAs', true, filename); - document.body.removeChild(frame); - } - } else { - var lang = model.get('lang'); - var html = '' + '' + '' + ''; - var tab = window.open(); - tab.document.write(html); - tab.document.title = title; - } - } - }; - - SaveAsImage.getDefaultOption = function (ecModel) { - var defaultOption = { - show: true, - icon: 'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0', - title: ecModel.getLocaleModel().get(['toolbox', 'saveAsImage', 'title']), - type: 'png', - // Default use option.backgroundColor - // backgroundColor: '#fff', - connectedBackgroundColor: '#fff', - name: '', - excludeComponents: ['toolbox'], - // use current pixel ratio of device by default - // pixelRatio: 1, - lang: ecModel.getLocaleModel().get(['toolbox', 'saveAsImage', 'lang']) - }; - return defaultOption; - }; - - return SaveAsImage; - }(ToolboxFeature); + /** @class */ + function (_super) { + __extends(SaveAsImage, _super); + + function SaveAsImage() { + return _super !== null && _super.apply(this, arguments) || this; + } + + SaveAsImage.prototype.onclick = function (ecModel, api) { + var model = this.model; + var title = model.get('name') || ecModel.get('title.0.text') || 'echarts'; + var isSvg = api.getZr().painter.getType() === 'svg'; + var type = isSvg ? 'svg' : model.get('type', true) || 'png'; + var url = api.getConnectedDataURL({ + type: type, + backgroundColor: model.get('backgroundColor', true) || ecModel.get('backgroundColor') || '#fff', + connectedBackgroundColor: model.get('connectedBackgroundColor'), + excludeComponents: model.get('excludeComponents'), + pixelRatio: model.get('pixelRatio') + }); + var browser = env.browser; // Chrome, Firefox, New Edge + + if (isFunction(MouseEvent) && (browser.newEdge || !browser.ie && !browser.edge)) { + var $a = document.createElement('a'); + $a.download = title + '.' + type; + $a.target = '_blank'; + $a.href = url; + var evt = new MouseEvent('click', { + // some micro front-end framework, window maybe is a Proxy + view: document.defaultView, + bubbles: true, + cancelable: false + }); + $a.dispatchEvent(evt); + } // IE or old Edge + else { + // @ts-ignore + if (window.navigator.msSaveOrOpenBlob || isSvg) { + var parts = url.split(','); // data:[][;charset=][;base64], + + var base64Encoded = parts[0].indexOf('base64') > -1; + var bstr = isSvg // should decode the svg data uri first + ? decodeURIComponent(parts[1]) : parts[1]; // only `atob` when the data uri is encoded with base64 + // otherwise, like `svg` data uri exported by zrender, + // there will be an error, for it's not encoded with base64. + // (just a url-encoded string through `encodeURIComponent`) + + base64Encoded && (bstr = window.atob(bstr)); + var filename = title + '.' + type; // @ts-ignore + + if (window.navigator.msSaveOrOpenBlob) { + var n = bstr.length; + var u8arr = new Uint8Array(n); + + while (n--) { + u8arr[n] = bstr.charCodeAt(n); + } + + var blob = new Blob([u8arr]); // @ts-ignore + + window.navigator.msSaveOrOpenBlob(blob, filename); + } else { + var frame = document.createElement('iframe'); + document.body.appendChild(frame); + var cw = frame.contentWindow; + var doc = cw.document; + doc.open('image/svg+xml', 'replace'); + doc.write(bstr); + doc.close(); + cw.focus(); + doc.execCommand('SaveAs', true, filename); + document.body.removeChild(frame); + } + } else { + var lang = model.get('lang'); + var html = '' + '' + '' + ''; + var tab = window.open(); + tab.document.write(html); + tab.document.title = title; + } + } + }; + + SaveAsImage.getDefaultOption = function (ecModel) { + var defaultOption = { + show: true, + icon: 'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0', + title: ecModel.getLocaleModel().get(['toolbox', 'saveAsImage', 'title']), + type: 'png', + // Default use option.backgroundColor + // backgroundColor: '#fff', + connectedBackgroundColor: '#fff', + name: '', + excludeComponents: ['toolbox'], + // use current pixel ratio of device by default + // pixelRatio: 1, + lang: ecModel.getLocaleModel().get(['toolbox', 'saveAsImage', 'lang']) + }; + return defaultOption; + }; + + return SaveAsImage; + }(ToolboxFeature); var INNER_STACK_KEYWORD = '__ec_magicType_stack__'; var radioTypes = [['line', 'bar'], ['stack']]; var MagicType = - /** @class */ - function (_super) { - __extends(MagicType, _super); - - function MagicType() { - return _super !== null && _super.apply(this, arguments) || this; - } - - MagicType.prototype.getIcons = function () { - var model = this.model; - var availableIcons = model.get('icon'); - var icons = {}; - each(model.get('type'), function (type) { - if (availableIcons[type]) { - icons[type] = availableIcons[type]; - } - }); - return icons; - }; - - MagicType.getDefaultOption = function (ecModel) { - var defaultOption = { - show: true, - type: [], - // Icon group - 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', - // eslint-disable-next-line - 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' // jshint ignore:line + /** @class */ + function (_super) { + __extends(MagicType, _super); + + function MagicType() { + return _super !== null && _super.apply(this, arguments) || this; + } + + MagicType.prototype.getIcons = function () { + var model = this.model; + var availableIcons = model.get('icon'); + var icons = {}; + each(model.get('type'), function (type) { + if (availableIcons[type]) { + icons[type] = availableIcons[type]; + } + }); + return icons; + }; + + MagicType.getDefaultOption = function (ecModel) { + var defaultOption = { + show: true, + type: [], + // Icon group + 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', + // eslint-disable-next-line + 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' // jshint ignore:line - }, - // `line`, `bar`, `stack`, `tiled` - title: ecModel.getLocaleModel().get(['toolbox', 'magicType', 'title']), - option: {}, - seriesIndex: {} - }; - return defaultOption; - }; + }, + // `line`, `bar`, `stack`, `tiled` + title: ecModel.getLocaleModel().get(['toolbox', 'magicType', 'title']), + option: {}, + seriesIndex: {} + }; + return defaultOption; + }; - MagicType.prototype.onclick = function (ecModel, api, type) { - var model = this.model; - var seriesIndex = model.get(['seriesIndex', type]); // Not supported magicType + MagicType.prototype.onclick = function (ecModel, api, type) { + var model = this.model; + var seriesIndex = model.get(['seriesIndex', type]); // Not supported magicType - if (!seriesOptGenreator[type]) { - return; - } + if (!seriesOptGenreator[type]) { + return; + } - var newOption = { - series: [] - }; + var newOption = { + series: [] + }; - var generateNewSeriesTypes = function (seriesModel) { - var seriesType = seriesModel.subType; - var seriesId = seriesModel.id; - var newSeriesOpt = seriesOptGenreator[type](seriesType, seriesId, seriesModel, model); + var generateNewSeriesTypes = function (seriesModel) { + var seriesType = seriesModel.subType; + var seriesId = seriesModel.id; + var newSeriesOpt = seriesOptGenreator[type](seriesType, seriesId, seriesModel, model); - if (newSeriesOpt) { - // PENDING If merge original option? - defaults(newSeriesOpt, seriesModel.option); - newOption.series.push(newSeriesOpt); - } // Modify boundaryGap + if (newSeriesOpt) { + // PENDING If merge original option? + defaults(newSeriesOpt, seriesModel.option); + newOption.series.push(newSeriesOpt); + } // Modify boundaryGap - var coordSys = seriesModel.coordinateSystem; + var coordSys = seriesModel.coordinateSystem; - if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) { - var categoryAxis = coordSys.getAxesByScale('ordinal')[0]; + if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) { + var categoryAxis = coordSys.getAxesByScale('ordinal')[0]; - if (categoryAxis) { - var axisDim = categoryAxis.dim; - var axisType = axisDim + 'Axis'; - var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0]; - var axisIndex = axisModel.componentIndex; - newOption[axisType] = newOption[axisType] || []; + if (categoryAxis) { + var axisDim = categoryAxis.dim; + var axisType = axisDim + 'Axis'; + var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0]; + var axisIndex = axisModel.componentIndex; + newOption[axisType] = newOption[axisType] || []; - for (var i = 0; i <= axisIndex; i++) { - newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {}; - } + for (var i = 0; i <= axisIndex; i++) { + newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {}; + } - newOption[axisType][axisIndex].boundaryGap = type === 'bar'; - } - } - }; + newOption[axisType][axisIndex].boundaryGap = type === 'bar'; + } + } + }; - each(radioTypes, function (radio) { - if (indexOf(radio, type) >= 0) { - each(radio, function (item) { - model.setIconStatus(item, 'normal'); - }); - } - }); - model.setIconStatus(type, 'emphasis'); - ecModel.eachComponent({ - mainType: 'series', - query: seriesIndex == null ? null : { - seriesIndex: seriesIndex - } - }, generateNewSeriesTypes); - var newTitle; - var currentType = type; // Change title of stack - - if (type === 'stack') { - // use titles in model instead of ecModel - // as stack and tiled appears in pair, just flip them - // no need of checking stack state - newTitle = merge({ - stack: model.option.title.tiled, - tiled: model.option.title.stack - }, model.option.title); - - if (model.get(['iconStatus', type]) !== 'emphasis') { - currentType = 'tiled'; - } - } + each(radioTypes, function (radio) { + if (indexOf(radio, type) >= 0) { + each(radio, function (item) { + model.setIconStatus(item, 'normal'); + }); + } + }); + model.setIconStatus(type, 'emphasis'); + ecModel.eachComponent({ + mainType: 'series', + query: seriesIndex == null ? null : { + seriesIndex: seriesIndex + } + }, generateNewSeriesTypes); + var newTitle; + var currentType = type; // Change title of stack + + if (type === 'stack') { + // use titles in model instead of ecModel + // as stack and tiled appears in pair, just flip them + // no need of checking stack state + newTitle = merge({ + stack: model.option.title.tiled, + tiled: model.option.title.stack + }, model.option.title); + + if (model.get(['iconStatus', type]) !== 'emphasis') { + currentType = 'tiled'; + } + } - api.dispatchAction({ - type: 'changeMagicType', - currentType: currentType, - newOption: newOption, - newTitle: newTitle, - featureName: 'magicType' - }); - }; + api.dispatchAction({ + type: 'changeMagicType', + currentType: currentType, + newOption: newOption, + newTitle: newTitle, + featureName: 'magicType' + }); + }; - return MagicType; - }(ToolboxFeature); + return MagicType; + }(ToolboxFeature); var seriesOptGenreator = { - 'line': function (seriesType, seriesId, seriesModel, model) { - if (seriesType === 'bar') { - return merge({ - id: seriesId, - type: 'line', - // Preserve data related option - data: seriesModel.get('data'), - stack: seriesModel.get('stack'), - markPoint: seriesModel.get('markPoint'), - markLine: seriesModel.get('markLine') - }, model.get(['option', 'line']) || {}, true); - } - }, - 'bar': function (seriesType, seriesId, seriesModel, model) { - if (seriesType === 'line') { - return merge({ - id: seriesId, - type: 'bar', - // Preserve data related option - data: seriesModel.get('data'), - stack: seriesModel.get('stack'), - markPoint: seriesModel.get('markPoint'), - markLine: seriesModel.get('markLine') - }, model.get(['option', 'bar']) || {}, true); - } - }, - 'stack': function (seriesType, seriesId, seriesModel, model) { - var isStack = seriesModel.get('stack') === INNER_STACK_KEYWORD; - - if (seriesType === 'line' || seriesType === 'bar') { - model.setIconStatus('stack', isStack ? 'normal' : 'emphasis'); - return merge({ - id: seriesId, - stack: isStack ? '' : INNER_STACK_KEYWORD - }, model.get(['option', 'stack']) || {}, true); - } - } + 'line': function (seriesType, seriesId, seriesModel, model) { + if (seriesType === 'bar') { + return merge({ + id: seriesId, + type: 'line', + // Preserve data related option + data: seriesModel.get('data'), + stack: seriesModel.get('stack'), + markPoint: seriesModel.get('markPoint'), + markLine: seriesModel.get('markLine') + }, model.get(['option', 'line']) || {}, true); + } + }, + 'bar': function (seriesType, seriesId, seriesModel, model) { + if (seriesType === 'line') { + return merge({ + id: seriesId, + type: 'bar', + // Preserve data related option + data: seriesModel.get('data'), + stack: seriesModel.get('stack'), + markPoint: seriesModel.get('markPoint'), + markLine: seriesModel.get('markLine') + }, model.get(['option', 'bar']) || {}, true); + } + }, + 'stack': function (seriesType, seriesId, seriesModel, model) { + var isStack = seriesModel.get('stack') === INNER_STACK_KEYWORD; + + if (seriesType === 'line' || seriesType === 'bar') { + model.setIconStatus('stack', isStack ? 'normal' : 'emphasis'); + return merge({ + id: seriesId, + stack: isStack ? '' : INNER_STACK_KEYWORD + }, model.get(['option', 'stack']) || {}, true); + } + } }; // TODO: SELF REGISTERED. registerAction({ - type: 'changeMagicType', - event: 'magicTypeChanged', - update: 'prepareAndUpdate' + type: 'changeMagicType', + event: 'magicTypeChanged', + update: 'prepareAndUpdate' }, function (payload, ecModel) { - ecModel.mergeOption(payload.newOption); + ecModel.mergeOption(payload.newOption); }); /* global document */ @@ -80585,44 +80585,44 @@ */ function groupSeries(ecModel) { - var seriesGroupByCategoryAxis = {}; - var otherSeries = []; - var meta = []; - ecModel.eachRawSeries(function (seriesModel) { - var coordSys = seriesModel.coordinateSystem; - - if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) { - // TODO: TYPE Consider polar? Include polar may increase unecessary bundle size. - var baseAxis = coordSys.getBaseAxis(); + var seriesGroupByCategoryAxis = {}; + var otherSeries = []; + var meta = []; + ecModel.eachRawSeries(function (seriesModel) { + var coordSys = seriesModel.coordinateSystem; - if (baseAxis.type === 'category') { - var key = baseAxis.dim + '_' + baseAxis.index; + if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) { + // TODO: TYPE Consider polar? Include polar may increase unecessary bundle size. + var baseAxis = coordSys.getBaseAxis(); - if (!seriesGroupByCategoryAxis[key]) { - seriesGroupByCategoryAxis[key] = { - categoryAxis: baseAxis, - valueAxis: coordSys.getOtherAxis(baseAxis), - series: [] - }; - meta.push({ - axisDim: baseAxis.dim, - axisIndex: baseAxis.index - }); - } + if (baseAxis.type === 'category') { + var key = baseAxis.dim + '_' + baseAxis.index; - seriesGroupByCategoryAxis[key].series.push(seriesModel); - } else { - otherSeries.push(seriesModel); - } - } else { - otherSeries.push(seriesModel); - } - }); - return { - seriesGroupByCategoryAxis: seriesGroupByCategoryAxis, - other: otherSeries, - meta: meta - }; + if (!seriesGroupByCategoryAxis[key]) { + seriesGroupByCategoryAxis[key] = { + categoryAxis: baseAxis, + valueAxis: coordSys.getOtherAxis(baseAxis), + series: [] + }; + meta.push({ + axisDim: baseAxis.dim, + axisIndex: baseAxis.index + }); + } + + seriesGroupByCategoryAxis[key].series.push(seriesModel); + } else { + otherSeries.push(seriesModel); + } + } else { + otherSeries.push(seriesModel); + } + }); + return { + seriesGroupByCategoryAxis: seriesGroupByCategoryAxis, + other: otherSeries, + meta: meta + }; } /** * Assemble content of series on cateogory axis @@ -80631,38 +80631,38 @@ function assembleSeriesWithCategoryAxis(groups) { - var tables = []; - each(groups, function (group, key) { - var categoryAxis = group.categoryAxis; - var valueAxis = group.valueAxis; - var valueAxisDim = valueAxis.dim; - var headers = [' '].concat(map(group.series, function (series) { - return series.name; - })); // @ts-ignore TODO Polar - - var columns = [categoryAxis.model.getCategories()]; - each(group.series, function (series) { - var rawData = series.getRawData(); - columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function (val) { - return val; - })); - }); // Assemble table content + var tables = []; + each(groups, function (group, key) { + var categoryAxis = group.categoryAxis; + var valueAxis = group.valueAxis; + var valueAxisDim = valueAxis.dim; + var headers = [' '].concat(map(group.series, function (series) { + return series.name; + })); // @ts-ignore TODO Polar + + var columns = [categoryAxis.model.getCategories()]; + each(group.series, function (series) { + var rawData = series.getRawData(); + columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function (val) { + return val; + })); + }); // Assemble table content - var lines = [headers.join(ITEM_SPLITER)]; + var lines = [headers.join(ITEM_SPLITER)]; - for (var i = 0; i < columns[0].length; i++) { - var items = []; + for (var i = 0; i < columns[0].length; i++) { + var items = []; - for (var j = 0; j < columns.length; j++) { - items.push(columns[j][i]); - } + for (var j = 0; j < columns.length; j++) { + items.push(columns[j][i]); + } - lines.push(items.join(ITEM_SPLITER)); - } + lines.push(items.join(ITEM_SPLITER)); + } - tables.push(lines.join('\n')); - }); - return tables.join('\n\n' + BLOCK_SPLITER + '\n\n'); + tables.push(lines.join('\n')); + }); + return tables.join('\n\n' + BLOCK_SPLITER + '\n\n'); } /** * Assemble content of other series @@ -80670,37 +80670,37 @@ function assembleOtherSeries(series) { - return map(series, function (series) { - var data = series.getRawData(); - var lines = [series.name]; - var vals = []; - data.each(data.dimensions, function () { - var argLen = arguments.length; - var dataIndex = arguments[argLen - 1]; - var name = data.getName(dataIndex); + return map(series, function (series) { + var data = series.getRawData(); + var lines = [series.name]; + var vals = []; + data.each(data.dimensions, function () { + var argLen = arguments.length; + var dataIndex = arguments[argLen - 1]; + var name = data.getName(dataIndex); - for (var i = 0; i < argLen - 1; i++) { - vals[i] = arguments[i]; - } + for (var i = 0; i < argLen - 1; i++) { + vals[i] = arguments[i]; + } - lines.push((name ? name + ITEM_SPLITER : '') + vals.join(ITEM_SPLITER)); - }); - return lines.join('\n'); - }).join('\n\n' + BLOCK_SPLITER + '\n\n'); + lines.push((name ? name + ITEM_SPLITER : '') + vals.join(ITEM_SPLITER)); + }); + return lines.join('\n'); + }).join('\n\n' + BLOCK_SPLITER + '\n\n'); } function getContentFromModel(ecModel) { - var result = groupSeries(ecModel); - return { - value: filter([assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis), assembleOtherSeries(result.other)], function (str) { - return !!str.replace(/[\n\t\s]/g, ''); - }).join('\n\n' + BLOCK_SPLITER + '\n\n'), - meta: result.meta - }; + var result = groupSeries(ecModel); + return { + value: filter([assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis), assembleOtherSeries(result.other)], function (str) { + return !!str.replace(/[\n\t\s]/g, ''); + }).join('\n\n' + BLOCK_SPLITER + '\n\n'), + meta: result.meta + }; } function trim$1(str) { - return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); + return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); } /** * If a block is tsv format @@ -80708,12 +80708,12 @@ function isTSVFormat(block) { - // Simple method to find out if a block is tsv format - var firstLine = block.slice(0, block.indexOf('\n')); + // Simple method to find out if a block is tsv format + var firstLine = block.slice(0, block.indexOf('\n')); - if (firstLine.indexOf(ITEM_SPLITER) >= 0) { - return true; - } + if (firstLine.indexOf(ITEM_SPLITER) >= 0) { + return true; + } } var itemSplitRegex = new RegExp('[' + ITEM_SPLITER + ']+', 'g'); @@ -80723,317 +80723,317 @@ */ function parseTSVContents(tsv) { - var tsvLines = tsv.split(/\n+/g); - var headers = trim$1(tsvLines.shift()).split(itemSplitRegex); - var categories = []; - var series = map(headers, function (header) { - return { - name: header, - data: [] - }; - }); + var tsvLines = tsv.split(/\n+/g); + var headers = trim$1(tsvLines.shift()).split(itemSplitRegex); + var categories = []; + var series = map(headers, function (header) { + return { + name: header, + data: [] + }; + }); - for (var i = 0; i < tsvLines.length; i++) { - var items = trim$1(tsvLines[i]).split(itemSplitRegex); - categories.push(items.shift()); + for (var i = 0; i < tsvLines.length; i++) { + var items = trim$1(tsvLines[i]).split(itemSplitRegex); + categories.push(items.shift()); - for (var j = 0; j < items.length; j++) { - series[j] && (series[j].data[i] = items[j]); - } + for (var j = 0; j < items.length; j++) { + series[j] && (series[j].data[i] = items[j]); } + } - return { - series: series, - categories: categories - }; + return { + series: series, + categories: categories + }; } function parseListContents(str) { - var lines = str.split(/\n+/g); - var seriesName = trim$1(lines.shift()); - var data = []; - - for (var i = 0; i < lines.length; i++) { - // if line is empty, ignore it. - // there is a case that a user forgot to delete `\n`. - var line = trim$1(lines[i]); - - if (!line) { - continue; - } - - var items = line.split(itemSplitRegex); - var name_1 = ''; - var value = void 0; - var hasName = false; - - if (isNaN(items[0])) { - // First item is name - hasName = true; - name_1 = items[0]; - items = items.slice(1); - data[i] = { - name: name_1, - value: [] - }; - value = data[i].value; - } else { - value = data[i] = []; - } + var lines = str.split(/\n+/g); + var seriesName = trim$1(lines.shift()); + var data = []; + + for (var i = 0; i < lines.length; i++) { + // if line is empty, ignore it. + // there is a case that a user forgot to delete `\n`. + var line = trim$1(lines[i]); + + if (!line) { + continue; + } + + var items = line.split(itemSplitRegex); + var name_1 = ''; + var value = void 0; + var hasName = false; + + if (isNaN(items[0])) { + // First item is name + hasName = true; + name_1 = items[0]; + items = items.slice(1); + data[i] = { + name: name_1, + value: [] + }; + value = data[i].value; + } else { + value = data[i] = []; + } - for (var j = 0; j < items.length; j++) { - value.push(+items[j]); - } + for (var j = 0; j < items.length; j++) { + value.push(+items[j]); + } - if (value.length === 1) { - hasName ? data[i].value = value[0] : data[i] = value[0]; - } + if (value.length === 1) { + hasName ? data[i].value = value[0] : data[i] = value[0]; } + } - return { - name: seriesName, - data: data - }; + return { + name: seriesName, + data: data + }; } function parseContents(str, blockMetaList) { - var blocks = str.split(new RegExp('\n*' + BLOCK_SPLITER + '\n*', 'g')); - var newOption = { - series: [] - }; - each(blocks, function (block, idx) { - if (isTSVFormat(block)) { - var result = parseTSVContents(block); - var blockMeta = blockMetaList[idx]; - var axisKey = blockMeta.axisDim + 'Axis'; - - if (blockMeta) { - newOption[axisKey] = newOption[axisKey] || []; - newOption[axisKey][blockMeta.axisIndex] = { - data: result.categories - }; - newOption.series = newOption.series.concat(result.series); - } - } else { - var result = parseListContents(block); - newOption.series.push(result); - } - }); - return newOption; + var blocks = str.split(new RegExp('\n*' + BLOCK_SPLITER + '\n*', 'g')); + var newOption = { + series: [] + }; + each(blocks, function (block, idx) { + if (isTSVFormat(block)) { + var result = parseTSVContents(block); + var blockMeta = blockMetaList[idx]; + var axisKey = blockMeta.axisDim + 'Axis'; + + if (blockMeta) { + newOption[axisKey] = newOption[axisKey] || []; + newOption[axisKey][blockMeta.axisIndex] = { + data: result.categories + }; + newOption.series = newOption.series.concat(result.series); + } + } else { + var result = parseListContents(block); + newOption.series.push(result); + } + }); + return newOption; } var DataView = - /** @class */ - function (_super) { - __extends(DataView, _super); - - function DataView() { - return _super !== null && _super.apply(this, arguments) || this; - } - - DataView.prototype.onclick = function (ecModel, api) { - // FIXME: better way? - setTimeout(function () { - api.dispatchAction({ - type: 'hideTip' - }); - }); - var container = api.getDom(); - var model = this.model; - - if (this._dom) { - container.removeChild(this._dom); - } - - var root = document.createElement('div'); // use padding to avoid 5px whitespace - - root.style.cssText = 'position:absolute;top:0;bottom:0;left:0;right:0;padding:5px'; - root.style.backgroundColor = model.get('backgroundColor') || '#fff'; // Create elements - - var header = document.createElement('h4'); - var lang = model.get('lang') || []; - header.innerHTML = lang[0] || model.get('title'); - header.style.cssText = 'margin:10px 20px'; - header.style.color = model.get('textColor'); - var viewMain = document.createElement('div'); - var textarea = document.createElement('textarea'); - viewMain.style.cssText = 'overflow:auto'; - var optionToContent = model.get('optionToContent'); - var contentToOption = model.get('contentToOption'); - var result = getContentFromModel(ecModel); - - if (isFunction(optionToContent)) { - var htmlOrDom = optionToContent(api.getOption()); - - if (isString(htmlOrDom)) { - viewMain.innerHTML = htmlOrDom; - } else if (isDom(htmlOrDom)) { - viewMain.appendChild(htmlOrDom); - } - } else { - // Use default textarea - textarea.readOnly = model.get('readOnly'); - var style = textarea.style; // eslint-disable-next-line max-len - - style.cssText = 'display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none'; - style.color = model.get('textColor'); - style.borderColor = model.get('textareaBorderColor'); - style.backgroundColor = model.get('textareaColor'); - textarea.value = result.value; - viewMain.appendChild(textarea); - } - - var blockMetaList = result.meta; - var buttonContainer = document.createElement('div'); - buttonContainer.style.cssText = 'position:absolute;bottom:5px;left:0;right:0'; // eslint-disable-next-line max-len - - var buttonStyle = 'float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px'; - var closeButton = document.createElement('div'); - var refreshButton = document.createElement('div'); - buttonStyle += ';background-color:' + model.get('buttonColor'); - buttonStyle += ';color:' + model.get('buttonTextColor'); - var self = this; - - function close() { - container.removeChild(root); - self._dom = null; - } - - addEventListener(closeButton, 'click', close); - addEventListener(refreshButton, 'click', function () { - if (contentToOption == null && optionToContent != null || contentToOption != null && optionToContent == null) { - if ("development" !== 'production') { - // eslint-disable-next-line - warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.'); - } - - close(); - return; - } - - var newOption; + /** @class */ + function (_super) { + __extends(DataView, _super); + + function DataView() { + return _super !== null && _super.apply(this, arguments) || this; + } + + DataView.prototype.onclick = function (ecModel, api) { + // FIXME: better way? + setTimeout(function () { + api.dispatchAction({ + type: 'hideTip' + }); + }); + var container = api.getDom(); + var model = this.model; + + if (this._dom) { + container.removeChild(this._dom); + } + + var root = document.createElement('div'); // use padding to avoid 5px whitespace + + root.style.cssText = 'position:absolute;top:0;bottom:0;left:0;right:0;padding:5px'; + root.style.backgroundColor = model.get('backgroundColor') || '#fff'; // Create elements + + var header = document.createElement('h4'); + var lang = model.get('lang') || []; + header.innerHTML = lang[0] || model.get('title'); + header.style.cssText = 'margin:10px 20px'; + header.style.color = model.get('textColor'); + var viewMain = document.createElement('div'); + var textarea = document.createElement('textarea'); + viewMain.style.cssText = 'overflow:auto'; + var optionToContent = model.get('optionToContent'); + var contentToOption = model.get('contentToOption'); + var result = getContentFromModel(ecModel); + + if (isFunction(optionToContent)) { + var htmlOrDom = optionToContent(api.getOption()); + + if (isString(htmlOrDom)) { + viewMain.innerHTML = htmlOrDom; + } else if (isDom(htmlOrDom)) { + viewMain.appendChild(htmlOrDom); + } + } else { + // Use default textarea + textarea.readOnly = model.get('readOnly'); + var style = textarea.style; // eslint-disable-next-line max-len + + style.cssText = 'display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none'; + style.color = model.get('textColor'); + style.borderColor = model.get('textareaBorderColor'); + style.backgroundColor = model.get('textareaColor'); + textarea.value = result.value; + viewMain.appendChild(textarea); + } + + var blockMetaList = result.meta; + var buttonContainer = document.createElement('div'); + buttonContainer.style.cssText = 'position:absolute;bottom:5px;left:0;right:0'; // eslint-disable-next-line max-len + + var buttonStyle = 'float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px'; + var closeButton = document.createElement('div'); + var refreshButton = document.createElement('div'); + buttonStyle += ';background-color:' + model.get('buttonColor'); + buttonStyle += ';color:' + model.get('buttonTextColor'); + var self = this; - try { - if (isFunction(contentToOption)) { - newOption = contentToOption(viewMain, api.getOption()); - } else { - newOption = parseContents(textarea.value, blockMetaList); - } - } catch (e) { - close(); - throw new Error('Data view format error ' + e); - } + function close() { + container.removeChild(root); + self._dom = null; + } - if (newOption) { - api.dispatchAction({ - type: 'changeDataView', - newOption: newOption - }); - } + addEventListener(closeButton, 'click', close); + addEventListener(refreshButton, 'click', function () { + if (contentToOption == null && optionToContent != null || contentToOption != null && optionToContent == null) { + if ("development" !== 'production') { + // eslint-disable-next-line + warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.'); + } - close(); - }); - closeButton.innerHTML = lang[1]; - refreshButton.innerHTML = lang[2]; - refreshButton.style.cssText = closeButton.style.cssText = buttonStyle; - !model.get('readOnly') && buttonContainer.appendChild(refreshButton); - buttonContainer.appendChild(closeButton); - root.appendChild(header); - root.appendChild(viewMain); - root.appendChild(buttonContainer); - viewMain.style.height = container.clientHeight - 80 + 'px'; - container.appendChild(root); - this._dom = root; - }; + close(); + return; + } - DataView.prototype.remove = function (ecModel, api) { - this._dom && api.getDom().removeChild(this._dom); - }; + var newOption; - DataView.prototype.dispose = function (ecModel, api) { - this.remove(ecModel, api); - }; + try { + if (isFunction(contentToOption)) { + newOption = contentToOption(viewMain, api.getOption()); + } else { + newOption = parseContents(textarea.value, blockMetaList); + } + } catch (e) { + close(); + throw new Error('Data view format error ' + e); + } - DataView.getDefaultOption = function (ecModel) { - var defaultOption = { - show: true, - readOnly: false, - optionToContent: null, - contentToOption: null, - // eslint-disable-next-line - icon: 'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28', - title: ecModel.getLocaleModel().get(['toolbox', 'dataView', 'title']), - lang: ecModel.getLocaleModel().get(['toolbox', 'dataView', 'lang']), - backgroundColor: '#fff', - textColor: '#000', - textareaColor: '#fff', - textareaBorderColor: '#333', - buttonColor: '#c23531', - buttonTextColor: '#fff' - }; - return defaultOption; - }; + if (newOption) { + api.dispatchAction({ + type: 'changeDataView', + newOption: newOption + }); + } - return DataView; - }(ToolboxFeature); + close(); + }); + closeButton.innerHTML = lang[1]; + refreshButton.innerHTML = lang[2]; + refreshButton.style.cssText = closeButton.style.cssText = buttonStyle; + !model.get('readOnly') && buttonContainer.appendChild(refreshButton); + buttonContainer.appendChild(closeButton); + root.appendChild(header); + root.appendChild(viewMain); + root.appendChild(buttonContainer); + viewMain.style.height = container.clientHeight - 80 + 'px'; + container.appendChild(root); + this._dom = root; + }; + + DataView.prototype.remove = function (ecModel, api) { + this._dom && api.getDom().removeChild(this._dom); + }; + + DataView.prototype.dispose = function (ecModel, api) { + this.remove(ecModel, api); + }; + + DataView.getDefaultOption = function (ecModel) { + var defaultOption = { + show: true, + readOnly: false, + optionToContent: null, + contentToOption: null, + // eslint-disable-next-line + icon: 'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28', + title: ecModel.getLocaleModel().get(['toolbox', 'dataView', 'title']), + lang: ecModel.getLocaleModel().get(['toolbox', 'dataView', 'lang']), + backgroundColor: '#fff', + textColor: '#000', + textareaColor: '#fff', + textareaBorderColor: '#333', + buttonColor: '#c23531', + buttonTextColor: '#fff' + }; + return defaultOption; + }; + + return DataView; + }(ToolboxFeature); /** * @inner */ function tryMergeDataOption(newData, originalData) { - return map(newData, function (newVal, idx) { - var original = originalData && originalData[idx]; + return map(newData, function (newVal, idx) { + var original = originalData && originalData[idx]; - if (isObject(original) && !isArray(original)) { - var newValIsObject = isObject(newVal) && !isArray(newVal); + if (isObject(original) && !isArray(original)) { + var newValIsObject = isObject(newVal) && !isArray(newVal); - if (!newValIsObject) { - newVal = { - value: newVal - }; - } // original data has name but new data has no name + if (!newValIsObject) { + newVal = { + value: newVal + }; + } // original data has name but new data has no name - var shouldDeleteName = original.name != null && newVal.name == null; // Original data has option + var shouldDeleteName = original.name != null && newVal.name == null; // Original data has option - newVal = defaults(newVal, original); - shouldDeleteName && delete newVal.name; - return newVal; - } else { - return newVal; - } - }); + newVal = defaults(newVal, original); + shouldDeleteName && delete newVal.name; + return newVal; + } else { + return newVal; + } + }); } // TODO: SELF REGISTERED. registerAction({ - type: 'changeDataView', - event: 'dataViewChanged', - update: 'prepareAndUpdate' + type: 'changeDataView', + event: 'dataViewChanged', + update: 'prepareAndUpdate' }, function (payload, ecModel) { - var newSeriesOptList = []; - each(payload.newOption.series, function (seriesOpt) { - var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0]; - - if (!seriesModel) { - // New created series - // Geuss the series type - newSeriesOptList.push(extend({ - // Default is scatter - type: 'scatter' - }, seriesOpt)); - } else { - var originalData = seriesModel.get('data'); - newSeriesOptList.push({ - name: seriesOpt.name, - data: tryMergeDataOption(seriesOpt.data, originalData) - }); - } - }); - ecModel.mergeOption(defaults({ - series: newSeriesOptList - }, payload.newOption)); + var newSeriesOptList = []; + each(payload.newOption.series, function (seriesOpt) { + var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0]; + + if (!seriesModel) { + // New created series + // Geuss the series type + newSeriesOptList.push(extend({ + // Default is scatter + type: 'scatter' + }, seriesOpt)); + } else { + var originalData = seriesModel.get('data'); + newSeriesOptList.push({ + name: seriesOpt.name, + data: tryMergeDataOption(seriesOpt.data, originalData) + }); + } + }); + ecModel.mergeOption(defaults({ + series: newSeriesOptList + }, payload.newOption)); }); var each$9 = each; @@ -81044,63 +81044,63 @@ */ function push(ecModel, newSnapshot) { - var storedSnapshots = getStoreSnapshots(ecModel); // If previous dataZoom can not be found, - // complete an range with current range. + var storedSnapshots = getStoreSnapshots(ecModel); // If previous dataZoom can not be found, + // complete an range with current range. - each$9(newSnapshot, function (batchItem, dataZoomId) { - var i = storedSnapshots.length - 1; + each$9(newSnapshot, function (batchItem, dataZoomId) { + var i = storedSnapshots.length - 1; - for (; i >= 0; i--) { - var snapshot = storedSnapshots[i]; + for (; i >= 0; i--) { + var snapshot = storedSnapshots[i]; - if (snapshot[dataZoomId]) { - break; - } - } + if (snapshot[dataZoomId]) { + break; + } + } - if (i < 0) { - // No origin range set, create one by current range. - var dataZoomModel = ecModel.queryComponents({ - mainType: 'dataZoom', - subType: 'select', - id: dataZoomId - })[0]; + if (i < 0) { + // No origin range set, create one by current range. + var dataZoomModel = ecModel.queryComponents({ + mainType: 'dataZoom', + subType: 'select', + id: dataZoomId + })[0]; - if (dataZoomModel) { - var percentRange = dataZoomModel.getPercentRange(); - storedSnapshots[0][dataZoomId] = { - dataZoomId: dataZoomId, - start: percentRange[0], - end: percentRange[1] - }; - } - } - }); - storedSnapshots.push(newSnapshot); + if (dataZoomModel) { + var percentRange = dataZoomModel.getPercentRange(); + storedSnapshots[0][dataZoomId] = { + dataZoomId: dataZoomId, + start: percentRange[0], + end: percentRange[1] + }; + } + } + }); + storedSnapshots.push(newSnapshot); } function pop(ecModel) { - var storedSnapshots = getStoreSnapshots(ecModel); - var head = storedSnapshots[storedSnapshots.length - 1]; - storedSnapshots.length > 1 && storedSnapshots.pop(); // Find top for all dataZoom. + var storedSnapshots = getStoreSnapshots(ecModel); + var head = storedSnapshots[storedSnapshots.length - 1]; + storedSnapshots.length > 1 && storedSnapshots.pop(); // Find top for all dataZoom. - var snapshot = {}; - each$9(head, function (batchItem, dataZoomId) { - for (var i = storedSnapshots.length - 1; i >= 0; i--) { - batchItem = storedSnapshots[i][dataZoomId]; + var snapshot = {}; + each$9(head, function (batchItem, dataZoomId) { + for (var i = storedSnapshots.length - 1; i >= 0; i--) { + batchItem = storedSnapshots[i][dataZoomId]; - if (batchItem) { - snapshot[dataZoomId] = batchItem; - break; - } - } - }); - return snapshot; + if (batchItem) { + snapshot[dataZoomId] = batchItem; + break; + } + } + }); + return snapshot; } function clear$1(ecModel) { - inner$f(ecModel).snapshots = null; + inner$f(ecModel).snapshots = null; } function count(ecModel) { - return getStoreSnapshots(ecModel).length; + return getStoreSnapshots(ecModel).length; } /** * History length of each dataZoom may be different. @@ -81108,52 +81108,52 @@ */ function getStoreSnapshots(ecModel) { - var store = inner$f(ecModel); + var store = inner$f(ecModel); - if (!store.snapshots) { - store.snapshots = [{}]; - } + if (!store.snapshots) { + store.snapshots = [{}]; + } - return store.snapshots; + return store.snapshots; } var RestoreOption = - /** @class */ - function (_super) { - __extends(RestoreOption, _super); + /** @class */ + function (_super) { + __extends(RestoreOption, _super); - function RestoreOption() { - return _super !== null && _super.apply(this, arguments) || this; - } + function RestoreOption() { + return _super !== null && _super.apply(this, arguments) || this; + } - RestoreOption.prototype.onclick = function (ecModel, api) { - clear$1(ecModel); - api.dispatchAction({ - type: 'restore', - from: this.uid - }); - }; + RestoreOption.prototype.onclick = function (ecModel, api) { + clear$1(ecModel); + api.dispatchAction({ + type: 'restore', + from: this.uid + }); + }; - RestoreOption.getDefaultOption = function (ecModel) { - var defaultOption = { - show: true, - // eslint-disable-next-line - icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5', - title: ecModel.getLocaleModel().get(['toolbox', 'restore', 'title']) - }; - return defaultOption; - }; + RestoreOption.getDefaultOption = function (ecModel) { + var defaultOption = { + show: true, + // eslint-disable-next-line + icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5', + title: ecModel.getLocaleModel().get(['toolbox', 'restore', 'title']) + }; + return defaultOption; + }; - return RestoreOption; - }(ToolboxFeature); // TODO: SELF REGISTERED. + return RestoreOption; + }(ToolboxFeature); // TODO: SELF REGISTERED. registerAction({ - type: 'restore', - event: 'restore', - update: 'prepareAndUpdate' + type: 'restore', + event: 'restore', + update: 'prepareAndUpdate' }, function (payload, ecModel) { - ecModel.resetOption('recreate'); + ecModel.resetOption('recreate'); }); // how to genarialize to more coordinate systems. @@ -81161,693 +81161,693 @@ var INCLUDE_FINDER_MAIN_TYPES = ['grid', 'xAxis', 'yAxis', 'geo', 'graph', 'polar', 'radiusAxis', 'angleAxis', 'bmap']; var BrushTargetManager = - /** @class */ - function () { - /** - * @param finder contains Index/Id/Name of xAxis/yAxis/geo/grid - * Each can be {number|Array.}. like: {xAxisIndex: [3, 4]} - * @param opt.include include coordinate system types. - */ - function BrushTargetManager(finder, ecModel, opt) { - var _this = this; - - this._targetInfoList = []; - var foundCpts = parseFinder$1(ecModel, finder); - each(targetInfoBuilders, function (builder, type) { - if (!opt || !opt.include || indexOf(opt.include, type) >= 0) { - builder(foundCpts, _this._targetInfoList); - } - }); - } - - BrushTargetManager.prototype.setOutputRanges = function (areas, ecModel) { - this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) { - (area.coordRanges || (area.coordRanges = [])).push(coordRange); // area.coordRange is the first of area.coordRanges - - if (!area.coordRange) { - area.coordRange = coordRange; // In 'category' axis, coord to pixel is not reversible, so we can not - // rebuild range by coordRange accrately, which may bring trouble when - // brushing only one item. So we use __rangeOffset to rebuilding range - // by coordRange. And this it only used in brush component so it is no - // need to be adapted to coordRanges. + /** @class */ + function () { + /** + * @param finder contains Index/Id/Name of xAxis/yAxis/geo/grid + * Each can be {number|Array.}. like: {xAxisIndex: [3, 4]} + * @param opt.include include coordinate system types. + */ + function BrushTargetManager(finder, ecModel, opt) { + var _this = this; + + this._targetInfoList = []; + var foundCpts = parseFinder$1(ecModel, finder); + each(targetInfoBuilders, function (builder, type) { + if (!opt || !opt.include || indexOf(opt.include, type) >= 0) { + builder(foundCpts, _this._targetInfoList); + } + }); + } - var result = coordConvert[area.brushType](0, coordSys, coordRange); - area.__rangeOffset = { - offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]), - xyMinMax: result.xyMinMax - }; - } - }); - return areas; - }; + BrushTargetManager.prototype.setOutputRanges = function (areas, ecModel) { + this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) { + (area.coordRanges || (area.coordRanges = [])).push(coordRange); // area.coordRange is the first of area.coordRanges - BrushTargetManager.prototype.matchOutputRanges = function (areas, ecModel, cb) { - each(areas, function (area) { - var targetInfo = this.findTargetInfo(area, ecModel); + if (!area.coordRange) { + area.coordRange = coordRange; // In 'category' axis, coord to pixel is not reversible, so we can not + // rebuild range by coordRange accrately, which may bring trouble when + // brushing only one item. So we use __rangeOffset to rebuilding range + // by coordRange. And this it only used in brush component so it is no + // need to be adapted to coordRanges. - if (targetInfo && targetInfo !== true) { - each(targetInfo.coordSyses, function (coordSys) { - var result = coordConvert[area.brushType](1, coordSys, area.range, true); - cb(area, result.values, coordSys, ecModel); - }); - } - }, this); + var result = coordConvert[area.brushType](0, coordSys, coordRange); + area.__rangeOffset = { + offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]), + xyMinMax: result.xyMinMax }; - /** - * the `areas` is `BrushModel.areas`. - * Called in layout stage. - * convert `area.coordRange` to global range and set panelId to `area.range`. - */ + } + }); + return areas; + }; + BrushTargetManager.prototype.matchOutputRanges = function (areas, ecModel, cb) { + each(areas, function (area) { + var targetInfo = this.findTargetInfo(area, ecModel); - BrushTargetManager.prototype.setInputRanges = function (areas, ecModel) { - each(areas, function (area) { - var targetInfo = this.findTargetInfo(area, ecModel); + if (targetInfo && targetInfo !== true) { + each(targetInfo.coordSyses, function (coordSys) { + var result = coordConvert[area.brushType](1, coordSys, area.range, true); + cb(area, result.values, coordSys, ecModel); + }); + } + }, this); + }; + /** + * the `areas` is `BrushModel.areas`. + * Called in layout stage. + * convert `area.coordRange` to global range and set panelId to `area.range`. + */ - if ("development" !== 'production') { - assert(!targetInfo || targetInfo === true || area.coordRange, 'coordRange must be specified when coord index specified.'); - assert(!targetInfo || targetInfo !== true || area.range, 'range must be specified in global brush.'); - } - area.range = area.range || []; // convert coordRange to global range and set panelId. + BrushTargetManager.prototype.setInputRanges = function (areas, ecModel) { + each(areas, function (area) { + var targetInfo = this.findTargetInfo(area, ecModel); - if (targetInfo && targetInfo !== true) { - area.panelId = targetInfo.panelId; // (1) area.range shoule always be calculate from coordRange but does - // not keep its original value, for the sake of the dataZoom scenario, - // where area.coordRange remains unchanged but area.range may be changed. - // (2) Only support converting one coordRange to pixel range in brush - // component. So do not consider `coordRanges`. - // (3) About __rangeOffset, see comment above. + if ("development" !== 'production') { + assert(!targetInfo || targetInfo === true || area.coordRange, 'coordRange must be specified when coord index specified.'); + assert(!targetInfo || targetInfo !== true || area.range, 'range must be specified in global brush.'); + } - var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange); - var rangeOffset = area.__rangeOffset; - area.range = rangeOffset ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax)) : result.values; - } - }, this); - }; + area.range = area.range || []; // convert coordRange to global range and set panelId. - BrushTargetManager.prototype.makePanelOpts = function (api, getDefaultBrushType) { - return map(this._targetInfoList, function (targetInfo) { - var rect = targetInfo.getPanelRect(); - return { - panelId: targetInfo.panelId, - defaultBrushType: getDefaultBrushType ? getDefaultBrushType(targetInfo) : null, - clipPath: makeRectPanelClipPath(rect), - isTargetByCursor: makeRectIsTargetByCursor(rect, api, targetInfo.coordSysModel), - getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect) - }; - }); - }; + if (targetInfo && targetInfo !== true) { + area.panelId = targetInfo.panelId; // (1) area.range shoule always be calculate from coordRange but does + // not keep its original value, for the sake of the dataZoom scenario, + // where area.coordRange remains unchanged but area.range may be changed. + // (2) Only support converting one coordRange to pixel range in brush + // component. So do not consider `coordRanges`. + // (3) About __rangeOffset, see comment above. - BrushTargetManager.prototype.controlSeries = function (area, seriesModel, ecModel) { - // Check whether area is bound in coord, and series do not belong to that coord. - // If do not do this check, some brush (like lineX) will controll all axes. - var targetInfo = this.findTargetInfo(area, ecModel); - return targetInfo === true || targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0; - }; - /** - * If return Object, a coord found. - * If reutrn true, global found. - * Otherwise nothing found. - */ + var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange); + var rangeOffset = area.__rangeOffset; + area.range = rangeOffset ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax)) : result.values; + } + }, this); + }; + + BrushTargetManager.prototype.makePanelOpts = function (api, getDefaultBrushType) { + return map(this._targetInfoList, function (targetInfo) { + var rect = targetInfo.getPanelRect(); + return { + panelId: targetInfo.panelId, + defaultBrushType: getDefaultBrushType ? getDefaultBrushType(targetInfo) : null, + clipPath: makeRectPanelClipPath(rect), + isTargetByCursor: makeRectIsTargetByCursor(rect, api, targetInfo.coordSysModel), + getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect) + }; + }); + }; + + BrushTargetManager.prototype.controlSeries = function (area, seriesModel, ecModel) { + // Check whether area is bound in coord, and series do not belong to that coord. + // If do not do this check, some brush (like lineX) will controll all axes. + var targetInfo = this.findTargetInfo(area, ecModel); + return targetInfo === true || targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0; + }; + /** + * If return Object, a coord found. + * If reutrn true, global found. + * Otherwise nothing found. + */ - BrushTargetManager.prototype.findTargetInfo = function (area, ecModel) { - var targetInfoList = this._targetInfoList; - var foundCpts = parseFinder$1(ecModel, area); + BrushTargetManager.prototype.findTargetInfo = function (area, ecModel) { + var targetInfoList = this._targetInfoList; + var foundCpts = parseFinder$1(ecModel, area); - for (var i = 0; i < targetInfoList.length; i++) { - var targetInfo = targetInfoList[i]; - var areaPanelId = area.panelId; + for (var i = 0; i < targetInfoList.length; i++) { + var targetInfo = targetInfoList[i]; + var areaPanelId = area.panelId; - if (areaPanelId) { - if (targetInfo.panelId === areaPanelId) { - return targetInfo; - } - } else { - for (var j = 0; j < targetInfoMatchers.length; j++) { - if (targetInfoMatchers[j](foundCpts, targetInfo)) { - return targetInfo; - } - } - } - } + if (areaPanelId) { + if (targetInfo.panelId === areaPanelId) { + return targetInfo; + } + } else { + for (var j = 0; j < targetInfoMatchers.length; j++) { + if (targetInfoMatchers[j](foundCpts, targetInfo)) { + return targetInfo; + } + } + } + } - return true; - }; + return true; + }; - return BrushTargetManager; - }(); + return BrushTargetManager; + }(); function formatMinMax(minMax) { - minMax[0] > minMax[1] && minMax.reverse(); - return minMax; + minMax[0] > minMax[1] && minMax.reverse(); + return minMax; } function parseFinder$1(ecModel, finder) { - return parseFinder(ecModel, finder, { - includeMainTypes: INCLUDE_FINDER_MAIN_TYPES - }); + return parseFinder(ecModel, finder, { + includeMainTypes: INCLUDE_FINDER_MAIN_TYPES + }); } var targetInfoBuilders = { - grid: function (foundCpts, targetInfoList) { - var xAxisModels = foundCpts.xAxisModels; - var yAxisModels = foundCpts.yAxisModels; - var gridModels = foundCpts.gridModels; // Remove duplicated. - - var gridModelMap = createHashMap(); - var xAxesHas = {}; - var yAxesHas = {}; + grid: function (foundCpts, targetInfoList) { + var xAxisModels = foundCpts.xAxisModels; + var yAxisModels = foundCpts.yAxisModels; + var gridModels = foundCpts.gridModels; // Remove duplicated. - if (!xAxisModels && !yAxisModels && !gridModels) { - return; - } + var gridModelMap = createHashMap(); + var xAxesHas = {}; + var yAxesHas = {}; - each(xAxisModels, function (axisModel) { - var gridModel = axisModel.axis.grid.model; - gridModelMap.set(gridModel.id, gridModel); - xAxesHas[gridModel.id] = true; - }); - each(yAxisModels, function (axisModel) { - var gridModel = axisModel.axis.grid.model; - gridModelMap.set(gridModel.id, gridModel); - yAxesHas[gridModel.id] = true; - }); - each(gridModels, function (gridModel) { - gridModelMap.set(gridModel.id, gridModel); - xAxesHas[gridModel.id] = true; - yAxesHas[gridModel.id] = true; - }); - gridModelMap.each(function (gridModel) { - var grid = gridModel.coordinateSystem; - var cartesians = []; - each(grid.getCartesians(), function (cartesian, index) { - if (indexOf(xAxisModels, cartesian.getAxis('x').model) >= 0 || indexOf(yAxisModels, cartesian.getAxis('y').model) >= 0) { - cartesians.push(cartesian); - } - }); - targetInfoList.push({ - panelId: 'grid--' + gridModel.id, - gridModel: gridModel, - coordSysModel: gridModel, - // Use the first one as the representitive coordSys. - coordSys: cartesians[0], - coordSyses: cartesians, - getPanelRect: panelRectBuilders.grid, - xAxisDeclared: xAxesHas[gridModel.id], - yAxisDeclared: yAxesHas[gridModel.id] - }); - }); - }, - geo: function (foundCpts, targetInfoList) { - each(foundCpts.geoModels, function (geoModel) { - var coordSys = geoModel.coordinateSystem; - targetInfoList.push({ - panelId: 'geo--' + geoModel.id, - geoModel: geoModel, - coordSysModel: geoModel, - coordSys: coordSys, - coordSyses: [coordSys], - getPanelRect: panelRectBuilders.geo - }); - }); + if (!xAxisModels && !yAxisModels && !gridModels) { + return; } + + each(xAxisModels, function (axisModel) { + var gridModel = axisModel.axis.grid.model; + gridModelMap.set(gridModel.id, gridModel); + xAxesHas[gridModel.id] = true; + }); + each(yAxisModels, function (axisModel) { + var gridModel = axisModel.axis.grid.model; + gridModelMap.set(gridModel.id, gridModel); + yAxesHas[gridModel.id] = true; + }); + each(gridModels, function (gridModel) { + gridModelMap.set(gridModel.id, gridModel); + xAxesHas[gridModel.id] = true; + yAxesHas[gridModel.id] = true; + }); + gridModelMap.each(function (gridModel) { + var grid = gridModel.coordinateSystem; + var cartesians = []; + each(grid.getCartesians(), function (cartesian, index) { + if (indexOf(xAxisModels, cartesian.getAxis('x').model) >= 0 || indexOf(yAxisModels, cartesian.getAxis('y').model) >= 0) { + cartesians.push(cartesian); + } + }); + targetInfoList.push({ + panelId: 'grid--' + gridModel.id, + gridModel: gridModel, + coordSysModel: gridModel, + // Use the first one as the representitive coordSys. + coordSys: cartesians[0], + coordSyses: cartesians, + getPanelRect: panelRectBuilders.grid, + xAxisDeclared: xAxesHas[gridModel.id], + yAxisDeclared: yAxesHas[gridModel.id] + }); + }); + }, + geo: function (foundCpts, targetInfoList) { + each(foundCpts.geoModels, function (geoModel) { + var coordSys = geoModel.coordinateSystem; + targetInfoList.push({ + panelId: 'geo--' + geoModel.id, + geoModel: geoModel, + coordSysModel: geoModel, + coordSys: coordSys, + coordSyses: [coordSys], + getPanelRect: panelRectBuilders.geo + }); + }); + } }; var targetInfoMatchers = [// grid - function (foundCpts, targetInfo) { - var xAxisModel = foundCpts.xAxisModel; - var yAxisModel = foundCpts.yAxisModel; - var gridModel = foundCpts.gridModel; - !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model); - !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model); - return gridModel && gridModel === targetInfo.gridModel; - }, // geo - function (foundCpts, targetInfo) { - var geoModel = foundCpts.geoModel; - return geoModel && geoModel === targetInfo.geoModel; - }]; + function (foundCpts, targetInfo) { + var xAxisModel = foundCpts.xAxisModel; + var yAxisModel = foundCpts.yAxisModel; + var gridModel = foundCpts.gridModel; + !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model); + !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model); + return gridModel && gridModel === targetInfo.gridModel; + }, // geo + function (foundCpts, targetInfo) { + var geoModel = foundCpts.geoModel; + return geoModel && geoModel === targetInfo.geoModel; + }]; var panelRectBuilders = { - grid: function () { - // grid is not Transformable. - return this.coordSys.master.getRect().clone(); - }, - geo: function () { - var coordSys = this.coordSys; - var rect = coordSys.getBoundingRect().clone(); // geo roam and zoom transform - - rect.applyTransform(getTransform(coordSys)); - return rect; - } + grid: function () { + // grid is not Transformable. + return this.coordSys.master.getRect().clone(); + }, + geo: function () { + var coordSys = this.coordSys; + var rect = coordSys.getBoundingRect().clone(); // geo roam and zoom transform + + rect.applyTransform(getTransform(coordSys)); + return rect; + } }; var coordConvert = { - lineX: curry(axisConvert, 0), - lineY: curry(axisConvert, 1), - rect: function (to, coordSys, rangeOrCoordRange, clamp) { - var xminymin = to ? coordSys.pointToData([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp) : coordSys.dataToPoint([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp); - var xmaxymax = to ? coordSys.pointToData([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp) : coordSys.dataToPoint([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp); - var values = [formatMinMax([xminymin[0], xmaxymax[0]]), formatMinMax([xminymin[1], xmaxymax[1]])]; - return { - values: values, - xyMinMax: values - }; - }, - polygon: function (to, coordSys, rangeOrCoordRange, clamp) { - var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]]; - var values = map(rangeOrCoordRange, function (item) { - var p = to ? coordSys.pointToData(item, clamp) : coordSys.dataToPoint(item, clamp); - xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]); - xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]); - xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]); - xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]); - return p; - }); - return { - values: values, - xyMinMax: xyMinMax - }; - } + lineX: curry(axisConvert, 0), + lineY: curry(axisConvert, 1), + rect: function (to, coordSys, rangeOrCoordRange, clamp) { + var xminymin = to ? coordSys.pointToData([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp) : coordSys.dataToPoint([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp); + var xmaxymax = to ? coordSys.pointToData([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp) : coordSys.dataToPoint([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp); + var values = [formatMinMax([xminymin[0], xmaxymax[0]]), formatMinMax([xminymin[1], xmaxymax[1]])]; + return { + values: values, + xyMinMax: values + }; + }, + polygon: function (to, coordSys, rangeOrCoordRange, clamp) { + var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]]; + var values = map(rangeOrCoordRange, function (item) { + var p = to ? coordSys.pointToData(item, clamp) : coordSys.dataToPoint(item, clamp); + xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]); + xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]); + xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]); + xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]); + return p; + }); + return { + values: values, + xyMinMax: xyMinMax + }; + } }; function axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) { - if ("development" !== 'production') { - assert(coordSys.type === 'cartesian2d', 'lineX/lineY brush is available only in cartesian2d.'); - } - - var axis = coordSys.getAxis(['x', 'y'][axisNameIndex]); - var values = formatMinMax(map([0, 1], function (i) { - return to ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i]), true) : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i])); - })); - var xyMinMax = []; - xyMinMax[axisNameIndex] = values; - xyMinMax[1 - axisNameIndex] = [NaN, NaN]; - return { - values: values, - xyMinMax: xyMinMax - }; + if ("development" !== 'production') { + assert(coordSys.type === 'cartesian2d', 'lineX/lineY brush is available only in cartesian2d.'); + } + + var axis = coordSys.getAxis(['x', 'y'][axisNameIndex]); + var values = formatMinMax(map([0, 1], function (i) { + return to ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i]), true) : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i])); + })); + var xyMinMax = []; + xyMinMax[axisNameIndex] = values; + xyMinMax[1 - axisNameIndex] = [NaN, NaN]; + return { + values: values, + xyMinMax: xyMinMax + }; } var diffProcessor = { - lineX: curry(axisDiffProcessor, 0), - lineY: curry(axisDiffProcessor, 1), - rect: function (values, refer, scales) { - return [[values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]], [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]]]; - }, - polygon: function (values, refer, scales) { - return map(values, function (item, idx) { - return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]]; - }); - } + lineX: curry(axisDiffProcessor, 0), + lineY: curry(axisDiffProcessor, 1), + rect: function (values, refer, scales) { + return [[values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]], [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]]]; + }, + polygon: function (values, refer, scales) { + return map(values, function (item, idx) { + return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]]; + }); + } }; function axisDiffProcessor(axisNameIndex, values, refer, scales) { - return [values[0] - scales[axisNameIndex] * refer[0], values[1] - scales[axisNameIndex] * refer[1]]; + return [values[0] - scales[axisNameIndex] * refer[0], values[1] - scales[axisNameIndex] * refer[1]]; } // We have to process scale caused by dataZoom manually, // although it might be not accurate. // Return [0~1, 0~1] function getScales(xyMinMaxCurr, xyMinMaxOrigin) { - var sizeCurr = getSize$1(xyMinMaxCurr); - var sizeOrigin = getSize$1(xyMinMaxOrigin); - var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]]; - isNaN(scales[0]) && (scales[0] = 1); - isNaN(scales[1]) && (scales[1] = 1); - return scales; + var sizeCurr = getSize$1(xyMinMaxCurr); + var sizeOrigin = getSize$1(xyMinMaxOrigin); + var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]]; + isNaN(scales[0]) && (scales[0] = 1); + isNaN(scales[1]) && (scales[1] = 1); + return scales; } function getSize$1(xyMinMax) { - return xyMinMax ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]] : [NaN, NaN]; + return xyMinMax ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]] : [NaN, NaN]; } var each$a = each; var DATA_ZOOM_ID_BASE = makeInternalComponentId('toolbox-dataZoom_'); var DataZoomFeature = - /** @class */ - function (_super) { - __extends(DataZoomFeature, _super); - - function DataZoomFeature() { - return _super !== null && _super.apply(this, arguments) || this; - } + /** @class */ + function (_super) { + __extends(DataZoomFeature, _super); - DataZoomFeature.prototype.render = function (featureModel, ecModel, api, payload) { - if (!this._brushController) { - this._brushController = new BrushController(api.getZr()); + function DataZoomFeature() { + return _super !== null && _super.apply(this, arguments) || this; + } - this._brushController.on('brush', bind(this._onBrush, this)).mount(); - } - - updateZoomBtnStatus(featureModel, ecModel, this, payload, api); - updateBackBtnStatus(featureModel, ecModel); - }; - - DataZoomFeature.prototype.onclick = function (ecModel, api, type) { - handlers$1[type].call(this); - }; - - DataZoomFeature.prototype.remove = function (ecModel, api) { - this._brushController && this._brushController.unmount(); - }; + DataZoomFeature.prototype.render = function (featureModel, ecModel, api, payload) { + if (!this._brushController) { + this._brushController = new BrushController(api.getZr()); - DataZoomFeature.prototype.dispose = function (ecModel, api) { - this._brushController && this._brushController.dispose(); - }; + this._brushController.on('brush', bind(this._onBrush, this)).mount(); + } - DataZoomFeature.prototype._onBrush = function (eventParam) { - var areas = eventParam.areas; + updateZoomBtnStatus(featureModel, ecModel, this, payload, api); + updateBackBtnStatus(featureModel, ecModel); + }; - if (!eventParam.isEnd || !areas.length) { - return; - } + DataZoomFeature.prototype.onclick = function (ecModel, api, type) { + handlers$1[type].call(this); + }; - var snapshot = {}; - var ecModel = this.ecModel; + DataZoomFeature.prototype.remove = function (ecModel, api) { + this._brushController && this._brushController.unmount(); + }; - this._brushController.updateCovers([]); // remove cover + DataZoomFeature.prototype.dispose = function (ecModel, api) { + this._brushController && this._brushController.dispose(); + }; + DataZoomFeature.prototype._onBrush = function (eventParam) { + var areas = eventParam.areas; - var brushTargetManager = new BrushTargetManager(makeAxisFinder(this.model), ecModel, { - include: ['grid'] - }); - brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) { - if (coordSys.type !== 'cartesian2d') { - return; - } + if (!eventParam.isEnd || !areas.length) { + return; + } - var brushType = area.brushType; + var snapshot = {}; + var ecModel = this.ecModel; - if (brushType === 'rect') { - setBatch('x', coordSys, coordRange[0]); - setBatch('y', coordSys, coordRange[1]); - } else { - setBatch({ - lineX: 'x', - lineY: 'y' - }[brushType], coordSys, coordRange); - } - }); - push(ecModel, snapshot); + this._brushController.updateCovers([]); // remove cover - this._dispatchZoomAction(snapshot); - function setBatch(dimName, coordSys, minMax) { - var axis = coordSys.getAxis(dimName); - var axisModel = axis.model; - var dataZoomModel = findDataZoom(dimName, axisModel, ecModel); // Restrict range. + var brushTargetManager = new BrushTargetManager(makeAxisFinder(this.model), ecModel, { + include: ['grid'] + }); + brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) { + if (coordSys.type !== 'cartesian2d') { + return; + } + + var brushType = area.brushType; + + if (brushType === 'rect') { + setBatch('x', coordSys, coordRange[0]); + setBatch('y', coordSys, coordRange[1]); + } else { + setBatch({ + lineX: 'x', + lineY: 'y' + }[brushType], coordSys, coordRange); + } + }); + push(ecModel, snapshot); - var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan(); + this._dispatchZoomAction(snapshot); - if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) { - minMax = sliderMove(0, minMax.slice(), axis.scale.getExtent(), 0, minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan); - } + function setBatch(dimName, coordSys, minMax) { + var axis = coordSys.getAxis(dimName); + var axisModel = axis.model; + var dataZoomModel = findDataZoom(dimName, axisModel, ecModel); // Restrict range. - dataZoomModel && (snapshot[dataZoomModel.id] = { - dataZoomId: dataZoomModel.id, - startValue: minMax[0], - endValue: minMax[1] - }); - } + var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan(); - function findDataZoom(dimName, axisModel, ecModel) { - var found; - ecModel.eachComponent({ - mainType: 'dataZoom', - subType: 'select' - }, function (dzModel) { - var has = dzModel.getAxisModel(dimName, axisModel.componentIndex); - has && (found = dzModel); - }); - return found; - } - }; + if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) { + minMax = sliderMove(0, minMax.slice(), axis.scale.getExtent(), 0, minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan); + } - DataZoomFeature.prototype._dispatchZoomAction = function (snapshot) { - var batch = []; // Convert from hash map to array. + dataZoomModel && (snapshot[dataZoomModel.id] = { + dataZoomId: dataZoomModel.id, + startValue: minMax[0], + endValue: minMax[1] + }); + } - each$a(snapshot, function (batchItem, dataZoomId) { - batch.push(clone(batchItem)); - }); - batch.length && this.api.dispatchAction({ - type: 'dataZoom', - from: this.uid, - batch: batch - }); - }; + function findDataZoom(dimName, axisModel, ecModel) { + var found; + ecModel.eachComponent({ + mainType: 'dataZoom', + subType: 'select' + }, function (dzModel) { + var has = dzModel.getAxisModel(dimName, axisModel.componentIndex); + has && (found = dzModel); + }); + return found; + } + }; - DataZoomFeature.getDefaultOption = function (ecModel) { - var defaultOption = { - show: true, - filterMode: 'filter', - // Icon group - 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' - }, - // `zoom`, `back` - title: ecModel.getLocaleModel().get(['toolbox', 'dataZoom', 'title']), - brushStyle: { - borderWidth: 0, - color: 'rgba(210,219,238,0.2)' - } - }; - return defaultOption; - }; + DataZoomFeature.prototype._dispatchZoomAction = function (snapshot) { + var batch = []; // Convert from hash map to array. - return DataZoomFeature; - }(ToolboxFeature); + each$a(snapshot, function (batchItem, dataZoomId) { + batch.push(clone(batchItem)); + }); + batch.length && this.api.dispatchAction({ + type: 'dataZoom', + from: this.uid, + batch: batch + }); + }; + + DataZoomFeature.getDefaultOption = function (ecModel) { + var defaultOption = { + show: true, + filterMode: 'filter', + // Icon group + 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' + }, + // `zoom`, `back` + title: ecModel.getLocaleModel().get(['toolbox', 'dataZoom', 'title']), + brushStyle: { + borderWidth: 0, + color: 'rgba(210,219,238,0.2)' + } + }; + return defaultOption; + }; + + return DataZoomFeature; + }(ToolboxFeature); var handlers$1 = { - zoom: function () { - var nextActive = !this._isZoomActive; - this.api.dispatchAction({ - type: 'takeGlobalCursor', - key: 'dataZoomSelect', - dataZoomSelectActive: nextActive - }); - }, - back: function () { - this._dispatchZoomAction(pop(this.ecModel)); - } + zoom: function () { + var nextActive = !this._isZoomActive; + this.api.dispatchAction({ + type: 'takeGlobalCursor', + key: 'dataZoomSelect', + dataZoomSelectActive: nextActive + }); + }, + back: function () { + this._dispatchZoomAction(pop(this.ecModel)); + } }; function makeAxisFinder(dzFeatureModel) { - var setting = { - xAxisIndex: dzFeatureModel.get('xAxisIndex', true), - yAxisIndex: dzFeatureModel.get('yAxisIndex', true), - xAxisId: dzFeatureModel.get('xAxisId', true), - yAxisId: dzFeatureModel.get('yAxisId', true) - }; // If both `xAxisIndex` `xAxisId` not set, it means 'all'. - // If both `yAxisIndex` `yAxisId` not set, it means 'all'. - // Some old cases set like this below to close yAxis control but leave xAxis control: - // `{ feature: { dataZoom: { yAxisIndex: false } }`. + var setting = { + xAxisIndex: dzFeatureModel.get('xAxisIndex', true), + yAxisIndex: dzFeatureModel.get('yAxisIndex', true), + xAxisId: dzFeatureModel.get('xAxisId', true), + yAxisId: dzFeatureModel.get('yAxisId', true) + }; // If both `xAxisIndex` `xAxisId` not set, it means 'all'. + // If both `yAxisIndex` `yAxisId` not set, it means 'all'. + // Some old cases set like this below to close yAxis control but leave xAxis control: + // `{ feature: { dataZoom: { yAxisIndex: false } }`. - if (setting.xAxisIndex == null && setting.xAxisId == null) { - setting.xAxisIndex = 'all'; - } + if (setting.xAxisIndex == null && setting.xAxisId == null) { + setting.xAxisIndex = 'all'; + } - if (setting.yAxisIndex == null && setting.yAxisId == null) { - setting.yAxisIndex = 'all'; - } + if (setting.yAxisIndex == null && setting.yAxisId == null) { + setting.yAxisIndex = 'all'; + } - return setting; + return setting; } function updateBackBtnStatus(featureModel, ecModel) { - featureModel.setIconStatus('back', count(ecModel) > 1 ? 'emphasis' : 'normal'); + featureModel.setIconStatus('back', count(ecModel) > 1 ? 'emphasis' : 'normal'); } function updateZoomBtnStatus(featureModel, ecModel, view, payload, api) { - var zoomActive = view._isZoomActive; + var zoomActive = view._isZoomActive; - if (payload && payload.type === 'takeGlobalCursor') { - zoomActive = payload.key === 'dataZoomSelect' ? payload.dataZoomSelectActive : false; - } + if (payload && payload.type === 'takeGlobalCursor') { + zoomActive = payload.key === 'dataZoomSelect' ? payload.dataZoomSelectActive : false; + } - view._isZoomActive = zoomActive; - featureModel.setIconStatus('zoom', zoomActive ? 'emphasis' : 'normal'); - var brushTargetManager = new BrushTargetManager(makeAxisFinder(featureModel), ecModel, { - include: ['grid'] - }); - var panels = brushTargetManager.makePanelOpts(api, function (targetInfo) { - return targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared ? 'lineX' : !targetInfo.xAxisDeclared && targetInfo.yAxisDeclared ? 'lineY' : 'rect'; - }); + view._isZoomActive = zoomActive; + featureModel.setIconStatus('zoom', zoomActive ? 'emphasis' : 'normal'); + var brushTargetManager = new BrushTargetManager(makeAxisFinder(featureModel), ecModel, { + include: ['grid'] + }); + var panels = brushTargetManager.makePanelOpts(api, function (targetInfo) { + return targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared ? 'lineX' : !targetInfo.xAxisDeclared && targetInfo.yAxisDeclared ? 'lineY' : 'rect'; + }); - view._brushController.setPanels(panels).enableBrush(zoomActive && panels.length ? { - brushType: 'auto', - brushStyle: featureModel.getModel('brushStyle').getItemStyle() - } : false); + view._brushController.setPanels(panels).enableBrush(zoomActive && panels.length ? { + brushType: 'auto', + brushStyle: featureModel.getModel('brushStyle').getItemStyle() + } : false); } registerInternalOptionCreator('dataZoom', function (ecModel) { - var toolboxModel = ecModel.getComponent('toolbox', 0); - var featureDataZoomPath = ['feature', 'dataZoom']; - - if (!toolboxModel || toolboxModel.get(featureDataZoomPath) == null) { - return; - } - - var dzFeatureModel = toolboxModel.getModel(featureDataZoomPath); - var dzOptions = []; - var finder = makeAxisFinder(dzFeatureModel); - var finderResult = parseFinder(ecModel, finder); - each$a(finderResult.xAxisModels, function (axisModel) { - return buildInternalOptions(axisModel, 'xAxis', 'xAxisIndex'); - }); - each$a(finderResult.yAxisModels, function (axisModel) { - return buildInternalOptions(axisModel, 'yAxis', 'yAxisIndex'); - }); - - function buildInternalOptions(axisModel, axisMainType, axisIndexPropName) { - var axisIndex = axisModel.componentIndex; - var newOpt = { - type: 'select', - $fromToolbox: true, - // Default to be filter - filterMode: dzFeatureModel.get('filterMode', true) || 'filter', - // Id for merge mapping. - id: DATA_ZOOM_ID_BASE + axisMainType + axisIndex - }; - newOpt[axisIndexPropName] = axisIndex; - dzOptions.push(newOpt); - } + var toolboxModel = ecModel.getComponent('toolbox', 0); + var featureDataZoomPath = ['feature', 'dataZoom']; - return dzOptions; + if (!toolboxModel || toolboxModel.get(featureDataZoomPath) == null) { + return; + } + + var dzFeatureModel = toolboxModel.getModel(featureDataZoomPath); + var dzOptions = []; + var finder = makeAxisFinder(dzFeatureModel); + var finderResult = parseFinder(ecModel, finder); + each$a(finderResult.xAxisModels, function (axisModel) { + return buildInternalOptions(axisModel, 'xAxis', 'xAxisIndex'); + }); + each$a(finderResult.yAxisModels, function (axisModel) { + return buildInternalOptions(axisModel, 'yAxis', 'yAxisIndex'); + }); + + function buildInternalOptions(axisModel, axisMainType, axisIndexPropName) { + var axisIndex = axisModel.componentIndex; + var newOpt = { + type: 'select', + $fromToolbox: true, + // Default to be filter + filterMode: dzFeatureModel.get('filterMode', true) || 'filter', + // Id for merge mapping. + id: DATA_ZOOM_ID_BASE + axisMainType + axisIndex + }; + newOpt[axisIndexPropName] = axisIndex; + dzOptions.push(newOpt); + } + + return dzOptions; }); function install$z(registers) { - registers.registerComponentModel(ToolboxModel); - registers.registerComponentView(ToolboxView); - registerFeature('saveAsImage', SaveAsImage); - registerFeature('magicType', MagicType); - registerFeature('dataView', DataView); - registerFeature('dataZoom', DataZoomFeature); - registerFeature('restore', RestoreOption); - use(install$y); + registers.registerComponentModel(ToolboxModel); + registers.registerComponentView(ToolboxView); + registerFeature('saveAsImage', SaveAsImage); + registerFeature('magicType', MagicType); + registerFeature('dataView', DataView); + registerFeature('dataZoom', DataZoomFeature); + registerFeature('restore', RestoreOption); + use(install$y); } var TooltipModel = - /** @class */ - function (_super) { - __extends(TooltipModel, _super); + /** @class */ + function (_super) { + __extends(TooltipModel, _super); - function TooltipModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function TooltipModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = TooltipModel.type; - return _this; - } + _this.type = TooltipModel.type; + return _this; + } - TooltipModel.type = 'tooltip'; - TooltipModel.dependencies = ['axisPointer']; - TooltipModel.defaultOption = { - // zlevel: 0, - z: 60, - show: true, - // tooltip main content - showContent: true, - // 'trigger' only works on coordinate system. - // 'item' | 'axis' | 'none' - trigger: 'item', - // 'click' | 'mousemove' | 'none' - triggerOn: 'mousemove|click', - alwaysShowContent: false, - displayMode: 'single', - renderMode: 'auto', - // whether restraint content inside viewRect. - // If renderMode: 'richText', default true. - // If renderMode: 'html', defaut false (for backward compat). - confine: null, - showDelay: 0, - hideDelay: 100, - // Animation transition time, unit is second - transitionDuration: 0.4, - enterable: false, - backgroundColor: '#fff', - // box shadow - shadowBlur: 10, - shadowColor: 'rgba(0, 0, 0, .2)', - shadowOffsetX: 1, - shadowOffsetY: 2, - // tooltip border radius, unit is px, default is 4 - borderRadius: 4, - // tooltip border width, unit is px, default is 0 (no border) - borderWidth: 1, - // Tooltip inside padding, default is 5 for all direction - // Array is allowed to set up, right, bottom, left, same with css - // The default value: See `tooltip/tooltipMarkup.ts#getPaddingFromTooltipModel`. - padding: null, - // Extra css text - extraCssText: '', - // axis indicator, trigger by axis - axisPointer: { - // default is line - // legal values: 'line' | 'shadow' | 'cross' - type: 'line', - // Valid when type is line, appoint tooltip line locate on which line. Optional - // legal values: 'x' | 'y' | 'angle' | 'radius' | 'auto' - // default is 'auto', chose the axis which type is category. - // for multiply y axis, cartesian coord chose x axis, polar chose angle axis - axis: 'auto', - animation: 'auto', - animationDurationUpdate: 200, - animationEasingUpdate: 'exponentialOut', - crossStyle: { - color: '#999', - width: 1, - type: 'dashed', - // TODO formatter - textStyle: {} - } // lineStyle and shadowStyle should not be specified here, - // otherwise it will always override those styles on option.axisPointer. + TooltipModel.type = 'tooltip'; + TooltipModel.dependencies = ['axisPointer']; + TooltipModel.defaultOption = { + // zlevel: 0, + z: 60, + show: true, + // tooltip main content + showContent: true, + // 'trigger' only works on coordinate system. + // 'item' | 'axis' | 'none' + trigger: 'item', + // 'click' | 'mousemove' | 'none' + triggerOn: 'mousemove|click', + alwaysShowContent: false, + displayMode: 'single', + renderMode: 'auto', + // whether restraint content inside viewRect. + // If renderMode: 'richText', default true. + // If renderMode: 'html', defaut false (for backward compat). + confine: null, + showDelay: 0, + hideDelay: 100, + // Animation transition time, unit is second + transitionDuration: 0.4, + enterable: false, + backgroundColor: '#fff', + // box shadow + shadowBlur: 10, + shadowColor: 'rgba(0, 0, 0, .2)', + shadowOffsetX: 1, + shadowOffsetY: 2, + // tooltip border radius, unit is px, default is 4 + borderRadius: 4, + // tooltip border width, unit is px, default is 0 (no border) + borderWidth: 1, + // Tooltip inside padding, default is 5 for all direction + // Array is allowed to set up, right, bottom, left, same with css + // The default value: See `tooltip/tooltipMarkup.ts#getPaddingFromTooltipModel`. + padding: null, + // Extra css text + extraCssText: '', + // axis indicator, trigger by axis + axisPointer: { + // default is line + // legal values: 'line' | 'shadow' | 'cross' + type: 'line', + // Valid when type is line, appoint tooltip line locate on which line. Optional + // legal values: 'x' | 'y' | 'angle' | 'radius' | 'auto' + // default is 'auto', chose the axis which type is category. + // for multiply y axis, cartesian coord chose x axis, polar chose angle axis + axis: 'auto', + animation: 'auto', + animationDurationUpdate: 200, + animationEasingUpdate: 'exponentialOut', + crossStyle: { + color: '#999', + width: 1, + type: 'dashed', + // TODO formatter + textStyle: {} + } // lineStyle and shadowStyle should not be specified here, + // otherwise it will always override those styles on option.axisPointer. - }, - textStyle: { - color: '#666', - fontSize: 14 - } - }; - return TooltipModel; - }(ComponentModel); + }, + textStyle: { + color: '#666', + fontSize: 14 + } + }; + return TooltipModel; + }(ComponentModel); /* global document */ function shouldTooltipConfine(tooltipModel) { - var confineOption = tooltipModel.get('confine'); - return confineOption != null ? !!confineOption // In richText mode, the outside part can not be visible. - : tooltipModel.get('renderMode') === 'richText'; + var confineOption = tooltipModel.get('confine'); + return confineOption != null ? !!confineOption // In richText mode, the outside part can not be visible. + : tooltipModel.get('renderMode') === 'richText'; } function testStyle(styleProps) { - if (!env.domSupported) { - return; - } + if (!env.domSupported) { + return; + } - var style = document.documentElement.style; + var style = document.documentElement.style; - for (var i = 0, len = styleProps.length; i < len; i++) { - if (styleProps[i] in style) { - return styleProps[i]; - } + for (var i = 0, len = styleProps.length; i < len; i++) { + if (styleProps[i] in style) { + return styleProps[i]; } + } } var TRANSFORM_VENDOR = testStyle(['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform']); var TRANSITION_VENDOR = testStyle(['webkitTransition', 'transition', 'OTransition', 'MozTransition', 'msTransition']); function toCSSVendorPrefix(styleVendor, styleProp) { - if (!styleVendor) { - return styleProp; - } + if (!styleVendor) { + return styleProp; + } - styleProp = toCamelCase(styleProp, true); - var idx = styleVendor.indexOf(styleProp); - styleVendor = idx === -1 ? styleProp : "-" + styleVendor.slice(0, idx) + "-" + styleProp; - return styleVendor.toLowerCase(); + styleProp = toCamelCase(styleProp, true); + var idx = styleVendor.indexOf(styleProp); + styleVendor = idx === -1 ? styleProp : "-" + styleVendor.slice(0, idx) + "-" + styleProp; + return styleVendor.toLowerCase(); } function getComputedStyle(el, style) { - var stl = el.currentStyle || document.defaultView && document.defaultView.getComputedStyle(el); - return stl ? style ? stl[style] : stl : null; + var stl = el.currentStyle || document.defaultView && document.defaultView.getComputedStyle(el); + return stl ? style ? stl[style] : stl : null; } /* global document, window */ @@ -81858,69 +81858,69 @@ var gCssText = "position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;" + (env.transform3dSupported ? 'will-change:transform;' : ''); function mirrorPos(pos) { - pos = pos === 'left' ? 'right' : pos === 'right' ? 'left' : pos === 'top' ? 'bottom' : 'top'; - return pos; + pos = pos === 'left' ? 'right' : pos === 'right' ? 'left' : pos === 'top' ? 'bottom' : 'top'; + return pos; } function assembleArrow(tooltipModel, borderColor, arrowPosition) { - if (!isString(arrowPosition) || arrowPosition === 'inside') { - return ''; - } - - var backgroundColor = tooltipModel.get('backgroundColor'); - var borderWidth = tooltipModel.get('borderWidth'); - borderColor = convertToColorString(borderColor); - var arrowPos = mirrorPos(arrowPosition); - var arrowSize = Math.max(Math.round(borderWidth) * 1.5, 6); - var positionStyle = ''; - var transformStyle = CSS_TRANSFORM_VENDOR + ':'; - var rotateDeg; - - if (indexOf(['left', 'right'], arrowPos) > -1) { - positionStyle += 'top:50%'; - transformStyle += "translateY(-50%) rotate(" + (rotateDeg = arrowPos === 'left' ? -225 : -45) + "deg)"; - } else { - positionStyle += 'left:50%'; - transformStyle += "translateX(-50%) rotate(" + (rotateDeg = arrowPos === 'top' ? 225 : 45) + "deg)"; - } - - var rotateRadian = rotateDeg * Math.PI / 180; - var arrowWH = arrowSize + borderWidth; - var rotatedWH = arrowWH * Math.abs(Math.cos(rotateRadian)) + arrowWH * Math.abs(Math.sin(rotateRadian)); - var arrowOffset = Math.round(((rotatedWH - Math.SQRT2 * borderWidth) / 2 + Math.SQRT2 * borderWidth - (rotatedWH - arrowWH) / 2) * 100) / 100; - positionStyle += ";" + arrowPos + ":-" + arrowOffset + "px"; - var borderStyle = borderColor + " solid " + borderWidth + "px;"; - var styleCss = ["position:absolute;width:" + arrowSize + "px;height:" + arrowSize + "px;", positionStyle + ";" + transformStyle + ";", "border-bottom:" + borderStyle, "border-right:" + borderStyle, "background-color:" + backgroundColor + ";"]; - return "
              "; + if (!isString(arrowPosition) || arrowPosition === 'inside') { + return ''; + } + + var backgroundColor = tooltipModel.get('backgroundColor'); + var borderWidth = tooltipModel.get('borderWidth'); + borderColor = convertToColorString(borderColor); + var arrowPos = mirrorPos(arrowPosition); + var arrowSize = Math.max(Math.round(borderWidth) * 1.5, 6); + var positionStyle = ''; + var transformStyle = CSS_TRANSFORM_VENDOR + ':'; + var rotateDeg; + + if (indexOf(['left', 'right'], arrowPos) > -1) { + positionStyle += 'top:50%'; + transformStyle += "translateY(-50%) rotate(" + (rotateDeg = arrowPos === 'left' ? -225 : -45) + "deg)"; + } else { + positionStyle += 'left:50%'; + transformStyle += "translateX(-50%) rotate(" + (rotateDeg = arrowPos === 'top' ? 225 : 45) + "deg)"; + } + + var rotateRadian = rotateDeg * Math.PI / 180; + var arrowWH = arrowSize + borderWidth; + var rotatedWH = arrowWH * Math.abs(Math.cos(rotateRadian)) + arrowWH * Math.abs(Math.sin(rotateRadian)); + var arrowOffset = Math.round(((rotatedWH - Math.SQRT2 * borderWidth) / 2 + Math.SQRT2 * borderWidth - (rotatedWH - arrowWH) / 2) * 100) / 100; + positionStyle += ";" + arrowPos + ":-" + arrowOffset + "px"; + var borderStyle = borderColor + " solid " + borderWidth + "px;"; + var styleCss = ["position:absolute;width:" + arrowSize + "px;height:" + arrowSize + "px;", positionStyle + ";" + transformStyle + ";", "border-bottom:" + borderStyle, "border-right:" + borderStyle, "background-color:" + backgroundColor + ";"]; + return "
              "; } function assembleTransition(duration, onlyFade) { - var transitionCurve = 'cubic-bezier(0.23,1,0.32,1)'; - var transitionOption = " " + duration / 2 + "s " + transitionCurve; - var transitionText = "opacity" + transitionOption + ",visibility" + transitionOption; + var transitionCurve = 'cubic-bezier(0.23,1,0.32,1)'; + var transitionOption = " " + duration / 2 + "s " + transitionCurve; + var transitionText = "opacity" + transitionOption + ",visibility" + transitionOption; - if (!onlyFade) { - transitionOption = " " + duration + "s " + transitionCurve; - transitionText += env.transformSupported ? "," + CSS_TRANSFORM_VENDOR + transitionOption : ",left" + transitionOption + ",top" + transitionOption; - } + if (!onlyFade) { + transitionOption = " " + duration + "s " + transitionCurve; + transitionText += env.transformSupported ? "," + CSS_TRANSFORM_VENDOR + transitionOption : ",left" + transitionOption + ",top" + transitionOption; + } - return CSS_TRANSITION_VENDOR + ':' + transitionText; + return CSS_TRANSITION_VENDOR + ':' + transitionText; } function assembleTransform(x, y, toString) { - // If using float on style, the final width of the dom might - // keep changing slightly while mouse move. So `toFixed(0)` them. - var x0 = x.toFixed(0) + 'px'; - var y0 = y.toFixed(0) + 'px'; // not support transform, use `left` and `top` instead. + // If using float on style, the final width of the dom might + // keep changing slightly while mouse move. So `toFixed(0)` them. + var x0 = x.toFixed(0) + 'px'; + var y0 = y.toFixed(0) + 'px'; // not support transform, use `left` and `top` instead. - if (!env.transformSupported) { - return toString ? "top:" + y0 + ";left:" + x0 + ";" : [['top', y0], ['left', x0]]; - } // support transform + if (!env.transformSupported) { + return toString ? "top:" + y0 + ";left:" + x0 + ";" : [['top', y0], ['left', x0]]; + } // support transform - var is3d = env.transform3dSupported; - var translate = "translate" + (is3d ? '3d' : '') + "(" + x0 + "," + y0 + (is3d ? ',0' : '') + ")"; - return toString ? 'top:0;left:0;' + CSS_TRANSFORM_VENDOR + ':' + translate + ';' : [['top', 0], ['left', 0], [TRANSFORM_VENDOR, translate]]; + var is3d = env.transform3dSupported; + var translate = "translate" + (is3d ? '3d' : '') + "(" + x0 + "," + y0 + (is3d ? ',0' : '') + ")"; + return toString ? 'top:0;left:0;' + CSS_TRANSFORM_VENDOR + ':' + translate + ';' : [['top', 0], ['left', 0], [TRANSFORM_VENDOR, translate]]; } /** * @param {Object} textStyle @@ -81930,1351 +81930,1351 @@ function assembleFont(textStyleModel) { - var cssText = []; - var fontSize = textStyleModel.get('fontSize'); - var color = textStyleModel.getTextColor(); - color && cssText.push('color:' + color); - cssText.push('font:' + textStyleModel.getFont()); - fontSize // @ts-ignore, leave it to the tooltip refactor. - && cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px'); - var shadowColor = textStyleModel.get('textShadowColor'); - var shadowBlur = textStyleModel.get('textShadowBlur') || 0; - var shadowOffsetX = textStyleModel.get('textShadowOffsetX') || 0; - var shadowOffsetY = textStyleModel.get('textShadowOffsetY') || 0; - shadowColor && shadowBlur && cssText.push('text-shadow:' + shadowOffsetX + 'px ' + shadowOffsetY + 'px ' + shadowBlur + 'px ' + shadowColor); - each(['decoration', 'align'], function (name) { - var val = textStyleModel.get(name); - val && cssText.push('text-' + name + ':' + val); - }); - return cssText.join(';'); + var cssText = []; + var fontSize = textStyleModel.get('fontSize'); + var color = textStyleModel.getTextColor(); + color && cssText.push('color:' + color); + cssText.push('font:' + textStyleModel.getFont()); + fontSize // @ts-ignore, leave it to the tooltip refactor. + && cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px'); + var shadowColor = textStyleModel.get('textShadowColor'); + var shadowBlur = textStyleModel.get('textShadowBlur') || 0; + var shadowOffsetX = textStyleModel.get('textShadowOffsetX') || 0; + var shadowOffsetY = textStyleModel.get('textShadowOffsetY') || 0; + shadowColor && shadowBlur && cssText.push('text-shadow:' + shadowOffsetX + 'px ' + shadowOffsetY + 'px ' + shadowBlur + 'px ' + shadowColor); + each(['decoration', 'align'], function (name) { + var val = textStyleModel.get(name); + val && cssText.push('text-' + name + ':' + val); + }); + return cssText.join(';'); } function assembleCssText(tooltipModel, enableTransition, onlyFade) { - var cssText = []; - var transitionDuration = tooltipModel.get('transitionDuration'); - var backgroundColor = tooltipModel.get('backgroundColor'); - var shadowBlur = tooltipModel.get('shadowBlur'); - var shadowColor = tooltipModel.get('shadowColor'); - var shadowOffsetX = tooltipModel.get('shadowOffsetX'); - var shadowOffsetY = tooltipModel.get('shadowOffsetY'); - var textStyleModel = tooltipModel.getModel('textStyle'); - var padding = getPaddingFromTooltipModel(tooltipModel, 'html'); - var boxShadow = shadowOffsetX + "px " + shadowOffsetY + "px " + shadowBlur + "px " + shadowColor; - cssText.push('box-shadow:' + boxShadow); // Animation transition. Do not animate when transitionDuration is 0. - - enableTransition && transitionDuration && cssText.push(assembleTransition(transitionDuration, onlyFade)); - - if (backgroundColor) { - cssText.push('background-color:' + backgroundColor); - } // Border style - - - each(['width', 'color', 'radius'], function (name) { - var borderName = 'border-' + name; - var camelCase = toCamelCase(borderName); - var val = tooltipModel.get(camelCase); - val != null && cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px')); - }); // Text style - - cssText.push(assembleFont(textStyleModel)); // Padding - - if (padding != null) { - cssText.push('padding:' + normalizeCssArray$1(padding).join('px ') + 'px'); - } - - return cssText.join(';') + ';'; + var cssText = []; + var transitionDuration = tooltipModel.get('transitionDuration'); + var backgroundColor = tooltipModel.get('backgroundColor'); + var shadowBlur = tooltipModel.get('shadowBlur'); + var shadowColor = tooltipModel.get('shadowColor'); + var shadowOffsetX = tooltipModel.get('shadowOffsetX'); + var shadowOffsetY = tooltipModel.get('shadowOffsetY'); + var textStyleModel = tooltipModel.getModel('textStyle'); + var padding = getPaddingFromTooltipModel(tooltipModel, 'html'); + var boxShadow = shadowOffsetX + "px " + shadowOffsetY + "px " + shadowBlur + "px " + shadowColor; + cssText.push('box-shadow:' + boxShadow); // Animation transition. Do not animate when transitionDuration is 0. + + enableTransition && transitionDuration && cssText.push(assembleTransition(transitionDuration, onlyFade)); + + if (backgroundColor) { + cssText.push('background-color:' + backgroundColor); + } // Border style + + + each(['width', 'color', 'radius'], function (name) { + var borderName = 'border-' + name; + var camelCase = toCamelCase(borderName); + var val = tooltipModel.get(camelCase); + val != null && cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px')); + }); // Text style + + cssText.push(assembleFont(textStyleModel)); // Padding + + if (padding != null) { + cssText.push('padding:' + normalizeCssArray$1(padding).join('px ') + 'px'); + } + + return cssText.join(';') + ';'; } // If not able to make, do not modify the input `out`. function makeStyleCoord(out, zr, appendToBody, zrX, zrY) { - var zrPainter = zr && zr.painter; + var zrPainter = zr && zr.painter; - if (appendToBody) { - var zrViewportRoot = zrPainter && zrPainter.getViewportRoot(); + if (appendToBody) { + var zrViewportRoot = zrPainter && zrPainter.getViewportRoot(); - if (zrViewportRoot) { - // Some APPs might use scale on body, so we support CSS transform here. - transformLocalCoord(out, zrViewportRoot, document.body, zrX, zrY); - } - } else { - out[0] = zrX; - out[1] = zrY; // xy should be based on canvas root. But tooltipContent is - // the sibling of canvas root. So padding of ec container - // should be considered here. + if (zrViewportRoot) { + // Some APPs might use scale on body, so we support CSS transform here. + transformLocalCoord(out, zrViewportRoot, document.body, zrX, zrY); + } + } else { + out[0] = zrX; + out[1] = zrY; // xy should be based on canvas root. But tooltipContent is + // the sibling of canvas root. So padding of ec container + // should be considered here. - var viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset(); + var viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset(); - if (viewportRootOffset) { - out[0] += viewportRootOffset.offsetLeft; - out[1] += viewportRootOffset.offsetTop; - } + if (viewportRootOffset) { + out[0] += viewportRootOffset.offsetLeft; + out[1] += viewportRootOffset.offsetTop; } + } - out[2] = out[0] / zr.getWidth(); - out[3] = out[1] / zr.getHeight(); + out[2] = out[0] / zr.getWidth(); + out[3] = out[1] / zr.getHeight(); } var TooltipHTMLContent = - /** @class */ - function () { - function TooltipHTMLContent(container, api, opt) { - this._show = false; - this._styleCoord = [0, 0, 0, 0]; - this._enterable = true; - this._firstShow = true; - this._longHide = true; + /** @class */ + function () { + function TooltipHTMLContent(container, api, opt) { + this._show = false; + this._styleCoord = [0, 0, 0, 0]; + this._enterable = true; + this._firstShow = true; + this._longHide = true; - if (env.wxa) { - return null; - } + if (env.wxa) { + return null; + } - var el = document.createElement('div'); // TODO: TYPE + var el = document.createElement('div'); // TODO: TYPE - el.domBelongToZr = true; - this.el = el; - var zr = this._zr = api.getZr(); - var appendToBody = this._appendToBody = opt && opt.appendToBody; - makeStyleCoord(this._styleCoord, zr, appendToBody, api.getWidth() / 2, api.getHeight() / 2); + el.domBelongToZr = true; + this.el = el; + var zr = this._zr = api.getZr(); + var appendToBody = this._appendToBody = opt && opt.appendToBody; + makeStyleCoord(this._styleCoord, zr, appendToBody, api.getWidth() / 2, api.getHeight() / 2); - if (appendToBody) { - document.body.appendChild(el); - } else { - container.appendChild(el); - } + if (appendToBody) { + document.body.appendChild(el); + } else { + container.appendChild(el); + } - this._container = container; // FIXME - // Is it needed to trigger zr event manually if - // the browser do not support `pointer-events: none`. + this._container = container; // FIXME + // Is it needed to trigger zr event manually if + // the browser do not support `pointer-events: none`. - var self = this; + var self = this; - el.onmouseenter = function () { - // clear the timeout in hideLater and keep showing tooltip - if (self._enterable) { - clearTimeout(self._hideTimeout); - self._show = true; - } + el.onmouseenter = function () { + // clear the timeout in hideLater and keep showing tooltip + if (self._enterable) { + clearTimeout(self._hideTimeout); + self._show = true; + } - self._inContent = true; - }; + self._inContent = true; + }; - el.onmousemove = function (e) { - e = e || window.event; - - if (!self._enterable) { - // `pointer-events: none` is set to tooltip content div - // if `enterable` is set as `false`, and `el.onmousemove` - // can not be triggered. But in browser that do not - // support `pointer-events`, we need to do this: - // Try trigger zrender event to avoid mouse - // in and out shape too frequently - var handler = zr.handler; - var zrViewportRoot = zr.painter.getViewportRoot(); - normalizeEvent(zrViewportRoot, e, true); - handler.dispatch('mousemove', e); - } - }; + el.onmousemove = function (e) { + e = e || window.event; + + if (!self._enterable) { + // `pointer-events: none` is set to tooltip content div + // if `enterable` is set as `false`, and `el.onmousemove` + // can not be triggered. But in browser that do not + // support `pointer-events`, we need to do this: + // Try trigger zrender event to avoid mouse + // in and out shape too frequently + var handler = zr.handler; + var zrViewportRoot = zr.painter.getViewportRoot(); + normalizeEvent(zrViewportRoot, e, true); + handler.dispatch('mousemove', e); + } + }; - el.onmouseleave = function () { - // set `_inContent` to `false` before `hideLater` - self._inContent = false; + el.onmouseleave = function () { + // set `_inContent` to `false` before `hideLater` + self._inContent = false; - if (self._enterable) { - if (self._show) { - self.hideLater(self._hideDelay); - } - } - }; + if (self._enterable) { + if (self._show) { + self.hideLater(self._hideDelay); } - /** - * Update when tooltip is rendered - */ + } + }; + } + /** + * Update when tooltip is rendered + */ - TooltipHTMLContent.prototype.update = function (tooltipModel) { - // FIXME - // Move this logic to ec main? - var container = this._container; - var position = getComputedStyle(container, 'position'); - var domStyle = container.style; + TooltipHTMLContent.prototype.update = function (tooltipModel) { + // FIXME + // Move this logic to ec main? + var container = this._container; + var position = getComputedStyle(container, 'position'); + var domStyle = container.style; - if (domStyle.position !== 'absolute' && position !== 'absolute') { - domStyle.position = 'relative'; - } // move tooltip if chart resized + if (domStyle.position !== 'absolute' && position !== 'absolute') { + domStyle.position = 'relative'; + } // move tooltip if chart resized - var alwaysShowContent = tooltipModel.get('alwaysShowContent'); - alwaysShowContent && this._moveIfResized(); // update className + var alwaysShowContent = tooltipModel.get('alwaysShowContent'); + alwaysShowContent && this._moveIfResized(); // update className - this.el.className = tooltipModel.get('className') || ''; // Hide the tooltip - // PENDING - // this.hide(); - }; + this.el.className = tooltipModel.get('className') || ''; // Hide the tooltip + // PENDING + // this.hide(); + }; - TooltipHTMLContent.prototype.show = function (tooltipModel, nearPointColor) { - clearTimeout(this._hideTimeout); - clearTimeout(this._longHideTimeout); - var el = this.el; - var style = el.style; - var styleCoord = this._styleCoord; + TooltipHTMLContent.prototype.show = function (tooltipModel, nearPointColor) { + clearTimeout(this._hideTimeout); + clearTimeout(this._longHideTimeout); + var el = this.el; + var style = el.style; + var styleCoord = this._styleCoord; - if (!el.innerHTML) { - style.display = 'none'; - } else { - style.cssText = gCssText + assembleCssText(tooltipModel, !this._firstShow, this._longHide) // initial transform - + assembleTransform(styleCoord[0], styleCoord[1], true) + ("border-color:" + convertToColorString(nearPointColor) + ";") + (tooltipModel.get('extraCssText') || '') // If mouse occasionally move over the tooltip, a mouseout event will be - // triggered by canvas, and cause some unexpectable result like dragging - // stop, "unfocusAdjacency". Here `pointer-events: none` is used to solve - // it. Although it is not supported by IE8~IE10, fortunately it is a rare - // scenario. - + (";pointer-events:" + (this._enterable ? 'auto' : 'none')); - } - - this._show = true; - this._firstShow = false; - this._longHide = false; - }; + if (!el.innerHTML) { + style.display = 'none'; + } else { + style.cssText = gCssText + assembleCssText(tooltipModel, !this._firstShow, this._longHide) // initial transform + + assembleTransform(styleCoord[0], styleCoord[1], true) + ("border-color:" + convertToColorString(nearPointColor) + ";") + (tooltipModel.get('extraCssText') || '') // If mouse occasionally move over the tooltip, a mouseout event will be + // triggered by canvas, and cause some unexpectable result like dragging + // stop, "unfocusAdjacency". Here `pointer-events: none` is used to solve + // it. Although it is not supported by IE8~IE10, fortunately it is a rare + // scenario. + + (";pointer-events:" + (this._enterable ? 'auto' : 'none')); + } - TooltipHTMLContent.prototype.setContent = function (content, markers, tooltipModel, borderColor, arrowPosition) { - var el = this.el; + this._show = true; + this._firstShow = false; + this._longHide = false; + }; - if (content == null) { - el.innerHTML = ''; - return; - } + TooltipHTMLContent.prototype.setContent = function (content, markers, tooltipModel, borderColor, arrowPosition) { + var el = this.el; + + if (content == null) { + el.innerHTML = ''; + return; + } - var arrow = ''; + var arrow = ''; - if (isString(arrowPosition) && tooltipModel.get('trigger') === 'item' && !shouldTooltipConfine(tooltipModel)) { - arrow = assembleArrow(tooltipModel, borderColor, arrowPosition); - } + if (isString(arrowPosition) && tooltipModel.get('trigger') === 'item' && !shouldTooltipConfine(tooltipModel)) { + arrow = assembleArrow(tooltipModel, borderColor, arrowPosition); + } - if (isString(content)) { - el.innerHTML = content + arrow; - } else if (content) { - // Clear previous - el.innerHTML = ''; + if (isString(content)) { + el.innerHTML = content + arrow; + } else if (content) { + // Clear previous + el.innerHTML = ''; - if (!isArray(content)) { - content = [content]; - } + if (!isArray(content)) { + content = [content]; + } - for (var i = 0; i < content.length; i++) { - if (isDom(content[i]) && content[i].parentNode !== el) { - el.appendChild(content[i]); - } - } // no arrow if empty + for (var i = 0; i < content.length; i++) { + if (isDom(content[i]) && content[i].parentNode !== el) { + el.appendChild(content[i]); + } + } // no arrow if empty - if (arrow && el.childNodes.length) { - // no need to create a new parent element, but it's not supported by IE 10 and older. - // const arrowEl = document.createRange().createContextualFragment(arrow); - var arrowEl = document.createElement('div'); - arrowEl.innerHTML = arrow; - el.appendChild(arrowEl); - } - } - }; + if (arrow && el.childNodes.length) { + // no need to create a new parent element, but it's not supported by IE 10 and older. + // const arrowEl = document.createRange().createContextualFragment(arrow); + var arrowEl = document.createElement('div'); + arrowEl.innerHTML = arrow; + el.appendChild(arrowEl); + } + } + }; - TooltipHTMLContent.prototype.setEnterable = function (enterable) { - this._enterable = enterable; - }; + TooltipHTMLContent.prototype.setEnterable = function (enterable) { + this._enterable = enterable; + }; - TooltipHTMLContent.prototype.getSize = function () { - var el = this.el; - return [el.offsetWidth, el.offsetHeight]; - }; + TooltipHTMLContent.prototype.getSize = function () { + var el = this.el; + return [el.offsetWidth, el.offsetHeight]; + }; - TooltipHTMLContent.prototype.moveTo = function (zrX, zrY) { - var styleCoord = this._styleCoord; - makeStyleCoord(styleCoord, this._zr, this._appendToBody, zrX, zrY); + TooltipHTMLContent.prototype.moveTo = function (zrX, zrY) { + var styleCoord = this._styleCoord; + makeStyleCoord(styleCoord, this._zr, this._appendToBody, zrX, zrY); - if (styleCoord[0] != null && styleCoord[1] != null) { - var style_1 = this.el.style; - var transforms = assembleTransform(styleCoord[0], styleCoord[1]); - each(transforms, function (transform) { - style_1[transform[0]] = transform[1]; - }); - } - }; - /** - * when `alwaysShowContent` is true, - * move the tooltip after chart resized - */ + if (styleCoord[0] != null && styleCoord[1] != null) { + var style_1 = this.el.style; + var transforms = assembleTransform(styleCoord[0], styleCoord[1]); + each(transforms, function (transform) { + style_1[transform[0]] = transform[1]; + }); + } + }; + /** + * when `alwaysShowContent` is true, + * move the tooltip after chart resized + */ - TooltipHTMLContent.prototype._moveIfResized = function () { - // The ratio of left to width - var ratioX = this._styleCoord[2]; // The ratio of top to height + TooltipHTMLContent.prototype._moveIfResized = function () { + // The ratio of left to width + var ratioX = this._styleCoord[2]; // The ratio of top to height - var ratioY = this._styleCoord[3]; - this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight()); - }; + var ratioY = this._styleCoord[3]; + this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight()); + }; - TooltipHTMLContent.prototype.hide = function () { - var _this = this; - - var style = this.el.style; - style.visibility = 'hidden'; - style.opacity = '0'; - env.transform3dSupported && (style.willChange = ''); - this._show = false; - this._longHideTimeout = setTimeout(function () { - return _this._longHide = true; - }, 500); - }; + TooltipHTMLContent.prototype.hide = function () { + var _this = this; - TooltipHTMLContent.prototype.hideLater = function (time) { - if (this._show && !(this._inContent && this._enterable)) { - if (time) { - this._hideDelay = time; // Set show false to avoid invoke hideLater multiple times + var style = this.el.style; + style.visibility = 'hidden'; + style.opacity = '0'; + env.transform3dSupported && (style.willChange = ''); + this._show = false; + this._longHideTimeout = setTimeout(function () { + return _this._longHide = true; + }, 500); + }; - this._show = false; - this._hideTimeout = setTimeout(bind(this.hide, this), time); - } else { - this.hide(); - } - } - }; + TooltipHTMLContent.prototype.hideLater = function (time) { + if (this._show && !(this._inContent && this._enterable)) { + if (time) { + this._hideDelay = time; // Set show false to avoid invoke hideLater multiple times - TooltipHTMLContent.prototype.isShow = function () { - return this._show; - }; + this._show = false; + this._hideTimeout = setTimeout(bind(this.hide, this), time); + } else { + this.hide(); + } + } + }; - TooltipHTMLContent.prototype.dispose = function () { - this.el.parentNode.removeChild(this.el); - }; + TooltipHTMLContent.prototype.isShow = function () { + return this._show; + }; - return TooltipHTMLContent; - }(); + TooltipHTMLContent.prototype.dispose = function () { + this.el.parentNode.removeChild(this.el); + }; - var TooltipRichContent = - /** @class */ - function () { - function TooltipRichContent(api) { - this._show = false; - this._styleCoord = [0, 0, 0, 0]; - this._enterable = true; - this._zr = api.getZr(); - makeStyleCoord$1(this._styleCoord, this._zr, api.getWidth() / 2, api.getHeight() / 2); - } - /** - * Update when tooltip is rendered - */ + return TooltipHTMLContent; + }(); + var TooltipRichContent = + /** @class */ + function () { + function TooltipRichContent(api) { + this._show = false; + this._styleCoord = [0, 0, 0, 0]; + this._enterable = true; + this._zr = api.getZr(); + makeStyleCoord$1(this._styleCoord, this._zr, api.getWidth() / 2, api.getHeight() / 2); + } + /** + * Update when tooltip is rendered + */ - TooltipRichContent.prototype.update = function (tooltipModel) { - var alwaysShowContent = tooltipModel.get('alwaysShowContent'); - alwaysShowContent && this._moveIfResized(); - }; - TooltipRichContent.prototype.show = function () { - if (this._hideTimeout) { - clearTimeout(this._hideTimeout); - } + TooltipRichContent.prototype.update = function (tooltipModel) { + var alwaysShowContent = tooltipModel.get('alwaysShowContent'); + alwaysShowContent && this._moveIfResized(); + }; - this.el.show(); - this._show = true; - }; - /** - * Set tooltip content - */ + TooltipRichContent.prototype.show = function () { + if (this._hideTimeout) { + clearTimeout(this._hideTimeout); + } + this.el.show(); + this._show = true; + }; + /** + * Set tooltip content + */ - TooltipRichContent.prototype.setContent = function (content, markupStyleCreator, tooltipModel, borderColor, arrowPosition) { - var _this = this; - if (isObject(content)) { - throwError("development" !== 'production' ? 'Passing DOM nodes as content is not supported in richText tooltip!' : ''); - } + TooltipRichContent.prototype.setContent = function (content, markupStyleCreator, tooltipModel, borderColor, arrowPosition) { + var _this = this; - if (this.el) { - this._zr.remove(this.el); - } + if (isObject(content)) { + throwError("development" !== 'production' ? 'Passing DOM nodes as content is not supported in richText tooltip!' : ''); + } - var textStyleModel = tooltipModel.getModel('textStyle'); - this.el = new ZRText({ - style: { - rich: markupStyleCreator.richTextStyles, - text: content, - lineHeight: 22, - borderWidth: 1, - borderColor: borderColor, - textShadowColor: textStyleModel.get('textShadowColor'), - fill: tooltipModel.get(['textStyle', 'color']), - padding: getPaddingFromTooltipModel(tooltipModel, 'richText'), - verticalAlign: 'top', - align: 'left' - }, - z: tooltipModel.get('z') - }); - each(['backgroundColor', 'borderRadius', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'], function (propName) { - _this.el.style[propName] = tooltipModel.get(propName); - }); - each(['textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'], function (propName) { - _this.el.style[propName] = textStyleModel.get(propName) || 0; - }); + if (this.el) { + this._zr.remove(this.el); + } - this._zr.add(this.el); + var textStyleModel = tooltipModel.getModel('textStyle'); + this.el = new ZRText({ + style: { + rich: markupStyleCreator.richTextStyles, + text: content, + lineHeight: 22, + borderWidth: 1, + borderColor: borderColor, + textShadowColor: textStyleModel.get('textShadowColor'), + fill: tooltipModel.get(['textStyle', 'color']), + padding: getPaddingFromTooltipModel(tooltipModel, 'richText'), + verticalAlign: 'top', + align: 'left' + }, + z: tooltipModel.get('z') + }); + each(['backgroundColor', 'borderRadius', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'], function (propName) { + _this.el.style[propName] = tooltipModel.get(propName); + }); + each(['textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'], function (propName) { + _this.el.style[propName] = textStyleModel.get(propName) || 0; + }); - var self = this; - this.el.on('mouseover', function () { - // clear the timeout in hideLater and keep showing tooltip - if (self._enterable) { - clearTimeout(self._hideTimeout); - self._show = true; - } + this._zr.add(this.el); - self._inContent = true; - }); - this.el.on('mouseout', function () { - if (self._enterable) { - if (self._show) { - self.hideLater(self._hideDelay); - } - } + var self = this; + this.el.on('mouseover', function () { + // clear the timeout in hideLater and keep showing tooltip + if (self._enterable) { + clearTimeout(self._hideTimeout); + self._show = true; + } + + self._inContent = true; + }); + this.el.on('mouseout', function () { + if (self._enterable) { + if (self._show) { + self.hideLater(self._hideDelay); + } + } - self._inContent = false; - }); - }; + self._inContent = false; + }); + }; - TooltipRichContent.prototype.setEnterable = function (enterable) { - this._enterable = enterable; - }; + TooltipRichContent.prototype.setEnterable = function (enterable) { + this._enterable = enterable; + }; - TooltipRichContent.prototype.getSize = function () { - var el = this.el; - var bounding = this.el.getBoundingRect(); // bounding rect does not include shadow. For renderMode richText, - // if overflow, it will be cut. So calculate them accurately. + TooltipRichContent.prototype.getSize = function () { + var el = this.el; + var bounding = this.el.getBoundingRect(); // bounding rect does not include shadow. For renderMode richText, + // if overflow, it will be cut. So calculate them accurately. - var shadowOuterSize = calcShadowOuterSize(el.style); - return [bounding.width + shadowOuterSize.left + shadowOuterSize.right, bounding.height + shadowOuterSize.top + shadowOuterSize.bottom]; - }; + var shadowOuterSize = calcShadowOuterSize(el.style); + return [bounding.width + shadowOuterSize.left + shadowOuterSize.right, bounding.height + shadowOuterSize.top + shadowOuterSize.bottom]; + }; - TooltipRichContent.prototype.moveTo = function (x, y) { - var el = this.el; + TooltipRichContent.prototype.moveTo = function (x, y) { + var el = this.el; - if (el) { - var styleCoord = this._styleCoord; - makeStyleCoord$1(styleCoord, this._zr, x, y); - x = styleCoord[0]; - y = styleCoord[1]; - var style = el.style; - var borderWidth = mathMaxWith0(style.borderWidth || 0); - var shadowOuterSize = calcShadowOuterSize(style); // rich text x, y do not include border. - - el.x = x + borderWidth + shadowOuterSize.left; - el.y = y + borderWidth + shadowOuterSize.top; - el.markRedraw(); - } - }; - /** - * when `alwaysShowContent` is true, - * move the tooltip after chart resized - */ + if (el) { + var styleCoord = this._styleCoord; + makeStyleCoord$1(styleCoord, this._zr, x, y); + x = styleCoord[0]; + y = styleCoord[1]; + var style = el.style; + var borderWidth = mathMaxWith0(style.borderWidth || 0); + var shadowOuterSize = calcShadowOuterSize(style); // rich text x, y do not include border. + + el.x = x + borderWidth + shadowOuterSize.left; + el.y = y + borderWidth + shadowOuterSize.top; + el.markRedraw(); + } + }; + /** + * when `alwaysShowContent` is true, + * move the tooltip after chart resized + */ - TooltipRichContent.prototype._moveIfResized = function () { - // The ratio of left to width - var ratioX = this._styleCoord[2]; // The ratio of top to height + TooltipRichContent.prototype._moveIfResized = function () { + // The ratio of left to width + var ratioX = this._styleCoord[2]; // The ratio of top to height - var ratioY = this._styleCoord[3]; - this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight()); - }; + var ratioY = this._styleCoord[3]; + this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight()); + }; - TooltipRichContent.prototype.hide = function () { - if (this.el) { - this.el.hide(); - } + TooltipRichContent.prototype.hide = function () { + if (this.el) { + this.el.hide(); + } - this._show = false; - }; + this._show = false; + }; - TooltipRichContent.prototype.hideLater = function (time) { - if (this._show && !(this._inContent && this._enterable)) { - if (time) { - this._hideDelay = time; // Set show false to avoid invoke hideLater multiple times + TooltipRichContent.prototype.hideLater = function (time) { + if (this._show && !(this._inContent && this._enterable)) { + if (time) { + this._hideDelay = time; // Set show false to avoid invoke hideLater multiple times - this._show = false; - this._hideTimeout = setTimeout(bind(this.hide, this), time); - } else { - this.hide(); - } - } - }; + this._show = false; + this._hideTimeout = setTimeout(bind(this.hide, this), time); + } else { + this.hide(); + } + } + }; - TooltipRichContent.prototype.isShow = function () { - return this._show; - }; + TooltipRichContent.prototype.isShow = function () { + return this._show; + }; - TooltipRichContent.prototype.dispose = function () { - this._zr.remove(this.el); - }; + TooltipRichContent.prototype.dispose = function () { + this._zr.remove(this.el); + }; - return TooltipRichContent; - }(); + return TooltipRichContent; + }(); function mathMaxWith0(val) { - return Math.max(0, val); + return Math.max(0, val); } function calcShadowOuterSize(style) { - var shadowBlur = mathMaxWith0(style.shadowBlur || 0); - var shadowOffsetX = mathMaxWith0(style.shadowOffsetX || 0); - var shadowOffsetY = mathMaxWith0(style.shadowOffsetY || 0); - return { - left: mathMaxWith0(shadowBlur - shadowOffsetX), - right: mathMaxWith0(shadowBlur + shadowOffsetX), - top: mathMaxWith0(shadowBlur - shadowOffsetY), - bottom: mathMaxWith0(shadowBlur + shadowOffsetY) - }; + var shadowBlur = mathMaxWith0(style.shadowBlur || 0); + var shadowOffsetX = mathMaxWith0(style.shadowOffsetX || 0); + var shadowOffsetY = mathMaxWith0(style.shadowOffsetY || 0); + return { + left: mathMaxWith0(shadowBlur - shadowOffsetX), + right: mathMaxWith0(shadowBlur + shadowOffsetX), + top: mathMaxWith0(shadowBlur - shadowOffsetY), + bottom: mathMaxWith0(shadowBlur + shadowOffsetY) + }; } function makeStyleCoord$1(out, zr, zrX, zrY) { - out[0] = zrX; - out[1] = zrY; - out[2] = out[0] / zr.getWidth(); - out[3] = out[1] / zr.getHeight(); + out[0] = zrX; + out[1] = zrY; + out[2] = out[0] / zr.getWidth(); + out[3] = out[1] / zr.getHeight(); } var proxyRect = new Rect({ - shape: { - x: -1, - y: -1, - width: 2, - height: 2 - } + shape: { + x: -1, + y: -1, + width: 2, + height: 2 + } }); var TooltipView = - /** @class */ - function (_super) { - __extends(TooltipView, _super); - - function TooltipView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = TooltipView.type; - return _this; - } - - TooltipView.prototype.init = function (ecModel, api) { - if (env.node || !api.getDom()) { - return; - } - - var tooltipModel = ecModel.getComponent('tooltip'); - var renderMode = this._renderMode = getTooltipRenderMode(tooltipModel.get('renderMode')); - this._tooltipContent = renderMode === 'richText' ? new TooltipRichContent(api) : new TooltipHTMLContent(api.getDom(), api, { - appendToBody: tooltipModel.get('appendToBody', true) - }); - }; + /** @class */ + function (_super) { + __extends(TooltipView, _super); - TooltipView.prototype.render = function (tooltipModel, ecModel, api) { - if (env.node || !api.getDom()) { - return; - } // Reset - - - this.group.removeAll(); - this._tooltipModel = tooltipModel; - this._ecModel = ecModel; - this._api = api; - /** - * @private - * @type {boolean} - */ - - this._alwaysShowContent = tooltipModel.get('alwaysShowContent'); - var tooltipContent = this._tooltipContent; - tooltipContent.update(tooltipModel); - tooltipContent.setEnterable(tooltipModel.get('enterable')); + function TooltipView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - this._initGlobalListener(); + _this.type = TooltipView.type; + return _this; + } - this._keepShow(); // PENDING - // `mousemove` event will be triggered very frequently when the mouse moves fast, - // which causes that the `updatePosition` function was also called frequently. - // In Chrome with devtools open and Firefox, tooltip looks laggy and shakes. See #14695 #16101 - // To avoid frequent triggering, - // consider throttling it in 50ms when transition is enabled + TooltipView.prototype.init = function (ecModel, api) { + if (env.node || !api.getDom()) { + return; + } + var tooltipModel = ecModel.getComponent('tooltip'); + var renderMode = this._renderMode = getTooltipRenderMode(tooltipModel.get('renderMode')); + this._tooltipContent = renderMode === 'richText' ? new TooltipRichContent(api) : new TooltipHTMLContent(api.getDom(), api, { + appendToBody: tooltipModel.get('appendToBody', true) + }); + }; - if (this._renderMode !== 'richText' && tooltipModel.get('transitionDuration')) { - createOrUpdate(this, '_updatePosition', 50, 'fixRate'); - } else { - clear(this, '_updatePosition'); - } - }; + TooltipView.prototype.render = function (tooltipModel, ecModel, api) { + if (env.node || !api.getDom()) { + return; + } // Reset - TooltipView.prototype._initGlobalListener = function () { - var tooltipModel = this._tooltipModel; - var triggerOn = tooltipModel.get('triggerOn'); - register('itemTooltip', this._api, bind(function (currTrigger, e, dispatchAction) { - // If 'none', it is not controlled by mouse totally. - if (triggerOn !== 'none') { - if (triggerOn.indexOf(currTrigger) >= 0) { - this._tryShow(e, dispatchAction); - } else if (currTrigger === 'leave') { - this._hide(dispatchAction); - } - } - }, this)); - }; - TooltipView.prototype._keepShow = function () { - var tooltipModel = this._tooltipModel; - var ecModel = this._ecModel; - var api = this._api; // Try to keep the tooltip show when refreshing - - if (this._lastX != null && this._lastY != null // When user is willing to control tooltip totally using API, - // self.manuallyShowTip({x, y}) might cause tooltip hide, - // which is not expected. - && tooltipModel.get('triggerOn') !== 'none') { - var self_1 = this; - clearTimeout(this._refreshUpdateTimeout); - this._refreshUpdateTimeout = setTimeout(function () { - // Show tip next tick after other charts are rendered - // In case highlight action has wrong result - // FIXME - !api.isDisposed() && self_1.manuallyShowTip(tooltipModel, ecModel, api, { - x: self_1._lastX, - y: self_1._lastY, - dataByCoordSys: self_1._lastDataByCoordSys - }); - }); - } - }; - /** - * Show tip manually by - * dispatchAction({ - * type: 'showTip', - * x: 10, - * y: 10 - * }); - * Or - * dispatchAction({ - * type: 'showTip', - * seriesIndex: 0, - * dataIndex or dataIndexInside or name - * }); - * - * TODO Batch - */ + this.group.removeAll(); + this._tooltipModel = tooltipModel; + this._ecModel = ecModel; + this._api = api; + /** + * @private + * @type {boolean} + */ + this._alwaysShowContent = tooltipModel.get('alwaysShowContent'); + var tooltipContent = this._tooltipContent; + tooltipContent.update(tooltipModel); + tooltipContent.setEnterable(tooltipModel.get('enterable')); - TooltipView.prototype.manuallyShowTip = function (tooltipModel, ecModel, api, payload) { - if (payload.from === this.uid || env.node || !api.getDom()) { - return; - } + this._initGlobalListener(); - var dispatchAction = makeDispatchAction$1(payload, api); // Reset ticket - - this._ticket = ''; // When triggered from axisPointer. - - var dataByCoordSys = payload.dataByCoordSys; - var cmptRef = findComponentReference(payload, ecModel, api); - - if (cmptRef) { - var rect = cmptRef.el.getBoundingRect().clone(); - rect.applyTransform(cmptRef.el.transform); - - this._tryShow({ - offsetX: rect.x + rect.width / 2, - offsetY: rect.y + rect.height / 2, - target: cmptRef.el, - position: payload.position, - // When manully trigger, the mouse is not on the el, so we'd better to - // position tooltip on the bottom of the el and display arrow is possible. - positionDefault: 'bottom' - }, dispatchAction); - } else if (payload.tooltip && payload.x != null && payload.y != null) { - var el = proxyRect; - el.x = payload.x; - el.y = payload.y; - el.update(); - getECData(el).tooltipConfig = { - name: null, - option: payload.tooltip - }; // Manually show tooltip while view is not using zrender elements. - - this._tryShow({ - offsetX: payload.x, - offsetY: payload.y, - target: el - }, dispatchAction); - } else if (dataByCoordSys) { - this._tryShow({ - offsetX: payload.x, - offsetY: payload.y, - position: payload.position, - dataByCoordSys: dataByCoordSys, - tooltipOption: payload.tooltipOption - }, dispatchAction); - } else if (payload.seriesIndex != null) { - if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) { - return; - } + this._keepShow(); // PENDING + // `mousemove` event will be triggered very frequently when the mouse moves fast, + // which causes that the `updatePosition` function was also called frequently. + // In Chrome with devtools open and Firefox, tooltip looks laggy and shakes. See #14695 #16101 + // To avoid frequent triggering, + // consider throttling it in 50ms when transition is enabled - var pointInfo = findPointFromSeries(payload, ecModel); - var cx = pointInfo.point[0]; - var cy = pointInfo.point[1]; - - if (cx != null && cy != null) { - this._tryShow({ - offsetX: cx, - offsetY: cy, - target: pointInfo.el, - position: payload.position, - // When manully trigger, the mouse is not on the el, so we'd better to - // position tooltip on the bottom of the el and display arrow is possible. - positionDefault: 'bottom' - }, dispatchAction); - } - } else if (payload.x != null && payload.y != null) { - // FIXME - // should wrap dispatchAction like `axisPointer/globalListener` ? - api.dispatchAction({ - type: 'updateAxisPointer', - x: payload.x, - y: payload.y - }); - this._tryShow({ - offsetX: payload.x, - offsetY: payload.y, - position: payload.position, - target: api.getZr().findHover(payload.x, payload.y).target - }, dispatchAction); - } - }; + if (this._renderMode !== 'richText' && tooltipModel.get('transitionDuration')) { + createOrUpdate(this, '_updatePosition', 50, 'fixRate'); + } else { + clear(this, '_updatePosition'); + } + }; + + TooltipView.prototype._initGlobalListener = function () { + var tooltipModel = this._tooltipModel; + var triggerOn = tooltipModel.get('triggerOn'); + register('itemTooltip', this._api, bind(function (currTrigger, e, dispatchAction) { + // If 'none', it is not controlled by mouse totally. + if (triggerOn !== 'none') { + if (triggerOn.indexOf(currTrigger) >= 0) { + this._tryShow(e, dispatchAction); + } else if (currTrigger === 'leave') { + this._hide(dispatchAction); + } + } + }, this)); + }; + + TooltipView.prototype._keepShow = function () { + var tooltipModel = this._tooltipModel; + var ecModel = this._ecModel; + var api = this._api; // Try to keep the tooltip show when refreshing + + if (this._lastX != null && this._lastY != null // When user is willing to control tooltip totally using API, + // self.manuallyShowTip({x, y}) might cause tooltip hide, + // which is not expected. + && tooltipModel.get('triggerOn') !== 'none') { + var self_1 = this; + clearTimeout(this._refreshUpdateTimeout); + this._refreshUpdateTimeout = setTimeout(function () { + // Show tip next tick after other charts are rendered + // In case highlight action has wrong result + // FIXME + !api.isDisposed() && self_1.manuallyShowTip(tooltipModel, ecModel, api, { + x: self_1._lastX, + y: self_1._lastY, + dataByCoordSys: self_1._lastDataByCoordSys + }); + }); + } + }; + /** + * Show tip manually by + * dispatchAction({ + * type: 'showTip', + * x: 10, + * y: 10 + * }); + * Or + * dispatchAction({ + * type: 'showTip', + * seriesIndex: 0, + * dataIndex or dataIndexInside or name + * }); + * + * TODO Batch + */ - TooltipView.prototype.manuallyHideTip = function (tooltipModel, ecModel, api, payload) { - var tooltipContent = this._tooltipContent; - if (!this._alwaysShowContent && this._tooltipModel) { - tooltipContent.hideLater(this._tooltipModel.get('hideDelay')); - } + TooltipView.prototype.manuallyShowTip = function (tooltipModel, ecModel, api, payload) { + if (payload.from === this.uid || env.node || !api.getDom()) { + return; + } - this._lastX = this._lastY = this._lastDataByCoordSys = null; + var dispatchAction = makeDispatchAction$1(payload, api); // Reset ticket - if (payload.from !== this.uid) { - this._hide(makeDispatchAction$1(payload, api)); - } - }; // Be compatible with previous design, that is, when tooltip.type is 'axis' and - // dispatchAction 'showTip' with seriesIndex and dataIndex will trigger axis pointer - // and tooltip. + this._ticket = ''; // When triggered from axisPointer. + var dataByCoordSys = payload.dataByCoordSys; + var cmptRef = findComponentReference(payload, ecModel, api); - TooltipView.prototype._manuallyAxisShowTip = function (tooltipModel, ecModel, api, payload) { - var seriesIndex = payload.seriesIndex; - var dataIndex = payload.dataIndex; // @ts-ignore + if (cmptRef) { + var rect = cmptRef.el.getBoundingRect().clone(); + rect.applyTransform(cmptRef.el.transform); - var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; + this._tryShow({ + offsetX: rect.x + rect.width / 2, + offsetY: rect.y + rect.height / 2, + target: cmptRef.el, + position: payload.position, + // When manully trigger, the mouse is not on the el, so we'd better to + // position tooltip on the bottom of the el and display arrow is possible. + positionDefault: 'bottom' + }, dispatchAction); + } else if (payload.tooltip && payload.x != null && payload.y != null) { + var el = proxyRect; + el.x = payload.x; + el.y = payload.y; + el.update(); + getECData(el).tooltipConfig = { + name: null, + option: payload.tooltip + }; // Manually show tooltip while view is not using zrender elements. + + this._tryShow({ + offsetX: payload.x, + offsetY: payload.y, + target: el + }, dispatchAction); + } else if (dataByCoordSys) { + this._tryShow({ + offsetX: payload.x, + offsetY: payload.y, + position: payload.position, + dataByCoordSys: dataByCoordSys, + tooltipOption: payload.tooltipOption + }, dispatchAction); + } else if (payload.seriesIndex != null) { + if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) { + return; + } + + var pointInfo = findPointFromSeries(payload, ecModel); + var cx = pointInfo.point[0]; + var cy = pointInfo.point[1]; + + if (cx != null && cy != null) { + this._tryShow({ + offsetX: cx, + offsetY: cy, + target: pointInfo.el, + position: payload.position, + // When manully trigger, the mouse is not on the el, so we'd better to + // position tooltip on the bottom of the el and display arrow is possible. + positionDefault: 'bottom' + }, dispatchAction); + } + } else if (payload.x != null && payload.y != null) { + // FIXME + // should wrap dispatchAction like `axisPointer/globalListener` ? + api.dispatchAction({ + type: 'updateAxisPointer', + x: payload.x, + y: payload.y + }); - if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) { - return; - } + this._tryShow({ + offsetX: payload.x, + offsetY: payload.y, + position: payload.position, + target: api.getZr().findHover(payload.x, payload.y).target + }, dispatchAction); + } + }; - var seriesModel = ecModel.getSeriesByIndex(seriesIndex); + TooltipView.prototype.manuallyHideTip = function (tooltipModel, ecModel, api, payload) { + var tooltipContent = this._tooltipContent; - if (!seriesModel) { - return; - } + if (!this._alwaysShowContent && this._tooltipModel) { + tooltipContent.hideLater(this._tooltipModel.get('hideDelay')); + } - var data = seriesModel.getData(); - var tooltipCascadedModel = buildTooltipModel([data.getItemModel(dataIndex), seriesModel, (seriesModel.coordinateSystem || {}).model], this._tooltipModel); + this._lastX = this._lastY = this._lastDataByCoordSys = null; - if (tooltipCascadedModel.get('trigger') !== 'axis') { - return; - } + if (payload.from !== this.uid) { + this._hide(makeDispatchAction$1(payload, api)); + } + }; // Be compatible with previous design, that is, when tooltip.type is 'axis' and + // dispatchAction 'showTip' with seriesIndex and dataIndex will trigger axis pointer + // and tooltip. - api.dispatchAction({ - type: 'updateAxisPointer', - seriesIndex: seriesIndex, - dataIndex: dataIndex, - position: payload.position - }); - return true; - }; - TooltipView.prototype._tryShow = function (e, dispatchAction) { - var el = e.target; - var tooltipModel = this._tooltipModel; + TooltipView.prototype._manuallyAxisShowTip = function (tooltipModel, ecModel, api, payload) { + var seriesIndex = payload.seriesIndex; + var dataIndex = payload.dataIndex; // @ts-ignore - if (!tooltipModel) { - return; - } // Save mouse x, mouse y. So we can try to keep showing the tip if chart is refreshed - - - this._lastX = e.offsetX; - this._lastY = e.offsetY; - var dataByCoordSys = e.dataByCoordSys; - - if (dataByCoordSys && dataByCoordSys.length) { - this._showAxisTooltip(dataByCoordSys, e); - } else if (el) { - this._lastDataByCoordSys = null; - var seriesDispatcher_1; - var cmptDispatcher_1; - findEventDispatcher(el, function (target) { - // Always show item tooltip if mouse is on the element with dataIndex - if (getECData(target).dataIndex != null) { - seriesDispatcher_1 = target; - return true; - } // Tooltip provided directly. Like legend. + var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; + if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) { + return; + } - if (getECData(target).tooltipConfig != null) { - cmptDispatcher_1 = target; - return true; - } - }, true); + var seriesModel = ecModel.getSeriesByIndex(seriesIndex); - if (seriesDispatcher_1) { - this._showSeriesItemTooltip(e, seriesDispatcher_1, dispatchAction); - } else if (cmptDispatcher_1) { - this._showComponentItemTooltip(e, cmptDispatcher_1, dispatchAction); - } else { - this._hide(dispatchAction); - } - } else { - this._lastDataByCoordSys = null; + if (!seriesModel) { + return; + } - this._hide(dispatchAction); - } - }; + var data = seriesModel.getData(); + var tooltipCascadedModel = buildTooltipModel([data.getItemModel(dataIndex), seriesModel, (seriesModel.coordinateSystem || {}).model], this._tooltipModel); - TooltipView.prototype._showOrMove = function (tooltipModel, cb) { - // showDelay is used in this case: tooltip.enterable is set - // as true. User intent to move mouse into tooltip and click - // something. `showDelay` makes it easier to enter the content - // but tooltip do not move immediately. - var delay = tooltipModel.get('showDelay'); - cb = bind(cb, this); - clearTimeout(this._showTimout); - delay > 0 ? this._showTimout = setTimeout(cb, delay) : cb(); - }; + if (tooltipCascadedModel.get('trigger') !== 'axis') { + return; + } - TooltipView.prototype._showAxisTooltip = function (dataByCoordSys, e) { - var ecModel = this._ecModel; - var globalTooltipModel = this._tooltipModel; - var point = [e.offsetX, e.offsetY]; - var singleTooltipModel = buildTooltipModel([e.tooltipOption], globalTooltipModel); - var renderMode = this._renderMode; - var cbParamsList = []; - var articleMarkup = createTooltipMarkup('section', { - blocks: [], - noHeader: true - }); // Only for legacy: `Serise['formatTooltip']` returns a string. - - var markupTextArrLegacy = []; - var markupStyleCreator = new TooltipMarkupStyleCreator(); - each(dataByCoordSys, function (itemCoordSys) { - each(itemCoordSys.dataByAxis, function (axisItem) { - var axisModel = ecModel.getComponent(axisItem.axisDim + 'Axis', axisItem.axisIndex); - var axisValue = axisItem.value; - - if (!axisModel || axisValue == null) { - return; - } + api.dispatchAction({ + type: 'updateAxisPointer', + seriesIndex: seriesIndex, + dataIndex: dataIndex, + position: payload.position + }); + return true; + }; - var axisValueLabel = getValueLabel(axisValue, axisModel.axis, ecModel, axisItem.seriesDataIndices, axisItem.valueLabelOpt); - var axisSectionMarkup = createTooltipMarkup('section', { - header: axisValueLabel, - noHeader: !trim(axisValueLabel), - sortBlocks: true, - blocks: [] - }); - articleMarkup.blocks.push(axisSectionMarkup); - each(axisItem.seriesDataIndices, function (idxItem) { - var series = ecModel.getSeriesByIndex(idxItem.seriesIndex); - var dataIndex = idxItem.dataIndexInside; - var cbParams = series.getDataParams(dataIndex); // Can't find data. - - if (cbParams.dataIndex < 0) { - return; - } + TooltipView.prototype._tryShow = function (e, dispatchAction) { + var el = e.target; + var tooltipModel = this._tooltipModel; - cbParams.axisDim = axisItem.axisDim; - cbParams.axisIndex = axisItem.axisIndex; - cbParams.axisType = axisItem.axisType; - cbParams.axisId = axisItem.axisId; - cbParams.axisValue = getAxisRawValue(axisModel.axis, { - value: axisValue - }); - cbParams.axisValueLabel = axisValueLabel; // Pre-create marker style for makers. Users can assemble richText - // text in `formatter` callback and use those markers style. - - cbParams.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(cbParams.color), renderMode); - var seriesTooltipResult = normalizeTooltipFormatResult(series.formatTooltip(dataIndex, true, null)); - var frag = seriesTooltipResult.frag; - - if (frag) { - var valueFormatter = buildTooltipModel([series], globalTooltipModel).get('valueFormatter'); - axisSectionMarkup.blocks.push(valueFormatter ? extend({ - valueFormatter: valueFormatter - }, frag) : frag); - } + if (!tooltipModel) { + return; + } // Save mouse x, mouse y. So we can try to keep showing the tip if chart is refreshed - if (seriesTooltipResult.text) { - markupTextArrLegacy.push(seriesTooltipResult.text); - } - cbParamsList.push(cbParams); - }); - }); - }); // In most cases, the second axis is displays upper on the first one. - // So we reverse it to look better. - - articleMarkup.blocks.reverse(); - markupTextArrLegacy.reverse(); - var positionExpr = e.position; - var orderMode = singleTooltipModel.get('order'); - var builtMarkupText = buildTooltipMarkup(articleMarkup, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'), singleTooltipModel.get('textStyle')); - builtMarkupText && markupTextArrLegacy.unshift(builtMarkupText); - var blockBreak = renderMode === 'richText' ? '\n\n' : '
              '; - var allMarkupText = markupTextArrLegacy.join(blockBreak); - - this._showOrMove(singleTooltipModel, function () { - if (this._updateContentNotChangedOnAxis(dataByCoordSys, cbParamsList)) { - this._updatePosition(singleTooltipModel, positionExpr, point[0], point[1], this._tooltipContent, cbParamsList); - } else { - this._showTooltipContent(singleTooltipModel, allMarkupText, cbParamsList, Math.random() + '', point[0], point[1], positionExpr, null, markupStyleCreator); - } - }); // Do not trigger events here, because this branch only be entered - // from dispatchAction. + this._lastX = e.offsetX; + this._lastY = e.offsetY; + var dataByCoordSys = e.dataByCoordSys; - }; + if (dataByCoordSys && dataByCoordSys.length) { + this._showAxisTooltip(dataByCoordSys, e); + } else if (el) { + this._lastDataByCoordSys = null; + var seriesDispatcher_1; + var cmptDispatcher_1; + findEventDispatcher(el, function (target) { + // Always show item tooltip if mouse is on the element with dataIndex + if (getECData(target).dataIndex != null) { + seriesDispatcher_1 = target; + return true; + } // Tooltip provided directly. Like legend. + + + if (getECData(target).tooltipConfig != null) { + cmptDispatcher_1 = target; + return true; + } + }, true); + + if (seriesDispatcher_1) { + this._showSeriesItemTooltip(e, seriesDispatcher_1, dispatchAction); + } else if (cmptDispatcher_1) { + this._showComponentItemTooltip(e, cmptDispatcher_1, dispatchAction); + } else { + this._hide(dispatchAction); + } + } else { + this._lastDataByCoordSys = null; + + this._hide(dispatchAction); + } + }; + + TooltipView.prototype._showOrMove = function (tooltipModel, cb) { + // showDelay is used in this case: tooltip.enterable is set + // as true. User intent to move mouse into tooltip and click + // something. `showDelay` makes it easier to enter the content + // but tooltip do not move immediately. + var delay = tooltipModel.get('showDelay'); + cb = bind(cb, this); + clearTimeout(this._showTimout); + delay > 0 ? this._showTimout = setTimeout(cb, delay) : cb(); + }; + + TooltipView.prototype._showAxisTooltip = function (dataByCoordSys, e) { + var ecModel = this._ecModel; + var globalTooltipModel = this._tooltipModel; + var point = [e.offsetX, e.offsetY]; + var singleTooltipModel = buildTooltipModel([e.tooltipOption], globalTooltipModel); + var renderMode = this._renderMode; + var cbParamsList = []; + var articleMarkup = createTooltipMarkup('section', { + blocks: [], + noHeader: true + }); // Only for legacy: `Serise['formatTooltip']` returns a string. + + var markupTextArrLegacy = []; + var markupStyleCreator = new TooltipMarkupStyleCreator(); + each(dataByCoordSys, function (itemCoordSys) { + each(itemCoordSys.dataByAxis, function (axisItem) { + var axisModel = ecModel.getComponent(axisItem.axisDim + 'Axis', axisItem.axisIndex); + var axisValue = axisItem.value; + + if (!axisModel || axisValue == null) { + return; + } + + var axisValueLabel = getValueLabel(axisValue, axisModel.axis, ecModel, axisItem.seriesDataIndices, axisItem.valueLabelOpt); + var axisSectionMarkup = createTooltipMarkup('section', { + header: axisValueLabel, + noHeader: !trim(axisValueLabel), + sortBlocks: true, + blocks: [] + }); + articleMarkup.blocks.push(axisSectionMarkup); + each(axisItem.seriesDataIndices, function (idxItem) { + var series = ecModel.getSeriesByIndex(idxItem.seriesIndex); + var dataIndex = idxItem.dataIndexInside; + var cbParams = series.getDataParams(dataIndex); // Can't find data. - TooltipView.prototype._showSeriesItemTooltip = function (e, dispatcher, dispatchAction) { - var ecModel = this._ecModel; - var ecData = getECData(dispatcher); // Use dataModel in element if possible - // Used when mouseover on a element like markPoint or edge - // In which case, the data is not main data in series. - - var seriesIndex = ecData.seriesIndex; - var seriesModel = ecModel.getSeriesByIndex(seriesIndex); // For example, graph link. - - var dataModel = ecData.dataModel || seriesModel; - var dataIndex = ecData.dataIndex; - var dataType = ecData.dataType; - var data = dataModel.getData(dataType); - var renderMode = this._renderMode; - var positionDefault = e.positionDefault; - var tooltipModel = buildTooltipModel([data.getItemModel(dataIndex), dataModel, seriesModel && (seriesModel.coordinateSystem || {}).model], this._tooltipModel, positionDefault ? { - position: positionDefault - } : null); - var tooltipTrigger = tooltipModel.get('trigger'); - - if (tooltipTrigger != null && tooltipTrigger !== 'item') { - return; - } + if (cbParams.dataIndex < 0) { + return; + } + + cbParams.axisDim = axisItem.axisDim; + cbParams.axisIndex = axisItem.axisIndex; + cbParams.axisType = axisItem.axisType; + cbParams.axisId = axisItem.axisId; + cbParams.axisValue = getAxisRawValue(axisModel.axis, { + value: axisValue + }); + cbParams.axisValueLabel = axisValueLabel; // Pre-create marker style for makers. Users can assemble richText + // text in `formatter` callback and use those markers style. + + cbParams.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(cbParams.color), renderMode); + var seriesTooltipResult = normalizeTooltipFormatResult(series.formatTooltip(dataIndex, true, null)); + var frag = seriesTooltipResult.frag; + + if (frag) { + var valueFormatter = buildTooltipModel([series], globalTooltipModel).get('valueFormatter'); + axisSectionMarkup.blocks.push(valueFormatter ? extend({ + valueFormatter: valueFormatter + }, frag) : frag); + } + + if (seriesTooltipResult.text) { + markupTextArrLegacy.push(seriesTooltipResult.text); + } + + cbParamsList.push(cbParams); + }); + }); + }); // In most cases, the second axis is displays upper on the first one. + // So we reverse it to look better. + + articleMarkup.blocks.reverse(); + markupTextArrLegacy.reverse(); + var positionExpr = e.position; + var orderMode = singleTooltipModel.get('order'); + var builtMarkupText = buildTooltipMarkup(articleMarkup, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'), singleTooltipModel.get('textStyle')); + builtMarkupText && markupTextArrLegacy.unshift(builtMarkupText); + var blockBreak = renderMode === 'richText' ? '\n\n' : '
              '; + var allMarkupText = markupTextArrLegacy.join(blockBreak); + + this._showOrMove(singleTooltipModel, function () { + if (this._updateContentNotChangedOnAxis(dataByCoordSys, cbParamsList)) { + this._updatePosition(singleTooltipModel, positionExpr, point[0], point[1], this._tooltipContent, cbParamsList); + } else { + this._showTooltipContent(singleTooltipModel, allMarkupText, cbParamsList, Math.random() + '', point[0], point[1], positionExpr, null, markupStyleCreator); + } + }); // Do not trigger events here, because this branch only be entered + // from dispatchAction. + + }; + + TooltipView.prototype._showSeriesItemTooltip = function (e, dispatcher, dispatchAction) { + var ecModel = this._ecModel; + var ecData = getECData(dispatcher); // Use dataModel in element if possible + // Used when mouseover on a element like markPoint or edge + // In which case, the data is not main data in series. + + var seriesIndex = ecData.seriesIndex; + var seriesModel = ecModel.getSeriesByIndex(seriesIndex); // For example, graph link. + + var dataModel = ecData.dataModel || seriesModel; + var dataIndex = ecData.dataIndex; + var dataType = ecData.dataType; + var data = dataModel.getData(dataType); + var renderMode = this._renderMode; + var positionDefault = e.positionDefault; + var tooltipModel = buildTooltipModel([data.getItemModel(dataIndex), dataModel, seriesModel && (seriesModel.coordinateSystem || {}).model], this._tooltipModel, positionDefault ? { + position: positionDefault + } : null); + var tooltipTrigger = tooltipModel.get('trigger'); + + if (tooltipTrigger != null && tooltipTrigger !== 'item') { + return; + } + + var params = dataModel.getDataParams(dataIndex, dataType); + var markupStyleCreator = new TooltipMarkupStyleCreator(); // Pre-create marker style for makers. Users can assemble richText + // text in `formatter` callback and use those markers style. + + params.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(params.color), renderMode); + var seriesTooltipResult = normalizeTooltipFormatResult(dataModel.formatTooltip(dataIndex, false, dataType)); + var orderMode = tooltipModel.get('order'); + var valueFormatter = tooltipModel.get('valueFormatter'); + var frag = seriesTooltipResult.frag; + var markupText = frag ? buildTooltipMarkup(valueFormatter ? extend({ + valueFormatter: valueFormatter + }, frag) : frag, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'), tooltipModel.get('textStyle')) : seriesTooltipResult.text; + var asyncTicket = 'item_' + dataModel.name + '_' + dataIndex; + + this._showOrMove(tooltipModel, function () { + this._showTooltipContent(tooltipModel, markupText, params, asyncTicket, e.offsetX, e.offsetY, e.position, e.target, markupStyleCreator); + }); // FIXME + // duplicated showtip if manuallyShowTip is called from dispatchAction. - var params = dataModel.getDataParams(dataIndex, dataType); - var markupStyleCreator = new TooltipMarkupStyleCreator(); // Pre-create marker style for makers. Users can assemble richText - // text in `formatter` callback and use those markers style. - - params.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(params.color), renderMode); - var seriesTooltipResult = normalizeTooltipFormatResult(dataModel.formatTooltip(dataIndex, false, dataType)); - var orderMode = tooltipModel.get('order'); - var valueFormatter = tooltipModel.get('valueFormatter'); - var frag = seriesTooltipResult.frag; - var markupText = frag ? buildTooltipMarkup(valueFormatter ? extend({ - valueFormatter: valueFormatter - }, frag) : frag, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'), tooltipModel.get('textStyle')) : seriesTooltipResult.text; - var asyncTicket = 'item_' + dataModel.name + '_' + dataIndex; - - this._showOrMove(tooltipModel, function () { - this._showTooltipContent(tooltipModel, markupText, params, asyncTicket, e.offsetX, e.offsetY, e.position, e.target, markupStyleCreator); - }); // FIXME - // duplicated showtip if manuallyShowTip is called from dispatchAction. - - - dispatchAction({ - type: 'showTip', - dataIndexInside: dataIndex, - dataIndex: data.getRawIndex(dataIndex), - seriesIndex: seriesIndex, - from: this.uid - }); - }; - TooltipView.prototype._showComponentItemTooltip = function (e, el, dispatchAction) { - var ecData = getECData(el); - var tooltipConfig = ecData.tooltipConfig; - var tooltipOpt = tooltipConfig.option || {}; - - if (isString(tooltipOpt)) { - var content = tooltipOpt; - tooltipOpt = { - content: content, - // Fixed formatter - formatter: content - }; - } + dispatchAction({ + type: 'showTip', + dataIndexInside: dataIndex, + dataIndex: data.getRawIndex(dataIndex), + seriesIndex: seriesIndex, + from: this.uid + }); + }; - var tooltipModelCascade = [tooltipOpt]; + TooltipView.prototype._showComponentItemTooltip = function (e, el, dispatchAction) { + var ecData = getECData(el); + var tooltipConfig = ecData.tooltipConfig; + var tooltipOpt = tooltipConfig.option || {}; - var cmpt = this._ecModel.getComponent(ecData.componentMainType, ecData.componentIndex); + if (isString(tooltipOpt)) { + var content = tooltipOpt; + tooltipOpt = { + content: content, + // Fixed formatter + formatter: content + }; + } - if (cmpt) { - tooltipModelCascade.push(cmpt); - } // In most cases, component tooltip formatter has different params with series tooltip formatter, - // so that they can not share the same formatter. Since the global tooltip formatter is used for series - // by convension, we do not use it as the default formatter for component. + var tooltipModelCascade = [tooltipOpt]; + var cmpt = this._ecModel.getComponent(ecData.componentMainType, ecData.componentIndex); - tooltipModelCascade.push({ - formatter: tooltipOpt.content - }); - var positionDefault = e.positionDefault; - var subTooltipModel = buildTooltipModel(tooltipModelCascade, this._tooltipModel, positionDefault ? { - position: positionDefault - } : null); - var defaultHtml = subTooltipModel.get('content'); - var asyncTicket = Math.random() + ''; // PENDING: this case do not support richText style yet. + if (cmpt) { + tooltipModelCascade.push(cmpt); + } // In most cases, component tooltip formatter has different params with series tooltip formatter, + // so that they can not share the same formatter. Since the global tooltip formatter is used for series + // by convension, we do not use it as the default formatter for component. - var markupStyleCreator = new TooltipMarkupStyleCreator(); // Do not check whether `trigger` is 'none' here, because `trigger` - // only works on coordinate system. In fact, we have not found case - // that requires setting `trigger` nothing on component yet. - this._showOrMove(subTooltipModel, function () { - // Use formatterParams from element defined in component - // Avoid users modify it. - var formatterParams = clone(subTooltipModel.get('formatterParams') || {}); + tooltipModelCascade.push({ + formatter: tooltipOpt.content + }); + var positionDefault = e.positionDefault; + var subTooltipModel = buildTooltipModel(tooltipModelCascade, this._tooltipModel, positionDefault ? { + position: positionDefault + } : null); + var defaultHtml = subTooltipModel.get('content'); + var asyncTicket = Math.random() + ''; // PENDING: this case do not support richText style yet. - this._showTooltipContent(subTooltipModel, defaultHtml, formatterParams, asyncTicket, e.offsetX, e.offsetY, e.position, el, markupStyleCreator); - }); // If not dispatch showTip, tip may be hide triggered by axis. + var markupStyleCreator = new TooltipMarkupStyleCreator(); // Do not check whether `trigger` is 'none' here, because `trigger` + // only works on coordinate system. In fact, we have not found case + // that requires setting `trigger` nothing on component yet. + this._showOrMove(subTooltipModel, function () { + // Use formatterParams from element defined in component + // Avoid users modify it. + var formatterParams = clone(subTooltipModel.get('formatterParams') || {}); - dispatchAction({ - type: 'showTip', - from: this.uid - }); - }; + this._showTooltipContent(subTooltipModel, defaultHtml, formatterParams, asyncTicket, e.offsetX, e.offsetY, e.position, el, markupStyleCreator); + }); // If not dispatch showTip, tip may be hide triggered by axis. - TooltipView.prototype._showTooltipContent = function ( // Use Model insteadof TooltipModel because this model may be from series or other options. - // Instead of top level tooltip. - tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markupStyleCreator) { - // Reset ticket - this._ticket = ''; - if (!tooltipModel.get('showContent') || !tooltipModel.get('show')) { - return; - } + dispatchAction({ + type: 'showTip', + from: this.uid + }); + }; - var tooltipContent = this._tooltipContent; - tooltipContent.setEnterable(tooltipModel.get('enterable')); - var formatter = tooltipModel.get('formatter'); - positionExpr = positionExpr || tooltipModel.get('position'); - var html = defaultHtml; + TooltipView.prototype._showTooltipContent = function ( // Use Model insteadof TooltipModel because this model may be from series or other options. + // Instead of top level tooltip. + tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markupStyleCreator) { + // Reset ticket + this._ticket = ''; - var nearPoint = this._getNearestPoint([x, y], params, tooltipModel.get('trigger'), tooltipModel.get('borderColor')); + if (!tooltipModel.get('showContent') || !tooltipModel.get('show')) { + return; + } - var nearPointColor = nearPoint.color; + var tooltipContent = this._tooltipContent; + tooltipContent.setEnterable(tooltipModel.get('enterable')); + var formatter = tooltipModel.get('formatter'); + positionExpr = positionExpr || tooltipModel.get('position'); + var html = defaultHtml; - if (formatter) { - if (isString(formatter)) { - var useUTC = tooltipModel.ecModel.get('useUTC'); - var params0 = isArray(params) ? params[0] : params; - var isTimeAxis = params0 && params0.axisType && params0.axisType.indexOf('time') >= 0; - html = formatter; + var nearPoint = this._getNearestPoint([x, y], params, tooltipModel.get('trigger'), tooltipModel.get('borderColor')); - if (isTimeAxis) { - html = format(params0.axisValue, html, useUTC); - } + var nearPointColor = nearPoint.color; - html = formatTpl(html, params, true); - } else if (isFunction(formatter)) { - var callback = bind(function (cbTicket, html) { - if (cbTicket === this._ticket) { - tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr); + if (formatter) { + if (isString(formatter)) { + var useUTC = tooltipModel.ecModel.get('useUTC'); + var params0 = isArray(params) ? params[0] : params; + var isTimeAxis = params0 && params0.axisType && params0.axisType.indexOf('time') >= 0; + html = formatter; - this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el); - } - }, this); - this._ticket = asyncTicket; - html = formatter(params, asyncTicket, callback); - } else { - html = formatter; - } - } + if (isTimeAxis) { + html = format(params0.axisValue, html, useUTC); + } + html = formatTpl(html, params, true); + } else if (isFunction(formatter)) { + var callback = bind(function (cbTicket, html) { + if (cbTicket === this._ticket) { tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr); - tooltipContent.show(tooltipModel, nearPointColor); this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el); - }; - - TooltipView.prototype._getNearestPoint = function (point, tooltipDataParams, trigger, borderColor) { - if (trigger === 'axis' || isArray(tooltipDataParams)) { - return { - color: borderColor || (this._renderMode === 'html' ? '#fff' : 'none') - }; - } - - if (!isArray(tooltipDataParams)) { - return { - color: borderColor || tooltipDataParams.color || tooltipDataParams.borderColor - }; - } - }; - - TooltipView.prototype._updatePosition = function (tooltipModel, positionExpr, x, // Mouse x - y, // Mouse y - content, params, el) { - var viewWidth = this._api.getWidth(); - - var viewHeight = this._api.getHeight(); - - positionExpr = positionExpr || tooltipModel.get('position'); - var contentSize = content.getSize(); - var align = tooltipModel.get('align'); - var vAlign = tooltipModel.get('verticalAlign'); - var rect = el && el.getBoundingRect().clone(); - el && rect.applyTransform(el.transform); - - if (isFunction(positionExpr)) { - // Callback of position can be an array or a string specify the position - positionExpr = positionExpr([x, y], params, content.el, rect, { - viewSize: [viewWidth, viewHeight], - contentSize: contentSize.slice() - }); - } - - if (isArray(positionExpr)) { - x = parsePercent$1(positionExpr[0], viewWidth); - y = parsePercent$1(positionExpr[1], viewHeight); - } else if (isObject(positionExpr)) { - var boxLayoutPosition = positionExpr; - boxLayoutPosition.width = contentSize[0]; - boxLayoutPosition.height = contentSize[1]; - var layoutRect = getLayoutRect(boxLayoutPosition, { - width: viewWidth, - height: viewHeight - }); - x = layoutRect.x; - y = layoutRect.y; - align = null; // When positionExpr is left/top/right/bottom, - // align and verticalAlign will not work. - - vAlign = null; - } // Specify tooltip position by string 'top' 'bottom' 'left' 'right' around graphic element - else if (isString(positionExpr) && el) { - var pos = calcTooltipPosition(positionExpr, rect, contentSize, tooltipModel.get('borderWidth')); - x = pos[0]; - y = pos[1]; - } else { - var pos = refixTooltipPosition(x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20); - x = pos[0]; - y = pos[1]; - } - - align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === 'right' ? contentSize[0] : 0); - vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === 'bottom' ? contentSize[1] : 0); - - if (shouldTooltipConfine(tooltipModel)) { - var pos = confineTooltipPosition(x, y, content, viewWidth, viewHeight); - x = pos[0]; - y = pos[1]; - } - - content.moveTo(x, y); - }; // FIXME - // Should we remove this but leave this to user? - - - TooltipView.prototype._updateContentNotChangedOnAxis = function (dataByCoordSys, cbParamsList) { - var lastCoordSys = this._lastDataByCoordSys; - var lastCbParamsList = this._cbParamsList; - var contentNotChanged = !!lastCoordSys && lastCoordSys.length === dataByCoordSys.length; - contentNotChanged && each(lastCoordSys, function (lastItemCoordSys, indexCoordSys) { - var lastDataByAxis = lastItemCoordSys.dataByAxis || []; - var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {}; - var thisDataByAxis = thisItemCoordSys.dataByAxis || []; - contentNotChanged = contentNotChanged && lastDataByAxis.length === thisDataByAxis.length; - contentNotChanged && each(lastDataByAxis, function (lastItem, indexAxis) { - var thisItem = thisDataByAxis[indexAxis] || {}; - var lastIndices = lastItem.seriesDataIndices || []; - var newIndices = thisItem.seriesDataIndices || []; - contentNotChanged = contentNotChanged && lastItem.value === thisItem.value && lastItem.axisType === thisItem.axisType && lastItem.axisId === thisItem.axisId && lastIndices.length === newIndices.length; - contentNotChanged && each(lastIndices, function (lastIdxItem, j) { - var newIdxItem = newIndices[j]; - contentNotChanged = contentNotChanged && lastIdxItem.seriesIndex === newIdxItem.seriesIndex && lastIdxItem.dataIndex === newIdxItem.dataIndex; - }); // check is cbParams data value changed - - lastCbParamsList && each(lastItem.seriesDataIndices, function (idxItem) { - var seriesIdx = idxItem.seriesIndex; - var cbParams = cbParamsList[seriesIdx]; - var lastCbParams = lastCbParamsList[seriesIdx]; - - if (cbParams && lastCbParams && lastCbParams.data !== cbParams.data) { - contentNotChanged = false; - } - }); - }); - }); - this._lastDataByCoordSys = dataByCoordSys; - this._cbParamsList = cbParamsList; - return !!contentNotChanged; - }; - - TooltipView.prototype._hide = function (dispatchAction) { - // Do not directly hideLater here, because this behavior may be prevented - // in dispatchAction when showTip is dispatched. - // FIXME - // duplicated hideTip if manuallyHideTip is called from dispatchAction. - this._lastDataByCoordSys = null; - dispatchAction({ - type: 'hideTip', - from: this.uid - }); - }; + } + }, this); + this._ticket = asyncTicket; + html = formatter(params, asyncTicket, callback); + } else { + html = formatter; + } + } + + tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr); + tooltipContent.show(tooltipModel, nearPointColor); + + this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el); + }; + + TooltipView.prototype._getNearestPoint = function (point, tooltipDataParams, trigger, borderColor) { + if (trigger === 'axis' || isArray(tooltipDataParams)) { + return { + color: borderColor || (this._renderMode === 'html' ? '#fff' : 'none') + }; + } + + if (!isArray(tooltipDataParams)) { + return { + color: borderColor || tooltipDataParams.color || tooltipDataParams.borderColor + }; + } + }; + + TooltipView.prototype._updatePosition = function (tooltipModel, positionExpr, x, // Mouse x + y, // Mouse y + content, params, el) { + var viewWidth = this._api.getWidth(); + + var viewHeight = this._api.getHeight(); + + positionExpr = positionExpr || tooltipModel.get('position'); + var contentSize = content.getSize(); + var align = tooltipModel.get('align'); + var vAlign = tooltipModel.get('verticalAlign'); + var rect = el && el.getBoundingRect().clone(); + el && rect.applyTransform(el.transform); + + if (isFunction(positionExpr)) { + // Callback of position can be an array or a string specify the position + positionExpr = positionExpr([x, y], params, content.el, rect, { + viewSize: [viewWidth, viewHeight], + contentSize: contentSize.slice() + }); + } + + if (isArray(positionExpr)) { + x = parsePercent$1(positionExpr[0], viewWidth); + y = parsePercent$1(positionExpr[1], viewHeight); + } else if (isObject(positionExpr)) { + var boxLayoutPosition = positionExpr; + boxLayoutPosition.width = contentSize[0]; + boxLayoutPosition.height = contentSize[1]; + var layoutRect = getLayoutRect(boxLayoutPosition, { + width: viewWidth, + height: viewHeight + }); + x = layoutRect.x; + y = layoutRect.y; + align = null; // When positionExpr is left/top/right/bottom, + // align and verticalAlign will not work. + + vAlign = null; + } // Specify tooltip position by string 'top' 'bottom' 'left' 'right' around graphic element + else if (isString(positionExpr) && el) { + var pos = calcTooltipPosition(positionExpr, rect, contentSize, tooltipModel.get('borderWidth')); + x = pos[0]; + y = pos[1]; + } else { + var pos = refixTooltipPosition(x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20); + x = pos[0]; + y = pos[1]; + } + + align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === 'right' ? contentSize[0] : 0); + vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === 'bottom' ? contentSize[1] : 0); + + if (shouldTooltipConfine(tooltipModel)) { + var pos = confineTooltipPosition(x, y, content, viewWidth, viewHeight); + x = pos[0]; + y = pos[1]; + } + + content.moveTo(x, y); + }; // FIXME + // Should we remove this but leave this to user? + + + TooltipView.prototype._updateContentNotChangedOnAxis = function (dataByCoordSys, cbParamsList) { + var lastCoordSys = this._lastDataByCoordSys; + var lastCbParamsList = this._cbParamsList; + var contentNotChanged = !!lastCoordSys && lastCoordSys.length === dataByCoordSys.length; + contentNotChanged && each(lastCoordSys, function (lastItemCoordSys, indexCoordSys) { + var lastDataByAxis = lastItemCoordSys.dataByAxis || []; + var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {}; + var thisDataByAxis = thisItemCoordSys.dataByAxis || []; + contentNotChanged = contentNotChanged && lastDataByAxis.length === thisDataByAxis.length; + contentNotChanged && each(lastDataByAxis, function (lastItem, indexAxis) { + var thisItem = thisDataByAxis[indexAxis] || {}; + var lastIndices = lastItem.seriesDataIndices || []; + var newIndices = thisItem.seriesDataIndices || []; + contentNotChanged = contentNotChanged && lastItem.value === thisItem.value && lastItem.axisType === thisItem.axisType && lastItem.axisId === thisItem.axisId && lastIndices.length === newIndices.length; + contentNotChanged && each(lastIndices, function (lastIdxItem, j) { + var newIdxItem = newIndices[j]; + contentNotChanged = contentNotChanged && lastIdxItem.seriesIndex === newIdxItem.seriesIndex && lastIdxItem.dataIndex === newIdxItem.dataIndex; + }); // check is cbParams data value changed + + lastCbParamsList && each(lastItem.seriesDataIndices, function (idxItem) { + var seriesIdx = idxItem.seriesIndex; + var cbParams = cbParamsList[seriesIdx]; + var lastCbParams = lastCbParamsList[seriesIdx]; + + if (cbParams && lastCbParams && lastCbParams.data !== cbParams.data) { + contentNotChanged = false; + } + }); + }); + }); + this._lastDataByCoordSys = dataByCoordSys; + this._cbParamsList = cbParamsList; + return !!contentNotChanged; + }; + + TooltipView.prototype._hide = function (dispatchAction) { + // Do not directly hideLater here, because this behavior may be prevented + // in dispatchAction when showTip is dispatched. + // FIXME + // duplicated hideTip if manuallyHideTip is called from dispatchAction. + this._lastDataByCoordSys = null; + dispatchAction({ + type: 'hideTip', + from: this.uid + }); + }; - TooltipView.prototype.dispose = function (ecModel, api) { - if (env.node || !api.getDom()) { - return; - } + TooltipView.prototype.dispose = function (ecModel, api) { + if (env.node || !api.getDom()) { + return; + } - clear(this, '_updatePosition'); + clear(this, '_updatePosition'); - this._tooltipContent.dispose(); + this._tooltipContent.dispose(); - unregister('itemTooltip', api); - }; + unregister('itemTooltip', api); + }; - TooltipView.type = 'tooltip'; - return TooltipView; - }(ComponentView); + TooltipView.type = 'tooltip'; + return TooltipView; + }(ComponentView); /** * From top to bottom. (the last one should be globalTooltipModel); */ function buildTooltipModel(modelCascade, globalTooltipModel, defaultTooltipOption) { - // Last is always tooltip model. - var ecModel = globalTooltipModel.ecModel; - var resultModel; - - if (defaultTooltipOption) { - resultModel = new Model(defaultTooltipOption, ecModel, ecModel); - resultModel = new Model(globalTooltipModel.option, resultModel, ecModel); - } else { - resultModel = globalTooltipModel; - } + // Last is always tooltip model. + var ecModel = globalTooltipModel.ecModel; + var resultModel; - for (var i = modelCascade.length - 1; i >= 0; i--) { - var tooltipOpt = modelCascade[i]; + if (defaultTooltipOption) { + resultModel = new Model(defaultTooltipOption, ecModel, ecModel); + resultModel = new Model(globalTooltipModel.option, resultModel, ecModel); + } else { + resultModel = globalTooltipModel; + } - if (tooltipOpt) { - if (tooltipOpt instanceof Model) { - tooltipOpt = tooltipOpt.get('tooltip', true); - } // In each data item tooltip can be simply write: - // { - // value: 10, - // tooltip: 'Something you need to know' - // } + for (var i = modelCascade.length - 1; i >= 0; i--) { + var tooltipOpt = modelCascade[i]; + if (tooltipOpt) { + if (tooltipOpt instanceof Model) { + tooltipOpt = tooltipOpt.get('tooltip', true); + } // In each data item tooltip can be simply write: + // { + // value: 10, + // tooltip: 'Something you need to know' + // } - if (isString(tooltipOpt)) { - tooltipOpt = { - formatter: tooltipOpt - }; - } - if (tooltipOpt) { - resultModel = new Model(tooltipOpt, resultModel, ecModel); - } - } + if (isString(tooltipOpt)) { + tooltipOpt = { + formatter: tooltipOpt + }; + } + + if (tooltipOpt) { + resultModel = new Model(tooltipOpt, resultModel, ecModel); + } } + } - return resultModel; + return resultModel; } function makeDispatchAction$1(payload, api) { - return payload.dispatchAction || bind(api.dispatchAction, api); + return payload.dispatchAction || bind(api.dispatchAction, api); } function refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH, gapV) { - var size = content.getSize(); - var width = size[0]; - var height = size[1]; - - if (gapH != null) { - // Add extra 2 pixels for this case: - // At present the "values" in defaut tooltip are using CSS `float: right`. - // When the right edge of the tooltip box is on the right side of the - // viewport, the `float` layout might push the "values" to the second line. - if (x + width + gapH + 2 > viewWidth) { - x -= width + gapH; - } else { - x += gapH; - } + var size = content.getSize(); + var width = size[0]; + var height = size[1]; + + if (gapH != null) { + // Add extra 2 pixels for this case: + // At present the "values" in defaut tooltip are using CSS `float: right`. + // When the right edge of the tooltip box is on the right side of the + // viewport, the `float` layout might push the "values" to the second line. + if (x + width + gapH + 2 > viewWidth) { + x -= width + gapH; + } else { + x += gapH; } + } - if (gapV != null) { - if (y + height + gapV > viewHeight) { - y -= height + gapV; - } else { - y += gapV; - } + if (gapV != null) { + if (y + height + gapV > viewHeight) { + y -= height + gapV; + } else { + y += gapV; } + } - return [x, y]; + return [x, y]; } function confineTooltipPosition(x, y, content, viewWidth, viewHeight) { - var size = content.getSize(); - var width = size[0]; - var height = size[1]; - x = Math.min(x + width, viewWidth) - width; - y = Math.min(y + height, viewHeight) - height; - x = Math.max(x, 0); - y = Math.max(y, 0); - return [x, y]; + var size = content.getSize(); + var width = size[0]; + var height = size[1]; + x = Math.min(x + width, viewWidth) - width; + y = Math.min(y + height, viewHeight) - height; + x = Math.max(x, 0); + y = Math.max(y, 0); + return [x, y]; } function calcTooltipPosition(position, rect, contentSize, borderWidth) { - var domWidth = contentSize[0]; - var domHeight = contentSize[1]; - var offset = Math.ceil(Math.SQRT2 * borderWidth) + 8; - var x = 0; - var y = 0; - var rectWidth = rect.width; - var rectHeight = rect.height; - - switch (position) { - case 'inside': - x = rect.x + rectWidth / 2 - domWidth / 2; - y = rect.y + rectHeight / 2 - domHeight / 2; - break; - - case 'top': - x = rect.x + rectWidth / 2 - domWidth / 2; - y = rect.y - domHeight - offset; - break; - - case 'bottom': - x = rect.x + rectWidth / 2 - domWidth / 2; - y = rect.y + rectHeight + offset; - break; - - case 'left': - x = rect.x - domWidth - offset; - y = rect.y + rectHeight / 2 - domHeight / 2; - break; - - case 'right': - x = rect.x + rectWidth + offset; - y = rect.y + rectHeight / 2 - domHeight / 2; - } - - return [x, y]; + var domWidth = contentSize[0]; + var domHeight = contentSize[1]; + var offset = Math.ceil(Math.SQRT2 * borderWidth) + 8; + var x = 0; + var y = 0; + var rectWidth = rect.width; + var rectHeight = rect.height; + + switch (position) { + case 'inside': + x = rect.x + rectWidth / 2 - domWidth / 2; + y = rect.y + rectHeight / 2 - domHeight / 2; + break; + + case 'top': + x = rect.x + rectWidth / 2 - domWidth / 2; + y = rect.y - domHeight - offset; + break; + + case 'bottom': + x = rect.x + rectWidth / 2 - domWidth / 2; + y = rect.y + rectHeight + offset; + break; + + case 'left': + x = rect.x - domWidth - offset; + y = rect.y + rectHeight / 2 - domHeight / 2; + break; + + case 'right': + x = rect.x + rectWidth + offset; + y = rect.y + rectHeight / 2 - domHeight / 2; + } + + return [x, y]; } function isCenterAlign(align) { - return align === 'center' || align === 'middle'; + return align === 'center' || align === 'middle'; } /** * Find target component by payload like: @@ -83290,186 +83290,186 @@ function findComponentReference(payload, ecModel, api) { - var queryOptionMap = preParseFinder(payload).queryOptionMap; - var componentMainType = queryOptionMap.keys()[0]; - - if (!componentMainType || componentMainType === 'series') { - return; - } + var queryOptionMap = preParseFinder(payload).queryOptionMap; + var componentMainType = queryOptionMap.keys()[0]; - var queryResult = queryReferringComponents(ecModel, componentMainType, queryOptionMap.get(componentMainType), { - useDefault: false, - enableAll: false, - enableNone: false - }); - var model = queryResult.models[0]; + if (!componentMainType || componentMainType === 'series') { + return; + } - if (!model) { - return; - } + var queryResult = queryReferringComponents(ecModel, componentMainType, queryOptionMap.get(componentMainType), { + useDefault: false, + enableAll: false, + enableNone: false + }); + var model = queryResult.models[0]; - var view = api.getViewOfComponentModel(model); - var el; - view.group.traverse(function (subEl) { - var tooltipConfig = getECData(subEl).tooltipConfig; + if (!model) { + return; + } - if (tooltipConfig && tooltipConfig.name === payload.name) { - el = subEl; - return true; // stop - } - }); + var view = api.getViewOfComponentModel(model); + var el; + view.group.traverse(function (subEl) { + var tooltipConfig = getECData(subEl).tooltipConfig; - if (el) { - return { - componentMainType: componentMainType, - componentIndex: model.componentIndex, - el: el - }; + if (tooltipConfig && tooltipConfig.name === payload.name) { + el = subEl; + return true; // stop } + }); + + if (el) { + return { + componentMainType: componentMainType, + componentIndex: model.componentIndex, + el: el + }; + } } function install$A(registers) { - use(install$s); - registers.registerComponentModel(TooltipModel); - registers.registerComponentView(TooltipView); - /** - * @action - * @property {string} type - * @property {number} seriesIndex - * @property {number} dataIndex - * @property {number} [x] - * @property {number} [y] - */ + use(install$s); + registers.registerComponentModel(TooltipModel); + registers.registerComponentView(TooltipView); + /** + * @action + * @property {string} type + * @property {number} seriesIndex + * @property {number} dataIndex + * @property {number} [x] + * @property {number} [y] + */ - registers.registerAction({ - type: 'showTip', - event: 'showTip', - update: 'tooltip:manuallyShowTip' - }, noop); - registers.registerAction({ - type: 'hideTip', - event: 'hideTip', - update: 'tooltip:manuallyHideTip' - }, noop); + registers.registerAction({ + type: 'showTip', + event: 'showTip', + update: 'tooltip:manuallyShowTip' + }, noop); + registers.registerAction({ + type: 'hideTip', + event: 'hideTip', + update: 'tooltip:manuallyHideTip' + }, noop); } var DEFAULT_TOOLBOX_BTNS = ['rect', 'polygon', 'keep', 'clear']; function brushPreprocessor(option, isNew) { - var brushComponents = normalizeToArray(option ? option.brush : []); - - if (!brushComponents.length) { - return; - } + var brushComponents = normalizeToArray(option ? option.brush : []); - var brushComponentSpecifiedBtns = []; - each(brushComponents, function (brushOpt) { - var tbs = brushOpt.hasOwnProperty('toolbox') ? brushOpt.toolbox : []; + if (!brushComponents.length) { + return; + } - if (tbs instanceof Array) { - brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs); - } - }); - var toolbox = option && option.toolbox; + var brushComponentSpecifiedBtns = []; + each(brushComponents, function (brushOpt) { + var tbs = brushOpt.hasOwnProperty('toolbox') ? brushOpt.toolbox : []; - if (isArray(toolbox)) { - toolbox = toolbox[0]; + if (tbs instanceof Array) { + brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs); } + }); + var toolbox = option && option.toolbox; - if (!toolbox) { - toolbox = { - feature: {} - }; - option.toolbox = [toolbox]; - } + if (isArray(toolbox)) { + toolbox = toolbox[0]; + } + + if (!toolbox) { + toolbox = { + feature: {} + }; + option.toolbox = [toolbox]; + } - var toolboxFeature = toolbox.feature || (toolbox.feature = {}); - var toolboxBrush = toolboxFeature.brush || (toolboxFeature.brush = {}); - var brushTypes = toolboxBrush.type || (toolboxBrush.type = []); - brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns); - removeDuplicate(brushTypes); + var toolboxFeature = toolbox.feature || (toolbox.feature = {}); + var toolboxBrush = toolboxFeature.brush || (toolboxFeature.brush = {}); + var brushTypes = toolboxBrush.type || (toolboxBrush.type = []); + brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns); + removeDuplicate(brushTypes); - if (isNew && !brushTypes.length) { - brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS); - } + if (isNew && !brushTypes.length) { + brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS); + } } function removeDuplicate(arr) { - var map = {}; - each(arr, function (val) { - map[val] = 1; - }); - arr.length = 0; - each(map, function (flag, val) { - arr.push(val); - }); + var map = {}; + each(arr, function (val) { + map[val] = 1; + }); + arr.length = 0; + each(map, function (flag, val) { + arr.push(val); + }); } var each$b = each; function hasKeys(obj) { - if (obj) { - for (var name_1 in obj) { - if (obj.hasOwnProperty(name_1)) { - return true; - } - } + if (obj) { + for (var name_1 in obj) { + if (obj.hasOwnProperty(name_1)) { + return true; + } } + } } function createVisualMappings(option, stateList, supplementVisualOption) { - var visualMappings = {}; - each$b(stateList, function (state) { - var mappings = visualMappings[state] = createMappings(); - each$b(option[state], function (visualData, visualType) { - if (!VisualMapping.isValidType(visualType)) { - return; - } - - var mappingOption = { - type: visualType, - visual: visualData - }; - supplementVisualOption && supplementVisualOption(mappingOption, state); - mappings[visualType] = new VisualMapping(mappingOption); // Prepare a alpha for opacity, for some case that opacity - // is not supported, such as rendering using gradient color. - - if (visualType === 'opacity') { - mappingOption = clone(mappingOption); - mappingOption.type = 'colorAlpha'; - mappings.__hidden.__alphaForOpacity = new VisualMapping(mappingOption); - } - }); + var visualMappings = {}; + each$b(stateList, function (state) { + var mappings = visualMappings[state] = createMappings(); + each$b(option[state], function (visualData, visualType) { + if (!VisualMapping.isValidType(visualType)) { + return; + } + + var mappingOption = { + type: visualType, + visual: visualData + }; + supplementVisualOption && supplementVisualOption(mappingOption, state); + mappings[visualType] = new VisualMapping(mappingOption); // Prepare a alpha for opacity, for some case that opacity + // is not supported, such as rendering using gradient color. + + if (visualType === 'opacity') { + mappingOption = clone(mappingOption); + mappingOption.type = 'colorAlpha'; + mappings.__hidden.__alphaForOpacity = new VisualMapping(mappingOption); + } }); - return visualMappings; + }); + return visualMappings; - function createMappings() { - var Creater = function () {}; // Make sure hidden fields will not be visited by - // object iteration (with hasOwnProperty checking). + function createMappings() { + var Creater = function () {}; // Make sure hidden fields will not be visited by + // object iteration (with hasOwnProperty checking). - Creater.prototype.__hidden = Creater.prototype; - var obj = new Creater(); - return obj; - } + Creater.prototype.__hidden = Creater.prototype; + var obj = new Creater(); + return obj; + } } function replaceVisualOption(thisOption, newOption, keys) { - // Visual attributes merge is not supported, otherwise it - // brings overcomplicated merge logic. See #2853. So if - // newOption has anyone of these keys, all of these keys - // will be reset. Otherwise, all keys remain. - var has; - each(keys, function (key) { - if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) { - has = true; - } - }); - has && each(keys, function (key) { - if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) { - thisOption[key] = clone(newOption[key]); - } else { - delete thisOption[key]; - } - }); + // Visual attributes merge is not supported, otherwise it + // brings overcomplicated merge logic. See #2853. So if + // newOption has anyone of these keys, all of these keys + // will be reset. Otherwise, all keys remain. + var has; + each(keys, function (key) { + if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) { + has = true; + } + }); + has && each(keys, function (key) { + if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) { + thisOption[key] = clone(newOption[key]); + } else { + delete thisOption[key]; + } + }); } /** * @param stateList @@ -83482,46 +83482,46 @@ // ???! handle brush? function applyVisual(stateList, visualMappings, data, getValueState, scope, dimension) { - var visualTypesMap = {}; - each(stateList, function (state) { - var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]); - visualTypesMap[state] = visualTypes; - }); - var dataIndex; - - function getVisual(key) { - return getItemVisualFromData(data, dataIndex, key); - } - - function setVisual(key, value) { - setItemVisualFromData(data, dataIndex, key, value); - } + var visualTypesMap = {}; + each(stateList, function (state) { + var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]); + visualTypesMap[state] = visualTypes; + }); + var dataIndex; + + function getVisual(key) { + return getItemVisualFromData(data, dataIndex, key); + } + + function setVisual(key, value) { + setItemVisualFromData(data, dataIndex, key, value); + } + + if (dimension == null) { + data.each(eachItem); + } else { + data.each([dimension], eachItem); + } + + function eachItem(valueOrIndex, index) { + dataIndex = dimension == null ? valueOrIndex // First argument is index + : index; + var rawDataItem = data.getRawDataItem(dataIndex); // Consider performance + // @ts-ignore - if (dimension == null) { - data.each(eachItem); - } else { - data.each([dimension], eachItem); + if (rawDataItem && rawDataItem.visualMap === false) { + return; } - function eachItem(valueOrIndex, index) { - dataIndex = dimension == null ? valueOrIndex // First argument is index - : index; - var rawDataItem = data.getRawDataItem(dataIndex); // Consider performance - // @ts-ignore - - if (rawDataItem && rawDataItem.visualMap === false) { - return; - } - - var valueState = getValueState.call(scope, valueOrIndex); - var mappings = visualMappings[valueState]; - var visualTypes = visualTypesMap[valueState]; + var valueState = getValueState.call(scope, valueOrIndex); + var mappings = visualMappings[valueState]; + var visualTypes = visualTypesMap[valueState]; - for (var i = 0, len = visualTypes.length; i < len; i++) { - var type = visualTypes[i]; - mappings[type] && mappings[type].applyVisual(valueOrIndex, getVisual, setVisual); - } + for (var i = 0, len = visualTypes.length; i < len; i++) { + var type = visualTypes[i]; + mappings[type] && mappings[type].applyVisual(valueOrIndex, getVisual, setVisual); } + } } /** * @param data @@ -83532,1832 +83532,1832 @@ */ function incrementalApplyVisual(stateList, visualMappings, getValueState, dim) { - var visualTypesMap = {}; - each(stateList, function (state) { - var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]); - visualTypesMap[state] = visualTypes; - }); - return { - progress: function progress(params, data) { - var dimIndex; - - if (dim != null) { - dimIndex = data.getDimensionIndex(dim); - } - - function getVisual(key) { - return getItemVisualFromData(data, dataIndex, key); - } + var visualTypesMap = {}; + each(stateList, function (state) { + var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]); + visualTypesMap[state] = visualTypes; + }); + return { + progress: function progress(params, data) { + var dimIndex; + + if (dim != null) { + dimIndex = data.getDimensionIndex(dim); + } + + function getVisual(key) { + return getItemVisualFromData(data, dataIndex, key); + } - function setVisual(key, value) { - setItemVisualFromData(data, dataIndex, key, value); - } + function setVisual(key, value) { + setItemVisualFromData(data, dataIndex, key, value); + } - var dataIndex; - var store = data.getStore(); + var dataIndex; + var store = data.getStore(); - while ((dataIndex = params.next()) != null) { - var rawDataItem = data.getRawDataItem(dataIndex); // Consider performance - // @ts-ignore + while ((dataIndex = params.next()) != null) { + var rawDataItem = data.getRawDataItem(dataIndex); // Consider performance + // @ts-ignore - if (rawDataItem && rawDataItem.visualMap === false) { - continue; - } + if (rawDataItem && rawDataItem.visualMap === false) { + continue; + } - var value = dim != null ? store.get(dimIndex, dataIndex) : dataIndex; - var valueState = getValueState(value); - var mappings = visualMappings[valueState]; - var visualTypes = visualTypesMap[valueState]; + var value = dim != null ? store.get(dimIndex, dataIndex) : dataIndex; + var valueState = getValueState(value); + var mappings = visualMappings[valueState]; + var visualTypes = visualTypesMap[valueState]; - for (var i = 0, len = visualTypes.length; i < len; i++) { - var type = visualTypes[i]; - mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual); - } - } + for (var i = 0, len = visualTypes.length; i < len; i++) { + var type = visualTypes[i]; + mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual); } - }; + } + } + }; } function makeBrushCommonSelectorForSeries(area) { - var brushType = area.brushType; // Do not use function binding or curry for performance. + var brushType = area.brushType; // Do not use function binding or curry for performance. - var selectors = { - point: function (itemLayout) { - return selector[brushType].point(itemLayout, selectors, area); - }, - rect: function (itemLayout) { - return selector[brushType].rect(itemLayout, selectors, area); - } - }; - return selectors; + var selectors = { + point: function (itemLayout) { + return selector[brushType].point(itemLayout, selectors, area); + }, + rect: function (itemLayout) { + return selector[brushType].rect(itemLayout, selectors, area); + } + }; + return selectors; } var selector = { - lineX: getLineSelectors(0), - lineY: getLineSelectors(1), - rect: { - point: function (itemLayout, selectors, area) { - return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]); - }, - rect: function (itemLayout, selectors, area) { - return itemLayout && area.boundingRect.intersect(itemLayout); - } + lineX: getLineSelectors(0), + lineY: getLineSelectors(1), + rect: { + point: function (itemLayout, selectors, area) { + return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]); }, - polygon: { - point: function (itemLayout, selectors, area) { - return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]) && contain$2(area.range, itemLayout[0], itemLayout[1]); - }, - rect: function (itemLayout, selectors, area) { - var points = area.range; + rect: function (itemLayout, selectors, area) { + return itemLayout && area.boundingRect.intersect(itemLayout); + } + }, + polygon: { + point: function (itemLayout, selectors, area) { + return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]) && contain$2(area.range, itemLayout[0], itemLayout[1]); + }, + rect: function (itemLayout, selectors, area) { + var points = area.range; - if (!itemLayout || points.length <= 1) { - return false; - } + if (!itemLayout || points.length <= 1) { + return false; + } - var x = itemLayout.x; - var y = itemLayout.y; - var width = itemLayout.width; - var height = itemLayout.height; - var p = points[0]; + var x = itemLayout.x; + var y = itemLayout.y; + var width = itemLayout.width; + var height = itemLayout.height; + var p = points[0]; - if (contain$2(points, x, y) || contain$2(points, x + width, y) || contain$2(points, x, y + height) || contain$2(points, x + width, y + height) || BoundingRect.create(itemLayout).contain(p[0], p[1]) || linePolygonIntersect(x, y, x + width, y, points) || linePolygonIntersect(x, y, x, y + height, points) || linePolygonIntersect(x + width, y, x + width, y + height, points) || linePolygonIntersect(x, y + height, x + width, y + height, points)) { - return true; - } - } + if (contain$2(points, x, y) || contain$2(points, x + width, y) || contain$2(points, x, y + height) || contain$2(points, x + width, y + height) || BoundingRect.create(itemLayout).contain(p[0], p[1]) || linePolygonIntersect(x, y, x + width, y, points) || linePolygonIntersect(x, y, x, y + height, points) || linePolygonIntersect(x + width, y, x + width, y + height, points) || linePolygonIntersect(x, y + height, x + width, y + height, points)) { + return true; + } } + } }; function getLineSelectors(xyIndex) { - var xy = ['x', 'y']; - var wh = ['width', 'height']; - return { - point: function (itemLayout, selectors, area) { - if (itemLayout) { - var range = area.range; - var p = itemLayout[xyIndex]; - return inLineRange(p, range); - } - }, - rect: function (itemLayout, selectors, area) { - if (itemLayout) { - var range = area.range; - var layoutRange = [itemLayout[xy[xyIndex]], itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]]; - layoutRange[1] < layoutRange[0] && layoutRange.reverse(); - return inLineRange(layoutRange[0], range) || inLineRange(layoutRange[1], range) || inLineRange(range[0], layoutRange) || inLineRange(range[1], layoutRange); - } - } - }; + var xy = ['x', 'y']; + var wh = ['width', 'height']; + return { + point: function (itemLayout, selectors, area) { + if (itemLayout) { + var range = area.range; + var p = itemLayout[xyIndex]; + return inLineRange(p, range); + } + }, + rect: function (itemLayout, selectors, area) { + if (itemLayout) { + var range = area.range; + var layoutRange = [itemLayout[xy[xyIndex]], itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]]; + layoutRange[1] < layoutRange[0] && layoutRange.reverse(); + return inLineRange(layoutRange[0], range) || inLineRange(layoutRange[1], range) || inLineRange(range[0], layoutRange) || inLineRange(range[1], layoutRange); + } + } + }; } function inLineRange(p, range) { - return range[0] <= p && p <= range[1]; + return range[0] <= p && p <= range[1]; } var STATE_LIST = ['inBrush', 'outOfBrush']; var DISPATCH_METHOD = '__ecBrushSelect'; var DISPATCH_FLAG = '__ecInBrushSelectEvent'; function layoutCovers(ecModel) { - ecModel.eachComponent({ - mainType: 'brush' - }, function (brushModel) { - var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel); - brushTargetManager.setInputRanges(brushModel.areas, ecModel); - }); + ecModel.eachComponent({ + mainType: 'brush' + }, function (brushModel) { + var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel); + brushTargetManager.setInputRanges(brushModel.areas, ecModel); + }); } /** * Register the visual encoding if this modules required. */ function brushVisual(ecModel, api, payload) { - var brushSelected = []; - var throttleType; - var throttleDelay; - ecModel.eachComponent({ - mainType: 'brush' - }, function (brushModel) { - payload && payload.type === 'takeGlobalCursor' && brushModel.setBrushOption(payload.key === 'brush' ? payload.brushOption : { - brushType: false - }); + var brushSelected = []; + var throttleType; + var throttleDelay; + ecModel.eachComponent({ + mainType: 'brush' + }, function (brushModel) { + payload && payload.type === 'takeGlobalCursor' && brushModel.setBrushOption(payload.key === 'brush' ? payload.brushOption : { + brushType: false + }); + }); + layoutCovers(ecModel); + ecModel.eachComponent({ + mainType: 'brush' + }, function (brushModel, brushIndex) { + var thisBrushSelected = { + brushId: brushModel.id, + brushIndex: brushIndex, + brushName: brushModel.name, + areas: clone(brushModel.areas), + selected: [] + }; // Every brush component exists in event params, convenient + // for user to find by index. + + brushSelected.push(thisBrushSelected); + var brushOption = brushModel.option; + var brushLink = brushOption.brushLink; + var linkedSeriesMap = []; + var selectedDataIndexForLink = []; + var rangeInfoBySeries = []; + var hasBrushExists = false; + + if (!brushIndex) { + // Only the first throttle setting works. + throttleType = brushOption.throttleType; + throttleDelay = brushOption.throttleDelay; + } // Add boundingRect and selectors to range. + + + var areas = map(brushModel.areas, function (area) { + var builder = boundingRectBuilders[area.brushType]; + var selectableArea = defaults({ + boundingRect: builder ? builder(area) : void 0 + }, area); + selectableArea.selectors = makeBrushCommonSelectorForSeries(selectableArea); + return selectableArea; + }); + var visualMappings = createVisualMappings(brushModel.option, STATE_LIST, function (mappingOption) { + mappingOption.mappingMethod = 'fixed'; + }); + isArray(brushLink) && each(brushLink, function (seriesIndex) { + linkedSeriesMap[seriesIndex] = 1; }); - layoutCovers(ecModel); - ecModel.eachComponent({ - mainType: 'brush' - }, function (brushModel, brushIndex) { - var thisBrushSelected = { - brushId: brushModel.id, - brushIndex: brushIndex, - brushName: brushModel.name, - areas: clone(brushModel.areas), - selected: [] - }; // Every brush component exists in event params, convenient - // for user to find by index. - - brushSelected.push(thisBrushSelected); - var brushOption = brushModel.option; - var brushLink = brushOption.brushLink; - var linkedSeriesMap = []; - var selectedDataIndexForLink = []; - var rangeInfoBySeries = []; - var hasBrushExists = false; - - if (!brushIndex) { - // Only the first throttle setting works. - throttleType = brushOption.throttleType; - throttleDelay = brushOption.throttleDelay; - } // Add boundingRect and selectors to range. - - - var areas = map(brushModel.areas, function (area) { - var builder = boundingRectBuilders[area.brushType]; - var selectableArea = defaults({ - boundingRect: builder ? builder(area) : void 0 - }, area); - selectableArea.selectors = makeBrushCommonSelectorForSeries(selectableArea); - return selectableArea; - }); - var visualMappings = createVisualMappings(brushModel.option, STATE_LIST, function (mappingOption) { - mappingOption.mappingMethod = 'fixed'; - }); - isArray(brushLink) && each(brushLink, function (seriesIndex) { - linkedSeriesMap[seriesIndex] = 1; - }); - - function linkOthers(seriesIndex) { - return brushLink === 'all' || !!linkedSeriesMap[seriesIndex]; - } // If no supported brush or no brush on the series, - // all visuals should be in original state. - - function brushed(rangeInfoList) { - return !!rangeInfoList.length; - } - /** - * Logic for each series: (If the logic has to be modified one day, do it carefully!) - * - * ( brushed ┬ && ┬hasBrushExist ┬ && linkOthers ) => StepA: ┬record, ┬ StepB: ┬visualByRecord. - * !brushed┘ ├hasBrushExist ┤ └nothing,┘ ├visualByRecord. - * └!hasBrushExist┘ └nothing. - * ( !brushed && ┬hasBrushExist ┬ && linkOthers ) => StepA: nothing, StepB: ┬visualByRecord. - * └!hasBrushExist┘ └nothing. - * ( brushed ┬ && !linkOthers ) => StepA: nothing, StepB: ┬visualByCheck. - * !brushed┘ └nothing. - * ( !brushed && !linkOthers ) => StepA: nothing, StepB: nothing. - */ - // Step A + function linkOthers(seriesIndex) { + return brushLink === 'all' || !!linkedSeriesMap[seriesIndex]; + } // If no supported brush or no brush on the series, + // all visuals should be in original state. - ecModel.eachSeries(function (seriesModel, seriesIndex) { - var rangeInfoList = rangeInfoBySeries[seriesIndex] = []; - seriesModel.subType === 'parallel' ? stepAParallel(seriesModel, seriesIndex) : stepAOthers(seriesModel, seriesIndex, rangeInfoList); - }); + function brushed(rangeInfoList) { + return !!rangeInfoList.length; + } + /** + * Logic for each series: (If the logic has to be modified one day, do it carefully!) + * + * ( brushed ┬ && ┬hasBrushExist ┬ && linkOthers ) => StepA: ┬record, ┬ StepB: ┬visualByRecord. + * !brushed┘ ├hasBrushExist ┤ └nothing,┘ ├visualByRecord. + * └!hasBrushExist┘ └nothing. + * ( !brushed && ┬hasBrushExist ┬ && linkOthers ) => StepA: nothing, StepB: ┬visualByRecord. + * └!hasBrushExist┘ └nothing. + * ( brushed ┬ && !linkOthers ) => StepA: nothing, StepB: ┬visualByCheck. + * !brushed┘ └nothing. + * ( !brushed && !linkOthers ) => StepA: nothing, StepB: nothing. + */ + // Step A - function stepAParallel(seriesModel, seriesIndex) { - var coordSys = seriesModel.coordinateSystem; - hasBrushExists = hasBrushExists || coordSys.hasAxisBrushed(); - linkOthers(seriesIndex) && coordSys.eachActiveState(seriesModel.getData(), function (activeState, dataIndex) { - activeState === 'active' && (selectedDataIndexForLink[dataIndex] = 1); - }); - } - function stepAOthers(seriesModel, seriesIndex, rangeInfoList) { - if (!seriesModel.brushSelector || brushModelNotControll(brushModel, seriesIndex)) { - return; - } + ecModel.eachSeries(function (seriesModel, seriesIndex) { + var rangeInfoList = rangeInfoBySeries[seriesIndex] = []; + seriesModel.subType === 'parallel' ? stepAParallel(seriesModel, seriesIndex) : stepAOthers(seriesModel, seriesIndex, rangeInfoList); + }); - each(areas, function (area) { - if (brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel)) { - rangeInfoList.push(area); - } + function stepAParallel(seriesModel, seriesIndex) { + var coordSys = seriesModel.coordinateSystem; + hasBrushExists = hasBrushExists || coordSys.hasAxisBrushed(); + linkOthers(seriesIndex) && coordSys.eachActiveState(seriesModel.getData(), function (activeState, dataIndex) { + activeState === 'active' && (selectedDataIndexForLink[dataIndex] = 1); + }); + } - hasBrushExists = hasBrushExists || brushed(rangeInfoList); - }); + function stepAOthers(seriesModel, seriesIndex, rangeInfoList) { + if (!seriesModel.brushSelector || brushModelNotControll(brushModel, seriesIndex)) { + return; + } - if (linkOthers(seriesIndex) && brushed(rangeInfoList)) { - var data_1 = seriesModel.getData(); - data_1.each(function (dataIndex) { - if (checkInRange(seriesModel, rangeInfoList, data_1, dataIndex)) { - selectedDataIndexForLink[dataIndex] = 1; - } - }); - } - } // Step B + each(areas, function (area) { + if (brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel)) { + rangeInfoList.push(area); + } + hasBrushExists = hasBrushExists || brushed(rangeInfoList); + }); - ecModel.eachSeries(function (seriesModel, seriesIndex) { - var seriesBrushSelected = { - seriesId: seriesModel.id, - seriesIndex: seriesIndex, - seriesName: seriesModel.name, - dataIndex: [] - }; // Every series exists in event params, convenient - // for user to find series by seriesIndex. + if (linkOthers(seriesIndex) && brushed(rangeInfoList)) { + var data_1 = seriesModel.getData(); + data_1.each(function (dataIndex) { + if (checkInRange(seriesModel, rangeInfoList, data_1, dataIndex)) { + selectedDataIndexForLink[dataIndex] = 1; + } + }); + } + } // Step B - thisBrushSelected.selected.push(seriesBrushSelected); - var rangeInfoList = rangeInfoBySeries[seriesIndex]; - var data = seriesModel.getData(); - var getValueState = linkOthers(seriesIndex) ? function (dataIndex) { - return selectedDataIndexForLink[dataIndex] ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') : 'outOfBrush'; - } : function (dataIndex) { - return checkInRange(seriesModel, rangeInfoList, data, dataIndex) ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') : 'outOfBrush'; - }; // If no supported brush or no brush, all visuals are in original state. - (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList)) && applyVisual(STATE_LIST, visualMappings, data, getValueState); - }); + ecModel.eachSeries(function (seriesModel, seriesIndex) { + var seriesBrushSelected = { + seriesId: seriesModel.id, + seriesIndex: seriesIndex, + seriesName: seriesModel.name, + dataIndex: [] + }; // Every series exists in event params, convenient + // for user to find series by seriesIndex. + + thisBrushSelected.selected.push(seriesBrushSelected); + var rangeInfoList = rangeInfoBySeries[seriesIndex]; + var data = seriesModel.getData(); + var getValueState = linkOthers(seriesIndex) ? function (dataIndex) { + return selectedDataIndexForLink[dataIndex] ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') : 'outOfBrush'; + } : function (dataIndex) { + return checkInRange(seriesModel, rangeInfoList, data, dataIndex) ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') : 'outOfBrush'; + }; // If no supported brush or no brush, all visuals are in original state. + + (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList)) && applyVisual(STATE_LIST, visualMappings, data, getValueState); }); - dispatchAction(api, throttleType, throttleDelay, brushSelected, payload); + }); + dispatchAction(api, throttleType, throttleDelay, brushSelected, payload); } function dispatchAction(api, throttleType, throttleDelay, brushSelected, payload) { - // This event will not be triggered when `setOpion`, otherwise dead lock may - // triggered when do `setOption` in event listener, which we do not find - // satisfactory way to solve yet. Some considered resolutions: - // (a) Diff with prevoius selected data ant only trigger event when changed. - // But store previous data and diff precisely (i.e., not only by dataIndex, but - // also detect value changes in selected data) might bring complexity or fragility. - // (b) Use spectial param like `silent` to suppress event triggering. - // But such kind of volatile param may be weird in `setOption`. - if (!payload) { - return; - } + // This event will not be triggered when `setOpion`, otherwise dead lock may + // triggered when do `setOption` in event listener, which we do not find + // satisfactory way to solve yet. Some considered resolutions: + // (a) Diff with prevoius selected data ant only trigger event when changed. + // But store previous data and diff precisely (i.e., not only by dataIndex, but + // also detect value changes in selected data) might bring complexity or fragility. + // (b) Use spectial param like `silent` to suppress event triggering. + // But such kind of volatile param may be weird in `setOption`. + if (!payload) { + return; + } - var zr = api.getZr(); + var zr = api.getZr(); - if (zr[DISPATCH_FLAG]) { - return; - } + if (zr[DISPATCH_FLAG]) { + return; + } - if (!zr[DISPATCH_METHOD]) { - zr[DISPATCH_METHOD] = doDispatch; - } + if (!zr[DISPATCH_METHOD]) { + zr[DISPATCH_METHOD] = doDispatch; + } - var fn = createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType); - fn(api, brushSelected); + var fn = createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType); + fn(api, brushSelected); } function doDispatch(api, brushSelected) { - if (!api.isDisposed()) { - var zr = api.getZr(); - zr[DISPATCH_FLAG] = true; - api.dispatchAction({ - type: 'brushSelect', - batch: brushSelected - }); - zr[DISPATCH_FLAG] = false; - } + if (!api.isDisposed()) { + var zr = api.getZr(); + zr[DISPATCH_FLAG] = true; + api.dispatchAction({ + type: 'brushSelect', + batch: brushSelected + }); + zr[DISPATCH_FLAG] = false; + } } function checkInRange(seriesModel, rangeInfoList, data, dataIndex) { - for (var i = 0, len = rangeInfoList.length; i < len; i++) { - var area = rangeInfoList[i]; + for (var i = 0, len = rangeInfoList.length; i < len; i++) { + var area = rangeInfoList[i]; - if (seriesModel.brushSelector(dataIndex, data, area.selectors, area)) { - return true; - } + if (seriesModel.brushSelector(dataIndex, data, area.selectors, area)) { + return true; } + } } function brushModelNotControll(brushModel, seriesIndex) { - var seriesIndices = brushModel.option.seriesIndex; - return seriesIndices != null && seriesIndices !== 'all' && (isArray(seriesIndices) ? indexOf(seriesIndices, seriesIndex) < 0 : seriesIndex !== seriesIndices); + var seriesIndices = brushModel.option.seriesIndex; + return seriesIndices != null && seriesIndices !== 'all' && (isArray(seriesIndices) ? indexOf(seriesIndices, seriesIndex) < 0 : seriesIndex !== seriesIndices); } var boundingRectBuilders = { - rect: function (area) { - return getBoundingRectFromMinMax(area.range); - }, - polygon: function (area) { - var minMax; - var range = area.range; - - for (var i = 0, len = range.length; i < len; i++) { - minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]]; - var rg = range[i]; - rg[0] < minMax[0][0] && (minMax[0][0] = rg[0]); - rg[0] > minMax[0][1] && (minMax[0][1] = rg[0]); - rg[1] < minMax[1][0] && (minMax[1][0] = rg[1]); - rg[1] > minMax[1][1] && (minMax[1][1] = rg[1]); - } - - return minMax && getBoundingRectFromMinMax(minMax); - } + rect: function (area) { + return getBoundingRectFromMinMax(area.range); + }, + polygon: function (area) { + var minMax; + var range = area.range; + + for (var i = 0, len = range.length; i < len; i++) { + minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]]; + var rg = range[i]; + rg[0] < minMax[0][0] && (minMax[0][0] = rg[0]); + rg[0] > minMax[0][1] && (minMax[0][1] = rg[0]); + rg[1] < minMax[1][0] && (minMax[1][0] = rg[1]); + rg[1] > minMax[1][1] && (minMax[1][1] = rg[1]); + } + + return minMax && getBoundingRectFromMinMax(minMax); + } }; function getBoundingRectFromMinMax(minMax) { - return new BoundingRect(minMax[0][0], minMax[1][0], minMax[0][1] - minMax[0][0], minMax[1][1] - minMax[1][0]); + return new BoundingRect(minMax[0][0], minMax[1][0], minMax[0][1] - minMax[0][0], minMax[1][1] - minMax[1][0]); } var BrushView = - /** @class */ - function (_super) { - __extends(BrushView, _super); - - function BrushView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = BrushView.type; - return _this; - } - - BrushView.prototype.init = function (ecModel, api) { - this.ecModel = ecModel; - this.api = api; - this.model; - (this._brushController = new BrushController(api.getZr())).on('brush', bind(this._onBrush, this)).mount(); - }; - - BrushView.prototype.render = function (brushModel, ecModel, api, payload) { - this.model = brushModel; - - this._updateController(brushModel, ecModel, api, payload); - }; + /** @class */ + function (_super) { + __extends(BrushView, _super); + + function BrushView() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = BrushView.type; + return _this; + } + + BrushView.prototype.init = function (ecModel, api) { + this.ecModel = ecModel; + this.api = api; + this.model; + (this._brushController = new BrushController(api.getZr())).on('brush', bind(this._onBrush, this)).mount(); + }; + + BrushView.prototype.render = function (brushModel, ecModel, api, payload) { + this.model = brushModel; + + this._updateController(brushModel, ecModel, api, payload); + }; + + BrushView.prototype.updateTransform = function (brushModel, ecModel, api, payload) { + // PENDING: `updateTransform` is a little tricky, whose layout need + // to be calculate mandatorily and other stages will not be performed. + // Take care the correctness of the logic. See #11754 . + layoutCovers(ecModel); - BrushView.prototype.updateTransform = function (brushModel, ecModel, api, payload) { - // PENDING: `updateTransform` is a little tricky, whose layout need - // to be calculate mandatorily and other stages will not be performed. - // Take care the correctness of the logic. See #11754 . - layoutCovers(ecModel); + this._updateController(brushModel, ecModel, api, payload); + }; - this._updateController(brushModel, ecModel, api, payload); - }; + BrushView.prototype.updateVisual = function (brushModel, ecModel, api, payload) { + this.updateTransform(brushModel, ecModel, api, payload); + }; - BrushView.prototype.updateVisual = function (brushModel, ecModel, api, payload) { - this.updateTransform(brushModel, ecModel, api, payload); - }; + BrushView.prototype.updateView = function (brushModel, ecModel, api, payload) { + this._updateController(brushModel, ecModel, api, payload); + }; - BrushView.prototype.updateView = function (brushModel, ecModel, api, payload) { - this._updateController(brushModel, ecModel, api, payload); - }; + BrushView.prototype._updateController = function (brushModel, ecModel, api, payload) { + // Do not update controller when drawing. + (!payload || payload.$from !== brushModel.id) && this._brushController.setPanels(brushModel.brushTargetManager.makePanelOpts(api)).enableBrush(brushModel.brushOption).updateCovers(brushModel.areas.slice()); + }; // updateLayout: updateController, + // updateVisual: updateController, - BrushView.prototype._updateController = function (brushModel, ecModel, api, payload) { - // Do not update controller when drawing. - (!payload || payload.$from !== brushModel.id) && this._brushController.setPanels(brushModel.brushTargetManager.makePanelOpts(api)).enableBrush(brushModel.brushOption).updateCovers(brushModel.areas.slice()); - }; // updateLayout: updateController, - // updateVisual: updateController, + BrushView.prototype.dispose = function () { + this._brushController.dispose(); + }; - BrushView.prototype.dispose = function () { - this._brushController.dispose(); - }; + BrushView.prototype._onBrush = function (eventParam) { + var modelId = this.model.id; + var areas = this.model.brushTargetManager.setOutputRanges(eventParam.areas, this.ecModel); // Action is not dispatched on drag end, because the drag end + // emits the same params with the last drag move event, and + // may have some delay when using touch pad, which makes + // animation not smooth (when using debounce). - BrushView.prototype._onBrush = function (eventParam) { - var modelId = this.model.id; - var areas = this.model.brushTargetManager.setOutputRanges(eventParam.areas, this.ecModel); // Action is not dispatched on drag end, because the drag end - // emits the same params with the last drag move event, and - // may have some delay when using touch pad, which makes - // animation not smooth (when using debounce). - - (!eventParam.isEnd || eventParam.removeOnClick) && this.api.dispatchAction({ - type: 'brush', - brushId: modelId, - areas: clone(areas), - $from: modelId - }); - eventParam.isEnd && this.api.dispatchAction({ - type: 'brushEnd', - brushId: modelId, - areas: clone(areas), - $from: modelId - }); - }; + (!eventParam.isEnd || eventParam.removeOnClick) && this.api.dispatchAction({ + type: 'brush', + brushId: modelId, + areas: clone(areas), + $from: modelId + }); + eventParam.isEnd && this.api.dispatchAction({ + type: 'brushEnd', + brushId: modelId, + areas: clone(areas), + $from: modelId + }); + }; - BrushView.type = 'brush'; - return BrushView; - }(ComponentView); + BrushView.type = 'brush'; + return BrushView; + }(ComponentView); var DEFAULT_OUT_OF_BRUSH_COLOR = '#ddd'; var BrushModel = - /** @class */ - function (_super) { - __extends(BrushModel, _super); + /** @class */ + function (_super) { + __extends(BrushModel, _super); - function BrushModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function BrushModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = BrushModel.type; - /** - * @readOnly - */ + _this.type = BrushModel.type; + /** + * @readOnly + */ - _this.areas = []; - /** - * Current brush painting area settings. - * @readOnly - */ + _this.areas = []; + /** + * Current brush painting area settings. + * @readOnly + */ - _this.brushOption = {}; - return _this; - } + _this.brushOption = {}; + return _this; + } - BrushModel.prototype.optionUpdated = function (newOption, isInit) { - var thisOption = this.option; - !isInit && replaceVisualOption(thisOption, newOption, ['inBrush', 'outOfBrush']); - var inBrush = thisOption.inBrush = thisOption.inBrush || {}; // Always give default visual, consider setOption at the second time. + BrushModel.prototype.optionUpdated = function (newOption, isInit) { + var thisOption = this.option; + !isInit && replaceVisualOption(thisOption, newOption, ['inBrush', 'outOfBrush']); + var inBrush = thisOption.inBrush = thisOption.inBrush || {}; // Always give default visual, consider setOption at the second time. - thisOption.outOfBrush = thisOption.outOfBrush || { - color: DEFAULT_OUT_OF_BRUSH_COLOR - }; + thisOption.outOfBrush = thisOption.outOfBrush || { + color: DEFAULT_OUT_OF_BRUSH_COLOR + }; - if (!inBrush.hasOwnProperty('liftZ')) { - // Bigger than the highlight z lift, otherwise it will - // be effected by the highlight z when brush. - inBrush.liftZ = 5; - } - }; - /** - * If `areas` is null/undefined, range state remain. - */ + if (!inBrush.hasOwnProperty('liftZ')) { + // Bigger than the highlight z lift, otherwise it will + // be effected by the highlight z when brush. + inBrush.liftZ = 5; + } + }; + /** + * If `areas` is null/undefined, range state remain. + */ - BrushModel.prototype.setAreas = function (areas) { - if ("development" !== 'production') { - assert(isArray(areas)); - each(areas, function (area) { - assert(area.brushType, 'Illegal areas'); - }); - } // If areas is null/undefined, range state remain. - // This helps user to dispatchAction({type: 'brush'}) with no areas - // set but just want to get the current brush select info from a `brush` event. + BrushModel.prototype.setAreas = function (areas) { + if ("development" !== 'production') { + assert(isArray(areas)); + each(areas, function (area) { + assert(area.brushType, 'Illegal areas'); + }); + } // If areas is null/undefined, range state remain. + // This helps user to dispatchAction({type: 'brush'}) with no areas + // set but just want to get the current brush select info from a `brush` event. - if (!areas) { - return; - } + if (!areas) { + return; + } - this.areas = map(areas, function (area) { - return generateBrushOption(this.option, area); - }, this); - }; - /** - * Set the current painting brush option. - */ + this.areas = map(areas, function (area) { + return generateBrushOption(this.option, area); + }, this); + }; + /** + * Set the current painting brush option. + */ - BrushModel.prototype.setBrushOption = function (brushOption) { - this.brushOption = generateBrushOption(this.option, brushOption); - this.brushType = this.brushOption.brushType; - }; + BrushModel.prototype.setBrushOption = function (brushOption) { + this.brushOption = generateBrushOption(this.option, brushOption); + this.brushType = this.brushOption.brushType; + }; - BrushModel.type = 'brush'; - BrushModel.dependencies = ['geo', 'grid', 'xAxis', 'yAxis', 'parallel', 'series']; - BrushModel.defaultOption = { - seriesIndex: 'all', - brushType: 'rect', - brushMode: 'single', - transformable: true, - brushStyle: { - borderWidth: 1, - color: 'rgba(210,219,238,0.3)', - borderColor: '#D2DBEE' - }, - throttleType: 'fixRate', - throttleDelay: 0, - removeOnClick: true, - z: 10000 - }; - return BrushModel; - }(ComponentModel); + BrushModel.type = 'brush'; + BrushModel.dependencies = ['geo', 'grid', 'xAxis', 'yAxis', 'parallel', 'series']; + BrushModel.defaultOption = { + seriesIndex: 'all', + brushType: 'rect', + brushMode: 'single', + transformable: true, + brushStyle: { + borderWidth: 1, + color: 'rgba(210,219,238,0.3)', + borderColor: '#D2DBEE' + }, + throttleType: 'fixRate', + throttleDelay: 0, + removeOnClick: true, + z: 10000 + }; + return BrushModel; + }(ComponentModel); function generateBrushOption(option, brushOption) { - return merge({ - brushType: option.brushType, - brushMode: option.brushMode, - transformable: option.transformable, - brushStyle: new Model(option.brushStyle).getItemStyle(), - removeOnClick: option.removeOnClick, - z: option.z - }, brushOption, true); + return merge({ + brushType: option.brushType, + brushMode: option.brushMode, + transformable: option.transformable, + brushStyle: new Model(option.brushStyle).getItemStyle(), + removeOnClick: option.removeOnClick, + z: option.z + }, brushOption, true); } var ICON_TYPES = ['rect', 'polygon', 'lineX', 'lineY', 'keep', 'clear']; var BrushFeature = - /** @class */ - function (_super) { - __extends(BrushFeature, _super); - - function BrushFeature() { - return _super !== null && _super.apply(this, arguments) || this; - } - - BrushFeature.prototype.render = function (featureModel, ecModel, api) { - var brushType; - var brushMode; - var isBrushed; - ecModel.eachComponent({ - mainType: 'brush' - }, function (brushModel) { - brushType = brushModel.brushType; - brushMode = brushModel.brushOption.brushMode || 'single'; - isBrushed = isBrushed || !!brushModel.areas.length; - }); - this._brushType = brushType; - this._brushMode = brushMode; - each(featureModel.get('type', true), function (type) { - featureModel.setIconStatus(type, (type === 'keep' ? brushMode === 'multiple' : type === 'clear' ? isBrushed : type === brushType) ? 'emphasis' : 'normal'); - }); - }; - - BrushFeature.prototype.updateView = function (featureModel, ecModel, api) { - this.render(featureModel, ecModel, api); - }; - - BrushFeature.prototype.getIcons = function () { - var model = this.model; - var availableIcons = model.get('icon', true); - var icons = {}; - each(model.get('type', true), function (type) { - if (availableIcons[type]) { - icons[type] = availableIcons[type]; - } - }); - return icons; - }; - - BrushFeature.prototype.onclick = function (ecModel, api, type) { - var brushType = this._brushType; - var brushMode = this._brushMode; - - if (type === 'clear') { - // Trigger parallel action firstly - api.dispatchAction({ - type: 'axisAreaSelect', - intervals: [] - }); - api.dispatchAction({ - type: 'brush', - command: 'clear', - // Clear all areas of all brush components. - areas: [] - }); - } else { - api.dispatchAction({ - type: 'takeGlobalCursor', - key: 'brush', - brushOption: { - brushType: type === 'keep' ? brushType : brushType === type ? false : type, - brushMode: type === 'keep' ? brushMode === 'multiple' ? 'single' : 'multiple' : brushMode - } - }); - } - }; - - BrushFeature.getDefaultOption = function (ecModel) { - var defaultOption = { - show: true, - type: ICON_TYPES.slice(), - icon: { - /* eslint-disable */ - 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' // jshint ignore:line - - /* eslint-enable */ - - }, - // `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear` - title: ecModel.getLocaleModel().get(['toolbox', 'brush', 'title']) - }; - return defaultOption; - }; - - return BrushFeature; - }(ToolboxFeature); + /** @class */ + function (_super) { + __extends(BrushFeature, _super); + + function BrushFeature() { + return _super !== null && _super.apply(this, arguments) || this; + } + + BrushFeature.prototype.render = function (featureModel, ecModel, api) { + var brushType; + var brushMode; + var isBrushed; + ecModel.eachComponent({ + mainType: 'brush' + }, function (brushModel) { + brushType = brushModel.brushType; + brushMode = brushModel.brushOption.brushMode || 'single'; + isBrushed = isBrushed || !!brushModel.areas.length; + }); + this._brushType = brushType; + this._brushMode = brushMode; + each(featureModel.get('type', true), function (type) { + featureModel.setIconStatus(type, (type === 'keep' ? brushMode === 'multiple' : type === 'clear' ? isBrushed : type === brushType) ? 'emphasis' : 'normal'); + }); + }; + + BrushFeature.prototype.updateView = function (featureModel, ecModel, api) { + this.render(featureModel, ecModel, api); + }; + + BrushFeature.prototype.getIcons = function () { + var model = this.model; + var availableIcons = model.get('icon', true); + var icons = {}; + each(model.get('type', true), function (type) { + if (availableIcons[type]) { + icons[type] = availableIcons[type]; + } + }); + return icons; + }; + + BrushFeature.prototype.onclick = function (ecModel, api, type) { + var brushType = this._brushType; + var brushMode = this._brushMode; + + if (type === 'clear') { + // Trigger parallel action firstly + api.dispatchAction({ + type: 'axisAreaSelect', + intervals: [] + }); + api.dispatchAction({ + type: 'brush', + command: 'clear', + // Clear all areas of all brush components. + areas: [] + }); + } else { + api.dispatchAction({ + type: 'takeGlobalCursor', + key: 'brush', + brushOption: { + brushType: type === 'keep' ? brushType : brushType === type ? false : type, + brushMode: type === 'keep' ? brushMode === 'multiple' ? 'single' : 'multiple' : brushMode + } + }); + } + }; + + BrushFeature.getDefaultOption = function (ecModel) { + var defaultOption = { + show: true, + type: ICON_TYPES.slice(), + icon: { + /* eslint-disable */ + 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' // jshint ignore:line + + /* eslint-enable */ + + }, + // `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear` + title: ecModel.getLocaleModel().get(['toolbox', 'brush', 'title']) + }; + return defaultOption; + }; + + return BrushFeature; + }(ToolboxFeature); function install$B(registers) { - registers.registerComponentView(BrushView); - registers.registerComponentModel(BrushModel); - registers.registerPreprocessor(brushPreprocessor); - registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, brushVisual); - registers.registerAction({ - type: 'brush', - event: 'brush', - update: 'updateVisual' - }, function (payload, ecModel) { - ecModel.eachComponent({ - mainType: 'brush', - query: payload - }, function (brushModel) { - brushModel.setAreas(payload.areas); - }); + registers.registerComponentView(BrushView); + registers.registerComponentModel(BrushModel); + registers.registerPreprocessor(brushPreprocessor); + registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, brushVisual); + registers.registerAction({ + type: 'brush', + event: 'brush', + update: 'updateVisual' + }, function (payload, ecModel) { + ecModel.eachComponent({ + mainType: 'brush', + query: payload + }, function (brushModel) { + brushModel.setAreas(payload.areas); }); - /** - * payload: { - * brushComponents: [ - * { - * brushId, - * brushIndex, - * brushName, - * series: [ - * { - * seriesId, - * seriesIndex, - * seriesName, - * rawIndices: [21, 34, ...] - * }, - * ... - * ] - * }, - * ... - * ] - * } - */ + }); + /** + * payload: { + * brushComponents: [ + * { + * brushId, + * brushIndex, + * brushName, + * series: [ + * { + * seriesId, + * seriesIndex, + * seriesName, + * rawIndices: [21, 34, ...] + * }, + * ... + * ] + * }, + * ... + * ] + * } + */ - registers.registerAction({ - type: 'brushSelect', - event: 'brushSelected', - update: 'none' - }, noop); - registers.registerAction({ - type: 'brushEnd', - event: 'brushEnd', - update: 'none' - }, noop); - registerFeature('brush', BrushFeature); + registers.registerAction({ + type: 'brushSelect', + event: 'brushSelected', + update: 'none' + }, noop); + registers.registerAction({ + type: 'brushEnd', + event: 'brushEnd', + update: 'none' + }, noop); + registerFeature('brush', BrushFeature); } var TitleModel = - /** @class */ - function (_super) { - __extends(TitleModel, _super); + /** @class */ + function (_super) { + __extends(TitleModel, _super); - function TitleModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function TitleModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = TitleModel.type; - _this.layoutMode = { - type: 'box', - ignoreSize: true - }; - return _this; - } + _this.type = TitleModel.type; + _this.layoutMode = { + type: 'box', + ignoreSize: true + }; + return _this; + } - TitleModel.type = 'title'; - TitleModel.defaultOption = { - // zlevel: 0, - z: 6, - show: true, - text: '', - target: 'blank', - subtext: '', - subtarget: 'blank', - left: 0, - top: 0, - backgroundColor: 'rgba(0,0,0,0)', - borderColor: '#ccc', - borderWidth: 0, - padding: 5, - itemGap: 10, - textStyle: { - fontSize: 18, - fontWeight: 'bold', - color: '#464646' - }, - subtextStyle: { - fontSize: 12, - color: '#6E7079' - } - }; - return TitleModel; - }(ComponentModel); // View + TitleModel.type = 'title'; + TitleModel.defaultOption = { + // zlevel: 0, + z: 6, + show: true, + text: '', + target: 'blank', + subtext: '', + subtarget: 'blank', + left: 0, + top: 0, + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + borderWidth: 0, + padding: 5, + itemGap: 10, + textStyle: { + fontSize: 18, + fontWeight: 'bold', + color: '#464646' + }, + subtextStyle: { + fontSize: 12, + color: '#6E7079' + } + }; + return TitleModel; + }(ComponentModel); // View var TitleView = - /** @class */ - function (_super) { - __extends(TitleView, _super); + /** @class */ + function (_super) { + __extends(TitleView, _super); - function TitleView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function TitleView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = TitleView.type; - return _this; - } - - TitleView.prototype.render = function (titleModel, ecModel, api) { - this.group.removeAll(); - - if (!titleModel.get('show')) { - return; - } - - var group = this.group; - var textStyleModel = titleModel.getModel('textStyle'); - var subtextStyleModel = titleModel.getModel('subtextStyle'); - var textAlign = titleModel.get('textAlign'); - var textVerticalAlign = retrieve2(titleModel.get('textBaseline'), titleModel.get('textVerticalAlign')); - var textEl = new ZRText({ - style: createTextStyle(textStyleModel, { - text: titleModel.get('text'), - fill: textStyleModel.getTextColor() - }, { - disableBox: true - }), - z2: 10 - }); - var textRect = textEl.getBoundingRect(); - var subText = titleModel.get('subtext'); - var subTextEl = new ZRText({ - style: createTextStyle(subtextStyleModel, { - text: subText, - fill: subtextStyleModel.getTextColor(), - y: textRect.height + titleModel.get('itemGap'), - verticalAlign: 'top' - }, { - disableBox: true - }), - z2: 10 - }); - var link = titleModel.get('link'); - var sublink = titleModel.get('sublink'); - var triggerEvent = titleModel.get('triggerEvent', true); - textEl.silent = !link && !triggerEvent; - subTextEl.silent = !sublink && !triggerEvent; + _this.type = TitleView.type; + return _this; + } - if (link) { - textEl.on('click', function () { - windowOpen(link, '_' + titleModel.get('target')); - }); - } + TitleView.prototype.render = function (titleModel, ecModel, api) { + this.group.removeAll(); - if (sublink) { - subTextEl.on('click', function () { - windowOpen(sublink, '_' + titleModel.get('subtarget')); - }); - } + if (!titleModel.get('show')) { + return; + } - getECData(textEl).eventData = getECData(subTextEl).eventData = triggerEvent ? { - componentType: 'title', - componentIndex: titleModel.componentIndex - } : null; - group.add(textEl); - subText && group.add(subTextEl); // If no subText, but add subTextEl, there will be an empty line. + var group = this.group; + var textStyleModel = titleModel.getModel('textStyle'); + var subtextStyleModel = titleModel.getModel('subtextStyle'); + var textAlign = titleModel.get('textAlign'); + var textVerticalAlign = retrieve2(titleModel.get('textBaseline'), titleModel.get('textVerticalAlign')); + var textEl = new ZRText({ + style: createTextStyle(textStyleModel, { + text: titleModel.get('text'), + fill: textStyleModel.getTextColor() + }, { + disableBox: true + }), + z2: 10 + }); + var textRect = textEl.getBoundingRect(); + var subText = titleModel.get('subtext'); + var subTextEl = new ZRText({ + style: createTextStyle(subtextStyleModel, { + text: subText, + fill: subtextStyleModel.getTextColor(), + y: textRect.height + titleModel.get('itemGap'), + verticalAlign: 'top' + }, { + disableBox: true + }), + z2: 10 + }); + var link = titleModel.get('link'); + var sublink = titleModel.get('sublink'); + var triggerEvent = titleModel.get('triggerEvent', true); + textEl.silent = !link && !triggerEvent; + subTextEl.silent = !sublink && !triggerEvent; - var groupRect = group.getBoundingRect(); - var layoutOption = titleModel.getBoxLayoutParams(); - layoutOption.width = groupRect.width; - layoutOption.height = groupRect.height; - var layoutRect = getLayoutRect(layoutOption, { - width: api.getWidth(), - height: api.getHeight() - }, titleModel.get('padding')); // Adjust text align based on position + if (link) { + textEl.on('click', function () { + windowOpen(link, '_' + titleModel.get('target')); + }); + } - if (!textAlign) { - // Align left if title is on the left. center and right is same - textAlign = titleModel.get('left') || titleModel.get('right'); // @ts-ignore + if (sublink) { + subTextEl.on('click', function () { + windowOpen(sublink, '_' + titleModel.get('subtarget')); + }); + } - if (textAlign === 'middle') { - textAlign = 'center'; - } // Adjust layout by text align + getECData(textEl).eventData = getECData(subTextEl).eventData = triggerEvent ? { + componentType: 'title', + componentIndex: titleModel.componentIndex + } : null; + group.add(textEl); + subText && group.add(subTextEl); // If no subText, but add subTextEl, there will be an empty line. + + var groupRect = group.getBoundingRect(); + var layoutOption = titleModel.getBoxLayoutParams(); + layoutOption.width = groupRect.width; + layoutOption.height = groupRect.height; + var layoutRect = getLayoutRect(layoutOption, { + width: api.getWidth(), + height: api.getHeight() + }, titleModel.get('padding')); // Adjust text align based on position + + if (!textAlign) { + // Align left if title is on the left. center and right is same + textAlign = titleModel.get('left') || titleModel.get('right'); // @ts-ignore + + if (textAlign === 'middle') { + textAlign = 'center'; + } // Adjust layout by text align - if (textAlign === 'right') { - layoutRect.x += layoutRect.width; - } else if (textAlign === 'center') { - layoutRect.x += layoutRect.width / 2; - } - } + if (textAlign === 'right') { + layoutRect.x += layoutRect.width; + } else if (textAlign === 'center') { + layoutRect.x += layoutRect.width / 2; + } + } - if (!textVerticalAlign) { - textVerticalAlign = titleModel.get('top') || titleModel.get('bottom'); // @ts-ignore + if (!textVerticalAlign) { + textVerticalAlign = titleModel.get('top') || titleModel.get('bottom'); // @ts-ignore - if (textVerticalAlign === 'center') { - textVerticalAlign = 'middle'; - } + if (textVerticalAlign === 'center') { + textVerticalAlign = 'middle'; + } - if (textVerticalAlign === 'bottom') { - layoutRect.y += layoutRect.height; - } else if (textVerticalAlign === 'middle') { - layoutRect.y += layoutRect.height / 2; - } + if (textVerticalAlign === 'bottom') { + layoutRect.y += layoutRect.height; + } else if (textVerticalAlign === 'middle') { + layoutRect.y += layoutRect.height / 2; + } - textVerticalAlign = textVerticalAlign || 'top'; - } + textVerticalAlign = textVerticalAlign || 'top'; + } - group.x = layoutRect.x; - group.y = layoutRect.y; - group.markRedraw(); - var alignStyle = { - align: textAlign, - verticalAlign: textVerticalAlign - }; - textEl.setStyle(alignStyle); - subTextEl.setStyle(alignStyle); // Render background - // Get groupRect again because textAlign has been changed - - groupRect = group.getBoundingRect(); - var padding = layoutRect.margin; - var style = titleModel.getItemStyle(['color', 'opacity']); - style.fill = titleModel.get('backgroundColor'); - var rect = new Rect({ - shape: { - x: groupRect.x - padding[3], - y: groupRect.y - padding[0], - width: groupRect.width + padding[1] + padding[3], - height: groupRect.height + padding[0] + padding[2], - r: titleModel.get('borderRadius') - }, - style: style, - subPixelOptimize: true, - silent: true - }); - group.add(rect); - }; + group.x = layoutRect.x; + group.y = layoutRect.y; + group.markRedraw(); + var alignStyle = { + align: textAlign, + verticalAlign: textVerticalAlign + }; + textEl.setStyle(alignStyle); + subTextEl.setStyle(alignStyle); // Render background + // Get groupRect again because textAlign has been changed + + groupRect = group.getBoundingRect(); + var padding = layoutRect.margin; + var style = titleModel.getItemStyle(['color', 'opacity']); + style.fill = titleModel.get('backgroundColor'); + var rect = new Rect({ + shape: { + x: groupRect.x - padding[3], + y: groupRect.y - padding[0], + width: groupRect.width + padding[1] + padding[3], + height: groupRect.height + padding[0] + padding[2], + r: titleModel.get('borderRadius') + }, + style: style, + subPixelOptimize: true, + silent: true + }); + group.add(rect); + }; - TitleView.type = 'title'; - return TitleView; - }(ComponentView); + TitleView.type = 'title'; + return TitleView; + }(ComponentView); function install$C(registers) { - registers.registerComponentModel(TitleModel); - registers.registerComponentView(TitleView); + registers.registerComponentModel(TitleModel); + registers.registerComponentView(TitleView); } var TimelineModel = - /** @class */ - function (_super) { - __extends(TimelineModel, _super); - - function TimelineModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = TimelineModel.type; - _this.layoutMode = 'box'; - return _this; - } - /** - * @override - */ - - - TimelineModel.prototype.init = function (option, parentModel, ecModel) { - this.mergeDefaultAndTheme(option, ecModel); - - this._initData(); - }; - /** - * @override - */ - - - TimelineModel.prototype.mergeOption = function (option) { - _super.prototype.mergeOption.apply(this, arguments); - - this._initData(); - }; - - TimelineModel.prototype.setCurrentIndex = function (currentIndex) { - if (currentIndex == null) { - currentIndex = this.option.currentIndex; - } - - var count = this._data.count(); - - if (this.option.loop) { - currentIndex = (currentIndex % count + count) % count; - } else { - currentIndex >= count && (currentIndex = count - 1); - currentIndex < 0 && (currentIndex = 0); - } + /** @class */ + function (_super) { + __extends(TimelineModel, _super); + + function TimelineModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = TimelineModel.type; + _this.layoutMode = 'box'; + return _this; + } + /** + * @override + */ - this.option.currentIndex = currentIndex; - }; - /** - * @return {number} currentIndex - */ + TimelineModel.prototype.init = function (option, parentModel, ecModel) { + this.mergeDefaultAndTheme(option, ecModel); - TimelineModel.prototype.getCurrentIndex = function () { - return this.option.currentIndex; - }; - /** - * @return {boolean} - */ + this._initData(); + }; + /** + * @override + */ - TimelineModel.prototype.isIndexMax = function () { - return this.getCurrentIndex() >= this._data.count() - 1; - }; - /** - * @param {boolean} state true: play, false: stop - */ + TimelineModel.prototype.mergeOption = function (option) { + _super.prototype.mergeOption.apply(this, arguments); + this._initData(); + }; - TimelineModel.prototype.setPlayState = function (state) { - this.option.autoPlay = !!state; - }; - /** - * @return {boolean} true: play, false: stop - */ + TimelineModel.prototype.setCurrentIndex = function (currentIndex) { + if (currentIndex == null) { + currentIndex = this.option.currentIndex; + } + var count = this._data.count(); - TimelineModel.prototype.getPlayState = function () { - return !!this.option.autoPlay; - }; - /** - * @private - */ + if (this.option.loop) { + currentIndex = (currentIndex % count + count) % count; + } else { + currentIndex >= count && (currentIndex = count - 1); + currentIndex < 0 && (currentIndex = 0); + } + this.option.currentIndex = currentIndex; + }; + /** + * @return {number} currentIndex + */ - TimelineModel.prototype._initData = function () { - var thisOption = this.option; - var dataArr = thisOption.data || []; - var axisType = thisOption.axisType; - var names = this._names = []; - var processedDataArr; - - if (axisType === 'category') { - processedDataArr = []; - each(dataArr, function (item, index) { - var value = convertOptionIdName(getDataItemValue(item), ''); - var newItem; - - if (isObject(item)) { - newItem = clone(item); - newItem.value = index; - } else { - newItem = index; - } - processedDataArr.push(newItem); - names.push(value); - }); - } else { - processedDataArr = dataArr; - } - - var dimType = { - category: 'ordinal', - time: 'time', - value: 'number' - }[axisType] || 'number'; - var data = this._data = new SeriesData([{ - name: 'value', - type: dimType - }], this); - data.initData(processedDataArr, names); - }; + TimelineModel.prototype.getCurrentIndex = function () { + return this.option.currentIndex; + }; + /** + * @return {boolean} + */ - TimelineModel.prototype.getData = function () { - return this._data; - }; - /** - * @public - * @return {Array.} categoreis - */ + TimelineModel.prototype.isIndexMax = function () { + return this.getCurrentIndex() >= this._data.count() - 1; + }; + /** + * @param {boolean} state true: play, false: stop + */ - TimelineModel.prototype.getCategories = function () { - if (this.get('axisType') === 'category') { - return this._names.slice(); - } - }; - TimelineModel.type = 'timeline'; - /** - * @protected - */ + TimelineModel.prototype.setPlayState = function (state) { + this.option.autoPlay = !!state; + }; + /** + * @return {boolean} true: play, false: stop + */ - TimelineModel.defaultOption = { - // zlevel: 0, // 一级层叠 - z: 4, - show: true, - axisType: 'time', - realtime: true, - left: '20%', - top: null, - right: '20%', - bottom: 0, - width: null, - height: 40, - padding: 5, - controlPosition: 'left', - autoPlay: false, - rewind: false, - loop: true, - playInterval: 2000, - currentIndex: 0, - itemStyle: {}, - label: { - color: '#000' - }, - data: [] - }; - return TimelineModel; - }(ComponentModel); - var SliderTimelineModel = - /** @class */ - function (_super) { - __extends(SliderTimelineModel, _super); + TimelineModel.prototype.getPlayState = function () { + return !!this.option.autoPlay; + }; + /** + * @private + */ - function SliderTimelineModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SliderTimelineModel.type; - return _this; + TimelineModel.prototype._initData = function () { + var thisOption = this.option; + var dataArr = thisOption.data || []; + var axisType = thisOption.axisType; + var names = this._names = []; + var processedDataArr; + + if (axisType === 'category') { + processedDataArr = []; + each(dataArr, function (item, index) { + var value = convertOptionIdName(getDataItemValue(item), ''); + var newItem; + + if (isObject(item)) { + newItem = clone(item); + newItem.value = index; + } else { + newItem = index; } - SliderTimelineModel.type = 'timeline.slider'; - /** - * @protected - */ - - SliderTimelineModel.defaultOption = inheritDefaultOption(TimelineModel.defaultOption, { - backgroundColor: 'rgba(0,0,0,0)', - borderColor: '#ccc', - borderWidth: 0, - orient: 'horizontal', - inverse: false, - tooltip: { - trigger: 'item' // data item may also have tootip attr. - - }, - symbol: 'circle', - symbolSize: 12, - lineStyle: { - show: true, - width: 2, - color: '#DAE1F5' - }, - label: { - position: 'auto', - // When using number, label position is not - // restricted by viewRect. - // positive: right/bottom, negative: left/top - show: true, - interval: 'auto', - rotate: 0, - // formatter: null, - // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#A4B1D7' - }, - itemStyle: { - color: '#A4B1D7', - borderWidth: 1 - }, - checkpointStyle: { - symbol: 'circle', - symbolSize: 15, - color: '#316bf3', - borderColor: '#fff', - borderWidth: 2, - shadowBlur: 2, - shadowOffsetX: 1, - shadowOffsetY: 1, - shadowColor: 'rgba(0, 0, 0, 0.3)', - // borderColor: 'rgba(194,53,49, 0.5)', - animation: true, - animationDuration: 300, - animationEasing: 'quinticInOut' - }, - controlStyle: { - show: true, - showPlayBtn: true, - showPrevBtn: true, - showNextBtn: true, - itemSize: 24, - itemGap: 12, - position: 'left', - playIcon: 'path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z', - stopIcon: 'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z', - // eslint-disable-next-line max-len - nextIcon: 'M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z', - // eslint-disable-next-line max-len - prevIcon: 'M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z', - prevBtnSize: 18, - nextBtnSize: 18, - color: '#A4B1D7', - borderColor: '#A4B1D7', - borderWidth: 1 - }, - emphasis: { - label: { - show: true, - // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#6f778d' - }, - itemStyle: { - color: '#316BF3' - }, - controlStyle: { - color: '#316BF3', - borderColor: '#316BF3', - borderWidth: 2 - } - }, - progress: { - lineStyle: { - color: '#316BF3' - }, - itemStyle: { - color: '#316BF3' - }, - label: { - color: '#6f778d' - } - }, - data: [] - }); - return SliderTimelineModel; - }(TimelineModel); - - mixin(SliderTimelineModel, DataFormatMixin.prototype); + processedDataArr.push(newItem); + names.push(value); + }); + } else { + processedDataArr = dataArr; + } + + var dimType = { + category: 'ordinal', + time: 'time', + value: 'number' + }[axisType] || 'number'; + var data = this._data = new SeriesData([{ + name: 'value', + type: dimType + }], this); + data.initData(processedDataArr, names); + }; + + TimelineModel.prototype.getData = function () { + return this._data; + }; + /** + * @public + * @return {Array.} categoreis + */ - var TimelineView = - /** @class */ - function (_super) { - __extends(TimelineView, _super); - function TimelineView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + TimelineModel.prototype.getCategories = function () { + if (this.get('axisType') === 'category') { + return this._names.slice(); + } + }; - _this.type = TimelineView.type; - return _this; - } + TimelineModel.type = 'timeline'; + /** + * @protected + */ - TimelineView.type = 'timeline'; - return TimelineView; - }(ComponentView); + TimelineModel.defaultOption = { + // zlevel: 0, // 一级层叠 + z: 4, + show: true, + axisType: 'time', + realtime: true, + left: '20%', + top: null, + right: '20%', + bottom: 0, + width: null, + height: 40, + padding: 5, + controlPosition: 'left', + autoPlay: false, + rewind: false, + loop: true, + playInterval: 2000, + currentIndex: 0, + itemStyle: {}, + label: { + color: '#000' + }, + data: [] + }; + return TimelineModel; + }(ComponentModel); - /** - * Extend axis 2d - */ + var SliderTimelineModel = + /** @class */ + function (_super) { + __extends(SliderTimelineModel, _super); - var TimelineAxis = - /** @class */ - function (_super) { - __extends(TimelineAxis, _super); + function SliderTimelineModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - function TimelineAxis(dim, scale, coordExtent, axisType) { - var _this = _super.call(this, dim, scale, coordExtent) || this; + _this.type = SliderTimelineModel.type; + return _this; + } - _this.type = axisType || 'value'; - return _this; - } - /** - * @override - */ + SliderTimelineModel.type = 'timeline.slider'; + /** + * @protected + */ + SliderTimelineModel.defaultOption = inheritDefaultOption(TimelineModel.defaultOption, { + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + borderWidth: 0, + orient: 'horizontal', + inverse: false, + tooltip: { + trigger: 'item' // data item may also have tootip attr. - TimelineAxis.prototype.getLabelModel = function () { - // Force override - return this.model.getModel('label'); - }; - /** - * @override - */ + }, + symbol: 'circle', + symbolSize: 12, + lineStyle: { + show: true, + width: 2, + color: '#DAE1F5' + }, + label: { + position: 'auto', + // When using number, label position is not + // restricted by viewRect. + // positive: right/bottom, negative: left/top + show: true, + interval: 'auto', + rotate: 0, + // formatter: null, + // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#A4B1D7' + }, + itemStyle: { + color: '#A4B1D7', + borderWidth: 1 + }, + checkpointStyle: { + symbol: 'circle', + symbolSize: 15, + color: '#316bf3', + borderColor: '#fff', + borderWidth: 2, + shadowBlur: 2, + shadowOffsetX: 1, + shadowOffsetY: 1, + shadowColor: 'rgba(0, 0, 0, 0.3)', + // borderColor: 'rgba(194,53,49, 0.5)', + animation: true, + animationDuration: 300, + animationEasing: 'quinticInOut' + }, + controlStyle: { + show: true, + showPlayBtn: true, + showPrevBtn: true, + showNextBtn: true, + itemSize: 24, + itemGap: 12, + position: 'left', + playIcon: 'path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z', + stopIcon: 'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z', + // eslint-disable-next-line max-len + nextIcon: 'M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z', + // eslint-disable-next-line max-len + prevIcon: 'M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z', + prevBtnSize: 18, + nextBtnSize: 18, + color: '#A4B1D7', + borderColor: '#A4B1D7', + borderWidth: 1 + }, + emphasis: { + label: { + show: true, + // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#6f778d' + }, + itemStyle: { + color: '#316BF3' + }, + controlStyle: { + color: '#316BF3', + borderColor: '#316BF3', + borderWidth: 2 + } + }, + progress: { + lineStyle: { + color: '#316BF3' + }, + itemStyle: { + color: '#316BF3' + }, + label: { + color: '#6f778d' + } + }, + data: [] + }); + return SliderTimelineModel; + }(TimelineModel); + mixin(SliderTimelineModel, DataFormatMixin.prototype); - TimelineAxis.prototype.isHorizontal = function () { - return this.model.get('orient') === 'horizontal'; - }; + var TimelineView = + /** @class */ + function (_super) { + __extends(TimelineView, _super); - return TimelineAxis; - }(Axis); + function TimelineView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - var PI$8 = Math.PI; - var labelDataIndexStore = makeInner(); + _this.type = TimelineView.type; + return _this; + } - var SliderTimelineView = - /** @class */ - function (_super) { - __extends(SliderTimelineView, _super); + TimelineView.type = 'timeline'; + return TimelineView; + }(ComponentView); - function SliderTimelineView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * Extend axis 2d + */ - _this.type = SliderTimelineView.type; - return _this; - } + var TimelineAxis = + /** @class */ + function (_super) { + __extends(TimelineAxis, _super); - SliderTimelineView.prototype.init = function (ecModel, api) { - this.api = api; - }; - /** - * @override - */ + function TimelineAxis(dim, scale, coordExtent, axisType) { + var _this = _super.call(this, dim, scale, coordExtent) || this; + _this.type = axisType || 'value'; + return _this; + } + /** + * @override + */ - SliderTimelineView.prototype.render = function (timelineModel, ecModel, api) { - this.model = timelineModel; - this.api = api; - this.ecModel = ecModel; - this.group.removeAll(); - if (timelineModel.get('show', true)) { - var layoutInfo_1 = this._layout(timelineModel, api); + TimelineAxis.prototype.getLabelModel = function () { + // Force override + return this.model.getModel('label'); + }; + /** + * @override + */ - var mainGroup_1 = this._createGroup('_mainGroup'); - var labelGroup = this._createGroup('_labelGroup'); + TimelineAxis.prototype.isHorizontal = function () { + return this.model.get('orient') === 'horizontal'; + }; - var axis_1 = this._axis = this._createAxis(layoutInfo_1, timelineModel); + return TimelineAxis; + }(Axis); - timelineModel.formatTooltip = function (dataIndex) { - var name = axis_1.scale.getLabel({ - value: dataIndex - }); - return createTooltipMarkup('nameValue', { - noName: true, - value: name - }); - }; + var PI$8 = Math.PI; + var labelDataIndexStore = makeInner(); - each(['AxisLine', 'AxisTick', 'Control', 'CurrentPointer'], function (name) { - this['_render' + name](layoutInfo_1, mainGroup_1, axis_1, timelineModel); - }, this); + var SliderTimelineView = + /** @class */ + function (_super) { + __extends(SliderTimelineView, _super); - this._renderAxisLabel(layoutInfo_1, labelGroup, axis_1, timelineModel); + function SliderTimelineView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - this._position(layoutInfo_1, timelineModel); - } + _this.type = SliderTimelineView.type; + return _this; + } - this._doPlayStop(); + SliderTimelineView.prototype.init = function (ecModel, api) { + this.api = api; + }; + /** + * @override + */ - this._updateTicksStatus(); - }; - /** - * @override - */ + SliderTimelineView.prototype.render = function (timelineModel, ecModel, api) { + this.model = timelineModel; + this.api = api; + this.ecModel = ecModel; + this.group.removeAll(); - SliderTimelineView.prototype.remove = function () { - this._clearTimer(); + if (timelineModel.get('show', true)) { + var layoutInfo_1 = this._layout(timelineModel, api); - this.group.removeAll(); - }; - /** - * @override - */ + var mainGroup_1 = this._createGroup('_mainGroup'); + var labelGroup = this._createGroup('_labelGroup'); - SliderTimelineView.prototype.dispose = function () { - this._clearTimer(); - }; + var axis_1 = this._axis = this._createAxis(layoutInfo_1, timelineModel); - SliderTimelineView.prototype._layout = function (timelineModel, api) { - var labelPosOpt = timelineModel.get(['label', 'position']); - var orient = timelineModel.get('orient'); - var viewRect = getViewRect$5(timelineModel, api); - var parsedLabelPos; // Auto label offset. - - if (labelPosOpt == null || labelPosOpt === 'auto') { - parsedLabelPos = orient === 'horizontal' ? viewRect.y + viewRect.height / 2 < api.getHeight() / 2 ? '-' : '+' : viewRect.x + viewRect.width / 2 < api.getWidth() / 2 ? '+' : '-'; - } else if (isString(labelPosOpt)) { - parsedLabelPos = { - horizontal: { - top: '-', - bottom: '+' - }, - vertical: { - left: '-', - right: '+' - } - }[orient][labelPosOpt]; - } else { - // is number - parsedLabelPos = labelPosOpt; - } + timelineModel.formatTooltip = function (dataIndex) { + var name = axis_1.scale.getLabel({ + value: dataIndex + }); + return createTooltipMarkup('nameValue', { + noName: true, + value: name + }); + }; - var labelAlignMap = { - horizontal: 'center', - vertical: parsedLabelPos >= 0 || parsedLabelPos === '+' ? 'left' : 'right' - }; - var labelBaselineMap = { - horizontal: parsedLabelPos >= 0 || parsedLabelPos === '+' ? 'top' : 'bottom', - vertical: 'middle' - }; - var rotationMap = { - horizontal: 0, - vertical: PI$8 / 2 - }; // Position - - var mainLength = orient === 'vertical' ? viewRect.height : viewRect.width; - var controlModel = timelineModel.getModel('controlStyle'); - var showControl = controlModel.get('show', true); - var controlSize = showControl ? controlModel.get('itemSize') : 0; - var controlGap = showControl ? controlModel.get('itemGap') : 0; - var sizePlusGap = controlSize + controlGap; // Special label rotate. - - var labelRotation = timelineModel.get(['label', 'rotate']) || 0; - labelRotation = labelRotation * PI$8 / 180; // To radian. - - var playPosition; - var prevBtnPosition; - var nextBtnPosition; - var controlPosition = controlModel.get('position', true); - var showPlayBtn = showControl && controlModel.get('showPlayBtn', true); - var showPrevBtn = showControl && controlModel.get('showPrevBtn', true); - var showNextBtn = showControl && controlModel.get('showNextBtn', true); - var xLeft = 0; - var xRight = mainLength; // position[0] means left, position[1] means middle. - - if (controlPosition === 'left' || controlPosition === 'bottom') { - showPlayBtn && (playPosition = [0, 0], xLeft += sizePlusGap); - showPrevBtn && (prevBtnPosition = [xLeft, 0], xLeft += sizePlusGap); - showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap); - } else { - // 'top' 'right' - showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap); - showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap); - showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap); - } + each(['AxisLine', 'AxisTick', 'Control', 'CurrentPointer'], function (name) { + this['_render' + name](layoutInfo_1, mainGroup_1, axis_1, timelineModel); + }, this); - var axisExtent = [xLeft, xRight]; + this._renderAxisLabel(layoutInfo_1, labelGroup, axis_1, timelineModel); - if (timelineModel.get('inverse')) { - axisExtent.reverse(); - } + this._position(layoutInfo_1, timelineModel); + } - return { - viewRect: viewRect, - mainLength: mainLength, - orient: orient, - rotation: rotationMap[orient], - labelRotation: labelRotation, - labelPosOpt: parsedLabelPos, - labelAlign: timelineModel.get(['label', 'align']) || labelAlignMap[orient], - labelBaseline: timelineModel.get(['label', 'verticalAlign']) || timelineModel.get(['label', 'baseline']) || labelBaselineMap[orient], - // Based on mainGroup. - playPosition: playPosition, - prevBtnPosition: prevBtnPosition, - nextBtnPosition: nextBtnPosition, - axisExtent: axisExtent, - controlSize: controlSize, - controlGap: controlGap - }; - }; + this._doPlayStop(); - SliderTimelineView.prototype._position = function (layoutInfo, timelineModel) { - // Position is be called finally, because bounding rect is needed for - // adapt content to fill viewRect (auto adapt offset). - // Timeline may be not all in the viewRect when 'offset' is specified - // as a number, because it is more appropriate that label aligns at - // 'offset' but not the other edge defined by viewRect. - var mainGroup = this._mainGroup; - var labelGroup = this._labelGroup; - var viewRect = layoutInfo.viewRect; - - if (layoutInfo.orient === 'vertical') { - // transform to horizontal, inverse rotate by left-top point. - var m = create$1(); - var rotateOriginX = viewRect.x; - var rotateOriginY = viewRect.y + viewRect.height; - translate(m, m, [-rotateOriginX, -rotateOriginY]); - rotate(m, m, -PI$8 / 2); - translate(m, m, [rotateOriginX, rotateOriginY]); - viewRect = viewRect.clone(); - viewRect.applyTransform(m); - } - - var viewBound = getBound(viewRect); - var mainBound = getBound(mainGroup.getBoundingRect()); - var labelBound = getBound(labelGroup.getBoundingRect()); - var mainPosition = [mainGroup.x, mainGroup.y]; - var labelsPosition = [labelGroup.x, labelGroup.y]; - labelsPosition[0] = mainPosition[0] = viewBound[0][0]; - var labelPosOpt = layoutInfo.labelPosOpt; - - if (labelPosOpt == null || isString(labelPosOpt)) { - // '+' or '-' - var mainBoundIdx = labelPosOpt === '+' ? 0 : 1; - toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx); - toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx); - } else { - var mainBoundIdx = labelPosOpt >= 0 ? 0 : 1; - toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx); - labelsPosition[1] = mainPosition[1] + labelPosOpt; - } + this._updateTicksStatus(); + }; + /** + * @override + */ - mainGroup.setPosition(mainPosition); - labelGroup.setPosition(labelsPosition); - mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation; - setOrigin(mainGroup); - setOrigin(labelGroup); - function setOrigin(targetGroup) { - targetGroup.originX = viewBound[0][0] - targetGroup.x; - targetGroup.originY = viewBound[1][0] - targetGroup.y; - } + SliderTimelineView.prototype.remove = function () { + this._clearTimer(); - function getBound(rect) { - // [[xmin, xmax], [ymin, ymax]] - return [[rect.x, rect.x + rect.width], [rect.y, rect.y + rect.height]]; - } + this.group.removeAll(); + }; + /** + * @override + */ - function toBound(fromPos, from, to, dimIdx, boundIdx) { - fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx]; - } - }; - SliderTimelineView.prototype._createAxis = function (layoutInfo, timelineModel) { - var data = timelineModel.getData(); - var axisType = timelineModel.get('axisType'); - var scale = createScaleByModel$1(timelineModel, axisType); // Customize scale. The `tickValue` is `dataIndex`. + SliderTimelineView.prototype.dispose = function () { + this._clearTimer(); + }; - scale.getTicks = function () { - return data.mapArray(['value'], function (value) { - return { - value: value - }; - }); - }; + SliderTimelineView.prototype._layout = function (timelineModel, api) { + var labelPosOpt = timelineModel.get(['label', 'position']); + var orient = timelineModel.get('orient'); + var viewRect = getViewRect$5(timelineModel, api); + var parsedLabelPos; // Auto label offset. - var dataExtent = data.getDataExtent('value'); - scale.setExtent(dataExtent[0], dataExtent[1]); - scale.calcNiceTicks(); - var axis = new TimelineAxis('value', scale, layoutInfo.axisExtent, axisType); - axis.model = timelineModel; - return axis; - }; + if (labelPosOpt == null || labelPosOpt === 'auto') { + parsedLabelPos = orient === 'horizontal' ? viewRect.y + viewRect.height / 2 < api.getHeight() / 2 ? '-' : '+' : viewRect.x + viewRect.width / 2 < api.getWidth() / 2 ? '+' : '-'; + } else if (isString(labelPosOpt)) { + parsedLabelPos = { + horizontal: { + top: '-', + bottom: '+' + }, + vertical: { + left: '-', + right: '+' + } + }[orient][labelPosOpt]; + } else { + // is number + parsedLabelPos = labelPosOpt; + } + + var labelAlignMap = { + horizontal: 'center', + vertical: parsedLabelPos >= 0 || parsedLabelPos === '+' ? 'left' : 'right' + }; + var labelBaselineMap = { + horizontal: parsedLabelPos >= 0 || parsedLabelPos === '+' ? 'top' : 'bottom', + vertical: 'middle' + }; + var rotationMap = { + horizontal: 0, + vertical: PI$8 / 2 + }; // Position + + var mainLength = orient === 'vertical' ? viewRect.height : viewRect.width; + var controlModel = timelineModel.getModel('controlStyle'); + var showControl = controlModel.get('show', true); + var controlSize = showControl ? controlModel.get('itemSize') : 0; + var controlGap = showControl ? controlModel.get('itemGap') : 0; + var sizePlusGap = controlSize + controlGap; // Special label rotate. + + var labelRotation = timelineModel.get(['label', 'rotate']) || 0; + labelRotation = labelRotation * PI$8 / 180; // To radian. + + var playPosition; + var prevBtnPosition; + var nextBtnPosition; + var controlPosition = controlModel.get('position', true); + var showPlayBtn = showControl && controlModel.get('showPlayBtn', true); + var showPrevBtn = showControl && controlModel.get('showPrevBtn', true); + var showNextBtn = showControl && controlModel.get('showNextBtn', true); + var xLeft = 0; + var xRight = mainLength; // position[0] means left, position[1] means middle. + + if (controlPosition === 'left' || controlPosition === 'bottom') { + showPlayBtn && (playPosition = [0, 0], xLeft += sizePlusGap); + showPrevBtn && (prevBtnPosition = [xLeft, 0], xLeft += sizePlusGap); + showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap); + } else { + // 'top' 'right' + showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap); + showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap); + showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap); + } - SliderTimelineView.prototype._createGroup = function (key) { - var newGroup = this[key] = new Group(); - this.group.add(newGroup); - return newGroup; - }; + var axisExtent = [xLeft, xRight]; - SliderTimelineView.prototype._renderAxisLine = function (layoutInfo, group, axis, timelineModel) { - var axisExtent = axis.getExtent(); + if (timelineModel.get('inverse')) { + axisExtent.reverse(); + } - if (!timelineModel.get(['lineStyle', 'show'])) { - return; - } + return { + viewRect: viewRect, + mainLength: mainLength, + orient: orient, + rotation: rotationMap[orient], + labelRotation: labelRotation, + labelPosOpt: parsedLabelPos, + labelAlign: timelineModel.get(['label', 'align']) || labelAlignMap[orient], + labelBaseline: timelineModel.get(['label', 'verticalAlign']) || timelineModel.get(['label', 'baseline']) || labelBaselineMap[orient], + // Based on mainGroup. + playPosition: playPosition, + prevBtnPosition: prevBtnPosition, + nextBtnPosition: nextBtnPosition, + axisExtent: axisExtent, + controlSize: controlSize, + controlGap: controlGap + }; + }; + + SliderTimelineView.prototype._position = function (layoutInfo, timelineModel) { + // Position is be called finally, because bounding rect is needed for + // adapt content to fill viewRect (auto adapt offset). + // Timeline may be not all in the viewRect when 'offset' is specified + // as a number, because it is more appropriate that label aligns at + // 'offset' but not the other edge defined by viewRect. + var mainGroup = this._mainGroup; + var labelGroup = this._labelGroup; + var viewRect = layoutInfo.viewRect; + + if (layoutInfo.orient === 'vertical') { + // transform to horizontal, inverse rotate by left-top point. + var m = create$1(); + var rotateOriginX = viewRect.x; + var rotateOriginY = viewRect.y + viewRect.height; + translate(m, m, [-rotateOriginX, -rotateOriginY]); + rotate(m, m, -PI$8 / 2); + translate(m, m, [rotateOriginX, rotateOriginY]); + viewRect = viewRect.clone(); + viewRect.applyTransform(m); + } + + var viewBound = getBound(viewRect); + var mainBound = getBound(mainGroup.getBoundingRect()); + var labelBound = getBound(labelGroup.getBoundingRect()); + var mainPosition = [mainGroup.x, mainGroup.y]; + var labelsPosition = [labelGroup.x, labelGroup.y]; + labelsPosition[0] = mainPosition[0] = viewBound[0][0]; + var labelPosOpt = layoutInfo.labelPosOpt; + + if (labelPosOpt == null || isString(labelPosOpt)) { + // '+' or '-' + var mainBoundIdx = labelPosOpt === '+' ? 0 : 1; + toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx); + toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx); + } else { + var mainBoundIdx = labelPosOpt >= 0 ? 0 : 1; + toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx); + labelsPosition[1] = mainPosition[1] + labelPosOpt; + } - var line = new Line({ - shape: { - x1: axisExtent[0], - y1: 0, - x2: axisExtent[1], - y2: 0 - }, - style: extend({ - lineCap: 'round' - }, timelineModel.getModel('lineStyle').getLineStyle()), - silent: true, - z2: 1 - }); - group.add(line); - var progressLine = this._progressLine = new Line({ - shape: { - x1: axisExtent[0], - x2: this._currentPointer ? this._currentPointer.x : axisExtent[0], - y1: 0, - y2: 0 - }, - style: defaults({ - lineCap: 'round', - lineWidth: line.style.lineWidth - }, timelineModel.getModel(['progress', 'lineStyle']).getLineStyle()), - silent: true, - z2: 1 - }); - group.add(progressLine); - }; + mainGroup.setPosition(mainPosition); + labelGroup.setPosition(labelsPosition); + mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation; + setOrigin(mainGroup); + setOrigin(labelGroup); - SliderTimelineView.prototype._renderAxisTick = function (layoutInfo, group, axis, timelineModel) { - var _this = this; + function setOrigin(targetGroup) { + targetGroup.originX = viewBound[0][0] - targetGroup.x; + targetGroup.originY = viewBound[1][0] - targetGroup.y; + } - var data = timelineModel.getData(); // Show all ticks, despite ignoring strategy. + function getBound(rect) { + // [[xmin, xmax], [ymin, ymax]] + return [[rect.x, rect.x + rect.width], [rect.y, rect.y + rect.height]]; + } - var ticks = axis.scale.getTicks(); - this._tickSymbols = []; // The value is dataIndex, see the costomized scale. + function toBound(fromPos, from, to, dimIdx, boundIdx) { + fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx]; + } + }; - each(ticks, function (tick) { - var tickCoord = axis.dataToCoord(tick.value); - var itemModel = data.getItemModel(tick.value); - var itemStyleModel = itemModel.getModel('itemStyle'); - var hoverStyleModel = itemModel.getModel(['emphasis', 'itemStyle']); - var progressStyleModel = itemModel.getModel(['progress', 'itemStyle']); - var symbolOpt = { - x: tickCoord, - y: 0, - onclick: bind(_this._changeTimeline, _this, tick.value) - }; - var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt); - el.ensureState('emphasis').style = hoverStyleModel.getItemStyle(); - el.ensureState('progress').style = progressStyleModel.getItemStyle(); - enableHoverEmphasis(el); - var ecData = getECData(el); - - if (itemModel.get('tooltip')) { - ecData.dataIndex = tick.value; - ecData.dataModel = timelineModel; - } else { - ecData.dataIndex = ecData.dataModel = null; - } + SliderTimelineView.prototype._createAxis = function (layoutInfo, timelineModel) { + var data = timelineModel.getData(); + var axisType = timelineModel.get('axisType'); + var scale = createScaleByModel$1(timelineModel, axisType); // Customize scale. The `tickValue` is `dataIndex`. - _this._tickSymbols.push(el); - }); + scale.getTicks = function () { + return data.mapArray(['value'], function (value) { + return { + value: value }; + }); + }; - SliderTimelineView.prototype._renderAxisLabel = function (layoutInfo, group, axis, timelineModel) { - var _this = this; - - var labelModel = axis.getLabelModel(); + var dataExtent = data.getDataExtent('value'); + scale.setExtent(dataExtent[0], dataExtent[1]); + scale.calcNiceTicks(); + var axis = new TimelineAxis('value', scale, layoutInfo.axisExtent, axisType); + axis.model = timelineModel; + return axis; + }; + + SliderTimelineView.prototype._createGroup = function (key) { + var newGroup = this[key] = new Group(); + this.group.add(newGroup); + return newGroup; + }; + + SliderTimelineView.prototype._renderAxisLine = function (layoutInfo, group, axis, timelineModel) { + var axisExtent = axis.getExtent(); - if (!labelModel.get('show')) { - return; - } + if (!timelineModel.get(['lineStyle', 'show'])) { + return; + } + + var line = new Line({ + shape: { + x1: axisExtent[0], + y1: 0, + x2: axisExtent[1], + y2: 0 + }, + style: extend({ + lineCap: 'round' + }, timelineModel.getModel('lineStyle').getLineStyle()), + silent: true, + z2: 1 + }); + group.add(line); + var progressLine = this._progressLine = new Line({ + shape: { + x1: axisExtent[0], + x2: this._currentPointer ? this._currentPointer.x : axisExtent[0], + y1: 0, + y2: 0 + }, + style: defaults({ + lineCap: 'round', + lineWidth: line.style.lineWidth + }, timelineModel.getModel(['progress', 'lineStyle']).getLineStyle()), + silent: true, + z2: 1 + }); + group.add(progressLine); + }; - var data = timelineModel.getData(); - var labels = axis.getViewLabels(); - this._tickLabels = []; - each(labels, function (labelItem) { - // The tickValue is dataIndex, see the costomized scale. - var dataIndex = labelItem.tickValue; - var itemModel = data.getItemModel(dataIndex); - var normalLabelModel = itemModel.getModel('label'); - var hoverLabelModel = itemModel.getModel(['emphasis', 'label']); - var progressLabelModel = itemModel.getModel(['progress', 'label']); - var tickCoord = axis.dataToCoord(labelItem.tickValue); - var textEl = new ZRText({ - x: tickCoord, - y: 0, - rotation: layoutInfo.labelRotation - layoutInfo.rotation, - onclick: bind(_this._changeTimeline, _this, dataIndex), - silent: false, - style: createTextStyle(normalLabelModel, { - text: labelItem.formattedLabel, - align: layoutInfo.labelAlign, - verticalAlign: layoutInfo.labelBaseline - }) - }); - textEl.ensureState('emphasis').style = createTextStyle(hoverLabelModel); - textEl.ensureState('progress').style = createTextStyle(progressLabelModel); - group.add(textEl); - enableHoverEmphasis(textEl); - labelDataIndexStore(textEl).dataIndex = dataIndex; + SliderTimelineView.prototype._renderAxisTick = function (layoutInfo, group, axis, timelineModel) { + var _this = this; - _this._tickLabels.push(textEl); - }); - }; + var data = timelineModel.getData(); // Show all ticks, despite ignoring strategy. - SliderTimelineView.prototype._renderControl = function (layoutInfo, group, axis, timelineModel) { - var controlSize = layoutInfo.controlSize; - var rotation = layoutInfo.rotation; - var itemStyle = timelineModel.getModel('controlStyle').getItemStyle(); - var hoverStyle = timelineModel.getModel(['emphasis', 'controlStyle']).getItemStyle(); - var playState = timelineModel.getPlayState(); - var inverse = timelineModel.get('inverse', true); - makeBtn(layoutInfo.nextBtnPosition, 'next', bind(this._changeTimeline, this, inverse ? '-' : '+')); - makeBtn(layoutInfo.prevBtnPosition, 'prev', bind(this._changeTimeline, this, inverse ? '+' : '-')); - makeBtn(layoutInfo.playPosition, playState ? 'stop' : 'play', bind(this._handlePlayClick, this, !playState), true); - - function makeBtn(position, iconName, onclick, willRotate) { - if (!position) { - return; - } + var ticks = axis.scale.getTicks(); + this._tickSymbols = []; // The value is dataIndex, see the costomized scale. + + each(ticks, function (tick) { + var tickCoord = axis.dataToCoord(tick.value); + var itemModel = data.getItemModel(tick.value); + var itemStyleModel = itemModel.getModel('itemStyle'); + var hoverStyleModel = itemModel.getModel(['emphasis', 'itemStyle']); + var progressStyleModel = itemModel.getModel(['progress', 'itemStyle']); + var symbolOpt = { + x: tickCoord, + y: 0, + onclick: bind(_this._changeTimeline, _this, tick.value) + }; + var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt); + el.ensureState('emphasis').style = hoverStyleModel.getItemStyle(); + el.ensureState('progress').style = progressStyleModel.getItemStyle(); + enableHoverEmphasis(el); + var ecData = getECData(el); + + if (itemModel.get('tooltip')) { + ecData.dataIndex = tick.value; + ecData.dataModel = timelineModel; + } else { + ecData.dataIndex = ecData.dataModel = null; + } + + _this._tickSymbols.push(el); + }); + }; - var iconSize = parsePercent(retrieve2(timelineModel.get(['controlStyle', iconName + 'BtnSize']), controlSize), controlSize); - var rect = [0, -iconSize / 2, iconSize, iconSize]; - var btn = makeControlIcon(timelineModel, iconName + 'Icon', rect, { - x: position[0], - y: position[1], - originX: controlSize / 2, - originY: 0, - rotation: willRotate ? -rotation : 0, - rectHover: true, - style: itemStyle, - onclick: onclick - }); - btn.ensureState('emphasis').style = hoverStyle; - group.add(btn); - enableHoverEmphasis(btn); - } - }; + SliderTimelineView.prototype._renderAxisLabel = function (layoutInfo, group, axis, timelineModel) { + var _this = this; - SliderTimelineView.prototype._renderCurrentPointer = function (layoutInfo, group, axis, timelineModel) { - var data = timelineModel.getData(); - var currentIndex = timelineModel.getCurrentIndex(); - var pointerModel = data.getItemModel(currentIndex).getModel('checkpointStyle'); - var me = this; - var callback = { - onCreate: function (pointer) { - pointer.draggable = true; - pointer.drift = bind(me._handlePointerDrag, me); - pointer.ondragend = bind(me._handlePointerDragend, me); - pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel, true); - }, - onUpdate: function (pointer) { - pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel); - } - }; // Reuse when exists, for animation and drag. + var labelModel = axis.getLabelModel(); - this._currentPointer = giveSymbol(pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback); - }; + if (!labelModel.get('show')) { + return; + } + + var data = timelineModel.getData(); + var labels = axis.getViewLabels(); + this._tickLabels = []; + each(labels, function (labelItem) { + // The tickValue is dataIndex, see the costomized scale. + var dataIndex = labelItem.tickValue; + var itemModel = data.getItemModel(dataIndex); + var normalLabelModel = itemModel.getModel('label'); + var hoverLabelModel = itemModel.getModel(['emphasis', 'label']); + var progressLabelModel = itemModel.getModel(['progress', 'label']); + var tickCoord = axis.dataToCoord(labelItem.tickValue); + var textEl = new ZRText({ + x: tickCoord, + y: 0, + rotation: layoutInfo.labelRotation - layoutInfo.rotation, + onclick: bind(_this._changeTimeline, _this, dataIndex), + silent: false, + style: createTextStyle(normalLabelModel, { + text: labelItem.formattedLabel, + align: layoutInfo.labelAlign, + verticalAlign: layoutInfo.labelBaseline + }) + }); + textEl.ensureState('emphasis').style = createTextStyle(hoverLabelModel); + textEl.ensureState('progress').style = createTextStyle(progressLabelModel); + group.add(textEl); + enableHoverEmphasis(textEl); + labelDataIndexStore(textEl).dataIndex = dataIndex; + + _this._tickLabels.push(textEl); + }); + }; + + SliderTimelineView.prototype._renderControl = function (layoutInfo, group, axis, timelineModel) { + var controlSize = layoutInfo.controlSize; + var rotation = layoutInfo.rotation; + var itemStyle = timelineModel.getModel('controlStyle').getItemStyle(); + var hoverStyle = timelineModel.getModel(['emphasis', 'controlStyle']).getItemStyle(); + var playState = timelineModel.getPlayState(); + var inverse = timelineModel.get('inverse', true); + makeBtn(layoutInfo.nextBtnPosition, 'next', bind(this._changeTimeline, this, inverse ? '-' : '+')); + makeBtn(layoutInfo.prevBtnPosition, 'prev', bind(this._changeTimeline, this, inverse ? '+' : '-')); + makeBtn(layoutInfo.playPosition, playState ? 'stop' : 'play', bind(this._handlePlayClick, this, !playState), true); + + function makeBtn(position, iconName, onclick, willRotate) { + if (!position) { + return; + } - SliderTimelineView.prototype._handlePlayClick = function (nextState) { - this._clearTimer(); + var iconSize = parsePercent(retrieve2(timelineModel.get(['controlStyle', iconName + 'BtnSize']), controlSize), controlSize); + var rect = [0, -iconSize / 2, iconSize, iconSize]; + var btn = makeControlIcon(timelineModel, iconName + 'Icon', rect, { + x: position[0], + y: position[1], + originX: controlSize / 2, + originY: 0, + rotation: willRotate ? -rotation : 0, + rectHover: true, + style: itemStyle, + onclick: onclick + }); + btn.ensureState('emphasis').style = hoverStyle; + group.add(btn); + enableHoverEmphasis(btn); + } + }; + + SliderTimelineView.prototype._renderCurrentPointer = function (layoutInfo, group, axis, timelineModel) { + var data = timelineModel.getData(); + var currentIndex = timelineModel.getCurrentIndex(); + var pointerModel = data.getItemModel(currentIndex).getModel('checkpointStyle'); + var me = this; + var callback = { + onCreate: function (pointer) { + pointer.draggable = true; + pointer.drift = bind(me._handlePointerDrag, me); + pointer.ondragend = bind(me._handlePointerDragend, me); + pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel, true); + }, + onUpdate: function (pointer) { + pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel); + } + }; // Reuse when exists, for animation and drag. + + this._currentPointer = giveSymbol(pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback); + }; + + SliderTimelineView.prototype._handlePlayClick = function (nextState) { + this._clearTimer(); + + this.api.dispatchAction({ + type: 'timelinePlayChange', + playState: nextState, + from: this.uid + }); + }; - this.api.dispatchAction({ - type: 'timelinePlayChange', - playState: nextState, - from: this.uid - }); - }; + SliderTimelineView.prototype._handlePointerDrag = function (dx, dy, e) { + this._clearTimer(); - SliderTimelineView.prototype._handlePointerDrag = function (dx, dy, e) { - this._clearTimer(); + this._pointerChangeTimeline([e.offsetX, e.offsetY]); + }; - this._pointerChangeTimeline([e.offsetX, e.offsetY]); - }; + SliderTimelineView.prototype._handlePointerDragend = function (e) { + this._pointerChangeTimeline([e.offsetX, e.offsetY], true); + }; - SliderTimelineView.prototype._handlePointerDragend = function (e) { - this._pointerChangeTimeline([e.offsetX, e.offsetY], true); - }; + SliderTimelineView.prototype._pointerChangeTimeline = function (mousePos, trigger) { + var toCoord = this._toAxisCoord(mousePos)[0]; - SliderTimelineView.prototype._pointerChangeTimeline = function (mousePos, trigger) { - var toCoord = this._toAxisCoord(mousePos)[0]; + var axis = this._axis; + var axisExtent = asc(axis.getExtent().slice()); + toCoord > axisExtent[1] && (toCoord = axisExtent[1]); + toCoord < axisExtent[0] && (toCoord = axisExtent[0]); + this._currentPointer.x = toCoord; - var axis = this._axis; - var axisExtent = asc(axis.getExtent().slice()); - toCoord > axisExtent[1] && (toCoord = axisExtent[1]); - toCoord < axisExtent[0] && (toCoord = axisExtent[0]); - this._currentPointer.x = toCoord; + this._currentPointer.markRedraw(); - this._currentPointer.markRedraw(); + this._progressLine.shape.x2 = toCoord; - this._progressLine.shape.x2 = toCoord; + this._progressLine.dirty(); - this._progressLine.dirty(); + var targetDataIndex = this._findNearestTick(toCoord); - var targetDataIndex = this._findNearestTick(toCoord); + var timelineModel = this.model; - var timelineModel = this.model; + if (trigger || targetDataIndex !== timelineModel.getCurrentIndex() && timelineModel.get('realtime')) { + this._changeTimeline(targetDataIndex); + } + }; - if (trigger || targetDataIndex !== timelineModel.getCurrentIndex() && timelineModel.get('realtime')) { - this._changeTimeline(targetDataIndex); - } - }; + SliderTimelineView.prototype._doPlayStop = function () { + var _this = this; - SliderTimelineView.prototype._doPlayStop = function () { - var _this = this; + this._clearTimer(); - this._clearTimer(); + if (this.model.getPlayState()) { + this._timer = setTimeout(function () { + // Do not cache + var timelineModel = _this.model; - if (this.model.getPlayState()) { - this._timer = setTimeout(function () { - // Do not cache - var timelineModel = _this.model; + _this._changeTimeline(timelineModel.getCurrentIndex() + (timelineModel.get('rewind', true) ? -1 : 1)); + }, this.model.get('playInterval')); + } + }; - _this._changeTimeline(timelineModel.getCurrentIndex() + (timelineModel.get('rewind', true) ? -1 : 1)); - }, this.model.get('playInterval')); - } - }; + SliderTimelineView.prototype._toAxisCoord = function (vertex) { + var trans = this._mainGroup.getLocalTransform(); - SliderTimelineView.prototype._toAxisCoord = function (vertex) { - var trans = this._mainGroup.getLocalTransform(); + return applyTransform$1(vertex, trans, true); + }; - return applyTransform$1(vertex, trans, true); - }; + SliderTimelineView.prototype._findNearestTick = function (axisCoord) { + var data = this.model.getData(); + var dist = Infinity; + var targetDataIndex; + var axis = this._axis; + data.each(['value'], function (value, dataIndex) { + var coord = axis.dataToCoord(value); + var d = Math.abs(coord - axisCoord); - SliderTimelineView.prototype._findNearestTick = function (axisCoord) { - var data = this.model.getData(); - var dist = Infinity; - var targetDataIndex; - var axis = this._axis; - data.each(['value'], function (value, dataIndex) { - var coord = axis.dataToCoord(value); - var d = Math.abs(coord - axisCoord); - - if (d < dist) { - dist = d; - targetDataIndex = dataIndex; - } - }); - return targetDataIndex; - }; + if (d < dist) { + dist = d; + targetDataIndex = dataIndex; + } + }); + return targetDataIndex; + }; - SliderTimelineView.prototype._clearTimer = function () { - if (this._timer) { - clearTimeout(this._timer); - this._timer = null; - } - }; + SliderTimelineView.prototype._clearTimer = function () { + if (this._timer) { + clearTimeout(this._timer); + this._timer = null; + } + }; - SliderTimelineView.prototype._changeTimeline = function (nextIndex) { - var currentIndex = this.model.getCurrentIndex(); + SliderTimelineView.prototype._changeTimeline = function (nextIndex) { + var currentIndex = this.model.getCurrentIndex(); - if (nextIndex === '+') { - nextIndex = currentIndex + 1; - } else if (nextIndex === '-') { - nextIndex = currentIndex - 1; - } + if (nextIndex === '+') { + nextIndex = currentIndex + 1; + } else if (nextIndex === '-') { + nextIndex = currentIndex - 1; + } - this.api.dispatchAction({ - type: 'timelineChange', - currentIndex: nextIndex, - from: this.uid - }); - }; + this.api.dispatchAction({ + type: 'timelineChange', + currentIndex: nextIndex, + from: this.uid + }); + }; - SliderTimelineView.prototype._updateTicksStatus = function () { - var currentIndex = this.model.getCurrentIndex(); - var tickSymbols = this._tickSymbols; - var tickLabels = this._tickLabels; + SliderTimelineView.prototype._updateTicksStatus = function () { + var currentIndex = this.model.getCurrentIndex(); + var tickSymbols = this._tickSymbols; + var tickLabels = this._tickLabels; - if (tickSymbols) { - for (var i = 0; i < tickSymbols.length; i++) { - tickSymbols && tickSymbols[i] && tickSymbols[i].toggleState('progress', i < currentIndex); - } - } + if (tickSymbols) { + for (var i = 0; i < tickSymbols.length; i++) { + tickSymbols && tickSymbols[i] && tickSymbols[i].toggleState('progress', i < currentIndex); + } + } - if (tickLabels) { - for (var i = 0; i < tickLabels.length; i++) { - tickLabels && tickLabels[i] && tickLabels[i].toggleState('progress', labelDataIndexStore(tickLabels[i]).dataIndex <= currentIndex); - } - } - }; + if (tickLabels) { + for (var i = 0; i < tickLabels.length; i++) { + tickLabels && tickLabels[i] && tickLabels[i].toggleState('progress', labelDataIndexStore(tickLabels[i]).dataIndex <= currentIndex); + } + } + }; - SliderTimelineView.type = 'timeline.slider'; - return SliderTimelineView; - }(TimelineView); + SliderTimelineView.type = 'timeline.slider'; + return SliderTimelineView; + }(TimelineView); function createScaleByModel$1(model, axisType) { - axisType = axisType || model.get('type'); - - if (axisType) { - switch (axisType) { - // Buildin scale - case 'category': - return new OrdinalScale({ - ordinalMeta: model.getCategories(), - extent: [Infinity, -Infinity] - }); + axisType = axisType || model.get('type'); + + if (axisType) { + switch (axisType) { + // Buildin scale + case 'category': + return new OrdinalScale({ + ordinalMeta: model.getCategories(), + extent: [Infinity, -Infinity] + }); - case 'time': - return new TimeScale({ - locale: model.ecModel.getLocaleModel(), - useUTC: model.ecModel.get('useUTC') - }); + case 'time': + return new TimeScale({ + locale: model.ecModel.getLocaleModel(), + useUTC: model.ecModel.get('useUTC') + }); - default: - // default to be value - return new IntervalScale(); - } + default: + // default to be value + return new IntervalScale(); } + } } function getViewRect$5(model, api) { - return getLayoutRect(model.getBoxLayoutParams(), { - width: api.getWidth(), - height: api.getHeight() - }, model.get('padding')); + return getLayoutRect(model.getBoxLayoutParams(), { + width: api.getWidth(), + height: api.getHeight() + }, model.get('padding')); } function makeControlIcon(timelineModel, objPath, rect, opts) { - var style = opts.style; - var icon = createIcon(timelineModel.get(['controlStyle', objPath]), opts || {}, new BoundingRect(rect[0], rect[1], rect[2], rect[3])); // TODO createIcon won't use style in opt. + var style = opts.style; + var icon = createIcon(timelineModel.get(['controlStyle', objPath]), opts || {}, new BoundingRect(rect[0], rect[1], rect[2], rect[3])); // TODO createIcon won't use style in opt. - if (style) { - icon.setStyle(style); - } + if (style) { + icon.setStyle(style); + } - return icon; + return icon; } /** * Create symbol or update symbol @@ -85366,462 +85366,462 @@ function giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) { - var color = itemStyleModel.get('color'); - - if (!symbol) { - var symbolType = hostModel.get('symbol'); - symbol = createSymbol(symbolType, -1, -1, 2, 2, color); - symbol.setStyle('strokeNoScale', true); - group.add(symbol); - callback && callback.onCreate(symbol); - } else { - symbol.setColor(color); - group.add(symbol); // Group may be new, also need to add. - - callback && callback.onUpdate(symbol); - } // Style - - - var itemStyle = itemStyleModel.getItemStyle(['color']); - symbol.setStyle(itemStyle); // Transform and events. - - opt = merge({ - rectHover: true, - z2: 100 - }, opt, true); - var symbolSize = normalizeSymbolSize(hostModel.get('symbolSize')); - opt.scaleX = symbolSize[0] / 2; - opt.scaleY = symbolSize[1] / 2; - var symbolOffset = normalizeSymbolOffset(hostModel.get('symbolOffset'), symbolSize); - - if (symbolOffset) { - opt.x = (opt.x || 0) + symbolOffset[0]; - opt.y = (opt.y || 0) + symbolOffset[1]; - } - - var symbolRotate = hostModel.get('symbolRotate'); - opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0; - symbol.attr(opt); // FIXME - // (1) When symbol.style.strokeNoScale is true and updateTransform is not performed, - // getBoundingRect will return wrong result. - // (This is supposed to be resolved in zrender, but it is a little difficult to - // leverage performance and auto updateTransform) - // (2) All of ancesters of symbol do not scale, so we can just updateTransform symbol. - - symbol.updateTransform(); - return symbol; + var color = itemStyleModel.get('color'); + + if (!symbol) { + var symbolType = hostModel.get('symbol'); + symbol = createSymbol(symbolType, -1, -1, 2, 2, color); + symbol.setStyle('strokeNoScale', true); + group.add(symbol); + callback && callback.onCreate(symbol); + } else { + symbol.setColor(color); + group.add(symbol); // Group may be new, also need to add. + + callback && callback.onUpdate(symbol); + } // Style + + + var itemStyle = itemStyleModel.getItemStyle(['color']); + symbol.setStyle(itemStyle); // Transform and events. + + opt = merge({ + rectHover: true, + z2: 100 + }, opt, true); + var symbolSize = normalizeSymbolSize(hostModel.get('symbolSize')); + opt.scaleX = symbolSize[0] / 2; + opt.scaleY = symbolSize[1] / 2; + var symbolOffset = normalizeSymbolOffset(hostModel.get('symbolOffset'), symbolSize); + + if (symbolOffset) { + opt.x = (opt.x || 0) + symbolOffset[0]; + opt.y = (opt.y || 0) + symbolOffset[1]; + } + + var symbolRotate = hostModel.get('symbolRotate'); + opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0; + symbol.attr(opt); // FIXME + // (1) When symbol.style.strokeNoScale is true and updateTransform is not performed, + // getBoundingRect will return wrong result. + // (This is supposed to be resolved in zrender, but it is a little difficult to + // leverage performance and auto updateTransform) + // (2) All of ancesters of symbol do not scale, so we can just updateTransform symbol. + + symbol.updateTransform(); + return symbol; } function pointerMoveTo(pointer, progressLine, dataIndex, axis, timelineModel, noAnimation) { - if (pointer.dragging) { - return; - } + if (pointer.dragging) { + return; + } - var pointerModel = timelineModel.getModel('checkpointStyle'); - var toCoord = axis.dataToCoord(timelineModel.getData().get('value', dataIndex)); + var pointerModel = timelineModel.getModel('checkpointStyle'); + var toCoord = axis.dataToCoord(timelineModel.getData().get('value', dataIndex)); - if (noAnimation || !pointerModel.get('animation', true)) { - pointer.attr({ - x: toCoord, - y: 0 - }); - progressLine && progressLine.attr({ - shape: { - x2: toCoord - } - }); - } else { - var animationCfg = { - duration: pointerModel.get('animationDuration', true), - easing: pointerModel.get('animationEasing', true) - }; - pointer.stopAnimation(null, true); - pointer.animateTo({ - x: toCoord, - y: 0 - }, animationCfg); - progressLine && progressLine.animateTo({ - shape: { - x2: toCoord - } - }, animationCfg); - } + if (noAnimation || !pointerModel.get('animation', true)) { + pointer.attr({ + x: toCoord, + y: 0 + }); + progressLine && progressLine.attr({ + shape: { + x2: toCoord + } + }); + } else { + var animationCfg = { + duration: pointerModel.get('animationDuration', true), + easing: pointerModel.get('animationEasing', true) + }; + pointer.stopAnimation(null, true); + pointer.animateTo({ + x: toCoord, + y: 0 + }, animationCfg); + progressLine && progressLine.animateTo({ + shape: { + x2: toCoord + } + }, animationCfg); + } } function installTimelineAction(registers) { - registers.registerAction({ - type: 'timelineChange', - event: 'timelineChanged', - update: 'prepareAndUpdate' - }, function (payload, ecModel, api) { - var timelineModel = ecModel.getComponent('timeline'); - - if (timelineModel && payload.currentIndex != null) { - timelineModel.setCurrentIndex(payload.currentIndex); - - if (!timelineModel.get('loop', true) && timelineModel.isIndexMax() && timelineModel.getPlayState()) { - timelineModel.setPlayState(false); // The timeline has played to the end, trigger event - - api.dispatchAction({ - type: 'timelinePlayChange', - playState: false, - from: payload.from - }); - } - } // Set normalized currentIndex to payload. + registers.registerAction({ + type: 'timelineChange', + event: 'timelineChanged', + update: 'prepareAndUpdate' + }, function (payload, ecModel, api) { + var timelineModel = ecModel.getComponent('timeline'); + if (timelineModel && payload.currentIndex != null) { + timelineModel.setCurrentIndex(payload.currentIndex); - ecModel.resetOption('timeline', { - replaceMerge: timelineModel.get('replaceMerge', true) + if (!timelineModel.get('loop', true) && timelineModel.isIndexMax() && timelineModel.getPlayState()) { + timelineModel.setPlayState(false); // The timeline has played to the end, trigger event + + api.dispatchAction({ + type: 'timelinePlayChange', + playState: false, + from: payload.from }); - return defaults({ - currentIndex: timelineModel.option.currentIndex - }, payload); - }); - registers.registerAction({ - type: 'timelinePlayChange', - event: 'timelinePlayChanged', - update: 'update' - }, function (payload, ecModel) { - var timelineModel = ecModel.getComponent('timeline'); + } + } // Set normalized currentIndex to payload. - if (timelineModel && payload.playState != null) { - timelineModel.setPlayState(payload.playState); - } + + ecModel.resetOption('timeline', { + replaceMerge: timelineModel.get('replaceMerge', true) }); + return defaults({ + currentIndex: timelineModel.option.currentIndex + }, payload); + }); + registers.registerAction({ + type: 'timelinePlayChange', + event: 'timelinePlayChanged', + update: 'update' + }, function (payload, ecModel) { + var timelineModel = ecModel.getComponent('timeline'); + + if (timelineModel && payload.playState != null) { + timelineModel.setPlayState(payload.playState); + } + }); } function timelinePreprocessor(option) { - var timelineOpt = option && option.timeline; + var timelineOpt = option && option.timeline; - if (!isArray(timelineOpt)) { - timelineOpt = timelineOpt ? [timelineOpt] : []; - } + if (!isArray(timelineOpt)) { + timelineOpt = timelineOpt ? [timelineOpt] : []; + } - each(timelineOpt, function (opt) { - if (!opt) { - return; - } + each(timelineOpt, function (opt) { + if (!opt) { + return; + } - compatibleEC2(opt); - }); + compatibleEC2(opt); + }); } function compatibleEC2(opt) { - var type = opt.type; - var ec2Types = { - 'number': 'value', - 'time': 'time' - }; // Compatible with ec2 - - if (ec2Types[type]) { - opt.axisType = ec2Types[type]; - delete opt.type; - } + var type = opt.type; + var ec2Types = { + 'number': 'value', + 'time': 'time' + }; // Compatible with ec2 - transferItem(opt); + if (ec2Types[type]) { + opt.axisType = ec2Types[type]; + delete opt.type; + } - if (has(opt, 'controlPosition')) { - var controlStyle = opt.controlStyle || (opt.controlStyle = {}); + transferItem(opt); - if (!has(controlStyle, 'position')) { - controlStyle.position = opt.controlPosition; - } + if (has(opt, 'controlPosition')) { + var controlStyle = opt.controlStyle || (opt.controlStyle = {}); - if (controlStyle.position === 'none' && !has(controlStyle, 'show')) { - controlStyle.show = false; - delete controlStyle.position; - } + if (!has(controlStyle, 'position')) { + controlStyle.position = opt.controlPosition; + } - delete opt.controlPosition; + if (controlStyle.position === 'none' && !has(controlStyle, 'show')) { + controlStyle.show = false; + delete controlStyle.position; } - each(opt.data || [], function (dataItem) { - if (isObject(dataItem) && !isArray(dataItem)) { - if (!has(dataItem, 'value') && has(dataItem, 'name')) { - // In ec2, using name as value. - dataItem.value = dataItem.name; - } + delete opt.controlPosition; + } - transferItem(dataItem); - } - }); + each(opt.data || [], function (dataItem) { + if (isObject(dataItem) && !isArray(dataItem)) { + if (!has(dataItem, 'value') && has(dataItem, 'name')) { + // In ec2, using name as value. + dataItem.value = dataItem.name; + } + + transferItem(dataItem); + } + }); } function transferItem(opt) { - var itemStyle = opt.itemStyle || (opt.itemStyle = {}); - var itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {}); // Transfer label out - - var label = opt.label || opt.label || {}; - var labelNormal = label.normal || (label.normal = {}); - var excludeLabelAttr = { - normal: 1, - emphasis: 1 - }; - each(label, function (value, name) { - if (!excludeLabelAttr[name] && !has(labelNormal, name)) { - labelNormal[name] = value; - } - }); + var itemStyle = opt.itemStyle || (opt.itemStyle = {}); + var itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {}); // Transfer label out - if (itemStyleEmphasis.label && !has(label, 'emphasis')) { - label.emphasis = itemStyleEmphasis.label; - delete itemStyleEmphasis.label; + var label = opt.label || opt.label || {}; + var labelNormal = label.normal || (label.normal = {}); + var excludeLabelAttr = { + normal: 1, + emphasis: 1 + }; + each(label, function (value, name) { + if (!excludeLabelAttr[name] && !has(labelNormal, name)) { + labelNormal[name] = value; } + }); + + if (itemStyleEmphasis.label && !has(label, 'emphasis')) { + label.emphasis = itemStyleEmphasis.label; + delete itemStyleEmphasis.label; + } } function has(obj, attr) { - return obj.hasOwnProperty(attr); + return obj.hasOwnProperty(attr); } function install$D(registers) { - registers.registerComponentModel(SliderTimelineModel); - registers.registerComponentView(SliderTimelineView); - registers.registerSubTypeDefaulter('timeline', function () { - // Only slider now. - return 'slider'; - }); - installTimelineAction(registers); - registers.registerPreprocessor(timelinePreprocessor); + registers.registerComponentModel(SliderTimelineModel); + registers.registerComponentView(SliderTimelineView); + registers.registerSubTypeDefaulter('timeline', function () { + // Only slider now. + return 'slider'; + }); + installTimelineAction(registers); + registers.registerPreprocessor(timelinePreprocessor); } function checkMarkerInSeries(seriesOpts, markerType) { - if (!seriesOpts) { - return false; - } + if (!seriesOpts) { + return false; + } - var seriesOptArr = isArray(seriesOpts) ? seriesOpts : [seriesOpts]; + var seriesOptArr = isArray(seriesOpts) ? seriesOpts : [seriesOpts]; - for (var idx = 0; idx < seriesOptArr.length; idx++) { - if (seriesOptArr[idx] && seriesOptArr[idx][markerType]) { - return true; - } + for (var idx = 0; idx < seriesOptArr.length; idx++) { + if (seriesOptArr[idx] && seriesOptArr[idx][markerType]) { + return true; } + } - return false; + return false; } function fillLabel(opt) { - defaultEmphasis(opt, 'label', ['show']); + defaultEmphasis(opt, 'label', ['show']); } // { [componentType]: MarkerModel } var inner$g = makeInner(); var MarkerModel = - /** @class */ - function (_super) { - __extends(MarkerModel, _super); + /** @class */ + function (_super) { + __extends(MarkerModel, _super); - function MarkerModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function MarkerModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = MarkerModel.type; - /** - * If marker model is created by self from series - */ + _this.type = MarkerModel.type; + /** + * If marker model is created by self from series + */ - _this.createdBySelf = false; - return _this; - } - /** - * @overrite - */ + _this.createdBySelf = false; + return _this; + } + /** + * @overrite + */ - MarkerModel.prototype.init = function (option, parentModel, ecModel) { - if ("development" !== 'production') { - if (this.type === 'marker') { - throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.'); - } - } + MarkerModel.prototype.init = function (option, parentModel, ecModel) { + if ("development" !== 'production') { + if (this.type === 'marker') { + throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.'); + } + } - this.mergeDefaultAndTheme(option, ecModel); + this.mergeDefaultAndTheme(option, ecModel); - this._mergeOption(option, ecModel, false, true); - }; + this._mergeOption(option, ecModel, false, true); + }; - MarkerModel.prototype.isAnimationEnabled = function () { - if (env.node) { - return false; - } + MarkerModel.prototype.isAnimationEnabled = function () { + if (env.node) { + return false; + } - var hostSeries = this.__hostSeries; - return this.getShallow('animation') && hostSeries && hostSeries.isAnimationEnabled(); - }; - /** - * @overrite - */ + var hostSeries = this.__hostSeries; + return this.getShallow('animation') && hostSeries && hostSeries.isAnimationEnabled(); + }; + /** + * @overrite + */ - MarkerModel.prototype.mergeOption = function (newOpt, ecModel) { - this._mergeOption(newOpt, ecModel, false, false); - }; + MarkerModel.prototype.mergeOption = function (newOpt, ecModel) { + this._mergeOption(newOpt, ecModel, false, false); + }; - MarkerModel.prototype._mergeOption = function (newOpt, ecModel, createdBySelf, isInit) { - var componentType = this.mainType; + MarkerModel.prototype._mergeOption = function (newOpt, ecModel, createdBySelf, isInit) { + var componentType = this.mainType; - if (!createdBySelf) { - ecModel.eachSeries(function (seriesModel) { - // mainType can be markPoint, markLine, markArea - var markerOpt = seriesModel.get(this.mainType, true); - var markerModel = inner$g(seriesModel)[componentType]; + if (!createdBySelf) { + ecModel.eachSeries(function (seriesModel) { + // mainType can be markPoint, markLine, markArea + var markerOpt = seriesModel.get(this.mainType, true); + var markerModel = inner$g(seriesModel)[componentType]; - if (!markerOpt || !markerOpt.data) { - inner$g(seriesModel)[componentType] = null; - return; - } + if (!markerOpt || !markerOpt.data) { + inner$g(seriesModel)[componentType] = null; + return; + } - if (!markerModel) { - if (isInit) { - // Default label emphasis `position` and `show` - fillLabel(markerOpt); - } + if (!markerModel) { + if (isInit) { + // Default label emphasis `position` and `show` + fillLabel(markerOpt); + } - each(markerOpt.data, function (item) { - // FIXME Overwrite fillLabel method ? - if (item instanceof Array) { - fillLabel(item[0]); - fillLabel(item[1]); - } else { - fillLabel(item); - } - }); - markerModel = this.createMarkerModelFromSeries(markerOpt, this, ecModel); // markerModel = new ImplementedMarkerModel( - // markerOpt, this, ecModel - // ); - - extend(markerModel, { - mainType: this.mainType, - // Use the same series index and name - seriesIndex: seriesModel.seriesIndex, - name: seriesModel.name, - createdBySelf: true - }); - markerModel.__hostSeries = seriesModel; - } else { - markerModel._mergeOption(markerOpt, ecModel, true); - } + each(markerOpt.data, function (item) { + // FIXME Overwrite fillLabel method ? + if (item instanceof Array) { + fillLabel(item[0]); + fillLabel(item[1]); + } else { + fillLabel(item); + } + }); + markerModel = this.createMarkerModelFromSeries(markerOpt, this, ecModel); // markerModel = new ImplementedMarkerModel( + // markerOpt, this, ecModel + // ); + + extend(markerModel, { + mainType: this.mainType, + // Use the same series index and name + seriesIndex: seriesModel.seriesIndex, + name: seriesModel.name, + createdBySelf: true + }); + markerModel.__hostSeries = seriesModel; + } else { + markerModel._mergeOption(markerOpt, ecModel, true); + } - inner$g(seriesModel)[componentType] = markerModel; - }, this); - } - }; + inner$g(seriesModel)[componentType] = markerModel; + }, this); + } + }; - MarkerModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { - var data = this.getData(); - var value = this.getRawValue(dataIndex); - var itemName = data.getName(dataIndex); - return createTooltipMarkup('section', { - header: this.name, - blocks: [createTooltipMarkup('nameValue', { - name: itemName, - value: value, - noName: !itemName, - noValue: value == null - })] - }); - }; + MarkerModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) { + var data = this.getData(); + var value = this.getRawValue(dataIndex); + var itemName = data.getName(dataIndex); + return createTooltipMarkup('section', { + header: this.name, + blocks: [createTooltipMarkup('nameValue', { + name: itemName, + value: value, + noName: !itemName, + noValue: value == null + })] + }); + }; - MarkerModel.prototype.getData = function () { - return this._data; - }; + MarkerModel.prototype.getData = function () { + return this._data; + }; - MarkerModel.prototype.setData = function (data) { - this._data = data; - }; + MarkerModel.prototype.setData = function (data) { + this._data = data; + }; - MarkerModel.getMarkerModelFromSeries = function (seriesModel, // Support three types of markers. Strict check. - componentType) { - return inner$g(seriesModel)[componentType]; - }; + MarkerModel.getMarkerModelFromSeries = function (seriesModel, // Support three types of markers. Strict check. + componentType) { + return inner$g(seriesModel)[componentType]; + }; - MarkerModel.type = 'marker'; - MarkerModel.dependencies = ['series', 'grid', 'polar', 'geo']; - return MarkerModel; - }(ComponentModel); + MarkerModel.type = 'marker'; + MarkerModel.dependencies = ['series', 'grid', 'polar', 'geo']; + return MarkerModel; + }(ComponentModel); mixin(MarkerModel, DataFormatMixin.prototype); var MarkPointModel = - /** @class */ - function (_super) { - __extends(MarkPointModel, _super); + /** @class */ + function (_super) { + __extends(MarkPointModel, _super); - function MarkPointModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function MarkPointModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = MarkPointModel.type; - return _this; - } + _this.type = MarkPointModel.type; + return _this; + } - MarkPointModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) { - return new MarkPointModel(markerOpt, masterMarkerModel, ecModel); - }; + MarkPointModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) { + return new MarkPointModel(markerOpt, masterMarkerModel, ecModel); + }; - MarkPointModel.type = 'markPoint'; - MarkPointModel.defaultOption = { - // zlevel: 0, - z: 5, - symbol: 'pin', - symbolSize: 50, - //symbolRotate: 0, - //symbolOffset: [0, 0] - tooltip: { - trigger: 'item' - }, - label: { - show: true, - position: 'inside' - }, - itemStyle: { - borderWidth: 2 - }, - emphasis: { - label: { - show: true - } - } - }; - return MarkPointModel; - }(MarkerModel); + MarkPointModel.type = 'markPoint'; + MarkPointModel.defaultOption = { + // zlevel: 0, + z: 5, + symbol: 'pin', + symbolSize: 50, + //symbolRotate: 0, + //symbolOffset: [0, 0] + tooltip: { + trigger: 'item' + }, + label: { + show: true, + position: 'inside' + }, + itemStyle: { + borderWidth: 2 + }, + emphasis: { + label: { + show: true + } + } + }; + return MarkPointModel; + }(MarkerModel); function hasXOrY(item) { - return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y))); + return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y))); } function hasXAndY(item) { - return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y)); + return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y)); } function markerTypeCalculatorWithExtent(markerType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex) { - var coordArr = []; - var stacked = isDimensionStacked(data, targetDataDim - /*, otherDataDim*/ - ); - var calcDataDim = stacked ? data.getCalculationInfo('stackResultDimension') : targetDataDim; - var value = numCalculate(data, calcDataDim, markerType); - var dataIndex = data.indicesOfNearest(calcDataDim, value)[0]; - coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex); - coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex); - var coordArrValue = data.get(targetDataDim, dataIndex); // Make it simple, do not visit all stacked value to count precision. - - var precision = getPrecision(data.get(targetDataDim, dataIndex)); - precision = Math.min(precision, 20); - - if (precision >= 0) { - coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision); - } - - return [coordArr, coordArrValue]; + var coordArr = []; + var stacked = isDimensionStacked(data, targetDataDim + /*, otherDataDim*/ + ); + var calcDataDim = stacked ? data.getCalculationInfo('stackResultDimension') : targetDataDim; + var value = numCalculate(data, calcDataDim, markerType); + var dataIndex = data.indicesOfNearest(calcDataDim, value)[0]; + coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex); + coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex); + var coordArrValue = data.get(targetDataDim, dataIndex); // Make it simple, do not visit all stacked value to count precision. + + var precision = getPrecision(data.get(targetDataDim, dataIndex)); + precision = Math.min(precision, 20); + + if (precision >= 0) { + coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision); + } + + return [coordArr, coordArrValue]; } // TODO Specified percent var markerTypeCalculator = { - min: curry(markerTypeCalculatorWithExtent, 'min'), - max: curry(markerTypeCalculatorWithExtent, 'max'), - average: curry(markerTypeCalculatorWithExtent, 'average'), - median: curry(markerTypeCalculatorWithExtent, 'median') + min: curry(markerTypeCalculatorWithExtent, 'min'), + max: curry(markerTypeCalculatorWithExtent, 'max'), + average: curry(markerTypeCalculatorWithExtent, 'average'), + median: curry(markerTypeCalculatorWithExtent, 'median') }; /** * Transform markPoint data item to format used in List by do the following @@ -85830,64 +85830,64 @@ */ function dataTransform(seriesModel, item) { - var data = seriesModel.getData(); - var coordSys = seriesModel.coordinateSystem; // 1. If not specify the position with pixel directly - // 2. If `coord` is not a data array. Which uses `xAxis`, - // `yAxis` to specify the coord on each dimension - // parseFloat first because item.x and item.y can be percent string like '20%' - - if (item && !hasXAndY(item) && !isArray(item.coord) && coordSys) { - var dims = coordSys.dimensions; - var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel); // Clone the option - // Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value - - item = clone(item); - - if (item.type && markerTypeCalculator[item.type] && axisInfo.baseAxis && axisInfo.valueAxis) { - var otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim); - var targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim); - var coordInfo = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex); - item.coord = coordInfo[0]; // Force to use the value of calculated value. - // let item use the value without stack. - - item.value = coordInfo[1]; - } else { - // FIXME Only has one of xAxis and yAxis. - var coord = [item.xAxis != null ? item.xAxis : item.radiusAxis, item.yAxis != null ? item.yAxis : item.angleAxis]; // Each coord support max, min, average - - for (var i = 0; i < 2; i++) { - if (markerTypeCalculator[coord[i]]) { - coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]); - } - } + var data = seriesModel.getData(); + var coordSys = seriesModel.coordinateSystem; // 1. If not specify the position with pixel directly + // 2. If `coord` is not a data array. Which uses `xAxis`, + // `yAxis` to specify the coord on each dimension + // parseFloat first because item.x and item.y can be percent string like '20%' + + if (item && !hasXAndY(item) && !isArray(item.coord) && coordSys) { + var dims = coordSys.dimensions; + var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel); // Clone the option + // Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value + + item = clone(item); + + if (item.type && markerTypeCalculator[item.type] && axisInfo.baseAxis && axisInfo.valueAxis) { + var otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim); + var targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim); + var coordInfo = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex); + item.coord = coordInfo[0]; // Force to use the value of calculated value. + // let item use the value without stack. + + item.value = coordInfo[1]; + } else { + // FIXME Only has one of xAxis and yAxis. + var coord = [item.xAxis != null ? item.xAxis : item.radiusAxis, item.yAxis != null ? item.yAxis : item.angleAxis]; // Each coord support max, min, average - item.coord = coord; + for (var i = 0; i < 2; i++) { + if (markerTypeCalculator[coord[i]]) { + coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]); } + } + + item.coord = coord; } + } - return item; + return item; } function getAxisInfo$1(item, data, coordSys, seriesModel) { - var ret = {}; + var ret = {}; - if (item.valueIndex != null || item.valueDim != null) { - ret.valueDataDim = item.valueIndex != null ? data.getDimension(item.valueIndex) : item.valueDim; - ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim)); - ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis); - ret.baseDataDim = data.mapDimension(ret.baseAxis.dim); - } else { - ret.baseAxis = seriesModel.getBaseAxis(); - ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis); - ret.baseDataDim = data.mapDimension(ret.baseAxis.dim); - ret.valueDataDim = data.mapDimension(ret.valueAxis.dim); - } + if (item.valueIndex != null || item.valueDim != null) { + ret.valueDataDim = item.valueIndex != null ? data.getDimension(item.valueIndex) : item.valueDim; + ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim)); + ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis); + ret.baseDataDim = data.mapDimension(ret.baseAxis.dim); + } else { + ret.baseAxis = seriesModel.getBaseAxis(); + ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis); + ret.baseDataDim = data.mapDimension(ret.baseAxis.dim); + ret.valueDataDim = data.mapDimension(ret.valueAxis.dim); + } - return ret; + return ret; } function dataDimToCoordDim(seriesModel, dataDim) { - var dimItem = seriesModel.getData().getDimensionInfo(dataDim); - return dimItem && dimItem.coordDim; + var dimItem = seriesModel.getData().getDimensionInfo(dataDim); + return dimItem && dimItem.coordDim; } /** * Filter data which is out of coordinateSystem range @@ -85896,1851 +85896,1851 @@ function dataFilter$1( // Currently only polar and cartesian has containData. - coordSys, item) { - // Alwalys return true if there is no coordSys - return coordSys && coordSys.containData && item.coord && !hasXOrY(item) ? coordSys.containData(item.coord) : true; + coordSys, item) { + // Alwalys return true if there is no coordSys + return coordSys && coordSys.containData && item.coord && !hasXOrY(item) ? coordSys.containData(item.coord) : true; } function createMarkerDimValueGetter(inCoordSys, dims) { - return inCoordSys ? function (item, dimName, dataIndex, dimIndex) { - var rawVal = dimIndex < 2 // x, y, radius, angle - ? item.coord && item.coord[dimIndex] : item.value; - return parseDataValue(rawVal, dims[dimIndex]); - } : function (item, dimName, dataIndex, dimIndex) { - return parseDataValue(item.value, dims[dimIndex]); - }; + return inCoordSys ? function (item, dimName, dataIndex, dimIndex) { + var rawVal = dimIndex < 2 // x, y, radius, angle + ? item.coord && item.coord[dimIndex] : item.value; + return parseDataValue(rawVal, dims[dimIndex]); + } : function (item, dimName, dataIndex, dimIndex) { + return parseDataValue(item.value, dims[dimIndex]); + }; } function numCalculate(data, valueDataDim, type) { - if (type === 'average') { - var sum_1 = 0; - var count_1 = 0; - data.each(valueDataDim, function (val, idx) { - if (!isNaN(val)) { - sum_1 += val; - count_1++; - } - }); - return sum_1 / count_1; - } else if (type === 'median') { - return data.getMedian(valueDataDim); - } else { - // max & min - return data.getDataExtent(valueDataDim)[type === 'max' ? 1 : 0]; - } + if (type === 'average') { + var sum_1 = 0; + var count_1 = 0; + data.each(valueDataDim, function (val, idx) { + if (!isNaN(val)) { + sum_1 += val; + count_1++; + } + }); + return sum_1 / count_1; + } else if (type === 'median') { + return data.getMedian(valueDataDim); + } else { + // max & min + return data.getDataExtent(valueDataDim)[type === 'max' ? 1 : 0]; + } } var inner$h = makeInner(); var MarkerView = - /** @class */ - function (_super) { - __extends(MarkerView, _super); + /** @class */ + function (_super) { + __extends(MarkerView, _super); - function MarkerView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function MarkerView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = MarkerView.type; - return _this; - } + _this.type = MarkerView.type; + return _this; + } - MarkerView.prototype.init = function () { - this.markerGroupMap = createHashMap(); - }; + MarkerView.prototype.init = function () { + this.markerGroupMap = createHashMap(); + }; - MarkerView.prototype.render = function (markerModel, ecModel, api) { - var _this = this; + MarkerView.prototype.render = function (markerModel, ecModel, api) { + var _this = this; - var markerGroupMap = this.markerGroupMap; - markerGroupMap.each(function (item) { - inner$h(item).keep = false; - }); - ecModel.eachSeries(function (seriesModel) { - var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type); - markerModel && _this.renderSeries(seriesModel, markerModel, ecModel, api); - }); - markerGroupMap.each(function (item) { - !inner$h(item).keep && _this.group.remove(item.group); - }); - }; + var markerGroupMap = this.markerGroupMap; + markerGroupMap.each(function (item) { + inner$h(item).keep = false; + }); + ecModel.eachSeries(function (seriesModel) { + var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type); + markerModel && _this.renderSeries(seriesModel, markerModel, ecModel, api); + }); + markerGroupMap.each(function (item) { + !inner$h(item).keep && _this.group.remove(item.group); + }); + }; - MarkerView.prototype.markKeep = function (drawGroup) { - inner$h(drawGroup).keep = true; - }; + MarkerView.prototype.markKeep = function (drawGroup) { + inner$h(drawGroup).keep = true; + }; - MarkerView.prototype.toggleBlurSeries = function (seriesModelList, isBlur) { - var _this = this; + MarkerView.prototype.toggleBlurSeries = function (seriesModelList, isBlur) { + var _this = this; - each(seriesModelList, function (seriesModel) { - var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type); + each(seriesModelList, function (seriesModel) { + var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type); - if (markerModel) { - var data = markerModel.getData(); - data.eachItemGraphicEl(function (el) { - if (el) { - isBlur ? enterBlur(el) : leaveBlur(el); - } - }); - } - }); - }; + if (markerModel) { + var data = markerModel.getData(); + data.eachItemGraphicEl(function (el) { + if (el) { + isBlur ? enterBlur(el) : leaveBlur(el); + } + }); + } + }); + }; - MarkerView.type = 'marker'; - return MarkerView; - }(ComponentView); + MarkerView.type = 'marker'; + return MarkerView; + }(ComponentView); function updateMarkerLayout(mpData, seriesModel, api) { - var coordSys = seriesModel.coordinateSystem; - mpData.each(function (idx) { - var itemModel = mpData.getItemModel(idx); - var point; - var xPx = parsePercent$1(itemModel.get('x'), api.getWidth()); - var yPx = parsePercent$1(itemModel.get('y'), api.getHeight()); + var coordSys = seriesModel.coordinateSystem; + mpData.each(function (idx) { + var itemModel = mpData.getItemModel(idx); + var point; + var xPx = parsePercent$1(itemModel.get('x'), api.getWidth()); + var yPx = parsePercent$1(itemModel.get('y'), api.getHeight()); - if (!isNaN(xPx) && !isNaN(yPx)) { - point = [xPx, yPx]; - } // Chart like bar may have there own marker positioning logic - else if (seriesModel.getMarkerPosition) { - // Use the getMarkerPoisition - point = seriesModel.getMarkerPosition(mpData.getValues(mpData.dimensions, idx)); - } else if (coordSys) { - var x = mpData.get(coordSys.dimensions[0], idx); - var y = mpData.get(coordSys.dimensions[1], idx); - point = coordSys.dataToPoint([x, y]); - } // Use x, y if has any + if (!isNaN(xPx) && !isNaN(yPx)) { + point = [xPx, yPx]; + } // Chart like bar may have there own marker positioning logic + else if (seriesModel.getMarkerPosition) { + // Use the getMarkerPoisition + point = seriesModel.getMarkerPosition(mpData.getValues(mpData.dimensions, idx)); + } else if (coordSys) { + var x = mpData.get(coordSys.dimensions[0], idx); + var y = mpData.get(coordSys.dimensions[1], idx); + point = coordSys.dataToPoint([x, y]); + } // Use x, y if has any - if (!isNaN(xPx)) { - point[0] = xPx; - } + if (!isNaN(xPx)) { + point[0] = xPx; + } - if (!isNaN(yPx)) { - point[1] = yPx; - } + if (!isNaN(yPx)) { + point[1] = yPx; + } - mpData.setItemLayout(idx, point); - }); + mpData.setItemLayout(idx, point); + }); } var MarkPointView = - /** @class */ - function (_super) { - __extends(MarkPointView, _super); + /** @class */ + function (_super) { + __extends(MarkPointView, _super); - function MarkPointView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function MarkPointView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = MarkPointView.type; - return _this; - } + _this.type = MarkPointView.type; + return _this; + } - MarkPointView.prototype.updateTransform = function (markPointModel, ecModel, api) { - ecModel.eachSeries(function (seriesModel) { - var mpModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markPoint'); + MarkPointView.prototype.updateTransform = function (markPointModel, ecModel, api) { + ecModel.eachSeries(function (seriesModel) { + var mpModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markPoint'); - if (mpModel) { - updateMarkerLayout(mpModel.getData(), seriesModel, api); - this.markerGroupMap.get(seriesModel.id).updateLayout(); - } - }, this); - }; + if (mpModel) { + updateMarkerLayout(mpModel.getData(), seriesModel, api); + this.markerGroupMap.get(seriesModel.id).updateLayout(); + } + }, this); + }; - MarkPointView.prototype.renderSeries = function (seriesModel, mpModel, ecModel, api) { - var coordSys = seriesModel.coordinateSystem; - var seriesId = seriesModel.id; - var seriesData = seriesModel.getData(); - var symbolDrawMap = this.markerGroupMap; - var symbolDraw = symbolDrawMap.get(seriesId) || symbolDrawMap.set(seriesId, new SymbolDraw()); - var mpData = createData(coordSys, seriesModel, mpModel); // FIXME - - mpModel.setData(mpData); - updateMarkerLayout(mpModel.getData(), seriesModel, api); - mpData.each(function (idx) { - var itemModel = mpData.getItemModel(idx); - var symbol = itemModel.getShallow('symbol'); - var symbolSize = itemModel.getShallow('symbolSize'); - var symbolRotate = itemModel.getShallow('symbolRotate'); - var symbolOffset = itemModel.getShallow('symbolOffset'); - var symbolKeepAspect = itemModel.getShallow('symbolKeepAspect'); // TODO: refactor needed: single data item should not support callback function - - if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate) || isFunction(symbolOffset)) { - var rawIdx = mpModel.getRawValue(idx); - var dataParams = mpModel.getDataParams(idx); - - if (isFunction(symbol)) { - symbol = symbol(rawIdx, dataParams); - } + MarkPointView.prototype.renderSeries = function (seriesModel, mpModel, ecModel, api) { + var coordSys = seriesModel.coordinateSystem; + var seriesId = seriesModel.id; + var seriesData = seriesModel.getData(); + var symbolDrawMap = this.markerGroupMap; + var symbolDraw = symbolDrawMap.get(seriesId) || symbolDrawMap.set(seriesId, new SymbolDraw()); + var mpData = createData(coordSys, seriesModel, mpModel); // FIXME + + mpModel.setData(mpData); + updateMarkerLayout(mpModel.getData(), seriesModel, api); + mpData.each(function (idx) { + var itemModel = mpData.getItemModel(idx); + var symbol = itemModel.getShallow('symbol'); + var symbolSize = itemModel.getShallow('symbolSize'); + var symbolRotate = itemModel.getShallow('symbolRotate'); + var symbolOffset = itemModel.getShallow('symbolOffset'); + var symbolKeepAspect = itemModel.getShallow('symbolKeepAspect'); // TODO: refactor needed: single data item should not support callback function - if (isFunction(symbolSize)) { - // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据? - symbolSize = symbolSize(rawIdx, dataParams); - } + if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate) || isFunction(symbolOffset)) { + var rawIdx = mpModel.getRawValue(idx); + var dataParams = mpModel.getDataParams(idx); - if (isFunction(symbolRotate)) { - symbolRotate = symbolRotate(rawIdx, dataParams); - } + if (isFunction(symbol)) { + symbol = symbol(rawIdx, dataParams); + } - if (isFunction(symbolOffset)) { - symbolOffset = symbolOffset(rawIdx, dataParams); - } - } + if (isFunction(symbolSize)) { + // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据? + symbolSize = symbolSize(rawIdx, dataParams); + } + + if (isFunction(symbolRotate)) { + symbolRotate = symbolRotate(rawIdx, dataParams); + } - var style = itemModel.getModel('itemStyle').getItemStyle(); - var color = getVisualFromData(seriesData, 'color'); + if (isFunction(symbolOffset)) { + symbolOffset = symbolOffset(rawIdx, dataParams); + } + } - if (!style.fill) { - style.fill = color; - } + var style = itemModel.getModel('itemStyle').getItemStyle(); + var color = getVisualFromData(seriesData, 'color'); - mpData.setItemVisual(idx, { - symbol: symbol, - symbolSize: symbolSize, - symbolRotate: symbolRotate, - symbolOffset: symbolOffset, - symbolKeepAspect: symbolKeepAspect, - style: style - }); - }); // TODO Text are wrong + if (!style.fill) { + style.fill = color; + } - symbolDraw.updateData(mpData); - this.group.add(symbolDraw.group); // Set host model for tooltip - // FIXME + mpData.setItemVisual(idx, { + symbol: symbol, + symbolSize: symbolSize, + symbolRotate: symbolRotate, + symbolOffset: symbolOffset, + symbolKeepAspect: symbolKeepAspect, + style: style + }); + }); // TODO Text are wrong - mpData.eachItemGraphicEl(function (el) { - el.traverse(function (child) { - getECData(child).dataModel = mpModel; - }); - }); - this.markKeep(symbolDraw); - symbolDraw.group.silent = mpModel.get('silent') || seriesModel.get('silent'); - }; + symbolDraw.updateData(mpData); + this.group.add(symbolDraw.group); // Set host model for tooltip + // FIXME + + mpData.eachItemGraphicEl(function (el) { + el.traverse(function (child) { + getECData(child).dataModel = mpModel; + }); + }); + this.markKeep(symbolDraw); + symbolDraw.group.silent = mpModel.get('silent') || seriesModel.get('silent'); + }; - MarkPointView.type = 'markPoint'; - return MarkPointView; - }(MarkerView); + MarkPointView.type = 'markPoint'; + return MarkPointView; + }(MarkerView); function createData(coordSys, seriesModel, mpModel) { - var coordDimsInfos; + var coordDimsInfos; - if (coordSys) { - coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) { - var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {}; // In map series data don't have lng and lat dimension. Fallback to same with coordSys + if (coordSys) { + coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) { + var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {}; // In map series data don't have lng and lat dimension. Fallback to same with coordSys - return extend(extend({}, info), { - name: coordDim, - // DON'T use ordinalMeta to parse and collect ordinal. - ordinalMeta: null - }); - }); - } else { - coordDimsInfos = [{ - name: 'value', - type: 'float' - }]; - } + return extend(extend({}, info), { + name: coordDim, + // DON'T use ordinalMeta to parse and collect ordinal. + ordinalMeta: null + }); + }); + } else { + coordDimsInfos = [{ + name: 'value', + type: 'float' + }]; + } - var mpData = new SeriesData(coordDimsInfos, mpModel); - var dataOpt = map(mpModel.get('data'), curry(dataTransform, seriesModel)); + var mpData = new SeriesData(coordDimsInfos, mpModel); + var dataOpt = map(mpModel.get('data'), curry(dataTransform, seriesModel)); - if (coordSys) { - dataOpt = filter(dataOpt, curry(dataFilter$1, coordSys)); - } + if (coordSys) { + dataOpt = filter(dataOpt, curry(dataFilter$1, coordSys)); + } - var dimValueGetter = createMarkerDimValueGetter(!!coordSys, coordDimsInfos); - mpData.initData(dataOpt, null, dimValueGetter); - return mpData; + var dimValueGetter = createMarkerDimValueGetter(!!coordSys, coordDimsInfos); + mpData.initData(dataOpt, null, dimValueGetter); + return mpData; } function install$E(registers) { - registers.registerComponentModel(MarkPointModel); - registers.registerComponentView(MarkPointView); - registers.registerPreprocessor(function (opt) { - if (checkMarkerInSeries(opt.series, 'markPoint')) { - // Make sure markPoint component is enabled - opt.markPoint = opt.markPoint || {}; - } - }); + registers.registerComponentModel(MarkPointModel); + registers.registerComponentView(MarkPointView); + registers.registerPreprocessor(function (opt) { + if (checkMarkerInSeries(opt.series, 'markPoint')) { + // Make sure markPoint component is enabled + opt.markPoint = opt.markPoint || {}; + } + }); } var MarkLineModel = - /** @class */ - function (_super) { - __extends(MarkLineModel, _super); + /** @class */ + function (_super) { + __extends(MarkLineModel, _super); - function MarkLineModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function MarkLineModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = MarkLineModel.type; - return _this; - } + _this.type = MarkLineModel.type; + return _this; + } - MarkLineModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) { - return new MarkLineModel(markerOpt, masterMarkerModel, ecModel); - }; + MarkLineModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) { + return new MarkLineModel(markerOpt, masterMarkerModel, ecModel); + }; - MarkLineModel.type = 'markLine'; - MarkLineModel.defaultOption = { - // zlevel: 0, - z: 5, - symbol: ['circle', 'arrow'], - symbolSize: [8, 16], - //symbolRotate: 0, - symbolOffset: 0, - precision: 2, - tooltip: { - trigger: 'item' - }, - label: { - show: true, - position: 'end', - distance: 5 - }, - lineStyle: { - type: 'dashed' - }, - emphasis: { - label: { - show: true - }, - lineStyle: { - width: 3 - } - }, - animationEasing: 'linear' - }; - return MarkLineModel; - }(MarkerModel); + MarkLineModel.type = 'markLine'; + MarkLineModel.defaultOption = { + // zlevel: 0, + z: 5, + symbol: ['circle', 'arrow'], + symbolSize: [8, 16], + //symbolRotate: 0, + symbolOffset: 0, + precision: 2, + tooltip: { + trigger: 'item' + }, + label: { + show: true, + position: 'end', + distance: 5 + }, + lineStyle: { + type: 'dashed' + }, + emphasis: { + label: { + show: true + }, + lineStyle: { + width: 3 + } + }, + animationEasing: 'linear' + }; + return MarkLineModel; + }(MarkerModel); var inner$i = makeInner(); var markLineTransform = function (seriesModel, coordSys, mlModel, item) { - var data = seriesModel.getData(); - var itemArray; - - if (!isArray(item)) { - // Special type markLine like 'min', 'max', 'average', 'median' - var mlType = item.type; - - if (mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median' // In case - // data: [{ - // yAxis: 10 - // }] - || item.xAxis != null || item.yAxis != null) { - var valueAxis = void 0; - var value = void 0; - - if (item.yAxis != null || item.xAxis != null) { - valueAxis = coordSys.getAxis(item.yAxis != null ? 'y' : 'x'); - value = retrieve(item.yAxis, item.xAxis); - } else { - var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel); - valueAxis = axisInfo.valueAxis; - var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim); - value = numCalculate(data, valueDataDim, mlType); - } - - var valueIndex = valueAxis.dim === 'x' ? 0 : 1; - var baseIndex = 1 - valueIndex; // Normized to 2d data with start and end point - - var mlFrom = clone(item); - var mlTo = { - coord: [] - }; - mlFrom.type = null; - mlFrom.coord = []; - mlFrom.coord[baseIndex] = -Infinity; - mlTo.coord[baseIndex] = Infinity; - var precision = mlModel.get('precision'); - - if (precision >= 0 && isNumber(value)) { - value = +value.toFixed(Math.min(precision, 20)); - } - - mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value; - itemArray = [mlFrom, mlTo, { - type: mlType, - valueIndex: item.valueIndex, - // Force to use the value of calculated value. - value: value - }]; - } else { - // Invalid data - if ("development" !== 'production') { - logError('Invalid markLine data.'); - } - - itemArray = []; - } + var data = seriesModel.getData(); + var itemArray; + + if (!isArray(item)) { + // Special type markLine like 'min', 'max', 'average', 'median' + var mlType = item.type; + + if (mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median' // In case + // data: [{ + // yAxis: 10 + // }] + || item.xAxis != null || item.yAxis != null) { + var valueAxis = void 0; + var value = void 0; + + if (item.yAxis != null || item.xAxis != null) { + valueAxis = coordSys.getAxis(item.yAxis != null ? 'y' : 'x'); + value = retrieve(item.yAxis, item.xAxis); + } else { + var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel); + valueAxis = axisInfo.valueAxis; + var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim); + value = numCalculate(data, valueDataDim, mlType); + } + + var valueIndex = valueAxis.dim === 'x' ? 0 : 1; + var baseIndex = 1 - valueIndex; // Normized to 2d data with start and end point + + var mlFrom = clone(item); + var mlTo = { + coord: [] + }; + mlFrom.type = null; + mlFrom.coord = []; + mlFrom.coord[baseIndex] = -Infinity; + mlTo.coord[baseIndex] = Infinity; + var precision = mlModel.get('precision'); + + if (precision >= 0 && isNumber(value)) { + value = +value.toFixed(Math.min(precision, 20)); + } + + mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value; + itemArray = [mlFrom, mlTo, { + type: mlType, + valueIndex: item.valueIndex, + // Force to use the value of calculated value. + value: value + }]; } else { - itemArray = item; + // Invalid data + if ("development" !== 'production') { + logError('Invalid markLine data.'); + } + + itemArray = []; } + } else { + itemArray = item; + } - var normalizedItem = [dataTransform(seriesModel, itemArray[0]), dataTransform(seriesModel, itemArray[1]), extend({}, itemArray[2])]; // Avoid line data type is extended by from(to) data type + var normalizedItem = [dataTransform(seriesModel, itemArray[0]), dataTransform(seriesModel, itemArray[1]), extend({}, itemArray[2])]; // Avoid line data type is extended by from(to) data type - normalizedItem[2].type = normalizedItem[2].type || null; // Merge from option and to option into line option + normalizedItem[2].type = normalizedItem[2].type || null; // Merge from option and to option into line option - merge(normalizedItem[2], normalizedItem[0]); - merge(normalizedItem[2], normalizedItem[1]); - return normalizedItem; + merge(normalizedItem[2], normalizedItem[0]); + merge(normalizedItem[2], normalizedItem[1]); + return normalizedItem; }; function isInifinity(val) { - return !isNaN(val) && !isFinite(val); + return !isNaN(val) && !isFinite(val); } // If a markLine has one dim function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) { - var otherDimIndex = 1 - dimIndex; - var dimName = coordSys.dimensions[dimIndex]; - return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex]) && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]); + var otherDimIndex = 1 - dimIndex; + var dimName = coordSys.dimensions[dimIndex]; + return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex]) && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]); } function markLineFilter(coordSys, item) { - if (coordSys.type === 'cartesian2d') { - var fromCoord = item[0].coord; - var toCoord = item[1].coord; // In case - // { - // markLine: { - // data: [{ yAxis: 2 }] - // } - // } + if (coordSys.type === 'cartesian2d') { + var fromCoord = item[0].coord; + var toCoord = item[1].coord; // In case + // { + // markLine: { + // data: [{ yAxis: 2 }] + // } + // } - if (fromCoord && toCoord && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) { - return true; - } + if (fromCoord && toCoord && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) { + return true; } + } - return dataFilter$1(coordSys, item[0]) && dataFilter$1(coordSys, item[1]); + return dataFilter$1(coordSys, item[0]) && dataFilter$1(coordSys, item[1]); } function updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api) { - var coordSys = seriesModel.coordinateSystem; - var itemModel = data.getItemModel(idx); - var point; - var xPx = parsePercent$1(itemModel.get('x'), api.getWidth()); - var yPx = parsePercent$1(itemModel.get('y'), api.getHeight()); - - if (!isNaN(xPx) && !isNaN(yPx)) { - point = [xPx, yPx]; + var coordSys = seriesModel.coordinateSystem; + var itemModel = data.getItemModel(idx); + var point; + var xPx = parsePercent$1(itemModel.get('x'), api.getWidth()); + var yPx = parsePercent$1(itemModel.get('y'), api.getHeight()); + + if (!isNaN(xPx) && !isNaN(yPx)) { + point = [xPx, yPx]; + } else { + // Chart like bar may have there own marker positioning logic + if (seriesModel.getMarkerPosition) { + // Use the getMarkerPoisition + point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx)); } else { - // Chart like bar may have there own marker positioning logic - if (seriesModel.getMarkerPosition) { - // Use the getMarkerPoisition - point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx)); - } else { - var dims = coordSys.dimensions; - var x = data.get(dims[0], idx); - var y = data.get(dims[1], idx); - point = coordSys.dataToPoint([x, y]); - } // Expand line to the edge of grid if value on one axis is Inifnity - // In case - // markLine: { - // data: [{ - // yAxis: 2 - // // or - // type: 'average' - // }] - // } + var dims = coordSys.dimensions; + var x = data.get(dims[0], idx); + var y = data.get(dims[1], idx); + point = coordSys.dataToPoint([x, y]); + } // Expand line to the edge of grid if value on one axis is Inifnity + // In case + // markLine: { + // data: [{ + // yAxis: 2 + // // or + // type: 'average' + // }] + // } - if (isCoordinateSystemType(coordSys, 'cartesian2d')) { - // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug - var xAxis = coordSys.getAxis('x'); - var yAxis = coordSys.getAxis('y'); - var dims = coordSys.dimensions; + if (isCoordinateSystemType(coordSys, 'cartesian2d')) { + // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug + var xAxis = coordSys.getAxis('x'); + var yAxis = coordSys.getAxis('y'); + var dims = coordSys.dimensions; - if (isInifinity(data.get(dims[0], idx))) { - point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]); - } else if (isInifinity(data.get(dims[1], idx))) { - point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]); - } - } // Use x, y if has any + if (isInifinity(data.get(dims[0], idx))) { + point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]); + } else if (isInifinity(data.get(dims[1], idx))) { + point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]); + } + } // Use x, y if has any - if (!isNaN(xPx)) { - point[0] = xPx; - } + if (!isNaN(xPx)) { + point[0] = xPx; + } - if (!isNaN(yPx)) { - point[1] = yPx; - } + if (!isNaN(yPx)) { + point[1] = yPx; } + } - data.setItemLayout(idx, point); + data.setItemLayout(idx, point); } var MarkLineView = - /** @class */ - function (_super) { - __extends(MarkLineView, _super); - - function MarkLineView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = MarkLineView.type; - return _this; - } - - MarkLineView.prototype.updateTransform = function (markLineModel, ecModel, api) { - ecModel.eachSeries(function (seriesModel) { - var mlModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markLine'); - - if (mlModel) { - var mlData_1 = mlModel.getData(); - var fromData_1 = inner$i(mlModel).from; - var toData_1 = inner$i(mlModel).to; // Update visual and layout of from symbol and to symbol - - fromData_1.each(function (idx) { - updateSingleMarkerEndLayout(fromData_1, idx, true, seriesModel, api); - updateSingleMarkerEndLayout(toData_1, idx, false, seriesModel, api); - }); // Update layout of line - - mlData_1.each(function (idx) { - mlData_1.setItemLayout(idx, [fromData_1.getItemLayout(idx), toData_1.getItemLayout(idx)]); - }); - this.markerGroupMap.get(seriesModel.id).updateLayout(); - } - }, this); - }; - - MarkLineView.prototype.renderSeries = function (seriesModel, mlModel, ecModel, api) { - var coordSys = seriesModel.coordinateSystem; - var seriesId = seriesModel.id; - var seriesData = seriesModel.getData(); - var lineDrawMap = this.markerGroupMap; - var lineDraw = lineDrawMap.get(seriesId) || lineDrawMap.set(seriesId, new LineDraw()); - this.group.add(lineDraw.group); - var mlData = createList$1(coordSys, seriesModel, mlModel); - var fromData = mlData.from; - var toData = mlData.to; - var lineData = mlData.line; - inner$i(mlModel).from = fromData; - inner$i(mlModel).to = toData; // Line data for tooltip and formatter - - mlModel.setData(lineData); // TODO - // Functionally, `symbolSize` & `symbolOffset` can also be 2D array now. - // But the related logic and type definition are not finished yet. - // Finish it if required + /** @class */ + function (_super) { + __extends(MarkLineView, _super); - var symbolType = mlModel.get('symbol'); - var symbolSize = mlModel.get('symbolSize'); - var symbolRotate = mlModel.get('symbolRotate'); - var symbolOffset = mlModel.get('symbolOffset'); // TODO: support callback function like markPoint + function MarkLineView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - if (!isArray(symbolType)) { - symbolType = [symbolType, symbolType]; - } - - if (!isArray(symbolSize)) { - symbolSize = [symbolSize, symbolSize]; - } + _this.type = MarkLineView.type; + return _this; + } - if (!isArray(symbolRotate)) { - symbolRotate = [symbolRotate, symbolRotate]; - } + MarkLineView.prototype.updateTransform = function (markLineModel, ecModel, api) { + ecModel.eachSeries(function (seriesModel) { + var mlModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markLine'); - if (!isArray(symbolOffset)) { - symbolOffset = [symbolOffset, symbolOffset]; - } // Update visual and layout of from symbol and to symbol + if (mlModel) { + var mlData_1 = mlModel.getData(); + var fromData_1 = inner$i(mlModel).from; + var toData_1 = inner$i(mlModel).to; // Update visual and layout of from symbol and to symbol + fromData_1.each(function (idx) { + updateSingleMarkerEndLayout(fromData_1, idx, true, seriesModel, api); + updateSingleMarkerEndLayout(toData_1, idx, false, seriesModel, api); + }); // Update layout of line - mlData.from.each(function (idx) { - updateDataVisualAndLayout(fromData, idx, true); - updateDataVisualAndLayout(toData, idx, false); - }); // Update visual and layout of line + mlData_1.each(function (idx) { + mlData_1.setItemLayout(idx, [fromData_1.getItemLayout(idx), toData_1.getItemLayout(idx)]); + }); + this.markerGroupMap.get(seriesModel.id).updateLayout(); + } + }, this); + }; - lineData.each(function (idx) { - var lineStyle = lineData.getItemModel(idx).getModel('lineStyle').getLineStyle(); // lineData.setItemVisual(idx, { - // color: lineColor || fromData.getItemVisual(idx, 'color') - // }); + MarkLineView.prototype.renderSeries = function (seriesModel, mlModel, ecModel, api) { + var coordSys = seriesModel.coordinateSystem; + var seriesId = seriesModel.id; + var seriesData = seriesModel.getData(); + var lineDrawMap = this.markerGroupMap; + var lineDraw = lineDrawMap.get(seriesId) || lineDrawMap.set(seriesId, new LineDraw()); + this.group.add(lineDraw.group); + var mlData = createList$1(coordSys, seriesModel, mlModel); + var fromData = mlData.from; + var toData = mlData.to; + var lineData = mlData.line; + inner$i(mlModel).from = fromData; + inner$i(mlModel).to = toData; // Line data for tooltip and formatter + + mlModel.setData(lineData); // TODO + // Functionally, `symbolSize` & `symbolOffset` can also be 2D array now. + // But the related logic and type definition are not finished yet. + // Finish it if required + + var symbolType = mlModel.get('symbol'); + var symbolSize = mlModel.get('symbolSize'); + var symbolRotate = mlModel.get('symbolRotate'); + var symbolOffset = mlModel.get('symbolOffset'); // TODO: support callback function like markPoint + + if (!isArray(symbolType)) { + symbolType = [symbolType, symbolType]; + } - lineData.setItemLayout(idx, [fromData.getItemLayout(idx), toData.getItemLayout(idx)]); + if (!isArray(symbolSize)) { + symbolSize = [symbolSize, symbolSize]; + } - if (lineStyle.stroke == null) { - lineStyle.stroke = fromData.getItemVisual(idx, 'style').fill; - } + if (!isArray(symbolRotate)) { + symbolRotate = [symbolRotate, symbolRotate]; + } - lineData.setItemVisual(idx, { - fromSymbolKeepAspect: fromData.getItemVisual(idx, 'symbolKeepAspect'), - fromSymbolOffset: fromData.getItemVisual(idx, 'symbolOffset'), - fromSymbolRotate: fromData.getItemVisual(idx, 'symbolRotate'), - fromSymbolSize: fromData.getItemVisual(idx, 'symbolSize'), - fromSymbol: fromData.getItemVisual(idx, 'symbol'), - toSymbolKeepAspect: toData.getItemVisual(idx, 'symbolKeepAspect'), - toSymbolOffset: toData.getItemVisual(idx, 'symbolOffset'), - toSymbolRotate: toData.getItemVisual(idx, 'symbolRotate'), - toSymbolSize: toData.getItemVisual(idx, 'symbolSize'), - toSymbol: toData.getItemVisual(idx, 'symbol'), - style: lineStyle - }); - }); - lineDraw.updateData(lineData); // Set host model for tooltip - // FIXME + if (!isArray(symbolOffset)) { + symbolOffset = [symbolOffset, symbolOffset]; + } // Update visual and layout of from symbol and to symbol + + + mlData.from.each(function (idx) { + updateDataVisualAndLayout(fromData, idx, true); + updateDataVisualAndLayout(toData, idx, false); + }); // Update visual and layout of line + + lineData.each(function (idx) { + var lineStyle = lineData.getItemModel(idx).getModel('lineStyle').getLineStyle(); // lineData.setItemVisual(idx, { + // color: lineColor || fromData.getItemVisual(idx, 'color') + // }); + + lineData.setItemLayout(idx, [fromData.getItemLayout(idx), toData.getItemLayout(idx)]); + + if (lineStyle.stroke == null) { + lineStyle.stroke = fromData.getItemVisual(idx, 'style').fill; + } + + lineData.setItemVisual(idx, { + fromSymbolKeepAspect: fromData.getItemVisual(idx, 'symbolKeepAspect'), + fromSymbolOffset: fromData.getItemVisual(idx, 'symbolOffset'), + fromSymbolRotate: fromData.getItemVisual(idx, 'symbolRotate'), + fromSymbolSize: fromData.getItemVisual(idx, 'symbolSize'), + fromSymbol: fromData.getItemVisual(idx, 'symbol'), + toSymbolKeepAspect: toData.getItemVisual(idx, 'symbolKeepAspect'), + toSymbolOffset: toData.getItemVisual(idx, 'symbolOffset'), + toSymbolRotate: toData.getItemVisual(idx, 'symbolRotate'), + toSymbolSize: toData.getItemVisual(idx, 'symbolSize'), + toSymbol: toData.getItemVisual(idx, 'symbol'), + style: lineStyle + }); + }); + lineDraw.updateData(lineData); // Set host model for tooltip + // FIXME - mlData.line.eachItemGraphicEl(function (el, idx) { - el.traverse(function (child) { - getECData(child).dataModel = mlModel; - }); - }); + mlData.line.eachItemGraphicEl(function (el, idx) { + el.traverse(function (child) { + getECData(child).dataModel = mlModel; + }); + }); - function updateDataVisualAndLayout(data, idx, isFrom) { - var itemModel = data.getItemModel(idx); - updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api); - var style = itemModel.getModel('itemStyle').getItemStyle(); + function updateDataVisualAndLayout(data, idx, isFrom) { + var itemModel = data.getItemModel(idx); + updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api); + var style = itemModel.getModel('itemStyle').getItemStyle(); - if (style.fill == null) { - style.fill = getVisualFromData(seriesData, 'color'); - } + if (style.fill == null) { + style.fill = getVisualFromData(seriesData, 'color'); + } - data.setItemVisual(idx, { - symbolKeepAspect: itemModel.get('symbolKeepAspect'), - // `0` should be considered as a valid value, so use `retrieve2` instead of `||` - symbolOffset: retrieve2(itemModel.get('symbolOffset', true), symbolOffset[isFrom ? 0 : 1]), - symbolRotate: retrieve2(itemModel.get('symbolRotate', true), symbolRotate[isFrom ? 0 : 1]), - // TODO: when 2d array is supported, it should ignore parent - symbolSize: retrieve2(itemModel.get('symbolSize'), symbolSize[isFrom ? 0 : 1]), - symbol: retrieve2(itemModel.get('symbol', true), symbolType[isFrom ? 0 : 1]), - style: style - }); - } + data.setItemVisual(idx, { + symbolKeepAspect: itemModel.get('symbolKeepAspect'), + // `0` should be considered as a valid value, so use `retrieve2` instead of `||` + symbolOffset: retrieve2(itemModel.get('symbolOffset', true), symbolOffset[isFrom ? 0 : 1]), + symbolRotate: retrieve2(itemModel.get('symbolRotate', true), symbolRotate[isFrom ? 0 : 1]), + // TODO: when 2d array is supported, it should ignore parent + symbolSize: retrieve2(itemModel.get('symbolSize'), symbolSize[isFrom ? 0 : 1]), + symbol: retrieve2(itemModel.get('symbol', true), symbolType[isFrom ? 0 : 1]), + style: style + }); + } - this.markKeep(lineDraw); - lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent'); - }; + this.markKeep(lineDraw); + lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent'); + }; - MarkLineView.type = 'markLine'; - return MarkLineView; - }(MarkerView); + MarkLineView.type = 'markLine'; + return MarkLineView; + }(MarkerView); function createList$1(coordSys, seriesModel, mlModel) { - var coordDimsInfos; - - if (coordSys) { - coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) { - var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {}; // In map series data don't have lng and lat dimension. Fallback to same with coordSys - - return extend(extend({}, info), { - name: coordDim, - // DON'T use ordinalMeta to parse and collect ordinal. - ordinalMeta: null - }); - }); - } else { - coordDimsInfos = [{ - name: 'value', - type: 'float' - }]; - } - - var fromData = new SeriesData(coordDimsInfos, mlModel); - var toData = new SeriesData(coordDimsInfos, mlModel); // No dimensions + var coordDimsInfos; - var lineData = new SeriesData([], mlModel); - var optData = map(mlModel.get('data'), curry(markLineTransform, seriesModel, coordSys, mlModel)); + if (coordSys) { + coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) { + var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {}; // In map series data don't have lng and lat dimension. Fallback to same with coordSys - if (coordSys) { - optData = filter(optData, curry(markLineFilter, coordSys)); - } - - var dimValueGetter = createMarkerDimValueGetter(!!coordSys, coordDimsInfos); - fromData.initData(map(optData, function (item) { - return item[0]; - }), null, dimValueGetter); - toData.initData(map(optData, function (item) { - return item[1]; - }), null, dimValueGetter); - lineData.initData(map(optData, function (item) { - return item[2]; - })); - lineData.hasItemOption = true; - return { - from: fromData, - to: toData, - line: lineData - }; + return extend(extend({}, info), { + name: coordDim, + // DON'T use ordinalMeta to parse and collect ordinal. + ordinalMeta: null + }); + }); + } else { + coordDimsInfos = [{ + name: 'value', + type: 'float' + }]; + } + + var fromData = new SeriesData(coordDimsInfos, mlModel); + var toData = new SeriesData(coordDimsInfos, mlModel); // No dimensions + + var lineData = new SeriesData([], mlModel); + var optData = map(mlModel.get('data'), curry(markLineTransform, seriesModel, coordSys, mlModel)); + + if (coordSys) { + optData = filter(optData, curry(markLineFilter, coordSys)); + } + + var dimValueGetter = createMarkerDimValueGetter(!!coordSys, coordDimsInfos); + fromData.initData(map(optData, function (item) { + return item[0]; + }), null, dimValueGetter); + toData.initData(map(optData, function (item) { + return item[1]; + }), null, dimValueGetter); + lineData.initData(map(optData, function (item) { + return item[2]; + })); + lineData.hasItemOption = true; + return { + from: fromData, + to: toData, + line: lineData + }; } function install$F(registers) { - registers.registerComponentModel(MarkLineModel); - registers.registerComponentView(MarkLineView); - registers.registerPreprocessor(function (opt) { - if (checkMarkerInSeries(opt.series, 'markLine')) { - // Make sure markLine component is enabled - opt.markLine = opt.markLine || {}; - } - }); + registers.registerComponentModel(MarkLineModel); + registers.registerComponentView(MarkLineView); + registers.registerPreprocessor(function (opt) { + if (checkMarkerInSeries(opt.series, 'markLine')) { + // Make sure markLine component is enabled + opt.markLine = opt.markLine || {}; + } + }); } var MarkAreaModel = - /** @class */ - function (_super) { - __extends(MarkAreaModel, _super); + /** @class */ + function (_super) { + __extends(MarkAreaModel, _super); - function MarkAreaModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function MarkAreaModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = MarkAreaModel.type; - return _this; - } + _this.type = MarkAreaModel.type; + return _this; + } - MarkAreaModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) { - return new MarkAreaModel(markerOpt, masterMarkerModel, ecModel); - }; + MarkAreaModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) { + return new MarkAreaModel(markerOpt, masterMarkerModel, ecModel); + }; - MarkAreaModel.type = 'markArea'; - MarkAreaModel.defaultOption = { - // zlevel: 0, - // PENDING - z: 1, - tooltip: { - trigger: 'item' - }, - // markArea should fixed on the coordinate system - animation: false, - label: { - show: true, - position: 'top' - }, - itemStyle: { - // color and borderColor default to use color from series - // color: 'auto' - // borderColor: 'auto' - borderWidth: 0 - }, - emphasis: { - label: { - show: true, - position: 'top' - } - } - }; - return MarkAreaModel; - }(MarkerModel); + MarkAreaModel.type = 'markArea'; + MarkAreaModel.defaultOption = { + // zlevel: 0, + // PENDING + z: 1, + tooltip: { + trigger: 'item' + }, + // markArea should fixed on the coordinate system + animation: false, + label: { + show: true, + position: 'top' + }, + itemStyle: { + // color and borderColor default to use color from series + // color: 'auto' + // borderColor: 'auto' + borderWidth: 0 + }, + emphasis: { + label: { + show: true, + position: 'top' + } + } + }; + return MarkAreaModel; + }(MarkerModel); var inner$j = makeInner(); var markAreaTransform = function (seriesModel, coordSys, maModel, item) { - var lt = dataTransform(seriesModel, item[0]); - var rb = dataTransform(seriesModel, item[1]); // FIXME make sure lt is less than rb - - var ltCoord = lt.coord; - var rbCoord = rb.coord; - ltCoord[0] = retrieve(ltCoord[0], -Infinity); - ltCoord[1] = retrieve(ltCoord[1], -Infinity); - rbCoord[0] = retrieve(rbCoord[0], Infinity); - rbCoord[1] = retrieve(rbCoord[1], Infinity); // Merge option into one - - var result = mergeAll([{}, lt, rb]); - result.coord = [lt.coord, rb.coord]; - result.x0 = lt.x; - result.y0 = lt.y; - result.x1 = rb.x; - result.y1 = rb.y; - return result; + var lt = dataTransform(seriesModel, item[0]); + var rb = dataTransform(seriesModel, item[1]); // FIXME make sure lt is less than rb + + var ltCoord = lt.coord; + var rbCoord = rb.coord; + ltCoord[0] = retrieve(ltCoord[0], -Infinity); + ltCoord[1] = retrieve(ltCoord[1], -Infinity); + rbCoord[0] = retrieve(rbCoord[0], Infinity); + rbCoord[1] = retrieve(rbCoord[1], Infinity); // Merge option into one + + var result = mergeAll([{}, lt, rb]); + result.coord = [lt.coord, rb.coord]; + result.x0 = lt.x; + result.y0 = lt.y; + result.x1 = rb.x; + result.y1 = rb.y; + return result; }; function isInifinity$1(val) { - return !isNaN(val) && !isFinite(val); + return !isNaN(val) && !isFinite(val); } // If a markArea has one dim function ifMarkAreaHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) { - var otherDimIndex = 1 - dimIndex; - return isInifinity$1(fromCoord[otherDimIndex]) && isInifinity$1(toCoord[otherDimIndex]); + var otherDimIndex = 1 - dimIndex; + return isInifinity$1(fromCoord[otherDimIndex]) && isInifinity$1(toCoord[otherDimIndex]); } function markAreaFilter(coordSys, item) { - var fromCoord = item.coord[0]; - var toCoord = item.coord[1]; - - if (isCoordinateSystemType(coordSys, 'cartesian2d')) { - // In case - // { - // markArea: { - // data: [{ yAxis: 2 }] - // } - // } - if (fromCoord && toCoord && (ifMarkAreaHasOnlyDim(1, fromCoord, toCoord) || ifMarkAreaHasOnlyDim(0, fromCoord, toCoord))) { - return true; - } - } + var fromCoord = item.coord[0]; + var toCoord = item.coord[1]; - return dataFilter$1(coordSys, { - coord: fromCoord, - x: item.x0, - y: item.y0 - }) || dataFilter$1(coordSys, { - coord: toCoord, - x: item.x1, - y: item.y1 - }); + if (isCoordinateSystemType(coordSys, 'cartesian2d')) { + // In case + // { + // markArea: { + // data: [{ yAxis: 2 }] + // } + // } + if (fromCoord && toCoord && (ifMarkAreaHasOnlyDim(1, fromCoord, toCoord) || ifMarkAreaHasOnlyDim(0, fromCoord, toCoord))) { + return true; + } + } + + return dataFilter$1(coordSys, { + coord: fromCoord, + x: item.x0, + y: item.y0 + }) || dataFilter$1(coordSys, { + coord: toCoord, + x: item.x1, + y: item.y1 + }); } // dims can be ['x0', 'y0'], ['x1', 'y1'], ['x0', 'y1'], ['x1', 'y0'] function getSingleMarkerEndPoint(data, idx, dims, seriesModel, api) { - var coordSys = seriesModel.coordinateSystem; - var itemModel = data.getItemModel(idx); - var point; - var xPx = parsePercent$1(itemModel.get(dims[0]), api.getWidth()); - var yPx = parsePercent$1(itemModel.get(dims[1]), api.getHeight()); - - if (!isNaN(xPx) && !isNaN(yPx)) { - point = [xPx, yPx]; + var coordSys = seriesModel.coordinateSystem; + var itemModel = data.getItemModel(idx); + var point; + var xPx = parsePercent$1(itemModel.get(dims[0]), api.getWidth()); + var yPx = parsePercent$1(itemModel.get(dims[1]), api.getHeight()); + + if (!isNaN(xPx) && !isNaN(yPx)) { + point = [xPx, yPx]; + } else { + // Chart like bar may have there own marker positioning logic + if (seriesModel.getMarkerPosition) { + // Use the getMarkerPoisition + point = seriesModel.getMarkerPosition(data.getValues(dims, idx)); } else { - // Chart like bar may have there own marker positioning logic - if (seriesModel.getMarkerPosition) { - // Use the getMarkerPoisition - point = seriesModel.getMarkerPosition(data.getValues(dims, idx)); - } else { - var x = data.get(dims[0], idx); - var y = data.get(dims[1], idx); - var pt = [x, y]; - coordSys.clampData && coordSys.clampData(pt, pt); - point = coordSys.dataToPoint(pt, true); - } + var x = data.get(dims[0], idx); + var y = data.get(dims[1], idx); + var pt = [x, y]; + coordSys.clampData && coordSys.clampData(pt, pt); + point = coordSys.dataToPoint(pt, true); + } - if (isCoordinateSystemType(coordSys, 'cartesian2d')) { - // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug - var xAxis = coordSys.getAxis('x'); - var yAxis = coordSys.getAxis('y'); - var x = data.get(dims[0], idx); - var y = data.get(dims[1], idx); + if (isCoordinateSystemType(coordSys, 'cartesian2d')) { + // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug + var xAxis = coordSys.getAxis('x'); + var yAxis = coordSys.getAxis('y'); + var x = data.get(dims[0], idx); + var y = data.get(dims[1], idx); - if (isInifinity$1(x)) { - point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]); - } else if (isInifinity$1(y)) { - point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]); - } - } // Use x, y if has any + if (isInifinity$1(x)) { + point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]); + } else if (isInifinity$1(y)) { + point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]); + } + } // Use x, y if has any - if (!isNaN(xPx)) { - point[0] = xPx; - } + if (!isNaN(xPx)) { + point[0] = xPx; + } - if (!isNaN(yPx)) { - point[1] = yPx; - } + if (!isNaN(yPx)) { + point[1] = yPx; } + } - return point; + return point; } var dimPermutations = [['x0', 'y0'], ['x1', 'y0'], ['x1', 'y1'], ['x0', 'y1']]; var MarkAreaView = - /** @class */ - function (_super) { - __extends(MarkAreaView, _super); - - function MarkAreaView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = MarkAreaView.type; - return _this; - } - - MarkAreaView.prototype.updateTransform = function (markAreaModel, ecModel, api) { - ecModel.eachSeries(function (seriesModel) { - var maModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markArea'); - - if (maModel) { - var areaData_1 = maModel.getData(); - areaData_1.each(function (idx) { - var points = map(dimPermutations, function (dim) { - return getSingleMarkerEndPoint(areaData_1, idx, dim, seriesModel, api); - }); // Layout - - areaData_1.setItemLayout(idx, points); - var el = areaData_1.getItemGraphicEl(idx); - el.setShape('points', points); - }); - } - }, this); - }; - - MarkAreaView.prototype.renderSeries = function (seriesModel, maModel, ecModel, api) { - var coordSys = seriesModel.coordinateSystem; - var seriesId = seriesModel.id; - var seriesData = seriesModel.getData(); - var areaGroupMap = this.markerGroupMap; - var polygonGroup = areaGroupMap.get(seriesId) || areaGroupMap.set(seriesId, { - group: new Group() - }); - this.group.add(polygonGroup.group); - this.markKeep(polygonGroup); - var areaData = createList$2(coordSys, seriesModel, maModel); // Line data for tooltip and formatter - - maModel.setData(areaData); // Update visual and layout of line - - areaData.each(function (idx) { - // Layout - var points = map(dimPermutations, function (dim) { - return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api); - }); - var xAxisScale = coordSys.getAxis('x').scale; - var yAxisScale = coordSys.getAxis('y').scale; - var xAxisExtent = xAxisScale.getExtent(); - var yAxisExtent = yAxisScale.getExtent(); - var xPointExtent = [xAxisScale.parse(areaData.get('x0', idx)), xAxisScale.parse(areaData.get('x1', idx))]; - var yPointExtent = [yAxisScale.parse(areaData.get('y0', idx)), yAxisScale.parse(areaData.get('y1', idx))]; - asc(xPointExtent); - asc(yPointExtent); - var overlapped = !(xAxisExtent[0] > xPointExtent[1] || xAxisExtent[1] < xPointExtent[0] || yAxisExtent[0] > yPointExtent[1] || yAxisExtent[1] < yPointExtent[0]); // If none of the area is inside coordSys, allClipped is set to be true - // in layout so that label will not be displayed. See #12591 - - var allClipped = !overlapped; - areaData.setItemLayout(idx, { - points: points, - allClipped: allClipped - }); - var style = areaData.getItemModel(idx).getModel('itemStyle').getItemStyle(); - var color$1 = getVisualFromData(seriesData, 'color'); - - if (!style.fill) { - style.fill = color$1; + /** @class */ + function (_super) { + __extends(MarkAreaView, _super); - if (isString(style.fill)) { - style.fill = modifyAlpha(style.fill, 0.4); - } - } + function MarkAreaView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - if (!style.stroke) { - style.stroke = color$1; - } // Visual + _this.type = MarkAreaView.type; + return _this; + } + MarkAreaView.prototype.updateTransform = function (markAreaModel, ecModel, api) { + ecModel.eachSeries(function (seriesModel) { + var maModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markArea'); + + if (maModel) { + var areaData_1 = maModel.getData(); + areaData_1.each(function (idx) { + var points = map(dimPermutations, function (dim) { + return getSingleMarkerEndPoint(areaData_1, idx, dim, seriesModel, api); + }); // Layout + + areaData_1.setItemLayout(idx, points); + var el = areaData_1.getItemGraphicEl(idx); + el.setShape('points', points); + }); + } + }, this); + }; - areaData.setItemVisual(idx, 'style', style); - }); - areaData.diff(inner$j(polygonGroup).data).add(function (idx) { - var layout = areaData.getItemLayout(idx); + MarkAreaView.prototype.renderSeries = function (seriesModel, maModel, ecModel, api) { + var coordSys = seriesModel.coordinateSystem; + var seriesId = seriesModel.id; + var seriesData = seriesModel.getData(); + var areaGroupMap = this.markerGroupMap; + var polygonGroup = areaGroupMap.get(seriesId) || areaGroupMap.set(seriesId, { + group: new Group() + }); + this.group.add(polygonGroup.group); + this.markKeep(polygonGroup); + var areaData = createList$2(coordSys, seriesModel, maModel); // Line data for tooltip and formatter + + maModel.setData(areaData); // Update visual and layout of line + + areaData.each(function (idx) { + // Layout + var points = map(dimPermutations, function (dim) { + return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api); + }); + var xAxisScale = coordSys.getAxis('x').scale; + var yAxisScale = coordSys.getAxis('y').scale; + var xAxisExtent = xAxisScale.getExtent(); + var yAxisExtent = yAxisScale.getExtent(); + var xPointExtent = [xAxisScale.parse(areaData.get('x0', idx)), xAxisScale.parse(areaData.get('x1', idx))]; + var yPointExtent = [yAxisScale.parse(areaData.get('y0', idx)), yAxisScale.parse(areaData.get('y1', idx))]; + asc(xPointExtent); + asc(yPointExtent); + var overlapped = !(xAxisExtent[0] > xPointExtent[1] || xAxisExtent[1] < xPointExtent[0] || yAxisExtent[0] > yPointExtent[1] || yAxisExtent[1] < yPointExtent[0]); // If none of the area is inside coordSys, allClipped is set to be true + // in layout so that label will not be displayed. See #12591 + + var allClipped = !overlapped; + areaData.setItemLayout(idx, { + points: points, + allClipped: allClipped + }); + var style = areaData.getItemModel(idx).getModel('itemStyle').getItemStyle(); + var color$1 = getVisualFromData(seriesData, 'color'); + + if (!style.fill) { + style.fill = color$1; + + if (isString(style.fill)) { + style.fill = modifyAlpha(style.fill, 0.4); + } + } + + if (!style.stroke) { + style.stroke = color$1; + } // Visual + + + areaData.setItemVisual(idx, 'style', style); + }); + areaData.diff(inner$j(polygonGroup).data).add(function (idx) { + var layout = areaData.getItemLayout(idx); + + if (!layout.allClipped) { + var polygon = new Polygon({ + shape: { + points: layout.points + } + }); + areaData.setItemGraphicEl(idx, polygon); + polygonGroup.group.add(polygon); + } + }).update(function (newIdx, oldIdx) { + var polygon = inner$j(polygonGroup).data.getItemGraphicEl(oldIdx); + var layout = areaData.getItemLayout(newIdx); - if (!layout.allClipped) { - var polygon = new Polygon({ - shape: { - points: layout.points - } - }); - areaData.setItemGraphicEl(idx, polygon); - polygonGroup.group.add(polygon); - } - }).update(function (newIdx, oldIdx) { - var polygon = inner$j(polygonGroup).data.getItemGraphicEl(oldIdx); - var layout = areaData.getItemLayout(newIdx); - - if (!layout.allClipped) { - if (polygon) { - updateProps(polygon, { - shape: { - points: layout.points - } - }, maModel, newIdx); - } else { - polygon = new Polygon({ - shape: { - points: layout.points - } - }); - } + if (!layout.allClipped) { + if (polygon) { + updateProps(polygon, { + shape: { + points: layout.points + } + }, maModel, newIdx); + } else { + polygon = new Polygon({ + shape: { + points: layout.points + } + }); + } - areaData.setItemGraphicEl(newIdx, polygon); - polygonGroup.group.add(polygon); - } else if (polygon) { - polygonGroup.group.remove(polygon); - } - }).remove(function (idx) { - var polygon = inner$j(polygonGroup).data.getItemGraphicEl(idx); - polygonGroup.group.remove(polygon); - }).execute(); - areaData.eachItemGraphicEl(function (polygon, idx) { - var itemModel = areaData.getItemModel(idx); - var style = areaData.getItemVisual(idx, 'style'); - polygon.useStyle(areaData.getItemVisual(idx, 'style')); - setLabelStyle(polygon, getLabelStatesModels(itemModel), { - labelFetcher: maModel, - labelDataIndex: idx, - defaultText: areaData.getName(idx) || '', - inheritColor: isString(style.fill) ? modifyAlpha(style.fill, 1) : '#000' - }); - setStatesStylesFromModel(polygon, itemModel); - toggleHoverEmphasis(polygon, null, null, itemModel.get(['emphasis', 'disabled'])); - getECData(polygon).dataModel = maModel; - }); - inner$j(polygonGroup).data = areaData; - polygonGroup.group.silent = maModel.get('silent') || seriesModel.get('silent'); - }; + areaData.setItemGraphicEl(newIdx, polygon); + polygonGroup.group.add(polygon); + } else if (polygon) { + polygonGroup.group.remove(polygon); + } + }).remove(function (idx) { + var polygon = inner$j(polygonGroup).data.getItemGraphicEl(idx); + polygonGroup.group.remove(polygon); + }).execute(); + areaData.eachItemGraphicEl(function (polygon, idx) { + var itemModel = areaData.getItemModel(idx); + var style = areaData.getItemVisual(idx, 'style'); + polygon.useStyle(areaData.getItemVisual(idx, 'style')); + setLabelStyle(polygon, getLabelStatesModels(itemModel), { + labelFetcher: maModel, + labelDataIndex: idx, + defaultText: areaData.getName(idx) || '', + inheritColor: isString(style.fill) ? modifyAlpha(style.fill, 1) : '#000' + }); + setStatesStylesFromModel(polygon, itemModel); + toggleHoverEmphasis(polygon, null, null, itemModel.get(['emphasis', 'disabled'])); + getECData(polygon).dataModel = maModel; + }); + inner$j(polygonGroup).data = areaData; + polygonGroup.group.silent = maModel.get('silent') || seriesModel.get('silent'); + }; - MarkAreaView.type = 'markArea'; - return MarkAreaView; - }(MarkerView); + MarkAreaView.type = 'markArea'; + return MarkAreaView; + }(MarkerView); function createList$2(coordSys, seriesModel, maModel) { - var areaData; - var dataDims; - var dims = ['x0', 'y0', 'x1', 'y1']; - - if (coordSys) { - var coordDimsInfos_1 = map(coordSys && coordSys.dimensions, function (coordDim) { - var data = seriesModel.getData(); - var info = data.getDimensionInfo(data.mapDimension(coordDim)) || {}; // In map series data don't have lng and lat dimension. Fallback to same with coordSys - - return extend(extend({}, info), { - name: coordDim, - // DON'T use ordinalMeta to parse and collect ordinal. - ordinalMeta: null - }); - }); - dataDims = map(dims, function (dim, idx) { - return { - name: dim, - type: coordDimsInfos_1[idx % 2].type - }; - }); - areaData = new SeriesData(dataDims, maModel); - } else { - dataDims = [{ - name: 'value', - type: 'float' - }]; - areaData = new SeriesData(dataDims, maModel); - } + var areaData; + var dataDims; + var dims = ['x0', 'y0', 'x1', 'y1']; + + if (coordSys) { + var coordDimsInfos_1 = map(coordSys && coordSys.dimensions, function (coordDim) { + var data = seriesModel.getData(); + var info = data.getDimensionInfo(data.mapDimension(coordDim)) || {}; // In map series data don't have lng and lat dimension. Fallback to same with coordSys + + return extend(extend({}, info), { + name: coordDim, + // DON'T use ordinalMeta to parse and collect ordinal. + ordinalMeta: null + }); + }); + dataDims = map(dims, function (dim, idx) { + return { + name: dim, + type: coordDimsInfos_1[idx % 2].type + }; + }); + areaData = new SeriesData(dataDims, maModel); + } else { + dataDims = [{ + name: 'value', + type: 'float' + }]; + areaData = new SeriesData(dataDims, maModel); + } - var optData = map(maModel.get('data'), curry(markAreaTransform, seriesModel, coordSys, maModel)); + var optData = map(maModel.get('data'), curry(markAreaTransform, seriesModel, coordSys, maModel)); - if (coordSys) { - optData = filter(optData, curry(markAreaFilter, coordSys)); - } + if (coordSys) { + optData = filter(optData, curry(markAreaFilter, coordSys)); + } - var dimValueGetter = coordSys ? function (item, dimName, dataIndex, dimIndex) { - // TODO should convert to ParsedValue? - var rawVal = item.coord[Math.floor(dimIndex / 2)][dimIndex % 2]; - return parseDataValue(rawVal, dataDims[dimIndex]); - } : function (item, dimName, dataIndex, dimIndex) { - return parseDataValue(item.value, dataDims[dimIndex]); - }; - areaData.initData(optData, null, dimValueGetter); - areaData.hasItemOption = true; - return areaData; + var dimValueGetter = coordSys ? function (item, dimName, dataIndex, dimIndex) { + // TODO should convert to ParsedValue? + var rawVal = item.coord[Math.floor(dimIndex / 2)][dimIndex % 2]; + return parseDataValue(rawVal, dataDims[dimIndex]); + } : function (item, dimName, dataIndex, dimIndex) { + return parseDataValue(item.value, dataDims[dimIndex]); + }; + areaData.initData(optData, null, dimValueGetter); + areaData.hasItemOption = true; + return areaData; } function install$G(registers) { - registers.registerComponentModel(MarkAreaModel); - registers.registerComponentView(MarkAreaView); - registers.registerPreprocessor(function (opt) { - if (checkMarkerInSeries(opt.series, 'markArea')) { - // Make sure markArea component is enabled - opt.markArea = opt.markArea || {}; - } - }); + registers.registerComponentModel(MarkAreaModel); + registers.registerComponentView(MarkAreaView); + registers.registerPreprocessor(function (opt) { + if (checkMarkerInSeries(opt.series, 'markArea')) { + // Make sure markArea component is enabled + opt.markArea = opt.markArea || {}; + } + }); } var getDefaultSelectorOptions = function (ecModel, type) { - if (type === 'all') { - return { - type: 'all', - title: ecModel.getLocaleModel().get(['legend', 'selector', 'all']) - }; - } else if (type === 'inverse') { - return { - type: 'inverse', - title: ecModel.getLocaleModel().get(['legend', 'selector', 'inverse']) - }; - } + if (type === 'all') { + return { + type: 'all', + title: ecModel.getLocaleModel().get(['legend', 'selector', 'all']) + }; + } else if (type === 'inverse') { + return { + type: 'inverse', + title: ecModel.getLocaleModel().get(['legend', 'selector', 'inverse']) + }; + } }; var LegendModel = - /** @class */ - function (_super) { - __extends(LegendModel, _super); - - function LegendModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = LegendModel.type; - _this.layoutMode = { - type: 'box', - // legend.width/height are maxWidth/maxHeight actually, - // whereas realy width/height is calculated by its content. - // (Setting {left: 10, right: 10} does not make sense). - // So consider the case: - // `setOption({legend: {left: 10});` - // then `setOption({legend: {right: 10});` - // The previous `left` should be cleared by setting `ignoreSize`. - ignoreSize: true - }; - return _this; - } + /** @class */ + function (_super) { + __extends(LegendModel, _super); - LegendModel.prototype.init = function (option, parentModel, ecModel) { - this.mergeDefaultAndTheme(option, ecModel); - option.selected = option.selected || {}; + function LegendModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - this._updateSelector(option); - }; + _this.type = LegendModel.type; + _this.layoutMode = { + type: 'box', + // legend.width/height are maxWidth/maxHeight actually, + // whereas realy width/height is calculated by its content. + // (Setting {left: 10, right: 10} does not make sense). + // So consider the case: + // `setOption({legend: {left: 10});` + // then `setOption({legend: {right: 10});` + // The previous `left` should be cleared by setting `ignoreSize`. + ignoreSize: true + }; + return _this; + } - LegendModel.prototype.mergeOption = function (option, ecModel) { - _super.prototype.mergeOption.call(this, option, ecModel); + LegendModel.prototype.init = function (option, parentModel, ecModel) { + this.mergeDefaultAndTheme(option, ecModel); + option.selected = option.selected || {}; - this._updateSelector(option); - }; + this._updateSelector(option); + }; - LegendModel.prototype._updateSelector = function (option) { - var selector = option.selector; - var ecModel = this.ecModel; + LegendModel.prototype.mergeOption = function (option, ecModel) { + _super.prototype.mergeOption.call(this, option, ecModel); - if (selector === true) { - selector = option.selector = ['all', 'inverse']; - } + this._updateSelector(option); + }; - if (isArray(selector)) { - each(selector, function (item, index) { - isString(item) && (item = { - type: item - }); - selector[index] = merge(item, getDefaultSelectorOptions(ecModel, item.type)); - }); - } - }; + LegendModel.prototype._updateSelector = function (option) { + var selector = option.selector; + var ecModel = this.ecModel; - LegendModel.prototype.optionUpdated = function () { - this._updateData(this.ecModel); + if (selector === true) { + selector = option.selector = ['all', 'inverse']; + } - var legendData = this._data; // If selectedMode is single, try to select one + if (isArray(selector)) { + each(selector, function (item, index) { + isString(item) && (item = { + type: item + }); + selector[index] = merge(item, getDefaultSelectorOptions(ecModel, item.type)); + }); + } + }; - if (legendData[0] && this.get('selectedMode') === 'single') { - var hasSelected = false; // If has any selected in option.selected + LegendModel.prototype.optionUpdated = function () { + this._updateData(this.ecModel); - for (var i = 0; i < legendData.length; i++) { - var name_1 = legendData[i].get('name'); + var legendData = this._data; // If selectedMode is single, try to select one - if (this.isSelected(name_1)) { - // Force to unselect others - this.select(name_1); - hasSelected = true; - break; - } - } // Try select the first if selectedMode is single + if (legendData[0] && this.get('selectedMode') === 'single') { + var hasSelected = false; // If has any selected in option.selected + for (var i = 0; i < legendData.length; i++) { + var name_1 = legendData[i].get('name'); - !hasSelected && this.select(legendData[0].get('name')); - } - }; + if (this.isSelected(name_1)) { + // Force to unselect others + this.select(name_1); + hasSelected = true; + break; + } + } // Try select the first if selectedMode is single - LegendModel.prototype._updateData = function (ecModel) { - var potentialData = []; - var availableNames = []; - ecModel.eachRawSeries(function (seriesModel) { - var seriesName = seriesModel.name; - availableNames.push(seriesName); - var isPotential; - if (seriesModel.legendVisualProvider) { - var provider = seriesModel.legendVisualProvider; - var names = provider.getAllNames(); + !hasSelected && this.select(legendData[0].get('name')); + } + }; - if (!ecModel.isSeriesFiltered(seriesModel)) { - availableNames = availableNames.concat(names); - } + LegendModel.prototype._updateData = function (ecModel) { + var potentialData = []; + var availableNames = []; + ecModel.eachRawSeries(function (seriesModel) { + var seriesName = seriesModel.name; + availableNames.push(seriesName); + var isPotential; - if (names.length) { - potentialData = potentialData.concat(names); - } else { - isPotential = true; - } - } else { - isPotential = true; - } + if (seriesModel.legendVisualProvider) { + var provider = seriesModel.legendVisualProvider; + var names = provider.getAllNames(); - if (isPotential && isNameSpecified(seriesModel)) { - potentialData.push(seriesModel.name); - } - }); - /** - * @type {Array.} - * @private - */ + if (!ecModel.isSeriesFiltered(seriesModel)) { + availableNames = availableNames.concat(names); + } - this._availableNames = availableNames; // If legend.data not specified in option, use availableNames as data, - // which is convinient for user preparing option. + if (names.length) { + potentialData = potentialData.concat(names); + } else { + isPotential = true; + } + } else { + isPotential = true; + } - var rawData = this.get('data') || potentialData; - var legendData = map(rawData, function (dataItem) { - // Can be string or number - if (isString(dataItem) || isNumber(dataItem)) { - dataItem = { - name: dataItem - }; - } + if (isPotential && isNameSpecified(seriesModel)) { + potentialData.push(seriesModel.name); + } + }); + /** + * @type {Array.} + * @private + */ - return new Model(dataItem, this, this.ecModel); - }, this); - /** - * @type {Array.} - * @private - */ + this._availableNames = availableNames; // If legend.data not specified in option, use availableNames as data, + // which is convinient for user preparing option. - this._data = legendData; + var rawData = this.get('data') || potentialData; + var legendData = map(rawData, function (dataItem) { + // Can be string or number + if (isString(dataItem) || isNumber(dataItem)) { + dataItem = { + name: dataItem }; + } - LegendModel.prototype.getData = function () { - return this._data; - }; + return new Model(dataItem, this, this.ecModel); + }, this); + /** + * @type {Array.} + * @private + */ - LegendModel.prototype.select = function (name) { - var selected = this.option.selected; - var selectedMode = this.get('selectedMode'); + this._data = legendData; + }; - if (selectedMode === 'single') { - var data = this._data; - each(data, function (dataItem) { - selected[dataItem.get('name')] = false; - }); - } + LegendModel.prototype.getData = function () { + return this._data; + }; - selected[name] = true; - }; + LegendModel.prototype.select = function (name) { + var selected = this.option.selected; + var selectedMode = this.get('selectedMode'); - LegendModel.prototype.unSelect = function (name) { - if (this.get('selectedMode') !== 'single') { - this.option.selected[name] = false; - } - }; + if (selectedMode === 'single') { + var data = this._data; + each(data, function (dataItem) { + selected[dataItem.get('name')] = false; + }); + } - LegendModel.prototype.toggleSelected = function (name) { - var selected = this.option.selected; // Default is true + selected[name] = true; + }; - if (!selected.hasOwnProperty(name)) { - selected[name] = true; - } + LegendModel.prototype.unSelect = function (name) { + if (this.get('selectedMode') !== 'single') { + this.option.selected[name] = false; + } + }; - this[selected[name] ? 'unSelect' : 'select'](name); - }; + LegendModel.prototype.toggleSelected = function (name) { + var selected = this.option.selected; // Default is true - LegendModel.prototype.allSelect = function () { - var data = this._data; - var selected = this.option.selected; - each(data, function (dataItem) { - selected[dataItem.get('name', true)] = true; - }); - }; + if (!selected.hasOwnProperty(name)) { + selected[name] = true; + } - LegendModel.prototype.inverseSelect = function () { - var data = this._data; - var selected = this.option.selected; - each(data, function (dataItem) { - var name = dataItem.get('name', true); // Initially, default value is true + this[selected[name] ? 'unSelect' : 'select'](name); + }; - if (!selected.hasOwnProperty(name)) { - selected[name] = true; - } + LegendModel.prototype.allSelect = function () { + var data = this._data; + var selected = this.option.selected; + each(data, function (dataItem) { + selected[dataItem.get('name', true)] = true; + }); + }; - selected[name] = !selected[name]; - }); - }; + LegendModel.prototype.inverseSelect = function () { + var data = this._data; + var selected = this.option.selected; + each(data, function (dataItem) { + var name = dataItem.get('name', true); // Initially, default value is true - LegendModel.prototype.isSelected = function (name) { - var selected = this.option.selected; - return !(selected.hasOwnProperty(name) && !selected[name]) && indexOf(this._availableNames, name) >= 0; - }; + if (!selected.hasOwnProperty(name)) { + selected[name] = true; + } - LegendModel.prototype.getOrient = function () { - return this.get('orient') === 'vertical' ? { - index: 1, - name: 'vertical' - } : { - index: 0, - name: 'horizontal' - }; - }; + selected[name] = !selected[name]; + }); + }; - LegendModel.type = 'legend.plain'; - LegendModel.dependencies = ['series']; - LegendModel.defaultOption = { - // zlevel: 0, - z: 4, - show: true, - orient: 'horizontal', - left: 'center', - // right: 'center', - top: 0, - // bottom: null, - align: 'auto', - backgroundColor: 'rgba(0,0,0,0)', - borderColor: '#ccc', - borderRadius: 0, - borderWidth: 0, - padding: 5, - itemGap: 10, - itemWidth: 25, - itemHeight: 14, - symbolRotate: 'inherit', - symbolKeepAspect: true, - inactiveColor: '#ccc', - inactiveBorderColor: '#ccc', - inactiveBorderWidth: 'auto', - itemStyle: { - color: 'inherit', - opacity: 'inherit', - borderColor: 'inherit', - borderWidth: 'auto', - borderCap: 'inherit', - borderJoin: 'inherit', - borderDashOffset: 'inherit', - borderMiterLimit: 'inherit' - }, - lineStyle: { - width: 'auto', - color: 'inherit', - inactiveColor: '#ccc', - inactiveWidth: 2, - opacity: 'inherit', - type: 'inherit', - cap: 'inherit', - join: 'inherit', - dashOffset: 'inherit', - miterLimit: 'inherit' - }, - textStyle: { - color: '#333' - }, - selectedMode: true, - selector: false, - selectorLabel: { - show: true, - borderRadius: 10, - padding: [3, 5, 3, 5], - fontSize: 12, - fontFamily: 'sans-serif', - color: '#666', - borderWidth: 1, - borderColor: '#666' - }, - emphasis: { - selectorLabel: { - show: true, - color: '#eee', - backgroundColor: '#666' - } - }, - selectorPosition: 'auto', - selectorItemGap: 7, - selectorButtonGap: 10, - tooltip: { - show: false - } - }; - return LegendModel; - }(ComponentModel); + LegendModel.prototype.isSelected = function (name) { + var selected = this.option.selected; + return !(selected.hasOwnProperty(name) && !selected[name]) && indexOf(this._availableNames, name) >= 0; + }; + + LegendModel.prototype.getOrient = function () { + return this.get('orient') === 'vertical' ? { + index: 1, + name: 'vertical' + } : { + index: 0, + name: 'horizontal' + }; + }; + + LegendModel.type = 'legend.plain'; + LegendModel.dependencies = ['series']; + LegendModel.defaultOption = { + // zlevel: 0, + z: 4, + show: true, + orient: 'horizontal', + left: 'center', + // right: 'center', + top: 0, + // bottom: null, + align: 'auto', + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + borderRadius: 0, + borderWidth: 0, + padding: 5, + itemGap: 10, + itemWidth: 25, + itemHeight: 14, + symbolRotate: 'inherit', + symbolKeepAspect: true, + inactiveColor: '#ccc', + inactiveBorderColor: '#ccc', + inactiveBorderWidth: 'auto', + itemStyle: { + color: 'inherit', + opacity: 'inherit', + borderColor: 'inherit', + borderWidth: 'auto', + borderCap: 'inherit', + borderJoin: 'inherit', + borderDashOffset: 'inherit', + borderMiterLimit: 'inherit' + }, + lineStyle: { + width: 'auto', + color: 'inherit', + inactiveColor: '#ccc', + inactiveWidth: 2, + opacity: 'inherit', + type: 'inherit', + cap: 'inherit', + join: 'inherit', + dashOffset: 'inherit', + miterLimit: 'inherit' + }, + textStyle: { + color: '#333' + }, + selectedMode: true, + selector: false, + selectorLabel: { + show: true, + borderRadius: 10, + padding: [3, 5, 3, 5], + fontSize: 12, + fontFamily: 'sans-serif', + color: '#666', + borderWidth: 1, + borderColor: '#666' + }, + emphasis: { + selectorLabel: { + show: true, + color: '#eee', + backgroundColor: '#666' + } + }, + selectorPosition: 'auto', + selectorItemGap: 7, + selectorButtonGap: 10, + tooltip: { + show: false + } + }; + return LegendModel; + }(ComponentModel); var curry$1 = curry; var each$c = each; var Group$2 = Group; var LegendView = - /** @class */ - function (_super) { - __extends(LegendView, _super); - - function LegendView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = LegendView.type; - _this.newlineDisabled = false; - return _this; - } - - LegendView.prototype.init = function () { - this.group.add(this._contentGroup = new Group$2()); - this.group.add(this._selectorGroup = new Group$2()); - this._isFirstRender = true; - }; - /** - * @protected - */ + /** @class */ + function (_super) { + __extends(LegendView, _super); + + function LegendView() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = LegendView.type; + _this.newlineDisabled = false; + return _this; + } + + LegendView.prototype.init = function () { + this.group.add(this._contentGroup = new Group$2()); + this.group.add(this._selectorGroup = new Group$2()); + this._isFirstRender = true; + }; + /** + * @protected + */ - LegendView.prototype.getContentGroup = function () { - return this._contentGroup; - }; - /** - * @protected - */ + LegendView.prototype.getContentGroup = function () { + return this._contentGroup; + }; + /** + * @protected + */ - LegendView.prototype.getSelectorGroup = function () { - return this._selectorGroup; - }; - /** - * @override - */ + LegendView.prototype.getSelectorGroup = function () { + return this._selectorGroup; + }; + /** + * @override + */ - LegendView.prototype.render = function (legendModel, ecModel, api) { - var isFirstRender = this._isFirstRender; - this._isFirstRender = false; - this.resetInner(); + LegendView.prototype.render = function (legendModel, ecModel, api) { + var isFirstRender = this._isFirstRender; + this._isFirstRender = false; + this.resetInner(); - if (!legendModel.get('show', true)) { - return; - } + if (!legendModel.get('show', true)) { + return; + } - var itemAlign = legendModel.get('align'); - var orient = legendModel.get('orient'); + var itemAlign = legendModel.get('align'); + var orient = legendModel.get('orient'); - if (!itemAlign || itemAlign === 'auto') { - itemAlign = legendModel.get('left') === 'right' && orient === 'vertical' ? 'right' : 'left'; - } // selector has been normalized to an array in model + if (!itemAlign || itemAlign === 'auto') { + itemAlign = legendModel.get('left') === 'right' && orient === 'vertical' ? 'right' : 'left'; + } // selector has been normalized to an array in model - var selector = legendModel.get('selector', true); - var selectorPosition = legendModel.get('selectorPosition', true); + var selector = legendModel.get('selector', true); + var selectorPosition = legendModel.get('selectorPosition', true); - if (selector && (!selectorPosition || selectorPosition === 'auto')) { - selectorPosition = orient === 'horizontal' ? 'end' : 'start'; - } + if (selector && (!selectorPosition || selectorPosition === 'auto')) { + selectorPosition = orient === 'horizontal' ? 'end' : 'start'; + } - this.renderInner(itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition); // Perform layout. + this.renderInner(itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition); // Perform layout. - var positionInfo = legendModel.getBoxLayoutParams(); - var viewportSize = { - width: api.getWidth(), - height: api.getHeight() - }; - var padding = legendModel.get('padding'); - var maxSize = getLayoutRect(positionInfo, viewportSize, padding); - var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition); // Place mainGroup, based on the calculated `mainRect`. - - var layoutRect = getLayoutRect(defaults({ - width: mainRect.width, - height: mainRect.height - }, positionInfo), viewportSize, padding); - this.group.x = layoutRect.x - mainRect.x; - this.group.y = layoutRect.y - mainRect.y; - this.group.markRedraw(); // Render background after group is layout. - - this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel)); - }; + var positionInfo = legendModel.getBoxLayoutParams(); + var viewportSize = { + width: api.getWidth(), + height: api.getHeight() + }; + var padding = legendModel.get('padding'); + var maxSize = getLayoutRect(positionInfo, viewportSize, padding); + var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition); // Place mainGroup, based on the calculated `mainRect`. - LegendView.prototype.resetInner = function () { - this.getContentGroup().removeAll(); - this._backgroundEl && this.group.remove(this._backgroundEl); - this.getSelectorGroup().removeAll(); - }; + var layoutRect = getLayoutRect(defaults({ + width: mainRect.width, + height: mainRect.height + }, positionInfo), viewportSize, padding); + this.group.x = layoutRect.x - mainRect.x; + this.group.y = layoutRect.y - mainRect.y; + this.group.markRedraw(); // Render background after group is layout. + + this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel)); + }; + + LegendView.prototype.resetInner = function () { + this.getContentGroup().removeAll(); + this._backgroundEl && this.group.remove(this._backgroundEl); + this.getSelectorGroup().removeAll(); + }; + + LegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) { + var contentGroup = this.getContentGroup(); + var legendDrawnMap = createHashMap(); + var selectMode = legendModel.get('selectedMode'); + var excludeSeriesId = []; + ecModel.eachRawSeries(function (seriesModel) { + !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id); + }); + each$c(legendModel.getData(), function (legendItemModel, dataIndex) { + var name = legendItemModel.get('name'); // Use empty string or \n as a newline string - LegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) { - var contentGroup = this.getContentGroup(); - var legendDrawnMap = createHashMap(); - var selectMode = legendModel.get('selectedMode'); - var excludeSeriesId = []; - ecModel.eachRawSeries(function (seriesModel) { - !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id); - }); - each$c(legendModel.getData(), function (legendItemModel, dataIndex) { - var name = legendItemModel.get('name'); // Use empty string or \n as a newline string + if (!this.newlineDisabled && (name === '' || name === '\n')) { + var g = new Group$2(); // @ts-ignore - if (!this.newlineDisabled && (name === '' || name === '\n')) { - var g = new Group$2(); // @ts-ignore + g.newline = true; + contentGroup.add(g); + return; + } // Representitive series. - g.newline = true; - contentGroup.add(g); - return; - } // Representitive series. + var seriesModel = ecModel.getSeriesByName(name)[0]; - var seriesModel = ecModel.getSeriesByName(name)[0]; + if (legendDrawnMap.get(name)) { + // Have been drawed + return; + } // Legend to control series. - if (legendDrawnMap.get(name)) { - // Have been drawed - return; - } // Legend to control series. + if (seriesModel) { + var data = seriesModel.getData(); + var lineVisualStyle = data.getVisual('legendLineStyle') || {}; + var legendIcon = data.getVisual('legendIcon'); + /** + * `data.getVisual('style')` may be the color from the register + * in series. For example, for line series, + */ - if (seriesModel) { - var data = seriesModel.getData(); - var lineVisualStyle = data.getVisual('legendLineStyle') || {}; - var legendIcon = data.getVisual('legendIcon'); - /** - * `data.getVisual('style')` may be the color from the register - * in series. For example, for line series, - */ + var style = data.getVisual('style'); - var style = data.getVisual('style'); + var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, style, legendIcon, selectMode); - var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, style, legendIcon, selectMode); + itemGroup.on('click', curry$1(dispatchSelectAction, name, null, api, excludeSeriesId)).on('mouseover', curry$1(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)).on('mouseout', curry$1(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId)); + legendDrawnMap.set(name, true); + } else { + // Legend to control data. In pie and funnel. + ecModel.eachRawSeries(function (seriesModel) { + // In case multiple series has same data name + if (legendDrawnMap.get(name)) { + return; + } - itemGroup.on('click', curry$1(dispatchSelectAction, name, null, api, excludeSeriesId)).on('mouseover', curry$1(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)).on('mouseout', curry$1(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId)); - legendDrawnMap.set(name, true); - } else { - // Legend to control data. In pie and funnel. - ecModel.eachRawSeries(function (seriesModel) { - // In case multiple series has same data name - if (legendDrawnMap.get(name)) { - return; - } + if (seriesModel.legendVisualProvider) { + var provider = seriesModel.legendVisualProvider; - if (seriesModel.legendVisualProvider) { - var provider = seriesModel.legendVisualProvider; + if (!provider.containName(name)) { + return; + } - if (!provider.containName(name)) { - return; - } + var idx = provider.indexOfName(name); + var style = provider.getItemVisual(idx, 'style'); + var legendIcon = provider.getItemVisual(idx, 'legendIcon'); + var colorArr = parse(style.fill); // Color may be set to transparent in visualMap when data is out of range. + // Do not show nothing. - var idx = provider.indexOfName(name); - var style = provider.getItemVisual(idx, 'style'); - var legendIcon = provider.getItemVisual(idx, 'legendIcon'); - var colorArr = parse(style.fill); // Color may be set to transparent in visualMap when data is out of range. - // Do not show nothing. + if (colorArr && colorArr[3] === 0) { + colorArr[3] = 0.2; // TODO color is set to 0, 0, 0, 0. Should show correct RGBA - if (colorArr && colorArr[3] === 0) { - colorArr[3] = 0.2; // TODO color is set to 0, 0, 0, 0. Should show correct RGBA + style = extend(extend({}, style), { + fill: stringify(colorArr, 'rgba') + }); + } - style = extend(extend({}, style), { - fill: stringify(colorArr, 'rgba') - }); - } + var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, {}, style, legendIcon, selectMode); // FIXME: consider different series has items with the same name. - var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, {}, style, legendIcon, selectMode); // FIXME: consider different series has items with the same name. + itemGroup.on('click', curry$1(dispatchSelectAction, null, name, api, excludeSeriesId)) // Should not specify the series name, consider legend controls + // more than one pie series. + .on('mouseover', curry$1(dispatchHighlightAction, null, name, api, excludeSeriesId)).on('mouseout', curry$1(dispatchDownplayAction, null, name, api, excludeSeriesId)); + legendDrawnMap.set(name, true); + } + }, this); + } - itemGroup.on('click', curry$1(dispatchSelectAction, null, name, api, excludeSeriesId)) // Should not specify the series name, consider legend controls - // more than one pie series. - .on('mouseover', curry$1(dispatchHighlightAction, null, name, api, excludeSeriesId)).on('mouseout', curry$1(dispatchDownplayAction, null, name, api, excludeSeriesId)); - legendDrawnMap.set(name, true); - } - }, this); - } + if ("development" !== 'production') { + if (!legendDrawnMap.get(name)) { + console.warn(name + ' series not exists. Legend data should be same with series name or data name.'); + } + } + }, this); - if ("development" !== 'production') { - if (!legendDrawnMap.get(name)) { - console.warn(name + ' series not exists. Legend data should be same with series name or data name.'); - } - } - }, this); + if (selector) { + this._createSelector(selector, legendModel, api, orient, selectorPosition); + } + }; - if (selector) { - this._createSelector(selector, legendModel, api, orient, selectorPosition); - } - }; + LegendView.prototype._createSelector = function (selector, legendModel, api, orient, selectorPosition) { + var selectorGroup = this.getSelectorGroup(); + each$c(selector, function createSelectorButton(selectorItem) { + var type = selectorItem.type; + var labelText = new ZRText({ + style: { + x: 0, + y: 0, + align: 'center', + verticalAlign: 'middle' + }, + onclick: function () { + api.dispatchAction({ + type: type === 'all' ? 'legendAllSelect' : 'legendInverseSelect' + }); + } + }); + selectorGroup.add(labelText); + var labelModel = legendModel.getModel('selectorLabel'); + var emphasisLabelModel = legendModel.getModel(['emphasis', 'selectorLabel']); + setLabelStyle(labelText, { + normal: labelModel, + emphasis: emphasisLabelModel + }, { + defaultText: selectorItem.title + }); + enableHoverEmphasis(labelText); + }); + }; + + LegendView.prototype._createItem = function (seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, itemVisualStyle, legendIcon, selectMode) { + var drawType = seriesModel.visualDrawType; + var itemWidth = legendModel.get('itemWidth'); + var itemHeight = legendModel.get('itemHeight'); + var isSelected = legendModel.isSelected(name); + var iconRotate = legendItemModel.get('symbolRotate'); + var symbolKeepAspect = legendItemModel.get('symbolKeepAspect'); + var legendIconType = legendItemModel.get('icon'); + legendIcon = legendIconType || legendIcon || 'roundRect'; + var style = getLegendStyle(legendIcon, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected); + var itemGroup = new Group$2(); + var textStyleModel = legendItemModel.getModel('textStyle'); + + if (isFunction(seriesModel.getLegendIcon) && (!legendIconType || legendIconType === 'inherit')) { + // Series has specific way to define legend icon + itemGroup.add(seriesModel.getLegendIcon({ + itemWidth: itemWidth, + itemHeight: itemHeight, + icon: legendIcon, + iconRotate: iconRotate, + itemStyle: style.itemStyle, + lineStyle: style.lineStyle, + symbolKeepAspect: symbolKeepAspect + })); + } else { + // Use default legend icon policy for most series + var rotate = legendIconType === 'inherit' && seriesModel.getData().getVisual('symbol') ? iconRotate === 'inherit' ? seriesModel.getData().getVisual('symbolRotate') : iconRotate : 0; // No rotation for no icon + + itemGroup.add(getDefaultLegendIcon({ + itemWidth: itemWidth, + itemHeight: itemHeight, + icon: legendIcon, + iconRotate: rotate, + itemStyle: style.itemStyle, + lineStyle: style.lineStyle, + symbolKeepAspect: symbolKeepAspect + })); + } + + var textX = itemAlign === 'left' ? itemWidth + 5 : -5; + var textAlign = itemAlign; + var formatter = legendModel.get('formatter'); + var content = name; + + if (isString(formatter) && formatter) { + content = formatter.replace('{name}', name != null ? name : ''); + } else if (isFunction(formatter)) { + content = formatter(name); + } + + var inactiveColor = legendItemModel.get('inactiveColor'); + itemGroup.add(new ZRText({ + style: createTextStyle(textStyleModel, { + text: content, + x: textX, + y: itemHeight / 2, + fill: isSelected ? textStyleModel.getTextColor() : inactiveColor, + align: textAlign, + verticalAlign: 'middle' + }) + })); // Add a invisible rect to increase the area of mouse hover + + var hitRect = new Rect({ + shape: itemGroup.getBoundingRect(), + invisible: true + }); + var tooltipModel = legendItemModel.getModel('tooltip'); - LegendView.prototype._createSelector = function (selector, legendModel, api, orient, selectorPosition) { - var selectorGroup = this.getSelectorGroup(); - each$c(selector, function createSelectorButton(selectorItem) { - var type = selectorItem.type; - var labelText = new ZRText({ - style: { - x: 0, - y: 0, - align: 'center', - verticalAlign: 'middle' - }, - onclick: function () { - api.dispatchAction({ - type: type === 'all' ? 'legendAllSelect' : 'legendInverseSelect' - }); - } - }); - selectorGroup.add(labelText); - var labelModel = legendModel.getModel('selectorLabel'); - var emphasisLabelModel = legendModel.getModel(['emphasis', 'selectorLabel']); - setLabelStyle(labelText, { - normal: labelModel, - emphasis: emphasisLabelModel - }, { - defaultText: selectorItem.title - }); - enableHoverEmphasis(labelText); - }); - }; + if (tooltipModel.get('show')) { + setTooltipConfig({ + el: hitRect, + componentModel: legendModel, + itemName: name, + itemTooltipOption: tooltipModel.option + }); + } - LegendView.prototype._createItem = function (seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, itemVisualStyle, legendIcon, selectMode) { - var drawType = seriesModel.visualDrawType; - var itemWidth = legendModel.get('itemWidth'); - var itemHeight = legendModel.get('itemHeight'); - var isSelected = legendModel.isSelected(name); - var iconRotate = legendItemModel.get('symbolRotate'); - var symbolKeepAspect = legendItemModel.get('symbolKeepAspect'); - var legendIconType = legendItemModel.get('icon'); - legendIcon = legendIconType || legendIcon || 'roundRect'; - var style = getLegendStyle(legendIcon, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected); - var itemGroup = new Group$2(); - var textStyleModel = legendItemModel.getModel('textStyle'); - - if (isFunction(seriesModel.getLegendIcon) && (!legendIconType || legendIconType === 'inherit')) { - // Series has specific way to define legend icon - itemGroup.add(seriesModel.getLegendIcon({ - itemWidth: itemWidth, - itemHeight: itemHeight, - icon: legendIcon, - iconRotate: iconRotate, - itemStyle: style.itemStyle, - lineStyle: style.lineStyle, - symbolKeepAspect: symbolKeepAspect - })); - } else { - // Use default legend icon policy for most series - var rotate = legendIconType === 'inherit' && seriesModel.getData().getVisual('symbol') ? iconRotate === 'inherit' ? seriesModel.getData().getVisual('symbolRotate') : iconRotate : 0; // No rotation for no icon - - itemGroup.add(getDefaultLegendIcon({ - itemWidth: itemWidth, - itemHeight: itemHeight, - icon: legendIcon, - iconRotate: rotate, - itemStyle: style.itemStyle, - lineStyle: style.lineStyle, - symbolKeepAspect: symbolKeepAspect - })); - } - - var textX = itemAlign === 'left' ? itemWidth + 5 : -5; - var textAlign = itemAlign; - var formatter = legendModel.get('formatter'); - var content = name; - - if (isString(formatter) && formatter) { - content = formatter.replace('{name}', name != null ? name : ''); - } else if (isFunction(formatter)) { - content = formatter(name); - } - - var inactiveColor = legendItemModel.get('inactiveColor'); - itemGroup.add(new ZRText({ - style: createTextStyle(textStyleModel, { - text: content, - x: textX, - y: itemHeight / 2, - fill: isSelected ? textStyleModel.getTextColor() : inactiveColor, - align: textAlign, - verticalAlign: 'middle' - }) - })); // Add a invisible rect to increase the area of mouse hover + itemGroup.add(hitRect); + itemGroup.eachChild(function (child) { + child.silent = true; + }); + hitRect.silent = !selectMode; + this.getContentGroup().add(itemGroup); + enableHoverEmphasis(itemGroup); // @ts-ignore + + itemGroup.__legendDataIndex = dataIndex; + return itemGroup; + }; + + LegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) { + var contentGroup = this.getContentGroup(); + var selectorGroup = this.getSelectorGroup(); // Place items in contentGroup. + + box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), maxSize.width, maxSize.height); + var contentRect = contentGroup.getBoundingRect(); + var contentPos = [-contentRect.x, -contentRect.y]; + selectorGroup.markRedraw(); + contentGroup.markRedraw(); + + if (selector) { + // Place buttons in selectorGroup + box( // Buttons in selectorGroup always layout horizontally + 'horizontal', selectorGroup, legendModel.get('selectorItemGap', true)); + var selectorRect = selectorGroup.getBoundingRect(); + var selectorPos = [-selectorRect.x, -selectorRect.y]; + var selectorButtonGap = legendModel.get('selectorButtonGap', true); + var orientIdx = legendModel.getOrient().index; + var wh = orientIdx === 0 ? 'width' : 'height'; + var hw = orientIdx === 0 ? 'height' : 'width'; + var yx = orientIdx === 0 ? 'y' : 'x'; + + if (selectorPosition === 'end') { + selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap; + } else { + contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap; + } //Always align selector to content as 'middle' + + + selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2; + selectorGroup.x = selectorPos[0]; + selectorGroup.y = selectorPos[1]; + contentGroup.x = contentPos[0]; + contentGroup.y = contentPos[1]; + var mainRect = { + x: 0, + y: 0 + }; + mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh]; + mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]); + mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]); + return mainRect; + } else { + contentGroup.x = contentPos[0]; + contentGroup.y = contentPos[1]; + return this.group.getBoundingRect(); + } + }; + /** + * @protected + */ - var hitRect = new Rect({ - shape: itemGroup.getBoundingRect(), - invisible: true - }); - var tooltipModel = legendItemModel.getModel('tooltip'); - - if (tooltipModel.get('show')) { - setTooltipConfig({ - el: hitRect, - componentModel: legendModel, - itemName: name, - itemTooltipOption: tooltipModel.option - }); - } - itemGroup.add(hitRect); - itemGroup.eachChild(function (child) { - child.silent = true; - }); - hitRect.silent = !selectMode; - this.getContentGroup().add(itemGroup); - enableHoverEmphasis(itemGroup); // @ts-ignore + LegendView.prototype.remove = function () { + this.getContentGroup().removeAll(); + this._isFirstRender = true; + }; - itemGroup.__legendDataIndex = dataIndex; - return itemGroup; - }; + LegendView.type = 'legend.plain'; + return LegendView; + }(ComponentView); - LegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) { - var contentGroup = this.getContentGroup(); - var selectorGroup = this.getSelectorGroup(); // Place items in contentGroup. - - box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), maxSize.width, maxSize.height); - var contentRect = contentGroup.getBoundingRect(); - var contentPos = [-contentRect.x, -contentRect.y]; - selectorGroup.markRedraw(); - contentGroup.markRedraw(); - - if (selector) { - // Place buttons in selectorGroup - box( // Buttons in selectorGroup always layout horizontally - 'horizontal', selectorGroup, legendModel.get('selectorItemGap', true)); - var selectorRect = selectorGroup.getBoundingRect(); - var selectorPos = [-selectorRect.x, -selectorRect.y]; - var selectorButtonGap = legendModel.get('selectorButtonGap', true); - var orientIdx = legendModel.getOrient().index; - var wh = orientIdx === 0 ? 'width' : 'height'; - var hw = orientIdx === 0 ? 'height' : 'width'; - var yx = orientIdx === 0 ? 'y' : 'x'; - - if (selectorPosition === 'end') { - selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap; - } else { - contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap; - } //Always align selector to content as 'middle' - - - selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2; - selectorGroup.x = selectorPos[0]; - selectorGroup.y = selectorPos[1]; - contentGroup.x = contentPos[0]; - contentGroup.y = contentPos[1]; - var mainRect = { - x: 0, - y: 0 - }; - mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh]; - mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]); - mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]); - return mainRect; - } else { - contentGroup.x = contentPos[0]; - contentGroup.y = contentPos[1]; - return this.group.getBoundingRect(); - } - }; - /** - * @protected - */ + function getLegendStyle(iconType, legendModel, lineVisualStyle, itemVisualStyle, drawType, isSelected) { + /** + * Use series style if is inherit; + * elsewise, use legend style + */ + function handleCommonProps(style, visualStyle) { + // If lineStyle.width is 'auto', it is set to be 2 if series has border + if (style.lineWidth === 'auto') { + style.lineWidth = visualStyle.lineWidth > 0 ? 2 : 0; + } + each$c(style, function (propVal, propName) { + style[propName] === 'inherit' && (style[propName] = visualStyle[propName]); + }); + } // itemStyle - LegendView.prototype.remove = function () { - this.getContentGroup().removeAll(); - this._isFirstRender = true; - }; - LegendView.type = 'legend.plain'; - return LegendView; - }(ComponentView); + var legendItemModel = legendModel.getModel('itemStyle'); + var itemStyle = legendItemModel.getItemStyle(); + var iconBrushType = iconType.lastIndexOf('empty', 0) === 0 ? 'fill' : 'stroke'; + itemStyle.decal = itemVisualStyle.decal; - function getLegendStyle(iconType, legendModel, lineVisualStyle, itemVisualStyle, drawType, isSelected) { + if (itemStyle.fill === 'inherit') { /** - * Use series style if is inherit; - * elsewise, use legend style + * Series with visualDrawType as 'stroke' should have + * series stroke as legend fill */ - function handleCommonProps(style, visualStyle) { - // If lineStyle.width is 'auto', it is set to be 2 if series has border - if (style.lineWidth === 'auto') { - style.lineWidth = visualStyle.lineWidth > 0 ? 2 : 0; - } - - each$c(style, function (propVal, propName) { - style[propName] === 'inherit' && (style[propName] = visualStyle[propName]); - }); - } // itemStyle - - - var legendItemModel = legendModel.getModel('itemStyle'); - var itemStyle = legendItemModel.getItemStyle(); - var iconBrushType = iconType.lastIndexOf('empty', 0) === 0 ? 'fill' : 'stroke'; - itemStyle.decal = itemVisualStyle.decal; - - if (itemStyle.fill === 'inherit') { - /** - * Series with visualDrawType as 'stroke' should have - * series stroke as legend fill - */ - itemStyle.fill = itemVisualStyle[drawType]; - } + itemStyle.fill = itemVisualStyle[drawType]; + } - if (itemStyle.stroke === 'inherit') { - /** - * icon type with "emptyXXX" should use fill color - * in visual style - */ - itemStyle.stroke = itemVisualStyle[iconBrushType]; - } + if (itemStyle.stroke === 'inherit') { + /** + * icon type with "emptyXXX" should use fill color + * in visual style + */ + itemStyle.stroke = itemVisualStyle[iconBrushType]; + } - if (itemStyle.opacity === 'inherit') { - /** - * Use lineStyle.opacity if drawType is stroke - */ - itemStyle.opacity = (drawType === 'fill' ? itemVisualStyle : lineVisualStyle).opacity; - } + if (itemStyle.opacity === 'inherit') { + /** + * Use lineStyle.opacity if drawType is stroke + */ + itemStyle.opacity = (drawType === 'fill' ? itemVisualStyle : lineVisualStyle).opacity; + } - handleCommonProps(itemStyle, itemVisualStyle); // lineStyle + handleCommonProps(itemStyle, itemVisualStyle); // lineStyle - var legendLineModel = legendModel.getModel('lineStyle'); - var lineStyle = legendLineModel.getLineStyle(); - handleCommonProps(lineStyle, lineVisualStyle); // Fix auto color to real color + var legendLineModel = legendModel.getModel('lineStyle'); + var lineStyle = legendLineModel.getLineStyle(); + handleCommonProps(lineStyle, lineVisualStyle); // Fix auto color to real color - itemStyle.fill === 'auto' && (itemStyle.fill = itemVisualStyle.fill); - itemStyle.stroke === 'auto' && (itemStyle.stroke = itemVisualStyle.fill); - lineStyle.stroke === 'auto' && (lineStyle.stroke = itemVisualStyle.fill); + itemStyle.fill === 'auto' && (itemStyle.fill = itemVisualStyle.fill); + itemStyle.stroke === 'auto' && (itemStyle.stroke = itemVisualStyle.fill); + lineStyle.stroke === 'auto' && (lineStyle.stroke = itemVisualStyle.fill); - if (!isSelected) { - var borderWidth = legendModel.get('inactiveBorderWidth'); - /** - * Since stroke is set to be inactiveBorderColor, it may occur that - * there is no border in series but border in legend, so we need to - * use border only when series has border if is set to be auto - */ + if (!isSelected) { + var borderWidth = legendModel.get('inactiveBorderWidth'); + /** + * Since stroke is set to be inactiveBorderColor, it may occur that + * there is no border in series but border in legend, so we need to + * use border only when series has border if is set to be auto + */ - var visualHasBorder = itemStyle[iconBrushType]; - itemStyle.lineWidth = borderWidth === 'auto' ? itemVisualStyle.lineWidth > 0 && visualHasBorder ? 2 : 0 : itemStyle.lineWidth; - itemStyle.fill = legendModel.get('inactiveColor'); - itemStyle.stroke = legendModel.get('inactiveBorderColor'); - lineStyle.stroke = legendLineModel.get('inactiveColor'); - lineStyle.lineWidth = legendLineModel.get('inactiveWidth'); - } + var visualHasBorder = itemStyle[iconBrushType]; + itemStyle.lineWidth = borderWidth === 'auto' ? itemVisualStyle.lineWidth > 0 && visualHasBorder ? 2 : 0 : itemStyle.lineWidth; + itemStyle.fill = legendModel.get('inactiveColor'); + itemStyle.stroke = legendModel.get('inactiveBorderColor'); + lineStyle.stroke = legendLineModel.get('inactiveColor'); + lineStyle.lineWidth = legendLineModel.get('inactiveWidth'); + } - return { - itemStyle: itemStyle, - lineStyle: lineStyle - }; + return { + itemStyle: itemStyle, + lineStyle: lineStyle + }; } function getDefaultLegendIcon(opt) { - var symboType = opt.icon || 'roundRect'; - var icon = createSymbol(symboType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill, opt.symbolKeepAspect); - icon.setStyle(opt.itemStyle); - icon.rotation = (opt.iconRotate || 0) * Math.PI / 180; - icon.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]); + var symboType = opt.icon || 'roundRect'; + var icon = createSymbol(symboType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill, opt.symbolKeepAspect); + icon.setStyle(opt.itemStyle); + icon.rotation = (opt.iconRotate || 0) * Math.PI / 180; + icon.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]); - if (symboType.indexOf('empty') > -1) { - icon.style.stroke = icon.style.fill; - icon.style.fill = '#fff'; - icon.style.lineWidth = 2; - } + if (symboType.indexOf('empty') > -1) { + icon.style.stroke = icon.style.fill; + icon.style.fill = '#fff'; + icon.style.lineWidth = 2; + } - return icon; + return icon; } function dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) { - // downplay before unselect - dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId); - api.dispatchAction({ - type: 'legendToggleSelect', - name: seriesName != null ? seriesName : dataName - }); // highlight after select - // TODO higlight immediately may cause animation loss. + // downplay before unselect + dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId); + api.dispatchAction({ + type: 'legendToggleSelect', + name: seriesName != null ? seriesName : dataName + }); // highlight after select + // TODO higlight immediately may cause animation loss. - dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId); + dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId); } function isUseHoverLayer(api) { - var list = api.getZr().storage.getDisplayList(); - var emphasisState; - var i = 0; - var len = list.length; + var list = api.getZr().storage.getDisplayList(); + var emphasisState; + var i = 0; + var len = list.length; - while (i < len && !(emphasisState = list[i].states.emphasis)) { - i++; - } + while (i < len && !(emphasisState = list[i].states.emphasis)) { + i++; + } - return emphasisState && emphasisState.hoverLayer; + return emphasisState && emphasisState.hoverLayer; } function dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) { - // If element hover will move to a hoverLayer. - if (!isUseHoverLayer(api)) { - api.dispatchAction({ - type: 'highlight', - seriesName: seriesName, - name: dataName, - excludeSeriesId: excludeSeriesId - }); - } + // If element hover will move to a hoverLayer. + if (!isUseHoverLayer(api)) { + api.dispatchAction({ + type: 'highlight', + seriesName: seriesName, + name: dataName, + excludeSeriesId: excludeSeriesId + }); + } } function dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) { - // If element hover will move to a hoverLayer. - if (!isUseHoverLayer(api)) { - api.dispatchAction({ - type: 'downplay', - seriesName: seriesName, - name: dataName, - excludeSeriesId: excludeSeriesId - }); - } + // If element hover will move to a hoverLayer. + if (!isUseHoverLayer(api)) { + api.dispatchAction({ + type: 'downplay', + seriesName: seriesName, + name: dataName, + excludeSeriesId: excludeSeriesId + }); + } } /* @@ -87786,178 +87786,178 @@ * under the License. */ function legendFilter(ecModel) { - var legendModels = ecModel.findComponents({ - mainType: 'legend' - }); + var legendModels = ecModel.findComponents({ + mainType: 'legend' + }); - if (legendModels && legendModels.length) { - ecModel.filterSeries(function (series) { - // If in any legend component the status is not selected. - // Because in legend series is assumed selected when it is not in the legend data. - for (var i = 0; i < legendModels.length; i++) { - if (!legendModels[i].isSelected(series.name)) { - return false; - } - } + if (legendModels && legendModels.length) { + ecModel.filterSeries(function (series) { + // If in any legend component the status is not selected. + // Because in legend series is assumed selected when it is not in the legend data. + for (var i = 0; i < legendModels.length; i++) { + if (!legendModels[i].isSelected(series.name)) { + return false; + } + } - return true; - }); - } + return true; + }); + } } function legendSelectActionHandler(methodName, payload, ecModel) { - var selectedMap = {}; - var isToggleSelect = methodName === 'toggleSelected'; - var isSelected; // Update all legend components - - ecModel.eachComponent('legend', function (legendModel) { - if (isToggleSelect && isSelected != null) { - // Force other legend has same selected status - // Or the first is toggled to true and other are toggled to false - // In the case one legend has some item unSelected in option. And if other legend - // doesn't has the item, they will assume it is selected. - legendModel[isSelected ? 'select' : 'unSelect'](payload.name); - } else if (methodName === 'allSelect' || methodName === 'inverseSelect') { - legendModel[methodName](); - } else { - legendModel[methodName](payload.name); - isSelected = legendModel.isSelected(payload.name); - } + var selectedMap = {}; + var isToggleSelect = methodName === 'toggleSelected'; + var isSelected; // Update all legend components + + ecModel.eachComponent('legend', function (legendModel) { + if (isToggleSelect && isSelected != null) { + // Force other legend has same selected status + // Or the first is toggled to true and other are toggled to false + // In the case one legend has some item unSelected in option. And if other legend + // doesn't has the item, they will assume it is selected. + legendModel[isSelected ? 'select' : 'unSelect'](payload.name); + } else if (methodName === 'allSelect' || methodName === 'inverseSelect') { + legendModel[methodName](); + } else { + legendModel[methodName](payload.name); + isSelected = legendModel.isSelected(payload.name); + } - var legendData = legendModel.getData(); - each(legendData, function (model) { - var name = model.get('name'); // Wrap element + var legendData = legendModel.getData(); + each(legendData, function (model) { + var name = model.get('name'); // Wrap element - if (name === '\n' || name === '') { - return; - } + if (name === '\n' || name === '') { + return; + } - var isItemSelected = legendModel.isSelected(name); + var isItemSelected = legendModel.isSelected(name); - if (selectedMap.hasOwnProperty(name)) { - // Unselected if any legend is unselected - selectedMap[name] = selectedMap[name] && isItemSelected; - } else { - selectedMap[name] = isItemSelected; - } - }); - }); // Return the event explicitly + if (selectedMap.hasOwnProperty(name)) { + // Unselected if any legend is unselected + selectedMap[name] = selectedMap[name] && isItemSelected; + } else { + selectedMap[name] = isItemSelected; + } + }); + }); // Return the event explicitly - return methodName === 'allSelect' || methodName === 'inverseSelect' ? { - selected: selectedMap - } : { - name: payload.name, - selected: selectedMap - }; + return methodName === 'allSelect' || methodName === 'inverseSelect' ? { + selected: selectedMap + } : { + name: payload.name, + selected: selectedMap + }; } function installLegendAction(registers) { - /** - * @event legendToggleSelect - * @type {Object} - * @property {string} type 'legendToggleSelect' - * @property {string} [from] - * @property {string} name Series name or data item name - */ - registers.registerAction('legendToggleSelect', 'legendselectchanged', curry(legendSelectActionHandler, 'toggleSelected')); - registers.registerAction('legendAllSelect', 'legendselectall', curry(legendSelectActionHandler, 'allSelect')); - registers.registerAction('legendInverseSelect', 'legendinverseselect', curry(legendSelectActionHandler, 'inverseSelect')); - /** - * @event legendSelect - * @type {Object} - * @property {string} type 'legendSelect' - * @property {string} name Series name or data item name - */ + /** + * @event legendToggleSelect + * @type {Object} + * @property {string} type 'legendToggleSelect' + * @property {string} [from] + * @property {string} name Series name or data item name + */ + registers.registerAction('legendToggleSelect', 'legendselectchanged', curry(legendSelectActionHandler, 'toggleSelected')); + registers.registerAction('legendAllSelect', 'legendselectall', curry(legendSelectActionHandler, 'allSelect')); + registers.registerAction('legendInverseSelect', 'legendinverseselect', curry(legendSelectActionHandler, 'inverseSelect')); + /** + * @event legendSelect + * @type {Object} + * @property {string} type 'legendSelect' + * @property {string} name Series name or data item name + */ - registers.registerAction('legendSelect', 'legendselected', curry(legendSelectActionHandler, 'select')); - /** - * @event legendUnSelect - * @type {Object} - * @property {string} type 'legendUnSelect' - * @property {string} name Series name or data item name - */ + registers.registerAction('legendSelect', 'legendselected', curry(legendSelectActionHandler, 'select')); + /** + * @event legendUnSelect + * @type {Object} + * @property {string} type 'legendUnSelect' + * @property {string} name Series name or data item name + */ - registers.registerAction('legendUnSelect', 'legendunselected', curry(legendSelectActionHandler, 'unSelect')); + registers.registerAction('legendUnSelect', 'legendunselected', curry(legendSelectActionHandler, 'unSelect')); } function install$H(registers) { - registers.registerComponentModel(LegendModel); - registers.registerComponentView(LegendView); - registers.registerProcessor(registers.PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter); - registers.registerSubTypeDefaulter('legend', function () { - return 'plain'; - }); - installLegendAction(registers); + registers.registerComponentModel(LegendModel); + registers.registerComponentView(LegendView); + registers.registerProcessor(registers.PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter); + registers.registerSubTypeDefaulter('legend', function () { + return 'plain'; + }); + installLegendAction(registers); } var ScrollableLegendModel = - /** @class */ - function (_super) { - __extends(ScrollableLegendModel, _super); - - function ScrollableLegendModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = ScrollableLegendModel.type; - return _this; - } - /** - * @param {number} scrollDataIndex - */ + /** @class */ + function (_super) { + __extends(ScrollableLegendModel, _super); + + function ScrollableLegendModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = ScrollableLegendModel.type; + return _this; + } + /** + * @param {number} scrollDataIndex + */ - ScrollableLegendModel.prototype.setScrollDataIndex = function (scrollDataIndex) { - this.option.scrollDataIndex = scrollDataIndex; - }; + ScrollableLegendModel.prototype.setScrollDataIndex = function (scrollDataIndex) { + this.option.scrollDataIndex = scrollDataIndex; + }; - ScrollableLegendModel.prototype.init = function (option, parentModel, ecModel) { - var inputPositionParams = getLayoutParams(option); + ScrollableLegendModel.prototype.init = function (option, parentModel, ecModel) { + var inputPositionParams = getLayoutParams(option); - _super.prototype.init.call(this, option, parentModel, ecModel); + _super.prototype.init.call(this, option, parentModel, ecModel); - mergeAndNormalizeLayoutParams$1(this, option, inputPositionParams); - }; - /** - * @override - */ + mergeAndNormalizeLayoutParams$1(this, option, inputPositionParams); + }; + /** + * @override + */ - ScrollableLegendModel.prototype.mergeOption = function (option, ecModel) { - _super.prototype.mergeOption.call(this, option, ecModel); + ScrollableLegendModel.prototype.mergeOption = function (option, ecModel) { + _super.prototype.mergeOption.call(this, option, ecModel); - mergeAndNormalizeLayoutParams$1(this, this.option, option); - }; + mergeAndNormalizeLayoutParams$1(this, this.option, option); + }; - ScrollableLegendModel.type = 'legend.scroll'; - ScrollableLegendModel.defaultOption = inheritDefaultOption(LegendModel.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 - }); - return ScrollableLegendModel; - }(LegendModel); + ScrollableLegendModel.type = 'legend.scroll'; + ScrollableLegendModel.defaultOption = inheritDefaultOption(LegendModel.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 + }); + return ScrollableLegendModel; + }(LegendModel); function mergeAndNormalizeLayoutParams$1(legendModel, target, raw) { - var orient = legendModel.getOrient(); - var ignoreSize = [1, 1]; - ignoreSize[orient.index] = 0; - mergeLayoutParam(target, raw, { - type: 'box', - ignoreSize: !!ignoreSize - }); + var orient = legendModel.getOrient(); + var ignoreSize = [1, 1]; + ignoreSize[orient.index] = 0; + mergeLayoutParam(target, raw, { + type: 'box', + ignoreSize: !!ignoreSize + }); } var Group$3 = Group; @@ -87965,400 +87965,400 @@ var XY$1 = ['x', 'y']; var ScrollableLegendView = - /** @class */ - function (_super) { - __extends(ScrollableLegendView, _super); - - function ScrollableLegendView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = ScrollableLegendView.type; - _this.newlineDisabled = true; - _this._currentIndex = 0; - return _this; - } - - ScrollableLegendView.prototype.init = function () { - _super.prototype.init.call(this); - - this.group.add(this._containerGroup = new Group$3()); - - this._containerGroup.add(this.getContentGroup()); - - this.group.add(this._controllerGroup = new Group$3()); - }; - /** - * @override - */ + /** @class */ + function (_super) { + __extends(ScrollableLegendView, _super); + function ScrollableLegendView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - ScrollableLegendView.prototype.resetInner = function () { - _super.prototype.resetInner.call(this); + _this.type = ScrollableLegendView.type; + _this.newlineDisabled = true; + _this._currentIndex = 0; + return _this; + } - this._controllerGroup.removeAll(); + ScrollableLegendView.prototype.init = function () { + _super.prototype.init.call(this); - this._containerGroup.removeClipPath(); - - this._containerGroup.__rectSize = null; - }; - /** - * @override - */ + this.group.add(this._containerGroup = new Group$3()); + this._containerGroup.add(this.getContentGroup()); - ScrollableLegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) { - var self = this; // Render content items. + this.group.add(this._controllerGroup = new Group$3()); + }; + /** + * @override + */ - _super.prototype.renderInner.call(this, itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition); - var controllerGroup = this._controllerGroup; // FIXME: support be 'auto' adapt to size number text length, - // e.g., '3/12345' should not overlap with the control arrow button. + ScrollableLegendView.prototype.resetInner = function () { + _super.prototype.resetInner.call(this); - var pageIconSize = legendModel.get('pageIconSize', true); - var pageIconSizeArr = isArray(pageIconSize) ? pageIconSize : [pageIconSize, pageIconSize]; - createPageButton('pagePrev', 0); - var pageTextStyleModel = legendModel.getModel('pageTextStyle'); - controllerGroup.add(new ZRText({ - name: 'pageText', - style: { - // Placeholder to calculate a proper layout. - text: 'xx/xx', - fill: pageTextStyleModel.getTextColor(), - font: pageTextStyleModel.getFont(), - verticalAlign: 'middle', - align: 'center' - }, - silent: true - })); - createPageButton('pageNext', 1); - - function createPageButton(name, iconIdx) { - var pageDataIndexName = name + 'DataIndex'; - var icon = createIcon(legendModel.get('pageIcons', true)[legendModel.getOrient().name][iconIdx], { - // Buttons will be created in each render, so we do not need - // to worry about avoiding using legendModel kept in scope. - onclick: bind(self._pageGo, self, pageDataIndexName, legendModel, api) - }, { - x: -pageIconSizeArr[0] / 2, - y: -pageIconSizeArr[1] / 2, - width: pageIconSizeArr[0], - height: pageIconSizeArr[1] - }); - icon.name = name; - controllerGroup.add(icon); - } - }; - /** - * @override - */ + this._controllerGroup.removeAll(); + this._containerGroup.removeClipPath(); - ScrollableLegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) { - var selectorGroup = this.getSelectorGroup(); - var orientIdx = legendModel.getOrient().index; - var wh = WH$1[orientIdx]; - var xy = XY$1[orientIdx]; - var hw = WH$1[1 - orientIdx]; - var yx = XY$1[1 - orientIdx]; - selector && box( // Buttons in selectorGroup always layout horizontally - 'horizontal', selectorGroup, legendModel.get('selectorItemGap', true)); - var selectorButtonGap = legendModel.get('selectorButtonGap', true); - var selectorRect = selectorGroup.getBoundingRect(); - var selectorPos = [-selectorRect.x, -selectorRect.y]; - var processMaxSize = clone(maxSize); - selector && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap); - - var mainRect = this._layoutContentAndController(legendModel, isFirstRender, processMaxSize, orientIdx, wh, hw, yx, xy); - - if (selector) { - if (selectorPosition === 'end') { - selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap; - } else { - var offset = selectorRect[wh] + selectorButtonGap; - selectorPos[orientIdx] -= offset; - mainRect[xy] -= offset; - } + this._containerGroup.__rectSize = null; + }; + /** + * @override + */ - mainRect[wh] += selectorRect[wh] + selectorButtonGap; - selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2; - mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]); - mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]); - selectorGroup.x = selectorPos[0]; - selectorGroup.y = selectorPos[1]; - selectorGroup.markRedraw(); - } - return mainRect; - }; + ScrollableLegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) { + var self = this; // Render content items. + + _super.prototype.renderInner.call(this, itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition); + + var controllerGroup = this._controllerGroup; // FIXME: support be 'auto' adapt to size number text length, + // e.g., '3/12345' should not overlap with the control arrow button. + + var pageIconSize = legendModel.get('pageIconSize', true); + var pageIconSizeArr = isArray(pageIconSize) ? pageIconSize : [pageIconSize, pageIconSize]; + createPageButton('pagePrev', 0); + var pageTextStyleModel = legendModel.getModel('pageTextStyle'); + controllerGroup.add(new ZRText({ + name: 'pageText', + style: { + // Placeholder to calculate a proper layout. + text: 'xx/xx', + fill: pageTextStyleModel.getTextColor(), + font: pageTextStyleModel.getFont(), + verticalAlign: 'middle', + align: 'center' + }, + silent: true + })); + createPageButton('pageNext', 1); + + function createPageButton(name, iconIdx) { + var pageDataIndexName = name + 'DataIndex'; + var icon = createIcon(legendModel.get('pageIcons', true)[legendModel.getOrient().name][iconIdx], { + // Buttons will be created in each render, so we do not need + // to worry about avoiding using legendModel kept in scope. + onclick: bind(self._pageGo, self, pageDataIndexName, legendModel, api) + }, { + x: -pageIconSizeArr[0] / 2, + y: -pageIconSizeArr[1] / 2, + width: pageIconSizeArr[0], + height: pageIconSizeArr[1] + }); + icon.name = name; + controllerGroup.add(icon); + } + }; + /** + * @override + */ - ScrollableLegendView.prototype._layoutContentAndController = function (legendModel, isFirstRender, maxSize, orientIdx, wh, hw, yx, xy) { - var contentGroup = this.getContentGroup(); - var containerGroup = this._containerGroup; - var controllerGroup = this._controllerGroup; // Place items in contentGroup. - box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), !orientIdx ? null : maxSize.width, orientIdx ? null : maxSize.height); - box( // Buttons in controller are layout always horizontally. - 'horizontal', controllerGroup, legendModel.get('pageButtonItemGap', true)); - var contentRect = contentGroup.getBoundingRect(); - var controllerRect = controllerGroup.getBoundingRect(); - var showController = this._showController = contentRect[wh] > maxSize[wh]; // In case that the inner elements of contentGroup layout do not based on [0, 0] + ScrollableLegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) { + var selectorGroup = this.getSelectorGroup(); + var orientIdx = legendModel.getOrient().index; + var wh = WH$1[orientIdx]; + var xy = XY$1[orientIdx]; + var hw = WH$1[1 - orientIdx]; + var yx = XY$1[1 - orientIdx]; + selector && box( // Buttons in selectorGroup always layout horizontally + 'horizontal', selectorGroup, legendModel.get('selectorItemGap', true)); + var selectorButtonGap = legendModel.get('selectorButtonGap', true); + var selectorRect = selectorGroup.getBoundingRect(); + var selectorPos = [-selectorRect.x, -selectorRect.y]; + var processMaxSize = clone(maxSize); + selector && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap); + + var mainRect = this._layoutContentAndController(legendModel, isFirstRender, processMaxSize, orientIdx, wh, hw, yx, xy); + + if (selector) { + if (selectorPosition === 'end') { + selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap; + } else { + var offset = selectorRect[wh] + selectorButtonGap; + selectorPos[orientIdx] -= offset; + mainRect[xy] -= offset; + } + + mainRect[wh] += selectorRect[wh] + selectorButtonGap; + selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2; + mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]); + mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]); + selectorGroup.x = selectorPos[0]; + selectorGroup.y = selectorPos[1]; + selectorGroup.markRedraw(); + } + + return mainRect; + }; + + ScrollableLegendView.prototype._layoutContentAndController = function (legendModel, isFirstRender, maxSize, orientIdx, wh, hw, yx, xy) { + var contentGroup = this.getContentGroup(); + var containerGroup = this._containerGroup; + var controllerGroup = this._controllerGroup; // Place items in contentGroup. + + box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), !orientIdx ? null : maxSize.width, orientIdx ? null : maxSize.height); + box( // Buttons in controller are layout always horizontally. + 'horizontal', controllerGroup, legendModel.get('pageButtonItemGap', true)); + var contentRect = contentGroup.getBoundingRect(); + var controllerRect = controllerGroup.getBoundingRect(); + var showController = this._showController = contentRect[wh] > maxSize[wh]; // In case that the inner elements of contentGroup layout do not based on [0, 0] + + var contentPos = [-contentRect.x, -contentRect.y]; // Remain contentPos when scroll animation perfroming. + // If first rendering, `contentGroup.position` is [0, 0], which + // does not make sense and may cause unexepcted animation if adopted. + + if (!isFirstRender) { + contentPos[orientIdx] = contentGroup[xy]; + } // Layout container group based on 0. + + + var containerPos = [0, 0]; + var controllerPos = [-controllerRect.x, -controllerRect.y]; + var pageButtonGap = retrieve2(legendModel.get('pageButtonGap', true), legendModel.get('itemGap', true)); // Place containerGroup and controllerGroup and contentGroup. + + if (showController) { + var pageButtonPosition = legendModel.get('pageButtonPosition', true); // controller is on the right / bottom. + + if (pageButtonPosition === 'end') { + controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh]; + } // controller is on the left / top. + else { + containerPos[orientIdx] += controllerRect[wh] + pageButtonGap; + } + } // Always align controller to content as 'middle'. + + + controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2; + contentGroup.setPosition(contentPos); + containerGroup.setPosition(containerPos); + controllerGroup.setPosition(controllerPos); // Calculate `mainRect` and set `clipPath`. + // mainRect should not be calculated by `this.group.getBoundingRect()` + // for sake of the overflow. + + var mainRect = { + x: 0, + y: 0 + }; // Consider content may be overflow (should be clipped). + + mainRect[wh] = showController ? maxSize[wh] : contentRect[wh]; + mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]); // `containerRect[yx] + containerPos[1 - orientIdx]` is 0. + + mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]); + containerGroup.__rectSize = maxSize[wh]; + + if (showController) { + var clipShape = { + x: 0, + y: 0 + }; + clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0); + clipShape[hw] = mainRect[hw]; + containerGroup.setClipPath(new Rect({ + shape: clipShape + })); // Consider content may be larger than container, container rect + // can not be obtained from `containerGroup.getBoundingRect()`. + + containerGroup.__rectSize = clipShape[wh]; + } else { + // Do not remove or ignore controller. Keep them set as placeholders. + controllerGroup.eachChild(function (child) { + child.attr({ + invisible: true, + silent: true + }); + }); + } // Content translate animation. - var contentPos = [-contentRect.x, -contentRect.y]; // Remain contentPos when scroll animation perfroming. - // If first rendering, `contentGroup.position` is [0, 0], which - // does not make sense and may cause unexepcted animation if adopted. - if (!isFirstRender) { - contentPos[orientIdx] = contentGroup[xy]; - } // Layout container group based on 0. + var pageInfo = this._getPageInfo(legendModel); + pageInfo.pageIndex != null && updateProps(contentGroup, { + x: pageInfo.contentPosition[0], + y: pageInfo.contentPosition[1] + }, // When switch from "show controller" to "not show controller", view should be + // updated immediately without animation, otherwise causes weird effect. + showController ? legendModel : null); - var containerPos = [0, 0]; - var controllerPos = [-controllerRect.x, -controllerRect.y]; - var pageButtonGap = retrieve2(legendModel.get('pageButtonGap', true), legendModel.get('itemGap', true)); // Place containerGroup and controllerGroup and contentGroup. + this._updatePageInfoView(legendModel, pageInfo); - if (showController) { - var pageButtonPosition = legendModel.get('pageButtonPosition', true); // controller is on the right / bottom. + return mainRect; + }; - if (pageButtonPosition === 'end') { - controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh]; - } // controller is on the left / top. - else { - containerPos[orientIdx] += controllerRect[wh] + pageButtonGap; - } - } // Always align controller to content as 'middle'. + ScrollableLegendView.prototype._pageGo = function (to, legendModel, api) { + var scrollDataIndex = this._getPageInfo(legendModel)[to]; + scrollDataIndex != null && api.dispatchAction({ + type: 'legendScroll', + scrollDataIndex: scrollDataIndex, + legendId: legendModel.id + }); + }; + + ScrollableLegendView.prototype._updatePageInfoView = function (legendModel, pageInfo) { + var controllerGroup = this._controllerGroup; + each(['pagePrev', 'pageNext'], function (name) { + var key = name + 'DataIndex'; + var canJump = pageInfo[key] != null; + var icon = controllerGroup.childOfName(name); + + if (icon) { + icon.setStyle('fill', canJump ? legendModel.get('pageIconColor', true) : legendModel.get('pageIconInactiveColor', true)); + icon.cursor = canJump ? 'pointer' : 'default'; + } + }); + var pageText = controllerGroup.childOfName('pageText'); + var pageFormatter = legendModel.get('pageFormatter'); + var pageIndex = pageInfo.pageIndex; + var current = pageIndex != null ? pageIndex + 1 : 0; + var total = pageInfo.pageCount; + pageText && pageFormatter && pageText.setStyle('text', isString(pageFormatter) ? pageFormatter.replace('{current}', current == null ? '' : current + '').replace('{total}', total == null ? '' : total + '') : pageFormatter({ + current: current, + total: total + })); + }; + /** + * contentPosition: Array., null when data item not found. + * pageIndex: number, null when data item not found. + * pageCount: number, always be a number, can be 0. + * pagePrevDataIndex: number, null when no previous page. + * pageNextDataIndex: number, null when no next page. + * } + */ - controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2; - contentGroup.setPosition(contentPos); - containerGroup.setPosition(containerPos); - controllerGroup.setPosition(controllerPos); // Calculate `mainRect` and set `clipPath`. - // mainRect should not be calculated by `this.group.getBoundingRect()` - // for sake of the overflow. - var mainRect = { - x: 0, - y: 0 - }; // Consider content may be overflow (should be clipped). + ScrollableLegendView.prototype._getPageInfo = function (legendModel) { + var scrollDataIndex = legendModel.get('scrollDataIndex', true); + var contentGroup = this.getContentGroup(); + var containerRectSize = this._containerGroup.__rectSize; + var orientIdx = legendModel.getOrient().index; + var wh = WH$1[orientIdx]; + var xy = XY$1[orientIdx]; - mainRect[wh] = showController ? maxSize[wh] : contentRect[wh]; - mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]); // `containerRect[yx] + containerPos[1 - orientIdx]` is 0. + var targetItemIndex = this._findTargetItemIndex(scrollDataIndex); - mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]); - containerGroup.__rectSize = maxSize[wh]; + var children = contentGroup.children(); + var targetItem = children[targetItemIndex]; + var itemCount = children.length; + var pCount = !itemCount ? 0 : 1; + var result = { + contentPosition: [contentGroup.x, contentGroup.y], + pageCount: pCount, + pageIndex: pCount - 1, + pagePrevDataIndex: null, + pageNextDataIndex: null + }; + + if (!targetItem) { + return result; + } + + var targetItemInfo = getItemInfo(targetItem); + result.contentPosition[orientIdx] = -targetItemInfo.s; // Strategy: + // (1) Always align based on the left/top most item. + // (2) It is user-friendly that the last item shown in the + // current window is shown at the begining of next window. + // Otherwise if half of the last item is cut by the window, + // it will have no chance to display entirely. + // (3) Consider that item size probably be different, we + // have calculate pageIndex by size rather than item index, + // and we can not get page index directly by division. + // (4) The window is to narrow to contain more than + // one item, we should make sure that the page can be fliped. + + for (var i = targetItemIndex + 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i <= itemCount; ++i) { + currItemInfo = getItemInfo(children[i]); + + if ( // Half of the last item is out of the window. + !currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize || // If the current item does not intersect with the window, the new page + // can be started at the current item or the last item. + currItemInfo && !intersect(currItemInfo, winStartItemInfo.s)) { + if (winEndItemInfo.i > winStartItemInfo.i) { + winStartItemInfo = winEndItemInfo; + } else { + // e.g., when page size is smaller than item size. + winStartItemInfo = currItemInfo; + } - if (showController) { - var clipShape = { - x: 0, - y: 0 - }; - clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0); - clipShape[hw] = mainRect[hw]; - containerGroup.setClipPath(new Rect({ - shape: clipShape - })); // Consider content may be larger than container, container rect - // can not be obtained from `containerGroup.getBoundingRect()`. - - containerGroup.__rectSize = clipShape[wh]; - } else { - // Do not remove or ignore controller. Keep them set as placeholders. - controllerGroup.eachChild(function (child) { - child.attr({ - invisible: true, - silent: true - }); - }); - } // Content translate animation. + if (winStartItemInfo) { + if (result.pageNextDataIndex == null) { + result.pageNextDataIndex = winStartItemInfo.i; + } + ++result.pageCount; + } + } - var pageInfo = this._getPageInfo(legendModel); + winEndItemInfo = currItemInfo; + } - pageInfo.pageIndex != null && updateProps(contentGroup, { - x: pageInfo.contentPosition[0], - y: pageInfo.contentPosition[1] - }, // When switch from "show controller" to "not show controller", view should be - // updated immediately without animation, otherwise causes weird effect. - showController ? legendModel : null); + for (var i = targetItemIndex - 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i >= -1; --i) { + currItemInfo = getItemInfo(children[i]); - this._updatePageInfoView(legendModel, pageInfo); + if ( // If the the end item does not intersect with the window started + // from the current item, a page can be settled. + (!currItemInfo || !intersect(winEndItemInfo, currItemInfo.s)) && // e.g., when page size is smaller than item size. + winStartItemInfo.i < winEndItemInfo.i) { + winEndItemInfo = winStartItemInfo; - return mainRect; - }; + if (result.pagePrevDataIndex == null) { + result.pagePrevDataIndex = winStartItemInfo.i; + } - ScrollableLegendView.prototype._pageGo = function (to, legendModel, api) { - var scrollDataIndex = this._getPageInfo(legendModel)[to]; + ++result.pageCount; + ++result.pageIndex; + } - scrollDataIndex != null && api.dispatchAction({ - type: 'legendScroll', - scrollDataIndex: scrollDataIndex, - legendId: legendModel.id - }); - }; + winStartItemInfo = currItemInfo; + } - ScrollableLegendView.prototype._updatePageInfoView = function (legendModel, pageInfo) { - var controllerGroup = this._controllerGroup; - each(['pagePrev', 'pageNext'], function (name) { - var key = name + 'DataIndex'; - var canJump = pageInfo[key] != null; - var icon = controllerGroup.childOfName(name); + return result; - if (icon) { - icon.setStyle('fill', canJump ? legendModel.get('pageIconColor', true) : legendModel.get('pageIconInactiveColor', true)); - icon.cursor = canJump ? 'pointer' : 'default'; - } - }); - var pageText = controllerGroup.childOfName('pageText'); - var pageFormatter = legendModel.get('pageFormatter'); - var pageIndex = pageInfo.pageIndex; - var current = pageIndex != null ? pageIndex + 1 : 0; - var total = pageInfo.pageCount; - pageText && pageFormatter && pageText.setStyle('text', isString(pageFormatter) ? pageFormatter.replace('{current}', current == null ? '' : current + '').replace('{total}', total == null ? '' : total + '') : pageFormatter({ - current: current, - total: total - })); + function getItemInfo(el) { + if (el) { + var itemRect = el.getBoundingRect(); + var start = itemRect[xy] + el[xy]; + return { + s: start, + e: start + itemRect[wh], + i: el.__legendDataIndex }; - /** - * contentPosition: Array., null when data item not found. - * pageIndex: number, null when data item not found. - * pageCount: number, always be a number, can be 0. - * pagePrevDataIndex: number, null when no previous page. - * pageNextDataIndex: number, null when no next page. - * } - */ - - - ScrollableLegendView.prototype._getPageInfo = function (legendModel) { - var scrollDataIndex = legendModel.get('scrollDataIndex', true); - var contentGroup = this.getContentGroup(); - var containerRectSize = this._containerGroup.__rectSize; - var orientIdx = legendModel.getOrient().index; - var wh = WH$1[orientIdx]; - var xy = XY$1[orientIdx]; - - var targetItemIndex = this._findTargetItemIndex(scrollDataIndex); - - var children = contentGroup.children(); - var targetItem = children[targetItemIndex]; - var itemCount = children.length; - var pCount = !itemCount ? 0 : 1; - var result = { - contentPosition: [contentGroup.x, contentGroup.y], - pageCount: pCount, - pageIndex: pCount - 1, - pagePrevDataIndex: null, - pageNextDataIndex: null - }; - - if (!targetItem) { - return result; - } - - var targetItemInfo = getItemInfo(targetItem); - result.contentPosition[orientIdx] = -targetItemInfo.s; // Strategy: - // (1) Always align based on the left/top most item. - // (2) It is user-friendly that the last item shown in the - // current window is shown at the begining of next window. - // Otherwise if half of the last item is cut by the window, - // it will have no chance to display entirely. - // (3) Consider that item size probably be different, we - // have calculate pageIndex by size rather than item index, - // and we can not get page index directly by division. - // (4) The window is to narrow to contain more than - // one item, we should make sure that the page can be fliped. - - for (var i = targetItemIndex + 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i <= itemCount; ++i) { - currItemInfo = getItemInfo(children[i]); - - if ( // Half of the last item is out of the window. - !currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize || // If the current item does not intersect with the window, the new page - // can be started at the current item or the last item. - currItemInfo && !intersect(currItemInfo, winStartItemInfo.s)) { - if (winEndItemInfo.i > winStartItemInfo.i) { - winStartItemInfo = winEndItemInfo; - } else { - // e.g., when page size is smaller than item size. - winStartItemInfo = currItemInfo; - } - - if (winStartItemInfo) { - if (result.pageNextDataIndex == null) { - result.pageNextDataIndex = winStartItemInfo.i; - } - - ++result.pageCount; - } - } - - winEndItemInfo = currItemInfo; - } - - for (var i = targetItemIndex - 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i >= -1; --i) { - currItemInfo = getItemInfo(children[i]); - - if ( // If the the end item does not intersect with the window started - // from the current item, a page can be settled. - (!currItemInfo || !intersect(winEndItemInfo, currItemInfo.s)) && // e.g., when page size is smaller than item size. - winStartItemInfo.i < winEndItemInfo.i) { - winEndItemInfo = winStartItemInfo; - - if (result.pagePrevDataIndex == null) { - result.pagePrevDataIndex = winStartItemInfo.i; - } - - ++result.pageCount; - ++result.pageIndex; - } - - winStartItemInfo = currItemInfo; - } - - return result; - - function getItemInfo(el) { - if (el) { - var itemRect = el.getBoundingRect(); - var start = itemRect[xy] + el[xy]; - return { - s: start, - e: start + itemRect[wh], - i: el.__legendDataIndex - }; - } - } + } + } - function intersect(itemInfo, winStart) { - return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize; - } - }; + function intersect(itemInfo, winStart) { + return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize; + } + }; - ScrollableLegendView.prototype._findTargetItemIndex = function (targetDataIndex) { - if (!this._showController) { - return 0; - } + ScrollableLegendView.prototype._findTargetItemIndex = function (targetDataIndex) { + if (!this._showController) { + return 0; + } - var index; - var contentGroup = this.getContentGroup(); - var defaultIndex; - contentGroup.eachChild(function (child, idx) { - var legendDataIdx = child.__legendDataIndex; // FIXME - // If the given targetDataIndex (from model) is illegal, - // we use defaultIndex. But the index on the legend model and - // action payload is still illegal. That case will not be - // changed until some scenario requires. + var index; + var contentGroup = this.getContentGroup(); + var defaultIndex; + contentGroup.eachChild(function (child, idx) { + var legendDataIdx = child.__legendDataIndex; // FIXME + // If the given targetDataIndex (from model) is illegal, + // we use defaultIndex. But the index on the legend model and + // action payload is still illegal. That case will not be + // changed until some scenario requires. - if (defaultIndex == null && legendDataIdx != null) { - defaultIndex = idx; - } + if (defaultIndex == null && legendDataIdx != null) { + defaultIndex = idx; + } - if (legendDataIdx === targetDataIndex) { - index = idx; - } - }); - return index != null ? index : defaultIndex; - }; + if (legendDataIdx === targetDataIndex) { + index = idx; + } + }); + return index != null ? index : defaultIndex; + }; - ScrollableLegendView.type = 'legend.scroll'; - return ScrollableLegendView; - }(LegendView); + ScrollableLegendView.type = 'legend.scroll'; + return ScrollableLegendView; + }(LegendView); /* * Licensed to the Apache Software Foundation (ASF) under one @@ -88403,136 +88403,136 @@ * under the License. */ function installScrollableLegendAction(registers) { - /** - * @event legendScroll - * @type {Object} - * @property {string} type 'legendScroll' - * @property {string} scrollDataIndex - */ - registers.registerAction('legendScroll', 'legendscroll', function (payload, ecModel) { - var scrollDataIndex = payload.scrollDataIndex; - scrollDataIndex != null && ecModel.eachComponent({ - mainType: 'legend', - subType: 'scroll', - query: payload - }, function (legendModel) { - legendModel.setScrollDataIndex(scrollDataIndex); - }); + /** + * @event legendScroll + * @type {Object} + * @property {string} type 'legendScroll' + * @property {string} scrollDataIndex + */ + registers.registerAction('legendScroll', 'legendscroll', function (payload, ecModel) { + var scrollDataIndex = payload.scrollDataIndex; + scrollDataIndex != null && ecModel.eachComponent({ + mainType: 'legend', + subType: 'scroll', + query: payload + }, function (legendModel) { + legendModel.setScrollDataIndex(scrollDataIndex); }); + }); } function install$I(registers) { - use(install$H); - registers.registerComponentModel(ScrollableLegendModel); - registers.registerComponentView(ScrollableLegendView); - installScrollableLegendAction(registers); + use(install$H); + registers.registerComponentModel(ScrollableLegendModel); + registers.registerComponentView(ScrollableLegendView); + installScrollableLegendAction(registers); } function install$J(registers) { - use(install$H); - use(install$I); + use(install$H); + use(install$I); } var InsideZoomModel = - /** @class */ - function (_super) { - __extends(InsideZoomModel, _super); - - function InsideZoomModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = InsideZoomModel.type; - return _this; - } - - InsideZoomModel.type = 'dataZoom.inside'; - InsideZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, { - disabled: false, - zoomLock: false, - zoomOnMouseWheel: true, - moveOnMouseMove: true, - moveOnMouseWheel: false, - preventDefaultMouseMove: true - }); - return InsideZoomModel; - }(DataZoomModel); + /** @class */ + function (_super) { + __extends(InsideZoomModel, _super); + + function InsideZoomModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = InsideZoomModel.type; + return _this; + } + + InsideZoomModel.type = 'dataZoom.inside'; + InsideZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, { + disabled: false, + zoomLock: false, + zoomOnMouseWheel: true, + moveOnMouseMove: true, + moveOnMouseWheel: false, + preventDefaultMouseMove: true + }); + return InsideZoomModel; + }(DataZoomModel); var inner$k = makeInner(); function setViewInfoToCoordSysRecord(api, dataZoomModel, getRange) { - inner$k(api).coordSysRecordMap.each(function (coordSysRecord) { - var dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid); + inner$k(api).coordSysRecordMap.each(function (coordSysRecord) { + var dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid); - if (dzInfo) { - dzInfo.getRange = getRange; - } - }); + if (dzInfo) { + dzInfo.getRange = getRange; + } + }); } function disposeCoordSysRecordIfNeeded(api, dataZoomModel) { - var coordSysRecordMap = inner$k(api).coordSysRecordMap; - var coordSysKeyArr = coordSysRecordMap.keys(); + var coordSysRecordMap = inner$k(api).coordSysRecordMap; + var coordSysKeyArr = coordSysRecordMap.keys(); - for (var i = 0; i < coordSysKeyArr.length; i++) { - var coordSysKey = coordSysKeyArr[i]; - var coordSysRecord = coordSysRecordMap.get(coordSysKey); - var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap; + for (var i = 0; i < coordSysKeyArr.length; i++) { + var coordSysKey = coordSysKeyArr[i]; + var coordSysRecord = coordSysRecordMap.get(coordSysKey); + var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap; - if (dataZoomInfoMap) { - var dzUid = dataZoomModel.uid; - var dzInfo = dataZoomInfoMap.get(dzUid); + if (dataZoomInfoMap) { + var dzUid = dataZoomModel.uid; + var dzInfo = dataZoomInfoMap.get(dzUid); - if (dzInfo) { - dataZoomInfoMap.removeKey(dzUid); + if (dzInfo) { + dataZoomInfoMap.removeKey(dzUid); - if (!dataZoomInfoMap.keys().length) { - disposeCoordSysRecord(coordSysRecordMap, coordSysRecord); - } - } + if (!dataZoomInfoMap.keys().length) { + disposeCoordSysRecord(coordSysRecordMap, coordSysRecord); } + } } + } } function disposeCoordSysRecord(coordSysRecordMap, coordSysRecord) { - if (coordSysRecord) { - coordSysRecordMap.removeKey(coordSysRecord.model.uid); - var controller = coordSysRecord.controller; - controller && controller.dispose(); - } + if (coordSysRecord) { + coordSysRecordMap.removeKey(coordSysRecord.model.uid); + var controller = coordSysRecord.controller; + controller && controller.dispose(); + } } function createCoordSysRecord(api, coordSysModel) { - // These init props will never change after record created. - var coordSysRecord = { - model: coordSysModel, - containsPoint: curry(containsPoint, coordSysModel), - dispatchAction: curry(dispatchAction$1, api), - dataZoomInfoMap: null, - controller: null - }; // Must not do anything depends on coordSysRecord outside the event handler here, - // because coordSysRecord not completed yet. - - var controller = coordSysRecord.controller = new RoamController(api.getZr()); - each(['pan', 'zoom', 'scrollMove'], function (eventName) { - controller.on(eventName, function (event) { - var batch = []; - coordSysRecord.dataZoomInfoMap.each(function (dzInfo) { - // Check whether the behaviors (zoomOnMouseWheel, moveOnMouseMove, - // moveOnMouseWheel, ...) enabled. - if (!event.isAvailableBehavior(dzInfo.model.option)) { - return; - } - - var method = (dzInfo.getRange || {})[eventName]; - var range = method && method(dzInfo.dzReferCoordSysInfo, coordSysRecord.model.mainType, coordSysRecord.controller, event); - !dzInfo.model.get('disabled', true) && range && batch.push({ - dataZoomId: dzInfo.model.id, - start: range[0], - end: range[1] - }); - }); - batch.length && coordSysRecord.dispatchAction(batch); + // These init props will never change after record created. + var coordSysRecord = { + model: coordSysModel, + containsPoint: curry(containsPoint, coordSysModel), + dispatchAction: curry(dispatchAction$1, api), + dataZoomInfoMap: null, + controller: null + }; // Must not do anything depends on coordSysRecord outside the event handler here, + // because coordSysRecord not completed yet. + + var controller = coordSysRecord.controller = new RoamController(api.getZr()); + each(['pan', 'zoom', 'scrollMove'], function (eventName) { + controller.on(eventName, function (event) { + var batch = []; + coordSysRecord.dataZoomInfoMap.each(function (dzInfo) { + // Check whether the behaviors (zoomOnMouseWheel, moveOnMouseMove, + // moveOnMouseWheel, ...) enabled. + if (!event.isAvailableBehavior(dzInfo.model.option)) { + return; + } + + var method = (dzInfo.getRange || {})[eventName]; + var range = method && method(dzInfo.dzReferCoordSysInfo, coordSysRecord.model.mainType, coordSysRecord.controller, event); + !dzInfo.model.get('disabled', true) && range && batch.push({ + dataZoomId: dzInfo.model.id, + start: range[0], + end: range[1] }); + }); + batch.length && coordSysRecord.dispatchAction(batch); }); - return coordSysRecord; + }); + return coordSysRecord; } /** * This action will be throttled. @@ -88540,20 +88540,20 @@ function dispatchAction$1(api, batch) { - if (!api.isDisposed()) { - api.dispatchAction({ - type: 'dataZoom', - animation: { - easing: 'cubicOut', - duration: 100 - }, - batch: batch - }); - } + if (!api.isDisposed()) { + api.dispatchAction({ + type: 'dataZoom', + animation: { + easing: 'cubicOut', + duration: 100 + }, + batch: batch + }); + } } function containsPoint(coordSysModel, e, x, y) { - return coordSysModel.coordinateSystem.containPoint([x, y]); + return coordSysModel.coordinateSystem.containPoint([x, y]); } /** * Merge roamController settings when multiple dataZooms share one roamController. @@ -88561,365 +88561,365 @@ function mergeControllerParams(dataZoomInfoMap) { - var controlType; // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated - // as string, it is probably revert to reserved word by compress tool. See #7411. - - var prefix = 'type_'; - var typePriority = { - 'type_true': 2, - 'type_move': 1, - 'type_false': 0, - 'type_undefined': -1 - }; - var preventDefaultMouseMove = true; - dataZoomInfoMap.each(function (dataZoomInfo) { - var dataZoomModel = dataZoomInfo.model; - var oneType = dataZoomModel.get('disabled', true) ? false : dataZoomModel.get('zoomLock', true) ? 'move' : true; - - if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) { - controlType = oneType; - } // Prevent default move event by default. If one false, do not prevent. Otherwise - // users may be confused why it does not work when multiple insideZooms exist. - - - preventDefaultMouseMove = preventDefaultMouseMove && dataZoomModel.get('preventDefaultMouseMove', true); - }); - return { - controlType: controlType, - opt: { - // RoamController will enable all of these functionalities, - // and the final behavior is determined by its event listener - // provided by each inside zoom. - zoomOnMouseWheel: true, - moveOnMouseMove: true, - moveOnMouseWheel: true, - preventDefaultMouseMove: !!preventDefaultMouseMove - } - }; + var controlType; // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated + // as string, it is probably revert to reserved word by compress tool. See #7411. + + var prefix = 'type_'; + var typePriority = { + 'type_true': 2, + 'type_move': 1, + 'type_false': 0, + 'type_undefined': -1 + }; + var preventDefaultMouseMove = true; + dataZoomInfoMap.each(function (dataZoomInfo) { + var dataZoomModel = dataZoomInfo.model; + var oneType = dataZoomModel.get('disabled', true) ? false : dataZoomModel.get('zoomLock', true) ? 'move' : true; + + if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) { + controlType = oneType; + } // Prevent default move event by default. If one false, do not prevent. Otherwise + // users may be confused why it does not work when multiple insideZooms exist. + + + preventDefaultMouseMove = preventDefaultMouseMove && dataZoomModel.get('preventDefaultMouseMove', true); + }); + return { + controlType: controlType, + opt: { + // RoamController will enable all of these functionalities, + // and the final behavior is determined by its event listener + // provided by each inside zoom. + zoomOnMouseWheel: true, + moveOnMouseMove: true, + moveOnMouseWheel: true, + preventDefaultMouseMove: !!preventDefaultMouseMove + } + }; } function installDataZoomRoamProcessor(registers) { - registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, function (ecModel, api) { - var apiInner = inner$k(api); - var coordSysRecordMap = apiInner.coordSysRecordMap || (apiInner.coordSysRecordMap = createHashMap()); - coordSysRecordMap.each(function (coordSysRecord) { - // `coordSysRecordMap` always exists (becuase it hold the `roam controller`, which should - // better not re-create each time), but clear `dataZoomInfoMap` each round of the workflow. - coordSysRecord.dataZoomInfoMap = null; + registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, function (ecModel, api) { + var apiInner = inner$k(api); + var coordSysRecordMap = apiInner.coordSysRecordMap || (apiInner.coordSysRecordMap = createHashMap()); + coordSysRecordMap.each(function (coordSysRecord) { + // `coordSysRecordMap` always exists (becuase it hold the `roam controller`, which should + // better not re-create each time), but clear `dataZoomInfoMap` each round of the workflow. + coordSysRecord.dataZoomInfoMap = null; + }); + ecModel.eachComponent({ + mainType: 'dataZoom', + subType: 'inside' + }, function (dataZoomModel) { + var dzReferCoordSysWrap = collectReferCoordSysModelInfo(dataZoomModel); + each(dzReferCoordSysWrap.infoList, function (dzCoordSysInfo) { + var coordSysUid = dzCoordSysInfo.model.uid; + var coordSysRecord = coordSysRecordMap.get(coordSysUid) || coordSysRecordMap.set(coordSysUid, createCoordSysRecord(api, dzCoordSysInfo.model)); + var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap || (coordSysRecord.dataZoomInfoMap = createHashMap()); // Notice these props might be changed each time for a single dataZoomModel. + + dataZoomInfoMap.set(dataZoomModel.uid, { + dzReferCoordSysInfo: dzCoordSysInfo, + model: dataZoomModel, + getRange: null }); - ecModel.eachComponent({ - mainType: 'dataZoom', - subType: 'inside' - }, function (dataZoomModel) { - var dzReferCoordSysWrap = collectReferCoordSysModelInfo(dataZoomModel); - each(dzReferCoordSysWrap.infoList, function (dzCoordSysInfo) { - var coordSysUid = dzCoordSysInfo.model.uid; - var coordSysRecord = coordSysRecordMap.get(coordSysUid) || coordSysRecordMap.set(coordSysUid, createCoordSysRecord(api, dzCoordSysInfo.model)); - var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap || (coordSysRecord.dataZoomInfoMap = createHashMap()); // Notice these props might be changed each time for a single dataZoomModel. - - dataZoomInfoMap.set(dataZoomModel.uid, { - dzReferCoordSysInfo: dzCoordSysInfo, - model: dataZoomModel, - getRange: null - }); - }); - }); // (1) Merge dataZoom settings for each coord sys and set to the roam controller. - // (2) Clear coord sys if not refered by any dataZoom. + }); + }); // (1) Merge dataZoom settings for each coord sys and set to the roam controller. + // (2) Clear coord sys if not refered by any dataZoom. - coordSysRecordMap.each(function (coordSysRecord) { - var controller = coordSysRecord.controller; - var firstDzInfo; - var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap; + coordSysRecordMap.each(function (coordSysRecord) { + var controller = coordSysRecord.controller; + var firstDzInfo; + var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap; - if (dataZoomInfoMap) { - var firstDzKey = dataZoomInfoMap.keys()[0]; + if (dataZoomInfoMap) { + var firstDzKey = dataZoomInfoMap.keys()[0]; - if (firstDzKey != null) { - firstDzInfo = dataZoomInfoMap.get(firstDzKey); - } - } + if (firstDzKey != null) { + firstDzInfo = dataZoomInfoMap.get(firstDzKey); + } + } - if (!firstDzInfo) { - disposeCoordSysRecord(coordSysRecordMap, coordSysRecord); - return; - } + if (!firstDzInfo) { + disposeCoordSysRecord(coordSysRecordMap, coordSysRecord); + return; + } - var controllerParams = mergeControllerParams(dataZoomInfoMap); - controller.enable(controllerParams.controlType, controllerParams.opt); - controller.setPointerChecker(coordSysRecord.containsPoint); - createOrUpdate(coordSysRecord, 'dispatchAction', firstDzInfo.model.get('throttle', true), 'fixRate'); - }); + var controllerParams = mergeControllerParams(dataZoomInfoMap); + controller.enable(controllerParams.controlType, controllerParams.opt); + controller.setPointerChecker(coordSysRecord.containsPoint); + createOrUpdate(coordSysRecord, 'dispatchAction', firstDzInfo.model.get('throttle', true), 'fixRate'); }); + }); } var InsideZoomView = - /** @class */ - function (_super) { - __extends(InsideZoomView, _super); + /** @class */ + function (_super) { + __extends(InsideZoomView, _super); - function InsideZoomView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function InsideZoomView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = 'dataZoom.inside'; - return _this; - } + _this.type = 'dataZoom.inside'; + return _this; + } - InsideZoomView.prototype.render = function (dataZoomModel, ecModel, api) { - _super.prototype.render.apply(this, arguments); + InsideZoomView.prototype.render = function (dataZoomModel, ecModel, api) { + _super.prototype.render.apply(this, arguments); - if (dataZoomModel.noTarget()) { - this._clear(); + if (dataZoomModel.noTarget()) { + this._clear(); - return; - } // Hence the `throttle` util ensures to preserve command order, - // here simply updating range all the time will not cause missing - // any of the the roam change. + return; + } // Hence the `throttle` util ensures to preserve command order, + // here simply updating range all the time will not cause missing + // any of the the roam change. - this.range = dataZoomModel.getPercentRange(); // Reset controllers. + this.range = dataZoomModel.getPercentRange(); // Reset controllers. - setViewInfoToCoordSysRecord(api, dataZoomModel, { - pan: bind(getRangeHandlers.pan, this), - zoom: bind(getRangeHandlers.zoom, this), - scrollMove: bind(getRangeHandlers.scrollMove, this) - }); - }; + setViewInfoToCoordSysRecord(api, dataZoomModel, { + pan: bind(getRangeHandlers.pan, this), + zoom: bind(getRangeHandlers.zoom, this), + scrollMove: bind(getRangeHandlers.scrollMove, this) + }); + }; - InsideZoomView.prototype.dispose = function () { - this._clear(); + InsideZoomView.prototype.dispose = function () { + this._clear(); - _super.prototype.dispose.apply(this, arguments); - }; + _super.prototype.dispose.apply(this, arguments); + }; - InsideZoomView.prototype._clear = function () { - disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel); - this.range = null; - }; + InsideZoomView.prototype._clear = function () { + disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel); + this.range = null; + }; - InsideZoomView.type = 'dataZoom.inside'; - return InsideZoomView; - }(DataZoomView); + InsideZoomView.type = 'dataZoom.inside'; + return InsideZoomView; + }(DataZoomView); var getRangeHandlers = { - zoom: function (coordSysInfo, coordSysMainType, controller, e) { - var lastRange = this.range; - var range = lastRange.slice(); // Calculate transform by the first axis. - - var axisModel = coordSysInfo.axisModels[0]; - - if (!axisModel) { - return; - } - - var directionInfo = getDirectionInfo[coordSysMainType](null, [e.originX, e.originY], axisModel, controller, coordSysInfo); - var percentPoint = (directionInfo.signal > 0 ? directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel : directionInfo.pixel - directionInfo.pixelStart) / directionInfo.pixelLength * (range[1] - range[0]) + range[0]; - var scale = Math.max(1 / e.scale, 0); - range[0] = (range[0] - percentPoint) * scale + percentPoint; - range[1] = (range[1] - percentPoint) * scale + percentPoint; // Restrict range. - - var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan(); - sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan); - this.range = range; - - if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) { - return range; - } - }, - pan: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) { - var directionInfo = getDirectionInfo[coordSysMainType]([e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordSysInfo); - return directionInfo.signal * (range[1] - range[0]) * directionInfo.pixel / directionInfo.pixelLength; - }), - scrollMove: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) { - var directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordSysInfo); - return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta; - }) + zoom: function (coordSysInfo, coordSysMainType, controller, e) { + var lastRange = this.range; + var range = lastRange.slice(); // Calculate transform by the first axis. + + var axisModel = coordSysInfo.axisModels[0]; + + if (!axisModel) { + return; + } + + var directionInfo = getDirectionInfo[coordSysMainType](null, [e.originX, e.originY], axisModel, controller, coordSysInfo); + var percentPoint = (directionInfo.signal > 0 ? directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel : directionInfo.pixel - directionInfo.pixelStart) / directionInfo.pixelLength * (range[1] - range[0]) + range[0]; + var scale = Math.max(1 / e.scale, 0); + range[0] = (range[0] - percentPoint) * scale + percentPoint; + range[1] = (range[1] - percentPoint) * scale + percentPoint; // Restrict range. + + var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan(); + sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan); + this.range = range; + + if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) { + return range; + } + }, + pan: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) { + var directionInfo = getDirectionInfo[coordSysMainType]([e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordSysInfo); + return directionInfo.signal * (range[1] - range[0]) * directionInfo.pixel / directionInfo.pixelLength; + }), + scrollMove: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) { + var directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordSysInfo); + return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta; + }) }; function makeMover(getPercentDelta) { - return function (coordSysInfo, coordSysMainType, controller, e) { - var lastRange = this.range; - var range = lastRange.slice(); // Calculate transform by the first axis. + return function (coordSysInfo, coordSysMainType, controller, e) { + var lastRange = this.range; + var range = lastRange.slice(); // Calculate transform by the first axis. - var axisModel = coordSysInfo.axisModels[0]; + var axisModel = coordSysInfo.axisModels[0]; - if (!axisModel) { - return; - } + if (!axisModel) { + return; + } - var percentDelta = getPercentDelta(range, axisModel, coordSysInfo, coordSysMainType, controller, e); - sliderMove(percentDelta, range, [0, 100], 'all'); - this.range = range; + var percentDelta = getPercentDelta(range, axisModel, coordSysInfo, coordSysMainType, controller, e); + sliderMove(percentDelta, range, [0, 100], 'all'); + this.range = range; - if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) { - return range; - } - }; + if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) { + return range; + } + }; } var getDirectionInfo = { - grid: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) { - var axis = axisModel.axis; - var ret = {}; - var rect = coordSysInfo.model.coordinateSystem.getRect(); - oldPoint = oldPoint || [0, 0]; - - if (axis.dim === 'x') { - ret.pixel = newPoint[0] - oldPoint[0]; - ret.pixelLength = rect.width; - ret.pixelStart = rect.x; - ret.signal = axis.inverse ? 1 : -1; - } else { - // axis.dim === 'y' - ret.pixel = newPoint[1] - oldPoint[1]; - ret.pixelLength = rect.height; - ret.pixelStart = rect.y; - ret.signal = axis.inverse ? -1 : 1; - } + grid: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) { + var axis = axisModel.axis; + var ret = {}; + var rect = coordSysInfo.model.coordinateSystem.getRect(); + oldPoint = oldPoint || [0, 0]; + + if (axis.dim === 'x') { + ret.pixel = newPoint[0] - oldPoint[0]; + ret.pixelLength = rect.width; + ret.pixelStart = rect.x; + ret.signal = axis.inverse ? 1 : -1; + } else { + // axis.dim === 'y' + ret.pixel = newPoint[1] - oldPoint[1]; + ret.pixelLength = rect.height; + ret.pixelStart = rect.y; + ret.signal = axis.inverse ? -1 : 1; + } - return ret; - }, - polar: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) { - var axis = axisModel.axis; - var ret = {}; - var polar = coordSysInfo.model.coordinateSystem; - var radiusExtent = polar.getRadiusAxis().getExtent(); - var angleExtent = polar.getAngleAxis().getExtent(); - oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0]; - newPoint = polar.pointToCoord(newPoint); - - if (axisModel.mainType === 'radiusAxis') { - ret.pixel = newPoint[0] - oldPoint[0]; // ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]); - // ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]); - - ret.pixelLength = radiusExtent[1] - radiusExtent[0]; - ret.pixelStart = radiusExtent[0]; - ret.signal = axis.inverse ? 1 : -1; - } else { - // 'angleAxis' - ret.pixel = newPoint[1] - oldPoint[1]; // ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]); - // ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]); + return ret; + }, + polar: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) { + var axis = axisModel.axis; + var ret = {}; + var polar = coordSysInfo.model.coordinateSystem; + var radiusExtent = polar.getRadiusAxis().getExtent(); + var angleExtent = polar.getAngleAxis().getExtent(); + oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0]; + newPoint = polar.pointToCoord(newPoint); - ret.pixelLength = angleExtent[1] - angleExtent[0]; - ret.pixelStart = angleExtent[0]; - ret.signal = axis.inverse ? -1 : 1; - } + if (axisModel.mainType === 'radiusAxis') { + ret.pixel = newPoint[0] - oldPoint[0]; // ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]); + // ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]); - return ret; - }, - singleAxis: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) { - var axis = axisModel.axis; - var rect = coordSysInfo.model.coordinateSystem.getRect(); - var ret = {}; - oldPoint = oldPoint || [0, 0]; - - if (axis.orient === 'horizontal') { - ret.pixel = newPoint[0] - oldPoint[0]; - ret.pixelLength = rect.width; - ret.pixelStart = rect.x; - ret.signal = axis.inverse ? 1 : -1; - } else { - // 'vertical' - ret.pixel = newPoint[1] - oldPoint[1]; - ret.pixelLength = rect.height; - ret.pixelStart = rect.y; - ret.signal = axis.inverse ? -1 : 1; - } + ret.pixelLength = radiusExtent[1] - radiusExtent[0]; + ret.pixelStart = radiusExtent[0]; + ret.signal = axis.inverse ? 1 : -1; + } else { + // 'angleAxis' + ret.pixel = newPoint[1] - oldPoint[1]; // ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]); + // ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]); + + ret.pixelLength = angleExtent[1] - angleExtent[0]; + ret.pixelStart = angleExtent[0]; + ret.signal = axis.inverse ? -1 : 1; + } + + return ret; + }, + singleAxis: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) { + var axis = axisModel.axis; + var rect = coordSysInfo.model.coordinateSystem.getRect(); + var ret = {}; + oldPoint = oldPoint || [0, 0]; - return ret; + if (axis.orient === 'horizontal') { + ret.pixel = newPoint[0] - oldPoint[0]; + ret.pixelLength = rect.width; + ret.pixelStart = rect.x; + ret.signal = axis.inverse ? 1 : -1; + } else { + // 'vertical' + ret.pixel = newPoint[1] - oldPoint[1]; + ret.pixelLength = rect.height; + ret.pixelStart = rect.y; + ret.signal = axis.inverse ? -1 : 1; } + + return ret; + } }; function install$K(registers) { - installCommon(registers); - registers.registerComponentModel(InsideZoomModel); - registers.registerComponentView(InsideZoomView); - installDataZoomRoamProcessor(registers); + installCommon(registers); + registers.registerComponentModel(InsideZoomModel); + registers.registerComponentView(InsideZoomView); + installDataZoomRoamProcessor(registers); } var SliderZoomModel = - /** @class */ - function (_super) { - __extends(SliderZoomModel, _super); + /** @class */ + function (_super) { + __extends(SliderZoomModel, _super); - function SliderZoomModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function SliderZoomModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = SliderZoomModel.type; - return _this; - } + _this.type = SliderZoomModel.type; + return _this; + } - SliderZoomModel.type = 'dataZoom.slider'; - SliderZoomModel.layoutMode = 'box'; - SliderZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, { - show: true, - // deault value can only be drived in view stage. - right: 'ph', - top: 'ph', - width: 'ph', - height: 'ph', - left: null, - bottom: null, - borderColor: '#d2dbee', - borderRadius: 3, - backgroundColor: 'rgba(47,69,84,0)', - // dataBackgroundColor: '#ddd', - dataBackground: { - lineStyle: { - color: '#d2dbee', - width: 0.5 - }, - areaStyle: { - color: '#d2dbee', - opacity: 0.2 - } - }, - selectedDataBackground: { - lineStyle: { - color: '#8fb0f7', - width: 0.5 - }, - areaStyle: { - color: '#8fb0f7', - opacity: 0.2 - } - }, - // Color of selected window. - fillerColor: 'rgba(135,175,274,0.2)', - handleIcon: 'path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z', - // Percent of the slider height - handleSize: '100%', - handleStyle: { - color: '#fff', - borderColor: '#ACB8D1' - }, - moveHandleSize: 7, - moveHandleIcon: 'path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z', - moveHandleStyle: { - color: '#D2DBEE', - opacity: 0.7 - }, - showDetail: true, - showDataShadow: 'auto', - realtime: true, - zoomLock: false, - textStyle: { - color: '#6E7079' - }, - brushSelect: true, - brushStyle: { - color: 'rgba(135,175,274,0.15)' - }, - emphasis: { - handleStyle: { - borderColor: '#8FB0F7' - }, - moveHandleStyle: { - color: '#8FB0F7' - } - } - }); - return SliderZoomModel; - }(DataZoomModel); + SliderZoomModel.type = 'dataZoom.slider'; + SliderZoomModel.layoutMode = 'box'; + SliderZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, { + show: true, + // deault value can only be drived in view stage. + right: 'ph', + top: 'ph', + width: 'ph', + height: 'ph', + left: null, + bottom: null, + borderColor: '#d2dbee', + borderRadius: 3, + backgroundColor: 'rgba(47,69,84,0)', + // dataBackgroundColor: '#ddd', + dataBackground: { + lineStyle: { + color: '#d2dbee', + width: 0.5 + }, + areaStyle: { + color: '#d2dbee', + opacity: 0.2 + } + }, + selectedDataBackground: { + lineStyle: { + color: '#8fb0f7', + width: 0.5 + }, + areaStyle: { + color: '#8fb0f7', + opacity: 0.2 + } + }, + // Color of selected window. + fillerColor: 'rgba(135,175,274,0.2)', + handleIcon: 'path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z', + // Percent of the slider height + handleSize: '100%', + handleStyle: { + color: '#fff', + borderColor: '#ACB8D1' + }, + moveHandleSize: 7, + moveHandleIcon: 'path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z', + moveHandleStyle: { + color: '#D2DBEE', + opacity: 0.7 + }, + showDetail: true, + showDataShadow: 'auto', + realtime: true, + zoomLock: false, + textStyle: { + color: '#6E7079' + }, + brushSelect: true, + brushStyle: { + color: 'rgba(135,175,274,0.15)' + }, + emphasis: { + handleStyle: { + borderColor: '#8FB0F7' + }, + moveHandleStyle: { + color: '#8FB0F7' + } + } + }); + return SliderZoomModel; + }(DataZoomModel); var Rect$2 = Rect; // Constants @@ -88932,922 +88932,922 @@ var LABEL_GAP = 5; var SHOW_DATA_SHADOW_SERIES_TYPE = ['line', 'bar', 'candlestick', 'scatter']; var REALTIME_ANIMATION_CONFIG = { - easing: 'cubicOut', - duration: 100, - delay: 0 + easing: 'cubicOut', + duration: 100, + delay: 0 }; var SliderZoomView = - /** @class */ - function (_super) { - __extends(SliderZoomView, _super); - - function SliderZoomView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = SliderZoomView.type; - _this._displayables = {}; - return _this; - } - - SliderZoomView.prototype.init = function (ecModel, api) { - this.api = api; // A unique handler for each dataZoom component - - this._onBrush = bind(this._onBrush, this); - this._onBrushEnd = bind(this._onBrushEnd, this); - }; - - SliderZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) { - _super.prototype.render.apply(this, arguments); - - createOrUpdate(this, '_dispatchZoomAction', dataZoomModel.get('throttle'), 'fixRate'); - this._orient = dataZoomModel.getOrient(); - - if (dataZoomModel.get('show') === false) { - this.group.removeAll(); - return; - } - - if (dataZoomModel.noTarget()) { - this._clear(); - - this.group.removeAll(); - return; - } // Notice: this._resetInterval() should not be executed when payload.type - // is 'dataZoom', origin this._range should be maintained, otherwise 'pan' - // or 'zoom' info will be missed because of 'throttle' of this.dispatchAction, - - - if (!payload || payload.type !== 'dataZoom' || payload.from !== this.uid) { - this._buildView(); - } - - this._updateView(); - }; + /** @class */ + function (_super) { + __extends(SliderZoomView, _super); - SliderZoomView.prototype.dispose = function () { - this._clear(); + function SliderZoomView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _super.prototype.dispose.apply(this, arguments); - }; - - SliderZoomView.prototype._clear = function () { - clear(this, '_dispatchZoomAction'); - var zr = this.api.getZr(); - zr.off('mousemove', this._onBrush); - zr.off('mouseup', this._onBrushEnd); - }; - - SliderZoomView.prototype._buildView = function () { - var thisGroup = this.group; - thisGroup.removeAll(); - this._brushing = false; - this._displayables.brushRect = null; - - this._resetLocation(); - - this._resetInterval(); - - var barGroup = this._displayables.sliderGroup = new Group(); - - this._renderBackground(); + _this.type = SliderZoomView.type; + _this._displayables = {}; + return _this; + } - this._renderHandle(); + SliderZoomView.prototype.init = function (ecModel, api) { + this.api = api; // A unique handler for each dataZoom component - this._renderDataShadow(); + this._onBrush = bind(this._onBrush, this); + this._onBrushEnd = bind(this._onBrushEnd, this); + }; - thisGroup.add(barGroup); + SliderZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) { + _super.prototype.render.apply(this, arguments); - this._positionGroup(); - }; + createOrUpdate(this, '_dispatchZoomAction', dataZoomModel.get('throttle'), 'fixRate'); + this._orient = dataZoomModel.getOrient(); - SliderZoomView.prototype._resetLocation = function () { - var dataZoomModel = this.dataZoomModel; - var api = this.api; - var showMoveHandle = dataZoomModel.get('brushSelect'); - var moveHandleSize = showMoveHandle ? DEFAULT_MOVE_HANDLE_SIZE : 0; // If some of x/y/width/height are not specified, - // auto-adapt according to target grid. - - var coordRect = this._findCoordRect(); - - var ecSize = { - width: api.getWidth(), - height: api.getHeight() - }; // Default align by coordinate system rect. - - var positionInfo = this._orient === HORIZONTAL ? { - // Why using 'right', because right should be used in vertical, - // and it is better to be consistent for dealing with position param merge. - right: ecSize.width - coordRect.x - coordRect.width, - top: ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP - moveHandleSize, - width: coordRect.width, - height: DEFAULT_FILLER_SIZE - } : { - right: DEFAULT_LOCATION_EDGE_GAP, - top: coordRect.y, - width: DEFAULT_FILLER_SIZE, - height: coordRect.height - }; // Do not write back to option and replace value 'ph', because - // the 'ph' value should be recalculated when resize. - - var layoutParams = getLayoutParams(dataZoomModel.option); // Replace the placeholder value. - - each(['right', 'top', 'width', 'height'], function (name) { - if (layoutParams[name] === 'ph') { - layoutParams[name] = positionInfo[name]; - } - }); - var layoutRect = getLayoutRect(layoutParams, ecSize); - this._location = { - x: layoutRect.x, - y: layoutRect.y - }; - this._size = [layoutRect.width, layoutRect.height]; - this._orient === VERTICAL && this._size.reverse(); - }; + if (dataZoomModel.get('show') === false) { + this.group.removeAll(); + return; + } - SliderZoomView.prototype._positionGroup = function () { - var thisGroup = this.group; - var location = this._location; - var orient = this._orient; // Just use the first axis to determine mapping. - - var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel(); - var inverse = targetAxisModel && targetAxisModel.get('inverse'); - var sliderGroup = this._displayables.sliderGroup; - var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse; // Transform barGroup. - - sliderGroup.attr(orient === HORIZONTAL && !inverse ? { - scaleY: otherAxisInverse ? 1 : -1, - scaleX: 1 - } : orient === HORIZONTAL && inverse ? { - scaleY: otherAxisInverse ? 1 : -1, - scaleX: -1 - } : orient === VERTICAL && !inverse ? { - scaleY: otherAxisInverse ? -1 : 1, - scaleX: 1, - rotation: Math.PI / 2 - } // Dont use Math.PI, considering shadow direction. - : { - scaleY: otherAxisInverse ? -1 : 1, - scaleX: -1, - rotation: Math.PI / 2 - }); // Position barGroup - - var rect = thisGroup.getBoundingRect([sliderGroup]); - thisGroup.x = location.x - rect.x; - thisGroup.y = location.y - rect.y; - thisGroup.markRedraw(); - }; + if (dataZoomModel.noTarget()) { + this._clear(); - SliderZoomView.prototype._getViewExtent = function () { - return [0, this._size[0]]; - }; + this.group.removeAll(); + return; + } // Notice: this._resetInterval() should not be executed when payload.type + // is 'dataZoom', origin this._range should be maintained, otherwise 'pan' + // or 'zoom' info will be missed because of 'throttle' of this.dispatchAction, - SliderZoomView.prototype._renderBackground = function () { - var dataZoomModel = this.dataZoomModel; - var size = this._size; - var barGroup = this._displayables.sliderGroup; - var brushSelect = dataZoomModel.get('brushSelect'); - barGroup.add(new Rect$2({ - silent: true, - shape: { - x: 0, - y: 0, - width: size[0], - height: size[1] - }, - style: { - fill: dataZoomModel.get('backgroundColor') - }, - z2: -40 - })); // Click panel, over shadow, below handles. - - var clickPanel = new Rect$2({ - shape: { - x: 0, - y: 0, - width: size[0], - height: size[1] - }, - style: { - fill: 'transparent' - }, - z2: 0, - onclick: bind(this._onClickPanel, this) - }); - var zr = this.api.getZr(); - if (brushSelect) { - clickPanel.on('mousedown', this._onBrushStart, this); - clickPanel.cursor = 'crosshair'; - zr.on('mousemove', this._onBrush); - zr.on('mouseup', this._onBrushEnd); - } else { - zr.off('mousemove', this._onBrush); - zr.off('mouseup', this._onBrushEnd); - } + if (!payload || payload.type !== 'dataZoom' || payload.from !== this.uid) { + this._buildView(); + } - barGroup.add(clickPanel); - }; + this._updateView(); + }; - SliderZoomView.prototype._renderDataShadow = function () { - var info = this._dataShadowInfo = this._prepareDataShadowInfo(); + SliderZoomView.prototype.dispose = function () { + this._clear(); - this._displayables.dataShadowSegs = []; + _super.prototype.dispose.apply(this, arguments); + }; - if (!info) { - return; - } + SliderZoomView.prototype._clear = function () { + clear(this, '_dispatchZoomAction'); + var zr = this.api.getZr(); + zr.off('mousemove', this._onBrush); + zr.off('mouseup', this._onBrushEnd); + }; - var size = this._size; - var oldSize = this._shadowSize || []; - var seriesModel = info.series; - var data = seriesModel.getRawData(); - var otherDim = seriesModel.getShadowDim ? seriesModel.getShadowDim() // @see candlestick - : info.otherDim; + SliderZoomView.prototype._buildView = function () { + var thisGroup = this.group; + thisGroup.removeAll(); + this._brushing = false; + this._displayables.brushRect = null; - if (otherDim == null) { - return; - } + this._resetLocation(); - var polygonPts = this._shadowPolygonPts; - var polylinePts = this._shadowPolylinePts; // Not re-render if data doesn't change. + this._resetInterval(); - if (data !== this._shadowData || otherDim !== this._shadowDim || size[0] !== oldSize[0] || size[1] !== oldSize[1]) { - var otherDataExtent_1 = data.getDataExtent(otherDim); // Nice extent. + var barGroup = this._displayables.sliderGroup = new Group(); - var otherOffset = (otherDataExtent_1[1] - otherDataExtent_1[0]) * 0.3; - otherDataExtent_1 = [otherDataExtent_1[0] - otherOffset, otherDataExtent_1[1] + otherOffset]; - var otherShadowExtent_1 = [0, size[1]]; - var thisShadowExtent = [0, size[0]]; - var areaPoints_1 = [[size[0], 0], [0, 0]]; - var linePoints_1 = []; - var step_1 = thisShadowExtent[1] / (data.count() - 1); - var thisCoord_1 = 0; // Optimize for large data shadow + this._renderBackground(); - var stride_1 = Math.round(data.count() / size[0]); - var lastIsEmpty_1; - data.each([otherDim], function (value, index) { - if (stride_1 > 0 && index % stride_1) { - thisCoord_1 += step_1; - return; - } // FIXME - // Should consider axis.min/axis.max when drawing dataShadow. - // FIXME - // 应该使用统一的空判断?还是在list里进行空判断? + this._renderHandle(); + this._renderDataShadow(); - var isEmpty = value == null || isNaN(value) || value === ''; // See #4235. + thisGroup.add(barGroup); - var otherCoord = isEmpty ? 0 : linearMap(value, otherDataExtent_1, otherShadowExtent_1, true); // Attempt to draw data shadow precisely when there are empty value. + this._positionGroup(); + }; - if (isEmpty && !lastIsEmpty_1 && index) { - areaPoints_1.push([areaPoints_1[areaPoints_1.length - 1][0], 0]); - linePoints_1.push([linePoints_1[linePoints_1.length - 1][0], 0]); - } else if (!isEmpty && lastIsEmpty_1) { - areaPoints_1.push([thisCoord_1, 0]); - linePoints_1.push([thisCoord_1, 0]); - } + SliderZoomView.prototype._resetLocation = function () { + var dataZoomModel = this.dataZoomModel; + var api = this.api; + var showMoveHandle = dataZoomModel.get('brushSelect'); + var moveHandleSize = showMoveHandle ? DEFAULT_MOVE_HANDLE_SIZE : 0; // If some of x/y/width/height are not specified, + // auto-adapt according to target grid. - areaPoints_1.push([thisCoord_1, otherCoord]); - linePoints_1.push([thisCoord_1, otherCoord]); - thisCoord_1 += step_1; - lastIsEmpty_1 = isEmpty; - }); - polygonPts = this._shadowPolygonPts = areaPoints_1; - polylinePts = this._shadowPolylinePts = linePoints_1; - } + var coordRect = this._findCoordRect(); - this._shadowData = data; - this._shadowDim = otherDim; - this._shadowSize = [size[0], size[1]]; - var dataZoomModel = this.dataZoomModel; + var ecSize = { + width: api.getWidth(), + height: api.getHeight() + }; // Default align by coordinate system rect. + + var positionInfo = this._orient === HORIZONTAL ? { + // Why using 'right', because right should be used in vertical, + // and it is better to be consistent for dealing with position param merge. + right: ecSize.width - coordRect.x - coordRect.width, + top: ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP - moveHandleSize, + width: coordRect.width, + height: DEFAULT_FILLER_SIZE + } : { + right: DEFAULT_LOCATION_EDGE_GAP, + top: coordRect.y, + width: DEFAULT_FILLER_SIZE, + height: coordRect.height + }; // Do not write back to option and replace value 'ph', because + // the 'ph' value should be recalculated when resize. + + var layoutParams = getLayoutParams(dataZoomModel.option); // Replace the placeholder value. + + each(['right', 'top', 'width', 'height'], function (name) { + if (layoutParams[name] === 'ph') { + layoutParams[name] = positionInfo[name]; + } + }); + var layoutRect = getLayoutRect(layoutParams, ecSize); + this._location = { + x: layoutRect.x, + y: layoutRect.y + }; + this._size = [layoutRect.width, layoutRect.height]; + this._orient === VERTICAL && this._size.reverse(); + }; + + SliderZoomView.prototype._positionGroup = function () { + var thisGroup = this.group; + var location = this._location; + var orient = this._orient; // Just use the first axis to determine mapping. + + var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel(); + var inverse = targetAxisModel && targetAxisModel.get('inverse'); + var sliderGroup = this._displayables.sliderGroup; + var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse; // Transform barGroup. + + sliderGroup.attr(orient === HORIZONTAL && !inverse ? { + scaleY: otherAxisInverse ? 1 : -1, + scaleX: 1 + } : orient === HORIZONTAL && inverse ? { + scaleY: otherAxisInverse ? 1 : -1, + scaleX: -1 + } : orient === VERTICAL && !inverse ? { + scaleY: otherAxisInverse ? -1 : 1, + scaleX: 1, + rotation: Math.PI / 2 + } // Dont use Math.PI, considering shadow direction. + : { + scaleY: otherAxisInverse ? -1 : 1, + scaleX: -1, + rotation: Math.PI / 2 + }); // Position barGroup + + var rect = thisGroup.getBoundingRect([sliderGroup]); + thisGroup.x = location.x - rect.x; + thisGroup.y = location.y - rect.y; + thisGroup.markRedraw(); + }; + + SliderZoomView.prototype._getViewExtent = function () { + return [0, this._size[0]]; + }; + + SliderZoomView.prototype._renderBackground = function () { + var dataZoomModel = this.dataZoomModel; + var size = this._size; + var barGroup = this._displayables.sliderGroup; + var brushSelect = dataZoomModel.get('brushSelect'); + barGroup.add(new Rect$2({ + silent: true, + shape: { + x: 0, + y: 0, + width: size[0], + height: size[1] + }, + style: { + fill: dataZoomModel.get('backgroundColor') + }, + z2: -40 + })); // Click panel, over shadow, below handles. + + var clickPanel = new Rect$2({ + shape: { + x: 0, + y: 0, + width: size[0], + height: size[1] + }, + style: { + fill: 'transparent' + }, + z2: 0, + onclick: bind(this._onClickPanel, this) + }); + var zr = this.api.getZr(); - function createDataShadowGroup(isSelectedArea) { - var model = dataZoomModel.getModel(isSelectedArea ? 'selectedDataBackground' : 'dataBackground'); - var group = new Group(); - var polygon = new Polygon({ - shape: { - points: polygonPts - }, - segmentIgnoreThreshold: 1, - style: model.getModel('areaStyle').getAreaStyle(), - silent: true, - z2: -20 - }); - var polyline = new Polyline({ - shape: { - points: polylinePts - }, - segmentIgnoreThreshold: 1, - style: model.getModel('lineStyle').getLineStyle(), - silent: true, - z2: -19 - }); - group.add(polygon); - group.add(polyline); - return group; - } // let dataBackgroundModel = dataZoomModel.getModel('dataBackground'); + if (brushSelect) { + clickPanel.on('mousedown', this._onBrushStart, this); + clickPanel.cursor = 'crosshair'; + zr.on('mousemove', this._onBrush); + zr.on('mouseup', this._onBrushEnd); + } else { + zr.off('mousemove', this._onBrush); + zr.off('mouseup', this._onBrushEnd); + } + barGroup.add(clickPanel); + }; - for (var i = 0; i < 3; i++) { - var group = createDataShadowGroup(i === 1); + SliderZoomView.prototype._renderDataShadow = function () { + var info = this._dataShadowInfo = this._prepareDataShadowInfo(); - this._displayables.sliderGroup.add(group); + this._displayables.dataShadowSegs = []; - this._displayables.dataShadowSegs.push(group); - } - }; + if (!info) { + return; + } - SliderZoomView.prototype._prepareDataShadowInfo = function () { - var dataZoomModel = this.dataZoomModel; - var showDataShadow = dataZoomModel.get('showDataShadow'); + var size = this._size; + var oldSize = this._shadowSize || []; + var seriesModel = info.series; + var data = seriesModel.getRawData(); + var otherDim = seriesModel.getShadowDim ? seriesModel.getShadowDim() // @see candlestick + : info.otherDim; + + if (otherDim == null) { + return; + } + + var polygonPts = this._shadowPolygonPts; + var polylinePts = this._shadowPolylinePts; // Not re-render if data doesn't change. + + if (data !== this._shadowData || otherDim !== this._shadowDim || size[0] !== oldSize[0] || size[1] !== oldSize[1]) { + var otherDataExtent_1 = data.getDataExtent(otherDim); // Nice extent. + + var otherOffset = (otherDataExtent_1[1] - otherDataExtent_1[0]) * 0.3; + otherDataExtent_1 = [otherDataExtent_1[0] - otherOffset, otherDataExtent_1[1] + otherOffset]; + var otherShadowExtent_1 = [0, size[1]]; + var thisShadowExtent = [0, size[0]]; + var areaPoints_1 = [[size[0], 0], [0, 0]]; + var linePoints_1 = []; + var step_1 = thisShadowExtent[1] / (data.count() - 1); + var thisCoord_1 = 0; // Optimize for large data shadow + + var stride_1 = Math.round(data.count() / size[0]); + var lastIsEmpty_1; + data.each([otherDim], function (value, index) { + if (stride_1 > 0 && index % stride_1) { + thisCoord_1 += step_1; + return; + } // FIXME + // Should consider axis.min/axis.max when drawing dataShadow. + // FIXME + // 应该使用统一的空判断?还是在list里进行空判断? - if (showDataShadow === false) { - return; - } // Find a representative series. + var isEmpty = value == null || isNaN(value) || value === ''; // See #4235. - var result; - var ecModel = this.ecModel; - dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { - var seriesModels = dataZoomModel.getAxisProxy(axisDim, axisIndex).getTargetSeriesModels(); - each(seriesModels, function (seriesModel) { - if (result) { - return; - } + var otherCoord = isEmpty ? 0 : linearMap(value, otherDataExtent_1, otherShadowExtent_1, true); // Attempt to draw data shadow precisely when there are empty value. - if (showDataShadow !== true && indexOf(SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type')) < 0) { - return; - } + if (isEmpty && !lastIsEmpty_1 && index) { + areaPoints_1.push([areaPoints_1[areaPoints_1.length - 1][0], 0]); + linePoints_1.push([linePoints_1[linePoints_1.length - 1][0], 0]); + } else if (!isEmpty && lastIsEmpty_1) { + areaPoints_1.push([thisCoord_1, 0]); + linePoints_1.push([thisCoord_1, 0]); + } - var thisAxis = ecModel.getComponent(getAxisMainType(axisDim), axisIndex).axis; - var otherDim = getOtherDim(axisDim); - var otherAxisInverse; - var coordSys = seriesModel.coordinateSystem; + areaPoints_1.push([thisCoord_1, otherCoord]); + linePoints_1.push([thisCoord_1, otherCoord]); + thisCoord_1 += step_1; + lastIsEmpty_1 = isEmpty; + }); + polygonPts = this._shadowPolygonPts = areaPoints_1; + polylinePts = this._shadowPolylinePts = linePoints_1; + } - if (otherDim != null && coordSys.getOtherAxis) { - otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse; - } + this._shadowData = data; + this._shadowDim = otherDim; + this._shadowSize = [size[0], size[1]]; + var dataZoomModel = this.dataZoomModel; - otherDim = seriesModel.getData().mapDimension(otherDim); - result = { - thisAxis: thisAxis, - series: seriesModel, - thisDim: axisDim, - otherDim: otherDim, - otherAxisInverse: otherAxisInverse - }; - }, this); - }, this); - return result; - }; + function createDataShadowGroup(isSelectedArea) { + var model = dataZoomModel.getModel(isSelectedArea ? 'selectedDataBackground' : 'dataBackground'); + var group = new Group(); + var polygon = new Polygon({ + shape: { + points: polygonPts + }, + segmentIgnoreThreshold: 1, + style: model.getModel('areaStyle').getAreaStyle(), + silent: true, + z2: -20 + }); + var polyline = new Polyline({ + shape: { + points: polylinePts + }, + segmentIgnoreThreshold: 1, + style: model.getModel('lineStyle').getLineStyle(), + silent: true, + z2: -19 + }); + group.add(polygon); + group.add(polyline); + return group; + } // let dataBackgroundModel = dataZoomModel.getModel('dataBackground'); - SliderZoomView.prototype._renderHandle = function () { - var thisGroup = this.group; - var displayables = this._displayables; - var handles = displayables.handles = [null, null]; - var handleLabels = displayables.handleLabels = [null, null]; - var sliderGroup = this._displayables.sliderGroup; - var size = this._size; - var dataZoomModel = this.dataZoomModel; - var api = this.api; - var borderRadius = dataZoomModel.get('borderRadius') || 0; - var brushSelect = dataZoomModel.get('brushSelect'); - var filler = displayables.filler = new Rect$2({ - silent: brushSelect, - style: { - fill: dataZoomModel.get('fillerColor') - }, - textConfig: { - position: 'inside' - } - }); - sliderGroup.add(filler); // Frame border. - - sliderGroup.add(new Rect$2({ - silent: true, - subPixelOptimize: true, - shape: { - x: 0, - y: 0, - width: size[0], - height: size[1], - r: borderRadius - }, - style: { - stroke: dataZoomModel.get('dataBackgroundColor') // deprecated option - || dataZoomModel.get('borderColor'), - lineWidth: DEFAULT_FRAME_BORDER_WIDTH, - fill: 'rgba(0,0,0,0)' - } - })); // Left and right handle to resize - each([0, 1], function (handleIndex) { - var iconStr = dataZoomModel.get('handleIcon'); + for (var i = 0; i < 3; i++) { + var group = createDataShadowGroup(i === 1); - if (!symbolBuildProxies[iconStr] && iconStr.indexOf('path://') < 0 && iconStr.indexOf('image://') < 0) { - // Compatitable with the old icon parsers. Which can use a path string without path:// - iconStr = 'path://' + iconStr; + this._displayables.sliderGroup.add(group); - if ("development" !== 'production') { - deprecateLog('handleIcon now needs \'path://\' prefix when using a path string'); - } - } + this._displayables.dataShadowSegs.push(group); + } + }; - var path = createSymbol(iconStr, -1, 0, 2, 2, null, true); - path.attr({ - cursor: getCursor(this._orient), - draggable: true, - drift: bind(this._onDragMove, this, handleIndex), - ondragend: bind(this._onDragEnd, this), - onmouseover: bind(this._showDataInfo, this, true), - onmouseout: bind(this._showDataInfo, this, false), - z2: 5 - }); - var bRect = path.getBoundingRect(); - var handleSize = dataZoomModel.get('handleSize'); - this._handleHeight = parsePercent$1(handleSize, this._size[1]); - this._handleWidth = bRect.width / bRect.height * this._handleHeight; - path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle()); - path.style.strokeNoScale = true; - path.rectHover = true; - path.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'handleStyle']).getItemStyle(); - enableHoverEmphasis(path); - var handleColor = dataZoomModel.get('handleColor'); // deprecated option - // Compatitable with previous version - - if (handleColor != null) { - path.style.fill = handleColor; - } + SliderZoomView.prototype._prepareDataShadowInfo = function () { + var dataZoomModel = this.dataZoomModel; + var showDataShadow = dataZoomModel.get('showDataShadow'); - sliderGroup.add(handles[handleIndex] = path); - var textStyleModel = dataZoomModel.getModel('textStyle'); - thisGroup.add(handleLabels[handleIndex] = new ZRText({ - silent: true, - invisible: true, - style: createTextStyle(textStyleModel, { - x: 0, - y: 0, - text: '', - verticalAlign: 'middle', - align: 'center', - fill: textStyleModel.getTextColor(), - font: textStyleModel.getFont() - }), - z2: 10 - })); - }, this); // Handle to move. Only visible when brushSelect is set true. - - var actualMoveZone = filler; - - if (brushSelect) { - var moveHandleHeight = parsePercent$1(dataZoomModel.get('moveHandleSize'), size[1]); - var moveHandle_1 = displayables.moveHandle = new Rect({ - style: dataZoomModel.getModel('moveHandleStyle').getItemStyle(), - silent: true, - shape: { - r: [0, 0, 2, 2], - y: size[1] - 0.5, - height: moveHandleHeight - } - }); - var iconSize = moveHandleHeight * 0.8; - var moveHandleIcon = displayables.moveHandleIcon = createSymbol(dataZoomModel.get('moveHandleIcon'), -iconSize / 2, -iconSize / 2, iconSize, iconSize, '#fff', true); - moveHandleIcon.silent = true; - moveHandleIcon.y = size[1] + moveHandleHeight / 2 - 0.5; - moveHandle_1.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'moveHandleStyle']).getItemStyle(); - var moveZoneExpandSize = Math.min(size[1] / 2, Math.max(moveHandleHeight, 10)); - actualMoveZone = displayables.moveZone = new Rect({ - invisible: true, - shape: { - y: size[1] - moveZoneExpandSize, - height: moveHandleHeight + moveZoneExpandSize - } - }); - actualMoveZone.on('mouseover', function () { - api.enterEmphasis(moveHandle_1); - }).on('mouseout', function () { - api.leaveEmphasis(moveHandle_1); - }); - sliderGroup.add(moveHandle_1); - sliderGroup.add(moveHandleIcon); - sliderGroup.add(actualMoveZone); - } - - actualMoveZone.attr({ - draggable: true, - cursor: getCursor(this._orient), - drift: bind(this._onDragMove, this, 'all'), - ondragstart: bind(this._showDataInfo, this, true), - ondragend: bind(this._onDragEnd, this), - onmouseover: bind(this._showDataInfo, this, true), - onmouseout: bind(this._showDataInfo, this, false) - }); - }; + if (showDataShadow === false) { + return; + } // Find a representative series. - SliderZoomView.prototype._resetInterval = function () { - var range = this._range = this.dataZoomModel.getPercentRange(); - var viewExtent = this._getViewExtent(); + var result; + var ecModel = this.ecModel; + dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) { + var seriesModels = dataZoomModel.getAxisProxy(axisDim, axisIndex).getTargetSeriesModels(); + each(seriesModels, function (seriesModel) { + if (result) { + return; + } - this._handleEnds = [linearMap(range[0], [0, 100], viewExtent, true), linearMap(range[1], [0, 100], viewExtent, true)]; - }; + if (showDataShadow !== true && indexOf(SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type')) < 0) { + return; + } - SliderZoomView.prototype._updateInterval = function (handleIndex, delta) { - var dataZoomModel = this.dataZoomModel; - var handleEnds = this._handleEnds; + var thisAxis = ecModel.getComponent(getAxisMainType(axisDim), axisIndex).axis; + var otherDim = getOtherDim(axisDim); + var otherAxisInverse; + var coordSys = seriesModel.coordinateSystem; - var viewExtend = this._getViewExtent(); + if (otherDim != null && coordSys.getOtherAxis) { + otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse; + } - var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan(); - var percentExtent = [0, 100]; - sliderMove(delta, handleEnds, viewExtend, dataZoomModel.get('zoomLock') ? 'all' : handleIndex, minMaxSpan.minSpan != null ? linearMap(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, minMaxSpan.maxSpan != null ? linearMap(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null); - var lastRange = this._range; - var range = this._range = asc([linearMap(handleEnds[0], viewExtend, percentExtent, true), linearMap(handleEnds[1], viewExtend, percentExtent, true)]); - return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1]; + otherDim = seriesModel.getData().mapDimension(otherDim); + result = { + thisAxis: thisAxis, + series: seriesModel, + thisDim: axisDim, + otherDim: otherDim, + otherAxisInverse: otherAxisInverse }; + }, this); + }, this); + return result; + }; + + SliderZoomView.prototype._renderHandle = function () { + var thisGroup = this.group; + var displayables = this._displayables; + var handles = displayables.handles = [null, null]; + var handleLabels = displayables.handleLabels = [null, null]; + var sliderGroup = this._displayables.sliderGroup; + var size = this._size; + var dataZoomModel = this.dataZoomModel; + var api = this.api; + var borderRadius = dataZoomModel.get('borderRadius') || 0; + var brushSelect = dataZoomModel.get('brushSelect'); + var filler = displayables.filler = new Rect$2({ + silent: brushSelect, + style: { + fill: dataZoomModel.get('fillerColor') + }, + textConfig: { + position: 'inside' + } + }); + sliderGroup.add(filler); // Frame border. - SliderZoomView.prototype._updateView = function (nonRealtime) { - var displaybles = this._displayables; - var handleEnds = this._handleEnds; - var handleInterval = asc(handleEnds.slice()); - var size = this._size; - each([0, 1], function (handleIndex) { - // Handles - var handle = displaybles.handles[handleIndex]; - var handleHeight = this._handleHeight; - handle.attr({ - scaleX: handleHeight / 2, - scaleY: handleHeight / 2, - // This is a trick, by adding an extra tiny offset to let the default handle's end point align to the drag window. - // NOTE: It may affect some custom shapes a bit. But we prefer to have better result by default. - x: handleEnds[handleIndex] + (handleIndex ? -1 : 1), - y: size[1] / 2 - handleHeight / 2 - }); - }, this); // Filler - - displaybles.filler.setShape({ - x: handleInterval[0], - y: 0, - width: handleInterval[1] - handleInterval[0], - height: size[1] - }); - var viewExtent = { - x: handleInterval[0], - width: handleInterval[1] - handleInterval[0] - }; // Move handle - - if (displaybles.moveHandle) { - displaybles.moveHandle.setShape(viewExtent); - displaybles.moveZone.setShape(viewExtent); // Force update path on the invisible object - - displaybles.moveZone.getBoundingRect(); - displaybles.moveHandleIcon && displaybles.moveHandleIcon.attr('x', viewExtent.x + viewExtent.width / 2); - } // update clip path of shadow. + sliderGroup.add(new Rect$2({ + silent: true, + subPixelOptimize: true, + shape: { + x: 0, + y: 0, + width: size[0], + height: size[1], + r: borderRadius + }, + style: { + stroke: dataZoomModel.get('dataBackgroundColor') // deprecated option + || dataZoomModel.get('borderColor'), + lineWidth: DEFAULT_FRAME_BORDER_WIDTH, + fill: 'rgba(0,0,0,0)' + } + })); // Left and right handle to resize + + each([0, 1], function (handleIndex) { + var iconStr = dataZoomModel.get('handleIcon'); + + if (!symbolBuildProxies[iconStr] && iconStr.indexOf('path://') < 0 && iconStr.indexOf('image://') < 0) { + // Compatitable with the old icon parsers. Which can use a path string without path:// + iconStr = 'path://' + iconStr; + if ("development" !== 'production') { + deprecateLog('handleIcon now needs \'path://\' prefix when using a path string'); + } + } - var dataShadowSegs = displaybles.dataShadowSegs; - var segIntervals = [0, handleInterval[0], handleInterval[1], size[0]]; + var path = createSymbol(iconStr, -1, 0, 2, 2, null, true); + path.attr({ + cursor: getCursor(this._orient), + draggable: true, + drift: bind(this._onDragMove, this, handleIndex), + ondragend: bind(this._onDragEnd, this), + onmouseover: bind(this._showDataInfo, this, true), + onmouseout: bind(this._showDataInfo, this, false), + z2: 5 + }); + var bRect = path.getBoundingRect(); + var handleSize = dataZoomModel.get('handleSize'); + this._handleHeight = parsePercent$1(handleSize, this._size[1]); + this._handleWidth = bRect.width / bRect.height * this._handleHeight; + path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle()); + path.style.strokeNoScale = true; + path.rectHover = true; + path.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'handleStyle']).getItemStyle(); + enableHoverEmphasis(path); + var handleColor = dataZoomModel.get('handleColor'); // deprecated option + // Compatitable with previous version + + if (handleColor != null) { + path.style.fill = handleColor; + } + + sliderGroup.add(handles[handleIndex] = path); + var textStyleModel = dataZoomModel.getModel('textStyle'); + thisGroup.add(handleLabels[handleIndex] = new ZRText({ + silent: true, + invisible: true, + style: createTextStyle(textStyleModel, { + x: 0, + y: 0, + text: '', + verticalAlign: 'middle', + align: 'center', + fill: textStyleModel.getTextColor(), + font: textStyleModel.getFont() + }), + z2: 10 + })); + }, this); // Handle to move. Only visible when brushSelect is set true. - for (var i = 0; i < dataShadowSegs.length; i++) { - var segGroup = dataShadowSegs[i]; - var clipPath = segGroup.getClipPath(); + var actualMoveZone = filler; - if (!clipPath) { - clipPath = new Rect(); - segGroup.setClipPath(clipPath); - } + if (brushSelect) { + var moveHandleHeight = parsePercent$1(dataZoomModel.get('moveHandleSize'), size[1]); + var moveHandle_1 = displayables.moveHandle = new Rect({ + style: dataZoomModel.getModel('moveHandleStyle').getItemStyle(), + silent: true, + shape: { + r: [0, 0, 2, 2], + y: size[1] - 0.5, + height: moveHandleHeight + } + }); + var iconSize = moveHandleHeight * 0.8; + var moveHandleIcon = displayables.moveHandleIcon = createSymbol(dataZoomModel.get('moveHandleIcon'), -iconSize / 2, -iconSize / 2, iconSize, iconSize, '#fff', true); + moveHandleIcon.silent = true; + moveHandleIcon.y = size[1] + moveHandleHeight / 2 - 0.5; + moveHandle_1.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'moveHandleStyle']).getItemStyle(); + var moveZoneExpandSize = Math.min(size[1] / 2, Math.max(moveHandleHeight, 10)); + actualMoveZone = displayables.moveZone = new Rect({ + invisible: true, + shape: { + y: size[1] - moveZoneExpandSize, + height: moveHandleHeight + moveZoneExpandSize + } + }); + actualMoveZone.on('mouseover', function () { + api.enterEmphasis(moveHandle_1); + }).on('mouseout', function () { + api.leaveEmphasis(moveHandle_1); + }); + sliderGroup.add(moveHandle_1); + sliderGroup.add(moveHandleIcon); + sliderGroup.add(actualMoveZone); + } + + actualMoveZone.attr({ + draggable: true, + cursor: getCursor(this._orient), + drift: bind(this._onDragMove, this, 'all'), + ondragstart: bind(this._showDataInfo, this, true), + ondragend: bind(this._onDragEnd, this), + onmouseover: bind(this._showDataInfo, this, true), + onmouseout: bind(this._showDataInfo, this, false) + }); + }; + + SliderZoomView.prototype._resetInterval = function () { + var range = this._range = this.dataZoomModel.getPercentRange(); + + var viewExtent = this._getViewExtent(); + + this._handleEnds = [linearMap(range[0], [0, 100], viewExtent, true), linearMap(range[1], [0, 100], viewExtent, true)]; + }; + + SliderZoomView.prototype._updateInterval = function (handleIndex, delta) { + var dataZoomModel = this.dataZoomModel; + var handleEnds = this._handleEnds; + + var viewExtend = this._getViewExtent(); + + var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan(); + var percentExtent = [0, 100]; + sliderMove(delta, handleEnds, viewExtend, dataZoomModel.get('zoomLock') ? 'all' : handleIndex, minMaxSpan.minSpan != null ? linearMap(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, minMaxSpan.maxSpan != null ? linearMap(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null); + var lastRange = this._range; + var range = this._range = asc([linearMap(handleEnds[0], viewExtend, percentExtent, true), linearMap(handleEnds[1], viewExtend, percentExtent, true)]); + return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1]; + }; + + SliderZoomView.prototype._updateView = function (nonRealtime) { + var displaybles = this._displayables; + var handleEnds = this._handleEnds; + var handleInterval = asc(handleEnds.slice()); + var size = this._size; + each([0, 1], function (handleIndex) { + // Handles + var handle = displaybles.handles[handleIndex]; + var handleHeight = this._handleHeight; + handle.attr({ + scaleX: handleHeight / 2, + scaleY: handleHeight / 2, + // This is a trick, by adding an extra tiny offset to let the default handle's end point align to the drag window. + // NOTE: It may affect some custom shapes a bit. But we prefer to have better result by default. + x: handleEnds[handleIndex] + (handleIndex ? -1 : 1), + y: size[1] / 2 - handleHeight / 2 + }); + }, this); // Filler + + displaybles.filler.setShape({ + x: handleInterval[0], + y: 0, + width: handleInterval[1] - handleInterval[0], + height: size[1] + }); + var viewExtent = { + x: handleInterval[0], + width: handleInterval[1] - handleInterval[0] + }; // Move handle - clipPath.setShape({ - x: segIntervals[i], - y: 0, - width: segIntervals[i + 1] - segIntervals[i], - height: size[1] - }); - } + if (displaybles.moveHandle) { + displaybles.moveHandle.setShape(viewExtent); + displaybles.moveZone.setShape(viewExtent); // Force update path on the invisible object - this._updateDataInfo(nonRealtime); - }; + displaybles.moveZone.getBoundingRect(); + displaybles.moveHandleIcon && displaybles.moveHandleIcon.attr('x', viewExtent.x + viewExtent.width / 2); + } // update clip path of shadow. - SliderZoomView.prototype._updateDataInfo = function (nonRealtime) { - var dataZoomModel = this.dataZoomModel; - var displaybles = this._displayables; - var handleLabels = displaybles.handleLabels; - var orient = this._orient; - var labelTexts = ['', '']; // FIXME - // date型,支持formatter,autoformatter(ec2 date.getAutoFormatter) - - if (dataZoomModel.get('showDetail')) { - var axisProxy = dataZoomModel.findRepresentativeAxisProxy(); - - if (axisProxy) { - var axis = axisProxy.getAxisModel().axis; - var range = this._range; - var dataInterval = nonRealtime // See #4434, data and axis are not processed and reset yet in non-realtime mode. - ? axisProxy.calculateDataWindow({ - start: range[0], - end: range[1] - }).valueWindow : axisProxy.getDataValueWindow(); - labelTexts = [this._formatLabel(dataInterval[0], axis), this._formatLabel(dataInterval[1], axis)]; - } - } - var orderedHandleEnds = asc(this._handleEnds.slice()); - setLabel.call(this, 0); - setLabel.call(this, 1); - - function setLabel(handleIndex) { - // Label - // Text should not transform by barGroup. - // Ignore handlers transform - var barTransform = getTransform(displaybles.handles[handleIndex].parent, this.group); - var direction = transformDirection(handleIndex === 0 ? 'right' : 'left', barTransform); - var offset = this._handleWidth / 2 + LABEL_GAP; - var textPoint = applyTransform$1([orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset), this._size[1] / 2], barTransform); - handleLabels[handleIndex].setStyle({ - x: textPoint[0], - y: textPoint[1], - verticalAlign: orient === HORIZONTAL ? 'middle' : direction, - align: orient === HORIZONTAL ? direction : 'center', - text: labelTexts[handleIndex] - }); - } - }; + var dataShadowSegs = displaybles.dataShadowSegs; + var segIntervals = [0, handleInterval[0], handleInterval[1], size[0]]; - SliderZoomView.prototype._formatLabel = function (value, axis) { - var dataZoomModel = this.dataZoomModel; - var labelFormatter = dataZoomModel.get('labelFormatter'); - var labelPrecision = dataZoomModel.get('labelPrecision'); + for (var i = 0; i < dataShadowSegs.length; i++) { + var segGroup = dataShadowSegs[i]; + var clipPath = segGroup.getClipPath(); - if (labelPrecision == null || labelPrecision === 'auto') { - labelPrecision = axis.getPixelPrecision(); - } + if (!clipPath) { + clipPath = new Rect(); + segGroup.setClipPath(clipPath); + } - var valueStr = value == null || isNaN(value) ? '' // FIXME Glue code - : axis.type === 'category' || axis.type === 'time' ? axis.scale.getLabel({ - value: Math.round(value) - }) // param of toFixed should less then 20. - : value.toFixed(Math.min(labelPrecision, 20)); - return isFunction(labelFormatter) ? labelFormatter(value, valueStr) : isString(labelFormatter) ? labelFormatter.replace('{value}', valueStr) : valueStr; - }; - /** - * @param showOrHide true: show, false: hide - */ + clipPath.setShape({ + x: segIntervals[i], + y: 0, + width: segIntervals[i + 1] - segIntervals[i], + height: size[1] + }); + } + + this._updateDataInfo(nonRealtime); + }; + + SliderZoomView.prototype._updateDataInfo = function (nonRealtime) { + var dataZoomModel = this.dataZoomModel; + var displaybles = this._displayables; + var handleLabels = displaybles.handleLabels; + var orient = this._orient; + var labelTexts = ['', '']; // FIXME + // date型,支持formatter,autoformatter(ec2 date.getAutoFormatter) + + if (dataZoomModel.get('showDetail')) { + var axisProxy = dataZoomModel.findRepresentativeAxisProxy(); + + if (axisProxy) { + var axis = axisProxy.getAxisModel().axis; + var range = this._range; + var dataInterval = nonRealtime // See #4434, data and axis are not processed and reset yet in non-realtime mode. + ? axisProxy.calculateDataWindow({ + start: range[0], + end: range[1] + }).valueWindow : axisProxy.getDataValueWindow(); + labelTexts = [this._formatLabel(dataInterval[0], axis), this._formatLabel(dataInterval[1], axis)]; + } + } + + var orderedHandleEnds = asc(this._handleEnds.slice()); + setLabel.call(this, 0); + setLabel.call(this, 1); + + function setLabel(handleIndex) { + // Label + // Text should not transform by barGroup. + // Ignore handlers transform + var barTransform = getTransform(displaybles.handles[handleIndex].parent, this.group); + var direction = transformDirection(handleIndex === 0 ? 'right' : 'left', barTransform); + var offset = this._handleWidth / 2 + LABEL_GAP; + var textPoint = applyTransform$1([orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset), this._size[1] / 2], barTransform); + handleLabels[handleIndex].setStyle({ + x: textPoint[0], + y: textPoint[1], + verticalAlign: orient === HORIZONTAL ? 'middle' : direction, + align: orient === HORIZONTAL ? direction : 'center', + text: labelTexts[handleIndex] + }); + } + }; + + SliderZoomView.prototype._formatLabel = function (value, axis) { + var dataZoomModel = this.dataZoomModel; + var labelFormatter = dataZoomModel.get('labelFormatter'); + var labelPrecision = dataZoomModel.get('labelPrecision'); + + if (labelPrecision == null || labelPrecision === 'auto') { + labelPrecision = axis.getPixelPrecision(); + } + + var valueStr = value == null || isNaN(value) ? '' // FIXME Glue code + : axis.type === 'category' || axis.type === 'time' ? axis.scale.getLabel({ + value: Math.round(value) + }) // param of toFixed should less then 20. + : value.toFixed(Math.min(labelPrecision, 20)); + return isFunction(labelFormatter) ? labelFormatter(value, valueStr) : isString(labelFormatter) ? labelFormatter.replace('{value}', valueStr) : valueStr; + }; + /** + * @param showOrHide true: show, false: hide + */ - SliderZoomView.prototype._showDataInfo = function (showOrHide) { - // Always show when drgging. - showOrHide = this._dragging || showOrHide; - var displayables = this._displayables; - var handleLabels = displayables.handleLabels; - handleLabels[0].attr('invisible', !showOrHide); - handleLabels[1].attr('invisible', !showOrHide); // Highlight move handle + SliderZoomView.prototype._showDataInfo = function (showOrHide) { + // Always show when drgging. + showOrHide = this._dragging || showOrHide; + var displayables = this._displayables; + var handleLabels = displayables.handleLabels; + handleLabels[0].attr('invisible', !showOrHide); + handleLabels[1].attr('invisible', !showOrHide); // Highlight move handle - displayables.moveHandle && this.api[showOrHide ? 'enterEmphasis' : 'leaveEmphasis'](displayables.moveHandle, 1); - }; + displayables.moveHandle && this.api[showOrHide ? 'enterEmphasis' : 'leaveEmphasis'](displayables.moveHandle, 1); + }; - SliderZoomView.prototype._onDragMove = function (handleIndex, dx, dy, event) { - this._dragging = true; // For mobile device, prevent screen slider on the button. + SliderZoomView.prototype._onDragMove = function (handleIndex, dx, dy, event) { + this._dragging = true; // For mobile device, prevent screen slider on the button. - stop(event.event); // Transform dx, dy to bar coordination. + stop(event.event); // Transform dx, dy to bar coordination. - var barTransform = this._displayables.sliderGroup.getLocalTransform(); + var barTransform = this._displayables.sliderGroup.getLocalTransform(); - var vertex = applyTransform$1([dx, dy], barTransform, true); + var vertex = applyTransform$1([dx, dy], barTransform, true); - var changed = this._updateInterval(handleIndex, vertex[0]); + var changed = this._updateInterval(handleIndex, vertex[0]); - var realtime = this.dataZoomModel.get('realtime'); + var realtime = this.dataZoomModel.get('realtime'); - this._updateView(!realtime); // Avoid dispatch dataZoom repeatly but range not changed, - // which cause bad visual effect when progressive enabled. + this._updateView(!realtime); // Avoid dispatch dataZoom repeatly but range not changed, + // which cause bad visual effect when progressive enabled. - changed && realtime && this._dispatchZoomAction(true); - }; + changed && realtime && this._dispatchZoomAction(true); + }; - SliderZoomView.prototype._onDragEnd = function () { - this._dragging = false; + SliderZoomView.prototype._onDragEnd = function () { + this._dragging = false; - this._showDataInfo(false); // While in realtime mode and stream mode, dispatch action when - // drag end will cause the whole view rerender, which is unnecessary. + this._showDataInfo(false); // While in realtime mode and stream mode, dispatch action when + // drag end will cause the whole view rerender, which is unnecessary. - var realtime = this.dataZoomModel.get('realtime'); - !realtime && this._dispatchZoomAction(false); - }; + var realtime = this.dataZoomModel.get('realtime'); + !realtime && this._dispatchZoomAction(false); + }; - SliderZoomView.prototype._onClickPanel = function (e) { - var size = this._size; + SliderZoomView.prototype._onClickPanel = function (e) { + var size = this._size; - var localPoint = this._displayables.sliderGroup.transformCoordToLocal(e.offsetX, e.offsetY); + var localPoint = this._displayables.sliderGroup.transformCoordToLocal(e.offsetX, e.offsetY); - if (localPoint[0] < 0 || localPoint[0] > size[0] || localPoint[1] < 0 || localPoint[1] > size[1]) { - return; - } + if (localPoint[0] < 0 || localPoint[0] > size[0] || localPoint[1] < 0 || localPoint[1] > size[1]) { + return; + } - var handleEnds = this._handleEnds; - var center = (handleEnds[0] + handleEnds[1]) / 2; + var handleEnds = this._handleEnds; + var center = (handleEnds[0] + handleEnds[1]) / 2; - var changed = this._updateInterval('all', localPoint[0] - center); + var changed = this._updateInterval('all', localPoint[0] - center); - this._updateView(); + this._updateView(); - changed && this._dispatchZoomAction(false); - }; + changed && this._dispatchZoomAction(false); + }; - SliderZoomView.prototype._onBrushStart = function (e) { - var x = e.offsetX; - var y = e.offsetY; - this._brushStart = new Point(x, y); - this._brushing = true; - this._brushStartTime = +new Date(); // this._updateBrushRect(x, y); - }; + SliderZoomView.prototype._onBrushStart = function (e) { + var x = e.offsetX; + var y = e.offsetY; + this._brushStart = new Point(x, y); + this._brushing = true; + this._brushStartTime = +new Date(); // this._updateBrushRect(x, y); + }; - SliderZoomView.prototype._onBrushEnd = function (e) { - if (!this._brushing) { - return; - } + SliderZoomView.prototype._onBrushEnd = function (e) { + if (!this._brushing) { + return; + } - var brushRect = this._displayables.brushRect; - this._brushing = false; + var brushRect = this._displayables.brushRect; + this._brushing = false; - if (!brushRect) { - return; - } + if (!brushRect) { + return; + } - brushRect.attr('ignore', true); - var brushShape = brushRect.shape; - var brushEndTime = +new Date(); // console.log(brushEndTime - this._brushStartTime); + brushRect.attr('ignore', true); + var brushShape = brushRect.shape; + var brushEndTime = +new Date(); // console.log(brushEndTime - this._brushStartTime); - if (brushEndTime - this._brushStartTime < 200 && Math.abs(brushShape.width) < 5) { - // Will treat it as a click - return; - } + if (brushEndTime - this._brushStartTime < 200 && Math.abs(brushShape.width) < 5) { + // Will treat it as a click + return; + } - var viewExtend = this._getViewExtent(); + var viewExtend = this._getViewExtent(); - var percentExtent = [0, 100]; - this._range = asc([linearMap(brushShape.x, viewExtend, percentExtent, true), linearMap(brushShape.x + brushShape.width, viewExtend, percentExtent, true)]); - this._handleEnds = [brushShape.x, brushShape.x + brushShape.width]; + var percentExtent = [0, 100]; + this._range = asc([linearMap(brushShape.x, viewExtend, percentExtent, true), linearMap(brushShape.x + brushShape.width, viewExtend, percentExtent, true)]); + this._handleEnds = [brushShape.x, brushShape.x + brushShape.width]; - this._updateView(); + this._updateView(); - this._dispatchZoomAction(false); - }; + this._dispatchZoomAction(false); + }; - SliderZoomView.prototype._onBrush = function (e) { - if (this._brushing) { - // For mobile device, prevent screen slider on the button. - stop(e.event); + SliderZoomView.prototype._onBrush = function (e) { + if (this._brushing) { + // For mobile device, prevent screen slider on the button. + stop(e.event); - this._updateBrushRect(e.offsetX, e.offsetY); - } - }; + this._updateBrushRect(e.offsetX, e.offsetY); + } + }; - SliderZoomView.prototype._updateBrushRect = function (mouseX, mouseY) { - var displayables = this._displayables; - var dataZoomModel = this.dataZoomModel; - var brushRect = displayables.brushRect; + SliderZoomView.prototype._updateBrushRect = function (mouseX, mouseY) { + var displayables = this._displayables; + var dataZoomModel = this.dataZoomModel; + var brushRect = displayables.brushRect; - if (!brushRect) { - brushRect = displayables.brushRect = new Rect$2({ - silent: true, - style: dataZoomModel.getModel('brushStyle').getItemStyle() - }); - displayables.sliderGroup.add(brushRect); - } - - brushRect.attr('ignore', false); - var brushStart = this._brushStart; - var sliderGroup = this._displayables.sliderGroup; - var endPoint = sliderGroup.transformCoordToLocal(mouseX, mouseY); - var startPoint = sliderGroup.transformCoordToLocal(brushStart.x, brushStart.y); - var size = this._size; - endPoint[0] = Math.max(Math.min(size[0], endPoint[0]), 0); - brushRect.setShape({ - x: startPoint[0], - y: 0, - width: endPoint[0] - startPoint[0], - height: size[1] - }); - }; - /** - * This action will be throttled. - */ + if (!brushRect) { + brushRect = displayables.brushRect = new Rect$2({ + silent: true, + style: dataZoomModel.getModel('brushStyle').getItemStyle() + }); + displayables.sliderGroup.add(brushRect); + } + + brushRect.attr('ignore', false); + var brushStart = this._brushStart; + var sliderGroup = this._displayables.sliderGroup; + var endPoint = sliderGroup.transformCoordToLocal(mouseX, mouseY); + var startPoint = sliderGroup.transformCoordToLocal(brushStart.x, brushStart.y); + var size = this._size; + endPoint[0] = Math.max(Math.min(size[0], endPoint[0]), 0); + brushRect.setShape({ + x: startPoint[0], + y: 0, + width: endPoint[0] - startPoint[0], + height: size[1] + }); + }; + /** + * This action will be throttled. + */ - SliderZoomView.prototype._dispatchZoomAction = function (realtime) { - var range = this._range; - this.api.dispatchAction({ - type: 'dataZoom', - from: this.uid, - dataZoomId: this.dataZoomModel.id, - animation: realtime ? REALTIME_ANIMATION_CONFIG : null, - start: range[0], - end: range[1] - }); - }; + SliderZoomView.prototype._dispatchZoomAction = function (realtime) { + var range = this._range; + this.api.dispatchAction({ + type: 'dataZoom', + from: this.uid, + dataZoomId: this.dataZoomModel.id, + animation: realtime ? REALTIME_ANIMATION_CONFIG : null, + start: range[0], + end: range[1] + }); + }; - SliderZoomView.prototype._findCoordRect = function () { - // Find the grid coresponding to the first axis referred by dataZoom. - var rect; - var coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList; + SliderZoomView.prototype._findCoordRect = function () { + // Find the grid coresponding to the first axis referred by dataZoom. + var rect; + var coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList; - if (!rect && coordSysInfoList.length) { - var coordSys = coordSysInfoList[0].model.coordinateSystem; - rect = coordSys.getRect && coordSys.getRect(); - } + if (!rect && coordSysInfoList.length) { + var coordSys = coordSysInfoList[0].model.coordinateSystem; + rect = coordSys.getRect && coordSys.getRect(); + } - if (!rect) { - var width = this.api.getWidth(); - var height = this.api.getHeight(); - rect = { - x: width * 0.2, - y: height * 0.2, - width: width * 0.6, - height: height * 0.6 - }; - } + if (!rect) { + var width = this.api.getWidth(); + var height = this.api.getHeight(); + rect = { + x: width * 0.2, + y: height * 0.2, + width: width * 0.6, + height: height * 0.6 + }; + } - return rect; - }; + return rect; + }; - SliderZoomView.type = 'dataZoom.slider'; - return SliderZoomView; - }(DataZoomView); + SliderZoomView.type = 'dataZoom.slider'; + return SliderZoomView; + }(DataZoomView); function getOtherDim(thisDim) { - // FIXME - // 这个逻辑和getOtherAxis里一致,但是写在这里是否不好 - var map = { - x: 'y', - y: 'x', - radius: 'angle', - angle: 'radius' - }; - return map[thisDim]; + // FIXME + // 这个逻辑和getOtherAxis里一致,但是写在这里是否不好 + var map = { + x: 'y', + y: 'x', + radius: 'angle', + angle: 'radius' + }; + return map[thisDim]; } function getCursor(orient) { - return orient === 'vertical' ? 'ns-resize' : 'ew-resize'; + return orient === 'vertical' ? 'ns-resize' : 'ew-resize'; } function install$L(registers) { - registers.registerComponentModel(SliderZoomModel); - registers.registerComponentView(SliderZoomView); - installCommon(registers); + registers.registerComponentModel(SliderZoomModel); + registers.registerComponentView(SliderZoomView); + installCommon(registers); } function install$M(registers) { - use(install$K); - use(install$L); // Do not install './dataZoomSelect', - // since it only work for toolbox dataZoom. + use(install$K); + use(install$L); // Do not install './dataZoomSelect', + // since it only work for toolbox dataZoom. } var visualDefault = { - /** - * @public - */ - get: function (visualType, key, isCategory) { - var value = clone((defaultOption$1[visualType] || {})[key]); - return isCategory ? isArray(value) ? value[value.length - 1] : value : value; - } + /** + * @public + */ + get: function (visualType, key, isCategory) { + var value = clone((defaultOption$1[visualType] || {})[key]); + return isCategory ? isArray(value) ? value[value.length - 1] : value : value; + } }; var defaultOption$1 = { - color: { - active: ['#006edd', '#e0ffff'], - inactive: ['rgba(0,0,0,0)'] - }, - colorHue: { - active: [0, 360], - inactive: [0, 0] - }, - colorSaturation: { - active: [0.3, 1], - inactive: [0, 0] - }, - colorLightness: { - active: [0.9, 0.5], - inactive: [0, 0] - }, - colorAlpha: { - active: [0.3, 1], - inactive: [0, 0] - }, - opacity: { - active: [0.3, 1], - inactive: [0, 0] - }, - symbol: { - active: ['circle', 'roundRect', 'diamond'], - inactive: ['none'] - }, - symbolSize: { - active: [10, 50], - inactive: [0, 0] - } + color: { + active: ['#006edd', '#e0ffff'], + inactive: ['rgba(0,0,0,0)'] + }, + colorHue: { + active: [0, 360], + inactive: [0, 0] + }, + colorSaturation: { + active: [0.3, 1], + inactive: [0, 0] + }, + colorLightness: { + active: [0.9, 0.5], + inactive: [0, 0] + }, + colorAlpha: { + active: [0.3, 1], + inactive: [0, 0] + }, + opacity: { + active: [0.3, 1], + inactive: [0, 0] + }, + symbol: { + active: ['circle', 'roundRect', 'diamond'], + inactive: ['none'] + }, + symbolSize: { + active: [10, 50], + inactive: [0, 0] + } }; var mapVisual$1 = VisualMapping.mapVisual; @@ -89858,793 +89858,793 @@ var linearMap$1 = linearMap; var VisualMapModel = - /** @class */ - function (_super) { - __extends(VisualMapModel, _super); + /** @class */ + function (_super) { + __extends(VisualMapModel, _super); - function VisualMapModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function VisualMapModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = VisualMapModel.type; - _this.stateList = ['inRange', 'outOfRange']; - _this.replacableOptionKeys = ['inRange', 'outOfRange', 'target', 'controller', 'color']; - _this.layoutMode = { - type: 'box', - ignoreSize: true - }; - /** - * [lowerBound, upperBound] - */ + _this.type = VisualMapModel.type; + _this.stateList = ['inRange', 'outOfRange']; + _this.replacableOptionKeys = ['inRange', 'outOfRange', 'target', 'controller', 'color']; + _this.layoutMode = { + type: 'box', + ignoreSize: true + }; + /** + * [lowerBound, upperBound] + */ - _this.dataBound = [-Infinity, Infinity]; - _this.targetVisuals = {}; - _this.controllerVisuals = {}; - return _this; - } + _this.dataBound = [-Infinity, Infinity]; + _this.targetVisuals = {}; + _this.controllerVisuals = {}; + return _this; + } + + VisualMapModel.prototype.init = function (option, parentModel, ecModel) { + this.mergeDefaultAndTheme(option, ecModel); + }; + /** + * @protected + */ - VisualMapModel.prototype.init = function (option, parentModel, ecModel) { - this.mergeDefaultAndTheme(option, ecModel); - }; - /** - * @protected - */ + VisualMapModel.prototype.optionUpdated = function (newOption, isInit) { + var thisOption = this.option; + !isInit && replaceVisualOption(thisOption, newOption, this.replacableOptionKeys); + this.textStyleModel = this.getModel('textStyle'); + this.resetItemSize(); + this.completeVisualOption(); + }; + /** + * @protected + */ - VisualMapModel.prototype.optionUpdated = function (newOption, isInit) { - var thisOption = this.option; - !isInit && replaceVisualOption(thisOption, newOption, this.replacableOptionKeys); - this.textStyleModel = this.getModel('textStyle'); - this.resetItemSize(); - this.completeVisualOption(); - }; - /** - * @protected - */ + VisualMapModel.prototype.resetVisual = function (supplementVisualOption) { + var stateList = this.stateList; + supplementVisualOption = bind(supplementVisualOption, this); + this.controllerVisuals = createVisualMappings(this.option.controller, stateList, supplementVisualOption); + this.targetVisuals = createVisualMappings(this.option.target, stateList, supplementVisualOption); + }; + /** + * @public + */ - VisualMapModel.prototype.resetVisual = function (supplementVisualOption) { - var stateList = this.stateList; - supplementVisualOption = bind(supplementVisualOption, this); - this.controllerVisuals = createVisualMappings(this.option.controller, stateList, supplementVisualOption); - this.targetVisuals = createVisualMappings(this.option.target, stateList, supplementVisualOption); - }; - /** - * @public - */ + VisualMapModel.prototype.getItemSymbol = function () { + return null; + }; + /** + * @protected + * @return {Array.} An array of series indices. + */ - VisualMapModel.prototype.getItemSymbol = function () { - return null; - }; - /** - * @protected - * @return {Array.} An array of series indices. - */ + VisualMapModel.prototype.getTargetSeriesIndices = function () { + var optionSeriesIndex = this.option.seriesIndex; + var seriesIndices = []; - VisualMapModel.prototype.getTargetSeriesIndices = function () { - var optionSeriesIndex = this.option.seriesIndex; - var seriesIndices = []; + if (optionSeriesIndex == null || optionSeriesIndex === 'all') { + this.ecModel.eachSeries(function (seriesModel, index) { + seriesIndices.push(index); + }); + } else { + seriesIndices = normalizeToArray(optionSeriesIndex); + } - if (optionSeriesIndex == null || optionSeriesIndex === 'all') { - this.ecModel.eachSeries(function (seriesModel, index) { - seriesIndices.push(index); - }); - } else { - seriesIndices = normalizeToArray(optionSeriesIndex); - } + return seriesIndices; + }; + /** + * @public + */ - return seriesIndices; - }; - /** - * @public - */ + VisualMapModel.prototype.eachTargetSeries = function (callback, context) { + each(this.getTargetSeriesIndices(), function (seriesIndex) { + var seriesModel = this.ecModel.getSeriesByIndex(seriesIndex); - VisualMapModel.prototype.eachTargetSeries = function (callback, context) { - each(this.getTargetSeriesIndices(), function (seriesIndex) { - var seriesModel = this.ecModel.getSeriesByIndex(seriesIndex); + if (seriesModel) { + callback.call(context, seriesModel); + } + }, this); + }; + /** + * @pubilc + */ - if (seriesModel) { - callback.call(context, seriesModel); - } - }, this); - }; - /** - * @pubilc - */ + VisualMapModel.prototype.isTargetSeries = function (seriesModel) { + var is = false; + this.eachTargetSeries(function (model) { + model === seriesModel && (is = true); + }); + return is; + }; + /** + * @example + * this.formatValueText(someVal); // format single numeric value to text. + * this.formatValueText(someVal, true); // format single category value to text. + * this.formatValueText([min, max]); // format numeric min-max to text. + * this.formatValueText([this.dataBound[0], max]); // using data lower bound. + * this.formatValueText([min, this.dataBound[1]]); // using data upper bound. + * + * @param value Real value, or this.dataBound[0 or 1]. + * @param isCategory Only available when value is number. + * @param edgeSymbols Open-close symbol when value is interval. + * @protected + */ - VisualMapModel.prototype.isTargetSeries = function (seriesModel) { - var is = false; - this.eachTargetSeries(function (model) { - model === seriesModel && (is = true); - }); - return is; - }; - /** - * @example - * this.formatValueText(someVal); // format single numeric value to text. - * this.formatValueText(someVal, true); // format single category value to text. - * this.formatValueText([min, max]); // format numeric min-max to text. - * this.formatValueText([this.dataBound[0], max]); // using data lower bound. - * this.formatValueText([min, this.dataBound[1]]); // using data upper bound. - * - * @param value Real value, or this.dataBound[0 or 1]. - * @param isCategory Only available when value is number. - * @param edgeSymbols Open-close symbol when value is interval. - * @protected - */ + VisualMapModel.prototype.formatValueText = function (value, isCategory, edgeSymbols) { + var option = this.option; + var precision = option.precision; + var dataBound = this.dataBound; + var formatter = option.formatter; + var isMinMax; + edgeSymbols = edgeSymbols || ['<', '>']; - VisualMapModel.prototype.formatValueText = function (value, isCategory, edgeSymbols) { - var option = this.option; - var precision = option.precision; - var dataBound = this.dataBound; - var formatter = option.formatter; - var isMinMax; - edgeSymbols = edgeSymbols || ['<', '>']; + if (isArray(value)) { + value = value.slice(); + isMinMax = true; + } - if (isArray(value)) { - value = value.slice(); - isMinMax = true; - } + var textValue = isCategory ? value // Value is string when isCategory + : isMinMax ? [toFixed(value[0]), toFixed(value[1])] : toFixed(value); - var textValue = isCategory ? value // Value is string when isCategory - : isMinMax ? [toFixed(value[0]), toFixed(value[1])] : toFixed(value); + if (isString(formatter)) { + return formatter.replace('{value}', isMinMax ? textValue[0] : textValue).replace('{value2}', isMinMax ? textValue[1] : textValue); + } else if (isFunction(formatter)) { + return isMinMax ? formatter(value[0], value[1]) : formatter(value); + } - if (isString(formatter)) { - return formatter.replace('{value}', isMinMax ? textValue[0] : textValue).replace('{value2}', isMinMax ? textValue[1] : textValue); - } else if (isFunction(formatter)) { - return isMinMax ? formatter(value[0], value[1]) : formatter(value); - } + if (isMinMax) { + if (value[0] === dataBound[0]) { + return edgeSymbols[0] + ' ' + textValue[1]; + } else if (value[1] === dataBound[1]) { + return edgeSymbols[1] + ' ' + textValue[0]; + } else { + return textValue[0] + ' - ' + textValue[1]; + } + } else { + // Format single value (includes category case). + return textValue; + } - if (isMinMax) { - if (value[0] === dataBound[0]) { - return edgeSymbols[0] + ' ' + textValue[1]; - } else if (value[1] === dataBound[1]) { - return edgeSymbols[1] + ' ' + textValue[0]; - } else { - return textValue[0] + ' - ' + textValue[1]; - } - } else { - // Format single value (includes category case). - return textValue; - } + function toFixed(val) { + return val === dataBound[0] ? 'min' : val === dataBound[1] ? 'max' : (+val).toFixed(Math.min(precision, 20)); + } + }; + /** + * @protected + */ - function toFixed(val) { - return val === dataBound[0] ? 'min' : val === dataBound[1] ? 'max' : (+val).toFixed(Math.min(precision, 20)); - } - }; - /** - * @protected - */ + VisualMapModel.prototype.resetExtent = function () { + var thisOption = this.option; // Can not calculate data extent by data here. + // Because series and data may be modified in processing stage. + // So we do not support the feature "auto min/max". - VisualMapModel.prototype.resetExtent = function () { - var thisOption = this.option; // Can not calculate data extent by data here. - // Because series and data may be modified in processing stage. - // So we do not support the feature "auto min/max". + var extent = asc$2([thisOption.min, thisOption.max]); + this._dataExtent = extent; + }; + /** + * PENDING: + * delete this method if no outer usage. + * + * Return Concrete dimention. If return null/undefined, no dimension used. + */ + // getDataDimension(data: SeriesData) { + // const optDim = this.option.dimension; + // if (optDim != null) { + // return data.getDimension(optDim); + // } + // const dimNames = data.dimensions; + // for (let i = dimNames.length - 1; i >= 0; i--) { + // const dimName = dimNames[i]; + // const dimInfo = data.getDimensionInfo(dimName); + // if (!dimInfo.isCalculationCoord) { + // return dimName; + // } + // } + // } - var extent = asc$2([thisOption.min, thisOption.max]); - this._dataExtent = extent; - }; - /** - * PENDING: - * delete this method if no outer usage. - * - * Return Concrete dimention. If return null/undefined, no dimension used. - */ - // getDataDimension(data: SeriesData) { - // const optDim = this.option.dimension; - // if (optDim != null) { - // return data.getDimension(optDim); - // } - // const dimNames = data.dimensions; - // for (let i = dimNames.length - 1; i >= 0; i--) { - // const dimName = dimNames[i]; - // const dimInfo = data.getDimensionInfo(dimName); - // if (!dimInfo.isCalculationCoord) { - // return dimName; - // } - // } - // } + VisualMapModel.prototype.getDataDimensionIndex = function (data) { + var optDim = this.option.dimension; - VisualMapModel.prototype.getDataDimensionIndex = function (data) { - var optDim = this.option.dimension; + if (optDim != null) { + return data.getDimensionIndex(optDim); + } - if (optDim != null) { - return data.getDimensionIndex(optDim); - } + var dimNames = data.dimensions; - var dimNames = data.dimensions; + for (var i = dimNames.length - 1; i >= 0; i--) { + var dimName = dimNames[i]; + var dimInfo = data.getDimensionInfo(dimName); - for (var i = dimNames.length - 1; i >= 0; i--) { - var dimName = dimNames[i]; - var dimInfo = data.getDimensionInfo(dimName); + if (!dimInfo.isCalculationCoord) { + return dimInfo.storeDimIndex; + } + } + }; - if (!dimInfo.isCalculationCoord) { - return dimInfo.storeDimIndex; - } - } - }; + VisualMapModel.prototype.getExtent = function () { + return this._dataExtent.slice(); + }; - VisualMapModel.prototype.getExtent = function () { - return this._dataExtent.slice(); - }; + VisualMapModel.prototype.completeVisualOption = function () { + var ecModel = this.ecModel; + var thisOption = this.option; + var base = { + inRange: thisOption.inRange, + outOfRange: thisOption.outOfRange + }; + var target = thisOption.target || (thisOption.target = {}); + var controller = thisOption.controller || (thisOption.controller = {}); + merge(target, base); // Do not override + + merge(controller, base); // Do not override + + var isCategory = this.isCategory(); + completeSingle.call(this, target); + completeSingle.call(this, controller); + completeInactive.call(this, target, 'inRange', 'outOfRange'); // completeInactive.call(this, target, 'outOfRange', 'inRange'); + + completeController.call(this, controller); + + function completeSingle(base) { + // Compatible with ec2 dataRange.color. + // The mapping order of dataRange.color is: [high value, ..., low value] + // whereas inRange.color and outOfRange.color is [low value, ..., high value] + // Notice: ec2 has no inverse. + if (isArray$1(thisOption.color) // If there has been inRange: {symbol: ...}, adding color is a mistake. + // So adding color only when no inRange defined. + && !base.inRange) { + base.inRange = { + color: thisOption.color.slice().reverse() + }; + } // Compatible with previous logic, always give a defautl color, otherwise + // simple config with no inRange and outOfRange will not work. + // Originally we use visualMap.color as the default color, but setOption at + // the second time the default color will be erased. So we change to use + // constant DEFAULT_COLOR. + // If user do not want the default color, set inRange: {color: null}. + + + base.inRange = base.inRange || { + color: ecModel.get('gradientColor') + }; + } + + function completeInactive(base, stateExist, stateAbsent) { + var optExist = base[stateExist]; + var optAbsent = base[stateAbsent]; + + if (optExist && !optAbsent) { + optAbsent = base[stateAbsent] = {}; + each$d(optExist, function (visualData, visualType) { + if (!VisualMapping.isValidType(visualType)) { + return; + } - VisualMapModel.prototype.completeVisualOption = function () { - var ecModel = this.ecModel; - var thisOption = this.option; - var base = { - inRange: thisOption.inRange, - outOfRange: thisOption.outOfRange - }; - var target = thisOption.target || (thisOption.target = {}); - var controller = thisOption.controller || (thisOption.controller = {}); - merge(target, base); // Do not override - - merge(controller, base); // Do not override - - var isCategory = this.isCategory(); - completeSingle.call(this, target); - completeSingle.call(this, controller); - completeInactive.call(this, target, 'inRange', 'outOfRange'); // completeInactive.call(this, target, 'outOfRange', 'inRange'); - - completeController.call(this, controller); - - function completeSingle(base) { - // Compatible with ec2 dataRange.color. - // The mapping order of dataRange.color is: [high value, ..., low value] - // whereas inRange.color and outOfRange.color is [low value, ..., high value] - // Notice: ec2 has no inverse. - if (isArray$1(thisOption.color) // If there has been inRange: {symbol: ...}, adding color is a mistake. - // So adding color only when no inRange defined. - && !base.inRange) { - base.inRange = { - color: thisOption.color.slice().reverse() - }; - } // Compatible with previous logic, always give a defautl color, otherwise - // simple config with no inRange and outOfRange will not work. - // Originally we use visualMap.color as the default color, but setOption at - // the second time the default color will be erased. So we change to use - // constant DEFAULT_COLOR. - // If user do not want the default color, set inRange: {color: null}. + var defa = visualDefault.get(visualType, 'inactive', isCategory); + if (defa != null) { + optAbsent[visualType] = defa; // Compatibable with ec2: + // Only inactive color to rgba(0,0,0,0) can not + // make label transparent, so use opacity also. - base.inRange = base.inRange || { - color: ecModel.get('gradientColor') - }; + if (visualType === 'color' && !optAbsent.hasOwnProperty('opacity') && !optAbsent.hasOwnProperty('colorAlpha')) { + optAbsent.opacity = [0, 0]; } + } + }); + } + } - function completeInactive(base, stateExist, stateAbsent) { - var optExist = base[stateExist]; - var optAbsent = base[stateAbsent]; - - if (optExist && !optAbsent) { - optAbsent = base[stateAbsent] = {}; - each$d(optExist, function (visualData, visualType) { - if (!VisualMapping.isValidType(visualType)) { - return; - } - - var defa = visualDefault.get(visualType, 'inactive', isCategory); - - if (defa != null) { - optAbsent[visualType] = defa; // Compatibable with ec2: - // Only inactive color to rgba(0,0,0,0) can not - // make label transparent, so use opacity also. - - if (visualType === 'color' && !optAbsent.hasOwnProperty('opacity') && !optAbsent.hasOwnProperty('colorAlpha')) { - optAbsent.opacity = [0, 0]; - } - } - }); - } - } + function completeController(controller) { + var symbolExists = (controller.inRange || {}).symbol || (controller.outOfRange || {}).symbol; + var symbolSizeExists = (controller.inRange || {}).symbolSize || (controller.outOfRange || {}).symbolSize; + var inactiveColor = this.get('inactiveColor'); + var itemSymbol = this.getItemSymbol(); + var defaultSymbol = itemSymbol || 'roundRect'; + each$d(this.stateList, function (state) { + var itemSize = this.itemSize; + var visuals = controller[state]; // Set inactive color for controller if no other color + // attr (like colorAlpha) specified. - function completeController(controller) { - var symbolExists = (controller.inRange || {}).symbol || (controller.outOfRange || {}).symbol; - var symbolSizeExists = (controller.inRange || {}).symbolSize || (controller.outOfRange || {}).symbolSize; - var inactiveColor = this.get('inactiveColor'); - var itemSymbol = this.getItemSymbol(); - var defaultSymbol = itemSymbol || 'roundRect'; - each$d(this.stateList, function (state) { - var itemSize = this.itemSize; - var visuals = controller[state]; // Set inactive color for controller if no other color - // attr (like colorAlpha) specified. - - if (!visuals) { - visuals = controller[state] = { - color: isCategory ? inactiveColor : [inactiveColor] - }; - } // Consistent symbol and symbolSize if not specified. + if (!visuals) { + visuals = controller[state] = { + color: isCategory ? inactiveColor : [inactiveColor] + }; + } // Consistent symbol and symbolSize if not specified. - if (visuals.symbol == null) { - visuals.symbol = symbolExists && clone(symbolExists) || (isCategory ? defaultSymbol : [defaultSymbol]); - } + if (visuals.symbol == null) { + visuals.symbol = symbolExists && clone(symbolExists) || (isCategory ? defaultSymbol : [defaultSymbol]); + } - if (visuals.symbolSize == null) { - visuals.symbolSize = symbolSizeExists && clone(symbolSizeExists) || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]); - } // Filter none + if (visuals.symbolSize == null) { + visuals.symbolSize = symbolSizeExists && clone(symbolSizeExists) || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]); + } // Filter none - visuals.symbol = mapVisual$1(visuals.symbol, function (symbol) { - return symbol === 'none' ? defaultSymbol : symbol; - }); // Normalize symbolSize + visuals.symbol = mapVisual$1(visuals.symbol, function (symbol) { + return symbol === 'none' ? defaultSymbol : symbol; + }); // Normalize symbolSize - var symbolSize = visuals.symbolSize; + var symbolSize = visuals.symbolSize; - if (symbolSize != null) { - var max_1 = -Infinity; // symbolSize can be object when categories defined. + if (symbolSize != null) { + var max_1 = -Infinity; // symbolSize can be object when categories defined. - eachVisual(symbolSize, function (value) { - value > max_1 && (max_1 = value); - }); - visuals.symbolSize = mapVisual$1(symbolSize, function (value) { - return linearMap$1(value, [0, max_1], [0, itemSize[0]], true); - }); - } - }, this); - } - }; + eachVisual(symbolSize, function (value) { + value > max_1 && (max_1 = value); + }); + visuals.symbolSize = mapVisual$1(symbolSize, function (value) { + return linearMap$1(value, [0, max_1], [0, itemSize[0]], true); + }); + } + }, this); + } + }; - VisualMapModel.prototype.resetItemSize = function () { - this.itemSize = [parseFloat(this.get('itemWidth')), parseFloat(this.get('itemHeight'))]; - }; + VisualMapModel.prototype.resetItemSize = function () { + this.itemSize = [parseFloat(this.get('itemWidth')), parseFloat(this.get('itemHeight'))]; + }; - VisualMapModel.prototype.isCategory = function () { - return !!this.option.categories; - }; - /** - * @public - * @abstract - */ + VisualMapModel.prototype.isCategory = function () { + return !!this.option.categories; + }; + /** + * @public + * @abstract + */ - VisualMapModel.prototype.setSelected = function (selected) {}; + VisualMapModel.prototype.setSelected = function (selected) {}; - VisualMapModel.prototype.getSelected = function () { - return null; - }; - /** - * @public - * @abstract - */ + VisualMapModel.prototype.getSelected = function () { + return null; + }; + /** + * @public + * @abstract + */ - VisualMapModel.prototype.getValueState = function (value) { - return null; - }; - /** - * FIXME - * Do not publish to thirt-part-dev temporarily - * util the interface is stable. (Should it return - * a function but not visual meta?) - * - * @pubilc - * @abstract - * @param getColorVisual - * params: value, valueState - * return: color - * @return {Object} visualMeta - * should includes {stops, outerColors} - * outerColor means [colorBeyondMinValue, colorBeyondMaxValue] - */ + VisualMapModel.prototype.getValueState = function (value) { + return null; + }; + /** + * FIXME + * Do not publish to thirt-part-dev temporarily + * util the interface is stable. (Should it return + * a function but not visual meta?) + * + * @pubilc + * @abstract + * @param getColorVisual + * params: value, valueState + * return: color + * @return {Object} visualMeta + * should includes {stops, outerColors} + * outerColor means [colorBeyondMinValue, colorBeyondMaxValue] + */ - VisualMapModel.prototype.getVisualMeta = function (getColorVisual) { - return null; - }; + VisualMapModel.prototype.getVisualMeta = function (getColorVisual) { + return null; + }; - VisualMapModel.type = 'visualMap'; - VisualMapModel.dependencies = ['series']; - VisualMapModel.defaultOption = { - show: true, - // zlevel: 0, - z: 4, - seriesIndex: 'all', - min: 0, - max: 200, - left: 0, - right: null, - top: null, - bottom: 0, - itemWidth: null, - itemHeight: null, - inverse: false, - orient: 'vertical', - backgroundColor: 'rgba(0,0,0,0)', - borderColor: '#ccc', - contentColor: '#5793f3', - inactiveColor: '#aaa', - borderWidth: 0, - padding: 5, - // 接受数组分别设定上右下左边距,同css - textGap: 10, - precision: 0, - textStyle: { - color: '#333' // 值域文字颜色 + VisualMapModel.type = 'visualMap'; + VisualMapModel.dependencies = ['series']; + VisualMapModel.defaultOption = { + show: true, + // zlevel: 0, + z: 4, + seriesIndex: 'all', + min: 0, + max: 200, + left: 0, + right: null, + top: null, + bottom: 0, + itemWidth: null, + itemHeight: null, + inverse: false, + orient: 'vertical', + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + contentColor: '#5793f3', + inactiveColor: '#aaa', + borderWidth: 0, + padding: 5, + // 接受数组分别设定上右下左边距,同css + textGap: 10, + precision: 0, + textStyle: { + color: '#333' // 值域文字颜色 - } - }; - return VisualMapModel; - }(ComponentModel); + } + }; + return VisualMapModel; + }(ComponentModel); var DEFAULT_BAR_BOUND = [20, 140]; var ContinuousModel = - /** @class */ - function (_super) { - __extends(ContinuousModel, _super); - - function ContinuousModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = ContinuousModel.type; - return _this; - } - /** - * @override - */ - - - ContinuousModel.prototype.optionUpdated = function (newOption, isInit) { - _super.prototype.optionUpdated.apply(this, arguments); + /** @class */ + function (_super) { + __extends(ContinuousModel, _super); - this.resetExtent(); - this.resetVisual(function (mappingOption) { - mappingOption.mappingMethod = 'linear'; - mappingOption.dataExtent = this.getExtent(); - }); + function ContinuousModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - this._resetRange(); - }; - /** - * @protected - * @override - */ + _this.type = ContinuousModel.type; + return _this; + } + /** + * @override + */ - ContinuousModel.prototype.resetItemSize = function () { - _super.prototype.resetItemSize.apply(this, arguments); + ContinuousModel.prototype.optionUpdated = function (newOption, isInit) { + _super.prototype.optionUpdated.apply(this, arguments); - var itemSize = this.itemSize; - (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]); - (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]); - }; - /** - * @private - */ + this.resetExtent(); + this.resetVisual(function (mappingOption) { + mappingOption.mappingMethod = 'linear'; + mappingOption.dataExtent = this.getExtent(); + }); + this._resetRange(); + }; + /** + * @protected + * @override + */ - ContinuousModel.prototype._resetRange = function () { - var dataExtent = this.getExtent(); - var range = this.option.range; - if (!range || range.auto) { - // `range` should always be array (so we dont use other - // value like 'auto') for user-friend. (consider getOption). - dataExtent.auto = 1; - this.option.range = dataExtent; - } else if (isArray(range)) { - if (range[0] > range[1]) { - range.reverse(); - } + ContinuousModel.prototype.resetItemSize = function () { + _super.prototype.resetItemSize.apply(this, arguments); - range[0] = Math.max(range[0], dataExtent[0]); - range[1] = Math.min(range[1], dataExtent[1]); - } - }; - /** - * @protected - * @override - */ + var itemSize = this.itemSize; + (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]); + (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]); + }; + /** + * @private + */ - ContinuousModel.prototype.completeVisualOption = function () { - _super.prototype.completeVisualOption.apply(this, arguments); + ContinuousModel.prototype._resetRange = function () { + var dataExtent = this.getExtent(); + var range = this.option.range; - each(this.stateList, function (state) { - var symbolSize = this.option.controller[state].symbolSize; + if (!range || range.auto) { + // `range` should always be array (so we dont use other + // value like 'auto') for user-friend. (consider getOption). + dataExtent.auto = 1; + this.option.range = dataExtent; + } else if (isArray(range)) { + if (range[0] > range[1]) { + range.reverse(); + } - if (symbolSize && symbolSize[0] !== symbolSize[1]) { - symbolSize[0] = symbolSize[1] / 3; // For good looking. - } - }, this); - }; - /** - * @override - */ + range[0] = Math.max(range[0], dataExtent[0]); + range[1] = Math.min(range[1], dataExtent[1]); + } + }; + /** + * @protected + * @override + */ - ContinuousModel.prototype.setSelected = function (selected) { - this.option.range = selected.slice(); + ContinuousModel.prototype.completeVisualOption = function () { + _super.prototype.completeVisualOption.apply(this, arguments); - this._resetRange(); - }; - /** - * @public - */ + each(this.stateList, function (state) { + var symbolSize = this.option.controller[state].symbolSize; + if (symbolSize && symbolSize[0] !== symbolSize[1]) { + symbolSize[0] = symbolSize[1] / 3; // For good looking. + } + }, this); + }; + /** + * @override + */ - ContinuousModel.prototype.getSelected = function () { - var dataExtent = this.getExtent(); - var dataInterval = asc((this.get('range') || []).slice()); // Clamp - dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]); - dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]); - dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]); - dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]); - return dataInterval; - }; - /** - * @override - */ + ContinuousModel.prototype.setSelected = function (selected) { + this.option.range = selected.slice(); + this._resetRange(); + }; + /** + * @public + */ - ContinuousModel.prototype.getValueState = function (value) { - var range = this.option.range; - var dataExtent = this.getExtent(); // When range[0] === dataExtent[0], any value larger than dataExtent[0] maps to 'inRange'. - // range[1] is processed likewise. - return (range[0] <= dataExtent[0] || range[0] <= value) && (range[1] >= dataExtent[1] || value <= range[1]) ? 'inRange' : 'outOfRange'; - }; + ContinuousModel.prototype.getSelected = function () { + var dataExtent = this.getExtent(); + var dataInterval = asc((this.get('range') || []).slice()); // Clamp - ContinuousModel.prototype.findTargetDataIndices = function (range) { - var result = []; - this.eachTargetSeries(function (seriesModel) { - var dataIndices = []; - var data = seriesModel.getData(); - data.each(this.getDataDimensionIndex(data), function (value, dataIndex) { - range[0] <= value && value <= range[1] && dataIndices.push(dataIndex); - }, this); - result.push({ - seriesId: seriesModel.id, - dataIndex: dataIndices - }); - }, this); - return result; - }; - /** - * @implement - */ + dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]); + dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]); + dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]); + dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]); + return dataInterval; + }; + /** + * @override + */ - ContinuousModel.prototype.getVisualMeta = function (getColorVisual) { - var oVals = getColorStopValues(this, 'outOfRange', this.getExtent()); - var iVals = getColorStopValues(this, 'inRange', this.option.range.slice()); - var stops = []; + ContinuousModel.prototype.getValueState = function (value) { + var range = this.option.range; + var dataExtent = this.getExtent(); // When range[0] === dataExtent[0], any value larger than dataExtent[0] maps to 'inRange'. + // range[1] is processed likewise. - function setStop(value, valueState) { - stops.push({ - value: value, - color: getColorVisual(value, valueState) - }); - } // Format to: outOfRange -- inRange -- outOfRange. + return (range[0] <= dataExtent[0] || range[0] <= value) && (range[1] >= dataExtent[1] || value <= range[1]) ? 'inRange' : 'outOfRange'; + }; + ContinuousModel.prototype.findTargetDataIndices = function (range) { + var result = []; + this.eachTargetSeries(function (seriesModel) { + var dataIndices = []; + var data = seriesModel.getData(); + data.each(this.getDataDimensionIndex(data), function (value, dataIndex) { + range[0] <= value && value <= range[1] && dataIndices.push(dataIndex); + }, this); + result.push({ + seriesId: seriesModel.id, + dataIndex: dataIndices + }); + }, this); + return result; + }; + /** + * @implement + */ - var iIdx = 0; - var oIdx = 0; - var iLen = iVals.length; - var oLen = oVals.length; - for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) { - // If oVal[oIdx] === iVals[iIdx], oVal[oIdx] should be ignored. - if (oVals[oIdx] < iVals[iIdx]) { - setStop(oVals[oIdx], 'outOfRange'); - } - } + ContinuousModel.prototype.getVisualMeta = function (getColorVisual) { + var oVals = getColorStopValues(this, 'outOfRange', this.getExtent()); + var iVals = getColorStopValues(this, 'inRange', this.option.range.slice()); + var stops = []; - for (var first = 1; iIdx < iLen; iIdx++, first = 0) { - // If range is full, value beyond min, max will be clamped. - // make a singularity - first && stops.length && setStop(iVals[iIdx], 'outOfRange'); - setStop(iVals[iIdx], 'inRange'); - } + function setStop(value, valueState) { + stops.push({ + value: value, + color: getColorVisual(value, valueState) + }); + } // Format to: outOfRange -- inRange -- outOfRange. - for (var first = 1; oIdx < oLen; oIdx++) { - if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) { - // make a singularity - if (first) { - stops.length && setStop(stops[stops.length - 1].value, 'outOfRange'); - first = 0; - } - setStop(oVals[oIdx], 'outOfRange'); - } - } + var iIdx = 0; + var oIdx = 0; + var iLen = iVals.length; + var oLen = oVals.length; - var stopsLen = stops.length; - return { - stops: stops, - outerColors: [stopsLen ? stops[0].color : 'transparent', stopsLen ? stops[stopsLen - 1].color : 'transparent'] - }; - }; + for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) { + // If oVal[oIdx] === iVals[iIdx], oVal[oIdx] should be ignored. + if (oVals[oIdx] < iVals[iIdx]) { + setStop(oVals[oIdx], 'outOfRange'); + } + } - ContinuousModel.type = 'visualMap.continuous'; - ContinuousModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, { - align: 'auto', - calculable: false, - hoverLink: true, - realtime: true, - handleIcon: 'path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z', - handleSize: '120%', - handleStyle: { - borderColor: '#fff', - borderWidth: 1 - }, - indicatorIcon: 'circle', - indicatorSize: '50%', - indicatorStyle: { - borderColor: '#fff', - borderWidth: 2, - shadowBlur: 2, - shadowOffsetX: 1, - shadowOffsetY: 1, - shadowColor: 'rgba(0,0,0,0.2)' - } // emphasis: { - // handleStyle: { - // shadowBlur: 3, - // shadowOffsetX: 1, - // shadowOffsetY: 1, - // shadowColor: 'rgba(0,0,0,0.2)' - // } - // } + for (var first = 1; iIdx < iLen; iIdx++, first = 0) { + // If range is full, value beyond min, max will be clamped. + // make a singularity + first && stops.length && setStop(iVals[iIdx], 'outOfRange'); + setStop(iVals[iIdx], 'inRange'); + } - }); - return ContinuousModel; - }(VisualMapModel); + for (var first = 1; oIdx < oLen; oIdx++) { + if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) { + // make a singularity + if (first) { + stops.length && setStop(stops[stops.length - 1].value, 'outOfRange'); + first = 0; + } - function getColorStopValues(visualMapModel, valueState, dataExtent) { - if (dataExtent[0] === dataExtent[1]) { - return dataExtent.slice(); - } // When using colorHue mapping, it is not linear color any more. - // Moreover, canvas gradient seems not to be accurate linear. - // FIXME - // Should be arbitrary value 100? or based on pixel size? + setStop(oVals[oIdx], 'outOfRange'); + } + } + var stopsLen = stops.length; + return { + stops: stops, + outerColors: [stopsLen ? stops[0].color : 'transparent', stopsLen ? stops[stopsLen - 1].color : 'transparent'] + }; + }; - var count = 200; - var step = (dataExtent[1] - dataExtent[0]) / count; - var value = dataExtent[0]; - var stopValues = []; + ContinuousModel.type = 'visualMap.continuous'; + ContinuousModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, { + align: 'auto', + calculable: false, + hoverLink: true, + realtime: true, + handleIcon: 'path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z', + handleSize: '120%', + handleStyle: { + borderColor: '#fff', + borderWidth: 1 + }, + indicatorIcon: 'circle', + indicatorSize: '50%', + indicatorStyle: { + borderColor: '#fff', + borderWidth: 2, + shadowBlur: 2, + shadowOffsetX: 1, + shadowOffsetY: 1, + shadowColor: 'rgba(0,0,0,0.2)' + } // emphasis: { + // handleStyle: { + // shadowBlur: 3, + // shadowOffsetX: 1, + // shadowOffsetY: 1, + // shadowColor: 'rgba(0,0,0,0.2)' + // } + // } - for (var i = 0; i <= count && value < dataExtent[1]; i++) { - stopValues.push(value); - value += step; - } + }); + return ContinuousModel; + }(VisualMapModel); - stopValues.push(dataExtent[1]); - return stopValues; - } + function getColorStopValues(visualMapModel, valueState, dataExtent) { + if (dataExtent[0] === dataExtent[1]) { + return dataExtent.slice(); + } // When using colorHue mapping, it is not linear color any more. + // Moreover, canvas gradient seems not to be accurate linear. + // FIXME + // Should be arbitrary value 100? or based on pixel size? - var VisualMapView = - /** @class */ - function (_super) { - __extends(VisualMapView, _super); - function VisualMapView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + var count = 200; + var step = (dataExtent[1] - dataExtent[0]) / count; + var value = dataExtent[0]; + var stopValues = []; - _this.type = VisualMapView.type; - _this.autoPositionValues = { - left: 1, - right: 1, - top: 1, - bottom: 1 - }; - return _this; - } + for (var i = 0; i <= count && value < dataExtent[1]; i++) { + stopValues.push(value); + value += step; + } - VisualMapView.prototype.init = function (ecModel, api) { - this.ecModel = ecModel; - this.api = api; - }; - /** - * @protected - */ + stopValues.push(dataExtent[1]); + return stopValues; + } + var VisualMapView = + /** @class */ + function (_super) { + __extends(VisualMapView, _super); + + function VisualMapView() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = VisualMapView.type; + _this.autoPositionValues = { + left: 1, + right: 1, + top: 1, + bottom: 1 + }; + return _this; + } + + VisualMapView.prototype.init = function (ecModel, api) { + this.ecModel = ecModel; + this.api = api; + }; + /** + * @protected + */ - VisualMapView.prototype.render = function (visualMapModel, ecModel, api, payload // TODO: TYPE - ) { - this.visualMapModel = visualMapModel; - if (visualMapModel.get('show') === false) { - this.group.removeAll(); - return; - } + VisualMapView.prototype.render = function (visualMapModel, ecModel, api, payload // TODO: TYPE + ) { + this.visualMapModel = visualMapModel; - this.doRender(visualMapModel, ecModel, api, payload); - }; - /** - * @protected - */ + if (visualMapModel.get('show') === false) { + this.group.removeAll(); + return; + } + this.doRender(visualMapModel, ecModel, api, payload); + }; + /** + * @protected + */ - VisualMapView.prototype.renderBackground = function (group) { - var visualMapModel = this.visualMapModel; - var padding = normalizeCssArray$1(visualMapModel.get('padding') || 0); - var rect = group.getBoundingRect(); - group.add(new Rect({ - z2: -1, - silent: true, - shape: { - x: rect.x - padding[3], - y: rect.y - padding[0], - width: rect.width + padding[3] + padding[1], - height: rect.height + padding[0] + padding[2] - }, - style: { - fill: visualMapModel.get('backgroundColor'), - stroke: visualMapModel.get('borderColor'), - lineWidth: visualMapModel.get('borderWidth') - } - })); - }; - /** - * @protected - * @param targetValue can be Infinity or -Infinity - * @param visualCluster Only can be 'color' 'opacity' 'symbol' 'symbolSize' - * @param opts - * @param opts.forceState Specify state, instead of using getValueState method. - * @param opts.convertOpacityToAlpha For color gradient in controller widget. - * @return {*} Visual value. - */ + VisualMapView.prototype.renderBackground = function (group) { + var visualMapModel = this.visualMapModel; + var padding = normalizeCssArray$1(visualMapModel.get('padding') || 0); + var rect = group.getBoundingRect(); + group.add(new Rect({ + z2: -1, + silent: true, + shape: { + x: rect.x - padding[3], + y: rect.y - padding[0], + width: rect.width + padding[3] + padding[1], + height: rect.height + padding[0] + padding[2] + }, + style: { + fill: visualMapModel.get('backgroundColor'), + stroke: visualMapModel.get('borderColor'), + lineWidth: visualMapModel.get('borderWidth') + } + })); + }; + /** + * @protected + * @param targetValue can be Infinity or -Infinity + * @param visualCluster Only can be 'color' 'opacity' 'symbol' 'symbolSize' + * @param opts + * @param opts.forceState Specify state, instead of using getValueState method. + * @param opts.convertOpacityToAlpha For color gradient in controller widget. + * @return {*} Visual value. + */ - VisualMapView.prototype.getControllerVisual = function (targetValue, visualCluster, opts) { - opts = opts || {}; - var forceState = opts.forceState; - var visualMapModel = this.visualMapModel; - var visualObj = {}; // Default values. - if (visualCluster === 'color') { - var defaultColor = visualMapModel.get('contentColor'); - visualObj.color = defaultColor; - } + VisualMapView.prototype.getControllerVisual = function (targetValue, visualCluster, opts) { + opts = opts || {}; + var forceState = opts.forceState; + var visualMapModel = this.visualMapModel; + var visualObj = {}; // Default values. - function getter(key) { - return visualObj[key]; - } + if (visualCluster === 'color') { + var defaultColor = visualMapModel.get('contentColor'); + visualObj.color = defaultColor; + } - function setter(key, value) { - visualObj[key] = value; - } + function getter(key) { + return visualObj[key]; + } - var mappings = visualMapModel.controllerVisuals[forceState || visualMapModel.getValueState(targetValue)]; - var visualTypes = VisualMapping.prepareVisualTypes(mappings); - each(visualTypes, function (type) { - var visualMapping = mappings[type]; + function setter(key, value) { + visualObj[key] = value; + } - if (opts.convertOpacityToAlpha && type === 'opacity') { - type = 'colorAlpha'; - visualMapping = mappings.__alphaForOpacity; - } + var mappings = visualMapModel.controllerVisuals[forceState || visualMapModel.getValueState(targetValue)]; + var visualTypes = VisualMapping.prepareVisualTypes(mappings); + each(visualTypes, function (type) { + var visualMapping = mappings[type]; - if (VisualMapping.dependsOn(type, visualCluster)) { - visualMapping && visualMapping.applyVisual(targetValue, getter, setter); - } - }); - return visualObj[visualCluster]; - }; + if (opts.convertOpacityToAlpha && type === 'opacity') { + type = 'colorAlpha'; + visualMapping = mappings.__alphaForOpacity; + } - VisualMapView.prototype.positionGroup = function (group) { - var model = this.visualMapModel; - var api = this.api; - positionElement(group, model.getBoxLayoutParams(), { - width: api.getWidth(), - height: api.getHeight() - }); - }; + if (VisualMapping.dependsOn(type, visualCluster)) { + visualMapping && visualMapping.applyVisual(targetValue, getter, setter); + } + }); + return visualObj[visualCluster]; + }; + + VisualMapView.prototype.positionGroup = function (group) { + var model = this.visualMapModel; + var api = this.api; + positionElement(group, model.getBoxLayoutParams(), { + width: api.getWidth(), + height: api.getHeight() + }); + }; - VisualMapView.prototype.doRender = function (visualMapModel, ecModel, api, payload) {}; + VisualMapView.prototype.doRender = function (visualMapModel, ecModel, api, payload) {}; - VisualMapView.type = 'visualMap'; - return VisualMapView; - }(ComponentView); + VisualMapView.type = 'visualMap'; + return VisualMapView; + }(ComponentView); var paramsSet = [['left', 'right', 'width'], ['top', 'bottom', 'height']]; /** @@ -90655,31 +90655,31 @@ */ function getItemAlign(visualMapModel, api, itemSize) { - var modelOption = visualMapModel.option; - var itemAlign = modelOption.align; + var modelOption = visualMapModel.option; + var itemAlign = modelOption.align; - if (itemAlign != null && itemAlign !== 'auto') { - return itemAlign; - } // Auto decision align. + if (itemAlign != null && itemAlign !== 'auto') { + return itemAlign; + } // Auto decision align. - var ecSize = { - width: api.getWidth(), - height: api.getHeight() - }; - var realIndex = modelOption.orient === 'horizontal' ? 1 : 0; - var reals = paramsSet[realIndex]; - var fakeValue = [0, null, 10]; - var layoutInput = {}; + var ecSize = { + width: api.getWidth(), + height: api.getHeight() + }; + var realIndex = modelOption.orient === 'horizontal' ? 1 : 0; + var reals = paramsSet[realIndex]; + var fakeValue = [0, null, 10]; + var layoutInput = {}; - for (var i = 0; i < 3; i++) { - layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i]; - layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]]; - } + for (var i = 0; i < 3; i++) { + layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i]; + layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]]; + } - var rParam = [['x', 'width', 3], ['y', 'height', 0]][realIndex]; - var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding); - return reals[(rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5 < ecSize[rParam[1]] * 0.5 ? 0 : 1]; + var rParam = [['x', 'width', 3], ['y', 'height', 0]][realIndex]; + var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding); + return reals[(rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5 < ecSize[rParam[1]] * 0.5 ? 0 : 1]; } /** * Prepare dataIndex for outside usage, where dataIndex means rawIndex, and @@ -90688,15 +90688,15 @@ // TODO: TYPE more specified payload types. function makeHighDownBatch(batch, visualMapModel) { - each(batch || [], function (batchItem) { - if (batchItem.dataIndex != null) { - batchItem.dataIndexInside = batchItem.dataIndex; - batchItem.dataIndex = null; - } + each(batch || [], function (batchItem) { + if (batchItem.dataIndex != null) { + batchItem.dataIndexInside = batchItem.dataIndex; + batchItem.dataIndex = null; + } - batchItem.highlightKey = 'visualMap' + (visualMapModel ? visualMapModel.componentIndex : ''); - }); - return batch; + batchItem.highlightKey = 'visualMap' + (visualMapModel ? visualMapModel.componentIndex : ''); + }); + return batch; } var linearMap$2 = linearMap; @@ -90714,729 +90714,729 @@ // The logic of transform is implemented in this._createBarGroup. var ContinuousView = - /** @class */ - function (_super) { - __extends(ContinuousView, _super); - - function ContinuousView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = ContinuousView.type; - _this._shapes = {}; - _this._dataInterval = []; - _this._handleEnds = []; - _this._hoverLinkDataIndices = []; - return _this; - } - - ContinuousView.prototype.doRender = function (visualMapModel, ecModel, api, payload) { - this._api = api; - - if (!payload || payload.type !== 'selectDataRange' || payload.from !== this.uid) { - this._buildView(); - } - }; - - ContinuousView.prototype._buildView = function () { - this.group.removeAll(); - var visualMapModel = this.visualMapModel; - var thisGroup = this.group; - this._orient = visualMapModel.get('orient'); - this._useHandle = visualMapModel.get('calculable'); + /** @class */ + function (_super) { + __extends(ContinuousView, _super); - this._resetInterval(); + function ContinuousView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - this._renderBar(thisGroup); + _this.type = ContinuousView.type; + _this._shapes = {}; + _this._dataInterval = []; + _this._handleEnds = []; + _this._hoverLinkDataIndices = []; + return _this; + } - var dataRangeText = visualMapModel.get('text'); + ContinuousView.prototype.doRender = function (visualMapModel, ecModel, api, payload) { + this._api = api; - this._renderEndsText(thisGroup, dataRangeText, 0); - - this._renderEndsText(thisGroup, dataRangeText, 1); // Do this for background size calculation. - - - this._updateView(true); // After updating view, inner shapes is built completely, - // and then background can be rendered. - - - this.renderBackground(thisGroup); // Real update view - - this._updateView(); - - this._enableHoverLinkToSeries(); - - this._enableHoverLinkFromSeries(); + if (!payload || payload.type !== 'selectDataRange' || payload.from !== this.uid) { + this._buildView(); + } + }; - this.positionGroup(thisGroup); - }; + ContinuousView.prototype._buildView = function () { + this.group.removeAll(); + var visualMapModel = this.visualMapModel; + var thisGroup = this.group; + this._orient = visualMapModel.get('orient'); + this._useHandle = visualMapModel.get('calculable'); - ContinuousView.prototype._renderEndsText = function (group, dataRangeText, endsIndex) { - if (!dataRangeText) { - return; - } // Compatible with ec2, text[0] map to high value, text[1] map low value. + this._resetInterval(); + this._renderBar(thisGroup); - var text = dataRangeText[1 - endsIndex]; - text = text != null ? text + '' : ''; - var visualMapModel = this.visualMapModel; - var textGap = visualMapModel.get('textGap'); - var itemSize = visualMapModel.itemSize; - var barGroup = this._shapes.mainGroup; + var dataRangeText = visualMapModel.get('text'); - var position = this._applyTransform([itemSize[0] / 2, endsIndex === 0 ? -textGap : itemSize[1] + textGap], barGroup); + this._renderEndsText(thisGroup, dataRangeText, 0); - var align = this._applyTransform(endsIndex === 0 ? 'bottom' : 'top', barGroup); + this._renderEndsText(thisGroup, dataRangeText, 1); // Do this for background size calculation. - var orient = this._orient; - var textStyleModel = this.visualMapModel.textStyleModel; - this.group.add(new ZRText({ - style: createTextStyle(textStyleModel, { - x: position[0], - y: position[1], - verticalAlign: orient === 'horizontal' ? 'middle' : align, - align: orient === 'horizontal' ? align : 'center', - text: text - }) - })); - }; - ContinuousView.prototype._renderBar = function (targetGroup) { - var visualMapModel = this.visualMapModel; - var shapes = this._shapes; - var itemSize = visualMapModel.itemSize; - var orient = this._orient; - var useHandle = this._useHandle; - var itemAlign = getItemAlign(visualMapModel, this.api, itemSize); - - var mainGroup = shapes.mainGroup = this._createBarGroup(itemAlign); - - var gradientBarGroup = new Group(); - mainGroup.add(gradientBarGroup); // Bar - - gradientBarGroup.add(shapes.outOfRange = createPolygon()); - gradientBarGroup.add(shapes.inRange = createPolygon(null, useHandle ? getCursor$1(this._orient) : null, bind(this._dragHandle, this, 'all', false), bind(this._dragHandle, this, 'all', true))); // A border radius clip. - - gradientBarGroup.setClipPath(new Rect({ - shape: { - x: 0, - y: 0, - width: itemSize[0], - height: itemSize[1], - r: 3 - } - })); - var textRect = visualMapModel.textStyleModel.getTextRect('国'); - var textSize = mathMax$a(textRect.width, textRect.height); // Handle + this._updateView(true); // After updating view, inner shapes is built completely, + // and then background can be rendered. - if (useHandle) { - shapes.handleThumbs = []; - shapes.handleLabels = []; - shapes.handleLabelPoints = []; - this._createHandle(visualMapModel, mainGroup, 0, itemSize, textSize, orient); + this.renderBackground(thisGroup); // Real update view - this._createHandle(visualMapModel, mainGroup, 1, itemSize, textSize, orient); - } + this._updateView(); - this._createIndicator(visualMapModel, mainGroup, itemSize, textSize, orient); + this._enableHoverLinkToSeries(); - targetGroup.add(mainGroup); - }; + this._enableHoverLinkFromSeries(); - ContinuousView.prototype._createHandle = function (visualMapModel, mainGroup, handleIndex, itemSize, textSize, orient) { - var onDrift = bind(this._dragHandle, this, handleIndex, false); - var onDragEnd = bind(this._dragHandle, this, handleIndex, true); - var handleSize = parsePercent(visualMapModel.get('handleSize'), itemSize[0]); - var handleThumb = createSymbol(visualMapModel.get('handleIcon'), -handleSize / 2, -handleSize / 2, handleSize, handleSize, null, true); - var cursor = getCursor$1(this._orient); - handleThumb.attr({ - cursor: cursor, - draggable: true, - drift: onDrift, - ondragend: onDragEnd, - onmousemove: function (e) { - stop(e.event); - } - }); - handleThumb.x = itemSize[0] / 2; - handleThumb.useStyle(visualMapModel.getModel('handleStyle').getItemStyle()); - handleThumb.setStyle({ - strokeNoScale: true, - strokeFirst: true - }); - handleThumb.style.lineWidth *= 2; - handleThumb.ensureState('emphasis').style = visualMapModel.getModel(['emphasis', 'handleStyle']).getItemStyle(); - setAsHighDownDispatcher(handleThumb, true); - mainGroup.add(handleThumb); // Text is always horizontal layout but should not be effected by - // transform (orient/inverse). So label is built separately but not - // use zrender/graphic/helper/RectText, and is located based on view - // group (according to handleLabelPoint) but not barGroup. - - var textStyleModel = this.visualMapModel.textStyleModel; - var handleLabel = new ZRText({ - cursor: cursor, - draggable: true, - drift: onDrift, - onmousemove: function (e) { - // Fot mobile devicem, prevent screen slider on the button. - stop(e.event); - }, - ondragend: onDragEnd, - style: createTextStyle(textStyleModel, { - x: 0, - y: 0, - text: '' - }) - }); - handleLabel.ensureState('blur').style = { - opacity: 0.1 - }; - handleLabel.stateTransition = { - duration: 200 - }; - this.group.add(handleLabel); - var handleLabelPoint = [handleSize, 0]; - var shapes = this._shapes; - shapes.handleThumbs[handleIndex] = handleThumb; - shapes.handleLabelPoints[handleIndex] = handleLabelPoint; - shapes.handleLabels[handleIndex] = handleLabel; - }; + this.positionGroup(thisGroup); + }; - ContinuousView.prototype._createIndicator = function (visualMapModel, mainGroup, itemSize, textSize, orient) { - var scale = parsePercent(visualMapModel.get('indicatorSize'), itemSize[0]); - var indicator = createSymbol(visualMapModel.get('indicatorIcon'), -scale / 2, -scale / 2, scale, scale, null, true); - indicator.attr({ - cursor: 'move', - invisible: true, - silent: true, - x: itemSize[0] / 2 - }); - var indicatorStyle = visualMapModel.getModel('indicatorStyle').getItemStyle(); - - if (indicator instanceof ZRImage) { - var pathStyle = indicator.style; - indicator.useStyle(extend({ - // TODO other properties like x, y ? - image: pathStyle.image, - x: pathStyle.x, - y: pathStyle.y, - width: pathStyle.width, - height: pathStyle.height - }, indicatorStyle)); - } else { - indicator.useStyle(indicatorStyle); - } - - mainGroup.add(indicator); - var textStyleModel = this.visualMapModel.textStyleModel; - var indicatorLabel = new ZRText({ - silent: true, - invisible: true, - style: createTextStyle(textStyleModel, { - x: 0, - y: 0, - text: '' - }) - }); - this.group.add(indicatorLabel); - var indicatorLabelPoint = [(orient === 'horizontal' ? textSize / 2 : HOVER_LINK_OUT) + itemSize[0] / 2, 0]; - var shapes = this._shapes; - shapes.indicator = indicator; - shapes.indicatorLabel = indicatorLabel; - shapes.indicatorLabelPoint = indicatorLabelPoint; - this._firstShowIndicator = true; - }; + ContinuousView.prototype._renderEndsText = function (group, dataRangeText, endsIndex) { + if (!dataRangeText) { + return; + } // Compatible with ec2, text[0] map to high value, text[1] map low value. - ContinuousView.prototype._dragHandle = function (handleIndex, isEnd, // dx is event from ondragend if isEnd is true. It's not used - dx, dy) { - if (!this._useHandle) { - return; - } - this._dragging = !isEnd; + var text = dataRangeText[1 - endsIndex]; + text = text != null ? text + '' : ''; + var visualMapModel = this.visualMapModel; + var textGap = visualMapModel.get('textGap'); + var itemSize = visualMapModel.itemSize; + var barGroup = this._shapes.mainGroup; - if (!isEnd) { - // Transform dx, dy to bar coordination. - var vertex = this._applyTransform([dx, dy], this._shapes.mainGroup, true); + var position = this._applyTransform([itemSize[0] / 2, endsIndex === 0 ? -textGap : itemSize[1] + textGap], barGroup); - this._updateInterval(handleIndex, vertex[1]); + var align = this._applyTransform(endsIndex === 0 ? 'bottom' : 'top', barGroup); - this._hideIndicator(); // Considering realtime, update view should be executed - // before dispatch action. + var orient = this._orient; + var textStyleModel = this.visualMapModel.textStyleModel; + this.group.add(new ZRText({ + style: createTextStyle(textStyleModel, { + x: position[0], + y: position[1], + verticalAlign: orient === 'horizontal' ? 'middle' : align, + align: orient === 'horizontal' ? align : 'center', + text: text + }) + })); + }; + ContinuousView.prototype._renderBar = function (targetGroup) { + var visualMapModel = this.visualMapModel; + var shapes = this._shapes; + var itemSize = visualMapModel.itemSize; + var orient = this._orient; + var useHandle = this._useHandle; + var itemAlign = getItemAlign(visualMapModel, this.api, itemSize); - this._updateView(); - } // dragEnd do not dispatch action when realtime. + var mainGroup = shapes.mainGroup = this._createBarGroup(itemAlign); + var gradientBarGroup = new Group(); + mainGroup.add(gradientBarGroup); // Bar - if (isEnd === !this.visualMapModel.get('realtime')) { - // jshint ignore:line - this.api.dispatchAction({ - type: 'selectDataRange', - from: this.uid, - visualMapId: this.visualMapModel.id, - selected: this._dataInterval.slice() - }); - } + gradientBarGroup.add(shapes.outOfRange = createPolygon()); + gradientBarGroup.add(shapes.inRange = createPolygon(null, useHandle ? getCursor$1(this._orient) : null, bind(this._dragHandle, this, 'all', false), bind(this._dragHandle, this, 'all', true))); // A border radius clip. - if (isEnd) { - !this._hovering && this._clearHoverLinkToSeries(); - } else if (useHoverLinkOnHandle(this.visualMapModel)) { - this._doHoverLinkToSeries(this._handleEnds[handleIndex], false); - } - }; + gradientBarGroup.setClipPath(new Rect({ + shape: { + x: 0, + y: 0, + width: itemSize[0], + height: itemSize[1], + r: 3 + } + })); + var textRect = visualMapModel.textStyleModel.getTextRect('国'); + var textSize = mathMax$a(textRect.width, textRect.height); // Handle - ContinuousView.prototype._resetInterval = function () { - var visualMapModel = this.visualMapModel; - var dataInterval = this._dataInterval = visualMapModel.getSelected(); - var dataExtent = visualMapModel.getExtent(); - var sizeExtent = [0, visualMapModel.itemSize[1]]; - this._handleEnds = [linearMap$2(dataInterval[0], dataExtent, sizeExtent, true), linearMap$2(dataInterval[1], dataExtent, sizeExtent, true)]; - }; - /** - * @private - * @param {(number|string)} handleIndex 0 or 1 or 'all' - * @param {number} dx - * @param {number} dy - */ + if (useHandle) { + shapes.handleThumbs = []; + shapes.handleLabels = []; + shapes.handleLabelPoints = []; + this._createHandle(visualMapModel, mainGroup, 0, itemSize, textSize, orient); - ContinuousView.prototype._updateInterval = function (handleIndex, delta) { - delta = delta || 0; - var visualMapModel = this.visualMapModel; - var handleEnds = this._handleEnds; - var sizeExtent = [0, visualMapModel.itemSize[1]]; - sliderMove(delta, handleEnds, sizeExtent, handleIndex, // cross is forbiden - 0); - var dataExtent = visualMapModel.getExtent(); // Update data interval. + this._createHandle(visualMapModel, mainGroup, 1, itemSize, textSize, orient); + } - this._dataInterval = [linearMap$2(handleEnds[0], sizeExtent, dataExtent, true), linearMap$2(handleEnds[1], sizeExtent, dataExtent, true)]; - }; + this._createIndicator(visualMapModel, mainGroup, itemSize, textSize, orient); - ContinuousView.prototype._updateView = function (forSketch) { - var visualMapModel = this.visualMapModel; - var dataExtent = visualMapModel.getExtent(); - var shapes = this._shapes; - var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]]; - var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds; + targetGroup.add(mainGroup); + }; - var visualInRange = this._createBarVisual(this._dataInterval, dataExtent, inRangeHandleEnds, 'inRange'); + ContinuousView.prototype._createHandle = function (visualMapModel, mainGroup, handleIndex, itemSize, textSize, orient) { + var onDrift = bind(this._dragHandle, this, handleIndex, false); + var onDragEnd = bind(this._dragHandle, this, handleIndex, true); + var handleSize = parsePercent(visualMapModel.get('handleSize'), itemSize[0]); + var handleThumb = createSymbol(visualMapModel.get('handleIcon'), -handleSize / 2, -handleSize / 2, handleSize, handleSize, null, true); + var cursor = getCursor$1(this._orient); + handleThumb.attr({ + cursor: cursor, + draggable: true, + drift: onDrift, + ondragend: onDragEnd, + onmousemove: function (e) { + stop(e.event); + } + }); + handleThumb.x = itemSize[0] / 2; + handleThumb.useStyle(visualMapModel.getModel('handleStyle').getItemStyle()); + handleThumb.setStyle({ + strokeNoScale: true, + strokeFirst: true + }); + handleThumb.style.lineWidth *= 2; + handleThumb.ensureState('emphasis').style = visualMapModel.getModel(['emphasis', 'handleStyle']).getItemStyle(); + setAsHighDownDispatcher(handleThumb, true); + mainGroup.add(handleThumb); // Text is always horizontal layout but should not be effected by + // transform (orient/inverse). So label is built separately but not + // use zrender/graphic/helper/RectText, and is located based on view + // group (according to handleLabelPoint) but not barGroup. + + var textStyleModel = this.visualMapModel.textStyleModel; + var handleLabel = new ZRText({ + cursor: cursor, + draggable: true, + drift: onDrift, + onmousemove: function (e) { + // Fot mobile devicem, prevent screen slider on the button. + stop(e.event); + }, + ondragend: onDragEnd, + style: createTextStyle(textStyleModel, { + x: 0, + y: 0, + text: '' + }) + }); + handleLabel.ensureState('blur').style = { + opacity: 0.1 + }; + handleLabel.stateTransition = { + duration: 200 + }; + this.group.add(handleLabel); + var handleLabelPoint = [handleSize, 0]; + var shapes = this._shapes; + shapes.handleThumbs[handleIndex] = handleThumb; + shapes.handleLabelPoints[handleIndex] = handleLabelPoint; + shapes.handleLabels[handleIndex] = handleLabel; + }; + + ContinuousView.prototype._createIndicator = function (visualMapModel, mainGroup, itemSize, textSize, orient) { + var scale = parsePercent(visualMapModel.get('indicatorSize'), itemSize[0]); + var indicator = createSymbol(visualMapModel.get('indicatorIcon'), -scale / 2, -scale / 2, scale, scale, null, true); + indicator.attr({ + cursor: 'move', + invisible: true, + silent: true, + x: itemSize[0] / 2 + }); + var indicatorStyle = visualMapModel.getModel('indicatorStyle').getItemStyle(); + + if (indicator instanceof ZRImage) { + var pathStyle = indicator.style; + indicator.useStyle(extend({ + // TODO other properties like x, y ? + image: pathStyle.image, + x: pathStyle.x, + y: pathStyle.y, + width: pathStyle.width, + height: pathStyle.height + }, indicatorStyle)); + } else { + indicator.useStyle(indicatorStyle); + } - var visualOutOfRange = this._createBarVisual(dataExtent, dataExtent, outOfRangeHandleEnds, 'outOfRange'); + mainGroup.add(indicator); + var textStyleModel = this.visualMapModel.textStyleModel; + var indicatorLabel = new ZRText({ + silent: true, + invisible: true, + style: createTextStyle(textStyleModel, { + x: 0, + y: 0, + text: '' + }) + }); + this.group.add(indicatorLabel); + var indicatorLabelPoint = [(orient === 'horizontal' ? textSize / 2 : HOVER_LINK_OUT) + itemSize[0] / 2, 0]; + var shapes = this._shapes; + shapes.indicator = indicator; + shapes.indicatorLabel = indicatorLabel; + shapes.indicatorLabelPoint = indicatorLabelPoint; + this._firstShowIndicator = true; + }; + + ContinuousView.prototype._dragHandle = function (handleIndex, isEnd, // dx is event from ondragend if isEnd is true. It's not used + dx, dy) { + if (!this._useHandle) { + return; + } + + this._dragging = !isEnd; + + if (!isEnd) { + // Transform dx, dy to bar coordination. + var vertex = this._applyTransform([dx, dy], this._shapes.mainGroup, true); + + this._updateInterval(handleIndex, vertex[1]); + + this._hideIndicator(); // Considering realtime, update view should be executed + // before dispatch action. + + + this._updateView(); + } // dragEnd do not dispatch action when realtime. + + + if (isEnd === !this.visualMapModel.get('realtime')) { + // jshint ignore:line + this.api.dispatchAction({ + type: 'selectDataRange', + from: this.uid, + visualMapId: this.visualMapModel.id, + selected: this._dataInterval.slice() + }); + } + + if (isEnd) { + !this._hovering && this._clearHoverLinkToSeries(); + } else if (useHoverLinkOnHandle(this.visualMapModel)) { + this._doHoverLinkToSeries(this._handleEnds[handleIndex], false); + } + }; + + ContinuousView.prototype._resetInterval = function () { + var visualMapModel = this.visualMapModel; + var dataInterval = this._dataInterval = visualMapModel.getSelected(); + var dataExtent = visualMapModel.getExtent(); + var sizeExtent = [0, visualMapModel.itemSize[1]]; + this._handleEnds = [linearMap$2(dataInterval[0], dataExtent, sizeExtent, true), linearMap$2(dataInterval[1], dataExtent, sizeExtent, true)]; + }; + /** + * @private + * @param {(number|string)} handleIndex 0 or 1 or 'all' + * @param {number} dx + * @param {number} dy + */ - shapes.inRange.setStyle({ - fill: visualInRange.barColor // opacity: visualInRange.opacity - }).setShape('points', visualInRange.barPoints); - shapes.outOfRange.setStyle({ - fill: visualOutOfRange.barColor // opacity: visualOutOfRange.opacity + ContinuousView.prototype._updateInterval = function (handleIndex, delta) { + delta = delta || 0; + var visualMapModel = this.visualMapModel; + var handleEnds = this._handleEnds; + var sizeExtent = [0, visualMapModel.itemSize[1]]; + sliderMove(delta, handleEnds, sizeExtent, handleIndex, // cross is forbiden + 0); + var dataExtent = visualMapModel.getExtent(); // Update data interval. - }).setShape('points', visualOutOfRange.barPoints); + this._dataInterval = [linearMap$2(handleEnds[0], sizeExtent, dataExtent, true), linearMap$2(handleEnds[1], sizeExtent, dataExtent, true)]; + }; - this._updateHandle(inRangeHandleEnds, visualInRange); - }; + ContinuousView.prototype._updateView = function (forSketch) { + var visualMapModel = this.visualMapModel; + var dataExtent = visualMapModel.getExtent(); + var shapes = this._shapes; + var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]]; + var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds; - ContinuousView.prototype._createBarVisual = function (dataInterval, dataExtent, handleEnds, forceState) { - var opts = { - forceState: forceState, - convertOpacityToAlpha: true - }; + var visualInRange = this._createBarVisual(this._dataInterval, dataExtent, inRangeHandleEnds, 'inRange'); - var colorStops = this._makeColorGradient(dataInterval, opts); + var visualOutOfRange = this._createBarVisual(dataExtent, dataExtent, outOfRangeHandleEnds, 'outOfRange'); - var symbolSizes = [this.getControllerVisual(dataInterval[0], 'symbolSize', opts), this.getControllerVisual(dataInterval[1], 'symbolSize', opts)]; + shapes.inRange.setStyle({ + fill: visualInRange.barColor // opacity: visualInRange.opacity - var barPoints = this._createBarPoints(handleEnds, symbolSizes); + }).setShape('points', visualInRange.barPoints); + shapes.outOfRange.setStyle({ + fill: visualOutOfRange.barColor // opacity: visualOutOfRange.opacity - return { - barColor: new LinearGradient(0, 0, 0, 1, colorStops), - barPoints: barPoints, - handlesColor: [colorStops[0].color, colorStops[colorStops.length - 1].color] - }; - }; + }).setShape('points', visualOutOfRange.barPoints); - ContinuousView.prototype._makeColorGradient = function (dataInterval, opts) { - // Considering colorHue, which is not linear, so we have to sample - // to calculate gradient color stops, but not only caculate head - // and tail. - var sampleNumber = 100; // Arbitrary value. - - var colorStops = []; - var step = (dataInterval[1] - dataInterval[0]) / sampleNumber; - colorStops.push({ - color: this.getControllerVisual(dataInterval[0], 'color', opts), - offset: 0 - }); + this._updateHandle(inRangeHandleEnds, visualInRange); + }; - for (var i = 1; i < sampleNumber; i++) { - var currValue = dataInterval[0] + step * i; + ContinuousView.prototype._createBarVisual = function (dataInterval, dataExtent, handleEnds, forceState) { + var opts = { + forceState: forceState, + convertOpacityToAlpha: true + }; - if (currValue > dataInterval[1]) { - break; - } + var colorStops = this._makeColorGradient(dataInterval, opts); - colorStops.push({ - color: this.getControllerVisual(currValue, 'color', opts), - offset: i / sampleNumber - }); - } + var symbolSizes = [this.getControllerVisual(dataInterval[0], 'symbolSize', opts), this.getControllerVisual(dataInterval[1], 'symbolSize', opts)]; - colorStops.push({ - color: this.getControllerVisual(dataInterval[1], 'color', opts), - offset: 1 - }); - return colorStops; - }; + var barPoints = this._createBarPoints(handleEnds, symbolSizes); - ContinuousView.prototype._createBarPoints = function (handleEnds, symbolSizes) { - var itemSize = this.visualMapModel.itemSize; - return [[itemSize[0] - symbolSizes[0], handleEnds[0]], [itemSize[0], handleEnds[0]], [itemSize[0], handleEnds[1]], [itemSize[0] - symbolSizes[1], handleEnds[1]]]; - }; + return { + barColor: new LinearGradient(0, 0, 0, 1, colorStops), + barPoints: barPoints, + handlesColor: [colorStops[0].color, colorStops[colorStops.length - 1].color] + }; + }; - ContinuousView.prototype._createBarGroup = function (itemAlign) { - var orient = this._orient; - var inverse = this.visualMapModel.get('inverse'); - return new Group(orient === 'horizontal' && !inverse ? { - scaleX: itemAlign === 'bottom' ? 1 : -1, - rotation: Math.PI / 2 - } : orient === 'horizontal' && inverse ? { - scaleX: itemAlign === 'bottom' ? -1 : 1, - rotation: -Math.PI / 2 - } : orient === 'vertical' && !inverse ? { - scaleX: itemAlign === 'left' ? 1 : -1, - scaleY: -1 - } : { - scaleX: itemAlign === 'left' ? 1 : -1 - }); - }; + ContinuousView.prototype._makeColorGradient = function (dataInterval, opts) { + // Considering colorHue, which is not linear, so we have to sample + // to calculate gradient color stops, but not only caculate head + // and tail. + var sampleNumber = 100; // Arbitrary value. - ContinuousView.prototype._updateHandle = function (handleEnds, visualInRange) { - if (!this._useHandle) { - return; - } + var colorStops = []; + var step = (dataInterval[1] - dataInterval[0]) / sampleNumber; + colorStops.push({ + color: this.getControllerVisual(dataInterval[0], 'color', opts), + offset: 0 + }); - var shapes = this._shapes; - var visualMapModel = this.visualMapModel; - var handleThumbs = shapes.handleThumbs; - var handleLabels = shapes.handleLabels; - var itemSize = visualMapModel.itemSize; - var dataExtent = visualMapModel.getExtent(); - each$e([0, 1], function (handleIndex) { - var handleThumb = handleThumbs[handleIndex]; - handleThumb.setStyle('fill', visualInRange.handlesColor[handleIndex]); - handleThumb.y = handleEnds[handleIndex]; - var val = linearMap$2(handleEnds[handleIndex], [0, itemSize[1]], dataExtent, true); - var symbolSize = this.getControllerVisual(val, 'symbolSize'); - handleThumb.scaleX = handleThumb.scaleY = symbolSize / itemSize[0]; - handleThumb.x = itemSize[0] - symbolSize / 2; // Update handle label position. - - var textPoint = applyTransform$1(shapes.handleLabelPoints[handleIndex], getTransform(handleThumb, this.group)); - handleLabels[handleIndex].setStyle({ - x: textPoint[0], - y: textPoint[1], - text: visualMapModel.formatValueText(this._dataInterval[handleIndex]), - verticalAlign: 'middle', - align: this._orient === 'vertical' ? this._applyTransform('left', shapes.mainGroup) : 'center' - }); - }, this); - }; + for (var i = 1; i < sampleNumber; i++) { + var currValue = dataInterval[0] + step * i; - ContinuousView.prototype._showIndicator = function (cursorValue, textValue, rangeSymbol, halfHoverLinkSize) { - var visualMapModel = this.visualMapModel; - var dataExtent = visualMapModel.getExtent(); - var itemSize = visualMapModel.itemSize; - var sizeExtent = [0, itemSize[1]]; - var shapes = this._shapes; - var indicator = shapes.indicator; + if (currValue > dataInterval[1]) { + break; + } - if (!indicator) { - return; - } + colorStops.push({ + color: this.getControllerVisual(currValue, 'color', opts), + offset: i / sampleNumber + }); + } - indicator.attr('invisible', false); - var opts = { - convertOpacityToAlpha: true - }; - var color = this.getControllerVisual(cursorValue, 'color', opts); - var symbolSize = this.getControllerVisual(cursorValue, 'symbolSize'); - var y = linearMap$2(cursorValue, dataExtent, sizeExtent, true); - var x = itemSize[0] - symbolSize / 2; - var oldIndicatorPos = { - x: indicator.x, - y: indicator.y - }; // Update handle label position. - - indicator.y = y; - indicator.x = x; - var textPoint = applyTransform$1(shapes.indicatorLabelPoint, getTransform(indicator, this.group)); - var indicatorLabel = shapes.indicatorLabel; - indicatorLabel.attr('invisible', false); - - var align = this._applyTransform('left', shapes.mainGroup); - - var orient = this._orient; - var isHorizontal = orient === 'horizontal'; - indicatorLabel.setStyle({ - text: (rangeSymbol ? rangeSymbol : '') + visualMapModel.formatValueText(textValue), - verticalAlign: isHorizontal ? align : 'middle', - align: isHorizontal ? 'center' : align - }); - var indicatorNewProps = { - x: x, - y: y, - style: { - fill: color - } - }; - var labelNewProps = { - style: { - x: textPoint[0], - y: textPoint[1] - } - }; + colorStops.push({ + color: this.getControllerVisual(dataInterval[1], 'color', opts), + offset: 1 + }); + return colorStops; + }; + + ContinuousView.prototype._createBarPoints = function (handleEnds, symbolSizes) { + var itemSize = this.visualMapModel.itemSize; + return [[itemSize[0] - symbolSizes[0], handleEnds[0]], [itemSize[0], handleEnds[0]], [itemSize[0], handleEnds[1]], [itemSize[0] - symbolSizes[1], handleEnds[1]]]; + }; + + ContinuousView.prototype._createBarGroup = function (itemAlign) { + var orient = this._orient; + var inverse = this.visualMapModel.get('inverse'); + return new Group(orient === 'horizontal' && !inverse ? { + scaleX: itemAlign === 'bottom' ? 1 : -1, + rotation: Math.PI / 2 + } : orient === 'horizontal' && inverse ? { + scaleX: itemAlign === 'bottom' ? -1 : 1, + rotation: -Math.PI / 2 + } : orient === 'vertical' && !inverse ? { + scaleX: itemAlign === 'left' ? 1 : -1, + scaleY: -1 + } : { + scaleX: itemAlign === 'left' ? 1 : -1 + }); + }; + + ContinuousView.prototype._updateHandle = function (handleEnds, visualInRange) { + if (!this._useHandle) { + return; + } + + var shapes = this._shapes; + var visualMapModel = this.visualMapModel; + var handleThumbs = shapes.handleThumbs; + var handleLabels = shapes.handleLabels; + var itemSize = visualMapModel.itemSize; + var dataExtent = visualMapModel.getExtent(); + each$e([0, 1], function (handleIndex) { + var handleThumb = handleThumbs[handleIndex]; + handleThumb.setStyle('fill', visualInRange.handlesColor[handleIndex]); + handleThumb.y = handleEnds[handleIndex]; + var val = linearMap$2(handleEnds[handleIndex], [0, itemSize[1]], dataExtent, true); + var symbolSize = this.getControllerVisual(val, 'symbolSize'); + handleThumb.scaleX = handleThumb.scaleY = symbolSize / itemSize[0]; + handleThumb.x = itemSize[0] - symbolSize / 2; // Update handle label position. + + var textPoint = applyTransform$1(shapes.handleLabelPoints[handleIndex], getTransform(handleThumb, this.group)); + handleLabels[handleIndex].setStyle({ + x: textPoint[0], + y: textPoint[1], + text: visualMapModel.formatValueText(this._dataInterval[handleIndex]), + verticalAlign: 'middle', + align: this._orient === 'vertical' ? this._applyTransform('left', shapes.mainGroup) : 'center' + }); + }, this); + }; + + ContinuousView.prototype._showIndicator = function (cursorValue, textValue, rangeSymbol, halfHoverLinkSize) { + var visualMapModel = this.visualMapModel; + var dataExtent = visualMapModel.getExtent(); + var itemSize = visualMapModel.itemSize; + var sizeExtent = [0, itemSize[1]]; + var shapes = this._shapes; + var indicator = shapes.indicator; + + if (!indicator) { + return; + } + + indicator.attr('invisible', false); + var opts = { + convertOpacityToAlpha: true + }; + var color = this.getControllerVisual(cursorValue, 'color', opts); + var symbolSize = this.getControllerVisual(cursorValue, 'symbolSize'); + var y = linearMap$2(cursorValue, dataExtent, sizeExtent, true); + var x = itemSize[0] - symbolSize / 2; + var oldIndicatorPos = { + x: indicator.x, + y: indicator.y + }; // Update handle label position. + + indicator.y = y; + indicator.x = x; + var textPoint = applyTransform$1(shapes.indicatorLabelPoint, getTransform(indicator, this.group)); + var indicatorLabel = shapes.indicatorLabel; + indicatorLabel.attr('invisible', false); + + var align = this._applyTransform('left', shapes.mainGroup); + + var orient = this._orient; + var isHorizontal = orient === 'horizontal'; + indicatorLabel.setStyle({ + text: (rangeSymbol ? rangeSymbol : '') + visualMapModel.formatValueText(textValue), + verticalAlign: isHorizontal ? align : 'middle', + align: isHorizontal ? 'center' : align + }); + var indicatorNewProps = { + x: x, + y: y, + style: { + fill: color + } + }; + var labelNewProps = { + style: { + x: textPoint[0], + y: textPoint[1] + } + }; + + if (visualMapModel.ecModel.isAnimationEnabled() && !this._firstShowIndicator) { + var animationCfg = { + duration: 100, + easing: 'cubicInOut', + additive: true + }; + indicator.x = oldIndicatorPos.x; + indicator.y = oldIndicatorPos.y; + indicator.animateTo(indicatorNewProps, animationCfg); + indicatorLabel.animateTo(labelNewProps, animationCfg); + } else { + indicator.attr(indicatorNewProps); + indicatorLabel.attr(labelNewProps); + } - if (visualMapModel.ecModel.isAnimationEnabled() && !this._firstShowIndicator) { - var animationCfg = { - duration: 100, - easing: 'cubicInOut', - additive: true - }; - indicator.x = oldIndicatorPos.x; - indicator.y = oldIndicatorPos.y; - indicator.animateTo(indicatorNewProps, animationCfg); - indicatorLabel.animateTo(labelNewProps, animationCfg); - } else { - indicator.attr(indicatorNewProps); - indicatorLabel.attr(labelNewProps); - } + this._firstShowIndicator = false; + var handleLabels = this._shapes.handleLabels; - this._firstShowIndicator = false; - var handleLabels = this._shapes.handleLabels; + if (handleLabels) { + for (var i = 0; i < handleLabels.length; i++) { + // Fade out handle labels. + // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it. + this._api.enterBlur(handleLabels[i]); + } + } + }; - if (handleLabels) { - for (var i = 0; i < handleLabels.length; i++) { - // Fade out handle labels. - // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it. - this._api.enterBlur(handleLabels[i]); - } - } - }; + ContinuousView.prototype._enableHoverLinkToSeries = function () { + var self = this; - ContinuousView.prototype._enableHoverLinkToSeries = function () { - var self = this; + this._shapes.mainGroup.on('mousemove', function (e) { + self._hovering = true; - this._shapes.mainGroup.on('mousemove', function (e) { - self._hovering = true; + if (!self._dragging) { + var itemSize = self.visualMapModel.itemSize; - if (!self._dragging) { - var itemSize = self.visualMapModel.itemSize; + var pos = self._applyTransform([e.offsetX, e.offsetY], self._shapes.mainGroup, true, true); // For hover link show when hover handle, which might be + // below or upper than sizeExtent. - var pos = self._applyTransform([e.offsetX, e.offsetY], self._shapes.mainGroup, true, true); // For hover link show when hover handle, which might be - // below or upper than sizeExtent. + pos[1] = mathMin$a(mathMax$a(0, pos[1]), itemSize[1]); - pos[1] = mathMin$a(mathMax$a(0, pos[1]), itemSize[1]); + self._doHoverLinkToSeries(pos[1], 0 <= pos[0] && pos[0] <= itemSize[0]); + } + }).on('mouseout', function () { + // When mouse is out of handle, hoverLink still need + // to be displayed when realtime is set as false. + self._hovering = false; + !self._dragging && self._clearHoverLinkToSeries(); + }); + }; - self._doHoverLinkToSeries(pos[1], 0 <= pos[0] && pos[0] <= itemSize[0]); - } - }).on('mouseout', function () { - // When mouse is out of handle, hoverLink still need - // to be displayed when realtime is set as false. - self._hovering = false; - !self._dragging && self._clearHoverLinkToSeries(); - }); - }; + ContinuousView.prototype._enableHoverLinkFromSeries = function () { + var zr = this.api.getZr(); - ContinuousView.prototype._enableHoverLinkFromSeries = function () { - var zr = this.api.getZr(); + if (this.visualMapModel.option.hoverLink) { + zr.on('mouseover', this._hoverLinkFromSeriesMouseOver, this); + zr.on('mouseout', this._hideIndicator, this); + } else { + this._clearHoverLinkFromSeries(); + } + }; - if (this.visualMapModel.option.hoverLink) { - zr.on('mouseover', this._hoverLinkFromSeriesMouseOver, this); - zr.on('mouseout', this._hideIndicator, this); - } else { - this._clearHoverLinkFromSeries(); - } - }; + ContinuousView.prototype._doHoverLinkToSeries = function (cursorPos, hoverOnBar) { + var visualMapModel = this.visualMapModel; + var itemSize = visualMapModel.itemSize; - ContinuousView.prototype._doHoverLinkToSeries = function (cursorPos, hoverOnBar) { - var visualMapModel = this.visualMapModel; - var itemSize = visualMapModel.itemSize; + if (!visualMapModel.option.hoverLink) { + return; + } - if (!visualMapModel.option.hoverLink) { - return; - } + var sizeExtent = [0, itemSize[1]]; + var dataExtent = visualMapModel.getExtent(); // For hover link show when hover handle, which might be below or upper than sizeExtent. - var sizeExtent = [0, itemSize[1]]; - var dataExtent = visualMapModel.getExtent(); // For hover link show when hover handle, which might be below or upper than sizeExtent. + cursorPos = mathMin$a(mathMax$a(sizeExtent[0], cursorPos), sizeExtent[1]); + var halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent); + var hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize]; + var cursorValue = linearMap$2(cursorPos, sizeExtent, dataExtent, true); + var valueRange = [linearMap$2(hoverRange[0], sizeExtent, dataExtent, true), linearMap$2(hoverRange[1], sizeExtent, dataExtent, true)]; // Consider data range is out of visualMap range, see test/visualMap-continuous.html, + // where china and india has very large population. - cursorPos = mathMin$a(mathMax$a(sizeExtent[0], cursorPos), sizeExtent[1]); - var halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent); - var hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize]; - var cursorValue = linearMap$2(cursorPos, sizeExtent, dataExtent, true); - var valueRange = [linearMap$2(hoverRange[0], sizeExtent, dataExtent, true), linearMap$2(hoverRange[1], sizeExtent, dataExtent, true)]; // Consider data range is out of visualMap range, see test/visualMap-continuous.html, - // where china and india has very large population. + hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity); + hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity); // Do not show indicator when mouse is over handle, + // otherwise labels overlap, especially when dragging. - hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity); - hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity); // Do not show indicator when mouse is over handle, - // otherwise labels overlap, especially when dragging. + if (hoverOnBar) { + if (valueRange[0] === -Infinity) { + this._showIndicator(cursorValue, valueRange[1], '< ', halfHoverLinkSize); + } else if (valueRange[1] === Infinity) { + this._showIndicator(cursorValue, valueRange[0], '> ', halfHoverLinkSize); + } else { + this._showIndicator(cursorValue, cursorValue, '≈ ', halfHoverLinkSize); + } + } // When realtime is set as false, handles, which are in barGroup, + // also trigger hoverLink, which help user to realize where they + // focus on when dragging. (see test/heatmap-large.html) + // When realtime is set as true, highlight will not show when hover + // handle, because the label on handle, which displays a exact value + // but not range, might mislead users. - if (hoverOnBar) { - if (valueRange[0] === -Infinity) { - this._showIndicator(cursorValue, valueRange[1], '< ', halfHoverLinkSize); - } else if (valueRange[1] === Infinity) { - this._showIndicator(cursorValue, valueRange[0], '> ', halfHoverLinkSize); - } else { - this._showIndicator(cursorValue, cursorValue, '≈ ', halfHoverLinkSize); - } - } // When realtime is set as false, handles, which are in barGroup, - // also trigger hoverLink, which help user to realize where they - // focus on when dragging. (see test/heatmap-large.html) - // When realtime is set as true, highlight will not show when hover - // handle, because the label on handle, which displays a exact value - // but not range, might mislead users. + var oldBatch = this._hoverLinkDataIndices; + var newBatch = []; - var oldBatch = this._hoverLinkDataIndices; - var newBatch = []; + if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) { + newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange); + } - if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) { - newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange); - } + var resultBatches = compressBatches(oldBatch, newBatch); - var resultBatches = compressBatches(oldBatch, newBatch); + this._dispatchHighDown('downplay', makeHighDownBatch(resultBatches[0], visualMapModel)); - this._dispatchHighDown('downplay', makeHighDownBatch(resultBatches[0], visualMapModel)); + this._dispatchHighDown('highlight', makeHighDownBatch(resultBatches[1], visualMapModel)); + }; - this._dispatchHighDown('highlight', makeHighDownBatch(resultBatches[1], visualMapModel)); - }; + ContinuousView.prototype._hoverLinkFromSeriesMouseOver = function (e) { + var el = e.target; + var visualMapModel = this.visualMapModel; - ContinuousView.prototype._hoverLinkFromSeriesMouseOver = function (e) { - var el = e.target; - var visualMapModel = this.visualMapModel; + if (!el || getECData(el).dataIndex == null) { + return; + } - if (!el || getECData(el).dataIndex == null) { - return; - } + var ecData = getECData(el); + var dataModel = this.ecModel.getSeriesByIndex(ecData.seriesIndex); - var ecData = getECData(el); - var dataModel = this.ecModel.getSeriesByIndex(ecData.seriesIndex); + if (!visualMapModel.isTargetSeries(dataModel)) { + return; + } - if (!visualMapModel.isTargetSeries(dataModel)) { - return; - } + var data = dataModel.getData(ecData.dataType); + var value = data.getStore().get(visualMapModel.getDataDimensionIndex(data), ecData.dataIndex); - var data = dataModel.getData(ecData.dataType); - var value = data.getStore().get(visualMapModel.getDataDimensionIndex(data), ecData.dataIndex); + if (!isNaN(value)) { + this._showIndicator(value, value); + } + }; - if (!isNaN(value)) { - this._showIndicator(value, value); - } - }; + ContinuousView.prototype._hideIndicator = function () { + var shapes = this._shapes; + shapes.indicator && shapes.indicator.attr('invisible', true); + shapes.indicatorLabel && shapes.indicatorLabel.attr('invisible', true); + var handleLabels = this._shapes.handleLabels; - ContinuousView.prototype._hideIndicator = function () { - var shapes = this._shapes; - shapes.indicator && shapes.indicator.attr('invisible', true); - shapes.indicatorLabel && shapes.indicatorLabel.attr('invisible', true); - var handleLabels = this._shapes.handleLabels; - - if (handleLabels) { - for (var i = 0; i < handleLabels.length; i++) { - // Fade out handle labels. - // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it. - this._api.leaveBlur(handleLabels[i]); - } - } - }; + if (handleLabels) { + for (var i = 0; i < handleLabels.length; i++) { + // Fade out handle labels. + // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it. + this._api.leaveBlur(handleLabels[i]); + } + } + }; - ContinuousView.prototype._clearHoverLinkToSeries = function () { - this._hideIndicator(); + ContinuousView.prototype._clearHoverLinkToSeries = function () { + this._hideIndicator(); - var indices = this._hoverLinkDataIndices; + var indices = this._hoverLinkDataIndices; - this._dispatchHighDown('downplay', makeHighDownBatch(indices, this.visualMapModel)); + this._dispatchHighDown('downplay', makeHighDownBatch(indices, this.visualMapModel)); - indices.length = 0; - }; + indices.length = 0; + }; - ContinuousView.prototype._clearHoverLinkFromSeries = function () { - this._hideIndicator(); + ContinuousView.prototype._clearHoverLinkFromSeries = function () { + this._hideIndicator(); - var zr = this.api.getZr(); - zr.off('mouseover', this._hoverLinkFromSeriesMouseOver); - zr.off('mouseout', this._hideIndicator); - }; + var zr = this.api.getZr(); + zr.off('mouseover', this._hoverLinkFromSeriesMouseOver); + zr.off('mouseout', this._hideIndicator); + }; - ContinuousView.prototype._applyTransform = function (vertex, element, inverse, global) { - var transform = getTransform(element, global ? null : this.group); - return isArray(vertex) ? applyTransform$1(vertex, transform, inverse) : transformDirection(vertex, transform, inverse); - }; // TODO: TYPE more specified payload types. + ContinuousView.prototype._applyTransform = function (vertex, element, inverse, global) { + var transform = getTransform(element, global ? null : this.group); + return isArray(vertex) ? applyTransform$1(vertex, transform, inverse) : transformDirection(vertex, transform, inverse); + }; // TODO: TYPE more specified payload types. - ContinuousView.prototype._dispatchHighDown = function (type, batch) { - batch && batch.length && this.api.dispatchAction({ - type: type, - batch: batch - }); - }; - /** - * @override - */ + ContinuousView.prototype._dispatchHighDown = function (type, batch) { + batch && batch.length && this.api.dispatchAction({ + type: type, + batch: batch + }); + }; + /** + * @override + */ - ContinuousView.prototype.dispose = function () { - this._clearHoverLinkFromSeries(); + ContinuousView.prototype.dispose = function () { + this._clearHoverLinkFromSeries(); - this._clearHoverLinkToSeries(); - }; - /** - * @override - */ + this._clearHoverLinkToSeries(); + }; + /** + * @override + */ - ContinuousView.prototype.remove = function () { - this._clearHoverLinkFromSeries(); + ContinuousView.prototype.remove = function () { + this._clearHoverLinkFromSeries(); - this._clearHoverLinkToSeries(); - }; + this._clearHoverLinkToSeries(); + }; - ContinuousView.type = 'visualMap.continuous'; - return ContinuousView; - }(VisualMapView); + ContinuousView.type = 'visualMap.continuous'; + return ContinuousView; + }(VisualMapView); function createPolygon(points, cursor, onDrift, onDragEnd) { - return new Polygon({ - shape: { - points: points - }, - draggable: !!onDrift, - cursor: cursor, - drift: onDrift, - onmousemove: function (e) { - // Fot mobile devicem, prevent screen slider on the button. - stop(e.event); - }, - ondragend: onDragEnd - }); + return new Polygon({ + shape: { + points: points + }, + draggable: !!onDrift, + cursor: cursor, + drift: onDrift, + onmousemove: function (e) { + // Fot mobile devicem, prevent screen slider on the button. + stop(e.event); + }, + ondragend: onDragEnd + }); } function getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent) { - var halfHoverLinkSize = HOVER_LINK_SIZE / 2; - var hoverLinkDataSize = visualMapModel.get('hoverLinkDataSize'); + var halfHoverLinkSize = HOVER_LINK_SIZE / 2; + var hoverLinkDataSize = visualMapModel.get('hoverLinkDataSize'); - if (hoverLinkDataSize) { - halfHoverLinkSize = linearMap$2(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2; - } + if (hoverLinkDataSize) { + halfHoverLinkSize = linearMap$2(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2; + } - return halfHoverLinkSize; + return halfHoverLinkSize; } function useHoverLinkOnHandle(visualMapModel) { - var hoverLinkOnHandle = visualMapModel.get('hoverLinkOnHandle'); - return !!(hoverLinkOnHandle == null ? visualMapModel.get('realtime') : hoverLinkOnHandle); + var hoverLinkOnHandle = visualMapModel.get('hoverLinkOnHandle'); + return !!(hoverLinkOnHandle == null ? visualMapModel.get('realtime') : hoverLinkOnHandle); } function getCursor$1(orient) { - return orient === 'vertical' ? 'ns-resize' : 'ew-resize'; + return orient === 'vertical' ? 'ns-resize' : 'ew-resize'; } /* @@ -91482,464 +91482,464 @@ * under the License. */ var visualMapActionInfo = { - type: 'selectDataRange', - event: 'dataRangeSelected', - // FIXME use updateView appears wrong - update: 'update' + type: 'selectDataRange', + event: 'dataRangeSelected', + // FIXME use updateView appears wrong + update: 'update' }; var visualMapActionHander = function (payload, ecModel) { - ecModel.eachComponent({ - mainType: 'visualMap', - query: payload - }, function (model) { - model.setSelected(payload.selected); - }); + ecModel.eachComponent({ + mainType: 'visualMap', + query: payload + }, function (model) { + model.setSelected(payload.selected); + }); }; var visualMapEncodingHandlers = [{ - createOnAllSeries: true, - reset: function (seriesModel, ecModel) { - var resetDefines = []; - ecModel.eachComponent('visualMap', function (visualMapModel) { - var pipelineContext = seriesModel.pipelineContext; + createOnAllSeries: true, + reset: function (seriesModel, ecModel) { + var resetDefines = []; + ecModel.eachComponent('visualMap', function (visualMapModel) { + var pipelineContext = seriesModel.pipelineContext; - if (!visualMapModel.isTargetSeries(seriesModel) || pipelineContext && pipelineContext.large) { - return; - } + if (!visualMapModel.isTargetSeries(seriesModel) || pipelineContext && pipelineContext.large) { + return; + } - resetDefines.push(incrementalApplyVisual(visualMapModel.stateList, visualMapModel.targetVisuals, bind(visualMapModel.getValueState, visualMapModel), visualMapModel.getDataDimensionIndex(seriesModel.getData()))); - }); - return resetDefines; - } + resetDefines.push(incrementalApplyVisual(visualMapModel.stateList, visualMapModel.targetVisuals, bind(visualMapModel.getValueState, visualMapModel), visualMapModel.getDataDimensionIndex(seriesModel.getData()))); + }); + return resetDefines; + } }, // Only support color. - { - createOnAllSeries: true, - reset: function (seriesModel, ecModel) { - var data = seriesModel.getData(); - var visualMetaList = []; - ecModel.eachComponent('visualMap', function (visualMapModel) { - if (visualMapModel.isTargetSeries(seriesModel)) { - var visualMeta = visualMapModel.getVisualMeta(bind(getColorVisual, null, seriesModel, visualMapModel)) || { - stops: [], - outerColors: [] - }; - var dimIdx = visualMapModel.getDataDimensionIndex(data); - - if (dimIdx >= 0) { - // visualMeta.dimension should be dimension index, but not concrete dimension. - visualMeta.dimension = dimIdx; - visualMetaList.push(visualMeta); - } - } - }); // console.log(JSON.stringify(visualMetaList.map(a => a.stops))); - - seriesModel.getData().setVisual('visualMeta', visualMetaList); - } - }]; // FIXME + { + createOnAllSeries: true, + reset: function (seriesModel, ecModel) { + var data = seriesModel.getData(); + var visualMetaList = []; + ecModel.eachComponent('visualMap', function (visualMapModel) { + if (visualMapModel.isTargetSeries(seriesModel)) { + var visualMeta = visualMapModel.getVisualMeta(bind(getColorVisual, null, seriesModel, visualMapModel)) || { + stops: [], + outerColors: [] + }; + var dimIdx = visualMapModel.getDataDimensionIndex(data); + + if (dimIdx >= 0) { + // visualMeta.dimension should be dimension index, but not concrete dimension. + visualMeta.dimension = dimIdx; + visualMetaList.push(visualMeta); + } + } + }); // console.log(JSON.stringify(visualMetaList.map(a => a.stops))); + + seriesModel.getData().setVisual('visualMeta', visualMetaList); + } + }]; // FIXME // performance and export for heatmap? // value can be Infinity or -Infinity function getColorVisual(seriesModel, visualMapModel, value, valueState) { - var mappings = visualMapModel.targetVisuals[valueState]; - var visualTypes = VisualMapping.prepareVisualTypes(mappings); - var resultVisual = { - color: getVisualFromData(seriesModel.getData(), 'color') // default color. + var mappings = visualMapModel.targetVisuals[valueState]; + var visualTypes = VisualMapping.prepareVisualTypes(mappings); + var resultVisual = { + color: getVisualFromData(seriesModel.getData(), 'color') // default color. - }; + }; - for (var i = 0, len = visualTypes.length; i < len; i++) { - var type = visualTypes[i]; - var mapping = mappings[type === 'opacity' ? '__alphaForOpacity' : type]; - mapping && mapping.applyVisual(value, getVisual, setVisual); - } + for (var i = 0, len = visualTypes.length; i < len; i++) { + var type = visualTypes[i]; + var mapping = mappings[type === 'opacity' ? '__alphaForOpacity' : type]; + mapping && mapping.applyVisual(value, getVisual, setVisual); + } - return resultVisual.color; + return resultVisual.color; - function getVisual(key) { - return resultVisual[key]; - } + function getVisual(key) { + return resultVisual[key]; + } - function setVisual(key, value) { - resultVisual[key] = value; - } + function setVisual(key, value) { + resultVisual[key] = value; + } } var each$f = each; function visualMapPreprocessor(option) { - var visualMap = option && option.visualMap; + var visualMap = option && option.visualMap; - if (!isArray(visualMap)) { - visualMap = visualMap ? [visualMap] : []; - } + if (!isArray(visualMap)) { + visualMap = visualMap ? [visualMap] : []; + } - each$f(visualMap, function (opt) { - if (!opt) { - return; - } // rename splitList to pieces + each$f(visualMap, function (opt) { + if (!opt) { + return; + } // rename splitList to pieces - if (has$1(opt, 'splitList') && !has$1(opt, 'pieces')) { - opt.pieces = opt.splitList; - delete opt.splitList; - } + if (has$1(opt, 'splitList') && !has$1(opt, 'pieces')) { + opt.pieces = opt.splitList; + delete opt.splitList; + } - var pieces = opt.pieces; + var pieces = opt.pieces; - if (pieces && isArray(pieces)) { - each$f(pieces, function (piece) { - if (isObject(piece)) { - if (has$1(piece, 'start') && !has$1(piece, 'min')) { - piece.min = piece.start; - } + if (pieces && isArray(pieces)) { + each$f(pieces, function (piece) { + if (isObject(piece)) { + if (has$1(piece, 'start') && !has$1(piece, 'min')) { + piece.min = piece.start; + } - if (has$1(piece, 'end') && !has$1(piece, 'max')) { - piece.max = piece.end; - } - } - }); + if (has$1(piece, 'end') && !has$1(piece, 'max')) { + piece.max = piece.end; + } } - }); + }); + } + }); } function has$1(obj, name) { - return obj && obj.hasOwnProperty && obj.hasOwnProperty(name); + return obj && obj.hasOwnProperty && obj.hasOwnProperty(name); } var installed$1 = false; function installCommon$1(registers) { - if (installed$1) { - return; - } + if (installed$1) { + return; + } - installed$1 = true; - registers.registerSubTypeDefaulter('visualMap', function (option) { - // Compatible with ec2, when splitNumber === 0, continuous visualMap will be used. - return !option.categories && (!(option.pieces ? option.pieces.length > 0 : option.splitNumber > 0) || option.calculable) ? 'continuous' : 'piecewise'; - }); - registers.registerAction(visualMapActionInfo, visualMapActionHander); - each(visualMapEncodingHandlers, function (handler) { - registers.registerVisual(registers.PRIORITY.VISUAL.COMPONENT, handler); - }); - registers.registerPreprocessor(visualMapPreprocessor); + installed$1 = true; + registers.registerSubTypeDefaulter('visualMap', function (option) { + // Compatible with ec2, when splitNumber === 0, continuous visualMap will be used. + return !option.categories && (!(option.pieces ? option.pieces.length > 0 : option.splitNumber > 0) || option.calculable) ? 'continuous' : 'piecewise'; + }); + registers.registerAction(visualMapActionInfo, visualMapActionHander); + each(visualMapEncodingHandlers, function (handler) { + registers.registerVisual(registers.PRIORITY.VISUAL.COMPONENT, handler); + }); + registers.registerPreprocessor(visualMapPreprocessor); } function install$N(registers) { - registers.registerComponentModel(ContinuousModel); - registers.registerComponentView(ContinuousView); - installCommon$1(registers); + registers.registerComponentModel(ContinuousModel); + registers.registerComponentView(ContinuousView); + installCommon$1(registers); } var PiecewiseModel = - /** @class */ - function (_super) { - __extends(PiecewiseModel, _super); - - function PiecewiseModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = PiecewiseModel.type; - /** - * The order is always [low, ..., high]. - * [{text: string, interval: Array.}, ...] - */ - - _this._pieceList = []; - return _this; - } - - PiecewiseModel.prototype.optionUpdated = function (newOption, isInit) { - _super.prototype.optionUpdated.apply(this, arguments); - - this.resetExtent(); - - var mode = this._mode = this._determineMode(); - - this._pieceList = []; + /** @class */ + function (_super) { + __extends(PiecewiseModel, _super); - resetMethods[this._mode].call(this, this._pieceList); + function PiecewiseModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - this._resetSelected(newOption, isInit); - - var categories = this.option.categories; - this.resetVisual(function (mappingOption, state) { - if (mode === 'categories') { - mappingOption.mappingMethod = 'category'; - mappingOption.categories = clone(categories); - } else { - mappingOption.dataExtent = this.getExtent(); - mappingOption.mappingMethod = 'piecewise'; - mappingOption.pieceList = map(this._pieceList, function (piece) { - piece = clone(piece); - - if (state !== 'inRange') { - // FIXME - // outOfRange do not support special visual in pieces. - piece.visual = null; - } + _this.type = PiecewiseModel.type; + /** + * The order is always [low, ..., high]. + * [{text: string, interval: Array.}, ...] + */ - return piece; - }); - } - }); - }; - /** - * @protected - * @override - */ + _this._pieceList = []; + return _this; + } + PiecewiseModel.prototype.optionUpdated = function (newOption, isInit) { + _super.prototype.optionUpdated.apply(this, arguments); - PiecewiseModel.prototype.completeVisualOption = function () { - // Consider this case: - // visualMap: { - // pieces: [{symbol: 'circle', lt: 0}, {symbol: 'rect', gte: 0}] - // } - // where no inRange/outOfRange set but only pieces. So we should make - // default inRange/outOfRange for this case, otherwise visuals that only - // appear in `pieces` will not be taken into account in visual encoding. - var option = this.option; - var visualTypesInPieces = {}; - var visualTypes = VisualMapping.listVisualTypes(); - var isCategory = this.isCategory(); - each(option.pieces, function (piece) { - each(visualTypes, function (visualType) { - if (piece.hasOwnProperty(visualType)) { - visualTypesInPieces[visualType] = 1; - } - }); - }); - each(visualTypesInPieces, function (v, visualType) { - var exists = false; - each(this.stateList, function (state) { - exists = exists || has(option, state, visualType) || has(option.target, state, visualType); - }, this); - !exists && each(this.stateList, function (state) { - (option[state] || (option[state] = {}))[visualType] = visualDefault.get(visualType, state === 'inRange' ? 'active' : 'inactive', isCategory); - }); - }, this); + this.resetExtent(); - function has(obj, state, visualType) { - return obj && obj[state] && obj[state].hasOwnProperty(visualType); - } + var mode = this._mode = this._determineMode(); - _super.prototype.completeVisualOption.apply(this, arguments); - }; + this._pieceList = []; - PiecewiseModel.prototype._resetSelected = function (newOption, isInit) { - var thisOption = this.option; - var pieceList = this._pieceList; // Selected do not merge but all override. + resetMethods[this._mode].call(this, this._pieceList); - var selected = (isInit ? thisOption : newOption).selected || {}; - thisOption.selected = selected; // Consider 'not specified' means true. + this._resetSelected(newOption, isInit); - each(pieceList, function (piece, index) { - var key = this.getSelectedMapKey(piece); + var categories = this.option.categories; + this.resetVisual(function (mappingOption, state) { + if (mode === 'categories') { + mappingOption.mappingMethod = 'category'; + mappingOption.categories = clone(categories); + } else { + mappingOption.dataExtent = this.getExtent(); + mappingOption.mappingMethod = 'piecewise'; + mappingOption.pieceList = map(this._pieceList, function (piece) { + piece = clone(piece); - if (!selected.hasOwnProperty(key)) { - selected[key] = true; - } - }, this); + if (state !== 'inRange') { + // FIXME + // outOfRange do not support special visual in pieces. + piece.visual = null; + } - if (thisOption.selectedMode === 'single') { - // Ensure there is only one selected. - var hasSel_1 = false; - each(pieceList, function (piece, index) { - var key = this.getSelectedMapKey(piece); + return piece; + }); + } + }); + }; + /** + * @protected + * @override + */ - if (selected[key]) { - hasSel_1 ? selected[key] = false : hasSel_1 = true; - } - }, this); - } // thisOption.selectedMode === 'multiple', default: all selected. - }; - /** - * @public - */ + PiecewiseModel.prototype.completeVisualOption = function () { + // Consider this case: + // visualMap: { + // pieces: [{symbol: 'circle', lt: 0}, {symbol: 'rect', gte: 0}] + // } + // where no inRange/outOfRange set but only pieces. So we should make + // default inRange/outOfRange for this case, otherwise visuals that only + // appear in `pieces` will not be taken into account in visual encoding. + var option = this.option; + var visualTypesInPieces = {}; + var visualTypes = VisualMapping.listVisualTypes(); + var isCategory = this.isCategory(); + each(option.pieces, function (piece) { + each(visualTypes, function (visualType) { + if (piece.hasOwnProperty(visualType)) { + visualTypesInPieces[visualType] = 1; + } + }); + }); + each(visualTypesInPieces, function (v, visualType) { + var exists = false; + each(this.stateList, function (state) { + exists = exists || has(option, state, visualType) || has(option.target, state, visualType); + }, this); + !exists && each(this.stateList, function (state) { + (option[state] || (option[state] = {}))[visualType] = visualDefault.get(visualType, state === 'inRange' ? 'active' : 'inactive', isCategory); + }); + }, this); + function has(obj, state, visualType) { + return obj && obj[state] && obj[state].hasOwnProperty(visualType); + } - PiecewiseModel.prototype.getItemSymbol = function () { - return this.get('itemSymbol'); - }; - /** - * @public - */ + _super.prototype.completeVisualOption.apply(this, arguments); + }; + PiecewiseModel.prototype._resetSelected = function (newOption, isInit) { + var thisOption = this.option; + var pieceList = this._pieceList; // Selected do not merge but all override. - PiecewiseModel.prototype.getSelectedMapKey = function (piece) { - return this._mode === 'categories' ? piece.value + '' : piece.index + ''; - }; - /** - * @public - */ + var selected = (isInit ? thisOption : newOption).selected || {}; + thisOption.selected = selected; // Consider 'not specified' means true. + each(pieceList, function (piece, index) { + var key = this.getSelectedMapKey(piece); - PiecewiseModel.prototype.getPieceList = function () { - return this._pieceList; - }; - /** - * @return {string} - */ + if (!selected.hasOwnProperty(key)) { + selected[key] = true; + } + }, this); + if (thisOption.selectedMode === 'single') { + // Ensure there is only one selected. + var hasSel_1 = false; + each(pieceList, function (piece, index) { + var key = this.getSelectedMapKey(piece); - PiecewiseModel.prototype._determineMode = function () { - var option = this.option; - return option.pieces && option.pieces.length > 0 ? 'pieces' : this.option.categories ? 'categories' : 'splitNumber'; - }; - /** - * @override - */ + if (selected[key]) { + hasSel_1 ? selected[key] = false : hasSel_1 = true; + } + }, this); + } // thisOption.selectedMode === 'multiple', default: all selected. + }; + /** + * @public + */ - PiecewiseModel.prototype.setSelected = function (selected) { - this.option.selected = clone(selected); - }; - /** - * @override - */ + PiecewiseModel.prototype.getItemSymbol = function () { + return this.get('itemSymbol'); + }; + /** + * @public + */ - PiecewiseModel.prototype.getValueState = function (value) { - var index = VisualMapping.findPieceIndex(value, this._pieceList); - return index != null ? this.option.selected[this.getSelectedMapKey(this._pieceList[index])] ? 'inRange' : 'outOfRange' : 'outOfRange'; - }; - /** - * @public - * @param pieceIndex piece index in visualMapModel.getPieceList() - */ + PiecewiseModel.prototype.getSelectedMapKey = function (piece) { + return this._mode === 'categories' ? piece.value + '' : piece.index + ''; + }; + /** + * @public + */ - PiecewiseModel.prototype.findTargetDataIndices = function (pieceIndex) { - var result = []; - var pieceList = this._pieceList; - this.eachTargetSeries(function (seriesModel) { - var dataIndices = []; - var data = seriesModel.getData(); - data.each(this.getDataDimensionIndex(data), function (value, dataIndex) { - // Should always base on model pieceList, because it is order sensitive. - var pIdx = VisualMapping.findPieceIndex(value, pieceList); - pIdx === pieceIndex && dataIndices.push(dataIndex); - }, this); - result.push({ - seriesId: seriesModel.id, - dataIndex: dataIndices - }); - }, this); - return result; - }; - /** - * @private - * @param piece piece.value or piece.interval is required. - * @return Can be Infinity or -Infinity - */ + PiecewiseModel.prototype.getPieceList = function () { + return this._pieceList; + }; + /** + * @return {string} + */ - PiecewiseModel.prototype.getRepresentValue = function (piece) { - var representValue; - if (this.isCategory()) { - representValue = piece.value; - } else { - if (piece.value != null) { - representValue = piece.value; - } else { - var pieceInterval = piece.interval || []; - representValue = pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity ? 0 : (pieceInterval[0] + pieceInterval[1]) / 2; - } - } + PiecewiseModel.prototype._determineMode = function () { + var option = this.option; + return option.pieces && option.pieces.length > 0 ? 'pieces' : this.option.categories ? 'categories' : 'splitNumber'; + }; + /** + * @override + */ - return representValue; - }; - PiecewiseModel.prototype.getVisualMeta = function (getColorVisual) { - // Do not support category. (category axis is ordinal, numerical) - if (this.isCategory()) { - return; - } + PiecewiseModel.prototype.setSelected = function (selected) { + this.option.selected = clone(selected); + }; + /** + * @override + */ - var stops = []; - var outerColors = ['', '']; - var visualMapModel = this; - function setStop(interval, valueState) { - var representValue = visualMapModel.getRepresentValue({ - interval: interval - }); // Not category + PiecewiseModel.prototype.getValueState = function (value) { + var index = VisualMapping.findPieceIndex(value, this._pieceList); + return index != null ? this.option.selected[this.getSelectedMapKey(this._pieceList[index])] ? 'inRange' : 'outOfRange' : 'outOfRange'; + }; + /** + * @public + * @param pieceIndex piece index in visualMapModel.getPieceList() + */ - if (!valueState) { - valueState = visualMapModel.getValueState(representValue); - } - var color = getColorVisual(representValue, valueState); + PiecewiseModel.prototype.findTargetDataIndices = function (pieceIndex) { + var result = []; + var pieceList = this._pieceList; + this.eachTargetSeries(function (seriesModel) { + var dataIndices = []; + var data = seriesModel.getData(); + data.each(this.getDataDimensionIndex(data), function (value, dataIndex) { + // Should always base on model pieceList, because it is order sensitive. + var pIdx = VisualMapping.findPieceIndex(value, pieceList); + pIdx === pieceIndex && dataIndices.push(dataIndex); + }, this); + result.push({ + seriesId: seriesModel.id, + dataIndex: dataIndices + }); + }, this); + return result; + }; + /** + * @private + * @param piece piece.value or piece.interval is required. + * @return Can be Infinity or -Infinity + */ - if (interval[0] === -Infinity) { - outerColors[0] = color; - } else if (interval[1] === Infinity) { - outerColors[1] = color; - } else { - stops.push({ - value: interval[0], - color: color - }, { - value: interval[1], - color: color - }); - } - } // Suplement + PiecewiseModel.prototype.getRepresentValue = function (piece) { + var representValue; - var pieceList = this._pieceList.slice(); + if (this.isCategory()) { + representValue = piece.value; + } else { + if (piece.value != null) { + representValue = piece.value; + } else { + var pieceInterval = piece.interval || []; + representValue = pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity ? 0 : (pieceInterval[0] + pieceInterval[1]) / 2; + } + } + + return representValue; + }; + + PiecewiseModel.prototype.getVisualMeta = function (getColorVisual) { + // Do not support category. (category axis is ordinal, numerical) + if (this.isCategory()) { + return; + } + + var stops = []; + var outerColors = ['', '']; + var visualMapModel = this; + + function setStop(interval, valueState) { + var representValue = visualMapModel.getRepresentValue({ + interval: interval + }); // Not category + + if (!valueState) { + valueState = visualMapModel.getValueState(representValue); + } + + var color = getColorVisual(representValue, valueState); + + if (interval[0] === -Infinity) { + outerColors[0] = color; + } else if (interval[1] === Infinity) { + outerColors[1] = color; + } else { + stops.push({ + value: interval[0], + color: color + }, { + value: interval[1], + color: color + }); + } + } // Suplement - if (!pieceList.length) { - pieceList.push({ - interval: [-Infinity, Infinity] - }); - } else { - var edge = pieceList[0].interval[0]; - edge !== -Infinity && pieceList.unshift({ - interval: [-Infinity, edge] - }); - edge = pieceList[pieceList.length - 1].interval[1]; - edge !== Infinity && pieceList.push({ - interval: [edge, Infinity] - }); - } - var curr = -Infinity; - each(pieceList, function (piece) { - var interval = piece.interval; + var pieceList = this._pieceList.slice(); - if (interval) { - // Fulfill gap. - interval[0] > curr && setStop([curr, interval[0]], 'outOfRange'); - setStop(interval.slice()); - curr = interval[1]; - } - }, this); - return { - stops: stops, - outerColors: outerColors - }; - }; + if (!pieceList.length) { + pieceList.push({ + interval: [-Infinity, Infinity] + }); + } else { + var edge = pieceList[0].interval[0]; + edge !== -Infinity && pieceList.unshift({ + interval: [-Infinity, edge] + }); + edge = pieceList[pieceList.length - 1].interval[1]; + edge !== Infinity && pieceList.push({ + interval: [edge, Infinity] + }); + } - PiecewiseModel.type = 'visualMap.piecewise'; - PiecewiseModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, { - selected: null, - minOpen: false, - maxOpen: false, - align: 'auto', - itemWidth: 20, - itemHeight: 14, - itemSymbol: 'roundRect', - pieces: null, - categories: null, - splitNumber: 5, - selectedMode: 'multiple', - itemGap: 10, - hoverLink: true // Enable hover highlight. + var curr = -Infinity; + each(pieceList, function (piece) { + var interval = piece.interval; + + if (interval) { + // Fulfill gap. + interval[0] > curr && setStop([curr, interval[0]], 'outOfRange'); + setStop(interval.slice()); + curr = interval[1]; + } + }, this); + return { + stops: stops, + outerColors: outerColors + }; + }; + + PiecewiseModel.type = 'visualMap.piecewise'; + PiecewiseModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, { + selected: null, + minOpen: false, + maxOpen: false, + align: 'auto', + itemWidth: 20, + itemHeight: 14, + itemSymbol: 'roundRect', + pieces: null, + categories: null, + splitNumber: 5, + selectedMode: 'multiple', + itemGap: 10, + hoverLink: true // Enable hover highlight. - }); - return PiecewiseModel; - }(VisualMapModel); + }); + return PiecewiseModel; + }(VisualMapModel); /** * Key is this._mode * @type {Object} @@ -91947,1124 +91947,1124 @@ */ var resetMethods = { - splitNumber: function (outPieceList) { - var thisOption = this.option; - var precision = Math.min(thisOption.precision, 20); - var dataExtent = this.getExtent(); - var splitNumber = thisOption.splitNumber; - splitNumber = Math.max(parseInt(splitNumber, 10), 1); - thisOption.splitNumber = splitNumber; - var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber; // Precision auto-adaption - - while (+splitStep.toFixed(precision) !== splitStep && precision < 5) { - precision++; - } - - thisOption.precision = precision; - splitStep = +splitStep.toFixed(precision); - - if (thisOption.minOpen) { - outPieceList.push({ - interval: [-Infinity, dataExtent[0]], - close: [0, 0] - }); - } - - for (var index = 0, curr = dataExtent[0]; index < splitNumber; curr += splitStep, index++) { - var max = index === splitNumber - 1 ? dataExtent[1] : curr + splitStep; - outPieceList.push({ - interval: [curr, max], - close: [1, 1] - }); - } - - if (thisOption.maxOpen) { - outPieceList.push({ - interval: [dataExtent[1], Infinity], - close: [0, 0] - }); - } - - reformIntervals(outPieceList); - each(outPieceList, function (piece, index) { - piece.index = index; - piece.text = this.formatValueText(piece.interval); - }, this); - }, - categories: function (outPieceList) { - var thisOption = this.option; - each(thisOption.categories, function (cate) { - // FIXME category模式也使用pieceList,但在visualMapping中不是使用pieceList。 - // 是否改一致。 - outPieceList.push({ - text: this.formatValueText(cate, true), - value: cate - }); - }, this); // See "Order Rule". - - normalizeReverse(thisOption, outPieceList); - }, - pieces: function (outPieceList) { - var thisOption = this.option; - each(thisOption.pieces, function (pieceListItem, index) { - if (!isObject(pieceListItem)) { - pieceListItem = { - value: pieceListItem - }; - } - - var item = { - text: '', - index: index - }; - - if (pieceListItem.label != null) { - item.text = pieceListItem.label; - } - - if (pieceListItem.hasOwnProperty('value')) { - var value = item.value = pieceListItem.value; - item.interval = [value, value]; - item.close = [1, 1]; - } else { - // `min` `max` is legacy option. - // `lt` `gt` `lte` `gte` is recommanded. - var interval = item.interval = []; - var close_1 = item.close = [0, 0]; - var closeList = [1, 0, 1]; - var infinityList = [-Infinity, Infinity]; - var useMinMax = []; - - for (var lg = 0; lg < 2; lg++) { - var names = [['gte', 'gt', 'min'], ['lte', 'lt', 'max']][lg]; - - for (var i = 0; i < 3 && interval[lg] == null; i++) { - interval[lg] = pieceListItem[names[i]]; - close_1[lg] = closeList[i]; - useMinMax[lg] = i === 2; - } + splitNumber: function (outPieceList) { + var thisOption = this.option; + var precision = Math.min(thisOption.precision, 20); + var dataExtent = this.getExtent(); + var splitNumber = thisOption.splitNumber; + splitNumber = Math.max(parseInt(splitNumber, 10), 1); + thisOption.splitNumber = splitNumber; + var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber; // Precision auto-adaption - interval[lg] == null && (interval[lg] = infinityList[lg]); - } + while (+splitStep.toFixed(precision) !== splitStep && precision < 5) { + precision++; + } - useMinMax[0] && interval[1] === Infinity && (close_1[0] = 0); - useMinMax[1] && interval[0] === -Infinity && (close_1[1] = 0); + thisOption.precision = precision; + splitStep = +splitStep.toFixed(precision); - if ("development" !== 'production') { - if (interval[0] > interval[1]) { - console.warn('Piece ' + index + 'is illegal: ' + interval + ' lower bound should not greater then uppper bound.'); - } - } + if (thisOption.minOpen) { + outPieceList.push({ + interval: [-Infinity, dataExtent[0]], + close: [0, 0] + }); + } - if (interval[0] === interval[1] && close_1[0] && close_1[1]) { - // Consider: [{min: 5, max: 5, visual: {...}}, {min: 0, max: 5}], - // we use value to lift the priority when min === max - item.value = interval[0]; - } - } + for (var index = 0, curr = dataExtent[0]; index < splitNumber; curr += splitStep, index++) { + var max = index === splitNumber - 1 ? dataExtent[1] : curr + splitStep; + outPieceList.push({ + interval: [curr, max], + close: [1, 1] + }); + } - item.visual = VisualMapping.retrieveVisuals(pieceListItem); - outPieceList.push(item); - }, this); // See "Order Rule". + if (thisOption.maxOpen) { + outPieceList.push({ + interval: [dataExtent[1], Infinity], + close: [0, 0] + }); + } - normalizeReverse(thisOption, outPieceList); // Only pieces + reformIntervals(outPieceList); + each(outPieceList, function (piece, index) { + piece.index = index; + piece.text = this.formatValueText(piece.interval); + }, this); + }, + categories: function (outPieceList) { + var thisOption = this.option; + each(thisOption.categories, function (cate) { + // FIXME category模式也使用pieceList,但在visualMapping中不是使用pieceList。 + // 是否改一致。 + outPieceList.push({ + text: this.formatValueText(cate, true), + value: cate + }); + }, this); // See "Order Rule". + + normalizeReverse(thisOption, outPieceList); + }, + pieces: function (outPieceList) { + var thisOption = this.option; + each(thisOption.pieces, function (pieceListItem, index) { + if (!isObject(pieceListItem)) { + pieceListItem = { + value: pieceListItem + }; + } + + var item = { + text: '', + index: index + }; + + if (pieceListItem.label != null) { + item.text = pieceListItem.label; + } + + if (pieceListItem.hasOwnProperty('value')) { + var value = item.value = pieceListItem.value; + item.interval = [value, value]; + item.close = [1, 1]; + } else { + // `min` `max` is legacy option. + // `lt` `gt` `lte` `gte` is recommanded. + var interval = item.interval = []; + var close_1 = item.close = [0, 0]; + var closeList = [1, 0, 1]; + var infinityList = [-Infinity, Infinity]; + var useMinMax = []; - reformIntervals(outPieceList); - each(outPieceList, function (piece) { - var close = piece.close; - var edgeSymbols = [['<', '≤'][close[1]], ['>', '≥'][close[0]]]; - piece.text = piece.text || this.formatValueText(piece.value != null ? piece.value : piece.interval, false, edgeSymbols); - }, this); - } - }; + for (var lg = 0; lg < 2; lg++) { + var names = [['gte', 'gt', 'min'], ['lte', 'lt', 'max']][lg]; - function normalizeReverse(thisOption, pieceList) { - var inverse = thisOption.inverse; + for (var i = 0; i < 3 && interval[lg] == null; i++) { + interval[lg] = pieceListItem[names[i]]; + close_1[lg] = closeList[i]; + useMinMax[lg] = i === 2; + } - if (thisOption.orient === 'vertical' ? !inverse : inverse) { - pieceList.reverse(); - } - } + interval[lg] == null && (interval[lg] = infinityList[lg]); + } - var PiecewiseVisualMapView = - /** @class */ - function (_super) { - __extends(PiecewiseVisualMapView, _super); + useMinMax[0] && interval[1] === Infinity && (close_1[0] = 0); + useMinMax[1] && interval[0] === -Infinity && (close_1[1] = 0); - function PiecewiseVisualMapView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + if ("development" !== 'production') { + if (interval[0] > interval[1]) { + console.warn('Piece ' + index + 'is illegal: ' + interval + ' lower bound should not greater then uppper bound.'); + } + } - _this.type = PiecewiseVisualMapView.type; - return _this; + if (interval[0] === interval[1] && close_1[0] && close_1[1]) { + // Consider: [{min: 5, max: 5, visual: {...}}, {min: 0, max: 5}], + // we use value to lift the priority when min === max + item.value = interval[0]; } + } - PiecewiseVisualMapView.prototype.doRender = function () { - var thisGroup = this.group; - thisGroup.removeAll(); - var visualMapModel = this.visualMapModel; - var textGap = visualMapModel.get('textGap'); - var textStyleModel = visualMapModel.textStyleModel; - var textFont = textStyleModel.getFont(); - var textFill = textStyleModel.getTextColor(); + item.visual = VisualMapping.retrieveVisuals(pieceListItem); + outPieceList.push(item); + }, this); // See "Order Rule". - var itemAlign = this._getItemAlign(); + normalizeReverse(thisOption, outPieceList); // Only pieces - var itemSize = visualMapModel.itemSize; + reformIntervals(outPieceList); + each(outPieceList, function (piece) { + var close = piece.close; + var edgeSymbols = [['<', '≤'][close[1]], ['>', '≥'][close[0]]]; + piece.text = piece.text || this.formatValueText(piece.value != null ? piece.value : piece.interval, false, edgeSymbols); + }, this); + } + }; - var viewData = this._getViewData(); + function normalizeReverse(thisOption, pieceList) { + var inverse = thisOption.inverse; - var endsText = viewData.endsText; - var showLabel = retrieve(visualMapModel.get('showLabel', true), !endsText); - endsText && this._renderEndsText(thisGroup, endsText[0], itemSize, showLabel, itemAlign); - each(viewData.viewPieceList, function (item) { - var piece = item.piece; - var itemGroup = new Group(); - itemGroup.onclick = bind(this._onItemClick, this, piece); + if (thisOption.orient === 'vertical' ? !inverse : inverse) { + pieceList.reverse(); + } + } - this._enableHoverLink(itemGroup, item.indexInModelPieceList); // TODO Category + var PiecewiseVisualMapView = + /** @class */ + function (_super) { + __extends(PiecewiseVisualMapView, _super); + function PiecewiseVisualMapView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - var representValue = visualMapModel.getRepresentValue(piece); + _this.type = PiecewiseVisualMapView.type; + return _this; + } - this._createItemSymbol(itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]]); + PiecewiseVisualMapView.prototype.doRender = function () { + var thisGroup = this.group; + thisGroup.removeAll(); + var visualMapModel = this.visualMapModel; + var textGap = visualMapModel.get('textGap'); + var textStyleModel = visualMapModel.textStyleModel; + var textFont = textStyleModel.getFont(); + var textFill = textStyleModel.getTextColor(); - if (showLabel) { - var visualState = this.visualMapModel.getValueState(representValue); - itemGroup.add(new ZRText({ - style: { - x: itemAlign === 'right' ? -textGap : itemSize[0] + textGap, - y: itemSize[1] / 2, - text: piece.text, - verticalAlign: 'middle', - align: itemAlign, - font: textFont, - fill: textFill, - opacity: visualState === 'outOfRange' ? 0.5 : 1 - } - })); - } + var itemAlign = this._getItemAlign(); - thisGroup.add(itemGroup); - }, this); - endsText && this._renderEndsText(thisGroup, endsText[1], itemSize, showLabel, itemAlign); - box(visualMapModel.get('orient'), thisGroup, visualMapModel.get('itemGap')); - this.renderBackground(thisGroup); - this.positionGroup(thisGroup); - }; + var itemSize = visualMapModel.itemSize; - PiecewiseVisualMapView.prototype._enableHoverLink = function (itemGroup, pieceIndex) { - var _this = this; + var viewData = this._getViewData(); - itemGroup.on('mouseover', function () { - return onHoverLink('highlight'); - }).on('mouseout', function () { - return onHoverLink('downplay'); - }); + var endsText = viewData.endsText; + var showLabel = retrieve(visualMapModel.get('showLabel', true), !endsText); + endsText && this._renderEndsText(thisGroup, endsText[0], itemSize, showLabel, itemAlign); + each(viewData.viewPieceList, function (item) { + var piece = item.piece; + var itemGroup = new Group(); + itemGroup.onclick = bind(this._onItemClick, this, piece); - var onHoverLink = function (method) { - var visualMapModel = _this.visualMapModel; // TODO: TYPE More detailed action types + this._enableHoverLink(itemGroup, item.indexInModelPieceList); // TODO Category - visualMapModel.option.hoverLink && _this.api.dispatchAction({ - type: method, - batch: makeHighDownBatch(visualMapModel.findTargetDataIndices(pieceIndex), visualMapModel) - }); - }; - }; - PiecewiseVisualMapView.prototype._getItemAlign = function () { - var visualMapModel = this.visualMapModel; - var modelOption = visualMapModel.option; + var representValue = visualMapModel.getRepresentValue(piece); - if (modelOption.orient === 'vertical') { - return getItemAlign(visualMapModel, this.api, visualMapModel.itemSize); - } else { - // horizontal, most case left unless specifying right. - var align = modelOption.align; + this._createItemSymbol(itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]]); - if (!align || align === 'auto') { - align = 'left'; - } + if (showLabel) { + var visualState = this.visualMapModel.getValueState(representValue); + itemGroup.add(new ZRText({ + style: { + x: itemAlign === 'right' ? -textGap : itemSize[0] + textGap, + y: itemSize[1] / 2, + text: piece.text, + verticalAlign: 'middle', + align: itemAlign, + font: textFont, + fill: textFill, + opacity: visualState === 'outOfRange' ? 0.5 : 1 + } + })); + } - return align; - } - }; + thisGroup.add(itemGroup); + }, this); + endsText && this._renderEndsText(thisGroup, endsText[1], itemSize, showLabel, itemAlign); + box(visualMapModel.get('orient'), thisGroup, visualMapModel.get('itemGap')); + this.renderBackground(thisGroup); + this.positionGroup(thisGroup); + }; + + PiecewiseVisualMapView.prototype._enableHoverLink = function (itemGroup, pieceIndex) { + var _this = this; + + itemGroup.on('mouseover', function () { + return onHoverLink('highlight'); + }).on('mouseout', function () { + return onHoverLink('downplay'); + }); - PiecewiseVisualMapView.prototype._renderEndsText = function (group, text, itemSize, showLabel, itemAlign) { - if (!text) { - return; - } + var onHoverLink = function (method) { + var visualMapModel = _this.visualMapModel; // TODO: TYPE More detailed action types - var itemGroup = new Group(); - var textStyleModel = this.visualMapModel.textStyleModel; - itemGroup.add(new ZRText({ - style: createTextStyle(textStyleModel, { - x: showLabel ? itemAlign === 'right' ? itemSize[0] : 0 : itemSize[0] / 2, - y: itemSize[1] / 2, - verticalAlign: 'middle', - align: showLabel ? itemAlign : 'center', - text: text - }) - })); - group.add(itemGroup); - }; - /** - * @private - * @return {Object} {peiceList, endsText} The order is the same as screen pixel order. - */ + visualMapModel.option.hoverLink && _this.api.dispatchAction({ + type: method, + batch: makeHighDownBatch(visualMapModel.findTargetDataIndices(pieceIndex), visualMapModel) + }); + }; + }; + PiecewiseVisualMapView.prototype._getItemAlign = function () { + var visualMapModel = this.visualMapModel; + var modelOption = visualMapModel.option; - PiecewiseVisualMapView.prototype._getViewData = function () { - var visualMapModel = this.visualMapModel; - var viewPieceList = map(visualMapModel.getPieceList(), function (piece, index) { - return { - piece: piece, - indexInModelPieceList: index - }; - }); - var endsText = visualMapModel.get('text'); // Consider orient and inverse. + if (modelOption.orient === 'vertical') { + return getItemAlign(visualMapModel, this.api, visualMapModel.itemSize); + } else { + // horizontal, most case left unless specifying right. + var align = modelOption.align; - var orient = visualMapModel.get('orient'); - var inverse = visualMapModel.get('inverse'); // Order of model pieceList is always [low, ..., high] + if (!align || align === 'auto') { + align = 'left'; + } - if (orient === 'horizontal' ? inverse : !inverse) { - viewPieceList.reverse(); - } // Origin order of endsText is [high, low] - else if (endsText) { - endsText = endsText.slice().reverse(); - } + return align; + } + }; - return { - viewPieceList: viewPieceList, - endsText: endsText - }; - }; + PiecewiseVisualMapView.prototype._renderEndsText = function (group, text, itemSize, showLabel, itemAlign) { + if (!text) { + return; + } + + var itemGroup = new Group(); + var textStyleModel = this.visualMapModel.textStyleModel; + itemGroup.add(new ZRText({ + style: createTextStyle(textStyleModel, { + x: showLabel ? itemAlign === 'right' ? itemSize[0] : 0 : itemSize[0] / 2, + y: itemSize[1] / 2, + verticalAlign: 'middle', + align: showLabel ? itemAlign : 'center', + text: text + }) + })); + group.add(itemGroup); + }; + /** + * @private + * @return {Object} {peiceList, endsText} The order is the same as screen pixel order. + */ - PiecewiseVisualMapView.prototype._createItemSymbol = function (group, representValue, shapeParam) { - group.add(createSymbol( // symbol will be string - this.getControllerVisual(representValue, 'symbol'), shapeParam[0], shapeParam[1], shapeParam[2], shapeParam[3], // color will be string - this.getControllerVisual(representValue, 'color'))); - }; - PiecewiseVisualMapView.prototype._onItemClick = function (piece) { - var visualMapModel = this.visualMapModel; - var option = visualMapModel.option; - var selected = clone(option.selected); - var newKey = visualMapModel.getSelectedMapKey(piece); + PiecewiseVisualMapView.prototype._getViewData = function () { + var visualMapModel = this.visualMapModel; + var viewPieceList = map(visualMapModel.getPieceList(), function (piece, index) { + return { + piece: piece, + indexInModelPieceList: index + }; + }); + var endsText = visualMapModel.get('text'); // Consider orient and inverse. - if (option.selectedMode === 'single') { - selected[newKey] = true; - each(selected, function (o, key) { - selected[key] = key === newKey; - }); - } else { - selected[newKey] = !selected[newKey]; - } + var orient = visualMapModel.get('orient'); + var inverse = visualMapModel.get('inverse'); // Order of model pieceList is always [low, ..., high] - this.api.dispatchAction({ - type: 'selectDataRange', - from: this.uid, - visualMapId: this.visualMapModel.id, - selected: selected - }); - }; + if (orient === 'horizontal' ? inverse : !inverse) { + viewPieceList.reverse(); + } // Origin order of endsText is [high, low] + else if (endsText) { + endsText = endsText.slice().reverse(); + } + + return { + viewPieceList: viewPieceList, + endsText: endsText + }; + }; + + PiecewiseVisualMapView.prototype._createItemSymbol = function (group, representValue, shapeParam) { + group.add(createSymbol( // symbol will be string + this.getControllerVisual(representValue, 'symbol'), shapeParam[0], shapeParam[1], shapeParam[2], shapeParam[3], // color will be string + this.getControllerVisual(representValue, 'color'))); + }; + + PiecewiseVisualMapView.prototype._onItemClick = function (piece) { + var visualMapModel = this.visualMapModel; + var option = visualMapModel.option; + var selected = clone(option.selected); + var newKey = visualMapModel.getSelectedMapKey(piece); + + if (option.selectedMode === 'single') { + selected[newKey] = true; + each(selected, function (o, key) { + selected[key] = key === newKey; + }); + } else { + selected[newKey] = !selected[newKey]; + } + + this.api.dispatchAction({ + type: 'selectDataRange', + from: this.uid, + visualMapId: this.visualMapModel.id, + selected: selected + }); + }; - PiecewiseVisualMapView.type = 'visualMap.piecewise'; - return PiecewiseVisualMapView; - }(VisualMapView); + PiecewiseVisualMapView.type = 'visualMap.piecewise'; + return PiecewiseVisualMapView; + }(VisualMapView); function install$O(registers) { - registers.registerComponentModel(PiecewiseModel); - registers.registerComponentView(PiecewiseVisualMapView); - installCommon$1(registers); + registers.registerComponentModel(PiecewiseModel); + registers.registerComponentView(PiecewiseVisualMapView); + installCommon$1(registers); } function install$P(registers) { - use(install$N); - use(install$O); // Do not install './dataZoomSelect', - // since it only work for toolbox dataZoom. + use(install$N); + use(install$O); // Do not install './dataZoomSelect', + // since it only work for toolbox dataZoom. } var DEFAULT_OPTION = { - label: { - enabled: true - }, - decal: { - show: false - } + label: { + enabled: true + }, + decal: { + show: false + } }; var inner$l = makeInner(); var decalPaletteScope = {}; function ariaVisual(ecModel, api) { - var ariaModel = ecModel.getModel('aria'); // See "area enabled" detection code in `GlobalModel.ts`. - - if (!ariaModel.get('enabled')) { - return; - } - - var defaultOption = clone(DEFAULT_OPTION); - merge(defaultOption.label, ecModel.getLocaleModel().get('aria'), false); - merge(ariaModel.option, defaultOption, false); - setDecal(); - setLabel(); + var ariaModel = ecModel.getModel('aria'); // See "area enabled" detection code in `GlobalModel.ts`. - function setDecal() { - var decalModel = ariaModel.getModel('decal'); - var useDecal = decalModel.get('show'); - - if (useDecal) { - // Each type of series use one scope. - // Pie and funnel are using diferrent scopes - var paletteScopeGroupByType_1 = createHashMap(); - ecModel.eachSeries(function (seriesModel) { - if (seriesModel.isColorBySeries()) { - return; - } + if (!ariaModel.get('enabled')) { + return; + } - var decalScope = paletteScopeGroupByType_1.get(seriesModel.type); + var defaultOption = clone(DEFAULT_OPTION); + merge(defaultOption.label, ecModel.getLocaleModel().get('aria'), false); + merge(ariaModel.option, defaultOption, false); + setDecal(); + setLabel(); - if (!decalScope) { - decalScope = {}; - paletteScopeGroupByType_1.set(seriesModel.type, decalScope); - } + function setDecal() { + var decalModel = ariaModel.getModel('decal'); + var useDecal = decalModel.get('show'); - inner$l(seriesModel).scope = decalScope; - }); - ecModel.eachRawSeries(function (seriesModel) { - if (ecModel.isSeriesFiltered(seriesModel)) { - return; - } + if (useDecal) { + // Each type of series use one scope. + // Pie and funnel are using diferrent scopes + var paletteScopeGroupByType_1 = createHashMap(); + ecModel.eachSeries(function (seriesModel) { + if (seriesModel.isColorBySeries()) { + return; + } - if (isFunction(seriesModel.enableAriaDecal)) { - // Let series define how to use decal palette on data - seriesModel.enableAriaDecal(); - return; - } + var decalScope = paletteScopeGroupByType_1.get(seriesModel.type); - var data = seriesModel.getData(); + if (!decalScope) { + decalScope = {}; + paletteScopeGroupByType_1.set(seriesModel.type, decalScope); + } - if (!seriesModel.isColorBySeries()) { - var dataAll_1 = seriesModel.getRawData(); - var idxMap_1 = {}; - var decalScope_1 = inner$l(seriesModel).scope; - data.each(function (idx) { - var rawIdx = data.getRawIndex(idx); - idxMap_1[rawIdx] = idx; - }); - var dataCount_1 = dataAll_1.count(); - dataAll_1.each(function (rawIdx) { - var idx = idxMap_1[rawIdx]; - var name = dataAll_1.getName(rawIdx) || rawIdx + ''; - var paletteDecal = getDecalFromPalette(seriesModel.ecModel, name, decalScope_1, dataCount_1); - var specifiedDecal = data.getItemVisual(idx, 'decal'); - data.setItemVisual(idx, 'decal', mergeDecal(specifiedDecal, paletteDecal)); - }); - } else { - var paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount()); - var specifiedDecal = data.getVisual('decal'); - data.setVisual('decal', mergeDecal(specifiedDecal, paletteDecal)); - } + inner$l(seriesModel).scope = decalScope; + }); + ecModel.eachRawSeries(function (seriesModel) { + if (ecModel.isSeriesFiltered(seriesModel)) { + return; + } - function mergeDecal(specifiedDecal, paletteDecal) { - // Merge decal from palette to decal from itemStyle. - // User do not need to specify all of the decal props. - var resultDecal = specifiedDecal ? extend(extend({}, paletteDecal), specifiedDecal) : paletteDecal; - resultDecal.dirty = true; - return resultDecal; - } - }); + if (isFunction(seriesModel.enableAriaDecal)) { + // Let series define how to use decal palette on data + seriesModel.enableAriaDecal(); + return; } - } - function setLabel() { - var labelLocale = ecModel.getLocaleModel().get('aria'); - var labelModel = ariaModel.getModel('label'); - labelModel.option = defaults(labelModel.option, labelLocale); + var data = seriesModel.getData(); - if (!labelModel.get('enabled')) { - return; + if (!seriesModel.isColorBySeries()) { + var dataAll_1 = seriesModel.getRawData(); + var idxMap_1 = {}; + var decalScope_1 = inner$l(seriesModel).scope; + data.each(function (idx) { + var rawIdx = data.getRawIndex(idx); + idxMap_1[rawIdx] = idx; + }); + var dataCount_1 = dataAll_1.count(); + dataAll_1.each(function (rawIdx) { + var idx = idxMap_1[rawIdx]; + var name = dataAll_1.getName(rawIdx) || rawIdx + ''; + var paletteDecal = getDecalFromPalette(seriesModel.ecModel, name, decalScope_1, dataCount_1); + var specifiedDecal = data.getItemVisual(idx, 'decal'); + data.setItemVisual(idx, 'decal', mergeDecal(specifiedDecal, paletteDecal)); + }); + } else { + var paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount()); + var specifiedDecal = data.getVisual('decal'); + data.setVisual('decal', mergeDecal(specifiedDecal, paletteDecal)); } - var dom = api.getZr().dom; - - if (labelModel.get('description')) { - dom.setAttribute('aria-label', labelModel.get('description')); - return; + function mergeDecal(specifiedDecal, paletteDecal) { + // Merge decal from palette to decal from itemStyle. + // User do not need to specify all of the decal props. + var resultDecal = specifiedDecal ? extend(extend({}, paletteDecal), specifiedDecal) : paletteDecal; + resultDecal.dirty = true; + return resultDecal; } + }); + } + } - var seriesCnt = ecModel.getSeriesCount(); - var maxDataCnt = labelModel.get(['data', 'maxCount']) || 10; - var maxSeriesCnt = labelModel.get(['series', 'maxCount']) || 10; - var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt); - var ariaLabel; + function setLabel() { + var labelLocale = ecModel.getLocaleModel().get('aria'); + var labelModel = ariaModel.getModel('label'); + labelModel.option = defaults(labelModel.option, labelLocale); - if (seriesCnt < 1) { - // No series, no aria label - return; - } else { - var title = getTitle(); + if (!labelModel.get('enabled')) { + return; + } - if (title) { - var withTitle = labelModel.get(['general', 'withTitle']); - ariaLabel = replace(withTitle, { - title: title - }); - } else { - ariaLabel = labelModel.get(['general', 'withoutTitle']); - } + var dom = api.getZr().dom; - var seriesLabels_1 = []; - var prefix = seriesCnt > 1 ? labelModel.get(['series', 'multiple', 'prefix']) : labelModel.get(['series', 'single', 'prefix']); - ariaLabel += replace(prefix, { - seriesCount: seriesCnt - }); - ecModel.eachSeries(function (seriesModel, idx) { - if (idx < displaySeriesCnt) { - var seriesLabel = void 0; - var seriesName = seriesModel.get('name'); - var withName = seriesName ? 'withName' : 'withoutName'; - seriesLabel = seriesCnt > 1 ? labelModel.get(['series', 'multiple', withName]) : labelModel.get(['series', 'single', withName]); - seriesLabel = replace(seriesLabel, { - seriesId: seriesModel.seriesIndex, - seriesName: seriesModel.get('name'), - seriesType: getSeriesTypeName(seriesModel.subType) - }); - var data = seriesModel.getData(); + if (labelModel.get('description')) { + dom.setAttribute('aria-label', labelModel.get('description')); + return; + } - if (data.count() > maxDataCnt) { - // Show part of data - var partialLabel = labelModel.get(['data', 'partialData']); - seriesLabel += replace(partialLabel, { - displayCnt: maxDataCnt - }); - } else { - seriesLabel += labelModel.get(['data', 'allData']); - } + var seriesCnt = ecModel.getSeriesCount(); + var maxDataCnt = labelModel.get(['data', 'maxCount']) || 10; + var maxSeriesCnt = labelModel.get(['series', 'maxCount']) || 10; + var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt); + var ariaLabel; - var middleSeparator_1 = labelModel.get(['data', 'separator', 'middle']); - var endSeparator_1 = labelModel.get(['data', 'separator', 'end']); - var dataLabels = []; - - for (var i = 0; i < data.count(); i++) { - if (i < maxDataCnt) { - var name_1 = data.getName(i); - var value = data.getValues(i); - var dataLabel = labelModel.get(['data', name_1 ? 'withName' : 'withoutName']); - dataLabels.push(replace(dataLabel, { - name: name_1, - value: value.join(middleSeparator_1) - })); - } - } + if (seriesCnt < 1) { + // No series, no aria label + return; + } else { + var title = getTitle(); - seriesLabel += dataLabels.join(middleSeparator_1) + endSeparator_1; - seriesLabels_1.push(seriesLabel); - } + if (title) { + var withTitle = labelModel.get(['general', 'withTitle']); + ariaLabel = replace(withTitle, { + title: title + }); + } else { + ariaLabel = labelModel.get(['general', 'withoutTitle']); + } + + var seriesLabels_1 = []; + var prefix = seriesCnt > 1 ? labelModel.get(['series', 'multiple', 'prefix']) : labelModel.get(['series', 'single', 'prefix']); + ariaLabel += replace(prefix, { + seriesCount: seriesCnt + }); + ecModel.eachSeries(function (seriesModel, idx) { + if (idx < displaySeriesCnt) { + var seriesLabel = void 0; + var seriesName = seriesModel.get('name'); + var withName = seriesName ? 'withName' : 'withoutName'; + seriesLabel = seriesCnt > 1 ? labelModel.get(['series', 'multiple', withName]) : labelModel.get(['series', 'single', withName]); + seriesLabel = replace(seriesLabel, { + seriesId: seriesModel.seriesIndex, + seriesName: seriesModel.get('name'), + seriesType: getSeriesTypeName(seriesModel.subType) + }); + var data = seriesModel.getData(); + + if (data.count() > maxDataCnt) { + // Show part of data + var partialLabel = labelModel.get(['data', 'partialData']); + seriesLabel += replace(partialLabel, { + displayCnt: maxDataCnt }); - var separatorModel = labelModel.getModel(['series', 'multiple', 'separator']); - var middleSeparator = separatorModel.get('middle'); - var endSeparator = separatorModel.get('end'); - ariaLabel += seriesLabels_1.join(middleSeparator) + endSeparator; - dom.setAttribute('aria-label', ariaLabel); - } - } + } else { + seriesLabel += labelModel.get(['data', 'allData']); + } + + var middleSeparator_1 = labelModel.get(['data', 'separator', 'middle']); + var endSeparator_1 = labelModel.get(['data', 'separator', 'end']); + var dataLabels = []; + + for (var i = 0; i < data.count(); i++) { + if (i < maxDataCnt) { + var name_1 = data.getName(i); + var value = data.getValues(i); + var dataLabel = labelModel.get(['data', name_1 ? 'withName' : 'withoutName']); + dataLabels.push(replace(dataLabel, { + name: name_1, + value: value.join(middleSeparator_1) + })); + } + } - function replace(str, keyValues) { - if (!isString(str)) { - return str; + seriesLabel += dataLabels.join(middleSeparator_1) + endSeparator_1; + seriesLabels_1.push(seriesLabel); } + }); + var separatorModel = labelModel.getModel(['series', 'multiple', 'separator']); + var middleSeparator = separatorModel.get('middle'); + var endSeparator = separatorModel.get('end'); + ariaLabel += seriesLabels_1.join(middleSeparator) + endSeparator; + dom.setAttribute('aria-label', ariaLabel); + } + } - var result = str; - each(keyValues, function (value, key) { - result = result.replace(new RegExp('\\{\\s*' + key + '\\s*\\}', 'g'), value); - }); - return result; + function replace(str, keyValues) { + if (!isString(str)) { + return str; } - function getTitle() { - var title = ecModel.get('title'); + var result = str; + each(keyValues, function (value, key) { + result = result.replace(new RegExp('\\{\\s*' + key + '\\s*\\}', 'g'), value); + }); + return result; + } - if (title && title.length) { - title = title[0]; - } + function getTitle() { + var title = ecModel.get('title'); - return title && title.text; + if (title && title.length) { + title = title[0]; } - function getSeriesTypeName(type) { - return ecModel.getLocaleModel().get(['series', 'typeNames'])[type] || '自定义图'; - } + return title && title.text; + } + + function getSeriesTypeName(type) { + return ecModel.getLocaleModel().get(['series', 'typeNames'])[type] || '自定义图'; + } } function ariaPreprocessor(option) { - if (!option || !option.aria) { - return; - } + if (!option || !option.aria) { + return; + } - var aria = option.aria; // aria.show is deprecated and should use aria.enabled instead + var aria = option.aria; // aria.show is deprecated and should use aria.enabled instead - if (aria.show != null) { - aria.enabled = aria.show; - } + if (aria.show != null) { + aria.enabled = aria.show; + } - aria.label = aria.label || {}; // move description, general, series, data to be under aria.label + aria.label = aria.label || {}; // move description, general, series, data to be under aria.label - each(['description', 'general', 'series', 'data'], function (name) { - if (aria[name] != null) { - aria.label[name] = aria[name]; - } - }); + each(['description', 'general', 'series', 'data'], function (name) { + if (aria[name] != null) { + aria.label[name] = aria[name]; + } + }); } function install$Q(registers) { - registers.registerPreprocessor(ariaPreprocessor); - registers.registerVisual(registers.PRIORITY.VISUAL.ARIA, ariaVisual); + registers.registerPreprocessor(ariaPreprocessor); + registers.registerVisual(registers.PRIORITY.VISUAL.ARIA, ariaVisual); } var RELATIONAL_EXPRESSION_OP_ALIAS_MAP = { - value: 'eq', - // PENDING: not good for literal semantic? - '<': 'lt', - '<=': 'lte', - '>': 'gt', - '>=': 'gte', - '=': 'eq', - '!=': 'ne', - '<>': 'ne' // Might mileading for sake of the different between '==' and '===', - // So dont support them. - // '==': 'eq', - // '===': 'seq', - // '!==': 'sne' - // PENDING: Whether support some common alias "ge", "le", "neq"? - // ge: 'gte', - // le: 'lte', - // neq: 'ne', + value: 'eq', + // PENDING: not good for literal semantic? + '<': 'lt', + '<=': 'lte', + '>': 'gt', + '>=': 'gte', + '=': 'eq', + '!=': 'ne', + '<>': 'ne' // Might mileading for sake of the different between '==' and '===', + // So dont support them. + // '==': 'eq', + // '===': 'seq', + // '!==': 'sne' + // PENDING: Whether support some common alias "ge", "le", "neq"? + // ge: 'gte', + // le: 'lte', + // neq: 'ne', }; // type RelationalExpressionOpEvaluate = (tarVal: unknown, condVal: unknown) => boolean; var RegExpEvaluator = - /** @class */ - function () { - function RegExpEvaluator(rVal) { - // Support condVal: RegExp | string - var condValue = this._condVal = isString(rVal) ? new RegExp(rVal) : isRegExp(rVal) ? rVal : null; + /** @class */ + function () { + function RegExpEvaluator(rVal) { + // Support condVal: RegExp | string + var condValue = this._condVal = isString(rVal) ? new RegExp(rVal) : isRegExp(rVal) ? rVal : null; - if (condValue == null) { - var errMsg = ''; + if (condValue == null) { + var errMsg = ''; - if ("development" !== 'production') { - errMsg = makePrintable('Illegal regexp', rVal, 'in'); - } + if ("development" !== 'production') { + errMsg = makePrintable('Illegal regexp', rVal, 'in'); + } - throwError(errMsg); - } - } + throwError(errMsg); + } + } - RegExpEvaluator.prototype.evaluate = function (lVal) { - var type = typeof lVal; - return isString(type) ? this._condVal.test(lVal) : isNumber(type) ? this._condVal.test(lVal + '') : false; - }; + RegExpEvaluator.prototype.evaluate = function (lVal) { + var type = typeof lVal; + return isString(type) ? this._condVal.test(lVal) : isNumber(type) ? this._condVal.test(lVal + '') : false; + }; - return RegExpEvaluator; - }(); + return RegExpEvaluator; + }(); var ConstConditionInternal = - /** @class */ - function () { - function ConstConditionInternal() {} + /** @class */ + function () { + function ConstConditionInternal() {} - ConstConditionInternal.prototype.evaluate = function () { - return this.value; - }; + ConstConditionInternal.prototype.evaluate = function () { + return this.value; + }; - return ConstConditionInternal; - }(); + return ConstConditionInternal; + }(); var AndConditionInternal = - /** @class */ - function () { - function AndConditionInternal() {} + /** @class */ + function () { + function AndConditionInternal() {} - AndConditionInternal.prototype.evaluate = function () { - var children = this.children; + AndConditionInternal.prototype.evaluate = function () { + var children = this.children; - for (var i = 0; i < children.length; i++) { - if (!children[i].evaluate()) { - return false; - } - } + for (var i = 0; i < children.length; i++) { + if (!children[i].evaluate()) { + return false; + } + } - return true; - }; + return true; + }; - return AndConditionInternal; - }(); + return AndConditionInternal; + }(); var OrConditionInternal = - /** @class */ - function () { - function OrConditionInternal() {} + /** @class */ + function () { + function OrConditionInternal() {} - OrConditionInternal.prototype.evaluate = function () { - var children = this.children; + OrConditionInternal.prototype.evaluate = function () { + var children = this.children; - for (var i = 0; i < children.length; i++) { - if (children[i].evaluate()) { - return true; - } - } + for (var i = 0; i < children.length; i++) { + if (children[i].evaluate()) { + return true; + } + } - return false; - }; + return false; + }; - return OrConditionInternal; - }(); + return OrConditionInternal; + }(); var NotConditionInternal = - /** @class */ - function () { - function NotConditionInternal() {} + /** @class */ + function () { + function NotConditionInternal() {} - NotConditionInternal.prototype.evaluate = function () { - return !this.child.evaluate(); - }; + NotConditionInternal.prototype.evaluate = function () { + return !this.child.evaluate(); + }; - return NotConditionInternal; - }(); + return NotConditionInternal; + }(); var RelationalConditionInternal = - /** @class */ - function () { - function RelationalConditionInternal() {} + /** @class */ + function () { + function RelationalConditionInternal() {} - RelationalConditionInternal.prototype.evaluate = function () { - var needParse = !!this.valueParser; // Call getValue with no `this`. + RelationalConditionInternal.prototype.evaluate = function () { + var needParse = !!this.valueParser; // Call getValue with no `this`. - var getValue = this.getValue; - var tarValRaw = getValue(this.valueGetterParam); - var tarValParsed = needParse ? this.valueParser(tarValRaw) : null; // Relational cond follow "and" logic internally. + var getValue = this.getValue; + var tarValRaw = getValue(this.valueGetterParam); + var tarValParsed = needParse ? this.valueParser(tarValRaw) : null; // Relational cond follow "and" logic internally. - for (var i = 0; i < this.subCondList.length; i++) { - if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) { - return false; - } - } + for (var i = 0; i < this.subCondList.length; i++) { + if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) { + return false; + } + } - return true; - }; + return true; + }; - return RelationalConditionInternal; - }(); + return RelationalConditionInternal; + }(); function parseOption(exprOption, getters) { - if (exprOption === true || exprOption === false) { - var cond = new ConstConditionInternal(); - cond.value = exprOption; - return cond; - } - - var errMsg = ''; + if (exprOption === true || exprOption === false) { + var cond = new ConstConditionInternal(); + cond.value = exprOption; + return cond; + } - if (!isObjectNotArray(exprOption)) { - if ("development" !== 'production') { - errMsg = makePrintable('Illegal config. Expect a plain object but actually', exprOption); - } + var errMsg = ''; - throwError(errMsg); + if (!isObjectNotArray(exprOption)) { + if ("development" !== 'production') { + errMsg = makePrintable('Illegal config. Expect a plain object but actually', exprOption); } - if (exprOption.and) { - return parseAndOrOption('and', exprOption, getters); - } else if (exprOption.or) { - return parseAndOrOption('or', exprOption, getters); - } else if (exprOption.not) { - return parseNotOption(exprOption, getters); - } + throwError(errMsg); + } - return parseRelationalOption(exprOption, getters); + if (exprOption.and) { + return parseAndOrOption('and', exprOption, getters); + } else if (exprOption.or) { + return parseAndOrOption('or', exprOption, getters); + } else if (exprOption.not) { + return parseNotOption(exprOption, getters); + } + + return parseRelationalOption(exprOption, getters); } function parseAndOrOption(op, exprOption, getters) { - var subOptionArr = exprOption[op]; - var errMsg = ''; + var subOptionArr = exprOption[op]; + var errMsg = ''; - if ("development" !== 'production') { - errMsg = makePrintable('"and"/"or" condition should only be `' + op + ': [...]` and must not be empty array.', 'Illegal condition:', exprOption); - } + if ("development" !== 'production') { + errMsg = makePrintable('"and"/"or" condition should only be `' + op + ': [...]` and must not be empty array.', 'Illegal condition:', exprOption); + } - if (!isArray(subOptionArr)) { - throwError(errMsg); - } + if (!isArray(subOptionArr)) { + throwError(errMsg); + } - if (!subOptionArr.length) { - throwError(errMsg); - } + if (!subOptionArr.length) { + throwError(errMsg); + } - var cond = op === 'and' ? new AndConditionInternal() : new OrConditionInternal(); - cond.children = map(subOptionArr, function (subOption) { - return parseOption(subOption, getters); - }); + var cond = op === 'and' ? new AndConditionInternal() : new OrConditionInternal(); + cond.children = map(subOptionArr, function (subOption) { + return parseOption(subOption, getters); + }); - if (!cond.children.length) { - throwError(errMsg); - } + if (!cond.children.length) { + throwError(errMsg); + } - return cond; + return cond; } function parseNotOption(exprOption, getters) { - var subOption = exprOption.not; - var errMsg = ''; + var subOption = exprOption.not; + var errMsg = ''; - if ("development" !== 'production') { - errMsg = makePrintable('"not" condition should only be `not: {}`.', 'Illegal condition:', exprOption); - } + if ("development" !== 'production') { + errMsg = makePrintable('"not" condition should only be `not: {}`.', 'Illegal condition:', exprOption); + } - if (!isObjectNotArray(subOption)) { - throwError(errMsg); - } + if (!isObjectNotArray(subOption)) { + throwError(errMsg); + } - var cond = new NotConditionInternal(); - cond.child = parseOption(subOption, getters); + var cond = new NotConditionInternal(); + cond.child = parseOption(subOption, getters); - if (!cond.child) { - throwError(errMsg); - } + if (!cond.child) { + throwError(errMsg); + } - return cond; + return cond; } function parseRelationalOption(exprOption, getters) { - var errMsg = ''; - var valueGetterParam = getters.prepareGetValue(exprOption); - var subCondList = []; - var exprKeys = keys(exprOption); - var parserName = exprOption.parser; - var valueParser = parserName ? getRawValueParser(parserName) : null; - - for (var i = 0; i < exprKeys.length; i++) { - var keyRaw = exprKeys[i]; + var errMsg = ''; + var valueGetterParam = getters.prepareGetValue(exprOption); + var subCondList = []; + var exprKeys = keys(exprOption); + var parserName = exprOption.parser; + var valueParser = parserName ? getRawValueParser(parserName) : null; - if (keyRaw === 'parser' || getters.valueGetterAttrMap.get(keyRaw)) { - continue; - } + for (var i = 0; i < exprKeys.length; i++) { + var keyRaw = exprKeys[i]; - var op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw) ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw] : keyRaw; - var condValueRaw = exprOption[keyRaw]; - var condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw; - var evaluator = createFilterComparator(op, condValueParsed) || op === 'reg' && new RegExpEvaluator(condValueParsed); + if (keyRaw === 'parser' || getters.valueGetterAttrMap.get(keyRaw)) { + continue; + } - if (!evaluator) { - if ("development" !== 'production') { - errMsg = makePrintable('Illegal relational operation: "' + keyRaw + '" in condition:', exprOption); - } + var op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw) ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw] : keyRaw; + var condValueRaw = exprOption[keyRaw]; + var condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw; + var evaluator = createFilterComparator(op, condValueParsed) || op === 'reg' && new RegExpEvaluator(condValueParsed); - throwError(errMsg); - } + if (!evaluator) { + if ("development" !== 'production') { + errMsg = makePrintable('Illegal relational operation: "' + keyRaw + '" in condition:', exprOption); + } - subCondList.push(evaluator); + throwError(errMsg); } - if (!subCondList.length) { - if ("development" !== 'production') { - errMsg = makePrintable('Relational condition must have at least one operator.', 'Illegal condition:', exprOption); - } // No relational operator always disabled in case of dangers result. + subCondList.push(evaluator); + } + if (!subCondList.length) { + if ("development" !== 'production') { + errMsg = makePrintable('Relational condition must have at least one operator.', 'Illegal condition:', exprOption); + } // No relational operator always disabled in case of dangers result. - throwError(errMsg); - } - var cond = new RelationalConditionInternal(); - cond.valueGetterParam = valueGetterParam; - cond.valueParser = valueParser; - cond.getValue = getters.getValue; - cond.subCondList = subCondList; - return cond; + throwError(errMsg); + } + + var cond = new RelationalConditionInternal(); + cond.valueGetterParam = valueGetterParam; + cond.valueParser = valueParser; + cond.getValue = getters.getValue; + cond.subCondList = subCondList; + return cond; } function isObjectNotArray(val) { - return isObject(val) && !isArrayLike(val); + return isObject(val) && !isArrayLike(val); } var ConditionalExpressionParsed = - /** @class */ - function () { - function ConditionalExpressionParsed(exprOption, getters) { - this._cond = parseOption(exprOption, getters); - } + /** @class */ + function () { + function ConditionalExpressionParsed(exprOption, getters) { + this._cond = parseOption(exprOption, getters); + } - ConditionalExpressionParsed.prototype.evaluate = function () { - return this._cond.evaluate(); - }; + ConditionalExpressionParsed.prototype.evaluate = function () { + return this._cond.evaluate(); + }; - return ConditionalExpressionParsed; - }(); + return ConditionalExpressionParsed; + }(); function parseConditionalExpression(exprOption, getters) { - return new ConditionalExpressionParsed(exprOption, getters); + return new ConditionalExpressionParsed(exprOption, getters); } var filterTransform = { - type: 'echarts:filter', - // PEDING: enhance to filter by index rather than create new data - transform: function (params) { - // [Caveat] Fail-Fast: - // Do not return the whole dataset unless user config indicate it explicitly. - // For example, if no condition specified by mistake, return an empty result - // is better than return the entire raw soruce for user to find the mistake. - var upstream = params.upstream; - var rawItem; - var condition = parseConditionalExpression(params.config, { - valueGetterAttrMap: createHashMap({ - dimension: true - }), - prepareGetValue: function (exprOption) { - var errMsg = ''; - var dimLoose = exprOption.dimension; - - if (!hasOwn(exprOption, 'dimension')) { - if ("development" !== 'production') { - errMsg = makePrintable('Relation condition must has prop "dimension" specified.', 'Illegal condition:', exprOption); - } - - throwError(errMsg); - } - - var dimInfo = upstream.getDimensionInfo(dimLoose); + type: 'echarts:filter', + // PEDING: enhance to filter by index rather than create new data + transform: function (params) { + // [Caveat] Fail-Fast: + // Do not return the whole dataset unless user config indicate it explicitly. + // For example, if no condition specified by mistake, return an empty result + // is better than return the entire raw soruce for user to find the mistake. + var upstream = params.upstream; + var rawItem; + var condition = parseConditionalExpression(params.config, { + valueGetterAttrMap: createHashMap({ + dimension: true + }), + prepareGetValue: function (exprOption) { + var errMsg = ''; + var dimLoose = exprOption.dimension; - if (!dimInfo) { - if ("development" !== 'production') { - errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\n', 'Illegal condition:', exprOption, '.\n'); - } + if (!hasOwn(exprOption, 'dimension')) { + if ("development" !== 'production') { + errMsg = makePrintable('Relation condition must has prop "dimension" specified.', 'Illegal condition:', exprOption); + } - throwError(errMsg); - } + throwError(errMsg); + } - return { - dimIdx: dimInfo.index - }; - }, - getValue: function (param) { - return upstream.retrieveValueFromItem(rawItem, param.dimIdx); - } - }); - var resultData = []; + var dimInfo = upstream.getDimensionInfo(dimLoose); - for (var i = 0, len = upstream.count(); i < len; i++) { - rawItem = upstream.getRawDataItem(i); + if (!dimInfo) { + if ("development" !== 'production') { + errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\n', 'Illegal condition:', exprOption, '.\n'); + } - if (condition.evaluate()) { - resultData.push(rawItem); - } + throwError(errMsg); } return { - data: resultData + dimIdx: dimInfo.index }; + }, + getValue: function (param) { + return upstream.retrieveValueFromItem(rawItem, param.dimIdx); + } + }); + var resultData = []; + + for (var i = 0, len = upstream.count(); i < len; i++) { + rawItem = upstream.getRawDataItem(i); + + if (condition.evaluate()) { + resultData.push(rawItem); + } } + + return { + data: resultData + }; + } }; var sampleLog = ''; if ("development" !== 'production') { - sampleLog = ['Valid config is like:', '{ dimension: "age", order: "asc" }', 'or [{ dimension: "age", order: "asc"], { dimension: "date", order: "desc" }]'].join(' '); + sampleLog = ['Valid config is like:', '{ dimension: "age", order: "asc" }', 'or [{ dimension: "age", order: "asc"], { dimension: "date", order: "desc" }]'].join(' '); } var sortTransform = { - type: 'echarts:sort', - transform: function (params) { - var upstream = params.upstream; - var config = params.config; - var errMsg = ''; // Normalize - // const orderExprList: OrderExpression[] = isArray(config[0]) - // ? config as OrderExpression[] - // : [config as OrderExpression]; - - var orderExprList = normalizeToArray(config); - - if (!orderExprList.length) { - if ("development" !== 'production') { - errMsg = 'Empty `config` in sort transform.'; - } + type: 'echarts:sort', + transform: function (params) { + var upstream = params.upstream; + var config = params.config; + var errMsg = ''; // Normalize + // const orderExprList: OrderExpression[] = isArray(config[0]) + // ? config as OrderExpression[] + // : [config as OrderExpression]; - throwError(errMsg); - } + var orderExprList = normalizeToArray(config); - var orderDefList = []; - each(orderExprList, function (orderExpr) { - var dimLoose = orderExpr.dimension; - var order = orderExpr.order; - var parserName = orderExpr.parser; - var incomparable = orderExpr.incomparable; + if (!orderExprList.length) { + if ("development" !== 'production') { + errMsg = 'Empty `config` in sort transform.'; + } - if (dimLoose == null) { - if ("development" !== 'production') { - errMsg = 'Sort transform config must has "dimension" specified.' + sampleLog; - } + throwError(errMsg); + } - throwError(errMsg); - } + var orderDefList = []; + each(orderExprList, function (orderExpr) { + var dimLoose = orderExpr.dimension; + var order = orderExpr.order; + var parserName = orderExpr.parser; + var incomparable = orderExpr.incomparable; - if (order !== 'asc' && order !== 'desc') { - if ("development" !== 'production') { - errMsg = 'Sort transform config must has "order" specified.' + sampleLog; - } + if (dimLoose == null) { + if ("development" !== 'production') { + errMsg = 'Sort transform config must has "dimension" specified.' + sampleLog; + } - throwError(errMsg); - } + throwError(errMsg); + } - if (incomparable && incomparable !== 'min' && incomparable !== 'max') { - var errMsg_1 = ''; + if (order !== 'asc' && order !== 'desc') { + if ("development" !== 'production') { + errMsg = 'Sort transform config must has "order" specified.' + sampleLog; + } - if ("development" !== 'production') { - errMsg_1 = 'incomparable must be "min" or "max" rather than "' + incomparable + '".'; - } + throwError(errMsg); + } - throwError(errMsg_1); - } + if (incomparable && incomparable !== 'min' && incomparable !== 'max') { + var errMsg_1 = ''; - if (order !== 'asc' && order !== 'desc') { - var errMsg_2 = ''; + if ("development" !== 'production') { + errMsg_1 = 'incomparable must be "min" or "max" rather than "' + incomparable + '".'; + } - if ("development" !== 'production') { - errMsg_2 = 'order must be "asc" or "desc" rather than "' + order + '".'; - } + throwError(errMsg_1); + } - throwError(errMsg_2); - } + if (order !== 'asc' && order !== 'desc') { + var errMsg_2 = ''; - var dimInfo = upstream.getDimensionInfo(dimLoose); + if ("development" !== 'production') { + errMsg_2 = 'order must be "asc" or "desc" rather than "' + order + '".'; + } - if (!dimInfo) { - if ("development" !== 'production') { - errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\n', 'Illegal config:', orderExpr, '.\n'); - } + throwError(errMsg_2); + } - throwError(errMsg); - } + var dimInfo = upstream.getDimensionInfo(dimLoose); - var parser = parserName ? getRawValueParser(parserName) : null; + if (!dimInfo) { + if ("development" !== 'production') { + errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\n', 'Illegal config:', orderExpr, '.\n'); + } - if (parserName && !parser) { - if ("development" !== 'production') { - errMsg = makePrintable('Invalid parser name ' + parserName + '.\n', 'Illegal config:', orderExpr, '.\n'); - } + throwError(errMsg); + } - throwError(errMsg); - } + var parser = parserName ? getRawValueParser(parserName) : null; - orderDefList.push({ - dimIdx: dimInfo.index, - parser: parser, - comparator: new SortOrderComparator(order, incomparable) - }); - }); // TODO: support it? + if (parserName && !parser) { + if ("development" !== 'production') { + errMsg = makePrintable('Invalid parser name ' + parserName + '.\n', 'Illegal config:', orderExpr, '.\n'); + } - var sourceFormat = upstream.sourceFormat; + throwError(errMsg); + } - if (sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) { - if ("development" !== 'production') { - errMsg = 'sourceFormat "' + sourceFormat + '" is not supported yet'; - } + orderDefList.push({ + dimIdx: dimInfo.index, + parser: parser, + comparator: new SortOrderComparator(order, incomparable) + }); + }); // TODO: support it? - throwError(errMsg); - } // Other upstream format are all array. + var sourceFormat = upstream.sourceFormat; + if (sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) { + if ("development" !== 'production') { + errMsg = 'sourceFormat "' + sourceFormat + '" is not supported yet'; + } - var resultData = []; + throwError(errMsg); + } // Other upstream format are all array. - for (var i = 0, len = upstream.count(); i < len; i++) { - resultData.push(upstream.getRawDataItem(i)); - } - resultData.sort(function (item0, item1) { - for (var i = 0; i < orderDefList.length; i++) { - var orderDef = orderDefList[i]; - var val0 = upstream.retrieveValueFromItem(item0, orderDef.dimIdx); - var val1 = upstream.retrieveValueFromItem(item1, orderDef.dimIdx); + var resultData = []; - if (orderDef.parser) { - val0 = orderDef.parser(val0); - val1 = orderDef.parser(val1); - } + for (var i = 0, len = upstream.count(); i < len; i++) { + resultData.push(upstream.getRawDataItem(i)); + } - var result = orderDef.comparator.evaluate(val0, val1); + resultData.sort(function (item0, item1) { + for (var i = 0; i < orderDefList.length; i++) { + var orderDef = orderDefList[i]; + var val0 = upstream.retrieveValueFromItem(item0, orderDef.dimIdx); + var val1 = upstream.retrieveValueFromItem(item1, orderDef.dimIdx); - if (result !== 0) { - return result; - } - } + if (orderDef.parser) { + val0 = orderDef.parser(val0); + val1 = orderDef.parser(val1); + } - return 0; - }); - return { - data: resultData - }; - } + var result = orderDef.comparator.evaluate(val0, val1); + + if (result !== 0) { + return result; + } + } + + return 0; + }); + return { + data: resultData + }; + } }; function install$R(registers) { - registers.registerTransform(filterTransform); - registers.registerTransform(sortTransform); + registers.registerTransform(filterTransform); + registers.registerTransform(sortTransform); } var DatasetModel = - /** @class */ - function (_super) { - __extends(DatasetModel, _super); + /** @class */ + function (_super) { + __extends(DatasetModel, _super); - function DatasetModel() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function DatasetModel() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = 'dataset'; - return _this; - } + _this.type = 'dataset'; + return _this; + } - DatasetModel.prototype.init = function (option, parentModel, ecModel) { - _super.prototype.init.call(this, option, parentModel, ecModel); + DatasetModel.prototype.init = function (option, parentModel, ecModel) { + _super.prototype.init.call(this, option, parentModel, ecModel); - this._sourceManager = new SourceManager(this); - disableTransformOptionMerge(this); - }; + this._sourceManager = new SourceManager(this); + disableTransformOptionMerge(this); + }; - DatasetModel.prototype.mergeOption = function (newOption, ecModel) { - _super.prototype.mergeOption.call(this, newOption, ecModel); + DatasetModel.prototype.mergeOption = function (newOption, ecModel) { + _super.prototype.mergeOption.call(this, newOption, ecModel); - disableTransformOptionMerge(this); - }; + disableTransformOptionMerge(this); + }; - DatasetModel.prototype.optionUpdated = function () { - this._sourceManager.dirty(); - }; + DatasetModel.prototype.optionUpdated = function () { + this._sourceManager.dirty(); + }; - DatasetModel.prototype.getSourceManager = function () { - return this._sourceManager; - }; + DatasetModel.prototype.getSourceManager = function () { + return this._sourceManager; + }; - DatasetModel.type = 'dataset'; - DatasetModel.defaultOption = { - seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN - }; - return DatasetModel; - }(ComponentModel); + DatasetModel.type = 'dataset'; + DatasetModel.defaultOption = { + seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN + }; + return DatasetModel; + }(ComponentModel); var DatasetView = - /** @class */ - function (_super) { - __extends(DatasetView, _super); + /** @class */ + function (_super) { + __extends(DatasetView, _super); - function DatasetView() { - var _this = _super !== null && _super.apply(this, arguments) || this; + function DatasetView() { + var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = 'dataset'; - return _this; - } + _this.type = 'dataset'; + return _this; + } - DatasetView.type = 'dataset'; - return DatasetView; - }(ComponentView); + DatasetView.type = 'dataset'; + return DatasetView; + }(ComponentView); function install$S(registers) { - registers.registerComponentModel(DatasetModel); - registers.registerComponentView(DatasetView); + registers.registerComponentModel(DatasetModel); + registers.registerComponentView(DatasetView); } var CMD$4 = PathProxy.CMD; @@ -93423,10 +93423,10 @@ addToPoly(newPolyB, splitPt0Arr); addToPoly(newPolyB, splitPt1Arr); return [{ - points: newPolyA - }, { - points: newPolyB - }]; + points: newPolyA + }, { + points: newPolyB + }]; } function binaryDividePolygon(polygonShape) { var points = polygonShape.points; @@ -94149,764 +94149,764 @@ } function isMultiple(elements) { - return isArray(elements[0]); + return isArray(elements[0]); } function prepareMorphBatches(one, many) { - var batches = []; - var batchCount = one.length; + var batches = []; + var batchCount = one.length; - for (var i = 0; i < batchCount; i++) { - batches.push({ - one: one[i], - many: [] - }); - } + for (var i = 0; i < batchCount; i++) { + batches.push({ + one: one[i], + many: [] + }); + } - for (var i = 0; i < many.length; i++) { - var len = many[i].length; - var k = void 0; + for (var i = 0; i < many.length; i++) { + var len = many[i].length; + var k = void 0; - for (k = 0; k < len; k++) { - batches[k % batchCount].many.push(many[i][k]); - } + for (k = 0; k < len; k++) { + batches[k % batchCount].many.push(many[i][k]); } + } - var off = 0; // If one has more paths than each one of many. average them. + var off = 0; // If one has more paths than each one of many. average them. - for (var i = batchCount - 1; i >= 0; i--) { - if (!batches[i].many.length) { - var moveFrom = batches[off].many; - - if (moveFrom.length <= 1) { - // Not enough - // Start from the first one. - if (off) { - off = 0; - } else { - return batches; - } - } + for (var i = batchCount - 1; i >= 0; i--) { + if (!batches[i].many.length) { + var moveFrom = batches[off].many; - var len = moveFrom.length; - var mid = Math.ceil(len / 2); - batches[i].many = moveFrom.slice(mid, len); - batches[off].many = moveFrom.slice(0, mid); - off++; + if (moveFrom.length <= 1) { + // Not enough + // Start from the first one. + if (off) { + off = 0; + } else { + return batches; } + } + + var len = moveFrom.length; + var mid = Math.ceil(len / 2); + batches[i].many = moveFrom.slice(mid, len); + batches[off].many = moveFrom.slice(0, mid); + off++; } + } - return batches; + return batches; } var pathDividers = { - clone: function (params) { - var ret = []; // Fitting the alpha + clone: function (params) { + var ret = []; // Fitting the alpha - var approxOpacity = 1 - Math.pow(1 - params.path.style.opacity, 1 / params.count); + var approxOpacity = 1 - Math.pow(1 - params.path.style.opacity, 1 / params.count); - for (var i = 0; i < params.count; i++) { - var cloned = clonePath(params.path); - cloned.setStyle('opacity', approxOpacity); - ret.push(cloned); - } + for (var i = 0; i < params.count; i++) { + var cloned = clonePath(params.path); + cloned.setStyle('opacity', approxOpacity); + ret.push(cloned); + } - return ret; - }, - // Use the default divider - split: null + return ret; + }, + // Use the default divider + split: null }; function applyMorphAnimation(from, to, divideShape, seriesModel, dataIndex, animateOtherProps) { - if (!from.length || !to.length) { - return; - } - - var updateAnimationCfg = getAnimationConfig('update', seriesModel, dataIndex); - - if (!(updateAnimationCfg && updateAnimationCfg.duration > 0)) { - return; - } - - var animationDelay = seriesModel.getModel('universalTransition').get('delay'); - var animationCfg = Object.assign({ - // Need to setToFinal so the further calculation based on the style can be correct. - // Like emphasis color. - setToFinal: true - }, updateAnimationCfg); - var many; - var one; - - if (isMultiple(from)) { - // manyToOne - many = from; - one = to; - } - - if (isMultiple(to)) { - // oneToMany - many = to; - one = from; - } - - function morphOneBatch(batch, fromIsMany, animateIndex, animateCount, forceManyOne) { - var batchMany = batch.many; - var batchOne = batch.one; + if (!from.length || !to.length) { + return; + } - if (batchMany.length === 1 && !forceManyOne) { - // Is one to one - var batchFrom = fromIsMany ? batchMany[0] : batchOne; - var batchTo = fromIsMany ? batchOne : batchMany[0]; + var updateAnimationCfg = getAnimationConfig('update', seriesModel, dataIndex); - if (isCombineMorphing(batchFrom)) { - // Keep doing combine animation. - morphOneBatch({ - many: [batchFrom], - one: batchTo - }, true, animateIndex, animateCount, true); - } else { - var individualAnimationCfg = animationDelay ? defaults({ - delay: animationDelay(animateIndex, animateCount) - }, animationCfg) : animationCfg; - morphPath(batchFrom, batchTo, individualAnimationCfg); - animateOtherProps(batchFrom, batchTo, batchFrom, batchTo, individualAnimationCfg); - } - } else { - var separateAnimationCfg = defaults({ - dividePath: pathDividers[divideShape], - individualDelay: animationDelay && function (idx, count, fromPath, toPath) { - return animationDelay(idx + animateIndex, animateCount); - } - }, animationCfg); + if (!(updateAnimationCfg && updateAnimationCfg.duration > 0)) { + return; + } + + var animationDelay = seriesModel.getModel('universalTransition').get('delay'); + var animationCfg = Object.assign({ + // Need to setToFinal so the further calculation based on the style can be correct. + // Like emphasis color. + setToFinal: true + }, updateAnimationCfg); + var many; + var one; + + if (isMultiple(from)) { + // manyToOne + many = from; + one = to; + } + + if (isMultiple(to)) { + // oneToMany + many = to; + one = from; + } + + function morphOneBatch(batch, fromIsMany, animateIndex, animateCount, forceManyOne) { + var batchMany = batch.many; + var batchOne = batch.one; + + if (batchMany.length === 1 && !forceManyOne) { + // Is one to one + var batchFrom = fromIsMany ? batchMany[0] : batchOne; + var batchTo = fromIsMany ? batchOne : batchMany[0]; + + if (isCombineMorphing(batchFrom)) { + // Keep doing combine animation. + morphOneBatch({ + many: [batchFrom], + one: batchTo + }, true, animateIndex, animateCount, true); + } else { + var individualAnimationCfg = animationDelay ? defaults({ + delay: animationDelay(animateIndex, animateCount) + }, animationCfg) : animationCfg; + morphPath(batchFrom, batchTo, individualAnimationCfg); + animateOtherProps(batchFrom, batchTo, batchFrom, batchTo, individualAnimationCfg); + } + } else { + var separateAnimationCfg = defaults({ + dividePath: pathDividers[divideShape], + individualDelay: animationDelay && function (idx, count, fromPath, toPath) { + return animationDelay(idx + animateIndex, animateCount); + } + }, animationCfg); - var _a = fromIsMany ? combineMorph(batchMany, batchOne, separateAnimationCfg) : separateMorph(batchOne, batchMany, separateAnimationCfg), - fromIndividuals = _a.fromIndividuals, - toIndividuals = _a.toIndividuals; + var _a = fromIsMany ? combineMorph(batchMany, batchOne, separateAnimationCfg) : separateMorph(batchOne, batchMany, separateAnimationCfg), + fromIndividuals = _a.fromIndividuals, + toIndividuals = _a.toIndividuals; - var count = fromIndividuals.length; + var count = fromIndividuals.length; - for (var k = 0; k < count; k++) { - var individualAnimationCfg = animationDelay ? defaults({ - delay: animationDelay(k, count) - }, animationCfg) : animationCfg; - animateOtherProps(fromIndividuals[k], toIndividuals[k], fromIsMany ? batchMany[k] : batch.one, fromIsMany ? batch.one : batchMany[k], individualAnimationCfg); - } - } + for (var k = 0; k < count; k++) { + var individualAnimationCfg = animationDelay ? defaults({ + delay: animationDelay(k, count) + }, animationCfg) : animationCfg; + animateOtherProps(fromIndividuals[k], toIndividuals[k], fromIsMany ? batchMany[k] : batch.one, fromIsMany ? batch.one : batchMany[k], individualAnimationCfg); + } } + } - var fromIsMany = many ? many === from // Is one to one. If the path number not match. also needs do merge and separate morphing. - : from.length > to.length; - var morphBatches = many ? prepareMorphBatches(one, many) : prepareMorphBatches(fromIsMany ? to : from, [fromIsMany ? from : to]); - var animateCount = 0; + var fromIsMany = many ? many === from // Is one to one. If the path number not match. also needs do merge and separate morphing. + : from.length > to.length; + var morphBatches = many ? prepareMorphBatches(one, many) : prepareMorphBatches(fromIsMany ? to : from, [fromIsMany ? from : to]); + var animateCount = 0; - for (var i = 0; i < morphBatches.length; i++) { - animateCount += morphBatches[i].many.length; - } + for (var i = 0; i < morphBatches.length; i++) { + animateCount += morphBatches[i].many.length; + } - var animateIndex = 0; + var animateIndex = 0; - for (var i = 0; i < morphBatches.length; i++) { - morphOneBatch(morphBatches[i], fromIsMany, animateIndex, animateCount); - animateIndex += morphBatches[i].many.length; - } + for (var i = 0; i < morphBatches.length; i++) { + morphOneBatch(morphBatches[i], fromIsMany, animateIndex, animateCount); + animateIndex += morphBatches[i].many.length; + } } function getPathList(elements) { - if (!elements) { - return []; - } - - if (isArray(elements)) { - var pathList_1 = []; + if (!elements) { + return []; + } - for (var i = 0; i < elements.length; i++) { - pathList_1.push(getPathList(elements[i])); - } + if (isArray(elements)) { + var pathList_1 = []; - return pathList_1; + for (var i = 0; i < elements.length; i++) { + pathList_1.push(getPathList(elements[i])); } - var pathList = []; - elements.traverse(function (el) { - if (el instanceof Path && !el.disableMorphing && !el.invisible && !el.ignore) { - pathList.push(el); - } - }); - return pathList; + return pathList_1; + } + + var pathList = []; + elements.traverse(function (el) { + if (el instanceof Path && !el.disableMorphing && !el.invisible && !el.ignore) { + pathList.push(el); + } + }); + return pathList; } var DATA_COUNT_THRESHOLD = 1e4; var getUniversalTransitionGlobalStore = makeInner(); function getGroupIdDimension(data) { - var dimensions = data.dimensions; + var dimensions = data.dimensions; - for (var i = 0; i < dimensions.length; i++) { - var dimInfo = data.getDimensionInfo(dimensions[i]); + for (var i = 0; i < dimensions.length; i++) { + var dimInfo = data.getDimensionInfo(dimensions[i]); - if (dimInfo && dimInfo.otherDims.itemGroupId === 0) { - return dimensions[i]; - } + if (dimInfo && dimInfo.otherDims.itemGroupId === 0) { + return dimensions[i]; } + } } function flattenDataDiffItems(list) { - var items = []; - each(list, function (seriesInfo) { - var data = seriesInfo.data; + var items = []; + each(list, function (seriesInfo) { + var data = seriesInfo.data; - if (data.count() > DATA_COUNT_THRESHOLD) { - if ("development" !== 'production') { - warn('Universal transition is disabled on large data > 10k.'); - } + if (data.count() > DATA_COUNT_THRESHOLD) { + if ("development" !== 'production') { + warn('Universal transition is disabled on large data > 10k.'); + } - return; - } + return; + } - var indices = data.getIndices(); - var groupDim = getGroupIdDimension(data); + var indices = data.getIndices(); + var groupDim = getGroupIdDimension(data); - for (var dataIndex = 0; dataIndex < indices.length; dataIndex++) { - items.push({ - data: data, - dim: seriesInfo.dim || groupDim, - divide: seriesInfo.divide, - dataIndex: dataIndex - }); - } - }); - return items; + for (var dataIndex = 0; dataIndex < indices.length; dataIndex++) { + items.push({ + data: data, + dim: seriesInfo.dim || groupDim, + divide: seriesInfo.divide, + dataIndex: dataIndex + }); + } + }); + return items; } function fadeInElement(newEl, newSeries, newIndex) { - newEl.traverse(function (el) { - if (el instanceof Path) { - // TODO use fade in animation for target element. - initProps(el, { - style: { - opacity: 0 - } - }, newSeries, { - dataIndex: newIndex, - isFrom: true - }); + newEl.traverse(function (el) { + if (el instanceof Path) { + // TODO use fade in animation for target element. + initProps(el, { + style: { + opacity: 0 } - }); + }, newSeries, { + dataIndex: newIndex, + isFrom: true + }); + } + }); } function removeEl$1(el) { - if (el.parent) { - // Bake parent transform to element. - // So it can still have proper transform to transition after it's removed. - var computedTransform = el.getComputedTransform(); - el.setLocalTransform(computedTransform); - el.parent.remove(el); - } + if (el.parent) { + // Bake parent transform to element. + // So it can still have proper transform to transition after it's removed. + var computedTransform = el.getComputedTransform(); + el.setLocalTransform(computedTransform); + el.parent.remove(el); + } } function stopAnimation(el) { - el.stopAnimation(); + el.stopAnimation(); - if (el.isGroup) { - el.traverse(function (child) { - child.stopAnimation(); - }); - } + if (el.isGroup) { + el.traverse(function (child) { + child.stopAnimation(); + }); + } } function animateElementStyles(el, dataIndex, seriesModel) { - var animationConfig = getAnimationConfig('update', seriesModel, dataIndex); - animationConfig && el.traverse(function (child) { - if (child instanceof Displayable) { - var oldStyle = getOldStyle(child); + var animationConfig = getAnimationConfig('update', seriesModel, dataIndex); + animationConfig && el.traverse(function (child) { + if (child instanceof Displayable) { + var oldStyle = getOldStyle(child); - if (oldStyle) { - child.animateFrom({ - style: oldStyle - }, animationConfig); - } - } - }); + if (oldStyle) { + child.animateFrom({ + style: oldStyle + }, animationConfig); + } + } + }); } function isAllIdSame(oldDiffItems, newDiffItems) { - var len = oldDiffItems.length; + var len = oldDiffItems.length; - if (len !== newDiffItems.length) { - return false; - } + if (len !== newDiffItems.length) { + return false; + } - for (var i = 0; i < len; i++) { - var oldItem = oldDiffItems[i]; - var newItem = newDiffItems[i]; + for (var i = 0; i < len; i++) { + var oldItem = oldDiffItems[i]; + var newItem = newDiffItems[i]; - if (oldItem.data.getId(oldItem.dataIndex) !== newItem.data.getId(newItem.dataIndex)) { - return false; - } + if (oldItem.data.getId(oldItem.dataIndex) !== newItem.data.getId(newItem.dataIndex)) { + return false; } + } - return true; + return true; } function transitionBetween(oldList, newList, api) { - var oldDiffItems = flattenDataDiffItems(oldList); - var newDiffItems = flattenDataDiffItems(newList); - - function updateMorphingPathProps(from, to, rawFrom, rawTo, animationCfg) { - if (rawFrom || from) { - to.animateFrom({ - style: rawFrom && rawFrom !== from ? // dividingMethod like clone may override the style(opacity) - // So extend it to raw style. - extend(extend({}, rawFrom.style), from.style) : from.style - }, animationCfg); - } + var oldDiffItems = flattenDataDiffItems(oldList); + var newDiffItems = flattenDataDiffItems(newList); + + function updateMorphingPathProps(from, to, rawFrom, rawTo, animationCfg) { + if (rawFrom || from) { + to.animateFrom({ + style: rawFrom && rawFrom !== from ? // dividingMethod like clone may override the style(opacity) + // So extend it to raw style. + extend(extend({}, rawFrom.style), from.style) : from.style + }, animationCfg); } + } - function findKeyDim(items) { - for (var i = 0; i < items.length; i++) { - if (items[i].dim) { - return items[i].dim; - } - } + function findKeyDim(items) { + for (var i = 0; i < items.length; i++) { + if (items[i].dim) { + return items[i].dim; + } } + } - var oldKeyDim = findKeyDim(oldDiffItems); - var newKeyDim = findKeyDim(newDiffItems); - var hasMorphAnimation = false; + var oldKeyDim = findKeyDim(oldDiffItems); + var newKeyDim = findKeyDim(newDiffItems); + var hasMorphAnimation = false; - function createKeyGetter(isOld, onlyGetId) { - return function (diffItem) { - var data = diffItem.data; - var dataIndex = diffItem.dataIndex; // TODO if specified dim + function createKeyGetter(isOld, onlyGetId) { + return function (diffItem) { + var data = diffItem.data; + var dataIndex = diffItem.dataIndex; // TODO if specified dim - if (onlyGetId) { - return data.getId(dataIndex); - } // Use group id as transition key by default. - // So we can achieve multiple to multiple animation like drilldown / up naturally. - // If group id not exits. Use id instead. If so, only one to one transition will be applied. + if (onlyGetId) { + return data.getId(dataIndex); + } // Use group id as transition key by default. + // So we can achieve multiple to multiple animation like drilldown / up naturally. + // If group id not exits. Use id instead. If so, only one to one transition will be applied. - var dataGroupId = data.hostModel && data.hostModel.get('dataGroupId'); // If specified key dimension(itemGroupId by default). Use this same dimension from other data. - // PENDING: If only use key dimension of newData. + var dataGroupId = data.hostModel && data.hostModel.get('dataGroupId'); // If specified key dimension(itemGroupId by default). Use this same dimension from other data. + // PENDING: If only use key dimension of newData. - var keyDim = isOld ? oldKeyDim || newKeyDim : newKeyDim || oldKeyDim; - var dimInfo = keyDim && data.getDimensionInfo(keyDim); - var dimOrdinalMeta = dimInfo && dimInfo.ordinalMeta; + var keyDim = isOld ? oldKeyDim || newKeyDim : newKeyDim || oldKeyDim; + var dimInfo = keyDim && data.getDimensionInfo(keyDim); + var dimOrdinalMeta = dimInfo && dimInfo.ordinalMeta; - if (dimInfo) { - // Get from encode.itemGroupId. - var key = data.get(dimInfo.name, dataIndex); + if (dimInfo) { + // Get from encode.itemGroupId. + var key = data.get(dimInfo.name, dataIndex); - if (dimOrdinalMeta) { - return dimOrdinalMeta.categories[key] || key + ''; - } + if (dimOrdinalMeta) { + return dimOrdinalMeta.categories[key] || key + ''; + } - return key + ''; - } // Get groupId from raw item. { groupId: '' } + return key + ''; + } // Get groupId from raw item. { groupId: '' } - var itemVal = data.getRawDataItem(dataIndex); + var itemVal = data.getRawDataItem(dataIndex); - if (itemVal && itemVal.groupId) { - return itemVal.groupId + ''; - } + if (itemVal && itemVal.groupId) { + return itemVal.groupId + ''; + } - return dataGroupId || data.getId(dataIndex); - }; - } // Use id if it's very likely to be an one to one animation - // It's more robust than groupId - // TODO Check if key dimension is specified. + return dataGroupId || data.getId(dataIndex); + }; + } // Use id if it's very likely to be an one to one animation + // It's more robust than groupId + // TODO Check if key dimension is specified. - var useId = isAllIdSame(oldDiffItems, newDiffItems); - var isElementStillInChart = {}; + var useId = isAllIdSame(oldDiffItems, newDiffItems); + var isElementStillInChart = {}; - if (!useId) { - // We may have different diff strategy with basicTransition if we use other dimension as key. - // If so, we can't simply check if oldEl is same with newEl. We need a map to check if oldEl is still being used in the new chart. - // We can't use the elements that already being morphed. Let it keep it's original basic transition. - for (var i = 0; i < newDiffItems.length; i++) { - var newItem = newDiffItems[i]; - var el = newItem.data.getItemGraphicEl(newItem.dataIndex); + if (!useId) { + // We may have different diff strategy with basicTransition if we use other dimension as key. + // If so, we can't simply check if oldEl is same with newEl. We need a map to check if oldEl is still being used in the new chart. + // We can't use the elements that already being morphed. Let it keep it's original basic transition. + for (var i = 0; i < newDiffItems.length; i++) { + var newItem = newDiffItems[i]; + var el = newItem.data.getItemGraphicEl(newItem.dataIndex); - if (el) { - isElementStillInChart[el.id] = true; - } - } + if (el) { + isElementStillInChart[el.id] = true; + } } + } - function updateOneToOne(newIndex, oldIndex) { - var oldItem = oldDiffItems[oldIndex]; - var newItem = newDiffItems[newIndex]; - var newSeries = newItem.data.hostModel; // TODO Mark this elements is morphed and don't morph them anymore - - var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex); - var newEl = newItem.data.getItemGraphicEl(newItem.dataIndex); // Can't handle same elements. - - if (oldEl === newEl) { - newEl && animateElementStyles(newEl, newItem.dataIndex, newSeries); - return; - } - - if ( // We can't use the elements that already being morphed - oldEl && isElementStillInChart[oldEl.id]) { - return; - } - - if (newEl) { - // TODO: If keep animating the group in case - // some of the elements don't want to be morphed. - // TODO Label? - stopAnimation(newEl); + function updateOneToOne(newIndex, oldIndex) { + var oldItem = oldDiffItems[oldIndex]; + var newItem = newDiffItems[newIndex]; + var newSeries = newItem.data.hostModel; // TODO Mark this elements is morphed and don't morph them anymore - if (oldEl) { - stopAnimation(oldEl); // If old element is doing leaving animation. stop it and remove it immediately. + var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex); + var newEl = newItem.data.getItemGraphicEl(newItem.dataIndex); // Can't handle same elements. - removeEl$1(oldEl); - hasMorphAnimation = true; - applyMorphAnimation(getPathList(oldEl), getPathList(newEl), newItem.divide, newSeries, newIndex, updateMorphingPathProps); - } else { - fadeInElement(newEl, newSeries, newIndex); - } - } // else keep oldEl leaving animation. + if (oldEl === newEl) { + newEl && animateElementStyles(newEl, newItem.dataIndex, newSeries); + return; + } + if ( // We can't use the elements that already being morphed + oldEl && isElementStillInChart[oldEl.id]) { + return; } - new DataDiffer(oldDiffItems, newDiffItems, createKeyGetter(true, useId), createKeyGetter(false, useId), null, 'multiple').update(updateOneToOne).updateManyToOne(function (newIndex, oldIndices) { - var newItem = newDiffItems[newIndex]; - var newData = newItem.data; - var newSeries = newData.hostModel; - var newEl = newData.getItemGraphicEl(newItem.dataIndex); - var oldElsList = filter(map(oldIndices, function (idx) { - return oldDiffItems[idx].data.getItemGraphicEl(oldDiffItems[idx].dataIndex); - }), function (oldEl) { - return oldEl && oldEl !== newEl && !isElementStillInChart[oldEl.id]; - }); + if (newEl) { + // TODO: If keep animating the group in case + // some of the elements don't want to be morphed. + // TODO Label? + stopAnimation(newEl); - if (newEl) { - stopAnimation(newEl); + if (oldEl) { + stopAnimation(oldEl); // If old element is doing leaving animation. stop it and remove it immediately. - if (oldElsList.length) { - // If old element is doing leaving animation. stop it and remove it immediately. - each(oldElsList, function (oldEl) { - stopAnimation(oldEl); - removeEl$1(oldEl); - }); - hasMorphAnimation = true; - applyMorphAnimation(getPathList(oldElsList), getPathList(newEl), newItem.divide, newSeries, newIndex, updateMorphingPathProps); - } else { - fadeInElement(newEl, newSeries, newItem.dataIndex); - } - } // else keep oldEl leaving animation. + removeEl$1(oldEl); + hasMorphAnimation = true; + applyMorphAnimation(getPathList(oldEl), getPathList(newEl), newItem.divide, newSeries, newIndex, updateMorphingPathProps); + } else { + fadeInElement(newEl, newSeries, newIndex); + } + } // else keep oldEl leaving animation. - }).updateOneToMany(function (newIndices, oldIndex) { - var oldItem = oldDiffItems[oldIndex]; - var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex); // We can't use the elements that already being morphed + } - if (oldEl && isElementStillInChart[oldEl.id]) { - return; - } + new DataDiffer(oldDiffItems, newDiffItems, createKeyGetter(true, useId), createKeyGetter(false, useId), null, 'multiple').update(updateOneToOne).updateManyToOne(function (newIndex, oldIndices) { + var newItem = newDiffItems[newIndex]; + var newData = newItem.data; + var newSeries = newData.hostModel; + var newEl = newData.getItemGraphicEl(newItem.dataIndex); + var oldElsList = filter(map(oldIndices, function (idx) { + return oldDiffItems[idx].data.getItemGraphicEl(oldDiffItems[idx].dataIndex); + }), function (oldEl) { + return oldEl && oldEl !== newEl && !isElementStillInChart[oldEl.id]; + }); - var newElsList = filter(map(newIndices, function (idx) { - return newDiffItems[idx].data.getItemGraphicEl(newDiffItems[idx].dataIndex); - }), function (el) { - return el && el !== oldEl; + if (newEl) { + stopAnimation(newEl); + + if (oldElsList.length) { + // If old element is doing leaving animation. stop it and remove it immediately. + each(oldElsList, function (oldEl) { + stopAnimation(oldEl); + removeEl$1(oldEl); }); - var newSeris = newDiffItems[newIndices[0]].data.hostModel; + hasMorphAnimation = true; + applyMorphAnimation(getPathList(oldElsList), getPathList(newEl), newItem.divide, newSeries, newIndex, updateMorphingPathProps); + } else { + fadeInElement(newEl, newSeries, newItem.dataIndex); + } + } // else keep oldEl leaving animation. - if (newElsList.length) { - each(newElsList, function (newEl) { - return stopAnimation(newEl); - }); + }).updateOneToMany(function (newIndices, oldIndex) { + var oldItem = oldDiffItems[oldIndex]; + var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex); // We can't use the elements that already being morphed - if (oldEl) { - stopAnimation(oldEl); // If old element is doing leaving animation. stop it and remove it immediately. + if (oldEl && isElementStillInChart[oldEl.id]) { + return; + } - removeEl$1(oldEl); - hasMorphAnimation = true; - applyMorphAnimation(getPathList(oldEl), getPathList(newElsList), oldItem.divide, // Use divide on old. - newSeris, newIndices[0], updateMorphingPathProps); - } else { - each(newElsList, function (newEl) { - return fadeInElement(newEl, newSeris, newIndices[0]); - }); - } - } // else keep oldEl leaving animation. - - }).updateManyToMany(function (newIndices, oldIndices) { - // If two data are same and both have groupId. - // Normally they should be diff by id. - new DataDiffer(oldIndices, newIndices, function (rawIdx) { - return oldDiffItems[rawIdx].data.getId(oldDiffItems[rawIdx].dataIndex); - }, function (rawIdx) { - return newDiffItems[rawIdx].data.getId(newDiffItems[rawIdx].dataIndex); - }).update(function (newIndex, oldIndex) { - // Use the original index - updateOneToOne(newIndices[newIndex], oldIndices[oldIndex]); - }).execute(); + var newElsList = filter(map(newIndices, function (idx) { + return newDiffItems[idx].data.getItemGraphicEl(newDiffItems[idx].dataIndex); + }), function (el) { + return el && el !== oldEl; + }); + var newSeris = newDiffItems[newIndices[0]].data.hostModel; + + if (newElsList.length) { + each(newElsList, function (newEl) { + return stopAnimation(newEl); + }); + + if (oldEl) { + stopAnimation(oldEl); // If old element is doing leaving animation. stop it and remove it immediately. + + removeEl$1(oldEl); + hasMorphAnimation = true; + applyMorphAnimation(getPathList(oldEl), getPathList(newElsList), oldItem.divide, // Use divide on old. + newSeris, newIndices[0], updateMorphingPathProps); + } else { + each(newElsList, function (newEl) { + return fadeInElement(newEl, newSeris, newIndices[0]); + }); + } + } // else keep oldEl leaving animation. + + }).updateManyToMany(function (newIndices, oldIndices) { + // If two data are same and both have groupId. + // Normally they should be diff by id. + new DataDiffer(oldIndices, newIndices, function (rawIdx) { + return oldDiffItems[rawIdx].data.getId(oldDiffItems[rawIdx].dataIndex); + }, function (rawIdx) { + return newDiffItems[rawIdx].data.getId(newDiffItems[rawIdx].dataIndex); + }).update(function (newIndex, oldIndex) { + // Use the original index + updateOneToOne(newIndices[newIndex], oldIndices[oldIndex]); }).execute(); - - if (hasMorphAnimation) { - each(newList, function (_a) { - var data = _a.data; - var seriesModel = data.hostModel; - var view = seriesModel && api.getViewOfSeriesModel(seriesModel); - var animationCfg = getAnimationConfig('update', seriesModel, 0); // use 0 index. - - if (view && seriesModel.isAnimationEnabled() && animationCfg && animationCfg.duration > 0) { - view.group.traverse(function (el) { - if (el instanceof Path && !el.animators.length) { - // We can't accept there still exists element that has no animation - // if universalTransition is enabled - el.animateFrom({ - style: { - opacity: 0 - } - }, animationCfg); - } - }); - } + }).execute(); + + if (hasMorphAnimation) { + each(newList, function (_a) { + var data = _a.data; + var seriesModel = data.hostModel; + var view = seriesModel && api.getViewOfSeriesModel(seriesModel); + var animationCfg = getAnimationConfig('update', seriesModel, 0); // use 0 index. + + if (view && seriesModel.isAnimationEnabled() && animationCfg && animationCfg.duration > 0) { + view.group.traverse(function (el) { + if (el instanceof Path && !el.animators.length) { + // We can't accept there still exists element that has no animation + // if universalTransition is enabled + el.animateFrom({ + style: { + opacity: 0 + } + }, animationCfg); + } }); - } + } + }); + } } function getSeriesTransitionKey(series) { - var seriesKey = series.getModel('universalTransition').get('seriesKey'); + var seriesKey = series.getModel('universalTransition').get('seriesKey'); - if (!seriesKey) { - // Use series id by default. - return series.id; - } + if (!seriesKey) { + // Use series id by default. + return series.id; + } - return seriesKey; + return seriesKey; } function convertArraySeriesKeyToString(seriesKey) { - if (isArray(seriesKey)) { - // Order independent. - return seriesKey.sort().join(','); - } + if (isArray(seriesKey)) { + // Order independent. + return seriesKey.sort().join(','); + } - return seriesKey; + return seriesKey; } function getDivideShapeFromData(data) { - if (data.hostModel) { - return data.hostModel.getModel('universalTransition').get('divideShape'); - } + if (data.hostModel) { + return data.hostModel.getModel('universalTransition').get('divideShape'); + } } function findTransitionSeriesBatches(globalStore, params) { - var updateBatches = createHashMap(); - var oldDataMap = createHashMap(); // Map that only store key in array seriesKey. - // Which is used to query the old data when transition from one to multiple series. - - var oldDataMapForSplit = createHashMap(); - each(globalStore.oldSeries, function (series, idx) { - var oldData = globalStore.oldData[idx]; - var transitionKey = getSeriesTransitionKey(series); - var transitionKeyStr = convertArraySeriesKeyToString(transitionKey); - oldDataMap.set(transitionKeyStr, oldData); - - if (isArray(transitionKey)) { - // Same key can't in different array seriesKey. - each(transitionKey, function (key) { - oldDataMapForSplit.set(key, { - data: oldData, - key: transitionKeyStr - }); - }); - } - }); + var updateBatches = createHashMap(); + var oldDataMap = createHashMap(); // Map that only store key in array seriesKey. + // Which is used to query the old data when transition from one to multiple series. + + var oldDataMapForSplit = createHashMap(); + each(globalStore.oldSeries, function (series, idx) { + var oldData = globalStore.oldData[idx]; + var transitionKey = getSeriesTransitionKey(series); + var transitionKeyStr = convertArraySeriesKeyToString(transitionKey); + oldDataMap.set(transitionKeyStr, oldData); + + if (isArray(transitionKey)) { + // Same key can't in different array seriesKey. + each(transitionKey, function (key) { + oldDataMapForSplit.set(key, { + data: oldData, + key: transitionKeyStr + }); + }); + } + }); - function checkTransitionSeriesKeyDuplicated(transitionKeyStr) { - if (updateBatches.get(transitionKeyStr)) { - warn("Duplicated seriesKey in universalTransition " + transitionKeyStr); - } + function checkTransitionSeriesKeyDuplicated(transitionKeyStr) { + if (updateBatches.get(transitionKeyStr)) { + warn("Duplicated seriesKey in universalTransition " + transitionKeyStr); } + } - each(params.updatedSeries, function (series) { - if (series.isUniversalTransitionEnabled() && series.isAnimationEnabled()) { - var newData = series.getData(); - var transitionKey = getSeriesTransitionKey(series); - var transitionKeyStr = convertArraySeriesKeyToString(transitionKey); // Only transition between series with same id. + each(params.updatedSeries, function (series) { + if (series.isUniversalTransitionEnabled() && series.isAnimationEnabled()) { + var newData = series.getData(); + var transitionKey = getSeriesTransitionKey(series); + var transitionKeyStr = convertArraySeriesKeyToString(transitionKey); // Only transition between series with same id. - var oldData = oldDataMap.get(transitionKeyStr); // string transition key is the best match. + var oldData = oldDataMap.get(transitionKeyStr); // string transition key is the best match. - if (oldData) { - if ("development" !== 'production') { - checkTransitionSeriesKeyDuplicated(transitionKeyStr); - } // TODO check if data is same? - - - updateBatches.set(transitionKeyStr, { - oldSeries: [{ - divide: getDivideShapeFromData(oldData), - data: oldData - }], - newSeries: [{ - divide: getDivideShapeFromData(newData), - data: newData - }] - }); - } else { - // Transition from multiple series. - if (isArray(transitionKey)) { - if ("development" !== 'production') { - checkTransitionSeriesKeyDuplicated(transitionKeyStr); - } + if (oldData) { + if ("development" !== 'production') { + checkTransitionSeriesKeyDuplicated(transitionKeyStr); + } // TODO check if data is same? + + + updateBatches.set(transitionKeyStr, { + oldSeries: [{ + divide: getDivideShapeFromData(oldData), + data: oldData + }], + newSeries: [{ + divide: getDivideShapeFromData(newData), + data: newData + }] + }); + } else { + // Transition from multiple series. + if (isArray(transitionKey)) { + if ("development" !== 'production') { + checkTransitionSeriesKeyDuplicated(transitionKeyStr); + } - var oldSeries_1 = []; - each(transitionKey, function (key) { - var oldData = oldDataMap.get(key); + var oldSeries_1 = []; + each(transitionKey, function (key) { + var oldData = oldDataMap.get(key); - if (oldData) { - oldSeries_1.push({ - divide: getDivideShapeFromData(oldData), - data: oldData - }); - } - }); + if (oldData) { + oldSeries_1.push({ + divide: getDivideShapeFromData(oldData), + data: oldData + }); + } + }); + + if (oldSeries_1.length) { + updateBatches.set(transitionKeyStr, { + oldSeries: oldSeries_1, + newSeries: [{ + data: newData, + divide: getDivideShapeFromData(newData) + }] + }); + } + } else { + // Try transition to multiple series. + var oldData_1 = oldDataMapForSplit.get(transitionKey); - if (oldSeries_1.length) { - updateBatches.set(transitionKeyStr, { - oldSeries: oldSeries_1, - newSeries: [{ - data: newData, - divide: getDivideShapeFromData(newData) - }] - }); - } - } else { - // Try transition to multiple series. - var oldData_1 = oldDataMapForSplit.get(transitionKey); - - if (oldData_1) { - var batch = updateBatches.get(oldData_1.key); - - if (!batch) { - batch = { - oldSeries: [{ - data: oldData_1.data, - divide: getDivideShapeFromData(oldData_1.data) - }], - newSeries: [] - }; - updateBatches.set(oldData_1.key, batch); - } + if (oldData_1) { + var batch = updateBatches.get(oldData_1.key); - batch.newSeries.push({ - data: newData, - divide: getDivideShapeFromData(newData) - }); - } - } + if (!batch) { + batch = { + oldSeries: [{ + data: oldData_1.data, + divide: getDivideShapeFromData(oldData_1.data) + }], + newSeries: [] + }; + updateBatches.set(oldData_1.key, batch); } + + batch.newSeries.push({ + data: newData, + divide: getDivideShapeFromData(newData) + }); + } } - }); - return updateBatches; + } + } + }); + return updateBatches; } function querySeries(series, finder) { - for (var i = 0; i < series.length; i++) { - var found = finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id; + for (var i = 0; i < series.length; i++) { + var found = finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id; - if (found) { - return i; - } + if (found) { + return i; } + } } function transitionSeriesFromOpt(transitionOpt, globalStore, params, api) { - var from = []; - var to = []; - each(normalizeToArray(transitionOpt.from), function (finder) { - var idx = querySeries(globalStore.oldSeries, finder); - - if (idx >= 0) { - from.push({ - data: globalStore.oldData[idx], - // TODO can specify divideShape in transition. - divide: getDivideShapeFromData(globalStore.oldData[idx]), - dim: finder.dimension - }); - } - }); - each(normalizeToArray(transitionOpt.to), function (finder) { - var idx = querySeries(params.updatedSeries, finder); - - if (idx >= 0) { - var data = params.updatedSeries[idx].getData(); - to.push({ - data: data, - divide: getDivideShapeFromData(data), - dim: finder.dimension - }); - } - }); - - if (from.length > 0 && to.length > 0) { - transitionBetween(from, to, api); + var from = []; + var to = []; + each(normalizeToArray(transitionOpt.from), function (finder) { + var idx = querySeries(globalStore.oldSeries, finder); + + if (idx >= 0) { + from.push({ + data: globalStore.oldData[idx], + // TODO can specify divideShape in transition. + divide: getDivideShapeFromData(globalStore.oldData[idx]), + dim: finder.dimension + }); + } + }); + each(normalizeToArray(transitionOpt.to), function (finder) { + var idx = querySeries(params.updatedSeries, finder); + + if (idx >= 0) { + var data = params.updatedSeries[idx].getData(); + to.push({ + data: data, + divide: getDivideShapeFromData(data), + dim: finder.dimension + }); } + }); + + if (from.length > 0 && to.length > 0) { + transitionBetween(from, to, api); + } } function installUniversalTransition(registers) { - registers.registerUpdateLifecycle('series:beforeupdate', function (ecMOdel, api, params) { - each(normalizeToArray(params.seriesTransition), function (transOpt) { - each(normalizeToArray(transOpt.to), function (finder) { - var series = params.updatedSeries; - - for (var i = 0; i < series.length; i++) { - if (finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id) { - series[i][SERIES_UNIVERSAL_TRANSITION_PROP] = true; - } - } - }); - }); - }); - registers.registerUpdateLifecycle('series:transition', function (ecModel, api, params) { - // TODO api provide an namespace that can save stuff per instance - var globalStore = getUniversalTransitionGlobalStore(api); // TODO multiple to multiple series. - - if (globalStore.oldSeries && params.updatedSeries && params.optionChanged) { - // Use give transition config if its' give; - var transitionOpt = params.seriesTransition; + registers.registerUpdateLifecycle('series:beforeupdate', function (ecMOdel, api, params) { + each(normalizeToArray(params.seriesTransition), function (transOpt) { + each(normalizeToArray(transOpt.to), function (finder) { + var series = params.updatedSeries; - if (transitionOpt) { - each(normalizeToArray(transitionOpt), function (opt) { - transitionSeriesFromOpt(opt, globalStore, params, api); - }); - } else { - // Else guess from series based on transition series key. - var updateBatches_1 = findTransitionSeriesBatches(globalStore, params); - each(updateBatches_1.keys(), function (key) { - var batch = updateBatches_1.get(key); - transitionBetween(batch.oldSeries, batch.newSeries, api); - }); - } // Reset + for (var i = 0; i < series.length; i++) { + if (finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id) { + series[i][SERIES_UNIVERSAL_TRANSITION_PROP] = true; + } + } + }); + }); + }); + registers.registerUpdateLifecycle('series:transition', function (ecModel, api, params) { + // TODO api provide an namespace that can save stuff per instance + var globalStore = getUniversalTransitionGlobalStore(api); // TODO multiple to multiple series. + + if (globalStore.oldSeries && params.updatedSeries && params.optionChanged) { + // Use give transition config if its' give; + var transitionOpt = params.seriesTransition; + + if (transitionOpt) { + each(normalizeToArray(transitionOpt), function (opt) { + transitionSeriesFromOpt(opt, globalStore, params, api); + }); + } else { + // Else guess from series based on transition series key. + var updateBatches_1 = findTransitionSeriesBatches(globalStore, params); + each(updateBatches_1.keys(), function (key) { + var batch = updateBatches_1.get(key); + transitionBetween(batch.oldSeries, batch.newSeries, api); + }); + } // Reset - each(params.updatedSeries, function (series) { - // Reset; - if (series[SERIES_UNIVERSAL_TRANSITION_PROP]) { - series[SERIES_UNIVERSAL_TRANSITION_PROP] = false; - } - }); - } // Save all series of current update. Not only the updated one. + each(params.updatedSeries, function (series) { + // Reset; + if (series[SERIES_UNIVERSAL_TRANSITION_PROP]) { + series[SERIES_UNIVERSAL_TRANSITION_PROP] = false; + } + }); + } // Save all series of current update. Not only the updated one. - var allSeries = ecModel.getSeries(); - var savedSeries = globalStore.oldSeries = []; - var savedData = globalStore.oldData = []; + var allSeries = ecModel.getSeries(); + var savedSeries = globalStore.oldSeries = []; + var savedData = globalStore.oldData = []; - for (var i = 0; i < allSeries.length; i++) { - var data = allSeries[i].getData(); // Only save the data that can have transition. - // Avoid large data costing too much extra memory + for (var i = 0; i < allSeries.length; i++) { + var data = allSeries[i].getData(); // Only save the data that can have transition. + // Avoid large data costing too much extra memory - if (data.count() < DATA_COUNT_THRESHOLD) { - savedSeries.push(allSeries[i]); - savedData.push(data); - } - } - }); + if (data.count() < DATA_COUNT_THRESHOLD) { + savedSeries.push(allSeries[i]); + savedData.push(data); + } + } + }); } // Render engines @@ -95166,8 +95166,7 @@ }))); -//# sourceMappingURL=echarts.js.map layui.define('echartsTheme', function(exports) { - echarts.registerTheme('walden', layui.echartsTheme); - exports('echarts', echarts); + echarts.registerTheme('walden', layui.echartsTheme); + exports('echarts', echarts); }); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/echartsTheme.js b/src/main/resources/static/component/pear/module/echartsTheme.js index a11e5f65..2cf0bfae 100644 --- a/src/main/resources/static/component/pear/module/echartsTheme.js +++ b/src/main/resources/static/component/pear/module/echartsTheme.js @@ -1,4 +1,4 @@ -layui.define(function (exports) { +layui.define(function(exports) { exports('echartsTheme', { "color": [ @@ -21,14 +21,10 @@ layui.define(function (exports) { }, "line": { "itemStyle": { - "normal": { "borderWidth": "3" - } }, "lineStyle": { - "normal": { "width": "4" - } }, "symbolSize": "10", "symbol": "emptyCircle", @@ -36,14 +32,10 @@ layui.define(function (exports) { }, "radar": { "itemStyle": { - "normal": { "borderWidth": "3" - } }, "lineStyle": { - "normal": { "width": "4" - } }, "symbolSize": "10", "symbol": "emptyCircle", @@ -51,11 +43,11 @@ layui.define(function (exports) { }, "bar": { "itemStyle": { - "normal": { "barBorderWidth": 0, "barBorderColor": "#ccc" - }, - "emphasis": { + }, + "emphasis": { + "itemStyle": { "barBorderWidth": 0, "barBorderColor": "#ccc" } @@ -63,11 +55,11 @@ layui.define(function (exports) { }, "pie": { "itemStyle": { - "normal": { "borderWidth": 0, "borderColor": "#ccc" - }, - "emphasis": { + }, + "emphasis": { + "itemStyle": { "borderWidth": 0, "borderColor": "#ccc" } @@ -75,11 +67,11 @@ layui.define(function (exports) { }, "scatter": { "itemStyle": { - "normal": { "borderWidth": 0, "borderColor": "#ccc" - }, - "emphasis": { + }, + "emphasis": { + "itemStyle": { "borderWidth": 0, "borderColor": "#ccc" } @@ -87,11 +79,12 @@ layui.define(function (exports) { }, "boxplot": { "itemStyle": { - "normal": { - "borderWidth": 0, - "borderColor": "#ccc" - }, - "emphasis": { + "borderWidth": 0, + "borderColor": "#ccc" + + }, + "emphasis": { + "itemStyle": { "borderWidth": 0, "borderColor": "#ccc" } @@ -99,11 +92,11 @@ layui.define(function (exports) { }, "parallel": { "itemStyle": { - "normal": { "borderWidth": 0, "borderColor": "#ccc" - }, - "emphasis": { + }, + "emphasis": { + "itemStyle": { "borderWidth": 0, "borderColor": "#ccc" } @@ -111,11 +104,11 @@ layui.define(function (exports) { }, "sankey": { "itemStyle": { - "normal": { - "borderWidth": 0, - "borderColor": "#ccc" - }, - "emphasis": { + "borderWidth": 0, + "borderColor": "#ccc" + }, + "emphasis": { + "itemStyle": { "borderWidth": 0, "borderColor": "#ccc" } @@ -123,11 +116,11 @@ layui.define(function (exports) { }, "funnel": { "itemStyle": { - "normal": { - "borderWidth": 0, - "borderColor": "#ccc" - }, - "emphasis": { + "borderWidth": 0, + "borderColor": "#ccc" + }, + "emphasis": { + "itemStyle": { "borderWidth": 0, "borderColor": "#ccc" } @@ -135,11 +128,11 @@ layui.define(function (exports) { }, "gauge": { "itemStyle": { - "normal": { - "borderWidth": 0, - "borderColor": "#ccc" - }, - "emphasis": { + "borderWidth": 0, + "borderColor": "#ccc" + }, + "emphasis": { + "itemStyle": { "borderWidth": 0, "borderColor": "#ccc" } @@ -147,27 +140,21 @@ layui.define(function (exports) { }, "candlestick": { "itemStyle": { - "normal": { - "color": "#e6a0d2", - "color0": "transparent", - "borderColor": "#e6a0d2", - "borderColor0": "#3fb1e3", - "borderWidth": "2" - } + "color": "#e6a0d2", + "color0": "transparent", + "borderColor": "#e6a0d2", + "borderColor0": "#3fb1e3", + "borderWidth": "2" } }, "graph": { "itemStyle": { - "normal": { - "borderWidth": 0, - "borderColor": "#ccc" - } + "borderWidth": 0, + "borderColor": "#ccc" }, "lineStyle": { - "normal": { "width": "1", "color": "#cccccc" - } }, "symbolSize": "10", "symbol": "emptyCircle", @@ -180,63 +167,47 @@ layui.define(function (exports) { "#c4ebad", "#96dee8" ], - "label": { - "normal": { - "textStyle": { - "color": "#ffffff" - } - } + "label": { + "color": "#ffffff" } }, "map": { "itemStyle": { - "normal": { - "areaColor": "#eeeeee", - "borderColor": "#aaaaaa", - "borderWidth": 0.5 - }, - "emphasis": { + "areaColor": "#eeeeee", + "borderColor": "#aaaaaa", + "borderWidth": 0.5 + }, + "label": { + "color": "#ffffff" + }, + "emphasis": { + "itemStyle": { "areaColor": "rgba(63,177,227,0.25)", "borderColor": "#3fb1e3", "borderWidth": 1 - } - }, - "label": { - "normal": { - "textStyle": { - "color": "#ffffff" - } }, - "emphasis": { - "textStyle": { - "color": "rgb(63,177,227)" - } + "label":{ + "color": "rgb(63,177,227)" } } }, "geo": { "itemStyle": { - "normal": { - "areaColor": "#eeeeee", - "borderColor": "#aaaaaa", - "borderWidth": 0.5 - }, - "emphasis": { + "areaColor": "#eeeeee", + "borderColor": "#aaaaaa", + "borderWidth": 0.5 + }, + "label": { + "color": "#ffffff" + }, + "emphasis": { + "itemStyle": { "areaColor": "rgba(63,177,227,0.25)", "borderColor": "#3fb1e3", "borderWidth": 1 - } - }, - "label": { - "normal": { - "textStyle": { - "color": "#ffffff" - } }, - "emphasis": { - "textStyle": { - "color": "rgb(63,177,227)" - } + "label":{ + "color": "rgb(63,177,227)" } } }, @@ -255,9 +226,9 @@ layui.define(function (exports) { }, "axisLabel": { "show": true, - "textStyle": { - "color": "#999999" - } + + "color": "#999999" + }, "splitLine": { "show": true, @@ -291,10 +262,9 @@ layui.define(function (exports) { } }, "axisLabel": { - "show": true, - "textStyle": { - "color": "#999999" - } + "show": true, + "color": "#999999" + }, "splitLine": { "show": true, @@ -328,10 +298,9 @@ layui.define(function (exports) { } }, "axisLabel": { - "show": true, - "textStyle": { - "color": "#999999" - } + "show": true, + "color": "#999999" + }, "splitLine": { "show": true, @@ -366,9 +335,9 @@ layui.define(function (exports) { }, "axisLabel": { "show": true, - "textStyle": { - "color": "#999999" - } + + "color": "#999999" + }, "splitLine": { "show": true, @@ -390,10 +359,10 @@ layui.define(function (exports) { }, "toolbox": { "iconStyle": { - "normal": { - "borderColor": "#999999" - }, - "emphasis": { + "borderColor": "#999999" + }, + "emphasis": { + "iconStyle": { "borderColor": "#666666" } } @@ -420,41 +389,34 @@ layui.define(function (exports) { "color": "#626c91", "width": 1 }, - "itemStyle": { - "normal": { - "color": "#626c91", - "borderWidth": 1 - }, - "emphasis": { - "color": "#626c91" - } - }, - "controlStyle": { - "normal": { - "color": "#626c91", - "borderColor": "#626c91", - "borderWidth": 0.5 - }, - "emphasis": { - "color": "#626c91", - "borderColor": "#626c91", - "borderWidth": 0.5 - } + "itemStyle": { + "color": "#626c91", + "borderWidth": 1 + + }, + "controlStyle": { + "color": "#626c91", + "borderColor": "#626c91", + "borderWidth": 0.5 }, "checkpointStyle": { "color": "#3fb1e3", "borderColor": "rgba(63,177,227,0.15)" }, - "label": { - "normal": { - "textStyle": { - "color": "#626c91" - } + "label": { + "color": "#626c91" + }, + "emphasis": { + "itemStyle": { + "color": "#626c91" }, - "emphasis": { - "textStyle": { - "color": "#626c91" - } + "controlStyle":{ + "color": "#626c91", + "borderColor": "#626c91", + "borderWidth": 0.5 + }, + "label":{ + "color": "#626c91" } } }, @@ -475,16 +437,12 @@ layui.define(function (exports) { } }, "markPoint": { - "label": { - "normal": { - "textStyle": { - "color": "#ffffff" - } - }, - "emphasis": { - "textStyle": { - "color": "#ffffff" - } + "label": { + "color": "#ffffff" + }, + "emphasis": { + "label": { + "color": "#ffffff" } } } diff --git a/src/main/resources/static/component/pear/module/frame.js b/src/main/resources/static/component/pear/module/frame.js index 98eaf9c6..5ee6841c 100644 --- a/src/main/resources/static/component/pear/module/frame.js +++ b/src/main/resources/static/component/pear/module/frame.js @@ -1,87 +1,71 @@ -layui.define(['jquery', 'element'], function (exports) { - "use strict"; +layui.define(['jquery', 'element'], function(exports) { + "use strict"; - var $ = layui.jquery; + var $ = layui.jquery; - var pearFrame = function (opt) { - this.option = opt; - }; + var frame = function(opt) { + this.option = opt; + }; - pearFrame.prototype.render = function (opt) { - var option = { - elem: opt.elem, - url: opt.url, - title: opt.title, - width: opt.width, - height: opt.height, - done: opt.done ? opt.done : function () { console.log("菜单渲染成功"); } - } - createFrameHTML(option); - $("#" + option.elem).width(option.width); - $("#" + option.elem).height(option.height); - return new pearFrame(option); - } + frame.prototype.render = function(opt) { + var option = { + elem: opt.elem, + url: opt.url, + title: opt.title, + width: opt.width, + height: opt.height, + done: opt.done ? opt.done : function() { + console.log("菜单渲染成功"); + } + } + renderContent(option); + $("#" + option.elem).width(option.width); + $("#" + option.elem).height(option.height); + return new frame(option); + } - pearFrame.prototype.changePage = function (url, loading) { - var $frameLoad = $("#" + this.option.elem).find(".pear-frame-loading"); + frame.prototype.changePage = function(url, loading) { + var $frameLoad = $("#" + this.option.elem).find(".pear-frame-loading"); + var $frame = $("#" + this.option.elem + " iframe"); + $frame.attr("src", url); + renderContentLoading($frame, $frameLoad, loading); + } - /** - * 非视图模式下,切换侧栏导航上条目时,会产生 loading.css 非 function错误 - * frame.js?v=3.9.4:28 Uncaught TypeError: loading.css is not a function - at pearFrame.changePage (frame.js?v=3.9.4:28:12) - at admin.js?v=3.9.4:165:17 - at HTMLAnchorElement. (menu.js?v=3.9.4:122:4) - at HTMLBodyElement.dispatch (layui.js:2:22295) - at HTMLBodyElement.m.handle (layui.js:2:18997) - * - */ - if (loading && typeof loading.css ==='function') { - loading.css({ display: 'block' }); - } - $("#" + this.option.elem + " iframe").attr("src", url); - if (loading) { - setTimeout(function () { - $frameLoad.fadeOut(500); - }, 800) - } - } + frame.prototype.changePageByElement = function(elem, url, title, loading) { + var $frameLoad = $("#" + elem).find(".pear-frame-loading"); + var $frame = $("#" + elem + " iframe"); + $frame.attr("src", url); + $("#" + elem + " .title").html(title); + renderContentLoading($frame, $frameLoad, loading); + } - pearFrame.prototype.changePageByElement = function (elem, url, title, loading) { - var $frameLoad = $("#" + elem).find(".pear-frame-loading"); - if (loading) { - $frameLoad.css({ display: 'block' }); - } - $("#" + elem + " iframe").attr("src", url); - $("#" + elem + " .title").html(title); - if (loading) { - setTimeout(function () { - $frameLoad.css({ display: 'none' }); - }, 400) - } - } + frame.prototype.refresh = function(loading) { + var $frameLoad = $("#" + this.option.elem).find(".pear-frame-loading"); + var $frame = $("#" + this.option.elem).find("iframe"); + $frame.attr("src", $frame.attr("src")); + renderContentLoading($frame, $frameLoad, loading); + } - pearFrame.prototype.refresh = function (time) { - if (time != false) { - var loading = $("#" + this.option.elem).find(".pear-frame-loading"); - loading.css({ display: 'block' }); - if (time != 0) { - setTimeout(function () { - loading.fadeOut(500); - }, time) - } - } - $("#" + this.option.elem).find("iframe")[0].contentWindow.location.reload(true); - } + function renderContent(option) { + var iframe = ``; + var loading = `
              +
              + +
              +
              `; + $("#" + option.elem).html("
              " + iframe + loading + "
              "); + } + + function renderContentLoading (iframeEl, loadingEl, isLoading) { + if (isLoading) { + loadingEl.css({ + display: 'block' + }); + $(iframeEl).on('load', function() { + loadingEl.fadeOut(1000); + }) + } + } - function createFrameHTML(option) { - var iframe = ""; - var loading = '
              ' + - '
              ' + - '' + - '
              ' + - '
              '; - $("#" + option.elem).html("
              " + iframe + loading + "
              "); - } - - exports('frame', new pearFrame()); -}); \ No newline at end of file + exports('frame', new frame()); +}); diff --git a/src/main/resources/static/component/pear/module/fullscreen.js b/src/main/resources/static/component/pear/module/fullscreen.js new file mode 100644 index 00000000..a0f3b4dd --- /dev/null +++ b/src/main/resources/static/component/pear/module/fullscreen.js @@ -0,0 +1,54 @@ +layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'menu', 'frame', 'theme', 'convert'], + function(exports) { + "use strict"; + var $ = layui.jquery; + var defer = $.Deferred(); + var fullScreen = new function() { + this.func = null; + this.onFullchange = function(func){ + this.func = func; + var evts = ['fullscreenchange','webkitfullscreenchange','mozfullscreenchange','MSFullscreenChange']; + for(var i=0;i'; + if (isFontClass || isCustom) { + oriIcon = ''; } else { oriIcon += ORIGINAL_ELEM_VALUE; } @@ -200,9 +211,10 @@ layui.define(['laypage', 'form'], function(exports) { // 每个图标dom var icon = '
              '; - if (isFontClass) { - icon += ''; - } else { + if (isFontClass || isCustom) + { + icon += ''; + }else{ icon += '' + obj.replace('amp;', '') + ''; } icon += '
              '; @@ -312,13 +324,14 @@ layui.define(['laypage', 'form'], function(exports) { check: function() { var item = '#' + PICKER_BODY + ' .layui-iconpicker-icon-item'; a.event('click', item, function(e) { - var el = $(e.currentTarget).find('.layui-icon'), + var el = $(e.currentTarget).find('.' + ICON_prefix), icon = ''; - if (isFontClass) { + console.log( el.attr('class')); + if (isFontClass || isCustom) { var clsArr = el.attr('class').split(/[\s\n]/), cls = clsArr[1], icon = cls; - $('#' + TITLE_ID).find('.layui-iconpicker-item .layui-icon').html( + $('#' + TITLE_ID).find('.layui-iconpicker-item .' + ICON_prefix).html( '').attr('class', clsArr.join(' ')); } else { var cls = el.html(), @@ -354,7 +367,6 @@ layui.define(['laypage', 'form'], function(exports) { $(BODY).on(evt, el, fn); } }; - var common = { /** * 加载样式表 @@ -372,95 +384,129 @@ layui.define(['laypage', 'form'], function(exports) { */ getData: { fontClass: function() { - var arr = ["layui-icon-rate-half", "layui-icon-rate", "layui-icon-rate-solid", + var arr = [ + "layui-icon-github", "layui-icon-moon", "layui-icon-error", + "layui-icon-success", "layui-icon-question", "layui-icon-lock", + "layui-icon-eye", "layui-icon-eye-invisible", "layui-icon-clear", + "layui-icon-backspace", "layui-icon-disabled", "layui-icon-tips-fill", + "layui-icon-test", "layui-icon-music", "layui-icon-chrome", + "layui-icon-firefox", "layui-icon-edge", "layui-icon-ie", + "layui-icon-heart-fill", "layui-icon-heart", "layui-icon-light", + "layui-icon-time", "layui-icon-bluetooth", "layui-icon-at", + "layui-icon-mute", "layui-icon-mike", "layui-icon-key", + "layui-icon-gift", "layui-icon-email", "layui-icon-rss", + "layui-icon-wifi", "layui-icon-logout", "layui-icon-android", + "layui-icon-ios", "layui-icon-windows", "layui-icon-transfer", + "layui-icon-service", "layui-icon-subtraction", "layui-icon-addition", + "layui-icon-slider", "layui-icon-print", "layui-icon-export", + "layui-icon-cols", "layui-icon-screen-restore", "layui-icon-screen-full", + "layui-icon-rate-half", "layui-icon-rate", "layui-icon-rate-solid", "layui-icon-cellphone", "layui-icon-vercode", "layui-icon-login-wechat", "layui-icon-login-qq", "layui-icon-login-weibo", "layui-icon-password", "layui-icon-username", "layui-icon-refresh-3", "layui-icon-auz", - "layui-icon-spread-left", "layui-icon-shrink-right", - "layui-icon-snowflake", "layui-icon-tips", "layui-icon-note", - "layui-icon-home", "layui-icon-senior", "layui-icon-refresh", - "layui-icon-refresh-1", "layui-icon-flag", "layui-icon-theme", - "layui-icon-notice", "layui-icon-website", "layui-icon-console", - "layui-icon-face-surprised", "layui-icon-set", "layui-icon-template-1", - "layui-icon-app", "layui-icon-template", "layui-icon-praise", - "layui-icon-tread", "layui-icon-male", "layui-icon-female", - "layui-icon-camera", "layui-icon-camera-fill", "layui-icon-more", - "layui-icon-more-vertical", "layui-icon-rmb", "layui-icon-dollar", - "layui-icon-diamond", "layui-icon-fire", "layui-icon-return", - "layui-icon-location", "layui-icon-read", "layui-icon-survey", - "layui-icon-face-smile", "layui-icon-face-cry", - "layui-icon-cart-simple", "layui-icon-cart", "layui-icon-next", - "layui-icon-prev", "layui-icon-upload-drag", "layui-icon-upload", - "layui-icon-download-circle", "layui-icon-component", + "layui-icon-spread-left", "layui-icon-shrink-right", "layui-icon-snowflake", + "layui-icon-tips", "layui-icon-note", "layui-icon-home", + "layui-icon-senior", "layui-icon-refresh", "layui-icon-refresh-1", + "layui-icon-flag", "layui-icon-theme", "layui-icon-notice", + "layui-icon-website", "layui-icon-console", "layui-icon-face-surprised", + "layui-icon-set", "layui-icon-template-1", "layui-icon-app", + "layui-icon-template", "layui-icon-praise", "layui-icon-tread", + "layui-icon-male", "layui-icon-female", "layui-icon-camera", + "layui-icon-camera-fill", "layui-icon-more", "layui-icon-more-vertical", + "layui-icon-rmb", "layui-icon-dollar", "layui-icon-diamond", + "layui-icon-fire", "layui-icon-return", "layui-icon-location", + "layui-icon-read", "layui-icon-survey", "layui-icon-face-smile", + "layui-icon-face-cry", "layui-icon-cart-simple", "layui-icon-cart", + "layui-icon-next", "layui-icon-prev", "layui-icon-upload-drag", + "layui-icon-upload", "layui-icon-download-circle", "layui-icon-component", "layui-icon-file-b", "layui-icon-user", "layui-icon-find-fill", "layui-icon-loading", "layui-icon-loading-1", "layui-icon-add-1", "layui-icon-play", "layui-icon-pause", "layui-icon-headset", "layui-icon-video", "layui-icon-voice", "layui-icon-speaker", - "layui-icon-fonts-del", "layui-icon-fonts-code", - "layui-icon-fonts-html", "layui-icon-fonts-strong", "layui-icon-unlink", - "layui-icon-picture", "layui-icon-link", "layui-icon-face-smile-b", - "layui-icon-align-left", "layui-icon-align-right", - "layui-icon-align-center", "layui-icon-fonts-u", "layui-icon-fonts-i", - "layui-icon-tabs", "layui-icon-radio", "layui-icon-circle", - "layui-icon-edit", "layui-icon-share", "layui-icon-delete", - "layui-icon-form", "layui-icon-cellphone-fine", "layui-icon-dialogue", - "layui-icon-fonts-clear", "layui-icon-layer", "layui-icon-date", - "layui-icon-water", "layui-icon-code-circle", "layui-icon-carousel", - "layui-icon-prev-circle", "layui-icon-layouts", "layui-icon-util", - "layui-icon-templeate-1", "layui-icon-upload-circle", "layui-icon-tree", - "layui-icon-table", "layui-icon-chart", "layui-icon-chart-screen", - "layui-icon-engine", "layui-icon-triangle-d", "layui-icon-triangle-r", - "layui-icon-file", "layui-icon-set-sm", "layui-icon-add-circle", - "layui-icon-404", "layui-icon-about", "layui-icon-up", - "layui-icon-down", "layui-icon-left", "layui-icon-right", - "layui-icon-circle-dot", "layui-icon-search", "layui-icon-set-fill", - "layui-icon-group", "layui-icon-friends", "layui-icon-reply-fill", - "layui-icon-menu-fill", "layui-icon-log", "layui-icon-picture-fine", - "layui-icon-face-smile-fine", "layui-icon-list", "layui-icon-release", - "layui-icon-ok", "layui-icon-help", "layui-icon-chat", "layui-icon-top", + "layui-icon-fonts-del", "layui-icon-fonts-code", "layui-icon-fonts-html", + "layui-icon-fonts-strong", "layui-icon-unlink", "layui-icon-picture", + "layui-icon-link", "layui-icon-face-smile-b", "layui-icon-align-left", + "layui-icon-align-right", "layui-icon-align-center", "layui-icon-fonts-u", + "layui-icon-fonts-i", "layui-icon-tabs", "layui-icon-radio", + "layui-icon-circle", "layui-icon-edit", "layui-icon-share", + "layui-icon-delete", "layui-icon-form", "layui-icon-cellphone-fine", + "layui-icon-dialogue", "layui-icon-fonts-clear", "layui-icon-layer", + "layui-icon-date", "layui-icon-water", "layui-icon-code-circle", + "layui-icon-carousel", "layui-icon-prev-circle", "layui-icon-layouts", + "layui-icon-util", "layui-icon-templeate-1", "layui-icon-upload-circle", + "layui-icon-tree", "layui-icon-table", "layui-icon-chart", + "layui-icon-chart-screen", "layui-icon-engine", "layui-icon-triangle-d", + "layui-icon-triangle-r", "layui-icon-file", "layui-icon-set-sm", + "layui-icon-reduce-circle", "layui-icon-add-circle", "layui-icon-404", + "layui-icon-about", "layui-icon-up", "layui-icon-down", + "layui-icon-left", "layui-icon-right", "layui-icon-circle-dot", + "layui-icon-search", "layui-icon-set-fill", "layui-icon-group", + "layui-icon-friends", "layui-icon-reply-fill", "layui-icon-menu-fill", + "layui-icon-log", "layui-icon-picture-fine", "layui-icon-face-smile-fine", + "layui-icon-list", "layui-icon-release", "layui-icon-ok", + "layui-icon-help", "layui-icon-chat", "layui-icon-top", "layui-icon-star", "layui-icon-star-fill", "layui-icon-close-fill", - "layui-icon-close", "layui-icon-ok-circle", "layui-icon-add-circle-fine" + "layui-icon-close", "layui-icon-ok-circle", "layui-icon-add-circle-fine", ]; return arr; }, unicode: function() { - return ["&#xe6c9;", "&#xe67b;", "&#xe67a;", "&#xe678;", - "&#xe679;", "&#xe677;", "&#xe676;", "&#xe675;", - "&#xe673;", "&#xe66f;", "&#xe9aa;", "&#xe672;", - "&#xe66b;", "&#xe668;", "&#xe6b1;", "&#xe702;", - "&#xe66e;", "&#xe68e;", "&#xe674;", "&#xe669;", - "&#xe666;", "&#xe66c;", "&#xe66a;", "&#xe667;", - "&#xe7ae;", "&#xe665;", "&#xe664;", "&#xe716;", - "&#xe656;", "&#xe653;", "&#xe663;", "&#xe6c6;", - "&#xe6c5;", "&#xe662;", "&#xe661;", "&#xe660;", - "&#xe65d;", "&#xe65f;", "&#xe671;", "&#xe65e;", - "&#xe659;", "&#xe735;", "&#xe756;", "&#xe65c;", - "&#xe715;", "&#xe705;", "&#xe6b2;", "&#xe6af;", - "&#xe69c;", "&#xe698;", "&#xe657;", "&#xe65b;", - "&#xe65a;", "&#xe681;", "&#xe67c;", "&#xe601;", - "&#xe857;", "&#xe655;", "&#xe770;", "&#xe670;", - "&#xe63d;", "&#xe63e;", "&#xe654;", "&#xe652;", - "&#xe651;", "&#xe6fc;", "&#xe6ed;", "&#xe688;", - "&#xe645;", "&#xe64f;", "&#xe64e;", "&#xe64b;", - "&#xe62b;", "&#xe64d;", "&#xe64a;", "&#xe64c;", - "&#xe650;", "&#xe649;", "&#xe648;", "&#xe647;", - "&#xe646;", "&#xe644;", "&#xe62a;", "&#xe643;", - "&#xe63f;", "&#xe642;", "&#xe641;", "&#xe640;", - "&#xe63c;", "&#xe63b;", "&#xe63a;", "&#xe639;", - "&#xe638;", "&#xe637;", "&#xe636;", "&#xe635;", - "&#xe634;", "&#xe633;", "&#xe632;", "&#xe631;", - "&#xe630;", "&#xe62f;", "&#xe62e;", "&#xe62d;", - "&#xe62c;", "&#xe629;", "&#xe628;", "&#xe625;", - "&#xe623;", "&#xe621;", "&#xe620;", "&#xe61f;", - "&#xe61c;", "&#xe60b;", "&#xe619;", "&#xe61a;", - "&#xe603;", "&#xe602;", "&#xe617;", "&#xe615;", - "&#xe614;", "&#xe613;", "&#xe612;", "&#xe611;", - "&#xe60f;", "&#xe60e;", "&#xe60d;", "&#xe60c;", - "&#xe60a;", "&#xe609;", "&#xe605;", "&#xe607;", - "&#xe606;", "&#xe604;", "&#xe600;", "&#xe658;", - "&#x1007;", "&#x1006;", "&#x1005;", "&#xe608;" + return [ + "&#xe6a7;", "&#xe6c2;", "&#xe693;", "&#xe697;", "&#xe699;", "&#xe69a;", + "&#xe695;", "&#xe696;", "&#xe788;", "&#xe694;", "&#xe6cc;", "&#xeb2e;", + "&#xe692;", "&#xe690;", "&#xe68a;", "&#xe686;", "&#xe68b;", "&#xe7bb;", + "&#xe68f;", "&#xe68c;", "&#xe748;", "&#xe68d;", "&#xe689;", "&#xe687;", + "&#xe685;", "&#xe6dc;", "&#xe683;", "&#xe627;", "&#xe618;", "&#xe808;", + "&#xe7e0;", "&#xe682;", "&#xe684;", "&#xe680;", "&#xe67f;", "&#xe691;", + "&#xe626;", "&#xe67e;", "&#xe624;", "&#xe714;", "&#xe66d;", "&#xe67d;", + "&#xe610;", "&#xe758;", "&#xe622;", "&#xe6c9;", "&#xe67b;", "&#xe67a;", + "&#xe678;", "&#xe679;", "&#xe677;", "&#xe676;", "&#xe675;", "&#xe673;", + "&#xe66f;", "&#xe9aa;", "&#xe672;", "&#xe66b;", "&#xe668;", "&#xe6b1;", + "&#xe702;", "&#xe66e;", "&#xe68e;", "&#xe674;", "&#xe669;", "&#xe666;", + "&#xe66c;", "&#xe66a;", "&#xe667;", "&#xe7ae;", "&#xe665;", "&#xe664;", + "&#xe716;", "&#xe656;", "&#xe653;", "&#xe663;", "&#xe6c6;", "&#xe6c5;", + "&#xe662;", "&#xe661;", "&#xe660;", "&#xe65d;", "&#xe65f;", "&#xe671;", + "&#xe65e;", "&#xe659;", "&#xe735;", "&#xe756;", "&#xe65c;", "&#xe715;", + "&#xe705;", "&#xe6b2;", "&#xe6af;", "&#xe69c;", "&#xe698;", "&#xe657;", + "&#xe65b;", "&#xe65a;", "&#xe681;", "&#xe67c;", "&#xe601;", "&#xe857;", + "&#xe655;", "&#xe770;", "&#xe670;", "&#xe63d;", "&#xe63e;", "&#xe654;", + "&#xe652;", "&#xe651;", "&#xe6fc;", "&#xe6ed;", "&#xe688;", "&#xe645;", + "&#xe64f;", "&#xe64e;", "&#xe64b;", "&#xe62b;", "&#xe64d;", "&#xe64a;", + "&#xe64c;", "&#xe650;", "&#xe649;", "&#xe648;", "&#xe647;", "&#xe646;", + "&#xe644;", "&#xe62a;", "&#xe643;", "&#xe63f;", "&#xe642;", "&#xe641;", + "&#xe640;", "&#xe63c;", "&#xe63b;", "&#xe63a;", "&#xe639;", "&#xe638;", + "&#xe637;", "&#xe636;", "&#xe635;", "&#xe634;", "&#xe633;", "&#xe632;", + "&#xe631;", "&#xe630;", "&#xe62f;", "&#xe62e;", "&#xe62d;", "&#xe62c;", + "&#xe629;", "&#xe628;", "&#xe625;", "&#xe623;", "&#xe621;", "&#xe620;", + "&#xe616;", "&#xe61f;", "&#xe61c;", "&#xe60b;", "&#xe619;", "&#xe61a;", + "&#xe603;", "&#xe602;", "&#xe617;", "&#xe615;", "&#xe614;", "&#xe613;", + "&#xe612;", "&#xe611;", "&#xe60f;", "&#xe60e;", "&#xe60d;", "&#xe60c;", + "&#xe60a;", "&#xe609;", "&#xe605;", "&#xe607;", "&#xe606;", "&#xe604;", + "&#xe600;", "&#xe658;", "&#x1007;", "&#x1006;", "&#x1005;", "&#xe608;", ]; - } + }, + + }, + //通过异步获取自定义图标数据源 + ajaxData:function (url,prefix){ + var iconlist = []; + $.ajax({ + url: url, + type: 'get', + contentType: "application/x-www-form-urlencoded; charset=UTF-8", + async: false, + success: function (ret) { + var exp = eval("/"+prefix+"-(.*):/ig"); + var result; + while ((result = exp.exec(ret)) != null) { + iconlist.push(prefix + '-' + result[1]); + } + }, + error: function (xhr, textstatus, thrown) { + layer.msg('自定义图标接口有误'); + } + }); + return iconlist; } }; diff --git a/src/main/resources/static/component/pear/module/loading.js b/src/main/resources/static/component/pear/module/loading.js new file mode 100644 index 00000000..447bd38f --- /dev/null +++ b/src/main/resources/static/component/pear/module/loading.js @@ -0,0 +1,2091 @@ +layui.define(['table', 'jquery', 'element'], function (exports) { + "use strict"; + + var MOD_NAME = 'loading', + $ = layui.jquery, + element = layui.element; + var pearOper = new function () { + this.blockRemove = function(dom,time){ + Notiflix.Block.Remove(dom, time); + } + this.block = function(option){ + if(option.type==1){ + Notiflix.Block.Standard( + option.elem + ,option.msg); + } + else if(option.type==2){ + Notiflix.Block.Hourglass( + option.elem + ,option.msg); + } + else if(option.type==3){ + Notiflix.Block.Circle( + option.elem + ,option.msg); + } + else if(option.type==4){ + Notiflix.Block.Arrows( + option.elem + ,option.msg); + } + else if(option.type==5){ + Notiflix.Block.Dots( + option.elem + ,option.msg); + } + else if(option.type==6){ + Notiflix.Block.Pulse( + option.elem + ,option.msg); + } + } + this.report = function(option){ + if(option.type=="success"){ + Notiflix.Report.Success( + option.title, + option.message,'确认'); + }else if(option.type=="failure"){ + Notiflix.Report.Failure( + option.title, + option.message,'确认'); + }else if(option.type=="warning"){ + Notiflix.Report.Warning( + option.title, + option.message,'确认'); + }else if(option.type=="info"){ + Notiflix.Report.Info( + option.title, + option.message,'确认'); + } + } + + this.notice = function(option){ + Notiflix.Notify.Init({ + position:option.position?"right-top":option.position, + }); + if(option.type=="success"){ + + Notiflix.Notify.Success(option.title); + }else if(option.type=="failure"){ + + Notiflix.Notify.Failure(option.title); + }else if(option.type=="warning"){ + + Notiflix.Notify.Warning(option.title); + }else if(option.type=="info"){ + + Notiflix.Notify.Info(option.title); + } + } + + this.confirm = function(option){ + Notiflix.Confirm.Show( + option.title, + option.message, + '确认', + '取消', + option.success, + option.cancle + ); + } + + this.drawer = function(position,dom,distance){ + var _right = new mSlider({ + dom: dom, + direction: position, + distance:distance + }); + _right.open(); + } + + this.loadRemove = function(time){ + Notiflix.Loading.Remove(time); + } + + this.Load = function(type,message){ + if(type==1){ + Notiflix.Loading.Standard(message); + }else if(type==2){ + Notiflix.Loading.Hourglass(message); + }else if(type==3){ + Notiflix.Loading.Circle(message); + }else if(type==4){ + Notiflix.Loading.Dots(message); + }else if(type==5){ + Notiflix.Loading.Pulse(message); + } + } + + this.msg = function(option){ + if(option.type=="success"){ + + layer.msg(option.title,{icon:1,time:option.time},option.callback); + + }else if(option.type=="failure"){ + + layer.msg(option.title,{icon:2,time:option.time},option.callback); + + }else if(option.type=="warning"){ + + layer.msg(option.title,{icon:3,time:option.time},option.callback); + + }else if(option.type=="info"){ + + layer.msg(option.title,{icon:4,time:option.time},option.callback); + } + } + }; + + // Notiflix: Notify Default Settings on + var notifySettings = { + wrapID: 'NotiflixNotifyWrap', // can not customizable + width: '280px', + position: 'right-top', // 'right-top' - 'right-bottom' - 'left-top' - 'left-bottom' + distance: '10px', + opacity: 1, + borderRadius: '5px', + rtl: false, + timeout: 3000, + messageMaxLength: 110, + backOverlay: false, + backOverlayColor: 'rgba(0,0,0,0.5)', + plainText: true, + showOnlyTheLastOne: false, + clickToClose: false, + + ID: 'NotiflixNotify', + className: 'notiflix-notify', + zindex: 4001, + useGoogleFont: true, + fontFamily: 'Quicksand', + fontSize: '13px', + cssAnimation: true, + cssAnimationDuration: 400, + cssAnimationStyle: 'fade', // 'fade' - 'zoom' - 'from-right' - 'from-top' - 'from-bottom' - 'from-left' + closeButton: false, + useIcon: true, + useFontAwesome: false, + fontAwesomeIconStyle: 'basic', // 'basic' - 'shadow' + fontAwesomeIconSize: '34px', + + success: { + background: '#32c682', + textColor: '#fff', + childClassName: 'success', + notiflixIconColor: 'rgba(0,0,0,0.2)', + fontAwesomeClassName: 'fas fa-check-circle', + fontAwesomeIconColor: 'rgba(0,0,0,0.2)', + }, + + failure: { + background: '#ff5549', + textColor: '#fff', + childClassName: 'failure', + notiflixIconColor: 'rgba(0,0,0,0.2)', + fontAwesomeClassName: 'fas fa-times-circle', + fontAwesomeIconColor: 'rgba(0,0,0,0.2)', + }, + + warning: { + background: '#eebf31', + textColor: '#fff', + childClassName: 'warning', + notiflixIconColor: 'rgba(0,0,0,0.2)', + fontAwesomeClassName: 'fas fa-exclamation-circle', + fontAwesomeIconColor: 'rgba(0,0,0,0.2)', + }, + + info: { + background: '#26c0d3', + textColor: '#fff', + childClassName: 'info', + notiflixIconColor: 'rgba(0,0,0,0.2)', + fontAwesomeClassName: 'fas fa-info-circle', + fontAwesomeIconColor: 'rgba(0,0,0,0.2)', + }, + }; + // Notiflix: Notify Default Settings off + + // Notiflix: Report Default Settings on + var reportSettings = { + ID: 'NotiflixReportWrap', // can not customizable + className: 'notiflix-report', + width: '320px', + backgroundColor: '#f8f8f8', + borderRadius: '25px', + rtl: false, + zindex: 4002, + backOverlay: true, + backOverlayColor: 'rgba(0, 0, 0, 0.5)', + useGoogleFont: true, + fontFamily: 'Quicksand', + svgSize: '110px', + plainText: true, + titleFontSize: '16px', + titleMaxLength: 34, + messageFontSize: '13px', + messageMaxLength: 400, + buttonFontSize: '14px', + buttonMaxLength: 34, + cssAnimation: true, + cssAnimationDuration: 360, + cssAnimationStyle: 'fade', // 'fade' - 'zoom' + + success: { + svgColor: '#32c682', + titleColor: '#1e1e1e', + messageColor: '#242424', + buttonBackground: '#32c682', + buttonColor: '#fff', + }, + + failure: { + svgColor: '#ff5549', + titleColor: '#1e1e1e', + messageColor: '#242424', + buttonBackground: '#ff5549', + buttonColor: '#fff', + }, + + warning: { + svgColor: '#eebf31', + titleColor: '#1e1e1e', + messageColor: '#242424', + buttonBackground: '#eebf31', + buttonColor: '#fff', + }, + + info: { + svgColor: '#26c0d3', + titleColor: '#1e1e1e', + messageColor: '#242424', + buttonBackground: '#26c0d3', + buttonColor: '#fff', + }, + }; + // Notiflix: Report Default Settings off + + // Notiflix: Confirm Default Settings on + var confirmSettings = { + ID: 'NotiflixConfirmWrap', // can not customizable + className: 'notiflix-confirm', + width: '300px', + zindex: 4003, + position: 'center', // 'center' - 'center-top' - 'right-top' - 'right-bottom' - 'left-top' - 'left-bottom' + distance: '10px', + backgroundColor: '#f8f8f8', + borderRadius: '25px', + backOverlay: true, + backOverlayColor: 'rgba(0,0,0,0.5)', + rtl: false, + useGoogleFont: true, + fontFamily: 'Quicksand', + cssAnimation: true, + cssAnimationStyle: 'fade', // 'zoom' - 'fade' + cssAnimationDuration: 300, + plainText: true, + + titleColor: '#32c682', + titleFontSize: '16px', + titleMaxLength: 34, + + messageColor: '#1e1e1e', + messageFontSize: '14px', + messageMaxLength: 110, + + buttonsFontSize: '15px', + buttonsMaxLength: 34, + okButtonColor: '#f8f8f8', + okButtonBackground: '#32c682', + cancelButtonColor: '#f8f8f8', + cancelButtonBackground: '#a9a9a9', + }; + // Notiflix: Confirm Default Settings off + + // Notiflix: Loading Default Settings on + var loadingSettings = { + ID: 'NotiflixLoadingWrap', // can not customizable + className: 'notiflix-loading', + zindex: 4000, + backgroundColor: 'rgba(0,0,0,0.8)', + rtl: false, + useGoogleFont: true, + fontFamily: 'Quicksand', + cssAnimation: true, + cssAnimationDuration: 400, + clickToClose: false, + customSvgUrl: null, + svgSize: '80px', + svgColor: '#32c682', + messageID: 'NotiflixLoadingMessage', + messageFontSize: '15px', + messageMaxLength: 34, + messageColor: '#dcdcdc', + }; + // Notiflix: Loading Default Settings off + + // Notiflix: Block Default Settings on + var blockSettings = { + ID: 'NotiflixBlockWrap', // can not customizable + querySelectorLimit: 200, + className: 'notiflix-block', + position: 'absolute', + zindex: 1000, + backgroundColor: 'rgba(255,255,255,0.9)', + rtl: false, + useGoogleFont: true, + fontFamily: 'Quicksand', + cssAnimation: true, + cssAnimationDuration: 300, + svgSize: '45px', + svgColor: '#383838', + messageFontSize: '14px', + messageMaxLength: 34, + messageColor: '#383838', + }; + // Notiflix: Block Default Settings off + + // Notiflix: Extend on + var extendNotiflix = function () { + // variables + var extended = {}; + var deep = false; + var i = 0; + // check if a deep merge + if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') { + deep = arguments[0]; + i++; + } + // merge the object into the extended object + var merge = function (obj) { + for (var prop in obj) { + if (Object.prototype.hasOwnProperty.call(obj, prop)) { + // if property is an object, merge properties + if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') { + extended[prop] = extendNotiflix(extended[prop], obj[prop]); + } else { + extended[prop] = obj[prop]; + } + } + } + }; + // loop through each object and conduct a merge + for (; i < arguments.length; i++) { + merge(arguments[i]); + } + return extended; + }; + // Notiflix: Extend off + + // Notiflix: Plaintext on + var notiflixPlaintext = function (html) { + var htmlPool = document.createElement('div'); + htmlPool.innerHTML = html; + return htmlPool.textContent || htmlPool.innerText || ''; + }; + // Notiflix: Plaintext off + + // Notiflix: GoogleFont on + var notiflixGoogleFont = function (use, family) { + if (!document.getElementById('NotiflixQuicksand') && use && (family && typeof family === 'string' && family.toLowerCase() === 'quicksand')) { + // google fonts dns prefetch on + var dns = ''; + var dnsRange = document.createRange(); + dnsRange.selectNode(document.head); + var dnsFragment = dnsRange.createContextualFragment(dns); + document.head.appendChild(dnsFragment); + // google fonts dns prefetch off + + // google fonts style on + var font = ''; + var fontRange = document.createRange(); + fontRange.selectNode(document.head); + var fontFragment = fontRange.createContextualFragment(font); + document.head.appendChild(fontFragment); + // google fonts style off + } + }; + // Notiflix: GoogleFont off + + // Notiflix: Console Error on + var notiflixConsoleError = function (title, message) { + return console.error('%c ' + title + ' ', 'padding:2px;border-radius:20px;color:#fff;background:#ff5549', '\n' + message + '\nVisit documentation page to learn more: https://www.notiflix.com/documentation'); + }; + // Notiflix: Console Error off + + // Notiflix: Console Log on + var notiflixConsoleLog = function (title, message) { + return console.log('%c ' + title + ' ', 'padding:2px;border-radius:20px;color:#fff;background:#26c0d3', '\n' + message + '\nVisit documentation page to learn more: https://www.notiflix.com/documentation'); + }; + // Notiflix: Console Log off + + // Notiflix: Main on + var newNotifySettings; + var newReportSettings; + var newConfirmSettings; + var newLoadingSettings; + var newBlockSettings; + var Notiflix = { + // Notify on + Notify: { + + // Init + Init: function (userNotifyOpt) { + // extend options + newNotifySettings = extendNotiflix(true, notifySettings, userNotifyOpt); + // use GoogleFonts if "Quicksand" + notiflixGoogleFont(newNotifySettings.useGoogleFont, newNotifySettings.fontFamily); + }, + + // Merge First Init + Merge: function (userNotifyExtend) { + // if initialized already + if (newNotifySettings) { + newNotifySettings = extendNotiflix(true, newNotifySettings, userNotifyExtend); + } + // initialize first + else { + notiflixConsoleError('Notiflix Error', 'You have to initialize the Notify module before call Merge function.'); + return false; + } + }, + + // Display Notification: Success + Success: function (message, callback) { + // if not initialized pretend like init + if (!newNotifySettings) { + Notiflix.Notify.Init({}); + } + var theType = newNotifySettings.success; + NotiflixNotify(message, callback, theType, 'Success'); + }, + + // Display Notification: Failure + Failure: function (message, callback) { + // if not initialized pretend like init + if (!newNotifySettings) { + Notiflix.Notify.Init({}); + } + var theType = newNotifySettings.failure; + NotiflixNotify(message, callback, theType, 'Failure'); + }, + + // Display Notification: Warning + Warning: function (message, callback) { + // if not initialized pretend like init + if (!newNotifySettings) { + Notiflix.Notify.Init({}); + } + var theType = newNotifySettings.warning; + NotiflixNotify(message, callback, theType, 'Warning'); + }, + + // Display Notification: Info + Info: function (message, callback) { + // if not initialized pretend like init + if (!newNotifySettings) { + Notiflix.Notify.Init({}); + } + var theType = newNotifySettings.info; + NotiflixNotify(message, callback, theType, 'Info'); + }, + }, + // Notify off + + // Report on + Report: { + + // Init + Init: function (userReportOpt) { + // extend options + newReportSettings = extendNotiflix(true, reportSettings, userReportOpt); + // use GoogleFonts if "Quicksand" + notiflixGoogleFont(newReportSettings.useGoogleFont, newReportSettings.fontFamily); + }, + + // Merge First Init + Merge: function (userReportExtend) { + // if initialized already + if (newReportSettings) { + newReportSettings = extendNotiflix(true, newReportSettings, userReportExtend); + } + // initialize first + else { + notiflixConsoleError('Notiflix Error', 'You have to initialize the Report module before call Merge function.'); + return false; + } + }, + + // Display Report: Success + Success: function (title, message, buttonText, buttonCallback) { + // if not initialized pretend like init + if (!newReportSettings) { + Notiflix.Report.Init({}); + } + var theType = newReportSettings.success; + NotiflixReport(title, message, buttonText, buttonCallback, theType, 'Success'); + }, + + // Display Report: Failure + Failure: function (title, message, buttonText, buttonCallback) { + // if not initialized pretend like init + if (!newReportSettings) { + Notiflix.Report.Init({}); + } + var theType = newReportSettings.failure; + NotiflixReport(title, message, buttonText, buttonCallback, theType, 'Failure'); + }, + + // Display Report: Warning + Warning: function (title, message, buttonText, buttonCallback) { + // if not initialized pretend like init + if (!newReportSettings) { + Notiflix.Report.Init({}); + } + var theType = newReportSettings.warning; + NotiflixReport(title, message, buttonText, buttonCallback, theType, 'Warning'); + }, + + // Display Report: Info + Info: function (title, message, buttonText, buttonCallback) { + // if not initialized pretend like init + if (!newReportSettings) { + Notiflix.Report.Init({}); + } + var theType = newReportSettings.info; + NotiflixReport(title, message, buttonText, buttonCallback, theType, 'Info'); + }, + }, + // Report off + + // Confirm on + Confirm: { + + // Init + Init: function (userConfirmOpt) { + // extend options + newConfirmSettings = extendNotiflix(true, confirmSettings, userConfirmOpt); + // use GoogleFonts if "Quicksand" + notiflixGoogleFont(newConfirmSettings.useGoogleFont, newConfirmSettings.fontFamily); + }, + + // Merge First Init + Merge: function (userConfirmExtend) { + // if initialized already + if (newConfirmSettings) { + newConfirmSettings = extendNotiflix(true, newConfirmSettings, userConfirmExtend); + } + // initialize first + else { + notiflixConsoleError('Notiflix Error', 'You have to initialize the Confirm module before call Merge function.'); + return false; + } + }, + + // Display Confirm: Show + Show: function (title, message, okText, cancelText, okCallback, cancelCallback) { + if (!title) { title = 'Notiflix Confirm'; } + if (!message) { message = 'Do you agree with me?'; } + if (!okText) { okText = 'Yes'; } + if (!cancelText) { cancelText = 'No'; } + if (!okCallback) { okCallback = undefined; } + if (!cancelCallback) { cancelCallback = undefined; } + NotiflixConfirm(title, message, okText, cancelText, okCallback, cancelCallback); + }, + }, + // Confirm off + + // Loading on + Loading: { + + // Init + Init: function (userLoadingOpt) { + // extend options + newLoadingSettings = extendNotiflix(true, loadingSettings, userLoadingOpt); + // use GoogleFonts if "Quicksand" + notiflixGoogleFont(newLoadingSettings.useGoogleFont, newLoadingSettings.fontFamily); + }, + + // Merge First Init + Merge: function (userLoadingExtend) { + // if initialized already + if (newLoadingSettings) { + newLoadingSettings = extendNotiflix(true, newLoadingSettings, userLoadingExtend); + } + // initialize first + else { + notiflixConsoleError('Notiflix Error', 'You have to initialize the Loading module before call Merge function.'); + return false; + } + }, + + // Display Loading: Standard + Standard: function (message) { + NotiflixLoading(message, 'standard', true, 0); // true => display || 0 => delay + }, + + // Display Loading: Hourglass + Hourglass: function (message) { + NotiflixLoading(message, 'hourglass', true, 0); // true => display || 0 => delay + }, + + // Display Loading: Circle + Circle: function (message) { + NotiflixLoading(message, 'circle', true, 0); // true => display || 0 => delay + }, + + // Display Loading: Arrows + Arrows: function (message) { + NotiflixLoading(message, 'arrows', true, 0); // true => display || 0 => delay + }, + + // Display Loading: Dots + Dots: function (message) { + NotiflixLoading(message, 'dots', true, 0); // true => display || 0 => delay + }, + + // Display Loading: Pulse + Pulse: function (message) { + NotiflixLoading(message, 'pulse', true, 0); // true => display || 0 => delay + }, + + // Display Loading: Custom + Custom: function (message) { + NotiflixLoading(message, 'custom', true, 0); // true => display || 0 => delay + }, + + // Display Loading: Notiflix + Notiflix: function (message) { + NotiflixLoading(message, 'notiflix', true, 0); // true => display || 0 => delay + }, + + // Remove Loading + Remove: function (theDelay) { + if (!theDelay) { theDelay = 0; } + NotiflixLoading(false, false, false, theDelay); // false = Remove + }, + + // Change The Message + Change: function (newMessage) { + NotiflixLoadingChange(newMessage); + }, + }, + // Loading off + + // Block on + Block: { + + // Initialize + Init: function (userBlockOpt) { + // extend options + newBlockSettings = extendNotiflix(true, blockSettings, userBlockOpt); + // use GoogleFonts if "Quicksand" + notiflixGoogleFont(newBlockSettings.useGoogleFont, newBlockSettings.fontFamily); + }, + + // Merge First Initialize + Merge: function (userBlockExtend) { + // if initialized already + if (newBlockSettings) { + newBlockSettings = extendNotiflix(true, newBlockSettings, userBlockExtend); + } + // initialize first + else { + notiflixConsoleError('Notiflix Error', 'You have to initialize the "Notiflix.Block" module before call Merge function.'); + return false; + } + }, + + // Display Block: Standard + Standard: function (selector, message) { + var block = true; + var theIcon = 'standard'; + NotiflixBlockUnblockElement(block, selector, theIcon, message); + }, + + // Display Block: Hourglass + Hourglass: function (selector, message) { + var block = true; + var theIcon = 'hourglass'; + NotiflixBlockUnblockElement(block, selector, theIcon, message); + }, + + // Display Block: Circle + Circle: function (selector, message) { + var block = true; + var theIcon = 'circle'; + NotiflixBlockUnblockElement(block, selector, theIcon, message); + }, + + // Display Block: Arrows + Arrows: function (selector, message) { + var block = true; + var theIcon = 'arrows'; + NotiflixBlockUnblockElement(block, selector, theIcon, message); + }, + + // Display Block: Dots + Dots: function (selector, message) { + var block = true; + var theIcon = 'dots'; + NotiflixBlockUnblockElement(block, selector, theIcon, message); + }, + + // Display Block: Pulse + Pulse: function (selector, message) { + var block = true; + var theIcon = 'pulse'; + NotiflixBlockUnblockElement(block, selector, theIcon, message); + }, + + // Remove Block + Remove: function (selector, delay) { + var block = false; + var theIcon = null; + var message = null; + NotiflixBlockUnblockElement(block, selector, theIcon, message, delay); + }, + }, + // Block off + }; + // Notiflix: Main off + + + // Notiflix: Notify Single on + var notiflixNotifyCount = 0; + var NotiflixNotify = function (message, callback, theType, staticType) { + if (arguments && arguments.length === 4) { + + // notify counter on + notiflixNotifyCount++; + // notify counter off + + // if no message on + if (!message) { + message = 'Notiflix ' + staticType; + } + // if no message off + + // if plainText true = HTML tags not allowed on + if (newNotifySettings.plainText) { + message = notiflixPlaintext(message); // message plain text + } + // if plainText true = HTML tags not allowed off + + // if plainText false but the message length more than messageMaxLength = HTML tags error on + if (!newNotifySettings.plainText && message.length > newNotifySettings.messageMaxLength) { + Notiflix.Notify.Merge({ closeButton: true, plainText: false, }); + message = 'HTML Tags Error: Your content length is more than "messageMaxLength" option.'; // message html error + } + // if plainText false but the message length more than messageMaxLength = HTML tags error off + + // message max length substring on + if (message.length > newNotifySettings.messageMaxLength) { + message = message.substring(0, newNotifySettings.messageMaxLength) + '...'; + } + // message max length substring off + + // font awesome icon style on + if (newNotifySettings.fontAwesomeIconStyle === 'shadow') { + theType.fontAwesomeIconColor = theType.background; + } + // font awesome icon style off + + // if cssAnimaion false -> duration on + if (!newNotifySettings.cssAnimation) { + newNotifySettings.cssAnimationDuration = 0; + } + // if cssAnimaion false -> duration off + + // notify wrap on + var docBody = document.body; + var ntflxNotifyWrap = document.createElement('div'); + ntflxNotifyWrap.id = notifySettings.wrapID; + ntflxNotifyWrap.style.width = newNotifySettings.width; + ntflxNotifyWrap.style.zIndex = newNotifySettings.zindex; + ntflxNotifyWrap.style.opacity = newNotifySettings.opacity; + + // wrap position on + if (newNotifySettings.position === 'right-bottom') { + ntflxNotifyWrap.style.right = newNotifySettings.distance; + ntflxNotifyWrap.style.bottom = newNotifySettings.distance; + ntflxNotifyWrap.style.top = 'auto'; + ntflxNotifyWrap.style.left = 'auto'; + } else if (newNotifySettings.position === 'left-top') { + ntflxNotifyWrap.style.left = newNotifySettings.distance; + ntflxNotifyWrap.style.top = newNotifySettings.distance; + ntflxNotifyWrap.style.right = 'auto'; + ntflxNotifyWrap.style.bottom = 'auto'; + } else if (newNotifySettings.position === 'left-bottom') { + ntflxNotifyWrap.style.left = newNotifySettings.distance; + ntflxNotifyWrap.style.bottom = newNotifySettings.distance; + ntflxNotifyWrap.style.top = 'auto'; + ntflxNotifyWrap.style.right = 'auto'; + } else { // 'right-top' or else + ntflxNotifyWrap.style.right = newNotifySettings.distance; + ntflxNotifyWrap.style.top = newNotifySettings.distance; + ntflxNotifyWrap.style.left = 'auto'; + ntflxNotifyWrap.style.bottom = 'auto'; + } + // wrap position off + + // if background overlay true on + var notifyOverlay; + if (newNotifySettings.backOverlay) { + notifyOverlay = document.createElement('div'); + notifyOverlay.id = newNotifySettings.ID + 'Overlay'; + notifyOverlay.style.width = '100%'; + notifyOverlay.style.height = '100%'; + notifyOverlay.style.position = 'fixed'; + notifyOverlay.style.zIndex = newNotifySettings.zindex; + notifyOverlay.style.left = 0; + notifyOverlay.style.top = 0; + notifyOverlay.style.right = 0; + notifyOverlay.style.bottom = 0; + notifyOverlay.style.background = newNotifySettings.backOverlayColor; + notifyOverlay.className = (newNotifySettings.cssAnimation ? 'with-animation' : ''); + notifyOverlay.style.animationDuration = (newNotifySettings.cssAnimation) ? newNotifySettings.cssAnimationDuration + 'ms' : ''; + if (!document.getElementById(notifyOverlay.id)) { + docBody.appendChild(notifyOverlay); + } + } + // if background overlay true off + + if (!document.getElementById(ntflxNotifyWrap.id)) { + docBody.appendChild(ntflxNotifyWrap); + } + // notify wrap off + + // notify content on + var ntflxNotify = document.createElement('div'); + ntflxNotify.id = newNotifySettings.ID + '-' + notiflixNotifyCount; + ntflxNotify.className = newNotifySettings.className + ' ' + theType.childClassName + ' ' + (newNotifySettings.cssAnimation ? 'with-animation' : '') + ' ' + (newNotifySettings.useIcon ? 'with-icon' : '') + ' nx-' + newNotifySettings.cssAnimationStyle + ' ' + (newNotifySettings.closeButton && !callback ? 'with-close-button' : '') + ' ' + (callback && typeof callback === 'function' ? 'with-callback' : '') + ' ' + (newNotifySettings.clickToClose ? 'click-to-close' : ''); + ntflxNotify.style.fontSize = newNotifySettings.fontSize; + ntflxNotify.style.color = theType.textColor; + ntflxNotify.style.background = theType.background; + ntflxNotify.style.borderRadius = newNotifySettings.borderRadius; + + // rtl on + if (newNotifySettings.rtl) { + ntflxNotify.setAttribute('dir', 'rtl'); + ntflxNotify.classList.add('rtl-on'); + } + // rtl off + + // font-family on + ntflxNotify.style.fontFamily = '"' + newNotifySettings.fontFamily + '"' + ', sans-serif'; + // font-family off + + // use css animation on + if (newNotifySettings.cssAnimation) { + ntflxNotify.style.animationDuration = newNotifySettings.cssAnimationDuration + 'ms'; + } + // use css animation off + + // close button element on + var closeButtonHTML = ''; + if (newNotifySettings.closeButton && !callback) { + closeButtonHTML = ''; + } + // close buttpon element off + + // use icon on + if (newNotifySettings.useIcon) { + // use font awesome + if (newNotifySettings.useFontAwesome) { + ntflxNotify.innerHTML = '' + message + '' + (newNotifySettings.closeButton ? closeButtonHTML : ''); + } + // use notiflix icon + else { + var svgIcon; + if (staticType === 'Success') { // success + svgIcon = ''; + } else if (staticType === 'Failure') { // failure + svgIcon = ''; + } else if (staticType === 'Warning') { // warning + svgIcon = ''; + } else if (staticType === 'Info') { // info + svgIcon = ''; + } else { + svgIcon = ''; + } + ntflxNotify.innerHTML = svgIcon + '' + message + '' + (newNotifySettings.closeButton ? closeButtonHTML : ''); + } + } + // without icon + else { + ntflxNotify.innerHTML = '' + message + '' + (newNotifySettings.closeButton ? closeButtonHTML : ''); + } + // use icon off + // notify content off + + // notify append or prepend on + if (newNotifySettings.position === 'left-bottom' || newNotifySettings.position === 'right-bottom') { // the new one will be first + var notifyWrap = document.getElementById(ntflxNotifyWrap.id); + notifyWrap.insertBefore(ntflxNotify, notifyWrap.firstChild); + } else { + document.getElementById(ntflxNotifyWrap.id).appendChild(ntflxNotify); + } + + if (newNotifySettings.useIcon) { // if useIcon, dynamically vertical align the contents + var messageIcon = document.getElementById(ntflxNotify.id).querySelectorAll('.nmi')[0]; + var messageIconH = 40; + // if font awesome + if (newNotifySettings.useFontAwesome) { + messageIconH = Math.round(parseInt(messageIcon.offsetHeight)); + } + // if notiflix SVG + else { + var SvgBBox = messageIcon.getBBox(); + messageIconH = Math.round(parseInt(SvgBBox.width)); + } + var messageText = document.getElementById(ntflxNotify.id).querySelectorAll('span')[0]; + var messageTextH = Math.round(messageText.offsetHeight); + if (messageTextH <= messageIconH) { + messageText.style.paddingTop = (messageIconH - messageTextH) / 2 + 'px'; + messageText.style.paddingBottom = (messageIconH - messageTextH) / 2 + 'px'; + } + } + // notify append or prepend off + + // remove by timeout or click on + if (document.getElementById(ntflxNotify.id)) { + // set elements on + var removeDiv = document.getElementById(ntflxNotify.id); + var removeWrap = document.getElementById(ntflxNotifyWrap.id); + var removeOverlay; + if (newNotifySettings.backOverlay) { + removeOverlay = document.getElementById(notifyOverlay.id); + } + // set elements on + + // timeout vars on + var timeoutHide; + var timeoutRemove; + // timeout vars off + + // hide notify elm and hide overlay on + var hideNotifyElementsAndOverlay = function () { + removeDiv.classList.add('remove'); + if (newNotifySettings.backOverlay && removeWrap.childElementCount <= 0) { + removeOverlay.classList.add('remove'); + } + clearTimeout(timeoutHide); + }; + // hide notify elm and hide overlay off + + // remove notify elm and wrapper on + var removeNotifyElmentsAndWrapper = function () { + var notifyExist = document.getElementById(ntflxNotify.id); + if (notifyExist && removeDiv.parentNode !== null) { + removeDiv.parentNode.removeChild(removeDiv); + } + if (removeWrap.childElementCount <= 0 && removeWrap.parentNode !== null) { // if childs count === 0 remove wrap + removeWrap.parentNode.removeChild(removeWrap); + if (newNotifySettings.backOverlay && removeOverlay.parentNode !== null) { + removeOverlay.parentNode.removeChild(removeOverlay); + } + } + clearTimeout(timeoutRemove); + }; + // remove notify elm and wrapper off + + // if close button and callback undefined on + if (newNotifySettings.closeButton && !callback) { + var closeButtonElm = document.getElementById(ntflxNotify.id).querySelectorAll('span.notify-close-button')[0]; + closeButtonElm.addEventListener('click', function () { + hideNotifyElementsAndOverlay(); + var clickToCloseTimeout = setTimeout(function () { + removeNotifyElmentsAndWrapper(); + clearTimeout(clickToCloseTimeout); + }, newNotifySettings.cssAnimationDuration); + }); + } + // if close button and callback undefined off + + // if callback or click to close on + if ((callback && typeof callback === 'function') || newNotifySettings.clickToClose) { + removeDiv.addEventListener('click', function (e) { + if (callback && typeof callback === 'function') { + callback(); + } + hideNotifyElementsAndOverlay(); + var callbackTimeout = setTimeout(function () { + removeNotifyElmentsAndWrapper(); + clearTimeout(callbackTimeout); + }, newNotifySettings.cssAnimationDuration); + }); + } + // if callback or click to close off + + // else auto remove on + if (!newNotifySettings.closeButton && !callback) { + timeoutHide = setTimeout(function () { + hideNotifyElementsAndOverlay(); + }, newNotifySettings.timeout); + timeoutRemove = setTimeout(function () { + removeNotifyElmentsAndWrapper(); + }, newNotifySettings.timeout + newNotifySettings.cssAnimationDuration); + } + // else auto remove off + } + // remove by timeout or click off + + // notify - show only the last one on + if (newNotifySettings.showOnlyTheLastOne && notiflixNotifyCount > 0) { + var allNotifyElmNotTheLastOne = document.querySelectorAll('[id^=' + newNotifySettings.ID + '-]:not([id=' + newNotifySettings.ID + '-' + notiflixNotifyCount + '])'); + for (var i = 0; i < allNotifyElmNotTheLastOne.length; i++) { + var eachNotifyElmNotLastOne = allNotifyElmNotTheLastOne[i]; + if (eachNotifyElmNotLastOne.parentNode !== null) { + eachNotifyElmNotLastOne.parentNode.removeChild(eachNotifyElmNotLastOne); + } + } + } + // notify - show only the last one off + + } else { + notiflixConsoleError('Notiflix Error', 'Where is the arguments?'); + } + }; + // Notiflix: Notify Single off + + + // Notiflix: Report Single on + var NotiflixReport = function (title, message, buttonText, buttonCallback, theType, staticType) { + + // check the arguments on + if (!title) { title = 'Notiflix ' + staticType; } + if (!message) { + if (staticType === 'Success') { + message = '"Do not try to become a person of success but try to become a person of value."

              - Albert Einstein'; + } + else if (staticType === 'Failure') { + message = '"Failure is simply the opportunity to begin again, this time more intelligently."

              - Henry Ford'; + } + else if (staticType === 'Warning') { + message = '"The peoples who want to live comfortably without producing and fatigue; they are doomed to lose their dignity, then liberty, and then independence and destiny."

              - Mustafa Kemal Ataturk'; + } + else if (staticType === 'Info') { + message = '"Knowledge rests not upon truth alone, but upon error also."

              - Carl Gustav Jung'; + } + } + if (!buttonText) { buttonText = 'Okay'; } + if (!buttonCallback) { buttonCallback = undefined; } + // check the arguments off + + // if plainText true = HTML tags not allowed on + if (newReportSettings.plainText) { + title = notiflixPlaintext(title); + message = notiflixPlaintext(message); + buttonText = notiflixPlaintext(buttonText); + } + // if plainText true = HTML tags not allowed off + + // if plainText false but the contents length more than *MaxLength = HTML tags error on + if (!newReportSettings.plainText) { + if (title.length > newReportSettings.titleMaxLength) { + title = 'HTML Tags Error'; // title html error + message = 'Your Title content length is more than "titleMaxLength" option.'; // message html error + buttonText = 'Okay'; // button html error + } + if (message.length > newReportSettings.messageMaxLength) { + title = 'HTML Tags Error'; // title html error + message = 'Your Message content length is more than "messageMaxLength" option.'; // message html error + buttonText = 'Okay'; // button html error + } + if (buttonText.length > newReportSettings.buttonMaxLength) { + title = 'HTML Tags Error'; // title html error + message = 'Your Button content length is more than "buttonMaxLength" option.'; // message html error + buttonText = 'Okay'; // button html error + } + } + // if plainText false but the contents length more than *MaxLength = HTML tags error off + + // max length on + if (title.length > newReportSettings.titleMaxLength) { + title = title.substring(0, newReportSettings.titleMaxLength) + '...'; + } + if (message.length > newReportSettings.messageMaxLength) { + message = message.substring(0, newReportSettings.messageMaxLength) + '...'; + } + if (buttonText.length > newReportSettings.buttonMaxLength) { + buttonText = buttonText.substring(0, newReportSettings.buttonMaxLength) + '...'; + } + // max length off + + // if cssAnimaion false -> duration on + if (!newReportSettings.cssAnimation) { + newReportSettings.cssAnimationDuration = 0; + } + // if cssAnimaion false -> duration off + + // report wrap on + var docBody = document.body; + var ntflxReportWrap = document.createElement('div'); + ntflxReportWrap.id = reportSettings.ID; + ntflxReportWrap.className = newReportSettings.className; + ntflxReportWrap.style.width = newReportSettings.width; + ntflxReportWrap.style.zIndex = newReportSettings.zindex; + ntflxReportWrap.style.borderRadius = newReportSettings.borderRadius; + ntflxReportWrap.style.fontFamily = '"' + newReportSettings.fontFamily + '"' + ', sans-serif'; + + // rtl on + if (newReportSettings.rtl) { + ntflxReportWrap.setAttribute('dir', 'rtl'); + ntflxReportWrap.classList.add('rtl-on'); + } + // rtl off + + // overlay on + var reportOverlay = ''; + if (newReportSettings.backOverlay) { + reportOverlay = '
              '; + } + // overlay off + + // svg icon on + var svgIcon = ''; + if (staticType === 'Success') { + svgIcon = notiflixReportSvgSuccess(newReportSettings.svgSize, theType.svgColor); + } else if (staticType === 'Failure') { + svgIcon = notiflixReportSvgFailure(newReportSettings.svgSize, theType.svgColor); + } else if (staticType === 'Warning') { + svgIcon = notiflixReportSvgWarning(newReportSettings.svgSize, theType.svgColor); + } else if (staticType === 'Info') { + svgIcon = notiflixReportSvgInfo(newReportSettings.svgSize, theType.svgColor); + } + // svg icon off + + ntflxReportWrap.innerHTML = reportOverlay + '
              ' + + '
              ' + svgIcon + '
              ' + + '
              ' + title + '
              ' + + '

              ' + message + '

              ' + + '' + buttonText + '' + + '
              '; + + // if there is no report element + if (!document.getElementById(ntflxReportWrap.id)) { + // append + docBody.appendChild(ntflxReportWrap); + + // vertical align on + var windowH = Math.round(window.innerHeight); + var reportH = Math.round(document.getElementById(ntflxReportWrap.id).offsetHeight); + ntflxReportWrap.style.top = (windowH - reportH) / 2 + 'px'; + // vertical align off + + // callback on + var getReportWrap = document.getElementById(ntflxReportWrap.id); + var reportButton = document.getElementById('NXReportButton'); + reportButton.addEventListener('click', function () { + // if callback on + if (buttonCallback && typeof buttonCallback === 'function') { + buttonCallback(); + } + // if callback off + + // remove element on + getReportWrap.classList.add('remove'); + var timeout = setTimeout(function () { + if (getReportWrap.parentNode !== null) { + getReportWrap.parentNode.removeChild(getReportWrap); + } + clearTimeout(timeout); + }, newReportSettings.cssAnimationDuration); + // remove element off + }); + // callback off + + } + // report wrap off + + }; + // Notiflix: Report Single off + + + // Notiflix: Confirm Single on + var NotiflixConfirm = function (title, message, okButtonText, cancelButtonText, okButtonCallback, cancelButtonCallback) { + // if not initialized pretend like init + if (!newConfirmSettings) { + Notiflix.Confirm.Init({}); + } + + // if plainText true => HTML tags not allowed on + if (newConfirmSettings.plainText) { + title = notiflixPlaintext(title); + message = notiflixPlaintext(message); + okButtonText = notiflixPlaintext(okButtonText); + cancelButtonText = notiflixPlaintext(cancelButtonText); + } + // if plainText true => HTML tags not allowed off + + // if plainText false but the contents length more than *MaxLength = HTML tags error on + if (!newConfirmSettings.plainText) { + if (title.length > newConfirmSettings.titleMaxLength) { + title = 'HTML Tags Error'; // title html error + message = 'Your Title content length is more than "titleMaxLength" option.'; // message html error + okButtonText = 'Okay'; // button html error + cancelButtonText = '...'; // button html error + } + if (message.length > newConfirmSettings.messageMaxLength) { + title = 'HTML Tags Error'; // title html error + message = 'Your Message content length is more than "messageMaxLength" option.'; // message html error + okButtonText = 'Okay'; // button html error + cancelButtonText = '...'; // button html error + } + if ((okButtonText.length || cancelButtonText.length) > newConfirmSettings.buttonsMaxLength) { + title = 'HTML Tags Error'; // title html error + message = 'Your Buttons contents length is more than "buttonsMaxLength" option.'; // message html error + okButtonText = 'Okay'; // button html error + cancelButtonText = '...'; // button html error + } + } + // if plainText false but the contents length more than *MaxLength = HTML tags error off + + // max length on + if (title.length > newConfirmSettings.titleMaxLength) { + title = title.substring(0, newConfirmSettings.titleMaxLength) + '...'; + } + if (message.length > newConfirmSettings.messageMaxLength) { + message = message.substring(0, newConfirmSettings.messageMaxLength) + '...'; + } + if (okButtonText.length > newConfirmSettings.buttonsMaxLength) { + okButtonText = okButtonText.substring(0, newConfirmSettings.buttonsMaxLength) + '...'; + } + if (cancelButtonText.length > newConfirmSettings.buttonsMaxLength) { + cancelButtonText = cancelButtonText.substring(0, newConfirmSettings.buttonsMaxLength) + '...'; + } + // max length off + + // if cssAnimaion false -> duration on + if (!newConfirmSettings.cssAnimation) { + newConfirmSettings.cssAnimationDuration = 0; + } + // if cssAnimaion false -> duration off + + // confirm wrap on + var docBody = document.body; + var ntflxConfirmWrap = document.createElement('div'); + ntflxConfirmWrap.id = confirmSettings.ID; + ntflxConfirmWrap.className = newConfirmSettings.className + (newConfirmSettings.cssAnimation ? ' with-animation nx-' + newConfirmSettings.cssAnimationStyle : ''); + ntflxConfirmWrap.style.width = newConfirmSettings.width; + ntflxConfirmWrap.style.zIndex = newConfirmSettings.zindex; + + // rtl on + if (newConfirmSettings.rtl) { + ntflxConfirmWrap.setAttribute('dir', 'rtl'); + ntflxConfirmWrap.classList.add('rtl-on'); + } + // rtl off + + // font-family on + ntflxConfirmWrap.style.fontFamily = '"' + newConfirmSettings.fontFamily + '"' + ', sans-serif'; + // font-family off + + // if background overlay true on + var confirmOverlay = ''; + if (newConfirmSettings.backOverlay) { + confirmOverlay = '
              '; + } + // if background overlay true off + + // if have a callback => add cancel button on + var cancelButtonHTML = ''; + if (okButtonCallback) { + cancelButtonHTML = '' + cancelButtonText + ''; + } + // if have a callback => add cancel button off + + ntflxConfirmWrap.innerHTML = confirmOverlay + + '
              ' + + '
              ' + + '
              ' + title + '
              ' + + '

              ' + message + '

              ' + + '
              ' + + '
              ' + + '' + okButtonText + '' + + cancelButtonHTML + + '
              ' + + '
              '; + // confirm wrap off + + // if there is no confirm box on + if (!document.getElementById(ntflxConfirmWrap.id)) { + docBody.appendChild(ntflxConfirmWrap); + + // position on + if (newConfirmSettings.position === 'center') { // if center-center + var windowH = Math.round(window.innerHeight); + var confirmH = Math.round(document.getElementById(ntflxConfirmWrap.id).offsetHeight); + ntflxConfirmWrap.style.top = (windowH - confirmH) / 2 + 'px'; + ntflxConfirmWrap.style.left = newConfirmSettings.distance; + ntflxConfirmWrap.style.right = newConfirmSettings.distance; + ntflxConfirmWrap.style.bottom = 'auto'; + ntflxConfirmWrap.style.margin = 'auto'; + } else if (newConfirmSettings.position === 'right-top') { // if right-top + ntflxConfirmWrap.style.right = newConfirmSettings.distance; + ntflxConfirmWrap.style.top = newConfirmSettings.distance; + ntflxConfirmWrap.style.bottom = 'auto'; + ntflxConfirmWrap.style.left = 'auto'; + ntflxConfirmWrap.style.margin = 'auto'; + } else if (newConfirmSettings.position === 'right-bottom') { // if right-bottom + ntflxConfirmWrap.style.right = newConfirmSettings.distance; + ntflxConfirmWrap.style.bottom = newConfirmSettings.distance; + ntflxConfirmWrap.style.top = 'auto'; + ntflxConfirmWrap.style.left = 'auto'; + ntflxConfirmWrap.style.margin = 'auto'; + } else if (newConfirmSettings.position === 'left-top') { // if left-top + ntflxConfirmWrap.style.left = newConfirmSettings.distance; + ntflxConfirmWrap.style.top = newConfirmSettings.distance; + ntflxConfirmWrap.style.right = 'auto'; + ntflxConfirmWrap.style.bottom = 'auto'; + ntflxConfirmWrap.style.margin = 'auto'; + } else if (newConfirmSettings.position === 'left-bottom') { // if left-bottom + ntflxConfirmWrap.style.left = newConfirmSettings.distance; + ntflxConfirmWrap.style.bottom = newConfirmSettings.distance; + ntflxConfirmWrap.style.top = 'auto'; + ntflxConfirmWrap.style.right = 'auto'; + ntflxConfirmWrap.style.margin = 'auto'; + } else { // if center-top + ntflxConfirmWrap.style.top = newConfirmSettings.distance; + ntflxConfirmWrap.style.left = 0; + ntflxConfirmWrap.style.right = 0; + ntflxConfirmWrap.style.bottom = 'auto'; + ntflxConfirmWrap.style.margin = 'auto'; + } + // position off + + // buttons listener on + var confirmCloseWrap = document.getElementById(ntflxConfirmWrap.id); + var okButton = document.getElementById('NXConfirmButtonOk'); + + // ok button listener on + okButton.addEventListener('click', function () { + // if ok callback && if ok callback is a function + if (okButtonCallback && typeof okButtonCallback === 'function') { + okButtonCallback(); + } + confirmCloseWrap.classList.add('remove'); + + var timeout = setTimeout(function () { + if (confirmCloseWrap.parentNode !== null) { + confirmCloseWrap.parentNode.removeChild(confirmCloseWrap); + clearTimeout(timeout); + } + }, newConfirmSettings.cssAnimationDuration); + }); + // ok button listener off + + // if ok callback && if ok callback a function => add Cancel Button listener on + if (okButtonCallback && typeof okButtonCallback === 'function') { + // cancel button listener on + var cancelButton = document.getElementById('NXConfirmButtonCancel'); + cancelButton.addEventListener('click', function () { + // if cancel callback && if cancel callback a function + if (cancelButtonCallback && typeof cancelButtonCallback === 'function') { + cancelButtonCallback(); + } + confirmCloseWrap.classList.add('remove'); + + var timeout = setTimeout(function () { + if (confirmCloseWrap.parentNode !== null) { + confirmCloseWrap.parentNode.removeChild(confirmCloseWrap); + clearTimeout(timeout); + } + }, newConfirmSettings.cssAnimationDuration); + }); + // cancel button listener off + } + // if ok callback && if ok callback a function => add Cancel Button listener off + // buttons listener off + } + // if there is no confirm box off + }; + // Notiflix: Confirm Single off + + + // Notiflix: Loading Single on + var NotiflixLoading = function (message, iconType, display, theDelay) { + // if not initialized pretend like init + if (!newLoadingSettings) { + Notiflix.Loading.Init({}); + } + // check the message + if (!message) { + message = ''; + } + // show loading + if (display) { + + // if message settings on + if (message.toString().length > newLoadingSettings.messageMaxLength) { + message = notiflixPlaintext(message).toString().substring(0, newLoadingSettings.messageMaxLength) + '...'; + } else { + message = notiflixPlaintext(message).toString(); + } + var intSvgSize = parseInt(newLoadingSettings.svgSize); + var messageHTML = ''; + if (message.length > 0) { + var messagePosTop = Math.round(intSvgSize - (intSvgSize / 4)).toString() + 'px'; + var messageHeight = (parseInt(newLoadingSettings.messageFontSize) * 1.4).toString() + 'px'; + messageHTML = '

              ' + message + '

              '; + } + // if message settings off + + // if cssAnimaion false -> duration on + if (!newLoadingSettings.cssAnimation) { + newLoadingSettings.cssAnimationDuration = 0; + } + // if cssAnimaion false -> duration off + + // svgIcon on + var svgIcon = ''; + if (iconType === 'standard') { + svgIcon = notiflixIndicatorSvgStandard(newLoadingSettings.svgSize, newLoadingSettings.svgColor); + } else if (iconType === 'hourglass') { + svgIcon = notiflixIndicatorSvgHourglass(newLoadingSettings.svgSize, newLoadingSettings.svgColor); + } else if (iconType === 'circle') { + svgIcon = notiflixIndicatorSvgCircle(newLoadingSettings.svgSize, newLoadingSettings.svgColor); + } else if (iconType === 'arrows') { + svgIcon = notiflixIndicatorSvgArrows(newLoadingSettings.svgSize, newLoadingSettings.svgColor); + } else if (iconType === 'dots') { + svgIcon = notiflixIndicatorSvgDots(newLoadingSettings.svgSize, newLoadingSettings.svgColor); + } else if (iconType === 'pulse') { + svgIcon = notiflixIndicatorSvgPulse(newLoadingSettings.svgSize, newLoadingSettings.svgColor); + } else if (iconType === 'custom' && newLoadingSettings.customSvgUrl !== null) { + svgIcon = 'Notiflix'; + } else if (iconType === 'custom' && newLoadingSettings.customSvgUrl == null) { + notiflixConsoleError('Notiflix Error', 'You have to set a static SVG url to "customSvgUrl" option to use Loading Custom.'); + return false; + } else if (iconType === 'notiflix') { + svgIcon = notiflixIndicatorSvgNotiflix(newLoadingSettings.svgSize, '#f8f8f8', '#32c682'); + } + var svgPosTop = 0; + if (message.length > 0) { + svgPosTop = '-' + Math.round(intSvgSize - (intSvgSize / 4)).toString() + 'px'; + } + var svgIconHTML = '
              ' + svgIcon + '
              '; + // svgIcon off + + // loading wrap on + var docBody = document.body; + var ntflxLoadingWrap = document.createElement('div'); + ntflxLoadingWrap.id = loadingSettings.ID; + ntflxLoadingWrap.className = newLoadingSettings.className + (newLoadingSettings.cssAnimation ? ' with-animation' : '') + (newLoadingSettings.clickToClose ? ' click-to-close' : ''); + ntflxLoadingWrap.style.zIndex = newLoadingSettings.zindex; + ntflxLoadingWrap.style.background = newLoadingSettings.backgroundColor; + ntflxLoadingWrap.style.animationDuration = newLoadingSettings.cssAnimationDuration + 'ms'; + ntflxLoadingWrap.style.fontFamily = '"' + newLoadingSettings.fontFamily + '"' + ', sans-serif'; + + // rtl on + if (newLoadingSettings.rtl) { + ntflxLoadingWrap.setAttribute('dir', 'rtl'); + ntflxLoadingWrap.classList.add('rtl-on'); + } + // rtl off + + // append on + ntflxLoadingWrap.innerHTML = svgIconHTML + messageHTML; + + // if there is no loading element + if (!document.getElementById(ntflxLoadingWrap.id)) { + // append + docBody.appendChild(ntflxLoadingWrap); + + // if click to close + if (newLoadingSettings.clickToClose) { + var loadingWrapElm = document.getElementById(ntflxLoadingWrap.id); + loadingWrapElm.addEventListener('click', function () { + ntflxLoadingWrap.classList.add('remove'); + var timeout = setTimeout(function () { + if (ntflxLoadingWrap.parentNode !== null) { + ntflxLoadingWrap.parentNode.removeChild(ntflxLoadingWrap); + clearTimeout(timeout); + } + }, newLoadingSettings.cssAnimationDuration); + }); + } + } + // append off + + } + // remove loading + else { + // if there is a loading element + if (document.getElementById(loadingSettings.ID)) { + var loadingElm = document.getElementById(loadingSettings.ID); + var timeout = setTimeout(function () { + loadingElm.classList.add('remove'); + var timeout2 = setTimeout(function () { + if (loadingElm.parentNode !== null) { + loadingElm.parentNode.removeChild(loadingElm); + clearTimeout(timeout2); + } + }, newLoadingSettings.cssAnimationDuration); + clearTimeout(timeout); + }, theDelay); + } + } + }; + // Notiflix: Loading Single off + + // Notiflix: Loading Change Message on + var NotiflixLoadingChange = function (newMessage) { + // check the new message + if (!newMessage) { + newMessage = ''; + } + // if has any loading + if (document.getElementById(loadingSettings.ID)) { + // if there is a new message + if (newMessage.length > 0) { + // max length on + if (newMessage.length > newLoadingSettings.messageMaxLength) { + newMessage = notiflixPlaintext(newMessage).toString().substring(0, newLoadingSettings.messageMaxLength) + '...'; + } else { + newMessage = notiflixPlaintext(newMessage).toString(); + } + // max length off + + // there is a message element + var oldMessageElm = document.getElementById(loadingSettings.ID).getElementsByTagName('p')[0]; + if (oldMessageElm) { + oldMessageElm.innerHTML = newMessage; // change the message + } + // there is no message element + else { + // create a new message element on + var newMessageHTML = document.createElement('p'); + newMessageHTML.id = newLoadingSettings.messageID; + newMessageHTML.className = 'loading-message new'; + newMessageHTML.style.color = newLoadingSettings.messageColor; + newMessageHTML.style.fontSize = newLoadingSettings.messageFontSize; + var intSvgSize = parseInt(newLoadingSettings.svgSize); + var messagePosTop = Math.round(intSvgSize - (intSvgSize / 4)).toString() + 'px'; + newMessageHTML.style.top = messagePosTop; + var messageHeight = (parseInt(newLoadingSettings.messageFontSize) * 1.4).toString() + 'px'; + newMessageHTML.style.height = messageHeight; + newMessageHTML.innerHTML = newMessage; + var messageWrap = document.getElementById(loadingSettings.ID); + messageWrap.appendChild(newMessageHTML); + // create a new message element off + + // vertical align svg on + var svgDivElm = document.getElementById(loadingSettings.ID).getElementsByTagName('div')[0]; + var svgNewPosTop = '-' + Math.round(intSvgSize - (intSvgSize / 4)).toString() + 'px'; + svgDivElm.style.top = svgNewPosTop; + // vertical align svg off + } + } + // if no message + else { + notiflixConsoleError('Notiflix Error', 'Where is the new message?'); + } + } + }; + // Notiflix: Loading Change Message off + + + // Notiflix: Block or Unblock Element on + var notiflixBlockElementCounter = 0; + var NotiflixBlockUnblockElement = function (block, selector, iconType, message, theDelay) { + + // check typeof selector on + if (typeof selector !== 'string') { + notiflixConsoleError('Notiflix Error', 'The selector must be a String.'); + return false; + } + // check typeof selector off + + // check the delay on + if (typeof theDelay !== 'number') { + theDelay = 0; + } + // check the delay off + + // check the selector on + var getSelector = document.querySelectorAll(selector); + if (getSelector.length > 0) { + + // if not initialized pretend like init on + if (!newBlockSettings) { + Notiflix.Block.Init({}); + } + // if not initialized pretend like init off + + // check the message on + if (!message || (message && typeof message !== 'string')) { + message = undefined; + } + // check the message off + + } else { + notiflixConsoleError('Notiflix Error', 'You called the "Notiflix.Block..." function with "' + selector + '" selector, but there is no such element(s) on the document.'); + return false; + } + // check the selector off + + // if cssAnimaion false => duration on + if (!newBlockSettings.cssAnimation) { + newBlockSettings.cssAnimationDuration = 0; + } + // if cssAnimaion false => duration off + + // check the class name on + var blockClassName = 'notiflix-block'; + if (newBlockSettings.className && typeof newBlockSettings.className === 'string') { + blockClassName = newBlockSettings.className.trim(); + } + // check the class name off + + // check query limit on + var getQueryLimit = (typeof newBlockSettings.querySelectorLimit === 'number' ? newBlockSettings.querySelectorLimit : 200); + var checkQueryLimit = (getSelector.length >= getQueryLimit ? getQueryLimit : getSelector.length); + // check query limit off + + // block + if (block) { + + // add element(s) and style on + for (var i = 0; i < checkQueryLimit; i++) { + var eachSelector = getSelector[i]; + + // check block element exist on + var eachBlockElement = eachSelector.querySelectorAll('[id^=' + blockSettings.ID + ']'); + if (eachBlockElement.length < 1) { + + // check the icon on + var icon = ''; + if (iconType) { + if (iconType === 'hourglass') { + icon = notiflixIndicatorSvgHourglass(newBlockSettings.svgSize, newBlockSettings.svgColor); + } else if (iconType === 'circle') { + icon = notiflixIndicatorSvgCircle(newBlockSettings.svgSize, newBlockSettings.svgColor); + } else if (iconType === 'arrows') { + icon = notiflixIndicatorSvgArrows(newBlockSettings.svgSize, newBlockSettings.svgColor); + } else if (iconType === 'dots') { + icon = notiflixIndicatorSvgDots(newBlockSettings.svgSize, newBlockSettings.svgColor); + } else if (iconType === 'pulse') { + icon = notiflixIndicatorSvgPulse(newBlockSettings.svgSize, newBlockSettings.svgColor); + } else { + icon = notiflixIndicatorSvgStandard(newBlockSettings.svgSize, newBlockSettings.svgColor); + } + } + var intSvgSize = parseInt(newBlockSettings.svgSize); + var posRatio = Math.round(intSvgSize - (intSvgSize / 5)).toString() + 'px'; + var svgPosTop = (message && message.length > 0 ? '-' + posRatio : 0); + var iconElement = '' + icon + ''; + // check the icon off + + // check the message on + var messageElement = ''; + var messageHeight = 0; + if (message) { + if (message.length > newBlockSettings.messageMaxLength) { + message = notiflixPlaintext(message).toString().substring(0, newBlockSettings.messageMaxLength) + '...'; + } else { + message = notiflixPlaintext(message).toString(); + } + messageHeight = Math.round(parseInt(newBlockSettings.messageFontSize) * 1.4).toString() + 'px'; + messageElement = '' + message + ''; + } + // check the message off + + // block element on + notiflixBlockElementCounter++; + var notiflixBlockWrap = document.createElement('div'); + notiflixBlockWrap.id = blockSettings.ID + '-' + notiflixBlockElementCounter; + notiflixBlockWrap.className = blockClassName + '-wrap' + (newBlockSettings.cssAnimation ? ' with-animation' : ''); + notiflixBlockWrap.style.position = newBlockSettings.position; + notiflixBlockWrap.style.zIndex = newBlockSettings.zindex; + notiflixBlockWrap.style.background = newBlockSettings.backgroundColor; + notiflixBlockWrap.style.animationDuration = newBlockSettings.cssAnimationDuration + 'ms'; + notiflixBlockWrap.style.fontFamily = '"' + newBlockSettings.fontFamily + '"' + ', sans-serif'; + // block element off + + // block element rtl on + if (newBlockSettings.rtl) { + notiflixBlockWrap.setAttribute('dir', 'rtl'); + notiflixBlockWrap.classList.add('rtl-on'); + } + // block element rtl off + + // block element data on + notiflixBlockWrap.innerHTML = iconElement + messageElement; + // block element data off + + // append block element on + var eachSelectorPos = getComputedStyle(eachSelector).getPropertyValue('position'); + eachSelectorPos = eachSelectorPos && typeof eachSelectorPos === 'string' ? eachSelectorPos.toLowerCase() : 'relative'; + + // selector internal style on + var eachSelectorIdOrClass = ''; + if (eachSelector.getAttribute('id')) { + eachSelectorIdOrClass = '#' + eachSelector.getAttribute('id'); + } else if (eachSelector.classList[0]) { + eachSelectorIdOrClass = '.' + eachSelector.classList[0]; + } + + var positions = ['absolute', 'relative', 'fixed', 'sticky']; + if (positions.indexOf(eachSelectorPos) <= -1) { + var minHeight = Math.round((parseInt(messageHeight) + intSvgSize) * 1.5).toString() + 'px'; + var style = ''; + var styleRange = document.createRange(); + styleRange.selectNode(document.head); + var styleFragment = styleRange.createContextualFragment(style); + document.head.appendChild(styleFragment); + eachSelector.classList.add(blockClassName + '-position'); + } + // selector internal style off + + // append + eachSelector.appendChild(notiflixBlockWrap); + // append block element off + } + // check block element exist off + } + // add element(s) and style off + } + // unblock/remove + else { + + // Step 3 => Remove each block element on + var removeBlockElements = function (eachOne) { + var timeout = setTimeout(function () { + // remove element + eachOne.remove(); + + // remove this selector internal style + var eachOneId = eachOne.getAttribute('id'); + var eachOneStyle = document.getElementById('Style-' + eachOneId); + if (eachOneStyle) { + eachOneStyle.remove(); + } + + // clear timeout + clearTimeout(timeout); + }, newBlockSettings.cssAnimationDuration); + } + // Step 3 => Remove each block element off + + // Step 2A => Remove each block element on + var removeClassBlockElements = function (eachBlockElement) { + // if elements exist + if (eachBlockElement && eachBlockElement.length > 0) { + for (var i = 0; i < eachBlockElement.length; i++) { + var eachOne = eachBlockElement[i]; + if (eachOne) { + // add remove class + eachOne.classList.add('remove'); + // remove block elements + removeBlockElements(eachOne); + } + } + } + // not exist + else { + notiflixConsoleLog('Notiflix Info', '"Notiflix.Block.Remove();" function called with "' + selector + '" selector, but this selector does not have a "Notiflix.Block..." element to remove.'); + } + } + // Step 2A => Remove each block element on + + // Step 2B => Remove each selector class name on + var removeEachSelectorClassName = function (eachSelector) { + var timeout = setTimeout(function () { + // remove class name + var positionClass = blockClassName + '-position'; + eachSelector.classList.remove(positionClass); + + // clear timeout + clearTimeout(timeout); + }, newBlockSettings.cssAnimationDuration + 300); + } + // Step 2B => Remove each selector class name off + + // Step 1 => Remove selector class name on + var selectorTimeout = setTimeout(function () { + for (var i = 0; i < checkQueryLimit; i++) { + var eachSelector = getSelector[i]; + + // remove each selector class name + removeEachSelectorClassName(eachSelector); + + // remove each block element + eachBlockElement = eachSelector.querySelectorAll('[id^=' + blockSettings.ID + ']'); + removeClassBlockElements(eachBlockElement); + } + // clear timeout + clearTimeout(selectorTimeout); + }, theDelay); + // Step 1 => Remove selector class name off + } + }; + // Notiflix: Block or Unblock Element off + + + // Notiflix: Report SVG Success on + var notiflixReportSvgSuccess = function (width, color) { + if (!width) { width = '110px'; } + if (!color) { color = '#32c682'; } + var reportSvgSuccess = ''; + return reportSvgSuccess; + }; + // Notiflix: Report SVG Success off + + // Notiflix: Report SVG Failure on + var notiflixReportSvgFailure = function (width, color) { + if (!width) { width = '110px'; } + if (!color) { color = '#ff5549'; } + var reportSvgFailure = ''; + return reportSvgFailure; + }; + // Notiflix: Report SVG Failure off + + // Notiflix: Report SVG Warning on + var notiflixReportSvgWarning = function (width, color) { + if (!width) { width = '110px'; } + if (!color) { color = '#eebf31'; } + var reportSvgWarning = ''; + return reportSvgWarning; + }; + // Notiflix: Report SVG Warning off + + // Notiflix: Report SVG Info on + var notiflixReportSvgInfo = function (width, color) { + if (!width) { width = '110px'; } + if (!color) { color = '#26c0d3'; } + var reportSvgInfo = ''; + return reportSvgInfo; + }; + // Notiflix: Report SVG Info off + + + // Notiflix: Indicator SVG standard on + var notiflixIndicatorSvgStandard = function (width, color) { + if (!width) { width = '60px'; } + if (!color) { color = '#32c682'; } + var standard = ''; + return standard; + }; + // Notiflix: Indicator SVG standard off + + // Notiflix: Indicator SVG hourglass on + var notiflixIndicatorSvgHourglass = function (width, color) { + if (!width) { width = '60px'; } + if (!color) { color = '#32c682'; } + var hourglass = ' '; + return hourglass; + }; + // Notiflix: Indicator SVG hourglass off + + // Notiflix: Indicator SVG circle on + var notiflixIndicatorSvgCircle = function (width, color) { + if (!width) { width = '60px'; } + if (!color) { color = '#32c682'; } + var circle = ''; + return circle; + }; + // Notiflix: Indicator SVG circle off + + // Notiflix: Indicator SVG arrows on + var notiflixIndicatorSvgArrows = function (width, color) { + if (!width) { width = '60px'; } + if (!color) { color = '#32c682'; } + var arrows = ''; + return arrows; + }; + // Notiflix: Indicator SVG arrows off + + // Notiflix: Indicator SVG dots on + var notiflixIndicatorSvgDots = function (width, color) { + if (!width) { width = '60px'; } + if (!color) { color = '#32c682'; } + var dots = ' '; + return dots; + }; + // Notiflix: Indicator SVG dots off + + // Notiflix: Indicator SVG pulse on + var notiflixIndicatorSvgPulse = function (width, color) { + if (!width) { width = '60px'; } + if (!color) { color = '#32c682'; } + var pulse = ''; + return pulse; + }; + // Notiflix: Indicator SVG pulse off + + // Notiflix: Indicator SVG notiflix on + var notiflixIndicatorSvgNotiflix = function (width, white, green) { + if (!width) { width = '60px'; } + if (!white) { white = '#f8f8f8'; } + if (!green) { green = '#32c682'; } + var notiflixIcon = ''; + return notiflixIcon; + }; + // Notiflix: Indicator SVG notiflix off + + + /* + * 侧边滑出弹层插件 mSlider.js + * DH (https://denghao.me) + * 2018-07 + */ + // (function(b, c) { + // function a(d) { + // this.opts = { + // "direction": d.direction || "left", + // "distance": d.distance || "60%", + // "dom": this.Q(d.dom), + // "time": d.time || "", + // "maskClose": (d.maskClose + "").toString() !== "false" ? true : false, + // "callback": d.callback || "" + // }; + // this.rnd = this.rnd(); + // this.dom = this.opts.dom[0]; + // this.wrap = ""; + // this.inner = ""; + // this.mask = ""; + // this.init() + // } + // a.prototype = { + // Q: function(d) { + // return document.querySelectorAll(d) + // }, + // isMobile: function() { + // return navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i) ? true : false + // }, + // addEvent: function(f, e, d) { + // if (f.attachEvent) { + // f.attachEvent("on" + e, d) + // } else { + // f.addEventListener(e, d, false) + // } + // }, + // rnd: function() { + // return Math.random().toString(36).substr(2, 6) + // }, + // init: function() { + // var g = this; + // if (!g.dom) { + // console.log("未正确绑定弹窗容器"); + // return + // } + // var d = document.createElement("div"); + // var e = document.createElement("div"); + // var f = document.createElement("div"); + // d.setAttribute("class", "mSlider-main ms-" + g.rnd); + // e.setAttribute("class", "mSlider-inner"); + // f.setAttribute("class", "mSlider-mask"); + // g.Q("body")[0].appendChild(d); + // g.Q(".ms-" + g.rnd)[0].appendChild(e); + // g.Q(".ms-" + g.rnd)[0].appendChild(f); + // g.wrap = g.Q(".ms-" + g.rnd)[0]; + // g.inner = g.Q(".ms-" + g.rnd + " .mSlider-inner")[0]; + // g.mask = g.Q(".ms-" + g.rnd + " .mSlider-mask")[0]; + // g.inner.appendChild(g.dom); + // switch (g.opts.direction) { + // case "top": + // g.top = "0"; + // g.left = "0"; + // g.width = "100%"; + // g.height = g.opts.distance; + // g.translate = "0,-100%,0"; + // break; + // case "bottom": + // g.bottom = "0"; + // g.left = "0"; + // g.width = "100%"; + // g.height = g.opts.distance; + // g.translate = "0,100%,0"; + // break; + // case "right": + // g.top = "0"; + // g.right = "0"; + // g.width = g.opts.distance; + // g.height = document.documentElement.clientHeight + "px"; + // g.translate = "100%,0,0"; + // break; + // default: + // g.top = "0"; + // g.left = "0"; + // g.width = g.opts.distance; + // g.height = document.documentElement.clientHeight + "px"; + // g.translate = "-100%,0,0" + // } + // g.wrap.style.display = "none"; + // g.wrap.style.position = "fixed"; + // g.wrap.style.top = "0"; + // g.wrap.style.left = "0"; + // g.wrap.style.width = "100%"; + // g.wrap.style.height = "100%"; + // g.wrap.style.zIndex = 99; + // g.inner.style.position = "absolute"; + // g.inner.style.top = g.top; + // g.inner.style.bottom = g.bottom; + // g.inner.style.left = g.left; + // g.inner.style.right = g.right; + // g.inner.style.width = g.width; + // g.inner.style.height = g.height; + // g.inner.style.backgroundColor = "#fff"; + // g.inner.style.transform = "translate3d(" + g.translate + ")"; + // g.inner.style.webkitTransition = "all .2s ease-out"; + // g.inner.style.transition = "all .2s ease-out"; + // g.inner.style.zIndex = 100; + // g.mask.style.width = "100%"; + // g.mask.style.height = "100%"; + // g.mask.style.opacity = "0"; + // g.mask.style.backgroundColor = "black"; + // g.mask.style.zIndex = "98"; + // g.mask.style.webkitTransition = "all .2s ease-out"; + // g.mask.style.transition = "all .2s ease-out"; + // g.mask.style.webkitBackfaceVisibility = "hidden"; + // g.events() + // }, + // open: function() { + // var d = this; + // d.wrap.style.display = "block"; + + // setTimeout(function() { + // d.inner.style.transform = "translate3d(0,0,0)"; + // d.inner.style.webkitTransform = "translate3d(0,0,0)"; + // d.mask.style.opacity = 0.5 + // }, 30); + // if (d.opts.time) { + // d.timer = setTimeout(function() { + // d.close() + // }, d.opts.time) + // } + // }, + // close: function() { + // var d = this; + // d.timer && clearTimeout(d.timer); + // d.inner.style.webkitTransform = "translate3d(" + d.translate + ")"; + // d.inner.style.transform = "translate3d(" + d.translate + ")"; + // d.mask.style.opacity = 0; + // setTimeout(function() { + // d.wrap.style.display = "none"; + // d.timer = null; + // d.opts.callback && d.opts.callback() + // }, 300) + // }, + // events: function() { + // var d = this; + // d.addEvent(d.mask, "touchmove", function(f) { + // f.preventDefault() + // }); + // d.addEvent(d.mask, (d.isMobile() ? "touchend" : "click"), function(f) { + // if (d.opts.maskClose) { + // d.close() + // } + // }) + // } + // }; + // b.mSlider = a + // })(window); + + exports(MOD_NAME,pearOper); +}) + diff --git a/src/main/resources/static/component/pear/module/menu.js b/src/main/resources/static/component/pear/module/menu.js index c4fb8d6e..a5a83ad1 100644 --- a/src/main/resources/static/component/pear/module/menu.js +++ b/src/main/resources/static/component/pear/module/menu.js @@ -1,523 +1,549 @@ layui.define(['table', 'jquery', 'element'], function (exports) { - "use strict"; - - var MOD_NAME = 'menu', - $ = layui.jquery, - element = layui.element; - - var pearMenu = function (opt) { - this.option = opt; - }; - - pearMenu.prototype.render = function (opt) { - - var option = { - elem: opt.elem, - async: opt.async, - parseData: opt.parseData, - url: opt.url, - method: opt.method ? opt.method : "GET", - defaultOpen: opt.defaultOpen, - defaultSelect: opt.defaultSelect, - control: opt.control, - controlWidth: opt.controlWidth ? opt.controlWidth : 500, - defaultMenu: opt.defaultMenu, - accordion: opt.accordion, - height: opt.height, - theme: opt.theme, - data: opt.data ? opt.data : [], - change: opt.change ? opt.change : function () { }, - done: opt.done ? opt.done : function () { } - } - if (option.async) { - if (option.method === "GET") { - getData(option.url).then(function (data) { - option.data = data; - renderMenu(option); - }); - } else { - postData(option.url).then(function (data) { - option.data = data; - renderMenu(option); - }); - } - } else { - //renderMenu中需要调用done事件,done事件中需要menu对象,但是此时还未返回menu对象,做个延时提前返回对象 - window.setTimeout(function () { renderMenu(option); }, 500); - } + "use strict"; + + var MOD_NAME = 'menu', + $ = layui.jquery, + element = layui.element; + + var pearMenu = function (opt) { + this.option = opt; + }; + + pearMenu.prototype.render = function (opt) { + + var option = { + elem: opt.elem, + async: opt.async, + parseData: opt.parseData, + url: opt.url, + method: opt.method ? opt.method : "GET", + defaultOpen: opt.defaultOpen, + defaultSelect: opt.defaultSelect, + control: opt.control, + defaultMenu: opt.defaultMenu, + accordion: opt.accordion, + height: opt.height, + theme: opt.theme, + data: opt.data ? opt.data : [], + change: opt.change ? opt.change : function () { }, + done: opt.done ? opt.done : function () { } + } + var tempDone = option.done; + option.done = function(){ + if (option.control) { + rationalizeHeaderControlWidthAuto(option); + } + tempDone(); + } + + if (option.async) { + if (option.method === "GET") { + getData(option.url).then(function (data) { + option.data = data; + renderMenu(option); + }); + } else { + postData(option.url).then(function (data) { + option.data = data; + renderMenu(option); + }); + } + } else { + // 延时返回,和 javascript 执行时序关联 + window.setTimeout(function () { renderMenu(option); }, 500); + } + + // 处理高度 + $("#" + opt.elem).height(option.height) + + + return new pearMenu(option); + } + + pearMenu.prototype.click = function (clickEvent) { + var _this = this; + $("body").on("click", "#" + _this.option.elem + " .site-demo-active", function () { + var dom = $(this); + var data = { + menuId: dom.attr("menu-id"), + menuTitle: dom.attr("menu-title"), + menuPath: dom.attr("menu-title"), + menuIcon: dom.attr("menu-icon"), + menuUrl: dom.attr("menu-url"), + openType: dom.attr("open-type") + }; + var doms = hash(dom); + if (doms != null) { + if (doms.text() != '') { + data['menuPath'] = doms.find("span").text() + " / " + data['menuPath']; + } + } + if (doms != null) { + var domss = hash(doms); + if (domss != null) { + if (domss.text() != '') { + data['menuPath'] = domss.find("span").text() + " / " + data['menuPath']; + } + } + } + if (domss != null) { + var domsss = hash(domss); + if (domsss != null) { + if (domsss.text() != '') { + data['menuPath'] = domsss.find("span").text() + " / " + data['menuPath']; + } + } + } + if ($("#" + _this.option.elem).is(".pear-nav-mini")) { + if (_this.option.accordion) { + activeMenus = $(this).parent().parent().parent().children("a"); + } else { + activeMenus.push($(this).parent().parent().parent().children("a")); + } + } + clickEvent(dom, data); + }) + } + + function hash(dom) { + var d = dom.parent().parent().prev(); + if (d.prop("tagName") === "UL") { + return null; + } + return d; + } + + pearMenu.prototype.skin = function (skin) { + var menu = $(".pear-nav-tree[lay-filter='" + this.option.elem + "']").parent(); + menu.removeClass("dark-theme"); + menu.removeClass("light-theme"); + menu.addClass(skin); + } + + pearMenu.prototype.selectItem = function (pearId) { + if (this.option.control != false) { + $("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents(".layui-side-scroll ").find("ul").css({ + display: "none" + }); + $("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents(".layui-side-scroll ").find(".layui-this").removeClass( + "layui-this"); + $("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents("ul").css({ + display: "block" + }); + var controlId = $("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents("ul").attr("pear-id"); + if (controlId != undefined) { + $("#" + this.option.control).find(".layui-this").removeClass("layui-this"); + $("#" + this.option.control).find("[pear-id='" + controlId + "']").addClass("layui-this"); + } + } + + $("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents(".pear-nav-tree").find(".layui-this").removeClass( + "layui-this"); + if (!$("#" + this.option.elem).is(".pear-nav-mini")) { + var openEle = null; + var openEleHeight = 0; + $($("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents('.layui-nav-child').get().reverse()).each(function () { + if (!$(this).parent().is('.layui-nav-itemed')) { + if (openEleHeight == 0) { + openEle = $(this); + } else { + $(this).parent().addClass('layui-nav-itemed'); + $(this).css({ + height: 'auto', + }); + } + openEleHeight += $(this).children("dd").length * 48; + } + }); + if (this.option.accordion) { + if (openEleHeight > 0) { + var currentDom = openEle.parent().siblings('.layui-nav-itemed').children(".layui-nav-child"); + currentDom.animate({ + height: "0px" + }, 240, function () { + currentDom.css({ + height: "auto" + }); + $(this).parent().removeClass("layui-nav-itemed"); + $(this).find('.layui-nav-itemed').removeClass("layui-nav-itemed"); + }); + } + } + if (openEleHeight > 0) { + openEle.parent().addClass("layui-nav-itemed"); + openEle.height(0); + openEle.animate({ + height: openEleHeight + "px" + }, 240, function () { + $(this).css({ height: 'auto' }); + }); + } + } + $("#" + this.option.elem + " a[menu-id='" + pearId + "']").parent().addClass("layui-this"); + } + + var activeMenus; + pearMenu.prototype.collapse = function (time) { + var elem = this.option.elem; + var config = this.option; + if ($("#" + this.option.elem).is(".pear-nav-mini")) { + $.each(activeMenus, function (i, item) { + $("#" + elem + " a[menu-id='" + $(this).attr("menu-id") + "']").parent().addClass("layui-nav-itemed"); + }) + $("#" + this.option.elem).removeClass("pear-nav-mini"); + $("#" + this.option.elem).animate({ + width: "220px" + }, 180); + isHoverMenu(false, config); + var that = this; + $("#" + this.option.elem) + .promise() + .done(function () { + if (that.option.control) { + rationalizeHeaderControlWidth(that.option); + } + }) + } else { + activeMenus = $("#" + this.option.elem).find(".layui-nav-itemed>a"); + $("#" + this.option.elem).find(".layui-nav-itemed").removeClass("layui-nav-itemed"); + $("#" + this.option.elem).addClass("pear-nav-mini"); + $("#" + this.option.elem).animate({ + width: "60px" + }, 400); + var that = this; + $("#" + this.option.elem) + .promise() + .done(function () { + isHoverMenu(true, config); + if (that.option.control) { + rationalizeHeaderControlWidth(that.option); + } + }) + } + } + + function getData(url) { + var defer = $.Deferred(); + var symbol = url.indexOf('?') !== -1 ? '&' : '?'; + $.get(url + symbol + "fresh=" + Math.random(), function (result) { + defer.resolve(result) + }); + return defer.promise(); + } + + function postData(url) { + var defer = $.Deferred(); + var symbol = url.indexOf('?') !== -1 ? '&' : '?'; + $.post(url + symbol + "fresh=" + Math.random(), function (result) { + defer.resolve(result) + }, "json"); + return defer.promise(); + } + + function renderMenu(option) { + if (option.parseData != false) { + option.parseData(option.data); + } + if (option.data.length > 0) { + if (option.control != false) { + createMenuAndControl(option); + } else { + createMenu(option); + } + } + element.init(); + option.done(); + } + + function createMenu(option) { + var menuHtml = '
                ' + $.each(option.data, function (i, item) { + var content = '
              • '; + if (i == option.defaultOpen) { + content = '
              • '; + } + var href = "javascript:;"; + var target = ""; + var className = "site-demo-active" + if (item.openType == "_blank" && item.type == 1) { + href = item.href; + target = "target='_blank'"; + className = ""; + } + if (item.type == 0) { + // 创 建 目 录 结 构 + content += '' + item.title + + ''; + } else if (item.type == 1) { + content += '' + item.title + ''; + } + // 调 用 递 归 方 法 加 载 无 限 层 级 的 子 菜 单 + content += loadchild(item); + // 结 束 一 个 根 菜 单 项 + content += '
              • '; + menuHtml += content; + }); + // 结 束 菜 单 结 构 的 初 始 化 + menuHtml += "
              "; + // 将 菜 单 拼 接 到 初 始 化 容 器 中 + $("#" + option.elem).html(menuHtml); + } + + function createMenuAndControl(option) { + var control = '
                '; + control+= '
              • '; + var controlPe = '
                  '; + // 声 明 头 部 + var menu = '
                  ' + // 开 启 同 步 操 作 + var index = 0; + var controlItemPe = '
                  '; + $.each(option.data, function (i, item) { + var menuItem = ''; + var controlItem = ''; + if (i === option.defaultMenu) { + controlItem = '
                • ' + item.title + '
                • '; + menuItem = '
                    '; + + controlPe += '
                  • ' + item.title + ''; + + controlItemPe += '
                    ' + item.title + '
                    '; + } else { + + controlItem = '
                  • ' + item.title + '
                  • '; + + menuItem = ''; + control += controlItem; + }) + controlItemPe += "
                " + controlPe += controlItemPe; + $("#" + option.control).html(control + "
              "); + $("#" + option.control).append(controlPe); + $("#" + option.elem).html(menu); + $("#" + option.control + " .pear-nav-control").on("click", "[pear-id]", function () { + $("#" + option.elem).find(".pear-nav-tree").css({ + display: 'none' + }); + $("#" + option.elem).find(".pear-nav-tree[pear-id='" + $(this).attr("pear-id") + "']").css({ + display: 'block' + }); + $("#" + option.control).find(".pe-title").html($(this).attr("pear-title")); + $("#" + option.control).find("") + option.change($(this).attr("pear-id"), $(this).attr("pear-title"), $(this).attr("pear-href")) + }) + } + + /** 加载子菜单 (递归)*/ + function loadchild(obj) { + // 判 单 是 否 是 菜 单, 如 果 是 菜 单 直 接 返 回 + if (obj.type == 1) { + return ""; + } + // 创 建 子 菜 单 结 构 + var content = '
              '; + // 如 果 嵌 套 不 等 于 空 + if (obj.children != null && obj.children.length > 0) { + // 遍 历 子 项 目 + $.each(obj.children, function (i, note) { + // 创 建 子 项 结 构 + content += '
              '; + var href = "javascript:;"; + var target = ""; + var className = "site-demo-active"; + if (note.openType == "_blank" && note.type == 1) { + href = note.href; + target = "target='_blank'"; + className = ""; + } + // 判 断 子 项 类 型 + if (note.type == 0) { + // 创 建 目 录 结 构 + content += '' + note.title + ''; + } else if (note.type == 1) { + // 创 建 菜 单 结 构 + content += '' + note.title + ''; + } + // 加 载 子 项 目 录 + content += loadchild(note); + // 结 束 当 前 子 菜 单 + content += '
              '; + }); + // 封 装 + } else { + content += '
              目录为空
              '; + } + content += '
              '; + return content; + } + + /** 二 级 悬 浮 菜 单*/ + function isHoverMenu(b, option) { + if (b) { + var navItem = "#" + option.elem + ".pear-nav-mini .layui-nav-item"; + var navChildDl = navItem + " .layui-nav-child>dl"; + var navChildDd = navItem + " .layui-nav-child>dd"; + + $(navItem + "," + navChildDd).mouseenter(function () { + var _this = $(this); + _this.siblings().find(".layui-nav-child") + .removeClass("layui-nav-hover").css({ + left: 0, + top: 0 + }); + _this.children(".layui-nav-child").addClass("layui-nav-hover"); + var height = $(window).height(); + var topLength = _this.offset().top; + var thisHeight = _this.children(".layui-nav-child").height(); + if ((thisHeight + topLength) > height) { + topLength = height - thisHeight - 10; + } + var left = _this.offset().left + 60; + if (!_this.hasClass("layui-nav-item")) { + left = _this.offset().left + _this.width(); + } + _this.children(".layui-nav-child").offset({ + top: topLength, + left: left + }); + }); + + $(navItem + "," + navChildDl).mouseleave(function () { + var _this = $(this); + _this.closest('.layui-nav-item') + .find(".layui-nav-child") + .removeClass("layui-nav-hover") + .css({ + left: 0, + top: 0 + }); + }); + + } else { + $("#" + option.elem + " .layui-nav-item").off('mouseenter').unbind('mouseleave'); + $("#" + option.elem + " dd").off('mouseenter').unbind('mouseleave'); + } + } + + function rationalizeHeaderControlWidth(option) { + var $headerControl = $("#" + option.control); + var $nextEl = $headerControl.next(); + var rationalizeWidth; + if ($nextEl.length) { + rationalizeWidth = $nextEl.position().left - $headerControl.position().left; + } else { + rationalizeWidth = $headerControl.parent().innerWidth() - $headerControl.position().left; + } + + $("#" + option.control + " .control").css({"width": rationalizeWidth}); + + var navobj = $("#" + option.control+' ul.pear-nav-control.pc'); + var dropdown = $(".tabdrop", navobj); + + var collection = 0; + var maxwidth = rationalizeWidth - 60; + + var liwidth = 0; + //检查超过一行的标签页 + $('.tabdrop').find('dd').each(function(){ + var newLI = $('
            • ').html($(this).html()); + newLI.addClass('layui-nav-item'); + newLI.attr('pear-href', $(this).attr('pear-href')); + newLI.attr('pear-title', $(this).attr('pear-title')); + newLI.attr('pear-id', $(this).attr('pear-id')); + navobj.append(newLI); + $(this).remove(); - // 处理高度 - $("#" + opt.elem).height(option.height) - - setTimeout(function () { - $("#" + opt.control + " .control").on("mousewheel DOMMouseScroll", function (event) { - - var delta = (event.originalEvent.wheelDelta && (event.originalEvent.wheelDelta > 0 ? 1 : -1)) || // chrome & ie - (event.originalEvent.detail && (event.originalEvent.detail > 0 ? -1 : 1)); // firefox - - if (delta > 0) { - for (var num = 1; num < 20; num++) { - setTimeout(function () { - if ($("#" + opt.control + " .control ul").css('left').replace("px", "") < 0) { - $("#" + opt.control + " .control ul").css("left", "+=2px"); - } - }, 10) - } - } else if (delta < 0) { - if (((Number)($("#" + opt.control + " .control ul").css("left").replace("px", "")) + ($("#" + opt.control + " .control ul").width() - $("#" + opt.control + " .control").width())) > 0) { - for (var num = 1; num < 20; num++) { - setTimeout(function () { - $("#" + opt.control + " .control ul").css("left", "-=2px"); - }, 10) - } - } - } - }); - }, 1000) - - return new pearMenu(option); - } - - pearMenu.prototype.click = function (clickEvent) { - var _this = this; - $("body").on("click", "#" + _this.option.elem + " .site-demo-active", function () { - var dom = $(this); - var data = { - menuId: dom.attr("menu-id"), - menuTitle: dom.attr("menu-title"), - menuPath: dom.attr("menu-title"), - menuIcon: dom.attr("menu-icon"), - menuUrl: dom.attr("menu-url"), - openType: dom.attr("open-type") - }; - var doms = hash(dom); - if (doms != null) { - if (doms.text() != '') { - data['menuPath'] = doms.find("span").text() + " / " + data['menuPath']; - } - } - if (doms != null) { - var domss = hash(doms); - if (domss != null) { - if (domss.text() != '') { - data['menuPath'] = domss.find("span").text() + " / " + data['menuPath']; - } - } - } - if (domss != null) { - var domsss = hash(domss); - if (domsss != null) { - if (domsss.text() != '') { - data['menuPath'] = domsss.find("span").text() + " / " + data['menuPath']; - } - } - } - if ($("#" + _this.option.elem).is(".pear-nav-mini")) { - if (_this.option.accordion) { - activeMenus = $(this).parent().parent().parent().children("a"); - } else { - activeMenus.push($(this).parent().parent().parent().children("a")); - } - } - clickEvent(dom, data); }) - } - - function hash(dom) { - var d = dom.parent().parent().prev(); - if (d.prop("tagName") === "UL") { - return null; - } - return d; - } - - pearMenu.prototype.skin = function (skin) { - var menu = $(".pear-nav-tree[lay-filter='" + this.option.elem + "']").parent(); - menu.removeClass("dark-theme"); - menu.removeClass("light-theme"); - menu.addClass(skin); - } - - pearMenu.prototype.selectItem = function (pearId) { - if (this.option.control != false) { - $("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents(".layui-side-scroll ").find("ul").css({ - display: "none" - }); - $("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents(".layui-side-scroll ").find(".layui-this").removeClass( - "layui-this"); - $("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents("ul").css({ - display: "block" - }); - var controlId = $("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents("ul").attr("pear-id"); - if (controlId != undefined) { - $("#" + this.option.control).find(".layui-this").removeClass("layui-this"); - $("#" + this.option.control).find("[pear-id='" + controlId + "']").addClass("layui-this"); - } - } - - $("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents(".pear-nav-tree").find(".layui-this").removeClass( - "layui-this"); - if (!$("#" + this.option.elem).is(".pear-nav-mini")) { - let openEle = null; - let openEleHeight = 0; - $($("#" + this.option.elem + " a[menu-id='" + pearId + "']").parents('.layui-nav-child').get().reverse()).each(function () { - if (!$(this).parent().is('.layui-nav-itemed')) { - if (openEleHeight == 0) { - openEle = $(this); - } else { - $(this).parent().addClass('layui-nav-itemed'); - $(this).css({ - height: 'auto', - }); - } - openEleHeight += $(this).children("dd").length * 48; - } - }); - if (this.option.accordion) { - if (openEleHeight > 0) { - var currentDom = openEle.parent().siblings('.layui-nav-itemed').children(".layui-nav-child"); - currentDom.animate({ - height: "0px" - }, 240, function () { - currentDom.css({ - height: "auto" - }); - $(this).parent().removeClass("layui-nav-itemed"); - $(this).find('.layui-nav-itemed').removeClass("layui-nav-itemed"); - }); - } - } - if (openEleHeight > 0) { - openEle.parent().addClass("layui-nav-itemed"); - openEle.height(0); - openEle.animate({ - height: openEleHeight + "px" - }, 240, function () { - $(this).css({ height: 'auto' }); - }); - } - } - $("#" + this.option.elem + " a[menu-id='" + pearId + "']").parent().addClass("layui-this"); - } - - var activeMenus; - pearMenu.prototype.collapse = function (time) { - var elem = this.option.elem; - var config = this.option; - if ($("#" + this.option.elem).is(".pear-nav-mini")) { - $.each(activeMenus, function (i, item) { - $("#" + elem + " a[menu-id='" + $(this).attr("menu-id") + "']").parent().addClass("layui-nav-itemed"); - }) - $("#" + this.option.elem).removeClass("pear-nav-mini"); - $("#" + this.option.elem).animate({ - width: "220px" - }, 150); - isHoverMenu(false, config); - } else { - activeMenus = $("#" + this.option.elem).find(".layui-nav-itemed>a"); - $("#" + this.option.elem).find(".layui-nav-itemed").removeClass("layui-nav-itemed"); - $("#" + this.option.elem).addClass("pear-nav-mini"); - $("#" + this.option.elem).animate({ - width: "60px" - }, 400); - // 使菜单在折叠动画过程中不触发 hover - setTimeout(function () { - isHoverMenu(true, config); - }, 100); - } - } + var litabs = navobj.find('>li').not('.tabdrop'); - function getData(url) { - var defer = $.Deferred(); - var symbol = url.indexOf('?') !== -1 ? '&' : '?'; - $.get(url + symbol + "fresh=" + Math.random(), function (result) { - defer.resolve(result) - }); - return defer.promise(); - } - - function postData(url) { - var defer = $.Deferred(); - var symbol = url.indexOf('?') !== -1 ? '&' : '?'; - $.post(url + symbol + "fresh=" + Math.random(), function (result) { - defer.resolve(result) - }, "json"); - return defer.promise(); - } - - function renderMenu(option) { - if (option.parseData != false) { - option.parseData(option.data); - } - if (option.data.length > 0) { - if (option.control != false) { - createMenuAndControl(option); - } else { - createMenu(option); - } - } - element.init(); - downShow(option); - option.done(); - } - - function createMenu(option) { - var menuHtml = '
                ' - $.each(option.data, function (i, item) { - var content = '
              • '; - if (i == option.defaultOpen) { - content = '
              • '; - } - var href = "javascript:;"; - var target = ""; - var className = "site-demo-active" - if (item.openType == "_blank" && item.type == 1) { - href = item.href; - target = "target='_blank'"; - className = ""; - } - if (item.type == 0) { - // 创 建 目 录 结 构 - content += '' + item.title + - ''; - } else if (item.type == 1) { - content += '' + item.title + ''; - } - // 调 用 递 归 方 法 加 载 无 限 层 级 的 子 菜 单 - content += loadchild(item); - // 结 束 一 个 根 菜 单 项 - content += '
              • '; - menuHtml += content; + var totalwidth = 0; + litabs.each(function () { + totalwidth += $(this).outerWidth(true); }); - // 结 束 菜 单 结 构 的 初 始 化 - menuHtml += "
              "; - // 将 菜 单 拼 接 到 初 始 化 容 器 中 - $("#" + option.elem).html(menuHtml); - } - - function createMenuAndControl(option) { - var control = '
                '; - var controlPe = '
                  '; - // 声 明 头 部 - var menu = '
                  ' - // 开 启 同 步 操 作 - var index = 0; - var controlItemPe = '
                  '; - $.each(option.data, function (i, item) { - var menuItem = ''; - var controlItem = ''; - if (i === option.defaultMenu) { - controlItem = '
                • ' + item.title + '
                • '; - menuItem = '
                    '; - - controlPe += '
                  • ' + item.title + ''; - - controlItemPe += '
                    ' + item.title + '
                    '; - } else { - - controlItem = '
                  • ' + item.title + '
                  • '; - - menuItem = ''; - control += controlItem; - }) - controlItemPe += "
                " - controlPe += controlItemPe; - $("#" + option.control).html(control + "
              "); - $("#" + option.control).append(controlPe); - $("#" + option.elem).html(menu); - $("#" + option.control + " .pear-nav-control").on("click", "[pear-id]", function () { - $("#" + option.elem).find(".pear-nav-tree").css({ - display: 'none' }); - $("#" + option.elem).find(".pear-nav-tree[pear-id='" + $(this).attr("pear-id") + "']").css({ - display: 'block' - }); - $("#" + option.control).find(".pe-title").html($(this).attr("pear-title")); - $("#" + option.control).find("") - option.change($(this).attr("pear-id"), $(this).attr("pear-title"), $(this).attr("pear-href")) - }) - } - - /** 加载子菜单 (递归)*/ - function loadchild(obj) { - // 判 单 是 否 是 菜 单, 如 果 是 菜 单 直 接 返 回 - if (obj.type == 1) { - return ""; - } - // 创 建 子 菜 单 结 构 - var content = '
              '; - // 如 果 嵌 套 不 等 于 空 - if (obj.children != null && obj.children.length > 0) { - // 遍 历 子 项 目 - $.each(obj.children, function (i, note) { - // 创 建 子 项 结 构 - content += '
              '; - var href = "javascript:;"; - var target = ""; - var className = "site-demo-active"; - if (note.openType == "_blank" && note.type == 1) { - href = note.href; - target = "target='_blank'"; - className = ""; - } - // 判 断 子 项 类 型 - if (note.type == 0) { - // 创 建 目 录 结 构 - content += '' + note.title + ''; - } else if (note.type == 1) { - // 创 建 菜 单 结 构 - content += '' + note.title + ''; - } - // 加 载 子 项 目 录 - content += loadchild(note); - // 结 束 当 前 子 菜 单 - content += '
              '; - }); - // 封 装 - } else { - content += '
              目录为空
              '; - } - content += '
              '; - return content; - } - - function downShow(option) { - $("body #" + option.elem).on("click", "a[menu-type='0']", function () { - if (!$("#" + option.elem).is(".pear-nav-mini")) { - var superEle = $(this).parent(); - var ele = $(this).next('.layui-nav-child'); - var heights = ele.children("dd").length * 48; - - if ($(this).parent().is(".layui-nav-itemed")) { - if (option.accordion) { - var currentDom = $(this).parent().siblings('.layui-nav-itemed').children('.layui-nav-child'); - currentDom.animate({ - height: '0px' - }, 240, function () { - currentDom.css({ - height: "auto", - }); - $(this).parent().removeClass("layui-nav-itemed"); - $(this).find('.layui-nav-itemed').removeClass("layui-nav-itemed"); - }); - } - ele.height(0); - ele.animate({ - height: heights + "px" - }, 240, function () { - ele.css({ - height: "auto" - }); - }); + if (collection > 0) { + dropdown.removeClass('layui-hide'); + if (dropdown.find('.active').length === 1) { + dropdown.addClass('active'); } else { - $(this).parent().addClass("layui-nav-itemed"); - ele.animate({ - height: "0px" - }, 240, function () { - ele.css({ - height: "auto" - }); - $(this).parent().removeClass("layui-nav-itemed"); - }); + dropdown.removeClass('active'); } } - }) - } - - /** 二 级 悬 浮 菜 单*/ - function isHoverMenu(b, option) { - if (b) { - var navItem = "#" + option.elem + ".pear-nav-mini .layui-nav-item"; - var navChildDl = navItem + " .layui-nav-child>dl"; - var navChildDd = navItem + " .layui-nav-child>dd"; - - $(navItem + "," + navChildDd).mouseenter(function () { - var _this = $(this); - _this.siblings().find(".layui-nav-child") - .removeClass("layui-nav-hover").css({ - left: 0, - top: 0 - }); - _this.children(".layui-nav-child").addClass("layui-nav-hover"); - var height = $(window).height(); - var topLength = _this.offset().top; - var thisHeight = _this.children(".layui-nav-child").height(); - if ((thisHeight + topLength) > height) { - topLength = height - thisHeight - 10; - } - var left = _this.offset().left + 60; - if (!_this.hasClass("layui-nav-item")) { - left = _this.offset().left + _this.width(); - } - _this.children(".layui-nav-child").offset({ - top: topLength, - left: left - }); - }); + }else { + dropdown.addClass('layui-hide'); + } + } - $(navItem + "," + navChildDl).mouseleave(function () { - var _this = $(this); - _this.closest('.layui-nav-item') - .find(".layui-nav-child") - .removeClass("layui-nav-hover") - .css({ - left: 0, - top: 0 - }); - }); + function rationalizeHeaderControlWidthAuto(option){ + $(window).on('resize', function () { + rationalizeHeaderControlWidth(option); + }) - } else { - $("#" + option.elem + " .layui-nav-item").off('mouseenter').unbind('mouseleave'); - $("#" + option.elem + " dd").off('mouseenter').unbind('mouseleave'); - } - } - exports(MOD_NAME, new pearMenu()); -}) \ No newline at end of file + $(document).ready(function () { + rationalizeHeaderControlWidth(option); + }); + } + + exports(MOD_NAME, new pearMenu()); +}) diff --git a/src/main/resources/static/component/pear/module/message.js b/src/main/resources/static/component/pear/module/message.js index ba152a7a..54e96bd3 100644 --- a/src/main/resources/static/component/pear/module/message.js +++ b/src/main/resources/static/component/pear/module/message.js @@ -1,98 +1,140 @@ layui.define(['table', 'jquery', 'element'], function (exports) { - "use strict"; - - var MOD_NAME = 'message', - $ = layui.jquery, - element = layui.element; - - var message = function (opt) { - this.option = opt; - }; - - message.prototype.render = function (opt) { - //默认配置值 - var option = { - elem: opt.elem, - url: opt.url ? opt.url : false, - height: opt.height, - data: opt.data - } - if (option.url != false) { - option.data = getData(option.url); - var notice = createHtml(option); - $(option.elem).html(notice); - } - setTimeout(function () { - element.init(); - $(opt.elem + " li").click(function (e) { - $(this).siblings().removeClass('pear-this'); - $(this).addClass('pear-this'); - }) - }, 300); - return new message(option); - } - - message.prototype.click = function (callback) { - $("*[notice-id]").click(function (event) { - event.preventDefault(); - var id = $(this).attr("notice-id"); - var title = $(this).attr("notice-title"); - var context = $(this).attr("notice-context"); - var form = $(this).attr("notice-form"); - callback(id, title, context, form); - }) - } - - /** 同 步 请 求 获 取 数 据 */ - function getData(url) { - $.ajaxSettings.async = false; - var data = null; - $.get(url, function (result) { - data = result; - }); - $.ajaxSettings.async = true; - return data; - } - - function createHtml(option) { - - var count = 0; - var noticeTitle = '
                '; - var noticeContent = '
                '; - - // 根据 data 便利数据 - $.each(option.data, function (i, item) { - - if (i === 0) { - noticeTitle += '
              • ' + item.title + '
              • '; - noticeContent += '
                '; - } else { - noticeTitle += '
              • ' + item.title + '
              • '; - noticeContent += '
                '; - } - - $.each(item.children, function (i, note) { - noticeContent += '
                ' + - '' + - '
                ' + note.title + '
                ' + - '
                ' + note.createTime + '
                ' + - '
                '; - }) - noticeContent += '
                '; - }) - - var notice = '
              • ' + - '
              • ' + - '
                '; - - noticeTitle += '
              '; - noticeContent += '
              '; - notice += noticeTitle; - notice += noticeContent; - notice += ''; - return notice; - } - - exports(MOD_NAME, new message()); -}) \ No newline at end of file + "use strict"; + + var MOD_NAME = 'message', + $ = layui.jquery, + element = layui.element; + + var message = function (opt) { + this.option = opt; + }; + + message.prototype.render = function (opt) { + //默认配置值 + var option = { + elem: opt.elem, + url: opt.url ? opt.url : false, + height: opt.height, + data: opt.data + } + if (option.url != false) { + option.data = getData(option.url); + var notice = createHtml(option); + $(option.elem).html(notice); + var targetNode = document.querySelector(option.elem + ' .pear-notice') + var mutationObserver = new MutationObserver(function (mutationsList, observer) { + if (getComputedStyle(targetNode).display !== 'none') { + var rect = targetNode.getBoundingClientRect(); + //是否超出右侧屏幕 + if (rect.right > $(window).width()) { + var elemRight = document.querySelector(option.elem).getBoundingClientRect().right; + var offsetRight = 20; + targetNode.style.right = elemRight - $(window).width() + offsetRight + 'px'; + targetNode.style.left = 'unset'; + } + } + }); + mutationObserver.observe(targetNode, { + attributes: true, + childList: false, + subtree: false, + attributeOldValue: false, + attributeFilter: ['class'] + }); + } + setTimeout(function () { + element.init(); + $(opt.elem + " li").click(function (e) { + $(this).siblings().removeClass('pear-this'); + $(this).addClass('pear-this'); + }) + }, 300); + return new message(option); + } + + message.prototype.click = function (callback) { + $("*[notice-id]").click(function (event) { + event.preventDefault(); + var id = $(this).attr("notice-id"); + var title = $(this).attr("notice-title"); + var context = $(this).attr("notice-context"); + var form = $(this).attr("notice-form"); + callback(id, title, context, form); + }) + } + + /** 刷 新 消 息 */ + message.prototype.reload = function () { + + } + + /** 同 步 请 求 获 取 数 据 */ + function getData(url) { + $.ajaxSettings.async = false; + var data = null; + $.get(url, function (result) { + data = result; + }); + $.ajaxSettings.async = true; + return data; + } + + function createHtml(option) { + + var count = 0; + var noticeTitle = '
                '; + var noticeContent = '
                '; + + + // 根据 data 便利数据 + $.each(option.data, function (i, item) { + + if (i === 0) { + noticeTitle += '
              • ' + item.title + '
              • '; + noticeContent += '
                '; + } else { + noticeTitle += '
              • ' + item.title + '
              • '; + noticeContent += '
                '; + } + + $.each(item.children, function (i, note) { + count++; + noticeContent += '
                ' ; + + if (note.avatar) + noticeContent +=''; + + noticeContent +='
                ' + note.title + '
                ' + + '
                ' + note.time + '
                ' + + '
                '; + }) + + // 空内容 + if(item.children.length==0){ + noticeContent +='

                暂无数据

                '; + } + noticeContent += '
                '; + }) + + var notice; + if (count > 0){ + notice = '
              • ' + + '' + + '
                '; + }else { + notice = '
              • ' + + '' + + '
                '; + } + + noticeTitle += '
              '; + noticeContent += ''; + notice += noticeTitle; + notice += noticeContent; + notice += ''; + return notice; + } + + exports(MOD_NAME, new message()); +}) diff --git a/src/main/resources/static/component/pear/module/notice.js b/src/main/resources/static/component/pear/module/notice.js index 9ac84742..4ea67ec8 100644 --- a/src/main/resources/static/component/pear/module/notice.js +++ b/src/main/resources/static/component/pear/module/notice.js @@ -1,489 +1,489 @@ (function(define) { - define(['jquery'], function($) { - return (function() { - var $container; - var listener; - var toastId = 0; - var toastType = { - error: 'error', - info: 'info', - success: 'success', - warning: 'warning' - }; - - var cssStyle = $( - '' - ); - $("body").append(cssStyle); - - var toastr = { - clear: clear, - remove: remove, - error: error, - getContainer: getContainer, - info: info, - options: {}, - subscribe: subscribe, - success: success, - version: '2.1.4', - warning: warning - }; - - var previousToast; - - return toastr; - - function error(message, title, optionsOverride) { - return notify({ - type: toastType.error, - iconClass: getOptions().iconClasses.error, - message: message, - optionsOverride: optionsOverride, - title: title - }); - } - - function getContainer(options, create) { - if (!options) { - options = getOptions(); - } - $container = $('#' + options.containerId); - if ($container.length) { - return $container; - } - if (create) { - $container = createContainer(options); - } - return $container; - } - - function info(message, title, optionsOverride) { - return notify({ - type: toastType.info, - iconClass: getOptions().iconClasses.info, - message: message, - optionsOverride: optionsOverride, - title: title - }); - } - - function subscribe(callback) { - listener = callback; - } - - function success(message, title, optionsOverride) { - return notify({ - type: toastType.success, - iconClass: getOptions().iconClasses.success, - message: message, - optionsOverride: optionsOverride, - title: title - }); - } - - function warning(message, title, optionsOverride) { - return notify({ - type: toastType.warning, - iconClass: getOptions().iconClasses.warning, - message: message, - optionsOverride: optionsOverride, - title: title - }); - } - - function clear($toastElement, clearOptions) { - var options = getOptions(); - if (!$container) { - getContainer(options); - } - if (!clearToast($toastElement, options, clearOptions)) { - clearContainer(options); - } - } - - function remove($toastElement) { - var options = getOptions(); - if (!$container) { - getContainer(options); - } - if ($toastElement && $(':focus', $toastElement).length === 0) { - removeToast($toastElement); - return; - } - if ($container.children().length) { - $container.remove(); - } - } - - // internal functions - - function clearContainer(options) { - var toastsToClear = $container.children(); - for (var i = toastsToClear.length - 1; i >= 0; i--) { - clearToast($(toastsToClear[i]), options); - } - } - - function clearToast($toastElement, options, clearOptions) { - var force = clearOptions && clearOptions.force ? clearOptions.force : false; - if ($toastElement && (force || $(':focus', $toastElement).length === 0)) { - $toastElement[options.hideMethod]({ - duration: options.hideDuration, - easing: options.hideEasing, - complete: function() { - removeToast($toastElement); - } - }); - return true; - } - return false; - } - - function createContainer(options) { - $container = $('
              ') - .attr('id', options.containerId) - .addClass(options.positionClass); - - $container.appendTo($(options.target)); - return $container; - } - - function getDefaults() { - return { - tapToDismiss: true, - toastClass: 'toast', - containerId: 'toast-container', - debug: false, - - showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery - showDuration: 300, - showEasing: 'swing', //swing and linear are built into jQuery - onShown: undefined, - hideMethod: 'fadeOut', - hideDuration: 1000, - hideEasing: 'swing', - onHidden: undefined, - closeMethod: false, - closeDuration: false, - closeEasing: false, - closeOnHover: true, - - extendedTimeOut: 1000, - iconClasses: { - error: 'toast-error', - info: 'toast-info', - success: 'toast-success', - warning: 'toast-warning' - }, - iconClass: 'toast-info', - positionClass: 'toast-top-right', - timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to make it sticky - titleClass: 'toast-title', - messageClass: 'toast-message', - escapeHtml: false, - target: 'body', - closeHtml: '', - closeClass: 'toast-close-button', - newestOnTop: true, - preventDuplicates: false, - progressBar: false, - progressClass: 'toast-progress', - rtl: false - }; - } - - function publish(args) { - if (!listener) { - return; - } - listener(args); - } - - function notify(map) { - var options = getOptions(); - var iconClass = map.iconClass || options.iconClass; - - if (typeof(map.optionsOverride) !== 'undefined') { - options = $.extend(options, map.optionsOverride); - iconClass = map.optionsOverride.iconClass || iconClass; - } - - if (shouldExit(options, map)) { - return; - } - - toastId++; - - $container = getContainer(options, true); - - var intervalId = null; - var $toastElement = $('
              '); - var $titleElement = $('
              '); - var $messageElement = $('
              '); - var $progressElement = $('
              '); - var $closeElement = $(options.closeHtml); - var progressBar = { - intervalId: null, - hideEta: null, - maxHideTime: null - }; - var response = { - toastId: toastId, - state: 'visible', - startTime: new Date(), - options: options, - map: map - }; - - personalizeToast(); - - displayToast(); - - handleEvents(); - - publish(response); - - if (options.debug && console) { - console.log(response); - } - - return $toastElement; - - function escapeHtml(source) { - if (source == null) { - source = ''; - } - - return source - .replace(/&/g, '&') - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(//g, '>'); - } - - function personalizeToast() { - setIcon(); - setTitle(); - setMessage(); - setCloseButton(); - setProgressBar(); - setRTL(); - setSequence(); - setAria(); - } - - function setAria() { - var ariaValue = ''; - switch (map.iconClass) { - case 'toast-success': - case 'toast-info': - ariaValue = 'polite'; - break; - default: - ariaValue = 'assertive'; - } - $toastElement.attr('aria-live', ariaValue); - } - - function handleEvents() { - if (options.closeOnHover) { - $toastElement.hover(stickAround, delayedHideToast); - } - - if (!options.onclick && options.tapToDismiss) { - $toastElement.click(hideToast); - } - - if (options.closeButton && $closeElement) { - $closeElement.click(function(event) { - if (event.stopPropagation) { - event.stopPropagation(); - } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) { - event.cancelBubble = true; - } - - if (options.onCloseClick) { - options.onCloseClick(event); - } - - hideToast(true); - }); - } - - if (options.onclick) { - $toastElement.click(function(event) { - options.onclick(event); - hideToast(); - }); - } - } - - function displayToast() { - $toastElement.hide(); - - $toastElement[options.showMethod]({ - duration: options.showDuration, - easing: options.showEasing, - complete: options.onShown - }); - - if (options.timeOut > 0) { - intervalId = setTimeout(hideToast, options.timeOut); - progressBar.maxHideTime = parseFloat(options.timeOut); - progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime; - if (options.progressBar) { - progressBar.intervalId = setInterval(updateProgress, 10); - } - } - } - - function setIcon() { - if (map.iconClass) { - $toastElement.addClass(options.toastClass).addClass(iconClass); - } - } - - function setSequence() { - if (options.newestOnTop) { - $container.prepend($toastElement); - } else { - $container.append($toastElement); - } - } - - function setTitle() { - if (map.title) { - var suffix = map.title; - if (options.escapeHtml) { - suffix = escapeHtml(map.title); - } - $titleElement.append(suffix).addClass(options.titleClass); - $toastElement.append($titleElement); - } - } - - function setMessage() { - if (map.message) { - var suffix = map.message; - if (options.escapeHtml) { - suffix = escapeHtml(map.message); - } - $messageElement.append(suffix).addClass(options.messageClass); - $toastElement.append($messageElement); - } - } - - function setCloseButton() { - if (options.closeButton) { - $closeElement.addClass(options.closeClass).attr('role', 'button'); - $toastElement.prepend($closeElement); - } - } - - function setProgressBar() { - if (options.progressBar) { - $progressElement.addClass(options.progressClass); - $toastElement.prepend($progressElement); - } - } - - function setRTL() { - if (options.rtl) { - $toastElement.addClass('rtl'); - } - } - - function shouldExit(options, map) { - if (options.preventDuplicates) { - if (map.message === previousToast) { - return true; - } else { - previousToast = map.message; - } - } - return false; - } - - function hideToast(override) { - var method = override && options.closeMethod !== false ? options.closeMethod : options.hideMethod; - var duration = override && options.closeDuration !== false ? - options.closeDuration : options.hideDuration; - var easing = override && options.closeEasing !== false ? options.closeEasing : options.hideEasing; - if ($(':focus', $toastElement).length && !override) { - return; - } - clearTimeout(progressBar.intervalId); - return $toastElement[method]({ - duration: duration, - easing: easing, - complete: function() { - removeToast($toastElement); - clearTimeout(intervalId); - if (options.onHidden && response.state !== 'hidden') { - options.onHidden(); - } - response.state = 'hidden'; - response.endTime = new Date(); - publish(response); - } - }); - } - - function delayedHideToast() { - if (options.timeOut > 0 || options.extendedTimeOut > 0) { - intervalId = setTimeout(hideToast, options.extendedTimeOut); - progressBar.maxHideTime = parseFloat(options.extendedTimeOut); - progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime; - } - } - - function stickAround() { - clearTimeout(intervalId); - progressBar.hideEta = 0; - $toastElement.stop(true, true)[options.showMethod]({ - duration: options.showDuration, - easing: options.showEasing - }); - } - - function updateProgress() { - var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100; - $progressElement.width(percentage + '%'); - } - } - - function getOptions() { - return $.extend({}, getDefaults(), toastr.options); - } - - function removeToast($toastElement) { - if (!$container) { - $container = getContainer(); - } - if ($toastElement.is(':visible')) { - return; - } - $toastElement.remove(); - $toastElement = null; - if ($container.children().length === 0) { - $container.remove(); - previousToast = undefined; - } - } - - })(); - }); + define(['jquery'], function($) { + return (function() { + var $container; + var listener; + var toastId = 0; + var toastType = { + error: 'error', + info: 'info', + success: 'success', + warning: 'warning' + }; + + var cssStyle = $( + '' + ); + $("body").append(cssStyle); + + var toastr = { + clear: clear, + remove: remove, + error: error, + getContainer: getContainer, + info: info, + options: {}, + subscribe: subscribe, + success: success, + version: '2.1.4', + warning: warning + }; + + var previousToast; + + return toastr; + + function error(message, title, optionsOverride) { + return notify({ + type: toastType.error, + iconClass: getOptions().iconClasses.error, + message: message, + optionsOverride: optionsOverride, + title: title + }); + } + + function getContainer(options, create) { + if (!options) { + options = getOptions(); + } + $container = $('#' + options.containerId); + if ($container.length) { + return $container; + } + if (create) { + $container = createContainer(options); + } + return $container; + } + + function info(message, title, optionsOverride) { + return notify({ + type: toastType.info, + iconClass: getOptions().iconClasses.info, + message: message, + optionsOverride: optionsOverride, + title: title + }); + } + + function subscribe(callback) { + listener = callback; + } + + function success(message, title, optionsOverride) { + return notify({ + type: toastType.success, + iconClass: getOptions().iconClasses.success, + message: message, + optionsOverride: optionsOverride, + title: title + }); + } + + function warning(message, title, optionsOverride) { + return notify({ + type: toastType.warning, + iconClass: getOptions().iconClasses.warning, + message: message, + optionsOverride: optionsOverride, + title: title + }); + } + + function clear($toastElement, clearOptions) { + var options = getOptions(); + if (!$container) { + getContainer(options); + } + if (!clearToast($toastElement, options, clearOptions)) { + clearContainer(options); + } + } + + function remove($toastElement) { + var options = getOptions(); + if (!$container) { + getContainer(options); + } + if ($toastElement && $(':focus', $toastElement).length === 0) { + removeToast($toastElement); + return; + } + if ($container.children().length) { + $container.remove(); + } + } + + // internal functions + + function clearContainer(options) { + var toastsToClear = $container.children(); + for (var i = toastsToClear.length - 1; i >= 0; i--) { + clearToast($(toastsToClear[i]), options); + } + } + + function clearToast($toastElement, options, clearOptions) { + var force = clearOptions && clearOptions.force ? clearOptions.force : false; + if ($toastElement && (force || $(':focus', $toastElement).length === 0)) { + $toastElement[options.hideMethod]({ + duration: options.hideDuration, + easing: options.hideEasing, + complete: function() { + removeToast($toastElement); + } + }); + return true; + } + return false; + } + + function createContainer(options) { + $container = $('
              ') + .attr('id', options.containerId) + .addClass(options.positionClass); + + $container.appendTo($(options.target)); + return $container; + } + + function getDefaults() { + return { + tapToDismiss: true, + toastClass: 'toast', + containerId: 'toast-container', + debug: false, + + showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery + showDuration: 300, + showEasing: 'swing', //swing and linear are built into jQuery + onShown: undefined, + hideMethod: 'fadeOut', + hideDuration: 1000, + hideEasing: 'swing', + onHidden: undefined, + closeMethod: false, + closeDuration: false, + closeEasing: false, + closeOnHover: true, + + extendedTimeOut: 1000, + iconClasses: { + error: 'toast-error', + info: 'toast-info', + success: 'toast-success', + warning: 'toast-warning' + }, + iconClass: 'toast-info', + positionClass: 'toast-top-right', + timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to make it sticky + titleClass: 'toast-title', + messageClass: 'toast-message', + escapeHtml: false, + target: 'body', + closeHtml: '', + closeClass: 'toast-close-button', + newestOnTop: true, + preventDuplicates: false, + progressBar: false, + progressClass: 'toast-progress', + rtl: false + }; + } + + function publish(args) { + if (!listener) { + return; + } + listener(args); + } + + function notify(map) { + var options = getOptions(); + var iconClass = map.iconClass || options.iconClass; + + if (typeof(map.optionsOverride) !== 'undefined') { + options = $.extend(options, map.optionsOverride); + iconClass = map.optionsOverride.iconClass || iconClass; + } + + if (shouldExit(options, map)) { + return; + } + + toastId++; + + $container = getContainer(options, true); + + var intervalId = null; + var $toastElement = $('
              '); + var $titleElement = $('
              '); + var $messageElement = $('
              '); + var $progressElement = $('
              '); + var $closeElement = $(options.closeHtml); + var progressBar = { + intervalId: null, + hideEta: null, + maxHideTime: null + }; + var response = { + toastId: toastId, + state: 'visible', + startTime: new Date(), + options: options, + map: map + }; + + personalizeToast(); + + displayToast(); + + handleEvents(); + + publish(response); + + if (options.debug && console) { + console.log(response); + } + + return $toastElement; + + function escapeHtml(source) { + if (source == null) { + source = ''; + } + + return source + .replace(/&/g, '&') + .replace(/"/g, '"') + .replace(/'/g, ''') + .replace(//g, '>'); + } + + function personalizeToast() { + setIcon(); + setTitle(); + setMessage(); + setCloseButton(); + setProgressBar(); + setRTL(); + setSequence(); + setAria(); + } + + function setAria() { + var ariaValue = ''; + switch (map.iconClass) { + case 'toast-success': + case 'toast-info': + ariaValue = 'polite'; + break; + default: + ariaValue = 'assertive'; + } + $toastElement.attr('aria-live', ariaValue); + } + + function handleEvents() { + if (options.closeOnHover) { + $toastElement.hover(stickAround, delayedHideToast); + } + + if (!options.onclick && options.tapToDismiss) { + $toastElement.click(hideToast); + } + + if (options.closeButton && $closeElement) { + $closeElement.click(function(event) { + if (event.stopPropagation) { + event.stopPropagation(); + } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) { + event.cancelBubble = true; + } + + if (options.onCloseClick) { + options.onCloseClick(event); + } + + hideToast(true); + }); + } + + if (options.onclick) { + $toastElement.click(function(event) { + options.onclick(event); + hideToast(); + }); + } + } + + function displayToast() { + $toastElement.hide(); + + $toastElement[options.showMethod]({ + duration: options.showDuration, + easing: options.showEasing, + complete: options.onShown + }); + + if (options.timeOut > 0) { + intervalId = setTimeout(hideToast, options.timeOut); + progressBar.maxHideTime = parseFloat(options.timeOut); + progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime; + if (options.progressBar) { + progressBar.intervalId = setInterval(updateProgress, 10); + } + } + } + + function setIcon() { + if (map.iconClass) { + $toastElement.addClass(options.toastClass).addClass(iconClass); + } + } + + function setSequence() { + if (options.newestOnTop) { + $container.prepend($toastElement); + } else { + $container.append($toastElement); + } + } + + function setTitle() { + if (map.title) { + var suffix = map.title; + if (options.escapeHtml) { + suffix = escapeHtml(map.title); + } + $titleElement.append(suffix).addClass(options.titleClass); + $toastElement.append($titleElement); + } + } + + function setMessage() { + if (map.message) { + var suffix = map.message; + if (options.escapeHtml) { + suffix = escapeHtml(map.message); + } + $messageElement.append(suffix).addClass(options.messageClass); + $toastElement.append($messageElement); + } + } + + function setCloseButton() { + if (options.closeButton) { + $closeElement.addClass(options.closeClass).attr('role', 'button'); + $toastElement.prepend($closeElement); + } + } + + function setProgressBar() { + if (options.progressBar) { + $progressElement.addClass(options.progressClass); + $toastElement.prepend($progressElement); + } + } + + function setRTL() { + if (options.rtl) { + $toastElement.addClass('rtl'); + } + } + + function shouldExit(options, map) { + if (options.preventDuplicates) { + if (map.message === previousToast) { + return true; + } else { + previousToast = map.message; + } + } + return false; + } + + function hideToast(override) { + var method = override && options.closeMethod !== false ? options.closeMethod : options.hideMethod; + var duration = override && options.closeDuration !== false ? + options.closeDuration : options.hideDuration; + var easing = override && options.closeEasing !== false ? options.closeEasing : options.hideEasing; + if ($(':focus', $toastElement).length && !override) { + return; + } + clearTimeout(progressBar.intervalId); + return $toastElement[method]({ + duration: duration, + easing: easing, + complete: function() { + removeToast($toastElement); + clearTimeout(intervalId); + if (options.onHidden && response.state !== 'hidden') { + options.onHidden(); + } + response.state = 'hidden'; + response.endTime = new Date(); + publish(response); + } + }); + } + + function delayedHideToast() { + if (options.timeOut > 0 || options.extendedTimeOut > 0) { + intervalId = setTimeout(hideToast, options.extendedTimeOut); + progressBar.maxHideTime = parseFloat(options.extendedTimeOut); + progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime; + } + } + + function stickAround() { + clearTimeout(intervalId); + progressBar.hideEta = 0; + $toastElement.stop(true, true)[options.showMethod]({ + duration: options.showDuration, + easing: options.showEasing + }); + } + + function updateProgress() { + var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100; + $progressElement.width(percentage + '%'); + } + } + + function getOptions() { + return $.extend({}, getDefaults(), toastr.options); + } + + function removeToast($toastElement) { + if (!$container) { + $container = getContainer(); + } + if ($toastElement.is(':visible')) { + return; + } + $toastElement.remove(); + $toastElement = null; + if ($container.children().length === 0) { + $container.remove(); + previousToast = undefined; + } + } + + })(); + }); }(typeof define === 'function' && define.amd ? define : function(deps, factory) { - if (typeof module !== 'undefined' && module.exports) { //Node - module.exports = factory(require('jquery')); - } else if (window.layui && layui.define) { - layui.define('jquery', function(exports) { //layui加载 - exports('toastr', factory(layui.jquery)); - exports('notice', factory(layui.jquery)); - }); - } else { - window.toastr = factory(window.jQuery); - } + if (typeof module !== 'undefined' && module.exports) { //Node + module.exports = factory(require('jquery')); + } else if (window.layui && layui.define) { + layui.define('jquery', function(exports) { //layui加载 + exports('toastr', factory(layui.jquery)); + exports('notice', factory(layui.jquery)); + }); + } else { + window.toastr = factory(window.jQuery); + } })); diff --git a/src/main/resources/static/component/pear/module/nprogress.js b/src/main/resources/static/component/pear/module/nprogress.js new file mode 100644 index 00000000..882039a7 --- /dev/null +++ b/src/main/resources/static/component/pear/module/nprogress.js @@ -0,0 +1,503 @@ +/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress + * @license MIT */ + +;(function(root, factory) { + + if (typeof define === 'function' && define.amd) { + define(factory); + } else if (typeof exports === 'object') { + module.exports = factory(); + } else { + root.NProgress = factory(); + } + +})(this, function() { + var NProgress = {}; + + NProgress.version = '0.2.0'; + + var Settings = NProgress.settings = { + minimum: 0.08, + easing: 'linear', + positionUsing: '', + speed: 200, + trickle: true, + trickleSpeed: 200, + showSpinner: true, + barSelector: '[role="bar"]', + spinnerSelector: '[role="spinner"]', + parent: 'body', + template: '
              ' + }; + + /** + * Updates configuration. + * + * NProgress.configure({ + * minimum: 0.1 + * }); + */ + NProgress.configure = function(options) { + var key, value; + for (key in options) { + value = options[key]; + if (value !== undefined && options.hasOwnProperty(key)) Settings[key] = value; + } + + return this; + }; + + /** + * Last number. + */ + + NProgress.status = null; + + /** + * Sets the progress bar status, where `n` is a number from `0.0` to `1.0`. + * + * NProgress.set(0.4); + * NProgress.set(1.0); + */ + + NProgress.set = function(n) { + var started = NProgress.isStarted(); + + n = clamp(n, Settings.minimum, 1); + NProgress.status = (n === 1 ? null : n); + + var progress = NProgress.render(!started), + bar = progress.querySelector(Settings.barSelector), + speed = Settings.speed, + ease = Settings.easing; + + progress.offsetWidth; /* Repaint */ + + queue(function(next) { + // Set positionUsing if it hasn't already been set + if (Settings.positionUsing === '') Settings.positionUsing = NProgress.getPositioningCSS(); + + // Add transition + css(bar, barPositionCSS(n, speed, ease)); + + if (n === 1) { + // Fade out + css(progress, { + transition: 'none', + opacity: 1 + }); + progress.offsetWidth; /* Repaint */ + + setTimeout(function() { + css(progress, { + transition: 'all ' + speed + 'ms linear', + opacity: 0 + }); + setTimeout(function() { + NProgress.remove(); + next(); + }, speed); + }, speed); + } else { + setTimeout(next, speed); + } + }); + + return this; + }; + + NProgress.isStarted = function() { + return typeof NProgress.status === 'number'; + }; + + /** + * Shows the progress bar. + * This is the same as setting the status to 0%, except that it doesn't go backwards. + * + * NProgress.start(); + * + */ + NProgress.start = function() { + if (!NProgress.status) NProgress.set(0); + + var work = function() { + setTimeout(function() { + if (!NProgress.status) return; + NProgress.trickle(); + work(); + }, Settings.trickleSpeed); + }; + + if (Settings.trickle) work(); + + return this; + }; + + /** + * Hides the progress bar. + * This is the *sort of* the same as setting the status to 100%, with the + * difference being `done()` makes some placebo effect of some realistic motion. + * + * NProgress.done(); + * + * If `true` is passed, it will show the progress bar even if its hidden. + * + * NProgress.done(true); + */ + + NProgress.done = function(force) { + if (!force && !NProgress.status) return this; + + return NProgress.inc(0.3 + 0.5 * Math.random()).set(1); + }; + + /** + * Increments by a random amount. + */ + + NProgress.inc = function(amount) { + var n = NProgress.status; + + if (!n) { + return NProgress.start(); + } else if(n > 1) { + return; + } else { + if (typeof amount !== 'number') { + if (n >= 0 && n < 0.2) { amount = 0.1; } + else if (n >= 0.2 && n < 0.5) { amount = 0.04; } + else if (n >= 0.5 && n < 0.8) { amount = 0.02; } + else if (n >= 0.8 && n < 0.99) { amount = 0.005; } + else { amount = 0; } + } + + n = clamp(n + amount, 0, 0.994); + return NProgress.set(n); + } + }; + + NProgress.trickle = function() { + return NProgress.inc(); + }; + + /** + * Waits for all supplied jQuery promises and + * increases the progress as the promises resolve. + * + * @param $promise jQUery Promise + */ + (function() { + var initial = 0, current = 0; + + NProgress.promise = function($promise) { + if (!$promise || $promise.state() === "resolved") { + return this; + } + + if (current === 0) { + NProgress.start(); + } + + initial++; + current++; + + $promise.always(function() { + current--; + if (current === 0) { + initial = 0; + NProgress.done(); + } else { + NProgress.set((initial - current) / initial); + } + }); + + return this; + }; + + })(); + + /** + * (Internal) renders the progress bar markup based on the `template` + * setting. + */ + + NProgress.render = function(fromStart) { + if (NProgress.isRendered()) return document.getElementById('nprogress'); + + addClass(document.documentElement, 'nprogress-busy'); + + var progress = document.createElement('div'); + progress.id = 'nprogress'; + progress.innerHTML = Settings.template; + + + + var bar = progress.querySelector(Settings.barSelector), + perc = fromStart ? '-100' : toBarPerc(NProgress.status || 0), + parent = isDOM(Settings.parent) + ? Settings.parent + : document.querySelector(Settings.parent), + spinner + + css(bar, { + transition: 'all 0 linear', + transform: 'translate3d(' + perc + '%,0,0)' + }); + + if (!Settings.showSpinner) { + spinner = progress.querySelector(Settings.spinnerSelector); + spinner && removeElement(spinner); + } + + if (parent != document.body) { + addClass(parent, 'nprogress-custom-parent'); + } + + parent.appendChild(progress); + return progress; + }; + + /** + * Removes the element. Opposite of render(). + */ + + NProgress.remove = function() { + removeClass(document.documentElement, 'nprogress-busy'); + var parent = isDOM(Settings.parent) + ? Settings.parent + : document.querySelector(Settings.parent) + removeClass(parent, 'nprogress-custom-parent') + var progress = document.getElementById('nprogress'); + progress && removeElement(progress); + }; + + /** + * Checks if the progress bar is rendered. + */ + + NProgress.isRendered = function() { + return !!document.getElementById('nprogress'); + }; + + /** + * Determine which positioning CSS rule to use. + */ + + NProgress.getPositioningCSS = function() { + // Sniff on document.body.style + var bodyStyle = document.body.style; + + // Sniff prefixes + var vendorPrefix = ('WebkitTransform' in bodyStyle) ? 'Webkit' : + ('MozTransform' in bodyStyle) ? 'Moz' : + ('msTransform' in bodyStyle) ? 'ms' : + ('OTransform' in bodyStyle) ? 'O' : ''; + + if (vendorPrefix + 'Perspective' in bodyStyle) { + // Modern browsers with 3D support, e.g. Webkit, IE10 + return 'translate3d'; + } else if (vendorPrefix + 'Transform' in bodyStyle) { + // Browsers without 3D support, e.g. IE9 + return 'translate'; + } else { + // Browsers without translate() support, e.g. IE7-8 + return 'margin'; + } + }; + + /** + * Helpers + */ + + function isDOM (obj) { + if (typeof HTMLElement === 'object') { + return obj instanceof HTMLElement + } + return ( + obj && + typeof obj === 'object' && + obj.nodeType === 1 && + typeof obj.nodeName === 'string' + ) + } + + function clamp(n, min, max) { + if (n < min) return min; + if (n > max) return max; + return n; + } + + /** + * (Internal) converts a percentage (`0..1`) to a bar translateX + * percentage (`-100%..0%`). + */ + + function toBarPerc(n) { + return (-1 + n) * 100; + } + + + /** + * (Internal) returns the correct CSS for changing the bar's + * position given an n percentage, and speed and ease from Settings + */ + + function barPositionCSS(n, speed, ease) { + var barCSS; + + if (Settings.positionUsing === 'translate3d') { + barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' }; + } else if (Settings.positionUsing === 'translate') { + barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' }; + } else { + barCSS = { 'margin-left': toBarPerc(n)+'%' }; + } + + barCSS.transition = 'all '+speed+'ms '+ease; + + return barCSS; + } + + /** + * (Internal) Queues a function to be executed. + */ + + var queue = (function() { + var pending = []; + + function next() { + var fn = pending.shift(); + if (fn) { + fn(next); + } + } + + return function(fn) { + pending.push(fn); + if (pending.length == 1) next(); + }; + })(); + + /** + * (Internal) Applies css properties to an element, similar to the jQuery + * css method. + * + * While this helper does assist with vendor prefixed property names, it + * does not perform any manipulation of values prior to setting styles. + */ + + var css = (function() { + var cssPrefixes = [ 'Webkit', 'O', 'Moz', 'ms' ], + cssProps = {}; + + function camelCase(string) { + return string.replace(/^-ms-/, 'ms-').replace(/-([\da-z])/gi, function(match, letter) { + return letter.toUpperCase(); + }); + } + + function getVendorProp(name) { + var style = document.body.style; + if (name in style) return name; + + var i = cssPrefixes.length, + capName = name.charAt(0).toUpperCase() + name.slice(1), + vendorName; + while (i--) { + vendorName = cssPrefixes[i] + capName; + if (vendorName in style) return vendorName; + } + + return name; + } + + function getStyleProp(name) { + name = camelCase(name); + return cssProps[name] || (cssProps[name] = getVendorProp(name)); + } + + function applyCss(element, prop, value) { + prop = getStyleProp(prop); + element.style[prop] = value; + } + + return function(element, properties) { + var args = arguments, + prop, + value; + + if (args.length == 2) { + for (prop in properties) { + value = properties[prop]; + if (value !== undefined && properties.hasOwnProperty(prop)) applyCss(element, prop, value); + } + } else { + applyCss(element, args[1], args[2]); + } + } + })(); + + /** + * (Internal) Determines if an element or space separated list of class names contains a class name. + */ + + function hasClass(element, name) { + var list = typeof element == 'string' ? element : classList(element); + return list.indexOf(' ' + name + ' ') >= 0; + } + + /** + * (Internal) Adds a class to an element. + */ + + function addClass(element, name) { + var oldList = classList(element), + newList = oldList + name; + + if (hasClass(oldList, name)) return; + + // Trim the opening space. + element.className = newList.substring(1); + } + + /** + * (Internal) Removes a class from an element. + */ + + function removeClass(element, name) { + var oldList = classList(element), + newList; + + if (!hasClass(element, name)) return; + + // Replace the class name. + newList = oldList.replace(' ' + name + ' ', ' '); + + // Trim the opening and closing spaces. + element.className = newList.substring(1, newList.length - 1); + } + + /** + * (Internal) Gets a space separated list of the class names on the element. + * The list is wrapped with a single space on each end to facilitate finding + * matches within the list. + */ + + function classList(element) { + return (' ' + (element && element.className || '') + ' ').replace(/\s+/gi, ' '); + } + + /** + * (Internal) Removes an element from the DOM. + */ + + function removeElement(element) { + element && element.parentNode && element.parentNode.removeChild(element); + } + + return NProgress; +}); + +layui.define([], function(exports) { + exports('nprogress', NProgress); +}); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/popover/popover.js b/src/main/resources/static/component/pear/module/popover/popover.js new file mode 100644 index 00000000..7f2e9bd7 --- /dev/null +++ b/src/main/resources/static/component/pear/module/popover/popover.js @@ -0,0 +1,1219 @@ +/* + * webui popover plugin - v1.2.17 + * A lightWeight popover plugin with jquery ,enchance the popover plugin of bootstrap with some awesome new features. It works well with bootstrap ,but bootstrap is not necessary! + * https://github.com/sandywalker/webui-popover + * + * Made by Sandy Duan + * Under MIT License + */ + +layui.define(['jquery', 'element'], function(exports) { + var $=layui.$; + // Create the defaults once + var pluginName = 'webuiPopover'; + var pluginClass = 'webui-popover'; + var pluginType = 'webui.popover'; + var defaults = { + placement: 'auto', + container: null, + width: 'auto', + height: 'auto', + trigger: 'click', //hover,click,sticky,manual + style: '', + opacity:null, + selector: false, // jQuery selector, if a selector is provided, popover objects will be delegated to the specified. + delay: { + show: null, + hide: 300 + }, + async: { + type: 'GET', + before: null, //function(that, xhr, settings){} + success: null, //function(that, xhr){} + error: null //function(that, xhr, data){} + }, + cache: true, + multi: false, + arrow: true, + title: '', + content: '', + closeable: false, + padding: true, + url: '', + type: 'html', + direction: '', // ltr,rtl + animation: null, + template: '
              ' + + '
              ' + + '
              ' + + '' + + '

              ' + + '

               

              ' + + '
              ' + + '
              ', + backdrop: false, + dismissible: true, + onShow: null, + onHide: null, + abortXHR: true, + autoHide: false, + offsetTop: 0, + offsetLeft: 0, + iframeOptions: { + frameborder: '0', + allowtransparency: 'true', + id: '', + name: '', + scrolling: '', + onload: '', + height: '', + width: '' + }, + hideEmpty: false + }; + + var rtlClass = pluginClass + '-rtl'; + var _srcElements = []; + var backdrop = $('
              '); + var _globalIdSeed = 0; + var _isBodyEventHandled = false; + var _offsetOut = -2000; // the value offset out of the screen + var $document = $(document); + + var toNumber = function (numeric, fallback) { + return isNaN(numeric) ? (fallback || 0) : Number(numeric); + }; + + var getPopFromElement = function ($element) { + return $element.data('plugin_' + pluginName); + }; + + var hideAllPop = function () { + var pop = null; + for (var i = 0; i < _srcElements.length; i++) { + pop = getPopFromElement(_srcElements[i]); + if (pop) { + pop.hide(true); + } + } + $document.trigger('hiddenAll.' + pluginType); + }; + + var hideOtherPops = function (currentPop) { + var pop = null; + for (var i = 0; i < _srcElements.length; i++) { + pop = getPopFromElement(_srcElements[i]); + if (pop && pop.id !== currentPop.id) { + pop.hide(true); + } + } + $document.trigger('hiddenAll.' + pluginType); + }; + + var isMobile = ('ontouchstart' in document.documentElement) && (/Mobi/.test(navigator.userAgent)); + + var pointerEventToXY = function (e) { + var out = { + x: 0, + y: 0 + }; + if (e.type === 'touchstart' || e.type === 'touchmove' || e.type === 'touchend' || e.type === 'touchcancel') { + var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; + out.x = touch.pageX; + out.y = touch.pageY; + } else if (e.type === 'mousedown' || e.type === 'mouseup' || e.type === 'click') { + out.x = e.pageX; + out.y = e.pageY; + } + return out; + }; + + + // The actual plugin constructor + function WebuiPopover(element, options) { + this.$element = $(element); + if (options) { + if ($.type(options.delay) === 'string' || $.type(options.delay) === 'number') { + options.delay = { + show: options.delay, + hide: options.delay + }; // bc break fix + } + } + this.options = $.extend({}, defaults, options); + this._defaults = defaults; + this._name = pluginName; + this._targetclick = false; + this.init(); + _srcElements.push(this.$element); + return this; + + } + + WebuiPopover.prototype = { + //init webui popover + init: function () { + if (this.$element[0] instanceof document.constructor && !this.options.selector) { + throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!'); + } + + if (this.getTrigger() !== 'manual') { + //init the event handlers + if (isMobile) { + this.$element.off('touchend', this.options.selector).on('touchend', this.options.selector, $.proxy(this.toggle, this)); + } else if (this.getTrigger() === 'click') { + this.$element.off('click', this.options.selector).on('click', this.options.selector, $.proxy(this.toggle, this)); + } else if (this.getTrigger() === 'hover') { + this.$element + .off('mouseenter mouseleave click', this.options.selector) + .on('mouseenter', this.options.selector, $.proxy(this.mouseenterHandler, this)) + .on('mouseleave', this.options.selector, $.proxy(this.mouseleaveHandler, this)); + } + } + this._poped = false; + this._inited = true; + this._opened = false; + this._idSeed = _globalIdSeed; + this.id = pluginName + this._idSeed; + // normalize container + this.options.container = $(this.options.container || document.body).first(); + + if (this.options.backdrop) { + backdrop.appendTo(this.options.container).hide(); + } + _globalIdSeed++; + if (this.getTrigger() === 'sticky') { + this.show(); + } + + if (this.options.selector) { + this._options = $.extend({}, this.options, { + selector: '' + }); + } + + }, + /* api methods and actions */ + destroy: function () { + var index = -1; + + for (var i = 0; i < _srcElements.length; i++) { + if (_srcElements[i] === this.$element) { + index = i; + break; + } + } + + _srcElements.splice(index, 1); + + + this.hide(); + this.$element.data('plugin_' + pluginName, null); + if (this.getTrigger() === 'click') { + this.$element.off('click'); + } else if (this.getTrigger() === 'hover') { + this.$element.off('mouseenter mouseleave'); + } + if (this.$target) { + this.$target.remove(); + } + }, + getDelegateOptions: function () { + var options = {}; + + this._options && $.each(this._options, function (key, value) { + if (defaults[key] !== value) { + options[key] = value; + } + }); + return options; + }, + /* + param: force boolean value, if value is true then force hide the popover + param: event dom event, + */ + hide: function (force, event) { + + if (!force && this.getTrigger() === 'sticky') { + return; + } + if (!this._opened) { + return; + } + if (event) { + event.preventDefault(); + event.stopPropagation(); + } + + if (this.xhr && this.options.abortXHR === true) { + this.xhr.abort(); + this.xhr = null; + } + + + var e = $.Event('hide.' + pluginType); + this.$element.trigger(e, [this.$target]); + if (this.$target) { + this.$target.removeClass('in').addClass(this.getHideAnimation()); + var that = this; + setTimeout(function () { + that.$target.hide(); + if (!that.getCache()) { + that.$target.remove(); + //that.getTriggerElement.removeAttr('data-target'); + } + }, that.getHideDelay()); + } + if (this.options.backdrop) { + backdrop.hide(); + } + this._opened = false; + this.$element.trigger('hidden.' + pluginType, [this.$target]); + + if (this.options.onHide) { + this.options.onHide(this.$target); + } + + }, + resetAutoHide: function () { + var that = this; + var autoHide = that.getAutoHide(); + if (autoHide) { + if (that.autoHideHandler) { + clearTimeout(that.autoHideHandler); + } + that.autoHideHandler = setTimeout(function () { + that.hide(); + }, autoHide); + } + }, + delegate: function (eventTarget) { + var self = $(eventTarget).data('plugin_' + pluginName); + if (!self) { + self = new WebuiPopover(eventTarget, this.getDelegateOptions()); + $(eventTarget).data('plugin_' + pluginName, self); + } + return self; + }, + toggle: function (e) { + var self = this; + if (e) { + e.preventDefault(); + e.stopPropagation(); + if (this.options.selector) { + self = this.delegate(e.currentTarget); + } + } + self[self.getTarget().hasClass('in') ? 'hide' : 'show'](); + }, + hideAll: function () { + hideAllPop(); + }, + hideOthers: function () { + hideOtherPops(this); + }, + /*core method ,show popover */ + show: function () { + if (this._opened) { + return; + } + //removeAllTargets(); + var + $target = this.getTarget().removeClass().addClass(pluginClass).addClass(this._customTargetClass); + if (!this.options.multi) { + this.hideOthers(); + } + + // use cache by default, if not cache setted , reInit the contents + if (!this.getCache() || !this._poped || this.content === '') { + this.content = ''; + this.setTitle(this.getTitle()); + if (!this.options.closeable) { + $target.find('.close').off('click').remove(); + } + if (!this.isAsync()) { + this.setContent(this.getContent()); + } else { + this.setContentASync(this.options.content); + } + + if (this.canEmptyHide() && this.content === '') { + return; + } + $target.show(); + } + + this.displayContent(); + + if (this.options.onShow) { + this.options.onShow($target); + } + + this.bindBodyEvents(); + if (this.options.backdrop) { + backdrop.show(); + } + this._opened = true; + this.resetAutoHide(); + }, + displayContent: function () { + var + //element postion + elementPos = this.getElementPosition(), + //target postion + $target = this.getTarget().removeClass().addClass(pluginClass).addClass(this._customTargetClass), + //target content + $targetContent = this.getContentElement(), + //target Width + targetWidth = $target[0].offsetWidth, + //target Height + targetHeight = $target[0].offsetHeight, + //placement + placement = 'bottom', + e = $.Event('show.' + pluginType); + + if (this.canEmptyHide()) { + + var content = $targetContent.children().html(); + if (content !== null && content.trim().length === 0) { + return; + } + } + + //if (this.hasContent()){ + this.$element.trigger(e, [$target]); + //} + // support width as data attribute + var optWidth = this.$element.data('width') || this.options.width; + if (optWidth === '') { + optWidth = this._defaults.width; + } + + if (optWidth !== 'auto') { + $target.width(optWidth); + } + + // support height as data attribute + var optHeight = this.$element.data('height') || this.options.height; + if (optHeight === '') { + optHeight = this._defaults.height; + } + + if (optHeight !== 'auto') { + $targetContent.height(optHeight); + } + + if (this.options.style) { + this.$target.addClass(pluginClass + '-' + this.options.style); + } + + //check rtl + if (this.options.direction === 'rtl' && !$targetContent.hasClass(rtlClass)) { + $targetContent.addClass(rtlClass); + } + + //init the popover and insert into the document body + if (!this.options.arrow) { + $target.find('.webui-arrow').remove(); + } + $target.detach().css({ + top: _offsetOut, + left: _offsetOut, + display: 'block', + opacity:this.options.opacity || 1 + }); + + if (this.getAnimation()) { + $target.addClass(this.getAnimation()); + } + $target.appendTo(this.options.container); + + + placement = this.getPlacement(elementPos); + + //This line is just for compatible with knockout custom binding + this.$element.trigger('added.' + pluginType); + + this.initTargetEvents(); + + if (!this.options.padding) { + if (this.options.height !== 'auto') { + $targetContent.css('height', $targetContent.outerHeight()); + } + this.$target.addClass('webui-no-padding'); + } + + // add maxHeight and maxWidth support by limodou@gmail.com 2016/10/1 + if (this.options.maxHeight) { + $targetContent.css('maxHeight', this.options.maxHeight); + } + + if (this.options.maxWidth) { + $targetContent.css('maxWidth', this.options.maxWidth); + } + // end + + targetWidth = $target[0].offsetWidth; + targetHeight = $target[0].offsetHeight; + + var postionInfo = this.getTargetPositin(elementPos, placement, targetWidth, targetHeight); + + this.$target.css(postionInfo.position).addClass(placement).addClass('in'); + + if (this.options.type === 'iframe') { + var $iframe = $target.find('iframe'); + var iframeWidth = $target.width(); + var iframeHeight = $iframe.parent().height(); + + if (this.options.iframeOptions.width !== '' && this.options.iframeOptions.width !== 'auto') { + iframeWidth = this.options.iframeOptions.width; + } + + if (this.options.iframeOptions.height !== '' && this.options.iframeOptions.height !== 'auto') { + iframeHeight = this.options.iframeOptions.height; + } + + $iframe.width(iframeWidth).height(iframeHeight); + } + + if (!this.options.arrow) { + this.$target.css({ + 'margin': 0 + }); + } + if (this.options.arrow) { + var $arrow = this.$target.find('.webui-arrow'); + $arrow.removeAttr('style'); + + //prevent arrow change by content size + if (placement === 'left' || placement === 'right') { + $arrow.css({ + top: this.$target.height() / 2 + }); + } else if (placement === 'top' || placement === 'bottom') { + $arrow.css({ + left: this.$target.width() / 2 + }); + } + + if (postionInfo.arrowOffset) { + //hide the arrow if offset is negative + if (postionInfo.arrowOffset.left === -1 || postionInfo.arrowOffset.top === -1) { + $arrow.hide(); + } else { + $arrow.css(postionInfo.arrowOffset); + } + } + + } + this._poped = true; + this.$element.trigger('shown.' + pluginType, [this.$target]); + }, + + isTargetLoaded: function () { + return this.getTarget().find('i.glyphicon-refresh').length === 0; + }, + + /*getter setters */ + getTriggerElement: function () { + return this.$element; + }, + getTarget: function () { + if (!this.$target) { + var id = pluginName + this._idSeed; + this.$target = $(this.options.template) + .attr('id', id); + this._customTargetClass = this.$target.attr('class') !== pluginClass ? this.$target.attr('class') : null; + this.getTriggerElement().attr('data-target', id); + } + if (!this.$target.data('trigger-element')) { + this.$target.data('trigger-element', this.getTriggerElement()); + } + return this.$target; + }, + removeTarget: function () { + this.$target.remove(); + this.$target = null; + this.$contentElement = null; + }, + getTitleElement: function () { + return this.getTarget().find('.' + pluginClass + '-title'); + }, + getContentElement: function () { + if (!this.$contentElement) { + this.$contentElement = this.getTarget().find('.' + pluginClass + '-content'); + } + return this.$contentElement; + }, + getTitle: function () { + return this.$element.attr('data-title') || this.options.title || this.$element.attr('title'); + }, + getUrl: function () { + return this.$element.attr('data-url') || this.options.url; + }, + getAutoHide: function () { + return this.$element.attr('data-auto-hide') || this.options.autoHide; + }, + getOffsetTop: function () { + return toNumber(this.$element.attr('data-offset-top')) || this.options.offsetTop; + }, + getOffsetLeft: function () { + return toNumber(this.$element.attr('data-offset-left')) || this.options.offsetLeft; + }, + getCache: function () { + var dataAttr = this.$element.attr('data-cache'); + if (typeof (dataAttr) !== 'undefined') { + switch (dataAttr.toLowerCase()) { + case 'true': + case 'yes': + case '1': + return true; + case 'false': + case 'no': + case '0': + return false; + } + } + return this.options.cache; + }, + getTrigger: function () { + return this.$element.attr('data-trigger') || this.options.trigger; + }, + getDelayShow: function () { + var dataAttr = this.$element.attr('data-delay-show'); + if (typeof (dataAttr) !== 'undefined') { + return dataAttr; + } + return this.options.delay.show === 0 ? 0 : this.options.delay.show || 100; + }, + getHideDelay: function () { + var dataAttr = this.$element.attr('data-delay-hide'); + if (typeof (dataAttr) !== 'undefined') { + return dataAttr; + } + return this.options.delay.hide === 0 ? 0 : this.options.delay.hide || 100; + }, + getAnimation: function () { + var dataAttr = this.$element.attr('data-animation'); + return dataAttr || this.options.animation; + }, + getHideAnimation: function () { + var ani = this.getAnimation(); + return ani ? ani + '-out' : 'out'; + }, + setTitle: function (title) { + var $titleEl = this.getTitleElement(); + if (title) { + //check rtl + if (this.options.direction === 'rtl' && !$titleEl.hasClass(rtlClass)) { + $titleEl.addClass(rtlClass); + } + $titleEl.html(title); + } else { + $titleEl.remove(); + } + }, + hasContent: function () { + return this.getContent(); + }, + canEmptyHide: function () { + return this.options.hideEmpty && this.options.type === 'html'; + }, + getIframe: function () { + var $iframe = $('').attr('src', this.getUrl()); + var self = this; + $.each(this._defaults.iframeOptions, function (opt) { + if (typeof self.options.iframeOptions[opt] !== 'undefined') { + $iframe.attr(opt, self.options.iframeOptions[opt]); + } + }); + + return $iframe; + }, + getContent: function () { + if (this.getUrl()) { + switch (this.options.type) { + case 'iframe': + this.content = this.getIframe(); + break; + case 'html': + try { + this.content = $(this.getUrl()); + if (!this.content.is(':visible')) { + this.content.show(); + } + } catch (error) { + throw new Error('Unable to get popover content. Invalid selector specified.'); + } + break; + } + } else if (!this.content) { + var content = ''; + if ($.isFunction(this.options.content)) { + content = this.options.content.apply(this.$element[0], [this]); + } else { + content = this.options.content; + } + this.content = this.$element.attr('data-content') || content; + if (!this.content) { + var $next = this.$element.next(); + + if ($next && $next.hasClass(pluginClass + '-content')) { + this.content = $next; + } + } + } + return this.content; + }, + setContent: function (content) { + var $target = this.getTarget(); + var $ct = this.getContentElement(); + if (typeof content === 'string') { + $ct.html(content); + } else if (content instanceof $) { + $ct.html(''); + //Don't want to clone too many times. + if (!this.options.cache) { + content.clone(true, true).removeClass(pluginClass + '-content').appendTo($ct); + } else { + content.removeClass(pluginClass + '-content').appendTo($ct); + } + } + this.$target = $target; + }, + isAsync: function () { + return this.options.type === 'async'; + }, + setContentASync: function (content) { + var that = this; + if (this.xhr) { + return; + } + this.xhr = $.ajax({ + url: this.getUrl(), + type: this.options.async.type, + cache: this.getCache(), + beforeSend: function (xhr, settings) { + if (that.options.async.before) { + that.options.async.before(that, xhr, settings); + } + }, + success: function (data) { + that.bindBodyEvents(); + if (content && $.isFunction(content)) { + that.content = content.apply(that.$element[0], [data]); + } else { + that.content = data; + } + that.setContent(that.content); + var $targetContent = that.getContentElement(); + $targetContent.removeAttr('style'); + that.displayContent(); + if (that.options.async.success) { + that.options.async.success(that, data); + } + }, + complete: function () { + that.xhr = null; + }, + error: function (xhr, data) { + if (that.options.async.error) { + that.options.async.error(that, xhr, data); + } + } + }); + }, + + bindBodyEvents: function () { + if (_isBodyEventHandled) { + return; + } + if (this.options.dismissible && this.getTrigger() === 'click') { + if (isMobile) { + $document.off('touchstart.webui-popover').on('touchstart.webui-popover', $.proxy(this.bodyTouchStartHandler, this)); + } else { + $document.off('keyup.webui-popover').on('keyup.webui-popover', $.proxy(this.escapeHandler, this)); + $document.off('click.webui-popover').on('click.webui-popover', $.proxy(this.bodyClickHandler, this)); + } + } else if (this.getTrigger() === 'hover') { + $document.off('touchend.webui-popover') + .on('touchend.webui-popover', $.proxy(this.bodyClickHandler, this)); + } + }, + + /* event handlers */ + mouseenterHandler: function (e) { + var self = this; + + if (e && this.options.selector) { + self = this.delegate(e.currentTarget); + } + + if (self._timeout) { + clearTimeout(self._timeout); + } + self._enterTimeout = setTimeout(function () { + if (!self.getTarget().is(':visible')) { + self.show(); + } + }, this.getDelayShow()); + }, + mouseleaveHandler: function () { + var self = this; + clearTimeout(self._enterTimeout); + //key point, set the _timeout then use clearTimeout when mouse leave + self._timeout = setTimeout(function () { + self.hide(); + }, this.getHideDelay()); + }, + escapeHandler: function (e) { + if (e.keyCode === 27) { + this.hideAll(); + } + }, + bodyTouchStartHandler: function (e) { + var self = this; + var $eventEl = $(e.currentTarget); + $eventEl.on('touchend', function (e) { + self.bodyClickHandler(e); + $eventEl.off('touchend'); + }); + $eventEl.on('touchmove', function () { + $eventEl.off('touchend'); + }); + }, + bodyClickHandler: function (e) { + _isBodyEventHandled = true; + var canHide = true; + for (var i = 0; i < _srcElements.length; i++) { + var pop = getPopFromElement(_srcElements[i]); + if (pop && pop._opened) { + var offset = pop.getTarget().offset(); + var popX1 = offset.left; + var popY1 = offset.top; + var popX2 = offset.left + pop.getTarget().width(); + var popY2 = offset.top + pop.getTarget().height(); + var pt = pointerEventToXY(e); + var inPop = pt.x >= popX1 && pt.x <= popX2 && pt.y >= popY1 && pt.y <= popY2; + if (inPop) { + canHide = false; + break; + } + } + } + if (canHide) { + hideAllPop(); + } + }, + + /* + targetClickHandler: function() { + this._targetclick = true; + }, + */ + + //reset and init the target events; + initTargetEvents: function () { + if (this.getTrigger() === 'hover') { + this.$target + .off('mouseenter mouseleave') + .on('mouseenter', $.proxy(this.mouseenterHandler, this)) + .on('mouseleave', $.proxy(this.mouseleaveHandler, this)); + } + this.$target.find('.close').off('click').on('click', $.proxy(this.hide, this, true)); + //this.$target.off('click.webui-popover').on('click.webui-popover', $.proxy(this.targetClickHandler, this)); + }, + /* utils methods */ + //caculate placement of the popover + getPlacement: function (pos) { + var + placement, + container = this.options.container, + clientWidth = container.innerWidth(), + clientHeight = container.innerHeight(), + scrollTop = container.scrollTop(), + scrollLeft = container.scrollLeft(), + pageX = Math.max(0, pos.left - scrollLeft), + pageY = Math.max(0, pos.top - scrollTop); + //arrowSize = 20; + + //if placement equals auto,caculate the placement by element information; + if (typeof (this.options.placement) === 'function') { + placement = this.options.placement.call(this, this.getTarget()[0], this.$element[0]); + } else { + placement = this.$element.data('placement') || this.options.placement; + } + + var isH = placement === 'horizontal'; + var isV = placement === 'vertical'; + var detect = placement === 'auto' || isH || isV; + + if (detect) { + if (pageX < clientWidth / 3) { + if (pageY < clientHeight / 3) { + placement = isH ? 'right-bottom' : 'bottom-right'; + } else if (pageY < clientHeight * 2 / 3) { + if (isV) { + placement = pageY <= clientHeight / 2 ? 'bottom-right' : 'top-right'; + } else { + placement = 'right'; + } + } else { + placement = isH ? 'right-top' : 'top-right'; + } + //placement= pageY>targetHeight+arrowSize?'top-right':'bottom-right'; + } else if (pageX < clientWidth * 2 / 3) { + if (pageY < clientHeight / 3) { + if (isH) { + placement = pageX <= clientWidth / 2 ? 'right-bottom' : 'left-bottom'; + } else { + placement = 'bottom'; + } + } else if (pageY < clientHeight * 2 / 3) { + if (isH) { + placement = pageX <= clientWidth / 2 ? 'right' : 'left'; + } else { + placement = pageY <= clientHeight / 2 ? 'bottom' : 'top'; + } + } else { + if (isH) { + placement = pageX <= clientWidth / 2 ? 'right-top' : 'left-top'; + } else { + placement = 'top'; + } + } + } else { + //placement = pageY>targetHeight+arrowSize?'top-left':'bottom-left'; + if (pageY < clientHeight / 3) { + placement = isH ? 'left-bottom' : 'bottom-left'; + } else if (pageY < clientHeight * 2 / 3) { + if (isV) { + placement = pageY <= clientHeight / 2 ? 'bottom-left' : 'top-left'; + } else { + placement = 'left'; + } + } else { + placement = isH ? 'left-top' : 'top-left'; + } + } + } else if (placement === 'auto-top') { + if (pageX < clientWidth / 3) { + placement = 'top-right'; + } else if (pageX < clientWidth * 2 / 3) { + placement = 'top'; + } else { + placement = 'top-left'; + } + } else if (placement === 'auto-bottom') { + if (pageX < clientWidth / 3) { + placement = 'bottom-right'; + } else if (pageX < clientWidth * 2 / 3) { + placement = 'bottom'; + } else { + placement = 'bottom-left'; + } + } else if (placement === 'auto-left') { + if (pageY < clientHeight / 3) { + placement = 'left-top'; + } else if (pageY < clientHeight * 2 / 3) { + placement = 'left'; + } else { + placement = 'left-bottom'; + } + } else if (placement === 'auto-right') { + if (pageY < clientHeight / 3) { + placement = 'right-bottom'; + } else if (pageY < clientHeight * 2 / 3) { + placement = 'right'; + } else { + placement = 'right-top'; + } + } + return placement; + }, + getElementPosition: function () { + // If the container is the body or normal conatiner, just use $element.offset() + var elRect = this.$element[0].getBoundingClientRect(); + var container = this.options.container; + var cssPos = container.css('position'); + + if (container.is(document.body) || cssPos === 'static') { + return $.extend({}, this.$element.offset(), { + width: this.$element[0].offsetWidth || elRect.width, + height: this.$element[0].offsetHeight || elRect.height + }); + // Else fixed container need recalculate the position + } else if (cssPos === 'fixed') { + var containerRect = container[0].getBoundingClientRect(); + return { + top: elRect.top - containerRect.top + container.scrollTop(), + left: elRect.left - containerRect.left + container.scrollLeft(), + width: elRect.width, + height: elRect.height + }; + } else if (cssPos === 'relative') { + return { + top: this.$element.offset().top - container.offset().top, + left: this.$element.offset().left - container.offset().left, + width: this.$element[0].offsetWidth || elRect.width, + height: this.$element[0].offsetHeight || elRect.height + }; + } + }, + + getTargetPositin: function (elementPos, placement, targetWidth, targetHeight) { + var pos = elementPos, + container = this.options.container, + //clientWidth = container.innerWidth(), + //clientHeight = container.innerHeight(), + elementW = this.$element.outerWidth(), + elementH = this.$element.outerHeight(), + scrollTop = document.documentElement.scrollTop + container.scrollTop(), + scrollLeft = document.documentElement.scrollLeft + container.scrollLeft(), + position = {}, + arrowOffset = null, + arrowSize = this.options.arrow ? 20 : 0, + padding = 10, + fixedW = elementW < arrowSize + padding ? arrowSize : 0, + fixedH = elementH < arrowSize + padding ? arrowSize : 0, + refix = 0, + pageH = document.documentElement.clientHeight + scrollTop, + pageW = document.documentElement.clientWidth + scrollLeft; + + var validLeft = pos.left + pos.width / 2 - fixedW > 0; + var validRight = pos.left + pos.width / 2 + fixedW < pageW; + var validTop = pos.top + pos.height / 2 - fixedH > 0; + var validBottom = pos.top + pos.height / 2 + fixedH < pageH; + + + switch (placement) { + case 'bottom': + position = { + top: pos.top + pos.height, + left: pos.left + pos.width / 2 - targetWidth / 2 + }; + break; + case 'top': + position = { + top: pos.top - targetHeight, + left: pos.left + pos.width / 2 - targetWidth / 2 + }; + break; + case 'left': + position = { + top: pos.top + pos.height / 2 - targetHeight / 2, + left: pos.left - targetWidth + }; + break; + case 'right': + position = { + top: pos.top + pos.height / 2 - targetHeight / 2, + left: pos.left + pos.width + }; + break; + case 'top-right': + position = { + top: pos.top - targetHeight, + left: validLeft ? pos.left - fixedW : padding + }; + arrowOffset = { + left: validLeft ? Math.min(elementW, targetWidth) / 2 + fixedW : _offsetOut + }; + break; + case 'top-left': + refix = validRight ? fixedW : -padding; + position = { + top: pos.top - targetHeight, + left: pos.left - targetWidth + pos.width + refix + }; + arrowOffset = { + left: validRight ? targetWidth - Math.min(elementW, targetWidth) / 2 - fixedW : _offsetOut + }; + break; + case 'bottom-right': + position = { + top: pos.top + pos.height, + left: validLeft ? pos.left - fixedW : padding + }; + arrowOffset = { + left: validLeft ? Math.min(elementW, targetWidth) / 2 + fixedW : _offsetOut + }; + break; + case 'bottom-left': + refix = validRight ? fixedW : -padding; + position = { + top: pos.top + pos.height, + left: pos.left - targetWidth + pos.width + refix + }; + arrowOffset = { + left: validRight ? targetWidth - Math.min(elementW, targetWidth) / 2 - fixedW : _offsetOut + }; + break; + case 'right-top': + refix = validBottom ? fixedH : -padding; + position = { + top: pos.top - targetHeight + pos.height + refix, + left: pos.left + pos.width + }; + arrowOffset = { + top: validBottom ? targetHeight - Math.min(elementH, targetHeight) / 2 - fixedH : _offsetOut + }; + break; + case 'right-bottom': + position = { + top: validTop ? pos.top - fixedH : padding, + left: pos.left + pos.width + }; + arrowOffset = { + top: validTop ? Math.min(elementH, targetHeight) / 2 + fixedH : _offsetOut + }; + break; + case 'left-top': + refix = validBottom ? fixedH : -padding; + position = { + top: pos.top - targetHeight + pos.height + refix, + left: pos.left - targetWidth + }; + arrowOffset = { + top: validBottom ? targetHeight - Math.min(elementH, targetHeight) / 2 - fixedH : _offsetOut + }; + break; + case 'left-bottom': + position = { + top: validTop ? pos.top - fixedH : padding, + left: pos.left - targetWidth + }; + arrowOffset = { + top: validTop ? Math.min(elementH, targetHeight) / 2 + fixedH : _offsetOut + }; + break; + + } + position.top += this.getOffsetTop(); + position.left += this.getOffsetLeft(); + + return { + position: position, + arrowOffset: arrowOffset + }; + } + }; + $.fn[pluginName] = function (options, noInit) { + var results = []; + var $result = this.each(function () { + + var webuiPopover = $.data(this, 'plugin_' + pluginName); + if (!webuiPopover) { + if (!options) { + webuiPopover = new WebuiPopover(this, null); + } else if (typeof options === 'string') { + if (options !== 'destroy') { + if (!noInit) { + webuiPopover = new WebuiPopover(this, null); + results.push(webuiPopover[options]()); + } + } + } else if (typeof options === 'object') { + webuiPopover = new WebuiPopover(this, options); + } + $.data(this, 'plugin_' + pluginName, webuiPopover); + } else { + if (options === 'destroy') { + webuiPopover.destroy(); + } else if (typeof options === 'string') { + results.push(webuiPopover[options]()); + } + } + }); + return (results.length) ? results : $result; + }; + + //Global object exposes to window. + var webuiPopovers = (function () { + var _hideAll = function () { + hideAllPop(); + }; + var _create = function (selector, options) { + options = options || {}; + $(selector).webuiPopover(options); + }; + var _isCreated = function (selector) { + var created = true; + $(selector).each(function (i, item) { + created = created && $(item).data('plugin_' + pluginName) !== undefined; + }); + return created; + }; + var _show = function (selector, options) { + if (options) { + $(selector).webuiPopover(options).webuiPopover('show'); + } else { + $(selector).webuiPopover('show'); + } + }; + var _hide = function (selector) { + $(selector).webuiPopover('hide'); + }; + + var _setDefaultOptions = function (options) { + defaults = $.extend({}, defaults, options); + }; + + var _updateContent = function (selector, content) { + var pop = $(selector).data('plugin_' + pluginName); + if (pop) { + var cache = pop.getCache(); + pop.options.cache = false; + pop.options.content = content; + if (pop._opened) { + pop._opened = false; + pop.show(); + } else { + if (pop.isAsync()) { + pop.setContentASync(content); + } else { + pop.setContent(content); + } + } + pop.options.cache = cache; + } + }; + + var _updateContentAsync = function (selector, url) { + var pop = $(selector).data('plugin_' + pluginName); + if (pop) { + var cache = pop.getCache(); + var type = pop.options.type; + pop.options.cache = false; + pop.options.url = url; + + if (pop._opened) { + pop._opened = false; + pop.show(); + } else { + pop.options.type = 'async'; + pop.setContentASync(pop.content); + } + pop.options.cache = cache; + pop.options.type = type; + } + }; + + return { + show: _show, + hide: _hide, + create: _create, + isCreated: _isCreated, + hideAll: _hideAll, + updateContent: _updateContent, + updateContentAsync: _updateContentAsync, + setDefaultOptions: _setDefaultOptions + }; + })(); + window.WebuiPopovers = webuiPopovers; + exports("popover",WebuiPopovers); +}) + + + + diff --git a/src/main/resources/static/component/pear/module/popup.js b/src/main/resources/static/component/pear/module/popup.js index 510579db..1e8e9521 100644 --- a/src/main/resources/static/component/pear/module/popup.js +++ b/src/main/resources/static/component/pear/module/popup.js @@ -1,49 +1,49 @@ -layui.define(['layer', 'jquery', 'element'], function (exports) { - "use strict"; +layui.define(['layer', 'jquery', 'element'], function(exports) { + "use strict"; - var MOD_NAME = 'popup', - $ = layui.jquery, - layer = layui.layer, - element = layui.element; + var MOD_NAME = 'popup', + $ = layui.jquery, + layer = layui.layer, + element = layui.element; - var popup = new function () { + var popup = new function() { - this.success = function (msg) { - layer.msg(msg, { - icon: 1, - time: 1000 - }) - }, - this.failure = function (msg) { - layer.msg(msg, { - icon: 2, - time: 1000 - }) - }, - this.warning = function (msg) { - layer.msg(msg, { - icon: 3, - time: 1000 - }) - }, - this.success = function (msg, callback) { - layer.msg(msg, { - icon: 1, - time: 1000 - }, callback); - }, - this.failure = function (msg, callback) { - layer.msg(msg, { - icon: 2, - time: 1000 - }, callback); - }, - this.warning = function (msg, callback) { - layer.msg(msg, { - icon: 3, - time: 1000 - }, callback); - } - }; - exports(MOD_NAME, popup); + this.success = function(msg) { + layer.msg(msg, { + icon: 1, + time: 1000 + }) + }, + this.failure = function(msg) { + layer.msg(msg, { + icon: 2, + time: 1000 + }) + }, + this.warning = function(msg) { + layer.msg(msg, { + icon: 3, + time: 1000 + }) + }, + this.success = function(msg, callback) { + layer.msg(msg, { + icon: 1, + time: 1000 + }, callback); + }, + this.failure = function(msg, callback) { + layer.msg(msg, { + icon: 2, + time: 1000 + }, callback); + }, + this.warming = function(msg, callback) { + layer.msg(msg, { + icon: 3, + time: 1000 + }, callback); + } + }; + exports(MOD_NAME, popup); }) diff --git a/src/main/resources/static/component/pear/module/select.js b/src/main/resources/static/component/pear/module/select.js index 578eb8dc..3b095f72 100644 --- a/src/main/resources/static/component/pear/module/select.js +++ b/src/main/resources/static/component/pear/module/select.js @@ -4,335 +4,261 @@ * version: 4.0.0.0910 * http://sun.faysunshine.com/layui/formSelects-v4/dist/formSelects-v4.js */ -(function (layui, window, factory) { - if (typeof exports === 'object') { // 支持 CommonJS - module.exports = factory(); - } else if (typeof define === 'function' && define.amd) { // 支持 AMD - define(factory); - } else if (window.layui && layui.define) { //layui加载 - layui.define(['jquery'], function (exports) { - exports('select', factory()); - }); - } else { - window.formSelects = factory(); - } -})(typeof layui == 'undefined' ? null : layui, window, function () { - let v = '4.0.0.0910', - NAME = 'xm-select', - PNAME = 'xm-select-parent', - INPUT = 'xm-select-input', - TDIV = 'xm-select--suffix', - THIS = 'xm-select-this', - LABEL = 'xm-select-label', - SEARCH = 'xm-select-search', - SEARCH_TYPE = 'xm-select-search-type', - SHOW_COUNT = 'xm-select-show-count', - CREATE = 'xm-select-create', - CREATE_LONG = 'xm-select-create-long', - MAX = 'xm-select-max', - SKIN = 'xm-select-skin', - DIRECTION = "xm-select-direction", - HEIGHT = 'xm-select-height', - DISABLED = 'xm-dis-disabled', - DIS = 'xm-select-dis', - TEMP = 'xm-select-temp', - RADIO = 'xm-select-radio', - LINKAGE = 'xm-select-linkage', - DL = 'xm-select-dl', - DD_HIDE = 'xm-select-hide', - HIDE_INPUT = 'xm-hide-input', - SANJIAO = 'xm-select-sj', - ICON_CLOSE = 'xm-icon-close', - FORM_TITLE = 'xm-select-title', - FORM_SELECT = 'xm-form-select', - FORM_SELECTED = 'xm-form-selected', - FORM_NONE = 'xm-select-none', - FORM_EMPTY = 'xm-select-empty', - FORM_INPUT = 'xm-input', - FORM_DL_INPUT = 'xm-dl-input', - FORM_SELECT_TIPS = 'xm-select-tips', - CHECKBOX_YES = 'xm-iconfont', - FORM_TEAM_PID = 'XM_PID_VALUE', - CZ = 'xm-cz', - CZ_GROUP = 'xm-cz-group', - TIPS = '请选择', - data = {}, - events = { - on: {}, - endOn: {}, - filter: {}, - maxTips: {}, - opened: {}, - closed: {} - }, - ajax = { - type: 'get', - header: {}, - first: true, - data: {}, - searchUrl: '', - searchName: 'keyword', - searchVal: null, - keyName: 'name', - keyVal: 'value', - keySel: 'selected', - keyDis: 'disabled', - keyChildren: 'children', - dataType: '', - delay: 500, - beforeSuccess: null, - success: null, - error: null, - beforeSearch: null, - response: { - statusCode: 0, - statusName: 'code', - msgName: 'msg', - dataName: 'data' - }, - tree: { - nextClick: function (id, item, callback) { - callback([]); - }, - folderChoose: true, - lazy: true - } - }, - quickBtns = [ - { - icon: 'xm-iconfont icon-quanxuan', name: '全选', click: function (id, cm) { - cm.selectAll(id, true, true); - } - }, - { - icon: 'xm-iconfont icon-qingkong', name: '清空', click: function (id, cm) { - cm.removeAll(id, true, true); - } - }, - { - icon: 'xm-iconfont icon-fanxuan', name: '反选', click: function (id, cm) { - cm.reverse(id, true, true); - } - }, - { - icon: 'xm-iconfont icon-pifu', name: '换肤', click: function (id, cm) { - cm.skin(id); - } - } - ], - $ = window.$ || (window.layui && window.layui.jquery), - $win = $(window), - ajaxs = {}, - fsConfig = {}, - fsConfigs = {}, - FormSelects = function (options) { - this.config = { - name: null, //xm-select="xxx" - max: null, - maxTips: (id, vals, val, max) => { - let ipt = $(`[xid="${this.config.name}"]`).prev().find(`.${NAME}`); - if (ipt.parents('.layui-form-item[pane]').length) { - ipt = ipt.parents('.layui-form-item[pane]'); - } - ipt.attr('style', 'border-color: red !important'); - setTimeout(() => { - ipt.removeAttr('style'); - }, 300); - }, - init: null, //初始化的选择值, - on: null, //select值发生变化 - opened: null, - closed: null, - filter: (id, inputVal, val, isDisabled) => { - return val.name.indexOf(inputVal) == -1; - }, - clearid: -1, - direction: 'auto', - height: null, - isEmpty: false, - btns: [quickBtns[0], quickBtns[1], quickBtns[2]], - searchType: 0, - create: (id, name) => { - return Date.now(); - }, - template: (id, item) => { - return item.name; - }, - showCount: 0, - isCreate: false, - placeholder: TIPS, - clearInput: false, - }; - this.select = null; - this.values = []; - $.extend(this.config, options, { - searchUrl: options.isSearch ? options.searchUrl : null, - placeholder: options.optionsFirst ? ( - options.optionsFirst.value ? TIPS : (options.optionsFirst.innerHTML || TIPS) - ) : TIPS, - btns: options.radio ? [quickBtns[1]] : [quickBtns[0], quickBtns[1], quickBtns[2]], - }, fsConfigs[options.name] || fsConfig); - if (isNaN(this.config.showCount) || this.config.showCount <= 0) { - this.config.showCount = 19921012; - } - }; - - //一些简单的处理方法 - let Common = function () { - this.appender(); - this.on(); - this.onreset(); - }; - - Common.prototype.appender = function () {//针对IE做的一些拓展 - //拓展Array map方法 - if (!Array.prototype.map) { - Array.prototype.map = function (i, h) { - var b, a, c, e = Object(this), f = e.length >>> 0; - if (h) { - b = h - } - a = new Array(f); - c = 0; - while (c < f) { - var d, g; - if (c in e) { - d = e[c]; - g = i.call(b, d, c, e); - a[c] = g - } - c++ - } - return a - } - } - ; - - //拓展Array foreach方法 - if (!Array.prototype.forEach) { - Array.prototype.forEach = function forEach(g, b) { - var d, c; - if (this == null) { - throw new TypeError("this is null or not defined") - } - var f = Object(this); - var a = f.length >>> 0; - if (typeof g !== "function") { - throw new TypeError(g + " is not a function") - } - if (arguments.length > 1) { - d = b - } - c = 0; - while (c < a) { - var e; - if (c in f) { - e = f[c]; - g.call(d, e, c, f) - } - c++ - } - } - } - ; - - //拓展Array filter方法 - if (!Array.prototype.filter) { - Array.prototype.filter = function (b) { - if (this === void 0 || this === null) { - throw new TypeError() - } - var f = Object(this); - var a = f.length >>> 0; - if (typeof b !== "function") { - throw new TypeError() - } - var e = []; - var d = arguments[1]; - for (var c = 0; c < a; c++) { - if (c in f) { - var g = f[c]; - if (b.call(d, g, c, f)) { - e.push(g) - } - } - } - return e - } - } - ; - } - - Common.prototype.init = function (target) { - //初始化页面上已有的select - $((target ? target : `select[${NAME}]`)).each((index, select) => { - let othis = $(select), - id = othis.attr(NAME), - hasLayuiRender = othis.next(`.layui-form-select`), - hasRender = othis.next(`.${PNAME}`), - options = { - name: id, - disabled: select.disabled, - max: othis.attr(MAX) - 0, - isSearch: othis.attr(SEARCH) != undefined, - searchUrl: othis.attr(SEARCH), - isCreate: othis.attr(CREATE) != undefined, - radio: othis.attr(RADIO) != undefined, - skin: othis.attr(SKIN), - direction: othis.attr(DIRECTION), - optionsFirst: select.options[0], - height: othis.attr(HEIGHT), - formname: othis.attr('name') || othis.attr('_name'), - layverify: othis.attr('lay-verify') || othis.attr('_lay-verify'), - layverType: othis.attr('lay-verType'), - searchType: othis.attr(SEARCH_TYPE) == 'dl' ? 1 : 0, - showCount: othis.attr(SHOW_COUNT) - 0, - }, - value = othis.find('option[selected]').toArray().map((option) => {//获取已选中的数据 - return { - name: option.innerHTML, - value: option.value, - } - }), - fs = new FormSelects(options); - - fs.values = value; - - if (fs.config.init) { - fs.values = fs.config.init.map(item => { - if (typeof item == 'object') { - return item; - } - return { - name: othis.find(`option[value="${item}"]`).text(), - value: item - } - }).filter(item => { - return item.name; - }); - fs.config.init = fs.values.concat([]); - } else { - fs.config.init = value.concat([]); - } - - !fs.values && (fs.values = []); - - data[id] = fs; - - //先取消layui对select的渲染 - hasLayuiRender[0] && hasLayuiRender.remove(); - hasRender[0] && hasRender.remove(); - - //构造渲染div - let dinfo = this.renderSelect(id, fs.config.placeholder, select); - let heightStyle = !fs.config.height || fs.config.height == 'auto' ? '' : `xm-hg style="height: 34px;"`; - let inputHtml = [ - `
              `, - ``, - `
              ` - ]; - let reElem = - $(`
              +(function(layui, window, factory) { + if(typeof exports === 'object') { // 支持 CommonJS + module.exports = factory(); + } else if(typeof define === 'function' && define.amd) { // 支持 AMD + define(factory); + } else if(window.layui && layui.define) { //layui加载 + layui.define(['jquery'], function(exports) { + exports('select', factory()); + }); + } else { + window.formSelects = factory(); + } +})(typeof layui == 'undefined' ? null : layui, window, function() { + let v = '4.0.0.0910', + NAME = 'xm-select', + PNAME = 'xm-select-parent', + INPUT = 'xm-select-input', + TDIV = 'xm-select--suffix', + THIS = 'xm-select-this', + LABEL = 'xm-select-label', + SEARCH = 'xm-select-search', + SEARCH_TYPE = 'xm-select-search-type', + SHOW_COUNT = 'xm-select-show-count', + CREATE = 'xm-select-create', + CREATE_LONG = 'xm-select-create-long', + MAX = 'xm-select-max', + SKIN = 'xm-select-skin', + DIRECTION = "xm-select-direction", + HEIGHT = 'xm-select-height', + DISABLED = 'xm-dis-disabled', + DIS = 'xm-select-dis', + TEMP = 'xm-select-temp', + RADIO = 'xm-select-radio', + LINKAGE= 'xm-select-linkage', + DL = 'xm-select-dl', + DD_HIDE = 'xm-select-hide', + HIDE_INPUT = 'xm-hide-input', + SANJIAO = 'xm-select-sj', + ICON_CLOSE = 'xm-icon-close', + FORM_TITLE = 'xm-select-title', + FORM_SELECT = 'xm-form-select', + FORM_SELECTED = 'xm-form-selected', + FORM_NONE = 'xm-select-none', + FORM_EMPTY = 'xm-select-empty', + FORM_INPUT = 'xm-input', + FORM_DL_INPUT = 'xm-dl-input', + FORM_SELECT_TIPS = 'xm-select-tips', + CHECKBOX_YES = 'xm-iconfont', + FORM_TEAM_PID = 'XM_PID_VALUE', + CZ = 'xm-cz', + CZ_GROUP = 'xm-cz-group', + TIPS = '请选择', + data = {}, + events = { + on: {}, + endOn: {}, + filter: {}, + maxTips: {}, + opened: {}, + closed: {} + }, + ajax = { + type: 'get', + header: { + + }, + first: true, + data: {}, + searchUrl: '', + searchName: 'keyword', + searchVal: null, + keyName: 'name', + keyVal: 'value', + keySel: 'selected', + keyDis: 'disabled', + keyChildren: 'children', + dataType: '', + delay: 500, + beforeSuccess: null, + success: null, + error: null, + beforeSearch: null, + response: { + statusCode: 0, + statusName: 'code', + msgName: 'msg', + dataName: 'data' + }, + tree: { + nextClick: function(id, item, callback){ + callback([]); + }, + folderChoose: true, + lazy: true + } + }, + quickBtns = [ + {icon: 'xm-iconfont icon-quanxuan', name: '全选', click: function(id, cm){ + cm.selectAll(id, true, true); + }}, + {icon: 'xm-iconfont icon-qingkong', name: '清空', click: function(id, cm){ + cm.removeAll(id, true, true); + }}, + {icon: 'xm-iconfont icon-fanxuan', name: '反选', click: function(id, cm){ + cm.reverse(id, true, true); + }}, + {icon: 'xm-iconfont icon-pifu', name: '换肤', click: function(id, cm){ + cm.skin(id); + }} + ], + $ = window.$ || (window.layui && window.layui.jquery), + $win = $(window), + ajaxs = {}, + fsConfig = {}, + fsConfigs = {}, + FormSelects = function(options) { + this.config = { + name: null, //xm-select="xxx" + max: null, + maxTips: (id, vals, val, max) => { + let ipt = $(`[xid="${this.config.name}"]`).prev().find(`.${NAME}`); + if(ipt.parents('.layui-form-item[pane]').length) { + ipt = ipt.parents('.layui-form-item[pane]'); + } + ipt.attr('style', 'border-color: red !important'); + setTimeout(() => { + ipt.removeAttr('style'); + }, 300); + }, + init: null, //初始化的选择值, + on: null, //select值发生变化 + opened: null, + closed: null, + filter: (id, inputVal, val, isDisabled) => { + return val.name.indexOf(inputVal) == -1; + }, + clearid: -1, + direction: 'auto', + height: null, + isEmpty: false, + btns: [quickBtns[0], quickBtns[1], quickBtns[2]], + searchType: 0, + create: (id, name) => { + return Date.now(); + }, + template: (id, item) => { + return item.name; + }, + showCount: 0, + isCreate: false, + placeholder: TIPS, + clearInput: false, + }; + this.select = null; + this.values = []; + $.extend(this.config, options, { + searchUrl: options.isSearch ? options.searchUrl : null, + placeholder: options.optionsFirst ? ( + options.optionsFirst.value ? TIPS : (options.optionsFirst.innerHTML || TIPS) + ) : TIPS, + btns: options.radio ? [quickBtns[1]] : [quickBtns[0], quickBtns[1], quickBtns[2]], + }, fsConfigs[options.name] || fsConfig); + if(isNaN(this.config.showCount) || this.config.showCount <= 0) { + this.config.showCount = 19921012; + } + }; + + //一些简单的处理方法 + let Common = function(){ + this.appender(); + this.on(); + this.onreset(); + }; + + Common.prototype.appender = function(){//针对IE做的一些拓展 + //拓展Array map方法 + if(!Array.prototype.map){Array.prototype.map=function(i,h){var b,a,c,e=Object(this),f=e.length>>>0;if(h){b=h}a=new Array(f);c=0;while(c>>0;if(typeof g!=="function"){throw new TypeError(g+" is not a function")}if(arguments.length>1){d=b}c=0;while(c>>0;if(typeof b!=="function"){throw new TypeError()}var e=[];var d=arguments[1];for(var c=0;c { + let othis = $(select), + id = othis.attr(NAME), + hasLayuiRender = othis.next(`.layui-form-select`), + hasRender = othis.next(`.${PNAME}`), + options = { + name: id, + disabled: select.disabled, + max: othis.attr(MAX) - 0, + isSearch: othis.attr(SEARCH) != undefined, + searchUrl: othis.attr(SEARCH), + isCreate: othis.attr(CREATE) != undefined, + radio: othis.attr(RADIO) != undefined, + skin: othis.attr(SKIN), + direction: othis.attr(DIRECTION), + optionsFirst: select.options[0], + height: othis.attr(HEIGHT), + formname: othis.attr('name') || othis.attr('_name'), + layverify: othis.attr('lay-verify') || othis.attr('_lay-verify'), + layverType: othis.attr('lay-verType'), + searchType: othis.attr(SEARCH_TYPE) == 'dl' ? 1 : 0, + showCount: othis.attr(SHOW_COUNT) - 0, + }, + value = othis.find('option[selected]').toArray().map((option) => {//获取已选中的数据 + return { + name: option.innerHTML, + value: option.value, + } + }), + fs = new FormSelects(options); + + fs.values = value; + + if(fs.config.init) { + fs.values = fs.config.init.map(item => { + if(typeof item == 'object') { + return item; + } + return { + name: othis.find(`option[value="${item}"]`).text(), + value: item + } + }).filter(item => { + return item.name; + }); + fs.config.init = fs.values.concat([]); + }else{ + fs.config.init = value.concat([]); + } + + !fs.values && (fs.values = []); + + data[id] = fs; + + //先取消layui对select的渲染 + hasLayuiRender[0] && hasLayuiRender.remove(); + hasRender[0] && hasRender.remove(); + + //构造渲染div + let dinfo = this.renderSelect(id, fs.config.placeholder, select); + let heightStyle = !fs.config.height || fs.config.height == 'auto' ? '' : `xm-hg style="height: 34px;"`; + let inputHtml = [ + `
              `, + ``, + `
              ` + ]; + let reElem = + $(`
              @@ -344,303 +270,303 @@
              -
              ${dinfo}
              +
              ${dinfo}
              `); - - var $parent = $(`
              `); - $parent.append(reElem) - othis.after($parent); - othis.attr('lay-ignore', ''); - othis.removeAttr('name') && othis.attr('_name', fs.config.formname); - othis.removeAttr('lay-verify') && othis.attr('_lay-verify', fs.config.layverify); - - //如果可搜索, 加上事件 - if (fs.config.isSearch) { - ajaxs[id] = $.extend({}, ajax, {searchUrl: fs.config.searchUrl}, ajaxs[id]); - $(document).on('input', `div.${PNAME}[FS_ID="${id}"] .${INPUT}`, (e) => { - this.search(id, e, fs.config.searchUrl); - }); - if (fs.config.searchUrl) {//触发第一次请求事件 - this.triggerSearch(reElem, true); - } - } else {//隐藏第二个dl - reElem.find(`dl dd.${FORM_DL_INPUT}`).css('display', 'none'); - } - }); - } - - Common.prototype.search = function (id, e, searchUrl, call) { - let input; - if (call) { - input = call; - } else { - input = e.target; - let keyCode = e.keyCode; - if (keyCode === 9 || keyCode === 13 || keyCode === 37 || keyCode === 38 || keyCode === 39 || keyCode === 40) { - return false; - } - } - let inputValue = $.trim(input.value); - //过滤一下tips - this.changePlaceHolder($(input)); - - let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; - searchUrl = ajaxConfig.searchUrl || searchUrl; - let fs = data[id], - isCreate = fs.config.isCreate, - reElem = $(`dl[xid="${id}"]`).parents(`.${FORM_SELECT}`); - //如果开启了远程搜索 - if (searchUrl) { - if (ajaxConfig.searchVal) { - inputValue = ajaxConfig.searchVal; - ajaxConfig.searchVal = ''; - } - if (!ajaxConfig.beforeSearch || (ajaxConfig.beforeSearch && ajaxConfig.beforeSearch instanceof Function && ajaxConfig.beforeSearch(id, searchUrl, inputValue))) { - let delay = ajaxConfig.delay; - if (ajaxConfig.first) { - ajaxConfig.first = false; - delay = 10; - } - clearTimeout(fs.clearid); - fs.clearid = setTimeout(() => { - reElem.find(`dl > *:not(.${FORM_SELECT_TIPS})`).remove(); - reElem.find(`dd.${FORM_NONE}`).addClass(FORM_EMPTY).text('请求中'); - this.ajax(id, searchUrl, inputValue, false, null, true); - }, delay); - } - } else { - reElem.find(`dl .${DD_HIDE}`).removeClass(DD_HIDE); - //遍历选项, 选择可以显示的值 - reElem.find(`dl dd:not(.${FORM_SELECT_TIPS})`).each((idx, item) => { - let _item = $(item); - let searchFun = events.filter[id] || data[id].config.filter; - if (searchFun && searchFun(id, inputValue, this.getItem(id, _item), _item.hasClass(DISABLED)) == true) { - _item.addClass(DD_HIDE); - } - }); - //控制分组名称 - reElem.find('dl dt').each((index, item) => { - if (!$(item).nextUntil('dt', `:not(.${DD_HIDE})`).length) { - $(item).addClass(DD_HIDE); - } - }); - //动态创建 - this.create(id, isCreate, inputValue); - let shows = reElem.find(`dl dd:not(.${FORM_SELECT_TIPS}):not(.${DD_HIDE})`); - if (!shows.length) { - reElem.find(`dd.${FORM_NONE}`).addClass(FORM_EMPTY).text('无匹配项'); - } else { - reElem.find(`dd.${FORM_NONE}`).removeClass(FORM_EMPTY); - } - } - } - - Common.prototype.isArray = function (obj) { - return Object.prototype.toString.call(obj) == "[object Array]"; - } - - Common.prototype.triggerSearch = function (div, isCall) { - (div ? [div] : $(`.${FORM_SELECT}`).toArray()).forEach((reElem, index) => { - reElem = $(reElem); - let id = reElem.find('dl').attr('xid') - if ((id && data[id] && data[id].config.isEmpty) || isCall) { - this.search(id, null, null, data[id].config.searchType == 0 ? reElem.find(`.${LABEL} .${INPUT}`) : reElem.find(`dl .${FORM_DL_INPUT} .${INPUT}`)); - } - }); - } - - Common.prototype.clearInput = function (id) { - let div = $(`.${PNAME}[fs_id="${id}"]`); - let input = data[id].config.searchType == 0 ? div.find(`.${LABEL} .${INPUT}`) : div.find(`dl .${FORM_DL_INPUT} .${INPUT}`); - input.val(''); - } - - Common.prototype.ajax = function (id, searchUrl, inputValue, isLinkage, linkageWidth, isSearch, successCallback, isReplace) { - let reElem = $(`.${PNAME} dl[xid="${id}"]`).parents(`.${FORM_SELECT}`); - if (!reElem[0] || !searchUrl) { - return; - } - let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; - let ajaxData = $.extend(true, {}, ajaxConfig.data); - ajaxData[ajaxConfig.searchName] = inputValue; - //是否需要对ajax添加随机时间 - //ajaxData['_'] = Date.now(); - $.ajax({ - type: ajaxConfig.type, - headers: ajaxConfig.header, - url: searchUrl, - data: ajaxConfig.dataType == 'json' ? JSON.stringify(ajaxData) : ajaxData, - success: (res) => { - if (typeof res == 'string') { - res = JSON.parse(res); - } - ajaxConfig.beforeSuccess && ajaxConfig.beforeSuccess instanceof Function && (res = ajaxConfig.beforeSuccess(id, searchUrl, inputValue, res)); - if (this.isArray(res)) { - let newRes = {}; - newRes[ajaxConfig.response.statusName] = ajaxConfig.response.statusCode; - newRes[ajaxConfig.response.msgName] = ""; - newRes[ajaxConfig.response.dataName] = res; - res = newRes; - } - if (res[ajaxConfig.response.statusName] != ajaxConfig.response.statusCode) { - reElem.find(`dd.${FORM_NONE}`).addClass(FORM_EMPTY).text(res[ajaxConfig.response.msgName]); - } else { - reElem.find(`dd.${FORM_NONE}`).removeClass(FORM_EMPTY); - this.renderData(id, res[ajaxConfig.response.dataName], isLinkage, linkageWidth, isSearch, isReplace); - data[id].config.isEmpty = res[ajaxConfig.response.dataName].length == 0; - } - successCallback && successCallback(id); - ajaxConfig.success && ajaxConfig.success instanceof Function && ajaxConfig.success(id, searchUrl, inputValue, res); - }, - error: (err) => { - reElem.find(`dd[lay-value]:not(.${FORM_SELECT_TIPS})`).remove(); - reElem.find(`dd.${FORM_NONE}`).addClass(FORM_EMPTY).text('服务异常'); - ajaxConfig.error && ajaxConfig.error instanceof Function && ajaxConfig.error(id, searchUrl, inputValue, err); - } - }); - } - - Common.prototype.renderData = function (id, dataArr, linkage, linkageWidth, isSearch, isReplace) { - if (linkage) {//渲染多级联动 - this.renderLinkage(id, dataArr, linkageWidth); - return; - } - if (isReplace) { - this.renderReplace(id, dataArr); - return; - } - - let reElem = $(`.${PNAME} dl[xid="${id}"]`).parents(`.${FORM_SELECT}`); - let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; - let pcInput = reElem.find(`.${TDIV} input`); - - dataArr = this.exchangeData(id, dataArr); - let values = []; - reElem.find('dl').html(this.renderSelect(id, pcInput.attr('placeholder') || pcInput.attr('back'), dataArr.map((item) => { - let itemVal = $.extend({}, item, { - innerHTML: item[ajaxConfig.keyName], - value: item[ajaxConfig.keyVal], - sel: item[ajaxConfig.keySel], - disabled: item[ajaxConfig.keyDis], - type: item.type, - name: item[ajaxConfig.keyName] - }); - if (itemVal.sel) { - values.push(itemVal); - } - return itemVal; - }))); - - let label = reElem.find(`.${LABEL}`); - let dl = reElem.find('dl[xid]'); - if (isSearch) {//如果是远程搜索, 这里需要判重 - let oldVal = data[id].values; - oldVal.forEach((item, index) => { - dl.find(`dd[lay-value="${item.value}"]`).addClass(THIS); - }); - values.forEach((item, index) => { - if (this.indexOf(oldVal, item) == -1) { - this.addLabel(id, label, item); - dl.find(`dd[lay-value="${item.value}"]`).addClass(THIS); - oldVal.push(item); - } - }); - } else { - values.forEach((item, index) => { - this.addLabel(id, label, item); - dl.find(`dd[lay-value="${item.value}"]`).addClass(THIS); - }); - data[id].values = values; - } - this.commonHandler(id, label); - } - - Common.prototype.renderLinkage = function (id, dataArr, linkageWidth) { - let result = [], - index = 0, - temp = {"0": dataArr}, - ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; - db[id] = {}; - do { - let group = result[index++] = [], - _temp = temp; - temp = {}; - $.each(_temp, (pid, arr) => { - $.each(arr, (idx, item) => { - let val = { - pid: pid, - name: item[ajaxConfig.keyName], - value: item[ajaxConfig.keyVal], - }; - db[id][val.value] = $.extend(item, val); - group.push(val); - let children = item[ajaxConfig.keyChildren]; - if (children && children.length) { - temp[val.value] = children; - } - }); - }); - } while (Object.getOwnPropertyNames(temp).length); - - let reElem = $(`.${PNAME} dl[xid="${id}"]`).parents(`.${FORM_SELECT}`); - let html = ['
              ']; - - $.each(result, (idx, arr) => { - let groupDiv = [`
              `]; - $.each(arr, (idx2, item) => { - let span = `
            • ${item.name}
            • `; - groupDiv.push(span); - }); - groupDiv.push(`
              `); - html = html.concat(groupDiv); - }); - html.push('
              '); - html.push('
              '); - reElem.find('dl').html(html.join('')); - reElem.find(`.${INPUT}`).css('display', 'none');//联动暂时不支持搜索 - } - - Common.prototype.renderReplace = function (id, dataArr) { - let dl = $(`.${PNAME} dl[xid="${id}"]`); - let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; - - dataArr = this.exchangeData(id, dataArr); - db[id] = dataArr; - - let html = dataArr.map((item) => { - let itemVal = $.extend({}, item, { - innerHTML: item[ajaxConfig.keyName], - value: item[ajaxConfig.keyVal], - sel: item[ajaxConfig.keySel], - disabled: item[ajaxConfig.keyDis], - type: item.type, - name: item[ajaxConfig.keyName] - }); - return this.createDD(id, itemVal); - }).join(''); - - dl.find(`dd:not(.${FORM_SELECT_TIPS}),dt:not([style])`).remove(); - dl.find(`dt[style]`).after($(html)); - } - - Common.prototype.exchangeData = function (id, arr) {//这里处理树形结构 - let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; - let childrenName = ajaxConfig['keyChildren']; - let disabledName = ajaxConfig['keyDis']; - db[id] = {}; - let result = this.getChildrenList(arr, childrenName, disabledName, [], false); + + var $parent = $(`
              `); + $parent.append(reElem) + othis.after($parent); + othis.attr('lay-ignore', ''); + othis.removeAttr('name') && othis.attr('_name', fs.config.formname); + othis.removeAttr('lay-verify') && othis.attr('_lay-verify', fs.config.layverify); + + //如果可搜索, 加上事件 + if(fs.config.isSearch){ + ajaxs[id] = $.extend({}, ajax, {searchUrl: fs.config.searchUrl}, ajaxs[id]); + $(document).on('input', `div.${PNAME}[FS_ID="${id}"] .${INPUT}`, (e) => { + this.search(id, e, fs.config.searchUrl); + }); + if(fs.config.searchUrl){//触发第一次请求事件 + this.triggerSearch(reElem, true); + } + }else{//隐藏第二个dl + reElem.find(`dl dd.${FORM_DL_INPUT}`).css('display', 'none'); + } + }); + } + + Common.prototype.search = function(id, e, searchUrl, call){ + let input; + if(call){ + input = call; + }else{ + input = e.target; + let keyCode = e.keyCode; + if(keyCode === 9 || keyCode === 13 || keyCode === 37 || keyCode === 38 || keyCode === 39 || keyCode === 40) { + return false; + } + } + let inputValue = $.trim(input.value); + //过滤一下tips + this.changePlaceHolder($(input)); + + let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + searchUrl = ajaxConfig.searchUrl || searchUrl; + let fs = data[id], + isCreate = fs.config.isCreate, + reElem = $(`dl[xid="${id}"]`).parents(`.${FORM_SELECT}`); + //如果开启了远程搜索 + if(searchUrl){ + if(ajaxConfig.searchVal){ + inputValue = ajaxConfig.searchVal; + ajaxConfig.searchVal = ''; + } + if(!ajaxConfig.beforeSearch || (ajaxConfig.beforeSearch && ajaxConfig.beforeSearch instanceof Function && ajaxConfig.beforeSearch(id, searchUrl, inputValue))){ + let delay = ajaxConfig.delay; + if(ajaxConfig.first){ + ajaxConfig.first = false; + delay = 10; + } + clearTimeout(fs.clearid); + fs.clearid = setTimeout(() => { + reElem.find(`dl > *:not(.${FORM_SELECT_TIPS})`).remove(); + reElem.find(`dd.${FORM_NONE}`).addClass(FORM_EMPTY).text('请求中'); + this.ajax(id, searchUrl, inputValue, false, null, true); + }, delay); + } + }else{ + reElem.find(`dl .${DD_HIDE}`).removeClass(DD_HIDE); + //遍历选项, 选择可以显示的值 + reElem.find(`dl dd:not(.${FORM_SELECT_TIPS})`).each((idx, item) => { + let _item = $(item); + let searchFun = events.filter[id] || data[id].config.filter; + if(searchFun && searchFun(id, inputValue, this.getItem(id, _item), _item.hasClass(DISABLED)) == true){ + _item.addClass(DD_HIDE); + } + }); + //控制分组名称 + reElem.find('dl dt').each((index, item) => { + if(!$(item).nextUntil('dt', `:not(.${DD_HIDE})`).length) { + $(item).addClass(DD_HIDE); + } + }); + //动态创建 + this.create(id, isCreate, inputValue); + let shows = reElem.find(`dl dd:not(.${FORM_SELECT_TIPS}):not(.${DD_HIDE})`); + if(!shows.length){ + reElem.find(`dd.${FORM_NONE}`).addClass(FORM_EMPTY).text('无匹配项'); + }else{ + reElem.find(`dd.${FORM_NONE}`).removeClass(FORM_EMPTY); + } + } + } + + Common.prototype.isArray = function(obj){ + return Object.prototype.toString.call(obj) == "[object Array]"; + } + + Common.prototype.triggerSearch = function(div, isCall){ + (div ? [div] : $(`.${FORM_SELECT}`).toArray()).forEach((reElem, index) => { + reElem = $(reElem); + let id = reElem.find('dl').attr('xid') + if((id && data[id] && data[id].config.isEmpty) || isCall){ + this.search(id, null, null, data[id].config.searchType == 0 ? reElem.find(`.${LABEL} .${INPUT}`) : reElem.find(`dl .${FORM_DL_INPUT} .${INPUT}`)); + } + }); + } + + Common.prototype.clearInput = function(id){ + let div = $(`.${PNAME}[fs_id="${id}"]`); + let input = data[id].config.searchType == 0 ? div.find(`.${LABEL} .${INPUT}`) : div.find(`dl .${FORM_DL_INPUT} .${INPUT}`); + input.val(''); + } + + Common.prototype.ajax = function(id, searchUrl, inputValue, isLinkage, linkageWidth, isSearch, successCallback, isReplace){ + let reElem = $(`.${PNAME} dl[xid="${id}"]`).parents(`.${FORM_SELECT}`); + if(!reElem[0] || !searchUrl){ + return ; + } + let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + let ajaxData = $.extend(true, {}, ajaxConfig.data); + ajaxData[ajaxConfig.searchName] = inputValue; + //是否需要对ajax添加随机时间 + //ajaxData['_'] = Date.now(); + $.ajax({ + type: ajaxConfig.type, + headers: ajaxConfig.header, + url: searchUrl, + data: ajaxConfig.dataType == 'json' ? JSON.stringify(ajaxData) : ajaxData, + success: (res) => { + if(typeof res == 'string'){ + res = JSON.parse(res); + } + ajaxConfig.beforeSuccess && ajaxConfig.beforeSuccess instanceof Function && (res = ajaxConfig.beforeSuccess(id, searchUrl, inputValue, res)); + if(this.isArray(res)){ + let newRes = {}; + newRes[ajaxConfig.response.statusName] = ajaxConfig.response.statusCode; + newRes[ajaxConfig.response.msgName] = ""; + newRes[ajaxConfig.response.dataName] = res; + res = newRes; + } + if(res[ajaxConfig.response.statusName] != ajaxConfig.response.statusCode) { + reElem.find(`dd.${FORM_NONE}`).addClass(FORM_EMPTY).text(res[ajaxConfig.response.msgName]); + }else{ + reElem.find(`dd.${FORM_NONE}`).removeClass(FORM_EMPTY); + this.renderData(id, res[ajaxConfig.response.dataName], isLinkage, linkageWidth, isSearch, isReplace); + data[id].config.isEmpty = res[ajaxConfig.response.dataName].length == 0; + } + successCallback && successCallback(id); + ajaxConfig.success && ajaxConfig.success instanceof Function && ajaxConfig.success(id, searchUrl, inputValue, res); + }, + error: (err) => { + reElem.find(`dd[lay-value]:not(.${FORM_SELECT_TIPS})`).remove(); + reElem.find(`dd.${FORM_NONE}`).addClass(FORM_EMPTY).text('服务异常'); + ajaxConfig.error && ajaxConfig.error instanceof Function && ajaxConfig.error(id, searchUrl, inputValue, err); + } + }); + } + + Common.prototype.renderData = function(id, dataArr, linkage, linkageWidth, isSearch, isReplace){ + if(linkage){//渲染多级联动 + this.renderLinkage(id, dataArr, linkageWidth); + return; + } + if(isReplace){ + this.renderReplace(id, dataArr); + return; + } + + let reElem = $(`.${PNAME} dl[xid="${id}"]`).parents(`.${FORM_SELECT}`); + let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + let pcInput = reElem.find(`.${TDIV} input`); + + dataArr = this.exchangeData(id, dataArr); + let values = []; + reElem.find('dl').html(this.renderSelect(id, pcInput.attr('placeholder') || pcInput.attr('back'), dataArr.map((item) => { + let itemVal = $.extend({}, item, { + innerHTML: item[ajaxConfig.keyName], + value: item[ajaxConfig.keyVal], + sel: item[ajaxConfig.keySel], + disabled: item[ajaxConfig.keyDis], + type: item.type, + name: item[ajaxConfig.keyName] + }); + if(itemVal.sel){ + values.push(itemVal); + } + return itemVal; + }))); + + let label = reElem.find(`.${LABEL}`); + let dl = reElem.find('dl[xid]'); + if(isSearch){//如果是远程搜索, 这里需要判重 + let oldVal = data[id].values; + oldVal.forEach((item, index) => { + dl.find(`dd[lay-value="${item.value}"]`).addClass(THIS); + }); + values.forEach((item, index) => { + if(this.indexOf(oldVal, item) == -1){ + this.addLabel(id, label, item); + dl.find(`dd[lay-value="${item.value}"]`).addClass(THIS); + oldVal.push(item); + } + }); + }else{ + values.forEach((item, index) => { + this.addLabel(id, label, item); + dl.find(`dd[lay-value="${item.value}"]`).addClass(THIS); + }); + data[id].values = values; + } + this.commonHandler(id, label); + } + + Common.prototype.renderLinkage = function(id, dataArr, linkageWidth){ + let result = [], + index = 0, + temp = {"0": dataArr}, + ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + db[id] = {}; + do{ + let group = result[index ++] = [], + _temp = temp; + temp = {}; + $.each(_temp, (pid, arr) => { + $.each(arr, (idx, item) => { + let val = { + pid: pid, + name: item[ajaxConfig.keyName], + value: item[ajaxConfig.keyVal], + }; + db[id][val.value] = $.extend(item, val); + group.push(val); + let children = item[ajaxConfig.keyChildren]; + if(children && children.length){ + temp[val.value] = children; + } + }); + }); + }while(Object.getOwnPropertyNames(temp).length); + + let reElem = $(`.${PNAME} dl[xid="${id}"]`).parents(`.${FORM_SELECT}`); + let html = ['
              ']; + + $.each(result, (idx, arr) => { + let groupDiv = [`
              `]; + $.each(arr, (idx2, item) => { + let span = `
            • ${item.name}
            • `; + groupDiv.push(span); + }); + groupDiv.push(`
              `); + html = html.concat(groupDiv); + }); + html.push('
              '); + html.push('
              '); + reElem.find('dl').html(html.join('')); + reElem.find(`.${INPUT}`).css('display', 'none');//联动暂时不支持搜索 + } + + Common.prototype.renderReplace = function(id, dataArr){ + let dl = $(`.${PNAME} dl[xid="${id}"]`); + let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + + dataArr = this.exchangeData(id, dataArr); + db[id] = dataArr; + + let html = dataArr.map((item) => { + let itemVal = $.extend({}, item, { + innerHTML: item[ajaxConfig.keyName], + value: item[ajaxConfig.keyVal], + sel: item[ajaxConfig.keySel], + disabled: item[ajaxConfig.keyDis], + type: item.type, + name: item[ajaxConfig.keyName] + }); + return this.createDD(id, itemVal); + }).join(''); + + dl.find(`dd:not(.${FORM_SELECT_TIPS}),dt:not([style])`).remove(); + dl.find(`dt[style]`).after($(html)); + } + + Common.prototype.exchangeData = function(id, arr){//这里处理树形结构 + let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + let childrenName = ajaxConfig['keyChildren']; + let disabledName = ajaxConfig['keyDis']; + db[id] = {}; + let result = this.getChildrenList(arr, childrenName, disabledName, [], false); return result; - } + } - Common.prototype.getChildrenList = function (arr, childrenName, disabledName, pid, disabled) { - let result = [], offset = 0; - for (let a = 0; a < arr.length; a++) { + Common.prototype.getChildrenList = function(arr, childrenName, disabledName, pid, disabled){ + let result = [], offset = 0; + for(let a = 0; a < arr.length; a ++){ let item = arr[a]; - if (item.type && item.type == 'optgroup') { - result.push(item); - continue; - } else { - offset++; + if(item.type && item.type == 'optgroup'){ + result.push(item); + continue; + }else{ + offset ++; } let parentIds = pid.concat([]); parentIds.push(`${offset - 1}_E`); @@ -648,1168 +574,1167 @@ item[disabledName] = item[disabledName] || disabled; result.push(item); let child = item[childrenName]; - if (child && common.isArray(child) && child.length) { - item['XM_TREE_FOLDER'] = true; + if(child && common.isArray(child) && child.length){ + item['XM_TREE_FOLDER'] = true; let pidArr = parentIds.concat([]); let childResult = this.getChildrenList(child, childrenName, disabledName, pidArr, item[disabledName]); result = result.concat(childResult); } } return result; - } - - Common.prototype.create = function (id, isCreate, inputValue) { - if (isCreate && inputValue) { - let fs = data[id], - dl = $(`[xid="${id}"]`), - tips = dl.find(`dd.${FORM_SELECT_TIPS}.${FORM_DL_INPUT}`), - tdd = null, - temp = dl.find(`dd.${TEMP}`); - dl.find(`dd:not(.${FORM_SELECT_TIPS}):not(.${TEMP})`).each((index, item) => { - if (inputValue == $(item).find('span').attr('name')) { - tdd = item; - } - }); - if (!tdd) {//如果不存在, 则创建 - let val = fs.config.create(id, inputValue); - if (temp[0]) { - temp.attr('lay-value', val); - temp.find('span').text(inputValue); - temp.find('span').attr("name", inputValue); - temp.removeClass(DD_HIDE); - } else { - tips.after($(this.createDD(id, { - name: inputValue, - innerHTML: inputValue, - value: val - }, `${TEMP} ${CREATE_LONG}`))); - } - } - } else { - $(`[xid=${id}] dd.${TEMP}`).remove(); - } - } - - Common.prototype.createDD = function (id, item, clz) { - let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; - let name = $.trim(item.innerHTML); - db[id][item.value] = $(item).is('option') ? (item = function () { - let resultItem = {}; - resultItem[ajaxConfig.keyName] = name; - resultItem[ajaxConfig.keyVal] = item.value; - resultItem[ajaxConfig.keyDis] = item.disabled; - return resultItem; - }()) : item; - let template = data[id].config.template(id, item); - let pid = item[FORM_TEAM_PID]; - pid ? (pid = JSON.parse(pid)) : (pid = [-1]); - let attr = pid[0] == -1 ? '' : `tree-id="${pid.join('-')}" tree-folder="${!!item['XM_TREE_FOLDER']}"`; - return `
              + } + + Common.prototype.create = function(id, isCreate, inputValue){ + if(isCreate && inputValue){ + let fs = data[id], + dl = $(`[xid="${id}"]`), + tips= dl.find(`dd.${FORM_SELECT_TIPS}.${FORM_DL_INPUT}`), + tdd = null, + temp = dl.find(`dd.${TEMP}`); + dl.find(`dd:not(.${FORM_SELECT_TIPS}):not(.${TEMP})`).each((index, item) => { + if(inputValue == $(item).find('span').attr('name')){ + tdd = item; + } + }); + if(!tdd){//如果不存在, 则创建 + let val = fs.config.create(id, inputValue); + if(temp[0]){ + temp.attr('lay-value', val); + temp.find('span').text(inputValue); + temp.find('span').attr("name", inputValue); + temp.removeClass(DD_HIDE); + }else{ + tips.after($(this.createDD(id, { + name: inputValue, + innerHTML: inputValue, + value: val + }, `${TEMP} ${CREATE_LONG}`))); + } + } + }else{ + $(`[xid=${id}] dd.${TEMP}`).remove(); + } + } + + Common.prototype.createDD = function(id, item, clz){ + let ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + let name = $.trim(item.innerHTML); + db[id][item.value] = $(item).is('option') ? (item = function(){ + let resultItem = {}; + resultItem[ajaxConfig.keyName] = name; + resultItem[ajaxConfig.keyVal] = item.value; + resultItem[ajaxConfig.keyDis] = item.disabled; + return resultItem; + }()) : item; + let template = data[id].config.template(id, item); + let pid = item[FORM_TEAM_PID]; + pid ? (pid = JSON.parse(pid)) : (pid = [-1]); + let attr = pid[0] == -1 ? '' : `tree-id="${pid.join('-')}" tree-folder="${!!item['XM_TREE_FOLDER']}"`; + return `
              ${template}
              `; - } - - Common.prototype.createQuickBtn = function (obj, right) { - return `
              ${obj.name}
              ` - } - - Common.prototype.renderBtns = function (id, show, right) { - let quickBtn = []; - let dl = $(`dl[xid="${id}"]`); - quickBtn.push(`
              `); - $.each(data[id].config.btns, (index, item) => { - quickBtn.push(this.createQuickBtn(item, right)); - }); - quickBtn.push(`
              `); - quickBtn.push(this.createQuickBtn({icon: 'xm-iconfont icon-caidan', name: ''})); - return quickBtn.join(''); - } - - Common.prototype.renderSelect = function (id, tips, select) { - db[id] = {}; - let arr = []; - if (data[id].config.btns.length) { - setTimeout(() => { - let dl = $(`dl[xid="${id}"]`); - dl.parents(`.${FORM_SELECT}`).attr(SEARCH_TYPE, data[id].config.searchType); - dl.find(`.${CZ_GROUP}`).css('max-width', `${dl.prev().width() - 54}px`); - }, 10) - arr.push([ - `
              `, - this.renderBtns(id, null, '30px'), - `
              `, - `
              `, - ``, - ``, - `
              ` - ].join('')); - } else { - arr.push(`
              ${tips}
              `); - } - if (this.isArray(select)) { - $(select).each((index, item) => { - if (item) { - if (item.type && item.type === 'optgroup') { - arr.push(`
              ${item.name}
              `); - } else { - arr.push(this.createDD(id, item)); - } - } - }); - } else { - $(select).find('*').each((index, item) => { - if (item.tagName.toLowerCase() == 'option' && index == 0 && !item.value) { - return; - } - if (item.tagName.toLowerCase() === 'optgroup') { - arr.push(`
              ${item.label}
              `); - } else { - arr.push(this.createDD(id, item)); - } - }); - } - arr.push('
              '); - arr.push(`
              没有选项
              `); - return arr.join(''); - } - - Common.prototype.on = function () {//事件绑定 - this.one(); - - $(document).on('click', (e) => { - if (!$(e.target).parents(`.${FORM_TITLE}`)[0]) {//清空input中的值 - $(`.${PNAME} dl .${DD_HIDE}`).removeClass(DD_HIDE); - $(`.${PNAME} dl dd.${FORM_EMPTY}`).removeClass(FORM_EMPTY); - $(`.${PNAME} dl dd.${TEMP}`).remove(); - $.each(data, (key, fs) => { - this.clearInput(key); - if (!fs.values.length) { - this.changePlaceHolder($(`div[FS_ID="${key}"] .${LABEL}`)); - } - }); - } - $(`.${PNAME} .${FORM_SELECTED}`).each((index, item) => { - this.changeShow($(item).find(`.${FORM_TITLE}`), false); - }); - }); - } - - Common.prototype.calcLabelLeft = function (label, w, call) { - let pos = this.getPosition(label[0]); - pos.y = pos.x + label[0].clientWidth; - let left = label[0].offsetLeft; - if (!label.find('span').length) { - left = 0; - } else if (call) {//校正归位 - let span = label.find('span:last'); - span.css('display') == 'none' ? (span = span.prev()[0]) : (span = span[0]); - let spos = this.getPosition(span); - spos.y = spos.x + span.clientWidth; - - if (spos.y > pos.y) { - left = left - (spos.y - pos.y) - 5; - } else { - left = 0; - } - } else { - if (w < 0) { - let span = label.find(':last'); - span.css('display') == 'none' ? (span = span.prev()[0]) : (span = span[0]); - let spos = this.getPosition(span); - spos.y = spos.x + span.clientWidth; - if (spos.y > pos.y) { - left -= 10; - } - } else { - if (left < 0) { - left += 10; - } - if (left > 0) { - left = 0; - } - } - } - label.css('left', left + 'px'); - } - - Common.prototype.one = function (target) {//一次性事件绑定 - $(target ? target : document).off('click', `.${FORM_TITLE}`).on('click', `.${FORM_TITLE}`, (e) => { - let othis = $(e.target), - title = othis.is(FORM_TITLE) ? othis : othis.parents(`.${FORM_TITLE}`), - dl = title.next(), - id = dl.attr('xid'); - - //清空非本select的input val - $(`dl[xid]`).not(dl).each((index, item) => { - this.clearInput($(item).attr('xid')); - }); - $(`dl[xid]`).not(dl).find(`dd.${DD_HIDE}`).removeClass(DD_HIDE); - - //如果是disabled select - if (title.hasClass(DIS)) { - return false; - } - //如果点击的是右边的三角或者只读的input - if (othis.is(`.${SANJIAO}`) || othis.is(`.${INPUT}[readonly]`)) { - this.changeShow(title, !title.parents(`.${FORM_SELECT}`).hasClass(FORM_SELECTED)); - return false; - } - //如果点击的是input的右边, focus一下 - if (title.find(`.${INPUT}:not(readonly)`)[0]) { - let input = title.find(`.${INPUT}`), - epos = {x: e.pageX, y: e.pageY}, - pos = this.getPosition(title[0]), - width = title.width(); - while (epos.x > pos.x) { - if ($(document.elementFromPoint(epos.x, epos.y)).is(input)) { - input.focus(); - this.changeShow(title, true); - return false; - } - epos.x -= 50; - } - } - - //如果点击的是可搜索的input - if (othis.is(`.${INPUT}`)) { - this.changeShow(title, true); - return false; - } - //如果点击的是x按钮 - if (othis.is(`i[fsw="${NAME}"]`)) { - let val = this.getItem(id, othis), - dd = dl.find(`dd[lay-value='${val.value}']`); - if (dd.hasClass(DISABLED)) {//如果是disabled状态, 不可选, 不可删 - return false; - } - this.handlerLabel(id, dd, false, val); - return false; - } - - this.changeShow(title, !title.parents(`.${FORM_SELECT}`).hasClass(FORM_SELECTED)); - return false; - }); - $(target ? target : document).off('click', `dl.${DL}`).on('click', `dl.${DL}`, (e) => { - let othis = $(e.target); - if (othis.is(`.${LINKAGE}`) || othis.parents(`.${LINKAGE}`)[0]) {//linkage的处理 - othis = othis.is('li') ? othis : othis.parents('li[xm-value]'); - let group = othis.parents('.xm-select-linkage-group'), - id = othis.parents('dl').attr('xid'); - if (!id) { - return false; - } - //激活li - group.find('.xm-select-active').removeClass('xm-select-active'); - othis.addClass('xm-select-active'); - //激活下一个group, 激活前显示对应数据 - group.nextAll('.xm-select-linkage-group').addClass('xm-select-linkage-hide'); - let nextGroup = group.next('.xm-select-linkage-group'); - nextGroup.find('li').addClass('xm-select-linkage-hide'); - nextGroup.find(`li[pid="${othis.attr('xm-value')}"]`).removeClass('xm-select-linkage-hide'); - //如果没有下一个group, 或没有对应的值 - if (!nextGroup[0] || nextGroup.find(`li:not(.xm-select-linkage-hide)`).length == 0) { - let vals = [], - index = 0, - isAdd = !othis.hasClass('xm-select-this'); - if (data[id].config.radio) { - othis.parents('.xm-select-linkage').find('.xm-select-this').removeClass('xm-select-this'); - } - do { - vals[index++] = { - name: othis.find('span').text(), - value: othis.attr('xm-value') - } - othis = othis.parents('.xm-select-linkage-group').prev().find(`li[xm-value="${othis.attr('pid')}"]`); - } while (othis.length); - vals.reverse(); - let val = { - name: vals.map((item) => { - return item.name; - }).join('/'), - value: vals.map((item) => { - return item.value; - }).join('/'), - } - this.handlerLabel(id, null, isAdd, val); - } else { - nextGroup.removeClass('xm-select-linkage-hide'); - } - return false; - } - - if (othis.is('dl')) { - return false; - } - - if (othis.is('dt')) { - othis.nextUntil(`dt`).each((index, item) => { - item = $(item); - if (item.hasClass(DISABLED) || item.hasClass(THIS)) { - - } else { - item.find('i:not(.icon-expand)').click(); - } - }); - return false; - } - let dd = othis.is('dd') ? othis : othis.parents('dd'); - let id = dd.parent('dl').attr('xid'); - - if (dd.hasClass(DISABLED)) {//被禁用选项的处理 - return false; - } - - //菜单功效 - if (othis.is('i.icon-caidan')) { - let opens = [], closes = []; - othis.parents('dl').find('dd[tree-folder="true"]').each((index, item) => { - $(item).attr('xm-tree-hidn') == undefined ? opens.push(item) : closes.push(item); - }); - let arr = closes.length ? closes : opens; - arr.forEach(item => item.click()); - return false; - } - //树状结构的选择 - let treeId = dd.attr('tree-id'); - if (treeId) { - //忽略右边的图标 - if (othis.is('i:not(.icon-expand)')) { - this.handlerLabel(id, dd, !dd.hasClass(THIS)); - return false; - } - let ajaxConfig = ajaxs[id] || ajax; - let treeConfig = ajaxConfig.tree; - let childrens = dd.nextAll(`dd[tree-id^="${treeId}"]`); - if (childrens && childrens.length) { - let len = childrens[0].clientHeight; - len ? ( - this.addTreeHeight(dd, len), - len = 0 - ) : ( - len = dd.attr('xm-tree-hidn') || 36, - dd.removeAttr('xm-tree-hidn'), - dd.find('>i').remove(), - (childrens = childrens.filter((index, item) => $(item).attr('tree-id').split('-').length - 1 == treeId.split('-').length)) - ); - childrens.animate({ - height: len - }, 150) - return false; - } else { - if (treeConfig.nextClick && treeConfig.nextClick instanceof Function) { - treeConfig.nextClick(id, this.getItem(id, dd), (res) => { - if (!res || !res.length) { - this.handlerLabel(id, dd, !dd.hasClass(THIS)); - } else { - dd.attr('tree-folder', 'true'); - let ddChilds = []; - res.forEach((item, idx) => { - item.innerHTML = item[ajaxConfig.keyName]; - item[FORM_TEAM_PID] = JSON.stringify(treeId.split('-').concat([idx])); - ddChilds.push(this.createDD(id, item)); - db[id][item[ajaxConfig.keyVal]] = item; - }); - dd.after(ddChilds.join('')); - } - }); - return false; - } - } - } - - if (dd.hasClass(FORM_SELECT_TIPS)) {//tips的处理 - let btn = othis.is(`.${CZ}`) ? othis : othis.parents(`.${CZ}`); - if (!btn[0]) { - return false; - } - let method = btn.attr('method'); - let obj = data[id].config.btns.filter(bean => bean.name == method)[0]; - obj && obj.click && obj.click instanceof Function && obj.click(id, this); - return false; - } - this.handlerLabel(id, dd, !dd.hasClass(THIS)); - return false; - }); - } - - Common.prototype.addTreeHeight = function (dd, len) { - let treeId = dd.attr('tree-id'); - let childrens = dd.nextAll(`dd[tree-id^="${treeId}"]`); - if (childrens.length) { - dd.append(''); - dd.attr('xm-tree-hidn', len); - childrens.each((index, item) => { - let that = $(item); - this.addTreeHeight(that, len); - }) - } - } - - let db = {}; - Common.prototype.getItem = function (id, value) { - if (value instanceof $) { - if (value.is(`i[fsw="${NAME}"]`)) { - let span = value.parent(); - return db[id][value] || { - name: span.find('font').text(), - value: span.attr('value') - } - } - let val = value.attr('lay-value'); - return !db[id][val] ? (db[id][val] = { - name: value.find('span[name]').attr('name'), - value: val - }) : db[id][val]; - } else if (typeof (value) == 'string' && value.indexOf('/') != -1) { - return db[id][value] || { - name: this.valToName(id, value), - value: value - } - } - return db[id][value]; - } - - Common.prototype.linkageAdd = function (id, val) { - let dl = $(`dl[xid="${id}"]`); - dl.find('.xm-select-active').removeClass('xm-select-active'); - let vs = val.value.split('/'); - let pid, li, index = 0; - let lis = []; - do { - pid = vs[index]; - li = dl.find(`.xm-select-linkage-group${index + 1} li[xm-value="${pid}"]`); - li[0] && lis.push(li); - index++; - } while (li.length && pid != undefined); - if (lis.length == vs.length) { - $.each(lis, (idx, item) => { - item.addClass('xm-select-this'); - }); - } - } - - Common.prototype.linkageDel = function (id, val) { - let dl = $(`dl[xid="${id}"]`); - let vs = val.value.split('/'); - let pid, li, index = vs.length - 1; - do { - pid = vs[index]; - li = dl.find(`.xm-select-linkage-group${index + 1} li[xm-value="${pid}"]`); - if (!li.parent().next().find(`li[pid=${pid}].xm-select-this`).length) { - li.removeClass('xm-select-this'); - } - index--; - } while (li.length && pid != undefined); - } - - Common.prototype.valToName = function (id, val) { - let dl = $(`dl[xid="${id}"]`); - let vs = (val + "").split('/'); - if (!vs.length) { - return null; - } - let names = []; - $.each(vs, (idx, item) => { - let name = dl.find(`.xm-select-linkage-group${idx + 1} li[xm-value="${item}"] span`).text(); - names.push(name); - }); - return names.length == vs.length ? names.join('/') : null; - } - - Common.prototype.commonHandler = function (key, label) { - if (!label || !label[0]) { - return; - } - this.checkHideSpan(key, label); - //计算input的提示语 - this.changePlaceHolder(label); - //计算高度 - this.retop(label.parents(`.${FORM_SELECT}`)); - this.calcLabelLeft(label, 0, true); - //表单默认值 - this.setHidnVal(key, label); - //title值 - label.parents(`.${FORM_TITLE} .${NAME}`).attr('title', data[key].values.map((val) => { - return val.name; - }).join(',')); - } - - Common.prototype.initVal = function (id) { - let target = {}; - if (id) { - target[id] = data[id]; - } else { - target = data; - } - $.each(target, (key, val) => { - let values = val.values, - div = $(`dl[xid="${key}"]`).parent(), - label = div.find(`.${LABEL}`), - dl = div.find('dl'); - dl.find(`dd.${THIS}`).removeClass(THIS); - - let _vals = values.concat([]); - _vals.concat([]).forEach((item, index) => { - this.addLabel(key, label, item); - dl.find(`dd[lay-value="${item.value}"]`).addClass(THIS); - }); - if (val.config.radio) { - _vals.length && values.push(_vals[_vals.length - 1]); - } - this.commonHandler(key, label); - }); - } - - Common.prototype.setHidnVal = function (key, label) { - if (!label || !label[0]) { - return; - } - label.parents(`.${PNAME}`).find(`.${HIDE_INPUT}`).val(data[key].values.map((val) => { - return val.value; - }).join(',')); - } - - Common.prototype.handlerLabel = function (id, dd, isAdd, oval, notOn) { - let div = $(`[xid="${id}"]`).prev().find(`.${LABEL}`), - val = dd && this.getItem(id, dd), - vals = data[id].values, - on = data[id].config.on || events.on[id], - endOn = data[id].config.endOn || events.endOn[id]; - if (oval) { - val = oval; - } - let fs = data[id]; - if (isAdd && fs.config.max && fs.values.length >= fs.config.max) { - let maxTipsFun = events.maxTips[id] || data[id].config.maxTips; - maxTipsFun && maxTipsFun(id, vals.concat([]), val, fs.config.max); - return; - } - if (!notOn) { - if (on && on instanceof Function && on(id, vals.concat([]), val, isAdd, dd && dd.hasClass(DISABLED)) == false) { - return; - } - } - let dl = $(`dl[xid="${id}"]`); - isAdd ? ( - (dd && dd[0] ? ( - dd.addClass(THIS), - dd.removeClass(TEMP) - ) : ( - dl.find('.xm-select-linkage')[0] && this.linkageAdd(id, val) - )), - this.addLabel(id, div, val), - vals.push(val) - ) : ( - (dd && dd[0] ? ( - dd.removeClass(THIS) - ) : ( - dl.find('.xm-select-linkage')[0] && this.linkageDel(id, val) - )), - this.delLabel(id, div, val), - this.remove(vals, val) - ); - if (!div[0]) return; - //单选选完后直接关闭选择域 - if (fs.config.radio) { - this.changeShow(div, false); - } - //移除表单验证的红色边框 - div.parents(`.${FORM_TITLE}`).prev().removeClass('layui-form-danger'); - - //清空搜索值 - fs.config.clearInput && this.clearInput(id); - - this.commonHandler(id, div); - - !notOn && endOn && endOn instanceof Function && endOn(id, vals.concat([]), val, isAdd, dd && dd.hasClass(DISABLED)); - } - - Common.prototype.addLabel = function (id, div, val) { - if (!val) return; - let tips = `fsw="${NAME}"`; - let [$label, $close] = [ - $(`${val.name}`), - $(``) - ]; - $label.append($close); - //如果是radio模式 - let fs = data[id]; - if (fs.config.radio) { - fs.values.length = 0; - $(`dl[xid="${id}"]`).find(`dd.${THIS}:not([lay-value="${val.value}"])`).removeClass(THIS); - div.find('span').remove(); - } - //如果是固定高度 - div.find('input').css('width', '50px'); - div.find('input').before($label); - } - - Common.prototype.delLabel = function (id, div, val) { - if (!val) return; - div.find(`span[value="${val.value}"]:first`).remove(); - } - - Common.prototype.checkHideSpan = function (id, div) { - let parentHeight = div.parents(`.${NAME}`)[0].offsetHeight + 5; - div.find('span.xm-span-hide').removeClass('xm-span-hide'); - div.find('span[style]').remove(); - - let count = data[id].config.showCount; - div.find('span').each((index, item) => { - if (index >= count) { - $(item).addClass('xm-span-hide'); - } - }); - - let prefix = div.find(`span:eq(${count})`); - prefix[0] && prefix.before($(` + ${div.find('span').length - count}`)) - } - - Common.prototype.retop = function (div) {//计算dl显示的位置 - let dl = div.find('dl'), - top = div.offset().top + div.outerHeight() + 5 - $win.scrollTop(), + } + + Common.prototype.createQuickBtn = function(obj, right){ + return `
              ${obj.name}
              ` + } + + Common.prototype.renderBtns = function(id, show, right){ + let quickBtn = []; + let dl = $(`dl[xid="${id}"]`); + quickBtn.push(`
              `); + $.each(data[id].config.btns, (index, item) => { + quickBtn.push(this.createQuickBtn(item, right)); + }); + quickBtn.push(`
              `); + quickBtn.push(this.createQuickBtn({icon: 'xm-iconfont icon-caidan', name: ''})); + return quickBtn.join(''); + } + + Common.prototype.renderSelect = function(id, tips, select){ + db[id] = {}; + let arr = []; + if(data[id].config.btns.length){ + setTimeout(() => { + let dl = $(`dl[xid="${id}"]`); + dl.parents(`.${FORM_SELECT}`).attr(SEARCH_TYPE, data[id].config.searchType); + dl.find(`.${CZ_GROUP}`).css('max-width', `${dl.prev().width() - 54}px`); + }, 10) + arr.push([ + `
              `, + this.renderBtns(id, null, '30px'), + `
              `, + `
              `, + ``, + ``, + `
              ` + ].join('')); + }else{ + arr.push(`
              ${tips}
              `); + } + if(this.isArray(select)){ + $(select).each((index, item) => { + if(item){ + if(item.type && item.type === 'optgroup') { + arr.push(`
              ${item.name}
              `); + } else { + arr.push(this.createDD(id, item)); + } + } + }); + }else{ + $(select).find('*').each((index, item) => { + if(item.tagName.toLowerCase() == 'option' && index == 0 && !item.value){ + return ; + } + if(item.tagName.toLowerCase() === 'optgroup') { + arr.push(`
              ${item.label}
              `); + } else { + arr.push(this.createDD(id, item)); + } + }); + } + arr.push('
              '); + arr.push(`
              没有选项
              `); + return arr.join(''); + } + + Common.prototype.on = function(){//事件绑定 + this.one(); + + $(document).on('click', (e) => { + if(!$(e.target).parents(`.${FORM_TITLE}`)[0]){//清空input中的值 + $(`.${PNAME} dl .${DD_HIDE}`).removeClass(DD_HIDE); + $(`.${PNAME} dl dd.${FORM_EMPTY}`).removeClass(FORM_EMPTY); + $(`.${PNAME} dl dd.${TEMP}`).remove(); + $.each(data, (key, fs) => { + this.clearInput(key); + if(!fs.values.length){ + this.changePlaceHolder($(`div[FS_ID="${key}"] .${LABEL}`)); + } + }); + } + $(`.${PNAME} .${FORM_SELECTED}`).each((index, item) => { + this.changeShow($(item).find(`.${FORM_TITLE}`), false); + }) ; + }); + } + + Common.prototype.calcLabelLeft = function(label, w, call){ + let pos = this.getPosition(label[0]); + pos.y = pos.x + label[0].clientWidth; + let left = label[0].offsetLeft; + if(!label.find('span').length){ + left = 0; + }else if(call){//校正归位 + let span = label.find('span:last'); + span.css('display') == 'none' ? (span = span.prev()[0]) : (span = span[0]); + let spos = this.getPosition(span); + spos.y = spos.x + span.clientWidth; + + if(spos.y > pos.y){ + left = left - (spos.y - pos.y) - 5; + }else{ + left = 0; + } + }else{ + if(w < 0){ + let span = label.find(':last'); + span.css('display') == 'none' ? (span = span.prev()[0]) : (span = span[0]); + let spos = this.getPosition(span); + spos.y = spos.x + span.clientWidth; + if(spos.y > pos.y){ + left -= 10; + } + }else{ + if(left < 0){ + left += 10; + } + if(left > 0){ + left = 0; + } + } + } + label.css('left', left + 'px'); + } + + Common.prototype.one = function(target){//一次性事件绑定 + $(target ? target : document).off('click', `.${FORM_TITLE}`).on('click', `.${FORM_TITLE}`, (e) => { + let othis = $(e.target), + title = othis.is(FORM_TITLE) ? othis : othis.parents(`.${FORM_TITLE}`), + dl = title.next(), + id = dl.attr('xid'); + + //清空非本select的input val + $(`dl[xid]`).not(dl).each((index, item) => { + this.clearInput($(item).attr('xid')); + }); + $(`dl[xid]`).not(dl).find(`dd.${DD_HIDE}`).removeClass(DD_HIDE); + + //如果是disabled select + if(title.hasClass(DIS)){ + return false; + } + //如果点击的是右边的三角或者只读的input + if(othis.is(`.${SANJIAO}`) || othis.is(`.${INPUT}[readonly]`)){ + this.changeShow(title, !title.parents(`.${FORM_SELECT}`).hasClass(FORM_SELECTED)); + return false; + } + //如果点击的是input的右边, focus一下 + if(title.find(`.${INPUT}:not(readonly)`)[0]){ + let input = title.find(`.${INPUT}`), + epos = {x: e.pageX, y: e.pageY}, + pos = this.getPosition(title[0]), + width = title.width(); + while(epos.x > pos.x){ + if($(document.elementFromPoint(epos.x, epos.y)).is(input)){ + input.focus(); + this.changeShow(title, true); + return false; + } + epos.x -= 50; + } + } + + //如果点击的是可搜索的input + if(othis.is(`.${INPUT}`)){ + this.changeShow(title, true); + return false; + } + //如果点击的是x按钮 + if(othis.is(`i[fsw="${NAME}"]`)){ + let val = this.getItem(id, othis), + dd = dl.find(`dd[lay-value='${val.value}']`); + if(dd.hasClass(DISABLED)){//如果是disabled状态, 不可选, 不可删 + return false; + } + this.handlerLabel(id, dd, false, val); + return false; + } + + this.changeShow(title, !title.parents(`.${FORM_SELECT}`).hasClass(FORM_SELECTED)); + return false; + }); + $(target ? target : document).off('click', `dl.${DL}`).on('click', `dl.${DL}`, (e) => { + let othis = $(e.target); + if(othis.is(`.${LINKAGE}`) || othis.parents(`.${LINKAGE}`)[0]){//linkage的处理 + othis = othis.is('li') ? othis : othis.parents('li[xm-value]'); + let group = othis.parents('.xm-select-linkage-group'), + id = othis.parents('dl').attr('xid'); + if(!id){ + return false; + } + //激活li + group.find('.xm-select-active').removeClass('xm-select-active'); + othis.addClass('xm-select-active'); + //激活下一个group, 激活前显示对应数据 + group.nextAll('.xm-select-linkage-group').addClass('xm-select-linkage-hide'); + let nextGroup = group.next('.xm-select-linkage-group'); + nextGroup.find('li').addClass('xm-select-linkage-hide'); + nextGroup.find(`li[pid="${othis.attr('xm-value')}"]`).removeClass('xm-select-linkage-hide'); + //如果没有下一个group, 或没有对应的值 + if(!nextGroup[0] || nextGroup.find(`li:not(.xm-select-linkage-hide)`).length == 0){ + let vals = [], + index = 0, + isAdd = !othis.hasClass('xm-select-this'); + if(data[id].config.radio){ + othis.parents('.xm-select-linkage').find('.xm-select-this').removeClass('xm-select-this'); + } + do{ + vals[index ++] = { + name: othis.find('span').text(), + value: othis.attr('xm-value') + } + othis = othis.parents('.xm-select-linkage-group').prev().find(`li[xm-value="${othis.attr('pid')}"]`); + }while(othis.length); + vals.reverse(); + let val = { + name: vals.map((item) => { + return item.name; + }).join('/'), + value: vals.map((item) => { + return item.value; + }).join('/'), + } + this.handlerLabel(id, null, isAdd, val); + }else{ + nextGroup.removeClass('xm-select-linkage-hide'); + } + return false; + } + + if(othis.is('dl')){ + return false; + } + + if(othis.is('dt')){ + othis.nextUntil(`dt`).each((index, item) => { + item = $(item); + if(item.hasClass(DISABLED) || item.hasClass(THIS)){ + + }else{ + item.find('i:not(.icon-expand)').click(); + } + }); + return false; + } + let dd = othis.is('dd') ? othis : othis.parents('dd'); + let id = dd.parent('dl').attr('xid'); + + if(dd.hasClass(DISABLED)){//被禁用选项的处理 + return false; + } + + //菜单功效 + if(othis.is('i.icon-caidan')){ + let opens = [], closes = []; + othis.parents('dl').find('dd[tree-folder="true"]').each((index, item) => { + $(item).attr('xm-tree-hidn') == undefined ? opens.push(item) : closes.push(item); + }); + let arr = closes.length ? closes : opens; + arr.forEach(item => item.click()); + return false; + } + //树状结构的选择 + let treeId = dd.attr('tree-id'); + if(treeId){ + //忽略右边的图标 + if(othis.is('i:not(.icon-expand)')){ + this.handlerLabel(id, dd, !dd.hasClass(THIS)); + return false; + } + let ajaxConfig = ajaxs[id] || ajax; + let treeConfig = ajaxConfig.tree; + let childrens = dd.nextAll(`dd[tree-id^="${treeId}"]`); + if(childrens && childrens.length){ + let len = childrens[0].clientHeight; + len ? ( + this.addTreeHeight(dd, len), + len = 0 + ) : ( + len = dd.attr('xm-tree-hidn') || 36, + dd.removeAttr('xm-tree-hidn'), + dd.find('>i').remove(), + (childrens = childrens.filter((index, item) => $(item).attr('tree-id').split('-').length - 1 == treeId.split('-').length)) + ); + childrens.animate({ + height: len + }, 150) + return false; + }else{ + if(treeConfig.nextClick && treeConfig.nextClick instanceof Function){ + treeConfig.nextClick(id, this.getItem(id, dd), (res) => { + if(!res || !res.length){ + this.handlerLabel(id, dd, !dd.hasClass(THIS)); + }else{ + dd.attr('tree-folder', 'true'); + let ddChilds = []; + res.forEach((item, idx) => { + item.innerHTML = item[ajaxConfig.keyName]; + item[FORM_TEAM_PID] = JSON.stringify(treeId.split('-').concat([idx])); + ddChilds.push(this.createDD(id, item)); + db[id][item[ajaxConfig.keyVal]] = item; + }); + dd.after(ddChilds.join('')); + } + }); + return false; + } + } + } + + if(dd.hasClass(FORM_SELECT_TIPS)){//tips的处理 + let btn = othis.is(`.${CZ}`) ? othis : othis.parents(`.${CZ}`); + if(!btn[0]){ + return false; + } + let method = btn.attr('method'); + let obj = data[id].config.btns.filter(bean => bean.name == method)[0]; + obj && obj.click && obj.click instanceof Function && obj.click(id, this); + return false; + } + this.handlerLabel(id, dd, !dd.hasClass(THIS)); + return false; + }); + } + + Common.prototype.addTreeHeight = function(dd, len){ + let treeId = dd.attr('tree-id'); + let childrens = dd.nextAll(`dd[tree-id^="${treeId}"]`); + if(childrens.length){ + dd.append(''); + dd.attr('xm-tree-hidn', len); + childrens.each((index, item) => { + let that = $(item); + this.addTreeHeight(that, len); + }) + } + } + + let db = {}; + Common.prototype.getItem = function(id, value){ + if(value instanceof $){ + if(value.is(`i[fsw="${NAME}"]`)){ + let span = value.parent(); + return db[id][value] || { + name: span.find('font').text(), + value: span.attr('value') + } + } + let val = value.attr('lay-value'); + return !db[id][val] ? (db[id][val] = { + name: value.find('span[name]').attr('name'), + value: val + }) : db[id][val]; + }else if(typeof(value) == 'string' && value.indexOf('/') != -1){ + return db[id][value] || { + name: this.valToName(id, value), + value: value + } + } + return db[id][value]; + } + + Common.prototype.linkageAdd = function(id, val){ + let dl = $(`dl[xid="${id}"]`); + dl.find('.xm-select-active').removeClass('xm-select-active'); + let vs = val.value.split('/'); + let pid, li, index = 0; + let lis = []; + do{ + pid = vs[index]; + li = dl.find(`.xm-select-linkage-group${index + 1} li[xm-value="${pid}"]`); + li[0] && lis.push(li); + index ++; + }while(li.length && pid != undefined); + if(lis.length == vs.length){ + $.each(lis, (idx, item) => { + item.addClass('xm-select-this'); + }); + } + } + + Common.prototype.linkageDel = function(id, val){ + let dl = $(`dl[xid="${id}"]`); + let vs = val.value.split('/'); + let pid, li, index = vs.length - 1; + do{ + pid = vs[index]; + li = dl.find(`.xm-select-linkage-group${index + 1} li[xm-value="${pid}"]`); + if(!li.parent().next().find(`li[pid=${pid}].xm-select-this`).length){ + li.removeClass('xm-select-this'); + } + index --; + }while(li.length && pid != undefined); + } + + Common.prototype.valToName = function(id, val){ + let dl = $(`dl[xid="${id}"]`); + let vs = (val + "").split('/'); + if(!vs.length){ + return null; + } + let names = []; + $.each(vs, (idx, item) => { + let name = dl.find(`.xm-select-linkage-group${idx + 1} li[xm-value="${item}"] span`).text(); + names.push(name); + }); + return names.length == vs.length ? names.join('/') : null; + } + + Common.prototype.commonHandler = function(key, label){ + if(!label || !label[0]){ + return ; + } + this.checkHideSpan(key, label); + //计算input的提示语 + this.changePlaceHolder(label); + //计算高度 + this.retop(label.parents(`.${FORM_SELECT}`)); + this.calcLabelLeft(label, 0, true); + //表单默认值 + this.setHidnVal(key, label); + //title值 + label.parents(`.${FORM_TITLE} .${NAME}`).attr('title', data[key].values.map((val) => { + return val.name; + }).join(',')); + } + + Common.prototype.initVal = function(id){ + let target = {}; + if(id){ + target[id] = data[id]; + }else{ + target = data; + } + $.each(target, (key, val) => { + let values = val.values, + div = $(`dl[xid="${key}"]`).parent(), + label = div.find(`.${LABEL}`), + dl = div.find('dl'); + dl.find(`dd.${THIS}`).removeClass(THIS); + + let _vals = values.concat([]); + _vals.concat([]).forEach((item, index) => { + this.addLabel(key, label, item); + dl.find(`dd[lay-value="${item.value}"]`).addClass(THIS); + }); + if(val.config.radio){ + _vals.length && values.push(_vals[_vals.length - 1]); + } + this.commonHandler(key, label); + }); + } + + Common.prototype.setHidnVal = function(key, label) { + if(!label || !label[0]) { + return; + } + label.parents(`.${PNAME}`).find(`.${HIDE_INPUT}`).val(data[key].values.map((val) => { + return val.value; + }).join(',')); + } + + Common.prototype.handlerLabel = function(id, dd, isAdd, oval, notOn){ + let div = $(`[xid="${id}"]`).prev().find(`.${LABEL}`), + val = dd && this.getItem(id, dd), + vals = data[id].values, + on = data[id].config.on || events.on[id], + endOn = data[id].config.endOn || events.endOn[id]; + if(oval){ + val = oval; + } + let fs = data[id]; + if(isAdd && fs.config.max && fs.values.length >= fs.config.max){ + let maxTipsFun = events.maxTips[id] || data[id].config.maxTips; + maxTipsFun && maxTipsFun(id, vals.concat([]), val, fs.config.max); + return ; + } + if(!notOn){ + if(on && on instanceof Function && on(id, vals.concat([]), val, isAdd, dd && dd.hasClass(DISABLED)) == false) { + return ; + } + } + let dl = $(`dl[xid="${id}"]`); + isAdd ? ( + (dd && dd[0] ? ( + dd.addClass(THIS), + dd.removeClass(TEMP) + ) : ( + dl.find('.xm-select-linkage')[0] && this.linkageAdd(id, val) + )), + this.addLabel(id, div, val), + vals.push(val) + ) : ( + (dd && dd[0] ? ( + dd.removeClass(THIS) + ) : ( + dl.find('.xm-select-linkage')[0] && this.linkageDel(id, val) + )), + this.delLabel(id, div, val), + this.remove(vals, val) + ); + if(!div[0]) return ; + //单选选完后直接关闭选择域 + if(fs.config.radio){ + this.changeShow(div, false); + } + //移除表单验证的红色边框 + div.parents(`.${FORM_TITLE}`).prev().removeClass('layui-form-danger'); + + //清空搜索值 + fs.config.clearInput && this.clearInput(id); + + this.commonHandler(id, div); + + !notOn && endOn && endOn instanceof Function && endOn(id, vals.concat([]), val, isAdd, dd && dd.hasClass(DISABLED)); + } + + Common.prototype.addLabel = function(id, div, val){ + if(!val) return ; + let tips = `fsw="${NAME}"`; + let [$label, $close] = [ + $(`${val.name}`), + $(``) + ]; + $label.append($close); + //如果是radio模式 + let fs = data[id]; + if(fs.config.radio){ + fs.values.length = 0; + $(`dl[xid="${id}"]`).find(`dd.${THIS}:not([lay-value="${val.value}"])`).removeClass(THIS); + div.find('span').remove(); + } + //如果是固定高度 + div.find('input').css('width', '50px'); + div.find('input').before($label); + } + + Common.prototype.delLabel = function(id, div, val){ + if(!val) return ; + div.find(`span[value="${val.value}"]:first`).remove(); + } + + Common.prototype.checkHideSpan = function(id, div){ + let parentHeight = div.parents(`.${NAME}`)[0].offsetHeight + 5; + div.find('span.xm-span-hide').removeClass('xm-span-hide'); + div.find('span[style]').remove(); + + let count = data[id].config.showCount; + div.find('span').each((index, item) => { + if(index >= count){ + $(item).addClass('xm-span-hide'); + } + }); + + let prefix = div.find(`span:eq(${count})`); + prefix[0] && prefix.before($(` + ${div.find('span').length - count}`)) + } + + Common.prototype.retop = function(div){//计算dl显示的位置 + let dl = div.find('dl'), + top = div.offset().top + div.outerHeight() + 5 - $win.scrollTop(), dlHeight = dl.outerHeight(); - let up = div.hasClass('layui-form-selectup') || dl.css('top').indexOf('-') != -1 || (top + dlHeight > $win.height() && top >= dlHeight); - div = div.find(`.${NAME}`); - - let fs = data[dl.attr('xid')]; - let base = dl.parents('.layui-form-pane')[0] && dl.prev()[0].clientHeight > 38 ? 14 : 10; - if ((fs && fs.config.direction == 'up') || up) { - up = true; - if ((fs && fs.config.direction == 'down')) { - up = false; - } - } - let reHeight = div[0].offsetTop + div.height() + base; - if (up) { - dl.css({ - top: 'auto', - bottom: reHeight + 3 + 'px', - }); - } else { - dl.css({ - top: reHeight + 'px', - bottom: 'auto' - }); - } - } - - Common.prototype.changeShow = function (children, isShow) {//显示于隐藏 - $('.layui-form-selected').removeClass('layui-form-selected'); - let top = children.parents(`.${FORM_SELECT}`), - realShow = top.hasClass(FORM_SELECTED), - id = top.find('dl').attr('xid'); - $(`.${PNAME} .${FORM_SELECT}`).not(top).removeClass(FORM_SELECTED); - if (isShow) { - this.retop(top); - top.addClass(FORM_SELECTED); - top.find(`.${INPUT}`).focus(); - if (!top.find(`dl dd[lay-value]:not(.${FORM_SELECT_TIPS})`).length) { - top.find(`dl .${FORM_NONE}`).addClass(FORM_EMPTY); - } - } else { - top.removeClass(FORM_SELECTED); - this.clearInput(id); - top.find(`dl .${FORM_EMPTY}`).removeClass(FORM_EMPTY); - top.find(`dl dd.${DD_HIDE}`).removeClass(DD_HIDE); - top.find(`dl dd.${TEMP}`).remove(); - //计算ajax数据是否为空, 然后重新请求数据 - if (id && data[id] && data[id].config.isEmpty) { - this.triggerSearch(top); - } - this.changePlaceHolder(top.find(`.${LABEL}`)); - } - if (isShow != realShow) { - let openFun = data[id].config.opened || events.opened[id]; - isShow && openFun && openFun instanceof Function && openFun(id); - let closeFun = data[id].config.closed || events.closed[id]; - !isShow && closeFun && closeFun instanceof Function && closeFun(id); - } - } - - Common.prototype.changePlaceHolder = function (div) {//显示于隐藏提示语 - //调整pane模式下的高度 - let title = div.parents(`.${FORM_TITLE}`); - title[0] || (title = div.parents(`dl`).prev()); - if (!title[0]) { - return; - } - - let id = div.parents(`.${PNAME}`).find(`dl[xid]`).attr('xid'); - if (data[id] && data[id].config.height) {//既然固定高度了, 那就看着办吧 - - } else { - let height = title.find(`.${NAME}`)[0].clientHeight; - title.css('height', (height > 36 ? height + 4 : height) + 'px'); - //如果是layui pane模式, 处理label的高度 - let label = title.parents(`.${PNAME}`).parent().prev(); - if (label.is('.layui-form-label') && title.parents('.layui-form-pane')[0]) { - height = height > 36 ? height + 4 : height; - title.css('height', height + 'px'); - label.css({ - height: height + 2 + 'px', - lineHeight: (height - 18) + 'px' - }) - } - } - - let input = title.find(`.${TDIV} input`), - isShow = !div.find('span:last')[0] && !title.find(`.${INPUT}`).val(); - if (isShow) { - let ph = input.attr('back'); - input.removeAttr('back'); - input.attr('placeholder', ph); - } else { - let ph = input.attr('placeholder'); - input.removeAttr('placeholder'); - input.attr('back', ph) - } - } - - Common.prototype.indexOf = function (arr, val) { - for (let i = 0; i < arr.length; i++) { - if (arr[i].value == val || arr[i].value == (val ? val.value : val) || arr[i] == val || JSON.stringify(arr[i]) == JSON.stringify(val)) { - return i; - } - } - return -1; - } - - Common.prototype.remove = function (arr, val) { - let idx = this.indexOf(arr, val ? val.value : val); - if (idx > -1) { - arr.splice(idx, 1); - return true; - } - return false; - } - - Common.prototype.selectAll = function (id, isOn, skipDis) { - let dl = $(`[xid="${id}"]`); - if (!dl[0]) { - return; - } - if (dl.find('.xm-select-linkage')[0]) { - return; - } - dl.find(`dd[lay-value]:not(.${FORM_SELECT_TIPS}):not(.${THIS})${skipDis ? ':not(.' + DISABLED + ')' : ''}`).each((index, item) => { - item = $(item); - let val = this.getItem(id, item); - this.handlerLabel(id, dl.find(`dd[lay-value="${val.value}"]`), true, val, !isOn); - }); - } - - Common.prototype.removeAll = function (id, isOn, skipDis) { - let dl = $(`[xid="${id}"]`); - if (!dl[0]) { - return; - } - if (dl.find('.xm-select-linkage')[0]) {//针对多级联动的处理 - data[id].values.concat([]).forEach((item, idx) => { - let vs = item.value.split('/'); - let pid, li, index = 0; - do { - pid = vs[index++]; - li = dl.find(`.xm-select-linkage-group${index}:not(.xm-select-linkage-hide) li[xm-value="${pid}"]`); - li.click(); - } while (li.length && pid != undefined); - }); - return; - } - data[id].values.concat([]).forEach((item, index) => { - if (skipDis && dl.find(`dd[lay-value="${item.value}"]`).hasClass(DISABLED)) { - - } else { - this.handlerLabel(id, dl.find(`dd[lay-value="${item.value}"]`), false, item, !isOn); - } - }); - } - - Common.prototype.reverse = function (id, isOn, skipDis) { - let dl = $(`[xid="${id}"]`); - if (!dl[0]) { - return; - } - if (dl.find('.xm-select-linkage')[0]) { - return; - } - dl.find(`dd[lay-value]:not(.${FORM_SELECT_TIPS})${skipDis ? ':not(.' + DISABLED + ')' : ''}`).each((index, item) => { - item = $(item); - let val = this.getItem(id, item); - this.handlerLabel(id, dl.find(`dd[lay-value="${val.value}"]`), !item.hasClass(THIS), val, !isOn); - }); - } - - Common.prototype.skin = function (id) { - let skins = ['default', 'primary', 'normal', 'warm', 'danger']; - let skin = skins[Math.floor(Math.random() * skins.length)]; - $(`dl[xid="${id}"]`).parents(`.${PNAME}`).find(`.${FORM_SELECT}`).attr('xm-select-skin', skin); - this.check(id) && this.commonHandler(id, $(`dl[xid="${id}"]`).parents(`.${PNAME}`).find(`.${LABEL}`)); - } - - Common.prototype.getPosition = function (e) { - let x = 0, y = 0; + let up = div.hasClass('layui-form-selectup') || dl.css('top').indexOf('-') != -1 || (top + dlHeight > $win.height() && top >= dlHeight); + div = div.find(`.${NAME}`); + + let fs = data[dl.attr('xid')]; + let base = dl.parents('.layui-form-pane')[0] && dl.prev()[0].clientHeight > 38 ? 14 : 10; + if((fs && fs.config.direction == 'up') || up){ + up = true; + if((fs && fs.config.direction == 'down')){ + up = false; + } + } + let reHeight = div[0].offsetTop + div.height() + base; + if(up) { + dl.css({ + top: 'auto', + bottom: reHeight + 3 + 'px', + }); + } else { + dl.css({ + top: reHeight + 'px', + bottom: 'auto' + }); + } + } + + Common.prototype.changeShow = function(children, isShow){//显示于隐藏 + $('.layui-form-selected').removeClass('layui-form-selected'); + let top = children.parents(`.${FORM_SELECT}`), + realShow = top.hasClass(FORM_SELECTED), + id = top.find('dl').attr('xid'); + $(`.${PNAME} .${FORM_SELECT}`).not(top).removeClass(FORM_SELECTED); + if(isShow){ + this.retop(top); + top.addClass(FORM_SELECTED); + top.find(`.${INPUT}`).focus(); + if(!top.find(`dl dd[lay-value]:not(.${FORM_SELECT_TIPS})`).length){ + top.find(`dl .${FORM_NONE}`).addClass(FORM_EMPTY); + } + }else{ + top.removeClass(FORM_SELECTED); + this.clearInput(id); + top.find(`dl .${FORM_EMPTY}`).removeClass(FORM_EMPTY); + top.find(`dl dd.${DD_HIDE}`).removeClass(DD_HIDE); + top.find(`dl dd.${TEMP}`).remove(); + //计算ajax数据是否为空, 然后重新请求数据 + if(id && data[id] && data[id].config.isEmpty){ + this.triggerSearch(top); + } + this.changePlaceHolder(top.find(`.${LABEL}`)); + } + if(isShow != realShow){ + let openFun = data[id].config.opened || events.opened[id]; + isShow && openFun && openFun instanceof Function && openFun(id); + let closeFun = data[id].config.closed || events.closed[id]; + !isShow && closeFun && closeFun instanceof Function && closeFun(id); + } + } + + Common.prototype.changePlaceHolder = function(div){//显示于隐藏提示语 + //调整pane模式下的高度 + let title = div.parents(`.${FORM_TITLE}`); + title[0] || (title = div.parents(`dl`).prev()); + if(!title[0]){ + return ; + } + + let id = div.parents(`.${PNAME}`).find(`dl[xid]`).attr('xid'); + if(data[id] && data[id].config.height){//既然固定高度了, 那就看着办吧 + + }else{ + let height = title.find(`.${NAME}`)[0].clientHeight; + title.css('height' , (height > 36 ? height + 4 : height) + 'px'); + //如果是layui pane模式, 处理label的高度 + let label = title.parents(`.${PNAME}`).parent().prev(); + if(label.is('.layui-form-label') && title.parents('.layui-form-pane')[0]){ + height = height > 36 ? height + 4 : height; + title.css('height' , height + 'px'); + label.css({ + height: height + 2 + 'px', + lineHeight: (height - 18) + 'px' + }) + } + } + + let input = title.find(`.${TDIV} input`), + isShow = !div.find('span:last')[0] && !title.find(`.${INPUT}`).val(); + if(isShow){ + let ph = input.attr('back'); + input.removeAttr('back'); + input.attr('placeholder', ph); + }else{ + let ph = input.attr('placeholder'); + input.removeAttr('placeholder'); + input.attr('back', ph) + } + } + + Common.prototype.indexOf = function(arr, val){ + for(let i = 0; i < arr.length; i++) { + if(arr[i].value == val || arr[i].value == (val ? val.value : val) || arr[i] == val || JSON.stringify(arr[i]) == JSON.stringify(val)) { + return i; + } + } + return -1; + } + + Common.prototype.remove = function(arr, val){ + let idx = this.indexOf(arr, val ? val.value : val); + if(idx > -1) { + arr.splice(idx, 1); + return true; + } + return false; + } + + Common.prototype.selectAll = function(id, isOn, skipDis){ + let dl = $(`[xid="${id}"]`); + if(!dl[0]){ + return ; + } + if(dl.find('.xm-select-linkage')[0]){ + return ; + } + dl.find(`dd[lay-value]:not(.${FORM_SELECT_TIPS}):not(.${THIS})${skipDis ? ':not(.'+DISABLED+')' :''}`).each((index, item) => { + item = $(item); + let val = this.getItem(id, item); + this.handlerLabel(id, dl.find(`dd[lay-value="${val.value}"]`), true, val, !isOn); + }); + } + + Common.prototype.removeAll = function(id, isOn, skipDis){ + let dl = $(`[xid="${id}"]`); + if(!dl[0]){ + return ; + } + if(dl.find('.xm-select-linkage')[0]){//针对多级联动的处理 + data[id].values.concat([]).forEach((item, idx) => { + let vs = item.value.split('/'); + let pid, li, index = 0; + do{ + pid = vs[index ++]; + li = dl.find(`.xm-select-linkage-group${index}:not(.xm-select-linkage-hide) li[xm-value="${pid}"]`); + li.click(); + }while(li.length && pid != undefined); + }); + return ; + } + data[id].values.concat([]).forEach((item, index) => { + if(skipDis && dl.find(`dd[lay-value="${item.value}"]`).hasClass(DISABLED)){ + + }else{ + this.handlerLabel(id, dl.find(`dd[lay-value="${item.value}"]`), false, item, !isOn); + } + }); + } + + Common.prototype.reverse = function(id, isOn, skipDis){ + let dl = $(`[xid="${id}"]`); + if(!dl[0]){ + return ; + } + if(dl.find('.xm-select-linkage')[0]){ + return ; + } + dl.find(`dd[lay-value]:not(.${FORM_SELECT_TIPS})${skipDis ? ':not(.'+DISABLED+')' :''}`).each((index, item) => { + item = $(item); + let val = this.getItem(id, item); + this.handlerLabel(id, dl.find(`dd[lay-value="${val.value}"]`), !item.hasClass(THIS), val, !isOn); + }); + } + + Common.prototype.skin = function(id){ + let skins = ['default' ,'primary', 'normal', 'warm', 'danger']; + let skin = skins[Math.floor(Math.random() * skins.length)]; + $(`dl[xid="${id}"]`).parents(`.${PNAME}`).find(`.${FORM_SELECT}`).attr('xm-select-skin', skin); + this.check(id) && this.commonHandler(id, $(`dl[xid="${id}"]`).parents(`.${PNAME}`).find(`.${LABEL}`)); + } + + Common.prototype.getPosition = function(e){ + let x = 0, y = 0; while (e != null) { x += e.offsetLeft; y += e.offsetTop; e = e.offsetParent; } - return {x: x, y: y}; - }; - - Common.prototype.onreset = function () {//监听reset按钮, 然后重置多选 - $(document).on('click', '[type=reset]', (e) => { - $(e.target).parents('form').find(`.${PNAME} dl[xid]`).each((index, item) => { - let id = item.getAttribute('xid'), - dl = $(item), - dd, - temp = {}; - common.removeAll(id); - data[id].config.init.forEach((val, idx) => { - if (val && (!temp[val] || data[id].config.repeat) && (dd = dl.find(`dd[lay-value="${val.value}"]`))[0]) { - common.handlerLabel(id, dd, true); - temp[val] = 1; - } - }); - }) - }); - } - - Common.prototype.bindEvent = function (name, id, fun) { - if (id && id instanceof Function) { - fun = id; - id = null; - } - if (fun && fun instanceof Function) { - if (!id) { - $.each(data, (id, val) => { - data[id] ? (data[id].config[name] = fun) : (events[name][id] = fun) - }) - } else { - data[id] ? (data[id].config[name] = fun, delete events[name][id]) : (events[name][id] = fun) - } - } - } - - Common.prototype.check = function (id, notAutoRender) { - if ($(`dl[xid="${id}"]`).length) { - return true; - } else if ($(`select[xm-select="${id}"]`).length) { - if (!notAutoRender) { - this.render(id, $(`select[xm-select="${id}"]`)); - return true; - } - } else { - delete data[id]; - return false; - } - } - - Common.prototype.render = function (id, select) { - common.init(select); - common.one($(`dl[xid="${id}"]`).parents(`.${PNAME}`)); - common.initVal(id); - } - - Common.prototype.log = function (obj) { - console.log(obj); - } - - let Select4 = function () { - this.v = v; - this.render(); - }; - let common = new Common(); - - Select4.prototype.value = function (id, type, isAppend) { - if (typeof id != 'string') { - return []; - } - let fs = data[id]; - if (!common.check(id)) { - return []; - } - if (typeof type == 'string' || type == undefined) { - let arr = fs.values.concat([]) || []; - if (type == 'val') { - return arr.map((val) => { - return val.value; - }); - } - if (type == 'valStr') { - return arr.map((val) => { - return val.value; - }).join(','); - } - if (type == 'name') { - return arr.map((val) => { - return val.name; - }); - } - if (type == 'nameStr') { - return arr.map((val) => { - return val.name; - }).join(','); - } - return arr; - } - if (common.isArray(type)) { - let dl = $(`[xid="${id}"]`), - temp = {}, - dd, - isAdd = true; - if (isAppend == false) {//删除传入的数组 - isAdd = false; - } else if (isAppend == true) {//追加模式 - isAdd = true; - } else {//删除原有的数据 - common.removeAll(id); - } - if (isAdd) { - fs.values.forEach((val, index) => { - temp[val.value] = 1; - }); - } - type.forEach((val, index) => { - if (val && (!temp[val] || fs.config.repeat)) { - if ((dd = dl.find(`dd[lay-value="${val}"]`))[0]) { - common.handlerLabel(id, dd, isAdd, null, true); - temp[val] = 1; - } else { - let name = common.valToName(id, val); - if (name) { - common.handlerLabel(id, dd, isAdd, common.getItem(id, val), true); - temp[val] = 1; - } - } - } - }); - } - } - - Select4.prototype.on = function (id, fun, isEnd) { - common.bindEvent(isEnd ? 'endOn' : 'on', id, fun); - return this; - } - - Select4.prototype.filter = function (id, fun) { - common.bindEvent('filter', id, fun); - return this; - } - - Select4.prototype.maxTips = function (id, fun) { - common.bindEvent('maxTips', id, fun); - return this; - } - - Select4.prototype.opened = function (id, fun) { - common.bindEvent('opened', id, fun); - return this; - } - - Select4.prototype.closed = function (id, fun) { - common.bindEvent('closed', id, fun); - return this; - } - - Select4.prototype.config = function (id, config, isJson) { - if (id && typeof id == 'object') { - isJson = config == true; - config = id; - id = null; - } - if (config && typeof config == 'object') { - if (isJson) { - config.header || (config.header = {}); - config.header['Content-Type'] = 'application/json; charset=UTF-8'; - config.dataType = 'json'; - } - id ? ( - ajaxs[id] = $.extend(true, {}, ajaxs[id] || ajax, config), !common.check(id) && this.render(id), - data[id] && config.direction && (data[id].config.direction = config.direction), - data[id] && config.clearInput && (data[id].config.clearInput = true), - config.searchUrl && data[id] && common.triggerSearch($(`.${PNAME} dl[xid="${id}"]`).parents(`.${FORM_SELECT}`), true) - ) : ( - $.extend(true, ajax, config), - $.each(ajaxs, (key, item) => { - $.extend(true, item, config) - }) - ); - } - return this; - } - - Select4.prototype.render = function (id, options) { - if (id && typeof id == 'object') { - options = id; - id = null; - } - let config = options ? { - init: options.init, - disabled: options.disabled, - max: options.max, - isSearch: options.isSearch, - searchUrl: options.searchUrl, - isCreate: options.isCreate, - radio: options.radio, - skin: options.skin, - direction: options.direction, - height: options.height, - formname: options.formname, - layverify: options.layverify, - layverType: options.layverType, - showCount: options.showCount, - placeholder: options.placeholder, - create: options.create, - filter: options.filter, - maxTips: options.maxTips, - on: options.on, - on: options.on, - opened: options.opened, - closed: options.closed, - template: options.template, - clearInput: options.clearInput, - } : {}; - - options && options.searchType != undefined && (config.searchType = options.searchType == 'dl' ? 1 : 0); - - if (id) { - fsConfigs[id] = {}; - $.extend(fsConfigs[id], data[id] ? data[id].config : {}, config); - } else { - $.extend(fsConfig, config); - } - - ($(`select[${NAME}="${id}"]`)[0] ? $(`select[${NAME}="${id}"]`) : $(`select[${NAME}]`)).each((index, select) => { - let sid = select.getAttribute(NAME); - common.render(sid, select); - setTimeout(() => common.setHidnVal(sid, $(`select[xm-select="${sid}"] + div.${PNAME} .${LABEL}`)), 10); - }); - return this; - } - - Select4.prototype.disabled = function (id) { - let target = {}; - id ? (common.check(id) && (target[id] = data[id])) : (target = data); - - $.each(target, (key, val) => { - $(`dl[xid="${key}"]`).prev().addClass(DIS); - }); - return this; - } - - Select4.prototype.undisabled = function (id) { - let target = {}; - id ? (common.check(id) && (target[id] = data[id])) : (target = data); - - $.each(target, (key, val) => { - $(`dl[xid="${key}"]`).prev().removeClass(DIS); - }); - return this; - } - - Select4.prototype.data = function (id, type, config) { - if (!id || !type || !config) { - common.log(`id: ${id} param error !!!`) - return this; - } - if (!common.check(id)) { - common.log(`id: ${id} not render !!!`) - return this; - } - this.value(id, []); - this.config(id, config); - if (type == 'local') { - common.renderData(id, config.arr, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100'); - } else if (type == 'server') { - common.ajax(id, config.url, config.keyword, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100'); - } - return this; - } - - Select4.prototype.btns = function (id, btns, config) { - if (id && common.isArray(id)) { - btns = id; - id = null; - } - if (!btns || !common.isArray(btns)) { - return this; - } - ; - let target = {}; - id ? (common.check(id) && (target[id] = data[id])) : (target = data); - - btns = btns.map((obj) => { - if (typeof obj == 'string') { - if (obj == 'select') { - return quickBtns[0]; - } - if (obj == 'remove') { - return quickBtns[1]; - } - if (obj == 'reverse') { - return quickBtns[2]; - } - if (obj == 'skin') { - return quickBtns[3]; - } - } - return obj; - }); - - $.each(target, (key, val) => { - val.config.btns = btns; - let dd = $(`dl[xid="${key}"]`).find(`.${FORM_SELECT_TIPS}:first`); - if (btns.length) { - let show = config && config.show && (config.show == 'name' || config.show == 'icon') ? config.show : ''; - let html = common.renderBtns(key, show, config && config.space ? config.space : '30px'); - dd.html(html); - } else { - let pcInput = dd.parents(`.${FORM_SELECT}`).find(`.${TDIV} input`); - let html = pcInput.attr('placeholder') || pcInput.attr('back'); - dd.html(html); - dd.removeAttr('style'); - } - }); - - return this; - } - - Select4.prototype.search = function (id, val) { - if (id && common.check(id)) { - ajaxs[id] = $.extend(true, {}, ajaxs[id] || ajax, { - first: true, - searchVal: val - }); - common.triggerSearch($(`dl[xid="${id}"]`).parents(`.${FORM_SELECT}`), true); - } - return this; - } - - Select4.prototype.replace = function (id, type, config) { - if (!id || !type || !config) { - common.log(`id: ${id} param error !!!`) - return this; - } - if (!common.check(id, true)) { - common.log(`id: ${id} not render !!!`) - return this; - } - let oldVals = this.value(id, 'val'); - this.value(id, []); - this.config(id, config); - if (type == 'local') { - common.renderData(id, config.arr, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100', false, true); - this.value(id, oldVals, true); - } else if (type == 'server') { - common.ajax(id, config.url, config.keyword, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100', false, (id) => { - this.value(id, oldVals, true); - }, true); - } - } - - return new Select4(); + return { x: x, y: y }; + }; + + Common.prototype.onreset = function(){//监听reset按钮, 然后重置多选 + $(document).on('click', '[type=reset]', (e) => { + $(e.target).parents('form').find(`.${PNAME} dl[xid]`).each((index, item) => { + let id = item.getAttribute('xid'), + dl = $(item), + dd, + temp = {}; + common.removeAll(id); + data[id].config.init.forEach((val, idx) => { + if(val && (!temp[val] || data[id].config.repeat) && (dd = dl.find(`dd[lay-value="${val.value}"]`))[0]){ + common.handlerLabel(id, dd, true); + temp[val] = 1; + } + }); + }) + }); + } + + Common.prototype.bindEvent = function(name, id, fun){ + if(id && id instanceof Function){ + fun = id; + id = null; + } + if(fun && fun instanceof Function){ + if(!id){ + $.each(data, (id, val) => { + data[id] ? (data[id].config[name] = fun) : (events[name][id] = fun) + }) + }else{ + data[id] ? (data[id].config[name] = fun, delete events[name][id]) : (events[name][id] = fun) + } + } + } + + Common.prototype.check = function(id, notAutoRender){ + if($(`dl[xid="${id}"]`).length) { + return true; + }else if($(`select[xm-select="${id}"]`).length){ + if(!notAutoRender){ + this.render(id, $(`select[xm-select="${id}"]`)); + return true; + } + }else{ + delete data[id]; + return false; + } + } + + Common.prototype.render = function(id, select){ + common.init(select); + common.one($(`dl[xid="${id}"]`).parents(`.${PNAME}`)); + common.initVal(id); + } + + Common.prototype.log = function(obj){ + console.log(obj); + } + + let Select4 = function(){ + this.v = v; + this.render(); + }; + let common = new Common(); + + Select4.prototype.value = function(id, type, isAppend){ + if(typeof id != 'string'){ + return []; + } + let fs = data[id]; + if(!common.check(id)){ + return []; + } + if(typeof type == 'string' || type == undefined){ + let arr = fs.values.concat([]) || []; + if(type == 'val') { + return arr.map((val) => { + return val.value; + }); + } + if(type == 'valStr') { + return arr.map((val) => { + return val.value; + }).join(','); + } + if(type == 'name') { + return arr.map((val) => { + return val.name; + }); + } + if(type == 'nameStr') { + return arr.map((val) => { + return val.name; + }).join(','); + } + return arr; + } + if(common.isArray(type)) { + let dl = $(`[xid="${id}"]`), + temp = {}, + dd, + isAdd = true; + if(isAppend == false){//删除传入的数组 + isAdd = false; + }else if(isAppend == true){//追加模式 + isAdd = true; + }else{//删除原有的数据 + common.removeAll(id); + } + if(isAdd){ + fs.values.forEach((val, index) => { + temp[val.value] = 1; + }); + } + type.forEach((val, index) => { + if(val && (!temp[val] || fs.config.repeat)){ + if((dd = dl.find(`dd[lay-value="${val}"]`))[0]){ + common.handlerLabel(id, dd, isAdd, null, true); + temp[val] = 1; + }else{ + let name = common.valToName(id, val); + if(name){ + common.handlerLabel(id, dd, isAdd, common.getItem(id, val), true); + temp[val] = 1; + } + } + } + }); + } + } + + Select4.prototype.on = function(id, fun, isEnd) { + common.bindEvent(isEnd ? 'endOn' : 'on', id, fun); + return this; + } + + Select4.prototype.filter = function(id, fun){ + common.bindEvent('filter', id, fun); + return this; + } + + Select4.prototype.maxTips = function(id, fun){ + common.bindEvent('maxTips', id, fun); + return this; + } + + Select4.prototype.opened = function(id, fun){ + common.bindEvent('opened', id, fun); + return this; + } + + Select4.prototype.closed = function(id, fun){ + common.bindEvent('closed', id, fun); + return this; + } + + Select4.prototype.config = function(id, config, isJson){ + if(id && typeof id == 'object'){ + isJson = config == true; + config = id; + id = null; + } + if(config && typeof config== 'object'){ + if(isJson){ + config.header || (config.header = {}); + config.header['Content-Type'] = 'application/json; charset=UTF-8'; + config.dataType = 'json'; + } + id ? ( + ajaxs[id] = $.extend(true, {}, ajaxs[id] || ajax, config), !common.check(id) && this.render(id), + data[id] && config.direction && (data[id].config.direction = config.direction), + data[id] && config.clearInput && (data[id].config.clearInput = true), + config.searchUrl && data[id] && common.triggerSearch($(`.${PNAME} dl[xid="${id}"]`).parents(`.${FORM_SELECT}`), true) + ) : ( + $.extend(true, ajax, config), + $.each(ajaxs, (key, item) => { + $.extend(true, item, config) + }) + ); + } + return this; + } + + Select4.prototype.render = function(id, options){ + if(id && typeof id == 'object'){ + options = id; + id = null; + } + let config = options ? { + init: options.init, + disabled: options.disabled, + max: options.max, + isSearch: options.isSearch, + searchUrl: options.searchUrl, + isCreate: options.isCreate, + radio: options.radio, + skin: options.skin, + direction: options.direction, + height: options.height, + formname: options.formname, + layverify: options.layverify, + layverType: options.layverType, + showCount: options.showCount, + placeholder: options.placeholder, + create: options.create, + filter: options.filter, + maxTips: options.maxTips, + on: options.on, + on: options.on, + opened: options.opened, + closed: options.closed, + template: options.template, + clearInput: options.clearInput, + } : {}; + + options && options.searchType != undefined && (config.searchType = options.searchType == 'dl' ? 1 : 0); + + if(id){ + fsConfigs[id] = {}; + $.extend(fsConfigs[id], data[id] ? data[id].config : {}, config); + }else{ + $.extend(fsConfig, config); + } + + ($(`select[${NAME}="${id}"]`)[0] ? $(`select[${NAME}="${id}"]`) : $(`select[${NAME}]`)).each((index, select) => { + let sid = select.getAttribute(NAME); + common.render(sid, select); + setTimeout(() => common.setHidnVal(sid, $(`select[xm-select="${sid}"] + div.${PNAME} .${LABEL}`)), 10); + }); + return this; + } + + Select4.prototype.disabled = function(id){ + let target = {}; + id ? (common.check(id) && (target[id] = data[id])) : (target = data); + + $.each(target, (key, val) => { + $(`dl[xid="${key}"]`).prev().addClass(DIS); + }); + return this; + } + + Select4.prototype.undisabled = function(id){ + let target = {}; + id ? (common.check(id) && (target[id] = data[id])) : (target = data); + + $.each(target, (key, val) => { + $(`dl[xid="${key}"]`).prev().removeClass(DIS); + }); + return this; + } + + Select4.prototype.data = function(id, type, config){ + if(!id || !type || !config){ + common.log(`id: ${id} param error !!!`) + return this; + } + if(!common.check(id)){ + common.log(`id: ${id} not render !!!`) + return this; + } + this.value(id, []); + this.config(id, config); + if(type == 'local'){ + common.renderData(id, config.arr, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100'); + }else if(type == 'server'){ + common.ajax(id, config.url, config.keyword, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100'); + } + return this; + } + + Select4.prototype.btns = function(id, btns, config){ + if(id && common.isArray(id)){ + btns = id; + id = null; + } + if(!btns || !common.isArray(btns)) { + return this; + }; + let target = {}; + id ? (common.check(id) && (target[id] = data[id])) : (target = data); + + btns = btns.map((obj) => { + if(typeof obj == 'string'){ + if(obj == 'select'){ + return quickBtns[0]; + } + if(obj == 'remove'){ + return quickBtns[1]; + } + if(obj == 'reverse'){ + return quickBtns[2]; + } + if(obj == 'skin'){ + return quickBtns[3]; + } + } + return obj; + }); + + $.each(target, (key, val) => { + val.config.btns = btns; + let dd = $(`dl[xid="${key}"]`).find(`.${FORM_SELECT_TIPS}:first`); + if(btns.length){ + let show = config && config.show && (config.show == 'name' || config.show == 'icon') ? config.show : ''; + let html = common.renderBtns(key, show, config && config.space ? config.space : '30px'); + dd.html(html); + }else{ + let pcInput = dd.parents(`.${FORM_SELECT}`).find(`.${TDIV} input`); + let html = pcInput.attr('placeholder') || pcInput.attr('back'); + dd.html(html); + dd.removeAttr('style'); + } + }); + + return this; + } + + Select4.prototype.search = function(id, val){ + if(id && common.check(id)){ + ajaxs[id] = $.extend(true, {}, ajaxs[id] || ajax, { + first: true, + searchVal: val + }); + common.triggerSearch($(`dl[xid="${id}"]`).parents(`.${FORM_SELECT}`), true); + } + return this; + } + + Select4.prototype.replace = function(id, type, config){ + if(!id || !type || !config){ + common.log(`id: ${id} param error !!!`) + return this; + } + if(!common.check(id, true)){ + common.log(`id: ${id} not render !!!`) + return this; + } + let oldVals = this.value(id, 'val'); + this.value(id, []); + this.config(id, config); + if(type == 'local'){ + common.renderData(id, config.arr, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100', false, true); + this.value(id, oldVals, true); + }else if(type == 'server'){ + common.ajax(id, config.url, config.keyword, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100', false, (id) => { + this.value(id, oldVals, true); + }, true); + } + } + + return new Select4(); }); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/step.js b/src/main/resources/static/component/pear/module/step.js index 91860613..4c96d178 100644 --- a/src/main/resources/static/component/pear/module/step.js +++ b/src/main/resources/static/component/pear/module/step.js @@ -3,12 +3,10 @@ layui.define(['layer', 'carousel'], function (exports) { var layer = layui.layer; var carousel = layui.carousel; - // 添加步骤条dom节点 var renderDom = function (elem, stepItems, postion) { var stepDiv = '
              '; for (var i = 0; i < stepItems.length; i++) { stepDiv += '
              '; - // 线 if (i < (stepItems.length - 1)) { if (i < postion) { stepDiv += '
              '; @@ -16,8 +14,6 @@ layui.define(['layer', 'carousel'], function (exports) { stepDiv += '
              '; } } - - // 数字 var number = stepItems[i].number; if (!number) { number = i + 1; @@ -29,11 +25,10 @@ layui.define(['layer', 'carousel'], function (exports) { } else { stepDiv += '
              ' + number + '
              '; } - - // 标题和描述 var title = stepItems[i].title; var desc = stepItems[i].desc; - if (title || desc) { + var time = stepItems[i].time; + if (title || desc || time) { stepDiv += '
              '; if (title) { stepDiv += '
              ' + title + '
              '; @@ -41,58 +36,45 @@ layui.define(['layer', 'carousel'], function (exports) { if (desc) { stepDiv += '
              ' + desc + '
              '; } + if (time) { + stepDiv += '
              ' + time + '
              '; + } stepDiv += '
              '; } stepDiv += '
              '; } stepDiv += '
              '; - $(elem).prepend(stepDiv); - - // 计算每一个条目的宽度 var bfb = 100 / stepItems.length; $('.step-item').css('width', bfb + '%'); }; var pearStep = { - // 渲染步骤条 render: function (param) { - param.indicator = 'none'; // 不显示指示器 - param.arrow = 'always'; // 始终显示箭头 - param.autoplay = false; // 关闭自动播放 + param.indicator = 'none'; // 不显示指示器 + param.arrow = 'always'; // 始终显示箭头 + param.autoplay = false; // 关闭自动播放 if (!param.stepWidth) { param.stepWidth = '400px'; } - - // 渲染轮播图 carousel.render(param); - - // 渲染步骤条 var stepItems = param.stepItems; renderDom(param.elem, stepItems, 0); $('.lay-step').css('width', param.stepWidth); - - //监听轮播切换事件 carousel.on('change(' + param.filter + ')', function (obj) { $(param.elem).find('.lay-step').remove(); renderDom(param.elem, stepItems, obj.index); $('.lay-step').css('width', param.stepWidth); }); - - // 隐藏左右箭头按钮 $(param.elem).find('.layui-carousel-arrow').css('display', 'none'); - - // 去掉轮播图的背景颜色 $(param.elem).css('background-color', 'transparent'); }, - // 下一步 next: function (elem) { $(elem).find('.layui-carousel-arrow[lay-type=add]').trigger('click'); }, - // 上一步 pre: function (elem) { $(elem).find('.layui-carousel-arrow[lay-type=sub]').trigger('click'); } }; exports('step', pearStep); -}); +}); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/tab.js b/src/main/resources/static/component/pear/module/tab.js index 3b21946e..088a3aa0 100644 --- a/src/main/resources/static/component/pear/module/tab.js +++ b/src/main/resources/static/component/pear/module/tab.js @@ -1,588 +1,663 @@ layui.define(['jquery', 'element'], function(exports) { - "use strict"; - - var MOD_NAME = 'tab', - $ = layui.jquery, - element = layui.element; - - var pearTab = function(opt) { - this.option = opt; - }; - - var tabData = new Array(); - var tabDataCurrent = 0; - var contextTabDOM; - - pearTab.prototype.render = function(opt) { - - var option = { - elem: opt.elem, - data: opt.data, - tool: opt.tool, - roll: opt.roll, - index: opt.index, - width: opt.width, - height: opt.height, - tabMax: opt.tabMax, - session: opt.session ? opt.session : false, - closeEvent: opt.closeEvent, - success: opt.success ? opt.success : function(id) {} - } - - if (option.session) { - if (sessionStorage.getItem(option.elem + "-pear-tab-data") != null) { - tabData = JSON.parse(sessionStorage.getItem(option.elem + "-pear-tab-data")); - option.data = JSON.parse(sessionStorage.getItem(option.elem + "-pear-tab-data")); - tabDataCurrent = sessionStorage.getItem(option.elem + "-pear-tab-data-current"); - tabData.forEach(function(item, index) { - if (item.id == tabDataCurrent) { - option.index = index; - } - }) - } else { - tabData = opt.data; - } - } - - var lastIndex; - var tab = createTab(option); - $("#" + option.elem).html(tab); - $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-prev").click(function() { - rollPage("left", option); - }) - $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-next").click(function() { - rollPage("right", option); - }) - element.init(); - toolEvent(option); - $("#" + option.elem).width(opt.width); - $("#" + option.elem).height(opt.height); - $("#" + option.elem).css({ - position: "relative" - }); - closeEvent(option); - - option.success(sessionStorage.getItem(option.elem + "-pear-tab-data-current")); - - $("body .layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title").on("contextmenu", "li", function(e) { - // 获取当前元素位置 - var top = e.clientY; - var left = e.clientX; - var menuWidth = 100; - var currentId = $(this).attr("lay-id"); - var menu = "
              • 关闭当前
              • 关闭其他
              • 关闭所有
              "; - - contextTabDOM = $(this); - var isOutsideBounds = (left + menuWidth) > $(window).width(); - if(isOutsideBounds){ - left = $(window).width() - menuWidth; - } - // 初始化 - layer.open({ - type: 1, - title: false, - shade: false, - skin: 'pear-tab-menu', - closeBtn: false, - area: [menuWidth + 'px', '108px'], - fixed: true, - anim: false, - isOutAnim: false, - offset: [top, left], - content: menu, //iframe的url, - success: function(layero, index) { - layer.close(lastIndex); - lastIndex = index; - menuEvent(option, index); - var timer; - $(layero).on('mouseout', function() { - timer = setTimeout(function() { - layer.close(index); - }, 30) - }); - - $(layero).on('mouseover', function() { - clearTimeout(timer); - }); - - // 清除 item 右击 - $(layero).on('contextmenu', function() { - return false; - }) - - } - }); - return false; - }) - - return new pearTab(option); - } - - pearTab.prototype.click = function(callback) { - var elem = this.option.elem; - var option = this.option; - element.on('tab(' + this.option.elem + ')', function(data) { - var id = $("#" + elem + " .layui-tab-title .layui-this").attr("lay-id"); - sessionStorage.setItem(option.elem + "-pear-tab-data-current", id); - callback(id); - }); - } - - pearTab.prototype.positionTab = function() { - var $tabTitle = $('.layui-tab[lay-filter=' + this.option.elem + '] .layui-tab-title'); - var autoLeft = 0; - $tabTitle.children("li").each(function() { - if ($(this).hasClass('layui-this')) { - return false; - } else { - autoLeft += $(this).outerWidth(); - } - }); - $tabTitle.animate({ - scrollLeft: autoLeft - $tabTitle.width() / 3 - }, 200); - } - - pearTab.prototype.clear = function() { - sessionStorage.removeItem(this.option.elem + "-pear-tab-data"); - sessionStorage.removeItem(this.option.elem + "-pear-tab-data-current"); - } - - pearTab.prototype.addTab = function(opt) { - var title = ''; - if (opt.close) { - title += '' + opt.title + - ''; - } else { - title += '' + opt.title + - ''; - } - element.tabAdd(this.option.elem, { - title: title, - content: '', - id: opt.id - }); - tabData.push(opt); - sessionStorage.setItem(this.option.elem + "-pear-tab-data", JSON.stringify(tabData)); - sessionStorage.setItem(this.option.elem + "-pear-tab-data-current", opt.id); - element.tabChange(this.option.elem, opt.id); - } - - var index = 0; - - // 根据过滤 fliter 标识, 重置选项卡标题 - pearTab.prototype.changeTabTitleById = function(elem, id, title) { - var currentTab = $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-title [lay-id='" + id + "'] .title"); - currentTab.html(title); - } - - // 根据过滤 filter 标识, 删除指定选项卡 - pearTab.prototype.delTabByElem = function(elem, id, callback) { - var currentTab = $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-title [lay-id='" + id + "']"); - if (currentTab.find("span").is(".able-close")) { - tabDelete(elem, id, callback); - } - } - - // 根据过滤 filter 标识, 删除其他选项卡 - pearTab.prototype.delOtherTabByElem = function(elem, callback) { - var currentId = $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-title .layui-this").attr("lay-id"); - var tabtitle = $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-title li"); - $.each(tabtitle, function(i) { - if ($(this).attr("lay-id") != currentId) { - if ($(this).find("span").is(".able-close")) { - tabDelete(elem, $(this).attr("lay-id"), callback); - } - } - }) - } - - // 根据过滤 filter 标识, 删除全部选项卡 - pearTab.prototype.delAllTabByElem = function(elem, callback) { - var currentId = $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-title .layui-this").attr("lay-id"); - var tabtitle = $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-title li"); - $.each(tabtitle, function(i) { - if ($(this).find("span").is(".able-close")) { - tabDelete(elem, $(this).attr("lay-id"), callback); - } - }) - } - - // 根据过滤 filter 标识, 删除当前选项卡 - pearTab.prototype.delCurrentTabByElem = function(elem, callback) { - var currentTab = $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-title .layui-this"); - if (currentTab.find("span").is(".able-close")) { - var currentId = currentTab.attr("lay-id"); - tabDelete(elem, currentId, callback); - } - } - - // 通过过滤 filter 标识, 新增标签页 - pearTab.prototype.addTabOnlyByElem = function(elem, opt, time) { - var title = ''; - if (opt.close) { - title += '' + opt.title + - '' - } else { - title += '' + opt.title + - '' - } - if ($(".layui-tab[lay-filter='" + elem + "'] .layui-tab-title li[lay-id]").length <= 0) { - element.tabAdd(elem, { - title: title, - content: '', - id: opt.id - }); - if (time != false && time != 0) { - tabIframeLoading(elem, opt.id); - } - tabData.push(opt); - sessionStorage.setItem(elem + "-pear-tab-data", JSON.stringify(tabData)); - } else { - var isData = false; - $.each($(".layui-tab[lay-filter='" + elem + "'] .layui-tab-title li[lay-id]"), function() { - if ($(this).attr("lay-id") == opt.id) { - isData = true; - } - }) - - if (isData == false) { - element.tabAdd(elem, { - title: title, - content: '', - id: opt.id - }); - if (time != false && time != 0) { - tabIframeLoading(elem, opt.id); - } - tabData.push(opt); - sessionStorage.setItem(elem + "-pear-tab-data", JSON.stringify(tabData)); - - } - } - sessionStorage.setItem(elem + "-pear-tab-data-current", opt.id); - element.tabChange(elem, opt.id); - } - - /** 添 加 唯 一 选 项 卡 */ - pearTab.prototype.addTabOnly = function(opt, time) { - var title = ''; - if (opt.close) { - title += '' + opt.title + - ''; - } else { - title += '' + opt.title + - ''; - } - if ($(".layui-tab[lay-filter='" + this.option.elem + "'] .layui-tab-title li[lay-id]").length <= 0) { - element.tabAdd(this.option.elem, { - title: title, - content: '', - id: opt.id - }); - if (time != false && time != 0) { - tabIframeLoading(this.option.elem, opt.id); - } - tabData.push(opt); - sessionStorage.setItem(this.option.elem + "-pear-tab-data", JSON.stringify(tabData)); - sessionStorage.setItem(this.option.elem + "-pear-tab-data-current", opt.id); - } else { - var isData = false; - $.each($(".layui-tab[lay-filter='" + this.option.elem + "'] .layui-tab-title li[lay-id]"), function() { - if ($(this).attr("lay-id") == opt.id) { - isData = true; - } - }) - if (isData == false) { - - if(this.option.tabMax != false) { - if ($(".layui-tab[lay-filter='" + this.option.elem + "'] .layui-tab-title li[lay-id]").length >= this.option.tabMax) { - layer.msg("最多打开" + this.option.tabMax + "个标签页", { - icon: 2, - time: 1000, - shift: 6 - }); - return false; - } - } - - element.tabAdd(this.option.elem, { - title: title, - content: '', - id: opt.id - }); - if (time != false && time != 0) { - tabIframeLoading(this.option.elem, opt.id); - } - tabData.push(opt); - sessionStorage.setItem(this.option.elem + "-pear-tab-data", JSON.stringify(tabData)); - sessionStorage.setItem(this.option.elem + "-pear-tab-data-current", opt.id); - } - } - element.tabChange(this.option.elem, opt.id); - sessionStorage.setItem(this.option.elem + "-pear-tab-data-current", opt.id); - } - - // 刷 新 指 定 的 选 项 卡 - pearTab.prototype.refresh = function (time) { - // 刷 新 指 定 的 选 项 卡 - if (time != false && time != 0) { - tabIframeLoading(this.option.elem); - } else { - var $iframe = $(".layui-tab[lay-filter='" + this.option.elem + "'] .layui-tab-content .layui-show").find("iframe"); - $iframe.attr("src", $iframe.attr("src")); - } - } - - function tabIframeLoading(elem, id) { - var load = '
              ' + - '
              ' + - '' + - '
              ' + - '
              ' - var $iframe = $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-content .layui-show").find("iframe"); - if(id){ - $iframe = $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-content").find("iframe[id='"+ id +"']"); - } - // loading 和 iframe 同级处理, 避免一个 tab 加载,其它 tab 无法查看的问题 - $iframe.parent().append(load); - var pearLoad = $("#" + elem).find("#pear-tab-loading" + index); - pearLoad.css({ display: "block" }); - index++; - $iframe.attr("src", $iframe.attr("src")); // 支持跨域刷新 iframe - $iframe.load(function () { - pearLoad.fadeOut(1000, function () { - pearLoad.remove(); - }); - }) - } - - - function tabDelete(elem, id, callback, option) { - - //根据 elem id 来删除指定的 layui title li - var tabTitle = $(".layui-tab[lay-filter='" + elem + "']").find(".layui-tab-title"); - - // 删除指定 id 的 title - var removeTab = tabTitle.find("li[lay-id='" + id + "']"); - var nextNode = removeTab.next("li"); - if (!removeTab.hasClass("layui-this")) { - removeTab.remove(); - var tabContent = $(".layui-tab[lay-filter='" + elem + "']").find("iframe[id='" + id + "']").parent(); - tabContent.remove(); - - tabData = JSON.parse(sessionStorage.getItem(elem + "-pear-tab-data")); - tabDataCurrent = sessionStorage.getItem(elem + "-pear-tab-data-current"); - tabData = tabData.filter(function(item) { - return item.id != id; - }) - sessionStorage.setItem(elem + "-pear-tab-data", JSON.stringify(tabData)); - return false; - } - - var currId; - if (nextNode.length) { - nextNode.addClass("layui-this"); - currId = nextNode.attr("lay-id"); - $("#" + elem + " [id='" + currId + "']").parent().addClass("layui-show"); - } else { - var prevNode = removeTab.prev("li"); - prevNode.addClass("layui-this"); - currId = prevNode.attr("lay-id"); - $("#" + elem + " [id='" + currId + "']").parent().addClass("layui-show"); - } - callback(currId); - tabData = JSON.parse(sessionStorage.getItem(elem + "-pear-tab-data")); - tabDataCurrent = sessionStorage.getItem(elem + "-pear-tab-data-current"); - tabData = tabData.filter(function(item) { - return item.id != id; - }) - sessionStorage.setItem(elem + "-pear-tab-data", JSON.stringify(tabData)); - sessionStorage.setItem(elem + "-pear-tab-data-current", currId); - - removeTab.remove(); - // 删除 content - var tabContent = $(".layui-tab[lay-filter='" + elem + "']").find("iframe[id='" + id + "']").parent(); - // 删除 - tabContent.remove(); - } - - function createTab(option) { - - var type = ""; - var types = option.type + " "; - if (option.roll == true) { - type = "layui-tab-roll"; - } - if (option.tool != false) { - type = "layui-tab-tool"; - } - if (option.roll == true && option.tool != false) { - type = "layui-tab-rollTool"; - } - var tab = '
              '; - var title = '
                '; - var content = '
                '; - var control = - '
                • '; - - // 处 理 选 项 卡 头 部 - var index = 0; - $.each(option.data, function(i, item) { - var TitleItem = ''; - if (option.index == index) { - TitleItem += '
                • '; - } else { - TitleItem += '
                • '; - } - - if (item.close) { - // 当 前 选 项 卡 可 以 关 闭 - TitleItem += '' + item.title + ''; - } else { - // 当 前 选 项 卡 不 允 许 关 闭 - TitleItem += '' + item.title + ''; - } - TitleItem += '
                • '; - title += TitleItem; - if (option.index == index) { - - // 处 理 显 示 内 容 - content += '
                  ' - } else { - // 处 理 显 示 内 容 - content += '
                  ' - } - index++; - }); - - title += '
                '; - content += '
              • '; - control += '
                关 闭 当 前
                ' - control += '
                关 闭 其 他
                ' - control += '
                关 闭 全 部
                ' - control += '
              '; - - tab += title; - tab += control; - tab += content; - tab += '
              '; - tab += '' - return tab; - } - - function rollPage(d, option) { - var $tabTitle = $('#' + option.elem + ' .layui-tab-title'); - var left = $tabTitle.scrollLeft(); - if ('left' === d) { - $tabTitle.animate({ - scrollLeft: left - 450 - }, 200); - } else { - $tabTitle.animate({ - scrollLeft: left + 450 - }, 200); - } - } - - function closeEvent(option) { - $(".layui-tab[lay-filter='" + option.elem + "']").on("click", ".layui-tab-close", function() { - var layid = $(this).parent().attr("lay-id"); - tabDelete(option.elem, layid, option.closeEvent, option); - }) - } - - function menuEvent(option, index) { - - $("#" + option.elem + "closeThis").click(function() { - var currentTab = contextTabDOM; - - if (currentTab.find("span").is(".able-close")) { - var currentId = currentTab.attr("lay-id"); - tabDelete(option.elem, currentId, option.closeEvent, option); - } else { - layer.msg("当前页面不允许关闭", { - icon: 3, - time: 800 - }) - } - layer.close(index); - }) - - $("#" + option.elem + "closeOther").click(function() { - var currentId = contextTabDOM.attr("lay-id"); - var tabtitle = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title li"); - $.each(tabtitle, function(i) { - if ($(this).attr("lay-id") != currentId) { - if ($(this).find("span").is(".able-close")) { - tabDelete(option.elem, $(this).attr("lay-id"), option.closeEvent, option); - } - } - }) - layer.close(index); - }) - - $("#" + option.elem + "closeAll").click(function() { - var currentId = contextTabDOM.attr("lay-id"); - var tabtitle = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title li"); - $.each(tabtitle, function(i) { - if ($(this).find("span").is(".able-close")) { - tabDelete(option.elem, $(this).attr("lay-id"), option.closeEvent, option); - } - }) - layer.close(index); - }) - } - - - function toolEvent(option) { - - $("body .layui-tab[lay-filter='" + option.elem + "']").on("click", "#closeThis", function() { - var currentTab = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title .layui-this"); - if (currentTab.find("span").is(".able-close")) { - var currentId = currentTab.attr("lay-id"); - tabDelete(option.elem, currentId, option.closeEvent, option); - } else { - layer.msg("当前页面不允许关闭", { - icon: 3, - time: 800 - }) - } - }) - - $("body .layui-tab[lay-filter='" + option.elem + "']").on("click", "#closeOther", function() { - var currentId = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title .layui-this").attr("lay-id"); - var tabtitle = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title li"); - $.each(tabtitle, function(i) { - if ($(this).attr("lay-id") != currentId) { - if ($(this).find("span").is(".able-close")) { - tabDelete(option.elem, $(this).attr("lay-id"), option.closeEvent, option); - } - } - }) - }) - - $("body .layui-tab[lay-filter='" + option.elem + "']").on("click", "#closeAll", function() { - var currentId = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title .layui-this").attr("lay-id"); - var tabtitle = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title li"); - $.each(tabtitle, function(i) { - if ($(this).find("span").is(".able-close")) { - tabDelete(option.elem, $(this).attr("lay-id"), option.closeEvent, option); - } - }) - }) - } - - exports(MOD_NAME, new pearTab()); + "use strict"; + + var MOD_NAME = 'tab', + $ = layui.jquery, + element = layui.element; + + var pearTab = function(opt) { + this.option = opt; + }; + + var tabData = new Array(); + var tabDataCurrent = 0; + var contextTabDOM; + + pearTab.prototype.render = function(opt) { + + var option = { + elem: opt.elem, + data: opt.data, + tool: opt.tool, + roll: opt.roll, + index: opt.index, + width: opt.width, + height: opt.height, + tabMax: opt.tabMax, + session: opt.session ? opt.session : false, + preload: opt.preload ? opt.preload : false, + closeEvent: opt.closeEvent, + success: opt.success ? opt.success : function(id) {} + } + + if (option.session) { + if (sessionStorage.getItem(option.elem + "-pear-tab-data") != null) { + tabData = JSON.parse(sessionStorage.getItem(option.elem + "-pear-tab-data")); + option.data = JSON.parse(sessionStorage.getItem(option.elem + "-pear-tab-data")); + tabDataCurrent = sessionStorage.getItem(option.elem + "-pear-tab-data-current"); + tabData.forEach(function(item, index) { + if (item.id == tabDataCurrent) { + option.index = index; + } + }) + } else { + tabData = opt.data; + } + } + + var lastIndex; + var tab = createTab(option); + $("#" + option.elem).html(tab); + $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-prev").click(function() { + rollPage("left", option); + }) + $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-next").click(function() { + rollPage("right", option); + }) + element.init(); + toolEvent(option); + $("#" + option.elem).width(opt.width); + $("#" + option.elem).height(opt.height); + $("#" + option.elem).css({ + position: "relative" + }); + closeEvent(option); + + option.success(sessionStorage.getItem(option.elem + "-pear-tab-data-current")); + + $("body .layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title").on("contextmenu", "li", + function(e) { + // 获取当前元素位置 + var top = e.clientY; + var left = e.clientX; + var menuWidth = 100; + var currentId = $(this).attr("lay-id"); + var menu = "
              • 关闭当前
              • 关闭其他
              • 关闭所有
              "; + + contextTabDOM = $(this); + var isOutsideBounds = (left + menuWidth) > $(window).width(); + if (isOutsideBounds) { + left = $(window).width() - menuWidth; + } + // 初始化 + layer.open({ + type: 1, + title: false, + shade: false, + skin: 'pear-tab-menu', + closeBtn: false, + area: [menuWidth + 'px', '108px'], + fixed: true, + anim: false, + isOutAnim: false, + offset: [top, left], + content: menu, //iframe的url, + success: function(layero, index) { + layer.close(lastIndex); + lastIndex = index; + menuEvent(option, index); + var timer; + $(layero).on('mouseout', function() { + timer = setTimeout(function() { + layer.close(index); + }, 30) + }); + + $(layero).on('mouseover', function() { + clearTimeout(timer); + }); + + // 清除 item 右击 + $(layero).on('contextmenu', function() { + return false; + }) + + } + }); + return false; + }) + + mousewheelAndTouchmoveHandler(option) + return new pearTab(option); + } + + pearTab.prototype.click = function(callback) { + var elem = this.option.elem; + var option = this.option; + element.on('tab(' + this.option.elem + ')', function(data) { + var id = $("#" + elem + " .layui-tab-title .layui-this").attr("lay-id"); + sessionStorage.setItem(option.elem + "-pear-tab-data-current", id); + if (!option.preload) { + var $iframe = $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-content").find( + "iframe[id='" + id + "']"); + var iframeUrl = $iframe.attr("src"); + if (!iframeUrl || iframeUrl === "about:blank") { + // 获取 url 并重载 + tabData.forEach(function(item, index) { + if (item.id === id) { + iframeUrl = item.url; + } + }) + tabIframeLoading(elem); + $iframe.attr("src", iframeUrl); + } + } + callback(id); + }); + } + + pearTab.prototype.positionTab = function() { + var $tabTitle = $('.layui-tab[lay-filter=' + this.option.elem + '] .layui-tab-title'); + var autoLeft = 0; + $tabTitle.children("li").each(function() { + if ($(this).hasClass('layui-this')) { + return false; + } else { + autoLeft += $(this).outerWidth(); + } + }); + $tabTitle.animate({ + scrollLeft: autoLeft - $tabTitle.width() / 3 + }, 200); + } + + pearTab.prototype.clear = function() { + sessionStorage.removeItem(this.option.elem + "-pear-tab-data"); + sessionStorage.removeItem(this.option.elem + "-pear-tab-data-current"); + } + + pearTab.prototype.addTab = function(opt) { + var title = ''; + if (opt.close) { + title += '' + opt.title + + ''; + } else { + title += '' + opt.title + + ''; + } + element.tabAdd(this.option.elem, { + title: title, + content: '', + id: opt.id + }); + if (time != false && time != 0) { + tabIframeLoading(elem, opt.id); + } + tabData.push(opt); + sessionStorage.setItem(elem + "-pear-tab-data", JSON.stringify(tabData)); + } else { + var isData = false; + $.each($(".layui-tab[lay-filter='" + elem + "'] .layui-tab-title li[lay-id]"), function() { + if ($(this).attr("lay-id") == opt.id) { + isData = true; + } + }) + + if (isData == false) { + element.tabAdd(elem, { + title: title, + content: '', + id: opt.id + }); + if (time != false && time != 0) { + tabIframeLoading(elem, opt.id); + } + tabData.push(opt); + sessionStorage.setItem(elem + "-pear-tab-data", JSON.stringify(tabData)); + + } + } + sessionStorage.setItem(elem + "-pear-tab-data-current", opt.id); + element.tabChange(elem, opt.id); + } + + /** 添 加 唯 一 选 项 卡 */ + pearTab.prototype.addTabOnly = function(opt, time) { + var title = ''; + if (opt.close) { + title += '' + opt.title + + ''; + } else { + title += '' + opt.title + + ''; + } + if ($(".layui-tab[lay-filter='" + this.option.elem + "'] .layui-tab-title li[lay-id]").length <= + 0) { + element.tabAdd(this.option.elem, { + title: title, + content: '', + id: opt.id + }); + if (time != false && time != 0) { + tabIframeLoading(this.option.elem, opt.id); + } + tabData.push(opt); + sessionStorage.setItem(this.option.elem + "-pear-tab-data", JSON.stringify(tabData)); + sessionStorage.setItem(this.option.elem + "-pear-tab-data-current", opt.id); + } else { + var isData = false; + $.each($(".layui-tab[lay-filter='" + this.option.elem + "'] .layui-tab-title li[lay-id]"), + function() { + if ($(this).attr("lay-id") == opt.id) { + isData = true; + } + }) + if (isData == false) { + + if (this.option.tabMax != false) { + if ($(".layui-tab[lay-filter='" + this.option.elem + "'] .layui-tab-title li[lay-id]") + .length >= this.option.tabMax) { + layer.msg("最多打开" + this.option.tabMax + "个标签页", { + icon: 2, + time: 1000, + shift: 6 + }); + return false; + } + } + + element.tabAdd(this.option.elem, { + title: title, + content: '', + id: opt.id + }); + if (time != false && time != 0) { + tabIframeLoading(this.option.elem, opt.id); + } + tabData.push(opt); + sessionStorage.setItem(this.option.elem + "-pear-tab-data", JSON.stringify(tabData)); + sessionStorage.setItem(this.option.elem + "-pear-tab-data-current", opt.id); + } + } + element.tabChange(this.option.elem, opt.id); + sessionStorage.setItem(this.option.elem + "-pear-tab-data-current", opt.id); + } + + // 刷 新 指 定 的 选 项 卡 + pearTab.prototype.refresh = function(time) { + // 刷 新 指 定 的 选 项 卡 + var $iframe = $(".layui-tab[lay-filter='" + this.option.elem + "'] .layui-tab-content .layui-show") + .find("iframe"); + if (time != false && time != 0) { + tabIframeLoading(this.option.elem); + } + $iframe.attr("src", $iframe.attr("src")); + } + + function tabIframeLoading(elem, id) { + var load = '
              ' + + '
              ' + + '' + + '
              ' + + '
              ' + var $iframe = $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-content .layui-show").find("iframe"); + if (id) { + $iframe = $(".layui-tab[lay-filter='" + elem + "'] .layui-tab-content").find("iframe[id='" + id + + "']"); + } + $iframe.parent().append(load); + var pearLoad = $("#" + elem).find("#pear-tab-loading" + index); + pearLoad.css({ + display: "block" + }); + index++; + $iframe.on("load", function() { + pearLoad.fadeOut(1000, function() { + pearLoad.remove(); + }); + }) + } + + function tabDelete(elem, id, callback, option) { + //根据 elem id 来删除指定的 layui title li + var tabTitle = $(".layui-tab[lay-filter='" + elem + "']").find(".layui-tab-title"); + + // 删除指定 id 的 title + var removeTab = tabTitle.find("li[lay-id='" + id + "']"); + var nextNode = removeTab.next("li"); + if (!removeTab.hasClass("layui-this")) { + removeTab.remove(); + var tabContent = $(".layui-tab[lay-filter='" + elem + "']").find("iframe[id='" + id + "']") + .parent(); + tabContent.remove(); + + tabData = JSON.parse(sessionStorage.getItem(elem + "-pear-tab-data")); + tabDataCurrent = sessionStorage.getItem(elem + "-pear-tab-data-current"); + tabData = tabData.filter(function(item) { + return item.id != id; + }) + sessionStorage.setItem(elem + "-pear-tab-data", JSON.stringify(tabData)); + return false; + } + + var currId; + if (nextNode.length) { + nextNode.addClass("layui-this"); + currId = nextNode.attr("lay-id"); + $("#" + elem + " [id='" + currId + "']").parent().addClass("layui-show"); + } else { + var prevNode = removeTab.prev("li"); + prevNode.addClass("layui-this"); + currId = prevNode.attr("lay-id"); + $("#" + elem + " [id='" + currId + "']").parent().addClass("layui-show"); + } + callback(currId); + tabData = JSON.parse(sessionStorage.getItem(elem + "-pear-tab-data")); + tabDataCurrent = sessionStorage.getItem(elem + "-pear-tab-data-current"); + tabData = tabData.filter(function(item) { + return item.id != id; + }) + sessionStorage.setItem(elem + "-pear-tab-data", JSON.stringify(tabData)); + sessionStorage.setItem(elem + "-pear-tab-data-current", currId); + + removeTab.remove(); + // 删除 content + var tabContent = $(".layui-tab[lay-filter='" + elem + "']").find("iframe[id='" + id + "']").parent(); + // 删除 + tabContent.remove(); + } + + function createTab(option) { + + var type = ""; + var types = option.type + " "; + if (option.roll == true) { + type = "layui-tab-roll"; + } + if (option.tool != false) { + type = "layui-tab-tool"; + } + if (option.roll == true && option.tool != false) { + type = "layui-tab-rollTool"; + } + var tab = '
              '; + var title = '
                '; + var content = '
                '; + var control = + '
                • '; + + // 处 理 选 项 卡 头 部 + var index = 0; + $.each(option.data, function(i, item) { + var TitleItem = ''; + if (option.index == index) { + TitleItem += '
                • '; + } else { + TitleItem += '
                • '; + } + + if (item.close) { + // 当 前 选 项 卡 可 以 关 闭 + TitleItem += '' + item.title + ''; + } else { + // 当 前 选 项 卡 不 允 许 关 闭 + TitleItem += '' + item.title + ''; + } + TitleItem += '
                • '; + title += TitleItem; + if (option.index == index) { + + // 处 理 显 示 内 容 + content += '
                  ' + } else { + if (!option.preload) { + item.url = "about:blank"; + } + // 处 理 显 示 内 容 + content += '
                  ' + } + index++; + }); + + title += '
                '; + content += '
              • '; + control += '
                关 闭 当 前
                ' + control += '
                关 闭 其 他
                ' + control += '
                关 闭 全 部
                ' + control += '
              '; + + tab += title; + tab += control; + tab += content; + tab += '
              '; + tab += '' + return tab; + } + + function rollPage(d, option) { + var $tabTitle = $('#' + option.elem + ' .layui-tab-title'); + var left = $tabTitle.scrollLeft(); + if ('left' === d) { + $tabTitle.animate({ + scrollLeft: left - 450 + }, 200); + } else { + $tabTitle.animate({ + scrollLeft: left + 450 + }, 200); + } + } + + function closeEvent(option) { + $(".layui-tab[lay-filter='" + option.elem + "']").on("click", ".layui-tab-close", function() { + var layid = $(this).parent().attr("lay-id"); + tabDelete(option.elem, layid, option.closeEvent, option); + }) + } + + function menuEvent(option, index) { + + $("#" + option.elem + "closeThis").click(function() { + var currentTab = contextTabDOM; + + if (currentTab.find("span").is(".able-close")) { + var currentId = currentTab.attr("lay-id"); + tabDelete(option.elem, currentId, option.closeEvent, option); + } else { + layer.msg("当前页面不允许关闭", { + icon: 3, + time: 800 + }) + } + layer.close(index); + }) + + $("#" + option.elem + "closeOther").click(function() { + var currentId = contextTabDOM.attr("lay-id"); + var tabtitle = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title li"); + $.each(tabtitle, function(i) { + if ($(this).attr("lay-id") != currentId) { + if ($(this).find("span").is(".able-close")) { + tabDelete(option.elem, $(this).attr("lay-id"), option.closeEvent, + option); + } + } + }) + layer.close(index); + }) + + $("#" + option.elem + "closeAll").click(function() { + var currentId = contextTabDOM.attr("lay-id"); + var tabtitle = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title li"); + $.each(tabtitle, function(i) { + if ($(this).find("span").is(".able-close")) { + tabDelete(option.elem, $(this).attr("lay-id"), option.closeEvent, option); + } + }) + layer.close(index); + }) + } + + function toolEvent(option) { + $("body .layui-tab[lay-filter='" + option.elem + "']").on("click", "#closeThis", function() { + var currentTab = $(".layui-tab[lay-filter='" + option.elem + + "'] .layui-tab-title .layui-this"); + if (currentTab.find("span").is(".able-close")) { + var currentId = currentTab.attr("lay-id"); + tabDelete(option.elem, currentId, option.closeEvent, option); + } else { + layer.msg("当前页面不允许关闭", { + icon: 3, + time: 800 + }) + } + }) + + $("body .layui-tab[lay-filter='" + option.elem + "']").on("click", "#closeOther", function() { + var currentId = $(".layui-tab[lay-filter='" + option.elem + + "'] .layui-tab-title .layui-this").attr("lay-id"); + var tabtitle = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title li"); + $.each(tabtitle, function(i) { + if ($(this).attr("lay-id") != currentId) { + if ($(this).find("span").is(".able-close")) { + tabDelete(option.elem, $(this).attr("lay-id"), option.closeEvent, + option); + } + } + }) + }) + + $("body .layui-tab[lay-filter='" + option.elem + "']").on("click", "#closeAll", function() { + var currentId = $(".layui-tab[lay-filter='" + option.elem + + "'] .layui-tab-title .layui-this").attr("lay-id"); + var tabtitle = $(".layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title li"); + $.each(tabtitle, function(i) { + if ($(this).find("span").is(".able-close")) { + tabDelete(option.elem, $(this).attr("lay-id"), option.closeEvent, option); + } + }) + }) + } + + function mousewheelAndTouchmoveHandler(option) { + var $bodyTab = $("body .layui-tab[lay-filter='" + option.elem + "'] .layui-tab-title") + var $tabTitle = $('#' + option.elem + ' .layui-tab-title'); + var mouseScrollStep = 100 + // 鼠标滚轮 + $bodyTab.on("mousewheel DOMMouseScroll", function(e) { + e.originalEvent.preventDefault() + var delta = (e.originalEvent.wheelDelta && (e.originalEvent.wheelDelta > 0 ? "top" : + "down")) || // chrome & ie + (e.originalEvent.detail && (e.originalEvent.detail > 0 ? "down" : "top")); // firefox + var scrollLeft = $tabTitle.scrollLeft(); + + if (delta === "top") { + scrollLeft -= mouseScrollStep + } else if (delta === "down") { + scrollLeft += mouseScrollStep + } + $tabTitle.scrollLeft(scrollLeft) + }); + + // 触摸移动 + var touchX = 0; + $bodyTab.on("touchstart", function(e) { + var touch = e.originalEvent.targetTouches[0]; + touchX = touch.pageX + }) + $bodyTab.on("touchmove", function(e) { + var event = e.originalEvent; + if (event.targetTouches.length > 1) return; + event.preventDefault(); + var touch = event.targetTouches[0]; + var distanceX = touchX - touch.pageX + var scrollLeft = $tabTitle.scrollLeft(); + touchX = touch.pageX + $tabTitle.scrollLeft(scrollLeft += distanceX) + }); + } + + exports(MOD_NAME, new pearTab()); }) diff --git a/src/main/resources/static/component/pear/module/tag.js b/src/main/resources/static/component/pear/module/tag.js index 83ced709..b7222ce2 100644 --- a/src/main/resources/static/component/pear/module/tag.js +++ b/src/main/resources/static/component/pear/module/tag.js @@ -1,163 +1,159 @@ -layui.define('jquery', function (exports) { - "use strict"; - - var $ = layui.$ - , MOD_NAME = 'tag', - TAG_CLASS = '.tag', - BUTTON_NEW_TAG = 'button-new-tag', - INPUT_NEW_TAG = 'input-new-tag', - TAG_ITEM = 'tag-item', - CLOSE = 'tag-close', - DEFAULT_SKIN = 'layui-btn layui-btn-primary layui-btn-sm', - tag = function () { - this.config = { - likeHref: '../../modules/tag.css', - skin: DEFAULT_SKIN, - tagText: '+ New Tag' - }; - this.configs = {} - }; - - tag.prototype.set = function (options) { - var that = this; - $.extend(true, that.config, options); - tag.render(); - return that; - }; - - //表单事件监听 - tag.prototype.on = function (events, callback) { - return layui.onevent.call(this, MOD_NAME, events, callback); - }; - - //外部Tag新增 - tag.prototype.add = function (filter, options) { - var tagElem = $(TAG_CLASS + '[lay-filter=' + filter + ']') - call.add(null, tagElem, options); - call.tagAuto(filter); - return this; - }; - - //外部Tag删除 - tag.prototype.delete = function (filter, layid) { - var tagElem = $(TAG_CLASS + '[lay-filter=' + filter + ']') - , tagItemElem = tagElem.find('>.' + TAG_ITEM + '[lay-id="' + layid + '"]'); - call.delete(null, tagItemElem); - return this; +layui.define('jquery', function(exports){ + "use strict"; + + var $ = layui.$ + ,MOD_NAME = 'tag', + TAG_CLASS = '.tag', + BUTTON_NEW_TAG ='button-new-tag', + INPUT_NEW_TAG ='input-new-tag', + TAG_ITEM ='tag-item', + CLOSE = 'tag-close', + DEFAULT_SKIN ='layui-btn layui-btn-primary layui-btn-sm' + ,tag = function(){ + this.config = { + skin: DEFAULT_SKIN, + tagText:'+ New Tag' }; + this.configs = {} + }; + + //全局设置 + tag.prototype.set = function(options){ + var that = this; + $.extend(true, that.config, options); + tag.render(); + return that; + }; + + //表单事件监听 + tag.prototype.on = function(events, callback){ + return layui.onevent.call(this, MOD_NAME, events, callback); + }; + + //外部Tag新增 + tag.prototype.add = function(filter, options){ + var tagElem = $(TAG_CLASS + '[lay-filter='+ filter +']') + call.add(null, tagElem, options); + call.tagAuto(filter); + return this; + }; + + //外部Tag删除 + tag.prototype.delete = function(filter, layid){ + var tagElem = $(TAG_CLASS + '[lay-filter='+ filter +']') + ,tagItemElem = tagElem.find('>.' + TAG_ITEM + '[lay-id="'+ layid +'"]'); + call.delete(null, tagItemElem); + return this; + }; - //基础事件体 - var call = { - //Tag点击 - tagClick: function (e, index, tagItemElem, options) { - options = options || {}; - var othis = tagItemElem || $(this) - , index = index || othis.index(othis) - , parents = othis.parents(TAG_CLASS).eq(0) - , filter = parents.attr('lay-filter'); - layui.event.call(this, MOD_NAME, 'click(' + filter + ')', { - elem: parents - , index: index - }); + //基础事件体 + var call = { + //Tag点击 + tagClick: function(e, index, tagItemElem, options){ + options = options || {}; + var othis = tagItemElem || $(this) + ,index = index || othis.index(othis) + ,parents = othis.parents(TAG_CLASS).eq(0) + ,filter = parents.attr('lay-filter'); + layui.event.call(this, MOD_NAME, 'click('+ filter +')', { + elem: parents + ,index: index + }); + } + //Tag新增事件 + ,add: function(e, tagElem, options){ + var filter = tagElem.attr('lay-filter'), + buttonNewTag = tagElem.children('.' + BUTTON_NEW_TAG), + index = buttonNewTag.index() + ,newTag = ''; + var result = layui.event.call(this, MOD_NAME, 'add('+ filter +')', { + elem: tagElem + ,index: index + ,othis: newTag + }) + if(result === false) return; + buttonNewTag[0] ? buttonNewTag.before(newTag) : tagElem.append(newTag); + } + //Tag输入事件 + ,input: function(e, othis){ + var buttonNewTag = othis || $(this) + ,parents = buttonNewTag.parents(TAG_CLASS).eq(0) + ,filter = parents.attr('lay-filter') + var options = tag.configs[filter] = $.extend({}, tag.config, tag.configs[filter] || {}, options); + //标签输入框 + var inpatNewTag = $('
              '); + inpatNewTag.addClass(options.skin); + buttonNewTag.after(inpatNewTag).remove(); + inpatNewTag.children('.layui-input').on('blur', function () { + if(this.value){ + var options = { + text: this.value + } + call.add(null, parents, options); } - //Tag新增事件 - , add: function (e, tagElem, options) { - var filter = tagElem.attr('lay-filter'), - buttonNewTag = tagElem.children('.' + BUTTON_NEW_TAG), - index = buttonNewTag.index() - , - newTag = ''; - var result = layui.event.call(this, MOD_NAME, 'add(' + filter + ')', { - elem: tagElem - , index: index - , othis: newTag - }) - if (result === false) return; - buttonNewTag[0] ? buttonNewTag.before(newTag) : tagElem.append(newTag); - } - //Tag输入事件 - , input: function (e, othis) { - var buttonNewTag = othis || $(this) - , parents = buttonNewTag.parents(TAG_CLASS).eq(0) - , filter = parents.attr('lay-filter') - var options = tag.configs[filter] = $.extend({}, tag.config, tag.configs[filter] || {}, options); - //标签输入框 - var inpatNewTag = $('
              '); - inpatNewTag.addClass(options.skin); - buttonNewTag.after(inpatNewTag).remove(); - inpatNewTag.children('.layui-input').on('blur', function () { - if (this.value) { - var options = { - text: this.value - } - call.add(null, parents, options); - } - inpatNewTag.remove(); - call.tagAuto(filter); - }).focus(); - } - //Tag删除 - , delete: function (e, othis) { - var tagItem = othis || $(this).parent(), index = tagItem.index() - , parents = tagItem.parents(TAG_CLASS).eq(0) - , filter = parents.attr('lay-filter'); + inpatNewTag.remove(); + call.tagAuto(filter); + }).focus(); + } + //Tag删除 + ,delete: function(e, othis){ + var tagItem = othis || $(this).parent(), index = tagItem.index() + ,parents = tagItem.parents(TAG_CLASS).eq(0) + ,filter = parents.attr('lay-filter'); - var result = layui.event.call(this, MOD_NAME, 'delete(' + filter + ')', { - elem: parents - , index: index - }) - if (result === false) return; - tagItem.remove() + var result = layui.event.call(this, MOD_NAME, 'delete('+ filter +')', { + elem: parents + ,index: index + }) + if(result === false) return; + tagItem.remove() + } + //Tag 自适应 + ,tagAuto: function(filter){ + filter = filter || ''; + var options = filter ? tag.configs[filter] || tag.config : tag.config; + var elemFilter = function(){ + return filter ? ('[lay-filter="' + filter +'"]') : ''; + }(); + $(TAG_CLASS + elemFilter).each(function(){ + var othis = $(this),tagItem = othis.children('.' + TAG_ITEM), buttonNewTag = othis.children('.' + BUTTON_NEW_TAG); + tagItem.removeClass(DEFAULT_SKIN).addClass(options.skin); + //允许关闭 + if(othis.attr('lay-allowClose') && tagItem.length){ + tagItem.each(function(){ + var li = $(this); + if(!li.find('.'+CLOSE)[0]){ + var close = $(''); + close.on('click', call.delete); + li.append(close); + } + }); } - //Tag 自适应 - , tagAuto: function (filter) { - filter = filter || ''; - var options = filter ? tag.configs[filter] || tag.config : tag.config; - var elemFilter = function () { - return filter ? ('[lay-filter="' + filter + '"]') : ''; - }(); - $(TAG_CLASS + elemFilter).each(function () { - var othis = $(this), tagItem = othis.children('.' + TAG_ITEM), - buttonNewTag = othis.children('.' + BUTTON_NEW_TAG); - tagItem.removeClass(DEFAULT_SKIN).addClass(options.skin); - //允许关闭 - if (othis.attr('lay-allowClose') && tagItem.length) { - tagItem.each(function () { - var li = $(this); - if (!li.find('.' + CLOSE)[0]) { - var close = $(''); - close.on('click', call.delete); - li.append(close); - } - }); - } - //允许新增标签 - if (othis.attr('lay-newTag') && buttonNewTag.length === 0) { - buttonNewTag = $(''); - buttonNewTag.on('click', call.input); - othis.append(buttonNewTag); - } - buttonNewTag.html(options.tagText); - buttonNewTag.removeClass(DEFAULT_SKIN).addClass(options.skin); - }); + //允许新增标签 + if(othis.attr('lay-newTag') && buttonNewTag.length === 0){ + buttonNewTag = $(''); + buttonNewTag.on('click', call.input); + othis.append(buttonNewTag); } - }; + buttonNewTag.html(options.tagText); + buttonNewTag.removeClass(DEFAULT_SKIN).addClass(options.skin); + }); + } + }; + + tag.prototype.init = function(filter, options){ + if(filter){ + tag.configs[filter] = $.extend({}, tag.config, tag.configs[filter] || {}, options); + } + return call.tagAuto.call(this, filter); + }; + + tag.prototype.render = tag.prototype.init; - //初始化元素操作 - tag.prototype.init = function (filter, options) { - layui.addcss(tag.config.likeHref); - if (filter) { - tag.configs[filter] = $.extend({}, tag.config, tag.configs[filter] || {}, options); - } - return call.tagAuto.call(this, filter); - }; - - tag.prototype.render = tag.prototype.init; - - var tag = new tag(), dom = $(document); - tag.render(); + var tag = new tag(), dom = $(document); + tag.render(); - dom.on('click', '.' + TAG_ITEM, call.tagClick); //tag 单击事件 - exports(MOD_NAME, tag); + dom.on('click', '.' + TAG_ITEM, call.tagClick); //tag 单击事件 + exports(MOD_NAME, tag); }); diff --git a/src/main/resources/static/component/pear/module/theme.js b/src/main/resources/static/component/pear/module/theme.js index de05dc99..01fd0267 100644 --- a/src/main/resources/static/component/pear/module/theme.js +++ b/src/main/resources/static/component/pear/module/theme.js @@ -1,100 +1,102 @@ layui.define(["jquery","layer"], function (exports) { - var MOD_NAME = 'theme', - $ = layui.jquery; + var MOD_NAME = 'theme', + $ = layui.jquery; - var theme = {}; - theme.autoHead = false; + var theme = {}; + theme.autoHead = false; - theme.changeTheme = function (target, autoHead) { - this.autoHead = autoHead; - const color = localStorage.getItem("theme-color-color"); - const second = localStorage.getItem("theme-color-second"); - this.colorSet(color, second); - if (target.frames.length == 0) return; - for (var i = 0; i < target.frames.length; i++) { - try { - if(target.frames[i].layui == undefined) continue; - target.frames[i].layui.theme.changeTheme(target.frames[i], autoHead); - } - catch (error) { - console.log(error); - } - } - } + theme.changeTheme = function (target, autoHead) { + this.autoHead = autoHead; + var color = localStorage.getItem("theme-color-color"); + var second = localStorage.getItem("theme-color-second"); + this.colorSet(color, second); + if (target.frames.length == 0) return; + for (var i = 0; i < target.frames.length; i++) { + try { + if(target.frames[i].layui == undefined) continue; + target.frames[i].layui.theme.changeTheme(target.frames[i], autoHead); + } + catch (error) { + console.log(error); + } + } + } - theme.colorSet = function(color, second) { - - let style = ''; - style += '.light-theme .pear-nav-tree .layui-this a:hover,.light-theme .pear-nav-tree .layui-this,.light-theme .pear-nav-tree .layui-this a,.pear-nav-tree .layui-this a,.pear-nav-tree .layui-this{background-color: ' +color + '!important;}'; - style += '.pear-admin .layui-logo .title{color:' + color + '!important;}'; - style += '.pear-frame-title .dot,.pear-tab .layui-this .pear-tab-active{background-color: ' + color +'!important;}'; - style += '.bottom-nav li a:hover{background-color:' + color + '!important;}'; - style += '.pear-admin .layui-header .layui-nav .layui-nav-bar{background-color: ' + color + '!important;}' - style += '.ball-loader>span,.signal-loader>span {background-color: ' + color + '!important;}'; - style += '.layui-header .layui-nav-child .layui-this a{background-color:' + color +'!important;color:white!important;}'; - style += '#preloader{background-color:' + color + '!important;}'; - style += '.pearone-color .color-content li.layui-this:after, .pearone-color .color-content li:hover:after {border: ' +color + ' 3px solid!important;}'; - style += '.layui-nav .layui-nav-child dd.layui-this a, .layui-nav-child dd.layui-this{background-color:' + color + ';color:white;}'; - style += '.pear-social-entrance {background-color:' + color + '!important}'; - style += '.pear-admin .pe-collapse {background-color:' + color + '!important}'; - style += '.layui-fixbar li {background-color:' + color + '!important}'; - style += '.pear-btn-primary {background-color:' + color + '!important}'; - style += '.layui-input:focus,.layui-textarea:focus {border-color: ' + color + '!important;box-shadow: 0 0 0 3px ' + second + ' !important;}' - style += '.layui-form-checkbox[lay-skin=primary]:hover span {background-color: initial;}' - style += '.layui-form-checked[lay-skin=primary] i {border-color: ' + color + '!important;background-color: ' + color + ';}' - style += '.layui-form-checked,.layui-form-checked:hover {border-color: ' + color + '!important;}' - style += '.layui-form-checked span,.layui-form-checked:hover span {background-color: ' + color + ';}' - style += '.layui-form-checked i,.layui-form-checked:hover i {color: ' + color + ';}' - style += '.layui-form-onswitch { border-color: ' + color + '; background-color: ' + color + ';}' - style += '.layui-form-radio>i:hover, .layui-form-radioed>i {color: ' + color + ';}' - style += '.layui-laypage .layui-laypage-curr .layui-laypage-em{background-color:'+ color +'!important}' - style += '.layui-tab-brief>.layui-tab-more li.layui-this:after, .layui-tab-brief>.layui-tab-title .layui-this:after{border-bottom: 3px solid '+color+'!important}' - style += '.layui-tab-brief>.layui-tab-title .layui-this{color:'+color+'!important}' - style += '.layui-progress-bar{background-color:'+color+'}'; - style += '.layui-elem-quote{border-left: 5px solid '+ color +'}'; - style += '.layui-timeline-axis{color:' + color + '}'; - style += '.layui-laydate .layui-this{background-color:'+color+'!important}'; - style += '.pear-this,.pear-text{color:' + color + '!important}'; - style += '.pear-back{background-color:'+ color +'!important}'; - style += '.pear-collapsed-pe{background-color:'+color+'!important}' - style += '.layui-form-select dl dd.layui-this{color:'+color+'!important;}' - style += '.tag-item-normal{background:'+color+'!important}'; - style += '.step-item-head.step-item-head-active{background-color:'+color+'}' - style += '.step-item-head{border: 3px solid '+color+';}' - style += '.step-item-tail i{background-color:'+color+'}' - style += '.step-item-head{color:' + color + '}' - style += 'div[xm-select-skin=normal] .xm-select-title div.xm-select-label>span i {background-color:'+color+'!important}' - style += 'div[xm-select-skin=normal] .xm-select-title div.xm-select-label>span{border: 1px solid '+color+'!important;background-color:'+color+'!important}' - style += 'div[xm-select-skin=normal] dl dd:not(.xm-dis-disabled) i{border-color:'+color+'!important}' - style += 'div[xm-select-skin=normal] dl dd.xm-select-this:not(.xm-dis-disabled) i{color:'+color+'!important}' - style += 'div[xm-select-skin=normal].xm-form-selected .xm-select, div[xm-select-skin=normal].xm-form-selected .xm-select:hover{border-color:'+color+'!important}' - style += '.layui-layer-btn a:first-child{border-color:'+color+';background-color:'+color+'!important}'; - style += '.layui-form-checkbox[lay-skin=primary]:hover i{border-color:'+color+'!important}' - style += '.pear-tab-menu .item:hover{background-color:'+color+'!important}' - style += '.layui-form-danger:focus {border-color:#FF5722 !important}' - style += '.pear-admin .user .layui-this a:hover{color:white!important}' - style += '.pear-admin .user a:hover{color:'+color+'!important}' - style += '.pear-notice .layui-this{color:'+color+'!important}' + theme.colorSet = function(color, second) { + + var style = ''; + style += '.light-theme .pear-nav-tree .layui-this a:hover,.light-theme .pear-nav-tree .layui-this,.light-theme .pear-nav-tree .layui-this a,.pear-nav-tree .layui-this a,.pear-nav-tree .layui-this{background-color: ' +color + '!important;}'; + style += '.pear-admin .layui-logo .title{color:' + color + '!important;}'; + style += '.pear-frame-title .dot,.pear-tab .layui-this .pear-tab-active{background-color: ' + color +'!important;}'; + style += '.bottom-nav li a:hover{background-color:' + color + '!important;}'; + style += '.pear-btn-primary {border: 1px solid ' + color + '!important;}'; + style += '.pear-admin .layui-header .layui-nav .layui-nav-bar{background-color: ' + color + '!important;}' + style += '.ball-loader>span,.signal-loader>span {background-color: ' + color + '!important;}'; + style += '.layui-header .layui-nav-child .layui-this a{background-color:' + color +'!important;color:white!important;}'; + style += '#preloader{background-color:' + color + '!important;}'; + style += '.pearone-color .color-content li.layui-this:after, .pearone-color .color-content li:hover:after {border: ' +color + ' 3px solid!important;}'; + style += '.layui-nav .layui-nav-child dd.layui-this a, .layui-nav-child dd.layui-this{background-color:' + color + ';color:white;}'; + style += '.pear-social-entrance {background-color:' + color + '!important}'; + style += '.pear-admin .pe-collapse {background-color:' + color + '!important}'; + style += '.layui-fixbar li {background-color:' + color + '!important}'; + style += '.pear-btn-primary {background-color:' + color + '!important}'; + style += '.layui-input:focus,.layui-textarea:focus {border-color: ' + color + '!important;box-shadow: 0 0 0 3px ' + second + ' !important;}' + style += '.layui-form-checkbox[lay-skin=primary]:hover span {background-color: initial;}' + style += '.layui-form-checked[lay-skin=primary] i {border-color: ' + color + '!important;background-color: ' + color + ';}' + style += '.layui-form-checked,.layui-form-checked:hover {border-color: ' + color + '!important;}' + style += '.layui-form-checked span,.layui-form-checked:hover span {background-color: ' + color + ';}' + style += '.layui-form-checked i,.layui-form-checked:hover i {color: ' + color + ';}' + style += '.layui-form-onswitch { border-color: ' + color + '; background-color: ' + color + ';}' + style += '.layui-form-radio>i:hover, .layui-form-radioed>i {color: ' + color + ';}' + style += '.layui-laypage .layui-laypage-curr .layui-laypage-em{background-color:'+ color +'!important}' + style += '.layui-tab-brief>.layui-tab-more li.layui-this:after, .layui-tab-brief>.layui-tab-title .layui-this:after{border-bottom: 3px solid '+color+'!important}' + style += '.layui-tab-brief>.layui-tab-title .layui-this{color:'+color+'!important}' + style += '.layui-progress-bar{background-color:'+color+'}'; + style += '.layui-elem-quote{border-left: 5px solid '+ color +'}'; + style += '.layui-timeline-axis{color:' + color + '}'; + style += '.layui-laydate .layui-this{background-color:'+color+'!important}'; + style += '.pear-this,.pear-text{color:' + color + '!important}'; + style += '.pear-back{background-color:'+ color +'!important}'; + style += '.pear-collapsed-pe{background-color:'+color+'!important}' + style += '.layui-form-select dl dd.layui-this{color:'+color+'!important;}' + style += '.tag-item-normal{background:'+color+'!important}'; + style += '.step-item-head.step-item-head-active{background-color:'+color+'}' + style += '.step-item-head{border: 3px solid '+color+';}' + style += '.step-item-tail i{background-color:'+color+'}' + style += '.step-item-head{color:' + color + '}' + style += 'div[xm-select-skin=normal] .xm-select-title div.xm-select-label>span i {background-color:'+color+'!important}' + style += 'div[xm-select-skin=normal] .xm-select-title div.xm-select-label>span{border: 1px solid '+color+'!important;background-color:'+color+'!important}' + style += 'div[xm-select-skin=normal] dl dd:not(.xm-dis-disabled) i{border-color:'+color+'!important}' + style += 'div[xm-select-skin=normal] dl dd.xm-select-this:not(.xm-dis-disabled) i{color:'+color+'!important}' + style += 'div[xm-select-skin=normal].xm-form-selected .xm-select, div[xm-select-skin=normal].xm-form-selected .xm-select:hover{border-color:'+color+'!important}' + style += '.layui-layer-btn a:first-child{border-color:'+color+';background-color:'+color+'!important}'; + style += '.layui-form-checkbox[lay-skin=primary]:hover i{border-color:'+color+'!important}' + style += '.pear-tab-menu .item:hover{background-color:'+color+'!important}' + style += '.layui-form-danger:focus {border-color:#FF5722 !important}' + style += '.pear-admin .user .layui-this a:hover{color:white!important}' + style += '.pear-admin .user a:hover{color:'+color+'!important}' + style += '.pear-notice .layui-this{color:'+color+'!important}' style += '.layui-form-radio:hover *, .layui-form-radioed, .layui-form-radioed>i{color:' + color + ' !important}'; - style += '.pear-btn:hover {color: '+color+';background-color: ' + second + ';}' - style += '.pear-btn-primary[plain] {color: '+ color +' !important;background: ' + second + ' !important;}' - style += '.pear-btn-primary[plain]:hover {background-color: ' + color + '!important}' - style += '.light-theme .pear-nav-tree .layui-this a:hover,.light-theme .pear-nav-tree .layui-this,.light-theme .pear-nav-tree .layui-this a {background-color:'+second+'!important;color:'+color+'!important;}' - style += '.light-theme .pear-nav-tree .layui-this{ border-right: 3px solid '+color+'!important}' - style += '.loader:after {background:'+color+'}' - if(this.autoHead === true || this.autoHead === "true"){ - style += '.pear-admin.banner-layout .layui-header .layui-logo,.pear-admin .layui-header{border:none;background-color:' + color + '!important;}.pear-admin.banner-layout .layui-header .layui-logo .title,.pear-admin .layui-header .layui-nav .layui-nav-item>a{color:whitesmoke!important;}'; - style += '.pear-admin.banner-layout .layui-header{ box-shadow: 2px 0 6px rgb(0 21 41 / 35%) }' - style += '.pear-admin .layui-header .layui-layout-control .layui-this *,.pear-admin.banner-layout .layui-header .layui-layout-control .layui-this *{ background-color: rgba(0,0,0,.1)!important;}' - } - style += '.menu-search-list li:hover,.menu-search-list li.this{background-color:'+ color +'}' - var colorPane = $("#pear-admin-color"); - if(colorPane.length>0){ - colorPane.html(style); - }else{ - $("head").append("") - } - } + style += '.pear-btn:hover {color: '+color+';background-color: ' + second + ';}' + style += '.pear-btn-primary[plain] {color: '+ color +' !important;background: ' + second + ' !important;}' + style += '.pear-btn-primary[plain]:hover {background-color: ' + color + '!important}' + style += '.light-theme .pear-nav-tree .layui-this a:hover,.light-theme .pear-nav-tree .layui-this,.light-theme .pear-nav-tree .layui-this a {background-color:'+second+'!important;color:'+color+'!important;}' + style += '.light-theme .pear-nav-tree .layui-this{ border-right: 3px solid '+color+'!important}' + style += '.loader:after {background:'+color+'}' + style += '.layui-laydate .layui-this, .layui-laydate .layui-this>div{background:'+color+'!important}' + if(this.autoHead === true || this.autoHead === "true"){ + style += '.pear-admin.banner-layout .layui-header .layui-logo,.pear-admin .layui-header{border:none;background-color:' + color + '!important;}.pear-admin.banner-layout .layui-header .layui-logo .title,.pear-admin .layui-header .layui-nav .layui-nav-item>a{color:whitesmoke!important;}'; + style += '.pear-admin.banner-layout .layui-header{ box-shadow: 2px 0 6px rgb(0 21 41 / 35%) }' + style += '.pear-admin .layui-header .layui-layout-control .layui-this *,.pear-admin.banner-layout .layui-header .layui-layout-control .layui-this *{ background-color: rgba(0,0,0,.1)!important;}' + } + style += '.menu-search-list li:hover,.menu-search-list li.this{background-color:'+ color +'}' + var colorPane = $("#pear-admin-color"); + if(colorPane.length>0){ + colorPane.html(style); + }else{ + $("head").append("") + } + } - exports(MOD_NAME, theme); + exports(MOD_NAME, theme); }); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce.js b/src/main/resources/static/component/pear/module/tinymce/tinymce.js index 02c4bac7..b6ef2203 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce.js @@ -1,4 +1,4 @@ -layui.define(['jquery'], function (exports) { +layui.define(['jquery'],function (exports) { var $ = layui.$ var modFile = layui.cache.modules['tinymce']; @@ -37,13 +37,13 @@ layui.define(['jquery'], function (exports) { var t = {}; //初始化 - t.render = function (options, callback) { + t.render = function (options,callback) { initTinymce(); - var option = initOptions(options, callback) + var option = initOptions(options,callback) - , edit = t.get(option.elem); + ,edit = t.get(option.elem); if (edit) { edit.destroy(); @@ -72,28 +72,28 @@ layui.define(['jquery'], function (exports) { //重载 t.reload = function (elem, option, callback) { - + var options = {} - if (typeof elem == 'string') { + if(typeof elem == 'string'){ option.elem = elem options = $.extend({}, option) - } else if (typeof elem == 'object' && typeof elem.elem == 'string') { + } else if (typeof elem == 'object' && typeof elem.elem == 'string'){ options = $.extend({}, elem) callback = option - } + } var optionCache = layui.sessionData('layui-tinymce')[options.elem] delete optionCache.init_instance_callback - $.extend(optionCache, options) + $.extend(optionCache,options) - return t.render(optionCache, callback) + return t.render(optionCache,callback) } - function initOptions(option, callback) { - + function initOptions(option,callback) { + var admin = layui.admin || {} var form = option.form || {} @@ -102,7 +102,7 @@ layui.define(['jquery'], function (exports) { var form_data = form.data || {} //其他表单数据 {key:value, ...} - option.suffix = isset(option.suffix) ? option.suffix : (plugin_filename.indexOf('.min') > -1 ? '.min' : '') + option.suffix= isset(option.suffix) ? option.suffix : (plugin_filename.indexOf('.min')>-1 ? '.min' : '') option.base_url = isset(option.base_url) ? option.base_url : settings.base_url @@ -112,9 +112,9 @@ layui.define(['jquery'], function (exports) { option.quickbars_selection_toolbar = isset(option.quickbars_selection_toolbar) ? option.quickbars_selection_toolbar : 'cut copy | bold italic underline strikethrough ' - option.plugins = isset(option.plugins) ? option.plugins : 'code quickbars print preview searchreplace autolink fullscreen image link media codesample table charmap hr advlist lists wordcount imagetools indent2em'; + option.plugins = isset(option.plugins) ? option.plugins : 'code kityformula-editor quickbars print preview searchreplace autolink fullscreen image link media codesample table charmap hr advlist lists wordcount imagetools indent2em'; - option.toolbar = isset(option.toolbar) ? option.toolbar : 'code undo redo | forecolor backcolor bold italic underline strikethrough | indent2em alignleft aligncenter alignright alignjustify outdent indent | link bullist numlist image table codesample | formatselect fontselect fontsizeselect'; + option.toolbar = isset(option.toolbar) ? option.toolbar : 'code undo redo | kityformula-editor forecolor backcolor bold italic underline strikethrough | indent2em alignleft aligncenter alignright alignjustify outdent indent | link bullist numlist image table codesample | formatselect fontselect fontsizeselect'; option.resize = isset(option.resize) ? option.resize : false; @@ -136,21 +136,21 @@ layui.define(['jquery'], function (exports) { table: {title: '表格', items: 'inserttable tableprops deletetable | cell row column'}, }; - option.init_instance_callback = isset(option.init_instance_callback) ? option.init_instance_callback : function (inst) { - if (typeof callback == 'function') callback(option, inst) + option.init_instance_callback =isset(option.init_instance_callback) ? option.init_instance_callback : function(inst) { + if(typeof callback == 'function') callback(option,inst) }; option.images_upload_url = isset(option.images_upload_url) ? option.images_upload_url : settings.images_upload_url; - option.images_upload_handler = isset(option.images_upload_handler) ? option.images_upload_handler : function (blobInfo, succFun, failFun) { - if (isEmpty(option.images_upload_url)) { + option.images_upload_handler = isset(option.images_upload_handler) ? option.images_upload_handler : function(blobInfo, succFun, failFun) { + if(isEmpty(option.images_upload_url)){ failFun("上传接口未配置"); return console.error('images_upload_url未配置'); } var formData = new FormData(); formData.append(file_field, blobInfo.blob()); - if (typeof form_data == 'object') { - for (var key in form_data) { + if(typeof form_data == 'object'){ + for(var key in form_data){ formData.append(key, form_data[key]); } } @@ -175,9 +175,9 @@ layui.define(['jquery'], function (exports) { } } - layui.sessionData('layui-tinymce', { - key: option.selector, - value: option + layui.sessionData('layui-tinymce',{ + key:option.selector, + value:option }) return option } @@ -198,11 +198,11 @@ layui.define(['jquery'], function (exports) { } function isEmpty(value) { - if (typeof value === 'undefined' || value === null || value === '') { + if(typeof value === 'undefined' || value === null|| value === ''){ return true - } else if (value instanceof Array && value.length === 0) { + } else if (value instanceof Array && value.length === 0){ return true - } else if (typeof value === 'object' && Object.keys(value).length === 0) { + } else if (typeof value === 'object' && Object.keys(value).length === 0){ return true } return false diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/icons/default/icons.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/icons/default/icons.js new file mode 100644 index 00000000..d31c9072 --- /dev/null +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/icons/default/icons.js @@ -0,0 +1,172 @@ +tinymce.IconManager.add('default', { + icons: { + 'accessibility-check': '', + 'action-next': '', + 'action-prev': '', + 'align-center': '', + 'align-justify': '', + 'align-left': '', + 'align-none': '', + 'align-right': '', + 'arrow-left': '', + 'arrow-right': '', + 'bold': '', + 'bookmark': '', + 'border-width': '', + 'brightness': '', + 'browse': '', + 'cancel': '', + 'change-case': '', + 'character-count': '', + 'checklist-rtl': '', + 'checklist': '', + 'checkmark': '', + 'chevron-down': '', + 'chevron-left': '', + 'chevron-right': '', + 'chevron-up': '', + 'close': '', + 'code-sample': '', + 'color-levels': '', + 'color-picker': '', + 'color-swatch-remove-color': '', + 'color-swatch': '', + 'comment-add': '', + 'comment': '', + 'contrast': '', + 'copy': '', + 'crop': '', + 'cut-column': '', + 'cut-row': '', + 'cut': '', + 'document-properties': '', + 'drag': '', + 'duplicate-column': '', + 'duplicate-row': '', + 'duplicate': '', + 'edit-block': '', + 'edit-image': '', + 'embed-page': '', + 'embed': '', + 'emoji': '', + 'export': '', + 'fill': '', + 'flip-horizontally': '', + 'flip-vertically': '', + 'format-painter': '', + 'format': '', + 'fullscreen': '', + 'gallery': '', + 'gamma': '', + 'help': '', + 'highlight-bg-color': '', + 'home': '', + 'horizontal-rule': '', + 'image-options': '', + 'image': '', + 'indent': '', + 'info': '', + 'insert-character': '', + 'insert-time': '', + 'invert': '', + 'italic': '', + 'line-height': '', + 'line': '', + 'link': '', + 'list-bull-circle': '', + 'list-bull-default': '', + 'list-bull-square': '', + 'list-num-default-rtl': '', + 'list-num-default': '', + 'list-num-lower-alpha-rtl': '', + 'list-num-lower-alpha': '', + 'list-num-lower-greek-rtl': '', + 'list-num-lower-greek': '', + 'list-num-lower-roman-rtl': '', + 'list-num-lower-roman': '', + 'list-num-upper-alpha-rtl': '', + 'list-num-upper-alpha': '', + 'list-num-upper-roman-rtl': '', + 'list-num-upper-roman': '', + 'lock': '', + 'ltr': '', + 'more-drawer': '', + 'new-document': '', + 'new-tab': '', + 'non-breaking': '', + 'notice': '', + 'ordered-list-rtl': '', + 'ordered-list': '', + 'orientation': '', + 'outdent': '', + 'page-break': '', + 'paragraph': '', + 'paste-column-after': '', + 'paste-column-before': '', + 'paste-row-after': '', + 'paste-row-before': '', + 'paste-text': '', + 'paste': '', + 'permanent-pen': '', + 'plus': '', + 'preferences': '', + 'preview': '', + 'print': '', + 'quote': '', + 'redo': '', + 'reload': '', + 'remove-formatting': '', + 'remove': '', + 'resize-handle': '', + 'resize': '', + 'restore-draft': '', + 'rotate-left': '', + 'rotate-right': '', + 'rtl': '', + 'save': '', + 'search': '', + 'select-all': '', + 'selected': '', + 'settings': '', + 'sharpen': '', + 'sourcecode': '', + 'spell-check': '', + 'strike-through': '', + 'subscript': '', + 'superscript': '', + 'table-cell-properties': '', + 'table-cell-select-all': '', + 'table-cell-select-inner': '', + 'table-delete-column': '', + 'table-delete-row': '', + 'table-delete-table': '', + 'table-insert-column-after': '', + 'table-insert-column-before': '', + 'table-insert-row-above': '', + 'table-insert-row-after': '', + 'table-left-header': '', + 'table-merge-cells': '', + 'table-row-properties': '', + 'table-split-cells': '', + 'table-top-header': '', + 'table': '', + 'template': '', + 'temporary-placeholder': '', + 'text-color': '', + 'toc': '', + 'translate': '', + 'underline': '', + 'undo': '', + 'unlink': '', + 'unlock': '', + 'unordered-list': '', + 'unselected': '', + 'upload': '', + 'user': '', + 'visualblocks': '', + 'visualchars': '', + 'warning': '', + 'zoom-in': '', + 'zoom-out': '', + } +}); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/icons/default/icons.min.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/icons/default/icons.min.js new file mode 100644 index 00000000..086f297d --- /dev/null +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/icons/default/icons.min.js @@ -0,0 +1 @@ +tinymce.IconManager.add("default",{icons:{"accessibility-check":'',"action-next":'',"action-prev":'',"align-center":'',"align-justify":'',"align-left":'',"align-none":'',"align-right":'',"arrow-left":'',"arrow-right":'',bold:'',bookmark:'',"border-width":'',brightness:'',browse:'',cancel:'',"change-case":'',"character-count":'',"checklist-rtl":'',checklist:'',checkmark:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',close:'',"code-sample":'',"color-levels":'',"color-picker":'',"color-swatch-remove-color":'',"color-swatch":'',"comment-add":'',comment:'',contrast:'',copy:'',crop:'',"cut-column":'',"cut-row":'',cut:'',"document-properties":'',drag:'',"duplicate-column":'',"duplicate-row":'',duplicate:'',"edit-block":'',"edit-image":'',"embed-page":'',embed:'',emoji:'',"export":'',fill:'',"flip-horizontally":'',"flip-vertically":'',"format-painter":'',format:'',fullscreen:'',gallery:'',gamma:'',help:'',"highlight-bg-color":'',home:'',"horizontal-rule":'',"image-options":'',image:'',indent:'',info:'',"insert-character":'',"insert-time":'',invert:'',italic:'',"line-height":'',line:'',link:'',"list-bull-circle":'',"list-bull-default":'',"list-bull-square":'',"list-num-default-rtl":'',"list-num-default":'',"list-num-lower-alpha-rtl":'',"list-num-lower-alpha":'',"list-num-lower-greek-rtl":'',"list-num-lower-greek":'',"list-num-lower-roman-rtl":'',"list-num-lower-roman":'',"list-num-upper-alpha-rtl":'',"list-num-upper-alpha":'',"list-num-upper-roman-rtl":'',"list-num-upper-roman":'',lock:'',ltr:'',"more-drawer":'',"new-document":'',"new-tab":'',"non-breaking":'',notice:'',"ordered-list-rtl":'',"ordered-list":'',orientation:'',outdent:'',"page-break":'',paragraph:'',"paste-column-after":'',"paste-column-before":'',"paste-row-after":'',"paste-row-before":'',"paste-text":'',paste:'',"permanent-pen":'',plus:'',preferences:'',preview:'',print:'',quote:'',redo:'',reload:'',"remove-formatting":'',remove:'',"resize-handle":'',resize:'',"restore-draft":'',"rotate-left":'',"rotate-right":'',rtl:'',save:'',search:'',"select-all":'',selected:'',settings:'',sharpen:'',sourcecode:'',"spell-check":'',"strike-through":'',subscript:'',superscript:'',"table-cell-properties":'',"table-cell-select-all":'',"table-cell-select-inner":'',"table-delete-column":'',"table-delete-row":'',"table-delete-table":'',"table-insert-column-after":'',"table-insert-column-before":'',"table-insert-row-above":'',"table-insert-row-after":'',"table-left-header":'',"table-merge-cells":'',"table-row-properties":'',"table-split-cells":'',"table-top-header":'',table:'',template:'',"temporary-placeholder":'',"text-color":'',toc:'',translate:'',underline:'',undo:'',unlink:'',unlock:'',"unordered-list":'',unselected:'',upload:'',user:'',visualblocks:'',visualchars:'',warning:'',"zoom-in":'',"zoom-out":''}}); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/langs/zh_CN.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/langs/zh_CN.js index 71217b4c..89b106c2 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/langs/zh_CN.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/langs/zh_CN.js @@ -1,419 +1,419 @@ -tinymce.addI18n('zh_CN', { - "Redo": "\u91cd\u505a", - "Undo": "\u64a4\u9500", - "Cut": "\u526a\u5207", - "Copy": "\u590d\u5236", - "Paste": "\u7c98\u8d34", - "Select all": "\u5168\u9009", - "New document": "\u65b0\u6587\u4ef6", - "Ok": "\u786e\u5b9a", - "Cancel": "\u53d6\u6d88", - "Visual aids": "\u7f51\u683c\u7ebf", - "Bold": "\u7c97\u4f53", - "Italic": "\u659c\u4f53", - "Underline": "\u4e0b\u5212\u7ebf", - "Strikethrough": "\u5220\u9664\u7ebf", - "Superscript": "\u4e0a\u6807", - "Subscript": "\u4e0b\u6807", - "Clear formatting": "\u6e05\u9664\u683c\u5f0f", - "Align left": "\u5de6\u8fb9\u5bf9\u9f50", - "Align center": "\u4e2d\u95f4\u5bf9\u9f50", - "Align right": "\u53f3\u8fb9\u5bf9\u9f50", - "Justify": "\u4e24\u7aef\u5bf9\u9f50", - "Bullet list": "\u9879\u76ee\u7b26\u53f7", - "Numbered list": "\u7f16\u53f7\u5217\u8868", - "Decrease indent": "\u51cf\u5c11\u7f29\u8fdb", - "Increase indent": "\u589e\u52a0\u7f29\u8fdb", - "Close": "\u5173\u95ed", - "Formats": "\u683c\u5f0f", - "Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "\u4f60\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u6253\u5f00\u526a\u8d34\u677f\uff0c\u8bf7\u4f7f\u7528Ctrl+X\/C\/V\u7b49\u5feb\u6377\u952e\u3002", - "Headers": "\u6807\u9898", - "Header 1": "\u6807\u98981", - "Header 2": "\u6807\u98982", - "Header 3": "\u6807\u98983", - "Header 4": "\u6807\u98984", - "Header 5": "\u6807\u98985", - "Header 6": "\u6807\u98986", - "Headings": "\u6807\u9898", - "Heading 1": "\u6807\u98981", - "Heading 2": "\u6807\u98982", - "Heading 3": "\u6807\u98983", - "Heading 4": "\u6807\u98984", - "Heading 5": "\u6807\u98985", - "Heading 6": "\u6807\u98986", - "Preformatted": "\u9884\u5148\u683c\u5f0f\u5316\u7684", - "Div": "Div", - "Pre": "Pre", - "Code": "\u4ee3\u7801", - "Paragraph": "\u6bb5\u843d", - "Blockquote": "\u5f15\u6587\u533a\u5757", - "Inline": "\u6587\u672c", - "Blocks": "\u57fa\u5757", - "Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "\u5f53\u524d\u4e3a\u7eaf\u6587\u672c\u7c98\u8d34\u6a21\u5f0f\uff0c\u518d\u6b21\u70b9\u51fb\u53ef\u4ee5\u56de\u5230\u666e\u901a\u7c98\u8d34\u6a21\u5f0f\u3002", - "Fonts": "\u5b57\u4f53", - "Font Sizes": "\u5b57\u53f7", - "Class": "\u7c7b\u578b", - "Browse for an image": "\u6d4f\u89c8\u56fe\u50cf", - "OR": "\u6216", - "Drop an image here": "\u62d6\u653e\u4e00\u5f20\u56fe\u50cf\u81f3\u6b64", - "Upload": "\u4e0a\u4f20", - "Block": "\u5757", - "Align": "\u5bf9\u9f50", - "Default": "\u9ed8\u8ba4", - "Circle": "\u7a7a\u5fc3\u5706", - "Disc": "\u5b9e\u5fc3\u5706", - "Square": "\u65b9\u5757", - "Lower Alpha": "\u5c0f\u5199\u82f1\u6587\u5b57\u6bcd", - "Lower Greek": "\u5c0f\u5199\u5e0c\u814a\u5b57\u6bcd", - "Lower Roman": "\u5c0f\u5199\u7f57\u9a6c\u5b57\u6bcd", - "Upper Alpha": "\u5927\u5199\u82f1\u6587\u5b57\u6bcd", - "Upper Roman": "\u5927\u5199\u7f57\u9a6c\u5b57\u6bcd", - "Anchor...": "\u951a\u70b9...", - "Name": "\u540d\u79f0", - "Id": "\u6807\u8bc6\u7b26", - "Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.": "\u6807\u8bc6\u7b26\u5e94\u8be5\u4ee5\u5b57\u6bcd\u5f00\u5934\uff0c\u540e\u8ddf\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u7834\u6298\u53f7\u3001\u70b9\u3001\u5192\u53f7\u6216\u4e0b\u5212\u7ebf\u3002", - "You have unsaved changes are you sure you want to navigate away?": "\u4f60\u8fd8\u6709\u6587\u6863\u5c1a\u672a\u4fdd\u5b58\uff0c\u786e\u5b9a\u8981\u79bb\u5f00\uff1f", - "Restore last draft": "\u6062\u590d\u4e0a\u6b21\u7684\u8349\u7a3f", - "Special character...": "\u7279\u6b8a\u5b57\u7b26...", - "Source code": "\u6e90\u4ee3\u7801", - "Insert\/Edit code sample": "\u63d2\u5165\/\u7f16\u8f91\u4ee3\u7801\u793a\u4f8b", - "Language": "\u8bed\u8a00", - "Code sample...": "\u793a\u4f8b\u4ee3\u7801...", - "Color Picker": "\u9009\u8272\u5668", - "R": "R", - "G": "G", - "B": "B", - "Left to right": "\u4ece\u5de6\u5230\u53f3", - "Right to left": "\u4ece\u53f3\u5230\u5de6", - "Emoticons...": "\u8868\u60c5\u7b26\u53f7...", - "Metadata and Document Properties": "\u5143\u6570\u636e\u548c\u6587\u6863\u5c5e\u6027", - "Title": "\u6807\u9898", - "Keywords": "\u5173\u952e\u8bcd", - "Description": "\u63cf\u8ff0", - "Robots": "\u673a\u5668\u4eba", - "Author": "\u4f5c\u8005", - "Encoding": "\u7f16\u7801", - "Fullscreen": "\u5168\u5c4f", - "Action": "\u64cd\u4f5c", - "Shortcut": "\u5feb\u6377\u952e", - "Help": "\u5e2e\u52a9", - "Address": "\u5730\u5740", - "Focus to menubar": "\u79fb\u52a8\u7126\u70b9\u5230\u83dc\u5355\u680f", - "Focus to toolbar": "\u79fb\u52a8\u7126\u70b9\u5230\u5de5\u5177\u680f", - "Focus to element path": "\u79fb\u52a8\u7126\u70b9\u5230\u5143\u7d20\u8def\u5f84", - "Focus to contextual toolbar": "\u79fb\u52a8\u7126\u70b9\u5230\u4e0a\u4e0b\u6587\u83dc\u5355", - "Insert link (if link plugin activated)": "\u63d2\u5165\u94fe\u63a5 (\u5982\u679c\u94fe\u63a5\u63d2\u4ef6\u5df2\u6fc0\u6d3b)", - "Save (if save plugin activated)": "\u4fdd\u5b58(\u5982\u679c\u4fdd\u5b58\u63d2\u4ef6\u5df2\u6fc0\u6d3b)", - "Find (if searchreplace plugin activated)": "\u67e5\u627e(\u5982\u679c\u67e5\u627e\u66ff\u6362\u63d2\u4ef6\u5df2\u6fc0\u6d3b)", - "Plugins installed ({0}):": "\u5df2\u5b89\u88c5\u63d2\u4ef6 ({0}):", - "Premium plugins:": "\u4f18\u79c0\u63d2\u4ef6\uff1a", - "Learn more...": "\u4e86\u89e3\u66f4\u591a...", - "You are using {0}": "\u4f60\u6b63\u5728\u4f7f\u7528 {0}", - "Plugins": "\u63d2\u4ef6", - "Handy Shortcuts": "\u5feb\u6377\u952e", - "Horizontal line": "\u6c34\u5e73\u5206\u5272\u7ebf", - "Insert\/edit image": "\u63d2\u5165\/\u7f16\u8f91\u56fe\u7247", - "Image description": "\u56fe\u7247\u63cf\u8ff0", - "Source": "\u5730\u5740", - "Dimensions": "\u5927\u5c0f", - "Constrain proportions": "\u4fdd\u6301\u7eb5\u6a2a\u6bd4", - "General": "\u666e\u901a", - "Advanced": "\u9ad8\u7ea7", - "Style": "\u6837\u5f0f", - "Vertical space": "\u5782\u76f4\u8fb9\u8ddd", - "Horizontal space": "\u6c34\u5e73\u8fb9\u8ddd", - "Border": "\u8fb9\u6846", - "Insert image": "\u63d2\u5165\u56fe\u7247", - "Image...": "\u56fe\u7247...", - "Image list": "\u56fe\u7247\u5217\u8868", - "Rotate counterclockwise": "\u9006\u65f6\u9488\u65cb\u8f6c", - "Rotate clockwise": "\u987a\u65f6\u9488\u65cb\u8f6c", - "Flip vertically": "\u5782\u76f4\u7ffb\u8f6c", - "Flip horizontally": "\u6c34\u5e73\u7ffb\u8f6c", - "Edit image": "\u7f16\u8f91\u56fe\u7247", - "Image options": "\u56fe\u7247\u9009\u9879", - "Zoom in": "\u653e\u5927", - "Zoom out": "\u7f29\u5c0f", - "Crop": "\u88c1\u526a", - "Resize": "\u8c03\u6574\u5927\u5c0f", - "Orientation": "\u65b9\u5411", - "Brightness": "\u4eae\u5ea6", - "Sharpen": "\u9510\u5316", - "Contrast": "\u5bf9\u6bd4\u5ea6", - "Color levels": "\u989c\u8272\u5c42\u6b21", - "Gamma": "\u4f3d\u9a6c\u503c", - "Invert": "\u53cd\u8f6c", - "Apply": "\u5e94\u7528", - "Back": "\u540e\u9000", - "Insert date\/time": "\u63d2\u5165\u65e5\u671f\/\u65f6\u95f4", - "Date\/time": "\u65e5\u671f\/\u65f6\u95f4", - "Insert\/Edit Link": "\u63d2\u5165\/\u7f16\u8f91\u94fe\u63a5", - "Insert\/edit link": "\u63d2\u5165\/\u7f16\u8f91\u94fe\u63a5", - "Text to display": "\u663e\u793a\u6587\u5b57", - "Url": "\u5730\u5740", - "Open link in...": "\u94fe\u63a5\u6253\u5f00\u4f4d\u7f6e...", - "Current window": "\u5f53\u524d\u7a97\u53e3", - "None": "\u65e0", - "New window": "\u5728\u65b0\u7a97\u53e3\u6253\u5f00", - "Remove link": "\u5220\u9664\u94fe\u63a5", - "Anchors": "\u951a\u70b9", - "Link...": "\u94fe\u63a5...", - "Paste or type a link": "\u7c98\u8d34\u6216\u8f93\u5165\u94fe\u63a5", - "The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "\u4f60\u6240\u586b\u5199\u7684URL\u5730\u5740\u4e3a\u90ae\u4ef6\u5730\u5740\uff0c\u9700\u8981\u52a0\u4e0amailto:\u524d\u7f00\u5417\uff1f", - "The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "\u4f60\u6240\u586b\u5199\u7684URL\u5730\u5740\u5c5e\u4e8e\u5916\u90e8\u94fe\u63a5\uff0c\u9700\u8981\u52a0\u4e0ahttp:\/\/:\u524d\u7f00\u5417\uff1f", - "Link list": "\u94fe\u63a5\u5217\u8868", - "Insert video": "\u63d2\u5165\u89c6\u9891", - "Insert\/edit video": "\u63d2\u5165\/\u7f16\u8f91\u89c6\u9891", - "Insert\/edit media": "\u63d2\u5165\/\u7f16\u8f91\u5a92\u4f53", - "Alternative source": "\u955c\u50cf", - "Alternative source URL": "\u66ff\u4ee3\u6765\u6e90\u7f51\u5740", - "Media poster (Image URL)": "\u5c01\u9762(\u56fe\u7247\u5730\u5740)", - "Paste your embed code below:": "\u5c06\u5185\u5d4c\u4ee3\u7801\u7c98\u8d34\u5728\u4e0b\u9762:", - "Embed": "\u5185\u5d4c", - "Media...": "\u591a\u5a92\u4f53...", - "Nonbreaking space": "\u4e0d\u95f4\u65ad\u7a7a\u683c", - "Page break": "\u5206\u9875\u7b26", - "Paste as text": "\u7c98\u8d34\u4e3a\u6587\u672c", - "Preview": "\u9884\u89c8", - "Print...": "\u6253\u5370...", - "Save": "\u4fdd\u5b58", - "Find": "\u67e5\u627e", - "Replace with": "\u66ff\u6362\u4e3a", - "Replace": "\u66ff\u6362", - "Replace all": "\u5168\u90e8\u66ff\u6362", - "Previous": "\u4e0a\u4e00\u4e2a", - "Next": "\u4e0b\u4e00\u4e2a", - "Find and replace...": "\u67e5\u627e\u5e76\u66ff\u6362...", - "Could not find the specified string.": "\u672a\u627e\u5230\u641c\u7d22\u5185\u5bb9.", - "Match case": "\u533a\u5206\u5927\u5c0f\u5199", - "Find whole words only": "\u5168\u5b57\u5339\u914d", - "Spell check": "\u62fc\u5199\u68c0\u67e5", - "Ignore": "\u5ffd\u7565", - "Ignore all": "\u5168\u90e8\u5ffd\u7565", - "Finish": "\u5b8c\u6210", - "Add to Dictionary": "\u6dfb\u52a0\u5230\u5b57\u5178", - "Insert table": "\u63d2\u5165\u8868\u683c", - "Table properties": "\u8868\u683c\u5c5e\u6027", - "Delete table": "\u5220\u9664\u8868\u683c", - "Cell": "\u5355\u5143\u683c", - "Row": "\u884c", - "Column": "\u5217", - "Cell properties": "\u5355\u5143\u683c\u5c5e\u6027", - "Merge cells": "\u5408\u5e76\u5355\u5143\u683c", - "Split cell": "\u62c6\u5206\u5355\u5143\u683c", - "Insert row before": "\u5728\u4e0a\u65b9\u63d2\u5165", - "Insert row after": "\u5728\u4e0b\u65b9\u63d2\u5165", - "Delete row": "\u5220\u9664\u884c", - "Row properties": "\u884c\u5c5e\u6027", - "Cut row": "\u526a\u5207\u884c", - "Copy row": "\u590d\u5236\u884c", - "Paste row before": "\u7c98\u8d34\u5230\u4e0a\u65b9", - "Paste row after": "\u7c98\u8d34\u5230\u4e0b\u65b9", - "Insert column before": "\u5728\u5de6\u4fa7\u63d2\u5165", - "Insert column after": "\u5728\u53f3\u4fa7\u63d2\u5165", - "Delete column": "\u5220\u9664\u5217", - "Cols": "\u5217", - "Rows": "\u884c", - "Width": "\u5bbd", - "Height": "\u9ad8", - "Cell spacing": "\u5355\u5143\u683c\u5916\u95f4\u8ddd", - "Cell padding": "\u5355\u5143\u683c\u5185\u8fb9\u8ddd", - "Show caption": "\u663e\u793a\u6807\u9898", - "Left": "\u5de6\u5bf9\u9f50", - "Center": "\u5c45\u4e2d", - "Right": "\u53f3\u5bf9\u9f50", - "Cell type": "\u5355\u5143\u683c\u7c7b\u578b", - "Scope": "\u8303\u56f4", - "Alignment": "\u5bf9\u9f50\u65b9\u5f0f", - "H Align": "\u6c34\u5e73\u5bf9\u9f50", - "V Align": "\u5782\u76f4\u5bf9\u9f50", - "Top": "\u9876\u90e8\u5bf9\u9f50", - "Middle": "\u5782\u76f4\u5c45\u4e2d", - "Bottom": "\u5e95\u90e8\u5bf9\u9f50", - "Header cell": "\u8868\u5934\u5355\u5143\u683c", - "Row group": "\u884c\u7ec4", - "Column group": "\u5217\u7ec4", - "Row type": "\u884c\u7c7b\u578b", - "Header": "\u8868\u5934", - "Body": "\u8868\u4f53", - "Footer": "\u8868\u5c3e", - "Border color": "\u8fb9\u6846\u989c\u8272", - "Insert template...": "\u63d2\u5165\u6a21\u677f...", - "Templates": "\u6a21\u677f", - "Template": "\u6a21\u677f", - "Text color": "\u6587\u5b57\u989c\u8272", - "Background color": "\u80cc\u666f\u8272", - "Custom...": "\u81ea\u5b9a\u4e49...", - "Custom color": "\u81ea\u5b9a\u4e49\u989c\u8272", - "No color": "\u65e0", - "Remove color": "\u79fb\u9664\u989c\u8272", - "Table of Contents": "\u5185\u5bb9\u5217\u8868", - "Show blocks": "\u663e\u793a\u533a\u5757\u8fb9\u6846", - "Show invisible characters": "\u663e\u793a\u4e0d\u53ef\u89c1\u5b57\u7b26", - "Word count": "\u5b57\u6570", - "Count": "\u8ba1\u6570", - "Document": "\u6587\u6863", - "Selection": "\u9009\u62e9", - "Words": "\u5355\u8bcd", - "Words: {0}": "\u5b57\u6570\uff1a{0}", - "{0} words": "{0} \u5b57", - "File": "\u6587\u4ef6", - "Edit": "\u7f16\u8f91", - "Insert": "\u63d2\u5165", - "View": "\u89c6\u56fe", - "Format": "\u683c\u5f0f", - "Table": "\u8868\u683c", - "Tools": "\u5de5\u5177", - "Powered by {0}": "\u7531{0}\u9a71\u52a8", - "Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "\u5728\u7f16\u8f91\u533a\u6309ALT-F9\u6253\u5f00\u83dc\u5355\uff0c\u6309ALT-F10\u6253\u5f00\u5de5\u5177\u680f\uff0c\u6309ALT-0\u67e5\u770b\u5e2e\u52a9", - "Image title": "\u56fe\u7247\u6807\u9898", - "Border width": "\u8fb9\u6846\u5bbd\u5ea6", - "Border style": "\u8fb9\u6846\u6837\u5f0f", - "Error": "\u9519\u8bef", - "Warn": "\u8b66\u544a", - "Valid": "\u6709\u6548", - "To open the popup, press Shift+Enter": "\u6309Shitf+Enter\u952e\u6253\u5f00\u5bf9\u8bdd\u6846", - "Rich Text Area. Press ALT-0 for help.": "\u7f16\u8f91\u533a\u3002\u6309Alt+0\u952e\u6253\u5f00\u5e2e\u52a9\u3002", - "System Font": "\u7cfb\u7edf\u5b57\u4f53", - "Failed to upload image: {0}": "\u56fe\u7247\u4e0a\u4f20\u5931\u8d25: {0}", - "Failed to load plugin: {0} from url {1}": "\u63d2\u4ef6\u52a0\u8f7d\u5931\u8d25: {0} \u6765\u81ea\u94fe\u63a5 {1}", - "Failed to load plugin url: {0}": "\u63d2\u4ef6\u52a0\u8f7d\u5931\u8d25 \u94fe\u63a5: {0}", - "Failed to initialize plugin: {0}": "\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25: {0}", - "example": "\u793a\u4f8b", - "Search": "\u641c\u7d22", - "All": "\u5168\u90e8", - "Currency": "\u8d27\u5e01", - "Text": "\u6587\u5b57", - "Quotations": "\u5f15\u7528", - "Mathematical": "\u6570\u5b66", - "Extended Latin": "\u62c9\u4e01\u8bed\u6269\u5145", - "Symbols": "\u7b26\u53f7", - "Arrows": "\u7bad\u5934", - "User Defined": "\u81ea\u5b9a\u4e49", - "dollar sign": "\u7f8e\u5143\u7b26\u53f7", - "currency sign": "\u8d27\u5e01\u7b26\u53f7", - "euro-currency sign": "\u6b27\u5143\u7b26\u53f7", - "colon sign": "\u5192\u53f7", - "cruzeiro sign": "\u514b\u9c81\u8d5b\u7f57\u5e01\u7b26\u53f7", - "french franc sign": "\u6cd5\u90ce\u7b26\u53f7", - "lira sign": "\u91cc\u62c9\u7b26\u53f7", - "mill sign": "\u5bc6\u5c14\u7b26\u53f7", - "naira sign": "\u5948\u62c9\u7b26\u53f7", - "peseta sign": "\u6bd4\u585e\u5854\u7b26\u53f7", - "rupee sign": "\u5362\u6bd4\u7b26\u53f7", - "won sign": "\u97e9\u5143\u7b26\u53f7", - "new sheqel sign": "\u65b0\u8c22\u514b\u5c14\u7b26\u53f7", - "dong sign": "\u8d8a\u5357\u76fe\u7b26\u53f7", - "kip sign": "\u8001\u631d\u57fa\u666e\u7b26\u53f7", - "tugrik sign": "\u56fe\u683c\u91cc\u514b\u7b26\u53f7", - "drachma sign": "\u5fb7\u62c9\u514b\u9a6c\u7b26\u53f7", - "german penny symbol": "\u5fb7\u56fd\u4fbf\u58eb\u7b26\u53f7", - "peso sign": "\u6bd4\u7d22\u7b26\u53f7", - "guarani sign": "\u74dc\u62c9\u5c3c\u7b26\u53f7", - "austral sign": "\u6fb3\u5143\u7b26\u53f7", - "hryvnia sign": "\u683c\u91cc\u592b\u5c3c\u4e9a\u7b26\u53f7", - "cedi sign": "\u585e\u5730\u7b26\u53f7", - "livre tournois sign": "\u91cc\u5f17\u5f17\u5c14\u7b26\u53f7", - "spesmilo sign": "spesmilo\u7b26\u53f7", - "tenge sign": "\u575a\u6208\u7b26\u53f7", - "indian rupee sign": "\u5370\u5ea6\u5362\u6bd4", - "turkish lira sign": "\u571f\u8033\u5176\u91cc\u62c9", - "nordic mark sign": "\u5317\u6b27\u9a6c\u514b", - "manat sign": "\u9a6c\u7eb3\u7279\u7b26\u53f7", - "ruble sign": "\u5362\u5e03\u7b26\u53f7", - "yen character": "\u65e5\u5143\u5b57\u6837", - "yuan character": "\u4eba\u6c11\u5e01\u5143\u5b57\u6837", - "yuan character, in hong kong and taiwan": "\u5143\u5b57\u6837\uff08\u6e2f\u53f0\u5730\u533a\uff09", - "yen\/yuan character variant one": "\u5143\u5b57\u6837\uff08\u5927\u5199\uff09", - "Loading emoticons...": "\u52a0\u8f7d\u8868\u60c5\u7b26\u53f7...", - "Could not load emoticons": "\u4e0d\u80fd\u52a0\u8f7d\u8868\u60c5\u7b26\u53f7", - "People": "\u4eba\u7c7b", - "Animals and Nature": "\u52a8\u7269\u548c\u81ea\u7136", - "Food and Drink": "\u98df\u7269\u548c\u996e\u54c1", - "Activity": "\u6d3b\u52a8", - "Travel and Places": "\u65c5\u6e38\u548c\u5730\u70b9", - "Objects": "\u7269\u4ef6", - "Flags": "\u65d7\u5e1c", - "Characters": "\u5b57\u7b26", - "Characters (no spaces)": "\u5b57\u7b26(\u65e0\u7a7a\u683c)", - "{0} characters": "{0} \u4e2a\u5b57\u7b26", - "Error: Form submit field collision.": "\u9519\u8bef: \u8868\u5355\u63d0\u4ea4\u5b57\u6bb5\u51b2\u7a81\u3002", - "Error: No form element found.": "\u9519\u8bef: \u6ca1\u6709\u8868\u5355\u63a7\u4ef6\u3002", - "Update": "\u66f4\u65b0", - "Color swatch": "\u989c\u8272\u6837\u672c", - "Turquoise": "\u9752\u7eff\u8272", - "Green": "\u7eff\u8272", - "Blue": "\u84dd\u8272", - "Purple": "\u7d2b\u8272", - "Navy Blue": "\u6d77\u519b\u84dd", - "Dark Turquoise": "\u6df1\u84dd\u7eff\u8272", - "Dark Green": "\u6df1\u7eff\u8272", - "Medium Blue": "\u4e2d\u84dd\u8272", - "Medium Purple": "\u4e2d\u7d2b\u8272", - "Midnight Blue": "\u6df1\u84dd\u8272", - "Yellow": "\u9ec4\u8272", - "Orange": "\u6a59\u8272", - "Red": "\u7ea2\u8272", - "Light Gray": "\u6d45\u7070\u8272", - "Gray": "\u7070\u8272", - "Dark Yellow": "\u6697\u9ec4\u8272", - "Dark Orange": "\u6df1\u6a59\u8272", - "Dark Red": "\u6df1\u7ea2\u8272", - "Medium Gray": "\u4e2d\u7070\u8272", - "Dark Gray": "\u6df1\u7070\u8272", - "Light Green": "\u6d45\u7eff\u8272", - "Light Yellow": "\u6d45\u9ec4\u8272", - "Light Red": "\u6d45\u7ea2\u8272", - "Light Purple": "\u6d45\u7d2b\u8272", - "Light Blue": "\u6d45\u84dd\u8272", - "Dark Purple": "\u6df1\u7d2b\u8272", - "Dark Blue": "\u6df1\u84dd\u8272", - "Black": "\u9ed1\u8272", - "White": "\u767d\u8272", - "Switch to or from fullscreen mode": "\u5207\u6362\u5168\u5c4f\u6a21\u5f0f", - "Open help dialog": "\u6253\u5f00\u5e2e\u52a9\u5bf9\u8bdd\u6846", - "history": "\u5386\u53f2", - "styles": "\u6837\u5f0f", - "formatting": "\u683c\u5f0f\u5316", - "alignment": "\u5bf9\u9f50", - "indentation": "\u7f29\u8fdb", - "permanent pen": "\u8bb0\u53f7\u7b14", - "comments": "\u5907\u6ce8", - "Format Painter": "\u683c\u5f0f\u5237", - "Insert\/edit iframe": "\u63d2\u5165\/\u7f16\u8f91\u6846\u67b6", - "Capitalization": "\u5927\u5199", - "lowercase": "\u5c0f\u5199", - "UPPERCASE": "\u5927\u5199", - "Title Case": "\u9996\u5b57\u6bcd\u5927\u5199", - "Permanent Pen Properties": "\u6c38\u4e45\u7b14\u5c5e\u6027", - "Permanent pen properties...": "\u6c38\u4e45\u7b14\u5c5e\u6027...", - "Font": "\u5b57\u4f53", - "Size": "\u5b57\u53f7", - "More...": "\u66f4\u591a...", - "Spellcheck Language": "\u62fc\u5199\u68c0\u67e5\u8bed\u8a00", - "Select...": "\u9009\u62e9...", - "Preferences": "\u9996\u9009\u9879", - "Yes": "\u662f", - "No": "\u5426", - "Keyboard Navigation": "\u952e\u76d8\u6307\u5f15", - "Version": "\u7248\u672c", - "Anchor": "\u951a\u70b9", - "Special character": "\u7279\u6b8a\u7b26\u53f7", - "Code sample": "\u4ee3\u7801\u793a\u4f8b", - "Color": "\u989c\u8272", - "Emoticons": "\u8868\u60c5", - "Document properties": "\u6587\u6863\u5c5e\u6027", - "Image": "\u56fe\u7247", - "Insert link": "\u63d2\u5165\u94fe\u63a5", - "Target": "\u6253\u5f00\u65b9\u5f0f", - "Link": "\u94fe\u63a5", - "Poster": "\u5c01\u9762", - "Media": "\u5a92\u4f53", - "Print": "\u6253\u5370", - "Prev": "\u4e0a\u4e00\u4e2a", - "Find and replace": "\u67e5\u627e\u548c\u66ff\u6362", - "Whole words": "\u5168\u5b57\u5339\u914d", - "Spellcheck": "\u62fc\u5199\u68c0\u67e5", - "Caption": "\u6807\u9898", - "Insert template": "\u63d2\u5165\u6a21\u677f" +tinymce.addI18n('zh_CN',{ +"Redo": "\u91cd\u505a", +"Undo": "\u64a4\u9500", +"Cut": "\u526a\u5207", +"Copy": "\u590d\u5236", +"Paste": "\u7c98\u8d34", +"Select all": "\u5168\u9009", +"New document": "\u65b0\u6587\u4ef6", +"Ok": "\u786e\u5b9a", +"Cancel": "\u53d6\u6d88", +"Visual aids": "\u7f51\u683c\u7ebf", +"Bold": "\u7c97\u4f53", +"Italic": "\u659c\u4f53", +"Underline": "\u4e0b\u5212\u7ebf", +"Strikethrough": "\u5220\u9664\u7ebf", +"Superscript": "\u4e0a\u6807", +"Subscript": "\u4e0b\u6807", +"Clear formatting": "\u6e05\u9664\u683c\u5f0f", +"Align left": "\u5de6\u8fb9\u5bf9\u9f50", +"Align center": "\u4e2d\u95f4\u5bf9\u9f50", +"Align right": "\u53f3\u8fb9\u5bf9\u9f50", +"Justify": "\u4e24\u7aef\u5bf9\u9f50", +"Bullet list": "\u9879\u76ee\u7b26\u53f7", +"Numbered list": "\u7f16\u53f7\u5217\u8868", +"Decrease indent": "\u51cf\u5c11\u7f29\u8fdb", +"Increase indent": "\u589e\u52a0\u7f29\u8fdb", +"Close": "\u5173\u95ed", +"Formats": "\u683c\u5f0f", +"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "\u4f60\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u6253\u5f00\u526a\u8d34\u677f\uff0c\u8bf7\u4f7f\u7528Ctrl+X\/C\/V\u7b49\u5feb\u6377\u952e\u3002", +"Headers": "\u6807\u9898", +"Header 1": "\u6807\u98981", +"Header 2": "\u6807\u98982", +"Header 3": "\u6807\u98983", +"Header 4": "\u6807\u98984", +"Header 5": "\u6807\u98985", +"Header 6": "\u6807\u98986", +"Headings": "\u6807\u9898", +"Heading 1": "\u6807\u98981", +"Heading 2": "\u6807\u98982", +"Heading 3": "\u6807\u98983", +"Heading 4": "\u6807\u98984", +"Heading 5": "\u6807\u98985", +"Heading 6": "\u6807\u98986", +"Preformatted": "\u9884\u5148\u683c\u5f0f\u5316\u7684", +"Div": "Div", +"Pre": "Pre", +"Code": "\u4ee3\u7801", +"Paragraph": "\u6bb5\u843d", +"Blockquote": "\u5f15\u6587\u533a\u5757", +"Inline": "\u6587\u672c", +"Blocks": "\u57fa\u5757", +"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "\u5f53\u524d\u4e3a\u7eaf\u6587\u672c\u7c98\u8d34\u6a21\u5f0f\uff0c\u518d\u6b21\u70b9\u51fb\u53ef\u4ee5\u56de\u5230\u666e\u901a\u7c98\u8d34\u6a21\u5f0f\u3002", +"Fonts": "\u5b57\u4f53", +"Font Sizes": "\u5b57\u53f7", +"Class": "\u7c7b\u578b", +"Browse for an image": "\u6d4f\u89c8\u56fe\u50cf", +"OR": "\u6216", +"Drop an image here": "\u62d6\u653e\u4e00\u5f20\u56fe\u50cf\u81f3\u6b64", +"Upload": "\u4e0a\u4f20", +"Block": "\u5757", +"Align": "\u5bf9\u9f50", +"Default": "\u9ed8\u8ba4", +"Circle": "\u7a7a\u5fc3\u5706", +"Disc": "\u5b9e\u5fc3\u5706", +"Square": "\u65b9\u5757", +"Lower Alpha": "\u5c0f\u5199\u82f1\u6587\u5b57\u6bcd", +"Lower Greek": "\u5c0f\u5199\u5e0c\u814a\u5b57\u6bcd", +"Lower Roman": "\u5c0f\u5199\u7f57\u9a6c\u5b57\u6bcd", +"Upper Alpha": "\u5927\u5199\u82f1\u6587\u5b57\u6bcd", +"Upper Roman": "\u5927\u5199\u7f57\u9a6c\u5b57\u6bcd", +"Anchor...": "\u951a\u70b9...", +"Name": "\u540d\u79f0", +"Id": "\u6807\u8bc6\u7b26", +"Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.": "\u6807\u8bc6\u7b26\u5e94\u8be5\u4ee5\u5b57\u6bcd\u5f00\u5934\uff0c\u540e\u8ddf\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u7834\u6298\u53f7\u3001\u70b9\u3001\u5192\u53f7\u6216\u4e0b\u5212\u7ebf\u3002", +"You have unsaved changes are you sure you want to navigate away?": "\u4f60\u8fd8\u6709\u6587\u6863\u5c1a\u672a\u4fdd\u5b58\uff0c\u786e\u5b9a\u8981\u79bb\u5f00\uff1f", +"Restore last draft": "\u6062\u590d\u4e0a\u6b21\u7684\u8349\u7a3f", +"Special character...": "\u7279\u6b8a\u5b57\u7b26...", +"Source code": "\u6e90\u4ee3\u7801", +"Insert\/Edit code sample": "\u63d2\u5165\/\u7f16\u8f91\u4ee3\u7801\u793a\u4f8b", +"Language": "\u8bed\u8a00", +"Code sample...": "\u793a\u4f8b\u4ee3\u7801...", +"Color Picker": "\u9009\u8272\u5668", +"R": "R", +"G": "G", +"B": "B", +"Left to right": "\u4ece\u5de6\u5230\u53f3", +"Right to left": "\u4ece\u53f3\u5230\u5de6", +"Emoticons...": "\u8868\u60c5\u7b26\u53f7...", +"Metadata and Document Properties": "\u5143\u6570\u636e\u548c\u6587\u6863\u5c5e\u6027", +"Title": "\u6807\u9898", +"Keywords": "\u5173\u952e\u8bcd", +"Description": "\u63cf\u8ff0", +"Robots": "\u673a\u5668\u4eba", +"Author": "\u4f5c\u8005", +"Encoding": "\u7f16\u7801", +"Fullscreen": "\u5168\u5c4f", +"Action": "\u64cd\u4f5c", +"Shortcut": "\u5feb\u6377\u952e", +"Help": "\u5e2e\u52a9", +"Address": "\u5730\u5740", +"Focus to menubar": "\u79fb\u52a8\u7126\u70b9\u5230\u83dc\u5355\u680f", +"Focus to toolbar": "\u79fb\u52a8\u7126\u70b9\u5230\u5de5\u5177\u680f", +"Focus to element path": "\u79fb\u52a8\u7126\u70b9\u5230\u5143\u7d20\u8def\u5f84", +"Focus to contextual toolbar": "\u79fb\u52a8\u7126\u70b9\u5230\u4e0a\u4e0b\u6587\u83dc\u5355", +"Insert link (if link plugin activated)": "\u63d2\u5165\u94fe\u63a5 (\u5982\u679c\u94fe\u63a5\u63d2\u4ef6\u5df2\u6fc0\u6d3b)", +"Save (if save plugin activated)": "\u4fdd\u5b58(\u5982\u679c\u4fdd\u5b58\u63d2\u4ef6\u5df2\u6fc0\u6d3b)", +"Find (if searchreplace plugin activated)": "\u67e5\u627e(\u5982\u679c\u67e5\u627e\u66ff\u6362\u63d2\u4ef6\u5df2\u6fc0\u6d3b)", +"Plugins installed ({0}):": "\u5df2\u5b89\u88c5\u63d2\u4ef6 ({0}):", +"Premium plugins:": "\u4f18\u79c0\u63d2\u4ef6\uff1a", +"Learn more...": "\u4e86\u89e3\u66f4\u591a...", +"You are using {0}": "\u4f60\u6b63\u5728\u4f7f\u7528 {0}", +"Plugins": "\u63d2\u4ef6", +"Handy Shortcuts": "\u5feb\u6377\u952e", +"Horizontal line": "\u6c34\u5e73\u5206\u5272\u7ebf", +"Insert\/edit image": "\u63d2\u5165\/\u7f16\u8f91\u56fe\u7247", +"Image description": "\u56fe\u7247\u63cf\u8ff0", +"Source": "\u5730\u5740", +"Dimensions": "\u5927\u5c0f", +"Constrain proportions": "\u4fdd\u6301\u7eb5\u6a2a\u6bd4", +"General": "\u666e\u901a", +"Advanced": "\u9ad8\u7ea7", +"Style": "\u6837\u5f0f", +"Vertical space": "\u5782\u76f4\u8fb9\u8ddd", +"Horizontal space": "\u6c34\u5e73\u8fb9\u8ddd", +"Border": "\u8fb9\u6846", +"Insert image": "\u63d2\u5165\u56fe\u7247", +"Image...": "\u56fe\u7247...", +"Image list": "\u56fe\u7247\u5217\u8868", +"Rotate counterclockwise": "\u9006\u65f6\u9488\u65cb\u8f6c", +"Rotate clockwise": "\u987a\u65f6\u9488\u65cb\u8f6c", +"Flip vertically": "\u5782\u76f4\u7ffb\u8f6c", +"Flip horizontally": "\u6c34\u5e73\u7ffb\u8f6c", +"Edit image": "\u7f16\u8f91\u56fe\u7247", +"Image options": "\u56fe\u7247\u9009\u9879", +"Zoom in": "\u653e\u5927", +"Zoom out": "\u7f29\u5c0f", +"Crop": "\u88c1\u526a", +"Resize": "\u8c03\u6574\u5927\u5c0f", +"Orientation": "\u65b9\u5411", +"Brightness": "\u4eae\u5ea6", +"Sharpen": "\u9510\u5316", +"Contrast": "\u5bf9\u6bd4\u5ea6", +"Color levels": "\u989c\u8272\u5c42\u6b21", +"Gamma": "\u4f3d\u9a6c\u503c", +"Invert": "\u53cd\u8f6c", +"Apply": "\u5e94\u7528", +"Back": "\u540e\u9000", +"Insert date\/time": "\u63d2\u5165\u65e5\u671f\/\u65f6\u95f4", +"Date\/time": "\u65e5\u671f\/\u65f6\u95f4", +"Insert\/Edit Link": "\u63d2\u5165\/\u7f16\u8f91\u94fe\u63a5", +"Insert\/edit link": "\u63d2\u5165\/\u7f16\u8f91\u94fe\u63a5", +"Text to display": "\u663e\u793a\u6587\u5b57", +"Url": "\u5730\u5740", +"Open link in...": "\u94fe\u63a5\u6253\u5f00\u4f4d\u7f6e...", +"Current window": "\u5f53\u524d\u7a97\u53e3", +"None": "\u65e0", +"New window": "\u5728\u65b0\u7a97\u53e3\u6253\u5f00", +"Remove link": "\u5220\u9664\u94fe\u63a5", +"Anchors": "\u951a\u70b9", +"Link...": "\u94fe\u63a5...", +"Paste or type a link": "\u7c98\u8d34\u6216\u8f93\u5165\u94fe\u63a5", +"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "\u4f60\u6240\u586b\u5199\u7684URL\u5730\u5740\u4e3a\u90ae\u4ef6\u5730\u5740\uff0c\u9700\u8981\u52a0\u4e0amailto:\u524d\u7f00\u5417\uff1f", +"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "\u4f60\u6240\u586b\u5199\u7684URL\u5730\u5740\u5c5e\u4e8e\u5916\u90e8\u94fe\u63a5\uff0c\u9700\u8981\u52a0\u4e0ahttp:\/\/:\u524d\u7f00\u5417\uff1f", +"Link list": "\u94fe\u63a5\u5217\u8868", +"Insert video": "\u63d2\u5165\u89c6\u9891", +"Insert\/edit video": "\u63d2\u5165\/\u7f16\u8f91\u89c6\u9891", +"Insert\/edit media": "\u63d2\u5165\/\u7f16\u8f91\u5a92\u4f53", +"Alternative source": "\u955c\u50cf", +"Alternative source URL": "\u66ff\u4ee3\u6765\u6e90\u7f51\u5740", +"Media poster (Image URL)": "\u5c01\u9762(\u56fe\u7247\u5730\u5740)", +"Paste your embed code below:": "\u5c06\u5185\u5d4c\u4ee3\u7801\u7c98\u8d34\u5728\u4e0b\u9762:", +"Embed": "\u5185\u5d4c", +"Media...": "\u591a\u5a92\u4f53...", +"Nonbreaking space": "\u4e0d\u95f4\u65ad\u7a7a\u683c", +"Page break": "\u5206\u9875\u7b26", +"Paste as text": "\u7c98\u8d34\u4e3a\u6587\u672c", +"Preview": "\u9884\u89c8", +"Print...": "\u6253\u5370...", +"Save": "\u4fdd\u5b58", +"Find": "\u67e5\u627e", +"Replace with": "\u66ff\u6362\u4e3a", +"Replace": "\u66ff\u6362", +"Replace all": "\u5168\u90e8\u66ff\u6362", +"Previous": "\u4e0a\u4e00\u4e2a", +"Next": "\u4e0b\u4e00\u4e2a", +"Find and replace...": "\u67e5\u627e\u5e76\u66ff\u6362...", +"Could not find the specified string.": "\u672a\u627e\u5230\u641c\u7d22\u5185\u5bb9.", +"Match case": "\u533a\u5206\u5927\u5c0f\u5199", +"Find whole words only": "\u5168\u5b57\u5339\u914d", +"Spell check": "\u62fc\u5199\u68c0\u67e5", +"Ignore": "\u5ffd\u7565", +"Ignore all": "\u5168\u90e8\u5ffd\u7565", +"Finish": "\u5b8c\u6210", +"Add to Dictionary": "\u6dfb\u52a0\u5230\u5b57\u5178", +"Insert table": "\u63d2\u5165\u8868\u683c", +"Table properties": "\u8868\u683c\u5c5e\u6027", +"Delete table": "\u5220\u9664\u8868\u683c", +"Cell": "\u5355\u5143\u683c", +"Row": "\u884c", +"Column": "\u5217", +"Cell properties": "\u5355\u5143\u683c\u5c5e\u6027", +"Merge cells": "\u5408\u5e76\u5355\u5143\u683c", +"Split cell": "\u62c6\u5206\u5355\u5143\u683c", +"Insert row before": "\u5728\u4e0a\u65b9\u63d2\u5165", +"Insert row after": "\u5728\u4e0b\u65b9\u63d2\u5165", +"Delete row": "\u5220\u9664\u884c", +"Row properties": "\u884c\u5c5e\u6027", +"Cut row": "\u526a\u5207\u884c", +"Copy row": "\u590d\u5236\u884c", +"Paste row before": "\u7c98\u8d34\u5230\u4e0a\u65b9", +"Paste row after": "\u7c98\u8d34\u5230\u4e0b\u65b9", +"Insert column before": "\u5728\u5de6\u4fa7\u63d2\u5165", +"Insert column after": "\u5728\u53f3\u4fa7\u63d2\u5165", +"Delete column": "\u5220\u9664\u5217", +"Cols": "\u5217", +"Rows": "\u884c", +"Width": "\u5bbd", +"Height": "\u9ad8", +"Cell spacing": "\u5355\u5143\u683c\u5916\u95f4\u8ddd", +"Cell padding": "\u5355\u5143\u683c\u5185\u8fb9\u8ddd", +"Show caption": "\u663e\u793a\u6807\u9898", +"Left": "\u5de6\u5bf9\u9f50", +"Center": "\u5c45\u4e2d", +"Right": "\u53f3\u5bf9\u9f50", +"Cell type": "\u5355\u5143\u683c\u7c7b\u578b", +"Scope": "\u8303\u56f4", +"Alignment": "\u5bf9\u9f50\u65b9\u5f0f", +"H Align": "\u6c34\u5e73\u5bf9\u9f50", +"V Align": "\u5782\u76f4\u5bf9\u9f50", +"Top": "\u9876\u90e8\u5bf9\u9f50", +"Middle": "\u5782\u76f4\u5c45\u4e2d", +"Bottom": "\u5e95\u90e8\u5bf9\u9f50", +"Header cell": "\u8868\u5934\u5355\u5143\u683c", +"Row group": "\u884c\u7ec4", +"Column group": "\u5217\u7ec4", +"Row type": "\u884c\u7c7b\u578b", +"Header": "\u8868\u5934", +"Body": "\u8868\u4f53", +"Footer": "\u8868\u5c3e", +"Border color": "\u8fb9\u6846\u989c\u8272", +"Insert template...": "\u63d2\u5165\u6a21\u677f...", +"Templates": "\u6a21\u677f", +"Template": "\u6a21\u677f", +"Text color": "\u6587\u5b57\u989c\u8272", +"Background color": "\u80cc\u666f\u8272", +"Custom...": "\u81ea\u5b9a\u4e49...", +"Custom color": "\u81ea\u5b9a\u4e49\u989c\u8272", +"No color": "\u65e0", +"Remove color": "\u79fb\u9664\u989c\u8272", +"Table of Contents": "\u5185\u5bb9\u5217\u8868", +"Show blocks": "\u663e\u793a\u533a\u5757\u8fb9\u6846", +"Show invisible characters": "\u663e\u793a\u4e0d\u53ef\u89c1\u5b57\u7b26", +"Word count": "\u5b57\u6570", +"Count": "\u8ba1\u6570", +"Document": "\u6587\u6863", +"Selection": "\u9009\u62e9", +"Words": "\u5355\u8bcd", +"Words: {0}": "\u5b57\u6570\uff1a{0}", +"{0} words": "{0} \u5b57", +"File": "\u6587\u4ef6", +"Edit": "\u7f16\u8f91", +"Insert": "\u63d2\u5165", +"View": "\u89c6\u56fe", +"Format": "\u683c\u5f0f", +"Table": "\u8868\u683c", +"Tools": "\u5de5\u5177", +"Powered by {0}": "\u7531{0}\u9a71\u52a8", +"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "\u5728\u7f16\u8f91\u533a\u6309ALT-F9\u6253\u5f00\u83dc\u5355\uff0c\u6309ALT-F10\u6253\u5f00\u5de5\u5177\u680f\uff0c\u6309ALT-0\u67e5\u770b\u5e2e\u52a9", +"Image title": "\u56fe\u7247\u6807\u9898", +"Border width": "\u8fb9\u6846\u5bbd\u5ea6", +"Border style": "\u8fb9\u6846\u6837\u5f0f", +"Error": "\u9519\u8bef", +"Warn": "\u8b66\u544a", +"Valid": "\u6709\u6548", +"To open the popup, press Shift+Enter": "\u6309Shitf+Enter\u952e\u6253\u5f00\u5bf9\u8bdd\u6846", +"Rich Text Area. Press ALT-0 for help.": "\u7f16\u8f91\u533a\u3002\u6309Alt+0\u952e\u6253\u5f00\u5e2e\u52a9\u3002", +"System Font": "\u7cfb\u7edf\u5b57\u4f53", +"Failed to upload image: {0}": "\u56fe\u7247\u4e0a\u4f20\u5931\u8d25: {0}", +"Failed to load plugin: {0} from url {1}": "\u63d2\u4ef6\u52a0\u8f7d\u5931\u8d25: {0} \u6765\u81ea\u94fe\u63a5 {1}", +"Failed to load plugin url: {0}": "\u63d2\u4ef6\u52a0\u8f7d\u5931\u8d25 \u94fe\u63a5: {0}", +"Failed to initialize plugin: {0}": "\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25: {0}", +"example": "\u793a\u4f8b", +"Search": "\u641c\u7d22", +"All": "\u5168\u90e8", +"Currency": "\u8d27\u5e01", +"Text": "\u6587\u5b57", +"Quotations": "\u5f15\u7528", +"Mathematical": "\u6570\u5b66", +"Extended Latin": "\u62c9\u4e01\u8bed\u6269\u5145", +"Symbols": "\u7b26\u53f7", +"Arrows": "\u7bad\u5934", +"User Defined": "\u81ea\u5b9a\u4e49", +"dollar sign": "\u7f8e\u5143\u7b26\u53f7", +"currency sign": "\u8d27\u5e01\u7b26\u53f7", +"euro-currency sign": "\u6b27\u5143\u7b26\u53f7", +"colon sign": "\u5192\u53f7", +"cruzeiro sign": "\u514b\u9c81\u8d5b\u7f57\u5e01\u7b26\u53f7", +"french franc sign": "\u6cd5\u90ce\u7b26\u53f7", +"lira sign": "\u91cc\u62c9\u7b26\u53f7", +"mill sign": "\u5bc6\u5c14\u7b26\u53f7", +"naira sign": "\u5948\u62c9\u7b26\u53f7", +"peseta sign": "\u6bd4\u585e\u5854\u7b26\u53f7", +"rupee sign": "\u5362\u6bd4\u7b26\u53f7", +"won sign": "\u97e9\u5143\u7b26\u53f7", +"new sheqel sign": "\u65b0\u8c22\u514b\u5c14\u7b26\u53f7", +"dong sign": "\u8d8a\u5357\u76fe\u7b26\u53f7", +"kip sign": "\u8001\u631d\u57fa\u666e\u7b26\u53f7", +"tugrik sign": "\u56fe\u683c\u91cc\u514b\u7b26\u53f7", +"drachma sign": "\u5fb7\u62c9\u514b\u9a6c\u7b26\u53f7", +"german penny symbol": "\u5fb7\u56fd\u4fbf\u58eb\u7b26\u53f7", +"peso sign": "\u6bd4\u7d22\u7b26\u53f7", +"guarani sign": "\u74dc\u62c9\u5c3c\u7b26\u53f7", +"austral sign": "\u6fb3\u5143\u7b26\u53f7", +"hryvnia sign": "\u683c\u91cc\u592b\u5c3c\u4e9a\u7b26\u53f7", +"cedi sign": "\u585e\u5730\u7b26\u53f7", +"livre tournois sign": "\u91cc\u5f17\u5f17\u5c14\u7b26\u53f7", +"spesmilo sign": "spesmilo\u7b26\u53f7", +"tenge sign": "\u575a\u6208\u7b26\u53f7", +"indian rupee sign": "\u5370\u5ea6\u5362\u6bd4", +"turkish lira sign": "\u571f\u8033\u5176\u91cc\u62c9", +"nordic mark sign": "\u5317\u6b27\u9a6c\u514b", +"manat sign": "\u9a6c\u7eb3\u7279\u7b26\u53f7", +"ruble sign": "\u5362\u5e03\u7b26\u53f7", +"yen character": "\u65e5\u5143\u5b57\u6837", +"yuan character": "\u4eba\u6c11\u5e01\u5143\u5b57\u6837", +"yuan character, in hong kong and taiwan": "\u5143\u5b57\u6837\uff08\u6e2f\u53f0\u5730\u533a\uff09", +"yen\/yuan character variant one": "\u5143\u5b57\u6837\uff08\u5927\u5199\uff09", +"Loading emoticons...": "\u52a0\u8f7d\u8868\u60c5\u7b26\u53f7...", +"Could not load emoticons": "\u4e0d\u80fd\u52a0\u8f7d\u8868\u60c5\u7b26\u53f7", +"People": "\u4eba\u7c7b", +"Animals and Nature": "\u52a8\u7269\u548c\u81ea\u7136", +"Food and Drink": "\u98df\u7269\u548c\u996e\u54c1", +"Activity": "\u6d3b\u52a8", +"Travel and Places": "\u65c5\u6e38\u548c\u5730\u70b9", +"Objects": "\u7269\u4ef6", +"Flags": "\u65d7\u5e1c", +"Characters": "\u5b57\u7b26", +"Characters (no spaces)": "\u5b57\u7b26(\u65e0\u7a7a\u683c)", +"{0} characters": "{0} \u4e2a\u5b57\u7b26", +"Error: Form submit field collision.": "\u9519\u8bef: \u8868\u5355\u63d0\u4ea4\u5b57\u6bb5\u51b2\u7a81\u3002", +"Error: No form element found.": "\u9519\u8bef: \u6ca1\u6709\u8868\u5355\u63a7\u4ef6\u3002", +"Update": "\u66f4\u65b0", +"Color swatch": "\u989c\u8272\u6837\u672c", +"Turquoise": "\u9752\u7eff\u8272", +"Green": "\u7eff\u8272", +"Blue": "\u84dd\u8272", +"Purple": "\u7d2b\u8272", +"Navy Blue": "\u6d77\u519b\u84dd", +"Dark Turquoise": "\u6df1\u84dd\u7eff\u8272", +"Dark Green": "\u6df1\u7eff\u8272", +"Medium Blue": "\u4e2d\u84dd\u8272", +"Medium Purple": "\u4e2d\u7d2b\u8272", +"Midnight Blue": "\u6df1\u84dd\u8272", +"Yellow": "\u9ec4\u8272", +"Orange": "\u6a59\u8272", +"Red": "\u7ea2\u8272", +"Light Gray": "\u6d45\u7070\u8272", +"Gray": "\u7070\u8272", +"Dark Yellow": "\u6697\u9ec4\u8272", +"Dark Orange": "\u6df1\u6a59\u8272", +"Dark Red": "\u6df1\u7ea2\u8272", +"Medium Gray": "\u4e2d\u7070\u8272", +"Dark Gray": "\u6df1\u7070\u8272", +"Light Green": "\u6d45\u7eff\u8272", +"Light Yellow": "\u6d45\u9ec4\u8272", +"Light Red": "\u6d45\u7ea2\u8272", +"Light Purple": "\u6d45\u7d2b\u8272", +"Light Blue": "\u6d45\u84dd\u8272", +"Dark Purple": "\u6df1\u7d2b\u8272", +"Dark Blue": "\u6df1\u84dd\u8272", +"Black": "\u9ed1\u8272", +"White": "\u767d\u8272", +"Switch to or from fullscreen mode": "\u5207\u6362\u5168\u5c4f\u6a21\u5f0f", +"Open help dialog": "\u6253\u5f00\u5e2e\u52a9\u5bf9\u8bdd\u6846", +"history": "\u5386\u53f2", +"styles": "\u6837\u5f0f", +"formatting": "\u683c\u5f0f\u5316", +"alignment": "\u5bf9\u9f50", +"indentation": "\u7f29\u8fdb", +"permanent pen": "\u8bb0\u53f7\u7b14", +"comments": "\u5907\u6ce8", +"Format Painter": "\u683c\u5f0f\u5237", +"Insert\/edit iframe": "\u63d2\u5165\/\u7f16\u8f91\u6846\u67b6", +"Capitalization": "\u5927\u5199", +"lowercase": "\u5c0f\u5199", +"UPPERCASE": "\u5927\u5199", +"Title Case": "\u9996\u5b57\u6bcd\u5927\u5199", +"Permanent Pen Properties": "\u6c38\u4e45\u7b14\u5c5e\u6027", +"Permanent pen properties...": "\u6c38\u4e45\u7b14\u5c5e\u6027...", +"Font": "\u5b57\u4f53", +"Size": "\u5b57\u53f7", +"More...": "\u66f4\u591a...", +"Spellcheck Language": "\u62fc\u5199\u68c0\u67e5\u8bed\u8a00", +"Select...": "\u9009\u62e9...", +"Preferences": "\u9996\u9009\u9879", +"Yes": "\u662f", +"No": "\u5426", +"Keyboard Navigation": "\u952e\u76d8\u6307\u5f15", +"Version": "\u7248\u672c", +"Anchor": "\u951a\u70b9", +"Special character": "\u7279\u6b8a\u7b26\u53f7", +"Code sample": "\u4ee3\u7801\u793a\u4f8b", +"Color": "\u989c\u8272", +"Emoticons": "\u8868\u60c5", +"Document properties": "\u6587\u6863\u5c5e\u6027", +"Image": "\u56fe\u7247", +"Insert link": "\u63d2\u5165\u94fe\u63a5", +"Target": "\u6253\u5f00\u65b9\u5f0f", +"Link": "\u94fe\u63a5", +"Poster": "\u5c01\u9762", +"Media": "\u5a92\u4f53", +"Print": "\u6253\u5370", +"Prev": "\u4e0a\u4e00\u4e2a", +"Find and replace": "\u67e5\u627e\u548c\u66ff\u6362", +"Whole words": "\u5168\u5b57\u5339\u914d", +"Spellcheck": "\u62fc\u5199\u68c0\u67e5", +"Caption": "\u6807\u9898", +"Insert template": "\u63d2\u5165\u6a21\u677f" }); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/advlist/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/advlist/plugin.js index c3112848..0dd07b06 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/advlist/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/advlist/plugin.js @@ -12,265 +12,265 @@ var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var applyListFormat = function (editor, listName, styleValue) { - var cmd = listName === 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList'; - editor.execCommand(cmd, false, styleValue === false ? null : {'list-style-type': styleValue}); + var cmd = listName === 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList'; + editor.execCommand(cmd, false, styleValue === false ? null : { 'list-style-type': styleValue }); }; var register = function (editor) { - editor.addCommand('ApplyUnorderedListStyle', function (ui, value) { - applyListFormat(editor, 'UL', value['list-style-type']); - }); - editor.addCommand('ApplyOrderedListStyle', function (ui, value) { - applyListFormat(editor, 'OL', value['list-style-type']); - }); + editor.addCommand('ApplyUnorderedListStyle', function (ui, value) { + applyListFormat(editor, 'UL', value['list-style-type']); + }); + editor.addCommand('ApplyOrderedListStyle', function (ui, value) { + applyListFormat(editor, 'OL', value['list-style-type']); + }); }; var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var getNumberStyles = function (editor) { - var styles = editor.getParam('advlist_number_styles', 'default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman'); - return styles ? styles.split(/[ ,]/) : []; + var styles = editor.getParam('advlist_number_styles', 'default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman'); + return styles ? styles.split(/[ ,]/) : []; }; var getBulletStyles = function (editor) { - var styles = editor.getParam('advlist_bullet_styles', 'default,circle,square'); - return styles ? styles.split(/[ ,]/) : []; + var styles = editor.getParam('advlist_bullet_styles', 'default,circle,square'); + return styles ? styles.split(/[ ,]/) : []; }; var noop = function () { }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; var never = constant(false); var always = constant(true); var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var isChildOfBody = function (editor, elm) { - return editor.$.contains(editor.getBody(), elm); + return editor.$.contains(editor.getBody(), elm); }; var isTableCellNode = function (node) { - return node && /^(TH|TD)$/.test(node.nodeName); + return node && /^(TH|TD)$/.test(node.nodeName); }; var isListNode = function (editor) { - return function (node) { - return node && /^(OL|UL|DL)$/.test(node.nodeName) && isChildOfBody(editor, node); - }; + return function (node) { + return node && /^(OL|UL|DL)$/.test(node.nodeName) && isChildOfBody(editor, node); + }; }; var getSelectedStyleType = function (editor) { - var listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul'); - var style = editor.dom.getStyle(listElm, 'listStyleType'); - return Optional.from(style); + var listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul'); + var style = editor.dom.getStyle(listElm, 'listStyleType'); + return Optional.from(style); }; var findIndex = function (list, predicate) { - for (var index = 0; index < list.length; index++) { - var element = list[index]; - if (predicate(element)) { - return index; - } + for (var index = 0; index < list.length; index++) { + var element = list[index]; + if (predicate(element)) { + return index; } - return -1; + } + return -1; }; var styleValueToText = function (styleValue) { - return styleValue.replace(/\-/g, ' ').replace(/\b\w/g, function (chr) { - return chr.toUpperCase(); - }); + return styleValue.replace(/\-/g, ' ').replace(/\b\w/g, function (chr) { + return chr.toUpperCase(); + }); }; var isWithinList = function (editor, e, nodeName) { - var tableCellIndex = findIndex(e.parents, isTableCellNode); - var parents = tableCellIndex !== -1 ? e.parents.slice(0, tableCellIndex) : e.parents; - var lists = global$1.grep(parents, isListNode(editor)); - return lists.length > 0 && lists[0].nodeName === nodeName; + var tableCellIndex = findIndex(e.parents, isTableCellNode); + var parents = tableCellIndex !== -1 ? e.parents.slice(0, tableCellIndex) : e.parents; + var lists = global$1.grep(parents, isListNode(editor)); + return lists.length > 0 && lists[0].nodeName === nodeName; }; var addSplitButton = function (editor, id, tooltip, cmd, nodeName, styles) { - editor.ui.registry.addSplitButton(id, { - tooltip: tooltip, - icon: nodeName === 'OL' ? 'ordered-list' : 'unordered-list', - presets: 'listpreview', - columns: 3, - fetch: function (callback) { - var items = global$1.map(styles, function (styleValue) { - var iconStyle = nodeName === 'OL' ? 'num' : 'bull'; - var iconName = styleValue === 'disc' || styleValue === 'decimal' ? 'default' : styleValue; - var itemValue = styleValue === 'default' ? '' : styleValue; - var displayText = styleValueToText(styleValue); - return { - type: 'choiceitem', - value: itemValue, - icon: 'list-' + iconStyle + '-' + iconName, - text: displayText - }; - }); - callback(items); - }, - onAction: function () { - return editor.execCommand(cmd); - }, - onItemAction: function (_splitButtonApi, value) { - applyListFormat(editor, nodeName, value); - }, - select: function (value) { - var listStyleType = getSelectedStyleType(editor); - return listStyleType.map(function (listStyle) { - return value === listStyle; - }).getOr(false); - }, - onSetup: function (api) { - var nodeChangeHandler = function (e) { - api.setActive(isWithinList(editor, e, nodeName)); - }; - editor.on('NodeChange', nodeChangeHandler); - return function () { - return editor.off('NodeChange', nodeChangeHandler); - }; - } - }); + editor.ui.registry.addSplitButton(id, { + tooltip: tooltip, + icon: nodeName === 'OL' ? 'ordered-list' : 'unordered-list', + presets: 'listpreview', + columns: 3, + fetch: function (callback) { + var items = global$1.map(styles, function (styleValue) { + var iconStyle = nodeName === 'OL' ? 'num' : 'bull'; + var iconName = styleValue === 'disc' || styleValue === 'decimal' ? 'default' : styleValue; + var itemValue = styleValue === 'default' ? '' : styleValue; + var displayText = styleValueToText(styleValue); + return { + type: 'choiceitem', + value: itemValue, + icon: 'list-' + iconStyle + '-' + iconName, + text: displayText + }; + }); + callback(items); + }, + onAction: function () { + return editor.execCommand(cmd); + }, + onItemAction: function (_splitButtonApi, value) { + applyListFormat(editor, nodeName, value); + }, + select: function (value) { + var listStyleType = getSelectedStyleType(editor); + return listStyleType.map(function (listStyle) { + return value === listStyle; + }).getOr(false); + }, + onSetup: function (api) { + var nodeChangeHandler = function (e) { + api.setActive(isWithinList(editor, e, nodeName)); + }; + editor.on('NodeChange', nodeChangeHandler); + return function () { + return editor.off('NodeChange', nodeChangeHandler); + }; + } + }); }; var addButton = function (editor, id, tooltip, cmd, nodeName, _styles) { - editor.ui.registry.addToggleButton(id, { - active: false, - tooltip: tooltip, - icon: nodeName === 'OL' ? 'ordered-list' : 'unordered-list', - onSetup: function (api) { - var nodeChangeHandler = function (e) { - api.setActive(isWithinList(editor, e, nodeName)); - }; - editor.on('NodeChange', nodeChangeHandler); - return function () { - return editor.off('NodeChange', nodeChangeHandler); - }; - }, - onAction: function () { - return editor.execCommand(cmd); - } - }); + editor.ui.registry.addToggleButton(id, { + active: false, + tooltip: tooltip, + icon: nodeName === 'OL' ? 'ordered-list' : 'unordered-list', + onSetup: function (api) { + var nodeChangeHandler = function (e) { + api.setActive(isWithinList(editor, e, nodeName)); + }; + editor.on('NodeChange', nodeChangeHandler); + return function () { + return editor.off('NodeChange', nodeChangeHandler); + }; + }, + onAction: function () { + return editor.execCommand(cmd); + } + }); }; var addControl = function (editor, id, tooltip, cmd, nodeName, styles) { - if (styles.length > 1) { - addSplitButton(editor, id, tooltip, cmd, nodeName, styles); - } else { - addButton(editor, id, tooltip, cmd, nodeName); - } + if (styles.length > 1) { + addSplitButton(editor, id, tooltip, cmd, nodeName, styles); + } else { + addButton(editor, id, tooltip, cmd, nodeName); + } }; var register$1 = function (editor) { - addControl(editor, 'numlist', 'Numbered list', 'InsertOrderedList', 'OL', getNumberStyles(editor)); - addControl(editor, 'bullist', 'Bullet list', 'InsertUnorderedList', 'UL', getBulletStyles(editor)); + addControl(editor, 'numlist', 'Numbered list', 'InsertOrderedList', 'OL', getNumberStyles(editor)); + addControl(editor, 'bullist', 'Bullet list', 'InsertUnorderedList', 'UL', getBulletStyles(editor)); }; - function Plugin() { - global.add('advlist', function (editor) { - if (editor.hasPlugin('lists')) { - register$1(editor); - register(editor); - } - }); + function Plugin () { + global.add('advlist', function (editor) { + if (editor.hasPlugin('lists')) { + register$1(editor); + register(editor); + } + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/anchor/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/anchor/plugin.js index bbce40af..17f2aa0a 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/anchor/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/anchor/plugin.js @@ -16,199 +16,199 @@ var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var allowHtmlInNamedAnchor = function (editor) { - return editor.getParam('allow_html_in_named_anchor', false, 'boolean'); + return editor.getParam('allow_html_in_named_anchor', false, 'boolean'); }; var namedAnchorSelector = 'a:not([href])'; var isEmptyString = function (str) { - return !str; + return !str; }; var getIdFromAnchor = function (elm) { - var id = elm.getAttribute('id') || elm.getAttribute('name'); - return id || ''; + var id = elm.getAttribute('id') || elm.getAttribute('name'); + return id || ''; }; var isAnchor = function (elm) { - return elm && elm.nodeName.toLowerCase() === 'a'; + return elm && elm.nodeName.toLowerCase() === 'a'; }; var isNamedAnchor = function (elm) { - return isAnchor(elm) && !elm.getAttribute('href') && getIdFromAnchor(elm) !== ''; + return isAnchor(elm) && !elm.getAttribute('href') && getIdFromAnchor(elm) !== ''; }; var isEmptyNamedAnchor = function (elm) { - return isNamedAnchor(elm) && !elm.firstChild; + return isNamedAnchor(elm) && !elm.firstChild; }; var removeEmptyNamedAnchorsInSelection = function (editor) { - var dom = editor.dom; - global$1(dom).walk(editor.selection.getRng(), function (nodes) { - global$2.each(nodes, function (node) { - if (isEmptyNamedAnchor(node)) { - dom.remove(node, false); - } - }); + var dom = editor.dom; + global$1(dom).walk(editor.selection.getRng(), function (nodes) { + global$2.each(nodes, function (node) { + if (isEmptyNamedAnchor(node)) { + dom.remove(node, false); + } }); + }); }; var isValidId = function (id) { - return /^[A-Za-z][A-Za-z0-9\-:._]*$/.test(id); + return /^[A-Za-z][A-Za-z0-9\-:._]*$/.test(id); }; var getNamedAnchor = function (editor) { - return editor.dom.getParent(editor.selection.getStart(), namedAnchorSelector); + return editor.dom.getParent(editor.selection.getStart(), namedAnchorSelector); }; var getId = function (editor) { - var anchor = getNamedAnchor(editor); - if (anchor) { - return getIdFromAnchor(anchor); - } else { - return ''; - } + var anchor = getNamedAnchor(editor); + if (anchor) { + return getIdFromAnchor(anchor); + } else { + return ''; + } }; var createAnchor = function (editor, id) { - editor.undoManager.transact(function () { - if (!allowHtmlInNamedAnchor(editor)) { - editor.selection.collapse(true); - } - if (editor.selection.isCollapsed()) { - editor.insertContent(editor.dom.createHTML('a', {id: id})); - } else { - removeEmptyNamedAnchorsInSelection(editor); - editor.formatter.remove('namedAnchor', null, null, true); - editor.formatter.apply('namedAnchor', {value: id}); - editor.addVisual(); - } - }); + editor.undoManager.transact(function () { + if (!allowHtmlInNamedAnchor(editor)) { + editor.selection.collapse(true); + } + if (editor.selection.isCollapsed()) { + editor.insertContent(editor.dom.createHTML('a', { id: id })); + } else { + removeEmptyNamedAnchorsInSelection(editor); + editor.formatter.remove('namedAnchor', null, null, true); + editor.formatter.apply('namedAnchor', { value: id }); + editor.addVisual(); + } + }); }; var updateAnchor = function (editor, id, anchorElement) { - anchorElement.removeAttribute('name'); - anchorElement.id = id; - editor.addVisual(); - editor.undoManager.add(); + anchorElement.removeAttribute('name'); + anchorElement.id = id; + editor.addVisual(); + editor.undoManager.add(); }; var insert = function (editor, id) { - var anchor = getNamedAnchor(editor); - if (anchor) { - updateAnchor(editor, id, anchor); - } else { - createAnchor(editor, id); - } - editor.focus(); + var anchor = getNamedAnchor(editor); + if (anchor) { + updateAnchor(editor, id, anchor); + } else { + createAnchor(editor, id); + } + editor.focus(); }; var insertAnchor = function (editor, newId) { - if (!isValidId(newId)) { - editor.windowManager.alert('Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.'); - return false; - } else { - insert(editor, newId); - return true; - } + if (!isValidId(newId)) { + editor.windowManager.alert('Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.'); + return false; + } else { + insert(editor, newId); + return true; + } }; var open = function (editor) { - var currentId = getId(editor); - editor.windowManager.open({ - title: 'Anchor', - size: 'normal', - body: { - type: 'panel', - items: [{ - name: 'id', - type: 'input', - label: 'ID', - placeholder: 'example' - }] - }, - buttons: [ - { - type: 'cancel', - name: 'cancel', - text: 'Cancel' - }, - { - type: 'submit', - name: 'save', - text: 'Save', - primary: true - } - ], - initialData: {id: currentId}, - onSubmit: function (api) { - if (insertAnchor(editor, api.getData().id)) { - api.close(); - } - } - }); + var currentId = getId(editor); + editor.windowManager.open({ + title: 'Anchor', + size: 'normal', + body: { + type: 'panel', + items: [{ + name: 'id', + type: 'input', + label: 'ID', + placeholder: 'example' + }] + }, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: { id: currentId }, + onSubmit: function (api) { + if (insertAnchor(editor, api.getData().id)) { + api.close(); + } + } + }); }; var register = function (editor) { - editor.addCommand('mceAnchor', function () { - open(editor); - }); + editor.addCommand('mceAnchor', function () { + open(editor); + }); }; var isNamedAnchorNode = function (node) { - return node && isEmptyString(node.attr('href')) && !isEmptyString(node.attr('id') || node.attr('name')); + return node && isEmptyString(node.attr('href')) && !isEmptyString(node.attr('id') || node.attr('name')); }; var isEmptyNamedAnchorNode = function (node) { - return isNamedAnchorNode(node) && !node.firstChild; + return isNamedAnchorNode(node) && !node.firstChild; }; var setContentEditable = function (state) { - return function (nodes) { - for (var i = 0; i < nodes.length; i++) { - var node = nodes[i]; - if (isEmptyNamedAnchorNode(node)) { - node.attr('contenteditable', state); - } - } - }; + return function (nodes) { + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + if (isEmptyNamedAnchorNode(node)) { + node.attr('contenteditable', state); + } + } + }; }; var setup = function (editor) { - editor.on('PreInit', function () { - editor.parser.addNodeFilter('a', setContentEditable('false')); - editor.serializer.addNodeFilter('a', setContentEditable(null)); - }); + editor.on('PreInit', function () { + editor.parser.addNodeFilter('a', setContentEditable('false')); + editor.serializer.addNodeFilter('a', setContentEditable(null)); + }); }; var registerFormats = function (editor) { - editor.formatter.register('namedAnchor', { - inline: 'a', - selector: namedAnchorSelector, - remove: 'all', - split: true, - deep: true, - attributes: {id: '%value'}, - onmatch: function (node, _fmt, _itemName) { - return isNamedAnchor(node); - } - }); + editor.formatter.register('namedAnchor', { + inline: 'a', + selector: namedAnchorSelector, + remove: 'all', + split: true, + deep: true, + attributes: { id: '%value' }, + onmatch: function (node, _fmt, _itemName) { + return isNamedAnchor(node); + } + }); }; var register$1 = function (editor) { - editor.ui.registry.addToggleButton('anchor', { - icon: 'bookmark', - tooltip: 'Anchor', - onAction: function () { - return editor.execCommand('mceAnchor'); - }, - onSetup: function (buttonApi) { - return editor.selection.selectorChangedWithUnbind('a:not([href])', buttonApi.setActive).unbind; - } - }); - editor.ui.registry.addMenuItem('anchor', { - icon: 'bookmark', - text: 'Anchor...', - onAction: function () { - return editor.execCommand('mceAnchor'); - } - }); + editor.ui.registry.addToggleButton('anchor', { + icon: 'bookmark', + tooltip: 'Anchor', + onAction: function () { + return editor.execCommand('mceAnchor'); + }, + onSetup: function (buttonApi) { + return editor.selection.selectorChangedWithUnbind('a:not([href])', buttonApi.setActive).unbind; + } + }); + editor.ui.registry.addMenuItem('anchor', { + icon: 'bookmark', + text: 'Anchor...', + onAction: function () { + return editor.execCommand('mceAnchor'); + } + }); }; - function Plugin() { - global.add('anchor', function (editor) { - setup(editor); - register(editor); - register$1(editor); - editor.on('PreInit', function () { - registerFormats(editor); - }); + function Plugin () { + global.add('anchor', function (editor) { + setup(editor); + register(editor); + register$1(editor); + editor.on('PreInit', function () { + registerFormats(editor); }); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/autolink/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/autolink/plugin.js index 96b69025..b63d25dc 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/autolink/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/autolink/plugin.js @@ -14,170 +14,170 @@ var global$1 = tinymce.util.Tools.resolve('tinymce.Env'); var getAutoLinkPattern = function (editor) { - return editor.getParam('autolink_pattern', /^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@(?!.*@))(.+)$/i); + return editor.getParam('autolink_pattern', /^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@(?!.*@))(.+)$/i); }; var getDefaultLinkTarget = function (editor) { - return editor.getParam('default_link_target', false); + return editor.getParam('default_link_target', false); }; var getDefaultLinkProtocol = function (editor) { - return editor.getParam('link_default_protocol', 'http', 'string'); + return editor.getParam('link_default_protocol', 'http', 'string'); }; var rangeEqualsDelimiterOrSpace = function (rangeString, delimiter) { - return rangeString === delimiter || rangeString === ' ' || rangeString.charCodeAt(0) === 160; + return rangeString === delimiter || rangeString === ' ' || rangeString.charCodeAt(0) === 160; }; var handleEclipse = function (editor) { - parseCurrentLine(editor, -1, '('); + parseCurrentLine(editor, -1, '('); }; var handleSpacebar = function (editor) { - parseCurrentLine(editor, 0, ''); + parseCurrentLine(editor, 0, ''); }; var handleEnter = function (editor) { - parseCurrentLine(editor, -1, ''); + parseCurrentLine(editor, -1, ''); }; var scopeIndex = function (container, index) { - if (index < 0) { - index = 0; + if (index < 0) { + index = 0; + } + if (container.nodeType === 3) { + var len = container.data.length; + if (index > len) { + index = len; } - if (container.nodeType === 3) { - var len = container.data.length; - if (index > len) { - index = len; - } - } - return index; + } + return index; }; var setStart = function (rng, container, offset) { - if (container.nodeType !== 1 || container.hasChildNodes()) { - rng.setStart(container, scopeIndex(container, offset)); - } else { - rng.setStartBefore(container); - } + if (container.nodeType !== 1 || container.hasChildNodes()) { + rng.setStart(container, scopeIndex(container, offset)); + } else { + rng.setStartBefore(container); + } }; var setEnd = function (rng, container, offset) { - if (container.nodeType !== 1 || container.hasChildNodes()) { - rng.setEnd(container, scopeIndex(container, offset)); - } else { - rng.setEndAfter(container); - } + if (container.nodeType !== 1 || container.hasChildNodes()) { + rng.setEnd(container, scopeIndex(container, offset)); + } else { + rng.setEndAfter(container); + } }; var parseCurrentLine = function (editor, endOffset, delimiter) { - var end, endContainer, bookmark, text, prev, len, rngText; - var autoLinkPattern = getAutoLinkPattern(editor); - var defaultLinkTarget = getDefaultLinkTarget(editor); - if (editor.selection.getNode().tagName === 'A') { + var end, endContainer, bookmark, text, prev, len, rngText; + var autoLinkPattern = getAutoLinkPattern(editor); + var defaultLinkTarget = getDefaultLinkTarget(editor); + if (editor.selection.getNode().tagName === 'A') { + return; + } + var rng = editor.selection.getRng().cloneRange(); + if (rng.startOffset < 5) { + prev = rng.endContainer.previousSibling; + if (!prev) { + if (!rng.endContainer.firstChild || !rng.endContainer.firstChild.nextSibling) { return; + } + prev = rng.endContainer.firstChild.nextSibling; } - var rng = editor.selection.getRng().cloneRange(); - if (rng.startOffset < 5) { - prev = rng.endContainer.previousSibling; - if (!prev) { - if (!rng.endContainer.firstChild || !rng.endContainer.firstChild.nextSibling) { - return; - } - prev = rng.endContainer.firstChild.nextSibling; - } - len = prev.length; - setStart(rng, prev, len); - setEnd(rng, prev, len); - if (rng.endOffset < 5) { - return; - } - end = rng.endOffset; - endContainer = prev; - } else { - endContainer = rng.endContainer; - if (endContainer.nodeType !== 3 && endContainer.firstChild) { - while (endContainer.nodeType !== 3 && endContainer.firstChild) { - endContainer = endContainer.firstChild; - } - if (endContainer.nodeType === 3) { - setStart(rng, endContainer, 0); - setEnd(rng, endContainer, endContainer.nodeValue.length); - } - } - if (rng.endOffset === 1) { - end = 2; - } else { - end = rng.endOffset - 1 - endOffset; - } + len = prev.length; + setStart(rng, prev, len); + setEnd(rng, prev, len); + if (rng.endOffset < 5) { + return; } - var start = end; - do { - setStart(rng, endContainer, end >= 2 ? end - 2 : 0); - setEnd(rng, endContainer, end >= 1 ? end - 1 : 0); - end -= 1; - rngText = rng.toString(); - } while (rngText !== ' ' && rngText !== '' && rngText.charCodeAt(0) !== 160 && end - 2 >= 0 && rngText !== delimiter); - if (rangeEqualsDelimiterOrSpace(rng.toString(), delimiter)) { - setStart(rng, endContainer, end); - setEnd(rng, endContainer, start); - end += 1; - } else if (rng.startOffset === 0) { + end = rng.endOffset; + endContainer = prev; + } else { + endContainer = rng.endContainer; + if (endContainer.nodeType !== 3 && endContainer.firstChild) { + while (endContainer.nodeType !== 3 && endContainer.firstChild) { + endContainer = endContainer.firstChild; + } + if (endContainer.nodeType === 3) { setStart(rng, endContainer, 0); - setEnd(rng, endContainer, start); + setEnd(rng, endContainer, endContainer.nodeValue.length); + } + } + if (rng.endOffset === 1) { + end = 2; } else { - setStart(rng, endContainer, end); - setEnd(rng, endContainer, start); + end = rng.endOffset - 1 - endOffset; } - text = rng.toString(); - if (text.charAt(text.length - 1) === '.') { - setEnd(rng, endContainer, start - 1); + } + var start = end; + do { + setStart(rng, endContainer, end >= 2 ? end - 2 : 0); + setEnd(rng, endContainer, end >= 1 ? end - 1 : 0); + end -= 1; + rngText = rng.toString(); + } while (rngText !== ' ' && rngText !== '' && rngText.charCodeAt(0) !== 160 && end - 2 >= 0 && rngText !== delimiter); + if (rangeEqualsDelimiterOrSpace(rng.toString(), delimiter)) { + setStart(rng, endContainer, end); + setEnd(rng, endContainer, start); + end += 1; + } else if (rng.startOffset === 0) { + setStart(rng, endContainer, 0); + setEnd(rng, endContainer, start); + } else { + setStart(rng, endContainer, end); + setEnd(rng, endContainer, start); + } + text = rng.toString(); + if (text.charAt(text.length - 1) === '.') { + setEnd(rng, endContainer, start - 1); + } + text = rng.toString().trim(); + var matches = text.match(autoLinkPattern); + var protocol = getDefaultLinkProtocol(editor); + if (matches) { + if (matches[1] === 'www.') { + matches[1] = protocol + '://www.'; + } else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) { + matches[1] = 'mailto:' + matches[1]; } - text = rng.toString().trim(); - var matches = text.match(autoLinkPattern); - var protocol = getDefaultLinkProtocol(editor); - if (matches) { - if (matches[1] === 'www.') { - matches[1] = protocol + '://www.'; - } else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) { - matches[1] = 'mailto:' + matches[1]; - } - bookmark = editor.selection.getBookmark(); - editor.selection.setRng(rng); - editor.execCommand('createlink', false, matches[1] + matches[2]); - if (defaultLinkTarget !== false) { - editor.dom.setAttrib(editor.selection.getNode(), 'target', defaultLinkTarget); - } - editor.selection.moveToBookmark(bookmark); - editor.nodeChanged(); + bookmark = editor.selection.getBookmark(); + editor.selection.setRng(rng); + editor.execCommand('createlink', false, matches[1] + matches[2]); + if (defaultLinkTarget !== false) { + editor.dom.setAttrib(editor.selection.getNode(), 'target', defaultLinkTarget); } + editor.selection.moveToBookmark(bookmark); + editor.nodeChanged(); + } }; var setup = function (editor) { - var autoUrlDetectState; - editor.on('keydown', function (e) { - if (e.keyCode === 13) { - return handleEnter(editor); - } - }); - if (global$1.browser.isIE()) { - editor.on('focus', function () { - if (!autoUrlDetectState) { - autoUrlDetectState = true; - try { - editor.execCommand('AutoUrlDetect', false, true); - } catch (ex) { - } - } - }); - return; + var autoUrlDetectState; + editor.on('keydown', function (e) { + if (e.keyCode === 13) { + return handleEnter(editor); } - editor.on('keypress', function (e) { - if (e.keyCode === 41) { - return handleEclipse(editor); - } - }); - editor.on('keyup', function (e) { - if (e.keyCode === 32) { - return handleSpacebar(editor); + }); + if (global$1.browser.isIE()) { + editor.on('focus', function () { + if (!autoUrlDetectState) { + autoUrlDetectState = true; + try { + editor.execCommand('AutoUrlDetect', false, true); + } catch (ex) { } + } }); + return; + } + editor.on('keypress', function (e) { + if (e.keyCode === 41) { + return handleEclipse(editor); + } + }); + editor.on('keyup', function (e) { + if (e.keyCode === 32) { + return handleSpacebar(editor); + } + }); }; - function Plugin() { - global.add('autolink', function (editor) { - setup(editor); - }); + function Plugin () { + global.add('autolink', function (editor) { + setup(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/autoresize/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/autoresize/plugin.js index c8dde200..786557af 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/autoresize/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/autoresize/plugin.js @@ -10,17 +10,17 @@ 'use strict'; var Cell = function (initial) { - var value = initial; - var get = function () { - return value; - }; - var set = function (v) { - value = v; - }; - return { - get: get, - set: set - }; + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; }; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); @@ -30,140 +30,140 @@ var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay'); var fireResizeEditor = function (editor) { - return editor.fire('ResizeEditor'); + return editor.fire('ResizeEditor'); }; var getAutoResizeMinHeight = function (editor) { - return editor.getParam('min_height', editor.getElement().offsetHeight, 'number'); + return editor.getParam('min_height', editor.getElement().offsetHeight, 'number'); }; var getAutoResizeMaxHeight = function (editor) { - return editor.getParam('max_height', 0, 'number'); + return editor.getParam('max_height', 0, 'number'); }; var getAutoResizeOverflowPadding = function (editor) { - return editor.getParam('autoresize_overflow_padding', 1, 'number'); + return editor.getParam('autoresize_overflow_padding', 1, 'number'); }; var getAutoResizeBottomMargin = function (editor) { - return editor.getParam('autoresize_bottom_margin', 50, 'number'); + return editor.getParam('autoresize_bottom_margin', 50, 'number'); }; var shouldAutoResizeOnInit = function (editor) { - return editor.getParam('autoresize_on_init', true, 'boolean'); + return editor.getParam('autoresize_on_init', true, 'boolean'); }; var isFullscreen = function (editor) { - return editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen(); + return editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen(); }; var wait = function (editor, oldSize, times, interval, callback) { - global$2.setEditorTimeout(editor, function () { - resize(editor, oldSize); - if (times--) { - wait(editor, oldSize, times, interval, callback); - } else if (callback) { - callback(); - } - }, interval); + global$2.setEditorTimeout(editor, function () { + resize(editor, oldSize); + if (times--) { + wait(editor, oldSize, times, interval, callback); + } else if (callback) { + callback(); + } + }, interval); }; var toggleScrolling = function (editor, state) { - var body = editor.getBody(); - if (body) { - body.style.overflowY = state ? '' : 'hidden'; - if (!state) { - body.scrollTop = 0; - } + var body = editor.getBody(); + if (body) { + body.style.overflowY = state ? '' : 'hidden'; + if (!state) { + body.scrollTop = 0; } + } }; var parseCssValueToInt = function (dom, elm, name, computed) { - var value = parseInt(dom.getStyle(elm, name, computed), 10); - return isNaN(value) ? 0 : value; + var value = parseInt(dom.getStyle(elm, name, computed), 10); + return isNaN(value) ? 0 : value; }; var resize = function (editor, oldSize) { - var dom = editor.dom; - var doc = editor.getDoc(); - if (!doc) { - return; - } - if (isFullscreen(editor)) { - toggleScrolling(editor, true); - return; - } - var docEle = doc.documentElement; - var resizeBottomMargin = getAutoResizeBottomMargin(editor); - var resizeHeight = getAutoResizeMinHeight(editor); - var marginTop = parseCssValueToInt(dom, docEle, 'margin-top', true); - var marginBottom = parseCssValueToInt(dom, docEle, 'margin-bottom', true); - var contentHeight = docEle.offsetHeight + marginTop + marginBottom + resizeBottomMargin; - if (contentHeight < 0) { - contentHeight = 0; + var dom = editor.dom; + var doc = editor.getDoc(); + if (!doc) { + return; + } + if (isFullscreen(editor)) { + toggleScrolling(editor, true); + return; + } + var docEle = doc.documentElement; + var resizeBottomMargin = getAutoResizeBottomMargin(editor); + var resizeHeight = getAutoResizeMinHeight(editor); + var marginTop = parseCssValueToInt(dom, docEle, 'margin-top', true); + var marginBottom = parseCssValueToInt(dom, docEle, 'margin-bottom', true); + var contentHeight = docEle.offsetHeight + marginTop + marginBottom + resizeBottomMargin; + if (contentHeight < 0) { + contentHeight = 0; + } + var containerHeight = editor.getContainer().offsetHeight; + var contentAreaHeight = editor.getContentAreaContainer().offsetHeight; + var chromeHeight = containerHeight - contentAreaHeight; + if (contentHeight + chromeHeight > getAutoResizeMinHeight(editor)) { + resizeHeight = contentHeight + chromeHeight; + } + var maxHeight = getAutoResizeMaxHeight(editor); + if (maxHeight && resizeHeight > maxHeight) { + resizeHeight = maxHeight; + toggleScrolling(editor, true); + } else { + toggleScrolling(editor, false); + } + if (resizeHeight !== oldSize.get()) { + var deltaSize = resizeHeight - oldSize.get(); + dom.setStyle(editor.getContainer(), 'height', resizeHeight + 'px'); + oldSize.set(resizeHeight); + fireResizeEditor(editor); + if (global$1.browser.isSafari() && global$1.mac) { + var win = editor.getWin(); + win.scrollTo(win.pageXOffset, win.pageYOffset); } - var containerHeight = editor.getContainer().offsetHeight; - var contentAreaHeight = editor.getContentAreaContainer().offsetHeight; - var chromeHeight = containerHeight - contentAreaHeight; - if (contentHeight + chromeHeight > getAutoResizeMinHeight(editor)) { - resizeHeight = contentHeight + chromeHeight; + if (editor.hasFocus()) { + editor.selection.scrollIntoView(editor.selection.getNode()); } - var maxHeight = getAutoResizeMaxHeight(editor); - if (maxHeight && resizeHeight > maxHeight) { - resizeHeight = maxHeight; - toggleScrolling(editor, true); - } else { - toggleScrolling(editor, false); - } - if (resizeHeight !== oldSize.get()) { - var deltaSize = resizeHeight - oldSize.get(); - dom.setStyle(editor.getContainer(), 'height', resizeHeight + 'px'); - oldSize.set(resizeHeight); - fireResizeEditor(editor); - if (global$1.browser.isSafari() && global$1.mac) { - var win = editor.getWin(); - win.scrollTo(win.pageXOffset, win.pageYOffset); - } - if (editor.hasFocus()) { - editor.selection.scrollIntoView(editor.selection.getNode()); - } - if (global$1.webkit && deltaSize < 0) { - resize(editor, oldSize); - } + if (global$1.webkit && deltaSize < 0) { + resize(editor, oldSize); } + } }; var setup = function (editor, oldSize) { - editor.on('init', function () { - var overflowPadding = getAutoResizeOverflowPadding(editor); - var dom = editor.dom; - dom.setStyles(editor.getDoc().documentElement, {height: 'auto'}); - dom.setStyles(editor.getBody(), { - 'paddingLeft': overflowPadding, - 'paddingRight': overflowPadding, - 'min-height': 0 - }); + editor.on('init', function () { + var overflowPadding = getAutoResizeOverflowPadding(editor); + var dom = editor.dom; + dom.setStyles(editor.getDoc().documentElement, { height: 'auto' }); + dom.setStyles(editor.getBody(), { + 'paddingLeft': overflowPadding, + 'paddingRight': overflowPadding, + 'min-height': 0 }); - editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent', function () { - resize(editor, oldSize); + }); + editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent', function () { + resize(editor, oldSize); + }); + if (shouldAutoResizeOnInit(editor)) { + editor.on('init', function () { + wait(editor, oldSize, 20, 100, function () { + wait(editor, oldSize, 5, 1000); + }); }); - if (shouldAutoResizeOnInit(editor)) { - editor.on('init', function () { - wait(editor, oldSize, 20, 100, function () { - wait(editor, oldSize, 5, 1000); - }); - }); - } + } }; var register = function (editor, oldSize) { - editor.addCommand('mceAutoResize', function () { - resize(editor, oldSize); - }); + editor.addCommand('mceAutoResize', function () { + resize(editor, oldSize); + }); }; - function Plugin() { - global.add('autoresize', function (editor) { - if (!editor.settings.hasOwnProperty('resize')) { - editor.settings.resize = false; - } - if (!editor.inline) { - var oldSize = Cell(0); - register(editor, oldSize); - setup(editor, oldSize); - } - }); + function Plugin () { + global.add('autoresize', function (editor) { + if (!editor.settings.hasOwnProperty('resize')) { + editor.settings.resize = false; + } + if (!editor.inline) { + var oldSize = Cell(0); + register(editor, oldSize); + setup(editor, oldSize); + } + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/autosave/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/autosave/plugin.js index b75b2671..84b993a4 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/autosave/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/autosave/plugin.js @@ -12,9 +12,9 @@ var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var eq = function (t) { - return function (a) { - return t === a; - }; + return function (a) { + return t === a; + }; }; var isUndefined = eq(undefined); @@ -25,186 +25,186 @@ var global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var fireRestoreDraft = function (editor) { - return editor.fire('RestoreDraft'); + return editor.fire('RestoreDraft'); }; var fireStoreDraft = function (editor) { - return editor.fire('StoreDraft'); + return editor.fire('StoreDraft'); }; var fireRemoveDraft = function (editor) { - return editor.fire('RemoveDraft'); + return editor.fire('RemoveDraft'); }; var parse = function (timeString, defaultTime) { - var multiples = { - s: 1000, - m: 60000 - }; - var toParse = timeString || defaultTime; - var parsedTime = /^(\d+)([ms]?)$/.exec('' + toParse); - return (parsedTime[2] ? multiples[parsedTime[2]] : 1) * parseInt(toParse, 10); + var multiples = { + s: 1000, + m: 60000 + }; + var toParse = timeString || defaultTime; + var parsedTime = /^(\d+)([ms]?)$/.exec('' + toParse); + return (parsedTime[2] ? multiples[parsedTime[2]] : 1) * parseInt(toParse, 10); }; var shouldAskBeforeUnload = function (editor) { - return editor.getParam('autosave_ask_before_unload', true); + return editor.getParam('autosave_ask_before_unload', true); }; var getAutoSavePrefix = function (editor) { - var location = document.location; - return editor.getParam('autosave_prefix', 'tinymce-autosave-{path}{query}{hash}-{id}-').replace(/{path}/g, location.pathname).replace(/{query}/g, location.search).replace(/{hash}/g, location.hash).replace(/{id}/g, editor.id); + var location = document.location; + return editor.getParam('autosave_prefix', 'tinymce-autosave-{path}{query}{hash}-{id}-').replace(/{path}/g, location.pathname).replace(/{query}/g, location.search).replace(/{hash}/g, location.hash).replace(/{id}/g, editor.id); }; var shouldRestoreWhenEmpty = function (editor) { - return editor.getParam('autosave_restore_when_empty', false); + return editor.getParam('autosave_restore_when_empty', false); }; var getAutoSaveInterval = function (editor) { - return parse(editor.getParam('autosave_interval'), '30s'); + return parse(editor.getParam('autosave_interval'), '30s'); }; var getAutoSaveRetention = function (editor) { - return parse(editor.getParam('autosave_retention'), '20m'); + return parse(editor.getParam('autosave_retention'), '20m'); }; var isEmpty = function (editor, html) { - if (isUndefined(html)) { - return editor.dom.isEmpty(editor.getBody()); + if (isUndefined(html)) { + return editor.dom.isEmpty(editor.getBody()); + } else { + var trimmedHtml = global$3.trim(html); + if (trimmedHtml === '') { + return true; } else { - var trimmedHtml = global$3.trim(html); - if (trimmedHtml === '') { - return true; - } else { - var fragment = new DOMParser().parseFromString(trimmedHtml, 'text/html'); - return editor.dom.isEmpty(fragment); - } + var fragment = new DOMParser().parseFromString(trimmedHtml, 'text/html'); + return editor.dom.isEmpty(fragment); } + } }; var hasDraft = function (editor) { - var time = parseInt(global$2.getItem(getAutoSavePrefix(editor) + 'time'), 10) || 0; - if (new Date().getTime() - time > getAutoSaveRetention(editor)) { - removeDraft(editor, false); - return false; - } - return true; + var time = parseInt(global$2.getItem(getAutoSavePrefix(editor) + 'time'), 10) || 0; + if (new Date().getTime() - time > getAutoSaveRetention(editor)) { + removeDraft(editor, false); + return false; + } + return true; }; var removeDraft = function (editor, fire) { - var prefix = getAutoSavePrefix(editor); - global$2.removeItem(prefix + 'draft'); - global$2.removeItem(prefix + 'time'); - if (fire !== false) { - fireRemoveDraft(editor); - } + var prefix = getAutoSavePrefix(editor); + global$2.removeItem(prefix + 'draft'); + global$2.removeItem(prefix + 'time'); + if (fire !== false) { + fireRemoveDraft(editor); + } }; var storeDraft = function (editor) { - var prefix = getAutoSavePrefix(editor); - if (!isEmpty(editor) && editor.isDirty()) { - global$2.setItem(prefix + 'draft', editor.getContent({ - format: 'raw', - no_events: true - })); - global$2.setItem(prefix + 'time', new Date().getTime().toString()); - fireStoreDraft(editor); - } + var prefix = getAutoSavePrefix(editor); + if (!isEmpty(editor) && editor.isDirty()) { + global$2.setItem(prefix + 'draft', editor.getContent({ + format: 'raw', + no_events: true + })); + global$2.setItem(prefix + 'time', new Date().getTime().toString()); + fireStoreDraft(editor); + } }; var restoreDraft = function (editor) { - var prefix = getAutoSavePrefix(editor); - if (hasDraft(editor)) { - editor.setContent(global$2.getItem(prefix + 'draft'), {format: 'raw'}); - fireRestoreDraft(editor); - } + var prefix = getAutoSavePrefix(editor); + if (hasDraft(editor)) { + editor.setContent(global$2.getItem(prefix + 'draft'), { format: 'raw' }); + fireRestoreDraft(editor); + } }; var startStoreDraft = function (editor) { - var interval = getAutoSaveInterval(editor); - global$1.setEditorInterval(editor, function () { - storeDraft(editor); - }, interval); + var interval = getAutoSaveInterval(editor); + global$1.setEditorInterval(editor, function () { + storeDraft(editor); + }, interval); }; var restoreLastDraft = function (editor) { - editor.undoManager.transact(function () { - restoreDraft(editor); - removeDraft(editor); - }); - editor.focus(); + editor.undoManager.transact(function () { + restoreDraft(editor); + removeDraft(editor); + }); + editor.focus(); }; var get = function (editor) { - return { - hasDraft: function () { - return hasDraft(editor); - }, - storeDraft: function () { - return storeDraft(editor); - }, - restoreDraft: function () { - return restoreDraft(editor); - }, - removeDraft: function (fire) { - return removeDraft(editor, fire); - }, - isEmpty: function (html) { - return isEmpty(editor, html); - } - }; + return { + hasDraft: function () { + return hasDraft(editor); + }, + storeDraft: function () { + return storeDraft(editor); + }, + restoreDraft: function () { + return restoreDraft(editor); + }, + removeDraft: function (fire) { + return removeDraft(editor, fire); + }, + isEmpty: function (html) { + return isEmpty(editor, html); + } + }; }; var global$4 = tinymce.util.Tools.resolve('tinymce.EditorManager'); var setup = function (editor) { - editor.editorManager.on('BeforeUnload', function (e) { - var msg; - global$3.each(global$4.get(), function (editor) { - if (editor.plugins.autosave) { - editor.plugins.autosave.storeDraft(); - } - if (!msg && editor.isDirty() && shouldAskBeforeUnload(editor)) { - msg = editor.translate('You have unsaved changes are you sure you want to navigate away?'); - } - }); - if (msg) { - e.preventDefault(); - e.returnValue = msg; - } + editor.editorManager.on('BeforeUnload', function (e) { + var msg; + global$3.each(global$4.get(), function (editor) { + if (editor.plugins.autosave) { + editor.plugins.autosave.storeDraft(); + } + if (!msg && editor.isDirty() && shouldAskBeforeUnload(editor)) { + msg = editor.translate('You have unsaved changes are you sure you want to navigate away?'); + } }); + if (msg) { + e.preventDefault(); + e.returnValue = msg; + } + }); }; var makeSetupHandler = function (editor) { - return function (api) { - api.setDisabled(!hasDraft(editor)); - var editorEventCallback = function () { - return api.setDisabled(!hasDraft(editor)); - }; - editor.on('StoreDraft RestoreDraft RemoveDraft', editorEventCallback); - return function () { - return editor.off('StoreDraft RestoreDraft RemoveDraft', editorEventCallback); - }; + return function (api) { + api.setDisabled(!hasDraft(editor)); + var editorEventCallback = function () { + return api.setDisabled(!hasDraft(editor)); }; + editor.on('StoreDraft RestoreDraft RemoveDraft', editorEventCallback); + return function () { + return editor.off('StoreDraft RestoreDraft RemoveDraft', editorEventCallback); + }; + }; }; var register = function (editor) { - startStoreDraft(editor); - editor.ui.registry.addButton('restoredraft', { - tooltip: 'Restore last draft', - icon: 'restore-draft', - onAction: function () { - restoreLastDraft(editor); - }, - onSetup: makeSetupHandler(editor) - }); - editor.ui.registry.addMenuItem('restoredraft', { - text: 'Restore last draft', - icon: 'restore-draft', - onAction: function () { - restoreLastDraft(editor); - }, - onSetup: makeSetupHandler(editor) - }); - }; - - function Plugin() { - global.add('autosave', function (editor) { - setup(editor); - register(editor); - editor.on('init', function () { - if (shouldRestoreWhenEmpty(editor) && editor.dom.isEmpty(editor.getBody())) { - restoreDraft(editor); - } - }); - return get(editor); + startStoreDraft(editor); + editor.ui.registry.addButton('restoredraft', { + tooltip: 'Restore last draft', + icon: 'restore-draft', + onAction: function () { + restoreLastDraft(editor); + }, + onSetup: makeSetupHandler(editor) + }); + editor.ui.registry.addMenuItem('restoredraft', { + text: 'Restore last draft', + icon: 'restore-draft', + onAction: function () { + restoreLastDraft(editor); + }, + onSetup: makeSetupHandler(editor) + }); + }; + + function Plugin () { + global.add('autosave', function (editor) { + setup(editor); + register(editor); + editor.on('init', function () { + if (shouldRestoreWhenEmpty(editor) && editor.dom.isEmpty(editor.getBody())) { + restoreDraft(editor); + } }); + return get(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/bbcode/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/bbcode/plugin.js index 5c832936..5b7ac223 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/bbcode/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/bbcode/plugin.js @@ -14,84 +14,84 @@ var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var html2bbcode = function (s) { - s = global$1.trim(s); - var rep = function (re, str) { - s = s.replace(re, str); - }; - rep(/(.*?)<\/a>/gi, '[url=$1]$2[/url]'); - rep(/(.*?)<\/font>/gi, '[code][color=$1]$2[/color][/code]'); - rep(/(.*?)<\/font>/gi, '[quote][color=$1]$2[/color][/quote]'); - rep(/(.*?)<\/font>/gi, '[code][color=$1]$2[/color][/code]'); - rep(/(.*?)<\/font>/gi, '[quote][color=$1]$2[/color][/quote]'); - rep(/(.*?)<\/span>/gi, '[color=$1]$2[/color]'); - rep(/(.*?)<\/font>/gi, '[color=$1]$2[/color]'); - rep(/(.*?)<\/span>/gi, '[size=$1]$2[/size]'); - rep(/(.*?)<\/font>/gi, '$1'); - rep(//gi, '[img]$1[/img]'); - rep(/(.*?)<\/span>/gi, '[code]$1[/code]'); - rep(/(.*?)<\/span>/gi, '[quote]$1[/quote]'); - rep(/(.*?)<\/strong>/gi, '[code][b]$1[/b][/code]'); - rep(/(.*?)<\/strong>/gi, '[quote][b]$1[/b][/quote]'); - rep(/(.*?)<\/em>/gi, '[code][i]$1[/i][/code]'); - rep(/(.*?)<\/em>/gi, '[quote][i]$1[/i][/quote]'); - rep(/(.*?)<\/u>/gi, '[code][u]$1[/u][/code]'); - rep(/(.*?)<\/u>/gi, '[quote][u]$1[/u][/quote]'); - rep(/<\/(strong|b)>/gi, '[/b]'); - rep(/<(strong|b)>/gi, '[b]'); - rep(/<\/(em|i)>/gi, '[/i]'); - rep(/<(em|i)>/gi, '[i]'); - rep(/<\/u>/gi, '[/u]'); - rep(/(.*?)<\/span>/gi, '[u]$1[/u]'); - rep(//gi, '[u]'); - rep(/]*>/gi, '[quote]'); - rep(/<\/blockquote>/gi, '[/quote]'); - rep(/
              /gi, '\n'); - rep(//gi, '\n'); - rep(/
              /gi, '\n'); - rep(/

              /gi, ''); - rep(/<\/p>/gi, '\n'); - rep(/ |\u00a0/gi, ' '); - rep(/"/gi, '"'); - rep(/</gi, '<'); - rep(/>/gi, '>'); - rep(/&/gi, '&'); - return s; + s = global$1.trim(s); + var rep = function (re, str) { + s = s.replace(re, str); + }; + rep(/(.*?)<\/a>/gi, '[url=$1]$2[/url]'); + rep(/(.*?)<\/font>/gi, '[code][color=$1]$2[/color][/code]'); + rep(/(.*?)<\/font>/gi, '[quote][color=$1]$2[/color][/quote]'); + rep(/(.*?)<\/font>/gi, '[code][color=$1]$2[/color][/code]'); + rep(/(.*?)<\/font>/gi, '[quote][color=$1]$2[/color][/quote]'); + rep(/(.*?)<\/span>/gi, '[color=$1]$2[/color]'); + rep(/(.*?)<\/font>/gi, '[color=$1]$2[/color]'); + rep(/(.*?)<\/span>/gi, '[size=$1]$2[/size]'); + rep(/(.*?)<\/font>/gi, '$1'); + rep(//gi, '[img]$1[/img]'); + rep(/(.*?)<\/span>/gi, '[code]$1[/code]'); + rep(/(.*?)<\/span>/gi, '[quote]$1[/quote]'); + rep(/(.*?)<\/strong>/gi, '[code][b]$1[/b][/code]'); + rep(/(.*?)<\/strong>/gi, '[quote][b]$1[/b][/quote]'); + rep(/(.*?)<\/em>/gi, '[code][i]$1[/i][/code]'); + rep(/(.*?)<\/em>/gi, '[quote][i]$1[/i][/quote]'); + rep(/(.*?)<\/u>/gi, '[code][u]$1[/u][/code]'); + rep(/(.*?)<\/u>/gi, '[quote][u]$1[/u][/quote]'); + rep(/<\/(strong|b)>/gi, '[/b]'); + rep(/<(strong|b)>/gi, '[b]'); + rep(/<\/(em|i)>/gi, '[/i]'); + rep(/<(em|i)>/gi, '[i]'); + rep(/<\/u>/gi, '[/u]'); + rep(/(.*?)<\/span>/gi, '[u]$1[/u]'); + rep(//gi, '[u]'); + rep(/]*>/gi, '[quote]'); + rep(/<\/blockquote>/gi, '[/quote]'); + rep(/
              /gi, '\n'); + rep(//gi, '\n'); + rep(/
              /gi, '\n'); + rep(/

              /gi, ''); + rep(/<\/p>/gi, '\n'); + rep(/ |\u00a0/gi, ' '); + rep(/"/gi, '"'); + rep(/</gi, '<'); + rep(/>/gi, '>'); + rep(/&/gi, '&'); + return s; }; var bbcode2html = function (s) { - s = global$1.trim(s); - var rep = function (re, str) { - s = s.replace(re, str); - }; - rep(/\n/gi, '
              '); - rep(/\[b\]/gi, ''); - rep(/\[\/b\]/gi, ''); - rep(/\[i\]/gi, ''); - rep(/\[\/i\]/gi, ''); - rep(/\[u\]/gi, ''); - rep(/\[\/u\]/gi, ''); - rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi, '$2'); - rep(/\[url\](.*?)\[\/url\]/gi, '$1'); - rep(/\[img\](.*?)\[\/img\]/gi, ''); - rep(/\[color=(.*?)\](.*?)\[\/color\]/gi, '$2'); - rep(/\[code\](.*?)\[\/code\]/gi, '$1 '); - rep(/\[quote.*?\](.*?)\[\/quote\]/gi, '$1 '); - return s; + s = global$1.trim(s); + var rep = function (re, str) { + s = s.replace(re, str); + }; + rep(/\n/gi, '
              '); + rep(/\[b\]/gi, ''); + rep(/\[\/b\]/gi, ''); + rep(/\[i\]/gi, ''); + rep(/\[\/i\]/gi, ''); + rep(/\[u\]/gi, ''); + rep(/\[\/u\]/gi, ''); + rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi, '$2'); + rep(/\[url\](.*?)\[\/url\]/gi, '$1'); + rep(/\[img\](.*?)\[\/img\]/gi, ''); + rep(/\[color=(.*?)\](.*?)\[\/color\]/gi, '$2'); + rep(/\[code\](.*?)\[\/code\]/gi, '$1 '); + rep(/\[quote.*?\](.*?)\[\/quote\]/gi, '$1 '); + return s; }; - function Plugin() { - global.add('bbcode', function (editor) { - editor.on('BeforeSetContent', function (e) { - e.content = bbcode2html(e.content); - }); - editor.on('PostProcess', function (e) { - if (e.set) { - e.content = bbcode2html(e.content); - } - if (e.get) { - e.content = html2bbcode(e.content); - } - }); + function Plugin () { + global.add('bbcode', function (editor) { + editor.on('BeforeSetContent', function (e) { + e.content = bbcode2html(e.content); }); + editor.on('PostProcess', function (e) { + if (e.set) { + e.content = bbcode2html(e.content); + } + if (e.get) { + e.content = html2bbcode(e.content); + } + }); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/charmap/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/charmap/plugin.js index 73db9efd..cceb2ec1 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/charmap/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/charmap/plugin.js @@ -12,1693 +12,1693 @@ var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var fireInsertCustomChar = function (editor, chr) { - return editor.fire('insertCustomChar', {chr: chr}); + return editor.fire('insertCustomChar', { chr: chr }); }; var insertChar = function (editor, chr) { - var evtChr = fireInsertCustomChar(editor, chr).chr; - editor.execCommand('mceInsertContent', false, evtChr); + var evtChr = fireInsertCustomChar(editor, chr).chr; + editor.execCommand('mceInsertContent', false, evtChr); }; var noop = function () { }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; var never = constant(false); var always = constant(true); var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var typeOf = function (x) { - var t = typeof x; - if (x === null) { - return 'null'; - } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { - return 'array'; - } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { - return 'string'; - } else { - return t; - } + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } }; var isType = function (type) { - return function (value) { - return typeOf(value) === type; - }; + return function (value) { + return typeOf(value) === type; + }; }; var isArray = isType('array'); var nativePush = Array.prototype.push; var map = function (xs, f) { - var len = xs.length; - var r = new Array(len); - for (var i = 0; i < len; i++) { - var x = xs[i]; - r[i] = f(x, i); - } - return r; + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; }; var each = function (xs, f) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - f(x, i); - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } }; var findUntil = function (xs, pred, until) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - return Optional.some(x); - } else if (until(x, i)) { - break; - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(x); + } else if (until(x, i)) { + break; } - return Optional.none(); + } + return Optional.none(); }; var find = function (xs, pred) { - return findUntil(xs, pred, never); + return findUntil(xs, pred, never); }; var flatten = function (xs) { - var r = []; - for (var i = 0, len = xs.length; i < len; ++i) { - if (!isArray(xs[i])) { - throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); - } - nativePush.apply(r, xs[i]); + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); } - return r; + nativePush.apply(r, xs[i]); + } + return r; }; var bind = function (xs, f) { - return flatten(map(xs, f)); + return flatten(map(xs, f)); }; var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var getCharMap = function (editor) { - return editor.getParam('charmap'); + return editor.getParam('charmap'); }; var getCharMapAppend = function (editor) { - return editor.getParam('charmap_append'); + return editor.getParam('charmap_append'); }; var isArray$1 = global$1.isArray; var UserDefined = 'User Defined'; var getDefaultCharMap = function () { - return [ - { - name: 'Currency', - characters: [ - [ - 36, - 'dollar sign' - ], - [ - 162, - 'cent sign' - ], - [ - 8364, - 'euro sign' - ], - [ - 163, - 'pound sign' - ], - [ - 165, - 'yen sign' - ], - [ - 164, - 'currency sign' - ], - [ - 8352, - 'euro-currency sign' - ], - [ - 8353, - 'colon sign' - ], - [ - 8354, - 'cruzeiro sign' - ], - [ - 8355, - 'french franc sign' - ], - [ - 8356, - 'lira sign' - ], - [ - 8357, - 'mill sign' - ], - [ - 8358, - 'naira sign' - ], - [ - 8359, - 'peseta sign' - ], - [ - 8360, - 'rupee sign' - ], - [ - 8361, - 'won sign' - ], - [ - 8362, - 'new sheqel sign' - ], - [ - 8363, - 'dong sign' - ], - [ - 8365, - 'kip sign' - ], - [ - 8366, - 'tugrik sign' - ], - [ - 8367, - 'drachma sign' - ], - [ - 8368, - 'german penny symbol' - ], - [ - 8369, - 'peso sign' - ], - [ - 8370, - 'guarani sign' - ], - [ - 8371, - 'austral sign' - ], - [ - 8372, - 'hryvnia sign' - ], - [ - 8373, - 'cedi sign' - ], - [ - 8374, - 'livre tournois sign' - ], - [ - 8375, - 'spesmilo sign' - ], - [ - 8376, - 'tenge sign' - ], - [ - 8377, - 'indian rupee sign' - ], - [ - 8378, - 'turkish lira sign' - ], - [ - 8379, - 'nordic mark sign' - ], - [ - 8380, - 'manat sign' - ], - [ - 8381, - 'ruble sign' - ], - [ - 20870, - 'yen character' - ], - [ - 20803, - 'yuan character' - ], - [ - 22291, - 'yuan character, in hong kong and taiwan' - ], - [ - 22278, - 'yen/yuan character variant one' - ] - ] - }, - { - name: 'Text', - characters: [ - [ - 169, - 'copyright sign' - ], - [ - 174, - 'registered sign' - ], - [ - 8482, - 'trade mark sign' - ], - [ - 8240, - 'per mille sign' - ], - [ - 181, - 'micro sign' - ], - [ - 183, - 'middle dot' - ], - [ - 8226, - 'bullet' - ], - [ - 8230, - 'three dot leader' - ], - [ - 8242, - 'minutes / feet' - ], - [ - 8243, - 'seconds / inches' - ], - [ - 167, - 'section sign' - ], - [ - 182, - 'paragraph sign' - ], - [ - 223, - 'sharp s / ess-zed' - ] - ] - }, - { - name: 'Quotations', - characters: [ - [ - 8249, - 'single left-pointing angle quotation mark' - ], - [ - 8250, - 'single right-pointing angle quotation mark' - ], - [ - 171, - 'left pointing guillemet' - ], - [ - 187, - 'right pointing guillemet' - ], - [ - 8216, - 'left single quotation mark' - ], - [ - 8217, - 'right single quotation mark' - ], - [ - 8220, - 'left double quotation mark' - ], - [ - 8221, - 'right double quotation mark' - ], - [ - 8218, - 'single low-9 quotation mark' - ], - [ - 8222, - 'double low-9 quotation mark' - ], - [ - 60, - 'less-than sign' - ], - [ - 62, - 'greater-than sign' - ], - [ - 8804, - 'less-than or equal to' - ], - [ - 8805, - 'greater-than or equal to' - ], - [ - 8211, - 'en dash' - ], - [ - 8212, - 'em dash' - ], - [ - 175, - 'macron' - ], - [ - 8254, - 'overline' - ], - [ - 164, - 'currency sign' - ], - [ - 166, - 'broken bar' - ], - [ - 168, - 'diaeresis' - ], - [ - 161, - 'inverted exclamation mark' - ], - [ - 191, - 'turned question mark' - ], - [ - 710, - 'circumflex accent' - ], - [ - 732, - 'small tilde' - ], - [ - 176, - 'degree sign' - ], - [ - 8722, - 'minus sign' - ], - [ - 177, - 'plus-minus sign' - ], - [ - 247, - 'division sign' - ], - [ - 8260, - 'fraction slash' - ], - [ - 215, - 'multiplication sign' - ], - [ - 185, - 'superscript one' - ], - [ - 178, - 'superscript two' - ], - [ - 179, - 'superscript three' - ], - [ - 188, - 'fraction one quarter' - ], - [ - 189, - 'fraction one half' - ], - [ - 190, - 'fraction three quarters' - ] - ] - }, - { - name: 'Mathematical', - characters: [ - [ - 402, - 'function / florin' - ], - [ - 8747, - 'integral' - ], - [ - 8721, - 'n-ary sumation' - ], - [ - 8734, - 'infinity' - ], - [ - 8730, - 'square root' - ], - [ - 8764, - 'similar to' - ], - [ - 8773, - 'approximately equal to' - ], - [ - 8776, - 'almost equal to' - ], - [ - 8800, - 'not equal to' - ], - [ - 8801, - 'identical to' - ], - [ - 8712, - 'element of' - ], - [ - 8713, - 'not an element of' - ], - [ - 8715, - 'contains as member' - ], - [ - 8719, - 'n-ary product' - ], - [ - 8743, - 'logical and' - ], - [ - 8744, - 'logical or' - ], - [ - 172, - 'not sign' - ], - [ - 8745, - 'intersection' - ], - [ - 8746, - 'union' - ], - [ - 8706, - 'partial differential' - ], - [ - 8704, - 'for all' - ], - [ - 8707, - 'there exists' - ], - [ - 8709, - 'diameter' - ], - [ - 8711, - 'backward difference' - ], - [ - 8727, - 'asterisk operator' - ], - [ - 8733, - 'proportional to' - ], - [ - 8736, - 'angle' - ] - ] - }, - { - name: 'Extended Latin', - characters: [ - [ - 192, - 'A - grave' - ], - [ - 193, - 'A - acute' - ], - [ - 194, - 'A - circumflex' - ], - [ - 195, - 'A - tilde' - ], - [ - 196, - 'A - diaeresis' - ], - [ - 197, - 'A - ring above' - ], - [ - 256, - 'A - macron' - ], - [ - 198, - 'ligature AE' - ], - [ - 199, - 'C - cedilla' - ], - [ - 200, - 'E - grave' - ], - [ - 201, - 'E - acute' - ], - [ - 202, - 'E - circumflex' - ], - [ - 203, - 'E - diaeresis' - ], - [ - 274, - 'E - macron' - ], - [ - 204, - 'I - grave' - ], - [ - 205, - 'I - acute' - ], - [ - 206, - 'I - circumflex' - ], - [ - 207, - 'I - diaeresis' - ], - [ - 298, - 'I - macron' - ], - [ - 208, - 'ETH' - ], - [ - 209, - 'N - tilde' - ], - [ - 210, - 'O - grave' - ], - [ - 211, - 'O - acute' - ], - [ - 212, - 'O - circumflex' - ], - [ - 213, - 'O - tilde' - ], - [ - 214, - 'O - diaeresis' - ], - [ - 216, - 'O - slash' - ], - [ - 332, - 'O - macron' - ], - [ - 338, - 'ligature OE' - ], - [ - 352, - 'S - caron' - ], - [ - 217, - 'U - grave' - ], - [ - 218, - 'U - acute' - ], - [ - 219, - 'U - circumflex' - ], - [ - 220, - 'U - diaeresis' - ], - [ - 362, - 'U - macron' - ], - [ - 221, - 'Y - acute' - ], - [ - 376, - 'Y - diaeresis' - ], - [ - 562, - 'Y - macron' - ], - [ - 222, - 'THORN' - ], - [ - 224, - 'a - grave' - ], - [ - 225, - 'a - acute' - ], - [ - 226, - 'a - circumflex' - ], - [ - 227, - 'a - tilde' - ], - [ - 228, - 'a - diaeresis' - ], - [ - 229, - 'a - ring above' - ], - [ - 257, - 'a - macron' - ], - [ - 230, - 'ligature ae' - ], - [ - 231, - 'c - cedilla' - ], - [ - 232, - 'e - grave' - ], - [ - 233, - 'e - acute' - ], - [ - 234, - 'e - circumflex' - ], - [ - 235, - 'e - diaeresis' - ], - [ - 275, - 'e - macron' - ], - [ - 236, - 'i - grave' - ], - [ - 237, - 'i - acute' - ], - [ - 238, - 'i - circumflex' - ], - [ - 239, - 'i - diaeresis' - ], - [ - 299, - 'i - macron' - ], - [ - 240, - 'eth' - ], - [ - 241, - 'n - tilde' - ], - [ - 242, - 'o - grave' - ], - [ - 243, - 'o - acute' - ], - [ - 244, - 'o - circumflex' - ], - [ - 245, - 'o - tilde' - ], - [ - 246, - 'o - diaeresis' - ], - [ - 248, - 'o slash' - ], - [ - 333, - 'o macron' - ], - [ - 339, - 'ligature oe' - ], - [ - 353, - 's - caron' - ], - [ - 249, - 'u - grave' - ], - [ - 250, - 'u - acute' - ], - [ - 251, - 'u - circumflex' - ], - [ - 252, - 'u - diaeresis' - ], - [ - 363, - 'u - macron' - ], - [ - 253, - 'y - acute' - ], - [ - 254, - 'thorn' - ], - [ - 255, - 'y - diaeresis' - ], - [ - 563, - 'y - macron' - ], - [ - 913, - 'Alpha' - ], - [ - 914, - 'Beta' - ], - [ - 915, - 'Gamma' - ], - [ - 916, - 'Delta' - ], - [ - 917, - 'Epsilon' - ], - [ - 918, - 'Zeta' - ], - [ - 919, - 'Eta' - ], - [ - 920, - 'Theta' - ], - [ - 921, - 'Iota' - ], - [ - 922, - 'Kappa' - ], - [ - 923, - 'Lambda' - ], - [ - 924, - 'Mu' - ], - [ - 925, - 'Nu' - ], - [ - 926, - 'Xi' - ], - [ - 927, - 'Omicron' - ], - [ - 928, - 'Pi' - ], - [ - 929, - 'Rho' - ], - [ - 931, - 'Sigma' - ], - [ - 932, - 'Tau' - ], - [ - 933, - 'Upsilon' - ], - [ - 934, - 'Phi' - ], - [ - 935, - 'Chi' - ], - [ - 936, - 'Psi' - ], - [ - 937, - 'Omega' - ], - [ - 945, - 'alpha' - ], - [ - 946, - 'beta' - ], - [ - 947, - 'gamma' - ], - [ - 948, - 'delta' - ], - [ - 949, - 'epsilon' - ], - [ - 950, - 'zeta' - ], - [ - 951, - 'eta' - ], - [ - 952, - 'theta' - ], - [ - 953, - 'iota' - ], - [ - 954, - 'kappa' - ], - [ - 955, - 'lambda' - ], - [ - 956, - 'mu' - ], - [ - 957, - 'nu' - ], - [ - 958, - 'xi' - ], - [ - 959, - 'omicron' - ], - [ - 960, - 'pi' - ], - [ - 961, - 'rho' - ], - [ - 962, - 'final sigma' - ], - [ - 963, - 'sigma' - ], - [ - 964, - 'tau' - ], - [ - 965, - 'upsilon' - ], - [ - 966, - 'phi' - ], - [ - 967, - 'chi' - ], - [ - 968, - 'psi' - ], - [ - 969, - 'omega' - ] - ] - }, - { - name: 'Symbols', - characters: [ - [ - 8501, - 'alef symbol' - ], - [ - 982, - 'pi symbol' - ], - [ - 8476, - 'real part symbol' - ], - [ - 978, - 'upsilon - hook symbol' - ], - [ - 8472, - 'Weierstrass p' - ], - [ - 8465, - 'imaginary part' - ] - ] - }, - { - name: 'Arrows', - characters: [ - [ - 8592, - 'leftwards arrow' - ], - [ - 8593, - 'upwards arrow' - ], - [ - 8594, - 'rightwards arrow' - ], - [ - 8595, - 'downwards arrow' - ], - [ - 8596, - 'left right arrow' - ], - [ - 8629, - 'carriage return' - ], - [ - 8656, - 'leftwards double arrow' - ], - [ - 8657, - 'upwards double arrow' - ], - [ - 8658, - 'rightwards double arrow' - ], - [ - 8659, - 'downwards double arrow' - ], - [ - 8660, - 'left right double arrow' - ], - [ - 8756, - 'therefore' - ], - [ - 8834, - 'subset of' - ], - [ - 8835, - 'superset of' - ], - [ - 8836, - 'not a subset of' - ], - [ - 8838, - 'subset of or equal to' - ], - [ - 8839, - 'superset of or equal to' - ], - [ - 8853, - 'circled plus' - ], - [ - 8855, - 'circled times' - ], - [ - 8869, - 'perpendicular' - ], - [ - 8901, - 'dot operator' - ], - [ - 8968, - 'left ceiling' - ], - [ - 8969, - 'right ceiling' - ], - [ - 8970, - 'left floor' - ], - [ - 8971, - 'right floor' - ], - [ - 9001, - 'left-pointing angle bracket' - ], - [ - 9002, - 'right-pointing angle bracket' - ], - [ - 9674, - 'lozenge' - ], - [ - 9824, - 'black spade suit' - ], - [ - 9827, - 'black club suit' - ], - [ - 9829, - 'black heart suit' - ], - [ - 9830, - 'black diamond suit' - ], - [ - 8194, - 'en space' - ], - [ - 8195, - 'em space' - ], - [ - 8201, - 'thin space' - ], - [ - 8204, - 'zero width non-joiner' - ], - [ - 8205, - 'zero width joiner' - ], - [ - 8206, - 'left-to-right mark' - ], - [ - 8207, - 'right-to-left mark' - ] - ] - } - ]; + return [ + { + name: 'Currency', + characters: [ + [ + 36, + 'dollar sign' + ], + [ + 162, + 'cent sign' + ], + [ + 8364, + 'euro sign' + ], + [ + 163, + 'pound sign' + ], + [ + 165, + 'yen sign' + ], + [ + 164, + 'currency sign' + ], + [ + 8352, + 'euro-currency sign' + ], + [ + 8353, + 'colon sign' + ], + [ + 8354, + 'cruzeiro sign' + ], + [ + 8355, + 'french franc sign' + ], + [ + 8356, + 'lira sign' + ], + [ + 8357, + 'mill sign' + ], + [ + 8358, + 'naira sign' + ], + [ + 8359, + 'peseta sign' + ], + [ + 8360, + 'rupee sign' + ], + [ + 8361, + 'won sign' + ], + [ + 8362, + 'new sheqel sign' + ], + [ + 8363, + 'dong sign' + ], + [ + 8365, + 'kip sign' + ], + [ + 8366, + 'tugrik sign' + ], + [ + 8367, + 'drachma sign' + ], + [ + 8368, + 'german penny symbol' + ], + [ + 8369, + 'peso sign' + ], + [ + 8370, + 'guarani sign' + ], + [ + 8371, + 'austral sign' + ], + [ + 8372, + 'hryvnia sign' + ], + [ + 8373, + 'cedi sign' + ], + [ + 8374, + 'livre tournois sign' + ], + [ + 8375, + 'spesmilo sign' + ], + [ + 8376, + 'tenge sign' + ], + [ + 8377, + 'indian rupee sign' + ], + [ + 8378, + 'turkish lira sign' + ], + [ + 8379, + 'nordic mark sign' + ], + [ + 8380, + 'manat sign' + ], + [ + 8381, + 'ruble sign' + ], + [ + 20870, + 'yen character' + ], + [ + 20803, + 'yuan character' + ], + [ + 22291, + 'yuan character, in hong kong and taiwan' + ], + [ + 22278, + 'yen/yuan character variant one' + ] + ] + }, + { + name: 'Text', + characters: [ + [ + 169, + 'copyright sign' + ], + [ + 174, + 'registered sign' + ], + [ + 8482, + 'trade mark sign' + ], + [ + 8240, + 'per mille sign' + ], + [ + 181, + 'micro sign' + ], + [ + 183, + 'middle dot' + ], + [ + 8226, + 'bullet' + ], + [ + 8230, + 'three dot leader' + ], + [ + 8242, + 'minutes / feet' + ], + [ + 8243, + 'seconds / inches' + ], + [ + 167, + 'section sign' + ], + [ + 182, + 'paragraph sign' + ], + [ + 223, + 'sharp s / ess-zed' + ] + ] + }, + { + name: 'Quotations', + characters: [ + [ + 8249, + 'single left-pointing angle quotation mark' + ], + [ + 8250, + 'single right-pointing angle quotation mark' + ], + [ + 171, + 'left pointing guillemet' + ], + [ + 187, + 'right pointing guillemet' + ], + [ + 8216, + 'left single quotation mark' + ], + [ + 8217, + 'right single quotation mark' + ], + [ + 8220, + 'left double quotation mark' + ], + [ + 8221, + 'right double quotation mark' + ], + [ + 8218, + 'single low-9 quotation mark' + ], + [ + 8222, + 'double low-9 quotation mark' + ], + [ + 60, + 'less-than sign' + ], + [ + 62, + 'greater-than sign' + ], + [ + 8804, + 'less-than or equal to' + ], + [ + 8805, + 'greater-than or equal to' + ], + [ + 8211, + 'en dash' + ], + [ + 8212, + 'em dash' + ], + [ + 175, + 'macron' + ], + [ + 8254, + 'overline' + ], + [ + 164, + 'currency sign' + ], + [ + 166, + 'broken bar' + ], + [ + 168, + 'diaeresis' + ], + [ + 161, + 'inverted exclamation mark' + ], + [ + 191, + 'turned question mark' + ], + [ + 710, + 'circumflex accent' + ], + [ + 732, + 'small tilde' + ], + [ + 176, + 'degree sign' + ], + [ + 8722, + 'minus sign' + ], + [ + 177, + 'plus-minus sign' + ], + [ + 247, + 'division sign' + ], + [ + 8260, + 'fraction slash' + ], + [ + 215, + 'multiplication sign' + ], + [ + 185, + 'superscript one' + ], + [ + 178, + 'superscript two' + ], + [ + 179, + 'superscript three' + ], + [ + 188, + 'fraction one quarter' + ], + [ + 189, + 'fraction one half' + ], + [ + 190, + 'fraction three quarters' + ] + ] + }, + { + name: 'Mathematical', + characters: [ + [ + 402, + 'function / florin' + ], + [ + 8747, + 'integral' + ], + [ + 8721, + 'n-ary sumation' + ], + [ + 8734, + 'infinity' + ], + [ + 8730, + 'square root' + ], + [ + 8764, + 'similar to' + ], + [ + 8773, + 'approximately equal to' + ], + [ + 8776, + 'almost equal to' + ], + [ + 8800, + 'not equal to' + ], + [ + 8801, + 'identical to' + ], + [ + 8712, + 'element of' + ], + [ + 8713, + 'not an element of' + ], + [ + 8715, + 'contains as member' + ], + [ + 8719, + 'n-ary product' + ], + [ + 8743, + 'logical and' + ], + [ + 8744, + 'logical or' + ], + [ + 172, + 'not sign' + ], + [ + 8745, + 'intersection' + ], + [ + 8746, + 'union' + ], + [ + 8706, + 'partial differential' + ], + [ + 8704, + 'for all' + ], + [ + 8707, + 'there exists' + ], + [ + 8709, + 'diameter' + ], + [ + 8711, + 'backward difference' + ], + [ + 8727, + 'asterisk operator' + ], + [ + 8733, + 'proportional to' + ], + [ + 8736, + 'angle' + ] + ] + }, + { + name: 'Extended Latin', + characters: [ + [ + 192, + 'A - grave' + ], + [ + 193, + 'A - acute' + ], + [ + 194, + 'A - circumflex' + ], + [ + 195, + 'A - tilde' + ], + [ + 196, + 'A - diaeresis' + ], + [ + 197, + 'A - ring above' + ], + [ + 256, + 'A - macron' + ], + [ + 198, + 'ligature AE' + ], + [ + 199, + 'C - cedilla' + ], + [ + 200, + 'E - grave' + ], + [ + 201, + 'E - acute' + ], + [ + 202, + 'E - circumflex' + ], + [ + 203, + 'E - diaeresis' + ], + [ + 274, + 'E - macron' + ], + [ + 204, + 'I - grave' + ], + [ + 205, + 'I - acute' + ], + [ + 206, + 'I - circumflex' + ], + [ + 207, + 'I - diaeresis' + ], + [ + 298, + 'I - macron' + ], + [ + 208, + 'ETH' + ], + [ + 209, + 'N - tilde' + ], + [ + 210, + 'O - grave' + ], + [ + 211, + 'O - acute' + ], + [ + 212, + 'O - circumflex' + ], + [ + 213, + 'O - tilde' + ], + [ + 214, + 'O - diaeresis' + ], + [ + 216, + 'O - slash' + ], + [ + 332, + 'O - macron' + ], + [ + 338, + 'ligature OE' + ], + [ + 352, + 'S - caron' + ], + [ + 217, + 'U - grave' + ], + [ + 218, + 'U - acute' + ], + [ + 219, + 'U - circumflex' + ], + [ + 220, + 'U - diaeresis' + ], + [ + 362, + 'U - macron' + ], + [ + 221, + 'Y - acute' + ], + [ + 376, + 'Y - diaeresis' + ], + [ + 562, + 'Y - macron' + ], + [ + 222, + 'THORN' + ], + [ + 224, + 'a - grave' + ], + [ + 225, + 'a - acute' + ], + [ + 226, + 'a - circumflex' + ], + [ + 227, + 'a - tilde' + ], + [ + 228, + 'a - diaeresis' + ], + [ + 229, + 'a - ring above' + ], + [ + 257, + 'a - macron' + ], + [ + 230, + 'ligature ae' + ], + [ + 231, + 'c - cedilla' + ], + [ + 232, + 'e - grave' + ], + [ + 233, + 'e - acute' + ], + [ + 234, + 'e - circumflex' + ], + [ + 235, + 'e - diaeresis' + ], + [ + 275, + 'e - macron' + ], + [ + 236, + 'i - grave' + ], + [ + 237, + 'i - acute' + ], + [ + 238, + 'i - circumflex' + ], + [ + 239, + 'i - diaeresis' + ], + [ + 299, + 'i - macron' + ], + [ + 240, + 'eth' + ], + [ + 241, + 'n - tilde' + ], + [ + 242, + 'o - grave' + ], + [ + 243, + 'o - acute' + ], + [ + 244, + 'o - circumflex' + ], + [ + 245, + 'o - tilde' + ], + [ + 246, + 'o - diaeresis' + ], + [ + 248, + 'o slash' + ], + [ + 333, + 'o macron' + ], + [ + 339, + 'ligature oe' + ], + [ + 353, + 's - caron' + ], + [ + 249, + 'u - grave' + ], + [ + 250, + 'u - acute' + ], + [ + 251, + 'u - circumflex' + ], + [ + 252, + 'u - diaeresis' + ], + [ + 363, + 'u - macron' + ], + [ + 253, + 'y - acute' + ], + [ + 254, + 'thorn' + ], + [ + 255, + 'y - diaeresis' + ], + [ + 563, + 'y - macron' + ], + [ + 913, + 'Alpha' + ], + [ + 914, + 'Beta' + ], + [ + 915, + 'Gamma' + ], + [ + 916, + 'Delta' + ], + [ + 917, + 'Epsilon' + ], + [ + 918, + 'Zeta' + ], + [ + 919, + 'Eta' + ], + [ + 920, + 'Theta' + ], + [ + 921, + 'Iota' + ], + [ + 922, + 'Kappa' + ], + [ + 923, + 'Lambda' + ], + [ + 924, + 'Mu' + ], + [ + 925, + 'Nu' + ], + [ + 926, + 'Xi' + ], + [ + 927, + 'Omicron' + ], + [ + 928, + 'Pi' + ], + [ + 929, + 'Rho' + ], + [ + 931, + 'Sigma' + ], + [ + 932, + 'Tau' + ], + [ + 933, + 'Upsilon' + ], + [ + 934, + 'Phi' + ], + [ + 935, + 'Chi' + ], + [ + 936, + 'Psi' + ], + [ + 937, + 'Omega' + ], + [ + 945, + 'alpha' + ], + [ + 946, + 'beta' + ], + [ + 947, + 'gamma' + ], + [ + 948, + 'delta' + ], + [ + 949, + 'epsilon' + ], + [ + 950, + 'zeta' + ], + [ + 951, + 'eta' + ], + [ + 952, + 'theta' + ], + [ + 953, + 'iota' + ], + [ + 954, + 'kappa' + ], + [ + 955, + 'lambda' + ], + [ + 956, + 'mu' + ], + [ + 957, + 'nu' + ], + [ + 958, + 'xi' + ], + [ + 959, + 'omicron' + ], + [ + 960, + 'pi' + ], + [ + 961, + 'rho' + ], + [ + 962, + 'final sigma' + ], + [ + 963, + 'sigma' + ], + [ + 964, + 'tau' + ], + [ + 965, + 'upsilon' + ], + [ + 966, + 'phi' + ], + [ + 967, + 'chi' + ], + [ + 968, + 'psi' + ], + [ + 969, + 'omega' + ] + ] + }, + { + name: 'Symbols', + characters: [ + [ + 8501, + 'alef symbol' + ], + [ + 982, + 'pi symbol' + ], + [ + 8476, + 'real part symbol' + ], + [ + 978, + 'upsilon - hook symbol' + ], + [ + 8472, + 'Weierstrass p' + ], + [ + 8465, + 'imaginary part' + ] + ] + }, + { + name: 'Arrows', + characters: [ + [ + 8592, + 'leftwards arrow' + ], + [ + 8593, + 'upwards arrow' + ], + [ + 8594, + 'rightwards arrow' + ], + [ + 8595, + 'downwards arrow' + ], + [ + 8596, + 'left right arrow' + ], + [ + 8629, + 'carriage return' + ], + [ + 8656, + 'leftwards double arrow' + ], + [ + 8657, + 'upwards double arrow' + ], + [ + 8658, + 'rightwards double arrow' + ], + [ + 8659, + 'downwards double arrow' + ], + [ + 8660, + 'left right double arrow' + ], + [ + 8756, + 'therefore' + ], + [ + 8834, + 'subset of' + ], + [ + 8835, + 'superset of' + ], + [ + 8836, + 'not a subset of' + ], + [ + 8838, + 'subset of or equal to' + ], + [ + 8839, + 'superset of or equal to' + ], + [ + 8853, + 'circled plus' + ], + [ + 8855, + 'circled times' + ], + [ + 8869, + 'perpendicular' + ], + [ + 8901, + 'dot operator' + ], + [ + 8968, + 'left ceiling' + ], + [ + 8969, + 'right ceiling' + ], + [ + 8970, + 'left floor' + ], + [ + 8971, + 'right floor' + ], + [ + 9001, + 'left-pointing angle bracket' + ], + [ + 9002, + 'right-pointing angle bracket' + ], + [ + 9674, + 'lozenge' + ], + [ + 9824, + 'black spade suit' + ], + [ + 9827, + 'black club suit' + ], + [ + 9829, + 'black heart suit' + ], + [ + 9830, + 'black diamond suit' + ], + [ + 8194, + 'en space' + ], + [ + 8195, + 'em space' + ], + [ + 8201, + 'thin space' + ], + [ + 8204, + 'zero width non-joiner' + ], + [ + 8205, + 'zero width joiner' + ], + [ + 8206, + 'left-to-right mark' + ], + [ + 8207, + 'right-to-left mark' + ] + ] + } + ]; }; var charmapFilter = function (charmap) { - return global$1.grep(charmap, function (item) { - return isArray$1(item) && item.length === 2; - }); + return global$1.grep(charmap, function (item) { + return isArray$1(item) && item.length === 2; + }); }; var getCharsFromSetting = function (settingValue) { - if (isArray$1(settingValue)) { - return [].concat(charmapFilter(settingValue)); - } - if (typeof settingValue === 'function') { - return settingValue(); - } - return []; + if (isArray$1(settingValue)) { + return [].concat(charmapFilter(settingValue)); + } + if (typeof settingValue === 'function') { + return settingValue(); + } + return []; }; var extendCharMap = function (editor, charmap) { - var userCharMap = getCharMap(editor); - if (userCharMap) { - charmap = [{ - name: UserDefined, - characters: getCharsFromSetting(userCharMap) - }]; - } - var userCharMapAppend = getCharMapAppend(editor); - if (userCharMapAppend) { - var userDefinedGroup = global$1.grep(charmap, function (cg) { - return cg.name === UserDefined; - }); - if (userDefinedGroup.length) { - userDefinedGroup[0].characters = [].concat(userDefinedGroup[0].characters).concat(getCharsFromSetting(userCharMapAppend)); - return charmap; - } - return [].concat(charmap).concat({ - name: UserDefined, - characters: getCharsFromSetting(userCharMapAppend) - }); + var userCharMap = getCharMap(editor); + if (userCharMap) { + charmap = [{ + name: UserDefined, + characters: getCharsFromSetting(userCharMap) + }]; + } + var userCharMapAppend = getCharMapAppend(editor); + if (userCharMapAppend) { + var userDefinedGroup = global$1.grep(charmap, function (cg) { + return cg.name === UserDefined; + }); + if (userDefinedGroup.length) { + userDefinedGroup[0].characters = [].concat(userDefinedGroup[0].characters).concat(getCharsFromSetting(userCharMapAppend)); + return charmap; } - return charmap; + return [].concat(charmap).concat({ + name: UserDefined, + characters: getCharsFromSetting(userCharMapAppend) + }); + } + return charmap; }; var getCharMap$1 = function (editor) { - var groups = extendCharMap(editor, getDefaultCharMap()); - return groups.length > 1 ? [{ - name: 'All', - characters: bind(groups, function (g) { - return g.characters; - }) + var groups = extendCharMap(editor, getDefaultCharMap()); + return groups.length > 1 ? [{ + name: 'All', + characters: bind(groups, function (g) { + return g.characters; + }) }].concat(groups) : groups; }; var get = function (editor) { - var getCharMap = function () { - return getCharMap$1(editor); - }; - var insertChar$1 = function (chr) { - insertChar(editor, chr); - }; - return { - getCharMap: getCharMap, - insertChar: insertChar$1 - }; + var getCharMap = function () { + return getCharMap$1(editor); + }; + var insertChar$1 = function (chr) { + insertChar(editor, chr); + }; + return { + getCharMap: getCharMap, + insertChar: insertChar$1 + }; }; var Cell = function (initial) { - var value = initial; - var get = function () { - return value; - }; - var set = function (v) { - value = v; - }; - return { - get: get, - set: set - }; + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; }; var last = function (fn, rate) { - var timer = null; - var cancel = function () { - if (timer !== null) { - clearTimeout(timer); - timer = null; - } - }; - var throttle = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (timer !== null) { - clearTimeout(timer); - } - timer = setTimeout(function () { - fn.apply(null, args); - timer = null; - }, rate); - }; - return { - cancel: cancel, - throttle: throttle - }; + var timer = null; + var cancel = function () { + if (timer !== null) { + clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer !== null) { + clearTimeout(timer); + } + timer = setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + }; + return { + cancel: cancel, + throttle: throttle + }; }; var nativeFromCodePoint = String.fromCodePoint; var contains = function (str, substr) { - return str.indexOf(substr) !== -1; + return str.indexOf(substr) !== -1; }; var fromCodePoint = function () { - var codePoints = []; - for (var _i = 0; _i < arguments.length; _i++) { - codePoints[_i] = arguments[_i]; - } - if (nativeFromCodePoint) { - return nativeFromCodePoint.apply(void 0, codePoints); - } else { - var codeUnits = []; - var codeLen = 0; - var result = ''; - for (var index = 0, len = codePoints.length; index !== len; ++index) { - var codePoint = +codePoints[index]; - if (!(codePoint < 1114111 && codePoint >>> 0 === codePoint)) { - throw RangeError('Invalid code point: ' + codePoint); - } - if (codePoint <= 65535) { - codeLen = codeUnits.push(codePoint); - } else { - codePoint -= 65536; - codeLen = codeUnits.push((codePoint >> 10) + 55296, codePoint % 1024 + 56320); - } - if (codeLen >= 16383) { - result += String.fromCharCode.apply(null, codeUnits); - codeUnits.length = 0; - } - } - return result + String.fromCharCode.apply(null, codeUnits); + var codePoints = []; + for (var _i = 0; _i < arguments.length; _i++) { + codePoints[_i] = arguments[_i]; + } + if (nativeFromCodePoint) { + return nativeFromCodePoint.apply(void 0, codePoints); + } else { + var codeUnits = []; + var codeLen = 0; + var result = ''; + for (var index = 0, len = codePoints.length; index !== len; ++index) { + var codePoint = +codePoints[index]; + if (!(codePoint < 1114111 && codePoint >>> 0 === codePoint)) { + throw RangeError('Invalid code point: ' + codePoint); + } + if (codePoint <= 65535) { + codeLen = codeUnits.push(codePoint); + } else { + codePoint -= 65536; + codeLen = codeUnits.push((codePoint >> 10) + 55296, codePoint % 1024 + 56320); + } + if (codeLen >= 16383) { + result += String.fromCharCode.apply(null, codeUnits); + codeUnits.length = 0; + } } + return result + String.fromCharCode.apply(null, codeUnits); + } }; var charMatches = function (charCode, name, lowerCasePattern) { - if (contains(fromCodePoint(charCode).toLowerCase(), lowerCasePattern)) { - return true; - } else { - return contains(name.toLowerCase(), lowerCasePattern) || contains(name.toLowerCase().replace(/\s+/g, ''), lowerCasePattern); - } + if (contains(fromCodePoint(charCode).toLowerCase(), lowerCasePattern)) { + return true; + } else { + return contains(name.toLowerCase(), lowerCasePattern) || contains(name.toLowerCase().replace(/\s+/g, ''), lowerCasePattern); + } }; var scan = function (group, pattern) { - var matches = []; - var lowerCasePattern = pattern.toLowerCase(); - each(group.characters, function (g) { - if (charMatches(g[0], g[1], lowerCasePattern)) { - matches.push(g); - } - }); - return map(matches, function (m) { - return { - text: m[1], - value: fromCodePoint(m[0]), - icon: fromCodePoint(m[0]) - }; - }); + var matches = []; + var lowerCasePattern = pattern.toLowerCase(); + each(group.characters, function (g) { + if (charMatches(g[0], g[1], lowerCasePattern)) { + matches.push(g); + } + }); + return map(matches, function (m) { + return { + text: m[1], + value: fromCodePoint(m[0]), + icon: fromCodePoint(m[0]) + }; + }); }; var patternName = 'pattern'; var open = function (editor, charMap) { - var makeGroupItems = function () { - return [ - { - label: 'Search', - type: 'input', - name: patternName - }, - { - type: 'collection', - name: 'results' - } - ]; - }; - var makeTabs = function () { - return map(charMap, function (charGroup) { - return { - title: charGroup.name, - name: charGroup.name, - items: makeGroupItems() - }; - }); - }; - var makePanel = function () { - return { - type: 'panel', - items: makeGroupItems() - }; - }; - var makeTabPanel = function () { - return { - type: 'tabpanel', - tabs: makeTabs() - }; - }; - var currentTab = charMap.length === 1 ? Cell(UserDefined) : Cell('All'); - var scanAndSet = function (dialogApi, pattern) { - find(charMap, function (group) { - return group.name === currentTab.get(); - }).each(function (f) { - var items = scan(f, pattern); - dialogApi.setData({results: items}); - }); - }; - var SEARCH_DELAY = 40; - var updateFilter = last(function (dialogApi) { - var pattern = dialogApi.getData().pattern; - scanAndSet(dialogApi, pattern); - }, SEARCH_DELAY); - var body = charMap.length === 1 ? makePanel() : makeTabPanel(); - var initialData = { - pattern: '', - results: scan(charMap[0], '') + var makeGroupItems = function () { + return [ + { + label: 'Search', + type: 'input', + name: patternName + }, + { + type: 'collection', + name: 'results' + } + ]; + }; + var makeTabs = function () { + return map(charMap, function (charGroup) { + return { + title: charGroup.name, + name: charGroup.name, + items: makeGroupItems() + }; + }); + }; + var makePanel = function () { + return { + type: 'panel', + items: makeGroupItems() }; - var bridgeSpec = { - title: 'Special Character', - size: 'normal', - body: body, - buttons: [{ - type: 'cancel', - name: 'close', - text: 'Close', - primary: true - }], - initialData: initialData, - onAction: function (api, details) { - if (details.name === 'results') { - insertChar(editor, details.value); - api.close(); - } - }, - onTabChange: function (dialogApi, details) { - currentTab.set(details.newTabName); - updateFilter.throttle(dialogApi); - }, - onChange: function (dialogApi, changeData) { - if (changeData.name === patternName) { - updateFilter.throttle(dialogApi); - } - } + }; + var makeTabPanel = function () { + return { + type: 'tabpanel', + tabs: makeTabs() }; - var dialogApi = editor.windowManager.open(bridgeSpec); - dialogApi.focus(patternName); + }; + var currentTab = charMap.length === 1 ? Cell(UserDefined) : Cell('All'); + var scanAndSet = function (dialogApi, pattern) { + find(charMap, function (group) { + return group.name === currentTab.get(); + }).each(function (f) { + var items = scan(f, pattern); + dialogApi.setData({ results: items }); + }); + }; + var SEARCH_DELAY = 40; + var updateFilter = last(function (dialogApi) { + var pattern = dialogApi.getData().pattern; + scanAndSet(dialogApi, pattern); + }, SEARCH_DELAY); + var body = charMap.length === 1 ? makePanel() : makeTabPanel(); + var initialData = { + pattern: '', + results: scan(charMap[0], '') + }; + var bridgeSpec = { + title: 'Special Character', + size: 'normal', + body: body, + buttons: [{ + type: 'cancel', + name: 'close', + text: 'Close', + primary: true + }], + initialData: initialData, + onAction: function (api, details) { + if (details.name === 'results') { + insertChar(editor, details.value); + api.close(); + } + }, + onTabChange: function (dialogApi, details) { + currentTab.set(details.newTabName); + updateFilter.throttle(dialogApi); + }, + onChange: function (dialogApi, changeData) { + if (changeData.name === patternName) { + updateFilter.throttle(dialogApi); + } + } + }; + var dialogApi = editor.windowManager.open(bridgeSpec); + dialogApi.focus(patternName); }; var register = function (editor, charMap) { - editor.addCommand('mceShowCharmap', function () { - open(editor, charMap); - }); + editor.addCommand('mceShowCharmap', function () { + open(editor, charMap); + }); }; var global$2 = tinymce.util.Tools.resolve('tinymce.util.Promise'); var init = function (editor, all) { - editor.ui.registry.addAutocompleter('charmap', { - ch: ':', - columns: 'auto', - minChars: 2, - fetch: function (pattern, _maxResults) { - return new global$2(function (resolve, _reject) { - resolve(scan(all, pattern)); - }); - }, - onAction: function (autocompleteApi, rng, value) { - editor.selection.setRng(rng); - editor.insertContent(value); - autocompleteApi.hide(); - } - }); + editor.ui.registry.addAutocompleter('charmap', { + ch: ':', + columns: 'auto', + minChars: 2, + fetch: function (pattern, _maxResults) { + return new global$2(function (resolve, _reject) { + resolve(scan(all, pattern)); + }); + }, + onAction: function (autocompleteApi, rng, value) { + editor.selection.setRng(rng); + editor.insertContent(value); + autocompleteApi.hide(); + } + }); }; var register$1 = function (editor) { - editor.ui.registry.addButton('charmap', { - icon: 'insert-character', - tooltip: 'Special character', - onAction: function () { - return editor.execCommand('mceShowCharmap'); - } - }); - editor.ui.registry.addMenuItem('charmap', { - icon: 'insert-character', - text: 'Special character...', - onAction: function () { - return editor.execCommand('mceShowCharmap'); - } - }); + editor.ui.registry.addButton('charmap', { + icon: 'insert-character', + tooltip: 'Special character', + onAction: function () { + return editor.execCommand('mceShowCharmap'); + } + }); + editor.ui.registry.addMenuItem('charmap', { + icon: 'insert-character', + text: 'Special character...', + onAction: function () { + return editor.execCommand('mceShowCharmap'); + } + }); }; - function Plugin() { - global.add('charmap', function (editor) { - var charMap = getCharMap$1(editor); - register(editor, charMap); - register$1(editor); - init(editor, charMap[0]); - return get(editor); - }); + function Plugin () { + global.add('charmap', function (editor) { + var charMap = getCharMap$1(editor); + register(editor, charMap); + register$1(editor); + init(editor, charMap[0]); + return get(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/code/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/code/plugin.js index 07849a34..8d58acce 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/code/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/code/plugin.js @@ -12,79 +12,79 @@ var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var setContent = function (editor, html) { - editor.focus(); - editor.undoManager.transact(function () { - editor.setContent(html); - }); - editor.selection.setCursorLocation(); - editor.nodeChanged(); + editor.focus(); + editor.undoManager.transact(function () { + editor.setContent(html); + }); + editor.selection.setCursorLocation(); + editor.nodeChanged(); }; var getContent = function (editor) { - return editor.getContent({source_view: true}); + return editor.getContent({ source_view: true }); }; var open = function (editor) { - var editorContent = getContent(editor); - editor.windowManager.open({ - title: 'Source Code', - size: 'large', - body: { - type: 'panel', - items: [{ - type: 'textarea', - name: 'code' - }] - }, - buttons: [ - { - type: 'cancel', - name: 'cancel', - text: 'Cancel' - }, - { - type: 'submit', - name: 'save', - text: 'Save', - primary: true - } - ], - initialData: {code: editorContent}, - onSubmit: function (api) { - setContent(editor, api.getData().code); - api.close(); - } - }); + var editorContent = getContent(editor); + editor.windowManager.open({ + title: 'Source Code', + size: 'large', + body: { + type: 'panel', + items: [{ + type: 'textarea', + name: 'code' + }] + }, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: { code: editorContent }, + onSubmit: function (api) { + setContent(editor, api.getData().code); + api.close(); + } + }); }; var register = function (editor) { - editor.addCommand('mceCodeEditor', function () { - open(editor); - }); + editor.addCommand('mceCodeEditor', function () { + open(editor); + }); }; var register$1 = function (editor) { - editor.ui.registry.addButton('code', { - icon: 'sourcecode', - tooltip: 'Source code', - onAction: function () { - return open(editor); - } - }); - editor.ui.registry.addMenuItem('code', { - icon: 'sourcecode', - text: 'Source code', - onAction: function () { - return open(editor); - } - }); + editor.ui.registry.addButton('code', { + icon: 'sourcecode', + tooltip: 'Source code', + onAction: function () { + return open(editor); + } + }); + editor.ui.registry.addMenuItem('code', { + icon: 'sourcecode', + text: 'Source code', + onAction: function () { + return open(editor); + } + }); }; - function Plugin() { - global.add('code', function (editor) { - register(editor); - register$1(editor); - return {}; - }); + function Plugin () { + global.add('code', function (editor) { + register(editor); + register$1(editor); + return {}; + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/codesample/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/codesample/plugin.js index 2492bf81..4f198792 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/codesample/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/codesample/plugin.js @@ -14,2120 +14,2089 @@ var noop = function () { }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; var never = constant(false); var always = constant(true); var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var get = function (xs, i) { - return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none(); + return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none(); }; var head = function (xs) { - return get(xs, 0); + return get(xs, 0); }; var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); function isCodeSample(elm) { - return elm && elm.nodeName === 'PRE' && elm.className.indexOf('language-') !== -1; + return elm && elm.nodeName === 'PRE' && elm.className.indexOf('language-') !== -1; } - function trimArg(predicateFn) { - return function (arg1, arg2) { - return predicateFn(arg2); - }; + return function (arg1, arg2) { + return predicateFn(arg2); + }; } var Global = typeof window !== 'undefined' ? window : Function('return this;')(); - var exports$1 = {}, module = {exports: exports$1}, global$2 = {}; + var exports$1 = {}, module = { exports: exports$1 }, global$2 = {}; (function (define, exports, module, require) { - var oldprism = window.Prism; - window.Prism = {manual: true}; - (function (f) { - if (typeof exports === 'object' && typeof module !== 'undefined') { - module.exports = f(); - } else if (typeof define === 'function' && define.amd) { - define([], f); - } else { - var g; - if (typeof window !== 'undefined') { - g = window; - } else if (typeof global$2 !== 'undefined') { - g = global$2; - } else if (typeof self !== 'undefined') { - g = self; - } else { - g = this; + var oldprism = window.Prism; + window.Prism = { manual: true }; + (function (f) { + if (typeof exports === 'object' && typeof module !== 'undefined') { + module.exports = f(); + } else if (typeof define === 'function' && define.amd) { + define([], f); + } else { + var g; + if (typeof window !== 'undefined') { + g = window; + } else if (typeof global$2 !== 'undefined') { + g = global$2; + } else if (typeof self !== 'undefined') { + g = self; + } else { + g = this; + } + g.EphoxContactWrapper = f(); + } + }(function () { + return function () { + function r(e, n, t) { + function o(i, f) { + if (!n[i]) { + if (!e[i]) { + var c = 'function' == typeof require && require; + if (!f && c) + return c(i, !0); + if (u) + return u(i, !0); + var a = new Error('Cannot find module \'' + i + '\''); + throw a.code = 'MODULE_NOT_FOUND', a; } - g.EphoxContactWrapper = f(); + var p = n[i] = { exports: {} }; + e[i][0].call(p.exports, function (r) { + var n = e[i][1][r]; + return o(n || r); + }, p, p.exports, r, e, n, t); + } + return n[i].exports; } - }(function () { - return function () { - function r(e, n, t) { - function o(i, f) { - if (!n[i]) { - if (!e[i]) { - var c = 'function' == typeof require && require; - if (!f && c) - return c(i, !0); - if (u) - return u(i, !0); - var a = new Error('Cannot find module \'' + i + '\''); - throw a.code = 'MODULE_NOT_FOUND', a; - } - var p = n[i] = {exports: {}}; - e[i][0].call(p.exports, function (r) { - var n = e[i][1][r]; - return o(n || r); - }, p, p.exports, r, e, n, t); - } - return n[i].exports; - } - - for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++) - o(t[i]); - return o; - } - - return r; - }()({ - 1: [ - function (require, module, exports) { - Prism.languages.c = Prism.languages.extend('clike', { - 'comment': { - pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/, - greedy: true - }, - 'class-name': { - pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+/, - lookbehind: true - }, - 'keyword': /\b(?:__attribute__|_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/, - 'function': /[a-z_]\w*(?=\s*\()/i, - 'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/, - 'number': /(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i - }); - Prism.languages.insertBefore('c', 'string', { - 'macro': { - pattern: /(^\s*)#\s*[a-z]+(?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im, - lookbehind: true, - greedy: true, - alias: 'property', - inside: { - 'string': [ - { - pattern: /^(#\s*include\s*)<[^>]+>/, - lookbehind: true - }, - Prism.languages.c['string'] - ], - 'comment': Prism.languages.c['comment'], - 'directive': { - pattern: /^(#\s*)[a-z]+/, - lookbehind: true, - alias: 'keyword' - }, - 'directive-hash': /^#/, - 'punctuation': /##|\\(?=[\r\n])/, - 'expression': { - pattern: /\S[\s\S]*/, - inside: Prism.languages.c - } - } - }, - 'constant': /\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/ - }); - delete Prism.languages.c['boolean']; - }, - {} - ], - 2: [ - function (require, module, exports) { - Prism.languages.clike = { - 'comment': [ - { - pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, - lookbehind: true - }, - { - pattern: /(^|[^\\:])\/\/.*/, - lookbehind: true, - greedy: true - } - ], - 'string': { - pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, - greedy: true - }, - 'class-name': { - pattern: /(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i, - lookbehind: true, - inside: {'punctuation': /[.\\]/} - }, - 'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/, - 'boolean': /\b(?:true|false)\b/, - 'function': /\w+(?=\()/, - 'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i, - 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/, - 'punctuation': /[{}[\];(),.:]/ - }; - }, - {} - ], - 3: [ - function (require, module, exports) { - (function (global) { - (function () { - var _self = typeof window !== 'undefined' ? window : typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope ? self : {}; - var Prism = function (_self) { - var lang = /\blang(?:uage)?-([\w-]+)\b/i; - var uniqueId = 0; - var _ = { - manual: _self.Prism && _self.Prism.manual, - disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler, - util: { - encode: function encode(tokens) { - if (tokens instanceof Token) { - return new Token(tokens.type, encode(tokens.content), tokens.alias); - } else if (Array.isArray(tokens)) { - return tokens.map(encode); - } else { - return tokens.replace(/&/g, '&').replace(/' + env.content + ''; - }; - - function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) { - for (var token in grammar) { - if (!grammar.hasOwnProperty(token) || !grammar[token]) { - continue; - } - var patterns = grammar[token]; - patterns = Array.isArray(patterns) ? patterns : [patterns]; - for (var j = 0; j < patterns.length; ++j) { - if (rematch && rematch.cause == token + ',' + j) { - return; - } - var patternObj = patterns[j], inside = patternObj.inside, - lookbehind = !!patternObj.lookbehind, greedy = !!patternObj.greedy, - lookbehindLength = 0, alias = patternObj.alias; - if (greedy && !patternObj.pattern.global) { - var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0]; - patternObj.pattern = RegExp(patternObj.pattern.source, flags + 'g'); - } - var pattern = patternObj.pattern || patternObj; - for (var currentNode = startNode.next, pos = startPos; currentNode !== tokenList.tail; pos += currentNode.value.length, currentNode = currentNode.next) { - if (rematch && pos >= rematch.reach) { - break; - } - var str = currentNode.value; - if (tokenList.length > text.length) { - return; - } - if (str instanceof Token) { - continue; - } - var removeCount = 1; - if (greedy && currentNode != tokenList.tail.prev) { - pattern.lastIndex = pos; - var match = pattern.exec(text); - if (!match) { - break; - } - var from = match.index + (lookbehind && match[1] ? match[1].length : 0); - var to = match.index + match[0].length; - var p = pos; - p += currentNode.value.length; - while (from >= p) { - currentNode = currentNode.next; - p += currentNode.value.length; - } - p -= currentNode.value.length; - pos = p; - if (currentNode.value instanceof Token) { - continue; - } - for (var k = currentNode; k !== tokenList.tail && (p < to || typeof k.value === 'string'); k = k.next) { - removeCount++; - p += k.value.length; - } - removeCount--; - str = text.slice(pos, p); - match.index -= pos; - } else { - pattern.lastIndex = 0; - var match = pattern.exec(str); - } - if (!match) { - continue; - } - if (lookbehind) { - lookbehindLength = match[1] ? match[1].length : 0; - } - var from = match.index + lookbehindLength, - matchStr = match[0].slice(lookbehindLength), - to = from + matchStr.length, before = str.slice(0, from), - after = str.slice(to); - var reach = pos + str.length; - if (rematch && reach > rematch.reach) { - rematch.reach = reach; - } - var removeFrom = currentNode.prev; - if (before) { - removeFrom = addAfter(tokenList, removeFrom, before); - pos += before.length; - } - removeRange(tokenList, removeFrom, removeCount); - var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr); - currentNode = addAfter(tokenList, removeFrom, wrapped); - if (after) { - addAfter(tokenList, currentNode, after); - } - if (removeCount > 1) { - matchGrammar(text, tokenList, grammar, currentNode.prev, pos, { - cause: token + ',' + j, - reach: reach - }); - } - } - } - } - } - - function LinkedList() { - var head = { - value: null, - prev: null, - next: null - }; - var tail = { - value: null, - prev: head, - next: null - }; - head.next = tail; - this.head = head; - this.tail = tail; - this.length = 0; - } - - function addAfter(list, node, value) { - var next = node.next; - var newNode = { - value: value, - prev: node, - next: next - }; - node.next = newNode; - next.prev = newNode; - list.length++; - return newNode; - } - - function removeRange(list, node, count) { - var next = node.next; - for (var i = 0; i < count && next !== list.tail; i++) { - next = next.next; - } - node.next = next; - next.prev = node; - list.length -= i; - } - - function toArray(list) { - var array = []; - var node = list.head.next; - while (node !== list.tail) { - array.push(node.value); - node = node.next; - } - return array; - } - - if (!_self.document) { - if (!_self.addEventListener) { - return _; - } - if (!_.disableWorkerMessageHandler) { - _self.addEventListener('message', function (evt) { - var message = JSON.parse(evt.data), lang = message.language, - code = message.code, immediateClose = message.immediateClose; - _self.postMessage(_.highlight(code, _.languages[lang], lang)); - if (immediateClose) { - _self.close(); - } - }, false); - } - return _; - } - var script = _.util.currentScript(); - if (script) { - _.filename = script.src; - if (script.hasAttribute('data-manual')) { - _.manual = true; - } - } - - function highlightAutomaticallyCallback() { - if (!_.manual) { - _.highlightAll(); - } - } - - if (!_.manual) { - var readyState = document.readyState; - if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) { - document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback); - } else { - if (window.requestAnimationFrame) { - window.requestAnimationFrame(highlightAutomaticallyCallback); - } else { - window.setTimeout(highlightAutomaticallyCallback, 16); - } - } - } - return _; - }(_self); - if (typeof module !== 'undefined' && module.exports) { - module.exports = Prism; - } - if (typeof global !== 'undefined') { - global.Prism = Prism; - } - }.call(this)); - }.call(this, typeof global$2 !== 'undefined' ? global$2 : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : {})); + for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++) + o(t[i]); + return o; + } + return r; + }()({ + 1: [ + function (require, module, exports) { + Prism.languages.c = Prism.languages.extend('clike', { + 'comment': { + pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/, + greedy: true + }, + 'class-name': { + pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+/, + lookbehind: true + }, + 'keyword': /\b(?:__attribute__|_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/, + 'function': /[a-z_]\w*(?=\s*\()/i, + 'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/, + 'number': /(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i + }); + Prism.languages.insertBefore('c', 'string', { + 'macro': { + pattern: /(^\s*)#\s*[a-z]+(?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im, + lookbehind: true, + greedy: true, + alias: 'property', + inside: { + 'string': [ + { + pattern: /^(#\s*include\s*)<[^>]+>/, + lookbehind: true + }, + Prism.languages.c['string'] + ], + 'comment': Prism.languages.c['comment'], + 'directive': { + pattern: /^(#\s*)[a-z]+/, + lookbehind: true, + alias: 'keyword' }, - {} + 'directive-hash': /^#/, + 'punctuation': /##|\\(?=[\r\n])/, + 'expression': { + pattern: /\S[\s\S]*/, + inside: Prism.languages.c + } + } + }, + 'constant': /\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/ + }); + delete Prism.languages.c['boolean']; + }, + {} + ], + 2: [ + function (require, module, exports) { + Prism.languages.clike = { + 'comment': [ + { + pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, + lookbehind: true + }, + { + pattern: /(^|[^\\:])\/\/.*/, + lookbehind: true, + greedy: true + } ], - 4: [ - function (require, module, exports) { - (function (Prism) { - var keyword = /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/; - Prism.languages.cpp = Prism.languages.extend('c', { - 'class-name': [ - { - pattern: RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g, function () { - return keyword.source; - })), - lookbehind: true - }, - /\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/, - /\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i, - /\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/ - ], - 'keyword': keyword, - 'number': { - pattern: /(?:\b0b[01']+|\b0x(?:[\da-f']+\.?[\da-f']*|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+\.?[\d']*|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]*/i, - greedy: true - }, - 'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/, - 'boolean': /\b(?:true|false)\b/ - }); - Prism.languages.insertBefore('cpp', 'string', { - 'raw-string': { - pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/, - alias: 'string', - greedy: true - } + 'string': { + pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true + }, + 'class-name': { + pattern: /(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i, + lookbehind: true, + inside: { 'punctuation': /[.\\]/ } + }, + 'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/, + 'boolean': /\b(?:true|false)\b/, + 'function': /\w+(?=\()/, + 'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i, + 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/, + 'punctuation': /[{}[\];(),.:]/ + }; + }, + {} + ], + 3: [ + function (require, module, exports) { + (function (global) { + (function () { + var _self = typeof window !== 'undefined' ? window : typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope ? self : {}; + var Prism = function (_self) { + var lang = /\blang(?:uage)?-([\w-]+)\b/i; + var uniqueId = 0; + var _ = { + manual: _self.Prism && _self.Prism.manual, + disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler, + util: { + encode: function encode(tokens) { + if (tokens instanceof Token) { + return new Token(tokens.type, encode(tokens.content), tokens.alias); + } else if (Array.isArray(tokens)) { + return tokens.map(encode); + } else { + return tokens.replace(/&/g, '&').replace(/>/g, function (m, index) { - return '(?:' + replacements[+index] + ')'; - }); + } } - - function re(pattern, replacements, flags) { - return RegExp(replace(pattern, replacements), flags || ''); + return null; + } + }, + isActive: function (element, className, defaultActivation) { + var no = 'no-' + className; + while (element) { + var classList = element.classList; + if (classList.contains(className)) { + return true; } - - function nested(pattern, depthLog2) { - for (var i = 0; i < depthLog2; i++) { - pattern = pattern.replace(/<>/g, function () { - return '(?:' + pattern + ')'; - }); + if (classList.contains(no)) { + return false; + } + element = element.parentElement; + } + return !!defaultActivation; + } + }, + languages: { + extend: function (id, redef) { + var lang = _.util.clone(_.languages[id]); + for (var key in redef) { + lang[key] = redef[key]; + } + return lang; + }, + insertBefore: function (inside, before, insert, root) { + root = root || _.languages; + var grammar = root[inside]; + var ret = {}; + for (var token in grammar) { + if (grammar.hasOwnProperty(token)) { + if (token == before) { + for (var newToken in insert) { + if (insert.hasOwnProperty(newToken)) { + ret[newToken] = insert[newToken]; + } } - return pattern.replace(/<>/g, '[^\\s\\S]'); + } + if (!insert.hasOwnProperty(token)) { + ret[token] = grammar[token]; + } } - - var keywordKinds = { - type: 'bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void', - typeDeclaration: 'class enum interface struct', - contextual: 'add alias and ascending async await by descending from get global group into join let nameof not notnull on or orderby partial remove select set unmanaged value when where where', - other: 'abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield' - }; - - function keywordsToPattern(words) { - return '\\b(?:' + words.trim().replace(/ /g, '|') + ')\\b'; + } + var old = root[inside]; + root[inside] = ret; + _.languages.DFS(_.languages, function (key, value) { + if (value === old && key != inside) { + this[key] = ret; } - - var typeDeclarationKeywords = keywordsToPattern(keywordKinds.typeDeclaration); - var keywords = RegExp(keywordsToPattern(keywordKinds.type + ' ' + keywordKinds.typeDeclaration + ' ' + keywordKinds.contextual + ' ' + keywordKinds.other)); - var nonTypeKeywords = keywordsToPattern(keywordKinds.typeDeclaration + ' ' + keywordKinds.contextual + ' ' + keywordKinds.other); - var nonContextualKeywords = keywordsToPattern(keywordKinds.type + ' ' + keywordKinds.typeDeclaration + ' ' + keywordKinds.other); - var generic = nested(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source, 2); - var nestedRound = nested(/\((?:[^()]|<>)*\)/.source, 2); - var name = /@?\b[A-Za-z_]\w*\b/.source; - var genericName = replace(/<<0>>(?:\s*<<1>>)?/.source, [ - name, - generic - ]); - var identifier = replace(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source, [ - nonTypeKeywords, - genericName - ]); - var array = /\[\s*(?:,\s*)*\]/.source; - var typeExpressionWithoutTuple = replace(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source, [ - identifier, - array - ]); - var tupleElement = replace(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source, [ - generic, - nestedRound, - array - ]); - var tuple = replace(/\(<<0>>+(?:,<<0>>+)+\)/.source, [tupleElement]); - var typeExpression = replace(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source, [ - tuple, - identifier, - array - ]); - var typeInside = { - 'keyword': keywords, - 'punctuation': /[<>()?,.:[\]]/ - }; - var character = /'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source; - var regularString = /"(?:\\.|[^\\"\r\n])*"/.source; - var verbatimString = /@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source; - Prism.languages.csharp = Prism.languages.extend('clike', { - 'string': [ - { - pattern: re(/(^|[^$\\])<<0>>/.source, [verbatimString]), - lookbehind: true, - greedy: true - }, - { - pattern: re(/(^|[^@$\\])<<0>>/.source, [regularString]), - lookbehind: true, - greedy: true - }, - { - pattern: RegExp(character), - greedy: true, - alias: 'character' - } - ], - 'class-name': [ - { - pattern: re(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source, [identifier]), - lookbehind: true, - inside: typeInside - }, - { - pattern: re(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source, [ - name, - typeExpression - ]), - lookbehind: true, - inside: typeInside - }, - { - pattern: re(/(\busing\s+)<<0>>(?=\s*=)/.source, [name]), - lookbehind: true - }, - { - pattern: re(/(\b<<0>>\s+)<<1>>/.source, [ - typeDeclarationKeywords, - genericName - ]), - lookbehind: true, - inside: typeInside - }, - { - pattern: re(/(\bcatch\s*\(\s*)<<0>>/.source, [identifier]), - lookbehind: true, - inside: typeInside - }, - { - pattern: re(/(\bwhere\s+)<<0>>/.source, [name]), - lookbehind: true - }, - { - pattern: re(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source, [typeExpressionWithoutTuple]), - lookbehind: true, - inside: typeInside - }, - { - pattern: re(/\b<<0>>(?=\s+(?!<<1>>)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source, [ - typeExpression, - nonContextualKeywords, - name - ]), - inside: typeInside - } - ], - 'keyword': keywords, - 'number': /(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:ul|lu|[dflmu])?\b/i, - 'operator': />>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/, - 'punctuation': /\?\.?|::|[{}[\];(),.:]/ - }); - Prism.languages.insertBefore('csharp', 'number', { - 'range': { - pattern: /\.\./, - alias: 'operator' - } - }); - Prism.languages.insertBefore('csharp', 'punctuation', { - 'named-parameter': { - pattern: re(/([(,]\s*)<<0>>(?=\s*:)/.source, [name]), - lookbehind: true, - alias: 'punctuation' - } - }); - Prism.languages.insertBefore('csharp', 'class-name', { - 'namespace': { - pattern: re(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source, [name]), - lookbehind: true, - inside: {'punctuation': /\./} - }, - 'type-expression': { - pattern: re(/(\b(?:default|typeof|sizeof)\s*\(\s*)(?:[^()\s]|\s(?!\s*\))|<<0>>)*(?=\s*\))/.source, [nestedRound]), - lookbehind: true, - alias: 'class-name', - inside: typeInside - }, - 'return-type': { - pattern: re(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source, [ - typeExpression, - identifier - ]), - inside: typeInside, - alias: 'class-name' - }, - 'constructor-invocation': { - pattern: re(/(\bnew\s+)<<0>>(?=\s*[[({])/.source, [typeExpression]), - lookbehind: true, - inside: typeInside, - alias: 'class-name' - }, - 'generic-method': { - pattern: re(/<<0>>\s*<<1>>(?=\s*\()/.source, [ - name, - generic - ]), - inside: { - 'function': re(/^<<0>>/.source, [name]), - 'generic': { - pattern: RegExp(generic), - alias: 'class-name', - inside: typeInside - } - } - }, - 'type-list': { - pattern: re(/\b((?:<<0>>\s+<<1>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>)(?:\s*,\s*(?:<<3>>|<<4>>))*(?=\s*(?:where|[{;]|=>|$))/.source, [ - typeDeclarationKeywords, - genericName, - name, - typeExpression, - keywords.source - ]), - lookbehind: true, - inside: { - 'keyword': keywords, - 'class-name': { - pattern: RegExp(typeExpression), - greedy: true, - inside: typeInside - }, - 'punctuation': /,/ - } - }, - 'preprocessor': { - pattern: /(^\s*)#.*/m, - lookbehind: true, - alias: 'property', - inside: { - 'directive': { - pattern: /(\s*#)\b(?:define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/, - lookbehind: true, - alias: 'keyword' - } - } - } - }); - var regularStringOrCharacter = regularString + '|' + character; - var regularStringCharacterOrComment = replace(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source, [regularStringOrCharacter]); - var roundExpression = nested(replace(/[^"'/()]|<<0>>|\(<>*\)/.source, [regularStringCharacterOrComment]), 2); - var attrTarget = /\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source; - var attr = replace(/<<0>>(?:\s*\(<<1>>*\))?/.source, [ - identifier, - roundExpression - ]); - Prism.languages.insertBefore('csharp', 'class-name', { - 'attribute': { - pattern: re(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source, [ - attrTarget, - attr - ]), - lookbehind: true, - greedy: true, - inside: { - 'target': { - pattern: re(/^<<0>>(?=\s*:)/.source, [attrTarget]), - alias: 'keyword' - }, - 'attribute-arguments': { - pattern: re(/\(<<0>>*\)/.source, [roundExpression]), - inside: Prism.languages.csharp - }, - 'class-name': { - pattern: RegExp(identifier), - inside: {'punctuation': /\./} - }, - 'punctuation': /[:,]/ - } - } - }); - var formatString = /:[^}\r\n]+/.source; - var mInterpolationRound = nested(replace(/[^"'/()]|<<0>>|\(<>*\)/.source, [regularStringCharacterOrComment]), 2); - var mInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [ - mInterpolationRound, - formatString - ]); - var sInterpolationRound = nested(replace(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source, [regularStringOrCharacter]), 2); - var sInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [ - sInterpolationRound, - formatString - ]); - - function createInterpolationInside(interpolation, interpolationRound) { - return { - 'interpolation': { - pattern: re(/((?:^|[^{])(?:\{\{)*)<<0>>/.source, [interpolation]), - lookbehind: true, - inside: { - 'format-string': { - pattern: re(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source, [ - interpolationRound, - formatString - ]), - lookbehind: true, - inside: {'punctuation': /^:/} - }, - 'punctuation': /^\{|\}$/, - 'expression': { - pattern: /[\s\S]+/, - alias: 'language-csharp', - inside: Prism.languages.csharp - } - } - }, - 'string': /[\s\S]+/ - }; + }); + return ret; + }, + DFS: function DFS(o, callback, type, visited) { + visited = visited || {}; + var objId = _.util.objId; + for (var i in o) { + if (o.hasOwnProperty(i)) { + callback.call(o, i, o[i], type || i); + var property = o[i], propertyType = _.util.type(property); + if (propertyType === 'Object' && !visited[objId(property)]) { + visited[objId(property)] = true; + DFS(property, callback, null, visited); + } else if (propertyType === 'Array' && !visited[objId(property)]) { + visited[objId(property)] = true; + DFS(property, callback, i, visited); + } } - - Prism.languages.insertBefore('csharp', 'string', { - 'interpolation-string': [ - { - pattern: re(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source, [mInterpolation]), - lookbehind: true, - greedy: true, - inside: createInterpolationInside(mInterpolation, mInterpolationRound) - }, - { - pattern: re(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source, [sInterpolation]), - lookbehind: true, - greedy: true, - inside: createInterpolationInside(sInterpolation, sInterpolationRound) - } - ] - }); - }(Prism)); - Prism.languages.dotnet = Prism.languages.cs = Prism.languages.csharp; - }, - {} - ], - 6: [ - function (require, module, exports) { - (function (Prism) { - var string = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/; - Prism.languages.css = { - 'comment': /\/\*[\s\S]*?\*\//, - 'atrule': { - pattern: /@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/, - inside: { - 'rule': /^@[\w-]+/, - 'selector-function-argument': { - pattern: /(\bselector\s*\((?!\s*\))\s*)(?:[^()]|\((?:[^()]|\([^()]*\))*\))+?(?=\s*\))/, - lookbehind: true, - alias: 'selector' - }, - 'keyword': { - pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/, - lookbehind: true - } - } - }, - 'url': { - pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'), - greedy: true, - inside: { - 'function': /^url/i, - 'punctuation': /^\(|\)$/, - 'string': { - pattern: RegExp('^' + string.source + '$'), - alias: 'url' - } - } - }, - 'selector': RegExp('[^{}\\s](?:[^{};"\']|' + string.source + ')*?(?=\\s*\\{)'), - 'string': { - pattern: string, - greedy: true - }, - 'property': /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i, - 'important': /!important\b/i, - 'function': /[-a-z0-9]+(?=\()/i, - 'punctuation': /[(){};:,]/ - }; - Prism.languages.css['atrule'].inside.rest = Prism.languages.css; - var markup = Prism.languages.markup; - if (markup) { - markup.tag.addInlined('style', 'css'); - Prism.languages.insertBefore('inside', 'attr-value', { - 'style-attr': { - pattern: /\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i, - inside: { - 'attr-name': { - pattern: /^\s*style/i, - inside: markup.tag.inside - }, - 'punctuation': /^\s*=\s*['"]|['"]\s*$/, - 'attr-value': { - pattern: /.+/i, - inside: Prism.languages.css - } - }, - alias: 'language-css' - } - }, markup.tag); + } + } + }, + plugins: {}, + highlightAll: function (async, callback) { + _.highlightAllUnder(document, async, callback); + }, + highlightAllUnder: function (container, async, callback) { + var env = { + callback: callback, + container: container, + selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code' + }; + _.hooks.run('before-highlightall', env); + env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector)); + _.hooks.run('before-all-elements-highlight', env); + for (var i = 0, element; element = env.elements[i++];) { + _.highlightElement(element, async === true, env.callback); + } + }, + highlightElement: function (element, async, callback) { + var language = _.util.getLanguage(element); + var grammar = _.languages[language]; + element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; + var parent = element.parentElement; + if (parent && parent.nodeName.toLowerCase() === 'pre') { + parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; + } + var code = element.textContent; + var env = { + element: element, + language: language, + grammar: grammar, + code: code + }; + function insertHighlightedCode(highlightedCode) { + env.highlightedCode = highlightedCode; + _.hooks.run('before-insert', env); + env.element.innerHTML = env.highlightedCode; + _.hooks.run('after-highlight', env); + _.hooks.run('complete', env); + callback && callback.call(env.element); + } + _.hooks.run('before-sanity-check', env); + if (!env.code) { + _.hooks.run('complete', env); + callback && callback.call(env.element); + return; + } + _.hooks.run('before-highlight', env); + if (!env.grammar) { + insertHighlightedCode(_.util.encode(env.code)); + return; + } + if (async && _self.Worker) { + var worker = new Worker(_.filename); + worker.onmessage = function (evt) { + insertHighlightedCode(evt.data); + }; + worker.postMessage(JSON.stringify({ + language: env.language, + code: env.code, + immediateClose: true + })); + } else { + insertHighlightedCode(_.highlight(env.code, env.grammar, env.language)); + } + }, + highlight: function (text, grammar, language) { + var env = { + code: text, + grammar: grammar, + language: language + }; + _.hooks.run('before-tokenize', env); + env.tokens = _.tokenize(env.code, env.grammar); + _.hooks.run('after-tokenize', env); + return Token.stringify(_.util.encode(env.tokens), env.language); + }, + tokenize: function (text, grammar) { + var rest = grammar.rest; + if (rest) { + for (var token in rest) { + grammar[token] = rest[token]; + } + delete grammar.rest; + } + var tokenList = new LinkedList(); + addAfter(tokenList, tokenList.head, text); + matchGrammar(text, tokenList, grammar, tokenList.head, 0); + return toArray(tokenList); + }, + hooks: { + all: {}, + add: function (name, callback) { + var hooks = _.hooks.all; + hooks[name] = hooks[name] || []; + hooks[name].push(callback); + }, + run: function (name, env) { + var callbacks = _.hooks.all[name]; + if (!callbacks || !callbacks.length) { + return; + } + for (var i = 0, callback; callback = callbacks[i++];) { + callback(env); + } + } + }, + Token: Token + }; + _self.Prism = _; + function Token(type, content, alias, matchedStr) { + this.type = type; + this.content = content; + this.alias = alias; + this.length = (matchedStr || '').length | 0; + } + Token.stringify = function stringify(o, language) { + if (typeof o == 'string') { + return o; + } + if (Array.isArray(o)) { + var s = ''; + o.forEach(function (e) { + s += stringify(e, language); + }); + return s; + } + var env = { + type: o.type, + content: stringify(o.content, language), + tag: 'span', + classes: [ + 'token', + o.type + ], + attributes: {}, + language: language + }; + var aliases = o.alias; + if (aliases) { + if (Array.isArray(aliases)) { + Array.prototype.push.apply(env.classes, aliases); + } else { + env.classes.push(aliases); + } + } + _.hooks.run('wrap', env); + var attributes = ''; + for (var name in env.attributes) { + attributes += ' ' + name + '="' + (env.attributes[name] || '').replace(/"/g, '"') + '"'; + } + return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + attributes + '>' + env.content + ''; + }; + function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) { + for (var token in grammar) { + if (!grammar.hasOwnProperty(token) || !grammar[token]) { + continue; + } + var patterns = grammar[token]; + patterns = Array.isArray(patterns) ? patterns : [patterns]; + for (var j = 0; j < patterns.length; ++j) { + if (rematch && rematch.cause == token + ',' + j) { + return; + } + var patternObj = patterns[j], inside = patternObj.inside, lookbehind = !!patternObj.lookbehind, greedy = !!patternObj.greedy, lookbehindLength = 0, alias = patternObj.alias; + if (greedy && !patternObj.pattern.global) { + var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0]; + patternObj.pattern = RegExp(patternObj.pattern.source, flags + 'g'); + } + var pattern = patternObj.pattern || patternObj; + for (var currentNode = startNode.next, pos = startPos; currentNode !== tokenList.tail; pos += currentNode.value.length, currentNode = currentNode.next) { + if (rematch && pos >= rematch.reach) { + break; + } + var str = currentNode.value; + if (tokenList.length > text.length) { + return; + } + if (str instanceof Token) { + continue; + } + var removeCount = 1; + if (greedy && currentNode != tokenList.tail.prev) { + pattern.lastIndex = pos; + var match = pattern.exec(text); + if (!match) { + break; + } + var from = match.index + (lookbehind && match[1] ? match[1].length : 0); + var to = match.index + match[0].length; + var p = pos; + p += currentNode.value.length; + while (from >= p) { + currentNode = currentNode.next; + p += currentNode.value.length; + } + p -= currentNode.value.length; + pos = p; + if (currentNode.value instanceof Token) { + continue; + } + for (var k = currentNode; k !== tokenList.tail && (p < to || typeof k.value === 'string'); k = k.next) { + removeCount++; + p += k.value.length; + } + removeCount--; + str = text.slice(pos, p); + match.index -= pos; + } else { + pattern.lastIndex = 0; + var match = pattern.exec(str); } - }(Prism)); + if (!match) { + continue; + } + if (lookbehind) { + lookbehindLength = match[1] ? match[1].length : 0; + } + var from = match.index + lookbehindLength, matchStr = match[0].slice(lookbehindLength), to = from + matchStr.length, before = str.slice(0, from), after = str.slice(to); + var reach = pos + str.length; + if (rematch && reach > rematch.reach) { + rematch.reach = reach; + } + var removeFrom = currentNode.prev; + if (before) { + removeFrom = addAfter(tokenList, removeFrom, before); + pos += before.length; + } + removeRange(tokenList, removeFrom, removeCount); + var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr); + currentNode = addAfter(tokenList, removeFrom, wrapped); + if (after) { + addAfter(tokenList, currentNode, after); + } + if (removeCount > 1) { + matchGrammar(text, tokenList, grammar, currentNode.prev, pos, { + cause: token + ',' + j, + reach: reach + }); + } + } + } + } + } + function LinkedList() { + var head = { + value: null, + prev: null, + next: null + }; + var tail = { + value: null, + prev: head, + next: null + }; + head.next = tail; + this.head = head; + this.tail = tail; + this.length = 0; + } + function addAfter(list, node, value) { + var next = node.next; + var newNode = { + value: value, + prev: node, + next: next + }; + node.next = newNode; + next.prev = newNode; + list.length++; + return newNode; + } + function removeRange(list, node, count) { + var next = node.next; + for (var i = 0; i < count && next !== list.tail; i++) { + next = next.next; + } + node.next = next; + next.prev = node; + list.length -= i; + } + function toArray(list) { + var array = []; + var node = list.head.next; + while (node !== list.tail) { + array.push(node.value); + node = node.next; + } + return array; + } + if (!_self.document) { + if (!_self.addEventListener) { + return _; + } + if (!_.disableWorkerMessageHandler) { + _self.addEventListener('message', function (evt) { + var message = JSON.parse(evt.data), lang = message.language, code = message.code, immediateClose = message.immediateClose; + _self.postMessage(_.highlight(code, _.languages[lang], lang)); + if (immediateClose) { + _self.close(); + } + }, false); + } + return _; + } + var script = _.util.currentScript(); + if (script) { + _.filename = script.src; + if (script.hasAttribute('data-manual')) { + _.manual = true; + } + } + function highlightAutomaticallyCallback() { + if (!_.manual) { + _.highlightAll(); + } + } + if (!_.manual) { + var readyState = document.readyState; + if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) { + document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback); + } else { + if (window.requestAnimationFrame) { + window.requestAnimationFrame(highlightAutomaticallyCallback); + } else { + window.setTimeout(highlightAutomaticallyCallback, 16); + } + } + } + return _; + }(_self); + if (typeof module !== 'undefined' && module.exports) { + module.exports = Prism; + } + if (typeof global !== 'undefined') { + global.Prism = Prism; + } + }.call(this)); + }.call(this, typeof global$2 !== 'undefined' ? global$2 : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : {})); + }, + {} + ], + 4: [ + function (require, module, exports) { + (function (Prism) { + var keyword = /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/; + Prism.languages.cpp = Prism.languages.extend('c', { + 'class-name': [ + { + pattern: RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g, function () { + return keyword.source; + })), + lookbehind: true }, - {} - ], - 7: [ - function (require, module, exports) { - (function (Prism) { - var keywords = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|null|open|opens|package|private|protected|provides|public|record|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/; - var className = /\b[A-Z](?:\w*[a-z]\w*)?\b/; - Prism.languages.java = Prism.languages.extend('clike', { - 'class-name': [ - className, - /\b[A-Z]\w*(?=\s+\w+\s*[;,=())])/ - ], - 'keyword': keywords, - 'function': [ - Prism.languages.clike.function, - { - pattern: /(\:\:)[a-z_]\w*/, - lookbehind: true - } - ], - 'number': /\b0b[01][01_]*L?\b|\b0x[\da-f_]*\.?[\da-f_p+-]+\b|(?:\b\d[\d_]*\.?[\d_]*|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i, - 'operator': { - pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m, - lookbehind: true - } - }); - Prism.languages.insertBefore('java', 'string', { - 'triple-quoted-string': { - pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/, - greedy: true, - alias: 'string' - } - }); - Prism.languages.insertBefore('java', 'class-name', { - 'annotation': { - alias: 'punctuation', - pattern: /(^|[^.])@\w+/, - lookbehind: true - }, - 'namespace': { - pattern: RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g, function () { - return keywords.source; - })), - lookbehind: true, - inside: {'punctuation': /\./} - }, - 'generics': { - pattern: /<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/, - inside: { - 'class-name': className, - 'keyword': keywords, - 'punctuation': /[<>(),.:]/, - 'operator': /[?&|]/ - } - } - }); - }(Prism)); + /\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/, + /\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i, + /\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/ + ], + 'keyword': keyword, + 'number': { + pattern: /(?:\b0b[01']+|\b0x(?:[\da-f']+\.?[\da-f']*|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+\.?[\d']*|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]*/i, + greedy: true + }, + 'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/, + 'boolean': /\b(?:true|false)\b/ + }); + Prism.languages.insertBefore('cpp', 'string', { + 'raw-string': { + pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/, + alias: 'string', + greedy: true + } + }); + Prism.languages.insertBefore('cpp', 'class-name', { + 'base-clause': { + pattern: /(\b(?:class|struct)\s+\w+\s*:\s*)(?:[^;{}"'])+?(?=\s*[;{])/, + lookbehind: true, + greedy: true, + inside: Prism.languages.extend('cpp', {}) + } + }); + Prism.languages.insertBefore('inside', 'operator', { 'class-name': /\b[a-z_]\w*\b(?!\s*::)/i }, Prism.languages.cpp['base-clause']); + }(Prism)); + }, + {} + ], + 5: [ + function (require, module, exports) { + (function (Prism) { + function replace(pattern, replacements) { + return pattern.replace(/<<(\d+)>>/g, function (m, index) { + return '(?:' + replacements[+index] + ')'; + }); + } + function re(pattern, replacements, flags) { + return RegExp(replace(pattern, replacements), flags || ''); + } + function nested(pattern, depthLog2) { + for (var i = 0; i < depthLog2; i++) { + pattern = pattern.replace(/<>/g, function () { + return '(?:' + pattern + ')'; + }); + } + return pattern.replace(/<>/g, '[^\\s\\S]'); + } + var keywordKinds = { + type: 'bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void', + typeDeclaration: 'class enum interface struct', + contextual: 'add alias and ascending async await by descending from get global group into join let nameof not notnull on or orderby partial remove select set unmanaged value when where where', + other: 'abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield' + }; + function keywordsToPattern(words) { + return '\\b(?:' + words.trim().replace(/ /g, '|') + ')\\b'; + } + var typeDeclarationKeywords = keywordsToPattern(keywordKinds.typeDeclaration); + var keywords = RegExp(keywordsToPattern(keywordKinds.type + ' ' + keywordKinds.typeDeclaration + ' ' + keywordKinds.contextual + ' ' + keywordKinds.other)); + var nonTypeKeywords = keywordsToPattern(keywordKinds.typeDeclaration + ' ' + keywordKinds.contextual + ' ' + keywordKinds.other); + var nonContextualKeywords = keywordsToPattern(keywordKinds.type + ' ' + keywordKinds.typeDeclaration + ' ' + keywordKinds.other); + var generic = nested(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source, 2); + var nestedRound = nested(/\((?:[^()]|<>)*\)/.source, 2); + var name = /@?\b[A-Za-z_]\w*\b/.source; + var genericName = replace(/<<0>>(?:\s*<<1>>)?/.source, [ + name, + generic + ]); + var identifier = replace(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source, [ + nonTypeKeywords, + genericName + ]); + var array = /\[\s*(?:,\s*)*\]/.source; + var typeExpressionWithoutTuple = replace(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source, [ + identifier, + array + ]); + var tupleElement = replace(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source, [ + generic, + nestedRound, + array + ]); + var tuple = replace(/\(<<0>>+(?:,<<0>>+)+\)/.source, [tupleElement]); + var typeExpression = replace(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source, [ + tuple, + identifier, + array + ]); + var typeInside = { + 'keyword': keywords, + 'punctuation': /[<>()?,.:[\]]/ + }; + var character = /'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source; + var regularString = /"(?:\\.|[^\\"\r\n])*"/.source; + var verbatimString = /@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source; + Prism.languages.csharp = Prism.languages.extend('clike', { + 'string': [ + { + pattern: re(/(^|[^$\\])<<0>>/.source, [verbatimString]), + lookbehind: true, + greedy: true }, - {} - ], - 8: [ - function (require, module, exports) { - Prism.languages.javascript = Prism.languages.extend('clike', { - 'class-name': [ - Prism.languages.clike['class-name'], - { - pattern: /(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/, - lookbehind: true - } - ], - 'keyword': [ - { - pattern: /((?:^|})\s*)(?:catch|finally)\b/, - lookbehind: true - }, - { - pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|(?:get|set)(?=\s*[\[$\w\xA0-\uFFFF])|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/, - lookbehind: true - } - ], - 'number': /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/, - 'function': /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, - 'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/ - }); - Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/; - Prism.languages.insertBefore('javascript', 'keyword', { - 'regex': { - pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/, - lookbehind: true, - greedy: true, - inside: { - 'regex-source': { - pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/, - lookbehind: true, - alias: 'language-regex', - inside: Prism.languages.regex - }, - 'regex-flags': /[a-z]+$/, - 'regex-delimiter': /^\/|\/$/ - } - }, - 'function-variable': { - pattern: /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/, - alias: 'function' - }, - 'parameter': [ - { - pattern: /(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/, - lookbehind: true, - inside: Prism.languages.javascript - }, - { - pattern: /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i, - inside: Prism.languages.javascript - }, - { - pattern: /(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/, - lookbehind: true, - inside: Prism.languages.javascript - }, - { - pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/, - lookbehind: true, - inside: Prism.languages.javascript - } - ], - 'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/ - }); - Prism.languages.insertBefore('javascript', 'string', { - 'template-string': { - pattern: /`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/, - greedy: true, - inside: { - 'template-punctuation': { - pattern: /^`|`$/, - alias: 'string' - }, - 'interpolation': { - pattern: /((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/, - lookbehind: true, - inside: { - 'interpolation-punctuation': { - pattern: /^\${|}$/, - alias: 'punctuation' - }, - rest: Prism.languages.javascript - } - }, - 'string': /[\s\S]+/ - } - } - }); - if (Prism.languages.markup) { - Prism.languages.markup.tag.addInlined('script', 'javascript'); + { + pattern: re(/(^|[^@$\\])<<0>>/.source, [regularString]), + lookbehind: true, + greedy: true + }, + { + pattern: RegExp(character), + greedy: true, + alias: 'character' + } + ], + 'class-name': [ + { + pattern: re(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source, [identifier]), + lookbehind: true, + inside: typeInside + }, + { + pattern: re(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source, [ + name, + typeExpression + ]), + lookbehind: true, + inside: typeInside + }, + { + pattern: re(/(\busing\s+)<<0>>(?=\s*=)/.source, [name]), + lookbehind: true + }, + { + pattern: re(/(\b<<0>>\s+)<<1>>/.source, [ + typeDeclarationKeywords, + genericName + ]), + lookbehind: true, + inside: typeInside + }, + { + pattern: re(/(\bcatch\s*\(\s*)<<0>>/.source, [identifier]), + lookbehind: true, + inside: typeInside + }, + { + pattern: re(/(\bwhere\s+)<<0>>/.source, [name]), + lookbehind: true + }, + { + pattern: re(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source, [typeExpressionWithoutTuple]), + lookbehind: true, + inside: typeInside + }, + { + pattern: re(/\b<<0>>(?=\s+(?!<<1>>)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source, [ + typeExpression, + nonContextualKeywords, + name + ]), + inside: typeInside + } + ], + 'keyword': keywords, + 'number': /(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:ul|lu|[dflmu])?\b/i, + 'operator': />>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/, + 'punctuation': /\?\.?|::|[{}[\];(),.:]/ + }); + Prism.languages.insertBefore('csharp', 'number', { + 'range': { + pattern: /\.\./, + alias: 'operator' + } + }); + Prism.languages.insertBefore('csharp', 'punctuation', { + 'named-parameter': { + pattern: re(/([(,]\s*)<<0>>(?=\s*:)/.source, [name]), + lookbehind: true, + alias: 'punctuation' + } + }); + Prism.languages.insertBefore('csharp', 'class-name', { + 'namespace': { + pattern: re(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source, [name]), + lookbehind: true, + inside: { 'punctuation': /\./ } + }, + 'type-expression': { + pattern: re(/(\b(?:default|typeof|sizeof)\s*\(\s*)(?:[^()\s]|\s(?!\s*\))|<<0>>)*(?=\s*\))/.source, [nestedRound]), + lookbehind: true, + alias: 'class-name', + inside: typeInside + }, + 'return-type': { + pattern: re(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source, [ + typeExpression, + identifier + ]), + inside: typeInside, + alias: 'class-name' + }, + 'constructor-invocation': { + pattern: re(/(\bnew\s+)<<0>>(?=\s*[[({])/.source, [typeExpression]), + lookbehind: true, + inside: typeInside, + alias: 'class-name' + }, + 'generic-method': { + pattern: re(/<<0>>\s*<<1>>(?=\s*\()/.source, [ + name, + generic + ]), + inside: { + 'function': re(/^<<0>>/.source, [name]), + 'generic': { + pattern: RegExp(generic), + alias: 'class-name', + inside: typeInside + } + } + }, + 'type-list': { + pattern: re(/\b((?:<<0>>\s+<<1>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>)(?:\s*,\s*(?:<<3>>|<<4>>))*(?=\s*(?:where|[{;]|=>|$))/.source, [ + typeDeclarationKeywords, + genericName, + name, + typeExpression, + keywords.source + ]), + lookbehind: true, + inside: { + 'keyword': keywords, + 'class-name': { + pattern: RegExp(typeExpression), + greedy: true, + inside: typeInside + }, + 'punctuation': /,/ + } + }, + 'preprocessor': { + pattern: /(^\s*)#.*/m, + lookbehind: true, + alias: 'property', + inside: { + 'directive': { + pattern: /(\s*#)\b(?:define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/, + lookbehind: true, + alias: 'keyword' + } + } + } + }); + var regularStringOrCharacter = regularString + '|' + character; + var regularStringCharacterOrComment = replace(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source, [regularStringOrCharacter]); + var roundExpression = nested(replace(/[^"'/()]|<<0>>|\(<>*\)/.source, [regularStringCharacterOrComment]), 2); + var attrTarget = /\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source; + var attr = replace(/<<0>>(?:\s*\(<<1>>*\))?/.source, [ + identifier, + roundExpression + ]); + Prism.languages.insertBefore('csharp', 'class-name', { + 'attribute': { + pattern: re(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source, [ + attrTarget, + attr + ]), + lookbehind: true, + greedy: true, + inside: { + 'target': { + pattern: re(/^<<0>>(?=\s*:)/.source, [attrTarget]), + alias: 'keyword' + }, + 'attribute-arguments': { + pattern: re(/\(<<0>>*\)/.source, [roundExpression]), + inside: Prism.languages.csharp + }, + 'class-name': { + pattern: RegExp(identifier), + inside: { 'punctuation': /\./ } + }, + 'punctuation': /[:,]/ + } + } + }); + var formatString = /:[^}\r\n]+/.source; + var mInterpolationRound = nested(replace(/[^"'/()]|<<0>>|\(<>*\)/.source, [regularStringCharacterOrComment]), 2); + var mInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [ + mInterpolationRound, + formatString + ]); + var sInterpolationRound = nested(replace(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source, [regularStringOrCharacter]), 2); + var sInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [ + sInterpolationRound, + formatString + ]); + function createInterpolationInside(interpolation, interpolationRound) { + return { + 'interpolation': { + pattern: re(/((?:^|[^{])(?:\{\{)*)<<0>>/.source, [interpolation]), + lookbehind: true, + inside: { + 'format-string': { + pattern: re(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source, [ + interpolationRound, + formatString + ]), + lookbehind: true, + inside: { 'punctuation': /^:/ } + }, + 'punctuation': /^\{|\}$/, + 'expression': { + pattern: /[\s\S]+/, + alias: 'language-csharp', + inside: Prism.languages.csharp } - Prism.languages.js = Prism.languages.javascript; + } }, - {} + 'string': /[\s\S]+/ + }; + } + Prism.languages.insertBefore('csharp', 'string', { + 'interpolation-string': [ + { + pattern: re(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source, [mInterpolation]), + lookbehind: true, + greedy: true, + inside: createInterpolationInside(mInterpolation, mInterpolationRound) + }, + { + pattern: re(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source, [sInterpolation]), + lookbehind: true, + greedy: true, + inside: createInterpolationInside(sInterpolation, sInterpolationRound) + } + ] + }); + }(Prism)); + Prism.languages.dotnet = Prism.languages.cs = Prism.languages.csharp; + }, + {} + ], + 6: [ + function (require, module, exports) { + (function (Prism) { + var string = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/; + Prism.languages.css = { + 'comment': /\/\*[\s\S]*?\*\//, + 'atrule': { + pattern: /@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/, + inside: { + 'rule': /^@[\w-]+/, + 'selector-function-argument': { + pattern: /(\bselector\s*\((?!\s*\))\s*)(?:[^()]|\((?:[^()]|\([^()]*\))*\))+?(?=\s*\))/, + lookbehind: true, + alias: 'selector' + }, + 'keyword': { + pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/, + lookbehind: true + } + } + }, + 'url': { + pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'), + greedy: true, + inside: { + 'function': /^url/i, + 'punctuation': /^\(|\)$/, + 'string': { + pattern: RegExp('^' + string.source + '$'), + alias: 'url' + } + } + }, + 'selector': RegExp('[^{}\\s](?:[^{};"\']|' + string.source + ')*?(?=\\s*\\{)'), + 'string': { + pattern: string, + greedy: true + }, + 'property': /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i, + 'important': /!important\b/i, + 'function': /[-a-z0-9]+(?=\()/i, + 'punctuation': /[(){};:,]/ + }; + Prism.languages.css['atrule'].inside.rest = Prism.languages.css; + var markup = Prism.languages.markup; + if (markup) { + markup.tag.addInlined('style', 'css'); + Prism.languages.insertBefore('inside', 'attr-value', { + 'style-attr': { + pattern: /\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i, + inside: { + 'attr-name': { + pattern: /^\s*style/i, + inside: markup.tag.inside + }, + 'punctuation': /^\s*=\s*['"]|['"]\s*$/, + 'attr-value': { + pattern: /.+/i, + inside: Prism.languages.css + } + }, + alias: 'language-css' + } + }, markup.tag); + } + }(Prism)); + }, + {} + ], + 7: [ + function (require, module, exports) { + (function (Prism) { + var keywords = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|null|open|opens|package|private|protected|provides|public|record|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/; + var className = /\b[A-Z](?:\w*[a-z]\w*)?\b/; + Prism.languages.java = Prism.languages.extend('clike', { + 'class-name': [ + className, + /\b[A-Z]\w*(?=\s+\w+\s*[;,=())])/ + ], + 'keyword': keywords, + 'function': [ + Prism.languages.clike.function, + { + pattern: /(\:\:)[a-z_]\w*/, + lookbehind: true + } + ], + 'number': /\b0b[01][01_]*L?\b|\b0x[\da-f_]*\.?[\da-f_p+-]+\b|(?:\b\d[\d_]*\.?[\d_]*|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i, + 'operator': { + pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m, + lookbehind: true + } + }); + Prism.languages.insertBefore('java', 'string', { + 'triple-quoted-string': { + pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/, + greedy: true, + alias: 'string' + } + }); + Prism.languages.insertBefore('java', 'class-name', { + 'annotation': { + alias: 'punctuation', + pattern: /(^|[^.])@\w+/, + lookbehind: true + }, + 'namespace': { + pattern: RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g, function () { + return keywords.source; + })), + lookbehind: true, + inside: { 'punctuation': /\./ } + }, + 'generics': { + pattern: /<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/, + inside: { + 'class-name': className, + 'keyword': keywords, + 'punctuation': /[<>(),.:]/, + 'operator': /[?&|]/ + } + } + }); + }(Prism)); + }, + {} + ], + 8: [ + function (require, module, exports) { + Prism.languages.javascript = Prism.languages.extend('clike', { + 'class-name': [ + Prism.languages.clike['class-name'], + { + pattern: /(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/, + lookbehind: true + } ], - 9: [ - function (require, module, exports) { - (function (Prism) { - function getPlaceholder(language, index) { - return '___' + language.toUpperCase() + index + '___'; - } - - Object.defineProperties(Prism.languages['markup-templating'] = {}, { - buildPlaceholders: { - value: function (env, language, placeholderPattern, replaceFilter) { - if (env.language !== language) { - return; - } - var tokenStack = env.tokenStack = []; - env.code = env.code.replace(placeholderPattern, function (match) { - if (typeof replaceFilter === 'function' && !replaceFilter(match)) { - return match; - } - var i = tokenStack.length; - var placeholder; - while (env.code.indexOf(placeholder = getPlaceholder(language, i)) !== -1) - ++i; - tokenStack[i] = match; - return placeholder; - }); - env.grammar = Prism.languages.markup; - } - }, - tokenizePlaceholders: { - value: function (env, language) { - if (env.language !== language || !env.tokenStack) { - return; - } - env.grammar = Prism.languages[language]; - var j = 0; - var keys = Object.keys(env.tokenStack); - - function walkTokens(tokens) { - for (var i = 0; i < tokens.length; i++) { - if (j >= keys.length) { - break; - } - var token = tokens[i]; - if (typeof token === 'string' || token.content && typeof token.content === 'string') { - var k = keys[j]; - var t = env.tokenStack[k]; - var s = typeof token === 'string' ? token : token.content; - var placeholder = getPlaceholder(language, k); - var index = s.indexOf(placeholder); - if (index > -1) { - ++j; - var before = s.substring(0, index); - var middle = new Prism.Token(language, Prism.tokenize(t, env.grammar), 'language-' + language, t); - var after = s.substring(index + placeholder.length); - var replacement = []; - if (before) { - replacement.push.apply(replacement, walkTokens([before])); - } - replacement.push(middle); - if (after) { - replacement.push.apply(replacement, walkTokens([after])); - } - if (typeof token === 'string') { - tokens.splice.apply(tokens, [ - i, - 1 - ].concat(replacement)); - } else { - token.content = replacement; - } - } - } else if (token.content) { - walkTokens(token.content); - } - } - return tokens; - } - - walkTokens(env.tokens); - } - } - }); - }(Prism)); + 'keyword': [ + { + pattern: /((?:^|})\s*)(?:catch|finally)\b/, + lookbehind: true + }, + { + pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|(?:get|set)(?=\s*[\[$\w\xA0-\uFFFF])|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/, + lookbehind: true + } + ], + 'number': /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/, + 'function': /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, + 'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/ + }); + Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/; + Prism.languages.insertBefore('javascript', 'keyword', { + 'regex': { + pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/, + lookbehind: true, + greedy: true, + inside: { + 'regex-source': { + pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/, + lookbehind: true, + alias: 'language-regex', + inside: Prism.languages.regex }, - {} + 'regex-flags': /[a-z]+$/, + 'regex-delimiter': /^\/|\/$/ + } + }, + 'function-variable': { + pattern: /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/, + alias: 'function' + }, + 'parameter': [ + { + pattern: /(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/, + lookbehind: true, + inside: Prism.languages.javascript + }, + { + pattern: /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i, + inside: Prism.languages.javascript + }, + { + pattern: /(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/, + lookbehind: true, + inside: Prism.languages.javascript + }, + { + pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/, + lookbehind: true, + inside: Prism.languages.javascript + } ], - 10: [ - function (require, module, exports) { - Prism.languages.markup = { - 'comment': //, - 'prolog': /<\?[\s\S]+?\?>/, - 'doctype': { - pattern: /"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i, - greedy: true, - inside: { - 'internal-subset': { - pattern: /(\[)[\s\S]+(?=\]>$)/, - lookbehind: true, - greedy: true, - inside: null - }, - 'string': { - pattern: /"[^"]*"|'[^']*'/, - greedy: true - }, - 'punctuation': /^$|[[\]]/, - 'doctype-tag': /^DOCTYPE/, - 'name': /[^\s<>'"]+/ - } - }, - 'cdata': //i, - 'tag': { - pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/, - greedy: true, - inside: { - 'tag': { - pattern: /^<\/?[^\s>\/]+/, - inside: { - 'punctuation': /^<\/?/, - 'namespace': /^[^\s>\/:]+:/ - } - }, - 'attr-value': { - pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/, - inside: { - 'punctuation': [ - { - pattern: /^=/, - alias: 'attr-equals' - }, - /"|'/ - ] - } - }, - 'punctuation': /\/?>/, - 'attr-name': { - pattern: /[^\s>\/]+/, - inside: {'namespace': /^[^\s>\/:]+:/} - } - } - }, - 'entity': [ - { - pattern: /&[\da-z]{1,8};/i, - alias: 'named-entity' - }, - /&#x?[\da-f]{1,8};/i - ] - }; - Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] = Prism.languages.markup['entity']; - Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup; - Prism.hooks.add('wrap', function (env) { - if (env.type === 'entity') { - env.attributes['title'] = env.content.replace(/&/, '&'); - } - }); - Object.defineProperty(Prism.languages.markup.tag, 'addInlined', { - value: function addInlined(tagName, lang) { - var includedCdataInside = {}; - includedCdataInside['language-' + lang] = { - pattern: /(^$)/i, - lookbehind: true, - inside: Prism.languages[lang] - }; - includedCdataInside['cdata'] = /^$/i; - var inside = { - 'included-cdata': { - pattern: //i, - inside: includedCdataInside - } - }; - inside['language-' + lang] = { - pattern: /[\s\S]+/, - inside: Prism.languages[lang] - }; - var def = {}; - def[tagName] = { - pattern: RegExp(/(<__[\s\S]*?>)(?:))*\]\]>|(?!)/.source.replace(/__/g, function () { - return tagName; - }), 'i'), - lookbehind: true, - greedy: true, - inside: inside - }; - Prism.languages.insertBefore('markup', 'cdata', def); + 'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/ + }); + Prism.languages.insertBefore('javascript', 'string', { + 'template-string': { + pattern: /`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/, + greedy: true, + inside: { + 'template-punctuation': { + pattern: /^`|`$/, + alias: 'string' + }, + 'interpolation': { + pattern: /((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/, + lookbehind: true, + inside: { + 'interpolation-punctuation': { + pattern: /^\${|}$/, + alias: 'punctuation' + }, + rest: Prism.languages.javascript + } + }, + 'string': /[\s\S]+/ + } + } + }); + if (Prism.languages.markup) { + Prism.languages.markup.tag.addInlined('script', 'javascript'); + } + Prism.languages.js = Prism.languages.javascript; + }, + {} + ], + 9: [ + function (require, module, exports) { + (function (Prism) { + function getPlaceholder(language, index) { + return '___' + language.toUpperCase() + index + '___'; + } + Object.defineProperties(Prism.languages['markup-templating'] = {}, { + buildPlaceholders: { + value: function (env, language, placeholderPattern, replaceFilter) { + if (env.language !== language) { + return; + } + var tokenStack = env.tokenStack = []; + env.code = env.code.replace(placeholderPattern, function (match) { + if (typeof replaceFilter === 'function' && !replaceFilter(match)) { + return match; + } + var i = tokenStack.length; + var placeholder; + while (env.code.indexOf(placeholder = getPlaceholder(language, i)) !== -1) + ++i; + tokenStack[i] = match; + return placeholder; + }); + env.grammar = Prism.languages.markup; + } + }, + tokenizePlaceholders: { + value: function (env, language) { + if (env.language !== language || !env.tokenStack) { + return; + } + env.grammar = Prism.languages[language]; + var j = 0; + var keys = Object.keys(env.tokenStack); + function walkTokens(tokens) { + for (var i = 0; i < tokens.length; i++) { + if (j >= keys.length) { + break; + } + var token = tokens[i]; + if (typeof token === 'string' || token.content && typeof token.content === 'string') { + var k = keys[j]; + var t = env.tokenStack[k]; + var s = typeof token === 'string' ? token : token.content; + var placeholder = getPlaceholder(language, k); + var index = s.indexOf(placeholder); + if (index > -1) { + ++j; + var before = s.substring(0, index); + var middle = new Prism.Token(language, Prism.tokenize(t, env.grammar), 'language-' + language, t); + var after = s.substring(index + placeholder.length); + var replacement = []; + if (before) { + replacement.push.apply(replacement, walkTokens([before])); + } + replacement.push(middle); + if (after) { + replacement.push.apply(replacement, walkTokens([after])); + } + if (typeof token === 'string') { + tokens.splice.apply(tokens, [ + i, + 1 + ].concat(replacement)); + } else { + token.content = replacement; + } } - }); - Prism.languages.html = Prism.languages.markup; - Prism.languages.mathml = Prism.languages.markup; - Prism.languages.svg = Prism.languages.markup; - Prism.languages.xml = Prism.languages.extend('markup', {}); - Prism.languages.ssml = Prism.languages.xml; - Prism.languages.atom = Prism.languages.xml; - Prism.languages.rss = Prism.languages.xml; + } else if (token.content) { + walkTokens(token.content); + } + } + return tokens; + } + walkTokens(env.tokens); + } + } + }); + }(Prism)); + }, + {} + ], + 10: [ + function (require, module, exports) { + Prism.languages.markup = { + 'comment': //, + 'prolog': /<\?[\s\S]+?\?>/, + 'doctype': { + pattern: /"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i, + greedy: true, + inside: { + 'internal-subset': { + pattern: /(\[)[\s\S]+(?=\]>$)/, + lookbehind: true, + greedy: true, + inside: null }, - {} - ], - 11: [ - function (require, module, exports) { - (function (Prism) { - Prism.languages.php = Prism.languages.extend('clike', { - 'keyword': /\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|new|or|parent|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i, - 'boolean': { - pattern: /\b(?:false|true)\b/i, - alias: 'constant' - }, - 'constant': [ - /\b[A-Z_][A-Z0-9_]*\b/, - /\b(?:null)\b/i - ], - 'comment': { - pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/, - lookbehind: true - } - }); - Prism.languages.insertBefore('php', 'string', { - 'shell-comment': { - pattern: /(^|[^\\])#.*/, - lookbehind: true, - alias: 'comment' - } - }); - Prism.languages.insertBefore('php', 'comment', { - 'delimiter': { - pattern: /\?>$|^<\?(?:php(?=\s)|=)?/i, - alias: 'important' - } - }); - Prism.languages.insertBefore('php', 'keyword', { - 'variable': /\$+(?:\w+\b|(?={))/i, - 'package': { - pattern: /(\\|namespace\s+|use\s+)[\w\\]+/, - lookbehind: true, - inside: {punctuation: /\\/} - } - }); - Prism.languages.insertBefore('php', 'operator', { - 'property': { - pattern: /(->)[\w]+/, - lookbehind: true - } - }); - var string_interpolation = { - pattern: /{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)*)/, - lookbehind: true, - inside: Prism.languages.php - }; - Prism.languages.insertBefore('php', 'string', { - 'nowdoc-string': { - pattern: /<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/, - greedy: true, - alias: 'string', - inside: { - 'delimiter': { - pattern: /^<<<'[^']+'|[a-z_]\w*;$/i, - alias: 'symbol', - inside: {'punctuation': /^<<<'?|[';]$/} - } - } - }, - 'heredoc-string': { - pattern: /<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i, - greedy: true, - alias: 'string', - inside: { - 'delimiter': { - pattern: /^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i, - alias: 'symbol', - inside: {'punctuation': /^<<<"?|[";]$/} - }, - 'interpolation': string_interpolation - } - }, - 'single-quoted-string': { - pattern: /'(?:\\[\s\S]|[^\\'])*'/, - greedy: true, - alias: 'string' - }, - 'double-quoted-string': { - pattern: /"(?:\\[\s\S]|[^\\"])*"/, - greedy: true, - alias: 'string', - inside: {'interpolation': string_interpolation} - } - }); - delete Prism.languages.php['string']; - Prism.hooks.add('before-tokenize', function (env) { - if (!/<\?/.test(env.code)) { - return; - } - var phpPattern = /<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#)(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/ig; - Prism.languages['markup-templating'].buildPlaceholders(env, 'php', phpPattern); - }); - Prism.hooks.add('after-tokenize', function (env) { - Prism.languages['markup-templating'].tokenizePlaceholders(env, 'php'); - }); - }(Prism)); + 'string': { + pattern: /"[^"]*"|'[^']*'/, + greedy: true }, - {} - ], - 12: [ - function (require, module, exports) { - Prism.languages.python = { - 'comment': { - pattern: /(^|[^\\])#.*/, - lookbehind: true - }, - 'string-interpolation': { - pattern: /(?:f|rf|fr)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i, - greedy: true, - inside: { - 'interpolation': { - pattern: /((?:^|[^{])(?:{{)*){(?!{)(?:[^{}]|{(?!{)(?:[^{}]|{(?!{)(?:[^{}])+})+})+}/, - lookbehind: true, - inside: { - 'format-spec': { - pattern: /(:)[^:(){}]+(?=}$)/, - lookbehind: true - }, - 'conversion-option': { - pattern: /![sra](?=[:}]$)/, - alias: 'punctuation' - }, - rest: null - } - }, - 'string': /[\s\S]+/ - } - }, - 'triple-quoted-string': { - pattern: /(?:[rub]|rb|br)?("""|''')[\s\S]*?\1/i, - greedy: true, - alias: 'string' - }, - 'string': { - pattern: /(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i, - greedy: true - }, - 'function': { - pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g, - lookbehind: true - }, - 'class-name': { - pattern: /(\bclass\s+)\w+/i, - lookbehind: true - }, - 'decorator': { - pattern: /(^\s*)@\w+(?:\.\w+)*/im, - lookbehind: true, - alias: [ - 'annotation', - 'punctuation' - ], - inside: {'punctuation': /\./} - }, - 'keyword': /\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/, - 'builtin': /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/, - 'boolean': /\b(?:True|False|None)\b/, - 'number': /(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i, - 'operator': /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/, - 'punctuation': /[{}[\];(),.:]/ - }; - Prism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python; - Prism.languages.py = Prism.languages.python; + 'punctuation': /^$|[[\]]/, + 'doctype-tag': /^DOCTYPE/, + 'name': /[^\s<>'"]+/ + } + }, + 'cdata': //i, + 'tag': { + pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/, + greedy: true, + inside: { + 'tag': { + pattern: /^<\/?[^\s>\/]+/, + inside: { + 'punctuation': /^<\/?/, + 'namespace': /^[^\s>\/:]+:/ + } }, - {} - ], - 13: [ - function (require, module, exports) { - (function (Prism) { - Prism.languages.ruby = Prism.languages.extend('clike', { - 'comment': [ - /#.*/, - { - pattern: /^=begin\s[\s\S]*?^=end/m, - greedy: true - } - ], - 'class-name': { - pattern: /(\b(?:class)\s+|\bcatch\s+\()[\w.\\]+/i, - lookbehind: true, - inside: {'punctuation': /[.\\]/} - }, - 'keyword': /\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/ - }); - var interpolation = { - pattern: /#\{[^}]+\}/, - inside: { - 'delimiter': { - pattern: /^#\{|\}$/, - alias: 'tag' - }, - rest: Prism.languages.ruby - } - }; - delete Prism.languages.ruby.function; - Prism.languages.insertBefore('ruby', 'keyword', { - 'regex': [ - { - pattern: RegExp(/%r/.source + '(?:' + [ - /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1[gim]{0,3}/.source, - /\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/.source, - /\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/.source, - /\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/.source, - /<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/.source - ].join('|') + ')'), - greedy: true, - inside: {'interpolation': interpolation} - }, - { - pattern: /(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[gim]{0,3}(?=\s*(?:$|[\r\n,.;})]))/, - lookbehind: true, - greedy: true - } - ], - 'variable': /[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/, - 'symbol': { - pattern: /(^|[^:]):[a-zA-Z_]\w*(?:[?!]|\b)/, - lookbehind: true - }, - 'method-definition': { - pattern: /(\bdef\s+)[\w.]+/, - lookbehind: true, - inside: { - 'function': /\w+$/, - rest: Prism.languages.ruby - } - } - }); - Prism.languages.insertBefore('ruby', 'number', { - 'builtin': /\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|Fixnum|Float|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/, - 'constant': /\b[A-Z]\w*(?:[?!]|\b)/ - }); - Prism.languages.ruby.string = [ - { - pattern: RegExp(/%[qQiIwWxs]?/.source + '(?:' + [ - /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source, - /\((?:[^()\\]|\\[\s\S])*\)/.source, - /\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source, - /\[(?:[^\[\]\\]|\\[\s\S])*\]/.source, - /<(?:[^<>\\]|\\[\s\S])*>/.source - ].join('|') + ')'), - greedy: true, - inside: {'interpolation': interpolation} - }, - { - pattern: /("|')(?:#\{[^}]+\}|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, - greedy: true, - inside: {'interpolation': interpolation} - } - ]; - Prism.languages.rb = Prism.languages.ruby; - }(Prism)); + 'attr-value': { + pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/, + inside: { + 'punctuation': [ + { + pattern: /^=/, + alias: 'attr-equals' + }, + /"|'/ + ] + } }, - {} - ], - 14: [ - function (require, module, exports) { - var Prism = require('prismjs/components/prism-core'); - require('prismjs/components/prism-clike'); - require('prismjs/components/prism-markup-templating'); - require('prismjs/components/prism-c'); - require('prismjs/components/prism-cpp'); - require('prismjs/components/prism-csharp'); - require('prismjs/components/prism-css'); - require('prismjs/components/prism-java'); - require('prismjs/components/prism-javascript'); - require('prismjs/components/prism-markup'); - require('prismjs/components/prism-php'); - require('prismjs/components/prism-python'); - require('prismjs/components/prism-ruby'); - module.exports = {boltExport: Prism}; + 'punctuation': /\/?>/, + 'attr-name': { + pattern: /[^\s>\/]+/, + inside: { 'namespace': /^[^\s>\/:]+:/ } + } + } + }, + 'entity': [ + { + pattern: /&[\da-z]{1,8};/i, + alias: 'named-entity' + }, + /&#x?[\da-f]{1,8};/i + ] + }; + Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] = Prism.languages.markup['entity']; + Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup; + Prism.hooks.add('wrap', function (env) { + if (env.type === 'entity') { + env.attributes['title'] = env.content.replace(/&/, '&'); + } + }); + Object.defineProperty(Prism.languages.markup.tag, 'addInlined', { + value: function addInlined(tagName, lang) { + var includedCdataInside = {}; + includedCdataInside['language-' + lang] = { + pattern: /(^$)/i, + lookbehind: true, + inside: Prism.languages[lang] + }; + includedCdataInside['cdata'] = /^$/i; + var inside = { + 'included-cdata': { + pattern: //i, + inside: includedCdataInside + } + }; + inside['language-' + lang] = { + pattern: /[\s\S]+/, + inside: Prism.languages[lang] + }; + var def = {}; + def[tagName] = { + pattern: RegExp(/(<__[\s\S]*?>)(?:))*\]\]>|(?!)/.source.replace(/__/g, function () { + return tagName; + }), 'i'), + lookbehind: true, + greedy: true, + inside: inside + }; + Prism.languages.insertBefore('markup', 'cdata', def); + } + }); + Prism.languages.html = Prism.languages.markup; + Prism.languages.mathml = Prism.languages.markup; + Prism.languages.svg = Prism.languages.markup; + Prism.languages.xml = Prism.languages.extend('markup', {}); + Prism.languages.ssml = Prism.languages.xml; + Prism.languages.atom = Prism.languages.xml; + Prism.languages.rss = Prism.languages.xml; + }, + {} + ], + 11: [ + function (require, module, exports) { + (function (Prism) { + Prism.languages.php = Prism.languages.extend('clike', { + 'keyword': /\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|new|or|parent|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i, + 'boolean': { + pattern: /\b(?:false|true)\b/i, + alias: 'constant' + }, + 'constant': [ + /\b[A-Z_][A-Z0-9_]*\b/, + /\b(?:null)\b/i + ], + 'comment': { + pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/, + lookbehind: true + } + }); + Prism.languages.insertBefore('php', 'string', { + 'shell-comment': { + pattern: /(^|[^\\])#.*/, + lookbehind: true, + alias: 'comment' + } + }); + Prism.languages.insertBefore('php', 'comment', { + 'delimiter': { + pattern: /\?>$|^<\?(?:php(?=\s)|=)?/i, + alias: 'important' + } + }); + Prism.languages.insertBefore('php', 'keyword', { + 'variable': /\$+(?:\w+\b|(?={))/i, + 'package': { + pattern: /(\\|namespace\s+|use\s+)[\w\\]+/, + lookbehind: true, + inside: { punctuation: /\\/ } + } + }); + Prism.languages.insertBefore('php', 'operator', { + 'property': { + pattern: /(->)[\w]+/, + lookbehind: true + } + }); + var string_interpolation = { + pattern: /{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)*)/, + lookbehind: true, + inside: Prism.languages.php + }; + Prism.languages.insertBefore('php', 'string', { + 'nowdoc-string': { + pattern: /<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/, + greedy: true, + alias: 'string', + inside: { + 'delimiter': { + pattern: /^<<<'[^']+'|[a-z_]\w*;$/i, + alias: 'symbol', + inside: { 'punctuation': /^<<<'?|[';]$/ } + } + } + }, + 'heredoc-string': { + pattern: /<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i, + greedy: true, + alias: 'string', + inside: { + 'delimiter': { + pattern: /^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i, + alias: 'symbol', + inside: { 'punctuation': /^<<<"?|[";]$/ } + }, + 'interpolation': string_interpolation + } + }, + 'single-quoted-string': { + pattern: /'(?:\\[\s\S]|[^\\'])*'/, + greedy: true, + alias: 'string' + }, + 'double-quoted-string': { + pattern: /"(?:\\[\s\S]|[^\\"])*"/, + greedy: true, + alias: 'string', + inside: { 'interpolation': string_interpolation } + } + }); + delete Prism.languages.php['string']; + Prism.hooks.add('before-tokenize', function (env) { + if (!/<\?/.test(env.code)) { + return; + } + var phpPattern = /<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#)(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/ig; + Prism.languages['markup-templating'].buildPlaceholders(env, 'php', phpPattern); + }); + Prism.hooks.add('after-tokenize', function (env) { + Prism.languages['markup-templating'].tokenizePlaceholders(env, 'php'); + }); + }(Prism)); + }, + {} + ], + 12: [ + function (require, module, exports) { + Prism.languages.python = { + 'comment': { + pattern: /(^|[^\\])#.*/, + lookbehind: true + }, + 'string-interpolation': { + pattern: /(?:f|rf|fr)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i, + greedy: true, + inside: { + 'interpolation': { + pattern: /((?:^|[^{])(?:{{)*){(?!{)(?:[^{}]|{(?!{)(?:[^{}]|{(?!{)(?:[^{}])+})+})+}/, + lookbehind: true, + inside: { + 'format-spec': { + pattern: /(:)[^:(){}]+(?=}$)/, + lookbehind: true + }, + 'conversion-option': { + pattern: /![sra](?=[:}]$)/, + alias: 'punctuation' + }, + rest: null + } }, + 'string': /[\s\S]+/ + } + }, + 'triple-quoted-string': { + pattern: /(?:[rub]|rb|br)?("""|''')[\s\S]*?\1/i, + greedy: true, + alias: 'string' + }, + 'string': { + pattern: /(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i, + greedy: true + }, + 'function': { + pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g, + lookbehind: true + }, + 'class-name': { + pattern: /(\bclass\s+)\w+/i, + lookbehind: true + }, + 'decorator': { + pattern: /(^\s*)@\w+(?:\.\w+)*/im, + lookbehind: true, + alias: [ + 'annotation', + 'punctuation' + ], + inside: { 'punctuation': /\./ } + }, + 'keyword': /\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/, + 'builtin': /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/, + 'boolean': /\b(?:True|False|None)\b/, + 'number': /(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i, + 'operator': /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/, + 'punctuation': /[{}[\];(),.:]/ + }; + Prism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python; + Prism.languages.py = Prism.languages.python; + }, + {} + ], + 13: [ + function (require, module, exports) { + (function (Prism) { + Prism.languages.ruby = Prism.languages.extend('clike', { + 'comment': [ + /#.*/, { - 'prismjs/components/prism-c': 1, - 'prismjs/components/prism-clike': 2, - 'prismjs/components/prism-core': 3, - 'prismjs/components/prism-cpp': 4, - 'prismjs/components/prism-csharp': 5, - 'prismjs/components/prism-css': 6, - 'prismjs/components/prism-java': 7, - 'prismjs/components/prism-javascript': 8, - 'prismjs/components/prism-markup': 10, - 'prismjs/components/prism-markup-templating': 9, - 'prismjs/components/prism-php': 11, - 'prismjs/components/prism-python': 12, - 'prismjs/components/prism-ruby': 13 + pattern: /^=begin\s[\s\S]*?^=end/m, + greedy: true } - ] - }, {}, [14])(14); - })); - var prism = window.Prism; - window.Prism = oldprism; - return prism; + ], + 'class-name': { + pattern: /(\b(?:class)\s+|\bcatch\s+\()[\w.\\]+/i, + lookbehind: true, + inside: { 'punctuation': /[.\\]/ } + }, + 'keyword': /\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/ + }); + var interpolation = { + pattern: /#\{[^}]+\}/, + inside: { + 'delimiter': { + pattern: /^#\{|\}$/, + alias: 'tag' + }, + rest: Prism.languages.ruby + } + }; + delete Prism.languages.ruby.function; + Prism.languages.insertBefore('ruby', 'keyword', { + 'regex': [ + { + pattern: RegExp(/%r/.source + '(?:' + [ + /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1[gim]{0,3}/.source, + /\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/.source, + /\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/.source, + /\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/.source, + /<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/.source + ].join('|') + ')'), + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[gim]{0,3}(?=\s*(?:$|[\r\n,.;})]))/, + lookbehind: true, + greedy: true + } + ], + 'variable': /[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/, + 'symbol': { + pattern: /(^|[^:]):[a-zA-Z_]\w*(?:[?!]|\b)/, + lookbehind: true + }, + 'method-definition': { + pattern: /(\bdef\s+)[\w.]+/, + lookbehind: true, + inside: { + 'function': /\w+$/, + rest: Prism.languages.ruby + } + } + }); + Prism.languages.insertBefore('ruby', 'number', { + 'builtin': /\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|Fixnum|Float|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/, + 'constant': /\b[A-Z]\w*(?:[?!]|\b)/ + }); + Prism.languages.ruby.string = [ + { + pattern: RegExp(/%[qQiIwWxs]?/.source + '(?:' + [ + /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source, + /\((?:[^()\\]|\\[\s\S])*\)/.source, + /\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source, + /\[(?:[^\[\]\\]|\\[\s\S])*\]/.source, + /<(?:[^<>\\]|\\[\s\S])*>/.source + ].join('|') + ')'), + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /("|')(?:#\{[^}]+\}|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true, + inside: { 'interpolation': interpolation } + } + ]; + Prism.languages.rb = Prism.languages.ruby; + }(Prism)); + }, + {} + ], + 14: [ + function (require, module, exports) { + var Prism = require('prismjs/components/prism-core'); + require('prismjs/components/prism-clike'); + require('prismjs/components/prism-markup-templating'); + require('prismjs/components/prism-c'); + require('prismjs/components/prism-cpp'); + require('prismjs/components/prism-csharp'); + require('prismjs/components/prism-css'); + require('prismjs/components/prism-java'); + require('prismjs/components/prism-javascript'); + require('prismjs/components/prism-markup'); + require('prismjs/components/prism-php'); + require('prismjs/components/prism-python'); + require('prismjs/components/prism-ruby'); + module.exports = { boltExport: Prism }; + }, + { + 'prismjs/components/prism-c': 1, + 'prismjs/components/prism-clike': 2, + 'prismjs/components/prism-core': 3, + 'prismjs/components/prism-cpp': 4, + 'prismjs/components/prism-csharp': 5, + 'prismjs/components/prism-css': 6, + 'prismjs/components/prism-java': 7, + 'prismjs/components/prism-javascript': 8, + 'prismjs/components/prism-markup': 10, + 'prismjs/components/prism-markup-templating': 9, + 'prismjs/components/prism-php': 11, + 'prismjs/components/prism-python': 12, + 'prismjs/components/prism-ruby': 13 + } + ] + }, {}, [14])(14); + })); + var prism = window.Prism; + window.Prism = oldprism; + return prism; }(undefined, exports$1, module, undefined)); var Prism$1 = module.exports.boltExport; var getLanguages = function (editor) { - return editor.getParam('codesample_languages'); + return editor.getParam('codesample_languages'); }; var useGlobalPrismJS = function (editor) { - return editor.getParam('codesample_global_prismjs', false, 'boolean'); + return editor.getParam('codesample_global_prismjs', false, 'boolean'); }; var get$1 = function (editor) { - return Global.Prism && useGlobalPrismJS(editor) ? Global.Prism : Prism$1; + return Global.Prism && useGlobalPrismJS(editor) ? Global.Prism : Prism$1; }; var getSelectedCodeSample = function (editor) { - var node = editor.selection ? editor.selection.getNode() : null; - if (isCodeSample(node)) { - return Optional.some(node); - } - return Optional.none(); + var node = editor.selection ? editor.selection.getNode() : null; + if (isCodeSample(node)) { + return Optional.some(node); + } + return Optional.none(); }; var insertCodeSample = function (editor, language, code) { - editor.undoManager.transact(function () { - var node = getSelectedCodeSample(editor); - code = global$1.DOM.encode(code); - return node.fold(function () { - editor.insertContent('

              ' + code + '
              '); - editor.selection.select(editor.$('#__new').removeAttr('id')[0]); - }, function (n) { - editor.dom.setAttrib(n, 'class', 'language-' + language); - n.innerHTML = code; - get$1(editor).highlightElement(n); - editor.selection.select(n); - }); - }); - }; - var getCurrentCode = function (editor) { + editor.undoManager.transact(function () { var node = getSelectedCodeSample(editor); + code = global$1.DOM.encode(code); return node.fold(function () { - return ''; + editor.insertContent('
              ' + code + '
              '); + editor.selection.select(editor.$('#__new').removeAttr('id')[0]); }, function (n) { - return n.textContent; + editor.dom.setAttrib(n, 'class', 'language-' + language); + n.innerHTML = code; + get$1(editor).highlightElement(n); + editor.selection.select(n); }); + }); + }; + var getCurrentCode = function (editor) { + var node = getSelectedCodeSample(editor); + return node.fold(function () { + return ''; + }, function (n) { + return n.textContent; + }); }; var getLanguages$1 = function (editor) { - var defaultLanguages = [ - { - text: 'HTML/XML', - value: 'markup' - }, - { - text: 'JavaScript', - value: 'javascript' - }, - { - text: 'CSS', - value: 'css' - }, - { - text: 'PHP', - value: 'php' - }, - { - text: 'Ruby', - value: 'ruby' - }, - { - text: 'Python', - value: 'python' - }, - { - text: 'Java', - value: 'java' - }, - { - text: 'C', - value: 'c' - }, - { - text: 'C#', - value: 'csharp' - }, - { - text: 'C++', - value: 'cpp' - } - ]; - var customLanguages = getLanguages(editor); - return customLanguages ? customLanguages : defaultLanguages; + var defaultLanguages = [ + { + text: 'HTML/XML', + value: 'markup' + }, + { + text: 'JavaScript', + value: 'javascript' + }, + { + text: 'CSS', + value: 'css' + }, + { + text: 'PHP', + value: 'php' + }, + { + text: 'Ruby', + value: 'ruby' + }, + { + text: 'Python', + value: 'python' + }, + { + text: 'Java', + value: 'java' + }, + { + text: 'C', + value: 'c' + }, + { + text: 'C#', + value: 'csharp' + }, + { + text: 'C++', + value: 'cpp' + } + ]; + var customLanguages = getLanguages(editor); + return customLanguages ? customLanguages : defaultLanguages; }; var getCurrentLanguage = function (editor, fallback) { - var node = getSelectedCodeSample(editor); - return node.fold(function () { - return fallback; - }, function (n) { - var matches = n.className.match(/language-(\w+)/); - return matches ? matches[1] : fallback; - }); + var node = getSelectedCodeSample(editor); + return node.fold(function () { + return fallback; + }, function (n) { + var matches = n.className.match(/language-(\w+)/); + return matches ? matches[1] : fallback; + }); }; var open = function (editor) { - var languages = getLanguages$1(editor); - var defaultLanguage = head(languages).fold(function () { - return ''; - }, function (l) { - return l.value; - }); - var currentLanguage = getCurrentLanguage(editor, defaultLanguage); - var currentCode = getCurrentCode(editor); - editor.windowManager.open({ - title: 'Insert/Edit Code Sample', - size: 'large', - body: { - type: 'panel', - items: [ - { - type: 'selectbox', - name: 'language', - label: 'Language', - items: languages - }, - { - type: 'textarea', - name: 'code', - label: 'Code view' - } - ] - }, - buttons: [ - { - type: 'cancel', - name: 'cancel', - text: 'Cancel' - }, - { - type: 'submit', - name: 'save', - text: 'Save', - primary: true - } - ], - initialData: { - language: currentLanguage, - code: currentCode + var languages = getLanguages$1(editor); + var defaultLanguage = head(languages).fold(function () { + return ''; + }, function (l) { + return l.value; + }); + var currentLanguage = getCurrentLanguage(editor, defaultLanguage); + var currentCode = getCurrentCode(editor); + editor.windowManager.open({ + title: 'Insert/Edit Code Sample', + size: 'large', + body: { + type: 'panel', + items: [ + { + type: 'selectbox', + name: 'language', + label: 'Language', + items: languages }, - onSubmit: function (api) { - var data = api.getData(); - insertCodeSample(editor, data.language, data.code); - api.close(); + { + type: 'textarea', + name: 'code', + label: 'Code view' } - }); + ] + }, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: { + language: currentLanguage, + code: currentCode + }, + onSubmit: function (api) { + var data = api.getData(); + insertCodeSample(editor, data.language, data.code); + api.close(); + } + }); }; var register = function (editor) { - editor.addCommand('codesample', function () { - var node = editor.selection.getNode(); - if (editor.selection.isCollapsed() || isCodeSample(node)) { - open(editor); - } else { - editor.formatter.toggle('code'); - } - }); + editor.addCommand('codesample', function () { + var node = editor.selection.getNode(); + if (editor.selection.isCollapsed() || isCodeSample(node)) { + open(editor); + } else { + editor.formatter.toggle('code'); + } + }); }; var setup = function (editor) { - var $ = editor.$; - editor.on('PreProcess', function (e) { - $('pre[contenteditable=false]', e.node).filter(trimArg(isCodeSample)).each(function (idx, elm) { - var $elm = $(elm), code = elm.textContent; - $elm.attr('class', $.trim($elm.attr('class'))); - $elm.removeAttr('contentEditable'); - $elm.empty().append($('').each(function () { - this.textContent = code; - })); - }); + var $ = editor.$; + editor.on('PreProcess', function (e) { + $('pre[contenteditable=false]', e.node).filter(trimArg(isCodeSample)).each(function (idx, elm) { + var $elm = $(elm), code = elm.textContent; + $elm.attr('class', $.trim($elm.attr('class'))); + $elm.removeAttr('contentEditable'); + $elm.empty().append($('').each(function () { + this.textContent = code; + })); }); - editor.on('SetContent', function () { - var unprocessedCodeSamples = $('pre').filter(trimArg(isCodeSample)).filter(function (idx, elm) { - return elm.contentEditable !== 'false'; - }); - if (unprocessedCodeSamples.length) { - editor.undoManager.transact(function () { - unprocessedCodeSamples.each(function (idx, elm) { - $(elm).find('br').each(function (idx, elm) { - elm.parentNode.replaceChild(editor.getDoc().createTextNode('\n'), elm); - }); - elm.contentEditable = 'false'; - elm.innerHTML = editor.dom.encode(elm.textContent); - get$1(editor).highlightElement(elm); - elm.className = $.trim(elm.className); - }); - }); - } + }); + editor.on('SetContent', function () { + var unprocessedCodeSamples = $('pre').filter(trimArg(isCodeSample)).filter(function (idx, elm) { + return elm.contentEditable !== 'false'; }); + if (unprocessedCodeSamples.length) { + editor.undoManager.transact(function () { + unprocessedCodeSamples.each(function (idx, elm) { + $(elm).find('br').each(function (idx, elm) { + elm.parentNode.replaceChild(editor.getDoc().createTextNode('\n'), elm); + }); + elm.contentEditable = 'false'; + elm.innerHTML = editor.dom.encode(elm.textContent); + get$1(editor).highlightElement(elm); + elm.className = $.trim(elm.className); + }); + }); + } + }); }; var isCodeSampleSelection = function (editor) { - var node = editor.selection.getStart(); - return editor.dom.is(node, 'pre[class*="language-"]'); + var node = editor.selection.getStart(); + return editor.dom.is(node, 'pre[class*="language-"]'); }; var register$1 = function (editor) { - editor.ui.registry.addToggleButton('codesample', { - icon: 'code-sample', - tooltip: 'Insert/edit code sample', - onAction: function () { - return open(editor); - }, - onSetup: function (api) { - var nodeChangeHandler = function () { - api.setActive(isCodeSampleSelection(editor)); - }; - editor.on('NodeChange', nodeChangeHandler); - return function () { - return editor.off('NodeChange', nodeChangeHandler); - }; - } - }); - editor.ui.registry.addMenuItem('codesample', { - text: 'Code sample...', - icon: 'code-sample', - onAction: function () { - return open(editor); - } - }); + editor.ui.registry.addToggleButton('codesample', { + icon: 'code-sample', + tooltip: 'Insert/edit code sample', + onAction: function () { + return open(editor); + }, + onSetup: function (api) { + var nodeChangeHandler = function () { + api.setActive(isCodeSampleSelection(editor)); + }; + editor.on('NodeChange', nodeChangeHandler); + return function () { + return editor.off('NodeChange', nodeChangeHandler); + }; + } + }); + editor.ui.registry.addMenuItem('codesample', { + text: 'Code sample...', + icon: 'code-sample', + onAction: function () { + return open(editor); + } + }); }; - function Plugin() { - global.add('codesample', function (editor) { - setup(editor); - register$1(editor); - register(editor); - editor.on('dblclick', function (ev) { - if (isCodeSample(ev.target)) { - open(editor); - } - }); + function Plugin () { + global.add('codesample', function (editor) { + setup(editor); + register$1(editor); + register(editor); + editor.on('dblclick', function (ev) { + if (isCodeSample(ev.target)) { + open(editor); + } }); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/colorpicker/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/colorpicker/plugin.js index c62e7ee0..c8cbff2d 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/colorpicker/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/colorpicker/plugin.js @@ -11,10 +11,10 @@ var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); - function Plugin() { - global.add('colorpicker', function () { - console.warn('Color picker plugin is now built in to the core editor, please remove it from your editor configuration'); - }); + function Plugin () { + global.add('colorpicker', function () { + console.warn('Color picker plugin is now built in to the core editor, please remove it from your editor configuration'); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/contextmenu/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/contextmenu/plugin.js index 375e15cf..084e2876 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/contextmenu/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/contextmenu/plugin.js @@ -11,10 +11,10 @@ var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); - function Plugin() { - global.add('contextmenu', function () { - console.warn('Context menu plugin is now built in to the core editor, please remove it from your editor configuration'); - }); + function Plugin () { + global.add('contextmenu', function () { + console.warn('Context menu plugin is now built in to the core editor, please remove it from your editor configuration'); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/directionality/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/directionality/plugin.js index 1b1f38af..fc9e6eb5 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/directionality/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/directionality/plugin.js @@ -14,196 +14,196 @@ var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var setDir = function (editor, dir) { - var dom = editor.dom; - var curDir; - var blocks = editor.selection.getSelectedBlocks(); - if (blocks.length) { - curDir = dom.getAttrib(blocks[0], 'dir'); - global$1.each(blocks, function (block) { - if (!dom.getParent(block.parentNode, '*[dir="' + dir + '"]', dom.getRoot())) { - dom.setAttrib(block, 'dir', curDir !== dir ? dir : null); - } - }); - editor.nodeChanged(); - } + var dom = editor.dom; + var curDir; + var blocks = editor.selection.getSelectedBlocks(); + if (blocks.length) { + curDir = dom.getAttrib(blocks[0], 'dir'); + global$1.each(blocks, function (block) { + if (!dom.getParent(block.parentNode, '*[dir="' + dir + '"]', dom.getRoot())) { + dom.setAttrib(block, 'dir', curDir !== dir ? dir : null); + } + }); + editor.nodeChanged(); + } }; var register = function (editor) { - editor.addCommand('mceDirectionLTR', function () { - setDir(editor, 'ltr'); - }); - editor.addCommand('mceDirectionRTL', function () { - setDir(editor, 'rtl'); - }); + editor.addCommand('mceDirectionLTR', function () { + setDir(editor, 'ltr'); + }); + editor.addCommand('mceDirectionRTL', function () { + setDir(editor, 'rtl'); + }); }; var noop = function () { }; var compose1 = function (fbc, fab) { - return function (a) { - return fbc(fab(a)); - }; + return function (a) { + return fbc(fab(a)); + }; }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; var never = constant(false); var always = constant(true); var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var isSimpleType = function (type) { - return function (value) { - return typeof value === type; - }; + return function (value) { + return typeof value === type; + }; }; var isFunction = isSimpleType('function'); var isSupported = function (dom) { - return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); }; var fromHtml = function (html, scope) { - var doc = scope || document; - var div = doc.createElement('div'); - div.innerHTML = html; - if (!div.hasChildNodes() || div.childNodes.length > 1) { - console.error('HTML does not have a single root node', html); - throw new Error('HTML must have a single root node'); - } - return fromDom(div.childNodes[0]); + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); }; var fromTag = function (tag, scope) { - var doc = scope || document; - var node = doc.createElement(tag); - return fromDom(node); + var doc = scope || document; + var node = doc.createElement(tag); + return fromDom(node); }; var fromText = function (text, scope) { - var doc = scope || document; - var node = doc.createTextNode(text); - return fromDom(node); + var doc = scope || document; + var node = doc.createTextNode(text); + return fromDom(node); }; var fromDom = function (node) { - if (node === null || node === undefined) { - throw new Error('Node cannot be null or undefined'); - } - return {dom: node}; + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: node }; }; var fromPoint = function (docElm, x, y) { - return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); + return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); }; var SugarElement = { - fromHtml: fromHtml, - fromTag: fromTag, - fromText: fromText, - fromDom: fromDom, - fromPoint: fromPoint + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint }; var Global = typeof window !== 'undefined' ? window : Function('return this;')(); @@ -213,100 +213,100 @@ var TEXT = 3; var type = function (element) { - return element.dom.nodeType; + return element.dom.nodeType; }; var isType = function (t) { - return function (element) { - return type(element) === t; - }; + return function (element) { + return type(element) === t; + }; }; var isText = isType(TEXT); var isDocument = isType(DOCUMENT); var isDocumentFragment = isType(DOCUMENT_FRAGMENT); var owner = function (element) { - return SugarElement.fromDom(element.dom.ownerDocument); + return SugarElement.fromDom(element.dom.ownerDocument); }; var documentOrOwner = function (dos) { - return isDocument(dos) ? dos : owner(dos); + return isDocument(dos) ? dos : owner(dos); }; var isShadowRoot = function (dos) { - return isDocumentFragment(dos); + return isDocumentFragment(dos); }; var supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode); var getRootNode = supported ? function (e) { - return SugarElement.fromDom(e.dom.getRootNode()); + return SugarElement.fromDom(e.dom.getRootNode()); } : documentOrOwner; var getShadowRoot = function (e) { - var r = getRootNode(e); - return isShadowRoot(r) ? Optional.some(r) : Optional.none(); + var r = getRootNode(e); + return isShadowRoot(r) ? Optional.some(r) : Optional.none(); }; var getShadowHost = function (e) { - return SugarElement.fromDom(e.dom.host); + return SugarElement.fromDom(e.dom.host); }; var inBody = function (element) { - var dom = isText(element) ? element.dom.parentNode : element.dom; - if (dom === undefined || dom === null || dom.ownerDocument === null) { - return false; - } - var doc = dom.ownerDocument; - return getShadowRoot(SugarElement.fromDom(dom)).fold(function () { - return doc.body.contains(dom); - }, compose1(inBody, getShadowHost)); + var dom = isText(element) ? element.dom.parentNode : element.dom; + if (dom === undefined || dom === null || dom.ownerDocument === null) { + return false; + } + var doc = dom.ownerDocument; + return getShadowRoot(SugarElement.fromDom(dom)).fold(function () { + return doc.body.contains(dom); + }, compose1(inBody, getShadowHost)); }; var get = function (element, property) { - var dom = element.dom; - var styles = window.getComputedStyle(dom); - var r = styles.getPropertyValue(property); - return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; + var dom = element.dom; + var styles = window.getComputedStyle(dom); + var r = styles.getPropertyValue(property); + return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; }; var getUnsafeProperty = function (dom, property) { - return isSupported(dom) ? dom.style.getPropertyValue(property) : ''; + return isSupported(dom) ? dom.style.getPropertyValue(property) : ''; }; var getDirection = function (element) { - return get(element, 'direction') === 'rtl' ? 'rtl' : 'ltr'; + return get(element, 'direction') === 'rtl' ? 'rtl' : 'ltr'; }; var getNodeChangeHandler = function (editor, dir) { - return function (api) { - var nodeChangeHandler = function (e) { - var element = SugarElement.fromDom(e.element); - api.setActive(getDirection(element) === dir); - }; - editor.on('NodeChange', nodeChangeHandler); - return function () { - return editor.off('NodeChange', nodeChangeHandler); - }; + return function (api) { + var nodeChangeHandler = function (e) { + var element = SugarElement.fromDom(e.element); + api.setActive(getDirection(element) === dir); + }; + editor.on('NodeChange', nodeChangeHandler); + return function () { + return editor.off('NodeChange', nodeChangeHandler); }; + }; }; var register$1 = function (editor) { - editor.ui.registry.addToggleButton('ltr', { - tooltip: 'Left to right', - icon: 'ltr', - onAction: function () { - return editor.execCommand('mceDirectionLTR'); - }, - onSetup: getNodeChangeHandler(editor, 'ltr') - }); - editor.ui.registry.addToggleButton('rtl', { - tooltip: 'Right to left', - icon: 'rtl', - onAction: function () { - return editor.execCommand('mceDirectionRTL'); - }, - onSetup: getNodeChangeHandler(editor, 'rtl') - }); + editor.ui.registry.addToggleButton('ltr', { + tooltip: 'Left to right', + icon: 'ltr', + onAction: function () { + return editor.execCommand('mceDirectionLTR'); + }, + onSetup: getNodeChangeHandler(editor, 'ltr') + }); + editor.ui.registry.addToggleButton('rtl', { + tooltip: 'Right to left', + icon: 'rtl', + onAction: function () { + return editor.execCommand('mceDirectionRTL'); + }, + onSetup: getNodeChangeHandler(editor, 'rtl') + }); }; - function Plugin() { - global.add('directionality', function (editor) { - register(editor); - register$1(editor); - }); + function Plugin () { + global.add('directionality', function (editor) { + register(editor); + register$1(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/emoticons/js/emojiimages.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/emoticons/js/emojiimages.js index 1e2b26a0..0c7d3b53 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/emoticons/js/emojiimages.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/emoticons/js/emojiimages.js @@ -1,9424 +1,9424 @@ // Source: npm package: emojilib // Images provided by twemoji: https://github.com/twitter/twemoji window.tinymce.Resource.add("tinymce.plugins.emoticons", { - 100: { - keywords: ["score", "perfect", "numbers", "century", "exam", "quiz", "test", "pass", "hundred"], - "char": '\ud83d\udcaf', - fitzpatrick_scale: false, - category: "symbols" - }, - 1234: { - keywords: ["numbers", "blue-square"], - "char": '\ud83d\udd22', - fitzpatrick_scale: false, - category: "symbols" - }, - grinning: { - keywords: ["face", "smile", "happy", "joy", ":D", "grin"], - "char": '\ud83d\ude00', - fitzpatrick_scale: false, - category: "people" - }, - grimacing: { - keywords: ["face", "grimace", "teeth"], - "char": '\ud83d\ude2c', - fitzpatrick_scale: false, - category: "people" - }, - grin: { - keywords: ["face", "happy", "smile", "joy", "kawaii"], - "char": '\ud83d\ude01', - fitzpatrick_scale: false, - category: "people" - }, - joy: { - keywords: ["face", "cry", "tears", "weep", "happy", "happytears", "haha"], - "char": '\ud83d\ude02', - fitzpatrick_scale: false, - category: "people" - }, - rofl: { - keywords: ["face", "rolling", "floor", "laughing", "lol", "haha"], - "char": '\ud83e\udd23', - fitzpatrick_scale: false, - category: "people" - }, - partying: { - keywords: ["face", "celebration", "woohoo"], - "char": '\ud83e\udd73', - fitzpatrick_scale: false, - category: "people" - }, - smiley: { - keywords: ["face", "happy", "joy", "haha", ":D", ":)", "smile", "funny"], - "char": '\ud83d\ude03', - fitzpatrick_scale: false, - category: "people" - }, - smile: { - keywords: ["face", "happy", "joy", "funny", "haha", "laugh", "like", ":D", ":)"], - "char": '\ud83d\ude04', - fitzpatrick_scale: false, - category: "people" - }, - sweat_smile: { - keywords: ["face", "hot", "happy", "laugh", "sweat", "smile", "relief"], - "char": '\ud83d\ude05', - fitzpatrick_scale: false, - category: "people" - }, - laughing: { - keywords: ["happy", "joy", "lol", "satisfied", "haha", "face", "glad", "XD", "laugh"], - "char": '\ud83d\ude06', - fitzpatrick_scale: false, - category: "people" - }, - innocent: { - keywords: ["face", "angel", "heaven", "halo"], - "char": '\ud83d\ude07', - fitzpatrick_scale: false, - category: "people" - }, - wink: { - keywords: ["face", "happy", "mischievous", "secret", ";)", "smile", "eye"], - "char": '\ud83d\ude09', - fitzpatrick_scale: false, - category: "people" - }, - blush: { - keywords: ["face", "smile", "happy", "flushed", "crush", "embarrassed", "shy", "joy"], - "char": '\ud83d\ude0a', - fitzpatrick_scale: false, - category: "people" - }, - slightly_smiling_face: { - keywords: ["face", "smile"], - "char": '\ud83d\ude42', - fitzpatrick_scale: false, - category: "people" - }, - upside_down_face: { - keywords: ["face", "flipped", "silly", "smile"], - "char": '\ud83d\ude43', - fitzpatrick_scale: false, - category: "people" - }, - relaxed: { - keywords: ["face", "blush", "massage", "happiness"], - "char": '\u263a\ufe0f', - fitzpatrick_scale: false, - category: "people" - }, - yum: { - keywords: ["happy", "joy", "tongue", "smile", "face", "silly", "yummy", "nom", "delicious", "savouring"], - "char": '\ud83d\ude0b', - fitzpatrick_scale: false, - category: "people" - }, - relieved: { - keywords: ["face", "relaxed", "phew", "massage", "happiness"], - "char": '\ud83d\ude0c', - fitzpatrick_scale: false, - category: "people" - }, - heart_eyes: { - keywords: ["face", "love", "like", "affection", "valentines", "infatuation", "crush", "heart"], - "char": '\ud83d\ude0d', - fitzpatrick_scale: false, - category: "people" - }, - smiling_face_with_three_hearts: { - keywords: ["face", "love", "like", "affection", "valentines", "infatuation", "crush", "hearts", "adore"], - "char": '\ud83e\udd70', - fitzpatrick_scale: false, - category: "people" - }, - kissing_heart: { - keywords: ["face", "love", "like", "affection", "valentines", "infatuation", "kiss"], - "char": '\ud83d\ude18', - fitzpatrick_scale: false, - category: "people" - }, - kissing: { - keywords: ["love", "like", "face", "3", "valentines", "infatuation", "kiss"], - "char": '\ud83d\ude17', - fitzpatrick_scale: false, - category: "people" - }, - kissing_smiling_eyes: { - keywords: ["face", "affection", "valentines", "infatuation", "kiss"], - "char": '\ud83d\ude19', - fitzpatrick_scale: false, - category: "people" - }, - kissing_closed_eyes: { - keywords: ["face", "love", "like", "affection", "valentines", "infatuation", "kiss"], - "char": '\ud83d\ude1a', - fitzpatrick_scale: false, - category: "people" - }, - stuck_out_tongue_winking_eye: { - keywords: ["face", "prank", "childish", "playful", "mischievous", "smile", "wink", "tongue"], - "char": '\ud83d\ude1c', - fitzpatrick_scale: false, - category: "people" - }, - zany: { - keywords: ["face", "goofy", "crazy"], - "char": '\ud83e\udd2a', - fitzpatrick_scale: false, - category: "people" - }, - raised_eyebrow: { - keywords: ["face", "distrust", "scepticism", "disapproval", "disbelief", "surprise"], - "char": '\ud83e\udd28', - fitzpatrick_scale: false, - category: "people" - }, - monocle: { - keywords: ["face", "stuffy", "wealthy"], - "char": '\ud83e\uddd0', - fitzpatrick_scale: false, - category: "people" - }, - stuck_out_tongue_closed_eyes: { - keywords: ["face", "prank", "playful", "mischievous", "smile", "tongue"], - "char": '\ud83d\ude1d', - fitzpatrick_scale: false, - category: "people" - }, - stuck_out_tongue: { - keywords: ["face", "prank", "childish", "playful", "mischievous", "smile", "tongue"], - "char": '\ud83d\ude1b', - fitzpatrick_scale: false, - category: "people" - }, - money_mouth_face: { - keywords: ["face", "rich", "dollar", "money"], - "char": '\ud83e\udd11', - fitzpatrick_scale: false, - category: "people" - }, - nerd_face: { - keywords: ["face", "nerdy", "geek", "dork"], - "char": '\ud83e\udd13', - fitzpatrick_scale: false, - category: "people" - }, - sunglasses: { - keywords: ["face", "cool", "smile", "summer", "beach", "sunglass"], - "char": '\ud83d\ude0e', - fitzpatrick_scale: false, - category: "people" - }, - star_struck: { - keywords: ["face", "smile", "starry", "eyes", "grinning"], - "char": '\ud83e\udd29', - fitzpatrick_scale: false, - category: "people" - }, - clown_face: { - keywords: ["face"], - "char": '\ud83e\udd21', - fitzpatrick_scale: false, - category: "people" - }, - cowboy_hat_face: { - keywords: ["face", "cowgirl", "hat"], - "char": '\ud83e\udd20', - fitzpatrick_scale: false, - category: "people" - }, - hugs: { - keywords: ["face", "smile", "hug"], - "char": '\ud83e\udd17', - fitzpatrick_scale: false, - category: "people" - }, - smirk: { - keywords: ["face", "smile", "mean", "prank", "smug", "sarcasm"], - "char": '\ud83d\ude0f', - fitzpatrick_scale: false, - category: "people" - }, - no_mouth: { - keywords: ["face", "hellokitty"], - "char": '\ud83d\ude36', - fitzpatrick_scale: false, - category: "people" - }, - neutral_face: { - keywords: ["indifference", "meh", ":|", "neutral"], - "char": '\ud83d\ude10', - fitzpatrick_scale: false, - category: "people" - }, - expressionless: { - keywords: ["face", "indifferent", "-_-", "meh", "deadpan"], - "char": '\ud83d\ude11', - fitzpatrick_scale: false, - category: "people" - }, - unamused: { - keywords: ["indifference", "bored", "straight face", "serious", "sarcasm", "unimpressed", "skeptical", "dubious", "side_eye"], - "char": '\ud83d\ude12', - fitzpatrick_scale: false, - category: "people" - }, - roll_eyes: { - keywords: ["face", "eyeroll", "frustrated"], - "char": '\ud83d\ude44', - fitzpatrick_scale: false, - category: "people" - }, - thinking: { - keywords: ["face", "hmmm", "think", "consider"], - "char": '\ud83e\udd14', - fitzpatrick_scale: false, - category: "people" - }, - lying_face: { - keywords: ["face", "lie", "pinocchio"], - "char": '\ud83e\udd25', - fitzpatrick_scale: false, - category: "people" - }, - hand_over_mouth: { - keywords: ["face", "whoops", "shock", "surprise"], - "char": '\ud83e\udd2d', - fitzpatrick_scale: false, - category: "people" - }, - shushing: { - keywords: ["face", "quiet", "shhh"], - "char": '\ud83e\udd2b', - fitzpatrick_scale: false, - category: "people" - }, - symbols_over_mouth: { - keywords: ["face", "swearing", "cursing", "cussing", "profanity", "expletive"], - "char": '\ud83e\udd2c', - fitzpatrick_scale: false, - category: "people" - }, - exploding_head: { - keywords: ["face", "shocked", "mind", "blown"], - "char": '\ud83e\udd2f', - fitzpatrick_scale: false, - category: "people" - }, - flushed: { - keywords: ["face", "blush", "shy", "flattered"], - "char": '\ud83d\ude33', - fitzpatrick_scale: false, - category: "people" - }, - disappointed: { - keywords: ["face", "sad", "upset", "depressed", ":("], - "char": '\ud83d\ude1e', - fitzpatrick_scale: false, - category: "people" - }, - worried: { - keywords: ["face", "concern", "nervous", ":("], - "char": '\ud83d\ude1f', - fitzpatrick_scale: false, - category: "people" - }, - angry: { - keywords: ["mad", "face", "annoyed", "frustrated"], - "char": '\ud83d\ude20', - fitzpatrick_scale: false, - category: "people" - }, - rage: { - keywords: ["angry", "mad", "hate", "despise"], - "char": '\ud83d\ude21', - fitzpatrick_scale: false, - category: "people" - }, - pensive: { - keywords: ["face", "sad", "depressed", "upset"], - "char": '\ud83d\ude14', - fitzpatrick_scale: false, - category: "people" - }, - confused: { - keywords: ["face", "indifference", "huh", "weird", "hmmm", ":/"], - "char": '\ud83d\ude15', - fitzpatrick_scale: false, - category: "people" - }, - slightly_frowning_face: { - keywords: ["face", "frowning", "disappointed", "sad", "upset"], - "char": '\ud83d\ude41', - fitzpatrick_scale: false, - category: "people" - }, - frowning_face: { - keywords: ["face", "sad", "upset", "frown"], - "char": '\u2639', - fitzpatrick_scale: false, - category: "people" - }, - persevere: { - keywords: ["face", "sick", "no", "upset", "oops"], - "char": '\ud83d\ude23', - fitzpatrick_scale: false, - category: "people" - }, - confounded: { - keywords: ["face", "confused", "sick", "unwell", "oops", ":S"], - "char": '\ud83d\ude16', - fitzpatrick_scale: false, - category: "people" - }, - tired_face: { - keywords: ["sick", "whine", "upset", "frustrated"], - "char": '\ud83d\ude2b', - fitzpatrick_scale: false, - category: "people" - }, - weary: { - keywords: ["face", "tired", "sleepy", "sad", "frustrated", "upset"], - "char": '\ud83d\ude29', - fitzpatrick_scale: false, - category: "people" - }, - pleading: { - keywords: ["face", "begging", "mercy"], - "char": '\ud83e\udd7a', - fitzpatrick_scale: false, - category: "people" - }, - triumph: { - keywords: ["face", "gas", "phew", "proud", "pride"], - "char": '\ud83d\ude24', - fitzpatrick_scale: false, - category: "people" - }, - open_mouth: { - keywords: ["face", "surprise", "impressed", "wow", "whoa", ":O"], - "char": '\ud83d\ude2e', - fitzpatrick_scale: false, - category: "people" - }, - scream: { - keywords: ["face", "munch", "scared", "omg"], - "char": '\ud83d\ude31', - fitzpatrick_scale: false, - category: "people" - }, - fearful: { - keywords: ["face", "scared", "terrified", "nervous", "oops", "huh"], - "char": '\ud83d\ude28', - fitzpatrick_scale: false, - category: "people" - }, - cold_sweat: { - keywords: ["face", "nervous", "sweat"], - "char": '\ud83d\ude30', - fitzpatrick_scale: false, - category: "people" - }, - hushed: { - keywords: ["face", "woo", "shh"], - "char": '\ud83d\ude2f', - fitzpatrick_scale: false, - category: "people" - }, - frowning: { - keywords: ["face", "aw", "what"], - "char": '\ud83d\ude26', - fitzpatrick_scale: false, - category: "people" - }, - anguished: { - keywords: ["face", "stunned", "nervous"], - "char": '\ud83d\ude27', - fitzpatrick_scale: false, - category: "people" - }, - cry: { - keywords: ["face", "tears", "sad", "depressed", "upset", ":'("], - "char": '\ud83d\ude22', - fitzpatrick_scale: false, - category: "people" - }, - disappointed_relieved: { - keywords: ["face", "phew", "sweat", "nervous"], - "char": '\ud83d\ude25', - fitzpatrick_scale: false, - category: "people" - }, - drooling_face: { - keywords: ["face"], - "char": '\ud83e\udd24', - fitzpatrick_scale: false, - category: "people" - }, - sleepy: { - keywords: ["face", "tired", "rest", "nap"], - "char": '\ud83d\ude2a', - fitzpatrick_scale: false, - category: "people" - }, - sweat: { - keywords: ["face", "hot", "sad", "tired", "exercise"], - "char": '\ud83d\ude13', - fitzpatrick_scale: false, - category: "people" - }, - hot: { - keywords: ["face", "feverish", "heat", "red", "sweating"], - "char": '\ud83e\udd75', - fitzpatrick_scale: false, - category: "people" - }, - cold: { - keywords: ["face", "blue", "freezing", "frozen", "frostbite", "icicles"], - "char": '\ud83e\udd76', - fitzpatrick_scale: false, - category: "people" - }, - sob: { - keywords: ["face", "cry", "tears", "sad", "upset", "depressed"], - "char": '\ud83d\ude2d', - fitzpatrick_scale: false, - category: "people" - }, - dizzy_face: { - keywords: ["spent", "unconscious", "xox", "dizzy"], - "char": '\ud83d\ude35', - fitzpatrick_scale: false, - category: "people" - }, - astonished: { - keywords: ["face", "xox", "surprised", "poisoned"], - "char": '\ud83d\ude32', - fitzpatrick_scale: false, - category: "people" - }, - zipper_mouth_face: { - keywords: ["face", "sealed", "zipper", "secret"], - "char": '\ud83e\udd10', - fitzpatrick_scale: false, - category: "people" - }, - nauseated_face: { - keywords: ["face", "vomit", "gross", "green", "sick", "throw up", "ill"], - "char": '\ud83e\udd22', - fitzpatrick_scale: false, - category: "people" - }, - sneezing_face: { - keywords: ["face", "gesundheit", "sneeze", "sick", "allergy"], - "char": '\ud83e\udd27', - fitzpatrick_scale: false, - category: "people" - }, - vomiting: { - keywords: ["face", "sick"], - "char": '\ud83e\udd2e', - fitzpatrick_scale: false, - category: "people" - }, - mask: { - keywords: ["face", "sick", "ill", "disease"], - "char": '\ud83d\ude37', - fitzpatrick_scale: false, - category: "people" - }, - face_with_thermometer: { - keywords: ["sick", "temperature", "thermometer", "cold", "fever"], - "char": '\ud83e\udd12', - fitzpatrick_scale: false, - category: "people" - }, - face_with_head_bandage: { - keywords: ["injured", "clumsy", "bandage", "hurt"], - "char": '\ud83e\udd15', - fitzpatrick_scale: false, - category: "people" - }, - woozy: { - keywords: ["face", "dizzy", "intoxicated", "tipsy", "wavy"], - "char": '\ud83e\udd74', - fitzpatrick_scale: false, - category: "people" - }, - sleeping: { - keywords: ["face", "tired", "sleepy", "night", "zzz"], - "char": '\ud83d\ude34', - fitzpatrick_scale: false, - category: "people" - }, - zzz: { - keywords: ["sleepy", "tired", "dream"], - "char": '\ud83d\udca4', - fitzpatrick_scale: false, - category: "people" - }, - poop: { - keywords: ["hankey", "shitface", "fail", "turd", "shit"], - "char": '\ud83d\udca9', - fitzpatrick_scale: false, - category: "people" - }, - smiling_imp: { - keywords: ["devil", "horns"], - "char": '\ud83d\ude08', - fitzpatrick_scale: false, - category: "people" - }, - imp: { - keywords: ["devil", "angry", "horns"], - "char": '\ud83d\udc7f', - fitzpatrick_scale: false, - category: "people" - }, - japanese_ogre: { - keywords: ["monster", "red", "mask", "halloween", "scary", "creepy", "devil", "demon", "japanese", "ogre"], - "char": '\ud83d\udc79', - fitzpatrick_scale: false, - category: "people" - }, - japanese_goblin: { - keywords: ["red", "evil", "mask", "monster", "scary", "creepy", "japanese", "goblin"], - "char": '\ud83d\udc7a', - fitzpatrick_scale: false, - category: "people" - }, - skull: { - keywords: ["dead", "skeleton", "creepy", "death"], - "char": '\ud83d\udc80', - fitzpatrick_scale: false, - category: "people" - }, - ghost: { - keywords: ["halloween", "spooky", "scary"], - "char": '\ud83d\udc7b', - fitzpatrick_scale: false, - category: "people" - }, - alien: { - keywords: ["UFO", "paul", "weird", "outer_space"], - "char": '\ud83d\udc7d', - fitzpatrick_scale: false, - category: "people" - }, - robot: { - keywords: ["computer", "machine", "bot"], - "char": '\ud83e\udd16', - fitzpatrick_scale: false, - category: "people" - }, - smiley_cat: { - keywords: ["animal", "cats", "happy", "smile"], - "char": '\ud83d\ude3a', - fitzpatrick_scale: false, - category: "people" - }, - smile_cat: { - keywords: ["animal", "cats", "smile"], - "char": '\ud83d\ude38', - fitzpatrick_scale: false, - category: "people" - }, - joy_cat: { - keywords: ["animal", "cats", "haha", "happy", "tears"], - "char": '\ud83d\ude39', - fitzpatrick_scale: false, - category: "people" - }, - heart_eyes_cat: { - keywords: ["animal", "love", "like", "affection", "cats", "valentines", "heart"], - "char": '\ud83d\ude3b', - fitzpatrick_scale: false, - category: "people" - }, - smirk_cat: { - keywords: ["animal", "cats", "smirk"], - "char": '\ud83d\ude3c', - fitzpatrick_scale: false, - category: "people" - }, - kissing_cat: { - keywords: ["animal", "cats", "kiss"], - "char": '\ud83d\ude3d', - fitzpatrick_scale: false, - category: "people" - }, - scream_cat: { - keywords: ["animal", "cats", "munch", "scared", "scream"], - "char": '\ud83d\ude40', - fitzpatrick_scale: false, - category: "people" - }, - crying_cat_face: { - keywords: ["animal", "tears", "weep", "sad", "cats", "upset", "cry"], - "char": '\ud83d\ude3f', - fitzpatrick_scale: false, - category: "people" - }, - pouting_cat: { - keywords: ["animal", "cats"], - "char": '\ud83d\ude3e', - fitzpatrick_scale: false, - category: "people" - }, - palms_up: { - keywords: ["hands", "gesture", "cupped", "prayer"], - "char": '\ud83e\udd32', - fitzpatrick_scale: true, - category: "people" - }, - raised_hands: { - keywords: ["gesture", "hooray", "yea", "celebration", "hands"], - "char": '\ud83d\ude4c', - fitzpatrick_scale: true, - category: "people" - }, - clap: { - keywords: ["hands", "praise", "applause", "congrats", "yay"], - "char": '\ud83d\udc4f', - fitzpatrick_scale: true, - category: "people" - }, - wave: { - keywords: ["hands", "gesture", "goodbye", "solong", "farewell", "hello", "hi", "palm"], - "char": '\ud83d\udc4b', - fitzpatrick_scale: true, - category: "people" - }, - call_me_hand: { - keywords: ["hands", "gesture"], - "char": '\ud83e\udd19', - fitzpatrick_scale: true, - category: "people" - }, - "+1": { - keywords: ["thumbsup", "yes", "awesome", "good", "agree", "accept", "cool", "hand", "like"], - "char": '\ud83d\udc4d', - fitzpatrick_scale: true, - category: "people" - }, - "-1": { - keywords: ["thumbsdown", "no", "dislike", "hand"], - "char": '\ud83d\udc4e', - fitzpatrick_scale: true, - category: "people" - }, - facepunch: { - keywords: ["angry", "violence", "fist", "hit", "attack", "hand"], - "char": '\ud83d\udc4a', - fitzpatrick_scale: true, - category: "people" - }, - fist: { - keywords: ["fingers", "hand", "grasp"], - "char": '\u270a', - fitzpatrick_scale: true, - category: "people" - }, - fist_left: { - keywords: ["hand", "fistbump"], - "char": '\ud83e\udd1b', - fitzpatrick_scale: true, - category: "people" - }, - fist_right: { - keywords: ["hand", "fistbump"], - "char": '\ud83e\udd1c', - fitzpatrick_scale: true, - category: "people" - }, - v: { - keywords: ["fingers", "ohyeah", "hand", "peace", "victory", "two"], - "char": '\u270c', - fitzpatrick_scale: true, - category: "people" - }, - ok_hand: { - keywords: ["fingers", "limbs", "perfect", "ok", "okay"], - "char": '\ud83d\udc4c', - fitzpatrick_scale: true, - category: "people" - }, - raised_hand: { - keywords: ["fingers", "stop", "highfive", "palm", "ban"], - "char": '\u270b', - fitzpatrick_scale: true, - category: "people" - }, - raised_back_of_hand: { - keywords: ["fingers", "raised", "backhand"], - "char": '\ud83e\udd1a', - fitzpatrick_scale: true, - category: "people" - }, - open_hands: { - keywords: ["fingers", "butterfly", "hands", "open"], - "char": '\ud83d\udc50', - fitzpatrick_scale: true, - category: "people" - }, - muscle: { - keywords: ["arm", "flex", "hand", "summer", "strong", "biceps"], - "char": '\ud83d\udcaa', - fitzpatrick_scale: true, - category: "people" - }, - pray: { - keywords: ["please", "hope", "wish", "namaste", "highfive"], - "char": '\ud83d\ude4f', - fitzpatrick_scale: true, - category: "people" - }, - foot: { - keywords: ["kick", "stomp"], - "char": '\ud83e\uddb6', - fitzpatrick_scale: true, - category: "people" - }, - leg: { - keywords: ["kick", "limb"], - "char": '\ud83e\uddb5', - fitzpatrick_scale: true, - category: "people" - }, - handshake: { - keywords: ["agreement", "shake"], - "char": '\ud83e\udd1d', - fitzpatrick_scale: false, - category: "people" - }, - point_up: { - keywords: ["hand", "fingers", "direction", "up"], - "char": '\u261d', - fitzpatrick_scale: true, - category: "people" - }, - point_up_2: { - keywords: ["fingers", "hand", "direction", "up"], - "char": '\ud83d\udc46', - fitzpatrick_scale: true, - category: "people" - }, - point_down: { - keywords: ["fingers", "hand", "direction", "down"], - "char": '\ud83d\udc47', - fitzpatrick_scale: true, - category: "people" - }, - point_left: { - keywords: ["direction", "fingers", "hand", "left"], - "char": '\ud83d\udc48', - fitzpatrick_scale: true, - category: "people" - }, - point_right: { - keywords: ["fingers", "hand", "direction", "right"], - "char": '\ud83d\udc49', - fitzpatrick_scale: true, - category: "people" - }, - fu: { - keywords: ["hand", "fingers", "rude", "middle", "flipping"], - "char": '\ud83d\udd95', - fitzpatrick_scale: true, - category: "people" - }, - raised_hand_with_fingers_splayed: { - keywords: ["hand", "fingers", "palm"], - "char": '\ud83d\udd90', - fitzpatrick_scale: true, - category: "people" - }, - love_you: { - keywords: ["hand", "fingers", "gesture"], - "char": '\ud83e\udd1f', - fitzpatrick_scale: true, - category: "people" - }, - metal: { - keywords: ["hand", "fingers", "evil_eye", "sign_of_horns", "rock_on"], - "char": '\ud83e\udd18', - fitzpatrick_scale: true, - category: "people" - }, - crossed_fingers: { - keywords: ["good", "lucky"], - "char": '\ud83e\udd1e', - fitzpatrick_scale: true, - category: "people" - }, - vulcan_salute: { - keywords: ["hand", "fingers", "spock", "star trek"], - "char": '\ud83d\udd96', - fitzpatrick_scale: true, - category: "people" - }, - writing_hand: { - keywords: ["lower_left_ballpoint_pen", "stationery", "write", "compose"], - "char": '\u270d', - fitzpatrick_scale: true, - category: "people" - }, - selfie: { - keywords: ["camera", "phone"], - "char": '\ud83e\udd33', - fitzpatrick_scale: true, - category: "people" - }, - nail_care: { - keywords: ["beauty", "manicure", "finger", "fashion", "nail"], - "char": '\ud83d\udc85', - fitzpatrick_scale: true, - category: "people" - }, - lips: { - keywords: ["mouth", "kiss"], - "char": '\ud83d\udc44', - fitzpatrick_scale: false, - category: "people" - }, - tooth: { - keywords: ["teeth", "dentist"], - "char": '\ud83e\uddb7', - fitzpatrick_scale: false, - category: "people" - }, - tongue: { - keywords: ["mouth", "playful"], - "char": '\ud83d\udc45', - fitzpatrick_scale: false, - category: "people" - }, - ear: { - keywords: ["face", "hear", "sound", "listen"], - "char": '\ud83d\udc42', - fitzpatrick_scale: true, - category: "people" - }, - nose: { - keywords: ["smell", "sniff"], - "char": '\ud83d\udc43', - fitzpatrick_scale: true, - category: "people" - }, - eye: { - keywords: ["face", "look", "see", "watch", "stare"], - "char": '\ud83d\udc41', - fitzpatrick_scale: false, - category: "people" - }, - eyes: { - keywords: ["look", "watch", "stalk", "peek", "see"], - "char": '\ud83d\udc40', - fitzpatrick_scale: false, - category: "people" - }, - brain: { - keywords: ["smart", "intelligent"], - "char": '\ud83e\udde0', - fitzpatrick_scale: false, - category: "people" - }, - bust_in_silhouette: { - keywords: ["user", "person", "human"], - "char": '\ud83d\udc64', - fitzpatrick_scale: false, - category: "people" - }, - busts_in_silhouette: { - keywords: ["user", "person", "human", "group", "team"], - "char": '\ud83d\udc65', - fitzpatrick_scale: false, - category: "people" - }, - speaking_head: { - keywords: ["user", "person", "human", "sing", "say", "talk"], - "char": '\ud83d\udde3', - fitzpatrick_scale: false, - category: "people" - }, - baby: { - keywords: ["child", "boy", "girl", "toddler"], - "char": '\ud83d\udc76', - fitzpatrick_scale: true, - category: "people" - }, - child: { - keywords: ["gender-neutral", "young"], - "char": '\ud83e\uddd2', - fitzpatrick_scale: true, - category: "people" - }, - boy: { - keywords: ["man", "male", "guy", "teenager"], - "char": '\ud83d\udc66', - fitzpatrick_scale: true, - category: "people" - }, - girl: { - keywords: ["female", "woman", "teenager"], - "char": '\ud83d\udc67', - fitzpatrick_scale: true, - category: "people" - }, - adult: { - keywords: ["gender-neutral", "person"], - "char": '\ud83e\uddd1', - fitzpatrick_scale: true, - category: "people" - }, - man: { - keywords: ["mustache", "father", "dad", "guy", "classy", "sir", "moustache"], - "char": '\ud83d\udc68', - fitzpatrick_scale: true, - category: "people" - }, - woman: { - keywords: ["female", "girls", "lady"], - "char": '\ud83d\udc69', - fitzpatrick_scale: true, - category: "people" - }, - blonde_woman: { - keywords: ["woman", "female", "girl", "blonde", "person"], - "char": '\ud83d\udc71\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - blonde_man: { - keywords: ["man", "male", "boy", "blonde", "guy", "person"], - "char": '\ud83d\udc71', - fitzpatrick_scale: true, - category: "people" - }, - bearded_person: { - keywords: ["person", "bewhiskered"], - "char": '\ud83e\uddd4', - fitzpatrick_scale: true, - category: "people" - }, - older_adult: { - keywords: ["human", "elder", "senior", "gender-neutral"], - "char": '\ud83e\uddd3', - fitzpatrick_scale: true, - category: "people" - }, - older_man: { - keywords: ["human", "male", "men", "old", "elder", "senior"], - "char": '\ud83d\udc74', - fitzpatrick_scale: true, - category: "people" - }, - older_woman: { - keywords: ["human", "female", "women", "lady", "old", "elder", "senior"], - "char": '\ud83d\udc75', - fitzpatrick_scale: true, - category: "people" - }, - man_with_gua_pi_mao: { - keywords: ["male", "boy", "chinese"], - "char": '\ud83d\udc72', - fitzpatrick_scale: true, - category: "people" - }, - woman_with_headscarf: { - keywords: ["female", "hijab", "mantilla", "tichel"], - "char": '\ud83e\uddd5', - fitzpatrick_scale: true, - category: "people" - }, - woman_with_turban: { - keywords: ["female", "indian", "hinduism", "arabs", "woman"], - "char": '\ud83d\udc73\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - man_with_turban: { - keywords: ["male", "indian", "hinduism", "arabs"], - "char": '\ud83d\udc73', - fitzpatrick_scale: true, - category: "people" - }, - policewoman: { - keywords: ["woman", "police", "law", "legal", "enforcement", "arrest", "911", "female"], - "char": '\ud83d\udc6e\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - policeman: { - keywords: ["man", "police", "law", "legal", "enforcement", "arrest", "911"], - "char": '\ud83d\udc6e', - fitzpatrick_scale: true, - category: "people" - }, - construction_worker_woman: { - keywords: ["female", "human", "wip", "build", "construction", "worker", "labor", "woman"], - "char": '\ud83d\udc77\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - construction_worker_man: { - keywords: ["male", "human", "wip", "guy", "build", "construction", "worker", "labor"], - "char": '\ud83d\udc77', - fitzpatrick_scale: true, - category: "people" - }, - guardswoman: { - keywords: ["uk", "gb", "british", "female", "royal", "woman"], - "char": '\ud83d\udc82\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - guardsman: { - keywords: ["uk", "gb", "british", "male", "guy", "royal"], - "char": '\ud83d\udc82', - fitzpatrick_scale: true, - category: "people" - }, - female_detective: { - keywords: ["human", "spy", "detective", "female", "woman"], - "char": '\ud83d\udd75\ufe0f\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - male_detective: { - keywords: ["human", "spy", "detective"], - "char": '\ud83d\udd75', - fitzpatrick_scale: true, - category: "people" - }, - woman_health_worker: { - keywords: ["doctor", "nurse", "therapist", "healthcare", "woman", "human"], - "char": '\ud83d\udc69\u200d\u2695\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - man_health_worker: { - keywords: ["doctor", "nurse", "therapist", "healthcare", "man", "human"], - "char": '\ud83d\udc68\u200d\u2695\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - woman_farmer: { - keywords: ["rancher", "gardener", "woman", "human"], - "char": '\ud83d\udc69\u200d\ud83c\udf3e', - fitzpatrick_scale: true, - category: "people" - }, - man_farmer: { - keywords: ["rancher", "gardener", "man", "human"], - "char": '\ud83d\udc68\u200d\ud83c\udf3e', - fitzpatrick_scale: true, - category: "people" - }, - woman_cook: { - keywords: ["chef", "woman", "human"], - "char": '\ud83d\udc69\u200d\ud83c\udf73', - fitzpatrick_scale: true, - category: "people" - }, - man_cook: { - keywords: ["chef", "man", "human"], - "char": '\ud83d\udc68\u200d\ud83c\udf73', - fitzpatrick_scale: true, - category: "people" - }, - woman_student: { - keywords: ["graduate", "woman", "human"], - "char": '\ud83d\udc69\u200d\ud83c\udf93', - fitzpatrick_scale: true, - category: "people" - }, - man_student: { - keywords: ["graduate", "man", "human"], - "char": '\ud83d\udc68\u200d\ud83c\udf93', - fitzpatrick_scale: true, - category: "people" - }, - woman_singer: { - keywords: ["rockstar", "entertainer", "woman", "human"], - "char": '\ud83d\udc69\u200d\ud83c\udfa4', - fitzpatrick_scale: true, - category: "people" - }, - man_singer: { - keywords: ["rockstar", "entertainer", "man", "human"], - "char": '\ud83d\udc68\u200d\ud83c\udfa4', - fitzpatrick_scale: true, - category: "people" - }, - woman_teacher: { - keywords: ["instructor", "professor", "woman", "human"], - "char": '\ud83d\udc69\u200d\ud83c\udfeb', - fitzpatrick_scale: true, - category: "people" - }, - man_teacher: { - keywords: ["instructor", "professor", "man", "human"], - "char": '\ud83d\udc68\u200d\ud83c\udfeb', - fitzpatrick_scale: true, - category: "people" - }, - woman_factory_worker: { - keywords: ["assembly", "industrial", "woman", "human"], - "char": '\ud83d\udc69\u200d\ud83c\udfed', - fitzpatrick_scale: true, - category: "people" - }, - man_factory_worker: { - keywords: ["assembly", "industrial", "man", "human"], - "char": '\ud83d\udc68\u200d\ud83c\udfed', - fitzpatrick_scale: true, - category: "people" - }, - woman_technologist: { - keywords: ["coder", "developer", "engineer", "programmer", "software", "woman", "human", "laptop", "computer"], - "char": '\ud83d\udc69\u200d\ud83d\udcbb', - fitzpatrick_scale: true, - category: "people" - }, - man_technologist: { - keywords: ["coder", "developer", "engineer", "programmer", "software", "man", "human", "laptop", "computer"], - "char": '\ud83d\udc68\u200d\ud83d\udcbb', - fitzpatrick_scale: true, - category: "people" - }, - woman_office_worker: { - keywords: ["business", "manager", "woman", "human"], - "char": '\ud83d\udc69\u200d\ud83d\udcbc', - fitzpatrick_scale: true, - category: "people" - }, - man_office_worker: { - keywords: ["business", "manager", "man", "human"], - "char": '\ud83d\udc68\u200d\ud83d\udcbc', - fitzpatrick_scale: true, - category: "people" - }, - woman_mechanic: { - keywords: ["plumber", "woman", "human", "wrench"], - "char": '\ud83d\udc69\u200d\ud83d\udd27', - fitzpatrick_scale: true, - category: "people" - }, - man_mechanic: { - keywords: ["plumber", "man", "human", "wrench"], - "char": '\ud83d\udc68\u200d\ud83d\udd27', - fitzpatrick_scale: true, - category: "people" - }, - woman_scientist: { - keywords: ["biologist", "chemist", "engineer", "physicist", "woman", "human"], - "char": '\ud83d\udc69\u200d\ud83d\udd2c', - fitzpatrick_scale: true, - category: "people" - }, - man_scientist: { - keywords: ["biologist", "chemist", "engineer", "physicist", "man", "human"], - "char": '\ud83d\udc68\u200d\ud83d\udd2c', - fitzpatrick_scale: true, - category: "people" - }, - woman_artist: { - keywords: ["painter", "woman", "human"], - "char": '\ud83d\udc69\u200d\ud83c\udfa8', - fitzpatrick_scale: true, - category: "people" - }, - man_artist: { - keywords: ["painter", "man", "human"], - "char": '\ud83d\udc68\u200d\ud83c\udfa8', - fitzpatrick_scale: true, - category: "people" - }, - woman_firefighter: { - keywords: ["fireman", "woman", "human"], - "char": '\ud83d\udc69\u200d\ud83d\ude92', - fitzpatrick_scale: true, - category: "people" - }, - man_firefighter: { - keywords: ["fireman", "man", "human"], - "char": '\ud83d\udc68\u200d\ud83d\ude92', - fitzpatrick_scale: true, - category: "people" - }, - woman_pilot: { - keywords: ["aviator", "plane", "woman", "human"], - "char": '\ud83d\udc69\u200d\u2708\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - man_pilot: { - keywords: ["aviator", "plane", "man", "human"], - "char": '\ud83d\udc68\u200d\u2708\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - woman_astronaut: { - keywords: ["space", "rocket", "woman", "human"], - "char": '\ud83d\udc69\u200d\ud83d\ude80', - fitzpatrick_scale: true, - category: "people" - }, - man_astronaut: { - keywords: ["space", "rocket", "man", "human"], - "char": '\ud83d\udc68\u200d\ud83d\ude80', - fitzpatrick_scale: true, - category: "people" - }, - woman_judge: { - keywords: ["justice", "court", "woman", "human"], - "char": '\ud83d\udc69\u200d\u2696\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - man_judge: { - keywords: ["justice", "court", "man", "human"], - "char": '\ud83d\udc68\u200d\u2696\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - woman_superhero: { - keywords: ["woman", "female", "good", "heroine", "superpowers"], - "char": '\ud83e\uddb8\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - man_superhero: { - keywords: ["man", "male", "good", "hero", "superpowers"], - "char": '\ud83e\uddb8\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - woman_supervillain: { - keywords: ["woman", "female", "evil", "bad", "criminal", "heroine", "superpowers"], - "char": '\ud83e\uddb9\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - man_supervillain: { - keywords: ["man", "male", "evil", "bad", "criminal", "hero", "superpowers"], - "char": '\ud83e\uddb9\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - mrs_claus: { - keywords: ["woman", "female", "xmas", "mother christmas"], - "char": '\ud83e\udd36', - fitzpatrick_scale: true, - category: "people" - }, - santa: { - keywords: ["festival", "man", "male", "xmas", "father christmas"], - "char": '\ud83c\udf85', - fitzpatrick_scale: true, - category: "people" - }, - sorceress: { - keywords: ["woman", "female", "mage", "witch"], - "char": '\ud83e\uddd9\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - wizard: { - keywords: ["man", "male", "mage", "sorcerer"], - "char": '\ud83e\uddd9\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - woman_elf: { - keywords: ["woman", "female"], - "char": '\ud83e\udddd\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - man_elf: { - keywords: ["man", "male"], - "char": '\ud83e\udddd\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - woman_vampire: { - keywords: ["woman", "female"], - "char": '\ud83e\udddb\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - man_vampire: { - keywords: ["man", "male", "dracula"], - "char": '\ud83e\udddb\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - woman_zombie: { - keywords: ["woman", "female", "undead", "walking dead"], - "char": '\ud83e\udddf\u200d\u2640\ufe0f', - fitzpatrick_scale: false, - category: "people" - }, - man_zombie: { - keywords: ["man", "male", "dracula", "undead", "walking dead"], - "char": '\ud83e\udddf\u200d\u2642\ufe0f', - fitzpatrick_scale: false, - category: "people" - }, - woman_genie: { - keywords: ["woman", "female"], - "char": '\ud83e\uddde\u200d\u2640\ufe0f', - fitzpatrick_scale: false, - category: "people" - }, - man_genie: { - keywords: ["man", "male"], - "char": '\ud83e\uddde\u200d\u2642\ufe0f', - fitzpatrick_scale: false, - category: "people" - }, - mermaid: { - keywords: ["woman", "female", "merwoman", "ariel"], - "char": '\ud83e\udddc\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - merman: { - keywords: ["man", "male", "triton"], - "char": '\ud83e\udddc\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - woman_fairy: { - keywords: ["woman", "female"], - "char": '\ud83e\uddda\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - man_fairy: { - keywords: ["man", "male"], - "char": '\ud83e\uddda\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - angel: { - keywords: ["heaven", "wings", "halo"], - "char": '\ud83d\udc7c', - fitzpatrick_scale: true, - category: "people" - }, - pregnant_woman: { - keywords: ["baby"], - "char": '\ud83e\udd30', - fitzpatrick_scale: true, - category: "people" - }, - breastfeeding: { - keywords: ["nursing", "baby"], - "char": '\ud83e\udd31', - fitzpatrick_scale: true, - category: "people" - }, - princess: { - keywords: ["girl", "woman", "female", "blond", "crown", "royal", "queen"], - "char": '\ud83d\udc78', - fitzpatrick_scale: true, - category: "people" - }, - prince: { - keywords: ["boy", "man", "male", "crown", "royal", "king"], - "char": '\ud83e\udd34', - fitzpatrick_scale: true, - category: "people" - }, - bride_with_veil: { - keywords: ["couple", "marriage", "wedding", "woman", "bride"], - "char": '\ud83d\udc70', - fitzpatrick_scale: true, - category: "people" - }, - man_in_tuxedo: { - keywords: ["couple", "marriage", "wedding", "groom"], - "char": '\ud83e\udd35', - fitzpatrick_scale: true, - category: "people" - }, - running_woman: { - keywords: ["woman", "walking", "exercise", "race", "running", "female"], - "char": '\ud83c\udfc3\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - running_man: { - keywords: ["man", "walking", "exercise", "race", "running"], - "char": '\ud83c\udfc3', - fitzpatrick_scale: true, - category: "people" - }, - walking_woman: { - keywords: ["human", "feet", "steps", "woman", "female"], - "char": '\ud83d\udeb6\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - walking_man: { - keywords: ["human", "feet", "steps"], - "char": '\ud83d\udeb6', - fitzpatrick_scale: true, - category: "people" - }, - dancer: { - keywords: ["female", "girl", "woman", "fun"], - "char": '\ud83d\udc83', - fitzpatrick_scale: true, - category: "people" - }, - man_dancing: { - keywords: ["male", "boy", "fun", "dancer"], - "char": '\ud83d\udd7a', - fitzpatrick_scale: true, - category: "people" - }, - dancing_women: { - keywords: ["female", "bunny", "women", "girls"], - "char": '\ud83d\udc6f', - fitzpatrick_scale: false, - category: "people" - }, - dancing_men: { - keywords: ["male", "bunny", "men", "boys"], - "char": '\ud83d\udc6f\u200d\u2642\ufe0f', - fitzpatrick_scale: false, - category: "people" - }, - couple: { - keywords: ["pair", "people", "human", "love", "date", "dating", "like", "affection", "valentines", "marriage"], - "char": '\ud83d\udc6b', - fitzpatrick_scale: false, - category: "people" - }, - two_men_holding_hands: { - keywords: ["pair", "couple", "love", "like", "bromance", "friendship", "people", "human"], - "char": '\ud83d\udc6c', - fitzpatrick_scale: false, - category: "people" - }, - two_women_holding_hands: { - keywords: ["pair", "friendship", "couple", "love", "like", "female", "people", "human"], - "char": '\ud83d\udc6d', - fitzpatrick_scale: false, - category: "people" - }, - bowing_woman: { - keywords: ["woman", "female", "girl"], - "char": '\ud83d\ude47\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - bowing_man: { - keywords: ["man", "male", "boy"], - "char": '\ud83d\ude47', - fitzpatrick_scale: true, - category: "people" - }, - man_facepalming: { - keywords: ["man", "male", "boy", "disbelief"], - "char": '\ud83e\udd26\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - woman_facepalming: { - keywords: ["woman", "female", "girl", "disbelief"], - "char": '\ud83e\udd26\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - woman_shrugging: { - keywords: ["woman", "female", "girl", "confused", "indifferent", "doubt"], - "char": '\ud83e\udd37', - fitzpatrick_scale: true, - category: "people" - }, - man_shrugging: { - keywords: ["man", "male", "boy", "confused", "indifferent", "doubt"], - "char": '\ud83e\udd37\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - tipping_hand_woman: { - keywords: ["female", "girl", "woman", "human", "information"], - "char": '\ud83d\udc81', - fitzpatrick_scale: true, - category: "people" - }, - tipping_hand_man: { - keywords: ["male", "boy", "man", "human", "information"], - "char": '\ud83d\udc81\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - no_good_woman: { - keywords: ["female", "girl", "woman", "nope"], - "char": '\ud83d\ude45', - fitzpatrick_scale: true, - category: "people" - }, - no_good_man: { - keywords: ["male", "boy", "man", "nope"], - "char": '\ud83d\ude45\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - ok_woman: { - keywords: ["women", "girl", "female", "pink", "human", "woman"], - "char": '\ud83d\ude46', - fitzpatrick_scale: true, - category: "people" - }, - ok_man: { - keywords: ["men", "boy", "male", "blue", "human", "man"], - "char": '\ud83d\ude46\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - raising_hand_woman: { - keywords: ["female", "girl", "woman"], - "char": '\ud83d\ude4b', - fitzpatrick_scale: true, - category: "people" - }, - raising_hand_man: { - keywords: ["male", "boy", "man"], - "char": '\ud83d\ude4b\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - pouting_woman: { - keywords: ["female", "girl", "woman"], - "char": '\ud83d\ude4e', - fitzpatrick_scale: true, - category: "people" - }, - pouting_man: { - keywords: ["male", "boy", "man"], - "char": '\ud83d\ude4e\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - frowning_woman: { - keywords: ["female", "girl", "woman", "sad", "depressed", "discouraged", "unhappy"], - "char": '\ud83d\ude4d', - fitzpatrick_scale: true, - category: "people" - }, - frowning_man: { - keywords: ["male", "boy", "man", "sad", "depressed", "discouraged", "unhappy"], - "char": '\ud83d\ude4d\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - haircut_woman: { - keywords: ["female", "girl", "woman"], - "char": '\ud83d\udc87', - fitzpatrick_scale: true, - category: "people" - }, - haircut_man: { - keywords: ["male", "boy", "man"], - "char": '\ud83d\udc87\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - massage_woman: { - keywords: ["female", "girl", "woman", "head"], - "char": '\ud83d\udc86', - fitzpatrick_scale: true, - category: "people" - }, - massage_man: { - keywords: ["male", "boy", "man", "head"], - "char": '\ud83d\udc86\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - woman_in_steamy_room: { - keywords: ["female", "woman", "spa", "steamroom", "sauna"], - "char": '\ud83e\uddd6\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - man_in_steamy_room: { - keywords: ["male", "man", "spa", "steamroom", "sauna"], - "char": '\ud83e\uddd6\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "people" - }, - couple_with_heart_woman_man: { - keywords: ["pair", "love", "like", "affection", "human", "dating", "valentines", "marriage"], - "char": '\ud83d\udc91', - fitzpatrick_scale: false, - category: "people" - }, - couple_with_heart_woman_woman: { - keywords: ["pair", "love", "like", "affection", "human", "dating", "valentines", "marriage"], - "char": '\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc69', - fitzpatrick_scale: false, - category: "people" - }, - couple_with_heart_man_man: { - keywords: ["pair", "love", "like", "affection", "human", "dating", "valentines", "marriage"], - "char": '\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68', - fitzpatrick_scale: false, - category: "people" - }, - couplekiss_man_woman: { - keywords: ["pair", "valentines", "love", "like", "dating", "marriage"], - "char": '\ud83d\udc8f', - fitzpatrick_scale: false, - category: "people" - }, - couplekiss_woman_woman: { - keywords: ["pair", "valentines", "love", "like", "dating", "marriage"], - "char": '\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69', - fitzpatrick_scale: false, - category: "people" - }, - couplekiss_man_man: { - keywords: ["pair", "valentines", "love", "like", "dating", "marriage"], - "char": '\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68', - fitzpatrick_scale: false, - category: "people" - }, - family_man_woman_boy: { - keywords: ["home", "parents", "child", "mom", "dad", "father", "mother", "people", "human"], - "char": '\ud83d\udc6a', - fitzpatrick_scale: false, - category: "people" - }, - family_man_woman_girl: { - keywords: ["home", "parents", "people", "human", "child"], - "char": '\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67', - fitzpatrick_scale: false, - category: "people" - }, - family_man_woman_girl_boy: { - keywords: ["home", "parents", "people", "human", "children"], - "char": '\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc66', - fitzpatrick_scale: false, - category: "people" - }, - family_man_woman_boy_boy: { - keywords: ["home", "parents", "people", "human", "children"], - "char": '\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66', - fitzpatrick_scale: false, - category: "people" - }, - family_man_woman_girl_girl: { - keywords: ["home", "parents", "people", "human", "children"], - "char": '\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc67', - fitzpatrick_scale: false, - category: "people" - }, - family_woman_woman_boy: { - keywords: ["home", "parents", "people", "human", "children"], - "char": '\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66', - fitzpatrick_scale: false, - category: "people" - }, - family_woman_woman_girl: { - keywords: ["home", "parents", "people", "human", "children"], - "char": '\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67', - fitzpatrick_scale: false, - category: "people" - }, - family_woman_woman_girl_boy: { - keywords: ["home", "parents", "people", "human", "children"], - "char": '\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc66', - fitzpatrick_scale: false, - category: "people" - }, - family_woman_woman_boy_boy: { - keywords: ["home", "parents", "people", "human", "children"], - "char": '\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66', - fitzpatrick_scale: false, - category: "people" - }, - family_woman_woman_girl_girl: { - keywords: ["home", "parents", "people", "human", "children"], - "char": '\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc67', - fitzpatrick_scale: false, - category: "people" - }, - family_man_man_boy: { - keywords: ["home", "parents", "people", "human", "children"], - "char": '\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66', - fitzpatrick_scale: false, - category: "people" - }, - family_man_man_girl: { - keywords: ["home", "parents", "people", "human", "children"], - "char": '\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67', - fitzpatrick_scale: false, - category: "people" - }, - family_man_man_girl_boy: { - keywords: ["home", "parents", "people", "human", "children"], - "char": '\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc66', - fitzpatrick_scale: false, - category: "people" - }, - family_man_man_boy_boy: { - keywords: ["home", "parents", "people", "human", "children"], - "char": '\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66', - fitzpatrick_scale: false, - category: "people" - }, - family_man_man_girl_girl: { - keywords: ["home", "parents", "people", "human", "children"], - "char": '\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc67', - fitzpatrick_scale: false, - category: "people" - }, - family_woman_boy: { - keywords: ["home", "parent", "people", "human", "child"], - "char": '\ud83d\udc69\u200d\ud83d\udc66', - fitzpatrick_scale: false, - category: "people" - }, - family_woman_girl: { - keywords: ["home", "parent", "people", "human", "child"], - "char": '\ud83d\udc69\u200d\ud83d\udc67', - fitzpatrick_scale: false, - category: "people" - }, - family_woman_girl_boy: { - keywords: ["home", "parent", "people", "human", "children"], - "char": '\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc66', - fitzpatrick_scale: false, - category: "people" - }, - family_woman_boy_boy: { - keywords: ["home", "parent", "people", "human", "children"], - "char": '\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66', - fitzpatrick_scale: false, - category: "people" - }, - family_woman_girl_girl: { - keywords: ["home", "parent", "people", "human", "children"], - "char": '\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc67', - fitzpatrick_scale: false, - category: "people" - }, - family_man_boy: { - keywords: ["home", "parent", "people", "human", "child"], - "char": '\ud83d\udc68\u200d\ud83d\udc66', - fitzpatrick_scale: false, - category: "people" - }, - family_man_girl: { - keywords: ["home", "parent", "people", "human", "child"], - "char": '\ud83d\udc68\u200d\ud83d\udc67', - fitzpatrick_scale: false, - category: "people" - }, - family_man_girl_boy: { - keywords: ["home", "parent", "people", "human", "children"], - "char": '\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc66', - fitzpatrick_scale: false, - category: "people" - }, - family_man_boy_boy: { - keywords: ["home", "parent", "people", "human", "children"], - "char": '\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66', - fitzpatrick_scale: false, - category: "people" - }, - family_man_girl_girl: { - keywords: ["home", "parent", "people", "human", "children"], - "char": '\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc67', - fitzpatrick_scale: false, - category: "people" - }, - yarn: { - keywords: ["ball", "crochet", "knit"], - "char": '\ud83e\uddf6', - fitzpatrick_scale: false, - category: "people" - }, - thread: { - keywords: ["needle", "sewing", "spool", "string"], - "char": '\ud83e\uddf5', - fitzpatrick_scale: false, - category: "people" - }, - coat: { - keywords: ["jacket"], - "char": '\ud83e\udde5', - fitzpatrick_scale: false, - category: "people" - }, - labcoat: { - keywords: ["doctor", "experiment", "scientist", "chemist"], - "char": '\ud83e\udd7c', - fitzpatrick_scale: false, - category: "people" - }, - womans_clothes: { - keywords: ["fashion", "shopping_bags", "female"], - "char": '\ud83d\udc5a', - fitzpatrick_scale: false, - category: "people" - }, - tshirt: { - keywords: ["fashion", "cloth", "casual", "shirt", "tee"], - "char": '\ud83d\udc55', - fitzpatrick_scale: false, - category: "people" - }, - jeans: { - keywords: ["fashion", "shopping"], - "char": '\ud83d\udc56', - fitzpatrick_scale: false, - category: "people" - }, - necktie: { - keywords: ["shirt", "suitup", "formal", "fashion", "cloth", "business"], - "char": '\ud83d\udc54', - fitzpatrick_scale: false, - category: "people" - }, - dress: { - keywords: ["clothes", "fashion", "shopping"], - "char": '\ud83d\udc57', - fitzpatrick_scale: false, - category: "people" - }, - bikini: { - keywords: ["swimming", "female", "woman", "girl", "fashion", "beach", "summer"], - "char": '\ud83d\udc59', - fitzpatrick_scale: false, - category: "people" - }, - kimono: { - keywords: ["dress", "fashion", "women", "female", "japanese"], - "char": '\ud83d\udc58', - fitzpatrick_scale: false, - category: "people" - }, - lipstick: { - keywords: ["female", "girl", "fashion", "woman"], - "char": '\ud83d\udc84', - fitzpatrick_scale: false, - category: "people" - }, - kiss: { - keywords: ["face", "lips", "love", "like", "affection", "valentines"], - "char": '\ud83d\udc8b', - fitzpatrick_scale: false, - category: "people" - }, - footprints: { - keywords: ["feet", "tracking", "walking", "beach"], - "char": '\ud83d\udc63', - fitzpatrick_scale: false, - category: "people" - }, - flat_shoe: { - keywords: ["ballet", "slip-on", "slipper"], - "char": '\ud83e\udd7f', - fitzpatrick_scale: false, - category: "people" - }, - high_heel: { - keywords: ["fashion", "shoes", "female", "pumps", "stiletto"], - "char": '\ud83d\udc60', - fitzpatrick_scale: false, - category: "people" - }, - sandal: { - keywords: ["shoes", "fashion", "flip flops"], - "char": '\ud83d\udc61', - fitzpatrick_scale: false, - category: "people" - }, - boot: { - keywords: ["shoes", "fashion"], - "char": '\ud83d\udc62', - fitzpatrick_scale: false, - category: "people" - }, - mans_shoe: { - keywords: ["fashion", "male"], - "char": '\ud83d\udc5e', - fitzpatrick_scale: false, - category: "people" - }, - athletic_shoe: { - keywords: ["shoes", "sports", "sneakers"], - "char": '\ud83d\udc5f', - fitzpatrick_scale: false, - category: "people" - }, - hiking_boot: { - keywords: ["backpacking", "camping", "hiking"], - "char": '\ud83e\udd7e', - fitzpatrick_scale: false, - category: "people" - }, - socks: { - keywords: ["stockings", "clothes"], - "char": '\ud83e\udde6', - fitzpatrick_scale: false, - category: "people" - }, - gloves: { - keywords: ["hands", "winter", "clothes"], - "char": '\ud83e\udde4', - fitzpatrick_scale: false, - category: "people" - }, - scarf: { - keywords: ["neck", "winter", "clothes"], - "char": '\ud83e\udde3', - fitzpatrick_scale: false, - category: "people" - }, - womans_hat: { - keywords: ["fashion", "accessories", "female", "lady", "spring"], - "char": '\ud83d\udc52', - fitzpatrick_scale: false, - category: "people" - }, - tophat: { - keywords: ["magic", "gentleman", "classy", "circus"], - "char": '\ud83c\udfa9', - fitzpatrick_scale: false, - category: "people" - }, - billed_hat: { - keywords: ["cap", "baseball"], - "char": '\ud83e\udde2', - fitzpatrick_scale: false, - category: "people" - }, - rescue_worker_helmet: { - keywords: ["construction", "build"], - "char": '\u26d1', - fitzpatrick_scale: false, - category: "people" - }, - mortar_board: { - keywords: ["school", "college", "degree", "university", "graduation", "cap", "hat", "legal", "learn", "education"], - "char": '\ud83c\udf93', - fitzpatrick_scale: false, - category: "people" - }, - crown: { - keywords: ["king", "kod", "leader", "royalty", "lord"], - "char": '\ud83d\udc51', - fitzpatrick_scale: false, - category: "people" - }, - school_satchel: { - keywords: ["student", "education", "bag", "backpack"], - "char": '\ud83c\udf92', - fitzpatrick_scale: false, - category: "people" - }, - luggage: { - keywords: ["packing", "travel"], - "char": '\ud83e\uddf3', - fitzpatrick_scale: false, - category: "people" - }, - pouch: { - keywords: ["bag", "accessories", "shopping"], - "char": '\ud83d\udc5d', - fitzpatrick_scale: false, - category: "people" - }, - purse: { - keywords: ["fashion", "accessories", "money", "sales", "shopping"], - "char": '\ud83d\udc5b', - fitzpatrick_scale: false, - category: "people" - }, - handbag: { - keywords: ["fashion", "accessory", "accessories", "shopping"], - "char": '\ud83d\udc5c', - fitzpatrick_scale: false, - category: "people" - }, - briefcase: { - keywords: ["business", "documents", "work", "law", "legal", "job", "career"], - "char": '\ud83d\udcbc', - fitzpatrick_scale: false, - category: "people" - }, - eyeglasses: { - keywords: ["fashion", "accessories", "eyesight", "nerdy", "dork", "geek"], - "char": '\ud83d\udc53', - fitzpatrick_scale: false, - category: "people" - }, - dark_sunglasses: { - keywords: ["face", "cool", "accessories"], - "char": '\ud83d\udd76', - fitzpatrick_scale: false, - category: "people" - }, - goggles: { - keywords: ["eyes", "protection", "safety"], - "char": '\ud83e\udd7d', - fitzpatrick_scale: false, - category: "people" - }, - ring: { - keywords: ["wedding", "propose", "marriage", "valentines", "diamond", "fashion", "jewelry", "gem", "engagement"], - "char": '\ud83d\udc8d', - fitzpatrick_scale: false, - category: "people" - }, - closed_umbrella: { - keywords: ["weather", "rain", "drizzle"], - "char": '\ud83c\udf02', - fitzpatrick_scale: false, - category: "people" - }, - dog: { - keywords: ["animal", "friend", "nature", "woof", "puppy", "pet", "faithful"], - "char": '\ud83d\udc36', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cat: { - keywords: ["animal", "meow", "nature", "pet", "kitten"], - "char": '\ud83d\udc31', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - mouse: { - keywords: ["animal", "nature", "cheese_wedge", "rodent"], - "char": '\ud83d\udc2d', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - hamster: { - keywords: ["animal", "nature"], - "char": '\ud83d\udc39', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - rabbit: { - keywords: ["animal", "nature", "pet", "spring", "magic", "bunny"], - "char": '\ud83d\udc30', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - fox_face: { - keywords: ["animal", "nature", "face"], - "char": '\ud83e\udd8a', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - bear: { - keywords: ["animal", "nature", "wild"], - "char": '\ud83d\udc3b', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - panda_face: { - keywords: ["animal", "nature", "panda"], - "char": '\ud83d\udc3c', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - koala: { - keywords: ["animal", "nature"], - "char": '\ud83d\udc28', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - tiger: { - keywords: ["animal", "cat", "danger", "wild", "nature", "roar"], - "char": '\ud83d\udc2f', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - lion: { - keywords: ["animal", "nature"], - "char": '\ud83e\udd81', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cow: { - keywords: ["beef", "ox", "animal", "nature", "moo", "milk"], - "char": '\ud83d\udc2e', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - pig: { - keywords: ["animal", "oink", "nature"], - "char": '\ud83d\udc37', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - pig_nose: { - keywords: ["animal", "oink"], - "char": '\ud83d\udc3d', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - frog: { - keywords: ["animal", "nature", "croak", "toad"], - "char": '\ud83d\udc38', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - squid: { - keywords: ["animal", "nature", "ocean", "sea"], - "char": '\ud83e\udd91', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - octopus: { - keywords: ["animal", "creature", "ocean", "sea", "nature", "beach"], - "char": '\ud83d\udc19', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - shrimp: { - keywords: ["animal", "ocean", "nature", "seafood"], - "char": '\ud83e\udd90', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - monkey_face: { - keywords: ["animal", "nature", "circus"], - "char": '\ud83d\udc35', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - gorilla: { - keywords: ["animal", "nature", "circus"], - "char": '\ud83e\udd8d', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - see_no_evil: { - keywords: ["monkey", "animal", "nature", "haha"], - "char": '\ud83d\ude48', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - hear_no_evil: { - keywords: ["animal", "monkey", "nature"], - "char": '\ud83d\ude49', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - speak_no_evil: { - keywords: ["monkey", "animal", "nature", "omg"], - "char": '\ud83d\ude4a', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - monkey: { - keywords: ["animal", "nature", "banana", "circus"], - "char": '\ud83d\udc12', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - chicken: { - keywords: ["animal", "cluck", "nature", "bird"], - "char": '\ud83d\udc14', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - penguin: { - keywords: ["animal", "nature"], - "char": '\ud83d\udc27', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - bird: { - keywords: ["animal", "nature", "fly", "tweet", "spring"], - "char": '\ud83d\udc26', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - baby_chick: { - keywords: ["animal", "chicken", "bird"], - "char": '\ud83d\udc24', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - hatching_chick: { - keywords: ["animal", "chicken", "egg", "born", "baby", "bird"], - "char": '\ud83d\udc23', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - hatched_chick: { - keywords: ["animal", "chicken", "baby", "bird"], - "char": '\ud83d\udc25', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - duck: { - keywords: ["animal", "nature", "bird", "mallard"], - "char": '\ud83e\udd86', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - eagle: { - keywords: ["animal", "nature", "bird"], - "char": '\ud83e\udd85', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - owl: { - keywords: ["animal", "nature", "bird", "hoot"], - "char": '\ud83e\udd89', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - bat: { - keywords: ["animal", "nature", "blind", "vampire"], - "char": '\ud83e\udd87', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - wolf: { - keywords: ["animal", "nature", "wild"], - "char": '\ud83d\udc3a', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - boar: { - keywords: ["animal", "nature"], - "char": '\ud83d\udc17', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - horse: { - keywords: ["animal", "brown", "nature"], - "char": '\ud83d\udc34', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - unicorn: { - keywords: ["animal", "nature", "mystical"], - "char": '\ud83e\udd84', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - honeybee: { - keywords: ["animal", "insect", "nature", "bug", "spring", "honey"], - "char": '\ud83d\udc1d', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - bug: { - keywords: ["animal", "insect", "nature", "worm"], - "char": '\ud83d\udc1b', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - butterfly: { - keywords: ["animal", "insect", "nature", "caterpillar"], - "char": '\ud83e\udd8b', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - snail: { - keywords: ["slow", "animal", "shell"], - "char": '\ud83d\udc0c', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - beetle: { - keywords: ["animal", "insect", "nature", "ladybug"], - "char": '\ud83d\udc1e', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - ant: { - keywords: ["animal", "insect", "nature", "bug"], - "char": '\ud83d\udc1c', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - grasshopper: { - keywords: ["animal", "cricket", "chirp"], - "char": '\ud83e\udd97', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - spider: { - keywords: ["animal", "arachnid"], - "char": '\ud83d\udd77', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - scorpion: { - keywords: ["animal", "arachnid"], - "char": '\ud83e\udd82', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - crab: { - keywords: ["animal", "crustacean"], - "char": '\ud83e\udd80', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - snake: { - keywords: ["animal", "evil", "nature", "hiss", "python"], - "char": '\ud83d\udc0d', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - lizard: { - keywords: ["animal", "nature", "reptile"], - "char": '\ud83e\udd8e', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - "t-rex": { - keywords: ["animal", "nature", "dinosaur", "tyrannosaurus", "extinct"], - "char": '\ud83e\udd96', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sauropod: { - keywords: ["animal", "nature", "dinosaur", "brachiosaurus", "brontosaurus", "diplodocus", "extinct"], - "char": '\ud83e\udd95', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - turtle: { - keywords: ["animal", "slow", "nature", "tortoise"], - "char": '\ud83d\udc22', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - tropical_fish: { - keywords: ["animal", "swim", "ocean", "beach", "nemo"], - "char": '\ud83d\udc20', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - fish: { - keywords: ["animal", "food", "nature"], - "char": '\ud83d\udc1f', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - blowfish: { - keywords: ["animal", "nature", "food", "sea", "ocean"], - "char": '\ud83d\udc21', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - dolphin: { - keywords: ["animal", "nature", "fish", "sea", "ocean", "flipper", "fins", "beach"], - "char": '\ud83d\udc2c', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - shark: { - keywords: ["animal", "nature", "fish", "sea", "ocean", "jaws", "fins", "beach"], - "char": '\ud83e\udd88', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - whale: { - keywords: ["animal", "nature", "sea", "ocean"], - "char": '\ud83d\udc33', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - whale2: { - keywords: ["animal", "nature", "sea", "ocean"], - "char": '\ud83d\udc0b', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - crocodile: { - keywords: ["animal", "nature", "reptile", "lizard", "alligator"], - "char": '\ud83d\udc0a', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - leopard: { - keywords: ["animal", "nature"], - "char": '\ud83d\udc06', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - zebra: { - keywords: ["animal", "nature", "stripes", "safari"], - "char": '\ud83e\udd93', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - tiger2: { - keywords: ["animal", "nature", "roar"], - "char": '\ud83d\udc05', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - water_buffalo: { - keywords: ["animal", "nature", "ox", "cow"], - "char": '\ud83d\udc03', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - ox: { - keywords: ["animal", "cow", "beef"], - "char": '\ud83d\udc02', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cow2: { - keywords: ["beef", "ox", "animal", "nature", "moo", "milk"], - "char": '\ud83d\udc04', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - deer: { - keywords: ["animal", "nature", "horns", "venison"], - "char": '\ud83e\udd8c', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - dromedary_camel: { - keywords: ["animal", "hot", "desert", "hump"], - "char": '\ud83d\udc2a', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - camel: { - keywords: ["animal", "nature", "hot", "desert", "hump"], - "char": '\ud83d\udc2b', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - giraffe: { - keywords: ["animal", "nature", "spots", "safari"], - "char": '\ud83e\udd92', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - elephant: { - keywords: ["animal", "nature", "nose", "th", "circus"], - "char": '\ud83d\udc18', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - rhinoceros: { - keywords: ["animal", "nature", "horn"], - "char": '\ud83e\udd8f', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - goat: { - keywords: ["animal", "nature"], - "char": '\ud83d\udc10', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - ram: { - keywords: ["animal", "sheep", "nature"], - "char": '\ud83d\udc0f', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sheep: { - keywords: ["animal", "nature", "wool", "shipit"], - "char": '\ud83d\udc11', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - racehorse: { - keywords: ["animal", "gamble", "luck"], - "char": '\ud83d\udc0e', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - pig2: { - keywords: ["animal", "nature"], - "char": '\ud83d\udc16', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - rat: { - keywords: ["animal", "mouse", "rodent"], - "char": '\ud83d\udc00', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - mouse2: { - keywords: ["animal", "nature", "rodent"], - "char": '\ud83d\udc01', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - rooster: { - keywords: ["animal", "nature", "chicken"], - "char": '\ud83d\udc13', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - turkey: { - keywords: ["animal", "bird"], - "char": '\ud83e\udd83', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - dove: { - keywords: ["animal", "bird"], - "char": '\ud83d\udd4a', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - dog2: { - keywords: ["animal", "nature", "friend", "doge", "pet", "faithful"], - "char": '\ud83d\udc15', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - poodle: { - keywords: ["dog", "animal", "101", "nature", "pet"], - "char": '\ud83d\udc29', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cat2: { - keywords: ["animal", "meow", "pet", "cats"], - "char": '\ud83d\udc08', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - rabbit2: { - keywords: ["animal", "nature", "pet", "magic", "spring"], - "char": '\ud83d\udc07', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - chipmunk: { - keywords: ["animal", "nature", "rodent", "squirrel"], - "char": '\ud83d\udc3f', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - hedgehog: { - keywords: ["animal", "nature", "spiny"], - "char": '\ud83e\udd94', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - raccoon: { - keywords: ["animal", "nature"], - "char": '\ud83e\udd9d', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - llama: { - keywords: ["animal", "nature", "alpaca"], - "char": '\ud83e\udd99', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - hippopotamus: { - keywords: ["animal", "nature"], - "char": '\ud83e\udd9b', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - kangaroo: { - keywords: ["animal", "nature", "australia", "joey", "hop", "marsupial"], - "char": '\ud83e\udd98', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - badger: { - keywords: ["animal", "nature", "honey"], - "char": '\ud83e\udda1', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - swan: { - keywords: ["animal", "nature", "bird"], - "char": '\ud83e\udda2', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - peacock: { - keywords: ["animal", "nature", "peahen", "bird"], - "char": '\ud83e\udd9a', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - parrot: { - keywords: ["animal", "nature", "bird", "pirate", "talk"], - "char": '\ud83e\udd9c', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - lobster: { - keywords: ["animal", "nature", "bisque", "claws", "seafood"], - "char": '\ud83e\udd9e', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - mosquito: { - keywords: ["animal", "nature", "insect", "malaria"], - "char": '\ud83e\udd9f', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - paw_prints: { - keywords: ["animal", "tracking", "footprints", "dog", "cat", "pet", "feet"], - "char": '\ud83d\udc3e', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - dragon: { - keywords: ["animal", "myth", "nature", "chinese", "green"], - "char": '\ud83d\udc09', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - dragon_face: { - keywords: ["animal", "myth", "nature", "chinese", "green"], - "char": '\ud83d\udc32', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cactus: { - keywords: ["vegetable", "plant", "nature"], - "char": '\ud83c\udf35', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - christmas_tree: { - keywords: ["festival", "vacation", "december", "xmas", "celebration"], - "char": '\ud83c\udf84', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - evergreen_tree: { - keywords: ["plant", "nature"], - "char": '\ud83c\udf32', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - deciduous_tree: { - keywords: ["plant", "nature"], - "char": '\ud83c\udf33', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - palm_tree: { - keywords: ["plant", "vegetable", "nature", "summer", "beach", "mojito", "tropical"], - "char": '\ud83c\udf34', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - seedling: { - keywords: ["plant", "nature", "grass", "lawn", "spring"], - "char": '\ud83c\udf31', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - herb: { - keywords: ["vegetable", "plant", "medicine", "weed", "grass", "lawn"], - "char": '\ud83c\udf3f', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - shamrock: { - keywords: ["vegetable", "plant", "nature", "irish", "clover"], - "char": '\u2618', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - four_leaf_clover: { - keywords: ["vegetable", "plant", "nature", "lucky", "irish"], - "char": '\ud83c\udf40', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - bamboo: { - keywords: ["plant", "nature", "vegetable", "panda", "pine_decoration"], - "char": '\ud83c\udf8d', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - tanabata_tree: { - keywords: ["plant", "nature", "branch", "summer"], - "char": '\ud83c\udf8b', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - leaves: { - keywords: ["nature", "plant", "tree", "vegetable", "grass", "lawn", "spring"], - "char": '\ud83c\udf43', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - fallen_leaf: { - keywords: ["nature", "plant", "vegetable", "leaves"], - "char": '\ud83c\udf42', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - maple_leaf: { - keywords: ["nature", "plant", "vegetable", "ca", "fall"], - "char": '\ud83c\udf41', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - ear_of_rice: { - keywords: ["nature", "plant"], - "char": '\ud83c\udf3e', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - hibiscus: { - keywords: ["plant", "vegetable", "flowers", "beach"], - "char": '\ud83c\udf3a', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sunflower: { - keywords: ["nature", "plant", "fall"], - "char": '\ud83c\udf3b', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - rose: { - keywords: ["flowers", "valentines", "love", "spring"], - "char": '\ud83c\udf39', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - wilted_flower: { - keywords: ["plant", "nature", "flower"], - "char": '\ud83e\udd40', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - tulip: { - keywords: ["flowers", "plant", "nature", "summer", "spring"], - "char": '\ud83c\udf37', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - blossom: { - keywords: ["nature", "flowers", "yellow"], - "char": '\ud83c\udf3c', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cherry_blossom: { - keywords: ["nature", "plant", "spring", "flower"], - "char": '\ud83c\udf38', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - bouquet: { - keywords: ["flowers", "nature", "spring"], - "char": '\ud83d\udc90', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - mushroom: { - keywords: ["plant", "vegetable"], - "char": '\ud83c\udf44', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - chestnut: { - keywords: ["food", "squirrel"], - "char": '\ud83c\udf30', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - jack_o_lantern: { - keywords: ["halloween", "light", "pumpkin", "creepy", "fall"], - "char": '\ud83c\udf83', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - shell: { - keywords: ["nature", "sea", "beach"], - "char": '\ud83d\udc1a', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - spider_web: { - keywords: ["animal", "insect", "arachnid", "silk"], - "char": '\ud83d\udd78', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - earth_americas: { - keywords: ["globe", "world", "USA", "international"], - "char": '\ud83c\udf0e', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - earth_africa: { - keywords: ["globe", "world", "international"], - "char": '\ud83c\udf0d', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - earth_asia: { - keywords: ["globe", "world", "east", "international"], - "char": '\ud83c\udf0f', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - full_moon: { - keywords: ["nature", "yellow", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": '\ud83c\udf15', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - waning_gibbous_moon: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep", "waxing_gibbous_moon"], - "char": '\ud83c\udf16', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - last_quarter_moon: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": '\ud83c\udf17', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - waning_crescent_moon: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": '\ud83c\udf18', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - new_moon: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": '\ud83c\udf11', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - waxing_crescent_moon: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": '\ud83c\udf12', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - first_quarter_moon: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": '\ud83c\udf13', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - waxing_gibbous_moon: { - keywords: ["nature", "night", "sky", "gray", "twilight", "planet", "space", "evening", "sleep"], - "char": '\ud83c\udf14', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - new_moon_with_face: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": '\ud83c\udf1a', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - full_moon_with_face: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": '\ud83c\udf1d', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - first_quarter_moon_with_face: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": '\ud83c\udf1b', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - last_quarter_moon_with_face: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": '\ud83c\udf1c', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sun_with_face: { - keywords: ["nature", "morning", "sky"], - "char": '\ud83c\udf1e', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - crescent_moon: { - keywords: ["night", "sleep", "sky", "evening", "magic"], - "char": '\ud83c\udf19', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - star: { - keywords: ["night", "yellow"], - "char": '\u2b50', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - star2: { - keywords: ["night", "sparkle", "awesome", "good", "magic"], - "char": '\ud83c\udf1f', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - dizzy: { - keywords: ["star", "sparkle", "shoot", "magic"], - "char": '\ud83d\udcab', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sparkles: { - keywords: ["stars", "shine", "shiny", "cool", "awesome", "good", "magic"], - "char": '\u2728', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - comet: { - keywords: ["space"], - "char": '\u2604', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sunny: { - keywords: ["weather", "nature", "brightness", "summer", "beach", "spring"], - "char": '\u2600\ufe0f', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sun_behind_small_cloud: { - keywords: ["weather"], - "char": '\ud83c\udf24', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - partly_sunny: { - keywords: ["weather", "nature", "cloudy", "morning", "fall", "spring"], - "char": '\u26c5', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sun_behind_large_cloud: { - keywords: ["weather"], - "char": '\ud83c\udf25', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sun_behind_rain_cloud: { - keywords: ["weather"], - "char": '\ud83c\udf26', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cloud: { - keywords: ["weather", "sky"], - "char": '\u2601\ufe0f', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cloud_with_rain: { - keywords: ["weather"], - "char": '\ud83c\udf27', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cloud_with_lightning_and_rain: { - keywords: ["weather", "lightning"], - "char": '\u26c8', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cloud_with_lightning: { - keywords: ["weather", "thunder"], - "char": '\ud83c\udf29', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - zap: { - keywords: ["thunder", "weather", "lightning bolt", "fast"], - "char": '\u26a1', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - fire: { - keywords: ["hot", "cook", "flame"], - "char": '\ud83d\udd25', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - boom: { - keywords: ["bomb", "explode", "explosion", "collision", "blown"], - "char": '\ud83d\udca5', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - snowflake: { - keywords: ["winter", "season", "cold", "weather", "christmas", "xmas"], - "char": '\u2744\ufe0f', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cloud_with_snow: { - keywords: ["weather"], - "char": '\ud83c\udf28', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - snowman: { - keywords: ["winter", "season", "cold", "weather", "christmas", "xmas", "frozen", "without_snow"], - "char": '\u26c4', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - snowman_with_snow: { - keywords: ["winter", "season", "cold", "weather", "christmas", "xmas", "frozen"], - "char": '\u2603', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - wind_face: { - keywords: ["gust", "air"], - "char": '\ud83c\udf2c', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - dash: { - keywords: ["wind", "air", "fast", "shoo", "fart", "smoke", "puff"], - "char": '\ud83d\udca8', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - tornado: { - keywords: ["weather", "cyclone", "twister"], - "char": '\ud83c\udf2a', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - fog: { - keywords: ["weather"], - "char": '\ud83c\udf2b', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - open_umbrella: { - keywords: ["weather", "spring"], - "char": '\u2602', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - umbrella: { - keywords: ["rainy", "weather", "spring"], - "char": '\u2614', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - droplet: { - keywords: ["water", "drip", "faucet", "spring"], - "char": '\ud83d\udca7', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sweat_drops: { - keywords: ["water", "drip", "oops"], - "char": '\ud83d\udca6', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - ocean: { - keywords: ["sea", "water", "wave", "nature", "tsunami", "disaster"], - "char": '\ud83c\udf0a', - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - green_apple: { - keywords: ["fruit", "nature"], - "char": '\ud83c\udf4f', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - apple: { - keywords: ["fruit", "mac", "school"], - "char": '\ud83c\udf4e', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - pear: { - keywords: ["fruit", "nature", "food"], - "char": '\ud83c\udf50', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - tangerine: { - keywords: ["food", "fruit", "nature", "orange"], - "char": '\ud83c\udf4a', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - lemon: { - keywords: ["fruit", "nature"], - "char": '\ud83c\udf4b', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - banana: { - keywords: ["fruit", "food", "monkey"], - "char": '\ud83c\udf4c', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - watermelon: { - keywords: ["fruit", "food", "picnic", "summer"], - "char": '\ud83c\udf49', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - grapes: { - keywords: ["fruit", "food", "wine"], - "char": '\ud83c\udf47', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - strawberry: { - keywords: ["fruit", "food", "nature"], - "char": '\ud83c\udf53', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - melon: { - keywords: ["fruit", "nature", "food"], - "char": '\ud83c\udf48', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - cherries: { - keywords: ["food", "fruit"], - "char": '\ud83c\udf52', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - peach: { - keywords: ["fruit", "nature", "food"], - "char": '\ud83c\udf51', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - pineapple: { - keywords: ["fruit", "nature", "food"], - "char": '\ud83c\udf4d', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - coconut: { - keywords: ["fruit", "nature", "food", "palm"], - "char": '\ud83e\udd65', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - kiwi_fruit: { - keywords: ["fruit", "food"], - "char": '\ud83e\udd5d', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - mango: { - keywords: ["fruit", "food", "tropical"], - "char": '\ud83e\udd6d', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - avocado: { - keywords: ["fruit", "food"], - "char": '\ud83e\udd51', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - broccoli: { - keywords: ["fruit", "food", "vegetable"], - "char": '\ud83e\udd66', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - tomato: { - keywords: ["fruit", "vegetable", "nature", "food"], - "char": '\ud83c\udf45', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - eggplant: { - keywords: ["vegetable", "nature", "food", "aubergine"], - "char": '\ud83c\udf46', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - cucumber: { - keywords: ["fruit", "food", "pickle"], - "char": '\ud83e\udd52', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - carrot: { - keywords: ["vegetable", "food", "orange"], - "char": '\ud83e\udd55', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - hot_pepper: { - keywords: ["food", "spicy", "chilli", "chili"], - "char": '\ud83c\udf36', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - potato: { - keywords: ["food", "tuber", "vegatable", "starch"], - "char": '\ud83e\udd54', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - corn: { - keywords: ["food", "vegetable", "plant"], - "char": '\ud83c\udf3d', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - leafy_greens: { - keywords: ["food", "vegetable", "plant", "bok choy", "cabbage", "kale", "lettuce"], - "char": '\ud83e\udd6c', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - sweet_potato: { - keywords: ["food", "nature"], - "char": '\ud83c\udf60', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - peanuts: { - keywords: ["food", "nut"], - "char": '\ud83e\udd5c', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - honey_pot: { - keywords: ["bees", "sweet", "kitchen"], - "char": '\ud83c\udf6f', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - croissant: { - keywords: ["food", "bread", "french"], - "char": '\ud83e\udd50', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - bread: { - keywords: ["food", "wheat", "breakfast", "toast"], - "char": '\ud83c\udf5e', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - baguette_bread: { - keywords: ["food", "bread", "french"], - "char": '\ud83e\udd56', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - bagel: { - keywords: ["food", "bread", "bakery", "schmear"], - "char": '\ud83e\udd6f', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - pretzel: { - keywords: ["food", "bread", "twisted"], - "char": '\ud83e\udd68', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - cheese: { - keywords: ["food", "chadder"], - "char": '\ud83e\uddc0', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - egg: { - keywords: ["food", "chicken", "breakfast"], - "char": '\ud83e\udd5a', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - bacon: { - keywords: ["food", "breakfast", "pork", "pig", "meat"], - "char": '\ud83e\udd53', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - steak: { - keywords: ["food", "cow", "meat", "cut", "chop", "lambchop", "porkchop"], - "char": '\ud83e\udd69', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - pancakes: { - keywords: ["food", "breakfast", "flapjacks", "hotcakes"], - "char": '\ud83e\udd5e', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - poultry_leg: { - keywords: ["food", "meat", "drumstick", "bird", "chicken", "turkey"], - "char": '\ud83c\udf57', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - meat_on_bone: { - keywords: ["good", "food", "drumstick"], - "char": '\ud83c\udf56', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - bone: { - keywords: ["skeleton"], - "char": '\ud83e\uddb4', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - fried_shrimp: { - keywords: ["food", "animal", "appetizer", "summer"], - "char": '\ud83c\udf64', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - fried_egg: { - keywords: ["food", "breakfast", "kitchen", "egg"], - "char": '\ud83c\udf73', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - hamburger: { - keywords: ["meat", "fast food", "beef", "cheeseburger", "mcdonalds", "burger king"], - "char": '\ud83c\udf54', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - fries: { - keywords: ["chips", "snack", "fast food"], - "char": '\ud83c\udf5f', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - stuffed_flatbread: { - keywords: ["food", "flatbread", "stuffed", "gyro"], - "char": '\ud83e\udd59', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - hotdog: { - keywords: ["food", "frankfurter"], - "char": '\ud83c\udf2d', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - pizza: { - keywords: ["food", "party"], - "char": '\ud83c\udf55', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - sandwich: { - keywords: ["food", "lunch", "bread"], - "char": '\ud83e\udd6a', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - canned_food: { - keywords: ["food", "soup"], - "char": '\ud83e\udd6b', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - spaghetti: { - keywords: ["food", "italian", "noodle"], - "char": '\ud83c\udf5d', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - taco: { - keywords: ["food", "mexican"], - "char": '\ud83c\udf2e', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - burrito: { - keywords: ["food", "mexican"], - "char": '\ud83c\udf2f', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - green_salad: { - keywords: ["food", "healthy", "lettuce"], - "char": '\ud83e\udd57', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - shallow_pan_of_food: { - keywords: ["food", "cooking", "casserole", "paella"], - "char": '\ud83e\udd58', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - ramen: { - keywords: ["food", "japanese", "noodle", "chopsticks"], - "char": '\ud83c\udf5c', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - stew: { - keywords: ["food", "meat", "soup"], - "char": '\ud83c\udf72', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - fish_cake: { - keywords: ["food", "japan", "sea", "beach", "narutomaki", "pink", "swirl", "kamaboko", "surimi", "ramen"], - "char": '\ud83c\udf65', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - fortune_cookie: { - keywords: ["food", "prophecy"], - "char": '\ud83e\udd60', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - sushi: { - keywords: ["food", "fish", "japanese", "rice"], - "char": '\ud83c\udf63', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - bento: { - keywords: ["food", "japanese", "box"], - "char": '\ud83c\udf71', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - curry: { - keywords: ["food", "spicy", "hot", "indian"], - "char": '\ud83c\udf5b', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - rice_ball: { - keywords: ["food", "japanese"], - "char": '\ud83c\udf59', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - rice: { - keywords: ["food", "china", "asian"], - "char": '\ud83c\udf5a', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - rice_cracker: { - keywords: ["food", "japanese"], - "char": '\ud83c\udf58', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - oden: { - keywords: ["food", "japanese"], - "char": '\ud83c\udf62', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - dango: { - keywords: ["food", "dessert", "sweet", "japanese", "barbecue", "meat"], - "char": '\ud83c\udf61', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - shaved_ice: { - keywords: ["hot", "dessert", "summer"], - "char": '\ud83c\udf67', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - ice_cream: { - keywords: ["food", "hot", "dessert"], - "char": '\ud83c\udf68', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - icecream: { - keywords: ["food", "hot", "dessert", "summer"], - "char": '\ud83c\udf66', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - pie: { - keywords: ["food", "dessert", "pastry"], - "char": '\ud83e\udd67', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - cake: { - keywords: ["food", "dessert"], - "char": '\ud83c\udf70', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - cupcake: { - keywords: ["food", "dessert", "bakery", "sweet"], - "char": '\ud83e\uddc1', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - moon_cake: { - keywords: ["food", "autumn"], - "char": '\ud83e\udd6e', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - birthday: { - keywords: ["food", "dessert", "cake"], - "char": '\ud83c\udf82', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - custard: { - keywords: ["dessert", "food"], - "char": '\ud83c\udf6e', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - candy: { - keywords: ["snack", "dessert", "sweet", "lolly"], - "char": '\ud83c\udf6c', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - lollipop: { - keywords: ["food", "snack", "candy", "sweet"], - "char": '\ud83c\udf6d', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - chocolate_bar: { - keywords: ["food", "snack", "dessert", "sweet"], - "char": '\ud83c\udf6b', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - popcorn: { - keywords: ["food", "movie theater", "films", "snack"], - "char": '\ud83c\udf7f', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - dumpling: { - keywords: ["food", "empanada", "pierogi", "potsticker"], - "char": '\ud83e\udd5f', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - doughnut: { - keywords: ["food", "dessert", "snack", "sweet", "donut"], - "char": '\ud83c\udf69', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - cookie: { - keywords: ["food", "snack", "oreo", "chocolate", "sweet", "dessert"], - "char": '\ud83c\udf6a', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - milk_glass: { - keywords: ["beverage", "drink", "cow"], - "char": '\ud83e\udd5b', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - beer: { - keywords: ["relax", "beverage", "drink", "drunk", "party", "pub", "summer", "alcohol", "booze"], - "char": '\ud83c\udf7a', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - beers: { - keywords: ["relax", "beverage", "drink", "drunk", "party", "pub", "summer", "alcohol", "booze"], - "char": '\ud83c\udf7b', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - clinking_glasses: { - keywords: ["beverage", "drink", "party", "alcohol", "celebrate", "cheers", "wine", "champagne", "toast"], - "char": '\ud83e\udd42', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - wine_glass: { - keywords: ["drink", "beverage", "drunk", "alcohol", "booze"], - "char": '\ud83c\udf77', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - tumbler_glass: { - keywords: ["drink", "beverage", "drunk", "alcohol", "liquor", "booze", "bourbon", "scotch", "whisky", "glass", "shot"], - "char": '\ud83e\udd43', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - cocktail: { - keywords: ["drink", "drunk", "alcohol", "beverage", "booze", "mojito"], - "char": '\ud83c\udf78', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - tropical_drink: { - keywords: ["beverage", "cocktail", "summer", "beach", "alcohol", "booze", "mojito"], - "char": '\ud83c\udf79', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - champagne: { - keywords: ["drink", "wine", "bottle", "celebration"], - "char": '\ud83c\udf7e', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - sake: { - keywords: ["wine", "drink", "drunk", "beverage", "japanese", "alcohol", "booze"], - "char": '\ud83c\udf76', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - tea: { - keywords: ["drink", "bowl", "breakfast", "green", "british"], - "char": '\ud83c\udf75', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - cup_with_straw: { - keywords: ["drink", "soda"], - "char": '\ud83e\udd64', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - coffee: { - keywords: ["beverage", "caffeine", "latte", "espresso"], - "char": '\u2615', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - baby_bottle: { - keywords: ["food", "container", "milk"], - "char": '\ud83c\udf7c', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - salt: { - keywords: ["condiment", "shaker"], - "char": '\ud83e\uddc2', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - spoon: { - keywords: ["cutlery", "kitchen", "tableware"], - "char": '\ud83e\udd44', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - fork_and_knife: { - keywords: ["cutlery", "kitchen"], - "char": '\ud83c\udf74', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - plate_with_cutlery: { - keywords: ["food", "eat", "meal", "lunch", "dinner", "restaurant"], - "char": '\ud83c\udf7d', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - bowl_with_spoon: { - keywords: ["food", "breakfast", "cereal", "oatmeal", "porridge"], - "char": '\ud83e\udd63', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - takeout_box: { - keywords: ["food", "leftovers"], - "char": '\ud83e\udd61', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - chopsticks: { - keywords: ["food"], - "char": '\ud83e\udd62', - fitzpatrick_scale: false, - category: "food_and_drink" - }, - soccer: { - keywords: ["sports", "football"], - "char": '\u26bd', - fitzpatrick_scale: false, - category: "activity" - }, - basketball: { - keywords: ["sports", "balls", "NBA"], - "char": '\ud83c\udfc0', - fitzpatrick_scale: false, - category: "activity" - }, - football: { - keywords: ["sports", "balls", "NFL"], - "char": '\ud83c\udfc8', - fitzpatrick_scale: false, - category: "activity" - }, - baseball: { - keywords: ["sports", "balls"], - "char": '\u26be', - fitzpatrick_scale: false, - category: "activity" - }, - softball: { - keywords: ["sports", "balls"], - "char": '\ud83e\udd4e', - fitzpatrick_scale: false, - category: "activity" - }, - tennis: { - keywords: ["sports", "balls", "green"], - "char": '\ud83c\udfbe', - fitzpatrick_scale: false, - category: "activity" - }, - volleyball: { - keywords: ["sports", "balls"], - "char": '\ud83c\udfd0', - fitzpatrick_scale: false, - category: "activity" - }, - rugby_football: { - keywords: ["sports", "team"], - "char": '\ud83c\udfc9', - fitzpatrick_scale: false, - category: "activity" - }, - flying_disc: { - keywords: ["sports", "frisbee", "ultimate"], - "char": '\ud83e\udd4f', - fitzpatrick_scale: false, - category: "activity" - }, - "8ball": { - keywords: ["pool", "hobby", "game", "luck", "magic"], - "char": '\ud83c\udfb1', - fitzpatrick_scale: false, - category: "activity" - }, - golf: { - keywords: ["sports", "business", "flag", "hole", "summer"], - "char": '\u26f3', - fitzpatrick_scale: false, - category: "activity" - }, - golfing_woman: { - keywords: ["sports", "business", "woman", "female"], - "char": '\ud83c\udfcc\ufe0f\u200d\u2640\ufe0f', - fitzpatrick_scale: false, - category: "activity" - }, - golfing_man: { - keywords: ["sports", "business"], - "char": '\ud83c\udfcc', - fitzpatrick_scale: true, - category: "activity" - }, - ping_pong: { - keywords: ["sports", "pingpong"], - "char": '\ud83c\udfd3', - fitzpatrick_scale: false, - category: "activity" - }, - badminton: { - keywords: ["sports"], - "char": '\ud83c\udff8', - fitzpatrick_scale: false, - category: "activity" - }, - goal_net: { - keywords: ["sports"], - "char": '\ud83e\udd45', - fitzpatrick_scale: false, - category: "activity" - }, - ice_hockey: { - keywords: ["sports"], - "char": '\ud83c\udfd2', - fitzpatrick_scale: false, - category: "activity" - }, - field_hockey: { - keywords: ["sports"], - "char": '\ud83c\udfd1', - fitzpatrick_scale: false, - category: "activity" - }, - lacrosse: { - keywords: ["sports", "ball", "stick"], - "char": '\ud83e\udd4d', - fitzpatrick_scale: false, - category: "activity" - }, - cricket: { - keywords: ["sports"], - "char": '\ud83c\udfcf', - fitzpatrick_scale: false, - category: "activity" - }, - ski: { - keywords: ["sports", "winter", "cold", "snow"], - "char": '\ud83c\udfbf', - fitzpatrick_scale: false, - category: "activity" - }, - skier: { - keywords: ["sports", "winter", "snow"], - "char": '\u26f7', - fitzpatrick_scale: false, - category: "activity" - }, - snowboarder: { - keywords: ["sports", "winter"], - "char": '\ud83c\udfc2', - fitzpatrick_scale: true, - category: "activity" - }, - person_fencing: { - keywords: ["sports", "fencing", "sword"], - "char": '\ud83e\udd3a', - fitzpatrick_scale: false, - category: "activity" - }, - women_wrestling: { - keywords: ["sports", "wrestlers"], - "char": '\ud83e\udd3c\u200d\u2640\ufe0f', - fitzpatrick_scale: false, - category: "activity" - }, - men_wrestling: { - keywords: ["sports", "wrestlers"], - "char": '\ud83e\udd3c\u200d\u2642\ufe0f', - fitzpatrick_scale: false, - category: "activity" - }, - woman_cartwheeling: { - keywords: ["gymnastics"], - "char": '\ud83e\udd38\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "activity" - }, - man_cartwheeling: { - keywords: ["gymnastics"], - "char": '\ud83e\udd38\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "activity" - }, - woman_playing_handball: { - keywords: ["sports"], - "char": '\ud83e\udd3e\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "activity" - }, - man_playing_handball: { - keywords: ["sports"], - "char": '\ud83e\udd3e\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "activity" - }, - ice_skate: { - keywords: ["sports"], - "char": '\u26f8', - fitzpatrick_scale: false, - category: "activity" - }, - curling_stone: { - keywords: ["sports"], - "char": '\ud83e\udd4c', - fitzpatrick_scale: false, - category: "activity" - }, - skateboard: { - keywords: ["board"], - "char": '\ud83d\udef9', - fitzpatrick_scale: false, - category: "activity" - }, - sled: { - keywords: ["sleigh", "luge", "toboggan"], - "char": '\ud83d\udef7', - fitzpatrick_scale: false, - category: "activity" - }, - bow_and_arrow: { - keywords: ["sports"], - "char": '\ud83c\udff9', - fitzpatrick_scale: false, - category: "activity" - }, - fishing_pole_and_fish: { - keywords: ["food", "hobby", "summer"], - "char": '\ud83c\udfa3', - fitzpatrick_scale: false, - category: "activity" - }, - boxing_glove: { - keywords: ["sports", "fighting"], - "char": '\ud83e\udd4a', - fitzpatrick_scale: false, - category: "activity" - }, - martial_arts_uniform: { - keywords: ["judo", "karate", "taekwondo"], - "char": '\ud83e\udd4b', - fitzpatrick_scale: false, - category: "activity" - }, - rowing_woman: { - keywords: ["sports", "hobby", "water", "ship", "woman", "female"], - "char": '\ud83d\udea3\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "activity" - }, - rowing_man: { - keywords: ["sports", "hobby", "water", "ship"], - "char": '\ud83d\udea3', - fitzpatrick_scale: true, - category: "activity" - }, - climbing_woman: { - keywords: ["sports", "hobby", "woman", "female", "rock"], - "char": '\ud83e\uddd7\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "activity" - }, - climbing_man: { - keywords: ["sports", "hobby", "man", "male", "rock"], - "char": '\ud83e\uddd7\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "activity" - }, - swimming_woman: { - keywords: ["sports", "exercise", "human", "athlete", "water", "summer", "woman", "female"], - "char": '\ud83c\udfca\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "activity" - }, - swimming_man: { - keywords: ["sports", "exercise", "human", "athlete", "water", "summer"], - "char": '\ud83c\udfca', - fitzpatrick_scale: true, - category: "activity" - }, - woman_playing_water_polo: { - keywords: ["sports", "pool"], - "char": '\ud83e\udd3d\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "activity" - }, - man_playing_water_polo: { - keywords: ["sports", "pool"], - "char": '\ud83e\udd3d\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "activity" - }, - woman_in_lotus_position: { - keywords: ["woman", "female", "meditation", "yoga", "serenity", "zen", "mindfulness"], - "char": '\ud83e\uddd8\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "activity" - }, - man_in_lotus_position: { - keywords: ["man", "male", "meditation", "yoga", "serenity", "zen", "mindfulness"], - "char": '\ud83e\uddd8\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "activity" - }, - surfing_woman: { - keywords: ["sports", "ocean", "sea", "summer", "beach", "woman", "female"], - "char": '\ud83c\udfc4\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "activity" - }, - surfing_man: { - keywords: ["sports", "ocean", "sea", "summer", "beach"], - "char": '\ud83c\udfc4', - fitzpatrick_scale: true, - category: "activity" - }, - bath: { - keywords: ["clean", "shower", "bathroom"], - "char": '\ud83d\udec0', - fitzpatrick_scale: true, - category: "activity" - }, - basketball_woman: { - keywords: ["sports", "human", "woman", "female"], - "char": '\u26f9\ufe0f\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "activity" - }, - basketball_man: { - keywords: ["sports", "human"], - "char": '\u26f9', - fitzpatrick_scale: true, - category: "activity" - }, - weight_lifting_woman: { - keywords: ["sports", "training", "exercise", "woman", "female"], - "char": '\ud83c\udfcb\ufe0f\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "activity" - }, - weight_lifting_man: { - keywords: ["sports", "training", "exercise"], - "char": '\ud83c\udfcb', - fitzpatrick_scale: true, - category: "activity" - }, - biking_woman: { - keywords: ["sports", "bike", "exercise", "hipster", "woman", "female"], - "char": '\ud83d\udeb4\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "activity" - }, - biking_man: { - keywords: ["sports", "bike", "exercise", "hipster"], - "char": '\ud83d\udeb4', - fitzpatrick_scale: true, - category: "activity" - }, - mountain_biking_woman: { - keywords: ["transportation", "sports", "human", "race", "bike", "woman", "female"], - "char": '\ud83d\udeb5\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "activity" - }, - mountain_biking_man: { - keywords: ["transportation", "sports", "human", "race", "bike"], - "char": '\ud83d\udeb5', - fitzpatrick_scale: true, - category: "activity" - }, - horse_racing: { - keywords: ["animal", "betting", "competition", "gambling", "luck"], - "char": '\ud83c\udfc7', - fitzpatrick_scale: true, - category: "activity" - }, - business_suit_levitating: { - keywords: ["suit", "business", "levitate", "hover", "jump"], - "char": '\ud83d\udd74', - fitzpatrick_scale: true, - category: "activity" - }, - trophy: { - keywords: ["win", "award", "contest", "place", "ftw", "ceremony"], - "char": '\ud83c\udfc6', - fitzpatrick_scale: false, - category: "activity" - }, - running_shirt_with_sash: { - keywords: ["play", "pageant"], - "char": '\ud83c\udfbd', - fitzpatrick_scale: false, - category: "activity" - }, - medal_sports: { - keywords: ["award", "winning"], - "char": '\ud83c\udfc5', - fitzpatrick_scale: false, - category: "activity" - }, - medal_military: { - keywords: ["award", "winning", "army"], - "char": '\ud83c\udf96', - fitzpatrick_scale: false, - category: "activity" - }, - "1st_place_medal": { - keywords: ["award", "winning", "first"], - "char": '\ud83e\udd47', - fitzpatrick_scale: false, - category: "activity" - }, - "2nd_place_medal": { - keywords: ["award", "second"], - "char": '\ud83e\udd48', - fitzpatrick_scale: false, - category: "activity" - }, - "3rd_place_medal": { - keywords: ["award", "third"], - "char": '\ud83e\udd49', - fitzpatrick_scale: false, - category: "activity" - }, - reminder_ribbon: { - keywords: ["sports", "cause", "support", "awareness"], - "char": '\ud83c\udf97', - fitzpatrick_scale: false, - category: "activity" - }, - rosette: { - keywords: ["flower", "decoration", "military"], - "char": '\ud83c\udff5', - fitzpatrick_scale: false, - category: "activity" - }, - ticket: { - keywords: ["event", "concert", "pass"], - "char": '\ud83c\udfab', - fitzpatrick_scale: false, - category: "activity" - }, - tickets: { - keywords: ["sports", "concert", "entrance"], - "char": '\ud83c\udf9f', - fitzpatrick_scale: false, - category: "activity" - }, - performing_arts: { - keywords: ["acting", "theater", "drama"], - "char": '\ud83c\udfad', - fitzpatrick_scale: false, - category: "activity" - }, - art: { - keywords: ["design", "paint", "draw", "colors"], - "char": '\ud83c\udfa8', - fitzpatrick_scale: false, - category: "activity" - }, - circus_tent: { - keywords: ["festival", "carnival", "party"], - "char": '\ud83c\udfaa', - fitzpatrick_scale: false, - category: "activity" - }, - woman_juggling: { - keywords: ["juggle", "balance", "skill", "multitask"], - "char": '\ud83e\udd39\u200d\u2640\ufe0f', - fitzpatrick_scale: true, - category: "activity" - }, - man_juggling: { - keywords: ["juggle", "balance", "skill", "multitask"], - "char": '\ud83e\udd39\u200d\u2642\ufe0f', - fitzpatrick_scale: true, - category: "activity" - }, - microphone: { - keywords: ["sound", "music", "PA", "sing", "talkshow"], - "char": '\ud83c\udfa4', - fitzpatrick_scale: false, - category: "activity" - }, - headphones: { - keywords: ["music", "score", "gadgets"], - "char": '\ud83c\udfa7', - fitzpatrick_scale: false, - category: "activity" - }, - musical_score: { - keywords: ["treble", "clef", "compose"], - "char": '\ud83c\udfbc', - fitzpatrick_scale: false, - category: "activity" - }, - musical_keyboard: { - keywords: ["piano", "instrument", "compose"], - "char": '\ud83c\udfb9', - fitzpatrick_scale: false, - category: "activity" - }, - drum: { - keywords: ["music", "instrument", "drumsticks", "snare"], - "char": '\ud83e\udd41', - fitzpatrick_scale: false, - category: "activity" - }, - saxophone: { - keywords: ["music", "instrument", "jazz", "blues"], - "char": '\ud83c\udfb7', - fitzpatrick_scale: false, - category: "activity" - }, - trumpet: { - keywords: ["music", "brass"], - "char": '\ud83c\udfba', - fitzpatrick_scale: false, - category: "activity" - }, - guitar: { - keywords: ["music", "instrument"], - "char": '\ud83c\udfb8', - fitzpatrick_scale: false, - category: "activity" - }, - violin: { - keywords: ["music", "instrument", "orchestra", "symphony"], - "char": '\ud83c\udfbb', - fitzpatrick_scale: false, - category: "activity" - }, - clapper: { - keywords: ["movie", "film", "record"], - "char": '\ud83c\udfac', - fitzpatrick_scale: false, - category: "activity" - }, - video_game: { - keywords: ["play", "console", "PS4", "controller"], - "char": '\ud83c\udfae', - fitzpatrick_scale: false, - category: "activity" - }, - space_invader: { - keywords: ["game", "arcade", "play"], - "char": '\ud83d\udc7e', - fitzpatrick_scale: false, - category: "activity" - }, - dart: { - keywords: ["game", "play", "bar", "target", "bullseye"], - "char": '\ud83c\udfaf', - fitzpatrick_scale: false, - category: "activity" - }, - game_die: { - keywords: ["dice", "random", "tabletop", "play", "luck"], - "char": '\ud83c\udfb2', - fitzpatrick_scale: false, - category: "activity" - }, - chess_pawn: { - keywords: ["expendable"], - "char": "\u265f", - fitzpatrick_scale: false, - category: "activity" - }, - slot_machine: { - keywords: ["bet", "gamble", "vegas", "fruit machine", "luck", "casino"], - "char": '\ud83c\udfb0', - fitzpatrick_scale: false, - category: "activity" - }, - jigsaw: { - keywords: ["interlocking", "puzzle", "piece"], - "char": '\ud83e\udde9', - fitzpatrick_scale: false, - category: "activity" - }, - bowling: { - keywords: ["sports", "fun", "play"], - "char": '\ud83c\udfb3', - fitzpatrick_scale: false, - category: "activity" - }, - red_car: { - keywords: ["red", "transportation", "vehicle"], - "char": '\ud83d\ude97', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - taxi: { - keywords: ["uber", "vehicle", "cars", "transportation"], - "char": '\ud83d\ude95', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - blue_car: { - keywords: ["transportation", "vehicle"], - "char": '\ud83d\ude99', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - bus: { - keywords: ["car", "vehicle", "transportation"], - "char": '\ud83d\ude8c', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - trolleybus: { - keywords: ["bart", "transportation", "vehicle"], - "char": '\ud83d\ude8e', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - racing_car: { - keywords: ["sports", "race", "fast", "formula", "f1"], - "char": '\ud83c\udfce', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - police_car: { - keywords: ["vehicle", "cars", "transportation", "law", "legal", "enforcement"], - "char": '\ud83d\ude93', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - ambulance: { - keywords: ["health", "911", "hospital"], - "char": '\ud83d\ude91', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - fire_engine: { - keywords: ["transportation", "cars", "vehicle"], - "char": '\ud83d\ude92', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - minibus: { - keywords: ["vehicle", "car", "transportation"], - "char": '\ud83d\ude90', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - truck: { - keywords: ["cars", "transportation"], - "char": '\ud83d\ude9a', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - articulated_lorry: { - keywords: ["vehicle", "cars", "transportation", "express"], - "char": '\ud83d\ude9b', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - tractor: { - keywords: ["vehicle", "car", "farming", "agriculture"], - "char": '\ud83d\ude9c', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - kick_scooter: { - keywords: ["vehicle", "kick", "razor"], - "char": '\ud83d\udef4', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - motorcycle: { - keywords: ["race", "sports", "fast"], - "char": '\ud83c\udfcd', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - bike: { - keywords: ["sports", "bicycle", "exercise", "hipster"], - "char": '\ud83d\udeb2', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - motor_scooter: { - keywords: ["vehicle", "vespa", "sasha"], - "char": '\ud83d\udef5', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - rotating_light: { - keywords: ["police", "ambulance", "911", "emergency", "alert", "error", "pinged", "law", "legal"], - "char": '\ud83d\udea8', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - oncoming_police_car: { - keywords: ["vehicle", "law", "legal", "enforcement", "911"], - "char": '\ud83d\ude94', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - oncoming_bus: { - keywords: ["vehicle", "transportation"], - "char": '\ud83d\ude8d', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - oncoming_automobile: { - keywords: ["car", "vehicle", "transportation"], - "char": '\ud83d\ude98', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - oncoming_taxi: { - keywords: ["vehicle", "cars", "uber"], - "char": '\ud83d\ude96', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - aerial_tramway: { - keywords: ["transportation", "vehicle", "ski"], - "char": '\ud83d\udea1', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - mountain_cableway: { - keywords: ["transportation", "vehicle", "ski"], - "char": '\ud83d\udea0', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - suspension_railway: { - keywords: ["vehicle", "transportation"], - "char": '\ud83d\ude9f', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - railway_car: { - keywords: ["transportation", "vehicle"], - "char": '\ud83d\ude83', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - train: { - keywords: ["transportation", "vehicle", "carriage", "public", "travel"], - "char": '\ud83d\ude8b', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - monorail: { - keywords: ["transportation", "vehicle"], - "char": '\ud83d\ude9d', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - bullettrain_side: { - keywords: ["transportation", "vehicle"], - "char": '\ud83d\ude84', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - bullettrain_front: { - keywords: ["transportation", "vehicle", "speed", "fast", "public", "travel"], - "char": '\ud83d\ude85', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - light_rail: { - keywords: ["transportation", "vehicle"], - "char": '\ud83d\ude88', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - mountain_railway: { - keywords: ["transportation", "vehicle"], - "char": '\ud83d\ude9e', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - steam_locomotive: { - keywords: ["transportation", "vehicle", "train"], - "char": '\ud83d\ude82', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - train2: { - keywords: ["transportation", "vehicle"], - "char": '\ud83d\ude86', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - metro: { - keywords: ["transportation", "blue-square", "mrt", "underground", "tube"], - "char": '\ud83d\ude87', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - tram: { - keywords: ["transportation", "vehicle"], - "char": '\ud83d\ude8a', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - station: { - keywords: ["transportation", "vehicle", "public"], - "char": '\ud83d\ude89', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - flying_saucer: { - keywords: ["transportation", "vehicle", "ufo"], - "char": '\ud83d\udef8', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - helicopter: { - keywords: ["transportation", "vehicle", "fly"], - "char": '\ud83d\ude81', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - small_airplane: { - keywords: ["flight", "transportation", "fly", "vehicle"], - "char": '\ud83d\udee9', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - airplane: { - keywords: ["vehicle", "transportation", "flight", "fly"], - "char": '\u2708\ufe0f', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - flight_departure: { - keywords: ["airport", "flight", "landing"], - "char": '\ud83d\udeeb', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - flight_arrival: { - keywords: ["airport", "flight", "boarding"], - "char": '\ud83d\udeec', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - sailboat: { - keywords: ["ship", "summer", "transportation", "water", "sailing"], - "char": '\u26f5', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - motor_boat: { - keywords: ["ship"], - "char": '\ud83d\udee5', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - speedboat: { - keywords: ["ship", "transportation", "vehicle", "summer"], - "char": '\ud83d\udea4', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - ferry: { - keywords: ["boat", "ship", "yacht"], - "char": '\u26f4', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - passenger_ship: { - keywords: ["yacht", "cruise", "ferry"], - "char": '\ud83d\udef3', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - rocket: { - keywords: ["launch", "ship", "staffmode", "NASA", "outer space", "outer_space", "fly"], - "char": '\ud83d\ude80', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - artificial_satellite: { - keywords: ["communication", "gps", "orbit", "spaceflight", "NASA", "ISS"], - "char": '\ud83d\udef0', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - seat: { - keywords: ["sit", "airplane", "transport", "bus", "flight", "fly"], - "char": '\ud83d\udcba', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - canoe: { - keywords: ["boat", "paddle", "water", "ship"], - "char": '\ud83d\udef6', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - anchor: { - keywords: ["ship", "ferry", "sea", "boat"], - "char": '\u2693', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - construction: { - keywords: ["wip", "progress", "caution", "warning"], - "char": '\ud83d\udea7', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - fuelpump: { - keywords: ["gas station", "petroleum"], - "char": '\u26fd', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - busstop: { - keywords: ["transportation", "wait"], - "char": '\ud83d\ude8f', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - vertical_traffic_light: { - keywords: ["transportation", "driving"], - "char": '\ud83d\udea6', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - traffic_light: { - keywords: ["transportation", "signal"], - "char": '\ud83d\udea5', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - checkered_flag: { - keywords: ["contest", "finishline", "race", "gokart"], - "char": '\ud83c\udfc1', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - ship: { - keywords: ["transportation", "titanic", "deploy"], - "char": '\ud83d\udea2', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - ferris_wheel: { - keywords: ["photo", "carnival", "londoneye"], - "char": '\ud83c\udfa1', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - roller_coaster: { - keywords: ["carnival", "playground", "photo", "fun"], - "char": '\ud83c\udfa2', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - carousel_horse: { - keywords: ["photo", "carnival"], - "char": '\ud83c\udfa0', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - building_construction: { - keywords: ["wip", "working", "progress"], - "char": '\ud83c\udfd7', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - foggy: { - keywords: ["photo", "mountain"], - "char": '\ud83c\udf01', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - tokyo_tower: { - keywords: ["photo", "japanese"], - "char": '\ud83d\uddfc', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - factory: { - keywords: ["building", "industry", "pollution", "smoke"], - "char": '\ud83c\udfed', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - fountain: { - keywords: ["photo", "summer", "water", "fresh"], - "char": '\u26f2', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - rice_scene: { - keywords: ["photo", "japan", "asia", "tsukimi"], - "char": '\ud83c\udf91', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - mountain: { - keywords: ["photo", "nature", "environment"], - "char": '\u26f0', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - mountain_snow: { - keywords: ["photo", "nature", "environment", "winter", "cold"], - "char": '\ud83c\udfd4', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - mount_fuji: { - keywords: ["photo", "mountain", "nature", "japanese"], - "char": '\ud83d\uddfb', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - volcano: { - keywords: ["photo", "nature", "disaster"], - "char": '\ud83c\udf0b', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - japan: { - keywords: ["nation", "country", "japanese", "asia"], - "char": '\ud83d\uddfe', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - camping: { - keywords: ["photo", "outdoors", "tent"], - "char": '\ud83c\udfd5', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - tent: { - keywords: ["photo", "camping", "outdoors"], - "char": '\u26fa', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - national_park: { - keywords: ["photo", "environment", "nature"], - "char": '\ud83c\udfde', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - motorway: { - keywords: ["road", "cupertino", "interstate", "highway"], - "char": '\ud83d\udee3', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - railway_track: { - keywords: ["train", "transportation"], - "char": '\ud83d\udee4', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - sunrise: { - keywords: ["morning", "view", "vacation", "photo"], - "char": '\ud83c\udf05', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - sunrise_over_mountains: { - keywords: ["view", "vacation", "photo"], - "char": '\ud83c\udf04', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - desert: { - keywords: ["photo", "warm", "saharah"], - "char": '\ud83c\udfdc', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - beach_umbrella: { - keywords: ["weather", "summer", "sunny", "sand", "mojito"], - "char": '\ud83c\udfd6', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - desert_island: { - keywords: ["photo", "tropical", "mojito"], - "char": '\ud83c\udfdd', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - city_sunrise: { - keywords: ["photo", "good morning", "dawn"], - "char": '\ud83c\udf07', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - city_sunset: { - keywords: ["photo", "evening", "sky", "buildings"], - "char": '\ud83c\udf06', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - cityscape: { - keywords: ["photo", "night life", "urban"], - "char": '\ud83c\udfd9', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - night_with_stars: { - keywords: ["evening", "city", "downtown"], - "char": '\ud83c\udf03', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - bridge_at_night: { - keywords: ["photo", "sanfrancisco"], - "char": '\ud83c\udf09', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - milky_way: { - keywords: ["photo", "space", "stars"], - "char": '\ud83c\udf0c', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - stars: { - keywords: ["night", "photo"], - "char": '\ud83c\udf20', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - sparkler: { - keywords: ["stars", "night", "shine"], - "char": '\ud83c\udf87', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - fireworks: { - keywords: ["photo", "festival", "carnival", "congratulations"], - "char": '\ud83c\udf86', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - rainbow: { - keywords: ["nature", "happy", "unicorn_face", "photo", "sky", "spring"], - "char": '\ud83c\udf08', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - houses: { - keywords: ["buildings", "photo"], - "char": '\ud83c\udfd8', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - european_castle: { - keywords: ["building", "royalty", "history"], - "char": '\ud83c\udff0', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - japanese_castle: { - keywords: ["photo", "building"], - "char": '\ud83c\udfef', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - stadium: { - keywords: ["photo", "place", "sports", "concert", "venue"], - "char": '\ud83c\udfdf', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - statue_of_liberty: { - keywords: ["american", "newyork"], - "char": '\ud83d\uddfd', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - house: { - keywords: ["building", "home"], - "char": '\ud83c\udfe0', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - house_with_garden: { - keywords: ["home", "plant", "nature"], - "char": '\ud83c\udfe1', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - derelict_house: { - keywords: ["abandon", "evict", "broken", "building"], - "char": '\ud83c\udfda', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - office: { - keywords: ["building", "bureau", "work"], - "char": '\ud83c\udfe2', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - department_store: { - keywords: ["building", "shopping", "mall"], - "char": '\ud83c\udfec', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - post_office: { - keywords: ["building", "envelope", "communication"], - "char": '\ud83c\udfe3', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - european_post_office: { - keywords: ["building", "email"], - "char": '\ud83c\udfe4', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - hospital: { - keywords: ["building", "health", "surgery", "doctor"], - "char": '\ud83c\udfe5', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - bank: { - keywords: ["building", "money", "sales", "cash", "business", "enterprise"], - "char": '\ud83c\udfe6', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - hotel: { - keywords: ["building", "accomodation", "checkin"], - "char": '\ud83c\udfe8', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - convenience_store: { - keywords: ["building", "shopping", "groceries"], - "char": '\ud83c\udfea', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - school: { - keywords: ["building", "student", "education", "learn", "teach"], - "char": '\ud83c\udfeb', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - love_hotel: { - keywords: ["like", "affection", "dating"], - "char": '\ud83c\udfe9', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - wedding: { - keywords: ["love", "like", "affection", "couple", "marriage", "bride", "groom"], - "char": '\ud83d\udc92', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - classical_building: { - keywords: ["art", "culture", "history"], - "char": '\ud83c\udfdb', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - church: { - keywords: ["building", "religion", "christ"], - "char": '\u26ea', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - mosque: { - keywords: ["islam", "worship", "minaret"], - "char": '\ud83d\udd4c', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - synagogue: { - keywords: ["judaism", "worship", "temple", "jewish"], - "char": '\ud83d\udd4d', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - kaaba: { - keywords: ["mecca", "mosque", "islam"], - "char": '\ud83d\udd4b', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - shinto_shrine: { - keywords: ["temple", "japan", "kyoto"], - "char": '\u26e9', - fitzpatrick_scale: false, - category: "travel_and_places" - }, - watch: { - keywords: ["time", "accessories"], - "char": '\u231a', - fitzpatrick_scale: false, - category: "objects" - }, - iphone: { - keywords: ["technology", "apple", "gadgets", "dial"], - "char": '\ud83d\udcf1', - fitzpatrick_scale: false, - category: "objects" - }, - calling: { - keywords: ["iphone", "incoming"], - "char": '\ud83d\udcf2', - fitzpatrick_scale: false, - category: "objects" - }, - computer: { - keywords: ["technology", "laptop", "screen", "display", "monitor"], - "char": '\ud83d\udcbb', - fitzpatrick_scale: false, - category: "objects" - }, - keyboard: { - keywords: ["technology", "computer", "type", "input", "text"], - "char": '\u2328', - fitzpatrick_scale: false, - category: "objects" - }, - desktop_computer: { - keywords: ["technology", "computing", "screen"], - "char": '\ud83d\udda5', - fitzpatrick_scale: false, - category: "objects" - }, - printer: { - keywords: ["paper", "ink"], - "char": '\ud83d\udda8', - fitzpatrick_scale: false, - category: "objects" - }, - computer_mouse: { - keywords: ["click"], - "char": '\ud83d\uddb1', - fitzpatrick_scale: false, - category: "objects" - }, - trackball: { - keywords: ["technology", "trackpad"], - "char": '\ud83d\uddb2', - fitzpatrick_scale: false, - category: "objects" - }, - joystick: { - keywords: ["game", "play"], - "char": '\ud83d\udd79', - fitzpatrick_scale: false, - category: "objects" - }, - clamp: { - keywords: ["tool"], - "char": '\ud83d\udddc', - fitzpatrick_scale: false, - category: "objects" - }, - minidisc: { - keywords: ["technology", "record", "data", "disk", "90s"], - "char": '\ud83d\udcbd', - fitzpatrick_scale: false, - category: "objects" - }, - floppy_disk: { - keywords: ["oldschool", "technology", "save", "90s", "80s"], - "char": '\ud83d\udcbe', - fitzpatrick_scale: false, - category: "objects" - }, - cd: { - keywords: ["technology", "dvd", "disk", "disc", "90s"], - "char": '\ud83d\udcbf', - fitzpatrick_scale: false, - category: "objects" - }, - dvd: { - keywords: ["cd", "disk", "disc"], - "char": '\ud83d\udcc0', - fitzpatrick_scale: false, - category: "objects" - }, - vhs: { - keywords: ["record", "video", "oldschool", "90s", "80s"], - "char": '\ud83d\udcfc', - fitzpatrick_scale: false, - category: "objects" - }, - camera: { - keywords: ["gadgets", "photography"], - "char": '\ud83d\udcf7', - fitzpatrick_scale: false, - category: "objects" - }, - camera_flash: { - keywords: ["photography", "gadgets"], - "char": '\ud83d\udcf8', - fitzpatrick_scale: false, - category: "objects" - }, - video_camera: { - keywords: ["film", "record"], - "char": '\ud83d\udcf9', - fitzpatrick_scale: false, - category: "objects" - }, - movie_camera: { - keywords: ["film", "record"], - "char": '\ud83c\udfa5', - fitzpatrick_scale: false, - category: "objects" - }, - film_projector: { - keywords: ["video", "tape", "record", "movie"], - "char": '\ud83d\udcfd', - fitzpatrick_scale: false, - category: "objects" - }, - film_strip: { - keywords: ["movie"], - "char": '\ud83c\udf9e', - fitzpatrick_scale: false, - category: "objects" - }, - telephone_receiver: { - keywords: ["technology", "communication", "dial"], - "char": '\ud83d\udcde', - fitzpatrick_scale: false, - category: "objects" - }, - phone: { - keywords: ["technology", "communication", "dial", "telephone"], - "char": '\u260e\ufe0f', - fitzpatrick_scale: false, - category: "objects" - }, - pager: { - keywords: ["bbcall", "oldschool", "90s"], - "char": '\ud83d\udcdf', - fitzpatrick_scale: false, - category: "objects" - }, - fax: { - keywords: ["communication", "technology"], - "char": '\ud83d\udce0', - fitzpatrick_scale: false, - category: "objects" - }, - tv: { - keywords: ["technology", "program", "oldschool", "show", "television"], - "char": '\ud83d\udcfa', - fitzpatrick_scale: false, - category: "objects" - }, - radio: { - keywords: ["communication", "music", "podcast", "program"], - "char": '\ud83d\udcfb', - fitzpatrick_scale: false, - category: "objects" - }, - studio_microphone: { - keywords: ["sing", "recording", "artist", "talkshow"], - "char": '\ud83c\udf99', - fitzpatrick_scale: false, - category: "objects" - }, - level_slider: { - keywords: ["scale"], - "char": '\ud83c\udf9a', - fitzpatrick_scale: false, - category: "objects" - }, - control_knobs: { - keywords: ["dial"], - "char": '\ud83c\udf9b', - fitzpatrick_scale: false, - category: "objects" - }, - compass: { - keywords: ["magnetic", "navigation", "orienteering"], - "char": '\ud83e\udded', - fitzpatrick_scale: false, - category: "objects" - }, - stopwatch: { - keywords: ["time", "deadline"], - "char": '\u23f1', - fitzpatrick_scale: false, - category: "objects" - }, - timer_clock: { - keywords: ["alarm"], - "char": '\u23f2', - fitzpatrick_scale: false, - category: "objects" - }, - alarm_clock: { - keywords: ["time", "wake"], - "char": '\u23f0', - fitzpatrick_scale: false, - category: "objects" - }, - mantelpiece_clock: { - keywords: ["time"], - "char": '\ud83d\udd70', - fitzpatrick_scale: false, - category: "objects" - }, - hourglass_flowing_sand: { - keywords: ["oldschool", "time", "countdown"], - "char": '\u23f3', - fitzpatrick_scale: false, - category: "objects" - }, - hourglass: { - keywords: ["time", "clock", "oldschool", "limit", "exam", "quiz", "test"], - "char": '\u231b', - fitzpatrick_scale: false, - category: "objects" - }, - satellite: { - keywords: ["communication", "future", "radio", "space"], - "char": '\ud83d\udce1', - fitzpatrick_scale: false, - category: "objects" - }, - battery: { - keywords: ["power", "energy", "sustain"], - "char": '\ud83d\udd0b', - fitzpatrick_scale: false, - category: "objects" - }, - electric_plug: { - keywords: ["charger", "power"], - "char": '\ud83d\udd0c', - fitzpatrick_scale: false, - category: "objects" - }, - bulb: { - keywords: ["light", "electricity", "idea"], - "char": '\ud83d\udca1', - fitzpatrick_scale: false, - category: "objects" - }, - flashlight: { - keywords: ["dark", "camping", "sight", "night"], - "char": '\ud83d\udd26', - fitzpatrick_scale: false, - category: "objects" - }, - candle: { - keywords: ["fire", "wax"], - "char": '\ud83d\udd6f', - fitzpatrick_scale: false, - category: "objects" - }, - fire_extinguisher: { - keywords: ["quench"], - "char": '\ud83e\uddef', - fitzpatrick_scale: false, - category: "objects" - }, - wastebasket: { - keywords: ["bin", "trash", "rubbish", "garbage", "toss"], - "char": '\ud83d\uddd1', - fitzpatrick_scale: false, - category: "objects" - }, - oil_drum: { - keywords: ["barrell"], - "char": '\ud83d\udee2', - fitzpatrick_scale: false, - category: "objects" - }, - money_with_wings: { - keywords: ["dollar", "bills", "payment", "sale"], - "char": '\ud83d\udcb8', - fitzpatrick_scale: false, - category: "objects" - }, - dollar: { - keywords: ["money", "sales", "bill", "currency"], - "char": '\ud83d\udcb5', - fitzpatrick_scale: false, - category: "objects" - }, - yen: { - keywords: ["money", "sales", "japanese", "dollar", "currency"], - "char": '\ud83d\udcb4', - fitzpatrick_scale: false, - category: "objects" - }, - euro: { - keywords: ["money", "sales", "dollar", "currency"], - "char": '\ud83d\udcb6', - fitzpatrick_scale: false, - category: "objects" - }, - pound: { - keywords: ["british", "sterling", "money", "sales", "bills", "uk", "england", "currency"], - "char": '\ud83d\udcb7', - fitzpatrick_scale: false, - category: "objects" - }, - moneybag: { - keywords: ["dollar", "payment", "coins", "sale"], - "char": '\ud83d\udcb0', - fitzpatrick_scale: false, - category: "objects" - }, - credit_card: { - keywords: ["money", "sales", "dollar", "bill", "payment", "shopping"], - "char": '\ud83d\udcb3', - fitzpatrick_scale: false, - category: "objects" - }, - gem: { - keywords: ["blue", "ruby", "diamond", "jewelry"], - "char": '\ud83d\udc8e', - fitzpatrick_scale: false, - category: "objects" - }, - balance_scale: { - keywords: ["law", "fairness", "weight"], - "char": '\u2696', - fitzpatrick_scale: false, - category: "objects" - }, - toolbox: { - keywords: ["tools", "diy", "fix", "maintainer", "mechanic"], - "char": '\ud83e\uddf0', - fitzpatrick_scale: false, - category: "objects" - }, - wrench: { - keywords: ["tools", "diy", "ikea", "fix", "maintainer"], - "char": '\ud83d\udd27', - fitzpatrick_scale: false, - category: "objects" - }, - hammer: { - keywords: ["tools", "build", "create"], - "char": '\ud83d\udd28', - fitzpatrick_scale: false, - category: "objects" - }, - hammer_and_pick: { - keywords: ["tools", "build", "create"], - "char": '\u2692', - fitzpatrick_scale: false, - category: "objects" - }, - hammer_and_wrench: { - keywords: ["tools", "build", "create"], - "char": '\ud83d\udee0', - fitzpatrick_scale: false, - category: "objects" - }, - pick: { - keywords: ["tools", "dig"], - "char": '\u26cf', - fitzpatrick_scale: false, - category: "objects" - }, - nut_and_bolt: { - keywords: ["handy", "tools", "fix"], - "char": '\ud83d\udd29', - fitzpatrick_scale: false, - category: "objects" - }, - gear: { - keywords: ["cog"], - "char": '\u2699', - fitzpatrick_scale: false, - category: "objects" - }, - brick: { - keywords: ["bricks"], - "char": '\ud83e\uddf1', - fitzpatrick_scale: false, - category: "objects" - }, - chains: { - keywords: ["lock", "arrest"], - "char": '\u26d3', - fitzpatrick_scale: false, - category: "objects" - }, - magnet: { - keywords: ["attraction", "magnetic"], - "char": '\ud83e\uddf2', - fitzpatrick_scale: false, - category: "objects" - }, - gun: { - keywords: ["violence", "weapon", "pistol", "revolver"], - "char": '\ud83d\udd2b', - fitzpatrick_scale: false, - category: "objects" - }, - bomb: { - keywords: ["boom", "explode", "explosion", "terrorism"], - "char": '\ud83d\udca3', - fitzpatrick_scale: false, - category: "objects" - }, - firecracker: { - keywords: ["dynamite", "boom", "explode", "explosion", "explosive"], - "char": '\ud83e\udde8', - fitzpatrick_scale: false, - category: "objects" - }, - hocho: { - keywords: ["knife", "blade", "cutlery", "kitchen", "weapon"], - "char": '\ud83d\udd2a', - fitzpatrick_scale: false, - category: "objects" - }, - dagger: { - keywords: ["weapon"], - "char": '\ud83d\udde1', - fitzpatrick_scale: false, - category: "objects" - }, - crossed_swords: { - keywords: ["weapon"], - "char": '\u2694', - fitzpatrick_scale: false, - category: "objects" - }, - shield: { - keywords: ["protection", "security"], - "char": '\ud83d\udee1', - fitzpatrick_scale: false, - category: "objects" - }, - smoking: { - keywords: ["kills", "tobacco", "cigarette", "joint", "smoke"], - "char": '\ud83d\udeac', - fitzpatrick_scale: false, - category: "objects" - }, - skull_and_crossbones: { - keywords: ["poison", "danger", "deadly", "scary", "death", "pirate", "evil"], - "char": '\u2620', - fitzpatrick_scale: false, - category: "objects" - }, - coffin: { - keywords: ["vampire", "dead", "die", "death", "rip", "graveyard", "cemetery", "casket", "funeral", "box"], - "char": '\u26b0', - fitzpatrick_scale: false, - category: "objects" - }, - funeral_urn: { - keywords: ["dead", "die", "death", "rip", "ashes"], - "char": '\u26b1', - fitzpatrick_scale: false, - category: "objects" - }, - amphora: { - keywords: ["vase", "jar"], - "char": '\ud83c\udffa', - fitzpatrick_scale: false, - category: "objects" - }, - crystal_ball: { - keywords: ["disco", "party", "magic", "circus", "fortune_teller"], - "char": '\ud83d\udd2e', - fitzpatrick_scale: false, - category: "objects" - }, - prayer_beads: { - keywords: ["dhikr", "religious"], - "char": '\ud83d\udcff', - fitzpatrick_scale: false, - category: "objects" - }, - nazar_amulet: { - keywords: ["bead", "charm"], - "char": '\ud83e\uddff', - fitzpatrick_scale: false, - category: "objects" - }, - barber: { - keywords: ["hair", "salon", "style"], - "char": '\ud83d\udc88', - fitzpatrick_scale: false, - category: "objects" - }, - alembic: { - keywords: ["distilling", "science", "experiment", "chemistry"], - "char": '\u2697', - fitzpatrick_scale: false, - category: "objects" - }, - telescope: { - keywords: ["stars", "space", "zoom", "science", "astronomy"], - "char": '\ud83d\udd2d', - fitzpatrick_scale: false, - category: "objects" - }, - microscope: { - keywords: ["laboratory", "experiment", "zoomin", "science", "study"], - "char": '\ud83d\udd2c', - fitzpatrick_scale: false, - category: "objects" - }, - hole: { - keywords: ["embarrassing"], - "char": '\ud83d\udd73', - fitzpatrick_scale: false, - category: "objects" - }, - pill: { - keywords: ["health", "medicine", "doctor", "pharmacy", "drug"], - "char": '\ud83d\udc8a', - fitzpatrick_scale: false, - category: "objects" - }, - syringe: { - keywords: ["health", "hospital", "drugs", "blood", "medicine", "needle", "doctor", "nurse"], - "char": '\ud83d\udc89', - fitzpatrick_scale: false, - category: "objects" - }, - dna: { - keywords: ["biologist", "genetics", "life"], - "char": '\ud83e\uddec', - fitzpatrick_scale: false, - category: "objects" - }, - microbe: { - keywords: ["amoeba", "bacteria", "germs"], - "char": '\ud83e\udda0', - fitzpatrick_scale: false, - category: "objects" - }, - petri_dish: { - keywords: ["bacteria", "biology", "culture", "lab"], - "char": '\ud83e\uddeb', - fitzpatrick_scale: false, - category: "objects" - }, - test_tube: { - keywords: ["chemistry", "experiment", "lab", "science"], - "char": '\ud83e\uddea', - fitzpatrick_scale: false, - category: "objects" - }, - thermometer: { - keywords: ["weather", "temperature", "hot", "cold"], - "char": '\ud83c\udf21', - fitzpatrick_scale: false, - category: "objects" - }, - broom: { - keywords: ["cleaning", "sweeping", "witch"], - "char": '\ud83e\uddf9', - fitzpatrick_scale: false, - category: "objects" - }, - basket: { - keywords: ["laundry"], - "char": '\ud83e\uddfa', - fitzpatrick_scale: false, - category: "objects" - }, - toilet_paper: { - keywords: ["roll"], - "char": '\ud83e\uddfb', - fitzpatrick_scale: false, - category: "objects" - }, - label: { - keywords: ["sale", "tag"], - "char": '\ud83c\udff7', - fitzpatrick_scale: false, - category: "objects" - }, - bookmark: { - keywords: ["favorite", "label", "save"], - "char": '\ud83d\udd16', - fitzpatrick_scale: false, - category: "objects" - }, - toilet: { - keywords: ["restroom", "wc", "washroom", "bathroom", "potty"], - "char": '\ud83d\udebd', - fitzpatrick_scale: false, - category: "objects" - }, - shower: { - keywords: ["clean", "water", "bathroom"], - "char": '\ud83d\udebf', - fitzpatrick_scale: false, - category: "objects" - }, - bathtub: { - keywords: ["clean", "shower", "bathroom"], - "char": '\ud83d\udec1', - fitzpatrick_scale: false, - category: "objects" - }, - soap: { - keywords: ["bar", "bathing", "cleaning", "lather"], - "char": '\ud83e\uddfc', - fitzpatrick_scale: false, - category: "objects" - }, - sponge: { - keywords: ["absorbing", "cleaning", "porous"], - "char": '\ud83e\uddfd', - fitzpatrick_scale: false, - category: "objects" - }, - lotion_bottle: { - keywords: ["moisturizer", "sunscreen"], - "char": '\ud83e\uddf4', - fitzpatrick_scale: false, - category: "objects" - }, - key: { - keywords: ["lock", "door", "password"], - "char": '\ud83d\udd11', - fitzpatrick_scale: false, - category: "objects" - }, - old_key: { - keywords: ["lock", "door", "password"], - "char": '\ud83d\udddd', - fitzpatrick_scale: false, - category: "objects" - }, - couch_and_lamp: { - keywords: ["read", "chill"], - "char": '\ud83d\udecb', - fitzpatrick_scale: false, - category: "objects" - }, - sleeping_bed: { - keywords: ["bed", "rest"], - "char": '\ud83d\udecc', - fitzpatrick_scale: true, - category: "objects" - }, - bed: { - keywords: ["sleep", "rest"], - "char": '\ud83d\udecf', - fitzpatrick_scale: false, - category: "objects" - }, - door: { - keywords: ["house", "entry", "exit"], - "char": '\ud83d\udeaa', - fitzpatrick_scale: false, - category: "objects" - }, - bellhop_bell: { - keywords: ["service"], - "char": '\ud83d\udece', - fitzpatrick_scale: false, - category: "objects" - }, - teddy_bear: { - keywords: ["plush", "stuffed"], - "char": '\ud83e\uddf8', - fitzpatrick_scale: false, - category: "objects" - }, - framed_picture: { - keywords: ["photography"], - "char": '\ud83d\uddbc', - fitzpatrick_scale: false, - category: "objects" - }, - world_map: { - keywords: ["location", "direction"], - "char": '\ud83d\uddfa', - fitzpatrick_scale: false, - category: "objects" - }, - parasol_on_ground: { - keywords: ["weather", "summer"], - "char": '\u26f1', - fitzpatrick_scale: false, - category: "objects" - }, - moyai: { - keywords: ["rock", "easter island", "moai"], - "char": '\ud83d\uddff', - fitzpatrick_scale: false, - category: "objects" - }, - shopping: { - keywords: ["mall", "buy", "purchase"], - "char": '\ud83d\udecd', - fitzpatrick_scale: false, - category: "objects" - }, - shopping_cart: { - keywords: ["trolley"], - "char": '\ud83d\uded2', - fitzpatrick_scale: false, - category: "objects" - }, - balloon: { - keywords: ["party", "celebration", "birthday", "circus"], - "char": '\ud83c\udf88', - fitzpatrick_scale: false, - category: "objects" - }, - flags: { - keywords: ["fish", "japanese", "koinobori", "carp", "banner"], - "char": '\ud83c\udf8f', - fitzpatrick_scale: false, - category: "objects" - }, - ribbon: { - keywords: ["decoration", "pink", "girl", "bowtie"], - "char": '\ud83c\udf80', - fitzpatrick_scale: false, - category: "objects" - }, - gift: { - keywords: ["present", "birthday", "christmas", "xmas"], - "char": '\ud83c\udf81', - fitzpatrick_scale: false, - category: "objects" - }, - confetti_ball: { - keywords: ["festival", "party", "birthday", "circus"], - "char": '\ud83c\udf8a', - fitzpatrick_scale: false, - category: "objects" - }, - tada: { - keywords: ["party", "congratulations", "birthday", "magic", "circus", "celebration"], - "char": '\ud83c\udf89', - fitzpatrick_scale: false, - category: "objects" - }, - dolls: { - keywords: ["japanese", "toy", "kimono"], - "char": '\ud83c\udf8e', - fitzpatrick_scale: false, - category: "objects" - }, - wind_chime: { - keywords: ["nature", "ding", "spring", "bell"], - "char": '\ud83c\udf90', - fitzpatrick_scale: false, - category: "objects" - }, - crossed_flags: { - keywords: ["japanese", "nation", "country", "border"], - "char": '\ud83c\udf8c', - fitzpatrick_scale: false, - category: "objects" - }, - izakaya_lantern: { - keywords: ["light", "paper", "halloween", "spooky"], - "char": '\ud83c\udfee', - fitzpatrick_scale: false, - category: "objects" - }, - red_envelope: { - keywords: ["gift"], - "char": '\ud83e\udde7', - fitzpatrick_scale: false, - category: "objects" - }, - email: { - keywords: ["letter", "postal", "inbox", "communication"], - "char": '\u2709\ufe0f', - fitzpatrick_scale: false, - category: "objects" - }, - envelope_with_arrow: { - keywords: ["email", "communication"], - "char": '\ud83d\udce9', - fitzpatrick_scale: false, - category: "objects" - }, - incoming_envelope: { - keywords: ["email", "inbox"], - "char": '\ud83d\udce8', - fitzpatrick_scale: false, - category: "objects" - }, - "e-mail": { - keywords: ["communication", "inbox"], - "char": '\ud83d\udce7', - fitzpatrick_scale: false, - category: "objects" - }, - love_letter: { - keywords: ["email", "like", "affection", "envelope", "valentines"], - "char": '\ud83d\udc8c', - fitzpatrick_scale: false, - category: "objects" - }, - postbox: { - keywords: ["email", "letter", "envelope"], - "char": '\ud83d\udcee', - fitzpatrick_scale: false, - category: "objects" - }, - mailbox_closed: { - keywords: ["email", "communication", "inbox"], - "char": '\ud83d\udcea', - fitzpatrick_scale: false, - category: "objects" - }, - mailbox: { - keywords: ["email", "inbox", "communication"], - "char": '\ud83d\udceb', - fitzpatrick_scale: false, - category: "objects" - }, - mailbox_with_mail: { - keywords: ["email", "inbox", "communication"], - "char": '\ud83d\udcec', - fitzpatrick_scale: false, - category: "objects" - }, - mailbox_with_no_mail: { - keywords: ["email", "inbox"], - "char": '\ud83d\udced', - fitzpatrick_scale: false, - category: "objects" - }, - "package": { - keywords: ["mail", "gift", "cardboard", "box", "moving"], - "char": '\ud83d\udce6', - fitzpatrick_scale: false, - category: "objects" - }, - postal_horn: { - keywords: ["instrument", "music"], - "char": '\ud83d\udcef', - fitzpatrick_scale: false, - category: "objects" - }, - inbox_tray: { - keywords: ["email", "documents"], - "char": '\ud83d\udce5', - fitzpatrick_scale: false, - category: "objects" - }, - outbox_tray: { - keywords: ["inbox", "email"], - "char": '\ud83d\udce4', - fitzpatrick_scale: false, - category: "objects" - }, - scroll: { - keywords: ["documents", "ancient", "history", "paper"], - "char": '\ud83d\udcdc', - fitzpatrick_scale: false, - category: "objects" - }, - page_with_curl: { - keywords: ["documents", "office", "paper"], - "char": '\ud83d\udcc3', - fitzpatrick_scale: false, - category: "objects" - }, - bookmark_tabs: { - keywords: ["favorite", "save", "order", "tidy"], - "char": '\ud83d\udcd1', - fitzpatrick_scale: false, - category: "objects" - }, - receipt: { - keywords: ["accounting", "expenses"], - "char": '\ud83e\uddfe', - fitzpatrick_scale: false, - category: "objects" - }, - bar_chart: { - keywords: ["graph", "presentation", "stats"], - "char": '\ud83d\udcca', - fitzpatrick_scale: false, - category: "objects" - }, - chart_with_upwards_trend: { - keywords: ["graph", "presentation", "stats", "recovery", "business", "economics", "money", "sales", "good", "success"], - "char": '\ud83d\udcc8', - fitzpatrick_scale: false, - category: "objects" - }, - chart_with_downwards_trend: { - keywords: ["graph", "presentation", "stats", "recession", "business", "economics", "money", "sales", "bad", "failure"], - "char": '\ud83d\udcc9', - fitzpatrick_scale: false, - category: "objects" - }, - page_facing_up: { - keywords: ["documents", "office", "paper", "information"], - "char": '\ud83d\udcc4', - fitzpatrick_scale: false, - category: "objects" - }, - date: { - keywords: ["calendar", "schedule"], - "char": '\ud83d\udcc5', - fitzpatrick_scale: false, - category: "objects" - }, - calendar: { - keywords: ["schedule", "date", "planning"], - "char": '\ud83d\udcc6', - fitzpatrick_scale: false, - category: "objects" - }, - spiral_calendar: { - keywords: ["date", "schedule", "planning"], - "char": '\ud83d\uddd3', - fitzpatrick_scale: false, - category: "objects" - }, - card_index: { - keywords: ["business", "stationery"], - "char": '\ud83d\udcc7', - fitzpatrick_scale: false, - category: "objects" - }, - card_file_box: { - keywords: ["business", "stationery"], - "char": '\ud83d\uddc3', - fitzpatrick_scale: false, - category: "objects" - }, - ballot_box: { - keywords: ["election", "vote"], - "char": '\ud83d\uddf3', - fitzpatrick_scale: false, - category: "objects" - }, - file_cabinet: { - keywords: ["filing", "organizing"], - "char": '\ud83d\uddc4', - fitzpatrick_scale: false, - category: "objects" - }, - clipboard: { - keywords: ["stationery", "documents"], - "char": '\ud83d\udccb', - fitzpatrick_scale: false, - category: "objects" - }, - spiral_notepad: { - keywords: ["memo", "stationery"], - "char": '\ud83d\uddd2', - fitzpatrick_scale: false, - category: "objects" - }, - file_folder: { - keywords: ["documents", "business", "office"], - "char": '\ud83d\udcc1', - fitzpatrick_scale: false, - category: "objects" - }, - open_file_folder: { - keywords: ["documents", "load"], - "char": '\ud83d\udcc2', - fitzpatrick_scale: false, - category: "objects" - }, - card_index_dividers: { - keywords: ["organizing", "business", "stationery"], - "char": '\ud83d\uddc2', - fitzpatrick_scale: false, - category: "objects" - }, - newspaper_roll: { - keywords: ["press", "headline"], - "char": '\ud83d\uddde', - fitzpatrick_scale: false, - category: "objects" - }, - newspaper: { - keywords: ["press", "headline"], - "char": '\ud83d\udcf0', - fitzpatrick_scale: false, - category: "objects" - }, - notebook: { - keywords: ["stationery", "record", "notes", "paper", "study"], - "char": '\ud83d\udcd3', - fitzpatrick_scale: false, - category: "objects" - }, - closed_book: { - keywords: ["read", "library", "knowledge", "textbook", "learn"], - "char": '\ud83d\udcd5', - fitzpatrick_scale: false, - category: "objects" - }, - green_book: { - keywords: ["read", "library", "knowledge", "study"], - "char": '\ud83d\udcd7', - fitzpatrick_scale: false, - category: "objects" - }, - blue_book: { - keywords: ["read", "library", "knowledge", "learn", "study"], - "char": '\ud83d\udcd8', - fitzpatrick_scale: false, - category: "objects" - }, - orange_book: { - keywords: ["read", "library", "knowledge", "textbook", "study"], - "char": '\ud83d\udcd9', - fitzpatrick_scale: false, - category: "objects" - }, - notebook_with_decorative_cover: { - keywords: ["classroom", "notes", "record", "paper", "study"], - "char": '\ud83d\udcd4', - fitzpatrick_scale: false, - category: "objects" - }, - ledger: { - keywords: ["notes", "paper"], - "char": '\ud83d\udcd2', - fitzpatrick_scale: false, - category: "objects" - }, - books: { - keywords: ["literature", "library", "study"], - "char": '\ud83d\udcda', - fitzpatrick_scale: false, - category: "objects" - }, - open_book: { - keywords: ["book", "read", "library", "knowledge", "literature", "learn", "study"], - "char": '\ud83d\udcd6', - fitzpatrick_scale: false, - category: "objects" - }, - safety_pin: { - keywords: ["diaper"], - "char": '\ud83e\uddf7', - fitzpatrick_scale: false, - category: "objects" - }, - link: { - keywords: ["rings", "url"], - "char": '\ud83d\udd17', - fitzpatrick_scale: false, - category: "objects" - }, - paperclip: { - keywords: ["documents", "stationery"], - "char": '\ud83d\udcce', - fitzpatrick_scale: false, - category: "objects" - }, - paperclips: { - keywords: ["documents", "stationery"], - "char": '\ud83d\udd87', - fitzpatrick_scale: false, - category: "objects" - }, - scissors: { - keywords: ["stationery", "cut"], - "char": '\u2702\ufe0f', - fitzpatrick_scale: false, - category: "objects" - }, - triangular_ruler: { - keywords: ["stationery", "math", "architect", "sketch"], - "char": '\ud83d\udcd0', - fitzpatrick_scale: false, - category: "objects" - }, - straight_ruler: { - keywords: ["stationery", "calculate", "length", "math", "school", "drawing", "architect", "sketch"], - "char": '\ud83d\udccf', - fitzpatrick_scale: false, - category: "objects" - }, - abacus: { - keywords: ["calculation"], - "char": '\ud83e\uddee', - fitzpatrick_scale: false, - category: "objects" - }, - pushpin: { - keywords: ["stationery", "mark", "here"], - "char": '\ud83d\udccc', - fitzpatrick_scale: false, - category: "objects" - }, - round_pushpin: { - keywords: ["stationery", "location", "map", "here"], - "char": '\ud83d\udccd', - fitzpatrick_scale: false, - category: "objects" - }, - triangular_flag_on_post: { - keywords: ["mark", "milestone", "place"], - "char": '\ud83d\udea9', - fitzpatrick_scale: false, - category: "objects" - }, - white_flag: { - keywords: ["losing", "loser", "lost", "surrender", "give up", "fail"], - "char": '\ud83c\udff3', - fitzpatrick_scale: false, - category: "objects" - }, - black_flag: { - keywords: ["pirate"], - "char": '\ud83c\udff4', - fitzpatrick_scale: false, - category: "objects" - }, - rainbow_flag: { - keywords: ["flag", "rainbow", "pride", "gay", "lgbt", "glbt", "queer", "homosexual", "lesbian", "bisexual", "transgender"], - "char": '\ud83c\udff3\ufe0f\u200d\ud83c\udf08', - fitzpatrick_scale: false, - category: "objects" - }, - closed_lock_with_key: { - keywords: ["security", "privacy"], - "char": '\ud83d\udd10', - fitzpatrick_scale: false, - category: "objects" - }, - lock: { - keywords: ["security", "password", "padlock"], - "char": '\ud83d\udd12', - fitzpatrick_scale: false, - category: "objects" - }, - unlock: { - keywords: ["privacy", "security"], - "char": '\ud83d\udd13', - fitzpatrick_scale: false, - category: "objects" - }, - lock_with_ink_pen: { - keywords: ["security", "secret"], - "char": '\ud83d\udd0f', - fitzpatrick_scale: false, - category: "objects" - }, - pen: { - keywords: ["stationery", "writing", "write"], - "char": '\ud83d\udd8a', - fitzpatrick_scale: false, - category: "objects" - }, - fountain_pen: { - keywords: ["stationery", "writing", "write"], - "char": '\ud83d\udd8b', - fitzpatrick_scale: false, - category: "objects" - }, - black_nib: { - keywords: ["pen", "stationery", "writing", "write"], - "char": '\u2712\ufe0f', - fitzpatrick_scale: false, - category: "objects" - }, - memo: { - keywords: ["write", "documents", "stationery", "pencil", "paper", "writing", "legal", "exam", "quiz", "test", "study", "compose"], - "char": '\ud83d\udcdd', - fitzpatrick_scale: false, - category: "objects" - }, - pencil2: { - keywords: ["stationery", "write", "paper", "writing", "school", "study"], - "char": '\u270f\ufe0f', - fitzpatrick_scale: false, - category: "objects" - }, - crayon: { - keywords: ["drawing", "creativity"], - "char": '\ud83d\udd8d', - fitzpatrick_scale: false, - category: "objects" - }, - paintbrush: { - keywords: ["drawing", "creativity", "art"], - "char": '\ud83d\udd8c', - fitzpatrick_scale: false, - category: "objects" - }, - mag: { - keywords: ["search", "zoom", "find", "detective"], - "char": '\ud83d\udd0d', - fitzpatrick_scale: false, - category: "objects" - }, - mag_right: { - keywords: ["search", "zoom", "find", "detective"], - "char": '\ud83d\udd0e', - fitzpatrick_scale: false, - category: "objects" - }, - heart: { - keywords: ["love", "like", "valentines"], - "char": '\u2764\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - orange_heart: { - keywords: ["love", "like", "affection", "valentines"], - "char": '\ud83e\udde1', - fitzpatrick_scale: false, - category: "symbols" - }, - yellow_heart: { - keywords: ["love", "like", "affection", "valentines"], - "char": '\ud83d\udc9b', - fitzpatrick_scale: false, - category: "symbols" - }, - green_heart: { - keywords: ["love", "like", "affection", "valentines"], - "char": '\ud83d\udc9a', - fitzpatrick_scale: false, - category: "symbols" - }, - blue_heart: { - keywords: ["love", "like", "affection", "valentines"], - "char": '\ud83d\udc99', - fitzpatrick_scale: false, - category: "symbols" - }, - purple_heart: { - keywords: ["love", "like", "affection", "valentines"], - "char": '\ud83d\udc9c', - fitzpatrick_scale: false, - category: "symbols" - }, - black_heart: { - keywords: ["evil"], - "char": '\ud83d\udda4', - fitzpatrick_scale: false, - category: "symbols" - }, - broken_heart: { - keywords: ["sad", "sorry", "break", "heart", "heartbreak"], - "char": '\ud83d\udc94', - fitzpatrick_scale: false, - category: "symbols" - }, - heavy_heart_exclamation: { - keywords: ["decoration", "love"], - "char": '\u2763', - fitzpatrick_scale: false, - category: "symbols" - }, - two_hearts: { - keywords: ["love", "like", "affection", "valentines", "heart"], - "char": '\ud83d\udc95', - fitzpatrick_scale: false, - category: "symbols" - }, - revolving_hearts: { - keywords: ["love", "like", "affection", "valentines"], - "char": '\ud83d\udc9e', - fitzpatrick_scale: false, - category: "symbols" - }, - heartbeat: { - keywords: ["love", "like", "affection", "valentines", "pink", "heart"], - "char": '\ud83d\udc93', - fitzpatrick_scale: false, - category: "symbols" - }, - heartpulse: { - keywords: ["like", "love", "affection", "valentines", "pink"], - "char": '\ud83d\udc97', - fitzpatrick_scale: false, - category: "symbols" - }, - sparkling_heart: { - keywords: ["love", "like", "affection", "valentines"], - "char": '\ud83d\udc96', - fitzpatrick_scale: false, - category: "symbols" - }, - cupid: { - keywords: ["love", "like", "heart", "affection", "valentines"], - "char": '\ud83d\udc98', - fitzpatrick_scale: false, - category: "symbols" - }, - gift_heart: { - keywords: ["love", "valentines"], - "char": '\ud83d\udc9d', - fitzpatrick_scale: false, - category: "symbols" - }, - heart_decoration: { - keywords: ["purple-square", "love", "like"], - "char": '\ud83d\udc9f', - fitzpatrick_scale: false, - category: "symbols" - }, - peace_symbol: { - keywords: ["hippie"], - "char": '\u262e', - fitzpatrick_scale: false, - category: "symbols" - }, - latin_cross: { - keywords: ["christianity"], - "char": '\u271d', - fitzpatrick_scale: false, - category: "symbols" - }, - star_and_crescent: { - keywords: ["islam"], - "char": '\u262a', - fitzpatrick_scale: false, - category: "symbols" - }, - om: { - keywords: ["hinduism", "buddhism", "sikhism", "jainism"], - "char": '\ud83d\udd49', - fitzpatrick_scale: false, - category: "symbols" - }, - wheel_of_dharma: { - keywords: ["hinduism", "buddhism", "sikhism", "jainism"], - "char": '\u2638', - fitzpatrick_scale: false, - category: "symbols" - }, - star_of_david: { - keywords: ["judaism"], - "char": '\u2721', - fitzpatrick_scale: false, - category: "symbols" - }, - six_pointed_star: { - keywords: ["purple-square", "religion", "jewish", "hexagram"], - "char": '\ud83d\udd2f', - fitzpatrick_scale: false, - category: "symbols" - }, - menorah: { - keywords: ["hanukkah", "candles", "jewish"], - "char": '\ud83d\udd4e', - fitzpatrick_scale: false, - category: "symbols" - }, - yin_yang: { - keywords: ["balance"], - "char": '\u262f', - fitzpatrick_scale: false, - category: "symbols" - }, - orthodox_cross: { - keywords: ["suppedaneum", "religion"], - "char": '\u2626', - fitzpatrick_scale: false, - category: "symbols" - }, - place_of_worship: { - keywords: ["religion", "church", "temple", "prayer"], - "char": '\ud83d\uded0', - fitzpatrick_scale: false, - category: "symbols" - }, - ophiuchus: { - keywords: ["sign", "purple-square", "constellation", "astrology"], - "char": '\u26ce', - fitzpatrick_scale: false, - category: "symbols" - }, - aries: { - keywords: ["sign", "purple-square", "zodiac", "astrology"], - "char": '\u2648', - fitzpatrick_scale: false, - category: "symbols" - }, - taurus: { - keywords: ["purple-square", "sign", "zodiac", "astrology"], - "char": '\u2649', - fitzpatrick_scale: false, - category: "symbols" - }, - gemini: { - keywords: ["sign", "zodiac", "purple-square", "astrology"], - "char": '\u264a', - fitzpatrick_scale: false, - category: "symbols" - }, - cancer: { - keywords: ["sign", "zodiac", "purple-square", "astrology"], - "char": '\u264b', - fitzpatrick_scale: false, - category: "symbols" - }, - leo: { - keywords: ["sign", "purple-square", "zodiac", "astrology"], - "char": '\u264c', - fitzpatrick_scale: false, - category: "symbols" - }, - virgo: { - keywords: ["sign", "zodiac", "purple-square", "astrology"], - "char": '\u264d', - fitzpatrick_scale: false, - category: "symbols" - }, - libra: { - keywords: ["sign", "purple-square", "zodiac", "astrology"], - "char": '\u264e', - fitzpatrick_scale: false, - category: "symbols" - }, - scorpius: { - keywords: ["sign", "zodiac", "purple-square", "astrology", "scorpio"], - "char": '\u264f', - fitzpatrick_scale: false, - category: "symbols" - }, - sagittarius: { - keywords: ["sign", "zodiac", "purple-square", "astrology"], - "char": '\u2650', - fitzpatrick_scale: false, - category: "symbols" - }, - capricorn: { - keywords: ["sign", "zodiac", "purple-square", "astrology"], - "char": '\u2651', - fitzpatrick_scale: false, - category: "symbols" - }, - aquarius: { - keywords: ["sign", "purple-square", "zodiac", "astrology"], - "char": '\u2652', - fitzpatrick_scale: false, - category: "symbols" - }, - pisces: { - keywords: ["purple-square", "sign", "zodiac", "astrology"], - "char": '\u2653', - fitzpatrick_scale: false, - category: "symbols" - }, - id: { - keywords: ["purple-square", "words"], - "char": '\ud83c\udd94', - fitzpatrick_scale: false, - category: "symbols" - }, - atom_symbol: { - keywords: ["science", "physics", "chemistry"], - "char": '\u269b', - fitzpatrick_scale: false, - category: "symbols" - }, - u7a7a: { - keywords: ["kanji", "japanese", "chinese", "empty", "sky", "blue-square"], - "char": '\ud83c\ude33', - fitzpatrick_scale: false, - category: "symbols" - }, - u5272: { - keywords: ["cut", "divide", "chinese", "kanji", "pink-square"], - "char": '\ud83c\ude39', - fitzpatrick_scale: false, - category: "symbols" - }, - radioactive: { - keywords: ["nuclear", "danger"], - "char": '\u2622', - fitzpatrick_scale: false, - category: "symbols" - }, - biohazard: { - keywords: ["danger"], - "char": '\u2623', - fitzpatrick_scale: false, - category: "symbols" - }, - mobile_phone_off: { - keywords: ["mute", "orange-square", "silence", "quiet"], - "char": '\ud83d\udcf4', - fitzpatrick_scale: false, - category: "symbols" - }, - vibration_mode: { - keywords: ["orange-square", "phone"], - "char": '\ud83d\udcf3', - fitzpatrick_scale: false, - category: "symbols" - }, - u6709: { - keywords: ["orange-square", "chinese", "have", "kanji"], - "char": '\ud83c\ude36', - fitzpatrick_scale: false, - category: "symbols" - }, - u7121: { - keywords: ["nothing", "chinese", "kanji", "japanese", "orange-square"], - "char": '\ud83c\ude1a', - fitzpatrick_scale: false, - category: "symbols" - }, - u7533: { - keywords: ["chinese", "japanese", "kanji", "orange-square"], - "char": '\ud83c\ude38', - fitzpatrick_scale: false, - category: "symbols" - }, - u55b6: { - keywords: ["japanese", "opening hours", "orange-square"], - "char": '\ud83c\ude3a', - fitzpatrick_scale: false, - category: "symbols" - }, - u6708: { - keywords: ["chinese", "month", "moon", "japanese", "orange-square", "kanji"], - "char": '\ud83c\ude37\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - eight_pointed_black_star: { - keywords: ["orange-square", "shape", "polygon"], - "char": '\u2734\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - vs: { - keywords: ["words", "orange-square"], - "char": '\ud83c\udd9a', - fitzpatrick_scale: false, - category: "symbols" - }, - accept: { - keywords: ["ok", "good", "chinese", "kanji", "agree", "yes", "orange-circle"], - "char": '\ud83c\ude51', - fitzpatrick_scale: false, - category: "symbols" - }, - white_flower: { - keywords: ["japanese", "spring"], - "char": '\ud83d\udcae', - fitzpatrick_scale: false, - category: "symbols" - }, - ideograph_advantage: { - keywords: ["chinese", "kanji", "obtain", "get", "circle"], - "char": '\ud83c\ude50', - fitzpatrick_scale: false, - category: "symbols" - }, - secret: { - keywords: ["privacy", "chinese", "sshh", "kanji", "red-circle"], - "char": '\u3299\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - congratulations: { - keywords: ["chinese", "kanji", "japanese", "red-circle"], - "char": '\u3297\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - u5408: { - keywords: ["japanese", "chinese", "join", "kanji", "red-square"], - "char": '\ud83c\ude34', - fitzpatrick_scale: false, - category: "symbols" - }, - u6e80: { - keywords: ["full", "chinese", "japanese", "red-square", "kanji"], - "char": '\ud83c\ude35', - fitzpatrick_scale: false, - category: "symbols" - }, - u7981: { - keywords: ["kanji", "japanese", "chinese", "forbidden", "limit", "restricted", "red-square"], - "char": '\ud83c\ude32', - fitzpatrick_scale: false, - category: "symbols" - }, - a: { - keywords: ["red-square", "alphabet", "letter"], - "char": '\ud83c\udd70\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - b: { - keywords: ["red-square", "alphabet", "letter"], - "char": '\ud83c\udd71\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - ab: { - keywords: ["red-square", "alphabet"], - "char": '\ud83c\udd8e', - fitzpatrick_scale: false, - category: "symbols" - }, - cl: { - keywords: ["alphabet", "words", "red-square"], - "char": '\ud83c\udd91', - fitzpatrick_scale: false, - category: "symbols" - }, - o2: { - keywords: ["alphabet", "red-square", "letter"], - "char": '\ud83c\udd7e\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - sos: { - keywords: ["help", "red-square", "words", "emergency", "911"], - "char": '\ud83c\udd98', - fitzpatrick_scale: false, - category: "symbols" - }, - no_entry: { - keywords: ["limit", "security", "privacy", "bad", "denied", "stop", "circle"], - "char": '\u26d4', - fitzpatrick_scale: false, - category: "symbols" - }, - name_badge: { - keywords: ["fire", "forbid"], - "char": '\ud83d\udcdb', - fitzpatrick_scale: false, - category: "symbols" - }, - no_entry_sign: { - keywords: ["forbid", "stop", "limit", "denied", "disallow", "circle"], - "char": '\ud83d\udeab', - fitzpatrick_scale: false, - category: "symbols" - }, - x: { - keywords: ["no", "delete", "remove", "cancel", "red"], - "char": '\u274c', - fitzpatrick_scale: false, - category: "symbols" - }, - o: { - keywords: ["circle", "round"], - "char": '\u2b55', - fitzpatrick_scale: false, - category: "symbols" - }, - stop_sign: { - keywords: ["stop"], - "char": '\ud83d\uded1', - fitzpatrick_scale: false, - category: "symbols" - }, - anger: { - keywords: ["angry", "mad"], - "char": '\ud83d\udca2', - fitzpatrick_scale: false, - category: "symbols" - }, - hotsprings: { - keywords: ["bath", "warm", "relax"], - "char": '\u2668\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - no_pedestrians: { - keywords: ["rules", "crossing", "walking", "circle"], - "char": '\ud83d\udeb7', - fitzpatrick_scale: false, - category: "symbols" - }, - do_not_litter: { - keywords: ["trash", "bin", "garbage", "circle"], - "char": '\ud83d\udeaf', - fitzpatrick_scale: false, - category: "symbols" - }, - no_bicycles: { - keywords: ["cyclist", "prohibited", "circle"], - "char": '\ud83d\udeb3', - fitzpatrick_scale: false, - category: "symbols" - }, - "non-potable_water": { - keywords: ["drink", "faucet", "tap", "circle"], - "char": '\ud83d\udeb1', - fitzpatrick_scale: false, - category: "symbols" - }, - underage: { - keywords: ["18", "drink", "pub", "night", "minor", "circle"], - "char": '\ud83d\udd1e', - fitzpatrick_scale: false, - category: "symbols" - }, - no_mobile_phones: { - keywords: ["iphone", "mute", "circle"], - "char": '\ud83d\udcf5', - fitzpatrick_scale: false, - category: "symbols" - }, - exclamation: { - keywords: ["heavy_exclamation_mark", "danger", "surprise", "punctuation", "wow", "warning"], - "char": '\u2757', - fitzpatrick_scale: false, - category: "symbols" - }, - grey_exclamation: { - keywords: ["surprise", "punctuation", "gray", "wow", "warning"], - "char": '\u2755', - fitzpatrick_scale: false, - category: "symbols" - }, - question: { - keywords: ["doubt", "confused"], - "char": '\u2753', - fitzpatrick_scale: false, - category: "symbols" - }, - grey_question: { - keywords: ["doubts", "gray", "huh", "confused"], - "char": '\u2754', - fitzpatrick_scale: false, - category: "symbols" - }, - bangbang: { - keywords: ["exclamation", "surprise"], - "char": '\u203c\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - interrobang: { - keywords: ["wat", "punctuation", "surprise"], - "char": '\u2049\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - low_brightness: { - keywords: ["sun", "afternoon", "warm", "summer"], - "char": '\ud83d\udd05', - fitzpatrick_scale: false, - category: "symbols" - }, - high_brightness: { - keywords: ["sun", "light"], - "char": '\ud83d\udd06', - fitzpatrick_scale: false, - category: "symbols" - }, - trident: { - keywords: ["weapon", "spear"], - "char": '\ud83d\udd31', - fitzpatrick_scale: false, - category: "symbols" - }, - fleur_de_lis: { - keywords: ["decorative", "scout"], - "char": '\u269c', - fitzpatrick_scale: false, - category: "symbols" - }, - part_alternation_mark: { - keywords: ["graph", "presentation", "stats", "business", "economics", "bad"], - "char": '\u303d\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - warning: { - keywords: ["exclamation", "wip", "alert", "error", "problem", "issue"], - "char": '\u26a0\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - children_crossing: { - keywords: ["school", "warning", "danger", "sign", "driving", "yellow-diamond"], - "char": '\ud83d\udeb8', - fitzpatrick_scale: false, - category: "symbols" - }, - beginner: { - keywords: ["badge", "shield"], - "char": '\ud83d\udd30', - fitzpatrick_scale: false, - category: "symbols" - }, - recycle: { - keywords: ["arrow", "environment", "garbage", "trash"], - "char": '\u267b\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - u6307: { - keywords: ["chinese", "point", "green-square", "kanji"], - "char": '\ud83c\ude2f', - fitzpatrick_scale: false, - category: "symbols" - }, - chart: { - keywords: ["green-square", "graph", "presentation", "stats"], - "char": '\ud83d\udcb9', - fitzpatrick_scale: false, - category: "symbols" - }, - sparkle: { - keywords: ["stars", "green-square", "awesome", "good", "fireworks"], - "char": '\u2747\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - eight_spoked_asterisk: { - keywords: ["star", "sparkle", "green-square"], - "char": '\u2733\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - negative_squared_cross_mark: { - keywords: ["x", "green-square", "no", "deny"], - "char": '\u274e', - fitzpatrick_scale: false, - category: "symbols" - }, - white_check_mark: { - keywords: ["green-square", "ok", "agree", "vote", "election", "answer", "tick"], - "char": '\u2705', - fitzpatrick_scale: false, - category: "symbols" - }, - diamond_shape_with_a_dot_inside: { - keywords: ["jewel", "blue", "gem", "crystal", "fancy"], - "char": '\ud83d\udca0', - fitzpatrick_scale: false, - category: "symbols" - }, - cyclone: { - keywords: ["weather", "swirl", "blue", "cloud", "vortex", "spiral", "whirlpool", "spin", "tornado", "hurricane", "typhoon"], - "char": '\ud83c\udf00', - fitzpatrick_scale: false, - category: "symbols" - }, - loop: { - keywords: ["tape", "cassette"], - "char": '\u27bf', - fitzpatrick_scale: false, - category: "symbols" - }, - globe_with_meridians: { - keywords: ["earth", "international", "world", "internet", "interweb", "i18n"], - "char": '\ud83c\udf10', - fitzpatrick_scale: false, - category: "symbols" - }, - m: { - keywords: ["alphabet", "blue-circle", "letter"], - "char": '\u24c2\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - atm: { - keywords: ["money", "sales", "cash", "blue-square", "payment", "bank"], - "char": '\ud83c\udfe7', - fitzpatrick_scale: false, - category: "symbols" - }, - sa: { - keywords: ["japanese", "blue-square", "katakana"], - "char": '\ud83c\ude02\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - passport_control: { - keywords: ["custom", "blue-square"], - "char": '\ud83d\udec2', - fitzpatrick_scale: false, - category: "symbols" - }, - customs: { - keywords: ["passport", "border", "blue-square"], - "char": '\ud83d\udec3', - fitzpatrick_scale: false, - category: "symbols" - }, - baggage_claim: { - keywords: ["blue-square", "airport", "transport"], - "char": '\ud83d\udec4', - fitzpatrick_scale: false, - category: "symbols" - }, - left_luggage: { - keywords: ["blue-square", "travel"], - "char": '\ud83d\udec5', - fitzpatrick_scale: false, - category: "symbols" - }, - wheelchair: { - keywords: ["blue-square", "disabled", "a11y", "accessibility"], - "char": '\u267f', - fitzpatrick_scale: false, - category: "symbols" - }, - no_smoking: { - keywords: ["cigarette", "blue-square", "smell", "smoke"], - "char": '\ud83d\udead', - fitzpatrick_scale: false, - category: "symbols" - }, - wc: { - keywords: ["toilet", "restroom", "blue-square"], - "char": '\ud83d\udebe', - fitzpatrick_scale: false, - category: "symbols" - }, - parking: { - keywords: ["cars", "blue-square", "alphabet", "letter"], - "char": '\ud83c\udd7f\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - potable_water: { - keywords: ["blue-square", "liquid", "restroom", "cleaning", "faucet"], - "char": '\ud83d\udeb0', - fitzpatrick_scale: false, - category: "symbols" - }, - mens: { - keywords: ["toilet", "restroom", "wc", "blue-square", "gender", "male"], - "char": '\ud83d\udeb9', - fitzpatrick_scale: false, - category: "symbols" - }, - womens: { - keywords: ["purple-square", "woman", "female", "toilet", "loo", "restroom", "gender"], - "char": '\ud83d\udeba', - fitzpatrick_scale: false, - category: "symbols" - }, - baby_symbol: { - keywords: ["orange-square", "child"], - "char": '\ud83d\udebc', - fitzpatrick_scale: false, - category: "symbols" - }, - restroom: { - keywords: ["blue-square", "toilet", "refresh", "wc", "gender"], - "char": '\ud83d\udebb', - fitzpatrick_scale: false, - category: "symbols" - }, - put_litter_in_its_place: { - keywords: ["blue-square", "sign", "human", "info"], - "char": '\ud83d\udeae', - fitzpatrick_scale: false, - category: "symbols" - }, - cinema: { - keywords: ["blue-square", "record", "film", "movie", "curtain", "stage", "theater"], - "char": '\ud83c\udfa6', - fitzpatrick_scale: false, - category: "symbols" - }, - signal_strength: { - keywords: ["blue-square", "reception", "phone", "internet", "connection", "wifi", "bluetooth", "bars"], - "char": '\ud83d\udcf6', - fitzpatrick_scale: false, - category: "symbols" - }, - koko: { - keywords: ["blue-square", "here", "katakana", "japanese", "destination"], - "char": '\ud83c\ude01', - fitzpatrick_scale: false, - category: "symbols" - }, - ng: { - keywords: ["blue-square", "words", "shape", "icon"], - "char": '\ud83c\udd96', - fitzpatrick_scale: false, - category: "symbols" - }, - ok: { - keywords: ["good", "agree", "yes", "blue-square"], - "char": '\ud83c\udd97', - fitzpatrick_scale: false, - category: "symbols" - }, - up: { - keywords: ["blue-square", "above", "high"], - "char": '\ud83c\udd99', - fitzpatrick_scale: false, - category: "symbols" - }, - cool: { - keywords: ["words", "blue-square"], - "char": '\ud83c\udd92', - fitzpatrick_scale: false, - category: "symbols" - }, - "new": { - keywords: ["blue-square", "words", "start"], - "char": '\ud83c\udd95', - fitzpatrick_scale: false, - category: "symbols" - }, - free: { - keywords: ["blue-square", "words"], - "char": '\ud83c\udd93', - fitzpatrick_scale: false, - category: "symbols" - }, - zero: { - keywords: ["0", "numbers", "blue-square", "null"], - "char": '0\ufe0f\u20e3', - fitzpatrick_scale: false, - category: "symbols" - }, - one: { - keywords: ["blue-square", "numbers", "1"], - "char": '1\ufe0f\u20e3', - fitzpatrick_scale: false, - category: "symbols" - }, - two: { - keywords: ["numbers", "2", "prime", "blue-square"], - "char": '2\ufe0f\u20e3', - fitzpatrick_scale: false, - category: "symbols" - }, - three: { - keywords: ["3", "numbers", "prime", "blue-square"], - "char": '3\ufe0f\u20e3', - fitzpatrick_scale: false, - category: "symbols" - }, - four: { - keywords: ["4", "numbers", "blue-square"], - "char": '4\ufe0f\u20e3', - fitzpatrick_scale: false, - category: "symbols" - }, - five: { - keywords: ["5", "numbers", "blue-square", "prime"], - "char": '5\ufe0f\u20e3', - fitzpatrick_scale: false, - category: "symbols" - }, - six: { - keywords: ["6", "numbers", "blue-square"], - "char": '6\ufe0f\u20e3', - fitzpatrick_scale: false, - category: "symbols" - }, - seven: { - keywords: ["7", "numbers", "blue-square", "prime"], - "char": '7\ufe0f\u20e3', - fitzpatrick_scale: false, - category: "symbols" - }, - eight: { - keywords: ["8", "blue-square", "numbers"], - "char": '8\ufe0f\u20e3', - fitzpatrick_scale: false, - category: "symbols" - }, - nine: { - keywords: ["blue-square", "numbers", "9"], - "char": '9\ufe0f\u20e3', - fitzpatrick_scale: false, - category: "symbols" - }, - keycap_ten: { - keywords: ["numbers", "10", "blue-square"], - "char": '\ud83d\udd1f', - fitzpatrick_scale: false, - category: "symbols" - }, - asterisk: { - keywords: ["star", "keycap"], - "char": '*\u20e3', - fitzpatrick_scale: false, - category: "symbols" - }, - eject_button: { - keywords: ["blue-square"], - "char": '\u23cf\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_forward: { - keywords: ["blue-square", "right", "direction", "play"], - "char": '\u25b6\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - pause_button: { - keywords: ["pause", "blue-square"], - "char": '\u23f8', - fitzpatrick_scale: false, - category: "symbols" - }, - next_track_button: { - keywords: ["forward", "next", "blue-square"], - "char": '\u23ed', - fitzpatrick_scale: false, - category: "symbols" - }, - stop_button: { - keywords: ["blue-square"], - "char": '\u23f9', - fitzpatrick_scale: false, - category: "symbols" - }, - record_button: { - keywords: ["blue-square"], - "char": '\u23fa', - fitzpatrick_scale: false, - category: "symbols" - }, - play_or_pause_button: { - keywords: ["blue-square", "play", "pause"], - "char": '\u23ef', - fitzpatrick_scale: false, - category: "symbols" - }, - previous_track_button: { - keywords: ["backward"], - "char": '\u23ee', - fitzpatrick_scale: false, - category: "symbols" - }, - fast_forward: { - keywords: ["blue-square", "play", "speed", "continue"], - "char": '\u23e9', - fitzpatrick_scale: false, - category: "symbols" - }, - rewind: { - keywords: ["play", "blue-square"], - "char": '\u23ea', - fitzpatrick_scale: false, - category: "symbols" - }, - twisted_rightwards_arrows: { - keywords: ["blue-square", "shuffle", "music", "random"], - "char": '\ud83d\udd00', - fitzpatrick_scale: false, - category: "symbols" - }, - repeat: { - keywords: ["loop", "record"], - "char": '\ud83d\udd01', - fitzpatrick_scale: false, - category: "symbols" - }, - repeat_one: { - keywords: ["blue-square", "loop"], - "char": '\ud83d\udd02', - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_backward: { - keywords: ["blue-square", "left", "direction"], - "char": '\u25c0\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_up_small: { - keywords: ["blue-square", "triangle", "direction", "point", "forward", "top"], - "char": '\ud83d\udd3c', - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_down_small: { - keywords: ["blue-square", "direction", "bottom"], - "char": '\ud83d\udd3d', - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_double_up: { - keywords: ["blue-square", "direction", "top"], - "char": '\u23eb', - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_double_down: { - keywords: ["blue-square", "direction", "bottom"], - "char": '\u23ec', - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_right: { - keywords: ["blue-square", "next"], - "char": '\u27a1\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_left: { - keywords: ["blue-square", "previous", "back"], - "char": '\u2b05\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_up: { - keywords: ["blue-square", "continue", "top", "direction"], - "char": '\u2b06\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_down: { - keywords: ["blue-square", "direction", "bottom"], - "char": '\u2b07\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_upper_right: { - keywords: ["blue-square", "point", "direction", "diagonal", "northeast"], - "char": '\u2197\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_lower_right: { - keywords: ["blue-square", "direction", "diagonal", "southeast"], - "char": '\u2198\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_lower_left: { - keywords: ["blue-square", "direction", "diagonal", "southwest"], - "char": '\u2199\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_upper_left: { - keywords: ["blue-square", "point", "direction", "diagonal", "northwest"], - "char": '\u2196\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_up_down: { - keywords: ["blue-square", "direction", "way", "vertical"], - "char": '\u2195\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - left_right_arrow: { - keywords: ["shape", "direction", "horizontal", "sideways"], - "char": '\u2194\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - arrows_counterclockwise: { - keywords: ["blue-square", "sync", "cycle"], - "char": '\ud83d\udd04', - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_right_hook: { - keywords: ["blue-square", "return", "rotate", "direction"], - "char": '\u21aa\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - leftwards_arrow_with_hook: { - keywords: ["back", "return", "blue-square", "undo", "enter"], - "char": '\u21a9\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_heading_up: { - keywords: ["blue-square", "direction", "top"], - "char": '\u2934\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_heading_down: { - keywords: ["blue-square", "direction", "bottom"], - "char": '\u2935\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - hash: { - keywords: ["symbol", "blue-square", "twitter"], - "char": '#\ufe0f\u20e3', - fitzpatrick_scale: false, - category: "symbols" - }, - information_source: { - keywords: ["blue-square", "alphabet", "letter"], - "char": '\u2139\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - abc: { - keywords: ["blue-square", "alphabet"], - "char": '\ud83d\udd24', - fitzpatrick_scale: false, - category: "symbols" - }, - abcd: { - keywords: ["blue-square", "alphabet"], - "char": '\ud83d\udd21', - fitzpatrick_scale: false, - category: "symbols" - }, - capital_abcd: { - keywords: ["alphabet", "words", "blue-square"], - "char": '\ud83d\udd20', - fitzpatrick_scale: false, - category: "symbols" - }, - symbols: { - keywords: ["blue-square", "music", "note", "ampersand", "percent", "glyphs", "characters"], - "char": '\ud83d\udd23', - fitzpatrick_scale: false, - category: "symbols" - }, - musical_note: { - keywords: ["score", "tone", "sound"], - "char": '\ud83c\udfb5', - fitzpatrick_scale: false, - category: "symbols" - }, - notes: { - keywords: ["music", "score"], - "char": '\ud83c\udfb6', - fitzpatrick_scale: false, - category: "symbols" - }, - wavy_dash: { - keywords: ["draw", "line", "moustache", "mustache", "squiggle", "scribble"], - "char": '\u3030\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - curly_loop: { - keywords: ["scribble", "draw", "shape", "squiggle"], - "char": '\u27b0', - fitzpatrick_scale: false, - category: "symbols" - }, - heavy_check_mark: { - keywords: ["ok", "nike", "answer", "yes", "tick"], - "char": '\u2714\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - arrows_clockwise: { - keywords: ["sync", "cycle", "round", "repeat"], - "char": '\ud83d\udd03', - fitzpatrick_scale: false, - category: "symbols" - }, - heavy_plus_sign: { - keywords: ["math", "calculation", "addition", "more", "increase"], - "char": '\u2795', - fitzpatrick_scale: false, - category: "symbols" - }, - heavy_minus_sign: { - keywords: ["math", "calculation", "subtract", "less"], - "char": '\u2796', - fitzpatrick_scale: false, - category: "symbols" - }, - heavy_division_sign: { - keywords: ["divide", "math", "calculation"], - "char": '\u2797', - fitzpatrick_scale: false, - category: "symbols" - }, - heavy_multiplication_x: { - keywords: ["math", "calculation"], - "char": '\u2716\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - infinity: { - keywords: ["forever"], - "char": '\u267e', - fitzpatrick_scale: false, - category: "symbols" - }, - heavy_dollar_sign: { - keywords: ["money", "sales", "payment", "currency", "buck"], - "char": '\ud83d\udcb2', - fitzpatrick_scale: false, - category: "symbols" - }, - currency_exchange: { - keywords: ["money", "sales", "dollar", "travel"], - "char": '\ud83d\udcb1', - fitzpatrick_scale: false, - category: "symbols" - }, - copyright: { - keywords: ["ip", "license", "circle", "law", "legal"], - "char": '\xa9\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - registered: { - keywords: ["alphabet", "circle"], - "char": '\xae\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - tm: { - keywords: ["trademark", "brand", "law", "legal"], - "char": '\u2122\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - end: { - keywords: ["words", "arrow"], - "char": '\ud83d\udd1a', - fitzpatrick_scale: false, - category: "symbols" - }, - back: { - keywords: ["arrow", "words", "return"], - "char": '\ud83d\udd19', - fitzpatrick_scale: false, - category: "symbols" - }, - on: { - keywords: ["arrow", "words"], - "char": '\ud83d\udd1b', - fitzpatrick_scale: false, - category: "symbols" - }, - top: { - keywords: ["words", "blue-square"], - "char": '\ud83d\udd1d', - fitzpatrick_scale: false, - category: "symbols" - }, - soon: { - keywords: ["arrow", "words"], - "char": '\ud83d\udd1c', - fitzpatrick_scale: false, - category: "symbols" - }, - ballot_box_with_check: { - keywords: ["ok", "agree", "confirm", "black-square", "vote", "election", "yes", "tick"], - "char": '\u2611\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - radio_button: { - keywords: ["input", "old", "music", "circle"], - "char": '\ud83d\udd18', - fitzpatrick_scale: false, - category: "symbols" - }, - white_circle: { - keywords: ["shape", "round"], - "char": '\u26aa', - fitzpatrick_scale: false, - category: "symbols" - }, - black_circle: { - keywords: ["shape", "button", "round"], - "char": '\u26ab', - fitzpatrick_scale: false, - category: "symbols" - }, - red_circle: { - keywords: ["shape", "error", "danger"], - "char": '\ud83d\udd34', - fitzpatrick_scale: false, - category: "symbols" - }, - large_blue_circle: { - keywords: ["shape", "icon", "button"], - "char": '\ud83d\udd35', - fitzpatrick_scale: false, - category: "symbols" - }, - small_orange_diamond: { - keywords: ["shape", "jewel", "gem"], - "char": '\ud83d\udd38', - fitzpatrick_scale: false, - category: "symbols" - }, - small_blue_diamond: { - keywords: ["shape", "jewel", "gem"], - "char": '\ud83d\udd39', - fitzpatrick_scale: false, - category: "symbols" - }, - large_orange_diamond: { - keywords: ["shape", "jewel", "gem"], - "char": '\ud83d\udd36', - fitzpatrick_scale: false, - category: "symbols" - }, - large_blue_diamond: { - keywords: ["shape", "jewel", "gem"], - "char": '\ud83d\udd37', - fitzpatrick_scale: false, - category: "symbols" - }, - small_red_triangle: { - keywords: ["shape", "direction", "up", "top"], - "char": '\ud83d\udd3a', - fitzpatrick_scale: false, - category: "symbols" - }, - black_small_square: { - keywords: ["shape", "icon"], - "char": '\u25aa\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - white_small_square: { - keywords: ["shape", "icon"], - "char": '\u25ab\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - black_large_square: { - keywords: ["shape", "icon", "button"], - "char": '\u2b1b', - fitzpatrick_scale: false, - category: "symbols" - }, - white_large_square: { - keywords: ["shape", "icon", "stone", "button"], - "char": '\u2b1c', - fitzpatrick_scale: false, - category: "symbols" - }, - small_red_triangle_down: { - keywords: ["shape", "direction", "bottom"], - "char": '\ud83d\udd3b', - fitzpatrick_scale: false, - category: "symbols" - }, - black_medium_square: { - keywords: ["shape", "button", "icon"], - "char": '\u25fc\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - white_medium_square: { - keywords: ["shape", "stone", "icon"], - "char": '\u25fb\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - black_medium_small_square: { - keywords: ["icon", "shape", "button"], - "char": '\u25fe', - fitzpatrick_scale: false, - category: "symbols" - }, - white_medium_small_square: { - keywords: ["shape", "stone", "icon", "button"], - "char": '\u25fd', - fitzpatrick_scale: false, - category: "symbols" - }, - black_square_button: { - keywords: ["shape", "input", "frame"], - "char": '\ud83d\udd32', - fitzpatrick_scale: false, - category: "symbols" - }, - white_square_button: { - keywords: ["shape", "input"], - "char": '\ud83d\udd33', - fitzpatrick_scale: false, - category: "symbols" - }, - speaker: { - keywords: ["sound", "volume", "silence", "broadcast"], - "char": '\ud83d\udd08', - fitzpatrick_scale: false, - category: "symbols" - }, - sound: { - keywords: ["volume", "speaker", "broadcast"], - "char": '\ud83d\udd09', - fitzpatrick_scale: false, - category: "symbols" - }, - loud_sound: { - keywords: ["volume", "noise", "noisy", "speaker", "broadcast"], - "char": '\ud83d\udd0a', - fitzpatrick_scale: false, - category: "symbols" - }, - mute: { - keywords: ["sound", "volume", "silence", "quiet"], - "char": '\ud83d\udd07', - fitzpatrick_scale: false, - category: "symbols" - }, - mega: { - keywords: ["sound", "speaker", "volume"], - "char": '\ud83d\udce3', - fitzpatrick_scale: false, - category: "symbols" - }, - loudspeaker: { - keywords: ["volume", "sound"], - "char": '\ud83d\udce2', - fitzpatrick_scale: false, - category: "symbols" - }, - bell: { - keywords: ["sound", "notification", "christmas", "xmas", "chime"], - "char": '\ud83d\udd14', - fitzpatrick_scale: false, - category: "symbols" - }, - no_bell: { - keywords: ["sound", "volume", "mute", "quiet", "silent"], - "char": '\ud83d\udd15', - fitzpatrick_scale: false, - category: "symbols" - }, - black_joker: { - keywords: ["poker", "cards", "game", "play", "magic"], - "char": '\ud83c\udccf', - fitzpatrick_scale: false, - category: "symbols" - }, - mahjong: { - keywords: ["game", "play", "chinese", "kanji"], - "char": '\ud83c\udc04', - fitzpatrick_scale: false, - category: "symbols" - }, - spades: { - keywords: ["poker", "cards", "suits", "magic"], - "char": '\u2660\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - clubs: { - keywords: ["poker", "cards", "magic", "suits"], - "char": '\u2663\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - hearts: { - keywords: ["poker", "cards", "magic", "suits"], - "char": '\u2665\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - diamonds: { - keywords: ["poker", "cards", "magic", "suits"], - "char": '\u2666\ufe0f', - fitzpatrick_scale: false, - category: "symbols" - }, - flower_playing_cards: { - keywords: ["game", "sunset", "red"], - "char": '\ud83c\udfb4', - fitzpatrick_scale: false, - category: "symbols" - }, - thought_balloon: { - keywords: ["bubble", "cloud", "speech", "thinking", "dream"], - "char": '\ud83d\udcad', - fitzpatrick_scale: false, - category: "symbols" - }, - right_anger_bubble: { - keywords: ["caption", "speech", "thinking", "mad"], - "char": '\ud83d\uddef', - fitzpatrick_scale: false, - category: "symbols" - }, - speech_balloon: { - keywords: ["bubble", "words", "message", "talk", "chatting"], - "char": '\ud83d\udcac', - fitzpatrick_scale: false, - category: "symbols" - }, - left_speech_bubble: { - keywords: ["words", "message", "talk", "chatting"], - "char": '\ud83d\udde8', - fitzpatrick_scale: false, - category: "symbols" - }, - clock1: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd50', - fitzpatrick_scale: false, - category: "symbols" - }, - clock2: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd51', - fitzpatrick_scale: false, - category: "symbols" - }, - clock3: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd52', - fitzpatrick_scale: false, - category: "symbols" - }, - clock4: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd53', - fitzpatrick_scale: false, - category: "symbols" - }, - clock5: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd54', - fitzpatrick_scale: false, - category: "symbols" - }, - clock6: { - keywords: ["time", "late", "early", "schedule", "dawn", "dusk"], - "char": '\ud83d\udd55', - fitzpatrick_scale: false, - category: "symbols" - }, - clock7: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd56', - fitzpatrick_scale: false, - category: "symbols" - }, - clock8: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd57', - fitzpatrick_scale: false, - category: "symbols" - }, - clock9: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd58', - fitzpatrick_scale: false, - category: "symbols" - }, - clock10: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd59', - fitzpatrick_scale: false, - category: "symbols" - }, - clock11: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd5a', - fitzpatrick_scale: false, - category: "symbols" - }, - clock12: { - keywords: ["time", "noon", "midnight", "midday", "late", "early", "schedule"], - "char": '\ud83d\udd5b', - fitzpatrick_scale: false, - category: "symbols" - }, - clock130: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd5c', - fitzpatrick_scale: false, - category: "symbols" - }, - clock230: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd5d', - fitzpatrick_scale: false, - category: "symbols" - }, - clock330: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd5e', - fitzpatrick_scale: false, - category: "symbols" - }, - clock430: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd5f', - fitzpatrick_scale: false, - category: "symbols" - }, - clock530: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd60', - fitzpatrick_scale: false, - category: "symbols" - }, - clock630: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd61', - fitzpatrick_scale: false, - category: "symbols" - }, - clock730: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd62', - fitzpatrick_scale: false, - category: "symbols" - }, - clock830: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd63', - fitzpatrick_scale: false, - category: "symbols" - }, - clock930: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd64', - fitzpatrick_scale: false, - category: "symbols" - }, - clock1030: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd65', - fitzpatrick_scale: false, - category: "symbols" - }, - clock1130: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd66', - fitzpatrick_scale: false, - category: "symbols" - }, - clock1230: { - keywords: ["time", "late", "early", "schedule"], - "char": '\ud83d\udd67', - fitzpatrick_scale: false, - category: "symbols" - }, - afghanistan: { - keywords: ["af", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde6\ud83c\uddeb', - fitzpatrick_scale: false, - category: "flags" - }, - aland_islands: { - keywords: ["\xc5land", "islands", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde6\ud83c\uddfd', - fitzpatrick_scale: false, - category: "flags" - }, - albania: { - keywords: ["al", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde6\ud83c\uddf1', - fitzpatrick_scale: false, - category: "flags" - }, - algeria: { - keywords: ["dz", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde9\ud83c\uddff', - fitzpatrick_scale: false, - category: "flags" - }, - american_samoa: { - keywords: ["american", "ws", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde6\ud83c\uddf8', - fitzpatrick_scale: false, - category: "flags" - }, - andorra: { - keywords: ["ad", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde6\ud83c\udde9', - fitzpatrick_scale: false, - category: "flags" - }, - angola: { - keywords: ["ao", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde6\ud83c\uddf4', - fitzpatrick_scale: false, - category: "flags" - }, - anguilla: { - keywords: ["ai", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde6\ud83c\uddee', - fitzpatrick_scale: false, - category: "flags" - }, - antarctica: { - keywords: ["aq", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde6\ud83c\uddf6', - fitzpatrick_scale: false, - category: "flags" - }, - antigua_barbuda: { - keywords: ["antigua", "barbuda", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde6\ud83c\uddec', - fitzpatrick_scale: false, - category: "flags" - }, - argentina: { - keywords: ["ar", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde6\ud83c\uddf7', - fitzpatrick_scale: false, - category: "flags" - }, - armenia: { - keywords: ["am", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde6\ud83c\uddf2', - fitzpatrick_scale: false, - category: "flags" - }, - aruba: { - keywords: ["aw", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde6\ud83c\uddfc', - fitzpatrick_scale: false, - category: "flags" - }, - australia: { - keywords: ["au", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde6\ud83c\uddfa', - fitzpatrick_scale: false, - category: "flags" - }, - austria: { - keywords: ["at", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde6\ud83c\uddf9', - fitzpatrick_scale: false, - category: "flags" - }, - azerbaijan: { - keywords: ["az", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde6\ud83c\uddff', - fitzpatrick_scale: false, - category: "flags" - }, - bahamas: { - keywords: ["bs", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\uddf8', - fitzpatrick_scale: false, - category: "flags" - }, - bahrain: { - keywords: ["bh", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\udded', - fitzpatrick_scale: false, - category: "flags" - }, - bangladesh: { - keywords: ["bd", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\udde9', - fitzpatrick_scale: false, - category: "flags" - }, - barbados: { - keywords: ["bb", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\udde7', - fitzpatrick_scale: false, - category: "flags" - }, - belarus: { - keywords: ["by", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\uddfe', - fitzpatrick_scale: false, - category: "flags" - }, - belgium: { - keywords: ["be", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\uddea', - fitzpatrick_scale: false, - category: "flags" - }, - belize: { - keywords: ["bz", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\uddff', - fitzpatrick_scale: false, - category: "flags" - }, - benin: { - keywords: ["bj", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\uddef', - fitzpatrick_scale: false, - category: "flags" - }, - bermuda: { - keywords: ["bm", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\uddf2', - fitzpatrick_scale: false, - category: "flags" - }, - bhutan: { - keywords: ["bt", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\uddf9', - fitzpatrick_scale: false, - category: "flags" - }, - bolivia: { - keywords: ["bo", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\uddf4', - fitzpatrick_scale: false, - category: "flags" - }, - caribbean_netherlands: { - keywords: ["bonaire", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\uddf6', - fitzpatrick_scale: false, - category: "flags" - }, - bosnia_herzegovina: { - keywords: ["bosnia", "herzegovina", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\udde6', - fitzpatrick_scale: false, - category: "flags" - }, - botswana: { - keywords: ["bw", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\uddfc', - fitzpatrick_scale: false, - category: "flags" - }, - brazil: { - keywords: ["br", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\uddf7', - fitzpatrick_scale: false, - category: "flags" - }, - british_indian_ocean_territory: { - keywords: ["british", "indian", "ocean", "territory", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddee\ud83c\uddf4', - fitzpatrick_scale: false, - category: "flags" - }, - british_virgin_islands: { - keywords: ["british", "virgin", "islands", "bvi", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddfb\ud83c\uddec', - fitzpatrick_scale: false, - category: "flags" - }, - brunei: { - keywords: ["bn", "darussalam", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\uddf3', - fitzpatrick_scale: false, - category: "flags" - }, - bulgaria: { - keywords: ["bg", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\uddec', - fitzpatrick_scale: false, - category: "flags" - }, - burkina_faso: { - keywords: ["burkina", "faso", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\uddeb', - fitzpatrick_scale: false, - category: "flags" - }, - burundi: { - keywords: ["bi", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\uddee', - fitzpatrick_scale: false, - category: "flags" - }, - cape_verde: { - keywords: ["cabo", "verde", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde8\ud83c\uddfb', - fitzpatrick_scale: false, - category: "flags" - }, - cambodia: { - keywords: ["kh", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf0\ud83c\udded', - fitzpatrick_scale: false, - category: "flags" - }, - cameroon: { - keywords: ["cm", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde8\ud83c\uddf2', - fitzpatrick_scale: false, - category: "flags" - }, - canada: { - keywords: ["ca", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde8\ud83c\udde6', - fitzpatrick_scale: false, - category: "flags" - }, - canary_islands: { - keywords: ["canary", "islands", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddee\ud83c\udde8', - fitzpatrick_scale: false, - category: "flags" - }, - cayman_islands: { - keywords: ["cayman", "islands", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf0\ud83c\uddfe', - fitzpatrick_scale: false, - category: "flags" - }, - central_african_republic: { - keywords: ["central", "african", "republic", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde8\ud83c\uddeb', - fitzpatrick_scale: false, - category: "flags" - }, - chad: { - keywords: ["td", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf9\ud83c\udde9', - fitzpatrick_scale: false, - category: "flags" - }, - chile: { - keywords: ["flag", "nation", "country", "banner"], - "char": '\ud83c\udde8\ud83c\uddf1', - fitzpatrick_scale: false, - category: "flags" - }, - cn: { - keywords: ["china", "chinese", "prc", "flag", "country", "nation", "banner"], - "char": '\ud83c\udde8\ud83c\uddf3', - fitzpatrick_scale: false, - category: "flags" - }, - christmas_island: { - keywords: ["christmas", "island", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde8\ud83c\uddfd', - fitzpatrick_scale: false, - category: "flags" - }, - cocos_islands: { - keywords: ["cocos", "keeling", "islands", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde8\ud83c\udde8', - fitzpatrick_scale: false, - category: "flags" - }, - colombia: { - keywords: ["co", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde8\ud83c\uddf4', - fitzpatrick_scale: false, - category: "flags" - }, - comoros: { - keywords: ["km", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf0\ud83c\uddf2', - fitzpatrick_scale: false, - category: "flags" - }, - congo_brazzaville: { - keywords: ["congo", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde8\ud83c\uddec', - fitzpatrick_scale: false, - category: "flags" - }, - congo_kinshasa: { - keywords: ["congo", "democratic", "republic", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde8\ud83c\udde9', - fitzpatrick_scale: false, - category: "flags" - }, - cook_islands: { - keywords: ["cook", "islands", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde8\ud83c\uddf0', - fitzpatrick_scale: false, - category: "flags" - }, - costa_rica: { - keywords: ["costa", "rica", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde8\ud83c\uddf7', - fitzpatrick_scale: false, - category: "flags" - }, - croatia: { - keywords: ["hr", "flag", "nation", "country", "banner"], - "char": '\ud83c\udded\ud83c\uddf7', - fitzpatrick_scale: false, - category: "flags" - }, - cuba: { - keywords: ["cu", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde8\ud83c\uddfa', - fitzpatrick_scale: false, - category: "flags" - }, - curacao: { - keywords: ["cura\xe7ao", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde8\ud83c\uddfc', - fitzpatrick_scale: false, - category: "flags" - }, - cyprus: { - keywords: ["cy", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde8\ud83c\uddfe', - fitzpatrick_scale: false, - category: "flags" - }, - czech_republic: { - keywords: ["cz", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde8\ud83c\uddff', - fitzpatrick_scale: false, - category: "flags" - }, - denmark: { - keywords: ["dk", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde9\ud83c\uddf0', - fitzpatrick_scale: false, - category: "flags" - }, - djibouti: { - keywords: ["dj", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde9\ud83c\uddef', - fitzpatrick_scale: false, - category: "flags" - }, - dominica: { - keywords: ["dm", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde9\ud83c\uddf2', - fitzpatrick_scale: false, - category: "flags" - }, - dominican_republic: { - keywords: ["dominican", "republic", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde9\ud83c\uddf4', - fitzpatrick_scale: false, - category: "flags" - }, - ecuador: { - keywords: ["ec", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddea\ud83c\udde8', - fitzpatrick_scale: false, - category: "flags" - }, - egypt: { - keywords: ["eg", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddea\ud83c\uddec', - fitzpatrick_scale: false, - category: "flags" - }, - el_salvador: { - keywords: ["el", "salvador", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\uddfb', - fitzpatrick_scale: false, - category: "flags" - }, - equatorial_guinea: { - keywords: ["equatorial", "gn", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddec\ud83c\uddf6', - fitzpatrick_scale: false, - category: "flags" - }, - eritrea: { - keywords: ["er", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddea\ud83c\uddf7', - fitzpatrick_scale: false, - category: "flags" - }, - estonia: { - keywords: ["ee", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddea\ud83c\uddea', - fitzpatrick_scale: false, - category: "flags" - }, - ethiopia: { - keywords: ["et", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddea\ud83c\uddf9', - fitzpatrick_scale: false, - category: "flags" - }, - eu: { - keywords: ["european", "union", "flag", "banner"], - "char": '\ud83c\uddea\ud83c\uddfa', - fitzpatrick_scale: false, - category: "flags" - }, - falkland_islands: { - keywords: ["falkland", "islands", "malvinas", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddeb\ud83c\uddf0', - fitzpatrick_scale: false, - category: "flags" - }, - faroe_islands: { - keywords: ["faroe", "islands", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddeb\ud83c\uddf4', - fitzpatrick_scale: false, - category: "flags" - }, - fiji: { - keywords: ["fj", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddeb\ud83c\uddef', - fitzpatrick_scale: false, - category: "flags" - }, - finland: { - keywords: ["fi", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddeb\ud83c\uddee', - fitzpatrick_scale: false, - category: "flags" - }, - fr: { - keywords: ["banner", "flag", "nation", "france", "french", "country"], - "char": '\ud83c\uddeb\ud83c\uddf7', - fitzpatrick_scale: false, - category: "flags" - }, - french_guiana: { - keywords: ["french", "guiana", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddec\ud83c\uddeb', - fitzpatrick_scale: false, - category: "flags" - }, - french_polynesia: { - keywords: ["french", "polynesia", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf5\ud83c\uddeb', - fitzpatrick_scale: false, - category: "flags" - }, - french_southern_territories: { - keywords: ["french", "southern", "territories", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf9\ud83c\uddeb', - fitzpatrick_scale: false, - category: "flags" - }, - gabon: { - keywords: ["ga", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddec\ud83c\udde6', - fitzpatrick_scale: false, - category: "flags" - }, - gambia: { - keywords: ["gm", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddec\ud83c\uddf2', - fitzpatrick_scale: false, - category: "flags" - }, - georgia: { - keywords: ["ge", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddec\ud83c\uddea', - fitzpatrick_scale: false, - category: "flags" - }, - de: { - keywords: ["german", "nation", "flag", "country", "banner"], - "char": '\ud83c\udde9\ud83c\uddea', - fitzpatrick_scale: false, - category: "flags" - }, - ghana: { - keywords: ["gh", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddec\ud83c\udded', - fitzpatrick_scale: false, - category: "flags" - }, - gibraltar: { - keywords: ["gi", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddec\ud83c\uddee', - fitzpatrick_scale: false, - category: "flags" - }, - greece: { - keywords: ["gr", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddec\ud83c\uddf7', - fitzpatrick_scale: false, - category: "flags" - }, - greenland: { - keywords: ["gl", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddec\ud83c\uddf1', - fitzpatrick_scale: false, - category: "flags" - }, - grenada: { - keywords: ["gd", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddec\ud83c\udde9', - fitzpatrick_scale: false, - category: "flags" - }, - guadeloupe: { - keywords: ["gp", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddec\ud83c\uddf5', - fitzpatrick_scale: false, - category: "flags" - }, - guam: { - keywords: ["gu", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddec\ud83c\uddfa', - fitzpatrick_scale: false, - category: "flags" - }, - guatemala: { - keywords: ["gt", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddec\ud83c\uddf9', - fitzpatrick_scale: false, - category: "flags" - }, - guernsey: { - keywords: ["gg", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddec\ud83c\uddec', - fitzpatrick_scale: false, - category: "flags" - }, - guinea: { - keywords: ["gn", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddec\ud83c\uddf3', - fitzpatrick_scale: false, - category: "flags" - }, - guinea_bissau: { - keywords: ["gw", "bissau", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddec\ud83c\uddfc', - fitzpatrick_scale: false, - category: "flags" - }, - guyana: { - keywords: ["gy", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddec\ud83c\uddfe', - fitzpatrick_scale: false, - category: "flags" - }, - haiti: { - keywords: ["ht", "flag", "nation", "country", "banner"], - "char": '\ud83c\udded\ud83c\uddf9', - fitzpatrick_scale: false, - category: "flags" - }, - honduras: { - keywords: ["hn", "flag", "nation", "country", "banner"], - "char": '\ud83c\udded\ud83c\uddf3', - fitzpatrick_scale: false, - category: "flags" - }, - hong_kong: { - keywords: ["hong", "kong", "flag", "nation", "country", "banner"], - "char": '\ud83c\udded\ud83c\uddf0', - fitzpatrick_scale: false, - category: "flags" - }, - hungary: { - keywords: ["hu", "flag", "nation", "country", "banner"], - "char": '\ud83c\udded\ud83c\uddfa', - fitzpatrick_scale: false, - category: "flags" - }, - iceland: { - keywords: ["is", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddee\ud83c\uddf8', - fitzpatrick_scale: false, - category: "flags" - }, - india: { - keywords: ["in", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddee\ud83c\uddf3', - fitzpatrick_scale: false, - category: "flags" - }, - indonesia: { - keywords: ["flag", "nation", "country", "banner"], - "char": '\ud83c\uddee\ud83c\udde9', - fitzpatrick_scale: false, - category: "flags" - }, - iran: { - keywords: ["iran,", "islamic", "republic", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddee\ud83c\uddf7', - fitzpatrick_scale: false, - category: "flags" - }, - iraq: { - keywords: ["iq", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddee\ud83c\uddf6', - fitzpatrick_scale: false, - category: "flags" - }, - ireland: { - keywords: ["ie", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddee\ud83c\uddea', - fitzpatrick_scale: false, - category: "flags" - }, - isle_of_man: { - keywords: ["isle", "man", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddee\ud83c\uddf2', - fitzpatrick_scale: false, - category: "flags" - }, - israel: { - keywords: ["il", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddee\ud83c\uddf1', - fitzpatrick_scale: false, - category: "flags" - }, - it: { - keywords: ["italy", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddee\ud83c\uddf9', - fitzpatrick_scale: false, - category: "flags" - }, - cote_divoire: { - keywords: ["ivory", "coast", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde8\ud83c\uddee', - fitzpatrick_scale: false, - category: "flags" - }, - jamaica: { - keywords: ["jm", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddef\ud83c\uddf2', - fitzpatrick_scale: false, - category: "flags" - }, - jp: { - keywords: ["japanese", "nation", "flag", "country", "banner"], - "char": '\ud83c\uddef\ud83c\uddf5', - fitzpatrick_scale: false, - category: "flags" - }, - jersey: { - keywords: ["je", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddef\ud83c\uddea', - fitzpatrick_scale: false, - category: "flags" - }, - jordan: { - keywords: ["jo", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddef\ud83c\uddf4', - fitzpatrick_scale: false, - category: "flags" - }, - kazakhstan: { - keywords: ["kz", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf0\ud83c\uddff', - fitzpatrick_scale: false, - category: "flags" - }, - kenya: { - keywords: ["ke", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf0\ud83c\uddea', - fitzpatrick_scale: false, - category: "flags" - }, - kiribati: { - keywords: ["ki", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf0\ud83c\uddee', - fitzpatrick_scale: false, - category: "flags" - }, - kosovo: { - keywords: ["xk", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddfd\ud83c\uddf0', - fitzpatrick_scale: false, - category: "flags" - }, - kuwait: { - keywords: ["kw", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf0\ud83c\uddfc', - fitzpatrick_scale: false, - category: "flags" - }, - kyrgyzstan: { - keywords: ["kg", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf0\ud83c\uddec', - fitzpatrick_scale: false, - category: "flags" - }, - laos: { - keywords: ["lao", "democratic", "republic", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf1\ud83c\udde6', - fitzpatrick_scale: false, - category: "flags" - }, - latvia: { - keywords: ["lv", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf1\ud83c\uddfb', - fitzpatrick_scale: false, - category: "flags" - }, - lebanon: { - keywords: ["lb", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf1\ud83c\udde7', - fitzpatrick_scale: false, - category: "flags" - }, - lesotho: { - keywords: ["ls", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf1\ud83c\uddf8', - fitzpatrick_scale: false, - category: "flags" - }, - liberia: { - keywords: ["lr", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf1\ud83c\uddf7', - fitzpatrick_scale: false, - category: "flags" - }, - libya: { - keywords: ["ly", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf1\ud83c\uddfe', - fitzpatrick_scale: false, - category: "flags" - }, - liechtenstein: { - keywords: ["li", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf1\ud83c\uddee', - fitzpatrick_scale: false, - category: "flags" - }, - lithuania: { - keywords: ["lt", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf1\ud83c\uddf9', - fitzpatrick_scale: false, - category: "flags" - }, - luxembourg: { - keywords: ["lu", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf1\ud83c\uddfa', - fitzpatrick_scale: false, - category: "flags" - }, - macau: { - keywords: ["macao", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\uddf4', - fitzpatrick_scale: false, - category: "flags" - }, - macedonia: { - keywords: ["macedonia,", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\uddf0', - fitzpatrick_scale: false, - category: "flags" - }, - madagascar: { - keywords: ["mg", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\uddec', - fitzpatrick_scale: false, - category: "flags" - }, - malawi: { - keywords: ["mw", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\uddfc', - fitzpatrick_scale: false, - category: "flags" - }, - malaysia: { - keywords: ["my", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\uddfe', - fitzpatrick_scale: false, - category: "flags" - }, - maldives: { - keywords: ["mv", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\uddfb', - fitzpatrick_scale: false, - category: "flags" - }, - mali: { - keywords: ["ml", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\uddf1', - fitzpatrick_scale: false, - category: "flags" - }, - malta: { - keywords: ["mt", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\uddf9', - fitzpatrick_scale: false, - category: "flags" - }, - marshall_islands: { - keywords: ["marshall", "islands", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\udded', - fitzpatrick_scale: false, - category: "flags" - }, - martinique: { - keywords: ["mq", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\uddf6', - fitzpatrick_scale: false, - category: "flags" - }, - mauritania: { - keywords: ["mr", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\uddf7', - fitzpatrick_scale: false, - category: "flags" - }, - mauritius: { - keywords: ["mu", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\uddfa', - fitzpatrick_scale: false, - category: "flags" - }, - mayotte: { - keywords: ["yt", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddfe\ud83c\uddf9', - fitzpatrick_scale: false, - category: "flags" - }, - mexico: { - keywords: ["mx", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\uddfd', - fitzpatrick_scale: false, - category: "flags" - }, - micronesia: { - keywords: ["micronesia,", "federated", "states", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddeb\ud83c\uddf2', - fitzpatrick_scale: false, - category: "flags" - }, - moldova: { - keywords: ["moldova,", "republic", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\udde9', - fitzpatrick_scale: false, - category: "flags" - }, - monaco: { - keywords: ["mc", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\udde8', - fitzpatrick_scale: false, - category: "flags" - }, - mongolia: { - keywords: ["mn", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\uddf3', - fitzpatrick_scale: false, - category: "flags" - }, - montenegro: { - keywords: ["me", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\uddea', - fitzpatrick_scale: false, - category: "flags" - }, - montserrat: { - keywords: ["ms", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\uddf8', - fitzpatrick_scale: false, - category: "flags" - }, - morocco: { - keywords: ["ma", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\udde6', - fitzpatrick_scale: false, - category: "flags" - }, - mozambique: { - keywords: ["mz", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\uddff', - fitzpatrick_scale: false, - category: "flags" - }, - myanmar: { - keywords: ["mm", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\uddf2', - fitzpatrick_scale: false, - category: "flags" - }, - namibia: { - keywords: ["na", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf3\ud83c\udde6', - fitzpatrick_scale: false, - category: "flags" - }, - nauru: { - keywords: ["nr", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf3\ud83c\uddf7', - fitzpatrick_scale: false, - category: "flags" - }, - nepal: { - keywords: ["np", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf3\ud83c\uddf5', - fitzpatrick_scale: false, - category: "flags" - }, - netherlands: { - keywords: ["nl", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf3\ud83c\uddf1', - fitzpatrick_scale: false, - category: "flags" - }, - new_caledonia: { - keywords: ["new", "caledonia", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf3\ud83c\udde8', - fitzpatrick_scale: false, - category: "flags" - }, - new_zealand: { - keywords: ["new", "zealand", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf3\ud83c\uddff', - fitzpatrick_scale: false, - category: "flags" - }, - nicaragua: { - keywords: ["ni", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf3\ud83c\uddee', - fitzpatrick_scale: false, - category: "flags" - }, - niger: { - keywords: ["ne", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf3\ud83c\uddea', - fitzpatrick_scale: false, - category: "flags" - }, - nigeria: { - keywords: ["flag", "nation", "country", "banner"], - "char": '\ud83c\uddf3\ud83c\uddec', - fitzpatrick_scale: false, - category: "flags" - }, - niue: { - keywords: ["nu", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf3\ud83c\uddfa', - fitzpatrick_scale: false, - category: "flags" - }, - norfolk_island: { - keywords: ["norfolk", "island", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf3\ud83c\uddeb', - fitzpatrick_scale: false, - category: "flags" - }, - northern_mariana_islands: { - keywords: ["northern", "mariana", "islands", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf2\ud83c\uddf5', - fitzpatrick_scale: false, - category: "flags" - }, - north_korea: { - keywords: ["north", "korea", "nation", "flag", "country", "banner"], - "char": '\ud83c\uddf0\ud83c\uddf5', - fitzpatrick_scale: false, - category: "flags" - }, - norway: { - keywords: ["no", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf3\ud83c\uddf4', - fitzpatrick_scale: false, - category: "flags" - }, - oman: { - keywords: ["om_symbol", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf4\ud83c\uddf2', - fitzpatrick_scale: false, - category: "flags" - }, - pakistan: { - keywords: ["pk", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf5\ud83c\uddf0', - fitzpatrick_scale: false, - category: "flags" - }, - palau: { - keywords: ["pw", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf5\ud83c\uddfc', - fitzpatrick_scale: false, - category: "flags" - }, - palestinian_territories: { - keywords: ["palestine", "palestinian", "territories", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf5\ud83c\uddf8', - fitzpatrick_scale: false, - category: "flags" - }, - panama: { - keywords: ["pa", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf5\ud83c\udde6', - fitzpatrick_scale: false, - category: "flags" - }, - papua_new_guinea: { - keywords: ["papua", "new", "guinea", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf5\ud83c\uddec', - fitzpatrick_scale: false, - category: "flags" - }, - paraguay: { - keywords: ["py", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf5\ud83c\uddfe', - fitzpatrick_scale: false, - category: "flags" - }, - peru: { - keywords: ["pe", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf5\ud83c\uddea', - fitzpatrick_scale: false, - category: "flags" - }, - philippines: { - keywords: ["ph", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf5\ud83c\udded', - fitzpatrick_scale: false, - category: "flags" - }, - pitcairn_islands: { - keywords: ["pitcairn", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf5\ud83c\uddf3', - fitzpatrick_scale: false, - category: "flags" - }, - poland: { - keywords: ["pl", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf5\ud83c\uddf1', - fitzpatrick_scale: false, - category: "flags" - }, - portugal: { - keywords: ["pt", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf5\ud83c\uddf9', - fitzpatrick_scale: false, - category: "flags" - }, - puerto_rico: { - keywords: ["puerto", "rico", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf5\ud83c\uddf7', - fitzpatrick_scale: false, - category: "flags" - }, - qatar: { - keywords: ["qa", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf6\ud83c\udde6', - fitzpatrick_scale: false, - category: "flags" - }, - reunion: { - keywords: ["r\xe9union", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf7\ud83c\uddea', - fitzpatrick_scale: false, - category: "flags" - }, - romania: { - keywords: ["ro", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf7\ud83c\uddf4', - fitzpatrick_scale: false, - category: "flags" - }, - ru: { - keywords: ["russian", "federation", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf7\ud83c\uddfa', - fitzpatrick_scale: false, - category: "flags" - }, - rwanda: { - keywords: ["rw", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf7\ud83c\uddfc', - fitzpatrick_scale: false, - category: "flags" - }, - st_barthelemy: { - keywords: ["saint", "barth\xe9lemy", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde7\ud83c\uddf1', - fitzpatrick_scale: false, - category: "flags" - }, - st_helena: { - keywords: ["saint", "helena", "ascension", "tristan", "cunha", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\udded', - fitzpatrick_scale: false, - category: "flags" - }, - st_kitts_nevis: { - keywords: ["saint", "kitts", "nevis", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf0\ud83c\uddf3', - fitzpatrick_scale: false, - category: "flags" - }, - st_lucia: { - keywords: ["saint", "lucia", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf1\ud83c\udde8', - fitzpatrick_scale: false, - category: "flags" - }, - st_pierre_miquelon: { - keywords: ["saint", "pierre", "miquelon", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf5\ud83c\uddf2', - fitzpatrick_scale: false, - category: "flags" - }, - st_vincent_grenadines: { - keywords: ["saint", "vincent", "grenadines", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddfb\ud83c\udde8', - fitzpatrick_scale: false, - category: "flags" - }, - samoa: { - keywords: ["ws", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddfc\ud83c\uddf8', - fitzpatrick_scale: false, - category: "flags" - }, - san_marino: { - keywords: ["san", "marino", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\uddf2', - fitzpatrick_scale: false, - category: "flags" - }, - sao_tome_principe: { - keywords: ["sao", "tome", "principe", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\uddf9', - fitzpatrick_scale: false, - category: "flags" - }, - saudi_arabia: { - keywords: ["flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\udde6', - fitzpatrick_scale: false, - category: "flags" - }, - senegal: { - keywords: ["sn", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\uddf3', - fitzpatrick_scale: false, - category: "flags" - }, - serbia: { - keywords: ["rs", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf7\ud83c\uddf8', - fitzpatrick_scale: false, - category: "flags" - }, - seychelles: { - keywords: ["sc", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\udde8', - fitzpatrick_scale: false, - category: "flags" - }, - sierra_leone: { - keywords: ["sierra", "leone", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\uddf1', - fitzpatrick_scale: false, - category: "flags" - }, - singapore: { - keywords: ["sg", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\uddec', - fitzpatrick_scale: false, - category: "flags" - }, - sint_maarten: { - keywords: ["sint", "maarten", "dutch", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\uddfd', - fitzpatrick_scale: false, - category: "flags" - }, - slovakia: { - keywords: ["sk", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\uddf0', - fitzpatrick_scale: false, - category: "flags" - }, - slovenia: { - keywords: ["si", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\uddee', - fitzpatrick_scale: false, - category: "flags" - }, - solomon_islands: { - keywords: ["solomon", "islands", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\udde7', - fitzpatrick_scale: false, - category: "flags" - }, - somalia: { - keywords: ["so", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\uddf4', - fitzpatrick_scale: false, - category: "flags" - }, - south_africa: { - keywords: ["south", "africa", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddff\ud83c\udde6', - fitzpatrick_scale: false, - category: "flags" - }, - south_georgia_south_sandwich_islands: { - keywords: ["south", "georgia", "sandwich", "islands", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddec\ud83c\uddf8', - fitzpatrick_scale: false, - category: "flags" - }, - kr: { - keywords: ["south", "korea", "nation", "flag", "country", "banner"], - "char": '\ud83c\uddf0\ud83c\uddf7', - fitzpatrick_scale: false, - category: "flags" - }, - south_sudan: { - keywords: ["south", "sd", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\uddf8', - fitzpatrick_scale: false, - category: "flags" - }, - es: { - keywords: ["spain", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddea\ud83c\uddf8', - fitzpatrick_scale: false, - category: "flags" - }, - sri_lanka: { - keywords: ["sri", "lanka", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf1\ud83c\uddf0', - fitzpatrick_scale: false, - category: "flags" - }, - sudan: { - keywords: ["sd", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\udde9', - fitzpatrick_scale: false, - category: "flags" - }, - suriname: { - keywords: ["sr", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\uddf7', - fitzpatrick_scale: false, - category: "flags" - }, - swaziland: { - keywords: ["sz", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\uddff', - fitzpatrick_scale: false, - category: "flags" - }, - sweden: { - keywords: ["se", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\uddea', - fitzpatrick_scale: false, - category: "flags" - }, - switzerland: { - keywords: ["ch", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde8\ud83c\udded', - fitzpatrick_scale: false, - category: "flags" - }, - syria: { - keywords: ["syrian", "arab", "republic", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf8\ud83c\uddfe', - fitzpatrick_scale: false, - category: "flags" - }, - taiwan: { - keywords: ["tw", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf9\ud83c\uddfc', - fitzpatrick_scale: false, - category: "flags" - }, - tajikistan: { - keywords: ["tj", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf9\ud83c\uddef', - fitzpatrick_scale: false, - category: "flags" - }, - tanzania: { - keywords: ["tanzania,", "united", "republic", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf9\ud83c\uddff', - fitzpatrick_scale: false, - category: "flags" - }, - thailand: { - keywords: ["th", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf9\ud83c\udded', - fitzpatrick_scale: false, - category: "flags" - }, - timor_leste: { - keywords: ["timor", "leste", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf9\ud83c\uddf1', - fitzpatrick_scale: false, - category: "flags" - }, - togo: { - keywords: ["tg", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf9\ud83c\uddec', - fitzpatrick_scale: false, - category: "flags" - }, - tokelau: { - keywords: ["tk", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf9\ud83c\uddf0', - fitzpatrick_scale: false, - category: "flags" - }, - tonga: { - keywords: ["to", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf9\ud83c\uddf4', - fitzpatrick_scale: false, - category: "flags" - }, - trinidad_tobago: { - keywords: ["trinidad", "tobago", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf9\ud83c\uddf9', - fitzpatrick_scale: false, - category: "flags" - }, - tunisia: { - keywords: ["tn", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf9\ud83c\uddf3', - fitzpatrick_scale: false, - category: "flags" - }, - tr: { - keywords: ["turkey", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf9\ud83c\uddf7', - fitzpatrick_scale: false, - category: "flags" - }, - turkmenistan: { - keywords: ["flag", "nation", "country", "banner"], - "char": '\ud83c\uddf9\ud83c\uddf2', - fitzpatrick_scale: false, - category: "flags" - }, - turks_caicos_islands: { - keywords: ["turks", "caicos", "islands", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddf9\ud83c\udde8', - fitzpatrick_scale: false, - category: "flags" - }, - tuvalu: { - keywords: ["flag", "nation", "country", "banner"], - "char": '\ud83c\uddf9\ud83c\uddfb', - fitzpatrick_scale: false, - category: "flags" - }, - uganda: { - keywords: ["ug", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddfa\ud83c\uddec', - fitzpatrick_scale: false, - category: "flags" - }, - ukraine: { - keywords: ["ua", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddfa\ud83c\udde6', - fitzpatrick_scale: false, - category: "flags" - }, - united_arab_emirates: { - keywords: ["united", "arab", "emirates", "flag", "nation", "country", "banner"], - "char": '\ud83c\udde6\ud83c\uddea', - fitzpatrick_scale: false, - category: "flags" - }, - uk: { - keywords: ["united", "kingdom", "great", "britain", "northern", "ireland", "flag", "nation", "country", "banner", "british", "UK", "english", "england", "union jack"], - "char": '\ud83c\uddec\ud83c\udde7', - fitzpatrick_scale: false, - category: "flags" - }, - england: { - keywords: ["flag", "english"], - "char": '\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f', - fitzpatrick_scale: false, - category: "flags" - }, - scotland: { - keywords: ["flag", "scottish"], - "char": '\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f', - fitzpatrick_scale: false, - category: "flags" - }, - wales: { - keywords: ["flag", "welsh"], - "char": '\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f', - fitzpatrick_scale: false, - category: "flags" - }, - us: { - keywords: ["united", "states", "america", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddfa\ud83c\uddf8', - fitzpatrick_scale: false, - category: "flags" - }, - us_virgin_islands: { - keywords: ["virgin", "islands", "us", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddfb\ud83c\uddee', - fitzpatrick_scale: false, - category: "flags" - }, - uruguay: { - keywords: ["uy", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddfa\ud83c\uddfe', - fitzpatrick_scale: false, - category: "flags" - }, - uzbekistan: { - keywords: ["uz", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddfa\ud83c\uddff', - fitzpatrick_scale: false, - category: "flags" - }, - vanuatu: { - keywords: ["vu", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddfb\ud83c\uddfa', - fitzpatrick_scale: false, - category: "flags" - }, - vatican_city: { - keywords: ["vatican", "city", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddfb\ud83c\udde6', - fitzpatrick_scale: false, - category: "flags" - }, - venezuela: { - keywords: ["ve", "bolivarian", "republic", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddfb\ud83c\uddea', - fitzpatrick_scale: false, - category: "flags" - }, - vietnam: { - keywords: ["viet", "nam", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddfb\ud83c\uddf3', - fitzpatrick_scale: false, - category: "flags" - }, - wallis_futuna: { - keywords: ["wallis", "futuna", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddfc\ud83c\uddeb', - fitzpatrick_scale: false, - category: "flags" - }, - western_sahara: { - keywords: ["western", "sahara", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddea\ud83c\udded', - fitzpatrick_scale: false, - category: "flags" - }, - yemen: { - keywords: ["ye", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddfe\ud83c\uddea', - fitzpatrick_scale: false, - category: "flags" - }, - zambia: { - keywords: ["zm", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddff\ud83c\uddf2', - fitzpatrick_scale: false, - category: "flags" - }, - zimbabwe: { - keywords: ["zw", "flag", "nation", "country", "banner"], - "char": '\ud83c\uddff\ud83c\uddfc', - fitzpatrick_scale: false, - category: "flags" - }, - united_nations: { - keywords: ["un", "flag", "banner"], - "char": '\ud83c\uddfa\ud83c\uddf3', - fitzpatrick_scale: false, - category: "flags" - }, - pirate_flag: { - keywords: ["skull", "crossbones", "flag", "banner"], - "char": '\ud83c\udff4\u200d\u2620\ufe0f', - fitzpatrick_scale: false, - category: "flags" - } + 100: { + keywords: [ "score", "perfect", "numbers", "century", "exam", "quiz", "test", "pass", "hundred" ], + "char": '\ud83d\udcaf', + fitzpatrick_scale: false, + category: "symbols" + }, + 1234: { + keywords: [ "numbers", "blue-square" ], + "char": '\ud83d\udd22', + fitzpatrick_scale: false, + category: "symbols" + }, + grinning: { + keywords: [ "face", "smile", "happy", "joy", ":D", "grin" ], + "char": '\ud83d\ude00', + fitzpatrick_scale: false, + category: "people" + }, + grimacing: { + keywords: [ "face", "grimace", "teeth" ], + "char": '\ud83d\ude2c', + fitzpatrick_scale: false, + category: "people" + }, + grin: { + keywords: [ "face", "happy", "smile", "joy", "kawaii" ], + "char": '\ud83d\ude01', + fitzpatrick_scale: false, + category: "people" + }, + joy: { + keywords: [ "face", "cry", "tears", "weep", "happy", "happytears", "haha" ], + "char": '\ud83d\ude02', + fitzpatrick_scale: false, + category: "people" + }, + rofl: { + keywords: [ "face", "rolling", "floor", "laughing", "lol", "haha" ], + "char": '\ud83e\udd23', + fitzpatrick_scale: false, + category: "people" + }, + partying: { + keywords: [ "face", "celebration", "woohoo" ], + "char": '\ud83e\udd73', + fitzpatrick_scale: false, + category: "people" + }, + smiley: { + keywords: [ "face", "happy", "joy", "haha", ":D", ":)", "smile", "funny" ], + "char": '\ud83d\ude03', + fitzpatrick_scale: false, + category: "people" + }, + smile: { + keywords: [ "face", "happy", "joy", "funny", "haha", "laugh", "like", ":D", ":)" ], + "char": '\ud83d\ude04', + fitzpatrick_scale: false, + category: "people" + }, + sweat_smile: { + keywords: [ "face", "hot", "happy", "laugh", "sweat", "smile", "relief" ], + "char": '\ud83d\ude05', + fitzpatrick_scale: false, + category: "people" + }, + laughing: { + keywords: [ "happy", "joy", "lol", "satisfied", "haha", "face", "glad", "XD", "laugh" ], + "char": '\ud83d\ude06', + fitzpatrick_scale: false, + category: "people" + }, + innocent: { + keywords: [ "face", "angel", "heaven", "halo" ], + "char": '\ud83d\ude07', + fitzpatrick_scale: false, + category: "people" + }, + wink: { + keywords: [ "face", "happy", "mischievous", "secret", ";)", "smile", "eye" ], + "char": '\ud83d\ude09', + fitzpatrick_scale: false, + category: "people" + }, + blush: { + keywords: [ "face", "smile", "happy", "flushed", "crush", "embarrassed", "shy", "joy" ], + "char": '\ud83d\ude0a', + fitzpatrick_scale: false, + category: "people" + }, + slightly_smiling_face: { + keywords: [ "face", "smile" ], + "char": '\ud83d\ude42', + fitzpatrick_scale: false, + category: "people" + }, + upside_down_face: { + keywords: [ "face", "flipped", "silly", "smile" ], + "char": '\ud83d\ude43', + fitzpatrick_scale: false, + category: "people" + }, + relaxed: { + keywords: [ "face", "blush", "massage", "happiness" ], + "char": '\u263a\ufe0f', + fitzpatrick_scale: false, + category: "people" + }, + yum: { + keywords: [ "happy", "joy", "tongue", "smile", "face", "silly", "yummy", "nom", "delicious", "savouring" ], + "char": '\ud83d\ude0b', + fitzpatrick_scale: false, + category: "people" + }, + relieved: { + keywords: [ "face", "relaxed", "phew", "massage", "happiness" ], + "char": '\ud83d\ude0c', + fitzpatrick_scale: false, + category: "people" + }, + heart_eyes: { + keywords: [ "face", "love", "like", "affection", "valentines", "infatuation", "crush", "heart" ], + "char": '\ud83d\ude0d', + fitzpatrick_scale: false, + category: "people" + }, + smiling_face_with_three_hearts: { + keywords: [ "face", "love", "like", "affection", "valentines", "infatuation", "crush", "hearts", "adore" ], + "char": '\ud83e\udd70', + fitzpatrick_scale: false, + category: "people" + }, + kissing_heart: { + keywords: [ "face", "love", "like", "affection", "valentines", "infatuation", "kiss" ], + "char": '\ud83d\ude18', + fitzpatrick_scale: false, + category: "people" + }, + kissing: { + keywords: [ "love", "like", "face", "3", "valentines", "infatuation", "kiss" ], + "char": '\ud83d\ude17', + fitzpatrick_scale: false, + category: "people" + }, + kissing_smiling_eyes: { + keywords: [ "face", "affection", "valentines", "infatuation", "kiss" ], + "char": '\ud83d\ude19', + fitzpatrick_scale: false, + category: "people" + }, + kissing_closed_eyes: { + keywords: [ "face", "love", "like", "affection", "valentines", "infatuation", "kiss" ], + "char": '\ud83d\ude1a', + fitzpatrick_scale: false, + category: "people" + }, + stuck_out_tongue_winking_eye: { + keywords: [ "face", "prank", "childish", "playful", "mischievous", "smile", "wink", "tongue" ], + "char": '\ud83d\ude1c', + fitzpatrick_scale: false, + category: "people" + }, + zany: { + keywords: [ "face", "goofy", "crazy" ], + "char": '\ud83e\udd2a', + fitzpatrick_scale: false, + category: "people" + }, + raised_eyebrow: { + keywords: [ "face", "distrust", "scepticism", "disapproval", "disbelief", "surprise" ], + "char": '\ud83e\udd28', + fitzpatrick_scale: false, + category: "people" + }, + monocle: { + keywords: [ "face", "stuffy", "wealthy" ], + "char": '\ud83e\uddd0', + fitzpatrick_scale: false, + category: "people" + }, + stuck_out_tongue_closed_eyes: { + keywords: [ "face", "prank", "playful", "mischievous", "smile", "tongue" ], + "char": '\ud83d\ude1d', + fitzpatrick_scale: false, + category: "people" + }, + stuck_out_tongue: { + keywords: [ "face", "prank", "childish", "playful", "mischievous", "smile", "tongue" ], + "char": '\ud83d\ude1b', + fitzpatrick_scale: false, + category: "people" + }, + money_mouth_face: { + keywords: [ "face", "rich", "dollar", "money" ], + "char": '\ud83e\udd11', + fitzpatrick_scale: false, + category: "people" + }, + nerd_face: { + keywords: [ "face", "nerdy", "geek", "dork" ], + "char": '\ud83e\udd13', + fitzpatrick_scale: false, + category: "people" + }, + sunglasses: { + keywords: [ "face", "cool", "smile", "summer", "beach", "sunglass" ], + "char": '\ud83d\ude0e', + fitzpatrick_scale: false, + category: "people" + }, + star_struck: { + keywords: [ "face", "smile", "starry", "eyes", "grinning" ], + "char": '\ud83e\udd29', + fitzpatrick_scale: false, + category: "people" + }, + clown_face: { + keywords: [ "face" ], + "char": '\ud83e\udd21', + fitzpatrick_scale: false, + category: "people" + }, + cowboy_hat_face: { + keywords: [ "face", "cowgirl", "hat" ], + "char": '\ud83e\udd20', + fitzpatrick_scale: false, + category: "people" + }, + hugs: { + keywords: [ "face", "smile", "hug" ], + "char": '\ud83e\udd17', + fitzpatrick_scale: false, + category: "people" + }, + smirk: { + keywords: [ "face", "smile", "mean", "prank", "smug", "sarcasm" ], + "char": '\ud83d\ude0f', + fitzpatrick_scale: false, + category: "people" + }, + no_mouth: { + keywords: [ "face", "hellokitty" ], + "char": '\ud83d\ude36', + fitzpatrick_scale: false, + category: "people" + }, + neutral_face: { + keywords: [ "indifference", "meh", ":|", "neutral" ], + "char": '\ud83d\ude10', + fitzpatrick_scale: false, + category: "people" + }, + expressionless: { + keywords: [ "face", "indifferent", "-_-", "meh", "deadpan" ], + "char": '\ud83d\ude11', + fitzpatrick_scale: false, + category: "people" + }, + unamused: { + keywords: [ "indifference", "bored", "straight face", "serious", "sarcasm", "unimpressed", "skeptical", "dubious", "side_eye" ], + "char": '\ud83d\ude12', + fitzpatrick_scale: false, + category: "people" + }, + roll_eyes: { + keywords: [ "face", "eyeroll", "frustrated" ], + "char": '\ud83d\ude44', + fitzpatrick_scale: false, + category: "people" + }, + thinking: { + keywords: [ "face", "hmmm", "think", "consider" ], + "char": '\ud83e\udd14', + fitzpatrick_scale: false, + category: "people" + }, + lying_face: { + keywords: [ "face", "lie", "pinocchio" ], + "char": '\ud83e\udd25', + fitzpatrick_scale: false, + category: "people" + }, + hand_over_mouth: { + keywords: [ "face", "whoops", "shock", "surprise" ], + "char": '\ud83e\udd2d', + fitzpatrick_scale: false, + category: "people" + }, + shushing: { + keywords: [ "face", "quiet", "shhh" ], + "char": '\ud83e\udd2b', + fitzpatrick_scale: false, + category: "people" + }, + symbols_over_mouth: { + keywords: [ "face", "swearing", "cursing", "cussing", "profanity", "expletive" ], + "char": '\ud83e\udd2c', + fitzpatrick_scale: false, + category: "people" + }, + exploding_head: { + keywords: [ "face", "shocked", "mind", "blown" ], + "char": '\ud83e\udd2f', + fitzpatrick_scale: false, + category: "people" + }, + flushed: { + keywords: [ "face", "blush", "shy", "flattered" ], + "char": '\ud83d\ude33', + fitzpatrick_scale: false, + category: "people" + }, + disappointed: { + keywords: [ "face", "sad", "upset", "depressed", ":(" ], + "char": '\ud83d\ude1e', + fitzpatrick_scale: false, + category: "people" + }, + worried: { + keywords: [ "face", "concern", "nervous", ":(" ], + "char": '\ud83d\ude1f', + fitzpatrick_scale: false, + category: "people" + }, + angry: { + keywords: [ "mad", "face", "annoyed", "frustrated" ], + "char": '\ud83d\ude20', + fitzpatrick_scale: false, + category: "people" + }, + rage: { + keywords: [ "angry", "mad", "hate", "despise" ], + "char": '\ud83d\ude21', + fitzpatrick_scale: false, + category: "people" + }, + pensive: { + keywords: [ "face", "sad", "depressed", "upset" ], + "char": '\ud83d\ude14', + fitzpatrick_scale: false, + category: "people" + }, + confused: { + keywords: [ "face", "indifference", "huh", "weird", "hmmm", ":/" ], + "char": '\ud83d\ude15', + fitzpatrick_scale: false, + category: "people" + }, + slightly_frowning_face: { + keywords: [ "face", "frowning", "disappointed", "sad", "upset" ], + "char": '\ud83d\ude41', + fitzpatrick_scale: false, + category: "people" + }, + frowning_face: { + keywords: [ "face", "sad", "upset", "frown" ], + "char": '\u2639', + fitzpatrick_scale: false, + category: "people" + }, + persevere: { + keywords: [ "face", "sick", "no", "upset", "oops" ], + "char": '\ud83d\ude23', + fitzpatrick_scale: false, + category: "people" + }, + confounded: { + keywords: [ "face", "confused", "sick", "unwell", "oops", ":S" ], + "char": '\ud83d\ude16', + fitzpatrick_scale: false, + category: "people" + }, + tired_face: { + keywords: [ "sick", "whine", "upset", "frustrated" ], + "char": '\ud83d\ude2b', + fitzpatrick_scale: false, + category: "people" + }, + weary: { + keywords: [ "face", "tired", "sleepy", "sad", "frustrated", "upset" ], + "char": '\ud83d\ude29', + fitzpatrick_scale: false, + category: "people" + }, + pleading: { + keywords: [ "face", "begging", "mercy" ], + "char": '\ud83e\udd7a', + fitzpatrick_scale: false, + category: "people" + }, + triumph: { + keywords: [ "face", "gas", "phew", "proud", "pride" ], + "char": '\ud83d\ude24', + fitzpatrick_scale: false, + category: "people" + }, + open_mouth: { + keywords: [ "face", "surprise", "impressed", "wow", "whoa", ":O" ], + "char": '\ud83d\ude2e', + fitzpatrick_scale: false, + category: "people" + }, + scream: { + keywords: [ "face", "munch", "scared", "omg" ], + "char": '\ud83d\ude31', + fitzpatrick_scale: false, + category: "people" + }, + fearful: { + keywords: [ "face", "scared", "terrified", "nervous", "oops", "huh" ], + "char": '\ud83d\ude28', + fitzpatrick_scale: false, + category: "people" + }, + cold_sweat: { + keywords: [ "face", "nervous", "sweat" ], + "char": '\ud83d\ude30', + fitzpatrick_scale: false, + category: "people" + }, + hushed: { + keywords: [ "face", "woo", "shh" ], + "char": '\ud83d\ude2f', + fitzpatrick_scale: false, + category: "people" + }, + frowning: { + keywords: [ "face", "aw", "what" ], + "char": '\ud83d\ude26', + fitzpatrick_scale: false, + category: "people" + }, + anguished: { + keywords: [ "face", "stunned", "nervous" ], + "char": '\ud83d\ude27', + fitzpatrick_scale: false, + category: "people" + }, + cry: { + keywords: [ "face", "tears", "sad", "depressed", "upset", ":'(" ], + "char": '\ud83d\ude22', + fitzpatrick_scale: false, + category: "people" + }, + disappointed_relieved: { + keywords: [ "face", "phew", "sweat", "nervous" ], + "char": '\ud83d\ude25', + fitzpatrick_scale: false, + category: "people" + }, + drooling_face: { + keywords: [ "face" ], + "char": '\ud83e\udd24', + fitzpatrick_scale: false, + category: "people" + }, + sleepy: { + keywords: [ "face", "tired", "rest", "nap" ], + "char": '\ud83d\ude2a', + fitzpatrick_scale: false, + category: "people" + }, + sweat: { + keywords: [ "face", "hot", "sad", "tired", "exercise" ], + "char": '\ud83d\ude13', + fitzpatrick_scale: false, + category: "people" + }, + hot: { + keywords: [ "face", "feverish", "heat", "red", "sweating" ], + "char": '\ud83e\udd75', + fitzpatrick_scale: false, + category: "people" + }, + cold: { + keywords: [ "face", "blue", "freezing", "frozen", "frostbite", "icicles" ], + "char": '\ud83e\udd76', + fitzpatrick_scale: false, + category: "people" + }, + sob: { + keywords: [ "face", "cry", "tears", "sad", "upset", "depressed" ], + "char": '\ud83d\ude2d', + fitzpatrick_scale: false, + category: "people" + }, + dizzy_face: { + keywords: [ "spent", "unconscious", "xox", "dizzy" ], + "char": '\ud83d\ude35', + fitzpatrick_scale: false, + category: "people" + }, + astonished: { + keywords: [ "face", "xox", "surprised", "poisoned" ], + "char": '\ud83d\ude32', + fitzpatrick_scale: false, + category: "people" + }, + zipper_mouth_face: { + keywords: [ "face", "sealed", "zipper", "secret" ], + "char": '\ud83e\udd10', + fitzpatrick_scale: false, + category: "people" + }, + nauseated_face: { + keywords: [ "face", "vomit", "gross", "green", "sick", "throw up", "ill" ], + "char": '\ud83e\udd22', + fitzpatrick_scale: false, + category: "people" + }, + sneezing_face: { + keywords: [ "face", "gesundheit", "sneeze", "sick", "allergy" ], + "char": '\ud83e\udd27', + fitzpatrick_scale: false, + category: "people" + }, + vomiting: { + keywords: [ "face", "sick" ], + "char": '\ud83e\udd2e', + fitzpatrick_scale: false, + category: "people" + }, + mask: { + keywords: [ "face", "sick", "ill", "disease" ], + "char": '\ud83d\ude37', + fitzpatrick_scale: false, + category: "people" + }, + face_with_thermometer: { + keywords: [ "sick", "temperature", "thermometer", "cold", "fever" ], + "char": '\ud83e\udd12', + fitzpatrick_scale: false, + category: "people" + }, + face_with_head_bandage: { + keywords: [ "injured", "clumsy", "bandage", "hurt" ], + "char": '\ud83e\udd15', + fitzpatrick_scale: false, + category: "people" + }, + woozy: { + keywords: [ "face", "dizzy", "intoxicated", "tipsy", "wavy" ], + "char": '\ud83e\udd74', + fitzpatrick_scale: false, + category: "people" + }, + sleeping: { + keywords: [ "face", "tired", "sleepy", "night", "zzz" ], + "char": '\ud83d\ude34', + fitzpatrick_scale: false, + category: "people" + }, + zzz: { + keywords: [ "sleepy", "tired", "dream" ], + "char": '\ud83d\udca4', + fitzpatrick_scale: false, + category: "people" + }, + poop: { + keywords: [ "hankey", "shitface", "fail", "turd", "shit" ], + "char": '\ud83d\udca9', + fitzpatrick_scale: false, + category: "people" + }, + smiling_imp: { + keywords: [ "devil", "horns" ], + "char": '\ud83d\ude08', + fitzpatrick_scale: false, + category: "people" + }, + imp: { + keywords: [ "devil", "angry", "horns" ], + "char": '\ud83d\udc7f', + fitzpatrick_scale: false, + category: "people" + }, + japanese_ogre: { + keywords: [ "monster", "red", "mask", "halloween", "scary", "creepy", "devil", "demon", "japanese", "ogre" ], + "char": '\ud83d\udc79', + fitzpatrick_scale: false, + category: "people" + }, + japanese_goblin: { + keywords: [ "red", "evil", "mask", "monster", "scary", "creepy", "japanese", "goblin" ], + "char": '\ud83d\udc7a', + fitzpatrick_scale: false, + category: "people" + }, + skull: { + keywords: [ "dead", "skeleton", "creepy", "death" ], + "char": '\ud83d\udc80', + fitzpatrick_scale: false, + category: "people" + }, + ghost: { + keywords: [ "halloween", "spooky", "scary" ], + "char": '\ud83d\udc7b', + fitzpatrick_scale: false, + category: "people" + }, + alien: { + keywords: [ "UFO", "paul", "weird", "outer_space" ], + "char": '\ud83d\udc7d', + fitzpatrick_scale: false, + category: "people" + }, + robot: { + keywords: [ "computer", "machine", "bot" ], + "char": '\ud83e\udd16', + fitzpatrick_scale: false, + category: "people" + }, + smiley_cat: { + keywords: [ "animal", "cats", "happy", "smile" ], + "char": '\ud83d\ude3a', + fitzpatrick_scale: false, + category: "people" + }, + smile_cat: { + keywords: [ "animal", "cats", "smile" ], + "char": '\ud83d\ude38', + fitzpatrick_scale: false, + category: "people" + }, + joy_cat: { + keywords: [ "animal", "cats", "haha", "happy", "tears" ], + "char": '\ud83d\ude39', + fitzpatrick_scale: false, + category: "people" + }, + heart_eyes_cat: { + keywords: [ "animal", "love", "like", "affection", "cats", "valentines", "heart" ], + "char": '\ud83d\ude3b', + fitzpatrick_scale: false, + category: "people" + }, + smirk_cat: { + keywords: [ "animal", "cats", "smirk" ], + "char": '\ud83d\ude3c', + fitzpatrick_scale: false, + category: "people" + }, + kissing_cat: { + keywords: [ "animal", "cats", "kiss" ], + "char": '\ud83d\ude3d', + fitzpatrick_scale: false, + category: "people" + }, + scream_cat: { + keywords: [ "animal", "cats", "munch", "scared", "scream" ], + "char": '\ud83d\ude40', + fitzpatrick_scale: false, + category: "people" + }, + crying_cat_face: { + keywords: [ "animal", "tears", "weep", "sad", "cats", "upset", "cry" ], + "char": '\ud83d\ude3f', + fitzpatrick_scale: false, + category: "people" + }, + pouting_cat: { + keywords: [ "animal", "cats" ], + "char": '\ud83d\ude3e', + fitzpatrick_scale: false, + category: "people" + }, + palms_up: { + keywords: [ "hands", "gesture", "cupped", "prayer" ], + "char": '\ud83e\udd32', + fitzpatrick_scale: true, + category: "people" + }, + raised_hands: { + keywords: [ "gesture", "hooray", "yea", "celebration", "hands" ], + "char": '\ud83d\ude4c', + fitzpatrick_scale: true, + category: "people" + }, + clap: { + keywords: [ "hands", "praise", "applause", "congrats", "yay" ], + "char": '\ud83d\udc4f', + fitzpatrick_scale: true, + category: "people" + }, + wave: { + keywords: [ "hands", "gesture", "goodbye", "solong", "farewell", "hello", "hi", "palm" ], + "char": '\ud83d\udc4b', + fitzpatrick_scale: true, + category: "people" + }, + call_me_hand: { + keywords: [ "hands", "gesture" ], + "char": '\ud83e\udd19', + fitzpatrick_scale: true, + category: "people" + }, + "+1": { + keywords: [ "thumbsup", "yes", "awesome", "good", "agree", "accept", "cool", "hand", "like" ], + "char": '\ud83d\udc4d', + fitzpatrick_scale: true, + category: "people" + }, + "-1": { + keywords: [ "thumbsdown", "no", "dislike", "hand" ], + "char": '\ud83d\udc4e', + fitzpatrick_scale: true, + category: "people" + }, + facepunch: { + keywords: [ "angry", "violence", "fist", "hit", "attack", "hand" ], + "char": '\ud83d\udc4a', + fitzpatrick_scale: true, + category: "people" + }, + fist: { + keywords: [ "fingers", "hand", "grasp" ], + "char": '\u270a', + fitzpatrick_scale: true, + category: "people" + }, + fist_left: { + keywords: [ "hand", "fistbump" ], + "char": '\ud83e\udd1b', + fitzpatrick_scale: true, + category: "people" + }, + fist_right: { + keywords: [ "hand", "fistbump" ], + "char": '\ud83e\udd1c', + fitzpatrick_scale: true, + category: "people" + }, + v: { + keywords: [ "fingers", "ohyeah", "hand", "peace", "victory", "two" ], + "char": '\u270c', + fitzpatrick_scale: true, + category: "people" + }, + ok_hand: { + keywords: [ "fingers", "limbs", "perfect", "ok", "okay" ], + "char": '\ud83d\udc4c', + fitzpatrick_scale: true, + category: "people" + }, + raised_hand: { + keywords: [ "fingers", "stop", "highfive", "palm", "ban" ], + "char": '\u270b', + fitzpatrick_scale: true, + category: "people" + }, + raised_back_of_hand: { + keywords: [ "fingers", "raised", "backhand" ], + "char": '\ud83e\udd1a', + fitzpatrick_scale: true, + category: "people" + }, + open_hands: { + keywords: [ "fingers", "butterfly", "hands", "open" ], + "char": '\ud83d\udc50', + fitzpatrick_scale: true, + category: "people" + }, + muscle: { + keywords: [ "arm", "flex", "hand", "summer", "strong", "biceps" ], + "char": '\ud83d\udcaa', + fitzpatrick_scale: true, + category: "people" + }, + pray: { + keywords: [ "please", "hope", "wish", "namaste", "highfive" ], + "char": '\ud83d\ude4f', + fitzpatrick_scale: true, + category: "people" + }, + foot: { + keywords: [ "kick", "stomp" ], + "char": '\ud83e\uddb6', + fitzpatrick_scale: true, + category: "people" + }, + leg: { + keywords: [ "kick", "limb" ], + "char": '\ud83e\uddb5', + fitzpatrick_scale: true, + category: "people" + }, + handshake: { + keywords: [ "agreement", "shake" ], + "char": '\ud83e\udd1d', + fitzpatrick_scale: false, + category: "people" + }, + point_up: { + keywords: [ "hand", "fingers", "direction", "up" ], + "char": '\u261d', + fitzpatrick_scale: true, + category: "people" + }, + point_up_2: { + keywords: [ "fingers", "hand", "direction", "up" ], + "char": '\ud83d\udc46', + fitzpatrick_scale: true, + category: "people" + }, + point_down: { + keywords: [ "fingers", "hand", "direction", "down" ], + "char": '\ud83d\udc47', + fitzpatrick_scale: true, + category: "people" + }, + point_left: { + keywords: [ "direction", "fingers", "hand", "left" ], + "char": '\ud83d\udc48', + fitzpatrick_scale: true, + category: "people" + }, + point_right: { + keywords: [ "fingers", "hand", "direction", "right" ], + "char": '\ud83d\udc49', + fitzpatrick_scale: true, + category: "people" + }, + fu: { + keywords: [ "hand", "fingers", "rude", "middle", "flipping" ], + "char": '\ud83d\udd95', + fitzpatrick_scale: true, + category: "people" + }, + raised_hand_with_fingers_splayed: { + keywords: [ "hand", "fingers", "palm" ], + "char": '\ud83d\udd90', + fitzpatrick_scale: true, + category: "people" + }, + love_you: { + keywords: [ "hand", "fingers", "gesture" ], + "char": '\ud83e\udd1f', + fitzpatrick_scale: true, + category: "people" + }, + metal: { + keywords: [ "hand", "fingers", "evil_eye", "sign_of_horns", "rock_on" ], + "char": '\ud83e\udd18', + fitzpatrick_scale: true, + category: "people" + }, + crossed_fingers: { + keywords: [ "good", "lucky" ], + "char": '\ud83e\udd1e', + fitzpatrick_scale: true, + category: "people" + }, + vulcan_salute: { + keywords: [ "hand", "fingers", "spock", "star trek" ], + "char": '\ud83d\udd96', + fitzpatrick_scale: true, + category: "people" + }, + writing_hand: { + keywords: [ "lower_left_ballpoint_pen", "stationery", "write", "compose" ], + "char": '\u270d', + fitzpatrick_scale: true, + category: "people" + }, + selfie: { + keywords: [ "camera", "phone" ], + "char": '\ud83e\udd33', + fitzpatrick_scale: true, + category: "people" + }, + nail_care: { + keywords: [ "beauty", "manicure", "finger", "fashion", "nail" ], + "char": '\ud83d\udc85', + fitzpatrick_scale: true, + category: "people" + }, + lips: { + keywords: [ "mouth", "kiss" ], + "char": '\ud83d\udc44', + fitzpatrick_scale: false, + category: "people" + }, + tooth: { + keywords: [ "teeth", "dentist" ], + "char": '\ud83e\uddb7', + fitzpatrick_scale: false, + category: "people" + }, + tongue: { + keywords: [ "mouth", "playful" ], + "char": '\ud83d\udc45', + fitzpatrick_scale: false, + category: "people" + }, + ear: { + keywords: [ "face", "hear", "sound", "listen" ], + "char": '\ud83d\udc42', + fitzpatrick_scale: true, + category: "people" + }, + nose: { + keywords: [ "smell", "sniff" ], + "char": '\ud83d\udc43', + fitzpatrick_scale: true, + category: "people" + }, + eye: { + keywords: [ "face", "look", "see", "watch", "stare" ], + "char": '\ud83d\udc41', + fitzpatrick_scale: false, + category: "people" + }, + eyes: { + keywords: [ "look", "watch", "stalk", "peek", "see" ], + "char": '\ud83d\udc40', + fitzpatrick_scale: false, + category: "people" + }, + brain: { + keywords: [ "smart", "intelligent" ], + "char": '\ud83e\udde0', + fitzpatrick_scale: false, + category: "people" + }, + bust_in_silhouette: { + keywords: [ "user", "person", "human" ], + "char": '\ud83d\udc64', + fitzpatrick_scale: false, + category: "people" + }, + busts_in_silhouette: { + keywords: [ "user", "person", "human", "group", "team" ], + "char": '\ud83d\udc65', + fitzpatrick_scale: false, + category: "people" + }, + speaking_head: { + keywords: [ "user", "person", "human", "sing", "say", "talk" ], + "char": '\ud83d\udde3', + fitzpatrick_scale: false, + category: "people" + }, + baby: { + keywords: [ "child", "boy", "girl", "toddler" ], + "char": '\ud83d\udc76', + fitzpatrick_scale: true, + category: "people" + }, + child: { + keywords: [ "gender-neutral", "young" ], + "char": '\ud83e\uddd2', + fitzpatrick_scale: true, + category: "people" + }, + boy: { + keywords: [ "man", "male", "guy", "teenager" ], + "char": '\ud83d\udc66', + fitzpatrick_scale: true, + category: "people" + }, + girl: { + keywords: [ "female", "woman", "teenager" ], + "char": '\ud83d\udc67', + fitzpatrick_scale: true, + category: "people" + }, + adult: { + keywords: [ "gender-neutral", "person" ], + "char": '\ud83e\uddd1', + fitzpatrick_scale: true, + category: "people" + }, + man: { + keywords: [ "mustache", "father", "dad", "guy", "classy", "sir", "moustache" ], + "char": '\ud83d\udc68', + fitzpatrick_scale: true, + category: "people" + }, + woman: { + keywords: [ "female", "girls", "lady" ], + "char": '\ud83d\udc69', + fitzpatrick_scale: true, + category: "people" + }, + blonde_woman: { + keywords: [ "woman", "female", "girl", "blonde", "person" ], + "char": '\ud83d\udc71\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + blonde_man: { + keywords: [ "man", "male", "boy", "blonde", "guy", "person" ], + "char": '\ud83d\udc71', + fitzpatrick_scale: true, + category: "people" + }, + bearded_person: { + keywords: [ "person", "bewhiskered" ], + "char": '\ud83e\uddd4', + fitzpatrick_scale: true, + category: "people" + }, + older_adult: { + keywords: [ "human", "elder", "senior", "gender-neutral" ], + "char": '\ud83e\uddd3', + fitzpatrick_scale: true, + category: "people" + }, + older_man: { + keywords: [ "human", "male", "men", "old", "elder", "senior" ], + "char": '\ud83d\udc74', + fitzpatrick_scale: true, + category: "people" + }, + older_woman: { + keywords: [ "human", "female", "women", "lady", "old", "elder", "senior" ], + "char": '\ud83d\udc75', + fitzpatrick_scale: true, + category: "people" + }, + man_with_gua_pi_mao: { + keywords: [ "male", "boy", "chinese" ], + "char": '\ud83d\udc72', + fitzpatrick_scale: true, + category: "people" + }, + woman_with_headscarf: { + keywords: [ "female", "hijab", "mantilla", "tichel" ], + "char": '\ud83e\uddd5', + fitzpatrick_scale: true, + category: "people" + }, + woman_with_turban: { + keywords: [ "female", "indian", "hinduism", "arabs", "woman" ], + "char": '\ud83d\udc73\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + man_with_turban: { + keywords: [ "male", "indian", "hinduism", "arabs" ], + "char": '\ud83d\udc73', + fitzpatrick_scale: true, + category: "people" + }, + policewoman: { + keywords: [ "woman", "police", "law", "legal", "enforcement", "arrest", "911", "female" ], + "char": '\ud83d\udc6e\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + policeman: { + keywords: [ "man", "police", "law", "legal", "enforcement", "arrest", "911" ], + "char": '\ud83d\udc6e', + fitzpatrick_scale: true, + category: "people" + }, + construction_worker_woman: { + keywords: [ "female", "human", "wip", "build", "construction", "worker", "labor", "woman" ], + "char": '\ud83d\udc77\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + construction_worker_man: { + keywords: [ "male", "human", "wip", "guy", "build", "construction", "worker", "labor" ], + "char": '\ud83d\udc77', + fitzpatrick_scale: true, + category: "people" + }, + guardswoman: { + keywords: [ "uk", "gb", "british", "female", "royal", "woman" ], + "char": '\ud83d\udc82\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + guardsman: { + keywords: [ "uk", "gb", "british", "male", "guy", "royal" ], + "char": '\ud83d\udc82', + fitzpatrick_scale: true, + category: "people" + }, + female_detective: { + keywords: [ "human", "spy", "detective", "female", "woman" ], + "char": '\ud83d\udd75\ufe0f\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + male_detective: { + keywords: [ "human", "spy", "detective" ], + "char": '\ud83d\udd75', + fitzpatrick_scale: true, + category: "people" + }, + woman_health_worker: { + keywords: [ "doctor", "nurse", "therapist", "healthcare", "woman", "human" ], + "char": '\ud83d\udc69\u200d\u2695\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + man_health_worker: { + keywords: [ "doctor", "nurse", "therapist", "healthcare", "man", "human" ], + "char": '\ud83d\udc68\u200d\u2695\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + woman_farmer: { + keywords: [ "rancher", "gardener", "woman", "human" ], + "char": '\ud83d\udc69\u200d\ud83c\udf3e', + fitzpatrick_scale: true, + category: "people" + }, + man_farmer: { + keywords: [ "rancher", "gardener", "man", "human" ], + "char": '\ud83d\udc68\u200d\ud83c\udf3e', + fitzpatrick_scale: true, + category: "people" + }, + woman_cook: { + keywords: [ "chef", "woman", "human" ], + "char": '\ud83d\udc69\u200d\ud83c\udf73', + fitzpatrick_scale: true, + category: "people" + }, + man_cook: { + keywords: [ "chef", "man", "human" ], + "char": '\ud83d\udc68\u200d\ud83c\udf73', + fitzpatrick_scale: true, + category: "people" + }, + woman_student: { + keywords: [ "graduate", "woman", "human" ], + "char": '\ud83d\udc69\u200d\ud83c\udf93', + fitzpatrick_scale: true, + category: "people" + }, + man_student: { + keywords: [ "graduate", "man", "human" ], + "char": '\ud83d\udc68\u200d\ud83c\udf93', + fitzpatrick_scale: true, + category: "people" + }, + woman_singer: { + keywords: [ "rockstar", "entertainer", "woman", "human" ], + "char": '\ud83d\udc69\u200d\ud83c\udfa4', + fitzpatrick_scale: true, + category: "people" + }, + man_singer: { + keywords: [ "rockstar", "entertainer", "man", "human" ], + "char": '\ud83d\udc68\u200d\ud83c\udfa4', + fitzpatrick_scale: true, + category: "people" + }, + woman_teacher: { + keywords: [ "instructor", "professor", "woman", "human" ], + "char": '\ud83d\udc69\u200d\ud83c\udfeb', + fitzpatrick_scale: true, + category: "people" + }, + man_teacher: { + keywords: [ "instructor", "professor", "man", "human" ], + "char": '\ud83d\udc68\u200d\ud83c\udfeb', + fitzpatrick_scale: true, + category: "people" + }, + woman_factory_worker: { + keywords: [ "assembly", "industrial", "woman", "human" ], + "char": '\ud83d\udc69\u200d\ud83c\udfed', + fitzpatrick_scale: true, + category: "people" + }, + man_factory_worker: { + keywords: [ "assembly", "industrial", "man", "human" ], + "char": '\ud83d\udc68\u200d\ud83c\udfed', + fitzpatrick_scale: true, + category: "people" + }, + woman_technologist: { + keywords: [ "coder", "developer", "engineer", "programmer", "software", "woman", "human", "laptop", "computer" ], + "char": '\ud83d\udc69\u200d\ud83d\udcbb', + fitzpatrick_scale: true, + category: "people" + }, + man_technologist: { + keywords: [ "coder", "developer", "engineer", "programmer", "software", "man", "human", "laptop", "computer" ], + "char": '\ud83d\udc68\u200d\ud83d\udcbb', + fitzpatrick_scale: true, + category: "people" + }, + woman_office_worker: { + keywords: [ "business", "manager", "woman", "human" ], + "char": '\ud83d\udc69\u200d\ud83d\udcbc', + fitzpatrick_scale: true, + category: "people" + }, + man_office_worker: { + keywords: [ "business", "manager", "man", "human" ], + "char": '\ud83d\udc68\u200d\ud83d\udcbc', + fitzpatrick_scale: true, + category: "people" + }, + woman_mechanic: { + keywords: [ "plumber", "woman", "human", "wrench" ], + "char": '\ud83d\udc69\u200d\ud83d\udd27', + fitzpatrick_scale: true, + category: "people" + }, + man_mechanic: { + keywords: [ "plumber", "man", "human", "wrench" ], + "char": '\ud83d\udc68\u200d\ud83d\udd27', + fitzpatrick_scale: true, + category: "people" + }, + woman_scientist: { + keywords: [ "biologist", "chemist", "engineer", "physicist", "woman", "human" ], + "char": '\ud83d\udc69\u200d\ud83d\udd2c', + fitzpatrick_scale: true, + category: "people" + }, + man_scientist: { + keywords: [ "biologist", "chemist", "engineer", "physicist", "man", "human" ], + "char": '\ud83d\udc68\u200d\ud83d\udd2c', + fitzpatrick_scale: true, + category: "people" + }, + woman_artist: { + keywords: [ "painter", "woman", "human" ], + "char": '\ud83d\udc69\u200d\ud83c\udfa8', + fitzpatrick_scale: true, + category: "people" + }, + man_artist: { + keywords: [ "painter", "man", "human" ], + "char": '\ud83d\udc68\u200d\ud83c\udfa8', + fitzpatrick_scale: true, + category: "people" + }, + woman_firefighter: { + keywords: [ "fireman", "woman", "human" ], + "char": '\ud83d\udc69\u200d\ud83d\ude92', + fitzpatrick_scale: true, + category: "people" + }, + man_firefighter: { + keywords: [ "fireman", "man", "human" ], + "char": '\ud83d\udc68\u200d\ud83d\ude92', + fitzpatrick_scale: true, + category: "people" + }, + woman_pilot: { + keywords: [ "aviator", "plane", "woman", "human" ], + "char": '\ud83d\udc69\u200d\u2708\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + man_pilot: { + keywords: [ "aviator", "plane", "man", "human" ], + "char": '\ud83d\udc68\u200d\u2708\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + woman_astronaut: { + keywords: [ "space", "rocket", "woman", "human" ], + "char": '\ud83d\udc69\u200d\ud83d\ude80', + fitzpatrick_scale: true, + category: "people" + }, + man_astronaut: { + keywords: [ "space", "rocket", "man", "human" ], + "char": '\ud83d\udc68\u200d\ud83d\ude80', + fitzpatrick_scale: true, + category: "people" + }, + woman_judge: { + keywords: [ "justice", "court", "woman", "human" ], + "char": '\ud83d\udc69\u200d\u2696\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + man_judge: { + keywords: [ "justice", "court", "man", "human" ], + "char": '\ud83d\udc68\u200d\u2696\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + woman_superhero: { + keywords: [ "woman", "female", "good", "heroine", "superpowers" ], + "char": '\ud83e\uddb8\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + man_superhero: { + keywords: [ "man", "male", "good", "hero", "superpowers" ], + "char": '\ud83e\uddb8\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + woman_supervillain: { + keywords: [ "woman", "female", "evil", "bad", "criminal", "heroine", "superpowers" ], + "char": '\ud83e\uddb9\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + man_supervillain: { + keywords: [ "man", "male", "evil", "bad", "criminal", "hero", "superpowers" ], + "char": '\ud83e\uddb9\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + mrs_claus: { + keywords: [ "woman", "female", "xmas", "mother christmas" ], + "char": '\ud83e\udd36', + fitzpatrick_scale: true, + category: "people" + }, + santa: { + keywords: [ "festival", "man", "male", "xmas", "father christmas" ], + "char": '\ud83c\udf85', + fitzpatrick_scale: true, + category: "people" + }, + sorceress: { + keywords: [ "woman", "female", "mage", "witch" ], + "char": '\ud83e\uddd9\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + wizard: { + keywords: [ "man", "male", "mage", "sorcerer" ], + "char": '\ud83e\uddd9\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + woman_elf: { + keywords: [ "woman", "female" ], + "char": '\ud83e\udddd\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + man_elf: { + keywords: [ "man", "male" ], + "char": '\ud83e\udddd\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + woman_vampire: { + keywords: [ "woman", "female" ], + "char": '\ud83e\udddb\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + man_vampire: { + keywords: [ "man", "male", "dracula" ], + "char": '\ud83e\udddb\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + woman_zombie: { + keywords: [ "woman", "female", "undead", "walking dead" ], + "char": '\ud83e\udddf\u200d\u2640\ufe0f', + fitzpatrick_scale: false, + category: "people" + }, + man_zombie: { + keywords: [ "man", "male", "dracula", "undead", "walking dead" ], + "char": '\ud83e\udddf\u200d\u2642\ufe0f', + fitzpatrick_scale: false, + category: "people" + }, + woman_genie: { + keywords: [ "woman", "female" ], + "char": '\ud83e\uddde\u200d\u2640\ufe0f', + fitzpatrick_scale: false, + category: "people" + }, + man_genie: { + keywords: [ "man", "male" ], + "char": '\ud83e\uddde\u200d\u2642\ufe0f', + fitzpatrick_scale: false, + category: "people" + }, + mermaid: { + keywords: [ "woman", "female", "merwoman", "ariel" ], + "char": '\ud83e\udddc\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + merman: { + keywords: [ "man", "male", "triton" ], + "char": '\ud83e\udddc\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + woman_fairy: { + keywords: [ "woman", "female" ], + "char": '\ud83e\uddda\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + man_fairy: { + keywords: [ "man", "male" ], + "char": '\ud83e\uddda\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + angel: { + keywords: [ "heaven", "wings", "halo" ], + "char": '\ud83d\udc7c', + fitzpatrick_scale: true, + category: "people" + }, + pregnant_woman: { + keywords: [ "baby" ], + "char": '\ud83e\udd30', + fitzpatrick_scale: true, + category: "people" + }, + breastfeeding: { + keywords: [ "nursing", "baby" ], + "char": '\ud83e\udd31', + fitzpatrick_scale: true, + category: "people" + }, + princess: { + keywords: [ "girl", "woman", "female", "blond", "crown", "royal", "queen" ], + "char": '\ud83d\udc78', + fitzpatrick_scale: true, + category: "people" + }, + prince: { + keywords: [ "boy", "man", "male", "crown", "royal", "king" ], + "char": '\ud83e\udd34', + fitzpatrick_scale: true, + category: "people" + }, + bride_with_veil: { + keywords: [ "couple", "marriage", "wedding", "woman", "bride" ], + "char": '\ud83d\udc70', + fitzpatrick_scale: true, + category: "people" + }, + man_in_tuxedo: { + keywords: [ "couple", "marriage", "wedding", "groom" ], + "char": '\ud83e\udd35', + fitzpatrick_scale: true, + category: "people" + }, + running_woman: { + keywords: [ "woman", "walking", "exercise", "race", "running", "female" ], + "char": '\ud83c\udfc3\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + running_man: { + keywords: [ "man", "walking", "exercise", "race", "running" ], + "char": '\ud83c\udfc3', + fitzpatrick_scale: true, + category: "people" + }, + walking_woman: { + keywords: [ "human", "feet", "steps", "woman", "female" ], + "char": '\ud83d\udeb6\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + walking_man: { + keywords: [ "human", "feet", "steps" ], + "char": '\ud83d\udeb6', + fitzpatrick_scale: true, + category: "people" + }, + dancer: { + keywords: [ "female", "girl", "woman", "fun" ], + "char": '\ud83d\udc83', + fitzpatrick_scale: true, + category: "people" + }, + man_dancing: { + keywords: [ "male", "boy", "fun", "dancer" ], + "char": '\ud83d\udd7a', + fitzpatrick_scale: true, + category: "people" + }, + dancing_women: { + keywords: [ "female", "bunny", "women", "girls" ], + "char": '\ud83d\udc6f', + fitzpatrick_scale: false, + category: "people" + }, + dancing_men: { + keywords: [ "male", "bunny", "men", "boys" ], + "char": '\ud83d\udc6f\u200d\u2642\ufe0f', + fitzpatrick_scale: false, + category: "people" + }, + couple: { + keywords: [ "pair", "people", "human", "love", "date", "dating", "like", "affection", "valentines", "marriage" ], + "char": '\ud83d\udc6b', + fitzpatrick_scale: false, + category: "people" + }, + two_men_holding_hands: { + keywords: [ "pair", "couple", "love", "like", "bromance", "friendship", "people", "human" ], + "char": '\ud83d\udc6c', + fitzpatrick_scale: false, + category: "people" + }, + two_women_holding_hands: { + keywords: [ "pair", "friendship", "couple", "love", "like", "female", "people", "human" ], + "char": '\ud83d\udc6d', + fitzpatrick_scale: false, + category: "people" + }, + bowing_woman: { + keywords: [ "woman", "female", "girl" ], + "char": '\ud83d\ude47\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + bowing_man: { + keywords: [ "man", "male", "boy" ], + "char": '\ud83d\ude47', + fitzpatrick_scale: true, + category: "people" + }, + man_facepalming: { + keywords: [ "man", "male", "boy", "disbelief" ], + "char": '\ud83e\udd26\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + woman_facepalming: { + keywords: [ "woman", "female", "girl", "disbelief" ], + "char": '\ud83e\udd26\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + woman_shrugging: { + keywords: [ "woman", "female", "girl", "confused", "indifferent", "doubt" ], + "char": '\ud83e\udd37', + fitzpatrick_scale: true, + category: "people" + }, + man_shrugging: { + keywords: [ "man", "male", "boy", "confused", "indifferent", "doubt" ], + "char": '\ud83e\udd37\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + tipping_hand_woman: { + keywords: [ "female", "girl", "woman", "human", "information" ], + "char": '\ud83d\udc81', + fitzpatrick_scale: true, + category: "people" + }, + tipping_hand_man: { + keywords: [ "male", "boy", "man", "human", "information" ], + "char": '\ud83d\udc81\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + no_good_woman: { + keywords: [ "female", "girl", "woman", "nope" ], + "char": '\ud83d\ude45', + fitzpatrick_scale: true, + category: "people" + }, + no_good_man: { + keywords: [ "male", "boy", "man", "nope" ], + "char": '\ud83d\ude45\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + ok_woman: { + keywords: [ "women", "girl", "female", "pink", "human", "woman" ], + "char": '\ud83d\ude46', + fitzpatrick_scale: true, + category: "people" + }, + ok_man: { + keywords: [ "men", "boy", "male", "blue", "human", "man" ], + "char": '\ud83d\ude46\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + raising_hand_woman: { + keywords: [ "female", "girl", "woman" ], + "char": '\ud83d\ude4b', + fitzpatrick_scale: true, + category: "people" + }, + raising_hand_man: { + keywords: [ "male", "boy", "man" ], + "char": '\ud83d\ude4b\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + pouting_woman: { + keywords: [ "female", "girl", "woman" ], + "char": '\ud83d\ude4e', + fitzpatrick_scale: true, + category: "people" + }, + pouting_man: { + keywords: [ "male", "boy", "man" ], + "char": '\ud83d\ude4e\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + frowning_woman: { + keywords: [ "female", "girl", "woman", "sad", "depressed", "discouraged", "unhappy" ], + "char": '\ud83d\ude4d', + fitzpatrick_scale: true, + category: "people" + }, + frowning_man: { + keywords: [ "male", "boy", "man", "sad", "depressed", "discouraged", "unhappy" ], + "char": '\ud83d\ude4d\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + haircut_woman: { + keywords: [ "female", "girl", "woman" ], + "char": '\ud83d\udc87', + fitzpatrick_scale: true, + category: "people" + }, + haircut_man: { + keywords: [ "male", "boy", "man" ], + "char": '\ud83d\udc87\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + massage_woman: { + keywords: [ "female", "girl", "woman", "head" ], + "char": '\ud83d\udc86', + fitzpatrick_scale: true, + category: "people" + }, + massage_man: { + keywords: [ "male", "boy", "man", "head" ], + "char": '\ud83d\udc86\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + woman_in_steamy_room: { + keywords: [ "female", "woman", "spa", "steamroom", "sauna" ], + "char": '\ud83e\uddd6\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + man_in_steamy_room: { + keywords: [ "male", "man", "spa", "steamroom", "sauna" ], + "char": '\ud83e\uddd6\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "people" + }, + couple_with_heart_woman_man: { + keywords: [ "pair", "love", "like", "affection", "human", "dating", "valentines", "marriage" ], + "char": '\ud83d\udc91', + fitzpatrick_scale: false, + category: "people" + }, + couple_with_heart_woman_woman: { + keywords: [ "pair", "love", "like", "affection", "human", "dating", "valentines", "marriage" ], + "char": '\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc69', + fitzpatrick_scale: false, + category: "people" + }, + couple_with_heart_man_man: { + keywords: [ "pair", "love", "like", "affection", "human", "dating", "valentines", "marriage" ], + "char": '\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68', + fitzpatrick_scale: false, + category: "people" + }, + couplekiss_man_woman: { + keywords: [ "pair", "valentines", "love", "like", "dating", "marriage" ], + "char": '\ud83d\udc8f', + fitzpatrick_scale: false, + category: "people" + }, + couplekiss_woman_woman: { + keywords: [ "pair", "valentines", "love", "like", "dating", "marriage" ], + "char": '\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69', + fitzpatrick_scale: false, + category: "people" + }, + couplekiss_man_man: { + keywords: [ "pair", "valentines", "love", "like", "dating", "marriage" ], + "char": '\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68', + fitzpatrick_scale: false, + category: "people" + }, + family_man_woman_boy: { + keywords: [ "home", "parents", "child", "mom", "dad", "father", "mother", "people", "human" ], + "char": '\ud83d\udc6a', + fitzpatrick_scale: false, + category: "people" + }, + family_man_woman_girl: { + keywords: [ "home", "parents", "people", "human", "child" ], + "char": '\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67', + fitzpatrick_scale: false, + category: "people" + }, + family_man_woman_girl_boy: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": '\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc66', + fitzpatrick_scale: false, + category: "people" + }, + family_man_woman_boy_boy: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": '\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66', + fitzpatrick_scale: false, + category: "people" + }, + family_man_woman_girl_girl: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": '\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc67', + fitzpatrick_scale: false, + category: "people" + }, + family_woman_woman_boy: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": '\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66', + fitzpatrick_scale: false, + category: "people" + }, + family_woman_woman_girl: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": '\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67', + fitzpatrick_scale: false, + category: "people" + }, + family_woman_woman_girl_boy: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": '\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc66', + fitzpatrick_scale: false, + category: "people" + }, + family_woman_woman_boy_boy: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": '\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66', + fitzpatrick_scale: false, + category: "people" + }, + family_woman_woman_girl_girl: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": '\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc67', + fitzpatrick_scale: false, + category: "people" + }, + family_man_man_boy: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": '\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66', + fitzpatrick_scale: false, + category: "people" + }, + family_man_man_girl: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": '\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67', + fitzpatrick_scale: false, + category: "people" + }, + family_man_man_girl_boy: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": '\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc66', + fitzpatrick_scale: false, + category: "people" + }, + family_man_man_boy_boy: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": '\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66', + fitzpatrick_scale: false, + category: "people" + }, + family_man_man_girl_girl: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": '\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc67', + fitzpatrick_scale: false, + category: "people" + }, + family_woman_boy: { + keywords: [ "home", "parent", "people", "human", "child" ], + "char": '\ud83d\udc69\u200d\ud83d\udc66', + fitzpatrick_scale: false, + category: "people" + }, + family_woman_girl: { + keywords: [ "home", "parent", "people", "human", "child" ], + "char": '\ud83d\udc69\u200d\ud83d\udc67', + fitzpatrick_scale: false, + category: "people" + }, + family_woman_girl_boy: { + keywords: [ "home", "parent", "people", "human", "children" ], + "char": '\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc66', + fitzpatrick_scale: false, + category: "people" + }, + family_woman_boy_boy: { + keywords: [ "home", "parent", "people", "human", "children" ], + "char": '\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66', + fitzpatrick_scale: false, + category: "people" + }, + family_woman_girl_girl: { + keywords: [ "home", "parent", "people", "human", "children" ], + "char": '\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc67', + fitzpatrick_scale: false, + category: "people" + }, + family_man_boy: { + keywords: [ "home", "parent", "people", "human", "child" ], + "char": '\ud83d\udc68\u200d\ud83d\udc66', + fitzpatrick_scale: false, + category: "people" + }, + family_man_girl: { + keywords: [ "home", "parent", "people", "human", "child" ], + "char": '\ud83d\udc68\u200d\ud83d\udc67', + fitzpatrick_scale: false, + category: "people" + }, + family_man_girl_boy: { + keywords: [ "home", "parent", "people", "human", "children" ], + "char": '\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc66', + fitzpatrick_scale: false, + category: "people" + }, + family_man_boy_boy: { + keywords: [ "home", "parent", "people", "human", "children" ], + "char": '\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66', + fitzpatrick_scale: false, + category: "people" + }, + family_man_girl_girl: { + keywords: [ "home", "parent", "people", "human", "children" ], + "char": '\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc67', + fitzpatrick_scale: false, + category: "people" + }, + yarn: { + keywords: [ "ball", "crochet", "knit" ], + "char": '\ud83e\uddf6', + fitzpatrick_scale: false, + category: "people" + }, + thread: { + keywords: [ "needle", "sewing", "spool", "string" ], + "char": '\ud83e\uddf5', + fitzpatrick_scale: false, + category: "people" + }, + coat: { + keywords: [ "jacket" ], + "char": '\ud83e\udde5', + fitzpatrick_scale: false, + category: "people" + }, + labcoat: { + keywords: [ "doctor", "experiment", "scientist", "chemist" ], + "char": '\ud83e\udd7c', + fitzpatrick_scale: false, + category: "people" + }, + womans_clothes: { + keywords: [ "fashion", "shopping_bags", "female" ], + "char": '\ud83d\udc5a', + fitzpatrick_scale: false, + category: "people" + }, + tshirt: { + keywords: [ "fashion", "cloth", "casual", "shirt", "tee" ], + "char": '\ud83d\udc55', + fitzpatrick_scale: false, + category: "people" + }, + jeans: { + keywords: [ "fashion", "shopping" ], + "char": '\ud83d\udc56', + fitzpatrick_scale: false, + category: "people" + }, + necktie: { + keywords: [ "shirt", "suitup", "formal", "fashion", "cloth", "business" ], + "char": '\ud83d\udc54', + fitzpatrick_scale: false, + category: "people" + }, + dress: { + keywords: [ "clothes", "fashion", "shopping" ], + "char": '\ud83d\udc57', + fitzpatrick_scale: false, + category: "people" + }, + bikini: { + keywords: [ "swimming", "female", "woman", "girl", "fashion", "beach", "summer" ], + "char": '\ud83d\udc59', + fitzpatrick_scale: false, + category: "people" + }, + kimono: { + keywords: [ "dress", "fashion", "women", "female", "japanese" ], + "char": '\ud83d\udc58', + fitzpatrick_scale: false, + category: "people" + }, + lipstick: { + keywords: [ "female", "girl", "fashion", "woman" ], + "char": '\ud83d\udc84', + fitzpatrick_scale: false, + category: "people" + }, + kiss: { + keywords: [ "face", "lips", "love", "like", "affection", "valentines" ], + "char": '\ud83d\udc8b', + fitzpatrick_scale: false, + category: "people" + }, + footprints: { + keywords: [ "feet", "tracking", "walking", "beach" ], + "char": '\ud83d\udc63', + fitzpatrick_scale: false, + category: "people" + }, + flat_shoe: { + keywords: [ "ballet", "slip-on", "slipper" ], + "char": '\ud83e\udd7f', + fitzpatrick_scale: false, + category: "people" + }, + high_heel: { + keywords: [ "fashion", "shoes", "female", "pumps", "stiletto" ], + "char": '\ud83d\udc60', + fitzpatrick_scale: false, + category: "people" + }, + sandal: { + keywords: [ "shoes", "fashion", "flip flops" ], + "char": '\ud83d\udc61', + fitzpatrick_scale: false, + category: "people" + }, + boot: { + keywords: [ "shoes", "fashion" ], + "char": '\ud83d\udc62', + fitzpatrick_scale: false, + category: "people" + }, + mans_shoe: { + keywords: [ "fashion", "male" ], + "char": '\ud83d\udc5e', + fitzpatrick_scale: false, + category: "people" + }, + athletic_shoe: { + keywords: [ "shoes", "sports", "sneakers" ], + "char": '\ud83d\udc5f', + fitzpatrick_scale: false, + category: "people" + }, + hiking_boot: { + keywords: [ "backpacking", "camping", "hiking" ], + "char": '\ud83e\udd7e', + fitzpatrick_scale: false, + category: "people" + }, + socks: { + keywords: [ "stockings", "clothes" ], + "char": '\ud83e\udde6', + fitzpatrick_scale: false, + category: "people" + }, + gloves: { + keywords: [ "hands", "winter", "clothes" ], + "char": '\ud83e\udde4', + fitzpatrick_scale: false, + category: "people" + }, + scarf: { + keywords: [ "neck", "winter", "clothes" ], + "char": '\ud83e\udde3', + fitzpatrick_scale: false, + category: "people" + }, + womans_hat: { + keywords: [ "fashion", "accessories", "female", "lady", "spring" ], + "char": '\ud83d\udc52', + fitzpatrick_scale: false, + category: "people" + }, + tophat: { + keywords: [ "magic", "gentleman", "classy", "circus" ], + "char": '\ud83c\udfa9', + fitzpatrick_scale: false, + category: "people" + }, + billed_hat: { + keywords: [ "cap", "baseball" ], + "char": '\ud83e\udde2', + fitzpatrick_scale: false, + category: "people" + }, + rescue_worker_helmet: { + keywords: [ "construction", "build" ], + "char": '\u26d1', + fitzpatrick_scale: false, + category: "people" + }, + mortar_board: { + keywords: [ "school", "college", "degree", "university", "graduation", "cap", "hat", "legal", "learn", "education" ], + "char": '\ud83c\udf93', + fitzpatrick_scale: false, + category: "people" + }, + crown: { + keywords: [ "king", "kod", "leader", "royalty", "lord" ], + "char": '\ud83d\udc51', + fitzpatrick_scale: false, + category: "people" + }, + school_satchel: { + keywords: [ "student", "education", "bag", "backpack" ], + "char": '\ud83c\udf92', + fitzpatrick_scale: false, + category: "people" + }, + luggage: { + keywords: [ "packing", "travel" ], + "char": '\ud83e\uddf3', + fitzpatrick_scale: false, + category: "people" + }, + pouch: { + keywords: [ "bag", "accessories", "shopping" ], + "char": '\ud83d\udc5d', + fitzpatrick_scale: false, + category: "people" + }, + purse: { + keywords: [ "fashion", "accessories", "money", "sales", "shopping" ], + "char": '\ud83d\udc5b', + fitzpatrick_scale: false, + category: "people" + }, + handbag: { + keywords: [ "fashion", "accessory", "accessories", "shopping" ], + "char": '\ud83d\udc5c', + fitzpatrick_scale: false, + category: "people" + }, + briefcase: { + keywords: [ "business", "documents", "work", "law", "legal", "job", "career" ], + "char": '\ud83d\udcbc', + fitzpatrick_scale: false, + category: "people" + }, + eyeglasses: { + keywords: [ "fashion", "accessories", "eyesight", "nerdy", "dork", "geek" ], + "char": '\ud83d\udc53', + fitzpatrick_scale: false, + category: "people" + }, + dark_sunglasses: { + keywords: [ "face", "cool", "accessories" ], + "char": '\ud83d\udd76', + fitzpatrick_scale: false, + category: "people" + }, + goggles: { + keywords: [ "eyes", "protection", "safety" ], + "char": '\ud83e\udd7d', + fitzpatrick_scale: false, + category: "people" + }, + ring: { + keywords: [ "wedding", "propose", "marriage", "valentines", "diamond", "fashion", "jewelry", "gem", "engagement" ], + "char": '\ud83d\udc8d', + fitzpatrick_scale: false, + category: "people" + }, + closed_umbrella: { + keywords: [ "weather", "rain", "drizzle" ], + "char": '\ud83c\udf02', + fitzpatrick_scale: false, + category: "people" + }, + dog: { + keywords: [ "animal", "friend", "nature", "woof", "puppy", "pet", "faithful" ], + "char": '\ud83d\udc36', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cat: { + keywords: [ "animal", "meow", "nature", "pet", "kitten" ], + "char": '\ud83d\udc31', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + mouse: { + keywords: [ "animal", "nature", "cheese_wedge", "rodent" ], + "char": '\ud83d\udc2d', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + hamster: { + keywords: [ "animal", "nature" ], + "char": '\ud83d\udc39', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + rabbit: { + keywords: [ "animal", "nature", "pet", "spring", "magic", "bunny" ], + "char": '\ud83d\udc30', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + fox_face: { + keywords: [ "animal", "nature", "face" ], + "char": '\ud83e\udd8a', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + bear: { + keywords: [ "animal", "nature", "wild" ], + "char": '\ud83d\udc3b', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + panda_face: { + keywords: [ "animal", "nature", "panda" ], + "char": '\ud83d\udc3c', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + koala: { + keywords: [ "animal", "nature" ], + "char": '\ud83d\udc28', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + tiger: { + keywords: [ "animal", "cat", "danger", "wild", "nature", "roar" ], + "char": '\ud83d\udc2f', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + lion: { + keywords: [ "animal", "nature" ], + "char": '\ud83e\udd81', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cow: { + keywords: [ "beef", "ox", "animal", "nature", "moo", "milk" ], + "char": '\ud83d\udc2e', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + pig: { + keywords: [ "animal", "oink", "nature" ], + "char": '\ud83d\udc37', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + pig_nose: { + keywords: [ "animal", "oink" ], + "char": '\ud83d\udc3d', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + frog: { + keywords: [ "animal", "nature", "croak", "toad" ], + "char": '\ud83d\udc38', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + squid: { + keywords: [ "animal", "nature", "ocean", "sea" ], + "char": '\ud83e\udd91', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + octopus: { + keywords: [ "animal", "creature", "ocean", "sea", "nature", "beach" ], + "char": '\ud83d\udc19', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + shrimp: { + keywords: [ "animal", "ocean", "nature", "seafood" ], + "char": '\ud83e\udd90', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + monkey_face: { + keywords: [ "animal", "nature", "circus" ], + "char": '\ud83d\udc35', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + gorilla: { + keywords: [ "animal", "nature", "circus" ], + "char": '\ud83e\udd8d', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + see_no_evil: { + keywords: [ "monkey", "animal", "nature", "haha" ], + "char": '\ud83d\ude48', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + hear_no_evil: { + keywords: [ "animal", "monkey", "nature" ], + "char": '\ud83d\ude49', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + speak_no_evil: { + keywords: [ "monkey", "animal", "nature", "omg" ], + "char": '\ud83d\ude4a', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + monkey: { + keywords: [ "animal", "nature", "banana", "circus" ], + "char": '\ud83d\udc12', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + chicken: { + keywords: [ "animal", "cluck", "nature", "bird" ], + "char": '\ud83d\udc14', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + penguin: { + keywords: [ "animal", "nature" ], + "char": '\ud83d\udc27', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + bird: { + keywords: [ "animal", "nature", "fly", "tweet", "spring" ], + "char": '\ud83d\udc26', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + baby_chick: { + keywords: [ "animal", "chicken", "bird" ], + "char": '\ud83d\udc24', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + hatching_chick: { + keywords: [ "animal", "chicken", "egg", "born", "baby", "bird" ], + "char": '\ud83d\udc23', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + hatched_chick: { + keywords: [ "animal", "chicken", "baby", "bird" ], + "char": '\ud83d\udc25', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + duck: { + keywords: [ "animal", "nature", "bird", "mallard" ], + "char": '\ud83e\udd86', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + eagle: { + keywords: [ "animal", "nature", "bird" ], + "char": '\ud83e\udd85', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + owl: { + keywords: [ "animal", "nature", "bird", "hoot" ], + "char": '\ud83e\udd89', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + bat: { + keywords: [ "animal", "nature", "blind", "vampire" ], + "char": '\ud83e\udd87', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + wolf: { + keywords: [ "animal", "nature", "wild" ], + "char": '\ud83d\udc3a', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + boar: { + keywords: [ "animal", "nature" ], + "char": '\ud83d\udc17', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + horse: { + keywords: [ "animal", "brown", "nature" ], + "char": '\ud83d\udc34', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + unicorn: { + keywords: [ "animal", "nature", "mystical" ], + "char": '\ud83e\udd84', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + honeybee: { + keywords: [ "animal", "insect", "nature", "bug", "spring", "honey" ], + "char": '\ud83d\udc1d', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + bug: { + keywords: [ "animal", "insect", "nature", "worm" ], + "char": '\ud83d\udc1b', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + butterfly: { + keywords: [ "animal", "insect", "nature", "caterpillar" ], + "char": '\ud83e\udd8b', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + snail: { + keywords: [ "slow", "animal", "shell" ], + "char": '\ud83d\udc0c', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + beetle: { + keywords: [ "animal", "insect", "nature", "ladybug" ], + "char": '\ud83d\udc1e', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + ant: { + keywords: [ "animal", "insect", "nature", "bug" ], + "char": '\ud83d\udc1c', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + grasshopper: { + keywords: [ "animal", "cricket", "chirp" ], + "char": '\ud83e\udd97', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + spider: { + keywords: [ "animal", "arachnid" ], + "char": '\ud83d\udd77', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + scorpion: { + keywords: [ "animal", "arachnid" ], + "char": '\ud83e\udd82', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + crab: { + keywords: [ "animal", "crustacean" ], + "char": '\ud83e\udd80', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + snake: { + keywords: [ "animal", "evil", "nature", "hiss", "python" ], + "char": '\ud83d\udc0d', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + lizard: { + keywords: [ "animal", "nature", "reptile" ], + "char": '\ud83e\udd8e', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + "t-rex": { + keywords: [ "animal", "nature", "dinosaur", "tyrannosaurus", "extinct" ], + "char": '\ud83e\udd96', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sauropod: { + keywords: [ "animal", "nature", "dinosaur", "brachiosaurus", "brontosaurus", "diplodocus", "extinct" ], + "char": '\ud83e\udd95', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + turtle: { + keywords: [ "animal", "slow", "nature", "tortoise" ], + "char": '\ud83d\udc22', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + tropical_fish: { + keywords: [ "animal", "swim", "ocean", "beach", "nemo" ], + "char": '\ud83d\udc20', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + fish: { + keywords: [ "animal", "food", "nature" ], + "char": '\ud83d\udc1f', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + blowfish: { + keywords: [ "animal", "nature", "food", "sea", "ocean" ], + "char": '\ud83d\udc21', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + dolphin: { + keywords: [ "animal", "nature", "fish", "sea", "ocean", "flipper", "fins", "beach" ], + "char": '\ud83d\udc2c', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + shark: { + keywords: [ "animal", "nature", "fish", "sea", "ocean", "jaws", "fins", "beach" ], + "char": '\ud83e\udd88', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + whale: { + keywords: [ "animal", "nature", "sea", "ocean" ], + "char": '\ud83d\udc33', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + whale2: { + keywords: [ "animal", "nature", "sea", "ocean" ], + "char": '\ud83d\udc0b', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + crocodile: { + keywords: [ "animal", "nature", "reptile", "lizard", "alligator" ], + "char": '\ud83d\udc0a', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + leopard: { + keywords: [ "animal", "nature" ], + "char": '\ud83d\udc06', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + zebra: { + keywords: [ "animal", "nature", "stripes", "safari" ], + "char": '\ud83e\udd93', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + tiger2: { + keywords: [ "animal", "nature", "roar" ], + "char": '\ud83d\udc05', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + water_buffalo: { + keywords: [ "animal", "nature", "ox", "cow" ], + "char": '\ud83d\udc03', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + ox: { + keywords: [ "animal", "cow", "beef" ], + "char": '\ud83d\udc02', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cow2: { + keywords: [ "beef", "ox", "animal", "nature", "moo", "milk" ], + "char": '\ud83d\udc04', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + deer: { + keywords: [ "animal", "nature", "horns", "venison" ], + "char": '\ud83e\udd8c', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + dromedary_camel: { + keywords: [ "animal", "hot", "desert", "hump" ], + "char": '\ud83d\udc2a', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + camel: { + keywords: [ "animal", "nature", "hot", "desert", "hump" ], + "char": '\ud83d\udc2b', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + giraffe: { + keywords: [ "animal", "nature", "spots", "safari" ], + "char": '\ud83e\udd92', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + elephant: { + keywords: [ "animal", "nature", "nose", "th", "circus" ], + "char": '\ud83d\udc18', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + rhinoceros: { + keywords: [ "animal", "nature", "horn" ], + "char": '\ud83e\udd8f', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + goat: { + keywords: [ "animal", "nature" ], + "char": '\ud83d\udc10', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + ram: { + keywords: [ "animal", "sheep", "nature" ], + "char": '\ud83d\udc0f', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sheep: { + keywords: [ "animal", "nature", "wool", "shipit" ], + "char": '\ud83d\udc11', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + racehorse: { + keywords: [ "animal", "gamble", "luck" ], + "char": '\ud83d\udc0e', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + pig2: { + keywords: [ "animal", "nature" ], + "char": '\ud83d\udc16', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + rat: { + keywords: [ "animal", "mouse", "rodent" ], + "char": '\ud83d\udc00', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + mouse2: { + keywords: [ "animal", "nature", "rodent" ], + "char": '\ud83d\udc01', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + rooster: { + keywords: [ "animal", "nature", "chicken" ], + "char": '\ud83d\udc13', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + turkey: { + keywords: [ "animal", "bird" ], + "char": '\ud83e\udd83', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + dove: { + keywords: [ "animal", "bird" ], + "char": '\ud83d\udd4a', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + dog2: { + keywords: [ "animal", "nature", "friend", "doge", "pet", "faithful" ], + "char": '\ud83d\udc15', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + poodle: { + keywords: [ "dog", "animal", "101", "nature", "pet" ], + "char": '\ud83d\udc29', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cat2: { + keywords: [ "animal", "meow", "pet", "cats" ], + "char": '\ud83d\udc08', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + rabbit2: { + keywords: [ "animal", "nature", "pet", "magic", "spring" ], + "char": '\ud83d\udc07', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + chipmunk: { + keywords: [ "animal", "nature", "rodent", "squirrel" ], + "char": '\ud83d\udc3f', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + hedgehog: { + keywords: [ "animal", "nature", "spiny" ], + "char": '\ud83e\udd94', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + raccoon: { + keywords: [ "animal", "nature" ], + "char": '\ud83e\udd9d', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + llama: { + keywords: [ "animal", "nature", "alpaca" ], + "char": '\ud83e\udd99', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + hippopotamus: { + keywords: [ "animal", "nature" ], + "char": '\ud83e\udd9b', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + kangaroo: { + keywords: [ "animal", "nature", "australia", "joey", "hop", "marsupial" ], + "char": '\ud83e\udd98', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + badger: { + keywords: [ "animal", "nature", "honey" ], + "char": '\ud83e\udda1', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + swan: { + keywords: [ "animal", "nature", "bird" ], + "char": '\ud83e\udda2', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + peacock: { + keywords: [ "animal", "nature", "peahen", "bird" ], + "char": '\ud83e\udd9a', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + parrot: { + keywords: [ "animal", "nature", "bird", "pirate", "talk" ], + "char": '\ud83e\udd9c', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + lobster: { + keywords: [ "animal", "nature", "bisque", "claws", "seafood" ], + "char": '\ud83e\udd9e', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + mosquito: { + keywords: [ "animal", "nature", "insect", "malaria" ], + "char": '\ud83e\udd9f', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + paw_prints: { + keywords: [ "animal", "tracking", "footprints", "dog", "cat", "pet", "feet" ], + "char": '\ud83d\udc3e', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + dragon: { + keywords: [ "animal", "myth", "nature", "chinese", "green" ], + "char": '\ud83d\udc09', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + dragon_face: { + keywords: [ "animal", "myth", "nature", "chinese", "green" ], + "char": '\ud83d\udc32', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cactus: { + keywords: [ "vegetable", "plant", "nature" ], + "char": '\ud83c\udf35', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + christmas_tree: { + keywords: [ "festival", "vacation", "december", "xmas", "celebration" ], + "char": '\ud83c\udf84', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + evergreen_tree: { + keywords: [ "plant", "nature" ], + "char": '\ud83c\udf32', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + deciduous_tree: { + keywords: [ "plant", "nature" ], + "char": '\ud83c\udf33', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + palm_tree: { + keywords: [ "plant", "vegetable", "nature", "summer", "beach", "mojito", "tropical" ], + "char": '\ud83c\udf34', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + seedling: { + keywords: [ "plant", "nature", "grass", "lawn", "spring" ], + "char": '\ud83c\udf31', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + herb: { + keywords: [ "vegetable", "plant", "medicine", "weed", "grass", "lawn" ], + "char": '\ud83c\udf3f', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + shamrock: { + keywords: [ "vegetable", "plant", "nature", "irish", "clover" ], + "char": '\u2618', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + four_leaf_clover: { + keywords: [ "vegetable", "plant", "nature", "lucky", "irish" ], + "char": '\ud83c\udf40', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + bamboo: { + keywords: [ "plant", "nature", "vegetable", "panda", "pine_decoration" ], + "char": '\ud83c\udf8d', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + tanabata_tree: { + keywords: [ "plant", "nature", "branch", "summer" ], + "char": '\ud83c\udf8b', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + leaves: { + keywords: [ "nature", "plant", "tree", "vegetable", "grass", "lawn", "spring" ], + "char": '\ud83c\udf43', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + fallen_leaf: { + keywords: [ "nature", "plant", "vegetable", "leaves" ], + "char": '\ud83c\udf42', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + maple_leaf: { + keywords: [ "nature", "plant", "vegetable", "ca", "fall" ], + "char": '\ud83c\udf41', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + ear_of_rice: { + keywords: [ "nature", "plant" ], + "char": '\ud83c\udf3e', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + hibiscus: { + keywords: [ "plant", "vegetable", "flowers", "beach" ], + "char": '\ud83c\udf3a', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sunflower: { + keywords: [ "nature", "plant", "fall" ], + "char": '\ud83c\udf3b', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + rose: { + keywords: [ "flowers", "valentines", "love", "spring" ], + "char": '\ud83c\udf39', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + wilted_flower: { + keywords: [ "plant", "nature", "flower" ], + "char": '\ud83e\udd40', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + tulip: { + keywords: [ "flowers", "plant", "nature", "summer", "spring" ], + "char": '\ud83c\udf37', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + blossom: { + keywords: [ "nature", "flowers", "yellow" ], + "char": '\ud83c\udf3c', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cherry_blossom: { + keywords: [ "nature", "plant", "spring", "flower" ], + "char": '\ud83c\udf38', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + bouquet: { + keywords: [ "flowers", "nature", "spring" ], + "char": '\ud83d\udc90', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + mushroom: { + keywords: [ "plant", "vegetable" ], + "char": '\ud83c\udf44', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + chestnut: { + keywords: [ "food", "squirrel" ], + "char": '\ud83c\udf30', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + jack_o_lantern: { + keywords: [ "halloween", "light", "pumpkin", "creepy", "fall" ], + "char": '\ud83c\udf83', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + shell: { + keywords: [ "nature", "sea", "beach" ], + "char": '\ud83d\udc1a', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + spider_web: { + keywords: [ "animal", "insect", "arachnid", "silk" ], + "char": '\ud83d\udd78', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + earth_americas: { + keywords: [ "globe", "world", "USA", "international" ], + "char": '\ud83c\udf0e', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + earth_africa: { + keywords: [ "globe", "world", "international" ], + "char": '\ud83c\udf0d', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + earth_asia: { + keywords: [ "globe", "world", "east", "international" ], + "char": '\ud83c\udf0f', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + full_moon: { + keywords: [ "nature", "yellow", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": '\ud83c\udf15', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + waning_gibbous_moon: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep", "waxing_gibbous_moon" ], + "char": '\ud83c\udf16', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + last_quarter_moon: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": '\ud83c\udf17', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + waning_crescent_moon: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": '\ud83c\udf18', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + new_moon: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": '\ud83c\udf11', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + waxing_crescent_moon: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": '\ud83c\udf12', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + first_quarter_moon: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": '\ud83c\udf13', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + waxing_gibbous_moon: { + keywords: [ "nature", "night", "sky", "gray", "twilight", "planet", "space", "evening", "sleep" ], + "char": '\ud83c\udf14', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + new_moon_with_face: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": '\ud83c\udf1a', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + full_moon_with_face: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": '\ud83c\udf1d', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + first_quarter_moon_with_face: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": '\ud83c\udf1b', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + last_quarter_moon_with_face: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": '\ud83c\udf1c', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sun_with_face: { + keywords: [ "nature", "morning", "sky" ], + "char": '\ud83c\udf1e', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + crescent_moon: { + keywords: [ "night", "sleep", "sky", "evening", "magic" ], + "char": '\ud83c\udf19', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + star: { + keywords: [ "night", "yellow" ], + "char": '\u2b50', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + star2: { + keywords: [ "night", "sparkle", "awesome", "good", "magic" ], + "char": '\ud83c\udf1f', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + dizzy: { + keywords: [ "star", "sparkle", "shoot", "magic" ], + "char": '\ud83d\udcab', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sparkles: { + keywords: [ "stars", "shine", "shiny", "cool", "awesome", "good", "magic" ], + "char": '\u2728', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + comet: { + keywords: [ "space" ], + "char": '\u2604', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sunny: { + keywords: [ "weather", "nature", "brightness", "summer", "beach", "spring" ], + "char": '\u2600\ufe0f', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sun_behind_small_cloud: { + keywords: [ "weather" ], + "char": '\ud83c\udf24', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + partly_sunny: { + keywords: [ "weather", "nature", "cloudy", "morning", "fall", "spring" ], + "char": '\u26c5', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sun_behind_large_cloud: { + keywords: [ "weather" ], + "char": '\ud83c\udf25', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sun_behind_rain_cloud: { + keywords: [ "weather" ], + "char": '\ud83c\udf26', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cloud: { + keywords: [ "weather", "sky" ], + "char": '\u2601\ufe0f', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cloud_with_rain: { + keywords: [ "weather" ], + "char": '\ud83c\udf27', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cloud_with_lightning_and_rain: { + keywords: [ "weather", "lightning" ], + "char": '\u26c8', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cloud_with_lightning: { + keywords: [ "weather", "thunder" ], + "char": '\ud83c\udf29', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + zap: { + keywords: [ "thunder", "weather", "lightning bolt", "fast" ], + "char": '\u26a1', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + fire: { + keywords: [ "hot", "cook", "flame" ], + "char": '\ud83d\udd25', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + boom: { + keywords: [ "bomb", "explode", "explosion", "collision", "blown" ], + "char": '\ud83d\udca5', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + snowflake: { + keywords: [ "winter", "season", "cold", "weather", "christmas", "xmas" ], + "char": '\u2744\ufe0f', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cloud_with_snow: { + keywords: [ "weather" ], + "char": '\ud83c\udf28', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + snowman: { + keywords: [ "winter", "season", "cold", "weather", "christmas", "xmas", "frozen", "without_snow" ], + "char": '\u26c4', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + snowman_with_snow: { + keywords: [ "winter", "season", "cold", "weather", "christmas", "xmas", "frozen" ], + "char": '\u2603', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + wind_face: { + keywords: [ "gust", "air" ], + "char": '\ud83c\udf2c', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + dash: { + keywords: [ "wind", "air", "fast", "shoo", "fart", "smoke", "puff" ], + "char": '\ud83d\udca8', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + tornado: { + keywords: [ "weather", "cyclone", "twister" ], + "char": '\ud83c\udf2a', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + fog: { + keywords: [ "weather" ], + "char": '\ud83c\udf2b', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + open_umbrella: { + keywords: [ "weather", "spring" ], + "char": '\u2602', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + umbrella: { + keywords: [ "rainy", "weather", "spring" ], + "char": '\u2614', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + droplet: { + keywords: [ "water", "drip", "faucet", "spring" ], + "char": '\ud83d\udca7', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sweat_drops: { + keywords: [ "water", "drip", "oops" ], + "char": '\ud83d\udca6', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + ocean: { + keywords: [ "sea", "water", "wave", "nature", "tsunami", "disaster" ], + "char": '\ud83c\udf0a', + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + green_apple: { + keywords: [ "fruit", "nature" ], + "char": '\ud83c\udf4f', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + apple: { + keywords: [ "fruit", "mac", "school" ], + "char": '\ud83c\udf4e', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + pear: { + keywords: [ "fruit", "nature", "food" ], + "char": '\ud83c\udf50', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + tangerine: { + keywords: [ "food", "fruit", "nature", "orange" ], + "char": '\ud83c\udf4a', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + lemon: { + keywords: [ "fruit", "nature" ], + "char": '\ud83c\udf4b', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + banana: { + keywords: [ "fruit", "food", "monkey" ], + "char": '\ud83c\udf4c', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + watermelon: { + keywords: [ "fruit", "food", "picnic", "summer" ], + "char": '\ud83c\udf49', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + grapes: { + keywords: [ "fruit", "food", "wine" ], + "char": '\ud83c\udf47', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + strawberry: { + keywords: [ "fruit", "food", "nature" ], + "char": '\ud83c\udf53', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + melon: { + keywords: [ "fruit", "nature", "food" ], + "char": '\ud83c\udf48', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + cherries: { + keywords: [ "food", "fruit" ], + "char": '\ud83c\udf52', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + peach: { + keywords: [ "fruit", "nature", "food" ], + "char": '\ud83c\udf51', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + pineapple: { + keywords: [ "fruit", "nature", "food" ], + "char": '\ud83c\udf4d', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + coconut: { + keywords: [ "fruit", "nature", "food", "palm" ], + "char": '\ud83e\udd65', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + kiwi_fruit: { + keywords: [ "fruit", "food" ], + "char": '\ud83e\udd5d', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + mango: { + keywords: [ "fruit", "food", "tropical" ], + "char": '\ud83e\udd6d', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + avocado: { + keywords: [ "fruit", "food" ], + "char": '\ud83e\udd51', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + broccoli: { + keywords: [ "fruit", "food", "vegetable" ], + "char": '\ud83e\udd66', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + tomato: { + keywords: [ "fruit", "vegetable", "nature", "food" ], + "char": '\ud83c\udf45', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + eggplant: { + keywords: [ "vegetable", "nature", "food", "aubergine" ], + "char": '\ud83c\udf46', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + cucumber: { + keywords: [ "fruit", "food", "pickle" ], + "char": '\ud83e\udd52', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + carrot: { + keywords: [ "vegetable", "food", "orange" ], + "char": '\ud83e\udd55', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + hot_pepper: { + keywords: [ "food", "spicy", "chilli", "chili" ], + "char": '\ud83c\udf36', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + potato: { + keywords: [ "food", "tuber", "vegatable", "starch" ], + "char": '\ud83e\udd54', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + corn: { + keywords: [ "food", "vegetable", "plant" ], + "char": '\ud83c\udf3d', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + leafy_greens: { + keywords: [ "food", "vegetable", "plant", "bok choy", "cabbage", "kale", "lettuce" ], + "char": '\ud83e\udd6c', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + sweet_potato: { + keywords: [ "food", "nature" ], + "char": '\ud83c\udf60', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + peanuts: { + keywords: [ "food", "nut" ], + "char": '\ud83e\udd5c', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + honey_pot: { + keywords: [ "bees", "sweet", "kitchen" ], + "char": '\ud83c\udf6f', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + croissant: { + keywords: [ "food", "bread", "french" ], + "char": '\ud83e\udd50', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + bread: { + keywords: [ "food", "wheat", "breakfast", "toast" ], + "char": '\ud83c\udf5e', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + baguette_bread: { + keywords: [ "food", "bread", "french" ], + "char": '\ud83e\udd56', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + bagel: { + keywords: [ "food", "bread", "bakery", "schmear" ], + "char": '\ud83e\udd6f', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + pretzel: { + keywords: [ "food", "bread", "twisted" ], + "char": '\ud83e\udd68', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + cheese: { + keywords: [ "food", "chadder" ], + "char": '\ud83e\uddc0', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + egg: { + keywords: [ "food", "chicken", "breakfast" ], + "char": '\ud83e\udd5a', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + bacon: { + keywords: [ "food", "breakfast", "pork", "pig", "meat" ], + "char": '\ud83e\udd53', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + steak: { + keywords: [ "food", "cow", "meat", "cut", "chop", "lambchop", "porkchop" ], + "char": '\ud83e\udd69', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + pancakes: { + keywords: [ "food", "breakfast", "flapjacks", "hotcakes" ], + "char": '\ud83e\udd5e', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + poultry_leg: { + keywords: [ "food", "meat", "drumstick", "bird", "chicken", "turkey" ], + "char": '\ud83c\udf57', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + meat_on_bone: { + keywords: [ "good", "food", "drumstick" ], + "char": '\ud83c\udf56', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + bone: { + keywords: [ "skeleton" ], + "char": '\ud83e\uddb4', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + fried_shrimp: { + keywords: [ "food", "animal", "appetizer", "summer" ], + "char": '\ud83c\udf64', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + fried_egg: { + keywords: [ "food", "breakfast", "kitchen", "egg" ], + "char": '\ud83c\udf73', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + hamburger: { + keywords: [ "meat", "fast food", "beef", "cheeseburger", "mcdonalds", "burger king" ], + "char": '\ud83c\udf54', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + fries: { + keywords: [ "chips", "snack", "fast food" ], + "char": '\ud83c\udf5f', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + stuffed_flatbread: { + keywords: [ "food", "flatbread", "stuffed", "gyro" ], + "char": '\ud83e\udd59', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + hotdog: { + keywords: [ "food", "frankfurter" ], + "char": '\ud83c\udf2d', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + pizza: { + keywords: [ "food", "party" ], + "char": '\ud83c\udf55', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + sandwich: { + keywords: [ "food", "lunch", "bread" ], + "char": '\ud83e\udd6a', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + canned_food: { + keywords: [ "food", "soup" ], + "char": '\ud83e\udd6b', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + spaghetti: { + keywords: [ "food", "italian", "noodle" ], + "char": '\ud83c\udf5d', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + taco: { + keywords: [ "food", "mexican" ], + "char": '\ud83c\udf2e', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + burrito: { + keywords: [ "food", "mexican" ], + "char": '\ud83c\udf2f', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + green_salad: { + keywords: [ "food", "healthy", "lettuce" ], + "char": '\ud83e\udd57', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + shallow_pan_of_food: { + keywords: [ "food", "cooking", "casserole", "paella" ], + "char": '\ud83e\udd58', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + ramen: { + keywords: [ "food", "japanese", "noodle", "chopsticks" ], + "char": '\ud83c\udf5c', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + stew: { + keywords: [ "food", "meat", "soup" ], + "char": '\ud83c\udf72', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + fish_cake: { + keywords: [ "food", "japan", "sea", "beach", "narutomaki", "pink", "swirl", "kamaboko", "surimi", "ramen" ], + "char": '\ud83c\udf65', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + fortune_cookie: { + keywords: [ "food", "prophecy" ], + "char": '\ud83e\udd60', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + sushi: { + keywords: [ "food", "fish", "japanese", "rice" ], + "char": '\ud83c\udf63', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + bento: { + keywords: [ "food", "japanese", "box" ], + "char": '\ud83c\udf71', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + curry: { + keywords: [ "food", "spicy", "hot", "indian" ], + "char": '\ud83c\udf5b', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + rice_ball: { + keywords: [ "food", "japanese" ], + "char": '\ud83c\udf59', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + rice: { + keywords: [ "food", "china", "asian" ], + "char": '\ud83c\udf5a', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + rice_cracker: { + keywords: [ "food", "japanese" ], + "char": '\ud83c\udf58', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + oden: { + keywords: [ "food", "japanese" ], + "char": '\ud83c\udf62', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + dango: { + keywords: [ "food", "dessert", "sweet", "japanese", "barbecue", "meat" ], + "char": '\ud83c\udf61', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + shaved_ice: { + keywords: [ "hot", "dessert", "summer" ], + "char": '\ud83c\udf67', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + ice_cream: { + keywords: [ "food", "hot", "dessert" ], + "char": '\ud83c\udf68', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + icecream: { + keywords: [ "food", "hot", "dessert", "summer" ], + "char": '\ud83c\udf66', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + pie: { + keywords: [ "food", "dessert", "pastry" ], + "char": '\ud83e\udd67', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + cake: { + keywords: [ "food", "dessert" ], + "char": '\ud83c\udf70', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + cupcake: { + keywords: [ "food", "dessert", "bakery", "sweet" ], + "char": '\ud83e\uddc1', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + moon_cake: { + keywords: [ "food", "autumn" ], + "char": '\ud83e\udd6e', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + birthday: { + keywords: [ "food", "dessert", "cake" ], + "char": '\ud83c\udf82', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + custard: { + keywords: [ "dessert", "food" ], + "char": '\ud83c\udf6e', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + candy: { + keywords: [ "snack", "dessert", "sweet", "lolly" ], + "char": '\ud83c\udf6c', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + lollipop: { + keywords: [ "food", "snack", "candy", "sweet" ], + "char": '\ud83c\udf6d', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + chocolate_bar: { + keywords: [ "food", "snack", "dessert", "sweet" ], + "char": '\ud83c\udf6b', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + popcorn: { + keywords: [ "food", "movie theater", "films", "snack" ], + "char": '\ud83c\udf7f', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + dumpling: { + keywords: [ "food", "empanada", "pierogi", "potsticker" ], + "char": '\ud83e\udd5f', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + doughnut: { + keywords: [ "food", "dessert", "snack", "sweet", "donut" ], + "char": '\ud83c\udf69', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + cookie: { + keywords: [ "food", "snack", "oreo", "chocolate", "sweet", "dessert" ], + "char": '\ud83c\udf6a', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + milk_glass: { + keywords: [ "beverage", "drink", "cow" ], + "char": '\ud83e\udd5b', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + beer: { + keywords: [ "relax", "beverage", "drink", "drunk", "party", "pub", "summer", "alcohol", "booze" ], + "char": '\ud83c\udf7a', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + beers: { + keywords: [ "relax", "beverage", "drink", "drunk", "party", "pub", "summer", "alcohol", "booze" ], + "char": '\ud83c\udf7b', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + clinking_glasses: { + keywords: [ "beverage", "drink", "party", "alcohol", "celebrate", "cheers", "wine", "champagne", "toast" ], + "char": '\ud83e\udd42', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + wine_glass: { + keywords: [ "drink", "beverage", "drunk", "alcohol", "booze" ], + "char": '\ud83c\udf77', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + tumbler_glass: { + keywords: [ "drink", "beverage", "drunk", "alcohol", "liquor", "booze", "bourbon", "scotch", "whisky", "glass", "shot" ], + "char": '\ud83e\udd43', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + cocktail: { + keywords: [ "drink", "drunk", "alcohol", "beverage", "booze", "mojito" ], + "char": '\ud83c\udf78', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + tropical_drink: { + keywords: [ "beverage", "cocktail", "summer", "beach", "alcohol", "booze", "mojito" ], + "char": '\ud83c\udf79', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + champagne: { + keywords: [ "drink", "wine", "bottle", "celebration" ], + "char": '\ud83c\udf7e', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + sake: { + keywords: [ "wine", "drink", "drunk", "beverage", "japanese", "alcohol", "booze" ], + "char": '\ud83c\udf76', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + tea: { + keywords: [ "drink", "bowl", "breakfast", "green", "british" ], + "char": '\ud83c\udf75', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + cup_with_straw: { + keywords: [ "drink", "soda" ], + "char": '\ud83e\udd64', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + coffee: { + keywords: [ "beverage", "caffeine", "latte", "espresso" ], + "char": '\u2615', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + baby_bottle: { + keywords: [ "food", "container", "milk" ], + "char": '\ud83c\udf7c', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + salt: { + keywords: [ "condiment", "shaker" ], + "char": '\ud83e\uddc2', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + spoon: { + keywords: [ "cutlery", "kitchen", "tableware" ], + "char": '\ud83e\udd44', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + fork_and_knife: { + keywords: [ "cutlery", "kitchen" ], + "char": '\ud83c\udf74', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + plate_with_cutlery: { + keywords: [ "food", "eat", "meal", "lunch", "dinner", "restaurant" ], + "char": '\ud83c\udf7d', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + bowl_with_spoon: { + keywords: [ "food", "breakfast", "cereal", "oatmeal", "porridge" ], + "char": '\ud83e\udd63', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + takeout_box: { + keywords: [ "food", "leftovers" ], + "char": '\ud83e\udd61', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + chopsticks: { + keywords: [ "food" ], + "char": '\ud83e\udd62', + fitzpatrick_scale: false, + category: "food_and_drink" + }, + soccer: { + keywords: [ "sports", "football" ], + "char": '\u26bd', + fitzpatrick_scale: false, + category: "activity" + }, + basketball: { + keywords: [ "sports", "balls", "NBA" ], + "char": '\ud83c\udfc0', + fitzpatrick_scale: false, + category: "activity" + }, + football: { + keywords: [ "sports", "balls", "NFL" ], + "char": '\ud83c\udfc8', + fitzpatrick_scale: false, + category: "activity" + }, + baseball: { + keywords: [ "sports", "balls" ], + "char": '\u26be', + fitzpatrick_scale: false, + category: "activity" + }, + softball: { + keywords: [ "sports", "balls" ], + "char": '\ud83e\udd4e', + fitzpatrick_scale: false, + category: "activity" + }, + tennis: { + keywords: [ "sports", "balls", "green" ], + "char": '\ud83c\udfbe', + fitzpatrick_scale: false, + category: "activity" + }, + volleyball: { + keywords: [ "sports", "balls" ], + "char": '\ud83c\udfd0', + fitzpatrick_scale: false, + category: "activity" + }, + rugby_football: { + keywords: [ "sports", "team" ], + "char": '\ud83c\udfc9', + fitzpatrick_scale: false, + category: "activity" + }, + flying_disc: { + keywords: [ "sports", "frisbee", "ultimate" ], + "char": '\ud83e\udd4f', + fitzpatrick_scale: false, + category: "activity" + }, + "8ball": { + keywords: [ "pool", "hobby", "game", "luck", "magic" ], + "char": '\ud83c\udfb1', + fitzpatrick_scale: false, + category: "activity" + }, + golf: { + keywords: [ "sports", "business", "flag", "hole", "summer" ], + "char": '\u26f3', + fitzpatrick_scale: false, + category: "activity" + }, + golfing_woman: { + keywords: [ "sports", "business", "woman", "female" ], + "char": '\ud83c\udfcc\ufe0f\u200d\u2640\ufe0f', + fitzpatrick_scale: false, + category: "activity" + }, + golfing_man: { + keywords: [ "sports", "business" ], + "char": '\ud83c\udfcc', + fitzpatrick_scale: true, + category: "activity" + }, + ping_pong: { + keywords: [ "sports", "pingpong" ], + "char": '\ud83c\udfd3', + fitzpatrick_scale: false, + category: "activity" + }, + badminton: { + keywords: [ "sports" ], + "char": '\ud83c\udff8', + fitzpatrick_scale: false, + category: "activity" + }, + goal_net: { + keywords: [ "sports" ], + "char": '\ud83e\udd45', + fitzpatrick_scale: false, + category: "activity" + }, + ice_hockey: { + keywords: [ "sports" ], + "char": '\ud83c\udfd2', + fitzpatrick_scale: false, + category: "activity" + }, + field_hockey: { + keywords: [ "sports" ], + "char": '\ud83c\udfd1', + fitzpatrick_scale: false, + category: "activity" + }, + lacrosse: { + keywords: [ "sports", "ball", "stick" ], + "char": '\ud83e\udd4d', + fitzpatrick_scale: false, + category: "activity" + }, + cricket: { + keywords: [ "sports" ], + "char": '\ud83c\udfcf', + fitzpatrick_scale: false, + category: "activity" + }, + ski: { + keywords: [ "sports", "winter", "cold", "snow" ], + "char": '\ud83c\udfbf', + fitzpatrick_scale: false, + category: "activity" + }, + skier: { + keywords: [ "sports", "winter", "snow" ], + "char": '\u26f7', + fitzpatrick_scale: false, + category: "activity" + }, + snowboarder: { + keywords: [ "sports", "winter" ], + "char": '\ud83c\udfc2', + fitzpatrick_scale: true, + category: "activity" + }, + person_fencing: { + keywords: [ "sports", "fencing", "sword" ], + "char": '\ud83e\udd3a', + fitzpatrick_scale: false, + category: "activity" + }, + women_wrestling: { + keywords: [ "sports", "wrestlers" ], + "char": '\ud83e\udd3c\u200d\u2640\ufe0f', + fitzpatrick_scale: false, + category: "activity" + }, + men_wrestling: { + keywords: [ "sports", "wrestlers" ], + "char": '\ud83e\udd3c\u200d\u2642\ufe0f', + fitzpatrick_scale: false, + category: "activity" + }, + woman_cartwheeling: { + keywords: [ "gymnastics" ], + "char": '\ud83e\udd38\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "activity" + }, + man_cartwheeling: { + keywords: [ "gymnastics" ], + "char": '\ud83e\udd38\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "activity" + }, + woman_playing_handball: { + keywords: [ "sports" ], + "char": '\ud83e\udd3e\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "activity" + }, + man_playing_handball: { + keywords: [ "sports" ], + "char": '\ud83e\udd3e\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "activity" + }, + ice_skate: { + keywords: [ "sports" ], + "char": '\u26f8', + fitzpatrick_scale: false, + category: "activity" + }, + curling_stone: { + keywords: [ "sports" ], + "char": '\ud83e\udd4c', + fitzpatrick_scale: false, + category: "activity" + }, + skateboard: { + keywords: [ "board" ], + "char": '\ud83d\udef9', + fitzpatrick_scale: false, + category: "activity" + }, + sled: { + keywords: [ "sleigh", "luge", "toboggan" ], + "char": '\ud83d\udef7', + fitzpatrick_scale: false, + category: "activity" + }, + bow_and_arrow: { + keywords: [ "sports" ], + "char": '\ud83c\udff9', + fitzpatrick_scale: false, + category: "activity" + }, + fishing_pole_and_fish: { + keywords: [ "food", "hobby", "summer" ], + "char": '\ud83c\udfa3', + fitzpatrick_scale: false, + category: "activity" + }, + boxing_glove: { + keywords: [ "sports", "fighting" ], + "char": '\ud83e\udd4a', + fitzpatrick_scale: false, + category: "activity" + }, + martial_arts_uniform: { + keywords: [ "judo", "karate", "taekwondo" ], + "char": '\ud83e\udd4b', + fitzpatrick_scale: false, + category: "activity" + }, + rowing_woman: { + keywords: [ "sports", "hobby", "water", "ship", "woman", "female" ], + "char": '\ud83d\udea3\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "activity" + }, + rowing_man: { + keywords: [ "sports", "hobby", "water", "ship" ], + "char": '\ud83d\udea3', + fitzpatrick_scale: true, + category: "activity" + }, + climbing_woman: { + keywords: [ "sports", "hobby", "woman", "female", "rock" ], + "char": '\ud83e\uddd7\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "activity" + }, + climbing_man: { + keywords: [ "sports", "hobby", "man", "male", "rock" ], + "char": '\ud83e\uddd7\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "activity" + }, + swimming_woman: { + keywords: [ "sports", "exercise", "human", "athlete", "water", "summer", "woman", "female" ], + "char": '\ud83c\udfca\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "activity" + }, + swimming_man: { + keywords: [ "sports", "exercise", "human", "athlete", "water", "summer" ], + "char": '\ud83c\udfca', + fitzpatrick_scale: true, + category: "activity" + }, + woman_playing_water_polo: { + keywords: [ "sports", "pool" ], + "char": '\ud83e\udd3d\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "activity" + }, + man_playing_water_polo: { + keywords: [ "sports", "pool" ], + "char": '\ud83e\udd3d\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "activity" + }, + woman_in_lotus_position: { + keywords: [ "woman", "female", "meditation", "yoga", "serenity", "zen", "mindfulness" ], + "char": '\ud83e\uddd8\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "activity" + }, + man_in_lotus_position: { + keywords: [ "man", "male", "meditation", "yoga", "serenity", "zen", "mindfulness" ], + "char": '\ud83e\uddd8\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "activity" + }, + surfing_woman: { + keywords: [ "sports", "ocean", "sea", "summer", "beach", "woman", "female" ], + "char": '\ud83c\udfc4\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "activity" + }, + surfing_man: { + keywords: [ "sports", "ocean", "sea", "summer", "beach" ], + "char": '\ud83c\udfc4', + fitzpatrick_scale: true, + category: "activity" + }, + bath: { + keywords: [ "clean", "shower", "bathroom" ], + "char": '\ud83d\udec0', + fitzpatrick_scale: true, + category: "activity" + }, + basketball_woman: { + keywords: [ "sports", "human", "woman", "female" ], + "char": '\u26f9\ufe0f\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "activity" + }, + basketball_man: { + keywords: [ "sports", "human" ], + "char": '\u26f9', + fitzpatrick_scale: true, + category: "activity" + }, + weight_lifting_woman: { + keywords: [ "sports", "training", "exercise", "woman", "female" ], + "char": '\ud83c\udfcb\ufe0f\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "activity" + }, + weight_lifting_man: { + keywords: [ "sports", "training", "exercise" ], + "char": '\ud83c\udfcb', + fitzpatrick_scale: true, + category: "activity" + }, + biking_woman: { + keywords: [ "sports", "bike", "exercise", "hipster", "woman", "female" ], + "char": '\ud83d\udeb4\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "activity" + }, + biking_man: { + keywords: [ "sports", "bike", "exercise", "hipster" ], + "char": '\ud83d\udeb4', + fitzpatrick_scale: true, + category: "activity" + }, + mountain_biking_woman: { + keywords: [ "transportation", "sports", "human", "race", "bike", "woman", "female" ], + "char": '\ud83d\udeb5\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "activity" + }, + mountain_biking_man: { + keywords: [ "transportation", "sports", "human", "race", "bike" ], + "char": '\ud83d\udeb5', + fitzpatrick_scale: true, + category: "activity" + }, + horse_racing: { + keywords: [ "animal", "betting", "competition", "gambling", "luck" ], + "char": '\ud83c\udfc7', + fitzpatrick_scale: true, + category: "activity" + }, + business_suit_levitating: { + keywords: [ "suit", "business", "levitate", "hover", "jump" ], + "char": '\ud83d\udd74', + fitzpatrick_scale: true, + category: "activity" + }, + trophy: { + keywords: [ "win", "award", "contest", "place", "ftw", "ceremony" ], + "char": '\ud83c\udfc6', + fitzpatrick_scale: false, + category: "activity" + }, + running_shirt_with_sash: { + keywords: [ "play", "pageant" ], + "char": '\ud83c\udfbd', + fitzpatrick_scale: false, + category: "activity" + }, + medal_sports: { + keywords: [ "award", "winning" ], + "char": '\ud83c\udfc5', + fitzpatrick_scale: false, + category: "activity" + }, + medal_military: { + keywords: [ "award", "winning", "army" ], + "char": '\ud83c\udf96', + fitzpatrick_scale: false, + category: "activity" + }, + "1st_place_medal": { + keywords: [ "award", "winning", "first" ], + "char": '\ud83e\udd47', + fitzpatrick_scale: false, + category: "activity" + }, + "2nd_place_medal": { + keywords: [ "award", "second" ], + "char": '\ud83e\udd48', + fitzpatrick_scale: false, + category: "activity" + }, + "3rd_place_medal": { + keywords: [ "award", "third" ], + "char": '\ud83e\udd49', + fitzpatrick_scale: false, + category: "activity" + }, + reminder_ribbon: { + keywords: [ "sports", "cause", "support", "awareness" ], + "char": '\ud83c\udf97', + fitzpatrick_scale: false, + category: "activity" + }, + rosette: { + keywords: [ "flower", "decoration", "military" ], + "char": '\ud83c\udff5', + fitzpatrick_scale: false, + category: "activity" + }, + ticket: { + keywords: [ "event", "concert", "pass" ], + "char": '\ud83c\udfab', + fitzpatrick_scale: false, + category: "activity" + }, + tickets: { + keywords: [ "sports", "concert", "entrance" ], + "char": '\ud83c\udf9f', + fitzpatrick_scale: false, + category: "activity" + }, + performing_arts: { + keywords: [ "acting", "theater", "drama" ], + "char": '\ud83c\udfad', + fitzpatrick_scale: false, + category: "activity" + }, + art: { + keywords: [ "design", "paint", "draw", "colors" ], + "char": '\ud83c\udfa8', + fitzpatrick_scale: false, + category: "activity" + }, + circus_tent: { + keywords: [ "festival", "carnival", "party" ], + "char": '\ud83c\udfaa', + fitzpatrick_scale: false, + category: "activity" + }, + woman_juggling: { + keywords: [ "juggle", "balance", "skill", "multitask" ], + "char": '\ud83e\udd39\u200d\u2640\ufe0f', + fitzpatrick_scale: true, + category: "activity" + }, + man_juggling: { + keywords: [ "juggle", "balance", "skill", "multitask" ], + "char": '\ud83e\udd39\u200d\u2642\ufe0f', + fitzpatrick_scale: true, + category: "activity" + }, + microphone: { + keywords: [ "sound", "music", "PA", "sing", "talkshow" ], + "char": '\ud83c\udfa4', + fitzpatrick_scale: false, + category: "activity" + }, + headphones: { + keywords: [ "music", "score", "gadgets" ], + "char": '\ud83c\udfa7', + fitzpatrick_scale: false, + category: "activity" + }, + musical_score: { + keywords: [ "treble", "clef", "compose" ], + "char": '\ud83c\udfbc', + fitzpatrick_scale: false, + category: "activity" + }, + musical_keyboard: { + keywords: [ "piano", "instrument", "compose" ], + "char": '\ud83c\udfb9', + fitzpatrick_scale: false, + category: "activity" + }, + drum: { + keywords: [ "music", "instrument", "drumsticks", "snare" ], + "char": '\ud83e\udd41', + fitzpatrick_scale: false, + category: "activity" + }, + saxophone: { + keywords: [ "music", "instrument", "jazz", "blues" ], + "char": '\ud83c\udfb7', + fitzpatrick_scale: false, + category: "activity" + }, + trumpet: { + keywords: [ "music", "brass" ], + "char": '\ud83c\udfba', + fitzpatrick_scale: false, + category: "activity" + }, + guitar: { + keywords: [ "music", "instrument" ], + "char": '\ud83c\udfb8', + fitzpatrick_scale: false, + category: "activity" + }, + violin: { + keywords: [ "music", "instrument", "orchestra", "symphony" ], + "char": '\ud83c\udfbb', + fitzpatrick_scale: false, + category: "activity" + }, + clapper: { + keywords: [ "movie", "film", "record" ], + "char": '\ud83c\udfac', + fitzpatrick_scale: false, + category: "activity" + }, + video_game: { + keywords: [ "play", "console", "PS4", "controller" ], + "char": '\ud83c\udfae', + fitzpatrick_scale: false, + category: "activity" + }, + space_invader: { + keywords: [ "game", "arcade", "play" ], + "char": '\ud83d\udc7e', + fitzpatrick_scale: false, + category: "activity" + }, + dart: { + keywords: [ "game", "play", "bar", "target", "bullseye" ], + "char": '\ud83c\udfaf', + fitzpatrick_scale: false, + category: "activity" + }, + game_die: { + keywords: [ "dice", "random", "tabletop", "play", "luck" ], + "char": '\ud83c\udfb2', + fitzpatrick_scale: false, + category: "activity" + }, + chess_pawn: { + keywords: [ "expendable" ], + "char": "\u265f", + fitzpatrick_scale: false, + category: "activity" + }, + slot_machine: { + keywords: [ "bet", "gamble", "vegas", "fruit machine", "luck", "casino" ], + "char": '\ud83c\udfb0', + fitzpatrick_scale: false, + category: "activity" + }, + jigsaw: { + keywords: [ "interlocking", "puzzle", "piece" ], + "char": '\ud83e\udde9', + fitzpatrick_scale: false, + category: "activity" + }, + bowling: { + keywords: [ "sports", "fun", "play" ], + "char": '\ud83c\udfb3', + fitzpatrick_scale: false, + category: "activity" + }, + red_car: { + keywords: [ "red", "transportation", "vehicle" ], + "char": '\ud83d\ude97', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + taxi: { + keywords: [ "uber", "vehicle", "cars", "transportation" ], + "char": '\ud83d\ude95', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + blue_car: { + keywords: [ "transportation", "vehicle" ], + "char": '\ud83d\ude99', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + bus: { + keywords: [ "car", "vehicle", "transportation" ], + "char": '\ud83d\ude8c', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + trolleybus: { + keywords: [ "bart", "transportation", "vehicle" ], + "char": '\ud83d\ude8e', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + racing_car: { + keywords: [ "sports", "race", "fast", "formula", "f1" ], + "char": '\ud83c\udfce', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + police_car: { + keywords: [ "vehicle", "cars", "transportation", "law", "legal", "enforcement" ], + "char": '\ud83d\ude93', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + ambulance: { + keywords: [ "health", "911", "hospital" ], + "char": '\ud83d\ude91', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + fire_engine: { + keywords: [ "transportation", "cars", "vehicle" ], + "char": '\ud83d\ude92', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + minibus: { + keywords: [ "vehicle", "car", "transportation" ], + "char": '\ud83d\ude90', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + truck: { + keywords: [ "cars", "transportation" ], + "char": '\ud83d\ude9a', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + articulated_lorry: { + keywords: [ "vehicle", "cars", "transportation", "express" ], + "char": '\ud83d\ude9b', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + tractor: { + keywords: [ "vehicle", "car", "farming", "agriculture" ], + "char": '\ud83d\ude9c', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + kick_scooter: { + keywords: [ "vehicle", "kick", "razor" ], + "char": '\ud83d\udef4', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + motorcycle: { + keywords: [ "race", "sports", "fast" ], + "char": '\ud83c\udfcd', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + bike: { + keywords: [ "sports", "bicycle", "exercise", "hipster" ], + "char": '\ud83d\udeb2', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + motor_scooter: { + keywords: [ "vehicle", "vespa", "sasha" ], + "char": '\ud83d\udef5', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + rotating_light: { + keywords: [ "police", "ambulance", "911", "emergency", "alert", "error", "pinged", "law", "legal" ], + "char": '\ud83d\udea8', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + oncoming_police_car: { + keywords: [ "vehicle", "law", "legal", "enforcement", "911" ], + "char": '\ud83d\ude94', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + oncoming_bus: { + keywords: [ "vehicle", "transportation" ], + "char": '\ud83d\ude8d', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + oncoming_automobile: { + keywords: [ "car", "vehicle", "transportation" ], + "char": '\ud83d\ude98', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + oncoming_taxi: { + keywords: [ "vehicle", "cars", "uber" ], + "char": '\ud83d\ude96', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + aerial_tramway: { + keywords: [ "transportation", "vehicle", "ski" ], + "char": '\ud83d\udea1', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + mountain_cableway: { + keywords: [ "transportation", "vehicle", "ski" ], + "char": '\ud83d\udea0', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + suspension_railway: { + keywords: [ "vehicle", "transportation" ], + "char": '\ud83d\ude9f', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + railway_car: { + keywords: [ "transportation", "vehicle" ], + "char": '\ud83d\ude83', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + train: { + keywords: [ "transportation", "vehicle", "carriage", "public", "travel" ], + "char": '\ud83d\ude8b', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + monorail: { + keywords: [ "transportation", "vehicle" ], + "char": '\ud83d\ude9d', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + bullettrain_side: { + keywords: [ "transportation", "vehicle" ], + "char": '\ud83d\ude84', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + bullettrain_front: { + keywords: [ "transportation", "vehicle", "speed", "fast", "public", "travel" ], + "char": '\ud83d\ude85', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + light_rail: { + keywords: [ "transportation", "vehicle" ], + "char": '\ud83d\ude88', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + mountain_railway: { + keywords: [ "transportation", "vehicle" ], + "char": '\ud83d\ude9e', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + steam_locomotive: { + keywords: [ "transportation", "vehicle", "train" ], + "char": '\ud83d\ude82', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + train2: { + keywords: [ "transportation", "vehicle" ], + "char": '\ud83d\ude86', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + metro: { + keywords: [ "transportation", "blue-square", "mrt", "underground", "tube" ], + "char": '\ud83d\ude87', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + tram: { + keywords: [ "transportation", "vehicle" ], + "char": '\ud83d\ude8a', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + station: { + keywords: [ "transportation", "vehicle", "public" ], + "char": '\ud83d\ude89', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + flying_saucer: { + keywords: [ "transportation", "vehicle", "ufo" ], + "char": '\ud83d\udef8', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + helicopter: { + keywords: [ "transportation", "vehicle", "fly" ], + "char": '\ud83d\ude81', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + small_airplane: { + keywords: [ "flight", "transportation", "fly", "vehicle" ], + "char": '\ud83d\udee9', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + airplane: { + keywords: [ "vehicle", "transportation", "flight", "fly" ], + "char": '\u2708\ufe0f', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + flight_departure: { + keywords: [ "airport", "flight", "landing" ], + "char": '\ud83d\udeeb', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + flight_arrival: { + keywords: [ "airport", "flight", "boarding" ], + "char": '\ud83d\udeec', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + sailboat: { + keywords: [ "ship", "summer", "transportation", "water", "sailing" ], + "char": '\u26f5', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + motor_boat: { + keywords: [ "ship" ], + "char": '\ud83d\udee5', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + speedboat: { + keywords: [ "ship", "transportation", "vehicle", "summer" ], + "char": '\ud83d\udea4', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + ferry: { + keywords: [ "boat", "ship", "yacht" ], + "char": '\u26f4', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + passenger_ship: { + keywords: [ "yacht", "cruise", "ferry" ], + "char": '\ud83d\udef3', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + rocket: { + keywords: [ "launch", "ship", "staffmode", "NASA", "outer space", "outer_space", "fly" ], + "char": '\ud83d\ude80', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + artificial_satellite: { + keywords: [ "communication", "gps", "orbit", "spaceflight", "NASA", "ISS" ], + "char": '\ud83d\udef0', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + seat: { + keywords: [ "sit", "airplane", "transport", "bus", "flight", "fly" ], + "char": '\ud83d\udcba', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + canoe: { + keywords: [ "boat", "paddle", "water", "ship" ], + "char": '\ud83d\udef6', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + anchor: { + keywords: [ "ship", "ferry", "sea", "boat" ], + "char": '\u2693', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + construction: { + keywords: [ "wip", "progress", "caution", "warning" ], + "char": '\ud83d\udea7', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + fuelpump: { + keywords: [ "gas station", "petroleum" ], + "char": '\u26fd', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + busstop: { + keywords: [ "transportation", "wait" ], + "char": '\ud83d\ude8f', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + vertical_traffic_light: { + keywords: [ "transportation", "driving" ], + "char": '\ud83d\udea6', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + traffic_light: { + keywords: [ "transportation", "signal" ], + "char": '\ud83d\udea5', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + checkered_flag: { + keywords: [ "contest", "finishline", "race", "gokart" ], + "char": '\ud83c\udfc1', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + ship: { + keywords: [ "transportation", "titanic", "deploy" ], + "char": '\ud83d\udea2', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + ferris_wheel: { + keywords: [ "photo", "carnival", "londoneye" ], + "char": '\ud83c\udfa1', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + roller_coaster: { + keywords: [ "carnival", "playground", "photo", "fun" ], + "char": '\ud83c\udfa2', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + carousel_horse: { + keywords: [ "photo", "carnival" ], + "char": '\ud83c\udfa0', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + building_construction: { + keywords: [ "wip", "working", "progress" ], + "char": '\ud83c\udfd7', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + foggy: { + keywords: [ "photo", "mountain" ], + "char": '\ud83c\udf01', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + tokyo_tower: { + keywords: [ "photo", "japanese" ], + "char": '\ud83d\uddfc', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + factory: { + keywords: [ "building", "industry", "pollution", "smoke" ], + "char": '\ud83c\udfed', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + fountain: { + keywords: [ "photo", "summer", "water", "fresh" ], + "char": '\u26f2', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + rice_scene: { + keywords: [ "photo", "japan", "asia", "tsukimi" ], + "char": '\ud83c\udf91', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + mountain: { + keywords: [ "photo", "nature", "environment" ], + "char": '\u26f0', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + mountain_snow: { + keywords: [ "photo", "nature", "environment", "winter", "cold" ], + "char": '\ud83c\udfd4', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + mount_fuji: { + keywords: [ "photo", "mountain", "nature", "japanese" ], + "char": '\ud83d\uddfb', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + volcano: { + keywords: [ "photo", "nature", "disaster" ], + "char": '\ud83c\udf0b', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + japan: { + keywords: [ "nation", "country", "japanese", "asia" ], + "char": '\ud83d\uddfe', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + camping: { + keywords: [ "photo", "outdoors", "tent" ], + "char": '\ud83c\udfd5', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + tent: { + keywords: [ "photo", "camping", "outdoors" ], + "char": '\u26fa', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + national_park: { + keywords: [ "photo", "environment", "nature" ], + "char": '\ud83c\udfde', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + motorway: { + keywords: [ "road", "cupertino", "interstate", "highway" ], + "char": '\ud83d\udee3', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + railway_track: { + keywords: [ "train", "transportation" ], + "char": '\ud83d\udee4', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + sunrise: { + keywords: [ "morning", "view", "vacation", "photo" ], + "char": '\ud83c\udf05', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + sunrise_over_mountains: { + keywords: [ "view", "vacation", "photo" ], + "char": '\ud83c\udf04', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + desert: { + keywords: [ "photo", "warm", "saharah" ], + "char": '\ud83c\udfdc', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + beach_umbrella: { + keywords: [ "weather", "summer", "sunny", "sand", "mojito" ], + "char": '\ud83c\udfd6', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + desert_island: { + keywords: [ "photo", "tropical", "mojito" ], + "char": '\ud83c\udfdd', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + city_sunrise: { + keywords: [ "photo", "good morning", "dawn" ], + "char": '\ud83c\udf07', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + city_sunset: { + keywords: [ "photo", "evening", "sky", "buildings" ], + "char": '\ud83c\udf06', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + cityscape: { + keywords: [ "photo", "night life", "urban" ], + "char": '\ud83c\udfd9', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + night_with_stars: { + keywords: [ "evening", "city", "downtown" ], + "char": '\ud83c\udf03', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + bridge_at_night: { + keywords: [ "photo", "sanfrancisco" ], + "char": '\ud83c\udf09', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + milky_way: { + keywords: [ "photo", "space", "stars" ], + "char": '\ud83c\udf0c', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + stars: { + keywords: [ "night", "photo" ], + "char": '\ud83c\udf20', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + sparkler: { + keywords: [ "stars", "night", "shine" ], + "char": '\ud83c\udf87', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + fireworks: { + keywords: [ "photo", "festival", "carnival", "congratulations" ], + "char": '\ud83c\udf86', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + rainbow: { + keywords: [ "nature", "happy", "unicorn_face", "photo", "sky", "spring" ], + "char": '\ud83c\udf08', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + houses: { + keywords: [ "buildings", "photo" ], + "char": '\ud83c\udfd8', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + european_castle: { + keywords: [ "building", "royalty", "history" ], + "char": '\ud83c\udff0', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + japanese_castle: { + keywords: [ "photo", "building" ], + "char": '\ud83c\udfef', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + stadium: { + keywords: [ "photo", "place", "sports", "concert", "venue" ], + "char": '\ud83c\udfdf', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + statue_of_liberty: { + keywords: [ "american", "newyork" ], + "char": '\ud83d\uddfd', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + house: { + keywords: [ "building", "home" ], + "char": '\ud83c\udfe0', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + house_with_garden: { + keywords: [ "home", "plant", "nature" ], + "char": '\ud83c\udfe1', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + derelict_house: { + keywords: [ "abandon", "evict", "broken", "building" ], + "char": '\ud83c\udfda', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + office: { + keywords: [ "building", "bureau", "work" ], + "char": '\ud83c\udfe2', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + department_store: { + keywords: [ "building", "shopping", "mall" ], + "char": '\ud83c\udfec', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + post_office: { + keywords: [ "building", "envelope", "communication" ], + "char": '\ud83c\udfe3', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + european_post_office: { + keywords: [ "building", "email" ], + "char": '\ud83c\udfe4', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + hospital: { + keywords: [ "building", "health", "surgery", "doctor" ], + "char": '\ud83c\udfe5', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + bank: { + keywords: [ "building", "money", "sales", "cash", "business", "enterprise" ], + "char": '\ud83c\udfe6', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + hotel: { + keywords: [ "building", "accomodation", "checkin" ], + "char": '\ud83c\udfe8', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + convenience_store: { + keywords: [ "building", "shopping", "groceries" ], + "char": '\ud83c\udfea', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + school: { + keywords: [ "building", "student", "education", "learn", "teach" ], + "char": '\ud83c\udfeb', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + love_hotel: { + keywords: [ "like", "affection", "dating" ], + "char": '\ud83c\udfe9', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + wedding: { + keywords: [ "love", "like", "affection", "couple", "marriage", "bride", "groom" ], + "char": '\ud83d\udc92', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + classical_building: { + keywords: [ "art", "culture", "history" ], + "char": '\ud83c\udfdb', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + church: { + keywords: [ "building", "religion", "christ" ], + "char": '\u26ea', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + mosque: { + keywords: [ "islam", "worship", "minaret" ], + "char": '\ud83d\udd4c', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + synagogue: { + keywords: [ "judaism", "worship", "temple", "jewish" ], + "char": '\ud83d\udd4d', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + kaaba: { + keywords: [ "mecca", "mosque", "islam" ], + "char": '\ud83d\udd4b', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + shinto_shrine: { + keywords: [ "temple", "japan", "kyoto" ], + "char": '\u26e9', + fitzpatrick_scale: false, + category: "travel_and_places" + }, + watch: { + keywords: [ "time", "accessories" ], + "char": '\u231a', + fitzpatrick_scale: false, + category: "objects" + }, + iphone: { + keywords: [ "technology", "apple", "gadgets", "dial" ], + "char": '\ud83d\udcf1', + fitzpatrick_scale: false, + category: "objects" + }, + calling: { + keywords: [ "iphone", "incoming" ], + "char": '\ud83d\udcf2', + fitzpatrick_scale: false, + category: "objects" + }, + computer: { + keywords: [ "technology", "laptop", "screen", "display", "monitor" ], + "char": '\ud83d\udcbb', + fitzpatrick_scale: false, + category: "objects" + }, + keyboard: { + keywords: [ "technology", "computer", "type", "input", "text" ], + "char": '\u2328', + fitzpatrick_scale: false, + category: "objects" + }, + desktop_computer: { + keywords: [ "technology", "computing", "screen" ], + "char": '\ud83d\udda5', + fitzpatrick_scale: false, + category: "objects" + }, + printer: { + keywords: [ "paper", "ink" ], + "char": '\ud83d\udda8', + fitzpatrick_scale: false, + category: "objects" + }, + computer_mouse: { + keywords: [ "click" ], + "char": '\ud83d\uddb1', + fitzpatrick_scale: false, + category: "objects" + }, + trackball: { + keywords: [ "technology", "trackpad" ], + "char": '\ud83d\uddb2', + fitzpatrick_scale: false, + category: "objects" + }, + joystick: { + keywords: [ "game", "play" ], + "char": '\ud83d\udd79', + fitzpatrick_scale: false, + category: "objects" + }, + clamp: { + keywords: [ "tool" ], + "char": '\ud83d\udddc', + fitzpatrick_scale: false, + category: "objects" + }, + minidisc: { + keywords: [ "technology", "record", "data", "disk", "90s" ], + "char": '\ud83d\udcbd', + fitzpatrick_scale: false, + category: "objects" + }, + floppy_disk: { + keywords: [ "oldschool", "technology", "save", "90s", "80s" ], + "char": '\ud83d\udcbe', + fitzpatrick_scale: false, + category: "objects" + }, + cd: { + keywords: [ "technology", "dvd", "disk", "disc", "90s" ], + "char": '\ud83d\udcbf', + fitzpatrick_scale: false, + category: "objects" + }, + dvd: { + keywords: [ "cd", "disk", "disc" ], + "char": '\ud83d\udcc0', + fitzpatrick_scale: false, + category: "objects" + }, + vhs: { + keywords: [ "record", "video", "oldschool", "90s", "80s" ], + "char": '\ud83d\udcfc', + fitzpatrick_scale: false, + category: "objects" + }, + camera: { + keywords: [ "gadgets", "photography" ], + "char": '\ud83d\udcf7', + fitzpatrick_scale: false, + category: "objects" + }, + camera_flash: { + keywords: [ "photography", "gadgets" ], + "char": '\ud83d\udcf8', + fitzpatrick_scale: false, + category: "objects" + }, + video_camera: { + keywords: [ "film", "record" ], + "char": '\ud83d\udcf9', + fitzpatrick_scale: false, + category: "objects" + }, + movie_camera: { + keywords: [ "film", "record" ], + "char": '\ud83c\udfa5', + fitzpatrick_scale: false, + category: "objects" + }, + film_projector: { + keywords: [ "video", "tape", "record", "movie" ], + "char": '\ud83d\udcfd', + fitzpatrick_scale: false, + category: "objects" + }, + film_strip: { + keywords: [ "movie" ], + "char": '\ud83c\udf9e', + fitzpatrick_scale: false, + category: "objects" + }, + telephone_receiver: { + keywords: [ "technology", "communication", "dial" ], + "char": '\ud83d\udcde', + fitzpatrick_scale: false, + category: "objects" + }, + phone: { + keywords: [ "technology", "communication", "dial", "telephone" ], + "char": '\u260e\ufe0f', + fitzpatrick_scale: false, + category: "objects" + }, + pager: { + keywords: [ "bbcall", "oldschool", "90s" ], + "char": '\ud83d\udcdf', + fitzpatrick_scale: false, + category: "objects" + }, + fax: { + keywords: [ "communication", "technology" ], + "char": '\ud83d\udce0', + fitzpatrick_scale: false, + category: "objects" + }, + tv: { + keywords: [ "technology", "program", "oldschool", "show", "television" ], + "char": '\ud83d\udcfa', + fitzpatrick_scale: false, + category: "objects" + }, + radio: { + keywords: [ "communication", "music", "podcast", "program" ], + "char": '\ud83d\udcfb', + fitzpatrick_scale: false, + category: "objects" + }, + studio_microphone: { + keywords: [ "sing", "recording", "artist", "talkshow" ], + "char": '\ud83c\udf99', + fitzpatrick_scale: false, + category: "objects" + }, + level_slider: { + keywords: [ "scale" ], + "char": '\ud83c\udf9a', + fitzpatrick_scale: false, + category: "objects" + }, + control_knobs: { + keywords: [ "dial" ], + "char": '\ud83c\udf9b', + fitzpatrick_scale: false, + category: "objects" + }, + compass: { + keywords: [ "magnetic", "navigation", "orienteering" ], + "char": '\ud83e\udded', + fitzpatrick_scale: false, + category: "objects" + }, + stopwatch: { + keywords: [ "time", "deadline" ], + "char": '\u23f1', + fitzpatrick_scale: false, + category: "objects" + }, + timer_clock: { + keywords: [ "alarm" ], + "char": '\u23f2', + fitzpatrick_scale: false, + category: "objects" + }, + alarm_clock: { + keywords: [ "time", "wake" ], + "char": '\u23f0', + fitzpatrick_scale: false, + category: "objects" + }, + mantelpiece_clock: { + keywords: [ "time" ], + "char": '\ud83d\udd70', + fitzpatrick_scale: false, + category: "objects" + }, + hourglass_flowing_sand: { + keywords: [ "oldschool", "time", "countdown" ], + "char": '\u23f3', + fitzpatrick_scale: false, + category: "objects" + }, + hourglass: { + keywords: [ "time", "clock", "oldschool", "limit", "exam", "quiz", "test" ], + "char": '\u231b', + fitzpatrick_scale: false, + category: "objects" + }, + satellite: { + keywords: [ "communication", "future", "radio", "space" ], + "char": '\ud83d\udce1', + fitzpatrick_scale: false, + category: "objects" + }, + battery: { + keywords: [ "power", "energy", "sustain" ], + "char": '\ud83d\udd0b', + fitzpatrick_scale: false, + category: "objects" + }, + electric_plug: { + keywords: [ "charger", "power" ], + "char": '\ud83d\udd0c', + fitzpatrick_scale: false, + category: "objects" + }, + bulb: { + keywords: [ "light", "electricity", "idea" ], + "char": '\ud83d\udca1', + fitzpatrick_scale: false, + category: "objects" + }, + flashlight: { + keywords: [ "dark", "camping", "sight", "night" ], + "char": '\ud83d\udd26', + fitzpatrick_scale: false, + category: "objects" + }, + candle: { + keywords: [ "fire", "wax" ], + "char": '\ud83d\udd6f', + fitzpatrick_scale: false, + category: "objects" + }, + fire_extinguisher: { + keywords: [ "quench" ], + "char": '\ud83e\uddef', + fitzpatrick_scale: false, + category: "objects" + }, + wastebasket: { + keywords: [ "bin", "trash", "rubbish", "garbage", "toss" ], + "char": '\ud83d\uddd1', + fitzpatrick_scale: false, + category: "objects" + }, + oil_drum: { + keywords: [ "barrell" ], + "char": '\ud83d\udee2', + fitzpatrick_scale: false, + category: "objects" + }, + money_with_wings: { + keywords: [ "dollar", "bills", "payment", "sale" ], + "char": '\ud83d\udcb8', + fitzpatrick_scale: false, + category: "objects" + }, + dollar: { + keywords: [ "money", "sales", "bill", "currency" ], + "char": '\ud83d\udcb5', + fitzpatrick_scale: false, + category: "objects" + }, + yen: { + keywords: [ "money", "sales", "japanese", "dollar", "currency" ], + "char": '\ud83d\udcb4', + fitzpatrick_scale: false, + category: "objects" + }, + euro: { + keywords: [ "money", "sales", "dollar", "currency" ], + "char": '\ud83d\udcb6', + fitzpatrick_scale: false, + category: "objects" + }, + pound: { + keywords: [ "british", "sterling", "money", "sales", "bills", "uk", "england", "currency" ], + "char": '\ud83d\udcb7', + fitzpatrick_scale: false, + category: "objects" + }, + moneybag: { + keywords: [ "dollar", "payment", "coins", "sale" ], + "char": '\ud83d\udcb0', + fitzpatrick_scale: false, + category: "objects" + }, + credit_card: { + keywords: [ "money", "sales", "dollar", "bill", "payment", "shopping" ], + "char": '\ud83d\udcb3', + fitzpatrick_scale: false, + category: "objects" + }, + gem: { + keywords: [ "blue", "ruby", "diamond", "jewelry" ], + "char": '\ud83d\udc8e', + fitzpatrick_scale: false, + category: "objects" + }, + balance_scale: { + keywords: [ "law", "fairness", "weight" ], + "char": '\u2696', + fitzpatrick_scale: false, + category: "objects" + }, + toolbox: { + keywords: [ "tools", "diy", "fix", "maintainer", "mechanic" ], + "char": '\ud83e\uddf0', + fitzpatrick_scale: false, + category: "objects" + }, + wrench: { + keywords: [ "tools", "diy", "ikea", "fix", "maintainer" ], + "char": '\ud83d\udd27', + fitzpatrick_scale: false, + category: "objects" + }, + hammer: { + keywords: [ "tools", "build", "create" ], + "char": '\ud83d\udd28', + fitzpatrick_scale: false, + category: "objects" + }, + hammer_and_pick: { + keywords: [ "tools", "build", "create" ], + "char": '\u2692', + fitzpatrick_scale: false, + category: "objects" + }, + hammer_and_wrench: { + keywords: [ "tools", "build", "create" ], + "char": '\ud83d\udee0', + fitzpatrick_scale: false, + category: "objects" + }, + pick: { + keywords: [ "tools", "dig" ], + "char": '\u26cf', + fitzpatrick_scale: false, + category: "objects" + }, + nut_and_bolt: { + keywords: [ "handy", "tools", "fix" ], + "char": '\ud83d\udd29', + fitzpatrick_scale: false, + category: "objects" + }, + gear: { + keywords: [ "cog" ], + "char": '\u2699', + fitzpatrick_scale: false, + category: "objects" + }, + brick: { + keywords: [ "bricks" ], + "char": '\ud83e\uddf1', + fitzpatrick_scale: false, + category: "objects" + }, + chains: { + keywords: [ "lock", "arrest" ], + "char": '\u26d3', + fitzpatrick_scale: false, + category: "objects" + }, + magnet: { + keywords: [ "attraction", "magnetic" ], + "char": '\ud83e\uddf2', + fitzpatrick_scale: false, + category: "objects" + }, + gun: { + keywords: [ "violence", "weapon", "pistol", "revolver" ], + "char": '\ud83d\udd2b', + fitzpatrick_scale: false, + category: "objects" + }, + bomb: { + keywords: [ "boom", "explode", "explosion", "terrorism" ], + "char": '\ud83d\udca3', + fitzpatrick_scale: false, + category: "objects" + }, + firecracker: { + keywords: [ "dynamite", "boom", "explode", "explosion", "explosive" ], + "char": '\ud83e\udde8', + fitzpatrick_scale: false, + category: "objects" + }, + hocho: { + keywords: [ "knife", "blade", "cutlery", "kitchen", "weapon" ], + "char": '\ud83d\udd2a', + fitzpatrick_scale: false, + category: "objects" + }, + dagger: { + keywords: [ "weapon" ], + "char": '\ud83d\udde1', + fitzpatrick_scale: false, + category: "objects" + }, + crossed_swords: { + keywords: [ "weapon" ], + "char": '\u2694', + fitzpatrick_scale: false, + category: "objects" + }, + shield: { + keywords: [ "protection", "security" ], + "char": '\ud83d\udee1', + fitzpatrick_scale: false, + category: "objects" + }, + smoking: { + keywords: [ "kills", "tobacco", "cigarette", "joint", "smoke" ], + "char": '\ud83d\udeac', + fitzpatrick_scale: false, + category: "objects" + }, + skull_and_crossbones: { + keywords: [ "poison", "danger", "deadly", "scary", "death", "pirate", "evil" ], + "char": '\u2620', + fitzpatrick_scale: false, + category: "objects" + }, + coffin: { + keywords: [ "vampire", "dead", "die", "death", "rip", "graveyard", "cemetery", "casket", "funeral", "box" ], + "char": '\u26b0', + fitzpatrick_scale: false, + category: "objects" + }, + funeral_urn: { + keywords: [ "dead", "die", "death", "rip", "ashes" ], + "char": '\u26b1', + fitzpatrick_scale: false, + category: "objects" + }, + amphora: { + keywords: [ "vase", "jar" ], + "char": '\ud83c\udffa', + fitzpatrick_scale: false, + category: "objects" + }, + crystal_ball: { + keywords: [ "disco", "party", "magic", "circus", "fortune_teller" ], + "char": '\ud83d\udd2e', + fitzpatrick_scale: false, + category: "objects" + }, + prayer_beads: { + keywords: [ "dhikr", "religious" ], + "char": '\ud83d\udcff', + fitzpatrick_scale: false, + category: "objects" + }, + nazar_amulet: { + keywords: [ "bead", "charm" ], + "char": '\ud83e\uddff', + fitzpatrick_scale: false, + category: "objects" + }, + barber: { + keywords: [ "hair", "salon", "style" ], + "char": '\ud83d\udc88', + fitzpatrick_scale: false, + category: "objects" + }, + alembic: { + keywords: [ "distilling", "science", "experiment", "chemistry" ], + "char": '\u2697', + fitzpatrick_scale: false, + category: "objects" + }, + telescope: { + keywords: [ "stars", "space", "zoom", "science", "astronomy" ], + "char": '\ud83d\udd2d', + fitzpatrick_scale: false, + category: "objects" + }, + microscope: { + keywords: [ "laboratory", "experiment", "zoomin", "science", "study" ], + "char": '\ud83d\udd2c', + fitzpatrick_scale: false, + category: "objects" + }, + hole: { + keywords: [ "embarrassing" ], + "char": '\ud83d\udd73', + fitzpatrick_scale: false, + category: "objects" + }, + pill: { + keywords: [ "health", "medicine", "doctor", "pharmacy", "drug" ], + "char": '\ud83d\udc8a', + fitzpatrick_scale: false, + category: "objects" + }, + syringe: { + keywords: [ "health", "hospital", "drugs", "blood", "medicine", "needle", "doctor", "nurse" ], + "char": '\ud83d\udc89', + fitzpatrick_scale: false, + category: "objects" + }, + dna: { + keywords: [ "biologist", "genetics", "life" ], + "char": '\ud83e\uddec', + fitzpatrick_scale: false, + category: "objects" + }, + microbe: { + keywords: [ "amoeba", "bacteria", "germs" ], + "char": '\ud83e\udda0', + fitzpatrick_scale: false, + category: "objects" + }, + petri_dish: { + keywords: [ "bacteria", "biology", "culture", "lab" ], + "char": '\ud83e\uddeb', + fitzpatrick_scale: false, + category: "objects" + }, + test_tube: { + keywords: [ "chemistry", "experiment", "lab", "science" ], + "char": '\ud83e\uddea', + fitzpatrick_scale: false, + category: "objects" + }, + thermometer: { + keywords: [ "weather", "temperature", "hot", "cold" ], + "char": '\ud83c\udf21', + fitzpatrick_scale: false, + category: "objects" + }, + broom: { + keywords: [ "cleaning", "sweeping", "witch" ], + "char": '\ud83e\uddf9', + fitzpatrick_scale: false, + category: "objects" + }, + basket: { + keywords: [ "laundry" ], + "char": '\ud83e\uddfa', + fitzpatrick_scale: false, + category: "objects" + }, + toilet_paper: { + keywords: [ "roll" ], + "char": '\ud83e\uddfb', + fitzpatrick_scale: false, + category: "objects" + }, + label: { + keywords: [ "sale", "tag" ], + "char": '\ud83c\udff7', + fitzpatrick_scale: false, + category: "objects" + }, + bookmark: { + keywords: [ "favorite", "label", "save" ], + "char": '\ud83d\udd16', + fitzpatrick_scale: false, + category: "objects" + }, + toilet: { + keywords: [ "restroom", "wc", "washroom", "bathroom", "potty" ], + "char": '\ud83d\udebd', + fitzpatrick_scale: false, + category: "objects" + }, + shower: { + keywords: [ "clean", "water", "bathroom" ], + "char": '\ud83d\udebf', + fitzpatrick_scale: false, + category: "objects" + }, + bathtub: { + keywords: [ "clean", "shower", "bathroom" ], + "char": '\ud83d\udec1', + fitzpatrick_scale: false, + category: "objects" + }, + soap: { + keywords: [ "bar", "bathing", "cleaning", "lather" ], + "char": '\ud83e\uddfc', + fitzpatrick_scale: false, + category: "objects" + }, + sponge: { + keywords: [ "absorbing", "cleaning", "porous" ], + "char": '\ud83e\uddfd', + fitzpatrick_scale: false, + category: "objects" + }, + lotion_bottle: { + keywords: [ "moisturizer", "sunscreen" ], + "char": '\ud83e\uddf4', + fitzpatrick_scale: false, + category: "objects" + }, + key: { + keywords: [ "lock", "door", "password" ], + "char": '\ud83d\udd11', + fitzpatrick_scale: false, + category: "objects" + }, + old_key: { + keywords: [ "lock", "door", "password" ], + "char": '\ud83d\udddd', + fitzpatrick_scale: false, + category: "objects" + }, + couch_and_lamp: { + keywords: [ "read", "chill" ], + "char": '\ud83d\udecb', + fitzpatrick_scale: false, + category: "objects" + }, + sleeping_bed: { + keywords: [ "bed", "rest" ], + "char": '\ud83d\udecc', + fitzpatrick_scale: true, + category: "objects" + }, + bed: { + keywords: [ "sleep", "rest" ], + "char": '\ud83d\udecf', + fitzpatrick_scale: false, + category: "objects" + }, + door: { + keywords: [ "house", "entry", "exit" ], + "char": '\ud83d\udeaa', + fitzpatrick_scale: false, + category: "objects" + }, + bellhop_bell: { + keywords: [ "service" ], + "char": '\ud83d\udece', + fitzpatrick_scale: false, + category: "objects" + }, + teddy_bear: { + keywords: [ "plush", "stuffed" ], + "char": '\ud83e\uddf8', + fitzpatrick_scale: false, + category: "objects" + }, + framed_picture: { + keywords: [ "photography" ], + "char": '\ud83d\uddbc', + fitzpatrick_scale: false, + category: "objects" + }, + world_map: { + keywords: [ "location", "direction" ], + "char": '\ud83d\uddfa', + fitzpatrick_scale: false, + category: "objects" + }, + parasol_on_ground: { + keywords: [ "weather", "summer" ], + "char": '\u26f1', + fitzpatrick_scale: false, + category: "objects" + }, + moyai: { + keywords: [ "rock", "easter island", "moai" ], + "char": '\ud83d\uddff', + fitzpatrick_scale: false, + category: "objects" + }, + shopping: { + keywords: [ "mall", "buy", "purchase" ], + "char": '\ud83d\udecd', + fitzpatrick_scale: false, + category: "objects" + }, + shopping_cart: { + keywords: [ "trolley" ], + "char": '\ud83d\uded2', + fitzpatrick_scale: false, + category: "objects" + }, + balloon: { + keywords: [ "party", "celebration", "birthday", "circus" ], + "char": '\ud83c\udf88', + fitzpatrick_scale: false, + category: "objects" + }, + flags: { + keywords: [ "fish", "japanese", "koinobori", "carp", "banner" ], + "char": '\ud83c\udf8f', + fitzpatrick_scale: false, + category: "objects" + }, + ribbon: { + keywords: [ "decoration", "pink", "girl", "bowtie" ], + "char": '\ud83c\udf80', + fitzpatrick_scale: false, + category: "objects" + }, + gift: { + keywords: [ "present", "birthday", "christmas", "xmas" ], + "char": '\ud83c\udf81', + fitzpatrick_scale: false, + category: "objects" + }, + confetti_ball: { + keywords: [ "festival", "party", "birthday", "circus" ], + "char": '\ud83c\udf8a', + fitzpatrick_scale: false, + category: "objects" + }, + tada: { + keywords: [ "party", "congratulations", "birthday", "magic", "circus", "celebration" ], + "char": '\ud83c\udf89', + fitzpatrick_scale: false, + category: "objects" + }, + dolls: { + keywords: [ "japanese", "toy", "kimono" ], + "char": '\ud83c\udf8e', + fitzpatrick_scale: false, + category: "objects" + }, + wind_chime: { + keywords: [ "nature", "ding", "spring", "bell" ], + "char": '\ud83c\udf90', + fitzpatrick_scale: false, + category: "objects" + }, + crossed_flags: { + keywords: [ "japanese", "nation", "country", "border" ], + "char": '\ud83c\udf8c', + fitzpatrick_scale: false, + category: "objects" + }, + izakaya_lantern: { + keywords: [ "light", "paper", "halloween", "spooky" ], + "char": '\ud83c\udfee', + fitzpatrick_scale: false, + category: "objects" + }, + red_envelope: { + keywords: [ "gift" ], + "char": '\ud83e\udde7', + fitzpatrick_scale: false, + category: "objects" + }, + email: { + keywords: [ "letter", "postal", "inbox", "communication" ], + "char": '\u2709\ufe0f', + fitzpatrick_scale: false, + category: "objects" + }, + envelope_with_arrow: { + keywords: [ "email", "communication" ], + "char": '\ud83d\udce9', + fitzpatrick_scale: false, + category: "objects" + }, + incoming_envelope: { + keywords: [ "email", "inbox" ], + "char": '\ud83d\udce8', + fitzpatrick_scale: false, + category: "objects" + }, + "e-mail": { + keywords: [ "communication", "inbox" ], + "char": '\ud83d\udce7', + fitzpatrick_scale: false, + category: "objects" + }, + love_letter: { + keywords: [ "email", "like", "affection", "envelope", "valentines" ], + "char": '\ud83d\udc8c', + fitzpatrick_scale: false, + category: "objects" + }, + postbox: { + keywords: [ "email", "letter", "envelope" ], + "char": '\ud83d\udcee', + fitzpatrick_scale: false, + category: "objects" + }, + mailbox_closed: { + keywords: [ "email", "communication", "inbox" ], + "char": '\ud83d\udcea', + fitzpatrick_scale: false, + category: "objects" + }, + mailbox: { + keywords: [ "email", "inbox", "communication" ], + "char": '\ud83d\udceb', + fitzpatrick_scale: false, + category: "objects" + }, + mailbox_with_mail: { + keywords: [ "email", "inbox", "communication" ], + "char": '\ud83d\udcec', + fitzpatrick_scale: false, + category: "objects" + }, + mailbox_with_no_mail: { + keywords: [ "email", "inbox" ], + "char": '\ud83d\udced', + fitzpatrick_scale: false, + category: "objects" + }, + "package": { + keywords: [ "mail", "gift", "cardboard", "box", "moving" ], + "char": '\ud83d\udce6', + fitzpatrick_scale: false, + category: "objects" + }, + postal_horn: { + keywords: [ "instrument", "music" ], + "char": '\ud83d\udcef', + fitzpatrick_scale: false, + category: "objects" + }, + inbox_tray: { + keywords: [ "email", "documents" ], + "char": '\ud83d\udce5', + fitzpatrick_scale: false, + category: "objects" + }, + outbox_tray: { + keywords: [ "inbox", "email" ], + "char": '\ud83d\udce4', + fitzpatrick_scale: false, + category: "objects" + }, + scroll: { + keywords: [ "documents", "ancient", "history", "paper" ], + "char": '\ud83d\udcdc', + fitzpatrick_scale: false, + category: "objects" + }, + page_with_curl: { + keywords: [ "documents", "office", "paper" ], + "char": '\ud83d\udcc3', + fitzpatrick_scale: false, + category: "objects" + }, + bookmark_tabs: { + keywords: [ "favorite", "save", "order", "tidy" ], + "char": '\ud83d\udcd1', + fitzpatrick_scale: false, + category: "objects" + }, + receipt: { + keywords: [ "accounting", "expenses" ], + "char": '\ud83e\uddfe', + fitzpatrick_scale: false, + category: "objects" + }, + bar_chart: { + keywords: [ "graph", "presentation", "stats" ], + "char": '\ud83d\udcca', + fitzpatrick_scale: false, + category: "objects" + }, + chart_with_upwards_trend: { + keywords: [ "graph", "presentation", "stats", "recovery", "business", "economics", "money", "sales", "good", "success" ], + "char": '\ud83d\udcc8', + fitzpatrick_scale: false, + category: "objects" + }, + chart_with_downwards_trend: { + keywords: [ "graph", "presentation", "stats", "recession", "business", "economics", "money", "sales", "bad", "failure" ], + "char": '\ud83d\udcc9', + fitzpatrick_scale: false, + category: "objects" + }, + page_facing_up: { + keywords: [ "documents", "office", "paper", "information" ], + "char": '\ud83d\udcc4', + fitzpatrick_scale: false, + category: "objects" + }, + date: { + keywords: [ "calendar", "schedule" ], + "char": '\ud83d\udcc5', + fitzpatrick_scale: false, + category: "objects" + }, + calendar: { + keywords: [ "schedule", "date", "planning" ], + "char": '\ud83d\udcc6', + fitzpatrick_scale: false, + category: "objects" + }, + spiral_calendar: { + keywords: [ "date", "schedule", "planning" ], + "char": '\ud83d\uddd3', + fitzpatrick_scale: false, + category: "objects" + }, + card_index: { + keywords: [ "business", "stationery" ], + "char": '\ud83d\udcc7', + fitzpatrick_scale: false, + category: "objects" + }, + card_file_box: { + keywords: [ "business", "stationery" ], + "char": '\ud83d\uddc3', + fitzpatrick_scale: false, + category: "objects" + }, + ballot_box: { + keywords: [ "election", "vote" ], + "char": '\ud83d\uddf3', + fitzpatrick_scale: false, + category: "objects" + }, + file_cabinet: { + keywords: [ "filing", "organizing" ], + "char": '\ud83d\uddc4', + fitzpatrick_scale: false, + category: "objects" + }, + clipboard: { + keywords: [ "stationery", "documents" ], + "char": '\ud83d\udccb', + fitzpatrick_scale: false, + category: "objects" + }, + spiral_notepad: { + keywords: [ "memo", "stationery" ], + "char": '\ud83d\uddd2', + fitzpatrick_scale: false, + category: "objects" + }, + file_folder: { + keywords: [ "documents", "business", "office" ], + "char": '\ud83d\udcc1', + fitzpatrick_scale: false, + category: "objects" + }, + open_file_folder: { + keywords: [ "documents", "load" ], + "char": '\ud83d\udcc2', + fitzpatrick_scale: false, + category: "objects" + }, + card_index_dividers: { + keywords: [ "organizing", "business", "stationery" ], + "char": '\ud83d\uddc2', + fitzpatrick_scale: false, + category: "objects" + }, + newspaper_roll: { + keywords: [ "press", "headline" ], + "char": '\ud83d\uddde', + fitzpatrick_scale: false, + category: "objects" + }, + newspaper: { + keywords: [ "press", "headline" ], + "char": '\ud83d\udcf0', + fitzpatrick_scale: false, + category: "objects" + }, + notebook: { + keywords: [ "stationery", "record", "notes", "paper", "study" ], + "char": '\ud83d\udcd3', + fitzpatrick_scale: false, + category: "objects" + }, + closed_book: { + keywords: [ "read", "library", "knowledge", "textbook", "learn" ], + "char": '\ud83d\udcd5', + fitzpatrick_scale: false, + category: "objects" + }, + green_book: { + keywords: [ "read", "library", "knowledge", "study" ], + "char": '\ud83d\udcd7', + fitzpatrick_scale: false, + category: "objects" + }, + blue_book: { + keywords: [ "read", "library", "knowledge", "learn", "study" ], + "char": '\ud83d\udcd8', + fitzpatrick_scale: false, + category: "objects" + }, + orange_book: { + keywords: [ "read", "library", "knowledge", "textbook", "study" ], + "char": '\ud83d\udcd9', + fitzpatrick_scale: false, + category: "objects" + }, + notebook_with_decorative_cover: { + keywords: [ "classroom", "notes", "record", "paper", "study" ], + "char": '\ud83d\udcd4', + fitzpatrick_scale: false, + category: "objects" + }, + ledger: { + keywords: [ "notes", "paper" ], + "char": '\ud83d\udcd2', + fitzpatrick_scale: false, + category: "objects" + }, + books: { + keywords: [ "literature", "library", "study" ], + "char": '\ud83d\udcda', + fitzpatrick_scale: false, + category: "objects" + }, + open_book: { + keywords: [ "book", "read", "library", "knowledge", "literature", "learn", "study" ], + "char": '\ud83d\udcd6', + fitzpatrick_scale: false, + category: "objects" + }, + safety_pin: { + keywords: [ "diaper" ], + "char": '\ud83e\uddf7', + fitzpatrick_scale: false, + category: "objects" + }, + link: { + keywords: [ "rings", "url" ], + "char": '\ud83d\udd17', + fitzpatrick_scale: false, + category: "objects" + }, + paperclip: { + keywords: [ "documents", "stationery" ], + "char": '\ud83d\udcce', + fitzpatrick_scale: false, + category: "objects" + }, + paperclips: { + keywords: [ "documents", "stationery" ], + "char": '\ud83d\udd87', + fitzpatrick_scale: false, + category: "objects" + }, + scissors: { + keywords: [ "stationery", "cut" ], + "char": '\u2702\ufe0f', + fitzpatrick_scale: false, + category: "objects" + }, + triangular_ruler: { + keywords: [ "stationery", "math", "architect", "sketch" ], + "char": '\ud83d\udcd0', + fitzpatrick_scale: false, + category: "objects" + }, + straight_ruler: { + keywords: [ "stationery", "calculate", "length", "math", "school", "drawing", "architect", "sketch" ], + "char": '\ud83d\udccf', + fitzpatrick_scale: false, + category: "objects" + }, + abacus: { + keywords: [ "calculation" ], + "char": '\ud83e\uddee', + fitzpatrick_scale: false, + category: "objects" + }, + pushpin: { + keywords: [ "stationery", "mark", "here" ], + "char": '\ud83d\udccc', + fitzpatrick_scale: false, + category: "objects" + }, + round_pushpin: { + keywords: [ "stationery", "location", "map", "here" ], + "char": '\ud83d\udccd', + fitzpatrick_scale: false, + category: "objects" + }, + triangular_flag_on_post: { + keywords: [ "mark", "milestone", "place" ], + "char": '\ud83d\udea9', + fitzpatrick_scale: false, + category: "objects" + }, + white_flag: { + keywords: [ "losing", "loser", "lost", "surrender", "give up", "fail" ], + "char": '\ud83c\udff3', + fitzpatrick_scale: false, + category: "objects" + }, + black_flag: { + keywords: [ "pirate" ], + "char": '\ud83c\udff4', + fitzpatrick_scale: false, + category: "objects" + }, + rainbow_flag: { + keywords: [ "flag", "rainbow", "pride", "gay", "lgbt", "glbt", "queer", "homosexual", "lesbian", "bisexual", "transgender" ], + "char": '\ud83c\udff3\ufe0f\u200d\ud83c\udf08', + fitzpatrick_scale: false, + category: "objects" + }, + closed_lock_with_key: { + keywords: [ "security", "privacy" ], + "char": '\ud83d\udd10', + fitzpatrick_scale: false, + category: "objects" + }, + lock: { + keywords: [ "security", "password", "padlock" ], + "char": '\ud83d\udd12', + fitzpatrick_scale: false, + category: "objects" + }, + unlock: { + keywords: [ "privacy", "security" ], + "char": '\ud83d\udd13', + fitzpatrick_scale: false, + category: "objects" + }, + lock_with_ink_pen: { + keywords: [ "security", "secret" ], + "char": '\ud83d\udd0f', + fitzpatrick_scale: false, + category: "objects" + }, + pen: { + keywords: [ "stationery", "writing", "write" ], + "char": '\ud83d\udd8a', + fitzpatrick_scale: false, + category: "objects" + }, + fountain_pen: { + keywords: [ "stationery", "writing", "write" ], + "char": '\ud83d\udd8b', + fitzpatrick_scale: false, + category: "objects" + }, + black_nib: { + keywords: [ "pen", "stationery", "writing", "write" ], + "char": '\u2712\ufe0f', + fitzpatrick_scale: false, + category: "objects" + }, + memo: { + keywords: [ "write", "documents", "stationery", "pencil", "paper", "writing", "legal", "exam", "quiz", "test", "study", "compose" ], + "char": '\ud83d\udcdd', + fitzpatrick_scale: false, + category: "objects" + }, + pencil2: { + keywords: [ "stationery", "write", "paper", "writing", "school", "study" ], + "char": '\u270f\ufe0f', + fitzpatrick_scale: false, + category: "objects" + }, + crayon: { + keywords: [ "drawing", "creativity" ], + "char": '\ud83d\udd8d', + fitzpatrick_scale: false, + category: "objects" + }, + paintbrush: { + keywords: [ "drawing", "creativity", "art" ], + "char": '\ud83d\udd8c', + fitzpatrick_scale: false, + category: "objects" + }, + mag: { + keywords: [ "search", "zoom", "find", "detective" ], + "char": '\ud83d\udd0d', + fitzpatrick_scale: false, + category: "objects" + }, + mag_right: { + keywords: [ "search", "zoom", "find", "detective" ], + "char": '\ud83d\udd0e', + fitzpatrick_scale: false, + category: "objects" + }, + heart: { + keywords: [ "love", "like", "valentines" ], + "char": '\u2764\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + orange_heart: { + keywords: [ "love", "like", "affection", "valentines" ], + "char": '\ud83e\udde1', + fitzpatrick_scale: false, + category: "symbols" + }, + yellow_heart: { + keywords: [ "love", "like", "affection", "valentines" ], + "char": '\ud83d\udc9b', + fitzpatrick_scale: false, + category: "symbols" + }, + green_heart: { + keywords: [ "love", "like", "affection", "valentines" ], + "char": '\ud83d\udc9a', + fitzpatrick_scale: false, + category: "symbols" + }, + blue_heart: { + keywords: [ "love", "like", "affection", "valentines" ], + "char": '\ud83d\udc99', + fitzpatrick_scale: false, + category: "symbols" + }, + purple_heart: { + keywords: [ "love", "like", "affection", "valentines" ], + "char": '\ud83d\udc9c', + fitzpatrick_scale: false, + category: "symbols" + }, + black_heart: { + keywords: [ "evil" ], + "char": '\ud83d\udda4', + fitzpatrick_scale: false, + category: "symbols" + }, + broken_heart: { + keywords: [ "sad", "sorry", "break", "heart", "heartbreak" ], + "char": '\ud83d\udc94', + fitzpatrick_scale: false, + category: "symbols" + }, + heavy_heart_exclamation: { + keywords: [ "decoration", "love" ], + "char": '\u2763', + fitzpatrick_scale: false, + category: "symbols" + }, + two_hearts: { + keywords: [ "love", "like", "affection", "valentines", "heart" ], + "char": '\ud83d\udc95', + fitzpatrick_scale: false, + category: "symbols" + }, + revolving_hearts: { + keywords: [ "love", "like", "affection", "valentines" ], + "char": '\ud83d\udc9e', + fitzpatrick_scale: false, + category: "symbols" + }, + heartbeat: { + keywords: [ "love", "like", "affection", "valentines", "pink", "heart" ], + "char": '\ud83d\udc93', + fitzpatrick_scale: false, + category: "symbols" + }, + heartpulse: { + keywords: [ "like", "love", "affection", "valentines", "pink" ], + "char": '\ud83d\udc97', + fitzpatrick_scale: false, + category: "symbols" + }, + sparkling_heart: { + keywords: [ "love", "like", "affection", "valentines" ], + "char": '\ud83d\udc96', + fitzpatrick_scale: false, + category: "symbols" + }, + cupid: { + keywords: [ "love", "like", "heart", "affection", "valentines" ], + "char": '\ud83d\udc98', + fitzpatrick_scale: false, + category: "symbols" + }, + gift_heart: { + keywords: [ "love", "valentines" ], + "char": '\ud83d\udc9d', + fitzpatrick_scale: false, + category: "symbols" + }, + heart_decoration: { + keywords: [ "purple-square", "love", "like" ], + "char": '\ud83d\udc9f', + fitzpatrick_scale: false, + category: "symbols" + }, + peace_symbol: { + keywords: [ "hippie" ], + "char": '\u262e', + fitzpatrick_scale: false, + category: "symbols" + }, + latin_cross: { + keywords: [ "christianity" ], + "char": '\u271d', + fitzpatrick_scale: false, + category: "symbols" + }, + star_and_crescent: { + keywords: [ "islam" ], + "char": '\u262a', + fitzpatrick_scale: false, + category: "symbols" + }, + om: { + keywords: [ "hinduism", "buddhism", "sikhism", "jainism" ], + "char": '\ud83d\udd49', + fitzpatrick_scale: false, + category: "symbols" + }, + wheel_of_dharma: { + keywords: [ "hinduism", "buddhism", "sikhism", "jainism" ], + "char": '\u2638', + fitzpatrick_scale: false, + category: "symbols" + }, + star_of_david: { + keywords: [ "judaism" ], + "char": '\u2721', + fitzpatrick_scale: false, + category: "symbols" + }, + six_pointed_star: { + keywords: [ "purple-square", "religion", "jewish", "hexagram" ], + "char": '\ud83d\udd2f', + fitzpatrick_scale: false, + category: "symbols" + }, + menorah: { + keywords: [ "hanukkah", "candles", "jewish" ], + "char": '\ud83d\udd4e', + fitzpatrick_scale: false, + category: "symbols" + }, + yin_yang: { + keywords: [ "balance" ], + "char": '\u262f', + fitzpatrick_scale: false, + category: "symbols" + }, + orthodox_cross: { + keywords: [ "suppedaneum", "religion" ], + "char": '\u2626', + fitzpatrick_scale: false, + category: "symbols" + }, + place_of_worship: { + keywords: [ "religion", "church", "temple", "prayer" ], + "char": '\ud83d\uded0', + fitzpatrick_scale: false, + category: "symbols" + }, + ophiuchus: { + keywords: [ "sign", "purple-square", "constellation", "astrology" ], + "char": '\u26ce', + fitzpatrick_scale: false, + category: "symbols" + }, + aries: { + keywords: [ "sign", "purple-square", "zodiac", "astrology" ], + "char": '\u2648', + fitzpatrick_scale: false, + category: "symbols" + }, + taurus: { + keywords: [ "purple-square", "sign", "zodiac", "astrology" ], + "char": '\u2649', + fitzpatrick_scale: false, + category: "symbols" + }, + gemini: { + keywords: [ "sign", "zodiac", "purple-square", "astrology" ], + "char": '\u264a', + fitzpatrick_scale: false, + category: "symbols" + }, + cancer: { + keywords: [ "sign", "zodiac", "purple-square", "astrology" ], + "char": '\u264b', + fitzpatrick_scale: false, + category: "symbols" + }, + leo: { + keywords: [ "sign", "purple-square", "zodiac", "astrology" ], + "char": '\u264c', + fitzpatrick_scale: false, + category: "symbols" + }, + virgo: { + keywords: [ "sign", "zodiac", "purple-square", "astrology" ], + "char": '\u264d', + fitzpatrick_scale: false, + category: "symbols" + }, + libra: { + keywords: [ "sign", "purple-square", "zodiac", "astrology" ], + "char": '\u264e', + fitzpatrick_scale: false, + category: "symbols" + }, + scorpius: { + keywords: [ "sign", "zodiac", "purple-square", "astrology", "scorpio" ], + "char": '\u264f', + fitzpatrick_scale: false, + category: "symbols" + }, + sagittarius: { + keywords: [ "sign", "zodiac", "purple-square", "astrology" ], + "char": '\u2650', + fitzpatrick_scale: false, + category: "symbols" + }, + capricorn: { + keywords: [ "sign", "zodiac", "purple-square", "astrology" ], + "char": '\u2651', + fitzpatrick_scale: false, + category: "symbols" + }, + aquarius: { + keywords: [ "sign", "purple-square", "zodiac", "astrology" ], + "char": '\u2652', + fitzpatrick_scale: false, + category: "symbols" + }, + pisces: { + keywords: [ "purple-square", "sign", "zodiac", "astrology" ], + "char": '\u2653', + fitzpatrick_scale: false, + category: "symbols" + }, + id: { + keywords: [ "purple-square", "words" ], + "char": '\ud83c\udd94', + fitzpatrick_scale: false, + category: "symbols" + }, + atom_symbol: { + keywords: [ "science", "physics", "chemistry" ], + "char": '\u269b', + fitzpatrick_scale: false, + category: "symbols" + }, + u7a7a: { + keywords: [ "kanji", "japanese", "chinese", "empty", "sky", "blue-square" ], + "char": '\ud83c\ude33', + fitzpatrick_scale: false, + category: "symbols" + }, + u5272: { + keywords: [ "cut", "divide", "chinese", "kanji", "pink-square" ], + "char": '\ud83c\ude39', + fitzpatrick_scale: false, + category: "symbols" + }, + radioactive: { + keywords: [ "nuclear", "danger" ], + "char": '\u2622', + fitzpatrick_scale: false, + category: "symbols" + }, + biohazard: { + keywords: [ "danger" ], + "char": '\u2623', + fitzpatrick_scale: false, + category: "symbols" + }, + mobile_phone_off: { + keywords: [ "mute", "orange-square", "silence", "quiet" ], + "char": '\ud83d\udcf4', + fitzpatrick_scale: false, + category: "symbols" + }, + vibration_mode: { + keywords: [ "orange-square", "phone" ], + "char": '\ud83d\udcf3', + fitzpatrick_scale: false, + category: "symbols" + }, + u6709: { + keywords: [ "orange-square", "chinese", "have", "kanji" ], + "char": '\ud83c\ude36', + fitzpatrick_scale: false, + category: "symbols" + }, + u7121: { + keywords: [ "nothing", "chinese", "kanji", "japanese", "orange-square" ], + "char": '\ud83c\ude1a', + fitzpatrick_scale: false, + category: "symbols" + }, + u7533: { + keywords: [ "chinese", "japanese", "kanji", "orange-square" ], + "char": '\ud83c\ude38', + fitzpatrick_scale: false, + category: "symbols" + }, + u55b6: { + keywords: [ "japanese", "opening hours", "orange-square" ], + "char": '\ud83c\ude3a', + fitzpatrick_scale: false, + category: "symbols" + }, + u6708: { + keywords: [ "chinese", "month", "moon", "japanese", "orange-square", "kanji" ], + "char": '\ud83c\ude37\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + eight_pointed_black_star: { + keywords: [ "orange-square", "shape", "polygon" ], + "char": '\u2734\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + vs: { + keywords: [ "words", "orange-square" ], + "char": '\ud83c\udd9a', + fitzpatrick_scale: false, + category: "symbols" + }, + accept: { + keywords: [ "ok", "good", "chinese", "kanji", "agree", "yes", "orange-circle" ], + "char": '\ud83c\ude51', + fitzpatrick_scale: false, + category: "symbols" + }, + white_flower: { + keywords: [ "japanese", "spring" ], + "char": '\ud83d\udcae', + fitzpatrick_scale: false, + category: "symbols" + }, + ideograph_advantage: { + keywords: [ "chinese", "kanji", "obtain", "get", "circle" ], + "char": '\ud83c\ude50', + fitzpatrick_scale: false, + category: "symbols" + }, + secret: { + keywords: [ "privacy", "chinese", "sshh", "kanji", "red-circle" ], + "char": '\u3299\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + congratulations: { + keywords: [ "chinese", "kanji", "japanese", "red-circle" ], + "char": '\u3297\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + u5408: { + keywords: [ "japanese", "chinese", "join", "kanji", "red-square" ], + "char": '\ud83c\ude34', + fitzpatrick_scale: false, + category: "symbols" + }, + u6e80: { + keywords: [ "full", "chinese", "japanese", "red-square", "kanji" ], + "char": '\ud83c\ude35', + fitzpatrick_scale: false, + category: "symbols" + }, + u7981: { + keywords: [ "kanji", "japanese", "chinese", "forbidden", "limit", "restricted", "red-square" ], + "char": '\ud83c\ude32', + fitzpatrick_scale: false, + category: "symbols" + }, + a: { + keywords: [ "red-square", "alphabet", "letter" ], + "char": '\ud83c\udd70\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + b: { + keywords: [ "red-square", "alphabet", "letter" ], + "char": '\ud83c\udd71\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + ab: { + keywords: [ "red-square", "alphabet" ], + "char": '\ud83c\udd8e', + fitzpatrick_scale: false, + category: "symbols" + }, + cl: { + keywords: [ "alphabet", "words", "red-square" ], + "char": '\ud83c\udd91', + fitzpatrick_scale: false, + category: "symbols" + }, + o2: { + keywords: [ "alphabet", "red-square", "letter" ], + "char": '\ud83c\udd7e\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + sos: { + keywords: [ "help", "red-square", "words", "emergency", "911" ], + "char": '\ud83c\udd98', + fitzpatrick_scale: false, + category: "symbols" + }, + no_entry: { + keywords: [ "limit", "security", "privacy", "bad", "denied", "stop", "circle" ], + "char": '\u26d4', + fitzpatrick_scale: false, + category: "symbols" + }, + name_badge: { + keywords: [ "fire", "forbid" ], + "char": '\ud83d\udcdb', + fitzpatrick_scale: false, + category: "symbols" + }, + no_entry_sign: { + keywords: [ "forbid", "stop", "limit", "denied", "disallow", "circle" ], + "char": '\ud83d\udeab', + fitzpatrick_scale: false, + category: "symbols" + }, + x: { + keywords: [ "no", "delete", "remove", "cancel", "red" ], + "char": '\u274c', + fitzpatrick_scale: false, + category: "symbols" + }, + o: { + keywords: [ "circle", "round" ], + "char": '\u2b55', + fitzpatrick_scale: false, + category: "symbols" + }, + stop_sign: { + keywords: [ "stop" ], + "char": '\ud83d\uded1', + fitzpatrick_scale: false, + category: "symbols" + }, + anger: { + keywords: [ "angry", "mad" ], + "char": '\ud83d\udca2', + fitzpatrick_scale: false, + category: "symbols" + }, + hotsprings: { + keywords: [ "bath", "warm", "relax" ], + "char": '\u2668\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + no_pedestrians: { + keywords: [ "rules", "crossing", "walking", "circle" ], + "char": '\ud83d\udeb7', + fitzpatrick_scale: false, + category: "symbols" + }, + do_not_litter: { + keywords: [ "trash", "bin", "garbage", "circle" ], + "char": '\ud83d\udeaf', + fitzpatrick_scale: false, + category: "symbols" + }, + no_bicycles: { + keywords: [ "cyclist", "prohibited", "circle" ], + "char": '\ud83d\udeb3', + fitzpatrick_scale: false, + category: "symbols" + }, + "non-potable_water": { + keywords: [ "drink", "faucet", "tap", "circle" ], + "char": '\ud83d\udeb1', + fitzpatrick_scale: false, + category: "symbols" + }, + underage: { + keywords: [ "18", "drink", "pub", "night", "minor", "circle" ], + "char": '\ud83d\udd1e', + fitzpatrick_scale: false, + category: "symbols" + }, + no_mobile_phones: { + keywords: [ "iphone", "mute", "circle" ], + "char": '\ud83d\udcf5', + fitzpatrick_scale: false, + category: "symbols" + }, + exclamation: { + keywords: [ "heavy_exclamation_mark", "danger", "surprise", "punctuation", "wow", "warning" ], + "char": '\u2757', + fitzpatrick_scale: false, + category: "symbols" + }, + grey_exclamation: { + keywords: [ "surprise", "punctuation", "gray", "wow", "warning" ], + "char": '\u2755', + fitzpatrick_scale: false, + category: "symbols" + }, + question: { + keywords: [ "doubt", "confused" ], + "char": '\u2753', + fitzpatrick_scale: false, + category: "symbols" + }, + grey_question: { + keywords: [ "doubts", "gray", "huh", "confused" ], + "char": '\u2754', + fitzpatrick_scale: false, + category: "symbols" + }, + bangbang: { + keywords: [ "exclamation", "surprise" ], + "char": '\u203c\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + interrobang: { + keywords: [ "wat", "punctuation", "surprise" ], + "char": '\u2049\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + low_brightness: { + keywords: [ "sun", "afternoon", "warm", "summer" ], + "char": '\ud83d\udd05', + fitzpatrick_scale: false, + category: "symbols" + }, + high_brightness: { + keywords: [ "sun", "light" ], + "char": '\ud83d\udd06', + fitzpatrick_scale: false, + category: "symbols" + }, + trident: { + keywords: [ "weapon", "spear" ], + "char": '\ud83d\udd31', + fitzpatrick_scale: false, + category: "symbols" + }, + fleur_de_lis: { + keywords: [ "decorative", "scout" ], + "char": '\u269c', + fitzpatrick_scale: false, + category: "symbols" + }, + part_alternation_mark: { + keywords: [ "graph", "presentation", "stats", "business", "economics", "bad" ], + "char": '\u303d\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + warning: { + keywords: [ "exclamation", "wip", "alert", "error", "problem", "issue" ], + "char": '\u26a0\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + children_crossing: { + keywords: [ "school", "warning", "danger", "sign", "driving", "yellow-diamond" ], + "char": '\ud83d\udeb8', + fitzpatrick_scale: false, + category: "symbols" + }, + beginner: { + keywords: [ "badge", "shield" ], + "char": '\ud83d\udd30', + fitzpatrick_scale: false, + category: "symbols" + }, + recycle: { + keywords: [ "arrow", "environment", "garbage", "trash" ], + "char": '\u267b\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + u6307: { + keywords: [ "chinese", "point", "green-square", "kanji" ], + "char": '\ud83c\ude2f', + fitzpatrick_scale: false, + category: "symbols" + }, + chart: { + keywords: [ "green-square", "graph", "presentation", "stats" ], + "char": '\ud83d\udcb9', + fitzpatrick_scale: false, + category: "symbols" + }, + sparkle: { + keywords: [ "stars", "green-square", "awesome", "good", "fireworks" ], + "char": '\u2747\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + eight_spoked_asterisk: { + keywords: [ "star", "sparkle", "green-square" ], + "char": '\u2733\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + negative_squared_cross_mark: { + keywords: [ "x", "green-square", "no", "deny" ], + "char": '\u274e', + fitzpatrick_scale: false, + category: "symbols" + }, + white_check_mark: { + keywords: [ "green-square", "ok", "agree", "vote", "election", "answer", "tick" ], + "char": '\u2705', + fitzpatrick_scale: false, + category: "symbols" + }, + diamond_shape_with_a_dot_inside: { + keywords: [ "jewel", "blue", "gem", "crystal", "fancy" ], + "char": '\ud83d\udca0', + fitzpatrick_scale: false, + category: "symbols" + }, + cyclone: { + keywords: [ "weather", "swirl", "blue", "cloud", "vortex", "spiral", "whirlpool", "spin", "tornado", "hurricane", "typhoon" ], + "char": '\ud83c\udf00', + fitzpatrick_scale: false, + category: "symbols" + }, + loop: { + keywords: [ "tape", "cassette" ], + "char": '\u27bf', + fitzpatrick_scale: false, + category: "symbols" + }, + globe_with_meridians: { + keywords: [ "earth", "international", "world", "internet", "interweb", "i18n" ], + "char": '\ud83c\udf10', + fitzpatrick_scale: false, + category: "symbols" + }, + m: { + keywords: [ "alphabet", "blue-circle", "letter" ], + "char": '\u24c2\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + atm: { + keywords: [ "money", "sales", "cash", "blue-square", "payment", "bank" ], + "char": '\ud83c\udfe7', + fitzpatrick_scale: false, + category: "symbols" + }, + sa: { + keywords: [ "japanese", "blue-square", "katakana" ], + "char": '\ud83c\ude02\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + passport_control: { + keywords: [ "custom", "blue-square" ], + "char": '\ud83d\udec2', + fitzpatrick_scale: false, + category: "symbols" + }, + customs: { + keywords: [ "passport", "border", "blue-square" ], + "char": '\ud83d\udec3', + fitzpatrick_scale: false, + category: "symbols" + }, + baggage_claim: { + keywords: [ "blue-square", "airport", "transport" ], + "char": '\ud83d\udec4', + fitzpatrick_scale: false, + category: "symbols" + }, + left_luggage: { + keywords: [ "blue-square", "travel" ], + "char": '\ud83d\udec5', + fitzpatrick_scale: false, + category: "symbols" + }, + wheelchair: { + keywords: [ "blue-square", "disabled", "a11y", "accessibility" ], + "char": '\u267f', + fitzpatrick_scale: false, + category: "symbols" + }, + no_smoking: { + keywords: [ "cigarette", "blue-square", "smell", "smoke" ], + "char": '\ud83d\udead', + fitzpatrick_scale: false, + category: "symbols" + }, + wc: { + keywords: [ "toilet", "restroom", "blue-square" ], + "char": '\ud83d\udebe', + fitzpatrick_scale: false, + category: "symbols" + }, + parking: { + keywords: [ "cars", "blue-square", "alphabet", "letter" ], + "char": '\ud83c\udd7f\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + potable_water: { + keywords: [ "blue-square", "liquid", "restroom", "cleaning", "faucet" ], + "char": '\ud83d\udeb0', + fitzpatrick_scale: false, + category: "symbols" + }, + mens: { + keywords: [ "toilet", "restroom", "wc", "blue-square", "gender", "male" ], + "char": '\ud83d\udeb9', + fitzpatrick_scale: false, + category: "symbols" + }, + womens: { + keywords: [ "purple-square", "woman", "female", "toilet", "loo", "restroom", "gender" ], + "char": '\ud83d\udeba', + fitzpatrick_scale: false, + category: "symbols" + }, + baby_symbol: { + keywords: [ "orange-square", "child" ], + "char": '\ud83d\udebc', + fitzpatrick_scale: false, + category: "symbols" + }, + restroom: { + keywords: [ "blue-square", "toilet", "refresh", "wc", "gender" ], + "char": '\ud83d\udebb', + fitzpatrick_scale: false, + category: "symbols" + }, + put_litter_in_its_place: { + keywords: [ "blue-square", "sign", "human", "info" ], + "char": '\ud83d\udeae', + fitzpatrick_scale: false, + category: "symbols" + }, + cinema: { + keywords: [ "blue-square", "record", "film", "movie", "curtain", "stage", "theater" ], + "char": '\ud83c\udfa6', + fitzpatrick_scale: false, + category: "symbols" + }, + signal_strength: { + keywords: [ "blue-square", "reception", "phone", "internet", "connection", "wifi", "bluetooth", "bars" ], + "char": '\ud83d\udcf6', + fitzpatrick_scale: false, + category: "symbols" + }, + koko: { + keywords: [ "blue-square", "here", "katakana", "japanese", "destination" ], + "char": '\ud83c\ude01', + fitzpatrick_scale: false, + category: "symbols" + }, + ng: { + keywords: [ "blue-square", "words", "shape", "icon" ], + "char": '\ud83c\udd96', + fitzpatrick_scale: false, + category: "symbols" + }, + ok: { + keywords: [ "good", "agree", "yes", "blue-square" ], + "char": '\ud83c\udd97', + fitzpatrick_scale: false, + category: "symbols" + }, + up: { + keywords: [ "blue-square", "above", "high" ], + "char": '\ud83c\udd99', + fitzpatrick_scale: false, + category: "symbols" + }, + cool: { + keywords: [ "words", "blue-square" ], + "char": '\ud83c\udd92', + fitzpatrick_scale: false, + category: "symbols" + }, + "new": { + keywords: [ "blue-square", "words", "start" ], + "char": '\ud83c\udd95', + fitzpatrick_scale: false, + category: "symbols" + }, + free: { + keywords: [ "blue-square", "words" ], + "char": '\ud83c\udd93', + fitzpatrick_scale: false, + category: "symbols" + }, + zero: { + keywords: [ "0", "numbers", "blue-square", "null" ], + "char": '0\ufe0f\u20e3', + fitzpatrick_scale: false, + category: "symbols" + }, + one: { + keywords: [ "blue-square", "numbers", "1" ], + "char": '1\ufe0f\u20e3', + fitzpatrick_scale: false, + category: "symbols" + }, + two: { + keywords: [ "numbers", "2", "prime", "blue-square" ], + "char": '2\ufe0f\u20e3', + fitzpatrick_scale: false, + category: "symbols" + }, + three: { + keywords: [ "3", "numbers", "prime", "blue-square" ], + "char": '3\ufe0f\u20e3', + fitzpatrick_scale: false, + category: "symbols" + }, + four: { + keywords: [ "4", "numbers", "blue-square" ], + "char": '4\ufe0f\u20e3', + fitzpatrick_scale: false, + category: "symbols" + }, + five: { + keywords: [ "5", "numbers", "blue-square", "prime" ], + "char": '5\ufe0f\u20e3', + fitzpatrick_scale: false, + category: "symbols" + }, + six: { + keywords: [ "6", "numbers", "blue-square" ], + "char": '6\ufe0f\u20e3', + fitzpatrick_scale: false, + category: "symbols" + }, + seven: { + keywords: [ "7", "numbers", "blue-square", "prime" ], + "char": '7\ufe0f\u20e3', + fitzpatrick_scale: false, + category: "symbols" + }, + eight: { + keywords: [ "8", "blue-square", "numbers" ], + "char": '8\ufe0f\u20e3', + fitzpatrick_scale: false, + category: "symbols" + }, + nine: { + keywords: [ "blue-square", "numbers", "9" ], + "char": '9\ufe0f\u20e3', + fitzpatrick_scale: false, + category: "symbols" + }, + keycap_ten: { + keywords: [ "numbers", "10", "blue-square" ], + "char": '\ud83d\udd1f', + fitzpatrick_scale: false, + category: "symbols" + }, + asterisk: { + keywords: [ "star", "keycap" ], + "char": '*\u20e3', + fitzpatrick_scale: false, + category: "symbols" + }, + eject_button: { + keywords: [ "blue-square" ], + "char": '\u23cf\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_forward: { + keywords: [ "blue-square", "right", "direction", "play" ], + "char": '\u25b6\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + pause_button: { + keywords: [ "pause", "blue-square" ], + "char": '\u23f8', + fitzpatrick_scale: false, + category: "symbols" + }, + next_track_button: { + keywords: [ "forward", "next", "blue-square" ], + "char": '\u23ed', + fitzpatrick_scale: false, + category: "symbols" + }, + stop_button: { + keywords: [ "blue-square" ], + "char": '\u23f9', + fitzpatrick_scale: false, + category: "symbols" + }, + record_button: { + keywords: [ "blue-square" ], + "char": '\u23fa', + fitzpatrick_scale: false, + category: "symbols" + }, + play_or_pause_button: { + keywords: [ "blue-square", "play", "pause" ], + "char": '\u23ef', + fitzpatrick_scale: false, + category: "symbols" + }, + previous_track_button: { + keywords: [ "backward" ], + "char": '\u23ee', + fitzpatrick_scale: false, + category: "symbols" + }, + fast_forward: { + keywords: [ "blue-square", "play", "speed", "continue" ], + "char": '\u23e9', + fitzpatrick_scale: false, + category: "symbols" + }, + rewind: { + keywords: [ "play", "blue-square" ], + "char": '\u23ea', + fitzpatrick_scale: false, + category: "symbols" + }, + twisted_rightwards_arrows: { + keywords: [ "blue-square", "shuffle", "music", "random" ], + "char": '\ud83d\udd00', + fitzpatrick_scale: false, + category: "symbols" + }, + repeat: { + keywords: [ "loop", "record" ], + "char": '\ud83d\udd01', + fitzpatrick_scale: false, + category: "symbols" + }, + repeat_one: { + keywords: [ "blue-square", "loop" ], + "char": '\ud83d\udd02', + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_backward: { + keywords: [ "blue-square", "left", "direction" ], + "char": '\u25c0\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_up_small: { + keywords: [ "blue-square", "triangle", "direction", "point", "forward", "top" ], + "char": '\ud83d\udd3c', + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_down_small: { + keywords: [ "blue-square", "direction", "bottom" ], + "char": '\ud83d\udd3d', + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_double_up: { + keywords: [ "blue-square", "direction", "top" ], + "char": '\u23eb', + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_double_down: { + keywords: [ "blue-square", "direction", "bottom" ], + "char": '\u23ec', + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_right: { + keywords: [ "blue-square", "next" ], + "char": '\u27a1\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_left: { + keywords: [ "blue-square", "previous", "back" ], + "char": '\u2b05\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_up: { + keywords: [ "blue-square", "continue", "top", "direction" ], + "char": '\u2b06\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_down: { + keywords: [ "blue-square", "direction", "bottom" ], + "char": '\u2b07\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_upper_right: { + keywords: [ "blue-square", "point", "direction", "diagonal", "northeast" ], + "char": '\u2197\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_lower_right: { + keywords: [ "blue-square", "direction", "diagonal", "southeast" ], + "char": '\u2198\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_lower_left: { + keywords: [ "blue-square", "direction", "diagonal", "southwest" ], + "char": '\u2199\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_upper_left: { + keywords: [ "blue-square", "point", "direction", "diagonal", "northwest" ], + "char": '\u2196\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_up_down: { + keywords: [ "blue-square", "direction", "way", "vertical" ], + "char": '\u2195\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + left_right_arrow: { + keywords: [ "shape", "direction", "horizontal", "sideways" ], + "char": '\u2194\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + arrows_counterclockwise: { + keywords: [ "blue-square", "sync", "cycle" ], + "char": '\ud83d\udd04', + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_right_hook: { + keywords: [ "blue-square", "return", "rotate", "direction" ], + "char": '\u21aa\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + leftwards_arrow_with_hook: { + keywords: [ "back", "return", "blue-square", "undo", "enter" ], + "char": '\u21a9\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_heading_up: { + keywords: [ "blue-square", "direction", "top" ], + "char": '\u2934\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_heading_down: { + keywords: [ "blue-square", "direction", "bottom" ], + "char": '\u2935\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + hash: { + keywords: [ "symbol", "blue-square", "twitter" ], + "char": '#\ufe0f\u20e3', + fitzpatrick_scale: false, + category: "symbols" + }, + information_source: { + keywords: [ "blue-square", "alphabet", "letter" ], + "char": '\u2139\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + abc: { + keywords: [ "blue-square", "alphabet" ], + "char": '\ud83d\udd24', + fitzpatrick_scale: false, + category: "symbols" + }, + abcd: { + keywords: [ "blue-square", "alphabet" ], + "char": '\ud83d\udd21', + fitzpatrick_scale: false, + category: "symbols" + }, + capital_abcd: { + keywords: [ "alphabet", "words", "blue-square" ], + "char": '\ud83d\udd20', + fitzpatrick_scale: false, + category: "symbols" + }, + symbols: { + keywords: [ "blue-square", "music", "note", "ampersand", "percent", "glyphs", "characters" ], + "char": '\ud83d\udd23', + fitzpatrick_scale: false, + category: "symbols" + }, + musical_note: { + keywords: [ "score", "tone", "sound" ], + "char": '\ud83c\udfb5', + fitzpatrick_scale: false, + category: "symbols" + }, + notes: { + keywords: [ "music", "score" ], + "char": '\ud83c\udfb6', + fitzpatrick_scale: false, + category: "symbols" + }, + wavy_dash: { + keywords: [ "draw", "line", "moustache", "mustache", "squiggle", "scribble" ], + "char": '\u3030\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + curly_loop: { + keywords: [ "scribble", "draw", "shape", "squiggle" ], + "char": '\u27b0', + fitzpatrick_scale: false, + category: "symbols" + }, + heavy_check_mark: { + keywords: [ "ok", "nike", "answer", "yes", "tick" ], + "char": '\u2714\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + arrows_clockwise: { + keywords: [ "sync", "cycle", "round", "repeat" ], + "char": '\ud83d\udd03', + fitzpatrick_scale: false, + category: "symbols" + }, + heavy_plus_sign: { + keywords: [ "math", "calculation", "addition", "more", "increase" ], + "char": '\u2795', + fitzpatrick_scale: false, + category: "symbols" + }, + heavy_minus_sign: { + keywords: [ "math", "calculation", "subtract", "less" ], + "char": '\u2796', + fitzpatrick_scale: false, + category: "symbols" + }, + heavy_division_sign: { + keywords: [ "divide", "math", "calculation" ], + "char": '\u2797', + fitzpatrick_scale: false, + category: "symbols" + }, + heavy_multiplication_x: { + keywords: [ "math", "calculation" ], + "char": '\u2716\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + infinity: { + keywords: [ "forever" ], + "char": '\u267e', + fitzpatrick_scale: false, + category: "symbols" + }, + heavy_dollar_sign: { + keywords: [ "money", "sales", "payment", "currency", "buck" ], + "char": '\ud83d\udcb2', + fitzpatrick_scale: false, + category: "symbols" + }, + currency_exchange: { + keywords: [ "money", "sales", "dollar", "travel" ], + "char": '\ud83d\udcb1', + fitzpatrick_scale: false, + category: "symbols" + }, + copyright: { + keywords: [ "ip", "license", "circle", "law", "legal" ], + "char": '\xa9\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + registered: { + keywords: [ "alphabet", "circle" ], + "char": '\xae\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + tm: { + keywords: [ "trademark", "brand", "law", "legal" ], + "char": '\u2122\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + end: { + keywords: [ "words", "arrow" ], + "char": '\ud83d\udd1a', + fitzpatrick_scale: false, + category: "symbols" + }, + back: { + keywords: [ "arrow", "words", "return" ], + "char": '\ud83d\udd19', + fitzpatrick_scale: false, + category: "symbols" + }, + on: { + keywords: [ "arrow", "words" ], + "char": '\ud83d\udd1b', + fitzpatrick_scale: false, + category: "symbols" + }, + top: { + keywords: [ "words", "blue-square" ], + "char": '\ud83d\udd1d', + fitzpatrick_scale: false, + category: "symbols" + }, + soon: { + keywords: [ "arrow", "words" ], + "char": '\ud83d\udd1c', + fitzpatrick_scale: false, + category: "symbols" + }, + ballot_box_with_check: { + keywords: [ "ok", "agree", "confirm", "black-square", "vote", "election", "yes", "tick" ], + "char": '\u2611\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + radio_button: { + keywords: [ "input", "old", "music", "circle" ], + "char": '\ud83d\udd18', + fitzpatrick_scale: false, + category: "symbols" + }, + white_circle: { + keywords: [ "shape", "round" ], + "char": '\u26aa', + fitzpatrick_scale: false, + category: "symbols" + }, + black_circle: { + keywords: [ "shape", "button", "round" ], + "char": '\u26ab', + fitzpatrick_scale: false, + category: "symbols" + }, + red_circle: { + keywords: [ "shape", "error", "danger" ], + "char": '\ud83d\udd34', + fitzpatrick_scale: false, + category: "symbols" + }, + large_blue_circle: { + keywords: [ "shape", "icon", "button" ], + "char": '\ud83d\udd35', + fitzpatrick_scale: false, + category: "symbols" + }, + small_orange_diamond: { + keywords: [ "shape", "jewel", "gem" ], + "char": '\ud83d\udd38', + fitzpatrick_scale: false, + category: "symbols" + }, + small_blue_diamond: { + keywords: [ "shape", "jewel", "gem" ], + "char": '\ud83d\udd39', + fitzpatrick_scale: false, + category: "symbols" + }, + large_orange_diamond: { + keywords: [ "shape", "jewel", "gem" ], + "char": '\ud83d\udd36', + fitzpatrick_scale: false, + category: "symbols" + }, + large_blue_diamond: { + keywords: [ "shape", "jewel", "gem" ], + "char": '\ud83d\udd37', + fitzpatrick_scale: false, + category: "symbols" + }, + small_red_triangle: { + keywords: [ "shape", "direction", "up", "top" ], + "char": '\ud83d\udd3a', + fitzpatrick_scale: false, + category: "symbols" + }, + black_small_square: { + keywords: [ "shape", "icon" ], + "char": '\u25aa\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + white_small_square: { + keywords: [ "shape", "icon" ], + "char": '\u25ab\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + black_large_square: { + keywords: [ "shape", "icon", "button" ], + "char": '\u2b1b', + fitzpatrick_scale: false, + category: "symbols" + }, + white_large_square: { + keywords: [ "shape", "icon", "stone", "button" ], + "char": '\u2b1c', + fitzpatrick_scale: false, + category: "symbols" + }, + small_red_triangle_down: { + keywords: [ "shape", "direction", "bottom" ], + "char": '\ud83d\udd3b', + fitzpatrick_scale: false, + category: "symbols" + }, + black_medium_square: { + keywords: [ "shape", "button", "icon" ], + "char": '\u25fc\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + white_medium_square: { + keywords: [ "shape", "stone", "icon" ], + "char": '\u25fb\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + black_medium_small_square: { + keywords: [ "icon", "shape", "button" ], + "char": '\u25fe', + fitzpatrick_scale: false, + category: "symbols" + }, + white_medium_small_square: { + keywords: [ "shape", "stone", "icon", "button" ], + "char": '\u25fd', + fitzpatrick_scale: false, + category: "symbols" + }, + black_square_button: { + keywords: [ "shape", "input", "frame" ], + "char": '\ud83d\udd32', + fitzpatrick_scale: false, + category: "symbols" + }, + white_square_button: { + keywords: [ "shape", "input" ], + "char": '\ud83d\udd33', + fitzpatrick_scale: false, + category: "symbols" + }, + speaker: { + keywords: [ "sound", "volume", "silence", "broadcast" ], + "char": '\ud83d\udd08', + fitzpatrick_scale: false, + category: "symbols" + }, + sound: { + keywords: [ "volume", "speaker", "broadcast" ], + "char": '\ud83d\udd09', + fitzpatrick_scale: false, + category: "symbols" + }, + loud_sound: { + keywords: [ "volume", "noise", "noisy", "speaker", "broadcast" ], + "char": '\ud83d\udd0a', + fitzpatrick_scale: false, + category: "symbols" + }, + mute: { + keywords: [ "sound", "volume", "silence", "quiet" ], + "char": '\ud83d\udd07', + fitzpatrick_scale: false, + category: "symbols" + }, + mega: { + keywords: [ "sound", "speaker", "volume" ], + "char": '\ud83d\udce3', + fitzpatrick_scale: false, + category: "symbols" + }, + loudspeaker: { + keywords: [ "volume", "sound" ], + "char": '\ud83d\udce2', + fitzpatrick_scale: false, + category: "symbols" + }, + bell: { + keywords: [ "sound", "notification", "christmas", "xmas", "chime" ], + "char": '\ud83d\udd14', + fitzpatrick_scale: false, + category: "symbols" + }, + no_bell: { + keywords: [ "sound", "volume", "mute", "quiet", "silent" ], + "char": '\ud83d\udd15', + fitzpatrick_scale: false, + category: "symbols" + }, + black_joker: { + keywords: [ "poker", "cards", "game", "play", "magic" ], + "char": '\ud83c\udccf', + fitzpatrick_scale: false, + category: "symbols" + }, + mahjong: { + keywords: [ "game", "play", "chinese", "kanji" ], + "char": '\ud83c\udc04', + fitzpatrick_scale: false, + category: "symbols" + }, + spades: { + keywords: [ "poker", "cards", "suits", "magic" ], + "char": '\u2660\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + clubs: { + keywords: [ "poker", "cards", "magic", "suits" ], + "char": '\u2663\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + hearts: { + keywords: [ "poker", "cards", "magic", "suits" ], + "char": '\u2665\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + diamonds: { + keywords: [ "poker", "cards", "magic", "suits" ], + "char": '\u2666\ufe0f', + fitzpatrick_scale: false, + category: "symbols" + }, + flower_playing_cards: { + keywords: [ "game", "sunset", "red" ], + "char": '\ud83c\udfb4', + fitzpatrick_scale: false, + category: "symbols" + }, + thought_balloon: { + keywords: [ "bubble", "cloud", "speech", "thinking", "dream" ], + "char": '\ud83d\udcad', + fitzpatrick_scale: false, + category: "symbols" + }, + right_anger_bubble: { + keywords: [ "caption", "speech", "thinking", "mad" ], + "char": '\ud83d\uddef', + fitzpatrick_scale: false, + category: "symbols" + }, + speech_balloon: { + keywords: [ "bubble", "words", "message", "talk", "chatting" ], + "char": '\ud83d\udcac', + fitzpatrick_scale: false, + category: "symbols" + }, + left_speech_bubble: { + keywords: [ "words", "message", "talk", "chatting" ], + "char": '\ud83d\udde8', + fitzpatrick_scale: false, + category: "symbols" + }, + clock1: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd50', + fitzpatrick_scale: false, + category: "symbols" + }, + clock2: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd51', + fitzpatrick_scale: false, + category: "symbols" + }, + clock3: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd52', + fitzpatrick_scale: false, + category: "symbols" + }, + clock4: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd53', + fitzpatrick_scale: false, + category: "symbols" + }, + clock5: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd54', + fitzpatrick_scale: false, + category: "symbols" + }, + clock6: { + keywords: [ "time", "late", "early", "schedule", "dawn", "dusk" ], + "char": '\ud83d\udd55', + fitzpatrick_scale: false, + category: "symbols" + }, + clock7: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd56', + fitzpatrick_scale: false, + category: "symbols" + }, + clock8: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd57', + fitzpatrick_scale: false, + category: "symbols" + }, + clock9: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd58', + fitzpatrick_scale: false, + category: "symbols" + }, + clock10: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd59', + fitzpatrick_scale: false, + category: "symbols" + }, + clock11: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd5a', + fitzpatrick_scale: false, + category: "symbols" + }, + clock12: { + keywords: [ "time", "noon", "midnight", "midday", "late", "early", "schedule" ], + "char": '\ud83d\udd5b', + fitzpatrick_scale: false, + category: "symbols" + }, + clock130: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd5c', + fitzpatrick_scale: false, + category: "symbols" + }, + clock230: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd5d', + fitzpatrick_scale: false, + category: "symbols" + }, + clock330: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd5e', + fitzpatrick_scale: false, + category: "symbols" + }, + clock430: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd5f', + fitzpatrick_scale: false, + category: "symbols" + }, + clock530: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd60', + fitzpatrick_scale: false, + category: "symbols" + }, + clock630: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd61', + fitzpatrick_scale: false, + category: "symbols" + }, + clock730: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd62', + fitzpatrick_scale: false, + category: "symbols" + }, + clock830: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd63', + fitzpatrick_scale: false, + category: "symbols" + }, + clock930: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd64', + fitzpatrick_scale: false, + category: "symbols" + }, + clock1030: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd65', + fitzpatrick_scale: false, + category: "symbols" + }, + clock1130: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd66', + fitzpatrick_scale: false, + category: "symbols" + }, + clock1230: { + keywords: [ "time", "late", "early", "schedule" ], + "char": '\ud83d\udd67', + fitzpatrick_scale: false, + category: "symbols" + }, + afghanistan: { + keywords: [ "af", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde6\ud83c\uddeb', + fitzpatrick_scale: false, + category: "flags" + }, + aland_islands: { + keywords: [ "\xc5land", "islands", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde6\ud83c\uddfd', + fitzpatrick_scale: false, + category: "flags" + }, + albania: { + keywords: [ "al", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde6\ud83c\uddf1', + fitzpatrick_scale: false, + category: "flags" + }, + algeria: { + keywords: [ "dz", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde9\ud83c\uddff', + fitzpatrick_scale: false, + category: "flags" + }, + american_samoa: { + keywords: [ "american", "ws", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde6\ud83c\uddf8', + fitzpatrick_scale: false, + category: "flags" + }, + andorra: { + keywords: [ "ad", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde6\ud83c\udde9', + fitzpatrick_scale: false, + category: "flags" + }, + angola: { + keywords: [ "ao", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde6\ud83c\uddf4', + fitzpatrick_scale: false, + category: "flags" + }, + anguilla: { + keywords: [ "ai", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde6\ud83c\uddee', + fitzpatrick_scale: false, + category: "flags" + }, + antarctica: { + keywords: [ "aq", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde6\ud83c\uddf6', + fitzpatrick_scale: false, + category: "flags" + }, + antigua_barbuda: { + keywords: [ "antigua", "barbuda", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde6\ud83c\uddec', + fitzpatrick_scale: false, + category: "flags" + }, + argentina: { + keywords: [ "ar", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde6\ud83c\uddf7', + fitzpatrick_scale: false, + category: "flags" + }, + armenia: { + keywords: [ "am", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde6\ud83c\uddf2', + fitzpatrick_scale: false, + category: "flags" + }, + aruba: { + keywords: [ "aw", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde6\ud83c\uddfc', + fitzpatrick_scale: false, + category: "flags" + }, + australia: { + keywords: [ "au", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde6\ud83c\uddfa', + fitzpatrick_scale: false, + category: "flags" + }, + austria: { + keywords: [ "at", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde6\ud83c\uddf9', + fitzpatrick_scale: false, + category: "flags" + }, + azerbaijan: { + keywords: [ "az", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde6\ud83c\uddff', + fitzpatrick_scale: false, + category: "flags" + }, + bahamas: { + keywords: [ "bs", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\uddf8', + fitzpatrick_scale: false, + category: "flags" + }, + bahrain: { + keywords: [ "bh", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\udded', + fitzpatrick_scale: false, + category: "flags" + }, + bangladesh: { + keywords: [ "bd", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\udde9', + fitzpatrick_scale: false, + category: "flags" + }, + barbados: { + keywords: [ "bb", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\udde7', + fitzpatrick_scale: false, + category: "flags" + }, + belarus: { + keywords: [ "by", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\uddfe', + fitzpatrick_scale: false, + category: "flags" + }, + belgium: { + keywords: [ "be", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\uddea', + fitzpatrick_scale: false, + category: "flags" + }, + belize: { + keywords: [ "bz", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\uddff', + fitzpatrick_scale: false, + category: "flags" + }, + benin: { + keywords: [ "bj", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\uddef', + fitzpatrick_scale: false, + category: "flags" + }, + bermuda: { + keywords: [ "bm", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\uddf2', + fitzpatrick_scale: false, + category: "flags" + }, + bhutan: { + keywords: [ "bt", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\uddf9', + fitzpatrick_scale: false, + category: "flags" + }, + bolivia: { + keywords: [ "bo", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\uddf4', + fitzpatrick_scale: false, + category: "flags" + }, + caribbean_netherlands: { + keywords: [ "bonaire", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\uddf6', + fitzpatrick_scale: false, + category: "flags" + }, + bosnia_herzegovina: { + keywords: [ "bosnia", "herzegovina", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\udde6', + fitzpatrick_scale: false, + category: "flags" + }, + botswana: { + keywords: [ "bw", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\uddfc', + fitzpatrick_scale: false, + category: "flags" + }, + brazil: { + keywords: [ "br", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\uddf7', + fitzpatrick_scale: false, + category: "flags" + }, + british_indian_ocean_territory: { + keywords: [ "british", "indian", "ocean", "territory", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddee\ud83c\uddf4', + fitzpatrick_scale: false, + category: "flags" + }, + british_virgin_islands: { + keywords: [ "british", "virgin", "islands", "bvi", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddfb\ud83c\uddec', + fitzpatrick_scale: false, + category: "flags" + }, + brunei: { + keywords: [ "bn", "darussalam", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\uddf3', + fitzpatrick_scale: false, + category: "flags" + }, + bulgaria: { + keywords: [ "bg", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\uddec', + fitzpatrick_scale: false, + category: "flags" + }, + burkina_faso: { + keywords: [ "burkina", "faso", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\uddeb', + fitzpatrick_scale: false, + category: "flags" + }, + burundi: { + keywords: [ "bi", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\uddee', + fitzpatrick_scale: false, + category: "flags" + }, + cape_verde: { + keywords: [ "cabo", "verde", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde8\ud83c\uddfb', + fitzpatrick_scale: false, + category: "flags" + }, + cambodia: { + keywords: [ "kh", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf0\ud83c\udded', + fitzpatrick_scale: false, + category: "flags" + }, + cameroon: { + keywords: [ "cm", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde8\ud83c\uddf2', + fitzpatrick_scale: false, + category: "flags" + }, + canada: { + keywords: [ "ca", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde8\ud83c\udde6', + fitzpatrick_scale: false, + category: "flags" + }, + canary_islands: { + keywords: [ "canary", "islands", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddee\ud83c\udde8', + fitzpatrick_scale: false, + category: "flags" + }, + cayman_islands: { + keywords: [ "cayman", "islands", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf0\ud83c\uddfe', + fitzpatrick_scale: false, + category: "flags" + }, + central_african_republic: { + keywords: [ "central", "african", "republic", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde8\ud83c\uddeb', + fitzpatrick_scale: false, + category: "flags" + }, + chad: { + keywords: [ "td", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf9\ud83c\udde9', + fitzpatrick_scale: false, + category: "flags" + }, + chile: { + keywords: [ "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde8\ud83c\uddf1', + fitzpatrick_scale: false, + category: "flags" + }, + cn: { + keywords: [ "china", "chinese", "prc", "flag", "country", "nation", "banner" ], + "char": '\ud83c\udde8\ud83c\uddf3', + fitzpatrick_scale: false, + category: "flags" + }, + christmas_island: { + keywords: [ "christmas", "island", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde8\ud83c\uddfd', + fitzpatrick_scale: false, + category: "flags" + }, + cocos_islands: { + keywords: [ "cocos", "keeling", "islands", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde8\ud83c\udde8', + fitzpatrick_scale: false, + category: "flags" + }, + colombia: { + keywords: [ "co", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde8\ud83c\uddf4', + fitzpatrick_scale: false, + category: "flags" + }, + comoros: { + keywords: [ "km", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf0\ud83c\uddf2', + fitzpatrick_scale: false, + category: "flags" + }, + congo_brazzaville: { + keywords: [ "congo", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde8\ud83c\uddec', + fitzpatrick_scale: false, + category: "flags" + }, + congo_kinshasa: { + keywords: [ "congo", "democratic", "republic", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde8\ud83c\udde9', + fitzpatrick_scale: false, + category: "flags" + }, + cook_islands: { + keywords: [ "cook", "islands", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde8\ud83c\uddf0', + fitzpatrick_scale: false, + category: "flags" + }, + costa_rica: { + keywords: [ "costa", "rica", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde8\ud83c\uddf7', + fitzpatrick_scale: false, + category: "flags" + }, + croatia: { + keywords: [ "hr", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udded\ud83c\uddf7', + fitzpatrick_scale: false, + category: "flags" + }, + cuba: { + keywords: [ "cu", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde8\ud83c\uddfa', + fitzpatrick_scale: false, + category: "flags" + }, + curacao: { + keywords: [ "cura\xe7ao", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde8\ud83c\uddfc', + fitzpatrick_scale: false, + category: "flags" + }, + cyprus: { + keywords: [ "cy", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde8\ud83c\uddfe', + fitzpatrick_scale: false, + category: "flags" + }, + czech_republic: { + keywords: [ "cz", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde8\ud83c\uddff', + fitzpatrick_scale: false, + category: "flags" + }, + denmark: { + keywords: [ "dk", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde9\ud83c\uddf0', + fitzpatrick_scale: false, + category: "flags" + }, + djibouti: { + keywords: [ "dj", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde9\ud83c\uddef', + fitzpatrick_scale: false, + category: "flags" + }, + dominica: { + keywords: [ "dm", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde9\ud83c\uddf2', + fitzpatrick_scale: false, + category: "flags" + }, + dominican_republic: { + keywords: [ "dominican", "republic", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde9\ud83c\uddf4', + fitzpatrick_scale: false, + category: "flags" + }, + ecuador: { + keywords: [ "ec", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddea\ud83c\udde8', + fitzpatrick_scale: false, + category: "flags" + }, + egypt: { + keywords: [ "eg", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddea\ud83c\uddec', + fitzpatrick_scale: false, + category: "flags" + }, + el_salvador: { + keywords: [ "el", "salvador", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\uddfb', + fitzpatrick_scale: false, + category: "flags" + }, + equatorial_guinea: { + keywords: [ "equatorial", "gn", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddec\ud83c\uddf6', + fitzpatrick_scale: false, + category: "flags" + }, + eritrea: { + keywords: [ "er", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddea\ud83c\uddf7', + fitzpatrick_scale: false, + category: "flags" + }, + estonia: { + keywords: [ "ee", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddea\ud83c\uddea', + fitzpatrick_scale: false, + category: "flags" + }, + ethiopia: { + keywords: [ "et", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddea\ud83c\uddf9', + fitzpatrick_scale: false, + category: "flags" + }, + eu: { + keywords: [ "european", "union", "flag", "banner" ], + "char": '\ud83c\uddea\ud83c\uddfa', + fitzpatrick_scale: false, + category: "flags" + }, + falkland_islands: { + keywords: [ "falkland", "islands", "malvinas", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddeb\ud83c\uddf0', + fitzpatrick_scale: false, + category: "flags" + }, + faroe_islands: { + keywords: [ "faroe", "islands", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddeb\ud83c\uddf4', + fitzpatrick_scale: false, + category: "flags" + }, + fiji: { + keywords: [ "fj", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddeb\ud83c\uddef', + fitzpatrick_scale: false, + category: "flags" + }, + finland: { + keywords: [ "fi", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddeb\ud83c\uddee', + fitzpatrick_scale: false, + category: "flags" + }, + fr: { + keywords: [ "banner", "flag", "nation", "france", "french", "country" ], + "char": '\ud83c\uddeb\ud83c\uddf7', + fitzpatrick_scale: false, + category: "flags" + }, + french_guiana: { + keywords: [ "french", "guiana", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddec\ud83c\uddeb', + fitzpatrick_scale: false, + category: "flags" + }, + french_polynesia: { + keywords: [ "french", "polynesia", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf5\ud83c\uddeb', + fitzpatrick_scale: false, + category: "flags" + }, + french_southern_territories: { + keywords: [ "french", "southern", "territories", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf9\ud83c\uddeb', + fitzpatrick_scale: false, + category: "flags" + }, + gabon: { + keywords: [ "ga", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddec\ud83c\udde6', + fitzpatrick_scale: false, + category: "flags" + }, + gambia: { + keywords: [ "gm", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddec\ud83c\uddf2', + fitzpatrick_scale: false, + category: "flags" + }, + georgia: { + keywords: [ "ge", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddec\ud83c\uddea', + fitzpatrick_scale: false, + category: "flags" + }, + de: { + keywords: [ "german", "nation", "flag", "country", "banner" ], + "char": '\ud83c\udde9\ud83c\uddea', + fitzpatrick_scale: false, + category: "flags" + }, + ghana: { + keywords: [ "gh", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddec\ud83c\udded', + fitzpatrick_scale: false, + category: "flags" + }, + gibraltar: { + keywords: [ "gi", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddec\ud83c\uddee', + fitzpatrick_scale: false, + category: "flags" + }, + greece: { + keywords: [ "gr", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddec\ud83c\uddf7', + fitzpatrick_scale: false, + category: "flags" + }, + greenland: { + keywords: [ "gl", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddec\ud83c\uddf1', + fitzpatrick_scale: false, + category: "flags" + }, + grenada: { + keywords: [ "gd", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddec\ud83c\udde9', + fitzpatrick_scale: false, + category: "flags" + }, + guadeloupe: { + keywords: [ "gp", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddec\ud83c\uddf5', + fitzpatrick_scale: false, + category: "flags" + }, + guam: { + keywords: [ "gu", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddec\ud83c\uddfa', + fitzpatrick_scale: false, + category: "flags" + }, + guatemala: { + keywords: [ "gt", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddec\ud83c\uddf9', + fitzpatrick_scale: false, + category: "flags" + }, + guernsey: { + keywords: [ "gg", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddec\ud83c\uddec', + fitzpatrick_scale: false, + category: "flags" + }, + guinea: { + keywords: [ "gn", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddec\ud83c\uddf3', + fitzpatrick_scale: false, + category: "flags" + }, + guinea_bissau: { + keywords: [ "gw", "bissau", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddec\ud83c\uddfc', + fitzpatrick_scale: false, + category: "flags" + }, + guyana: { + keywords: [ "gy", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddec\ud83c\uddfe', + fitzpatrick_scale: false, + category: "flags" + }, + haiti: { + keywords: [ "ht", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udded\ud83c\uddf9', + fitzpatrick_scale: false, + category: "flags" + }, + honduras: { + keywords: [ "hn", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udded\ud83c\uddf3', + fitzpatrick_scale: false, + category: "flags" + }, + hong_kong: { + keywords: [ "hong", "kong", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udded\ud83c\uddf0', + fitzpatrick_scale: false, + category: "flags" + }, + hungary: { + keywords: [ "hu", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udded\ud83c\uddfa', + fitzpatrick_scale: false, + category: "flags" + }, + iceland: { + keywords: [ "is", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddee\ud83c\uddf8', + fitzpatrick_scale: false, + category: "flags" + }, + india: { + keywords: [ "in", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddee\ud83c\uddf3', + fitzpatrick_scale: false, + category: "flags" + }, + indonesia: { + keywords: [ "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddee\ud83c\udde9', + fitzpatrick_scale: false, + category: "flags" + }, + iran: { + keywords: [ "iran,", "islamic", "republic", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddee\ud83c\uddf7', + fitzpatrick_scale: false, + category: "flags" + }, + iraq: { + keywords: [ "iq", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddee\ud83c\uddf6', + fitzpatrick_scale: false, + category: "flags" + }, + ireland: { + keywords: [ "ie", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddee\ud83c\uddea', + fitzpatrick_scale: false, + category: "flags" + }, + isle_of_man: { + keywords: [ "isle", "man", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddee\ud83c\uddf2', + fitzpatrick_scale: false, + category: "flags" + }, + israel: { + keywords: [ "il", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddee\ud83c\uddf1', + fitzpatrick_scale: false, + category: "flags" + }, + it: { + keywords: [ "italy", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddee\ud83c\uddf9', + fitzpatrick_scale: false, + category: "flags" + }, + cote_divoire: { + keywords: [ "ivory", "coast", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde8\ud83c\uddee', + fitzpatrick_scale: false, + category: "flags" + }, + jamaica: { + keywords: [ "jm", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddef\ud83c\uddf2', + fitzpatrick_scale: false, + category: "flags" + }, + jp: { + keywords: [ "japanese", "nation", "flag", "country", "banner" ], + "char": '\ud83c\uddef\ud83c\uddf5', + fitzpatrick_scale: false, + category: "flags" + }, + jersey: { + keywords: [ "je", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddef\ud83c\uddea', + fitzpatrick_scale: false, + category: "flags" + }, + jordan: { + keywords: [ "jo", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddef\ud83c\uddf4', + fitzpatrick_scale: false, + category: "flags" + }, + kazakhstan: { + keywords: [ "kz", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf0\ud83c\uddff', + fitzpatrick_scale: false, + category: "flags" + }, + kenya: { + keywords: [ "ke", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf0\ud83c\uddea', + fitzpatrick_scale: false, + category: "flags" + }, + kiribati: { + keywords: [ "ki", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf0\ud83c\uddee', + fitzpatrick_scale: false, + category: "flags" + }, + kosovo: { + keywords: [ "xk", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddfd\ud83c\uddf0', + fitzpatrick_scale: false, + category: "flags" + }, + kuwait: { + keywords: [ "kw", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf0\ud83c\uddfc', + fitzpatrick_scale: false, + category: "flags" + }, + kyrgyzstan: { + keywords: [ "kg", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf0\ud83c\uddec', + fitzpatrick_scale: false, + category: "flags" + }, + laos: { + keywords: [ "lao", "democratic", "republic", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf1\ud83c\udde6', + fitzpatrick_scale: false, + category: "flags" + }, + latvia: { + keywords: [ "lv", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf1\ud83c\uddfb', + fitzpatrick_scale: false, + category: "flags" + }, + lebanon: { + keywords: [ "lb", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf1\ud83c\udde7', + fitzpatrick_scale: false, + category: "flags" + }, + lesotho: { + keywords: [ "ls", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf1\ud83c\uddf8', + fitzpatrick_scale: false, + category: "flags" + }, + liberia: { + keywords: [ "lr", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf1\ud83c\uddf7', + fitzpatrick_scale: false, + category: "flags" + }, + libya: { + keywords: [ "ly", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf1\ud83c\uddfe', + fitzpatrick_scale: false, + category: "flags" + }, + liechtenstein: { + keywords: [ "li", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf1\ud83c\uddee', + fitzpatrick_scale: false, + category: "flags" + }, + lithuania: { + keywords: [ "lt", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf1\ud83c\uddf9', + fitzpatrick_scale: false, + category: "flags" + }, + luxembourg: { + keywords: [ "lu", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf1\ud83c\uddfa', + fitzpatrick_scale: false, + category: "flags" + }, + macau: { + keywords: [ "macao", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\uddf4', + fitzpatrick_scale: false, + category: "flags" + }, + macedonia: { + keywords: [ "macedonia,", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\uddf0', + fitzpatrick_scale: false, + category: "flags" + }, + madagascar: { + keywords: [ "mg", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\uddec', + fitzpatrick_scale: false, + category: "flags" + }, + malawi: { + keywords: [ "mw", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\uddfc', + fitzpatrick_scale: false, + category: "flags" + }, + malaysia: { + keywords: [ "my", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\uddfe', + fitzpatrick_scale: false, + category: "flags" + }, + maldives: { + keywords: [ "mv", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\uddfb', + fitzpatrick_scale: false, + category: "flags" + }, + mali: { + keywords: [ "ml", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\uddf1', + fitzpatrick_scale: false, + category: "flags" + }, + malta: { + keywords: [ "mt", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\uddf9', + fitzpatrick_scale: false, + category: "flags" + }, + marshall_islands: { + keywords: [ "marshall", "islands", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\udded', + fitzpatrick_scale: false, + category: "flags" + }, + martinique: { + keywords: [ "mq", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\uddf6', + fitzpatrick_scale: false, + category: "flags" + }, + mauritania: { + keywords: [ "mr", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\uddf7', + fitzpatrick_scale: false, + category: "flags" + }, + mauritius: { + keywords: [ "mu", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\uddfa', + fitzpatrick_scale: false, + category: "flags" + }, + mayotte: { + keywords: [ "yt", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddfe\ud83c\uddf9', + fitzpatrick_scale: false, + category: "flags" + }, + mexico: { + keywords: [ "mx", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\uddfd', + fitzpatrick_scale: false, + category: "flags" + }, + micronesia: { + keywords: [ "micronesia,", "federated", "states", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddeb\ud83c\uddf2', + fitzpatrick_scale: false, + category: "flags" + }, + moldova: { + keywords: [ "moldova,", "republic", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\udde9', + fitzpatrick_scale: false, + category: "flags" + }, + monaco: { + keywords: [ "mc", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\udde8', + fitzpatrick_scale: false, + category: "flags" + }, + mongolia: { + keywords: [ "mn", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\uddf3', + fitzpatrick_scale: false, + category: "flags" + }, + montenegro: { + keywords: [ "me", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\uddea', + fitzpatrick_scale: false, + category: "flags" + }, + montserrat: { + keywords: [ "ms", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\uddf8', + fitzpatrick_scale: false, + category: "flags" + }, + morocco: { + keywords: [ "ma", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\udde6', + fitzpatrick_scale: false, + category: "flags" + }, + mozambique: { + keywords: [ "mz", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\uddff', + fitzpatrick_scale: false, + category: "flags" + }, + myanmar: { + keywords: [ "mm", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\uddf2', + fitzpatrick_scale: false, + category: "flags" + }, + namibia: { + keywords: [ "na", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf3\ud83c\udde6', + fitzpatrick_scale: false, + category: "flags" + }, + nauru: { + keywords: [ "nr", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf3\ud83c\uddf7', + fitzpatrick_scale: false, + category: "flags" + }, + nepal: { + keywords: [ "np", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf3\ud83c\uddf5', + fitzpatrick_scale: false, + category: "flags" + }, + netherlands: { + keywords: [ "nl", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf3\ud83c\uddf1', + fitzpatrick_scale: false, + category: "flags" + }, + new_caledonia: { + keywords: [ "new", "caledonia", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf3\ud83c\udde8', + fitzpatrick_scale: false, + category: "flags" + }, + new_zealand: { + keywords: [ "new", "zealand", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf3\ud83c\uddff', + fitzpatrick_scale: false, + category: "flags" + }, + nicaragua: { + keywords: [ "ni", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf3\ud83c\uddee', + fitzpatrick_scale: false, + category: "flags" + }, + niger: { + keywords: [ "ne", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf3\ud83c\uddea', + fitzpatrick_scale: false, + category: "flags" + }, + nigeria: { + keywords: [ "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf3\ud83c\uddec', + fitzpatrick_scale: false, + category: "flags" + }, + niue: { + keywords: [ "nu", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf3\ud83c\uddfa', + fitzpatrick_scale: false, + category: "flags" + }, + norfolk_island: { + keywords: [ "norfolk", "island", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf3\ud83c\uddeb', + fitzpatrick_scale: false, + category: "flags" + }, + northern_mariana_islands: { + keywords: [ "northern", "mariana", "islands", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf2\ud83c\uddf5', + fitzpatrick_scale: false, + category: "flags" + }, + north_korea: { + keywords: [ "north", "korea", "nation", "flag", "country", "banner" ], + "char": '\ud83c\uddf0\ud83c\uddf5', + fitzpatrick_scale: false, + category: "flags" + }, + norway: { + keywords: [ "no", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf3\ud83c\uddf4', + fitzpatrick_scale: false, + category: "flags" + }, + oman: { + keywords: [ "om_symbol", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf4\ud83c\uddf2', + fitzpatrick_scale: false, + category: "flags" + }, + pakistan: { + keywords: [ "pk", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf5\ud83c\uddf0', + fitzpatrick_scale: false, + category: "flags" + }, + palau: { + keywords: [ "pw", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf5\ud83c\uddfc', + fitzpatrick_scale: false, + category: "flags" + }, + palestinian_territories: { + keywords: [ "palestine", "palestinian", "territories", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf5\ud83c\uddf8', + fitzpatrick_scale: false, + category: "flags" + }, + panama: { + keywords: [ "pa", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf5\ud83c\udde6', + fitzpatrick_scale: false, + category: "flags" + }, + papua_new_guinea: { + keywords: [ "papua", "new", "guinea", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf5\ud83c\uddec', + fitzpatrick_scale: false, + category: "flags" + }, + paraguay: { + keywords: [ "py", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf5\ud83c\uddfe', + fitzpatrick_scale: false, + category: "flags" + }, + peru: { + keywords: [ "pe", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf5\ud83c\uddea', + fitzpatrick_scale: false, + category: "flags" + }, + philippines: { + keywords: [ "ph", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf5\ud83c\udded', + fitzpatrick_scale: false, + category: "flags" + }, + pitcairn_islands: { + keywords: [ "pitcairn", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf5\ud83c\uddf3', + fitzpatrick_scale: false, + category: "flags" + }, + poland: { + keywords: [ "pl", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf5\ud83c\uddf1', + fitzpatrick_scale: false, + category: "flags" + }, + portugal: { + keywords: [ "pt", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf5\ud83c\uddf9', + fitzpatrick_scale: false, + category: "flags" + }, + puerto_rico: { + keywords: [ "puerto", "rico", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf5\ud83c\uddf7', + fitzpatrick_scale: false, + category: "flags" + }, + qatar: { + keywords: [ "qa", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf6\ud83c\udde6', + fitzpatrick_scale: false, + category: "flags" + }, + reunion: { + keywords: [ "r\xe9union", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf7\ud83c\uddea', + fitzpatrick_scale: false, + category: "flags" + }, + romania: { + keywords: [ "ro", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf7\ud83c\uddf4', + fitzpatrick_scale: false, + category: "flags" + }, + ru: { + keywords: [ "russian", "federation", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf7\ud83c\uddfa', + fitzpatrick_scale: false, + category: "flags" + }, + rwanda: { + keywords: [ "rw", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf7\ud83c\uddfc', + fitzpatrick_scale: false, + category: "flags" + }, + st_barthelemy: { + keywords: [ "saint", "barth\xe9lemy", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde7\ud83c\uddf1', + fitzpatrick_scale: false, + category: "flags" + }, + st_helena: { + keywords: [ "saint", "helena", "ascension", "tristan", "cunha", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\udded', + fitzpatrick_scale: false, + category: "flags" + }, + st_kitts_nevis: { + keywords: [ "saint", "kitts", "nevis", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf0\ud83c\uddf3', + fitzpatrick_scale: false, + category: "flags" + }, + st_lucia: { + keywords: [ "saint", "lucia", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf1\ud83c\udde8', + fitzpatrick_scale: false, + category: "flags" + }, + st_pierre_miquelon: { + keywords: [ "saint", "pierre", "miquelon", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf5\ud83c\uddf2', + fitzpatrick_scale: false, + category: "flags" + }, + st_vincent_grenadines: { + keywords: [ "saint", "vincent", "grenadines", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddfb\ud83c\udde8', + fitzpatrick_scale: false, + category: "flags" + }, + samoa: { + keywords: [ "ws", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddfc\ud83c\uddf8', + fitzpatrick_scale: false, + category: "flags" + }, + san_marino: { + keywords: [ "san", "marino", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\uddf2', + fitzpatrick_scale: false, + category: "flags" + }, + sao_tome_principe: { + keywords: [ "sao", "tome", "principe", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\uddf9', + fitzpatrick_scale: false, + category: "flags" + }, + saudi_arabia: { + keywords: [ "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\udde6', + fitzpatrick_scale: false, + category: "flags" + }, + senegal: { + keywords: [ "sn", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\uddf3', + fitzpatrick_scale: false, + category: "flags" + }, + serbia: { + keywords: [ "rs", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf7\ud83c\uddf8', + fitzpatrick_scale: false, + category: "flags" + }, + seychelles: { + keywords: [ "sc", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\udde8', + fitzpatrick_scale: false, + category: "flags" + }, + sierra_leone: { + keywords: [ "sierra", "leone", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\uddf1', + fitzpatrick_scale: false, + category: "flags" + }, + singapore: { + keywords: [ "sg", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\uddec', + fitzpatrick_scale: false, + category: "flags" + }, + sint_maarten: { + keywords: [ "sint", "maarten", "dutch", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\uddfd', + fitzpatrick_scale: false, + category: "flags" + }, + slovakia: { + keywords: [ "sk", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\uddf0', + fitzpatrick_scale: false, + category: "flags" + }, + slovenia: { + keywords: [ "si", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\uddee', + fitzpatrick_scale: false, + category: "flags" + }, + solomon_islands: { + keywords: [ "solomon", "islands", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\udde7', + fitzpatrick_scale: false, + category: "flags" + }, + somalia: { + keywords: [ "so", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\uddf4', + fitzpatrick_scale: false, + category: "flags" + }, + south_africa: { + keywords: [ "south", "africa", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddff\ud83c\udde6', + fitzpatrick_scale: false, + category: "flags" + }, + south_georgia_south_sandwich_islands: { + keywords: [ "south", "georgia", "sandwich", "islands", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddec\ud83c\uddf8', + fitzpatrick_scale: false, + category: "flags" + }, + kr: { + keywords: [ "south", "korea", "nation", "flag", "country", "banner" ], + "char": '\ud83c\uddf0\ud83c\uddf7', + fitzpatrick_scale: false, + category: "flags" + }, + south_sudan: { + keywords: [ "south", "sd", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\uddf8', + fitzpatrick_scale: false, + category: "flags" + }, + es: { + keywords: [ "spain", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddea\ud83c\uddf8', + fitzpatrick_scale: false, + category: "flags" + }, + sri_lanka: { + keywords: [ "sri", "lanka", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf1\ud83c\uddf0', + fitzpatrick_scale: false, + category: "flags" + }, + sudan: { + keywords: [ "sd", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\udde9', + fitzpatrick_scale: false, + category: "flags" + }, + suriname: { + keywords: [ "sr", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\uddf7', + fitzpatrick_scale: false, + category: "flags" + }, + swaziland: { + keywords: [ "sz", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\uddff', + fitzpatrick_scale: false, + category: "flags" + }, + sweden: { + keywords: [ "se", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\uddea', + fitzpatrick_scale: false, + category: "flags" + }, + switzerland: { + keywords: [ "ch", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde8\ud83c\udded', + fitzpatrick_scale: false, + category: "flags" + }, + syria: { + keywords: [ "syrian", "arab", "republic", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf8\ud83c\uddfe', + fitzpatrick_scale: false, + category: "flags" + }, + taiwan: { + keywords: [ "tw", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf9\ud83c\uddfc', + fitzpatrick_scale: false, + category: "flags" + }, + tajikistan: { + keywords: [ "tj", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf9\ud83c\uddef', + fitzpatrick_scale: false, + category: "flags" + }, + tanzania: { + keywords: [ "tanzania,", "united", "republic", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf9\ud83c\uddff', + fitzpatrick_scale: false, + category: "flags" + }, + thailand: { + keywords: [ "th", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf9\ud83c\udded', + fitzpatrick_scale: false, + category: "flags" + }, + timor_leste: { + keywords: [ "timor", "leste", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf9\ud83c\uddf1', + fitzpatrick_scale: false, + category: "flags" + }, + togo: { + keywords: [ "tg", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf9\ud83c\uddec', + fitzpatrick_scale: false, + category: "flags" + }, + tokelau: { + keywords: [ "tk", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf9\ud83c\uddf0', + fitzpatrick_scale: false, + category: "flags" + }, + tonga: { + keywords: [ "to", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf9\ud83c\uddf4', + fitzpatrick_scale: false, + category: "flags" + }, + trinidad_tobago: { + keywords: [ "trinidad", "tobago", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf9\ud83c\uddf9', + fitzpatrick_scale: false, + category: "flags" + }, + tunisia: { + keywords: [ "tn", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf9\ud83c\uddf3', + fitzpatrick_scale: false, + category: "flags" + }, + tr: { + keywords: [ "turkey", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf9\ud83c\uddf7', + fitzpatrick_scale: false, + category: "flags" + }, + turkmenistan: { + keywords: [ "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf9\ud83c\uddf2', + fitzpatrick_scale: false, + category: "flags" + }, + turks_caicos_islands: { + keywords: [ "turks", "caicos", "islands", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf9\ud83c\udde8', + fitzpatrick_scale: false, + category: "flags" + }, + tuvalu: { + keywords: [ "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddf9\ud83c\uddfb', + fitzpatrick_scale: false, + category: "flags" + }, + uganda: { + keywords: [ "ug", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddfa\ud83c\uddec', + fitzpatrick_scale: false, + category: "flags" + }, + ukraine: { + keywords: [ "ua", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddfa\ud83c\udde6', + fitzpatrick_scale: false, + category: "flags" + }, + united_arab_emirates: { + keywords: [ "united", "arab", "emirates", "flag", "nation", "country", "banner" ], + "char": '\ud83c\udde6\ud83c\uddea', + fitzpatrick_scale: false, + category: "flags" + }, + uk: { + keywords: [ "united", "kingdom", "great", "britain", "northern", "ireland", "flag", "nation", "country", "banner", "british", "UK", "english", "england", "union jack" ], + "char": '\ud83c\uddec\ud83c\udde7', + fitzpatrick_scale: false, + category: "flags" + }, + england: { + keywords: [ "flag", "english" ], + "char": '\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f', + fitzpatrick_scale: false, + category: "flags" + }, + scotland: { + keywords: [ "flag", "scottish" ], + "char": '\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f', + fitzpatrick_scale: false, + category: "flags" + }, + wales: { + keywords: [ "flag", "welsh" ], + "char": '\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f', + fitzpatrick_scale: false, + category: "flags" + }, + us: { + keywords: [ "united", "states", "america", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddfa\ud83c\uddf8', + fitzpatrick_scale: false, + category: "flags" + }, + us_virgin_islands: { + keywords: [ "virgin", "islands", "us", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddfb\ud83c\uddee', + fitzpatrick_scale: false, + category: "flags" + }, + uruguay: { + keywords: [ "uy", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddfa\ud83c\uddfe', + fitzpatrick_scale: false, + category: "flags" + }, + uzbekistan: { + keywords: [ "uz", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddfa\ud83c\uddff', + fitzpatrick_scale: false, + category: "flags" + }, + vanuatu: { + keywords: [ "vu", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddfb\ud83c\uddfa', + fitzpatrick_scale: false, + category: "flags" + }, + vatican_city: { + keywords: [ "vatican", "city", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddfb\ud83c\udde6', + fitzpatrick_scale: false, + category: "flags" + }, + venezuela: { + keywords: [ "ve", "bolivarian", "republic", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddfb\ud83c\uddea', + fitzpatrick_scale: false, + category: "flags" + }, + vietnam: { + keywords: [ "viet", "nam", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddfb\ud83c\uddf3', + fitzpatrick_scale: false, + category: "flags" + }, + wallis_futuna: { + keywords: [ "wallis", "futuna", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddfc\ud83c\uddeb', + fitzpatrick_scale: false, + category: "flags" + }, + western_sahara: { + keywords: [ "western", "sahara", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddea\ud83c\udded', + fitzpatrick_scale: false, + category: "flags" + }, + yemen: { + keywords: [ "ye", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddfe\ud83c\uddea', + fitzpatrick_scale: false, + category: "flags" + }, + zambia: { + keywords: [ "zm", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddff\ud83c\uddf2', + fitzpatrick_scale: false, + category: "flags" + }, + zimbabwe: { + keywords: [ "zw", "flag", "nation", "country", "banner" ], + "char": '\ud83c\uddff\ud83c\uddfc', + fitzpatrick_scale: false, + category: "flags" + }, + united_nations: { + keywords: [ "un", "flag", "banner" ], + "char": '\ud83c\uddfa\ud83c\uddf3', + fitzpatrick_scale: false, + category: "flags" + }, + pirate_flag: { + keywords: [ "skull", "crossbones", "flag", "banner" ], + "char": '\ud83c\udff4\u200d\u2620\ufe0f', + fitzpatrick_scale: false, + category: "flags" + } }); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/emoticons/js/emojis.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/emoticons/js/emojis.js index 7dbe2d28..4adb59b0 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/emoticons/js/emojis.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/emoticons/js/emojis.js @@ -1,9423 +1,9423 @@ // Source: npm package: emojilib, file:emojis.json window.tinymce.Resource.add("tinymce.plugins.emoticons", { - grinning: { - keywords: ["face", "smile", "happy", "joy", ":D", "grin"], - "char": "\ud83d\ude00", - fitzpatrick_scale: false, - category: "people" - }, - grimacing: { - keywords: ["face", "grimace", "teeth"], - "char": "\ud83d\ude2c", - fitzpatrick_scale: false, - category: "people" - }, - grin: { - keywords: ["face", "happy", "smile", "joy", "kawaii"], - "char": "\ud83d\ude01", - fitzpatrick_scale: false, - category: "people" - }, - joy: { - keywords: ["face", "cry", "tears", "weep", "happy", "happytears", "haha"], - "char": "\ud83d\ude02", - fitzpatrick_scale: false, - category: "people" - }, - rofl: { - keywords: ["face", "rolling", "floor", "laughing", "lol", "haha"], - "char": "\ud83e\udd23", - fitzpatrick_scale: false, - category: "people" - }, - partying: { - keywords: ["face", "celebration", "woohoo"], - "char": "\ud83e\udd73", - fitzpatrick_scale: false, - category: "people" - }, - smiley: { - keywords: ["face", "happy", "joy", "haha", ":D", ":)", "smile", "funny"], - "char": "\ud83d\ude03", - fitzpatrick_scale: false, - category: "people" - }, - smile: { - keywords: ["face", "happy", "joy", "funny", "haha", "laugh", "like", ":D", ":)"], - "char": "\ud83d\ude04", - fitzpatrick_scale: false, - category: "people" - }, - sweat_smile: { - keywords: ["face", "hot", "happy", "laugh", "sweat", "smile", "relief"], - "char": "\ud83d\ude05", - fitzpatrick_scale: false, - category: "people" - }, - laughing: { - keywords: ["happy", "joy", "lol", "satisfied", "haha", "face", "glad", "XD", "laugh"], - "char": "\ud83d\ude06", - fitzpatrick_scale: false, - category: "people" - }, - innocent: { - keywords: ["face", "angel", "heaven", "halo"], - "char": "\ud83d\ude07", - fitzpatrick_scale: false, - category: "people" - }, - wink: { - keywords: ["face", "happy", "mischievous", "secret", ";)", "smile", "eye"], - "char": "\ud83d\ude09", - fitzpatrick_scale: false, - category: "people" - }, - blush: { - keywords: ["face", "smile", "happy", "flushed", "crush", "embarrassed", "shy", "joy"], - "char": "\ud83d\ude0a", - fitzpatrick_scale: false, - category: "people" - }, - slightly_smiling_face: { - keywords: ["face", "smile"], - "char": "\ud83d\ude42", - fitzpatrick_scale: false, - category: "people" - }, - upside_down_face: { - keywords: ["face", "flipped", "silly", "smile"], - "char": "\ud83d\ude43", - fitzpatrick_scale: false, - category: "people" - }, - relaxed: { - keywords: ["face", "blush", "massage", "happiness"], - "char": "\u263a\ufe0f", - fitzpatrick_scale: false, - category: "people" - }, - yum: { - keywords: ["happy", "joy", "tongue", "smile", "face", "silly", "yummy", "nom", "delicious", "savouring"], - "char": "\ud83d\ude0b", - fitzpatrick_scale: false, - category: "people" - }, - relieved: { - keywords: ["face", "relaxed", "phew", "massage", "happiness"], - "char": "\ud83d\ude0c", - fitzpatrick_scale: false, - category: "people" - }, - heart_eyes: { - keywords: ["face", "love", "like", "affection", "valentines", "infatuation", "crush", "heart"], - "char": "\ud83d\ude0d", - fitzpatrick_scale: false, - category: "people" - }, - smiling_face_with_three_hearts: { - keywords: ["face", "love", "like", "affection", "valentines", "infatuation", "crush", "hearts", "adore"], - "char": "\ud83e\udd70", - fitzpatrick_scale: false, - category: "people" - }, - kissing_heart: { - keywords: ["face", "love", "like", "affection", "valentines", "infatuation", "kiss"], - "char": "\ud83d\ude18", - fitzpatrick_scale: false, - category: "people" - }, - kissing: { - keywords: ["love", "like", "face", "3", "valentines", "infatuation", "kiss"], - "char": "\ud83d\ude17", - fitzpatrick_scale: false, - category: "people" - }, - kissing_smiling_eyes: { - keywords: ["face", "affection", "valentines", "infatuation", "kiss"], - "char": "\ud83d\ude19", - fitzpatrick_scale: false, - category: "people" - }, - kissing_closed_eyes: { - keywords: ["face", "love", "like", "affection", "valentines", "infatuation", "kiss"], - "char": "\ud83d\ude1a", - fitzpatrick_scale: false, - category: "people" - }, - stuck_out_tongue_winking_eye: { - keywords: ["face", "prank", "childish", "playful", "mischievous", "smile", "wink", "tongue"], - "char": "\ud83d\ude1c", - fitzpatrick_scale: false, - category: "people" - }, - zany: { - keywords: ["face", "goofy", "crazy"], - "char": "\ud83e\udd2a", - fitzpatrick_scale: false, - category: "people" - }, - raised_eyebrow: { - keywords: ["face", "distrust", "scepticism", "disapproval", "disbelief", "surprise"], - "char": "\ud83e\udd28", - fitzpatrick_scale: false, - category: "people" - }, - monocle: { - keywords: ["face", "stuffy", "wealthy"], - "char": "\ud83e\uddd0", - fitzpatrick_scale: false, - category: "people" - }, - stuck_out_tongue_closed_eyes: { - keywords: ["face", "prank", "playful", "mischievous", "smile", "tongue"], - "char": "\ud83d\ude1d", - fitzpatrick_scale: false, - category: "people" - }, - stuck_out_tongue: { - keywords: ["face", "prank", "childish", "playful", "mischievous", "smile", "tongue"], - "char": "\ud83d\ude1b", - fitzpatrick_scale: false, - category: "people" - }, - money_mouth_face: { - keywords: ["face", "rich", "dollar", "money"], - "char": "\ud83e\udd11", - fitzpatrick_scale: false, - category: "people" - }, - nerd_face: { - keywords: ["face", "nerdy", "geek", "dork"], - "char": "\ud83e\udd13", - fitzpatrick_scale: false, - category: "people" - }, - sunglasses: { - keywords: ["face", "cool", "smile", "summer", "beach", "sunglass"], - "char": "\ud83d\ude0e", - fitzpatrick_scale: false, - category: "people" - }, - star_struck: { - keywords: ["face", "smile", "starry", "eyes", "grinning"], - "char": "\ud83e\udd29", - fitzpatrick_scale: false, - category: "people" - }, - clown_face: { - keywords: ["face"], - "char": "\ud83e\udd21", - fitzpatrick_scale: false, - category: "people" - }, - cowboy_hat_face: { - keywords: ["face", "cowgirl", "hat"], - "char": "\ud83e\udd20", - fitzpatrick_scale: false, - category: "people" - }, - hugs: { - keywords: ["face", "smile", "hug"], - "char": "\ud83e\udd17", - fitzpatrick_scale: false, - category: "people" - }, - smirk: { - keywords: ["face", "smile", "mean", "prank", "smug", "sarcasm"], - "char": "\ud83d\ude0f", - fitzpatrick_scale: false, - category: "people" - }, - no_mouth: { - keywords: ["face", "hellokitty"], - "char": "\ud83d\ude36", - fitzpatrick_scale: false, - category: "people" - }, - neutral_face: { - keywords: ["indifference", "meh", ":|", "neutral"], - "char": "\ud83d\ude10", - fitzpatrick_scale: false, - category: "people" - }, - expressionless: { - keywords: ["face", "indifferent", "-_-", "meh", "deadpan"], - "char": "\ud83d\ude11", - fitzpatrick_scale: false, - category: "people" - }, - unamused: { - keywords: ["indifference", "bored", "straight face", "serious", "sarcasm", "unimpressed", "skeptical", "dubious", "side_eye"], - "char": "\ud83d\ude12", - fitzpatrick_scale: false, - category: "people" - }, - roll_eyes: { - keywords: ["face", "eyeroll", "frustrated"], - "char": "\ud83d\ude44", - fitzpatrick_scale: false, - category: "people" - }, - thinking: { - keywords: ["face", "hmmm", "think", "consider"], - "char": "\ud83e\udd14", - fitzpatrick_scale: false, - category: "people" - }, - lying_face: { - keywords: ["face", "lie", "pinocchio"], - "char": "\ud83e\udd25", - fitzpatrick_scale: false, - category: "people" - }, - hand_over_mouth: { - keywords: ["face", "whoops", "shock", "surprise"], - "char": "\ud83e\udd2d", - fitzpatrick_scale: false, - category: "people" - }, - shushing: { - keywords: ["face", "quiet", "shhh"], - "char": "\ud83e\udd2b", - fitzpatrick_scale: false, - category: "people" - }, - symbols_over_mouth: { - keywords: ["face", "swearing", "cursing", "cussing", "profanity", "expletive"], - "char": "\ud83e\udd2c", - fitzpatrick_scale: false, - category: "people" - }, - exploding_head: { - keywords: ["face", "shocked", "mind", "blown"], - "char": "\ud83e\udd2f", - fitzpatrick_scale: false, - category: "people" - }, - flushed: { - keywords: ["face", "blush", "shy", "flattered"], - "char": "\ud83d\ude33", - fitzpatrick_scale: false, - category: "people" - }, - disappointed: { - keywords: ["face", "sad", "upset", "depressed", ":("], - "char": "\ud83d\ude1e", - fitzpatrick_scale: false, - category: "people" - }, - worried: { - keywords: ["face", "concern", "nervous", ":("], - "char": "\ud83d\ude1f", - fitzpatrick_scale: false, - category: "people" - }, - angry: { - keywords: ["mad", "face", "annoyed", "frustrated"], - "char": "\ud83d\ude20", - fitzpatrick_scale: false, - category: "people" - }, - rage: { - keywords: ["angry", "mad", "hate", "despise"], - "char": "\ud83d\ude21", - fitzpatrick_scale: false, - category: "people" - }, - pensive: { - keywords: ["face", "sad", "depressed", "upset"], - "char": "\ud83d\ude14", - fitzpatrick_scale: false, - category: "people" - }, - confused: { - keywords: ["face", "indifference", "huh", "weird", "hmmm", ":/"], - "char": "\ud83d\ude15", - fitzpatrick_scale: false, - category: "people" - }, - slightly_frowning_face: { - keywords: ["face", "frowning", "disappointed", "sad", "upset"], - "char": "\ud83d\ude41", - fitzpatrick_scale: false, - category: "people" - }, - frowning_face: { - keywords: ["face", "sad", "upset", "frown"], - "char": "\u2639", - fitzpatrick_scale: false, - category: "people" - }, - persevere: { - keywords: ["face", "sick", "no", "upset", "oops"], - "char": "\ud83d\ude23", - fitzpatrick_scale: false, - category: "people" - }, - confounded: { - keywords: ["face", "confused", "sick", "unwell", "oops", ":S"], - "char": "\ud83d\ude16", - fitzpatrick_scale: false, - category: "people" - }, - tired_face: { - keywords: ["sick", "whine", "upset", "frustrated"], - "char": "\ud83d\ude2b", - fitzpatrick_scale: false, - category: "people" - }, - weary: { - keywords: ["face", "tired", "sleepy", "sad", "frustrated", "upset"], - "char": "\ud83d\ude29", - fitzpatrick_scale: false, - category: "people" - }, - pleading: { - keywords: ["face", "begging", "mercy"], - "char": "\ud83e\udd7a", - fitzpatrick_scale: false, - category: "people" - }, - triumph: { - keywords: ["face", "gas", "phew", "proud", "pride"], - "char": "\ud83d\ude24", - fitzpatrick_scale: false, - category: "people" - }, - open_mouth: { - keywords: ["face", "surprise", "impressed", "wow", "whoa", ":O"], - "char": "\ud83d\ude2e", - fitzpatrick_scale: false, - category: "people" - }, - scream: { - keywords: ["face", "munch", "scared", "omg"], - "char": "\ud83d\ude31", - fitzpatrick_scale: false, - category: "people" - }, - fearful: { - keywords: ["face", "scared", "terrified", "nervous", "oops", "huh"], - "char": "\ud83d\ude28", - fitzpatrick_scale: false, - category: "people" - }, - cold_sweat: { - keywords: ["face", "nervous", "sweat"], - "char": "\ud83d\ude30", - fitzpatrick_scale: false, - category: "people" - }, - hushed: { - keywords: ["face", "woo", "shh"], - "char": "\ud83d\ude2f", - fitzpatrick_scale: false, - category: "people" - }, - frowning: { - keywords: ["face", "aw", "what"], - "char": "\ud83d\ude26", - fitzpatrick_scale: false, - category: "people" - }, - anguished: { - keywords: ["face", "stunned", "nervous"], - "char": "\ud83d\ude27", - fitzpatrick_scale: false, - category: "people" - }, - cry: { - keywords: ["face", "tears", "sad", "depressed", "upset", ":'("], - "char": "\ud83d\ude22", - fitzpatrick_scale: false, - category: "people" - }, - disappointed_relieved: { - keywords: ["face", "phew", "sweat", "nervous"], - "char": "\ud83d\ude25", - fitzpatrick_scale: false, - category: "people" - }, - drooling_face: { - keywords: ["face"], - "char": "\ud83e\udd24", - fitzpatrick_scale: false, - category: "people" - }, - sleepy: { - keywords: ["face", "tired", "rest", "nap"], - "char": "\ud83d\ude2a", - fitzpatrick_scale: false, - category: "people" - }, - sweat: { - keywords: ["face", "hot", "sad", "tired", "exercise"], - "char": "\ud83d\ude13", - fitzpatrick_scale: false, - category: "people" - }, - hot: { - keywords: ["face", "feverish", "heat", "red", "sweating"], - "char": "\ud83e\udd75", - fitzpatrick_scale: false, - category: "people" - }, - cold: { - keywords: ["face", "blue", "freezing", "frozen", "frostbite", "icicles"], - "char": "\ud83e\udd76", - fitzpatrick_scale: false, - category: "people" - }, - sob: { - keywords: ["face", "cry", "tears", "sad", "upset", "depressed"], - "char": "\ud83d\ude2d", - fitzpatrick_scale: false, - category: "people" - }, - dizzy_face: { - keywords: ["spent", "unconscious", "xox", "dizzy"], - "char": "\ud83d\ude35", - fitzpatrick_scale: false, - category: "people" - }, - astonished: { - keywords: ["face", "xox", "surprised", "poisoned"], - "char": "\ud83d\ude32", - fitzpatrick_scale: false, - category: "people" - }, - zipper_mouth_face: { - keywords: ["face", "sealed", "zipper", "secret"], - "char": "\ud83e\udd10", - fitzpatrick_scale: false, - category: "people" - }, - nauseated_face: { - keywords: ["face", "vomit", "gross", "green", "sick", "throw up", "ill"], - "char": "\ud83e\udd22", - fitzpatrick_scale: false, - category: "people" - }, - sneezing_face: { - keywords: ["face", "gesundheit", "sneeze", "sick", "allergy"], - "char": "\ud83e\udd27", - fitzpatrick_scale: false, - category: "people" - }, - vomiting: { - keywords: ["face", "sick"], - "char": "\ud83e\udd2e", - fitzpatrick_scale: false, - category: "people" - }, - mask: { - keywords: ["face", "sick", "ill", "disease"], - "char": "\ud83d\ude37", - fitzpatrick_scale: false, - category: "people" - }, - face_with_thermometer: { - keywords: ["sick", "temperature", "thermometer", "cold", "fever"], - "char": "\ud83e\udd12", - fitzpatrick_scale: false, - category: "people" - }, - face_with_head_bandage: { - keywords: ["injured", "clumsy", "bandage", "hurt"], - "char": "\ud83e\udd15", - fitzpatrick_scale: false, - category: "people" - }, - woozy: { - keywords: ["face", "dizzy", "intoxicated", "tipsy", "wavy"], - "char": "\ud83e\udd74", - fitzpatrick_scale: false, - category: "people" - }, - sleeping: { - keywords: ["face", "tired", "sleepy", "night", "zzz"], - "char": "\ud83d\ude34", - fitzpatrick_scale: false, - category: "people" - }, - zzz: { - keywords: ["sleepy", "tired", "dream"], - "char": "\ud83d\udca4", - fitzpatrick_scale: false, - category: "people" - }, - poop: { - keywords: ["hankey", "shitface", "fail", "turd", "shit"], - "char": "\ud83d\udca9", - fitzpatrick_scale: false, - category: "people" - }, - smiling_imp: { - keywords: ["devil", "horns"], - "char": "\ud83d\ude08", - fitzpatrick_scale: false, - category: "people" - }, - imp: { - keywords: ["devil", "angry", "horns"], - "char": "\ud83d\udc7f", - fitzpatrick_scale: false, - category: "people" - }, - japanese_ogre: { - keywords: ["monster", "red", "mask", "halloween", "scary", "creepy", "devil", "demon", "japanese", "ogre"], - "char": "\ud83d\udc79", - fitzpatrick_scale: false, - category: "people" - }, - japanese_goblin: { - keywords: ["red", "evil", "mask", "monster", "scary", "creepy", "japanese", "goblin"], - "char": "\ud83d\udc7a", - fitzpatrick_scale: false, - category: "people" - }, - skull: { - keywords: ["dead", "skeleton", "creepy", "death"], - "char": "\ud83d\udc80", - fitzpatrick_scale: false, - category: "people" - }, - ghost: { - keywords: ["halloween", "spooky", "scary"], - "char": "\ud83d\udc7b", - fitzpatrick_scale: false, - category: "people" - }, - alien: { - keywords: ["UFO", "paul", "weird", "outer_space"], - "char": "\ud83d\udc7d", - fitzpatrick_scale: false, - category: "people" - }, - robot: { - keywords: ["computer", "machine", "bot"], - "char": "\ud83e\udd16", - fitzpatrick_scale: false, - category: "people" - }, - smiley_cat: { - keywords: ["animal", "cats", "happy", "smile"], - "char": "\ud83d\ude3a", - fitzpatrick_scale: false, - category: "people" - }, - smile_cat: { - keywords: ["animal", "cats", "smile"], - "char": "\ud83d\ude38", - fitzpatrick_scale: false, - category: "people" - }, - joy_cat: { - keywords: ["animal", "cats", "haha", "happy", "tears"], - "char": "\ud83d\ude39", - fitzpatrick_scale: false, - category: "people" - }, - heart_eyes_cat: { - keywords: ["animal", "love", "like", "affection", "cats", "valentines", "heart"], - "char": "\ud83d\ude3b", - fitzpatrick_scale: false, - category: "people" - }, - smirk_cat: { - keywords: ["animal", "cats", "smirk"], - "char": "\ud83d\ude3c", - fitzpatrick_scale: false, - category: "people" - }, - kissing_cat: { - keywords: ["animal", "cats", "kiss"], - "char": "\ud83d\ude3d", - fitzpatrick_scale: false, - category: "people" - }, - scream_cat: { - keywords: ["animal", "cats", "munch", "scared", "scream"], - "char": "\ud83d\ude40", - fitzpatrick_scale: false, - category: "people" - }, - crying_cat_face: { - keywords: ["animal", "tears", "weep", "sad", "cats", "upset", "cry"], - "char": "\ud83d\ude3f", - fitzpatrick_scale: false, - category: "people" - }, - pouting_cat: { - keywords: ["animal", "cats"], - "char": "\ud83d\ude3e", - fitzpatrick_scale: false, - category: "people" - }, - palms_up: { - keywords: ["hands", "gesture", "cupped", "prayer"], - "char": "\ud83e\udd32", - fitzpatrick_scale: true, - category: "people" - }, - raised_hands: { - keywords: ["gesture", "hooray", "yea", "celebration", "hands"], - "char": "\ud83d\ude4c", - fitzpatrick_scale: true, - category: "people" - }, - clap: { - keywords: ["hands", "praise", "applause", "congrats", "yay"], - "char": "\ud83d\udc4f", - fitzpatrick_scale: true, - category: "people" - }, - wave: { - keywords: ["hands", "gesture", "goodbye", "solong", "farewell", "hello", "hi", "palm"], - "char": "\ud83d\udc4b", - fitzpatrick_scale: true, - category: "people" - }, - call_me_hand: { - keywords: ["hands", "gesture"], - "char": "\ud83e\udd19", - fitzpatrick_scale: true, - category: "people" - }, - "+1": { - keywords: ["thumbsup", "yes", "awesome", "good", "agree", "accept", "cool", "hand", "like"], - "char": "\ud83d\udc4d", - fitzpatrick_scale: true, - category: "people" - }, - "-1": { - keywords: ["thumbsdown", "no", "dislike", "hand"], - "char": "\ud83d\udc4e", - fitzpatrick_scale: true, - category: "people" - }, - facepunch: { - keywords: ["angry", "violence", "fist", "hit", "attack", "hand"], - "char": "\ud83d\udc4a", - fitzpatrick_scale: true, - category: "people" - }, - fist: { - keywords: ["fingers", "hand", "grasp"], - "char": "\u270a", - fitzpatrick_scale: true, - category: "people" - }, - fist_left: { - keywords: ["hand", "fistbump"], - "char": "\ud83e\udd1b", - fitzpatrick_scale: true, - category: "people" - }, - fist_right: { - keywords: ["hand", "fistbump"], - "char": "\ud83e\udd1c", - fitzpatrick_scale: true, - category: "people" - }, - v: { - keywords: ["fingers", "ohyeah", "hand", "peace", "victory", "two"], - "char": "\u270c", - fitzpatrick_scale: true, - category: "people" - }, - ok_hand: { - keywords: ["fingers", "limbs", "perfect", "ok", "okay"], - "char": "\ud83d\udc4c", - fitzpatrick_scale: true, - category: "people" - }, - raised_hand: { - keywords: ["fingers", "stop", "highfive", "palm", "ban"], - "char": "\u270b", - fitzpatrick_scale: true, - category: "people" - }, - raised_back_of_hand: { - keywords: ["fingers", "raised", "backhand"], - "char": "\ud83e\udd1a", - fitzpatrick_scale: true, - category: "people" - }, - open_hands: { - keywords: ["fingers", "butterfly", "hands", "open"], - "char": "\ud83d\udc50", - fitzpatrick_scale: true, - category: "people" - }, - muscle: { - keywords: ["arm", "flex", "hand", "summer", "strong", "biceps"], - "char": "\ud83d\udcaa", - fitzpatrick_scale: true, - category: "people" - }, - pray: { - keywords: ["please", "hope", "wish", "namaste", "highfive"], - "char": "\ud83d\ude4f", - fitzpatrick_scale: true, - category: "people" - }, - foot: { - keywords: ["kick", "stomp"], - "char": "\ud83e\uddb6", - fitzpatrick_scale: true, - category: "people" - }, - leg: { - keywords: ["kick", "limb"], - "char": "\ud83e\uddb5", - fitzpatrick_scale: true, - category: "people" - }, - handshake: { - keywords: ["agreement", "shake"], - "char": "\ud83e\udd1d", - fitzpatrick_scale: false, - category: "people" - }, - point_up: { - keywords: ["hand", "fingers", "direction", "up"], - "char": "\u261d", - fitzpatrick_scale: true, - category: "people" - }, - point_up_2: { - keywords: ["fingers", "hand", "direction", "up"], - "char": "\ud83d\udc46", - fitzpatrick_scale: true, - category: "people" - }, - point_down: { - keywords: ["fingers", "hand", "direction", "down"], - "char": "\ud83d\udc47", - fitzpatrick_scale: true, - category: "people" - }, - point_left: { - keywords: ["direction", "fingers", "hand", "left"], - "char": "\ud83d\udc48", - fitzpatrick_scale: true, - category: "people" - }, - point_right: { - keywords: ["fingers", "hand", "direction", "right"], - "char": "\ud83d\udc49", - fitzpatrick_scale: true, - category: "people" - }, - fu: { - keywords: ["hand", "fingers", "rude", "middle", "flipping"], - "char": "\ud83d\udd95", - fitzpatrick_scale: true, - category: "people" - }, - raised_hand_with_fingers_splayed: { - keywords: ["hand", "fingers", "palm"], - "char": "\ud83d\udd90", - fitzpatrick_scale: true, - category: "people" - }, - love_you: { - keywords: ["hand", "fingers", "gesture"], - "char": "\ud83e\udd1f", - fitzpatrick_scale: true, - category: "people" - }, - metal: { - keywords: ["hand", "fingers", "evil_eye", "sign_of_horns", "rock_on"], - "char": "\ud83e\udd18", - fitzpatrick_scale: true, - category: "people" - }, - crossed_fingers: { - keywords: ["good", "lucky"], - "char": "\ud83e\udd1e", - fitzpatrick_scale: true, - category: "people" - }, - vulcan_salute: { - keywords: ["hand", "fingers", "spock", "star trek"], - "char": "\ud83d\udd96", - fitzpatrick_scale: true, - category: "people" - }, - writing_hand: { - keywords: ["lower_left_ballpoint_pen", "stationery", "write", "compose"], - "char": "\u270d", - fitzpatrick_scale: true, - category: "people" - }, - selfie: { - keywords: ["camera", "phone"], - "char": "\ud83e\udd33", - fitzpatrick_scale: true, - category: "people" - }, - nail_care: { - keywords: ["beauty", "manicure", "finger", "fashion", "nail"], - "char": "\ud83d\udc85", - fitzpatrick_scale: true, - category: "people" - }, - lips: { - keywords: ["mouth", "kiss"], - "char": "\ud83d\udc44", - fitzpatrick_scale: false, - category: "people" - }, - tooth: { - keywords: ["teeth", "dentist"], - "char": "\ud83e\uddb7", - fitzpatrick_scale: false, - category: "people" - }, - tongue: { - keywords: ["mouth", "playful"], - "char": "\ud83d\udc45", - fitzpatrick_scale: false, - category: "people" - }, - ear: { - keywords: ["face", "hear", "sound", "listen"], - "char": "\ud83d\udc42", - fitzpatrick_scale: true, - category: "people" - }, - nose: { - keywords: ["smell", "sniff"], - "char": "\ud83d\udc43", - fitzpatrick_scale: true, - category: "people" - }, - eye: { - keywords: ["face", "look", "see", "watch", "stare"], - "char": "\ud83d\udc41", - fitzpatrick_scale: false, - category: "people" - }, - eyes: { - keywords: ["look", "watch", "stalk", "peek", "see"], - "char": "\ud83d\udc40", - fitzpatrick_scale: false, - category: "people" - }, - brain: { - keywords: ["smart", "intelligent"], - "char": "\ud83e\udde0", - fitzpatrick_scale: false, - category: "people" - }, - bust_in_silhouette: { - keywords: ["user", "person", "human"], - "char": "\ud83d\udc64", - fitzpatrick_scale: false, - category: "people" - }, - busts_in_silhouette: { - keywords: ["user", "person", "human", "group", "team"], - "char": "\ud83d\udc65", - fitzpatrick_scale: false, - category: "people" - }, - speaking_head: { - keywords: ["user", "person", "human", "sing", "say", "talk"], - "char": "\ud83d\udde3", - fitzpatrick_scale: false, - category: "people" - }, - baby: { - keywords: ["child", "boy", "girl", "toddler"], - "char": "\ud83d\udc76", - fitzpatrick_scale: true, - category: "people" - }, - child: { - keywords: ["gender-neutral", "young"], - "char": "\ud83e\uddd2", - fitzpatrick_scale: true, - category: "people" - }, - boy: { - keywords: ["man", "male", "guy", "teenager"], - "char": "\ud83d\udc66", - fitzpatrick_scale: true, - category: "people" - }, - girl: { - keywords: ["female", "woman", "teenager"], - "char": "\ud83d\udc67", - fitzpatrick_scale: true, - category: "people" - }, - adult: { - keywords: ["gender-neutral", "person"], - "char": "\ud83e\uddd1", - fitzpatrick_scale: true, - category: "people" - }, - man: { - keywords: ["mustache", "father", "dad", "guy", "classy", "sir", "moustache"], - "char": "\ud83d\udc68", - fitzpatrick_scale: true, - category: "people" - }, - woman: { - keywords: ["female", "girls", "lady"], - "char": "\ud83d\udc69", - fitzpatrick_scale: true, - category: "people" - }, - blonde_woman: { - keywords: ["woman", "female", "girl", "blonde", "person"], - "char": "\ud83d\udc71\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - blonde_man: { - keywords: ["man", "male", "boy", "blonde", "guy", "person"], - "char": "\ud83d\udc71", - fitzpatrick_scale: true, - category: "people" - }, - bearded_person: { - keywords: ["person", "bewhiskered"], - "char": "\ud83e\uddd4", - fitzpatrick_scale: true, - category: "people" - }, - older_adult: { - keywords: ["human", "elder", "senior", "gender-neutral"], - "char": "\ud83e\uddd3", - fitzpatrick_scale: true, - category: "people" - }, - older_man: { - keywords: ["human", "male", "men", "old", "elder", "senior"], - "char": "\ud83d\udc74", - fitzpatrick_scale: true, - category: "people" - }, - older_woman: { - keywords: ["human", "female", "women", "lady", "old", "elder", "senior"], - "char": "\ud83d\udc75", - fitzpatrick_scale: true, - category: "people" - }, - man_with_gua_pi_mao: { - keywords: ["male", "boy", "chinese"], - "char": "\ud83d\udc72", - fitzpatrick_scale: true, - category: "people" - }, - woman_with_headscarf: { - keywords: ["female", "hijab", "mantilla", "tichel"], - "char": "\ud83e\uddd5", - fitzpatrick_scale: true, - category: "people" - }, - woman_with_turban: { - keywords: ["female", "indian", "hinduism", "arabs", "woman"], - "char": "\ud83d\udc73\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - man_with_turban: { - keywords: ["male", "indian", "hinduism", "arabs"], - "char": "\ud83d\udc73", - fitzpatrick_scale: true, - category: "people" - }, - policewoman: { - keywords: ["woman", "police", "law", "legal", "enforcement", "arrest", "911", "female"], - "char": "\ud83d\udc6e\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - policeman: { - keywords: ["man", "police", "law", "legal", "enforcement", "arrest", "911"], - "char": "\ud83d\udc6e", - fitzpatrick_scale: true, - category: "people" - }, - construction_worker_woman: { - keywords: ["female", "human", "wip", "build", "construction", "worker", "labor", "woman"], - "char": "\ud83d\udc77\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - construction_worker_man: { - keywords: ["male", "human", "wip", "guy", "build", "construction", "worker", "labor"], - "char": "\ud83d\udc77", - fitzpatrick_scale: true, - category: "people" - }, - guardswoman: { - keywords: ["uk", "gb", "british", "female", "royal", "woman"], - "char": "\ud83d\udc82\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - guardsman: { - keywords: ["uk", "gb", "british", "male", "guy", "royal"], - "char": "\ud83d\udc82", - fitzpatrick_scale: true, - category: "people" - }, - female_detective: { - keywords: ["human", "spy", "detective", "female", "woman"], - "char": "\ud83d\udd75\ufe0f\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - male_detective: { - keywords: ["human", "spy", "detective"], - "char": "\ud83d\udd75", - fitzpatrick_scale: true, - category: "people" - }, - woman_health_worker: { - keywords: ["doctor", "nurse", "therapist", "healthcare", "woman", "human"], - "char": "\ud83d\udc69\u200d\u2695\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - man_health_worker: { - keywords: ["doctor", "nurse", "therapist", "healthcare", "man", "human"], - "char": "\ud83d\udc68\u200d\u2695\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - woman_farmer: { - keywords: ["rancher", "gardener", "woman", "human"], - "char": "\ud83d\udc69\u200d\ud83c\udf3e", - fitzpatrick_scale: true, - category: "people" - }, - man_farmer: { - keywords: ["rancher", "gardener", "man", "human"], - "char": "\ud83d\udc68\u200d\ud83c\udf3e", - fitzpatrick_scale: true, - category: "people" - }, - woman_cook: { - keywords: ["chef", "woman", "human"], - "char": "\ud83d\udc69\u200d\ud83c\udf73", - fitzpatrick_scale: true, - category: "people" - }, - man_cook: { - keywords: ["chef", "man", "human"], - "char": "\ud83d\udc68\u200d\ud83c\udf73", - fitzpatrick_scale: true, - category: "people" - }, - woman_student: { - keywords: ["graduate", "woman", "human"], - "char": "\ud83d\udc69\u200d\ud83c\udf93", - fitzpatrick_scale: true, - category: "people" - }, - man_student: { - keywords: ["graduate", "man", "human"], - "char": "\ud83d\udc68\u200d\ud83c\udf93", - fitzpatrick_scale: true, - category: "people" - }, - woman_singer: { - keywords: ["rockstar", "entertainer", "woman", "human"], - "char": "\ud83d\udc69\u200d\ud83c\udfa4", - fitzpatrick_scale: true, - category: "people" - }, - man_singer: { - keywords: ["rockstar", "entertainer", "man", "human"], - "char": "\ud83d\udc68\u200d\ud83c\udfa4", - fitzpatrick_scale: true, - category: "people" - }, - woman_teacher: { - keywords: ["instructor", "professor", "woman", "human"], - "char": "\ud83d\udc69\u200d\ud83c\udfeb", - fitzpatrick_scale: true, - category: "people" - }, - man_teacher: { - keywords: ["instructor", "professor", "man", "human"], - "char": "\ud83d\udc68\u200d\ud83c\udfeb", - fitzpatrick_scale: true, - category: "people" - }, - woman_factory_worker: { - keywords: ["assembly", "industrial", "woman", "human"], - "char": "\ud83d\udc69\u200d\ud83c\udfed", - fitzpatrick_scale: true, - category: "people" - }, - man_factory_worker: { - keywords: ["assembly", "industrial", "man", "human"], - "char": "\ud83d\udc68\u200d\ud83c\udfed", - fitzpatrick_scale: true, - category: "people" - }, - woman_technologist: { - keywords: ["coder", "developer", "engineer", "programmer", "software", "woman", "human", "laptop", "computer"], - "char": "\ud83d\udc69\u200d\ud83d\udcbb", - fitzpatrick_scale: true, - category: "people" - }, - man_technologist: { - keywords: ["coder", "developer", "engineer", "programmer", "software", "man", "human", "laptop", "computer"], - "char": "\ud83d\udc68\u200d\ud83d\udcbb", - fitzpatrick_scale: true, - category: "people" - }, - woman_office_worker: { - keywords: ["business", "manager", "woman", "human"], - "char": "\ud83d\udc69\u200d\ud83d\udcbc", - fitzpatrick_scale: true, - category: "people" - }, - man_office_worker: { - keywords: ["business", "manager", "man", "human"], - "char": "\ud83d\udc68\u200d\ud83d\udcbc", - fitzpatrick_scale: true, - category: "people" - }, - woman_mechanic: { - keywords: ["plumber", "woman", "human", "wrench"], - "char": "\ud83d\udc69\u200d\ud83d\udd27", - fitzpatrick_scale: true, - category: "people" - }, - man_mechanic: { - keywords: ["plumber", "man", "human", "wrench"], - "char": "\ud83d\udc68\u200d\ud83d\udd27", - fitzpatrick_scale: true, - category: "people" - }, - woman_scientist: { - keywords: ["biologist", "chemist", "engineer", "physicist", "woman", "human"], - "char": "\ud83d\udc69\u200d\ud83d\udd2c", - fitzpatrick_scale: true, - category: "people" - }, - man_scientist: { - keywords: ["biologist", "chemist", "engineer", "physicist", "man", "human"], - "char": "\ud83d\udc68\u200d\ud83d\udd2c", - fitzpatrick_scale: true, - category: "people" - }, - woman_artist: { - keywords: ["painter", "woman", "human"], - "char": "\ud83d\udc69\u200d\ud83c\udfa8", - fitzpatrick_scale: true, - category: "people" - }, - man_artist: { - keywords: ["painter", "man", "human"], - "char": "\ud83d\udc68\u200d\ud83c\udfa8", - fitzpatrick_scale: true, - category: "people" - }, - woman_firefighter: { - keywords: ["fireman", "woman", "human"], - "char": "\ud83d\udc69\u200d\ud83d\ude92", - fitzpatrick_scale: true, - category: "people" - }, - man_firefighter: { - keywords: ["fireman", "man", "human"], - "char": "\ud83d\udc68\u200d\ud83d\ude92", - fitzpatrick_scale: true, - category: "people" - }, - woman_pilot: { - keywords: ["aviator", "plane", "woman", "human"], - "char": "\ud83d\udc69\u200d\u2708\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - man_pilot: { - keywords: ["aviator", "plane", "man", "human"], - "char": "\ud83d\udc68\u200d\u2708\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - woman_astronaut: { - keywords: ["space", "rocket", "woman", "human"], - "char": "\ud83d\udc69\u200d\ud83d\ude80", - fitzpatrick_scale: true, - category: "people" - }, - man_astronaut: { - keywords: ["space", "rocket", "man", "human"], - "char": "\ud83d\udc68\u200d\ud83d\ude80", - fitzpatrick_scale: true, - category: "people" - }, - woman_judge: { - keywords: ["justice", "court", "woman", "human"], - "char": "\ud83d\udc69\u200d\u2696\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - man_judge: { - keywords: ["justice", "court", "man", "human"], - "char": "\ud83d\udc68\u200d\u2696\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - woman_superhero: { - keywords: ["woman", "female", "good", "heroine", "superpowers"], - "char": "\ud83e\uddb8\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - man_superhero: { - keywords: ["man", "male", "good", "hero", "superpowers"], - "char": "\ud83e\uddb8\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - woman_supervillain: { - keywords: ["woman", "female", "evil", "bad", "criminal", "heroine", "superpowers"], - "char": "\ud83e\uddb9\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - man_supervillain: { - keywords: ["man", "male", "evil", "bad", "criminal", "hero", "superpowers"], - "char": "\ud83e\uddb9\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - mrs_claus: { - keywords: ["woman", "female", "xmas", "mother christmas"], - "char": "\ud83e\udd36", - fitzpatrick_scale: true, - category: "people" - }, - santa: { - keywords: ["festival", "man", "male", "xmas", "father christmas"], - "char": "\ud83c\udf85", - fitzpatrick_scale: true, - category: "people" - }, - sorceress: { - keywords: ["woman", "female", "mage", "witch"], - "char": "\ud83e\uddd9\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - wizard: { - keywords: ["man", "male", "mage", "sorcerer"], - "char": "\ud83e\uddd9\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - woman_elf: { - keywords: ["woman", "female"], - "char": "\ud83e\udddd\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - man_elf: { - keywords: ["man", "male"], - "char": "\ud83e\udddd\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - woman_vampire: { - keywords: ["woman", "female"], - "char": "\ud83e\udddb\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - man_vampire: { - keywords: ["man", "male", "dracula"], - "char": "\ud83e\udddb\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - woman_zombie: { - keywords: ["woman", "female", "undead", "walking dead"], - "char": "\ud83e\udddf\u200d\u2640\ufe0f", - fitzpatrick_scale: false, - category: "people" - }, - man_zombie: { - keywords: ["man", "male", "dracula", "undead", "walking dead"], - "char": "\ud83e\udddf\u200d\u2642\ufe0f", - fitzpatrick_scale: false, - category: "people" - }, - woman_genie: { - keywords: ["woman", "female"], - "char": "\ud83e\uddde\u200d\u2640\ufe0f", - fitzpatrick_scale: false, - category: "people" - }, - man_genie: { - keywords: ["man", "male"], - "char": "\ud83e\uddde\u200d\u2642\ufe0f", - fitzpatrick_scale: false, - category: "people" - }, - mermaid: { - keywords: ["woman", "female", "merwoman", "ariel"], - "char": "\ud83e\udddc\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - merman: { - keywords: ["man", "male", "triton"], - "char": "\ud83e\udddc\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - woman_fairy: { - keywords: ["woman", "female"], - "char": "\ud83e\uddda\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - man_fairy: { - keywords: ["man", "male"], - "char": "\ud83e\uddda\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - angel: { - keywords: ["heaven", "wings", "halo"], - "char": "\ud83d\udc7c", - fitzpatrick_scale: true, - category: "people" - }, - pregnant_woman: { - keywords: ["baby"], - "char": "\ud83e\udd30", - fitzpatrick_scale: true, - category: "people" - }, - breastfeeding: { - keywords: ["nursing", "baby"], - "char": "\ud83e\udd31", - fitzpatrick_scale: true, - category: "people" - }, - princess: { - keywords: ["girl", "woman", "female", "blond", "crown", "royal", "queen"], - "char": "\ud83d\udc78", - fitzpatrick_scale: true, - category: "people" - }, - prince: { - keywords: ["boy", "man", "male", "crown", "royal", "king"], - "char": "\ud83e\udd34", - fitzpatrick_scale: true, - category: "people" - }, - bride_with_veil: { - keywords: ["couple", "marriage", "wedding", "woman", "bride"], - "char": "\ud83d\udc70", - fitzpatrick_scale: true, - category: "people" - }, - man_in_tuxedo: { - keywords: ["couple", "marriage", "wedding", "groom"], - "char": "\ud83e\udd35", - fitzpatrick_scale: true, - category: "people" - }, - running_woman: { - keywords: ["woman", "walking", "exercise", "race", "running", "female"], - "char": "\ud83c\udfc3\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - running_man: { - keywords: ["man", "walking", "exercise", "race", "running"], - "char": "\ud83c\udfc3", - fitzpatrick_scale: true, - category: "people" - }, - walking_woman: { - keywords: ["human", "feet", "steps", "woman", "female"], - "char": "\ud83d\udeb6\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - walking_man: { - keywords: ["human", "feet", "steps"], - "char": "\ud83d\udeb6", - fitzpatrick_scale: true, - category: "people" - }, - dancer: { - keywords: ["female", "girl", "woman", "fun"], - "char": "\ud83d\udc83", - fitzpatrick_scale: true, - category: "people" - }, - man_dancing: { - keywords: ["male", "boy", "fun", "dancer"], - "char": "\ud83d\udd7a", - fitzpatrick_scale: true, - category: "people" - }, - dancing_women: { - keywords: ["female", "bunny", "women", "girls"], - "char": "\ud83d\udc6f", - fitzpatrick_scale: false, - category: "people" - }, - dancing_men: { - keywords: ["male", "bunny", "men", "boys"], - "char": "\ud83d\udc6f\u200d\u2642\ufe0f", - fitzpatrick_scale: false, - category: "people" - }, - couple: { - keywords: ["pair", "people", "human", "love", "date", "dating", "like", "affection", "valentines", "marriage"], - "char": "\ud83d\udc6b", - fitzpatrick_scale: false, - category: "people" - }, - two_men_holding_hands: { - keywords: ["pair", "couple", "love", "like", "bromance", "friendship", "people", "human"], - "char": "\ud83d\udc6c", - fitzpatrick_scale: false, - category: "people" - }, - two_women_holding_hands: { - keywords: ["pair", "friendship", "couple", "love", "like", "female", "people", "human"], - "char": "\ud83d\udc6d", - fitzpatrick_scale: false, - category: "people" - }, - bowing_woman: { - keywords: ["woman", "female", "girl"], - "char": "\ud83d\ude47\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - bowing_man: { - keywords: ["man", "male", "boy"], - "char": "\ud83d\ude47", - fitzpatrick_scale: true, - category: "people" - }, - man_facepalming: { - keywords: ["man", "male", "boy", "disbelief"], - "char": "\ud83e\udd26\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - woman_facepalming: { - keywords: ["woman", "female", "girl", "disbelief"], - "char": "\ud83e\udd26\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - woman_shrugging: { - keywords: ["woman", "female", "girl", "confused", "indifferent", "doubt"], - "char": "\ud83e\udd37", - fitzpatrick_scale: true, - category: "people" - }, - man_shrugging: { - keywords: ["man", "male", "boy", "confused", "indifferent", "doubt"], - "char": "\ud83e\udd37\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - tipping_hand_woman: { - keywords: ["female", "girl", "woman", "human", "information"], - "char": "\ud83d\udc81", - fitzpatrick_scale: true, - category: "people" - }, - tipping_hand_man: { - keywords: ["male", "boy", "man", "human", "information"], - "char": "\ud83d\udc81\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - no_good_woman: { - keywords: ["female", "girl", "woman", "nope"], - "char": "\ud83d\ude45", - fitzpatrick_scale: true, - category: "people" - }, - no_good_man: { - keywords: ["male", "boy", "man", "nope"], - "char": "\ud83d\ude45\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - ok_woman: { - keywords: ["women", "girl", "female", "pink", "human", "woman"], - "char": "\ud83d\ude46", - fitzpatrick_scale: true, - category: "people" - }, - ok_man: { - keywords: ["men", "boy", "male", "blue", "human", "man"], - "char": "\ud83d\ude46\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - raising_hand_woman: { - keywords: ["female", "girl", "woman"], - "char": "\ud83d\ude4b", - fitzpatrick_scale: true, - category: "people" - }, - raising_hand_man: { - keywords: ["male", "boy", "man"], - "char": "\ud83d\ude4b\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - pouting_woman: { - keywords: ["female", "girl", "woman"], - "char": "\ud83d\ude4e", - fitzpatrick_scale: true, - category: "people" - }, - pouting_man: { - keywords: ["male", "boy", "man"], - "char": "\ud83d\ude4e\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - frowning_woman: { - keywords: ["female", "girl", "woman", "sad", "depressed", "discouraged", "unhappy"], - "char": "\ud83d\ude4d", - fitzpatrick_scale: true, - category: "people" - }, - frowning_man: { - keywords: ["male", "boy", "man", "sad", "depressed", "discouraged", "unhappy"], - "char": "\ud83d\ude4d\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - haircut_woman: { - keywords: ["female", "girl", "woman"], - "char": "\ud83d\udc87", - fitzpatrick_scale: true, - category: "people" - }, - haircut_man: { - keywords: ["male", "boy", "man"], - "char": "\ud83d\udc87\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - massage_woman: { - keywords: ["female", "girl", "woman", "head"], - "char": "\ud83d\udc86", - fitzpatrick_scale: true, - category: "people" - }, - massage_man: { - keywords: ["male", "boy", "man", "head"], - "char": "\ud83d\udc86\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - woman_in_steamy_room: { - keywords: ["female", "woman", "spa", "steamroom", "sauna"], - "char": "\ud83e\uddd6\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - man_in_steamy_room: { - keywords: ["male", "man", "spa", "steamroom", "sauna"], - "char": "\ud83e\uddd6\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "people" - }, - couple_with_heart_woman_man: { - keywords: ["pair", "love", "like", "affection", "human", "dating", "valentines", "marriage"], - "char": "\ud83d\udc91", - fitzpatrick_scale: false, - category: "people" - }, - couple_with_heart_woman_woman: { - keywords: ["pair", "love", "like", "affection", "human", "dating", "valentines", "marriage"], - "char": "\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc69", - fitzpatrick_scale: false, - category: "people" - }, - couple_with_heart_man_man: { - keywords: ["pair", "love", "like", "affection", "human", "dating", "valentines", "marriage"], - "char": "\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68", - fitzpatrick_scale: false, - category: "people" - }, - couplekiss_man_woman: { - keywords: ["pair", "valentines", "love", "like", "dating", "marriage"], - "char": "\ud83d\udc8f", - fitzpatrick_scale: false, - category: "people" - }, - couplekiss_woman_woman: { - keywords: ["pair", "valentines", "love", "like", "dating", "marriage"], - "char": "\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69", - fitzpatrick_scale: false, - category: "people" - }, - couplekiss_man_man: { - keywords: ["pair", "valentines", "love", "like", "dating", "marriage"], - "char": "\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68", - fitzpatrick_scale: false, - category: "people" - }, - family_man_woman_boy: { - keywords: ["home", "parents", "child", "mom", "dad", "father", "mother", "people", "human"], - "char": "\ud83d\udc6a", - fitzpatrick_scale: false, - category: "people" - }, - family_man_woman_girl: { - keywords: ["home", "parents", "people", "human", "child"], - "char": "\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67", - fitzpatrick_scale: false, - category: "people" - }, - family_man_woman_girl_boy: { - keywords: ["home", "parents", "people", "human", "children"], - "char": "\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc66", - fitzpatrick_scale: false, - category: "people" - }, - family_man_woman_boy_boy: { - keywords: ["home", "parents", "people", "human", "children"], - "char": "\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66", - fitzpatrick_scale: false, - category: "people" - }, - family_man_woman_girl_girl: { - keywords: ["home", "parents", "people", "human", "children"], - "char": "\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc67", - fitzpatrick_scale: false, - category: "people" - }, - family_woman_woman_boy: { - keywords: ["home", "parents", "people", "human", "children"], - "char": "\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66", - fitzpatrick_scale: false, - category: "people" - }, - family_woman_woman_girl: { - keywords: ["home", "parents", "people", "human", "children"], - "char": "\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67", - fitzpatrick_scale: false, - category: "people" - }, - family_woman_woman_girl_boy: { - keywords: ["home", "parents", "people", "human", "children"], - "char": "\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc66", - fitzpatrick_scale: false, - category: "people" - }, - family_woman_woman_boy_boy: { - keywords: ["home", "parents", "people", "human", "children"], - "char": "\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66", - fitzpatrick_scale: false, - category: "people" - }, - family_woman_woman_girl_girl: { - keywords: ["home", "parents", "people", "human", "children"], - "char": "\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc67", - fitzpatrick_scale: false, - category: "people" - }, - family_man_man_boy: { - keywords: ["home", "parents", "people", "human", "children"], - "char": "\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66", - fitzpatrick_scale: false, - category: "people" - }, - family_man_man_girl: { - keywords: ["home", "parents", "people", "human", "children"], - "char": "\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67", - fitzpatrick_scale: false, - category: "people" - }, - family_man_man_girl_boy: { - keywords: ["home", "parents", "people", "human", "children"], - "char": "\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc66", - fitzpatrick_scale: false, - category: "people" - }, - family_man_man_boy_boy: { - keywords: ["home", "parents", "people", "human", "children"], - "char": "\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66", - fitzpatrick_scale: false, - category: "people" - }, - family_man_man_girl_girl: { - keywords: ["home", "parents", "people", "human", "children"], - "char": "\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc67", - fitzpatrick_scale: false, - category: "people" - }, - family_woman_boy: { - keywords: ["home", "parent", "people", "human", "child"], - "char": "\ud83d\udc69\u200d\ud83d\udc66", - fitzpatrick_scale: false, - category: "people" - }, - family_woman_girl: { - keywords: ["home", "parent", "people", "human", "child"], - "char": "\ud83d\udc69\u200d\ud83d\udc67", - fitzpatrick_scale: false, - category: "people" - }, - family_woman_girl_boy: { - keywords: ["home", "parent", "people", "human", "children"], - "char": "\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc66", - fitzpatrick_scale: false, - category: "people" - }, - family_woman_boy_boy: { - keywords: ["home", "parent", "people", "human", "children"], - "char": "\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66", - fitzpatrick_scale: false, - category: "people" - }, - family_woman_girl_girl: { - keywords: ["home", "parent", "people", "human", "children"], - "char": "\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc67", - fitzpatrick_scale: false, - category: "people" - }, - family_man_boy: { - keywords: ["home", "parent", "people", "human", "child"], - "char": "\ud83d\udc68\u200d\ud83d\udc66", - fitzpatrick_scale: false, - category: "people" - }, - family_man_girl: { - keywords: ["home", "parent", "people", "human", "child"], - "char": "\ud83d\udc68\u200d\ud83d\udc67", - fitzpatrick_scale: false, - category: "people" - }, - family_man_girl_boy: { - keywords: ["home", "parent", "people", "human", "children"], - "char": "\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc66", - fitzpatrick_scale: false, - category: "people" - }, - family_man_boy_boy: { - keywords: ["home", "parent", "people", "human", "children"], - "char": "\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66", - fitzpatrick_scale: false, - category: "people" - }, - family_man_girl_girl: { - keywords: ["home", "parent", "people", "human", "children"], - "char": "\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc67", - fitzpatrick_scale: false, - category: "people" - }, - yarn: { - keywords: ["ball", "crochet", "knit"], - "char": "\ud83e\uddf6", - fitzpatrick_scale: false, - category: "people" - }, - thread: { - keywords: ["needle", "sewing", "spool", "string"], - "char": "\ud83e\uddf5", - fitzpatrick_scale: false, - category: "people" - }, - coat: { - keywords: ["jacket"], - "char": "\ud83e\udde5", - fitzpatrick_scale: false, - category: "people" - }, - labcoat: { - keywords: ["doctor", "experiment", "scientist", "chemist"], - "char": "\ud83e\udd7c", - fitzpatrick_scale: false, - category: "people" - }, - womans_clothes: { - keywords: ["fashion", "shopping_bags", "female"], - "char": "\ud83d\udc5a", - fitzpatrick_scale: false, - category: "people" - }, - tshirt: { - keywords: ["fashion", "cloth", "casual", "shirt", "tee"], - "char": "\ud83d\udc55", - fitzpatrick_scale: false, - category: "people" - }, - jeans: { - keywords: ["fashion", "shopping"], - "char": "\ud83d\udc56", - fitzpatrick_scale: false, - category: "people" - }, - necktie: { - keywords: ["shirt", "suitup", "formal", "fashion", "cloth", "business"], - "char": "\ud83d\udc54", - fitzpatrick_scale: false, - category: "people" - }, - dress: { - keywords: ["clothes", "fashion", "shopping"], - "char": "\ud83d\udc57", - fitzpatrick_scale: false, - category: "people" - }, - bikini: { - keywords: ["swimming", "female", "woman", "girl", "fashion", "beach", "summer"], - "char": "\ud83d\udc59", - fitzpatrick_scale: false, - category: "people" - }, - kimono: { - keywords: ["dress", "fashion", "women", "female", "japanese"], - "char": "\ud83d\udc58", - fitzpatrick_scale: false, - category: "people" - }, - lipstick: { - keywords: ["female", "girl", "fashion", "woman"], - "char": "\ud83d\udc84", - fitzpatrick_scale: false, - category: "people" - }, - kiss: { - keywords: ["face", "lips", "love", "like", "affection", "valentines"], - "char": "\ud83d\udc8b", - fitzpatrick_scale: false, - category: "people" - }, - footprints: { - keywords: ["feet", "tracking", "walking", "beach"], - "char": "\ud83d\udc63", - fitzpatrick_scale: false, - category: "people" - }, - flat_shoe: { - keywords: ["ballet", "slip-on", "slipper"], - "char": "\ud83e\udd7f", - fitzpatrick_scale: false, - category: "people" - }, - high_heel: { - keywords: ["fashion", "shoes", "female", "pumps", "stiletto"], - "char": "\ud83d\udc60", - fitzpatrick_scale: false, - category: "people" - }, - sandal: { - keywords: ["shoes", "fashion", "flip flops"], - "char": "\ud83d\udc61", - fitzpatrick_scale: false, - category: "people" - }, - boot: { - keywords: ["shoes", "fashion"], - "char": "\ud83d\udc62", - fitzpatrick_scale: false, - category: "people" - }, - mans_shoe: { - keywords: ["fashion", "male"], - "char": "\ud83d\udc5e", - fitzpatrick_scale: false, - category: "people" - }, - athletic_shoe: { - keywords: ["shoes", "sports", "sneakers"], - "char": "\ud83d\udc5f", - fitzpatrick_scale: false, - category: "people" - }, - hiking_boot: { - keywords: ["backpacking", "camping", "hiking"], - "char": "\ud83e\udd7e", - fitzpatrick_scale: false, - category: "people" - }, - socks: { - keywords: ["stockings", "clothes"], - "char": "\ud83e\udde6", - fitzpatrick_scale: false, - category: "people" - }, - gloves: { - keywords: ["hands", "winter", "clothes"], - "char": "\ud83e\udde4", - fitzpatrick_scale: false, - category: "people" - }, - scarf: { - keywords: ["neck", "winter", "clothes"], - "char": "\ud83e\udde3", - fitzpatrick_scale: false, - category: "people" - }, - womans_hat: { - keywords: ["fashion", "accessories", "female", "lady", "spring"], - "char": "\ud83d\udc52", - fitzpatrick_scale: false, - category: "people" - }, - tophat: { - keywords: ["magic", "gentleman", "classy", "circus"], - "char": "\ud83c\udfa9", - fitzpatrick_scale: false, - category: "people" - }, - billed_hat: { - keywords: ["cap", "baseball"], - "char": "\ud83e\udde2", - fitzpatrick_scale: false, - category: "people" - }, - rescue_worker_helmet: { - keywords: ["construction", "build"], - "char": "\u26d1", - fitzpatrick_scale: false, - category: "people" - }, - mortar_board: { - keywords: ["school", "college", "degree", "university", "graduation", "cap", "hat", "legal", "learn", "education"], - "char": "\ud83c\udf93", - fitzpatrick_scale: false, - category: "people" - }, - crown: { - keywords: ["king", "kod", "leader", "royalty", "lord"], - "char": "\ud83d\udc51", - fitzpatrick_scale: false, - category: "people" - }, - school_satchel: { - keywords: ["student", "education", "bag", "backpack"], - "char": "\ud83c\udf92", - fitzpatrick_scale: false, - category: "people" - }, - luggage: { - keywords: ["packing", "travel"], - "char": "\ud83e\uddf3", - fitzpatrick_scale: false, - category: "people" - }, - pouch: { - keywords: ["bag", "accessories", "shopping"], - "char": "\ud83d\udc5d", - fitzpatrick_scale: false, - category: "people" - }, - purse: { - keywords: ["fashion", "accessories", "money", "sales", "shopping"], - "char": "\ud83d\udc5b", - fitzpatrick_scale: false, - category: "people" - }, - handbag: { - keywords: ["fashion", "accessory", "accessories", "shopping"], - "char": "\ud83d\udc5c", - fitzpatrick_scale: false, - category: "people" - }, - briefcase: { - keywords: ["business", "documents", "work", "law", "legal", "job", "career"], - "char": "\ud83d\udcbc", - fitzpatrick_scale: false, - category: "people" - }, - eyeglasses: { - keywords: ["fashion", "accessories", "eyesight", "nerdy", "dork", "geek"], - "char": "\ud83d\udc53", - fitzpatrick_scale: false, - category: "people" - }, - dark_sunglasses: { - keywords: ["face", "cool", "accessories"], - "char": "\ud83d\udd76", - fitzpatrick_scale: false, - category: "people" - }, - goggles: { - keywords: ["eyes", "protection", "safety"], - "char": "\ud83e\udd7d", - fitzpatrick_scale: false, - category: "people" - }, - ring: { - keywords: ["wedding", "propose", "marriage", "valentines", "diamond", "fashion", "jewelry", "gem", "engagement"], - "char": "\ud83d\udc8d", - fitzpatrick_scale: false, - category: "people" - }, - closed_umbrella: { - keywords: ["weather", "rain", "drizzle"], - "char": "\ud83c\udf02", - fitzpatrick_scale: false, - category: "people" - }, - dog: { - keywords: ["animal", "friend", "nature", "woof", "puppy", "pet", "faithful"], - "char": "\ud83d\udc36", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cat: { - keywords: ["animal", "meow", "nature", "pet", "kitten"], - "char": "\ud83d\udc31", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - mouse: { - keywords: ["animal", "nature", "cheese_wedge", "rodent"], - "char": "\ud83d\udc2d", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - hamster: { - keywords: ["animal", "nature"], - "char": "\ud83d\udc39", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - rabbit: { - keywords: ["animal", "nature", "pet", "spring", "magic", "bunny"], - "char": "\ud83d\udc30", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - fox_face: { - keywords: ["animal", "nature", "face"], - "char": "\ud83e\udd8a", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - bear: { - keywords: ["animal", "nature", "wild"], - "char": "\ud83d\udc3b", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - panda_face: { - keywords: ["animal", "nature", "panda"], - "char": "\ud83d\udc3c", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - koala: { - keywords: ["animal", "nature"], - "char": "\ud83d\udc28", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - tiger: { - keywords: ["animal", "cat", "danger", "wild", "nature", "roar"], - "char": "\ud83d\udc2f", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - lion: { - keywords: ["animal", "nature"], - "char": "\ud83e\udd81", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cow: { - keywords: ["beef", "ox", "animal", "nature", "moo", "milk"], - "char": "\ud83d\udc2e", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - pig: { - keywords: ["animal", "oink", "nature"], - "char": "\ud83d\udc37", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - pig_nose: { - keywords: ["animal", "oink"], - "char": "\ud83d\udc3d", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - frog: { - keywords: ["animal", "nature", "croak", "toad"], - "char": "\ud83d\udc38", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - squid: { - keywords: ["animal", "nature", "ocean", "sea"], - "char": "\ud83e\udd91", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - octopus: { - keywords: ["animal", "creature", "ocean", "sea", "nature", "beach"], - "char": "\ud83d\udc19", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - shrimp: { - keywords: ["animal", "ocean", "nature", "seafood"], - "char": "\ud83e\udd90", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - monkey_face: { - keywords: ["animal", "nature", "circus"], - "char": "\ud83d\udc35", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - gorilla: { - keywords: ["animal", "nature", "circus"], - "char": "\ud83e\udd8d", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - see_no_evil: { - keywords: ["monkey", "animal", "nature", "haha"], - "char": "\ud83d\ude48", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - hear_no_evil: { - keywords: ["animal", "monkey", "nature"], - "char": "\ud83d\ude49", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - speak_no_evil: { - keywords: ["monkey", "animal", "nature", "omg"], - "char": "\ud83d\ude4a", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - monkey: { - keywords: ["animal", "nature", "banana", "circus"], - "char": "\ud83d\udc12", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - chicken: { - keywords: ["animal", "cluck", "nature", "bird"], - "char": "\ud83d\udc14", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - penguin: { - keywords: ["animal", "nature"], - "char": "\ud83d\udc27", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - bird: { - keywords: ["animal", "nature", "fly", "tweet", "spring"], - "char": "\ud83d\udc26", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - baby_chick: { - keywords: ["animal", "chicken", "bird"], - "char": "\ud83d\udc24", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - hatching_chick: { - keywords: ["animal", "chicken", "egg", "born", "baby", "bird"], - "char": "\ud83d\udc23", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - hatched_chick: { - keywords: ["animal", "chicken", "baby", "bird"], - "char": "\ud83d\udc25", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - duck: { - keywords: ["animal", "nature", "bird", "mallard"], - "char": "\ud83e\udd86", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - eagle: { - keywords: ["animal", "nature", "bird"], - "char": "\ud83e\udd85", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - owl: { - keywords: ["animal", "nature", "bird", "hoot"], - "char": "\ud83e\udd89", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - bat: { - keywords: ["animal", "nature", "blind", "vampire"], - "char": "\ud83e\udd87", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - wolf: { - keywords: ["animal", "nature", "wild"], - "char": "\ud83d\udc3a", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - boar: { - keywords: ["animal", "nature"], - "char": "\ud83d\udc17", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - horse: { - keywords: ["animal", "brown", "nature"], - "char": "\ud83d\udc34", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - unicorn: { - keywords: ["animal", "nature", "mystical"], - "char": "\ud83e\udd84", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - honeybee: { - keywords: ["animal", "insect", "nature", "bug", "spring", "honey"], - "char": "\ud83d\udc1d", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - bug: { - keywords: ["animal", "insect", "nature", "worm"], - "char": "\ud83d\udc1b", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - butterfly: { - keywords: ["animal", "insect", "nature", "caterpillar"], - "char": "\ud83e\udd8b", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - snail: { - keywords: ["slow", "animal", "shell"], - "char": "\ud83d\udc0c", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - beetle: { - keywords: ["animal", "insect", "nature", "ladybug"], - "char": "\ud83d\udc1e", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - ant: { - keywords: ["animal", "insect", "nature", "bug"], - "char": "\ud83d\udc1c", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - grasshopper: { - keywords: ["animal", "cricket", "chirp"], - "char": "\ud83e\udd97", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - spider: { - keywords: ["animal", "arachnid"], - "char": "\ud83d\udd77", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - scorpion: { - keywords: ["animal", "arachnid"], - "char": "\ud83e\udd82", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - crab: { - keywords: ["animal", "crustacean"], - "char": "\ud83e\udd80", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - snake: { - keywords: ["animal", "evil", "nature", "hiss", "python"], - "char": "\ud83d\udc0d", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - lizard: { - keywords: ["animal", "nature", "reptile"], - "char": "\ud83e\udd8e", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - "t-rex": { - keywords: ["animal", "nature", "dinosaur", "tyrannosaurus", "extinct"], - "char": "\ud83e\udd96", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sauropod: { - keywords: ["animal", "nature", "dinosaur", "brachiosaurus", "brontosaurus", "diplodocus", "extinct"], - "char": "\ud83e\udd95", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - turtle: { - keywords: ["animal", "slow", "nature", "tortoise"], - "char": "\ud83d\udc22", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - tropical_fish: { - keywords: ["animal", "swim", "ocean", "beach", "nemo"], - "char": "\ud83d\udc20", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - fish: { - keywords: ["animal", "food", "nature"], - "char": "\ud83d\udc1f", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - blowfish: { - keywords: ["animal", "nature", "food", "sea", "ocean"], - "char": "\ud83d\udc21", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - dolphin: { - keywords: ["animal", "nature", "fish", "sea", "ocean", "flipper", "fins", "beach"], - "char": "\ud83d\udc2c", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - shark: { - keywords: ["animal", "nature", "fish", "sea", "ocean", "jaws", "fins", "beach"], - "char": "\ud83e\udd88", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - whale: { - keywords: ["animal", "nature", "sea", "ocean"], - "char": "\ud83d\udc33", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - whale2: { - keywords: ["animal", "nature", "sea", "ocean"], - "char": "\ud83d\udc0b", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - crocodile: { - keywords: ["animal", "nature", "reptile", "lizard", "alligator"], - "char": "\ud83d\udc0a", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - leopard: { - keywords: ["animal", "nature"], - "char": "\ud83d\udc06", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - zebra: { - keywords: ["animal", "nature", "stripes", "safari"], - "char": "\ud83e\udd93", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - tiger2: { - keywords: ["animal", "nature", "roar"], - "char": "\ud83d\udc05", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - water_buffalo: { - keywords: ["animal", "nature", "ox", "cow"], - "char": "\ud83d\udc03", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - ox: { - keywords: ["animal", "cow", "beef"], - "char": "\ud83d\udc02", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cow2: { - keywords: ["beef", "ox", "animal", "nature", "moo", "milk"], - "char": "\ud83d\udc04", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - deer: { - keywords: ["animal", "nature", "horns", "venison"], - "char": "\ud83e\udd8c", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - dromedary_camel: { - keywords: ["animal", "hot", "desert", "hump"], - "char": "\ud83d\udc2a", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - camel: { - keywords: ["animal", "nature", "hot", "desert", "hump"], - "char": "\ud83d\udc2b", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - giraffe: { - keywords: ["animal", "nature", "spots", "safari"], - "char": "\ud83e\udd92", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - elephant: { - keywords: ["animal", "nature", "nose", "th", "circus"], - "char": "\ud83d\udc18", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - rhinoceros: { - keywords: ["animal", "nature", "horn"], - "char": "\ud83e\udd8f", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - goat: { - keywords: ["animal", "nature"], - "char": "\ud83d\udc10", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - ram: { - keywords: ["animal", "sheep", "nature"], - "char": "\ud83d\udc0f", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sheep: { - keywords: ["animal", "nature", "wool", "shipit"], - "char": "\ud83d\udc11", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - racehorse: { - keywords: ["animal", "gamble", "luck"], - "char": "\ud83d\udc0e", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - pig2: { - keywords: ["animal", "nature"], - "char": "\ud83d\udc16", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - rat: { - keywords: ["animal", "mouse", "rodent"], - "char": "\ud83d\udc00", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - mouse2: { - keywords: ["animal", "nature", "rodent"], - "char": "\ud83d\udc01", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - rooster: { - keywords: ["animal", "nature", "chicken"], - "char": "\ud83d\udc13", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - turkey: { - keywords: ["animal", "bird"], - "char": "\ud83e\udd83", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - dove: { - keywords: ["animal", "bird"], - "char": "\ud83d\udd4a", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - dog2: { - keywords: ["animal", "nature", "friend", "doge", "pet", "faithful"], - "char": "\ud83d\udc15", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - poodle: { - keywords: ["dog", "animal", "101", "nature", "pet"], - "char": "\ud83d\udc29", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cat2: { - keywords: ["animal", "meow", "pet", "cats"], - "char": "\ud83d\udc08", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - rabbit2: { - keywords: ["animal", "nature", "pet", "magic", "spring"], - "char": "\ud83d\udc07", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - chipmunk: { - keywords: ["animal", "nature", "rodent", "squirrel"], - "char": "\ud83d\udc3f", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - hedgehog: { - keywords: ["animal", "nature", "spiny"], - "char": "\ud83e\udd94", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - raccoon: { - keywords: ["animal", "nature"], - "char": "\ud83e\udd9d", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - llama: { - keywords: ["animal", "nature", "alpaca"], - "char": "\ud83e\udd99", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - hippopotamus: { - keywords: ["animal", "nature"], - "char": "\ud83e\udd9b", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - kangaroo: { - keywords: ["animal", "nature", "australia", "joey", "hop", "marsupial"], - "char": "\ud83e\udd98", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - badger: { - keywords: ["animal", "nature", "honey"], - "char": "\ud83e\udda1", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - swan: { - keywords: ["animal", "nature", "bird"], - "char": "\ud83e\udda2", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - peacock: { - keywords: ["animal", "nature", "peahen", "bird"], - "char": "\ud83e\udd9a", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - parrot: { - keywords: ["animal", "nature", "bird", "pirate", "talk"], - "char": "\ud83e\udd9c", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - lobster: { - keywords: ["animal", "nature", "bisque", "claws", "seafood"], - "char": "\ud83e\udd9e", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - mosquito: { - keywords: ["animal", "nature", "insect", "malaria"], - "char": "\ud83e\udd9f", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - paw_prints: { - keywords: ["animal", "tracking", "footprints", "dog", "cat", "pet", "feet"], - "char": "\ud83d\udc3e", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - dragon: { - keywords: ["animal", "myth", "nature", "chinese", "green"], - "char": "\ud83d\udc09", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - dragon_face: { - keywords: ["animal", "myth", "nature", "chinese", "green"], - "char": "\ud83d\udc32", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cactus: { - keywords: ["vegetable", "plant", "nature"], - "char": "\ud83c\udf35", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - christmas_tree: { - keywords: ["festival", "vacation", "december", "xmas", "celebration"], - "char": "\ud83c\udf84", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - evergreen_tree: { - keywords: ["plant", "nature"], - "char": "\ud83c\udf32", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - deciduous_tree: { - keywords: ["plant", "nature"], - "char": "\ud83c\udf33", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - palm_tree: { - keywords: ["plant", "vegetable", "nature", "summer", "beach", "mojito", "tropical"], - "char": "\ud83c\udf34", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - seedling: { - keywords: ["plant", "nature", "grass", "lawn", "spring"], - "char": "\ud83c\udf31", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - herb: { - keywords: ["vegetable", "plant", "medicine", "weed", "grass", "lawn"], - "char": "\ud83c\udf3f", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - shamrock: { - keywords: ["vegetable", "plant", "nature", "irish", "clover"], - "char": "\u2618", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - four_leaf_clover: { - keywords: ["vegetable", "plant", "nature", "lucky", "irish"], - "char": "\ud83c\udf40", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - bamboo: { - keywords: ["plant", "nature", "vegetable", "panda", "pine_decoration"], - "char": "\ud83c\udf8d", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - tanabata_tree: { - keywords: ["plant", "nature", "branch", "summer"], - "char": "\ud83c\udf8b", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - leaves: { - keywords: ["nature", "plant", "tree", "vegetable", "grass", "lawn", "spring"], - "char": "\ud83c\udf43", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - fallen_leaf: { - keywords: ["nature", "plant", "vegetable", "leaves"], - "char": "\ud83c\udf42", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - maple_leaf: { - keywords: ["nature", "plant", "vegetable", "ca", "fall"], - "char": "\ud83c\udf41", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - ear_of_rice: { - keywords: ["nature", "plant"], - "char": "\ud83c\udf3e", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - hibiscus: { - keywords: ["plant", "vegetable", "flowers", "beach"], - "char": "\ud83c\udf3a", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sunflower: { - keywords: ["nature", "plant", "fall"], - "char": "\ud83c\udf3b", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - rose: { - keywords: ["flowers", "valentines", "love", "spring"], - "char": "\ud83c\udf39", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - wilted_flower: { - keywords: ["plant", "nature", "flower"], - "char": "\ud83e\udd40", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - tulip: { - keywords: ["flowers", "plant", "nature", "summer", "spring"], - "char": "\ud83c\udf37", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - blossom: { - keywords: ["nature", "flowers", "yellow"], - "char": "\ud83c\udf3c", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cherry_blossom: { - keywords: ["nature", "plant", "spring", "flower"], - "char": "\ud83c\udf38", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - bouquet: { - keywords: ["flowers", "nature", "spring"], - "char": "\ud83d\udc90", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - mushroom: { - keywords: ["plant", "vegetable"], - "char": "\ud83c\udf44", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - chestnut: { - keywords: ["food", "squirrel"], - "char": "\ud83c\udf30", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - jack_o_lantern: { - keywords: ["halloween", "light", "pumpkin", "creepy", "fall"], - "char": "\ud83c\udf83", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - shell: { - keywords: ["nature", "sea", "beach"], - "char": "\ud83d\udc1a", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - spider_web: { - keywords: ["animal", "insect", "arachnid", "silk"], - "char": "\ud83d\udd78", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - earth_americas: { - keywords: ["globe", "world", "USA", "international"], - "char": "\ud83c\udf0e", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - earth_africa: { - keywords: ["globe", "world", "international"], - "char": "\ud83c\udf0d", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - earth_asia: { - keywords: ["globe", "world", "east", "international"], - "char": "\ud83c\udf0f", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - full_moon: { - keywords: ["nature", "yellow", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": "\ud83c\udf15", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - waning_gibbous_moon: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep", "waxing_gibbous_moon"], - "char": "\ud83c\udf16", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - last_quarter_moon: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": "\ud83c\udf17", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - waning_crescent_moon: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": "\ud83c\udf18", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - new_moon: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": "\ud83c\udf11", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - waxing_crescent_moon: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": "\ud83c\udf12", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - first_quarter_moon: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": "\ud83c\udf13", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - waxing_gibbous_moon: { - keywords: ["nature", "night", "sky", "gray", "twilight", "planet", "space", "evening", "sleep"], - "char": "\ud83c\udf14", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - new_moon_with_face: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": "\ud83c\udf1a", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - full_moon_with_face: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": "\ud83c\udf1d", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - first_quarter_moon_with_face: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": "\ud83c\udf1b", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - last_quarter_moon_with_face: { - keywords: ["nature", "twilight", "planet", "space", "night", "evening", "sleep"], - "char": "\ud83c\udf1c", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sun_with_face: { - keywords: ["nature", "morning", "sky"], - "char": "\ud83c\udf1e", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - crescent_moon: { - keywords: ["night", "sleep", "sky", "evening", "magic"], - "char": "\ud83c\udf19", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - star: { - keywords: ["night", "yellow"], - "char": "\u2b50", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - star2: { - keywords: ["night", "sparkle", "awesome", "good", "magic"], - "char": "\ud83c\udf1f", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - dizzy: { - keywords: ["star", "sparkle", "shoot", "magic"], - "char": "\ud83d\udcab", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sparkles: { - keywords: ["stars", "shine", "shiny", "cool", "awesome", "good", "magic"], - "char": "\u2728", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - comet: { - keywords: ["space"], - "char": "\u2604", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sunny: { - keywords: ["weather", "nature", "brightness", "summer", "beach", "spring"], - "char": "\u2600\ufe0f", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sun_behind_small_cloud: { - keywords: ["weather"], - "char": "\ud83c\udf24", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - partly_sunny: { - keywords: ["weather", "nature", "cloudy", "morning", "fall", "spring"], - "char": "\u26c5", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sun_behind_large_cloud: { - keywords: ["weather"], - "char": "\ud83c\udf25", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sun_behind_rain_cloud: { - keywords: ["weather"], - "char": "\ud83c\udf26", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cloud: { - keywords: ["weather", "sky"], - "char": "\u2601\ufe0f", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cloud_with_rain: { - keywords: ["weather"], - "char": "\ud83c\udf27", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cloud_with_lightning_and_rain: { - keywords: ["weather", "lightning"], - "char": "\u26c8", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cloud_with_lightning: { - keywords: ["weather", "thunder"], - "char": "\ud83c\udf29", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - zap: { - keywords: ["thunder", "weather", "lightning bolt", "fast"], - "char": "\u26a1", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - fire: { - keywords: ["hot", "cook", "flame"], - "char": "\ud83d\udd25", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - boom: { - keywords: ["bomb", "explode", "explosion", "collision", "blown"], - "char": "\ud83d\udca5", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - snowflake: { - keywords: ["winter", "season", "cold", "weather", "christmas", "xmas"], - "char": "\u2744\ufe0f", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - cloud_with_snow: { - keywords: ["weather"], - "char": "\ud83c\udf28", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - snowman: { - keywords: ["winter", "season", "cold", "weather", "christmas", "xmas", "frozen", "without_snow"], - "char": "\u26c4", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - snowman_with_snow: { - keywords: ["winter", "season", "cold", "weather", "christmas", "xmas", "frozen"], - "char": "\u2603", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - wind_face: { - keywords: ["gust", "air"], - "char": "\ud83c\udf2c", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - dash: { - keywords: ["wind", "air", "fast", "shoo", "fart", "smoke", "puff"], - "char": "\ud83d\udca8", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - tornado: { - keywords: ["weather", "cyclone", "twister"], - "char": "\ud83c\udf2a", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - fog: { - keywords: ["weather"], - "char": "\ud83c\udf2b", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - open_umbrella: { - keywords: ["weather", "spring"], - "char": "\u2602", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - umbrella: { - keywords: ["rainy", "weather", "spring"], - "char": "\u2614", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - droplet: { - keywords: ["water", "drip", "faucet", "spring"], - "char": "\ud83d\udca7", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - sweat_drops: { - keywords: ["water", "drip", "oops"], - "char": "\ud83d\udca6", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - ocean: { - keywords: ["sea", "water", "wave", "nature", "tsunami", "disaster"], - "char": "\ud83c\udf0a", - fitzpatrick_scale: false, - category: "animals_and_nature" - }, - green_apple: { - keywords: ["fruit", "nature"], - "char": "\ud83c\udf4f", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - apple: { - keywords: ["fruit", "mac", "school"], - "char": "\ud83c\udf4e", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - pear: { - keywords: ["fruit", "nature", "food"], - "char": "\ud83c\udf50", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - tangerine: { - keywords: ["food", "fruit", "nature", "orange"], - "char": "\ud83c\udf4a", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - lemon: { - keywords: ["fruit", "nature"], - "char": "\ud83c\udf4b", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - banana: { - keywords: ["fruit", "food", "monkey"], - "char": "\ud83c\udf4c", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - watermelon: { - keywords: ["fruit", "food", "picnic", "summer"], - "char": "\ud83c\udf49", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - grapes: { - keywords: ["fruit", "food", "wine"], - "char": "\ud83c\udf47", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - strawberry: { - keywords: ["fruit", "food", "nature"], - "char": "\ud83c\udf53", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - melon: { - keywords: ["fruit", "nature", "food"], - "char": "\ud83c\udf48", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - cherries: { - keywords: ["food", "fruit"], - "char": "\ud83c\udf52", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - peach: { - keywords: ["fruit", "nature", "food"], - "char": "\ud83c\udf51", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - pineapple: { - keywords: ["fruit", "nature", "food"], - "char": "\ud83c\udf4d", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - coconut: { - keywords: ["fruit", "nature", "food", "palm"], - "char": "\ud83e\udd65", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - kiwi_fruit: { - keywords: ["fruit", "food"], - "char": "\ud83e\udd5d", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - mango: { - keywords: ["fruit", "food", "tropical"], - "char": "\ud83e\udd6d", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - avocado: { - keywords: ["fruit", "food"], - "char": "\ud83e\udd51", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - broccoli: { - keywords: ["fruit", "food", "vegetable"], - "char": "\ud83e\udd66", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - tomato: { - keywords: ["fruit", "vegetable", "nature", "food"], - "char": "\ud83c\udf45", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - eggplant: { - keywords: ["vegetable", "nature", "food", "aubergine"], - "char": "\ud83c\udf46", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - cucumber: { - keywords: ["fruit", "food", "pickle"], - "char": "\ud83e\udd52", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - carrot: { - keywords: ["vegetable", "food", "orange"], - "char": "\ud83e\udd55", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - hot_pepper: { - keywords: ["food", "spicy", "chilli", "chili"], - "char": "\ud83c\udf36", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - potato: { - keywords: ["food", "tuber", "vegatable", "starch"], - "char": "\ud83e\udd54", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - corn: { - keywords: ["food", "vegetable", "plant"], - "char": "\ud83c\udf3d", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - leafy_greens: { - keywords: ["food", "vegetable", "plant", "bok choy", "cabbage", "kale", "lettuce"], - "char": "\ud83e\udd6c", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - sweet_potato: { - keywords: ["food", "nature"], - "char": "\ud83c\udf60", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - peanuts: { - keywords: ["food", "nut"], - "char": "\ud83e\udd5c", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - honey_pot: { - keywords: ["bees", "sweet", "kitchen"], - "char": "\ud83c\udf6f", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - croissant: { - keywords: ["food", "bread", "french"], - "char": "\ud83e\udd50", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - bread: { - keywords: ["food", "wheat", "breakfast", "toast"], - "char": "\ud83c\udf5e", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - baguette_bread: { - keywords: ["food", "bread", "french"], - "char": "\ud83e\udd56", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - bagel: { - keywords: ["food", "bread", "bakery", "schmear"], - "char": "\ud83e\udd6f", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - pretzel: { - keywords: ["food", "bread", "twisted"], - "char": "\ud83e\udd68", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - cheese: { - keywords: ["food", "chadder"], - "char": "\ud83e\uddc0", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - egg: { - keywords: ["food", "chicken", "breakfast"], - "char": "\ud83e\udd5a", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - bacon: { - keywords: ["food", "breakfast", "pork", "pig", "meat"], - "char": "\ud83e\udd53", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - steak: { - keywords: ["food", "cow", "meat", "cut", "chop", "lambchop", "porkchop"], - "char": "\ud83e\udd69", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - pancakes: { - keywords: ["food", "breakfast", "flapjacks", "hotcakes"], - "char": "\ud83e\udd5e", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - poultry_leg: { - keywords: ["food", "meat", "drumstick", "bird", "chicken", "turkey"], - "char": "\ud83c\udf57", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - meat_on_bone: { - keywords: ["good", "food", "drumstick"], - "char": "\ud83c\udf56", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - bone: { - keywords: ["skeleton"], - "char": "\ud83e\uddb4", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - fried_shrimp: { - keywords: ["food", "animal", "appetizer", "summer"], - "char": "\ud83c\udf64", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - fried_egg: { - keywords: ["food", "breakfast", "kitchen", "egg"], - "char": "\ud83c\udf73", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - hamburger: { - keywords: ["meat", "fast food", "beef", "cheeseburger", "mcdonalds", "burger king"], - "char": "\ud83c\udf54", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - fries: { - keywords: ["chips", "snack", "fast food"], - "char": "\ud83c\udf5f", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - stuffed_flatbread: { - keywords: ["food", "flatbread", "stuffed", "gyro"], - "char": "\ud83e\udd59", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - hotdog: { - keywords: ["food", "frankfurter"], - "char": "\ud83c\udf2d", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - pizza: { - keywords: ["food", "party"], - "char": "\ud83c\udf55", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - sandwich: { - keywords: ["food", "lunch", "bread"], - "char": "\ud83e\udd6a", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - canned_food: { - keywords: ["food", "soup"], - "char": "\ud83e\udd6b", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - spaghetti: { - keywords: ["food", "italian", "noodle"], - "char": "\ud83c\udf5d", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - taco: { - keywords: ["food", "mexican"], - "char": "\ud83c\udf2e", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - burrito: { - keywords: ["food", "mexican"], - "char": "\ud83c\udf2f", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - green_salad: { - keywords: ["food", "healthy", "lettuce"], - "char": "\ud83e\udd57", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - shallow_pan_of_food: { - keywords: ["food", "cooking", "casserole", "paella"], - "char": "\ud83e\udd58", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - ramen: { - keywords: ["food", "japanese", "noodle", "chopsticks"], - "char": "\ud83c\udf5c", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - stew: { - keywords: ["food", "meat", "soup"], - "char": "\ud83c\udf72", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - fish_cake: { - keywords: ["food", "japan", "sea", "beach", "narutomaki", "pink", "swirl", "kamaboko", "surimi", "ramen"], - "char": "\ud83c\udf65", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - fortune_cookie: { - keywords: ["food", "prophecy"], - "char": "\ud83e\udd60", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - sushi: { - keywords: ["food", "fish", "japanese", "rice"], - "char": "\ud83c\udf63", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - bento: { - keywords: ["food", "japanese", "box"], - "char": "\ud83c\udf71", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - curry: { - keywords: ["food", "spicy", "hot", "indian"], - "char": "\ud83c\udf5b", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - rice_ball: { - keywords: ["food", "japanese"], - "char": "\ud83c\udf59", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - rice: { - keywords: ["food", "china", "asian"], - "char": "\ud83c\udf5a", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - rice_cracker: { - keywords: ["food", "japanese"], - "char": "\ud83c\udf58", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - oden: { - keywords: ["food", "japanese"], - "char": "\ud83c\udf62", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - dango: { - keywords: ["food", "dessert", "sweet", "japanese", "barbecue", "meat"], - "char": "\ud83c\udf61", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - shaved_ice: { - keywords: ["hot", "dessert", "summer"], - "char": "\ud83c\udf67", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - ice_cream: { - keywords: ["food", "hot", "dessert"], - "char": "\ud83c\udf68", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - icecream: { - keywords: ["food", "hot", "dessert", "summer"], - "char": "\ud83c\udf66", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - pie: { - keywords: ["food", "dessert", "pastry"], - "char": "\ud83e\udd67", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - cake: { - keywords: ["food", "dessert"], - "char": "\ud83c\udf70", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - cupcake: { - keywords: ["food", "dessert", "bakery", "sweet"], - "char": "\ud83e\uddc1", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - moon_cake: { - keywords: ["food", "autumn"], - "char": "\ud83e\udd6e", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - birthday: { - keywords: ["food", "dessert", "cake"], - "char": "\ud83c\udf82", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - custard: { - keywords: ["dessert", "food"], - "char": "\ud83c\udf6e", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - candy: { - keywords: ["snack", "dessert", "sweet", "lolly"], - "char": "\ud83c\udf6c", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - lollipop: { - keywords: ["food", "snack", "candy", "sweet"], - "char": "\ud83c\udf6d", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - chocolate_bar: { - keywords: ["food", "snack", "dessert", "sweet"], - "char": "\ud83c\udf6b", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - popcorn: { - keywords: ["food", "movie theater", "films", "snack"], - "char": "\ud83c\udf7f", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - dumpling: { - keywords: ["food", "empanada", "pierogi", "potsticker"], - "char": "\ud83e\udd5f", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - doughnut: { - keywords: ["food", "dessert", "snack", "sweet", "donut"], - "char": "\ud83c\udf69", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - cookie: { - keywords: ["food", "snack", "oreo", "chocolate", "sweet", "dessert"], - "char": "\ud83c\udf6a", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - milk_glass: { - keywords: ["beverage", "drink", "cow"], - "char": "\ud83e\udd5b", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - beer: { - keywords: ["relax", "beverage", "drink", "drunk", "party", "pub", "summer", "alcohol", "booze"], - "char": "\ud83c\udf7a", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - beers: { - keywords: ["relax", "beverage", "drink", "drunk", "party", "pub", "summer", "alcohol", "booze"], - "char": "\ud83c\udf7b", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - clinking_glasses: { - keywords: ["beverage", "drink", "party", "alcohol", "celebrate", "cheers", "wine", "champagne", "toast"], - "char": "\ud83e\udd42", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - wine_glass: { - keywords: ["drink", "beverage", "drunk", "alcohol", "booze"], - "char": "\ud83c\udf77", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - tumbler_glass: { - keywords: ["drink", "beverage", "drunk", "alcohol", "liquor", "booze", "bourbon", "scotch", "whisky", "glass", "shot"], - "char": "\ud83e\udd43", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - cocktail: { - keywords: ["drink", "drunk", "alcohol", "beverage", "booze", "mojito"], - "char": "\ud83c\udf78", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - tropical_drink: { - keywords: ["beverage", "cocktail", "summer", "beach", "alcohol", "booze", "mojito"], - "char": "\ud83c\udf79", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - champagne: { - keywords: ["drink", "wine", "bottle", "celebration"], - "char": "\ud83c\udf7e", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - sake: { - keywords: ["wine", "drink", "drunk", "beverage", "japanese", "alcohol", "booze"], - "char": "\ud83c\udf76", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - tea: { - keywords: ["drink", "bowl", "breakfast", "green", "british"], - "char": "\ud83c\udf75", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - cup_with_straw: { - keywords: ["drink", "soda"], - "char": "\ud83e\udd64", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - coffee: { - keywords: ["beverage", "caffeine", "latte", "espresso"], - "char": "\u2615", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - baby_bottle: { - keywords: ["food", "container", "milk"], - "char": "\ud83c\udf7c", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - salt: { - keywords: ["condiment", "shaker"], - "char": "\ud83e\uddc2", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - spoon: { - keywords: ["cutlery", "kitchen", "tableware"], - "char": "\ud83e\udd44", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - fork_and_knife: { - keywords: ["cutlery", "kitchen"], - "char": "\ud83c\udf74", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - plate_with_cutlery: { - keywords: ["food", "eat", "meal", "lunch", "dinner", "restaurant"], - "char": "\ud83c\udf7d", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - bowl_with_spoon: { - keywords: ["food", "breakfast", "cereal", "oatmeal", "porridge"], - "char": "\ud83e\udd63", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - takeout_box: { - keywords: ["food", "leftovers"], - "char": "\ud83e\udd61", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - chopsticks: { - keywords: ["food"], - "char": "\ud83e\udd62", - fitzpatrick_scale: false, - category: "food_and_drink" - }, - soccer: { - keywords: ["sports", "football"], - "char": "\u26bd", - fitzpatrick_scale: false, - category: "activity" - }, - basketball: { - keywords: ["sports", "balls", "NBA"], - "char": "\ud83c\udfc0", - fitzpatrick_scale: false, - category: "activity" - }, - football: { - keywords: ["sports", "balls", "NFL"], - "char": "\ud83c\udfc8", - fitzpatrick_scale: false, - category: "activity" - }, - baseball: { - keywords: ["sports", "balls"], - "char": "\u26be", - fitzpatrick_scale: false, - category: "activity" - }, - softball: { - keywords: ["sports", "balls"], - "char": "\ud83e\udd4e", - fitzpatrick_scale: false, - category: "activity" - }, - tennis: { - keywords: ["sports", "balls", "green"], - "char": "\ud83c\udfbe", - fitzpatrick_scale: false, - category: "activity" - }, - volleyball: { - keywords: ["sports", "balls"], - "char": "\ud83c\udfd0", - fitzpatrick_scale: false, - category: "activity" - }, - rugby_football: { - keywords: ["sports", "team"], - "char": "\ud83c\udfc9", - fitzpatrick_scale: false, - category: "activity" - }, - flying_disc: { - keywords: ["sports", "frisbee", "ultimate"], - "char": "\ud83e\udd4f", - fitzpatrick_scale: false, - category: "activity" - }, - "8ball": { - keywords: ["pool", "hobby", "game", "luck", "magic"], - "char": "\ud83c\udfb1", - fitzpatrick_scale: false, - category: "activity" - }, - golf: { - keywords: ["sports", "business", "flag", "hole", "summer"], - "char": "\u26f3", - fitzpatrick_scale: false, - category: "activity" - }, - golfing_woman: { - keywords: ["sports", "business", "woman", "female"], - "char": "\ud83c\udfcc\ufe0f\u200d\u2640\ufe0f", - fitzpatrick_scale: false, - category: "activity" - }, - golfing_man: { - keywords: ["sports", "business"], - "char": "\ud83c\udfcc", - fitzpatrick_scale: true, - category: "activity" - }, - ping_pong: { - keywords: ["sports", "pingpong"], - "char": "\ud83c\udfd3", - fitzpatrick_scale: false, - category: "activity" - }, - badminton: { - keywords: ["sports"], - "char": "\ud83c\udff8", - fitzpatrick_scale: false, - category: "activity" - }, - goal_net: { - keywords: ["sports"], - "char": "\ud83e\udd45", - fitzpatrick_scale: false, - category: "activity" - }, - ice_hockey: { - keywords: ["sports"], - "char": "\ud83c\udfd2", - fitzpatrick_scale: false, - category: "activity" - }, - field_hockey: { - keywords: ["sports"], - "char": "\ud83c\udfd1", - fitzpatrick_scale: false, - category: "activity" - }, - lacrosse: { - keywords: ["sports", "ball", "stick"], - "char": "\ud83e\udd4d", - fitzpatrick_scale: false, - category: "activity" - }, - cricket: { - keywords: ["sports"], - "char": "\ud83c\udfcf", - fitzpatrick_scale: false, - category: "activity" - }, - ski: { - keywords: ["sports", "winter", "cold", "snow"], - "char": "\ud83c\udfbf", - fitzpatrick_scale: false, - category: "activity" - }, - skier: { - keywords: ["sports", "winter", "snow"], - "char": "\u26f7", - fitzpatrick_scale: false, - category: "activity" - }, - snowboarder: { - keywords: ["sports", "winter"], - "char": "\ud83c\udfc2", - fitzpatrick_scale: true, - category: "activity" - }, - person_fencing: { - keywords: ["sports", "fencing", "sword"], - "char": "\ud83e\udd3a", - fitzpatrick_scale: false, - category: "activity" - }, - women_wrestling: { - keywords: ["sports", "wrestlers"], - "char": "\ud83e\udd3c\u200d\u2640\ufe0f", - fitzpatrick_scale: false, - category: "activity" - }, - men_wrestling: { - keywords: ["sports", "wrestlers"], - "char": "\ud83e\udd3c\u200d\u2642\ufe0f", - fitzpatrick_scale: false, - category: "activity" - }, - woman_cartwheeling: { - keywords: ["gymnastics"], - "char": "\ud83e\udd38\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "activity" - }, - man_cartwheeling: { - keywords: ["gymnastics"], - "char": "\ud83e\udd38\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "activity" - }, - woman_playing_handball: { - keywords: ["sports"], - "char": "\ud83e\udd3e\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "activity" - }, - man_playing_handball: { - keywords: ["sports"], - "char": "\ud83e\udd3e\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "activity" - }, - ice_skate: { - keywords: ["sports"], - "char": "\u26f8", - fitzpatrick_scale: false, - category: "activity" - }, - curling_stone: { - keywords: ["sports"], - "char": "\ud83e\udd4c", - fitzpatrick_scale: false, - category: "activity" - }, - skateboard: { - keywords: ["board"], - "char": "\ud83d\udef9", - fitzpatrick_scale: false, - category: "activity" - }, - sled: { - keywords: ["sleigh", "luge", "toboggan"], - "char": "\ud83d\udef7", - fitzpatrick_scale: false, - category: "activity" - }, - bow_and_arrow: { - keywords: ["sports"], - "char": "\ud83c\udff9", - fitzpatrick_scale: false, - category: "activity" - }, - fishing_pole_and_fish: { - keywords: ["food", "hobby", "summer"], - "char": "\ud83c\udfa3", - fitzpatrick_scale: false, - category: "activity" - }, - boxing_glove: { - keywords: ["sports", "fighting"], - "char": "\ud83e\udd4a", - fitzpatrick_scale: false, - category: "activity" - }, - martial_arts_uniform: { - keywords: ["judo", "karate", "taekwondo"], - "char": "\ud83e\udd4b", - fitzpatrick_scale: false, - category: "activity" - }, - rowing_woman: { - keywords: ["sports", "hobby", "water", "ship", "woman", "female"], - "char": "\ud83d\udea3\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "activity" - }, - rowing_man: { - keywords: ["sports", "hobby", "water", "ship"], - "char": "\ud83d\udea3", - fitzpatrick_scale: true, - category: "activity" - }, - climbing_woman: { - keywords: ["sports", "hobby", "woman", "female", "rock"], - "char": "\ud83e\uddd7\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "activity" - }, - climbing_man: { - keywords: ["sports", "hobby", "man", "male", "rock"], - "char": "\ud83e\uddd7\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "activity" - }, - swimming_woman: { - keywords: ["sports", "exercise", "human", "athlete", "water", "summer", "woman", "female"], - "char": "\ud83c\udfca\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "activity" - }, - swimming_man: { - keywords: ["sports", "exercise", "human", "athlete", "water", "summer"], - "char": "\ud83c\udfca", - fitzpatrick_scale: true, - category: "activity" - }, - woman_playing_water_polo: { - keywords: ["sports", "pool"], - "char": "\ud83e\udd3d\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "activity" - }, - man_playing_water_polo: { - keywords: ["sports", "pool"], - "char": "\ud83e\udd3d\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "activity" - }, - woman_in_lotus_position: { - keywords: ["woman", "female", "meditation", "yoga", "serenity", "zen", "mindfulness"], - "char": "\ud83e\uddd8\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "activity" - }, - man_in_lotus_position: { - keywords: ["man", "male", "meditation", "yoga", "serenity", "zen", "mindfulness"], - "char": "\ud83e\uddd8\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "activity" - }, - surfing_woman: { - keywords: ["sports", "ocean", "sea", "summer", "beach", "woman", "female"], - "char": "\ud83c\udfc4\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "activity" - }, - surfing_man: { - keywords: ["sports", "ocean", "sea", "summer", "beach"], - "char": "\ud83c\udfc4", - fitzpatrick_scale: true, - category: "activity" - }, - bath: { - keywords: ["clean", "shower", "bathroom"], - "char": "\ud83d\udec0", - fitzpatrick_scale: true, - category: "activity" - }, - basketball_woman: { - keywords: ["sports", "human", "woman", "female"], - "char": "\u26f9\ufe0f\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "activity" - }, - basketball_man: { - keywords: ["sports", "human"], - "char": "\u26f9", - fitzpatrick_scale: true, - category: "activity" - }, - weight_lifting_woman: { - keywords: ["sports", "training", "exercise", "woman", "female"], - "char": "\ud83c\udfcb\ufe0f\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "activity" - }, - weight_lifting_man: { - keywords: ["sports", "training", "exercise"], - "char": "\ud83c\udfcb", - fitzpatrick_scale: true, - category: "activity" - }, - biking_woman: { - keywords: ["sports", "bike", "exercise", "hipster", "woman", "female"], - "char": "\ud83d\udeb4\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "activity" - }, - biking_man: { - keywords: ["sports", "bike", "exercise", "hipster"], - "char": "\ud83d\udeb4", - fitzpatrick_scale: true, - category: "activity" - }, - mountain_biking_woman: { - keywords: ["transportation", "sports", "human", "race", "bike", "woman", "female"], - "char": "\ud83d\udeb5\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "activity" - }, - mountain_biking_man: { - keywords: ["transportation", "sports", "human", "race", "bike"], - "char": "\ud83d\udeb5", - fitzpatrick_scale: true, - category: "activity" - }, - horse_racing: { - keywords: ["animal", "betting", "competition", "gambling", "luck"], - "char": "\ud83c\udfc7", - fitzpatrick_scale: true, - category: "activity" - }, - business_suit_levitating: { - keywords: ["suit", "business", "levitate", "hover", "jump"], - "char": "\ud83d\udd74", - fitzpatrick_scale: true, - category: "activity" - }, - trophy: { - keywords: ["win", "award", "contest", "place", "ftw", "ceremony"], - "char": "\ud83c\udfc6", - fitzpatrick_scale: false, - category: "activity" - }, - running_shirt_with_sash: { - keywords: ["play", "pageant"], - "char": "\ud83c\udfbd", - fitzpatrick_scale: false, - category: "activity" - }, - medal_sports: { - keywords: ["award", "winning"], - "char": "\ud83c\udfc5", - fitzpatrick_scale: false, - category: "activity" - }, - medal_military: { - keywords: ["award", "winning", "army"], - "char": "\ud83c\udf96", - fitzpatrick_scale: false, - category: "activity" - }, - "1st_place_medal": { - keywords: ["award", "winning", "first"], - "char": "\ud83e\udd47", - fitzpatrick_scale: false, - category: "activity" - }, - "2nd_place_medal": { - keywords: ["award", "second"], - "char": "\ud83e\udd48", - fitzpatrick_scale: false, - category: "activity" - }, - "3rd_place_medal": { - keywords: ["award", "third"], - "char": "\ud83e\udd49", - fitzpatrick_scale: false, - category: "activity" - }, - reminder_ribbon: { - keywords: ["sports", "cause", "support", "awareness"], - "char": "\ud83c\udf97", - fitzpatrick_scale: false, - category: "activity" - }, - rosette: { - keywords: ["flower", "decoration", "military"], - "char": "\ud83c\udff5", - fitzpatrick_scale: false, - category: "activity" - }, - ticket: { - keywords: ["event", "concert", "pass"], - "char": "\ud83c\udfab", - fitzpatrick_scale: false, - category: "activity" - }, - tickets: { - keywords: ["sports", "concert", "entrance"], - "char": "\ud83c\udf9f", - fitzpatrick_scale: false, - category: "activity" - }, - performing_arts: { - keywords: ["acting", "theater", "drama"], - "char": "\ud83c\udfad", - fitzpatrick_scale: false, - category: "activity" - }, - art: { - keywords: ["design", "paint", "draw", "colors"], - "char": "\ud83c\udfa8", - fitzpatrick_scale: false, - category: "activity" - }, - circus_tent: { - keywords: ["festival", "carnival", "party"], - "char": "\ud83c\udfaa", - fitzpatrick_scale: false, - category: "activity" - }, - woman_juggling: { - keywords: ["juggle", "balance", "skill", "multitask"], - "char": "\ud83e\udd39\u200d\u2640\ufe0f", - fitzpatrick_scale: true, - category: "activity" - }, - man_juggling: { - keywords: ["juggle", "balance", "skill", "multitask"], - "char": "\ud83e\udd39\u200d\u2642\ufe0f", - fitzpatrick_scale: true, - category: "activity" - }, - microphone: { - keywords: ["sound", "music", "PA", "sing", "talkshow"], - "char": "\ud83c\udfa4", - fitzpatrick_scale: false, - category: "activity" - }, - headphones: { - keywords: ["music", "score", "gadgets"], - "char": "\ud83c\udfa7", - fitzpatrick_scale: false, - category: "activity" - }, - musical_score: { - keywords: ["treble", "clef", "compose"], - "char": "\ud83c\udfbc", - fitzpatrick_scale: false, - category: "activity" - }, - musical_keyboard: { - keywords: ["piano", "instrument", "compose"], - "char": "\ud83c\udfb9", - fitzpatrick_scale: false, - category: "activity" - }, - drum: { - keywords: ["music", "instrument", "drumsticks", "snare"], - "char": "\ud83e\udd41", - fitzpatrick_scale: false, - category: "activity" - }, - saxophone: { - keywords: ["music", "instrument", "jazz", "blues"], - "char": "\ud83c\udfb7", - fitzpatrick_scale: false, - category: "activity" - }, - trumpet: { - keywords: ["music", "brass"], - "char": "\ud83c\udfba", - fitzpatrick_scale: false, - category: "activity" - }, - guitar: { - keywords: ["music", "instrument"], - "char": "\ud83c\udfb8", - fitzpatrick_scale: false, - category: "activity" - }, - violin: { - keywords: ["music", "instrument", "orchestra", "symphony"], - "char": "\ud83c\udfbb", - fitzpatrick_scale: false, - category: "activity" - }, - clapper: { - keywords: ["movie", "film", "record"], - "char": "\ud83c\udfac", - fitzpatrick_scale: false, - category: "activity" - }, - video_game: { - keywords: ["play", "console", "PS4", "controller"], - "char": "\ud83c\udfae", - fitzpatrick_scale: false, - category: "activity" - }, - space_invader: { - keywords: ["game", "arcade", "play"], - "char": "\ud83d\udc7e", - fitzpatrick_scale: false, - category: "activity" - }, - dart: { - keywords: ["game", "play", "bar", "target", "bullseye"], - "char": "\ud83c\udfaf", - fitzpatrick_scale: false, - category: "activity" - }, - game_die: { - keywords: ["dice", "random", "tabletop", "play", "luck"], - "char": "\ud83c\udfb2", - fitzpatrick_scale: false, - category: "activity" - }, - chess_pawn: { - keywords: ["expendable"], - "char": "\u265f", - fitzpatrick_scale: false, - category: "activity" - }, - slot_machine: { - keywords: ["bet", "gamble", "vegas", "fruit machine", "luck", "casino"], - "char": "\ud83c\udfb0", - fitzpatrick_scale: false, - category: "activity" - }, - jigsaw: { - keywords: ["interlocking", "puzzle", "piece"], - "char": "\ud83e\udde9", - fitzpatrick_scale: false, - category: "activity" - }, - bowling: { - keywords: ["sports", "fun", "play"], - "char": "\ud83c\udfb3", - fitzpatrick_scale: false, - category: "activity" - }, - red_car: { - keywords: ["red", "transportation", "vehicle"], - "char": "\ud83d\ude97", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - taxi: { - keywords: ["uber", "vehicle", "cars", "transportation"], - "char": "\ud83d\ude95", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - blue_car: { - keywords: ["transportation", "vehicle"], - "char": "\ud83d\ude99", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - bus: { - keywords: ["car", "vehicle", "transportation"], - "char": "\ud83d\ude8c", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - trolleybus: { - keywords: ["bart", "transportation", "vehicle"], - "char": "\ud83d\ude8e", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - racing_car: { - keywords: ["sports", "race", "fast", "formula", "f1"], - "char": "\ud83c\udfce", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - police_car: { - keywords: ["vehicle", "cars", "transportation", "law", "legal", "enforcement"], - "char": "\ud83d\ude93", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - ambulance: { - keywords: ["health", "911", "hospital"], - "char": "\ud83d\ude91", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - fire_engine: { - keywords: ["transportation", "cars", "vehicle"], - "char": "\ud83d\ude92", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - minibus: { - keywords: ["vehicle", "car", "transportation"], - "char": "\ud83d\ude90", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - truck: { - keywords: ["cars", "transportation"], - "char": "\ud83d\ude9a", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - articulated_lorry: { - keywords: ["vehicle", "cars", "transportation", "express"], - "char": "\ud83d\ude9b", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - tractor: { - keywords: ["vehicle", "car", "farming", "agriculture"], - "char": "\ud83d\ude9c", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - kick_scooter: { - keywords: ["vehicle", "kick", "razor"], - "char": "\ud83d\udef4", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - motorcycle: { - keywords: ["race", "sports", "fast"], - "char": "\ud83c\udfcd", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - bike: { - keywords: ["sports", "bicycle", "exercise", "hipster"], - "char": "\ud83d\udeb2", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - motor_scooter: { - keywords: ["vehicle", "vespa", "sasha"], - "char": "\ud83d\udef5", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - rotating_light: { - keywords: ["police", "ambulance", "911", "emergency", "alert", "error", "pinged", "law", "legal"], - "char": "\ud83d\udea8", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - oncoming_police_car: { - keywords: ["vehicle", "law", "legal", "enforcement", "911"], - "char": "\ud83d\ude94", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - oncoming_bus: { - keywords: ["vehicle", "transportation"], - "char": "\ud83d\ude8d", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - oncoming_automobile: { - keywords: ["car", "vehicle", "transportation"], - "char": "\ud83d\ude98", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - oncoming_taxi: { - keywords: ["vehicle", "cars", "uber"], - "char": "\ud83d\ude96", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - aerial_tramway: { - keywords: ["transportation", "vehicle", "ski"], - "char": "\ud83d\udea1", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - mountain_cableway: { - keywords: ["transportation", "vehicle", "ski"], - "char": "\ud83d\udea0", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - suspension_railway: { - keywords: ["vehicle", "transportation"], - "char": "\ud83d\ude9f", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - railway_car: { - keywords: ["transportation", "vehicle"], - "char": "\ud83d\ude83", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - train: { - keywords: ["transportation", "vehicle", "carriage", "public", "travel"], - "char": "\ud83d\ude8b", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - monorail: { - keywords: ["transportation", "vehicle"], - "char": "\ud83d\ude9d", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - bullettrain_side: { - keywords: ["transportation", "vehicle"], - "char": "\ud83d\ude84", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - bullettrain_front: { - keywords: ["transportation", "vehicle", "speed", "fast", "public", "travel"], - "char": "\ud83d\ude85", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - light_rail: { - keywords: ["transportation", "vehicle"], - "char": "\ud83d\ude88", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - mountain_railway: { - keywords: ["transportation", "vehicle"], - "char": "\ud83d\ude9e", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - steam_locomotive: { - keywords: ["transportation", "vehicle", "train"], - "char": "\ud83d\ude82", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - train2: { - keywords: ["transportation", "vehicle"], - "char": "\ud83d\ude86", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - metro: { - keywords: ["transportation", "blue-square", "mrt", "underground", "tube"], - "char": "\ud83d\ude87", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - tram: { - keywords: ["transportation", "vehicle"], - "char": "\ud83d\ude8a", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - station: { - keywords: ["transportation", "vehicle", "public"], - "char": "\ud83d\ude89", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - flying_saucer: { - keywords: ["transportation", "vehicle", "ufo"], - "char": "\ud83d\udef8", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - helicopter: { - keywords: ["transportation", "vehicle", "fly"], - "char": "\ud83d\ude81", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - small_airplane: { - keywords: ["flight", "transportation", "fly", "vehicle"], - "char": "\ud83d\udee9", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - airplane: { - keywords: ["vehicle", "transportation", "flight", "fly"], - "char": "\u2708\ufe0f", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - flight_departure: { - keywords: ["airport", "flight", "landing"], - "char": "\ud83d\udeeb", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - flight_arrival: { - keywords: ["airport", "flight", "boarding"], - "char": "\ud83d\udeec", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - sailboat: { - keywords: ["ship", "summer", "transportation", "water", "sailing"], - "char": "\u26f5", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - motor_boat: { - keywords: ["ship"], - "char": "\ud83d\udee5", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - speedboat: { - keywords: ["ship", "transportation", "vehicle", "summer"], - "char": "\ud83d\udea4", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - ferry: { - keywords: ["boat", "ship", "yacht"], - "char": "\u26f4", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - passenger_ship: { - keywords: ["yacht", "cruise", "ferry"], - "char": "\ud83d\udef3", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - rocket: { - keywords: ["launch", "ship", "staffmode", "NASA", "outer space", "outer_space", "fly"], - "char": "\ud83d\ude80", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - artificial_satellite: { - keywords: ["communication", "gps", "orbit", "spaceflight", "NASA", "ISS"], - "char": "\ud83d\udef0", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - seat: { - keywords: ["sit", "airplane", "transport", "bus", "flight", "fly"], - "char": "\ud83d\udcba", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - canoe: { - keywords: ["boat", "paddle", "water", "ship"], - "char": "\ud83d\udef6", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - anchor: { - keywords: ["ship", "ferry", "sea", "boat"], - "char": "\u2693", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - construction: { - keywords: ["wip", "progress", "caution", "warning"], - "char": "\ud83d\udea7", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - fuelpump: { - keywords: ["gas station", "petroleum"], - "char": "\u26fd", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - busstop: { - keywords: ["transportation", "wait"], - "char": "\ud83d\ude8f", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - vertical_traffic_light: { - keywords: ["transportation", "driving"], - "char": "\ud83d\udea6", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - traffic_light: { - keywords: ["transportation", "signal"], - "char": "\ud83d\udea5", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - checkered_flag: { - keywords: ["contest", "finishline", "race", "gokart"], - "char": "\ud83c\udfc1", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - ship: { - keywords: ["transportation", "titanic", "deploy"], - "char": "\ud83d\udea2", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - ferris_wheel: { - keywords: ["photo", "carnival", "londoneye"], - "char": "\ud83c\udfa1", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - roller_coaster: { - keywords: ["carnival", "playground", "photo", "fun"], - "char": "\ud83c\udfa2", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - carousel_horse: { - keywords: ["photo", "carnival"], - "char": "\ud83c\udfa0", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - building_construction: { - keywords: ["wip", "working", "progress"], - "char": "\ud83c\udfd7", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - foggy: { - keywords: ["photo", "mountain"], - "char": "\ud83c\udf01", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - tokyo_tower: { - keywords: ["photo", "japanese"], - "char": "\ud83d\uddfc", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - factory: { - keywords: ["building", "industry", "pollution", "smoke"], - "char": "\ud83c\udfed", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - fountain: { - keywords: ["photo", "summer", "water", "fresh"], - "char": "\u26f2", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - rice_scene: { - keywords: ["photo", "japan", "asia", "tsukimi"], - "char": "\ud83c\udf91", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - mountain: { - keywords: ["photo", "nature", "environment"], - "char": "\u26f0", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - mountain_snow: { - keywords: ["photo", "nature", "environment", "winter", "cold"], - "char": "\ud83c\udfd4", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - mount_fuji: { - keywords: ["photo", "mountain", "nature", "japanese"], - "char": "\ud83d\uddfb", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - volcano: { - keywords: ["photo", "nature", "disaster"], - "char": "\ud83c\udf0b", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - japan: { - keywords: ["nation", "country", "japanese", "asia"], - "char": "\ud83d\uddfe", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - camping: { - keywords: ["photo", "outdoors", "tent"], - "char": "\ud83c\udfd5", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - tent: { - keywords: ["photo", "camping", "outdoors"], - "char": "\u26fa", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - national_park: { - keywords: ["photo", "environment", "nature"], - "char": "\ud83c\udfde", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - motorway: { - keywords: ["road", "cupertino", "interstate", "highway"], - "char": "\ud83d\udee3", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - railway_track: { - keywords: ["train", "transportation"], - "char": "\ud83d\udee4", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - sunrise: { - keywords: ["morning", "view", "vacation", "photo"], - "char": "\ud83c\udf05", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - sunrise_over_mountains: { - keywords: ["view", "vacation", "photo"], - "char": "\ud83c\udf04", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - desert: { - keywords: ["photo", "warm", "saharah"], - "char": "\ud83c\udfdc", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - beach_umbrella: { - keywords: ["weather", "summer", "sunny", "sand", "mojito"], - "char": "\ud83c\udfd6", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - desert_island: { - keywords: ["photo", "tropical", "mojito"], - "char": "\ud83c\udfdd", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - city_sunrise: { - keywords: ["photo", "good morning", "dawn"], - "char": "\ud83c\udf07", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - city_sunset: { - keywords: ["photo", "evening", "sky", "buildings"], - "char": "\ud83c\udf06", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - cityscape: { - keywords: ["photo", "night life", "urban"], - "char": "\ud83c\udfd9", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - night_with_stars: { - keywords: ["evening", "city", "downtown"], - "char": "\ud83c\udf03", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - bridge_at_night: { - keywords: ["photo", "sanfrancisco"], - "char": "\ud83c\udf09", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - milky_way: { - keywords: ["photo", "space", "stars"], - "char": "\ud83c\udf0c", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - stars: { - keywords: ["night", "photo"], - "char": "\ud83c\udf20", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - sparkler: { - keywords: ["stars", "night", "shine"], - "char": "\ud83c\udf87", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - fireworks: { - keywords: ["photo", "festival", "carnival", "congratulations"], - "char": "\ud83c\udf86", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - rainbow: { - keywords: ["nature", "happy", "unicorn_face", "photo", "sky", "spring"], - "char": "\ud83c\udf08", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - houses: { - keywords: ["buildings", "photo"], - "char": "\ud83c\udfd8", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - european_castle: { - keywords: ["building", "royalty", "history"], - "char": "\ud83c\udff0", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - japanese_castle: { - keywords: ["photo", "building"], - "char": "\ud83c\udfef", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - stadium: { - keywords: ["photo", "place", "sports", "concert", "venue"], - "char": "\ud83c\udfdf", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - statue_of_liberty: { - keywords: ["american", "newyork"], - "char": "\ud83d\uddfd", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - house: { - keywords: ["building", "home"], - "char": "\ud83c\udfe0", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - house_with_garden: { - keywords: ["home", "plant", "nature"], - "char": "\ud83c\udfe1", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - derelict_house: { - keywords: ["abandon", "evict", "broken", "building"], - "char": "\ud83c\udfda", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - office: { - keywords: ["building", "bureau", "work"], - "char": "\ud83c\udfe2", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - department_store: { - keywords: ["building", "shopping", "mall"], - "char": "\ud83c\udfec", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - post_office: { - keywords: ["building", "envelope", "communication"], - "char": "\ud83c\udfe3", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - european_post_office: { - keywords: ["building", "email"], - "char": "\ud83c\udfe4", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - hospital: { - keywords: ["building", "health", "surgery", "doctor"], - "char": "\ud83c\udfe5", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - bank: { - keywords: ["building", "money", "sales", "cash", "business", "enterprise"], - "char": "\ud83c\udfe6", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - hotel: { - keywords: ["building", "accomodation", "checkin"], - "char": "\ud83c\udfe8", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - convenience_store: { - keywords: ["building", "shopping", "groceries"], - "char": "\ud83c\udfea", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - school: { - keywords: ["building", "student", "education", "learn", "teach"], - "char": "\ud83c\udfeb", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - love_hotel: { - keywords: ["like", "affection", "dating"], - "char": "\ud83c\udfe9", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - wedding: { - keywords: ["love", "like", "affection", "couple", "marriage", "bride", "groom"], - "char": "\ud83d\udc92", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - classical_building: { - keywords: ["art", "culture", "history"], - "char": "\ud83c\udfdb", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - church: { - keywords: ["building", "religion", "christ"], - "char": "\u26ea", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - mosque: { - keywords: ["islam", "worship", "minaret"], - "char": "\ud83d\udd4c", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - synagogue: { - keywords: ["judaism", "worship", "temple", "jewish"], - "char": "\ud83d\udd4d", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - kaaba: { - keywords: ["mecca", "mosque", "islam"], - "char": "\ud83d\udd4b", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - shinto_shrine: { - keywords: ["temple", "japan", "kyoto"], - "char": "\u26e9", - fitzpatrick_scale: false, - category: "travel_and_places" - }, - watch: { - keywords: ["time", "accessories"], - "char": "\u231a", - fitzpatrick_scale: false, - category: "objects" - }, - iphone: { - keywords: ["technology", "apple", "gadgets", "dial"], - "char": "\ud83d\udcf1", - fitzpatrick_scale: false, - category: "objects" - }, - calling: { - keywords: ["iphone", "incoming"], - "char": "\ud83d\udcf2", - fitzpatrick_scale: false, - category: "objects" - }, - computer: { - keywords: ["technology", "laptop", "screen", "display", "monitor"], - "char": "\ud83d\udcbb", - fitzpatrick_scale: false, - category: "objects" - }, - keyboard: { - keywords: ["technology", "computer", "type", "input", "text"], - "char": "\u2328", - fitzpatrick_scale: false, - category: "objects" - }, - desktop_computer: { - keywords: ["technology", "computing", "screen"], - "char": "\ud83d\udda5", - fitzpatrick_scale: false, - category: "objects" - }, - printer: { - keywords: ["paper", "ink"], - "char": "\ud83d\udda8", - fitzpatrick_scale: false, - category: "objects" - }, - computer_mouse: { - keywords: ["click"], - "char": "\ud83d\uddb1", - fitzpatrick_scale: false, - category: "objects" - }, - trackball: { - keywords: ["technology", "trackpad"], - "char": "\ud83d\uddb2", - fitzpatrick_scale: false, - category: "objects" - }, - joystick: { - keywords: ["game", "play"], - "char": "\ud83d\udd79", - fitzpatrick_scale: false, - category: "objects" - }, - clamp: { - keywords: ["tool"], - "char": "\ud83d\udddc", - fitzpatrick_scale: false, - category: "objects" - }, - minidisc: { - keywords: ["technology", "record", "data", "disk", "90s"], - "char": "\ud83d\udcbd", - fitzpatrick_scale: false, - category: "objects" - }, - floppy_disk: { - keywords: ["oldschool", "technology", "save", "90s", "80s"], - "char": "\ud83d\udcbe", - fitzpatrick_scale: false, - category: "objects" - }, - cd: { - keywords: ["technology", "dvd", "disk", "disc", "90s"], - "char": "\ud83d\udcbf", - fitzpatrick_scale: false, - category: "objects" - }, - dvd: { - keywords: ["cd", "disk", "disc"], - "char": "\ud83d\udcc0", - fitzpatrick_scale: false, - category: "objects" - }, - vhs: { - keywords: ["record", "video", "oldschool", "90s", "80s"], - "char": "\ud83d\udcfc", - fitzpatrick_scale: false, - category: "objects" - }, - camera: { - keywords: ["gadgets", "photography"], - "char": "\ud83d\udcf7", - fitzpatrick_scale: false, - category: "objects" - }, - camera_flash: { - keywords: ["photography", "gadgets"], - "char": "\ud83d\udcf8", - fitzpatrick_scale: false, - category: "objects" - }, - video_camera: { - keywords: ["film", "record"], - "char": "\ud83d\udcf9", - fitzpatrick_scale: false, - category: "objects" - }, - movie_camera: { - keywords: ["film", "record"], - "char": "\ud83c\udfa5", - fitzpatrick_scale: false, - category: "objects" - }, - film_projector: { - keywords: ["video", "tape", "record", "movie"], - "char": "\ud83d\udcfd", - fitzpatrick_scale: false, - category: "objects" - }, - film_strip: { - keywords: ["movie"], - "char": "\ud83c\udf9e", - fitzpatrick_scale: false, - category: "objects" - }, - telephone_receiver: { - keywords: ["technology", "communication", "dial"], - "char": "\ud83d\udcde", - fitzpatrick_scale: false, - category: "objects" - }, - phone: { - keywords: ["technology", "communication", "dial", "telephone"], - "char": "\u260e\ufe0f", - fitzpatrick_scale: false, - category: "objects" - }, - pager: { - keywords: ["bbcall", "oldschool", "90s"], - "char": "\ud83d\udcdf", - fitzpatrick_scale: false, - category: "objects" - }, - fax: { - keywords: ["communication", "technology"], - "char": "\ud83d\udce0", - fitzpatrick_scale: false, - category: "objects" - }, - tv: { - keywords: ["technology", "program", "oldschool", "show", "television"], - "char": "\ud83d\udcfa", - fitzpatrick_scale: false, - category: "objects" - }, - radio: { - keywords: ["communication", "music", "podcast", "program"], - "char": "\ud83d\udcfb", - fitzpatrick_scale: false, - category: "objects" - }, - studio_microphone: { - keywords: ["sing", "recording", "artist", "talkshow"], - "char": "\ud83c\udf99", - fitzpatrick_scale: false, - category: "objects" - }, - level_slider: { - keywords: ["scale"], - "char": "\ud83c\udf9a", - fitzpatrick_scale: false, - category: "objects" - }, - control_knobs: { - keywords: ["dial"], - "char": "\ud83c\udf9b", - fitzpatrick_scale: false, - category: "objects" - }, - compass: { - keywords: ["magnetic", "navigation", "orienteering"], - "char": "\ud83e\udded", - fitzpatrick_scale: false, - category: "objects" - }, - stopwatch: { - keywords: ["time", "deadline"], - "char": "\u23f1", - fitzpatrick_scale: false, - category: "objects" - }, - timer_clock: { - keywords: ["alarm"], - "char": "\u23f2", - fitzpatrick_scale: false, - category: "objects" - }, - alarm_clock: { - keywords: ["time", "wake"], - "char": "\u23f0", - fitzpatrick_scale: false, - category: "objects" - }, - mantelpiece_clock: { - keywords: ["time"], - "char": "\ud83d\udd70", - fitzpatrick_scale: false, - category: "objects" - }, - hourglass_flowing_sand: { - keywords: ["oldschool", "time", "countdown"], - "char": "\u23f3", - fitzpatrick_scale: false, - category: "objects" - }, - hourglass: { - keywords: ["time", "clock", "oldschool", "limit", "exam", "quiz", "test"], - "char": "\u231b", - fitzpatrick_scale: false, - category: "objects" - }, - satellite: { - keywords: ["communication", "future", "radio", "space"], - "char": "\ud83d\udce1", - fitzpatrick_scale: false, - category: "objects" - }, - battery: { - keywords: ["power", "energy", "sustain"], - "char": "\ud83d\udd0b", - fitzpatrick_scale: false, - category: "objects" - }, - electric_plug: { - keywords: ["charger", "power"], - "char": "\ud83d\udd0c", - fitzpatrick_scale: false, - category: "objects" - }, - bulb: { - keywords: ["light", "electricity", "idea"], - "char": "\ud83d\udca1", - fitzpatrick_scale: false, - category: "objects" - }, - flashlight: { - keywords: ["dark", "camping", "sight", "night"], - "char": "\ud83d\udd26", - fitzpatrick_scale: false, - category: "objects" - }, - candle: { - keywords: ["fire", "wax"], - "char": "\ud83d\udd6f", - fitzpatrick_scale: false, - category: "objects" - }, - fire_extinguisher: { - keywords: ["quench"], - "char": "\ud83e\uddef", - fitzpatrick_scale: false, - category: "objects" - }, - wastebasket: { - keywords: ["bin", "trash", "rubbish", "garbage", "toss"], - "char": "\ud83d\uddd1", - fitzpatrick_scale: false, - category: "objects" - }, - oil_drum: { - keywords: ["barrell"], - "char": "\ud83d\udee2", - fitzpatrick_scale: false, - category: "objects" - }, - money_with_wings: { - keywords: ["dollar", "bills", "payment", "sale"], - "char": "\ud83d\udcb8", - fitzpatrick_scale: false, - category: "objects" - }, - dollar: { - keywords: ["money", "sales", "bill", "currency"], - "char": "\ud83d\udcb5", - fitzpatrick_scale: false, - category: "objects" - }, - yen: { - keywords: ["money", "sales", "japanese", "dollar", "currency"], - "char": "\ud83d\udcb4", - fitzpatrick_scale: false, - category: "objects" - }, - euro: { - keywords: ["money", "sales", "dollar", "currency"], - "char": "\ud83d\udcb6", - fitzpatrick_scale: false, - category: "objects" - }, - pound: { - keywords: ["british", "sterling", "money", "sales", "bills", "uk", "england", "currency"], - "char": "\ud83d\udcb7", - fitzpatrick_scale: false, - category: "objects" - }, - moneybag: { - keywords: ["dollar", "payment", "coins", "sale"], - "char": "\ud83d\udcb0", - fitzpatrick_scale: false, - category: "objects" - }, - credit_card: { - keywords: ["money", "sales", "dollar", "bill", "payment", "shopping"], - "char": "\ud83d\udcb3", - fitzpatrick_scale: false, - category: "objects" - }, - gem: { - keywords: ["blue", "ruby", "diamond", "jewelry"], - "char": "\ud83d\udc8e", - fitzpatrick_scale: false, - category: "objects" - }, - balance_scale: { - keywords: ["law", "fairness", "weight"], - "char": "\u2696", - fitzpatrick_scale: false, - category: "objects" - }, - toolbox: { - keywords: ["tools", "diy", "fix", "maintainer", "mechanic"], - "char": "\ud83e\uddf0", - fitzpatrick_scale: false, - category: "objects" - }, - wrench: { - keywords: ["tools", "diy", "ikea", "fix", "maintainer"], - "char": "\ud83d\udd27", - fitzpatrick_scale: false, - category: "objects" - }, - hammer: { - keywords: ["tools", "build", "create"], - "char": "\ud83d\udd28", - fitzpatrick_scale: false, - category: "objects" - }, - hammer_and_pick: { - keywords: ["tools", "build", "create"], - "char": "\u2692", - fitzpatrick_scale: false, - category: "objects" - }, - hammer_and_wrench: { - keywords: ["tools", "build", "create"], - "char": "\ud83d\udee0", - fitzpatrick_scale: false, - category: "objects" - }, - pick: { - keywords: ["tools", "dig"], - "char": "\u26cf", - fitzpatrick_scale: false, - category: "objects" - }, - nut_and_bolt: { - keywords: ["handy", "tools", "fix"], - "char": "\ud83d\udd29", - fitzpatrick_scale: false, - category: "objects" - }, - gear: { - keywords: ["cog"], - "char": "\u2699", - fitzpatrick_scale: false, - category: "objects" - }, - brick: { - keywords: ["bricks"], - "char": "\ud83e\uddf1", - fitzpatrick_scale: false, - category: "objects" - }, - chains: { - keywords: ["lock", "arrest"], - "char": "\u26d3", - fitzpatrick_scale: false, - category: "objects" - }, - magnet: { - keywords: ["attraction", "magnetic"], - "char": "\ud83e\uddf2", - fitzpatrick_scale: false, - category: "objects" - }, - gun: { - keywords: ["violence", "weapon", "pistol", "revolver"], - "char": "\ud83d\udd2b", - fitzpatrick_scale: false, - category: "objects" - }, - bomb: { - keywords: ["boom", "explode", "explosion", "terrorism"], - "char": "\ud83d\udca3", - fitzpatrick_scale: false, - category: "objects" - }, - firecracker: { - keywords: ["dynamite", "boom", "explode", "explosion", "explosive"], - "char": "\ud83e\udde8", - fitzpatrick_scale: false, - category: "objects" - }, - hocho: { - keywords: ["knife", "blade", "cutlery", "kitchen", "weapon"], - "char": "\ud83d\udd2a", - fitzpatrick_scale: false, - category: "objects" - }, - dagger: { - keywords: ["weapon"], - "char": "\ud83d\udde1", - fitzpatrick_scale: false, - category: "objects" - }, - crossed_swords: { - keywords: ["weapon"], - "char": "\u2694", - fitzpatrick_scale: false, - category: "objects" - }, - shield: { - keywords: ["protection", "security"], - "char": "\ud83d\udee1", - fitzpatrick_scale: false, - category: "objects" - }, - smoking: { - keywords: ["kills", "tobacco", "cigarette", "joint", "smoke"], - "char": "\ud83d\udeac", - fitzpatrick_scale: false, - category: "objects" - }, - skull_and_crossbones: { - keywords: ["poison", "danger", "deadly", "scary", "death", "pirate", "evil"], - "char": "\u2620", - fitzpatrick_scale: false, - category: "objects" - }, - coffin: { - keywords: ["vampire", "dead", "die", "death", "rip", "graveyard", "cemetery", "casket", "funeral", "box"], - "char": "\u26b0", - fitzpatrick_scale: false, - category: "objects" - }, - funeral_urn: { - keywords: ["dead", "die", "death", "rip", "ashes"], - "char": "\u26b1", - fitzpatrick_scale: false, - category: "objects" - }, - amphora: { - keywords: ["vase", "jar"], - "char": "\ud83c\udffa", - fitzpatrick_scale: false, - category: "objects" - }, - crystal_ball: { - keywords: ["disco", "party", "magic", "circus", "fortune_teller"], - "char": "\ud83d\udd2e", - fitzpatrick_scale: false, - category: "objects" - }, - prayer_beads: { - keywords: ["dhikr", "religious"], - "char": "\ud83d\udcff", - fitzpatrick_scale: false, - category: "objects" - }, - nazar_amulet: { - keywords: ["bead", "charm"], - "char": "\ud83e\uddff", - fitzpatrick_scale: false, - category: "objects" - }, - barber: { - keywords: ["hair", "salon", "style"], - "char": "\ud83d\udc88", - fitzpatrick_scale: false, - category: "objects" - }, - alembic: { - keywords: ["distilling", "science", "experiment", "chemistry"], - "char": "\u2697", - fitzpatrick_scale: false, - category: "objects" - }, - telescope: { - keywords: ["stars", "space", "zoom", "science", "astronomy"], - "char": "\ud83d\udd2d", - fitzpatrick_scale: false, - category: "objects" - }, - microscope: { - keywords: ["laboratory", "experiment", "zoomin", "science", "study"], - "char": "\ud83d\udd2c", - fitzpatrick_scale: false, - category: "objects" - }, - hole: { - keywords: ["embarrassing"], - "char": "\ud83d\udd73", - fitzpatrick_scale: false, - category: "objects" - }, - pill: { - keywords: ["health", "medicine", "doctor", "pharmacy", "drug"], - "char": "\ud83d\udc8a", - fitzpatrick_scale: false, - category: "objects" - }, - syringe: { - keywords: ["health", "hospital", "drugs", "blood", "medicine", "needle", "doctor", "nurse"], - "char": "\ud83d\udc89", - fitzpatrick_scale: false, - category: "objects" - }, - dna: { - keywords: ["biologist", "genetics", "life"], - "char": "\ud83e\uddec", - fitzpatrick_scale: false, - category: "objects" - }, - microbe: { - keywords: ["amoeba", "bacteria", "germs"], - "char": "\ud83e\udda0", - fitzpatrick_scale: false, - category: "objects" - }, - petri_dish: { - keywords: ["bacteria", "biology", "culture", "lab"], - "char": "\ud83e\uddeb", - fitzpatrick_scale: false, - category: "objects" - }, - test_tube: { - keywords: ["chemistry", "experiment", "lab", "science"], - "char": "\ud83e\uddea", - fitzpatrick_scale: false, - category: "objects" - }, - thermometer: { - keywords: ["weather", "temperature", "hot", "cold"], - "char": "\ud83c\udf21", - fitzpatrick_scale: false, - category: "objects" - }, - broom: { - keywords: ["cleaning", "sweeping", "witch"], - "char": "\ud83e\uddf9", - fitzpatrick_scale: false, - category: "objects" - }, - basket: { - keywords: ["laundry"], - "char": "\ud83e\uddfa", - fitzpatrick_scale: false, - category: "objects" - }, - toilet_paper: { - keywords: ["roll"], - "char": "\ud83e\uddfb", - fitzpatrick_scale: false, - category: "objects" - }, - label: { - keywords: ["sale", "tag"], - "char": "\ud83c\udff7", - fitzpatrick_scale: false, - category: "objects" - }, - bookmark: { - keywords: ["favorite", "label", "save"], - "char": "\ud83d\udd16", - fitzpatrick_scale: false, - category: "objects" - }, - toilet: { - keywords: ["restroom", "wc", "washroom", "bathroom", "potty"], - "char": "\ud83d\udebd", - fitzpatrick_scale: false, - category: "objects" - }, - shower: { - keywords: ["clean", "water", "bathroom"], - "char": "\ud83d\udebf", - fitzpatrick_scale: false, - category: "objects" - }, - bathtub: { - keywords: ["clean", "shower", "bathroom"], - "char": "\ud83d\udec1", - fitzpatrick_scale: false, - category: "objects" - }, - soap: { - keywords: ["bar", "bathing", "cleaning", "lather"], - "char": "\ud83e\uddfc", - fitzpatrick_scale: false, - category: "objects" - }, - sponge: { - keywords: ["absorbing", "cleaning", "porous"], - "char": "\ud83e\uddfd", - fitzpatrick_scale: false, - category: "objects" - }, - lotion_bottle: { - keywords: ["moisturizer", "sunscreen"], - "char": "\ud83e\uddf4", - fitzpatrick_scale: false, - category: "objects" - }, - key: { - keywords: ["lock", "door", "password"], - "char": "\ud83d\udd11", - fitzpatrick_scale: false, - category: "objects" - }, - old_key: { - keywords: ["lock", "door", "password"], - "char": "\ud83d\udddd", - fitzpatrick_scale: false, - category: "objects" - }, - couch_and_lamp: { - keywords: ["read", "chill"], - "char": "\ud83d\udecb", - fitzpatrick_scale: false, - category: "objects" - }, - sleeping_bed: { - keywords: ["bed", "rest"], - "char": "\ud83d\udecc", - fitzpatrick_scale: true, - category: "objects" - }, - bed: { - keywords: ["sleep", "rest"], - "char": "\ud83d\udecf", - fitzpatrick_scale: false, - category: "objects" - }, - door: { - keywords: ["house", "entry", "exit"], - "char": "\ud83d\udeaa", - fitzpatrick_scale: false, - category: "objects" - }, - bellhop_bell: { - keywords: ["service"], - "char": "\ud83d\udece", - fitzpatrick_scale: false, - category: "objects" - }, - teddy_bear: { - keywords: ["plush", "stuffed"], - "char": "\ud83e\uddf8", - fitzpatrick_scale: false, - category: "objects" - }, - framed_picture: { - keywords: ["photography"], - "char": "\ud83d\uddbc", - fitzpatrick_scale: false, - category: "objects" - }, - world_map: { - keywords: ["location", "direction"], - "char": "\ud83d\uddfa", - fitzpatrick_scale: false, - category: "objects" - }, - parasol_on_ground: { - keywords: ["weather", "summer"], - "char": "\u26f1", - fitzpatrick_scale: false, - category: "objects" - }, - moyai: { - keywords: ["rock", "easter island", "moai"], - "char": "\ud83d\uddff", - fitzpatrick_scale: false, - category: "objects" - }, - shopping: { - keywords: ["mall", "buy", "purchase"], - "char": "\ud83d\udecd", - fitzpatrick_scale: false, - category: "objects" - }, - shopping_cart: { - keywords: ["trolley"], - "char": "\ud83d\uded2", - fitzpatrick_scale: false, - category: "objects" - }, - balloon: { - keywords: ["party", "celebration", "birthday", "circus"], - "char": "\ud83c\udf88", - fitzpatrick_scale: false, - category: "objects" - }, - flags: { - keywords: ["fish", "japanese", "koinobori", "carp", "banner"], - "char": "\ud83c\udf8f", - fitzpatrick_scale: false, - category: "objects" - }, - ribbon: { - keywords: ["decoration", "pink", "girl", "bowtie"], - "char": "\ud83c\udf80", - fitzpatrick_scale: false, - category: "objects" - }, - gift: { - keywords: ["present", "birthday", "christmas", "xmas"], - "char": "\ud83c\udf81", - fitzpatrick_scale: false, - category: "objects" - }, - confetti_ball: { - keywords: ["festival", "party", "birthday", "circus"], - "char": "\ud83c\udf8a", - fitzpatrick_scale: false, - category: "objects" - }, - tada: { - keywords: ["party", "congratulations", "birthday", "magic", "circus", "celebration"], - "char": "\ud83c\udf89", - fitzpatrick_scale: false, - category: "objects" - }, - dolls: { - keywords: ["japanese", "toy", "kimono"], - "char": "\ud83c\udf8e", - fitzpatrick_scale: false, - category: "objects" - }, - wind_chime: { - keywords: ["nature", "ding", "spring", "bell"], - "char": "\ud83c\udf90", - fitzpatrick_scale: false, - category: "objects" - }, - crossed_flags: { - keywords: ["japanese", "nation", "country", "border"], - "char": "\ud83c\udf8c", - fitzpatrick_scale: false, - category: "objects" - }, - izakaya_lantern: { - keywords: ["light", "paper", "halloween", "spooky"], - "char": "\ud83c\udfee", - fitzpatrick_scale: false, - category: "objects" - }, - red_envelope: { - keywords: ["gift"], - "char": "\ud83e\udde7", - fitzpatrick_scale: false, - category: "objects" - }, - email: { - keywords: ["letter", "postal", "inbox", "communication"], - "char": "\u2709\ufe0f", - fitzpatrick_scale: false, - category: "objects" - }, - envelope_with_arrow: { - keywords: ["email", "communication"], - "char": "\ud83d\udce9", - fitzpatrick_scale: false, - category: "objects" - }, - incoming_envelope: { - keywords: ["email", "inbox"], - "char": "\ud83d\udce8", - fitzpatrick_scale: false, - category: "objects" - }, - "e-mail": { - keywords: ["communication", "inbox"], - "char": "\ud83d\udce7", - fitzpatrick_scale: false, - category: "objects" - }, - love_letter: { - keywords: ["email", "like", "affection", "envelope", "valentines"], - "char": "\ud83d\udc8c", - fitzpatrick_scale: false, - category: "objects" - }, - postbox: { - keywords: ["email", "letter", "envelope"], - "char": "\ud83d\udcee", - fitzpatrick_scale: false, - category: "objects" - }, - mailbox_closed: { - keywords: ["email", "communication", "inbox"], - "char": "\ud83d\udcea", - fitzpatrick_scale: false, - category: "objects" - }, - mailbox: { - keywords: ["email", "inbox", "communication"], - "char": "\ud83d\udceb", - fitzpatrick_scale: false, - category: "objects" - }, - mailbox_with_mail: { - keywords: ["email", "inbox", "communication"], - "char": "\ud83d\udcec", - fitzpatrick_scale: false, - category: "objects" - }, - mailbox_with_no_mail: { - keywords: ["email", "inbox"], - "char": "\ud83d\udced", - fitzpatrick_scale: false, - category: "objects" - }, - "package": { - keywords: ["mail", "gift", "cardboard", "box", "moving"], - "char": "\ud83d\udce6", - fitzpatrick_scale: false, - category: "objects" - }, - postal_horn: { - keywords: ["instrument", "music"], - "char": "\ud83d\udcef", - fitzpatrick_scale: false, - category: "objects" - }, - inbox_tray: { - keywords: ["email", "documents"], - "char": "\ud83d\udce5", - fitzpatrick_scale: false, - category: "objects" - }, - outbox_tray: { - keywords: ["inbox", "email"], - "char": "\ud83d\udce4", - fitzpatrick_scale: false, - category: "objects" - }, - scroll: { - keywords: ["documents", "ancient", "history", "paper"], - "char": "\ud83d\udcdc", - fitzpatrick_scale: false, - category: "objects" - }, - page_with_curl: { - keywords: ["documents", "office", "paper"], - "char": "\ud83d\udcc3", - fitzpatrick_scale: false, - category: "objects" - }, - bookmark_tabs: { - keywords: ["favorite", "save", "order", "tidy"], - "char": "\ud83d\udcd1", - fitzpatrick_scale: false, - category: "objects" - }, - receipt: { - keywords: ["accounting", "expenses"], - "char": "\ud83e\uddfe", - fitzpatrick_scale: false, - category: "objects" - }, - bar_chart: { - keywords: ["graph", "presentation", "stats"], - "char": "\ud83d\udcca", - fitzpatrick_scale: false, - category: "objects" - }, - chart_with_upwards_trend: { - keywords: ["graph", "presentation", "stats", "recovery", "business", "economics", "money", "sales", "good", "success"], - "char": "\ud83d\udcc8", - fitzpatrick_scale: false, - category: "objects" - }, - chart_with_downwards_trend: { - keywords: ["graph", "presentation", "stats", "recession", "business", "economics", "money", "sales", "bad", "failure"], - "char": "\ud83d\udcc9", - fitzpatrick_scale: false, - category: "objects" - }, - page_facing_up: { - keywords: ["documents", "office", "paper", "information"], - "char": "\ud83d\udcc4", - fitzpatrick_scale: false, - category: "objects" - }, - date: { - keywords: ["calendar", "schedule"], - "char": "\ud83d\udcc5", - fitzpatrick_scale: false, - category: "objects" - }, - calendar: { - keywords: ["schedule", "date", "planning"], - "char": "\ud83d\udcc6", - fitzpatrick_scale: false, - category: "objects" - }, - spiral_calendar: { - keywords: ["date", "schedule", "planning"], - "char": "\ud83d\uddd3", - fitzpatrick_scale: false, - category: "objects" - }, - card_index: { - keywords: ["business", "stationery"], - "char": "\ud83d\udcc7", - fitzpatrick_scale: false, - category: "objects" - }, - card_file_box: { - keywords: ["business", "stationery"], - "char": "\ud83d\uddc3", - fitzpatrick_scale: false, - category: "objects" - }, - ballot_box: { - keywords: ["election", "vote"], - "char": "\ud83d\uddf3", - fitzpatrick_scale: false, - category: "objects" - }, - file_cabinet: { - keywords: ["filing", "organizing"], - "char": "\ud83d\uddc4", - fitzpatrick_scale: false, - category: "objects" - }, - clipboard: { - keywords: ["stationery", "documents"], - "char": "\ud83d\udccb", - fitzpatrick_scale: false, - category: "objects" - }, - spiral_notepad: { - keywords: ["memo", "stationery"], - "char": "\ud83d\uddd2", - fitzpatrick_scale: false, - category: "objects" - }, - file_folder: { - keywords: ["documents", "business", "office"], - "char": "\ud83d\udcc1", - fitzpatrick_scale: false, - category: "objects" - }, - open_file_folder: { - keywords: ["documents", "load"], - "char": "\ud83d\udcc2", - fitzpatrick_scale: false, - category: "objects" - }, - card_index_dividers: { - keywords: ["organizing", "business", "stationery"], - "char": "\ud83d\uddc2", - fitzpatrick_scale: false, - category: "objects" - }, - newspaper_roll: { - keywords: ["press", "headline"], - "char": "\ud83d\uddde", - fitzpatrick_scale: false, - category: "objects" - }, - newspaper: { - keywords: ["press", "headline"], - "char": "\ud83d\udcf0", - fitzpatrick_scale: false, - category: "objects" - }, - notebook: { - keywords: ["stationery", "record", "notes", "paper", "study"], - "char": "\ud83d\udcd3", - fitzpatrick_scale: false, - category: "objects" - }, - closed_book: { - keywords: ["read", "library", "knowledge", "textbook", "learn"], - "char": "\ud83d\udcd5", - fitzpatrick_scale: false, - category: "objects" - }, - green_book: { - keywords: ["read", "library", "knowledge", "study"], - "char": "\ud83d\udcd7", - fitzpatrick_scale: false, - category: "objects" - }, - blue_book: { - keywords: ["read", "library", "knowledge", "learn", "study"], - "char": "\ud83d\udcd8", - fitzpatrick_scale: false, - category: "objects" - }, - orange_book: { - keywords: ["read", "library", "knowledge", "textbook", "study"], - "char": "\ud83d\udcd9", - fitzpatrick_scale: false, - category: "objects" - }, - notebook_with_decorative_cover: { - keywords: ["classroom", "notes", "record", "paper", "study"], - "char": "\ud83d\udcd4", - fitzpatrick_scale: false, - category: "objects" - }, - ledger: { - keywords: ["notes", "paper"], - "char": "\ud83d\udcd2", - fitzpatrick_scale: false, - category: "objects" - }, - books: { - keywords: ["literature", "library", "study"], - "char": "\ud83d\udcda", - fitzpatrick_scale: false, - category: "objects" - }, - open_book: { - keywords: ["book", "read", "library", "knowledge", "literature", "learn", "study"], - "char": "\ud83d\udcd6", - fitzpatrick_scale: false, - category: "objects" - }, - safety_pin: { - keywords: ["diaper"], - "char": "\ud83e\uddf7", - fitzpatrick_scale: false, - category: "objects" - }, - link: { - keywords: ["rings", "url"], - "char": "\ud83d\udd17", - fitzpatrick_scale: false, - category: "objects" - }, - paperclip: { - keywords: ["documents", "stationery"], - "char": "\ud83d\udcce", - fitzpatrick_scale: false, - category: "objects" - }, - paperclips: { - keywords: ["documents", "stationery"], - "char": "\ud83d\udd87", - fitzpatrick_scale: false, - category: "objects" - }, - scissors: { - keywords: ["stationery", "cut"], - "char": "\u2702\ufe0f", - fitzpatrick_scale: false, - category: "objects" - }, - triangular_ruler: { - keywords: ["stationery", "math", "architect", "sketch"], - "char": "\ud83d\udcd0", - fitzpatrick_scale: false, - category: "objects" - }, - straight_ruler: { - keywords: ["stationery", "calculate", "length", "math", "school", "drawing", "architect", "sketch"], - "char": "\ud83d\udccf", - fitzpatrick_scale: false, - category: "objects" - }, - abacus: { - keywords: ["calculation"], - "char": "\ud83e\uddee", - fitzpatrick_scale: false, - category: "objects" - }, - pushpin: { - keywords: ["stationery", "mark", "here"], - "char": "\ud83d\udccc", - fitzpatrick_scale: false, - category: "objects" - }, - round_pushpin: { - keywords: ["stationery", "location", "map", "here"], - "char": "\ud83d\udccd", - fitzpatrick_scale: false, - category: "objects" - }, - triangular_flag_on_post: { - keywords: ["mark", "milestone", "place"], - "char": "\ud83d\udea9", - fitzpatrick_scale: false, - category: "objects" - }, - white_flag: { - keywords: ["losing", "loser", "lost", "surrender", "give up", "fail"], - "char": "\ud83c\udff3", - fitzpatrick_scale: false, - category: "objects" - }, - black_flag: { - keywords: ["pirate"], - "char": "\ud83c\udff4", - fitzpatrick_scale: false, - category: "objects" - }, - rainbow_flag: { - keywords: ["flag", "rainbow", "pride", "gay", "lgbt", "glbt", "queer", "homosexual", "lesbian", "bisexual", "transgender"], - "char": "\ud83c\udff3\ufe0f\u200d\ud83c\udf08", - fitzpatrick_scale: false, - category: "objects" - }, - closed_lock_with_key: { - keywords: ["security", "privacy"], - "char": "\ud83d\udd10", - fitzpatrick_scale: false, - category: "objects" - }, - lock: { - keywords: ["security", "password", "padlock"], - "char": "\ud83d\udd12", - fitzpatrick_scale: false, - category: "objects" - }, - unlock: { - keywords: ["privacy", "security"], - "char": "\ud83d\udd13", - fitzpatrick_scale: false, - category: "objects" - }, - lock_with_ink_pen: { - keywords: ["security", "secret"], - "char": "\ud83d\udd0f", - fitzpatrick_scale: false, - category: "objects" - }, - pen: { - keywords: ["stationery", "writing", "write"], - "char": "\ud83d\udd8a", - fitzpatrick_scale: false, - category: "objects" - }, - fountain_pen: { - keywords: ["stationery", "writing", "write"], - "char": "\ud83d\udd8b", - fitzpatrick_scale: false, - category: "objects" - }, - black_nib: { - keywords: ["pen", "stationery", "writing", "write"], - "char": "\u2712\ufe0f", - fitzpatrick_scale: false, - category: "objects" - }, - memo: { - keywords: ["write", "documents", "stationery", "pencil", "paper", "writing", "legal", "exam", "quiz", "test", "study", "compose"], - "char": "\ud83d\udcdd", - fitzpatrick_scale: false, - category: "objects" - }, - pencil2: { - keywords: ["stationery", "write", "paper", "writing", "school", "study"], - "char": "\u270f\ufe0f", - fitzpatrick_scale: false, - category: "objects" - }, - crayon: { - keywords: ["drawing", "creativity"], - "char": "\ud83d\udd8d", - fitzpatrick_scale: false, - category: "objects" - }, - paintbrush: { - keywords: ["drawing", "creativity", "art"], - "char": "\ud83d\udd8c", - fitzpatrick_scale: false, - category: "objects" - }, - mag: { - keywords: ["search", "zoom", "find", "detective"], - "char": "\ud83d\udd0d", - fitzpatrick_scale: false, - category: "objects" - }, - mag_right: { - keywords: ["search", "zoom", "find", "detective"], - "char": "\ud83d\udd0e", - fitzpatrick_scale: false, - category: "objects" - }, - heart: { - keywords: ["love", "like", "valentines"], - "char": "\u2764\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - orange_heart: { - keywords: ["love", "like", "affection", "valentines"], - "char": "\ud83e\udde1", - fitzpatrick_scale: false, - category: "symbols" - }, - yellow_heart: { - keywords: ["love", "like", "affection", "valentines"], - "char": "\ud83d\udc9b", - fitzpatrick_scale: false, - category: "symbols" - }, - green_heart: { - keywords: ["love", "like", "affection", "valentines"], - "char": "\ud83d\udc9a", - fitzpatrick_scale: false, - category: "symbols" - }, - blue_heart: { - keywords: ["love", "like", "affection", "valentines"], - "char": "\ud83d\udc99", - fitzpatrick_scale: false, - category: "symbols" - }, - purple_heart: { - keywords: ["love", "like", "affection", "valentines"], - "char": "\ud83d\udc9c", - fitzpatrick_scale: false, - category: "symbols" - }, - black_heart: { - keywords: ["evil"], - "char": "\ud83d\udda4", - fitzpatrick_scale: false, - category: "symbols" - }, - broken_heart: { - keywords: ["sad", "sorry", "break", "heart", "heartbreak"], - "char": "\ud83d\udc94", - fitzpatrick_scale: false, - category: "symbols" - }, - heavy_heart_exclamation: { - keywords: ["decoration", "love"], - "char": "\u2763", - fitzpatrick_scale: false, - category: "symbols" - }, - two_hearts: { - keywords: ["love", "like", "affection", "valentines", "heart"], - "char": "\ud83d\udc95", - fitzpatrick_scale: false, - category: "symbols" - }, - revolving_hearts: { - keywords: ["love", "like", "affection", "valentines"], - "char": "\ud83d\udc9e", - fitzpatrick_scale: false, - category: "symbols" - }, - heartbeat: { - keywords: ["love", "like", "affection", "valentines", "pink", "heart"], - "char": "\ud83d\udc93", - fitzpatrick_scale: false, - category: "symbols" - }, - heartpulse: { - keywords: ["like", "love", "affection", "valentines", "pink"], - "char": "\ud83d\udc97", - fitzpatrick_scale: false, - category: "symbols" - }, - sparkling_heart: { - keywords: ["love", "like", "affection", "valentines"], - "char": "\ud83d\udc96", - fitzpatrick_scale: false, - category: "symbols" - }, - cupid: { - keywords: ["love", "like", "heart", "affection", "valentines"], - "char": "\ud83d\udc98", - fitzpatrick_scale: false, - category: "symbols" - }, - gift_heart: { - keywords: ["love", "valentines"], - "char": "\ud83d\udc9d", - fitzpatrick_scale: false, - category: "symbols" - }, - heart_decoration: { - keywords: ["purple-square", "love", "like"], - "char": "\ud83d\udc9f", - fitzpatrick_scale: false, - category: "symbols" - }, - peace_symbol: { - keywords: ["hippie"], - "char": "\u262e", - fitzpatrick_scale: false, - category: "symbols" - }, - latin_cross: { - keywords: ["christianity"], - "char": "\u271d", - fitzpatrick_scale: false, - category: "symbols" - }, - star_and_crescent: { - keywords: ["islam"], - "char": "\u262a", - fitzpatrick_scale: false, - category: "symbols" - }, - om: { - keywords: ["hinduism", "buddhism", "sikhism", "jainism"], - "char": "\ud83d\udd49", - fitzpatrick_scale: false, - category: "symbols" - }, - wheel_of_dharma: { - keywords: ["hinduism", "buddhism", "sikhism", "jainism"], - "char": "\u2638", - fitzpatrick_scale: false, - category: "symbols" - }, - star_of_david: { - keywords: ["judaism"], - "char": "\u2721", - fitzpatrick_scale: false, - category: "symbols" - }, - six_pointed_star: { - keywords: ["purple-square", "religion", "jewish", "hexagram"], - "char": "\ud83d\udd2f", - fitzpatrick_scale: false, - category: "symbols" - }, - menorah: { - keywords: ["hanukkah", "candles", "jewish"], - "char": "\ud83d\udd4e", - fitzpatrick_scale: false, - category: "symbols" - }, - yin_yang: { - keywords: ["balance"], - "char": "\u262f", - fitzpatrick_scale: false, - category: "symbols" - }, - orthodox_cross: { - keywords: ["suppedaneum", "religion"], - "char": "\u2626", - fitzpatrick_scale: false, - category: "symbols" - }, - place_of_worship: { - keywords: ["religion", "church", "temple", "prayer"], - "char": "\ud83d\uded0", - fitzpatrick_scale: false, - category: "symbols" - }, - ophiuchus: { - keywords: ["sign", "purple-square", "constellation", "astrology"], - "char": "\u26ce", - fitzpatrick_scale: false, - category: "symbols" - }, - aries: { - keywords: ["sign", "purple-square", "zodiac", "astrology"], - "char": "\u2648", - fitzpatrick_scale: false, - category: "symbols" - }, - taurus: { - keywords: ["purple-square", "sign", "zodiac", "astrology"], - "char": "\u2649", - fitzpatrick_scale: false, - category: "symbols" - }, - gemini: { - keywords: ["sign", "zodiac", "purple-square", "astrology"], - "char": "\u264a", - fitzpatrick_scale: false, - category: "symbols" - }, - cancer: { - keywords: ["sign", "zodiac", "purple-square", "astrology"], - "char": "\u264b", - fitzpatrick_scale: false, - category: "symbols" - }, - leo: { - keywords: ["sign", "purple-square", "zodiac", "astrology"], - "char": "\u264c", - fitzpatrick_scale: false, - category: "symbols" - }, - virgo: { - keywords: ["sign", "zodiac", "purple-square", "astrology"], - "char": "\u264d", - fitzpatrick_scale: false, - category: "symbols" - }, - libra: { - keywords: ["sign", "purple-square", "zodiac", "astrology"], - "char": "\u264e", - fitzpatrick_scale: false, - category: "symbols" - }, - scorpius: { - keywords: ["sign", "zodiac", "purple-square", "astrology", "scorpio"], - "char": "\u264f", - fitzpatrick_scale: false, - category: "symbols" - }, - sagittarius: { - keywords: ["sign", "zodiac", "purple-square", "astrology"], - "char": "\u2650", - fitzpatrick_scale: false, - category: "symbols" - }, - capricorn: { - keywords: ["sign", "zodiac", "purple-square", "astrology"], - "char": "\u2651", - fitzpatrick_scale: false, - category: "symbols" - }, - aquarius: { - keywords: ["sign", "purple-square", "zodiac", "astrology"], - "char": "\u2652", - fitzpatrick_scale: false, - category: "symbols" - }, - pisces: { - keywords: ["purple-square", "sign", "zodiac", "astrology"], - "char": "\u2653", - fitzpatrick_scale: false, - category: "symbols" - }, - id: { - keywords: ["purple-square", "words"], - "char": "\ud83c\udd94", - fitzpatrick_scale: false, - category: "symbols" - }, - atom_symbol: { - keywords: ["science", "physics", "chemistry"], - "char": "\u269b", - fitzpatrick_scale: false, - category: "symbols" - }, - u7a7a: { - keywords: ["kanji", "japanese", "chinese", "empty", "sky", "blue-square"], - "char": "\ud83c\ude33", - fitzpatrick_scale: false, - category: "symbols" - }, - u5272: { - keywords: ["cut", "divide", "chinese", "kanji", "pink-square"], - "char": "\ud83c\ude39", - fitzpatrick_scale: false, - category: "symbols" - }, - radioactive: { - keywords: ["nuclear", "danger"], - "char": "\u2622", - fitzpatrick_scale: false, - category: "symbols" - }, - biohazard: { - keywords: ["danger"], - "char": "\u2623", - fitzpatrick_scale: false, - category: "symbols" - }, - mobile_phone_off: { - keywords: ["mute", "orange-square", "silence", "quiet"], - "char": "\ud83d\udcf4", - fitzpatrick_scale: false, - category: "symbols" - }, - vibration_mode: { - keywords: ["orange-square", "phone"], - "char": "\ud83d\udcf3", - fitzpatrick_scale: false, - category: "symbols" - }, - u6709: { - keywords: ["orange-square", "chinese", "have", "kanji"], - "char": "\ud83c\ude36", - fitzpatrick_scale: false, - category: "symbols" - }, - u7121: { - keywords: ["nothing", "chinese", "kanji", "japanese", "orange-square"], - "char": "\ud83c\ude1a", - fitzpatrick_scale: false, - category: "symbols" - }, - u7533: { - keywords: ["chinese", "japanese", "kanji", "orange-square"], - "char": "\ud83c\ude38", - fitzpatrick_scale: false, - category: "symbols" - }, - u55b6: { - keywords: ["japanese", "opening hours", "orange-square"], - "char": "\ud83c\ude3a", - fitzpatrick_scale: false, - category: "symbols" - }, - u6708: { - keywords: ["chinese", "month", "moon", "japanese", "orange-square", "kanji"], - "char": "\ud83c\ude37\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - eight_pointed_black_star: { - keywords: ["orange-square", "shape", "polygon"], - "char": "\u2734\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - vs: { - keywords: ["words", "orange-square"], - "char": "\ud83c\udd9a", - fitzpatrick_scale: false, - category: "symbols" - }, - accept: { - keywords: ["ok", "good", "chinese", "kanji", "agree", "yes", "orange-circle"], - "char": "\ud83c\ude51", - fitzpatrick_scale: false, - category: "symbols" - }, - white_flower: { - keywords: ["japanese", "spring"], - "char": "\ud83d\udcae", - fitzpatrick_scale: false, - category: "symbols" - }, - ideograph_advantage: { - keywords: ["chinese", "kanji", "obtain", "get", "circle"], - "char": "\ud83c\ude50", - fitzpatrick_scale: false, - category: "symbols" - }, - secret: { - keywords: ["privacy", "chinese", "sshh", "kanji", "red-circle"], - "char": "\u3299\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - congratulations: { - keywords: ["chinese", "kanji", "japanese", "red-circle"], - "char": "\u3297\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - u5408: { - keywords: ["japanese", "chinese", "join", "kanji", "red-square"], - "char": "\ud83c\ude34", - fitzpatrick_scale: false, - category: "symbols" - }, - u6e80: { - keywords: ["full", "chinese", "japanese", "red-square", "kanji"], - "char": "\ud83c\ude35", - fitzpatrick_scale: false, - category: "symbols" - }, - u7981: { - keywords: ["kanji", "japanese", "chinese", "forbidden", "limit", "restricted", "red-square"], - "char": "\ud83c\ude32", - fitzpatrick_scale: false, - category: "symbols" - }, - a: { - keywords: ["red-square", "alphabet", "letter"], - "char": "\ud83c\udd70\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - b: { - keywords: ["red-square", "alphabet", "letter"], - "char": "\ud83c\udd71\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - ab: { - keywords: ["red-square", "alphabet"], - "char": "\ud83c\udd8e", - fitzpatrick_scale: false, - category: "symbols" - }, - cl: { - keywords: ["alphabet", "words", "red-square"], - "char": "\ud83c\udd91", - fitzpatrick_scale: false, - category: "symbols" - }, - o2: { - keywords: ["alphabet", "red-square", "letter"], - "char": "\ud83c\udd7e\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - sos: { - keywords: ["help", "red-square", "words", "emergency", "911"], - "char": "\ud83c\udd98", - fitzpatrick_scale: false, - category: "symbols" - }, - no_entry: { - keywords: ["limit", "security", "privacy", "bad", "denied", "stop", "circle"], - "char": "\u26d4", - fitzpatrick_scale: false, - category: "symbols" - }, - name_badge: { - keywords: ["fire", "forbid"], - "char": "\ud83d\udcdb", - fitzpatrick_scale: false, - category: "symbols" - }, - no_entry_sign: { - keywords: ["forbid", "stop", "limit", "denied", "disallow", "circle"], - "char": "\ud83d\udeab", - fitzpatrick_scale: false, - category: "symbols" - }, - x: { - keywords: ["no", "delete", "remove", "cancel", "red"], - "char": "\u274c", - fitzpatrick_scale: false, - category: "symbols" - }, - o: { - keywords: ["circle", "round"], - "char": "\u2b55", - fitzpatrick_scale: false, - category: "symbols" - }, - stop_sign: { - keywords: ["stop"], - "char": "\ud83d\uded1", - fitzpatrick_scale: false, - category: "symbols" - }, - anger: { - keywords: ["angry", "mad"], - "char": "\ud83d\udca2", - fitzpatrick_scale: false, - category: "symbols" - }, - hotsprings: { - keywords: ["bath", "warm", "relax"], - "char": "\u2668\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - no_pedestrians: { - keywords: ["rules", "crossing", "walking", "circle"], - "char": "\ud83d\udeb7", - fitzpatrick_scale: false, - category: "symbols" - }, - do_not_litter: { - keywords: ["trash", "bin", "garbage", "circle"], - "char": "\ud83d\udeaf", - fitzpatrick_scale: false, - category: "symbols" - }, - no_bicycles: { - keywords: ["cyclist", "prohibited", "circle"], - "char": "\ud83d\udeb3", - fitzpatrick_scale: false, - category: "symbols" - }, - "non-potable_water": { - keywords: ["drink", "faucet", "tap", "circle"], - "char": "\ud83d\udeb1", - fitzpatrick_scale: false, - category: "symbols" - }, - underage: { - keywords: ["18", "drink", "pub", "night", "minor", "circle"], - "char": "\ud83d\udd1e", - fitzpatrick_scale: false, - category: "symbols" - }, - no_mobile_phones: { - keywords: ["iphone", "mute", "circle"], - "char": "\ud83d\udcf5", - fitzpatrick_scale: false, - category: "symbols" - }, - exclamation: { - keywords: ["heavy_exclamation_mark", "danger", "surprise", "punctuation", "wow", "warning"], - "char": "\u2757", - fitzpatrick_scale: false, - category: "symbols" - }, - grey_exclamation: { - keywords: ["surprise", "punctuation", "gray", "wow", "warning"], - "char": "\u2755", - fitzpatrick_scale: false, - category: "symbols" - }, - question: { - keywords: ["doubt", "confused"], - "char": "\u2753", - fitzpatrick_scale: false, - category: "symbols" - }, - grey_question: { - keywords: ["doubts", "gray", "huh", "confused"], - "char": "\u2754", - fitzpatrick_scale: false, - category: "symbols" - }, - bangbang: { - keywords: ["exclamation", "surprise"], - "char": "\u203c\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - interrobang: { - keywords: ["wat", "punctuation", "surprise"], - "char": "\u2049\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - 100: { - keywords: ["score", "perfect", "numbers", "century", "exam", "quiz", "test", "pass", "hundred"], - "char": "\ud83d\udcaf", - fitzpatrick_scale: false, - category: "symbols" - }, - low_brightness: { - keywords: ["sun", "afternoon", "warm", "summer"], - "char": "\ud83d\udd05", - fitzpatrick_scale: false, - category: "symbols" - }, - high_brightness: { - keywords: ["sun", "light"], - "char": "\ud83d\udd06", - fitzpatrick_scale: false, - category: "symbols" - }, - trident: { - keywords: ["weapon", "spear"], - "char": "\ud83d\udd31", - fitzpatrick_scale: false, - category: "symbols" - }, - fleur_de_lis: { - keywords: ["decorative", "scout"], - "char": "\u269c", - fitzpatrick_scale: false, - category: "symbols" - }, - part_alternation_mark: { - keywords: ["graph", "presentation", "stats", "business", "economics", "bad"], - "char": "\u303d\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - warning: { - keywords: ["exclamation", "wip", "alert", "error", "problem", "issue"], - "char": "\u26a0\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - children_crossing: { - keywords: ["school", "warning", "danger", "sign", "driving", "yellow-diamond"], - "char": "\ud83d\udeb8", - fitzpatrick_scale: false, - category: "symbols" - }, - beginner: { - keywords: ["badge", "shield"], - "char": "\ud83d\udd30", - fitzpatrick_scale: false, - category: "symbols" - }, - recycle: { - keywords: ["arrow", "environment", "garbage", "trash"], - "char": "\u267b\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - u6307: { - keywords: ["chinese", "point", "green-square", "kanji"], - "char": "\ud83c\ude2f", - fitzpatrick_scale: false, - category: "symbols" - }, - chart: { - keywords: ["green-square", "graph", "presentation", "stats"], - "char": "\ud83d\udcb9", - fitzpatrick_scale: false, - category: "symbols" - }, - sparkle: { - keywords: ["stars", "green-square", "awesome", "good", "fireworks"], - "char": "\u2747\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - eight_spoked_asterisk: { - keywords: ["star", "sparkle", "green-square"], - "char": "\u2733\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - negative_squared_cross_mark: { - keywords: ["x", "green-square", "no", "deny"], - "char": "\u274e", - fitzpatrick_scale: false, - category: "symbols" - }, - white_check_mark: { - keywords: ["green-square", "ok", "agree", "vote", "election", "answer", "tick"], - "char": "\u2705", - fitzpatrick_scale: false, - category: "symbols" - }, - diamond_shape_with_a_dot_inside: { - keywords: ["jewel", "blue", "gem", "crystal", "fancy"], - "char": "\ud83d\udca0", - fitzpatrick_scale: false, - category: "symbols" - }, - cyclone: { - keywords: ["weather", "swirl", "blue", "cloud", "vortex", "spiral", "whirlpool", "spin", "tornado", "hurricane", "typhoon"], - "char": "\ud83c\udf00", - fitzpatrick_scale: false, - category: "symbols" - }, - loop: { - keywords: ["tape", "cassette"], - "char": "\u27bf", - fitzpatrick_scale: false, - category: "symbols" - }, - globe_with_meridians: { - keywords: ["earth", "international", "world", "internet", "interweb", "i18n"], - "char": "\ud83c\udf10", - fitzpatrick_scale: false, - category: "symbols" - }, - m: { - keywords: ["alphabet", "blue-circle", "letter"], - "char": "\u24c2\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - atm: { - keywords: ["money", "sales", "cash", "blue-square", "payment", "bank"], - "char": "\ud83c\udfe7", - fitzpatrick_scale: false, - category: "symbols" - }, - sa: { - keywords: ["japanese", "blue-square", "katakana"], - "char": "\ud83c\ude02\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - passport_control: { - keywords: ["custom", "blue-square"], - "char": "\ud83d\udec2", - fitzpatrick_scale: false, - category: "symbols" - }, - customs: { - keywords: ["passport", "border", "blue-square"], - "char": "\ud83d\udec3", - fitzpatrick_scale: false, - category: "symbols" - }, - baggage_claim: { - keywords: ["blue-square", "airport", "transport"], - "char": "\ud83d\udec4", - fitzpatrick_scale: false, - category: "symbols" - }, - left_luggage: { - keywords: ["blue-square", "travel"], - "char": "\ud83d\udec5", - fitzpatrick_scale: false, - category: "symbols" - }, - wheelchair: { - keywords: ["blue-square", "disabled", "a11y", "accessibility"], - "char": "\u267f", - fitzpatrick_scale: false, - category: "symbols" - }, - no_smoking: { - keywords: ["cigarette", "blue-square", "smell", "smoke"], - "char": "\ud83d\udead", - fitzpatrick_scale: false, - category: "symbols" - }, - wc: { - keywords: ["toilet", "restroom", "blue-square"], - "char": "\ud83d\udebe", - fitzpatrick_scale: false, - category: "symbols" - }, - parking: { - keywords: ["cars", "blue-square", "alphabet", "letter"], - "char": "\ud83c\udd7f\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - potable_water: { - keywords: ["blue-square", "liquid", "restroom", "cleaning", "faucet"], - "char": "\ud83d\udeb0", - fitzpatrick_scale: false, - category: "symbols" - }, - mens: { - keywords: ["toilet", "restroom", "wc", "blue-square", "gender", "male"], - "char": "\ud83d\udeb9", - fitzpatrick_scale: false, - category: "symbols" - }, - womens: { - keywords: ["purple-square", "woman", "female", "toilet", "loo", "restroom", "gender"], - "char": "\ud83d\udeba", - fitzpatrick_scale: false, - category: "symbols" - }, - baby_symbol: { - keywords: ["orange-square", "child"], - "char": "\ud83d\udebc", - fitzpatrick_scale: false, - category: "symbols" - }, - restroom: { - keywords: ["blue-square", "toilet", "refresh", "wc", "gender"], - "char": "\ud83d\udebb", - fitzpatrick_scale: false, - category: "symbols" - }, - put_litter_in_its_place: { - keywords: ["blue-square", "sign", "human", "info"], - "char": "\ud83d\udeae", - fitzpatrick_scale: false, - category: "symbols" - }, - cinema: { - keywords: ["blue-square", "record", "film", "movie", "curtain", "stage", "theater"], - "char": "\ud83c\udfa6", - fitzpatrick_scale: false, - category: "symbols" - }, - signal_strength: { - keywords: ["blue-square", "reception", "phone", "internet", "connection", "wifi", "bluetooth", "bars"], - "char": "\ud83d\udcf6", - fitzpatrick_scale: false, - category: "symbols" - }, - koko: { - keywords: ["blue-square", "here", "katakana", "japanese", "destination"], - "char": "\ud83c\ude01", - fitzpatrick_scale: false, - category: "symbols" - }, - ng: { - keywords: ["blue-square", "words", "shape", "icon"], - "char": "\ud83c\udd96", - fitzpatrick_scale: false, - category: "symbols" - }, - ok: { - keywords: ["good", "agree", "yes", "blue-square"], - "char": "\ud83c\udd97", - fitzpatrick_scale: false, - category: "symbols" - }, - up: { - keywords: ["blue-square", "above", "high"], - "char": "\ud83c\udd99", - fitzpatrick_scale: false, - category: "symbols" - }, - cool: { - keywords: ["words", "blue-square"], - "char": "\ud83c\udd92", - fitzpatrick_scale: false, - category: "symbols" - }, - "new": { - keywords: ["blue-square", "words", "start"], - "char": "\ud83c\udd95", - fitzpatrick_scale: false, - category: "symbols" - }, - free: { - keywords: ["blue-square", "words"], - "char": "\ud83c\udd93", - fitzpatrick_scale: false, - category: "symbols" - }, - zero: { - keywords: ["0", "numbers", "blue-square", "null"], - "char": "0\ufe0f\u20e3", - fitzpatrick_scale: false, - category: "symbols" - }, - one: { - keywords: ["blue-square", "numbers", "1"], - "char": "1\ufe0f\u20e3", - fitzpatrick_scale: false, - category: "symbols" - }, - two: { - keywords: ["numbers", "2", "prime", "blue-square"], - "char": "2\ufe0f\u20e3", - fitzpatrick_scale: false, - category: "symbols" - }, - three: { - keywords: ["3", "numbers", "prime", "blue-square"], - "char": "3\ufe0f\u20e3", - fitzpatrick_scale: false, - category: "symbols" - }, - four: { - keywords: ["4", "numbers", "blue-square"], - "char": "4\ufe0f\u20e3", - fitzpatrick_scale: false, - category: "symbols" - }, - five: { - keywords: ["5", "numbers", "blue-square", "prime"], - "char": "5\ufe0f\u20e3", - fitzpatrick_scale: false, - category: "symbols" - }, - six: { - keywords: ["6", "numbers", "blue-square"], - "char": "6\ufe0f\u20e3", - fitzpatrick_scale: false, - category: "symbols" - }, - seven: { - keywords: ["7", "numbers", "blue-square", "prime"], - "char": "7\ufe0f\u20e3", - fitzpatrick_scale: false, - category: "symbols" - }, - eight: { - keywords: ["8", "blue-square", "numbers"], - "char": "8\ufe0f\u20e3", - fitzpatrick_scale: false, - category: "symbols" - }, - nine: { - keywords: ["blue-square", "numbers", "9"], - "char": "9\ufe0f\u20e3", - fitzpatrick_scale: false, - category: "symbols" - }, - keycap_ten: { - keywords: ["numbers", "10", "blue-square"], - "char": "\ud83d\udd1f", - fitzpatrick_scale: false, - category: "symbols" - }, - asterisk: { - keywords: ["star", "keycap"], - "char": "*\u20e3", - fitzpatrick_scale: false, - category: "symbols" - }, - 1234: { - keywords: ["numbers", "blue-square"], - "char": "\ud83d\udd22", - fitzpatrick_scale: false, - category: "symbols" - }, - eject_button: { - keywords: ["blue-square"], - "char": "\u23cf\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_forward: { - keywords: ["blue-square", "right", "direction", "play"], - "char": "\u25b6\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - pause_button: { - keywords: ["pause", "blue-square"], - "char": "\u23f8", - fitzpatrick_scale: false, - category: "symbols" - }, - next_track_button: { - keywords: ["forward", "next", "blue-square"], - "char": "\u23ed", - fitzpatrick_scale: false, - category: "symbols" - }, - stop_button: { - keywords: ["blue-square"], - "char": "\u23f9", - fitzpatrick_scale: false, - category: "symbols" - }, - record_button: { - keywords: ["blue-square"], - "char": "\u23fa", - fitzpatrick_scale: false, - category: "symbols" - }, - play_or_pause_button: { - keywords: ["blue-square", "play", "pause"], - "char": "\u23ef", - fitzpatrick_scale: false, - category: "symbols" - }, - previous_track_button: { - keywords: ["backward"], - "char": "\u23ee", - fitzpatrick_scale: false, - category: "symbols" - }, - fast_forward: { - keywords: ["blue-square", "play", "speed", "continue"], - "char": "\u23e9", - fitzpatrick_scale: false, - category: "symbols" - }, - rewind: { - keywords: ["play", "blue-square"], - "char": "\u23ea", - fitzpatrick_scale: false, - category: "symbols" - }, - twisted_rightwards_arrows: { - keywords: ["blue-square", "shuffle", "music", "random"], - "char": "\ud83d\udd00", - fitzpatrick_scale: false, - category: "symbols" - }, - repeat: { - keywords: ["loop", "record"], - "char": "\ud83d\udd01", - fitzpatrick_scale: false, - category: "symbols" - }, - repeat_one: { - keywords: ["blue-square", "loop"], - "char": "\ud83d\udd02", - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_backward: { - keywords: ["blue-square", "left", "direction"], - "char": "\u25c0\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_up_small: { - keywords: ["blue-square", "triangle", "direction", "point", "forward", "top"], - "char": "\ud83d\udd3c", - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_down_small: { - keywords: ["blue-square", "direction", "bottom"], - "char": "\ud83d\udd3d", - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_double_up: { - keywords: ["blue-square", "direction", "top"], - "char": "\u23eb", - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_double_down: { - keywords: ["blue-square", "direction", "bottom"], - "char": "\u23ec", - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_right: { - keywords: ["blue-square", "next"], - "char": "\u27a1\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_left: { - keywords: ["blue-square", "previous", "back"], - "char": "\u2b05\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_up: { - keywords: ["blue-square", "continue", "top", "direction"], - "char": "\u2b06\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_down: { - keywords: ["blue-square", "direction", "bottom"], - "char": "\u2b07\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_upper_right: { - keywords: ["blue-square", "point", "direction", "diagonal", "northeast"], - "char": "\u2197\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_lower_right: { - keywords: ["blue-square", "direction", "diagonal", "southeast"], - "char": "\u2198\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_lower_left: { - keywords: ["blue-square", "direction", "diagonal", "southwest"], - "char": "\u2199\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_upper_left: { - keywords: ["blue-square", "point", "direction", "diagonal", "northwest"], - "char": "\u2196\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_up_down: { - keywords: ["blue-square", "direction", "way", "vertical"], - "char": "\u2195\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - left_right_arrow: { - keywords: ["shape", "direction", "horizontal", "sideways"], - "char": "\u2194\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - arrows_counterclockwise: { - keywords: ["blue-square", "sync", "cycle"], - "char": "\ud83d\udd04", - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_right_hook: { - keywords: ["blue-square", "return", "rotate", "direction"], - "char": "\u21aa\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - leftwards_arrow_with_hook: { - keywords: ["back", "return", "blue-square", "undo", "enter"], - "char": "\u21a9\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_heading_up: { - keywords: ["blue-square", "direction", "top"], - "char": "\u2934\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - arrow_heading_down: { - keywords: ["blue-square", "direction", "bottom"], - "char": "\u2935\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - hash: { - keywords: ["symbol", "blue-square", "twitter"], - "char": "#\ufe0f\u20e3", - fitzpatrick_scale: false, - category: "symbols" - }, - information_source: { - keywords: ["blue-square", "alphabet", "letter"], - "char": "\u2139\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - abc: { - keywords: ["blue-square", "alphabet"], - "char": "\ud83d\udd24", - fitzpatrick_scale: false, - category: "symbols" - }, - abcd: { - keywords: ["blue-square", "alphabet"], - "char": "\ud83d\udd21", - fitzpatrick_scale: false, - category: "symbols" - }, - capital_abcd: { - keywords: ["alphabet", "words", "blue-square"], - "char": "\ud83d\udd20", - fitzpatrick_scale: false, - category: "symbols" - }, - symbols: { - keywords: ["blue-square", "music", "note", "ampersand", "percent", "glyphs", "characters"], - "char": "\ud83d\udd23", - fitzpatrick_scale: false, - category: "symbols" - }, - musical_note: { - keywords: ["score", "tone", "sound"], - "char": "\ud83c\udfb5", - fitzpatrick_scale: false, - category: "symbols" - }, - notes: { - keywords: ["music", "score"], - "char": "\ud83c\udfb6", - fitzpatrick_scale: false, - category: "symbols" - }, - wavy_dash: { - keywords: ["draw", "line", "moustache", "mustache", "squiggle", "scribble"], - "char": "\u3030\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - curly_loop: { - keywords: ["scribble", "draw", "shape", "squiggle"], - "char": "\u27b0", - fitzpatrick_scale: false, - category: "symbols" - }, - heavy_check_mark: { - keywords: ["ok", "nike", "answer", "yes", "tick"], - "char": "\u2714\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - arrows_clockwise: { - keywords: ["sync", "cycle", "round", "repeat"], - "char": "\ud83d\udd03", - fitzpatrick_scale: false, - category: "symbols" - }, - heavy_plus_sign: { - keywords: ["math", "calculation", "addition", "more", "increase"], - "char": "\u2795", - fitzpatrick_scale: false, - category: "symbols" - }, - heavy_minus_sign: { - keywords: ["math", "calculation", "subtract", "less"], - "char": "\u2796", - fitzpatrick_scale: false, - category: "symbols" - }, - heavy_division_sign: { - keywords: ["divide", "math", "calculation"], - "char": "\u2797", - fitzpatrick_scale: false, - category: "symbols" - }, - heavy_multiplication_x: { - keywords: ["math", "calculation"], - "char": "\u2716\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - infinity: { - keywords: ["forever"], - "char": "\u267e", - fitzpatrick_scale: false, - category: "symbols" - }, - heavy_dollar_sign: { - keywords: ["money", "sales", "payment", "currency", "buck"], - "char": "\ud83d\udcb2", - fitzpatrick_scale: false, - category: "symbols" - }, - currency_exchange: { - keywords: ["money", "sales", "dollar", "travel"], - "char": "\ud83d\udcb1", - fitzpatrick_scale: false, - category: "symbols" - }, - copyright: { - keywords: ["ip", "license", "circle", "law", "legal"], - "char": "\xa9\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - registered: { - keywords: ["alphabet", "circle"], - "char": "\xae\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - tm: { - keywords: ["trademark", "brand", "law", "legal"], - "char": "\u2122\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - end: { - keywords: ["words", "arrow"], - "char": "\ud83d\udd1a", - fitzpatrick_scale: false, - category: "symbols" - }, - back: { - keywords: ["arrow", "words", "return"], - "char": "\ud83d\udd19", - fitzpatrick_scale: false, - category: "symbols" - }, - on: { - keywords: ["arrow", "words"], - "char": "\ud83d\udd1b", - fitzpatrick_scale: false, - category: "symbols" - }, - top: { - keywords: ["words", "blue-square"], - "char": "\ud83d\udd1d", - fitzpatrick_scale: false, - category: "symbols" - }, - soon: { - keywords: ["arrow", "words"], - "char": "\ud83d\udd1c", - fitzpatrick_scale: false, - category: "symbols" - }, - ballot_box_with_check: { - keywords: ["ok", "agree", "confirm", "black-square", "vote", "election", "yes", "tick"], - "char": "\u2611\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - radio_button: { - keywords: ["input", "old", "music", "circle"], - "char": "\ud83d\udd18", - fitzpatrick_scale: false, - category: "symbols" - }, - white_circle: { - keywords: ["shape", "round"], - "char": "\u26aa", - fitzpatrick_scale: false, - category: "symbols" - }, - black_circle: { - keywords: ["shape", "button", "round"], - "char": "\u26ab", - fitzpatrick_scale: false, - category: "symbols" - }, - red_circle: { - keywords: ["shape", "error", "danger"], - "char": "\ud83d\udd34", - fitzpatrick_scale: false, - category: "symbols" - }, - large_blue_circle: { - keywords: ["shape", "icon", "button"], - "char": "\ud83d\udd35", - fitzpatrick_scale: false, - category: "symbols" - }, - small_orange_diamond: { - keywords: ["shape", "jewel", "gem"], - "char": "\ud83d\udd38", - fitzpatrick_scale: false, - category: "symbols" - }, - small_blue_diamond: { - keywords: ["shape", "jewel", "gem"], - "char": "\ud83d\udd39", - fitzpatrick_scale: false, - category: "symbols" - }, - large_orange_diamond: { - keywords: ["shape", "jewel", "gem"], - "char": "\ud83d\udd36", - fitzpatrick_scale: false, - category: "symbols" - }, - large_blue_diamond: { - keywords: ["shape", "jewel", "gem"], - "char": "\ud83d\udd37", - fitzpatrick_scale: false, - category: "symbols" - }, - small_red_triangle: { - keywords: ["shape", "direction", "up", "top"], - "char": "\ud83d\udd3a", - fitzpatrick_scale: false, - category: "symbols" - }, - black_small_square: { - keywords: ["shape", "icon"], - "char": "\u25aa\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - white_small_square: { - keywords: ["shape", "icon"], - "char": "\u25ab\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - black_large_square: { - keywords: ["shape", "icon", "button"], - "char": "\u2b1b", - fitzpatrick_scale: false, - category: "symbols" - }, - white_large_square: { - keywords: ["shape", "icon", "stone", "button"], - "char": "\u2b1c", - fitzpatrick_scale: false, - category: "symbols" - }, - small_red_triangle_down: { - keywords: ["shape", "direction", "bottom"], - "char": "\ud83d\udd3b", - fitzpatrick_scale: false, - category: "symbols" - }, - black_medium_square: { - keywords: ["shape", "button", "icon"], - "char": "\u25fc\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - white_medium_square: { - keywords: ["shape", "stone", "icon"], - "char": "\u25fb\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - black_medium_small_square: { - keywords: ["icon", "shape", "button"], - "char": "\u25fe", - fitzpatrick_scale: false, - category: "symbols" - }, - white_medium_small_square: { - keywords: ["shape", "stone", "icon", "button"], - "char": "\u25fd", - fitzpatrick_scale: false, - category: "symbols" - }, - black_square_button: { - keywords: ["shape", "input", "frame"], - "char": "\ud83d\udd32", - fitzpatrick_scale: false, - category: "symbols" - }, - white_square_button: { - keywords: ["shape", "input"], - "char": "\ud83d\udd33", - fitzpatrick_scale: false, - category: "symbols" - }, - speaker: { - keywords: ["sound", "volume", "silence", "broadcast"], - "char": "\ud83d\udd08", - fitzpatrick_scale: false, - category: "symbols" - }, - sound: { - keywords: ["volume", "speaker", "broadcast"], - "char": "\ud83d\udd09", - fitzpatrick_scale: false, - category: "symbols" - }, - loud_sound: { - keywords: ["volume", "noise", "noisy", "speaker", "broadcast"], - "char": "\ud83d\udd0a", - fitzpatrick_scale: false, - category: "symbols" - }, - mute: { - keywords: ["sound", "volume", "silence", "quiet"], - "char": "\ud83d\udd07", - fitzpatrick_scale: false, - category: "symbols" - }, - mega: { - keywords: ["sound", "speaker", "volume"], - "char": "\ud83d\udce3", - fitzpatrick_scale: false, - category: "symbols" - }, - loudspeaker: { - keywords: ["volume", "sound"], - "char": "\ud83d\udce2", - fitzpatrick_scale: false, - category: "symbols" - }, - bell: { - keywords: ["sound", "notification", "christmas", "xmas", "chime"], - "char": "\ud83d\udd14", - fitzpatrick_scale: false, - category: "symbols" - }, - no_bell: { - keywords: ["sound", "volume", "mute", "quiet", "silent"], - "char": "\ud83d\udd15", - fitzpatrick_scale: false, - category: "symbols" - }, - black_joker: { - keywords: ["poker", "cards", "game", "play", "magic"], - "char": "\ud83c\udccf", - fitzpatrick_scale: false, - category: "symbols" - }, - mahjong: { - keywords: ["game", "play", "chinese", "kanji"], - "char": "\ud83c\udc04", - fitzpatrick_scale: false, - category: "symbols" - }, - spades: { - keywords: ["poker", "cards", "suits", "magic"], - "char": "\u2660\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - clubs: { - keywords: ["poker", "cards", "magic", "suits"], - "char": "\u2663\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - hearts: { - keywords: ["poker", "cards", "magic", "suits"], - "char": "\u2665\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - diamonds: { - keywords: ["poker", "cards", "magic", "suits"], - "char": "\u2666\ufe0f", - fitzpatrick_scale: false, - category: "symbols" - }, - flower_playing_cards: { - keywords: ["game", "sunset", "red"], - "char": "\ud83c\udfb4", - fitzpatrick_scale: false, - category: "symbols" - }, - thought_balloon: { - keywords: ["bubble", "cloud", "speech", "thinking", "dream"], - "char": "\ud83d\udcad", - fitzpatrick_scale: false, - category: "symbols" - }, - right_anger_bubble: { - keywords: ["caption", "speech", "thinking", "mad"], - "char": "\ud83d\uddef", - fitzpatrick_scale: false, - category: "symbols" - }, - speech_balloon: { - keywords: ["bubble", "words", "message", "talk", "chatting"], - "char": "\ud83d\udcac", - fitzpatrick_scale: false, - category: "symbols" - }, - left_speech_bubble: { - keywords: ["words", "message", "talk", "chatting"], - "char": "\ud83d\udde8", - fitzpatrick_scale: false, - category: "symbols" - }, - clock1: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd50", - fitzpatrick_scale: false, - category: "symbols" - }, - clock2: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd51", - fitzpatrick_scale: false, - category: "symbols" - }, - clock3: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd52", - fitzpatrick_scale: false, - category: "symbols" - }, - clock4: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd53", - fitzpatrick_scale: false, - category: "symbols" - }, - clock5: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd54", - fitzpatrick_scale: false, - category: "symbols" - }, - clock6: { - keywords: ["time", "late", "early", "schedule", "dawn", "dusk"], - "char": "\ud83d\udd55", - fitzpatrick_scale: false, - category: "symbols" - }, - clock7: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd56", - fitzpatrick_scale: false, - category: "symbols" - }, - clock8: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd57", - fitzpatrick_scale: false, - category: "symbols" - }, - clock9: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd58", - fitzpatrick_scale: false, - category: "symbols" - }, - clock10: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd59", - fitzpatrick_scale: false, - category: "symbols" - }, - clock11: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd5a", - fitzpatrick_scale: false, - category: "symbols" - }, - clock12: { - keywords: ["time", "noon", "midnight", "midday", "late", "early", "schedule"], - "char": "\ud83d\udd5b", - fitzpatrick_scale: false, - category: "symbols" - }, - clock130: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd5c", - fitzpatrick_scale: false, - category: "symbols" - }, - clock230: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd5d", - fitzpatrick_scale: false, - category: "symbols" - }, - clock330: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd5e", - fitzpatrick_scale: false, - category: "symbols" - }, - clock430: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd5f", - fitzpatrick_scale: false, - category: "symbols" - }, - clock530: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd60", - fitzpatrick_scale: false, - category: "symbols" - }, - clock630: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd61", - fitzpatrick_scale: false, - category: "symbols" - }, - clock730: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd62", - fitzpatrick_scale: false, - category: "symbols" - }, - clock830: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd63", - fitzpatrick_scale: false, - category: "symbols" - }, - clock930: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd64", - fitzpatrick_scale: false, - category: "symbols" - }, - clock1030: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd65", - fitzpatrick_scale: false, - category: "symbols" - }, - clock1130: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd66", - fitzpatrick_scale: false, - category: "symbols" - }, - clock1230: { - keywords: ["time", "late", "early", "schedule"], - "char": "\ud83d\udd67", - fitzpatrick_scale: false, - category: "symbols" - }, - afghanistan: { - keywords: ["af", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde6\ud83c\uddeb", - fitzpatrick_scale: false, - category: "flags" - }, - aland_islands: { - keywords: ["\xc5land", "islands", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde6\ud83c\uddfd", - fitzpatrick_scale: false, - category: "flags" - }, - albania: { - keywords: ["al", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde6\ud83c\uddf1", - fitzpatrick_scale: false, - category: "flags" - }, - algeria: { - keywords: ["dz", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde9\ud83c\uddff", - fitzpatrick_scale: false, - category: "flags" - }, - american_samoa: { - keywords: ["american", "ws", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde6\ud83c\uddf8", - fitzpatrick_scale: false, - category: "flags" - }, - andorra: { - keywords: ["ad", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde6\ud83c\udde9", - fitzpatrick_scale: false, - category: "flags" - }, - angola: { - keywords: ["ao", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde6\ud83c\uddf4", - fitzpatrick_scale: false, - category: "flags" - }, - anguilla: { - keywords: ["ai", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde6\ud83c\uddee", - fitzpatrick_scale: false, - category: "flags" - }, - antarctica: { - keywords: ["aq", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde6\ud83c\uddf6", - fitzpatrick_scale: false, - category: "flags" - }, - antigua_barbuda: { - keywords: ["antigua", "barbuda", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde6\ud83c\uddec", - fitzpatrick_scale: false, - category: "flags" - }, - argentina: { - keywords: ["ar", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde6\ud83c\uddf7", - fitzpatrick_scale: false, - category: "flags" - }, - armenia: { - keywords: ["am", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde6\ud83c\uddf2", - fitzpatrick_scale: false, - category: "flags" - }, - aruba: { - keywords: ["aw", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde6\ud83c\uddfc", - fitzpatrick_scale: false, - category: "flags" - }, - australia: { - keywords: ["au", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde6\ud83c\uddfa", - fitzpatrick_scale: false, - category: "flags" - }, - austria: { - keywords: ["at", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde6\ud83c\uddf9", - fitzpatrick_scale: false, - category: "flags" - }, - azerbaijan: { - keywords: ["az", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde6\ud83c\uddff", - fitzpatrick_scale: false, - category: "flags" - }, - bahamas: { - keywords: ["bs", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\uddf8", - fitzpatrick_scale: false, - category: "flags" - }, - bahrain: { - keywords: ["bh", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\udded", - fitzpatrick_scale: false, - category: "flags" - }, - bangladesh: { - keywords: ["bd", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\udde9", - fitzpatrick_scale: false, - category: "flags" - }, - barbados: { - keywords: ["bb", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\udde7", - fitzpatrick_scale: false, - category: "flags" - }, - belarus: { - keywords: ["by", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\uddfe", - fitzpatrick_scale: false, - category: "flags" - }, - belgium: { - keywords: ["be", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\uddea", - fitzpatrick_scale: false, - category: "flags" - }, - belize: { - keywords: ["bz", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\uddff", - fitzpatrick_scale: false, - category: "flags" - }, - benin: { - keywords: ["bj", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\uddef", - fitzpatrick_scale: false, - category: "flags" - }, - bermuda: { - keywords: ["bm", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\uddf2", - fitzpatrick_scale: false, - category: "flags" - }, - bhutan: { - keywords: ["bt", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\uddf9", - fitzpatrick_scale: false, - category: "flags" - }, - bolivia: { - keywords: ["bo", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\uddf4", - fitzpatrick_scale: false, - category: "flags" - }, - caribbean_netherlands: { - keywords: ["bonaire", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\uddf6", - fitzpatrick_scale: false, - category: "flags" - }, - bosnia_herzegovina: { - keywords: ["bosnia", "herzegovina", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\udde6", - fitzpatrick_scale: false, - category: "flags" - }, - botswana: { - keywords: ["bw", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\uddfc", - fitzpatrick_scale: false, - category: "flags" - }, - brazil: { - keywords: ["br", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\uddf7", - fitzpatrick_scale: false, - category: "flags" - }, - british_indian_ocean_territory: { - keywords: ["british", "indian", "ocean", "territory", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddee\ud83c\uddf4", - fitzpatrick_scale: false, - category: "flags" - }, - british_virgin_islands: { - keywords: ["british", "virgin", "islands", "bvi", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddfb\ud83c\uddec", - fitzpatrick_scale: false, - category: "flags" - }, - brunei: { - keywords: ["bn", "darussalam", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\uddf3", - fitzpatrick_scale: false, - category: "flags" - }, - bulgaria: { - keywords: ["bg", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\uddec", - fitzpatrick_scale: false, - category: "flags" - }, - burkina_faso: { - keywords: ["burkina", "faso", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\uddeb", - fitzpatrick_scale: false, - category: "flags" - }, - burundi: { - keywords: ["bi", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\uddee", - fitzpatrick_scale: false, - category: "flags" - }, - cape_verde: { - keywords: ["cabo", "verde", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde8\ud83c\uddfb", - fitzpatrick_scale: false, - category: "flags" - }, - cambodia: { - keywords: ["kh", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf0\ud83c\udded", - fitzpatrick_scale: false, - category: "flags" - }, - cameroon: { - keywords: ["cm", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde8\ud83c\uddf2", - fitzpatrick_scale: false, - category: "flags" - }, - canada: { - keywords: ["ca", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde8\ud83c\udde6", - fitzpatrick_scale: false, - category: "flags" - }, - canary_islands: { - keywords: ["canary", "islands", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddee\ud83c\udde8", - fitzpatrick_scale: false, - category: "flags" - }, - cayman_islands: { - keywords: ["cayman", "islands", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf0\ud83c\uddfe", - fitzpatrick_scale: false, - category: "flags" - }, - central_african_republic: { - keywords: ["central", "african", "republic", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde8\ud83c\uddeb", - fitzpatrick_scale: false, - category: "flags" - }, - chad: { - keywords: ["td", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf9\ud83c\udde9", - fitzpatrick_scale: false, - category: "flags" - }, - chile: { - keywords: ["flag", "nation", "country", "banner"], - "char": "\ud83c\udde8\ud83c\uddf1", - fitzpatrick_scale: false, - category: "flags" - }, - cn: { - keywords: ["china", "chinese", "prc", "flag", "country", "nation", "banner"], - "char": "\ud83c\udde8\ud83c\uddf3", - fitzpatrick_scale: false, - category: "flags" - }, - christmas_island: { - keywords: ["christmas", "island", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde8\ud83c\uddfd", - fitzpatrick_scale: false, - category: "flags" - }, - cocos_islands: { - keywords: ["cocos", "keeling", "islands", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde8\ud83c\udde8", - fitzpatrick_scale: false, - category: "flags" - }, - colombia: { - keywords: ["co", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde8\ud83c\uddf4", - fitzpatrick_scale: false, - category: "flags" - }, - comoros: { - keywords: ["km", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf0\ud83c\uddf2", - fitzpatrick_scale: false, - category: "flags" - }, - congo_brazzaville: { - keywords: ["congo", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde8\ud83c\uddec", - fitzpatrick_scale: false, - category: "flags" - }, - congo_kinshasa: { - keywords: ["congo", "democratic", "republic", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde8\ud83c\udde9", - fitzpatrick_scale: false, - category: "flags" - }, - cook_islands: { - keywords: ["cook", "islands", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde8\ud83c\uddf0", - fitzpatrick_scale: false, - category: "flags" - }, - costa_rica: { - keywords: ["costa", "rica", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde8\ud83c\uddf7", - fitzpatrick_scale: false, - category: "flags" - }, - croatia: { - keywords: ["hr", "flag", "nation", "country", "banner"], - "char": "\ud83c\udded\ud83c\uddf7", - fitzpatrick_scale: false, - category: "flags" - }, - cuba: { - keywords: ["cu", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde8\ud83c\uddfa", - fitzpatrick_scale: false, - category: "flags" - }, - curacao: { - keywords: ["cura\xe7ao", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde8\ud83c\uddfc", - fitzpatrick_scale: false, - category: "flags" - }, - cyprus: { - keywords: ["cy", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde8\ud83c\uddfe", - fitzpatrick_scale: false, - category: "flags" - }, - czech_republic: { - keywords: ["cz", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde8\ud83c\uddff", - fitzpatrick_scale: false, - category: "flags" - }, - denmark: { - keywords: ["dk", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde9\ud83c\uddf0", - fitzpatrick_scale: false, - category: "flags" - }, - djibouti: { - keywords: ["dj", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde9\ud83c\uddef", - fitzpatrick_scale: false, - category: "flags" - }, - dominica: { - keywords: ["dm", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde9\ud83c\uddf2", - fitzpatrick_scale: false, - category: "flags" - }, - dominican_republic: { - keywords: ["dominican", "republic", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde9\ud83c\uddf4", - fitzpatrick_scale: false, - category: "flags" - }, - ecuador: { - keywords: ["ec", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddea\ud83c\udde8", - fitzpatrick_scale: false, - category: "flags" - }, - egypt: { - keywords: ["eg", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddea\ud83c\uddec", - fitzpatrick_scale: false, - category: "flags" - }, - el_salvador: { - keywords: ["el", "salvador", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\uddfb", - fitzpatrick_scale: false, - category: "flags" - }, - equatorial_guinea: { - keywords: ["equatorial", "gn", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddec\ud83c\uddf6", - fitzpatrick_scale: false, - category: "flags" - }, - eritrea: { - keywords: ["er", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddea\ud83c\uddf7", - fitzpatrick_scale: false, - category: "flags" - }, - estonia: { - keywords: ["ee", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddea\ud83c\uddea", - fitzpatrick_scale: false, - category: "flags" - }, - ethiopia: { - keywords: ["et", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddea\ud83c\uddf9", - fitzpatrick_scale: false, - category: "flags" - }, - eu: { - keywords: ["european", "union", "flag", "banner"], - "char": "\ud83c\uddea\ud83c\uddfa", - fitzpatrick_scale: false, - category: "flags" - }, - falkland_islands: { - keywords: ["falkland", "islands", "malvinas", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddeb\ud83c\uddf0", - fitzpatrick_scale: false, - category: "flags" - }, - faroe_islands: { - keywords: ["faroe", "islands", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddeb\ud83c\uddf4", - fitzpatrick_scale: false, - category: "flags" - }, - fiji: { - keywords: ["fj", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddeb\ud83c\uddef", - fitzpatrick_scale: false, - category: "flags" - }, - finland: { - keywords: ["fi", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddeb\ud83c\uddee", - fitzpatrick_scale: false, - category: "flags" - }, - fr: { - keywords: ["banner", "flag", "nation", "france", "french", "country"], - "char": "\ud83c\uddeb\ud83c\uddf7", - fitzpatrick_scale: false, - category: "flags" - }, - french_guiana: { - keywords: ["french", "guiana", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddec\ud83c\uddeb", - fitzpatrick_scale: false, - category: "flags" - }, - french_polynesia: { - keywords: ["french", "polynesia", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf5\ud83c\uddeb", - fitzpatrick_scale: false, - category: "flags" - }, - french_southern_territories: { - keywords: ["french", "southern", "territories", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf9\ud83c\uddeb", - fitzpatrick_scale: false, - category: "flags" - }, - gabon: { - keywords: ["ga", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddec\ud83c\udde6", - fitzpatrick_scale: false, - category: "flags" - }, - gambia: { - keywords: ["gm", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddec\ud83c\uddf2", - fitzpatrick_scale: false, - category: "flags" - }, - georgia: { - keywords: ["ge", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddec\ud83c\uddea", - fitzpatrick_scale: false, - category: "flags" - }, - de: { - keywords: ["german", "nation", "flag", "country", "banner"], - "char": "\ud83c\udde9\ud83c\uddea", - fitzpatrick_scale: false, - category: "flags" - }, - ghana: { - keywords: ["gh", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddec\ud83c\udded", - fitzpatrick_scale: false, - category: "flags" - }, - gibraltar: { - keywords: ["gi", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddec\ud83c\uddee", - fitzpatrick_scale: false, - category: "flags" - }, - greece: { - keywords: ["gr", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddec\ud83c\uddf7", - fitzpatrick_scale: false, - category: "flags" - }, - greenland: { - keywords: ["gl", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddec\ud83c\uddf1", - fitzpatrick_scale: false, - category: "flags" - }, - grenada: { - keywords: ["gd", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddec\ud83c\udde9", - fitzpatrick_scale: false, - category: "flags" - }, - guadeloupe: { - keywords: ["gp", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddec\ud83c\uddf5", - fitzpatrick_scale: false, - category: "flags" - }, - guam: { - keywords: ["gu", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddec\ud83c\uddfa", - fitzpatrick_scale: false, - category: "flags" - }, - guatemala: { - keywords: ["gt", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddec\ud83c\uddf9", - fitzpatrick_scale: false, - category: "flags" - }, - guernsey: { - keywords: ["gg", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddec\ud83c\uddec", - fitzpatrick_scale: false, - category: "flags" - }, - guinea: { - keywords: ["gn", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddec\ud83c\uddf3", - fitzpatrick_scale: false, - category: "flags" - }, - guinea_bissau: { - keywords: ["gw", "bissau", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddec\ud83c\uddfc", - fitzpatrick_scale: false, - category: "flags" - }, - guyana: { - keywords: ["gy", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddec\ud83c\uddfe", - fitzpatrick_scale: false, - category: "flags" - }, - haiti: { - keywords: ["ht", "flag", "nation", "country", "banner"], - "char": "\ud83c\udded\ud83c\uddf9", - fitzpatrick_scale: false, - category: "flags" - }, - honduras: { - keywords: ["hn", "flag", "nation", "country", "banner"], - "char": "\ud83c\udded\ud83c\uddf3", - fitzpatrick_scale: false, - category: "flags" - }, - hong_kong: { - keywords: ["hong", "kong", "flag", "nation", "country", "banner"], - "char": "\ud83c\udded\ud83c\uddf0", - fitzpatrick_scale: false, - category: "flags" - }, - hungary: { - keywords: ["hu", "flag", "nation", "country", "banner"], - "char": "\ud83c\udded\ud83c\uddfa", - fitzpatrick_scale: false, - category: "flags" - }, - iceland: { - keywords: ["is", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddee\ud83c\uddf8", - fitzpatrick_scale: false, - category: "flags" - }, - india: { - keywords: ["in", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddee\ud83c\uddf3", - fitzpatrick_scale: false, - category: "flags" - }, - indonesia: { - keywords: ["flag", "nation", "country", "banner"], - "char": "\ud83c\uddee\ud83c\udde9", - fitzpatrick_scale: false, - category: "flags" - }, - iran: { - keywords: ["iran,", "islamic", "republic", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddee\ud83c\uddf7", - fitzpatrick_scale: false, - category: "flags" - }, - iraq: { - keywords: ["iq", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddee\ud83c\uddf6", - fitzpatrick_scale: false, - category: "flags" - }, - ireland: { - keywords: ["ie", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddee\ud83c\uddea", - fitzpatrick_scale: false, - category: "flags" - }, - isle_of_man: { - keywords: ["isle", "man", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddee\ud83c\uddf2", - fitzpatrick_scale: false, - category: "flags" - }, - israel: { - keywords: ["il", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddee\ud83c\uddf1", - fitzpatrick_scale: false, - category: "flags" - }, - it: { - keywords: ["italy", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddee\ud83c\uddf9", - fitzpatrick_scale: false, - category: "flags" - }, - cote_divoire: { - keywords: ["ivory", "coast", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde8\ud83c\uddee", - fitzpatrick_scale: false, - category: "flags" - }, - jamaica: { - keywords: ["jm", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddef\ud83c\uddf2", - fitzpatrick_scale: false, - category: "flags" - }, - jp: { - keywords: ["japanese", "nation", "flag", "country", "banner"], - "char": "\ud83c\uddef\ud83c\uddf5", - fitzpatrick_scale: false, - category: "flags" - }, - jersey: { - keywords: ["je", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddef\ud83c\uddea", - fitzpatrick_scale: false, - category: "flags" - }, - jordan: { - keywords: ["jo", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddef\ud83c\uddf4", - fitzpatrick_scale: false, - category: "flags" - }, - kazakhstan: { - keywords: ["kz", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf0\ud83c\uddff", - fitzpatrick_scale: false, - category: "flags" - }, - kenya: { - keywords: ["ke", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf0\ud83c\uddea", - fitzpatrick_scale: false, - category: "flags" - }, - kiribati: { - keywords: ["ki", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf0\ud83c\uddee", - fitzpatrick_scale: false, - category: "flags" - }, - kosovo: { - keywords: ["xk", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddfd\ud83c\uddf0", - fitzpatrick_scale: false, - category: "flags" - }, - kuwait: { - keywords: ["kw", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf0\ud83c\uddfc", - fitzpatrick_scale: false, - category: "flags" - }, - kyrgyzstan: { - keywords: ["kg", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf0\ud83c\uddec", - fitzpatrick_scale: false, - category: "flags" - }, - laos: { - keywords: ["lao", "democratic", "republic", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf1\ud83c\udde6", - fitzpatrick_scale: false, - category: "flags" - }, - latvia: { - keywords: ["lv", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf1\ud83c\uddfb", - fitzpatrick_scale: false, - category: "flags" - }, - lebanon: { - keywords: ["lb", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf1\ud83c\udde7", - fitzpatrick_scale: false, - category: "flags" - }, - lesotho: { - keywords: ["ls", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf1\ud83c\uddf8", - fitzpatrick_scale: false, - category: "flags" - }, - liberia: { - keywords: ["lr", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf1\ud83c\uddf7", - fitzpatrick_scale: false, - category: "flags" - }, - libya: { - keywords: ["ly", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf1\ud83c\uddfe", - fitzpatrick_scale: false, - category: "flags" - }, - liechtenstein: { - keywords: ["li", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf1\ud83c\uddee", - fitzpatrick_scale: false, - category: "flags" - }, - lithuania: { - keywords: ["lt", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf1\ud83c\uddf9", - fitzpatrick_scale: false, - category: "flags" - }, - luxembourg: { - keywords: ["lu", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf1\ud83c\uddfa", - fitzpatrick_scale: false, - category: "flags" - }, - macau: { - keywords: ["macao", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\uddf4", - fitzpatrick_scale: false, - category: "flags" - }, - macedonia: { - keywords: ["macedonia,", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\uddf0", - fitzpatrick_scale: false, - category: "flags" - }, - madagascar: { - keywords: ["mg", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\uddec", - fitzpatrick_scale: false, - category: "flags" - }, - malawi: { - keywords: ["mw", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\uddfc", - fitzpatrick_scale: false, - category: "flags" - }, - malaysia: { - keywords: ["my", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\uddfe", - fitzpatrick_scale: false, - category: "flags" - }, - maldives: { - keywords: ["mv", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\uddfb", - fitzpatrick_scale: false, - category: "flags" - }, - mali: { - keywords: ["ml", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\uddf1", - fitzpatrick_scale: false, - category: "flags" - }, - malta: { - keywords: ["mt", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\uddf9", - fitzpatrick_scale: false, - category: "flags" - }, - marshall_islands: { - keywords: ["marshall", "islands", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\udded", - fitzpatrick_scale: false, - category: "flags" - }, - martinique: { - keywords: ["mq", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\uddf6", - fitzpatrick_scale: false, - category: "flags" - }, - mauritania: { - keywords: ["mr", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\uddf7", - fitzpatrick_scale: false, - category: "flags" - }, - mauritius: { - keywords: ["mu", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\uddfa", - fitzpatrick_scale: false, - category: "flags" - }, - mayotte: { - keywords: ["yt", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddfe\ud83c\uddf9", - fitzpatrick_scale: false, - category: "flags" - }, - mexico: { - keywords: ["mx", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\uddfd", - fitzpatrick_scale: false, - category: "flags" - }, - micronesia: { - keywords: ["micronesia,", "federated", "states", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddeb\ud83c\uddf2", - fitzpatrick_scale: false, - category: "flags" - }, - moldova: { - keywords: ["moldova,", "republic", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\udde9", - fitzpatrick_scale: false, - category: "flags" - }, - monaco: { - keywords: ["mc", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\udde8", - fitzpatrick_scale: false, - category: "flags" - }, - mongolia: { - keywords: ["mn", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\uddf3", - fitzpatrick_scale: false, - category: "flags" - }, - montenegro: { - keywords: ["me", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\uddea", - fitzpatrick_scale: false, - category: "flags" - }, - montserrat: { - keywords: ["ms", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\uddf8", - fitzpatrick_scale: false, - category: "flags" - }, - morocco: { - keywords: ["ma", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\udde6", - fitzpatrick_scale: false, - category: "flags" - }, - mozambique: { - keywords: ["mz", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\uddff", - fitzpatrick_scale: false, - category: "flags" - }, - myanmar: { - keywords: ["mm", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\uddf2", - fitzpatrick_scale: false, - category: "flags" - }, - namibia: { - keywords: ["na", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf3\ud83c\udde6", - fitzpatrick_scale: false, - category: "flags" - }, - nauru: { - keywords: ["nr", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf3\ud83c\uddf7", - fitzpatrick_scale: false, - category: "flags" - }, - nepal: { - keywords: ["np", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf3\ud83c\uddf5", - fitzpatrick_scale: false, - category: "flags" - }, - netherlands: { - keywords: ["nl", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf3\ud83c\uddf1", - fitzpatrick_scale: false, - category: "flags" - }, - new_caledonia: { - keywords: ["new", "caledonia", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf3\ud83c\udde8", - fitzpatrick_scale: false, - category: "flags" - }, - new_zealand: { - keywords: ["new", "zealand", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf3\ud83c\uddff", - fitzpatrick_scale: false, - category: "flags" - }, - nicaragua: { - keywords: ["ni", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf3\ud83c\uddee", - fitzpatrick_scale: false, - category: "flags" - }, - niger: { - keywords: ["ne", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf3\ud83c\uddea", - fitzpatrick_scale: false, - category: "flags" - }, - nigeria: { - keywords: ["flag", "nation", "country", "banner"], - "char": "\ud83c\uddf3\ud83c\uddec", - fitzpatrick_scale: false, - category: "flags" - }, - niue: { - keywords: ["nu", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf3\ud83c\uddfa", - fitzpatrick_scale: false, - category: "flags" - }, - norfolk_island: { - keywords: ["norfolk", "island", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf3\ud83c\uddeb", - fitzpatrick_scale: false, - category: "flags" - }, - northern_mariana_islands: { - keywords: ["northern", "mariana", "islands", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf2\ud83c\uddf5", - fitzpatrick_scale: false, - category: "flags" - }, - north_korea: { - keywords: ["north", "korea", "nation", "flag", "country", "banner"], - "char": "\ud83c\uddf0\ud83c\uddf5", - fitzpatrick_scale: false, - category: "flags" - }, - norway: { - keywords: ["no", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf3\ud83c\uddf4", - fitzpatrick_scale: false, - category: "flags" - }, - oman: { - keywords: ["om_symbol", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf4\ud83c\uddf2", - fitzpatrick_scale: false, - category: "flags" - }, - pakistan: { - keywords: ["pk", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf5\ud83c\uddf0", - fitzpatrick_scale: false, - category: "flags" - }, - palau: { - keywords: ["pw", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf5\ud83c\uddfc", - fitzpatrick_scale: false, - category: "flags" - }, - palestinian_territories: { - keywords: ["palestine", "palestinian", "territories", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf5\ud83c\uddf8", - fitzpatrick_scale: false, - category: "flags" - }, - panama: { - keywords: ["pa", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf5\ud83c\udde6", - fitzpatrick_scale: false, - category: "flags" - }, - papua_new_guinea: { - keywords: ["papua", "new", "guinea", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf5\ud83c\uddec", - fitzpatrick_scale: false, - category: "flags" - }, - paraguay: { - keywords: ["py", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf5\ud83c\uddfe", - fitzpatrick_scale: false, - category: "flags" - }, - peru: { - keywords: ["pe", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf5\ud83c\uddea", - fitzpatrick_scale: false, - category: "flags" - }, - philippines: { - keywords: ["ph", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf5\ud83c\udded", - fitzpatrick_scale: false, - category: "flags" - }, - pitcairn_islands: { - keywords: ["pitcairn", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf5\ud83c\uddf3", - fitzpatrick_scale: false, - category: "flags" - }, - poland: { - keywords: ["pl", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf5\ud83c\uddf1", - fitzpatrick_scale: false, - category: "flags" - }, - portugal: { - keywords: ["pt", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf5\ud83c\uddf9", - fitzpatrick_scale: false, - category: "flags" - }, - puerto_rico: { - keywords: ["puerto", "rico", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf5\ud83c\uddf7", - fitzpatrick_scale: false, - category: "flags" - }, - qatar: { - keywords: ["qa", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf6\ud83c\udde6", - fitzpatrick_scale: false, - category: "flags" - }, - reunion: { - keywords: ["r\xe9union", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf7\ud83c\uddea", - fitzpatrick_scale: false, - category: "flags" - }, - romania: { - keywords: ["ro", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf7\ud83c\uddf4", - fitzpatrick_scale: false, - category: "flags" - }, - ru: { - keywords: ["russian", "federation", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf7\ud83c\uddfa", - fitzpatrick_scale: false, - category: "flags" - }, - rwanda: { - keywords: ["rw", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf7\ud83c\uddfc", - fitzpatrick_scale: false, - category: "flags" - }, - st_barthelemy: { - keywords: ["saint", "barth\xe9lemy", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde7\ud83c\uddf1", - fitzpatrick_scale: false, - category: "flags" - }, - st_helena: { - keywords: ["saint", "helena", "ascension", "tristan", "cunha", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\udded", - fitzpatrick_scale: false, - category: "flags" - }, - st_kitts_nevis: { - keywords: ["saint", "kitts", "nevis", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf0\ud83c\uddf3", - fitzpatrick_scale: false, - category: "flags" - }, - st_lucia: { - keywords: ["saint", "lucia", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf1\ud83c\udde8", - fitzpatrick_scale: false, - category: "flags" - }, - st_pierre_miquelon: { - keywords: ["saint", "pierre", "miquelon", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf5\ud83c\uddf2", - fitzpatrick_scale: false, - category: "flags" - }, - st_vincent_grenadines: { - keywords: ["saint", "vincent", "grenadines", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddfb\ud83c\udde8", - fitzpatrick_scale: false, - category: "flags" - }, - samoa: { - keywords: ["ws", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddfc\ud83c\uddf8", - fitzpatrick_scale: false, - category: "flags" - }, - san_marino: { - keywords: ["san", "marino", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\uddf2", - fitzpatrick_scale: false, - category: "flags" - }, - sao_tome_principe: { - keywords: ["sao", "tome", "principe", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\uddf9", - fitzpatrick_scale: false, - category: "flags" - }, - saudi_arabia: { - keywords: ["flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\udde6", - fitzpatrick_scale: false, - category: "flags" - }, - senegal: { - keywords: ["sn", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\uddf3", - fitzpatrick_scale: false, - category: "flags" - }, - serbia: { - keywords: ["rs", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf7\ud83c\uddf8", - fitzpatrick_scale: false, - category: "flags" - }, - seychelles: { - keywords: ["sc", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\udde8", - fitzpatrick_scale: false, - category: "flags" - }, - sierra_leone: { - keywords: ["sierra", "leone", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\uddf1", - fitzpatrick_scale: false, - category: "flags" - }, - singapore: { - keywords: ["sg", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\uddec", - fitzpatrick_scale: false, - category: "flags" - }, - sint_maarten: { - keywords: ["sint", "maarten", "dutch", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\uddfd", - fitzpatrick_scale: false, - category: "flags" - }, - slovakia: { - keywords: ["sk", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\uddf0", - fitzpatrick_scale: false, - category: "flags" - }, - slovenia: { - keywords: ["si", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\uddee", - fitzpatrick_scale: false, - category: "flags" - }, - solomon_islands: { - keywords: ["solomon", "islands", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\udde7", - fitzpatrick_scale: false, - category: "flags" - }, - somalia: { - keywords: ["so", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\uddf4", - fitzpatrick_scale: false, - category: "flags" - }, - south_africa: { - keywords: ["south", "africa", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddff\ud83c\udde6", - fitzpatrick_scale: false, - category: "flags" - }, - south_georgia_south_sandwich_islands: { - keywords: ["south", "georgia", "sandwich", "islands", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddec\ud83c\uddf8", - fitzpatrick_scale: false, - category: "flags" - }, - kr: { - keywords: ["south", "korea", "nation", "flag", "country", "banner"], - "char": "\ud83c\uddf0\ud83c\uddf7", - fitzpatrick_scale: false, - category: "flags" - }, - south_sudan: { - keywords: ["south", "sd", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\uddf8", - fitzpatrick_scale: false, - category: "flags" - }, - es: { - keywords: ["spain", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddea\ud83c\uddf8", - fitzpatrick_scale: false, - category: "flags" - }, - sri_lanka: { - keywords: ["sri", "lanka", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf1\ud83c\uddf0", - fitzpatrick_scale: false, - category: "flags" - }, - sudan: { - keywords: ["sd", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\udde9", - fitzpatrick_scale: false, - category: "flags" - }, - suriname: { - keywords: ["sr", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\uddf7", - fitzpatrick_scale: false, - category: "flags" - }, - swaziland: { - keywords: ["sz", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\uddff", - fitzpatrick_scale: false, - category: "flags" - }, - sweden: { - keywords: ["se", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\uddea", - fitzpatrick_scale: false, - category: "flags" - }, - switzerland: { - keywords: ["ch", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde8\ud83c\udded", - fitzpatrick_scale: false, - category: "flags" - }, - syria: { - keywords: ["syrian", "arab", "republic", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf8\ud83c\uddfe", - fitzpatrick_scale: false, - category: "flags" - }, - taiwan: { - keywords: ["tw", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf9\ud83c\uddfc", - fitzpatrick_scale: false, - category: "flags" - }, - tajikistan: { - keywords: ["tj", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf9\ud83c\uddef", - fitzpatrick_scale: false, - category: "flags" - }, - tanzania: { - keywords: ["tanzania,", "united", "republic", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf9\ud83c\uddff", - fitzpatrick_scale: false, - category: "flags" - }, - thailand: { - keywords: ["th", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf9\ud83c\udded", - fitzpatrick_scale: false, - category: "flags" - }, - timor_leste: { - keywords: ["timor", "leste", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf9\ud83c\uddf1", - fitzpatrick_scale: false, - category: "flags" - }, - togo: { - keywords: ["tg", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf9\ud83c\uddec", - fitzpatrick_scale: false, - category: "flags" - }, - tokelau: { - keywords: ["tk", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf9\ud83c\uddf0", - fitzpatrick_scale: false, - category: "flags" - }, - tonga: { - keywords: ["to", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf9\ud83c\uddf4", - fitzpatrick_scale: false, - category: "flags" - }, - trinidad_tobago: { - keywords: ["trinidad", "tobago", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf9\ud83c\uddf9", - fitzpatrick_scale: false, - category: "flags" - }, - tunisia: { - keywords: ["tn", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf9\ud83c\uddf3", - fitzpatrick_scale: false, - category: "flags" - }, - tr: { - keywords: ["turkey", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf9\ud83c\uddf7", - fitzpatrick_scale: false, - category: "flags" - }, - turkmenistan: { - keywords: ["flag", "nation", "country", "banner"], - "char": "\ud83c\uddf9\ud83c\uddf2", - fitzpatrick_scale: false, - category: "flags" - }, - turks_caicos_islands: { - keywords: ["turks", "caicos", "islands", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddf9\ud83c\udde8", - fitzpatrick_scale: false, - category: "flags" - }, - tuvalu: { - keywords: ["flag", "nation", "country", "banner"], - "char": "\ud83c\uddf9\ud83c\uddfb", - fitzpatrick_scale: false, - category: "flags" - }, - uganda: { - keywords: ["ug", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddfa\ud83c\uddec", - fitzpatrick_scale: false, - category: "flags" - }, - ukraine: { - keywords: ["ua", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddfa\ud83c\udde6", - fitzpatrick_scale: false, - category: "flags" - }, - united_arab_emirates: { - keywords: ["united", "arab", "emirates", "flag", "nation", "country", "banner"], - "char": "\ud83c\udde6\ud83c\uddea", - fitzpatrick_scale: false, - category: "flags" - }, - uk: { - keywords: ["united", "kingdom", "great", "britain", "northern", "ireland", "flag", "nation", "country", "banner", "british", "UK", "english", "england", "union jack"], - "char": "\ud83c\uddec\ud83c\udde7", - fitzpatrick_scale: false, - category: "flags" - }, - england: { - keywords: ["flag", "english"], - "char": "\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f", - fitzpatrick_scale: false, - category: "flags" - }, - scotland: { - keywords: ["flag", "scottish"], - "char": "\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f", - fitzpatrick_scale: false, - category: "flags" - }, - wales: { - keywords: ["flag", "welsh"], - "char": "\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f", - fitzpatrick_scale: false, - category: "flags" - }, - us: { - keywords: ["united", "states", "america", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddfa\ud83c\uddf8", - fitzpatrick_scale: false, - category: "flags" - }, - us_virgin_islands: { - keywords: ["virgin", "islands", "us", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddfb\ud83c\uddee", - fitzpatrick_scale: false, - category: "flags" - }, - uruguay: { - keywords: ["uy", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddfa\ud83c\uddfe", - fitzpatrick_scale: false, - category: "flags" - }, - uzbekistan: { - keywords: ["uz", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddfa\ud83c\uddff", - fitzpatrick_scale: false, - category: "flags" - }, - vanuatu: { - keywords: ["vu", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddfb\ud83c\uddfa", - fitzpatrick_scale: false, - category: "flags" - }, - vatican_city: { - keywords: ["vatican", "city", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddfb\ud83c\udde6", - fitzpatrick_scale: false, - category: "flags" - }, - venezuela: { - keywords: ["ve", "bolivarian", "republic", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddfb\ud83c\uddea", - fitzpatrick_scale: false, - category: "flags" - }, - vietnam: { - keywords: ["viet", "nam", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddfb\ud83c\uddf3", - fitzpatrick_scale: false, - category: "flags" - }, - wallis_futuna: { - keywords: ["wallis", "futuna", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddfc\ud83c\uddeb", - fitzpatrick_scale: false, - category: "flags" - }, - western_sahara: { - keywords: ["western", "sahara", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddea\ud83c\udded", - fitzpatrick_scale: false, - category: "flags" - }, - yemen: { - keywords: ["ye", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddfe\ud83c\uddea", - fitzpatrick_scale: false, - category: "flags" - }, - zambia: { - keywords: ["zm", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddff\ud83c\uddf2", - fitzpatrick_scale: false, - category: "flags" - }, - zimbabwe: { - keywords: ["zw", "flag", "nation", "country", "banner"], - "char": "\ud83c\uddff\ud83c\uddfc", - fitzpatrick_scale: false, - category: "flags" - }, - united_nations: { - keywords: ["un", "flag", "banner"], - "char": "\ud83c\uddfa\ud83c\uddf3", - fitzpatrick_scale: false, - category: "flags" - }, - pirate_flag: { - keywords: ["skull", "crossbones", "flag", "banner"], - "char": "\ud83c\udff4\u200d\u2620\ufe0f", - fitzpatrick_scale: false, - category: "flags" - } + grinning: { + keywords: [ "face", "smile", "happy", "joy", ":D", "grin" ], + "char": "\ud83d\ude00", + fitzpatrick_scale: false, + category: "people" + }, + grimacing: { + keywords: [ "face", "grimace", "teeth" ], + "char": "\ud83d\ude2c", + fitzpatrick_scale: false, + category: "people" + }, + grin: { + keywords: [ "face", "happy", "smile", "joy", "kawaii" ], + "char": "\ud83d\ude01", + fitzpatrick_scale: false, + category: "people" + }, + joy: { + keywords: [ "face", "cry", "tears", "weep", "happy", "happytears", "haha" ], + "char": "\ud83d\ude02", + fitzpatrick_scale: false, + category: "people" + }, + rofl: { + keywords: [ "face", "rolling", "floor", "laughing", "lol", "haha" ], + "char": "\ud83e\udd23", + fitzpatrick_scale: false, + category: "people" + }, + partying: { + keywords: [ "face", "celebration", "woohoo" ], + "char": "\ud83e\udd73", + fitzpatrick_scale: false, + category: "people" + }, + smiley: { + keywords: [ "face", "happy", "joy", "haha", ":D", ":)", "smile", "funny" ], + "char": "\ud83d\ude03", + fitzpatrick_scale: false, + category: "people" + }, + smile: { + keywords: [ "face", "happy", "joy", "funny", "haha", "laugh", "like", ":D", ":)" ], + "char": "\ud83d\ude04", + fitzpatrick_scale: false, + category: "people" + }, + sweat_smile: { + keywords: [ "face", "hot", "happy", "laugh", "sweat", "smile", "relief" ], + "char": "\ud83d\ude05", + fitzpatrick_scale: false, + category: "people" + }, + laughing: { + keywords: [ "happy", "joy", "lol", "satisfied", "haha", "face", "glad", "XD", "laugh" ], + "char": "\ud83d\ude06", + fitzpatrick_scale: false, + category: "people" + }, + innocent: { + keywords: [ "face", "angel", "heaven", "halo" ], + "char": "\ud83d\ude07", + fitzpatrick_scale: false, + category: "people" + }, + wink: { + keywords: [ "face", "happy", "mischievous", "secret", ";)", "smile", "eye" ], + "char": "\ud83d\ude09", + fitzpatrick_scale: false, + category: "people" + }, + blush: { + keywords: [ "face", "smile", "happy", "flushed", "crush", "embarrassed", "shy", "joy" ], + "char": "\ud83d\ude0a", + fitzpatrick_scale: false, + category: "people" + }, + slightly_smiling_face: { + keywords: [ "face", "smile" ], + "char": "\ud83d\ude42", + fitzpatrick_scale: false, + category: "people" + }, + upside_down_face: { + keywords: [ "face", "flipped", "silly", "smile" ], + "char": "\ud83d\ude43", + fitzpatrick_scale: false, + category: "people" + }, + relaxed: { + keywords: [ "face", "blush", "massage", "happiness" ], + "char": "\u263a\ufe0f", + fitzpatrick_scale: false, + category: "people" + }, + yum: { + keywords: [ "happy", "joy", "tongue", "smile", "face", "silly", "yummy", "nom", "delicious", "savouring" ], + "char": "\ud83d\ude0b", + fitzpatrick_scale: false, + category: "people" + }, + relieved: { + keywords: [ "face", "relaxed", "phew", "massage", "happiness" ], + "char": "\ud83d\ude0c", + fitzpatrick_scale: false, + category: "people" + }, + heart_eyes: { + keywords: [ "face", "love", "like", "affection", "valentines", "infatuation", "crush", "heart" ], + "char": "\ud83d\ude0d", + fitzpatrick_scale: false, + category: "people" + }, + smiling_face_with_three_hearts: { + keywords: [ "face", "love", "like", "affection", "valentines", "infatuation", "crush", "hearts", "adore" ], + "char": "\ud83e\udd70", + fitzpatrick_scale: false, + category: "people" + }, + kissing_heart: { + keywords: [ "face", "love", "like", "affection", "valentines", "infatuation", "kiss" ], + "char": "\ud83d\ude18", + fitzpatrick_scale: false, + category: "people" + }, + kissing: { + keywords: [ "love", "like", "face", "3", "valentines", "infatuation", "kiss" ], + "char": "\ud83d\ude17", + fitzpatrick_scale: false, + category: "people" + }, + kissing_smiling_eyes: { + keywords: [ "face", "affection", "valentines", "infatuation", "kiss" ], + "char": "\ud83d\ude19", + fitzpatrick_scale: false, + category: "people" + }, + kissing_closed_eyes: { + keywords: [ "face", "love", "like", "affection", "valentines", "infatuation", "kiss" ], + "char": "\ud83d\ude1a", + fitzpatrick_scale: false, + category: "people" + }, + stuck_out_tongue_winking_eye: { + keywords: [ "face", "prank", "childish", "playful", "mischievous", "smile", "wink", "tongue" ], + "char": "\ud83d\ude1c", + fitzpatrick_scale: false, + category: "people" + }, + zany: { + keywords: [ "face", "goofy", "crazy" ], + "char": "\ud83e\udd2a", + fitzpatrick_scale: false, + category: "people" + }, + raised_eyebrow: { + keywords: [ "face", "distrust", "scepticism", "disapproval", "disbelief", "surprise" ], + "char": "\ud83e\udd28", + fitzpatrick_scale: false, + category: "people" + }, + monocle: { + keywords: [ "face", "stuffy", "wealthy" ], + "char": "\ud83e\uddd0", + fitzpatrick_scale: false, + category: "people" + }, + stuck_out_tongue_closed_eyes: { + keywords: [ "face", "prank", "playful", "mischievous", "smile", "tongue" ], + "char": "\ud83d\ude1d", + fitzpatrick_scale: false, + category: "people" + }, + stuck_out_tongue: { + keywords: [ "face", "prank", "childish", "playful", "mischievous", "smile", "tongue" ], + "char": "\ud83d\ude1b", + fitzpatrick_scale: false, + category: "people" + }, + money_mouth_face: { + keywords: [ "face", "rich", "dollar", "money" ], + "char": "\ud83e\udd11", + fitzpatrick_scale: false, + category: "people" + }, + nerd_face: { + keywords: [ "face", "nerdy", "geek", "dork" ], + "char": "\ud83e\udd13", + fitzpatrick_scale: false, + category: "people" + }, + sunglasses: { + keywords: [ "face", "cool", "smile", "summer", "beach", "sunglass" ], + "char": "\ud83d\ude0e", + fitzpatrick_scale: false, + category: "people" + }, + star_struck: { + keywords: [ "face", "smile", "starry", "eyes", "grinning" ], + "char": "\ud83e\udd29", + fitzpatrick_scale: false, + category: "people" + }, + clown_face: { + keywords: [ "face" ], + "char": "\ud83e\udd21", + fitzpatrick_scale: false, + category: "people" + }, + cowboy_hat_face: { + keywords: [ "face", "cowgirl", "hat" ], + "char": "\ud83e\udd20", + fitzpatrick_scale: false, + category: "people" + }, + hugs: { + keywords: [ "face", "smile", "hug" ], + "char": "\ud83e\udd17", + fitzpatrick_scale: false, + category: "people" + }, + smirk: { + keywords: [ "face", "smile", "mean", "prank", "smug", "sarcasm" ], + "char": "\ud83d\ude0f", + fitzpatrick_scale: false, + category: "people" + }, + no_mouth: { + keywords: [ "face", "hellokitty" ], + "char": "\ud83d\ude36", + fitzpatrick_scale: false, + category: "people" + }, + neutral_face: { + keywords: [ "indifference", "meh", ":|", "neutral" ], + "char": "\ud83d\ude10", + fitzpatrick_scale: false, + category: "people" + }, + expressionless: { + keywords: [ "face", "indifferent", "-_-", "meh", "deadpan" ], + "char": "\ud83d\ude11", + fitzpatrick_scale: false, + category: "people" + }, + unamused: { + keywords: [ "indifference", "bored", "straight face", "serious", "sarcasm", "unimpressed", "skeptical", "dubious", "side_eye" ], + "char": "\ud83d\ude12", + fitzpatrick_scale: false, + category: "people" + }, + roll_eyes: { + keywords: [ "face", "eyeroll", "frustrated" ], + "char": "\ud83d\ude44", + fitzpatrick_scale: false, + category: "people" + }, + thinking: { + keywords: [ "face", "hmmm", "think", "consider" ], + "char": "\ud83e\udd14", + fitzpatrick_scale: false, + category: "people" + }, + lying_face: { + keywords: [ "face", "lie", "pinocchio" ], + "char": "\ud83e\udd25", + fitzpatrick_scale: false, + category: "people" + }, + hand_over_mouth: { + keywords: [ "face", "whoops", "shock", "surprise" ], + "char": "\ud83e\udd2d", + fitzpatrick_scale: false, + category: "people" + }, + shushing: { + keywords: [ "face", "quiet", "shhh" ], + "char": "\ud83e\udd2b", + fitzpatrick_scale: false, + category: "people" + }, + symbols_over_mouth: { + keywords: [ "face", "swearing", "cursing", "cussing", "profanity", "expletive" ], + "char": "\ud83e\udd2c", + fitzpatrick_scale: false, + category: "people" + }, + exploding_head: { + keywords: [ "face", "shocked", "mind", "blown" ], + "char": "\ud83e\udd2f", + fitzpatrick_scale: false, + category: "people" + }, + flushed: { + keywords: [ "face", "blush", "shy", "flattered" ], + "char": "\ud83d\ude33", + fitzpatrick_scale: false, + category: "people" + }, + disappointed: { + keywords: [ "face", "sad", "upset", "depressed", ":(" ], + "char": "\ud83d\ude1e", + fitzpatrick_scale: false, + category: "people" + }, + worried: { + keywords: [ "face", "concern", "nervous", ":(" ], + "char": "\ud83d\ude1f", + fitzpatrick_scale: false, + category: "people" + }, + angry: { + keywords: [ "mad", "face", "annoyed", "frustrated" ], + "char": "\ud83d\ude20", + fitzpatrick_scale: false, + category: "people" + }, + rage: { + keywords: [ "angry", "mad", "hate", "despise" ], + "char": "\ud83d\ude21", + fitzpatrick_scale: false, + category: "people" + }, + pensive: { + keywords: [ "face", "sad", "depressed", "upset" ], + "char": "\ud83d\ude14", + fitzpatrick_scale: false, + category: "people" + }, + confused: { + keywords: [ "face", "indifference", "huh", "weird", "hmmm", ":/" ], + "char": "\ud83d\ude15", + fitzpatrick_scale: false, + category: "people" + }, + slightly_frowning_face: { + keywords: [ "face", "frowning", "disappointed", "sad", "upset" ], + "char": "\ud83d\ude41", + fitzpatrick_scale: false, + category: "people" + }, + frowning_face: { + keywords: [ "face", "sad", "upset", "frown" ], + "char": "\u2639", + fitzpatrick_scale: false, + category: "people" + }, + persevere: { + keywords: [ "face", "sick", "no", "upset", "oops" ], + "char": "\ud83d\ude23", + fitzpatrick_scale: false, + category: "people" + }, + confounded: { + keywords: [ "face", "confused", "sick", "unwell", "oops", ":S" ], + "char": "\ud83d\ude16", + fitzpatrick_scale: false, + category: "people" + }, + tired_face: { + keywords: [ "sick", "whine", "upset", "frustrated" ], + "char": "\ud83d\ude2b", + fitzpatrick_scale: false, + category: "people" + }, + weary: { + keywords: [ "face", "tired", "sleepy", "sad", "frustrated", "upset" ], + "char": "\ud83d\ude29", + fitzpatrick_scale: false, + category: "people" + }, + pleading: { + keywords: [ "face", "begging", "mercy" ], + "char": "\ud83e\udd7a", + fitzpatrick_scale: false, + category: "people" + }, + triumph: { + keywords: [ "face", "gas", "phew", "proud", "pride" ], + "char": "\ud83d\ude24", + fitzpatrick_scale: false, + category: "people" + }, + open_mouth: { + keywords: [ "face", "surprise", "impressed", "wow", "whoa", ":O" ], + "char": "\ud83d\ude2e", + fitzpatrick_scale: false, + category: "people" + }, + scream: { + keywords: [ "face", "munch", "scared", "omg" ], + "char": "\ud83d\ude31", + fitzpatrick_scale: false, + category: "people" + }, + fearful: { + keywords: [ "face", "scared", "terrified", "nervous", "oops", "huh" ], + "char": "\ud83d\ude28", + fitzpatrick_scale: false, + category: "people" + }, + cold_sweat: { + keywords: [ "face", "nervous", "sweat" ], + "char": "\ud83d\ude30", + fitzpatrick_scale: false, + category: "people" + }, + hushed: { + keywords: [ "face", "woo", "shh" ], + "char": "\ud83d\ude2f", + fitzpatrick_scale: false, + category: "people" + }, + frowning: { + keywords: [ "face", "aw", "what" ], + "char": "\ud83d\ude26", + fitzpatrick_scale: false, + category: "people" + }, + anguished: { + keywords: [ "face", "stunned", "nervous" ], + "char": "\ud83d\ude27", + fitzpatrick_scale: false, + category: "people" + }, + cry: { + keywords: [ "face", "tears", "sad", "depressed", "upset", ":'(" ], + "char": "\ud83d\ude22", + fitzpatrick_scale: false, + category: "people" + }, + disappointed_relieved: { + keywords: [ "face", "phew", "sweat", "nervous" ], + "char": "\ud83d\ude25", + fitzpatrick_scale: false, + category: "people" + }, + drooling_face: { + keywords: [ "face" ], + "char": "\ud83e\udd24", + fitzpatrick_scale: false, + category: "people" + }, + sleepy: { + keywords: [ "face", "tired", "rest", "nap" ], + "char": "\ud83d\ude2a", + fitzpatrick_scale: false, + category: "people" + }, + sweat: { + keywords: [ "face", "hot", "sad", "tired", "exercise" ], + "char": "\ud83d\ude13", + fitzpatrick_scale: false, + category: "people" + }, + hot: { + keywords: [ "face", "feverish", "heat", "red", "sweating" ], + "char": "\ud83e\udd75", + fitzpatrick_scale: false, + category: "people" + }, + cold: { + keywords: [ "face", "blue", "freezing", "frozen", "frostbite", "icicles" ], + "char": "\ud83e\udd76", + fitzpatrick_scale: false, + category: "people" + }, + sob: { + keywords: [ "face", "cry", "tears", "sad", "upset", "depressed" ], + "char": "\ud83d\ude2d", + fitzpatrick_scale: false, + category: "people" + }, + dizzy_face: { + keywords: [ "spent", "unconscious", "xox", "dizzy" ], + "char": "\ud83d\ude35", + fitzpatrick_scale: false, + category: "people" + }, + astonished: { + keywords: [ "face", "xox", "surprised", "poisoned" ], + "char": "\ud83d\ude32", + fitzpatrick_scale: false, + category: "people" + }, + zipper_mouth_face: { + keywords: [ "face", "sealed", "zipper", "secret" ], + "char": "\ud83e\udd10", + fitzpatrick_scale: false, + category: "people" + }, + nauseated_face: { + keywords: [ "face", "vomit", "gross", "green", "sick", "throw up", "ill" ], + "char": "\ud83e\udd22", + fitzpatrick_scale: false, + category: "people" + }, + sneezing_face: { + keywords: [ "face", "gesundheit", "sneeze", "sick", "allergy" ], + "char": "\ud83e\udd27", + fitzpatrick_scale: false, + category: "people" + }, + vomiting: { + keywords: [ "face", "sick" ], + "char": "\ud83e\udd2e", + fitzpatrick_scale: false, + category: "people" + }, + mask: { + keywords: [ "face", "sick", "ill", "disease" ], + "char": "\ud83d\ude37", + fitzpatrick_scale: false, + category: "people" + }, + face_with_thermometer: { + keywords: [ "sick", "temperature", "thermometer", "cold", "fever" ], + "char": "\ud83e\udd12", + fitzpatrick_scale: false, + category: "people" + }, + face_with_head_bandage: { + keywords: [ "injured", "clumsy", "bandage", "hurt" ], + "char": "\ud83e\udd15", + fitzpatrick_scale: false, + category: "people" + }, + woozy: { + keywords: [ "face", "dizzy", "intoxicated", "tipsy", "wavy" ], + "char": "\ud83e\udd74", + fitzpatrick_scale: false, + category: "people" + }, + sleeping: { + keywords: [ "face", "tired", "sleepy", "night", "zzz" ], + "char": "\ud83d\ude34", + fitzpatrick_scale: false, + category: "people" + }, + zzz: { + keywords: [ "sleepy", "tired", "dream" ], + "char": "\ud83d\udca4", + fitzpatrick_scale: false, + category: "people" + }, + poop: { + keywords: [ "hankey", "shitface", "fail", "turd", "shit" ], + "char": "\ud83d\udca9", + fitzpatrick_scale: false, + category: "people" + }, + smiling_imp: { + keywords: [ "devil", "horns" ], + "char": "\ud83d\ude08", + fitzpatrick_scale: false, + category: "people" + }, + imp: { + keywords: [ "devil", "angry", "horns" ], + "char": "\ud83d\udc7f", + fitzpatrick_scale: false, + category: "people" + }, + japanese_ogre: { + keywords: [ "monster", "red", "mask", "halloween", "scary", "creepy", "devil", "demon", "japanese", "ogre" ], + "char": "\ud83d\udc79", + fitzpatrick_scale: false, + category: "people" + }, + japanese_goblin: { + keywords: [ "red", "evil", "mask", "monster", "scary", "creepy", "japanese", "goblin" ], + "char": "\ud83d\udc7a", + fitzpatrick_scale: false, + category: "people" + }, + skull: { + keywords: [ "dead", "skeleton", "creepy", "death" ], + "char": "\ud83d\udc80", + fitzpatrick_scale: false, + category: "people" + }, + ghost: { + keywords: [ "halloween", "spooky", "scary" ], + "char": "\ud83d\udc7b", + fitzpatrick_scale: false, + category: "people" + }, + alien: { + keywords: [ "UFO", "paul", "weird", "outer_space" ], + "char": "\ud83d\udc7d", + fitzpatrick_scale: false, + category: "people" + }, + robot: { + keywords: [ "computer", "machine", "bot" ], + "char": "\ud83e\udd16", + fitzpatrick_scale: false, + category: "people" + }, + smiley_cat: { + keywords: [ "animal", "cats", "happy", "smile" ], + "char": "\ud83d\ude3a", + fitzpatrick_scale: false, + category: "people" + }, + smile_cat: { + keywords: [ "animal", "cats", "smile" ], + "char": "\ud83d\ude38", + fitzpatrick_scale: false, + category: "people" + }, + joy_cat: { + keywords: [ "animal", "cats", "haha", "happy", "tears" ], + "char": "\ud83d\ude39", + fitzpatrick_scale: false, + category: "people" + }, + heart_eyes_cat: { + keywords: [ "animal", "love", "like", "affection", "cats", "valentines", "heart" ], + "char": "\ud83d\ude3b", + fitzpatrick_scale: false, + category: "people" + }, + smirk_cat: { + keywords: [ "animal", "cats", "smirk" ], + "char": "\ud83d\ude3c", + fitzpatrick_scale: false, + category: "people" + }, + kissing_cat: { + keywords: [ "animal", "cats", "kiss" ], + "char": "\ud83d\ude3d", + fitzpatrick_scale: false, + category: "people" + }, + scream_cat: { + keywords: [ "animal", "cats", "munch", "scared", "scream" ], + "char": "\ud83d\ude40", + fitzpatrick_scale: false, + category: "people" + }, + crying_cat_face: { + keywords: [ "animal", "tears", "weep", "sad", "cats", "upset", "cry" ], + "char": "\ud83d\ude3f", + fitzpatrick_scale: false, + category: "people" + }, + pouting_cat: { + keywords: [ "animal", "cats" ], + "char": "\ud83d\ude3e", + fitzpatrick_scale: false, + category: "people" + }, + palms_up: { + keywords: [ "hands", "gesture", "cupped", "prayer" ], + "char": "\ud83e\udd32", + fitzpatrick_scale: true, + category: "people" + }, + raised_hands: { + keywords: [ "gesture", "hooray", "yea", "celebration", "hands" ], + "char": "\ud83d\ude4c", + fitzpatrick_scale: true, + category: "people" + }, + clap: { + keywords: [ "hands", "praise", "applause", "congrats", "yay" ], + "char": "\ud83d\udc4f", + fitzpatrick_scale: true, + category: "people" + }, + wave: { + keywords: [ "hands", "gesture", "goodbye", "solong", "farewell", "hello", "hi", "palm" ], + "char": "\ud83d\udc4b", + fitzpatrick_scale: true, + category: "people" + }, + call_me_hand: { + keywords: [ "hands", "gesture" ], + "char": "\ud83e\udd19", + fitzpatrick_scale: true, + category: "people" + }, + "+1": { + keywords: [ "thumbsup", "yes", "awesome", "good", "agree", "accept", "cool", "hand", "like" ], + "char": "\ud83d\udc4d", + fitzpatrick_scale: true, + category: "people" + }, + "-1": { + keywords: [ "thumbsdown", "no", "dislike", "hand" ], + "char": "\ud83d\udc4e", + fitzpatrick_scale: true, + category: "people" + }, + facepunch: { + keywords: [ "angry", "violence", "fist", "hit", "attack", "hand" ], + "char": "\ud83d\udc4a", + fitzpatrick_scale: true, + category: "people" + }, + fist: { + keywords: [ "fingers", "hand", "grasp" ], + "char": "\u270a", + fitzpatrick_scale: true, + category: "people" + }, + fist_left: { + keywords: [ "hand", "fistbump" ], + "char": "\ud83e\udd1b", + fitzpatrick_scale: true, + category: "people" + }, + fist_right: { + keywords: [ "hand", "fistbump" ], + "char": "\ud83e\udd1c", + fitzpatrick_scale: true, + category: "people" + }, + v: { + keywords: [ "fingers", "ohyeah", "hand", "peace", "victory", "two" ], + "char": "\u270c", + fitzpatrick_scale: true, + category: "people" + }, + ok_hand: { + keywords: [ "fingers", "limbs", "perfect", "ok", "okay" ], + "char": "\ud83d\udc4c", + fitzpatrick_scale: true, + category: "people" + }, + raised_hand: { + keywords: [ "fingers", "stop", "highfive", "palm", "ban" ], + "char": "\u270b", + fitzpatrick_scale: true, + category: "people" + }, + raised_back_of_hand: { + keywords: [ "fingers", "raised", "backhand" ], + "char": "\ud83e\udd1a", + fitzpatrick_scale: true, + category: "people" + }, + open_hands: { + keywords: [ "fingers", "butterfly", "hands", "open" ], + "char": "\ud83d\udc50", + fitzpatrick_scale: true, + category: "people" + }, + muscle: { + keywords: [ "arm", "flex", "hand", "summer", "strong", "biceps" ], + "char": "\ud83d\udcaa", + fitzpatrick_scale: true, + category: "people" + }, + pray: { + keywords: [ "please", "hope", "wish", "namaste", "highfive" ], + "char": "\ud83d\ude4f", + fitzpatrick_scale: true, + category: "people" + }, + foot: { + keywords: [ "kick", "stomp" ], + "char": "\ud83e\uddb6", + fitzpatrick_scale: true, + category: "people" + }, + leg: { + keywords: [ "kick", "limb" ], + "char": "\ud83e\uddb5", + fitzpatrick_scale: true, + category: "people" + }, + handshake: { + keywords: [ "agreement", "shake" ], + "char": "\ud83e\udd1d", + fitzpatrick_scale: false, + category: "people" + }, + point_up: { + keywords: [ "hand", "fingers", "direction", "up" ], + "char": "\u261d", + fitzpatrick_scale: true, + category: "people" + }, + point_up_2: { + keywords: [ "fingers", "hand", "direction", "up" ], + "char": "\ud83d\udc46", + fitzpatrick_scale: true, + category: "people" + }, + point_down: { + keywords: [ "fingers", "hand", "direction", "down" ], + "char": "\ud83d\udc47", + fitzpatrick_scale: true, + category: "people" + }, + point_left: { + keywords: [ "direction", "fingers", "hand", "left" ], + "char": "\ud83d\udc48", + fitzpatrick_scale: true, + category: "people" + }, + point_right: { + keywords: [ "fingers", "hand", "direction", "right" ], + "char": "\ud83d\udc49", + fitzpatrick_scale: true, + category: "people" + }, + fu: { + keywords: [ "hand", "fingers", "rude", "middle", "flipping" ], + "char": "\ud83d\udd95", + fitzpatrick_scale: true, + category: "people" + }, + raised_hand_with_fingers_splayed: { + keywords: [ "hand", "fingers", "palm" ], + "char": "\ud83d\udd90", + fitzpatrick_scale: true, + category: "people" + }, + love_you: { + keywords: [ "hand", "fingers", "gesture" ], + "char": "\ud83e\udd1f", + fitzpatrick_scale: true, + category: "people" + }, + metal: { + keywords: [ "hand", "fingers", "evil_eye", "sign_of_horns", "rock_on" ], + "char": "\ud83e\udd18", + fitzpatrick_scale: true, + category: "people" + }, + crossed_fingers: { + keywords: [ "good", "lucky" ], + "char": "\ud83e\udd1e", + fitzpatrick_scale: true, + category: "people" + }, + vulcan_salute: { + keywords: [ "hand", "fingers", "spock", "star trek" ], + "char": "\ud83d\udd96", + fitzpatrick_scale: true, + category: "people" + }, + writing_hand: { + keywords: [ "lower_left_ballpoint_pen", "stationery", "write", "compose" ], + "char": "\u270d", + fitzpatrick_scale: true, + category: "people" + }, + selfie: { + keywords: [ "camera", "phone" ], + "char": "\ud83e\udd33", + fitzpatrick_scale: true, + category: "people" + }, + nail_care: { + keywords: [ "beauty", "manicure", "finger", "fashion", "nail" ], + "char": "\ud83d\udc85", + fitzpatrick_scale: true, + category: "people" + }, + lips: { + keywords: [ "mouth", "kiss" ], + "char": "\ud83d\udc44", + fitzpatrick_scale: false, + category: "people" + }, + tooth: { + keywords: [ "teeth", "dentist" ], + "char": "\ud83e\uddb7", + fitzpatrick_scale: false, + category: "people" + }, + tongue: { + keywords: [ "mouth", "playful" ], + "char": "\ud83d\udc45", + fitzpatrick_scale: false, + category: "people" + }, + ear: { + keywords: [ "face", "hear", "sound", "listen" ], + "char": "\ud83d\udc42", + fitzpatrick_scale: true, + category: "people" + }, + nose: { + keywords: [ "smell", "sniff" ], + "char": "\ud83d\udc43", + fitzpatrick_scale: true, + category: "people" + }, + eye: { + keywords: [ "face", "look", "see", "watch", "stare" ], + "char": "\ud83d\udc41", + fitzpatrick_scale: false, + category: "people" + }, + eyes: { + keywords: [ "look", "watch", "stalk", "peek", "see" ], + "char": "\ud83d\udc40", + fitzpatrick_scale: false, + category: "people" + }, + brain: { + keywords: [ "smart", "intelligent" ], + "char": "\ud83e\udde0", + fitzpatrick_scale: false, + category: "people" + }, + bust_in_silhouette: { + keywords: [ "user", "person", "human" ], + "char": "\ud83d\udc64", + fitzpatrick_scale: false, + category: "people" + }, + busts_in_silhouette: { + keywords: [ "user", "person", "human", "group", "team" ], + "char": "\ud83d\udc65", + fitzpatrick_scale: false, + category: "people" + }, + speaking_head: { + keywords: [ "user", "person", "human", "sing", "say", "talk" ], + "char": "\ud83d\udde3", + fitzpatrick_scale: false, + category: "people" + }, + baby: { + keywords: [ "child", "boy", "girl", "toddler" ], + "char": "\ud83d\udc76", + fitzpatrick_scale: true, + category: "people" + }, + child: { + keywords: [ "gender-neutral", "young" ], + "char": "\ud83e\uddd2", + fitzpatrick_scale: true, + category: "people" + }, + boy: { + keywords: [ "man", "male", "guy", "teenager" ], + "char": "\ud83d\udc66", + fitzpatrick_scale: true, + category: "people" + }, + girl: { + keywords: [ "female", "woman", "teenager" ], + "char": "\ud83d\udc67", + fitzpatrick_scale: true, + category: "people" + }, + adult: { + keywords: [ "gender-neutral", "person" ], + "char": "\ud83e\uddd1", + fitzpatrick_scale: true, + category: "people" + }, + man: { + keywords: [ "mustache", "father", "dad", "guy", "classy", "sir", "moustache" ], + "char": "\ud83d\udc68", + fitzpatrick_scale: true, + category: "people" + }, + woman: { + keywords: [ "female", "girls", "lady" ], + "char": "\ud83d\udc69", + fitzpatrick_scale: true, + category: "people" + }, + blonde_woman: { + keywords: [ "woman", "female", "girl", "blonde", "person" ], + "char": "\ud83d\udc71\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + blonde_man: { + keywords: [ "man", "male", "boy", "blonde", "guy", "person" ], + "char": "\ud83d\udc71", + fitzpatrick_scale: true, + category: "people" + }, + bearded_person: { + keywords: [ "person", "bewhiskered" ], + "char": "\ud83e\uddd4", + fitzpatrick_scale: true, + category: "people" + }, + older_adult: { + keywords: [ "human", "elder", "senior", "gender-neutral" ], + "char": "\ud83e\uddd3", + fitzpatrick_scale: true, + category: "people" + }, + older_man: { + keywords: [ "human", "male", "men", "old", "elder", "senior" ], + "char": "\ud83d\udc74", + fitzpatrick_scale: true, + category: "people" + }, + older_woman: { + keywords: [ "human", "female", "women", "lady", "old", "elder", "senior" ], + "char": "\ud83d\udc75", + fitzpatrick_scale: true, + category: "people" + }, + man_with_gua_pi_mao: { + keywords: [ "male", "boy", "chinese" ], + "char": "\ud83d\udc72", + fitzpatrick_scale: true, + category: "people" + }, + woman_with_headscarf: { + keywords: [ "female", "hijab", "mantilla", "tichel" ], + "char": "\ud83e\uddd5", + fitzpatrick_scale: true, + category: "people" + }, + woman_with_turban: { + keywords: [ "female", "indian", "hinduism", "arabs", "woman" ], + "char": "\ud83d\udc73\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + man_with_turban: { + keywords: [ "male", "indian", "hinduism", "arabs" ], + "char": "\ud83d\udc73", + fitzpatrick_scale: true, + category: "people" + }, + policewoman: { + keywords: [ "woman", "police", "law", "legal", "enforcement", "arrest", "911", "female" ], + "char": "\ud83d\udc6e\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + policeman: { + keywords: [ "man", "police", "law", "legal", "enforcement", "arrest", "911" ], + "char": "\ud83d\udc6e", + fitzpatrick_scale: true, + category: "people" + }, + construction_worker_woman: { + keywords: [ "female", "human", "wip", "build", "construction", "worker", "labor", "woman" ], + "char": "\ud83d\udc77\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + construction_worker_man: { + keywords: [ "male", "human", "wip", "guy", "build", "construction", "worker", "labor" ], + "char": "\ud83d\udc77", + fitzpatrick_scale: true, + category: "people" + }, + guardswoman: { + keywords: [ "uk", "gb", "british", "female", "royal", "woman" ], + "char": "\ud83d\udc82\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + guardsman: { + keywords: [ "uk", "gb", "british", "male", "guy", "royal" ], + "char": "\ud83d\udc82", + fitzpatrick_scale: true, + category: "people" + }, + female_detective: { + keywords: [ "human", "spy", "detective", "female", "woman" ], + "char": "\ud83d\udd75\ufe0f\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + male_detective: { + keywords: [ "human", "spy", "detective" ], + "char": "\ud83d\udd75", + fitzpatrick_scale: true, + category: "people" + }, + woman_health_worker: { + keywords: [ "doctor", "nurse", "therapist", "healthcare", "woman", "human" ], + "char": "\ud83d\udc69\u200d\u2695\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + man_health_worker: { + keywords: [ "doctor", "nurse", "therapist", "healthcare", "man", "human" ], + "char": "\ud83d\udc68\u200d\u2695\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + woman_farmer: { + keywords: [ "rancher", "gardener", "woman", "human" ], + "char": "\ud83d\udc69\u200d\ud83c\udf3e", + fitzpatrick_scale: true, + category: "people" + }, + man_farmer: { + keywords: [ "rancher", "gardener", "man", "human" ], + "char": "\ud83d\udc68\u200d\ud83c\udf3e", + fitzpatrick_scale: true, + category: "people" + }, + woman_cook: { + keywords: [ "chef", "woman", "human" ], + "char": "\ud83d\udc69\u200d\ud83c\udf73", + fitzpatrick_scale: true, + category: "people" + }, + man_cook: { + keywords: [ "chef", "man", "human" ], + "char": "\ud83d\udc68\u200d\ud83c\udf73", + fitzpatrick_scale: true, + category: "people" + }, + woman_student: { + keywords: [ "graduate", "woman", "human" ], + "char": "\ud83d\udc69\u200d\ud83c\udf93", + fitzpatrick_scale: true, + category: "people" + }, + man_student: { + keywords: [ "graduate", "man", "human" ], + "char": "\ud83d\udc68\u200d\ud83c\udf93", + fitzpatrick_scale: true, + category: "people" + }, + woman_singer: { + keywords: [ "rockstar", "entertainer", "woman", "human" ], + "char": "\ud83d\udc69\u200d\ud83c\udfa4", + fitzpatrick_scale: true, + category: "people" + }, + man_singer: { + keywords: [ "rockstar", "entertainer", "man", "human" ], + "char": "\ud83d\udc68\u200d\ud83c\udfa4", + fitzpatrick_scale: true, + category: "people" + }, + woman_teacher: { + keywords: [ "instructor", "professor", "woman", "human" ], + "char": "\ud83d\udc69\u200d\ud83c\udfeb", + fitzpatrick_scale: true, + category: "people" + }, + man_teacher: { + keywords: [ "instructor", "professor", "man", "human" ], + "char": "\ud83d\udc68\u200d\ud83c\udfeb", + fitzpatrick_scale: true, + category: "people" + }, + woman_factory_worker: { + keywords: [ "assembly", "industrial", "woman", "human" ], + "char": "\ud83d\udc69\u200d\ud83c\udfed", + fitzpatrick_scale: true, + category: "people" + }, + man_factory_worker: { + keywords: [ "assembly", "industrial", "man", "human" ], + "char": "\ud83d\udc68\u200d\ud83c\udfed", + fitzpatrick_scale: true, + category: "people" + }, + woman_technologist: { + keywords: [ "coder", "developer", "engineer", "programmer", "software", "woman", "human", "laptop", "computer" ], + "char": "\ud83d\udc69\u200d\ud83d\udcbb", + fitzpatrick_scale: true, + category: "people" + }, + man_technologist: { + keywords: [ "coder", "developer", "engineer", "programmer", "software", "man", "human", "laptop", "computer" ], + "char": "\ud83d\udc68\u200d\ud83d\udcbb", + fitzpatrick_scale: true, + category: "people" + }, + woman_office_worker: { + keywords: [ "business", "manager", "woman", "human" ], + "char": "\ud83d\udc69\u200d\ud83d\udcbc", + fitzpatrick_scale: true, + category: "people" + }, + man_office_worker: { + keywords: [ "business", "manager", "man", "human" ], + "char": "\ud83d\udc68\u200d\ud83d\udcbc", + fitzpatrick_scale: true, + category: "people" + }, + woman_mechanic: { + keywords: [ "plumber", "woman", "human", "wrench" ], + "char": "\ud83d\udc69\u200d\ud83d\udd27", + fitzpatrick_scale: true, + category: "people" + }, + man_mechanic: { + keywords: [ "plumber", "man", "human", "wrench" ], + "char": "\ud83d\udc68\u200d\ud83d\udd27", + fitzpatrick_scale: true, + category: "people" + }, + woman_scientist: { + keywords: [ "biologist", "chemist", "engineer", "physicist", "woman", "human" ], + "char": "\ud83d\udc69\u200d\ud83d\udd2c", + fitzpatrick_scale: true, + category: "people" + }, + man_scientist: { + keywords: [ "biologist", "chemist", "engineer", "physicist", "man", "human" ], + "char": "\ud83d\udc68\u200d\ud83d\udd2c", + fitzpatrick_scale: true, + category: "people" + }, + woman_artist: { + keywords: [ "painter", "woman", "human" ], + "char": "\ud83d\udc69\u200d\ud83c\udfa8", + fitzpatrick_scale: true, + category: "people" + }, + man_artist: { + keywords: [ "painter", "man", "human" ], + "char": "\ud83d\udc68\u200d\ud83c\udfa8", + fitzpatrick_scale: true, + category: "people" + }, + woman_firefighter: { + keywords: [ "fireman", "woman", "human" ], + "char": "\ud83d\udc69\u200d\ud83d\ude92", + fitzpatrick_scale: true, + category: "people" + }, + man_firefighter: { + keywords: [ "fireman", "man", "human" ], + "char": "\ud83d\udc68\u200d\ud83d\ude92", + fitzpatrick_scale: true, + category: "people" + }, + woman_pilot: { + keywords: [ "aviator", "plane", "woman", "human" ], + "char": "\ud83d\udc69\u200d\u2708\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + man_pilot: { + keywords: [ "aviator", "plane", "man", "human" ], + "char": "\ud83d\udc68\u200d\u2708\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + woman_astronaut: { + keywords: [ "space", "rocket", "woman", "human" ], + "char": "\ud83d\udc69\u200d\ud83d\ude80", + fitzpatrick_scale: true, + category: "people" + }, + man_astronaut: { + keywords: [ "space", "rocket", "man", "human" ], + "char": "\ud83d\udc68\u200d\ud83d\ude80", + fitzpatrick_scale: true, + category: "people" + }, + woman_judge: { + keywords: [ "justice", "court", "woman", "human" ], + "char": "\ud83d\udc69\u200d\u2696\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + man_judge: { + keywords: [ "justice", "court", "man", "human" ], + "char": "\ud83d\udc68\u200d\u2696\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + woman_superhero: { + keywords: [ "woman", "female", "good", "heroine", "superpowers" ], + "char": "\ud83e\uddb8\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + man_superhero: { + keywords: [ "man", "male", "good", "hero", "superpowers" ], + "char": "\ud83e\uddb8\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + woman_supervillain: { + keywords: [ "woman", "female", "evil", "bad", "criminal", "heroine", "superpowers" ], + "char": "\ud83e\uddb9\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + man_supervillain: { + keywords: [ "man", "male", "evil", "bad", "criminal", "hero", "superpowers" ], + "char": "\ud83e\uddb9\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + mrs_claus: { + keywords: [ "woman", "female", "xmas", "mother christmas" ], + "char": "\ud83e\udd36", + fitzpatrick_scale: true, + category: "people" + }, + santa: { + keywords: [ "festival", "man", "male", "xmas", "father christmas" ], + "char": "\ud83c\udf85", + fitzpatrick_scale: true, + category: "people" + }, + sorceress: { + keywords: [ "woman", "female", "mage", "witch" ], + "char": "\ud83e\uddd9\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + wizard: { + keywords: [ "man", "male", "mage", "sorcerer" ], + "char": "\ud83e\uddd9\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + woman_elf: { + keywords: [ "woman", "female" ], + "char": "\ud83e\udddd\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + man_elf: { + keywords: [ "man", "male" ], + "char": "\ud83e\udddd\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + woman_vampire: { + keywords: [ "woman", "female" ], + "char": "\ud83e\udddb\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + man_vampire: { + keywords: [ "man", "male", "dracula" ], + "char": "\ud83e\udddb\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + woman_zombie: { + keywords: [ "woman", "female", "undead", "walking dead" ], + "char": "\ud83e\udddf\u200d\u2640\ufe0f", + fitzpatrick_scale: false, + category: "people" + }, + man_zombie: { + keywords: [ "man", "male", "dracula", "undead", "walking dead" ], + "char": "\ud83e\udddf\u200d\u2642\ufe0f", + fitzpatrick_scale: false, + category: "people" + }, + woman_genie: { + keywords: [ "woman", "female" ], + "char": "\ud83e\uddde\u200d\u2640\ufe0f", + fitzpatrick_scale: false, + category: "people" + }, + man_genie: { + keywords: [ "man", "male" ], + "char": "\ud83e\uddde\u200d\u2642\ufe0f", + fitzpatrick_scale: false, + category: "people" + }, + mermaid: { + keywords: [ "woman", "female", "merwoman", "ariel" ], + "char": "\ud83e\udddc\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + merman: { + keywords: [ "man", "male", "triton" ], + "char": "\ud83e\udddc\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + woman_fairy: { + keywords: [ "woman", "female" ], + "char": "\ud83e\uddda\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + man_fairy: { + keywords: [ "man", "male" ], + "char": "\ud83e\uddda\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + angel: { + keywords: [ "heaven", "wings", "halo" ], + "char": "\ud83d\udc7c", + fitzpatrick_scale: true, + category: "people" + }, + pregnant_woman: { + keywords: [ "baby" ], + "char": "\ud83e\udd30", + fitzpatrick_scale: true, + category: "people" + }, + breastfeeding: { + keywords: [ "nursing", "baby" ], + "char": "\ud83e\udd31", + fitzpatrick_scale: true, + category: "people" + }, + princess: { + keywords: [ "girl", "woman", "female", "blond", "crown", "royal", "queen" ], + "char": "\ud83d\udc78", + fitzpatrick_scale: true, + category: "people" + }, + prince: { + keywords: [ "boy", "man", "male", "crown", "royal", "king" ], + "char": "\ud83e\udd34", + fitzpatrick_scale: true, + category: "people" + }, + bride_with_veil: { + keywords: [ "couple", "marriage", "wedding", "woman", "bride" ], + "char": "\ud83d\udc70", + fitzpatrick_scale: true, + category: "people" + }, + man_in_tuxedo: { + keywords: [ "couple", "marriage", "wedding", "groom" ], + "char": "\ud83e\udd35", + fitzpatrick_scale: true, + category: "people" + }, + running_woman: { + keywords: [ "woman", "walking", "exercise", "race", "running", "female" ], + "char": "\ud83c\udfc3\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + running_man: { + keywords: [ "man", "walking", "exercise", "race", "running" ], + "char": "\ud83c\udfc3", + fitzpatrick_scale: true, + category: "people" + }, + walking_woman: { + keywords: [ "human", "feet", "steps", "woman", "female" ], + "char": "\ud83d\udeb6\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + walking_man: { + keywords: [ "human", "feet", "steps" ], + "char": "\ud83d\udeb6", + fitzpatrick_scale: true, + category: "people" + }, + dancer: { + keywords: [ "female", "girl", "woman", "fun" ], + "char": "\ud83d\udc83", + fitzpatrick_scale: true, + category: "people" + }, + man_dancing: { + keywords: [ "male", "boy", "fun", "dancer" ], + "char": "\ud83d\udd7a", + fitzpatrick_scale: true, + category: "people" + }, + dancing_women: { + keywords: [ "female", "bunny", "women", "girls" ], + "char": "\ud83d\udc6f", + fitzpatrick_scale: false, + category: "people" + }, + dancing_men: { + keywords: [ "male", "bunny", "men", "boys" ], + "char": "\ud83d\udc6f\u200d\u2642\ufe0f", + fitzpatrick_scale: false, + category: "people" + }, + couple: { + keywords: [ "pair", "people", "human", "love", "date", "dating", "like", "affection", "valentines", "marriage" ], + "char": "\ud83d\udc6b", + fitzpatrick_scale: false, + category: "people" + }, + two_men_holding_hands: { + keywords: [ "pair", "couple", "love", "like", "bromance", "friendship", "people", "human" ], + "char": "\ud83d\udc6c", + fitzpatrick_scale: false, + category: "people" + }, + two_women_holding_hands: { + keywords: [ "pair", "friendship", "couple", "love", "like", "female", "people", "human" ], + "char": "\ud83d\udc6d", + fitzpatrick_scale: false, + category: "people" + }, + bowing_woman: { + keywords: [ "woman", "female", "girl" ], + "char": "\ud83d\ude47\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + bowing_man: { + keywords: [ "man", "male", "boy" ], + "char": "\ud83d\ude47", + fitzpatrick_scale: true, + category: "people" + }, + man_facepalming: { + keywords: [ "man", "male", "boy", "disbelief" ], + "char": "\ud83e\udd26\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + woman_facepalming: { + keywords: [ "woman", "female", "girl", "disbelief" ], + "char": "\ud83e\udd26\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + woman_shrugging: { + keywords: [ "woman", "female", "girl", "confused", "indifferent", "doubt" ], + "char": "\ud83e\udd37", + fitzpatrick_scale: true, + category: "people" + }, + man_shrugging: { + keywords: [ "man", "male", "boy", "confused", "indifferent", "doubt" ], + "char": "\ud83e\udd37\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + tipping_hand_woman: { + keywords: [ "female", "girl", "woman", "human", "information" ], + "char": "\ud83d\udc81", + fitzpatrick_scale: true, + category: "people" + }, + tipping_hand_man: { + keywords: [ "male", "boy", "man", "human", "information" ], + "char": "\ud83d\udc81\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + no_good_woman: { + keywords: [ "female", "girl", "woman", "nope" ], + "char": "\ud83d\ude45", + fitzpatrick_scale: true, + category: "people" + }, + no_good_man: { + keywords: [ "male", "boy", "man", "nope" ], + "char": "\ud83d\ude45\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + ok_woman: { + keywords: [ "women", "girl", "female", "pink", "human", "woman" ], + "char": "\ud83d\ude46", + fitzpatrick_scale: true, + category: "people" + }, + ok_man: { + keywords: [ "men", "boy", "male", "blue", "human", "man" ], + "char": "\ud83d\ude46\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + raising_hand_woman: { + keywords: [ "female", "girl", "woman" ], + "char": "\ud83d\ude4b", + fitzpatrick_scale: true, + category: "people" + }, + raising_hand_man: { + keywords: [ "male", "boy", "man" ], + "char": "\ud83d\ude4b\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + pouting_woman: { + keywords: [ "female", "girl", "woman" ], + "char": "\ud83d\ude4e", + fitzpatrick_scale: true, + category: "people" + }, + pouting_man: { + keywords: [ "male", "boy", "man" ], + "char": "\ud83d\ude4e\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + frowning_woman: { + keywords: [ "female", "girl", "woman", "sad", "depressed", "discouraged", "unhappy" ], + "char": "\ud83d\ude4d", + fitzpatrick_scale: true, + category: "people" + }, + frowning_man: { + keywords: [ "male", "boy", "man", "sad", "depressed", "discouraged", "unhappy" ], + "char": "\ud83d\ude4d\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + haircut_woman: { + keywords: [ "female", "girl", "woman" ], + "char": "\ud83d\udc87", + fitzpatrick_scale: true, + category: "people" + }, + haircut_man: { + keywords: [ "male", "boy", "man" ], + "char": "\ud83d\udc87\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + massage_woman: { + keywords: [ "female", "girl", "woman", "head" ], + "char": "\ud83d\udc86", + fitzpatrick_scale: true, + category: "people" + }, + massage_man: { + keywords: [ "male", "boy", "man", "head" ], + "char": "\ud83d\udc86\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + woman_in_steamy_room: { + keywords: [ "female", "woman", "spa", "steamroom", "sauna" ], + "char": "\ud83e\uddd6\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + man_in_steamy_room: { + keywords: [ "male", "man", "spa", "steamroom", "sauna" ], + "char": "\ud83e\uddd6\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "people" + }, + couple_with_heart_woman_man: { + keywords: [ "pair", "love", "like", "affection", "human", "dating", "valentines", "marriage" ], + "char": "\ud83d\udc91", + fitzpatrick_scale: false, + category: "people" + }, + couple_with_heart_woman_woman: { + keywords: [ "pair", "love", "like", "affection", "human", "dating", "valentines", "marriage" ], + "char": "\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc69", + fitzpatrick_scale: false, + category: "people" + }, + couple_with_heart_man_man: { + keywords: [ "pair", "love", "like", "affection", "human", "dating", "valentines", "marriage" ], + "char": "\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68", + fitzpatrick_scale: false, + category: "people" + }, + couplekiss_man_woman: { + keywords: [ "pair", "valentines", "love", "like", "dating", "marriage" ], + "char": "\ud83d\udc8f", + fitzpatrick_scale: false, + category: "people" + }, + couplekiss_woman_woman: { + keywords: [ "pair", "valentines", "love", "like", "dating", "marriage" ], + "char": "\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69", + fitzpatrick_scale: false, + category: "people" + }, + couplekiss_man_man: { + keywords: [ "pair", "valentines", "love", "like", "dating", "marriage" ], + "char": "\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68", + fitzpatrick_scale: false, + category: "people" + }, + family_man_woman_boy: { + keywords: [ "home", "parents", "child", "mom", "dad", "father", "mother", "people", "human" ], + "char": "\ud83d\udc6a", + fitzpatrick_scale: false, + category: "people" + }, + family_man_woman_girl: { + keywords: [ "home", "parents", "people", "human", "child" ], + "char": "\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67", + fitzpatrick_scale: false, + category: "people" + }, + family_man_woman_girl_boy: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": "\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc66", + fitzpatrick_scale: false, + category: "people" + }, + family_man_woman_boy_boy: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": "\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66", + fitzpatrick_scale: false, + category: "people" + }, + family_man_woman_girl_girl: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": "\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc67", + fitzpatrick_scale: false, + category: "people" + }, + family_woman_woman_boy: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": "\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66", + fitzpatrick_scale: false, + category: "people" + }, + family_woman_woman_girl: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": "\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67", + fitzpatrick_scale: false, + category: "people" + }, + family_woman_woman_girl_boy: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": "\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc66", + fitzpatrick_scale: false, + category: "people" + }, + family_woman_woman_boy_boy: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": "\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66", + fitzpatrick_scale: false, + category: "people" + }, + family_woman_woman_girl_girl: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": "\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc67", + fitzpatrick_scale: false, + category: "people" + }, + family_man_man_boy: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": "\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66", + fitzpatrick_scale: false, + category: "people" + }, + family_man_man_girl: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": "\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67", + fitzpatrick_scale: false, + category: "people" + }, + family_man_man_girl_boy: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": "\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc66", + fitzpatrick_scale: false, + category: "people" + }, + family_man_man_boy_boy: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": "\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66", + fitzpatrick_scale: false, + category: "people" + }, + family_man_man_girl_girl: { + keywords: [ "home", "parents", "people", "human", "children" ], + "char": "\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc67", + fitzpatrick_scale: false, + category: "people" + }, + family_woman_boy: { + keywords: [ "home", "parent", "people", "human", "child" ], + "char": "\ud83d\udc69\u200d\ud83d\udc66", + fitzpatrick_scale: false, + category: "people" + }, + family_woman_girl: { + keywords: [ "home", "parent", "people", "human", "child" ], + "char": "\ud83d\udc69\u200d\ud83d\udc67", + fitzpatrick_scale: false, + category: "people" + }, + family_woman_girl_boy: { + keywords: [ "home", "parent", "people", "human", "children" ], + "char": "\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc66", + fitzpatrick_scale: false, + category: "people" + }, + family_woman_boy_boy: { + keywords: [ "home", "parent", "people", "human", "children" ], + "char": "\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66", + fitzpatrick_scale: false, + category: "people" + }, + family_woman_girl_girl: { + keywords: [ "home", "parent", "people", "human", "children" ], + "char": "\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d\udc67", + fitzpatrick_scale: false, + category: "people" + }, + family_man_boy: { + keywords: [ "home", "parent", "people", "human", "child" ], + "char": "\ud83d\udc68\u200d\ud83d\udc66", + fitzpatrick_scale: false, + category: "people" + }, + family_man_girl: { + keywords: [ "home", "parent", "people", "human", "child" ], + "char": "\ud83d\udc68\u200d\ud83d\udc67", + fitzpatrick_scale: false, + category: "people" + }, + family_man_girl_boy: { + keywords: [ "home", "parent", "people", "human", "children" ], + "char": "\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc66", + fitzpatrick_scale: false, + category: "people" + }, + family_man_boy_boy: { + keywords: [ "home", "parent", "people", "human", "children" ], + "char": "\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66", + fitzpatrick_scale: false, + category: "people" + }, + family_man_girl_girl: { + keywords: [ "home", "parent", "people", "human", "children" ], + "char": "\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d\udc67", + fitzpatrick_scale: false, + category: "people" + }, + yarn: { + keywords: [ "ball", "crochet", "knit" ], + "char": "\ud83e\uddf6", + fitzpatrick_scale: false, + category: "people" + }, + thread: { + keywords: [ "needle", "sewing", "spool", "string" ], + "char": "\ud83e\uddf5", + fitzpatrick_scale: false, + category: "people" + }, + coat: { + keywords: [ "jacket" ], + "char": "\ud83e\udde5", + fitzpatrick_scale: false, + category: "people" + }, + labcoat: { + keywords: [ "doctor", "experiment", "scientist", "chemist" ], + "char": "\ud83e\udd7c", + fitzpatrick_scale: false, + category: "people" + }, + womans_clothes: { + keywords: [ "fashion", "shopping_bags", "female" ], + "char": "\ud83d\udc5a", + fitzpatrick_scale: false, + category: "people" + }, + tshirt: { + keywords: [ "fashion", "cloth", "casual", "shirt", "tee" ], + "char": "\ud83d\udc55", + fitzpatrick_scale: false, + category: "people" + }, + jeans: { + keywords: [ "fashion", "shopping" ], + "char": "\ud83d\udc56", + fitzpatrick_scale: false, + category: "people" + }, + necktie: { + keywords: [ "shirt", "suitup", "formal", "fashion", "cloth", "business" ], + "char": "\ud83d\udc54", + fitzpatrick_scale: false, + category: "people" + }, + dress: { + keywords: [ "clothes", "fashion", "shopping" ], + "char": "\ud83d\udc57", + fitzpatrick_scale: false, + category: "people" + }, + bikini: { + keywords: [ "swimming", "female", "woman", "girl", "fashion", "beach", "summer" ], + "char": "\ud83d\udc59", + fitzpatrick_scale: false, + category: "people" + }, + kimono: { + keywords: [ "dress", "fashion", "women", "female", "japanese" ], + "char": "\ud83d\udc58", + fitzpatrick_scale: false, + category: "people" + }, + lipstick: { + keywords: [ "female", "girl", "fashion", "woman" ], + "char": "\ud83d\udc84", + fitzpatrick_scale: false, + category: "people" + }, + kiss: { + keywords: [ "face", "lips", "love", "like", "affection", "valentines" ], + "char": "\ud83d\udc8b", + fitzpatrick_scale: false, + category: "people" + }, + footprints: { + keywords: [ "feet", "tracking", "walking", "beach" ], + "char": "\ud83d\udc63", + fitzpatrick_scale: false, + category: "people" + }, + flat_shoe: { + keywords: [ "ballet", "slip-on", "slipper" ], + "char": "\ud83e\udd7f", + fitzpatrick_scale: false, + category: "people" + }, + high_heel: { + keywords: [ "fashion", "shoes", "female", "pumps", "stiletto" ], + "char": "\ud83d\udc60", + fitzpatrick_scale: false, + category: "people" + }, + sandal: { + keywords: [ "shoes", "fashion", "flip flops" ], + "char": "\ud83d\udc61", + fitzpatrick_scale: false, + category: "people" + }, + boot: { + keywords: [ "shoes", "fashion" ], + "char": "\ud83d\udc62", + fitzpatrick_scale: false, + category: "people" + }, + mans_shoe: { + keywords: [ "fashion", "male" ], + "char": "\ud83d\udc5e", + fitzpatrick_scale: false, + category: "people" + }, + athletic_shoe: { + keywords: [ "shoes", "sports", "sneakers" ], + "char": "\ud83d\udc5f", + fitzpatrick_scale: false, + category: "people" + }, + hiking_boot: { + keywords: [ "backpacking", "camping", "hiking" ], + "char": "\ud83e\udd7e", + fitzpatrick_scale: false, + category: "people" + }, + socks: { + keywords: [ "stockings", "clothes" ], + "char": "\ud83e\udde6", + fitzpatrick_scale: false, + category: "people" + }, + gloves: { + keywords: [ "hands", "winter", "clothes" ], + "char": "\ud83e\udde4", + fitzpatrick_scale: false, + category: "people" + }, + scarf: { + keywords: [ "neck", "winter", "clothes" ], + "char": "\ud83e\udde3", + fitzpatrick_scale: false, + category: "people" + }, + womans_hat: { + keywords: [ "fashion", "accessories", "female", "lady", "spring" ], + "char": "\ud83d\udc52", + fitzpatrick_scale: false, + category: "people" + }, + tophat: { + keywords: [ "magic", "gentleman", "classy", "circus" ], + "char": "\ud83c\udfa9", + fitzpatrick_scale: false, + category: "people" + }, + billed_hat: { + keywords: [ "cap", "baseball" ], + "char": "\ud83e\udde2", + fitzpatrick_scale: false, + category: "people" + }, + rescue_worker_helmet: { + keywords: [ "construction", "build" ], + "char": "\u26d1", + fitzpatrick_scale: false, + category: "people" + }, + mortar_board: { + keywords: [ "school", "college", "degree", "university", "graduation", "cap", "hat", "legal", "learn", "education" ], + "char": "\ud83c\udf93", + fitzpatrick_scale: false, + category: "people" + }, + crown: { + keywords: [ "king", "kod", "leader", "royalty", "lord" ], + "char": "\ud83d\udc51", + fitzpatrick_scale: false, + category: "people" + }, + school_satchel: { + keywords: [ "student", "education", "bag", "backpack" ], + "char": "\ud83c\udf92", + fitzpatrick_scale: false, + category: "people" + }, + luggage: { + keywords: [ "packing", "travel" ], + "char": "\ud83e\uddf3", + fitzpatrick_scale: false, + category: "people" + }, + pouch: { + keywords: [ "bag", "accessories", "shopping" ], + "char": "\ud83d\udc5d", + fitzpatrick_scale: false, + category: "people" + }, + purse: { + keywords: [ "fashion", "accessories", "money", "sales", "shopping" ], + "char": "\ud83d\udc5b", + fitzpatrick_scale: false, + category: "people" + }, + handbag: { + keywords: [ "fashion", "accessory", "accessories", "shopping" ], + "char": "\ud83d\udc5c", + fitzpatrick_scale: false, + category: "people" + }, + briefcase: { + keywords: [ "business", "documents", "work", "law", "legal", "job", "career" ], + "char": "\ud83d\udcbc", + fitzpatrick_scale: false, + category: "people" + }, + eyeglasses: { + keywords: [ "fashion", "accessories", "eyesight", "nerdy", "dork", "geek" ], + "char": "\ud83d\udc53", + fitzpatrick_scale: false, + category: "people" + }, + dark_sunglasses: { + keywords: [ "face", "cool", "accessories" ], + "char": "\ud83d\udd76", + fitzpatrick_scale: false, + category: "people" + }, + goggles: { + keywords: [ "eyes", "protection", "safety" ], + "char": "\ud83e\udd7d", + fitzpatrick_scale: false, + category: "people" + }, + ring: { + keywords: [ "wedding", "propose", "marriage", "valentines", "diamond", "fashion", "jewelry", "gem", "engagement" ], + "char": "\ud83d\udc8d", + fitzpatrick_scale: false, + category: "people" + }, + closed_umbrella: { + keywords: [ "weather", "rain", "drizzle" ], + "char": "\ud83c\udf02", + fitzpatrick_scale: false, + category: "people" + }, + dog: { + keywords: [ "animal", "friend", "nature", "woof", "puppy", "pet", "faithful" ], + "char": "\ud83d\udc36", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cat: { + keywords: [ "animal", "meow", "nature", "pet", "kitten" ], + "char": "\ud83d\udc31", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + mouse: { + keywords: [ "animal", "nature", "cheese_wedge", "rodent" ], + "char": "\ud83d\udc2d", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + hamster: { + keywords: [ "animal", "nature" ], + "char": "\ud83d\udc39", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + rabbit: { + keywords: [ "animal", "nature", "pet", "spring", "magic", "bunny" ], + "char": "\ud83d\udc30", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + fox_face: { + keywords: [ "animal", "nature", "face" ], + "char": "\ud83e\udd8a", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + bear: { + keywords: [ "animal", "nature", "wild" ], + "char": "\ud83d\udc3b", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + panda_face: { + keywords: [ "animal", "nature", "panda" ], + "char": "\ud83d\udc3c", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + koala: { + keywords: [ "animal", "nature" ], + "char": "\ud83d\udc28", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + tiger: { + keywords: [ "animal", "cat", "danger", "wild", "nature", "roar" ], + "char": "\ud83d\udc2f", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + lion: { + keywords: [ "animal", "nature" ], + "char": "\ud83e\udd81", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cow: { + keywords: [ "beef", "ox", "animal", "nature", "moo", "milk" ], + "char": "\ud83d\udc2e", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + pig: { + keywords: [ "animal", "oink", "nature" ], + "char": "\ud83d\udc37", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + pig_nose: { + keywords: [ "animal", "oink" ], + "char": "\ud83d\udc3d", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + frog: { + keywords: [ "animal", "nature", "croak", "toad" ], + "char": "\ud83d\udc38", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + squid: { + keywords: [ "animal", "nature", "ocean", "sea" ], + "char": "\ud83e\udd91", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + octopus: { + keywords: [ "animal", "creature", "ocean", "sea", "nature", "beach" ], + "char": "\ud83d\udc19", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + shrimp: { + keywords: [ "animal", "ocean", "nature", "seafood" ], + "char": "\ud83e\udd90", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + monkey_face: { + keywords: [ "animal", "nature", "circus" ], + "char": "\ud83d\udc35", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + gorilla: { + keywords: [ "animal", "nature", "circus" ], + "char": "\ud83e\udd8d", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + see_no_evil: { + keywords: [ "monkey", "animal", "nature", "haha" ], + "char": "\ud83d\ude48", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + hear_no_evil: { + keywords: [ "animal", "monkey", "nature" ], + "char": "\ud83d\ude49", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + speak_no_evil: { + keywords: [ "monkey", "animal", "nature", "omg" ], + "char": "\ud83d\ude4a", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + monkey: { + keywords: [ "animal", "nature", "banana", "circus" ], + "char": "\ud83d\udc12", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + chicken: { + keywords: [ "animal", "cluck", "nature", "bird" ], + "char": "\ud83d\udc14", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + penguin: { + keywords: [ "animal", "nature" ], + "char": "\ud83d\udc27", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + bird: { + keywords: [ "animal", "nature", "fly", "tweet", "spring" ], + "char": "\ud83d\udc26", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + baby_chick: { + keywords: [ "animal", "chicken", "bird" ], + "char": "\ud83d\udc24", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + hatching_chick: { + keywords: [ "animal", "chicken", "egg", "born", "baby", "bird" ], + "char": "\ud83d\udc23", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + hatched_chick: { + keywords: [ "animal", "chicken", "baby", "bird" ], + "char": "\ud83d\udc25", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + duck: { + keywords: [ "animal", "nature", "bird", "mallard" ], + "char": "\ud83e\udd86", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + eagle: { + keywords: [ "animal", "nature", "bird" ], + "char": "\ud83e\udd85", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + owl: { + keywords: [ "animal", "nature", "bird", "hoot" ], + "char": "\ud83e\udd89", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + bat: { + keywords: [ "animal", "nature", "blind", "vampire" ], + "char": "\ud83e\udd87", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + wolf: { + keywords: [ "animal", "nature", "wild" ], + "char": "\ud83d\udc3a", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + boar: { + keywords: [ "animal", "nature" ], + "char": "\ud83d\udc17", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + horse: { + keywords: [ "animal", "brown", "nature" ], + "char": "\ud83d\udc34", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + unicorn: { + keywords: [ "animal", "nature", "mystical" ], + "char": "\ud83e\udd84", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + honeybee: { + keywords: [ "animal", "insect", "nature", "bug", "spring", "honey" ], + "char": "\ud83d\udc1d", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + bug: { + keywords: [ "animal", "insect", "nature", "worm" ], + "char": "\ud83d\udc1b", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + butterfly: { + keywords: [ "animal", "insect", "nature", "caterpillar" ], + "char": "\ud83e\udd8b", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + snail: { + keywords: [ "slow", "animal", "shell" ], + "char": "\ud83d\udc0c", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + beetle: { + keywords: [ "animal", "insect", "nature", "ladybug" ], + "char": "\ud83d\udc1e", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + ant: { + keywords: [ "animal", "insect", "nature", "bug" ], + "char": "\ud83d\udc1c", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + grasshopper: { + keywords: [ "animal", "cricket", "chirp" ], + "char": "\ud83e\udd97", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + spider: { + keywords: [ "animal", "arachnid" ], + "char": "\ud83d\udd77", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + scorpion: { + keywords: [ "animal", "arachnid" ], + "char": "\ud83e\udd82", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + crab: { + keywords: [ "animal", "crustacean" ], + "char": "\ud83e\udd80", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + snake: { + keywords: [ "animal", "evil", "nature", "hiss", "python" ], + "char": "\ud83d\udc0d", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + lizard: { + keywords: [ "animal", "nature", "reptile" ], + "char": "\ud83e\udd8e", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + "t-rex": { + keywords: [ "animal", "nature", "dinosaur", "tyrannosaurus", "extinct" ], + "char": "\ud83e\udd96", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sauropod: { + keywords: [ "animal", "nature", "dinosaur", "brachiosaurus", "brontosaurus", "diplodocus", "extinct" ], + "char": "\ud83e\udd95", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + turtle: { + keywords: [ "animal", "slow", "nature", "tortoise" ], + "char": "\ud83d\udc22", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + tropical_fish: { + keywords: [ "animal", "swim", "ocean", "beach", "nemo" ], + "char": "\ud83d\udc20", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + fish: { + keywords: [ "animal", "food", "nature" ], + "char": "\ud83d\udc1f", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + blowfish: { + keywords: [ "animal", "nature", "food", "sea", "ocean" ], + "char": "\ud83d\udc21", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + dolphin: { + keywords: [ "animal", "nature", "fish", "sea", "ocean", "flipper", "fins", "beach" ], + "char": "\ud83d\udc2c", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + shark: { + keywords: [ "animal", "nature", "fish", "sea", "ocean", "jaws", "fins", "beach" ], + "char": "\ud83e\udd88", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + whale: { + keywords: [ "animal", "nature", "sea", "ocean" ], + "char": "\ud83d\udc33", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + whale2: { + keywords: [ "animal", "nature", "sea", "ocean" ], + "char": "\ud83d\udc0b", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + crocodile: { + keywords: [ "animal", "nature", "reptile", "lizard", "alligator" ], + "char": "\ud83d\udc0a", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + leopard: { + keywords: [ "animal", "nature" ], + "char": "\ud83d\udc06", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + zebra: { + keywords: [ "animal", "nature", "stripes", "safari" ], + "char": "\ud83e\udd93", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + tiger2: { + keywords: [ "animal", "nature", "roar" ], + "char": "\ud83d\udc05", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + water_buffalo: { + keywords: [ "animal", "nature", "ox", "cow" ], + "char": "\ud83d\udc03", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + ox: { + keywords: [ "animal", "cow", "beef" ], + "char": "\ud83d\udc02", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cow2: { + keywords: [ "beef", "ox", "animal", "nature", "moo", "milk" ], + "char": "\ud83d\udc04", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + deer: { + keywords: [ "animal", "nature", "horns", "venison" ], + "char": "\ud83e\udd8c", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + dromedary_camel: { + keywords: [ "animal", "hot", "desert", "hump" ], + "char": "\ud83d\udc2a", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + camel: { + keywords: [ "animal", "nature", "hot", "desert", "hump" ], + "char": "\ud83d\udc2b", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + giraffe: { + keywords: [ "animal", "nature", "spots", "safari" ], + "char": "\ud83e\udd92", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + elephant: { + keywords: [ "animal", "nature", "nose", "th", "circus" ], + "char": "\ud83d\udc18", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + rhinoceros: { + keywords: [ "animal", "nature", "horn" ], + "char": "\ud83e\udd8f", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + goat: { + keywords: [ "animal", "nature" ], + "char": "\ud83d\udc10", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + ram: { + keywords: [ "animal", "sheep", "nature" ], + "char": "\ud83d\udc0f", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sheep: { + keywords: [ "animal", "nature", "wool", "shipit" ], + "char": "\ud83d\udc11", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + racehorse: { + keywords: [ "animal", "gamble", "luck" ], + "char": "\ud83d\udc0e", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + pig2: { + keywords: [ "animal", "nature" ], + "char": "\ud83d\udc16", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + rat: { + keywords: [ "animal", "mouse", "rodent" ], + "char": "\ud83d\udc00", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + mouse2: { + keywords: [ "animal", "nature", "rodent" ], + "char": "\ud83d\udc01", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + rooster: { + keywords: [ "animal", "nature", "chicken" ], + "char": "\ud83d\udc13", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + turkey: { + keywords: [ "animal", "bird" ], + "char": "\ud83e\udd83", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + dove: { + keywords: [ "animal", "bird" ], + "char": "\ud83d\udd4a", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + dog2: { + keywords: [ "animal", "nature", "friend", "doge", "pet", "faithful" ], + "char": "\ud83d\udc15", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + poodle: { + keywords: [ "dog", "animal", "101", "nature", "pet" ], + "char": "\ud83d\udc29", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cat2: { + keywords: [ "animal", "meow", "pet", "cats" ], + "char": "\ud83d\udc08", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + rabbit2: { + keywords: [ "animal", "nature", "pet", "magic", "spring" ], + "char": "\ud83d\udc07", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + chipmunk: { + keywords: [ "animal", "nature", "rodent", "squirrel" ], + "char": "\ud83d\udc3f", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + hedgehog: { + keywords: [ "animal", "nature", "spiny" ], + "char": "\ud83e\udd94", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + raccoon: { + keywords: [ "animal", "nature" ], + "char": "\ud83e\udd9d", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + llama: { + keywords: [ "animal", "nature", "alpaca" ], + "char": "\ud83e\udd99", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + hippopotamus: { + keywords: [ "animal", "nature" ], + "char": "\ud83e\udd9b", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + kangaroo: { + keywords: [ "animal", "nature", "australia", "joey", "hop", "marsupial" ], + "char": "\ud83e\udd98", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + badger: { + keywords: [ "animal", "nature", "honey" ], + "char": "\ud83e\udda1", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + swan: { + keywords: [ "animal", "nature", "bird" ], + "char": "\ud83e\udda2", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + peacock: { + keywords: [ "animal", "nature", "peahen", "bird" ], + "char": "\ud83e\udd9a", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + parrot: { + keywords: [ "animal", "nature", "bird", "pirate", "talk" ], + "char": "\ud83e\udd9c", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + lobster: { + keywords: [ "animal", "nature", "bisque", "claws", "seafood" ], + "char": "\ud83e\udd9e", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + mosquito: { + keywords: [ "animal", "nature", "insect", "malaria" ], + "char": "\ud83e\udd9f", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + paw_prints: { + keywords: [ "animal", "tracking", "footprints", "dog", "cat", "pet", "feet" ], + "char": "\ud83d\udc3e", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + dragon: { + keywords: [ "animal", "myth", "nature", "chinese", "green" ], + "char": "\ud83d\udc09", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + dragon_face: { + keywords: [ "animal", "myth", "nature", "chinese", "green" ], + "char": "\ud83d\udc32", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cactus: { + keywords: [ "vegetable", "plant", "nature" ], + "char": "\ud83c\udf35", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + christmas_tree: { + keywords: [ "festival", "vacation", "december", "xmas", "celebration" ], + "char": "\ud83c\udf84", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + evergreen_tree: { + keywords: [ "plant", "nature" ], + "char": "\ud83c\udf32", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + deciduous_tree: { + keywords: [ "plant", "nature" ], + "char": "\ud83c\udf33", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + palm_tree: { + keywords: [ "plant", "vegetable", "nature", "summer", "beach", "mojito", "tropical" ], + "char": "\ud83c\udf34", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + seedling: { + keywords: [ "plant", "nature", "grass", "lawn", "spring" ], + "char": "\ud83c\udf31", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + herb: { + keywords: [ "vegetable", "plant", "medicine", "weed", "grass", "lawn" ], + "char": "\ud83c\udf3f", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + shamrock: { + keywords: [ "vegetable", "plant", "nature", "irish", "clover" ], + "char": "\u2618", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + four_leaf_clover: { + keywords: [ "vegetable", "plant", "nature", "lucky", "irish" ], + "char": "\ud83c\udf40", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + bamboo: { + keywords: [ "plant", "nature", "vegetable", "panda", "pine_decoration" ], + "char": "\ud83c\udf8d", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + tanabata_tree: { + keywords: [ "plant", "nature", "branch", "summer" ], + "char": "\ud83c\udf8b", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + leaves: { + keywords: [ "nature", "plant", "tree", "vegetable", "grass", "lawn", "spring" ], + "char": "\ud83c\udf43", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + fallen_leaf: { + keywords: [ "nature", "plant", "vegetable", "leaves" ], + "char": "\ud83c\udf42", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + maple_leaf: { + keywords: [ "nature", "plant", "vegetable", "ca", "fall" ], + "char": "\ud83c\udf41", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + ear_of_rice: { + keywords: [ "nature", "plant" ], + "char": "\ud83c\udf3e", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + hibiscus: { + keywords: [ "plant", "vegetable", "flowers", "beach" ], + "char": "\ud83c\udf3a", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sunflower: { + keywords: [ "nature", "plant", "fall" ], + "char": "\ud83c\udf3b", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + rose: { + keywords: [ "flowers", "valentines", "love", "spring" ], + "char": "\ud83c\udf39", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + wilted_flower: { + keywords: [ "plant", "nature", "flower" ], + "char": "\ud83e\udd40", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + tulip: { + keywords: [ "flowers", "plant", "nature", "summer", "spring" ], + "char": "\ud83c\udf37", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + blossom: { + keywords: [ "nature", "flowers", "yellow" ], + "char": "\ud83c\udf3c", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cherry_blossom: { + keywords: [ "nature", "plant", "spring", "flower" ], + "char": "\ud83c\udf38", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + bouquet: { + keywords: [ "flowers", "nature", "spring" ], + "char": "\ud83d\udc90", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + mushroom: { + keywords: [ "plant", "vegetable" ], + "char": "\ud83c\udf44", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + chestnut: { + keywords: [ "food", "squirrel" ], + "char": "\ud83c\udf30", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + jack_o_lantern: { + keywords: [ "halloween", "light", "pumpkin", "creepy", "fall" ], + "char": "\ud83c\udf83", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + shell: { + keywords: [ "nature", "sea", "beach" ], + "char": "\ud83d\udc1a", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + spider_web: { + keywords: [ "animal", "insect", "arachnid", "silk" ], + "char": "\ud83d\udd78", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + earth_americas: { + keywords: [ "globe", "world", "USA", "international" ], + "char": "\ud83c\udf0e", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + earth_africa: { + keywords: [ "globe", "world", "international" ], + "char": "\ud83c\udf0d", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + earth_asia: { + keywords: [ "globe", "world", "east", "international" ], + "char": "\ud83c\udf0f", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + full_moon: { + keywords: [ "nature", "yellow", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": "\ud83c\udf15", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + waning_gibbous_moon: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep", "waxing_gibbous_moon" ], + "char": "\ud83c\udf16", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + last_quarter_moon: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": "\ud83c\udf17", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + waning_crescent_moon: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": "\ud83c\udf18", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + new_moon: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": "\ud83c\udf11", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + waxing_crescent_moon: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": "\ud83c\udf12", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + first_quarter_moon: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": "\ud83c\udf13", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + waxing_gibbous_moon: { + keywords: [ "nature", "night", "sky", "gray", "twilight", "planet", "space", "evening", "sleep" ], + "char": "\ud83c\udf14", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + new_moon_with_face: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": "\ud83c\udf1a", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + full_moon_with_face: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": "\ud83c\udf1d", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + first_quarter_moon_with_face: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": "\ud83c\udf1b", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + last_quarter_moon_with_face: { + keywords: [ "nature", "twilight", "planet", "space", "night", "evening", "sleep" ], + "char": "\ud83c\udf1c", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sun_with_face: { + keywords: [ "nature", "morning", "sky" ], + "char": "\ud83c\udf1e", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + crescent_moon: { + keywords: [ "night", "sleep", "sky", "evening", "magic" ], + "char": "\ud83c\udf19", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + star: { + keywords: [ "night", "yellow" ], + "char": "\u2b50", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + star2: { + keywords: [ "night", "sparkle", "awesome", "good", "magic" ], + "char": "\ud83c\udf1f", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + dizzy: { + keywords: [ "star", "sparkle", "shoot", "magic" ], + "char": "\ud83d\udcab", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sparkles: { + keywords: [ "stars", "shine", "shiny", "cool", "awesome", "good", "magic" ], + "char": "\u2728", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + comet: { + keywords: [ "space" ], + "char": "\u2604", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sunny: { + keywords: [ "weather", "nature", "brightness", "summer", "beach", "spring" ], + "char": "\u2600\ufe0f", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sun_behind_small_cloud: { + keywords: [ "weather" ], + "char": "\ud83c\udf24", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + partly_sunny: { + keywords: [ "weather", "nature", "cloudy", "morning", "fall", "spring" ], + "char": "\u26c5", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sun_behind_large_cloud: { + keywords: [ "weather" ], + "char": "\ud83c\udf25", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sun_behind_rain_cloud: { + keywords: [ "weather" ], + "char": "\ud83c\udf26", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cloud: { + keywords: [ "weather", "sky" ], + "char": "\u2601\ufe0f", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cloud_with_rain: { + keywords: [ "weather" ], + "char": "\ud83c\udf27", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cloud_with_lightning_and_rain: { + keywords: [ "weather", "lightning" ], + "char": "\u26c8", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cloud_with_lightning: { + keywords: [ "weather", "thunder" ], + "char": "\ud83c\udf29", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + zap: { + keywords: [ "thunder", "weather", "lightning bolt", "fast" ], + "char": "\u26a1", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + fire: { + keywords: [ "hot", "cook", "flame" ], + "char": "\ud83d\udd25", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + boom: { + keywords: [ "bomb", "explode", "explosion", "collision", "blown" ], + "char": "\ud83d\udca5", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + snowflake: { + keywords: [ "winter", "season", "cold", "weather", "christmas", "xmas" ], + "char": "\u2744\ufe0f", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + cloud_with_snow: { + keywords: [ "weather" ], + "char": "\ud83c\udf28", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + snowman: { + keywords: [ "winter", "season", "cold", "weather", "christmas", "xmas", "frozen", "without_snow" ], + "char": "\u26c4", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + snowman_with_snow: { + keywords: [ "winter", "season", "cold", "weather", "christmas", "xmas", "frozen" ], + "char": "\u2603", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + wind_face: { + keywords: [ "gust", "air" ], + "char": "\ud83c\udf2c", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + dash: { + keywords: [ "wind", "air", "fast", "shoo", "fart", "smoke", "puff" ], + "char": "\ud83d\udca8", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + tornado: { + keywords: [ "weather", "cyclone", "twister" ], + "char": "\ud83c\udf2a", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + fog: { + keywords: [ "weather" ], + "char": "\ud83c\udf2b", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + open_umbrella: { + keywords: [ "weather", "spring" ], + "char": "\u2602", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + umbrella: { + keywords: [ "rainy", "weather", "spring" ], + "char": "\u2614", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + droplet: { + keywords: [ "water", "drip", "faucet", "spring" ], + "char": "\ud83d\udca7", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + sweat_drops: { + keywords: [ "water", "drip", "oops" ], + "char": "\ud83d\udca6", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + ocean: { + keywords: [ "sea", "water", "wave", "nature", "tsunami", "disaster" ], + "char": "\ud83c\udf0a", + fitzpatrick_scale: false, + category: "animals_and_nature" + }, + green_apple: { + keywords: [ "fruit", "nature" ], + "char": "\ud83c\udf4f", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + apple: { + keywords: [ "fruit", "mac", "school" ], + "char": "\ud83c\udf4e", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + pear: { + keywords: [ "fruit", "nature", "food" ], + "char": "\ud83c\udf50", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + tangerine: { + keywords: [ "food", "fruit", "nature", "orange" ], + "char": "\ud83c\udf4a", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + lemon: { + keywords: [ "fruit", "nature" ], + "char": "\ud83c\udf4b", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + banana: { + keywords: [ "fruit", "food", "monkey" ], + "char": "\ud83c\udf4c", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + watermelon: { + keywords: [ "fruit", "food", "picnic", "summer" ], + "char": "\ud83c\udf49", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + grapes: { + keywords: [ "fruit", "food", "wine" ], + "char": "\ud83c\udf47", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + strawberry: { + keywords: [ "fruit", "food", "nature" ], + "char": "\ud83c\udf53", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + melon: { + keywords: [ "fruit", "nature", "food" ], + "char": "\ud83c\udf48", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + cherries: { + keywords: [ "food", "fruit" ], + "char": "\ud83c\udf52", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + peach: { + keywords: [ "fruit", "nature", "food" ], + "char": "\ud83c\udf51", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + pineapple: { + keywords: [ "fruit", "nature", "food" ], + "char": "\ud83c\udf4d", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + coconut: { + keywords: [ "fruit", "nature", "food", "palm" ], + "char": "\ud83e\udd65", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + kiwi_fruit: { + keywords: [ "fruit", "food" ], + "char": "\ud83e\udd5d", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + mango: { + keywords: [ "fruit", "food", "tropical" ], + "char": "\ud83e\udd6d", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + avocado: { + keywords: [ "fruit", "food" ], + "char": "\ud83e\udd51", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + broccoli: { + keywords: [ "fruit", "food", "vegetable" ], + "char": "\ud83e\udd66", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + tomato: { + keywords: [ "fruit", "vegetable", "nature", "food" ], + "char": "\ud83c\udf45", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + eggplant: { + keywords: [ "vegetable", "nature", "food", "aubergine" ], + "char": "\ud83c\udf46", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + cucumber: { + keywords: [ "fruit", "food", "pickle" ], + "char": "\ud83e\udd52", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + carrot: { + keywords: [ "vegetable", "food", "orange" ], + "char": "\ud83e\udd55", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + hot_pepper: { + keywords: [ "food", "spicy", "chilli", "chili" ], + "char": "\ud83c\udf36", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + potato: { + keywords: [ "food", "tuber", "vegatable", "starch" ], + "char": "\ud83e\udd54", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + corn: { + keywords: [ "food", "vegetable", "plant" ], + "char": "\ud83c\udf3d", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + leafy_greens: { + keywords: [ "food", "vegetable", "plant", "bok choy", "cabbage", "kale", "lettuce" ], + "char": "\ud83e\udd6c", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + sweet_potato: { + keywords: [ "food", "nature" ], + "char": "\ud83c\udf60", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + peanuts: { + keywords: [ "food", "nut" ], + "char": "\ud83e\udd5c", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + honey_pot: { + keywords: [ "bees", "sweet", "kitchen" ], + "char": "\ud83c\udf6f", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + croissant: { + keywords: [ "food", "bread", "french" ], + "char": "\ud83e\udd50", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + bread: { + keywords: [ "food", "wheat", "breakfast", "toast" ], + "char": "\ud83c\udf5e", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + baguette_bread: { + keywords: [ "food", "bread", "french" ], + "char": "\ud83e\udd56", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + bagel: { + keywords: [ "food", "bread", "bakery", "schmear" ], + "char": "\ud83e\udd6f", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + pretzel: { + keywords: [ "food", "bread", "twisted" ], + "char": "\ud83e\udd68", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + cheese: { + keywords: [ "food", "chadder" ], + "char": "\ud83e\uddc0", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + egg: { + keywords: [ "food", "chicken", "breakfast" ], + "char": "\ud83e\udd5a", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + bacon: { + keywords: [ "food", "breakfast", "pork", "pig", "meat" ], + "char": "\ud83e\udd53", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + steak: { + keywords: [ "food", "cow", "meat", "cut", "chop", "lambchop", "porkchop" ], + "char": "\ud83e\udd69", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + pancakes: { + keywords: [ "food", "breakfast", "flapjacks", "hotcakes" ], + "char": "\ud83e\udd5e", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + poultry_leg: { + keywords: [ "food", "meat", "drumstick", "bird", "chicken", "turkey" ], + "char": "\ud83c\udf57", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + meat_on_bone: { + keywords: [ "good", "food", "drumstick" ], + "char": "\ud83c\udf56", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + bone: { + keywords: [ "skeleton" ], + "char": "\ud83e\uddb4", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + fried_shrimp: { + keywords: [ "food", "animal", "appetizer", "summer" ], + "char": "\ud83c\udf64", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + fried_egg: { + keywords: [ "food", "breakfast", "kitchen", "egg" ], + "char": "\ud83c\udf73", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + hamburger: { + keywords: [ "meat", "fast food", "beef", "cheeseburger", "mcdonalds", "burger king" ], + "char": "\ud83c\udf54", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + fries: { + keywords: [ "chips", "snack", "fast food" ], + "char": "\ud83c\udf5f", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + stuffed_flatbread: { + keywords: [ "food", "flatbread", "stuffed", "gyro" ], + "char": "\ud83e\udd59", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + hotdog: { + keywords: [ "food", "frankfurter" ], + "char": "\ud83c\udf2d", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + pizza: { + keywords: [ "food", "party" ], + "char": "\ud83c\udf55", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + sandwich: { + keywords: [ "food", "lunch", "bread" ], + "char": "\ud83e\udd6a", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + canned_food: { + keywords: [ "food", "soup" ], + "char": "\ud83e\udd6b", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + spaghetti: { + keywords: [ "food", "italian", "noodle" ], + "char": "\ud83c\udf5d", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + taco: { + keywords: [ "food", "mexican" ], + "char": "\ud83c\udf2e", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + burrito: { + keywords: [ "food", "mexican" ], + "char": "\ud83c\udf2f", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + green_salad: { + keywords: [ "food", "healthy", "lettuce" ], + "char": "\ud83e\udd57", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + shallow_pan_of_food: { + keywords: [ "food", "cooking", "casserole", "paella" ], + "char": "\ud83e\udd58", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + ramen: { + keywords: [ "food", "japanese", "noodle", "chopsticks" ], + "char": "\ud83c\udf5c", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + stew: { + keywords: [ "food", "meat", "soup" ], + "char": "\ud83c\udf72", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + fish_cake: { + keywords: [ "food", "japan", "sea", "beach", "narutomaki", "pink", "swirl", "kamaboko", "surimi", "ramen" ], + "char": "\ud83c\udf65", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + fortune_cookie: { + keywords: [ "food", "prophecy" ], + "char": "\ud83e\udd60", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + sushi: { + keywords: [ "food", "fish", "japanese", "rice" ], + "char": "\ud83c\udf63", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + bento: { + keywords: [ "food", "japanese", "box" ], + "char": "\ud83c\udf71", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + curry: { + keywords: [ "food", "spicy", "hot", "indian" ], + "char": "\ud83c\udf5b", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + rice_ball: { + keywords: [ "food", "japanese" ], + "char": "\ud83c\udf59", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + rice: { + keywords: [ "food", "china", "asian" ], + "char": "\ud83c\udf5a", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + rice_cracker: { + keywords: [ "food", "japanese" ], + "char": "\ud83c\udf58", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + oden: { + keywords: [ "food", "japanese" ], + "char": "\ud83c\udf62", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + dango: { + keywords: [ "food", "dessert", "sweet", "japanese", "barbecue", "meat" ], + "char": "\ud83c\udf61", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + shaved_ice: { + keywords: [ "hot", "dessert", "summer" ], + "char": "\ud83c\udf67", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + ice_cream: { + keywords: [ "food", "hot", "dessert" ], + "char": "\ud83c\udf68", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + icecream: { + keywords: [ "food", "hot", "dessert", "summer" ], + "char": "\ud83c\udf66", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + pie: { + keywords: [ "food", "dessert", "pastry" ], + "char": "\ud83e\udd67", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + cake: { + keywords: [ "food", "dessert" ], + "char": "\ud83c\udf70", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + cupcake: { + keywords: [ "food", "dessert", "bakery", "sweet" ], + "char": "\ud83e\uddc1", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + moon_cake: { + keywords: [ "food", "autumn" ], + "char": "\ud83e\udd6e", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + birthday: { + keywords: [ "food", "dessert", "cake" ], + "char": "\ud83c\udf82", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + custard: { + keywords: [ "dessert", "food" ], + "char": "\ud83c\udf6e", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + candy: { + keywords: [ "snack", "dessert", "sweet", "lolly" ], + "char": "\ud83c\udf6c", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + lollipop: { + keywords: [ "food", "snack", "candy", "sweet" ], + "char": "\ud83c\udf6d", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + chocolate_bar: { + keywords: [ "food", "snack", "dessert", "sweet" ], + "char": "\ud83c\udf6b", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + popcorn: { + keywords: [ "food", "movie theater", "films", "snack" ], + "char": "\ud83c\udf7f", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + dumpling: { + keywords: [ "food", "empanada", "pierogi", "potsticker" ], + "char": "\ud83e\udd5f", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + doughnut: { + keywords: [ "food", "dessert", "snack", "sweet", "donut" ], + "char": "\ud83c\udf69", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + cookie: { + keywords: [ "food", "snack", "oreo", "chocolate", "sweet", "dessert" ], + "char": "\ud83c\udf6a", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + milk_glass: { + keywords: [ "beverage", "drink", "cow" ], + "char": "\ud83e\udd5b", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + beer: { + keywords: [ "relax", "beverage", "drink", "drunk", "party", "pub", "summer", "alcohol", "booze" ], + "char": "\ud83c\udf7a", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + beers: { + keywords: [ "relax", "beverage", "drink", "drunk", "party", "pub", "summer", "alcohol", "booze" ], + "char": "\ud83c\udf7b", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + clinking_glasses: { + keywords: [ "beverage", "drink", "party", "alcohol", "celebrate", "cheers", "wine", "champagne", "toast" ], + "char": "\ud83e\udd42", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + wine_glass: { + keywords: [ "drink", "beverage", "drunk", "alcohol", "booze" ], + "char": "\ud83c\udf77", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + tumbler_glass: { + keywords: [ "drink", "beverage", "drunk", "alcohol", "liquor", "booze", "bourbon", "scotch", "whisky", "glass", "shot" ], + "char": "\ud83e\udd43", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + cocktail: { + keywords: [ "drink", "drunk", "alcohol", "beverage", "booze", "mojito" ], + "char": "\ud83c\udf78", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + tropical_drink: { + keywords: [ "beverage", "cocktail", "summer", "beach", "alcohol", "booze", "mojito" ], + "char": "\ud83c\udf79", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + champagne: { + keywords: [ "drink", "wine", "bottle", "celebration" ], + "char": "\ud83c\udf7e", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + sake: { + keywords: [ "wine", "drink", "drunk", "beverage", "japanese", "alcohol", "booze" ], + "char": "\ud83c\udf76", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + tea: { + keywords: [ "drink", "bowl", "breakfast", "green", "british" ], + "char": "\ud83c\udf75", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + cup_with_straw: { + keywords: [ "drink", "soda" ], + "char": "\ud83e\udd64", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + coffee: { + keywords: [ "beverage", "caffeine", "latte", "espresso" ], + "char": "\u2615", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + baby_bottle: { + keywords: [ "food", "container", "milk" ], + "char": "\ud83c\udf7c", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + salt: { + keywords: [ "condiment", "shaker" ], + "char": "\ud83e\uddc2", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + spoon: { + keywords: [ "cutlery", "kitchen", "tableware" ], + "char": "\ud83e\udd44", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + fork_and_knife: { + keywords: [ "cutlery", "kitchen" ], + "char": "\ud83c\udf74", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + plate_with_cutlery: { + keywords: [ "food", "eat", "meal", "lunch", "dinner", "restaurant" ], + "char": "\ud83c\udf7d", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + bowl_with_spoon: { + keywords: [ "food", "breakfast", "cereal", "oatmeal", "porridge" ], + "char": "\ud83e\udd63", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + takeout_box: { + keywords: [ "food", "leftovers" ], + "char": "\ud83e\udd61", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + chopsticks: { + keywords: [ "food" ], + "char": "\ud83e\udd62", + fitzpatrick_scale: false, + category: "food_and_drink" + }, + soccer: { + keywords: [ "sports", "football" ], + "char": "\u26bd", + fitzpatrick_scale: false, + category: "activity" + }, + basketball: { + keywords: [ "sports", "balls", "NBA" ], + "char": "\ud83c\udfc0", + fitzpatrick_scale: false, + category: "activity" + }, + football: { + keywords: [ "sports", "balls", "NFL" ], + "char": "\ud83c\udfc8", + fitzpatrick_scale: false, + category: "activity" + }, + baseball: { + keywords: [ "sports", "balls" ], + "char": "\u26be", + fitzpatrick_scale: false, + category: "activity" + }, + softball: { + keywords: [ "sports", "balls" ], + "char": "\ud83e\udd4e", + fitzpatrick_scale: false, + category: "activity" + }, + tennis: { + keywords: [ "sports", "balls", "green" ], + "char": "\ud83c\udfbe", + fitzpatrick_scale: false, + category: "activity" + }, + volleyball: { + keywords: [ "sports", "balls" ], + "char": "\ud83c\udfd0", + fitzpatrick_scale: false, + category: "activity" + }, + rugby_football: { + keywords: [ "sports", "team" ], + "char": "\ud83c\udfc9", + fitzpatrick_scale: false, + category: "activity" + }, + flying_disc: { + keywords: [ "sports", "frisbee", "ultimate" ], + "char": "\ud83e\udd4f", + fitzpatrick_scale: false, + category: "activity" + }, + "8ball": { + keywords: [ "pool", "hobby", "game", "luck", "magic" ], + "char": "\ud83c\udfb1", + fitzpatrick_scale: false, + category: "activity" + }, + golf: { + keywords: [ "sports", "business", "flag", "hole", "summer" ], + "char": "\u26f3", + fitzpatrick_scale: false, + category: "activity" + }, + golfing_woman: { + keywords: [ "sports", "business", "woman", "female" ], + "char": "\ud83c\udfcc\ufe0f\u200d\u2640\ufe0f", + fitzpatrick_scale: false, + category: "activity" + }, + golfing_man: { + keywords: [ "sports", "business" ], + "char": "\ud83c\udfcc", + fitzpatrick_scale: true, + category: "activity" + }, + ping_pong: { + keywords: [ "sports", "pingpong" ], + "char": "\ud83c\udfd3", + fitzpatrick_scale: false, + category: "activity" + }, + badminton: { + keywords: [ "sports" ], + "char": "\ud83c\udff8", + fitzpatrick_scale: false, + category: "activity" + }, + goal_net: { + keywords: [ "sports" ], + "char": "\ud83e\udd45", + fitzpatrick_scale: false, + category: "activity" + }, + ice_hockey: { + keywords: [ "sports" ], + "char": "\ud83c\udfd2", + fitzpatrick_scale: false, + category: "activity" + }, + field_hockey: { + keywords: [ "sports" ], + "char": "\ud83c\udfd1", + fitzpatrick_scale: false, + category: "activity" + }, + lacrosse: { + keywords: [ "sports", "ball", "stick" ], + "char": "\ud83e\udd4d", + fitzpatrick_scale: false, + category: "activity" + }, + cricket: { + keywords: [ "sports" ], + "char": "\ud83c\udfcf", + fitzpatrick_scale: false, + category: "activity" + }, + ski: { + keywords: [ "sports", "winter", "cold", "snow" ], + "char": "\ud83c\udfbf", + fitzpatrick_scale: false, + category: "activity" + }, + skier: { + keywords: [ "sports", "winter", "snow" ], + "char": "\u26f7", + fitzpatrick_scale: false, + category: "activity" + }, + snowboarder: { + keywords: [ "sports", "winter" ], + "char": "\ud83c\udfc2", + fitzpatrick_scale: true, + category: "activity" + }, + person_fencing: { + keywords: [ "sports", "fencing", "sword" ], + "char": "\ud83e\udd3a", + fitzpatrick_scale: false, + category: "activity" + }, + women_wrestling: { + keywords: [ "sports", "wrestlers" ], + "char": "\ud83e\udd3c\u200d\u2640\ufe0f", + fitzpatrick_scale: false, + category: "activity" + }, + men_wrestling: { + keywords: [ "sports", "wrestlers" ], + "char": "\ud83e\udd3c\u200d\u2642\ufe0f", + fitzpatrick_scale: false, + category: "activity" + }, + woman_cartwheeling: { + keywords: [ "gymnastics" ], + "char": "\ud83e\udd38\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "activity" + }, + man_cartwheeling: { + keywords: [ "gymnastics" ], + "char": "\ud83e\udd38\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "activity" + }, + woman_playing_handball: { + keywords: [ "sports" ], + "char": "\ud83e\udd3e\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "activity" + }, + man_playing_handball: { + keywords: [ "sports" ], + "char": "\ud83e\udd3e\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "activity" + }, + ice_skate: { + keywords: [ "sports" ], + "char": "\u26f8", + fitzpatrick_scale: false, + category: "activity" + }, + curling_stone: { + keywords: [ "sports" ], + "char": "\ud83e\udd4c", + fitzpatrick_scale: false, + category: "activity" + }, + skateboard: { + keywords: [ "board" ], + "char": "\ud83d\udef9", + fitzpatrick_scale: false, + category: "activity" + }, + sled: { + keywords: [ "sleigh", "luge", "toboggan" ], + "char": "\ud83d\udef7", + fitzpatrick_scale: false, + category: "activity" + }, + bow_and_arrow: { + keywords: [ "sports" ], + "char": "\ud83c\udff9", + fitzpatrick_scale: false, + category: "activity" + }, + fishing_pole_and_fish: { + keywords: [ "food", "hobby", "summer" ], + "char": "\ud83c\udfa3", + fitzpatrick_scale: false, + category: "activity" + }, + boxing_glove: { + keywords: [ "sports", "fighting" ], + "char": "\ud83e\udd4a", + fitzpatrick_scale: false, + category: "activity" + }, + martial_arts_uniform: { + keywords: [ "judo", "karate", "taekwondo" ], + "char": "\ud83e\udd4b", + fitzpatrick_scale: false, + category: "activity" + }, + rowing_woman: { + keywords: [ "sports", "hobby", "water", "ship", "woman", "female" ], + "char": "\ud83d\udea3\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "activity" + }, + rowing_man: { + keywords: [ "sports", "hobby", "water", "ship" ], + "char": "\ud83d\udea3", + fitzpatrick_scale: true, + category: "activity" + }, + climbing_woman: { + keywords: [ "sports", "hobby", "woman", "female", "rock" ], + "char": "\ud83e\uddd7\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "activity" + }, + climbing_man: { + keywords: [ "sports", "hobby", "man", "male", "rock" ], + "char": "\ud83e\uddd7\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "activity" + }, + swimming_woman: { + keywords: [ "sports", "exercise", "human", "athlete", "water", "summer", "woman", "female" ], + "char": "\ud83c\udfca\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "activity" + }, + swimming_man: { + keywords: [ "sports", "exercise", "human", "athlete", "water", "summer" ], + "char": "\ud83c\udfca", + fitzpatrick_scale: true, + category: "activity" + }, + woman_playing_water_polo: { + keywords: [ "sports", "pool" ], + "char": "\ud83e\udd3d\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "activity" + }, + man_playing_water_polo: { + keywords: [ "sports", "pool" ], + "char": "\ud83e\udd3d\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "activity" + }, + woman_in_lotus_position: { + keywords: [ "woman", "female", "meditation", "yoga", "serenity", "zen", "mindfulness" ], + "char": "\ud83e\uddd8\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "activity" + }, + man_in_lotus_position: { + keywords: [ "man", "male", "meditation", "yoga", "serenity", "zen", "mindfulness" ], + "char": "\ud83e\uddd8\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "activity" + }, + surfing_woman: { + keywords: [ "sports", "ocean", "sea", "summer", "beach", "woman", "female" ], + "char": "\ud83c\udfc4\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "activity" + }, + surfing_man: { + keywords: [ "sports", "ocean", "sea", "summer", "beach" ], + "char": "\ud83c\udfc4", + fitzpatrick_scale: true, + category: "activity" + }, + bath: { + keywords: [ "clean", "shower", "bathroom" ], + "char": "\ud83d\udec0", + fitzpatrick_scale: true, + category: "activity" + }, + basketball_woman: { + keywords: [ "sports", "human", "woman", "female" ], + "char": "\u26f9\ufe0f\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "activity" + }, + basketball_man: { + keywords: [ "sports", "human" ], + "char": "\u26f9", + fitzpatrick_scale: true, + category: "activity" + }, + weight_lifting_woman: { + keywords: [ "sports", "training", "exercise", "woman", "female" ], + "char": "\ud83c\udfcb\ufe0f\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "activity" + }, + weight_lifting_man: { + keywords: [ "sports", "training", "exercise" ], + "char": "\ud83c\udfcb", + fitzpatrick_scale: true, + category: "activity" + }, + biking_woman: { + keywords: [ "sports", "bike", "exercise", "hipster", "woman", "female" ], + "char": "\ud83d\udeb4\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "activity" + }, + biking_man: { + keywords: [ "sports", "bike", "exercise", "hipster" ], + "char": "\ud83d\udeb4", + fitzpatrick_scale: true, + category: "activity" + }, + mountain_biking_woman: { + keywords: [ "transportation", "sports", "human", "race", "bike", "woman", "female" ], + "char": "\ud83d\udeb5\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "activity" + }, + mountain_biking_man: { + keywords: [ "transportation", "sports", "human", "race", "bike" ], + "char": "\ud83d\udeb5", + fitzpatrick_scale: true, + category: "activity" + }, + horse_racing: { + keywords: [ "animal", "betting", "competition", "gambling", "luck" ], + "char": "\ud83c\udfc7", + fitzpatrick_scale: true, + category: "activity" + }, + business_suit_levitating: { + keywords: [ "suit", "business", "levitate", "hover", "jump" ], + "char": "\ud83d\udd74", + fitzpatrick_scale: true, + category: "activity" + }, + trophy: { + keywords: [ "win", "award", "contest", "place", "ftw", "ceremony" ], + "char": "\ud83c\udfc6", + fitzpatrick_scale: false, + category: "activity" + }, + running_shirt_with_sash: { + keywords: [ "play", "pageant" ], + "char": "\ud83c\udfbd", + fitzpatrick_scale: false, + category: "activity" + }, + medal_sports: { + keywords: [ "award", "winning" ], + "char": "\ud83c\udfc5", + fitzpatrick_scale: false, + category: "activity" + }, + medal_military: { + keywords: [ "award", "winning", "army" ], + "char": "\ud83c\udf96", + fitzpatrick_scale: false, + category: "activity" + }, + "1st_place_medal": { + keywords: [ "award", "winning", "first" ], + "char": "\ud83e\udd47", + fitzpatrick_scale: false, + category: "activity" + }, + "2nd_place_medal": { + keywords: [ "award", "second" ], + "char": "\ud83e\udd48", + fitzpatrick_scale: false, + category: "activity" + }, + "3rd_place_medal": { + keywords: [ "award", "third" ], + "char": "\ud83e\udd49", + fitzpatrick_scale: false, + category: "activity" + }, + reminder_ribbon: { + keywords: [ "sports", "cause", "support", "awareness" ], + "char": "\ud83c\udf97", + fitzpatrick_scale: false, + category: "activity" + }, + rosette: { + keywords: [ "flower", "decoration", "military" ], + "char": "\ud83c\udff5", + fitzpatrick_scale: false, + category: "activity" + }, + ticket: { + keywords: [ "event", "concert", "pass" ], + "char": "\ud83c\udfab", + fitzpatrick_scale: false, + category: "activity" + }, + tickets: { + keywords: [ "sports", "concert", "entrance" ], + "char": "\ud83c\udf9f", + fitzpatrick_scale: false, + category: "activity" + }, + performing_arts: { + keywords: [ "acting", "theater", "drama" ], + "char": "\ud83c\udfad", + fitzpatrick_scale: false, + category: "activity" + }, + art: { + keywords: [ "design", "paint", "draw", "colors" ], + "char": "\ud83c\udfa8", + fitzpatrick_scale: false, + category: "activity" + }, + circus_tent: { + keywords: [ "festival", "carnival", "party" ], + "char": "\ud83c\udfaa", + fitzpatrick_scale: false, + category: "activity" + }, + woman_juggling: { + keywords: [ "juggle", "balance", "skill", "multitask" ], + "char": "\ud83e\udd39\u200d\u2640\ufe0f", + fitzpatrick_scale: true, + category: "activity" + }, + man_juggling: { + keywords: [ "juggle", "balance", "skill", "multitask" ], + "char": "\ud83e\udd39\u200d\u2642\ufe0f", + fitzpatrick_scale: true, + category: "activity" + }, + microphone: { + keywords: [ "sound", "music", "PA", "sing", "talkshow" ], + "char": "\ud83c\udfa4", + fitzpatrick_scale: false, + category: "activity" + }, + headphones: { + keywords: [ "music", "score", "gadgets" ], + "char": "\ud83c\udfa7", + fitzpatrick_scale: false, + category: "activity" + }, + musical_score: { + keywords: [ "treble", "clef", "compose" ], + "char": "\ud83c\udfbc", + fitzpatrick_scale: false, + category: "activity" + }, + musical_keyboard: { + keywords: [ "piano", "instrument", "compose" ], + "char": "\ud83c\udfb9", + fitzpatrick_scale: false, + category: "activity" + }, + drum: { + keywords: [ "music", "instrument", "drumsticks", "snare" ], + "char": "\ud83e\udd41", + fitzpatrick_scale: false, + category: "activity" + }, + saxophone: { + keywords: [ "music", "instrument", "jazz", "blues" ], + "char": "\ud83c\udfb7", + fitzpatrick_scale: false, + category: "activity" + }, + trumpet: { + keywords: [ "music", "brass" ], + "char": "\ud83c\udfba", + fitzpatrick_scale: false, + category: "activity" + }, + guitar: { + keywords: [ "music", "instrument" ], + "char": "\ud83c\udfb8", + fitzpatrick_scale: false, + category: "activity" + }, + violin: { + keywords: [ "music", "instrument", "orchestra", "symphony" ], + "char": "\ud83c\udfbb", + fitzpatrick_scale: false, + category: "activity" + }, + clapper: { + keywords: [ "movie", "film", "record" ], + "char": "\ud83c\udfac", + fitzpatrick_scale: false, + category: "activity" + }, + video_game: { + keywords: [ "play", "console", "PS4", "controller" ], + "char": "\ud83c\udfae", + fitzpatrick_scale: false, + category: "activity" + }, + space_invader: { + keywords: [ "game", "arcade", "play" ], + "char": "\ud83d\udc7e", + fitzpatrick_scale: false, + category: "activity" + }, + dart: { + keywords: [ "game", "play", "bar", "target", "bullseye" ], + "char": "\ud83c\udfaf", + fitzpatrick_scale: false, + category: "activity" + }, + game_die: { + keywords: [ "dice", "random", "tabletop", "play", "luck" ], + "char": "\ud83c\udfb2", + fitzpatrick_scale: false, + category: "activity" + }, + chess_pawn: { + keywords: [ "expendable" ], + "char": "\u265f", + fitzpatrick_scale: false, + category: "activity" + }, + slot_machine: { + keywords: [ "bet", "gamble", "vegas", "fruit machine", "luck", "casino" ], + "char": "\ud83c\udfb0", + fitzpatrick_scale: false, + category: "activity" + }, + jigsaw: { + keywords: [ "interlocking", "puzzle", "piece" ], + "char": "\ud83e\udde9", + fitzpatrick_scale: false, + category: "activity" + }, + bowling: { + keywords: [ "sports", "fun", "play" ], + "char": "\ud83c\udfb3", + fitzpatrick_scale: false, + category: "activity" + }, + red_car: { + keywords: [ "red", "transportation", "vehicle" ], + "char": "\ud83d\ude97", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + taxi: { + keywords: [ "uber", "vehicle", "cars", "transportation" ], + "char": "\ud83d\ude95", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + blue_car: { + keywords: [ "transportation", "vehicle" ], + "char": "\ud83d\ude99", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + bus: { + keywords: [ "car", "vehicle", "transportation" ], + "char": "\ud83d\ude8c", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + trolleybus: { + keywords: [ "bart", "transportation", "vehicle" ], + "char": "\ud83d\ude8e", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + racing_car: { + keywords: [ "sports", "race", "fast", "formula", "f1" ], + "char": "\ud83c\udfce", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + police_car: { + keywords: [ "vehicle", "cars", "transportation", "law", "legal", "enforcement" ], + "char": "\ud83d\ude93", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + ambulance: { + keywords: [ "health", "911", "hospital" ], + "char": "\ud83d\ude91", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + fire_engine: { + keywords: [ "transportation", "cars", "vehicle" ], + "char": "\ud83d\ude92", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + minibus: { + keywords: [ "vehicle", "car", "transportation" ], + "char": "\ud83d\ude90", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + truck: { + keywords: [ "cars", "transportation" ], + "char": "\ud83d\ude9a", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + articulated_lorry: { + keywords: [ "vehicle", "cars", "transportation", "express" ], + "char": "\ud83d\ude9b", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + tractor: { + keywords: [ "vehicle", "car", "farming", "agriculture" ], + "char": "\ud83d\ude9c", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + kick_scooter: { + keywords: [ "vehicle", "kick", "razor" ], + "char": "\ud83d\udef4", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + motorcycle: { + keywords: [ "race", "sports", "fast" ], + "char": "\ud83c\udfcd", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + bike: { + keywords: [ "sports", "bicycle", "exercise", "hipster" ], + "char": "\ud83d\udeb2", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + motor_scooter: { + keywords: [ "vehicle", "vespa", "sasha" ], + "char": "\ud83d\udef5", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + rotating_light: { + keywords: [ "police", "ambulance", "911", "emergency", "alert", "error", "pinged", "law", "legal" ], + "char": "\ud83d\udea8", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + oncoming_police_car: { + keywords: [ "vehicle", "law", "legal", "enforcement", "911" ], + "char": "\ud83d\ude94", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + oncoming_bus: { + keywords: [ "vehicle", "transportation" ], + "char": "\ud83d\ude8d", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + oncoming_automobile: { + keywords: [ "car", "vehicle", "transportation" ], + "char": "\ud83d\ude98", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + oncoming_taxi: { + keywords: [ "vehicle", "cars", "uber" ], + "char": "\ud83d\ude96", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + aerial_tramway: { + keywords: [ "transportation", "vehicle", "ski" ], + "char": "\ud83d\udea1", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + mountain_cableway: { + keywords: [ "transportation", "vehicle", "ski" ], + "char": "\ud83d\udea0", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + suspension_railway: { + keywords: [ "vehicle", "transportation" ], + "char": "\ud83d\ude9f", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + railway_car: { + keywords: [ "transportation", "vehicle" ], + "char": "\ud83d\ude83", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + train: { + keywords: [ "transportation", "vehicle", "carriage", "public", "travel" ], + "char": "\ud83d\ude8b", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + monorail: { + keywords: [ "transportation", "vehicle" ], + "char": "\ud83d\ude9d", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + bullettrain_side: { + keywords: [ "transportation", "vehicle" ], + "char": "\ud83d\ude84", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + bullettrain_front: { + keywords: [ "transportation", "vehicle", "speed", "fast", "public", "travel" ], + "char": "\ud83d\ude85", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + light_rail: { + keywords: [ "transportation", "vehicle" ], + "char": "\ud83d\ude88", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + mountain_railway: { + keywords: [ "transportation", "vehicle" ], + "char": "\ud83d\ude9e", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + steam_locomotive: { + keywords: [ "transportation", "vehicle", "train" ], + "char": "\ud83d\ude82", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + train2: { + keywords: [ "transportation", "vehicle" ], + "char": "\ud83d\ude86", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + metro: { + keywords: [ "transportation", "blue-square", "mrt", "underground", "tube" ], + "char": "\ud83d\ude87", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + tram: { + keywords: [ "transportation", "vehicle" ], + "char": "\ud83d\ude8a", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + station: { + keywords: [ "transportation", "vehicle", "public" ], + "char": "\ud83d\ude89", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + flying_saucer: { + keywords: [ "transportation", "vehicle", "ufo" ], + "char": "\ud83d\udef8", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + helicopter: { + keywords: [ "transportation", "vehicle", "fly" ], + "char": "\ud83d\ude81", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + small_airplane: { + keywords: [ "flight", "transportation", "fly", "vehicle" ], + "char": "\ud83d\udee9", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + airplane: { + keywords: [ "vehicle", "transportation", "flight", "fly" ], + "char": "\u2708\ufe0f", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + flight_departure: { + keywords: [ "airport", "flight", "landing" ], + "char": "\ud83d\udeeb", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + flight_arrival: { + keywords: [ "airport", "flight", "boarding" ], + "char": "\ud83d\udeec", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + sailboat: { + keywords: [ "ship", "summer", "transportation", "water", "sailing" ], + "char": "\u26f5", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + motor_boat: { + keywords: [ "ship" ], + "char": "\ud83d\udee5", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + speedboat: { + keywords: [ "ship", "transportation", "vehicle", "summer" ], + "char": "\ud83d\udea4", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + ferry: { + keywords: [ "boat", "ship", "yacht" ], + "char": "\u26f4", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + passenger_ship: { + keywords: [ "yacht", "cruise", "ferry" ], + "char": "\ud83d\udef3", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + rocket: { + keywords: [ "launch", "ship", "staffmode", "NASA", "outer space", "outer_space", "fly" ], + "char": "\ud83d\ude80", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + artificial_satellite: { + keywords: [ "communication", "gps", "orbit", "spaceflight", "NASA", "ISS" ], + "char": "\ud83d\udef0", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + seat: { + keywords: [ "sit", "airplane", "transport", "bus", "flight", "fly" ], + "char": "\ud83d\udcba", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + canoe: { + keywords: [ "boat", "paddle", "water", "ship" ], + "char": "\ud83d\udef6", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + anchor: { + keywords: [ "ship", "ferry", "sea", "boat" ], + "char": "\u2693", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + construction: { + keywords: [ "wip", "progress", "caution", "warning" ], + "char": "\ud83d\udea7", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + fuelpump: { + keywords: [ "gas station", "petroleum" ], + "char": "\u26fd", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + busstop: { + keywords: [ "transportation", "wait" ], + "char": "\ud83d\ude8f", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + vertical_traffic_light: { + keywords: [ "transportation", "driving" ], + "char": "\ud83d\udea6", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + traffic_light: { + keywords: [ "transportation", "signal" ], + "char": "\ud83d\udea5", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + checkered_flag: { + keywords: [ "contest", "finishline", "race", "gokart" ], + "char": "\ud83c\udfc1", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + ship: { + keywords: [ "transportation", "titanic", "deploy" ], + "char": "\ud83d\udea2", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + ferris_wheel: { + keywords: [ "photo", "carnival", "londoneye" ], + "char": "\ud83c\udfa1", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + roller_coaster: { + keywords: [ "carnival", "playground", "photo", "fun" ], + "char": "\ud83c\udfa2", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + carousel_horse: { + keywords: [ "photo", "carnival" ], + "char": "\ud83c\udfa0", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + building_construction: { + keywords: [ "wip", "working", "progress" ], + "char": "\ud83c\udfd7", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + foggy: { + keywords: [ "photo", "mountain" ], + "char": "\ud83c\udf01", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + tokyo_tower: { + keywords: [ "photo", "japanese" ], + "char": "\ud83d\uddfc", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + factory: { + keywords: [ "building", "industry", "pollution", "smoke" ], + "char": "\ud83c\udfed", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + fountain: { + keywords: [ "photo", "summer", "water", "fresh" ], + "char": "\u26f2", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + rice_scene: { + keywords: [ "photo", "japan", "asia", "tsukimi" ], + "char": "\ud83c\udf91", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + mountain: { + keywords: [ "photo", "nature", "environment" ], + "char": "\u26f0", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + mountain_snow: { + keywords: [ "photo", "nature", "environment", "winter", "cold" ], + "char": "\ud83c\udfd4", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + mount_fuji: { + keywords: [ "photo", "mountain", "nature", "japanese" ], + "char": "\ud83d\uddfb", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + volcano: { + keywords: [ "photo", "nature", "disaster" ], + "char": "\ud83c\udf0b", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + japan: { + keywords: [ "nation", "country", "japanese", "asia" ], + "char": "\ud83d\uddfe", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + camping: { + keywords: [ "photo", "outdoors", "tent" ], + "char": "\ud83c\udfd5", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + tent: { + keywords: [ "photo", "camping", "outdoors" ], + "char": "\u26fa", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + national_park: { + keywords: [ "photo", "environment", "nature" ], + "char": "\ud83c\udfde", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + motorway: { + keywords: [ "road", "cupertino", "interstate", "highway" ], + "char": "\ud83d\udee3", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + railway_track: { + keywords: [ "train", "transportation" ], + "char": "\ud83d\udee4", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + sunrise: { + keywords: [ "morning", "view", "vacation", "photo" ], + "char": "\ud83c\udf05", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + sunrise_over_mountains: { + keywords: [ "view", "vacation", "photo" ], + "char": "\ud83c\udf04", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + desert: { + keywords: [ "photo", "warm", "saharah" ], + "char": "\ud83c\udfdc", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + beach_umbrella: { + keywords: [ "weather", "summer", "sunny", "sand", "mojito" ], + "char": "\ud83c\udfd6", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + desert_island: { + keywords: [ "photo", "tropical", "mojito" ], + "char": "\ud83c\udfdd", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + city_sunrise: { + keywords: [ "photo", "good morning", "dawn" ], + "char": "\ud83c\udf07", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + city_sunset: { + keywords: [ "photo", "evening", "sky", "buildings" ], + "char": "\ud83c\udf06", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + cityscape: { + keywords: [ "photo", "night life", "urban" ], + "char": "\ud83c\udfd9", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + night_with_stars: { + keywords: [ "evening", "city", "downtown" ], + "char": "\ud83c\udf03", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + bridge_at_night: { + keywords: [ "photo", "sanfrancisco" ], + "char": "\ud83c\udf09", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + milky_way: { + keywords: [ "photo", "space", "stars" ], + "char": "\ud83c\udf0c", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + stars: { + keywords: [ "night", "photo" ], + "char": "\ud83c\udf20", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + sparkler: { + keywords: [ "stars", "night", "shine" ], + "char": "\ud83c\udf87", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + fireworks: { + keywords: [ "photo", "festival", "carnival", "congratulations" ], + "char": "\ud83c\udf86", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + rainbow: { + keywords: [ "nature", "happy", "unicorn_face", "photo", "sky", "spring" ], + "char": "\ud83c\udf08", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + houses: { + keywords: [ "buildings", "photo" ], + "char": "\ud83c\udfd8", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + european_castle: { + keywords: [ "building", "royalty", "history" ], + "char": "\ud83c\udff0", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + japanese_castle: { + keywords: [ "photo", "building" ], + "char": "\ud83c\udfef", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + stadium: { + keywords: [ "photo", "place", "sports", "concert", "venue" ], + "char": "\ud83c\udfdf", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + statue_of_liberty: { + keywords: [ "american", "newyork" ], + "char": "\ud83d\uddfd", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + house: { + keywords: [ "building", "home" ], + "char": "\ud83c\udfe0", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + house_with_garden: { + keywords: [ "home", "plant", "nature" ], + "char": "\ud83c\udfe1", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + derelict_house: { + keywords: [ "abandon", "evict", "broken", "building" ], + "char": "\ud83c\udfda", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + office: { + keywords: [ "building", "bureau", "work" ], + "char": "\ud83c\udfe2", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + department_store: { + keywords: [ "building", "shopping", "mall" ], + "char": "\ud83c\udfec", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + post_office: { + keywords: [ "building", "envelope", "communication" ], + "char": "\ud83c\udfe3", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + european_post_office: { + keywords: [ "building", "email" ], + "char": "\ud83c\udfe4", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + hospital: { + keywords: [ "building", "health", "surgery", "doctor" ], + "char": "\ud83c\udfe5", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + bank: { + keywords: [ "building", "money", "sales", "cash", "business", "enterprise" ], + "char": "\ud83c\udfe6", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + hotel: { + keywords: [ "building", "accomodation", "checkin" ], + "char": "\ud83c\udfe8", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + convenience_store: { + keywords: [ "building", "shopping", "groceries" ], + "char": "\ud83c\udfea", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + school: { + keywords: [ "building", "student", "education", "learn", "teach" ], + "char": "\ud83c\udfeb", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + love_hotel: { + keywords: [ "like", "affection", "dating" ], + "char": "\ud83c\udfe9", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + wedding: { + keywords: [ "love", "like", "affection", "couple", "marriage", "bride", "groom" ], + "char": "\ud83d\udc92", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + classical_building: { + keywords: [ "art", "culture", "history" ], + "char": "\ud83c\udfdb", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + church: { + keywords: [ "building", "religion", "christ" ], + "char": "\u26ea", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + mosque: { + keywords: [ "islam", "worship", "minaret" ], + "char": "\ud83d\udd4c", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + synagogue: { + keywords: [ "judaism", "worship", "temple", "jewish" ], + "char": "\ud83d\udd4d", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + kaaba: { + keywords: [ "mecca", "mosque", "islam" ], + "char": "\ud83d\udd4b", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + shinto_shrine: { + keywords: [ "temple", "japan", "kyoto" ], + "char": "\u26e9", + fitzpatrick_scale: false, + category: "travel_and_places" + }, + watch: { + keywords: [ "time", "accessories" ], + "char": "\u231a", + fitzpatrick_scale: false, + category: "objects" + }, + iphone: { + keywords: [ "technology", "apple", "gadgets", "dial" ], + "char": "\ud83d\udcf1", + fitzpatrick_scale: false, + category: "objects" + }, + calling: { + keywords: [ "iphone", "incoming" ], + "char": "\ud83d\udcf2", + fitzpatrick_scale: false, + category: "objects" + }, + computer: { + keywords: [ "technology", "laptop", "screen", "display", "monitor" ], + "char": "\ud83d\udcbb", + fitzpatrick_scale: false, + category: "objects" + }, + keyboard: { + keywords: [ "technology", "computer", "type", "input", "text" ], + "char": "\u2328", + fitzpatrick_scale: false, + category: "objects" + }, + desktop_computer: { + keywords: [ "technology", "computing", "screen" ], + "char": "\ud83d\udda5", + fitzpatrick_scale: false, + category: "objects" + }, + printer: { + keywords: [ "paper", "ink" ], + "char": "\ud83d\udda8", + fitzpatrick_scale: false, + category: "objects" + }, + computer_mouse: { + keywords: [ "click" ], + "char": "\ud83d\uddb1", + fitzpatrick_scale: false, + category: "objects" + }, + trackball: { + keywords: [ "technology", "trackpad" ], + "char": "\ud83d\uddb2", + fitzpatrick_scale: false, + category: "objects" + }, + joystick: { + keywords: [ "game", "play" ], + "char": "\ud83d\udd79", + fitzpatrick_scale: false, + category: "objects" + }, + clamp: { + keywords: [ "tool" ], + "char": "\ud83d\udddc", + fitzpatrick_scale: false, + category: "objects" + }, + minidisc: { + keywords: [ "technology", "record", "data", "disk", "90s" ], + "char": "\ud83d\udcbd", + fitzpatrick_scale: false, + category: "objects" + }, + floppy_disk: { + keywords: [ "oldschool", "technology", "save", "90s", "80s" ], + "char": "\ud83d\udcbe", + fitzpatrick_scale: false, + category: "objects" + }, + cd: { + keywords: [ "technology", "dvd", "disk", "disc", "90s" ], + "char": "\ud83d\udcbf", + fitzpatrick_scale: false, + category: "objects" + }, + dvd: { + keywords: [ "cd", "disk", "disc" ], + "char": "\ud83d\udcc0", + fitzpatrick_scale: false, + category: "objects" + }, + vhs: { + keywords: [ "record", "video", "oldschool", "90s", "80s" ], + "char": "\ud83d\udcfc", + fitzpatrick_scale: false, + category: "objects" + }, + camera: { + keywords: [ "gadgets", "photography" ], + "char": "\ud83d\udcf7", + fitzpatrick_scale: false, + category: "objects" + }, + camera_flash: { + keywords: [ "photography", "gadgets" ], + "char": "\ud83d\udcf8", + fitzpatrick_scale: false, + category: "objects" + }, + video_camera: { + keywords: [ "film", "record" ], + "char": "\ud83d\udcf9", + fitzpatrick_scale: false, + category: "objects" + }, + movie_camera: { + keywords: [ "film", "record" ], + "char": "\ud83c\udfa5", + fitzpatrick_scale: false, + category: "objects" + }, + film_projector: { + keywords: [ "video", "tape", "record", "movie" ], + "char": "\ud83d\udcfd", + fitzpatrick_scale: false, + category: "objects" + }, + film_strip: { + keywords: [ "movie" ], + "char": "\ud83c\udf9e", + fitzpatrick_scale: false, + category: "objects" + }, + telephone_receiver: { + keywords: [ "technology", "communication", "dial" ], + "char": "\ud83d\udcde", + fitzpatrick_scale: false, + category: "objects" + }, + phone: { + keywords: [ "technology", "communication", "dial", "telephone" ], + "char": "\u260e\ufe0f", + fitzpatrick_scale: false, + category: "objects" + }, + pager: { + keywords: [ "bbcall", "oldschool", "90s" ], + "char": "\ud83d\udcdf", + fitzpatrick_scale: false, + category: "objects" + }, + fax: { + keywords: [ "communication", "technology" ], + "char": "\ud83d\udce0", + fitzpatrick_scale: false, + category: "objects" + }, + tv: { + keywords: [ "technology", "program", "oldschool", "show", "television" ], + "char": "\ud83d\udcfa", + fitzpatrick_scale: false, + category: "objects" + }, + radio: { + keywords: [ "communication", "music", "podcast", "program" ], + "char": "\ud83d\udcfb", + fitzpatrick_scale: false, + category: "objects" + }, + studio_microphone: { + keywords: [ "sing", "recording", "artist", "talkshow" ], + "char": "\ud83c\udf99", + fitzpatrick_scale: false, + category: "objects" + }, + level_slider: { + keywords: [ "scale" ], + "char": "\ud83c\udf9a", + fitzpatrick_scale: false, + category: "objects" + }, + control_knobs: { + keywords: [ "dial" ], + "char": "\ud83c\udf9b", + fitzpatrick_scale: false, + category: "objects" + }, + compass: { + keywords: [ "magnetic", "navigation", "orienteering" ], + "char": "\ud83e\udded", + fitzpatrick_scale: false, + category: "objects" + }, + stopwatch: { + keywords: [ "time", "deadline" ], + "char": "\u23f1", + fitzpatrick_scale: false, + category: "objects" + }, + timer_clock: { + keywords: [ "alarm" ], + "char": "\u23f2", + fitzpatrick_scale: false, + category: "objects" + }, + alarm_clock: { + keywords: [ "time", "wake" ], + "char": "\u23f0", + fitzpatrick_scale: false, + category: "objects" + }, + mantelpiece_clock: { + keywords: [ "time" ], + "char": "\ud83d\udd70", + fitzpatrick_scale: false, + category: "objects" + }, + hourglass_flowing_sand: { + keywords: [ "oldschool", "time", "countdown" ], + "char": "\u23f3", + fitzpatrick_scale: false, + category: "objects" + }, + hourglass: { + keywords: [ "time", "clock", "oldschool", "limit", "exam", "quiz", "test" ], + "char": "\u231b", + fitzpatrick_scale: false, + category: "objects" + }, + satellite: { + keywords: [ "communication", "future", "radio", "space" ], + "char": "\ud83d\udce1", + fitzpatrick_scale: false, + category: "objects" + }, + battery: { + keywords: [ "power", "energy", "sustain" ], + "char": "\ud83d\udd0b", + fitzpatrick_scale: false, + category: "objects" + }, + electric_plug: { + keywords: [ "charger", "power" ], + "char": "\ud83d\udd0c", + fitzpatrick_scale: false, + category: "objects" + }, + bulb: { + keywords: [ "light", "electricity", "idea" ], + "char": "\ud83d\udca1", + fitzpatrick_scale: false, + category: "objects" + }, + flashlight: { + keywords: [ "dark", "camping", "sight", "night" ], + "char": "\ud83d\udd26", + fitzpatrick_scale: false, + category: "objects" + }, + candle: { + keywords: [ "fire", "wax" ], + "char": "\ud83d\udd6f", + fitzpatrick_scale: false, + category: "objects" + }, + fire_extinguisher: { + keywords: [ "quench" ], + "char": "\ud83e\uddef", + fitzpatrick_scale: false, + category: "objects" + }, + wastebasket: { + keywords: [ "bin", "trash", "rubbish", "garbage", "toss" ], + "char": "\ud83d\uddd1", + fitzpatrick_scale: false, + category: "objects" + }, + oil_drum: { + keywords: [ "barrell" ], + "char": "\ud83d\udee2", + fitzpatrick_scale: false, + category: "objects" + }, + money_with_wings: { + keywords: [ "dollar", "bills", "payment", "sale" ], + "char": "\ud83d\udcb8", + fitzpatrick_scale: false, + category: "objects" + }, + dollar: { + keywords: [ "money", "sales", "bill", "currency" ], + "char": "\ud83d\udcb5", + fitzpatrick_scale: false, + category: "objects" + }, + yen: { + keywords: [ "money", "sales", "japanese", "dollar", "currency" ], + "char": "\ud83d\udcb4", + fitzpatrick_scale: false, + category: "objects" + }, + euro: { + keywords: [ "money", "sales", "dollar", "currency" ], + "char": "\ud83d\udcb6", + fitzpatrick_scale: false, + category: "objects" + }, + pound: { + keywords: [ "british", "sterling", "money", "sales", "bills", "uk", "england", "currency" ], + "char": "\ud83d\udcb7", + fitzpatrick_scale: false, + category: "objects" + }, + moneybag: { + keywords: [ "dollar", "payment", "coins", "sale" ], + "char": "\ud83d\udcb0", + fitzpatrick_scale: false, + category: "objects" + }, + credit_card: { + keywords: [ "money", "sales", "dollar", "bill", "payment", "shopping" ], + "char": "\ud83d\udcb3", + fitzpatrick_scale: false, + category: "objects" + }, + gem: { + keywords: [ "blue", "ruby", "diamond", "jewelry" ], + "char": "\ud83d\udc8e", + fitzpatrick_scale: false, + category: "objects" + }, + balance_scale: { + keywords: [ "law", "fairness", "weight" ], + "char": "\u2696", + fitzpatrick_scale: false, + category: "objects" + }, + toolbox: { + keywords: [ "tools", "diy", "fix", "maintainer", "mechanic" ], + "char": "\ud83e\uddf0", + fitzpatrick_scale: false, + category: "objects" + }, + wrench: { + keywords: [ "tools", "diy", "ikea", "fix", "maintainer" ], + "char": "\ud83d\udd27", + fitzpatrick_scale: false, + category: "objects" + }, + hammer: { + keywords: [ "tools", "build", "create" ], + "char": "\ud83d\udd28", + fitzpatrick_scale: false, + category: "objects" + }, + hammer_and_pick: { + keywords: [ "tools", "build", "create" ], + "char": "\u2692", + fitzpatrick_scale: false, + category: "objects" + }, + hammer_and_wrench: { + keywords: [ "tools", "build", "create" ], + "char": "\ud83d\udee0", + fitzpatrick_scale: false, + category: "objects" + }, + pick: { + keywords: [ "tools", "dig" ], + "char": "\u26cf", + fitzpatrick_scale: false, + category: "objects" + }, + nut_and_bolt: { + keywords: [ "handy", "tools", "fix" ], + "char": "\ud83d\udd29", + fitzpatrick_scale: false, + category: "objects" + }, + gear: { + keywords: [ "cog" ], + "char": "\u2699", + fitzpatrick_scale: false, + category: "objects" + }, + brick: { + keywords: [ "bricks" ], + "char": "\ud83e\uddf1", + fitzpatrick_scale: false, + category: "objects" + }, + chains: { + keywords: [ "lock", "arrest" ], + "char": "\u26d3", + fitzpatrick_scale: false, + category: "objects" + }, + magnet: { + keywords: [ "attraction", "magnetic" ], + "char": "\ud83e\uddf2", + fitzpatrick_scale: false, + category: "objects" + }, + gun: { + keywords: [ "violence", "weapon", "pistol", "revolver" ], + "char": "\ud83d\udd2b", + fitzpatrick_scale: false, + category: "objects" + }, + bomb: { + keywords: [ "boom", "explode", "explosion", "terrorism" ], + "char": "\ud83d\udca3", + fitzpatrick_scale: false, + category: "objects" + }, + firecracker: { + keywords: [ "dynamite", "boom", "explode", "explosion", "explosive" ], + "char": "\ud83e\udde8", + fitzpatrick_scale: false, + category: "objects" + }, + hocho: { + keywords: [ "knife", "blade", "cutlery", "kitchen", "weapon" ], + "char": "\ud83d\udd2a", + fitzpatrick_scale: false, + category: "objects" + }, + dagger: { + keywords: [ "weapon" ], + "char": "\ud83d\udde1", + fitzpatrick_scale: false, + category: "objects" + }, + crossed_swords: { + keywords: [ "weapon" ], + "char": "\u2694", + fitzpatrick_scale: false, + category: "objects" + }, + shield: { + keywords: [ "protection", "security" ], + "char": "\ud83d\udee1", + fitzpatrick_scale: false, + category: "objects" + }, + smoking: { + keywords: [ "kills", "tobacco", "cigarette", "joint", "smoke" ], + "char": "\ud83d\udeac", + fitzpatrick_scale: false, + category: "objects" + }, + skull_and_crossbones: { + keywords: [ "poison", "danger", "deadly", "scary", "death", "pirate", "evil" ], + "char": "\u2620", + fitzpatrick_scale: false, + category: "objects" + }, + coffin: { + keywords: [ "vampire", "dead", "die", "death", "rip", "graveyard", "cemetery", "casket", "funeral", "box" ], + "char": "\u26b0", + fitzpatrick_scale: false, + category: "objects" + }, + funeral_urn: { + keywords: [ "dead", "die", "death", "rip", "ashes" ], + "char": "\u26b1", + fitzpatrick_scale: false, + category: "objects" + }, + amphora: { + keywords: [ "vase", "jar" ], + "char": "\ud83c\udffa", + fitzpatrick_scale: false, + category: "objects" + }, + crystal_ball: { + keywords: [ "disco", "party", "magic", "circus", "fortune_teller" ], + "char": "\ud83d\udd2e", + fitzpatrick_scale: false, + category: "objects" + }, + prayer_beads: { + keywords: [ "dhikr", "religious" ], + "char": "\ud83d\udcff", + fitzpatrick_scale: false, + category: "objects" + }, + nazar_amulet: { + keywords: [ "bead", "charm" ], + "char": "\ud83e\uddff", + fitzpatrick_scale: false, + category: "objects" + }, + barber: { + keywords: [ "hair", "salon", "style" ], + "char": "\ud83d\udc88", + fitzpatrick_scale: false, + category: "objects" + }, + alembic: { + keywords: [ "distilling", "science", "experiment", "chemistry" ], + "char": "\u2697", + fitzpatrick_scale: false, + category: "objects" + }, + telescope: { + keywords: [ "stars", "space", "zoom", "science", "astronomy" ], + "char": "\ud83d\udd2d", + fitzpatrick_scale: false, + category: "objects" + }, + microscope: { + keywords: [ "laboratory", "experiment", "zoomin", "science", "study" ], + "char": "\ud83d\udd2c", + fitzpatrick_scale: false, + category: "objects" + }, + hole: { + keywords: [ "embarrassing" ], + "char": "\ud83d\udd73", + fitzpatrick_scale: false, + category: "objects" + }, + pill: { + keywords: [ "health", "medicine", "doctor", "pharmacy", "drug" ], + "char": "\ud83d\udc8a", + fitzpatrick_scale: false, + category: "objects" + }, + syringe: { + keywords: [ "health", "hospital", "drugs", "blood", "medicine", "needle", "doctor", "nurse" ], + "char": "\ud83d\udc89", + fitzpatrick_scale: false, + category: "objects" + }, + dna: { + keywords: [ "biologist", "genetics", "life" ], + "char": "\ud83e\uddec", + fitzpatrick_scale: false, + category: "objects" + }, + microbe: { + keywords: [ "amoeba", "bacteria", "germs" ], + "char": "\ud83e\udda0", + fitzpatrick_scale: false, + category: "objects" + }, + petri_dish: { + keywords: [ "bacteria", "biology", "culture", "lab" ], + "char": "\ud83e\uddeb", + fitzpatrick_scale: false, + category: "objects" + }, + test_tube: { + keywords: [ "chemistry", "experiment", "lab", "science" ], + "char": "\ud83e\uddea", + fitzpatrick_scale: false, + category: "objects" + }, + thermometer: { + keywords: [ "weather", "temperature", "hot", "cold" ], + "char": "\ud83c\udf21", + fitzpatrick_scale: false, + category: "objects" + }, + broom: { + keywords: [ "cleaning", "sweeping", "witch" ], + "char": "\ud83e\uddf9", + fitzpatrick_scale: false, + category: "objects" + }, + basket: { + keywords: [ "laundry" ], + "char": "\ud83e\uddfa", + fitzpatrick_scale: false, + category: "objects" + }, + toilet_paper: { + keywords: [ "roll" ], + "char": "\ud83e\uddfb", + fitzpatrick_scale: false, + category: "objects" + }, + label: { + keywords: [ "sale", "tag" ], + "char": "\ud83c\udff7", + fitzpatrick_scale: false, + category: "objects" + }, + bookmark: { + keywords: [ "favorite", "label", "save" ], + "char": "\ud83d\udd16", + fitzpatrick_scale: false, + category: "objects" + }, + toilet: { + keywords: [ "restroom", "wc", "washroom", "bathroom", "potty" ], + "char": "\ud83d\udebd", + fitzpatrick_scale: false, + category: "objects" + }, + shower: { + keywords: [ "clean", "water", "bathroom" ], + "char": "\ud83d\udebf", + fitzpatrick_scale: false, + category: "objects" + }, + bathtub: { + keywords: [ "clean", "shower", "bathroom" ], + "char": "\ud83d\udec1", + fitzpatrick_scale: false, + category: "objects" + }, + soap: { + keywords: [ "bar", "bathing", "cleaning", "lather" ], + "char": "\ud83e\uddfc", + fitzpatrick_scale: false, + category: "objects" + }, + sponge: { + keywords: [ "absorbing", "cleaning", "porous" ], + "char": "\ud83e\uddfd", + fitzpatrick_scale: false, + category: "objects" + }, + lotion_bottle: { + keywords: [ "moisturizer", "sunscreen" ], + "char": "\ud83e\uddf4", + fitzpatrick_scale: false, + category: "objects" + }, + key: { + keywords: [ "lock", "door", "password" ], + "char": "\ud83d\udd11", + fitzpatrick_scale: false, + category: "objects" + }, + old_key: { + keywords: [ "lock", "door", "password" ], + "char": "\ud83d\udddd", + fitzpatrick_scale: false, + category: "objects" + }, + couch_and_lamp: { + keywords: [ "read", "chill" ], + "char": "\ud83d\udecb", + fitzpatrick_scale: false, + category: "objects" + }, + sleeping_bed: { + keywords: [ "bed", "rest" ], + "char": "\ud83d\udecc", + fitzpatrick_scale: true, + category: "objects" + }, + bed: { + keywords: [ "sleep", "rest" ], + "char": "\ud83d\udecf", + fitzpatrick_scale: false, + category: "objects" + }, + door: { + keywords: [ "house", "entry", "exit" ], + "char": "\ud83d\udeaa", + fitzpatrick_scale: false, + category: "objects" + }, + bellhop_bell: { + keywords: [ "service" ], + "char": "\ud83d\udece", + fitzpatrick_scale: false, + category: "objects" + }, + teddy_bear: { + keywords: [ "plush", "stuffed" ], + "char": "\ud83e\uddf8", + fitzpatrick_scale: false, + category: "objects" + }, + framed_picture: { + keywords: [ "photography" ], + "char": "\ud83d\uddbc", + fitzpatrick_scale: false, + category: "objects" + }, + world_map: { + keywords: [ "location", "direction" ], + "char": "\ud83d\uddfa", + fitzpatrick_scale: false, + category: "objects" + }, + parasol_on_ground: { + keywords: [ "weather", "summer" ], + "char": "\u26f1", + fitzpatrick_scale: false, + category: "objects" + }, + moyai: { + keywords: [ "rock", "easter island", "moai" ], + "char": "\ud83d\uddff", + fitzpatrick_scale: false, + category: "objects" + }, + shopping: { + keywords: [ "mall", "buy", "purchase" ], + "char": "\ud83d\udecd", + fitzpatrick_scale: false, + category: "objects" + }, + shopping_cart: { + keywords: [ "trolley" ], + "char": "\ud83d\uded2", + fitzpatrick_scale: false, + category: "objects" + }, + balloon: { + keywords: [ "party", "celebration", "birthday", "circus" ], + "char": "\ud83c\udf88", + fitzpatrick_scale: false, + category: "objects" + }, + flags: { + keywords: [ "fish", "japanese", "koinobori", "carp", "banner" ], + "char": "\ud83c\udf8f", + fitzpatrick_scale: false, + category: "objects" + }, + ribbon: { + keywords: [ "decoration", "pink", "girl", "bowtie" ], + "char": "\ud83c\udf80", + fitzpatrick_scale: false, + category: "objects" + }, + gift: { + keywords: [ "present", "birthday", "christmas", "xmas" ], + "char": "\ud83c\udf81", + fitzpatrick_scale: false, + category: "objects" + }, + confetti_ball: { + keywords: [ "festival", "party", "birthday", "circus" ], + "char": "\ud83c\udf8a", + fitzpatrick_scale: false, + category: "objects" + }, + tada: { + keywords: [ "party", "congratulations", "birthday", "magic", "circus", "celebration" ], + "char": "\ud83c\udf89", + fitzpatrick_scale: false, + category: "objects" + }, + dolls: { + keywords: [ "japanese", "toy", "kimono" ], + "char": "\ud83c\udf8e", + fitzpatrick_scale: false, + category: "objects" + }, + wind_chime: { + keywords: [ "nature", "ding", "spring", "bell" ], + "char": "\ud83c\udf90", + fitzpatrick_scale: false, + category: "objects" + }, + crossed_flags: { + keywords: [ "japanese", "nation", "country", "border" ], + "char": "\ud83c\udf8c", + fitzpatrick_scale: false, + category: "objects" + }, + izakaya_lantern: { + keywords: [ "light", "paper", "halloween", "spooky" ], + "char": "\ud83c\udfee", + fitzpatrick_scale: false, + category: "objects" + }, + red_envelope: { + keywords: [ "gift" ], + "char": "\ud83e\udde7", + fitzpatrick_scale: false, + category: "objects" + }, + email: { + keywords: [ "letter", "postal", "inbox", "communication" ], + "char": "\u2709\ufe0f", + fitzpatrick_scale: false, + category: "objects" + }, + envelope_with_arrow: { + keywords: [ "email", "communication" ], + "char": "\ud83d\udce9", + fitzpatrick_scale: false, + category: "objects" + }, + incoming_envelope: { + keywords: [ "email", "inbox" ], + "char": "\ud83d\udce8", + fitzpatrick_scale: false, + category: "objects" + }, + "e-mail": { + keywords: [ "communication", "inbox" ], + "char": "\ud83d\udce7", + fitzpatrick_scale: false, + category: "objects" + }, + love_letter: { + keywords: [ "email", "like", "affection", "envelope", "valentines" ], + "char": "\ud83d\udc8c", + fitzpatrick_scale: false, + category: "objects" + }, + postbox: { + keywords: [ "email", "letter", "envelope" ], + "char": "\ud83d\udcee", + fitzpatrick_scale: false, + category: "objects" + }, + mailbox_closed: { + keywords: [ "email", "communication", "inbox" ], + "char": "\ud83d\udcea", + fitzpatrick_scale: false, + category: "objects" + }, + mailbox: { + keywords: [ "email", "inbox", "communication" ], + "char": "\ud83d\udceb", + fitzpatrick_scale: false, + category: "objects" + }, + mailbox_with_mail: { + keywords: [ "email", "inbox", "communication" ], + "char": "\ud83d\udcec", + fitzpatrick_scale: false, + category: "objects" + }, + mailbox_with_no_mail: { + keywords: [ "email", "inbox" ], + "char": "\ud83d\udced", + fitzpatrick_scale: false, + category: "objects" + }, + "package": { + keywords: [ "mail", "gift", "cardboard", "box", "moving" ], + "char": "\ud83d\udce6", + fitzpatrick_scale: false, + category: "objects" + }, + postal_horn: { + keywords: [ "instrument", "music" ], + "char": "\ud83d\udcef", + fitzpatrick_scale: false, + category: "objects" + }, + inbox_tray: { + keywords: [ "email", "documents" ], + "char": "\ud83d\udce5", + fitzpatrick_scale: false, + category: "objects" + }, + outbox_tray: { + keywords: [ "inbox", "email" ], + "char": "\ud83d\udce4", + fitzpatrick_scale: false, + category: "objects" + }, + scroll: { + keywords: [ "documents", "ancient", "history", "paper" ], + "char": "\ud83d\udcdc", + fitzpatrick_scale: false, + category: "objects" + }, + page_with_curl: { + keywords: [ "documents", "office", "paper" ], + "char": "\ud83d\udcc3", + fitzpatrick_scale: false, + category: "objects" + }, + bookmark_tabs: { + keywords: [ "favorite", "save", "order", "tidy" ], + "char": "\ud83d\udcd1", + fitzpatrick_scale: false, + category: "objects" + }, + receipt: { + keywords: [ "accounting", "expenses" ], + "char": "\ud83e\uddfe", + fitzpatrick_scale: false, + category: "objects" + }, + bar_chart: { + keywords: [ "graph", "presentation", "stats" ], + "char": "\ud83d\udcca", + fitzpatrick_scale: false, + category: "objects" + }, + chart_with_upwards_trend: { + keywords: [ "graph", "presentation", "stats", "recovery", "business", "economics", "money", "sales", "good", "success" ], + "char": "\ud83d\udcc8", + fitzpatrick_scale: false, + category: "objects" + }, + chart_with_downwards_trend: { + keywords: [ "graph", "presentation", "stats", "recession", "business", "economics", "money", "sales", "bad", "failure" ], + "char": "\ud83d\udcc9", + fitzpatrick_scale: false, + category: "objects" + }, + page_facing_up: { + keywords: [ "documents", "office", "paper", "information" ], + "char": "\ud83d\udcc4", + fitzpatrick_scale: false, + category: "objects" + }, + date: { + keywords: [ "calendar", "schedule" ], + "char": "\ud83d\udcc5", + fitzpatrick_scale: false, + category: "objects" + }, + calendar: { + keywords: [ "schedule", "date", "planning" ], + "char": "\ud83d\udcc6", + fitzpatrick_scale: false, + category: "objects" + }, + spiral_calendar: { + keywords: [ "date", "schedule", "planning" ], + "char": "\ud83d\uddd3", + fitzpatrick_scale: false, + category: "objects" + }, + card_index: { + keywords: [ "business", "stationery" ], + "char": "\ud83d\udcc7", + fitzpatrick_scale: false, + category: "objects" + }, + card_file_box: { + keywords: [ "business", "stationery" ], + "char": "\ud83d\uddc3", + fitzpatrick_scale: false, + category: "objects" + }, + ballot_box: { + keywords: [ "election", "vote" ], + "char": "\ud83d\uddf3", + fitzpatrick_scale: false, + category: "objects" + }, + file_cabinet: { + keywords: [ "filing", "organizing" ], + "char": "\ud83d\uddc4", + fitzpatrick_scale: false, + category: "objects" + }, + clipboard: { + keywords: [ "stationery", "documents" ], + "char": "\ud83d\udccb", + fitzpatrick_scale: false, + category: "objects" + }, + spiral_notepad: { + keywords: [ "memo", "stationery" ], + "char": "\ud83d\uddd2", + fitzpatrick_scale: false, + category: "objects" + }, + file_folder: { + keywords: [ "documents", "business", "office" ], + "char": "\ud83d\udcc1", + fitzpatrick_scale: false, + category: "objects" + }, + open_file_folder: { + keywords: [ "documents", "load" ], + "char": "\ud83d\udcc2", + fitzpatrick_scale: false, + category: "objects" + }, + card_index_dividers: { + keywords: [ "organizing", "business", "stationery" ], + "char": "\ud83d\uddc2", + fitzpatrick_scale: false, + category: "objects" + }, + newspaper_roll: { + keywords: [ "press", "headline" ], + "char": "\ud83d\uddde", + fitzpatrick_scale: false, + category: "objects" + }, + newspaper: { + keywords: [ "press", "headline" ], + "char": "\ud83d\udcf0", + fitzpatrick_scale: false, + category: "objects" + }, + notebook: { + keywords: [ "stationery", "record", "notes", "paper", "study" ], + "char": "\ud83d\udcd3", + fitzpatrick_scale: false, + category: "objects" + }, + closed_book: { + keywords: [ "read", "library", "knowledge", "textbook", "learn" ], + "char": "\ud83d\udcd5", + fitzpatrick_scale: false, + category: "objects" + }, + green_book: { + keywords: [ "read", "library", "knowledge", "study" ], + "char": "\ud83d\udcd7", + fitzpatrick_scale: false, + category: "objects" + }, + blue_book: { + keywords: [ "read", "library", "knowledge", "learn", "study" ], + "char": "\ud83d\udcd8", + fitzpatrick_scale: false, + category: "objects" + }, + orange_book: { + keywords: [ "read", "library", "knowledge", "textbook", "study" ], + "char": "\ud83d\udcd9", + fitzpatrick_scale: false, + category: "objects" + }, + notebook_with_decorative_cover: { + keywords: [ "classroom", "notes", "record", "paper", "study" ], + "char": "\ud83d\udcd4", + fitzpatrick_scale: false, + category: "objects" + }, + ledger: { + keywords: [ "notes", "paper" ], + "char": "\ud83d\udcd2", + fitzpatrick_scale: false, + category: "objects" + }, + books: { + keywords: [ "literature", "library", "study" ], + "char": "\ud83d\udcda", + fitzpatrick_scale: false, + category: "objects" + }, + open_book: { + keywords: [ "book", "read", "library", "knowledge", "literature", "learn", "study" ], + "char": "\ud83d\udcd6", + fitzpatrick_scale: false, + category: "objects" + }, + safety_pin: { + keywords: [ "diaper" ], + "char": "\ud83e\uddf7", + fitzpatrick_scale: false, + category: "objects" + }, + link: { + keywords: [ "rings", "url" ], + "char": "\ud83d\udd17", + fitzpatrick_scale: false, + category: "objects" + }, + paperclip: { + keywords: [ "documents", "stationery" ], + "char": "\ud83d\udcce", + fitzpatrick_scale: false, + category: "objects" + }, + paperclips: { + keywords: [ "documents", "stationery" ], + "char": "\ud83d\udd87", + fitzpatrick_scale: false, + category: "objects" + }, + scissors: { + keywords: [ "stationery", "cut" ], + "char": "\u2702\ufe0f", + fitzpatrick_scale: false, + category: "objects" + }, + triangular_ruler: { + keywords: [ "stationery", "math", "architect", "sketch" ], + "char": "\ud83d\udcd0", + fitzpatrick_scale: false, + category: "objects" + }, + straight_ruler: { + keywords: [ "stationery", "calculate", "length", "math", "school", "drawing", "architect", "sketch" ], + "char": "\ud83d\udccf", + fitzpatrick_scale: false, + category: "objects" + }, + abacus: { + keywords: [ "calculation" ], + "char": "\ud83e\uddee", + fitzpatrick_scale: false, + category: "objects" + }, + pushpin: { + keywords: [ "stationery", "mark", "here" ], + "char": "\ud83d\udccc", + fitzpatrick_scale: false, + category: "objects" + }, + round_pushpin: { + keywords: [ "stationery", "location", "map", "here" ], + "char": "\ud83d\udccd", + fitzpatrick_scale: false, + category: "objects" + }, + triangular_flag_on_post: { + keywords: [ "mark", "milestone", "place" ], + "char": "\ud83d\udea9", + fitzpatrick_scale: false, + category: "objects" + }, + white_flag: { + keywords: [ "losing", "loser", "lost", "surrender", "give up", "fail" ], + "char": "\ud83c\udff3", + fitzpatrick_scale: false, + category: "objects" + }, + black_flag: { + keywords: [ "pirate" ], + "char": "\ud83c\udff4", + fitzpatrick_scale: false, + category: "objects" + }, + rainbow_flag: { + keywords: [ "flag", "rainbow", "pride", "gay", "lgbt", "glbt", "queer", "homosexual", "lesbian", "bisexual", "transgender" ], + "char": "\ud83c\udff3\ufe0f\u200d\ud83c\udf08", + fitzpatrick_scale: false, + category: "objects" + }, + closed_lock_with_key: { + keywords: [ "security", "privacy" ], + "char": "\ud83d\udd10", + fitzpatrick_scale: false, + category: "objects" + }, + lock: { + keywords: [ "security", "password", "padlock" ], + "char": "\ud83d\udd12", + fitzpatrick_scale: false, + category: "objects" + }, + unlock: { + keywords: [ "privacy", "security" ], + "char": "\ud83d\udd13", + fitzpatrick_scale: false, + category: "objects" + }, + lock_with_ink_pen: { + keywords: [ "security", "secret" ], + "char": "\ud83d\udd0f", + fitzpatrick_scale: false, + category: "objects" + }, + pen: { + keywords: [ "stationery", "writing", "write" ], + "char": "\ud83d\udd8a", + fitzpatrick_scale: false, + category: "objects" + }, + fountain_pen: { + keywords: [ "stationery", "writing", "write" ], + "char": "\ud83d\udd8b", + fitzpatrick_scale: false, + category: "objects" + }, + black_nib: { + keywords: [ "pen", "stationery", "writing", "write" ], + "char": "\u2712\ufe0f", + fitzpatrick_scale: false, + category: "objects" + }, + memo: { + keywords: [ "write", "documents", "stationery", "pencil", "paper", "writing", "legal", "exam", "quiz", "test", "study", "compose" ], + "char": "\ud83d\udcdd", + fitzpatrick_scale: false, + category: "objects" + }, + pencil2: { + keywords: [ "stationery", "write", "paper", "writing", "school", "study" ], + "char": "\u270f\ufe0f", + fitzpatrick_scale: false, + category: "objects" + }, + crayon: { + keywords: [ "drawing", "creativity" ], + "char": "\ud83d\udd8d", + fitzpatrick_scale: false, + category: "objects" + }, + paintbrush: { + keywords: [ "drawing", "creativity", "art" ], + "char": "\ud83d\udd8c", + fitzpatrick_scale: false, + category: "objects" + }, + mag: { + keywords: [ "search", "zoom", "find", "detective" ], + "char": "\ud83d\udd0d", + fitzpatrick_scale: false, + category: "objects" + }, + mag_right: { + keywords: [ "search", "zoom", "find", "detective" ], + "char": "\ud83d\udd0e", + fitzpatrick_scale: false, + category: "objects" + }, + heart: { + keywords: [ "love", "like", "valentines" ], + "char": "\u2764\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + orange_heart: { + keywords: [ "love", "like", "affection", "valentines" ], + "char": "\ud83e\udde1", + fitzpatrick_scale: false, + category: "symbols" + }, + yellow_heart: { + keywords: [ "love", "like", "affection", "valentines" ], + "char": "\ud83d\udc9b", + fitzpatrick_scale: false, + category: "symbols" + }, + green_heart: { + keywords: [ "love", "like", "affection", "valentines" ], + "char": "\ud83d\udc9a", + fitzpatrick_scale: false, + category: "symbols" + }, + blue_heart: { + keywords: [ "love", "like", "affection", "valentines" ], + "char": "\ud83d\udc99", + fitzpatrick_scale: false, + category: "symbols" + }, + purple_heart: { + keywords: [ "love", "like", "affection", "valentines" ], + "char": "\ud83d\udc9c", + fitzpatrick_scale: false, + category: "symbols" + }, + black_heart: { + keywords: [ "evil" ], + "char": "\ud83d\udda4", + fitzpatrick_scale: false, + category: "symbols" + }, + broken_heart: { + keywords: [ "sad", "sorry", "break", "heart", "heartbreak" ], + "char": "\ud83d\udc94", + fitzpatrick_scale: false, + category: "symbols" + }, + heavy_heart_exclamation: { + keywords: [ "decoration", "love" ], + "char": "\u2763", + fitzpatrick_scale: false, + category: "symbols" + }, + two_hearts: { + keywords: [ "love", "like", "affection", "valentines", "heart" ], + "char": "\ud83d\udc95", + fitzpatrick_scale: false, + category: "symbols" + }, + revolving_hearts: { + keywords: [ "love", "like", "affection", "valentines" ], + "char": "\ud83d\udc9e", + fitzpatrick_scale: false, + category: "symbols" + }, + heartbeat: { + keywords: [ "love", "like", "affection", "valentines", "pink", "heart" ], + "char": "\ud83d\udc93", + fitzpatrick_scale: false, + category: "symbols" + }, + heartpulse: { + keywords: [ "like", "love", "affection", "valentines", "pink" ], + "char": "\ud83d\udc97", + fitzpatrick_scale: false, + category: "symbols" + }, + sparkling_heart: { + keywords: [ "love", "like", "affection", "valentines" ], + "char": "\ud83d\udc96", + fitzpatrick_scale: false, + category: "symbols" + }, + cupid: { + keywords: [ "love", "like", "heart", "affection", "valentines" ], + "char": "\ud83d\udc98", + fitzpatrick_scale: false, + category: "symbols" + }, + gift_heart: { + keywords: [ "love", "valentines" ], + "char": "\ud83d\udc9d", + fitzpatrick_scale: false, + category: "symbols" + }, + heart_decoration: { + keywords: [ "purple-square", "love", "like" ], + "char": "\ud83d\udc9f", + fitzpatrick_scale: false, + category: "symbols" + }, + peace_symbol: { + keywords: [ "hippie" ], + "char": "\u262e", + fitzpatrick_scale: false, + category: "symbols" + }, + latin_cross: { + keywords: [ "christianity" ], + "char": "\u271d", + fitzpatrick_scale: false, + category: "symbols" + }, + star_and_crescent: { + keywords: [ "islam" ], + "char": "\u262a", + fitzpatrick_scale: false, + category: "symbols" + }, + om: { + keywords: [ "hinduism", "buddhism", "sikhism", "jainism" ], + "char": "\ud83d\udd49", + fitzpatrick_scale: false, + category: "symbols" + }, + wheel_of_dharma: { + keywords: [ "hinduism", "buddhism", "sikhism", "jainism" ], + "char": "\u2638", + fitzpatrick_scale: false, + category: "symbols" + }, + star_of_david: { + keywords: [ "judaism" ], + "char": "\u2721", + fitzpatrick_scale: false, + category: "symbols" + }, + six_pointed_star: { + keywords: [ "purple-square", "religion", "jewish", "hexagram" ], + "char": "\ud83d\udd2f", + fitzpatrick_scale: false, + category: "symbols" + }, + menorah: { + keywords: [ "hanukkah", "candles", "jewish" ], + "char": "\ud83d\udd4e", + fitzpatrick_scale: false, + category: "symbols" + }, + yin_yang: { + keywords: [ "balance" ], + "char": "\u262f", + fitzpatrick_scale: false, + category: "symbols" + }, + orthodox_cross: { + keywords: [ "suppedaneum", "religion" ], + "char": "\u2626", + fitzpatrick_scale: false, + category: "symbols" + }, + place_of_worship: { + keywords: [ "religion", "church", "temple", "prayer" ], + "char": "\ud83d\uded0", + fitzpatrick_scale: false, + category: "symbols" + }, + ophiuchus: { + keywords: [ "sign", "purple-square", "constellation", "astrology" ], + "char": "\u26ce", + fitzpatrick_scale: false, + category: "symbols" + }, + aries: { + keywords: [ "sign", "purple-square", "zodiac", "astrology" ], + "char": "\u2648", + fitzpatrick_scale: false, + category: "symbols" + }, + taurus: { + keywords: [ "purple-square", "sign", "zodiac", "astrology" ], + "char": "\u2649", + fitzpatrick_scale: false, + category: "symbols" + }, + gemini: { + keywords: [ "sign", "zodiac", "purple-square", "astrology" ], + "char": "\u264a", + fitzpatrick_scale: false, + category: "symbols" + }, + cancer: { + keywords: [ "sign", "zodiac", "purple-square", "astrology" ], + "char": "\u264b", + fitzpatrick_scale: false, + category: "symbols" + }, + leo: { + keywords: [ "sign", "purple-square", "zodiac", "astrology" ], + "char": "\u264c", + fitzpatrick_scale: false, + category: "symbols" + }, + virgo: { + keywords: [ "sign", "zodiac", "purple-square", "astrology" ], + "char": "\u264d", + fitzpatrick_scale: false, + category: "symbols" + }, + libra: { + keywords: [ "sign", "purple-square", "zodiac", "astrology" ], + "char": "\u264e", + fitzpatrick_scale: false, + category: "symbols" + }, + scorpius: { + keywords: [ "sign", "zodiac", "purple-square", "astrology", "scorpio" ], + "char": "\u264f", + fitzpatrick_scale: false, + category: "symbols" + }, + sagittarius: { + keywords: [ "sign", "zodiac", "purple-square", "astrology" ], + "char": "\u2650", + fitzpatrick_scale: false, + category: "symbols" + }, + capricorn: { + keywords: [ "sign", "zodiac", "purple-square", "astrology" ], + "char": "\u2651", + fitzpatrick_scale: false, + category: "symbols" + }, + aquarius: { + keywords: [ "sign", "purple-square", "zodiac", "astrology" ], + "char": "\u2652", + fitzpatrick_scale: false, + category: "symbols" + }, + pisces: { + keywords: [ "purple-square", "sign", "zodiac", "astrology" ], + "char": "\u2653", + fitzpatrick_scale: false, + category: "symbols" + }, + id: { + keywords: [ "purple-square", "words" ], + "char": "\ud83c\udd94", + fitzpatrick_scale: false, + category: "symbols" + }, + atom_symbol: { + keywords: [ "science", "physics", "chemistry" ], + "char": "\u269b", + fitzpatrick_scale: false, + category: "symbols" + }, + u7a7a: { + keywords: [ "kanji", "japanese", "chinese", "empty", "sky", "blue-square" ], + "char": "\ud83c\ude33", + fitzpatrick_scale: false, + category: "symbols" + }, + u5272: { + keywords: [ "cut", "divide", "chinese", "kanji", "pink-square" ], + "char": "\ud83c\ude39", + fitzpatrick_scale: false, + category: "symbols" + }, + radioactive: { + keywords: [ "nuclear", "danger" ], + "char": "\u2622", + fitzpatrick_scale: false, + category: "symbols" + }, + biohazard: { + keywords: [ "danger" ], + "char": "\u2623", + fitzpatrick_scale: false, + category: "symbols" + }, + mobile_phone_off: { + keywords: [ "mute", "orange-square", "silence", "quiet" ], + "char": "\ud83d\udcf4", + fitzpatrick_scale: false, + category: "symbols" + }, + vibration_mode: { + keywords: [ "orange-square", "phone" ], + "char": "\ud83d\udcf3", + fitzpatrick_scale: false, + category: "symbols" + }, + u6709: { + keywords: [ "orange-square", "chinese", "have", "kanji" ], + "char": "\ud83c\ude36", + fitzpatrick_scale: false, + category: "symbols" + }, + u7121: { + keywords: [ "nothing", "chinese", "kanji", "japanese", "orange-square" ], + "char": "\ud83c\ude1a", + fitzpatrick_scale: false, + category: "symbols" + }, + u7533: { + keywords: [ "chinese", "japanese", "kanji", "orange-square" ], + "char": "\ud83c\ude38", + fitzpatrick_scale: false, + category: "symbols" + }, + u55b6: { + keywords: [ "japanese", "opening hours", "orange-square" ], + "char": "\ud83c\ude3a", + fitzpatrick_scale: false, + category: "symbols" + }, + u6708: { + keywords: [ "chinese", "month", "moon", "japanese", "orange-square", "kanji" ], + "char": "\ud83c\ude37\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + eight_pointed_black_star: { + keywords: [ "orange-square", "shape", "polygon" ], + "char": "\u2734\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + vs: { + keywords: [ "words", "orange-square" ], + "char": "\ud83c\udd9a", + fitzpatrick_scale: false, + category: "symbols" + }, + accept: { + keywords: [ "ok", "good", "chinese", "kanji", "agree", "yes", "orange-circle" ], + "char": "\ud83c\ude51", + fitzpatrick_scale: false, + category: "symbols" + }, + white_flower: { + keywords: [ "japanese", "spring" ], + "char": "\ud83d\udcae", + fitzpatrick_scale: false, + category: "symbols" + }, + ideograph_advantage: { + keywords: [ "chinese", "kanji", "obtain", "get", "circle" ], + "char": "\ud83c\ude50", + fitzpatrick_scale: false, + category: "symbols" + }, + secret: { + keywords: [ "privacy", "chinese", "sshh", "kanji", "red-circle" ], + "char": "\u3299\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + congratulations: { + keywords: [ "chinese", "kanji", "japanese", "red-circle" ], + "char": "\u3297\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + u5408: { + keywords: [ "japanese", "chinese", "join", "kanji", "red-square" ], + "char": "\ud83c\ude34", + fitzpatrick_scale: false, + category: "symbols" + }, + u6e80: { + keywords: [ "full", "chinese", "japanese", "red-square", "kanji" ], + "char": "\ud83c\ude35", + fitzpatrick_scale: false, + category: "symbols" + }, + u7981: { + keywords: [ "kanji", "japanese", "chinese", "forbidden", "limit", "restricted", "red-square" ], + "char": "\ud83c\ude32", + fitzpatrick_scale: false, + category: "symbols" + }, + a: { + keywords: [ "red-square", "alphabet", "letter" ], + "char": "\ud83c\udd70\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + b: { + keywords: [ "red-square", "alphabet", "letter" ], + "char": "\ud83c\udd71\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + ab: { + keywords: [ "red-square", "alphabet" ], + "char": "\ud83c\udd8e", + fitzpatrick_scale: false, + category: "symbols" + }, + cl: { + keywords: [ "alphabet", "words", "red-square" ], + "char": "\ud83c\udd91", + fitzpatrick_scale: false, + category: "symbols" + }, + o2: { + keywords: [ "alphabet", "red-square", "letter" ], + "char": "\ud83c\udd7e\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + sos: { + keywords: [ "help", "red-square", "words", "emergency", "911" ], + "char": "\ud83c\udd98", + fitzpatrick_scale: false, + category: "symbols" + }, + no_entry: { + keywords: [ "limit", "security", "privacy", "bad", "denied", "stop", "circle" ], + "char": "\u26d4", + fitzpatrick_scale: false, + category: "symbols" + }, + name_badge: { + keywords: [ "fire", "forbid" ], + "char": "\ud83d\udcdb", + fitzpatrick_scale: false, + category: "symbols" + }, + no_entry_sign: { + keywords: [ "forbid", "stop", "limit", "denied", "disallow", "circle" ], + "char": "\ud83d\udeab", + fitzpatrick_scale: false, + category: "symbols" + }, + x: { + keywords: [ "no", "delete", "remove", "cancel", "red" ], + "char": "\u274c", + fitzpatrick_scale: false, + category: "symbols" + }, + o: { + keywords: [ "circle", "round" ], + "char": "\u2b55", + fitzpatrick_scale: false, + category: "symbols" + }, + stop_sign: { + keywords: [ "stop" ], + "char": "\ud83d\uded1", + fitzpatrick_scale: false, + category: "symbols" + }, + anger: { + keywords: [ "angry", "mad" ], + "char": "\ud83d\udca2", + fitzpatrick_scale: false, + category: "symbols" + }, + hotsprings: { + keywords: [ "bath", "warm", "relax" ], + "char": "\u2668\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + no_pedestrians: { + keywords: [ "rules", "crossing", "walking", "circle" ], + "char": "\ud83d\udeb7", + fitzpatrick_scale: false, + category: "symbols" + }, + do_not_litter: { + keywords: [ "trash", "bin", "garbage", "circle" ], + "char": "\ud83d\udeaf", + fitzpatrick_scale: false, + category: "symbols" + }, + no_bicycles: { + keywords: [ "cyclist", "prohibited", "circle" ], + "char": "\ud83d\udeb3", + fitzpatrick_scale: false, + category: "symbols" + }, + "non-potable_water": { + keywords: [ "drink", "faucet", "tap", "circle" ], + "char": "\ud83d\udeb1", + fitzpatrick_scale: false, + category: "symbols" + }, + underage: { + keywords: [ "18", "drink", "pub", "night", "minor", "circle" ], + "char": "\ud83d\udd1e", + fitzpatrick_scale: false, + category: "symbols" + }, + no_mobile_phones: { + keywords: [ "iphone", "mute", "circle" ], + "char": "\ud83d\udcf5", + fitzpatrick_scale: false, + category: "symbols" + }, + exclamation: { + keywords: [ "heavy_exclamation_mark", "danger", "surprise", "punctuation", "wow", "warning" ], + "char": "\u2757", + fitzpatrick_scale: false, + category: "symbols" + }, + grey_exclamation: { + keywords: [ "surprise", "punctuation", "gray", "wow", "warning" ], + "char": "\u2755", + fitzpatrick_scale: false, + category: "symbols" + }, + question: { + keywords: [ "doubt", "confused" ], + "char": "\u2753", + fitzpatrick_scale: false, + category: "symbols" + }, + grey_question: { + keywords: [ "doubts", "gray", "huh", "confused" ], + "char": "\u2754", + fitzpatrick_scale: false, + category: "symbols" + }, + bangbang: { + keywords: [ "exclamation", "surprise" ], + "char": "\u203c\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + interrobang: { + keywords: [ "wat", "punctuation", "surprise" ], + "char": "\u2049\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + 100: { + keywords: [ "score", "perfect", "numbers", "century", "exam", "quiz", "test", "pass", "hundred" ], + "char": "\ud83d\udcaf", + fitzpatrick_scale: false, + category: "symbols" + }, + low_brightness: { + keywords: [ "sun", "afternoon", "warm", "summer" ], + "char": "\ud83d\udd05", + fitzpatrick_scale: false, + category: "symbols" + }, + high_brightness: { + keywords: [ "sun", "light" ], + "char": "\ud83d\udd06", + fitzpatrick_scale: false, + category: "symbols" + }, + trident: { + keywords: [ "weapon", "spear" ], + "char": "\ud83d\udd31", + fitzpatrick_scale: false, + category: "symbols" + }, + fleur_de_lis: { + keywords: [ "decorative", "scout" ], + "char": "\u269c", + fitzpatrick_scale: false, + category: "symbols" + }, + part_alternation_mark: { + keywords: [ "graph", "presentation", "stats", "business", "economics", "bad" ], + "char": "\u303d\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + warning: { + keywords: [ "exclamation", "wip", "alert", "error", "problem", "issue" ], + "char": "\u26a0\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + children_crossing: { + keywords: [ "school", "warning", "danger", "sign", "driving", "yellow-diamond" ], + "char": "\ud83d\udeb8", + fitzpatrick_scale: false, + category: "symbols" + }, + beginner: { + keywords: [ "badge", "shield" ], + "char": "\ud83d\udd30", + fitzpatrick_scale: false, + category: "symbols" + }, + recycle: { + keywords: [ "arrow", "environment", "garbage", "trash" ], + "char": "\u267b\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + u6307: { + keywords: [ "chinese", "point", "green-square", "kanji" ], + "char": "\ud83c\ude2f", + fitzpatrick_scale: false, + category: "symbols" + }, + chart: { + keywords: [ "green-square", "graph", "presentation", "stats" ], + "char": "\ud83d\udcb9", + fitzpatrick_scale: false, + category: "symbols" + }, + sparkle: { + keywords: [ "stars", "green-square", "awesome", "good", "fireworks" ], + "char": "\u2747\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + eight_spoked_asterisk: { + keywords: [ "star", "sparkle", "green-square" ], + "char": "\u2733\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + negative_squared_cross_mark: { + keywords: [ "x", "green-square", "no", "deny" ], + "char": "\u274e", + fitzpatrick_scale: false, + category: "symbols" + }, + white_check_mark: { + keywords: [ "green-square", "ok", "agree", "vote", "election", "answer", "tick" ], + "char": "\u2705", + fitzpatrick_scale: false, + category: "symbols" + }, + diamond_shape_with_a_dot_inside: { + keywords: [ "jewel", "blue", "gem", "crystal", "fancy" ], + "char": "\ud83d\udca0", + fitzpatrick_scale: false, + category: "symbols" + }, + cyclone: { + keywords: [ "weather", "swirl", "blue", "cloud", "vortex", "spiral", "whirlpool", "spin", "tornado", "hurricane", "typhoon" ], + "char": "\ud83c\udf00", + fitzpatrick_scale: false, + category: "symbols" + }, + loop: { + keywords: [ "tape", "cassette" ], + "char": "\u27bf", + fitzpatrick_scale: false, + category: "symbols" + }, + globe_with_meridians: { + keywords: [ "earth", "international", "world", "internet", "interweb", "i18n" ], + "char": "\ud83c\udf10", + fitzpatrick_scale: false, + category: "symbols" + }, + m: { + keywords: [ "alphabet", "blue-circle", "letter" ], + "char": "\u24c2\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + atm: { + keywords: [ "money", "sales", "cash", "blue-square", "payment", "bank" ], + "char": "\ud83c\udfe7", + fitzpatrick_scale: false, + category: "symbols" + }, + sa: { + keywords: [ "japanese", "blue-square", "katakana" ], + "char": "\ud83c\ude02\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + passport_control: { + keywords: [ "custom", "blue-square" ], + "char": "\ud83d\udec2", + fitzpatrick_scale: false, + category: "symbols" + }, + customs: { + keywords: [ "passport", "border", "blue-square" ], + "char": "\ud83d\udec3", + fitzpatrick_scale: false, + category: "symbols" + }, + baggage_claim: { + keywords: [ "blue-square", "airport", "transport" ], + "char": "\ud83d\udec4", + fitzpatrick_scale: false, + category: "symbols" + }, + left_luggage: { + keywords: [ "blue-square", "travel" ], + "char": "\ud83d\udec5", + fitzpatrick_scale: false, + category: "symbols" + }, + wheelchair: { + keywords: [ "blue-square", "disabled", "a11y", "accessibility" ], + "char": "\u267f", + fitzpatrick_scale: false, + category: "symbols" + }, + no_smoking: { + keywords: [ "cigarette", "blue-square", "smell", "smoke" ], + "char": "\ud83d\udead", + fitzpatrick_scale: false, + category: "symbols" + }, + wc: { + keywords: [ "toilet", "restroom", "blue-square" ], + "char": "\ud83d\udebe", + fitzpatrick_scale: false, + category: "symbols" + }, + parking: { + keywords: [ "cars", "blue-square", "alphabet", "letter" ], + "char": "\ud83c\udd7f\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + potable_water: { + keywords: [ "blue-square", "liquid", "restroom", "cleaning", "faucet" ], + "char": "\ud83d\udeb0", + fitzpatrick_scale: false, + category: "symbols" + }, + mens: { + keywords: [ "toilet", "restroom", "wc", "blue-square", "gender", "male" ], + "char": "\ud83d\udeb9", + fitzpatrick_scale: false, + category: "symbols" + }, + womens: { + keywords: [ "purple-square", "woman", "female", "toilet", "loo", "restroom", "gender" ], + "char": "\ud83d\udeba", + fitzpatrick_scale: false, + category: "symbols" + }, + baby_symbol: { + keywords: [ "orange-square", "child" ], + "char": "\ud83d\udebc", + fitzpatrick_scale: false, + category: "symbols" + }, + restroom: { + keywords: [ "blue-square", "toilet", "refresh", "wc", "gender" ], + "char": "\ud83d\udebb", + fitzpatrick_scale: false, + category: "symbols" + }, + put_litter_in_its_place: { + keywords: [ "blue-square", "sign", "human", "info" ], + "char": "\ud83d\udeae", + fitzpatrick_scale: false, + category: "symbols" + }, + cinema: { + keywords: [ "blue-square", "record", "film", "movie", "curtain", "stage", "theater" ], + "char": "\ud83c\udfa6", + fitzpatrick_scale: false, + category: "symbols" + }, + signal_strength: { + keywords: [ "blue-square", "reception", "phone", "internet", "connection", "wifi", "bluetooth", "bars" ], + "char": "\ud83d\udcf6", + fitzpatrick_scale: false, + category: "symbols" + }, + koko: { + keywords: [ "blue-square", "here", "katakana", "japanese", "destination" ], + "char": "\ud83c\ude01", + fitzpatrick_scale: false, + category: "symbols" + }, + ng: { + keywords: [ "blue-square", "words", "shape", "icon" ], + "char": "\ud83c\udd96", + fitzpatrick_scale: false, + category: "symbols" + }, + ok: { + keywords: [ "good", "agree", "yes", "blue-square" ], + "char": "\ud83c\udd97", + fitzpatrick_scale: false, + category: "symbols" + }, + up: { + keywords: [ "blue-square", "above", "high" ], + "char": "\ud83c\udd99", + fitzpatrick_scale: false, + category: "symbols" + }, + cool: { + keywords: [ "words", "blue-square" ], + "char": "\ud83c\udd92", + fitzpatrick_scale: false, + category: "symbols" + }, + "new": { + keywords: [ "blue-square", "words", "start" ], + "char": "\ud83c\udd95", + fitzpatrick_scale: false, + category: "symbols" + }, + free: { + keywords: [ "blue-square", "words" ], + "char": "\ud83c\udd93", + fitzpatrick_scale: false, + category: "symbols" + }, + zero: { + keywords: [ "0", "numbers", "blue-square", "null" ], + "char": "0\ufe0f\u20e3", + fitzpatrick_scale: false, + category: "symbols" + }, + one: { + keywords: [ "blue-square", "numbers", "1" ], + "char": "1\ufe0f\u20e3", + fitzpatrick_scale: false, + category: "symbols" + }, + two: { + keywords: [ "numbers", "2", "prime", "blue-square" ], + "char": "2\ufe0f\u20e3", + fitzpatrick_scale: false, + category: "symbols" + }, + three: { + keywords: [ "3", "numbers", "prime", "blue-square" ], + "char": "3\ufe0f\u20e3", + fitzpatrick_scale: false, + category: "symbols" + }, + four: { + keywords: [ "4", "numbers", "blue-square" ], + "char": "4\ufe0f\u20e3", + fitzpatrick_scale: false, + category: "symbols" + }, + five: { + keywords: [ "5", "numbers", "blue-square", "prime" ], + "char": "5\ufe0f\u20e3", + fitzpatrick_scale: false, + category: "symbols" + }, + six: { + keywords: [ "6", "numbers", "blue-square" ], + "char": "6\ufe0f\u20e3", + fitzpatrick_scale: false, + category: "symbols" + }, + seven: { + keywords: [ "7", "numbers", "blue-square", "prime" ], + "char": "7\ufe0f\u20e3", + fitzpatrick_scale: false, + category: "symbols" + }, + eight: { + keywords: [ "8", "blue-square", "numbers" ], + "char": "8\ufe0f\u20e3", + fitzpatrick_scale: false, + category: "symbols" + }, + nine: { + keywords: [ "blue-square", "numbers", "9" ], + "char": "9\ufe0f\u20e3", + fitzpatrick_scale: false, + category: "symbols" + }, + keycap_ten: { + keywords: [ "numbers", "10", "blue-square" ], + "char": "\ud83d\udd1f", + fitzpatrick_scale: false, + category: "symbols" + }, + asterisk: { + keywords: [ "star", "keycap" ], + "char": "*\u20e3", + fitzpatrick_scale: false, + category: "symbols" + }, + 1234: { + keywords: [ "numbers", "blue-square" ], + "char": "\ud83d\udd22", + fitzpatrick_scale: false, + category: "symbols" + }, + eject_button: { + keywords: [ "blue-square" ], + "char": "\u23cf\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_forward: { + keywords: [ "blue-square", "right", "direction", "play" ], + "char": "\u25b6\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + pause_button: { + keywords: [ "pause", "blue-square" ], + "char": "\u23f8", + fitzpatrick_scale: false, + category: "symbols" + }, + next_track_button: { + keywords: [ "forward", "next", "blue-square" ], + "char": "\u23ed", + fitzpatrick_scale: false, + category: "symbols" + }, + stop_button: { + keywords: [ "blue-square" ], + "char": "\u23f9", + fitzpatrick_scale: false, + category: "symbols" + }, + record_button: { + keywords: [ "blue-square" ], + "char": "\u23fa", + fitzpatrick_scale: false, + category: "symbols" + }, + play_or_pause_button: { + keywords: [ "blue-square", "play", "pause" ], + "char": "\u23ef", + fitzpatrick_scale: false, + category: "symbols" + }, + previous_track_button: { + keywords: [ "backward" ], + "char": "\u23ee", + fitzpatrick_scale: false, + category: "symbols" + }, + fast_forward: { + keywords: [ "blue-square", "play", "speed", "continue" ], + "char": "\u23e9", + fitzpatrick_scale: false, + category: "symbols" + }, + rewind: { + keywords: [ "play", "blue-square" ], + "char": "\u23ea", + fitzpatrick_scale: false, + category: "symbols" + }, + twisted_rightwards_arrows: { + keywords: [ "blue-square", "shuffle", "music", "random" ], + "char": "\ud83d\udd00", + fitzpatrick_scale: false, + category: "symbols" + }, + repeat: { + keywords: [ "loop", "record" ], + "char": "\ud83d\udd01", + fitzpatrick_scale: false, + category: "symbols" + }, + repeat_one: { + keywords: [ "blue-square", "loop" ], + "char": "\ud83d\udd02", + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_backward: { + keywords: [ "blue-square", "left", "direction" ], + "char": "\u25c0\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_up_small: { + keywords: [ "blue-square", "triangle", "direction", "point", "forward", "top" ], + "char": "\ud83d\udd3c", + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_down_small: { + keywords: [ "blue-square", "direction", "bottom" ], + "char": "\ud83d\udd3d", + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_double_up: { + keywords: [ "blue-square", "direction", "top" ], + "char": "\u23eb", + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_double_down: { + keywords: [ "blue-square", "direction", "bottom" ], + "char": "\u23ec", + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_right: { + keywords: [ "blue-square", "next" ], + "char": "\u27a1\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_left: { + keywords: [ "blue-square", "previous", "back" ], + "char": "\u2b05\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_up: { + keywords: [ "blue-square", "continue", "top", "direction" ], + "char": "\u2b06\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_down: { + keywords: [ "blue-square", "direction", "bottom" ], + "char": "\u2b07\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_upper_right: { + keywords: [ "blue-square", "point", "direction", "diagonal", "northeast" ], + "char": "\u2197\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_lower_right: { + keywords: [ "blue-square", "direction", "diagonal", "southeast" ], + "char": "\u2198\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_lower_left: { + keywords: [ "blue-square", "direction", "diagonal", "southwest" ], + "char": "\u2199\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_upper_left: { + keywords: [ "blue-square", "point", "direction", "diagonal", "northwest" ], + "char": "\u2196\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_up_down: { + keywords: [ "blue-square", "direction", "way", "vertical" ], + "char": "\u2195\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + left_right_arrow: { + keywords: [ "shape", "direction", "horizontal", "sideways" ], + "char": "\u2194\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + arrows_counterclockwise: { + keywords: [ "blue-square", "sync", "cycle" ], + "char": "\ud83d\udd04", + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_right_hook: { + keywords: [ "blue-square", "return", "rotate", "direction" ], + "char": "\u21aa\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + leftwards_arrow_with_hook: { + keywords: [ "back", "return", "blue-square", "undo", "enter" ], + "char": "\u21a9\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_heading_up: { + keywords: [ "blue-square", "direction", "top" ], + "char": "\u2934\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + arrow_heading_down: { + keywords: [ "blue-square", "direction", "bottom" ], + "char": "\u2935\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + hash: { + keywords: [ "symbol", "blue-square", "twitter" ], + "char": "#\ufe0f\u20e3", + fitzpatrick_scale: false, + category: "symbols" + }, + information_source: { + keywords: [ "blue-square", "alphabet", "letter" ], + "char": "\u2139\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + abc: { + keywords: [ "blue-square", "alphabet" ], + "char": "\ud83d\udd24", + fitzpatrick_scale: false, + category: "symbols" + }, + abcd: { + keywords: [ "blue-square", "alphabet" ], + "char": "\ud83d\udd21", + fitzpatrick_scale: false, + category: "symbols" + }, + capital_abcd: { + keywords: [ "alphabet", "words", "blue-square" ], + "char": "\ud83d\udd20", + fitzpatrick_scale: false, + category: "symbols" + }, + symbols: { + keywords: [ "blue-square", "music", "note", "ampersand", "percent", "glyphs", "characters" ], + "char": "\ud83d\udd23", + fitzpatrick_scale: false, + category: "symbols" + }, + musical_note: { + keywords: [ "score", "tone", "sound" ], + "char": "\ud83c\udfb5", + fitzpatrick_scale: false, + category: "symbols" + }, + notes: { + keywords: [ "music", "score" ], + "char": "\ud83c\udfb6", + fitzpatrick_scale: false, + category: "symbols" + }, + wavy_dash: { + keywords: [ "draw", "line", "moustache", "mustache", "squiggle", "scribble" ], + "char": "\u3030\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + curly_loop: { + keywords: [ "scribble", "draw", "shape", "squiggle" ], + "char": "\u27b0", + fitzpatrick_scale: false, + category: "symbols" + }, + heavy_check_mark: { + keywords: [ "ok", "nike", "answer", "yes", "tick" ], + "char": "\u2714\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + arrows_clockwise: { + keywords: [ "sync", "cycle", "round", "repeat" ], + "char": "\ud83d\udd03", + fitzpatrick_scale: false, + category: "symbols" + }, + heavy_plus_sign: { + keywords: [ "math", "calculation", "addition", "more", "increase" ], + "char": "\u2795", + fitzpatrick_scale: false, + category: "symbols" + }, + heavy_minus_sign: { + keywords: [ "math", "calculation", "subtract", "less" ], + "char": "\u2796", + fitzpatrick_scale: false, + category: "symbols" + }, + heavy_division_sign: { + keywords: [ "divide", "math", "calculation" ], + "char": "\u2797", + fitzpatrick_scale: false, + category: "symbols" + }, + heavy_multiplication_x: { + keywords: [ "math", "calculation" ], + "char": "\u2716\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + infinity: { + keywords: [ "forever" ], + "char": "\u267e", + fitzpatrick_scale: false, + category: "symbols" + }, + heavy_dollar_sign: { + keywords: [ "money", "sales", "payment", "currency", "buck" ], + "char": "\ud83d\udcb2", + fitzpatrick_scale: false, + category: "symbols" + }, + currency_exchange: { + keywords: [ "money", "sales", "dollar", "travel" ], + "char": "\ud83d\udcb1", + fitzpatrick_scale: false, + category: "symbols" + }, + copyright: { + keywords: [ "ip", "license", "circle", "law", "legal" ], + "char": "\xa9\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + registered: { + keywords: [ "alphabet", "circle" ], + "char": "\xae\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + tm: { + keywords: [ "trademark", "brand", "law", "legal" ], + "char": "\u2122\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + end: { + keywords: [ "words", "arrow" ], + "char": "\ud83d\udd1a", + fitzpatrick_scale: false, + category: "symbols" + }, + back: { + keywords: [ "arrow", "words", "return" ], + "char": "\ud83d\udd19", + fitzpatrick_scale: false, + category: "symbols" + }, + on: { + keywords: [ "arrow", "words" ], + "char": "\ud83d\udd1b", + fitzpatrick_scale: false, + category: "symbols" + }, + top: { + keywords: [ "words", "blue-square" ], + "char": "\ud83d\udd1d", + fitzpatrick_scale: false, + category: "symbols" + }, + soon: { + keywords: [ "arrow", "words" ], + "char": "\ud83d\udd1c", + fitzpatrick_scale: false, + category: "symbols" + }, + ballot_box_with_check: { + keywords: [ "ok", "agree", "confirm", "black-square", "vote", "election", "yes", "tick" ], + "char": "\u2611\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + radio_button: { + keywords: [ "input", "old", "music", "circle" ], + "char": "\ud83d\udd18", + fitzpatrick_scale: false, + category: "symbols" + }, + white_circle: { + keywords: [ "shape", "round" ], + "char": "\u26aa", + fitzpatrick_scale: false, + category: "symbols" + }, + black_circle: { + keywords: [ "shape", "button", "round" ], + "char": "\u26ab", + fitzpatrick_scale: false, + category: "symbols" + }, + red_circle: { + keywords: [ "shape", "error", "danger" ], + "char": "\ud83d\udd34", + fitzpatrick_scale: false, + category: "symbols" + }, + large_blue_circle: { + keywords: [ "shape", "icon", "button" ], + "char": "\ud83d\udd35", + fitzpatrick_scale: false, + category: "symbols" + }, + small_orange_diamond: { + keywords: [ "shape", "jewel", "gem" ], + "char": "\ud83d\udd38", + fitzpatrick_scale: false, + category: "symbols" + }, + small_blue_diamond: { + keywords: [ "shape", "jewel", "gem" ], + "char": "\ud83d\udd39", + fitzpatrick_scale: false, + category: "symbols" + }, + large_orange_diamond: { + keywords: [ "shape", "jewel", "gem" ], + "char": "\ud83d\udd36", + fitzpatrick_scale: false, + category: "symbols" + }, + large_blue_diamond: { + keywords: [ "shape", "jewel", "gem" ], + "char": "\ud83d\udd37", + fitzpatrick_scale: false, + category: "symbols" + }, + small_red_triangle: { + keywords: [ "shape", "direction", "up", "top" ], + "char": "\ud83d\udd3a", + fitzpatrick_scale: false, + category: "symbols" + }, + black_small_square: { + keywords: [ "shape", "icon" ], + "char": "\u25aa\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + white_small_square: { + keywords: [ "shape", "icon" ], + "char": "\u25ab\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + black_large_square: { + keywords: [ "shape", "icon", "button" ], + "char": "\u2b1b", + fitzpatrick_scale: false, + category: "symbols" + }, + white_large_square: { + keywords: [ "shape", "icon", "stone", "button" ], + "char": "\u2b1c", + fitzpatrick_scale: false, + category: "symbols" + }, + small_red_triangle_down: { + keywords: [ "shape", "direction", "bottom" ], + "char": "\ud83d\udd3b", + fitzpatrick_scale: false, + category: "symbols" + }, + black_medium_square: { + keywords: [ "shape", "button", "icon" ], + "char": "\u25fc\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + white_medium_square: { + keywords: [ "shape", "stone", "icon" ], + "char": "\u25fb\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + black_medium_small_square: { + keywords: [ "icon", "shape", "button" ], + "char": "\u25fe", + fitzpatrick_scale: false, + category: "symbols" + }, + white_medium_small_square: { + keywords: [ "shape", "stone", "icon", "button" ], + "char": "\u25fd", + fitzpatrick_scale: false, + category: "symbols" + }, + black_square_button: { + keywords: [ "shape", "input", "frame" ], + "char": "\ud83d\udd32", + fitzpatrick_scale: false, + category: "symbols" + }, + white_square_button: { + keywords: [ "shape", "input" ], + "char": "\ud83d\udd33", + fitzpatrick_scale: false, + category: "symbols" + }, + speaker: { + keywords: [ "sound", "volume", "silence", "broadcast" ], + "char": "\ud83d\udd08", + fitzpatrick_scale: false, + category: "symbols" + }, + sound: { + keywords: [ "volume", "speaker", "broadcast" ], + "char": "\ud83d\udd09", + fitzpatrick_scale: false, + category: "symbols" + }, + loud_sound: { + keywords: [ "volume", "noise", "noisy", "speaker", "broadcast" ], + "char": "\ud83d\udd0a", + fitzpatrick_scale: false, + category: "symbols" + }, + mute: { + keywords: [ "sound", "volume", "silence", "quiet" ], + "char": "\ud83d\udd07", + fitzpatrick_scale: false, + category: "symbols" + }, + mega: { + keywords: [ "sound", "speaker", "volume" ], + "char": "\ud83d\udce3", + fitzpatrick_scale: false, + category: "symbols" + }, + loudspeaker: { + keywords: [ "volume", "sound" ], + "char": "\ud83d\udce2", + fitzpatrick_scale: false, + category: "symbols" + }, + bell: { + keywords: [ "sound", "notification", "christmas", "xmas", "chime" ], + "char": "\ud83d\udd14", + fitzpatrick_scale: false, + category: "symbols" + }, + no_bell: { + keywords: [ "sound", "volume", "mute", "quiet", "silent" ], + "char": "\ud83d\udd15", + fitzpatrick_scale: false, + category: "symbols" + }, + black_joker: { + keywords: [ "poker", "cards", "game", "play", "magic" ], + "char": "\ud83c\udccf", + fitzpatrick_scale: false, + category: "symbols" + }, + mahjong: { + keywords: [ "game", "play", "chinese", "kanji" ], + "char": "\ud83c\udc04", + fitzpatrick_scale: false, + category: "symbols" + }, + spades: { + keywords: [ "poker", "cards", "suits", "magic" ], + "char": "\u2660\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + clubs: { + keywords: [ "poker", "cards", "magic", "suits" ], + "char": "\u2663\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + hearts: { + keywords: [ "poker", "cards", "magic", "suits" ], + "char": "\u2665\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + diamonds: { + keywords: [ "poker", "cards", "magic", "suits" ], + "char": "\u2666\ufe0f", + fitzpatrick_scale: false, + category: "symbols" + }, + flower_playing_cards: { + keywords: [ "game", "sunset", "red" ], + "char": "\ud83c\udfb4", + fitzpatrick_scale: false, + category: "symbols" + }, + thought_balloon: { + keywords: [ "bubble", "cloud", "speech", "thinking", "dream" ], + "char": "\ud83d\udcad", + fitzpatrick_scale: false, + category: "symbols" + }, + right_anger_bubble: { + keywords: [ "caption", "speech", "thinking", "mad" ], + "char": "\ud83d\uddef", + fitzpatrick_scale: false, + category: "symbols" + }, + speech_balloon: { + keywords: [ "bubble", "words", "message", "talk", "chatting" ], + "char": "\ud83d\udcac", + fitzpatrick_scale: false, + category: "symbols" + }, + left_speech_bubble: { + keywords: [ "words", "message", "talk", "chatting" ], + "char": "\ud83d\udde8", + fitzpatrick_scale: false, + category: "symbols" + }, + clock1: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd50", + fitzpatrick_scale: false, + category: "symbols" + }, + clock2: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd51", + fitzpatrick_scale: false, + category: "symbols" + }, + clock3: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd52", + fitzpatrick_scale: false, + category: "symbols" + }, + clock4: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd53", + fitzpatrick_scale: false, + category: "symbols" + }, + clock5: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd54", + fitzpatrick_scale: false, + category: "symbols" + }, + clock6: { + keywords: [ "time", "late", "early", "schedule", "dawn", "dusk" ], + "char": "\ud83d\udd55", + fitzpatrick_scale: false, + category: "symbols" + }, + clock7: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd56", + fitzpatrick_scale: false, + category: "symbols" + }, + clock8: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd57", + fitzpatrick_scale: false, + category: "symbols" + }, + clock9: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd58", + fitzpatrick_scale: false, + category: "symbols" + }, + clock10: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd59", + fitzpatrick_scale: false, + category: "symbols" + }, + clock11: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd5a", + fitzpatrick_scale: false, + category: "symbols" + }, + clock12: { + keywords: [ "time", "noon", "midnight", "midday", "late", "early", "schedule" ], + "char": "\ud83d\udd5b", + fitzpatrick_scale: false, + category: "symbols" + }, + clock130: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd5c", + fitzpatrick_scale: false, + category: "symbols" + }, + clock230: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd5d", + fitzpatrick_scale: false, + category: "symbols" + }, + clock330: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd5e", + fitzpatrick_scale: false, + category: "symbols" + }, + clock430: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd5f", + fitzpatrick_scale: false, + category: "symbols" + }, + clock530: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd60", + fitzpatrick_scale: false, + category: "symbols" + }, + clock630: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd61", + fitzpatrick_scale: false, + category: "symbols" + }, + clock730: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd62", + fitzpatrick_scale: false, + category: "symbols" + }, + clock830: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd63", + fitzpatrick_scale: false, + category: "symbols" + }, + clock930: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd64", + fitzpatrick_scale: false, + category: "symbols" + }, + clock1030: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd65", + fitzpatrick_scale: false, + category: "symbols" + }, + clock1130: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd66", + fitzpatrick_scale: false, + category: "symbols" + }, + clock1230: { + keywords: [ "time", "late", "early", "schedule" ], + "char": "\ud83d\udd67", + fitzpatrick_scale: false, + category: "symbols" + }, + afghanistan: { + keywords: [ "af", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde6\ud83c\uddeb", + fitzpatrick_scale: false, + category: "flags" + }, + aland_islands: { + keywords: [ "\xc5land", "islands", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde6\ud83c\uddfd", + fitzpatrick_scale: false, + category: "flags" + }, + albania: { + keywords: [ "al", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde6\ud83c\uddf1", + fitzpatrick_scale: false, + category: "flags" + }, + algeria: { + keywords: [ "dz", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde9\ud83c\uddff", + fitzpatrick_scale: false, + category: "flags" + }, + american_samoa: { + keywords: [ "american", "ws", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde6\ud83c\uddf8", + fitzpatrick_scale: false, + category: "flags" + }, + andorra: { + keywords: [ "ad", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde6\ud83c\udde9", + fitzpatrick_scale: false, + category: "flags" + }, + angola: { + keywords: [ "ao", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde6\ud83c\uddf4", + fitzpatrick_scale: false, + category: "flags" + }, + anguilla: { + keywords: [ "ai", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde6\ud83c\uddee", + fitzpatrick_scale: false, + category: "flags" + }, + antarctica: { + keywords: [ "aq", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde6\ud83c\uddf6", + fitzpatrick_scale: false, + category: "flags" + }, + antigua_barbuda: { + keywords: [ "antigua", "barbuda", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde6\ud83c\uddec", + fitzpatrick_scale: false, + category: "flags" + }, + argentina: { + keywords: [ "ar", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde6\ud83c\uddf7", + fitzpatrick_scale: false, + category: "flags" + }, + armenia: { + keywords: [ "am", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde6\ud83c\uddf2", + fitzpatrick_scale: false, + category: "flags" + }, + aruba: { + keywords: [ "aw", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde6\ud83c\uddfc", + fitzpatrick_scale: false, + category: "flags" + }, + australia: { + keywords: [ "au", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde6\ud83c\uddfa", + fitzpatrick_scale: false, + category: "flags" + }, + austria: { + keywords: [ "at", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde6\ud83c\uddf9", + fitzpatrick_scale: false, + category: "flags" + }, + azerbaijan: { + keywords: [ "az", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde6\ud83c\uddff", + fitzpatrick_scale: false, + category: "flags" + }, + bahamas: { + keywords: [ "bs", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\uddf8", + fitzpatrick_scale: false, + category: "flags" + }, + bahrain: { + keywords: [ "bh", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\udded", + fitzpatrick_scale: false, + category: "flags" + }, + bangladesh: { + keywords: [ "bd", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\udde9", + fitzpatrick_scale: false, + category: "flags" + }, + barbados: { + keywords: [ "bb", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\udde7", + fitzpatrick_scale: false, + category: "flags" + }, + belarus: { + keywords: [ "by", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\uddfe", + fitzpatrick_scale: false, + category: "flags" + }, + belgium: { + keywords: [ "be", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\uddea", + fitzpatrick_scale: false, + category: "flags" + }, + belize: { + keywords: [ "bz", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\uddff", + fitzpatrick_scale: false, + category: "flags" + }, + benin: { + keywords: [ "bj", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\uddef", + fitzpatrick_scale: false, + category: "flags" + }, + bermuda: { + keywords: [ "bm", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\uddf2", + fitzpatrick_scale: false, + category: "flags" + }, + bhutan: { + keywords: [ "bt", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\uddf9", + fitzpatrick_scale: false, + category: "flags" + }, + bolivia: { + keywords: [ "bo", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\uddf4", + fitzpatrick_scale: false, + category: "flags" + }, + caribbean_netherlands: { + keywords: [ "bonaire", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\uddf6", + fitzpatrick_scale: false, + category: "flags" + }, + bosnia_herzegovina: { + keywords: [ "bosnia", "herzegovina", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\udde6", + fitzpatrick_scale: false, + category: "flags" + }, + botswana: { + keywords: [ "bw", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\uddfc", + fitzpatrick_scale: false, + category: "flags" + }, + brazil: { + keywords: [ "br", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\uddf7", + fitzpatrick_scale: false, + category: "flags" + }, + british_indian_ocean_territory: { + keywords: [ "british", "indian", "ocean", "territory", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddee\ud83c\uddf4", + fitzpatrick_scale: false, + category: "flags" + }, + british_virgin_islands: { + keywords: [ "british", "virgin", "islands", "bvi", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddfb\ud83c\uddec", + fitzpatrick_scale: false, + category: "flags" + }, + brunei: { + keywords: [ "bn", "darussalam", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\uddf3", + fitzpatrick_scale: false, + category: "flags" + }, + bulgaria: { + keywords: [ "bg", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\uddec", + fitzpatrick_scale: false, + category: "flags" + }, + burkina_faso: { + keywords: [ "burkina", "faso", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\uddeb", + fitzpatrick_scale: false, + category: "flags" + }, + burundi: { + keywords: [ "bi", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\uddee", + fitzpatrick_scale: false, + category: "flags" + }, + cape_verde: { + keywords: [ "cabo", "verde", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde8\ud83c\uddfb", + fitzpatrick_scale: false, + category: "flags" + }, + cambodia: { + keywords: [ "kh", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf0\ud83c\udded", + fitzpatrick_scale: false, + category: "flags" + }, + cameroon: { + keywords: [ "cm", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde8\ud83c\uddf2", + fitzpatrick_scale: false, + category: "flags" + }, + canada: { + keywords: [ "ca", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde8\ud83c\udde6", + fitzpatrick_scale: false, + category: "flags" + }, + canary_islands: { + keywords: [ "canary", "islands", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddee\ud83c\udde8", + fitzpatrick_scale: false, + category: "flags" + }, + cayman_islands: { + keywords: [ "cayman", "islands", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf0\ud83c\uddfe", + fitzpatrick_scale: false, + category: "flags" + }, + central_african_republic: { + keywords: [ "central", "african", "republic", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde8\ud83c\uddeb", + fitzpatrick_scale: false, + category: "flags" + }, + chad: { + keywords: [ "td", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf9\ud83c\udde9", + fitzpatrick_scale: false, + category: "flags" + }, + chile: { + keywords: [ "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde8\ud83c\uddf1", + fitzpatrick_scale: false, + category: "flags" + }, + cn: { + keywords: [ "china", "chinese", "prc", "flag", "country", "nation", "banner" ], + "char": "\ud83c\udde8\ud83c\uddf3", + fitzpatrick_scale: false, + category: "flags" + }, + christmas_island: { + keywords: [ "christmas", "island", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde8\ud83c\uddfd", + fitzpatrick_scale: false, + category: "flags" + }, + cocos_islands: { + keywords: [ "cocos", "keeling", "islands", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde8\ud83c\udde8", + fitzpatrick_scale: false, + category: "flags" + }, + colombia: { + keywords: [ "co", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde8\ud83c\uddf4", + fitzpatrick_scale: false, + category: "flags" + }, + comoros: { + keywords: [ "km", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf0\ud83c\uddf2", + fitzpatrick_scale: false, + category: "flags" + }, + congo_brazzaville: { + keywords: [ "congo", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde8\ud83c\uddec", + fitzpatrick_scale: false, + category: "flags" + }, + congo_kinshasa: { + keywords: [ "congo", "democratic", "republic", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde8\ud83c\udde9", + fitzpatrick_scale: false, + category: "flags" + }, + cook_islands: { + keywords: [ "cook", "islands", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde8\ud83c\uddf0", + fitzpatrick_scale: false, + category: "flags" + }, + costa_rica: { + keywords: [ "costa", "rica", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde8\ud83c\uddf7", + fitzpatrick_scale: false, + category: "flags" + }, + croatia: { + keywords: [ "hr", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udded\ud83c\uddf7", + fitzpatrick_scale: false, + category: "flags" + }, + cuba: { + keywords: [ "cu", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde8\ud83c\uddfa", + fitzpatrick_scale: false, + category: "flags" + }, + curacao: { + keywords: [ "cura\xe7ao", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde8\ud83c\uddfc", + fitzpatrick_scale: false, + category: "flags" + }, + cyprus: { + keywords: [ "cy", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde8\ud83c\uddfe", + fitzpatrick_scale: false, + category: "flags" + }, + czech_republic: { + keywords: [ "cz", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde8\ud83c\uddff", + fitzpatrick_scale: false, + category: "flags" + }, + denmark: { + keywords: [ "dk", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde9\ud83c\uddf0", + fitzpatrick_scale: false, + category: "flags" + }, + djibouti: { + keywords: [ "dj", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde9\ud83c\uddef", + fitzpatrick_scale: false, + category: "flags" + }, + dominica: { + keywords: [ "dm", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde9\ud83c\uddf2", + fitzpatrick_scale: false, + category: "flags" + }, + dominican_republic: { + keywords: [ "dominican", "republic", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde9\ud83c\uddf4", + fitzpatrick_scale: false, + category: "flags" + }, + ecuador: { + keywords: [ "ec", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddea\ud83c\udde8", + fitzpatrick_scale: false, + category: "flags" + }, + egypt: { + keywords: [ "eg", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddea\ud83c\uddec", + fitzpatrick_scale: false, + category: "flags" + }, + el_salvador: { + keywords: [ "el", "salvador", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\uddfb", + fitzpatrick_scale: false, + category: "flags" + }, + equatorial_guinea: { + keywords: [ "equatorial", "gn", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddec\ud83c\uddf6", + fitzpatrick_scale: false, + category: "flags" + }, + eritrea: { + keywords: [ "er", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddea\ud83c\uddf7", + fitzpatrick_scale: false, + category: "flags" + }, + estonia: { + keywords: [ "ee", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddea\ud83c\uddea", + fitzpatrick_scale: false, + category: "flags" + }, + ethiopia: { + keywords: [ "et", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddea\ud83c\uddf9", + fitzpatrick_scale: false, + category: "flags" + }, + eu: { + keywords: [ "european", "union", "flag", "banner" ], + "char": "\ud83c\uddea\ud83c\uddfa", + fitzpatrick_scale: false, + category: "flags" + }, + falkland_islands: { + keywords: [ "falkland", "islands", "malvinas", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddeb\ud83c\uddf0", + fitzpatrick_scale: false, + category: "flags" + }, + faroe_islands: { + keywords: [ "faroe", "islands", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddeb\ud83c\uddf4", + fitzpatrick_scale: false, + category: "flags" + }, + fiji: { + keywords: [ "fj", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddeb\ud83c\uddef", + fitzpatrick_scale: false, + category: "flags" + }, + finland: { + keywords: [ "fi", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddeb\ud83c\uddee", + fitzpatrick_scale: false, + category: "flags" + }, + fr: { + keywords: [ "banner", "flag", "nation", "france", "french", "country" ], + "char": "\ud83c\uddeb\ud83c\uddf7", + fitzpatrick_scale: false, + category: "flags" + }, + french_guiana: { + keywords: [ "french", "guiana", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddec\ud83c\uddeb", + fitzpatrick_scale: false, + category: "flags" + }, + french_polynesia: { + keywords: [ "french", "polynesia", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf5\ud83c\uddeb", + fitzpatrick_scale: false, + category: "flags" + }, + french_southern_territories: { + keywords: [ "french", "southern", "territories", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf9\ud83c\uddeb", + fitzpatrick_scale: false, + category: "flags" + }, + gabon: { + keywords: [ "ga", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddec\ud83c\udde6", + fitzpatrick_scale: false, + category: "flags" + }, + gambia: { + keywords: [ "gm", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddec\ud83c\uddf2", + fitzpatrick_scale: false, + category: "flags" + }, + georgia: { + keywords: [ "ge", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddec\ud83c\uddea", + fitzpatrick_scale: false, + category: "flags" + }, + de: { + keywords: [ "german", "nation", "flag", "country", "banner" ], + "char": "\ud83c\udde9\ud83c\uddea", + fitzpatrick_scale: false, + category: "flags" + }, + ghana: { + keywords: [ "gh", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddec\ud83c\udded", + fitzpatrick_scale: false, + category: "flags" + }, + gibraltar: { + keywords: [ "gi", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddec\ud83c\uddee", + fitzpatrick_scale: false, + category: "flags" + }, + greece: { + keywords: [ "gr", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddec\ud83c\uddf7", + fitzpatrick_scale: false, + category: "flags" + }, + greenland: { + keywords: [ "gl", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddec\ud83c\uddf1", + fitzpatrick_scale: false, + category: "flags" + }, + grenada: { + keywords: [ "gd", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddec\ud83c\udde9", + fitzpatrick_scale: false, + category: "flags" + }, + guadeloupe: { + keywords: [ "gp", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddec\ud83c\uddf5", + fitzpatrick_scale: false, + category: "flags" + }, + guam: { + keywords: [ "gu", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddec\ud83c\uddfa", + fitzpatrick_scale: false, + category: "flags" + }, + guatemala: { + keywords: [ "gt", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddec\ud83c\uddf9", + fitzpatrick_scale: false, + category: "flags" + }, + guernsey: { + keywords: [ "gg", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddec\ud83c\uddec", + fitzpatrick_scale: false, + category: "flags" + }, + guinea: { + keywords: [ "gn", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddec\ud83c\uddf3", + fitzpatrick_scale: false, + category: "flags" + }, + guinea_bissau: { + keywords: [ "gw", "bissau", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddec\ud83c\uddfc", + fitzpatrick_scale: false, + category: "flags" + }, + guyana: { + keywords: [ "gy", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddec\ud83c\uddfe", + fitzpatrick_scale: false, + category: "flags" + }, + haiti: { + keywords: [ "ht", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udded\ud83c\uddf9", + fitzpatrick_scale: false, + category: "flags" + }, + honduras: { + keywords: [ "hn", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udded\ud83c\uddf3", + fitzpatrick_scale: false, + category: "flags" + }, + hong_kong: { + keywords: [ "hong", "kong", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udded\ud83c\uddf0", + fitzpatrick_scale: false, + category: "flags" + }, + hungary: { + keywords: [ "hu", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udded\ud83c\uddfa", + fitzpatrick_scale: false, + category: "flags" + }, + iceland: { + keywords: [ "is", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddee\ud83c\uddf8", + fitzpatrick_scale: false, + category: "flags" + }, + india: { + keywords: [ "in", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddee\ud83c\uddf3", + fitzpatrick_scale: false, + category: "flags" + }, + indonesia: { + keywords: [ "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddee\ud83c\udde9", + fitzpatrick_scale: false, + category: "flags" + }, + iran: { + keywords: [ "iran,", "islamic", "republic", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddee\ud83c\uddf7", + fitzpatrick_scale: false, + category: "flags" + }, + iraq: { + keywords: [ "iq", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddee\ud83c\uddf6", + fitzpatrick_scale: false, + category: "flags" + }, + ireland: { + keywords: [ "ie", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddee\ud83c\uddea", + fitzpatrick_scale: false, + category: "flags" + }, + isle_of_man: { + keywords: [ "isle", "man", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddee\ud83c\uddf2", + fitzpatrick_scale: false, + category: "flags" + }, + israel: { + keywords: [ "il", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddee\ud83c\uddf1", + fitzpatrick_scale: false, + category: "flags" + }, + it: { + keywords: [ "italy", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddee\ud83c\uddf9", + fitzpatrick_scale: false, + category: "flags" + }, + cote_divoire: { + keywords: [ "ivory", "coast", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde8\ud83c\uddee", + fitzpatrick_scale: false, + category: "flags" + }, + jamaica: { + keywords: [ "jm", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddef\ud83c\uddf2", + fitzpatrick_scale: false, + category: "flags" + }, + jp: { + keywords: [ "japanese", "nation", "flag", "country", "banner" ], + "char": "\ud83c\uddef\ud83c\uddf5", + fitzpatrick_scale: false, + category: "flags" + }, + jersey: { + keywords: [ "je", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddef\ud83c\uddea", + fitzpatrick_scale: false, + category: "flags" + }, + jordan: { + keywords: [ "jo", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddef\ud83c\uddf4", + fitzpatrick_scale: false, + category: "flags" + }, + kazakhstan: { + keywords: [ "kz", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf0\ud83c\uddff", + fitzpatrick_scale: false, + category: "flags" + }, + kenya: { + keywords: [ "ke", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf0\ud83c\uddea", + fitzpatrick_scale: false, + category: "flags" + }, + kiribati: { + keywords: [ "ki", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf0\ud83c\uddee", + fitzpatrick_scale: false, + category: "flags" + }, + kosovo: { + keywords: [ "xk", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddfd\ud83c\uddf0", + fitzpatrick_scale: false, + category: "flags" + }, + kuwait: { + keywords: [ "kw", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf0\ud83c\uddfc", + fitzpatrick_scale: false, + category: "flags" + }, + kyrgyzstan: { + keywords: [ "kg", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf0\ud83c\uddec", + fitzpatrick_scale: false, + category: "flags" + }, + laos: { + keywords: [ "lao", "democratic", "republic", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf1\ud83c\udde6", + fitzpatrick_scale: false, + category: "flags" + }, + latvia: { + keywords: [ "lv", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf1\ud83c\uddfb", + fitzpatrick_scale: false, + category: "flags" + }, + lebanon: { + keywords: [ "lb", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf1\ud83c\udde7", + fitzpatrick_scale: false, + category: "flags" + }, + lesotho: { + keywords: [ "ls", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf1\ud83c\uddf8", + fitzpatrick_scale: false, + category: "flags" + }, + liberia: { + keywords: [ "lr", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf1\ud83c\uddf7", + fitzpatrick_scale: false, + category: "flags" + }, + libya: { + keywords: [ "ly", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf1\ud83c\uddfe", + fitzpatrick_scale: false, + category: "flags" + }, + liechtenstein: { + keywords: [ "li", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf1\ud83c\uddee", + fitzpatrick_scale: false, + category: "flags" + }, + lithuania: { + keywords: [ "lt", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf1\ud83c\uddf9", + fitzpatrick_scale: false, + category: "flags" + }, + luxembourg: { + keywords: [ "lu", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf1\ud83c\uddfa", + fitzpatrick_scale: false, + category: "flags" + }, + macau: { + keywords: [ "macao", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\uddf4", + fitzpatrick_scale: false, + category: "flags" + }, + macedonia: { + keywords: [ "macedonia,", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\uddf0", + fitzpatrick_scale: false, + category: "flags" + }, + madagascar: { + keywords: [ "mg", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\uddec", + fitzpatrick_scale: false, + category: "flags" + }, + malawi: { + keywords: [ "mw", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\uddfc", + fitzpatrick_scale: false, + category: "flags" + }, + malaysia: { + keywords: [ "my", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\uddfe", + fitzpatrick_scale: false, + category: "flags" + }, + maldives: { + keywords: [ "mv", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\uddfb", + fitzpatrick_scale: false, + category: "flags" + }, + mali: { + keywords: [ "ml", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\uddf1", + fitzpatrick_scale: false, + category: "flags" + }, + malta: { + keywords: [ "mt", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\uddf9", + fitzpatrick_scale: false, + category: "flags" + }, + marshall_islands: { + keywords: [ "marshall", "islands", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\udded", + fitzpatrick_scale: false, + category: "flags" + }, + martinique: { + keywords: [ "mq", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\uddf6", + fitzpatrick_scale: false, + category: "flags" + }, + mauritania: { + keywords: [ "mr", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\uddf7", + fitzpatrick_scale: false, + category: "flags" + }, + mauritius: { + keywords: [ "mu", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\uddfa", + fitzpatrick_scale: false, + category: "flags" + }, + mayotte: { + keywords: [ "yt", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddfe\ud83c\uddf9", + fitzpatrick_scale: false, + category: "flags" + }, + mexico: { + keywords: [ "mx", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\uddfd", + fitzpatrick_scale: false, + category: "flags" + }, + micronesia: { + keywords: [ "micronesia,", "federated", "states", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddeb\ud83c\uddf2", + fitzpatrick_scale: false, + category: "flags" + }, + moldova: { + keywords: [ "moldova,", "republic", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\udde9", + fitzpatrick_scale: false, + category: "flags" + }, + monaco: { + keywords: [ "mc", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\udde8", + fitzpatrick_scale: false, + category: "flags" + }, + mongolia: { + keywords: [ "mn", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\uddf3", + fitzpatrick_scale: false, + category: "flags" + }, + montenegro: { + keywords: [ "me", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\uddea", + fitzpatrick_scale: false, + category: "flags" + }, + montserrat: { + keywords: [ "ms", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\uddf8", + fitzpatrick_scale: false, + category: "flags" + }, + morocco: { + keywords: [ "ma", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\udde6", + fitzpatrick_scale: false, + category: "flags" + }, + mozambique: { + keywords: [ "mz", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\uddff", + fitzpatrick_scale: false, + category: "flags" + }, + myanmar: { + keywords: [ "mm", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\uddf2", + fitzpatrick_scale: false, + category: "flags" + }, + namibia: { + keywords: [ "na", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf3\ud83c\udde6", + fitzpatrick_scale: false, + category: "flags" + }, + nauru: { + keywords: [ "nr", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf3\ud83c\uddf7", + fitzpatrick_scale: false, + category: "flags" + }, + nepal: { + keywords: [ "np", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf3\ud83c\uddf5", + fitzpatrick_scale: false, + category: "flags" + }, + netherlands: { + keywords: [ "nl", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf3\ud83c\uddf1", + fitzpatrick_scale: false, + category: "flags" + }, + new_caledonia: { + keywords: [ "new", "caledonia", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf3\ud83c\udde8", + fitzpatrick_scale: false, + category: "flags" + }, + new_zealand: { + keywords: [ "new", "zealand", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf3\ud83c\uddff", + fitzpatrick_scale: false, + category: "flags" + }, + nicaragua: { + keywords: [ "ni", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf3\ud83c\uddee", + fitzpatrick_scale: false, + category: "flags" + }, + niger: { + keywords: [ "ne", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf3\ud83c\uddea", + fitzpatrick_scale: false, + category: "flags" + }, + nigeria: { + keywords: [ "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf3\ud83c\uddec", + fitzpatrick_scale: false, + category: "flags" + }, + niue: { + keywords: [ "nu", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf3\ud83c\uddfa", + fitzpatrick_scale: false, + category: "flags" + }, + norfolk_island: { + keywords: [ "norfolk", "island", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf3\ud83c\uddeb", + fitzpatrick_scale: false, + category: "flags" + }, + northern_mariana_islands: { + keywords: [ "northern", "mariana", "islands", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf2\ud83c\uddf5", + fitzpatrick_scale: false, + category: "flags" + }, + north_korea: { + keywords: [ "north", "korea", "nation", "flag", "country", "banner" ], + "char": "\ud83c\uddf0\ud83c\uddf5", + fitzpatrick_scale: false, + category: "flags" + }, + norway: { + keywords: [ "no", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf3\ud83c\uddf4", + fitzpatrick_scale: false, + category: "flags" + }, + oman: { + keywords: [ "om_symbol", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf4\ud83c\uddf2", + fitzpatrick_scale: false, + category: "flags" + }, + pakistan: { + keywords: [ "pk", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf5\ud83c\uddf0", + fitzpatrick_scale: false, + category: "flags" + }, + palau: { + keywords: [ "pw", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf5\ud83c\uddfc", + fitzpatrick_scale: false, + category: "flags" + }, + palestinian_territories: { + keywords: [ "palestine", "palestinian", "territories", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf5\ud83c\uddf8", + fitzpatrick_scale: false, + category: "flags" + }, + panama: { + keywords: [ "pa", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf5\ud83c\udde6", + fitzpatrick_scale: false, + category: "flags" + }, + papua_new_guinea: { + keywords: [ "papua", "new", "guinea", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf5\ud83c\uddec", + fitzpatrick_scale: false, + category: "flags" + }, + paraguay: { + keywords: [ "py", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf5\ud83c\uddfe", + fitzpatrick_scale: false, + category: "flags" + }, + peru: { + keywords: [ "pe", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf5\ud83c\uddea", + fitzpatrick_scale: false, + category: "flags" + }, + philippines: { + keywords: [ "ph", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf5\ud83c\udded", + fitzpatrick_scale: false, + category: "flags" + }, + pitcairn_islands: { + keywords: [ "pitcairn", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf5\ud83c\uddf3", + fitzpatrick_scale: false, + category: "flags" + }, + poland: { + keywords: [ "pl", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf5\ud83c\uddf1", + fitzpatrick_scale: false, + category: "flags" + }, + portugal: { + keywords: [ "pt", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf5\ud83c\uddf9", + fitzpatrick_scale: false, + category: "flags" + }, + puerto_rico: { + keywords: [ "puerto", "rico", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf5\ud83c\uddf7", + fitzpatrick_scale: false, + category: "flags" + }, + qatar: { + keywords: [ "qa", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf6\ud83c\udde6", + fitzpatrick_scale: false, + category: "flags" + }, + reunion: { + keywords: [ "r\xe9union", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf7\ud83c\uddea", + fitzpatrick_scale: false, + category: "flags" + }, + romania: { + keywords: [ "ro", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf7\ud83c\uddf4", + fitzpatrick_scale: false, + category: "flags" + }, + ru: { + keywords: [ "russian", "federation", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf7\ud83c\uddfa", + fitzpatrick_scale: false, + category: "flags" + }, + rwanda: { + keywords: [ "rw", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf7\ud83c\uddfc", + fitzpatrick_scale: false, + category: "flags" + }, + st_barthelemy: { + keywords: [ "saint", "barth\xe9lemy", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde7\ud83c\uddf1", + fitzpatrick_scale: false, + category: "flags" + }, + st_helena: { + keywords: [ "saint", "helena", "ascension", "tristan", "cunha", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\udded", + fitzpatrick_scale: false, + category: "flags" + }, + st_kitts_nevis: { + keywords: [ "saint", "kitts", "nevis", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf0\ud83c\uddf3", + fitzpatrick_scale: false, + category: "flags" + }, + st_lucia: { + keywords: [ "saint", "lucia", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf1\ud83c\udde8", + fitzpatrick_scale: false, + category: "flags" + }, + st_pierre_miquelon: { + keywords: [ "saint", "pierre", "miquelon", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf5\ud83c\uddf2", + fitzpatrick_scale: false, + category: "flags" + }, + st_vincent_grenadines: { + keywords: [ "saint", "vincent", "grenadines", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddfb\ud83c\udde8", + fitzpatrick_scale: false, + category: "flags" + }, + samoa: { + keywords: [ "ws", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddfc\ud83c\uddf8", + fitzpatrick_scale: false, + category: "flags" + }, + san_marino: { + keywords: [ "san", "marino", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\uddf2", + fitzpatrick_scale: false, + category: "flags" + }, + sao_tome_principe: { + keywords: [ "sao", "tome", "principe", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\uddf9", + fitzpatrick_scale: false, + category: "flags" + }, + saudi_arabia: { + keywords: [ "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\udde6", + fitzpatrick_scale: false, + category: "flags" + }, + senegal: { + keywords: [ "sn", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\uddf3", + fitzpatrick_scale: false, + category: "flags" + }, + serbia: { + keywords: [ "rs", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf7\ud83c\uddf8", + fitzpatrick_scale: false, + category: "flags" + }, + seychelles: { + keywords: [ "sc", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\udde8", + fitzpatrick_scale: false, + category: "flags" + }, + sierra_leone: { + keywords: [ "sierra", "leone", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\uddf1", + fitzpatrick_scale: false, + category: "flags" + }, + singapore: { + keywords: [ "sg", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\uddec", + fitzpatrick_scale: false, + category: "flags" + }, + sint_maarten: { + keywords: [ "sint", "maarten", "dutch", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\uddfd", + fitzpatrick_scale: false, + category: "flags" + }, + slovakia: { + keywords: [ "sk", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\uddf0", + fitzpatrick_scale: false, + category: "flags" + }, + slovenia: { + keywords: [ "si", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\uddee", + fitzpatrick_scale: false, + category: "flags" + }, + solomon_islands: { + keywords: [ "solomon", "islands", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\udde7", + fitzpatrick_scale: false, + category: "flags" + }, + somalia: { + keywords: [ "so", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\uddf4", + fitzpatrick_scale: false, + category: "flags" + }, + south_africa: { + keywords: [ "south", "africa", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddff\ud83c\udde6", + fitzpatrick_scale: false, + category: "flags" + }, + south_georgia_south_sandwich_islands: { + keywords: [ "south", "georgia", "sandwich", "islands", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddec\ud83c\uddf8", + fitzpatrick_scale: false, + category: "flags" + }, + kr: { + keywords: [ "south", "korea", "nation", "flag", "country", "banner" ], + "char": "\ud83c\uddf0\ud83c\uddf7", + fitzpatrick_scale: false, + category: "flags" + }, + south_sudan: { + keywords: [ "south", "sd", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\uddf8", + fitzpatrick_scale: false, + category: "flags" + }, + es: { + keywords: [ "spain", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddea\ud83c\uddf8", + fitzpatrick_scale: false, + category: "flags" + }, + sri_lanka: { + keywords: [ "sri", "lanka", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf1\ud83c\uddf0", + fitzpatrick_scale: false, + category: "flags" + }, + sudan: { + keywords: [ "sd", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\udde9", + fitzpatrick_scale: false, + category: "flags" + }, + suriname: { + keywords: [ "sr", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\uddf7", + fitzpatrick_scale: false, + category: "flags" + }, + swaziland: { + keywords: [ "sz", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\uddff", + fitzpatrick_scale: false, + category: "flags" + }, + sweden: { + keywords: [ "se", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\uddea", + fitzpatrick_scale: false, + category: "flags" + }, + switzerland: { + keywords: [ "ch", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde8\ud83c\udded", + fitzpatrick_scale: false, + category: "flags" + }, + syria: { + keywords: [ "syrian", "arab", "republic", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf8\ud83c\uddfe", + fitzpatrick_scale: false, + category: "flags" + }, + taiwan: { + keywords: [ "tw", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf9\ud83c\uddfc", + fitzpatrick_scale: false, + category: "flags" + }, + tajikistan: { + keywords: [ "tj", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf9\ud83c\uddef", + fitzpatrick_scale: false, + category: "flags" + }, + tanzania: { + keywords: [ "tanzania,", "united", "republic", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf9\ud83c\uddff", + fitzpatrick_scale: false, + category: "flags" + }, + thailand: { + keywords: [ "th", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf9\ud83c\udded", + fitzpatrick_scale: false, + category: "flags" + }, + timor_leste: { + keywords: [ "timor", "leste", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf9\ud83c\uddf1", + fitzpatrick_scale: false, + category: "flags" + }, + togo: { + keywords: [ "tg", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf9\ud83c\uddec", + fitzpatrick_scale: false, + category: "flags" + }, + tokelau: { + keywords: [ "tk", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf9\ud83c\uddf0", + fitzpatrick_scale: false, + category: "flags" + }, + tonga: { + keywords: [ "to", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf9\ud83c\uddf4", + fitzpatrick_scale: false, + category: "flags" + }, + trinidad_tobago: { + keywords: [ "trinidad", "tobago", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf9\ud83c\uddf9", + fitzpatrick_scale: false, + category: "flags" + }, + tunisia: { + keywords: [ "tn", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf9\ud83c\uddf3", + fitzpatrick_scale: false, + category: "flags" + }, + tr: { + keywords: [ "turkey", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf9\ud83c\uddf7", + fitzpatrick_scale: false, + category: "flags" + }, + turkmenistan: { + keywords: [ "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf9\ud83c\uddf2", + fitzpatrick_scale: false, + category: "flags" + }, + turks_caicos_islands: { + keywords: [ "turks", "caicos", "islands", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf9\ud83c\udde8", + fitzpatrick_scale: false, + category: "flags" + }, + tuvalu: { + keywords: [ "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddf9\ud83c\uddfb", + fitzpatrick_scale: false, + category: "flags" + }, + uganda: { + keywords: [ "ug", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddfa\ud83c\uddec", + fitzpatrick_scale: false, + category: "flags" + }, + ukraine: { + keywords: [ "ua", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddfa\ud83c\udde6", + fitzpatrick_scale: false, + category: "flags" + }, + united_arab_emirates: { + keywords: [ "united", "arab", "emirates", "flag", "nation", "country", "banner" ], + "char": "\ud83c\udde6\ud83c\uddea", + fitzpatrick_scale: false, + category: "flags" + }, + uk: { + keywords: [ "united", "kingdom", "great", "britain", "northern", "ireland", "flag", "nation", "country", "banner", "british", "UK", "english", "england", "union jack" ], + "char": "\ud83c\uddec\ud83c\udde7", + fitzpatrick_scale: false, + category: "flags" + }, + england: { + keywords: [ "flag", "english" ], + "char": "\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f", + fitzpatrick_scale: false, + category: "flags" + }, + scotland: { + keywords: [ "flag", "scottish" ], + "char": "\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f", + fitzpatrick_scale: false, + category: "flags" + }, + wales: { + keywords: [ "flag", "welsh" ], + "char": "\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f", + fitzpatrick_scale: false, + category: "flags" + }, + us: { + keywords: [ "united", "states", "america", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddfa\ud83c\uddf8", + fitzpatrick_scale: false, + category: "flags" + }, + us_virgin_islands: { + keywords: [ "virgin", "islands", "us", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddfb\ud83c\uddee", + fitzpatrick_scale: false, + category: "flags" + }, + uruguay: { + keywords: [ "uy", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddfa\ud83c\uddfe", + fitzpatrick_scale: false, + category: "flags" + }, + uzbekistan: { + keywords: [ "uz", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddfa\ud83c\uddff", + fitzpatrick_scale: false, + category: "flags" + }, + vanuatu: { + keywords: [ "vu", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddfb\ud83c\uddfa", + fitzpatrick_scale: false, + category: "flags" + }, + vatican_city: { + keywords: [ "vatican", "city", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddfb\ud83c\udde6", + fitzpatrick_scale: false, + category: "flags" + }, + venezuela: { + keywords: [ "ve", "bolivarian", "republic", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddfb\ud83c\uddea", + fitzpatrick_scale: false, + category: "flags" + }, + vietnam: { + keywords: [ "viet", "nam", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddfb\ud83c\uddf3", + fitzpatrick_scale: false, + category: "flags" + }, + wallis_futuna: { + keywords: [ "wallis", "futuna", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddfc\ud83c\uddeb", + fitzpatrick_scale: false, + category: "flags" + }, + western_sahara: { + keywords: [ "western", "sahara", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddea\ud83c\udded", + fitzpatrick_scale: false, + category: "flags" + }, + yemen: { + keywords: [ "ye", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddfe\ud83c\uddea", + fitzpatrick_scale: false, + category: "flags" + }, + zambia: { + keywords: [ "zm", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddff\ud83c\uddf2", + fitzpatrick_scale: false, + category: "flags" + }, + zimbabwe: { + keywords: [ "zw", "flag", "nation", "country", "banner" ], + "char": "\ud83c\uddff\ud83c\uddfc", + fitzpatrick_scale: false, + category: "flags" + }, + united_nations: { + keywords: [ "un", "flag", "banner" ], + "char": "\ud83c\uddfa\ud83c\uddf3", + fitzpatrick_scale: false, + category: "flags" + }, + pirate_flag: { + keywords: [ "skull", "crossbones", "flag", "banner" ], + "char": "\ud83c\udff4\u200d\u2620\ufe0f", + fitzpatrick_scale: false, + category: "flags" + } }); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/emoticons/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/emoticons/plugin.js index 49caafb5..e939611e 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/emoticons/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/emoticons/plugin.js @@ -13,230 +13,230 @@ var DEFAULT_ID = 'tinymce.plugins.emoticons'; var getEmoticonDatabase = function (editor) { - return editor.getParam('emoticons_database', 'emojis', 'string'); + return editor.getParam('emoticons_database', 'emojis', 'string'); }; var getEmoticonDatabaseUrl = function (editor, pluginUrl) { - var database = getEmoticonDatabase(editor); - return editor.getParam('emoticons_database_url', pluginUrl + '/js/' + database + editor.suffix + '.js', 'string'); + var database = getEmoticonDatabase(editor); + return editor.getParam('emoticons_database_url', pluginUrl + '/js/' + database + editor.suffix + '.js', 'string'); }; var getEmoticonDatabaseId = function (editor) { - return editor.getParam('emoticons_database_id', DEFAULT_ID, 'string'); + return editor.getParam('emoticons_database_id', DEFAULT_ID, 'string'); }; var getAppendedEmoticons = function (editor) { - return editor.getParam('emoticons_append', {}, 'object'); + return editor.getParam('emoticons_append', {}, 'object'); }; var getEmotionsImageUrl = function (editor) { - return editor.getParam('emoticons_images_url', 'https://twemoji.maxcdn.com/v/13.0.1/72x72/', 'string'); + return editor.getParam('emoticons_images_url', 'https://twemoji.maxcdn.com/v/13.0.1/72x72/', 'string'); }; var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); }; var Cell = function (initial) { - var value = initial; - var get = function () { - return value; - }; - var set = function (v) { - value = v; - }; - return { - get: get, - set: set - }; + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; }; var hasOwnProperty = Object.prototype.hasOwnProperty; var shallow = function (old, nu) { - return nu; + return nu; }; var baseMerge = function (merger) { - return function () { - var objects = new Array(arguments.length); - for (var i = 0; i < objects.length; i++) { - objects[i] = arguments[i]; - } - if (objects.length === 0) { - throw new Error('Can\'t merge zero objects'); - } - var ret = {}; - for (var j = 0; j < objects.length; j++) { - var curObject = objects[j]; - for (var key in curObject) { - if (hasOwnProperty.call(curObject, key)) { - ret[key] = merger(ret[key], curObject[key]); - } - } + return function () { + var objects = new Array(arguments.length); + for (var i = 0; i < objects.length; i++) { + objects[i] = arguments[i]; + } + if (objects.length === 0) { + throw new Error('Can\'t merge zero objects'); + } + var ret = {}; + for (var j = 0; j < objects.length; j++) { + var curObject = objects[j]; + for (var key in curObject) { + if (hasOwnProperty.call(curObject, key)) { + ret[key] = merger(ret[key], curObject[key]); } - return ret; - }; + } + } + return ret; + }; }; var merge = baseMerge(shallow); var noop = function () { }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; var never = constant(false); var always = constant(true); var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var keys = Object.keys; var hasOwnProperty$1 = Object.hasOwnProperty; var each = function (obj, f) { - var props = keys(obj); - for (var k = 0, len = props.length; k < len; k++) { - var i = props[k]; - var x = obj[i]; - f(x, i); - } + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } }; var map = function (obj, f) { - return tupleMap(obj, function (x, i) { - return { - k: i, - v: f(x, i) - }; - }); + return tupleMap(obj, function (x, i) { + return { + k: i, + v: f(x, i) + }; + }); }; var tupleMap = function (obj, f) { - var r = {}; - each(obj, function (x, i) { - var tuple = f(x, i); - r[tuple.k] = tuple.v; - }); - return r; + var r = {}; + each(obj, function (x, i) { + var tuple = f(x, i); + r[tuple.k] = tuple.v; + }); + return r; }; var has = function (obj, key) { - return hasOwnProperty$1.call(obj, key); + return hasOwnProperty$1.call(obj, key); }; var checkRange = function (str, substr, start) { - return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr; + return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr; }; var contains = function (str, substr) { - return str.indexOf(substr) !== -1; + return str.indexOf(substr) !== -1; }; var startsWith = function (str, prefix) { - return checkRange(str, prefix, 0); + return checkRange(str, prefix, 0); }; var global$1 = tinymce.util.Tools.resolve('tinymce.Resource'); @@ -247,357 +247,357 @@ var ALL_CATEGORY = 'All'; var categoryNameMap = { - symbols: 'Symbols', - people: 'People', - animals_and_nature: 'Animals and Nature', - food_and_drink: 'Food and Drink', - activity: 'Activity', - travel_and_places: 'Travel and Places', - objects: 'Objects', - flags: 'Flags', - user: 'User Defined' + symbols: 'Symbols', + people: 'People', + animals_and_nature: 'Animals and Nature', + food_and_drink: 'Food and Drink', + activity: 'Activity', + travel_and_places: 'Travel and Places', + objects: 'Objects', + flags: 'Flags', + user: 'User Defined' }; var translateCategory = function (categories, name) { - return has(categories, name) ? categories[name] : name; + return has(categories, name) ? categories[name] : name; }; var getUserDefinedEmoticons = function (editor) { - var userDefinedEmoticons = getAppendedEmoticons(editor); - return map(userDefinedEmoticons, function (value) { - return __assign({ - keywords: [], - category: 'user' - }, value); - }); + var userDefinedEmoticons = getAppendedEmoticons(editor); + return map(userDefinedEmoticons, function (value) { + return __assign({ + keywords: [], + category: 'user' + }, value); + }); }; var initDatabase = function (editor, databaseUrl, databaseId) { - var categories = Cell(Optional.none()); - var all = Cell(Optional.none()); - var emojiImagesUrl = getEmotionsImageUrl(editor); - var getEmoji = function (lib) { - if (startsWith(lib.char, '= max; - }; - }); - for (var i = 0; i < list.length; i++) { - if (pattern.length === 0 || emojiMatches(list[i], lowerCasePattern)) { - matches.push({ - value: list[i].char, - text: list[i].title, - icon: list[i].char - }); - if (reachedLimit(matches.length)) { - break; - } - } + var matches = []; + var lowerCasePattern = pattern.toLowerCase(); + var reachedLimit = maxResults.fold(function () { + return never; + }, function (max) { + return function (size) { + return size >= max; + }; + }); + for (var i = 0; i < list.length; i++) { + if (pattern.length === 0 || emojiMatches(list[i], lowerCasePattern)) { + matches.push({ + value: list[i].char, + text: list[i].title, + icon: list[i].char + }); + if (reachedLimit(matches.length)) { + break; + } } - return matches; + } + return matches; }; var init = function (editor, database) { - editor.ui.registry.addAutocompleter('emoticons', { - ch: ':', - columns: 'auto', - minChars: 2, - fetch: function (pattern, maxResults) { - return database.waitForLoad().then(function () { - var candidates = database.listAll(); - return emojisFrom(candidates, pattern, Optional.some(maxResults)); - }); - }, - onAction: function (autocompleteApi, rng, value) { - editor.selection.setRng(rng); - editor.insertContent(value); - autocompleteApi.hide(); - } - }); + editor.ui.registry.addAutocompleter('emoticons', { + ch: ':', + columns: 'auto', + minChars: 2, + fetch: function (pattern, maxResults) { + return database.waitForLoad().then(function () { + var candidates = database.listAll(); + return emojisFrom(candidates, pattern, Optional.some(maxResults)); + }); + }, + onAction: function (autocompleteApi, rng, value) { + editor.selection.setRng(rng); + editor.insertContent(value); + autocompleteApi.hide(); + } + }); }; var last = function (fn, rate) { - var timer = null; - var cancel = function () { - if (timer !== null) { - clearTimeout(timer); - timer = null; - } - }; - var throttle = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (timer !== null) { - clearTimeout(timer); - } - timer = setTimeout(function () { - fn.apply(null, args); - timer = null; - }, rate); - }; - return { - cancel: cancel, - throttle: throttle - }; + var timer = null; + var cancel = function () { + if (timer !== null) { + clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer !== null) { + clearTimeout(timer); + } + timer = setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + }; + return { + cancel: cancel, + throttle: throttle + }; }; var insertEmoticon = function (editor, ch) { - editor.insertContent(ch); + editor.insertContent(ch); }; var patternName = 'pattern'; var open = function (editor, database) { - var initialState = { - pattern: '', - results: emojisFrom(database.listAll(), '', Optional.some(300)) - }; - var currentTab = Cell(ALL_CATEGORY); - var scan = function (dialogApi) { - var dialogData = dialogApi.getData(); - var category = currentTab.get(); - var candidates = database.listCategory(category); - var results = emojisFrom(candidates, dialogData[patternName], category === ALL_CATEGORY ? Optional.some(300) : Optional.none()); - dialogApi.setData({results: results}); - }; - var updateFilter = last(function (dialogApi) { - scan(dialogApi); - }, 200); - var searchField = { - label: 'Search', - type: 'input', - name: patternName - }; - var resultsField = { - type: 'collection', - name: 'results' - }; - var getInitialState = function () { - var body = { - type: 'tabpanel', - tabs: map$1(database.listCategories(), function (cat) { - return { - title: cat, - name: cat, - items: [ - searchField, - resultsField - ] - }; - }) - }; + var initialState = { + pattern: '', + results: emojisFrom(database.listAll(), '', Optional.some(300)) + }; + var currentTab = Cell(ALL_CATEGORY); + var scan = function (dialogApi) { + var dialogData = dialogApi.getData(); + var category = currentTab.get(); + var candidates = database.listCategory(category); + var results = emojisFrom(candidates, dialogData[patternName], category === ALL_CATEGORY ? Optional.some(300) : Optional.none()); + dialogApi.setData({ results: results }); + }; + var updateFilter = last(function (dialogApi) { + scan(dialogApi); + }, 200); + var searchField = { + label: 'Search', + type: 'input', + name: patternName + }; + var resultsField = { + type: 'collection', + name: 'results' + }; + var getInitialState = function () { + var body = { + type: 'tabpanel', + tabs: map$1(database.listCategories(), function (cat) { return { - title: 'Emoticons', - size: 'normal', - body: body, - initialData: initialState, - onTabChange: function (dialogApi, details) { - currentTab.set(details.newTabName); - updateFilter.throttle(dialogApi); - }, - onChange: updateFilter.throttle, - onAction: function (dialogApi, actionData) { - if (actionData.name === 'results') { - insertEmoticon(editor, actionData.value); - dialogApi.close(); - } - }, - buttons: [{ - type: 'cancel', - text: 'Close', - primary: true - }] + title: cat, + name: cat, + items: [ + searchField, + resultsField + ] }; + }) }; - var dialogApi = editor.windowManager.open(getInitialState()); - dialogApi.focus(patternName); - if (!database.hasLoaded()) { - dialogApi.block('Loading emoticons...'); - database.waitForLoad().then(function () { - dialogApi.redial(getInitialState()); - updateFilter.throttle(dialogApi); - dialogApi.focus(patternName); - dialogApi.unblock(); - }).catch(function (_err) { - dialogApi.redial({ - title: 'Emoticons', - body: { - type: 'panel', - items: [{ - type: 'alertbanner', - level: 'error', - icon: 'warning', - text: '

              Could not load emoticons

              ' - }] - }, - buttons: [{ - type: 'cancel', - text: 'Close', - primary: true - }], - initialData: { - pattern: '', - results: [] - } - }); - dialogApi.focus(patternName); - dialogApi.unblock(); - }); - } + return { + title: 'Emoticons', + size: 'normal', + body: body, + initialData: initialState, + onTabChange: function (dialogApi, details) { + currentTab.set(details.newTabName); + updateFilter.throttle(dialogApi); + }, + onChange: updateFilter.throttle, + onAction: function (dialogApi, actionData) { + if (actionData.name === 'results') { + insertEmoticon(editor, actionData.value); + dialogApi.close(); + } + }, + buttons: [{ + type: 'cancel', + text: 'Close', + primary: true + }] + }; + }; + var dialogApi = editor.windowManager.open(getInitialState()); + dialogApi.focus(patternName); + if (!database.hasLoaded()) { + dialogApi.block('Loading emoticons...'); + database.waitForLoad().then(function () { + dialogApi.redial(getInitialState()); + updateFilter.throttle(dialogApi); + dialogApi.focus(patternName); + dialogApi.unblock(); + }).catch(function (_err) { + dialogApi.redial({ + title: 'Emoticons', + body: { + type: 'panel', + items: [{ + type: 'alertbanner', + level: 'error', + icon: 'warning', + text: '

              Could not load emoticons

              ' + }] + }, + buttons: [{ + type: 'cancel', + text: 'Close', + primary: true + }], + initialData: { + pattern: '', + results: [] + } + }); + dialogApi.focus(patternName); + dialogApi.unblock(); + }); + } }; var register = function (editor, database) { - var onAction = function () { - return open(editor, database); - }; - editor.ui.registry.addButton('emoticons', { - tooltip: 'Emoticons', - icon: 'emoji', - onAction: onAction - }); - editor.ui.registry.addMenuItem('emoticons', { - text: 'Emoticons...', - icon: 'emoji', - onAction: onAction - }); + var onAction = function () { + return open(editor, database); + }; + editor.ui.registry.addButton('emoticons', { + tooltip: 'Emoticons', + icon: 'emoji', + onAction: onAction + }); + editor.ui.registry.addMenuItem('emoticons', { + text: 'Emoticons...', + icon: 'emoji', + onAction: onAction + }); }; - function Plugin() { - global.add('emoticons', function (editor, pluginUrl) { - var databaseUrl = getEmoticonDatabaseUrl(editor, pluginUrl); - var databaseId = getEmoticonDatabaseId(editor); - var database = initDatabase(editor, databaseUrl, databaseId); - register(editor, database); - init(editor, database); - setup(editor); - }); + function Plugin () { + global.add('emoticons', function (editor, pluginUrl) { + var databaseUrl = getEmoticonDatabaseUrl(editor, pluginUrl); + var databaseId = getEmoticonDatabaseId(editor); + var database = initDatabase(editor, databaseUrl, databaseId); + register(editor, database); + init(editor, database); + setup(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/fullpage/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/fullpage/plugin.js index af711dee..2292dedb 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/fullpage/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/fullpage/plugin.js @@ -10,32 +10,32 @@ 'use strict'; var Cell = function (initial) { - var value = initial; - var get = function () { - return value; - }; - var set = function (v) { - value = v; - }; - return { - get: get, - set: set - }; + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; }; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); }; var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); @@ -47,501 +47,496 @@ var global$4 = tinymce.util.Tools.resolve('tinymce.html.Serializer'); var shouldHideInSourceView = function (editor) { - return editor.getParam('fullpage_hide_in_source_view'); + return editor.getParam('fullpage_hide_in_source_view'); }; var getDefaultXmlPi = function (editor) { - return editor.getParam('fullpage_default_xml_pi'); + return editor.getParam('fullpage_default_xml_pi'); }; var getDefaultEncoding = function (editor) { - return editor.getParam('fullpage_default_encoding'); + return editor.getParam('fullpage_default_encoding'); }; var getDefaultFontFamily = function (editor) { - return editor.getParam('fullpage_default_font_family'); + return editor.getParam('fullpage_default_font_family'); }; var getDefaultFontSize = function (editor) { - return editor.getParam('fullpage_default_font_size'); + return editor.getParam('fullpage_default_font_size'); }; var getDefaultTextColor = function (editor) { - return editor.getParam('fullpage_default_text_color'); + return editor.getParam('fullpage_default_text_color'); }; var getDefaultTitle = function (editor) { - return editor.getParam('fullpage_default_title'); + return editor.getParam('fullpage_default_title'); }; var getDefaultDocType = function (editor) { - return editor.getParam('fullpage_default_doctype', ''); + return editor.getParam('fullpage_default_doctype', ''); }; var getProtect = function (editor) { - return editor.getParam('protect'); + return editor.getParam('protect'); }; var parseHeader = function (head) { - return global$2({ - validate: false, - root_name: '#document' - }).parse(head, {format: 'xhtml'}); + return global$2({ + validate: false, + root_name: '#document' + }).parse(head, { format: 'xhtml' }); }; var htmlToData = function (editor, head) { - var headerFragment = parseHeader(head); - var data = {}; - var elm, matches; - - function getAttr(elm, name) { - var value = elm.attr(name); - return value || ''; + var headerFragment = parseHeader(head); + var data = {}; + var elm, matches; + function getAttr(elm, name) { + var value = elm.attr(name); + return value || ''; + } + data.fontface = getDefaultFontFamily(editor); + data.fontsize = getDefaultFontSize(editor); + elm = headerFragment.firstChild; + if (elm.type === 7) { + data.xml_pi = true; + matches = /encoding="([^"]+)"/.exec(elm.value); + if (matches) { + data.docencoding = matches[1]; } - - data.fontface = getDefaultFontFamily(editor); - data.fontsize = getDefaultFontSize(editor); - elm = headerFragment.firstChild; - if (elm.type === 7) { - data.xml_pi = true; - matches = /encoding="([^"]+)"/.exec(elm.value); - if (matches) { - data.docencoding = matches[1]; - } + } + elm = headerFragment.getAll('#doctype')[0]; + if (elm) { + data.doctype = ''; + } + elm = headerFragment.getAll('title')[0]; + if (elm && elm.firstChild) { + data.title = elm.firstChild.value; + } + global$1.each(headerFragment.getAll('meta'), function (meta) { + var name = meta.attr('name'); + var httpEquiv = meta.attr('http-equiv'); + var matches; + if (name) { + data[name.toLowerCase()] = meta.attr('content'); + } else if (httpEquiv === 'Content-Type') { + matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content')); + if (matches) { + data.docencoding = matches[1]; + } } - elm = headerFragment.getAll('#doctype')[0]; - if (elm) { - data.doctype = ''; + }); + elm = headerFragment.getAll('html')[0]; + if (elm) { + data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang'); + } + data.stylesheets = []; + global$1.each(headerFragment.getAll('link'), function (link) { + if (link.attr('rel') === 'stylesheet') { + data.stylesheets.push(link.attr('href')); } - elm = headerFragment.getAll('title')[0]; - if (elm && elm.firstChild) { - data.title = elm.firstChild.value; + }); + elm = headerFragment.getAll('body')[0]; + if (elm) { + data.langdir = getAttr(elm, 'dir'); + data.style = getAttr(elm, 'style'); + data.visited_color = getAttr(elm, 'vlink'); + data.link_color = getAttr(elm, 'link'); + data.active_color = getAttr(elm, 'alink'); + } + return data; + }; + var dataToHtml = function (editor, data, head) { + var headElement, elm, value; + var dom = editor.dom; + function setAttr(elm, name, value) { + elm.attr(name, value ? value : undefined); + } + function addHeadNode(node) { + if (headElement.firstChild) { + headElement.insert(node, headElement.firstChild); + } else { + headElement.append(node); } - global$1.each(headerFragment.getAll('meta'), function (meta) { - var name = meta.attr('name'); - var httpEquiv = meta.attr('http-equiv'); - var matches; - if (name) { - data[name.toLowerCase()] = meta.attr('content'); - } else if (httpEquiv === 'Content-Type') { - matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content')); - if (matches) { - data.docencoding = matches[1]; - } - } - }); + } + var headerFragment = parseHeader(head); + headElement = headerFragment.getAll('head')[0]; + if (!headElement) { elm = headerFragment.getAll('html')[0]; - if (elm) { - data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang'); + headElement = new global$3('head', 1); + if (elm.firstChild) { + elm.insert(headElement, elm.firstChild, true); + } else { + elm.append(headElement); } - data.stylesheets = []; - global$1.each(headerFragment.getAll('link'), function (link) { - if (link.attr('rel') === 'stylesheet') { - data.stylesheets.push(link.attr('href')); - } - }); - elm = headerFragment.getAll('body')[0]; - if (elm) { - data.langdir = getAttr(elm, 'dir'); - data.style = getAttr(elm, 'style'); - data.visited_color = getAttr(elm, 'vlink'); - data.link_color = getAttr(elm, 'link'); - data.active_color = getAttr(elm, 'alink'); + } + elm = headerFragment.firstChild; + if (data.xml_pi) { + value = 'version="1.0"'; + if (data.docencoding) { + value += ' encoding="' + data.docencoding + '"'; } - return data; - }; - var dataToHtml = function (editor, data, head) { - var headElement, elm, value; - var dom = editor.dom; - - function setAttr(elm, name, value) { - elm.attr(name, value ? value : undefined); + if (elm.type !== 7) { + elm = new global$3('xml', 7); + headerFragment.insert(elm, headerFragment.firstChild, true); } - - function addHeadNode(node) { - if (headElement.firstChild) { - headElement.insert(node, headElement.firstChild); - } else { - headElement.append(node); - } + elm.value = value; + } else if (elm && elm.type === 7) { + elm.remove(); + } + elm = headerFragment.getAll('#doctype')[0]; + if (data.doctype) { + if (!elm) { + elm = new global$3('#doctype', 10); + if (data.xml_pi) { + headerFragment.insert(elm, headerFragment.firstChild); + } else { + addHeadNode(elm); + } } - - var headerFragment = parseHeader(head); - headElement = headerFragment.getAll('head')[0]; - if (!headElement) { - elm = headerFragment.getAll('html')[0]; - headElement = new global$3('head', 1); - if (elm.firstChild) { - elm.insert(headElement, elm.firstChild, true); - } else { - elm.append(headElement); - } - } - elm = headerFragment.firstChild; - if (data.xml_pi) { - value = 'version="1.0"'; - if (data.docencoding) { - value += ' encoding="' + data.docencoding + '"'; - } - if (elm.type !== 7) { - elm = new global$3('xml', 7); - headerFragment.insert(elm, headerFragment.firstChild, true); - } - elm.value = value; - } else if (elm && elm.type === 7) { - elm.remove(); + elm.value = data.doctype.substring(9, data.doctype.length - 1); + } else if (elm) { + elm.remove(); + } + elm = null; + global$1.each(headerFragment.getAll('meta'), function (meta) { + if (meta.attr('http-equiv') === 'Content-Type') { + elm = meta; } - elm = headerFragment.getAll('#doctype')[0]; - if (data.doctype) { - if (!elm) { - elm = new global$3('#doctype', 10); - if (data.xml_pi) { - headerFragment.insert(elm, headerFragment.firstChild); - } else { - addHeadNode(elm); - } - } - elm.value = data.doctype.substring(9, data.doctype.length - 1); - } else if (elm) { - elm.remove(); + }); + if (data.docencoding) { + if (!elm) { + elm = new global$3('meta', 1); + elm.attr('http-equiv', 'Content-Type'); + elm.shortEnded = true; + addHeadNode(elm); } - elm = null; - global$1.each(headerFragment.getAll('meta'), function (meta) { - if (meta.attr('http-equiv') === 'Content-Type') { - elm = meta; - } - }); - if (data.docencoding) { - if (!elm) { - elm = new global$3('meta', 1); - elm.attr('http-equiv', 'Content-Type'); - elm.shortEnded = true; - addHeadNode(elm); - } - elm.attr('content', 'text/html; charset=' + data.docencoding); - } else if (elm) { - elm.remove(); + elm.attr('content', 'text/html; charset=' + data.docencoding); + } else if (elm) { + elm.remove(); + } + elm = headerFragment.getAll('title')[0]; + if (data.title) { + if (!elm) { + elm = new global$3('title', 1); + addHeadNode(elm); + } else { + elm.empty(); } - elm = headerFragment.getAll('title')[0]; - if (data.title) { - if (!elm) { - elm = new global$3('title', 1); - addHeadNode(elm); + elm.append(new global$3('#text', 3)).value = data.title; + } else if (elm) { + elm.remove(); + } + global$1.each('keywords,description,author,copyright,robots'.split(','), function (name) { + var nodes = headerFragment.getAll('meta'); + var i, meta; + var value = data[name]; + for (i = 0; i < nodes.length; i++) { + meta = nodes[i]; + if (meta.attr('name') === name) { + if (value) { + meta.attr('content', value); } else { - elm.empty(); + meta.remove(); } - elm.append(new global$3('#text', 3)).value = data.title; - } else if (elm) { - elm.remove(); + return; + } } - global$1.each('keywords,description,author,copyright,robots'.split(','), function (name) { - var nodes = headerFragment.getAll('meta'); - var i, meta; - var value = data[name]; - for (i = 0; i < nodes.length; i++) { - meta = nodes[i]; - if (meta.attr('name') === name) { - if (value) { - meta.attr('content', value); - } else { - meta.remove(); - } - return; - } - } - if (value) { - elm = new global$3('meta', 1); - elm.attr('name', name); - elm.attr('content', value); - elm.shortEnded = true; - addHeadNode(elm); - } - }); - var currentStyleSheetsMap = {}; - global$1.each(headerFragment.getAll('link'), function (stylesheet) { - if (stylesheet.attr('rel') === 'stylesheet') { - currentStyleSheetsMap[stylesheet.attr('href')] = stylesheet; - } - }); - global$1.each(data.stylesheets, function (stylesheet) { - if (!currentStyleSheetsMap[stylesheet]) { - elm = new global$3('link', 1); - elm.attr({ - rel: 'stylesheet', - text: 'text/css', - href: stylesheet - }); - elm.shortEnded = true; - addHeadNode(elm); - } - delete currentStyleSheetsMap[stylesheet]; - }); - global$1.each(currentStyleSheetsMap, function (stylesheet) { - stylesheet.remove(); - }); - elm = headerFragment.getAll('body')[0]; - if (elm) { - setAttr(elm, 'dir', data.langdir); - setAttr(elm, 'style', data.style); - setAttr(elm, 'vlink', data.visited_color); - setAttr(elm, 'link', data.link_color); - setAttr(elm, 'alink', data.active_color); - dom.setAttribs(editor.getBody(), { - style: data.style, - dir: data.dir, - vLink: data.visited_color, - link: data.link_color, - aLink: data.active_color - }); + if (value) { + elm = new global$3('meta', 1); + elm.attr('name', name); + elm.attr('content', value); + elm.shortEnded = true; + addHeadNode(elm); } - elm = headerFragment.getAll('html')[0]; - if (elm) { - setAttr(elm, 'lang', data.langcode); - setAttr(elm, 'xml:lang', data.langcode); + }); + var currentStyleSheetsMap = {}; + global$1.each(headerFragment.getAll('link'), function (stylesheet) { + if (stylesheet.attr('rel') === 'stylesheet') { + currentStyleSheetsMap[stylesheet.attr('href')] = stylesheet; } - if (!headElement.firstChild) { - headElement.remove(); + }); + global$1.each(data.stylesheets, function (stylesheet) { + if (!currentStyleSheetsMap[stylesheet]) { + elm = new global$3('link', 1); + elm.attr({ + rel: 'stylesheet', + text: 'text/css', + href: stylesheet + }); + elm.shortEnded = true; + addHeadNode(elm); } - var html = global$4({ - validate: false, - indent: true, - indent_before: 'head,html,body,meta,title,script,link,style', - indent_after: 'head,html,body,meta,title,script,link,style' - }).serialize(headerFragment); - return html.substring(0, html.indexOf('')); + delete currentStyleSheetsMap[stylesheet]; + }); + global$1.each(currentStyleSheetsMap, function (stylesheet) { + stylesheet.remove(); + }); + elm = headerFragment.getAll('body')[0]; + if (elm) { + setAttr(elm, 'dir', data.langdir); + setAttr(elm, 'style', data.style); + setAttr(elm, 'vlink', data.visited_color); + setAttr(elm, 'link', data.link_color); + setAttr(elm, 'alink', data.active_color); + dom.setAttribs(editor.getBody(), { + style: data.style, + dir: data.dir, + vLink: data.visited_color, + link: data.link_color, + aLink: data.active_color + }); + } + elm = headerFragment.getAll('html')[0]; + if (elm) { + setAttr(elm, 'lang', data.langcode); + setAttr(elm, 'xml:lang', data.langcode); + } + if (!headElement.firstChild) { + headElement.remove(); + } + var html = global$4({ + validate: false, + indent: true, + indent_before: 'head,html,body,meta,title,script,link,style', + indent_after: 'head,html,body,meta,title,script,link,style' + }).serialize(headerFragment); + return html.substring(0, html.indexOf('')); }; var open = function (editor, headState) { - var data = htmlToData(editor, headState.get()); - var defaultData = { - title: '', - keywords: '', - description: '', - robots: '', - author: '', - docencoding: '' - }; - var initialData = __assign(__assign({}, defaultData), data); - editor.windowManager.open({ - title: 'Metadata and Document Properties', - size: 'normal', - body: { - type: 'panel', - items: [ - { - name: 'title', - type: 'input', - label: 'Title' - }, - { - name: 'keywords', - type: 'input', - label: 'Keywords' - }, - { - name: 'description', - type: 'input', - label: 'Description' - }, - { - name: 'robots', - type: 'input', - label: 'Robots' - }, - { - name: 'author', - type: 'input', - label: 'Author' - }, - { - name: 'docencoding', - type: 'input', - label: 'Encoding' - } - ] + var data = htmlToData(editor, headState.get()); + var defaultData = { + title: '', + keywords: '', + description: '', + robots: '', + author: '', + docencoding: '' + }; + var initialData = __assign(__assign({}, defaultData), data); + editor.windowManager.open({ + title: 'Metadata and Document Properties', + size: 'normal', + body: { + type: 'panel', + items: [ + { + name: 'title', + type: 'input', + label: 'Title' + }, + { + name: 'keywords', + type: 'input', + label: 'Keywords' + }, + { + name: 'description', + type: 'input', + label: 'Description' + }, + { + name: 'robots', + type: 'input', + label: 'Robots' + }, + { + name: 'author', + type: 'input', + label: 'Author' }, - buttons: [ - { - type: 'cancel', - name: 'cancel', - text: 'Cancel' - }, - { - type: 'submit', - name: 'save', - text: 'Save', - primary: true - } - ], - initialData: initialData, - onSubmit: function (api) { - var nuData = api.getData(); - var headHtml = dataToHtml(editor, global$1.extend(data, nuData), headState.get()); - headState.set(headHtml); - api.close(); + { + name: 'docencoding', + type: 'input', + label: 'Encoding' } - }); + ] + }, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: initialData, + onSubmit: function (api) { + var nuData = api.getData(); + var headHtml = dataToHtml(editor, global$1.extend(data, nuData), headState.get()); + headState.set(headHtml); + api.close(); + } + }); }; var register = function (editor, headState) { - editor.addCommand('mceFullPageProperties', function () { - open(editor, headState); - }); + editor.addCommand('mceFullPageProperties', function () { + open(editor, headState); + }); }; var protectHtml = function (protect, html) { - global$1.each(protect, function (pattern) { - html = html.replace(pattern, function (str) { - return ''; - }); + global$1.each(protect, function (pattern) { + html = html.replace(pattern, function (str) { + return ''; }); - return html; + }); + return html; }; var unprotectHtml = function (html) { - return html.replace(//g, function (a, m) { - return unescape(m); - }); + return html.replace(//g, function (a, m) { + return unescape(m); + }); }; var each = global$1.each; var low = function (s) { - return s.replace(/<\/?[A-Z]+/g, function (a) { - return a.toLowerCase(); - }); + return s.replace(/<\/?[A-Z]+/g, function (a) { + return a.toLowerCase(); + }); }; var handleSetContent = function (editor, headState, footState, evt) { - var startPos, endPos, content, styles = ''; - var dom = editor.dom; - if (evt.selection) { - return; - } - content = protectHtml(getProtect(editor), evt.content); - if (evt.format === 'raw' && headState.get()) { - return; + var startPos, endPos, content, styles = ''; + var dom = editor.dom; + if (evt.selection) { + return; + } + content = protectHtml(getProtect(editor), evt.content); + if (evt.format === 'raw' && headState.get()) { + return; + } + if (evt.source_view && shouldHideInSourceView(editor)) { + return; + } + if (content.length === 0 && !evt.source_view) { + content = global$1.trim(headState.get()) + '\n' + global$1.trim(content) + '\n' + global$1.trim(footState.get()); + } + content = content.replace(/<(\/?)BODY/gi, '<$1body'); + startPos = content.indexOf('', startPos); + headState.set(low(content.substring(0, startPos + 1))); + endPos = content.indexOf('\n'); + } + var headerFragment = parseHeader(headState.get()); + each(headerFragment.getAll('style'), function (node) { + if (node.firstChild) { + styles += node.firstChild.value; } - content = content.replace(/<(\/?)BODY/gi, '<$1body'); - startPos = content.indexOf('', startPos); - headState.set(low(content.substring(0, startPos + 1))); - endPos = content.indexOf('\n'); - } - var headerFragment = parseHeader(headState.get()); - each(headerFragment.getAll('style'), function (node) { - if (node.firstChild) { - styles += node.firstChild.value; - } + }); + var bodyElm = headerFragment.getAll('body')[0]; + if (bodyElm) { + dom.setAttribs(editor.getBody(), { + style: bodyElm.attr('style') || '', + dir: bodyElm.attr('dir') || '', + vLink: bodyElm.attr('vlink') || '', + link: bodyElm.attr('link') || '', + aLink: bodyElm.attr('alink') || '' }); - var bodyElm = headerFragment.getAll('body')[0]; - if (bodyElm) { - dom.setAttribs(editor.getBody(), { - style: bodyElm.attr('style') || '', - dir: bodyElm.attr('dir') || '', - vLink: bodyElm.attr('vlink') || '', - link: bodyElm.attr('link') || '', - aLink: bodyElm.attr('alink') || '' - }); + } + dom.remove('fullpage_styles'); + var headElm = editor.getDoc().getElementsByTagName('head')[0]; + if (styles) { + var styleElm = dom.add(headElm, 'style', { id: 'fullpage_styles' }); + styleElm.appendChild(document.createTextNode(styles)); + } + var currentStyleSheetsMap = {}; + global$1.each(headElm.getElementsByTagName('link'), function (stylesheet) { + if (stylesheet.rel === 'stylesheet' && stylesheet.getAttribute('data-mce-fullpage')) { + currentStyleSheetsMap[stylesheet.href] = stylesheet; } - dom.remove('fullpage_styles'); - var headElm = editor.getDoc().getElementsByTagName('head')[0]; - if (styles) { - var styleElm = dom.add(headElm, 'style', {id: 'fullpage_styles'}); - styleElm.appendChild(document.createTextNode(styles)); + }); + global$1.each(headerFragment.getAll('link'), function (stylesheet) { + var href = stylesheet.attr('href'); + if (!href) { + return true; } - var currentStyleSheetsMap = {}; - global$1.each(headElm.getElementsByTagName('link'), function (stylesheet) { - if (stylesheet.rel === 'stylesheet' && stylesheet.getAttribute('data-mce-fullpage')) { - currentStyleSheetsMap[stylesheet.href] = stylesheet; - } - }); - global$1.each(headerFragment.getAll('link'), function (stylesheet) { - var href = stylesheet.attr('href'); - if (!href) { - return true; - } - if (!currentStyleSheetsMap[href] && stylesheet.attr('rel') === 'stylesheet') { - dom.add(headElm, 'link', { - 'rel': 'stylesheet', - 'text': 'text/css', - href: href, - 'data-mce-fullpage': '1' - }); - } - delete currentStyleSheetsMap[href]; - }); - global$1.each(currentStyleSheetsMap, function (stylesheet) { - stylesheet.parentNode.removeChild(stylesheet); - }); + if (!currentStyleSheetsMap[href] && stylesheet.attr('rel') === 'stylesheet') { + dom.add(headElm, 'link', { + 'rel': 'stylesheet', + 'text': 'text/css', + href: href, + 'data-mce-fullpage': '1' + }); + } + delete currentStyleSheetsMap[href]; + }); + global$1.each(currentStyleSheetsMap, function (stylesheet) { + stylesheet.parentNode.removeChild(stylesheet); + }); }; var getDefaultHeader = function (editor) { - var header = '', value, styles = ''; - if (getDefaultXmlPi(editor)) { - var piEncoding = getDefaultEncoding(editor); - header += '\n'; - } - header += getDefaultDocType(editor); - header += '\n\n\n'; - if (value = getDefaultTitle(editor)) { - header += '' + value + '\n'; - } - if (value = getDefaultEncoding(editor)) { - header += '\n'; - } - if (value = getDefaultFontFamily(editor)) { - styles += 'font-family: ' + value + ';'; - } - if (value = getDefaultFontSize(editor)) { - styles += 'font-size: ' + value + ';'; - } - if (value = getDefaultTextColor(editor)) { - styles += 'color: ' + value + ';'; - } - header += '\n\n'; - return header; + var header = '', value, styles = ''; + if (getDefaultXmlPi(editor)) { + var piEncoding = getDefaultEncoding(editor); + header += '\n'; + } + header += getDefaultDocType(editor); + header += '\n\n\n'; + if (value = getDefaultTitle(editor)) { + header += '' + value + '\n'; + } + if (value = getDefaultEncoding(editor)) { + header += '\n'; + } + if (value = getDefaultFontFamily(editor)) { + styles += 'font-family: ' + value + ';'; + } + if (value = getDefaultFontSize(editor)) { + styles += 'font-size: ' + value + ';'; + } + if (value = getDefaultTextColor(editor)) { + styles += 'color: ' + value + ';'; + } + header += '\n\n'; + return header; }; var handleGetContent = function (editor, head, foot, evt) { - if (evt.format === 'html' && !evt.selection && (!evt.source_view || !shouldHideInSourceView(editor))) { - evt.content = unprotectHtml(global$1.trim(head) + '\n' + global$1.trim(evt.content) + '\n' + global$1.trim(foot)); - } + if (evt.format === 'html' && !evt.selection && (!evt.source_view || !shouldHideInSourceView(editor))) { + evt.content = unprotectHtml(global$1.trim(head) + '\n' + global$1.trim(evt.content) + '\n' + global$1.trim(foot)); + } }; var setup = function (editor, headState, footState) { - editor.on('BeforeSetContent', function (evt) { - handleSetContent(editor, headState, footState, evt); - }); - editor.on('GetContent', function (evt) { - handleGetContent(editor, headState.get(), footState.get(), evt); - }); + editor.on('BeforeSetContent', function (evt) { + handleSetContent(editor, headState, footState, evt); + }); + editor.on('GetContent', function (evt) { + handleGetContent(editor, headState.get(), footState.get(), evt); + }); }; var register$1 = function (editor) { - editor.ui.registry.addButton('fullpage', { - tooltip: 'Metadata and document properties', - icon: 'document-properties', - onAction: function () { - editor.execCommand('mceFullPageProperties'); - } - }); - editor.ui.registry.addMenuItem('fullpage', { - text: 'Metadata and document properties', - icon: 'document-properties', - onAction: function () { - editor.execCommand('mceFullPageProperties'); - } - }); + editor.ui.registry.addButton('fullpage', { + tooltip: 'Metadata and document properties', + icon: 'document-properties', + onAction: function () { + editor.execCommand('mceFullPageProperties'); + } + }); + editor.ui.registry.addMenuItem('fullpage', { + text: 'Metadata and document properties', + icon: 'document-properties', + onAction: function () { + editor.execCommand('mceFullPageProperties'); + } + }); }; - function Plugin() { - global.add('fullpage', function (editor) { - var headState = Cell(''), footState = Cell(''); - register(editor, headState); - register$1(editor); - setup(editor, headState, footState); - }); + function Plugin () { + global.add('fullpage', function (editor) { + var headState = Cell(''), footState = Cell(''); + register(editor, headState); + register$1(editor); + setup(editor, headState, footState); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/fullscreen/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/fullscreen/plugin.js index e9d4c2a4..deb9dde6 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/fullscreen/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/fullscreen/plugin.js @@ -10,353 +10,351 @@ 'use strict'; var Cell = function (initial) { - var value = initial; - var get = function () { - return value; - }; - var set = function (v) { - value = v; - }; - return { - get: get, - set: set - }; + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; }; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var get = function (fullscreenState) { - return { - isFullscreen: function () { - return fullscreenState.get() !== null; - } - }; + return { + isFullscreen: function () { + return fullscreenState.get() !== null; + } + }; }; var noop = function () { }; var compose = function (fa, fb) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return fa(fb.apply(null, args)); - }; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return fa(fb.apply(null, args)); + }; }; var compose1 = function (fbc, fab) { - return function (a) { - return fbc(fab(a)); - }; + return function (a) { + return fbc(fab(a)); + }; }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; - function curry(fn) { - var initialArgs = []; - for (var _i = 1; _i < arguments.length; _i++) { - initialArgs[_i - 1] = arguments[_i]; + var initialArgs = []; + for (var _i = 1; _i < arguments.length; _i++) { + initialArgs[_i - 1] = arguments[_i]; + } + return function () { + var restArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + restArgs[_i] = arguments[_i]; } - return function () { - var restArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - restArgs[_i] = arguments[_i]; - } - var all = initialArgs.concat(restArgs); - return fn.apply(null, all); - }; + var all = initialArgs.concat(restArgs); + return fn.apply(null, all); + }; } - var never = constant(false); var always = constant(true); var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var revocable = function (doRevoke) { - var subject = Cell(Optional.none()); - var revoke = function () { - return subject.get().each(doRevoke); - }; - var clear = function () { - revoke(); - subject.set(Optional.none()); - }; - var isSet = function () { - return subject.get().isSome(); - }; - var set = function (s) { - revoke(); - subject.set(Optional.some(s)); - }; - return { - clear: clear, - isSet: isSet, - set: set - }; + var subject = Cell(Optional.none()); + var revoke = function () { + return subject.get().each(doRevoke); + }; + var clear = function () { + revoke(); + subject.set(Optional.none()); + }; + var isSet = function () { + return subject.get().isSome(); + }; + var set = function (s) { + revoke(); + subject.set(Optional.some(s)); + }; + return { + clear: clear, + isSet: isSet, + set: set + }; }; var unbindable = function () { - return revocable(function (s) { - return s.unbind(); - }); + return revocable(function (s) { + return s.unbind(); + }); }; var value = function () { - var subject = Cell(Optional.none()); - var clear = function () { - return subject.set(Optional.none()); - }; - var set = function (s) { - return subject.set(Optional.some(s)); - }; - var isSet = function () { - return subject.get().isSome(); - }; - var on = function (f) { - return subject.get().each(f); - }; - return { - clear: clear, - set: set, - isSet: isSet, - on: on - }; + var subject = Cell(Optional.none()); + var clear = function () { + return subject.set(Optional.none()); + }; + var set = function (s) { + return subject.set(Optional.some(s)); + }; + var isSet = function () { + return subject.get().isSome(); + }; + var on = function (f) { + return subject.get().each(f); + }; + return { + clear: clear, + set: set, + isSet: isSet, + on: on + }; }; var typeOf = function (x) { - var t = typeof x; - if (x === null) { - return 'null'; - } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { - return 'array'; - } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { - return 'string'; - } else { - return t; - } + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } }; var isType = function (type) { - return function (value) { - return typeOf(value) === type; - }; + return function (value) { + return typeOf(value) === type; + }; }; var isSimpleType = function (type) { - return function (value) { - return typeof value === type; - }; + return function (value) { + return typeof value === type; + }; }; var isString = isType('string'); var isArray = isType('array'); var isBoolean = isSimpleType('boolean'); var isNullable = function (a) { - return a === null || a === undefined; + return a === null || a === undefined; }; var isNonNullable = function (a) { - return !isNullable(a); + return !isNullable(a); }; var isFunction = isSimpleType('function'); var isNumber = isSimpleType('number'); var nativePush = Array.prototype.push; var map = function (xs, f) { - var len = xs.length; - var r = new Array(len); - for (var i = 0; i < len; i++) { - var x = xs[i]; - r[i] = f(x, i); - } - return r; + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; }; var each = function (xs, f) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - f(x, i); - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } }; var filter = function (xs, pred) { - var r = []; - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - r.push(x); - } + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); } - return r; + } + return r; }; var flatten = function (xs) { - var r = []; - for (var i = 0, len = xs.length; i < len; ++i) { - if (!isArray(xs[i])) { - throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); - } - nativePush.apply(r, xs[i]); + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); } - return r; + nativePush.apply(r, xs[i]); + } + return r; }; var bind = function (xs, f) { - return flatten(map(xs, f)); + return flatten(map(xs, f)); }; var get$1 = function (xs, i) { - return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none(); + return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none(); }; var head = function (xs) { - return get$1(xs, 0); + return get$1(xs, 0); }; var keys = Object.keys; var each$1 = function (obj, f) { - var props = keys(obj); - for (var k = 0, len = props.length; k < len; k++) { - var i = props[k]; - var x = obj[i]; - f(x, i); - } + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } }; var isSupported = function (dom) { - return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); }; var fromHtml = function (html, scope) { - var doc = scope || document; - var div = doc.createElement('div'); - div.innerHTML = html; - if (!div.hasChildNodes() || div.childNodes.length > 1) { - console.error('HTML does not have a single root node', html); - throw new Error('HTML must have a single root node'); - } - return fromDom(div.childNodes[0]); + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); }; var fromTag = function (tag, scope) { - var doc = scope || document; - var node = doc.createElement(tag); - return fromDom(node); + var doc = scope || document; + var node = doc.createElement(tag); + return fromDom(node); }; var fromText = function (text, scope) { - var doc = scope || document; - var node = doc.createTextNode(text); - return fromDom(node); + var doc = scope || document; + var node = doc.createTextNode(text); + return fromDom(node); }; var fromDom = function (node) { - if (node === null || node === undefined) { - throw new Error('Node cannot be null or undefined'); - } - return {dom: node}; + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: node }; }; var fromPoint = function (docElm, x, y) { - return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); + return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); }; var SugarElement = { - fromHtml: fromHtml, - fromTag: fromTag, - fromText: fromText, - fromDom: fromDom, - fromPoint: fromPoint + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint }; var Global = typeof window !== 'undefined' ? window : Function('return this;')(); @@ -367,12 +365,12 @@ var TEXT = 3; var type = function (element) { - return element.dom.nodeType; + return element.dom.nodeType; }; var isType$1 = function (t) { - return function (element) { - return type(element) === t; - }; + return function (element) { + return type(element) === t; + }; }; var isElement = isType$1(ELEMENT); var isText = isType$1(TEXT); @@ -380,274 +378,274 @@ var isDocumentFragment = isType$1(DOCUMENT_FRAGMENT); var is = function (element, selector) { - var dom = element.dom; - if (dom.nodeType !== ELEMENT) { - return false; + var dom = element.dom; + if (dom.nodeType !== ELEMENT) { + return false; + } else { + var elem = dom; + if (elem.matches !== undefined) { + return elem.matches(selector); + } else if (elem.msMatchesSelector !== undefined) { + return elem.msMatchesSelector(selector); + } else if (elem.webkitMatchesSelector !== undefined) { + return elem.webkitMatchesSelector(selector); + } else if (elem.mozMatchesSelector !== undefined) { + return elem.mozMatchesSelector(selector); } else { - var elem = dom; - if (elem.matches !== undefined) { - return elem.matches(selector); - } else if (elem.msMatchesSelector !== undefined) { - return elem.msMatchesSelector(selector); - } else if (elem.webkitMatchesSelector !== undefined) { - return elem.webkitMatchesSelector(selector); - } else if (elem.mozMatchesSelector !== undefined) { - return elem.mozMatchesSelector(selector); - } else { - throw new Error('Browser lacks native selectors'); - } + throw new Error('Browser lacks native selectors'); } + } }; var bypassSelector = function (dom) { - return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0; + return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0; }; var all = function (selector, scope) { - var base = scope === undefined ? document : scope.dom; - return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), SugarElement.fromDom); + var base = scope === undefined ? document : scope.dom; + return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), SugarElement.fromDom); }; var eq = function (e1, e2) { - return e1.dom === e2.dom; + return e1.dom === e2.dom; }; var owner = function (element) { - return SugarElement.fromDom(element.dom.ownerDocument); + return SugarElement.fromDom(element.dom.ownerDocument); }; var documentOrOwner = function (dos) { - return isDocument(dos) ? dos : owner(dos); + return isDocument(dos) ? dos : owner(dos); }; var parent = function (element) { - return Optional.from(element.dom.parentNode).map(SugarElement.fromDom); + return Optional.from(element.dom.parentNode).map(SugarElement.fromDom); }; var parents = function (element, isRoot) { - var stop = isFunction(isRoot) ? isRoot : never; - var dom = element.dom; - var ret = []; - while (dom.parentNode !== null && dom.parentNode !== undefined) { - var rawParent = dom.parentNode; - var p = SugarElement.fromDom(rawParent); - ret.push(p); - if (stop(p) === true) { - break; - } else { - dom = rawParent; - } + var stop = isFunction(isRoot) ? isRoot : never; + var dom = element.dom; + var ret = []; + while (dom.parentNode !== null && dom.parentNode !== undefined) { + var rawParent = dom.parentNode; + var p = SugarElement.fromDom(rawParent); + ret.push(p); + if (stop(p) === true) { + break; + } else { + dom = rawParent; } - return ret; + } + return ret; }; var siblings = function (element) { - var filterSelf = function (elements) { - return filter(elements, function (x) { - return !eq(element, x); - }); - }; - return parent(element).map(children).map(filterSelf).getOr([]); + var filterSelf = function (elements) { + return filter(elements, function (x) { + return !eq(element, x); + }); + }; + return parent(element).map(children).map(filterSelf).getOr([]); }; var children = function (element) { - return map(element.dom.childNodes, SugarElement.fromDom); + return map(element.dom.childNodes, SugarElement.fromDom); }; var isShadowRoot = function (dos) { - return isDocumentFragment(dos); + return isDocumentFragment(dos); }; var supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode); var isSupported$1 = constant(supported); var getRootNode = supported ? function (e) { - return SugarElement.fromDom(e.dom.getRootNode()); + return SugarElement.fromDom(e.dom.getRootNode()); } : documentOrOwner; var getShadowRoot = function (e) { - var r = getRootNode(e); - return isShadowRoot(r) ? Optional.some(r) : Optional.none(); + var r = getRootNode(e); + return isShadowRoot(r) ? Optional.some(r) : Optional.none(); }; var getShadowHost = function (e) { - return SugarElement.fromDom(e.dom.host); + return SugarElement.fromDom(e.dom.host); }; var getOriginalEventTarget = function (event) { - if (isSupported$1() && isNonNullable(event.target)) { - var el = SugarElement.fromDom(event.target); - if (isElement(el) && isOpenShadowHost(el)) { - if (event.composed && event.composedPath) { - var composedPath = event.composedPath(); - if (composedPath) { - return head(composedPath); - } - } + if (isSupported$1() && isNonNullable(event.target)) { + var el = SugarElement.fromDom(event.target); + if (isElement(el) && isOpenShadowHost(el)) { + if (event.composed && event.composedPath) { + var composedPath = event.composedPath(); + if (composedPath) { + return head(composedPath); } + } } - return Optional.from(event.target); + } + return Optional.from(event.target); }; var isOpenShadowHost = function (element) { - return isNonNullable(element.dom.shadowRoot); + return isNonNullable(element.dom.shadowRoot); }; var inBody = function (element) { - var dom = isText(element) ? element.dom.parentNode : element.dom; - if (dom === undefined || dom === null || dom.ownerDocument === null) { - return false; - } - var doc = dom.ownerDocument; - return getShadowRoot(SugarElement.fromDom(dom)).fold(function () { - return doc.body.contains(dom); - }, compose1(inBody, getShadowHost)); + var dom = isText(element) ? element.dom.parentNode : element.dom; + if (dom === undefined || dom === null || dom.ownerDocument === null) { + return false; + } + var doc = dom.ownerDocument; + return getShadowRoot(SugarElement.fromDom(dom)).fold(function () { + return doc.body.contains(dom); + }, compose1(inBody, getShadowHost)); }; var getBody = function (doc) { - var b = doc.dom.body; - if (b === null || b === undefined) { - throw new Error('Body is not available yet'); - } - return SugarElement.fromDom(b); + var b = doc.dom.body; + if (b === null || b === undefined) { + throw new Error('Body is not available yet'); + } + return SugarElement.fromDom(b); }; var rawSet = function (dom, key, value) { - if (isString(value) || isBoolean(value) || isNumber(value)) { - dom.setAttribute(key, value + ''); - } else { - console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); - throw new Error('Attribute value was not simple'); - } + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); + throw new Error('Attribute value was not simple'); + } }; var set = function (element, key, value) { - rawSet(element.dom, key, value); + rawSet(element.dom, key, value); }; var get$2 = function (element, key) { - var v = element.dom.getAttribute(key); - return v === null ? undefined : v; + var v = element.dom.getAttribute(key); + return v === null ? undefined : v; }; var remove = function (element, key) { - element.dom.removeAttribute(key); + element.dom.removeAttribute(key); }; var internalSet = function (dom, property, value) { - if (!isString(value)) { - console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom); - throw new Error('CSS value must be a string: ' + value); - } - if (isSupported(dom)) { - dom.style.setProperty(property, value); - } + if (!isString(value)) { + console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom); + throw new Error('CSS value must be a string: ' + value); + } + if (isSupported(dom)) { + dom.style.setProperty(property, value); + } }; var setAll = function (element, css) { - var dom = element.dom; - each$1(css, function (v, k) { - internalSet(dom, k, v); - }); + var dom = element.dom; + each$1(css, function (v, k) { + internalSet(dom, k, v); + }); }; var get$3 = function (element, property) { - var dom = element.dom; - var styles = window.getComputedStyle(dom); - var r = styles.getPropertyValue(property); - return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; + var dom = element.dom; + var styles = window.getComputedStyle(dom); + var r = styles.getPropertyValue(property); + return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; }; var getUnsafeProperty = function (dom, property) { - return isSupported(dom) ? dom.style.getPropertyValue(property) : ''; + return isSupported(dom) ? dom.style.getPropertyValue(property) : ''; }; var mkEvent = function (target, x, y, stop, prevent, kill, raw) { - return { - target: target, - x: x, - y: y, - stop: stop, - prevent: prevent, - kill: kill, - raw: raw - }; + return { + target: target, + x: x, + y: y, + stop: stop, + prevent: prevent, + kill: kill, + raw: raw + }; }; var fromRawEvent = function (rawEvent) { - var target = SugarElement.fromDom(getOriginalEventTarget(rawEvent).getOr(rawEvent.target)); - var stop = function () { - return rawEvent.stopPropagation(); - }; - var prevent = function () { - return rawEvent.preventDefault(); - }; - var kill = compose(prevent, stop); - return mkEvent(target, rawEvent.clientX, rawEvent.clientY, stop, prevent, kill, rawEvent); + var target = SugarElement.fromDom(getOriginalEventTarget(rawEvent).getOr(rawEvent.target)); + var stop = function () { + return rawEvent.stopPropagation(); + }; + var prevent = function () { + return rawEvent.preventDefault(); + }; + var kill = compose(prevent, stop); + return mkEvent(target, rawEvent.clientX, rawEvent.clientY, stop, prevent, kill, rawEvent); }; var handle = function (filter, handler) { - return function (rawEvent) { - if (filter(rawEvent)) { - handler(fromRawEvent(rawEvent)); - } - }; + return function (rawEvent) { + if (filter(rawEvent)) { + handler(fromRawEvent(rawEvent)); + } + }; }; var binder = function (element, event, filter, handler, useCapture) { - var wrapped = handle(filter, handler); - element.dom.addEventListener(event, wrapped, useCapture); - return {unbind: curry(unbind, element, event, wrapped, useCapture)}; + var wrapped = handle(filter, handler); + element.dom.addEventListener(event, wrapped, useCapture); + return { unbind: curry(unbind, element, event, wrapped, useCapture) }; }; var bind$1 = function (element, event, filter, handler) { - return binder(element, event, filter, handler, false); + return binder(element, event, filter, handler, false); }; var unbind = function (element, event, handler, useCapture) { - element.dom.removeEventListener(event, handler, useCapture); + element.dom.removeEventListener(event, handler, useCapture); }; var filter$1 = always; var bind$2 = function (element, event, handler) { - return bind$1(element, event, filter$1, handler); + return bind$1(element, event, filter$1, handler); }; var r = function (left, top) { - var translate = function (x, y) { - return r(left + x, top + y); - }; - return { - left: left, - top: top, - translate: translate - }; + var translate = function (x, y) { + return r(left + x, top + y); + }; + return { + left: left, + top: top, + translate: translate + }; }; var SugarPosition = r; var get$4 = function (_DOC) { - var doc = _DOC !== undefined ? _DOC.dom : document; - var x = doc.body.scrollLeft || doc.documentElement.scrollLeft; - var y = doc.body.scrollTop || doc.documentElement.scrollTop; - return SugarPosition(x, y); + var doc = _DOC !== undefined ? _DOC.dom : document; + var x = doc.body.scrollLeft || doc.documentElement.scrollLeft; + var y = doc.body.scrollTop || doc.documentElement.scrollTop; + return SugarPosition(x, y); }; var get$5 = function (_win) { - var win = _win === undefined ? window : _win; - return Optional.from(win['visualViewport']); + var win = _win === undefined ? window : _win; + return Optional.from(win['visualViewport']); }; var bounds = function (x, y, width, height) { - return { - x: x, - y: y, - width: width, - height: height, - right: x + width, - bottom: y + height - }; + return { + x: x, + y: y, + width: width, + height: height, + right: x + width, + bottom: y + height + }; }; var getBounds = function (_win) { - var win = _win === undefined ? window : _win; - var doc = win.document; - var scroll = get$4(SugarElement.fromDom(doc)); - return get$5(win).fold(function () { - var html = win.document.documentElement; - var width = html.clientWidth; - var height = html.clientHeight; - return bounds(scroll.left, scroll.top, width, height); - }, function (visualViewport) { - return bounds(Math.max(visualViewport.pageLeft, scroll.left), Math.max(visualViewport.pageTop, scroll.top), visualViewport.width, visualViewport.height); - }); + var win = _win === undefined ? window : _win; + var doc = win.document; + var scroll = get$4(SugarElement.fromDom(doc)); + return get$5(win).fold(function () { + var html = win.document.documentElement; + var width = html.clientWidth; + var height = html.clientHeight; + return bounds(scroll.left, scroll.top, width, height); + }, function (visualViewport) { + return bounds(Math.max(visualViewport.pageLeft, scroll.left), Math.max(visualViewport.pageTop, scroll.top), visualViewport.width, visualViewport.height); + }); }; var bind$3 = function (name, callback, _win) { - return get$5(_win).map(function (visualViewport) { - var handler = function (e) { - return callback(fromRawEvent(e)); - }; - visualViewport.addEventListener(name, handler); - return { - unbind: function () { - return visualViewport.removeEventListener(name, handler); - } - }; - }).getOrThunk(function () { - return {unbind: noop}; - }); + return get$5(_win).map(function (visualViewport) { + var handler = function (e) { + return callback(fromRawEvent(e)); + }; + visualViewport.addEventListener(name, handler); + return { + unbind: function () { + return visualViewport.removeEventListener(name, handler); + } + }; + }).getOrThunk(function () { + return { unbind: noop }; + }); }; var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); @@ -657,84 +655,84 @@ var global$3 = tinymce.util.Tools.resolve('tinymce.util.Delay'); var fireFullscreenStateChanged = function (editor, state) { - editor.fire('FullscreenStateChanged', {state: state}); + editor.fire('FullscreenStateChanged', { state: state }); }; var getFullscreenNative = function (editor) { - return editor.getParam('fullscreen_native', false, 'boolean'); + return editor.getParam('fullscreen_native', false, 'boolean'); }; var getFullscreenRoot = function (editor) { - var elem = SugarElement.fromDom(editor.getElement()); - return getShadowRoot(elem).map(getShadowHost).getOrThunk(function () { - return getBody(owner(elem)); - }); + var elem = SugarElement.fromDom(editor.getElement()); + return getShadowRoot(elem).map(getShadowHost).getOrThunk(function () { + return getBody(owner(elem)); + }); }; var getFullscreenElement = function (root) { - if (root.fullscreenElement !== undefined) { - return root.fullscreenElement; - } else if (root.msFullscreenElement !== undefined) { - return root.msFullscreenElement; - } else if (root.webkitFullscreenElement !== undefined) { - return root.webkitFullscreenElement; - } else { - return null; - } + if (root.fullscreenElement !== undefined) { + return root.fullscreenElement; + } else if (root.msFullscreenElement !== undefined) { + return root.msFullscreenElement; + } else if (root.webkitFullscreenElement !== undefined) { + return root.webkitFullscreenElement; + } else { + return null; + } }; var getFullscreenchangeEventName = function () { - if (document.fullscreenElement !== undefined) { - return 'fullscreenchange'; - } else if (document.msFullscreenElement !== undefined) { - return 'MSFullscreenChange'; - } else if (document.webkitFullscreenElement !== undefined) { - return 'webkitfullscreenchange'; - } else { - return 'fullscreenchange'; - } + if (document.fullscreenElement !== undefined) { + return 'fullscreenchange'; + } else if (document.msFullscreenElement !== undefined) { + return 'MSFullscreenChange'; + } else if (document.webkitFullscreenElement !== undefined) { + return 'webkitfullscreenchange'; + } else { + return 'fullscreenchange'; + } }; var requestFullscreen = function (sugarElem) { - var elem = sugarElem.dom; - if (elem.requestFullscreen) { - elem.requestFullscreen(); - } else if (elem.msRequestFullscreen) { - elem.msRequestFullscreen(); - } else if (elem.webkitRequestFullScreen) { - elem.webkitRequestFullScreen(); - } + var elem = sugarElem.dom; + if (elem.requestFullscreen) { + elem.requestFullscreen(); + } else if (elem.msRequestFullscreen) { + elem.msRequestFullscreen(); + } else if (elem.webkitRequestFullScreen) { + elem.webkitRequestFullScreen(); + } }; var exitFullscreen = function (sugarDoc) { - var doc = sugarDoc.dom; - if (doc.exitFullscreen) { - doc.exitFullscreen(); - } else if (doc.msExitFullscreen) { - doc.msExitFullscreen(); - } else if (doc.webkitCancelFullScreen) { - doc.webkitCancelFullScreen(); - } + var doc = sugarDoc.dom; + if (doc.exitFullscreen) { + doc.exitFullscreen(); + } else if (doc.msExitFullscreen) { + doc.msExitFullscreen(); + } else if (doc.webkitCancelFullScreen) { + doc.webkitCancelFullScreen(); + } }; var isFullscreenElement = function (elem) { - return elem.dom === getFullscreenElement(owner(elem).dom); + return elem.dom === getFullscreenElement(owner(elem).dom); }; var ancestors = function (scope, predicate, isRoot) { - return filter(parents(scope, isRoot), predicate); + return filter(parents(scope, isRoot), predicate); }; var siblings$1 = function (scope, predicate) { - return filter(siblings(scope), predicate); + return filter(siblings(scope), predicate); }; var all$1 = function (selector) { - return all(selector); + return all(selector); }; var ancestors$1 = function (scope, selector, isRoot) { - return ancestors(scope, function (e) { - return is(e, selector); - }, isRoot); + return ancestors(scope, function (e) { + return is(e, selector); + }, isRoot); }; var siblings$2 = function (scope, selector) { - return siblings$1(scope, function (e) { - return is(e, selector); - }); + return siblings$1(scope, function (e) { + return is(e, selector); + }); }; var attr = 'data-ephox-mobile-fullscreen-style'; @@ -744,236 +742,236 @@ var bgFallback = 'background-color:rgb(255,255,255)!important;'; var isAndroid = global$2.os.isAndroid(); var matchColor = function (editorBody) { - var color = get$3(editorBody, 'background-color'); - return color !== undefined && color !== '' ? 'background-color:' + color + '!important' : bgFallback; + var color = get$3(editorBody, 'background-color'); + return color !== undefined && color !== '' ? 'background-color:' + color + '!important' : bgFallback; }; var clobberStyles = function (dom, container, editorBody) { - var gatherSiblings = function (element) { - return siblings$2(element, '*:not(.tox-silver-sink)'); - }; - var clobber = function (clobberStyle) { - return function (element) { - var styles = get$2(element, 'style'); - var backup = styles === undefined ? 'no-styles' : styles.trim(); - if (backup === clobberStyle) { - return; - } else { - set(element, attr, backup); - setAll(element, dom.parseStyle(clobberStyle)); - } - }; - }; - var ancestors = ancestors$1(container, '*'); - var siblings = bind(ancestors, gatherSiblings); - var bgColor = matchColor(editorBody); - each(siblings, clobber(siblingStyles)); - each(ancestors, clobber(ancestorPosition + ancestorStyles + bgColor)); - var containerStyles = isAndroid === true ? '' : ancestorPosition; - clobber(containerStyles + ancestorStyles + bgColor)(container); + var gatherSiblings = function (element) { + return siblings$2(element, '*:not(.tox-silver-sink)'); + }; + var clobber = function (clobberStyle) { + return function (element) { + var styles = get$2(element, 'style'); + var backup = styles === undefined ? 'no-styles' : styles.trim(); + if (backup === clobberStyle) { + return; + } else { + set(element, attr, backup); + setAll(element, dom.parseStyle(clobberStyle)); + } + }; + }; + var ancestors = ancestors$1(container, '*'); + var siblings = bind(ancestors, gatherSiblings); + var bgColor = matchColor(editorBody); + each(siblings, clobber(siblingStyles)); + each(ancestors, clobber(ancestorPosition + ancestorStyles + bgColor)); + var containerStyles = isAndroid === true ? '' : ancestorPosition; + clobber(containerStyles + ancestorStyles + bgColor)(container); }; var restoreStyles = function (dom) { - var clobberedEls = all$1('[' + attr + ']'); - each(clobberedEls, function (element) { - var restore = get$2(element, attr); - if (restore !== 'no-styles') { - setAll(element, dom.parseStyle(restore)); - } else { - remove(element, 'style'); - } - remove(element, attr); - }); + var clobberedEls = all$1('[' + attr + ']'); + each(clobberedEls, function (element) { + var restore = get$2(element, attr); + if (restore !== 'no-styles') { + setAll(element, dom.parseStyle(restore)); + } else { + remove(element, 'style'); + } + remove(element, attr); + }); }; var DOM = global$1.DOM; var getScrollPos = function () { - var vp = getBounds(window); - return { - x: vp.x, - y: vp.y - }; + var vp = getBounds(window); + return { + x: vp.x, + y: vp.y + }; }; var setScrollPos = function (pos) { - window.scrollTo(pos.x, pos.y); + window.scrollTo(pos.x, pos.y); }; var viewportUpdate = get$5().fold(function () { - return { - bind: noop, - unbind: noop - }; + return { + bind: noop, + unbind: noop + }; }, function (visualViewport) { - var editorContainer = value(); - var resizeBinder = unbindable(); - var scrollBinder = unbindable(); - var refreshScroll = function () { - document.body.scrollTop = 0; - document.documentElement.scrollTop = 0; - }; - var refreshVisualViewport = function () { - window.requestAnimationFrame(function () { - editorContainer.on(function (container) { - return setAll(container, { - top: visualViewport.offsetTop + 'px', - left: visualViewport.offsetLeft + 'px', - height: visualViewport.height + 'px', - width: visualViewport.width + 'px' - }); - }); + var editorContainer = value(); + var resizeBinder = unbindable(); + var scrollBinder = unbindable(); + var refreshScroll = function () { + document.body.scrollTop = 0; + document.documentElement.scrollTop = 0; + }; + var refreshVisualViewport = function () { + window.requestAnimationFrame(function () { + editorContainer.on(function (container) { + return setAll(container, { + top: visualViewport.offsetTop + 'px', + left: visualViewport.offsetLeft + 'px', + height: visualViewport.height + 'px', + width: visualViewport.width + 'px' }); - }; - var update = global$3.throttle(function () { - refreshScroll(); - refreshVisualViewport(); - }, 50); - var bind = function (element) { - editorContainer.set(element); - update(); - resizeBinder.set(bind$3('resize', update)); - scrollBinder.set(bind$3('scroll', update)); - }; - var unbind = function () { - editorContainer.on(function () { - resizeBinder.clear(); - scrollBinder.clear(); - }); - editorContainer.clear(); - }; - return { - bind: bind, - unbind: unbind - }; + }); + }); + }; + var update = global$3.throttle(function () { + refreshScroll(); + refreshVisualViewport(); + }, 50); + var bind = function (element) { + editorContainer.set(element); + update(); + resizeBinder.set(bind$3('resize', update)); + scrollBinder.set(bind$3('scroll', update)); + }; + var unbind = function () { + editorContainer.on(function () { + resizeBinder.clear(); + scrollBinder.clear(); + }); + editorContainer.clear(); + }; + return { + bind: bind, + unbind: unbind + }; }); var toggleFullscreen = function (editor, fullscreenState) { - var body = document.body; - var documentElement = document.documentElement; - var editorContainer = editor.getContainer(); - var editorContainerS = SugarElement.fromDom(editorContainer); - var fullscreenRoot = getFullscreenRoot(editor); - var fullscreenInfo = fullscreenState.get(); - var editorBody = SugarElement.fromDom(editor.getBody()); - var isTouch = global$2.deviceType.isTouch(); - var editorContainerStyle = editorContainer.style; - var iframe = editor.iframeElement; - var iframeStyle = iframe.style; - var handleClasses = function (handler) { - handler(body, 'tox-fullscreen'); - handler(documentElement, 'tox-fullscreen'); - handler(editorContainer, 'tox-fullscreen'); - getShadowRoot(editorContainerS).map(function (root) { - return getShadowHost(root).dom; - }).each(function (host) { - handler(host, 'tox-fullscreen'); - handler(host, 'tox-shadowhost'); - }); - }; - var cleanup = function () { - if (isTouch) { - restoreStyles(editor.dom); - } - handleClasses(DOM.removeClass); - viewportUpdate.unbind(); - Optional.from(fullscreenState.get()).each(function (info) { - return info.fullscreenChangeHandler.unbind(); - }); - }; - if (!fullscreenInfo) { - var fullscreenChangeHandler = bind$2(owner(fullscreenRoot), getFullscreenchangeEventName(), function (_evt) { - if (getFullscreenNative(editor)) { - if (!isFullscreenElement(fullscreenRoot) && fullscreenState.get() !== null) { - toggleFullscreen(editor, fullscreenState); - } - } - }); - var newFullScreenInfo = { - scrollPos: getScrollPos(), - containerWidth: editorContainerStyle.width, - containerHeight: editorContainerStyle.height, - containerTop: editorContainerStyle.top, - containerLeft: editorContainerStyle.left, - iframeWidth: iframeStyle.width, - iframeHeight: iframeStyle.height, - fullscreenChangeHandler: fullscreenChangeHandler - }; - if (isTouch) { - clobberStyles(editor.dom, editorContainerS, editorBody); - } - iframeStyle.width = iframeStyle.height = '100%'; - editorContainerStyle.width = editorContainerStyle.height = ''; - handleClasses(DOM.addClass); - viewportUpdate.bind(editorContainerS); - editor.on('remove', cleanup); - fullscreenState.set(newFullScreenInfo); - if (getFullscreenNative(editor)) { - requestFullscreen(fullscreenRoot); - } - fireFullscreenStateChanged(editor, true); - } else { - fullscreenInfo.fullscreenChangeHandler.unbind(); - if (getFullscreenNative(editor) && isFullscreenElement(fullscreenRoot)) { - exitFullscreen(owner(fullscreenRoot)); + var body = document.body; + var documentElement = document.documentElement; + var editorContainer = editor.getContainer(); + var editorContainerS = SugarElement.fromDom(editorContainer); + var fullscreenRoot = getFullscreenRoot(editor); + var fullscreenInfo = fullscreenState.get(); + var editorBody = SugarElement.fromDom(editor.getBody()); + var isTouch = global$2.deviceType.isTouch(); + var editorContainerStyle = editorContainer.style; + var iframe = editor.iframeElement; + var iframeStyle = iframe.style; + var handleClasses = function (handler) { + handler(body, 'tox-fullscreen'); + handler(documentElement, 'tox-fullscreen'); + handler(editorContainer, 'tox-fullscreen'); + getShadowRoot(editorContainerS).map(function (root) { + return getShadowHost(root).dom; + }).each(function (host) { + handler(host, 'tox-fullscreen'); + handler(host, 'tox-shadowhost'); + }); + }; + var cleanup = function () { + if (isTouch) { + restoreStyles(editor.dom); + } + handleClasses(DOM.removeClass); + viewportUpdate.unbind(); + Optional.from(fullscreenState.get()).each(function (info) { + return info.fullscreenChangeHandler.unbind(); + }); + }; + if (!fullscreenInfo) { + var fullscreenChangeHandler = bind$2(owner(fullscreenRoot), getFullscreenchangeEventName(), function (_evt) { + if (getFullscreenNative(editor)) { + if (!isFullscreenElement(fullscreenRoot) && fullscreenState.get() !== null) { + toggleFullscreen(editor, fullscreenState); } - iframeStyle.width = fullscreenInfo.iframeWidth; - iframeStyle.height = fullscreenInfo.iframeHeight; - editorContainerStyle.width = fullscreenInfo.containerWidth; - editorContainerStyle.height = fullscreenInfo.containerHeight; - editorContainerStyle.top = fullscreenInfo.containerTop; - editorContainerStyle.left = fullscreenInfo.containerLeft; - setScrollPos(fullscreenInfo.scrollPos); - fullscreenState.set(null); - fireFullscreenStateChanged(editor, false); - cleanup(); - editor.off('remove', cleanup); + } + }); + var newFullScreenInfo = { + scrollPos: getScrollPos(), + containerWidth: editorContainerStyle.width, + containerHeight: editorContainerStyle.height, + containerTop: editorContainerStyle.top, + containerLeft: editorContainerStyle.left, + iframeWidth: iframeStyle.width, + iframeHeight: iframeStyle.height, + fullscreenChangeHandler: fullscreenChangeHandler + }; + if (isTouch) { + clobberStyles(editor.dom, editorContainerS, editorBody); } + iframeStyle.width = iframeStyle.height = '100%'; + editorContainerStyle.width = editorContainerStyle.height = ''; + handleClasses(DOM.addClass); + viewportUpdate.bind(editorContainerS); + editor.on('remove', cleanup); + fullscreenState.set(newFullScreenInfo); + if (getFullscreenNative(editor)) { + requestFullscreen(fullscreenRoot); + } + fireFullscreenStateChanged(editor, true); + } else { + fullscreenInfo.fullscreenChangeHandler.unbind(); + if (getFullscreenNative(editor) && isFullscreenElement(fullscreenRoot)) { + exitFullscreen(owner(fullscreenRoot)); + } + iframeStyle.width = fullscreenInfo.iframeWidth; + iframeStyle.height = fullscreenInfo.iframeHeight; + editorContainerStyle.width = fullscreenInfo.containerWidth; + editorContainerStyle.height = fullscreenInfo.containerHeight; + editorContainerStyle.top = fullscreenInfo.containerTop; + editorContainerStyle.left = fullscreenInfo.containerLeft; + setScrollPos(fullscreenInfo.scrollPos); + fullscreenState.set(null); + fireFullscreenStateChanged(editor, false); + cleanup(); + editor.off('remove', cleanup); + } }; var register = function (editor, fullscreenState) { - editor.addCommand('mceFullScreen', function () { - toggleFullscreen(editor, fullscreenState); - }); + editor.addCommand('mceFullScreen', function () { + toggleFullscreen(editor, fullscreenState); + }); }; var makeSetupHandler = function (editor, fullscreenState) { - return function (api) { - api.setActive(fullscreenState.get() !== null); - var editorEventCallback = function (e) { - return api.setActive(e.state); - }; - editor.on('FullscreenStateChanged', editorEventCallback); - return function () { - return editor.off('FullscreenStateChanged', editorEventCallback); - }; + return function (api) { + api.setActive(fullscreenState.get() !== null); + var editorEventCallback = function (e) { + return api.setActive(e.state); }; + editor.on('FullscreenStateChanged', editorEventCallback); + return function () { + return editor.off('FullscreenStateChanged', editorEventCallback); + }; + }; }; var register$1 = function (editor, fullscreenState) { - editor.ui.registry.addToggleMenuItem('fullscreen', { - text: 'Fullscreen', - icon: 'fullscreen', - shortcut: 'Meta+Shift+F', - onAction: function () { - return editor.execCommand('mceFullScreen'); - }, - onSetup: makeSetupHandler(editor, fullscreenState) - }); - editor.ui.registry.addToggleButton('fullscreen', { - tooltip: 'Fullscreen', - icon: 'fullscreen', - onAction: function () { - return editor.execCommand('mceFullScreen'); - }, - onSetup: makeSetupHandler(editor, fullscreenState) - }); - }; - - function Plugin() { - global.add('fullscreen', function (editor) { - var fullscreenState = Cell(null); - if (editor.inline) { - return get(fullscreenState); - } - register(editor, fullscreenState); - register$1(editor, fullscreenState); - editor.addShortcut('Meta+Shift+F', '', 'mceFullScreen'); - return get(fullscreenState); - }); + editor.ui.registry.addToggleMenuItem('fullscreen', { + text: 'Fullscreen', + icon: 'fullscreen', + shortcut: 'Meta+Shift+F', + onAction: function () { + return editor.execCommand('mceFullScreen'); + }, + onSetup: makeSetupHandler(editor, fullscreenState) + }); + editor.ui.registry.addToggleButton('fullscreen', { + tooltip: 'Fullscreen', + icon: 'fullscreen', + onAction: function () { + return editor.execCommand('mceFullScreen'); + }, + onSetup: makeSetupHandler(editor, fullscreenState) + }); + }; + + function Plugin () { + global.add('fullscreen', function (editor) { + var fullscreenState = Cell(null); + if (editor.inline) { + return get(fullscreenState); + } + register(editor, fullscreenState); + register$1(editor, fullscreenState); + editor.addShortcut('Meta+Shift+F', '', 'mceFullScreen'); + return get(fullscreenState); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/help/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/help/plugin.js index 7f84af1a..47d083c1 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/help/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/help/plugin.js @@ -10,835 +10,835 @@ 'use strict'; var Cell = function (initial) { - var value = initial; - var get = function () { - return value; - }; - var set = function (v) { - value = v; - }; - return { - get: get, - set: set - }; + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; }; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var get = function (customTabs) { - var addTab = function (spec) { - var currentCustomTabs = customTabs.get(); - currentCustomTabs[spec.name] = spec; - customTabs.set(currentCustomTabs); - }; - return {addTab: addTab}; + var addTab = function (spec) { + var currentCustomTabs = customTabs.get(); + currentCustomTabs[spec.name] = spec; + customTabs.set(currentCustomTabs); + }; + return { addTab: addTab }; }; var register = function (editor, dialogOpener) { - editor.addCommand('mceHelp', dialogOpener); + editor.addCommand('mceHelp', dialogOpener); }; var register$1 = function (editor, dialogOpener) { - editor.ui.registry.addButton('help', { - icon: 'help', - tooltip: 'Help', - onAction: dialogOpener - }); - editor.ui.registry.addMenuItem('help', { - text: 'Help', - icon: 'help', - shortcut: 'Alt+0', - onAction: dialogOpener - }); + editor.ui.registry.addButton('help', { + icon: 'help', + tooltip: 'Help', + onAction: dialogOpener + }); + editor.ui.registry.addMenuItem('help', { + text: 'Help', + icon: 'help', + shortcut: 'Alt+0', + onAction: dialogOpener + }); }; var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); }; var noop = function () { }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; var never = constant(false); var always = constant(true); var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var nativeIndexOf = Array.prototype.indexOf; var rawIndexOf = function (ts, t) { - return nativeIndexOf.call(ts, t); + return nativeIndexOf.call(ts, t); }; var contains = function (xs, x) { - return rawIndexOf(xs, x) > -1; + return rawIndexOf(xs, x) > -1; }; var map = function (xs, f) { - var len = xs.length; - var r = new Array(len); - for (var i = 0; i < len; i++) { - var x = xs[i]; - r[i] = f(x, i); - } - return r; + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; }; var filter = function (xs, pred) { - var r = []; - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - r.push(x); - } + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); } - return r; + } + return r; }; var findUntil = function (xs, pred, until) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - return Optional.some(x); - } else if (until(x, i)) { - break; - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(x); + } else if (until(x, i)) { + break; } - return Optional.none(); + } + return Optional.none(); }; var find = function (xs, pred) { - return findUntil(xs, pred, never); + return findUntil(xs, pred, never); }; var keys = Object.keys; var hasOwnProperty = Object.hasOwnProperty; var get$1 = function (obj, key) { - return has(obj, key) ? Optional.from(obj[key]) : Optional.none(); + return has(obj, key) ? Optional.from(obj[key]) : Optional.none(); }; var has = function (obj, key) { - return hasOwnProperty.call(obj, key); + return hasOwnProperty.call(obj, key); }; var cat = function (arr) { - var r = []; - var push = function (x) { - r.push(x); - }; - for (var i = 0; i < arr.length; i++) { - arr[i].each(push); - } - return r; + var r = []; + var push = function (x) { + r.push(x); + }; + for (var i = 0; i < arr.length; i++) { + arr[i].each(push); + } + return r; }; var getHelpTabs = function (editor) { - return Optional.from(editor.getParam('help_tabs')); + return Optional.from(editor.getParam('help_tabs')); }; var getForcedPlugins = function (editor) { - return editor.getParam('forced_plugins'); + return editor.getParam('forced_plugins'); }; var description = '

              Editor UI keyboard navigation

              \n\n

              Activating keyboard navigation

              \n\n

              The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:

              \n
                \n
              • Focus the menubar: Alt + F9 (Windows) or ⌥F9 (MacOS)
              • \n
              • Focus the toolbar: Alt + F10 (Windows) or ⌥F10 (MacOS)
              • \n
              • Focus the footer: Alt + F11 (Windows) or ⌥F11 (MacOS)
              • \n
              \n\n

              Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline.

              \n\n

              Moving between UI sections

              \n\n

              When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:

              \n
                \n
              • the menubar
              • \n
              • each group of the toolbar
              • \n
              • the sidebar
              • \n
              • the element path in the footer
              • \n
              • the wordcount toggle button in the footer
              • \n
              • the branding link in the footer
              • \n
              \n\n

              Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.

              \n\n

              Moving within UI sections

              \n\n

              Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:

              \n
                \n
              • moving between menus in the menubar
              • \n
              • moving between buttons in a toolbar group
              • \n
              • moving between items in the element path
              • \n
              \n\n

              In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group.

              \n\n

              Executing buttons

              \n\n

              To execute a button, navigate the selection to the desired button and hit space or enter.

              \n\n

              Opening, navigating and closing menus

              \n\n

              When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.

              \n\n

              To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.

              \n\n

              Context toolbars and menus

              \n\n

              To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or ⌃F9 (MacOS).

              \n\n

              Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.

              \n\n

              Dialog navigation

              \n\n

              There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.

              \n\n

              When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.

              \n\n

              When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab\u2019s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.

              '; var tab = function () { - var body = { - type: 'htmlpanel', - presets: 'document', - html: description - }; - return { - name: 'keyboardnav', - title: 'Keyboard Navigation', - items: [body] - }; + var body = { + type: 'htmlpanel', + presets: 'document', + html: description + }; + return { + name: 'keyboardnav', + title: 'Keyboard Navigation', + items: [body] + }; }; var global$1 = tinymce.util.Tools.resolve('tinymce.Env'); var convertText = function (source) { - var mac = { - alt: '⌥', - ctrl: '⌃', - shift: '⇧', - meta: '⌘', - access: '⌃⌥' - }; - var other = { - meta: 'Ctrl ', - access: 'Shift + Alt ' - }; - var replace = global$1.mac ? mac : other; - var shortcut = source.split('+'); - var updated = map(shortcut, function (segment) { - var search = segment.toLowerCase().trim(); - return has(replace, search) ? replace[search] : segment; - }); - return global$1.mac ? updated.join('').replace(/\s/, '') : updated.join('+'); + var mac = { + alt: '⌥', + ctrl: '⌃', + shift: '⇧', + meta: '⌘', + access: '⌃⌥' + }; + var other = { + meta: 'Ctrl ', + access: 'Shift + Alt ' + }; + var replace = global$1.mac ? mac : other; + var shortcut = source.split('+'); + var updated = map(shortcut, function (segment) { + var search = segment.toLowerCase().trim(); + return has(replace, search) ? replace[search] : segment; + }); + return global$1.mac ? updated.join('').replace(/\s/, '') : updated.join('+'); }; var shortcuts = [ - { - shortcuts: ['Meta + B'], - action: 'Bold' - }, - { - shortcuts: ['Meta + I'], - action: 'Italic' - }, - { - shortcuts: ['Meta + U'], - action: 'Underline' - }, - { - shortcuts: ['Meta + A'], - action: 'Select all' - }, - { - shortcuts: [ - 'Meta + Y', - 'Meta + Shift + Z' - ], - action: 'Redo' - }, - { - shortcuts: ['Meta + Z'], - action: 'Undo' - }, - { - shortcuts: ['Access + 1'], - action: 'Heading 1' - }, - { - shortcuts: ['Access + 2'], - action: 'Heading 2' - }, - { - shortcuts: ['Access + 3'], - action: 'Heading 3' - }, - { - shortcuts: ['Access + 4'], - action: 'Heading 4' - }, - { - shortcuts: ['Access + 5'], - action: 'Heading 5' - }, - { - shortcuts: ['Access + 6'], - action: 'Heading 6' - }, - { - shortcuts: ['Access + 7'], - action: 'Paragraph' - }, - { - shortcuts: ['Access + 8'], - action: 'Div' - }, - { - shortcuts: ['Access + 9'], - action: 'Address' - }, - { - shortcuts: ['Alt + 0'], - action: 'Open help dialog' - }, - { - shortcuts: ['Alt + F9'], - action: 'Focus to menubar' - }, - { - shortcuts: ['Alt + F10'], - action: 'Focus to toolbar' - }, - { - shortcuts: ['Alt + F11'], - action: 'Focus to element path' - }, - { - shortcuts: ['Ctrl + F9'], - action: 'Focus to contextual toolbar' - }, - { - shortcuts: ['Shift + Enter'], - action: 'Open popup menu for split buttons' - }, - { - shortcuts: ['Meta + K'], - action: 'Insert link (if link plugin activated)' - }, - { - shortcuts: ['Meta + S'], - action: 'Save (if save plugin activated)' - }, - { - shortcuts: ['Meta + F'], - action: 'Find (if searchreplace plugin activated)' - }, - { - shortcuts: ['Meta + Shift + F'], - action: 'Switch to or from fullscreen mode' - } + { + shortcuts: ['Meta + B'], + action: 'Bold' + }, + { + shortcuts: ['Meta + I'], + action: 'Italic' + }, + { + shortcuts: ['Meta + U'], + action: 'Underline' + }, + { + shortcuts: ['Meta + A'], + action: 'Select all' + }, + { + shortcuts: [ + 'Meta + Y', + 'Meta + Shift + Z' + ], + action: 'Redo' + }, + { + shortcuts: ['Meta + Z'], + action: 'Undo' + }, + { + shortcuts: ['Access + 1'], + action: 'Heading 1' + }, + { + shortcuts: ['Access + 2'], + action: 'Heading 2' + }, + { + shortcuts: ['Access + 3'], + action: 'Heading 3' + }, + { + shortcuts: ['Access + 4'], + action: 'Heading 4' + }, + { + shortcuts: ['Access + 5'], + action: 'Heading 5' + }, + { + shortcuts: ['Access + 6'], + action: 'Heading 6' + }, + { + shortcuts: ['Access + 7'], + action: 'Paragraph' + }, + { + shortcuts: ['Access + 8'], + action: 'Div' + }, + { + shortcuts: ['Access + 9'], + action: 'Address' + }, + { + shortcuts: ['Alt + 0'], + action: 'Open help dialog' + }, + { + shortcuts: ['Alt + F9'], + action: 'Focus to menubar' + }, + { + shortcuts: ['Alt + F10'], + action: 'Focus to toolbar' + }, + { + shortcuts: ['Alt + F11'], + action: 'Focus to element path' + }, + { + shortcuts: ['Ctrl + F9'], + action: 'Focus to contextual toolbar' + }, + { + shortcuts: ['Shift + Enter'], + action: 'Open popup menu for split buttons' + }, + { + shortcuts: ['Meta + K'], + action: 'Insert link (if link plugin activated)' + }, + { + shortcuts: ['Meta + S'], + action: 'Save (if save plugin activated)' + }, + { + shortcuts: ['Meta + F'], + action: 'Find (if searchreplace plugin activated)' + }, + { + shortcuts: ['Meta + Shift + F'], + action: 'Switch to or from fullscreen mode' + } ]; var tab$1 = function () { - var shortcutList = map(shortcuts, function (shortcut) { - var shortcutText = map(shortcut.shortcuts, convertText).join(' or '); - return [ - shortcut.action, - shortcutText - ]; - }); - var tablePanel = { - type: 'table', - header: [ - 'Action', - 'Shortcut' - ], - cells: shortcutList - }; - return { - name: 'shortcuts', - title: 'Handy Shortcuts', - items: [tablePanel] - }; + var shortcutList = map(shortcuts, function (shortcut) { + var shortcutText = map(shortcut.shortcuts, convertText).join(' or '); + return [ + shortcut.action, + shortcutText + ]; + }); + var tablePanel = { + type: 'table', + header: [ + 'Action', + 'Shortcut' + ], + cells: shortcutList + }; + return { + name: 'shortcuts', + title: 'Handy Shortcuts', + items: [tablePanel] + }; }; var global$2 = tinymce.util.Tools.resolve('tinymce.util.I18n'); var urls = [ - { - key: 'advlist', - name: 'Advanced List' - }, - { - key: 'anchor', - name: 'Anchor' - }, - { - key: 'autolink', - name: 'Autolink' - }, - { - key: 'autoresize', - name: 'Autoresize' - }, - { - key: 'autosave', - name: 'Autosave' - }, - { - key: 'bbcode', - name: 'BBCode' - }, - { - key: 'charmap', - name: 'Character Map' - }, - { - key: 'code', - name: 'Code' - }, - { - key: 'codesample', - name: 'Code Sample' - }, - { - key: 'colorpicker', - name: 'Color Picker' - }, - { - key: 'directionality', - name: 'Directionality' - }, - { - key: 'emoticons', - name: 'Emoticons' - }, - { - key: 'fullpage', - name: 'Full Page' - }, - { - key: 'fullscreen', - name: 'Full Screen' - }, - { - key: 'help', - name: 'Help' - }, - { - key: 'hr', - name: 'Horizontal Rule' - }, - { - key: 'image', - name: 'Image' - }, - { - key: 'imagetools', - name: 'Image Tools' - }, - { - key: 'importcss', - name: 'Import CSS' - }, - { - key: 'insertdatetime', - name: 'Insert Date/Time' - }, - { - key: 'legacyoutput', - name: 'Legacy Output' - }, - { - key: 'link', - name: 'Link' - }, - { - key: 'lists', - name: 'Lists' - }, - { - key: 'media', - name: 'Media' - }, - { - key: 'nonbreaking', - name: 'Nonbreaking' - }, - { - key: 'noneditable', - name: 'Noneditable' - }, - { - key: 'pagebreak', - name: 'Page Break' - }, - { - key: 'paste', - name: 'Paste' - }, - { - key: 'preview', - name: 'Preview' - }, - { - key: 'print', - name: 'Print' - }, - { - key: 'save', - name: 'Save' - }, - { - key: 'searchreplace', - name: 'Search and Replace' - }, - { - key: 'spellchecker', - name: 'Spell Checker' - }, - { - key: 'tabfocus', - name: 'Tab Focus' - }, - { - key: 'table', - name: 'Table' - }, - { - key: 'template', - name: 'Template' - }, - { - key: 'textcolor', - name: 'Text Color' - }, - { - key: 'textpattern', - name: 'Text Pattern' - }, - { - key: 'toc', - name: 'Table of Contents' - }, - { - key: 'visualblocks', - name: 'Visual Blocks' - }, - { - key: 'visualchars', - name: 'Visual Characters' - }, - { - key: 'wordcount', - name: 'Word Count' - }, - { - key: 'advcode', - name: 'Advanced Code Editor*' - }, - { - key: 'formatpainter', - name: 'Format Painter*' - }, - { - key: 'powerpaste', - name: 'PowerPaste*' - }, - { - key: 'tinydrive', - name: 'Tiny Drive*', - slug: 'drive' - }, - { - key: 'tinymcespellchecker', - name: 'Spell Checker Pro*' - }, - { - key: 'a11ychecker', - name: 'Accessibility Checker*' - }, - { - key: 'linkchecker', - name: 'Link Checker*' - }, - { - key: 'mentions', - name: 'Mentions*' - }, - { - key: 'mediaembed', - name: 'Enhanced Media Embed*' - }, - { - key: 'checklist', - name: 'Checklist*' - }, - { - key: 'casechange', - name: 'Case Change*' - }, - { - key: 'permanentpen', - name: 'Permanent Pen*' - }, - { - key: 'pageembed', - name: 'Page Embed*' - }, - { - key: 'tinycomments', - name: 'Tiny Comments*', - slug: 'comments' - }, - { - key: 'advtable', - name: 'Advanced Tables*' - }, - { - key: 'autocorrect', - name: 'Autocorrect*' - } + { + key: 'advlist', + name: 'Advanced List' + }, + { + key: 'anchor', + name: 'Anchor' + }, + { + key: 'autolink', + name: 'Autolink' + }, + { + key: 'autoresize', + name: 'Autoresize' + }, + { + key: 'autosave', + name: 'Autosave' + }, + { + key: 'bbcode', + name: 'BBCode' + }, + { + key: 'charmap', + name: 'Character Map' + }, + { + key: 'code', + name: 'Code' + }, + { + key: 'codesample', + name: 'Code Sample' + }, + { + key: 'colorpicker', + name: 'Color Picker' + }, + { + key: 'directionality', + name: 'Directionality' + }, + { + key: 'emoticons', + name: 'Emoticons' + }, + { + key: 'fullpage', + name: 'Full Page' + }, + { + key: 'fullscreen', + name: 'Full Screen' + }, + { + key: 'help', + name: 'Help' + }, + { + key: 'hr', + name: 'Horizontal Rule' + }, + { + key: 'image', + name: 'Image' + }, + { + key: 'imagetools', + name: 'Image Tools' + }, + { + key: 'importcss', + name: 'Import CSS' + }, + { + key: 'insertdatetime', + name: 'Insert Date/Time' + }, + { + key: 'legacyoutput', + name: 'Legacy Output' + }, + { + key: 'link', + name: 'Link' + }, + { + key: 'lists', + name: 'Lists' + }, + { + key: 'media', + name: 'Media' + }, + { + key: 'nonbreaking', + name: 'Nonbreaking' + }, + { + key: 'noneditable', + name: 'Noneditable' + }, + { + key: 'pagebreak', + name: 'Page Break' + }, + { + key: 'paste', + name: 'Paste' + }, + { + key: 'preview', + name: 'Preview' + }, + { + key: 'print', + name: 'Print' + }, + { + key: 'save', + name: 'Save' + }, + { + key: 'searchreplace', + name: 'Search and Replace' + }, + { + key: 'spellchecker', + name: 'Spell Checker' + }, + { + key: 'tabfocus', + name: 'Tab Focus' + }, + { + key: 'table', + name: 'Table' + }, + { + key: 'template', + name: 'Template' + }, + { + key: 'textcolor', + name: 'Text Color' + }, + { + key: 'textpattern', + name: 'Text Pattern' + }, + { + key: 'toc', + name: 'Table of Contents' + }, + { + key: 'visualblocks', + name: 'Visual Blocks' + }, + { + key: 'visualchars', + name: 'Visual Characters' + }, + { + key: 'wordcount', + name: 'Word Count' + }, + { + key: 'advcode', + name: 'Advanced Code Editor*' + }, + { + key: 'formatpainter', + name: 'Format Painter*' + }, + { + key: 'powerpaste', + name: 'PowerPaste*' + }, + { + key: 'tinydrive', + name: 'Tiny Drive*', + slug: 'drive' + }, + { + key: 'tinymcespellchecker', + name: 'Spell Checker Pro*' + }, + { + key: 'a11ychecker', + name: 'Accessibility Checker*' + }, + { + key: 'linkchecker', + name: 'Link Checker*' + }, + { + key: 'mentions', + name: 'Mentions*' + }, + { + key: 'mediaembed', + name: 'Enhanced Media Embed*' + }, + { + key: 'checklist', + name: 'Checklist*' + }, + { + key: 'casechange', + name: 'Case Change*' + }, + { + key: 'permanentpen', + name: 'Permanent Pen*' + }, + { + key: 'pageembed', + name: 'Page Embed*' + }, + { + key: 'tinycomments', + name: 'Tiny Comments*', + slug: 'comments' + }, + { + key: 'advtable', + name: 'Advanced Tables*' + }, + { + key: 'autocorrect', + name: 'Autocorrect*' + } ]; var tab$2 = function (editor) { - var availablePlugins = function () { - var premiumPlugins = [ - 'Accessibility Checker', - 'Advanced Code Editor', - 'Advanced Tables', - 'Case Change', - 'Checklist', - 'Tiny Comments', - 'Tiny Drive', - 'Enhanced Media Embed', - 'Format Painter', - 'Link Checker', - 'Mentions', - 'MoxieManager', - 'Page Embed', - 'Permanent Pen', - 'PowerPaste', - 'Spell Checker Pro' - ]; - var premiumPluginList = map(premiumPlugins, function (plugin) { - return '
            • ' + global$2.translate(plugin) + '
            • '; - }).join(''); - return '
              ' + '

              ' + global$2.translate('Premium plugins:') + '

              ' + '' + '
              '; - }; - var makeLink = function (p) { - return '' + p.name + ''; - }; - var maybeUrlize = function (editor, key) { - return find(urls, function (x) { - return x.key === key; - }).fold(function () { - var getMetadata = editor.plugins[key].getMetadata; - return typeof getMetadata === 'function' ? makeLink(getMetadata()) : key; - }, function (x) { - var urlSlug = x.slug || x.key; - return makeLink({ - name: x.name, - url: 'https://www.tiny.cloud/docs/plugins/' + urlSlug - }); - }); - }; - var getPluginKeys = function (editor) { - var keys$1 = keys(editor.plugins); - var forced_plugins = getForcedPlugins(editor); - return forced_plugins === undefined ? keys$1 : filter(keys$1, function (k) { - return !contains(forced_plugins, k); - }); - }; - var pluginLister = function (editor) { - var pluginKeys = getPluginKeys(editor); - var pluginLis = map(pluginKeys, function (key) { - return '
            • ' + maybeUrlize(editor, key) + '
            • '; - }); - var count = pluginLis.length; - var pluginsString = pluginLis.join(''); - var html = '

              ' + global$2.translate([ - 'Plugins installed ({0}):', - count - ]) + '

              ' + '
                ' + pluginsString + '
              '; - return html; - }; - var installedPlugins = function (editor) { - if (editor == null) { - return ''; - } - return '
              ' + pluginLister(editor) + '
              '; - }; - var htmlPanel = { - type: 'htmlpanel', - presets: 'document', - html: [ - installedPlugins(editor), - availablePlugins() - ].join('') - }; - return { - name: 'plugins', - title: 'Plugins', - items: [htmlPanel] - }; + var availablePlugins = function () { + var premiumPlugins = [ + 'Accessibility Checker', + 'Advanced Code Editor', + 'Advanced Tables', + 'Case Change', + 'Checklist', + 'Tiny Comments', + 'Tiny Drive', + 'Enhanced Media Embed', + 'Format Painter', + 'Link Checker', + 'Mentions', + 'MoxieManager', + 'Page Embed', + 'Permanent Pen', + 'PowerPaste', + 'Spell Checker Pro' + ]; + var premiumPluginList = map(premiumPlugins, function (plugin) { + return '
            • ' + global$2.translate(plugin) + '
            • '; + }).join(''); + return '
              ' + '

              ' + global$2.translate('Premium plugins:') + '

              ' + '' + '
              '; + }; + var makeLink = function (p) { + return '' + p.name + ''; + }; + var maybeUrlize = function (editor, key) { + return find(urls, function (x) { + return x.key === key; + }).fold(function () { + var getMetadata = editor.plugins[key].getMetadata; + return typeof getMetadata === 'function' ? makeLink(getMetadata()) : key; + }, function (x) { + var urlSlug = x.slug || x.key; + return makeLink({ + name: x.name, + url: 'https://www.tiny.cloud/docs/plugins/' + urlSlug + }); + }); + }; + var getPluginKeys = function (editor) { + var keys$1 = keys(editor.plugins); + var forced_plugins = getForcedPlugins(editor); + return forced_plugins === undefined ? keys$1 : filter(keys$1, function (k) { + return !contains(forced_plugins, k); + }); + }; + var pluginLister = function (editor) { + var pluginKeys = getPluginKeys(editor); + var pluginLis = map(pluginKeys, function (key) { + return '
            • ' + maybeUrlize(editor, key) + '
            • '; + }); + var count = pluginLis.length; + var pluginsString = pluginLis.join(''); + var html = '

              ' + global$2.translate([ + 'Plugins installed ({0}):', + count + ]) + '

              ' + '
                ' + pluginsString + '
              '; + return html; + }; + var installedPlugins = function (editor) { + if (editor == null) { + return ''; + } + return '
              ' + pluginLister(editor) + '
              '; + }; + var htmlPanel = { + type: 'htmlpanel', + presets: 'document', + html: [ + installedPlugins(editor), + availablePlugins() + ].join('') + }; + return { + name: 'plugins', + title: 'Plugins', + items: [htmlPanel] + }; }; var global$3 = tinymce.util.Tools.resolve('tinymce.EditorManager'); var tab$3 = function () { - var getVersion = function (major, minor) { - return major.indexOf('@') === 0 ? 'X.X.X' : major + '.' + minor; - }; - var version = getVersion(global$3.majorVersion, global$3.minorVersion); - var changeLogLink = 'TinyMCE ' + version + ''; - var htmlPanel = { - type: 'htmlpanel', - html: '

              ' + global$2.translate([ - 'You are using {0}', - changeLogLink - ]) + '

              ', - presets: 'document' - }; - return { - name: 'versions', - title: 'Version', - items: [htmlPanel] - }; + var getVersion = function (major, minor) { + return major.indexOf('@') === 0 ? 'X.X.X' : major + '.' + minor; + }; + var version = getVersion(global$3.majorVersion, global$3.minorVersion); + var changeLogLink = 'TinyMCE ' + version + ''; + var htmlPanel = { + type: 'htmlpanel', + html: '

              ' + global$2.translate([ + 'You are using {0}', + changeLogLink + ]) + '

              ', + presets: 'document' + }; + return { + name: 'versions', + title: 'Version', + items: [htmlPanel] + }; }; var parseHelpTabsSetting = function (tabsFromSettings, tabs) { - var newTabs = {}; - var names = map(tabsFromSettings, function (t) { - if (typeof t === 'string') { - if (has(tabs, t)) { - newTabs[t] = tabs[t]; - } - return t; - } else { - newTabs[t.name] = t; - return t.name; - } - }); - return { - tabs: newTabs, - names: names - }; + var newTabs = {}; + var names = map(tabsFromSettings, function (t) { + if (typeof t === 'string') { + if (has(tabs, t)) { + newTabs[t] = tabs[t]; + } + return t; + } else { + newTabs[t.name] = t; + return t.name; + } + }); + return { + tabs: newTabs, + names: names + }; }; var getNamesFromTabs = function (tabs) { - var names = keys(tabs); - var idx = names.indexOf('versions'); - if (idx !== -1) { - names.splice(idx, 1); - names.push('versions'); - } - return { - tabs: tabs, - names: names - }; + var names = keys(tabs); + var idx = names.indexOf('versions'); + if (idx !== -1) { + names.splice(idx, 1); + names.push('versions'); + } + return { + tabs: tabs, + names: names + }; }; var parseCustomTabs = function (editor, customTabs) { - var _a; - var shortcuts = tab$1(); - var nav = tab(); - var plugins = tab$2(editor); - var versions = tab$3(); - var tabs = __assign((_a = {}, _a[shortcuts.name] = shortcuts, _a[nav.name] = nav, _a[plugins.name] = plugins, _a[versions.name] = versions, _a), customTabs.get()); - return getHelpTabs(editor).fold(function () { - return getNamesFromTabs(tabs); - }, function (tabsFromSettings) { - return parseHelpTabsSetting(tabsFromSettings, tabs); - }); + var _a; + var shortcuts = tab$1(); + var nav = tab(); + var plugins = tab$2(editor); + var versions = tab$3(); + var tabs = __assign((_a = {}, _a[shortcuts.name] = shortcuts, _a[nav.name] = nav, _a[plugins.name] = plugins, _a[versions.name] = versions, _a), customTabs.get()); + return getHelpTabs(editor).fold(function () { + return getNamesFromTabs(tabs); + }, function (tabsFromSettings) { + return parseHelpTabsSetting(tabsFromSettings, tabs); + }); }; var init = function (editor, customTabs) { - return function () { - var _a = parseCustomTabs(editor, customTabs), tabs = _a.tabs, names = _a.names; - var foundTabs = map(names, function (name) { - return get$1(tabs, name); - }); - var dialogTabs = cat(foundTabs); - var body = { - type: 'tabpanel', - tabs: dialogTabs - }; - editor.windowManager.open({ - title: 'Help', - size: 'medium', - body: body, - buttons: [{ - type: 'cancel', - name: 'close', - text: 'Close', - primary: true - }], - initialData: {} - }); - }; + return function () { + var _a = parseCustomTabs(editor, customTabs), tabs = _a.tabs, names = _a.names; + var foundTabs = map(names, function (name) { + return get$1(tabs, name); + }); + var dialogTabs = cat(foundTabs); + var body = { + type: 'tabpanel', + tabs: dialogTabs + }; + editor.windowManager.open({ + title: 'Help', + size: 'medium', + body: body, + buttons: [{ + type: 'cancel', + name: 'close', + text: 'Close', + primary: true + }], + initialData: {} + }); + }; }; - function Plugin() { - global.add('help', function (editor) { - var customTabs = Cell({}); - var api = get(customTabs); - var dialogOpener = init(editor, customTabs); - register$1(editor, dialogOpener); - register(editor, dialogOpener); - editor.shortcuts.add('Alt+0', 'Open help dialog', 'mceHelp'); - return api; - }); + function Plugin () { + global.add('help', function (editor) { + var customTabs = Cell({}); + var api = get(customTabs); + var dialogOpener = init(editor, customTabs); + register$1(editor, dialogOpener); + register(editor, dialogOpener); + editor.shortcuts.add('Alt+0', 'Open help dialog', 'mceHelp'); + return api; + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/hr/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/hr/plugin.js index e41a49ac..75d22d30 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/hr/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/hr/plugin.js @@ -12,33 +12,33 @@ var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var register = function (editor) { - editor.addCommand('InsertHorizontalRule', function () { - editor.execCommand('mceInsertContent', false, '
              '); - }); + editor.addCommand('InsertHorizontalRule', function () { + editor.execCommand('mceInsertContent', false, '
              '); + }); }; var register$1 = function (editor) { - editor.ui.registry.addButton('hr', { - icon: 'horizontal-rule', - tooltip: 'Horizontal line', - onAction: function () { - return editor.execCommand('InsertHorizontalRule'); - } - }); - editor.ui.registry.addMenuItem('hr', { - icon: 'horizontal-rule', - text: 'Horizontal line', - onAction: function () { - return editor.execCommand('InsertHorizontalRule'); - } - }); + editor.ui.registry.addButton('hr', { + icon: 'horizontal-rule', + tooltip: 'Horizontal line', + onAction: function () { + return editor.execCommand('InsertHorizontalRule'); + } + }); + editor.ui.registry.addMenuItem('hr', { + icon: 'horizontal-rule', + text: 'Horizontal line', + onAction: function () { + return editor.execCommand('InsertHorizontalRule'); + } + }); }; - function Plugin() { - global.add('hr', function (editor) { - register(editor); - register$1(editor); - }); + function Plugin () { + global.add('hr', function (editor) { + register(editor); + register$1(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/image/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/image/plugin.js index 3d4b776b..d7b1cf18 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/image/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/image/plugin.js @@ -12,44 +12,44 @@ var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); }; var typeOf = function (x) { - var t = typeof x; - if (x === null) { - return 'null'; - } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { - return 'array'; - } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { - return 'string'; - } else { - return t; - } + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } }; var isType = function (type) { - return function (value) { - return typeOf(value) === type; - }; + return function (value) { + return typeOf(value) === type; + }; }; var isSimpleType = function (type) { - return function (value) { - return typeof value === type; - }; + return function (value) { + return typeof value === type; + }; }; var eq = function (t) { - return function (a) { - return t === a; - }; + return function (a) { + return t === a; + }; }; var isString = isType('string'); var isObject = isType('object'); @@ -61,198 +61,198 @@ var noop = function () { }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; var never = constant(false); var always = constant(true); var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var nativePush = Array.prototype.push; var flatten = function (xs) { - var r = []; - for (var i = 0, len = xs.length; i < len; ++i) { - if (!isArray(xs[i])) { - throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); - } - nativePush.apply(r, xs[i]); + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); } - return r; + nativePush.apply(r, xs[i]); + } + return r; }; var get = function (xs, i) { - return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none(); + return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none(); }; var head = function (xs) { - return get(xs, 0); + return get(xs, 0); }; var findMap = function (arr, f) { - for (var i = 0; i < arr.length; i++) { - var r = f(arr[i], i); - if (r.isSome()) { - return r; - } + for (var i = 0; i < arr.length; i++) { + var r = f(arr[i], i); + if (r.isSome()) { + return r; } - return Optional.none(); + } + return Optional.none(); }; var Global = typeof window !== 'undefined' ? window : Function('return this;')(); var rawSet = function (dom, key, value) { - if (isString(value) || isBoolean(value) || isNumber(value)) { - dom.setAttribute(key, value + ''); - } else { - console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); - throw new Error('Attribute value was not simple'); - } + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); + throw new Error('Attribute value was not simple'); + } }; var set = function (element, key, value) { - rawSet(element.dom, key, value); + rawSet(element.dom, key, value); }; var remove = function (element, key) { - element.dom.removeAttribute(key); + element.dom.removeAttribute(key); }; var fromHtml = function (html, scope) { - var doc = scope || document; - var div = doc.createElement('div'); - div.innerHTML = html; - if (!div.hasChildNodes() || div.childNodes.length > 1) { - console.error('HTML does not have a single root node', html); - throw new Error('HTML must have a single root node'); - } - return fromDom(div.childNodes[0]); + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); }; var fromTag = function (tag, scope) { - var doc = scope || document; - var node = doc.createElement(tag); - return fromDom(node); + var doc = scope || document; + var node = doc.createElement(tag); + return fromDom(node); }; var fromText = function (text, scope) { - var doc = scope || document; - var node = doc.createTextNode(text); - return fromDom(node); + var doc = scope || document; + var node = doc.createTextNode(text); + return fromDom(node); }; var fromDom = function (node) { - if (node === null || node === undefined) { - throw new Error('Node cannot be null or undefined'); - } - return {dom: node}; + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: node }; }; var fromPoint = function (docElm, x, y) { - return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); + return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); }; var SugarElement = { - fromHtml: fromHtml, - fromTag: fromTag, - fromText: fromText, - fromDom: fromDom, - fromPoint: fromPoint + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint }; var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); @@ -262,1402 +262,1401 @@ var global$3 = tinymce.util.Tools.resolve('tinymce.util.XHR'); var hasDimensions = function (editor) { - return editor.getParam('image_dimensions', true, 'boolean'); + return editor.getParam('image_dimensions', true, 'boolean'); }; var hasAdvTab = function (editor) { - return editor.getParam('image_advtab', false, 'boolean'); + return editor.getParam('image_advtab', false, 'boolean'); }; var hasUploadTab = function (editor) { - return editor.getParam('image_uploadtab', true, 'boolean'); + return editor.getParam('image_uploadtab', true, 'boolean'); }; var getPrependUrl = function (editor) { - return editor.getParam('image_prepend_url', '', 'string'); + return editor.getParam('image_prepend_url', '', 'string'); }; var getClassList = function (editor) { - return editor.getParam('image_class_list'); + return editor.getParam('image_class_list'); }; var hasDescription = function (editor) { - return editor.getParam('image_description', true, 'boolean'); + return editor.getParam('image_description', true, 'boolean'); }; var hasImageTitle = function (editor) { - return editor.getParam('image_title', false, 'boolean'); + return editor.getParam('image_title', false, 'boolean'); }; var hasImageCaption = function (editor) { - return editor.getParam('image_caption', false, 'boolean'); + return editor.getParam('image_caption', false, 'boolean'); }; var getImageList = function (editor) { - return editor.getParam('image_list', false); + return editor.getParam('image_list', false); }; var hasUploadUrl = function (editor) { - return !!getUploadUrl(editor); + return !!getUploadUrl(editor); }; var hasUploadHandler = function (editor) { - return !!getUploadHandler(editor); + return !!getUploadHandler(editor); }; var getUploadUrl = function (editor) { - return editor.getParam('images_upload_url', '', 'string'); + return editor.getParam('images_upload_url', '', 'string'); }; var getUploadHandler = function (editor) { - return editor.getParam('images_upload_handler', undefined, 'function'); + return editor.getParam('images_upload_handler', undefined, 'function'); }; var getUploadBasePath = function (editor) { - return editor.getParam('images_upload_base_path', undefined, 'string'); + return editor.getParam('images_upload_base_path', undefined, 'string'); }; var getUploadCredentials = function (editor) { - return editor.getParam('images_upload_credentials', false, 'boolean'); + return editor.getParam('images_upload_credentials', false, 'boolean'); }; var showAccessibilityOptions = function (editor) { - return editor.getParam('a11y_advanced_options', false, 'boolean'); + return editor.getParam('a11y_advanced_options', false, 'boolean'); }; var isAutomaticUploadsEnabled = function (editor) { - return editor.getParam('automatic_uploads', true, 'boolean'); + return editor.getParam('automatic_uploads', true, 'boolean'); }; var parseIntAndGetMax = function (val1, val2) { - return Math.max(parseInt(val1, 10), parseInt(val2, 10)); + return Math.max(parseInt(val1, 10), parseInt(val2, 10)); }; var getImageSize = function (url) { - return new global$2(function (callback) { - var img = document.createElement('img'); - var done = function (dimensions) { - if (img.parentNode) { - img.parentNode.removeChild(img); - } - callback(dimensions); - }; - img.onload = function () { - var width = parseIntAndGetMax(img.width, img.clientWidth); - var height = parseIntAndGetMax(img.height, img.clientHeight); - var dimensions = { - width: width, - height: height - }; - done(global$2.resolve(dimensions)); - }; - img.onerror = function () { - done(global$2.reject('Failed to get image dimensions for: ' + url)); - }; - var style = img.style; - style.visibility = 'hidden'; - style.position = 'fixed'; - style.bottom = style.left = '0px'; - style.width = style.height = 'auto'; - document.body.appendChild(img); - img.src = url; - }); + return new global$2(function (callback) { + var img = document.createElement('img'); + var done = function (dimensions) { + if (img.parentNode) { + img.parentNode.removeChild(img); + } + callback(dimensions); + }; + img.onload = function () { + var width = parseIntAndGetMax(img.width, img.clientWidth); + var height = parseIntAndGetMax(img.height, img.clientHeight); + var dimensions = { + width: width, + height: height + }; + done(global$2.resolve(dimensions)); + }; + img.onerror = function () { + done(global$2.reject('Failed to get image dimensions for: ' + url)); + }; + var style = img.style; + style.visibility = 'hidden'; + style.position = 'fixed'; + style.bottom = style.left = '0px'; + style.width = style.height = 'auto'; + document.body.appendChild(img); + img.src = url; + }); }; var removePixelSuffix = function (value) { - if (value) { - value = value.replace(/px$/, ''); - } - return value; + if (value) { + value = value.replace(/px$/, ''); + } + return value; }; var addPixelSuffix = function (value) { - if (value.length > 0 && /^[0-9]+$/.test(value)) { - value += 'px'; - } - return value; + if (value.length > 0 && /^[0-9]+$/.test(value)) { + value += 'px'; + } + return value; }; var mergeMargins = function (css) { - if (css.margin) { - var splitMargin = String(css.margin).split(' '); - switch (splitMargin.length) { - case 1: - css['margin-top'] = css['margin-top'] || splitMargin[0]; - css['margin-right'] = css['margin-right'] || splitMargin[0]; - css['margin-bottom'] = css['margin-bottom'] || splitMargin[0]; - css['margin-left'] = css['margin-left'] || splitMargin[0]; - break; - case 2: - css['margin-top'] = css['margin-top'] || splitMargin[0]; - css['margin-right'] = css['margin-right'] || splitMargin[1]; - css['margin-bottom'] = css['margin-bottom'] || splitMargin[0]; - css['margin-left'] = css['margin-left'] || splitMargin[1]; - break; - case 3: - css['margin-top'] = css['margin-top'] || splitMargin[0]; - css['margin-right'] = css['margin-right'] || splitMargin[1]; - css['margin-bottom'] = css['margin-bottom'] || splitMargin[2]; - css['margin-left'] = css['margin-left'] || splitMargin[1]; - break; - case 4: - css['margin-top'] = css['margin-top'] || splitMargin[0]; - css['margin-right'] = css['margin-right'] || splitMargin[1]; - css['margin-bottom'] = css['margin-bottom'] || splitMargin[2]; - css['margin-left'] = css['margin-left'] || splitMargin[3]; - } - delete css.margin; + if (css.margin) { + var splitMargin = String(css.margin).split(' '); + switch (splitMargin.length) { + case 1: + css['margin-top'] = css['margin-top'] || splitMargin[0]; + css['margin-right'] = css['margin-right'] || splitMargin[0]; + css['margin-bottom'] = css['margin-bottom'] || splitMargin[0]; + css['margin-left'] = css['margin-left'] || splitMargin[0]; + break; + case 2: + css['margin-top'] = css['margin-top'] || splitMargin[0]; + css['margin-right'] = css['margin-right'] || splitMargin[1]; + css['margin-bottom'] = css['margin-bottom'] || splitMargin[0]; + css['margin-left'] = css['margin-left'] || splitMargin[1]; + break; + case 3: + css['margin-top'] = css['margin-top'] || splitMargin[0]; + css['margin-right'] = css['margin-right'] || splitMargin[1]; + css['margin-bottom'] = css['margin-bottom'] || splitMargin[2]; + css['margin-left'] = css['margin-left'] || splitMargin[1]; + break; + case 4: + css['margin-top'] = css['margin-top'] || splitMargin[0]; + css['margin-right'] = css['margin-right'] || splitMargin[1]; + css['margin-bottom'] = css['margin-bottom'] || splitMargin[2]; + css['margin-left'] = css['margin-left'] || splitMargin[3]; } - return css; + delete css.margin; + } + return css; }; var createImageList = function (editor, callback) { - var imageList = getImageList(editor); - if (typeof imageList === 'string') { - global$3.send({ - url: imageList, - success: function (text) { - callback(JSON.parse(text)); - } - }); - } else if (typeof imageList === 'function') { - imageList(callback); - } else { - callback(imageList); - } + var imageList = getImageList(editor); + if (typeof imageList === 'string') { + global$3.send({ + url: imageList, + success: function (text) { + callback(JSON.parse(text)); + } + }); + } else if (typeof imageList === 'function') { + imageList(callback); + } else { + callback(imageList); + } }; var waitLoadImage = function (editor, data, imgElm) { - var selectImage = function () { - imgElm.onload = imgElm.onerror = null; - if (editor.selection) { - editor.selection.select(imgElm); - editor.nodeChanged(); - } - }; - imgElm.onload = function () { - if (!data.width && !data.height && hasDimensions(editor)) { - editor.dom.setAttribs(imgElm, { - width: String(imgElm.clientWidth), - height: String(imgElm.clientHeight) - }); - } - selectImage(); - }; - imgElm.onerror = selectImage; + var selectImage = function () { + imgElm.onload = imgElm.onerror = null; + if (editor.selection) { + editor.selection.select(imgElm); + editor.nodeChanged(); + } + }; + imgElm.onload = function () { + if (!data.width && !data.height && hasDimensions(editor)) { + editor.dom.setAttribs(imgElm, { + width: String(imgElm.clientWidth), + height: String(imgElm.clientHeight) + }); + } + selectImage(); + }; + imgElm.onerror = selectImage; }; var blobToDataUri = function (blob) { - return new global$2(function (resolve, reject) { - var reader = new FileReader(); - reader.onload = function () { - resolve(reader.result); - }; - reader.onerror = function () { - reject(reader.error.message); - }; - reader.readAsDataURL(blob); - }); + return new global$2(function (resolve, reject) { + var reader = new FileReader(); + reader.onload = function () { + resolve(reader.result); + }; + reader.onerror = function () { + reject(reader.error.message); + }; + reader.readAsDataURL(blob); + }); }; var isPlaceholderImage = function (imgElm) { - return imgElm.nodeName === 'IMG' && (imgElm.hasAttribute('data-mce-object') || imgElm.hasAttribute('data-mce-placeholder')); + return imgElm.nodeName === 'IMG' && (imgElm.hasAttribute('data-mce-object') || imgElm.hasAttribute('data-mce-placeholder')); }; var DOM = global$1.DOM; var getHspace = function (image) { - if (image.style.marginLeft && image.style.marginRight && image.style.marginLeft === image.style.marginRight) { - return removePixelSuffix(image.style.marginLeft); - } else { - return ''; - } + if (image.style.marginLeft && image.style.marginRight && image.style.marginLeft === image.style.marginRight) { + return removePixelSuffix(image.style.marginLeft); + } else { + return ''; + } }; var getVspace = function (image) { - if (image.style.marginTop && image.style.marginBottom && image.style.marginTop === image.style.marginBottom) { - return removePixelSuffix(image.style.marginTop); - } else { - return ''; - } + if (image.style.marginTop && image.style.marginBottom && image.style.marginTop === image.style.marginBottom) { + return removePixelSuffix(image.style.marginTop); + } else { + return ''; + } }; var getBorder = function (image) { - if (image.style.borderWidth) { - return removePixelSuffix(image.style.borderWidth); - } else { - return ''; - } + if (image.style.borderWidth) { + return removePixelSuffix(image.style.borderWidth); + } else { + return ''; + } }; var getAttrib = function (image, name) { - if (image.hasAttribute(name)) { - return image.getAttribute(name); - } else { - return ''; - } + if (image.hasAttribute(name)) { + return image.getAttribute(name); + } else { + return ''; + } }; var getStyle = function (image, name) { - return image.style[name] ? image.style[name] : ''; + return image.style[name] ? image.style[name] : ''; }; var hasCaption = function (image) { - return image.parentNode !== null && image.parentNode.nodeName === 'FIGURE'; + return image.parentNode !== null && image.parentNode.nodeName === 'FIGURE'; }; var updateAttrib = function (image, name, value) { - if (value === '') { - image.removeAttribute(name); - } else { - image.setAttribute(name, value); - } + if (value === '') { + image.removeAttribute(name); + } else { + image.setAttribute(name, value); + } }; var wrapInFigure = function (image) { - var figureElm = DOM.create('figure', {class: 'image'}); - DOM.insertAfter(figureElm, image); - figureElm.appendChild(image); - figureElm.appendChild(DOM.create('figcaption', {contentEditable: 'true'}, 'Caption')); - figureElm.contentEditable = 'false'; + var figureElm = DOM.create('figure', { class: 'image' }); + DOM.insertAfter(figureElm, image); + figureElm.appendChild(image); + figureElm.appendChild(DOM.create('figcaption', { contentEditable: 'true' }, 'Caption')); + figureElm.contentEditable = 'false'; }; var removeFigure = function (image) { - var figureElm = image.parentNode; - DOM.insertAfter(image, figureElm); - DOM.remove(figureElm); + var figureElm = image.parentNode; + DOM.insertAfter(image, figureElm); + DOM.remove(figureElm); }; var toggleCaption = function (image) { - if (hasCaption(image)) { - removeFigure(image); - } else { - wrapInFigure(image); - } + if (hasCaption(image)) { + removeFigure(image); + } else { + wrapInFigure(image); + } }; var normalizeStyle = function (image, normalizeCss) { - var attrValue = image.getAttribute('style'); - var value = normalizeCss(attrValue !== null ? attrValue : ''); - if (value.length > 0) { - image.setAttribute('style', value); - image.setAttribute('data-mce-style', value); - } else { - image.removeAttribute('style'); - } + var attrValue = image.getAttribute('style'); + var value = normalizeCss(attrValue !== null ? attrValue : ''); + if (value.length > 0) { + image.setAttribute('style', value); + image.setAttribute('data-mce-style', value); + } else { + image.removeAttribute('style'); + } }; var setSize = function (name, normalizeCss) { - return function (image, name, value) { - if (image.style[name]) { - image.style[name] = addPixelSuffix(value); - normalizeStyle(image, normalizeCss); - } else { - updateAttrib(image, name, value); - } - }; - }; - var getSize = function (image, name) { + return function (image, name, value) { if (image.style[name]) { - return removePixelSuffix(image.style[name]); + image.style[name] = addPixelSuffix(value); + normalizeStyle(image, normalizeCss); } else { - return getAttrib(image, name); + updateAttrib(image, name, value); } + }; + }; + var getSize = function (image, name) { + if (image.style[name]) { + return removePixelSuffix(image.style[name]); + } else { + return getAttrib(image, name); + } }; var setHspace = function (image, value) { - var pxValue = addPixelSuffix(value); - image.style.marginLeft = pxValue; - image.style.marginRight = pxValue; + var pxValue = addPixelSuffix(value); + image.style.marginLeft = pxValue; + image.style.marginRight = pxValue; }; var setVspace = function (image, value) { - var pxValue = addPixelSuffix(value); - image.style.marginTop = pxValue; - image.style.marginBottom = pxValue; + var pxValue = addPixelSuffix(value); + image.style.marginTop = pxValue; + image.style.marginBottom = pxValue; }; var setBorder = function (image, value) { - var pxValue = addPixelSuffix(value); - image.style.borderWidth = pxValue; + var pxValue = addPixelSuffix(value); + image.style.borderWidth = pxValue; }; var setBorderStyle = function (image, value) { - image.style.borderStyle = value; + image.style.borderStyle = value; }; var getBorderStyle = function (image) { - return getStyle(image, 'borderStyle'); + return getStyle(image, 'borderStyle'); }; var isFigure = function (elm) { - return elm.nodeName === 'FIGURE'; + return elm.nodeName === 'FIGURE'; }; var isImage = function (elm) { - return elm.nodeName === 'IMG'; + return elm.nodeName === 'IMG'; }; var getIsDecorative = function (image) { - return DOM.getAttrib(image, 'alt').length === 0 && DOM.getAttrib(image, 'role') === 'presentation'; + return DOM.getAttrib(image, 'alt').length === 0 && DOM.getAttrib(image, 'role') === 'presentation'; }; var getAlt = function (image) { - if (getIsDecorative(image)) { - return ''; - } else { - return getAttrib(image, 'alt'); - } + if (getIsDecorative(image)) { + return ''; + } else { + return getAttrib(image, 'alt'); + } }; var defaultData = function () { - return { - src: '', - alt: '', - title: '', - width: '', - height: '', - class: '', - style: '', - caption: false, - hspace: '', - vspace: '', - border: '', - borderStyle: '', - isDecorative: false - }; + return { + src: '', + alt: '', + title: '', + width: '', + height: '', + class: '', + style: '', + caption: false, + hspace: '', + vspace: '', + border: '', + borderStyle: '', + isDecorative: false + }; }; var getStyleValue = function (normalizeCss, data) { - var image = document.createElement('img'); - updateAttrib(image, 'style', data.style); - if (getHspace(image) || data.hspace !== '') { - setHspace(image, data.hspace); - } - if (getVspace(image) || data.vspace !== '') { - setVspace(image, data.vspace); - } - if (getBorder(image) || data.border !== '') { - setBorder(image, data.border); - } - if (getBorderStyle(image) || data.borderStyle !== '') { - setBorderStyle(image, data.borderStyle); - } - return normalizeCss(image.getAttribute('style')); + var image = document.createElement('img'); + updateAttrib(image, 'style', data.style); + if (getHspace(image) || data.hspace !== '') { + setHspace(image, data.hspace); + } + if (getVspace(image) || data.vspace !== '') { + setVspace(image, data.vspace); + } + if (getBorder(image) || data.border !== '') { + setBorder(image, data.border); + } + if (getBorderStyle(image) || data.borderStyle !== '') { + setBorderStyle(image, data.borderStyle); + } + return normalizeCss(image.getAttribute('style')); }; var create = function (normalizeCss, data) { - var image = document.createElement('img'); - write(normalizeCss, __assign(__assign({}, data), {caption: false}), image); - setAlt(image, data.alt, data.isDecorative); - if (data.caption) { - var figure = DOM.create('figure', {class: 'image'}); - figure.appendChild(image); - figure.appendChild(DOM.create('figcaption', {contentEditable: 'true'}, 'Caption')); - figure.contentEditable = 'false'; - return figure; - } else { - return image; - } + var image = document.createElement('img'); + write(normalizeCss, __assign(__assign({}, data), { caption: false }), image); + setAlt(image, data.alt, data.isDecorative); + if (data.caption) { + var figure = DOM.create('figure', { class: 'image' }); + figure.appendChild(image); + figure.appendChild(DOM.create('figcaption', { contentEditable: 'true' }, 'Caption')); + figure.contentEditable = 'false'; + return figure; + } else { + return image; + } }; var read = function (normalizeCss, image) { - return { - src: getAttrib(image, 'src'), - alt: getAlt(image), - title: getAttrib(image, 'title'), - width: getSize(image, 'width'), - height: getSize(image, 'height'), - class: getAttrib(image, 'class'), - style: normalizeCss(getAttrib(image, 'style')), - caption: hasCaption(image), - hspace: getHspace(image), - vspace: getVspace(image), - border: getBorder(image), - borderStyle: getStyle(image, 'borderStyle'), - isDecorative: getIsDecorative(image) - }; + return { + src: getAttrib(image, 'src'), + alt: getAlt(image), + title: getAttrib(image, 'title'), + width: getSize(image, 'width'), + height: getSize(image, 'height'), + class: getAttrib(image, 'class'), + style: normalizeCss(getAttrib(image, 'style')), + caption: hasCaption(image), + hspace: getHspace(image), + vspace: getVspace(image), + border: getBorder(image), + borderStyle: getStyle(image, 'borderStyle'), + isDecorative: getIsDecorative(image) + }; }; var updateProp = function (image, oldData, newData, name, set) { - if (newData[name] !== oldData[name]) { - set(image, name, newData[name]); - } + if (newData[name] !== oldData[name]) { + set(image, name, newData[name]); + } }; var setAlt = function (image, alt, isDecorative) { - if (isDecorative) { - DOM.setAttrib(image, 'role', 'presentation'); - var sugarImage = SugarElement.fromDom(image); - set(sugarImage, 'alt', ''); + if (isDecorative) { + DOM.setAttrib(image, 'role', 'presentation'); + var sugarImage = SugarElement.fromDom(image); + set(sugarImage, 'alt', ''); + } else { + if (isNull(alt)) { + var sugarImage = SugarElement.fromDom(image); + remove(sugarImage, 'alt'); } else { - if (isNull(alt)) { - var sugarImage = SugarElement.fromDom(image); - remove(sugarImage, 'alt'); - } else { - var sugarImage = SugarElement.fromDom(image); - set(sugarImage, 'alt', alt); - } - if (DOM.getAttrib(image, 'role') === 'presentation') { - DOM.setAttrib(image, 'role', ''); - } + var sugarImage = SugarElement.fromDom(image); + set(sugarImage, 'alt', alt); + } + if (DOM.getAttrib(image, 'role') === 'presentation') { + DOM.setAttrib(image, 'role', ''); } + } }; var updateAlt = function (image, oldData, newData) { - if (newData.alt !== oldData.alt || newData.isDecorative !== oldData.isDecorative) { - setAlt(image, newData.alt, newData.isDecorative); - } + if (newData.alt !== oldData.alt || newData.isDecorative !== oldData.isDecorative) { + setAlt(image, newData.alt, newData.isDecorative); + } }; var normalized = function (set, normalizeCss) { - return function (image, name, value) { - set(image, value); - normalizeStyle(image, normalizeCss); - }; + return function (image, name, value) { + set(image, value); + normalizeStyle(image, normalizeCss); + }; }; var write = function (normalizeCss, newData, image) { - var oldData = read(normalizeCss, image); - updateProp(image, oldData, newData, 'caption', function (image, _name, _value) { - return toggleCaption(image); - }); - updateProp(image, oldData, newData, 'src', updateAttrib); - updateProp(image, oldData, newData, 'title', updateAttrib); - updateProp(image, oldData, newData, 'width', setSize('width', normalizeCss)); - updateProp(image, oldData, newData, 'height', setSize('height', normalizeCss)); - updateProp(image, oldData, newData, 'class', updateAttrib); - updateProp(image, oldData, newData, 'style', normalized(function (image, value) { - return updateAttrib(image, 'style', value); - }, normalizeCss)); - updateProp(image, oldData, newData, 'hspace', normalized(setHspace, normalizeCss)); - updateProp(image, oldData, newData, 'vspace', normalized(setVspace, normalizeCss)); - updateProp(image, oldData, newData, 'border', normalized(setBorder, normalizeCss)); - updateProp(image, oldData, newData, 'borderStyle', normalized(setBorderStyle, normalizeCss)); - updateAlt(image, oldData, newData); + var oldData = read(normalizeCss, image); + updateProp(image, oldData, newData, 'caption', function (image, _name, _value) { + return toggleCaption(image); + }); + updateProp(image, oldData, newData, 'src', updateAttrib); + updateProp(image, oldData, newData, 'title', updateAttrib); + updateProp(image, oldData, newData, 'width', setSize('width', normalizeCss)); + updateProp(image, oldData, newData, 'height', setSize('height', normalizeCss)); + updateProp(image, oldData, newData, 'class', updateAttrib); + updateProp(image, oldData, newData, 'style', normalized(function (image, value) { + return updateAttrib(image, 'style', value); + }, normalizeCss)); + updateProp(image, oldData, newData, 'hspace', normalized(setHspace, normalizeCss)); + updateProp(image, oldData, newData, 'vspace', normalized(setVspace, normalizeCss)); + updateProp(image, oldData, newData, 'border', normalized(setBorder, normalizeCss)); + updateProp(image, oldData, newData, 'borderStyle', normalized(setBorderStyle, normalizeCss)); + updateAlt(image, oldData, newData); }; var normalizeCss = function (editor, cssText) { - var css = editor.dom.styles.parse(cssText); - var mergedCss = mergeMargins(css); - var compressed = editor.dom.styles.parse(editor.dom.styles.serialize(mergedCss)); - return editor.dom.styles.serialize(compressed); + var css = editor.dom.styles.parse(cssText); + var mergedCss = mergeMargins(css); + var compressed = editor.dom.styles.parse(editor.dom.styles.serialize(mergedCss)); + return editor.dom.styles.serialize(compressed); }; var getSelectedImage = function (editor) { - var imgElm = editor.selection.getNode(); - var figureElm = editor.dom.getParent(imgElm, 'figure.image'); - if (figureElm) { - return editor.dom.select('img', figureElm)[0]; - } - if (imgElm && (imgElm.nodeName !== 'IMG' || isPlaceholderImage(imgElm))) { - return null; - } - return imgElm; + var imgElm = editor.selection.getNode(); + var figureElm = editor.dom.getParent(imgElm, 'figure.image'); + if (figureElm) { + return editor.dom.select('img', figureElm)[0]; + } + if (imgElm && (imgElm.nodeName !== 'IMG' || isPlaceholderImage(imgElm))) { + return null; + } + return imgElm; }; var splitTextBlock = function (editor, figure) { - var dom = editor.dom; - var textBlock = dom.getParent(figure.parentNode, function (node) { - return !!editor.schema.getTextBlockElements()[node.nodeName]; - }, editor.getBody()); - if (textBlock) { - return dom.split(textBlock, figure); - } else { - return figure; - } + var dom = editor.dom; + var textBlock = dom.getParent(figure.parentNode, function (node) { + return !!editor.schema.getTextBlockElements()[node.nodeName]; + }, editor.getBody()); + if (textBlock) { + return dom.split(textBlock, figure); + } else { + return figure; + } }; var readImageDataFromSelection = function (editor) { - var image = getSelectedImage(editor); - return image ? read(function (css) { - return normalizeCss(editor, css); - }, image) : defaultData(); + var image = getSelectedImage(editor); + return image ? read(function (css) { + return normalizeCss(editor, css); + }, image) : defaultData(); }; var insertImageAtCaret = function (editor, data) { - var elm = create(function (css) { - return normalizeCss(editor, css); - }, data); - editor.dom.setAttrib(elm, 'data-mce-id', '__mcenew'); - editor.focus(); - editor.selection.setContent(elm.outerHTML); - var insertedElm = editor.dom.select('*[data-mce-id="__mcenew"]')[0]; - editor.dom.setAttrib(insertedElm, 'data-mce-id', null); - if (isFigure(insertedElm)) { - var figure = splitTextBlock(editor, insertedElm); - editor.selection.select(figure); - } else { - editor.selection.select(insertedElm); - } + var elm = create(function (css) { + return normalizeCss(editor, css); + }, data); + editor.dom.setAttrib(elm, 'data-mce-id', '__mcenew'); + editor.focus(); + editor.selection.setContent(elm.outerHTML); + var insertedElm = editor.dom.select('*[data-mce-id="__mcenew"]')[0]; + editor.dom.setAttrib(insertedElm, 'data-mce-id', null); + if (isFigure(insertedElm)) { + var figure = splitTextBlock(editor, insertedElm); + editor.selection.select(figure); + } else { + editor.selection.select(insertedElm); + } }; var syncSrcAttr = function (editor, image) { - editor.dom.setAttrib(image, 'src', image.getAttribute('src')); + editor.dom.setAttrib(image, 'src', image.getAttribute('src')); }; var deleteImage = function (editor, image) { - if (image) { - var elm = editor.dom.is(image.parentNode, 'figure.image') ? image.parentNode : image; - editor.dom.remove(elm); - editor.focus(); - editor.nodeChanged(); - if (editor.dom.isEmpty(editor.getBody())) { - editor.setContent(''); - editor.selection.setCursorLocation(); - } + if (image) { + var elm = editor.dom.is(image.parentNode, 'figure.image') ? image.parentNode : image; + editor.dom.remove(elm); + editor.focus(); + editor.nodeChanged(); + if (editor.dom.isEmpty(editor.getBody())) { + editor.setContent(''); + editor.selection.setCursorLocation(); } + } }; var writeImageDataToSelection = function (editor, data) { - var image = getSelectedImage(editor); - write(function (css) { - return normalizeCss(editor, css); - }, data, image); - syncSrcAttr(editor, image); - if (isFigure(image.parentNode)) { - var figure = image.parentNode; - splitTextBlock(editor, figure); - editor.selection.select(image.parentNode); - } else { - editor.selection.select(image); - waitLoadImage(editor, data, image); - } + var image = getSelectedImage(editor); + write(function (css) { + return normalizeCss(editor, css); + }, data, image); + syncSrcAttr(editor, image); + if (isFigure(image.parentNode)) { + var figure = image.parentNode; + splitTextBlock(editor, figure); + editor.selection.select(image.parentNode); + } else { + editor.selection.select(image); + waitLoadImage(editor, data, image); + } }; var insertOrUpdateImage = function (editor, partialData) { - var image = getSelectedImage(editor); - if (image) { - var selectedImageData = read(function (css) { - return normalizeCss(editor, css); - }, image); - var data = __assign(__assign({}, selectedImageData), partialData); - if (data.src) { - writeImageDataToSelection(editor, data); - } else { - deleteImage(editor, image); - } - } else if (partialData.src) { - insertImageAtCaret(editor, __assign(__assign({}, defaultData()), partialData)); + var image = getSelectedImage(editor); + if (image) { + var selectedImageData = read(function (css) { + return normalizeCss(editor, css); + }, image); + var data = __assign(__assign({}, selectedImageData), partialData); + if (data.src) { + writeImageDataToSelection(editor, data); + } else { + deleteImage(editor, image); } + } else if (partialData.src) { + insertImageAtCaret(editor, __assign(__assign({}, defaultData()), partialData)); + } }; var hasOwnProperty = Object.prototype.hasOwnProperty; var deep = function (old, nu) { - var bothObjects = isObject(old) && isObject(nu); - return bothObjects ? deepMerge(old, nu) : nu; + var bothObjects = isObject(old) && isObject(nu); + return bothObjects ? deepMerge(old, nu) : nu; }; var baseMerge = function (merger) { - return function () { - var objects = new Array(arguments.length); - for (var i = 0; i < objects.length; i++) { - objects[i] = arguments[i]; - } - if (objects.length === 0) { - throw new Error('Can\'t merge zero objects'); - } - var ret = {}; - for (var j = 0; j < objects.length; j++) { - var curObject = objects[j]; - for (var key in curObject) { - if (hasOwnProperty.call(curObject, key)) { - ret[key] = merger(ret[key], curObject[key]); - } - } + return function () { + var objects = new Array(arguments.length); + for (var i = 0; i < objects.length; i++) { + objects[i] = arguments[i]; + } + if (objects.length === 0) { + throw new Error('Can\'t merge zero objects'); + } + var ret = {}; + for (var j = 0; j < objects.length; j++) { + var curObject = objects[j]; + for (var key in curObject) { + if (hasOwnProperty.call(curObject, key)) { + ret[key] = merger(ret[key], curObject[key]); } - return ret; - }; + } + } + return ret; + }; }; var deepMerge = baseMerge(deep); var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var getValue = function (item) { - return isString(item.value) ? item.value : ''; + return isString(item.value) ? item.value : ''; }; var getText = function (item) { - if (isString(item.text)) { - return item.text; - } else if (isString(item.title)) { - return item.title; - } else { - return ''; - } + if (isString(item.text)) { + return item.text; + } else if (isString(item.title)) { + return item.title; + } else { + return ''; + } }; var sanitizeList = function (list, extractValue) { - var out = []; - global$4.each(list, function (item) { - var text = getText(item); - if (item.menu !== undefined) { - var items = sanitizeList(item.menu, extractValue); - out.push({ - text: text, - items: items - }); - } else { - var value = extractValue(item); - out.push({ - text: text, - value: value - }); - } - }); - return out; + var out = []; + global$4.each(list, function (item) { + var text = getText(item); + if (item.menu !== undefined) { + var items = sanitizeList(item.menu, extractValue); + out.push({ + text: text, + items: items + }); + } else { + var value = extractValue(item); + out.push({ + text: text, + value: value + }); + } + }); + return out; }; var sanitizer = function (extracter) { - if (extracter === void 0) { - extracter = getValue; + if (extracter === void 0) { + extracter = getValue; + } + return function (list) { + if (list) { + return Optional.from(list).map(function (list) { + return sanitizeList(list, extracter); + }); + } else { + return Optional.none(); } - return function (list) { - if (list) { - return Optional.from(list).map(function (list) { - return sanitizeList(list, extracter); - }); - } else { - return Optional.none(); - } - }; + }; }; var sanitize = function (list) { - return sanitizer(getValue)(list); + return sanitizer(getValue)(list); }; var isGroup = function (item) { - return Object.prototype.hasOwnProperty.call(item, 'items'); + return Object.prototype.hasOwnProperty.call(item, 'items'); }; var findEntryDelegate = function (list, value) { - return findMap(list, function (item) { - if (isGroup(item)) { - return findEntryDelegate(item.items, value); - } else if (item.value === value) { - return Optional.some(item); - } else { - return Optional.none(); - } - }); + return findMap(list, function (item) { + if (isGroup(item)) { + return findEntryDelegate(item.items, value); + } else if (item.value === value) { + return Optional.some(item); + } else { + return Optional.none(); + } + }); }; var findEntry = function (optList, value) { - return optList.bind(function (list) { - return findEntryDelegate(list, value); - }); + return optList.bind(function (list) { + return findEntryDelegate(list, value); + }); }; var ListUtils = { - sanitizer: sanitizer, - sanitize: sanitize, - findEntry: findEntry + sanitizer: sanitizer, + sanitize: sanitize, + findEntry: findEntry }; var pathJoin = function (path1, path2) { - if (path1) { - return path1.replace(/\/$/, '') + '/' + path2.replace(/^\//, ''); - } - return path2; - }; - - function Uploader(settings) { - var defaultHandler = function (blobInfo, success, failure, progress) { - var xhr = new XMLHttpRequest(); - xhr.open('POST', settings.url); - xhr.withCredentials = settings.credentials; - xhr.upload.onprogress = function (e) { - progress(e.loaded / e.total * 100); - }; - xhr.onerror = function () { - failure('Image upload failed due to a XHR Transport error. Code: ' + xhr.status); - }; - xhr.onload = function () { - if (xhr.status < 200 || xhr.status >= 300) { - failure('HTTP Error: ' + xhr.status); - return; - } - var json = JSON.parse(xhr.responseText); - if (!json || typeof json.location !== 'string') { - failure('Invalid JSON: ' + xhr.responseText); - return; - } - success(pathJoin(settings.basePath, json.location)); - }; - var formData = new FormData(); - formData.append('file', blobInfo.blob(), blobInfo.filename()); - xhr.send(formData); - }; - var uploadBlob = function (blobInfo, handler) { - return new global$2(function (resolve, reject) { - try { - handler(blobInfo, resolve, reject, noop); - } catch (ex) { - reject(ex.message); - } - }); + if (path1) { + return path1.replace(/\/$/, '') + '/' + path2.replace(/^\//, ''); + } + return path2; + }; + function Uploader (settings) { + var defaultHandler = function (blobInfo, success, failure, progress) { + var xhr = new XMLHttpRequest(); + xhr.open('POST', settings.url); + xhr.withCredentials = settings.credentials; + xhr.upload.onprogress = function (e) { + progress(e.loaded / e.total * 100); }; - var isDefaultHandler = function (handler) { - return handler === defaultHandler; + xhr.onerror = function () { + failure('Image upload failed due to a XHR Transport error. Code: ' + xhr.status); }; - var upload = function (blobInfo) { - return !settings.url && isDefaultHandler(settings.handler) ? global$2.reject('Upload url missing from the settings.') : uploadBlob(blobInfo, settings.handler); + xhr.onload = function () { + if (xhr.status < 200 || xhr.status >= 300) { + failure('HTTP Error: ' + xhr.status); + return; + } + var json = JSON.parse(xhr.responseText); + if (!json || typeof json.location !== 'string') { + failure('Invalid JSON: ' + xhr.responseText); + return; + } + success(pathJoin(settings.basePath, json.location)); }; - settings = global$4.extend({ - credentials: false, - handler: defaultHandler - }, settings); - return {upload: upload}; + var formData = new FormData(); + formData.append('file', blobInfo.blob(), blobInfo.filename()); + xhr.send(formData); + }; + var uploadBlob = function (blobInfo, handler) { + return new global$2(function (resolve, reject) { + try { + handler(blobInfo, resolve, reject, noop); + } catch (ex) { + reject(ex.message); + } + }); + }; + var isDefaultHandler = function (handler) { + return handler === defaultHandler; + }; + var upload = function (blobInfo) { + return !settings.url && isDefaultHandler(settings.handler) ? global$2.reject('Upload url missing from the settings.') : uploadBlob(blobInfo, settings.handler); + }; + settings = global$4.extend({ + credentials: false, + handler: defaultHandler + }, settings); + return { upload: upload }; } var makeTab = function (_info) { - return { - title: 'Advanced', - name: 'advanced', + return { + title: 'Advanced', + name: 'advanced', + items: [ + { + type: 'input', + label: 'Style', + name: 'style' + }, + { + type: 'grid', + columns: 2, items: [ - { - type: 'input', - label: 'Style', - name: 'style' - }, - { - type: 'grid', - columns: 2, - items: [ - { - type: 'input', - label: 'Vertical space', - name: 'vspace', - inputMode: 'numeric' - }, - { - type: 'input', - label: 'Horizontal space', - name: 'hspace', - inputMode: 'numeric' - }, - { - type: 'input', - label: 'Border width', - name: 'border', - inputMode: 'numeric' - }, - { - type: 'listbox', - name: 'borderstyle', - label: 'Border style', - items: [ - { - text: 'Select...', - value: '' - }, - { - text: 'Solid', - value: 'solid' - }, - { - text: 'Dotted', - value: 'dotted' - }, - { - text: 'Dashed', - value: 'dashed' - }, - { - text: 'Double', - value: 'double' - }, - { - text: 'Groove', - value: 'groove' - }, - { - text: 'Ridge', - value: 'ridge' - }, - { - text: 'Inset', - value: 'inset' - }, - { - text: 'Outset', - value: 'outset' - }, - { - text: 'None', - value: 'none' - }, - { - text: 'Hidden', - value: 'hidden' - } - ] - } - ] - } + { + type: 'input', + label: 'Vertical space', + name: 'vspace', + inputMode: 'numeric' + }, + { + type: 'input', + label: 'Horizontal space', + name: 'hspace', + inputMode: 'numeric' + }, + { + type: 'input', + label: 'Border width', + name: 'border', + inputMode: 'numeric' + }, + { + type: 'listbox', + name: 'borderstyle', + label: 'Border style', + items: [ + { + text: 'Select...', + value: '' + }, + { + text: 'Solid', + value: 'solid' + }, + { + text: 'Dotted', + value: 'dotted' + }, + { + text: 'Dashed', + value: 'dashed' + }, + { + text: 'Double', + value: 'double' + }, + { + text: 'Groove', + value: 'groove' + }, + { + text: 'Ridge', + value: 'ridge' + }, + { + text: 'Inset', + value: 'inset' + }, + { + text: 'Outset', + value: 'outset' + }, + { + text: 'None', + value: 'none' + }, + { + text: 'Hidden', + value: 'hidden' + } + ] + } ] - }; + } + ] + }; }; - var AdvTab = {makeTab: makeTab}; + var AdvTab = { makeTab: makeTab }; var collect = function (editor) { - var urlListSanitizer = ListUtils.sanitizer(function (item) { - return editor.convertURL(item.value || item.url, 'src'); - }); - var futureImageList = new global$2(function (completer) { - createImageList(editor, function (imageList) { - completer(urlListSanitizer(imageList).map(function (items) { - return flatten([ - [{ - text: 'None', - value: '' - }], - items - ]); - })); - }); - }); - var classList = ListUtils.sanitize(getClassList(editor)); - var hasAdvTab$1 = hasAdvTab(editor); - var hasUploadTab$1 = hasUploadTab(editor); - var hasUploadUrl$1 = hasUploadUrl(editor); - var hasUploadHandler$1 = hasUploadHandler(editor); - var image = readImageDataFromSelection(editor); - var hasDescription$1 = hasDescription(editor); - var hasImageTitle$1 = hasImageTitle(editor); - var hasDimensions$1 = hasDimensions(editor); - var hasImageCaption$1 = hasImageCaption(editor); - var hasAccessibilityOptions = showAccessibilityOptions(editor); - var url = getUploadUrl(editor); - var basePath = getUploadBasePath(editor); - var credentials = getUploadCredentials(editor); - var handler = getUploadHandler(editor); - var automaticUploads = isAutomaticUploadsEnabled(editor); - var prependURL = Optional.some(getPrependUrl(editor)).filter(function (preUrl) { - return isString(preUrl) && preUrl.length > 0; - }); - return futureImageList.then(function (imageList) { - return { - image: image, - imageList: imageList, - classList: classList, - hasAdvTab: hasAdvTab$1, - hasUploadTab: hasUploadTab$1, - hasUploadUrl: hasUploadUrl$1, - hasUploadHandler: hasUploadHandler$1, - hasDescription: hasDescription$1, - hasImageTitle: hasImageTitle$1, - hasDimensions: hasDimensions$1, - hasImageCaption: hasImageCaption$1, - url: url, - basePath: basePath, - credentials: credentials, - handler: handler, - prependURL: prependURL, - hasAccessibilityOptions: hasAccessibilityOptions, - automaticUploads: automaticUploads - }; + var urlListSanitizer = ListUtils.sanitizer(function (item) { + return editor.convertURL(item.value || item.url, 'src'); + }); + var futureImageList = new global$2(function (completer) { + createImageList(editor, function (imageList) { + completer(urlListSanitizer(imageList).map(function (items) { + return flatten([ + [{ + text: 'None', + value: '' + }], + items + ]); + })); }); + }); + var classList = ListUtils.sanitize(getClassList(editor)); + var hasAdvTab$1 = hasAdvTab(editor); + var hasUploadTab$1 = hasUploadTab(editor); + var hasUploadUrl$1 = hasUploadUrl(editor); + var hasUploadHandler$1 = hasUploadHandler(editor); + var image = readImageDataFromSelection(editor); + var hasDescription$1 = hasDescription(editor); + var hasImageTitle$1 = hasImageTitle(editor); + var hasDimensions$1 = hasDimensions(editor); + var hasImageCaption$1 = hasImageCaption(editor); + var hasAccessibilityOptions = showAccessibilityOptions(editor); + var url = getUploadUrl(editor); + var basePath = getUploadBasePath(editor); + var credentials = getUploadCredentials(editor); + var handler = getUploadHandler(editor); + var automaticUploads = isAutomaticUploadsEnabled(editor); + var prependURL = Optional.some(getPrependUrl(editor)).filter(function (preUrl) { + return isString(preUrl) && preUrl.length > 0; + }); + return futureImageList.then(function (imageList) { + return { + image: image, + imageList: imageList, + classList: classList, + hasAdvTab: hasAdvTab$1, + hasUploadTab: hasUploadTab$1, + hasUploadUrl: hasUploadUrl$1, + hasUploadHandler: hasUploadHandler$1, + hasDescription: hasDescription$1, + hasImageTitle: hasImageTitle$1, + hasDimensions: hasDimensions$1, + hasImageCaption: hasImageCaption$1, + url: url, + basePath: basePath, + credentials: credentials, + handler: handler, + prependURL: prependURL, + hasAccessibilityOptions: hasAccessibilityOptions, + automaticUploads: automaticUploads + }; + }); }; var makeItems = function (info) { - var imageUrl = { - name: 'src', - type: 'urlinput', - filetype: 'image', - label: 'Source' - }; - var imageList = info.imageList.map(function (items) { - return { - name: 'images', - type: 'listbox', - label: 'Image list', - items: items - }; - }); - var imageDescription = { - name: 'alt', - type: 'input', - label: 'Alternative description', - disabled: info.hasAccessibilityOptions && info.image.isDecorative - }; - var imageTitle = { - name: 'title', - type: 'input', - label: 'Image title' - }; - var imageDimensions = { - name: 'dimensions', - type: 'sizeinput' - }; - var isDecorative = { - type: 'label', - label: 'Accessibility', - items: [{ - name: 'isDecorative', - type: 'checkbox', - label: 'Image is decorative' - }] + var imageUrl = { + name: 'src', + type: 'urlinput', + filetype: 'image', + label: 'Source' + }; + var imageList = info.imageList.map(function (items) { + return { + name: 'images', + type: 'listbox', + label: 'Image list', + items: items }; - var classList = info.classList.map(function (items) { - return { - name: 'classes', - type: 'listbox', - label: 'Class', - items: items - }; - }); - var caption = { - type: 'label', - label: 'Caption', - items: [{ - type: 'checkbox', - name: 'caption', - label: 'Show caption' - }] + }); + var imageDescription = { + name: 'alt', + type: 'input', + label: 'Alternative description', + disabled: info.hasAccessibilityOptions && info.image.isDecorative + }; + var imageTitle = { + name: 'title', + type: 'input', + label: 'Image title' + }; + var imageDimensions = { + name: 'dimensions', + type: 'sizeinput' + }; + var isDecorative = { + type: 'label', + label: 'Accessibility', + items: [{ + name: 'isDecorative', + type: 'checkbox', + label: 'Image is decorative' + }] + }; + var classList = info.classList.map(function (items) { + return { + name: 'classes', + type: 'listbox', + label: 'Class', + items: items }; - return flatten([ - [imageUrl], - imageList.toArray(), - info.hasAccessibilityOptions && info.hasDescription ? [isDecorative] : [], - info.hasDescription ? [imageDescription] : [], - info.hasImageTitle ? [imageTitle] : [], - info.hasDimensions ? [imageDimensions] : [], - [{ - type: 'grid', - columns: 2, - items: flatten([ - classList.toArray(), - info.hasImageCaption ? [caption] : [] - ]) - }] - ]); + }); + var caption = { + type: 'label', + label: 'Caption', + items: [{ + type: 'checkbox', + name: 'caption', + label: 'Show caption' + }] + }; + return flatten([ + [imageUrl], + imageList.toArray(), + info.hasAccessibilityOptions && info.hasDescription ? [isDecorative] : [], + info.hasDescription ? [imageDescription] : [], + info.hasImageTitle ? [imageTitle] : [], + info.hasDimensions ? [imageDimensions] : [], + [{ + type: 'grid', + columns: 2, + items: flatten([ + classList.toArray(), + info.hasImageCaption ? [caption] : [] + ]) + }] + ]); }; var makeTab$1 = function (info) { - return { - title: 'General', - name: 'general', - items: makeItems(info) - }; + return { + title: 'General', + name: 'general', + items: makeItems(info) + }; }; var MainTab = { - makeTab: makeTab$1, - makeItems: makeItems + makeTab: makeTab$1, + makeItems: makeItems }; var makeTab$2 = function (_info) { - var items = [{ - type: 'dropzone', - name: 'fileinput' + var items = [{ + type: 'dropzone', + name: 'fileinput' }]; - return { - title: 'Upload', - name: 'upload', - items: items - }; + return { + title: 'Upload', + name: 'upload', + items: items + }; }; - var UploadTab = {makeTab: makeTab$2}; + var UploadTab = { makeTab: makeTab$2 }; var createState = function (info) { - return { - prevImage: ListUtils.findEntry(info.imageList, info.image.src), - prevAlt: info.image.alt, - open: true - }; + return { + prevImage: ListUtils.findEntry(info.imageList, info.image.src), + prevAlt: info.image.alt, + open: true + }; }; var fromImageData = function (image) { - return { - src: { - value: image.src, - meta: {} - }, - images: image.src, - alt: image.alt, - title: image.title, - dimensions: { - width: image.width, - height: image.height - }, - classes: image.class, - caption: image.caption, - style: image.style, - vspace: image.vspace, - border: image.border, - hspace: image.hspace, - borderstyle: image.borderStyle, - fileinput: [], - isDecorative: image.isDecorative - }; + return { + src: { + value: image.src, + meta: {} + }, + images: image.src, + alt: image.alt, + title: image.title, + dimensions: { + width: image.width, + height: image.height + }, + classes: image.class, + caption: image.caption, + style: image.style, + vspace: image.vspace, + border: image.border, + hspace: image.hspace, + borderstyle: image.borderStyle, + fileinput: [], + isDecorative: image.isDecorative + }; }; var toImageData = function (data, removeEmptyAlt) { - return { - src: data.src.value, - alt: data.alt.length === 0 && removeEmptyAlt ? null : data.alt, - title: data.title, - width: data.dimensions.width, - height: data.dimensions.height, - class: data.classes, - style: data.style, - caption: data.caption, - hspace: data.hspace, - vspace: data.vspace, - border: data.border, - borderStyle: data.borderstyle, - isDecorative: data.isDecorative - }; + return { + src: data.src.value, + alt: data.alt.length === 0 && removeEmptyAlt ? null : data.alt, + title: data.title, + width: data.dimensions.width, + height: data.dimensions.height, + class: data.classes, + style: data.style, + caption: data.caption, + hspace: data.hspace, + vspace: data.vspace, + border: data.border, + borderStyle: data.borderstyle, + isDecorative: data.isDecorative + }; }; var addPrependUrl2 = function (info, srcURL) { - if (!/^(?:[a-zA-Z]+:)?\/\//.test(srcURL)) { - return info.prependURL.bind(function (prependUrl) { - if (srcURL.substring(0, prependUrl.length) !== prependUrl) { - return Optional.some(prependUrl + srcURL); - } - return Optional.none(); - }); - } - return Optional.none(); + if (!/^(?:[a-zA-Z]+:)?\/\//.test(srcURL)) { + return info.prependURL.bind(function (prependUrl) { + if (srcURL.substring(0, prependUrl.length) !== prependUrl) { + return Optional.some(prependUrl + srcURL); + } + return Optional.none(); + }); + } + return Optional.none(); }; var addPrependUrl = function (info, api) { - var data = api.getData(); - addPrependUrl2(info, data.src.value).each(function (srcURL) { - api.setData({ - src: { - value: srcURL, - meta: data.src.meta - } - }); + var data = api.getData(); + addPrependUrl2(info, data.src.value).each(function (srcURL) { + api.setData({ + src: { + value: srcURL, + meta: data.src.meta + } }); + }); }; var formFillFromMeta2 = function (info, data, meta) { - if (info.hasDescription && isString(meta.alt)) { - data.alt = meta.alt; + if (info.hasDescription && isString(meta.alt)) { + data.alt = meta.alt; + } + if (info.hasAccessibilityOptions) { + data.isDecorative = meta.isDecorative || data.isDecorative || false; + } + if (info.hasImageTitle && isString(meta.title)) { + data.title = meta.title; + } + if (info.hasDimensions) { + if (isString(meta.width)) { + data.dimensions.width = meta.width; } - if (info.hasAccessibilityOptions) { - data.isDecorative = meta.isDecorative || data.isDecorative || false; + if (isString(meta.height)) { + data.dimensions.height = meta.height; } - if (info.hasImageTitle && isString(meta.title)) { - data.title = meta.title; + } + if (isString(meta.class)) { + ListUtils.findEntry(info.classList, meta.class).each(function (entry) { + data.classes = entry.value; + }); + } + if (info.hasImageCaption) { + if (isBoolean(meta.caption)) { + data.caption = meta.caption; } - if (info.hasDimensions) { - if (isString(meta.width)) { - data.dimensions.width = meta.width; - } - if (isString(meta.height)) { - data.dimensions.height = meta.height; - } + } + if (info.hasAdvTab) { + if (isString(meta.style)) { + data.style = meta.style; } - if (isString(meta.class)) { - ListUtils.findEntry(info.classList, meta.class).each(function (entry) { - data.classes = entry.value; - }); + if (isString(meta.vspace)) { + data.vspace = meta.vspace; } - if (info.hasImageCaption) { - if (isBoolean(meta.caption)) { - data.caption = meta.caption; - } + if (isString(meta.border)) { + data.border = meta.border; } - if (info.hasAdvTab) { - if (isString(meta.style)) { - data.style = meta.style; - } - if (isString(meta.vspace)) { - data.vspace = meta.vspace; - } - if (isString(meta.border)) { - data.border = meta.border; - } - if (isString(meta.hspace)) { - data.hspace = meta.hspace; - } - if (isString(meta.borderstyle)) { - data.borderstyle = meta.borderstyle; - } + if (isString(meta.hspace)) { + data.hspace = meta.hspace; } + if (isString(meta.borderstyle)) { + data.borderstyle = meta.borderstyle; + } + } }; var formFillFromMeta = function (info, api) { - var data = api.getData(); - var meta = data.src.meta; - if (meta !== undefined) { - var newData = deepMerge({}, data); - formFillFromMeta2(info, newData, meta); - api.setData(newData); - } + var data = api.getData(); + var meta = data.src.meta; + if (meta !== undefined) { + var newData = deepMerge({}, data); + formFillFromMeta2(info, newData, meta); + api.setData(newData); + } }; var calculateImageSize = function (helpers, info, state, api) { - var data = api.getData(); - var url = data.src.value; - var meta = data.src.meta || {}; - if (!meta.width && !meta.height && info.hasDimensions) { - helpers.imageSize(url).then(function (size) { - if (state.open) { - api.setData({dimensions: size}); - } - }); - } + var data = api.getData(); + var url = data.src.value; + var meta = data.src.meta || {}; + if (!meta.width && !meta.height && info.hasDimensions) { + helpers.imageSize(url).then(function (size) { + if (state.open) { + api.setData({ dimensions: size }); + } + }); + } }; var updateImagesDropdown = function (info, state, api) { - var data = api.getData(); - var image = ListUtils.findEntry(info.imageList, data.src.value); - state.prevImage = image; - api.setData({ - images: image.map(function (entry) { - return entry.value; - }).getOr('') - }); + var data = api.getData(); + var image = ListUtils.findEntry(info.imageList, data.src.value); + state.prevImage = image; + api.setData({ + images: image.map(function (entry) { + return entry.value; + }).getOr('') + }); }; var changeSrc = function (helpers, info, state, api) { - addPrependUrl(info, api); - formFillFromMeta(info, api); - calculateImageSize(helpers, info, state, api); - updateImagesDropdown(info, state, api); + addPrependUrl(info, api); + formFillFromMeta(info, api); + calculateImageSize(helpers, info, state, api); + updateImagesDropdown(info, state, api); }; var changeImages = function (helpers, info, state, api) { - var data = api.getData(); - var image = ListUtils.findEntry(info.imageList, data.images); - image.each(function (img) { - var updateAlt = data.alt === '' || state.prevImage.map(function (image) { - return image.text === data.alt; - }).getOr(false); - if (updateAlt) { - if (img.value === '') { - api.setData({ - src: img, - alt: state.prevAlt - }); - } else { - api.setData({ - src: img, - alt: img.text - }); - } - } else { - api.setData({src: img}); - } - }); - state.prevImage = image; - changeSrc(helpers, info, state, api); + var data = api.getData(); + var image = ListUtils.findEntry(info.imageList, data.images); + image.each(function (img) { + var updateAlt = data.alt === '' || state.prevImage.map(function (image) { + return image.text === data.alt; + }).getOr(false); + if (updateAlt) { + if (img.value === '') { + api.setData({ + src: img, + alt: state.prevAlt + }); + } else { + api.setData({ + src: img, + alt: img.text + }); + } + } else { + api.setData({ src: img }); + } + }); + state.prevImage = image; + changeSrc(helpers, info, state, api); }; var calcVSpace = function (css) { - var matchingTopBottom = css['margin-top'] && css['margin-bottom'] && css['margin-top'] === css['margin-bottom']; - return matchingTopBottom ? removePixelSuffix(String(css['margin-top'])) : ''; + var matchingTopBottom = css['margin-top'] && css['margin-bottom'] && css['margin-top'] === css['margin-bottom']; + return matchingTopBottom ? removePixelSuffix(String(css['margin-top'])) : ''; }; var calcHSpace = function (css) { - var matchingLeftRight = css['margin-right'] && css['margin-left'] && css['margin-right'] === css['margin-left']; - return matchingLeftRight ? removePixelSuffix(String(css['margin-right'])) : ''; + var matchingLeftRight = css['margin-right'] && css['margin-left'] && css['margin-right'] === css['margin-left']; + return matchingLeftRight ? removePixelSuffix(String(css['margin-right'])) : ''; }; var calcBorderWidth = function (css) { - return css['border-width'] ? removePixelSuffix(String(css['border-width'])) : ''; + return css['border-width'] ? removePixelSuffix(String(css['border-width'])) : ''; }; var calcBorderStyle = function (css) { - return css['border-style'] ? String(css['border-style']) : ''; + return css['border-style'] ? String(css['border-style']) : ''; }; var calcStyle = function (parseStyle, serializeStyle, css) { - return serializeStyle(parseStyle(serializeStyle(css))); + return serializeStyle(parseStyle(serializeStyle(css))); }; var changeStyle2 = function (parseStyle, serializeStyle, data) { - var css = mergeMargins(parseStyle(data.style)); - var dataCopy = deepMerge({}, data); - dataCopy.vspace = calcVSpace(css); - dataCopy.hspace = calcHSpace(css); - dataCopy.border = calcBorderWidth(css); - dataCopy.borderstyle = calcBorderStyle(css); - dataCopy.style = calcStyle(parseStyle, serializeStyle, css); - return dataCopy; + var css = mergeMargins(parseStyle(data.style)); + var dataCopy = deepMerge({}, data); + dataCopy.vspace = calcVSpace(css); + dataCopy.hspace = calcHSpace(css); + dataCopy.border = calcBorderWidth(css); + dataCopy.borderstyle = calcBorderStyle(css); + dataCopy.style = calcStyle(parseStyle, serializeStyle, css); + return dataCopy; }; var changeStyle = function (helpers, api) { - var data = api.getData(); - var newData = changeStyle2(helpers.parseStyle, helpers.serializeStyle, data); - api.setData(newData); + var data = api.getData(); + var newData = changeStyle2(helpers.parseStyle, helpers.serializeStyle, data); + api.setData(newData); }; var changeAStyle = function (helpers, info, api) { - var data = deepMerge(fromImageData(info.image), api.getData()); - var style = getStyleValue(helpers.normalizeCss, toImageData(data, false)); - api.setData({style: style}); + var data = deepMerge(fromImageData(info.image), api.getData()); + var style = getStyleValue(helpers.normalizeCss, toImageData(data, false)); + api.setData({ style: style }); }; var changeFileInput = function (helpers, info, state, api) { - var data = api.getData(); - api.block('Uploading image'); - head(data.fileinput).fold(function () { - api.unblock(); - }, function (file) { - var blobUri = URL.createObjectURL(file); - var uploader = Uploader({ - url: info.url, - basePath: info.basePath, - credentials: info.credentials, - handler: info.handler - }); - var finalize = function () { - api.unblock(); - URL.revokeObjectURL(blobUri); - }; - var updateSrcAndSwitchTab = function (url) { - api.setData({ - src: { - value: url, - meta: {} - } - }); - api.showTab('general'); - changeSrc(helpers, info, state, api); - }; - blobToDataUri(file).then(function (dataUrl) { - var blobInfo = helpers.createBlobCache(file, blobUri, dataUrl); - if (info.automaticUploads) { - uploader.upload(blobInfo).then(function (url) { - updateSrcAndSwitchTab(url); - finalize(); - }).catch(function (err) { - finalize(); - helpers.alertErr(err); - }); - } else { - helpers.addToBlobCache(blobInfo); - updateSrcAndSwitchTab(blobInfo.blobUri()); - api.unblock(); - } + var data = api.getData(); + api.block('Uploading image'); + head(data.fileinput).fold(function () { + api.unblock(); + }, function (file) { + var blobUri = URL.createObjectURL(file); + var uploader = Uploader({ + url: info.url, + basePath: info.basePath, + credentials: info.credentials, + handler: info.handler + }); + var finalize = function () { + api.unblock(); + URL.revokeObjectURL(blobUri); + }; + var updateSrcAndSwitchTab = function (url) { + api.setData({ + src: { + value: url, + meta: {} + } + }); + api.showTab('general'); + changeSrc(helpers, info, state, api); + }; + blobToDataUri(file).then(function (dataUrl) { + var blobInfo = helpers.createBlobCache(file, blobUri, dataUrl); + if (info.automaticUploads) { + uploader.upload(blobInfo).then(function (url) { + updateSrcAndSwitchTab(url); + finalize(); + }).catch(function (err) { + finalize(); + helpers.alertErr(err); }); + } else { + helpers.addToBlobCache(blobInfo); + updateSrcAndSwitchTab(blobInfo.blobUri()); + api.unblock(); + } }); + }); }; var changeHandler = function (helpers, info, state) { - return function (api, evt) { - if (evt.name === 'src') { - changeSrc(helpers, info, state, api); - } else if (evt.name === 'images') { - changeImages(helpers, info, state, api); - } else if (evt.name === 'alt') { - state.prevAlt = api.getData().alt; - } else if (evt.name === 'style') { - changeStyle(helpers, api); - } else if (evt.name === 'vspace' || evt.name === 'hspace' || evt.name === 'border' || evt.name === 'borderstyle') { - changeAStyle(helpers, info, api); - } else if (evt.name === 'fileinput') { - changeFileInput(helpers, info, state, api); - } else if (evt.name === 'isDecorative') { - if (api.getData().isDecorative) { - api.disable('alt'); - } else { - api.enable('alt'); - } - } - }; + return function (api, evt) { + if (evt.name === 'src') { + changeSrc(helpers, info, state, api); + } else if (evt.name === 'images') { + changeImages(helpers, info, state, api); + } else if (evt.name === 'alt') { + state.prevAlt = api.getData().alt; + } else if (evt.name === 'style') { + changeStyle(helpers, api); + } else if (evt.name === 'vspace' || evt.name === 'hspace' || evt.name === 'border' || evt.name === 'borderstyle') { + changeAStyle(helpers, info, api); + } else if (evt.name === 'fileinput') { + changeFileInput(helpers, info, state, api); + } else if (evt.name === 'isDecorative') { + if (api.getData().isDecorative) { + api.disable('alt'); + } else { + api.enable('alt'); + } + } + }; }; var closeHandler = function (state) { - return function () { - state.open = false; - }; + return function () { + state.open = false; + }; }; var makeDialogBody = function (info) { - if (info.hasAdvTab || info.hasUploadUrl || info.hasUploadHandler) { - var tabPanel = { - type: 'tabpanel', - tabs: flatten([ - [MainTab.makeTab(info)], - info.hasAdvTab ? [AdvTab.makeTab(info)] : [], - info.hasUploadTab && (info.hasUploadUrl || info.hasUploadHandler) ? [UploadTab.makeTab(info)] : [] - ]) - }; - return tabPanel; - } else { - var panel = { - type: 'panel', - items: MainTab.makeItems(info) - }; - return panel; - } + if (info.hasAdvTab || info.hasUploadUrl || info.hasUploadHandler) { + var tabPanel = { + type: 'tabpanel', + tabs: flatten([ + [MainTab.makeTab(info)], + info.hasAdvTab ? [AdvTab.makeTab(info)] : [], + info.hasUploadTab && (info.hasUploadUrl || info.hasUploadHandler) ? [UploadTab.makeTab(info)] : [] + ]) + }; + return tabPanel; + } else { + var panel = { + type: 'panel', + items: MainTab.makeItems(info) + }; + return panel; + } }; var makeDialog = function (helpers) { - return function (info) { - var state = createState(info); - return { - title: 'Insert/Edit Image', - size: 'normal', - body: makeDialogBody(info), - buttons: [ - { - type: 'cancel', - name: 'cancel', - text: 'Cancel' - }, - { - type: 'submit', - name: 'save', - text: 'Save', - primary: true - } - ], - initialData: fromImageData(info.image), - onSubmit: helpers.onSubmit(info), - onChange: changeHandler(helpers, info, state), - onClose: closeHandler(state) - }; + return function (info) { + var state = createState(info); + return { + title: 'Insert/Edit Image', + size: 'normal', + body: makeDialogBody(info), + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: fromImageData(info.image), + onSubmit: helpers.onSubmit(info), + onChange: changeHandler(helpers, info, state), + onClose: closeHandler(state) }; + }; }; var submitHandler = function (editor) { - return function (info) { - return function (api) { - var data = deepMerge(fromImageData(info.image), api.getData()); - editor.execCommand('mceUpdateImage', false, toImageData(data, info.hasAccessibilityOptions)); - editor.editorUpload.uploadImagesAuto(); - api.close(); - }; + return function (info) { + return function (api) { + var data = deepMerge(fromImageData(info.image), api.getData()); + editor.execCommand('mceUpdateImage', false, toImageData(data, info.hasAccessibilityOptions)); + editor.editorUpload.uploadImagesAuto(); + api.close(); }; + }; }; var imageSize = function (editor) { - return function (url) { - return getImageSize(editor.documentBaseURI.toAbsolute(url)).then(function (dimensions) { - return { - width: String(dimensions.width), - height: String(dimensions.height) - }; - }); - }; + return function (url) { + return getImageSize(editor.documentBaseURI.toAbsolute(url)).then(function (dimensions) { + return { + width: String(dimensions.width), + height: String(dimensions.height) + }; + }); + }; }; var createBlobCache = function (editor) { - return function (file, blobUri, dataUrl) { - return editor.editorUpload.blobCache.create({ - blob: file, - blobUri: blobUri, - name: file.name ? file.name.replace(/\.[^\.]+$/, '') : null, - filename: file.name, - base64: dataUrl.split(',')[1] - }); - }; + return function (file, blobUri, dataUrl) { + return editor.editorUpload.blobCache.create({ + blob: file, + blobUri: blobUri, + name: file.name ? file.name.replace(/\.[^\.]+$/, '') : null, + filename: file.name, + base64: dataUrl.split(',')[1] + }); + }; }; var addToBlobCache = function (editor) { - return function (blobInfo) { - editor.editorUpload.blobCache.add(blobInfo); - }; + return function (blobInfo) { + editor.editorUpload.blobCache.add(blobInfo); + }; }; var alertErr = function (editor) { - return function (message) { - editor.windowManager.alert(message); - }; + return function (message) { + editor.windowManager.alert(message); + }; }; var normalizeCss$1 = function (editor) { - return function (cssText) { - return normalizeCss(editor, cssText); - }; + return function (cssText) { + return normalizeCss(editor, cssText); + }; }; var parseStyle = function (editor) { - return function (cssText) { - return editor.dom.parseStyle(cssText); - }; + return function (cssText) { + return editor.dom.parseStyle(cssText); + }; }; var serializeStyle = function (editor) { - return function (stylesArg, name) { - return editor.dom.serializeStyle(stylesArg, name); - }; + return function (stylesArg, name) { + return editor.dom.serializeStyle(stylesArg, name); + }; }; var Dialog = function (editor) { - var helpers = { - onSubmit: submitHandler(editor), - imageSize: imageSize(editor), - addToBlobCache: addToBlobCache(editor), - createBlobCache: createBlobCache(editor), - alertErr: alertErr(editor), - normalizeCss: normalizeCss$1(editor), - parseStyle: parseStyle(editor), - serializeStyle: serializeStyle(editor) - }; - var open = function () { - collect(editor).then(makeDialog(helpers)).then(editor.windowManager.open); - }; - return {open: open}; + var helpers = { + onSubmit: submitHandler(editor), + imageSize: imageSize(editor), + addToBlobCache: addToBlobCache(editor), + createBlobCache: createBlobCache(editor), + alertErr: alertErr(editor), + normalizeCss: normalizeCss$1(editor), + parseStyle: parseStyle(editor), + serializeStyle: serializeStyle(editor) + }; + var open = function () { + collect(editor).then(makeDialog(helpers)).then(editor.windowManager.open); + }; + return { open: open }; }; var register = function (editor) { - editor.addCommand('mceImage', Dialog(editor).open); - editor.addCommand('mceUpdateImage', function (_ui, data) { - editor.undoManager.transact(function () { - return insertOrUpdateImage(editor, data); - }); + editor.addCommand('mceImage', Dialog(editor).open); + editor.addCommand('mceUpdateImage', function (_ui, data) { + editor.undoManager.transact(function () { + return insertOrUpdateImage(editor, data); }); + }); }; var hasImageClass = function (node) { - var className = node.attr('class'); - return className && /\bimage\b/.test(className); + var className = node.attr('class'); + return className && /\bimage\b/.test(className); }; var toggleContentEditableState = function (state) { - return function (nodes) { - var i = nodes.length; - var toggleContentEditable = function (node) { - node.attr('contenteditable', state ? 'true' : null); - }; - while (i--) { - var node = nodes[i]; - if (hasImageClass(node)) { - node.attr('contenteditable', state ? 'false' : null); - global$4.each(node.getAll('figcaption'), toggleContentEditable); - } - } + return function (nodes) { + var i = nodes.length; + var toggleContentEditable = function (node) { + node.attr('contenteditable', state ? 'true' : null); }; + while (i--) { + var node = nodes[i]; + if (hasImageClass(node)) { + node.attr('contenteditable', state ? 'false' : null); + global$4.each(node.getAll('figcaption'), toggleContentEditable); + } + } + }; }; var setup = function (editor) { - editor.on('PreInit', function () { - editor.parser.addNodeFilter('figure', toggleContentEditableState(true)); - editor.serializer.addNodeFilter('figure', toggleContentEditableState(false)); - }); + editor.on('PreInit', function () { + editor.parser.addNodeFilter('figure', toggleContentEditableState(true)); + editor.serializer.addNodeFilter('figure', toggleContentEditableState(false)); + }); }; var register$1 = function (editor) { - editor.ui.registry.addToggleButton('image', { - icon: 'image', - tooltip: 'Insert/edit image', - onAction: Dialog(editor).open, - onSetup: function (buttonApi) { - return editor.selection.selectorChangedWithUnbind('img:not([data-mce-object],[data-mce-placeholder]),figure.image', buttonApi.setActive).unbind; - } - }); - editor.ui.registry.addMenuItem('image', { - icon: 'image', - text: 'Image...', - onAction: Dialog(editor).open - }); - editor.ui.registry.addContextMenu('image', { - update: function (element) { - return isFigure(element) || isImage(element) && !isPlaceholderImage(element) ? ['image'] : []; - } - }); + editor.ui.registry.addToggleButton('image', { + icon: 'image', + tooltip: 'Insert/edit image', + onAction: Dialog(editor).open, + onSetup: function (buttonApi) { + return editor.selection.selectorChangedWithUnbind('img:not([data-mce-object],[data-mce-placeholder]),figure.image', buttonApi.setActive).unbind; + } + }); + editor.ui.registry.addMenuItem('image', { + icon: 'image', + text: 'Image...', + onAction: Dialog(editor).open + }); + editor.ui.registry.addContextMenu('image', { + update: function (element) { + return isFigure(element) || isImage(element) && !isPlaceholderImage(element) ? ['image'] : []; + } + }); }; - function Plugin() { - global.add('image', function (editor) { - setup(editor); - register$1(editor); - register(editor); - }); + function Plugin () { + global.add('image', function (editor) { + setup(editor); + register$1(editor); + register(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/imagetools/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/imagetools/plugin.js index 7cfc790f..2ee2ae0b 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/imagetools/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/imagetools/plugin.js @@ -10,17 +10,17 @@ 'use strict'; var Cell = function (initial) { - var value = initial; - var get = function () { - return value; - }; - var set = function (v) { - value = v; - }; - return { - get: get, - set: set - }; + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; }; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); @@ -30,880 +30,840 @@ var noop = function () { }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; var never = constant(false); var always = constant(true); var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var isSimpleType = function (type) { - return function (value) { - return typeof value === type; - }; + return function (value) { + return typeof value === type; + }; }; var isNullable = function (a) { - return a === null || a === undefined; + return a === null || a === undefined; }; var isNonNullable = function (a) { - return !isNullable(a); + return !isNullable(a); }; var isFunction = isSimpleType('function'); function create(width, height) { - return resize(document.createElement('canvas'), width, height); + return resize(document.createElement('canvas'), width, height); } - function clone(canvas) { - var tCanvas = create(canvas.width, canvas.height); - var ctx = get2dContext(tCanvas); - ctx.drawImage(canvas, 0, 0); - return tCanvas; + var tCanvas = create(canvas.width, canvas.height); + var ctx = get2dContext(tCanvas); + ctx.drawImage(canvas, 0, 0); + return tCanvas; } - function get2dContext(canvas) { - return canvas.getContext('2d'); + return canvas.getContext('2d'); } - function resize(canvas, width, height) { - canvas.width = width; - canvas.height = height; - return canvas; + canvas.width = width; + canvas.height = height; + return canvas; } function getWidth(image) { - return image.naturalWidth || image.width; + return image.naturalWidth || image.width; } - function getHeight(image) { - return image.naturalHeight || image.height; + return image.naturalHeight || image.height; } var promise = function () { - var Promise = function (fn) { - if (typeof this !== 'object') { - throw new TypeError('Promises must be constructed via new'); - } - if (typeof fn !== 'function') { - throw new TypeError('not a function'); - } - this._state = null; - this._value = null; - this._deferreds = []; - doResolve(fn, bind(resolve, this), bind(reject, this)); - }; - var anyWindow = window; - var asap = Promise.immediateFn || typeof anyWindow.setImmediate === 'function' && anyWindow.setImmediate || function (fn) { - setTimeout(fn, 1); - }; - - function bind(fn, thisArg) { - return function () { - return fn.apply(thisArg, arguments); - }; + var Promise = function (fn) { + if (typeof this !== 'object') { + throw new TypeError('Promises must be constructed via new'); } - - var isArray = Array.isArray || function (value) { - return Object.prototype.toString.call(value) === '[object Array]'; + if (typeof fn !== 'function') { + throw new TypeError('not a function'); + } + this._state = null; + this._value = null; + this._deferreds = []; + doResolve(fn, bind(resolve, this), bind(reject, this)); + }; + var anyWindow = window; + var asap = Promise.immediateFn || typeof anyWindow.setImmediate === 'function' && anyWindow.setImmediate || function (fn) { + setTimeout(fn, 1); + }; + function bind(fn, thisArg) { + return function () { + return fn.apply(thisArg, arguments); }; - - function handle(deferred) { - var me = this; - if (this._state === null) { - this._deferreds.push(deferred); - return; - } - asap(function () { - var cb = me._state ? deferred.onFulfilled : deferred.onRejected; - if (cb === null) { - (me._state ? deferred.resolve : deferred.reject)(me._value); - return; - } - var ret; - try { - ret = cb(me._value); - } catch (e) { - deferred.reject(e); - return; - } - deferred.resolve(ret); - }); + } + var isArray = Array.isArray || function (value) { + return Object.prototype.toString.call(value) === '[object Array]'; + }; + function handle(deferred) { + var me = this; + if (this._state === null) { + this._deferreds.push(deferred); + return; } - - function resolve(newValue) { - try { - if (newValue === this) { - throw new TypeError('A promise cannot be resolved with itself.'); - } - if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { - var then = newValue.then; - if (typeof then === 'function') { - doResolve(bind(then, newValue), bind(resolve, this), bind(reject, this)); - return; - } - } - this._state = true; - this._value = newValue; - finale.call(this); - } catch (e) { - reject.call(this, e); + asap(function () { + var cb = me._state ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (me._state ? deferred.resolve : deferred.reject)(me._value); + return; + } + var ret; + try { + ret = cb(me._value); + } catch (e) { + deferred.reject(e); + return; + } + deferred.resolve(ret); + }); + } + function resolve(newValue) { + try { + if (newValue === this) { + throw new TypeError('A promise cannot be resolved with itself.'); + } + if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { + var then = newValue.then; + if (typeof then === 'function') { + doResolve(bind(then, newValue), bind(resolve, this), bind(reject, this)); + return; } + } + this._state = true; + this._value = newValue; + finale.call(this); + } catch (e) { + reject.call(this, e); } - - function reject(newValue) { - this._state = false; - this._value = newValue; - finale.call(this); + } + function reject(newValue) { + this._state = false; + this._value = newValue; + finale.call(this); + } + function finale() { + for (var _i = 0, _a = this._deferreds; _i < _a.length; _i++) { + var deferred = _a[_i]; + handle.call(this, deferred); } - - function finale() { - for (var _i = 0, _a = this._deferreds; _i < _a.length; _i++) { - var deferred = _a[_i]; - handle.call(this, deferred); + this._deferreds = []; + } + function Handler(onFulfilled, onRejected, resolve, reject) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.resolve = resolve; + this.reject = reject; + } + function doResolve(fn, onFulfilled, onRejected) { + var done = false; + try { + fn(function (value) { + if (done) { + return; } - this._deferreds = []; + done = true; + onFulfilled(value); + }, function (reason) { + if (done) { + return; + } + done = true; + onRejected(reason); + }); + } catch (ex) { + if (done) { + return; + } + done = true; + onRejected(ex); } - - function Handler(onFulfilled, onRejected, resolve, reject) { - this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; - this.onRejected = typeof onRejected === 'function' ? onRejected : null; - this.resolve = resolve; - this.reject = reject; + } + Promise.prototype.catch = function (onRejected) { + return this.then(null, onRejected); + }; + Promise.prototype.then = function (onFulfilled, onRejected) { + var me = this; + return new Promise(function (resolve, reject) { + handle.call(me, new Handler(onFulfilled, onRejected, resolve, reject)); + }); + }; + Promise.all = function () { + var values = []; + for (var _i = 0; _i < arguments.length; _i++) { + values[_i] = arguments[_i]; } - - function doResolve(fn, onFulfilled, onRejected) { - var done = false; + var args = Array.prototype.slice.call(values.length === 1 && isArray(values[0]) ? values[0] : values); + return new Promise(function (resolve, reject) { + if (args.length === 0) { + return resolve([]); + } + var remaining = args.length; + function res(i, val) { try { - fn(function (value) { - if (done) { - return; - } - done = true; - onFulfilled(value); - }, function (reason) { - if (done) { - return; - } - done = true; - onRejected(reason); - }); - } catch (ex) { - if (done) { - return; + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call(val, function (val) { + res(i, val); + }, reject); + return; } - done = true; - onRejected(ex); + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); } + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; } - - Promise.prototype.catch = function (onRejected) { - return this.then(null, onRejected); - }; - Promise.prototype.then = function (onFulfilled, onRejected) { - var me = this; - return new Promise(function (resolve, reject) { - handle.call(me, new Handler(onFulfilled, onRejected, resolve, reject)); - }); - }; - Promise.all = function () { - var values = []; - for (var _i = 0; _i < arguments.length; _i++) { - values[_i] = arguments[_i]; - } - var args = Array.prototype.slice.call(values.length === 1 && isArray(values[0]) ? values[0] : values); - return new Promise(function (resolve, reject) { - if (args.length === 0) { - return resolve([]); - } - var remaining = args.length; - - function res(i, val) { - try { - if (val && (typeof val === 'object' || typeof val === 'function')) { - var then = val.then; - if (typeof then === 'function') { - then.call(val, function (val) { - res(i, val); - }, reject); - return; - } - } - args[i] = val; - if (--remaining === 0) { - resolve(args); - } - } catch (ex) { - reject(ex); - } - } - - for (var i = 0; i < args.length; i++) { - res(i, args[i]); - } - }); - }; - Promise.resolve = function (value) { - if (value && typeof value === 'object' && value.constructor === Promise) { - return value; - } - return new Promise(function (resolve) { - resolve(value); - }); - }; - Promise.reject = function (reason) { - return new Promise(function (resolve, reject) { - reject(reason); - }); - }; - Promise.race = function (values) { - return new Promise(function (resolve, reject) { - for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { - var value = values_1[_i]; - value.then(resolve, reject); - } - }); - }; - return Promise; + return new Promise(function (resolve) { + resolve(value); + }); + }; + Promise.reject = function (reason) { + return new Promise(function (resolve, reject) { + reject(reason); + }); + }; + Promise.race = function (values) { + return new Promise(function (resolve, reject) { + for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { + var value = values_1[_i]; + value.then(resolve, reject); + } + }); + }; + return Promise; }; var Promise = window.Promise ? window.Promise : promise(); function imageToBlob(image) { - var src = image.src; - if (src.indexOf('data:') === 0) { - return dataUriToBlob(src); - } - return anyUriToBlob(src); + var src = image.src; + if (src.indexOf('data:') === 0) { + return dataUriToBlob(src); + } + return anyUriToBlob(src); } - function blobToImage(blob) { - return new Promise(function (resolve, reject) { - var blobUrl = URL.createObjectURL(blob); - var image = new Image(); - var removeListeners = function () { - image.removeEventListener('load', loaded); - image.removeEventListener('error', error); - }; - - function loaded() { - removeListeners(); - resolve(image); - } - - function error() { - removeListeners(); - reject('Unable to load data of type ' + blob.type + ': ' + blobUrl); - } - - image.addEventListener('load', loaded); - image.addEventListener('error', error); - image.src = blobUrl; - if (image.complete) { - loaded(); - } - }); + return new Promise(function (resolve, reject) { + var blobUrl = URL.createObjectURL(blob); + var image = new Image(); + var removeListeners = function () { + image.removeEventListener('load', loaded); + image.removeEventListener('error', error); + }; + function loaded() { + removeListeners(); + resolve(image); + } + function error() { + removeListeners(); + reject('Unable to load data of type ' + blob.type + ': ' + blobUrl); + } + image.addEventListener('load', loaded); + image.addEventListener('error', error); + image.src = blobUrl; + if (image.complete) { + loaded(); + } + }); } - function anyUriToBlob(url) { - return new Promise(function (resolve, reject) { - var xhr = new XMLHttpRequest(); - xhr.open('GET', url, true); - xhr.responseType = 'blob'; - xhr.onload = function () { - if (this.status === 200) { - resolve(this.response); - } - }; - xhr.onerror = function () { - var _this = this; - var corsError = function () { - var obj = new Error('No access to download image'); - obj.code = 18; - obj.name = 'SecurityError'; - return obj; - }; - var genericError = function () { - return new Error('Error ' + _this.status + ' downloading image'); - }; - reject(this.status === 0 ? corsError() : genericError()); - }; - xhr.send(); - }); + return new Promise(function (resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.responseType = 'blob'; + xhr.onload = function () { + if (this.status === 200) { + resolve(this.response); + } + }; + xhr.onerror = function () { + var _this = this; + var corsError = function () { + var obj = new Error('No access to download image'); + obj.code = 18; + obj.name = 'SecurityError'; + return obj; + }; + var genericError = function () { + return new Error('Error ' + _this.status + ' downloading image'); + }; + reject(this.status === 0 ? corsError() : genericError()); + }; + xhr.send(); + }); } - function dataUriToBlobSync(uri) { - var data = uri.split(','); - var matches = /data:([^;]+)/.exec(data[0]); - if (!matches) { - return Optional.none(); - } - var mimetype = matches[1]; - var base64 = data[1]; - var sliceSize = 1024; - var byteCharacters = atob(base64); - var bytesLength = byteCharacters.length; - var slicesCount = Math.ceil(bytesLength / sliceSize); - var byteArrays = new Array(slicesCount); - for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) { - var begin = sliceIndex * sliceSize; - var end = Math.min(begin + sliceSize, bytesLength); - var bytes = new Array(end - begin); - for (var offset = begin, i = 0; offset < end; ++i, ++offset) { - bytes[i] = byteCharacters[offset].charCodeAt(0); - } - byteArrays[sliceIndex] = new Uint8Array(bytes); + var data = uri.split(','); + var matches = /data:([^;]+)/.exec(data[0]); + if (!matches) { + return Optional.none(); + } + var mimetype = matches[1]; + var base64 = data[1]; + var sliceSize = 1024; + var byteCharacters = atob(base64); + var bytesLength = byteCharacters.length; + var slicesCount = Math.ceil(bytesLength / sliceSize); + var byteArrays = new Array(slicesCount); + for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) { + var begin = sliceIndex * sliceSize; + var end = Math.min(begin + sliceSize, bytesLength); + var bytes = new Array(end - begin); + for (var offset = begin, i = 0; offset < end; ++i, ++offset) { + bytes[i] = byteCharacters[offset].charCodeAt(0); } - return Optional.some(new Blob(byteArrays, {type: mimetype})); + byteArrays[sliceIndex] = new Uint8Array(bytes); + } + return Optional.some(new Blob(byteArrays, { type: mimetype })); } - function dataUriToBlob(uri) { - return new Promise(function (resolve, reject) { - dataUriToBlobSync(uri).fold(function () { - reject('uri is not base64: ' + uri); - }, resolve); - }); + return new Promise(function (resolve, reject) { + dataUriToBlobSync(uri).fold(function () { + reject('uri is not base64: ' + uri); + }, resolve); + }); } - function canvasToBlob(canvas, type, quality) { - type = type || 'image/png'; - if (isFunction(HTMLCanvasElement.prototype.toBlob)) { - return new Promise(function (resolve, reject) { - canvas.toBlob(function (blob) { - if (blob) { - resolve(blob); - } else { - reject(); - } - }, type, quality); - }); - } else { - return dataUriToBlob(canvas.toDataURL(type, quality)); - } + type = type || 'image/png'; + if (isFunction(HTMLCanvasElement.prototype.toBlob)) { + return new Promise(function (resolve, reject) { + canvas.toBlob(function (blob) { + if (blob) { + resolve(blob); + } else { + reject(); + } + }, type, quality); + }); + } else { + return dataUriToBlob(canvas.toDataURL(type, quality)); + } } - function canvasToDataURL(canvas, type, quality) { - type = type || 'image/png'; - return canvas.toDataURL(type, quality); + type = type || 'image/png'; + return canvas.toDataURL(type, quality); } - function blobToCanvas(blob) { - return blobToImage(blob).then(function (image) { - revokeImageUrl(image); - var canvas = create(getWidth(image), getHeight(image)); - var context = get2dContext(canvas); - context.drawImage(image, 0, 0); - return canvas; - }); + return blobToImage(blob).then(function (image) { + revokeImageUrl(image); + var canvas = create(getWidth(image), getHeight(image)); + var context = get2dContext(canvas); + context.drawImage(image, 0, 0); + return canvas; + }); } - function blobToDataUri(blob) { - return new Promise(function (resolve) { - var reader = new FileReader(); - reader.onloadend = function () { - resolve(reader.result); - }; - reader.readAsDataURL(blob); - }); + return new Promise(function (resolve) { + var reader = new FileReader(); + reader.onloadend = function () { + resolve(reader.result); + }; + reader.readAsDataURL(blob); + }); } - function revokeImageUrl(image) { - URL.revokeObjectURL(image.src); + URL.revokeObjectURL(image.src); } var blobToImage$1 = function (blob) { - return blobToImage(blob); + return blobToImage(blob); }; var imageToBlob$1 = function (image) { - return imageToBlob(image); + return imageToBlob(image); }; var each = function (xs, f) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - f(x, i); - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } }; var foldl = function (xs, f, acc) { - each(xs, function (x) { - acc = f(acc, x); - }); - return acc; + each(xs, function (x) { + acc = f(acc, x); + }); + return acc; }; var findUntil = function (xs, pred, until) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - return Optional.some(x); - } else if (until(x, i)) { - break; - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(x); + } else if (until(x, i)) { + break; } - return Optional.none(); + } + return Optional.none(); }; var find = function (xs, pred) { - return findUntil(xs, pred, never); + return findUntil(xs, pred, never); }; function create$1(getCanvas, blob, uri) { - var initialType = blob.type; - var getType = constant(initialType); - - function toBlob() { - return Promise.resolve(blob); - } - - var toDataURL = constant(uri); - - function toBase64() { - return uri.split(',')[1]; - } - - function toAdjustedBlob(type, quality) { - return getCanvas.then(function (canvas) { - return canvasToBlob(canvas, type, quality); - }); - } - - function toAdjustedDataURL(type, quality) { - return getCanvas.then(function (canvas) { - return canvasToDataURL(canvas, type, quality); - }); - } - - function toAdjustedBase64(type, quality) { - return toAdjustedDataURL(type, quality).then(function (dataurl) { - return dataurl.split(',')[1]; - }); - } - - function toCanvas() { - return getCanvas.then(clone); - } - - return { - getType: getType, - toBlob: toBlob, - toDataURL: toDataURL, - toBase64: toBase64, - toAdjustedBlob: toAdjustedBlob, - toAdjustedDataURL: toAdjustedDataURL, - toAdjustedBase64: toAdjustedBase64, - toCanvas: toCanvas - }; + var initialType = blob.type; + var getType = constant(initialType); + function toBlob() { + return Promise.resolve(blob); + } + var toDataURL = constant(uri); + function toBase64() { + return uri.split(',')[1]; + } + function toAdjustedBlob(type, quality) { + return getCanvas.then(function (canvas) { + return canvasToBlob(canvas, type, quality); + }); + } + function toAdjustedDataURL(type, quality) { + return getCanvas.then(function (canvas) { + return canvasToDataURL(canvas, type, quality); + }); + } + function toAdjustedBase64(type, quality) { + return toAdjustedDataURL(type, quality).then(function (dataurl) { + return dataurl.split(',')[1]; + }); + } + function toCanvas() { + return getCanvas.then(clone); + } + return { + getType: getType, + toBlob: toBlob, + toDataURL: toDataURL, + toBase64: toBase64, + toAdjustedBlob: toAdjustedBlob, + toAdjustedDataURL: toAdjustedDataURL, + toAdjustedBase64: toAdjustedBase64, + toCanvas: toCanvas + }; } - function fromBlob(blob) { - return blobToDataUri(blob).then(function (uri) { - return create$1(blobToCanvas(blob), blob, uri); - }); + return blobToDataUri(blob).then(function (uri) { + return create$1(blobToCanvas(blob), blob, uri); + }); } - function fromCanvas(canvas, type) { - return canvasToBlob(canvas, type).then(function (blob) { - return create$1(Promise.resolve(canvas), blob, canvas.toDataURL()); - }); + return canvasToBlob(canvas, type).then(function (blob) { + return create$1(Promise.resolve(canvas), blob, canvas.toDataURL()); + }); } function rotate(ir, angle) { - return ir.toCanvas().then(function (canvas) { - return applyRotate(canvas, ir.getType(), angle); - }); + return ir.toCanvas().then(function (canvas) { + return applyRotate(canvas, ir.getType(), angle); + }); } - function applyRotate(image, type, angle) { - var canvas = create(image.width, image.height); - var context = get2dContext(canvas); - var translateX = 0; - var translateY = 0; - angle = angle < 0 ? 360 + angle : angle; - if (angle === 90 || angle === 270) { - resize(canvas, canvas.height, canvas.width); - } - if (angle === 90 || angle === 180) { - translateX = canvas.width; - } - if (angle === 270 || angle === 180) { - translateY = canvas.height; - } - context.translate(translateX, translateY); - context.rotate(angle * Math.PI / 180); - context.drawImage(image, 0, 0); - return fromCanvas(canvas, type); + var canvas = create(image.width, image.height); + var context = get2dContext(canvas); + var translateX = 0; + var translateY = 0; + angle = angle < 0 ? 360 + angle : angle; + if (angle === 90 || angle === 270) { + resize(canvas, canvas.height, canvas.width); + } + if (angle === 90 || angle === 180) { + translateX = canvas.width; + } + if (angle === 270 || angle === 180) { + translateY = canvas.height; + } + context.translate(translateX, translateY); + context.rotate(angle * Math.PI / 180); + context.drawImage(image, 0, 0); + return fromCanvas(canvas, type); } - function flip(ir, axis) { - return ir.toCanvas().then(function (canvas) { - return applyFlip(canvas, ir.getType(), axis); - }); + return ir.toCanvas().then(function (canvas) { + return applyFlip(canvas, ir.getType(), axis); + }); } - function applyFlip(image, type, axis) { - var canvas = create(image.width, image.height); - var context = get2dContext(canvas); - if (axis === 'v') { - context.scale(1, -1); - context.drawImage(image, 0, -canvas.height); - } else { - context.scale(-1, 1); - context.drawImage(image, -canvas.width, 0); - } - return fromCanvas(canvas, type); + var canvas = create(image.width, image.height); + var context = get2dContext(canvas); + if (axis === 'v') { + context.scale(1, -1); + context.drawImage(image, 0, -canvas.height); + } else { + context.scale(-1, 1); + context.drawImage(image, -canvas.width, 0); + } + return fromCanvas(canvas, type); } var flip$1 = function (ir, axis) { - return flip(ir, axis); + return flip(ir, axis); }; var rotate$1 = function (ir, angle) { - return rotate(ir, angle); + return rotate(ir, angle); }; var keys = Object.keys; var each$1 = function (obj, f) { - var props = keys(obj); - for (var k = 0, len = props.length; k < len; k++) { - var i = props[k]; - var x = obj[i]; - f(x, i); - } + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } }; var sendRequest = function (url, headers, withCredentials) { - if (withCredentials === void 0) { - withCredentials = false; - } - return new Promise(function (resolve) { - var xhr = new XMLHttpRequest(); - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - resolve({ - status: xhr.status, - blob: xhr.response - }); - } - }; - xhr.open('GET', url, true); - xhr.withCredentials = withCredentials; - each$1(headers, function (value, key) { - xhr.setRequestHeader(key, value); + if (withCredentials === void 0) { + withCredentials = false; + } + return new Promise(function (resolve) { + var xhr = new XMLHttpRequest(); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + resolve({ + status: xhr.status, + blob: xhr.response }); - xhr.responseType = 'blob'; - xhr.send(); + } + }; + xhr.open('GET', url, true); + xhr.withCredentials = withCredentials; + each$1(headers, function (value, key) { + xhr.setRequestHeader(key, value); }); + xhr.responseType = 'blob'; + xhr.send(); + }); }; var readBlobText = function (blob) { - return new Promise(function (resolve, reject) { - var reader = new FileReader(); - reader.onload = function () { - resolve(reader.result); - }; - reader.onerror = function (e) { - reject(e); - }; - reader.readAsText(blob); - }); + return new Promise(function (resolve, reject) { + var reader = new FileReader(); + reader.onload = function () { + resolve(reader.result); + }; + reader.onerror = function (e) { + reject(e); + }; + reader.readAsText(blob); + }); }; var parseJson = function (text) { - try { - return Optional.some(JSON.parse(text)); - } catch (ex) { - return Optional.none(); - } + try { + return Optional.some(JSON.parse(text)); + } catch (ex) { + return Optional.none(); + } }; var friendlyHttpErrors = [ - { - code: 404, - message: 'Could not find Image Proxy' - }, - { - code: 403, - message: 'Rejected request' - }, - { - code: 0, - message: 'Incorrect Image Proxy URL' - } + { + code: 404, + message: 'Could not find Image Proxy' + }, + { + code: 403, + message: 'Rejected request' + }, + { + code: 0, + message: 'Incorrect Image Proxy URL' + } ]; var friendlyServiceErrors = [ - { - type: 'not_found', - message: 'Failed to load image.' - }, - { - type: 'key_missing', - message: 'The request did not include an api key.' - }, - { - type: 'key_not_found', - message: 'The provided api key could not be found.' - }, - { - type: 'domain_not_trusted', - message: 'The api key is not valid for the request origins.' - } + { + type: 'not_found', + message: 'Failed to load image.' + }, + { + type: 'key_missing', + message: 'The request did not include an api key.' + }, + { + type: 'key_not_found', + message: 'The provided api key could not be found.' + }, + { + type: 'domain_not_trusted', + message: 'The api key is not valid for the request origins.' + } ]; var traverseJson = function (json, path) { - var value = foldl(path, function (result, key) { - return isNonNullable(result) ? result[key] : undefined; - }, json); - return Optional.from(value); + var value = foldl(path, function (result, key) { + return isNonNullable(result) ? result[key] : undefined; + }, json); + return Optional.from(value); }; var isServiceErrorCode = function (code, blob) { - return (blob === null || blob === void 0 ? void 0 : blob.type) === 'application/json' && (code === 400 || code === 403 || code === 404 || code === 500); + return (blob === null || blob === void 0 ? void 0 : blob.type) === 'application/json' && (code === 400 || code === 403 || code === 404 || code === 500); }; var getHttpErrorMsg = function (status) { - var message = find(friendlyHttpErrors, function (error) { - return status === error.code; - }).fold(constant('Unknown ImageProxy error'), function (error) { - return error.message; - }); - return 'ImageProxy HTTP error: ' + message; + var message = find(friendlyHttpErrors, function (error) { + return status === error.code; + }).fold(constant('Unknown ImageProxy error'), function (error) { + return error.message; + }); + return 'ImageProxy HTTP error: ' + message; }; var handleHttpError = function (status) { - var message = getHttpErrorMsg(status); - return Promise.reject(message); + var message = getHttpErrorMsg(status); + return Promise.reject(message); }; var getServiceErrorMsg = function (type) { - return find(friendlyServiceErrors, function (error) { - return error.type === type; - }).fold(constant('Unknown service error'), function (error) { - return error.message; - }); + return find(friendlyServiceErrors, function (error) { + return error.type === type; + }).fold(constant('Unknown service error'), function (error) { + return error.message; + }); }; var getServiceError = function (text) { - var serviceError = parseJson(text); - var errorMsg = serviceError.bind(function (err) { - return traverseJson(err, [ - 'error', - 'type' - ]).map(getServiceErrorMsg); - }).getOr('Invalid JSON in service error message'); - return 'ImageProxy Service error: ' + errorMsg; + var serviceError = parseJson(text); + var errorMsg = serviceError.bind(function (err) { + return traverseJson(err, [ + 'error', + 'type' + ]).map(getServiceErrorMsg); + }).getOr('Invalid JSON in service error message'); + return 'ImageProxy Service error: ' + errorMsg; }; var handleServiceError = function (blob) { - return readBlobText(blob).then(function (text) { - var serviceError = getServiceError(text); - return Promise.reject(serviceError); - }); + return readBlobText(blob).then(function (text) { + var serviceError = getServiceError(text); + return Promise.reject(serviceError); + }); }; var handleServiceErrorResponse = function (status, blob) { - return isServiceErrorCode(status, blob) ? handleServiceError(blob) : handleHttpError(status); + return isServiceErrorCode(status, blob) ? handleServiceError(blob) : handleHttpError(status); }; var appendApiKey = function (url, apiKey) { - var separator = url.indexOf('?') === -1 ? '?' : '&'; - if (/[?&]apiKey=/.test(url)) { - return url; - } else { - return url + separator + 'apiKey=' + encodeURIComponent(apiKey); - } + var separator = url.indexOf('?') === -1 ? '?' : '&'; + if (/[?&]apiKey=/.test(url)) { + return url; + } else { + return url + separator + 'apiKey=' + encodeURIComponent(apiKey); + } }; var isError = function (status) { - return status < 200 || status >= 300; + return status < 200 || status >= 300; }; var requestServiceBlob = function (url, apiKey) { - var headers = { - 'Content-Type': 'application/json;charset=UTF-8', - 'tiny-api-key': apiKey - }; - return sendRequest(appendApiKey(url, apiKey), headers).then(function (result) { - return isError(result.status) ? handleServiceErrorResponse(result.status, result.blob) : Promise.resolve(result.blob); - }); + var headers = { + 'Content-Type': 'application/json;charset=UTF-8', + 'tiny-api-key': apiKey + }; + return sendRequest(appendApiKey(url, apiKey), headers).then(function (result) { + return isError(result.status) ? handleServiceErrorResponse(result.status, result.blob) : Promise.resolve(result.blob); + }); }; var requestBlob = function (url, withCredentials) { - return sendRequest(url, {}, withCredentials).then(function (result) { - return isError(result.status) ? handleHttpError(result.status) : Promise.resolve(result.blob); - }); + return sendRequest(url, {}, withCredentials).then(function (result) { + return isError(result.status) ? handleHttpError(result.status) : Promise.resolve(result.blob); + }); }; var getUrl = function (url, apiKey, withCredentials) { - if (withCredentials === void 0) { - withCredentials = false; - } - return apiKey ? requestServiceBlob(url, apiKey) : requestBlob(url, withCredentials); + if (withCredentials === void 0) { + withCredentials = false; + } + return apiKey ? requestServiceBlob(url, apiKey) : requestBlob(url, withCredentials); }; var blobToImageResult = function (blob) { - return fromBlob(blob); + return fromBlob(blob); }; var ELEMENT = 1; var fromHtml = function (html, scope) { - var doc = scope || document; - var div = doc.createElement('div'); - div.innerHTML = html; - if (!div.hasChildNodes() || div.childNodes.length > 1) { - console.error('HTML does not have a single root node', html); - throw new Error('HTML must have a single root node'); - } - return fromDom(div.childNodes[0]); + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); }; var fromTag = function (tag, scope) { - var doc = scope || document; - var node = doc.createElement(tag); - return fromDom(node); + var doc = scope || document; + var node = doc.createElement(tag); + return fromDom(node); }; var fromText = function (text, scope) { - var doc = scope || document; - var node = doc.createTextNode(text); - return fromDom(node); + var doc = scope || document; + var node = doc.createTextNode(text); + return fromDom(node); }; var fromDom = function (node) { - if (node === null || node === undefined) { - throw new Error('Node cannot be null or undefined'); - } - return {dom: node}; + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: node }; }; var fromPoint = function (docElm, x, y) { - return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); + return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); }; var SugarElement = { - fromHtml: fromHtml, - fromTag: fromTag, - fromText: fromText, - fromDom: fromDom, - fromPoint: fromPoint + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint }; var is = function (element, selector) { - var dom = element.dom; - if (dom.nodeType !== ELEMENT) { - return false; + var dom = element.dom; + if (dom.nodeType !== ELEMENT) { + return false; + } else { + var elem = dom; + if (elem.matches !== undefined) { + return elem.matches(selector); + } else if (elem.msMatchesSelector !== undefined) { + return elem.msMatchesSelector(selector); + } else if (elem.webkitMatchesSelector !== undefined) { + return elem.webkitMatchesSelector(selector); + } else if (elem.mozMatchesSelector !== undefined) { + return elem.mozMatchesSelector(selector); } else { - var elem = dom; - if (elem.matches !== undefined) { - return elem.matches(selector); - } else if (elem.msMatchesSelector !== undefined) { - return elem.msMatchesSelector(selector); - } else if (elem.webkitMatchesSelector !== undefined) { - return elem.webkitMatchesSelector(selector); - } else if (elem.mozMatchesSelector !== undefined) { - return elem.mozMatchesSelector(selector); - } else { - throw new Error('Browser lacks native selectors'); - } + throw new Error('Browser lacks native selectors'); } + } }; var Global = typeof window !== 'undefined' ? window : Function('return this;')(); var child = function (scope, predicate) { - var pred = function (node) { - return predicate(SugarElement.fromDom(node)); - }; - var result = find(scope.dom.childNodes, pred); - return result.map(SugarElement.fromDom); + var pred = function (node) { + return predicate(SugarElement.fromDom(node)); + }; + var result = find(scope.dom.childNodes, pred); + return result.map(SugarElement.fromDom); }; var child$1 = function (scope, selector) { - return child(scope, function (e) { - return is(e, selector); - }); + return child(scope, function (e) { + return is(e, selector); + }); }; var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay'); @@ -913,282 +873,277 @@ var global$4 = tinymce.util.Tools.resolve('tinymce.util.URI'); var getToolbarItems = function (editor) { - return editor.getParam('imagetools_toolbar', 'rotateleft rotateright flipv fliph editimage imageoptions'); + return editor.getParam('imagetools_toolbar', 'rotateleft rotateright flipv fliph editimage imageoptions'); }; var getProxyUrl = function (editor) { - return editor.getParam('imagetools_proxy'); + return editor.getParam('imagetools_proxy'); }; var getCorsHosts = function (editor) { - return editor.getParam('imagetools_cors_hosts', [], 'string[]'); + return editor.getParam('imagetools_cors_hosts', [], 'string[]'); }; var getCredentialsHosts = function (editor) { - return editor.getParam('imagetools_credentials_hosts', [], 'string[]'); + return editor.getParam('imagetools_credentials_hosts', [], 'string[]'); }; var getFetchImage = function (editor) { - return Optional.from(editor.getParam('imagetools_fetch_image', null, 'function')); + return Optional.from(editor.getParam('imagetools_fetch_image', null, 'function')); }; var getApiKey = function (editor) { - return editor.getParam('api_key', editor.getParam('imagetools_api_key', '', 'string'), 'string'); + return editor.getParam('api_key', editor.getParam('imagetools_api_key', '', 'string'), 'string'); }; var getUploadTimeout = function (editor) { - return editor.getParam('images_upload_timeout', 30000, 'number'); + return editor.getParam('images_upload_timeout', 30000, 'number'); }; var shouldReuseFilename = function (editor) { - return editor.getParam('images_reuse_filename', false, 'boolean'); + return editor.getParam('images_reuse_filename', false, 'boolean'); }; function getImageSize(img) { - var width, height; - - function isPxValue(value) { - return /^[0-9\.]+px$/.test(value); + var width, height; + function isPxValue(value) { + return /^[0-9\.]+px$/.test(value); + } + width = img.style.width; + height = img.style.height; + if (width || height) { + if (isPxValue(width) && isPxValue(height)) { + return { + w: parseInt(width, 10), + h: parseInt(height, 10) + }; } - + return null; + } + width = img.width; + height = img.height; + if (width && height) { + return { + w: parseInt(width, 10), + h: parseInt(height, 10) + }; + } + return null; + } + function setImageSize(img, size) { + var width, height; + if (size) { width = img.style.width; height = img.style.height; if (width || height) { - if (isPxValue(width) && isPxValue(height)) { - return { - w: parseInt(width, 10), - h: parseInt(height, 10) - }; - } - return null; + img.style.width = size.w + 'px'; + img.style.height = size.h + 'px'; + img.removeAttribute('data-mce-style'); } width = img.width; height = img.height; - if (width && height) { - return { - w: parseInt(width, 10), - h: parseInt(height, 10) - }; - } - return null; - } - - function setImageSize(img, size) { - var width, height; - if (size) { - width = img.style.width; - height = img.style.height; - if (width || height) { - img.style.width = size.w + 'px'; - img.style.height = size.h + 'px'; - img.removeAttribute('data-mce-style'); - } - width = img.width; - height = img.height; - if (width || height) { - img.setAttribute('width', String(size.w)); - img.setAttribute('height', String(size.h)); - } + if (width || height) { + img.setAttribute('width', String(size.w)); + img.setAttribute('height', String(size.h)); } + } } - function getNaturalImageSize(img) { - return { - w: img.naturalWidth, - h: img.naturalHeight - }; + return { + w: img.naturalWidth, + h: img.naturalHeight + }; } var count = 0; var getFigureImg = function (elem) { - return child$1(SugarElement.fromDom(elem), 'img'); + return child$1(SugarElement.fromDom(elem), 'img'); }; var isFigure = function (editor, elem) { - return editor.dom.is(elem, 'figure'); + return editor.dom.is(elem, 'figure'); }; var isImage = function (editor, imgNode) { - return editor.dom.is(imgNode, 'img:not([data-mce-object],[data-mce-placeholder])'); + return editor.dom.is(imgNode, 'img:not([data-mce-object],[data-mce-placeholder])'); }; var getEditableImage = function (editor, node) { - var isEditable = function (imgNode) { - return isImage(editor, imgNode) && (isLocalImage(editor, imgNode) || isCorsImage(editor, imgNode) || isNonNullable(getProxyUrl(editor))); - }; - if (isFigure(editor, node)) { - return getFigureImg(node).bind(function (img) { - return isEditable(img.dom) ? Optional.some(img.dom) : Optional.none(); - }); - } else { - return isEditable(node) ? Optional.some(node) : Optional.none(); - } + var isEditable = function (imgNode) { + return isImage(editor, imgNode) && (isLocalImage(editor, imgNode) || isCorsImage(editor, imgNode) || isNonNullable(getProxyUrl(editor))); + }; + if (isFigure(editor, node)) { + return getFigureImg(node).bind(function (img) { + return isEditable(img.dom) ? Optional.some(img.dom) : Optional.none(); + }); + } else { + return isEditable(node) ? Optional.some(node) : Optional.none(); + } }; var displayError = function (editor, error) { - editor.notificationManager.open({ - text: error, - type: 'error' - }); + editor.notificationManager.open({ + text: error, + type: 'error' + }); }; var getSelectedImage = function (editor) { - var elem = editor.selection.getNode(); - var figureElm = editor.dom.getParent(elem, 'figure.image'); - if (figureElm !== null && isFigure(editor, figureElm)) { - return getFigureImg(figureElm); - } else if (isImage(editor, elem)) { - return Optional.some(SugarElement.fromDom(elem)); - } else { - return Optional.none(); - } + var elem = editor.selection.getNode(); + var figureElm = editor.dom.getParent(elem, 'figure.image'); + if (figureElm !== null && isFigure(editor, figureElm)) { + return getFigureImg(figureElm); + } else if (isImage(editor, elem)) { + return Optional.some(SugarElement.fromDom(elem)); + } else { + return Optional.none(); + } }; var extractFilename = function (editor, url, group) { - var m = url.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i); - return isNonNullable(m) ? editor.dom.encode(m[group]) : null; + var m = url.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i); + return isNonNullable(m) ? editor.dom.encode(m[group]) : null; }; var createId = function () { - return 'imagetools' + count++; + return 'imagetools' + count++; }; var isLocalImage = function (editor, img) { - var url = img.src; - return url.indexOf('data:') === 0 || url.indexOf('blob:') === 0 || new global$4(url).host === editor.documentBaseURI.host; + var url = img.src; + return url.indexOf('data:') === 0 || url.indexOf('blob:') === 0 || new global$4(url).host === editor.documentBaseURI.host; }; var isCorsImage = function (editor, img) { - return global$1.inArray(getCorsHosts(editor), new global$4(img.src).host) !== -1; + return global$1.inArray(getCorsHosts(editor), new global$4(img.src).host) !== -1; }; var isCorsWithCredentialsImage = function (editor, img) { - return global$1.inArray(getCredentialsHosts(editor), new global$4(img.src).host) !== -1; + return global$1.inArray(getCredentialsHosts(editor), new global$4(img.src).host) !== -1; }; var defaultFetchImage = function (editor, img) { - if (isCorsImage(editor, img)) { - return getUrl(img.src, null, isCorsWithCredentialsImage(editor, img)); - } - if (!isLocalImage(editor, img)) { - var proxyUrl = getProxyUrl(editor); - var src = proxyUrl + (proxyUrl.indexOf('?') === -1 ? '?' : '&') + 'url=' + encodeURIComponent(img.src); - var apiKey = getApiKey(editor); - return getUrl(src, apiKey, false); - } - return imageToBlob$1(img); + if (isCorsImage(editor, img)) { + return getUrl(img.src, null, isCorsWithCredentialsImage(editor, img)); + } + if (!isLocalImage(editor, img)) { + var proxyUrl = getProxyUrl(editor); + var src = proxyUrl + (proxyUrl.indexOf('?') === -1 ? '?' : '&') + 'url=' + encodeURIComponent(img.src); + var apiKey = getApiKey(editor); + return getUrl(src, apiKey, false); + } + return imageToBlob$1(img); }; var imageToBlob$2 = function (editor, img) { - return getFetchImage(editor).fold(function () { - return defaultFetchImage(editor, img); - }, function (customFetchImage) { - return customFetchImage(img); - }); + return getFetchImage(editor).fold(function () { + return defaultFetchImage(editor, img); + }, function (customFetchImage) { + return customFetchImage(img); + }); }; var findBlob = function (editor, img) { - var blobInfo = editor.editorUpload.blobCache.getByUri(img.src); - if (blobInfo) { - return global$3.resolve(blobInfo.blob()); - } - return imageToBlob$2(editor, img); + var blobInfo = editor.editorUpload.blobCache.getByUri(img.src); + if (blobInfo) { + return global$3.resolve(blobInfo.blob()); + } + return imageToBlob$2(editor, img); }; var startTimedUpload = function (editor, imageUploadTimerState) { - var imageUploadTimer = global$2.setEditorTimeout(editor, function () { - editor.editorUpload.uploadImagesAuto(); - }, getUploadTimeout(editor)); - imageUploadTimerState.set(imageUploadTimer); + var imageUploadTimer = global$2.setEditorTimeout(editor, function () { + editor.editorUpload.uploadImagesAuto(); + }, getUploadTimeout(editor)); + imageUploadTimerState.set(imageUploadTimer); }; var cancelTimedUpload = function (imageUploadTimerState) { - global$2.clearTimeout(imageUploadTimerState.get()); + global$2.clearTimeout(imageUploadTimerState.get()); }; var updateSelectedImage = function (editor, origBlob, ir, uploadImmediately, imageUploadTimerState, selectedImage, size) { - return ir.toBlob().then(function (blob) { - var uri, name, filename, blobInfo; - var blobCache = editor.editorUpload.blobCache; - uri = selectedImage.src; - var useFilename = origBlob.type === blob.type; - if (shouldReuseFilename(editor)) { - blobInfo = blobCache.getByUri(uri); - if (isNonNullable(blobInfo)) { - uri = blobInfo.uri(); - name = blobInfo.name(); - filename = blobInfo.filename(); - } else { - name = extractFilename(editor, uri, 2); - filename = extractFilename(editor, uri, 1); - } + return ir.toBlob().then(function (blob) { + var uri, name, filename, blobInfo; + var blobCache = editor.editorUpload.blobCache; + uri = selectedImage.src; + var useFilename = origBlob.type === blob.type; + if (shouldReuseFilename(editor)) { + blobInfo = blobCache.getByUri(uri); + if (isNonNullable(blobInfo)) { + uri = blobInfo.uri(); + name = blobInfo.name(); + filename = blobInfo.filename(); + } else { + name = extractFilename(editor, uri, 2); + filename = extractFilename(editor, uri, 1); + } + } + blobInfo = blobCache.create({ + id: createId(), + blob: blob, + base64: ir.toBase64(), + uri: uri, + name: name, + filename: useFilename ? filename : undefined + }); + blobCache.add(blobInfo); + editor.undoManager.transact(function () { + function imageLoadedHandler() { + editor.$(selectedImage).off('load', imageLoadedHandler); + editor.nodeChanged(); + if (uploadImmediately) { + editor.editorUpload.uploadImagesAuto(); + } else { + cancelTimedUpload(imageUploadTimerState); + startTimedUpload(editor, imageUploadTimerState); } - blobInfo = blobCache.create({ - id: createId(), - blob: blob, - base64: ir.toBase64(), - uri: uri, - name: name, - filename: useFilename ? filename : undefined - }); - blobCache.add(blobInfo); - editor.undoManager.transact(function () { - function imageLoadedHandler() { - editor.$(selectedImage).off('load', imageLoadedHandler); - editor.nodeChanged(); - if (uploadImmediately) { - editor.editorUpload.uploadImagesAuto(); - } else { - cancelTimedUpload(imageUploadTimerState); - startTimedUpload(editor, imageUploadTimerState); - } - } - - editor.$(selectedImage).on('load', imageLoadedHandler); - if (size) { - editor.$(selectedImage).attr({ - width: size.w, - height: size.h - }); - } - editor.$(selectedImage).attr({src: blobInfo.blobUri()}).removeAttr('data-mce-src'); + } + editor.$(selectedImage).on('load', imageLoadedHandler); + if (size) { + editor.$(selectedImage).attr({ + width: size.w, + height: size.h }); - return blobInfo; + } + editor.$(selectedImage).attr({ src: blobInfo.blobUri() }).removeAttr('data-mce-src'); }); + return blobInfo; + }); }; var selectedImageOperation = function (editor, imageUploadTimerState, fn, size) { - return function () { - var imgOpt = getSelectedImage(editor); - return imgOpt.fold(function () { - displayError(editor, 'Could not find selected image'); - }, function (img) { - return editor._scanForImages().then(function () { - return findBlob(editor, img.dom); - }).then(function (blob) { - return blobToImageResult(blob).then(fn).then(function (imageResult) { - return updateSelectedImage(editor, blob, imageResult, false, imageUploadTimerState, img.dom, size); - }); - }).catch(function (error) { - displayError(editor, error); - }); + return function () { + var imgOpt = getSelectedImage(editor); + return imgOpt.fold(function () { + displayError(editor, 'Could not find selected image'); + }, function (img) { + return editor._scanForImages().then(function () { + return findBlob(editor, img.dom); + }).then(function (blob) { + return blobToImageResult(blob).then(fn).then(function (imageResult) { + return updateSelectedImage(editor, blob, imageResult, false, imageUploadTimerState, img.dom, size); }); - }; + }).catch(function (error) { + displayError(editor, error); + }); + }); + }; }; var rotate$2 = function (editor, imageUploadTimerState, angle) { - return function () { - var imgOpt = getSelectedImage(editor); - var flippedSize = imgOpt.fold(function () { - return null; - }, function (img) { - var size = getImageSize(img.dom); - return size ? { - w: size.h, - h: size.w - } : null; - }); - return selectedImageOperation(editor, imageUploadTimerState, function (imageResult) { - return rotate$1(imageResult, angle); - }, flippedSize)(); - }; + return function () { + var imgOpt = getSelectedImage(editor); + var flippedSize = imgOpt.fold(function () { + return null; + }, function (img) { + var size = getImageSize(img.dom); + return size ? { + w: size.h, + h: size.w + } : null; + }); + return selectedImageOperation(editor, imageUploadTimerState, function (imageResult) { + return rotate$1(imageResult, angle); + }, flippedSize)(); + }; }; var flip$2 = function (editor, imageUploadTimerState, axis) { - return function () { - return selectedImageOperation(editor, imageUploadTimerState, function (imageResult) { - return flip$1(imageResult, axis); - })(); - }; + return function () { + return selectedImageOperation(editor, imageUploadTimerState, function (imageResult) { + return flip$1(imageResult, axis); + })(); + }; }; var handleDialogBlob = function (editor, imageUploadTimerState, img, originalSize, blob) { - return blobToImage$1(blob).then(function (newImage) { - var newSize = getNaturalImageSize(newImage); - if (originalSize.w !== newSize.w || originalSize.h !== newSize.h) { - if (getImageSize(img)) { - setImageSize(img, newSize); - } - } - URL.revokeObjectURL(newImage.src); - return blob; - }).then(blobToImageResult).then(function (imageResult) { - return updateSelectedImage(editor, blob, imageResult, true, imageUploadTimerState, img); - }).catch(function () { - }); + return blobToImage$1(blob).then(function (newImage) { + var newSize = getNaturalImageSize(newImage); + if (originalSize.w !== newSize.w || originalSize.h !== newSize.h) { + if (getImageSize(img)) { + setImageSize(img, newSize); + } + } + URL.revokeObjectURL(newImage.src); + return blob; + }).then(blobToImageResult).then(function (imageResult) { + return updateSelectedImage(editor, blob, imageResult, true, imageUploadTimerState, img); + }).catch(function () { + }); }; var saveState = 'save-state'; @@ -1196,196 +1151,196 @@ var enable = 'enable'; var createState = function (blob) { - return { - blob: blob, - url: URL.createObjectURL(blob) - }; + return { + blob: blob, + url: URL.createObjectURL(blob) + }; }; var makeOpen = function (editor, imageUploadTimerState) { - return function () { - var getLoadedSpec = function (currentState) { - return { - title: 'Edit Image', - size: 'large', - body: { - type: 'panel', - items: [{ - type: 'imagetools', - name: 'imagetools', - label: 'Edit Image', - currentState: currentState - }] - }, - buttons: [ - { - type: 'cancel', - name: 'cancel', - text: 'Cancel' - }, - { - type: 'submit', - name: 'save', - text: 'Save', - primary: true, - disabled: true - } - ], - onSubmit: function (api) { - var blob = api.getData().imagetools.blob; - originalImgOpt.each(function (originalImg) { - originalSizeOpt.each(function (originalSize) { - handleDialogBlob(editor, imageUploadTimerState, originalImg.dom, originalSize, blob); - }); - }); - api.close(); - }, - onCancel: function () { - }, - onAction: function (api, details) { - switch (details.name) { - case saveState: - if (details.value) { - api.enable('save'); - } else { - api.disable('save'); - } - break; - case disable: - api.disable('save'); - api.disable('cancel'); - break; - case enable: - api.enable('cancel'); - break; - } - } - }; - }; - var originalImgOpt = getSelectedImage(editor); - var originalSizeOpt = originalImgOpt.map(function (origImg) { - return getNaturalImageSize(origImg.dom); - }); - originalImgOpt.each(function (img) { - getEditableImage(editor, img.dom).each(function (_) { - findBlob(editor, img.dom).then(function (blob) { - var state = createState(blob); - editor.windowManager.open(getLoadedSpec(state)); - }); + return function () { + var getLoadedSpec = function (currentState) { + return { + title: 'Edit Image', + size: 'large', + body: { + type: 'panel', + items: [{ + type: 'imagetools', + name: 'imagetools', + label: 'Edit Image', + currentState: currentState + }] + }, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true, + disabled: true + } + ], + onSubmit: function (api) { + var blob = api.getData().imagetools.blob; + originalImgOpt.each(function (originalImg) { + originalSizeOpt.each(function (originalSize) { + handleDialogBlob(editor, imageUploadTimerState, originalImg.dom, originalSize, blob); }); - }); + }); + api.close(); + }, + onCancel: function () { + }, + onAction: function (api, details) { + switch (details.name) { + case saveState: + if (details.value) { + api.enable('save'); + } else { + api.disable('save'); + } + break; + case disable: + api.disable('save'); + api.disable('cancel'); + break; + case enable: + api.enable('cancel'); + break; + } + } + }; }; + var originalImgOpt = getSelectedImage(editor); + var originalSizeOpt = originalImgOpt.map(function (origImg) { + return getNaturalImageSize(origImg.dom); + }); + originalImgOpt.each(function (img) { + getEditableImage(editor, img.dom).each(function (_) { + findBlob(editor, img.dom).then(function (blob) { + var state = createState(blob); + editor.windowManager.open(getLoadedSpec(state)); + }); + }); + }); + }; }; var register = function (editor, imageUploadTimerState) { - global$1.each({ - mceImageRotateLeft: rotate$2(editor, imageUploadTimerState, -90), - mceImageRotateRight: rotate$2(editor, imageUploadTimerState, 90), - mceImageFlipVertical: flip$2(editor, imageUploadTimerState, 'v'), - mceImageFlipHorizontal: flip$2(editor, imageUploadTimerState, 'h'), - mceEditImage: makeOpen(editor, imageUploadTimerState) - }, function (fn, cmd) { - editor.addCommand(cmd, fn); - }); + global$1.each({ + mceImageRotateLeft: rotate$2(editor, imageUploadTimerState, -90), + mceImageRotateRight: rotate$2(editor, imageUploadTimerState, 90), + mceImageFlipVertical: flip$2(editor, imageUploadTimerState, 'v'), + mceImageFlipHorizontal: flip$2(editor, imageUploadTimerState, 'h'), + mceEditImage: makeOpen(editor, imageUploadTimerState) + }, function (fn, cmd) { + editor.addCommand(cmd, fn); + }); }; var setup = function (editor, imageUploadTimerState, lastSelectedImageState) { - editor.on('NodeChange', function (e) { - var lastSelectedImage = lastSelectedImageState.get(); - var selectedImage = getEditableImage(editor, e.element); - if (lastSelectedImage && !selectedImage.exists(function (img) { - return lastSelectedImage.src === img.src; - })) { - cancelTimedUpload(imageUploadTimerState); - editor.editorUpload.uploadImagesAuto(); - lastSelectedImageState.set(null); - } - selectedImage.each(lastSelectedImageState.set); - }); + editor.on('NodeChange', function (e) { + var lastSelectedImage = lastSelectedImageState.get(); + var selectedImage = getEditableImage(editor, e.element); + if (lastSelectedImage && !selectedImage.exists(function (img) { + return lastSelectedImage.src === img.src; + })) { + cancelTimedUpload(imageUploadTimerState); + editor.editorUpload.uploadImagesAuto(); + lastSelectedImageState.set(null); + } + selectedImage.each(lastSelectedImageState.set); + }); }; var register$1 = function (editor) { - var cmd = function (command) { - return function () { - return editor.execCommand(command); - }; + var cmd = function (command) { + return function () { + return editor.execCommand(command); }; - editor.ui.registry.addButton('rotateleft', { - tooltip: 'Rotate counterclockwise', - icon: 'rotate-left', - onAction: cmd('mceImageRotateLeft') - }); - editor.ui.registry.addButton('rotateright', { - tooltip: 'Rotate clockwise', - icon: 'rotate-right', - onAction: cmd('mceImageRotateRight') - }); - editor.ui.registry.addButton('flipv', { - tooltip: 'Flip vertically', - icon: 'flip-vertically', - onAction: cmd('mceImageFlipVertical') - }); - editor.ui.registry.addButton('fliph', { - tooltip: 'Flip horizontally', - icon: 'flip-horizontally', - onAction: cmd('mceImageFlipHorizontal') - }); - editor.ui.registry.addButton('editimage', { - tooltip: 'Edit image', - icon: 'edit-image', - onAction: cmd('mceEditImage'), - onSetup: function (buttonApi) { - var setDisabled = function () { - var disabled = getSelectedImage(editor).forall(function (element) { - return getEditableImage(editor, element.dom).isNone(); - }); - buttonApi.setDisabled(disabled); - }; - editor.on('NodeChange', setDisabled); - return function () { - editor.off('NodeChange', setDisabled); - }; - } - }); - editor.ui.registry.addButton('imageoptions', { - tooltip: 'Image options', - icon: 'image', - onAction: cmd('mceImage') - }); - editor.ui.registry.addContextMenu('imagetools', { - update: function (element) { - return getEditableImage(editor, element).fold(function () { - return []; - }, function (_) { - return [{ - text: 'Edit image', - icon: 'edit-image', - onAction: cmd('mceEditImage') - }]; - }); - } - }); + }; + editor.ui.registry.addButton('rotateleft', { + tooltip: 'Rotate counterclockwise', + icon: 'rotate-left', + onAction: cmd('mceImageRotateLeft') + }); + editor.ui.registry.addButton('rotateright', { + tooltip: 'Rotate clockwise', + icon: 'rotate-right', + onAction: cmd('mceImageRotateRight') + }); + editor.ui.registry.addButton('flipv', { + tooltip: 'Flip vertically', + icon: 'flip-vertically', + onAction: cmd('mceImageFlipVertical') + }); + editor.ui.registry.addButton('fliph', { + tooltip: 'Flip horizontally', + icon: 'flip-horizontally', + onAction: cmd('mceImageFlipHorizontal') + }); + editor.ui.registry.addButton('editimage', { + tooltip: 'Edit image', + icon: 'edit-image', + onAction: cmd('mceEditImage'), + onSetup: function (buttonApi) { + var setDisabled = function () { + var disabled = getSelectedImage(editor).forall(function (element) { + return getEditableImage(editor, element.dom).isNone(); + }); + buttonApi.setDisabled(disabled); + }; + editor.on('NodeChange', setDisabled); + return function () { + editor.off('NodeChange', setDisabled); + }; + } + }); + editor.ui.registry.addButton('imageoptions', { + tooltip: 'Image options', + icon: 'image', + onAction: cmd('mceImage') + }); + editor.ui.registry.addContextMenu('imagetools', { + update: function (element) { + return getEditableImage(editor, element).fold(function () { + return []; + }, function (_) { + return [{ + text: 'Edit image', + icon: 'edit-image', + onAction: cmd('mceEditImage') + }]; + }); + } + }); }; var register$2 = function (editor) { - editor.ui.registry.addContextToolbar('imagetools', { - items: getToolbarItems(editor), - predicate: function (elem) { - return getEditableImage(editor, elem).isSome(); - }, - position: 'node', - scope: 'node' - }); - }; - - function Plugin() { - global.add('imagetools', function (editor) { - var imageUploadTimerState = Cell(0); - var lastSelectedImageState = Cell(null); - register(editor, imageUploadTimerState); - register$1(editor); - register$2(editor); - setup(editor, imageUploadTimerState, lastSelectedImageState); - }); + editor.ui.registry.addContextToolbar('imagetools', { + items: getToolbarItems(editor), + predicate: function (elem) { + return getEditableImage(editor, elem).isSome(); + }, + position: 'node', + scope: 'node' + }); + }; + + function Plugin () { + global.add('imagetools', function (editor) { + var imageUploadTimerState = Cell(0); + var lastSelectedImageState = Cell(null); + register(editor, imageUploadTimerState); + register$1(editor); + register$2(editor); + setup(editor, imageUploadTimerState, lastSelectedImageState); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/importcss/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/importcss/plugin.js index 15fcb252..10bec6ce 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/importcss/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/importcss/plugin.js @@ -20,324 +20,322 @@ var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var shouldMergeClasses = function (editor) { - return editor.getParam('importcss_merge_classes'); + return editor.getParam('importcss_merge_classes'); }; var shouldImportExclusive = function (editor) { - return editor.getParam('importcss_exclusive'); + return editor.getParam('importcss_exclusive'); }; var getSelectorConverter = function (editor) { - return editor.getParam('importcss_selector_converter'); + return editor.getParam('importcss_selector_converter'); }; var getSelectorFilter = function (editor) { - return editor.getParam('importcss_selector_filter'); + return editor.getParam('importcss_selector_filter'); }; var getCssGroups = function (editor) { - return editor.getParam('importcss_groups'); + return editor.getParam('importcss_groups'); }; var shouldAppend = function (editor) { - return editor.getParam('importcss_append'); + return editor.getParam('importcss_append'); }; var getFileFilter = function (editor) { - return editor.getParam('importcss_file_filter'); + return editor.getParam('importcss_file_filter'); }; var getSkin = function (editor) { - var skin = editor.getParam('skin'); - return skin !== false ? skin || 'oxide' : false; + var skin = editor.getParam('skin'); + return skin !== false ? skin || 'oxide' : false; }; var getSkinUrl = function (editor) { - return editor.getParam('skin_url'); + return editor.getParam('skin_url'); }; var typeOf = function (x) { - var t = typeof x; - if (x === null) { - return 'null'; - } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { - return 'array'; - } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { - return 'string'; - } else { - return t; - } + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } }; var isType = function (type) { - return function (value) { - return typeOf(value) === type; - }; + return function (value) { + return typeOf(value) === type; + }; }; var isArray = isType('array'); var nativePush = Array.prototype.push; var map = function (xs, f) { - var len = xs.length; - var r = new Array(len); - for (var i = 0; i < len; i++) { - var x = xs[i]; - r[i] = f(x, i); - } - return r; + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; }; var flatten = function (xs) { - var r = []; - for (var i = 0, len = xs.length; i < len; ++i) { - if (!isArray(xs[i])) { - throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); - } - nativePush.apply(r, xs[i]); + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); } - return r; + nativePush.apply(r, xs[i]); + } + return r; }; var bind = function (xs, f) { - return flatten(map(xs, f)); + return flatten(map(xs, f)); }; var generate = function () { - var ungroupedOrder = []; - var groupOrder = []; - var groups = {}; - var addItemToGroup = function (groupTitle, itemInfo) { - if (groups[groupTitle]) { - groups[groupTitle].push(itemInfo); - } else { - groupOrder.push(groupTitle); - groups[groupTitle] = [itemInfo]; - } - }; - var addItem = function (itemInfo) { - ungroupedOrder.push(itemInfo); - }; - var toFormats = function () { - var groupItems = bind(groupOrder, function (g) { - var items = groups[g]; - return items.length === 0 ? [] : [{ - title: g, - items: items - }]; - }); - return groupItems.concat(ungroupedOrder); - }; - return { - addItemToGroup: addItemToGroup, - addItem: addItem, - toFormats: toFormats - }; + var ungroupedOrder = []; + var groupOrder = []; + var groups = {}; + var addItemToGroup = function (groupTitle, itemInfo) { + if (groups[groupTitle]) { + groups[groupTitle].push(itemInfo); + } else { + groupOrder.push(groupTitle); + groups[groupTitle] = [itemInfo]; + } + }; + var addItem = function (itemInfo) { + ungroupedOrder.push(itemInfo); + }; + var toFormats = function () { + var groupItems = bind(groupOrder, function (g) { + var items = groups[g]; + return items.length === 0 ? [] : [{ + title: g, + items: items + }]; + }); + return groupItems.concat(ungroupedOrder); + }; + return { + addItemToGroup: addItemToGroup, + addItem: addItem, + toFormats: toFormats + }; }; var removeCacheSuffix = function (url) { - var cacheSuffix = global$3.cacheSuffix; - if (typeof url === 'string') { - url = url.replace('?' + cacheSuffix, '').replace('&' + cacheSuffix, ''); - } - return url; + var cacheSuffix = global$3.cacheSuffix; + if (typeof url === 'string') { + url = url.replace('?' + cacheSuffix, '').replace('&' + cacheSuffix, ''); + } + return url; }; var isSkinContentCss = function (editor, href) { - var skin = getSkin(editor); - if (skin) { - var skinUrlBase = getSkinUrl(editor); - var skinUrl = skinUrlBase ? editor.documentBaseURI.toAbsolute(skinUrlBase) : global$2.baseURL + '/skins/ui/' + skin; - var contentSkinUrlPart = global$2.baseURL + '/skins/content/'; - return href === skinUrl + '/content' + (editor.inline ? '.inline' : '') + '.min.css' || href.indexOf(contentSkinUrlPart) !== -1; - } - return false; + var skin = getSkin(editor); + if (skin) { + var skinUrlBase = getSkinUrl(editor); + var skinUrl = skinUrlBase ? editor.documentBaseURI.toAbsolute(skinUrlBase) : global$2.baseURL + '/skins/ui/' + skin; + var contentSkinUrlPart = global$2.baseURL + '/skins/content/'; + return href === skinUrl + '/content' + (editor.inline ? '.inline' : '') + '.min.css' || href.indexOf(contentSkinUrlPart) !== -1; + } + return false; }; var compileFilter = function (filter) { - if (typeof filter === 'string') { - return function (value) { - return value.indexOf(filter) !== -1; - }; - } else if (filter instanceof RegExp) { - return function (value) { - return filter.test(value); - }; - } - return filter; + if (typeof filter === 'string') { + return function (value) { + return value.indexOf(filter) !== -1; + }; + } else if (filter instanceof RegExp) { + return function (value) { + return filter.test(value); + }; + } + return filter; }; var isCssImportRule = function (rule) { - return rule.styleSheet; + return rule.styleSheet; }; var isCssPageRule = function (rule) { - return rule.selectorText; + return rule.selectorText; }; var getSelectors = function (editor, doc, fileFilter) { - var selectors = [], contentCSSUrls = {}; - - function append(styleSheet, imported) { - var href = styleSheet.href, rules; - href = removeCacheSuffix(href); - if (!href || !fileFilter(href, imported) || isSkinContentCss(editor, href)) { - return; - } - global$4.each(styleSheet.imports, function (styleSheet) { - append(styleSheet, true); - }); - try { - rules = styleSheet.cssRules || styleSheet.rules; - } catch (e) { - } - global$4.each(rules, function (cssRule) { - if (isCssImportRule(cssRule)) { - append(cssRule.styleSheet, true); - } else if (isCssPageRule(cssRule)) { - global$4.each(cssRule.selectorText.split(','), function (selector) { - selectors.push(global$4.trim(selector)); - }); - } - }); + var selectors = [], contentCSSUrls = {}; + function append(styleSheet, imported) { + var href = styleSheet.href, rules; + href = removeCacheSuffix(href); + if (!href || !fileFilter(href, imported) || isSkinContentCss(editor, href)) { + return; } - - global$4.each(editor.contentCSS, function (url) { - contentCSSUrls[url] = true; + global$4.each(styleSheet.imports, function (styleSheet) { + append(styleSheet, true); }); - if (!fileFilter) { - fileFilter = function (href, imported) { - return imported || contentCSSUrls[href]; - }; - } try { - global$4.each(doc.styleSheets, function (styleSheet) { - append(styleSheet); - }); + rules = styleSheet.cssRules || styleSheet.rules; } catch (e) { } - return selectors; + global$4.each(rules, function (cssRule) { + if (isCssImportRule(cssRule)) { + append(cssRule.styleSheet, true); + } else if (isCssPageRule(cssRule)) { + global$4.each(cssRule.selectorText.split(','), function (selector) { + selectors.push(global$4.trim(selector)); + }); + } + }); + } + global$4.each(editor.contentCSS, function (url) { + contentCSSUrls[url] = true; + }); + if (!fileFilter) { + fileFilter = function (href, imported) { + return imported || contentCSSUrls[href]; + }; + } + try { + global$4.each(doc.styleSheets, function (styleSheet) { + append(styleSheet); + }); + } catch (e) { + } + return selectors; }; var defaultConvertSelectorToFormat = function (editor, selectorText) { - var format; - var selector = /^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(selectorText); - if (!selector) { - return; - } - var elementName = selector[1]; - var classes = selector[2].substr(1).split('.').join(' '); - var inlineSelectorElements = global$4.makeMap('a,img'); - if (selector[1]) { - format = {title: selectorText}; - if (editor.schema.getTextBlockElements()[elementName]) { - format.block = elementName; - } else if (editor.schema.getBlockElements()[elementName] || inlineSelectorElements[elementName.toLowerCase()]) { - format.selector = elementName; - } else { - format.inline = elementName; - } - } else if (selector[2]) { - format = { - inline: 'span', - title: selectorText.substr(1), - classes: classes - }; - } - if (shouldMergeClasses(editor) !== false) { - format.classes = classes; + var format; + var selector = /^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(selectorText); + if (!selector) { + return; + } + var elementName = selector[1]; + var classes = selector[2].substr(1).split('.').join(' '); + var inlineSelectorElements = global$4.makeMap('a,img'); + if (selector[1]) { + format = { title: selectorText }; + if (editor.schema.getTextBlockElements()[elementName]) { + format.block = elementName; + } else if (editor.schema.getBlockElements()[elementName] || inlineSelectorElements[elementName.toLowerCase()]) { + format.selector = elementName; } else { - format.attributes = {class: classes}; + format.inline = elementName; } - return format; + } else if (selector[2]) { + format = { + inline: 'span', + title: selectorText.substr(1), + classes: classes + }; + } + if (shouldMergeClasses(editor) !== false) { + format.classes = classes; + } else { + format.attributes = { class: classes }; + } + return format; }; var getGroupsBySelector = function (groups, selector) { - return global$4.grep(groups, function (group) { - return !group.filter || group.filter(selector); - }); + return global$4.grep(groups, function (group) { + return !group.filter || group.filter(selector); + }); }; var compileUserDefinedGroups = function (groups) { - return global$4.map(groups, function (group) { - return global$4.extend({}, group, { - original: group, - selectors: {}, - filter: compileFilter(group.filter), - item: { - text: group.title, - menu: [] - } - }); + return global$4.map(groups, function (group) { + return global$4.extend({}, group, { + original: group, + selectors: {}, + filter: compileFilter(group.filter), + item: { + text: group.title, + menu: [] + } }); + }); }; var isExclusiveMode = function (editor, group) { - return group === null || shouldImportExclusive(editor) !== false; + return group === null || shouldImportExclusive(editor) !== false; }; var isUniqueSelector = function (editor, selector, group, globallyUniqueSelectors) { - return !(isExclusiveMode(editor, group) ? selector in globallyUniqueSelectors : selector in group.selectors); + return !(isExclusiveMode(editor, group) ? selector in globallyUniqueSelectors : selector in group.selectors); }; var markUniqueSelector = function (editor, selector, group, globallyUniqueSelectors) { - if (isExclusiveMode(editor, group)) { - globallyUniqueSelectors[selector] = true; - } else { - group.selectors[selector] = true; - } + if (isExclusiveMode(editor, group)) { + globallyUniqueSelectors[selector] = true; + } else { + group.selectors[selector] = true; + } }; var convertSelectorToFormat = function (editor, plugin, selector, group) { - var selectorConverter; - if (group && group.selector_converter) { - selectorConverter = group.selector_converter; - } else if (getSelectorConverter(editor)) { - selectorConverter = getSelectorConverter(editor); - } else { - selectorConverter = function () { - return defaultConvertSelectorToFormat(editor, selector); - }; - } - return selectorConverter.call(plugin, selector, group); + var selectorConverter; + if (group && group.selector_converter) { + selectorConverter = group.selector_converter; + } else if (getSelectorConverter(editor)) { + selectorConverter = getSelectorConverter(editor); + } else { + selectorConverter = function () { + return defaultConvertSelectorToFormat(editor, selector); + }; + } + return selectorConverter.call(plugin, selector, group); }; var setup = function (editor) { - editor.on('init', function (_e) { - var model = generate(); - var globallyUniqueSelectors = {}; - var selectorFilter = compileFilter(getSelectorFilter(editor)); - var groups = compileUserDefinedGroups(getCssGroups(editor)); - var processSelector = function (selector, group) { - if (isUniqueSelector(editor, selector, group, globallyUniqueSelectors)) { - markUniqueSelector(editor, selector, group, globallyUniqueSelectors); - var format = convertSelectorToFormat(editor, editor.plugins.importcss, selector, group); - if (format) { - var formatName = format.name || global$1.DOM.uniqueId(); - editor.formatter.register(formatName, format); - return global$4.extend({}, { - title: format.title, - format: formatName - }); - } - } - return null; - }; - global$4.each(getSelectors(editor, editor.getDoc(), compileFilter(getFileFilter(editor))), function (selector) { - if (selector.indexOf('.mce-') === -1) { - if (!selectorFilter || selectorFilter(selector)) { - var selectorGroups = getGroupsBySelector(groups, selector); - if (selectorGroups.length > 0) { - global$4.each(selectorGroups, function (group) { - var menuItem = processSelector(selector, group); - if (menuItem) { - model.addItemToGroup(group.title, menuItem); - } - }); - } else { - var menuItem = processSelector(selector, null); - if (menuItem) { - model.addItem(menuItem); - } - } - } + editor.on('init', function (_e) { + var model = generate(); + var globallyUniqueSelectors = {}; + var selectorFilter = compileFilter(getSelectorFilter(editor)); + var groups = compileUserDefinedGroups(getCssGroups(editor)); + var processSelector = function (selector, group) { + if (isUniqueSelector(editor, selector, group, globallyUniqueSelectors)) { + markUniqueSelector(editor, selector, group, globallyUniqueSelectors); + var format = convertSelectorToFormat(editor, editor.plugins.importcss, selector, group); + if (format) { + var formatName = format.name || global$1.DOM.uniqueId(); + editor.formatter.register(formatName, format); + return global$4.extend({}, { + title: format.title, + format: formatName + }); + } + } + return null; + }; + global$4.each(getSelectors(editor, editor.getDoc(), compileFilter(getFileFilter(editor))), function (selector) { + if (selector.indexOf('.mce-') === -1) { + if (!selectorFilter || selectorFilter(selector)) { + var selectorGroups = getGroupsBySelector(groups, selector); + if (selectorGroups.length > 0) { + global$4.each(selectorGroups, function (group) { + var menuItem = processSelector(selector, group); + if (menuItem) { + model.addItemToGroup(group.title, menuItem); + } + }); + } else { + var menuItem = processSelector(selector, null); + if (menuItem) { + model.addItem(menuItem); } - }); - var items = model.toFormats(); - editor.fire('addStyleModifications', { - items: items, - replace: !shouldAppend(editor) - }); + } + } + } }); + var items = model.toFormats(); + editor.fire('addStyleModifications', { + items: items, + replace: !shouldAppend(editor) + }); + }); }; var get = function (editor) { - var convertSelectorToFormat = function (selectorText) { - return defaultConvertSelectorToFormat(editor, selectorText); - }; - return {convertSelectorToFormat: convertSelectorToFormat}; + var convertSelectorToFormat = function (selectorText) { + return defaultConvertSelectorToFormat(editor, selectorText); + }; + return { convertSelectorToFormat: convertSelectorToFormat }; }; - function Plugin() { - global.add('importcss', function (editor) { - setup(editor); - return get(editor); - }); + function Plugin () { + global.add('importcss', function (editor) { + setup(editor); + return get(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/indent2em/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/indent2em/plugin.js index 16da0424..b9d83825 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/indent2em/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/indent2em/plugin.js @@ -1,5 +1,5 @@ -tinymce.PluginManager.add('indent2em', function (editor, url) { - var pluginName = '首行缩进'; +tinymce.PluginManager.add('indent2em', function(editor, url) { + var pluginName='首行缩进'; var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var indent2em_val = editor.getParam('indent2em_val', '2em'); var doAct = function () { @@ -7,29 +7,29 @@ tinymce.PluginManager.add('indent2em', function (editor, url) { var blocks = editor.selection.getSelectedBlocks(); var act = ''; global$1.each(blocks, function (block) { - if (act == '') { - act = dom.getStyle(block, 'text-indent') == indent2em_val ? 'remove' : 'add'; + if(act==''){ + act = dom.getStyle(block,'text-indent')==indent2em_val ? 'remove' : 'add'; } - if (act == 'add') { + if( act=='add' ){ dom.setStyle(block, 'text-indent', indent2em_val); - } else { - var style = dom.getAttrib(block, 'style'); + }else{ + var style=dom.getAttrib(block,'style'); var reg = new RegExp('text-indent:[\\s]*' + indent2em_val + ';', 'ig'); style = style.replace(reg, ''); - dom.setAttrib(block, 'style', style); + dom.setAttrib(block,'style',style); } }); }; - editor.ui.registry.getAll().icons.indent2em || editor.ui.registry.addIcon('indent2em', ''); + editor.ui.registry.getAll().icons.indent2em || editor.ui.registry.addIcon('indent2em',''); var stateSelectorAdapter = function (editor, selector) { - return function (buttonApi) { - return editor.selection.selectorChangedWithUnbind(selector.join(','), buttonApi.setActive).unbind; - }; + return function (buttonApi) { + return editor.selection.selectorChangedWithUnbind(selector.join(','), buttonApi.setActive).unbind; + }; }; - + editor.ui.registry.addToggleButton('indent2em', { icon: 'indent2em', tooltip: pluginName, @@ -37,23 +37,23 @@ tinymce.PluginManager.add('indent2em', function (editor, url) { doAct(); }, onSetup: stateSelectorAdapter(editor, [ - '*[style*="text-indent"]', - '*[data-mce-style*="text-indent"]', + '*[style*="text-indent"]', + '*[data-mce-style*="text-indent"]', ]) }); editor.ui.registry.addMenuItem('indent2em', { text: pluginName, - onAction: function () { + onAction: function() { doAct(); } }); - editor.addCommand('indent2em', doAct); + editor.addCommand('indent2em', doAct ); return { getMetadata: function () { - return { + return { name: pluginName, url: "http://tinymce.ax-z.cn/more-plugins/indent2em.php", }; diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/insertdatetime/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/insertdatetime/plugin.js index 628f3426..b8ae4bc4 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/insertdatetime/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/insertdatetime/plugin.js @@ -12,25 +12,25 @@ var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var getDateFormat = function (editor) { - return editor.getParam('insertdatetime_dateformat', editor.translate('%Y-%m-%d')); + return editor.getParam('insertdatetime_dateformat', editor.translate('%Y-%m-%d')); }; var getTimeFormat = function (editor) { - return editor.getParam('insertdatetime_timeformat', editor.translate('%H:%M:%S')); + return editor.getParam('insertdatetime_timeformat', editor.translate('%H:%M:%S')); }; var getFormats = function (editor) { - return editor.getParam('insertdatetime_formats', [ - '%H:%M:%S', - '%Y-%m-%d', - '%I:%M:%S %p', - '%D' - ]); + return editor.getParam('insertdatetime_formats', [ + '%H:%M:%S', + '%Y-%m-%d', + '%I:%M:%S %p', + '%D' + ]); }; var getDefaultDateTime = function (editor) { - var formats = getFormats(editor); - return formats.length > 0 ? formats[0] : getTimeFormat(editor); + var formats = getFormats(editor); + return formats.length > 0 ? formats[0] : getTimeFormat(editor); }; var shouldInsertTimeElement = function (editor) { - return editor.getParam('insertdatetime_element', false); + return editor.getParam('insertdatetime_element', false); }; var daysShort = 'Sun Mon Tue Wed Thu Fri Sat Sun'.split(' '); @@ -38,138 +38,138 @@ var monthsShort = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' '); var monthsLong = 'January February March April May June July August September October November December'.split(' '); var addZeros = function (value, len) { - value = '' + value; - if (value.length < len) { - for (var i = 0; i < len - value.length; i++) { - value = '0' + value; - } + value = '' + value; + if (value.length < len) { + for (var i = 0; i < len - value.length; i++) { + value = '0' + value; } - return value; + } + return value; }; var getDateTime = function (editor, fmt, date) { - date = date || new Date(); - fmt = fmt.replace('%D', '%m/%d/%Y'); - fmt = fmt.replace('%r', '%I:%M:%S %p'); - fmt = fmt.replace('%Y', '' + date.getFullYear()); - fmt = fmt.replace('%y', '' + date.getYear()); - fmt = fmt.replace('%m', addZeros(date.getMonth() + 1, 2)); - fmt = fmt.replace('%d', addZeros(date.getDate(), 2)); - fmt = fmt.replace('%H', '' + addZeros(date.getHours(), 2)); - fmt = fmt.replace('%M', '' + addZeros(date.getMinutes(), 2)); - fmt = fmt.replace('%S', '' + addZeros(date.getSeconds(), 2)); - fmt = fmt.replace('%I', '' + ((date.getHours() + 11) % 12 + 1)); - fmt = fmt.replace('%p', '' + (date.getHours() < 12 ? 'AM' : 'PM')); - fmt = fmt.replace('%B', '' + editor.translate(monthsLong[date.getMonth()])); - fmt = fmt.replace('%b', '' + editor.translate(monthsShort[date.getMonth()])); - fmt = fmt.replace('%A', '' + editor.translate(daysLong[date.getDay()])); - fmt = fmt.replace('%a', '' + editor.translate(daysShort[date.getDay()])); - fmt = fmt.replace('%%', '%'); - return fmt; + date = date || new Date(); + fmt = fmt.replace('%D', '%m/%d/%Y'); + fmt = fmt.replace('%r', '%I:%M:%S %p'); + fmt = fmt.replace('%Y', '' + date.getFullYear()); + fmt = fmt.replace('%y', '' + date.getYear()); + fmt = fmt.replace('%m', addZeros(date.getMonth() + 1, 2)); + fmt = fmt.replace('%d', addZeros(date.getDate(), 2)); + fmt = fmt.replace('%H', '' + addZeros(date.getHours(), 2)); + fmt = fmt.replace('%M', '' + addZeros(date.getMinutes(), 2)); + fmt = fmt.replace('%S', '' + addZeros(date.getSeconds(), 2)); + fmt = fmt.replace('%I', '' + ((date.getHours() + 11) % 12 + 1)); + fmt = fmt.replace('%p', '' + (date.getHours() < 12 ? 'AM' : 'PM')); + fmt = fmt.replace('%B', '' + editor.translate(monthsLong[date.getMonth()])); + fmt = fmt.replace('%b', '' + editor.translate(monthsShort[date.getMonth()])); + fmt = fmt.replace('%A', '' + editor.translate(daysLong[date.getDay()])); + fmt = fmt.replace('%a', '' + editor.translate(daysShort[date.getDay()])); + fmt = fmt.replace('%%', '%'); + return fmt; }; var updateElement = function (editor, timeElm, computerTime, userTime) { - var newTimeElm = editor.dom.create('time', {datetime: computerTime}, userTime); - timeElm.parentNode.insertBefore(newTimeElm, timeElm); - editor.dom.remove(timeElm); - editor.selection.select(newTimeElm, true); - editor.selection.collapse(false); + var newTimeElm = editor.dom.create('time', { datetime: computerTime }, userTime); + timeElm.parentNode.insertBefore(newTimeElm, timeElm); + editor.dom.remove(timeElm); + editor.selection.select(newTimeElm, true); + editor.selection.collapse(false); }; var insertDateTime = function (editor, format) { - if (shouldInsertTimeElement(editor)) { - var userTime = getDateTime(editor, format); - var computerTime = void 0; - if (/%[HMSIp]/.test(format)) { - computerTime = getDateTime(editor, '%Y-%m-%dT%H:%M'); - } else { - computerTime = getDateTime(editor, '%Y-%m-%d'); - } - var timeElm = editor.dom.getParent(editor.selection.getStart(), 'time'); - if (timeElm) { - updateElement(editor, timeElm, computerTime, userTime); - } else { - editor.insertContent(''); - } + if (shouldInsertTimeElement(editor)) { + var userTime = getDateTime(editor, format); + var computerTime = void 0; + if (/%[HMSIp]/.test(format)) { + computerTime = getDateTime(editor, '%Y-%m-%dT%H:%M'); + } else { + computerTime = getDateTime(editor, '%Y-%m-%d'); + } + var timeElm = editor.dom.getParent(editor.selection.getStart(), 'time'); + if (timeElm) { + updateElement(editor, timeElm, computerTime, userTime); } else { - editor.insertContent(getDateTime(editor, format)); + editor.insertContent(''); } + } else { + editor.insertContent(getDateTime(editor, format)); + } }; var register = function (editor) { - editor.addCommand('mceInsertDate', function () { - insertDateTime(editor, getDateFormat(editor)); - }); - editor.addCommand('mceInsertTime', function () { - insertDateTime(editor, getTimeFormat(editor)); - }); + editor.addCommand('mceInsertDate', function () { + insertDateTime(editor, getDateFormat(editor)); + }); + editor.addCommand('mceInsertTime', function () { + insertDateTime(editor, getTimeFormat(editor)); + }); }; var Cell = function (initial) { - var value = initial; - var get = function () { - return value; - }; - var set = function (v) { - value = v; - }; - return { - get: get, - set: set - }; + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; }; var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var register$1 = function (editor) { - var formats = getFormats(editor); - var defaultFormat = Cell(getDefaultDateTime(editor)); - editor.ui.registry.addSplitButton('insertdatetime', { - icon: 'insert-time', - tooltip: 'Insert date/time', - select: function (value) { - return value === defaultFormat.get(); - }, - fetch: function (done) { - done(global$1.map(formats, function (format) { - return { - type: 'choiceitem', - text: getDateTime(editor, format), - value: format - }; - })); - }, - onAction: function (_api) { - insertDateTime(editor, defaultFormat.get()); - }, - onItemAction: function (_api, value) { - defaultFormat.set(value); - insertDateTime(editor, value); - } - }); - var makeMenuItemHandler = function (format) { - return function () { - defaultFormat.set(format); - insertDateTime(editor, format); + var formats = getFormats(editor); + var defaultFormat = Cell(getDefaultDateTime(editor)); + editor.ui.registry.addSplitButton('insertdatetime', { + icon: 'insert-time', + tooltip: 'Insert date/time', + select: function (value) { + return value === defaultFormat.get(); + }, + fetch: function (done) { + done(global$1.map(formats, function (format) { + return { + type: 'choiceitem', + text: getDateTime(editor, format), + value: format }; + })); + }, + onAction: function (_api) { + insertDateTime(editor, defaultFormat.get()); + }, + onItemAction: function (_api, value) { + defaultFormat.set(value); + insertDateTime(editor, value); + } + }); + var makeMenuItemHandler = function (format) { + return function () { + defaultFormat.set(format); + insertDateTime(editor, format); }; - editor.ui.registry.addNestedMenuItem('insertdatetime', { - icon: 'insert-time', - text: 'Date/time', - getSubmenuItems: function () { - return global$1.map(formats, function (format) { - return { - type: 'menuitem', - text: getDateTime(editor, format), - onAction: makeMenuItemHandler(format) - }; - }); - } - }); + }; + editor.ui.registry.addNestedMenuItem('insertdatetime', { + icon: 'insert-time', + text: 'Date/time', + getSubmenuItems: function () { + return global$1.map(formats, function (format) { + return { + type: 'menuitem', + text: getDateTime(editor, format), + onAction: makeMenuItemHandler(format) + }; + }); + } + }); }; - function Plugin() { - global.add('insertdatetime', function (editor) { - register(editor); - register$1(editor); - }); + function Plugin () { + global.add('insertdatetime', function (editor) { + register(editor); + register$1(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/icon.svg b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/icon.svg new file mode 100644 index 00000000..d0103e7a --- /dev/null +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/icon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityFormula.html b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityFormula.html new file mode 100644 index 00000000..f5f25b56 --- /dev/null +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityFormula.html @@ -0,0 +1,111 @@ + + + + + + + + + + + + +
              +
              + sorry! Beta版本仅支持IE9及以上版本的浏览器,正式版本将会支持低版本浏览器,谢谢您的关注! +
              +
              + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/custom/bar-bg.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/custom/bar-bg.png new file mode 100644 index 0000000000000000000000000000000000000000..9dedcc678245832448f459c712e72039d36a2d03 GIT binary patch literal 925 zcmaJ=J#W)M7&fg0RizFrNHCo)3zdk!61&YQrfTejTEbCCA~hq9eMwHKedc_@PDU04 z{{SKW0y_c;Rwj1Df8Z~0PUDn;aI$@0&-1*We$(qdIXZlBC`rrkNt4@;yZ3i(mo`^5g&O^Q9vWvFEDZ*C4wzU z&9gl5gE{74jHe{F;P200At0dzFAY!i5*yFR#fssSg4a%sydJPA!@!Vh)j-uWV4AX4H%wD|1awu?6;(WDRjVVz zMEVKX3@EIzaDw_yXJbq3EI8vlL5h-PnVi*R%BG6eXfz59U9Sp6HC@Ks&#Q4-DHR-? z28<+}&=?eo{+KSf1%;>AAwi1cuC@rX6f-7?|I0LQ|`wB zb{z`}1(}c#)#|54-7y@eqlwY3weB&L~A;|0;BOB)X?qZrfIDwvCTt(d|sM u^^g4hYw=6mb)EBJ{&W263$gZZO9!fS{B7^vr)O`AOUZ3_osX^Oul@jSrWpJH literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/custom/bar.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/custom/bar.png new file mode 100644 index 0000000000000000000000000000000000000000..f98ded737e1ec99b2daf3b72dd53012f84a6439d GIT binary patch literal 1067 zcmaJ=&ui0A9M2pM9h6mNuuafs=H}G3Y1%bw!@3_$nyp~U))m&9rpenHw&Z2W+nNoL zO++Vx>>qGmJc@eoq=$iQ2l3!R5%H$rS&QHhM1ASn>R~k`dEfW=d_Lcw@AhP7+}GOG zN>P+AJt1bvdW?KSM_R~#?ef%dvUK899#5lLTvBXEjcKR=LE2E}U=}Lc%Hm5nL{ZJO zp3CFBe2G_)5mY=(&^0W=CSoJ5rKs}|g94n>%>@1B`8Ex7EkVyj<&bO%u&7V0+HiU` zlT%mc)wo8F41*z;Cjth<3UG}D)8X9&UD4%4 zWX~~dJRbKn!r=fx1e_HUD{jDax@!s|bW~fnu#QaNDJliDgcCH0bUy{ds>_;AwM?X7 zjH_4-8w`0V)qt}6f2d*9(GJeSzwsU@?BrG~$Yh~|mTZ+YZnoQVW$}Uy6^!g0LJPGj zP8JbHP7zr^nC3v=jBaYE5xFS-Q3~1sSSF3a5p@v*<6by@a7NM;#Lrt=g0V*l;dgEBchI&=5 z)-aY>sv(yl!7yH9|7mpXh)j=X*2k7?>VpqWGVL}Q>xnJlGr1D?)8bgp{ZRP%`}asQ z_XK`x@%J?Cyjg#Lcw>)R?DcPdE&E2NUcFd5xj~iHvr%wwc(niM4%%!Fe`Fu{?(~3b z=bk06-V{Ii+q!rCrwY5}&g4KxRC~KQB}l%`gACyNk$e~%7T%q>c=z>Y0sOkv`@QW# s=INQo>-nyY!9(TKeSzlo@g}ONh0=C9ZtN{@@!s`Kr!wNB*X!WnmBXq@IQ>f`ZLQ(`N0^xMZ8u223e!VSCdwnYN)#CQha%ErOsI z_vS$a|A8kj-t^$vzp!Ty;>C+6L2=S;st0RGG9Nt8^S<-G&zyGJclY|SL5AH`T>!&PbyXb+EQ;t<5?9v&iK1f2MenNFd;Qju94(xl-#ev{t z7$FTJ#^$*CQ5re!6j3llV?WgRZy!GL!1px%q-slc)IbxzwIrywZ1>&e)UA2^(H&4v zArlA?bwC=-!WgC+ztV+lo^6XfSV8DiRwC8_ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/custom/bottom.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/custom/bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..e3df3d1c4a4291c9f812ac4a35ad4592e1cc671e GIT binary patch literal 1003 zcmaJ=&ui0A98Vq0F&yHMvAGG4H`EC>Y0@@p!{XeU%mtb;y5f2ewlsNN!QQ9ijv~nZ0GTgc+j+2tB<}~G&*%Gn-|y#b&(7TJ z>Auj-Fiej&trX~Zj((k8r|AFHw}Xdt7$9ni%;5^D89rhrEL=uFbBrZaK!&xkx`)OX zrUTl=5-I6<$;1w8L>M-7Jj!O6vGLF|%wgv&{=Tiz0sw2nk-`67&`0d`e1-k}wJy52Vq2t0EPYsYWcil3|q)PvW>*t;W`p zEcTZ;KAX)(8iEj~hrHwp@-T!$pn#tI^FZ>YixYvMpV-jE`LEcAwgM|Kiif^hzvf%0w~zTE6r9$M*e~ zsgB<8@aN&t(a|Hde_-I!3+wys%bjO-_dY#fKW@V<^(^QFf6)77Xz1CE yD=`fWj%>ZYdoMP)Sg!P)??bz>C;ii>nOG;Yu-g6h^ZJKd(e=~R8RgC7;?^H97C9jR literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/custom/btn.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/custom/btn.png new file mode 100644 index 0000000000000000000000000000000000000000..31c0b52f0662a08b3265963960c222f5e72ddda5 GIT binary patch literal 926 zcmaJ=J#W)M7fW^I=Z$e3jw#X>V6BMj`wo8Uh7g2l6Q+z^E8FdVwfb)F!fM50$< z#5_tkTM!z@dE)sq%)kgw!q|X6KYxKB3=DW$cVs6q@iaVHQao68hyHTr>j6A|2pT!! z0ug2&$fL73MY#c2x`@wI1NTAdg0aG3r~Lbu7Lz;FPfhNm7<&VpbCgok)tV>xG7@Rym@YE@I~8 z)i~WR6)c?kG)!1XVo)f0BQj?O5DVsAc;Qmf2Lzw%#nc7V+m1j#~`1s(0cmn E57{#v_5c6? literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/custom/down.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/custom/down.png new file mode 100644 index 0000000000000000000000000000000000000000..31c0b52f0662a08b3265963960c222f5e72ddda5 GIT binary patch literal 926 zcmaJ=J#W)M7fW^I=Z$e3jw#X>V6BMj`wo8Uh7g2l6Q+z^E8FdVwfb)F!fM50$< z#5_tkTM!z@dE)sq%)kgw!q|X6KYxKB3=DW$cVs6q@iaVHQao68hyHTr>j6A|2pT!! z0ug2&$fL73MY#c2x`@wI1NTAdg0aG3r~Lbu7Lz;FPfhNm7<&VpbCgok)tV>xG7@Rym@YE@I~8 z)i~WR6)c?kG)!1XVo)f0BQj?O5DVsAc;Qmf2Lzw%#nc7V+m1j#~`1s(0cmn E57{#v_5c6? literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/custom/top.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/custom/top.png new file mode 100644 index 0000000000000000000000000000000000000000..ecda0704e84186b1f8088cc3a81f0050780b663f GIT binary patch literal 996 zcmaJ=PiWIn9L}7ZGTlKhGI#Ltc2TfNleTX*EE~0HU9lOXE3D#SrpfCXw&ca+&1OZY zI24AU;z1PAfkzMGT~Nf+@Zwp-!A>Gb^(vG3(zTrjYe@3`@O|I!_kO?ctkxmX{4;^LmKk1KVY6j+>YYT-{j06qNCz}xGg}?g3u)e?j=>yWG7$o>u#E6O_ zK!_LP353M6K#Gcz5M?ilh;ccAWN93)_pQec%*R~Cd?t;W}4Jn;%t>r z;#Y|a(sKx$p0^y6)ci9oyr#)H$EUhu;GC*Jroda4DN9k5kPwPxP)riVOe`7Crq7}A zR8~x+;_2~NhpQ4}#l{ZpaLs*gyeBubg6*=%D)y{v*vxvw2CXB@R_|QIo_cMr**h1h zCs$y}2w`LYYIJ9dxhI@2?X&BpP*BmL+{ zb8G9~sV}=bKi8hFt!*saUw=Gu>EXbW+YMo3>ej2q_1!^r`+=0t=iPz)qxxjy*NugP pcb+x3-fW+E_x#Y;i#w3(8|03TmOccd_V@7KfW^I=Z$e3jw#X>V6BMj`wo8Uh7g2l6Q+z^E8FdVwfb)F!fM50$< z#5_tkTM!z@dE)sq%)kgw!q|X6KYxKB3=DW$cVs6q@iaVHQao68hyHTr>j6A|2pT!! z0ug2&$fL73MY#c2x`@wI1NTAdg0aG3r~Lbu7Lz;FPfhNm7<&VpbCgok)tV>xG7@Rym@YE@I~8 z)i~WR6)c?kG)!1XVo)f0BQj?O5DVsAc;Qmf2Lzw%#nc7V+m1j#~`1s(0cmn E57{#v_5c6? literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/edit/bar-bg.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/edit/bar-bg.png new file mode 100644 index 0000000000000000000000000000000000000000..4f9db6bee66f6ae920fbb433cc772c840a723437 GIT binary patch literal 938 zcmaJ=yN=U96g8wET4^N^6hMJSvkgeZ&)6uVm?#@3tR);piKV2(u_uX@wa3^K?4+Pr zBqaWTf`Sgw@B+O}YzY zQIZ9by;?=8B2`23J+OHoixztm)HgbtSZt-k8Kn^tgfvb0RN+ZH6{K3NmTSmzg&``* zGNevc36q0D!N7?d`w{g?2y#VdOcqp!EYtHN1kqMDOg3d=1rstS5+q*Ck5m9H>;KRo z*rF5K$A9wur*L8~BP{fBLKd;h8aFw}Lq(_+V~3L1CgixNVsAz$NoFJht$_w^5B<<1 zX>wg$g-*$qFitd;w}Ol z(t_)4xth3>n_D4>SY!jo{uAtVViJJ$k&(YU7h|X1hU@LjMQ!io3M?5RZ|q-6yX6w^uFKu=uZka~Y&OVQSoSikUmP)0)r@y{md4Bzx^7`$ivd9fz Vl~2EZdb7xHkJ;`T?+zcG{07G#ARYh! literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/edit/bar-left.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/edit/bar-left.png new file mode 100644 index 0000000000000000000000000000000000000000..2f8c46ee09d0ff24cf64b524f9ad08792278bfa1 GIT binary patch literal 982 zcmaJ=O=#0l91nKrm<+u6fv`vBLBZyuU9;uUY_>`3DrStXbG^AVd0j)7yqLV%Y$5|e zL=eQ2HxGUuMDgN94?BDC;7wE*vdeCjfr3M+FJ0Stu!bb>gWvD>|G)qL_ioS5oF5)K zF~l&;aA8_2((w@ejtm~4|M{(*XLLADa%D1ytE6H0h{;&Ef~Kbe;X=owY=%isg`Q#75djsnWV;I6e7nH{+fvwtlrHF=ifZ=snvdqz zW=iH--IOhMY7(SFNCg~33=lfYZU94tZR~LfuzN|B^;w`|AAuB?jGKZe z0!iY;v6Lis$y z#EY^lM;eJloFd}Es!NP8?gpb>1q}tJZ+pbXE{GJ33SJ=!OEcX&g5&jM-Jnw@S};B| zJYM94=ty0luKyqEI6ZVgifBLIe+mbsRS)q+6yO!#q>ZbNMxi{Y`p6*IFJZjgt>SDA z6CBjA2h=$UoL;b93pau@ZM?3-f*TOSHBmuRSgOF;wgoe4HZzeQ&*r3LQWSH^tUMuS zgp@cTnhYN`_OC{Fx2SufY0tKF(K9}BsoQ;O>sL>7-uMF|l0NeQ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/edit/bar-right.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/edit/bar-right.png new file mode 100644 index 0000000000000000000000000000000000000000..9772c54a68519446ef3c4a307c7c6477f390086c GIT binary patch literal 994 zcmaJ=KTOn69Ik?3NI(okBa1J+0Zq96z3bVAis!Y!B^L2G~n~S4^qfr(Y7Y7yw4GtzI8Vw-69(SjMXVdom$@hJ~-~0W(cYAtjqPJ(L zhoY$7;-pq0V>kKwj~*uft6N{6k>M29D|iOYdHIS4j;+$OS%WkD0<1ZcYXO{D zn<`stiX_<$=CiWS ziNZNCCrEN$Z*nzcExXXeO|ISIX1TW9#0suYB5N>kR-io|AQ#k+tT^p+(c0=YxOUrI zGJ0DsOOj!e#{Sjl<`!{JGHuzGELz5g9&vj>Z0+t0eI{4pT2afF;}6x{{r$0yuDPcV zKfM?}mLE)|hEL|$$JD^Uz`c#m`<>fAzJJ@;_;~r(-p-x=TQ~2X-n5SI{oLw4ab=~i qZ{*4D?)rrXN45vcxp!}0Q-`{!N7vc+(FD7h+`6JZr9HnmxBeS?8#|N$ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/edit/thumb-bg.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/edit/thumb-bg.png new file mode 100644 index 0000000000000000000000000000000000000000..450faa2763dc0392583e797081f2ddb2be0c94c3 GIT binary patch literal 941 zcmaJ=O^ee&7|w2?E{h8*qM)ZS1yR`Mqitr}&{*0ebpxi9Ze@EkO{Q(=CKHpXNsA|M z{tEpC!k#>M@Fs|Q7W@-}KfpTaHeCpdOr5Pd*S@rcA$h?u5>hX@#+HAX#TIrHbAQJrCOtlJ-uf%!zXvBy~{ zhD*GFvKgk{NCL~AA_9hJ?D`7(^TS6LxQ@b}Nv2>1Dw?<_ix8bII(>UFwQCOBcm(Q+ zOa(kdERcBTek3OfyV8~EJl*D5u!4}O!d@mdFuOp-Ap#OtF4}@90th*=B0(q~fs!DW zc!9pKC{|<%%B5qlepnhUbVhPdYp-L`mBLO431ps+%P-KU0KwRvDRM8sZ8Bti8>E#i;U?b~C>oU=T@rf1iA}6Fr%7CW%f2ike z&=KjOt9<_{9QEe`;(I8~7Dcyj5?_b++eH*~;ZYvAH(0vWg~Ypclh?k*ZZIH%L@bS<&PFSyVsd` V_u9qNa^YoqfegK)y=y&t^#_8)AY1?d literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/edit/thumb-left.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/edit/thumb-left.png new file mode 100644 index 0000000000000000000000000000000000000000..01b9255a2b102faaf4f70ff8a54aad65b71bcfae GIT binary patch literal 983 zcmaJ=J8aWH7`FOSsZ>-61_}cwmjR^4j-A9IrG6 zctVndWgtcck&n_>iU@I-kf4|ZgNLQjJhKLiYJL!lu4J}BhzohX)9G-X7>B(&FQihb zP(u_W6cO>e4$*^%<1Y;rROB0;V0@svyud}n zBMpI?_J62tkI+6TqSJi;DeRZJF5-*G$8FD`jjJt%pe2CWdJ*1*jZY5^d>WXw|D-1sW)DTsnWHDS52t3M Y%>Cb2T6gx>FN9aEklRpStyX$}0Ls}k`2YX_ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/edit/thumb-right.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/scrollbar/edit/thumb-right.png new file mode 100644 index 0000000000000000000000000000000000000000..f74673a3a57b3b421d8c0310a992e3f73e804980 GIT binary patch literal 988 zcmaJ=PiWIn9L_cz+hnkVhdB>EG8hwV{&k7#W3g+K&K1lkU12>gOe$ z5A)zjP{ErF@uVmy6Az+zk!>e$9z1yRCc6vsrE5D6){x}A-{bqf-`{tyuySL3Y-)^Q znDP9wUZm?e`b~@s)Bkt!=7=sANv=#*ag{X905KUGR}jd%<_0Pv({A1Rf)*HNh;>S3 zQZ{Zv3%i^dW4OrmDVt#y(vfdkbwoe~Z8)CF{(Ap`1&*zYOWw^mBl zR^3Y3Z2CG_h#(bk5ivpJZh9e%RJN@P={`Q@SD^1YXu3 z18r3SvuloL<7RlJjW-OK_d;TN7Ru`?OBFcBv0+A#<<$I=o>SzEDCUy$x~6MlR?jA> zDW;?@SI1VvMIPyL?K5t!FE<_q*QcI!6gan$y%b;DBu zoL&!24f z!VNxYd%kCU4&Rq^#!yP}o3i1T^#ObU&1Umkzgn%Ts`?gz{#%>PhGCd*Lw>)%(P+>& z^a^k~odDG9_2*C|5&^K^?^RVb51^Em%Vhx5>D1uwb~^x0r}KP1TLMr@jKQ@a{z)MXs?w@g%Hy3_uX!HEEfBLqvCeE0dP1Ry3_0R^7;H= zFi0koR*wow>2Np%FdB^vzPA16;V@HVZ6C5MKbnf71Ofp7m&?T}pw(&t2!%ohUzTON z-5w5ytpX%T(hF_~Efxy^+wIo;BrA%tUaz%hpU-EAX0zE~F!=00ih1#0bUYs0?Y7tJ x^>{pmLLrezJg-?Umzhk)B;a%De*k|3@CD!kB;@88S<(Oi002ovPDHLkV1m@;_M!j) literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/alphabetic/bbbk.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/alphabetic/bbbk.png new file mode 100644 index 0000000000000000000000000000000000000000..a793366065a08f1d8e1e50ff1f2a7b20e3e8d94f GIT binary patch literal 519 zcmV+i0{H!jP)6ov1^C~9FL z1cTTJ0l|oZNWfkTi(nyQD}vbC+4=x>mih#-5m7;`t!xAXX+#@;ili5fdbikRSy)_G z9oa2%%3+v~Ip@w{2qMBO#lVYY0sbDq-rS+RskaJgJKj=P(HKWekt0D#x)6-CkI zat((=yi+$U^85X&s!Ecis%ouPGYo@%20YKN*J}Vcolb-h`hX{&`ahVW?>Zij<#O3H zO+;i__Iy6K+ikboP3;B_ha(sa?)Q65(1N!pO2bFgpkAGplO;YigvqwI-LrF zKp_J{$k(`sfJyvcmW+jf>9`!(>JDx6%As)xyPBY|dQ4nx-&C%U@;c!F+N4~@JM2|hKovQ5y zA6euWwN0(WtZwI*MZ{b`EB0sF!~Oh?jBOqF=6>2c`zgbJUW>lPt5$V495A@HEjM!7 z>s@M|PFLUjp7*?R*0Lqsmo7y`AA7T_&&ZHbU}A9|vw%|oUt?w3{qI4i5+x*(^|>vc z`(D;L{pqAw}YeTu7O>WQx^yxs=GX`E!fhU7ppI@fAe!M>S7g7^PXe1?W!( MPgg&ebxsLQ0MLMa5C8xG literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/alphabetic/circleds.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/alphabetic/circleds.png new file mode 100644 index 0000000000000000000000000000000000000000..7f455e85c607d3634d43780d2c1ef6f6789364f9 GIT binary patch literal 874 zcmV-w1C{)VP) zI^D>~2!5gG=jVZefv&DDkH<4RJBtunU0ucVrcfwmW@d^4gu~(b`g&Zsxw%m)m5D^6 z@EVWDO(qin?C$P<`P|;#7Aj2`P*G8FaBzStYPEW6YYSJ>=`;ZB?d{=WZ*OlP5D);w z#cniwnY2uh$cR^Ye3xq6jy#lQ%avySuw_rO*Mx!^4E9&1S2tti%ceP zd3m|V<9T~~;{rN5Iu;fd_)>%r%IEWhD3wYxnatAClH2W8DwVlhZfxLmG$KL7olT(GmVv%$f^ zwzjsivNEYuT3uajG#Z1!Ab0w6jr#xV`0oQg0eA0$40-K#w68ju5&+~b%VHmoupUbvwB>=K41As6L z_kBN|Wmy7%<2Vukp63C;PeB9~ex77XDFATJe`%S1za2>_wQXA!01*X6ds8Ap$kmH3 zz~_LXD4M2`(5`*o2Y{~YRP`d|5*?Qne_1aBjtMgi!@YBwCIB!^Q$h|HW5>=Q2&$^8 z>pD%-!;|N^gn@&I5340f5|LOU__O1jGseboB!pO&700orX+mxB`a1r7zzt(gPYN&R RA>;r6002ovPDHLkV1fyKj{N`t literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/alphabetic/daleth.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/alphabetic/daleth.png new file mode 100644 index 0000000000000000000000000000000000000000..ac705c36d25fcf682b8c89de7e79535b0d49978b GIT binary patch literal 305 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyvcm7LGZJ;(0)!3!W~HAs)xyPP67~Q4nZj-@3tY<^K2kR~}qu zjug`@jlF)n@WHm1Hs^OV)ZQ;-jLQDvX?E-Z)3)5htR9;3|C*jJKVkX(hWy)erzW!` z^e{GT{if6MSFl~l&~xE?D4k)Ej z6d8sA0IgQ5kpC$vpzC@Z$9bHlX~`aJHk)3rC(AMbJRT24QA+jz0DRxi@YL$+81Ee3*PI5oL6^(lgAPi(BQh`vJ9QkxN2n?ucELCjYdz{F+=VP(h?RK;M2_D&0W4>V2VIIh?0$+9fVvSnF3&jT2ZMxnkUN7ZVz zQmK56G#ZV~W&= z03wk{D8O#F13;3b+lt5I0K6BGKftmqXUcAiAP4{q!-N8`EDOLiO}Awj27q?E9SR_d zA^=_2-PUTg0?_St!`_2ht>#X9y`sfJyvcmE~$^w-YbAYeV#6kAs)xyPBY|UR^V|J7Sz>Kk~`R4EtCIn-2*kN%;RO6 zT}KzH=Kp)B$r(7O_>iweOdE^69*5!@=g(87ObW`9wBFCC)MvQjqzc1>-xuc?C$DFo z8no?{+46hU=Pm2^C@$S{O^^HI58I5jlF3!?w^s#ZyShkS-Y=H1cK_XFhHig)1P)nl izxV2kz7iwn15Pd8Q<^XI3F@ArFe0(q%gt?qWa=lNEv1pt%D#C^Fpz(t&M0N89cq5wqH>2x$r z69^!pa5y{|3`c>Sj5+OtA8}Jev@A=KBvG9#%ktrH@YBiL?KYRo zS(fz}1_FWcc>J7pyC!77b1S0000l;a+3rssK|0sd0g zb@`t-j&)sUS@pyIwJ7;$6(0000< KMNUMnLSTYW{*!$G literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/alphabetic/hbar.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/alphabetic/hbar.png new file mode 100644 index 0000000000000000000000000000000000000000..8809ef3681740ad6cba9eaf95f4746247111061c GIT binary patch literal 516 zcmV+f0{i`mP)d?=6rY}-~2v_>_j_LgLKY1M14)ubqY;43W;379Iq$k|tyWVMC1?h!szxFa+qR3vVk(t# zU6=E>+btT6hL8afEtg9GyvFlg+%A27ygmZ|U*H?}=e;lWs))z{0000Z1Z@N>!PZyj1H?*EP_VH|{=h;-ajys*xfJIs z2M6a=yTk4d%{AcWvI@qu5)Ti_oEQ1>h9klZ079XV!mQWpLZQI({9>`t!6E>Y$pnDOWQxb*k|c?uSSpoRmVMQt z>-9LPiG&Ur5JDJ+ zp(skb6NtrPI`lx6<-_5S&1Ti)YPAC3^?G&4px^HU5ClO@b~+u!G#xTf0??2ym&<50 z>eB;;VKfbpWf?#&ms6&j&F1+GlmNb-AO+QG6+k|p2QVIwN2Ag67S-!@0Nrj^P5S+Q zmSvT(AP6rtx!3Cf2#3RJ(&O>aG_ABc8jZemi+ny`u~^iQ&1Tc#aAY!>%jJ?xCVxJ` g@cwwc1^&LkCl8Po`2kk;QUCw|07*qoM6N<$f*B(1djJ3c literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/alphabetic/im.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/alphabetic/im.png new file mode 100644 index 0000000000000000000000000000000000000000..201ec05e4bb3069cfc4cfb6853f389e5bb63bdbe GIT binary patch literal 571 zcmV-B0>u4^P)5et8S zR@x{jf~}Ph5MpD}CbfmyX<=n+C1Mf8Sc$!zwb~dE5fn_P1Vj*w5>WgWbZ#-Qg!LwO z&Go`A_;z#749_|9&J05!gy1Lj3w~H{!2bi#H0^%BzaF3{3d1nTWU^AJ@I3EyI<955@ zNW0zM@AuCENRqUuE1%B;0LO6%q2+SvcDv1HnwsqQ`xlFaSvHr;O{Y_z&nF0iD2l48 zn!agf-8ETG?`31 z9uELCo6VP9LEKN!E`#kTCKiZMZ7;=Z@|9~_yG6SF_sT%SX=-A002ov JPDHLkV1hqr{M-Nl literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/alphabetic/mho.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/alphabetic/mho.png new file mode 100644 index 0000000000000000000000000000000000000000..291f75054e0feea3b0bdb119589c534eca78aec0 GIT binary patch literal 573 zcmV-D0>b@?P);oVDL%dMx#-^US}8v!0mQxHk)R%S!GM5 z(sH>ZI1mWr^Lgzm%JWF4)A!2lc6-m-?e_1~p&ik5I#qS?c-&&K+_N0VscfN85Jgd6 z4>p@kI2A=6pUs(~xyisZ?H^gI22rAdyIDvSk18JpZFf9t;KmQmNF#{dT(zAeYP0(?7rb zBqftcMNz8Ns?Xx(^9g|EatR<7i{0q5ECVnM!zq9e zl1`^5lgWMG07#Pbgcf}V2JpB`?jOyZs;Y{jcs!nBvB2w0H-|wH`gVAUd3%;$4eRRQ>XKBqotG#caac)Q)YT<-<-dcAtR9tZ>gghC-lJ`hC_fUfH| z`fxb(`~3h`tJUuxd9&F7Xti4Rso88sQ=(0p=Xn5&#o|6S7z_YZDiue72Q}7ewd-8{ z9-wI&fJ`Ry^?U2>%9@f;czyarCcZWKFH;Ai9|wC6iw6m{XWaG-ENnDUokWvul0H@%kuGf3#n2ex8TtxtAjlLhzGP!4K;f@c#q8T|zlPp-?zJK8{AC)9G~C ze|>$;FpSx3rfHfWi0?~SDM1iou^2+A(P#ibybFwDjP%+PAJZ*OlRU@#a+ zat4C|4&B||t-M5TP1S1k)zy_C2%_ifQnuS|k|ZOMh}-R6eTn=MQxw(hc11Ij$?WXx zAcQm;&CAOR$8k=lv)OD?6t%X>b%AoZd~k5^{{FtZyDRxs^z_u@@#yvXuTia5`!^4fTnEx^0|0=2 zzmH9y&j$cJ&nxd>rHn@7@;a&2YUR)Ma5$8BtX8Xdw%Kd|@bK`U5P%;`p69Xo^z;M( zEX#@skB^T4V7J>90!WgqR4ScL2b;xW5dbbOF2n?f!vO%zW)t`7a=AV}J~kdQ%d**Q z79m8_bSjlv4!yp1wqa4u`#7ucWNSViAwW34%B~ kJCnJA`2Dl{1^lx<0meu{g?ijT^Z)<=07*qoM6N<$f{6`4UjP6A literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/alphabetic/wp.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/alphabetic/wp.png new file mode 100644 index 0000000000000000000000000000000000000000..23f6541296fc04941c3eb652a55349b9b7cd8a70 GIT binary patch literal 524 zcmV+n0`vWeP)f(q&E zM6j_4!6u+s36?&91Q9_jEW#ibO2Ed>#wYLrv=j?Ltn9oXsbgU}3$c)BVZ0DBTMP`# zdWlADmi*P3Gylm4;hdRqVT|FE`hpM30XTqv1W;8qolbAJ+h+l;M<#i>Tnd6PnM`PA zJRWyC9n&;5O{-KY;c)n7F@8XyP>9Bx%_fyf_4|FA@pwG5+3Z%WHK5z=7K=p^%d#wr z;vYk;R*OcX_5q1RVmh6grny)w3WdU@q0wmE`4iRvTAWNKuNn|SZvY^Kj>qFw1IKYJ z%ibz~s7;&AW*`u7yWN*tr_)JMlw2-nzl-AWH~<_D2eMQY#V`!ITd&vef5aNFTCD&e z7K@Q(Bofgyjl{aH1Hf=Nd9>`o7;k=kqxj43bz71cqUrJ?tz1vMh5PN8-U? z(ChWyd|Z3I-u-@0NG!|x{r)!tc%IjFT~*c5Xw+`EZCp4m=Vj*rUe*tN$eqU2O%6i< O0000`sfJyrpBE%uH`2RWe72TvEr5Rc<;rv>sJRuE{ruIa!eG@+sS(E=eqC)F6)0CrpU zD~^R1tQgq0vrn>J6Pb8+Rx0Or7e2lCe~;^&4xibs{kU$oh1LS5IyQ;6M497@7XR_I zc+TLU`E-u9&PnYL_oS0AMP;v@l6AXmUb@n+rl!=$U;FAknHY?tv)68oWOZ*4aJpXl z`;Uq5O4p7VZ?6h62s(2d|LS@6q;-cOmtvo_PD_Vj+zaNlTfhICKX*^=>?xmA6mH)a zIxy4l?)ldz4Sn65kCdN3wtFop00i_>zopr0K52ro&W#< literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/circlearrowright.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/circlearrowright.png new file mode 100644 index 0000000000000000000000000000000000000000..d29116286697f520bbbecf48c4710b0ef7a81164 GIT binary patch literal 351 zcmV-l0igbgP)`sfJyrpBO{oJ#^(;W4U!E?GAs)xyPCeM$rXbK-xVc=DQMz!2eJDza6liWM0GhK2@XdvBLW+?3J616qt<~CY*PFC-Hb& zZi~RVpJyjNdbUd9c%ekwCLKnFV;vo#p_)ru1jHvFpX$Wn#F6a7@$mW1@AHb+ZT0J) zeEK$H!mMS+%~OIjzgiuTxLg{0>$1sNoAc`#oH$Bj$hvv7)+X1{dQ^{;1Uo@yxm qw|W-mT*j_H>gf(_DF^HsY8Wql2sEs_&SeD*1qM%7KbLh*2~7a*^N4@| literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/curvearrowright.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/curvearrowright.png new file mode 100644 index 0000000000000000000000000000000000000000..265e1e018eba5388b2fce042a9b5ae1b271b7d9e GIT binary patch literal 338 zcmV-Y0j>UtP)HMzi5;sT*t|B~Ez&Y2pZ6e^6Xsl8y(Y*6K zhhYGKx~{FYSIRukxl@FQ+qMBf+M$$Uj9m^y?E5}`sfJyrpB0loK5Y}`Phd7dtgAs)xyPIKgCQRHz=>`h=~cV!YPV9;=25-V^BaFT6c zRw>~xzI``k2J=a|UwupL^;?#?3Qe>)=`GX7s`Epwr68=K;}4ro0wZ@_;@aG`wKC@{ zlY72TZZ?xhu6WOwu$GmWo8m66#^t#z~QMl-wQ^#we**3xg x6N6TL-xvRXNB5lKsMmk1PRi?x{n`J3*V0()xR;#7S)fZ9JYD@<);T3K0RUldQ}_S? literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/downdownarrows.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/downdownarrows.png new file mode 100644 index 0000000000000000000000000000000000000000..457598cdfa6d802453d64fe782bd0d52ec574524 GIT binary patch literal 268 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBWj4Jzrw;;!R(rZQhIkx*d+j3UVFdxUgv+ky1Z9p2-f?g*V7}{c_W*AR zi}}vm2kb<=JQi@8WX8X%|MT&Oz{7%>#a-5)1^&5V>m%Wx@!B#aTrJ{45np1=3 zuQTXRS}W?bWXe5WC7>S^9zFbF*wCTa;(IeHd+k}_$RFv)4_vQgdNc3oi`gOj8-dPd N@O1TaS?83{1OR1_W;Xx; literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/downharpoonleft.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/downharpoonleft.png new file mode 100644 index 0000000000000000000000000000000000000000..f1de8a25bcc216fa1f6ad507e3ec99e304071537 GIT binary patch literal 190 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpB1>Q-?j$J^ZSWg$n5Rc<;uWjT!5WwLYST9yAB75-cKdrn4vu7x!&XN#t zs@Psvz$G0XdNGBam!08&t?_KuJF@0Ly$A9cL(iTuce2%1a!GlA_RQ7JsBFQRta^*L g##iiNsFAl|Ob=5u$~<_b9H^MV)78&qol`;+0F>i5VE_OC literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/downharpoonright.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/downharpoonright.png new file mode 100644 index 0000000000000000000000000000000000000000..b94a0b8643e221b70bf529188b36e5df8afd79be GIT binary patch literal 191 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpB1eFqBp>qSqV;+g&Y8qg*NPgg&ebxsLQ0J76UUH||9 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/gets.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/gets.png new file mode 100644 index 0000000000000000000000000000000000000000..8d659f01a2c3ecc6e43c8a15337b137d15785a00 GIT binary patch literal 252 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBevv047uA76vproLLp+YZof63FtjObfKU$4}-6KO*gww)-+v@ChIvnmo8}lR<@qo$ ztlj#OCA{gLwNjfvMdRnYyZa2Q-cJp>cI%)~#|eqgMtl0VY%f`UT~zR5lB<2}r^!<$ w73VE(n7Q>@HS5wT@8_@FlP%cspr3_*!c~@k0R=wmfX-y_boFyt=akR{0KlMID*ylh literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/leftarrowtail.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/leftarrowtail.png new file mode 100644 index 0000000000000000000000000000000000000000..d36a75aaa41615c556991242053ac2fdcb60086f GIT binary patch literal 259 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBRg0a=3*P{R7J0fjhIkx*J2jD$*^sAoeKM1ls*u)FJ}=QLPO2eJs&kr; zIBG5AGh#gL#%(R(e((H~iSHd13YCgtRvs_h$dkapd`H&c*o|3Bf7vr-t&MKDc8jf{ zHz3Ow8$9BlgpBbH<^?GHP>yz|)ClkdaP1k9y9h$0Jm%e9U z*z^5)rQR|Y28IiN`sfJyrpBS*748lU$%sq^FBxh{y4_R~>m73^`l^cePDuVNp?7IcY*eOC)p3WZ%Op zKd)E$+^54}bW{1Tpn^lg0nvs9-l6~B?WnfC%FJ*k=Y8+vCy&$8LQOeR(p+Siy7ebB dFfy4l=)YO(B`{0qaV*dh22WQ%mvv4FO#nCtI5PkM literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/leftharpoonup.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/leftharpoonup.png new file mode 100644 index 0000000000000000000000000000000000000000..d9fd9f2d0636c9af03a1c431494c0e13c2283411 GIT binary patch literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpB8IyfeH`D@!qC8z3Lp+YZy&A}Sz<{IWVOiURCYB`)$~spWh4PrDnMQiZ zPrIYvpubaGt)XyJwoD%bBNNN715w&aQB2!bW`!=i$Y-$mjLZ6P2bX<)58s`)p3L74 dQu2@CPT1WK$tkV+H-WY=c)I$ztaD0e0syFuIq(1g literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/leftleftarrows.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/leftleftarrows.png new file mode 100644 index 0000000000000000000000000000000000000000..f4cd7c07b31aee31c45fe8438fdcea03acb4c3ed GIT binary patch literal 269 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBMJwZ@SC0UN)_A%&hIkx*JI$AuMUkg9ajF6%r-cUJ3YH}g7*u$;CNS|G zaQto%?ooEwY_e~~b+sDK_g~$GCO)|0ZSb0b@4P-T8OMsp4%i2N*vv-}|{OzMud6SqGrI O89ZJ6T-G@yGywp3EMf%! literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/leftrightarrow.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/leftrightarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..4d8d86b40de8628cb7e90267bc2d6a2c529edab7 GIT binary patch literal 309 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBK?T8wQocZ;E1oWnAs)xyP6-rjHsEPXG-tGMaC*d`@?e3`gbRlqWgD6w zEh%N-3u3={JMNlUPKYX{SZd+vV~TRz*QGI_Hx z1nw{P(^Or?E&JwoU&loOrK`)@bfQP;ZZCv>bC z1TN|_7=N#=f4=x6!}A!gC1<|0n67=ki%ILjeg^$pS6QQfP280Y^dEz#tDnm{r-UW| D1#5J~ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/leftrightarrows.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/leftrightarrows.png new file mode 100644 index 0000000000000000000000000000000000000000..6f0717c7237f5b2bec9a988fbfb65d0e326b2586 GIT binary patch literal 294 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBWtq$WjCKQsj(WN{hIkx*JIzt>hysu6>2q8wTD&@#3xZ@y0s=T6FmQVu zV6<2e8X%LxU(I@I%F_+Tf3zEq`#Z5Ubp-qGU3N~Yf$>NEfkGKsMz5894DV}uCK_Jj zP&gTx(j(|paPBq#qA6qw9JznS@yrR!?eDG4w4<3BW<0+cb^G+eaK)CQ18Yyu zF5jTzZOOpUV|ZTnO2%!o=P`MvcbCoi{MqL9=Qn$&2Q9n3>u%$+h84jc<(o`)US nweEVUDAS1_+jtHzd||I)*fAqjKVn5W$U_XCu6{1-oD!MN literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/leftrightharpoons.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/leftrightharpoons.png new file mode 100644 index 0000000000000000000000000000000000000000..10a057fd01d2a79f6b691eabe4126aeeac1bd24a GIT binary patch literal 268 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBMV>$P4zWO?)t)YnAs)xyUb)E2A}GN2;O=R$1{+qSIX1Hmjr$$EG8Gfne!X{IZs9$ZV<#-v zU$&e*fA06VY+eSAh39&cdN>vLe>F?!k=)DawNhY_c*W%zac8v{rUbP~CH71W+RLzX z%l=Z1gHf;NNK0Qn_hgP_GCy}3qh@MPq2h--f4?n!`@V`q)akFCu=vGXy%D N!PC{xWt~$(699`lW7Yrw literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/leftrightsquigarrow.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/leftrightsquigarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..d515001e032b759a11508f71ca4c26085d3e2ac3 GIT binary patch literal 346 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpB9p;;P%8fvwpPnv`As)xyPCdA`MM0n~@$(_kb z3h=ti#&dYW$zzk}6xZHgF2TT|c<=Y)Yt{Z7j18Ng#%x=ceS6!-?Qy~q$snkidcE{o z6vKikZ2|&LiY#853=!E|ubo`9)$Y`iDVI&&{yrz+J#ESS@0kKlzLz-^FCEiZ8kMcs z64WIy=}}1ifhj@9W?Wgg?zR2e7Z+^KhlW}{Kj(SQ^7)^jnX!Vq<{U4KnWlR0lC=@D q2mem?6HFfZ%Y);RGNZFyiIFnGH9xvX`sfJyrpBQR9!s^QHrZ)_A%&hIkx*JJnW@MUlsC`dnclb`J+8j{}TC2N=a1IE5xK zXfUwvd^BtC{JYv>yY_TRc1_ox%;0<^SM~Qc384uMEaFW9hh&)N9k4tu`6m6T_R=ub z7ki7(Rlg4ws^Ka+=hQLB*sn=;e)ihZ9zh0%2Y%r#0_S#K|5>=F;9Rd^RQ9!7)=k@g z?Q^bt-)p!z>PxlH(kYrtTbqKqrW8GtV{lkodP>UR*B4I*CZRviIcMnmteo|B85_{u N44$rjF6*2UngGhGU!MQ~ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/longleftrightarrow.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/longleftrightarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..fe3141daa36519f3ffeec6c0adb5b1e11997cc2e GIT binary patch literal 297 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBF^zy~mK{K$6P_-PAs)xyUUL*}Q4nBDxVfD%BY`E?fmParS^0<00^Ti* zCI(Gr2iTmO>-pa?TE0m=viHON8Ha1~+4wjZTu<%kI&#v1&FBMr!u@i;-H$EyeBaNo z)|7q2wWw@;RTjfzTXMPG<`jFa+)%{0YE{v>#_8)`_ZS*FxRl18|IAa?;i0*8-Rnvb zhH0siZH`_yP0s4-AFsCeoqTQA``_gy!rK|r=jU%PSSO-g^=guQ)iQ=to1QQ{ws5QN qYs|epLs%d%Lh$G9NsT;9*zG>fVaZUfn5GT%6N9I#pUXO@geCwXa%=ej literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/longrightarrow.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/longrightarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..ec988e1dfdb85a9d4fbcd926301d305a6f431d43 GIT binary patch literal 285 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBF}|j}7A5^Z91Z`SV{b`i>Xg;mo>i<}&Ab<*a4XKQnr0 zDn6R47nwaZ==3HIMXvh|9c_sP=dNa5+_kRuzI1ZdRt|@KXa6st+iTfMEt_0 zuOsqD0RR!Dl+LL)T-0^l(kCkkA$IyL@z@*y+O|D=mHm8c?Nt@LTjj5ho$pll*fjhH e0T2N90z3iOGGMJo+Gmdd0000`sfJyrpBRi^sYE8>7cpFCY0Lp+YZop!PJumVq;=T*iNY&jEh4scYow5IeBcIqKC$$=welRy=t3BHrKkaDs z`YA@oJT&*uWK?2eFwS1<%)ua#{6~e=?}UW2OaD`w^N%e)6{<4&UbfNi^vM4EO+~O( zAn5xW(@4#!oqm@~ZZIzuQF@o2fBTzR)Y4<6J%S9ccIDmvw(aqp*Sqvu3(rMn|K4~1 z_Oc)^moNUiW>3qV#vJ=))s&NGYbP0l+XkKID&?5 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/multimap.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/multimap.png new file mode 100644 index 0000000000000000000000000000000000000000..c7a0bb8acf9fd2ddd635b1fe25894f80cb369d41 GIT binary patch literal 254 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBZP^@!4ppGgTu&Fr5Rc<;ryk^GR^(yvonjZ$^pe4a&DX!MWVrq~Ec}C8D#nPbw_>UU$z!v-q6;w%@z&>|+WOKRJ;vOv!3t y%G#|{E=d#@oecggxLat?WXS^zY=0OZFfL}h%m3}P`sfJyrpB32QI6j2A$md!8!tIacdXdzcX`X}UCEY(`!X07Y;|*CkT|~a{qJqLy0(u}=RIGwYRQz#CXw806qy@> zvLxCRmS-$akKE>a=-%TuXLhao9psgn%Vk&V9XajvrV4?Gmo6zw_lwQBsISy?DW2ob z3xC#gU)-7a{>B|xa-ZYJ7wtyzUn>uY{|&id(kpHyxYOR^W4Ive|33^|3QlD*aXfxN PpE7v5`njxgN@xNA(oBCq literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/nleftarrow.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/nleftarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..df714e174f027fa32dd9eefda881425fda6fc707 GIT binary patch literal 276 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBDU%oH#eV~ZHha1_hIkx*JJpewSy8}sdK&8k2F(WvItq;JEbJZ!7+*7R zMjT+YSkN9PwLs@~%4D^<`sfJyrpBX^wllqilgfdp%toLp+YZoqCb;hyqXB?Zw;{o`ubM4>dQ>16z?NE7o2(eCXiQdatB2?e%hRg1zoet}5l{2AXp~p1H^H^{!_-uFZO< z-D1#}%#rBNsc5P9mAAog*_2Z&i~EAAuG+-x_2GE9SO2x4o2IJMiKyA#x3?wsSU$gO zBKxa-SM}2p#UnQ7+ZW&6&St$}O5Lo@^kdIltG&JI$7DvJ djei&(@b0_wL-Z$$`(GfJ!PC{xWt~$(69AAHY)1e9 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/nwarrow.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/nwarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..bf7b7d23d8897a32cec3900c15a438c4a85ced3b GIT binary patch literal 324 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBNzDaMG#&zl9(%ethIkx*d+j1`vw{HIgUv4)@(x%s<~-8)8&3j%N+qq)h zYk{WXyvS*VGJ=NUD;D)W+nYbjE&Fb%EQ5fc;MA!a`UB5_IOy z_rE5-Iwuq_YIV!-Y*(UNMdk(`NvvZ7P%D4Vs{kv&5V__VFriJR0 TVx1R2?=pD0`njxgN@xNAIoEx5 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/rightarrowtail.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/rightarrowtail.png new file mode 100644 index 0000000000000000000000000000000000000000..27cdc5bf6850ee18e46d9717e72d5e82ba6d21b2 GIT binary patch literal 250 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBHGVDgb_Jl&Oivfb5Rc<;uWsaJR^(y5u=_<-Sc0fpBFkpR)fLQcmiZ0l z2GSO}Tn-9PgIxZpO3Y(8IcHUs&CKf`3wR6;H2i1n$jBB?yT>fBaqBidg+~`I#JQ*( zTXA~kmHCUyd|fn`3LJW**wHc5Tl3!U^B=SK<^0`VaPDjO{!&+l3v*vFGbkv%b~v~5 u+AhXB-`848zO}1P$rfdkNI1aXXs#|iJ5}t@ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/rightharpoondown.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/rightharpoondown.png new file mode 100644 index 0000000000000000000000000000000000000000..e384cf845a1a22e8d2297cc59074f3fd7091f31f GIT binary patch literal 194 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBIc}??{|^C$5`Ysn7Q}h3f9G9Jy8Z(2Rk-2JhV4U z$j|p*W%={x&xqbbd5oS4_V)Gv{`}mLqRG36nVpY=gF{6{WrCQ?5$5{(|KH!=e;jzg kA}X~Hq<;mg@mdKI;Vst08G_DH~;_u literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/rightharpoonup.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/rightharpoonup.png new file mode 100644 index 0000000000000000000000000000000000000000..187e1eb24d08e9fdcf342cc78cd033850ce7741a GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBdB(%s>T`iY5uPrNAs)w*|NQ@N&#cQR%-nl$1?yt5o+yK?g9RHD6crmA zy8cgT{QLX+_3PIk2Rf|emywaNtNF1Z;ULqcnuPp(|5d&}fBuZVL dK<*U`4DIIASRXz6Dh9NJ!PC{xWt~$(696muJ)Qsn literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/rightleftarrows.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/rightleftarrows.png new file mode 100644 index 0000000000000000000000000000000000000000..cdec5d9e416f3e0e851b00cefcd52a767e51e9b8 GIT binary patch literal 278 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBWj$%lWNV<%R!o6Wyh*ymfW=y=fkkZoMYZv~^nXKigkUVP={?N`7tDjS`he4)XF~Jh*%FwMR@f-x?Ec+~pA$DmW&Q zobz$fm*iDbKHV!%{@x`sfJyrpBMdk2ywJboPEuJopAs)xyPI2UARuphuxRODohq;NVfI)*n)5GDA)d42I z1B@06+T~6MnWga0{;>YflhhyeY}>D0m|L}Q_Etve4UDfF=6sfSkDhF(w$#L64U?DV zoX?F9@5*W)>oA=6M|G`fvQ7&F!~XR=eM2r8h9(X9xxx2 Wo6oShW~nOB{S2P2elF{r5}E*SM`iK= literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/rightrightarrows.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/rightrightarrows.png new file mode 100644 index 0000000000000000000000000000000000000000..52a7f0f0f1769315be59ac067bd19238f51e4431 GIT binary patch literal 266 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBCDF~6yW@aDD?MEtLp+YZo#x2PqR8W#xY=n!facVO=0^-N3XI&3TdW+I z7Btwt5uJ3C*OvGHFXwo#Tk~HTwoSU?&H0*v?}224K$8vw!@Ac|x02gCG@jdR{i4+^ zuDXmD-X@e_sg%bIcTPa*77%WWUbW>ui^hzBPhsOme9k<@chn|+V%4k zld|6~H)Lg4Y4|t&;=9+gg*!B+x}MpyYTcAe&vPsrm?yB;Ff4u&wbdairV8k222WQ% Jmvv4FO#pe!UCICe literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/rightsquigarrow.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/rightsquigarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..f471054f45716f22ed94250302c27b14d2c2f3f1 GIT binary patch literal 304 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBU6we(_GF;Yc~2L|5Rc<;uO8%WHsE0m*#3$kO-O=KO~J>(EP+Mhp!5U5 zO^i7Yau}pjSgIVHR%8W*Y6bECJFc&-U&OaF_cmMjGd^*5MplskhJ@Jb*^Fu5?k!i_ z=CNy?vx}hRbfu;amlD0(+jtd^oU7aux^`=ah3{m;W0v6}tPB>`sfJyrpBDURa{vTJ}scRXDjLp+YZz2?i?Vj#f!AhDTIq@nqsW1)lW0!G$|1DvH7 z7A&w}VDD*uS6Uyn&F6Gx<@L&$`o6Qa%-kxr?hLcuIo?0I3QJWMnKYFil~8WE@%^qF zdrfl)o6MO>5(PGW<`2@9FEvaE>S1iO-NyJZbROgKTRhC?G*Go_OeaPiGY~UN5^x$g7?Xc{(Z(R1Wm&W!#)>vxu;>nx0r#GGX?Bn7ZsIj!h z=UnvN@3oQBd@n035?~VCo?AT4_}KC8j*b`sfJyrpBDLLbkd%8fO!=5gVAs)xyUNaOts=(8bSiu*-AXFfr@_<1`fs=D>i&duT z5yxHoo2LogI5BJYe`$#h6(z&sx};A!35;)rllQF4786J=IVYLSWu4^Dq4+%JcGt>M zy$@08jJjXz7Hqu7x#fCwga6m_2d-C%TAVNT*vpl%_J7a5D$x^`%cuPKy4;+Bq3$o| zg{aT3^%?g2xooP~rm!gJRMhLe;!YON84{kf7t6SFC@y7TVAzm5du!SK?|cqsa&a9U l9Z&UBIX0~8V!iU5O+;MBaffaA7NB<+JYD@<);T3K0RSgMX`sfJyrpB0S4nK+(&>y+dN$yLp+YZo#M#LtSI1GKAY=q1~ z9t^BK%vBlrxe;ZYp8S7a|9O)7?EIOy?7L~NHu_#;(mBA?1GIdpiQt5wOHuQGziQA} zx^&96bdCpm!@aiJIxBK3G8~Ay{o#%M{jJ4%&+l{^9y2)B_xQn_`tbR^IaZAGBjaB! zh!65=nP8Z9YGJFuJ>^+jmq|RnY`XWpW6wmxHi4|$@6v%Tb>NuE8u7l0QS3oIgMQcM WutO#v`sfJyrpB9f@G>SGho;m7Xq+As)xyUcJb9M1hAb!8WfUFU9=@+pZ?z7i^_d@-7I@ z;yuHb)_kXVj?D3`{Fj^_ezIphQX}MOYP?$ebAY%z10%~1W(L7%M;CQw&82KdB-#@# zfR-vr9pC76Zs$J1m-Ekm-K2Bx_bm}Y#)MhR9=jczQ8jD5&37|{;;ldDo{N4qH|MsP z(~7S)=U?wC3cqsjR(gE)+n)@^&*wx3dc9=W^5-NIhr$8g2J!!X0Uv`tKLh!L!PC{x JWt~$(69AE2VnhG{ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/twoheadrightarrow.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/twoheadrightarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..9242bc210394005cb0fe00eedc55db71bc428cbe GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpB9gWgUw+;e@mU_B4hIkx*JM|(bv!Z~@^#axm^=%29VGHJFaF#8QjpfW@ zy>;-Jvjvln|;O? zkA|}_Bu@}%`aZAt-$^#h=gLLrD)Z95s0%kRu>4>=Aj><`Gx$f+e-@yF89ZJ6T-G@y GGywpu23%JF literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/u-downarrow.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/u-downarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..b2264cbfb669bc614780abe35eb65829ba425b92 GIT binary patch literal 285 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBVZ9^yp(lVsdpunnLp+YZo#x1UL_xqckyn9HCWM)51&hiRN8J!6zX=Yq z3XO#yzF$b;pPeRosm%Yg-(*gEekV0aUI*Kg-nKm)E+4`VZqix)HMgnuzJK;lX2FgJ zyB>V^DOF#m@1c42vyV%Btza#S`$ zRQ9nML0sx5L}lJ{C^B#;7QCxl(0*;2#Ny(rr)@ps~ dX5oXW_b#k|&b(G`sfJyrpB6DyVi;|oBcO`a}}As)xyPP@y?A}HeaJde4=iG4)_pN3;PkWsRL<@bh@ zcD?gw%uLz*(Y9iu#mRDh#;w;LpWM^ezL`;a1LI_d_qFFLCkD7{E){Tkm355aSOiC+ zB*Wk1=OmaJj?Jj!)ZMyX0r$U4Eg*l5q6c9 SZHz$IGkCiCxvXtB=r literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/u-leftrightarrow.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/u-leftrightarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..288dcc11f9b080ae207cc642d315848fb0e14d9e GIT binary patch literal 341 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpB5tZ!UT7p2KFP<)rAs)xyPCJ;}YQWR>cvbZT-a~AO%?DUEFv=+^Z(vlO zz{?}Oq48!z&ICEFuK}MXUD{W^@{|1E)BmR2=wni3`RKK`Q+zc8*8+w*j)HTs&98UK z9iQmWXKA=O=#`YZ(%MopTYiIM0)bav{jQ6gR`RR*SIuP;Mh1qQ+hwJ@*Ezdrrp8|H z*K&AdD%*CjdcMcMEH`sfJyrpBAsNxdrkp^bEuJopAs)xyPCLlStSI1GeyO2sk?fAJ1+p2OWy|Jfu-|G_ zo#Cu7J?GBBRK=E`?EFSQ9{gX=k=*mv&vx5vR|X~l27V9Ct=Gahm>1sLEs&(c$r|AG zbk22#f?qc(-!mSlwwF)t@zk{cp574T#gTZwyyt3=SGKNMv&7=9*DS-cWv_qP>bkd_ zVMpBM;_fZiW;C}5w2Lits#`Byc#hxM?dlbY%`unn@5opmx7L*FMYtma(;vnMoZoaJ V?8;tsy$8CV!PC{xWt~$(69DhOW3m7M literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/u-lleftarrow.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/u-lleftarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..6bed12114c738d03186804fb5a466c7e6d4ffb67 GIT binary patch literal 305 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpB3!e1)m##pe3!W~HAs)xyPEF)JtRT>OJC$id0DC!~1Cz#r&;ZY)jHN*` zAxsuKI3-?hEYmrC=(p#I-;=73FIHc)ZdqPzs;L8W4Znbsh35jMx4-!qO1xYdvfpmf zdCp)PEvm?p+*ADShZF;c;=J>c4ql#`OSh)E+x9&+;CY`aknG~}-ZnO%{DI!mJum(l zHJ8RN&kXWXOnPW`?(>|p56-R2@2tKy>*RxAJzhVGt4rl!X>1aG>Qc74l>g_&z_ zwzqZsRLKfInmNmHh-(>jDU%`-fwJ}G*Y{L_v-xxey{an^LB{Ts5`sfJyrpBaY>1NriXz-J3L(+Lp+YZopzA-umX?kV?7762HphbNt}n+44llGeG{5f znEM_0C$5NUl}lRWCHg<1@X^8V$C--G9iCgoW4@Z%Y60^;W+#r{`+_-lD!EJvO53!G zVQp#8M81a0iO=USGd#az8ZMFSwKDlHr-$a+*H*s5N6QqCye@dEcdt6RXKUH*ZFl_g zHJw}-GNdmTcR#CKmUGHdUo3QX%q!O3#}Tt)dS7nR@lE=*yS?m5*F23E`@8sFG}trP ZFupkuVJDM))CK4V22WQ%mvv4FO#tpWX1o9Z literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/u-longleftrightarrow.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/u-longleftrightarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..def0c9ee946544160a53d1c1e7984b11d7f6fa3b GIT binary patch literal 330 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpB2`M)Hifurlm!2+;As)xyPCL!pq9D*V^Q_nc(FFFzq7hBH7aA`&mMxIY zV87A0klE@0-v;Jy8^j+gPc)4&`*WP}S#lgp!MTkSsx}_zYT)Q-&^}<|8y7b%b*IfE zKBHp_i#|`>I;}Wwt*zc%hE=O(J-=D$&1WfSg(AyWngFsI;HKMIZJElu|g52 zoVOcleOm=y?|N4Guh?_zHP=8B-_7d}8t`;zEG_B3T6*_d=n6C6Nl$EC878FOoGdam z)zjs`sfJyrpBajRW7T{Z%R_ItWGhIkx*JMExgivo}9*>hqEoMj5K0bSFk@NHoBZs1$c zQZgaJ@!JDe*{=!}Hy_G>POmVw=VVxQYtKsm&zrOsFljB|Xy^#?n!YWqd*<(b>Cb|< zGdP4kuas+hc%|uWs<;zFL%O44((P^Mb~@LxJGcl|-r*5cRC0N`sfJyrpBHKU^V(}qBy*`6+rAs)xyPI2UAQRH#8o-NqWVx_^ip@Bsvfsyk82dBjf zR+*A~;k?UdbgExj|C_MKWa)na!5b&p&61gf|M(j`f3r7V2)MLov3I=KTmP-w;flfM vb)4%g*J$~Ca6VXdHGlVsvIHjKJ`sfJyrpBX*sR@_c=hJzn(6RAs)xyPPyCLsvyvsxS91vV+li;f@}hNP?Ky1`!s{H z2PI0fJwWDW{@D^m;o&~t>~aoOK6p6c!$f2INi&aHe^tDz)=upI{QLL4-}AqQc*TnTbewJX>KuD<0Z-KZ?+hQl tGo;OXKC?s4)c@6jr=@clB|qph#9P>kEX&e$otxQ1&iQqBaHTBElu~=Rt}DiPyC;OWr9*xD z@sv`85JG60rY)njPSbP?8DoqwAw-fSXD6Vux2d(ZX&L~C41?Q5UDr}d&ycUzbl=5!p3Aa4EO~SdFvbu<0HCTWckD{3E&p2p u0Bq;BZR;kLQip5vBozKC0w4hX0pI~TeHrM5{#JPa0000l1z-ibl-`S4t%b);r<7FN$ItS5;+pu$8Hz~&UuvV zx{fhcmgP1@M6LCCDTe@SZ3tnXM8xPwLI^|z0H3y~X&SBdKHvAflu{|>oZGM7a1jv^ z(c2{eIO@b9z*@U3%WGzy=eBM4uJzuZwCL=RBX=sLBI6?>B3}6Qt~;NRXwxKsF(%r} vIVYt|(Wc(ys1KVpQ-nPKDl#Ag{sG_@p!K|`sfJyrpBA+vK5f9?Z?4tu&dhIkx*JMAp*VFjMn!mHJLJWsH!Im98Ss9e#K(`4>p zrl4#gd?7njbAr8|==)Q`^WUT^D=baPdX=iRno(*2<2weIl*nnD^kYMNHopJ8i1*zd z*E2aiii>)l&&_9INZ~nbARwqz_5QofPOce|q1~k`UhP_U*+lWtWXT%smIre_-#h>L zPw|%`sfJyrpB4N=c)!B>DnH$7b(Lp+YZoqABPMS;h)^f=QSl`;pb143_HtPNBHm}EWJ zFEoiZh;Cp{-!n6{^ro%O&Pg-b?SIaAIWB&9P0$v=6Yg4Q882OHE z(#b#Xpt*Hj_NiGd0#kwx8}vNBu`Tx%PuW+Y?-R1m=>~pNG(R)zv)zrqHs_14mxk9g zbnM~p@bLP1h$X(Gt2@!%rS^V0k9GFi@BhMXOx54a@Q>pI%Y{2PPgQ=2kOz8_!PC{x JWt~$(69BqDd>Q}% literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/u-rsh.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/u-rsh.png new file mode 100644 index 0000000000000000000000000000000000000000..05e8974d689ec6b008136cc9ad3d43c6309be6d0 GIT binary patch literal 255 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBb>6#5*L{IP^E_P~Lp+YZo#xHUqR7+MepbqX(Sw2Y0gLw30QLw6CZSgh zoKp|nJ2A&B)+j~)ufIv==dYqc#?SZoy(*QR#w7AV-r@aUi-wLR_lmujilj}e*wH|JVj_Wvo?vWYl@WQrxLxjjQI;uW8SMx(o`^PjqlF@bmwSJ1F72 ykI!1P;{Dgv0SDL~EI+&R^oyH|7+B}9*Dx@#8*|3({W%BdQU*^~KbLh*2~7Z#K3K;9 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/u-uparrow.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/u-uparrow.png new file mode 100644 index 0000000000000000000000000000000000000000..e539f6517c5518046effd7267c2912b3faf608fe GIT binary patch literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBVe#2ncMkxCc6z!vhIkx*JMALxVFex+PjLn53A_o+>nHIZ;^;Y~mcqQL zadYF%1Am=ES7}{P3$m}7pFVe9$q6xL<^E*O0OiQM$*?MfoD~aSa zTQ!$*Go0SUz#z!zV7mJ8-v6Qjt1TG#F8f>6r#!!NJ$R=plYoQ%gVN=G-&bc%=%3E; cPyPeTQ?V<;tgX6BfSzFRboFyt=akR{0A(X*AOHXW literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/u-updownarrow.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/u-updownarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..4aa9faa2793f21f080054d1849dc7574deda8119 GIT binary patch literal 338 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBQK7w2eJ6oJA3a?hLp+YZopv$zr~;4c+*QpfEM^-vJDN54Oc4CQmeQQk z(sO_$SO4IaT-RrC&9rxw)7gsVQ-#dy*q2N>#S$f?#KfRf z6n9BvtEQk}pjT$>_1E4<&K#3S%e!3`Ij!6K$=-T99)`;%a|Qp^G)p93FJ)-x=vPsC z_uJ3K@Ywx(2coL?XerrEIv(Y+X6yQ=tg&B23w%5CR_|b}XLvB@v}OJ7sl{?_54ZmL z%X7f8e8*As_uYm@#k!lh73TA-JYv$ gb^lKM@&Eik7#8$$J^d;g4GJ{|Pgg&ebxsLQ06C+Bd;kCd literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/uparrow.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/uparrow.png new file mode 100644 index 0000000000000000000000000000000000000000..aa8f571aed79db6f7609092ff43a3117d91d4f45 GIT binary patch literal 251 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpB0jYD}KJ5bv&GK|{4DmSr_S!*C7DXP`fOP2%B5xmTPhihtotD7qr@l`sfJyrpBLDL$Wf6IVEXFXjULp+YZopzA7MM1!|PRKDVOxh0!?*2HjO|Mg z$5buLy?sw3G&JPEZU)5`>7^_O40vkqzqfYeNR)A3`&CoHvFz9k4eKe|P)r3vUU22WQ%mvv4FO#txcc-sH~ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/upharpoonleft.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/upharpoonleft.png new file mode 100644 index 0000000000000000000000000000000000000000..72d093d219db4183e4f06a8ac1ff25b5476f00a8 GIT binary patch literal 188 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBc`=6@i=u!+(Vi}jAs)xyUfalfz=6X#FkUUGS(-J!F6R-?1T_(l&L{E8 zwo)q7RD8-3EtuKnO_X8r2)oJ=5UR5KHFLwgsWYF;cvk0^Hq9z!yx+*k%vQ(g;*wqW f^P|y++6QdYf1PAyR&%KYTEpP!>gTe~DWM4fBD^=H literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/upharpoonright.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/upharpoonright.png new file mode 100644 index 0000000000000000000000000000000000000000..76c7335543e8cbc93d1e41d6c4ea90941c510d07 GIT binary patch literal 200 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBd1LN7WwJn_bWaz@5Rc<;uN~xMFyvryC>CAH9PO#Taq^TT?rD?wzWw{& z#qK1xyIwL(ActXzQNKt#L!mdKI;Vst01>%7PXGV_ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/upuparrows.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/arrow/upuparrows.png new file mode 100644 index 0000000000000000000000000000000000000000..129a3383587a640f46949c70667330b9abfc7c52 GIT binary patch literal 281 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyrpBC5_jC-~E9?J3L(+Lp+YZo#x1S#DT~4aw=<2^Tq)7V9tpKd{XSm3;EQ7 zlokp-N;u~DZNmlU#M_60UMT+m;aTy=!HLbd+4^hK?57Ou3=Z#WBd5*PR8lJHOh}*g zT#_Mc?d;1@-G;{`qO+I3b>|Eb6)Zldxm35kLqJeTNl9?-GYcjIW8?nE91JcdzQRhY zw2a#YoH)*`S@n9?KT{=RZ_T%Jg1j`JdaZxo$Sm`qL7m}Vc-KDmuQz@!Jt(iwZX^GJ Zabe7p??p~V8-adc@O1TaS?83{1OWDqVSWGr literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/brackets/1.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/brackets/1.png new file mode 100644 index 0000000000000000000000000000000000000000..3b1ed2604fd80a290eb50c70dd88ab817998ba27 GIT binary patch literal 748 zcmVMu2(fp|MWlg?c5H8rJ|7zc!MmDr9OoR0E%Hgj z`q)SC_NMuK-tHC(h1buk)rq?|r&eo$avb*-t^Y|=hRKSge<1ybNxR)HQ#^P{?RL9N zCW8=KEEenaT2YjAI-Seq%H=Xb=yJKFQYki4jtgGGUTuQs)bUm1aM|XR5VG6tsGPsv zuYcUj<>JXse9`H2nBo+$_kr}60ZR%`18^E@w#BDLG?HnY;zYDEo6lI(HIT`rei zwa-a4O*r4WUcO2z+ng!vcO2ZO<&Uaym|sMTt{UXQhkS?GK|7X-l(JfF{sq8Ns; z*=(#Ehs|bV7>1%K=kwXoUJ!)obQ-NtjPYF*=86dzkO{pqgd@$4L-;Fi~1gW94d^+Z@w;f^!K8!MR#H! z$VmKXlw4A0@;4;-cwx=``Wa7u|GWF^!W6Cbmp|JubS!#NV;8^v`qQGFaqBr1=RKG0 zKR$2SRu09M3FY51i@mS#RZqI78~Ijrjq%I8?XRcwowu9Cm(&%^<$F=Yx83~g=a^0G zg)-{rKdZ0*x=kW^YRDv}^Rwk$0|Q0AmIjIhitJtJ->h(XW*v9@tIJ1|6gllPKcz=ryW@E6;p%0ZZ~6$88DBLyyY20>ZCiF4Z_SOqY*O=n zvF5Brnssw|R_XsxcM4!}g`f);9VV+RoU$xa%lgTWhgVd5gS|2*sl;lB{@$8zH1o{! z&+E#4mtX#M&tAIfoMrMFozoV5j1Nkz7#(Der$!nbvv@w=$X(RckjFVR^s)(K!seR{ z4Vkl6t&(c{ID5aha-$qy`@Nluo8Eo@4Wi=orh}+;VXHw@)HKnyg#w34V;OGbZD)9} zYn^}+&*6C47Q4`^u|0-fD+QEJZ}Kxwi&Se_FvZUHRvx$gbU_hEINJR}`jsgE&%c)w Rp99kkgQu&X%Q~loCIF=@6Jh`W literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/brackets/3.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/brackets/3.png new file mode 100644 index 0000000000000000000000000000000000000000..8abe1967dd22b51f7d729b9bca875f27b29be623 GIT binary patch literal 813 zcmV+|1JeA7P)yIo5kJ+ML3>9leWI3H~HE0xOK+?7ft zOZ`7=vR$9;9gjyr5H6RC&*x(pCL9i{dXLBR%rq56F%Srt^^zp{{eGDH5cEw!;gy1* z5EOzsA9TH5H=9kIwO+3;mrLRuN-!9--$~dwV41qzZdK^@dV(ORvLFb(UeDn0Oim}0 z3Bxd|%rMMkGI>6yxm?cvfR)W=$#PmK6f~J-S-nYL%;)oDyFP6k^m|8rF%pU3>SBY^ zG_4A!(@C$_ikbt#=&(P&gG76*gDql^_oq*AGJxol7x?tkuD ztJP{Ml_F}Fm?+0_=IbZJ?blr^P1Cp!tj}L;Jp%h{$ww|Nzkf2_Za4iWSrxTfZL`@( zlEiTwMNzF*i=rrw<0MJiY&Nx8&AeC;|MDy3n9t|2Sgc;JFBS`;iqq+|(P$(RiPdUF r+9({CfhZ6KqCgag0#P6eL`m=ga(>!t>00000NkvXXu0mjfvKw{7 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/brackets/4.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/brackets/4.png new file mode 100644 index 0000000000000000000000000000000000000000..31ad7f74479356eabf76a76e8bb97454a87d3834 GIT binary patch literal 635 zcmV->0)+jEP)Q2HWC6$!x=aD*!)BrN$WEJap+oLvGe`)OWJzm4NqJy=7mc0CimSziR>^gl*ehTgxyL&p}k_9y4MLI-cGU2-Lu*3?jNg~ zyWI|bA4!KJ#Uq8JNQ$I`keb7gmZY!35IvV}b43F{6h*G<20^f1uOD;gmZYxh9u5aR zFCdEIP3MX0y?o^ZC33(#d4<81{_v@atiol(K1>4oIIyeeI9bW4vft zmWnU&-bYd-MN-U82EZ5m5ui{Mib7E+3PqtPbYP)`5XRW|$1}zVA-^EhvMiNH_B6g1 z(_bzZ0Lb%P2*DU*j0quB-CK2i4*PQoA%y370O0#RX!R=9^gPc{ejjv4Ips8N-5_&3_}1&l0nxd3hkrpqW4g`!Xtib7E+3Pqtm!9Q5k V#~#b6-emv)002ovPDHLkV1g$~6*B+; literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/btn.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/btn.png new file mode 100644 index 0000000000000000000000000000000000000000..77d7c10b296c249d3d557fc6a29a5221b4173d9a GIT binary patch literal 6784 zcmV-`8h_=9P)sxDo z>s#;le&3Rq>*JDuO9CzlxFm4XNkF>kdhF_OvywnYT811kE`rbFEuU|Zhdw;iHK&`^ z2)jDtCYC2U3+)2z&it3!dnTAo!2%AIPu*?x$s~i8}iT)R(QCORa~iHuf6(OlRVp| z2D%ElB+!5a?477m#HO)tGs!SlwQiZEXADmp=S-46b?Q|2o!fUFOJ1GK0{st_AlS#NuC?Z|{7z ztLqt=8FEH?21{L+DlL0+nOthUOf$gm-7>XfNX-VUc4G*@GsP6AKnJ$WCK+_n=svu(}r zm7$GM{!&DKGxU>{&L)YKt5(WM%agd`A2N7Iy0@>l zQ|(adq z-6E59#t5%veM9;hm57rylWol2xcBFxpZgv>bdXJmn!p}>=s{`q`>T6y|7QE1z`Fz6 z{r!c%+dM(w2u=DhiFvp8X2~BWOJpg_i|cg=E|8lnT!@OR`_F~&GOJ|tOpJr zDDU1`tNa7*43J}{#1Qlp@6dLnq^8If7c1~QHgt%ob9?{Z{dEvnFmHqT-=g0z0w6c+ zdLu?gG}~P-6s#VKw5b%eUh`7aGcspn>kjUIUy&LPrin3fZD?|?@)?>Zs)=B z)3fw$w4>@P{;gP!nH|IS7wl(bS+cov<~ptN&&4Fhl4*P{&wm&w(7lA()8)m zWnUj(cB142Tb;aG)7SwUCo7-fU(s(xEIKM$3Xcqz%gV}_nvzXio+wvVRZIUAPXVKjP65QrvTKa>5%468UUof{2*EzrS&(;HWutJ?q8p2mUFwg%vU> zyI97@RoO=TUU{{WMTFNfqLd%VIptp|Z1F3LS#x7aDHXP(7J$aotM`HeMUSz~8JTmb zZj7ZT^JCT#8Rs!3*DPN>eAUzDok7cWVYs%SWD+F8+JCj;i91%Q?O zUINIAk9%OxKvJ6F97-X@X)+gJ^^+5m^$P5zd5$zzLB>5BCl~x!U{U!4Vu7O1%gN(y z3y+MFi)le4UqC(O*Vwiw?+2|kWnBvY$)j!EE{N6bfLH~qyjaPgXt8Ko+qGzI7b$4& ztD-rae$Rj1V**t|!GrB2#?`!TIHLpZ2vA)BU=&~n0H?LqHaV(13=gGWN9%Lc6l-G? zwRpZWFDR4qW4QZ;w)UKg2Ru0=CxevUd{#j?vNJP%;+~INcj)k;@fXT2T+U3* zoZ;KWca7GU0Z;+KJ;0?IEM?peNFaJbG^6_KIVo#lp#+xtkvbft_4!)MM@@*4OG;>Q zZUFWHdkggn>|g6M>@5#Px@*TS7913;s%*KeiBYDv@{fHgR>qE1z)Yh3fNDnCVdRx@ya?lG((tAOfoIjbM9k)#+cwbWZ)kM58NU~IMS+4Gv61Mt~+IVUjr0`9V zW60vntkwOs4qY&RYAR|fvd3hX*)w69;+~EjJIZ9ivWyKG+`$VAF8-Bx78n@Fl9Q6J zhtrokbX6AOdY1glue`i2D=TaK#Hfj<3Fh##M_zcr!9ynnVzmCS<%i=tHz$`VoxrFc zmUm$9!0X0bu|@gYBL}_ifjozRPKFot5cBkBbe7IQm#qAA>C z{#>-FsHn)e_>1e7>b0lc0!AVOgAKZ08<7C_Lh-|KFBbODM?#Oq&W*ip^Uxj{*mI9w z3(CaYiFdmh+&?FazZ=?7Q^RJj4O_XwQkxo5{t_ws(S#X2PSq4sg?$Cw!z&{kiT_Vr zf6`dLWrn8RZcoRX>K=1T5%|AHE06Tc^5qwr(0Vi~{WWXXl&?=+Uv4lM*r-vX+RT_a zqfMPGOcsW|1Nwesa5Fs7|K9#*5?3Vp+9NO8^2>mH2){SNJD?^4?@wNptP1%ktv4)| zrDdfIIDBboDFda^JeVmrkDSWyByfKMp4FIOC$9W|C(D0Z!wz42WTDqRfJ*@Jm@8ww z>Nl?kN*>Ce#=!W_VuuDe5C3Q<(x4&7cL+58=4I9DZEPR#u4#Rz2HrPN4!A3Ty|wJE zYfLVhqgb%AKh1Vp-&|v5rT6_{_qZE8b0k^*arN-z2@Tb6al(ww8r|N_vt_9*jk{7) z9lS9tqrjH3H+z|-Z!Fz(VBdjIk9HoXLi&VAw3Tmns^nBFA0Hn!YsRc>QubpYqrAL4 zpDo+AoIddVf%1PJ{kJE*Or?AG?7eNkfC0CB^UXIGv9Q}BO9Uce`wS~zX&quW1lS9X z?;=vPLV1t_ki!eYsR#wrt9LE#zijC;xsYB)0<~Gp^cXmg`R`&UrEE`Q*f)UX5Pav% z${&5@Y$%MCoiK+j<0s0fDQUnYwD_1T2o2SV1q*?4N<7^W%3n*rP!_(p)bv!ylTC=8 zU{v(L{=rI$ij2|>|7dN)%~-xcYXJ+usVnYPtqz^J(qVvastDjBOewth0?YSvztYN? z;T|U$P;SYuTD$6r?2PRD{e1nV6Jz7E*>h&|V2efZi`En#Eu4h!eg4$v#OM6j<2W}M>5x(ubmcQr=7&vhLI(i2Hs0kEX!qkoLEZ{k`!&X`?>S*7d z{9cM^cD{g61of*6U#;gzwlrQC^SsS@toSVL0*O6_i1`s=BcxhNG0la^(fn^=FccRT zv-lU|(_^2GjRYeJN?r+z!Jkodw21F0O_V=aU+I~wW0#KPe{vp&w5{{l*~{64`I|U; zsYeY(@4^Ql*SOtX`t6yo?PUUu$%}kIuDbF=Ggw%-;!k`parvPi4?P9t*e|%>+IjQl zJxRawYvZHGuc5_s68&R6@9w#Q0);$EFP4rv@%srjb<)(rmlnSCXIeC>#*QEBHgM2D zilLKI&Yw9y<)@#1x@^nj0;31`JuH8rjA7l!&WmHgy?b$*pTK7Uh0*SyL5my84lg^S z%uOhZ`}Jl8)hd6A+O6Zz+tSbLRYs(rfCJc4yhLN$1`8Om3|LTwQbnDx~k$jGs7~6Ws%@1p%tnCzxYmu>*WKV)zKYtHjO_`IVsD5$SAfaVY;%T1Wt+0g4o#_HEnquUK4N%HP`PYQJui@>e=~@rde*%id~=8A{t= zkiKNH{9?xN^#6f!d-T)DI}J5g&MM14`0|4-Zt35lx1p-KNUa`vUJTv4kYWe|P>1$z zUAqJ93}UtzDR@v?B47!VZOHvY9LincvlEKS}9Rp+u99i!uVet0R&g&7iYmaPcF_goJGOIUh zOgL#VM-kUx-ZsEaQ2xr@Ktt`vPJug(RbVPGbwC#d#*RQhOZD)b-bcwS{`q)rG$2YG z3pJEIm`n z3x}^-JzAYpTG}%7k)c`LZtpf4*3LiT|M4DS_Ooz*T3VXV+sjvs>D<}x{i@5C*rTD3 z9-2C1>OFKx>F^cb)qc~`44cZ@!tDn>TR`a)ihiMNmJV7tZzSbkyAui`1+0H2QNVM6 zJwQv2emq*u!k5WWYI9zrx`<@V1(Ww4ej%`GFrEkkw8pW=Vuwm7pv)wq8FM3Hc>)Z~*cAB!v4Q@n zyatQky_Ix?;Edz608sFOeEj@3XYRapfX`9DzC_ zaZ7tSt>xz@zxd!%dHJMj`6}zysawg?WlR0hmzgtXK0>&7{+2CUSm)b2vwk7{KASy@ z`vBA^pt^P+mKOqk%u@rvf+KjrYOoKzq;fJvg_75oZ|~J2M;qJV8%6m;nFjX`c6cUF z$Q*b${3=Q-AHi;x78em^Y$_#bc%Ee<_4j!HkKtVNfewDOcKfwPC;fTEya>j;q?3vvK{tf_<#Dd+SO5UHn;1~kpAIDQ2yNF?@7LtCQ9Lq zU0Govc3jsKHypT#I3}Fj>U)fFBWJH1F($$ULIGwEhp(-503H&42kcA;>f)~_g4%e} z#COTzOTHkZ@}~t7*Mm zkNcHoR##k8bM%sumg_M7*X!;_e85+9PcGs9{5PuOE&BTze78lRiv>kb*r%xn=govS zEA}7Q@6p+>v%GD`Hp$)HowaM-j!{4d3+W%iMvofZX6MeGZi5F8zToJ#;iZIy$oct8 zUSk#XJ)Rz5Qgf7L601h%{W2FRr zVsXI#xIgiOM3XZ39qB7@Fc0DX+^LP7C>+s9>1{25P0QSJmAxi`1}z42yx&~;3v6Bq z&j13V(VnSv)+(VROHhw;P=v3*mW9IFU{YpGvPP2lNlQV5%?hU+=aLh@T}(D>^=Q35 zY2qaLv#p=8Hf_8qg~Wf_oIH6_BwP|zIUM3qYjX?{CXkO% z(!xR)O5U6eWMl!=wTsNqPMM*ZoTrWj#Ng@vUS??e_`1v3Ibd)5o?r~w-W|&&0c+5K zA4X~;EDI=pSWb?ZV14_A$Y;)+W$nG&GXpdD63_mOh1RJ#b@k}7Y8{~Vftm?M1^Nz4 zAJj^`oaTN2^9sPqfb$KCKjF;;emOU*etL+;HXaHMSh}+@JTQk4bi_aAhm<1iwc?|< z@`uvgy>~a1qRBf8e?Z)eaaN%b9E=k?Ew&zO$Wp!5#?YKVp(km=5$Q3k_2*{1-k|cQ z^LdSUzq!>faD8)29={{MKNbQ~@Flc+aN}&Dn(8sKWO%#I`MZ;L27jfp9{yeoiP)j& zIYcCO6M9Dt<0XlGHkMP=#DU+y6tOFy6brhCkN53ANWO6KENk1^i+#86JE#Uk;!A=#C*J{pPIA1&7*3n`VEG%l!G3P#0KZSWi_3GURSAEVU0V~SC7Vn4E ze}2#D?q)$-+$pQZ$WbtTrjl1-7`hD0UbzDx=P#WGM!p1z?V)RwKd4qQ3g(dBct3KR zj2JnBGYXb0Uee>luP2TX#ZC2v&|`=uO`aha{URY2`TXS&sO`sm~1%#%q zO-<_-(9J7;fnyH=QT7Q7Va%);zC8z35Jy^CqxS(GPzH)YLG%3aTzUfFs zt(h3jdJ^BG_gJS@?tby~OaLR1ksUw6E~|$o2ey0bZ}X zK~3>vmyi*bk*&8#VCBH#1$K(uG>LB}*2`$A*E3U6Kdwkx@vg@mUGHGWe?Kli7x!Eh zIeFVY_0&_h9z99~rj{*z+PJs=X+TIYqv%~vqJG+(pI?tQLYad-g2+y!dsZq9W#A5; z#Zx{I#;q&^2nZqmSU^PjV*I9uwGJkYG6Sit{RLbAzBsUA1T4XU7QG@EtRqXhaQo}A~gr1adB>iSPYeA!P-F#0a9^TItRd3 zxx32Um=fU19}&FxUvVmz6tQXC2A<2uLQt20XVjEG9L3)Keg1+vRnk02v;+7nD4#}kmxA3P-olQle_ha3=-m&hP`SX@|d3pWlpmtcS7LGeul1OW(`On(h=bDBhB@bWjc*;|Q1q z3r|ClvReA2EK68Bttoz|oca7^d;8|PuW2P98MAj@Q}WjoKefeDDhIlx7Z+aw=bs0J zSqS>lOC&tQC0YD%cEUn5&ttFGb3{GS(b2cu+xy-(MjgiY)UP?s`V)4Xm0{cv^%1^Q^t;ZBP&sDVo640dN& zknE*OVwb`*f?7HMSBsoPSwJh;?VxT!Aiyd(+vuLIl-Fz$Mf1{O!;Q=3 z)6nxd1{^k&t$cT7J%y*G-CD{Lm)|QpJKOWzxpUm7F>Kf{LsV4MDJ^w4sw{A1Bz;p$ z<^>0@zmGRVFqft5oL~;YN(VE?T6}<79|WHt*N|Qs5EMA;$|D6+QZwWX3QiLr>@e`J zqN0K)mNSPxa27z(5lRZTr}kiVJwH(Xh>%qa?BY<>EIKTQB3i-kePe*i8)Co+MGFS2gEgZq{ab(+@W8Hw^QqpP_ zJGkJ;7D@_qn3DUgrQcZ05UmPa+}4x_TIvTa68;1vSu?l%UCLjJBwb~lK?1dyKaOIQ z4S&M-8d?6&nTv+Q!a?f{jciOCN>7)j;pj#%T)=M!HIee^=LURhNr-?W z>?nxW&YjVE9j6EfDSRZB(oDm!fR6;QkH~J>(7C$$^w?F4O9J*wK=-Y&{Y}yTP6VRd z8*=Y4oNYc9kKJUr`@i5ToSM(fo84z`L2c>aY$wcsK=%Fo9~NYenvC?ZYi~V9lO5f i+iO?PToSNf0{;&Q$@k<}p6WUP0000b!J z!r;*0CzHuZ3L$_9P`Fp%=!H>FGd-6kn}j)Tk|f$TktFhW^Pa%6EX2p+O2M)$B&U)j z36R9hr!yppyT=P4VqM;9a^8xk|qGjt9erQj!F@JW80q?8htWidVP zxnFH2E+^Efx~}&HNX@1wrFWQRS&&k8d=QJq6rY?!M_XT84|zAcm}UNMUK2v#tT+n* z5JGfCp#``t7eWa2j!2i=yL4VTjITEjP8YyEayh;Ta|7w3bCP>^1R=BRHa(mVChNeEqy=_>jv{6zno`&Ij>G$`EG@55_{!6 zN+}_wgltHpW>c)zswzi%+Ng+#z7$rn7D734`fPk<3r@Wp{Pzs7Z5x*+E-`a8L)*4P zLr0tI+<3Ube)8>~I>S*g0}J;Hyl7rz=}D<~zngLC`80jr`}Kh&s?V!TP9;0?CVReh z9OupCR5HX9g*)frI)@H|J-5dL`hbquxmbuRmHi4cUuKY9%t8pE>Tb`sx?atFlSAfe zhUNV-gVjLSJ>2d}*<(PxUPo*=7Lu(#ScNfSAQp{je|NaQjPr&Ti^j0Ex#iXGw#$vT z4IlzIFP+WMbPaehs?}*#63>2qMj-^#^XbrR6d#K-{%%~&L*23OekMMcpfO^E z^ou)13L%)gm7{a$z;PUO`blttn@aY6{J2PC#Gqf8k2~D@!-6qlaOJ^@H!U{%;5Lp) z!hXd(aXF!_udO3JpYEY$_ey=9V*YL(lOIiLVxWT+!i^k5!{Sbn=D5lAjdcbs^*e9w zR*rk+J$BQq`n<~Aog8ID_Rv%|B+PM>OV^ir!q~qTw1E0i{SD`(^QZmNra5M6A*=lf uHF&E&vf4q-Yrw;u(OJ>>|7P@WG2kzFYjbyphIGjQ0000La=QK$f2$t>p(DOX+d++<)Xmew2Y2oq$!!S#= zb+b;#^T~Jm6#ZZQacI*aO{z_@h1+Cchmg@-+=8Iy*&SGiw!3%l9V{_SibahkXUOg zmT!SltWp6F5*x(ct{|eGmF%%5{&qmATx+3SK}Xn=nN8p}QJl4~&njqWQTfbM+=%cYZGVTrN+O;giPx z)#&LKbx$&#*_JM5#)m$2dq{14t+M`!UWv7usW;-!tzUK$q0OSHMQw1a2sU(SyV$>=rClU(D0Grup_00b zm%%~~EaX7~_rQbCA+3#AHScUJ^@F#(;rD*u_kQ2+`xGL=dB!E2b6iXUob%M?`X*Uf zi)LnL$UpF@FjXKcYfC|$KwiP3{d|J zqeiZs3M7+Bh_-mK`Q`1 z(pDnuw!`ycixeKifn*cHZ@ zC*>|O|J8k*Nr&_yof?e>Wpi2bK6(_i0ubx4UFf3GR6u40i(G+tEbfhFM!{6} f;8c2FViFh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_cg49rTIArU1JzCKpT`MG+DAT@dwxdkBY3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|81#=KlDb#X~hD#E>34K5C;EJ)Q4 zN-fSWElLJPT$(b-ssbzLqSVBa{GyQj{2W*)24v)yHM2BwGB9y5 zb2c)E>2=9ZF3nBND}m`vLFl!>sTY(KatnYqyQCInmZhe+73JqDfW2&$iQ6rvIL(9V zO~LIJGn{($fsWA!MJ!T8!-RmT2gHOYTObFX@Kf`Esl5o8tQmIRZ3E^OJ5LwKkcwMx zBD^z%14ZU`iq6Vgv)}>y>qT4FahZwjca8nQ%-Xxv%e-lY0>{VA8=H0sty;H;+gz(m z)or!toh?ckOCO~#eCe07Yl6^b9~Q-?s}*{4)UO}+G4jlw+{(}Q{#j$TN61u-&?}OK_s@)uMnK(gD}a8+e>%x&L?U-5zrKU}%`feXVMa87h;vr-!Jd zZkc=P9{ZECtPvt?vscBYm1+O>TzmE42Cnrjg{!W~TzOb~s?PAjkMrDH`=h=y*)9rN za9GG)Iyulya`zK2UjmRsH5;3kolFEROC? zkBs{ySH1H|iuQ+9GJ*?TEMG;=zSx_nBfiQ(=F%j)*G~?{H+((dzjd)mmB8gVmzW}d zp}t)U8+2aB>{&PCsxQmeriJ@?L@F*xsy}|)^-%smbzimRPk{)&E9`{@3rp|5-?&U% zf<;N|&7niO4~*Bd|4fcw{ri!f{Ws~~rjFZo#h#k?g=4+JWp~aw}`9 zo=ZzO^n9+G?IlNvJuBWg^UTc?T2=h2;K8Pj(>FNgb`|^0xpOLgiOsyF{3?wyB5l(} zXPW<9e7J1d_n5%s@Ts**44Q)9yuB@Nq_vhGne{&DzaQsB-I65p_Y=^iX@In`sIasq<$oj*YHhjk+-dLMeku z85QP%@YhFC6VI2EEwm8LW_kg#}hP0fo=^`OZ0Mk4T6^}xf zzu(H0>r;u|`1;uvP2CiJ64!>gDwK*JP3`&g)TyDSPuf`Ovt7&dkDVY9cnsWJ^n7lVBjdktrqS292 zMQhV6;~e?H!v|$fJ9fq>IXtL<4LFwoYJ}@M1&C<$+^Fb?c95>?L~IPvW^ZIgrBbOz z7i)WOyu%o7|kfOeU824z-Ee8V;cS~&8J zOnr^WWe5Ig(ByRCNbeWOm@}yVSig)avMoY)f4r;A{4qnJts&_My(e!^3N@fo&x*}G1wkv!w zVEk@a-RyovTr%%ds)SG}9>kB|>p^UzD%haPOrMy^f zXX@M8*=+V&Mv?PiIp8{@JpmYh+R@iBAgjR!I|lVmNcfMru)MC82~Pl(MSF=Mng+ck z&C5Li6aaY?Uz1R^9jmJ98Igy-70tc?Aae65QRMZ=3IqSP!XE(X#k71iNJBGVe3_ei zJk^YCUt>HO;N|7ZP_vyp0hs^T)HmzFW1J@doB?ZDJOQkwbJ+F`fcN?}!Qu}9uN54- zjdsFj(fI&i?S43R*P?g=klQdb5ZNBFbbycj-2qxtCC|+}&GPMQBT`>htrWP1HvW*R zm{oG|VG$>#RLKx5P|4%x$EzyY696B_0`y1Ujw-8}1JQS)6x|V3a5uCh7FS!X@ z#RLpwZ(7EYcYTLW$rH(Vs4esW10B)fIF(c`GX{3h$LR-^j7tpPn1}_c0uk%9Im284 zU=UKf^jC?3n}e3*whg+Z759VOs#VYrPH}-5zc4Pwz8F(tyJDiJw+F)2%@7RWcIou&-uvFso`XBKKenBSc7zUf_VV0_$Mqopj*N~j^W=Wx(D4zXhaSOW(8rUz zShy_~I?}amvCiXuc;~NwK6{%*-dI;(tmE~ep@Gve>KGn485?-D@y%1Q*BTFojvRgI zot+Itp1q;Y_80oxMx!TRG?Y?ow{_!ztqWa_eE$MS&8I5KF@H0uSN^q|WBktgq?UK+nNZn)}P)ZNpq@;CG3srL{AGh8kgQC&^qQ&kDZKPU%<`_giW zN_R?h;r$B+f-^XyR4UabvgM`vJ6PhXcM-l4!Fff#Cw=ne61>{tKLM)B0KB>D+?--g zvmOA&fU?)JQU-haGe2fT3-iR~iB%k#xI9I(U(BwOX_tC-{2l~Dnf18%;YG^d$SY(f z&=xR|m9e+S)Y8(D0GpYeAzhlm;Xw)>2pXyHQ?kJ@Z7F>Gwv<$qEVad>< z-d)~GS3nPegg=}{yoU@Ks@UH3T-^n>cmHaMtl7B%V<*{Kr;Zs|tF-BV2PUBu_cCe& z;9erFqjUcOz_tsp`I`l7KC*U_G4thJ;g;wL+4T95&ZNowoyqr2g7W!-e0y{_s+_u@ z>MVfL((;n97Il^ci772BmYFp_Ds{=qvZ0UBgRs#TDtBtUd_hLCXj$~2*-t^QUyiW6TaC~zR4np>LH`FGDd)~;6g1VH$BnB4U^fQT}g z48^a+Rs7Sq?A?3@Nd27%v=#(_<0Al^&kXq(*ok~!S&sL!U)l~RTuSk@J=3NRhYqX$ zll`iAtJqR378`s|`P7-W&fq_(+hslILO%Y{xU$QVsU)@SZ&S%snxG$_juZSX-dGg< z{(*jxC%Mc;#v87g>q(&{7?H;@3An69|i_F-?S)vBCN0$PMT)<;A!30O5WYxMYKzHA*-Zi zIL}~jv%gvT-k$cU&!+HKMTepWj@;hodpr66ce>T&EZ`E1jmE@>zUcTK_tC_q2|1j~ z0Ir(~%8_Fc)V+b9zcN2%DA*n>w;^lg7IJbO)8~GmJ)j~lMksP3VxZ1`zn}OnInU%Z zG{~{hF;(e#_MzJscTVUFucZF_gHn5>32EUnNQ#kCq*l_*X~&F5r@xX`mg(Ap3n)?a zR8&C^a&Q6MfPC_kN#V-eS94OTN-&THwMPKFgfVA8<*wxfl$~%`1E|!R^@YeR18-1s z*kXoHfW!>q+2tTAe8@&5mxWSk52r}#k4uDUn$+|}6E*E_s$5caYGvlM%a9^kYnEBQ zECEkQJ+^7Q!)3;@gA7l3C)CbhW;v8vL#}IQ4+OpSh7M%CuWY~T$T!}KEdcAqs)c-G g0JVs)iH|M6knHXGxwED3m26THl42^Zv+I%d1pJUE0F~ipv U9@IYl`WRldVxgqH$~Er)0j{AjO8@`> literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/button/script.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/button/script.png new file mode 100644 index 0000000000000000000000000000000000000000..e29e594005eca1fc12b32117e9da1e6d277f8f7c GIT binary patch literal 1311 zcmV+)1>pLLP)F7=A9FrCLkW zQpAR!FtjWTveHi3*cLRSP$2?Q(IB0C6m08^OEsA>{!q6>C7NMVkTgnRzz9JZP>YP) zI2=r?xIq!bx<$e;Sao!krl7^M9~%bIF+a+F@%*~?y!YJq<9Xiq+zZTM4zrA2b1$@~ zv`_E#=k&AZOy8iV0Dz`xsYav8=;`XooV3-{)(Bha)~(a`c)2qGNs5Ft);C@;cbj9( zy=Fx4BLLtVomRKfU@&~o59hN1R7~CD;qEFBLL?!}p@j5ZtwR0Dd$z)@LzYjhpgfO;j-9r5@;#2KWRVSt-lDLoJ#;td( zpZ?o(uS7v*RpoQhYfH5+%!tKe;m+V4q^?V~1q20@(Jl1rXH$5r@Tn7Bxy~U@5L+cl z66?v5la9&tj*A`71R`7|tPsVDh;qBqI@7ynk3SyA=*Z~R zP=4sILA;>&+m_o=Z9ldpM@B}jVfnF=uKj#1KzCXv>FVy<>vFj&2W}6H{-*}CrCLh$ zxr%5?G({$pse;L3%J^^db#jGVT&yXk0HFW3et39zfTAcoq8@n<4-Ox&jo7MMFSMS_ zNYCgiDK6=dW=T1AyPcfSoDjNPE~9hI`QW7~sHv_gZft5Sn4l)$_|s9}(AbbVX)_qk zt#58=K09i2z%nrSpv~B_7yynQKI-I!@UVH)W>TrxoCx{CnK_SD33lA>=0L6AiLU2fMGfmT28oU(37~y$&fn2OEQd7#$ zl;m|f>=_ZNi`3M%oNZK8WKt&nC(y%#Q880N+BT5q@63&$RfA^zid^YXCe zJM;7Mzffz`lv4S6&R2-TY`)T)6uq~g6L_!krP6Vl{u5wOot4Xw7 z{6Q?slRZ52{+|0HO8Df%G0QD8BRVV^ni7p~{de_FNs?r~N~KzOv;QV0JUlo> zUzZr(6TFKZvK@Y)K<(SR&plmGcczX?PfI5`xjB9J@7-U?WH2!>G=N3^i@;*DVEe-c z?h-DR2QRDMy?f7BjCqWnH?6=61(cbSxgaV$>XOA`;X51-czSyx^sP|zboXq}*qAY# zz9GH-pGk+S`V#;E02y>e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00X2+L_t(o!|j&AYui>F$G>lA z@B|LLKnE7=5S#u1bzu+%c8FLCvFM;KIm9BnxD?iUJFH7~_rNWC2fJG3}E z6w3z>*$;1x>`r{xd;^m;w4 z-(9EGuU4sl(0^=|Eiykf$$n_3YTMcCU>rDkR{%tS`^<%u5()rxb~{x2v4;9jbtWT; zn>TKfmen95iOy~ZfJC>~g_IJ{_nuRGr;X{%G*-V}T{0IJWj#4?gF<_(4j=pJ-& z=i581xL9Pyya6Eu+%1=+l%pLhKyD_7;$jh{%O#X9mykOj1FDLOqy(iaCFc7+DxX(i zKeQ=(F3YSXi$MXxqY$3wp?}mL^|kM#`)4;^h;tx9qLGnIV7)yL(^J#1mMms1Tg+Oq znD&7dZ&(>W2Na<3w85;hh5F+<%qwQ>fy6vKT~E#vQ;nXqW=@|2=N!Rd0M0phhC^gT zGS)xR!4)0@I8BFCMa8WzZn3p{YtS?e_J*AtJg>Qb&>6!}74`HMQVL4HUq=hr8vH@v*_QtOh7ZG%UFl51gAiIEE=5`!=lg zzl{^9@fZV6nHb{$XA#i}pPV_st?g| z9~SBd12gY?-}~PCeZTkKHw+QsWex{k@_6OIf6sx`qf`YewKl!Qp)*6!bsfSkfkrQlGS4qw{(Tue`+EpZ7Ob;qjdilN|q@B&f`DfAuaW5PXQ%4V~ezA?=>9F>5LoF5^}vM?AOWLB0} z{&e(>8yZ&;&~NKxJ+t82=z=n%;MCWr7yvNt7zpkOA(P3F+wHDEL7tK^d~Vn__P01- z7zV7I1;a3K?AS2|0Q6sV0sxNlVngGGip`C?2DvtRux0a>DrEkW1L~{_01$Y=o>b?H zGODkj zfC$#fLcgus1}8305Vw`H4L`W|fI|C1Oyo#}5d$JxeSV~$q@m4e_L}%)oMI3H*sOy7zJA*Qu8p(j#7+^5 zPff5*EL2UkH296Gps;Lz03er8}9_5yD$mjFO=kqAN+jXE+ z?aI$uo>GW=$BUNNTbL3r&VF~6;AAoQ)zO;lKYZvgu}v(@v=GI8CNEQ-+d9O6h`u z!AMyu1xcM%plT{g`95)Zg19ygEpN0i^$-|2e-{32ewb+!mStgOd8KBrSThu{Lny-c zFopD!G?j8c*cGe`f9!aS`akIh-@!w_qr-S;AoE*>>LO4++-^5xSr*ANGMZm&MzAwT zX4=H=4|lIiK6$E0+}{1Y%&lK;*_&$fT1_(6wASC#Z@1j>AI1^vtRKBJHiFoR7#t1< z_z!r-)#NJOvg|se&1ocElvWX`Rn3S9p?x9Z+BovP=cA;atf+pfrqbx8QCk){5}~A? zr1JIA!6t~KH3xMFr>b6E(yfW05> zt;&wx{k`@v7>^7@4n?qI`;JPz^^Smukhq?p$En9_HlKw2GbQJfWSVBp=46^CCFBH| n3nt~3a#i!ptAE4)y#s#$gEY+O>%l$n00000NkvXXu0mjfSPhK+ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/button/sum.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/button/sum.png new file mode 100644 index 0000000000000000000000000000000000000000..8c663e2bc0b315ae98a5892227b9bd27c4a393a9 GIT binary patch literal 4273 zcmc&%Ur19?82=`cn`sOZnmtYNW%SY=23@KL?_9dU%tnwwMCBHlu7A4}h%d=Bs@ank z$ku~0dk7aK?xC1((L*sG1lL1!AADF3!S*0HNI0GEta8lVI`=g2z_)w$o$ufI&hI;a z9`*P2G&de@1b}8wZ?~U*?MUW*^fx>@x=BBl+r1aU0Q(OjnP4_%qs#`?<8wEBt+!g5 zT8bYgFHu&j>K;&Cw?d)dO%+^sgICmGz9RE`1;R3IB*ESdc@P+b#B07vRk#h zi4a2d_O8|akL%S>t4v+{q5+afs~1s1otft|B)gUcMN=UAISX4qwjeSdF&VWdoPkzb zE947#kR-`uZZbpRd%>u0CNCVo;_F4gAlf?GAoDQ;(lJRW06-9mkkl!Y^h%oPN}UqP zZRCXP2xS1lXEp;UT?(6Zp-_PMd|arU_Ph+at04I*NfIv;Y{m$>QnUQ}Zb5Og2*qtm z#UiBNrunPE$ofa0Mv4EdpU`rnYP+$MSV$1XtyCSWCXYPBz!@GICSISP#9qXzI+}hq zU6o(60MHO-!Rzz>sRBLYJbc3$K%==_4!j;OLBc+dBRv^mWePMbLzW3W<2-z!eE^|P z!3Oei8E^v%Tnz~A0cb}!091}lMod_GHXGg!1RGD9^ki@ehC^XGyt^cMdBPZwPs#*K zlGl-*oKOI4<~4ARK^YDJOD}v!Kkd=SQA1fV1j3OUBdqQn4o6kQEzB>F_*}f|m>!e+ zG#ncpBgv&?$2h?G$`8+ga!Gs>;1wMkUek>p? znSpYLMjt3#8PGJ1Xd4KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd zST$CUHDeuEH+B^pz@B062qXfFfD`NpUW5?BY=V%GM_5c)L#QR}BeW8_2v-S%gfYS= zB9o|3v?Y2H`NVi)In3rTB8+ej^> zQ=~r95NVuDChL%G$=>7$vVg20myx%S50Foi`^m%Pw-h?Xh~i8Mq9jtJloCocWk2Nv zrJpiFnV_ms&8eQ$2&#xWpIS+6pmtC%Q-`S&GF4Q#^mhymh7E(qNMa}%YZ-ePrx>>xFPTiH1=E+A$W$=bG8>s^ zm=Bn5Rah$aDtr}@$`X}2l~$F0mFKEdRdZE8)p@E5RI61Ft6o-prbbn>P~)iy)E2AN zsU20jsWz_8Qg>31P|s0cqrPALg8E|(vWA65poU1JRAaZs8I2(p#xiB`SVGovRs-uS zYnV-9TeA7=Om+qP8+I>yOjAR1s%ETak!GFdam@h^# z)@rS0t$wXH+Irf)+G6c;?H29p+V6F6oj{!|o%K3xI`?%6x;DB|x`n#ibhIR?(H}Q3Gzd138Ei2)WAMz7W9Vy`X}HnwgyEn!VS)>mv$8&{hQn>w4zwy3R}t;BYlZQm5)6pty=DfLrs+A-|>>;~;Q z_F?uV_HFjh9n2gO9o9Q^JA86v({H5aB!kjoO6 zc9$1ZZKsN-Zl8L~mE{`ly3)1N^`o1+o7}D0ZPeY&J;i;i`%NyJ8_8Y6J?}yE@b_5a zam?eLr<8@mESk|3$_SkmS{wQ>%qC18))9_|&j{ZT zes8AvOzF(F2#DZEY>2oYX&IRp`F#{ADl)1r>QS^)ba8a|EY_^#S^HO&t^Rgqwv=MZThqqEWH8 zxJo>d=ABlR_Bh=;eM9Tw|Ih34~oTE|= zX_mAr*D$vzw@+p(E0Yc6dFE}(8oqt`+R{gE3x4zjX+Sb3_cYE^= zgB=w+-tUy`ytONMS8KgRef4hA?t0j zufM;t32jm~jUGrkaOInTZ`zyfns>EuS}G30LFK_G-==(f<51|K&cocp&EJ`SxAh3? zNO>#LI=^+SEu(FqJ)ynt=!~PC9bO$rzPJB=?=j6w@a-(u02P7 zaQ)#(uUl{HW%tYNS3ItC^iAtK(eKlL`f9+{bJzISE?u8_z3;~C8@FyI-5j_jy7l;W z_U#vU3hqqYU3!mrul&B+{ptt$59)uk{;_4iZQ%G|z+lhASr6|H35TBkl>gI*;nGLU zN7W-nBaM%pA0HbH8olyl&XeJ%vZoWz%6?Y=dFykl=imL}`%BMQ{Mhgd`HRoLu6e2R za__6DuR6yg#~-}Tc|Gx_{H@O0eebyMy5GmWADJlpK>kqk(fVV@r_fLLKIeS?{4e)} z^ZO;zpECde03c&XQcVB=dL;k=fP(-4`Tqa_faw4Lbua(`>RI+y?e7jKeZ#YO-C z0KG{>K~#9!)YGqOf?*WL@y|O=UVv$M6Dx+91;H#6!w|d!v8-7a7YswML6C*rz~X|4 z!5|n0Yqr5G@5(b6gZK4ePudqwIB?F7^Eb=$TnZNwNfxO7bcWBPbMXW87wyN+Un*!~ z{yQgD;1Ww5aa-6z0kx1^M;Gs971V-#lVO1?JmBfv7GCg%do*x|9@dz|tZ|4F#@J(u z58U80M&K1K98d`@jIoWngTM~gSYd-%*@UzI{|m_iUjqO#$|0DX*G=XC0000aX?ir2agLF* zFcxe{+S_LZ`C$sm6o4*QZuz0E4x7jj= sA8v;?&zesE{nIP==1gCIxKNN59!MY4$FEbcw31)0M!n^Hs=c}T4dWyxpa1{> literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char.png new file mode 100644 index 0000000000000000000000000000000000000000..4eef3c380b0f322363f83f032d27ff8367f54a71 GIT binary patch literal 89633 zcmeF3WmFu^+O7$KK!6~@10+a*;2JczyIXL#fnYNPcXuafa1TBNx8N3h1}6|)gZpXT z_uJpz`#bxrb^e~U&QGZ6?&|82=eh2?Doj~X>IK>>Gz0{M7c$b~st5>3x(EnQT2P+> z|9Jv0O+r8*N01R0QU7ePcZd9)spt3(iyO0Z(cjhq73n$Bi-XPp+=YN<6jvDsS69Th z+DAs6i=qy$4?aS7ZD1d-jnO>;kHaqqyqo3jStl7DV_5?FwM|V$wqT7jR-uP%o-k}| zL{VW>)F%|=NP)ip`iC$zDh5?e!Anvw?*CTyUqAeeBo6Jz{`brNc@Jd@L`q$HB(;W@ z|NewKWIwv1jETFuLmyX;VOB986&-i9$LC+a04}&z(2`O4_XjG!K;&Nbtetn6R9N(R zxLLNbFK+(3!oqJJYe4?*HRvE0GlIe`oIUpIQ*@n2-lM=1b{&Hr>*a`z4S$JZSx@=z zulmZbqZ>l_hS`U{BNJ$UEigH3 zy~yJKov5~Oe{-09|0LfJ+lm~h`70Qms?5K%WB{?B(EV|Y;EqY*7Yq6q-5JiK+xKUc zK8-3;Wc8=6?v2=+E~&=Bj{JL70Ui%`7p-~McNfdeXEVBE747%etqV=(hokRj_3Vo> zAx|c z_P(i5dOws<*?vE#z_*=$u;4rfW+<=f`r5tUeAwokV(9HwvRTMA@yX|AUUhZ`JWiYK z`AgHl&D?b}({*M#@E|=v__x{6T8z*E>pL2z|Ityl@cc}pd3yzpf8Z{~F;G2RjrlBm zI2m5c?AGr3CaAa(#l5uEOY*6OV#K~~T=HP~;l9D+&j77y$%G33*4eJ%!`v$448;(0 zb2`six67{F*8HkS`wRaLb!I zjtOb1M(d)?nHay)joiTj0>0QPaqqXl82cfD0KNX!eBi`TQKy>mY&sn1kuo@+_v>dD zb}QSL;xHK#sYSoGllum+55CL$Z22wnc3a8ENloE>QcQ3dwRp&a>#|ogGGDaEJLfTh zhM0I?PMfq9X~u>HC;R4oXqm)&%E?Z*`K!UY!_}kJF}EQTAmJ$Ze#WVk&784m=|Pt&H++W@ztVSZ@a6Dmu)6YHv+< z>?IZmezmcS%#EAo8_sGPTFrrX9B@0K%4N?msmrDZY~)RmPz;A;uG@4`%D z?1oRooL)P0Jn?oF5x2atuf`r^)ST6Gj>4)Yl~)Z!W-&hMoS`0NktOH603IW0WWuiw zZ(BV))iG#~+fjC%+NO&6@QaX+r$3S!%>jx_kUJG+wCPgSFF~lkPS!XsNitGVJIcqD zomoeek%1#cIzGQ_^iujsF2;<$>moEJD(~`YGuuPn6g7^sc1*DOfufY3LCesqUKc#A z(V7shHiy?)LK~mQ7&aZXq(H4p{^GUA9-HgUenW#7Q!>|IVYE#O zT<{+WkujF1LSkn*P?JRcBSm8S@2d-<=uA_ako;_sLY(JR z)=?e67hO@Ca#&YGv*nvK4-)Vr_9=N~abBPitv1NY1%bxmQ z;S9;wic1nt<3XzhD0#E8i3d~lBN#g@>@pQKgY>Th_z3AU{TJT!6J%)gmnN=8NG9WC zg}&a1{nKS!-5s$4e1l!Q`-xdop*_xyo!R}NA-H^jCHD1cU!E||Y54W2_SQ4U@&^a4B=Q*99Rcl)6gkNPnRhJ`95u~ZR z&Yo+u?Ua_aoJhUni$kDkFt z*ar&zZ#EPa0cn&vPGMJJADMHa#5m&(rmS7ellV9+*&aNPdk8T>p;K0+oIxOCufC61 zVG7XO9j*31TrR*w$X%cAbVeB;;UWlPlH*DCihUvmt>Tc3W*m(i2qv-LBJ|Et>lQr) zR-g+-{N>dk2VinZ>5-eAj`ZDsO?W1QO9~-yk=IrT_qC#jcM(x7XORi^QVG!^34}_! z19R4$|3bz(<(~pYGDp~WC+T^icy!>pEYGJ`ogJ8l3DT4shz@3?y`eBvJH&FU`Os1t ziG%`5-OwrWYhP0D4BWsbRGy>2?%H>juAJ#MonY)2w^Jep#_fB`u9V<8UNF1E%PxI^ zd4W6&dw-|KH;Iq=G)7{4RgFZn{8(J_PuNNOxRF#<-`nFoK9zN zSFwDG6?)il81gw;`({g|im*Zh-rrxYd94XZQ2XksoK&+RV#|zGMPOlEK<$8ejaz#}qM%Bl zwnEnGww9g-gF3CWUDk$IwW}{__Ck8n@$I{G$hk4ZI1qz_h>#RAo8g&|J)`z4K{LlB zYCX^epG36rlkZ8rz=o6e%0j*y)lep?JZq7wt2IpbaIx9qnv<_o^mHE zHH*^-JsIV1em|p~cjOWK^^!xpNrXs*k-c)70*^k3i1v3+V1GIgXnFQOgt<`fCm{CI znPoWk9y{ag7AmJc?Wm>OUD?x1<^+;&QtN<`}{>Gp$>8mb#40I*GU<@!>yM$)ZSC zdQ5QM=hQ~u&Hh%e@20z5AcatcrGLe}Ciad+HU7+eH~1m#&VzPrVY}YAJ?IX;?X}ai zq*`UN7Ju=94wy2XDA7Jj#KubctvRjup@O8;_(DwcU~hpFxIR~G7ZpV0kkrcfx+k^ne7j-Xtk<~-|4?=Ey#J*X4EMTN3|V-^-XDtJ`=L#EShRALL$y4yG2D$-DRqea zE{p&a&q+}e1a|mdO&9^n>E}RBG#%y#pYuXpfgrdESdPlpEShL^KVRuAX~F2xU8uNg z=B9p&*L~ERC}cv2fGLt{WKnB`i}kf?b`tLCY%^qKB0uHXFgEguk%1nCN`80n55}>< z|KPr@3&Zp=fO#w_pqkg=sw4gU5XyAv8nYW*y($*bFBGJ^iMf-ZA6o-<`Jzz$ zeNQPAhpnjd3(DKBcf6Q8WnQ={?EYXpYjy1H{3^{e-JQ!_L+d|Pa3jakx*j_CHP)8F zI7j{+&p6|hG&x$ZHcIMIu%dehN<-X=&=kdT`c`pbXusHEM zx~gbcYT}v>4K^XIcWxUe%rwE%A%IV`HHSInZHx`Ev@dL$^uGE*V{30CuIIj8;3a5@ zNo`*HObdzc zC;8V9QW2wrOnH1^ zR5z*^AeC;sAbS$GR`@`aNDQ zO#$64$u+y>4{4S{K|ES6M>B^wVZkl~<~Fx70gaoF0B;Cz{}+rH;`d)WcVlrP7D{>d%niCYUlR>cN=^{s~E&*oEYw zeEY@pl`P@v)tt}zUpU*ttZ7p|1l8hZvBqn47s$##>uNO#LfSCK&zgw8UVkO$W4uYF zSBzKC!&z{co<`qIiU4uj)+TUNMX5H5csf_avMVdLU;p6Njy;V$u58I?qa&c!I;IVB z5~njh&O{Y|Q9>6ugymu^mAn9}bZzblX~Y@alIXl1Gi zn5t?*&aCNs$HDE;B{95aY4~{+St@@7NX68(8~hjbAP;eTq(T$CsR?16?6j5Bbo@a6 zl{rhT$(I1kMtOezb+KvU0;wyc0c3X{U0xFPab!d0tlO&W8U4yl4Z3ik@0dYoMXBx_ zo};9qZ{;)nM-qC83VDO}ali=A&wfR)%#=v>T?DV2t+ivoe;$v>d3J`TuojaSj$x-G zFg%gzONmvKs`gRM;ZJ%Z0zLY<3SWKZ&xwT_sj$FLcY$B4uo*@WJx}O;M zj>M4xCS_oiV_W)j`rc{qkLP~chd%`goBJDcvBFfX^vO@>WVI&4T(QtQXtn~|fW=%j ztaxqQ+KM;&-Kc~<#qlCcSAUsemSi*h==K8z6AJB<_*BuZe9xBSUJ`H#$9fwKqmK|* zKy(f<@EM63>_v)axmvjB>wkv# z%AM!1`Z^N2CJ(GO@uGK~hL|?d1#mS2V!bbKmLJ-brg+Wxov(mQY*voD{+4;)>49v3alNKCug=vPN^J!mm%{T0T1@c@%s>!fF;l zraL$^0uiqu|HkCc6gVi#LSf+GaOtsg8Uo4ukSfSRA8h+xPxbY5RE738E3#&d)>DoI zZ8gPd6VaMH$MLf0{t$L;{5S@J9&`6Xq6f_wBz{>1`5DT%h;I_7v7jxiDvLpmfG5hLp$=tm6OO0>c(J@sJyqtp_K?{*S%qj1K2D+pH4naJ+xku3UrD@6o{RH*UWowYj?eV zilDghS6;u{0`k?L?Vogce}QBHKBFqQ6MVrEh_~HK`f2zRX@+*hW)%@LvN10OCCwM5 zyC-wzDbOS}DRFE}P8Bq^z))05DrwxoLUli42tipY+n8L%s|kTYsN9=)MeXE_?PrrT z@k}33?z*>4rv&{O8D7a@*NCIyNq}7fWWF3Kuc5rOT5#+mbK-rA(zjxPe#N0Q4G$?q z5J#6Nu27_K-j0)cy$!a>%?CmoS2GSClX#}n=Q#0rfx&f;oFW~j(8wo}Q5$V^aHt7{ zKjDg0HU-kdgeDEXTOOicg(y4T%8u6*&eS8Q5u6&Qsi0*bK80}7s{IS?| z+2EUAqy#w>Z&5`cF;W`xwfbbvnqClyXt<(f;+%p7mGCbJ;Ht>sXG>4}g7o)7-gv`8 zeymj~Uyv&m2MIIbXP{?fmF|<$`bwCo*r*lbijM;@YBTQ>`O9LFfFG0}tZ%;O%t!===;)G+3#hX%D-zb}I1r(A{7^8=&vky5Hy)LuB!B2a8UxpfMhja#!>r^xQoft#8; zMS7z5UE!*p6ftnT3SDyk67CfIUShhIOHFb1b9w-JNhmK9BEAsz4Z}PCC@%MuPmCVb zPb3r}NKfZGTn68q!l+X!zhjtVOz)hb$v&3KC|?wgmsGk+NgtL*JoPX%D9o`f(spC2{_0vV#~BV&e=2wK5}2p-N~cFC`GS5w9q55HraUzKBlYjH9?A(uu$L z%F=de(%%J%Dtnd?1hgfme&6wT6GIGq|6rex5XoVs6D@gP@!*REfXjU4!2@`fJ` z1-Vn6Oe=*xARP2l9szB4spm~8S7I#kQNo7ew|VQ?%!w4lS&uu8=_SR_=ZN{AMabiK zrew*9N|eMYK22mx@9NssPxD#J&dx;oPSeRJF{_`fou$u5fVR2ysU`jr8~$5W5oSZg zQ|(pJRF5dnCqd%*m5i6eE|u(z@xI-C1YxlpO@K4PJ5OF#X#DvX;5O$RXqW}Fy|G4Y_zyANN z_WL1X1TcE=#j;O(Gl2FN%@Py{id5<+a1e#=P80qTqPXTklj9dI)&KIr-6f2E#xnJh zxn|58hmg7V*mn55iR_U5FX^iX^}{*L)c#xJ#vj6RV7fa1BqLnChmekg=EDO_K#>w< z{M<+CJj`YfGY*OJpM8q;VPzxR$J_M>j?{MXuGj@1?JzTvspt!Wqfjn0qT_Rv{|3K$lSMbx};Gtq>&1<+-)v) z$|{?HdAg73`-=Z~*70Vx52PD|BN7n)W)~9G6p1SqAuj|jR|2wNzIgBAA33;P+tmis z^DmHnmp@mJ0SLaxaX(cI2E`(#Z3dgeN$(c*@$(Yb`Me{+Ez@jO+=T(A|;PD~h zQr}AoWn{!hX(3zf826ItR{@$jI3^KQnEasq;U057`62xq?K5P!Xnt=r|H0N@N*b`l z6^S*!sbj1u@St{Ze;lw7 z)?C$%q7VTkWH=0&(qt$6be8ChRl>A37+@wGb#c`f7M*UsX6t!{yWgCF&r;<2+2r|X7tp?YK$TD~{tU73 zL#F2k0QvJb1a3}v0pP815$_*(aZGIE-=IvYWWehQ8SaWsd_c-_+aTr!gg%cRKpfcGpW#R8(u4$R3OGl#%9V+H1vI*I@RvN*Rz?$VK!1QVwrRU4 zdr63kOTX7UMbAm*Q4YExGYjoarL3W*nVW{1D^kSa##>M#-hj`Yyc?g&-PHI7 z>tYmd$sPqdysiME!m(Lp?er% zu-S*IbW$~O=nwJc3uu=64juOpW9=o$aaTHcMrV=G(35SwSNtszeAdIZsasfb1rSUj z?bp+lA3ARUji(VvoGX>YpNl^`>8_tO*xfZ`s{1J#<^OcizU5dlJ6EINlpCO!FL$YD zRBpNYrdY%FJ2uH&I+~&{NUnSEW?DdVI^ygU*Et*ufhJ}9T$Luj%mRk5&g&tnOj}v^!iCi0`&jp z+h@`?)rn)V-2GHWCc8R`Iw}%A=kicim_xi8`!{pGx71I-OA z)S*f!Ct$z=p>zn$?2}nm6d%Kn&j5Mx=3$Mo{pO(A9#Ego9u(_67JOn83xg4?qhaHK zj=!B50tl0is63CNE(_?oNa${05zvb5ffUCM&w)~RA@C3xD>7%7cj0 zt4E9`dv^NrDY^b!Gu10nxLG0@gtrYrzfivbEt!0i{?Z$gIR*&3QPR{kymT2uOz$~^ z9&9B7w}%+54U-J?6PSpwDTDyE$g8~=mKiU;Wrq0Glo)#@O;mMdDvGI~mri2&w1F$E z%MF##L(w3^%o zuxsgl>WY2U?V-=Z?$77`j7fT*SA!0I;3}QcLPvPkBJIQJ3b$%QbpYtP2n@mlNiwi{ zw(Jxq@t#>k+$+WpVqLyLRdHy>;j)qUwW8m7UQ8_;FLn@#7r}z$9W!bapFH&GK&_%^ z0(U2U9+i2PNMe$_as_RA`90KpO{lfFz8Y7=2n7u#uWkbBjna6Cg%~_hSz7Z*P69!v zohzyX{VYf5YW0(3UH)66YUkQ3B4>yJiG>pUn#~PKUY_hrrCU*8I{Iz)RRUjSGWBGI zqJA9HJ23&g$UpXAvz^66+1 zt9`4x;IoE4t-9V77Z9GD5~U{`PPMv*bv8E~69^s+jbC@Tni}8S z^}%jVCzTRLkqIPT#($GQlII?S@4J#?xupc2XB62sTpXr>j47tk;U*MTi}Xv|7pk$S zi|m(@l)lGC*s_*44LFBj(AhcUN4JS#l_AjU3fd=kgQlL&x$jnZ zWxm+4_gw>QG8q{T)tt0hhd@AckhXq^pM7*=+_}RS{ro^u3sOa>3u1fFK-bww2 zi;8(9M>hR3>zk=pveQx>Z_aZZE(7v?O4`_%%6&LqHj*=>GcdZh&@^h^;-!x%3$6smsK>+ z_rJ7@V2Zud%u&)ZLpRd>#@JC{!8PRK4XP=KRCJqFPkJ+BcLQ|S-sH68hy|vlr&k`O z@Cn_+mrR{FYZ`>x!;|5magPoNspSlZuIEc^g&o^Kn6ay=ZH(;N{et__rON9ZUepk> zvpS!j|2W2-J@%@luv|;d%VJUS2sXsO@<}(@*HH(BEHXp~DpDAU1QH>w0TvS;ab(I- zp4_y&oX)*0j{}(;gAy(j4)_Fp!!qdwOp!oQUghlzGr3Z{h;p`S=I2-z@618?hIm;` z)(ydR4eG(+=?vgznms*Bdq_U;4pYln?k^-pa708Ms1HJUTrn}G(5AN3!lnh>pDyFCU++WEV z3dOSEJvQIW@1x(=$YCNo*gr6NOJRa665;8T;yRX*(z1l0g0 zw$CK~!vRyarBm(VGYK(2#jRK8 z#ff5k&ej$x?4p_fmU)Cb-#FxPPcvg%eVh~}ExTV8a&MV>t>Tg<&*)*RCCvkwk~DbY zC{18vP$12~IgxY~D&2e($Q03*gJoJ2XuewytDe%xs#ySn3Z##1DAb#X#LNY5Qjj9A}s!;At1DFV&2izasm=Tsx}viGUGITH2zt4-y$1p887 ziVDFb%;Y{1D5rF5NtR8y{W5o%dOsq*63H>@kZ#{p!oOQyd)rLSkiUZiSA`fT94CUK zTJJ@nu&~YIiHaGNT8dAbnfoo+DPuvn%l8>!P?h>7T3 z6-AkhiCIs6GL`Edakl_Q6*6mv~Hu8n<$S}d!{-5srs6u zvY)}3X0!#rFiK(%pX|c~y+WOR2IC);=3mR2B*T0ZhkNDZ-j%_P1Ttio7-_sC=zRSK#Sx@)7E|K~}^3;Rf&KirH>yDv6uh z7=k3Uw|*hDXLni@_4$9CGaWGjAfN7R&GJxL~;6}=3-s>40@~vZnhYiA?{2Yzvf35t-Zozu7_2LCUzGgehgK^pKUsT|-4LBvDchesm7{C! z`-u-O8Zs|eJ$$0>6@`z!)|TA&kvk{u0%IRUN2AEna^$a6bh-b@NB7kM5K0VJeE$`G zAG(n0f6^6K2{6|0l_@`w06kEb#dldlOaHfzDk@mdWZp4+lN7@){uy-UqwST{Z*g+P zXQgV=R5fI|Ee^kdQ2S^0JBh(pC!k4jGdXAXACU4ZyXXMk{@eEF;^v;{!t=r%yeCX6YhfiGk~e%K0h}AOYr;iol}0YwugI<3n1%n zGQ9tja;NA@x4?)bTJt+6oro3RT~9X}v7C^v z%7{b5EPB|6JbkJR119lbw`RPIp~3TkZb9VgJCuq|H-)H2ZJNE2(&D`}9}+ei$ZM$a z|GcnEkx3+Uwn_e;bHu62)b+0YdWXRkh;o`9?Ivt|ZMT1hqSqWv^O-m|ativtiu$5P zJ(^zbd3p+m_8XQDB#DdzRq5hdKcK%|1u`Yh{C<4~r;uN3vCNb5911LeHS6Fp<(^Ci z)_ol5y;4-dIHt@C;qkb!%;l1$Pn_0bW2zkvGirsJQxTuRt_@Q(Wv-KW!{noBUn3+M z#oiUt;Fj%z7wKpa-QI_pK(m`FM8u#SqlJ7s^k7=o32$7q7I1FmH+)0@+T{!TCZtJ{ z*l{kOvh|U!-G(ROfh#Y;PcoXIG4g*unKZlecGOo#A1VHExYckjO~*u|It zE1Nbh;r|QX1a^>%t^n?|BXC%#4V^BQ8Fpu$)L*akw;j9Vt0aIPzaDrCwEPQ+`WJV$ z@_WE1T`H-5f&17Fe_!;k@bcMX`7`jv?&`lI)PMZOuM`IxuKGT=Df>U)pS2h$XD@Cx z#A5jyH~-J4s7LwsCzs+(-~CIa0A~8%_ZN9A7g@Y>|NQs+|AU$S<2PSz0K>U@RPh1r zKQDUnFF(b2EXUY6nC(XY*MI->O*N>eS1OB2|M~tzQ$RWK)M8}_ zA>x0$Ln-iy<)%Y-y#Hfq;Qvh*sQ)LIES=H#yDwm9BN=$?zwaBPj9_Fp%C1g9xdDQm z+u6QXw&e!)d53>(5cubJdWSkC3I%;%4PG)%bsD52LtjtQGT1Y`ZL#u-R+59#C zbJ*TatCOniSOd6~qdS9b+r1606{8*754t4jviT+|+Qr55drMR#6Y?+)kiBZ4=3qy43LD>-ZGY6`z^ zn2}c}(5Q}9oUg$FFSw3ui5^Y%XA~Wz9jOs?Tqr9=kpkzi10d|Shqu_hBKrCSWL>r)Pkev}ZlntG=6pdF@aXzKI;wKE++_3Tf6v@ze^o{V|DPQSt> z`9+IgV!Urj_Eb(GVt*kJAqUqKn@p`uE1b2)&G)KnBa#TBK*FPlZ365d*ieQRBQMu;VK@i#^1OW%|EBF3g0{>fw9tB zaR0HJq@a;JH>y}-@(lh~z2WF$Qf}G@g}=1_S_C6C@vd>J4h4x??lH|2hQJ%_vfvw2 zcxv)&f!MWCsirXk&?2y#yx~ z@6bx<#$|?4T1eFxOIb0yJ0UZ*=pS5aLt9dN6Zf+j6&1GI8EHyR*(t-3;d zMh;z2wJoC)RRc4*%Us2J(|Mcfz6Eu>UwRjBMY4&lV=$9#^jw?WEbuv26~yqKNtu z#dPR1EBxPTr;6osZGV<7B-ZgDv*?ORaZE%)y}=wdn4(1CYVW1Z4^UWL?1>06!q3E) zHAnff`yep8jyO52NumRy0=+FZ1ftOMiRy=<$h4ZDx_c-$(eH`z;Jnw`oL~0$;PqTN zzvD#Bdlf2YwJ#}=B1X_}U)1CgT71`P?Xb>^;(8@2`X%bjeOa;1aO%@)G~eAb$gpm; zG(A<0E)%0J;EV7VDVhxy_hZ6V-8;{7Wx!zkAb3tWb_A-2)i!cKzVY0do4yes4gkzF ze^}A_42U;#)o$!uTSuO+f>(a<_d-_Y7xQ+;(${$sDcDqbwJ8qFPs^LK{~V;ux++k7 z+{^5Jg(k&<%x1SXGI3H9N3vyQn*$a(>qw3hwo&P}ZacEF! zJCQ*wD2D^@dQW%zL6^2Z93dLV*rtMrU)G8F8!X(%q+tR^+RjwAGm!_fGEbSV5hRXhk;}b%VrNgUwWVb|qoNWjeiV z`*m;l8U^Kfs}ZMkNPZnw+hV111bNLLBq^jpPy7_C$ppK(%>FRxRpTyrv~taVGG+?i z8=~g=5^|>|X=XThy|-lry}`?*~1jjj#LBf6Xg zk@f>7W+%dEy6p0`n0S2EPr7az!k~Ebql0|fnx5?EX+76$({t?nTqmG~{$~3=M~!9l z%>eb2@4N~UB8jd)nX%W%9C^dNr#ys4;K9JKr_E zzg?s}b|;=}_2h=)E-23CE}kZiGo9a8Ef4De)>Xpa`wnu|k^?(aZ~Hn4+AAhjK)1)F zCD%1!W)THOI3n>j2~>3z4$MmLV?xHME>TzcQhapHti!K3J+abX8_$`e)f8yh6l5Yy z*(;X)a`w1L4zn@eH&IE_sMFtgt&qkc<`vQZ^ymk4s~cu(9MRTi7^-kuw>wl5XwZCP zCR7PD)WFy03A|V^dcqfE#G!0uqLw1uHPqlhB=_I@?CjP*i>h6x!}|j?^F@oE8TOo6 z2$k$FPL$PLmFYNDhFdZ_V=>s^zx)jK=(#wtd79MtDQWgA338L_^eyWj->bgsC~pkM z!9oM|t6PbS!T5JAp%w26y!sT8Y_wP_WxX7O$Ell%gblkZ2G8df%QOHF#fZJaIcyYi zQNDA6H!8xgxJ@P3JZz9+BUKR=$3($pVOSE*n9i)DNc)XJzsV#yvc$B)_@Fr#my^6GzFf?#HlwjKbo^E4uuQ0^Ub8bKe zaIU-LDt^qW+Qv40{nd^^*f1ERVm9=!%hVrmbcCyGSfeAcT=2)VoXfbhZa24H&UAo4 z4$DfTs<^br41R;h_VxTCG1C_3Eu*NNF}7{Z;4e%5JplOM#Xe8)bmwoXVqDVD*IMuQ z)qyh0XxKsAv!~9KMZHGi2403#Kq&dVmTG3xnS!i6bWjAFtLQuqOTUS|F<>l-!5Tf+ zB`AW8Q@Q;Jm#_|uGow=t4F~bEP*&3OTZ6MT&Cr+SWHyQ%FvF{Cw5TXq#04cEej6u( z9aMQZ&-cvLEOvTJ>6+_u0;cIB(*?UXRI{E<<@Xcp_3voH(x{Pn$>yw=JYM_~lrO57 z|JLZkv(y==PDYiRCJFt@LbQq?DqE16p7s)sNMJrhf@jV(Wo@YNg`;-NDpf}&Mia*$ z{42rr5YKiHG6vJG>4^p_;Dk@1)wR5OqoCc-O8%vV^>bNiW;jR$YYvJ^B1b0O<1%M< z4am$`+aIY;e!kbZ%l8<=W*`KtcC0k} zR^0~kJEu1al)77QPU+B;xKMuP8uEF~*jKUysBAfa=K=4JslkdsioRR{`QsFxng?gj z#mr<{{7!P~ai^HjPoVoS$H6wbht~k3ds--#MV3ccq}UtDIa0WzT%2aoL})6ia%>Py-ybfKRM|E z5Pu9ED3j~?d#PT4i3qV&e>O6ZvH;A@TgWN3+Zu4UfFMhdWh)sxzGg`hZS$)YGm98@ zeyF{5NZho;bE+njmUJE5VIXeKS{R0Ans7JEM2o?LqosCWeYm{WNt@#> zv3&*>5(8p~Bb{AJEWm2NSZGrE0xPS8xrLrWw_Nxe+0C$j!c<}+&P!jwy_WfEMtrMB z+WpF&%j@f6S8ED%(34x&G;i3|L~pXr8$Fvh-IerdjHX?cwg_#6tn6xWy7wtb1Y*Q( zHDZ}24|kBg8(0$LXW7^e&BJeIA%2iV)Sc1?k(CR`-JlX?xcNlnyxD(AW{gvn z9+{}j5BL&*OpFJ_%F`KkbXe84*!eD)fA(_p)#a?5lSQ#@aq}~uChg#HM<5RJi!ehz zQru0x?ek-kYOkY*We;|u?YD26$q`ZD%p0>%;&jBgzBwl-i#E|D>?I|6qeGdusHf7` zT!pVVoMc?Rz&D3=Xr10=e*4`($!2?9r(-LOHmkoP%0eQ@E^}$X%cB)4<7{!s2#!Np z{H0NNZn!teW4fXN;4u9v4r|r^a(Rk8d;W4EZJBc z%%zYiWFkJ7^BB^>5Y+2S81fhQdV*s{#xp8O;k1I1xdEtTi7Aa=bn5ou52J z)4?fIb((VxO^YhHMjVawbl#ZX(16$Tw|+PeTl-$&NBTHb>RqEr3atvmh@nJx~6k!D3Tp`Z1-R<%`3SPU+e0X>Ua zw=1OcdpWrUJY))djLjNCvw=i>xILw6gLM5g?B~F!g8t`ol#Cts^LxlLV`sv&(6n9} zbKjvS&XBmaZCyj(nwA$rSB$~N|`pG z)Ky{ayJi?BzG=C}auDVX;5psdf8k{siwgNHxdaQBNweJabr^k4#qnn&ylL}Xv&md$ zwTT-=+!a&tw}SALQgVAI6u&fKPLDXM-`DG>bo&}(c{Xp*HIxP2Fc_Q*Kki9FG+ zIBK6~!*4i-^92Cd5^WV*)Zi5;;t`mmAgy(v{3pEPNBBmvcw042K`kc{yI4oy4 zS8*1gBg!m@@~Okf)vlMjUZp#Sn2MUSh1boy(E#Y+B=ci`t1ORLoa7uk;fP9xy2Qle zM@Lp({#0)r)Kk~aewRSaZNlHrcC4)1N~N5<9wkA3dM_TZiAmsSrbK!o5Fg_7#WmB5 z<=jFg&R%0jg%19*#xv~)%GlSL1T;VFClFKO2XiMc6b>i(Bg#CKTI4PGzY(x!?1)JT zOizg!1=0aTu#Xd}!&uSE)g=1AK^*Ki0RK5=(~9^%;2DHRLWgjmCy@4^3EKa^{{Ol5 z`zeI;`Oz-{C|)q0-|3}VYrgTKe}8_~tw$cZr67#(H~s4{5?*=aTxyEE1thlR)$xJ{ z0K!_gNHu3G z!f`GEJhuRBu$>8Qr1Rw5kX>R>h^GPKcF(l(AwX-`-nR}RgB0s4EL~)KUzg}w7bMvj z;)a1rTKT8{3tD2BA!Yg8ySV~tb|YY_?|XDmMR}?d>^%A^0A05)o&~0}z*zm`<>M(1 zb{LvG9Kl$DayEXEe@PHlc~Qw9lLYsH7dSlt&L(i7isDqwJAJh`xMK8px_~{9aGV6@ zm>E&{o&b_-#CL!YHnL$sfU?hsR)AMAMKMa`s}H?D)1zO^9@t-fagJw-xt8ez*k*X= zmVo;&0ERR}l5NVG0-w2pI)X?EFYNv>_8%IQI6?9_@*=JuX$v~QnE_i-ZIbLo zF{&Qmor}ia0USfsOgA#Aw~vNPO?~imF<)u*LkI#U8s_5XwW!TU=YrtR)Dx#(V$07c zCY{KHE^^F``71X9vh#@3U{# zDog-IZS!%}^SL|2oJf$4Z~FasVhLcaXlh6Rm?Kp~!I!aIz3b&DP%twvFy*blI;{~?N=~80D!Tf{bXR+sT zv@o9iWneGJ0O|>4hNzd?nz#>+PMVVo?y*SMb^|mOQ*o>{NL`XfBT4kEdj~0?qs#@a#E;qVez7B>=mrh86&! z_KRo*#U00jLw6%!)aiUAV+Vja$|2;nd$B1kWfJy?6JX0d4ZAiTM+octFpk7V`Q#=V zh>Ui=j3fWS<>!Aq#RIrNn}kh5chGdR4zW_YycnBdYD4AmB<}1PJ`^ z`_m$!tHkfD`c{v^vZ)F?Ct|r)2f8JehfNpXr0Rz~S6LK>F^e=JkqPn4D(Z~`y!w2r zSsSaLZ8-E>Ka_AmXg6GBeXl)0LeEV34<&fsTYp0;`pH5=59qHH119IVwReiwxjXMV zv-$~$zLL2vjKkNFs91Uy-c`PwaPI^=^Nz z1K?IYWi;GNsr#+}vA7IJ6azM${_O{_MQ z3H1!MaafZGu31NtUkdv3&br(DT?QJkTBowlA&bn*QBYrmL@pCXa-in(6{=$v{^C|( z&e4YxRed>s!!mP>^-|F1qE!IqZzandsa<``#0u}F)lAj~Qf zyRhR1jj2nPa_YMLpq7u_-wOE_PFWxBMX-bVzr6HI!T6fRMjM$nu6Qir&giG5!R;Qd3FKt&Cg1e(*hV2&-$t zvb{?-2b&8I6cinRTth~Gb`ZYiP~iSh>Kf@0mdO2Q=hiERT6fy-fbNleC5_}m5zKO> z_AY9e0G}4ifS((&J?cC~ZIh~!Vc>!GtN_SPZx|DAmc_%Kc8}R!xPiIkn2G~X(mmP8 z{6B^Uq$~jmI4o;)>l5J^m<(L($tukC7r0@H=gsBZuyK1qt|KB<;p;&Z5^vQdzusE) z%}7aAtOBR{<+Qhn?@b@Eq`}E_!J2Y&kC(q3j2^-(FQ;O~WX;6>v-}Q;&DE zif$D=`ONnBJCW}CD$wFj&DtdO(>q#u@QtMt3=H=JqW7nOE5ixmB}lrdt93EM5yG>f zNUApa3_g(iOdy@Wvbo&^U!O%~GPt1Qcv<|F(3#YWIiDD*AD&H#%^ptChAe*!KFLn8 ztkf2~9!Op%HO){usVoeT8k$7dnI)JCp!`qOW4=sWPX^f zG$l$smGSW`FoR(kO^uBTz5<3$&H@`tj^N>@s9b zDw&kn{jpkl-S1+?nB@Ln_-yzHfAEYu@iE(9MehXZ@Z3qEPndWihsggT^ypW@vvZ}{ z)jlG&gX-UDii*?Gr`Mc~>v0T<6!6tm+vp|2fIi|^P^<{yMuerfI=gKi8(b`R0SMx> z9{C2)Yy{d+UMuK|Hb>c zo&FcMMf{9N{j(04e7@VRnB6$KK`SyJ=Wg#8?|11#)4U7oG##pG_^S6vQe1%F%LCm+ zH}S-^h3nbPB!W)?^%FOy@zRGDzqm0{Rm46$^R>-1zL#LdPvWJQCNo_d@4vi?r}aLX zu8Bb}+btY_v&xC?i6v7}7{w3tBCOZ+{fJ^eTJ(>}Gy5g`9KTy@f#|9flQ*ZSbTB^qI7G3g&;>TyszdC=FXRkH;#EI#ICrF zV-%bGAX3%?{DkJjB|h%@=6J{MEIiq%%gUT@02sVcSV^x_j8x}ijk@_0>c>R;Ev8K=2P_Oy-s-k>)YkB^T_tw7 zRFPlv7UAe|UeRF@DKt=RhbgNKBFI~|Dyl6ndBSWb@(zc+igoIhejM*}*BG4YN^6aW zc@VguCv39!`hVxB&2;~+=BK@P_ip&H#uzQ^Q?zQ;Q)Y~b&tUEs{-uawUk@Spog!bW zz=ls!<}2%&wN7vfn6$IRXp5cZK^sDPxy5)JbIO%Wag_|$Zdgz>H!Mao<7Jdd$X#9f z=<+s={sCp}W%3o))vAaTajm-dPOagpq5$o5b&I0pL;Zc~2}&e|F|m$%;DhUSq*U@| zHVY-tKQ9!YNjkv7xeRJ_N<&@x3jwuNj)fnVd~?UQY_UcJs7N0Fm)7SF5sT61@|^Bl zQJW?f?w=NwtAuuGE{5^b2}URjK0mk8@h?sFWU=Mcs0*=hkMZYW`_6h`-^pEvhfWrg z9d%Z7<{-~~R&&}%?;77!ZQHEcAhzP1(7qnkgr0eP1`lHwY^u6{b+I5PRjVFhRY9ld z1T7`%>RaUW%k-V=9^5H9_=7b73^{tts|=A*1Ixzyy_5FfZcBVNayowF+3eHeSDqQ9 z@6GdR@XaKqUzq4=d|(bW{T9x4VMd}B_srx$T$-J=-6@V)tc9IASCVgF#tU?&z*D)M z;j$V_6vFfuhWly6_MRP;qTl46319iZSC6-!n!UzDtP`AE6>+|GlNR39=@3>(($}&9 zs#X&9C_uBtyJ;fZQCvxx$Qq@Wm9VN)9If7Os{Jx2->rF+c0UznV=E4UB&8_tinm*l zCQDBd9$a|a;wNn8ITi=0X=m!VmDaienI{bl`_ZJfv#QrA-rw_BzI%-|##Cu&6PJ}g<#L9XAs&x|4(HxK2K zN=R*3eK@dKu7j$YQZW8POiVzrNMr{~c3?%4jVUBCAnMrd4c;BTh|QZs3r@#9eC^*- z!8~FOq)3-9A3JAo*3b3#L|rL`4a)H4K<*-LdC4?4fS&3KFwA=}mGGitpKgB)nub5s z?>(Cs-A(L+*(c^He6QMZr~dLN=haEty$aH_{9(tpPgU7M+vLmSZdBCWaT;1qbvD2; zcVl>aM1jW0{>^>VUml#q%RN3kUyLmBzj#+Brq<9Y?u9Ybw>hkBwxbxWl(2cVj;8-1 zZ4%69YL`$ILHE+I-rJaP3sGdNT*#YLttHg{lAE(3>GI%DJkR`+z29itZ~H*k8PretmMw!i=$Jq1)vq0(K8r8ws*d(q zcCMPM%vq%;`+Hn+^>fC?^j`iVQoDjQRRd~>T{pt360D_X8`QZZ^X^*uWqB4aOV7qw z|D_m0tlLue1qBMHh^{se#))g3M<$qYD6SY0O>4=1*4&wz*dDQs z+~+on&%cgN{zM;{FsJm|KW*VcOwiC{N^0zG) zkL}5(3;nL4Jb9PQb7hm+z-2=s+$0o; zA5$ORQMJN|kWMYfX%AO_mK73`MW@#dm+yv|Jd1ws%#3Mzj^z2K2lW9)k8w|vJ&8US z5#uVBBm4XJfX?xFUjd&5NE?-m-Xw_CSa_1)x0dU`aIa!=Nt901oy%SlN{^xZXSo(3 z6>-;1DONTDt^I9|M`>N|D+mu_*2`GjNO&e)!s(a1!FpRt@!SxSCcBFYx4%d=D*E{6 zYky|u<&)%?~Jr1d+{ljs((EyTgo!Q?vPC5OvEYBb1d=4so6g%|#^?7df zaP370t2C`)20M8woEJ>!O;su0Z59;IHsN!TM?1>ygRdzze*xy+(Vk)Oy98}3q|ePDO&FZ(a!8MA=X?GTdZFcX6o@RZd;%W$gwE;CK=PLO2ajZ3`>kRZ9 z&XVz*jh23l$S736^d-&0c{kO*(IdrRL4Q_0{@q~>-i1HAF+s|SSEJipmKNWHqEtiH zS>XNZ|LRAwL4R-bHll+as#MA@n5IynFpKohzh}iHIkdBzH5I`2!|;?Snq z83Z97k%+m36gp4(+R@G2A=ZQwm{fFv4~GRmKcyvF$JF7wG6mjq5q7j-Oab8BV@?W>8rL(@z0m=uk9Jqj)2bBtI%DqL??1rHl7&0p+O3L#t=4=+eZUe+D+c^1B#-v0+VvT>nY#e60QGw*4-;#!78aQ zdGlF^R_FQQcE~Izq8-5$hhk)_QAX)U|5+UCePfkinBKWE7BYc}5bw0(!#?9c@~^bdRkXU}xMiL%e#CgP;R@-h-RDSZ z@aT)d?sT&{`0xEec<3o7;!K#uVxRy}LA9F6H;GCxFB@G6-Iu zl0HY;)2Xc{*E%z6Yco^3M)Um~5*5m0|Hd;~8FPq)x+SIQ@jE zR8-aXRZ#LN9ps)flvHVXlaRioUGgR=RJ1hMLS03_^f1)vthIOsI!n3XpXS_ZLKKC9 zaV&gQe%_|ZjSj1N|3;Cwfu8naQ1C-S=}Hs@;nI5rxmG78xyhZD`Dj3idOC+x_iMlJ zd*7c??Z-F`b4U{-I#I;MIKk`C%&};WE^8aI{{r_JuYx%NskGv&<{QFE0;&A7ay32g z-KKof6z{-rc>b=-Pzm6Mp;8rgsVtQS39BT$TgZ7jp~GxS)z2b1d_eg%=+yXGLh=() z3!lYk=Vzvz=QvX;F#d^Rdc3%6Q|bFoXw4+9&+_(*K@d0u`v+3`u44mA~1vn!(g<~jG?5VNudjd*xvk^i!P?ZV$6nz*Dg zBcUC_vg@s<3SJuM<**(IwQn5NDs{(*|Yf0agIULDuS5-uv~GiwrLuVsFzv4ti8D4 zrCqh0*Qx7nbgqC+&Y_B00xiOK7sa2MpN6afb=H#lROnlx&T7_6>0$UwQl@6Jhb{Vn zetUF=&&Ee-(H8^e$SB`=S?`X0d@HdfVVN6E=665ae{+pW(f%4#Mfn4<89mxg&p~>Y z`#d_-(I(OF^U>!G-4)>r?xqU~h()N$-TN_MwH2>Ml{U4%^ge|n8{1(m>3=w#dbSqJMB_JqxK00mnR-GzF z>8zFhBKp*P?cuTZ{clRsSI}HA(}to@R#eM>&&9mOD+#YvA*enfykGtlD1bn3z$_{q zsDM%uU6a?Tp3t0`%Y8!C9*0RspkHZ;Jb7K_A z8CsN#ueob)rbMY5DkY~eszY;YLp?SKg@CM?fh(YzhH2eDvjS}5WD4) zll3u&|B2cSnLNtHCY|f{k$<92?*>w$KW7K^UnNCtcAMT|6gj0{ntp>>2p|%}Eu>Zs zCQ$7jmL#`Th^&bP0*5CC`1SL26W)o659~9mUK09M)W5dO`!@J|I6hngUOQBrBgY}` z0jv#DaPI6$(?}LK7rygT5Wow6w+A<|yOurdc1$;`9Y% zIIEJ}ff_hV-t*Zlw_2-Sxw|YMJrT`)g|8c%QIL~(g_$z9z+wR9-I$0x{0+U(UP&#b z+@IC7dt=@DK=#?cVB_#R5s#m0Vlo*ySy+FFD7&HXEwuk@s~1Qh;ka-fQFs3zg~JnZ z+$g`1YVFdn|4UAxfOWBHA^x8a{eR>jMi?N(AnBWJ_#e*y|41DEg>1JdOR(er^Sj|B zSeXbsw>#^fL2he{C0RbCh=JKZF;XgLB zgkbu=#^L|YY~5j7V7KK=i(8M_3x|7V=5 z$-_b6`jH$sXaJjp;kpL$RZ|Eg+=1geHilq??a>EdLZIt`RTyKve_O9-`(w8pP6EZK zbT9{e@b*U=PtRy3BOTZjlW&ed5xx!@;j>HqNa6ZHg;DHy--p$4L_%sT z0NTquS-5qnLCA`$1q1VC6&CkqJoTzM?cZUzpV-O`u``uiyY<0KX=E`I68<;lHNYA7 zvwhU37L!8d5Oe3g#;P7DM&4|*UHy!;aBCi7 zEPa+q&xmvI2ehV6L(hQE?({q0&J&>y@r`;7@)|ZLq`vTX0^qL)xS5nq7Fyrx2LF*| zz+yMu0Kt?RS7DTpJ!l#TzK&^O0Kl|#aHA2O{P)**07%$LSi1y>*#>Y}5j+QdKB*lr zdz5@|Z|Wob`>|#lX!%e7IQ+@gNYPpT#G)4E$Y*AkrhM7`!uhWupNwq>Q?y&()MjjQ zqlMhBZJNms8xPOuBKz;Ce6Cb>eScSb`kh)^Sqh6VQfu;W6jghLcY%dr5AcHip#3i^GQrSEDWMl9)0%%C`T-=k z8yN35OjKTc_>FbP!J=>}M|mIzz-J{Cis&vvK)1St&O+?2wUAZd5M>TOCnO~FF5sUSR1sb`H!$bH%QK~=makM-Qe-l zIvdd4HHxvmNB~~EH=aGe@$7}@{^erQ8We@{djtx?)rY-x-wr^_I@$Xcz^H;B0_vgv zt38GLMWEM1Q2^}-|{FhaZ5g>tje zd;|=fV}b*Kdo}~sx#_q<{CE)b0j^sN!4G>us0C~1pR<)`B4LW6!qj5-q?Z(MtS zP7nJ3ETG3pJ4BDdX~!iGv;i(oXhQ@i5b=ABL-bRfL#5kPy5;?ehI)3KoAdH+nj9Vh z&a@48o?Ut}8<8W{gmCv~$m&BI-~@4Ab6Z(4GzwrU)ddy-r$rwxcWz;k&NKO-Jw=t5 z>$y*}<^SyIu8ncR`>C$=*yzduK+UpndK#{1>6G^_8gK=%wjXz z#{geoO?8NSF=RFOPQ)EkMKyO|;l^_77SMM7x{b%vE*NyNSJgX1q5s;PdNTmLS6A1i z@iid{cn#Qn1z&F54zu@Y0n(O>+ts{BpTX_@0ATeEk@z+fwT6qr*2OQtW%gU_c-Bxi zNE8z=4(_x=5OvWfHAnxz^JM*xKLDmBXEx-oex)o#cjc24?O=mjW+sbL?U8X5mo%4J zJ6xCEPid4zGT=$GDjf=e!b|;8!<^;^V~Ji%;AUCXxY01X$V)fCts+~Xqh06REusz; zq}0@!rOq9~WZN2S5>3B9Kn_kLYNUob$G<3dz{<_IqlqmLe7q`R_e@GmE=uWy#_0V8 z3*+4}up&S$epL=nC=VWm$NHWWc?db^6avUIHr}QAHR&5R z>}ayykyUNO?WaIepvd55(U5BxVVVo75z0OWyH45>9{|XCqdpE&m#OY?_`AZzUn4*0 z$D-~5Bd?2HR;61m51}G=q99*1@l|72?U`SeCrgdL14GbWt0;9{Cu8l*XdO_{n zV7ZUy9M^CO8mw>s2vT{fvaGHDW*?LlvYq z>%EH}9*Q8WqIcx;y;qrQ8($%1-azSv{&6jYiS#BR^EN?OPEdL`Mcf{K+Uu`)LT*;` zCnbN9H=@i*$TDaTr|)VRtrOP7h9MzCO_Pc(0L7ypyfd}vnxzueD01=6*EOeqQ1bOW znyT0=)XU|_UuKFlE=z)^&|C-yf+tABas=!!R)p4U z`tqstHkq_&;0bvWk3_L-z%tfeOVJz=7(@nmTP9omd{|+82XP4y-qS~w>o=0Q)8x%= zgGblH1}2})AfbIJ{v@{!t|HUgTr0=Z|5VO%i$H8a9DD*LG@6U8N-U zzeftB56uT&lHZSMmz2}uFQMVTSb=jt99 zCz72=oqzBNB|3f}QIr_iH~O}wrmR=zYu{s~TT$VpVa;XYPBRDz#iQ3Jo{FV514M51 z*Xp%NfRbWhm|Ms#KCY};0W~VEahAUwDFuv*q#~w*dJPUd!{T&j?o_iW znd3|eh~N_eZ>wXR+gAti)J1kJSYFkTaIz!GCi6-u+Y-Kpnd@M@MvH|O+?d%8BBGWk z#r(r0lyd1}i0*#iin14O&^e8A`gIJ0ON8CnWVh}HVkkaentN9(e*^RwK2!-3qZpj& zQXPzm_mm_%mqu}Y5$~uXIAFqMXDU|s%s#x%etxNjK-azh<0^m+qkNHTu4_zMgN5a^ zR#vFh$4xm4!o`JscsPlsjEqS;UVy1JsAU2F(c><7f!yflibjU6vCk5*Mh$lZBb5N=Q4Ngt;g64P+szG91?izZM#4XL)}Q)gl-|A` znXWfIDYekT#j#Y(rg4lP8&iBEEaSB7H_l^fOM~B|k451g-=bnh`3^$kt2T4f%d&YshMpHu-oo-84l%eG0Z9Q# zA?@k~T(c(dTn-r_z&2FOf`pfG=mPb_?5xoFSirP|bGa%crjM1jL9<8UAYuj1{ z7Sej}XiD+A)L0Vv@R{t_LO?3l#fRkG60nY0qN#)Jz8%Lh_u_`#y5T;w`oc>QAB}g- zQ60iN605$3Z2AK-1bIYeDy1{nEGJ{J)l=F0d=)!NU$7LBE<0@mtAxgq=G}y!92K9V zcs^XWOjz|2@K@8|KBhmrdx}&*O$vWqa(fDunHH4wpEJIDx^VS1;MFm~AzHI%_fz+2 z>7T!*LY499j6lpiZv$l|qrM?*9-zAX$2(%rsIVq?kHo%s5`*73q)!8LOm9PXZ zVaSt164Y7gB^Jr39f?0IyhiFo7DaJ(^4Z8N>vrXo2|8Rj-W zIw*Wa^)5mX2?VcpntWwLUI=^{*l^L@1Cas;Z)T+7fEIOy8qmLMe&gd$n& zFCaYGzMgF%_uW82NfL%L{XtpmH|CmfA)U%RtJO?X$$K(dBdVPaS_C5tn(zipSRyi! zM{&zrYHFZN?foaf$s84Uc&`eJCxu05vGc`YAk3`H+oH*)Sr=68itbd9Bt%~^hNP@f zYs%Tscz@7CdQTIT4Xsgb{#4e#G>cbu&Ba(bW4bu`w|@juc&RQf^s~h8ZDHW7N*q1$ZA^F zWyr*O!ShM`vmAk!9j4($S$_rHlK0ZmY?p^y+03^JP7Bkza9tj`*Fd*!W)VZ?I;I1W zd}ttHCp9I1P+~qt>pF@_G1aG5v8}*VkKGJork#%Vl1Nf}vh}vP<=Y@9)Tz~Jy_7CA zdW#}Rq1q?$<<>8OZti*xC3%Nq611&xlwozwTo(Kj@g_&*Osv3^T*usCc}X)5Xz4uBEo@vhE<~H9VZD=v__yCvFpC898`Cauf@} zj~8s|N!I(2$w-gVHt;$DPJ3V4eus1y2gTX87Cxp{xuTLvp4<70tC3Tb^F2L4mZi;7` zi$Kp7+i!n6VQaT&!4)BO)`=nw!$oOpso&{niaF?zA(S(*ta=e4|1yZD|MaKm+uubO z6#Aptxu^2GrV5E>k)_6t4B=1}*Y{=}b*y2xxWg5Cg7Adum?X>Sgk-t1bja&zly;Vd zyJM8Odv;@N`0C@mS~6@ggu=4uR0BB0PHus$c#@llB9*j;dPfu$(=O_x{n%nA6_bfP zGQ}zGdNb8>7t3#*S5FZQ00Z^ivkxep`Bh!;C21WKy01{&h_E;cNmUl9z|p^UV4D$q zhtYu~{Ab_T7Ai?kEe~$~IG^z#Kc)(2u7L-js*d_f-1S#?dT6Qi+d?dIu+@9M(02_O zDsY_gaH^!94phhW-T7<}?sMqNH-@?xPPj6UjQ&%) z@3{rKvZqG(6UA;=6FSpXnkXtZ05&bQ=B}us-B2u{4$oEj_7M{F3!c5F z*+O0(cBGt?_++6m?lX?4PkJGQ)6WGTF556?xP?C%$&S-$HefhB`9fK;HS%2sx?8XO zrZJ^FRUjLeI`Ue$Q{P5I0{NF&`b1vHjON>^H&P}*%iGdD<*33vn7G)KQQ?$uCI zKV3i51)Q-OQr?e^&Sg61njH}p8ayrYi+D=Kyq#!xDe^Q|P+8jDZ*P8klooTHcJp$0 z!g~|>GG8%Kfj3@|UE^`NcUmn1IxbVC{7i2<@7$AjRu|sQDUk=+!0+nQHSv0&=7*rJ z_6WbW)h5Es6K~Z)Q}+0E#)W|2f(|Z`j)pD8$gdmJb>)ijT6JHRWi5W*F2I${L@`~D zdpfv5X4ncrO7%uh?i#9%ly$2V?b2Bla9Mbb-ZqYBlW+^lt|X=sc!9?dAQE*>Cmz_3 zI|(IfaJjU8RFOWX?6&B0Y*k*;v1pqhr>9pyurmDD`-rNM!?tOEE4we;R~A8idk?bt zew22a8E%oNhf3kDC$eoEfLnb3$j((wnKiCj8(hD**D6Eldc18%N|>B!T;ZY+|20SP z*>{MG8XXB|9&2f_2r>ThySkl~TAt#@}@a#70~YES;sQbD*SP|0C@qP06juf$gOy117% z#F1<`Ri@Bf+2bj{9?PZ;K2aJ8){mF0nq)=TQZk8mr|0>YT|$v*U#O}wko+X_PxKz!AVjXPl1t_N<))FW4C~lKPJH#@1Jcrk&<0|tRWl2P{-256h z&dVYB36-%?uc(G4@hgQUiAl`gtAHCL&03-_BEqM zM5qI&CCkr%2f8QWr=5(_FQNKvrP)ayqp{3ku|iMp=* zm?M`O|9tnEi4G=i@Gq3^a?Eor(CTQy`}KW*@;43V8L0Gkqm9YsNqUQYr`6?FBlAUq z`s1!A;<>O#Nx!wfc#`AF{-)W|O%f(uyAVHnHm$<*u{~HI2t7X9Y8r*GBeo;tq(7U{ zVQ+MQ*Y6RSr7GaK;&5Kr-&=7cd`7hlaywUIP=pq6!-NBusz*zcasIX}53shnzewVMe(kX)*fH`6$be-IiLZyuvPaC{@s z>6=(58u86*?`h5jqejhOywi-_h@6tIuK|8LO)v7`t;k8LE>>G`e#({x!B71L#Ub6*m{VIEM)BEP!N@jlszVNAYj2F+ikJJpSF}a++*PbOED9sQU zjE7p1Hftz%mM+{yLDJhdXzwe^g`XP;nJebpBt^Kc+k$+G10vwKR@DF=B=OwrRKSsb&%*Z}<`WQ21+C zKzPW#Mc;#pN2Vg1e2R!UmNZY{&I%vF<{~RZ_U=MSbWS@)uOsw!$CNNdfz&2II?#H z7Lp?@pWBG)q~?PCW+^=XfLz$vMKdLeTz2sNUX9;7GoWeZX(9L=txOa7*b+@ry&MN! z;xJB9j@QR~G8WwYhRWa6)QyOlI3p>XDhAW1boTn*%%jU!bm-dY=i0Ac_}0~~?45+I z&x-ZtD|FCL*}hWRk(}e4yr&@POoLEux_J?c-kxRZi|~$_@_JeS#9txw&cH`*@@FugAMqgl6jM-i@bU7t`Aa26 z%BqT4WE$6lpBEtzJ9>ojQ>-ce>qRCo~eY)AAng|tAjb&|R#z5pd2%_!}SdDo8Od^h400gwJ|4^^E=N}A{DE-lKE#?ol|J{<2= zzQdYjljCnOH&YDREOIK-fwDBJDT166chqg6hRD)HVq$0}NK~9D7oC{gkN5B@? zD0)z#m1ga~wB#Nu`S@{zVRbW3P%Ma)vSS9F6F-Ti&ucN{${N5*8g-SICa`#&$1FOH z5~`mnzwtZuTOj~X(f+*g)!$&%Qgh6r6uu>3+!xAqItYw>fG!JsV?4-% z@Fmx!Ab;25U`l)`BBNM<8r@an z%Zo%3awq(Hu@w@6^JKS2d+yC>W@UwF)K78!TNhJ0*|h^Y-Mx;6r!Kfl)VBHd?}5X( z@Rg}|BX^?oN%KjcUI}b5DwM0RyNLYgRZfJP&8_SV2FY=8811g)0GLqAL@?vm5?+)8 zUPZ?N=(Detma+3hv$m!Q!0PScY?}O*v0+>Ic{1?!@OGm-j+naXo@%QE&b1y|}6?1n%T_PNyDkMo$zex#$Ug3TPlhKIF3(pQ}Mw^Xzd z=_oTtKYLlzF+d{9CmdqCZ|Mk2xTC&|YUu_g0^`ir-(NjKzr{J>L79+++u3>`$Q#uT=mSU1 z5IVMT%8kN=@OmZU6o*)&H`EB@UCiNwcv>onR3yX)+8)bJIe`0S@h5l!7V#&IQb;$^ z7&TZ~n=+P?X!)khLwvP6-s_tY4Npv0`sCdcV2KgCUf5@qS1MYxWY>FO`bl(>>X=d3 zHNwNhG)wQMTXj*du=8NGz>HC^A`{gTwGa3=Trcrjg3(bMnu?kKC5Rt?F!EzU+4**} zuZWQv7k~$uE|Jo+uA@GclC%ZpOw9zi7ziD+AdUZ&x@>8nhn7teN=(J-)sI^wTMl&J z{PrEw^dyCY2()X?Z6*kkORmS%8}h`@95+r5VA}G4NA>E$<#RBDFb|owo|)u$Fw=n$ z$hzO79Lp0V$@JZAh?&~iqzn1_f_fd;AiU?do1wcujDcQnooI`K#k9- zX&)ysPF*^b-qQZWZHbGkC(7uoLQRc{+PrPCMy~}{li6F5e)TQ%;?dWg+mlO^Zwq}s zp8NG$O(uN)Rcya=)5oFli;sZPzTig&eM*3tmi-C}WVeU)K-; z|G&8a3ElEgljf9Q!F?g+p}56${6-KOev3mMS;1%GU{r#mlGEHF+hx2+A z6scTsn+!gy&B2E=FiSVe21COxG9&sd{A?+x1ZN*0YhO{77rnJC`2lB$Tt2oJNi zQ(^9D2r!qwMe@Jp^6DFSC&QB;9W?Z+3R;*C#h~oI-zU@GN0D*S=fHOD1)Lr{yzvDm zO$e3iz1=$21gZWmUU7R$B^3gh%Ba_bCZ&ofk@ytvGLEvH-8s;4*}S7?$iv&ww1yRq zEv0SDCL^?YA8m_mlMFpDtCK|Jx5;4`lgD(B<1#kdjE3$Lne=488Yk>DUrwQAN~0x` z+bxwSE*3vF&=eS;8ru47>krE)QwsyHhFdUY_oi6Y^#{$E4i3$gtVQ9E&%a^2;t2vB zrn3&{C~Asl7m#3vc+s_+FVfoxlr{ah%Oplap6fIsgV{7{T{J6PbpOhx64F!5=BRs@ z=@`q`C@Y%N5I6y?;TgX;VI4<{F;v&UbllM8^)k2 zOofLWMY7{G9>dDk$fh_h9c&?5wD^l7?6=~0Z)oHhZ^PQV788C^#H2UR?J$$X!q=D* z-59#RDli11-4~#dvJ7kLDAJfN&+3%YRqzUZQ?mp;Zp`Z|DE+e6`H1aqht~zk#tsk? zXjVE+03<3;RZNAo_uU<(*HC&M+=>8&id4~98;uKmFai8p#7eQj5ELlC%mcroAcOBU zKA+`?IX~O`vu$nn<|Jk+*b@TYc?`Gy&p)ppQ33M-&`$0{CQI} z`3PH?1@J{ie71FL%@KQ?3ODghOPZ?|T}KcgJv0Fu8l}=1&{UE{ z%+q>vL=-(Tle}(6N{UZ%J7JKXe(6$GvLodInIVqS&TBkMUl200jq))yf?EL$xk^NA zY8iVk;32N2o>A$+~)kn~mB}jD&_Tm7)xy-2tr>FRo?vpbgR8Xaj>~_Y%e-DEZ z$7?x^PUG%?NE+l|MAFt_KTPDa6`v}eaD}+BhQ&W5cecJb^QRYY~ zaMSQa=!#-T{A18~7gKo&@9jj(UGcj89?xmY<>)^7m|vWm;mz3_YZa8*&o;WuLx$V9 zwFvqF(q7preCTKYg~un^^AXv{-g)-Ky4m1(m2xMRtToi{7?-=tOSYZ``;ec=V)V`B zIo2goG?Grlq%bDG&YUtf_|eDnN~c$lcSio2!Yu?t)&K*48(+tVUkLEk7zwLovTf5* zTBP>6kxGZ~Po&vFt+M6wIQtZar-PTg15e+XrtFz32b{VaCeD=78@`-^S`m*D&;8n4 zSt$K>_x?{pC2OTe`!9b3-2~3yJ;+=m_qTWVw`eE=+ilYXtR+-ztwm`B(SxmTmR)~|e(An^w#L0c8Lkg)iB6*X#55GHts9a4*!yum^rmPT$%p1t0bT-Yqi8&u z#4j=5?Z~5PGOVI>GE(eX?s0r-`}QK`4(f;Ok!6f&;vU;1Q@S4cZJzJNM?9I+Yun%) zge_N$_Hi%7zU0;w<8=`^G5_>T3C#)N=GYL$Pd1*q$M=#o`0GjDu|}FOawdNQpI-mH$Pd^aVKF{Td)gh}6^pDgh+-)fG!_6o;ajrQezk-< z>4QT(&WMkJiTWh+^W+pXiLMhM$-|1Kl+;UU9mbLVMDrv11BZQ=Zc*&}m{%7J8flJG zWgWVZX%+YKU6&Q*RDwMJDC#tQSi~0&?N`4mzgfFKi7`-nQShP%W4-=y_dc&dyg!Ue zLkUXYm#f9yZx6YwReU=_{q$3c_mo`bCakvhG~=5F(l5+{&fKY#H%-vk)rsnM_5%Uj zDv(I#T50>?VeI8paIV241I~A*)4coh{J%pVAgnnRTfJ`<-c!+X1N4?Wt9fx;sgu9c zs<#~79oYt1DHvAA-j8RI3g!RzRcKETwkeSoRIgC6E z{Dw$Aggl$Rf&TDM&zvFL>C!K~ejj7X>bu{HBw3P8K6445ZI{<|I7*6!Dew7NruIBM z*IuSPgDwEl-J^^*A@>cH`J;+U>?fHbgsbs9M4^I8>)iLoWen7NX~szcC~qX zVrEmJnDHyjsqbD`&M2_ywR2=NhbuPgyqzGJ(~JE7Sf0CG_9z< znG=y%$JAPLCjCWG?I?_I9Ssg!U##$6Y6e{Cn~?Eujn*{3rDe9|K3-e7Pr)+UGN%o@D7WK-_O}qw&Qd7cUvn1uc83Dpm|fDpK`VHcjmvQ zateOq;49OrU9P}wM{UPA(YV|E84MZiwCD(XP?Xu1>r*k->YPxv7~e?O+{ZW;HYdT? zTu-h&Kh*-W2on4ZIR1&56ur7}{E2sh#TjU>7=^KA)AE|cz-c1W$FJ|HTX*?B3Qc_q zwSyF5Z*||fM+ly33e!5ia2HfH~>rnUDDNyzQ{`Qtw zrjA}!)auLfhtECFLOR0emZ)24=jr33;El}B&=Zx#e?qEbl9moL4R)TK+K3_9<;TIv$r;v|R+(jm%4dRG2S z{oA0=oe=in!OI4v^{59FKST+iX(SR?+k%)ZBA5l$O<;NojE}ezmaC82cAC?|)lamY zsG6sCy55$&*H`B~pp^NpaO2*kM8L1F1t$y#KmOiIN_RPW+w$Yk(6jnYNWq7j48%Em zFr2|lqx}l`Vzd@pt*Ak}(9mK*TUa_pZpt+vkjI_GHql9l?{~zsuw@z1$uBjOcZN{HYmRzJAO&$G&S`2e(_{c7>@^5sH+%=UaPlD$->B)tnyTtz14h zym?<76{5J?XL<6CFVXbX?|H+-=Fet~`U`nQJ)UlUcA3;hj_l63*4t4>Q1NJANK15w z_8blVw*KK}pFun&i4jv-<({dJWsX?cg7BsxV?h>&& zKs9W3xZ*du_!xJ&D49!<-(jDG)9Bj5Mt#3m{9JWetoRT}ex0-RN)LP0HkeZ4;iID#K9F0p8 zl&JX0<`zK#@d(lAqXbmfB(nFBmekXf%rt?v97aTFN?${NP5paIL$?wCqTHF6XoltQ zbUN^?3%;ih-L?!CSWlk{sqeh10v;!>G_OXS?*8q~h;!0k8Bq~_-zbw@|E%=J<>#y} zk~Vm#4mdG3 z(jERu4YI~Q?>q5+zn!ZM`Q*l^DRu-s%xkerfZeBJ{y*&f^;eW{814-#(jkq5scu)?nc?xDYE^S;^9`9&M*<~qUS{N+i#z<|?L_xKML9Jw@NYtwp{ zX7QvOeYtU$UYI3!4w-m$kL^B@i>>F#owK9%Zha2&vPQGWFj+WwXRC-X)4w@h$nlZ^NxQu@+j3g`Bx7FjFB=87dEODvZh3fZ2)Krc!yUEkvN1*b(YXG+-DLCNpC317!ca$?ya zJu-2HM<1dMZU67mf`Hh+n*0cEh3~=Ifb*FO)g~*IA*Wwm5YNz9$ho6%@_avhBJ}tm zfyv;BGTM&wwCzWNqONn@@*na|hj0-eI~HRbZ%)*{pdZ?_`h9ZW{q_JdR9r>Dy~L`U zCZ`M$MAQ?A$xH!@Vf~8MDpmd;bzdPm3LGLJ>1=Zp=Z$g7&0m8?q4bl?$woEmq*{#w zxLCua{-Rl&`<_gVi(j9C9i3_G4H!L3WoRh(kAuN)9unFw<@Q(2J1Bs1-5yh!A=ex? z2*>RhI5?y8h&2@I#}u9(I;cQx_Th zCfw9c)|P1z#@A_jS#jJ1|0rWfapd|xOLAitI(28>2kqm^%L;0LOPPjg8I!kul94aL zA?5$y3w+KD0?rz9;i!hong3I9o=azJ_SzY7g!X@`uK(Y^@xS*z{{QKD#LE9iMEp<4 z4)8dZ%WHoM7d+vvF;~JXa_RejESYA=pW3X4kq5vy?24or&B-fA+#&4-EjwZ-?pi+u zGsyx40#uPO8D#3DGcbcc#;wo;3gi`m_EWq@fau0(`K#mc!R|VtNR(l*rI3E%Y&{Ua zSxZf9<_MTE@H|D@$1NTk`d(VYp3PAIkB#;J@dW@|1+bqCww-vNIGy-hx2yo8l(^PY zx9hCSa*NT6RlopEdnX|JC^HC1M}Gqm8=&i84zJD?0JlRtDtNn_x1uU?l+dbYEDJ-8 zBaqqDoI6D_9!G&X$0Z5v;Q`rfe19|ac6n4_Z8;g&vlGW?UHqy#rfEm~x=Cv3i|;(p zPf1zWK+3fLBc~zN+5b*se81D&uVWm?$~<>KLRwb-bGrbEC(t8g;?}``PLcXb?@_U{ z0lEc|$oiC?o?-9`?ICqzB?R z@GRdLU$!NGCdJzZOaWQ-y_nhUm`e{KKena(E)gytN7lr)FUF6a(N!$LsSOvK0Mh}} z+S|U!K{HE=J8sXaN{)Ohk#qE&@uwJ+#!gJ6yI0gQ*(m;in~33#k8i>8cZ$Ua)lGmb zuuA1TE~Q6t+;(l$2oUqkt%Fcyk`aEtlHQB&2~q<5b~EAzZ8dw&G@nfR}B z@V%i^@Hg)qWL*Klq^uo2Apvrx@gYH`j${yswb=yH!zxDHj6S58=Qft?qQ$-{-;1Q^ z@!tj(PK*fPwaRO>oKg`OMTGyCt#Y#+A1&mKv;_fW)f!vV_7`N^Cp8BT5F@LR4F*#J z4k;w#GGex`(&w`56Ob+KKtLTU;(pV^B)$O%7v8%9&6*~_W(08)nct}de%Hnasro+# zh<`2s%upi)%fmedY2-Q%q`A))0i0O+@~sRE2FY&sVGNw+tlF)Ck6n`BdkMK`@kXdP zekg8AG6Am4HGTb($vr)cF+#c~AmumY26rh2t}8BY`8#F-%kIbd$&**#zIT;8w!Y%C z6x7=pnO_{e{`r#k_em^&P4siw&zxiK5<|=L<_H(B!{o>&@55d}VO_Ntp#08nmZW}h zLHJv!j~M&ClA-Yk+{~5-Rg=yy?xtzX`=<$O5ySwQ4Su~i*Uld??)R>9327Tx@&4OQ z^BIZW;K3L5=mKnKdq6Nv%%QL*^*=y{%Mch^A0|OS)ov_EoKgh@nwo#_{Q`*P@1CP< z*xGrfA;Y9skg>r)QmNZ@h(Ig28+946Z7kM-+^ngmsdKH2cb+38ab8)j0PV|W831x- zMIM47ds{S*Zu~x&afGt;GSEXr^ZLV$_cjBEyJ868_UkyweL^tm0^#fSivkWIOs3zT z7Lp|i2>C97cwS~V9wdY8y7X-u3r=4wXOa=H-s_5I;aMf8V{zUt3}Eb zR0U`5j94IK{#BiFH{KMIkdwZIdm4$N@_vr*EZ!7}-;tn(^s148#bG^COYNqdwdlAi zxD(Mxm5?=3KfBsMp>^f4hcYR%3$^C6=FfEz<$I!!<0f%*x>TevpPR5deN+d$xTl`_ z7l~h%q?jP(MvOqTkSKD_V1s9R^lzrp=U2n3$3f(>;6@Pf2S39Q@Z(=#-!uVqR-W6c z|H!TdiEmhxOBMm66(u1@T?!%$)Fq6Gbp@zz)I_Nv&xow9S6p4Q04Sw}8`~a~fHUi6 z#G=Nx=pV+uI~cFonzs9;NbJZmTDu$^bltHl%i$R7DKlW_b53zRnbbZF z99ZrJqEB4(?IFbGwLegBP;GxBwWB@&d&dG+%8{>+goz$gow$Vtin0<}5lh8Nu_6t` z6-$W;HaRX(Jm}AAtmtY2ihqd69F_RNfwI(55Q)<8OYRz(p=LYYSB5G|UI&#m+vo!n z{8SP|0oOPY>L=AZJ+gjW^rO`XNk1WcmC5=&ymMXfbaTv2@KXd6ErZmsem&BIMj&oD z_u>yu8}<0}ghj@#`NWvSZXz3hyyOIF$4&rWQw^bEr_Q;vj|LE7>)cVB1~{go^t8X!&rT`>1YOh zaxo8pHv>gp81WeDt3@pmp)Os`KvcLd(z&KM7QR^Z==ry?cc#}{H(+U#Cuqx98>G-p5cm9pvwp>pXIg7#Eu!| zFJCXBGxsizcqBajte0D7Fke$)C_jR7k+f5MxhEt)niKuQ^~bufAo6ykv8=q1!nWY3 zyt?GK_LLA2ybbqeBzEkK>okkP)7Ms*OlR)b5(plMR-wDT}v zrsaAHhAFixFw2Sd3GY3RCCI1lO+Xq%UpM(p|2W8c5vhecj%1}xOqzZMh{ff2?$W{9 z#F)4cf1}gzw+UU630TQ($1ar-a+s%%Hl|lbnl3-!HfR3$UbL@UOqCT=6xm|U(+`nu z%MYJ-lYY3;-?yPMTZ-9=(Ph_8UWA;W#!I{EFK)C{gy<`Oq;{>O9nHZroP7 zMB7Z`?Z}>tLhu;=)~6-LI5s5=Yfs;mOBE8ks#wUO1PAFtm&n0t!E_;L^@7&CYS8fcGY?5n9G>|5sh0&qdt2`T&jWJsn%uG;fFtZaw{!&uw0WaeISB=A>W^?> zY@Y@Fv3Pak{f+4;e9I#&VL*QCc8mcJr;G9P?Z|cewOAvdXf~@nwu-&(%sVzhh)h;# z&fc6Z)h$|;ne$nj=3~rUwjH~MZ)?gI*(@Wt0}%z$L>fkh^Z+1!YIoSx=c8%fN6x-+ z#@BRKS1G)`B_EX|te)|DT3_lwe}hmAb3d9wxmCDW4iagkX;5e~Cz2?4J$=)BNZiq` zEYSa_7ND$Ot|9-;kgWD!w4Y1H!e6at@c-Z_s_xwNpL0#7&0ataWTZD{3)e~pXgIB8 zc#{gwgSr&PESK1`(y>;)@{ehyvJ$$5f7HHsOObwlGIGMC6p{D6Kn)hQ4CZ5}p~~ne zik$v5_5N|ui$W$|#&Bt7Tl_r+A|qtfqel@EX(+xA!UgMFs{Jco&)E+o3`06$LkiH?nhwaN9SI~__Xg8rqxX86}vkC62=c9?`(q$ia?1Gzm`@O}Sw z)5m=ehZEw!BC%Q zA>lmZ3ihv`Z~v+v9|Ic15l>3tdc}|tQ9#btU3+c|?N$!}TkGqsEKeX|U=w>b-Suz76-jpATbLIcs;j1~fbTB%9y~HZUDzaFs z2tpby-S~SF^54Y0!4h{1W2yvPTx;*IY!Je#Ak$B$ZNKRJq4z@$Th&4F!O4xl%i-Kw z4Kz7VMk@Y%MO@V;cXk{cO8F(jsvbGsC0XeTQzWP)@%xQwXGP*dNN3QTJ$sr7%%5cC zjC7I~S;`F8P2$Z1ElczJc~O?~4HVs_!r+8czAeV%7u2`MkCv|+crOFq))(Q)nU87Y z8%+5Kw5giCehXJr;`NSHY1qEw<*zAV{tf;%b-k8ov$13y&pufLh&;RmVz zRGI2Qn#H-#kEwt~06s2PcO3!hdqcSYol9gP< zXHIZ?Zg#$8L-w4K`x(bA(A^h0JqN104L}5sbDh2;+W!FDXKl~jo!h@^=_4f7pQ=u> zBi*R1`q#4tb{TH$B`h!AdpYb}^R~sI6kN0^(o0WSgfy#eckUHsWm3_-V<4a+k+XHQ zMO<;k6kp1u64!q~ApYRog}BKtSx6SDKSSIc4g&y$)B+QLb}p+yXD_6hvenG|WK>Z@ zM|z*Shsn|fM&C;W=|^6?&0|8nSkiXVsb$md@$J-Byk%`W4=&eA#AyLZs0V$j;lx*)96T?K>af}BhBB;DV`7o0 z0lQFy?rKVm$2pzBnJs>Wlm1JM_yw*lzVILLpMPw1Dzr+b5S$I1&9rPMSfZmnX zUq12GIVjN_EE3ed(Ik#6?enkBibiuB<}9HYZg*-v{+F|+c9)+XL0fKpKJTNZLHoi6 znysK~4+Lg!{tGo2}xd>7E$sOR%&*4Q0!-2~^|on^uSnu;$W| zdkn34$I1DN2}-zRe@qv=is}@suzu!Um6w&Ka@P#RJtQ2zoryBPW)f&|+PyAIguEN5 z{X_@V&Y>gX{8r31u1!m+%S5WQcG2E2SI;1Dzthht-PvZV6pmm{_?>H-YRkpk+^#ZV z{RrA6IQiz$r@J&$xW+X*96N@4!%Fkwv8nocj(e%MYmvr7_7!l;-j}Sn75fkr^thT676rjY zE=73B@}gJf=c&8lZ!#Mf-2->x9G4GpPSyVLkm>JgGuL=xUxDpP^OiKrhS)!+SrNR0 zarANjUF@95g)n)IM0Ms&;t#M{mIN0U99KuQzWnk2+bwN1=a7VJ`H|9$uV)OH6BQ+& zTe2n{D6$q#JKf#;crv+6aHUb<%KapohCUa0H0Jqg?ce17wb`n=>@9v!{kx%Hu?+;3 z|BO~)2gXL4sixo7{NBmWPEBYBH?5}ece{>F>_oChPKYah3!RVZ| ztSlTBKXM*y?&NbG8zx2>&JZJZl^lp^<%q4ehCV#N zTBhUge;e`s9zvH}Z2idI>Fs)RYI zV}wHEwYvs|Vp%DD#p*cUBkFR#bM>3j!J=ZBYXPQ4GXU1^XRG>wqQ?b~mWpAE6)k@T zQv^!1Fok|uGQA#$TumB9rH1^WVDwm^9KIljC-Xk9$NClS%T%t!q%;2EpGxA!UH;5P z3W4l(Ayhx)twxbv(5DWuF@j`P%-!OVoJA4-NuFLyzMQJB795G89NH~KOHSIfx(|#G zVJF`#{Wo;oqUsH+Z>`7pP&H}&9DXXY!fI#%o=T19Rc)4`0kQN1<8&)+1^DZ3@e+W! zb_{_BMy$$bd;>Z=Y_Gwk5q^71t4Od%E-lBckV}eJXOrYU?vd|#+S>B9OVsgBvPECu zRIcD@e-iL;L`7CX0l~x>pq+U~p!uc(6Vs8ES5LnJhzR!h68H8Aj8c^Ln}ptP#7Jxg z0qcPpaK~JA3{a3wC0r4HwAx z_qShq?lSM-6&gyU;!hnPXs=C9UA27GL|LCg)}2oCJ4ur zkgZz2GxL9!uX0imtfQ(%iekod_?$+30@y#+%5RndNMFiCxoLIIDTFjcfkJhA+t6)9 z(J+>^ep++Ep_Y}_cTv#AyEREBXKHN&-{DKyjw9CT2- z)VJg-US`$hQ4xHI^#Iy+4W3&RYl7NSENjDx30`R=Qw&2DWq^2+RH$X_|1kmiA9F?} zLfS6eF5rs(X)w0|p$zFV6Gp_bO_?NA#QdMeXt78Y>=!9pj{lR$)ql^=@BjT9|4V}W z|D(^tp9^dcP%xSRT92!;N=?K6l0E<6g{@mi+@*+YMe-~^!xvruuL~X*1qmI#lv*EvMI-xf(ieGu>H2Mn})mg$fB<67rG|&gz*3me2PlNWn0a(rL zTjcm?`r+Zk*EP+iMv<43+Vha>8VEA-4%w+S83XWK6RSexH1{QH-Yi-lkjF&WZ-CV_ z<_h4rTJCn`C4|Xa67omolo|XNjJQ<@z612E6_M4`=dOT$(@e}~<-lkM8B~6~ydyq0 z%00}=lVcC`rCWfMq25nGc!d+ttk3gA-e6Q>Yd)zmpaMt6<9Fmh;uy)kl3Dwp$^pDm zwMrr~?#})jSUeoO&)WNk@4YK?%mcKvm4TiY%{{GwKu7|T{e_HMli}}NU3ua!Pwn0# z1{Bes>89Yd0LrgB#ozi6iMw{zzIHx+hy>nsTUY@`FsKzT2Zr^xfpQWBcLUY zWbS4Cy#b7j?Z{SOUc=TYkQWC8QN3<(8{_Jy%vb|1Y!*$xXt4GC0sJZG-mRNrb^X8V zT1*ib}W{|*7 zB)e9G*>{@*9;`H zT~@DSp1o_Am@NmY1%ZL{3xdckV2tW{eBJTbCh~VZu-09h$r!2rXaVSBwa1!w-a(kg zBxHoNhG`za-Mr~-`&r^KkX<=6tDs;s`}zWf+3m(63z#k->3~E3$ny@Z-{0xa&8aQk z{k0Lq1E_ z8H0>~ndBfNHT@Wd#NW>HsP)f4QEz^dY1e+k&A?P>98~M?b=|V&V&}C*A<~BZY!_H{ zpP@xyG(-DO&|B&?g&6AbFe11>$ zD<(MTst0nMEP!14D}ngp$>iBc#+~Qtd1ex!Xe>Ev{v#j|U}_$-Gp+$Dl;9w<5Q_;5 ze&5zk8!uxGdMHj7@blU%`2Jwl#32GoLO32Nn}fr8X|#igkVV%u@7hxw%Rf3U zv34|pXqBXCtH3AEs)z&f^#THWve`gk93B%9xf}TywM9sazyc+a!`ybk``gK+<$@%m z)QTJMHqas(O?dsA&yCj0Gg2inTk_nNJNhs#2Q@hTCh{yIt_Cp2&5FOw%XCR}DX-)t zD`z;wg6VkytF4@2>*k*&Q=FLuFr!gQ`}4K2wRZ!waR=otysOJNmEJI;raN?yo#%S| zuO6G@T!SMXRp8~sw*B)}kBL}Y*T8`&Iz?xSbB893=~?n;Gh_V{ImD$K3-d5HlKNK; z4Er@wQJLETSf*KAS}YmzY-3str0(@#*bp8t>Ej6D`~WLs2h0n{fPvCAB*NLqSss^- zvuP_@WZ7Wt_6zrC(HyA61lsGv1R8&KpNt?g zB}EK~_2wpOW2ZlJGzk3UJT%;^pXUYWqO!Bp0r4! zblJ-WC^5Hs4(7`{<3>{tIAMedFUYwNUThibMTdQ_BgK_gC>=-ViC`ckG=7@*o(W(#rYr$M6CQ38;M=HZX`MQ;f!a80rhcSx z5~~cV{Q+Ojrmqn~`c^Vl-#QbInSINK5|jjQ4vYFL|4`q-KUWOM9YN{q*g{+P;kO{? z>wJ0jNYlgE{h?a~Y)~3>|B=j7frbAN6d;co9L|RULDLL91y4qw;00sT-4>>O8iK@e zP7}7{w8nYowxwQSn1{QB^KS>AYA!PL;bt!CcC{8$)aJSZ|3(mDF9~YR=GD7=e+uUT&114qb zXuDoUoRVsB2GpNyRhy5p6U}1gn(`i3FQT%SXO&}kT@$>Aef_(al#D zb{p$2GRBiU$KQB-OF0l!7)2m4k^w?tjE&rF+-=4*TT z$1%;Gu7SH6W1L8s$ehw#_zUsUPk3ylC6<6%)Z%a0L)0a$6e)Koclf{cuOcNV^QgKjM z6;~aBC>=CE2bGQ-4V%vI^DI^g4)g%_td}6N5ILYGUVRR@CD0H9FwiRm{X2Wbw;>Z2iXl@rF#X>iY8wen@C&v%$;9=TH02=MT;P zIM%jmn!^JovV|p>XPNtO#v(eze~Apb22YHn4$b!x;EEy&A!;Xvn;=55=ye(zHx}Gq<;&;EU?*GLMu%Htr%5|LI+b&)UzPl_HpPRcOm1 zFmnk6t2;Ip;NFaoJOz*ht`4pXrQS#Vn;XFQpTO4t+QZjrx=i9_7#`CJio3=eeZaefm$ z*RO{t;|kjSo}rTx+O+?*CKuchI|H9W44*6ooruH`+G;tImp}>3sxg^wgK`Ya0;^t} zQ=LT>koDoA#9b1Vdl|xl(JouXSoB9u0a%ms96+s^+p$X_nR>MSdAhgursm6dX7FXy_fs#7V zlNrXQ40)*>*J-Zt@}FmMeIU3{yO_XMGEDoq$3o*s^K<4v|4=7?ewptHSWZtY6pj4x zCX6yW=b3xUi$_8Ipo;RX5)zF+v}f5?pC%a7xvRq~h;tC9PbTz8N4u$2M9TWAPIPl< z2rKmYi(tmJ0+fh>KwrevwY<2T#T@}M8x-vew4*mKe& zO1Mh*pUK@aiJyjj^f06H5yTpYC+@Ry$K7p@Yzsif!<3a6yga9`|MV-Je6S1I?rBhB z77RTYup81LAbp=GPEj+uJ4f(Shdu|vJ*zugK!P$TV`iN3Qw^p#P`Tn?X~z3Xq09_>V_lH#Wcm-DjSz#BYr zGi+pI8U@^|uaZF{k-rR#+(a?=S;iE~8{)}u7J@X;2;VTcHEU?XW2ihU&LR(HRUopQ zACkAg!CW#oAI8`KP=ktONq3W!_~#X2m0N-}hc(f?8gc1d=vi$2fJ8msW~$4R0`UT9 zBI2R1((YHI|4AMz5fjWH3|b*V>&KUM8l)V_oDVflmZ2qaC*?cQYfRMdxqsf&fAc{1 zOUsj$5S*WPlRGURC*f|xX&lz$?TaAkurt!19Lp}uf7n{?0joOQr;IkCJI zp~qRE$oD6e)qMT<;i#`Lke>Z@Xt}2aQ%%8s&XcfBzJwhOTR0bVScB(_xPbNd?T3v{3L%q=$6gYS<|j@Or|s5w;Gteqet zG9W+-;x(_J{xR9W9OdRIj{b{>$pUZC)4IT2x&nK3`uNetV}wNlEJ2o}YQBi58a!L@ zZo|-`Hos8zqp8vat!;;$i8jgYvUzLivH!>3XJHnI^et|%sX}kJbR+mt^vr@34J0#B zVJ#t43zO8&prtp*;kHB2$tdask(9Eihv)j`M01e_DzkRQrTd1H&CRIf%rk>txI66k z745r{rm&Y{Jag!3F3A1$Qf4-9 zq#Z0OaZ)zRxzzKaYkcTIFelN^FTYE?K&&!yk8-?I?pQbo&-FPwSEy$w?w0Y6R)<6) zqA#?Zf(WAFTrQe?$b~=pUS(knsoS4_HX1&yR<7_nB>+YmKiryzHnqyl^N=c%}{o^6Qo62 zElON~{t@_RDpeV1|CBkPyJKxYY0kPzNFe88$c0|kb0MMuFYF4 zYJF_%EkZLVi@0ln5du)n#`>@R_~8CHJaju5y?U=px}KH?i{e7Od~H2;?->!U+xg;% zguk)2iA9)1mHqC=I= zBM7u}zngkarfwEB>AWDFxNx_v>~47;wwUh|y)VD62e%Dp1Lfsk%#a@Sg6Pd_qtk7d zjNDJc_oE1OcIN(qy+e63YnsM{W$R2eI-47gta4FhP;$QKRn;<1tmeQwvOYZD^misb zjvyyfOW>!M72i}%4ubxfcgA(tm1LLts-O)`?|`qXCzUB{+w0QnPhHO%Vk|t{i)SL# zB?b@aF1h4$ZJ|#*-4H_E$W1VsRl=l2pejAD`kZ&ZpODZj?s{YRlLhg*<0>xQ`(_ds zh=?jH|LdOAuzjLI@z-@#h8`9ETVDNc4ID>e%%8u`8kij|_DKaOukkD-qJy=&+P}SY zo&S*lrqz5MTFv?Ou(zaNxj|z|KgZSqN4252T{dy9)Rs=hDCVicDh;u!PO6M}$Dy9G zjkIZ)$9e~|s^G^-jyQ^-WxQWpa4!0~geU^@rwoOx<*&UV+wn0v@^}aI1>-vdGPl{q zvB$w1J)1pp@@Cpb>OTjvs-+ND*|Ci%@mxuXfmHu?0jXwv=GFZy^w%erpoL#K4@8Fi^=!u@2Y9W z%b7YmnK|o;xE>c+6Xo-ZhzImdt_EZK&0e^zaTJh21j0;d=KRNQ`)dK(b+c@dtDtCZ zOqIAE`82Pln7#GuG;X;2BB?DQID}i7-n^7py!4Mw#uu+qNIGVILG}A0f?1jUE=l{d z2l%{XWGz{>08dOlegCHz=OQot(tTSf9xK`cP<{krYYJy+9u|>ncm_$w!sr#$_fyXA zJwHw?CJ4lq$fKxEqbRwQn(M96^5|qKdl*dAmmc_K2K&EM3epfCRW3mR9lq;c#VHxo zz0>H)S)AAwf?1S(i}uy#;A3=F(vRP9ZjxKm$Rx=Nc{x9Uo-v=lb0_cBubh;#8VBhv z4Tt7+tV2ze;er>7>)48N{LhXQ>wVtV;~T{AVRprHsWOKvo3hcLEsu$7sIV@|D1o+L zClNC*UCFx`e6QT)%xD;U)gmsq5U`>Bwf1G{gm-3O=Lm`_)J5r+QaF`PorZX5dCcZk zXn(pQ&8xAdLEW6#c%N=a={xD;S3Fid`CCy>UjL@V!ALX9n9Eo6ytn?UZ&kwj1+7;z z^QZ<$86#BxroCQq)KdCw2PBYdjfk~sS=i6dNM@2RK02#Pnh^u9L?k@pjEaNMLW->Z zk!+L`rwQq1{)6TUREC~x=x-Pav&b0|0&R7i(aBqr1kj|EOki7!w)1V?^qVVfG zX%CKr{P2rHS_3zUhyHnbk8X)Lm6ARlc`yf&BQO7{awG7UcVr*L*P?a0-vW~N5LQokDcssR%Rb8LLM)WgWYldrwk0*ZT zXrXg1o0#hiux__3ik3kS>qj4QzV#Z&Rf~irueZLPU#mLbs9_n`eOsGtn+6`--q;&2*7Hx0#yWFArv%b!o2m zk=tOi0S`9VhiotDKc;S9u`Hj1^bUiA3W|iiCC%i?7rIh|-r@y9LJ)_iQ=utpf_!Gi zdu`!Qpl8ClPc(zRAM%#B+xEw5MoTay5>7~`Ql3x-ZV!^pYR*n4lmv-CKNNxH%E-zZ zWAeN>%XDs+ZGHTw2nAsKs$j@Nyfe>avsWBXAuFY!r{J}A#@|_U>LE$S+>imypaFs_ z{l)V5#%58GZLvdlke*HnN_h%_CKzXC3S)JU=bR8d7QVZ^yTujb#@-zV7oRe_|mGm>s~(QBjeQ~Oy~unYCCK`6zr!edfHRIs=BMSm^vb3uC#4!#Mjig$0s#N zmMo%rokP0{Qe7Afl*C4}`MCRTT)4_5AXs%=edx9LcI~lHjxQ5w2pS1K&2}$=^aS_3 zr!V0P@%9%fvi_~|k?NRuU8vp@mLlMYdsE#S!dtXPGiTBn`Y`uxo)C(mckSN|R+3E= z0`Y=ydWTKJ9d}QyVuvJ~Gp%q5qMjKTx|nJfH<%m}g-1H5RvWm3F1@Utb7rZl6ZR!s zFe%iLtm=<~Nm1xDanR(MjcmkAqSMUZC2y_6w&hX~`5_=vEoC;~M3*9$KV>+}RTgBx zWj!6(Ow5-wTcx1EX=JHEtBGu)x#|Aprlixb6pPS+z`mU-mJ z_{`nJ^DA@FLNSZj(=gm?f={B`xIQcCXm}z-&Dih_f3%(m_=yLbl$sWLWDb1QF7dqa zfzC9BZ_l;%pZc{^D)HL=odpw|j!QdkN`m5{D_mKOJB=D1mLFx*G2oI7L>aJr4qd73 zuxzC$Qs%_nkFcd|oI4CrsIYnw!K6=Q*L;9ag|_wp?r)p;;+M`$>3Ag3(QLxgc{bEH z%-%UW8cXe#cDN2+_DilwhLtXuOs-1()JGF76LbqpwA~6x@}-a>>C3iVq1d(jgNd)) zdk3`7l^USU#=C=t=wBUcHFthi`_&|~&?tlVWWG=u=MUY=e1Suq+`^4}8P4wSm>!Mm zhzk|4l{8pnA~y@&L`@1F@|1O!0vm4SxI(x?UK!%8)>q228eTtsU5TI#_|Z(EM&iGotdr|Cl8337aBWJ5(!8*d0wc%0M%!DaMy8d zb%U~AJ_zVl>b#4kdk&wbEIycuz0`LO5B5coZf|pIcHrdfrwzFIt@&jSz`<`cikSS&<|4f5Z5;@=~^7ZLXxX7yrCBGczFh=la=NZ+{? zN7dze;3K08qWJk$=JYmWFmA~SnuhKRO%-RGg)mJQ@1rx3Ajb0`l9*P64f(!3I>fo; zu6I5Wiz&fmJ(SVl44oUcGmqLGUB@vyR4V*t8oSH>Ew)OrPxke&Vm~DfB)p)UV>fF4 z8A<-=-2D=e5X2PzN?@VvZj+&id~74x@v1|3gM`*fC^&ka#j_GyI_any4l#gnK6mJX zllzobq@Hcl)CcqVK^Awh9NVQGC9^dsa3NwYx77K(gjz1vD4p~^4^7P{U5{d*1qh0N zF!zUrHda0U0{{`NC;Ip)TOs(O}K590VILv|ams2ThIJ4Bf;6nhxdKrg8= z(`9NzQ0-8u2)u&`B3AvpbiGb{^N6wZe}Mant$Ff|dp0T{)A!Z=)Wf*KktU8iI`&_C zNr@tgpJyFLEPM)XB$J)9RQbr$XSh_lsNf=>a&QyQAK`syrso?{J{RCG?`)vgMo((a zc#9sab=j2aQ)Jjb-VxIlbhFhM_jyYwU?AeCP1E}+E=zl5Gs+(&6)jt$V-1)(rsxH( zXy-KCgl&X|^xITBh@&Ica^Skr`|AK%F1?157WL?$S8(!Xo3V_ra^gA^yf~>=YrC|@ zI5)-ajE@~sW0XjRfm=P+D2NJHE+r1Jq#~?H2pE?uv7^14AXNDi<&L*TRiCC%7Nl@F z)gHcDHhtCXJj!l+bzsTIK-k<`G%Qvsqni*AGWWj7zChRw)=cRwWpS3*5^)>)DLRTy z>^ly+%eDFmzBDN-?NBw(1H9HIY_O9P1&$+49Cx|X+V2ZIwEaW4N8M_&=>LDXP=a&410Kd!&EV+i=Ape>wdeV@i z$$@51PW#h;)69*r)Flxp)wDm9ck(RNkB!et7rQY6xnI(SM(q-a?y4lK@GIi#^flNx zlu_j6t_hVA6x8g3M95tUC|Z;L)NscTu1+Jpr96((%)n^f%jq{78|3+~UPg~+(wLpE z{Bz>p?zXIJI^%=ZZDFa?pllFLKVs8iy`wrA{sW$xmamf?G(m62Q`UNfpdwqDLqW}CHF^vZCQ|By$1)r%q>%#RK z!4fjqX2jH65bmt&;y(1p_eCN>Hg9KY%_6OjR4JMVG>THrwDz2Lz{pn&a*Rx`olUmvX)8O&qum z4JD?&8ET5XMO@=BXXqNmy)s^{i1yas9zZO1I^-wrN!S-5O0YV# zuYyA2ytDMVVC}cLH~c-!=CJGPH78IoN9m5HwxGntU*^RDUv>|i10eA8T$;<-xmmnF z6@$(IG+i^Ls{V$H?DTUmS#afyET26JA-2)J7Ghp~;1zv1-FtlLdWs?3SNtDvzkwo> z$?QZkm1#xqptzg|H!87Rl_W>n1FpqfW;xp{vbhS(K4n^>=7PCBLD)%5+xQ&tIBCf= zXUakaUPt}1uHQ1o=o`I^f!bV?pkU5NFN#<_<{%+lgXjPOn74nf_@+*vu9W(KM$h1k zoQ8!M6kfc5X*%<@Q+&eQ)Ny+`5G6FcuvvgOfmk9-)ISSRP*{Jwn80w~wwP(6( zaYJbpB-3k+CxXjAE|g9R24zNp5|^|MD{VSrP4ULyVBgcN4mt^Q7{U=II(SyEiCLh^tm%BJEc1PR zc|DDzjH)+PimG}(P9XA`OYEOi;-htWjChnGAB9sF64%MMC8R-;xLXxwnZ1tu3ckZJ z#LUhh5qBo?pP*UXTVfgD<kHgBnig=VYTl!ln3l{6bMa>r#qaIIg2Cnh_Ne!I4jQ;Ub#EIvdCN25^_GmePcVQ1I~Thr_=ntBEQ*pgo=bRmkX;<7Pmda3*RJ2;dJA5C^!|n5 zOvA?A_IELa^(;Fsb0j&*=hiqGtRW!nt7g4??QQV#nO(VJd75!oqna5leKX?KjB2NG zFu^a1s9yz_OU1m@xpxD;a$$a)kyI1X6eOe1HX|?;WNe#GGivrHCjQh4Pk`?l5Km!Fxtp* zI7rP|=&D`2e~e|4mZp9r*_1-EE+M0p*jjwAX~fz_Bv*tX^2HvL&aEfn^PplOf-4uF z)8jx>h@@%k0W@3PBLUX2{!)WRD*--DK9HRts$R_Bk(Sn?z;a~GBBgB+y5d@KM5(qj z_S8zJUJAQxQV=+O#1nhbh3Ny%H|EKCO$7dS-KoK80eUq%0NFE8{?50Mdy&MLVG&^R zmru;6evl{P8=)~MHx}bYDk#Uanni>>=fLyecnSl*tT z&b01@9gWFMYq!9n`afNI+F<7%N?R!*+U-&f_oqukf(rYPxbM#cE5kOAd2*p2NDjNZ zm*r@))$6z>6~h8;O3pty;)UQ*@CJX>`X#=JCZ%WUA1fKjW${toYGPhmJZfVbyH&&O zNEb&vRh{e}jl`U)Ts_~*JpB?IZQ(78v}wtd8fOqGmd1tG**MPP6tP#Gf?`x3hdXqmj@fF6hQ>af+gSy>4*TShe!Snj0M0PebK9n9xXC6ir$EpnBwH~= z0k7fn8I3Zk)|2)iN||j`LA{)u%Zv*un-&hwM434Ma;%BcahMlfMZgRj5AdBBp1vv= zdztO#nWJJ|@aU=X1vDqvwpolF}I!lw8hsV|KM zhE*I&df;w}yF(w2>e;#L-yRXvhj}|V5##e#Wo)<4W7v|olT?g_PNwheYDI6O1`tC~ zL`xYI6xDHJ>+x6f|$m^f^luQhG2|eH}rW0gNLRj!2|bBnDAiZHPQg`14aTFy8aHd`Vq& z|IeSeu}rS2hVGy8mF8OXunEGB*sVDYQg_)s z$2v9_RF3M5RWG16BJ6F%c%7!24K7Ypq3-e8Cix!IrGC_REkA>duApE19)H0ouo)04 zJyAj`qq|}6b2hL0^Flk9-Y5^KpqNl&jd4!N4=TRGOO|Z`eTf5I#C}ZOM`v=^mx_uR zu-U%SrmDAhWIVXfU_kB}z>;H;fg?<|F)CJ$ZtKTb#<>5NA^+ze$5f>B+st^z?Jy2& zb%Ly76~JSBp7oRFzYGEV+em;F4xnrLPD=lLFB{mwe`kyTMPmF9d;b5o@t>FF|IK>H z8>7(&pX*)$^xgMSfWfwAfN2Z=Cs}ir9-wFzDv4C5&&ht5qm%k-2=d5Ga`z# z1SFjg0b|bFOa5K=!QiWdrO+_s?-h%^4iWgp5|U{8@g zRsE-TZq&X;c3A!~#S>7>tg^hk7Z{ClL~fwyJdQpDh;*t_qRVGWR@vaNF>>y#4}gma zz{6V*QY^%D(%~QeQ2zm)X6!Oqgum)~tKjG#YFLd4aWjPpl>N&eVys8P1g0 zf`Bje6ZGNO?71rlZ_ih;jvdWIMBIJ-2qFKx-2F$rb=7e+`tS&No3vl3cHAxx#^0!C>?jl#9JN_N7D)TgF`EDQ>7#0}cJW;@;+aL#qvNLN6cFZaL zM>sdVmloZDnKkI(9)QF){{(Wo4L)V+1QHvd=0W;Eh#3rEoi~$aqT1~q4gu0X`Ur^Y zHPG6v11S38D_}r_YPJT1dJ7B?_8`P#hf^B-d49BeT|f+3u6G?E&}n=Rziz#7W>qiP zXq?viK8ro@{^AzkR&(OZ@h7!rnLBwGbvM8C(DqkFi?A*M8IP4Lf=Z0^J zo(On&WOfEvuV7bT>Uv1}XV5#?uc|XEdX3*e2c-=$-}EMxy=M~`F7v8ldz!sP4=8vS z#G+{tjxEG-cxjpOo~Q*#a|;ol01~Lr-TIM8&SXTcZvNlRXwgJdVVjVBxuyL`#mB=Fx!(w3J&wh$WcNv^o>T$gZw;JCcTPoBRtH0BB(Qz^t%M z;$sWc4am^kGZDf1$=2yOSU9cU-__V9pyQrPl?fvC8)E@R2Wo_Sk@|^05-KzNc|D5B znmX|!Q$OiNQVlScCDuk3ou^q@^TE3YNQ%4%kCaBRp8%^ows_XQB{SY#b@uqqGUTfn z01gZP!9jTeNWI3SK^#MrVs+8JwNwEdZvl;@3tF^Hl&)iql9N}{6WwOCOE<1-y~ z?2LD?`XRPM#ALy&ED&zNd8y$SS7{fHP7cST{gw>=*>~5?oC~103#@12s(;yBJ1(AG z0ZuusJDOz;oa-Kn&NTmcox`}P*X;<`$%9PI_Uc6pM>1=gUs_xmPA3nb7oZaSE**)r zM(7gri*cBnZ8F{{?n}5}#2u$iHMSSx8rpCIOw!5G)6&E9fg$)G=72OySenKjXUa5+ zbZ=h6;*?lr<2`?nTaYgpO)*;pNpS_Z?mJ)d3X{h@(o3g-tg#O4Lc-}bxRoh4z5@a+ znMsz}&{?cmzuDBz*OuJ=Y<;OwUtoZ11^$r0?jMOSx_vv`a|@hvT_aNF=bG!{RxGora8&|AD@~)^HPnDi)uIEfb%tX$22^S`H89$jieht;+*>fYnh=N zeWXT5^aXQ0`VnEiWF`!1^#M}vsMt9ISh7;k_W*TXpt7sHUD|TWhoH4Q$jfL6`>qX!~byhDvgFpx&dB+BBBbHHhz9<>oBp>mA(vh&1J z)Cr3L&l~&qHPF`N<}mQv)t2}}>ig%7(F-q}kEBN;>KrJAam2lY*d9nKl{5{d%Rsuv89;~K+ZMHMAeCy1_c#@>Vw-8C889^XuDSjT1+AH$hOn~4qB||tl+VZ zg(D#b!?G*{cajg1EdSJ+<$Ib@SwfNaVwj2nent4oAufaj@&u*gG{v`_nMO<%8l1?n zm&B=@wMjcig0Eyi(eoU4^$Y3bbyIW4=sobNn;X}@ZpOSu&`X#q^~kz=2pk{*O|Die zQTf_d-JR&yNrm|oqny>)4@XJh4N_v80%zgb*0(oU`~94%r>&QTD#tPeoJ`{}v>D)A z%PZGS9vrqw<87DyXwz>CsA_xBaN+kv$g`b5DFMb*8Nd-_S3FIR^#*V+dX<*$11~>^ z`UN)zQ*2Iov`%zYdpxbAUOD%Zb}!HxUF+v6Ur@DfPQ3Ko-kg86y~1z}R}qpK_Vw$d z*YNh(x5S<_+fHLTy1OFDOygp*Jc445tt(KUXF0VgVAyh7DdB-3uQLuJrZY~Iu-Lj+ z;m?;n2I-c7lEriJQkTV_aWHTKQcn+Iox^0G8Bfg8+CAmpba>3mOyKtjM zA4Y-{3)bpNNO=J8U1u$b(0`I?ET+dxmjLKwB=0ny^HZ+-b(pYZKHIR2REZjj4P&*~O!GnN1YS>H z4A{$Z6_sm;V9CYE%tsTG7ya|?_%929wjVz>CgFPc9>iyM>$E$^S3pHLpaHvNtMymuEp1d zWIXzV4t4Y+ZAZot!)tw-C;3cFa1a*dmxXT>uQM05U|GTFsHvUAUs$b4UbtBogz;>O zNjtAJ^bu>=y)+r|4`Ht6v>W5y5Lc%~Ibl{bbg>0KghscFrxFsWpSm{0&y~zv^nczC zxuk0ssroe14@N_$R2gaRyr|~6$&^SIjyhrH;w*tXhH*HIQ+@i-45}Re^{Gli*F>#24-DcL^&4x+RWtpU0iO7``m1 z$`oF*HqmH3+Z5h-;*9+A85+YeJ~2_$Ln12nAbx-bOktdvI{pZco#Pep4Nd^HGh6ys zrFXPx>qI>6aW*Pp*28c2u7!wxj*798~@2ftvOI<6J??bH5niVeH)>kXSO?DPz;C{hBWf~;rT zdW`%}g!AW*w0}9PvLglGVBBC1VPlVrZD*Wt_=0%tSGSzRoVlExoscQuTu_FR5V>Je zFWf(z+6n7q_Act2RX;&Flzo%~wj{H!I+^9DYvcZEFSsV5V;L?BXt~V)y|?GHj#Hcm z@AFdp!qvI{-GX*I@2ZDaDnJ|bJu!wtyfcY)>ct+T2yUnwRv%%wX)1B1cL{i!26r=R(*tQyKMOAAuQ8nAvH z6WZ^b-Zfo;R8g>F&S=e_p|NYpEF1>=w3yaM3s95Q8B#Vc6ZMo`Zzp8>8Ea1oTKym` z{TygLmlYLdaY^L)qokH7CG~3T3T6XY{lSih<)&-FXcBiGNAzsy*3UHu`=IP2s7C`! zpCkP$daL_a_nMkO7i0S{oSZ3yvFbP_id@gN+#!6fNlyxfRMG95wL-w9%f3@upI0t9DF2_0!{tLj-Na8<1+6Me~@ZR>H=g128`2@+$%&g_GYreh6^e9T~}TW1rGK=fR_lNbK3lk;uxO}KSrT|8gXik;mkOTUmob#>{1l0&!^@8US=A5j+I zz)%e4PkMD}F$CIcP33GAaGB`F(>zJ>pnF9mnK5-AOIZ{24blW!8lz6(xc7t42o%87 zeh}nhfGW3_L6qVjz#-s|@v|&T#y-69A?zB+-7$LEUQdIOer~6$&<`;g8MoCf*Qvzm zL{ZvS8=RYSjoe*FY4wEkP=BbW-^Sj4w!Lde@JP8#GoEP?c7~VJPq9xk&_4X~XR-Mg zJ6ysO6QOxexn&Iu1tNJS#Zz3l1oSy!lUwpZyLwPQe&OmCN#&WJ8dVq5k&yL?z;10y zg0Ult>9n(z$w_T9{?AO^J{vRNVaRmTwxsb(GPqrYMx!HHGII?1uo92khZ_w_SsD%f zaF9YcemvfKYqM77=^#|RQ?uB{qj*Kf!&#e#?wNg zLc=h!-Nq$3Svy3wRyMt-PYtSs&B^XZbCwnVf!c=WjcB>8zi!g~blhL5idSI$$?TPy zMad8s#!T&`&tR?B-C6QfF#^Za1e3__GmT51a;zpcs0X5b5`qh!U;r6MU%%|34sBkJ zRmy_>(aQV&d?iUXh(xGf!c>3atOu6Rt`Gjn(oUd_jNYhBoX{mXt)J2;`v8Wmag_Id zK%mPeijPpdBb`nA=>h42q5)$pBO@+M|{K8VS^5_h=Lr;$X-e{^w`9T!zZ6vJ-bb z+Q_PLZ$VYm<6ZL4%B8;8_;o^HOkj;PyiO24QUm!%0k)%)Jx0AQT6D; z+v^NPQvAAy)F6sUCY{U0VjR%q6P=}kR`lm(9MPBc6_f%;<8zW}g<%m|l_14=DqPG- zT>Bj^pWupHx}KC7Dd>zNxc~cBfdFKba#O;kn*^J)*9Mo9L}*y~fUFQl0jgDrmdX=_ zEAdfMsP=PeVdz!j@>^*9>W|VCND`dM+E~+_v;$=|*3sYVq(_;&UHg*Ds9e#ol z7LkNJX`*&hB`?%DWiv>ZI$gAAKAjho0K(!ZsOU(gL{9=I_{pl{Dn`o9q;kBTu}hrt z^5HGNBelGeIq$YMvYS3#tK~1iIzNbd6uwC2`At2pZ69gi=U5uo@qWo zdPF&gZ~x)@3$7`;@9?*oH}X{BA3EO0;petgK)otB>V3-VV2Vu}U!$8^MA*#Y91C4> z3qKcQs6AN~KS4Vx=Le`J2xgdK+{9lUMJ|#rQm6i_hB>KN#gu3$_ovgZ7K>ZU8Ck#% z*BMGTYtgTxnkU6>{9XWJ(<4*qgr2IKCbe{7>DZnIQVUlmNaM<=;`LcahUQ^)oAMX0 zQ(bL6V;xYI*)=oi``FwpQqxll&giuh`Xo+i$DogufQdKsX%pqsQzA9LTGBTn8y>0Z za^Q$Dxf6}Q98ebWg`Pm;cjXyTid&(+0b;*x=O2JK2;q%5KBw>Cvq98_2~lKZelxlJ zmEaQi+q5W3-U!3JVLlgy-tB+lxv}q%q zXI}xT&;85Owv^>H)Anng4IidlxMm+C4kswl&;IO!pb?qaX{>#KGHQjnLp5DraFb+` zV#IA(wbX^wy(djcFox0QVfqywrYO`i{f%6K$IDp88+Rc;hs2xiI(pe+Rkt z^Y(vCIY~Kl;}K#5%0L_m5ca@Y0(oOEV|3^zef9SWRr=S8i>T%|CHjAEN^!jXeHUba ztuPuI6P9NvQ}dVL-(^(Qw%yHar`@~V@GzStq*t1L`p)E*ZS#9eawo&zA+hMwciNA^ zzfFAI$e!78e`ve*fg}Rr~c1!JQlh=E{8_@U32D z0xcD%Qu|p;JPb^&6D=52K;-H!?ux0%WKv{$njov)I;PdOWY*F3hY52<@&4fT#= z68<~(_fo<<#S}s+2GwTM3!m9Ch!7@SYv-tEZIl5%mfbwukazFjJQUqFY7zLK8vTBY zdw_J9X!PUP?(Kf-Z5yPixN1S@Sv~Z|?*UEahd`f4wavPZEojXbMn*d)eweV&?JZ8w zDvx={oD6?kNdY2HB{JGrFu3rNo0Gd(tK8j(uATsNb?rwB3}{I<`EZFb|8G6T2YoVQ zedO6nZxXuTks(%uU*UG7ttU`Td;Lj4DZREVl2*{pckxY{$nN;7Z>r@K3f+2mSMB9# zj!F1t{d$7?r-RKu@S|`P2z8%Qln@kQVasUw+|M4R(fK8vU9a7J#upx#9G5P*Hrc#Z zxMnpkT6;$1{rL$PKI4Tv- z;^SUrCe~;3X>PeM??FyQ%*}2)wQr?2^0B1-=M6vNZav+dHdVc5Vr@tOo)7X8@e&Su zcU3*p`ycaUCFgp3F<1>u!Cayil{M%u%^M#FLPD3$V$aEMU8bL}EgJ{AH?4F<{DP=( zN~#upb_))v@!WX%nGBkL~0CmP?jHG_zB!Gq&2kR*8S+-+tp=yl+8Q@|=_& za6}M?XQmr75f@g}4PmNHLfI6aT6^m1q<@qcGU?wl@jm~w42)bSP4bbVEXq5EcgvQ3SYSYYO|Rlm3ci&yW_k@4chb}%=S5X9vWNE2Od*y!*bz4Tm3u#a%ROptW$qM zn(>NV0i4}54U@_=ns<4oP!O(CTJE)*lDb7DoP4>LPbtACZyH(fEqI?O7X(r9i1Nb; zXY9o`uzM1PLvc7oNc*gE3+;Vjqe7hVY>f_jeNLmMBsHgdkXNUwEabwuLZ zky9L%!D=}Z>)whk1s=PaO&^~2V_eRod7#V;nogda&6ErXWv?8ht5zb2pr93sIy4w%*Kono|ChHHr_B0xUc7Y~(N zDd8|{!gU&zqs=I`-O_7C8hwcR%~9XP$5-Ija_7jW6!jtlU`&_IF!)bGf#= zv3Ol3q0_Q)zSiv`6K~h;NT=+^40z~GHCC`HJr?_Uq>xPGkk{>VW`}G&e(+I+zBh0- z+XoiZuzLqXSokldwau%VXZs11aztrZHAC_4s8>+$c3w;}I34>C`a6;w9RF*J1V={jN~%!6`sGsAq@`eJovFf%orNY#!@ ziPSNM^jQ{ZZ8?P{3-W!v_USLYva!4hu8p2_Y91bW;X^Qf+hxAOUXJl}xs`4^wD8R1 z?>L|0aqCbOSOh0Vf3##)<0SMsay*q9FDidxtL*dvt>-``P2(&c0eRf+8;d&zq`R(zuX~n&}0Y5%Pk*hFF49#%2m1ZL{gL~|@=G(&!cIun+ z*I=h~ERtC;9k15C5RN0a=SSYd;2H=1XHlGJ>@iZd@PL$V>0*wOx1z;WO3&uDz}kOx zeohQsZ@Md57k^Atoj)@EZot#_Sq>b^{)U|SyEga6wIn4Nap)}a*Zie7Yl#OqO;F2$}FBgKK$K}GS;Qq`g>gUj zQN=neo>yvElm4)P46J??) zY;h_K{pL;%)q-NOJT~W@9$E5@p+AE7%a$EBiKG8w@f*QuHZXUjYQOmX`4fzrOvaKj z5JxREQ^^Q<&;0gNlC&s2xn18npKL$%PL9ZesZPWItTIllq!(83?VfNux=jHFYd+BfY*SX^o zTmFZ)i+eW*9Y8LqdCrt3Z}AFWk96?Qlk`qav2?Gb{9-=b*4zx3*8Q~SIr@~h&yJYmL~46^#OiKVa=yqv5nWM)5iPEIGU!t{_<|N%vRck zHR`|UQBQiUNkw(%t5l`?9QL_4dXhuLu>=RR%I%A+!7=KhFtT%nl(?TwSB<7dml6cB z$8TCBGPmROc%|D_n!N-fj|4LB*#=6+mD=^Pt|s}#kJ*j#vP9q4-PVOCX7Ga0C|L#8 zo;5_4$4$TojKM6+)IRFFpa1*>Xdb$<^Cx%;w2K}z)-6#;y|h!t-U2DP^kO0!quXcX zND275QAzqwaw!y_$G6sDSodQSrHhF3)h3BkZdCRg8Kov_{J8p*@QPZAw#;{RM9HaG z+`5-2+@!x7g-EOH*3294wN#EaHulavVOEn7x}0UF7)Zz0dy7dCRXA?cMpznIt1PCsZX zrYHCHi0qJ{;xIAtwcypcat3UBZ(!ke72;;?iI?U2T}<|*Js-gGjF#x5E|QZ%?$KpT z9>>#(d-{OC3JUp5_~uS;B$5u{-2dF=1S#I;wzd&?JJVG5lO&QuJ9JtObJ7m9 zdWu+r$G1)!(OyE(jT8|)8-Y3|ze_JIT5%|l0P0BO;g?7#*9XF~U#E z8HFkSx>E^Qbq3n0+F3j=;=#I9eX$}!N;y^Wq*H`DT}5sN%G`fMXoB`qIbW#Cg{wDa zIz%fvjn|bDPyBC%_DpZc!UpBIKrXQg-5n!Ib&0`?^YBQ5c*S7~e7!IdLRE7OiU?_D zGG6J`-j@#ht);ig!bj^zJ(WtIDZe^EUMIq5Hy)rOHc{$H7Qk>SR09^{VV4YIyZDNwalpM+re(1k z2tX&;;nO|sO+BucbOU(A{66OOvI3*mc-~L63@Ml1H-uh@bbxA|HDYxvd(-U4Bm1lv zx?gZnN$80!&Z|fyUWkrLPT9@}#!k#*O1N{FpGyoxC`mhs#YC@YtVdhQ7l#<5H8non z4Xp>&n!2LJx!2|w`DiiMkKKAB-2^?uaUbx1G2Q0D6h9r-fbvx^ioAX{!yP4|4sTUn z++!?D!}?O2HvIDB8|Q1Jff9KDmS%dbsK* zjS{*NhTvydSm91+;&zNhEGfmL78h8s_LG79Uq=CHBKox~{aK4yO@kwuSNXevo~lqH zU?zW9%TP4fO$fBomEfOQ|7rwo_uWpOol^zcb!fL0SZtMsQNo566$S#KoH1FI&0p#} z9muCyGhXH0{6G&ZYIJ|D%D@u+rd1l^l1{AB(wq(4@FkHk0FeYgaZP!0-01fDVF$>^ zmMCC+SIDPuV=^sogR=Z{vuR9ZKuzqxGZ;X!8<57JZmQ1Un~=(y)XDQN_opZiJeF`~ zfj*8Quo8xe=Hf$|6AYhvpA%yHxX$N&EK+w6cq3$F>xWK90^-~Hh!4=fDjFP>DbbLa3PLHUHre{l`5iR+6{Vkc3^>{fC|Y*EB57^+kMBQ_3rpzb})?qcm{TAe`G`>p5Onrk#MRwVEa_! z+X43f^A0l7p)i?ES$|^xU)EO`1Z-c}ed1#Hzis=UWssKyo}l91XWIY6`i8$u>H@H+ zKb`jnZfyv)E+W+8gQ!@T0Vv=SASRSdUN)_nMF;M}TxZJRpFA+(igb})81QwA<>8QaNPP}K z_zh#1=SRzHVaoJn(%R8fvT|-wu4*M$Af5i3|qDpnO z{CL0o00q*IDpvpuH7j$Po|-Gm|5 zY5N8|0o!aF!T@~byT2En8@3P7frmi7!xsUySfsP7I7W9d)F z1kZ9Fr}rPl`+>ialL>JP{Q2`2;5hzSl2|7@{iHx(WfFg+4AE^p1i0C&(5r>YV`R+Z zR$z?qPC8_+?e`yGRv&VOfJ_mfXo^RS>W5W>BC3+{F!RBbF-zbV z^Ba*%Kta6p9p!CR^dJyhMFgkz3_AfbbQEFmJOnJr?V)^H9LWzRW{orJ{eeQFFJk9& z?Oj86G%P(+17lbzqc}dj!PRyB7~F$y+(kV~9?Jfi*qe&i;ng#`!<)T6)rUbYpR2B{$Ix*f3dwjmzM!x_Z+1G5*@#e2al%T3UAsO$PF zvTiB=EO!f0W*s&Mu9*nJwFI!?-*4^^N9?mk?MtT)&3Iw30t4r0KlHZklUZjT2c&+zV&~6zuo2`Z1mf* z$Kiy2Nc=4;C|3wZ@2icbpohbnuE(8%P`?s5rJUR-W!G2iHWJ%3b z7y0pCIGKZ<)ic^J(dlo-geaYbmj0T#JA&lln)f)@cG zsbk=+fW7K1Et!j%ujZBj^7>owpXg;CPSPskm~^fFGP`RC0KGuHc9}#P_<^$4*Hdsp zFv&yUnVE}-+uuonUHAImCn>&-k`%#MUx9|eS0JD>PNNGbYG1RP397mQuIR5R9Cjo7 z3k|`(xvz=IqPo#TIH_Z3?mg=LfEua4VunX}lnkJTzFV}-w?zwGBPnp#4!xPaZ&%ck zEvOe6Ww(oJX}IpA{HSu9uWk5uMJE`@IeH*YqowKm%O~0_^;ZI)kAk+OmH;Athpq#G zKK@pH09rDCu1Xwa_Ds}P6bH=QI)04X-k_p-qo&XYeO#dPbIYxCG2ME}s6E8Zw@}tX-4EJzE;Pj*q8G_upQoUk(__u7si9A;SSUZtr3r2w5F= zUXQxn_)N~xC+Eks0H38aejy@R@wos#2z)*?C8V*#l%%Koe$@$ha9e@v*x=qHX|m5H zpo(9-2Xw8+0U(-r>hZ*48Dmz6__zQ99f#4Mx>1g-O}0;^iq5`LFL z+z@YPT>%H~#VcG)NL4?=@{MQ)Yo??lNAPT`Z1S8XU@^kH>}(6VFZ&OBJC&OBwIo;< z=Ih>d{NZ&w5w%yfh`>F=GO3dQk6lw0^lBj)`QZ~ND7$pL=H*e%Y!=ay767K|Dzv1t zEhxK4I~Ri0t#s-HOt31FN`Zh`G}i+_j-Dk78AbAJ5VAX4N4{SI!k(V-t9j%}Pes2K zii#3#667#Cr)H!9C6Vreq|?w@76PwI{e4P`T=68&bI>pem3Xu`0Msr4Hso#XbMVk-i039!xY>8^6S-U-{YUXHMdl_(*H-XS|wHfrqGN!Rtj1vG#-JOeCht@ZOS zD(A>R5MWeir|>|i@^e|d)T2)<9E=r=8{P|F%}?CEN;!b;JT4uDG|TxEFWl5G3lF~E zLughz9&A1z0oUsxk0Mlp=K{sy#eH|C)QDp%Mpj)9v?z@ z+?m{I5yE$VhhOe+>_1+A|R|bR@ zISb5pgB-|z9&%e=s|)4!V6HbR0fUCyx4_lnuNA>5Bcb^7C~tp6>Dm4%(T`{7-g9-f z_z^TI3qUqFr$2?sX|!l*K9VV-@cQA&2#L_)dVi>1x2A` z$vc%K%wydmTD3=N{QDU|o^A1GzcQMFY!QRnvh`7~=!!7sBBERNZL5g6JG{d#LsPWk zV0cq@kKh}!iM|Myrz*uFP%T*BN+=2SP>uW?Q5^GRZt|$ z2OL)m%$Lh*#)%?gZE7S}9g5c5SCand?6#Beltr_8R>ppeUVnJ~uDy?2AXhh+a(-+k zIl~4IlUBkRlq)V|$X<*1&8dSp+yMS#Ue#(wkT%IGyx7JSjM>UG7*BqL`x5XAF6X+t zdq$n$O5MlG-C2M3O6VLW!*O0mvQ1G^$r6si#h}ZfKa0CIuNQ2Vn2e0F35h-9Eqh*Q zJvOx0Phlx7mJp3Uu1W|;>(O3d(HBYhm2QeI5oWE{N4nu{9*D>uh`kWKFc=fuptbb@ zt`B~Km9$hvB3ZWk(Lv<2*bZ7t0uZn{*i<4+f&D{jCADAuQMlo74DB}R0Nb6fVZlEC z{F8ZH&c*UG?0wZ>Rfz({rviQwf^3QsuB%7Jn7Jb)yy+j`?6)1;z*3F`{S63akj3%4hlBwIXNJaVvdYEj%<-v zv2Bp=l6RB_24!-~q-K%O*jr_wwqwNM;SY(}cP(;7q>REZMzjB1DbY?fomY9-vk@oW zGtilSX$Hwe^M)Ou2=Qj0}E+un=HZ3cA7v1v&>F3+6 zBOMugNR~6=v|*f=`Y927Hj5?FHDKT|fshCVURxCA8b#bR^gHA7^^xW*VUNLTe;h)65! zdgps5>-*IxSBN!uRw?MUoGM<}X~bvvsN$bygA1`V*~Z^SgG4h3oANReXp=KQ8v0hk z*0LX2JV1(((bKQU-6~(G$8CAF4q-F+5vi+3g4P;Q?d6{!fq%csMw>kT_IUfPW9vq& zgWI|kwn$09%IrbOjR&05^Ttth5P?3799Atsb`n+^Pb(}ho9Fd~8564@{bC$gZ8wI6 z5pjNYTQr6eY@1jCI?q?u*eLqZopu3xYjXpSIO(KYb;Y~98mzCrMai6ZQg>mv1$VbW zjqd>J9Dyo{=g7IqnbpbjjMZ4EdB@N3bl_{5>|ffQbDrkfq?}1`oV$$ z1sBsPHpAAiN@dj& zms8P}02hv^S2gIo zF!sh{PvTJps0DZ}RfBbzd!=%BN(O~!*Hm)3kT;33f}=oa9PRtzO`*fKC+WP>Qh3^1 znK6H!uS!2xU{S92%R6Dn^-eY6pAp;xSC<;Yzv^>bEmCHm&Po@8c< zWfx{q0m(_TVk$81>REAAG0a6MI*N`(3RqXoWtYk`Y^68XnU%_s@V6(*t)n^&M?0g- zuGCUf2IYjvI|+HO+rCJIRQ#!f6YVpdRlFu3>Vc}l z#HwFeH+ z*xQqJxU!tGsxnbcuJU2tXG$HN7H&L6&h|=8JE%gS+jG^718*#gM zTO^aO#JQESv;ihyI^QMc#!uVr;nmVS)npH6sFP4bB0c|m<-Wy%g-8e^7xG$eFSnC= zbaJcJzCVP1gUu`rRS0=-CWv%OZiu)xCtdF~Z=ov_dS*E&p-$|}u@ne2^Il=opgI|b z&1_bi(arm+a_|j4P1rTEiM%>Ckvzmv^ozI%$?}tw-wZ~4w;?nOifGfor%b^D>-5DC zq4&qZYMSe%X8WT1ZZOc)gy+wj$3e~L`}ea|&MnKb)QE-XVkyRD8YgIVP~mFynOh0+tP$>}3vx!Pv$zM0$VzP!b{!a%dC4TrN$Isy@ga`v}uXQGF!Lc zMZ@a!d8azN_+iSKz^mPS*jK$bHifesQ-*7s+_Q2}N9<-c-`ot!Bt4u{A_eHV`Peg+ zCV|wiCoyqqcDAUoR!?;)lC~v_1ok&lW@PlH^@z#L1?i(<*mZVC;WGmqnm@APB=!EHyxW7F-TZ#AaSwnNTfk6KA9Ou zz!a2&$esF)!|nH_W|?0-<*H|$)lBPxK%PMvqHIAa{3*ikjEZ?GmzA5+6tx$nJ~%oBu7R>pUH_G?D~{vyZ6@SJ>osAVn7GY~rb!qXs~_iZAr6z(P6hWdeO)RAjI zcu`Gotb0mCU58vNhwM^V-V0P7;L_V>rMj@VmHE>(i|UX0;60C#t)A5I)YLpEp0Pqm zeemGZ_p5c3uMih&_`;VA(twiLL10AaU^+@MM z%u=WYz0qb77GoAnsh}z5zogb>CBZ5bG-6?yNOPu6K zgCod>1z75%)1bSq6FSGR7!G|YR^E6LA^dPyU2?jPFRn+!2}HI?)RTh9g-L>^J{mv4 zRGRarxSfU}j)A&~$F}&JRmcDwvd6#mW*;Q8UCLE70)I=ZtL9@Ii4J}<1MNQU{eU8t zoAoRCB3dEEwMfAVw5h(xjE0xvk+7Z4r%a2+e0|}u1Wuxht1$4{+_sImPEmfc_P8o;yzR1)n8#c^n_`nkVA$&KpYd& zQ_5Dnem(P}a7b|6CN@tZ)s{pICJEG|6zsl-PN=;sZ%z)Cezor+ZX&)@OxN&Rd_yU8 z@gTuve1GpsiP>yq*1no#6{W)Zf-5edP!{J_pc-Jom$zAAB%hX16jBHkyjd~7=zk?D zdHHlwvsjQsSIM?!9ivNhP>j~H=xU+NE1h?r7i3#Zs+4QyjUl$GP+8Jy|JspCPlu6U zEx3hXy#<3{LpD$=fjkAf3FneX#l4UH9KYxP+|T=c?9Dq^%$ij*-zz@Xc^-*+$=mbrM7iGc+|mWpg|g`)q~sm9 z(~y$?9~OY+30n$gfN%-V)VEB4BIei7kKd{`4K7h1PS;mh+496YIdreDP1zl*wG;YMeju;{qUTf$bgIc29ep80o5 z9k{b9BuUhod|hBUaCgWxK7?I6scclk(fKan_=X->P=ia=??AW_Rd%SF%WUKou~|%} zpR%3a#*~yvffDSI_DwD3&H!X8Pg#(WFM{MdvjfEu4>6Wph$Mx-UaJT^;z|L~_``ab z(4i%gi+zvZ&0D$e`}6YdV%{20>$eBnXfbNLa0+HYNrck`=HJv%#SwgmY5e+moplWf z_APr~mUBwM(P&3xr9-asSBDfs#j^^xHBhyx{y`Sg_k^+^@I0W}n9IIMHA5=S!$TzQ z_;rB_j*O1^F(WFpadbah6V10c6>P)dI_xy^sc%s`Epe1S$FdbOWqWky5)YM2=WDuD zH9oN=8>s4^+?(7Ao()-kN?9wIC_ct>=2Dwtq>AhGTa1p3SHyVTU|Zy5)@f*AN`cIv z(aA}D zajq`Lt)0>MYX-ryB%N`mQf&DKb1>x$xGM}}i(6#zMRV_|(xFUi#UTG;to!b}{h>CcxN1O4aCvILO@UF5)2bH02mct4Ucsad`33F|=>Wo)h<8HGol#(Zu9 zwZRYG##)mCx_!Y$P0axI`d%r7GJ<}p0$`Yb+S{#I$Fmdd=g-?>U^XS?DWQd@?Y z<@EIcuN+G)kRW{>?9DCpJ~D_t+VhmKvsYyBM@DID3O7W{jl&9@P9}k$7$Ceoj*LO| zWB66Q-r&_Q_cM<*_kqa+iiJKh_iCHHEOX6uM8<~%SO^j`Gq-?{8+Tx=eRpmcuz$=>itE|@;7b6h2 z{pU<0VoH=5uyvHDB_C^a=PMXqn>Bwal)c8!ma(u>YkELL!R6^p$DUcd?tg~p?XT#% zJszz@QQGto34Zjg3kX-sbJ>suOr#fI0opA0oucQN#mU^4%#a>}0uKMryofm(gykAPKd~iOwW&s5Y?#tD(NLU$&Y4}$Y zg98WMlgIFj^faR!3B{L14>t^ntF-vS6d|MUr zK_@y1_!QvGDLX+m$RjB?!=^P7y{KAkim-%T;yt%UW!>9SxMykB%f35`mskIuybl3m z4)^U5vupevH}nzu;~Uoorx^_i z(&di%uynz5D}R~$0ys_tY@IrXmTKz+qdQoBsv1$uiwwHN_K)H{oBtydF@*iK7w3afyQB#yf0daS6V8{1|RfPsaGi%beTH}s0eZ6+;pmC zJKl+aR{CVe&FQc=GYKV1=%pJM{TpGK1P~V=2UhEZn$4Ah>25jkS?W z;LkfTK^QBJT&yU19Bx=)H@LiMr_k?Ox=cL7KA9_7i;X_LTM)!YqiTJS_m*1Gs&V3cEhvcg7za78rfH8cEdpimE;U!431v?M z!YwCOGNacn1V^_@@=`8#qtF3oqI_$IiEu(@*Jot}ifNY^TIrfPc&oU3-c-XM^ZPjn zggK&ww|XdoB}v?dGGpFiwV8%TRj*aYMwJ<35~qRFuCNrN`Y<)w0=#e>q%%y_fR3JSH5QECagFaqz zf`w2s{LC?f`(TXrpa`6`GJ0k6Y_pv{*JN1lbM zl3>D@kfeP0J$*c3Bq}s=#e#SgGA*$G@B@E`h1j_iab>gllL)7z8IAY5kYP9nK?V^? zztfH8tB-@pOp^;Ps{QnK{471Gjl=n1(`1%p4T$tCm>8na_;=xKWN478#n(7soj|%0 z_~t7^$VS~lC)_gVg8<6`1W#>8$&}0a``o26o0JMw9eV}~-8y+})34qM^DT03)^9xA z<3g043E-kn>xq`6b|{3^jHv{DezWoJbII|>-=@$`k$84S^o2DAJTM9F9@4r>(-2j{dm}1w zU1~a0UWCV)^O4fHh$rolW&$PygDYH4zM$#nI}Y_TjTo)0rZDv=V^&|}P;@)2PWo%z zmp2sOn?VPD;cr~u+a{8e-PR(b*G&3St@Dnkju!U3JAa&ZK-^1EJ9 zT?}^YjVz6_6oU@8)kiIpLzA&r=VG2rt*y~0v6R_5lQ<}Neo3GheVu$uz;lE=HJ;sd z_gWpsbckO0)H8Mb93y^nB5j4U{o${`J;X!rjVT=|s_;Q>|t4?V_ZCCdZK;KN27`ag=lUOZn0E{Vxl4o;aedhKL#Q+lHK~q8j0lk zM60M#9TfGkrfu;dTbUldc<2L>}!P)-#~Pnx=A|dd-4Ki^{3hl!aRMvFI|^E zvoPtpX48|p&d1s=@LPjO(v-EUTaKt#8Ua58?#{Ns8Ur3JKwu@GNn^wh*($p-~Oix_4-{j za{-Cez91B;+UT|~)6jtRWL;sa@3kg@&t;z{GxR%%JAsce zK73Pxa`7dTKs+11iLbk+T~R2i>8XXGw2W~&?Ye$vIOjS3!-WeMNru>g!Q#KgwsLl5 z?(xUvoq0}K#HP05cF?Vddb2hWa)@|&OVCRf1r)UzjZ4p3$suB8uOX{b`w@Gb{?Pkq zk`SaY|DRL2yySAIq=%@D^u&>A>CMpE4&bw`P=A>D%MjNO<^T`-6amomp`>_d6x zixH*5GRHAiUGnMm`Cdc$Z`ao2jGPXdwK4j0-ohVfr$^^=hJtbJ3ZjHDlEO5;3NVn+ z65=SRvNbPm(Y<3!9VV|SRuvl%9bhMgGQ>)HaVX4mq$8e`CTJw#kZ$zpy0WR-rr?qN z%zq)T{H5J_eQNWE_WOp(NaT^HSkv@m2nh7Y)cUFHYBMsQw@9ch*B{Ziu06fXF1vLy zj}qLJXnsqh(+zA7Aj}i0r(Zp#iC25G(QjKPH^6 zLkb?6SLyIKItN5T*(U^;?AH>mAfC!*J=6C|{`m6cr^rW%DRDC~#Taf;$k>L-RQQx* ze))YwbvU%$ZF#0k@43VLg(Bl??r0hC?8FpmQm3zNZ(X-)N?dh^`T!nCWt5(q+Ae*U zB;K7N`4ZJ6;&Wk_7q$47MZh`_|Iz0$D(ibKU&|uv!FxHk!0s2{b@lh++^k*l5_v?` zgVv+Zbo9XF(I}hW$vAt*@8uH8cu>N^o`A9&Wvw;`PCk%vZcBxOpqnD&JeYVO*L3>Q zTn30T<4!PID2o^W3M8DVE5^qTdm%_f-?|~}c4&IulLT zlMx`>%s0!UV=DAd5Qc6pXx(+j60JsFM-`1IyDs>yb>ybCD=WCWCn)jH>q ztSC~W0!TwCP!djAaFMf&tzycIBk=6*Wo}(NqH(v{q=!t-#ZN^@4P|hn+BY>7I-pQB z2Rkbci(PR5pi+N@roEeQXp-`2@1`Q{#b!ttJ5{&F#OUD{S55kGYk;;mDPhrEP zd-Xe6WSt%i&co-L_kuVr)D@QwEe_hzo4jX5Wv5)szoj%K%p(*}+nsZJ!3VdYDn2!T ze6#<7sHKG?DXhh8(V;}^Tkj92xG40eu=>Wbv9#ud0LWDi?}V?~zr1cJ7)dZrd2RiL zy)IwX=j6*SEMa+d!bPzrZ0>i>3RyI_ETlMJm=dioDj_dhO^oD4K> z`(OV0e>0E1z=^9RS?uflZ@ULhTlD{nr)>d+|4bDB?V9vvfRRJt4M6bhk-U7f{x*;_ zsCS=VvNwt5TkxkxW9*Aa;hxX`FjluqizrxJKLFvnpiWka^{0%K>d?Oz^^8N!g1q0C2c!v%0^ z_j%+2d=l+|wlno+O?}r0ckktfOK}8=I{-obGUM9@7BhmrbxzBYz zYGkeeLWduU-#*-3bOU;!lNpnKfcW2XN!&9rJkfA@|BDr$?yK#**S~$PT~q0C0K(1Z zB70B*K~MNgC&@Scq4^PUdu(Jrz={IS-GJR@Jz(E`r6d022AKPJ(_T+S-A+Dc02hyB zW)N=ZKEO&<1|a}2NQ%UJ?Pm4jA98It1|Zi~(}@2O4h0;qcYq4Em_eX#` z4aD7YxmfjUpv@b7{!zkbZeQy^Kw-iNBn+S1^<*;25!^UH&$Kd%no4UnPQ@7bv_FaX zqzsKy34CN21|I-D(qrk+H&u)hmy*!_nWB5ocHnY$15;Y1Mo6pYZS9>}fyZesG0d5N zz_=nq5DA&XAEz6QACEH{@|Si1l`8J`FC?aK2+(rqq6#kuSi2r^LKi@BlS-{kD_~#m zQBuzXNY3h$zKZ-EAYA#?zV`d4-{MT6(41`4p$yBtOv@qg9IjSHMZZPx7p_ZRJc?lc zf{#9XQ~~W22NWH97$5Z>eLDx8lWmh7~qb0rK-1^P1vzyjG2=M4=X5FQ;$TG1de{K9%*eNk6jP^lu zWp@)0jXYhEF=Rx=xym&6Hfaa^=_l??98LOmN=@ZZy6TVekG(SXfO)Lpr{9+UQjGZL z0>OL{zwnA@T2Vj#roi^;Bg^*GmkJYs%gW$mP1Vq`f%zN*%5z;6PIbOoD+tZyw@dVS ze<=-4ZzJ(o?>GLIP%w;SNagabluZqrU?cSoIZ#+R+ zf5e%!(wzp;hF=%L37}fb~ZZbg{s9zpAkD-IuK=V2Uzu zf%^#i@79I@=T|F2QW)eeoj*xv*-;$+0KDw7x$9^2j5QO7@(h3IDCf(+u}pBVxxB#l z$IfRvfT&5;;t5HWB+-pUw^=Udfd-l6p5R54S#9=PMkhqg1}vQ%M5FPOxr^3T3tZ0mcz~dmvlXc{*6Mpc+4~;%a;++i7UH%ZY*FI(O+j zU#Ro?cZ0^O#TTy`20Um)!u_b*R3(Ip!xT(g-OMItKpd_l3p=+Ky`L*I-10A7S)RF8^Xo9@9k8>xk z)#7P+-2)YducAm8_=Y>ch?*%oQB`GY5FYL^v`u{e>>!~D)0qfyJ;pzIdhk2~x3!<` zK$>MYp=T#KI_Nd7O0(_=7=mieT71yFeFrQpLgFRUMcitHIXJL0#OIa{eeZe`Z{ zoJZBi$^d*zSD?}~ClzX+k3s7{rKEVeKqgb-xcdNn%QpFZkExGY!g_TnSA=^4P(gDa z9-&bkq1S;Yc{^9xB!Bn|Fp2zCOkY8N-xOfavJpKGsew(S_;;nA1xDN2cEIG zyQYTe2k)YNc*e>sQiV?5KF_K{DnatJKt=RJ0>Z?8Xa;drBU zCTSvn^!SF?T z_0IXD0?oG1$a_r$#@FznrH+LcwKEG{rO`5RH9)Ff|_ zyr|HH@1SMr2VnX~yefMZvTcp{fZp*^lq}G=xMp>HYQoNO3rq*_3+sE_$eZNKY7RLJ z>oW*ZV_7C54+o4)Tz-BLrZmG6#eh?4ri%w%LM*o-m!~#pJY$5qr|6nLrIX6)kItFB zVuF|Ze!rC6@SS1aIw0igbYs6EBUZVee{Rk8PYbz27^Hjp1vL95mK-zQ(GA}bR^FMB&2K$ z37=(K6PDqndr>;rzg-fA!v9vQGGY!!xCo+Vm&C7pHQU$7I%vaa7`3{1Q~S<<0b#%SnUrGQ8j45^4_A zUK6K?x#MXR)jH`lwbjxtS{E<^mKr@wt_F#l`cz#f7Kvjngu>>Zih_EIQ@DRb_F|W= zT5~mVPv?mKX%e`56JWY!YYu%HsGc~aiAWk!0nv*O98nfID74|5%TVLFEMI+V2>ki- zqHE3|^2z#`$7s?w&OK9|#=m{3yvF$4kfnhLy%glWh*QGY$zC8-zL?{a$2Vcj{b_#W zn^g*O9Z@_5l@Ybt^q#jibZ#a|-&^VkvEL*W;e3Yo2XecvCb;fq4Cx|Vf07d;I})_kUQ*l+NPoGasY8RRxM zT|Li<;}VBN=QQfO^kX+*Qab+UtkPF8H=pqW ze;jmcw}&gv;t2n}1(xjNB8`P;`*mLj7GbzMKLOe#ATVA8Us|+d9DLNerL~l2%ng6g z;~|yfP9zv%W>Rqd_$T7|r9JaDnTSsFduYv~zcDJ?*V*+DgQFEl8(k866IJ$4q4cg^ zy(Pq$NA0||>4fu~RJZ@c7GM7-_XkloD&V0}hoFBWp7?!SsCPFuwWDYLTf#c)pyea( z55wwrhv<$#dRBXE0^*PUqKX#kUtaQhAuHu9g!!TpP3>vA|EM?x*Ip$ev?H zZb!%3_qTHAcKx~uxb4+=wf!CaTr(ce+lQ)^n)d5?i0lmizV7i@kgVpmG1--suhg6r zhz0+dMMg>Orxw6X>>V&XHbDBK{5R-KyCZc0h}a9ZS5GU1nWcGIR3nCR$Ay;0c20Gf zNbL#`d)P(>ddZnD*dgl4y@VA6vRugo8E_D+LnQi`UNFkEoGvmMLl<SzyLnzzvufZA-}6$!5&vmtNY!jKTI`16sW6bts0`m7J>q0WP~I zRf)kR!5@Y)qb5V?Q@CqAu&NM$26BeY>BLv%7j>y`UKlw~K2^av$LlWm(kl#fpG<0P zv315P`hV>>AI%RQDNSpY`nTaN?4L_~xA-mjWGCV58?ypw{^I`2(~u-d#?`Q2o@@Ir zw%jFZR-fJtys#d-v>vdX$g8W~B3RIsM*SQ~>AY$GDPM=1#oQl6rC6`8(7W}1j)2iF zB0_I|WhN1ZERl``W`;Pqw(>u;Ap*`!VND9hxwMdK|3~5QNBMZ8@A-x~e~D5#Xo2an z0A6!t^w@O*Ze*P>lubv=`-0Mcyc~`Kj{NTW$`mo%kz{orb)?6p18ivVrMQ$4$(|g# z-pcJ9)9=US%Ep1L&pxPJWX?TI2M8#3{@M;saxaTr49kB*43aJGVJm9Z6XCC}RM%xu zRdyUbgQ{gsp5AF11Z0Y(#3W4e^i>Y9#7k(L#E2#);!%d%;mWr-*KbMuYRF5IrxUVT zh@?wPFgMPh+~QD4ZXK`c_0pO-k%Ke$YG7a_x7r>Hlndn4cCyYf_3>r~a}@|1 zB@i`MF&ux6ankA_t# zb^nG(5J1(;wD?*!s~KLY&cEGdIz`=s1So0QF`9PlMJmTo;cOsF0;>xpLE|MCy zo)(xDU!6=!fAsqig3-fun-|DFp|*viBiwTHyL*xwkW49beYEH3VT_fvESd}<6=qDC zK$9ZEuFwo$(QEqq%8TX9{`$gbk=q>rg(Q^X67s# z@crb7rnH_DD2mtK68E3z(@|)VAHe*}2R&AcR8qHn*+vED@s4(8C)jd*U=w zkD2(BO{I;j%0jd0Tl^3)@x0eZPI5sL_qv5^ry3ie9Gkch@}2EwSER`Kh0oY80$~lI zU+weghRUA#7c@KFK;L|^{>6kwPvn~yV6(U_IlC8koo=qQXWed&{^}LsDbKyT%`^$V zGqC*q?3`rja`p{CF3lRY=>-uNHC=N{M(f^y92a|jpg(tg z964nb>?nw~>V>onw3_LT=$yeAOe{#%Qn}5fada*py-VVT$S;@98BwSX5R>c z(Y*JQZPn^>M9qK6l*CsiWV53@KDc}wEx0ylznAm>3^wJT zqiUd763S~H^(VXFcfO$%!>V;x$~}3h=>DUI5&%33)*4%*#Tc=z;mkdfRS^9+YLu`P zg~e0yZ$ixQ2oQ(}KO8B+vjE6g8ohgU8@7NNn#WF2(0zwT*U81jvWJ!y%+(rO_}8BY z9O31ub%}vILhVK2V~0mY{-z$C=O#pux#V7Zunw#(J)Z&6&deK%OIHEig!iaIp9%b;*jBX>_ws z#VRGIPWA|l3W(Sf`}@>c)2b=a74F8UG58hgKKA;WC#qgki8AI>VD^kGO)d=v2IIgq z)_D+OBGxO^W}-i_O)|SvBRp{8jx;B`->VHo#-ODs$MI6lS;(%wH7d=e%FTdp`)iiL zkrNY^$71Z;oj&HnsC(`eUQJqTmEvVS!z;ZZF~9S}Ro#mUNE=dN`Ou%&`zHG324q9C z)b!Wr1oTFXx~SzUzPJ<5jn1VW=QE971$aFJ`%9~HDdWU`5F$re|D{l+7fts9D1YJx zna%(v4ck~}kvKc)D7_@bO~5L8`S)>z6>epe3%df0Le>L;GR2jd2}Qdc_;c&5uA0Gy zOgMgohZZp8Sthdnhk@{fvXtF+lvlB8!D>B}Eury~z3Td+Q17xZfhFYcJy8|nG9ix` zJYk?zG5$`DCZ1HNaJiDs`3Wyy6T25X*ZdrnQ(9F+AmAFhO;}ktyAhjb-v81IRc1~~ z@y;yITHVop_?ot759%baAMxBy*{i^8Ea;pBm)>0z@3g;= zwD%+Vucl`dC<}edGQE!jkVliEDmaWdT;m-1mA8pj3nGW|4B+b*YNb+x%JSlFgNpFG zcA}7}GCUYfj&(L?Mv|a`!5W5m+FR&xd~DFGqSwu$H~W>pM0XhwOugBm52fAi`ys}L zOG?p0J8PmBsoEqwRu2|ZU&MyK(_cTm%NV_HJuMbl92}wfb0T%##h%9f_-Sd7Jq9Ad zDd(1H#mBPT1+K>OdlfmyFLxJfM^AI}oq-Xxzm%iET>QRG=@3WCQ&Gw@Yqs97rO%Y83LItr=Jy8zr_yr8!-Jdhn2UpO~Jj1YZ+x^VK#3&eE2=P&}K9a8n>1&?Z@vpbxtV z++U-#v|vYDr^(_hFV>(XOL;xf19qxvvYar6a6+k1Vy|#g$SPiyXO{lHlBYLKo&=E| zqHGh~W4$T=uHZaxTIQ#DQ>V%jr&_xtJ++egeeGN`;BK`fpt{fwSly`%HF99GjgO^o z@y+Ew@*0^Uj^VomRKE2GD?kzarmy0}qrUsMSkMW6&|o`(SKv@KEt6Ja3p3_8fr>8a zioD|pFhaets#cp1c$(HToZ4{G&PRxzDlr^gU+ zfOw+Cu3y2LzWAr>FVi8&W`G*QxKgjo)H{1Ss~Y~V3Cc)>n(^+u-wmwsDGZq9U)gQk zW+xs|74Bz9bmk_`SG=igOm0GOqWAG{=6Eq_U!EUE8GfuH;*g&|T2v0#ou55(+Cn)G zG55(26FCYE+j|asZ{|%DKtZ4I(Sr59^SYrQ-6~7~52gx*@3zxZ4b691<7P0NST84| z*Qy@*Dc&27(;{XO@KIl~9e%^`-n~Ca42Yq?Qxpsuy@Ctt6z(22;TC^j?DK-1?^aes zH@3cOpW~>u$a~SD_gtwe(z+M80@q7kbQG!rC63XU4xIU__F_eyfMP%@z%)LY(;+PH z!%>MRJ@cjuqw}=~7MFwu+J54}ct%LvN+YVJLb~RDLR4OqvPLs!Pyc-iB?E_zKwn+^ z>i+9S28L0WG!)9!HHwb#jI%nPXP0$=IDiU53y&D(Ke}(qVZr5M#&ramtzJB7Pn;wL zX;G3f^_VfQ)8Q(((Iku7plYc#KN$Q=xad*OiN8MDnMy|qX=sQ*^4A2E2BO>#Kfo<0Y=UT zNGG|grU+EfTQe;D&%WzFFBJfdf#A$Ip1#%pTgQ_oF?fh%924k<{Oc}GAGJkjKF^l^ z>(<9sDO|zhzqLvK^A|}#8Kqo_=Zx)t+kG@_n(AL9O@Q43ZR;dJ*JTf^E~)x|T#$dZ zKDJ63Oa(Chx8s^(1UCDk=_L`M{KsAU&-VgO`@i<|fBwt=FHW0G0>#M8Ey6V5?Aywt z8U-ND(E53l6ZyZ%%-9M6*U|R;^5EB?%nx9W-;31TGiB+~Ku1&jmjEK|)Bw0wi})Qt z18xOq;OO|*J@$$oH9%Z|@Xiyk3e?J*zy9!_kKZS31&a|VmLkg&)?Yxs(wjBkHPjTa z-=lf58N*t*J0WqR{?Hvk@?vQH-M0Oy-&YmZ@n4RBqJY<Lns;!TFp%e{Zx-tMmt zcJP$~)b-GeF~(}lPJDCw-p^6cq3o*6^k9@JvP030DC*X+SzRdi}%pcshy1N z=|5l)qmU?*Jn1`rhuAHO`%8_`@cEy)YH2*WsXD+hN#T>l!J5XiK&g2yT~(hUDbS5REy0~~!xX;)Yx|A?v{EvOu;Srr-Zc%CRn=<2g zTg87Ls^9lK+mxQLi`;Kq5-*mfFOHN^=FdtL-6oT^RigIN|C`G#Pt#35Dm39c?Q=pO z90*-$#>jKoS_AwT*OvoCiv&*2p=F}S^pqzBcjf5;pL*rW1bkyYpqUH$ox^BF>kJc+ zZekaF%6Y0)QQMVoO`2`rK3G-=HRb?nJhumFELvFn=rETsQjda6r`{+y@O|p*fj1*> zk}O)OVZ=&!ovMo(X|0(9`<;tzVKWZ$1Q%Wz0%KZnqR(J&3`WvajQc)UACQVJlr7|| z2{0C^KiT5i8^iv_GdOQ8WkNqzJnIy_qwWAlH^XL)`^skHiI{)4#cQlu*Xn9bueu2+ z-{f*KAZRFGJzasyVSD|`n2IyMfzawJaC+YbzABpf z*2TI(RVt6Lvvg^rlS~mQR72(M{&w=-m@d4j{qNwlU0{xefo@i5mbwt)oAO=n>G=Ce zUcZ>X@H3<1M#l7_vq|F|8nUyM>)W0LQxTsj6^jhh-eS?iCfr7O_D0^X!9{;X8%OpA zjSbPGZdu~MpMMyK&RX2fyjK4jf+x*sFbm)Xz1TN9Yv(6Yb7_SJNuTDSSV@SSMW9=| zf=+72qcwtyKqagj7^pm&r~6@7p{zCpjjR~{^6-{bP4gbM)pj>a4&KOh^D z57>Tc?97&6#+Fozda6a6(vKbeHMT(jY;!b8<_rvJpCoh3zi;IqXf^VkXgPbuz}%`@ z@#e5kuk}w$-LC-M+uqY2xrfF<`Y7@@WF_8HmN&H5$kdrPXq}q9Q!!e+&om~>UeBy3 zLPGS|OS)WebJEPLXzQDiBTGh`uvC?t!Urtbu!LAdGRWFpR~b>k1eW_QDgh>flWG%x zS)wFcPTY4{ujL=Y#n`;RPOpts5n%Wa*-d+U?`G%q;0=Zd+V1VGPpT=d&?`~BK~lUl zDnHMp^6-fcIF)PrW2Md~$8JgCz}uvK{nI2q--U4B&{4L83>2}muj|C-x5Zvun_S#t zx%wq#o!?t7wx^r|@!Z-57tLciKNhIjWHg7W57||klsED*)83owl3-iLqcEC8;nVXD zwAxui!ASDm4o>f(aSCn*<@MWz7v(z{DO~h1eg1HLx&G4Gr#=P#%+a)sNUSx^#1q7U ziR#SfnO&mc>hnCdJ3sT6G|;s70xC{(;|4jr8tjdS4kkE2b{x!8LuXPa%Bfg-qBJ1T#pNaQHZ(cU8 zj=kPkvoJgkmOksD-aqkUH02tIfBIVWLwJfdMvDed&5X8{OuPnmhTNXU;`PpJk14e% zo-|GhC6x@ahWS5re9>x(uX$|84n#t+Zed|u5qY8qr>|qBj5J?=6W?TNyf*|=M=fs# zJ@(L#v{O8T~Y)rj4}4uc5etXwU6+p)UTvYK%R#=uDLMxJy@=H-VPs%%}&xhc)& z16;FDc0lk-L)8>w#>~L9e;AtT=UO`&Wpx6N(pC%m7(>N-Tn>TwWSrPtTYzq2_T19S znHEB^oBDB!KToR0n`gJ#g(rcZ8)6ohQQO#Xku}rLYq$w$KTWN5(J=XhoJEt~R;1c+ zLvVMY*hVLTJKlTq`v5CqVNWL}t6KMW85sL>h_E-Af(`v!5;-#zPE$|IXofNrYZDHp zHqV!DzKP6&DVcF3<0reUiVc4>4&-Adklah6p?b1a`mVp>sXSc#!?RKX6_e+B1&hwi z*HU!Hj)7U$PNj9~S>_^Sp=u{w)D#Q4N(}nt(%UbBygWcr75a5GV%_hyXe9LEUk=@< zyf8iCA6=d7tGdAJJ=_ZL?+aeQj9%ncV-$QIN0(%LeAS2}VhHio@qo^htTSIt3vn0j z<$PI?5zEG`HUE6m22wa|82X74g@hTp3yhnflc}fACC5*S-N``ceD5xL<()QNu7Jamo3v&IRxy*LLd8k0@d8uh(ll6kz!jG zv47a!SRh_fo!2E<$uYcXkq%IXsvQP11ndoE&Re#7%_YJfiW>D9aI1d>lNDI(@iLdH z^r`Vz``6r0@1747mkZIiQWr+$P|HgMA4dLx23Gq3uGo3Fgd;*Z*~Y_?3)Pyoay{;& z{pod-4XKox=Ia*L-_^KU#lkwuijD027waIRF$2}S>@gZ#NyLb@qGp}R9R5M2CmEPw z)QeC3;uoeoJNIgeA#L+s8@9U{>N?Z}D&M_cX1RBDjbu3$Rn2UAzc4LHE>>WX-_<)v zl#KXuk}4QeeTdSHQx5fXO{30m!u@i`Q@Jq&<>3$wWU=n~-JeU)`L`Ob!^P17sm}lK zQ6bsVCzDAaIqI!-gsX;BO^R-{X6!dOCLS~eJueYdpE|zJ!eF}Bgo?p0QaqyJGT&;!q6TA2XA?5m(azusx5GpsSAIYd#yrm85-=c@GEdch z-|gMN#7@jHmO3Bqu5TVNcr^azIdPzvK&2K`?c&#}+$1+e@qT#A&CK;3)FHL@pvQIv z>`X!ue?%IyU+I2skZ2687wCn5q)Rq zLc7rf7zXPJhL*)HffF6{Gk{K(N%}4lrKisxs@AsH4X70};j$^$6i@P0J7v+d^ZZ-! z8Gqd{34eGEnWHJlZP#T48U9B+b~VSUy^DLu(uk}gy|_l+fDg{RiXHW?aUQ0<@psQ_ zkD+A9ri@5ry<=X*VdAa+w>fRVk|B>={bgM0P!&e)QL$)%xtIL#TjDgTawu;AHNnmp z|9P%%RiefT2dQT9W+xDQ`k6!9{}k7Zg&?zHTc1M$5q2KQnC3r6BeKp2_uT>`X@pUp zw{x8upyq#u3!t*v6@5ymWP-}qBGqMkYC z;V}fxODv%yvt9&xLt*y*}ts*6E9FF}0@Sc7m zi-Pl%7D^sULq@@pMu&G_u#zh9^jH-k0XkJ| zn~-XK1^?i#dzVP`o2_9f8km(eKdbF*sg>W8UPg<8DJ8 zJFt^HoSCf6rl7hcf!WZvwT4eAAMH)K=*$0>Wmt!XBa+|b8BBO-vvy)R`7fZRxiwvt z<@_Ep1ubE(Qey}<4^40g!YejZQ<0dx=zq*!!5wKaNUF%8@iPIK>rKdVa&E`kBToy| znV7wzW%9+eQ{PZ;3}FivSVkKc$MINk-S$8VFY(=~QmY(aYQ!F<>Ve{8kxo{0{pc;C zw9}xoK2tkD+L8@J>+74D=Qu84@srR~ehz0wuO_@!kKoqa{iFi>mn4*o2*_@p2vQL! z{(Fv@?Flfy>enFEz<+r$kW5-=134=BtgABF|FZonKpgY!F|u9#x1{R7lGYGeAc3~g z?x(l>uRr~_oHRs52_T-!lHP5R{(BnxBm&6KWpSdy!T-LUg&M$))1*REU;XP9LLYS2qn6b z(IAwr0U?V;nUs}L(p|4)L&@Sh_%Zko{K#K`*kn**kZdM#bu+jI<;Ugo47Z*^PfwSJ zp2d6moOAm0I_G@epK~w(K%W$jKCCa`3wRJs)2USIsTAy~K2WJtGMQ|@-+u(q?RIOm znqIFbNs^){u>=q;pU*cMjaZh|>2%_=#Ma<+It_-BoG+3a?^@px=B8cinCa=AnZS*_OBJDKA+f*|~UKS2-} zh6!8ddH!;_bUK~YYUTBM8HRbi57Oy0Lg;q8JWRAgNTU(P$Eh#J_$x-%tMw_%DE8nReV5=4z2Y00000NkvXXu0mjf_BjsT literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/b.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/b.png new file mode 100644 index 0000000000000000000000000000000000000000..cc75c7d20cc48c337e251efffd52093c306f721b GIT binary patch literal 617 zcmV-v0+#)WP)1${ibmA%lZI5fS*hIY+=9O7YYTF$wUyu?RG;55d?wbxG0Kx zz20WCktCVPWbAhP8v;BR!!YCV7{jpTayg&RDT*qW%ZtULR;wX|TCJAD;mBsQ@KOlg zNvqW=h9t?u;h^|RrP6M<0iakcmdj;z0HIKb=Xu4mEE|i({)Tv&hHn*&S$zP*Fcd{0goeXmDwR^92EkzPcswdzk|ZVXG)-G97G*yEzx^3l z6ve?{a5|l2Sssl>_xs&qvE*{Od_KQkuW6b#7z`MORjbv@M-XVelzgRnR&w)!%xZvKdcwvKLjX>@?pg=j7JUl5479u%H?t}7z6;C zrU4)tjdr_TP17*OsZ?q^Z7g;j{|_i;jr0k)9KVA03p=x z_a#YU80PnEwOTC{3Z+uXA|Rbk4+aB_aVQiz91fq>6pKXwumX@IDU-=yjAdD-DC)sJ zECO=5+;X|Z7>lA$U0qX95U<`1PG22;#{Azu&*zZq1mYsQrHbWI!MgxB()Oh%C#`A9g&?PbL!p z;5g0=$8oJzizG>}*SlCO?o~D#4TfPX zj_X7sQLEL?=d;V@G7RHGR@e1>K93N(Ua#LifvL@A1NLMftM#?e+0`0sei!J08-4 UmN$%iEdT%j07*qoM6N<$g6iS~BLDyZ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/d.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/d.png new file mode 100644 index 0000000000000000000000000000000000000000..66e23a897c4a97b2da18e9c2db42d91b51ec0ce3 GIT binary patch literal 525 zcmV+o0`mQdP)@5XNWMM6nYk z(MD{vMJ#*+o4km%58x{ZfmC(@A%(Hh&RRrR|5O$d<6IH(O;R-hh7q;O+$&W0bn!ZQB+_@d*ODX}Mgc(`ia+G#bt2a*`y4 z!(jj@6bjBRS(bafo@H71li-`!d_HeBo0oMrrKqY30E(heN(Y01cfe+|$!4>T=Q!>* zG?`3NsT3ksDiuXhJOUVFk|enT5V2OPjYcCxlx11dH2(p*uD4n(L_8c0p-{+w03u%V zw%cvPFkF-T>K@p(?U-t{s_VM{7cCNr?Du;BD3{BoY5EUHBoe37$?-hT`ww7@34#Cs zi^U?7$@mZ0ZnusxO*5a*KQSsEIYpLbiK6KEKp=20iT4hM!(qK%2LM%78;!G^ziJR#&Zq-h$@^MWA6VzJq577PZxbYK`pr_;F(yWR14j1P#sKVEOZ-v@jEvb#&?OK31t P00000NkvXXu0mjf6gAv^goX7~m$~GA8E(!Yh;t6Fln-94H{d@2;4gZXWtpb=ohh;`i=z0jg}(4Xxm+HP z$LsYv7K;gjaJgIz!_YL1F=m?PZnpyfMNvYbP#_SP&1R3M@MkI(izu91h>Nvf1qMcD6lWg>hZ0)q=s`4*>`v=lb`Vaj$y4-syBcOXcT)<#L%w zBmf{9jjmQJ_xyUj4h92NRc+gDG#c@E{Ey?hP$)RBj4{R-JGCf^82@HZNs<6yv)Mcx hg5Ez~Z@|9~_yzANC6IOHq{#pP002ovPDHLkV1k(^@6-SQ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/f.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/f.png new file mode 100644 index 0000000000000000000000000000000000000000..e0f76fc95c9bef8111333e5973497f492d23bdd6 GIT binary patch literal 500 zcmVTUHE_rI zs$pkm9=kJd1_JbFh{xl;?<0gl8)F;<0b{J) zZYzp%GYRJCV87q*cDrV?X&6SaSX?X?)9KVSO~%;qcwDVk{eC~6&sVF})9GXw#_cR{ z50ui$WC8%4PRF+GE3c}m>2zAtw6DVN*C3Hdc%B!2iy&Oz9}EV$T<-Jv3yNH+R6;{l zRmRvOMdo8Rn}tTB(crw`K?28dE_No9d5sPLK$0Yc(0o3x*Xyqr8X=_BYGI5OML8S} zu~_U`pz7A7xXxm<3yTidp?+3aXEa$UFE?VitPQ50*n+BbE;+Xv(Ec(d6MLV_T; qXf50@x~_|&_$Awkn3Bd>EFy~Y;k!pzm0000iV#5#X4EPTL!{P7`&t|hZm4H5>cDwEI zcq9@D04Nj+0FcRKu~=+89wUUbT5YXX`zZJC0GrK5k|aS8Hk)nlEEbDOr4j&mJRYCV zFPF;<0R%xjJUkQ%1+`jz7`?fZr_&{qNraG8D(!SSN7pzU4gg>R$mjEV zy&fSn7z{2iFHh6~0Hspt%K)?4T(8#=LXVG+fk5B{AQFkZzP^4Luy3&2+uKYggP7|0 zJ{XNgBuUaXMNtGneDg-@_xp4g0zjkDpnLy20bDM3KPOl$7Kg)O3^<;7adFXXHfdWb zl@102u~@v1S}c~yWP)MXVzHn-0)b$?Ui*ALm&^6pqk_ZX(1z3Le13lZH8dO!pPrs@ z9PjmdqtS?>C_bN`%jLG)?csB_dP;q0neF z;c!@^(Nrpx)oOM4ZI71xsh>ApS=Zn`F@b3fO0nhcC@66(+-v9sr07*qoM6N<$g6+pL9RL6T literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/h.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/h.png new file mode 100644 index 0000000000000000000000000000000000000000..0347c9327748445a525e29c28e8a6698f30bcee9 GIT binary patch literal 537 zcmV+!0_OdRP)!2>3|_zz@p@`~v{})RiP@xm+>~W7{?%grX>hVJyo^r_+r_ zV>ld6r&E??FPDq!x&VM+Flbp;G#c%8yZ61wGZ}`VD2gbGqtQsyw83BykH;5_g<%+k z5YseORn6scolZy7G+CCz;V{Nn*Y(F%&nFNBK@fyOp#UL72O&fIJ^ev1A$z_P4RC8yog`sfJysqzQ3LWKfpHFb71=B1M&ynA< zW1sg8#d=Fw7@RtSPOV$Xs*}(-pCRa!0tbVGrmLnY`T-|~Oaw%qNxi>KWC{Z?ZG&b`|?!`GHCF@#ls;M{25o PK4tK9^>bP0l+XkK+Y5f6 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/j.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/j.png new file mode 100644 index 0000000000000000000000000000000000000000..c9ad651dd102a424bfe686e6c5eeedde9b72d871 GIT binary patch literal 388 zcmV-~0ek+5P)Oa3@C=?Hcklp$t(BF6t%U&#D@80)*y!6Lutf?pOOP$rzj_Sw_y&IF ze~%y{Y$*yGYX|&2;7jmc*L9S>zGhh#RaFTgYn>>dvMf#0Je^JeVB0q5+%OCP;G9QM zwB9QO_>rP0&mstdIF3bHe&>O%>wVt?Kwa0Ws%~g9rBpBi_J6PgcECRXWLf6>ev%|F z=Y$Z^ZDAz{$8kI!k9nSJnpRa6B67~Vu0ur2vYy39Y1%Z6<2aYg#kTFXZ2@4KCP|X= zJfG)TFiqdg1J`x0*X#LwM#MBt4~Ih-hK#Xc7z9Vin~_-*#qD;x-|v)CS(ZJ|V~jl> i4{?*pzS-@7kM#`=1%9=aMn66P0000&sBOD~f+5hLof{YG#-LgSAqt8@P0l~i zRL-Q%eGA{_*$~E?Ab6eSxrgtEd(ZcrOJI!QE5iU^96x~n0Dv^J`}_O1x3@;4QBf3( zF+mVUqfwUS)z#JQ?QH;v#bT3_lih9?08Azm#@J%993LNRXko1o1mW`Xa&~q$o6TNd zU!Rb0Y}Cu;A|QjwH!Kp^#3e0U(pfRI61@DQ&K+M51@*6DPnrl!`{*I!>> zBaz6%!^4<+ep~?0^Mk>FWm$}IqtTe3pMQIM(-V+LBt%hMT3UK~dZH+*SS&6qEa(Yv zI-S$g)8%rRVHf}ihr=5i8_{S~XBUOT;mys>P$&cdTU%QIu(!9T^Biy-M^RKNl>&f# zK7Vv{R4SEpu<6K>U>L^l_s3$fR;y*TTAR(L$KxRg;&T95mPwKX0992H`m3^5tJ!R} zU@++Mc$&>7P1DcM&l3|9??ry??(V+NUR_;PDwTtS1BPMl@9#xXJUl$4C`ytfx7!T> zk|aGoKAxYS69gd$g4t|lS$27Od2ViQM2gUyms~Dauh$Vm{eJ(?O%dw%`-_W<@pv2n z+U@q~=_x{JFc=J91|ej(+gX+!3-I&l{{X%f;5T7vZ3}A2W32!H002ovPDHLkV1fy- BNO1rF literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/l.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/l.png new file mode 100644 index 0000000000000000000000000000000000000000..72015ab4143687e0e4434d81ba4ea3b25e7dcc94 GIT binary patch literal 376 zcmV-;0f+vHP)E4ynuHwF!c_Go}P?b3nKjh0000)P6y*=*M7 zbgfoPQ4~T*I-RCz`qRmhB>DY*06;{FqDDqWBuR?JVpCI7Zz6mjxm@nx-~a&D*Vk`u zZZ%r8t9(ZXfy!8VzD5iEXy=a_c8#0(b3UH zqk)JE3k$Vcty|Nx2BA(~*qDZOb#Wd+T<))taxau5ug~kH@vq?-p4Nhr>~=RuR!= zvwax)2agBduP7c zY#Iy(0ALvA@$s<_fh^1Mc--l9j*pK!9FD!cJxP+(AyE_oAe+r<;7-xb1KmgzO5RFFP-rjhge}8`m01U&5 z#UeovTS7LQeRy~fi^Tx2TCJQ;XDk-`rV!eLPNx$Nht+Czzu#{(8i_>W>gsBjFqupq zA0IC-F9D!jE>EY^Z|m$8KnQUh2LQ=ra&z^1y_rnr6Q@)vnM@{uB0>W5`5XX9lI-<* zJkKM92!a?6hr66&v1qYa1d8AXT^fx>7Z(>VFE0SVFpO5K-TdriT_lxC^ZC5dXv8o~ zrBbESX`jz`;x-M1LK=0mIp37P;ffrYbJEEEdGCqg6= zAxScoN&$e`Y^Eq`Hk-BE?Gt#gYev0ZM+mLgYaGXIHrr`D*n(jghr_X4E=3|ywOSR9 z#W4bMx%~eA-e52QfKI1dtyZTW*M7g>(G{QQ+BlgVnennWTwG6(0S ee-`*h1U>+}I&RA2*NI600000hSOo08lIz)y2VJKoCSA5U|;7FE1~f11uIxtyW_g z=KTEp_jN^4o}Zs7ijpMBWHPZVy9vPW_ut;$qMU0Q&d$z;!{K~BCkW!>kdNY7?7k|bBX;y8{Y5eNiEqmkaAy}rJBJRYP) zQMB9bYs0j=yE~ao^a9Lg^K!XVW2h&s7={@b6(mUtf`GKk<(f{XtC~MQKar3mNxkXy zfW5sv^+0!ab|gt!xjWO(_J@ZD^|9$1c8Nry)9C;Jj*pL7meuqKf^c+ng!J9r-O0&` zfnmpSoZIb&5I#LU1%p9NPrY6*6bcYRhGCE}HYzfi%=Ps(3Xv?!e;W=C4tSpDIL>Od zZaD0GK3_hcuU4zcWb%(o?RGm7iFCVN48ufG+NY z3dyppD9Yvl2;uwtd%0W=hr=khIF37=&dbY7p6B&^aIo!<*B0>a1AYK#xe|k7XKA@5XQgNl{CJ9 zA&LZIEL0Ft!P-VFQwhF;TG)w=U@v(Id%@B&m4$_kg4hHt1g!)MiH=1Mi#soR8jpj^ zS1t2re+#oS3?m}EQ$D;|9^fAUxP$L_Jnr}Vo33CmC1r_%|5 zBuT5)%6))kS$@ACfN7ecP{@6NVHl}Y3P8PHZ#J9m0DQiW`0aMPSS%z-DijK`ENhzf zOrw3hUDx&DaCkTz27>{BY&NUwdZ|=;vXejQd_I@U#@H*H$9=$LGD#+r07Ow-uh%~&I853~rDDejg1|YqyDSh0wA*cZSj=0zJiy-v ZTmWFeIro}|6xIL$002ovPDHLkV1h$w%b)-N literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/q.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/q.png new file mode 100644 index 0000000000000000000000000000000000000000..e47c32ea6b18aa30d7b9285a958a28dcb5bdb234 GIT binary patch literal 825 zcmV-91IGM`P)Z?MxHuUh<`gtFMT6B6BGu9mNMkfKG$>>t1a7&BMmQ)QS(M_X z1m%!k&uF{mrA9g(P%!Oe|dS) zXf#t(Q#PCJXLhi^zfaTj*x1lPm-2D8!EX#JgogfI0$0N(~H}$Bj=jUg=Uca)k zVzF3ucXvOgBuVP&={Y(&qG>vrOn$M*R{(>-5Q#)msg%iN`kdX{+gn{-l_ZHI$=lmo z)c~K*x4yoPh%T4w?Ch+mhoUG%OsCU4&#MNIB-sc$J3Ey;6B83RH#dlAx7(x9X!CWN z9!w|{@_N0En5Jo^^D~>xi9`YbHa0eb!Jvv;6bgl$PA337K0Xc(4k`fzLC9n>05CZ@ z84ib40E)$;R;vYoTrOuY7?c2geSJ?)PmP#mSrq_L6bA+d06>;yifXADtJSIsfFKC@ zd>#N8hN;)a?rs$Thr@AlasmJx$EDM0C4eZ3 zI-L#xE-o${4u`r?!7xlC=gGd$8lP%_Vo0$ zX%*4l)A9WLJe$pyN~NKpq4Du?qtU43B>vu}{~hoTaD5yG{k=yJ00000NkvXXu0mjf D!6SZ{ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/r.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/r.png new file mode 100644 index 0000000000000000000000000000000000000000..44ae3c0d6484ff0336f451432bd3a86bc819ed40 GIT binary patch literal 579 zcmV-J0=)f+P)~0005vNklq!bieKKc(4fugWK&E`^93x^ZaNuN~KbT zLgD@lU+jUd>)2?T=61WW4~0VYdVMyVsjBL5I2w({!%Jj}rs*4l)$jMqx7%UwbULk%>E&{{Ua#02hG9KmI-RD|X@pR_-Iit9f<2%p$}Fx{E1u`O-EOH= zk|gPLIz1m#6X0^W5{X16lc8xEA;hw5Hk<8qIzK%JCV*iW0PuRfgTVj*Se88=kMIpW z7SrW&DM=Cl42Q!=Bw{@P0BW_Gq9_26%jH_Fmh}Jt5Jhpb*__X3j^oVx!%Bdvs)0ZN z0LJ67-|x2uK$7J9dZkinHk$yTC`z$dd=hXt9DF_>_R(n6FpT$Ij^p|TH$>kVMCEDKP2 RG`Ii&002ovPDHLkV1iEf|4{${ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/s.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/s.png new file mode 100644 index 0000000000000000000000000000000000000000..93dd1c61d6ac04beca23465cf78704952acf934f GIT binary patch literal 665 zcmV;K0%rY*P)D=G%-1E8J@9+H1AwUShUkU+#tT*6401$sTuhZ#NtJT?TMx)WxYPHQ~BNB<-Zg;g> z84QM7Z^E0xaeTYo3WY)dfW=~|R4T<{QLonn0H{#bTAqWvkWt6d;qyB$G*})7fY=u2R$K6ae6MyKk>>$7B>mtyU|W&7RNaS1FN5 z6buIMyLX!}kw`Y1&EarB5M($UUS$V^K_ZcO>KA#v-cqTA<2Z(4d_Ldda9|h)f1^8q z#bQCBP)?^4j^hx*LZQInaFj}AwOV}*078hOD49%dx7+8cg%D0A6O+lr{_k%xd+K)^2-2ct=DUbL}Ihq&X3V( zG?hv{4v0h|D2jfK`~CiKIDD=Gl}h#aMx#(Dh=1^$H(LC8pm-Gi4+I~a=F}9YPZ|*cs!j>HyVu|Zx!))Je$o51Ol(u zdl?@NhX4R3lliSfzc4u#i_z(HkH@1>C;$LPqtR}+%jI$afZ1$buh)00j&S?pg<%+% z%RP^e$78S8LlA_)V2H)yA0CB-_s#ANcv}Aeod}3@%EiT=00000NkvXXu0mjf*;_Ht literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/t.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/t.png new file mode 100644 index 0000000000000000000000000000000000000000..c359ccd2717878d307dc9f28b9f42a92dd293680 GIT binary patch literal 448 zcmV;x0YCnUP)@+~05&#muxnw}@; z^zCUO=N$Y}2>e(AAOPR1Rkn~MiR-!uAz79I0E{t=@$>oQoJ*3F=Q+k0A(UkqW6ZKF z&-0p9a5|lCx0`92`~AM%ZciqY=I%f&E^(P%^n34&lgpKrI@(h_)y2qBuL z^?JSg{a!={gF%ucob%~)N(d=}o6Sa1l;Ln#mZw$GzVrE8@ka*u975Gs`lGxJdT1^!{b-!~c!08kXA*=)AkZ2+j% zYPzmpuh%5wI8LEZ006@<06^0;$?4ZKe?7=nVB(7v)Aj*W;5i&6&#O8%d!wL zilSDl#mvm-b7l|j;l5-HT^bhKiyr77I)RQWN9xSQN!lsU%6#XfzrQ zhm_KMKEGP6@CC?=2e0*dz1!`AATSK0)9Fx3U);weJK1G|kGTP^Z5U$P)5={^W4 zC9AyDIfH+IQc7X*7bwYqO<9yvW`p^ZOk`jZS!6OB)X6{@7#NPhBFXm|&YgO^-1p&j z4^R0_=Umry&ga+F?@a}OeiJqQGH=0K@N@oLhYp9sZnwJ#0H;>xo3-x@NoGy4~(Vp}_Mz?nCzykw~Q1>j4;zM$u^WW{tsMU>F8pa#t{) z&z(-^XVI-rE*1+S%IEV>3IMPyJDE%XB$LT@yM2)r1c8VoNqSz;?REo!002=Gyg3<;_xq2J4*)#R$K&x= z3No3DAP4|rvDjcRARf?D|~Ql!}+2!gnY zTBs-*MNeoOJgit6%L`_Xihlht+R9swav)N8gPKc1RC<1V~T&Jg} zS`>@LR9Bt7*Xy-ftzXsB7;J5A_4f7xSX)~Q1Oi&r*4AdRST;8|0d#eB?d|QUsI;_n zet!O22I}Y(Md5i~?M$UoM09a+;c~eEL?RK7$HP!EnIxju*VpeFba!{}?(PC`I2`Ba z=d9D`^Uci60N{B(l}c$-nwy)etE)>t*0jBmNTj{JouxD~GNKE8c6N4RVgkUxz(6=0 z24J__S>w9~0630gDKXvE)m5+8%h21~8{27;Bvn;aso(s}KpkCeZLK6pJkQ_W-m0{| zzCIR<0VpXc@%#PiV*J2Bk|c-20bqT7-Db17-EJ-2-rnx)>{Pe^&d$z{4FH%-rk9r& zmj2PvQKp@iB_9BW@$vCYH?5*5XJ=;>6%{KhE6dBvI{NVN@cjH7kH>kQ@95~rcwc8R ze|mZ{o6TcmV+#ulX)|;>ovp2{?AZTHMC=?C6%}Qo<>lpOvpKs0m;HY9cKiAHc{m*2*w{dM0y%?9rIN{HLPSv%RVoz#OeT}x1R&z>?rtKHK*WoS z3#ZeGvLzQFiXs3EheJfPSS*=L=9dA8SglqK1_L6F$72AHPGzBf@KoI0-8CAGR4T>u zydVfpr&HE6naj`Ra?+}mO6B{FlCx2=0QGtu0D8S1A*5I=TCLVkr?NbN5Yle90ia&5 zznfO8wOA}7;?>oaUawysKnUq}yEIKlqtTE4a5&^RPOA6z_F}Qvl7L>X$1u#+*4F*~ z{io>Y=;-9+M5&yh$(r_=fUev`>`czD=oG^D80=?H=_7!1{ZTrSUTMa}&$8jVKLXq4l)*Vk8yqSn^d^m_gN{yqRSn@vFwSe7M(h@wbQ r6adgPtZ88`{8NB8GDH4y)neSV00000NkvXXu0mjfv@=m- literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/y.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/bb/y.png new file mode 100644 index 0000000000000000000000000000000000000000..7b1ecf62a2ea93f55a5b60180258324b5b9e1b5f GIT binary patch literal 556 zcmV+{0@MA8P)9{|LgS9iNzp-}L8y_d@c0C=7!gb+g7?e@E; z)oM*969BMnTaqNd-><6bjV`=1ubYyyHylL5Cm0K1A)L| zvAEfD7l4ShTCG$nQ7uW*;c)oqNvG2QU|H6^l1BjAyWj5-aWEL9QmK!INF*{G4j(i; z0rdO*OeRBhI2@kMX4j{q(I}ZrK5lpdKtx%V=kvMix`tr{gTd<~kH=%0=63;xVaT#f zbvB#r^?Fnni^WEx@ihJ%KzlV!LqyXw1wlZ>&1U2C`B<_{0Mj%jNus)3E;pM^S(cZ} z<&Obquc9ba6GHO&JY$d*KwqhC+lW}HRJz?RW9k#%qEIMwI-LN35W>C(KLPmKa{X8P zz;#{Mb*W%~Tq27})3oF9xLU1rT|b}CmSxrJbpVJ)qw#qBah7Abmuj`j^E}6Kj^l6~ u2LPfdI*yY_Byzdj4**_&6)(Ww0^R`8)1&asQC+_P0000XafZY zaS*J7)=6;E#YG*(!NJKz5&RQ6xJq|X7Z(xdE)E3|M-g3|q#X)w9TZ%vbjrCy-jhpx z*4}b2Ja~T7$vI#8qah~=1_1Pv`h|X2Z@_;52)NX2+rD0}?(-?7(P-4gfL;0kV_YZ{ zw%aWmilWGI975=LJch$z_FYZWZnqmDF8MsNe59^2K6NRaF2uolZQ@!z(=ntX8W`CgVshm&;r($Kq@@yI!v;rTzhm zqBxSFQ0Q{G0Kj}cuT(1FK?pock|bG{S&T8ZEbBV~=kxi#;+;-sI2?MM=oKJ};%>L2 zlp2N+iA22rwzg#z_Khth@+~isvromEDr{Q>2&&K zfN7ctAwozX@cTvz{1L|Ze$=yTz`ZT-`{DHl{QH0pob+c7bM=cO00000NkvXXu0mjf Dz_0ww literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/a.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/a.png new file mode 100644 index 0000000000000000000000000000000000000000..bbbc10267ecf51ec4f06128c516b65cd9d887fe5 GIT binary patch literal 499 zcmV7?s=qtReBrnOp)5OUjEmK7vmu~d0%_f+ed^j8c*tUH;8IQ*RqS0tDH#wir4+aC8 zHB~a11VF)`R?zG900@F`=jAw#GCaJT??2hHEI|GTT~ z++`Gx#|a@1v*URlK)2iVsNewrz<$4{>r5u2D9T^vY&Hv^TrR%=n9t{Q1gq7mBuSzu zdYGHdCJkP#R;^a+DS&O;;c%FCFBXgKb~_J%X__=Lkx0yDvu9hhUaxbxT%}SupU;lt pcn{ciyIn4qA5GEs+42SW=?X6_)14Nr{Mi5i002ovPDHLkV1i@^(arz> literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/b.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/b.png new file mode 100644 index 0000000000000000000000000000000000000000..1f2d08ac31c91b8c8f480920fd8fe6eb1c54e709 GIT binary patch literal 599 zcmV-d0;v6oP)mrNEZB9e$0?!LpPF6qmCfA{UX zc~AHGJfG)z^*o>Fo;!o0DELeL!yoGd_y8VtKA)d<4u`|xaL{m5exPQvX|Y&}#Ufd* zR;zS6twu1L&6COGm9GY1xm-G(PP^R>pwsCnijvFa+-`Tf-5!lbf*_boCIA#g=>**G zcSTWrJ|BSDY{oE5Hk*AsFdmOd9>?QR4}gfKX#gzCG7R%g2*7MM>&$>8p_Y5M+dZ0O zSso6D0Q&vDe!yTbAkp*r{F7<1SWpxtisBo0Z9uJ7BY@NCq;5)*#BrS0>s_zc@7=Wl z$z&1$$8ls?DwV8OD*(UWKcCMv-L(O3w;KSdLm&`f7{=rAsJ9Xdg?=O z7K_D*DU-?Q2ap?9>+_^|JgzwoG-gq+*8>m^hrhMf>vi(5*=%&qqF^uxV87pM7Eou2 z0JvPPSJunr0)Xdvod8i30aUBiR|f<^FdB_-^3wpYEDNAgsn~2bNs^wd-ENnr>FIQ; zvrWmprBW#X27>`WB9Uk`8m(5VTrN8tj%YM`yh48(v0n6nQz<4}<@D0NtgzWcwUO+aRRTSmfw{4p-Mk(b2tX3-kjYflg zs~3Pur2=3!n|%!s!ry~LBH?)+&zlhjxLhu>EC;<3%Pg{O8$dFdjBD5(k4FHm>&690 zrBcCSx7+<0u-$Ik?Kamm4Pu_llv280uK~>GbFMPgbv2#7L zNe~18rBZ1!nV6>8YPHhoboh*W7eFaJ91g`|@ph%EstyK&$QtdTs0blZHrnso@&ml5 YD|ai| zQcMP2qC{QlN)#DPvND~)Xkk!BbvC6Wg)%UkZZPO(G9kOcl@hL#`wgC?$KO-Gdg}4s z?)!Ot?)9y^&$llj%QAj5D*ST3g8x9ERzz>NTTv8MDwWY_e78q_m0qtGi9~cd-EFVU zW=p5jlgZ>s`!fN@ab~kQl}gp?^-LxMAQTF59M^8Qi^U>M(-#v(QIaGn6I3b{yTWd}jnXvz z;aT*D0Nif(?Ybz6E|-g8m>2EO%dJ)mK&#cdUOXHQg+jq(GVwhBdP1N7pyhHI06`F) zPDc=g#bPlS3@Gn9 T+4U}w00000NkvXXu0mjf3BBZ@1g)_4;@` z?)Q6)amcW3y8wVBNz>`{vmc;Ztrp;5Hk{F(+wB$t6h-;i(sf-F#pm;xcSIOt%d!BV z)9EORA_#)-`>WLoV{DpcF)>{(mpsph#f?ToRaM7vii~Obt0)0+`UNv5G5>$Ul!*WU N002ovPDHLkV1f?U%`*T1 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/f.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/f.png new file mode 100644 index 0000000000000000000000000000000000000000..28a6cffc0febaf5fd4e7a82b7abb382242902dca GIT binary patch literal 483 zcmV<90UZ8`P)_Y{!VbNd^|Au8jv>OG3&L9T=2cxhgcCA(sG#C__O%?`nLBXQz3p3C=#B&jB#7FGAx0jD7jpYzr_QA<2Z#vp`^m;uWfTw5CVzD5EWV6|TpG@-ov-=7H Za|LDowplw^g>V1>002ovPDHLkV1kQ))lC2Z literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/g.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/g.png new file mode 100644 index 0000000000000000000000000000000000000000..a8f1999bdd520beec47c4aa1e5d9b06e4641ad8a GIT binary patch literal 579 zcmV-J0=)f+P)@jQ{Orqij*<%&k5)oN8ylwPlw&1Pwu1`vzI^a3iC3d1n-`TU=FE|&vPEEaVE%H=YE z!{Kn95(I%|**j~=fbn6_3Z4%jNy$1b{5d0P^|# z`B@PFKA(@+1YH24SL*e8DwVoZaL>t;$piq)vbPG_?Y1b2Mx*gbC-?h(02D>tDhLLH z02D=evPFZz;PMii&E`6L*&lJ(JoF9H>GXBV?REq3`~A8Akx1mikY)KJxZCYK9*@J} z08lEGbOE;8t-hUa;jrYVY&Bx$i& z*ladMQ6xzspBvBFCz(tF*zfmxjrOHhs}+D+t@Z;>et&;Ao6X^HSXI@JAjffqLg8md zMJN>d+)u03YOz>4ozCOieIwrNj>luG)f$aPCX~!Y}EM%C4J`y@B4o5@RfTz z&vo7R^>p3mzIzBk5b&F!!Y{{1;QtZ0-ERM0V7J>9i$$8I34+jQG?hw4jv0@~1A%}v zCdfoSpZ9n?^?H3c9EQVT00x6Wl3AH5!f2C*5urKsucklX;#8kjZ4^1pe;9;c(DuwcG9X`Ea#b0r2^JVu!2MDu7%r zC)-Kkjfll!049@(7_wTe%0=E1uvjdTRXC0VkW3~Oa$nEE^?Kzv&gF86p?13sAeBlf zq?5|kN2AenIt5^}**cxh^KK_eve|3`xEuJL9_aP@JBJ_$aUw-g02qc*wpYob%jF^n zg4t|VtJUJn@pud%5{dk17i~5hp63&Zgc$1g`v5|r(2oRqy&iyUHY)uUTX=nMjh9 zgj%f@0Gg)P>-A!>(CKvLa`|f(u`Ekb6w9)b=xjE7T+wc~4+aCdI>fghUgz`qcsx3t lPL)c@XX5j+`w09v{s53-g&g?I_Mrd(002ovPDHLkV1kf_4X^+J literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/i.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/i.png new file mode 100644 index 0000000000000000000000000000000000000000..a149116cbd55f5ad964efc2d6aab15facc6967ba GIT binary patch literal 467 zcmV;^0WAKBP)VHNNj>{3}M*rc$tuu%{{z)mE6ibO5a3fU_JkzjI(XSm{= za@g5f-g~pV#27=7_(H+>82kf+(hHi?=|n`2OcX`+dj0uomI0H=q}%OQDwQNlj^n~G ze5$4NpzU_Me!p*;rX)!m$2FVHa=Cmw9tVSgZQHUeGscLh-EJptk#g|ub_-y=UdQ-q zwW_Kr%Z4-qK@dixQH&gq#{ibgwY>$;xj8HQ0*4jjh; zpzC@L4a);XQEoZNE}>lS0TJ;$e?FfJDbZ%L0ibDGQFqa5wF1!V_3~XT*{dmvV&0zp z5VS{JE*Ai%X%=N*Sr!1#^J4traCnaafZ=c$BRidrD2nOAQc`1x$Z?$O^-4t3>9kg> zsj51k&+qfPSS*4d*zfnRG}-t4bXBX>n$2eK58CHf@iF)lgKwE2iC9>2d~pB(002ov JPDHLkV1j&L$`=3t literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/j.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/j.png new file mode 100644 index 0000000000000000000000000000000000000000..cf94ff276a68cbaedf599779e91267d3e4780547 GIT binary patch literal 531 zcmV+u0_^>XP)A|? z;R9G;HCD=25sAGuN?FWCiq9dX*l6Md$Og$5u#<(Al@ya2v9fY4yv4jR!<~8bdgUzt z_x$_ad+s@RhEPiJ&T!z(@d5lj;Om$E{eJIoeD9J{>hX9uj{A{8t;cXU%w#f#yuo0g zOD2})V7Xi-5{Y;`o=hfvKA#{6JkQtb_33mf%W^Ch({JC>3EJ(p+wDG|&swq9>j5|( zk7h1bK)2fka5|l|;&!_Q&}cLs7?}Wyq5vosi#k0TjS7PB*vkYc6bgR7|8O{H#noyB zpjNBB0AN_+d_E6AQIr<|jGaI*7<`&$bCM^M34m-i`#ja&_H(%$fcbp>G?Uo-;CQ`W zRaIHMc1pC_Y*bY>do5l77>~yQQmGVEwv7u&r_%s-yB$-r8LFjH=>Z#nD2lAzd@n5) z3ji*c%g`XpGGqUk0%o(>t$OSA`hJz?`D(RlVIIwj03Z|!T`m``9tZ@=<+8PbH&k1# z){Vh&oFqw|PN!0-IGxUZzi;_PFP5}V1t#Ue5&i_XMgpi|1Aq)>_s>iZ3+PB+}^ zp5M>iJlpp^?|Yu_d%pKQ=e!X@@SFI9U&c$|B_N?ztF>CKyVPp6%4V~%SZuLa+@Z-M zwA*d1Rtq4VPG3>u@z~*Tc)ebZ;{Z4uj@$D0?>9c1%|@dU%d(9|!)P>0@#FCr3WXF3 zMZe!S7z_Zq-7Zbj|8fFCh|A>y(ChWYWu;Ql>2#CHuh#$=h5^8` ztl4bdZnsxCYPI@)@lQ@5Wl|K?Y&MA;JQkSG=KunMfYoZPR;xrN9t)JqWdPy@68U&M z2gBhIfY<8#x2@&w#&H-O9K@;R7Fr2yn|xvOM~qCP%8WC&a?7XW_0|CTbDOaMBajuhcI&Sta8 zv#3}s0^oW6mfG+4;uj(u4#(qhtyY^%Cck>lmv2+0QYi?6#bUXoG#brzyUpkGr_+gH mm{O_qO_#pC{_I`?|Bb&3aC|#3A7Tgq0000E-{0004uNkl@5XQef{FBZE z6-{TMSPCHzp|P=vMH)e|RvYas#0L<3fuLZUfDd3{VPWkH*og>2VhRh_A|S`X#bhxY z2l=`kX86qvGs6-}DZ`q0B{_~eX6Pofa5rikN^O~FaYSf{<2Ia6So47DB}NAB$LT_JZ{_e z%d%Rnc%D}jfv+0 z-xG-hO9k`!+}+sU9BkXJR;#isGfol5aR5Y7OsCV5Bn^kd?RNX!q0wjnI3ABIi>4@w zD2l48mdoWIY00wO>-9#XQ7jfa91bj--0%16_4@60ds$4=>~_0_LcwJSf-oMBDW#9c j<1^PZ`c*`LzXCh~Wd|aycr%7@00000NkvXXu0mjfK@`uf literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/m.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/m.png new file mode 100644 index 0000000000000000000000000000000000000000..08eccac594fe14fe65d7acb9fe63d5d9768ad626 GIT binary patch literal 722 zcmV;@0xkWCP)i6#qQofrSpi z6LJt56htBfi>7oDF+pd zsrbIbjrTQwJ%ew{7eCWI=bn2$+|N1Zaw$oY@S9NKm$4z(5Qw74aolh?{87?}hljt0 zv=Vl^9l+Dmle9K2FE9OmzicWH&@>I;=H_P2?AdGwOS;; zR4T1SP$(3vRx5zr-CacjQ501w6-7}1CXE_Zcx1%T&y#lo7+=0G4INz&HV z7NJotvdv}_1mWP|0KoI}^NL8P(|LG!*l08WoSd9YZ>_pPr_-9Q-R4OGqO(qk7TCJu` zkk98ij+4z;ECwJFiOAV`o~I}(9*=*kr%DB&-|s6Ecs!m~t0kN7@9zM#TCF^QG)+gN z(V0^Vm0UnD8jXxbG=5A zU@#mV9nGIAm&*VchEXP-C5N`}_L~RV6a&bh;V;*BrQ9uKWA@@pv2#hc7NJ z=KFnTXNP53i^W2keIBF+L@3$(T9FYam={sTcsyS5TD043lEG%Pxm>Pq5`BJtG7Lku zYqi?+TlgceEPHl#mP{rW*Pv3Vh@vR{Yfzi7f!H-zw3uBm7!0#43M&?iN$_8AhyyWL6bu>^Oe?~M?cT7Ly)XW` zsXPx)c`ohuz3=@#_dD)(XF~|VcQ!kGbNdDSJb?JxbgHT+ilKA(R&9zT6e)578Ka=8Qm zkH_=SQ!bY=#aRG`!(pjZLI@EA0RXGj>fRFw1TYyamS{X4r&1{ZC=?1do2}h$-xw~J z3r*9w6!;3F(WtKL2q8sL9_}Scl3J}6CW8gQ=kuB0Znql%`u+a@hFmVU-|s&JOeT|Z zxon2DS`7fw>GX>m)EZDKm1eV<8Jsy&eEKolYanX0ylR@k2ndSd?Y?UUxVg03ZkgLg?AidkNt6dLQb7 zAOL{NHV{Bu&$*)hf^P7&ZXVG~H-4-T)j9hkrM<-HsVE7z_;CZnt{_ zplMn#7_|H|n`dG)8ohEG+HRhX+wGR3D3T<<>KS1BeVhI`;17@>|B2ZQUK0QS002ov JPDHLkV1i431<3#a literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/o.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/o.png new file mode 100644 index 0000000000000000000000000000000000000000..a6568588bc3bbbc1fce0a8fb0be937f6745ca252 GIT binary patch literal 597 zcmV-b0;>IqP)NklL7K<#)&So=eTdmestJQ9|)9Ew-LI{BAbb2@UH9!yqhr>bbR4QdK z7;aBxS*8G=&-W*QXf$fG*{I!YHUZFk+)5P1C(U>Us8lKdR;!h&s+Y?JKqwUY9=6$R zC}1!cyaAvuB#}r^Hy)1zSg+T2gLOI`fL^cn1|S#=0yrEF)Xn8`+wJyIu-R+|FdmP! z0?y|%0FTF`YLi~C2XMV!?_BQg+if%&0Q`Qx#wj_SP8`S4Mrj(fPNxHa=XovFX)tZ6 zR={L30l+Yf7C^mT2SA5TD`3Ch16VGXFRLqx^7Zv42!hdQd;?&ySO9dp-Isu9G|Dhc zwOV~|7iF_qEt{&}?*ot|Nl}zXG51R>77Gf9#bS>#hr{8c>D4r7fk1#VL{a>HS|}7) zmZe+dxyX}mi`(rUjYa@Cj*CPhcDtPr((m_cwOTTn%w#f}X5=|PpU*p;&fmdaueV$- jtM7<>K3*TdzYq8YE;zyD3(J&500000NkvXXu0mjf)BpVD literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/p.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/p.png new file mode 100644 index 0000000000000000000000000000000000000000..fc24a272aa555adf2dcf027c43951fa314447876 GIT binary patch literal 581 zcmV-L0=oT)P)M*DwW%(BuM~dS-zv0rWp(d0Wb{nhCsPo z<~UB*^_wM=$p9FQMvvs#Y-UsK=hoF~buHA*5)Ov}oX_V+@_xSu@b&feUWx8`08P_R zU5mv6K&@7DFR)xL0c5k;r`}Sj4*ITdGgpg}Hy>||- z$mjFdSaf6OBd-g~DAgxDilQ6+kYRn@lDikLS8? zNs@NEos;BV{{ux)02GTwUDp*wiO1uDAiQzgy-XpQOad@XleoeQf#dNAAe~MVw|FrR zWLXAKtybL+1bh8RB;v4@-IQpv+1T6x4nf&GykuE645QI#{A6TOpO@W7;K%q2y?nP| TviJ<)00000NkvXXu0mjfH#Pmk literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/q.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/q.png new file mode 100644 index 0000000000000000000000000000000000000000..44ebb8de0dd2921149e440d6ab387fbc5b272093 GIT binary patch literal 663 zcmV;I0%-k-P){oqBb`pO1T2?J z04Nj+&jK_W4FCv*LY4p&MSVWsivS$Q=_F>e+1miC)ym~^8QVhxn$6}z@6#zF2%=mr zM$GcoEYygA7;MPEg!;wm*!r?H6VRpNnBuR>*8jS`3OePchmW`5U zvzg6ilSm|dK3}C$g+iglVnMqql?sQ$nNFw7GNj(L>-FmKc=USx>2!Mi?hHDht<&j{ zBuOi7JRX-yrCzU>%jLelzV1Ikk0t$#Tr3vvgNu z%49N5r<23s+%N`%A)C$acDq}oPNy>(jsMz%dcE#)xxSMG0)bwy7mLMSua|uf?ycMH x)@rrYYPH|*wOXy)?dJ3OuTH9;U&sF+@Edn{t^vvb+W`Oo002ovPDHLkV1kx}D-Zwx literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/r.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/r.png new file mode 100644 index 0000000000000000000000000000000000000000..be3017a4a29fdcc6487596b1e22941f08da6e039 GIT binary patch literal 641 zcmV-{0)G98P)=t>#h|2=!C+CcGnyz?Bdbu?;7{R}+{++EO+*Wq@%1ptboM1y@k9{}WX zIZ?03DH@GNcDtQr+3Ui`<1qlZTrSa_RH;+|;PraH^OCVjr4j%n5(!bSMx(LWY|nBf z9n;}(2mo%k`_WacRs}&A3oMbSIQ$F%_lfIpu~=Y0JRbi6fFK9}5C{Zrjgd%1`T_YOs8A>XK&@80HF6w>0r`CX zE`Bh zu~-ZM7K??bm!|2zA4P&7Nivhkyxl4c2E%5v!M*HJl}g3q@k}NYhr7{{M8g)x!W zuV802Woe^WPMQUog^jRLlD&^$MM~L`m9mo(cCxi)DJ8KQ3yYcOE>7uohq?1Y-CO?4 z^E}V_opb)@jUXbtQw+RWAHaVGoK7c0d1yw*s3 zx7X|SWHPDO>m0`sLI7aD-`fQUf)I^He>AG9O6M^g4s8Kitrh@Gr&Dc+=Xr)~uP> z2Owg<-w%hw6ytKa27|$i0e1|w1OO_Pid}%BD7V{9+n!7&DPumLTL%;hg+L&1KA#^( zgTWvGlu9Liz|(V(PN#dl-sN(k9ch)%=K&xT3R$`AuGcF7c)eboq19?N0N8G~R+ebB zT2cIFvr$#`VUEM$_;r2sJfHxUWp}%sHX4t|GntH$T}PgMTNaB&B9S13AYv+&5=GJD z@hFP2TrNkWQMcR8X0vu5oWtRe%jMi|H_i05a8Mb-k=Q?1VJ!_x;=5`j%&#-Ejhz4XLt6S zo!QAOM+m`^`oO|k0V{x2!!U$l_|x)9INZ9xT3}UfJkTO~&Vqi5G*jcQ84h9lwA_l35&0-Lu!qTCkcW5Fv=k)El zwGEwVH|`lWVuz zc|0Dg)v7ovl?utZ-|qn=5{b`}79g9=3W6ZZax$3&(CKtY&SJ3$U_PJ!AK+DfzaM}o ziX?;CY&Mxps?yg0Ns<6WA`y~dFc<(R6bd>4&1Mt8U@#yV7={6`TrPD2XqvWIEUMD; z`5cW#04RzgJ^lrN<2V3~MuTLq*=zvP>9kHjJRaAGaX#@D1bm9pc6n*l-+Jul~|T_I2_$>7eKjO)&rQ$W&rZ}{Aa1x z>j5~Q=j0LO8904&P_Xt&!R`aI7ASg+Tw2x-UUH)%R53yGrmcXPAZc)ebp=NX2P zBGb)0>I;$n-Q)34-V{JA7UOyTgF%T9fMT(zu?L3l pT)Ym4gUjX8_88tbyEow5^#=$0z&)9g@U#E`002ovPDHLkV1kL#2^jzY literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/v.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/v.png new file mode 100644 index 0000000000000000000000000000000000000000..2c51c10dfa13fca1efc357fb580242dcd2710820 GIT binary patch literal 518 zcmV+h0{Q)kP)8mEbN7VPayaLwib#)N{OO{Bw%BcYY|vvP2x3} zX7O~HIWr$~ZzhBxguqGtz+rs>Ux0&v+wIovb~~NUcDuExZ@1fv#lng}Ow{Z3LZOiE z8IQ+?p2=jQ8>Z8#Sszn?uEAiSx7h7=&)I&z@AvxwB$G*-076K$S_M$4RLl&8LV;yj z`v6&%tq*g#T;}t6v+V1)h~v0eECyh+*%%s*$788fdi#2&&Xx!9io zKqiv`a5x;EQ=%xQQYn^Y&1zjVfJ7nz;Cj9OiL0vGXf&SVZ*Q`uX@>D^Hai>+eLkNf zpNew19F0a>t(LXTMc?spj(WYmTCL9K^UEqK0K+f<;_2%UGjZlkf z0!fkpcsw3OQM_KSekGrr06?)=B(_8a7>!26u9)wyvk zk`#v&2U~&$MTbC=1{Xzw5JAYn#Yt#rwIFb4YX}6F3nEQANYJ9V1&R(LC>0?@i=&EM z#q);q-hFmGUEhP(^6;DP{m=iO@BHWg&VLS}l;S&~!8c<`uq61G1f$W&XfzT+1VJd3 zN?!#?l4P}7T`m`Q)aUaNLY|+Wf1BtpNRm{m)xzO0vp1Vf%0s`!b zL^fi6icly7!0mQ(3A|qK=H@1VTrM|1`tb0uv$NxLI@JjJ{k|f(+2z~q_Eahb;PmvA zyMjz6jCn+-svQc>8=W^=pUZZsMIR##WKvG@1)=jZ1O2x74q08tbbk%2(q zXBYsW*Xzy427|#)r?Y_I>go!><>lq9QKQlH`+fH9@pu3f3I#+5Sl5ZJHV?FLXTmlc7DMB?V==97t=fhdXq(&;p%bUK|@tJU@O^;w5vu?S$c zn3U3wkB^Ow4aHPi{_)dj0IaO6FkQP`E>>6>4u=E4)6>(e@#yF%pU?kMt9W^NkqM&F zXgnU@+uNIU*xK3xFdPnL%iZ0b!C*K%JXFrb-J*+&3jmEqIL+uK`q=;mQG z8re~ZL?Zk9`>ermz)fGL)2Xy0hGa6ygd_-piW^5o+9cLIP5ZLwOUN9UxC#ipU>~^?y9(PGANhJ#bVK9GO1rxgTWw~O#1zPbvH8qvZIu; p^wlw$Otf0}?A95h*$Z?_u&Q55s}yvHd|5}i(`N~OZG zY^hXQE|;37QP0$y67_n$a5(I0Qm@wml*?uBsy>s*FpP9MZQHhGS%M${NG6j2G)?pO zhoWLKnZ)Dq!{P8VIh{@cM59q3&ZcHXQOsmAk9k>^{d$km+U<4$%x1I4lCJA6fubn) z``xmvcDwDHpin3P5ClQjb;{BL0RX8~N|Gc1qtVDW!C)`|P^;Ch*Xv_dk|dX-SS)Tf ko0k%i&&BIQ@c#+E0CWR_T2(BDHUIzs07*qoM6N<$f?PlB)&Kwi literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/y.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/y.png new file mode 100644 index 0000000000000000000000000000000000000000..6670417a7b73caadb525e084ca2ae229364529fb GIT binary patch literal 559 zcmV+~0?_@5P)nq)q5ebn2V zXEk%qea>^wJ?Gpms;UZ~#1DKJUxB|ZuwJj@@i-zPVltVOB+1xv+wB$+!{PAxd^V4w zT41?cy4`M36#M;tFc<^?ilR=Z)7`ScV4%e*6bhzsECnG60pdN-R5!!V}AM~h6;bS{?zfOflW^j}|fg+ifT zug9|N`vn{h2gh;6Vo{rn_X}jRS)b2mI?}HSXcNFN%yc?^lw(!>L?Ur#+3j{Nmy73l zqQ)~9n9XJYFdPnbORLoafP6l$62dYAEx%MMRjbwfem?*-8V!{kmI9;ENI%9%B(hj6 x)Te+pFFRS5$K!D{8s&NZ>2bmD)A9cc`~tKKlO1JOmjnO+002ovPDHLkV1lPt?~woi literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/z.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/cal/z.png new file mode 100644 index 0000000000000000000000000000000000000000..2489eda0e59883c60371ad2540319227c3d509e9 GIT binary patch literal 559 zcmV+~0?_@5P)1MFbTr^1Jv#xAO?#Ti?C$TXtK!4tO`DUAczimtU4Fm35Np* z{Fsi{_Y|+V`?{}RxOZ(9UDv@o^$WaNAHWCjbAZKSk;~;EgqFWz7)B6;dc7`+qQ~PI zjYc;YEzcA!l}ag!l1`^}T}KFw$K&aA`mdqgZs+s)+spbxX_`jUbR-hF9vu#c?RE`-n|jSFdWC}MzWau*zr8S-|uBvHgtZO zNKYn{7~^NsjgS0Co6Ux0SqP!i=_E-K0O0j{IgUFXkA}NX^#DRxtJNe)a=BdbcwClc zK@b#0v0AN$yD!`zkx0-qEsEk>nj8v+!r}0%=}+B2RaJ_j8jZ$11IE~74=$I>Zntwd z9Q}U(o`>goilR&cCX)$45X0f{o}pAK0RTFkjv2sUFaQ8Fn@vfQR;!h&s@EQy%@&PD z%`~~yY88vc>*qe7FAxX>gF%ucWm)$7{oQW&<=3=QsUU<3g~I7{(ll+kT&~ya`FxHL x!Wf^=XM!MDmaSH+u~_Uod+_-ue*pgr@Eb7WB@o=qWm*6L002ovPDHLkV1iP;_7VU9 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/a.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/a.png new file mode 100644 index 0000000000000000000000000000000000000000..e8a6950a011de8bed9b29907242982b6529a26bd GIT binary patch literal 393 zcmV;40e1e0P)w+cp3sNx}vo2*R(+B!mFK?RML(-GAg|S*B?+3}c%TMUlZ2 zQAz-w?lHEi3K0buQ&Qo6dVC<@E6 zPNx$91VIqTaaorCb+YTaKj(elN5n7;*D%X6HcmE8ljr%>YpWzls;X+Ykb82g==&ZK nRaJfUbL5V-_o1e%nFhSdUEfYfTWl9MQk7K=swfcyP^yWJeexm+$$6jcIzsTg&;-G09h z;B-1QScA!A(o_vPoeqG(V9*qx*XseGl*;A#e4fwed7jq>kPT6e%jME>oH&jR!w7<) zv{zQB!Q=55kH?f!&+`BfLe}ebmSyG9m1?)!0T>R4oO8MJd_Hwu2aqJm-@X-2Fr7{b zA#$$kx@B24U(;XH{i^&&08M*q#yPJ6aJ^pNQEl6<0ZEUn)!%$Qd gX+K^q;Qs@@0jA*b;6S1&FaQ7m07*qoM6N<$g62QKQUCw| literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/c.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/c.png new file mode 100644 index 0000000000000000000000000000000000000000..e0417c53e7b25ceec69b85978b9d0101db7e512a GIT binary patch literal 330 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysr8HGK}D*$aU}FFjoxLp+YZouj*#k03$%}PS|&rYk0yY%z&6#*xQr9K+d*fJW}{;+9uEz&vt zdY8xDM}5EcmCHPTJoov})va7NzT0|EQsA(79yyJ%v*NQQ{}+i0HWVT@<9+4Xwe z@Ap+z0l;RnIh{^C&$GEfTdwQUE0g9ps!|-*u-Ov06328?EUVnXqsj^on~3K+wERSMNydfAkXtG%jWZW zJ1NUDGr;|R2LMqN-)4^)pe)PZ$>;M40F%jt*{aC%yd7eU0YKMvW`Nu6)()d60)W+O z#lXpz%Y|0zx?a~cA%rdr%d(g`*)&bc;CcRVI9QhD`+iS*_I2`hyQK_Cl9D9p@Baa- nA_#)@dQAq38~;TkUtI^peTwb0RT+XB%*EGT-OB< zhT&s?<2V3#o_CGYG(}M)d6^=U)4uOlS^(O%ou;WQOUaC-0L!ufP*pY0bHgyQEPMDB z^?eUOQ54QO-IP=hgb)C9UH5(em7-ae1z=rQ$8pZ{yp~l}Jz2CkjsY;n7-LD2*tR{- z^OHRwq9}^4n8$d*9nvUam%fh~I%Ln)X?*o3+4c7b(_D-Du0000Keq%6qAL7H$b5fdx7yhXdYpTWSO2`vIU7GLA6)}s#jcb-M#Gsx#I5Vo_sz1`~NM` zT4POpU}e1l%LC##CWHtf9*@WJ03k#ehK}Rh@Asx@j6B*{bzNUB7p=9F5`dJ_#AT7- zd_E7u0Dv*p_dR25;RHodFvhf{EE1$?s+6j#%I;Q}@1^TH0F+Xz1RKMB$*`C0k~eTzVCC+Ip@m&zE=|hKq(aj!Fv|{pzU^R zajGxWz{>IuYd|So7huv{F9MWO0J1Dw3owo&faCGF7T|Wf9S(;iN!A+I`~Cj;eA+%Z mrj4ex{^~MYk@w&9&jFw58Ml0;XbR#000006ot=(6voa{ zun?@Qv`S+kVq>k4O7a4}fTj2lHbE?W2f<1#1eJh@wO|NnkTkIh26HU};_AW#b^=@E zbaR=*H}_|TVMK%^B_Uy@fE4g8&-0Q3tk>&&KA+3wdcB@$nv=;yRaL%?cnZUih%`+r z7KdTgk2cq8wZULOMDzI^fTAc|Z!7>26$%9ao6RO# z-tYGadAVHv3JAl{_x(<%3_T1VJzu zMX=By#6zSAm_{#PK(O-!9>6nr0S{rD*3K%0m6a*dL?S3ENI*lj7>Kfw-DLO6ZsS|c zOlIbp`Tiy>iX!AG0XgdpAOKviSKs$}dor2a?{{Lr<#L(LX6N&{-EJF(Q79C$T_H-L zdc7`+;&3>OvMUvUAH}xq9{^aIL}QHcyZ%uWEtgATA3V=AO%s5ss+MID`@r{oNs=^8 ziw`#*kH1};!9>&P^mIC{R;wTgy4@~-+wDf?1IE~VKIiRXu{anE00com2B_6)&)rI; z0>E|MylPRS(EuO_0s&yZ-zNvllv2lPt>w0A8!ZFdU6W zk7a@od*ZhMUDx?WmSx3*+wB%WtJR{3qQzp->2#j0wA<|f7=}Spi;^-;v)OEtmFt(G z<#`^B50dKl`|I^O&F+~^6oz51*K-_)_(hAg*=!U=DV0iJWZ!3FzW+`C9q`sfJysr8Eg9+Zt-FCj$30yfLp+YZow87{#X!Vm`eOD+2a{Gd2nm=ta!zURQY{fU zsURSsqU*pm-}T5`F5{Zw>7jEnBJcV3%Ixfqm~cH6%(fNF?7|pBXvr-qh5ag);i`sfJysr8Evu7N25vy1`<^b2As)xyPFu^{;vmp^f6al53?4iYPKqLp3XT&Tm=|a^ z^LYeBSRGhgC}C3E#8$>JxnO#A))Bvbd(PY!GIkDTJN1iMj_pe6-uJtE4qRKcimTyy zrOrf#0-5&57N<9LFr?VCpYd_IBz0joo38KW%6VJ6WR8EFYUDe)cG}wJO*-9+c09_x z9U@~;JV}M&*S`9D2bXGem2}rEej2y)&AHE4SX&Z*Y~{;)qa>LS8_sY{Vyz>0lfx{f z8s47AD@yrqZTnhlf7)nj^@Y;8uXk0>>#ja`EbX$%VS^947yrNh@w2e}cDwCR0wOclbpe3m zIDFjgc7#Hv(}S*7tD-1ov)S|cEXy*AqMn<4yWPSt#P`N=+%(NsNw*3Zh6%$E05nZI zolc|CsOJh6iv@P_JilJAef}bfq5yzpSpe{Tf4|?$vP>lWI-Bm(9;azaA|wSMgbs%T1{j8c5Ng|&L`8Ml qi!PT-Q53qalS`;!@fraCAMgf*k8FBWf<5Q}0000`sfJysr8ZKHd;I!%E>*F9YvLp+YZou(|m+vC5A7x_3p8up|RI*Z?on3Q2RgbNu?c+ zvj7Xff3VW2O*{^_x4A9TWYBzS;_EpnLuC8kn~?|3?_zl2^u3ZbTOtYQMFvk-KbLh* G2~7ZXlyz4C literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/m.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/m.png new file mode 100644 index 0000000000000000000000000000000000000000..f5a79ce813b0201e6d0d42c8f5f95f54cb233065 GIT binary patch literal 450 zcmV;z0X_bSP)ztQLR=1K-09rV9;nZZqGECOk`PpD5U^^bG}}$ zecuNFK@g_XDI)H6JIk^to$I>f9FNDOP+0{kK*afc4gl?T`_BF2R_pb8KHz1OB}t-O zZ(CRnT7EFbehD}n4%EH;{bY#axbUC_K|qGlXhh0twIandO;S#$6Dfiq=(;|e%?dnI z&N*%FbULJ5k12}ce!nMCRaM4VrBYcgm&N7)5go_r^?J9;a5z*HckzW@LL literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/n.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/n.png new file mode 100644 index 0000000000000000000000000000000000000000..e9b7491a7bd9b8187349d4e03009094b6a941a73 GIT binary patch literal 382 zcmV-^0fGLBP)U#RmUs-Vcv&hBq_3 z6A@ug3D{W&-~fCIfO9@SW?A+N0xik+eE?~i5>eAMhG773T{q8jTA>Ai=Xp~ewrw-U zL{Xe4SJ(9>z%UF|RRuu+K$4{U{Z2%j^DqooR=->U5k*l1z;T?n^L#$n1B5k?1VGcY zx1*{m09lszYEwZFezw-%&q3e!|76g*uA4gY?KDj@1+Ui&z&MVZ07X#%h~xP2cuY=N zmQ!F^*7bUA+jbK`lB91NLf7@nPx# literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/o.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/o.png new file mode 100644 index 0000000000000000000000000000000000000000..f386683e561d8ac0d040377c8b1202885217a541 GIT binary patch literal 382 zcmV-^0fGLBP)o8qIZGarymz3q{j3 z&+{my$CT+X463RMhNfvj5af9-*`ZPZ#u%kkQ4~T*mSwx9%T02t`0ASb?%{a5)|Lx! c0nP_}0J+w6G^wFA2><{907*qoM6N<$g6VjbIRF3v literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/p.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/p.png new file mode 100644 index 0000000000000000000000000000000000000000..334a11890098e231dbe0f3f9177f05d084a231a0 GIT binary patch literal 462 zcmV;<0WtoGP)PZPn}zJPxPc(31B0h7r@5CmR;PN&msHlKNxB0tg|~=@fvbY1{3VdSAqXeOyPNzzx^4#C+^){Q0@B0AO>-DEXyId~)e&4oj0H$ebnnp2= zM#J}gmKJBy!D6uhU|AL+WImsFyWQLEmSq`BEK`vmkH=FDqtR%$+f}Po#>bTj5Cj3= zfkQizBY<9!BuQ@o1eQU#TCMK)`(QBO1^9kjzJNme0fBmE9D#G)kN^Mx07*qoM6N<$ Ef}p>|n*aa+ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/q.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/q.png new file mode 100644 index 0000000000000000000000000000000000000000..205df6aa1f8e3dec251846aa059302cd22e353bb GIT binary patch literal 439 zcmV;o0Z9IdP)IeZ7lY&vA>1K2?j#7;#jSu}SDl=d#>_G%~3mY*Cx z&!0c4CWJtr8lh(mfC2DrK$c~W<3v#efKuvtUb{yq%lG}KYciPtI3AC!E~NyNQqweb zU8j_uPN&^&XBY;6*=*KL0?V=hR8{q?91aHnK@fD4AW4$xbSm2-^>{o0)OFp#As0mf zU_PI}7Sl8ZuvjcQ0Nidj0ORra%{CeVXqu)2Kv|aGxCgRPPyGt?FM#aB^?D_Q$jbSA zW{jyuXq_|8xtw|cgpl=m%^2HkHUQ!{ZnZ1jgUjV20o(1Cb1sBftyYQvT_vS$+hG`% zW$C)^Uk_PV+_&HFUzeJuDGu0&uj?d90OWbz7eJ1d%+U+re!l})E|;x4wGV#0gb*sv h{yAXy=nsH*{Q%hRmesQWCwBk<002ovPDHLkV1j`7vwHvl literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/r.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/r.png new file mode 100644 index 0000000000000000000000000000000000000000..fc8bc8b0ae880e53cfe630bc7e2ccfd49d80129a GIT binary patch literal 328 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysr8J)^~EYYTuv&pllnLp+YZoo0Kg#XzD({dQNALIo=~xA(zQrw%c9^ez|h z-rFO0D7%6=+f_h^rTb^sfoby#Z<=^7ods*yvbtzwth1?r-PFG*4b`1?Z z>3RQqe71??Sp%M>s=mSZzaKCBljgH@kp|NQm6Mh8y2NbGel_6ff7SYPn?wWS3-&*Z Ymw%-%TO%HG3+QDAPgg&ebxsLQ09M+BdjJ3c literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/s.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/s.png new file mode 100644 index 0000000000000000000000000000000000000000..bd6c50c094f3539b1a895fe0d07706d20fab5f25 GIT binary patch literal 405 zcmV;G0c!qu8~)-fX!E4GmpStd zbGR@JBEpek;b5JB6L1241r$Xg%W|5gr0n~CS(XhCQp<51j^l{ya=GZb9t6Rriwe+n z9nbT&Z6o62@h}WS5QNw3MdPIcJfBYhh@uF87gYu<%L2eK4Bt+k=i@k1n#4rrs@AtR7Uava?{>gP+04U3H zpOCXGyWMVpA!O4uMN$0jC(|HF631~n%t4lAZQGKy=Xr!7Nm81o zh`6rnCV=_rSCJ&iJkP%G(_5JH+j0U`sfJysr8eI19Jg&>W`JzX3_JdVGeV#wE`AmG}*_Ns71L{y!6s#jV?&JIp>X6UyhPrAn=IGNmyY~@w#=dE9Y(g ov+Q}b{Q0jb?5X@+544-iRXwLJTzszYIM7QBp00i_>zopr0O8YZ&Hw-a literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/u.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/u.png new file mode 100644 index 0000000000000000000000000000000000000000..8c1dfbcf105e9f02883f4d6a0f9a286af94a0fbf GIT binary patch literal 389 zcmV;00eb$4P)KuhZYF5ny-L925Ctwtw8;$I}9m@On5vAglhqS^RXFW)zl&*Z(CWGF<0 zJM{rK>j6A~{{m>5=0|^;rV9X`=Lv!k$MMz-!|?Tb<#~Qw9saI)o-NBFga7~`WP7#d zR#k;Zg2RX?iU2?mgzo@+L&rf~*PQ_z|H1l1JkQ_TrX0uZ9F}FT0n~L30For_e43`O z0Te|60J1Fa{Hm(10iN*8zZG7~l61F$e<3an@W_RSm<) zvg}lwx~{t|C`l4Tv~3#zL{V(p_Us%WVp*1oqR6s5j^pYK!=P!}vMh(W)ZexWM5HL{ jok;3gTOPmzxF7HdKM4w$-7NIH00000NkvXXu0mjfM9iJ) literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/ua.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/ua.png new file mode 100644 index 0000000000000000000000000000000000000000..cc049efe2a4f36ffb323bb03540b0987ac409e90 GIT binary patch literal 653 zcmV;80&@L{P)3poEa@Z!#K8`Nh~T7yf`gljgFi|!f))f(O1HK{&0t-m z^>qkezMx-2P21_~+1|PL=Dd@4-{nz+5d0(z_+k7C{09QY&m@VWSglqc9v&EmNhA`- z$H(eurBX2%4B>G2-^D}|q9~r8o^l+=vaC{ad3mWMoSmITA`y)*XbI$UId$>lGysm{2q9Lh6~OiNwT8flhs^W*E=f^TI-LeE zolXJRY&Llldb)^V7>c6YZub@+3jSP()y9uI(izpv+zW!&A} z@jQQcc&IShY&IMYTP&7ua1e{dip8Ru5d^{S_bbcKIM5mu^50O9&*$g!d9&HvN?R_M z-!SZw$)qGng+gIB^z`(kf7lU1*6X#;=c8%*>gsAM`ttGuU^1EL@1oIYbaZs2B#*~q zWiENWUWda0z-%__9CoQxie=eYET+CzyJjOZ00000NkvXXu0mjfW+5)X literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/ub.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/ub.png new file mode 100644 index 0000000000000000000000000000000000000000..841e8cc19703f08479e5897f3d0129f7312f0db0 GIT binary patch literal 707 zcmV;!0zCbRP)jpdBnt zo$O?xx5I@H{KI^uo9~wQo}1_9oWso_5JK>m`UiikEno`(06`EUk%-sphsJU>5U1^~#i ztoZqS9soFw(*Wppy8z(#`{(@2%S!+_J3CXGolXY;bUNMB(~~4g8v$fl#+fY?3TmI{ zc>pk*&2#Z2Ndf>()1oMDnxarBgc<#QUol@^UKU$pG#b$~{rLE(tp;CTUq+*mAc#O9 zpqL*YA8NpGIAmG&`uZBJ*19&u$yJwHNnI|NqbN%0_1)dwo0}VL0EAGrS~ZzWpP!$K z)9dvBz+^Hhd22Kp4u=C{&d<*^07Ov?27|NNOl`K?Z2$-cgLAo+FFUnfUtf=p zk2#KOwOXrUD2lS%?b^BsE1gcyohcfP&Rq$`Vlf;JFWpY88C!Us&tx(z%eq{y$z)Qm z*DIBZvPzO?9=zV) p-}mOF6((0004`Nkl0zO;EQCEQBbpKnXG2O++!=#K2=Xb<=OSm+Ri`ey4Mu z^PKZJf1dO7n1~2^>JK{002lxn4Tr-{r=#pg->Y7)+wFD$KA%s~`3pd!(U?poX0v%P z7_?d~w!hVCB?!X(e*XzjsZ9yQ$cfa5N=TNKFN~Mx|!1MV$olZ`t^F1y?p-?)VP9~F9t5q>= ze44I#o{z`l?--8bL{U_nXi`yl9S#SF!||cB$*AlMz|VRC?tT@H6iOT100000NkvXX Hu0mjfQi0006pNklMfx^-ckl%Vhw_ zWHKzvN~@2Lj}C`Jz>LS^;{Xi90KjxQ6(?_QZfdofICFP*#{-N;<8c6=&)06Z`7y_F zo6SbA*H^1msj^rs@{C5KaRlJ%>Pi@M9Ean$-|zoSY%-YuAel@`OY(idFibEQ6sDz8 z>2Nr_yu5sN71QZ70L*4HrH%IX_U83^h3R6k0Dw-X^YHK>t9Q9v0HD!mPV57OkXEbZ z^}F3pTAk1501$~pl>Q>=N6<9Qk7KczRG`!80O0!i`b00nFpMCGcsvdOEXzs-qtOTe z+-~<@nH_IF`F#E;fYLKqtyVaWQxqjz4Fm$AP)N4)jhlA6-G0CS{QUg-`nuomWi{LF z_Wu5UI2<1BruBMVth~6mh(@DAdkbN=+XsWe(Pp|MmNtifQwFicviR4UD8 s(_*n?vsr|Ytme-ZKR>+Afd3!x0T->L_LGj*%K!iX07*qoM6N<$g2mA?8UO$Q literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/ue.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/ue.png new file mode 100644 index 0000000000000000000000000000000000000000..69b1f086851cfdf496a42485fd301fa1e05a1599 GIT binary patch literal 566 zcmV-60?GY}P)TCHq0TPl?v{rP;J49n#*Lg>l#X8@k(-EMcM)4>>z zMkDe^MN!Dt<#MTKiJk#$Hd`up64%@ zi`i^e6y-&LEXx3JyWP}`#bN<~TCFyjOe9Gv7K@wBhN7q!4_Y#r1b}|OuVx$$hsWc2 zz9|hfIUEiHz+$lgfM&B9i^baQwkV2LtJT=8qDAiYdg?L8Z%7kxJRS)kl}ddCfH6)a z5`*U%0MqI8tqN3) z$Ky;U^N7jia_93|&s>wyhnFNtPN!49-}HUieF1Ol7m!cud$y6`p8x;=07*qoM6N<$ Ef`B>r>i_@% literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/uf.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/uf.png new file mode 100644 index 0000000000000000000000000000000000000000..9fd1e6a1f73ad2c54f5e4f9c399f48732dc3052e GIT binary patch literal 616 zcmV-u0+;=XP)f zc#YTG=5bH89A@^+?%CO0Oi>j0N&JBy#;?Fj{M8dQ8jWhT+WCBTxm@XVnjnZb6qHwB z7)FzlN~JV0{eJ&h`U`<2z#1n|eWlAjq=(Y=*B)ZZsODQb|J|4hNUZmCxr1g0NUDlgY&4a9|kr9S?Y(*D%Rs zlH)k#9f1B&p64lwQr^TH0s!Fi`OsLF<@I`9E|(1x5JeGf>E&{fWqG&Tp>CMXW?v`j z?PQC^g3c(zF!TA`=kxjfegGH@2A?*Xx|>i+BoaYPrBX4{14U8d@i@}BUatn2+-x?z zUM~Q2yWIy#k|c&0aPQ7;~HL) zq;NQFz>9`z+-|pO&swb(0MzSs158F!<2b(G?-3(O5=oNN>C~{xE|bZiQj*DJG#X`D z_IA7J?@dh4&rT48;c)15Izyq*yT1zT_v`ro3;YAeCXGC%@$6o_h~P2*FR90Y7XT!2b+5IXPJ=j_5H-lG5q4 zBuVjj96+H^Q1r!Ou`FdJz~|@Z)z#I_%?$va=LsPU!zk}(x7&R_-_z66`hZHM5{X2z z+3dG3&gF6dj7H;RGSNua0`NTVbUGW21|g)~Zhr;HvMfo`{{H^Q$A>J-YXY{nx7}{H zvVMMkRsfHWkAx78WJ!_$a2%(&udlBx%i3(Vd_Mm*?C|i= zY&HX+C`uo|S->P)%v)NoM7DWNnYBd1FVljLf3WXSkDHICvc>G-RR4Vm6 zfMFP%<#0FzgTd`~dv+}r3+(cEJkJ9-j>B2BTJ5zrkw^f5TrL;YrVfV#0E|ZCwToq0 z;>Sb=G@DJFWxZZsxR%Q$c5ODB=K%;IjYb0i-EQ~7KA+EtPjJ^PibNs+Ad|^nJnYKl z@_0N30HsoCv)O2xz8R)csU9A7yWLK&*W-XpCPUNoe!ssC!!_`Fy$=`JVzGq7VS~Yd z8KcqYbUIy!4F&@MNT<_}0jASwuh+xtXf#@@)&AO?%jNJ2&paUF>;q zp=z}X0Lf(1>2&t{ePaCAqiwfZt?YLDWHMn{R-sT3<0YS8$Nvxb2K2o@2QsxxYXATM M07*qoM6N<$f@5XQd*Z8Vjj zZy>R<5X4w&WnrHtP0%N>wG7x;r0_))Svw0!7qGF=QZa>?7!X7W@aTyDMU(!V0{4p0FdBDP)egH>UO)H=V_W|7)Bbcs7?#bPlG!*;uUKA(rf;bybByXy7&bUNjCfFVLityX)q ztk>&Kr=zOsY&M%rCjEY&{Q?KjY&M^{Y}?i}joV=sV87q@dc7ZAmSq7LkH>ETSZM$N z*LAs(f1HC{E(c(>T8SF8R4N7FbUKLwls%nPgqACz3utyAR-P ZT>-WXL*43-sP$cj~qK~yk5MQny8F&a!3!Q?kE_yr7B&Ay-_%qIB4+z|HMFpzOyba&Tr zxo}S!=j@yx=jA^}IOp)w0`S@X0e=c`KA-&p7>1Efrzxd`kWQ!bJpy-Okx0aulF#Rz z(Zk{JAon?dF{Y}j{oHQ1ZH6ESjYgwbELN-4_GF0gT6E(=($gJ$*};ClPo+|v^FpD(IbSRm z&S)Z$06;1AJ|a;RGnotk#+cpc$9HnM+zZZB(=-6VV9@F8^?KoO*v*-`y5&G10AMs4 z-941j^?Get)@uO$e&24lUavQsO<9(AyPZo_x)s`Hvl$MDgb+!RWLf@(B>(?Se;x1! XUiw9ZoiIq600000NkvXXu0mjfoh<07 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/uk.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/uk.png new file mode 100644 index 0000000000000000000000000000000000000000..adb3b00ae8019b75416edd3e0f2028ec1cf1f47d GIT binary patch literal 577 zcmV-H0>1r;P)0005tNkl>6VZUV_{(<3(d%ug@3}zihn>^jIFYhQZ}=(P!=|_CN)Y^q=*;z_6Ga{z~`%i`Ft+R@^-tm+wG}TDi(_w2=LQ3 z9*+@1JkN`w$Z;Hzhr?lg)w6(FttLs*V`Q~jA%p;6I2_Uf>h*f7)%tRYVVKEeLIqeZ zmpYj&6biH{N+c32%ii67zaI<+0YDT*jPdPuqXHa{$H!jCX0y3m?%p|r!N72T1^`Xd z$iEatNvG52^O?j2K>z@r=V<{LW2e&z02Yhoa5&t9v)PP*1wm-H+f;y3sRRJ!a`~@# zBog5`uG{U>oaLkk98MuG{VYHUJq6o6Ux} z`~BWzG6BGJIyKZjHBCJp4*;+%OI(M;QK?h_U^E(i&$u?5&CzJ|F_KIs0if6G8H@jS zw0JzeSS-jz^?JRh)9G-B{ikPO&twq~=L&*#_c^}i$GzD29mS}Yb{ zE3&Gpfj|HNGMS8~X4WPC^-bUUJ+n;hD P00000NkvXXu0mjfjGqDA literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/ul.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/ul.png new file mode 100644 index 0000000000000000000000000000000000000000..9f138ee71d6febb585fc3233651a826de42a1c6c GIT binary patch literal 537 zcmV+!0_OdRP)Y%7X~uskL_(w zcn>`7e(yPaw(q(3a4A9vyfePw&G7;JLjcBjzuzN-^cE0(fiW%?i!96D3OSCuTrQf0 zx&YJZG!lu3q9`xh?Y7Lw=ksO(7~{oa!7z+UkH_Nx!1KH&K%)l~MTJ74bULll{eHi^ zYqrUaM&o=w-|MpI^?J<$Hk%Cqbh}-ZE=dvq^m@H!v$@;ti~~511AzH_zFx1Dx*!NN zO(zlwhr?mF+f5x)o6QCQu~>{43T;5WUcdSN762i{?REn|wOTa*&^0P5l?nhH4hJK{ zNY7V{$783{`RpeCf<@tQ7$Nj*w_Gm2sI|QKxlX4u91i>a{^@jjmeXprd_JEMi%O-E zGA)3NHR`^I}O3h%vEuWvQ;%{lYUnK|b$0ukXmVZb-zN8rB|2#3RKYipB}laeI8zP{Go z<>27JZnrxej#8gEQ%ttlq89&Q6-ScWXxuBxm;$`L?Y4B(gMI_G7-`8^77{9=JxhB+pD3WAr_0d zTrOrD3VQOlMcQ+c10H&v>y;W0l=`?_@t}fov@Am`XuPC3-1CV7|B~X>7 zXJ==fot-Rpg=}hS(&nYM2hYyV0vH(?sZ$5xa2UYAz<`R^m1%EpSH`j|kB*MkFSKkn zYcLoN4-bD^7z_Y(oyW(=+2HQ(4nRjoht|f(PtMQJkB*K?r4oPMr>7^~m;g*nOt3+X zYOfM-I-O3ZQ)Th^_y}Neagis>=kD%qmJtdBLHHAai;D}T zJt(-ky4u;~_?-Nn6SR5J}T3uaLmM$+ZPft&YXm@wl z?RJwMa=Bb%V`DOzRPloD$BT$`Q=%@kj>6B+?nmIS@eADw_>(U7=A9dG!{fr zYB0*mlr0No!AO>BHvRz?v$9fFnws@26v;{oODh)2j2TWm~P*u}#DcR;!iGW($YIu~^LG@c>{LMx)Vi97hPLR;vny zB9%&IG8w5<3c&02US}Ya$=2)j{n^-F)%$^D_Wp>rb_aVHmU7?DzZSayea3@$~dW=Z-HP4u=3F zlA{C5idM(taj8_Q)oT2r$z%ecR;v$Ab9#_j(OZedV$1ONa407*qoM6N<$g6twVe*gdg literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/uo.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/uo.png new file mode 100644 index 0000000000000000000000000000000000000000..0340b6d03416fa966c0b2e8970395e09e140558d GIT binary patch literal 606 zcmV-k0-^nhP)RQ z<{93^nc925_kPZ8&iURF7-RU&AmNwe1Ng51&1UlrfbK<|+wH~}(=_e(`@LST-EJqz z*OJ38#Ar17zEH2%a~wAq43yUrs*SeYZap4PwOSQLQO=qqNl_G6tCcK>L?ZL~{LK@D z!{PCG{B#N-6pO{=O_IsvPdg|9d_G^jURTZ_7!1mcp+_PNh;w8DO*7 z9tmlyqG&WKYc7|If-Id*13;xx(e{Y|U^1D=58ZB8LAGA60f1o`&0b_OnTo|C0O)i| zj8NTRPNligFvfvEV6j*z2>Sg#00@Gh4IoL<;c#GCw%u+kXW(!+ zve~TC`JV2+-|r0ugZvFG7E3OdTP~O1l^nvTFzrBZ(`aXOu~T1`Hys*yau4=~0ALHsp{ s5V~HkMx)VeHotyl5}!Z258$8U3z7%h*~Ah(EC2ui07*qoM6N<$f-77Gw*UYD literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/up.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/up.png new file mode 100644 index 0000000000000000000000000000000000000000..f5a1d38d7583f7516237fe38ebb33ecf0a919c43 GIT binary patch literal 685 zcmV;e0#f~nP)SXCIf(vj}Ht$tyX(`d%IL#US2rH`FwUdo%8vew|qVy0K{T33;+O>%VnVm049^^ z%1Wox0H9DP`u%>d*ZVVII-LRlK@eAZB9Q<9wOW0pFBS`qZMWMGhr@SA001tR>r(7? zy8xikXoT%alFVka7{4f=&vT4Ip}>pV?e-?1*=*WuHnCz6ts;lR0RRq%gID(Zy%2Cb z9swX8k7ENUiUNRQv3MWQ>2&U|Cs8912>AW}OXVhjpRiCUgaK$Y8p47T1LSf!j&VAj zFh(E@F#tlyVzB@~y9gRkR0(gCWO(v5J!+d>xH5!d8l3uTmL?YpE*ladq zmnlN%^YfD=N#P`qMkBA+%VRtq&z&Uq0GrL`^7U{yTvgF{JQh1=ep05B$piqDN+rSx zj54KZnmceFb*osf*W3fcFb@F?heMT0wOXy@a{2ealHlG=5keA) TfhFW&00000NkvXXu0mjfCNCx` literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/uq.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/uq.png new file mode 100644 index 0000000000000000000000000000000000000000..bfb7f505109971e0bd98e5fcdc2f59c943f658d4 GIT binary patch literal 606 zcmV-k0-^nhP)1xPwJ59D%t8j44Rlfr7Uj>SNaE62j_Wd6l(^sUDSi9pj`RE3 zyr)ms`}w?jy7%+kVWKF)C#8Z9>kIgw06`Ew2%sn`9*@5Pz+Q>2!(#sCd0z%eR=z-CBNnM~%P zK{BS}@fZLKg~F4Vt5kNo9ROICRW=7Gm-Tvmxm?OK%w{tHU>K$h(C_!rAs7tG0~`*= z9isrC*XtXN271qf!9WI}(P#j`X0s_?72$B$>2&_?=Al-r6##g>-ghRsTCD=Wa5$9l zSS%Kqd!8&imSz2Zzt88BGMrAQ{eGWHrQX>^48xElDc@o?o7HNy@9d&7UK%i7A zT`m`?X*U{;9LL>mH)Q~H`)~dH{FKY(?RJX{=kpmYiOFOl-{J#6rBaDRA{@u@JYTET z2!fD`CQ`fIMupSq^d-P%v-#`E;czGxi?LWN8jU8C$yTc+isE1}FququjMwXB7)J5; s;HjF;W+)UIjYd)i?E7c;1^l!A04f&oAMt=3b^rhX07*qoM6N<$f(0xQy#N3J literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/ur.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/ur.png new file mode 100644 index 0000000000000000000000000000000000000000..959804cd94498599d5e680a83343f22cf101af42 GIT binary patch literal 690 zcmV;j0!{siP)C|xP*|aVuMRwK?SD-g`x&+OrlLUH)&N|BLasUT$FSWL{V~yP{9cNKspT< z1+9sPhX+ArG#XuGtyb&q?(Sck5Yg&fI-Nc|Je*FaMAYy1tyU}7D4)+0k<;mX zdwV0I=jUgRm&;`l0@Z32!0YQP9~zBD02+-7TYcDsDo zZnwF^CX-1%x7+Oi4h|0P@9!TUAD6qWFj=8cFbs2abi{``oo;`BAAnY?<@2+%GlfFY z>-9c9J{%6mk4$d0T3pKIa`Cy_?FJB!$N4ZGkEhdV(I#JCUvnCbMq>d_Pfr2d-Q97o zg+jq#FmP^*79b*%$poO)Y6%1)k%+}&;m_dYTZym7C;$Ke07*qoM6N<$f*$-arvLx| literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/us.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/us.png new file mode 100644 index 0000000000000000000000000000000000000000..1d77b1d70537a413d909b19e7f4c6b201bc15c9d GIT binary patch literal 674 zcmV;T0$u%yP)!KYxCHIF6fP{C_c-t_hL6$*vs%kc2lQ`T2QwcXxk(-)uHNK0c0*j}wW6R;yLfrqO5=0MGM;kb1o? zd(t%R^?E6a`ZtK#Y+jbZVr;+P2QVIw0Wb_xDwRAQkI`tfTCE(%Rjbvvw>P>^5xVQkYzrU|y7KOuM0FopX z3Wc?Ry}dmEE|*K)EHW4j0CsnG*On-s&##EH)NpfiBcI^l;9xbtrQL4la=BnISSS=W85Q&5dEV)C z{&jNddTAHJ!C5UK@K&Z(v2pY06Y6^ld3~~q}?>qP+eSP_U zEQrb&{N&1RR&<$ArQX*!)w=W;p6EZ9M-)v8b^+?a-8a2$u9 zkz)n5S`8s|W5(n0PN(x+8#$3#mL*AYyWQH3EXxEz7>4mw1&&>m$z(2<3(xbm(`+^g zf@rl`uc-iITr3u^m!(q4+A^EX9|7V$3X~% zuBTkx?{`U(w%aWsB;eZb_bh_%`( z5&-1$`Tt*XDwSe`>2w+f5VkVGCD-e90O8C5j82utCl^7AM zC>eB7EH0ug>Sp^79O~3DgLKrTljH}u2wKpgwP=SrxCo+F2zBd{PQ{8&4kc=cwa}qL z#k}D{$V;P`_g<&hv*mo}ekbQ9-{oSGB*AyW0N;!sga5z)-%#uK`=wHe=XtN!%PsH~@&p<0`Sk;m~ccx3~BB_^2YUudh!| zPHlgY&Gc3)jxJv=<5)9KyaU1SrDM#tmvZ|ec_`Mk6q+6m6i z&Qwe;my^@PVzF|$T&-4v!63(R(nf%!2Moi=X^xMNQQXZ-us^tX&FAx-ogI=Sw-IAM eH@hE$zs4`LQ9?CPO?xW<00009d!Cv9%+EIJ$x8nC&!$$CSfkXEa$R4SCj<8hTr1)#01Egp|cMw1FeqfwX36^%y2;jqDA zAR1d+Tf}RzSP0SU^^HbD6vaRwFf=se^ZDq6dU|@6mzNI?4ip4pvDoC~BungeJL&fL z_&72$Qm@wqK_FyycGmCrpPru5V4mlRYhq$Tc?AFjL6EKy0HD+9-rn8_86O`fFq6qh zg7f*j#bQz3qFgQqz-Tl|`YbFg0O;@Ur=(OW(Pgobl}d%U22cyx3G zz+f=2u)VzrrG05nfE>sZ^>^C|Iplp68pJn-za(+~39PPvG|p Z{0IIo#$xdaS+M{B002ovPDHLkV1kyLgsA`k literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/ux.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/ux.png new file mode 100644 index 0000000000000000000000000000000000000000..e87b75546c5db940206bcf3b68534f1875d8b56b GIT binary patch literal 575 zcmV-F0>J%=P)uo$d1!D5J&1Umt*EFqOufHZxOHHTKdt^47z1v5l zk!hSvCe|6O0JGT)Kqiy%csyph(P%^|?e%)1C~_P}2ywgJk|d4CW7~lBdR;D;@5fXs z1wasl&1O@nR4Ap_>opJv0LbU_*Xz|V410ifyZsyr00@V}kH+Ki`1ck)DVD#< zj%-|0pU(#%nM{7_9q>F4AR3L@0ubwUz1?n`%_hSzx~}i{ds&tfi3H2C01U(EbUKkp z#2Ua@yA?%gG#a|Da~vm%qAbhRYW3&m$LVw`it;l1>xcHJQmF($lB7=!`FuVD*zI*P2_x}r6tyYCX;eJdc5~tIN zQYwm~S@&QtFkPCaJ+7>`0II5*Swf*uJRawHURBlmF7x~Sgb*{p>-DlM`{;eQf>x^q zz~OLoyWJ<(?RJaBVkRJ$%e`z7`P;|qa=EzOZkNmT-&OJbReS+&=oc8(vHp)XKpFr5 N002ovPDHLkV1lty0%-sM literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/uy.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/uy.png new file mode 100644 index 0000000000000000000000000000000000000000..b51e8ee870f14ae9c5f76bc8060982c49f44225f GIT binary patch literal 726 zcmV;{0xA88P)D~4L5UKq#2?rhwGhNK5i7eO3W8QC0?|eV(aK7j!$y>p`2*BKPOuQM5lLYo7HVQZ zMBP^$EXR2o&%6|m_omwY=G*&rZf16uhY*6FG(P;W{UZX4#bP?0o~VEhS}vCpi9{6B zU@(kEqwRK!y(CGVpPxIO&I4cAE3jNH^?H3Y8cn5A_xJYzz~k`*0>Q_}2So^lLKFx9 z*VotY@9*3M#A5N=+Z&#CyIm>{x7&>nayT57N@X^isnu#qMyJzp5O{ie+WmXkY?jh+ zxm>H&3gcH-SCj?^fxEjq07#`$Of~=j)M_<4ND#ziGnvdLs}Yy<$%ZnptoyWKV#4f<{X;Ns$f zK^6*yr}Tl}?`IG^9uMmhsZ_czf)Ol*-zB$-Syz*4DXx7!adJW8NYC{Vj;wOSaA zMx)_y_{+6N3G{kB9I;F$yS%)-xw#=p@|d;X&B6bd-CrQ^8@v^NgnoT@#sB~S07*qo IM6N<$f)?32CjbBd literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/uz.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/uz.png new file mode 100644 index 0000000000000000000000000000000000000000..58ee470185ca5a4a093d49efdd61cb7a1aeda038 GIT binary patch literal 527 zcmV+q0`UEbP)i7FzuUFHwVzC$q1g`NV5()NqKnU4xw`Q}MCI$z*z6oo`GutJSKi>Tb6aMKKr*x?HYUEOs~?SPuRFAFsa+_yum;F=?GK RBK-gW002ovPDHLkV1ke7;;sMy literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/v.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/v.png new file mode 100644 index 0000000000000000000000000000000000000000..3aed0031cacf3ad6303d9435a42333a56835ca9d GIT binary patch literal 423 zcmV;Y0a*TtP)HQ0003-Nkl2XiY`I*%Hn-pJTLCR28jVJ->jJpn?@5xJ&u8EFpU0992ri-I5kxZQ3X0PH=VPN&V{WHJGuCSyk2d?FK|q?2?1_4$?GbeJF}@ zxm*Bvo<|7T?RFfJ%(PywUw+dxx7#i4EOhkQwhh3tEc&K|;a4#L2Eac6d;!#^)mRhK RsI&k8002ovPDHLkV1k@huzdgk literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/w.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/frak/w.png new file mode 100644 index 0000000000000000000000000000000000000000..008b3613484ed1bbb12f6f0be6630cdcced5fe67 GIT binary patch literal 496 zcmVD^E~!LB2r@DPPACWk0Sbu7ah&`89+cpEy;dp}S(bwmXqt9B9>uWV?{~Z1mpP3_ zV>+FFG0<;Wtya9+Y&MCgUa#|^q9~)$h=>-8MJyKMFrUxQ=X3H1yb8Ho4nQ;-t<`F# zY4&VI6ccs%Y~AW4!}$#ER?K`SQKP17ywwW*S=4YVHkY5 za=H8>0FcRKX0zFDw@W6I!{Ly;gAcV*sRUrTTnchH9G<(O>pFeQCjn#3vaEM*+jghZ mab1`G5Gnj^2?e1bc)XK6{w}RaGJ4d*3X}@;uixttg5`FB4!=9LE4)nkMpyqsY_LQdM>9gU@Q3 zW-Wjyia!C1&j|%8L6?wnkmt|?&c9JB0-}BvT#*r+-9Q%L7F>a@z&)hR0;WnSxCKdRs(1NT)W-wa{{Z<;c%GG=c02ypP96(0qu5M*Y&b2DW#0D<#GwY z^E^pR1>kf#0njvUu~=L#m*H?|+ctLq?Du;G6>K&ezT$el=1vqvhG768geU+Uk4FIA zZdWv?(G3@dZ<{bhSnktYw&k#r%h>b`DAt-jPbBl!(w^}b7xP_-%+1YP) z&d#7hMEIsud|4A<0{l|fb-Uf}`FxIuAz|HaH(l2iMFDWRTm+*;0jJX`48tTz=JWZe z%!Kwa#?mw;qG1^FJO{AdZUq6#*ipe4GfngLdVT8^`MxiH`Z$xju3N2E08G<791fCA zCZgl<=y~2Jv;BTA8Nl^;JUAc-0+IddsA8678AZ|cdIeBbm1Gavw&hvZbq!#%*~q*> z-}hk{p3i3h!!Q6a3_~PP7X&zt!z%-TPYcVkr1e1@$EvC>77M;CiUNS^x^g^dng+mZ zHv4>u<5<(Qs;cBXQ^puC%W}EQvMkSY+qU2Dx6DSn-|rtw*X#ADz7ZOBM8u8#gOusV dYXba#zz?JukpQNi4>JG&002ovPDHLkV1j`sxL*JO literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/alpha.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/alpha.png new file mode 100644 index 0000000000000000000000000000000000000000..91907f256e28c86774b8ce4260234f5ca0cdac6d GIT binary patch literal 339 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr+J*eybgy1C)S5pFCY0Lp+YZof_MFL_y&A@^l87EkXqsyjCz51aMAe;G5te z8^Hd6K}LkVm|w+r^K9LmZ)Q8$|K;=e)O}_x>EO73g})|}_W}d&2YE)rW82S_f6bp5 zq;<^Vd~wgk>h)7jeVZb*^vhD|Yn{dCEcfeez1ESjw)EUxi!jC>!uukEXvwJb*O{oif5P948( jc71zk?!au~5V?QZ$tOLDJd2ruzGv`s^>bP0l+XkKZViHX literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/beta.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/beta.png new file mode 100644 index 0000000000000000000000000000000000000000..95edb82f59d4cda867805b03112ad4ba60a4a6a5 GIT binary patch literal 382 zcmV-^0fGLBP)l)Gp-GMO%A;cK_-FpS< zg)(r?mD7zeZQGs(Ii=JzO<8izl~SOkLB6Au(t9tZWQ$MNBb5P}eL8e~F98Q>UW+qTx) za}2!qLWp^u@1@qd?|b<4ob&fn0K+gKgw}OUDKW;N`2sR{NWcMo^uh@tV2ochsIEV| c%iv|*0PbkToCs2G7ytkO07*qoM6N<$f=QE}8UO$Q literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/chi.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/chi.png new file mode 100644 index 0000000000000000000000000000000000000000..2c5f2f28f499555ec79523d8adf36a3b5c09f88d GIT binary patch literal 344 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr+J*Ii|xJr`G_5zI(bjhIkx*JMCa$gMx_5^pFJh04CW8rl`iU1kPy=oHrPw z8cQ5FZyj9DTvTxEqzb#jMejCSrr+|LKS)OO2!{ccp$2}zxsWzp=Y&Jfw$(;DO#)I*bI&_C@3k-dTx0+ z6v$vWCb713-)aVd7&<8Oc0eSa`tNompiMxMh8OH0l@y%YXzcl^<> oES!pyv?Kp+3vpoG!~cV&{H|x;clM?4fI-0E>FVdQ&MBb@08S~0mjD0& literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/delta.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/delta.png new file mode 100644 index 0000000000000000000000000000000000000000..847f5c1469dbb348de397f17e25dd88cfaaf9779 GIT binary patch literal 329 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr+J*QIRVg%gum7FFaiwLp+YZowkwphysu6*_T!6%_+<`8hR!PZgK=cHxDxd z=?6X&1SJ}^CkWhaJR++8Q9C%|{*Rj+5BIjmzhboyGtOYEPxzqcYjBK1Q6Nw=^grA0 zeasAky^kdxz5k>dHBFV}+|DyojF>f->W4&jPYHUxYnr3B*7M4F2NdjGpV(i&UTSD; zeE+-boUD5fEc$Y9@A>Y+!tlKET8ocM)a!~jzwP>hWlwyz@xLt6f7l?Tjfdgo18>dj zZ6~5;Uwb&m`N*m6whqm=H4Ho13R~7}je7m(6Zf}`sfJr+J*Q6n~1rPDy66`n4RAs)xyPCdxWDk#u){F&$i=3pk-7Y^K37n_8pEMT^} z(8TxRfVIcH(wl2epRQ3CI{92)`0z1_f=S$b&P+lR9>}xIUwc`xWlr&XS;4*E^|{w< zy}VI8am~Xy!cIN4Hy)LrwG8*lT>Jc*<@dCvATEX_Q{+^3h^^;m=%`rbD;UTTm|c5m zdADb<*RdJbZpEyh-o5txlc?+-L7>9@*Y~wvyr9m==}~ZAyy$?robndyJwP`zc)I$z JtaD0e0suLQU(x^o literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/eta.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/eta.png new file mode 100644 index 0000000000000000000000000000000000000000..206d0142761401395213686294b78561c25d17ae GIT binary patch literal 311 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr+J*F_oKtjzj{5u6epRhIkx*JIzvuoQ#(+U6^Q77k1n4D22mGFyZm zEwDHtH{)jF4Q5UI?fasQUe@@=ExYXH^1!$DL8_<&qez3$hIOy)Ql6fYS;cAEWFPxdo8Ygrp4lCPKgUe5U`vAE1_R&P&BSv!p~v!ri~3bD!HLCr@=A{;XaC~A(Oz!5Be~&J^OQ@QbguJU zm{nsSBlz{}&HTW5jFD&K3?7{7SeAKe)%sKWS1@of?2GxvroTPO(FEv222WQ%mvv4F FO#tELb(;VH literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/gamma.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/gamma.png new file mode 100644 index 0000000000000000000000000000000000000000..97a09a08c45a6c7f9ce729f9de7844ed8af47eb0 GIT binary patch literal 303 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr+J*5yLidCj+3+IZqeI5Rc<;ryb;NRp4>BXyM@gf+LSX`h`Z$A&y;)ISjK8 zu$3|YYdkXH56i@sBh2qps$MKUYUX3;c5U*^(lm~?1P(hD4n-5GN5aPo85ojz1owWg zv7vs6SpAbU_BRu$MN-N?tPjqmHcY+c8-pW```PTN@K14iVp8Mo3HP{aWU}0 yoY%LNlvd4IFTPtt{l4o|pT`ePS?-JfVc6d5@OtBxC(1ydF?hQAxvX`sfJr+J*aoPEgY6XBoGd*1#Lp+YZy>?KrMUaOz;onWB5(oAY2TrdGlCl|!vKJU- zFEsAmx$exG(|Px7KcC#q5ud$rcIAzy0uBs}^_*uc^_etP-~V-GV3-oLW2(4X(5X4b zSuBiGf+UiYc|<-e__gsGmttP%lC6D)?{fFW1ZL-czZ`Y@((ye3uelT%7JQd;vXFWB te7+sSm8iMJ$7XysFWjZYq40pc!CZ%@?;*QSp(N0e44$rjF6*2UngG06R~P^Q literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/kappa.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/kappa.png new file mode 100644 index 0000000000000000000000000000000000000000..7a8571dd2749b7e6bbc3c1969576a2e0aff20a03 GIT binary patch literal 304 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr+J*ann`dS6=~z&U?BzhIkx*d+j1;ivbVY0}XQrGY_`{7Wb1JeGk}nHQqcR zYUN~}F?T`Ug=&o{&CI$h^vnOwU-IGiMYkosJ%aOmxcQeeiLN;CpYiuTdyW-Z_rFI5 zg}Tgn{&UAyE%qM6*z1f9TdzfFE8VLWw9GSox<5Nj?zo_!pke+~n~gf>EEyD(1Pzb1 z2yk^TJ+Mi~MI@O=(dV*@%ekGClA`SzN_09bc$ke>XGQIQu6@eEPwoeA!}q$|+x#15 yUcP<#@Kwd-#sA|XuYcWg`%1JctJVkR1JZR?Zf_2ng#8D4jlt8^&t;ucLK6V69dly< literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/lambda.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/lambda.png new file mode 100644 index 0000000000000000000000000000000000000000..b619ecd3dcc1a19882a61eb13d65f76104b3f25b GIT binary patch literal 309 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr+J*2~n|yFW&-%u6VjQhIkx*d(Dxz#Xx}dLZaw{1*HspT`V#^EGh~Mg&0_Q zxh5D`tY|rS@J*sHA2+*N=JyRR?aeadKdbvjb#gp8!)>&jf%S*1!THTw%kGzNRp@W- zh`ruv#HG-}z+iYRrlCV3dC&J%y1Nv=*Y4NxUMJbXA($D>^!7rJ;bDU(t6o_2?OJ!e z^lXrzvGSvBxeN|2o!Uuh&t;6eJuaJ^k8XOteE#-t_oA~WGoHD#?X8LLbFUsj1}6^A zhVw5UThy(!elB3hTkyN2^Tn!r%e3})F^N3jZ!njT|Kyim+jAG_KL$@%KbLh*2~7Y6 ClyWry literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/mu.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/mu.png new file mode 100644 index 0000000000000000000000000000000000000000..016d4642008c5a2eea36b59f2d63c38f85160b10 GIT binary patch literal 309 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr+J*Nk-8Go{K=CE1oWnAs)xyPCLlks=(8Bk+p<5fl0P8@Q#c5O6eU=cMtGJ zsUP62U>9<}cd*@N$H)7(mi%=3FP1THcQyv&`OkO0-+jM1HL}OB_P%kkhp+ifX$P0jHp~rMuc<5h=GE;xdD-OW zwkf-`;(BVFy5oFPPRT`NZ_h2RU$OH4BCZt-9~mnjG9O*zwR;B8e+-_kelF{r5}E*X C7ICBi literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/nu.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/nu.png new file mode 100644 index 0000000000000000000000000000000000000000..0f00fc4117d938236eb5eb6c32ba21c43106016f GIT binary patch literal 287 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr+J*Nlk^TOSFMP`#fD7Lp+YZofgP@M1iMmcd!Bb0|u1`ESx@EdDK?)oo4^}xj>hbTkzoIs)L7THE_;ouxGv!r9bo9t-ZYxT#6iu zEdtM%Y`tb#{yLSht4?al41++Y8B8cek$FOc2krFm>d^83B-UvDtfU7E2rI{WrEMu(n{&Fu$r4g^lS$F?t`VUDrVrSPa{ g>ywz&9zopr0LF!Ac>n+a literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/omega.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/omega.png new file mode 100644 index 0000000000000000000000000000000000000000..3c0220f4d0cd21495d0de45a33d6a0f5b87e0024 GIT binary patch literal 307 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr+J*Im;qtr4FFbB~KT}5Rc<;r(Wc3HsEp5k7ejTz}CVm(a3v(Bj*6e0hJ0C zw*=-*jtNa)^tp1cY*|_pa_VpFnjews-eT9HVpdA)g)yl(F#TanxV=rD;nudRQTF?_ zm!8^W!+jx2IB?!`M+bqL3B4;{TP62we!c70)n%D+_4V3HN=2R8OaDxo@+rqE@*TmORda8%JJ)@8U`sfJr+J*DTN{xe;=UGNlzEY5Rc<;r*7nJG2n4M+$raFg3Z9mtbx~tD@W+Y0cjQG z11uleDw<;og}O2d7%z$bi`|#B*F%5O>N%S$jpaWVi7a4X{iED4b7o}S{%P^9E-oeK z1O)|kPb*2C-o$Xgfahu9EVYvfx;4Ldtvg;gr+2H_u^%&FVdQ&MBb@0DdiS$N&HU literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/phi.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/phi.png new file mode 100644 index 0000000000000000000000000000000000000000..5b6fc9e50b7ea1a2a986346a8321bca119f08884 GIT binary patch literal 369 zcmV-%0gnEOP)?=nRCuv*TopCxpjc|UMW@L7^C;T#MatrnyTq_55{qv=Xo#GUKU}eKB_&lZJROX zbpjAk;`sfJr+J*DdTUm_$C2`Hha1_hIkx*d(Dyeu!0EN10&W44?I_}%-ON2!?zV0>ChFoa|2E~^6#vm@i$n2$46k96iS=&#XQWSgr{M0FzCaBGS9(h`xrQ6>xP&~a!BKg&g>iZR|mSwIk)_eYEmfZ1+d>sEm4GtWTXYjAS X^F`x~V8{`m^BFu{{an^LB{Ts5skUmE literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/psi.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/psi.png new file mode 100644 index 0000000000000000000000000000000000000000..92054d2b8e0b687eed39d9c0ff6a64c4813f7fc1 GIT binary patch literal 362 zcmV-w0hRuVP)_AGm9e@=`2bRF?KssO_Ovq&1tUuArZsK{=8&2Z)0X|Yn>`K1a#oU5h z@FPUzy}wZ4y|1e3LP3m?bN;U~h%vqf007J92L(igh{l+z#QmQOVB04T0qPZ>3xn*rQ=TgemIz4}R2LJ#-M19|f5Z(fq2TlmtdoP5T z*UACR-|95M>!NuFAflA=1OWgntKyu?))mqk(=-Vo5HW;ctqmb)t;cap+h7~#hGD4d zT5D~sO?zP5N4u^|`}s5X!P^el&ST?$(XJ!WfCH2?qr literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/rho.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/rho.png new file mode 100644 index 0000000000000000000000000000000000000000..48cc456e69b154f92b63299cd8a3ed8376448c3a GIT binary patch literal 328 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr+J*Y2hpH<)wi_&pllnLp+YZopzA7MM1!|aC7-f2k#BcFI}uI2)%KzVzA!8 ze4J|ovzLTb0>8?!ikpVo(|P~1s2omy=HH;yav`sfJr+J*83Cr{H`0JY`#oJ8Lp+YZo$4sqV!-2i*)%|=q1kH%%K=8A2@TC2D_CAF zC=HMaaZ*Xi=h@w!EBRnc7dU$6gNlBIgkXmQ%YT&)!@kEW>}D=oSu+vR%>zxc|~O_-4b3~%CRsgU|q(%=c$pimff8E_-B@@3k!qgbNQ1? zyPP=U=NFud%zi)TV4#D`u^Ce?&1G_NaY;L8`MtLORcTt7sdeRTv-h>vOAi~&nQhQ8 hX{kPwV8?`sfJr+J*8STw$44r^N^E_P~Lp+YZo$AZ$tjN=lcvH3@fYZZ)NvME9XhIW<$^#ae zhURx$RINYmvhjOeuJ`lTbS1&SIZqV%4l{{ucrc$uQ#HBg&oRsLeud{e413F6dJG@U zzIN-|+hXaB*O(dvngo)17H(DB>M`kDsitf8+r9RtPoh?Doo1H0=ggd7%~lr<(Jj|b zyqp{rlD&7+^e4K%9_;p902??0Zomk-fw%!1;0EXfxB+b7cOW6&>`V0WVo#Q|`L(5gERN$qPud4PY%kyi z{3u{uS9oyom6EmAF-A)1vMl2`f^rV9P1D3VPv1?`IOiZ)P(TQQ5E4R2F6Ue+1xbY7 zLEra`v9c_a8)F0}{y~EFeV^yqIhRl108j_U7>sdU*ZE}IHcIJj9T;PZqG;RpTs~v$ zwk<*k4a1OKr4%6qxE=DkMd{h7dUC@ZltbK6YAbgpd#-i}{h)^!=l~fZqiC13}EH*U&1Q Qf&c&j07*qoM6N<$g7GYweE`sfJr+J*SswnqTQh({*F9YvLp+YZoqCb8#ek=6@txh02YFwySv4u|=(K9gd%$(` zK;8oB8N8Qxi}+bJk2|&o?`W^f|EpQ!DV(uv)dv+z8y_JRN1;Cx4_J!(?)%hrFCi^k z*O>W$0gv6B=an+!*yLp`nZnf~LO3&pIUJ>R%nW z&dqSVu;rnNuX)J>MWtk)$Y~E-1V3)m-E^(ahC{G4wtO~&;Nhz8wfwtxCbHe$CYkKw z5_-M#Yjx?wH;?9@IpgwVPWJ6<@2|RU`tnlU5$K*d=GK{>55Bae=K;OQ;OXk;vd$@? F2>=WTb|nA+ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/xi.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/xi.png new file mode 100644 index 0000000000000000000000000000000000000000..a00c3829d177de5ea599de8145998680341975ce GIT binary patch literal 358 zcmV-s0h#`ZP);Ouz153aXumVev4x|I@fa!oecyY6r!DzAv-+AB<|4$}VIcK<&7u?Jv@Cf`e zj$={%yHp^A;G7deAY#{bSH2*Gpp@D#_1+61NXIgb7$akBp66T$RbUtf&Ur3}YSFfB zR8PLCh|4a7(6;R~O^h)B;G7fns8b|_FvhIw3IL3;x~{2Dp!k?l(psmKPGmq5&|1eB z^C^JRzLYYboVzQ7J>-3U`o1s91L&nGC2K9`8~~POxnAHn zRMuKzalyLw-XmhuGyq_XxiaLVOLTK~s^{bN2>idm2WA<@_K>}J`Tzg`07*qoM6N<$ Ef>>6QCjbBd literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/zeta.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/lower/zeta.png new file mode 100644 index 0000000000000000000000000000000000000000..683d9bca83ea455961ba22637f470c94fb8b68c7 GIT binary patch literal 322 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr+J*F@YZ*25*2u4?SHRLp+YZoqABPMS;h)`SIN;4(!tsIBzuS-e^?yV2@yu zox!(-`7MKW0)I^Tv6jehN9@}x=joYWH##48fU8gd{!_jZ_AL&vo!rAHHvFub=F zR8$hoTpRy9dZp$0&k@x`e2krFVC&lgvNBYVn*QLB{=k?Mj(9zw>%L`z)W= z@q2J7>YQd`ICH`AOwj%BXHJGiE!7nMY-8Nt@p$sLsliufHvD=Se&9c&yxc}!mD)Y4 RS%98p@O1TaS?83{1OUL+e6s)m literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/misc/digamma.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/misc/digamma.png new file mode 100644 index 0000000000000000000000000000000000000000..b9ab6f1448fe0eba3714206132e00a1b3ce0d9ed GIT binary patch literal 336 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJytG3HVXyDye&YX_nt0}As)xyPBY|cF%WP)z9S<$IX(BGU`xWvh*jdB<+4_8 zo9EiEu<>+`;D(4YLqqGi`=ur|`aki{X=v`pHIKhP5(t7{1lUPkU;^f7rlt(tgP$nOZFt+b2)?6#nRp0=HsF^zCgG z-aR4*OjA~~yy)>zU9c{DkG9+NhS%aHvCFHjm8w=AH1TD4@Oz)smH*;=&+nARuKvkj gasK=}!wuJ@mv=CH?bq741L$=IPgg&ebxsLQ0Nv4qe*gdg literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/misc/varepsilon.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/misc/varepsilon.png new file mode 100644 index 0000000000000000000000000000000000000000..2f3ae9c94835bd79f04304c5b68e39be5c712940 GIT binary patch literal 375 zcmV--0f_#IP)uuX0 zgni%7^DIfy3tu=aqT@JqUEk%wx~>R<&@_G5B*$?q%ksZZZQEW`B8Fl926bKUy6#Mg zj#q{6`w&9IFj$ryhM}seq9~#$!g2hvHl3y^48yW4F$_~xRnxSK=ioUw58wfOrXNec V1jITqZ8rb_002ovPDHLkV1k|AnsNXD literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/misc/varkappa.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/misc/varkappa.png new file mode 100644 index 0000000000000000000000000000000000000000..ddc85a22758f76099117875787aeeacbbb86e3b3 GIT binary patch literal 446 zcmV;v0YUzWP)Ska)hV*Q@2>e>&Vh z_x%3%4ENp!BEly{!G~1?YCsKm2H?8xXf*2edQlXW-7L#wS*B?^&-0)6W2H>f1OSSn z0ARb_esdkiAx#X!xYwZyu-ol8jtj#O5p`Y9^SrRKER!S&0GiEa5Cj!XssNYE<$Ar6 zdN>>w>#Nm@1m}4k9|`aYrD>|FDk2__N0wzt@NTzzKA+zMn9XKMl312Sf@_)<$8p8n ze+>{tvET0l0K+h3;*-hbbUM8UpePCnKA+Ev#lc{JNKB#9shx50@#&s!`Oq#lpQ zhr{6&fNk65;6&^7y3^@!90vf?>GYKo?Du;BXt&$G@0Z=pW&;4NR%^LjJ{(cw-lLzU oDNWOVzl$36uc8LjfPVn^0$XNCsPaLfKL7v#07*qoM6N<$f^&wulK=n! literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/misc/varphi.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/misc/varphi.png new file mode 100644 index 0000000000000000000000000000000000000000..a198b26921f9af5f8e825491313443f073105e4c GIT binary patch literal 520 zcmV+j0{8uiP)&zuW&dV7K=qZq0{Ne zvK$VF+3!Ip6slAzhrT5M`_aR@{R92}yymOg{6et`x-aB*l6YKsJM2pSc1Zp!pFJcuy0e9-dn zO!xlJx#xGd_Z+woAq2i@Kj6z&0V+TR0H9Xj+wFE3hJBa_$8n0HG8`z&Ow;^Bv6-oA zuR({yVKSN6w%uyASeDf^?RL8r}_PA5&%Qb#VA3y$OEE)F3ypUv>+g-F|FURjt?SaU8QOyI!v!I>Rul)vCC`a^C<#*y(h5o^Lc7&1Td0{Uk{?n+*V9 zI2>{u2LO;H>1_w+0$kS}jYfmPKv9%uT~U-?uQwi#P1F2jL}2x+r~nn<9{}z^`f5pB S+iC~^0000yXdAO?fYZZY~3Z2kt5QR5baANUa#1PvC8$Ql$4yC#_z1X-Dl^Pd8cD^;9Z#I2`Oquh$z422A}&y+XBGozLgtaQJpy zEEWJXO=EmO^b9;6PbQPmG_6vpM59qc$mMeJ`~9r5<+1*1wYtrQr-RZ(r_*V(*}O7M zU5}T(Wm$nhpja#>lS#MR4L}sdL?V&T=bb4LA!IZf<#IVe5F(LCEEbbxnd7+ec+6NL t*Aw5C^Z9(eUPV!KphVxD{1x~JfgheZ2g)B9vbq2O002ovPDHLkV1lld(=Px3 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/misc/varsigma.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/misc/varsigma.png new file mode 100644 index 0000000000000000000000000000000000000000..a5409dd4b923662dd2b59335466910ad94a801dc GIT binary patch literal 360 zcmV-u0hj)XP)$-|GIHoMif*|+^3L%tA%Yw5~FF8$9-}i5HQQ!Ac%JVi-_UL&YV~lftZbWLpIF1M*jB%dlw*Ua3 zZChQ}5kjVE)^&Y7005+vVHm!r>Nw8zfVb9lwQUJ^otJ$A3yp+ z2ui6Cf-!d7xL?#V3`1F#`@YZf3;-D8i#vEO+5>n1XY~iin5?d03g37D0000)m9~P|q!0^>*w~4URdg+FMeqlRU>B_=)?yd@_ybmoc9wz?D-A*2D})$4xFlYL zJ8+6+XLgroVdmW(hEj@mngegP58!_S*6TGPq|s=Y+D$E*D2nZNn^HQT&sml=+;0tV zI-Lk1kHf%zzqb=mtJM@m(Oj?BI~)#wK4L8g$K%oIbUqU3aI97FjjIZmD+4Jnw!mLd%a#F zkua-%!z=7|JD1DF^Za-`<~U9e1WOMvW7ro_N*RV(E|-VHA)QWJ{r;FwE5!5h(ZYSJii)CM2L7y z4Yby85v7z;>X;gQoDGP$EKAeaXgPjLsg5(o>YLU23y@MGBF;Gx)m<%wkWxD5KH{JH vr^t-4$9SlvwSE|I`sfJr)605#|q~NlSo2Pd!~6Lp+YZopzSDMM0po@bO(C9Y*U5Ld%4sHZZ?su)e@| zge%SK0@obAH2&E$&gLl{nR-}lkMKiv`44jTGdotys9JHttAXVQvqRlI8=mIkyxZG$ zt?TznV{2HJ*~Ibavdwwxyl2|hTGnTFAr24nC>i8=j8L8 Up%mI$1N1P1r>mdKI;Vst0Mej%D*ylh literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/chi.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/chi.png new file mode 100644 index 0000000000000000000000000000000000000000..774804af196fa73fe550b41b349f228a05914a47 GIT binary patch literal 364 zcmV-y0h9iTP)xtPjX9AaGvDy%pM)18l5fTj`Epc1 z1yn#5V6Bx>c3r2G+P3Y?kK@>Nos@E(=L`XJ0RWUz=iHw>=NtgC<#_-idhaQvF~&3F zoGa;G3P8lZ?}ZS@ImYO{FDxtt06^Qe#uxy&%Jl#M5km-s5Uq8gIJW_aI1Gaj;uhe> z9_;(h7y|%n?Ttk!pXHD~#z+VWAv`RR_x`l0G3I#6V}Pr3IOj^K#{gGf9zvCD1Nl7o zx~@{nt8-FHjIpL^mSssPeQ5HVwSd<8->YewN=)>s|Dp=00P+R~;PtZ(vR)ei0000< KMNUMnLSTY`>5%>a literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/delta.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/delta.png new file mode 100644 index 0000000000000000000000000000000000000000..c3baf6253586ab872c62ccae51d725760af5ec11 GIT binary patch literal 332 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr)60QQH+ErtnLZT zn;dT*s5UU1{`t$QRz> zeDa>nt%l21t(wmeef)X%k57}fUQ3O9r^BJhaNy2jzU^I8f;bw3k4L>;doJ)vzBgOS cfxivv)3@@Ll`s9w4D>dGr>mdKI;Vst07XcFvj6}9 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/epsilon.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/epsilon.png new file mode 100644 index 0000000000000000000000000000000000000000..c8f85ef3fbef563dd92dd43417f489a61ac84ecb GIT binary patch literal 319 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr)60QRDO1lRbe#_dH!3Lp+YZofgR3svy#KQL=%C)Y_ddHs^0(UZ z$NS#TU-m+X!RK;|K-4tVWyUWxFGU4=$oDfibtFuf zm7uY7%JWJu&FiIKU(flRd%J1&ig)#*b+78B-raA|Z20s*#DQ_oLjEp4rj6MtlRJPu OW$<+Mb6Mw<&;$Stw0uPX literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/eta.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/eta.png new file mode 100644 index 0000000000000000000000000000000000000000..c02a78af3eeba4366aa30e51fb4c7732fd6d6e76 GIT binary patch literal 265 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr)60ap7bAip)Tv6`n4RAs)xyPP@o?SV5poe<`y?lk$$nzDc|>2YF>2-FMzT zAUKKl49oTQ2A11wnkT(?{(t#{#eTy4!<{o9p0j!ItiyptiJ@Yiy#DD)#d=E_8Vu9s zrLX`sfJr)605veJ4r&54I^E_P~Lp+YZopzCzS&^gd{Vcu*Y?}^lY}DS_sQiMXPf6LL zv1ftsh4$)~v)^tt%RKboh2shL1p7qsiMdPjZYOCvFxE5d@YkMU`8>wU@R-7*nQ!)9 zkLrKyq3QeUsj202Cyw(oug%(8cB`V+mEpnO_-baClxM9B3_lJ{v}ajyQRD-+!~3}% z$0S@_T!PbMKQ?w8kvRY0E@xS7w8(;nuMO`sfJr)603BxJnH5x#nI!_nJ5Rc<;uQ~F%DDtpe*c8d=;lRX~#mXLW=#<3@mI4Ef z2lv0l@crN5`P}W$6V(uzBzHRokw4X|8*=)AN07 z=z6Vk|0%_N@gfck^*j?;7!ua9HZ0jZV@@`=r}1yu?6v1MPE6A0QedcLP_}JT%$e+X Q59ksGPgg&ebxsLQ00I<9GXMYp literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/kappa.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/kappa.png new file mode 100644 index 0000000000000000000000000000000000000000..44aa91f3c746c532ba9456a24e136b884d30a70d GIT binary patch literal 364 zcmV-y0h9iTP) z&paum^mU1d-uro;i`+rVZj32%$(OQUCP2i#@1>MQWSVM!JRVx>3q|Ft$T^q9(=^RA zO-CMb34{>OrE`u_`lmn>a$CeXf7-^Fwrw*T_2H=S-iHuMy#qoBW6WBswMN8$5g;M} z?E4M?0PvcQbB>6^FaW^k!!F6pIhTyn@CYIN^q+96|DsAz3CK6h(rgg`c1n8y0000< KMNUMnLSTY}Op-zX literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/lambda.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/lambda.png new file mode 100644 index 0000000000000000000000000000000000000000..cf67ea5de45ba58bbf2a9fc0fbcfc1b490b9ed33 GIT binary patch literal 324 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr)60N!97wW{LoX9(%ethIkx*JMAFvVFeynPT`8?4UQ6u(g!+n5{w*gFqkPw z&)|K*sM%Gt;?cGh;{Q%=GKl~G^U=y{T2)?M=cL#UKj3FOUig7cEBLd`=6j!c1Oho4 zJI=eSOz$^5R((I4ogrcE-EC`6^9dL}_i@qjnsn4%la&EPFBi4((y?2c7C1@AE?p$q zhvVV&4nI5J*SqYNeo;y5F+5iB_Q{-9f$h(pckKBd^*Y;KbE{5w@w?kBE>Gq#H`LzG zpSfl$gMgF5B6EA6_v^cYyu4PveITW@G{h@&>$P9o7Oq}axQ(Yd@xuKFtoKwx`1z~3 R`GMYL@O1TaS?83{1OTT#d>8-# literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/mu.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/mu.png new file mode 100644 index 0000000000000000000000000000000000000000..7284125d1d9b94b23b811982b93e41cb8e463bdd GIT binary patch literal 372 zcmV-)0gL{LP)00003KNklIBA+?6PY1=^B*3|val=Vi(M=? z;0F8y!1tEHIX4W0wKhqTzVAQYK}5zF0MvE8NmzEJEKAP$JkRf@X_~SutEy`Mgt*5f!{ILU}eM9#TG?jHaMA&R0f#vCfZv0bE;>bmZ5jD-i)eOx@0^*lSbH`D)D((W_@o)5OEhBai#raszI_^?)CA^!miu SbglmY0000ItDpXD!^A>xBlZx3SK zfE(}+0PnA#bI#uTloDfXnx<#FwRYRKvMiNSLWm!~zzgd8z9@=e7!LNPX-<7F0gN%@ zIC9SSeSfwu%W~>_wFYh5erAKP$lm)9!n&?h03n1irt3PwHdRU?qP3O^z&Ur$Ip=cD zRD)L6byZbb>%SSaZ{?hmQqJ?tIVV{aLI|al)*1k)c9FFf5mQRP1pq*dF@z9fJjCn0 zzY+?2eN_O!SC~@DL(&1@v<&P%TW-J&pa*;asIU(}wxA`)00000NkvXXu0mjfjRlMW literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/omega.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/omega.png new file mode 100644 index 0000000000000000000000000000000000000000..3b9466db6b0cf618d1ba1359d750ae3afc6535c1 GIT binary patch literal 409 zcmV;K0cQS*P)X!!T@}Qc3`j zQaZOg05(xw*ZYty)Hsfp0Gx9Gcsstex~>7BEXzxPgEDqqXB&Q;!O>)UgJoIvA?p-E zTvAa{6jnvQN^4#4cNH095b^nZ?n8*^tdF|~M5L73t3^tQh{l)?0EnonsyDT8&bzKV zvlou*qm;7WVHj@pv+|s?2F@{F3$-4(EK6G)V~leS9?l;eV~jDDWm(_%)~U7jeV;Mr z`@ZLS#~Il1vqfvY4uKHDs($N?qUe~x?sw4*xB>72CRs*o0xrGj00000NkvXXu0mjf DKOm$M literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/omicron.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/omicron.png new file mode 100644 index 0000000000000000000000000000000000000000..6d31fbd95e6ace84ef6f1b317ac700c9da502a09 GIT binary patch literal 370 zcmV-&0ge8NP)0003INklJ2haigVY1n*Ph}tRV-xQu0~}_COK5V=aHl@tW<7uh z@DBi=C6iK0(=@ehi-;*D?>!<4A&Ln3O3pdPm~-yupw?PSnG19Qh%q9fwRRtpQYxit z0ZOT^>t2RJ2mla5IN#x-$;OzYT2o31A;y@h9st10`fOs1F~;7{V4mmm!?kT&<%7%h zDWxg^A_9Q-{scfNt#UHw{HRbVrDa+AzOQPswH5$kjQfz*`sfD#!3Ucagb;fJ5<-62 z`%OU3c^t=K7{2px&T-C5cF#FCg};h*U5zo@V+R1GFC9Shd|MvC1GpdX1==;FbG^FT Q5&!@I07*qoM6N<$f<&~D)Bpeg literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/phi.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/phi.png new file mode 100644 index 0000000000000000000000000000000000000000..1a928d65d4f45299b2b7bd405b61624d49db8367 GIT binary patch literal 364 zcmV-y0h9iTP)~=P||~7CGnAG(Ev0rIay-G4{L;0M^<=7OiEI=lRQBDP`AnhXjNW zYrMb7Kfi2u$VE}SyyjX|Wm%rk2U_d8t{+2=F>0-wrg_V~Z5)~2dqhOUs;ZoGM5L5@ z>(5_w@_knuhY$cDgpeeOlyVDkt3^cg_(L$pP8PT(+9hxa9Kbi7cgzu3r%9Or0000< KMNUMnLSTYR8Ih>~ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/pi.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/pi.png new file mode 100644 index 0000000000000000000000000000000000000000..a1e1314b03fe7c4c585d9699e614dfce48f123ac GIT binary patch literal 250 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr)608Dlxo8$c0;nVv3=As)xyPCLlStSI1`?##8JMe`tE&QU&{gF-rv-i1~h zSl%YAIUpm}bhAZ8r6OWR{iN>`*^PMel6fL#a_jVQxD+rQ{8}5E?W_58j-a66^Ho!r z7^1SX-!7~=@k8mD#QVR-CFg4Q{Jt)%xiqEAMWIQUW5&#ms`oA~E@x`m*KU>kx8u#X rR8glJ{Kh?oat}`De99GUOd|q9BOQPf&XDV0)w3Sj1(^WSG+trZafXsw-3 zLkJq8E{41;OYi+|nK4EpverJUB1F98;aQp9rKpqw051Rlfb*PNYqi$b01y!~pY?-? znpIGBKt$gA@8x^%LkJprC*_;W%*-5PwAKQ^wr!XC`KL|R-bFd*-g~XJ)|yh9=ULgo qO|NJX+4ud+(PvHLUo-#)fcXRxwJFvG85Q6F0000`sfJr)60S&>C7FjVcd2Hc(d8;A+1PO*`mH+b2oNws3wJr5olVbkuu`sfJr)60Idg literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/tau.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/tau.png new file mode 100644 index 0000000000000000000000000000000000000000..7ad430550b442ecdcc55b7995c1e2fac5f05729a GIT binary patch literal 285 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr)60IVHErvkHJhdpunnLp+YZopzA7MM1#zf6g~O*$nnujMI|X1Da$bgch<` zNoY6l-C*v#dAQ5%`t3i$lNCQ389!t{W%<~1?}rU63Ji=4@2je0+?6gxF?(pX3f$WE zb{8Lm@%q=hbWR)aY!%wMYTx_ho@kB(mfKs8&3OM|IiFj~+EA~zsn09Zp1rnCcxKdV ztGP6fk>Ls>!?Mg>`<@(rmHzI8v+#k(aUmfw8cSIYRQtQkR{qN#ptCwt>UoUi{Pzt{ e;#C+JA26ps@3lE}IF1$Q4+c+HKbLh*2~7Z^#A$&5 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/theta.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/theta.png new file mode 100644 index 0000000000000000000000000000000000000000..b5d78300c31402f09f77c5ca91245b8ebf36b22c GIT binary patch literal 392 zcmV;30eAk1P)4KnG|AU!IRJR5EY-m!Pt!z1Pc1~`oKMqqDn-k(5RvyjwTv;0u|vSS6d7ao zLDzNbx<0r<2qL<#`3rzCwhxF15mS5!;cQF+U>wI+t`OodtOs{c*Y%r2nCJOb1ad3T zT9;+HZCh$7r8wtj`(ST{+wGP%Am`j#`wxH^W8e3E-{0$S&ee6DvwMuO$o#f=?~O5t mxF;v~r2{Cgf6)cF0Pq8V(6X@sR^_e$0000`sfJr)60d9Ey5=F>o-6P_-PAs)xyPCLlkq9DNV@KO942I~zh$*fa0EDh)?X^<7r z4$xKzQwZDeU12A`CBNRo?Vp>@zT@j}Js>#o>XV~d&P+lR9xOi~ak*6XdCjb40!}=7 zrzf%PZ|c`ry65}#(#*BT3te2^*WTWC&eEmiT;|&O);65mayMVA+s2TvmbKxAtZ>zDF~-6kjZwsIc(lncLt0?tA~)rvGuo^-!;w smg{~0MLs$#ApSFS&OcWb1;%RTIMWWZr%fuhKtC~fy85}Sb4q9e06oWY;{X5v literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/xi.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/greek/upper/xi.png new file mode 100644 index 0000000000000000000000000000000000000000..a478d75912ca67133ab024ee8ea449bb68968c23 GIT binary patch literal 258 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr)60X(P4ZxZ=GF=py0%h2iy*b z*z?cqShMxqPVey0nWmX_}|$oU7}4S(bxvMu>Ah&vWT`?+GEsn8PdzFbu;hQV4;` zqDlk+CWFWL?G|9~&h9$%f8c7+WVFc^L0AyiEd~+X4dO--S@GPkaQRU0 z{p60q7d-8}@4z!>=FDLj5#g2b2QQ8{;J*iKx7)kAVHl4R==(5DGZu^8wM0>z&1UpK z`~;XzrvO%~)ve|C`y-JEFMx=AK3^aZIG@i~dZW<*P_0(E0GG>UKA!`K$K$tdHk$>| zY&N+nAfkT14_*wGV-#OZY6?IPQ@0gOf?Ck=&nXIasUp81Mf?A0KH!CuB9l-F9C*O6pO`RFbE)-Oxm`6yC$E{|GYWI p|1TmU#@Ki669DgT%Ny`&z$db<4@E?goxlJ9002ovPDHLkV1gY9^5Fmg literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/approx.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/approx.png new file mode 100644 index 0000000000000000000000000000000000000000..7ef6f5dab254b82b474171509f3743e7f5995ac3 GIT binary patch literal 494 zcmVi0s_SV89}G7Jq?B0}S0oC2^~tsa&AejklS0aPlLN4?wazM8{S zm&;`)lVP^{{k|Xw03=D0W!dF&0hmlCJOFz|q9~?PDP}8?NSx2-dc965RaG?>i|uy1 zNF>5rHTm&BSS%J+tJUxKzwlfxm*ersj)C&4TrPhdgpg9H#B(Z&QmfSrWN@Euu~?eT zrmCvz^}1TE3W8v_+sEVavpJj14u?Zy005`c>6=(66aXZX$<1c-DHe-GQ522cqSbBv~W1gOLab<4+aBW*8_n-E|^KnO{a^oy5e`9KEe?Y3_*Xw0`znarDnWo9}d=LZ=_kdxTaU4C* z0{~su<2Vk(@Ub!7w#{)IS(XjMNRnip=cZ}0EMr+VilPUa+_vrK^Qr3^0Q$ZcMe&Sd zj4jK$w37{Wp69Q;gP-<&CtVdR>8HPKn;-};0_eJ?01EhrfG@Z6{5)89q7ncA002ov JPDHLkV1oDbmtX(@ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/baifenhao.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/baifenhao.png new file mode 100644 index 0000000000000000000000000000000000000000..624539c19693627bc2a55f333ef657a165abf1db GIT binary patch literal 690 zcmV;j0!{siP)r) zLRql#2T0A5#Kub27B=#$q~ynfl&sjv1}T!oSja{Su~W=$l%hn0g-J|t?qcdRVO-bO zt*@{9tj_bCch1w9^PcxT2mpZdlla5=Vf-5W!v+9=-EJ2Q21B7xzu#vITd&vAX!Mx_ zV8L#;Q>j$+IG@jFv)TKY4@@SL)9KXf^)xk`&04KiE|;SyDwD~k z(cp(qN{WHJc=pePE%uv{+J?REhGTrQU+N$?bp4R9R4@ou-< zolb|T*lf0RIt{)8@8Px%hXaBjOhqgf@ArF1$K!FY*DIAuUuMx`1BF6yb2h8hN+y#* zs?+I4qtQ!w%6j?;GM~>O_51yB91e$lJ|B1utOoITJdsF13Rhe%mjZzRybR8hIg7UG?q#wdOVp-=uD$gsZZbN~PV07*qoM6N<$g0&kr1ONa4 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/because.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/because.png new file mode 100644 index 0000000000000000000000000000000000000000..51070efc10f886dc762a36d25e73749c6655b905 GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyvc`Esb@24VQsJOFdm2Lp+YZy<*69L_vV{f<5;=CHK>gMXU#pIY&I<%DlX6 z^Tt`+9AZhDyVN_@Y|t#58Gru6k0$56l4`sfJyvc`JteK}Yfb`%9(%ethIkx*JJpb@#X!Kdmt~_6)1-T+qC0MQO7$ls9$>y% z&Bkrpx3|}iVJ%F>c~Q(oKXaR114n6)hTb{(g~0dw81 zMX#;AUY5qLnxnumYuU-qF`g5$3eTC|X6bU+SSS-4{(9oF%plQ&2R3SSwFsQv#Gx2s z`Pt@pAMU;MszVBPgn(^Ymn%`;=?KaUKZ`n=L=wVLN7ozw5u_*k=xEm$rd;>4{` Ts++YP=v@X+S3j3^P6`sfJyvc`ea4BW-~0j!C3?CzhIkx*du<~pgCPg&1(!TV?(h0B$71g|<}E3&-% zANC2PVeD4m%g@c{>dx=jrO_vd$@?2>^TBL2Cd2 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/cap.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/cap.png new file mode 100644 index 0000000000000000000000000000000000000000..59d6a754347ad2e7fb94068e40e71eade8447ce1 GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyvc`VLi{6D`J2`cRgJkLp+YZoun3nsm}xA(ojUTW(be0y8vJmsWmsX<=O8;vx(7AbHXEBv$N)Fu`N z#UqvT!k@A^1d0^OWHZHHS6rl)z`)QjC1}3q>(Gdc*(# literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/cdot.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/cdot.png new file mode 100644 index 0000000000000000000000000000000000000000..4f923c17780c032655a7aa14dc94f1a709565e07 GIT binary patch literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyvc`9g{bq)lxvAC{Gv15Rc<;uWaN!V8G!Ls3)sz+_(KB)0zf}#y*`1$EIm0 z-Hm_H*y2!rI;Ee-y@7#|$)5S$zjurb4xx-G&o~~u3sqIBe&4*YPb@y$wPmI+qfIaq e3x~jucdUyvWKO+f6*~m9g~8L+&t;ucLK6UndpIuu literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/circ.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/circ.png new file mode 100644 index 0000000000000000000000000000000000000000..a27d47748e475c55a752c387bcb6a86bcf633a81 GIT binary patch literal 362 zcmV-w0hRuVP)b@ZYe^X>+)TkIM;n zAf*(%Qy<{X;s6fdfIk3yvX3@RgE3y$)p49Cik{qH-*-*Z;y6|m#j>obsvv}Y-!l;? zgH%;b)AYO3bsYd;S(e-EJ)kHG&-1Q+k|bdmJ^%=UpswqyKTVS;insCm4(54A2wi=I z(6((4lq7RrX0>v8S> zw_n)1a!Ip29*@`SwOA|$G@yrV+kNL| zv!OXX&pRHEgAx^RI-M}aNs{~zecu;FQI_Sd>j)ul=G|_WW!W@j^BH6O%`S#vSe7*npsH%yw%_C#08~|FNoD{BpvNCWf!T-W SXo&j&0000`sfJyvc`VWG6PE4P6{H#}V&Lp+YZy=KVg>L9@OAaW{)`otVp-P>7P^&Uv^J>=+H zFu~(XmCM4dih&m{%qVY64_DbW^Vj_U+RG%{IzBv=`0!D{;lOqWiMHI^S=uqz?|%Qw zYv6l%TW(Z>%<<1QFHf)teBdjPdA>_8_h_Navdn#qHTT!A^18cEhnwNXw%XYTeoqWy zI$(3Y%SV7EbCwp97K32-B8CQ=^Z!51DOPOR)tI@zD^cQ+Mcyp6E~RspO6y)nO-sH1 zJ#w0==c2fD{`+E@sj=5%uS>QiMotqr^m&hZch5g1CXNPqsrqkhi%g2Y0R70|>FVdQ I&MBb@0P?zewEzGB literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/ddots.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/ddots.png new file mode 100644 index 0000000000000000000000000000000000000000..c609835e5a42f761cd4139dfc7b6e93904c4a017 GIT binary patch literal 275 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyvc`T{X7v)<8LiO`a}}As)xyPEq7Lq9EX!D17ef?T`W`J%F zr2g#K73sJsNqW{@hP3I=A3jb0$K&d9X)^oEGXgx0?vD5RC6d=Na?g40sj1qcv2;UI z64U!yzKyxj(^)z+T4p?#WXKY_V87e-c%jAfS!W;g3OLnmT9@4{7F+q&#p~tg@cX=x zUYrbbKF2l1+mxN&B$0e;%ZsjSR`r|SS2v5@Js|PgG$mU%IcL_gi;EN`nvDF7uFjb{ TPyG@*(De+Su6{1-oD!M`sfJr+J5EtUz3zefUvnmk<`Lp+YZoqCY>fC7iB_v5>wGL5`*4hG&iz?&j01EgF0 z0<_sDn>~&HY0uBc&~aj8@bit4Yz7UCAq|FZUYgI>D4*CgBT`yWaPIDFr_QY6sQGte zr{~)5abAoKoyV*FT@+iang6_z7YNLL8(aP0TD0R431y{KYz)=EK!(gKWfYCm?zPlD R$p&-{gQu&X%Q~loCIDMpOR)d| literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/downarrow.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/downarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..fe285ddba4ab2b6092b93113f114fb899d96f899 GIT binary patch literal 320 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyvc`O}5Cd_wECQ?t8j8hIkx*drgtA*+7Kt!S#(Tx40adjtRP~Z*cl1Gl#*3 z@7)1Lfd>!xBy=Q1Ja`(H2v7Dlle(r8`RmQ=`Tl#ltvFx%R$3V~=4=z`W<{S1;1wQ0#jg!}MyG-0_W> zQl~d<%Vlmz=UzBvS>~;6Z%ur|^Am2DMNW&HCfUZwAd!6kd$YoeUFSaUIq&{pxw@xN z&&GAHdp3U7R0-MRb9v75NR1-#U&VnUUu*S61ep&Rl*EQ>G=-S|wfw*kr9Geb@{`H+ QK(8`*y85}Sb4q9e06V;Y9RL6T literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/eq.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/eq.png new file mode 100644 index 0000000000000000000000000000000000000000..21820cadf2fc50656cc6abac4a4f3b6e0f357db3 GIT binary patch literal 176 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr+J5Wr673Gjf4K{+=$5As)w*|NQ@N&#cQR%-nl$1?yt5o+yK?g9#fNSoeQv zV&xXoi}AQH`sfJr+J5OF14r|BXPQ8c!F;5Rc<;uN>q(puoWzkWqD9Q0Cy-n1g{btmYSd?>LzM zF!Rj`Vh(S0KX4+M=a!^+E*~?G!2^~DZ0W0_ydtM{7+O8Q$Dr7vZrk+A<;ed3zT(y% znuf+Zl$9*g4VG?pzfzsQ_F;|S!G2!Gtzn_D-(KvsuVQDDNI1ZLfaT0a6>Ei~4y{0U OFnGH9xvX`sfJyvc`RRwil5j~*LdQTU}5Rc<;Cp&T-RuFKV8>G_Rkn;Reb;{JwuUPlA|GwkU zDq!4^pr62Nvh~8Xn{~&x&-kzK+$ZW>ugN^VAIt~#${m+jI%O)mQ%B{zcy^2DQ-Tf~ zhy=S_iE0*$!;dIW{9Hy6D_v zi)+{QD+^?foA~nD-uS+^`on96V>dE6{TW{GI`nzrl%jLeRTuj2FwSSRVbH$irf{7< R&J^f$22WQ%mvv4FO#q*mXkY*U literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/forall.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/forall.png new file mode 100644 index 0000000000000000000000000000000000000000..c2a01c859c410ff2d669a4cd0c8c09283079ca79 GIT binary patch literal 444 zcmV;t0Ym>=`GcQ;WC&wtz9 z_y2yk?>oLz7-Qg-`T{T32k_4UuIo}tg((n1m&@f5fMFP681l1cSw<;^5Vl6Jc9mtx z4`7UWo)-iGCqUr0EGv#{sw_j`m;+b$u*G);a60f2wT>2yj6;oBAAu=9O? zx7(?z`e(h@>!oR0*EQcR2Aoc(!C-Ja9-E&3+7tz2-0$}>#)4bSBs3b0k|en=9i>!U zVHv=7yPeHuw=0LkLDzK|uN0s;Z&g*-PseehD0(Kqwrz}Y8}A8#+nQ`PoB4b$`|C_v z*RBqS!~32;0kB@L7mLODe3ra>jlSh4`*OL|Gz~(yTCF-f2&{`HlL-JI&+`t2?F1l% mjK||n7V)U~Jo+EN+W|i#$Gq!U0w@*$0000`sfJr+J56Y&Evoe@BxtDY{7As)xyPP@q4tRT>~^(8~!12%J}Jcl_9a}Eef927jj znb2I!>~?@xqS0=`j|(P?!X}wLtbY2bp7YMc)y^EDesZB{T?;t66f^_8cn@z__qx>C zqp_n!;M~rwW^4k`p+^MYZ((}E#tn} z&ayo3vGUjZ`J(5aqxKo2r_y85}Sb4q9e E07r^>Q~&?~ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/gets.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/gets.png new file mode 100644 index 0000000000000000000000000000000000000000..702b6da64d3590519fd342b1d443265210f123a3 GIT binary patch literal 325 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyvc`b>*HSbupmO6Hgb%5Rc<;r`d8f8;CT-ze*Ad7c3X#f2di+Xxr#s_*rC~ zWT}XV>{lK>F21I2&vqwG-7u9}?~~h8e^uiw$2Y z@FZL!Idhg5D<7*`sfJr+J51I^UH!0$kzx1KJJAs)xyUW;CPL_vTpp=|0EMxkYV6Bzv1*smOXut4a5 zqpFW=Ps=-IPQ|-#=GpGuW0?Q<@}KxqsxOmoo0UGdxq9|;BVWk_e}(6Bit{E*Jl?hL zzreQjhtFJ#Vn}#4N#`^Z!?~TaYUID3_TC!e;x#FViQ#>%uOH)luTGC_Ti?s34$)G{ zYdDqOO$v61wmM&2DI(~?(lF(csl(0xi4q+vVx5Xr#4JS&u0yY*|)-eh*hw6b$s&40>Tvo4uZ_S?zopr0P@v`sfJr+J5eU1A(`Tv1JTRmMILp+YZy>^lFh=Ksig(o|h-l(X~;M>-+k;U3$jmk?0 z>l;E_nspUl9{A01C*P+-M&{i14-svQzvmQ(8?RqiBz2*I?T;LXqQ&!Xwfps-Y&I|! zjLddbiT4lxp?8df!J%g(SAmNQgMgrMIAdSVZ8P7=*Q#Q#YaN(=F^YLb(LtN@hYfU2 zf2v`>7Nzv*p8cK14vA!jDc7U93_e@*F}!>Gpmx`jDU-g(X_n@nsQn#kvVgIkp@w1M XN9T?obML+fdVs;x)z4*}Q$iB}2pef% literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/in.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/in.png new file mode 100644 index 0000000000000000000000000000000000000000..271d61905f992c930cbf76769743ffdf71b501dc GIT binary patch literal 368 zcmV-$0gwKPP)&V6rv>}Vy?LBE=PV#=c_0C?aa>15=4Y25#V87 z!7JeB>!awRDC)ZIx=s*&Z?>+h=XtU$^JWkP0U^Y3oU$xMQM@w)L}ZL9iqiMJrfDD7 z2+uGK!*yM}%84L~BE}eUa3Y|TR#n9#AP3uYo@Yua=ej+5|6?COkLL@1Y-66~((&7T}&wARKLDW&H(afFs- t*|x21+pg;{#!s76<K0w{pb`UNxk0gRWap-lh)002ovPDHLkV1i>Rpw0jQ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/leftrightarrow.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/leftrightarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..989a47dc39a40d1cfceb4012d77213382f9eb980 GIT binary patch literal 448 zcmV;x0YCnUP)? zuHVD=oZ&r(!yzIR86FBwDJTX1UvRtK&gU})*zflY15#s}=5#ux0JU0ex7$$wh5!KK zIHmxO;|vCaF9ksmbh};p3DPtLfamj>Pe2HX;}`(0*DJCzpU<1kWJRaGT~FpG$Yl}g1hjMM4ld7h?ezo(yq#bPlUjQ~KF z<=5-Qaa@+NBjV%nI3ACpD6UqkR;$IRsjlmdMgub^3`0Q>T-VLfBFnNQNy@T4NfH1! z91gi_+Uay=vl&xRuh*B$=V`sfJr+J5L#e~F7#9GA_ItWGhIkx*JMAFvVFeyn&#R1^ICC7#8Ut@AC`+g*NE&$YmdTGeHpB8;# z>+UU?@@UTFpm)FHynfCUmtD))P~WAhpp^ag?zI?3hBdFHlGns?oJ(PF@OnAtG0)!r ze0scsyn=I%NNl}!EozzD7hkibC0PQ69S>Lpdkv#r2R6MHG+%Z4@%3ru&x5%Yw-{?K i&0m_DR~G!iT>cdQQjUO(u6;nSFnGH9xvXIP literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/ll.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/ll.png new file mode 100644 index 0000000000000000000000000000000000000000..d0cc99f3daaeaead992b145969645ce4d285359b GIT binary patch literal 340 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr+J5J^p0b*H?i;pFLe1Lp+YZy>^keSwVm;;kIX9v-HD9EU#ELaOOPV*ua>_ zAZ@{vSD<{MU9Dx(m0MBwf5_|qs^@I)+&(3!JoVk(qnQrOQXixRoH!JxOiqpb$DDK9 z%y;ruF$SY+-)o=lRgvX3_SWpoh`s(?<(Ng^VgaRNJ3c3sFNw-6ONjLAGo zQpsLCg8d=&40DP*R!q?{R62D-^MC|1!_$XciVO`iFHe8@jo&>x)_2X;|BUlyKHsU6 znzr=H!LN0N-K&Dq#GIyte-oLIUmGfwEYs%bRr$?&g@lrp_ulU=A?sd=Oz>VUYw`S^ kZB6!mUEYiXUk@`sfJr+J5U4f$(TOR|3wtBiahIkx*do7TcS&@hB!R}P1f~FQP2KJ+jLJo%(GR$dU zR#9M-*>L@|9NV4Vl*k|Rz4w{5w(PyO>+G52*>hNR5*Y1yEuL?=_I8)mj5(hRWf&6H zzFk@WZF`KD;jtqUmd_Pi?j_sCE}7CI!0=$N{M;Rk74I#dcgzS{HT@IkhHFAjNj+cP zZV59q2qc|ic`mD`sfJyvc`ZMA^4bEX1?Vm)0PLp+YZy}FV2fB^@KgSFRb4V@!A>uyf)6v%cE+n~C9 zgNWw;x85-yS@*8Gbu#8{0Z`sfJr+J5Q?6Z(R}KJ$8a!PbLp+YZopzA-fC7i>(w7W<2iW=^Wc0CVTQnLmDqmPV zecQz=&cgpb3jeeIz~3;lb*|N+G|K~w_6&3QH{aXcvB&Mnoa>BdY^=`obaYtE(p)O> zIJfKUiYZPm!P@s0^+&5HZ4G0%adpwPSuO44SyTBk0`m9 UR12g#0o}sj>FVdQ&MBb@0BHtL=Kufz literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/neg.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/neg.png new file mode 100644 index 0000000000000000000000000000000000000000..164bfa842c13b5e45098b4c1d81ab2a7ec846d03 GIT binary patch literal 223 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyvc`9X6FFtyw^!I!_nJ5Rc<;rx|h`P~c$*eWfpRXYQX~eV!jo^^e~@TBr1q zTPpg<%AKZd-6|~}E+XoIj|_AY7`Y=pa3B0C@?tM@!?juG++E)9Eq=Fo!L?aIL0KP< z&e^=x?3l;Y4a^KJ0v+tTZD$mJnxU7uRxog9WoVC~m*%kL S(g{G9FnGH9xvXHbFtq zrGtA%aW9CVIEten-2}V(GrDyX`b)%C5d<9^92^9}?tWm46x6}ILGXR>=+|o|&y=<| zIrrq|G#61yfh9O#jJG8)3}d(3g^5J*ii{9C9*>1Wfr$dgank8@nAHIQs4uqLZ7P+* zKS2lq073{Mq}goxuMoUN`~9BdzJzid*YEcwN$PgHr_-raDqXMF_zM0+u~=NKR+Q4i z;eavr4~|3dN-GROpsWN6RE1|{eB04+wF!i_MaY1(CKt++eQchz<4~CWx3I4JRT1KxLhuy(J09+ zQWQnk_19zaJ`hE5yUp>zg1R)s(wr%HfxokH3{beST84L!=_`ooXcDo(p-yT-Ma5$`1 yt8p5Tkcs5;`ORj-P(iEJigeHXw=a69-t-gplY1P!*rDkF0000KP)!g$-hCV%+~kEJ zgaDfQ0+jUt9>9IEr;a2^+P3{UavZ0ss%e^nAW)eAV;ls5D2j$*48w5VK&~nbLjXXU zrpLDH07A$-&j5h3ENKC@ZEKo_Wm#H)Z|S-oMbTdM12J_RC(rZiG4(vJuImHCvMiD$ z?Nyo6eK3yWG))JFs;Y{j$g=F>1Q0?9;ep}xdTE;W`Frr2695oGdsXJ<%Cv2JUDr5{ zsZ8LyuA(T%o+~j$2>HIx^E}45@B6!Nk*@21T4Y(aEUW9f|4hj|-ni9`y8f`sgLyHF@Z2mxTVT3-^F&*x^dIh{_2!{IYX)3m{0sMTseb?<>a z(ChU!n@x^48V%_MK@e`x?^Fu(J0v{PbCrw0GUkY z`9<4oHUJ1ASF=v1Q%Q$!?ZI$31mJSH7Fc002ovPDHLkV1oGe><0h< literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/plus.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/plus.png new file mode 100644 index 0000000000000000000000000000000000000000..7055190c44bfa7f28cd4ee6f59f8c92199efd112 GIT binary patch literal 265 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyvc`ZJutiP-mdf3Qrfu5Rc<;r)}gssvyv2Tgbo}v80IitkX=#0%7rjmK>#~ zUcQ9MW(TjI_D)RfDhU5~=Y4s5yWEy*C(bNLDN8DTyxt#VdL_`+h&SKCa@OhJ25bw;AdNEzHFTb_e!9f89ZJ6 KT-G@yGywpN`sfJr+J56&YC{r$(Sqr>Bc!h{y4_(*k)9DDb%Sr!q|lV1K~i>2W}akAc0kfmLQh z{H9cu-w7wD-Fv?D&hHmX9lze&7$hy`&A?P4ec;U6t*s3b%EqVp?AQV(XU{6uTRKNZ zNomo=FZZ(7zIXb@`A39h!L_WOjo12~smLD#=YL)DX z4an#7O#g5=+#mLOz1jq@hs<#t)AxG4jYb1NtyZ(Ur%Y_QT(+tx91cgLQ2?9G=KT&N zNt(~+&wjJnOsCV6$pk<$nS8$kBFbbk56*Bn6a?Yt*5-1#H-}6_i^U?F%^r_OBHHiw zs;b6fvD4{fCg{2j!0-2WI-M6Qix=?icB?2#BodKjc`z6}C!Eh`P17VvN~Ka(m$;l? fg#&N^{{V0UkweYyYlbiy00000NkvXXu0mjfz`sfJr+J5b;Uf+*kGX05>FS$5Rc<;uln*bD+;haxT|%LQAmQFg*AbZH9~^@K|)~z zt4ss4iVwfQP+ka-{V0hVo79Edo*5uhV)G*RnFW zxVR`D*`#xyIl4W$Cn`Jp?ZdY&CZDID1e*Paxq!WmRpH^?&oe#)-OJ$V>gTe~DWM4f D{FYf# literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/simeq.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/simeq.png new file mode 100644 index 0000000000000000000000000000000000000000..ac4b64b65c6a1e93dea9b3d3f317f0676fdcbbef GIT binary patch literal 307 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJr+J5Gwx^E+ouABE_u2*hIkx*JM|)Ovw}d|#+TMP4{{ZhEt;fHux)BweTO4& zfpmj#hwuxw>+HhGS=DB~IYEd2AFDr5E;GTq!(-0M*%pz40*rzMtOx!UuqpLDUNJ@M zbdcs(5ne?OMTQ5bg(Z>&CU(pzj(WW;^V^SRmX~{PZCkr4OP25Ogw&Z^%VsTG>%7Lo zA@=&~xaeT7%pT1yCEwuZGW;Gh>K^R99`*jO0Fx4v!@TD{U&U4H?-%Syw>n>Z|NEaR z&8Mf0>R3M9D~~Ooq0I2+|MAv$3QS50Omz$u3^JMbrm+OfHUavM!PC{xWt~$(696`5 BbM62D literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/surd.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/surd.png new file mode 100644 index 0000000000000000000000000000000000000000..9ddfd4db77f349593e7d2eee602b0f83acfa7fcf GIT binary patch literal 477 zcmV<30V4j1P)FI=HlxL{(WP8BqY3O5`3e#!W;Z{Akwzf90dqD8Z1)Xr21Wi}!n?gEo^#-L z4)>hr(xa53OZ!2`_NM@nB>BGI72te6XIVBLkKY57kxeEO*L6SrYyj8mwcqdOhS&h6 z)2ZV)T>(7L<2deHlmS3dl*8fB6(9(L;z>dK@@?BLNa(fEqBxEPK`4Ght3_L{*QRL} z=QQsiilX6gSo(NT2dmZUd4{>R-EJ+*Dla7WWFC))BuM~tUC&KO(-c6GB&Ac31GwF8 z%jNRbdzz-7IfM{GNR=@w8dE|DfX!y}=1-F38@L|ee!u5_#@%jb7)HfKDOt3|VgcZ7 zl>mfc$OiD7qQPMB@|dQnX`sfJr+J5ZNAK0eKw#_xu=U`h{y4_*Bp5dDDbdeI4|;mLFK^&1y0t81DvHF%4alw zy}+{VUv;IYH&>&IPVqqtK8p{Q4lY&itr}-tiDK+Ayf^(%E}LaK!%~rGg<};(-9cX4 z4qRS3IlT217b8dY-jl`WuFdMm+0tEdAj-Sc>g0p}O6)QRc#YY$pGTcuWdU>ogQu&X J%Q~loCIE)!NYnrT literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/therefore.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/therefore.png new file mode 100644 index 0000000000000000000000000000000000000000..7fd47cf7f8c60d97f3fdeb2ee00d85886a46dc76 GIT binary patch literal 253 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyvc`Esm)P3#5TUb39!fLp+YZonp(yqR7+w_@1{--}DbAWpU0T2anyl7M3!@ zjhlP>hIupRGK!a-T+Q_J=Om^69>avCaT_8y91d(}>@jrem{KI_kj=|*?UuCd`sfJr+J5P0@>XEg3+eDV{ElAs)xyP6^~aYQW)oddd~fpaoo63;hl_>OScCzI%_Z z`sfJyvc`4Xq-x=31c88&4O<5Rc<;r!C}aaS&*mo9q~HLH&l#4VL?dw)j8bj;P_^ z?bf`0p|1f4+vI~PYLh!E^<-q)S3IbkocDjnXJdKm!*6sH7CEhKchcdU&|uF{G0)sr zSn+_#S)J48WGehaLtpNyOWMKh;BtH0WEDl0JyjRB>54K4?p~MN^Y$LI+4)idmek0) zi*HjSf9*5pQ9fUMz4ZR`=mQ2kk1gWPu3MEQ(dK)3Nv2lI51x&^Q;W}8?&lJ4VmM%P z-um_HI_5_fWirn-xW0$0F|2vLDpTsDihJOb-~R%?$xk`4Y0V-H4)vYuUKcZ;$nR$H dV6c6_dAa|<+$Y(Y=0JZlc)I$ztaD0e0swwefcF3Z literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/uparrow.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/uparrow.png new file mode 100644 index 0000000000000000000000000000000000000000..0c619451ae4cf406ac66c39ca6662f3cfd395802 GIT binary patch literal 320 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyvc`4bBUJpZI}7_dQ)4Lp+YZy|$6F#XyAZ!Sm2-T{qGh9VhT4WD5rrFqjuG zl@~BuYaa}15eYkJ%2LXx{dt{*#X6HY4=ql_v&qHFy%$VURC;lS+2lBbIrH<%cfZ#O zzWBXwUG`S70M*P{Y>o>;7BQ@O{cG1{6W=I?>!sa`7EEC}uq`*}ly>O!v<*7lk1aw& zj~4oHNVXmPUaNS7*Z9F4<6{g9a-&^xW~rSocA4}1=C)j~%4bz)Fw>c3_7?DH%HAL=!w^Lqik O%HZkh=d#Wzp$Pz_=650h literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/varnothing.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/math/varnothing.png new file mode 100644 index 0000000000000000000000000000000000000000..ea1b6c1d9e5035dee7006127814bf632eb5bd878 GIT binary patch literal 584 zcmV-O0=NB%P)k+iJA{ARG>NyWJN7@pznNSwpK(C=di8Nz!Vy za=Bcu0AyJ`sfJyvc`UBP``^JIWRD?MEtLp+YZovg@rL_xr{-IjgXJZ;6_1 z)X;Hy6N5ufp^Tu7iCB%e6vMjLN+KMJOQxK&6gpTa^Or+$f{vu%+O4;@*`7b_oP6+n zQ_!gx_vKkp*>6wmd;j>#5%%x3-<6;Hn3}xbYq)IdF`yFnd*%vn!!)8VYzI1;!PC{x JWt~$(699L?U&a6c literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/gneqq.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/gneqq.png new file mode 100644 index 0000000000000000000000000000000000000000..b299d23031ec9249af036beb8a18214c36b3fb28 GIT binary patch literal 408 zcmV;J0cZY+P)ftSgSQDnztvzhZ`fSfP)4@sPJaHqcDW_y;sgZ&JUDtW*h*5x3Yav8Y6me7LoclhW z^L1T~F^sX@Edbcvx^`9U%36zvAz>xQzszZxwrzV|FUyjMq?7=FhzAZQDH_M|H8XA7 zR#j!K)mj5Unx>rd_oT>LE2TUguE;rva6hksF(ye8|6SKL=bVUsocUD^rfKr+*fb3h zF~)q}pCyDiYSxf2l~PwTbFBu$Fht+#$>-_#{{asr{FRnF)4Hkv0000bh>1Kaf%)V&C_d%jNNSv@pav008IQ7!yK>Yd}^-0|2FT97jal zg&@H>Cxob^X(7mIq?F$Kg|K#+_I-akok9q=+iim;=LjJfV<@Fs>tfH>5g?*5hI0-8 z8#fsd$8n^T)~Bu|NU4Po&bfwq76`1h&8ZU(Z3}0f=Om=ftl|fR5S7DRI|sSbP1D2} zV~lNMb^wsPnlWarjWKf0bNM^x7MetA{2*1sT1zRFQfjU9nDhC(;1&e}rBwd0i1=O- z>BM`llv>D8*l1nX<-6>9y#m1fem@?MQc6OI_x@L2louBfIp^1=xXhfE{25&;eS3`(d)#>`PF1Yxc+cWym;Zn5zTXzVC3SKHz3O zfCmuJx~^^8GRB;9e++QWwQXAz1*OzE#~2Gm?=iC0A|jh-Hciv( z5bgWEu50hT)*1jPrJ;Ej+nGGiuTQ!-4-&GUdoa&)mSx9t(=?1RMEn)=mIuqStm_H@ zUDqKZA>`=$PjSu(A#ZsgrHt)NoCo7LCjXDwb2t5Wz!$^%oE}^G<{bb4002ovPDHLk FV1kg^t9bwb literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/lnsim.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/lnsim.png new file mode 100644 index 0000000000000000000000000000000000000000..1365188a04e6085031a6046ccf2e296cf6d7aa3e GIT binary patch literal 447 zcmV;w0YLtVP)T_tJ0KlE2e<=rK(Z{Ygb9idE9IX!jOJN0pN|hQM%Yt7 zu(Q5^eF4)n-S78}qF5y&YTH&y>72_~LPcvt9EM@D^?QI2!u5JZM5R;+q5OlOy!GvN zd#m*}AcSzaTo93nVy$v6^4@E$&*!rcqTXtSTkZS4aI2L|HpXzy`@XlIZaj)G0^r)g-dkH@1BLMgSb8HOQ$Gjf2g>((FZoC5$M z#IgWuZP#`A8T@9Z*ECI2ylzWUZa1seT9R;X3CKaXBlch^WL%r8bpP pmd8U4fOB5=9@Iz0_s8qs0A4T3#DZWY`Az@;002ovPDHLkV1jZuz|8;v literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/nbdash-1.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/nbdash-1.png new file mode 100644 index 0000000000000000000000000000000000000000..07cce702f4abfb4d7d235f5e19449aea32fa5672 GIT binary patch literal 289 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyro$9jSed@%lia1D-C9As)xyUfsyq;vm3!VgKuy(p*`rVH+3D{Mn=`DUqSr z#`dhMQQ_DrvjoOh5r^&`)RVdMr>27Eb0Ul2!BiEQc1AXdAI1rhVhpc$F)1v{z1{bC z1Lv1o{soy*N=C;*LPc2)-d=hAd4m8`!}H4D`^sa(r!Ac<-Sar&dg;99$7cNAmz&3s zFl(7c*Cw6W&wuV(XTY;`%C&|>iAyHEk0Ufw_q*oaR`Xmm#p?WJPv6@6*Q1yiwBxV0Gg&f z9*@;(b-7%%TJ2h3x7$ml(&agkNC*SuaybBi!C68;wQ*fL5!8VOX=-WLfrbIB*;{olbo|9{|AX^+E_aj>B=h(P&)s9*-v$iwOWY z9FBZGf4yEVm(^-D03Z|!5d^VbuZP2-&*wu?RDcIO&&y=8dkGA~q*AG`ZKBufCzHuN zJ#upvb-P`g&33Qx+-^65An|ydWm%n0N0Q`EwrRiL7nCI!;B-2x)#|$dg+f8A)e1_v z?Ljh`tW+u}ihivmhGCP*M4?dNIR01G@puddgPBa``cpRm5W>-D#4rqkAfJmEhUId( z`Fx&Er}z8)b&5)*A_(GnlNp8q0L*5y^ZEP(CAtoZqLfNyy^kNB7?!;;(=H!UaeM}&4wU|)9G|`m*?}DB*|X{O4w_6;?Tdmg9htfX)*=+XX_q?DA>jen(LjGvva0qYUA zwknFEX`0PJs}Vu~z$*t)6lGcVzWyA5F?Lw^?f|6}0JLp;>Q3LbG)~jBah7F?F}~mL z!!X#2K8m7E4y;v_=lQc|o@ZkWA!Mhe0HChxZSsF{D!At$P187z-Fp5QAcWYT_+Efh zQ^5tm7z@MDXJ_mI#&JXl2_bv{2TPwZ_H(G6GT)v2`SJP(fCqT_R+JdNI;sEw002ov JPDHLkV1i~lt1$oo literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/nequiv.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/nequiv.png new file mode 100644 index 0000000000000000000000000000000000000000..83427dc84ec60897226f5ac9be13a5a6a0f8086c GIT binary patch literal 463 zcmV;=0WkiFP)kWEXysH4$8oBoKM+~lL5mpNs^!ey0@umniNHG9EW~ox9EDk(lqV5F7n0K0q{I; zxm-2_)B)gmJ`BSlfVK>>EE5D_u~-awc|fo0|F`Mr`UWU0;BEe#z{&ss002ovPDHLk FV1kSX%k=;N literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/nexists.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/nexists.png new file mode 100644 index 0000000000000000000000000000000000000000..c5e3e583c6d81cdb274f5d83ad06160c578d37e7 GIT binary patch literal 317 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyroWS<4%Lr*8ua-SKpB4DmSrcG^bX76Tqv#=8tTLS`H@8w49XB{~H?)DB3i z%w))apq-&H;ap!q@uTp}HPhecyRYnAaVaEN^EK<9hG@m4``^157#=WdC7qBcj<)W5 zeEwEj<U6>1JxAV7q-9lo_0u%QqB{?|O?+7;W4L&C+ zD0tCQUHOB1hD2NKeNPR>0}{?frc(MDiQP#(tbDJ&zy9&RLBDaSjDC6YM^Hd9c)I$z JtaD0e0sxn-bV2|C literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/ngeq.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/ngeq.png new file mode 100644 index 0000000000000000000000000000000000000000..d3385e4cd6dce61f029f9b76541095347ec01231 GIT binary patch literal 526 zcmV+p0`dKcP)1r|V7XjjJ07=i zx%ZzAoagZ4c|QRFp#0Pa<+J`cK+`lI0rUBMGMTvB0jZM7D+EN{8w0jcDo%4 zh05h}x7&R+XHJ0o{a&xvW3kwDIt74KDrH%gmw@y6yjUzAXTvZGg#y7$#LYpqTE!eb zKNP@R`jJTFbUG2tT_=ET+s$SZA*Ad2cDpT=O3yY7!?ap02Y^!_AcQKFN;n+OX0xiQ z+P3{{L(}xTeXw4y6-6OleC~jJK5rNXF~EIg%CekDB#8e8xK;H3v-`z>FJew|?N;%r QO#lD@07*qoM6N<$f{>u-1^@s6 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/ngtr.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/ngtr.png new file mode 100644 index 0000000000000000000000000000000000000000..033a1d168126cf8e29d8b725a10ba0434d57e7ef GIT binary patch literal 432 zcmV;h0Z;ykP)1&`N`Rjh~?74fF1x_(W92tK&IDUX* z0guOH9LGdb+!{nwRh9RCJ#Bjj)>~~!UKnSr9z!+nUd97a8b<;HW`+c7wbIyr~h^)19>6|f~GM~)b z?FQg{KF>R>wH88T-B~&EopW=tQYwD~vMlo6YpnrDDZee9066Eg){L=vjo)vi%=rH{ zou=t}y>iZ{X_^O6Rn^9KBWY2I{PYZzQmblB#%~55tf~na08Kc*Gdz z^ZEP!vUgw@hU>bfX^NtlC}swnPA33BtyWtumo$0?z$NggpkEzq3e1!fG`XZLb|TsZny76MNxtv$jpJ~d7>z) zs=D9r??|5KSwjI6gS^>nEX#rravY~=TC3H95HfTPQ#$MQy61UJ4rn`hwOS1ZgZX?u znM^RowrywZpjxd)QFMQfqNv;LmdoYwc$`fi1VNxE%Hz7@IN1OU!|;7S-Q0yVhkmJ4 zx?Zp8PL8L5IF5V09zy7FIP7-2X0!RIDHIC*e*b5{=d%|Gp?14nEEXk6@_j#!<3~*{ zmwPouDTWW*Pi{0Ctiy+`(K?+D$8oP*Tc}d>f3y4DfG?DvE5W^y-znE zcQVB(V7XkjS}j2kc%B~)htAhz19&_h>-D-=EOH#TSS(JbQ!<%!W!efbnM`7_SgBMx z9*^&cD2n6pI2eGYX#k+A>Q4kAl*{GZUO6iV`~6-N#Y`qM8jT1c<#KsCodyYb>w3LP zk^}%0MLnO--~n&dYPC+M0|4D_*A>9N&??|uLV;Dx3<-_6NcZ=rpc{ZE`sfJyroWY3qcQfigg$DV{ElAs)xyPCLlUqR8Po^X#3i!ny~AbQ*;;faF2HB`nqx z`R*JxYcT$}f%8Alo|ga4JFZ0)1j$?IF#nNG=n3?)eH>tF4Rg zRreUS7(5TzmUH}yp1YMV0tI~4qxDjP7ae2z5*kERm l##XUb|Nh*jmsLkvHv&Z&JYD@<);T3K0RS6#SCRk# literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/notin.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/notin.png new file mode 100644 index 0000000000000000000000000000000000000000..d0012918e033082e4f727ec48169322da7fa3c5c GIT binary patch literal 383 zcmV-_0f7FAP)LJ!9a@F2i( z9Nzl}0mgCMw(UAEwT2L)B(1Rn?>%FzD7CG8DdoDZC7IvlRXgXFWjTrU-tYTP2$|>k zh7MwkN+}_PF(!myj2VWZuvb*br`Eb*K1Bdp>woo9O3T^02B4IN5PqLk^GPY;OS{Gx zkK>qA4FCXu5CQ-x`sfJyroW8KK;$`0YTUIi4<#As)xyPTS3UK!L}F_Y_0V0W||A=?7;cS_35-c|F<# zx)SX478OjD{(W$6tH4r`2UA$mWDhK7IJYxO`B9z2xt-TEmriC3G<0)gP%1k-LHqLB zt$$0kQY4eJco`H~ysq;csJ?&bp6c^C4{s^0dS5KLW#47pMND%0^3Nq)`M!}SttP)@ xqul(G=BY31tJh5p+IlTYc=wT?H)RiO$`du|*rD3xxee$}22WQ%mvv4FO#mqxT?POE literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/nprec.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/nprec.png new file mode 100644 index 0000000000000000000000000000000000000000..a929e3b024b53f8a690da1c901403673d44d83ae GIT binary patch literal 353 zcmV-n0iOPeP)>msc^zF!N=XQDWaa0kzO^=lP`SZgUkH&>s@!1HpXXUh*)&bf1~Ep?IT3m9 zi~2+aXK&MS9033kIp@~ef<9wk#c8bTx_$T|gc##649>Z>ZR;Gg{cx6L0RRBVIUlWj zYWiK*5z#bFecvmkiW@*gCjeS&@BQ}Zz2}@48SJe7KF&FFfyhn(`liQ=^ z;eWe-{_x|Rd+y;<7-RUPzTm?u00p1``~?ulvEw+oi-3B2Rmie@yWI|lLrxCAC0*AU zhKb`iH~Aaja=A#7)a&&GK`>48<*(Q4YPEVkpVQ&lY(@q+9*>z?MNzz7ub$^sDwXYa zn-2TF-)^@F06`D{K&@6o2-&v1-|q*50RS|cO_pUhn@uLaSS&`P5dlC|)mE#OBuUyt z2mwH;RMIpp48xbd+wA~gxm*$eI-QPT7#UL(MMY7@<1qj<8jWtZJDE&)o(F*8a7b{; zNs`p-^^7^4PC1T?q6lL=pU)YF`5AMH>i7Hi`~C5F5LDp%e)_mtt;*$cx-CHv*tU%j za$PsmNrEx`mStH0a5|mddoekHD2iyB&I~1ysNz>q01CiA06YOE7(F=js&pp+0000< KMNUMnLSTZxy~b?- literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/nsubseteq.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/nsubseteq.png new file mode 100644 index 0000000000000000000000000000000000000000..9e530e2767f3d70ea8ca7dbf8c2324b50852367f GIT binary patch literal 401 zcmV;C0dD?@P)Ih zI=SrzH;=M15B5{&C1jZOCdY(==HPq(+6cmNE7;J^|pEUyPAS-8E6P(pk_b@5`soRX8=aP9JXp}FEb!BR_(!m1?sXle8Yrctl<|EbOU^mQSjx^w1kV^#@uLw`Rpp$^#*atPb)8ZwA3x;|gb+%p zJp6bBgb=N@wU%?fEQ|MEN_hgGkRowhBcj%Np67kv0RRAgm-@b^ls-H7eS)PZj^kjA zm1UX!iX<6GDYtC{fU2sDF&`ck08rPpF$NLGaXj7euWMkMrePRD2-aF5L`Ki2Hd@=Z z>$+wbL{ii=4W$$j5%F*3d@Myj%EphU=$-7R8oYxaLMZN!*KP3s4Ib>;D&rq+_@@8> N002ovPDHLkV1gE7j^zLV literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/nsupseteq.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/nsupseteq.png new file mode 100644 index 0000000000000000000000000000000000000000..4c1866b401e2fa89deb23d995a79a4f8e04cc3f5 GIT binary patch literal 400 zcmV;B0dM|^P)~0003mNklR*i1nEGn06IV`zz(njv;y~FK4LtG61{xcIq}R(24>!m?`2tDPvY}>7(aq% z2`Hrx5;RT27z^huu>b&TZ7?l4re}=J^St|*Wm)=%`(I$Kl~Q7iDW%T2V1A55&N)Je zlo9}f95Dn{Rn>L99?G)3pMVhJFHQ(KPQF~GN-0VyLTC-sG#!TFAU}yHe<6eq5kk{6 z-Bv}`S^(I|b*Dr^h@vQb*mYfaT3of)pN%mX<6tu<5yNL3$F^;?)=H^hGrx~lCS%Nd z*!MjEtj03Nwp!gFkuipI9?>*s2{`9k>!%2ua~R{esea0XaU2mszI%5|ZQFN|9&Crt uReY`vpUVhdAyX zfCunNob!2}gG}9Vt?P<04m3WKft0eY>rm?x8DNapbyZ3+#;mp9jbA6iPt&w4%Ph;B za{!R%`DI0xQjX)8W!W@MQc6OI*X0%dv=9OzL1DwvFRR2mt`CH6i3cdA%9z z&CVFpS|>>Y002-F#l?dbMbUl`LL3d>1K^x%t>ZW@ieeZBt@XtKgiw+sZQB}SthL*= zbzKJlx9lQgj4=jd%ouB$<^U#Sbf;&_nV)3<%&e4h&H;dk zAmU~WnE7-%A!65c%&fIu&wqn~_x^sr9}b6ko{4DX)^9WL-fOLy`F6WG=c=m8JpDDm zaJS)(l#ay%ZtD{`ry%>XW!3o}pCq_w_YuOS3P%-1LD4FF()Nh!5$ ztCWf{Ztq0^Fbo3#7-O2IIiJt#{Z-Nji#=FtLkM+UTWkBie?Fg^nO)a)<2e5OGLEA$ z=J9x}{8hbWp9Q9yD-jVjO;ci9nHMp}Ow&}rK&`JW)>;vXF^b4V~wH898^O7ZS&b8Km95wsn$A#(6+7jK1Zrt4eGjdl|Uo`8w5<(bb z&*zhKP6)Z+i4J)0kBCwVV=RRDp!Vr89mnx~IuSyNi*l-iW4V-4l+s}sl9T#4yIcq% z0OLYr#tEdT%j07*qoM6N<$g0dp1 Ae*gdg literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/ntrianglerighteq.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/ntrianglerighteq.png new file mode 100644 index 0000000000000000000000000000000000000000..abff3af7dcdb933014f0be241e50dba2a5827422 GIT binary patch literal 440 zcmV;p0Z0CcP)0pTdL}{Fb=F$W`8?12 zspAL`vG4n7ng9R*4j*tt4-ipnEu|!cZ0d(+52_%`GD66*EZf*nO2ug!J3eD4ZiG#Z zF;dECQ-|Lr&-1|X@Ds`5+M<*K07L`;&iSL_9(6tm+>6F>M8vwTuaYR_cYMCdh)5}o ivVXKh@5SpM6MO;Y0yxP?(3jc(0000mSa<%**=I-Z|%-J8)0BqB)_i>u#xm_r9vCmwrC1H`uJG)=~s82c-2s;YHew{3f+ zA7V0KW)azZXs0@H5D`S2qyHWtB1A+)2csehKtv+49yRN^6sbr4wq!sC+z)sIHCj2* TtT@y?00000NkvXXu0mjfq*8p> literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/nvdash-2.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/nvdash-2.png new file mode 100644 index 0000000000000000000000000000000000000000..4079f6fba03da755909ea184176debbd6bfe8b31 GIT binary patch literal 342 zcmV-c0jd6pP)Nklfpnl9pp|F`Qi2_z6)+{x0dz3;KytZ<+g;X^mks~ZWM;w_X8r^UBD$s2{gzl6 zkO7|p7>40dX&guI{eJ=0+DG83su*KQMzkzTxWV(buXCp>rS^T_w(VtSEZ{hfpV)gp zO_Ne8Bsu370JPR2Ktx28QW|4I1^}L|fg;2?4}o(I0E{sdtv3M9xw@{k*7S~wm`sfJyroWS*;l7YZ*YH&z>%hAs)xyPP@q4tRT?VzwG^{gGV__mpPqc?Ny)fM`@|AkrJ+3k?$I1|Mk{)$cfG_%bEeTJylN53txIe&ZG zU#a|hPY%Pa_RqDKP6^U}*zWbjEaduERk@6{OQ*cP$@pNOdH(g%ysJGM4R~VByOhrT zw6xBc<>n>H!l+~y_v-gQlgW=Q)~z~~ca86WMIXZk?cH0;RrG) j-t{xTo4w+|*9LVBw+*u#?r`4#dY{45)z4*}Q$iB}gg1dH literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/nvdash.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/nvdash.png new file mode 100644 index 0000000000000000000000000000000000000000..4f4fb1f2e91b0d3c523f84f4e909e1f85fea3cd2 GIT binary patch literal 289 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyro$Ey==5D}izh2RvOILp+YZy}FUJ#X*4e!v5DYrMa?L!!|CQ`Ljt?QX)gK zjqO=iqr$OMW(kb1A`aa>s3&vhPfZ2S=R_94gQ+Sq?Tl;^Ka3M1#TZ`iVp3R?d%N%P z2F@?F{0lOrl#Gsrgo?5pyuI@J^9BK?hUb;P_m#(nPg^=!y617k_0oCIkIneKFE@`N zVb(H@u1z|#pa0yo&VXm>lxq!%5|>PRA4h1W?sv_-t>(FCiq-kcp1!sBuSYR!bUo5` i_~4(`z{pm|P{H8Du;cxLd34?Qpk^pw)g(?`D}K3?~O6m zT0|rw&Uwm3A1O6-&N=72_sg<0O(UgD{QD7$rfHH=3L&)CDg1+7G|#gTf{1bntPnz2 zYjd?J0JLqJH_1)Yc<`sfJyroW9)$P#?|c7n!J~$K@0VwC?d+;(=y2j#Te^>P{?8yUB`(&kP7$h^EVl$$sE_ezsz5Asa&q-9QjN^rG3|;u8T78RR*ZGHFn(EcJ{>UMiIl}>!t3| gQStV>xdYb7n}+AK1}qfa3iLgLr>mdKI;Vst058{sX#fBK literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/succnsim.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/succnsim.png new file mode 100644 index 0000000000000000000000000000000000000000..7eafb5bd473d4db551059509427c895ec984db19 GIT binary patch literal 465 zcmV;?0WSWDP)65N5*f!u-Afz*KropGTZ@c}ao$qOu=Apj!YZnsq<^vUYFj#AonU7uSp+hL61oM&UelBNMeYn=g8EZk&7 z)LLt;4~K&gf)FC59Bxrc8DqaaxVv7jO91x!{qcBwymu0DxiZTAN1~EoTskL@1kvZqy`)r%eELsRb2$7bhRD$VJ`{Cxie1 zizdrswk*qqc3K+Oh&YW{##myx-kU%vMF;@^#+Wf?@YOUkthEUf&j46!M>dQxlu{{W z(=^kb%jJ^r@eDv!Rnw1+F#>>;aumROUsYA&4c}=32_XYNLusv*Qf=FwPNyO4y!Xzz zd<~}L#uz#0<8{+COQPuwo1V|-j6{OByq~c##pmew{{emg&fMTr9Krp*00000NkvXX Hu0mjf)11jg literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/supsetneq.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/not/supsetneq.png new file mode 100644 index 0000000000000000000000000000000000000000..b43f091926deaaf19d55f0a596f49a512a1c6a61 GIT binary patch literal 330 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJyroW0TsT`Rwba&OHUWa5Rc<;!w&McCuk1}U4YH%oIVRXsiOd#Ysr0p$sO{y(BPHm-a9On~9mw%l21 z{SJjC7X$Xc=9ZP%RQ*z1Mo)@}_fstK)l|G!t%spW8SUFe;SzKjfl z-#7J3DJ%`~di&fxYRkujdFjV)yf0upV8C-d_AHB`l3iLFCr>mdKI;Vst0I(l`761SM literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/a.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/a.png new file mode 100644 index 0000000000000000000000000000000000000000..9da4fafe5aeab01be22acaaf52aa64c6229129c0 GIT binary patch literal 303 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysrWM(ab9FKh-1o%3{Y4DmSrcA6vaVFMo5%b5&k7PKXBGzPGRN=h_oia2r| z6yRCN!?ZAQf~?ll4ZcxUTc_*(7x?+$$4UE*lk}dyS$E}Z>>9R=2DTsS2X?Jnm6dj8 zPLP$u3DGXYHUY0Y-~VpQ-RT!9JL9I!`RbmIj*PVQs3&{nkAFP5(d)ooHBQ0yL;*nt zg+)UFO0~il5-+1`v=qe8TD4@?6JYD@<);T3K0RRW(b*BIT literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/b.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/b.png new file mode 100644 index 0000000000000000000000000000000000000000..c14fe4f1dac6ab7d710dc32043867d2824a980b0 GIT binary patch literal 291 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysrWCb2b%_gR5Lhdf;zLp+YZy>^hdML~cy;BF3Mi9(qJdjfme0@VO6)c_`0 z2liWyHx9l}`1T;R|M9VtaX-{O8r)|%yy#pp`OIozKW3>5415OXKb!a}vS=zSb#Y;c z;%)i#j9+(Y%v6RA>$J`sfJysrWCSBPqGew}#Ax{^_5Rc<;ryk@ztia8waR8-OJJyD*l~G#R5oLSAsa(fc2?w4 zPYyvRi)%|ol6f{xNV&L4C&)`PHT&s{XGYz7zIWVka>?0{t;59dJjPaalIxt$bBd2= zcXb#Zdw$0I$68lS)pM1aOH;3vsz#Xzx~KIN-Zoo$#pb-G>e{a#74BvI%20d%+t22^ jO2VII%mxhgTonvAs~zqw)>2mm`i8;N)z4*}Q$iB}Ym;Vt literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/d.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/d.png new file mode 100644 index 0000000000000000000000000000000000000000..2c9a95d8df8530ebcb7a5893e59960da4a457e46 GIT binary patch literal 308 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysrWX0{b)|0w{4E_=E-hIkx*J8dIxvjdN-@1(Xq-Vbd1CSA%oz>#xk>Xa=d z=1j^5*m4+r7<8{L?GSOzOj24Svh)7kll#l9H2#t+gBTg}cFKcA!2 z(DAG?EGKZ1N`3MtU%6LvoR8$*e)88cz%g>#F^M$2E+)a>`|O1;nD8=4B+I$Gq&zcb zjJ!gDdQX^xp7s}|L zHtJJm*pj>Z{qOY8e+AdR{`sfJysrWX8AMA!X5yHu6epRhIkx*JM|!Mi-Le_;^y+@EY=BD24xAHKs2R6^#)_v z0@()i;jJu>Cv3^k&YF?K2tljpZfg7KfF;T9_BcDB{5Qhxq~LI&V$i%SX;A zIl07MU)aKoPbfsfe4 zLYdp!R2Svm{Md5>s;*3wtbsLy|I3D0Gv|hZ@X2--`sfJysrWW|IV|^$UPPQ$1ZALp+YZo#x2PqR8WFKU*|FbE*N~h6Z6RM)n6R1r5v- z8koOrJIWbQew$g_mZYt1RsVeGa9|@>2*V!##%obtogEAvC(erY7|tnHWJ$Z1 zdd;)w+_hWEPu4UAojQ2?|K*g;|6{v7)`}h|jb+&L-JE-0@@8Y3T_?4EOtgG1xncho qL$@?FCBc__^Ml;pD~YaPkiYZlHi!THnyWwuGI+ZBxvX;899xK8dg9!>9z6 zpb|9AxBO@bfti`vT1!Mk1OU#to3tXsFbwOumQr%gN~xT4&N-!YnX7DiSY=?t!&7#(3Rf=55>B zw!O`j+BAf4+7ti~k(r%yTI;tF)DNc;RDu`q0}6#|8F&p06951J07*qoM6N<$g4276 AVgLXD literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/h.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/h.png new file mode 100644 index 0000000000000000000000000000000000000000..fa3c006d3324d8d6e96bde3eb5431e84a6b9be44 GIT binary patch literal 245 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysrW7WwAq2h@Q=Q#@T9Lp+YZz2?ZvqR7JJI;&C~x~`78wNZmlklin;%s1L!^mPgg&ebxsLQ06k7t6951J literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/i.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/i.png new file mode 100644 index 0000000000000000000000000000000000000000..58e2a69325c503ece628a44281d8f3f31322f4ce GIT binary patch literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysrW77Mkvr9MERd`}n05Rc<;uLSZQP~c$+n9=lzgl`D)gYJe^R!nE+1kEazdvhbP>b+7?z1_bx-BH;~rx>;= zD=3|LQ=z1ENS(PNNOWtM(kaXJTLVNH81}H=*xqm{>%;M2H=xxFp00i_>zopr0Ky|f AU;qFB literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/j.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/j.png new file mode 100644 index 0000000000000000000000000000000000000000..592148aa81b4deca5fe1021338f129399c805f1d GIT binary patch literal 226 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysrWR>|V|A;CbQMo$;V5Rc<;uQ&?2C~~kR++Z>LxITe-afXuijRRaR3mVN5 z-dA6m`TVKwf5~UF8yU@vcg^IF?PKQq UbK9q_K*un6y85}Sb4q9e0LaEnUH||9 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/k.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/k.png new file mode 100644 index 0000000000000000000000000000000000000000..e2daf2e56154174a51fef2078d029b1093729bab GIT binary patch literal 301 zcmeAS@N?(olHy`uVBq!ia0vp^@<6P}!2~4N?RmZ#NO2Z;L>4nJa0`PlBg3pY5H=O_Is>6+^l-1l|IG*h0b`oIEHu}e>=@lu*HDKb+>i3x{%gFz9^Xo4IT#=JytLm zILIh0oERX|(EO&+`gZEA=>MA2|9?`SdGd*>(yAHvRxQ!md#U@v?seI>uT{sl__-(* z%}bwKtye2oF)j7x_gKx;wWa4$&#l|ar}(9|zQ1mg?J`sfJysrWHugn(tv&;V!aQ9ZLp+YZy=ExLV94Qe@rj56E4M|5vd#krZjZwU=e6EB zbMfu_nc+Ey**2(EUn^kY5ct6|r}&JH(z1qCOc(CnX<%Sv+TZ^APOM9asqy>uX8)C# bSgvt9pUbqBF^RGQ+Q8uH>gTe~DWM4f3~V^U literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/m.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/m.png new file mode 100644 index 0000000000000000000000000000000000000000..9f020cc1b7d489578334cee644e972473ff7ab32 GIT binary patch literal 288 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysrWHu;Sg7cB(}?e}zX4DmSrcIrXi!wNjEb5}7}Os;6jad11qmdJeLfbs-i zCp8Y~7QquN?;49cuV}3b`FVfdgg+`j#O8J!m|J<^Y+xf-$OrzW^v7qa_vcC*Gdp;# zoWjI#?be*)9zg~#&1<)~n@ui%w>5tMJMN;y;WLUYUFUXI&buwFw~j-w_?%0~#ExmH zGncJ=WWb}jH2*$>p!5pUzk46poIjuaYL2su(yF~YiUNX4RqtI>Vy_p`sfJysrWHsfZ_b8bMPK2I0N5Rc<;ryk^GR^(yXsll3~o}<3SL461F^aoKZ7`zq; ze{$&hWG#1G{nH<@#9jlpnBsE`sfJysrWc0vE5eUE`cmpxq^Lp+YZoqC_M#enD7$CCpjS_duiXg5Vto za{=`g(l>Z7@mBFSaWp+yaH#N0b(XzU-4lLaF{cLguTAY!88{~}{AZ{*J)iGzLkGiy zz3+GVNr|Ogii*zuZfu;rwzYAQkYuvJ##O8Sc6GR1`Chw)=hZH`;~(Fg`5ZGXbqmk5 z)SIj8rxokn5)pMRH2rMT&!(^_bJn?YyVkjgtYts5W=hht!+~D8x79k&wpib^Oz+8@ z#m2B^Ywm41=hF3WZZCbmcfXm9n!?{@Kxf!<{9w3iVbin3`KKe$dkmhgelF{r5}E+A COnR#T literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/p.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/p.png new file mode 100644 index 0000000000000000000000000000000000000000..b3e837cd82eb88546ceb17b73624dbff1683e838 GIT binary patch literal 298 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysrWcE!xqef~h9lb$Y)As)xyPCLlkq9EYvzM0jB-GOyV!(0c>GKIMg?AsV* zZ!{*eUSg~^xLG0GD`WO>ZUR$f`%mW=Mdt!0%V}L^@x8#pF#ojhwObO4ugxm`sfJysrWb^~VVb$fwAH$7b(Lp+YZofgY`M1kk{&8I9^7%gt7gdBRtz-b{NG@+p- zYDTkV0^b3~?-!mF-3)$z=v%?V{|-S+e_NNy^K1<(T`Kn~snmhJcWa z9FuTSSyVZ1_TGkC%javhG6*E!`Mx)@!--?5NVe|m%O;$Ay%}9vI_6t5ToBrjdz`sfJysrW4t}Gj^ZkKBO`a}}As)xyP6^~~HsomOPi4|tC^R8}(_>}xHOH+F8>|*^ zS#kfJT*}Y=ou@|exMOwxoh#haMH?7c9`sfJysrW4%L@&VKae3$30yfLp+YZo#x2fX28>WTAt+!<5UK&F!l!w+7>fdReYHE z+L|L*H2-T?ZFy{cp!JRHG`VZFmATW`7ME8A+gC;MUSQz;!0N#N&Uo{bNgXpJ1?N8B znJYcz<&0~kdmqgy=3w-3@h*`$F53Ti#j1?n0`^tA-dAfLz5BY0gLOxBk6}xI?2|e2 zYh literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/t.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/t.png new file mode 100644 index 0000000000000000000000000000000000000000..00432047f5efe9ce1711d81a8f11162336eba2bf GIT binary patch literal 242 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysrW4s)sJ>KB1R6FprVLp+YZo#x2PqR8WVT4I6F1O~1y5fuf_DFK`w4orMA z4yzR3P26nzX3775pD!K$y)rVpF@;Z{k4fZ%+krX3VgX(gS-;$4WjteZ?8d4Y&y%MY zuiL7WgcT&TVCvqLde{?dnqFNO)$?V(~oh;-2sJ-yUpZ6m;gec1vAuhW@^; m?DqnJPnf`sfJysrWPJw0L7XJncE%J164DmSr_Ub~xBMJhn7oMzZd{D5(fpZCq)dChThafi9 z7Cwzez5|QG7JqX&vyywKXP)1i^7ucM#@z{SM_!(@SvK35fsy48_k%gn*G*eCTo-7% zb}On{m4RXFwY^fwEdrL$wf(o~oNo8(|HGZ|=S4hI(5dgca&JHQ@N$kc%bxE&8?Qxq zbr#DdzuBw3ly6#v8qiH05nhsW&U|?(?7+ZyypnO*q%M~^Z!$jtWf(kN{an^LB{Ts5 DemY@* literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/ua.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/ua.png new file mode 100644 index 0000000000000000000000000000000000000000..7d36a0e98a63a6fd1968e086ae446731a4585e2f GIT binary patch literal 343 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysqrZg#PYdYwR_Z=NoWAs)xyh8^rZtRQe_&Zl(m0?vR&?*pnA8lwx?^%!?E zEns@W<->mA;HAd*;*lrsp42FlQ-8Ky`7NKZj?nhp+Yh{I4jx^>6#C#YlV!T1%gjSz zOlwUUB$E5Ki&$sez7|#O>0+7g65?g~T(8q3+t+ibo7<)wn|0k=Cd7@*u9RK;oMIH no_e1hSL0npS1|o|cpx3Qe1+JJsXGIJA;942>gTe~DWM4f847}V literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/ub.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/ub.png new file mode 100644 index 0000000000000000000000000000000000000000..d1eacb7ef8cd2dcb0d0c6fb4d7f2ad23e18424fc GIT binary patch literal 363 zcmV-x0hIoUP)OV6WpkIDn_YS1f0~&v`2znyxE;pY6+(!0T>&6Tk~B>Lz&ZDLJj$~4>4}aPRM#~kK39}dh}d=AY482Tol;7l zQ^uH-GRrc?Sf1xWJYb9gz&y{POm@xzz^M)I1B4KWSXI@hQ{=Vp`?4%P)><25ybTwO zsTU!HbM9kA)LKg^$8ju*;+iq#oc}6r+eQfK`~Lsl_dTGL3L)CI4f|ABYXbtTwTO6) z$$urK9EL$D^(mlfnrWJ})<4JXoHND%fHCIuqTS-ZC;}n?z5!3j06NQ6{=WbK002ov JPDHLkV1kG!kc0pL literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/uc.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/uc.png new file mode 100644 index 0000000000000000000000000000000000000000..e1f8bb9e0e7e3950f920b95f633e496466f4f1f0 GIT binary patch literal 378 zcmV-=0fqjFP)yL^jFi$40;N@-Af2bB*&Bu!@w8= zfHyw?V2qolIZjUi0Dur;t=*0GeV+s*imbK97z-hGqf*MWzQ=sVSWy%Q2R=RStV9T* zqzIQJy1mizJonz;2oORn%X0h+E*05Yix67ZbvL@M>o|^=iX3CCs!B@vsSo}(;MYag zS_42`*Khu9awJDZc5+I!z5oCK literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/ud.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/ud.png new file mode 100644 index 0000000000000000000000000000000000000000..a5d2343dcfe16517550e55bbc0f8feee106bbb29 GIT binary patch literal 310 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysqrQ_&@BUG@Nlu6nvShIkx*JMAEEvjLAQ?<mI+2{d3L;v^dE?eGPGh8X{ z?O-U7aldSmd;3^&l;YBT@8eI+DLy8l#3lb?c89>kndd*NC<(Gp=VyqR_VhcSp8PS1 z?6nEvnQNa{im@mx`W`37z;Jt;C*!r!UPn*HJ>R`F4|dG3wB&j^_xkEpuXg#d95{2? z#PIXoRC6BZH(v^6*58?19QFEz0;k5O?W)X14sst@HuJsTB)mLB9_T>^Pgg&ebxsLQ E00UWZb^rhX literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/ue.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/ue.png new file mode 100644 index 0000000000000000000000000000000000000000..974322c69f5280bd2b88512e5d688b18474f9938 GIT binary patch literal 308 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysqrQ{A5Rf0Teimpxq^Lp+YZopzA-umX>(@73zC1m;bQJqOq%RZp^<0TLu+ZD=iJd*rdkmhgelF{r5}E)= Cx^<%f literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/uf.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/uf.png new file mode 100644 index 0000000000000000000000000000000000000000..253244e6002ffc49dd28a84f6a071cca1a7136aa GIT binary patch literal 260 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysqrGnS_Y=Dk3n#hxyXAs)w*|NQ@N&#cQR%-nl$1?yrl9!Bm6j#U{M83`#V zM^vNZ?d{)-sT zxtPe;#{BSvcNjtvLO^%g2fEoF zzytUPfX|b8%d&J`7eb(v0sy77swx05##B{x6=00fT3c%=rK<-3)_n;fk>U`uzV8`h z-usQ;dyg@0n&!AX0`T4wLWW`3jVh(0fJl?I))-?U#BQ`GinzYVe8yOw=LZSj9qz0| z2%)G5mn6D<4$?GTmSy7vfN7fEON=q+{Fjp~g!sDGrgKtCrPQS+55s^En&){pnq}G5 zYbu10Qr3078wG$rc`sfJysqrGu`D)>mLGzR(iTPhIkx*JMADRiz1J!@oBLn&RdPDHyWo+;L~yS-oU(- z$y>mB1M_zSgXyg45(PI}|74r+KY2bow}(;tYtvCB2F8C3ALdOL+_?3a#Okd|i>3%M z?D?+9qUhq~nVs7+bE`!9rfYTb+DjQ6dOm*nbyoe+oXOpCMHd&&`5blNZT@4eg!v4o z7RfVxx%Y6F?K8(M%bAqqPClL!?8Vp+bjs5F{f3LToEVtau-7m&O*xwCIAz;rpraW) MUHx3vIVCg!08tuZVE_OC literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/ui.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/ui.png new file mode 100644 index 0000000000000000000000000000000000000000..f69e3f857e6a7c7e11ecaed284b3bd53d33a5e8e GIT binary patch literal 212 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysqrbJlJhvnZfYv8Rh;h{y5dKmY&RGwU)6Gxr``!Ma$Chmkv?BmCBd3k44k zu{t{+{`~wrI}3}7ii*I}xAvL|e}8@D;o*6If4_Phcc!C?f&zoOd+@JL8VaB*=xJ3rrliQch`X{SN*7w$1Jv^_n@oOtS%Ezo)fPgg&ebxsLQ09cDc AmH+?% literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/uj.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/uj.png new file mode 100644 index 0000000000000000000000000000000000000000..ffefb31042c96f3fdd04d151cfe32eb1f9007674 GIT binary patch literal 242 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysqrbBPyPQO!W1iJmTwAs)xyUOULktiZt`sfJysqrb7Pljiw^^Zet5b#hIkx*JMH4c76qQRo3nKttQW9&Enu-a5z$zZ5Ve8n zjf3?8J|FfB)=P}P51ct`duQd2(}&M~*zc$y&&hdMx#d97tM1e=Mv(*d3^x5|qh9CU zws?Nda_!bBpKdRivg-A%YJLW3a%;;MvbLcdMluIs`VpuYUjcIisQRWs_C`0YgQgEmnQWGEv!*$=7Zb z_?G`#kQ;sOXC}MLUCm$@ACD`0{rWnirm1?f^cZTYGMM-l#|17wF79+B{QdKzR?i>p o5jZ4K{NQ2WK3&!ThM$c33B8}g^nX{^0mFd7)78&qol`;+0Hh>|(f|Me literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/ul.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/ul.png new file mode 100644 index 0000000000000000000000000000000000000000..47d868a0cbacd1e3148c7fca84eb9a9f820e9b73 GIT binary patch literal 228 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysqr3!c)9Nrph7W=|K#5Rc<;uN~xVP~c&`kadUMt(midGeP9W0%ZfIn+v2L z99+z9x{=-Y|HhwZy%iL7iv1>>;W`xP(8$klJN2-o`LPYxlolB-oASwLhPjZ_j+-{_ z`jL(MnYV^TF8Hp;VX*mupyB54|K=XoJ9Z1opD; Xzgk3!mmjtPI)}m2)z4*}Q$iB}sSQvX literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/um.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/um.png new file mode 100644 index 0000000000000000000000000000000000000000..c45333e6034076b8fabc626ab19d9e2314ee5655 GIT binary patch literal 368 zcmV-$0gwKPP)SfD)zy zDM2c5tN==&153~j&w1L?qfATgU;b#+%CE^(g758(smp9zm?n#h&$LoSXR za0C81Kqbsw&H}x~>;zwbq1?zVA17c>hF7sjll5 zrvQKuLMiY`p(Q|imJmYn&zS(m7yzV8c<=Z4=Wwf#Qmz%mIRHd-&h51S0l;iW z04R#W7_&bCZ+ejsf>H_q*4nxGXsy%OTC0>wH=D)Rc--HX8*l@z2mAt)S@#guVlb=# O0000`sfJysqr3-cq%)uKS5kDe}$As)xyPCIzEMM0o7-TePu%|^aCLR*;LHbgWAFh(#= zX%O{bzttprqcMu{f9dA5tIc;Rj=MkbPOF$)*(#v0?4Cd*=L7~$h7aX+IxRDvOER=2 zIvnw@zhBO9V$+$Z>TfPPCIxAoFFyBkdVY`Lv6#61p-RtV?ti~*Qaj7V#pV2$hK^g? za%ZU}P2PI#^{%Y7$&3OQEz{S=PE);RzV`L3jwMqBiyzGSe6RX_GNVMYm!{^^ZMhpK z>9lYt#CElQ=nO#+dy!WsF@NG|st{^3jhmVvLP3R{=3b zLdY--E0a>XGEV~X=cJTMsr>WNS_>f#_nuX~bZxQL=C;|HzLlzSFDifnfL~)P?e{fw RnV|px002ovPDHLkV1j#yn6>}_ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/up.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/up.png new file mode 100644 index 0000000000000000000000000000000000000000..d48be7b8cfb41d25ad1e53532bd9c29a7dc776bc GIT binary patch literal 280 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysqrOX>Fu)V2eKwtKobhIkx*J8dIxivf@8T;bXq3ilKw8wEEpYNs@B;MA^Y zu3%M5U^Q}F=U_Egqwjzw>!kXphrVh5`I;K))i|xnF`3hWfr;UTpS2Um=}im`hHQe{ zbA!DUA6fL(-k&e*)tc1Pes0R7t!49`U%olJVeZ1Mao4|ofAd$G=kSDLwMEBwb7Biq17(8A5T-G@yGywqEYH9}n literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/uq.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/uq.png new file mode 100644 index 0000000000000000000000000000000000000000..d20612bf0e3f1f77cf23b2f812d1e18c0b5b66d6 GIT binary patch literal 425 zcmV;a0apHrP)SD+F!N8m#Tem}y2FQc z0WQFKeeFEwoO8|*LgslUgaAO(G-;7h+##h@UDvNWh)5|##O$|uK-YDg^W{Dw7DW+4 zI0f+D1Hjr%>$?7t+1mgqC8cyNYK#GZ?IiBm+A_x0qCyA&===V7n~vl7cs$mksf(s* z`o~5qiemeM0I-o_9#B=)2EaK702@Wh8_ik^0N(qx9{bfI?-{KuOQlp=Ypsnj#+Vpm z2!RliHFF*iLZFlyV-V3=o6_>$mu0E7{)17G7)mKAW!tvNU!3zjgJ>_{wItSBM0`G4 zdbi_FURqZO!5EvSX&8p&vU#4*j_akg)`SotM7GWc0na(ub=~%{+x2I60Z!{1>qGYX Tagem$00000NkvXXu0mjfbHTL+ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/ur.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/ur.png new file mode 100644 index 0000000000000000000000000000000000000000..e812c3186f8143411f9e41e603b163045099ea97 GIT binary patch literal 336 zcmV-W0k8gvP)S3m_HX z65Ii#lCl65ahgz#@sV~)79nb;) z0Py|RgNXKhS4tUU06;{>akSPt=WY?|4SDaco~4u!g0;4k@;3I#6KSo92oa}gYM2A( z95XX>D}dJeJevSwjPpDLz~=$XOhf<>WBfpwo=Pbxr9>p9bmX~JnbulE2#9zm_95W- z2bX1O(g)XMw4FsF(hy*+J#VnC>+>Xg?-B8sdfT?0_MEdZCg+@UzS>_j{AFzs5oQK} iU)pWxdr=2;fcgOyy_CfoKG2r{0000)FhWKkBV>cH0VBW$WCPfM9x6Rmd6DW$yhEk@H!NG9jg7_7T4V3j2Ya(_ zzzz5ZfKQ@dO38Z<04XIQgfYf@Z;bgpvJn(Q&{{u_rIdM|rIeId5O8IGtG4=#p z7HX}f#FCoKIrrY5jMFrcx<|=kSr!1;wyphLjOb^r{Z2?JwXSQ7YXyKlW6BtF&Yc=ge95F`H_x+D z$`~__BO)HhvG4n3S+5!>-9H9Xw^q8o4n*cXu0RV)r0LO1{b002ov JPDHLkV1l=yjwJv9 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/ut.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/ut.png new file mode 100644 index 0000000000000000000000000000000000000000..d897d27c64780aa6b2917b04be971d4991fb5c21 GIT binary patch literal 259 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysqrE4@i}8^eJ@i#%N%Lp+YZopzAZS&^r$c4_(M&b$P-0v7WNyl2#Qb*_HF zmY2ZKTG@UrT&_an$^O48zgk;5j!QVdx#FB7#w>AwL2=&ef^$2!Zadd$xb9H0X0nf0 zX4Lz=L0Pwgx~3G>9(L_sv-RB0OhyKVWv)jA4&9SfNLu^V?m^7^?Jf6y|5cp-`*UDa zcAN>@AKM3ybZ2>K3SO*!@5JHq`sfJysqrYmP__*4IFx6P_-PAs)xyPP@o?SV5poU-f+O^oddj+cx4U> z8Z}8CyZS$0zdOIPSf`|95iD*I$&+wEp5fKw2z3} z-(2jMUHg4|E;EDXQv)7%{{X+*`}TXE?frf){qfi1_2FKH;)V~x8Js$b8Q1@^UE0zS z&ycZp_A*aR+aIrYO=I}9xT(X5Blq^ZxrH*xJ*qbs1zs$bWspc-v(>3XLRm>F*=y6) p==6GZdd>S literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/uv.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/uv.png new file mode 100644 index 0000000000000000000000000000000000000000..8d6cd3bbdea1f593e8b09140f47ea859542679af GIT binary patch literal 361 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysqrYgv=84}l_#9G)(YAs)xyPK)hrF%USue0nuI`xQnD4ZZ^h6&Tq)fHaUJ zRNx@HMPo*7hLc(K?tl}M?l}MVU&8!(wttYDOTqHG2WhMh3@i)>-uJCtrFBe#K_dCq zwx@IKqhIfeyM8sQyCXHS?u*mzNkQ-SD7QpROTB-X@qh#~L+tgvTkEXs85NXVbh;j` z{eJkvUIs5sh99rJy*%Zt<}I>0KUwAF?|(l7vj1NC-0fSIHLI<-PO)Y^&z(J4YnNy4 z+Qc!hkwa17qAma72bbgStK}O%HhULRTjTv?m5A#_i@s~OEc*7xD{U8uoaU(+D;Iz6 zz~7o@mHP~tmAo#8XqLX3T+HzQ;msq5j%qXfvwy&-#=UdFKl4A1z(8T}boFyt=akR{ E0N?qLH2?qr literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/uw.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/uw.png new file mode 100644 index 0000000000000000000000000000000000000000..0d5f3890cb01ceade5bb9d1b17eb32a5feb383ae GIT binary patch literal 442 zcmV;r0Y(0aP)YnB{xewo;FEDTB%?vSd&cP?~1s}#O za0}c50N*d!vMiG%0RUr+Qp%HB>#pn4G+maZX&TPC=li}N$B|M>2zXl! z$aP%-V45bxw{6?D?aMg30@E}Bz`Cx8CxkRjgGedmUYy+?aLx%K!5@!p+ZbcxIHJRp z(ko3CLLdRHb>H{PvTWNHNNerIDH1}=^NjB2dH#4jVqv9JX!vP?*d=SNw}NwyD!XVA zilvkiLhMzx3wH=9WjGU$3L(UQ4#QxKIf(G40-rK6B<_Fk?c65E<`zZaV|lS)T~$@T za>>1el#)`4R>>Fx0CinIZ{j(Ne6rSBl&r5zYt0zD^4P^-jAdCC`xDymHx~If?wK^k k9M6wOa{qYU0{>s&2kbm4AE-gYjQ{`u07*qoM6N<$f}$t8hyVZp literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/ux.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/ux.png new file mode 100644 index 0000000000000000000000000000000000000000..024bade9b32aa3d20452de9f458bc00beba8f155 GIT binary patch literal 374 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysrW20;d64HX6kMo~`}#}JR>Z>L@CZBY<$y`S?<-b!LE!`lOV8<<}>SRdfi zU<49S_6&X@<3h8p$zRX^KK@j-z5Jo7jT1+~(z*vpcN?S&m>KHIzx~=L-==uJ__<7S zPqEzJ%6XR0QzOrP_R);}yI-{I>0b2~5!a0$mrm(1d|zuJBoh{q&FGN*H;+rvX_mrL z4~|B|xbv&0%v$!+o>7s-$s_jqM#ZHe9${Juv(#E9Ofj;ZQ`}Ioks)F2Uao|mO1t@? zp>vs*@ZH*^b8cs$%-XH7*XPdI@}=gH_NA!#TwFqj4Uety_ImmJMJ@k_d)}Jnd`=o4 zEoGTCmd;P(d9` literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/uy.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/uy.png new file mode 100644 index 0000000000000000000000000000000000000000..cfa70de56d26d1a4158a9fb9759877fd01d17a68 GIT binary patch literal 341 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysrW28F=48gf9PFP<)rAs)xyPP@CdMM0po{p>zxc0cxM37pd$IBztTIdEpM z9^ukyj9`pl+}L!JJ^swS*Y}@QP4>0$Z#jHsy38RKH^~Yg=YW& literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/uz.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/uz.png new file mode 100644 index 0000000000000000000000000000000000000000..8d1fcc83fe1d05564a170ac03ede1fc843b345e8 GIT binary patch literal 366 zcmV-!0g?WRP)VI0003ENkl649ELj?j1(Z z319==fDs%)H^2?l4R8Y707t+HU<25|@4@6^_>!~6^WhTzPo!!43oR|LbzR|3eZkFo z01x0F0KPF!N~v)iw=-jmQVIYu#${Qglx1071$gg62z}r0bG2>joa3Ay1g{7QA)Ir2 zi*pVDwAP2QD1ekQu@priguuk2N|a?;(h_T}wHDRo^`t@wl+v#2kp8CuRaG&@@c!oj z#uxxF#@q#9jMa6WRP4_HQc6NdlJWC_CBm)>@BJ_gN~vv(@p>WuRrpMF0Q* literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/v.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/v.png new file mode 100644 index 0000000000000000000000000000000000000000..0ad4cd8a334f33a21d9548486e4f6c2a2129e8bf GIT binary patch literal 301 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysrWPJ_8KnvH=%XFOdTLp+YZopzA7Re`7Nba(mP19=BHHZ&@qV6$qPeS&Qb zgRp^<`vu-#d@9FgKYeiY!+fbr&$Rz4E|?*C?+Slh7_*53a}DDK+q9h9%cd|fB=>9; zV@T@JRArd)TvAZ}Rpf%qS<_N?u9rye@CedodNSvD;hyzxexEaHH1N-sb z?Cl$O{c3gmqt7<;-Q%A!8p|KQ_}x}e@Zwg{&MALfi_a-4DOo+&I=6Dq^rWqK?paON wU;Xr3SpSL});!KveZ$^{Uu59@z<5CZxsQwKY$3%2puZSAUHx3vIVCg!0Gt7FhyVZp literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/w.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/w.png new file mode 100644 index 0000000000000000000000000000000000000000..c6edcb49b5f460c2664587157b62cd46b45ed5ba GIT binary patch literal 339 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysrWE@6>N3!8vKpFCY0Lp+YZoqCYBMM1!|{p`Jk%r6fJX)sz{@Y}%b9iV-I zZwvEVhP4TA8f<->Y~FCS-?jb7pR!Nj{uzGGGu8b2uQ1oG;W^R3^Mm<8<>u=qyvaNa zt5z{JBuc#4y;Y3i*FO6`#JYmrh!w8{qZXX8mig-u9XMgawx_nZmVAqib8PFyr|tn!Sd<_r`sfJysrWZn@%$H+4XvbDl1aAs)xyUOmX$q9DL};d~nR2IdzBgf_5PH}D-3deb1Z zf!TWli!e`gL?$O0yQhWD3cA6sZGWr)b$ zy^h(y_wu$}hB?K@W=#G(Y2p;2hSJ#YMUi69?*#ty6H`z!bjx1bVNlHBxM}gH_~7@o zmrah%NR;4en{c1oID2h!PtYVLg{2}+7oyVd)kz*WQ~mz4&Gy{WXTq7z__(-xy4?GH xnnCGS`tQ9=3*P^pQ@P@odiVk+(I3nYm^V4Joa|Oy`VQzb22WQ%mvv4FO#nNkab^Gj literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/y.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/y.png new file mode 100644 index 0000000000000000000000000000000000000000..98c8626b14f31920ca63cb8c34911db9b173174d GIT binary patch literal 329 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysrW9wrS7wQoS77oIMTAs)xyPCK}|uZ9lzZ+x77cS`HU9*$@4i^%rU;R(tbyzXaJ+=2j&BhbC1}Z_tIo= zII`|FL&E*MbUl*4xxzS?YC*|i9%Jdpui+W#s(01x|Czq(# z0#15@BCg7d?%Xq)ygqhUc8I~|;&;C{pRg>S_q^DthM~ga)}b?J{>Zp24f+}%!YIn{ ZKk1OKwfSF%SfHO7JYD@<);T3K0RU`Qfaw4L literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/z.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/char/rm/z.png new file mode 100644 index 0000000000000000000000000000000000000000..644a5b3158bab6d2441751b15836855112cc0d58 GIT binary patch literal 292 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sfJysrW9*L___j`ashdo^!Lp+YZz3Rw&L_vV{LfK}f0teZKW;WKT418V8Dj`fk zR-p|nT}%ZBfX@E3 kUiPKGS_1>qKZYL++P_^-R9%kp2Z}Rzy85}Sb4q9e06MK|egFUf literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/frac/1.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/frac/1.png new file mode 100644 index 0000000000000000000000000000000000000000..3894249db8e513cde9912875bba551de948fdb46 GIT binary patch literal 965 zcmV;$13LVPP)7S}9L000AINkl^N*{QcFhN`G*0aB*?*=k4Dpgb+~_r>Cc# zQ2v1Q@pxPi1bZJ>u5fo_xXH^q6mU8Gc!X7iN#`pKmY(jq0q|8 z3IOcx?p|MCQ=XnQO}o3hGYmsj)mSWsh?Po(<2XbV1R)-eBVr7?Xs8*{y&jUaFn&3Wtr!Bzu%9D(P(sWaS;)>x3`ywQS^Gf{r&y+rT+Q(d17LMCTP80cez~l z8zv%tetvd$chk)J_4W0`!$W(YR4VoD&iP{ztyC%<9UVPAJ@$t*NsaR0S=m$`}PkK?=y3`{njE{-7?_ukIf*!9Ul;JEqm_KWEo1Y9lzS>Jb9Q_If! z_K4RToh_R#UOJ?{L7-cNEw`!HDM-Ue^&bc+0&w(haY}$w_desRqpL=x!JSY z1SYAR?4KvPE#Ugs8aw$jEa7)^e`sI$TbD1_ci7<2 zn%7^etmeLpI+}E`Q07!p&&Jog*1i6hBFCoErw|l$GX472kyVGFT%AnNb}LSVY|9D5tn|__dEZd0=`P*m9 zYpQw%tqnV@f1z1+?e*7*(=uo6jeGCCDQM-3U4D^ox}R4bdg#jPHLvQj$$pj1H+58G1+<}}SbnQ|#>t44S8C6lw&i-f-DA7ZYzkjdMAd%m6QqMcJzgg8Ti z;Hd?lqKO30pB*uJ#xr~3D{bT^pG=96pO)$x=)zGb^L_8b95e21RnIDdM2>FKIlW25 z^`J!eq8IMxKWWcC`>blO+7_;LyKYZdbK>3Nl_6e%Q?ADzR%W)He_rSGK1Pi_cNlR* d;J>MMj7v<+T&BDbumvV922WQ%mvv4FO#qE@B{={9 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/frac/3.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/frac/3.png new file mode 100644 index 0000000000000000000000000000000000000000..fad9d20cfe5e5b62a221a7ce9847dca79eae0e80 GIT binary patch literal 596 zcmV-a0;~OrP)H}S_Bo$H_!nbQ-+;jDu5E`06Op=m|+}7Bbtz?**&e|;1ia&Z`WcN1~`KK!9fgxB2Wa1 zKoKYcMW6_D_dxr;Cxm#XC<=cwIE0YC@5fG7E6$)tyRI|FEKXsJ>ADVM^h{f?wRX-e zPT`!>T4Rjj*5|Te-rBa6QVvTdrEJ@F$ZU{fQYobnB3yFL!w07ieF7-we7sixz&T$# zv;yd^w!Zk?-jmk)dcAJr0mc|(Y&B5ESjzjf*3s-)cIio2D5b2mi_v4PRZ8WK(Pt}K z*R@Zf&bi0q5!7^)4vaB%U4Ju1LlQT}csM=pizb5F)htecM0O1?fYPUBYvdTBfS1s;U;#$^Cx6-EL96HKqbWNT{pQhYneV zo+3s!Hy}O@G_gP{%W|?DL*cydpAGm!?2{`RjL!B2WbSiv0udZFR4YSI^i00000heao;{}ayT3S z5R1iFZ;8d?FLT1-FaW&1zB0|Cq9UWwm}-yi@9&qFm*Y6jdh7E6Wu({Zo0^*Vd_HqP zL!ppDp-A>#nw*>*sZ^TKHA*&US|lZpkB@I} zZ=B;yZf-8~7D&2B=jP^aZ*RGQQWUkewpLM5fwumydU$x)+uMsoA_|3~wzf8XGkiXu zpO=@nu&|Ksbv=&brKP0+kPLTzbIo*od`u9;5BO4Ix7#_Vn@PX*7K`Ql{9GgwwY0P- zl}eY(RZ~;Lj_Pzek|do@r$(bOnM^p2UtC-q92}%N&C}_0-QC@cJwHGHWwouXEw9&0 z)AZHV6#%&1Zj;IMxq3-a_T=;Vn5e`wmzS3bg7`dPdU~2M%w{uNPBG{y1sxn5l*wdl zlOTwtr6soc@$tdhDwRs5QYDx)atF=I%F=4JzZU{>KXGR=*RjZ~M*Wo2b-#F&_vsH&<00I%1}mU|e60l?1A4gfG8q;_|A z+uGW=JuXA7R&)DhdwcuH$Vfp!!OF_Y=H{kWtHm&^va(Vtl>$H{61lm#;qiExnVCYN z(Bttq91ej%z&+3=cyxlnAbWM#2*8ML! hB2Wa1KoRIa>ldJcqhTm*w2%M*002ovPDHLkV1ftF2Y&zn literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/frac/c2.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/frac/c2.png new file mode 100644 index 0000000000000000000000000000000000000000..a8c95a87123b926713695f00e1ccf64b5821debb GIT binary patch literal 1077 zcmV-51j_q~P)Bqd&dvD&({&wHY&b(O;gb-AMa6yF#2F0Kl6oX<=42nT9C@HZ*OlQgakn} zH#e6r==}UVQog>v005Vlm)SA9ySv-l+vy(kZ0v!0JRXn7lQO5Krerc%MvTE=@caEL zm1=Em4S6gUi$EYK;C6-2dYjGG+1Z&g^?LpF_4U=&ReDS$5|K)!UavP6iy@E86aD@DDKi)hhC(4UDrlNU&W47Dy}dp5QlCm?x`e}F0D#Zu%ZTji z>OwlhFaUt}_ji_39|#26+S;=Hb#-+Lg+irLr8^xChg>d4y3^?t2n1rWn5ERu&dz?< z6p2It0HIJQ<&j7vXJ=1%<}Sb%G78yRaI5(?d@{8oM9L~ zpZ^DI{m94@%4yi=c-m`tYX>S_Rh z-EQC6*%6DyKaZK;9HaTl=jSH?pr)p#$bL!=`dgCU=gD9&oS&Z;f7e(nw!gnG6beiA zMroRk$K$_JR*1!7E|<${>R(=7nwpx*y|{aNdXh?|6;Oqqo}M-~Hm zx7!_$$45s;lgVWHmdmIFMKdGk4z(F8~}4N6Jhj5;r$DNLMPAN~MzRF`7suva<{! z)ai6BEiE}Okw_#~tCej~y27@6Qjs6_d(a|wDI7rj9$z);}W?^B0qNu~eLq4Cc)9L>6jWhl$ vfY* literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/frac/c4.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/frac/c4.png new file mode 100644 index 0000000000000000000000000000000000000000..74c5cdfe2e677593d0fd24cc0f6d506a0a9ca6f5 GIT binary patch literal 1124 zcmV-q1e^PbP)h|<2K3Z>C#e!su2t}a{i{#CnPB9Vy2;xx*& zwY8m{om9`|Vo129H@$r$zb|xa5zq7!0OzIGs*DpPxEFp-{+VGD7=&z6^u%`KfogTrDjv zWHS&5NTt%$0o&W#GMS9fHk(Z-6jJjD<#M@9CX;Ngudna!?xqfiL?TU1O@y}F?HMi5 z%-87q`#XftZnvw|>a^b4+FF~<1|i(q+5!Ohe7;QXmC=EZ2&Ak=XZB^d3kx?A}RT!Jv}`!7>wN9+;5aUecw{V zY&M%rrceCv_4W1O;Nb5?6vHqw+xWM8x45{NvZ?oYJUEW?c)YT*vhSNX8w>^v!;X%Q z1Omaz%1X8tY34_!TrP*%w=aljC=`mtVn5(bi9(@hY;4T>`IPyjJU>4J0LI3~()_o# zw~LF5XJ=;+LXXEYKR+Lj$3I>5XS(YrCnq@^PE}P^UteD=7Aq+!A^Z-9BODHoj*dzs z5|Kz$Q&Ur3UOq4|5Rbot~bu*=(g!`M*e<(N_@!ia-%4 q0!5$*6oDd81d2crC<6Ttfc^##Mp87^nZJSn0000S=51)mYdzBso1Cy4gi(^Q}y|*{4S3hzPVR+za5T`35=-S<(z{PdYX-$qx z$BoXWsjUhfW>FojQ|+B{*66reA9VA0y;$_fAt%9uez_)(np5&7y1o&V zW~#{8sTr#qCmI}kA=~7dFT}vA;lRih(7+_J0K&Xb&#+2)cAnA97bW&jLqbgjI3je! zq84nwefItL>b>_azibgmiY(iGcUO$w6NUlVOpYV zV>Lv?x>*lC;rSyE^h0LU*PSu%YV7{MTDM4JYm}~3@4vsH^;UC3LjRs+R-63t@#Dw) zHT+e$?T*bzoDsHq>;3o18zYn^E+`2uvXGf{@=4LoJ8#PtX?(KLKW((~iORy6KF_kR zKP))%xKL^#$HEe;zpt{SMS@Oxp1W9MC(qX&AGHdYskQ&<)$T< iFr&p+K*K)yFT(8CKZtES;$jI*NDQ8?elF{r5}E*BMj2)R literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/func/1.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/func/1.png new file mode 100644 index 0000000000000000000000000000000000000000..3654ff91c867daf6eabdb97f02ee3ac19116b676 GIT binary patch literal 918 zcmeAS@N?(olHy`uVBq!ia0vp^7C`LH!2~2%1zlDHQk(@Ik;M!Q+`=Ht$S`Y;1W=H@ z#M9T6{T_<|yQ)RY@rW1(24+)F7srr{dv9mjdb|!0Iqv`J^I}og?(VBgIrMgkZ+Y-Q z&FY1MlGB|#C1MA)EG#;@tvW1zgtCjuw(#*Sbvn3f>V+nSur)J0cn_M~ny_VWK1a)i zYf`5BzCW33{B%zByR-ep@9f#5x&)Z)59WMu=5Z7h!H(>Ce{HW@{mUT3Z1z%(R}UUM zh-Y8BX3dh!U8`5WzP!H2Z83v_XOPiMmIeEZKfZP8&>^PNn-(u#eE06%C>05wd2{D}wAsIJUtLYj8V#<) z2Ael;4h;=Gs_s2$%eHN1wzhx8UOar5=K4`3-o0}t=WVN|qFUeMxcKRQGGx^Qjoo+Wc`fboKlilg{Q2{#THil?QaZh9Wf#+dw{O?3S{1i` z`l1#4_Sr4JoOw0o#PiQG$EV&r@wvuouGv>vQP)6$ma}JlT>~rTmG6w%yLWHcO1sG? z=ggTi#gn7`@W+ZfA+P1-<)1%)-YdBL^3RLcu3xz_C1>x{q)j(-R`y~Z)!N+WpSJ_YnE2<#i>)LUcMY0Ec(&#CzySvZfel_hs%pV{(=T@w*4M9Jwd(fU zYwee>FAp)By?5u%%>4X%ZN-^Bx88nRwrtt=qf550*}66Kcgm}R`1wo2x?b+?O_Xr* zu$sGX_ip8un3$N1qAPb!pZ4CI^egZ7jT;ON?d|QKKNmAZ#Ko~SRM^PzwKFDUX0Cjq n$MrwfEr7)pE4uJs_KUgM)w27srr{dv9m#_Wm3oam?SzRW*b&#AS(v*F}4$f{$Ig zB?3|A?BcBY3K^v$>QlR%1s67#ePHVHie-`Q3JJ)%#C5Mti(_rBlT*uw**+t)mtaP!J;&g!>MDD#^jSOlT>^!b0}`U zxhAUr_~er*UVk?Dm6w;#ojZ47Ku79LAXvU!-RAVBHJ4weM1K4Du`ng&$)iV1=k;`S zSehOC9 z)2B~Y)b783|L)zj(;k1^aW(7g)1s)d>gwGylC!g4zj?EU>BWs3GZZ-D8@6rRrl+Sj zE&EW?MiwSU8zH{-k3Ws=?D_;=y?8NW{(OHGp;PZY_sQG; zJzZT@A1kS_W3hsWMpI>+}yi&@5`5& zTVuk*x9{G)dg-lOw=}x6-fbwc0>)RXTy16LMc$Ck+AYhMFWF%R%%Bl_BHAHsp-Mg0I)%V|Yo@ELd~)aNmyaIH_Pf4vd|*8*I~{*wJ}Hi0cN!9B9TT*u() L>gTe~DWM4f&I!Ff literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/func/3.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/func/3.png new file mode 100644 index 0000000000000000000000000000000000000000..3fc2186ac8cbb7ae187e6b1f41a990feb3a1dc60 GIT binary patch literal 931 zcmV;U16=%xP)rP3Q&Lo6rcbF zC_n)UP=EsTUqI98v?z){0J^`we|2?L=!sLQ6wmVrp`)WCgit&lm#2at2!ikjXgC}; z8jXd9USD4a0s(}O$K#PE4F-cW4TVCXQ0UVEL=jb0Re~Up0!K2L)GxTdzn7=1+wG?4 zKp@cH-+z97jxpZZ*;!j#>*(l^pOw$&3x~riD=TKR*=#oFERxgd+}PMCD=W)nGTYnR zo12?YPfs;9HL5G>a=Gkwdr?u5){;9Mj-H+#y%jAkF8=uVkhVopq~o)*vvj+@zW(6g zAm_k%JZ`hu#>dC$uIA?E-QC?Uthan#Db%5=mmVRswY4Q}`~Cjb)>dUrUteEuZ!b;9 z#>R$*hEyrT!^4k{k2=<_t}c1{7kzYUYRYQ0O54@d)vvFw${IpQOG}G9O(v77zvgzk zOG`_2rkkIim#4q-hq_#@xw*MWBx1AKqR}YJvdS7!6qWa`YVbU7GMNkp&6SEqqvhr0 zdA*r1#<5t8rdF#JV>~l6GcYjF-rlbDQpoe8z|zu^>NTMu^(j55D2mdFVvH{@FQvhS zg@sfqH8L_Hr7X*4G8u%>;^N}h`l!d_F_}zSdkG<{tE=*JR)N;l)m>a%AcQ!MYiw+k z25)a~D=RB$&GGRu$8iXuY&I)DHs^jY7z|n$x3jbJ;o(6G$}mh*Qxn55dhKa%Z?CPb z?d0TSdU~1;zP-KG*49o=PDUb;<>lp@o12D)hKY%Z_4RdHGdMVCG#V=^D!g7VA;jzT zS}c~5l9JKUQROU&L?WBb>OA#1od;>v@jR~_e13k8#bUJ2y}!R}bw2%+5OQ{QmQJU2 zpofQtc|i*uPNx%NtW(h4-ThxcUtV4~j-x9l2!cGlySqyy5?^fi-y1y7>;HQ?Jw5&O zc)_<&fC3bt00k&O0SZun0u-PC1t>rP3Q&Lo6rkT5zX4>ZCm)Tw9Kiqp002ovPDHLk FV1hvCtsDRV literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/func/4.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/func/4.png new file mode 100644 index 0000000000000000000000000000000000000000..6f528dbf975e917eadde81809ad3ab663a78e272 GIT binary patch literal 880 zcmeAS@N?(olHy`uVBq!ia0vp^7C`LH!2~2%1zlDHQk(@Ik;M!Q+`=Ht$S`Y;1W=H@ z#M9T6{T_<|yN3Lfuu#IaXfu(gw@IiiX5M&Oy|3Ke?r3a z7ra&;0u`^4Qrd-H2TWJlCE;4;(ZQ2{SII`@#?j<}=?+sO#8N(|9v6=ZD%^hfkU`Gt zs6Q{#4}P{iVe|Q^q`k4#=JR}uHMo9p8!fa~VqguxfiC2G6x*lQ#9o)bFnRLi+qa|J z66g4-%bq)TPO0V4!w;W7Z&qu4d3tN|>Z?H_t*JMIR;Fyesp2UmA(0R%mYlOSO4UiOsI-@Ti4Hf{IacO_O*;ggoMx3f1-6c-ogy_2x0 zUcTXa^|k8o!wm`?K+%m6J=@I8%;ebS$J3&&y4`brg8v;yFpc z>1NKi<#oR*Z1T27?e6{b@1LESS(`vqRFsvi?bOtn5f?MAOF3qt-U2NXCr+Ff9cMdr%j{V~$0`yN9iLyh`r_Ze zxXb?M|9$u{VcWLt+npCqxaFrJ#Mb$L$IOzjlB%j(DMm{#XI2?KfBrmccZ5#b=E$VV zy>UGoZ2{v02BQ9g8O(8dUzS*}YDXKl?goBcc9_Gpsf<5!)Jcf<$UPAu}=UX^7c trE{8(kMEnjNSrH!hyx>5^hNw7vpHA88@1HxbYN~_@O1TaS?83{1OP2(k}v=O literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/func/5.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/func/5.png new file mode 100644 index 0000000000000000000000000000000000000000..e22d59278cf4d3e295d481848a2ec245d5281ecd GIT binary patch literal 904 zcmeAS@N?(olHy`uVBq!ia0vp^7C`LH!2~2%1zlDHQk(@Ik;M!Q+`=Ht$S`Y;1W=H@ z#M9T6{T_<|yC(PaMP+Ub49x1DE{-7?_ukI1^>`g1a{T>T5s@ib8~t{r6%_;r+_BP% zIC${n(W8!u32>KcC-u^6$mo=TC%kB-nm&Zdxd>#K0PW16|mp;u)kh)rn*7ym_;7Eo9s{ zRE0X1FJGR|SXEIW(S20FNn2YxZTGHST>@Ne&6{+d-)Z`PI{kQwRcv^8cv8cvRebG- zrM|p*<0EnuC>9#}w7}xlty?jA;-|H`9)15k*KfIs=j6$g%XZ(b$v2w$@_b)e8eDdkj zroDUTM#Wx_)tkQVbH+hC$efTgj`@-zm(k%k#KVQFoy)7|i z^Udqm!)JB5Ew=1_@csAQJo8>w#|^jNK6`WL&Yj=CtN)4QbaHuJ|JvTpo*i)5z-eKC zyF2?`>1VkcwrvZGjorI@xAvbf1%VqkZ!Wxf^r&m!<5Q8xf!-FnxqbWg0*f5ps*;i; zk33Wk72f&v%WCWG+qWeiCkg+k*#``(B8T677`tZvpY46{?+qHZ5 z+1)^|UbL~3>b>L;IOWf)Jv(-s*y+TPxc}*Dhr{bvu8fR|N}48c>CT-qZ_b=K^W(>k zoex``6s62fOul^o4)pZq90LiJmM7ctdZMGE434Sp%JKK_FFhz3AI5Ykk^XB=fO>S;(UZkPbWn^TObdHaQ$HdI6thCfsNpSh)mme!W1qQ7QsjaOw z3~=gLwQ6U6OOvZRbD)UvOrMQgJB~lTnX@gz^vL6n^>IG&3(jjU)1RPoddt*H`^_eL z1XS16`Mo`Ty1Ue{w(;AyZ(eieef$1h)$^Cwa&?P`%o+_$I8a^8eukUk3ev^_wUxkJ O#Ng@b=d#Wzp$P!Esi%7Y literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/func/6.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/func/6.png new file mode 100644 index 0000000000000000000000000000000000000000..2eed1bcd0533a3b6ecfc54f6f9d1cab3ef4c81f7 GIT binary patch literal 893 zcmeAS@N?(olHy`uVBq!ia0vp^7C`LH!2~2%1zlDHQk(@Ik;M!Q+`=Ht$S`Y;1W=H@ z#M9T6{T_<|yQco?g_EW;Ffhw_x;Tbp+8!9J5xLWz|wEaqfp;vT?p5&*yg* z$-47w9?rRH`@H`B&ixP1S>BQK3KTKn`NqxL$*9r5gaawH1nj;m$9G}zV&%`A{{H@p zG?ZF4-PCdFcx(|UVm+77_wp)hj)1nrGwLcrob#RwIxSzmoMWMf%AwCStFKzw+lR*{ zaemeR*B=xzf6M##@A=vfdrVE;c{8W4w>PtS|Mzd-z684l-no1CsKoKdh3l_pZ;a6B zx|Ao()oRhVd-v|ybLMP`TDwZ5*R9s>{_*4PyYKe7E!H`G?#!7NpY?%2S68wzsps&+ z4{zSQi4Sy5|5n zojZT7ZQH+fYv}5$f9mR2h6uS9=H~jYW@BQUe%jRDe!k!G%vpAJc52h+&z&0^7su9o zu)V$g>(|oSf7h>H|M;;``GVi_%UN5uyp^0eJ$+-upI^U>g1B3oPJZ;96tXs~_ezLX z>ZbJy91@TJ)s`@9+p!~K(X*nR&CSjKnYIM2bP0 Hl+XkKMhBl+ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/func/c1.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/func/c1.png new file mode 100644 index 0000000000000000000000000000000000000000..d797cb8341215b0d5ec100495ae914f7f342f376 GIT binary patch literal 857 zcmV-f1E&0mP)T5g zNu1PH(a@qp8X;7RgIw{TrU=5Nz$J*lL8MGEA{rVTqK2!6A{!eV5`vaMiEs-WR2mwR zK#M#v^!&f!c*mh-zPtB$#QVPK`~H4>{O<4n?gR;?6uv{~;F|3Ul zm25Vv*Xz|lkB^Vf&(DX3h8TufUtbRfgVH)7#OL$rbh^#WO}Y8{`r2x>_V)G`i^a3E zvrHzlw6qishd&#BbaXU3J1du&Oa=h@`}@`0OdQ84OTXW*EJLACC=_bG!=llsvJ^$J zd9ok~05CW>_~TbN9F7*AFV5)2#l`FEYgbp7R8CAxv~%*Nr>EuIU@#O41(szSdakan z0O024rn|daT5-GG%?GL7um0fRz+^I6EEccVn@Xi7Cnwv18jZ#;d+zV=0YFv)z{$zU z;^LwjD5Z2^VWC_u`+Pn@5bSpQ;o;$*dKHyQrIC@5h7Dd`URDDoghV0{qtWPgyZ86^ z>-BnzEB@UOMNxU*Y;SLGY;351g(@F%gpjeZF%>34Nb{o2W~)}KQl3ty6N$vy+M0Uk z<>h56m6GymwQ8|gl+V$8KL7UirhKfHN~MMgl}hE|;h}l*%*;$OnUr#u%azS$zqs1g ze~887@y^c9$HzxPNTE>hcs%k)tE;Po5K5`pY+hMe0f5`v+tbrilgU&p7U$>ZS(e?| z*|V6aetCj0p^J zF&HhujBFf)YOzl zqxoJ7{NE3r=T}x%5JDK^R4Uck*=ey@zT4z)K(DT@>gwta4-ZMYyu3_NlpqM-YNGtZ zOozka*Vk8uVHk!fDJdcKY&Ls)d&~2DadELmqtR-$r2g{q^8EbFvTSK-DaUa&H8pZ8 zhGC3GV_{(-NlB2&WN4bEC<-BzNF)jh3iNt?EEeN9uBxhvVVHcsdY8*}aB!g4>sgld zcsz1_ettd_3h8t@j^o^JH$q5$o~G&A+FFFr;^Ja%D~4gbUTQBd9UUEYI-U9M(Qr6iQBgr+gpgLNC2=4SFq_TtV@F3vHk*ya z4Gj%)eRFg3s}&3c0xc~qkw}E3OG``1WD;XMH#bLG?eFhLqtSf#sMG1}>gxKv?r=El zcDtNDK0X?aMvmh!#vYGHrBe0x_it@&eWheswzs$U?Ck6xbwLoUR_of@+8_4l=S!c- zWIjGVey>ZClzTaWF_t7Lo6S-bWwBW9?(RA|I%a2Q?RNX8=jhDL%*4cm$z)04U+bPN$R8WHLz(7oX49+}teJPfkwcgJy7WP_DPNwTYsb z+c1?%t*)-hD?U9vEeOK<`}^_nu^ir zr?QTUj7(f9EP=Epypa2CZKmiI+fC3bt00k&O0SZun0`y-Q ZzW^ literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/func/c3.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/func/c3.png new file mode 100644 index 0000000000000000000000000000000000000000..0f55b7e17fa552ec9a97f0624582e5c8ab9c1c74 GIT binary patch literal 2532 zcmYM02{hE}8^?b%vP71|FcMSYW`we2C(F&ChGDYJSW_BX#+p5mNh$_eLbkDWiLs4j zcO^>(*E(EVDY;a#OvwN3p7THVch38J&w0*s&ig*k`+PsoL&jYBosUPH2ZA6z)5}Iy zU?+oR#>Ec)eI6I2!N%=(*^UH3M~?kkY*5xSI52Vsm|7Tf&cXyZRTT;+Dn9_XSW_bd z>yW8`96Zgj7NWUU3BqwIMKyLJ($P{wyshM2xNsrg26p~ec{Mx87VWQD%ZCH zlT>5^n=0H||GHowVayttZFH~3M!B9NF)mV1hE8|-O-pV;yLC|G0%`5L?)K~j(qO8T z5E<%-zbD+pk$`}8@hu!?yB*tTpwE<&@)1zyN2vGW+j+kf3Pn(z2x)0)36ZUFxO#Ef!otGz^z=NvsKbziUSxAi%k0~?Jhy4~FbN zH*UC{P3+Ff%{5`7jt8&L+Td^^WFssVYiMYgoSZyFz~OKh%=3bRlqXLhg>YRx6zXBm zVt04}5{(LmhpoWN>E^Y{iqfhAvS1q$IJ+W zG4D^uRF;-T6FbsMmeLc|eP{RTyDO`!mG|P1$qAS8dHMOP$PQ6aQJOgfTU%Q^J|{Of zmqLkEegFQwot<4-dHJ2tP=h0ndp0&VXIdg&WoFtD2)UO}f7{p?85>hmRyH*?&HUW_ z@}&|Ag*tVrb9_8lmEy>){`4IFhfWvBR%TX~YdM`BYGBZw6(YhDhxxd^?(}?mb#=AC zgd9OFDGAk{Ju6F3Q4KIQ?p|kQ#l^?tY;0UshK8Q#OW7WKHz8zZW=3SRwY;=+Jt-z8 zw#Vr=v&gq6YNM|oJz*vEm`o;bum7z$=N=v|!Q-VC=HcNHlM7O2Wo5OswYBp{CsScw z=Fjtu(gIw-RpMw#LxVap(5si-L($E8ggSvOV%Z*tqz^GK}($doR&CP0w-Y;MLNTdrbG$7Oh3J?dl z!I9>V2=P8X4F5@86?OGIV$`=K?%C|Z!c&gJb8LDyDHKXZoDni9DQRF6XKf7=>p-oo zt?ld;c5yZLzVu+J@bmMB^hxSPq6D~L?Cs&zF-FMwJYI5jZDAo0zCDmMO;}X)hPyjT zBIfB`00e*vy-gW&3yWeZ^(WO)Hi%@5Wb{>}Caftx<}KPD#^1Xdp22h|QJb&|F8{ zk;IfHIY&G`?$UhTf`{GHbOM`L#0P^Ov{3 zf6au(arT(!6&3Oduixy2Y7=~Y6?JEw0~eAWUnkMrdX7GnG&VNw|2fwl`{TzQb8k;i zjqn{M=y_3*I|mbvKm-Q`U7~}JMx!+~*{=$I`t*q-^Gcz^yVAF**>3R(Yec#$bGsCcD){X6B!^1*c zuqaRM@sW|($u)qb?w%e+;%d$KkYB~^gP;5OS3x+0SwFHTzFoh1l|TKuar49p2@1xPrKP1o(V%4oR)zii2ZBb&$IZON zPn_U@{4Po~D=R8qH8thNf|9l{H=mKZAzs=V2sc>#3PkB-YJN=|nCx%jNC ztPVtLlq=5`~mO6peIxU{H{zre=rRQTdD|y&RgSkBx!bV1O4rNiH(g7P1Clwx5vlFUteEYk(%CgcXwwk5)1~tuhv3dmtI|64Tr;~ zX)20RC=~bw1+crjYqFQ8&2({b0bqG~nfG0PdU^`Ls!rA-UhegNzrVM)w_GlBozX_4 z@$&LAJw46)fq!{<31D(^l6TPa^K$^Rv$Nj=`uQ3i85wzgel`q)5W+PmA;jnNy}!S= zZhM3f>*?P5%1@um;-{VP96kXQ=I8qji#r^$#J9lqyuUITHtkJWxGXP^_W9B#NGa0?PxdAXYH|H2x zE|*iOl%1POrT*hT;S(>nxVQ-5=;+8Xl2Tf)*X`VTy-q1*n9=L&YXH$`)G<<3)l#Ws z=axz(RaIGSCQ50e(Qvbq+I$Oj*^?{{3=H)3_1U?jqodv3-K;YD`1lAQ5{bA8mL%!; z_}I=pIXRIei52Mm{XKyB`FS_Nfj}S>3IV88D!Q)MYPDLert5m8QUMSOg#v*9E7059 zTL9L^cYguQ=kv{GQ$k5P``ySn%7Ang!fQ5wx-iKsXfi5jA z@eXQT=wh)L@1TW3VQ_G;r>BQ^&|EIJva-VaAouC%3BcOg8mFLdZ*LC|57wlqtE(#< z4z~r=`8RK3V!{gZ`~8VT!fcbA5B#mIt^WT0NF=hkxyf`&@AcCk9v*gdbY!zxhVyyW zV@H0ECjlxz1*iZOpaN8Y3Qz$mKn17({Sy5FAlq(Wqn&6F00000NkvXXu0mjf&V-TN literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/int/2.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/int/2.png new file mode 100644 index 0000000000000000000000000000000000000000..09cb7f882c266d4f44fa14fd9e9d01009ded3ffd GIT binary patch literal 1148 zcmV-?1cUpDP)r6qN000CVNklB^;KP6E%As_6m@ubxVX58AL8|T8HUN} z<8(U38d08WbbEW7<2a+ysL^P2I$i!A!oqQ!Xq%MZ|Lg4RoS&aBr6XH!#?lv6)9H<$mzcs!mz z*PoxCVr?eix8L=8eU6f4S*O!!x7!gycDvo@^L>1L;HEU7Pft$(u)MsCepkv~qen+a z05Ci}T^*E3hQ+Z_&v!{IQV zD6A|fR9WvhJv{}0?(S|Opc4}l05Cp24geaBMy*!k8vvM`oD>K2{QMjM^m;vSN{`2b zZ~FTB0HC$C6*ueZ>Hxsya<#R!sZ=VV4!^gz7XXfrk9m8UL?V$$B#K$1(P**Upgd6g z-(s;CZ_r>c7z_rBSU2kaJ00v zd}Gz=bj2!yGDh_B@)AEw2q;a{G))(?Zf$L`EGsm7!aK?3av>=M%H2tCZ*M~0XSdtG zNvW2WmLidepepqF`MJ5dS*21%qtS{!De?RLq9jcok0;~v^TlGZFbpGTjjpb)0>H+` zhQOs3kH^#LbUK|b77mIz{8C5s;^G1T3pLQ_*y6*u+x8;Dqk^FIq(xuu8qtq&9akFjvMjuTAEUJI~@QzQ=R;%yXXSoaf9apePD|g8hX*#CT91ln3QOc~Bmd z2jxL|&FFswtw_Y^m@IerKPpCwX{AlG11r82cV*&LZMLn zzDLz+bzWW`OAG`805&!@D6TDi(A?bI{{DWJI6puC&2UO&X(rR%-5p7it*xyreSLjh zEEZ=`)~~It0cdV+X6ZJYO)8aU5vavt0U(h`Vnw^%{we)$f|^XG^73+)Xti3i3-s#h z3V>WLXX)G9+W;CG8nOj+e}5l9Wo2c2fEE`QXVDQ#d#^t0z6QW-`&j|Hx3>qN zzP>)5KHkkN^LRXFvl)P1uV-4b+3fLnm@aNkrk9r&00cp>^xocH07j!R`S4&c=<#?c ziaI+xV_LV{O_C%@l3uTuvy*9SYYRYodpk?d&(84~!=^x)ties9{{-KEQ=FNfRhcIK(#&1SQ4mP~Xl z%wnR`tFf^$l^FyA!H<`DE|=@mQEhE)02UV)znmcu2xMaEFD@?PHzokb$HxFv9Yn|=jTMR zt5T^FM(}@nXpu++;NjsRR-B!k1u#53oGl&=hr@4gZv;Wmdpl$FwX>zAC6!5ZIvstl z`qZPNqoW*n^ziTyKv!26OQ#q8{{B9dNl21R;=Dj0z(Lm2sm%&ddMh9ZqNu1Sl}T=H zZuELR6OJmCiY`qY4u`|xSYBS{AnS*Qh5*oI1Y>Tu8$eG_Puk&_C@9nSD4pHa)z$F< z8h;&4<#38^xvWPoFE5*#npon=$q9hY&dzLkNp^dC3!tN;<5N)9b@Vqu6M4>RwbBWZ zEueID$6ETw$Hzz{67S|8u@v)EB9SPSN|tCa7y$TuKI-Q!C67iT5vS8RFfhQU27aqH=O_=H}+8j94;ItyW9FxT~tF(rUH; zjsXS-2Q3zhP$;A_Wr8GsehCJHGMTKPpg<@T8jVIqpPrufdc6jN!D_YE)YN3=tBBys zf9ZrmA%Y-SVl)~R3Wb^ceDgIZ|3Qogna=s)!sZ9nuW Re)9kT002ovPDHLkV1hQz7aafq literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/int/4.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/int/4.png new file mode 100644 index 0000000000000000000000000000000000000000..483092e69a6bd7acc836a05ef1cfd97870c578c6 GIT binary patch literal 1406 zcmV-^1%djBP)8w$CT3z7@Pg;t7^#kC9Byi>^g>%@d)jb>g-8Jm}}IXnN0 zQ>XKsV|zB+{P*-fpNmub{Laok`@a8vn}8%q{0;EIUjkkzFO(O`3+09KLV2OQP&dG8 zwR)q_`T6 zb#-}pc}#v_U?4g=x}>CJX=#ZhNwe9^eeai~r-W8iR8&<}O-@b%pe>})XeiGF2L~r4 zBzVZ8|2Q5bx3{;WqoYctk|2oi@bI{}IEt^Wtt~Dt1`r<~pP!#^D|KAWC&#~2YisMT zU%yzS#bN<4GBQFlR;!i1+9y5b`q0qO^73*PIXpZJfR$cjV`JR6e@QwHN6V95ufM;) z&&kPQ@d|~)-``&-6f()MurTfuz9il6`oY0L04FCWY>xnCWo0b#{r#QASglqUv))mQ z&dtpMh>eY9lIQ2=0CID4SvM<{N|VVXm&FMd*RtX?8Gt*m!lG)i=04XUcEPiHYMko~e`T2Q^(8a|? zs-81RolXZpEEapwn76R703ahHy*8N=cuA|e1BA0K}^k-NIO z3iEkjdxcel}Kv}MtTh6YD1dU|>afVG7uNisDxm22j2;Q9I4&c4rRG&-8~R8{8= z@COG6Tr+ zz1jVBl&jL#2R}VMQHLl@oSvRiW0x2Gau*a7WU*K-E-tiMtxP8S`1sh^*tod3NJvO< zyHJ5Ef6yXH^2;&87XP0K<$qn~h4Mmqp}bIDC@+*3$_wR%{$GUt3jq?uS`N^A`2YX_ M07*qoM6N<$f;T9e%K!iX literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/int/5.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/int/5.png new file mode 100644 index 0000000000000000000000000000000000000000..604128ceda81954571b399706eec20a83e427dbe GIT binary patch literal 1486 zcmV;<1u^=GP)<{P+91{3MKt(I2;xau`K&v5z2Ag^z^h!rD|+!Y;A274%O7un9b%3 z7cQ)=t?}gN&!1CLQf}V7dH??X-74iIA}J}Ur>Cc(p#i}5_BJ6qJ3G~CHIdlX*2WtH z`10k;)vH(kU?B?sNV==Xj~}xvTT@drH#euzXcP(s;Vl-+lP6EMx3{yiv(KMDPsqD> z@201x=jP_>bh^aE!~^wcUS6KrY^KQG-d+HqP>AA_lapIoTDU!e1fk!*e+OW**(ly@ zHfLsLQl!`G1>kbI;vm#!vjLc$ou#J$>g($%vaPLc_i-tNgwT2U@+E-Nr%ww>;<p(NO>+92jEG49-@bi|mIT~l7j#oJ$h8gzkT~w{D?_3pE`AF z_vt7hAwgPOl}e>FkB*IviE9#R`2bL5X>f25 zfYE4-I_=QV5V_Tec=YJe&!0b~C491zUc7iAB>VdM0OaN6McheaV`JQ2Bf3!Dg+lV) zy?X$fnwlaS$Fi{9ZnxX*JB{ACb7ysRRf5pvwjHTAQ86$uz~_81+S}WI{P-bZ*H2DPMqE1(2rvvo_3#rD69BGU zxe|*|qtSTi&>@cFs5C^-+}up<`Y4ayY&MgmBP4x3AAs`ma?03XFaTItS&8v!k{QU= zYPEX3Ua!|{wOV;nLX48sO_AN*-2fgwd`R(1rBWQtJK@)_U(_|?P^>XJH#bN8B#uR@ zFAjx5TU%Qd6%~>SkMJ6CD5iuzGc&`tVdC;b6;G1tuV23&heI+_ImALgeE1;F1Ehe7 zjSoU7S-YsHNJuU&E&?bkE2E5uhld%4q2Brr=$$DiC&yqgP~`LH&q*c{pYn;1r4A_J zPfku&R#u8%M->VM6`;XjFcb<^S6A=jk@HS>K-$fvr6r2b%*?EgwvWS}h?L7ZC>m&J|iLaf9bF+%P>s5e!h_)RQ^Fs7Agysg~~!@ op|Vg}s4P?#Dhri`{_lkT3+S5(IQogUxBvhE07*qoM6N<$f-DWpApigX literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/int/6.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/int/6.png new file mode 100644 index 0000000000000000000000000000000000000000..287b6ca3da36e44daef8c3baa8ed58678a40ded8 GIT binary patch literal 1376 zcmV-m1)utfP)GS zkE&4{HL+Mfuu|}%rdEp|{Wz)M)oZVwyozUU9?ij{BBEG?5)~BlMGF;svDipNCC0Kz z*CejlWV4z1ABO)BEPwy0-HO7z)4X{*v%h(7=gr$?8H5mc2*QE~A{3N@Qcwy?K`AH& zrJxj)f>KZlN-BoQ{_aA5ad9y@ zIq7sdA%p+`Q4}X8Cg$hou~iU+si~>CxjB5LCrG*TvsHosL?(Rb0($X?JJ4@95{(j=NY&L7N*;ZCo zh}G-$UR_;Dk|aq|Fc?fE5_c5(Xf$dzn}fk1>Cx-;L=A_-9LFV-Nn(|9B$-S?2=6HL zf*@R8UOsv91gn0(-()hCmX>1m$B!R8&+|M_t|z(au1}_~U%$4swGnlBdD&vIl$4ZU z)#LGWc6Q#2BlN?E4=-Q7B|ipS%Mq7)Ssu`F9tQ&Uq@!!XS5?yfdx{l||VjYeZ}aWPiU&(8q> z1ay6Uy|}oTJg+y4qA0(1ilV3u==S!u#bP0Qd~^!t~QxWSl!y%>g(&nZBBmjWV z=X?A1EqQz+k;to8ukxHNold9I>1&J6qhNAqPScxm&=vOWJrAeDD+;hcW7vcs2-1}qoadm zS)z`Pj^;m`*=%lVYQk+YE$R8AGVl5G=U%TDw`EzjTCJ;_uakMr&1}S(YUy{I5;?HFc?%-2j)TU*mA^#9{gj^k=;YYPer#>dBTChG3)cDY>b?d>+34eucc z;ndWW(P#t!6ciNT1{QL_{&kNcgj7{MK0eO%aju$9r^yb(1toSo7N5_jl}8zE|A5G3 zGKoY2J5{IC1%tsGa`b{<^@24)FQ7srr{dv9mhdb|!0Iqsj8`A5U+;MtXq2Ul)pz36#i z>Ez~Sy;$qj%}w1wB?Ye@BnjR+x-`L2V~PSttJc(Q&fHM}vw||LS#q0?ITg#kTWlkz zzjY^PrN700#U++IpZ_bGR9$uMDTm?*;U^99N-VAc80bPhZ1sQBm2BC&*Ej#h{rl?oSKiFAv$a*7 zeDdzyyEA7>S{X?73cY4w&as={?^jt|oP6Tt-@kjWzZPXVsCMD{^>8jLBcnwcU4hq6 zpFX`a<{V#u(}}NNO;ckdA`(9A+qyMXSVK`of+y(O;>F6&>r8!DUw{3rQON1n>%|c| zS+mm8_Bkzd;8+>9dM?maFFht*+3(R`C8hN+eRE{hqwl{h`-~^2xCF8^6z$YGy-DZv z(x8>~6Xkf9FSjqLtMhvw9~qg*_x$+rc8#v8YhFOf5Fb|&hNgoLZrze%SaSJghRLZP z?~|V8N^qULaz#Y;>!(kL1TMy{zn-`K>zY+SkY%>$%f!6={Fgs3T@rE*5OM8vQL4J; zqc-_u%9>6M#V0?0?D%geAkE5?EG90__~7Hmi!U4^r#Ua2Fwb(=@C`yYQ?xQ%CV=Bz~;lP6EE z-&$8!$HZ{{b6WJoxpU`+tv>3*$#6H%eER8^k=a|L)`nePd$xVf<4>PHy?L|dZrK3zcS_e{ODOHgEp?-m3bFiXVT~&wp-pVq^$fIYq^DlFHH`O$G~FTh@jYBTH-R z)AQV=d)d~`mIyol?AfyiuU1B_<%_gExIOjAix)4hUKM42dgo4z+3c;Fwr9_umzR^1 zDy=Fkd|0;IR<6IbvgATiRD68-&X`7r2k+kHeb~NYRo31({i$9@lQ!PpD(l%C9JY7_?L>#bPm*G8T)KN~I=&@?3hF zrmNK|Yn3aNicBVhAV@$KB}p<8iLjKBNQ5LwVJ$sHQQ2&krOalt6h#SZ=>Y)AWKu4d zx3{;a(`lp8n8{?S)oO2Vui#$zZ{wzUk<^eyg|*k)Y&L_zU@#c;dc900lYc60ZEY%* zs-vSrr_(W`bUK~gZf}J}34+jQG!#WCmC9nV_*Z8r6biv$@b2#J*RNkLmkR)((P%IX zYsFrFadE-?a$sP9>ju5Cu>k;hn-%boFC`@_D=Q4^+S(e|2?Bw@*w|Q$Kxvxp@9$?= z5d`5nhuv)s7{jn&FbDu}yWRCR6bfM&R_|&w!`EuH z^%R7+Mcr;UNs=G+9vvMuWKl-0udkU8qobn@y}-Fkcnsg%+|1>2AN4LTFMnHcM^RK~XJ?^M003k%8NFWrja4xOK}`D% zX`WOnJwHDO08C9y@t|B?U45H(*L`<#a`GJy<{i1)+uIh4<=gA`TCG-Zzrjag7?wyR z#bS})@U5*au09HQJaH%#VvZZ$KKBgwWM8DCvpmCNOi zdKvF;v}Q7yOb&-*czC$cjGf~{aswS18ChIhTv%A(iskqF|NLsPSkBJQ0028XJN5SX z_!vb|6h&1kRYN<|($dnz!~_qITwh;*dU|4IPl-h0qwI<4;u%afo2{p(hX(e(3Cnx;_{H5!fk`}-!7>GKGHAP7a#=jZ2# zhX)vjA0HpGXQN z$z;;$bdn^AAc)iH6x{U-vUCqoh(PEA5v^B*Hqw&*$?9g0Peb zg5>jgVfm<1sWh9-ET!3ORw|Xk0)-&x?GnGM{9({yu^5d;S;}ZM`q#tWAGi=Jm&>e$ zE|p3Og+g!_VyRS$rA(z#g1Zn?tJNNl$L)4UB9Xnly+WaIa&qGFc+_gOczyHV@AV?6 j2r7b#pdzRU+6?&(&<^1V{7$OH00000NkvXXu0mjfSwK1R literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/large/3.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/large/3.png new file mode 100644 index 0000000000000000000000000000000000000000..70b0f3e1d0603800b7411651fb2172f01955bb46 GIT binary patch literal 988 zcmV<210(#2P)Vd>x zh(89UNOW*>QgO)OB#6#}?xK^_;^wF*)WJW%MQ15?D&nL=hbjRBL6Xuz)E0}iw$`TD zJnwK4Uh3PLUXog0?ip@)?$;;JU7q{q!U6#E8;oOqiBV7rN?B^%u^3{ez^hK5`Rl_Y6-d6{7tgwWR3R-sU+(Kwk*777Jf zmTzuu%zKTwxw&vS>_AB2JDZ=M$1M*I4#2V{5{b>tP24e;%YkiUtTbwGZ^u(65{bG- zFPF=rC~jEx3{_PzXkT9+!5pF}HYlP1u)Dj9Sr-=<>zyN&N`=GW27v;=^z<}l z4TVDBgc*immQI2ei^bN~R?M1Cr|lq0k`xRE0bq7^)+~d;pd?9V6*(vXTwGjW(2*RNq_>K#202w>Lr^>t#zwY9b9=jUp*IKXy60YDH0%zAlw2~JzJjY|TW&1OG^ z0>|mPPB6mG&Q3O)tya6by6Q|s0U#6#Vb+O>39?5mm&?^^|G6s|;x)n=fMJ-ImzR3` zo}Zt;zrRLizW`}_M0!(3lqcXV_Rbgx^H5l58g`JG$^bhKGl3CQH{7{@K|X$8p7C z(ed2w*b!=~();^+i+aa2MNujQmy4q0?d^^D%p4mVt2d(Ld311a@bK`^l%y6dl}e3{ zj?T=?)JUa&mv-~$fUOm6d2T>h*f3rl!6< zZ0_#v9v&VH!!VtKAed^)#qat^ByxOw+|$#eD2l}qySuypzJT!i{f^{Ul7vt1p4^{v9v>eyO>0I_^NX~G=jTB)nT#yU{r&ws&kKU!@puLX24q>zWHQYK ziV*Vod=*Zg&xa6l36$`y$638%t#w^*X=x$8Om!uq`FuVWi&Z#du~`f__Rb3(g+~)pb1{k5@S3@wl$*%>~NyJVHoS)pR-?jYdnQ((UanLWt-2pZP0N z!@9b<+S=L>LcP7c9LIHbc6z;D_Yyu8B@~o`Qcwy?K`H3}4f+Sw?_4!#iGgVV0000< KMNUMnLSTYc2hrsK literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/other.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/other.png new file mode 100644 index 0000000000000000000000000000000000000000..a5796aa82861db92a8d248df72c151f187032dd9 GIT binary patch literal 40838 zcmcG$bzGG1x;3sN;2=l~BGM&D4$|Eq-Q5F-#0ZFVib#iaOGxL?jgrDp0zk& zJM%qzpS^$YiT!!c?{ofP_-mf$x$o;<*IMgZ&xEO~%0GVe?9sh@_Z}-M$Y|cXhX+Re zuLQ(G{he^auD*AV=ANRAq_&6Y?gIAoD{D8V+winTjPo!C$)4qBYgkZVICeM=p))vu zc0U{-7ZsK(W6mW>pg{zdlaOTqS;X~_lgiH1^Onkbv&^Plc0+QG64P;Kj;ZBzL9`8 z#^e5XFB8`3fuR|js;2P2{XE133X(QrbpMMh_SaV{OVD7ZUWWd!ZVl=}T=xS}n?wKQ zUu{n3Gup$B+o?O&{SOT-Pa0Yl_8$2o_wM{JKKsA0|8sEQciysohwnA|kq_w|W!_)% zKfmub`q&`YBJB_k)4!_9DiMs^i}9T-qc-xO!) zjpycz-r(o&I`8+CJGqq#8vD9&ge@n5>n80g|LdD`c#csbCGC$`A)q2+2l?yCMvgyv z#*de4F#i9(RDWAy^EEp3ip`zzOg$IeJNG*{e<@c_{Gui2BZ%wkRdQ@b+x( z&i_=;Ux##R>DuVlf6v~mWoAjbY$P8fuHgH7 zIG?vH`C6RAC>a0M3H|F#boR=kzMrCD&$gl|^zshje><{@0uhrP`=5LS;td@)dl6*q zho3TsA-;JcT>s5;n|INx5BbbsM!wY@;@DiT{=Xo&6H3^)9E1}d!P(w8?K&cwY?AP4 zA)97=@$|!-V?&kqM$|u_lIa&fpF89dr_+a;^h9y-+oPDlPHMlqU0d;&PQE)v5R#|R ztpDo*e`}SUHo$xu9_r9y0s=c~?kJj?@}C7Pr8eM+$fZi(J^MLRx)`PZa3He?Jy2IO zBZ8-NP@jB#Xg!*c#XUUuw*_RwzkmC}k8RC}jQ)4)+`@kS7b{Df{@q`{JRSadM|M7U zI<@TS8oN#E^r%3*#!pL);V=Gez09R)B;NSPr_Y0>CwO0`0?Pn^DPva^=efDX`o=EG zeRZF+nr!wD^Ui&%S38xQKwkGn&rO{osU+_Ie7(0QQElN2?@wD;D`HIV!~ZgZXO ze`f2idnI|ZTir+1({VG`k%)Qy&Ft!%ihue?!Qq4LrLJPdB!++7nl5Hw_TBYn&wk5+ zsj=_rWO;*j*R;a+A{P^(953|LmO`hg|trtS#t72qfHZ=OR5hq4P<7)V- z1-`ew^RVD%!p;h(|K;Gf{vE*)PgUn$a$Ayzl}L{mk?K|182tXv&$>Aux=T>_QJgs#V8*sIr@7M62kxfzFXo>8)ARqm zd{zl*`WaeJ=B_io0nLy0V%`6?hAGs5RCX7?>5W9<{|}mneC{;6?lB{AZyGcSe}E_O zRc8fHc(-b`n^=tvGqwNBy>*R}A2aHWTcF6lRYMlR#dmx^^$h>pOH2zv?!`Za*`^LH zd-Xli)K{act%zZxmllgLekXaWNe!*mYWi&_n zpfOY2Vh+l0wl*NT54=7p6lZToWFC+hLE2791Li%}qO9RCv)gqu)vA9!TL09J9)Fg2 z1mZW2A2GGaeN7IcPam$;i`*5yI}*R`v*V20{6}^CeRU#%z%Q0gRET4A_aT2}EvJk) z`P-_m&{Pp(rY_y=yAM{21m)H_M)jv;8bIgh_$~!*wGeEG(t5r;xy z9tH8SV)@d6S|#J>{?|u694)(`KVLpxnc8SMD###HM|=t{(mO8GhX&3=_*-)>20N|? zS542G^^S7M+KQ&FVnko(Oue9;YCH(hbhd5~HGzc_!H%P4S znB94?^j{~MT_(z~{o{Q7^X@%m1NaCmUBMe(FX3=Rb(o!&=nWY!l7NSCS9~}QZ_hhA z8jlBFDt(?G&%Qkw#wfW=*e27fqy1bKrL4{0UG9Io>CZtKvKIL@KK_Ut1soy~X;Z2w zl*l5iVzF_3gQ~-qdGUUz*7tJXYpR9xFXZk2*>ObCp&?}H7#$jYz6bGdY3yNl8f$ch zyN(^Z`~!x$7y+ayaO#asDENxo%$B7;g=j*Ao$x6EAhcG&m}00*R_x}F8d*d8X?et6 z!%{o!Fi1Zm3Fv@8?fXXKN?-2<7ySD|=u-jAZnpLQ zYDYboWX4=Nv;+ixdsBYwJYdyNrdbKVlaHNR*;f-mhwCx7TQRQ#liH@;c*N3nDq1S0 zea{zgP8rRSHR8w`mxD_t{wBq|JDVrLo{qDBoMXI=okzSEYo^_%Od=lOi&S}R3NIOi zucp@dTvUZ>hH)>Qx1ZNF?V3l=_}|?`q%U1>ST9iBUGyb;KaRUOMuYY~ieo2R;pT9! zh;y$Bf%_*+ZL>UWjw;;SN(I&;dBU@Ac5Tx^)&s^W;G3Une$aV{=jEW8sn~(Vbz(b@ zpFQLvpAjG}9q@G;`P#vx0pE8^y5|AaVZbl^?Eiuxz=ArvsBaJdf(hrICwefK)LvIi zl2r)uS8}_y-^jVww8iHq_@4dJHqCmEK(;{;Kjw(w=qkh}stUgK7r!J-(3Ine9E$HeJCvx^^O;T^X-9URdDtD%;gneK}T&h`sOKd=5BMoL2hnxJ*k zumgId0xvKVQpbLX4WfrJEPi(l3g|~S&DG_P`1@X01J60%4A`3@(pFj2JO>66JmEp% zog>UH=!SVxs^4;0p6{rPQ82_O5EbiWMVC>BF5!Qm|IVb+~X6oqPRM4{N!i|wZ0 zUzEaq&t`0oqJFJW#5m_YR;|t4G%{D7YPn z%u(UnZ@GjQ+)P^Yik^&0M~l3Bu2S(4?_k>Cv{~dFOZ>* zdZwP%s8*Br6#9&osoGJ$LXq$F4#Z#tMk<(5FE3SQ6SRyxsnD$vS9XQHdpmu7ovP=C zU2n@Fr;w5Q`tv;0p#JZbVV(j67O~I_y|OW7N+;*mpFJcL*sC26*K6C>VHC7Z-18jq zHa)uD6!%Xo9krjqo^HP!f{;>QbUq9}@YxjZA?vv4Sw-FCyUO#YKYCO}PbZ)Y(w!g1 zWXYbO`5ZUL;4CW;!DR7r=g*97wh2~fY5J~fL(`Dsz;a(HtH^px{NrPJ@vAY?QykjA zB;EDq-F0@u;S}%X-fB$_@`MU?sia)35$6RTCiNfq{uf=K7U=~v$zP3?#$$0-Qo;y{ z46se9+-^T_J0R^zI7&INpWI}S?iC;WPf>!40sydVLp{Z!a`Jh&UTf~fbe~u~3++m+ zJ4(^k_OmaGV7%#0w*v_eE5#~`gt76mmVO)YU1EU#&Y1B-?kNSir}VocNM6$=yu^9F z>6wiwg6A0_V@?3vigDPY_E-)qAD}1NxJ4eAIeq>1?+5*FJwaN!bN&o1Q|Rj}^C*2! z#;j#H0flHrl%88zX=PICMkn(m&`kTPR>qv3uJd89_|zm>Z}wKJC#H3%ecx#!=fJbQ zS3}&=PF9kfKlo?rGseS1=S;=_nZcjRNF>$aaJE(n9CZ^5>m6pe4zui|8g25A%ALxN zc9N+6UrBt%7@_`Rcb6mh4FLwwVuIxk+FH@;!>&Rhe;w84P0<4bo8v^qstCe&i@%xp z|F{f%jb?02IE5B3Dp+v(tl;Pg(Qm_zASS!*$o+MF?FOC^ks26qmOSQ)BXp8^2#CVLs+#AOt=(3VVmq&;($^O~o#?76fY&!mcfL)8 zOJ|g1_s3frrcAxdUosd}{{3+Ln~HuS+i9#bv7tdYpjT^{9)5$u`i92w%zf?oyW4Y4 zo>6BugGva=nwF%4roVroqcIwU`|l=sYgT$?1?{u`Ny~QjN-d)rolBF3KdPBF#r`QT zH~4&uVpK|nyEBfJ>;fAUZ3{P&`weCR)Lp?t* zl>_Gs$3`G9aT`^j zVIMZA>vE7#WO#x)XB;vk3UP0lb7R+~$_AFb0*Ir|mlCtb+*Tfz3Z8!S%s)Na^z-`& z8}fxNSdFV+sv0&%St+c^^!7NJnZ{LSIX8lXHS4@}Gf_3otyZsf^+}KaCFk9@vRQPm z{xTXg-Ag_R4t=+=uOOv^{LL(G5dKVWi0UX*K7nvc@b@;;PN&I%*AzRzoR*b7q~fEU zJ>lXuQ+hY#?hFDcI&=z2`n@wgve< zdC`3_QsUoGEI(yM*J)(5w9&Zp*&k2QbIY~RF1QVaIxY2zsK@;G7CKIAzSQO8SeW^N zl?o+b674VQZL<9Sd`nIuKfJ2fASdQ**@Z$Qfp{nuUf9rBeyoiNf=7eAh6YuI_i8~N zqap{~l~DZkW(8IxiV7>-*U}OU<1R;iPBqv;?XEA2 zD%3^|>5g%Gh<{gg=vUSv5b@#y#g{mGKD*t==WeVk^(%6cCfiW)N}_+TVJn76MN5|{ z($5rnGV9ESrm_(qc!ytI!Y3fvzGo~P?H8-;CCuvIhai3kb}=)|tibABM~Ju4n)e`e z)y>%)Sz(6D>y?`d3c~H=_LFa`_GZXgR=!J^HK{;s6=&qg7kyz*MjmP52AqCa+oZ0M zBW=G-Brm?oe{@&=LKr#P!}(3IhKq=fiwKaj)HL6mgH|}G^aI?$HZhP{{H!|0(V0a| zT14PG%K@qlCoL^)@HMd1nS6N^4PCmsS>imGJH)umnPzu#jbbZ3jdBlI4&Wa-bq zY!l3)7#pRNE_h5B%*as8m-+{Vi|_UDZ5Y$}LDgROJSawO!=oIBPX_I)Y>bAfy6bbl!WDR~9v+TvPmV+t!e7lpg@> z;wu6EPPXoqwF+|<3f389z&KZQF(obVTtam(T5}Ha@2W8FQ~QlkJA}MM$79!y&*4pO zA+~ho)EERFD9r;&B%Gx_40xE}Pt1a<3UPLskr9~4j;eR`X0ecjT5Y=Q1^ zv>yKWLgRvVUdA@Mz<#v4zQ5_I4X*!W-`Z89z&_Ee4b_*}ZthcG_RH%QRH$H{8ZT{% zowF!%L5aEUyPYtHMx&*f((z6+P))D8S|r=e|4Ft^V!!whw;NjsQ~&eL?48-@Nr?~6 z3l&rP6GsDNdoyQQMT3e_m}@9oSF1R@7$8!31GsPhA(%m|*p1K9 z@^>NA3QIN?h=hK)1Pi#)Wn`U0djC#%@hH02%O6e4WpDGKN)I^7kxYU|~tB$9JTxoEmwD2=wn2n0{e|?uj#nyMwQI2ejR%U;ivq}t$q};+%tCe ziPI;Ct)h%}b~G)R_Ccoiev`G0HsMs5bKcE4N{xMC8)Ix4BH&(e5JB$N4CeN@9-=lP z|GF&e=6&e;2&kMB;ENR#79ao*aJ(Vj2`Ib#o~UQqWPr8DbhQ7fuk3-?j_JcOF-#Kk zyA|>4&zdm$F73Z`E8hK`(*yrIB&JIn?lDyV8;W*G8ULD$;o+1l=uFWwahvRS_#Etk z#?41NS=P_!WWhj6`B;4$^3Q&d5dyQ`Fy^f3;v#rYuwRVVMBV@*6b$1e&>*$gfL?P2 zf5*k%Ksg#Vf|ZId!%>F9XX{?>`#B>b2v}W6a1oK`>ueo<1Nb6}=8~d&Jb&1c-x|MP z9F!A`FODuzCL>KLB%21K>rCb1SDiNn@zbtql(;S&fUQmPeqZ!H zFd23qCkmvcH?LqMkgKEKH(aE?UVg}k!Q-!Er_Vfn{$XOGSV3p6qy*Ou zf5+uePpRo?iA#2n8YV>dUSCNRG5FYS?WbP6faqzl8vA8{TePvU*1e*o>!Bq!wE6u@ zjgUz{=NQA?Jt+w#$=J4{1jxPvX>-dJT@9J>opmP^hsB8NppONs4scVcOs#9NN5L{I zR5pao^i~YdMJ}K!93VqcpHTS+;~GKAZW_HMv$IWn!6k%S(mslIl$O-P%u>l39<`20 z5e`DsSOq-M5%ud=L~$YaXM`Bvx6?k50r^K#yWY=l&4Zg8-^N*Ut5W1y!g$0kJDzo0 z#I67IMyonuj1!84#>5VYl&H)lj2*tK?(-1;$26j_!Vv{-E)$3L! zj-pj%VFf*fhV>pyHf5w+QKJLdJsiaL+d*Gpo(ipm(2c$$huwEEJVgC z{@o$|V5P2N$^}{E+HpO_8TPx)(tZ@>6#u- zeP0q$L)CzG7Hb9D$8Vh2o+L?!`pJ|9wb>C%{R<<`+ zD@t+w(h-?;M;==cJ4~yQdV1-=Q+?OCc22=5CwO#m%JxCpgmN6E_$ZD!7_Ox%_-$A3 zmtSB2EKKJ0J8ZKFAxq+$IMFt*6Qo-iWFkyqOt{do&Uqnr^nxR4K}~HAYw7l^LCGw^ zugxxsXht$@PFHZyjxrmqr%uRAUB^>;r#vdX7fLnq-#S8WhTZMT8%k`RH}#3`YdpfU zPB=VAv4$qliws!d*?tt#r@H?ODEsOb#o=xLd}e(8m}jYV$k9n_{;a;itsvNumVT|NF9H?P7_wQ^y-r(=>Z1VpF#|UC5N`9Oq zLHLvRjLBqN=xq^`w>!9)x5FQ04RPsc>@~ICo>nd;M71~ffhIANJv1@4COTB?0Ty(! zdgqG;ZE%s1an-ZOsbX(QoucZZX*?sB%nfGzm{%C{YJ})>adh8O3YHtpm6Udh`{DaS zRLJw%3d>!or&7)qJx%}lSnmXMQY;>ZtWIdDv7hT;oPQTBA5mn+2C1Pq{Ln@goa&lT zfLO(5Nha262M+x4Tfn<6=vuGFQ8mK(5vWks3Fb-ot!?ky&e**4J^djz@}R!@)Hhe8 zV7_l*<#07!a=b3qzzhkjqiR-gMzA7~j+t`PJNUO3AI0={>PwL_#aQwgVcE+Pjv`8< z5xQB1c?Yd_5hg-?c?|GS_0KuDg@e^&!d8}N8$zq`Zicvk-e-@*1nQm zyy0k=97TzJOJPic@9hWF*C^}0KO+a_;T?_*qk6IFC80*TnE4Firx-UAk-9uNk02p- zlwJ-cvfDg#>e-W54r$O{p*LfJqXjHGa$>g6EDmbvR-*!3fhMy+Q}|>2blDA_T}Dn% z#lXWiyQ)U)7-A@ektpMnkF1}On;6YdCauwdy7{Qp-LDR$DUDPhwQEUZi5H*0g1)@e z4EO{D3Uz_UD-o$!L(;a`h287<0Xp-Qp)n4*&4Pf>N+qG_&ekCU2~5T2n=7W!9(Z)7D*}8?z`=_r>^P z@{v-#Hu$h&=YmzNI}>Bb|L~!|`lHj&DVV0}q~ts4XAf=d?1Qe+oMGLsv~4mc&DY0O zqZ?@lyDhnVo~>p`$Hj^9j`&1A)$@ZXaMKMnp}hxyLwX&>rclme98jj}sIjn<>M!mS z&^-y;^Th#u|^DQCRf%8QIQ91)%832II`aHmu%b3bV!?8NGY zJNk_fDeBB5^g+bq5?Y+_j=`KOY2 zRMrZWbW>A28oN!KSv}~vtLE?Tp}Lrs*q|Sy*_G%X%}Cpj_5>^L{NV2PprKzZpf=)O zBuS5|z)J9!=RJSwISL@ZdV%=cEQsLH6KNj56fr1rvQn$E@Cb{EaDMQhT_DXuXJou~ks!>NwcI+Gq0aJEnDK4tma@MK;s)j`3`h zLLakpS>ut)WCttYgGz1|naOUjilj)( zVu{+Y&6M|u%k{za@IgX`;&%-j-kZGT8=d`~vZ-C9PmnS|xIL;}SzP{vUq-TEH+u2N zbNBM+I|p$mIBtS(o%Fbyjbpl}2q&WGpaiQe?ICH6sVliY5%e!R%de@s;5y@CkF}(??OTEVi|AU&}42d|!PZ`r< zT>Lq?M8{6%m3;eYKPO~Vl&m~DV#LNJhBwfRr^Vdm2;tY;5Wg90m!(b$f{Cf`UOrQ3 za|3bZraTUROH%FJu;=PL5=c5@Dz`9x&KHsAqc9ojC$#TLFxVoonBe=BCEf6}hE2-&(S~buz|A89sv(4Lv-he)ulhs_e#R>LSaL{&Lh49Z*N8z+GRwSEAgz&T1Wc%QBwr{c9Y|V@$Mo^B%U-nbexs~gtaI!j zT4ty$(XP{)xc}_kn2|JIw9WR#dPwe4j7z}16b=}8OG@sBrME?n)2+6B$;d_{)QXz5 zwf_kR%=S<7tC;6n6U>uj2y`y?*<+aJunZ4P#Equ59_4d?$k%AbSJ*1A0(KTE55 zZYvf^+-oNJj@+i5Q$f~;i2#$DZPhB#imuCT62lA~JmGeB;!{eU%X+CGgCVjztD3iO zAu5Ag_sB*q{2+t&2ayHLGRWpB;s7-S9C1l)%2M+1x>)&~d`_TH+?@PsD5~Qq3X<^q zgWshNH@SZ~@oxI5bx=8t?ub?Uj6C@!ZB@F?$&`GXoJp7I5{~I%5PJ|7FXfUOl_2ZZ zu*lB%>1<8?kVsZ?h1(m~R=2F`6wVKKH|G%7*Hk=MfqkgF%(_@j+Y7NLuHxStfK5Z+ zk8nz|haMGNf}H!IHABbVKTmE@LyRWanPcQ~%*sd2_KV0+RJrz1)#&;XZ1P`%lGYnC z_-O!}Dd|R~AzSrV2H@%%coRA$i1mje_lVh0x-9+(|7ZzYVyXeVff#GT&*TtCc4pr zsVc+GaM`Pya?+p;jAk$`!V>vXhRK;mZBd1Iym7m8X$)wpJnZLd3o+0$2=2+fDIiqb$hsX{5 zApF3~;kI=mjn@2QYL}-8Zcb3wd@eM~_b9@QEpv~;(W?A0pQo}oaO<;ZGJl0rJ%PmdsRnW0$OtHo^ujw?aK1CZJl!t9 zo7I?EA*B0d*PSr1Au@#!?#^`#u5`@$6y*^KH0m!TGxe}A@J(lcPN$U4lE}YdFvY29 zqGN3vvJCN&JbAZ~YK!+w49^zqc1kYKO6t21GMq?a-B2mj4 zassKj7r2Ri$5<-c>I`5>-)0Rb5cA8VvP8p?4bR-KRxhL61uj>6Tll^DtK4O_Y&(0XK{7p

              q}3#%sPjvETdsHAQ{^C9a5;2u1GGMP?+ZPE{}ofU<5r)cC(}m!wWXVh(t^)n8_jS z=?~0x63EsG@?&%`rFS-%N5%%^x;Dl|eDCNZ7 z9uGa{MCn*g`%*lA(co3sOQsPj+vsF&V78k4z~j#>-MZ* z`#MOSO*UWG1Ug?qWI*?To;nD(4!U$^Ay4HARxF}zmDH`E;3n;O6!eb3Jb||Sg=~G0 z3~jg0M`e{CavjpI814~kcwCrXvJl3CS;DQDOza7lcJM<_cPaEf!F}hw-$>QH&7_;7 zg1+Q-S&(Ynyjh8Nu&R*8E%e9Fb;#t}5#l=7p`_NUIF#l)x=-g_@D+5sKbRC1Seld%2T7s1iPm0srfwyB5@F3;ocRt7Q*~Zh&dSCI#L8W_6k#rJ>Xn8E~ zeNWhv&A7Po%FW_GLeP&MPBYGZlzPvdy9u?H@Z@^?WLsmj$e=E{w~SdvJCuOmZ|jfk z_9d6YehY)+*%b(ALk=#2nMEv|diGd9q#H@HlGWEY*y{SLS`C3!IK86qBv!|`E7MMHV>#6tJ1#>*M#40%)r+$QsWqF?Whd0?R9G?8CT{m-2J4u$o24i_P>wqb?vrPWCIRD;N(d81LUfQhNzI_XS_} z+A;?le@I#=a!>!jg}>fnV7+$!vCY%r4P#06M-=$7Ld*p~qIw^Cb8(gzs@n}v( znp$8MU#-{6JZOD&N#m=lSAGijVVAX-uYT1Z%|K;};LQ!qljXD8#pB#QGk|Z}!~(#2 zJ5^?ypR8%-@*9p4564A- z`#bfUX14a3O$_?33w!;jQ#NS+4JA#~a%{GSuO=6194L$|rf{=xvWvSZ}~*Qj@i3J>koio7fZb%(g?-`}t+7qo=K) zs^ELl?R(Pec|mwNkwc>KR(D4Fa#+vYmcc+v&55Cqyd4?|#gQFk&WHJ$<@&Las4%kU zwTQ;3NX2*#id3OPzyQiWICS0qfUm=3w}=S$^2t^too;$VSxpN0F`Dnzic2IQDD96m~2wn`& zXRir%(12cz-E=}l1Zm4WWWGA?hC8<`{Vs%{w$l5R3G>D;ZstmA9+noc@1E9>h@eta z`Ta7z1kUc<@o2_g>OC8_cS8iq!2&h*f_V;C@5HZM1=w@jnv>iTqnYn5N3KiMRdWnf zDkMSUCwL@gMVQVcVi~7pw&`Xmnz`Z-p~Mi)kmNV~-F-sXPXje41ZL6&Oa*;P;|4!3 zZiHrT2hUsV{h*x!1Mh+G-|f%DCOm$h8Prc>O81jqm@6MLto3`2)*$o=@ zHdD!_Yi#FX!uvC$UkH7}yyls_33VKeaQjiLVj|=CL}y8Ekh|}>R#uR{wyfgL&yWdVb+w(gaGW`Jc7|fb}ZT${mxBEb>``^ z_%!Scf(OqZJp6&FU-re|fY2ICurCcaY$(JTytk2lmeK2ex>PP`%!b*# zC9g8U`NJ=tl#4|n%Pc0Ev;f;YD3EA*brGmcM=WJl?|@sz(^d%(nV8DwHZ8V~@8Fhc zG?6KR@>lhL5Pj5F-*_^HhYm^#M(aJ$?(BIgQAX}de80pk*4BDbITkyEy7%Bkzn0OG z_gphxqHu88v((88%U#hEM;(n30cX#5#aHeAH(qDNyJQzbp_Ny|zss}WV}ND((cp`6 zHBa=cdr>$#)jf0VYGdjm0XjJqHQMU~=pY(12}pRu*+(XiilO zp<17d*__PiURnz}I94IBIOIh1>E3vqf{25sr8mYi!H2Yfv{&NPZj>|3<=B_4_=3M< zf8BA?1O*tn38R9*uaDxch;kx{9vYe*cMQ5HzU#HMGu^*Hg_i6c5}POb=HZ5r#K)>x zl#O0fSX8+GcC{XM>b-E0c6t9C@OGg6y<9uG;qQzD3? zokb5iRqjtFn}`L;i-na)Ox-4dhIzW`-DELb90wh#H^ukUW>Um;vLP`!5G6^QrO=Ae z(^&6Ne3fVNao*S_bka)cCA4%8og0Ua2F0*gSV3P{BglM6oQ0xgNp_`j4L?vKZWjm$ z*7X>~nYMeZsFBkyxjnR`9cw8x1Ch-SG%JTt0<_JA$IWF7TD$gF^a= z`NB{GIWaL6z@MgS?ew42>MAd^(rd9q5*A8=(5KVr3dTz!rT5B_Hqm- zyxnND4wv3ES!%uQm7v)GFV=Yuwb4bai15sLah}qi`Z0iN^o+Dbkp$l&y`)Y831|A- z1dKO7IVRA;iSj^3x;092_3Dm`3=$`8J14Y;k8`X-ZK7UQh!52eq^etqN+$df8aE!~ z6?w^>)H&kj^7xlphx=L-f09Q15AdU6oBg6COxmokLj?~DQ8u6b4NdjB4p3L-II_P! zvCzaQYmjYunmE zOv5d=6dD0I<0Xxt;I6Sd52rQH@<;rIgwDe)Hydug6is;``kB};h0*?p{iaY8y078d zY`~{urjaI+SX%HBb)J44L`fH2MZ`T;%NK-sLw>h>GIMY1M`aVNlDtD-52%F~sRSr! z8o?bD&ITl2nawgjhJ(Ccbz2FNBId8 zrnlso&QwD>AJdv^p2fa}f65UbzoKfFv)7Um+bN-;ooSVCl|6iBD-8qiu<<34T3bmFyh916q+s|} zGn-5!0E5qZO^)>DYN}&VG5;B$x?uN2=lR?!2oW@56eP73kM1^_x)RUF0qqpx88b9xb0_;?v8hzN)7JF~- zxL#5G#rH~C`!l``&!S{>>NxD%=NJ9P6GAD}iz)L=Rz^D0d^^IG_#0{)@_hSBp~q#m zqNN0fd2cb&H}W^0odGTsLSdIVrA)CH(b-=$;LX=WxAh^8&=MNdM!{Mxg_(v%m`&s_ zhc<)a)gfzMd=k%Xk#nHX$*5@({?MvkAGYW?LbZ3@%a2u9#~Tljepr_=K%2fW^P||k z9Bj*b2N%W3@k>d-I_&hTYDd{`vvTU-J+4v%C1d}a({IySE#7`2HJ}NdC{E>f&h2`V zoMvaxWL_8Di(3&Kfmt7Cz_;M7;^MNwB1BmVZziN|<^%fzUwWz72vVHIVEonTiq+cS z_iCa!GhuhU-HIO}@l`rMXi%d7T0kN-Ad__m(0p`s4^PR!G zk>xvhAw>;Sd1kVP&CP*&wek_!-?IQghHt$^KE3s~FGszW($P$UEObM^tGU2!l+Huv z9dUnp$qgsRlAr)yuxbz|V~z`O%#Eg~s%*d74kH9Qs)rNk*41yq^Fr~zjR`E{wo1NA z(MG-aq`}SZhr+ye0-&VosaL;59#p^AnJLbX37dcIg234Ddf2Gy)l0tKqbq$Xx-5gr z%uQy%pcKvGWc|VJtM%PkPGwhoU+lolc6*>)BO#s?;NFi!PXh`KN8T1NklS~oFl@RM zR&xf4a|X$9U#Z>r*nG{Himx)9^4)jMHX@RvJFfGrG-p6WGj%v52-piUJ9g^VOiu?% zF8t}(bvbkPAMW9AKZ>%hSIEa7yL5bwdA}mY`#0|_?P!ApCx{Z?cYhHt^HlgP{iAnv zxtqU?yS#XzZ$1ObnT{Gf!)Wj~Bqlr76t{$N9I_9V*wjix@1T18sZk2~dnM$RWn<(y zlKgO6b>=o?NMvoQx{!ub}%l_Vwi3%>;PafGQ5AW&! z@==5iNAs!6Ly?j-N+=N#1neJXWnLA|M4upvfB#-e=m0uC!;dp87@n{pvZhUa%aJc6 zMm4hhq6PKp>wvP(itq4;x3gswE(={4uo8j)x)ywJXFD+ zaIh1vZdoZ|4$Xk~2U5F5SGrKeRI@zg*@sP@3s4}8!WC?^R&!3I)`Az?=Lt`VVMD~NC%-b7%BYLSsopv$XitMG3^U<@cyy&h6 z>M;clF`#Q237o13hxtNwijVs7`la#&Uy8ClV_>Pi;o5U9^0TYI>F^#yU)!M{A_3KXLutkRxyluRWwp$U$lnKD*Caj zYi6g4=>-bQypL!dzJOqaZVk?gRYq(LmbekU>J-D?`O?<>n8R^OvfAmb>yTLVSOtJd z=3T-z?_4-ip3)titQFu8s#2gZ{x{whi<#=9C1VfQ(y^xyv72|k7C+Nq#>BB3=RgP* z%<^q4_NFS%#9bT!g+fh2X!>7q91nFGEd!A0P!HV)R_Pz#Scxf+M|ZuGDy!c6Z0NmX z6vmv%89Ux6s_7@Trv&8t*$hs6?p{t15Q0BkJ-dv_=^^&0;wsXZSbJ95xo435ZqT6BI;hg$$`jkw8 z18S-2)ox*@W~J-TL`!}beG|=<`y!Alcki_6x;$&-@OyKIVAV3mq-|98NPF&*1%U1q zreTV9pQj%rJAgCs%>+``{PEzGUrbY>-)jj8-@x0sXJ6kgLJ+L;m0kGat-IrUT9Hb> ze(44eR5GT#$qvj<$W+U$%6vM@Bmbt9x}rY5Ipy;vHX7xPZd5y6`^7*8M%SG4Q1bl98#w_=H5x+~=pyjU!l z^eypT0qT{LBBdmYr@*K2%KOS(VOGk`Yqm*5AD)=f!k*y_QD4^sNo4H}Fdz{MjUL&t z@3jP84UWfdRsaASMT;GZlk=~sW?X0o~CsFS`pOsq>(3}`g$t_>Kt9Ux% z~KN^(37dYGdNrkOjhav$;zvI+DRz1`E-C;P;p*lS1v!bK5YnR+}X3n^ew-|vh z(7#l$5h0Nc=K!ag{aCbbuG0NvVPi#AA< ztF*1KPme2eBn`J->!fCxeYG022~wcCC7u43c0_7X9X6rQ42cduY1?hCZxjDc^9z+U zMTaC_dA@2YzRr)^b}IgDw8aL8St52uvJr}W!6h3 zAZu>?vS9B8>TSNl>&555KQGQo!e|J-lv!Zs-o${J3A%(REO5RLG6c4}6Pfx@#A#TO z8XMynywUEB-L4ZgI#X%enKdYgqv;sd3~>`DqiufO=wP(8?IE=PJl~4Ef2caiam5Ox zTKltNyuQ`(d}8jA|LkJJp0fsIz05Y9*RK_wy;eMdzH8uh<1WlfILdi^kh3Q$Pe~TE z%EVm{`?}!+4I6wjQOHjGV9gD-mJY3^`MCP!RhYJP@SINm?7AQX;Q*T@Jv+4i!+pRU zWG=a-<8H-6zrAV8pQLPvoET(4nO(%Ygkzi?*T?Lj_+i6B=S`!^MrIy0JHrPmu6H`i zcr&huRuB@C@Qq#C6@0{C!&{{I`daB|F%@4&RwaHo^AuUX+Guc~CAy^F<39Jw?2T|z zq!35Y*M=d}N!vD*SDMi2lq7_25UZ%IT02(Tx2TIDvMsR644@6_$T6&QEKA4uKUBSC zT$EAQ_ANN*(A^*@C?z>`w}424bW00JcL+nLbc0AE4Ba5j0MgykEesv+$#q}%^FGg) z`F{Rp@3r?{>p1?0Z6@$%gnm}~{f-wT&hW?^=bYmIt@;4hI0QHKv&}N?n^(`G1(=zssmSo)c}8nz@WF-NHn?eb?9dYR(%5POCr2$aqvwz|JLWgV0GAl zPBWV8l$n0_4}DPN#;;mK;SaF`${)1f(DB3Ax=ks*e;KGc;b6q3g9Dc%{pe~oQqhHQ z(!MEO{%af%H!7V7%pkl8FW%F>RERc@$EEaU#PMzG@fTFsay+73q%!ijd}!F2A=Tqe z_ElMn$}QEF)|9`nx64IMUfbZh$4T_r{x{t0&JIC53yMpu(9dzB-@)Ji*iTXvmh)9r zmgPKIHx!nzd}T-;tFzr1hY8E5Ku2XSbf%87LJRM6JwxCs6bPCxGnarmM#(0;V--pl z{l*7b<1Cs}udRs(rSXik{ofn$hV6jLEYZ9h77w?>v0>Bb-j`+iQT*Q9cg<6mK&#A% zXj(^nq#kMJfs!%&iuz zMitPsT5d2O@$2Dfj%raq!`mUPdz!G(2{AAI8-&PmuZ*;r)|h_BK5z9ia}c9(170O~ z+~VvAm|qI+(I)6Ye?=-2=`cjX&~Td3 zDi>qUx{zi0`559N_>30PJY-!s_;-a=)YH55Gh{0Wbr$cA8>|ap@-rjH_yHOc)PY6Z zD41cMS0l3gKqNk)8zz7lT03?Y{d1>`O5fxzTSlQKb@2)Jb5Uv}Eq5q!@2J~C2ww^>(@oNfPu zPsGPtZzAGvVJvi89$QP0gsXhp>3K65rdS%qbF=hqz#E-DXp#!U|2=ymNm3$Xq_5t1 zCekj}!BDhQW(=WKRU2-%BayWj(CALUo?2GNai0pHo{-rsz%Y>{GMg_V zj%t4!=qok-TBsDgS4#MT?ZaSfm>6W_QKZ1KQ$|FTuUbo+C!(vNx^6CpL{)#^e2i*8 zy%aZn0jd}V0cLXt1RupU zx}`a};+mm-+;5a37{?~L1#4pQt@>Npw;GSc@!)n2-iEn10MB7au+Ukkh~3kyW(fzK zE?p0Q02e9t3z80QYDIY}GAM+0YV~{;8V!=j#!`RiO{W{E%k=kFE<7^b45!sCZl&Vx zH4T}Wml_Tn?e?P-ezeC#3g?f|)v-fZ2G4cnu9Zv@b-Kd_sX7_A#4oZ5v!kf{gPV<> zU3pC_`_7b?gWbm+r;(NkTfjE4xhUTHF5-m<(Oh|9D7%O*)Gf~r^R~NN3YcEN^xQba7cAd6Bl4_c0Q8e#<%8@zz)Svyfi9*7*?}Z|2l&me{(o(&yrA}hLtvV2I9(8GPt>1g`K#mmsXiq%>bf_J#2(qT z1ZJP^yaEE%59*0oz_kYIe-D4*@O?!Rk(<&VA>FG|(y=g-I2cQ&GcR%(b$X5L0-EQm zQ#?|7A+2M@iEow=Ze0+~XFuNPm?54WHPqD@InCw4dqt;xweZ*Qy)%MV05&_}N77*T zik8TcfsMBHlJlhB>mtHmIutCH*Aa5XS?zybRW+vJZq63aLK;_-s65@uX3o*;N_aGh zVx}=h+)WowouL{#cg&TdMUI8c;XuXc6nV)7xnpJ8Xg$$^^7KuW*tFxMI+vpR?PK_8 zy7;KH|E%t9ZOS=F)8F3MU@u)>a4}V>z#_WviQv~8^|>MPvbNbQ4`)VHP_E-QtC*1XX^dS0@1r9Ym3p z_K-`TQCU4=rdI$PX0!0$A8--O2pajpj2hqiKSj}|{&oF`YMV!vE^(L=?dK5~%l=op z(Qn}08*qEN;>V9&p^(1~E?pLM)6(Z(bp%TaehXkh73I|9SYKBsM$t~!_f$ntt5L~i zs1JKuvzaQ&kw-lXqz@o+lp$V|);0E8h#Wq%r}NbfwsuA^S2X0!EMO`XX_jZW;qg!F z9pzKq?+_ud0+R1t>FettiPr@G>OGF$h*#wx_XmMPuRuQYoE))8sHfRf;U}%uXL$dq zYdz-Eb?lF?87>Y&+$B5cb;?R^*DprONX=gFGFe1WV<|ajg8y;a2+wCZL^G3r1_iRe ztgzU&_R73*EbXQYhga^2*{Tt@DF%rHvQ5lTo3vYH0ok0R)iNAJO2V-9{GuStR@|rd z6^#fXPD$9zlqQbgUIUIljmJAKK1Hiys16Opoaev;LiI|63Ym>i$UNyB>rk@Y(k4>=K`Q3KqEwyH?tBK}3EsT+rgX zTy$2z8ZGKp(V^hLZb~y(d$d5C}RV;>uJn_~4 zn%PCp0se=z+Ufbijh@YW-wSp=@CXbTdL>Z}aLXC>%Kqt@N3%jCZ=GqhyCvW9Y0iOd z_K)ct)3*7qv_YQJqc?F)I?nTqB`=RM=tW8mewKqZG7oKPJRX{j)~+Xidc;_vgH_Tm zG#OAi_xV2Hnf+sY1>BQ#SFxKtK+4sc(@9%YN`;UA6b0ELwG-OqR%|OGZ{Jc!K4_(T zvGtNV(%SCw)7uoKU-n*p$*y6X`JvQIAt)c~0T3*{ua8;ZqVbh2Dk0gJM(Y#rkWK9J zm5Ae%ZbtG%TehUxV)XI?Msy40M;f!F!@$$(7<~ocDyaJXoP6%HY7P61W01-eM+k;x zjsiUCK78w*I84kC-&SQ9L(uG_IHp;U0YS8Z?n8YIt#FV5v`+OG`xCELbm%Itn|0RgY;+7a3Un#?u_Yo!#-1b zQMgYE<}{RPt`9-v5%p8}(8`=(L7u_pJ2)U8LduxAGII&&$@NF)jr#$q01WRUlcTEA zmC_}%ZNZBW)Nt0zUD^H$Jo~lQ_$V{UN`h+3ukBeuLR69lT4SFKuj)6CP^CQ$-Z)oj z6a(3_vT$oVdt(?yKv!?|qq(&W9#dUs?mJPRbT5P>{69u_@Eo~#Y;m;QC6rtvAudJC zG$X8qwe5H&GvS;m6TuJ=OV&9+@Yzjed9`*Bz>RI;%C@tTmVs~Z8 zrq}YcRZyEm17@P$t-8z13qFvpiT?T;0L5~hAL7p9aV4~z zAPxVCBYo%<3HSj0IAd;VJ)m3PkOF|IiGl8m{F;!`Pi9o&+V+FooXT<5QI-%e;vn7pH^cL22^4^xf0QJ3^AO7zQfDz|o;QMEW z^D%L_uc1pO?DD3fyJdN!Zu74LHj=JzzRH4)dJLBZfHJU8kIPQ4fbDb$Z*ZE8FiqscItQLPAs%bUD1Z3?F7y_VnN|I(_1?^Z-UhF3Mmhd&wor@ujuXJ5s}s?CDoO(de4 z8fuKJaM1qv@ME@Ypb4tbD%m?AA9yQ&1t_|H4Vf_NHdISLd+)1l^Y$!z8FkIZQUr zlP<&ll}rX0@hP6*-O@}CZM`~$dt!t0`bh6U!RmEv)0%P-Zq)b=!Z=FFUZ`8*>N3wD zBL}Bm(Q7Ka?jFQ@qyaz&b0PdAf_(Y6^+g98!cG9POh}^VzV>a?AiNHiRdi|iwA7EQ zhu9WaxHg_ljEQZV9%WO8Pv&$Hn@d~HjTDZ^9bv^UNb8bedFMa2ma=^IZAOC;E{Ll= zm)e;pc~hGtvbYEF0f*+b-d(JPTZJ`t26JO@&FwI8~ z$|b~!eD2tK!_zY41~7Cim*vuA=kyZJD&D=!YKjgg;jR34>7t*mkpQt+H=r1U$rK%y zE_!4}1&FN#!ZmPKFXpO!ECUW#aD%(G!WW+4cA22$} zOH!2?jAg)dT>S+s^LEccicKqJD??1Os}YKpkt=VA0(D8jd!&@>tsIxKFOE$lQ zjkw?@)HGu8Z|7>9YyBV!os6bMUb#(#OHkE|u*@PmQVT_H3%s)$+`>rajgoToa)ahJCalaKyMC1oMFY(EFj9WR(~Z*knLi8 zyUK8p@bTtU3AtHkU&u_HAuj&1;_YXJ1xx!$$Kb4BlZ0y0k$DSPhN#T~i*9W3(gBi; z7_uL^VU+BX@!R6hIctB-%V9vNF2qPn<4w?EM}!X#kSlJ>qBj!w8!HLXPwVLMob_(D zM(#OP_>|1){E~LKDP^cZW^(qamo_c1B@27;bs8J}FKrH+aXgQSnHVCvSkg>g-9p>} zN;*8cH+z)@mA&{=k`iioahCmfSJ-i=K;>a3X=;BN=oKse@Qr79Uk-f+o5q5HeM zbS)Yy@-x5G<=^AD^{|zbby=c;k~*C^@2Kv7T1Tti*=xo? zxY(o&6PfIta;09c5Um7CQ;f*X&Uj@}CB|76xJYeya9&G)I2}Qwamv?5Df;6&FvqMR z`KE#0Pgl3?(9VHbbo@~(sP-SfXY`&Ai{Je9cDCU^3RCYIh8fpigko|syMU9Wbn}ev zORxwb5oi?QR{9Pjtzv?{zwE;KA^IS*7pd#6P(-LgxSV?8?8i#^i(B3;kt4^L{Y5v| z&Y@4$qf%)4M@yU9=I8c`rZ(^Tr3w-MG+}mA0sr*PLafm94)8IV+b zi4xvU`6ppmOFpg`lZ4po15)!FGSMmOYVZfz@u6-zKl^#;G0k|H^R@h#+=!6s~Tiq`JS4Vh1dGtJB2wcQSofpaK&ZTlGkI?>k z99Iw~e1qZ7kDBe#(wA_gbN?#W&~G~Nd*P7Fx^^C#>F)vz>jaIs;A zQo2xx2N{_u+4NblADm^V0F`A=sC1`t^k%A38cc2Drbbk&gOb`Uzjg1^%6!(5I}hnK zGXdolIWmC1KV-?-&jl*xG3%*!rInNvqp+LAR z85oT34uZWnYrf%b9sq2@&6X+c5$OCEG0?>4YPR)ph5-F^f$5k|75;T7-5{dX@*HsF z4irklC50l~g*ml_GP8+Jo(Yl;-N6@dcl>4<86yuTaIzs+Kc$|dQUwqABOuj<1z5l2@e zf`){bmm0^8GgXEK*wNI_rZqW*LUD8VN=rULI-}3`x3q3*_Y5X#0u@KU=lCMK1f%8| zVc5+lAU?RDLa0rPJsxE+Fxry>6)E3U(RY0X^9AZfX4tH&61sl5(;TR?GhlnJ%9Eg( z?i}Ka0S{cnC*=w?*kUn!f*&y;slJQhQVCW3O4sxrp{lvKz&8o`4J*<#C9KeIjk%k zQOW-m%q6>&VEUUwzh?@U$AxPX<;I*ekB7fZW zG!FgNRv@|-2_z!jDQjicXWj^nm6j22oD*B8hPf8pdw4^8G*Nf5)$`IaCI-msxI}(! zX;FO*mA;y*zQRDv6LR~8T(}-B^Y1?_-i|&kemCCHF60V6F_u2-(?7u#$B|(^(_EF` z!D3>DQW?E|3`6;s>aNQIR`g>xD9BrXxJz9FWQu@AR?>FrbY}wvOYY1E= zuUKO!m=p72YnB#sCLbd`dF~ArVX?r`RIjqAQlka`OQaXLW!5n8Mu-^5Do9qCw$=H{ z=*lr2@VWH=2IE~&#Kuj?&^=>3ey?#tlgEp<^o`gc<&WJnkn0mlN?$PgDzL-s9S8K& z1r2U8jx!GTq1F+g+fd7$(v0;OmuLL0(-zmF6S+NT@{l|oDP|@o6+EG-ulQ(mjL-yh z_p=l87Pd!D#}$2KqQap!Fb}+krX-u?J~|}4_$a)i0q@mJE4(8mriG7NY8%zUX+vvj z)Jn7l7j{EkVo6#BD$YxVwdwG+zzvThx^$IE{b?g@MY=A#Axf)=A(lgNqk%_F1n(Ja zfs1A`AvbiG>}x+6I?WUU$4xTlZNI-y8i4I}OR`pUVGCqe5!0aHnELjxA`djC;xT7n z4hHkYjdh1-O=Y#Y*Z4FH-RHUGp<(A`!!`0#^A$RMl(O{Zirx9-X?8Uj zses?XZu)fIVbZabp+93wN3V{0;@;e-rc%F_QD_ZS*DRENgj1^+-Apzt6Ta)s%e0^E zy4`F)_@Li6-d2FI+Z!pua>co&9mo;c#70GLdoH_&6jXxibGm!lz5s)ENS~1B;cDTM z@T68<^^!ZVI7UCr2o;lc=M5y!TyR|;#Gk^-QyeKqj$|<^myLtPHFAI4`?kFxo%;>7 z3M(n`Hk+X}Dq%Q@NBI~srZNq2&g($)eiyh8H<8ljEcd#Eo}ci;YoQ(cTT8H+cl*p^ zg>{t-H_(mY9$~KPXM>S%o0l7|opfpJ40Xg&&&%RQ0E|y{f0pc{moEUpf?8a6l>~Hx zBxzKWXzJ|QgTsX70;e5Q(||{xuq2-)tj-x|t&eocTKbw{5rt*1Q`Wk5%}D;z@^L_2 zx|-ci*Z%%8raQ^w=r6nIN7V&Q$Q~5^KlQyz6gYo$myrmQQ*c@uX6F zx$@ba<|Qf{K+>%qovxc!3=VTyDY7~Hc_reFKONJHJ{l950T@U>G={F-k1@VUfcNV+ ztiW3Kr<}`oQPBTrDy}lo!r5JLgp88)UFXh8kpwv2-tA@dS)rs}5S-`7aZGWA$^P|p zu_5EV=`wvY(`oz*!u0?rW3f8~d@Y#YHdYi$@DYO00bjS*Z?S)@ZR=wd{OV_!)W{Jy zuHHo81Gktzy#q#hR)G_L>6=G=j?`pSNX$1z%CmwZJ8qmT*wETrlxf+~ku?G^^9lzl zp&ATsz4jZEEPwadx|q>R`$@__Yy`&veT4DG!OmiH8iE(;DQ2UAeFa|I00n>(_vGM~ z^tI7B7PPR~Z#8%`C(IUl8eNlm=C(_`hm7U}S~CDYmjulQr&sf}rRh7TUiG$q=O2W` zJkWE7U$DN~h89`2*Fw3K~5uV$+CX*nyB$c7-FlIx} zgtkvusOh74qol_veWMGLbj#OPOKgc!bwdzfCO;?c3^H8?BrdeuO0+g?ct1s8ow5*X z9i91$%ZM_Y#Zm`xi)>Q-?WjH(g4Gf7iCja&UbJrc^d1@`YjR`X9hY?3YuoBM^#}}Y z2)-{W%5MO0nt5<~5f%+>N@(x3FJWE#5xZ}w<2819!ju!|HeZB3a4;&TZv@@S~Yd2YOW zZ>+uf5l_-IYNWoS4RgQL@)A%%hA`;h6f#s{+9?n+q%M#tx`gKU&+{)}b*Ui>7Pj`z zqgF9ApYW~x68-Jw_j^4g@c<=opj@b&K*@47c(7ueela~*9xlv?YJMfU{W?6UJn&5i zpLv@h@5Ut1$y!Jec2>Qg_ikswFeCUklD5x-Quxb_<9%?1wvA%8Ot4K9Zc7|>I%F-_ zH1I^gs$%KIhDzU?$0t{c1q*6W7=KRN+oSTB=AFCg z%f^c$=WFY%Cx`a&m!&Kqoxvd~%x98EhB8!AHrBp^?|(JHX*AAB0yZ;%mGT2uvOyg% zoq$tO^F1?0qbodtYrqg|>?xJ2GFOL77QHHSFQR5RSu`8Zr|qTmwwQXGn`$X5Gi0^t zV!H%R^qZjywL!JlZ&ddG+_cMY?*31q8y9x06NUwcdt>ynwqbJ~bfgF~k8EBpPT|6jz*UynnpWW(P<3c8A0Q^*#%Y|3p_5BDv-?)#V~(Qn zN`%QSANyudt4;Oaar)ifyn?GV($BD>Lyi;$Zqfio`0kG>W`>W@e#T!odmJue!=Rf z=~Fi$+-A2w%Sj@WEk#UwD{t(2e;Towzv`*PQbT^QdMZiaSx^cs?!Nn1xrZ5k@)|zS zEwn|HbyZR%W+Gh8_z7$I?G?bnmXXTA)bamKewvrn8eh~ITxOL=q8%+zA6+XR7v>ZT zF!KpOv1fcfCK#8zG-i=&c3kOEU8NBxgFJ95sl@QI%pts$1_w|E``c)Y)iWGryF^P? z0D%W88TD4P8rI+sX{D-~8*Q}8I`+%1_mFKmN2eiR1ZjwTVA&4klACpXs|1u0+J`>-r7P`)LhPt@nFg7+Zat8I^ZuDHchpf*D` zHT~PKxjI+_R8zd|HwAvQ(~bMR)P#Z?YD%8!oS%Y80-A*Ox2fz=A{GIbKCg6b#Hf_W zUqz`xs&EABA7|m?uj%|9AK7Q+HfN#8iy{m4$1J~m+WhkOM}7C{SKw0O*q#Vjhc>zeY!r6-H- zTXqknrI_j)_W1H$Tg5D#5Y;{%uy!a@3ulZ>29EI+5WlgYPPp$v4i~8;AL|AJT_8z9 z>lr}TOIj3P4j=p~4n>1|6X0#Or#F!dQQv)KExXiejr&)_1A9rEt}EqSVF*)N_(2Wx zQPA@~?Ro9UnI)(K$7L9wejeZ$*DKv6n^kOqMxtTU=`P`JP9f3%?*UJ0gf^VMpIg*w zZ*<@MG=ml$R|{t=lJ=oYb_k({-kA{l5&?V40}(V-pN_a)d3-QWiUs=F6@Po#eVtOd zVoTOjMu?A3K~mZU66<9iAawHhkL75(VEdoAM@oU&$`iL1thk+&>-8+Jo;1Nj3f&wD z6}-cj;QMJ7&Tj5QFKUwgjjc^LeWDkEx2b))YD0KBJoGaFveB1Lx}pDja1*rSsoyC0 zd%3Wj823QZRrK#)021Odajex7ewQ#Ub>@C77{t4Q+FSdiK>E?&psb5>6btX2KI=c3 z7WJ9`I1|!Mjr{M4sk{Sg+N_POxE^3YbtO7wn_&*6wim5=MFC%|NGmg%6sYsf*gvxz z)Fvdg_j>uY7d;wpc35>=gU}35bWXBtgf6PKw`or=!9R#S#~!%A(TlA{P%_G$mi_K_ zco;B8=lm}1k;?L6@8fXn&Y6dK_4>T-33 z=NLjY^KR`2+Ld+tJ%EkgD$G+yY1;bo)leg#!ZOA1bD~(XXpq>9yOMtcE=to?!Io-p z72GrV&$V;*?c$_Tn`)s2p z|HmwVJXh$d>d={l6CC&3Zt@IpP$82=^m$MtY@7m%ug7IKE$Ej@r6cQu-c`b1m`WHH#f5JyLL>yvcX! zZY5fLmNQZsPQE8Xi04ar39cn9BCOc!QFpk1s9i)<#U4e|@q zF%g(8T0W%>K{PNuZsHZ#QWv~d2!C6}`0eYie0ssa{_4W6w1blNl?VX$P>6R}fppi> ztd)zYEKkVWOzWKN{QEHKl+Cv7IbH6c45TCse?T8YHOz~AFE_+-6w<+cmyQsltybrc z*)fGe-W%~MWQMZz3+z4C|k~^NfIdJMRmnGH44Zf_r##A zV9FIk@TJH}0CwWs5Vp`shf;Qr0de~yQ@XIMP);F2{hrGvQ+|#`3kf|?(!`k}9*0R2 zWr}9-GSw7Zuemf2Jdhrjy&jUDM%mh;pe{x&%oCYd`EKhGu5th#_UZ5Rc?&gHxfP=N zQ&@)-Na{;1Qg21`Q4{C;XR3+P>UYtmd~v^He_{#j!4eZU3x>d^03-S<&-fKQB-zO&dR1mru|(~#);RE17Gr$2srAA^Iz?^n?k(?v1$qRv0DoJ?(9Qv)N zh=eeyyt0b;;s{Kmzr15*`wX6CN@gEwpKu}YBhyT`o!rnQ+&xC=PZR<~kmqgya9%Z$ zjDf86A~R`+|6HK*{q+se>)w!Ap>596K)c!uWZs<(6qS?u6^+yU_F=B!QMh=C-=)6c z8O@BWHU^EA1_r60R**M0%H57`@ccGxHdx0@VL-(44*!RtOdwuHF#9M)X8(Y5SVQ&R zhDz;40w~p|-D{{Nt1f|6Mtx2tkY^K}#sGZjZ80&r$lRt&SoMkqNfm4CWp17&SzPS^ zd_pQYn|{QeZckT6kdBs)y={Z?_|43;*Kww7$zg`Mzhp{p^VQ)R`p*G&6Sf7 z-bCEgzOe3jq5AA=xFtmRc&KcqWO2bc6!aDN-tYANG!ZpgC==$%X8_gO>#bS+%eSP;tI=*jw%Esqqq>@yny^4wt5$J` zRmJ*Y?AJuYVKc+Wd#&H!w!A$FuOn#4llQi@|BS`*d#mK~P|CVm2Bh@@*l6|!X4B)tAQ=JTWOFLNJC8qWlAm0AMSs(+EjWPizZq5LUh%_8Ih zKl@7R)c>WB5p18j>%+PkKTULMBaSKCYU+1fwOAVQSHktMD>IP%udU+n#3f&yIiCfS zOTqRtL33(;9ah=70v`K}z7_Mw*WR&qL%;er=Ftx3r*-Cly$M7XkVhCkA`IVUyCA)| z;XD)C@b?)guU~Ge9J=t$v|gyOnz-Sx%T8WK7l}pp-BZhE;tDvsJ)Mgh%#iDzag*6J zm%w?DcP4eFeo*u}M2Fj&(PRd^Ic>Y4iacN%ViW>ZkL|ac*YOK3Kbw82=_q1HYD(=-(V} zcE{DLg)NDAN#Z3{kM{rUWlbuif-~xo%71+0(zblZnnA@oU-RZKUw?hgPLj+K?;hWC zTqq#0;=(ZZr@K61Fnt9Z8!6RGNH&is9RBvkN-fb7%axuqU8d4|lUYGFGLjw?y}{Xr zRoqKkHG`_(&qlinL4A%>B7H9mwAJ4u`9q<5fQss6a=P^y?eOq(E*q{7PJdB@U#7z~ zkdYkyBh``jcJRyBr0#3S0tvnu!J=KC0y!30UJFr%ONZ=<^wJ-5I)VcK#NKoHSiC+E zG+n37iU5~<>=FO#LR<68D!Mq?M=lU9y(-Y{MWPVqio>%PQe+eXB5FG}-y`~O;pr(nfG3$`$&M%NX9b=hliCUI0#i6{Omb`pmh*R8~iICxmTYf+=a z9M}AOv2~Nx;q8C0)K4J`#EwHPeaJWsfRBDCQa3KD&{LtCcg{R5m>m7hr)3i)uoSoJ zsJ{`zzU>Ccmb`XZmeNK2Z8dMQwuVWmZA>6H$-@4{e_WgU|bSS(I zs&v)AwWmJ1XUI+69<>^3;7?+CjAi`c>M--!vLw`Fc)I<(^MN%bhcNS z*NpqA=OH2T;AEi<9{?A+jJsN3FS&_@di68Yyeebr+ynXLzd5bp8%I3Gp;JeA*(Qmb zFSHOPFYKTawul{Sz1Y&K#2%n?Bzo8wJRwEARScVd3RtX2N2Lg{_SV>1ym)q)J-lA| z_c(YZ0eI;(PBU4gPE-xER8ds0V5Dg(vUEJ z4E1CKPphX4wL}zpA*mOY_-3}fb5QybNm_9R;?~rhZkatG0IoF^Von@@6*>t3Gn-Kw zL*>p!AMZwo6!lyrK?3*Z6GJilbx+xka^17|T};K?wl)HBo9 z-LTG2{o?jdsEB&UO9=ZX-Uv8)KQs7LvI>~8jnyUe{xF|z{~y(>9*7Ov0I4ZKB5!e? zYI9FBB~rPtI_6MvJ$3<0;CA=i@YyWOmhq!^TFuw>pCv_f$N+*s+=Z5Xo2A;tBpW}s zxSHW+kZ={Mz+kKnyb*LyLI@sf+*)$!vcDaNU&;lD+CJ3b{;3&gVqY1*aC4#6aVDLs zh_#U=&AWaw;r65b28mWxh+Rm1=CF)0wJrKtEBS1J4&?02}7+teDwy|q?vMX8`R(Ejo4^VH1%TDRXL zkWp6yfJE`@KC8Aod+63EUn#PjT<+ll&SKS^X(`a((bea%`W5z|1}Q5a%h$S-xAgh1 zRS2n=+rY@1PgpFcyZF|Hm900u+z;Bwj0F~>q1&rZN0dUfxi&?8(LcA=n45pOPq`b1 z-?jtcb`Lg{#)Of_z_yBMgq~tq7Rk2=)3cb_3In-OLvG$g8`v<-c$6jI-%M$j6KC(; zA>}&Ex{tfqA-3ST8|M2&qu#1YZlzR|@R}Jj7U~ZaO~(oD>bhF^DqqX%BLjLvtRI&V zWD!CSK%R>8-0}okaiq(9l9BNL8x@=*hEC6rg%0gWhC&`YyFI5qjeM%bRG-7F&0ip9`y9i~auB!geVa7K4pKXv6 z=)bd>S70lJt~$`rRL^fgXOisl-$=ZaNHHjBT)oyniNtT3L~<+a#ua5MQrS56T6wTS z?^K*och!6~;1WgAjHdhZh2_+IDsja!PQ?bCVnM3;GN4~T%!p((XBaWW)?DVzSVBa4 z;mwd=$dbU>$)ytw<_WdW_%LPbJoRrLLnaVs_Z^&pRzgbZRYcSU1awAY9PsB!1!T%q zoeZt-_6P_q`V2{n(DTxzB|{-8RfCN z>?sg;YG1&PYdj((U)adr*=0s5QQ&0`8jh1MCKczOIHT?fdb^5;|%kmUc{Ev;INElT7Yt_o~ zy`%F(leMsuB)Z??N<#Tp&I@@7pJMRdzmk}p(lXQs|2l`t3gzKCA(r8A=o(U zVCDxNlS5w0HbA5gQ6r}NtI)>KEEopq&91Va=R30_Ot85oKd!b8=s!U?Dlg{+6dfAY zLgEkXBwzoZO_oB0L|@P(<}h!=x+g?inG1bMw@<%jN@b!r13Lji=bQ0K-VWUcY$!v~ zq|uRF#LIC`#G>Rr=E;P~l)o&@gDev>yod?@9I5fi#zwBzI>PFcv?+TXigdXK!KnKh zE}`?pFGH2x zPr0HvLaSK*z4z+f_;tJ~%c1|kjJvl1KD}pJ^UARwQlK>W8Fdi{ra^>Sq2ewMwc01C z0%%wm3sIGSPsR{td{*)5dnW@e)4%<3#v>X0-}e7>tdofA&(X6qDLy43S1D*TiaXIp z_~J7t?mQA(Q&Aud{G{g*x|lW1EiWH7gNv|Nm?z&+{1bfB%IGvKhB&aLbzxmde5Fvz zVCFR3Q7c(HgL%icN>=b{=6!7oo2Ms6pVlbbuPC{Gvk!N#XxYD)#79pPQj;dIaeh^# zd6PLK>3}S#tHt@q#n_(~eg3t}dP|%gakBP1-6LFoB+AG-@F+rP2P)2(n1|UEebTnK z^XVB?{NlgrS6Ty&d1RM=2NFzA!?}0TrGkI5)j#Dd@x%@So!+QdDv9v z5g5J~*e!32_dD0?p&jZu5A#%&zHV=4qJ*bjenAr}6k9&m#^dn7-gtNx zMW*e>%&Q&x_u*q54sDeH!M~p>&%YH~Q!6dsbycH)l=^}YRAC82`vob+z;^UNCZI+9`844Ib^x~c&Qdz1_srhR3?)p z%&iX}L8!$)f~emF8dp=20jVpk67=JW8GHZ(S%wG3y~8arb#GU{R5ziA8o7390-+Ah z!A1MSJv0l93pN@J99j`3&oBp?bh00^EImbchi}!=p4(_-sKwiyJs5N~_P;PWeUPGPxmwHX#H}h%TxYw&uJ0LGoZ_Ees^tkL#_w4rtY*{?Fhj1TV58Tq5N*>vH3kEqdTVv zOPn!!i)fXLN}l>_vdvbfCx$de5{u5b$Z*YwR2R{})*alby#IzW`%wOb>4uuxcCtui z4Zs2IaDPv1m{}03eBd@Y{I;Sqhn2GHu6n76yio_pkFLx|-t9jY<9lArh6x+}(dRr4 z%GQm?dDpNS_#yQDKMrw!f+1$gx2U|w`pC^^j74$T`pd9!qY8Rzi*^}XaHXBWqt&lv z_;!bFE>e@`Q;>V3;AX}`#JjeJqrM&lW9LtgS9clqHDfa7_yb zuD*YKxcw}UeJ3_G9&3CXJ(~A;fEyvGa8!(o%u<3wT>~iadVfB_tV}y`Dl~u@sA#>` z{>UqZ#_n!_(;K7j`pLFi$kP)G*|ehN-{7m5xDGsDU(_qJ6Ig%V1pjshK5%fie*{LFb$$P1afK7xBP(3PB^2puQiqa|ahd`TcPBj&k##(0CJmfS;Y6T_)D| zye~jpp`l*HTS{+CX5SetGSfKA2Of!EfZ=vx0eT~Nt zNeeQTj6bg#bvxUo!!qiSS?R>;DTx%H@~pzQ6u2TJ)al>f0mlS@(8tU`foF6Agp4t1LM%_33h{`t z9d-I?o^kptw*nn9(^$DI!S)Htgd=2OOuTaWaZkWuY8qOCuPnszqVr?w9gwSx4)juG zZ+)LK6c#mqv1M)pr;%x>B9kuH4wk(6O_gb1okJ7Q_V1H!YzIRkpd3u!sL(mlpXJ&3s!Nw|?bVCwR+u3eJl zpyz1p4;dD^^mI{UtyZ{qyTVMq(PC%4I712f*gI2@|OgO?ao`hZWG{svSh~)E?Z) z)!YFAdK88;Uy;mwq8o{P^jzo6tNa&$gk5}mCLJ#0`#5nVzV#p4k`}EgSXf`xXMvII z`sMDQ6QCCoa(mn^dI!+7!!oJgV9b;RX~#|GX7IcZ_s6CbsL|lhsQ+*6`0u~%kIed7 zEMu7_lmc%=_;L~J%%IKNgM`aM@pcACqlA&Hxcw1-=`tJbQcoip5)2GlFHiRYor;TI z_Pj|1>wLW_rqj*&uJKr&w7H#5I&fQ6?gDN-8<+C`=!s$xEz4N=oL%l-yat51^<-yRA3AWBq@vU3omzTN`Jh8j9>nwqh*VBU#2) z3?cizQz?Y($}kdBWWPkVxsfGH_9fZ(vXil73E3t|2r;~8itep@@8`as_w)K|%R6W+#>P zZuW9UevH#ynlbL|@qqy3dY>7hVx9Vl-(Dj}M{J}OmLFM*cp{7wxFO_sH>G!cXfrxT z@rgcF3rJE*+cgU?0|UVhJ5NUdxbgz!=l68_-3 zquMtu<|KwXR`9IiHX`BM1bS)9N*k53#RT4m>7p;NN_#nPtoCU%VB`ZPv9lcs3}c|$ z_LqZ4d_v>I2cGA>Sa??0moCMnh<|WEE%3>PkHHNYHP2Ysm6`W3`n6M-Ufw#HvT@%# z=v1!m`zSkKwz=C45RQ<%rz3REuUHEIr1yc;6Sor+@U}_r`erZ8ZY6cC!2=CWlF_Q8 zUcEn!2y>wPI=N;#Od2M4oZh^=u9Le=y=P`|nK#1L-=*ye2g3G1tNjqH%hj>5z&)lL z+vkdnk{;}nVZtMW8>t$7Keurito56oE$CFS)Pp1V%@FpBpN+bvJS_Hv5#dKHQ{#d^ zXWNv-U z7}q-aW>t3%R`85L-VqQq_-5QwqsEoJby2kt{z(~75IVBAp5w?{xmUh?7%DIv0_KM% z0rn~Wj1)be;jtP-B$65?2zE&hQk~s8{?L6DoMYj30B>EESGaMiuCtw?9fx#!ugzOk zZGV3K4wQ#c{7@)i)BMno?N;M`s)7i8Cp0v^iq4^@g(j_0y_#0{H%3FX%WsDJu;mrC zr9NH1qaaQ66G3F+7c+g0+As@KfZk(rQaHaCXJGtD%2~MbYsvy9gm#>7b{#U@DNVTQ zq=$S76sda{!si&}6F=|}WE3dnxPuWqD&Tga+AZfK7>;?nQrxY2V3(| z{J6*eGo-|gIk%)CYj!_AG*(5G#9yFtrGc-q0>Nx6R^D5bY}KDgCF{T;3ckwOkJZ>i=t%)4j&3t;no%g@R7<#1ch80> z8MkH#(StW`ulXNIt6Q(3hz~6E>ZQfn;IdmHoIBROfSkMI^E~DtIcF`rFE8rT)6i%NYq-}$0gdufep%H5SaL9*eUWRaUT za^@R~>|TfDzU35ga@_?xbEwI&daigq+{v#yG4IdrE94kyEWZhTDd;EP`CWZ^Safp$ zr3~X-C!&|NspMK$GV?&58B;Py5B5@{ZAwSZA4U@=<>?qFgSx$SW0Z;5VuxBEt^*!=hG{fFH0@z-a4XHZToc> z(Sq*+bioS;Dq^z3-HVU6(*Bs(Z^6F*0KE`Zia^+K~7mm&Kq%wJ*moYd%qHMPya3d>YNqpiMl8lsgP9D|Rs3D6NeRxu$urHR? zcf*QN#>Y!d(;>YlSS7Q=Z6`70Cxz6bHzDaAze<;4#l( zY5qKM;y@iu%vI8A5G;5#+!Kh8IpT=XWOnSv$j3N*Jhx|#HEoH5Gn}hB$4wLZ>SWxN z*^Ew)j8?zZSvkM+8^CH>(fH-#wZK~L-QI14iRHi=)7Y&U?5X1beVn+H`34~QX$T&h z;#kfh^>`6ZQZxlZmcAlG36-mOWvP*vcTl?|8szqviBlC_b0`x7cjo+`hy@Inzy1gMpNrOZ7O0Qn7Jedtvc5k{r@^%gZqW0^F>P;>*JzZJKImw}urnMyY4$Ere5wc5E~Vf> zc9Kx&QBz#>VEkgHia2S&`hsWm+vx9#u|_=sPq|p@#;-Z=%ab-Ra*85G#=znx_Lb|> z8J+d)y_PrWEX`){>*JJfpCiG3nqkV-^aMvTP{&TK{C%uRy%vJ`jTL?d)Irh#G&WN` zD8I@K{4345QMbPB%iX7S_U%0FoF{RfgoCL6mHvC1n-1i@n!JG-! z`3bjaLdLX8)LG@?%&QR*ZBz3siaqo@pZw7Kivc6&?eB1xdl!JEq6UIDYc@5}Vhe~= z54suDXlOyXzh)STAx(apuPqKn@fA&hy++VS7QWu)V8?1bPevj&`E0td_vh*S-JLBo zx!_Bo_Bi3wrhrTfl`u?E{K0%;A|Qld#jwOqZ_q9~SCV-b&vaK#7+f4jnO9f3 zWLblb9H(Z|0xYqV6-ek!@%oV9PD{h?d!loe_tzDB*0G(Vn^8bdg z3YzGbXYdPevKt7TuGFLe&|yLZYW1!@P{WuKX7o4RxLGKY-#Jw!)rXxl0n~ogNYP(PX-|QG=eSJ1&5}YO{7XU-ZlzAU~S$m6#OjI8g z1`na<4~9M(s;f!>TMbUrW4D1HZg?zaU!P-CGzm`tsodEeHLPcV*J&WUB5r0W?n>Wp zV9!nd^sndx6f|Dl^>p~XXbqW)Wc0i0eHZ?h z`+vP~T@tv~gpa>Tvj1gHex3OJE`M#}kNYyqfE3o~-Tn5=!Ot|`KML<}FLb*RjM*rU zyTbpWF-<2hN*w>f&OblYna8p6dz+xzyjR^dyC|Y%d)T@;)!(<00k&O0SeIH z4;o`ErPL&)#28B{)ufaXV?0lO64W_Yv7B>6#26!@nxvGRbLYvm;Mn!=x@)alPHL@h zslV(TIp+{U%gGQz&iPsu(!a&sDOt~4-#!ZIyOaLz%2_WkNPozUcGIJfzB^DNQcAU) zR7%yi-(QrTb8fAzxwV#a{%GmjAI{Gge>KLO^!g-RV+p(dqwzLc^xE6!dA?!VUyAix zT1qLU-0+z9-ZRF$_j`OPT#&wArx0S>wiH4P!+;*`5mam4_<_6bnQG&~-00000NkvXXu0mjfMp?qE literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/script/2.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/script/2.png new file mode 100644 index 0000000000000000000000000000000000000000..1eac155aae83d21adcf8317a8dcf8f80d0d964bd GIT binary patch literal 464 zcmV;>0WbcEP)kFIhEeSa-?0_iGXe9`6j}$k%mcCFp|{B7g!Epa2CZ zKmiI+fC3bt?*hs>H^!vc7{fWgx|C6$$A`9UD}+d~5Tb3{t4q1Wi~kEHA|kqR;<7Bm zFf7ZGnRMMz(=<)ftk>neXN-C8*R0x2eX_Hz>l=;|QC-(nRiQ>p1XW5YrEZ)^L|xb2 zyNFLa`Wxkh8b!lL!^dSp!$-qMjiTYB;b(C)yR5Y_#uOyKz4s}IF zRsfT3sK2D5(ex;&k1kQIb)M%Tk$Il` zyWd}=o>D4=@U{?wQu?av@Qd^N$+YL?Ohn(rL!!{ zvTVa;UMWQgQA(ZhQkbCLmorV%ZKq|Lrb&{ZM`KKsa~}A>9rsL86x#;z>WZG%Na#@r zJ_H}b1i^>kqemh55d57LJsee4HBI9UUvH(9H=3rYs%mJ=VS1Q^5YN9WTI7#8R{9H&!njA4w0L^8$}R%h7UMRzh`Y5Q-f$I=$m-<^6aZSPu9ENx?a xg@$bIR<8ti5&R@cmS1V09*H7RB#K1$;RE-1D=}0)oB99%002ovPDHLkV1iV9H}S_Bo$H_!nbQ-+;jDu5E`06Op=m|+}7Bbtz?**&e|;1ia&Z`WcN1~`KK!9fgxB2Wa1 zKoKYcMW6_D_dxr;Cxm#XC<=cwIE0YC@5fG7E6$)tyRI|FEKXsJ>ADVM^h{f?wRX-e zPT`!>T4Rjj*5|Te-rBa6QVvTdrEJ@F$ZU{fQYobnB3yFL!w07ieF7-we7sixz&T$# zv;yd^w!Zk?-jmk)dcAJr0mc|(Y&B5ESjzjf*3s-)cIio2D5b2mi_v4PRZ8WK(Pt}K z*R@Zf&bi0q5!7^)4vaB%U4Ju1LlQT}csM=pizb5F)htecM0O1?fYPUBYvdTBfS1s;U;#$^Cx6-EL96HKqbWNT{pQhYneV zo+3s!Hy}O@G_gP{%W|?DL*cydpAGm!?2{`RjL!B2WbSiv0udZFR4YSI^i00000g8T0lfZwA=02AVwwz zM&8`=`8)swgTc4lN~IFM7YhIig+g+&_6}b#=waxej~e#(_tk3k!^6Y$^z`7RHAt)j z5Nfqr-z^e#34$O9LVap&Zf@3_nnPQ4e}CT`+Gx;Luc1Dl?^Amk1M*B5S-zi4$&}+b z0C;+O5{s9Ym+5rcXf%GyG!zPzN+pFt;dZ+L;PLU1n4FyK-nDi8 z6+bL4E@HQ$xlg7Ni-r`Lk|~+~FjIzMq&F3p%3`rtuW`9t7Z(?ue)roR!vsOdX0wQR za&i(5hhJV^5HXodiZMe&Lv8LqI_U3zjg5@~K($&`tJNNl2LOhLhfhyW0bpxuD;A4= zfwWc6&(DaMN~O~2v{>W!`)jpY&vz(@Xf~VQj=GX;&?Y7(5V24w;5XEqKEp`xKtAmK z#*rw&Gv#?607gegX){5lWJ;z#^mH;X*%K&%5-5QZD1j2_?*SDzJu)5~dn}&kr>3U* z2I_P=6N$w7`nq^2n~ zFDjMFTrLLyM@L64xw1WKR;+8g}?rgtsVb*VU-00000NkvXX Hu0mjf&?kid literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/script/c2.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/script/c2.png new file mode 100644 index 0000000000000000000000000000000000000000..572ad1ffba49478afcee3e46fee8198be363a0f6 GIT binary patch literal 626 zcmV-&0*(ENP)k^+-H{C=?P8pdyM%m_&y}rBd<=I*AF*BpP182#HA;fs8*|az23=Wa^H2mUMG`DriI<@ zc2=vE5Q2Nalmqi4*GK5PL2Wi00Ho7t&Ra^;w9RJY@pxWrpB|4#08kVq7K^def3Ost zPA5VLr8F1};xR?&Z-L@IMJPfM${N*bRZ)~%74*RvjYgExMx$|~=E=L1-EQA*w>;Y~ zm&-SZ&$K_A%|fA2AQ0f+K8MwBx7z?9NfImdZoiTw8QmNXhvjm~GDWO&DhLAmyx)h4 zqDU#7PN(e9`*Z4aI>+O2tJP9f6(7+EMJPfMYU-`;ZMsKM6h%=KMNt$*QBF}Rm5jvY zat#K9*A*26!ALThOsCU%20=}XL?W?REY9ci6W=xIHLuxh`g}fz!(p*ldc9sgpU3yn zUn81IrS|*%d_IpvBH3&f0NieOx7+1r%H@>EvTP*7;qZqJC}(Ii8m-ssMy{$VM>2<{ zmt~m{vRbVQg@Uf@@pv2nipApfe@yUKD2k#eilQirq9}@@D2jfHzc(*hEZq7lZ=Pp& z{kpuzzH_Q`?>)ZvbLQSV_kaNa^1*(P&+N3`cDt?k%;szi^WOX&`}X#xL@?B3%*As% zxR>Yo^OAk8aD>1$gfa|s!)bksCAfjmMx#LpQK?jf5QoF@#~6HJola+~hhnwtcKe~B zudlDTUC!_XE;2ug{%@k`bo$}p;b>LZY0Kpj0Q`P`p-=#TZnv9Cr2rt2NbLC39?_5H z@p$&e>`8wznb>T$&6krXii^d9Dt!R3*=)yVgJ&N_&uqA*P!vT`6h*g96vcYIZZsM< zuXNh7Cmap~Krk3wHyu0N_5{U%IanH}syTgty z&2y*p)Opk`N_xFSluh&aSNqd+ol}a+1bi3VO1*B3b$|=sa^gPc80)dy8m#zL%sZ^`g z?(XggA%Y-0Jw2IBrhoQC0bn|vp73Yy33f9#6V=kUS}jSE)M~XTiawuDuh(BGC>A9M jil7LJpa_bfS8qQ7ClFT@Dkzn>00000NkvXXu0mjf=doX; literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/sqrt/1.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/sqrt/1.png new file mode 100644 index 0000000000000000000000000000000000000000..f6d0f2e56f9112404f1e0371b7c6de48d3056e20 GIT binary patch literal 800 zcmV+*1K<3KP)20008NNkl zJGj(A9E27Jhq|b^xw*Lb4;0jYz{S}=A+teO9kk%Af?ATr#UEJEE=7Y%(SVT1c|#s~ z)*5T_;xFF$rh89LzI-?L}8y*gaK|k=@M^cl4A%&z!ilj%+P+neMtXAuW@#*Qw z$ZV>j*Xx;_p%jZnT~qX4q#ln40P^`f$8kHd9et$g65q63Dw#~GspPtSbET&%q&`1C zl|r-G{8v)1*Q*p5hA}Pp8;u6f^M1cyD=H0UeKwmdo6V}#L?Xem>_&I#?)|}F0EU3` zK9V9SlKzLQlZ$CR3PqtP6osNt6pBL62DG_!JkQ7D@nA4WQPghF>+9=ODs{5#$>nmj z+wF7j`amF{ZdWMBN_d_Z1VIo4p66BL-xDXg049N9m|QNWloyKy%d$KE*K-`Fm){(r zqtPf73aM2|lDgflmh*T#-e)iCAo~ywhvV(-?Hq@v<#MT(qtR%&Tt2&Tbg@_vLM#@G zQZ1EAZnxX%bRK*lH5QbWO6B?ad9_-3z25IvB}wY{`&#!-CKCfOYOw2lKHtsFjlds?HH&40000C=?1yLZyXP+SwbUg;vWCAfdn?AjSq8jEx;6K-6eR4C`m1Awe{{?k?vQ zlecdlyWp8|N?x@BMJ@bvTq;PUcPvv4Qi_@^s?rKKf(wOXxe%&D}85yz4iWaEVYFfEeDy^-p0Vos-nz2wQ2!ddGZ%a~BEG{nUtKo3i zHmUZ$N+c4zkj-ZG9k#Z%-l8-bjSdbDYSqWbNBxWP>gvk$E_(Kf)M1cI5h;-p={F@! zr_*O=XR<7}+d12P^+}S{)z!sgo{o+VXO!OD-0;G~!vkY15C}Lxy0^E-3+LzOjIouK z6~e94z*2xVFfd@uM6`h=mpVQ^<^_u@ z)-LFc#bSJC+tbs-jb5+!T|qB^?d@#fl!Lit(T$;rvl(NQ9ikR&OYO!CvYxw*Mwv1oC$b|;v@A!M`J<>h7T%kpVL zM@L7Ej@u?@Wigv)FRf>UAP5r^6XkN5SI5T2N~Ka$pIj~{%W^A*{r!D+pL#vIySo9b zuCDIx?iyRy*Vo%*R`nlsxxVzdTyAo5a(;f^v{e+vOeO<>AIDVW2LO-}IEfzEtZQp)l}hEa0002+`1lAKIBe43 zu(xmBZnsjYyuQBbd<_5`4u_2z^m#21e7C7fTWGafu~@9pXcUV@#ga%Qh}IjU;CX)3 zINbE&;sOlt;~w~N0e`8fYt&RI6r4`yxYH${&vP92#dJv~lPuFkU9CFZy1u^tXV5k6 zhP6IFKZ7xFx>)dlE#F7dUr8zm0wKiX@vyLhDSEvg02GTwumUoE(`K_dG16={t31fE z{9V$^%S!+Vhr_zHgTY`h7_cby`~AQKT>D5mVc?WPQY1xE`$>m13@a*htnnEoHCE0A&>-DD7X+p@#%F4mP!S3#^Qq}2n&d<;1 z=H|X6SzcZ?Jjh_%jGN%;>1lp`UTX;kgJ2sNg(eb-Znvw*RV+rinjaHNDV?32otc?& zxm<*hhld9M$mMeCm5hGB-)gl0;O6E=NrlO>%=0|Y^Rg`8-``KwqgveE-NoZ^wJ1rF zNlMN90LNaT3kwU{BFAyMw_?-*nefrhnAqCds@LmU%kAy0lC{-EtyY`HfAr+!#O-#g z_cKbRQZyPJN+a_;|Nj1N#L#ZH8C}9K3LcLK07Ow-U0ofmEtktCxn%R>&HNC}@$z+&+G`}d3jnNYdMWHAZg`!XtibAd812|k# UAGE!VT>t<807*qoM6N<$f(pB&>i_@% literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/sqrt/4.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/images/toolbar/sqrt/4.png new file mode 100644 index 0000000000000000000000000000000000000000..66470a6b0d6767dbe7e4b9d716d09a6e32ee3256 GIT binary patch literal 916 zcmV;F18e+=P)-7`>4W6*~z! zNV~YbmQD(SRXVr{il|T&?CM}A{{{a5p@T>#wRJUvt1e0rp{)+J##%&BL8F)=w1gz) zd&7M%WC zAP~@Xoe=Wz@$vNZ^d|~+@Or(vuGh!^d$Sm*-Q=~isKsJ&X=#ZN^6M}D;hHA|jigd3 zu!8jv0075vUwGwto)AKLnx@$rI6XZzX9Yp%*7@2^3+6}aN6}6deRz1-+1Yt~d~Bzv z&*vK*9W9s3gphDJ%%BSP&~<%lYYPBGQ3Mu{W=Qw<_p}bnha-dN^Ye3GUmpOBjEqB{MgeXoa6h%=Kbwo6gNGvQYv>@tg zP`13hEXy)YdpsVW&sRgZzP@G_)imwu>WZe{-rn49cN?}n7Z(>VFE7<lkhXcUd2Q74T?A`$un!~XvM#Kc7XA-2i43xtW?8p`GJ z+1c6L+?*`SM)2_PaC39BNrfiAy)b;%X;48vpEp{os;b@Rn(w2Pq31X*8jaF)E|&|1 zLNpx=1~ZuqO~+y}Ns@S;=XqX|q*yFQ2$`OqHj0>QZC8ue*Vj)@PK@l@+L|3x5QM$G zJtum!9@%VG)3nLSNh5N1cV|bIW%>2>m9+|2TZ~2`ky5E-jtmbE+mYRF_rSn_6St@H z^Ye|34I>*4hv||sV`^&3?(+Wre!t)E&>WqanW1ms;_uy?{?R!s#>X3SZi#3 zF%1n3DT*>XJ8M~5DwPyP5k*lHMO9UAZf*eJ^70Y@ipApR=O=4*tsj?fZ*K#EfTAeQ qJVNnYk4Dib8bzaM6pfNgh@Avk$*4kb6#{2o}ob#UZp7%M=bIy6r^E~e%K?s5HAOn%GMze{D3EmIj zzi4P^fV?m{If>5-`jILsDgXcyiNw1%gyG>~$QOzLfD0Ec%*@OP*zM)ZmmM7)!D{d8 z?d_ePpI_}MNuqocr8lyKKJRav+S*z{8}S^|sHmv;_;|cDvDs{XBd)BhJU2JD#<+QS zcnD5RNlA$;kF|(WCjt~jXv1JI1g~soXJ=$&w5lxd!OopKu{4v(6ucq7(ev=|n4Fx{ z)YL2~DG`cjeSQ6bfdQ^JOO8)MND+(0l2A_+3ZeC*GiO#d3=9l>^5hAYwXm=V2?_b%J6G0bFc^x8iu}j=_3PIw z3t22yMn(nzV0?UhdU_gLJ9u}q68rY;gAm%-*g#PsV+HK|z7dW{c1P z+KYu7wEq5n0|NuG?>Z2|l9G~l@7_5(I}6oHxasNa?7XnB;Ns#U__2oAZ)AOwmKexj zbAg~ocpN=?RATgqeg2G$jO^aMdu939*qD}S7`0)~#C*LLVO=2%*2fKXS^On3$jh&n8Aj zMp)X@)AP@tKf;=1H8eC(;?=8H5W@KQcof5zo}LaNymsx{8pOE&i{9Q|ygk~<$w_d| z;0@MDU@|i^x$1<6hwsAyvme~JaRW~bD);sEMOn1Ci^v&oZ*QI^Og_YLncf2e0)(0a zEEWsJexdNF=g*&`=C!r8Jv}{RV`J+Qv)I_!zP>(;KWHG$&COAQzl@=v3jAUq2-4Hj z0RX|l!4N`QTieLUNEH>8w6rt`p}oC*d3kwZVWGGzH6Vo za|8D*j2n0E+>y#&ypg(DXJ;o$G&VL$=M1p1V-pk<1f_=!)|zK#X1u(-HpxjdH#gV8 z!9gbMWS4Gj%9tq#p*vyUA+hX3P=C*tDbAcQqFHEC&SR#sMWKp2#Na5;y0 z;>3v)$k~fz5&fMdh4S%VRQ`<>lq7 zs;Z--qgzW)L(7Ggl~rP5;+mB|eE1L@9lg#TeSLjXQd00GWo2blDs}(<{aiI)zI@5y za5_3Va&vQAT3WQVwbxH?W@ctlQIXv2H(gy_0=~1Mp<&Gc!!>_Z#>egbT?)wL%F0S{ zFE~L#K{`4*!ba9f(?J*!5n*d<8xaxV>FIg?{Q2hQX6)}~E+{A{tS9I>H8nLnJbYzT z_@hUUEG#UVnwlCL8@s!^v$L}|T$+FV`bDSHGcz-vJ$ttDX)Tkole)))t#N4jg5^}Q&SUt-muwh7K=5u3b?M=Q4?8+Ku<%m+yg_#? zbai#1Y)(#&p`ju6w5Fy8|1nf5wYs`ma(dd?vuC5CqVU5+r_;r;rr|F{#N)w(2d1W` z__%(1d;1L}@c8lLadB}p8jVJyUB7;P`}XZ_Zf>EWp-8F>3=Ht$zN)IKC?ps{I6FIw zG#9Dq(0O@zF)=YHt*oq!S5>*9zafNQzI;LVnu+iy#cJ2q78Dft`T3!ALPCP8tE;$! zQ=UG3ie-(Bjj<^k7#N5qO+-WlR(W)E6sufSRfVFr3JMB-{P+~TwHwr z{yl|4Ie74(Aic;aZ^p;Rb#!zV78bZ{GfqxUXyM)pkX?IPMn=Za&`@%6GFD<{X4cWs zv4srLvTU?)aBygEZ^vviO-)U3D?z4x1l85mYHDgTGc!oTv9z?@QvMrR_Yp9eOa_Bd zQBm>r>sP|>DO<3#v{YAD--3+cH*Y2;CO8}pARuO_si`R`DQzmh=h)a7gTc_y(D3o` z5!1yHgq|ie78e(>3(h$l&YL%H004D$b(>F5lRw|u@bGY5U0qL44*-BfBDuP{0s!cA zI#;!0c8&zIwYFaj))gn7aAHGxXjE00|Nj6?6@kp zqmSUthGBYoIy5vCUlJJ^2_Y;hD#C8LfDqc++M>&GE?v4Lk7UZ9p2lP{OG``1FMeD`udW|>A000J|NklHZ zWzkaEk{aoUWu`Hrq(q^JNJ2=cMK6k0$kM_HiXa&zy?n^51Yv$q>4nlz`e4Phg3=FL z^kRxmo3uA2p{TZY`f&f;|K+;PyX|hfuIKmZoO931{hi-A&wb9h=Ux#Z1cFBbgoK4! z?Bd0XbolDkt3Hc~;kx3cTy*%$moHR6qtQsE($K9n zh5Y<{I^5OOMTd<>BORWdoekYox3;!M!%o}nc9~2T@#!g($+m6Vh87x|S#U!jYDj?i z0`fsV3yjay)YRNWo6V-z>$z7lG&I!O+A3UqR;*ZY=+GhV`PFLm^5x5UXgEv~B{mo6bUM~<*YDrI{bgo4mH)L3!1CDzw2;rt z%p4mVJ9g~Y?c29mm+s!Z3jm)#e_p$GEdVGKitXFC_x1G^78X*Qkzc=ljg5am2%$G9 zA3l7zckf>MQbR)n03;?R=H%q;+_`gZ+5Y~1jYh*vsjaQ8sHjjV6fyI67A;!jcDn&U zE|*VEP72Uoi-XGTcDt`#yOx@oDoiryk0KxBgM8wcPh8oz1RQBd2FV~9B!gs-Oe9up zKGD?FbmPViUhbxgu|>x&WZOyquM-zrX+E$BzJDG#aUtBS($^fZ1#YfS#V7EnBwm<^qJ=4Q{ua z4sYGMl@Rjn+c&4vIXF1TMH#-HEj*a!D_5?F#s91N;>C;l`udcV6un-rR;&H>8Z%m6 zUVi-eah|tRxbrS6E2G2v_U$9WLvUM79*>79$iiL%s8lKd*t2I(Jdinc>J$L%*s&u{ zb~Gm@Cf2N36DMS(QYrI*Bcs9suHB7-*;s0<}SHunSNd1ZsoY zAW$3B27%fHfKsVMF@&hi>C>m%+S=yLX1CiL8yf+@Y&It+C;$2Lhu_({Rc-Ou#&bYWqk5RRh6Set@^f}lt3&yl~P$*`ThHMhr`j{-tO}^QNleY#4j2f8|8BO{{8!--}KqDXU%5wlP6CCTNLL1 zHvb`;X0=))bg0c}G&VOk&tonCK7IN`gpHW_0-HB)zIX4Q&r3&-9<8aVvDs`|tu`ww ztGl~9Xb&eL5U(?5&SYd{7z_rR%~o7o+}YVFOdmQnHm$U@w5h2nH8qu$?r=C{GMUwC zUA1Zz0NlTSU#r#5&dvs|ZE|wbVzJQn$7C{DESBB7chiO;BO_z=>eWntY`Xxwj zZ*NISi9lceMt`bybaeRpR$$YnO;uG@bTln3&0sKiz1{#nlJRNNSSPKSXlQ6CDk`F* zN~N;8x>}evE!x_6JRa&8yHB*Vv>ZNsm_E8r4V}8Wx?rC-0km1{3a?zb^6As3 zf_>gZL>rUIB$vyXpB2zpw{BgeDGdz`J%9e3EPO<2-V6>7s?};%;>nXIS>GBVV&JE# z)#{?6qMJ8w(kVuxQ7jg3+_(`pF$LkLrKhLAd-pCmIT-*{D%Jb<@3F^)ve!8}I+~lC z3jn#fxh9hdyE`aE_B$=HSghCUWinZFbF+}Y3Hx`~o-bd%MJ4q&p z72vGE?yAgfR?udWQL0c@fU|9PLsdQ^m@JVcnq%+RutRe&R}WK4<#|p&CrR@B{EVq9W0Gc!an7~YmpXA{Oq!;+0ANL1 zAW_frf*`orVn$h(`#Kjw7-Nok#h&Mp)urt2MTWsSKlX_LR2x}sPEiz>8iSM)Up=g7J6JB4H*@)nF-oa@r&??M^XJcfiTb`@Rn;}d zaI?T0z>5B<3H3aWF-G~AYgf!3EBcdC_WOOt*kZA`_85wyIDJc!QZ5#Y6AE80my5*$ zeljF_JBd>6LE2oVIqF;DnX=NpFMvA|m?700nLCI|w~d9T;2 z-7m5%8balEsJw2WIS)0w~@$vEC zuloJI9R_)}RaIU5WUH#OpF)GL{gyHI^72A2XR}%Dih6o_3W9)srh*E4FgTOHJr-3; zo$%0zS|xfd5M3^pZa`R;W$n-7IR5QK%dw(A3PkNN$TX2byX^c3Ax>2JrfJ&m_w9#j zt=&ahDP^ALtJR8LhG96H&2E`yL%Qf5@O}T-(*FrB*S#n`r<&&)Uhcs-lLAqjL!x24 zx(JkI+3A~w@B3~B__T{_jCp>3o=hh0@vZ`kq6mV(P7bZpLUNGk+hB~n>AtSDc2`8p zvg~%dSF#KzlBgt}nqptQQ@nN8OO|DwPG>ru(#!RF?Rnl{Fc^(SHc#fB`*OK-KSD~0 z+9pW!9VG2q6(K~LrdO(AIF=|P3uXnmZ_O^77;`;#3MSn*?J%r=LDCJw&=|8nGY8)U zCqPE`ZBX{o>NAex>utz9Q6S;IFNEm#`?vQYYfH6RmIXmTo(1VPNfLLJ#TbK{{@(yy z7k(#&LxzGew!hR-yDpCj>{Ve?HP5kY+8C20NuK9Y%GGK`6}i_tWhv!!I;DmWR2WS6 zh%`-myEqv`nH!QP7>3`fJew z;C-yH8Do6kuldGwzS#K%yjEm%smRXv{V)tEH+S4>--6)<16st@_kT z6pEtQFM$A%XcM9IAcb3uv8t-VFjPvpTbYe9wUvN_xNH55B1sZgqGxvc18{U3fxGbF z`##lV-{05Z`@XF&7eb&A2ed2}CEN1p)2Gd5bC-|n;he{DOtK_50hcCdO)P57=`l}L zYkf|)*d{-Xi#k(NRULLtgEmQ&8V)eVT#r|4?Y87$jGdDTYI1Z(CY0)L;NpV+(d3#^dp9HnY1c0U#P3iyC7%=MN7LR6E8w9}EVxv*iA~ zL9O-IuU|iZ{)|Fa(8_et-#{3KWm)3!)c_K0Zs3hv5olSu=z64SinWdRLI{DI5v(Wx z_W-tZ0|1GFKcFaz;cz$@45rg5T17*mpm6~+V{AU3&*$^iYW48&fL76vC};{wDQZOG z{dztHtq)^nAW_f=%CgM!+-@9YjD=zNYGZByiGmxEBuNxSuU0b9E&@2f_X-wW+JtS< z;0CM4m@LbRqFArjyWI}$8tx3Vx^4~Bg3PVp&9Y1>MLnjoEIZgV6hNZj7HF;Mi7f7O zT=G1(9bt?y+wB$)H9{;3-T~V2W4pW))P&w@vi3YE0EvRz=`%?ZThwaPLbXQ~N-3M! z;t)WhcTSdNZqd0Li@M2P+m)i$H5(un1y_V~zTIvYi-lbdwKagQKFhLPuh&8dV+@J} z?+h%uG?%h0hr?m*&CzH?c2a9ik2zYcR`gt>UawbG6{U7Ddypt-M3_puz)6#~6&q#- z5(NO<2&9VufJ6ZRkSG9L_NaEGCNz|YrS=+I5E2oZsclNe@}ab}l~9JEwXcnqprW=Q zDr1>a)TEd)mWt3y38jrKTCLcZFa7?2@0{Pg?|Yv6+x-vQWz0f3aF-#LdBp#w7FUoWR?BLCs_iK&-o$oIbWN4#b_VZmM# zDt#$)S1H6M={lGKkO`N!nKjC!)1e+sk|N=U%(;cOFoj-!1QuKY1O88QhtrpL{1KvE z6GA%uha4-KFDzS0V{4wOoZNlc4h~F7D8qo0h=eAzI(Ww#E~-*i46ye}71=G7LnJ`@ zngm85&yn*p(bGLWNy}~Fk=;;iOcAGXcR34AV zZec9@bjB>kzzCE}B(;@o%WUG~-kZaRo`LDW)3JhuwzD=lTl`34!7bS2Gx&d|5|HRT zs3dEoB{X7sxYXk0Gx_Bw6!<`3wZ;Gw)Qh1u!BXG69o4`4t6Z9mLUM7OH>Cpe%l$bh ziWW2}x}0w@m_b^Ql9wykMyo*!b-GQ3x5-B8qxDd^pr0~mFzKK1c)PU&OWGwzh2+?E z4e9bPC)+g!TSD1L6Hn8W^Qk{hM7do2x)|v|Povqhn+z;cXb+6*nDB|^=H<4|&#L56 zSn4QJYXFf-!@jWc8(cv2zN+3Y?T}{a6f&EUxPO^-B{pJo`c7xuojV?QjzCb4S;0Q9 zO)R+5SsHG>I3DR$Kzzr96DW#)C49mA=ZUNux~ADHIz15d@`^O;!Q55kT?+97iB1P5 z_y&wPqDLEmA(=>U$hEeM zFW>#q8apOXi9J7x^n%NAN!8q1O6L138K_)qant%dcS=QN5Vs+uqeechr-gd^AYk_q zW?f2f5>Yg`V635PD}LEv=R#;!&l?qjZ7W@~FX9g}`#uf!DpxG_Ttg7qO)Zr+Z)g(x z40KHP16VDk&jfR|$Qk7uhwX}a<&Laz6BT7mSb2^%ODE7onsuPv$d4}J z2Nm{SZiUyrHW`iD50N#EfZ#BsxHulqqY4s~=Rx49Uy2}?3Y4?v9^GOD74oC=#Y+Z% zGc+^|9S<#Y`Wk6m@#Hr?%18Dv-I0d=U0lot9P)m8S}C~<<^bt4OMH1w;)7A8e42Mb zWh()jPYEvbYf+>G?&Q&6>5W|OHJ}3V|AI84(Ju^ss`>V;>6H)hynNA zHSsH$VTdc`ChH92Fi+Pu?9XSjwVYrVr7vr1YgF{9<5wue;o;$V{Oti3*W%#el$)uv zG3Azn^i0H?^hQqbg|kFFUSue*CB<+~`j8qjRWC$iI>$%9EIytY+`@0klVYE#Qw=#F8{&6Q_gKm4&JPeL+u4T=VLUUBo&7YU^>t3JUhlhK%%SWTdCveerC`5jEQqJ{FR zinV!DQ&XglN@V(70cps<6_4M#L7+qoDf*#neZyXOlXax$pq#RFT?e8NxsnSd62|*L zmkI`U^f9Z3nSQ;GMgkyx;)3%JXHqwwj^%vm_0c*sLsbk#XA`$qSHpG_N=r)a?e7RT z1lNYPW6XWD3u-y3x*Ln^D#IJoD~r3E@(IKIZ|5YmFJ0=2-L(x68IbGDdSLHc4u|s& z;@p-85KzCl?yZOhV;8*n^_4 z@61(5A^UHJpk3~dCP7gk=i9>Axc11h=|G`?g7*=gP@P12xXG)$+}y`;Mhb}0^yeTx zBtm1r6`Oy?dHo#@U|+7jyPE(Ki=VkcfuXaMCXqA{`_P2fNv9W^)TpO5Reg<)6Rd69 zC1L?a3E}ygUr*@&t5;L6vraS0)GKywuL#$eX#VCRdYeP7eaU6<}mjbo2BzqhzWFFu_ZnX<%UPhE*K!P6`cae zb}XHIXibs1C=j=O!|LDz8C+d7do%WCmLYY%{F7^tVunYoG8;62AyMAu}s=}w5;o52}e0lkRW(GP96_9mJM6@xZwJ{ zj!qXIovJ)X&o?W}meS?BXT z>EuTi-|iLH=D+XY%iSKmG~`Cy`s+>|W_>}Sq5JRWZ(FR9^|IvI=gQE~#A>6NXPy`9 zeLNfJx;rd1^hU>`6PDMHDf)5GD$X;J+G@3kPui(t8XM~w*Nd`>F2df=V^&|jXds~5 zwMggmw0-rnmYv;ZxNNVWX>nl5TeXK9uU#vh`~0W7bxLH|v{d$9nYCL5nmU9o&R6!m zyh*23;QmjwV>52%Y>QiOe`uPqG}NqlkcsOlnn#rcOH7HqzGrS$HXsC&A;5BKel^0@DI zCF=K|KYxDwu#n+~IVtLlAxT->q8g|XMC`?LR-c)Q5Y^10vp$K0D;-v7ONyyx1j z!w)~0Eebl7_ixkYYgN1N?%TJ|%sE@nP;f8*z28@}w%&h#IK%kG*D9wD>1!s*XEIE< z<}Pn7JI-^E+8vt>pTHPN{evve#OgAt-q9ck)`_NiNyCOGCV_mfFrgKl}Et zwjRUw!v`gVt+ro&`DO97iIvsV2Dh@h?lc z{^_SvcbuLYwEF6*rN`wI=P2rWPV!kE{QS;Sy^V&?jD6=`mbW-6_0!o40-S>t7}FFE8aw{J(5gD@Sbai}2O+ zi}lWbUS{E~xq4OA_I4hnD*02JY@&-lpOn58RULJIPVu>&XK=Wmvi;=g^1fQE>ROWNv6^Q$Pu~8O*2DSu2DkII%MUX=-dyd-S_`!J zY3(A7S!dJEN`BmbrsIYG7E1k_sY{Wf?c>XZ^$X7y`tr;6vSRA;Z1CsRJn>~B~^U@~9rBjOiG)-mr`j019ytwr0 zeZhg5@ppBc4~ECi?QZH|`tf~Zj~p~f V=M|+_tOS-e44$rjF6*2UngE4UFRK6m literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/styles/base.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/styles/base.css new file mode 100644 index 00000000..355d9b0b --- /dev/null +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/styles/base.css @@ -0,0 +1,40 @@ + +.kf-editor { + width: 100%; + height: 100%; + border: 1px solid #e0e0e0; + position: relative; + top: 0; + left: 0; + + overflow: hidden; + z-index: 2; + background-color: #f6f5ee; +} + +.kf-editor-edit-area { + position: relative; + top: 0; + left: 0; + + z-index: 1; + height: 0; + background-color: white; + /*background-color: white;*/ + /*background-size: 21px 21px;*/ + /*background-position: 0 0,10px 10px;*/ + /*background-image: -webkit-linear-gradient(45deg,#efefef 25%,transparent 25%,transparent 75%,#efefef 75%,#efefef),-webkit-linear-gradient(45deg,#efefef 25%,transparent 25%,transparent 75%,#efefef 75%,#efefef);*/ + /*background-image: linear-gradient(45deg,#efefef 25%,transparent 25%,transparent 75%,#efefef 75%,#efefef),linear-gradient(45deg,#efefef 25%,transparent 25%,transparent 75%,#efefef 75%,#efefef);*/ +} + +.kf-editor-canvas-container { + width: 100%; + height: 100%; +} + +.kf-editor-input-box { + position: fixed; + top: 0; + left: -99999999px; + z-index: 999999; +} \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/styles/page.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/styles/page.css new file mode 100644 index 00000000..8026403b --- /dev/null +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/styles/page.css @@ -0,0 +1,12 @@ + +html, body { + width: 100%; + height: 100%; + padding: 0; + margin: 0; + background: rgba( 48, 48, 48, 0.5 ); +} + +body { + height: 1000px; +} diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/styles/scrollbar.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/styles/scrollbar.css new file mode 100644 index 00000000..b8254b0c --- /dev/null +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/styles/scrollbar.css @@ -0,0 +1,78 @@ +/*! + * 滚动条 + **/ + +.kf-editor-edit-scrollbar { + width: 100%; + height: 16px; + position: absolute; + bottom: 0; + left: 0; + z-index: 994; + border-top: 1px solid #ddd; +} + +.kf-editor-ui-left-button { + position: absolute; + top: 0; + left: 0; + width: 5px; + height: 100%; + background: white; +} + +.kf-editor-ui-right-button { + position: absolute; + top: 0; + right: 0; + width: 5px; + height: 100%; + background: white; +} + +.kf-editor-ui-track { + position: absolute; + top: 0; + left: 5px; + width: 0; + height: 100%; + background-image: url(../images/scrollbar/edit/bar-left.png), url(../images/scrollbar/edit/bar-right.png), url(../images/scrollbar/edit/bar-bg.png); + background-repeat: no-repeat, no-repeat, repeat-x; + background-position: 0 0, right 0, 0 0; +} + +.kf-editor-ui-thumb { + position: absolute; + top: 0; + left: 0; + width: 0; + height: 100%; +} + +.kf-editor-ui-thumb-left { + width: 5px; + height: 100%; + position: absolute; + top: 0; + left: 0; + background: url(../images/scrollbar/edit/thumb-left.png) no-repeat 0 0; + z-index: 1; +} + +.kf-editor-ui-thumb-right { + width: 5px; + height: 100%; + position: absolute; + top: 0; + right: 0; + background: url(../images/scrollbar/edit/thumb-right.png) no-repeat 0 0; +} + +.kf-editor-ui-thumb-body { + position: absolute; + top: 0; + left: 5px; + width: 0; + height: 100%; + background: url(../images/scrollbar/edit/thumb-bg.png) repeat-x 0 0; +} \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/styles/ui.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/styles/ui.css new file mode 100644 index 00000000..e8ac4708 --- /dev/null +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/styles/ui.css @@ -0,0 +1,536 @@ +/* 工具栏 */ +.kf-editor-toolbar { + width: 100%; + padding: 1px 10px; + position: relative; + top: 0; + left: 0; + z-index: 2; + background-color: #f6f5ee; + border-bottom: 1px solid #ccc; + -moz-box-shadow:1px 1px 1px rgba( 0, 0, 0, 0.1 ); + -webkit-box-shadow:1px 1px 1px rgba( 0, 0, 0, 0.1 ); + box-shadow:1px 1px 1px rgba( 0, 0, 0, 0.1 ); + color: #000; + font-family: Helvetica, Arial, "微软雅黑", "Microsoft YaHei", "宋体", sans-serif; +} + +/* 按钮 */ +.kf-editor-ui-button { + padding: 8px 6px; + height: 79px; + font-size: 12px; + display: inline-block; + border: 1px solid transparent; + border-radius: 3px; + cursor: default; + position: relative; + top: 0; + left: 0; + z-index: 3; + vertical-align: top; + opacity: 0.5; + margin-right: 1px; +} + +.kf-editor-toolbar .kf-editor-ui-overlap-button { + width: 100%; + height: 25px; + background: #53b856; + border-radius: 0; +} + +.kf-editor-ui-button-icon { + width: 32px; + height: 32px; + margin: 2px auto; +} + +.kf-editor-ui-button-label { + color: #666; + text-align: center; + display: block; + font-size: 12px; + line-height: 20px; +} + +.kf-editor-ui-overlap-button .kf-editor-ui-button-label { + padding: 3px 5px; + text-align: left; + color: white; + font-size: 12px; +} + +.kf-editor-ui-button-sign { + border: 4px solid transparent; + border-top-color: #2d2d2d; + width: 0; + height: 0; + display: inline-block; + margin: 8px auto; + vertical-align: top; +} + +.kf-editor-ui-button-mount-point { + display: none; + position: absolute; + bottom: -2px; + left: -1px; +} + +.kf-editor-ui-overlap-button .kf-editor-ui-button-mount-point { + width: 100%; + height: 10000px; +} + +.kf-editor-ui-wrap-group { + overflow-x: hidden; + overflow-y: auto; +} + +.kf-editor-ui-overlap-button .kf-editor-ui-button-mount-point { + top: 27px; +} + +.kf-editor-toolbar .kf-editor-ui-button-in { + border-color: #8fcc91!important; + background: #e0f0dd!important; +} + +.kf-editor-toolbar .kf-editor-ui-overlap-button { + padding-top: 0; + padding-bottom: 0; + border-color: #61b864!important; + background: #61b864!important; +} + +/* 分割符 */ +.kf-editor-ui-delimiter { + width: 11px; + height: 100%; + display: none; +} + +.kf-editor-ui-enabled.kf-editor-ui-button:HOVER { + border: 1px solid #a9d9ab; + background: #ebf7e6; +} + +.kf-editor-ui-enabled.kf-editor-ui-overlap-button:HOVER { + border: 1px solid #53b856; + background: #53b856; +} + +.kf-editor-ui-delimiter-line { + width: 1px; + height: 100%; + margin: 0 auto; + background: -webkit-linear-gradient(top, rgba(233, 233, 233, 0.11), rgba(92, 92, 92, 0.20) 60%, rgba(92, 92, 92, 0.41) 80%, rgba(123, 123, 123, 0.50)); +} + +/* box */ +.kf-editor-ui-box { + border: 1px solid #b3aead; + border-radius: 3px; + box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.11); + background: white; + position: absolute; + top: 0; + left: -1px; + overflow-x: hidden; + overflow-y: auto; +} + +.kf-editor-ui-area .kf-editor-ui-box { + border-color: #61b864; +} + +.kf-editor-ui-box-container { + font-size: 12px; +} + +.kf-editor-ui-box-group-title { + background-color: #f7f6f0; + height: 23px; + line-height: 23px; + font-size: 12px; + border: 1px solid #ebeae4; + border-width: 1px 0; + padding-left: 12px; +} + +.kf-editor-ui-box-group-item-container { + padding: 7px 9px 17px 9px; +} + +.kf-editor-ui-overlap-container { + overflow: hidden; +} + +.kf-editor-ui-area .kf-editor-ui-box { + top: -1px; +} + +.kf-editor-ui-overlap-container .kf-editor-ui-button-sign { + border-top-color: white; + border-width: 4px; + margin-left: 10px; + margin-top: 8px; +} + +.kf-editor-ui-yushe-btn .kf-editor-ui-box-item { + border: 1px solid transparent; + padding: 5px; +} + +.kf-editor-ui-box-item { + display: inline-block; + margin: 4px; +} + +.kf-editor-ui-box-item-content:HOVER { + border-color: #dff3df; +} + +.kf-editor-ui-box-item-content:HOVER .kf-editor-ui-box-item-val { + border-color: #6eb864; +} + +.kf-editor-ui-area .kf-editor-ui-box-item { + position: relative; + top: 0; + left: 0; + width: 32px; + height: 32px; + border: 0; + margin: 3px; + padding: 0; + z-index: 1; +} + +.kf-editor-ui-area .kf-editor-ui-box-item img { + width: 32px; + height: 32px; +} + + +.kf-editor-ui-box-item-label { + margin-bottom: 5px; +} + +.kf-editor-ui-box-item-content { + background: white; + border: 1px solid white; +} + +.kf-editor-ui-area .kf-editor-ui-box-item-content { + position: absolute; + top: 0; + left: 0; +} + +.kf-editor-ui-area .kf-editor-ui-box-item-content:HOVER { + border: 1px solid #dff3df; +} + +.kf-editor-ui-box-item-val { + padding: 5px; + line-height: 0; + border: 1px solid #808080; +} + +.kf-editor-ui-area .kf-editor-ui-box-item-val { + padding: 0; + margin: 0; +} + +/* area */ +.kf-editor-ui-area { + height: 79px; + display: inline-block; + cursor: default; + position: relative; + top: 0; + left: 0; + vertical-align: top; + opacity: 0.5; + z-index: 4; + border: 1px solid #e0dfd5; + border-radius: 4px; + background: white; + margin: 8px 10px; +} + +.kf-editor-ui-area-container { + width: 293px; + height: 70px; + /*margin: 7px 5px 5px 5px;*/ + margin: 5px; + display: inline-block; + border-right: 0; + vertical-align: top; + position: relative; + top: 0; + left: 0; + overflow: hidden; +} + +.kf-editor-ui-area-panel { + position: absolute; + top: 0; + left: 0; + line-height: 0; + background: white; + -webkit-transition: top 0.5s linear; + -moz-transition: top 0.5s linear; + transition: top 0.5s linear; +} + +.kf-editor-ui-area-button-container { + display: inline-block; + width: 16px; + height: 100%; + overflow: hidden; + text-align: center; + border: 0 solid #D3D3D3; + border-left-width: 1px; + background-color: #f2f0e6; +} + +.kf-editor-ui-moveup-button, .kf-editor-ui-movedown-button { + line-height: 25px; + height: 30px; +} + +.kf-editor-ui-moveup-button { + background: url("../images/toolbar/btn.png") -304px 9px no-repeat; +} + +.kf-editor-ui-movedown-button { + border: 1px solid #D3D3D3; + border-width: 1px 0; + background: url("../images/toolbar/btn.png") -325px 9px no-repeat; +} + +.kf-editor-ui-area-button { + width: 100%; + height: 50px; + line-height: 26px; + background: url("../images/toolbar/btn.png") -346px 0 no-repeat; +} + +.kf-editor-ui-enabled .kf-editor-ui-area-button:HOVER { + background-color: #e5e4e1; +} + +.kf-editor-ui-enabled .kf-editor-ui-moveup-button:HOVER { + background-color: #e5e4e1; +} + +.kf-editor-ui-enabled .kf-editor-ui-movedown-button:HOVER { + background-color: #e5e4e1; +} + +.kf-editor-ui-area-button-container .kf-editor-ui-disabled { + opacity: 0.25; + background-color: transparent!important; +} + +.kf-editor-ui-area-mount { + position: absolute; + top: 0; + left: 0; + display: none; +} + +.kf-editor-ui-overlap-title { + width: 100%; + line-height: 1.5; +} + +/* list */ +.kf-editor-ui-list { + background: #f9f8f5; + border: 1px solid #b3aead; + border-radius: 3px; + position: fixed; + top: 0; + left: 0; + box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.11); +} + +.kf-editor-ui-list-bg { + display: none; +} + +.kf-editor-ui-list-item-container { + position: relative; + top: 0; + left: 0; + z-index: 2; +} + +.kf-editor-ui-list-item { + line-height: 24px; + padding: 2px 6px; + border: 1px solid transparent; + border-width: 1px 0; +} + +.kf-editor-ui-list-item-select { + color: #61b864; + font-weight: bold; +} + +.kf-editor-ui-list-item-select .kf-editor-ui-list-item-icon { + visibility: visible; + width: 16px; + height: 16px; + background: url(../images/toolbar/btn.png) no-repeat -367px 0; +} + +.kf-editor-ui-list-item:HOVER { + border-color: #beddbf; + background-color: #ecf3e9; +} + +.kf-editor-ui-list-item-icon { + width: 16px; + height: 16px; + display: inline-block; + vertical-align: middle; + margin-top: -2px; + margin-right: 4px; + visibility: hidden; +} + +/* area 内容区 */ +.kf-editor-ui-area-item { + width: 26px; + height: 26px; + position: absolute; + top: 0; + left: 0; +} + +.kf-editor-ui-area-item-inner { + width: 34px; + height: 34px; + border: 1px solid white; + position: absolute; + top: -4px; + left: -4px; + -webkit-transition: all 0.1s linear; + -moz-transition: all 0.1s linear; + transition: all 0.1s linear; + + -webkit-transform: scale( 0.76 ); + -moz-transform: scale( 0.76 ); + transform: scale( 0.76 ); +} + +.kf-editor-ui-enabled .kf-editor-ui-area-item-inner:HOVER { + border-color: #dff3df; + + -webkit-transform: scale( 1 ); + -moz-transform: scale( 1 ); + transform: scale( 1 ); +} + +.kf-editor-ui-area-item-img { + width: 32px; + height: 32px; + border: 1px solid #808080; + -webkit-transition: all 0.1s linear; + -moz-transition: all 0.1s linear; + transition: all 0.1s linear; +} + +.kf-editor-ui-enabled .kf-editor-ui-area-item-inner:HOVER .kf-editor-ui-area-item-img { + border-color: #6eb864; +} + +.kf-editor-ui-enabled { + opacity: 1; +} + +.kf-editor-ui-overlap-container .kf-editor-ui-box-item { + width: 34px; + height: 34px; + border: 1px solid white; +} + +.kf-editor-ui-overlap-container .kf-editor-ui-box-item-content:HOVER { +} + +.kf-editor-ui-overlap-container .kf-editor-ui-box-item-val { + width: 32px; + height: 32px; +} + +/* scrollbar */ +.kf-editor-ui-box::-webkit-scrollbar { + width: 17px; + background: url(../images/scrollbar/custom/bg.png) 0 0 repeat-y white; +} + +.kf-editor-ui-box::-webkit-scrollbar-button:end:increment { + height: 5px; + background: url(../images/scrollbar/custom/down.png) 0 0 repeat-y white; +} +/*定义滚动条渐减按扭的样式 */ +.kf-editor-ui-box::-webkit-scrollbar-button:start:decrement { + height: 5px; + background: url(../images/scrollbar/custom/up.png) 0 0 repeat-y white; +} + +/* 垂直滚动条的第三层轨道的上段 */ +.kf-editor-ui-box::-webkit-scrollbar-track-piece:vertical:start { + background-image: url(../images/scrollbar/custom/top.png), url(../images/scrollbar/custom/bg.png); + background-repeat: no-repeat, repeat-y; +} +/* 垂直滚动条的第三层轨道的下段 */ +.kf-editor-ui-box::-webkit-scrollbar-track-piece:vertical:end { + background-image: url(../images/scrollbar/custom/bottom.png), url(../images/scrollbar/custom/bg.png); + background-repeat: no-repeat, repeat-y; + background-position: 0 bottom, 0 0; +} +/* 垂直滚动条的滑动块 */ +.kf-editor-ui-box::-webkit-scrollbar-thumb:vertical { + /*background: url(./images2/bar.png) 6px 0 no-repeat;*/ + /*background-size: 6px;*/ + -webkit-border-image: url(../images/scrollbar/custom/bar.png) 8; + border-width: 10px; +} + +.kf-editor-ui-wrap-group::-webkit-scrollbar { + width: 17px; + background: url(../images/scrollbar/custom/bg.png) 0 0 repeat-y white; +} + +.kf-editor-ui-wrap-group::-webkit-scrollbar-button:end:increment { + height: 5px; + background: url(../images/scrollbar/custom/down.png) 0 0 repeat-y white; +} +/*定义滚动条渐减按扭的样式 */ +.kf-editor-ui-wrap-group::-webkit-scrollbar-button:start:decrement { + height: 5px; + background: url(../images/scrollbar/custom/up.png) 0 0 repeat-y white; +} + +/* 垂直滚动条的第三层轨道的上段 */ +.kf-editor-ui-wrap-group::-webkit-scrollbar-track-piece:vertical:start { + background-image: url(../images/scrollbar/custom/top.png), url(../images/scrollbar/custom/bg.png); + background-repeat: no-repeat, repeat-y; +} +/* 垂直滚动条的第三层轨道的下段 */ +.kf-editor-ui-wrap-group::-webkit-scrollbar-track-piece:vertical:end { + background-image: url(../images/scrollbar/custom/bottom.png), url(../images/scrollbar/custom/bg.png); + background-repeat: no-repeat, repeat-y; + background-position: 0 bottom, 0 0; +} +/* 垂直滚动条的滑动块 */ +.kf-editor-ui-wrap-group::-webkit-scrollbar-thumb:vertical { + -webkit-border-image: url(../images/scrollbar/custom/bar.png) 8; + border-width: 10px; +} \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/theme/default/fui.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/theme/default/fui.css new file mode 100644 index 00000000..de07bba5 --- /dev/null +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/theme/default/fui.css @@ -0,0 +1,540 @@ +/** + * 所有构件样式规则 + **/ +/** + * FUI 通用样式定义 + */ +/*------------ var*/ +/*------------ mixin*/ +.fui-widget { + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-user-drag: none; + color: #000000; + line-height: 1.5; + font-size: 12px; + font-family: "ff-tisa-web-pro-1", "ff-tisa-web-pro-2", "Lucida Grande", "Hiragino Sans GB", "Hiragino Sans GB W3", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; + -webkit-font-smoothing: antialiased; + outline: none; + display: inline-block; + vertical-align: top; + position: relative; + top: 0; + left: 0; +} +.fui-widget.fui-selectable { + -webkit-user-select: text; + -khtml-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + -webkit-user-drag: text; +} +.fui-widget * { + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-user-drag: none; +} +.fui-widget.fui-disabled { + opacity: 0.3!important; +} +.fui-widget.fui-hide { + display: none!important; +} +.fui-widget.fui-mask-animate { + -webkit-transition: all 0.2s; +} +.fui-widget.fui-mask-hint { + -webkit-transform: perspective(600px) translateZ(30px); +} + +/** + * 容器类通用样式 + **/ +/** + * FUI 通用样式定义 + */ +/*------------ var*/ +/*------------ mixin*/ +.fui-container { + overflow: hidden; + position: relative; + top: 0; + left: 0; +} +.fui-container.fui-disabled { + opacity: 1!important; +} + +/** + * FUI 通用样式定义 + */ +/*------------ var*/ +/*------------ mixin*/ +.fui-button-menu { + border: 1px solid white; +} +.fui-button-menu:HOVER { + border-color: #d5e1f2; +} +.fui-button-menu.fui-button-active { + border-color: #d5e1f2; + background: #d5e1f2; +} +.fui-button-menu.fui-button-active .fui-button { + background: #d5e1f2; +} +.fui-button-menu.fui-layout-top, +.fui-button-menu.fui-layout-bottom { + text-align: center; +} +.fui-button-menu.fui-layout-top .fui-open-btn, +.fui-button-menu.fui-layout-bottom .fui-open-btn { + display: block; +} + +/** + * 通用button + */ +/** + * FUI 通用样式定义 + */ +/*------------ var*/ +/*------------ mixin*/ +.fui-button { + overflow: hidden; + cursor: default; + font-size: 0; +} +.fui-button ._layout .fui-label { + display: block; +} +.fui-button ._layout .fui-icon { + display: block; +} +.fui-button .fui-icon { + display: inline-block; + vertical-align: middle; +} +.fui-button .fui-label { + display: inline-block; + vertical-align: middle; +} +.fui-button.fui-button-layout-top .fui-label { + display: block; +} +.fui-button.fui-button-layout-top .fui-icon { + display: block; +} +.fui-button.fui-button-layout-bottom .fui-label { + display: block; +} +.fui-button.fui-button-layout-bottom .fui-icon { + display: block; +} +.fui-button:HOVER { + background-color: #d5e1f2 !important; + color: #000000 !important; +} +.fui-button:ACTIVE { + background-color: #87a9da !important; + color: #000000 !important; +} +.fui-button.fui-disabled:HOVER { + background-color: #ffffff !important; + color: #000000 !important; +} +.fui-button.fui-disabled:ACTIVE { + background-color: #ffffff !important; + color: #000000 !important; +} + +/** + * FUI 通用样式定义 + */ +/*------------ var*/ +/*------------ mixin*/ +.fui-colorpicker { + background-color: #fff; +} +.fui-colorpicker-container { + border: 1px solid #d3d3d3; +} +.fui-colorpicker-container .fui-colorpicker-title { + background: #eee; + padding: 2px 4px; +} +.fui-colorpicker-container .fui-colorpicker-colors { + margin: 0; + padding: 0; + font-size: 0; + line-height: 0; +} +.fui-colorpicker-container .fui-colorpicker-colors-line0 { + margin-bottom: 3px; +} +.fui-colorpicker-container .fui-colorpicker-item { + display: inline-block; + margin: 0 2px; + width: 13px; + height: 13px; + border-style: solid; + border-width: 1px; +} +.fui-colorpicker-container .fui-colorpicker-commoncolor, +.fui-colorpicker-container .fui-colorpicker-standardcolor { + margin: 4px 3px; + white-space: nowrap; +} +.fui-colorpicker-container .fui-colorpicker-toolbar { + margin: 4px; + height: 27px; +} +.fui-colorpicker-container .fui-colorpicker-toolbar .fui-colorpicker-preview { + display: inline-block; + height: 25px; + line-height: 25px; + width: 120px; + border: 1px solid #d3d3d3; +} +.fui-colorpicker-container .fui-colorpicker-toolbar .fui-colorpicker-clear { + display: inline-block; + height: 25px; + line-height: 25px; + width: 60px; + border: 1px solid #d3d3d3; + font-size: 12px; + text-align: center; + position: absolute; + right: 5px; + cursor: pointer; +} + +/** + * FUI 通用样式定义 + */ +/*------------ var*/ +/*------------ mixin*/ + +/** + * 通用button + */ +/** + * FUI 通用样式定义 + */ +/*------------ var*/ +/*------------ mixin*/ +.fui-dialog { + position: fixed; + top: -1000000px; + left: -100000px; + border: 1px solid #B1B1B1; + background: #fff; +} +.fui-dialog .fui-panel-content { + width: auto!important; + height: auto!important; + padding: 2px; +} +.fui-dialog .fui-dialog-caption { + margin: 0; + padding: 5px; + font-size: 16px; + font-weight: normal; + line-height: 1; + display: inline-block; +} +.fui-dialog .fui-dialog-head .fui-close-button { + float: right; +} +.fui-dialog .fui-dialog-head .fui-close-button .fui-close-button-icon { + width: 16px; + height: 16px; + background: url("images/close.png") no-repeat 0 0; +} + +/** + * FUI 通用样式定义 + */ +/*------------ var*/ +/*------------ mixin*/ +.fui-drop-panel { + border: 1px solid #d3d3d3; + overflow: hidden; + position: relative; +} +.fui-drop-panel .fui-drop-panel-content { + display: inline-block; +} +.fui-drop-panel .fui-drop-panel-placeholder { + display: none; +} +.fui-drop-panel .fui-drop-panel-button { + border-left: 1px solid #d3d3d3; + visibility: visible; +} +.fui-drop-panel .fui-drop-panel-button:HOVER { + border-color: #d5e1f2; +} +.fui-drop-panel .fui-drop-panel-button:ACTIVE { + border-color: #87a9da; +} +.fui-drop-panel:HOVER { + border-color: #d5e1f2; +} +.fui-drop-panel:HOVER .fui-drop-panel-button { + border-left-color: #d5e1f2; +} +.fui-drop-panel:ACTIVE { + border-color: #87a9da; +} +.fui-drop-panel:ACTIVE .fui-drop-panel-button { + border-left-color: #d5e1f2; +} +.fui-drop-panel.fui-drop-panel-open { + overflow: visible; +} +.fui-drop-panel.fui-drop-panel-open .fui-drop-panel-content { + border: 1px solid #d3d3d3; + position: absolute; + top: -1px; + left: -1px; +} +.fui-drop-panel.fui-drop-panel-open .fui-drop-panel-button { + visibility: hidden; +} +.fui-drop-panel.fui-drop-panel-open .fui-drop-panel-placeholder { + display: inline-block; +} +.fui-drop-panel-popup { + border: 1px solid #d3d3d3; +} +.fui-drop-panel-popup:HOVER { + border-color: #d5e1f2; +} +.fui-drop-panel-popup:HOVER .fui-drop-panel-button { + border-left-color: #d5e1f2; +} +.fui-drop-panel-popup:ACTIVE { + border-color: #87a9da; +} +.fui-drop-panel-popup:ACTIVE .fui-drop-panel-button { + border-left-color: #d5e1f2; +} + +.fui-icon { + text-align: center; + font-size: 0; +} +.fui-icon img { + display: inline-block; +} + +/** + * FUI 通用样式定义 + */ +/*------------ var*/ +/*------------ mixin*/ +.fui-input-button { + border: 1px solid #ababab; +} +.fui-input-button .fui-input { + vertical-align: middle; + border: none!important; +} +.fui-input-button .fui-button { + vertical-align: middle; +} +.fui-input-button:HOVER { + border-color: #87a9da; +} +.fui-input-button:ACTIVE { + border-color: #87a9da; +} + +/** + * FUI 通用样式定义 + */ +/*------------ var*/ +/*------------ mixin*/ +.fui-input { + border: 1px solid #d3d3d3; + padding: 1px; + margin: 0; +} +.fui-input:HOVER, +.fui-input:FOCUS { + border-color: #4d90fe!important; +} + +/** + * FUI 通用样式定义 + */ +/*------------ var*/ +/*------------ mixin*/ +.fui-item { + font-size: 0; +} +.fui-item .fui-icon { + vertical-align: middle; +} +.fui-item .fui-label { + vertical-align: middle; +} +.fui-item.fui-item-selected { + background: #87a9da; +} + +/** + * FUI 通用样式定义 + */ +/*------------ var*/ +/*------------ mixin*/ +.fui-label-panel .fui-label-panel-label { + width: 100%; + color: #666; +} +.fui-label-panel.fui-no-position .fui-label-panel-label { + position: static!important; +} +.fui-label-panel.fui-layout-bottom .fui-label-panel-label { + position: absolute; + bottom: 0; + left: 0; + top: auto; + z-index: 2; +} + +.fui-label { + cursor: default; + display: inline-block; + white-space: nowrap; +} + +/** + * 通用button + */ +.fui-mask { + position: fixed; + z-index: 99998; +} + +/** + * FUI 通用样式定义 + */ +/*------------ var*/ +/*------------ mixin*/ +.fui-menu { + background-color: #fff; + border: 1px solid #d3d3d3; +} +.fui-menu .fui-item { + padding: 2px 5px; + display: block!important; +} +.fui-menu .fui-item:HOVER { + background: #d5e1f2; +} + +/** + * 通用button + */ +/** + * FUI 通用样式定义 + */ +/*------------ var*/ +/*------------ mixin*/ +.fui-panel { + display: inline-block; + vertical-align: top; + overflow-y: auto; + overflow-x: hidden; +} +.fui-panel .fui-panel-content { + position: relative; + top: 0; + left: 0; +} +.fui-panel .fui-panel-content { + width: 100%; + height: 100%; +} +.fui-panel.fui-container-column { + font-size: 0; +} +.fui-panel.fui-container-column .fui-column { + display: block; +} + +/** + * 通用button + */ +.fui-ppanel::-webkit-scrollbar { + width: 15px; +} +.fui-ppanel::-webkit-scrollbar-button:start:decrement, +.fui-ppanel::-webkit-scrollbar-button:end:decrement, +.fui-ppanel::-webkit-scrollbar-button:start:increment, +.fui-ppanel::-webkit-scrollbar-button:end:increment, +.fui-ppanel::-webkit-scrollbar-thumb { + border: 1px solid #e7e7e7; +} +.fui-ppanel.fui-ppanel-position { + position: fixed; + z-index: 99999; +} + +/** + * FUI 通用样式定义 + */ +/*------------ var*/ +/*------------ mixin*/ +.fui-separator { + background: #6d6d6d; +} + +/** + * Spin-button + */ +.fui-spin-button .fui-spin-up-btn .fui-icon, +.fui-spin-button .fui-spin-down-btn .fui-icon { + width: 16px; + height: 9px; + background: url("images/up.png") no-repeat 3px 1.5px; +} +.fui-spin-button .fui-spin-down-btn .fui-icon { + background-image: url("images/down.png"); +} + +/** + * 通用button + */ +/** + * FUI 通用样式定义 + */ +/*------------ var*/ +/*------------ mixin*/ +.fui-tabs .fui-selected { + background-color: #d5e1f2; +} + +/** + * 可切换Button (ToggleButton) + */ +/** + * FUI 通用样式定义 + */ +/*------------ var*/ +/*------------ mixin*/ +.fui-toggle-button.fui-button-pressed { + background-color: #aec5e6; +} +.fui-toggle-button.fui-button-pressed.fui-disabled { + background-color: #aec5e6 !important; +} diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/theme/default/fui.min.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/theme/default/fui.min.css new file mode 100644 index 00000000..3faab2ac --- /dev/null +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/theme/default/fui.min.css @@ -0,0 +1,10 @@ +/*! + * ==================================================== + * Themes file * Flex UI - v1.0.0 - 2014-07-28 + * https://github.com/fex-team/fui + * GitHub: https://github.com/fex-team/fui.git + * Copyright (c) 2014 Baidu Kity Group; Licensed MIT + * ==================================================== + */ + +.fui-widget{-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-drag:none;color:#000;line-height:1.5;font-size:12px;font-family:ff-tisa-web-pro-1,ff-tisa-web-pro-2,"Lucida Grande","Hiragino Sans GB","Hiragino Sans GB W3","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;-webkit-font-smoothing:antialiased;outline:0;display:inline-block;vertical-align:top;position:relative;top:0;left:0}.fui-widget.fui-selectable{-webkit-user-select:text;-khtml-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;-webkit-user-drag:text}.fui-widget *{-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-drag:none}.fui-widget.fui-disabled{opacity:.3!important}.fui-widget.fui-hide{display:none!important}.fui-widget.fui-mask-animate{-webkit-transition:all .2s}.fui-widget.fui-mask-hint{-webkit-transform:perspective(600px) translateZ(30px)}.fui-container{overflow:hidden;position:relative;top:0;left:0}.fui-container.fui-disabled{opacity:1!important}.fui-button-menu{border:1px solid #fff}.fui-button-menu:HOVER{border-color:#d5e1f2}.fui-button-menu.fui-button-active{border-color:#d5e1f2;background:#d5e1f2}.fui-button-menu.fui-button-active .fui-button{background:#d5e1f2}.fui-button-menu.fui-layout-bottom,.fui-button-menu.fui-layout-top{text-align:center}.fui-button-menu.fui-layout-bottom .fui-open-btn,.fui-button-menu.fui-layout-top .fui-open-btn{display:block}.fui-button{overflow:hidden;cursor:default;font-size:0}.fui-button ._layout .fui-icon,.fui-button ._layout .fui-label{display:block}.fui-button .fui-icon,.fui-button .fui-label{display:inline-block;vertical-align:middle}.fui-button.fui-button-layout-bottom .fui-icon,.fui-button.fui-button-layout-bottom .fui-label,.fui-button.fui-button-layout-top .fui-icon,.fui-button.fui-button-layout-top .fui-label{display:block}.fui-button:HOVER{background-color:#d5e1f2!important;color:#000!important}.fui-button:ACTIVE{background-color:#87a9da!important;color:#000!important}.fui-button.fui-disabled:ACTIVE,.fui-button.fui-disabled:HOVER{background-color:#fff!important;color:#000!important}.fui-colorpicker{background-color:#fff}.fui-colorpicker-container{border:1px solid #d3d3d3}.fui-colorpicker-container .fui-colorpicker-title{background:#eee;padding:2px 4px}.fui-colorpicker-container .fui-colorpicker-colors{margin:0;padding:0;font-size:0;line-height:0}.fui-colorpicker-container .fui-colorpicker-colors-line0{margin-bottom:3px}.fui-colorpicker-container .fui-colorpicker-item{display:inline-block;margin:0 2px;width:13px;height:13px;border-style:solid;border-width:1px}.fui-colorpicker-container .fui-colorpicker-commoncolor,.fui-colorpicker-container .fui-colorpicker-standardcolor{margin:4px 3px;white-space:nowrap}.fui-colorpicker-container .fui-colorpicker-toolbar{margin:4px;height:27px}.fui-colorpicker-container .fui-colorpicker-toolbar .fui-colorpicker-preview{display:inline-block;height:25px;line-height:25px;width:120px;border:1px solid #d3d3d3}.fui-colorpicker-container .fui-colorpicker-toolbar .fui-colorpicker-clear{display:inline-block;height:25px;line-height:25px;width:60px;border:1px solid #d3d3d3;font-size:12px;text-align:center;position:absolute;right:5px;cursor:pointer}.fui-dialog{position:fixed;top:-1000000px;left:-100000px;border:1px solid #B1B1B1;background:#fff}.fui-dialog .fui-panel-content{width:auto!important;height:auto!important;padding:2px}.fui-dialog .fui-dialog-caption{margin:0;padding:5px;font-size:16px;font-weight:400;line-height:1;display:inline-block}.fui-dialog .fui-dialog-head .fui-close-button{float:right}.fui-dialog .fui-dialog-head .fui-close-button .fui-close-button-icon{width:16px;height:16px;background:url(images/close.png) no-repeat}.fui-drop-panel{border:1px solid #d3d3d3;overflow:hidden;position:relative}.fui-drop-panel .fui-drop-panel-content{display:inline-block}.fui-drop-panel .fui-drop-panel-placeholder{display:none}.fui-drop-panel .fui-drop-panel-button{border-left:1px solid #d3d3d3;visibility:visible}.fui-drop-panel .fui-drop-panel-button:HOVER{border-color:#d5e1f2}.fui-drop-panel .fui-drop-panel-button:ACTIVE{border-color:#87a9da}.fui-drop-panel:HOVER{border-color:#d5e1f2}.fui-drop-panel:HOVER .fui-drop-panel-button{border-left-color:#d5e1f2}.fui-drop-panel:ACTIVE{border-color:#87a9da}.fui-drop-panel:ACTIVE .fui-drop-panel-button{border-left-color:#d5e1f2}.fui-drop-panel.fui-drop-panel-open{overflow:visible}.fui-drop-panel.fui-drop-panel-open .fui-drop-panel-content{border:1px solid #d3d3d3;position:absolute;top:-1px;left:-1px}.fui-drop-panel.fui-drop-panel-open .fui-drop-panel-button{visibility:hidden}.fui-drop-panel.fui-drop-panel-open .fui-drop-panel-placeholder{display:inline-block}.fui-drop-panel-popup{border:1px solid #d3d3d3}.fui-drop-panel-popup:HOVER{border-color:#d5e1f2}.fui-drop-panel-popup:HOVER .fui-drop-panel-button{border-left-color:#d5e1f2}.fui-drop-panel-popup:ACTIVE{border-color:#87a9da}.fui-drop-panel-popup:ACTIVE .fui-drop-panel-button{border-left-color:#d5e1f2}.fui-icon{text-align:center;font-size:0}.fui-icon img{display:inline-block}.fui-input-button{border:1px solid #ababab}.fui-input-button .fui-input{vertical-align:middle;border:none!important}.fui-input-button .fui-button{vertical-align:middle}.fui-input-button:ACTIVE,.fui-input-button:HOVER{border-color:#87a9da}.fui-input{border:1px solid #d3d3d3;padding:1px;margin:0}.fui-input:FOCUS,.fui-input:HOVER{border-color:#4d90fe!important}.fui-item{font-size:0}.fui-item .fui-icon,.fui-item .fui-label{vertical-align:middle}.fui-item.fui-item-selected{background:#87a9da}.fui-label-panel .fui-label-panel-label{width:100%;color:#666}.fui-label-panel.fui-no-position .fui-label-panel-label{position:static!important}.fui-label-panel.fui-layout-bottom .fui-label-panel-label{position:absolute;bottom:0;left:0;top:auto;z-index:2}.fui-label{cursor:default;display:inline-block;white-space:nowrap}.fui-mask{position:fixed;z-index:99998}.fui-menu{background-color:#fff;border:1px solid #d3d3d3}.fui-menu .fui-item{padding:2px 5px;display:block!important}.fui-menu .fui-item:HOVER{background:#d5e1f2}.fui-panel{display:inline-block;vertical-align:top;overflow-y:auto;overflow-x:hidden}.fui-panel .fui-panel-content{position:relative;top:0;left:0;width:100%;height:100%}.fui-panel.fui-container-column{font-size:0}.fui-panel.fui-container-column .fui-column{display:block}.fui-ppanel::-webkit-scrollbar{width:15px}.fui-ppanel::-webkit-scrollbar-button:end:decrement,.fui-ppanel::-webkit-scrollbar-button:end:increment,.fui-ppanel::-webkit-scrollbar-button:start:decrement,.fui-ppanel::-webkit-scrollbar-button:start:increment,.fui-ppanel::-webkit-scrollbar-thumb{border:1px solid #e7e7e7}.fui-ppanel.fui-ppanel-position{position:fixed;z-index:99999}.fui-separator{background:#6d6d6d}.fui-spin-button .fui-spin-down-btn .fui-icon,.fui-spin-button .fui-spin-up-btn .fui-icon{width:16px;height:9px;background:url(images/up.png) 3px 1.5px no-repeat}.fui-spin-button .fui-spin-down-btn .fui-icon{background-image:url(images/down.png)}.fui-tabs .fui-selected{background-color:#d5e1f2}.fui-toggle-button.fui-button-pressed{background-color:#aec5e6}.fui-toggle-button.fui-button-pressed.fui-disabled{background-color:#aec5e6!important} \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/theme/default/images/close.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/theme/default/images/close.png new file mode 100644 index 0000000000000000000000000000000000000000..4f8885f47e0ce084c2a963bad9a3d9998e4c292d GIT binary patch literal 836 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^xl_H+M9WCijSl0AZa z85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=YDR+uenMVO6iP5s=4O z;1O92G;jkLPtXOMsMzWR&J6Sy{Q{Czpb>SXl)C zO)h3IT>gKzKAIY^ORcOtQZv&tN*GLyjZf`ioC;JUj${s0O?YNXNd`zsq;KE}pb|+W zCBB)tsU?*KsSIFG=ojRr+iwc%W1gMI^(Ad(<+{D7f)T~Q8m<^~z7|ERA%qn2y z=vkV1J2~ZkTHXkhPC}9n4f142%gjjyhM0aver~FMT1kPvp{bF9erjTIWo9xkD3bF~ t*vTn*x|zA@ddTuX*XbJ?niv~HNHZfnpa{bxe=VSG44$rjF6*2UngElh3X%W- literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/theme/default/images/down.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/theme/default/images/down.png new file mode 100644 index 0000000000000000000000000000000000000000..cf92db68069cad3c42ef007f543f905fe00fb2b3 GIT binary patch literal 1089 zcmaJ=Ye*DP6rPCG7VH5P6%@m0nAFZ|cgJo_jdoch0%zyWO$c z^~J8GE)2tpqcuVt?T%egRDk~9C+6Nk+Y%T_!aAc7rX>qtA;o9_cvO>`KpaR)+qSzP zfMGLB)kG2|#SOe{Xr$!CkQvQHXbcNfWlTwK0T6EhO{yLw#;;r_a8(Hs8+{@znqkna z*0fuouDv!Px3|cZ3Q@Hd4`g^mpaCf187-yTd?rX_d3j_zZi>LOA+RM#{3$9a#_+IV z0o+G=+%nBDILDEU*T-?pYMiARmZH((+>Dp^aXedrPksc-W+{z)T&SMRg-$`D8A6k% zsB}6_rah!#HBn4uWu?QxvThXNw%c?lW!$=5l4B5nEnBJyRYS)eMybJQg+T&U`lkiW zoTAn3$!kIvMr9{n0UC3!&i!utm=-VJc|%TKC0VL(q#}8f&}6qRaN1=6}Fx-P4#XwXD zB{EOFwf(MJ^nxAT?_#d{=P!PA`ahQ)I5x2PZQ)mOPUnK+Jx>-DmhXL?*g95!b9W&% zcqQF?_QJEk{lmn=jv1$W=6wp>bKSVSeBZ0ojgE7x*Q9o;$4l>AD!TBv;n0z?2VZ_h z-`qOW_r8AEyKwFVvH#RXZI$&XHq@0aI*EO(IV$++k*i;34c;DFOm>aE9O+ftL)Yhb vulP08KTeb`K6q{8=%!txMK@0be|?=zW7=RMaef)Q+j-Q{NUhMfZcFEHB|va9 literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/theme/default/images/open.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/theme/default/images/open.png new file mode 100644 index 0000000000000000000000000000000000000000..861a04e883c7eeabda06bf1ea385218b2c34ff3e GIT binary patch literal 859 zcmeAS@N?(olHy`uVBq!ia0vp^LO{&V!2%?m`@?4fDVB6cUq=Rpjs4tz5?O(Kg=CK) zUj~LMH3o);76yi2K%s^g3=E|P3=FRl7#OT(FffQ0%-I!a1C(G&@^*J&U|7|wYy{+S z7I;J!1L+hn=AU--E|4+Z)5S4F<9zLTL%t>hiMEI0yJu7|i1R&MraXJMw)#ZT{6|@j z9*Oeo5?GfYQJ|*c6TqJQ=lAvxrP=qE_$%kV*?8tH7bkDovpqK&71QVVu=Tkx7(Pu2 z+3;`gtV`^Z`wq|F_DHDboX%7JZF}}ENqbyZe9-eF`zHNJzt60ZexGDF&3U3-)bV~| zZQX=7pS0y><%C?hRQ&v9Tph!N@T$#BUq5yMov2#k8c~vxSdwa$T$Bo=7>o=IO>_-R zbqx$dj0~(y%&iQ}wGAw+3=CMEvM!@&$jwj5OsmALp+x>tK2U=%$cEzlw370~qErUY z+{E-$-^BFHlpinIKI- z4Ai8TUz8rXB)%TzlH#&-tK|IL+|;}h1_k%jywoC~CsGuWDiu7F^L_L4^Yk+F6%0{uKbLh*2~7Yx9TzJA literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/theme/default/images/up.png b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/assets/theme/default/images/up.png new file mode 100644 index 0000000000000000000000000000000000000000..4e4a6d1f9831b280fc99774f19b835ae0ff96c7e GIT binary patch literal 1080 zcmaJ=T}TvB6dp;$Br^(1MQ9q0655%a+1=3{cQe~rbE7d^m)d@HoVo4}>-;oxZCCLr z5t4kdqN2AT0|o2Fel#r%3Zk;7it@!Eis->0BB`M6=&ttAHeBYOdpO^B&bjBi{Y{N~ z3JXdLFbpdUHSl4y+jd@l9{T_IQuG*YB`_F;&3ZdbiYCD7WW5dGAytflFc9UglTUyT z!&X%&ktmD``#4EgNzslWQ>uZ`80M=@8KRT`5N`u9Me`H$_Z|?qBKwI$9>FOX0T5Rj zx=qmB-58O&6OvaZYIowk6o&{@07X2dc4!ut@)L`^9I|aUMc|7eFySYbii!$NctAG+ z?jc|&bsR6z%nTZ4QQUpa_T6r9m;}(5&(d0}m|8R1B!-8g4U+ZF(p46R6Uq7F1)I zRsgo6 z<@8hsXgcVwbMXvc$9jUnDu$tho(z`PrA`%SFoTs>u&r3!RlOjg_<4!eqr#s2Iu~?O&tLxR8Eqb6L3Puq=I`A-$VO*c;z?2GOG!3GsE2 z)LY;Fse*^jb@wZXd~LYbtycDjb1zMfonKgAQa16uvaDuEnWUmcWKU1+c+I=1ZCi4$ zzUtgsITX7a`*m>dftm5KYb`?;b{!kNHSOJWd7^iAq1<$BRs jrDjcgU*e40*OHTmbscRzN6p+Rwcm0m*vQ}5-Fo^Dnsa3k literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/js/jquery-3.6.0.min.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/js/jquery-3.6.0.min.js new file mode 100644 index 00000000..c4c6022f --- /dev/null +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/js/jquery-3.6.0.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.6.0 | (c) OpenJS 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(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),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("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(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 de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){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[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.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},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.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},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(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?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===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]||se.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]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(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(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
              "],col:[2,"","
              "],tr:[2,"","
              "],td:[3,"","
              "],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);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\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="

              ",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.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"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.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)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.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,n){S.fn[n]=function(e,t){return 0p;p++)k=n[p],k!==h?k?"string"==typeof k?(n[p]="brackets"===e.name&&2>p?k:"function"===e.name&&0===p?k:c("text",k),f.operand.push(n[p])):(f.operand.push({}),n[p]=b(a.operand[p],k,f.operand[f.operand.length-1],g,i)):(n[p]=c("empty"),f.operand.push(n[p])):(m.push(p),i.hasOwnProperty("startOffset")||(i.startOffset=p),i.endOffset=p,e.attr&&e.attr.id&&(i.groupId=e.attr.id));for(2===m.length&&(i.endOffset-=1);p=m.length;)p=m[p-1],n.splice(p,1),m.length--,a.operand.splice(p,1)}if(o=d(e.name),!o)throw new Error("operator type error: not found "+e.operator);j=function(){},j.prototype=o.prototype,l=new j,o.apply(l,n),f.func=l;for(var r in e.callFn)e.callFn.hasOwnProperty(r)&&l[r]&&l[r].apply(l,e.callFn[r]);return e.attr&&(e.attr.id&&(g[e.attr.id]={objGroup:l,strGroup:a}),e.attr["data-root"]&&(g.root={objGroup:l,strGroup:a}),l.setAttr(e.attr)),l}function c(a,b){switch(a){case"empty":return new kf.EmptyExpression;case"text":return new kf.TextExpression(b)}}function d(a){return g[a]||kf[a.replace(/^[a-z]/i,function(a){return a.toUpperCase()}).replace(/-([a-z])/gi,function(a,b){return b.toUpperCase()})+"Expression"]}function e(a){var b={};if("[object Array]"==={}.toString.call(a)){b=[];for(var c=0,d=a.length;d>c;c++)b[c]=f(a[c])}else for(var e in a)a.hasOwnProperty(e)&&(b[e]=f(a[e]));return b}function f(a){return a?"object"!=typeof a?a:e(a):a}var g={},h="\uf155";return a.prototype.generateBy=function(a){var c=a.tree,d={},f={},g={};if("string"==typeof c)throw new Error("Unhandled error");return this.formula.appendExpression(b(c,e(c),d,g,f)),{select:f,parsedTree:c,tree:d,mapping:g}},a.prototype.regenerateBy=function(a){return this.formula.clearExpressions(),this.generateBy(a)},a}},b[1]={value:function(){return{toRPNExpression:b.r(2),generateTree:b.r(3)}}},b[2]={value:function(){function a(b){var e=[],f=null;for(b=c(b);f=b.shift();)"combination"===f.name&&1===f.operand.length&&"brackets"===f.operand[0].name&&(f=f.operand[0]),e.push(d.isArray(f)?a(f):f);return e}function c(a){for(var b=[],c=null;void 0!==(c=a.pop());)if(!c||"object"!=typeof c||c.sign!==!1&&"function"!==c.name)b.push(c);else{var d=c.handler(c,[],b.reverse());b.unshift(d),b.reverse()}return b.reverse()}var d=b.r(4);return a}},b[3]={value:function(){function a(b){for(var e=null,f=[],g=0,h=b.length;h>g;g++)d.isArray(b[g])&&(b[g]=a(b[g]));for(;e=b.shift();)f.push("object"==typeof e&&e.handler?e.handler(e,f,b):e);return c(f)}var c=b.r(13),d=b.r(4);return a}},b[4]={value:function(){var a=b.r(7),c=b.r(6),d=b.r(15),e={getLatexType:function(b){return b=b.replace(/^\\/,""),a[b]?"operator":c[b]?"function":"text"},isArray:function(a){return a&&"[object Array]"===Object.prototype.toString.call(a)},getDefine:function(b){return e.extend({},a[b.replace("\\","")])},getFuncDefine:function(a){return{name:"function",params:a.replace(/^\\/,""),handler:d}},getBracketsDefine:function(b,c){return e.extend({params:[b,c]},a.brackets)},extend:function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}};return e}},b[5]={value:function(){var a=!0;return{".":a,"{":a,"}":a,"[":a,"]":a,"(":a,")":a,"|":a}}},b[6]={value:function(){return{sin:1,cos:1,arccos:1,cosh:1,det:1,inf:1,limsup:1,Pr:1,tan:1,arcsin:1,cot:1,dim:1,ker:1,ln:1,sec:1,tanh:1,arctan:1,coth:1,exp:1,lg:1,log:1,arg:1,csc:1,gcd:1,lim:1,max:1,sinh:1,deg:1,hom:1,liminf:1,min:1,sup:1}}},b[7]={value:function(){var a=b.r(22),c=b.r(11);return{"^":{name:"superscript",type:c.OP,handler:a},_:{name:"subscript",type:c.OP,handler:a},frac:{name:"fraction",type:c.FN,sign:!1,handler:b.r(14)},sqrt:{name:"radical",type:c.FN,sign:!1,handler:b.r(23)},sum:{name:"summation",type:c.FN,traversal:"rtl",handler:b.r(24)},"int":{name:"integration",type:c.FN,traversal:"rtl",handler:b.r(16)},brackets:{name:"brackets",type:c.FN,handler:b.r(12)},mathcal:{name:"mathcal",type:c.FN,sign:!1,handler:b.r(19)},mathfrak:{name:"mathfrak",type:c.FN,sign:!1,handler:b.r(20)},mathbb:{name:"mathbb",type:c.FN,sign:!1,handler:b.r(18)},mathrm:{name:"mathrm",type:c.FN,sign:!1,handler:b.r(21)}}}},b[8]={value:function(){return{"int":b.r(26),quot:b.r(27)}}},b[9]={value:function(){return{combination:b.r(29),fraction:b.r(30),"function":b.r(31),integration:b.r(32),subscript:b.r(39),superscript:b.r(41),script:b.r(37),radical:b.r(38),summation:b.r(40),brackets:b.r(28),mathcal:b.r(34),mathfrak:b.r(35),mathbb:b.r(33),mathrm:b.r(36)}}},b[10]={value:function(){return{"#":1,$:1,"%":1,_:1,"&":1,"{":1,"}":1,"^":1,"~":1}}},b[11]={value:function(){return{OP:1,FN:2}}},b[12]={value:function(){var a=b.r(5);return function(b,c,d){for(var e=0,f=b.params.length;f>e;e++)if(!(b.params[e]in a))throw new Error("Brackets: invalid params");return b.operand=b.params,b.params[2]=d.shift(),delete b.handler,delete b.params,b}}},b[13]={value:function(){return function(){return{name:"combination",operand:arguments[0]||[]}}}},b[14]={value:function(){return function(a,b,c){var d=c.shift(),e=c.shift();if(void 0===d||void 0===e)throw new Error("Frac: Syntax Error");return d.handler&&"integration"===d.name?(d=d.handler(d,b,[e]),e=c.shift()):e.handler&&"integration"===e.name&&(e=e.handler(e,b,[c.shift()])),a.operand=[d,e],delete a.handler,a}}},b[15]={value:function(){var a=b.r(17);return function(b,c,d){var e=a.exec(d);return e.expr&&e.expr.handler&&"integration"===e.expr.name&&(e.expr=e.expr.handler(e.expr,c,[d.shift()])),b.operand=[b.params,e.expr,e.superscript,e.subscript],delete b.params,delete b.handler,b}}},b[16]={value:function(){var a=b.r(17),c=b.r(11).FN;return function(b,d,e){var f=e.shift(),g=a.exec(e);return g.expr&&g.expr.type===c&&g.expr.handler&&"integration"===g.expr.name&&(g.expr=g.expr.handler(g.expr,d,[e.shift()])),b.operand=[g.expr,g.superscript,g.subscript],b.callFn={setType:[0|f]},delete b.handler,b}}},b[17]={value:function(){function a(a){var c=b(a),d=null,e={superscript:null,subscript:null};if(!c)return e;if(d=b(a),e[c.type]=c.value||null,d){if(d.type===c.type)throw new Error("Script: syntax error!");e[d.type]=d.value||null}return e}function b(a){var b=a.shift();return b?"subscript"===b.name||"superscript"===b.name?{type:b.name,value:a.shift()}:(a.unshift(b),null):null}return{exec:function(b){var c=a(b),d=b.shift();if(d&&d.name&&-1!==d.name.indexOf("script"))throw new Error("Script: syntax error!");return c.expr=d||null,c}}}},b[18]={value:function(){return function(a,b,c){var d=c.shift();return"object"==typeof d&&"combination"===d.name&&(d=d.operand.join("")),a.name="text",a.attr={_reverse:"mathbb"},a.callFn={setFamily:["KF AMS BB"]},a.operand=[d],delete a.handler,a}}},b[19]={value:function(){return function(a,b,c){var d=c.shift();return"object"==typeof d&&"combination"===d.name&&(d=d.operand.join("")),a.name="text",a.attr={_reverse:"mathcal"},a.callFn={setFamily:["KF AMS CAL"]},a.operand=[d],delete a.handler,a}}},b[20]={value:function(){return function(a,b,c){var d=c.shift();return"object"==typeof d&&"combination"===d.name&&(d=d.operand.join("")),a.name="text",a.attr={_reverse:"mathfrak"},a.callFn={setFamily:["KF AMS FRAK"]},a.operand=[d],delete a.handler,a}}},b[21]={value:function(){return function(a,b,c){var d=c.shift();return"object"==typeof d&&"combination"===d.name&&(d=d.operand.join("")),a.name="text",a.attr={_reverse:"mathrm"},a.callFn={setFamily:["KF AMS ROMAN"]},a.operand=[d],delete a.handler,a}}},b[22]={value:function(){return function(a,b,c){var d=b.pop(),e=c.shift()||null;if(!e)throw new Error("Missing script");if(d=d||"",d.name===a.name||"script"===d.name)throw new Error("script error");return"subscript"===d.name?(d.name="script",d.operand[2]=d.operand[1],d.operand[1]=e,d):"superscript"===d.name?(d.name="script",d.operand[2]=e,d):(a.operand=[d,e],delete a.handler,a)}}},b[23]={value:function(){var a=b.r(13);return function(b,c,d){var e=d.shift(),f=null,g=null;if("["===e){for(e=[];(f=d.shift())&&"]"!==f;)e.push(f);e=0===e.length?null:a(e),g=d.shift()}else g=e,e=null;return b.operand=[g,e],delete b.handler,b}}},b[24]={value:function(){var a=b.r(17),c=b.r(11).FN;return function(b,d,e){var f=a.exec(e);return f.expr&&f.expr.type===c&&f.expr.handler&&"integration"===f.expr.name&&(f.expr=f.expr.handler(f.expr,d,[e.shift()])),b.operand=[f.expr,f.superscript,f.subscript],delete b.handler,b}}},b[25]={value:function(){function a(a){if(d(a))return a.substring(1);switch(m.getLatexType(a)){case"operator":return m.getDefine(a);case"function":return m.getFuncDefine(a);default:return c(a)}}function c(a){return 0===a.indexOf("\\")?a+"\\":a}function d(a){return 0===a.indexOf("\\")?!!l[a.substring(1)]:!1}function e(a){return a.replace(/\\\s+/,"").replace(/\s*([^a-z0-9\s])\s*/gi,function(a,b){return b})}var f=b.r(43).Parser,g=b.r(1),h=b.r(8),i=b.r(42),j=b.r(7),k=b.r(9),l=b.r(10),m=b.r(4),n="\ufff8",o="\ufffc",p=new RegExp(n+"|"+o,"g"),q=new RegExp(n,"g"),r=new RegExp(o,"g");f.register("latex",f.implement({parse:function(a){var b=this.split(this.format(a));return b=this.parseToGroup(b),b=this.parseToStruct(b),this.generateTree(b)},serialization:function(a,b){return i(a,b)},expand:function(a){var b=a.parse,c=null,d=a.pre,e=a.reverse;for(var f in b)b.hasOwnProperty(f)&&(c=f.replace(/\\/g,""),j[c]=b[f]);for(var f in e)e.hasOwnProperty(f)&&(k[f.replace(/\\/g,"")]=e[f]);if(d)for(var f in d)d.hasOwnProperty(f)&&(h[f.replace(/\\/g,"")]=d[f])},format:function(a){a=e(a),a=a.replace(p,"").replace(/\\{/gi,n).replace(/\\}/gi,o);for(var b in h)h.hasOwnProperty(b)&&(a=h[b](a));return a},split:function(a){var b=[],c=/(?:\\[^a-z]\s*)|(?:\\[a-z]+\s*)|(?:[{}]\s*)|(?:[^\\{}]\s*)/gi,d=/^\s+|\s+$/g,e=null;for(a=a.replace(d,"");e=c.exec(a);)e=e[0].replace(d,""),e&&b.push(e);return b},generateTree:function(a){for(var b=[],c=null;c=a.shift();)b.push(m.isArray(c)?this.generateTree(c):c);return b=g.toRPNExpression(b),g.generateTree(b)},parseToGroup:function(a){for(var b=[],c=[b],d=0,e=0,f=0,g=a.length;g>f;f++)switch(a[f]){case"{":d++,c.push(b),b.push([]),b=b[b.length-1];break;case"}":d--,b=c.pop();break;case"\\left":e++,c.push(b),b.push([[]]),b=b[b.length-1][0],b.type="brackets",f++,b.leftBrackets=a[f].replace(q,"{").replace(r,"}");break;case"\\right":e--,f++,b.rightBrackets=a[f].replace(q,"{").replace(r,"}"),b=c.pop();break;default:b.push(a[f].replace(q,"\\{").replace(r,"\\}"))}if(0!==d)throw new Error("Group Error!");if(0!==e)throw new Error("Brackets Error!");return c[0]},parseToStruct:function(b){for(var c=[],d=0,e=b.length;e>d;d++)m.isArray(b[d])?"brackets"===b[d].type?(c.push(m.getBracketsDefine(b[d].leftBrackets,b[d].rightBrackets)),c.push(this.parseToStruct(b[d]))):c.push(this.parseToStruct(b[d])):c.push(a(b[d]));return c}}))}},b[26]={value:function(){return function(a){return a.replace(/\\(i+)nt(\b|[^a-zA-Z])/g,function(a,b,c){return"\\int "+b.length+c})}}},b[27]={value:function(){return function(a){return a.replace(/``/g,"\u201c")}}},b[28]={value:function(){return function(a){return("{"===a[0]||"}"===a[0])&&(a[0]="\\"+a[0]),("{"===a[1]||"}"===a[1])&&(a[1]="\\"+a[1]),["\\left",a[0],a[2],"\\right",a[1]].join(" ")}}},b[29]={value:function(){return function(a){return this.attr["data-root"]||this.attr["data-placeholder"]?a.join(""):"{"+a.join("")+"}"}}},b[30]={value:function(){return function(a){return"\\frac "+a[0]+" "+a[1]}}},b[31]={value:function(){return function(a){var b=["\\"+a[0]];return a[2]&&b.push("^"+a[2]),a[3]&&b.push("_"+a[3]),a[1]&&b.push(" "+a[1]),b.join("")}}},b[32]={value:function(){return function(a){var b=["\\int "];if(this.callFn&&this.callFn.setType){b=["\\"];for(var c=0,d=this.callFn.setType;d>c;c++)b.push("i");b.push("nt ")}return a[1]&&b.push("^"+a[1]),a[2]&&b.push("_"+a[2]),a[0]&&b.push(" "+a[0]),b.join("")}}},b[33]={value:function(){return function(a){return"\\mathbb{"+a[0]+"}"}}},b[34]={value:function(){return function(a){return"\\mathcal{"+a[0]+"}"}}},b[35]={value:function(){return function(a){return"\\mathfrak{"+a[0]+"}"}}},b[36]={value:function(){return function(a){return"\\mathrm{"+a[0]+"}"}}},b[37]={value:function(){return function(a){return a[0]+"^"+a[1]+"_"+a[2]}}},b[38]={value:function(){return function(a){var b=["\\sqrt"];return a[1]&&b.push("["+a[1]+"]"),b.push(" "+a[0]),b.join("")}}},b[39]={value:function(){return function(a){return a[0]+"_"+a[1]}}},b[40]={value:function(){return function(a){var b=["\\sum "];return a[1]&&b.push("^"+a[1]),a[2]&&b.push("_"+a[2]),a[0]&&b.push(" "+a[0]),b.join("")}}},b[41]={value:function(){return function(a){return a[0]+"^"+a[1]}}},b[42]={value:function(){function a(b,e){var g=[],h=null,i=null;if("object"!=typeof b)return c(b)?"\\"+b+" ":b.replace(f,function(a,b){return b+" "});"combination"===b.name&&1===b.operand.length&&"combination"===b.operand[0].name&&(b=b.operand[0]),i=b.operand;for(var j=0,k=i.length;k>j;j++)g.push(i[j]?a(i[j]):i[j]);return h=b.attr&&b.attr._reverse?b.attr._reverse:b.name,d[h].call(b,g,e)}function c(a){return!!e[a]}var d=b.r(9),e=b.r(10),f=/(\\(?:[\w]+)|(?:[^a-z]))\\/gi;return function(b,c){return a(b,c)}}},b[43]={value:function(a,b,c){function d(a){this.impl=new a,this.conf={}}function e(){this.conf={}}var f={},g={},h={extend:function(a,b){var c=null;b=[].slice.call(arguments,1);for(var d=0,e=b.length;e>d;d++){c=b[d];for(var f in c)c.hasOwnProperty(f)&&(a[f]=c[f])}},setData:function(a,b,c){if("string"==typeof b)a[b]=c;else{if("object"!=typeof b)throw new Error("invalid option");for(c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}}},i={use:function(a){if(!g[a])throw new Error("unknown parser type");return this.proxy(g[a])},config:function(a,b){return h.setData(f,a,b),this},register:function(a,b){return g[a.toLowerCase()]=b,this},implement:function(a){var b=function(){},c=a.constructor||function(){},d=function(){e.call(this),c.call(this)};b.prototype=e.prototype,d.prototype=new b,delete a.constructor;for(var f in a)"constructor"!==f&&a.hasOwnProperty(f)&&(d.prototype[f]=a[f]);return d},proxy:function(a){return new d(a)}};h.extend(d.prototype,{config:function(a,b){h.setData(this.conf,a,b)},set:function(a,b){this.impl.set(a,b)},parse:function(a){var b={config:{},tree:this.impl.parse(a)};return h.extend(b.config,f,this.conf),b},serialization:function(a,b){return this.impl.serialization(a,b)},expand:function(a){this.impl.expand(a)}}),h.extend(e.prototype,{set:function(a,b){h.extend(this.conf,a,b)},parse:function(){throw new Error("Abstract function")}}),c.exports={Parser:i,ParserInterface:e}}},b[44]={value:function(){var a=b.r(43).Parser;b.r(25),window.kf.Parser=a,window.kf.Assembly=b.r(0)}};var c={"kf.start":44};!function(){try{a("kf.start")}catch(b){}}(this)}(); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/js/kity-formula-render.all.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/js/kity-formula-render.all.js new file mode 100644 index 00000000..80665993 --- /dev/null +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/js/kity-formula-render.all.js @@ -0,0 +1,5757 @@ +/*! + * ==================================================== + * Kity Formula Render - v1.0.0 - 2014-07-30 + * https://github.com/kitygraph/formula + * GitHub: https://github.com/kitygraph/formula.git + * Copyright (c) 2014 Baidu Kity Group; Licensed MIT + * ==================================================== + */ + +(function () { +var _p = { + r: function(index) { + if (_p[index].inited) { + return _p[index].value; + } + if (typeof _p[index].value === "function") { + var module = { + exports: {} + }, returnValue = _p[index].value(null, module.exports, module); + _p[index].inited = true; + _p[index].value = returnValue; + if (returnValue !== undefined) { + return returnValue; + } else { + for (var key in module.exports) { + if (module.exports.hasOwnProperty(key)) { + _p[index].inited = true; + _p[index].value = module.exports; + return module.exports; + } + } + } + } else { + _p[index].inited = true; + return _p[index].value; + } + } +}; + +/*! + * canvg库封装 + * canvg官网: https://code.google.com/p/canvg/ + */ +_p[0] = { + value: function(require) { + /** + * A class to parse color values + * @author Stoyan Stefanov + * @link http://www.phpied.com/rgb-color-parser-in-javascript/ + * @license Use it if you like it + */ + function RGBColor(color_string) { + this.ok = false; + // strip any leading # + if (color_string.charAt(0) == "#") { + // remove # if any + color_string = color_string.substr(1, 6); + } + color_string = color_string.replace(/ /g, ""); + color_string = color_string.toLowerCase(); + // before getting into regexps, try simple matches + // and overwrite the input + var simple_colors = { + aliceblue: "f0f8ff", + antiquewhite: "faebd7", + aqua: "00ffff", + aquamarine: "7fffd4", + azure: "f0ffff", + beige: "f5f5dc", + bisque: "ffe4c4", + black: "000000", + blanchedalmond: "ffebcd", + blue: "0000ff", + blueviolet: "8a2be2", + brown: "a52a2a", + burlywood: "deb887", + cadetblue: "5f9ea0", + chartreuse: "7fff00", + chocolate: "d2691e", + coral: "ff7f50", + cornflowerblue: "6495ed", + cornsilk: "fff8dc", + crimson: "dc143c", + cyan: "00ffff", + darkblue: "00008b", + darkcyan: "008b8b", + darkgoldenrod: "b8860b", + darkgray: "a9a9a9", + darkgreen: "006400", + darkkhaki: "bdb76b", + darkmagenta: "8b008b", + darkolivegreen: "556b2f", + darkorange: "ff8c00", + darkorchid: "9932cc", + darkred: "8b0000", + darksalmon: "e9967a", + darkseagreen: "8fbc8f", + darkslateblue: "483d8b", + darkslategray: "2f4f4f", + darkturquoise: "00ced1", + darkviolet: "9400d3", + deeppink: "ff1493", + deepskyblue: "00bfff", + dimgray: "696969", + dodgerblue: "1e90ff", + feldspar: "d19275", + firebrick: "b22222", + floralwhite: "fffaf0", + forestgreen: "228b22", + fuchsia: "ff00ff", + gainsboro: "dcdcdc", + ghostwhite: "f8f8ff", + gold: "ffd700", + goldenrod: "daa520", + gray: "808080", + green: "008000", + greenyellow: "adff2f", + honeydew: "f0fff0", + hotpink: "ff69b4", + indianred: "cd5c5c", + indigo: "4b0082", + ivory: "fffff0", + khaki: "f0e68c", + lavender: "e6e6fa", + lavenderblush: "fff0f5", + lawngreen: "7cfc00", + lemonchiffon: "fffacd", + lightblue: "add8e6", + lightcoral: "f08080", + lightcyan: "e0ffff", + lightgoldenrodyellow: "fafad2", + lightgrey: "d3d3d3", + lightgreen: "90ee90", + lightpink: "ffb6c1", + lightsalmon: "ffa07a", + lightseagreen: "20b2aa", + lightskyblue: "87cefa", + lightslateblue: "8470ff", + lightslategray: "778899", + lightsteelblue: "b0c4de", + lightyellow: "ffffe0", + lime: "00ff00", + limegreen: "32cd32", + linen: "faf0e6", + magenta: "ff00ff", + maroon: "800000", + mediumaquamarine: "66cdaa", + mediumblue: "0000cd", + mediumorchid: "ba55d3", + mediumpurple: "9370d8", + mediumseagreen: "3cb371", + mediumslateblue: "7b68ee", + mediumspringgreen: "00fa9a", + mediumturquoise: "48d1cc", + mediumvioletred: "c71585", + midnightblue: "191970", + mintcream: "f5fffa", + mistyrose: "ffe4e1", + moccasin: "ffe4b5", + navajowhite: "ffdead", + navy: "000080", + oldlace: "fdf5e6", + olive: "808000", + olivedrab: "6b8e23", + orange: "ffa500", + orangered: "ff4500", + orchid: "da70d6", + palegoldenrod: "eee8aa", + palegreen: "98fb98", + paleturquoise: "afeeee", + palevioletred: "d87093", + papayawhip: "ffefd5", + peachpuff: "ffdab9", + peru: "cd853f", + pink: "ffc0cb", + plum: "dda0dd", + powderblue: "b0e0e6", + purple: "800080", + red: "ff0000", + rosybrown: "bc8f8f", + royalblue: "4169e1", + saddlebrown: "8b4513", + salmon: "fa8072", + sandybrown: "f4a460", + seagreen: "2e8b57", + seashell: "fff5ee", + sienna: "a0522d", + silver: "c0c0c0", + skyblue: "87ceeb", + slateblue: "6a5acd", + slategray: "708090", + snow: "fffafa", + springgreen: "00ff7f", + steelblue: "4682b4", + tan: "d2b48c", + teal: "008080", + thistle: "d8bfd8", + tomato: "ff6347", + turquoise: "40e0d0", + violet: "ee82ee", + violetred: "d02090", + wheat: "f5deb3", + white: "ffffff", + whitesmoke: "f5f5f5", + yellow: "ffff00", + yellowgreen: "9acd32" + }; + for (var key in simple_colors) { + if (color_string == key) { + color_string = simple_colors[key]; + } + } + // emd of simple type-in colors + // array of color definition objects + var color_defs = [ { + re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/, + example: [ "rgb(123, 234, 45)", "rgb(255,234,245)" ], + process: function(bits) { + return [ parseInt(bits[1]), parseInt(bits[2]), parseInt(bits[3]) ]; + } + }, { + re: /^(\w{2})(\w{2})(\w{2})$/, + example: [ "#00ff00", "336699" ], + process: function(bits) { + return [ parseInt(bits[1], 16), parseInt(bits[2], 16), parseInt(bits[3], 16) ]; + } + }, { + re: /^(\w{1})(\w{1})(\w{1})$/, + example: [ "#fb0", "f0f" ], + process: function(bits) { + return [ parseInt(bits[1] + bits[1], 16), parseInt(bits[2] + bits[2], 16), parseInt(bits[3] + bits[3], 16) ]; + } + } ]; + // search through the definitions to find a match + for (var i = 0; i < color_defs.length; i++) { + var re = color_defs[i].re; + var processor = color_defs[i].process; + var bits = re.exec(color_string); + if (bits) { + channels = processor(bits); + this.r = channels[0]; + this.g = channels[1]; + this.b = channels[2]; + this.ok = true; + } + } + // validate/cleanup values + this.r = this.r < 0 || isNaN(this.r) ? 0 : this.r > 255 ? 255 : this.r; + this.g = this.g < 0 || isNaN(this.g) ? 0 : this.g > 255 ? 255 : this.g; + this.b = this.b < 0 || isNaN(this.b) ? 0 : this.b > 255 ? 255 : this.b; + // some getters + this.toRGB = function() { + return "rgb(" + this.r + ", " + this.g + ", " + this.b + ")"; + }; + this.toHex = function() { + var r = this.r.toString(16); + var g = this.g.toString(16); + var b = this.b.toString(16); + if (r.length == 1) r = "0" + r; + if (g.length == 1) g = "0" + g; + if (b.length == 1) b = "0" + b; + return "#" + r + g + b; + }; + // help + this.getHelpXML = function() { + var examples = new Array(); + // add regexps + for (var i = 0; i < color_defs.length; i++) { + var example = color_defs[i].example; + for (var j = 0; j < example.length; j++) { + examples[examples.length] = example[j]; + } + } + // add type-in colors + for (var sc in simple_colors) { + examples[examples.length] = sc; + } + var xml = document.createElement("ul"); + xml.setAttribute("id", "rgbcolor-examples"); + for (var i = 0; i < examples.length; i++) { + try { + var list_item = document.createElement("li"); + var list_color = new RGBColor(examples[i]); + var example_div = document.createElement("div"); + example_div.style.cssText = "margin: 3px; " + "border: 1px solid black; " + "background:" + list_color.toHex() + "; " + "color:" + list_color.toHex(); + example_div.appendChild(document.createTextNode("test")); + var list_item_value = document.createTextNode(" " + examples[i] + " -> " + list_color.toRGB() + " -> " + list_color.toHex()); + list_item.appendChild(example_div); + list_item.appendChild(list_item_value); + xml.appendChild(list_item); + } catch (e) {} + } + return xml; + }; + } + /* + + StackBlur - a fast almost Gaussian Blur For Canvas + + Version: 0.5 + Author: Mario Klingemann + Contact: mario@quasimondo.com + Website: http://www.quasimondo.com/StackBlurForCanvas + Twitter: @quasimondo + + In case you find this class useful - especially in commercial projects - + I am not totally unhappy for a small donation to my PayPal account + mario@quasimondo.de + + Or support me on flattr: + https://flattr.com/thing/72791/StackBlur-a-fast-almost-Gaussian-Blur-Effect-for-CanvasJavascript + + Copyright (c) 2010 Mario Klingemann + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + */ + var mul_table = [ 512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292, 512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292, 273, 512, 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259, 496, 475, 456, 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292, 282, 273, 265, 512, 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373, 364, 354, 345, 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259, 507, 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 396, 388, 381, 374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307, 302, 297, 292, 287, 282, 278, 273, 269, 265, 261, 512, 505, 497, 489, 482, 475, 468, 461, 454, 447, 441, 435, 428, 422, 417, 411, 405, 399, 394, 389, 383, 378, 373, 368, 364, 359, 354, 350, 345, 341, 337, 332, 328, 324, 320, 316, 312, 309, 305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259, 257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, 451, 446, 442, 437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, 385, 381, 377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, 332, 329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292, 289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259 ]; + var shg_table = [ 9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 ]; + function stackBlurImage(imageID, canvasID, radius, blurAlphaChannel) { + var img = document.getElementById(imageID); + var w = img.naturalWidth; + var h = img.naturalHeight; + var canvas = document.getElementById(canvasID); + canvas.style.width = w + "px"; + canvas.style.height = h + "px"; + canvas.width = w; + canvas.height = h; + var context = canvas.getContext("2d"); + context.clearRect(0, 0, w, h); + context.drawImage(img, 0, 0); + if (isNaN(radius) || radius < 1) return; + if (blurAlphaChannel) stackBlurCanvasRGBA(canvasID, 0, 0, w, h, radius); else stackBlurCanvasRGB(canvasID, 0, 0, w, h, radius); + } + function stackBlurCanvasRGBA(id, top_x, top_y, width, height, radius) { + if (isNaN(radius) || radius < 1) return; + radius |= 0; + var canvas = document.getElementById(id); + var context = canvas.getContext("2d"); + var imageData; + try { + try { + imageData = context.getImageData(top_x, top_y, width, height); + } catch (e) { + // NOTE: this part is supposedly only needed if you want to work with local files + // so it might be okay to remove the whole try/catch block and just use + // imageData = context.getImageData( top_x, top_y, width, height ); + try { + netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); + imageData = context.getImageData(top_x, top_y, width, height); + } catch (e) { + alert("Cannot access local image"); + throw new Error("unable to access local image data: " + e); + return; + } + } + } catch (e) { + alert("Cannot access image"); + throw new Error("unable to access image data: " + e); + } + var pixels = imageData.data; + var x, y, i, p, yp, yi, yw, r_sum, g_sum, b_sum, a_sum, r_out_sum, g_out_sum, b_out_sum, a_out_sum, r_in_sum, g_in_sum, b_in_sum, a_in_sum, pr, pg, pb, pa, rbs; + var div = radius + radius + 1; + var w4 = width << 2; + var widthMinus1 = width - 1; + var heightMinus1 = height - 1; + var radiusPlus1 = radius + 1; + var sumFactor = radiusPlus1 * (radiusPlus1 + 1) / 2; + var stackStart = new BlurStack(); + var stack = stackStart; + for (i = 1; i < div; i++) { + stack = stack.next = new BlurStack(); + if (i == radiusPlus1) var stackEnd = stack; + } + stack.next = stackStart; + var stackIn = null; + var stackOut = null; + yw = yi = 0; + var mul_sum = mul_table[radius]; + var shg_sum = shg_table[radius]; + for (y = 0; y < height; y++) { + r_in_sum = g_in_sum = b_in_sum = a_in_sum = r_sum = g_sum = b_sum = a_sum = 0; + r_out_sum = radiusPlus1 * (pr = pixels[yi]); + g_out_sum = radiusPlus1 * (pg = pixels[yi + 1]); + b_out_sum = radiusPlus1 * (pb = pixels[yi + 2]); + a_out_sum = radiusPlus1 * (pa = pixels[yi + 3]); + r_sum += sumFactor * pr; + g_sum += sumFactor * pg; + b_sum += sumFactor * pb; + a_sum += sumFactor * pa; + stack = stackStart; + for (i = 0; i < radiusPlus1; i++) { + stack.r = pr; + stack.g = pg; + stack.b = pb; + stack.a = pa; + stack = stack.next; + } + for (i = 1; i < radiusPlus1; i++) { + p = yi + ((widthMinus1 < i ? widthMinus1 : i) << 2); + r_sum += (stack.r = pr = pixels[p]) * (rbs = radiusPlus1 - i); + g_sum += (stack.g = pg = pixels[p + 1]) * rbs; + b_sum += (stack.b = pb = pixels[p + 2]) * rbs; + a_sum += (stack.a = pa = pixels[p + 3]) * rbs; + r_in_sum += pr; + g_in_sum += pg; + b_in_sum += pb; + a_in_sum += pa; + stack = stack.next; + } + stackIn = stackStart; + stackOut = stackEnd; + for (x = 0; x < width; x++) { + pixels[yi + 3] = pa = a_sum * mul_sum >> shg_sum; + if (pa != 0) { + pa = 255 / pa; + pixels[yi] = (r_sum * mul_sum >> shg_sum) * pa; + pixels[yi + 1] = (g_sum * mul_sum >> shg_sum) * pa; + pixels[yi + 2] = (b_sum * mul_sum >> shg_sum) * pa; + } else { + pixels[yi] = pixels[yi + 1] = pixels[yi + 2] = 0; + } + r_sum -= r_out_sum; + g_sum -= g_out_sum; + b_sum -= b_out_sum; + a_sum -= a_out_sum; + r_out_sum -= stackIn.r; + g_out_sum -= stackIn.g; + b_out_sum -= stackIn.b; + a_out_sum -= stackIn.a; + p = yw + ((p = x + radius + 1) < widthMinus1 ? p : widthMinus1) << 2; + r_in_sum += stackIn.r = pixels[p]; + g_in_sum += stackIn.g = pixels[p + 1]; + b_in_sum += stackIn.b = pixels[p + 2]; + a_in_sum += stackIn.a = pixels[p + 3]; + r_sum += r_in_sum; + g_sum += g_in_sum; + b_sum += b_in_sum; + a_sum += a_in_sum; + stackIn = stackIn.next; + r_out_sum += pr = stackOut.r; + g_out_sum += pg = stackOut.g; + b_out_sum += pb = stackOut.b; + a_out_sum += pa = stackOut.a; + r_in_sum -= pr; + g_in_sum -= pg; + b_in_sum -= pb; + a_in_sum -= pa; + stackOut = stackOut.next; + yi += 4; + } + yw += width; + } + for (x = 0; x < width; x++) { + g_in_sum = b_in_sum = a_in_sum = r_in_sum = g_sum = b_sum = a_sum = r_sum = 0; + yi = x << 2; + r_out_sum = radiusPlus1 * (pr = pixels[yi]); + g_out_sum = radiusPlus1 * (pg = pixels[yi + 1]); + b_out_sum = radiusPlus1 * (pb = pixels[yi + 2]); + a_out_sum = radiusPlus1 * (pa = pixels[yi + 3]); + r_sum += sumFactor * pr; + g_sum += sumFactor * pg; + b_sum += sumFactor * pb; + a_sum += sumFactor * pa; + stack = stackStart; + for (i = 0; i < radiusPlus1; i++) { + stack.r = pr; + stack.g = pg; + stack.b = pb; + stack.a = pa; + stack = stack.next; + } + yp = width; + for (i = 1; i <= radius; i++) { + yi = yp + x << 2; + r_sum += (stack.r = pr = pixels[yi]) * (rbs = radiusPlus1 - i); + g_sum += (stack.g = pg = pixels[yi + 1]) * rbs; + b_sum += (stack.b = pb = pixels[yi + 2]) * rbs; + a_sum += (stack.a = pa = pixels[yi + 3]) * rbs; + r_in_sum += pr; + g_in_sum += pg; + b_in_sum += pb; + a_in_sum += pa; + stack = stack.next; + if (i < heightMinus1) { + yp += width; + } + } + yi = x; + stackIn = stackStart; + stackOut = stackEnd; + for (y = 0; y < height; y++) { + p = yi << 2; + pixels[p + 3] = pa = a_sum * mul_sum >> shg_sum; + if (pa > 0) { + pa = 255 / pa; + pixels[p] = (r_sum * mul_sum >> shg_sum) * pa; + pixels[p + 1] = (g_sum * mul_sum >> shg_sum) * pa; + pixels[p + 2] = (b_sum * mul_sum >> shg_sum) * pa; + } else { + pixels[p] = pixels[p + 1] = pixels[p + 2] = 0; + } + r_sum -= r_out_sum; + g_sum -= g_out_sum; + b_sum -= b_out_sum; + a_sum -= a_out_sum; + r_out_sum -= stackIn.r; + g_out_sum -= stackIn.g; + b_out_sum -= stackIn.b; + a_out_sum -= stackIn.a; + p = x + ((p = y + radiusPlus1) < heightMinus1 ? p : heightMinus1) * width << 2; + r_sum += r_in_sum += stackIn.r = pixels[p]; + g_sum += g_in_sum += stackIn.g = pixels[p + 1]; + b_sum += b_in_sum += stackIn.b = pixels[p + 2]; + a_sum += a_in_sum += stackIn.a = pixels[p + 3]; + stackIn = stackIn.next; + r_out_sum += pr = stackOut.r; + g_out_sum += pg = stackOut.g; + b_out_sum += pb = stackOut.b; + a_out_sum += pa = stackOut.a; + r_in_sum -= pr; + g_in_sum -= pg; + b_in_sum -= pb; + a_in_sum -= pa; + stackOut = stackOut.next; + yi += width; + } + } + context.putImageData(imageData, top_x, top_y); + } + function stackBlurCanvasRGB(id, top_x, top_y, width, height, radius) { + if (isNaN(radius) || radius < 1) return; + radius |= 0; + var canvas = document.getElementById(id); + var context = canvas.getContext("2d"); + var imageData; + try { + try { + imageData = context.getImageData(top_x, top_y, width, height); + } catch (e) { + // NOTE: this part is supposedly only needed if you want to work with local files + // so it might be okay to remove the whole try/catch block and just use + // imageData = context.getImageData( top_x, top_y, width, height ); + try { + netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); + imageData = context.getImageData(top_x, top_y, width, height); + } catch (e) { + alert("Cannot access local image"); + throw new Error("unable to access local image data: " + e); + return; + } + } + } catch (e) { + alert("Cannot access image"); + throw new Error("unable to access image data: " + e); + } + var pixels = imageData.data; + var x, y, i, p, yp, yi, yw, r_sum, g_sum, b_sum, r_out_sum, g_out_sum, b_out_sum, r_in_sum, g_in_sum, b_in_sum, pr, pg, pb, rbs; + var div = radius + radius + 1; + var w4 = width << 2; + var widthMinus1 = width - 1; + var heightMinus1 = height - 1; + var radiusPlus1 = radius + 1; + var sumFactor = radiusPlus1 * (radiusPlus1 + 1) / 2; + var stackStart = new BlurStack(); + var stack = stackStart; + for (i = 1; i < div; i++) { + stack = stack.next = new BlurStack(); + if (i == radiusPlus1) var stackEnd = stack; + } + stack.next = stackStart; + var stackIn = null; + var stackOut = null; + yw = yi = 0; + var mul_sum = mul_table[radius]; + var shg_sum = shg_table[radius]; + for (y = 0; y < height; y++) { + r_in_sum = g_in_sum = b_in_sum = r_sum = g_sum = b_sum = 0; + r_out_sum = radiusPlus1 * (pr = pixels[yi]); + g_out_sum = radiusPlus1 * (pg = pixels[yi + 1]); + b_out_sum = radiusPlus1 * (pb = pixels[yi + 2]); + r_sum += sumFactor * pr; + g_sum += sumFactor * pg; + b_sum += sumFactor * pb; + stack = stackStart; + for (i = 0; i < radiusPlus1; i++) { + stack.r = pr; + stack.g = pg; + stack.b = pb; + stack = stack.next; + } + for (i = 1; i < radiusPlus1; i++) { + p = yi + ((widthMinus1 < i ? widthMinus1 : i) << 2); + r_sum += (stack.r = pr = pixels[p]) * (rbs = radiusPlus1 - i); + g_sum += (stack.g = pg = pixels[p + 1]) * rbs; + b_sum += (stack.b = pb = pixels[p + 2]) * rbs; + r_in_sum += pr; + g_in_sum += pg; + b_in_sum += pb; + stack = stack.next; + } + stackIn = stackStart; + stackOut = stackEnd; + for (x = 0; x < width; x++) { + pixels[yi] = r_sum * mul_sum >> shg_sum; + pixels[yi + 1] = g_sum * mul_sum >> shg_sum; + pixels[yi + 2] = b_sum * mul_sum >> shg_sum; + r_sum -= r_out_sum; + g_sum -= g_out_sum; + b_sum -= b_out_sum; + r_out_sum -= stackIn.r; + g_out_sum -= stackIn.g; + b_out_sum -= stackIn.b; + p = yw + ((p = x + radius + 1) < widthMinus1 ? p : widthMinus1) << 2; + r_in_sum += stackIn.r = pixels[p]; + g_in_sum += stackIn.g = pixels[p + 1]; + b_in_sum += stackIn.b = pixels[p + 2]; + r_sum += r_in_sum; + g_sum += g_in_sum; + b_sum += b_in_sum; + stackIn = stackIn.next; + r_out_sum += pr = stackOut.r; + g_out_sum += pg = stackOut.g; + b_out_sum += pb = stackOut.b; + r_in_sum -= pr; + g_in_sum -= pg; + b_in_sum -= pb; + stackOut = stackOut.next; + yi += 4; + } + yw += width; + } + for (x = 0; x < width; x++) { + g_in_sum = b_in_sum = r_in_sum = g_sum = b_sum = r_sum = 0; + yi = x << 2; + r_out_sum = radiusPlus1 * (pr = pixels[yi]); + g_out_sum = radiusPlus1 * (pg = pixels[yi + 1]); + b_out_sum = radiusPlus1 * (pb = pixels[yi + 2]); + r_sum += sumFactor * pr; + g_sum += sumFactor * pg; + b_sum += sumFactor * pb; + stack = stackStart; + for (i = 0; i < radiusPlus1; i++) { + stack.r = pr; + stack.g = pg; + stack.b = pb; + stack = stack.next; + } + yp = width; + for (i = 1; i <= radius; i++) { + yi = yp + x << 2; + r_sum += (stack.r = pr = pixels[yi]) * (rbs = radiusPlus1 - i); + g_sum += (stack.g = pg = pixels[yi + 1]) * rbs; + b_sum += (stack.b = pb = pixels[yi + 2]) * rbs; + r_in_sum += pr; + g_in_sum += pg; + b_in_sum += pb; + stack = stack.next; + if (i < heightMinus1) { + yp += width; + } + } + yi = x; + stackIn = stackStart; + stackOut = stackEnd; + for (y = 0; y < height; y++) { + p = yi << 2; + pixels[p] = r_sum * mul_sum >> shg_sum; + pixels[p + 1] = g_sum * mul_sum >> shg_sum; + pixels[p + 2] = b_sum * mul_sum >> shg_sum; + r_sum -= r_out_sum; + g_sum -= g_out_sum; + b_sum -= b_out_sum; + r_out_sum -= stackIn.r; + g_out_sum -= stackIn.g; + b_out_sum -= stackIn.b; + p = x + ((p = y + radiusPlus1) < heightMinus1 ? p : heightMinus1) * width << 2; + r_sum += r_in_sum += stackIn.r = pixels[p]; + g_sum += g_in_sum += stackIn.g = pixels[p + 1]; + b_sum += b_in_sum += stackIn.b = pixels[p + 2]; + stackIn = stackIn.next; + r_out_sum += pr = stackOut.r; + g_out_sum += pg = stackOut.g; + b_out_sum += pb = stackOut.b; + r_in_sum -= pr; + g_in_sum -= pg; + b_in_sum -= pb; + stackOut = stackOut.next; + yi += width; + } + } + context.putImageData(imageData, top_x, top_y); + } + function BlurStack() { + this.r = 0; + this.g = 0; + this.b = 0; + this.a = 0; + this.next = null; + } + /* + * canvg.js - Javascript SVG parser and renderer on Canvas + * MIT Licensed + * Gabe Lerner (gabelerner@gmail.com) + * http://code.google.com/p/canvg/ + * + * Requires: rgbcolor.js - http://www.phpied.com/rgb-color-parser-in-javascript/ + */ + (function() { + // canvg(target, s) + // empty parameters: replace all 'svg' elements on page with 'canvas' elements + // target: canvas element or the id of a canvas element + // s: svg string, url to svg file, or xml document + // opts: optional hash of options + // ignoreMouse: true => ignore mouse events + // ignoreAnimation: true => ignore animations + // ignoreDimensions: true => does not try to resize canvas + // ignoreClear: true => does not clear canvas + // offsetX: int => draws at a x offset + // offsetY: int => draws at a y offset + // scaleWidth: int => scales horizontally to width + // scaleHeight: int => scales vertically to height + // renderCallback: function => will call the function after the first render is completed + // forceRedraw: function => will call the function on every frame, if it returns true, will redraw + this.canvg = function(target, s, opts) { + // no parameters + if (target == null && s == null && opts == null) { + var svgTags = document.getElementsByTagName("svg"); + for (var i = 0; i < svgTags.length; i++) { + var svgTag = svgTags[i]; + var c = document.createElement("canvas"); + c.width = svgTag.clientWidth; + c.height = svgTag.clientHeight; + svgTag.parentNode.insertBefore(c, svgTag); + svgTag.parentNode.removeChild(svgTag); + var div = document.createElement("div"); + div.appendChild(svgTag); + canvg(c, div.innerHTML); + } + return; + } + opts = opts || {}; + if (typeof target == "string") { + target = document.getElementById(target); + } + // store class on canvas + if (target.svg != null) target.svg.stop(); + var svg = build(); + // on i.e. 8 for flash canvas, we can't assign the property so check for it + if (!(target.childNodes.length == 1 && target.childNodes[0].nodeName == "OBJECT")) target.svg = svg; + svg.opts = opts; + var ctx = target.getContext("2d"); + if (typeof s.documentElement != "undefined") { + // load from xml doc + svg.loadXmlDoc(ctx, s); + } else if (s.substr(0, 1) == "<") { + // load from xml string + svg.loadXml(ctx, s); + } else { + // load from url + svg.load(ctx, s); + } + }; + function build() { + var svg = {}; + svg.FRAMERATE = 30; + svg.MAX_VIRTUAL_PIXELS = 3e4; + // globals + svg.init = function(ctx) { + var uniqueId = 0; + svg.UniqueId = function() { + uniqueId++; + return "canvg" + uniqueId; + }; + svg.Definitions = {}; + svg.Styles = {}; + svg.Animations = []; + svg.Images = []; + svg.ctx = ctx; + svg.ViewPort = new function() { + this.viewPorts = []; + this.Clear = function() { + this.viewPorts = []; + }; + this.SetCurrent = function(width, height) { + this.viewPorts.push({ + width: width, + height: height + }); + }; + this.RemoveCurrent = function() { + this.viewPorts.pop(); + }; + this.Current = function() { + return this.viewPorts[this.viewPorts.length - 1]; + }; + this.width = function() { + return this.Current().width; + }; + this.height = function() { + return this.Current().height; + }; + this.ComputeSize = function(d) { + if (d != null && typeof d == "number") return d; + if (d == "x") return this.width(); + if (d == "y") return this.height(); + return Math.sqrt(Math.pow(this.width(), 2) + Math.pow(this.height(), 2)) / Math.sqrt(2); + }; + }(); + }; + svg.init(); + // images loaded + svg.ImagesLoaded = function() { + for (var i = 0; i < svg.Images.length; i++) { + if (!svg.Images[i].loaded) return false; + } + return true; + }; + // trim + svg.trim = function(s) { + return s.replace(/^\s+|\s+$/g, ""); + }; + // compress spaces + svg.compressSpaces = function(s) { + return s.replace(/[\s\r\t\n]+/gm, " "); + }; + // ajax + svg.ajax = function(url) { + var AJAX; + if (window.XMLHttpRequest) { + AJAX = new XMLHttpRequest(); + } else { + AJAX = new ActiveXObject("Microsoft.XMLHTTP"); + } + if (AJAX) { + AJAX.open("GET", url, false); + AJAX.send(null); + return AJAX.responseText; + } + return null; + }; + // parse xml + svg.parseXml = function(xml) { + if (window.DOMParser) { + var parser = new DOMParser(); + return parser.parseFromString(xml, "text/xml"); + } else { + xml = xml.replace(/]*>/, ""); + var xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); + xmlDoc.async = "false"; + xmlDoc.loadXML(xml); + return xmlDoc; + } + }; + svg.Property = function(name, value) { + this.name = name; + this.value = value; + }; + svg.Property.prototype.getValue = function() { + return this.value; + }; + svg.Property.prototype.hasValue = function() { + return this.value != null && this.value !== ""; + }; + // return the numerical value of the property + svg.Property.prototype.numValue = function() { + if (!this.hasValue()) return 0; + var n = parseFloat(this.value); + if ((this.value + "").match(/%$/)) { + n = n / 100; + } + return n; + }; + svg.Property.prototype.valueOrDefault = function(def) { + if (this.hasValue()) return this.value; + return def; + }; + svg.Property.prototype.numValueOrDefault = function(def) { + if (this.hasValue()) return this.numValue(); + return def; + }; + // color extensions + // augment the current color value with the opacity + svg.Property.prototype.addOpacity = function(opacity) { + var newValue = this.value; + if (opacity != null && opacity != "" && typeof this.value == "string") { + // can only add opacity to colors, not patterns + var color = new RGBColor(this.value); + if (color.ok) { + newValue = "rgba(" + color.r + ", " + color.g + ", " + color.b + ", " + opacity + ")"; + } + } + return new svg.Property(this.name, newValue); + }; + // definition extensions + // get the definition from the definitions table + svg.Property.prototype.getDefinition = function() { + var name = this.value.match(/#([^\)'"]+)/); + if (name) { + name = name[1]; + } + if (!name) { + name = this.value; + } + return svg.Definitions[name]; + }; + svg.Property.prototype.isUrlDefinition = function() { + return this.value.indexOf("url(") == 0; + }; + svg.Property.prototype.getFillStyleDefinition = function(e, opacityProp) { + var def = this.getDefinition(); + // gradient + if (def != null && def.createGradient) { + return def.createGradient(svg.ctx, e, opacityProp); + } + // pattern + if (def != null && def.createPattern) { + if (def.getHrefAttribute().hasValue()) { + var pt = def.attribute("patternTransform"); + def = def.getHrefAttribute().getDefinition(); + if (pt.hasValue()) { + def.attribute("patternTransform", true).value = pt.value; + } + } + return def.createPattern(svg.ctx, e); + } + return null; + }; + // length extensions + svg.Property.prototype.getDPI = function(viewPort) { + return 96; + }; + svg.Property.prototype.getEM = function(viewPort) { + var em = 12; + var fontSize = new svg.Property("fontSize", svg.Font.Parse(svg.ctx.font).fontSize); + if (fontSize.hasValue()) em = fontSize.toPixels(viewPort); + return em; + }; + svg.Property.prototype.getUnits = function() { + var s = this.value + ""; + return s.replace(/[0-9\.\-]/g, ""); + }; + // get the length as pixels + svg.Property.prototype.toPixels = function(viewPort, processPercent) { + if (!this.hasValue()) return 0; + var s = this.value + ""; + if (s.match(/em$/)) return this.numValue() * this.getEM(viewPort); + if (s.match(/ex$/)) return this.numValue() * this.getEM(viewPort) / 2; + if (s.match(/px$/)) return this.numValue(); + if (s.match(/pt$/)) return this.numValue() * this.getDPI(viewPort) * (1 / 72); + if (s.match(/pc$/)) return this.numValue() * 15; + if (s.match(/cm$/)) return this.numValue() * this.getDPI(viewPort) / 2.54; + if (s.match(/mm$/)) return this.numValue() * this.getDPI(viewPort) / 25.4; + if (s.match(/in$/)) return this.numValue() * this.getDPI(viewPort); + if (s.match(/%$/)) return this.numValue() * svg.ViewPort.ComputeSize(viewPort); + var n = this.numValue(); + if (processPercent && n < 1) return n * svg.ViewPort.ComputeSize(viewPort); + return n; + }; + // time extensions + // get the time as milliseconds + svg.Property.prototype.toMilliseconds = function() { + if (!this.hasValue()) return 0; + var s = this.value + ""; + if (s.match(/s$/)) return this.numValue() * 1e3; + if (s.match(/ms$/)) return this.numValue(); + return this.numValue(); + }; + // angle extensions + // get the angle as radians + svg.Property.prototype.toRadians = function() { + if (!this.hasValue()) return 0; + var s = this.value + ""; + if (s.match(/deg$/)) return this.numValue() * (Math.PI / 180); + if (s.match(/grad$/)) return this.numValue() * (Math.PI / 200); + if (s.match(/rad$/)) return this.numValue(); + return this.numValue() * (Math.PI / 180); + }; + // fonts + svg.Font = new function() { + this.Styles = "normal|italic|oblique|inherit"; + this.Variants = "normal|small-caps|inherit"; + this.Weights = "normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit"; + this.CreateFont = function(fontStyle, fontVariant, fontWeight, fontSize, fontFamily, inherit) { + var f = inherit != null ? this.Parse(inherit) : this.CreateFont("", "", "", "", "", svg.ctx.font); + return { + fontFamily: fontFamily || f.fontFamily, + fontSize: fontSize || f.fontSize, + fontStyle: fontStyle || f.fontStyle, + fontWeight: fontWeight || f.fontWeight, + fontVariant: fontVariant || f.fontVariant, + toString: function() { + return [ this.fontStyle, this.fontVariant, this.fontWeight, this.fontSize, this.fontFamily ].join(" "); + } + }; + }; + var that = this; + this.Parse = function(s) { + var f = {}; + var d = svg.trim(svg.compressSpaces(s || "")).split(" "); + var set = { + fontSize: false, + fontStyle: false, + fontWeight: false, + fontVariant: false + }; + var ff = ""; + for (var i = 0; i < d.length; i++) { + if (!set.fontStyle && that.Styles.indexOf(d[i]) != -1) { + if (d[i] != "inherit") f.fontStyle = d[i]; + set.fontStyle = true; + } else if (!set.fontVariant && that.Variants.indexOf(d[i]) != -1) { + if (d[i] != "inherit") f.fontVariant = d[i]; + set.fontStyle = set.fontVariant = true; + } else if (!set.fontWeight && that.Weights.indexOf(d[i]) != -1) { + if (d[i] != "inherit") f.fontWeight = d[i]; + set.fontStyle = set.fontVariant = set.fontWeight = true; + } else if (!set.fontSize) { + if (d[i] != "inherit") f.fontSize = d[i].split("/")[0]; + set.fontStyle = set.fontVariant = set.fontWeight = set.fontSize = true; + } else { + if (d[i] != "inherit") ff += d[i]; + } + } + if (ff != "") f.fontFamily = ff; + return f; + }; + }(); + // points and paths + svg.ToNumberArray = function(s) { + var a = svg.trim(svg.compressSpaces((s || "").replace(/,/g, " "))).split(" "); + for (var i = 0; i < a.length; i++) { + a[i] = parseFloat(a[i]); + } + return a; + }; + svg.Point = function(x, y) { + this.x = x; + this.y = y; + }; + svg.Point.prototype.angleTo = function(p) { + return Math.atan2(p.y - this.y, p.x - this.x); + }; + svg.Point.prototype.applyTransform = function(v) { + var xp = this.x * v[0] + this.y * v[2] + v[4]; + var yp = this.x * v[1] + this.y * v[3] + v[5]; + this.x = xp; + this.y = yp; + }; + svg.CreatePoint = function(s) { + var a = svg.ToNumberArray(s); + return new svg.Point(a[0], a[1]); + }; + svg.CreatePath = function(s) { + var a = svg.ToNumberArray(s); + var path = []; + for (var i = 0; i < a.length; i += 2) { + path.push(new svg.Point(a[i], a[i + 1])); + } + return path; + }; + // bounding box + svg.BoundingBox = function(x1, y1, x2, y2) { + // pass in initial points if you want + this.x1 = Number.NaN; + this.y1 = Number.NaN; + this.x2 = Number.NaN; + this.y2 = Number.NaN; + this.x = function() { + return this.x1; + }; + this.y = function() { + return this.y1; + }; + this.width = function() { + return this.x2 - this.x1; + }; + this.height = function() { + return this.y2 - this.y1; + }; + this.addPoint = function(x, y) { + if (x != null) { + if (isNaN(this.x1) || isNaN(this.x2)) { + this.x1 = x; + this.x2 = x; + } + if (x < this.x1) this.x1 = x; + if (x > this.x2) this.x2 = x; + } + if (y != null) { + if (isNaN(this.y1) || isNaN(this.y2)) { + this.y1 = y; + this.y2 = y; + } + if (y < this.y1) this.y1 = y; + if (y > this.y2) this.y2 = y; + } + }; + this.addX = function(x) { + this.addPoint(x, null); + }; + this.addY = function(y) { + this.addPoint(null, y); + }; + this.addBoundingBox = function(bb) { + this.addPoint(bb.x1, bb.y1); + this.addPoint(bb.x2, bb.y2); + }; + this.addQuadraticCurve = function(p0x, p0y, p1x, p1y, p2x, p2y) { + var cp1x = p0x + 2 / 3 * (p1x - p0x); + // CP1 = QP0 + 2/3 *(QP1-QP0) + var cp1y = p0y + 2 / 3 * (p1y - p0y); + // CP1 = QP0 + 2/3 *(QP1-QP0) + var cp2x = cp1x + 1 / 3 * (p2x - p0x); + // CP2 = CP1 + 1/3 *(QP2-QP0) + var cp2y = cp1y + 1 / 3 * (p2y - p0y); + // CP2 = CP1 + 1/3 *(QP2-QP0) + this.addBezierCurve(p0x, p0y, cp1x, cp2x, cp1y, cp2y, p2x, p2y); + }; + this.addBezierCurve = function(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y) { + // from http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html + var p0 = [ p0x, p0y ], p1 = [ p1x, p1y ], p2 = [ p2x, p2y ], p3 = [ p3x, p3y ]; + this.addPoint(p0[0], p0[1]); + this.addPoint(p3[0], p3[1]); + for (i = 0; i <= 1; i++) { + var f = function(t) { + return Math.pow(1 - t, 3) * p0[i] + 3 * Math.pow(1 - t, 2) * t * p1[i] + 3 * (1 - t) * Math.pow(t, 2) * p2[i] + Math.pow(t, 3) * p3[i]; + }; + var b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i]; + var a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i]; + var c = 3 * p1[i] - 3 * p0[i]; + if (a == 0) { + if (b == 0) continue; + var t = -c / b; + if (0 < t && t < 1) { + if (i == 0) this.addX(f(t)); + if (i == 1) this.addY(f(t)); + } + continue; + } + var b2ac = Math.pow(b, 2) - 4 * c * a; + if (b2ac < 0) continue; + var t1 = (-b + Math.sqrt(b2ac)) / (2 * a); + if (0 < t1 && t1 < 1) { + if (i == 0) this.addX(f(t1)); + if (i == 1) this.addY(f(t1)); + } + var t2 = (-b - Math.sqrt(b2ac)) / (2 * a); + if (0 < t2 && t2 < 1) { + if (i == 0) this.addX(f(t2)); + if (i == 1) this.addY(f(t2)); + } + } + }; + this.isPointInBox = function(x, y) { + return this.x1 <= x && x <= this.x2 && this.y1 <= y && y <= this.y2; + }; + this.addPoint(x1, y1); + this.addPoint(x2, y2); + }; + // transforms + svg.Transform = function(v) { + var that = this; + this.Type = {}; + // translate + this.Type.translate = function(s) { + this.p = svg.CreatePoint(s); + this.apply = function(ctx) { + ctx.translate(this.p.x || 0, this.p.y || 0); + }; + this.unapply = function(ctx) { + ctx.translate(-1 * this.p.x || 0, -1 * this.p.y || 0); + }; + this.applyToPoint = function(p) { + p.applyTransform([ 1, 0, 0, 1, this.p.x || 0, this.p.y || 0 ]); + }; + }; + // rotate + this.Type.rotate = function(s) { + var a = svg.ToNumberArray(s); + this.angle = new svg.Property("angle", a[0]); + this.cx = a[1] || 0; + this.cy = a[2] || 0; + this.apply = function(ctx) { + ctx.translate(this.cx, this.cy); + ctx.rotate(this.angle.toRadians()); + ctx.translate(-this.cx, -this.cy); + }; + this.unapply = function(ctx) { + ctx.translate(this.cx, this.cy); + ctx.rotate(-1 * this.angle.toRadians()); + ctx.translate(-this.cx, -this.cy); + }; + this.applyToPoint = function(p) { + var a = this.angle.toRadians(); + p.applyTransform([ 1, 0, 0, 1, this.p.x || 0, this.p.y || 0 ]); + p.applyTransform([ Math.cos(a), Math.sin(a), -Math.sin(a), Math.cos(a), 0, 0 ]); + p.applyTransform([ 1, 0, 0, 1, -this.p.x || 0, -this.p.y || 0 ]); + }; + }; + this.Type.scale = function(s) { + this.p = svg.CreatePoint(s); + this.apply = function(ctx) { + ctx.scale(this.p.x || 1, this.p.y || this.p.x || 1); + }; + this.unapply = function(ctx) { + ctx.scale(1 / this.p.x || 1, 1 / this.p.y || this.p.x || 1); + }; + this.applyToPoint = function(p) { + p.applyTransform([ this.p.x || 0, 0, 0, this.p.y || 0, 0, 0 ]); + }; + }; + this.Type.matrix = function(s) { + this.m = svg.ToNumberArray(s); + this.apply = function(ctx) { + ctx.transform(this.m[0], this.m[1], this.m[2], this.m[3], this.m[4], this.m[5]); + }; + this.applyToPoint = function(p) { + p.applyTransform(this.m); + }; + }; + this.Type.SkewBase = function(s) { + this.base = that.Type.matrix; + this.base(s); + this.angle = new svg.Property("angle", s); + }; + this.Type.SkewBase.prototype = new this.Type.matrix(); + this.Type.skewX = function(s) { + this.base = that.Type.SkewBase; + this.base(s); + this.m = [ 1, 0, Math.tan(this.angle.toRadians()), 1, 0, 0 ]; + }; + this.Type.skewX.prototype = new this.Type.SkewBase(); + this.Type.skewY = function(s) { + this.base = that.Type.SkewBase; + this.base(s); + this.m = [ 1, Math.tan(this.angle.toRadians()), 0, 1, 0, 0 ]; + }; + this.Type.skewY.prototype = new this.Type.SkewBase(); + this.transforms = []; + this.apply = function(ctx) { + for (var i = 0; i < this.transforms.length; i++) { + this.transforms[i].apply(ctx); + } + }; + this.unapply = function(ctx) { + for (var i = this.transforms.length - 1; i >= 0; i--) { + this.transforms[i].unapply(ctx); + } + }; + this.applyToPoint = function(p) { + for (var i = 0; i < this.transforms.length; i++) { + this.transforms[i].applyToPoint(p); + } + }; + var data = svg.trim(svg.compressSpaces(v)).replace(/\)(\s?,\s?)/g, ") ").split(/\s(?=[a-z])/); + for (var i = 0; i < data.length; i++) { + var type = svg.trim(data[i].split("(")[0]); + var s = data[i].split("(")[1].replace(")", ""); + var transform = new this.Type[type](s); + transform.type = type; + this.transforms.push(transform); + } + }; + // aspect ratio + svg.AspectRatio = function(ctx, aspectRatio, width, desiredWidth, height, desiredHeight, minX, minY, refX, refY) { + // aspect ratio - http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute + aspectRatio = svg.compressSpaces(aspectRatio); + aspectRatio = aspectRatio.replace(/^defer\s/, ""); + // ignore defer + var align = aspectRatio.split(" ")[0] || "xMidYMid"; + var meetOrSlice = aspectRatio.split(" ")[1] || "meet"; + // calculate scale + var scaleX = width / desiredWidth; + var scaleY = height / desiredHeight; + var scaleMin = Math.min(scaleX, scaleY); + var scaleMax = Math.max(scaleX, scaleY); + if (meetOrSlice == "meet") { + desiredWidth *= scaleMin; + desiredHeight *= scaleMin; + } + if (meetOrSlice == "slice") { + desiredWidth *= scaleMax; + desiredHeight *= scaleMax; + } + refX = new svg.Property("refX", refX); + refY = new svg.Property("refY", refY); + if (refX.hasValue() && refY.hasValue()) { + ctx.translate(-scaleMin * refX.toPixels("x"), -scaleMin * refY.toPixels("y")); + } else { + // align + if (align.match(/^xMid/) && (meetOrSlice == "meet" && scaleMin == scaleY || meetOrSlice == "slice" && scaleMax == scaleY)) ctx.translate(width / 2 - desiredWidth / 2, 0); + if (align.match(/YMid$/) && (meetOrSlice == "meet" && scaleMin == scaleX || meetOrSlice == "slice" && scaleMax == scaleX)) ctx.translate(0, height / 2 - desiredHeight / 2); + if (align.match(/^xMax/) && (meetOrSlice == "meet" && scaleMin == scaleY || meetOrSlice == "slice" && scaleMax == scaleY)) ctx.translate(width - desiredWidth, 0); + if (align.match(/YMax$/) && (meetOrSlice == "meet" && scaleMin == scaleX || meetOrSlice == "slice" && scaleMax == scaleX)) ctx.translate(0, height - desiredHeight); + } + // scale + if (align == "none") ctx.scale(scaleX, scaleY); else if (meetOrSlice == "meet") ctx.scale(scaleMin, scaleMin); else if (meetOrSlice == "slice") ctx.scale(scaleMax, scaleMax); + // translate + ctx.translate(minX == null ? 0 : -minX, minY == null ? 0 : -minY); + }; + // elements + svg.Element = {}; + svg.EmptyProperty = new svg.Property("EMPTY", ""); + svg.Element.ElementBase = function(node) { + this.attributes = {}; + this.styles = {}; + this.children = []; + // get or create attribute + this.attribute = function(name, createIfNotExists) { + var a = this.attributes[name]; + if (a != null) return a; + if (createIfNotExists == true) { + a = new svg.Property(name, ""); + this.attributes[name] = a; + } + return a || svg.EmptyProperty; + }; + this.getHrefAttribute = function() { + for (var a in this.attributes) { + if (a.match(/:href$/)) { + return this.attributes[a]; + } + } + return svg.EmptyProperty; + }; + // get or create style, crawls up node tree + this.style = function(name, createIfNotExists) { + var s = this.styles[name]; + if (s != null) return s; + var a = this.attribute(name); + if (a != null && a.hasValue()) { + this.styles[name] = a; + // move up to me to cache + return a; + } + var p = this.parent; + if (p != null) { + var ps = p.style(name); + if (ps != null && ps.hasValue()) { + return ps; + } + } + if (createIfNotExists == true) { + s = new svg.Property(name, ""); + this.styles[name] = s; + } + return s || svg.EmptyProperty; + }; + // base render + this.render = function(ctx) { + // don't render display=none + if (this.style("display").value == "none") return; + // don't render visibility=hidden + if (this.attribute("visibility").value == "hidden") return; + ctx.save(); + if (this.attribute("mask").hasValue()) { + // mask + var mask = this.attribute("mask").getDefinition(); + if (mask != null) mask.apply(ctx, this); + } else if (this.style("filter").hasValue()) { + // filter + var filter = this.style("filter").getDefinition(); + if (filter != null) filter.apply(ctx, this); + } else { + this.setContext(ctx); + this.renderChildren(ctx); + this.clearContext(ctx); + } + ctx.restore(); + }; + // base set context + this.setContext = function(ctx) {}; + // base clear context + this.clearContext = function(ctx) {}; + // base render children + this.renderChildren = function(ctx) { + for (var i = 0; i < this.children.length; i++) { + this.children[i].render(ctx); + } + }; + this.addChild = function(childNode, create) { + var child = childNode; + if (create) child = svg.CreateElement(childNode); + child.parent = this; + this.children.push(child); + }; + if (node != null && node.nodeType == 1) { + //ELEMENT_NODE + // add children + for (var i = 0; i < node.childNodes.length; i++) { + var childNode = node.childNodes[i]; + if (childNode.nodeType == 1) this.addChild(childNode, true); + //ELEMENT_NODE + if (this.captureTextNodes && childNode.nodeType == 3) { + var text = childNode.nodeValue || childNode.text || ""; + if (svg.trim(svg.compressSpaces(text)) != "") { + this.addChild(new svg.Element.tspan(childNode), false); + } + } + } + // add attributes + for (var i = 0; i < node.attributes.length; i++) { + var attribute = node.attributes[i]; + this.attributes[attribute.nodeName] = new svg.Property(attribute.nodeName, attribute.nodeValue); + } + // add tag styles + var styles = svg.Styles[node.nodeName]; + if (styles != null) { + for (var name in styles) { + this.styles[name] = styles[name]; + } + } + // add class styles + if (this.attribute("class").hasValue()) { + var classes = svg.compressSpaces(this.attribute("class").value).split(" "); + for (var j = 0; j < classes.length; j++) { + styles = svg.Styles["." + classes[j]]; + if (styles != null) { + for (var name in styles) { + this.styles[name] = styles[name]; + } + } + styles = svg.Styles[node.nodeName + "." + classes[j]]; + if (styles != null) { + for (var name in styles) { + this.styles[name] = styles[name]; + } + } + } + } + // add id styles + if (this.attribute("id").hasValue()) { + var styles = svg.Styles["#" + this.attribute("id").value]; + if (styles != null) { + for (var name in styles) { + this.styles[name] = styles[name]; + } + } + } + // add inline styles + if (this.attribute("style").hasValue()) { + var styles = this.attribute("style").value.split(";"); + for (var i = 0; i < styles.length; i++) { + if (svg.trim(styles[i]) != "") { + var style = styles[i].split(":"); + var name = svg.trim(style[0]); + var value = svg.trim(style[1]); + this.styles[name] = new svg.Property(name, value); + } + } + } + // add id + if (this.attribute("id").hasValue()) { + if (svg.Definitions[this.attribute("id").value] == null) { + svg.Definitions[this.attribute("id").value] = this; + } + } + } + }; + svg.Element.RenderedElementBase = function(node) { + this.base = svg.Element.ElementBase; + this.base(node); + this.setContext = function(ctx) { + // fill + if (this.style("fill").isUrlDefinition()) { + var fs = this.style("fill").getFillStyleDefinition(this, this.style("fill-opacity")); + if (fs != null) ctx.fillStyle = fs; + } else if (this.style("fill").hasValue()) { + var fillStyle = this.style("fill"); + if (fillStyle.value == "currentColor") fillStyle.value = this.style("color").value; + ctx.fillStyle = fillStyle.value == "none" ? "rgba(0,0,0,0)" : fillStyle.value; + } + if (this.style("fill-opacity").hasValue()) { + var fillStyle = new svg.Property("fill", ctx.fillStyle); + fillStyle = fillStyle.addOpacity(this.style("fill-opacity").value); + ctx.fillStyle = fillStyle.value; + } + // stroke + if (this.style("stroke").isUrlDefinition()) { + var fs = this.style("stroke").getFillStyleDefinition(this, this.style("stroke-opacity")); + if (fs != null) ctx.strokeStyle = fs; + } else if (this.style("stroke").hasValue()) { + var strokeStyle = this.style("stroke"); + if (strokeStyle.value == "currentColor") strokeStyle.value = this.style("color").value; + ctx.strokeStyle = strokeStyle.value == "none" ? "rgba(0,0,0,0)" : strokeStyle.value; + } + if (this.style("stroke-opacity").hasValue()) { + var strokeStyle = new svg.Property("stroke", ctx.strokeStyle); + strokeStyle = strokeStyle.addOpacity(this.style("stroke-opacity").value); + ctx.strokeStyle = strokeStyle.value; + } + if (this.style("stroke-width").hasValue()) { + var newLineWidth = this.style("stroke-width").toPixels(); + ctx.lineWidth = newLineWidth == 0 ? .001 : newLineWidth; + } + if (this.style("stroke-linecap").hasValue()) ctx.lineCap = this.style("stroke-linecap").value; + if (this.style("stroke-linejoin").hasValue()) ctx.lineJoin = this.style("stroke-linejoin").value; + if (this.style("stroke-miterlimit").hasValue()) ctx.miterLimit = this.style("stroke-miterlimit").value; + if (this.style("stroke-dasharray").hasValue()) { + var gaps = svg.ToNumberArray(this.style("stroke-dasharray").value); + if (typeof ctx.setLineDash != "undefined") { + ctx.setLineDash(gaps); + } else if (typeof ctx.webkitLineDash != "undefined") { + ctx.webkitLineDash = gaps; + } else if (typeof ctx.mozDash != "undefined") { + ctx.mozDash = gaps; + } + var offset = this.style("stroke-dashoffset").numValueOrDefault(1); + if (typeof ctx.lineDashOffset != "undefined") { + ctx.lineDashOffset = offset; + } else if (typeof ctx.webkitLineDashOffset != "undefined") { + ctx.webkitLineDashOffset = offset; + } else if (typeof ctx.mozDashOffset != "undefined") { + ctx.mozDashOffset = offset; + } + } + // font + if (typeof ctx.font != "undefined") { + ctx.font = svg.Font.CreateFont(this.style("font-style").value, this.style("font-variant").value, this.style("font-weight").value, this.style("font-size").hasValue() ? this.style("font-size").toPixels() + "px" : "", this.style("font-family").value).toString(); + } + // transform + if (this.attribute("transform").hasValue()) { + var transform = new svg.Transform(this.attribute("transform").value); + transform.apply(ctx); + } + // clip + if (this.style("clip-path").hasValue()) { + var clip = this.style("clip-path").getDefinition(); + if (clip != null) clip.apply(ctx); + } + // opacity + if (this.style("opacity").hasValue()) { + ctx.globalAlpha = this.style("opacity").numValue(); + } + }; + }; + svg.Element.RenderedElementBase.prototype = new svg.Element.ElementBase(); + svg.Element.PathElementBase = function(node) { + this.base = svg.Element.RenderedElementBase; + this.base(node); + this.path = function(ctx) { + if (ctx != null) ctx.beginPath(); + return new svg.BoundingBox(); + }; + this.renderChildren = function(ctx) { + this.path(ctx); + svg.Mouse.checkPath(this, ctx); + if (ctx.fillStyle != "") { + if (this.attribute("fill-rule").hasValue()) { + ctx.fill(this.attribute("fill-rule").value); + } else { + ctx.fill(); + } + } + if (ctx.strokeStyle != "") ctx.stroke(); + var markers = this.getMarkers(); + if (markers != null) { + if (this.style("marker-start").isUrlDefinition()) { + var marker = this.style("marker-start").getDefinition(); + marker.render(ctx, markers[0][0], markers[0][1]); + } + if (this.style("marker-mid").isUrlDefinition()) { + var marker = this.style("marker-mid").getDefinition(); + for (var i = 1; i < markers.length - 1; i++) { + marker.render(ctx, markers[i][0], markers[i][1]); + } + } + if (this.style("marker-end").isUrlDefinition()) { + var marker = this.style("marker-end").getDefinition(); + marker.render(ctx, markers[markers.length - 1][0], markers[markers.length - 1][1]); + } + } + }; + this.getBoundingBox = function() { + return this.path(); + }; + this.getMarkers = function() { + return null; + }; + }; + svg.Element.PathElementBase.prototype = new svg.Element.RenderedElementBase(); + // svg element + svg.Element.svg = function(node) { + this.base = svg.Element.RenderedElementBase; + this.base(node); + this.baseClearContext = this.clearContext; + this.clearContext = function(ctx) { + this.baseClearContext(ctx); + svg.ViewPort.RemoveCurrent(); + }; + this.baseSetContext = this.setContext; + this.setContext = function(ctx) { + // initial values + ctx.strokeStyle = "rgba(0,0,0,0)"; + ctx.lineCap = "butt"; + ctx.lineJoin = "miter"; + ctx.miterLimit = 4; + this.baseSetContext(ctx); + // create new view port + if (!this.attribute("x").hasValue()) this.attribute("x", true).value = 0; + if (!this.attribute("y").hasValue()) this.attribute("y", true).value = 0; + ctx.translate(this.attribute("x").toPixels("x"), this.attribute("y").toPixels("y")); + var width = svg.ViewPort.width(); + var height = svg.ViewPort.height(); + if (!this.attribute("width").hasValue()) this.attribute("width", true).value = "100%"; + if (!this.attribute("height").hasValue()) this.attribute("height", true).value = "100%"; + if (typeof this.root == "undefined") { + width = this.attribute("width").toPixels("x"); + height = this.attribute("height").toPixels("y"); + var x = 0; + var y = 0; + if (this.attribute("refX").hasValue() && this.attribute("refY").hasValue()) { + x = -this.attribute("refX").toPixels("x"); + y = -this.attribute("refY").toPixels("y"); + } + ctx.beginPath(); + ctx.moveTo(x, y); + ctx.lineTo(width, y); + ctx.lineTo(width, height); + ctx.lineTo(x, height); + ctx.closePath(); + ctx.clip(); + } + svg.ViewPort.SetCurrent(width, height); + // viewbox + if (this.attribute("viewBox").hasValue()) { + var viewBox = svg.ToNumberArray(this.attribute("viewBox").value); + var minX = viewBox[0]; + var minY = viewBox[1]; + width = viewBox[2]; + height = viewBox[3]; + svg.AspectRatio(ctx, this.attribute("preserveAspectRatio").value, svg.ViewPort.width(), width, svg.ViewPort.height(), height, minX, minY, this.attribute("refX").value, this.attribute("refY").value); + svg.ViewPort.RemoveCurrent(); + svg.ViewPort.SetCurrent(viewBox[2], viewBox[3]); + } + }; + }; + svg.Element.svg.prototype = new svg.Element.RenderedElementBase(); + // rect element + svg.Element.rect = function(node) { + this.base = svg.Element.PathElementBase; + this.base(node); + this.path = function(ctx) { + var x = this.attribute("x").toPixels("x"); + var y = this.attribute("y").toPixels("y"); + var width = this.attribute("width").toPixels("x"); + var height = this.attribute("height").toPixels("y"); + var rx = this.attribute("rx").toPixels("x"); + var ry = this.attribute("ry").toPixels("y"); + if (this.attribute("rx").hasValue() && !this.attribute("ry").hasValue()) ry = rx; + if (this.attribute("ry").hasValue() && !this.attribute("rx").hasValue()) rx = ry; + rx = Math.min(rx, width / 2); + ry = Math.min(ry, height / 2); + if (ctx != null) { + ctx.beginPath(); + ctx.moveTo(x + rx, y); + ctx.lineTo(x + width - rx, y); + ctx.quadraticCurveTo(x + width, y, x + width, y + ry); + ctx.lineTo(x + width, y + height - ry); + ctx.quadraticCurveTo(x + width, y + height, x + width - rx, y + height); + ctx.lineTo(x + rx, y + height); + ctx.quadraticCurveTo(x, y + height, x, y + height - ry); + ctx.lineTo(x, y + ry); + ctx.quadraticCurveTo(x, y, x + rx, y); + ctx.closePath(); + } + return new svg.BoundingBox(x, y, x + width, y + height); + }; + }; + svg.Element.rect.prototype = new svg.Element.PathElementBase(); + // circle element + svg.Element.circle = function(node) { + this.base = svg.Element.PathElementBase; + this.base(node); + this.path = function(ctx) { + var cx = this.attribute("cx").toPixels("x"); + var cy = this.attribute("cy").toPixels("y"); + var r = this.attribute("r").toPixels(); + if (ctx != null) { + ctx.beginPath(); + ctx.arc(cx, cy, r, 0, Math.PI * 2, true); + ctx.closePath(); + } + return new svg.BoundingBox(cx - r, cy - r, cx + r, cy + r); + }; + }; + svg.Element.circle.prototype = new svg.Element.PathElementBase(); + // ellipse element + svg.Element.ellipse = function(node) { + this.base = svg.Element.PathElementBase; + this.base(node); + this.path = function(ctx) { + var KAPPA = 4 * ((Math.sqrt(2) - 1) / 3); + var rx = this.attribute("rx").toPixels("x"); + var ry = this.attribute("ry").toPixels("y"); + var cx = this.attribute("cx").toPixels("x"); + var cy = this.attribute("cy").toPixels("y"); + if (ctx != null) { + ctx.beginPath(); + ctx.moveTo(cx, cy - ry); + ctx.bezierCurveTo(cx + KAPPA * rx, cy - ry, cx + rx, cy - KAPPA * ry, cx + rx, cy); + ctx.bezierCurveTo(cx + rx, cy + KAPPA * ry, cx + KAPPA * rx, cy + ry, cx, cy + ry); + ctx.bezierCurveTo(cx - KAPPA * rx, cy + ry, cx - rx, cy + KAPPA * ry, cx - rx, cy); + ctx.bezierCurveTo(cx - rx, cy - KAPPA * ry, cx - KAPPA * rx, cy - ry, cx, cy - ry); + ctx.closePath(); + } + return new svg.BoundingBox(cx - rx, cy - ry, cx + rx, cy + ry); + }; + }; + svg.Element.ellipse.prototype = new svg.Element.PathElementBase(); + // line element + svg.Element.line = function(node) { + this.base = svg.Element.PathElementBase; + this.base(node); + this.getPoints = function() { + return [ new svg.Point(this.attribute("x1").toPixels("x"), this.attribute("y1").toPixels("y")), new svg.Point(this.attribute("x2").toPixels("x"), this.attribute("y2").toPixels("y")) ]; + }; + this.path = function(ctx) { + var points = this.getPoints(); + if (ctx != null) { + ctx.beginPath(); + ctx.moveTo(points[0].x, points[0].y); + ctx.lineTo(points[1].x, points[1].y); + } + return new svg.BoundingBox(points[0].x, points[0].y, points[1].x, points[1].y); + }; + this.getMarkers = function() { + var points = this.getPoints(); + var a = points[0].angleTo(points[1]); + return [ [ points[0], a ], [ points[1], a ] ]; + }; + }; + svg.Element.line.prototype = new svg.Element.PathElementBase(); + // polyline element + svg.Element.polyline = function(node) { + this.base = svg.Element.PathElementBase; + this.base(node); + this.points = svg.CreatePath(this.attribute("points").value); + this.path = function(ctx) { + var bb = new svg.BoundingBox(this.points[0].x, this.points[0].y); + if (ctx != null) { + ctx.beginPath(); + ctx.moveTo(this.points[0].x, this.points[0].y); + } + for (var i = 1; i < this.points.length; i++) { + bb.addPoint(this.points[i].x, this.points[i].y); + if (ctx != null) ctx.lineTo(this.points[i].x, this.points[i].y); + } + return bb; + }; + this.getMarkers = function() { + var markers = []; + for (var i = 0; i < this.points.length - 1; i++) { + markers.push([ this.points[i], this.points[i].angleTo(this.points[i + 1]) ]); + } + markers.push([ this.points[this.points.length - 1], markers[markers.length - 1][1] ]); + return markers; + }; + }; + svg.Element.polyline.prototype = new svg.Element.PathElementBase(); + // polygon element + svg.Element.polygon = function(node) { + this.base = svg.Element.polyline; + this.base(node); + this.basePath = this.path; + this.path = function(ctx) { + var bb = this.basePath(ctx); + if (ctx != null) { + ctx.lineTo(this.points[0].x, this.points[0].y); + ctx.closePath(); + } + return bb; + }; + }; + svg.Element.polygon.prototype = new svg.Element.polyline(); + // path element + svg.Element.path = function(node) { + this.base = svg.Element.PathElementBase; + this.base(node); + var d = this.attribute("d").value; + // TODO: convert to real lexer based on http://www.w3.org/TR/SVG11/paths.html#PathDataBNF + d = d.replace(/,/gm, " "); + // get rid of all commas + d = d.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm, "$1 $2"); + // separate commands from commands + d = d.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm, "$1 $2"); + // separate commands from commands + d = d.replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm, "$1 $2"); + // separate commands from points + d = d.replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm, "$1 $2"); + // separate commands from points + d = d.replace(/([0-9])([+\-])/gm, "$1 $2"); + // separate digits when no comma + d = d.replace(/(\.[0-9]*)(\.)/gm, "$1 $2"); + // separate digits when no comma + d = d.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm, "$1 $3 $4 "); + // shorthand elliptical arc path syntax + d = svg.compressSpaces(d); + // compress multiple spaces + d = svg.trim(d); + this.PathParser = new function(d) { + this.tokens = d.split(" "); + this.reset = function() { + this.i = -1; + this.command = ""; + this.previousCommand = ""; + this.start = new svg.Point(0, 0); + this.control = new svg.Point(0, 0); + this.current = new svg.Point(0, 0); + this.points = []; + this.angles = []; + }; + this.isEnd = function() { + return this.i >= this.tokens.length - 1; + }; + this.isCommandOrEnd = function() { + if (this.isEnd()) return true; + return this.tokens[this.i + 1].match(/^[A-Za-z]$/) != null; + }; + this.isRelativeCommand = function() { + switch (this.command) { + case "m": + case "l": + case "h": + case "v": + case "c": + case "s": + case "q": + case "t": + case "a": + case "z": + return true; + break; + } + return false; + }; + this.getToken = function() { + this.i++; + return this.tokens[this.i]; + }; + this.getScalar = function() { + return parseFloat(this.getToken()); + }; + this.nextCommand = function() { + this.previousCommand = this.command; + this.command = this.getToken(); + }; + this.getPoint = function() { + var p = new svg.Point(this.getScalar(), this.getScalar()); + return this.makeAbsolute(p); + }; + this.getAsControlPoint = function() { + var p = this.getPoint(); + this.control = p; + return p; + }; + this.getAsCurrentPoint = function() { + var p = this.getPoint(); + this.current = p; + return p; + }; + this.getReflectedControlPoint = function() { + if (this.previousCommand.toLowerCase() != "c" && this.previousCommand.toLowerCase() != "s" && this.previousCommand.toLowerCase() != "q" && this.previousCommand.toLowerCase() != "t") { + return this.current; + } + // reflect point + var p = new svg.Point(2 * this.current.x - this.control.x, 2 * this.current.y - this.control.y); + return p; + }; + this.makeAbsolute = function(p) { + if (this.isRelativeCommand()) { + p.x += this.current.x; + p.y += this.current.y; + } + return p; + }; + this.addMarker = function(p, from, priorTo) { + // if the last angle isn't filled in because we didn't have this point yet ... + if (priorTo != null && this.angles.length > 0 && this.angles[this.angles.length - 1] == null) { + this.angles[this.angles.length - 1] = this.points[this.points.length - 1].angleTo(priorTo); + } + this.addMarkerAngle(p, from == null ? null : from.angleTo(p)); + }; + this.addMarkerAngle = function(p, a) { + this.points.push(p); + this.angles.push(a); + }; + this.getMarkerPoints = function() { + return this.points; + }; + this.getMarkerAngles = function() { + for (var i = 0; i < this.angles.length; i++) { + if (this.angles[i] == null) { + for (var j = i + 1; j < this.angles.length; j++) { + if (this.angles[j] != null) { + this.angles[i] = this.angles[j]; + break; + } + } + } + } + return this.angles; + }; + }(d); + this.path = function(ctx) { + var pp = this.PathParser; + pp.reset(); + var bb = new svg.BoundingBox(); + if (ctx != null) ctx.beginPath(); + while (!pp.isEnd()) { + pp.nextCommand(); + switch (pp.command) { + case "M": + case "m": + var p = pp.getAsCurrentPoint(); + pp.addMarker(p); + bb.addPoint(p.x, p.y); + if (ctx != null) ctx.moveTo(p.x, p.y); + pp.start = pp.current; + while (!pp.isCommandOrEnd()) { + var p = pp.getAsCurrentPoint(); + pp.addMarker(p, pp.start); + bb.addPoint(p.x, p.y); + if (ctx != null) ctx.lineTo(p.x, p.y); + } + break; + + case "L": + case "l": + while (!pp.isCommandOrEnd()) { + var c = pp.current; + var p = pp.getAsCurrentPoint(); + pp.addMarker(p, c); + bb.addPoint(p.x, p.y); + if (ctx != null) ctx.lineTo(p.x, p.y); + } + break; + + case "H": + case "h": + while (!pp.isCommandOrEnd()) { + var newP = new svg.Point((pp.isRelativeCommand() ? pp.current.x : 0) + pp.getScalar(), pp.current.y); + pp.addMarker(newP, pp.current); + pp.current = newP; + bb.addPoint(pp.current.x, pp.current.y); + if (ctx != null) ctx.lineTo(pp.current.x, pp.current.y); + } + break; + + case "V": + case "v": + while (!pp.isCommandOrEnd()) { + var newP = new svg.Point(pp.current.x, (pp.isRelativeCommand() ? pp.current.y : 0) + pp.getScalar()); + pp.addMarker(newP, pp.current); + pp.current = newP; + bb.addPoint(pp.current.x, pp.current.y); + if (ctx != null) ctx.lineTo(pp.current.x, pp.current.y); + } + break; + + case "C": + case "c": + while (!pp.isCommandOrEnd()) { + var curr = pp.current; + var p1 = pp.getPoint(); + var cntrl = pp.getAsControlPoint(); + var cp = pp.getAsCurrentPoint(); + pp.addMarker(cp, cntrl, p1); + bb.addBezierCurve(curr.x, curr.y, p1.x, p1.y, cntrl.x, cntrl.y, cp.x, cp.y); + if (ctx != null) ctx.bezierCurveTo(p1.x, p1.y, cntrl.x, cntrl.y, cp.x, cp.y); + } + break; + + case "S": + case "s": + while (!pp.isCommandOrEnd()) { + var curr = pp.current; + var p1 = pp.getReflectedControlPoint(); + var cntrl = pp.getAsControlPoint(); + var cp = pp.getAsCurrentPoint(); + pp.addMarker(cp, cntrl, p1); + bb.addBezierCurve(curr.x, curr.y, p1.x, p1.y, cntrl.x, cntrl.y, cp.x, cp.y); + if (ctx != null) ctx.bezierCurveTo(p1.x, p1.y, cntrl.x, cntrl.y, cp.x, cp.y); + } + break; + + case "Q": + case "q": + while (!pp.isCommandOrEnd()) { + var curr = pp.current; + var cntrl = pp.getAsControlPoint(); + var cp = pp.getAsCurrentPoint(); + pp.addMarker(cp, cntrl, cntrl); + bb.addQuadraticCurve(curr.x, curr.y, cntrl.x, cntrl.y, cp.x, cp.y); + if (ctx != null) ctx.quadraticCurveTo(cntrl.x, cntrl.y, cp.x, cp.y); + } + break; + + case "T": + case "t": + while (!pp.isCommandOrEnd()) { + var curr = pp.current; + var cntrl = pp.getReflectedControlPoint(); + pp.control = cntrl; + var cp = pp.getAsCurrentPoint(); + pp.addMarker(cp, cntrl, cntrl); + bb.addQuadraticCurve(curr.x, curr.y, cntrl.x, cntrl.y, cp.x, cp.y); + if (ctx != null) ctx.quadraticCurveTo(cntrl.x, cntrl.y, cp.x, cp.y); + } + break; + + case "A": + case "a": + while (!pp.isCommandOrEnd()) { + var curr = pp.current; + var rx = pp.getScalar(); + var ry = pp.getScalar(); + var xAxisRotation = pp.getScalar() * (Math.PI / 180); + var largeArcFlag = pp.getScalar(); + var sweepFlag = pp.getScalar(); + var cp = pp.getAsCurrentPoint(); + // Conversion from endpoint to center parameterization + // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes + // x1', y1' + var currp = new svg.Point(Math.cos(xAxisRotation) * (curr.x - cp.x) / 2 + Math.sin(xAxisRotation) * (curr.y - cp.y) / 2, -Math.sin(xAxisRotation) * (curr.x - cp.x) / 2 + Math.cos(xAxisRotation) * (curr.y - cp.y) / 2); + // adjust radii + var l = Math.pow(currp.x, 2) / Math.pow(rx, 2) + Math.pow(currp.y, 2) / Math.pow(ry, 2); + if (l > 1) { + rx *= Math.sqrt(l); + ry *= Math.sqrt(l); + } + // cx', cy' + var s = (largeArcFlag == sweepFlag ? -1 : 1) * Math.sqrt((Math.pow(rx, 2) * Math.pow(ry, 2) - Math.pow(rx, 2) * Math.pow(currp.y, 2) - Math.pow(ry, 2) * Math.pow(currp.x, 2)) / (Math.pow(rx, 2) * Math.pow(currp.y, 2) + Math.pow(ry, 2) * Math.pow(currp.x, 2))); + if (isNaN(s)) s = 0; + var cpp = new svg.Point(s * rx * currp.y / ry, s * -ry * currp.x / rx); + // cx, cy + var centp = new svg.Point((curr.x + cp.x) / 2 + Math.cos(xAxisRotation) * cpp.x - Math.sin(xAxisRotation) * cpp.y, (curr.y + cp.y) / 2 + Math.sin(xAxisRotation) * cpp.x + Math.cos(xAxisRotation) * cpp.y); + // vector magnitude + var m = function(v) { + return Math.sqrt(Math.pow(v[0], 2) + Math.pow(v[1], 2)); + }; + // ratio between two vectors + var r = function(u, v) { + return (u[0] * v[0] + u[1] * v[1]) / (m(u) * m(v)); + }; + // angle between two vectors + var a = function(u, v) { + return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(r(u, v)); + }; + // initial angle + var a1 = a([ 1, 0 ], [ (currp.x - cpp.x) / rx, (currp.y - cpp.y) / ry ]); + // angle delta + var u = [ (currp.x - cpp.x) / rx, (currp.y - cpp.y) / ry ]; + var v = [ (-currp.x - cpp.x) / rx, (-currp.y - cpp.y) / ry ]; + var ad = a(u, v); + if (r(u, v) <= -1) ad = Math.PI; + if (r(u, v) >= 1) ad = 0; + // for markers + var dir = 1 - sweepFlag ? 1 : -1; + var ah = a1 + dir * (ad / 2); + var halfWay = new svg.Point(centp.x + rx * Math.cos(ah), centp.y + ry * Math.sin(ah)); + pp.addMarkerAngle(halfWay, ah - dir * Math.PI / 2); + pp.addMarkerAngle(cp, ah - dir * Math.PI); + bb.addPoint(cp.x, cp.y); + // TODO: this is too naive, make it better + if (ctx != null) { + var r = rx > ry ? rx : ry; + var sx = rx > ry ? 1 : rx / ry; + var sy = rx > ry ? ry / rx : 1; + ctx.translate(centp.x, centp.y); + ctx.rotate(xAxisRotation); + ctx.scale(sx, sy); + ctx.arc(0, 0, r, a1, a1 + ad, 1 - sweepFlag); + ctx.scale(1 / sx, 1 / sy); + ctx.rotate(-xAxisRotation); + ctx.translate(-centp.x, -centp.y); + } + } + break; + + case "Z": + case "z": + if (ctx != null) ctx.closePath(); + pp.current = pp.start; + } + } + return bb; + }; + this.getMarkers = function() { + var points = this.PathParser.getMarkerPoints(); + var angles = this.PathParser.getMarkerAngles(); + var markers = []; + for (var i = 0; i < points.length; i++) { + markers.push([ points[i], angles[i] ]); + } + return markers; + }; + }; + svg.Element.path.prototype = new svg.Element.PathElementBase(); + // pattern element + svg.Element.pattern = function(node) { + this.base = svg.Element.ElementBase; + this.base(node); + this.createPattern = function(ctx, element) { + var width = this.attribute("width").toPixels("x", true); + var height = this.attribute("height").toPixels("y", true); + // render me using a temporary svg element + var tempSvg = new svg.Element.svg(); + tempSvg.attributes["viewBox"] = new svg.Property("viewBox", this.attribute("viewBox").value); + tempSvg.attributes["width"] = new svg.Property("width", width + "px"); + tempSvg.attributes["height"] = new svg.Property("height", height + "px"); + tempSvg.attributes["transform"] = new svg.Property("transform", this.attribute("patternTransform").value); + tempSvg.children = this.children; + var c = document.createElement("canvas"); + c.width = width; + c.height = height; + var cctx = c.getContext("2d"); + if (this.attribute("x").hasValue() && this.attribute("y").hasValue()) { + cctx.translate(this.attribute("x").toPixels("x", true), this.attribute("y").toPixels("y", true)); + } + // render 3x3 grid so when we transform there's no white space on edges + for (var x = -1; x <= 1; x++) { + for (var y = -1; y <= 1; y++) { + cctx.save(); + cctx.translate(x * c.width, y * c.height); + tempSvg.render(cctx); + cctx.restore(); + } + } + var pattern = ctx.createPattern(c, "repeat"); + return pattern; + }; + }; + svg.Element.pattern.prototype = new svg.Element.ElementBase(); + // marker element + svg.Element.marker = function(node) { + this.base = svg.Element.ElementBase; + this.base(node); + this.baseRender = this.render; + this.render = function(ctx, point, angle) { + ctx.translate(point.x, point.y); + if (this.attribute("orient").valueOrDefault("auto") == "auto") ctx.rotate(angle); + if (this.attribute("markerUnits").valueOrDefault("strokeWidth") == "strokeWidth") ctx.scale(ctx.lineWidth, ctx.lineWidth); + ctx.save(); + // render me using a temporary svg element + var tempSvg = new svg.Element.svg(); + tempSvg.attributes["viewBox"] = new svg.Property("viewBox", this.attribute("viewBox").value); + tempSvg.attributes["refX"] = new svg.Property("refX", this.attribute("refX").value); + tempSvg.attributes["refY"] = new svg.Property("refY", this.attribute("refY").value); + tempSvg.attributes["width"] = new svg.Property("width", this.attribute("markerWidth").value); + tempSvg.attributes["height"] = new svg.Property("height", this.attribute("markerHeight").value); + tempSvg.attributes["fill"] = new svg.Property("fill", this.attribute("fill").valueOrDefault("black")); + tempSvg.attributes["stroke"] = new svg.Property("stroke", this.attribute("stroke").valueOrDefault("none")); + tempSvg.children = this.children; + tempSvg.render(ctx); + ctx.restore(); + if (this.attribute("markerUnits").valueOrDefault("strokeWidth") == "strokeWidth") ctx.scale(1 / ctx.lineWidth, 1 / ctx.lineWidth); + if (this.attribute("orient").valueOrDefault("auto") == "auto") ctx.rotate(-angle); + ctx.translate(-point.x, -point.y); + }; + }; + svg.Element.marker.prototype = new svg.Element.ElementBase(); + // definitions element + svg.Element.defs = function(node) { + this.base = svg.Element.ElementBase; + this.base(node); + this.render = function(ctx) {}; + }; + svg.Element.defs.prototype = new svg.Element.ElementBase(); + // base for gradients + svg.Element.GradientBase = function(node) { + this.base = svg.Element.ElementBase; + this.base(node); + this.gradientUnits = this.attribute("gradientUnits").valueOrDefault("objectBoundingBox"); + this.stops = []; + for (var i = 0; i < this.children.length; i++) { + var child = this.children[i]; + if (child.type == "stop") this.stops.push(child); + } + this.getGradient = function() {}; + this.createGradient = function(ctx, element, parentOpacityProp) { + var stopsContainer = this; + if (this.getHrefAttribute().hasValue()) { + stopsContainer = this.getHrefAttribute().getDefinition(); + } + var addParentOpacity = function(color) { + if (parentOpacityProp.hasValue()) { + var p = new svg.Property("color", color); + return p.addOpacity(parentOpacityProp.value).value; + } + return color; + }; + var g = this.getGradient(ctx, element); + if (g == null) return addParentOpacity(stopsContainer.stops[stopsContainer.stops.length - 1].color); + for (var i = 0; i < stopsContainer.stops.length; i++) { + g.addColorStop(stopsContainer.stops[i].offset, addParentOpacity(stopsContainer.stops[i].color)); + } + if (this.attribute("gradientTransform").hasValue()) { + // render as transformed pattern on temporary canvas + var rootView = svg.ViewPort.viewPorts[0]; + var rect = new svg.Element.rect(); + rect.attributes["x"] = new svg.Property("x", -svg.MAX_VIRTUAL_PIXELS / 3); + rect.attributes["y"] = new svg.Property("y", -svg.MAX_VIRTUAL_PIXELS / 3); + rect.attributes["width"] = new svg.Property("width", svg.MAX_VIRTUAL_PIXELS); + rect.attributes["height"] = new svg.Property("height", svg.MAX_VIRTUAL_PIXELS); + var group = new svg.Element.g(); + group.attributes["transform"] = new svg.Property("transform", this.attribute("gradientTransform").value); + group.children = [ rect ]; + var tempSvg = new svg.Element.svg(); + tempSvg.attributes["x"] = new svg.Property("x", 0); + tempSvg.attributes["y"] = new svg.Property("y", 0); + tempSvg.attributes["width"] = new svg.Property("width", rootView.width); + tempSvg.attributes["height"] = new svg.Property("height", rootView.height); + tempSvg.children = [ group ]; + var c = document.createElement("canvas"); + c.width = rootView.width; + c.height = rootView.height; + var tempCtx = c.getContext("2d"); + tempCtx.fillStyle = g; + tempSvg.render(tempCtx); + return tempCtx.createPattern(c, "no-repeat"); + } + return g; + }; + }; + svg.Element.GradientBase.prototype = new svg.Element.ElementBase(); + // linear gradient element + svg.Element.linearGradient = function(node) { + this.base = svg.Element.GradientBase; + this.base(node); + this.getGradient = function(ctx, element) { + var bb = element.getBoundingBox(); + if (!this.attribute("x1").hasValue() && !this.attribute("y1").hasValue() && !this.attribute("x2").hasValue() && !this.attribute("y2").hasValue()) { + this.attribute("x1", true).value = 0; + this.attribute("y1", true).value = 0; + this.attribute("x2", true).value = 1; + this.attribute("y2", true).value = 0; + } + var x1 = this.gradientUnits == "objectBoundingBox" ? bb.x() + bb.width() * this.attribute("x1").numValue() : this.attribute("x1").toPixels("x"); + var y1 = this.gradientUnits == "objectBoundingBox" ? bb.y() + bb.height() * this.attribute("y1").numValue() : this.attribute("y1").toPixels("y"); + var x2 = this.gradientUnits == "objectBoundingBox" ? bb.x() + bb.width() * this.attribute("x2").numValue() : this.attribute("x2").toPixels("x"); + var y2 = this.gradientUnits == "objectBoundingBox" ? bb.y() + bb.height() * this.attribute("y2").numValue() : this.attribute("y2").toPixels("y"); + if (x1 == x2 && y1 == y2) return null; + return ctx.createLinearGradient(x1, y1, x2, y2); + }; + }; + svg.Element.linearGradient.prototype = new svg.Element.GradientBase(); + // radial gradient element + svg.Element.radialGradient = function(node) { + this.base = svg.Element.GradientBase; + this.base(node); + this.getGradient = function(ctx, element) { + var bb = element.getBoundingBox(); + if (!this.attribute("cx").hasValue()) this.attribute("cx", true).value = "50%"; + if (!this.attribute("cy").hasValue()) this.attribute("cy", true).value = "50%"; + if (!this.attribute("r").hasValue()) this.attribute("r", true).value = "50%"; + var cx = this.gradientUnits == "objectBoundingBox" ? bb.x() + bb.width() * this.attribute("cx").numValue() : this.attribute("cx").toPixels("x"); + var cy = this.gradientUnits == "objectBoundingBox" ? bb.y() + bb.height() * this.attribute("cy").numValue() : this.attribute("cy").toPixels("y"); + var fx = cx; + var fy = cy; + if (this.attribute("fx").hasValue()) { + fx = this.gradientUnits == "objectBoundingBox" ? bb.x() + bb.width() * this.attribute("fx").numValue() : this.attribute("fx").toPixels("x"); + } + if (this.attribute("fy").hasValue()) { + fy = this.gradientUnits == "objectBoundingBox" ? bb.y() + bb.height() * this.attribute("fy").numValue() : this.attribute("fy").toPixels("y"); + } + var r = this.gradientUnits == "objectBoundingBox" ? (bb.width() + bb.height()) / 2 * this.attribute("r").numValue() : this.attribute("r").toPixels(); + return ctx.createRadialGradient(fx, fy, 0, cx, cy, r); + }; + }; + svg.Element.radialGradient.prototype = new svg.Element.GradientBase(); + // gradient stop element + svg.Element.stop = function(node) { + this.base = svg.Element.ElementBase; + this.base(node); + this.offset = this.attribute("offset").numValue(); + if (this.offset < 0) this.offset = 0; + if (this.offset > 1) this.offset = 1; + var stopColor = this.style("stop-color"); + if (this.style("stop-opacity").hasValue()) stopColor = stopColor.addOpacity(this.style("stop-opacity").value); + this.color = stopColor.value; + }; + svg.Element.stop.prototype = new svg.Element.ElementBase(); + // animation base element + svg.Element.AnimateBase = function(node) { + this.base = svg.Element.ElementBase; + this.base(node); + svg.Animations.push(this); + this.duration = 0; + this.begin = this.attribute("begin").toMilliseconds(); + this.maxDuration = this.begin + this.attribute("dur").toMilliseconds(); + this.getProperty = function() { + var attributeType = this.attribute("attributeType").value; + var attributeName = this.attribute("attributeName").value; + if (attributeType == "CSS") { + return this.parent.style(attributeName, true); + } + return this.parent.attribute(attributeName, true); + }; + this.initialValue = null; + this.initialUnits = ""; + this.removed = false; + this.calcValue = function() { + // OVERRIDE ME! + return ""; + }; + this.update = function(delta) { + // set initial value + if (this.initialValue == null) { + this.initialValue = this.getProperty().value; + this.initialUnits = this.getProperty().getUnits(); + } + // if we're past the end time + if (this.duration > this.maxDuration) { + // loop for indefinitely repeating animations + if (this.attribute("repeatCount").value == "indefinite" || this.attribute("repeatDur").value == "indefinite") { + this.duration = 0; + } else if (this.attribute("fill").valueOrDefault("remove") == "remove" && !this.removed) { + this.removed = true; + this.getProperty().value = this.initialValue; + return true; + } else { + return false; + } + } + this.duration = this.duration + delta; + // if we're past the begin time + var updated = false; + if (this.begin < this.duration) { + var newValue = this.calcValue(); + // tween + if (this.attribute("type").hasValue()) { + // for transform, etc. + var type = this.attribute("type").value; + newValue = type + "(" + newValue + ")"; + } + this.getProperty().value = newValue; + updated = true; + } + return updated; + }; + this.from = this.attribute("from"); + this.to = this.attribute("to"); + this.values = this.attribute("values"); + if (this.values.hasValue()) this.values.value = this.values.value.split(";"); + // fraction of duration we've covered + this.progress = function() { + var ret = { + progress: (this.duration - this.begin) / (this.maxDuration - this.begin) + }; + if (this.values.hasValue()) { + var p = ret.progress * (this.values.value.length - 1); + var lb = Math.floor(p), ub = Math.ceil(p); + ret.from = new svg.Property("from", parseFloat(this.values.value[lb])); + ret.to = new svg.Property("to", parseFloat(this.values.value[ub])); + ret.progress = (p - lb) / (ub - lb); + } else { + ret.from = this.from; + ret.to = this.to; + } + return ret; + }; + }; + svg.Element.AnimateBase.prototype = new svg.Element.ElementBase(); + // animate element + svg.Element.animate = function(node) { + this.base = svg.Element.AnimateBase; + this.base(node); + this.calcValue = function() { + var p = this.progress(); + // tween value linearly + var newValue = p.from.numValue() + (p.to.numValue() - p.from.numValue()) * p.progress; + return newValue + this.initialUnits; + }; + }; + svg.Element.animate.prototype = new svg.Element.AnimateBase(); + // animate color element + svg.Element.animateColor = function(node) { + this.base = svg.Element.AnimateBase; + this.base(node); + this.calcValue = function() { + var p = this.progress(); + var from = new RGBColor(p.from.value); + var to = new RGBColor(p.to.value); + if (from.ok && to.ok) { + // tween color linearly + var r = from.r + (to.r - from.r) * p.progress; + var g = from.g + (to.g - from.g) * p.progress; + var b = from.b + (to.b - from.b) * p.progress; + return "rgb(" + parseInt(r, 10) + "," + parseInt(g, 10) + "," + parseInt(b, 10) + ")"; + } + return this.attribute("from").value; + }; + }; + svg.Element.animateColor.prototype = new svg.Element.AnimateBase(); + // animate transform element + svg.Element.animateTransform = function(node) { + this.base = svg.Element.AnimateBase; + this.base(node); + this.calcValue = function() { + var p = this.progress(); + // tween value linearly + var from = svg.ToNumberArray(p.from.value); + var to = svg.ToNumberArray(p.to.value); + var newValue = ""; + for (var i = 0; i < from.length; i++) { + newValue += from[i] + (to[i] - from[i]) * p.progress + " "; + } + return newValue; + }; + }; + svg.Element.animateTransform.prototype = new svg.Element.animate(); + // font element + svg.Element.font = function(node) { + this.base = svg.Element.ElementBase; + this.base(node); + this.horizAdvX = this.attribute("horiz-adv-x").numValue(); + this.isRTL = false; + this.isArabic = false; + this.fontFace = null; + this.missingGlyph = null; + this.glyphs = []; + for (var i = 0; i < this.children.length; i++) { + var child = this.children[i]; + if (child.type == "font-face") { + this.fontFace = child; + if (child.style("font-family").hasValue()) { + svg.Definitions[child.style("font-family").value] = this; + } + } else if (child.type == "missing-glyph") this.missingGlyph = child; else if (child.type == "glyph") { + if (child.arabicForm != "") { + this.isRTL = true; + this.isArabic = true; + if (typeof this.glyphs[child.unicode] == "undefined") this.glyphs[child.unicode] = []; + this.glyphs[child.unicode][child.arabicForm] = child; + } else { + this.glyphs[child.unicode] = child; + } + } + } + }; + svg.Element.font.prototype = new svg.Element.ElementBase(); + // font-face element + svg.Element.fontface = function(node) { + this.base = svg.Element.ElementBase; + this.base(node); + this.ascent = this.attribute("ascent").value; + this.descent = this.attribute("descent").value; + this.unitsPerEm = this.attribute("units-per-em").numValue(); + }; + svg.Element.fontface.prototype = new svg.Element.ElementBase(); + // missing-glyph element + svg.Element.missingglyph = function(node) { + this.base = svg.Element.path; + this.base(node); + this.horizAdvX = 0; + }; + svg.Element.missingglyph.prototype = new svg.Element.path(); + // glyph element + svg.Element.glyph = function(node) { + this.base = svg.Element.path; + this.base(node); + this.horizAdvX = this.attribute("horiz-adv-x").numValue(); + this.unicode = this.attribute("unicode").value; + this.arabicForm = this.attribute("arabic-form").value; + }; + svg.Element.glyph.prototype = new svg.Element.path(); + // text element + svg.Element.text = function(node) { + this.captureTextNodes = true; + this.base = svg.Element.RenderedElementBase; + this.base(node); + this.baseSetContext = this.setContext; + this.setContext = function(ctx) { + this.baseSetContext(ctx); + if (this.style("dominant-baseline").hasValue()) ctx.textBaseline = this.style("dominant-baseline").value; + if (this.style("alignment-baseline").hasValue()) ctx.textBaseline = this.style("alignment-baseline").value; + }; + this.getBoundingBox = function() { + // TODO: implement + return new svg.BoundingBox(this.attribute("x").toPixels("x"), this.attribute("y").toPixels("y"), 0, 0); + }; + this.renderChildren = function(ctx) { + this.x = this.attribute("x").toPixels("x"); + this.y = this.attribute("y").toPixels("y"); + this.x += this.getAnchorDelta(ctx, this, 0); + for (var i = 0; i < this.children.length; i++) { + this.renderChild(ctx, this, i); + } + }; + this.getAnchorDelta = function(ctx, parent, startI) { + var textAnchor = this.style("text-anchor").valueOrDefault("start"); + if (textAnchor != "start") { + var width = 0; + for (var i = startI; i < parent.children.length; i++) { + var child = parent.children[i]; + if (i > startI && child.attribute("x").hasValue()) break; + // new group + width += child.measureTextRecursive(ctx); + } + return -1 * (textAnchor == "end" ? width : width / 2); + } + return 0; + }; + this.renderChild = function(ctx, parent, i) { + var child = parent.children[i]; + if (child.attribute("x").hasValue()) { + child.x = child.attribute("x").toPixels("x") + this.getAnchorDelta(ctx, parent, i); + } else { + if (this.attribute("dx").hasValue()) this.x += this.attribute("dx").toPixels("x"); + if (child.attribute("dx").hasValue()) this.x += child.attribute("dx").toPixels("x"); + child.x = this.x; + } + this.x = child.x + child.measureText(ctx); + if (child.attribute("y").hasValue()) { + child.y = child.attribute("y").toPixels("y"); + } else { + if (this.attribute("dy").hasValue()) this.y += this.attribute("dy").toPixels("y"); + if (child.attribute("dy").hasValue()) this.y += child.attribute("dy").toPixels("y"); + child.y = this.y; + } + this.y = child.y; + child.render(ctx); + for (var i = 0; i < child.children.length; i++) { + this.renderChild(ctx, child, i); + } + }; + }; + svg.Element.text.prototype = new svg.Element.RenderedElementBase(); + // text base + svg.Element.TextElementBase = function(node) { + this.base = svg.Element.RenderedElementBase; + this.base(node); + this.getGlyph = function(font, text, i) { + var c = text[i]; + var glyph = null; + if (font.isArabic) { + var arabicForm = "isolated"; + if ((i == 0 || text[i - 1] == " ") && i < text.length - 2 && text[i + 1] != " ") arabicForm = "terminal"; + if (i > 0 && text[i - 1] != " " && i < text.length - 2 && text[i + 1] != " ") arabicForm = "medial"; + if (i > 0 && text[i - 1] != " " && (i == text.length - 1 || text[i + 1] == " ")) arabicForm = "initial"; + if (typeof font.glyphs[c] != "undefined") { + glyph = font.glyphs[c][arabicForm]; + if (glyph == null && font.glyphs[c].type == "glyph") glyph = font.glyphs[c]; + } + } else { + glyph = font.glyphs[c]; + } + if (glyph == null) glyph = font.missingGlyph; + return glyph; + }; + this.renderChildren = function(ctx) { + var customFont = this.parent.style("font-family").getDefinition(); + if (customFont != null) { + var fontSize = this.parent.style("font-size").numValueOrDefault(svg.Font.Parse(svg.ctx.font).fontSize); + var fontStyle = this.parent.style("font-style").valueOrDefault(svg.Font.Parse(svg.ctx.font).fontStyle); + var text = this.getText(); + if (customFont.isRTL) text = text.split("").reverse().join(""); + var dx = svg.ToNumberArray(this.parent.attribute("dx").value); + for (var i = 0; i < text.length; i++) { + var glyph = this.getGlyph(customFont, text, i); + var scale = fontSize / customFont.fontFace.unitsPerEm; + ctx.translate(this.x, this.y); + ctx.scale(scale, -scale); + var lw = ctx.lineWidth; + ctx.lineWidth = ctx.lineWidth * customFont.fontFace.unitsPerEm / fontSize; + if (fontStyle == "italic") ctx.transform(1, 0, .4, 1, 0, 0); + glyph.render(ctx); + if (fontStyle == "italic") ctx.transform(1, 0, -.4, 1, 0, 0); + ctx.lineWidth = lw; + ctx.scale(1 / scale, -1 / scale); + ctx.translate(-this.x, -this.y); + this.x += fontSize * (glyph.horizAdvX || customFont.horizAdvX) / customFont.fontFace.unitsPerEm; + if (typeof dx[i] != "undefined" && !isNaN(dx[i])) { + this.x += dx[i]; + } + } + return; + } + if (ctx.fillStyle != "") ctx.fillText(svg.compressSpaces(this.getText()), this.x, this.y); + if (ctx.strokeStyle != "") ctx.strokeText(svg.compressSpaces(this.getText()), this.x, this.y); + }; + this.getText = function() {}; + this.measureTextRecursive = function(ctx) { + var width = this.measureText(ctx); + for (var i = 0; i < this.children.length; i++) { + width += this.children[i].measureTextRecursive(ctx); + } + return width; + }; + this.measureText = function(ctx) { + var customFont = this.parent.style("font-family").getDefinition(); + if (customFont != null) { + var fontSize = this.parent.style("font-size").numValueOrDefault(svg.Font.Parse(svg.ctx.font).fontSize); + var measure = 0; + var text = this.getText(); + if (customFont.isRTL) text = text.split("").reverse().join(""); + var dx = svg.ToNumberArray(this.parent.attribute("dx").value); + for (var i = 0; i < text.length; i++) { + var glyph = this.getGlyph(customFont, text, i); + measure += (glyph.horizAdvX || customFont.horizAdvX) * fontSize / customFont.fontFace.unitsPerEm; + if (typeof dx[i] != "undefined" && !isNaN(dx[i])) { + measure += dx[i]; + } + } + return measure; + } + var textToMeasure = svg.compressSpaces(this.getText()); + if (!ctx.measureText) return textToMeasure.length * 10; + ctx.save(); + this.setContext(ctx); + var width = ctx.measureText(textToMeasure).width; + ctx.restore(); + return width; + }; + }; + svg.Element.TextElementBase.prototype = new svg.Element.RenderedElementBase(); + // tspan + svg.Element.tspan = function(node) { + this.captureTextNodes = true; + this.base = svg.Element.TextElementBase; + this.base(node); + this.text = node.nodeValue || node.text || ""; + this.getText = function() { + return this.text; + }; + }; + svg.Element.tspan.prototype = new svg.Element.TextElementBase(); + // tref + svg.Element.tref = function(node) { + this.base = svg.Element.TextElementBase; + this.base(node); + this.getText = function() { + var element = this.getHrefAttribute().getDefinition(); + if (element != null) return element.children[0].getText(); + }; + }; + svg.Element.tref.prototype = new svg.Element.TextElementBase(); + // a element + svg.Element.a = function(node) { + this.base = svg.Element.TextElementBase; + this.base(node); + this.hasText = true; + for (var i = 0; i < node.childNodes.length; i++) { + if (node.childNodes[i].nodeType != 3) this.hasText = false; + } + // this might contain text + this.text = this.hasText ? node.childNodes[0].nodeValue : ""; + this.getText = function() { + return this.text; + }; + this.baseRenderChildren = this.renderChildren; + this.renderChildren = function(ctx) { + if (this.hasText) { + // render as text element + this.baseRenderChildren(ctx); + var fontSize = new svg.Property("fontSize", svg.Font.Parse(svg.ctx.font).fontSize); + svg.Mouse.checkBoundingBox(this, new svg.BoundingBox(this.x, this.y - fontSize.toPixels("y"), this.x + this.measureText(ctx), this.y)); + } else { + // render as temporary group + var g = new svg.Element.g(); + g.children = this.children; + g.parent = this; + g.render(ctx); + } + }; + this.onclick = function() { + window.open(this.getHrefAttribute().value); + }; + this.onmousemove = function() { + svg.ctx.canvas.style.cursor = "pointer"; + }; + }; + svg.Element.a.prototype = new svg.Element.TextElementBase(); + // image element + svg.Element.image = function(node) { + this.base = svg.Element.RenderedElementBase; + this.base(node); + var href = this.getHrefAttribute().value; + var isSvg = href.match(/\.svg$/); + svg.Images.push(this); + this.loaded = false; + if (!isSvg) { + this.img = document.createElement("img"); + var self = this; + this.img.onload = function() { + self.loaded = true; + }; + this.img.onerror = function() { + if (typeof console != "undefined") { + console.log('ERROR: image "' + href + '" not found'); + self.loaded = true; + } + }; + this.img.src = href; + } else { + this.img = svg.ajax(href); + this.loaded = true; + } + this.renderChildren = function(ctx) { + var x = this.attribute("x").toPixels("x"); + var y = this.attribute("y").toPixels("y"); + var width = this.attribute("width").toPixels("x"); + var height = this.attribute("height").toPixels("y"); + if (width == 0 || height == 0) return; + ctx.save(); + if (isSvg) { + ctx.drawSvg(this.img, x, y, width, height); + } else { + ctx.translate(x, y); + svg.AspectRatio(ctx, this.attribute("preserveAspectRatio").value, width, this.img.width, height, this.img.height, 0, 0); + ctx.drawImage(this.img, 0, 0); + } + ctx.restore(); + }; + this.getBoundingBox = function() { + var x = this.attribute("x").toPixels("x"); + var y = this.attribute("y").toPixels("y"); + var width = this.attribute("width").toPixels("x"); + var height = this.attribute("height").toPixels("y"); + return new svg.BoundingBox(x, y, x + width, y + height); + }; + }; + svg.Element.image.prototype = new svg.Element.RenderedElementBase(); + // group element + svg.Element.g = function(node) { + this.base = svg.Element.RenderedElementBase; + this.base(node); + this.getBoundingBox = function() { + var bb = new svg.BoundingBox(); + for (var i = 0; i < this.children.length; i++) { + bb.addBoundingBox(this.children[i].getBoundingBox()); + } + return bb; + }; + }; + svg.Element.g.prototype = new svg.Element.RenderedElementBase(); + // symbol element + svg.Element.symbol = function(node) { + this.base = svg.Element.RenderedElementBase; + this.base(node); + this.baseSetContext = this.setContext; + this.setContext = function(ctx) { + this.baseSetContext(ctx); + // viewbox + if (this.attribute("viewBox").hasValue()) { + var viewBox = svg.ToNumberArray(this.attribute("viewBox").value); + var minX = viewBox[0]; + var minY = viewBox[1]; + width = viewBox[2]; + height = viewBox[3]; + svg.AspectRatio(ctx, this.attribute("preserveAspectRatio").value, this.attribute("width").toPixels("x"), width, this.attribute("height").toPixels("y"), height, minX, minY); + svg.ViewPort.SetCurrent(viewBox[2], viewBox[3]); + } + }; + }; + svg.Element.symbol.prototype = new svg.Element.RenderedElementBase(); + // style element + svg.Element.style = function(node) { + this.base = svg.Element.ElementBase; + this.base(node); + // text, or spaces then CDATA + var css = ""; + for (var i = 0; i < node.childNodes.length; i++) { + css += node.childNodes[i].nodeValue; + } + css = css.replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm, ""); + // remove comments + css = svg.compressSpaces(css); + // replace whitespace + var cssDefs = css.split("}"); + for (var i = 0; i < cssDefs.length; i++) { + if (svg.trim(cssDefs[i]) != "") { + var cssDef = cssDefs[i].split("{"); + var cssClasses = cssDef[0].split(","); + var cssProps = cssDef[1].split(";"); + for (var j = 0; j < cssClasses.length; j++) { + var cssClass = svg.trim(cssClasses[j]); + if (cssClass != "") { + var props = {}; + for (var k = 0; k < cssProps.length; k++) { + var prop = cssProps[k].indexOf(":"); + var name = cssProps[k].substr(0, prop); + var value = cssProps[k].substr(prop + 1, cssProps[k].length - prop); + if (name != null && value != null) { + props[svg.trim(name)] = new svg.Property(svg.trim(name), svg.trim(value)); + } + } + svg.Styles[cssClass] = props; + if (cssClass == "@font-face") { + var fontFamily = props["font-family"].value.replace(/"/g, ""); + var srcs = props["src"].value.split(","); + for (var s = 0; s < srcs.length; s++) { + if (srcs[s].indexOf('format("svg")') > 0) { + var urlStart = srcs[s].indexOf("url"); + var urlEnd = srcs[s].indexOf(")", urlStart); + var url = srcs[s].substr(urlStart + 5, urlEnd - urlStart - 6); + var doc = svg.parseXml(svg.ajax(url)); + var fonts = doc.getElementsByTagName("font"); + for (var f = 0; f < fonts.length; f++) { + var font = svg.CreateElement(fonts[f]); + svg.Definitions[fontFamily] = font; + } + } + } + } + } + } + } + } + }; + svg.Element.style.prototype = new svg.Element.ElementBase(); + // use element + svg.Element.use = function(node) { + this.base = svg.Element.RenderedElementBase; + this.base(node); + this.baseSetContext = this.setContext; + this.setContext = function(ctx) { + this.baseSetContext(ctx); + if (this.attribute("x").hasValue()) ctx.translate(this.attribute("x").toPixels("x"), 0); + if (this.attribute("y").hasValue()) ctx.translate(0, this.attribute("y").toPixels("y")); + }; + this.getDefinition = function() { + var element = this.getHrefAttribute().getDefinition(); + if (this.attribute("width").hasValue()) element.attribute("width", true).value = this.attribute("width").value; + if (this.attribute("height").hasValue()) element.attribute("height", true).value = this.attribute("height").value; + return element; + }; + this.path = function(ctx) { + var element = this.getDefinition(); + if (element != null) element.path(ctx); + }; + this.getBoundingBox = function() { + var element = this.getDefinition(); + if (element != null) return element.getBoundingBox(); + }; + this.renderChildren = function(ctx) { + var element = this.getDefinition(); + if (element != null) { + // temporarily detach from parent and render + var oldParent = element.parent; + element.parent = null; + element.render(ctx); + element.parent = oldParent; + } + }; + }; + svg.Element.use.prototype = new svg.Element.RenderedElementBase(); + // mask element + svg.Element.mask = function(node) { + this.base = svg.Element.ElementBase; + this.base(node); + this.apply = function(ctx, element) { + // render as temp svg + var x = this.attribute("x").toPixels("x"); + var y = this.attribute("y").toPixels("y"); + var width = this.attribute("width").toPixels("x"); + var height = this.attribute("height").toPixels("y"); + if (width == 0 && height == 0) { + var bb = new svg.BoundingBox(); + for (var i = 0; i < this.children.length; i++) { + bb.addBoundingBox(this.children[i].getBoundingBox()); + } + var x = Math.floor(bb.x1); + var y = Math.floor(bb.y1); + var width = Math.floor(bb.width()); + var height = Math.floor(bb.height()); + } + // temporarily remove mask to avoid recursion + var mask = element.attribute("mask").value; + element.attribute("mask").value = ""; + var cMask = document.createElement("canvas"); + cMask.width = x + width; + cMask.height = y + height; + var maskCtx = cMask.getContext("2d"); + this.renderChildren(maskCtx); + var c = document.createElement("canvas"); + c.width = x + width; + c.height = y + height; + var tempCtx = c.getContext("2d"); + element.render(tempCtx); + tempCtx.globalCompositeOperation = "destination-in"; + tempCtx.fillStyle = maskCtx.createPattern(cMask, "no-repeat"); + tempCtx.fillRect(0, 0, x + width, y + height); + ctx.fillStyle = tempCtx.createPattern(c, "no-repeat"); + ctx.fillRect(0, 0, x + width, y + height); + // reassign mask + element.attribute("mask").value = mask; + }; + this.render = function(ctx) {}; + }; + svg.Element.mask.prototype = new svg.Element.ElementBase(); + // clip element + svg.Element.clipPath = function(node) { + this.base = svg.Element.ElementBase; + this.base(node); + this.apply = function(ctx) { + for (var i = 0; i < this.children.length; i++) { + var child = this.children[i]; + if (typeof child.path != "undefined") { + var transform = null; + if (child.attribute("transform").hasValue()) { + transform = new svg.Transform(child.attribute("transform").value); + transform.apply(ctx); + } + child.path(ctx); + ctx.clip(); + if (transform) { + transform.unapply(ctx); + } + } + } + }; + this.render = function(ctx) {}; + }; + svg.Element.clipPath.prototype = new svg.Element.ElementBase(); + // filters + svg.Element.filter = function(node) { + this.base = svg.Element.ElementBase; + this.base(node); + this.apply = function(ctx, element) { + // render as temp svg + var bb = element.getBoundingBox(); + var x = Math.floor(bb.x1); + var y = Math.floor(bb.y1); + var width = Math.floor(bb.width()); + var height = Math.floor(bb.height()); + // temporarily remove filter to avoid recursion + var filter = element.style("filter").value; + element.style("filter").value = ""; + var px = 0, py = 0; + for (var i = 0; i < this.children.length; i++) { + var efd = this.children[i].extraFilterDistance || 0; + px = Math.max(px, efd); + py = Math.max(py, efd); + } + var c = document.createElement("canvas"); + c.width = width + 2 * px; + c.height = height + 2 * py; + var tempCtx = c.getContext("2d"); + tempCtx.translate(-x + px, -y + py); + element.render(tempCtx); + // apply filters + for (var i = 0; i < this.children.length; i++) { + this.children[i].apply(tempCtx, 0, 0, width + 2 * px, height + 2 * py); + } + // render on me + ctx.drawImage(c, 0, 0, width + 2 * px, height + 2 * py, x - px, y - py, width + 2 * px, height + 2 * py); + // reassign filter + element.style("filter", true).value = filter; + }; + this.render = function(ctx) {}; + }; + svg.Element.filter.prototype = new svg.Element.ElementBase(); + svg.Element.feMorphology = function(node) { + this.base = svg.Element.ElementBase; + this.base(node); + this.apply = function(ctx, x, y, width, height) {}; + }; + svg.Element.feMorphology.prototype = new svg.Element.ElementBase(); + svg.Element.feColorMatrix = function(node) { + this.base = svg.Element.ElementBase; + this.base(node); + function imGet(img, x, y, width, height, rgba) { + return img[y * width * 4 + x * 4 + rgba]; + } + function imSet(img, x, y, width, height, rgba, val) { + img[y * width * 4 + x * 4 + rgba] = val; + } + this.apply = function(ctx, x, y, width, height) { + // only supporting grayscale for now per Issue 195, need to extend to all matrix + // assuming x==0 && y==0 for now + var srcData = ctx.getImageData(0, 0, width, height); + for (var y = 0; y < height; y++) { + for (var x = 0; x < width; x++) { + var r = imGet(srcData.data, x, y, width, height, 0); + var g = imGet(srcData.data, x, y, width, height, 1); + var b = imGet(srcData.data, x, y, width, height, 2); + var gray = (r + g + b) / 3; + imSet(srcData.data, x, y, width, height, 0, gray); + imSet(srcData.data, x, y, width, height, 1, gray); + imSet(srcData.data, x, y, width, height, 2, gray); + } + } + ctx.clearRect(0, 0, width, height); + ctx.putImageData(srcData, 0, 0); + }; + }; + svg.Element.feColorMatrix.prototype = new svg.Element.ElementBase(); + svg.Element.feGaussianBlur = function(node) { + this.base = svg.Element.ElementBase; + this.base(node); + this.blurRadius = Math.floor(this.attribute("stdDeviation").numValue()); + this.extraFilterDistance = this.blurRadius; + this.apply = function(ctx, x, y, width, height) { + if (typeof stackBlurCanvasRGBA == "undefined") { + if (typeof console != "undefined") { + console.log("ERROR: StackBlur.js must be included for blur to work"); + } + return; + } + // StackBlur requires canvas be on document + ctx.canvas.id = svg.UniqueId(); + ctx.canvas.style.display = "none"; + document.body.appendChild(ctx.canvas); + stackBlurCanvasRGBA(ctx.canvas.id, x, y, width, height, this.blurRadius); + document.body.removeChild(ctx.canvas); + }; + }; + svg.Element.feGaussianBlur.prototype = new svg.Element.ElementBase(); + // title element, do nothing + svg.Element.title = function(node) {}; + svg.Element.title.prototype = new svg.Element.ElementBase(); + // desc element, do nothing + svg.Element.desc = function(node) {}; + svg.Element.desc.prototype = new svg.Element.ElementBase(); + svg.Element.MISSING = function(node) { + if (typeof console != "undefined") { + console.log("ERROR: Element '" + node.nodeName + "' not yet implemented."); + } + }; + svg.Element.MISSING.prototype = new svg.Element.ElementBase(); + // element factory + svg.CreateElement = function(node) { + var className = node.nodeName.replace(/^[^:]+:/, ""); + // remove namespace + className = className.replace(/\-/g, ""); + // remove dashes + var e = null; + if (typeof svg.Element[className] != "undefined") { + e = new svg.Element[className](node); + } else { + e = new svg.Element.MISSING(node); + } + e.type = node.nodeName; + return e; + }; + // load from url + svg.load = function(ctx, url) { + svg.loadXml(ctx, svg.ajax(url)); + }; + // load from xml + svg.loadXml = function(ctx, xml) { + svg.loadXmlDoc(ctx, svg.parseXml(xml)); + }; + svg.loadXmlDoc = function(ctx, dom) { + svg.init(ctx); + var mapXY = function(p) { + var e = ctx.canvas; + while (e) { + p.x -= e.offsetLeft; + p.y -= e.offsetTop; + e = e.offsetParent; + } + if (window.scrollX) p.x += window.scrollX; + if (window.scrollY) p.y += window.scrollY; + return p; + }; + // bind mouse + if (svg.opts["ignoreMouse"] != true) { + ctx.canvas.onclick = function(e) { + var p = mapXY(new svg.Point(e != null ? e.clientX : event.clientX, e != null ? e.clientY : event.clientY)); + svg.Mouse.onclick(p.x, p.y); + }; + ctx.canvas.onmousemove = function(e) { + var p = mapXY(new svg.Point(e != null ? e.clientX : event.clientX, e != null ? e.clientY : event.clientY)); + svg.Mouse.onmousemove(p.x, p.y); + }; + } + var e = svg.CreateElement(dom.documentElement); + e.root = true; + // render loop + var isFirstRender = true; + var draw = function() { + svg.ViewPort.Clear(); + if (ctx.canvas.parentNode) svg.ViewPort.SetCurrent(ctx.canvas.parentNode.clientWidth, ctx.canvas.parentNode.clientHeight); + if (svg.opts["ignoreDimensions"] != true) { + // set canvas size + if (e.style("width").hasValue()) { + ctx.canvas.width = e.style("width").toPixels("x"); + ctx.canvas.style.width = ctx.canvas.width + "px"; + } + if (e.style("height").hasValue()) { + ctx.canvas.height = e.style("height").toPixels("y"); + ctx.canvas.style.height = ctx.canvas.height + "px"; + } + } + var cWidth = ctx.canvas.clientWidth || ctx.canvas.width; + var cHeight = ctx.canvas.clientHeight || ctx.canvas.height; + if (svg.opts["ignoreDimensions"] == true && e.style("width").hasValue() && e.style("height").hasValue()) { + cWidth = e.style("width").toPixels("x"); + cHeight = e.style("height").toPixels("y"); + } + svg.ViewPort.SetCurrent(cWidth, cHeight); + if (svg.opts["offsetX"] != null) e.attribute("x", true).value = svg.opts["offsetX"]; + if (svg.opts["offsetY"] != null) e.attribute("y", true).value = svg.opts["offsetY"]; + if (svg.opts["scaleWidth"] != null && svg.opts["scaleHeight"] != null) { + var xRatio = 1, yRatio = 1, viewBox = svg.ToNumberArray(e.attribute("viewBox").value); + if (e.attribute("width").hasValue()) xRatio = e.attribute("width").toPixels("x") / svg.opts["scaleWidth"]; else if (!isNaN(viewBox[2])) xRatio = viewBox[2] / svg.opts["scaleWidth"]; + if (e.attribute("height").hasValue()) yRatio = e.attribute("height").toPixels("y") / svg.opts["scaleHeight"]; else if (!isNaN(viewBox[3])) yRatio = viewBox[3] / svg.opts["scaleHeight"]; + e.attribute("width", true).value = svg.opts["scaleWidth"]; + e.attribute("height", true).value = svg.opts["scaleHeight"]; + e.attribute("viewBox", true).value = "0 0 " + cWidth * xRatio + " " + cHeight * yRatio; + e.attribute("preserveAspectRatio", true).value = "none"; + } + // clear and render + if (svg.opts["ignoreClear"] != true) { + ctx.clearRect(0, 0, cWidth, cHeight); + } + e.render(ctx); + if (isFirstRender) { + isFirstRender = false; + if (typeof svg.opts["renderCallback"] == "function") svg.opts["renderCallback"](dom); + } + }; + var waitingForImages = true; + if (svg.ImagesLoaded()) { + waitingForImages = false; + draw(); + } + svg.intervalID = setInterval(function() { + var needUpdate = false; + if (waitingForImages && svg.ImagesLoaded()) { + waitingForImages = false; + needUpdate = true; + } + // need update from mouse events? + if (svg.opts["ignoreMouse"] != true) { + needUpdate = needUpdate | svg.Mouse.hasEvents(); + } + // need update from animations? + if (svg.opts["ignoreAnimation"] != true) { + for (var i = 0; i < svg.Animations.length; i++) { + needUpdate = needUpdate | svg.Animations[i].update(1e3 / svg.FRAMERATE); + } + } + // need update from redraw? + if (typeof svg.opts["forceRedraw"] == "function") { + if (svg.opts["forceRedraw"]() == true) needUpdate = true; + } + // render if needed + if (needUpdate) { + draw(); + svg.Mouse.runEvents(); + } + }, 1e3 / svg.FRAMERATE); + }; + svg.stop = function() { + if (svg.intervalID) { + clearInterval(svg.intervalID); + } + }; + svg.Mouse = new function() { + this.events = []; + this.hasEvents = function() { + return this.events.length != 0; + }; + this.onclick = function(x, y) { + this.events.push({ + type: "onclick", + x: x, + y: y, + run: function(e) { + if (e.onclick) e.onclick(); + } + }); + }; + this.onmousemove = function(x, y) { + this.events.push({ + type: "onmousemove", + x: x, + y: y, + run: function(e) { + if (e.onmousemove) e.onmousemove(); + } + }); + }; + this.eventElements = []; + this.checkPath = function(element, ctx) { + for (var i = 0; i < this.events.length; i++) { + var e = this.events[i]; + if (ctx.isPointInPath && ctx.isPointInPath(e.x, e.y)) this.eventElements[i] = element; + } + }; + this.checkBoundingBox = function(element, bb) { + for (var i = 0; i < this.events.length; i++) { + var e = this.events[i]; + if (bb.isPointInBox(e.x, e.y)) this.eventElements[i] = element; + } + }; + this.runEvents = function() { + svg.ctx.canvas.style.cursor = ""; + for (var i = 0; i < this.events.length; i++) { + var e = this.events[i]; + var element = this.eventElements[i]; + while (element) { + e.run(element); + element = element.parent; + } + } + // done running, clear + this.events = []; + this.eventElements = []; + }; + }(); + return svg; + } + })(); + if (typeof CanvasRenderingContext2D != "undefined") { + CanvasRenderingContext2D.prototype.drawSvg = function(s, dx, dy, dw, dh) { + canvg(this.canvas, s, { + ignoreMouse: true, + ignoreAnimation: true, + ignoreDimensions: true, + ignoreClear: true, + offsetX: dx, + offsetY: dy, + scaleWidth: dw, + scaleHeight: dh + }); + }; + } + return canvg; + } +}; + +/*! + * 输出转换器,提供输出支持 + */ +_p[1] = { + value: function(require) { + var kity = _p.r(34), canvg = _p.r(0); + return kity.createClass("Output", { + constructor: function(formula) { + this.formula = formula; + }, + toJPG: function(cb) { + toImage(this.formula, "image/jpeg", cb); + }, + toPNG: function(cb) { + toImage(this.formula, "image/png", cb); + } + }); + function toImage(formula, type, cb) { + var rectSpace = formula.container.getRenderBox(); + return getBase64DataURL(formula.node.ownerDocument, { + width: rectSpace.width, + height: rectSpace.height, + content: getSVGContent(formula.node) + }, type, cb); + } + function getBase64DataURL(doc, data, type, cb) { + var canvas = null, args = arguments, ctx = null; + if (true) { + drawToCanvas.apply(null, args); + } else { + canvas = getImageCanvas(doc, data.width, data.height, type); + ctx = canvas.getContext("2d"); + var image = new Image(); + image.onload = function() { + try { + ctx.drawImage(image, 0, 0); + cb(canvas.toDataURL(type)); + } catch (e) { + drawToCanvas.apply(null, args); + } + }; + image.src = getSVGDataURL(data.content); + } + } + function getSVGContent(svgNode) { + var tmp = svgNode.ownerDocument.createElement("div"), start = [ '' ]; + tmp.appendChild(svgNode.cloneNode(true)); + return tmp.innerHTML.replace(/]+?>/i, start.join("")).replace(/ /g, ""); + } + function getSVGDataURL(data) { + return "data:image/svg+xml;base64," + window.btoa(unescape(encodeURIComponent(data))); + } + function getImageCanvas(doc, width, height, type) { + var canvas = doc.createElement("canvas"), ctx = canvas.getContext("2d"); + canvas.width = width; + canvas.height = height; + if (type !== "image/png") { + ctx.fillStyle = "white"; + ctx.fillRect(0, 0, canvas.width, canvas.height); + } + return canvas; + } + function drawToCanvas(doc, data, type, cb) { + var canvas = getImageCanvas(doc, data.width, data.height, type); + canvas.style.cssText = "position: absolute; top: 0; left: 100000px; z-index: -1;"; + window.setTimeout(function() { + doc.body.appendChild(canvas); + canvg(canvas, data.content); + doc.body.removeChild(canvas); + cb(canvas.toDataURL(type)); + }, 0); + } + } +}; + +/*! + * 所有字符的列表 + */ +_p[2] = { + value: function() { + return [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "ȷ", "ı", "α", "β", "γ", "δ", "ε", "ζ", "η", "θ", "ι", "κ", "λ", "μ", "ν", "ξ", "ο", "π", "ρ", "ς", "σ", "τ", "υ", "φ", "χ", "ψ", "ω", "ϑ", "ϕ", "ϖ", "Ϟ", "Ϝ", "ϵ", "ϱ", "Ϲ", "ℜ", "ℵ", "ℑ", "℧", "ℶ", "ℷ", "ℸ", "ð", "ℏ", "⅁", "ℎ", "∂", "℘", "⅌", "Ⅎ", "∁", "ℓ", "Ⓢ", "(", ")", "Γ", "Δ", "Ε", "Ζ", "Η", "Θ", "Ι", "Κ", "Λ", "Μ", "Ν", "Ξ", "Ο", "Π", "Ρ", "Σ", "Τ", "Υ", "Φ", "Χ", "Ψ", "Ω", "Α", "Β", "#", "!", "$", "%", "&", "∠", "′", "‵", "★", "◆", "■", "▲", "▼", "⊤", "⊥", "♣", "♠", "♢", "♡", "∃", "∄", "♭", "♮", "♯", "∀", "∞", "∡", "∇", "¬", "∢", "√", "△", "▽", "∅", "ø", "◇", "◀", "▸", "[", "]", "{", "}", "〈", "〉", "ϰ", ",", ".", "/", ":", ";", "?", "\\", "⋮", "⋯", "⋰", "…", "@", """, "'", "|", "^", "`", "“", "_", "*", "+", "-", "∐", "⊼", "⊻", "◯", "⊡", "⊟", "⊞", "⊠", "•", "∩", "∪", "⋒", "⋓", "⋐", "⋑", "·", "▪", "◦", "⊛", "⊚", "⊖", "⊙", "⊝", "⊕", "⊗", "⊘", "±", "∓", "⋏", "⋎", "†", "‡", "⋄", "÷", "⋇", "∔", "⌭", "⋗", "⋖", "⋉", "⋊", "⋋", "⋌", "⊓", "⊔", "⊑", "⊒", "⊏", "⊐", "⋆", "×", "⊳", "⊲", "⊵", "⊴", "⊎", "∨", "∧", "≀", "<", "=", ">", "≈", "≇", "≍", "≒", "≓", "≊", "∽", "≁", "≂", "≃", "⋍", "≏", "≎", "≗", "≅", "⋞", "⋟", "≐", "≑", "≖", "⪖", "⪕", "≡", "≥", "≤", "≦", "≧", "⩾", "⩽", "≫", "≪", "≨", "≩", "⋘", "⋙", "⪇", "⪈", "⪉", "⪊", "⋧", "⋦", "⪆", "⪅", "⋛", "⋚", "⪋", "⪌", "≷", "≶", "≳", "≲", "⌮", "⌯", "≯", "≱", "≰", "≮", "⌱", "⌰", "⌲", "⌳", "≬", "⊀", "⊁", "⋠", "⋡", "≺", "≻", "≼", "≽", "≾", "≿", "⊂", "⊃", "⊈", "⊉", "⊆", "⊇", "⊊", "⊋", "⪷", "⪸", "⪯", "⪰", "⪹", "⪺", "⪵", "⪶", "⋨", "⋩", "∼", "≜", "↶", "↷", "↺", "↻", "↾", "↿", "⇂", "⇃", "⇄", "⇆", "⇈", "⇊", "⇋", "⇌", "⇍", "⇎", "⇏", "⇐", "⇑", "⇒", "⇓", "⇔", "⇕", "⇚", "⇛", "⇝", "↫", "↬", "↭", "↮", "←", "↑", "→", "↓", "↔", "↕", "↖", "↗", "↘", "↙", "↞", "↠", "↢", "↣", "↰", "↱", "⊢", "⊣", "⊨", "⊩", "⊪", "⊭", "⊯", "⊸", "⊺", "⋔", "⋪", "⋫", "⋬", "⋭", "⌈", "⌉", "⌊", "⌋", "⫋", "⫌", "⫅", "⫆", "∈", "∋", "∝", "∤", "∦", "∴", "∵", "∍", "⋈", "⌢", "⌣", "∣", "∥", "⏐", "⏑", "⏒", "⏓", "⫇", "⫈", "⊮", "⊬", "⫉", "⏔", "⏕", "⏖", "⏗", "⇇", "⇉", "↼", "↽", "⇀", "⇁", "↚", "↛", "⟵", "⟶", "⟷", "⟹", "⟸", "⟺", "≢", "≠", "∉" ]; + } +}; + +/*! + * 字符配置 + */ +_p[3] = { + value: function() { + return { + // 默认字体 + defaultFont: "KF AMS MAIN" + }; + } +}; + +/*! + * 工厂方法,创建兼容各浏览器的text实现 + */ +_p[4] = { + value: function(require) { + var kity = _p.r(34), divNode = document.createElement("div"), NAMESPACE = "http://www.w3.org/XML/1998/namespace"; + function createText(content) { + var text = new kity.Text(); + // Non-IE + if ("innerHTML" in text.node) { + text.node.setAttributeNS(NAMESPACE, "xml:space", "preserve"); + } else { + if (content.indexOf(" ") != -1) { + content = convertContent(content); + } + } + text.setContent(content); + return text; + } + /** + * 构建节点来转换内容 + */ + function convertContent(content) { + divNode.innerHTML = '' + content.replace(/\s/gi, " ") + ""; + return divNode.firstChild.firstChild.textContent; + } + return { + create: function(content) { + return createText(content); + } + }; + } +}; + +/** + * 文本 + */ +_p[5] = { + value: function(require) { + var kity = _p.r(34), FONT_CONF = _p.r(47).font, FontManager = _p.r(25), TextFactory = _p.r(4); + return kity.createClass("Text", { + base: _p.r(46), + constructor: function(content, fontFamily) { + this.callBase(); + this.fontFamily = fontFamily; + this.fontSize = 50; + this.content = content || ""; + // 移除多余的节点 + this.box.remove(); + this.translationContent = this.translation(this.content); + this.contentShape = new kity.Group(); + this.contentNode = this.createContent(); + this.contentShape.addShape(this.contentNode); + this.addShape(this.contentShape); + }, + createContent: function() { + var contentNode = TextFactory.create(this.translationContent); + contentNode.setAttr({ + "font-family": this.fontFamily, + "font-size": 50, + x: 0, + y: FONT_CONF.offset + }); + return contentNode; + }, + setFamily: function(fontFamily) { + this.fontFamily = fontFamily; + this.contentNode.setAttr("font-family", fontFamily); + }, + setFontSize: function(fontSize) { + this.fontSize = fontSize; + this.contentNode.setAttr("font-size", fontSize + "px"); + this.contentNode.setAttr("y", fontSize / 50 * FONT_CONF.offset); + }, + getBaseHeight: function() { + var chars = this.contentShape.getItems(), currentChar = null, index = 0, height = 0; + while (currentChar = chars[index]) { + height = Math.max(height, currentChar.getHeight()); + index++; + } + return height; + }, + translation: function(content) { + var fontFamily = this.fontFamily; + // 首先特殊处理掉两个相连的"`"符号 + return content.replace(/``/g, "“").replace(/\\([a-zA-Z,]+)\\/g, function(match, input) { + if (input === ",") { + return " "; + } + var data = FontManager.getCharacterValue(input, fontFamily); + if (!data) { + return ""; + } + return data; + }); + } + }); + } +}; + +/** + * 定义公式中各种对象的类型 + */ +_p[6] = { + value: function() { + return { + UNKNOWN: -1, + EXP: 0, + COMPOUND_EXP: 1, + OP: 2 + }; + } +}; + +/** + * 定义公式中上下标的类型 + */ +_p[7] = { + value: function() { + return { + SIDE: "side", + FOLLOW: "follow" + }; + } +}; + +/** + * 下标表达式 + */ +_p[8] = { + value: function(require) { + var kity = _p.r(34); + return kity.createClass("SubscriptExpression", { + base: _p.r(17), + constructor: function(operand, subscript) { + this.callBase(operand, null, subscript); + this.setFlag("Subscript"); + } + }); + } +}; + +/** + * 上标表达式 + */ +_p[9] = { + value: function(require) { + var kity = _p.r(34); + return kity.createClass("SuperscriptExpression", { + base: _p.r(17), + constructor: function(operand, superscript) { + this.callBase(operand, superscript, null); + this.setFlag("Superscript"); + } + }); + } +}; + +/** + * 二元操作表达式 + */ +_p[10] = { + value: function(require) { + var kity = _p.r(34); + return kity.createClass("BinaryExpression", { + base: _p.r(19), + constructor: function(firstOperand, lastOperand) { + this.callBase(); + this.setFirstOperand(firstOperand); + this.setLastOperand(lastOperand); + }, + setFirstOperand: function(operand) { + return this.setOperand(operand, 0); + }, + getFirstOperand: function() { + return this.getOperand(0); + }, + setLastOperand: function(operand) { + return this.setOperand(operand, 1); + }, + getLastOperand: function() { + return this.getOperand(1); + } + }); + } +}; + +/** + * 自动增长括号表达式 + */ +_p[11] = { + value: function(require) { + var kity = _p.r(34), BracketsOperator = _p.r(35); + return kity.createClass("BracketsExpression", { + base: _p.r(19), + /** + * 构造函数调用方式: + * new Constructor( 左括号, 右括号, 表达式 ) + * 或者 + * new Constructor( 括号, 表达式 ), 该构造函数转换成上面的构造函数,是: new Constructor( 括号, 括号, 表达式 ) + * @param left 左括号 + * @param right 右括号 + * @param exp 表达式 + */ + constructor: function(left, right, exp) { + this.callBase(); + this.setFlag("Brackets"); + // 参数整理 + if (arguments.length === 2) { + exp = right; + right = left; + } + this.leftSymbol = left; + this.rightSymbol = right; + this.setOperator(new BracketsOperator()); + this.setOperand(exp, 0); + }, + getLeftSymbol: function() { + return this.leftSymbol; + }, + getRightSymbol: function() { + return this.rightSymbol; + } + }); + } +}; + +/** + * 组合表达式 + * 可以组合多个表达式 + */ +_p[12] = { + value: function(require) { + var kity = _p.r(34), FONT_CONF = _p.r(47).font, CombinationOperator = _p.r(36); + return kity.createClass("CombinationExpression", { + base: _p.r(19), + constructor: function() { + this.callBase(); + this.setFlag("Combination"); + this.setOperator(new CombinationOperator()); + kity.Utils.each(arguments, function(operand, index) { + this.setOperand(operand, index); + }, this); + }, + getRenderBox: function(refer) { + var rectBox = this.callBase(refer); + if (this.getOperands().length === 0) { + rectBox.height = FONT_CONF.spaceHeight; + } + return rectBox; + }, + getBaseline: function(refer) { + var maxBaseline = 0, operands = this.getOperands(); + if (operands.length === 0) { + return this.callBase(refer); + } + kity.Utils.each(operands, function(operand) { + maxBaseline = Math.max(operand.getBaseline(refer), maxBaseline); + }); + return maxBaseline; + }, + getMeanline: function(refer) { + var minMeanline = 1e7, operands = this.getOperands(); + if (operands.length === 0) { + return this.callBase(refer); + } + kity.Utils.each(operands, function(operand) { + minMeanline = Math.min(operand.getMeanline(refer), minMeanline); + }); + return minMeanline; + } + }); + } +}; + +/** + * 分数表达式 + */ +_p[13] = { + value: function(require) { + var kity = _p.r(34), FractionOperator = _p.r(38); + return kity.createClass("FractionExpression", { + base: _p.r(10), + constructor: function(upOperand, downOperand) { + this.callBase(upOperand, downOperand); + this.setFlag("Fraction"); + this.setOperator(new FractionOperator()); + }, + /*------- 重写分数结构的baseline和mealine计算方式 */ + getBaseline: function(refer) { + var downOperand = this.getOperand(1), rectBox = downOperand.getRenderBox(refer); + return rectBox.y + downOperand.getBaselineProportion() * rectBox.height; + }, + getMeanline: function(refer) { + var upOperand = this.getOperand(0), rectBox = upOperand.getRenderBox(refer); + return upOperand.getMeanlineProportion() * rectBox.height; + } + }); + } +}; + +/** + * 函数表达式 + */ +_p[14] = { + value: function(require) { + var kity = _p.r(34), FUNC_CONF = _p.r(47).func, FunctionOperator = _p.r(39); + return kity.createClass("FunctionExpression", { + base: _p.r(19), + /** + * function表达式构造函数 + * @param funcName function名称 + * @param expr 函数表达式 + * @param sup 上标 + * @param sub 下标 + */ + constructor: function(funcName, expr, sup, sub) { + this.callBase(); + this.setFlag("Func"); + this.funcName = funcName; + this.setOperator(new FunctionOperator(funcName)); + this.setExpr(expr); + this.setSuperscript(sup); + this.setSubscript(sub); + }, + // 当前函数应用的script位置是否是在侧面 + isSideScript: function() { + return !FUNC_CONF["ud-script"][this.funcName]; + }, + setExpr: function(expr) { + return this.setOperand(expr, 0); + }, + setSuperscript: function(sub) { + return this.setOperand(sub, 1); + }, + setSubscript: function(sub) { + return this.setOperand(sub, 2); + } + }); + } +}; + +/** + * 积分表达式 + */ +_p[15] = { + value: function(require) { + var kity = _p.r(34), IntegrationOperator = _p.r(40), IntegrationExpression = kity.createClass("IntegrationExpression", { + base: _p.r(19), + /** + * 构造积分表达式 + * @param integrand 被积函数 + * @param supOperand 上限 + * @param subOperand 下限 + */ + constructor: function(integrand, superscript, subscript) { + this.callBase(); + this.setFlag("Integration"); + this.setOperator(new IntegrationOperator()); + this.setIntegrand(integrand); + this.setSuperscript(superscript); + this.setSubscript(subscript); + }, + setType: function(type) { + this.getOperator().setType(type); + return this; + }, + resetType: function() { + this.getOperator().resetType(); + return this; + }, + setIntegrand: function(integrand) { + this.setOperand(integrand, 0); + }, + setSuperscript: function(sup) { + this.setOperand(sup, 1); + }, + setSubscript: function(sub) { + this.setOperand(sub, 2); + } + }); + return IntegrationExpression; + } +}; + +/** + * 方根表达式 + */ +_p[16] = { + value: function(require) { + var kity = _p.r(34), RadicalOperator = _p.r(42); + return kity.createClass("RadicalExpression", { + base: _p.r(10), + /** + * 构造开方表达式 + * @param radicand 被开方数 + * @param exponent 指数 + */ + constructor: function(radicand, exponent) { + this.callBase(radicand, exponent); + this.setFlag("Radicand"); + this.setOperator(new RadicalOperator()); + }, + setRadicand: function(operand) { + return this.setFirstOperand(operand); + }, + getRadicand: function() { + return this.getFirstOperand(); + }, + setExponent: function(operand) { + return this.setLastOperand(operand); + }, + getExponent: function() { + return this.getLastOperand(); + } + }); + } +}; + +/** + * 上标表达式 + */ +_p[17] = { + value: function(require) { + var kity = _p.r(34), ScriptOperator = _p.r(43); + return kity.createClass("ScriptExpression", { + base: _p.r(19), + constructor: function(operand, superscript, subscript) { + this.callBase(); + this.setFlag("Script"); + this.setOperator(new ScriptOperator()); + this.setOpd(operand); + this.setSuperscript(superscript); + this.setSubscript(subscript); + }, + setOpd: function(operand) { + this.setOperand(operand, 0); + }, + setSuperscript: function(sup) { + this.setOperand(sup, 1); + }, + setSubscript: function(sub) { + this.setOperand(sub, 2); + } + }); + } +}; + +/** + * 求和表达式 + */ +_p[18] = { + value: function(require) { + var kity = _p.r(34), SummationOperator = _p.r(44); + return kity.createClass("SummationExpression", { + base: _p.r(19), + /** + * 构造求和表达式 + * @param expr 求和表达式 + * @param upOperand 上标 + * @param downOperand 下标 + */ + constructor: function(expr, superscript, subscript) { + this.callBase(); + this.setFlag("Summation"); + this.setOperator(new SummationOperator()); + this.setExpr(expr); + this.setSuperscript(superscript); + this.setSubscript(subscript); + }, + setExpr: function(expr) { + this.setOperand(expr, 0); + }, + setSuperscript: function(sup) { + this.setOperand(sup, 1); + }, + setSubscript: function(sub) { + this.setOperand(sub, 2); + } + }); + } +}; + +/** + * 复合表达式 + * @abstract + */ +_p[19] = { + value: function(require) { + var kity = _p.r(34), GTYPE = _p.r(6), Expression = _p.r(21); + return kity.createClass("CompoundExpression", { + base: _p.r(21), + constructor: function() { + this.callBase(); + this.type = GTYPE.COMPOUND_EXP; + this.operands = []; + this.operator = null; + this.operatorBox = new kity.Group(); + this.operatorBox.setAttr("data-type", "kf-editor-exp-op-box"); + this.operandBox = new kity.Group(); + this.operandBox.setAttr("data-type", "kf-editor-exp-operand-box"); + this.setChildren(0, this.operatorBox); + this.setChildren(1, this.operandBox); + }, + // 操作符存储在第1位置 + setOperator: function(operator) { + if (operator === undefined) { + return this; + } + if (this.operator) { + this.operator.remove(); + } + this.operatorBox.addShape(operator); + this.operator = operator; + this.operator.setParentExpression(this); + // 表达式关联到操作符 + operator.expression = this; + return this; + }, + getOperator: function() { + return this.operator; + }, + // 操作数存储位置是从1开始 + setOperand: function(operand, index, isWrap) { + // 不包装操作数 + if (isWrap === false) { + this.operands[index] = operand; + return this; + } + operand = Expression.wrap(operand); + if (this.operands[index]) { + this.operands[index].remove(); + } + this.operands[index] = operand; + this.operandBox.addShape(operand); + return this; + }, + getOperand: function(index) { + return this.operands[index]; + }, + getOperands: function() { + return this.operands; + }, + addedCall: function() { + this.operator.applyOperand.apply(this.operator, this.operands); + return this; + } + }); + } +}; + +/** + * 空表达式 + * 该表达式主要用途是用于站位 + */ +_p[20] = { + value: function(require) { + var kity = _p.r(34), FONT_CONF = _p.r(47).font, Expression = _p.r(21), EmptyExpression = kity.createClass("EmptyExpression", { + base: Expression, + constructor: function() { + this.callBase(); + this.setFlag("Empty"); + }, + getRenderBox: function() { + return { + width: 0, + height: FONT_CONF.spaceHeight, + x: 0, + y: 0 + }; + } + }); + EmptyExpression.isEmpty = function(target) { + return target instanceof EmptyExpression; + }; + // 注册打包函数 + Expression.registerWrap("empty", function(operand) { + if (operand === null || operand === undefined) { + return new EmptyExpression(); + } + }); + return EmptyExpression; + } +}; + +/** + * 基础表达式, 该类是表达式和操作数的高层抽象 + * @abstract + */ +_p[21] = { + value: function(require) { + var kity = _p.r(34), GTYPE = _p.r(6), FONT_CONF = _p.r(47).font, // 打包函数列表 + WRAP_FN = [], // 注册的打包函数的名称与其在注册器列表中的索引之间的对应关系 + WRAP_FN_INDEX = {}, Expression = kity.createClass("Expression", { + base: _p.r(46), + constructor: function() { + this.callBase(); + this.type = GTYPE.EXP; + // 表达式的上下偏移 + this._offset = { + top: 0, + bottom: 0 + }; + this.children = []; + this.box.fill("transparent").setAttr("data-type", "kf-editor-exp-box"); + this.box.setAttr("data-type", "kf-editor-exp-bg-box"); + this.expContent = new kity.Group(); + this.expContent.setAttr("data-type", "kf-editor-exp-content-box"); + this.addShape(this.expContent); + }, + getChildren: function() { + return this.children; + }, + getChild: function(index) { + return this.children[index] || null; + }, + getTopOffset: function() { + return this._offset.top; + }, + getBottomOffset: function() { + return this._offset.bottom; + }, + getOffset: function() { + return this._offset; + }, + setTopOffset: function(val) { + this._offset.top = val; + }, + setBottomOffset: function(val) { + this._offset.bottom = val; + }, + setOffset: function(top, bottom) { + this._offset.top = top; + this._offset.bottom = bottom; + }, + setFlag: function(flag) { + this.setAttr("data-flag", flag || "Expression"); + }, + setChildren: function(index, exp) { + // 首先清理掉之前的表达式 + if (this.children[index]) { + this.children[index].remove(); + } + this.children[index] = exp; + this.expContent.addShape(exp); + }, + getBaselineProportion: function() { + return FONT_CONF.baselinePosition; + }, + getMeanlineProportion: function() { + return FONT_CONF.meanlinePosition; + }, + getBaseline: function(refer) { + // 上偏移3px + return this.getRenderBox(refer).height * FONT_CONF.baselinePosition - 3; + }, + getMeanline: function(refer) { + // 上偏移1px + return this.getRenderBox(refer).height * FONT_CONF.meanlinePosition - 1; + }, + getAscenderline: function() { + return this.getFixRenderBox().height * FONT_CONF.ascenderPosition; + }, + getDescenderline: function() { + return this.getFixRenderBox().height * FONT_CONF.descenderPosition; + }, + translateElement: function(x, y) { + this.expContent.translate(x, y); + }, + expand: function(width, height) { + var renderBox = this.getFixRenderBox(); + this.setBoxSize(renderBox.width + width, renderBox.height + height); + }, + getBaseWidth: function() { + return this.getWidth(); + }, + getBaseHeight: function() { + return this.getHeight(); + }, + updateBoxSize: function() { + var renderBox = this.expContent.getFixRenderBox(); + this.setBoxSize(renderBox.width, renderBox.height); + }, + getBox: function() { + return this.box; + } + }); + // 表达式自动打包 + kity.Utils.extend(Expression, { + registerWrap: function(name, fn) { + WRAP_FN_INDEX[name] = WRAP_FN.length; + WRAP_FN.push(fn); + }, + revokeWrap: function(name) { + var fn = null; + if (name in WRAP_FN_INDEX) { + fn = WRAP_FN[WRAP_FN_INDEX[name]]; + WRAP_FN[WRAP_FN_INDEX[name]] = null; + delete WRAP_FN_INDEX[name]; + } + return fn; + }, + // 打包函数 + wrap: function(operand) { + var result; + kity.Utils.each(WRAP_FN, function(fn) { + if (!fn) { + return; + } + result = fn(operand); + if (result) { + return false; + } + }); + return result; + } + }); + return Expression; + } +}; + +/** + * Text表达式 + */ +_p[22] = { + value: function(require) { + var Text = _p.r(5), kity = _p.r(34), FONT_CONF = _p.r(3), Expression = _p.r(21), TextExpression = kity.createClass("TextExpression", { + base: _p.r(21), + constructor: function(content, fontFamily) { + this.callBase(); + this.fontFamily = fontFamily || FONT_CONF.defaultFont; + this.setFlag("Text"); + this.content = content + ""; + this.textContent = new Text(this.content, this.fontFamily); + this.setChildren(0, this.textContent); + this.setChildren(1, new kity.Rect(0, 0, 0, 0).fill("transparent")); + }, + setFamily: function(fontFamily) { + this.textContent.setFamily(fontFamily); + }, + setFontSize: function(fontSize) { + this.textContent.setFontSize(fontSize); + }, + addedCall: function() { + var box = this.textContent.getFixRenderBox(); + this.getChild(1).setSize(box.width, box.height); + this.updateBoxSize(); + return this; + } + }); + // 注册文本表达式的打包函数 + Expression.registerWrap("text", function(operand) { + var operandType = typeof operand; + if (operandType === "number" || operandType === "string") { + operand = new TextExpression(operand); + } + return operand; + }); + return TextExpression; + } +}; + +/*! + * 字体信息检测模板,用于检测浏览器的字体信息 + */ +_p[23] = { + value: function() { + return [ '', 'x', "" ]; + } +}; + +/*! + * 字体安装器 + */ +_p[24] = { + value: function(require) { + var kity = _p.r(34), FontManager = _p.r(25), $ = _p.r(33), FONT_CONF = _p.r(47).font, CHAR_LIST = _p.r(2), NODE_LIST = []; + return kity.createClass("FontInstaller", { + constructor: function(doc, resource) { + this.callBase(); + this.resource = resource || "../src/resource/"; + this.doc = doc; + }, + // 挂载字体 + mount: function(callback) { + var fontList = FontManager.getFontList(), count = 0, _self = this; + kity.Utils.each(fontList, function(fontInfo) { + count++; + fontInfo.meta.src = _self.resource + fontInfo.meta.src; + _self.createFontStyle(fontInfo); + preload(_self.doc, fontInfo, function() { + count--; + if (count === 0) { + complete(_self.doc, callback); + } + }); + }); + }, + createFontStyle: function(fontInfo) { + var stylesheet = this.doc.createElement("style"), tpl = '@font-face{\nfont-family: "${fontFamily}";\nsrc: url("${src}");\n}'; + stylesheet.setAttribute("type", "text/css"); + stylesheet.innerHTML = tpl.replace("${fontFamily}", fontInfo.meta.fontFamily).replace("${src}", fontInfo.meta.src); + this.doc.head.appendChild(stylesheet); + } + }); + function preload(doc, fontInfo, callback) { + $.get(fontInfo.meta.src, function(data, state) { + if (state === "success") { + applyFonts(doc, fontInfo); + } + callback(); + }); + } + function complete(doc, callback) { + window.setTimeout(function() { + initFontSystemInfo(doc); + removeTmpNode(); + callback(); + }, 100); + } + function applyFonts(doc, fontInfo) { + var node = document.createElement("div"), fontFamily = fontInfo.meta.fontFamily; + node.style.cssText = "position: absolute; top: -10000px; left: -100000px;"; + node.style.fontFamily = fontFamily; + node.innerHTML = CHAR_LIST.join(""); + doc.body.appendChild(node); + NODE_LIST.push(node); + } + /** + * 计算字体系统信息 + */ + function initFontSystemInfo(doc) { + var tmpNode = doc.createElement("div"); + tmpNode.style.cssText = "position: absolute; top: 0; left: -100000px;"; + tmpNode.innerHTML = _p.r(23).join(""); + doc.body.appendChild(tmpNode); + var rectBox = tmpNode.getElementsByTagName("text")[0].getBBox(); + // text实际占用空间 + FONT_CONF.spaceHeight = rectBox.height; + // text顶部空间 + FONT_CONF.topSpace = -rectBox.y - FONT_CONF.baseline; + FONT_CONF.bottomSpace = FONT_CONF.spaceHeight - FONT_CONF.topSpace - FONT_CONF.baseHeight; + // text偏移值 + FONT_CONF.offset = FONT_CONF.baseline + FONT_CONF.topSpace; + // baseline比例 + FONT_CONF.baselinePosition = (FONT_CONF.topSpace + FONT_CONF.baseline) / FONT_CONF.spaceHeight; + // meanline比例 + FONT_CONF.meanlinePosition = (FONT_CONF.topSpace + FONT_CONF.meanline) / FONT_CONF.spaceHeight; + // 上下延伸性比例 + FONT_CONF.ascenderPosition = FONT_CONF.topSpace / FONT_CONF.spaceHeight; + FONT_CONF.descenderPosition = (FONT_CONF.topSpace + FONT_CONF.baseHeight) / FONT_CONF.spaceHeight; + doc.body.removeChild(tmpNode); + } + function removeTmpNode() { + kity.Utils.each(NODE_LIST, function(node) { + node.parentNode.removeChild(node); + }); + NODE_LIST = []; + } + } +}; + +/*! + * 字体管理器 + */ +_p[25] = { + value: function(require) { + var FONT_LIST = {}, kity = _p.r(34), CONF = _p.r(47).font.list; + // init + (function() { + kity.Utils.each(CONF, function(fontData) { + FONT_LIST[fontData.meta.fontFamily] = fontData; + }); + })(); + return { + getFontList: function() { + return FONT_LIST; + }, + getCharacterValue: function(key, fontFamily) { + if (!FONT_LIST[fontFamily]) { + return null; + } + return FONT_LIST[fontFamily].map[key] || null; + } + }; + } +}; + +/*! + * 双线字体 + */ +_p[26] = { + value: function() { + return { + meta: { + fontFamily: "KF AMS BB", + src: "KF_AMS_BB.woff" + } + }; + } +}; + +/*! + * 手写体 + */ +_p[27] = { + value: function() { + return { + meta: { + fontFamily: "KF AMS CAL", + src: "KF_AMS_CAL.woff" + } + }; + } +}; + +/*! + * 花体 + */ +_p[28] = { + value: function() { + return { + meta: { + fontFamily: "KF AMS FRAK", + src: "KF_AMS_FRAK.woff" + } + }; + } +}; + +/*! + * 字体主文件 + */ +_p[29] = { + value: function() { + return { + meta: { + fontFamily: "KF AMS MAIN", + src: "KF_AMS_MAIN.woff" + }, + map: { + // char + Alpha: "Α", + Beta: "Β", + Gamma: "Γ", + Delta: "Δ", + Epsilon: "Ε", + Zeta: "Ζ", + Eta: "Η", + Theta: "Θ", + Iota: "Ι", + Kappa: "Κ", + Lambda: "Λ", + Mu: "Μ", + Nu: "Ν", + Xi: "Ξ", + Omicron: "Ο", + Pi: "Π", + Rho: "Ρ", + Sigma: "Σ", + Tau: "Τ", + Upsilon: "Υ", + Phi: "Φ", + Chi: "Χ", + Psi: "Ψ", + Omega: "Ω", + alpha: "α", + beta: "β", + gamma: "γ", + delta: "δ", + epsilon: "ε", + zeta: "ζ", + eta: "η", + theta: "θ", + iota: "ι", + kappa: "κ", + lambda: "λ", + mu: "μ", + nu: "ν", + xi: "ξ", + omicron: "ο", + pi: "π", + rho: "ρ", + sigma: "σ", + tau: "τ", + upsilon: "υ", + phi: "φ", + varkappa: "ϰ", + chi: "χ", + psi: "ψ", + omega: "ω", + digamma: "Ϝ", + varepsilon: "ϵ", + varrho: "ϱ", + varphi: "ϕ", + vartheta: "ϑ", + varpi: "ϖ", + varsigma: "Ϲ", + aleph: "ℵ", + beth: "ℶ", + daleth: "ℸ", + gimel: "ℷ", + eth: "ð", + hbar: "ℎ", + hslash: "ℏ", + mho: "℧", + partial: "∂", + wp: "℘", + Game: "⅁", + Bbbk: "⅌", + Finv: "Ⅎ", + Im: "ℑ", + Re: "ℜ", + complement: "∁", + ell: "ℓ", + circledS: "Ⓢ", + imath: "ı", + jmath: "ȷ", + // symbol + doublecap: "⋒", + Cap: "⋒", + doublecup: "⋓", + Cup: "⋓", + ast: "*", + divideontimes: "⋇", + rightthreetimes: "⋌", + leftthreetimes: "⋋", + cdot: "·", + odot: "⊙", + dotplus: "∔", + rtimes: "⋊", + ltimes: "⋉", + centerdot: "▪", + doublebarwedge: "⌭", + setminus: "⒁", + amalg: "∐", + circ: "◦", + bigcirc: "◯", + gtrdot: "⋗", + lessdot: "⋖", + smallsetminus: "⒅", + circledast: "⊛", + circledcirc: "⊚", + sqcap: "⊓", + sqcup: "⊔", + barwedge: "⊼", + circleddash: "⊝", + star: "⋆", + bigtriangledown: "▽", + bigtriangleup: "△", + cup: "∪", + cap: "∩", + times: "×", + mp: "∓", + pm: "±", + triangleleft: "⊲", + triangleright: "⊳", + boxdot: "⊡", + curlyvee: "⋏", + curlywedge: "⋎", + boxminus: "⊟", + boxtimes: "⊠", + ominus: "⊖", + oplus: "⊕", + oslash: "⊘", + otimes: "⊗", + uplus: "⊎", + boxplus: "⊞", + dagger: "†", + ddagger: "‡", + vee: "∨", + lor: "∨", + veebar: "⊻", + bullet: "•", + diamond: "⋄", + wedge: "∧", + land: "∧", + div: "÷", + wr: "≀", + geqq: "≧", + lll: "⋘", + llless: "⋘", + ggg: "⋙", + gggtr: "⋙", + preccurlyeq: "≼", + geqslant: "⩾", + lnapprox: "⪉", + preceq: "⪯", + gg: "≫", + lneq: "⪇", + precnapprox: "⪹", + approx: "≈", + lneqq: "≨", + precneqq: "⪵", + approxeq: "≊", + gnapprox: "⪊", + lnsim: "⋦", + precnsim: "⋨", + asymp: "≍", + gneq: "⪈", + lvertneqq: "⌮", + precsim: "≾", + backsim: "∽", + gneqq: "≩", + ncong: "≇", + risingdotseq: "≓", + backsimeq: "⋍", + gnsim: "⋧", + sim: "∼", + simeq: "≃", + bumpeq: "≏", + gtrapprox: "⪆", + ngeq: "≱", + Bumpeq: "≎", + gtreqless: "⋛", + ngeqq: "⌱", + succ: "≻", + circeq: "≗", + gtreqqless: "⪌", + ngeqslant: "⌳", + succapprox: "⪸", + cong: "≅", + gtrless: "≷", + ngtr: "≯", + succcurlyeq: "≽", + curlyeqprec: "⋞", + gtrsim: "≳", + nleq: "≰", + succeq: "⪰", + curlyeqsucc: "⋟", + gvertneqq: "⌯", + neq: "≠", + ne: "≠", + nequiv: "≢", + nleqq: "⌰", + succnapprox: "⪺", + doteq: "≐", + leq: "≤", + le: "≤", + nleqslant: "⌲", + succneqq: "⪶", + doteqdot: "≑", + Doteq: "≑", + leqq: "≦", + nless: "≮", + succnsim: "⋩", + leqslant: "⩽", + nprec: "⊀", + succsim: "≿", + eqsim: "≂", + lessapprox: "⪅", + npreceq: "⋠", + eqslantgtr: "⪖", + lesseqgtr: "⋚", + nsim: "≁", + eqslantless: "⪕", + lesseqqgtr: "⪋", + nsucc: "⊁", + triangleq: "≜", + eqcirc: "≖", + equiv: "≡", + lessgtr: "≶", + nsucceq: "⋡", + fallingdotseq: "≒", + lesssim: "≲", + prec: "≺", + geq: "≥", + ge: "≥", + ll: "≪", + precapprox: "⪷", + // arrows + uparrow: "↑", + downarrow: "↓", + updownarrow: "↕", + Uparrow: "⇑", + Downarrow: "⇓", + Updownarrow: "⇕", + circlearrowleft: "↺", + circlearrowright: "↻", + curvearrowleft: "↶", + curvearrowright: "↷", + downdownarrows: "⇊", + downharpoonleft: "⇃", + downharpoonright: "⇂", + leftarrow: "←", + gets: "←", + Leftarrow: "⇐", + leftarrowtail: "↢", + leftharpoondown: "↽", + leftharpoonup: "↼", + leftleftarrows: "⇇", + leftrightarrow: "↔", + Leftrightarrow: "⇔", + leftrightarrows: "⇄", + leftrightharpoons: "⇋", + leftrightsquigarrow: "↭", + Lleftarrow: "⇚", + looparrowleft: "↫", + looparrowright: "↬", + multimap: "⊸", + nLeftarrow: "⇍", + nRightarrow: "⇏", + nLeftrightarrow: "⇎", + nearrow: "↗", + nleftarrow: "↚", + nleftrightarrow: "↮", + nrightarrow: "↛", + nwarrow: "↖", + rightarrow: "→", + to: "→", + Rightarrow: "⇒", + rightarrowtail: "↣", + rightharpoondown: "⇁", + rightharpoonup: "⇀", + rightleftarrows: "⇆", + rightleftharpoons: "⇌", + rightrightarrows: "⇉", + rightsquigarrow: "⇝", + Rrightarrow: "⇛", + searrow: "↘", + swarrow: "↙", + twoheadleftarrow: "↞", + twoheadrightarrow: "↠", + upharpoonleft: "↿", + upharpoonright: "↾", + restriction: "↾", + upuparrows: "⇈", + Lsh: "↰", + Rsh: "↱", + longleftarrow: "⟵", + longrightarrow: "⟶", + Longleftarrow: "⟸", + Longrightarrow: "⟹", + implies: "⟹", + longleftrightarrow: "⟷", + Longleftrightarrow: "⟺", + // relation + backepsilon: "∍", + because: "∵", + therefore: "∴", + between: "≬", + blacktriangleleft: "◀", + blacktriangleright: "▸", + dashv: "⊣", + bowtie: "⋈", + frown: "⌢", + "in": "∈", + notin: "∉", + mid: "∣", + parallel: "∥", + models: "⊨", + ni: "∋", + owns: "∋", + nmid: "∤", + nparallel: "∦", + nshortmid: "⏒", + nshortparallel: "⏓", + nsubseteq: "⊈", + nsubseteqq: "⫇", + nsupseteq: "⊉", + nsupseteqq: "⫈", + ntriangleleft: "⋪", + ntrianglelefteq: "⋬", + ntriangleright: "⋫", + ntrianglerighteq: "⋭", + nvdash: "⊬", + nVdash: "⊮", + nvDash: "⊭", + nVDash: "⊯", + perp: "⊥", + pitchfork: "⋔", + propto: "∝", + shortmid: "⏐", + shortparallel: "⏑", + smile: "⌣", + sqsubset: "⊏", + sqsubseteq: "⊑", + sqsupset: "⊐", + sqsupseteq: "⊒", + subset: "⊂", + Subset: "⋐", + subseteq: "⊆", + subseteqq: "⫅", + subsetneq: "⊊", + subsetneqq: "⫋", + supset: "⊃", + Supset: "⋑", + supseteq: "⊇", + supseteqq: "⫆", + supsetneq: "⊋", + supsetneqq: "⫌", + trianglelefteq: "⊴", + trianglerighteq: "⊵", + varpropto: "⫉", + varsubsetneq: "⏔", + varsubsetneqq: "⏖", + varsupsetneq: "⏕", + varsupsetneqq: "⏗", + vdash: "⊢", + Vdash: "⊩", + vDash: "⊨", + Vvdash: "⊪", + vert: "|", + Vert: "ǁ", + "|": "ǁ", + "{": "{", + "}": "}", + backslash: "\\", + langle: "〈", + rangle: "〉", + lceil: "⌈", + rceil: "⌉", + lbrace: "{", + rbrace: "}", + lfloor: "⌊", + rfloor: "⌋", + cdots: "⋯", + ddots: "⋰", + vdots: "⋮", + dots: "…", + ldots: "…", + "#": "#", + bot: "⊥", + angle: "∠", + backprime: "‵", + bigstar: "★", + blacklozenge: "◆", + blacksquare: "■", + blacktriangle: "▲", + blacktriangledown: "▼", + clubsuit: "♣", + diagdown: "⒁", + diagup: "⒂", + diamondsuit: "♢", + emptyset: "ø", + exists: "∃", + flat: "♭", + forall: "∀", + heartsuit: "♡", + infty: "∞", + lozenge: "◇", + measuredangle: "∡", + nabla: "∇", + natural: "♮", + neg: "¬", + lnot: "¬", + nexists: "∄", + prime: "′", + sharp: "♯", + spadesuit: "♠", + sphericalangle: "∢", + surd: "√", + top: "⊤", + varnothing: "∅", + triangle: "△", + triangledown: "▽" + } + }; + } +}; + +/*! + * 罗马字体 + */ +_p[30] = { + value: function() { + return { + meta: { + fontFamily: "KF AMS ROMAN", + src: "KF_AMS_ROMAN.woff" + } + }; + } +}; + +/** + * 公式对象,表达式容器 + */ +_p[31] = { + value: function(require) { + var kity = _p.r(34), GTYPE = _p.r(6), FontManager = _p.r(25), FontInstaller = _p.r(24), DEFAULT_OPTIONS = { + fontsize: 50, + autoresize: true, + padding: [ 0 ] + }, Output = _p.r(1), EXPRESSION_INTERVAL = 10, ExpressionWrap = kity.createClass("ExpressionWrap", { + constructor: function(exp, config) { + this.wrap = new kity.Group(); + this.bg = new kity.Rect(0, 0, 0, 0).fill("transparent"); + this.exp = exp; + this.config = config; + this.wrap.setAttr("data-type", "kf-exp-wrap"); + this.bg.setAttr("data-type", "kf-exp-wrap-bg"); + this.wrap.addShape(this.bg); + this.wrap.addShape(this.exp); + }, + getWrapShape: function() { + return this.wrap; + }, + getExpression: function() { + return this.exp; + }, + getBackground: function() { + return this.bg; + }, + resize: function() { + var padding = this.config.padding, expBox = this.exp.getFixRenderBox(); + if (padding.length === 1) { + padding[1] = padding[0]; + } + this.bg.setSize(padding[1] * 2 + expBox.width, padding[0] * 2 + expBox.height); + this.exp.translate(padding[1], padding[0]); + } + }), Formula = kity.createClass("Formula", { + base: _p.r(32), + constructor: function(container, config) { + this.callBase(container); + this.expressions = []; + this.fontInstaller = new FontInstaller(this); + this.config = kity.Utils.extend({}, DEFAULT_OPTIONS, config); + this.initEnvironment(); + this.initInnerFont(); + }, + getContentContainer: function() { + return this.container; + }, + initEnvironment: function() { + this.zoom = this.config.fontsize / 50; + if ("width" in this.config) { + this.setWidth(this.config.width); + } + if ("height" in this.config) { + this.setHeight(this.config.height); + } + this.node.setAttribute("font-size", DEFAULT_OPTIONS.fontsize); + }, + initInnerFont: function() { + var fontList = FontManager.getFontList(), _self = this; + kity.Utils.each(fontList, function(fontInfo) { + createFontStyle(fontInfo); + }); + function createFontStyle(fontInfo) { + var stylesheet = _self.doc.createElement("style"), tpl = '@font-face{font-family: "${fontFamily}";font-style: normal;src: url("${src}") format("woff");}'; + stylesheet.setAttribute("type", "text/css"); + stylesheet.innerHTML = tpl.replace("${fontFamily}", fontInfo.meta.fontFamily).replace("${src}", fontInfo.meta.src); + _self.resourceNode.appendChild(stylesheet); + } + }, + insertExpression: function(expression, index) { + var expWrap = this.wrap(expression); + // clear zoom + this.container.clearTransform(); + this.expressions.splice(index, 0, expWrap.getWrapShape()); + this.addShape(expWrap.getWrapShape()); + notifyExpression.call(this, expWrap.getExpression()); + expWrap.resize(); + correctOffset.call(this); + this.resetZoom(); + this.config.autoresize && this.resize(); + }, + appendExpression: function(expression) { + this.insertExpression(expression, this.expressions.length); + }, + resize: function() { + var renderBox = this.container.getRenderBox("paper"); + this.node.setAttribute("width", renderBox.width); + this.node.setAttribute("height", renderBox.height); + }, + resetZoom: function() { + var zoomLevel = this.zoom / this.getBaseZoom(); + if (zoomLevel !== 0) { + this.container.scale(zoomLevel); + } + }, + wrap: function(exp) { + return new ExpressionWrap(exp, this.config); + }, + clear: function() { + this.callBase(); + this.expressions = []; + }, + clearExpressions: function() { + kity.Utils.each(this.expressions, function(exp) { + exp.remove(); + }); + this.expressions = []; + }, + toJPG: function(cb) { + new Output(this).toJPG(cb); + }, + toPNG: function(cb) { + new Output(this).toPNG(cb); + } + }); + kity.Utils.extend(Formula, { + registerFont: function(fontData) { + FontManager.registerFont(fontData); + } + }); + // 调整表达式之间的偏移 + function correctOffset() { + var exprOffset = 0; + kity.Utils.each(this.expressions, function(expr) { + var box = null; + if (!expr) { + return; + } + expr.setMatrix(new kity.Matrix(1, 0, 0, 1, 0, 0)); + box = expr.getFixRenderBox(); + expr.translate(0 - box.x, exprOffset); + exprOffset += box.height + EXPRESSION_INTERVAL; + }); + return this; + } + // 通知表达式已接入到paper + function notifyExpression(expression) { + var len = 0; + if (!expression) { + return; + } + if (expression.getType() === GTYPE.EXP) { + for (var i = 0, len = expression.getChildren().length; i < len; i++) { + notifyExpression(expression.getChild(i)); + } + } else if (expression.getType() === GTYPE.COMPOUND_EXP) { + // 操作数处理 + for (var i = 0, len = expression.getOperands().length; i < len; i++) { + notifyExpression(expression.getOperand(i)); + } + // 处理操作符 + notifyExpression(expression.getOperator()); + } + expression.addedCall && expression.addedCall(); + } + return Formula; + } +}; + +/** + * 公式专用paper + */ +_p[32] = { + value: function(require) { + var kity = _p.r(34); + return kity.createClass("FPaper", { + base: kity.Paper, + constructor: function(container) { + this.callBase(container); + this.doc = container.ownerDocument; + this.container = new kity.Group(); + this.container.setAttr("data-type", "kf-container"); + this.background = new kity.Group(); + this.background.setAttr("data-type", "kf-bg"); + this.baseZoom = 1; + this.zoom = 1; + this.base("addShape", this.background); + this.base("addShape", this.container); + }, + getZoom: function() { + return this.zoom; + }, + getBaseZoom: function() { + return this.baseZoom; + }, + addShape: function(shape, pos) { + return this.container.addShape(shape, pos); + }, + getBackground: function() { + return this.background; + }, + removeShape: function(pos) { + return this.container.removeShape(pos); + }, + clear: function() { + return this.container.clear(); + } + }); + } +}; + +/** + * jquery + */ +_p[33] = { + value: function() { + if (!window.jQuery) { + throw new Error("Missing jQuery"); + } + return window.jQuery; + } +}; + +/** + * kity库封包 + */ +_p[34] = { + value: function() { + if (!window.kity) { + throw new Error("Missing Kity Graphic Lib"); + } + return window.kity; + } +}; + +/** + * 小括号操作符:() + */ +_p[35] = { + value: function(require) { + var kity = _p.r(34), Text = _p.r(5); + return kity.createClass("BracketsOperator", { + base: _p.r(41), + constructor: function() { + this.callBase("Brackets"); + }, + applyOperand: function(exp) { + generate.call(this, exp); + } + }); + function generate(exp) { + var left = this.getParentExpression().getLeftSymbol(), right = this.getParentExpression().getRightSymbol(), fontSize = exp.getFixRenderBox().height, group = new kity.Group(), offset = 0, leftOp = new Text(left, "KF AMS MAIN").fill("black"), rightOp = new Text(right, "KF AMS MAIN").fill("black"); + leftOp.setFontSize(fontSize); + rightOp.setFontSize(fontSize); + this.addOperatorShape(group.addShape(leftOp).addShape(rightOp)); + offset += leftOp.getFixRenderBox().width; + exp.translate(offset, 0); + offset += exp.getFixRenderBox().width; + rightOp.translate(offset, 0); + } + } +}; + +/** + * 组合操作符 + * 操作多个表达式组合在一起 + */ +_p[36] = { + value: function(require) { + var kity = _p.r(34); + return kity.createClass("CombinationOperator", { + base: _p.r(41), + constructor: function() { + this.callBase("Combination"); + }, + applyOperand: function() { + // 偏移量 + var offsetX = 0, // 操作数 + operands = arguments, // 操作对象最大高度 + maxHeight = 0, // 垂直距离最大偏移 + maxOffsetTop = 0, maxOffsetBottom = 0, cached = [], // 偏移集合 + offsets = []; + kity.Utils.each(operands, function(operand) { + var box = operand.getFixRenderBox(), offsetY = operand.getOffset(); + box.height -= offsetY.top + offsetY.bottom; + cached.push(box); + offsets.push(offsetY); + maxOffsetTop = Math.max(offsetY.top, maxOffsetTop); + maxOffsetBottom = Math.max(offsetY.bottom, maxOffsetBottom); + maxHeight = Math.max(box.height, maxHeight); + }); + kity.Utils.each(operands, function(operand, index) { + var box = cached[index]; + operand.translate(offsetX - box.x, (maxHeight - (box.y + box.height)) / 2 + maxOffsetBottom - offsets[index].bottom); + offsetX += box.width; + }); + this.parentExpression.setOffset(maxOffsetTop, maxOffsetBottom); + this.parentExpression.updateBoxSize(); + } + }); + } +}; + +/*! + * 上下标控制器 + */ +_p[37] = { + value: function(require) { + var kity = _p.r(34), EmptyExpression = _p.r(20), defaultOptions = { + subOffset: 0, + supOffset: 0, + // 上下标的默认缩放值 + zoom: .66 + }; + return kity.createClass("ScriptController", { + constructor: function(opObj, target, sup, sub, options) { + this.observer = opObj.getParentExpression(); + this.target = target; + this.sup = sup; + this.sub = sub; + this.options = kity.Utils.extend({}, defaultOptions, options); + }, + // 上下标记 + applyUpDown: function() { + var target = this.target, sup = this.sup, sub = this.sub, options = this.options; + sup.scale(options.zoom); + sub.scale(options.zoom); + var targetBox = target.getFixRenderBox(); + if (EmptyExpression.isEmpty(sup) && EmptyExpression.isEmpty(sub)) { + return { + width: targetBox.width, + height: targetBox.height, + top: 0, + bottom: 0 + }; + } else { + // 上标 + if (!EmptyExpression.isEmpty(sup) && EmptyExpression.isEmpty(sub)) { + return this.applyUp(target, sup); + } else if (EmptyExpression.isEmpty(sup) && !EmptyExpression.isEmpty(sub)) { + return this.applyDown(target, sub); + } else { + return this.applyUpDownScript(target, sup, sub); + } + } + }, + /** + * 返回应用上下标后的空间占用情况,其中的key各自的意义是: + * top: 上空间偏移 + * bottom: 下空间偏移 + * width: 当前整个图形的实际占用空间的width + * height: 当前整个图形的实际占用空间的height + * @returns {*} + */ + applySide: function() { + var target = this.target, sup = this.sup, sub = this.sub; + if (EmptyExpression.isEmpty(sup) && EmptyExpression.isEmpty(sub)) { + var targetRectBox = target.getRenderBox(this.observer); + return { + width: targetRectBox.width, + height: targetRectBox.height, + top: 0, + bottom: 0 + }; + } else { + // 下标处理 + if (EmptyExpression.isEmpty(sup) && !EmptyExpression.isEmpty(sub)) { + return this.applySideSub(target, sub); + } else if (!EmptyExpression.isEmpty(sup) && EmptyExpression.isEmpty(sub)) { + return this.applySideSuper(target, sup); + } else { + return this.applySideScript(target, sup, sub); + } + } + }, + applySideSuper: function(target, sup) { + sup.scale(this.options.zoom); + var targetRectBox = target.getRenderBox(this.observer), supRectBox = sup.getRenderBox(this.observer), targetMeanline = target.getMeanline(this.observer), supBaseline = sup.getBaseline(this.observer), positionline = targetMeanline, diff = supBaseline - positionline, space = { + top: 0, + bottom: 0, + width: targetRectBox.width + supRectBox.width, + height: targetRectBox.height + }; + sup.translate(targetRectBox.width, 0); + if (this.options.supOffset) { + sup.translate(this.options.supOffset, 0); + } + if (diff > 0) { + target.translate(0, diff); + space.bottom = diff; + space.height += diff; + } else { + sup.translate(0, -diff); + } + return space; + }, + applySideSub: function(target, sub) { + sub.scale(this.options.zoom); + var targetRectBox = target.getRenderBox(this.observer), subRectBox = sub.getRenderBox(this.observer), subOffset = sub.getOffset(), targetBaseline = target.getBaseline(this.observer), // 下标定位线 + subPosition = (subRectBox.height + subOffset.top + subOffset.bottom) / 2, diff = targetRectBox.height - targetBaseline - subPosition, space = { + top: 0, + bottom: 0, + width: targetRectBox.width + subRectBox.width, + height: targetRectBox.height + }; + // 定位下标位置 + sub.translate(targetRectBox.width, subOffset.top + targetBaseline - subPosition); + if (this.options.subOffset) { + sub.translate(this.options.subOffset, 0); + } + if (diff < 0) { + space.top = -diff; + space.height -= diff; + } + return space; + }, + applySideScript: function(target, sup, sub) { + sup.scale(this.options.zoom); + sub.scale(this.options.zoom); + var targetRectBox = target.getRenderBox(this.observer), subRectBox = sub.getRenderBox(this.observer), supRectBox = sup.getRenderBox(this.observer), targetMeanline = target.getMeanline(this.observer), targetBaseline = target.getBaseline(this.observer), supBaseline = sup.getBaseline(this.observer), // 上下标都存在时, 下标的定位以上伸线为准 + subAscenderline = sub.getAscenderline(this.observer), supPosition = targetMeanline, subPosition = targetMeanline + (targetBaseline - targetMeanline) * 2 / 3, topDiff = supPosition - supBaseline, bottomDiff = targetRectBox.height - subPosition - (subRectBox.height - subAscenderline), space = { + top: 0, + bottom: 0, + width: targetRectBox.width + Math.max(subRectBox.width, supRectBox.width), + height: targetRectBox.height + }; + sup.translate(targetRectBox.width, topDiff); + sub.translate(targetRectBox.width, subPosition - subAscenderline); + if (this.options.supOffset) { + sup.translate(this.options.supOffset, 0); + } + if (this.options.subOffset) { + sub.translate(this.options.subOffset, 0); + } + // 定位纠正 + if (topDiff > 0) { + if (bottomDiff < 0) { + targetRectBox.height -= bottomDiff; + space.top = -bottomDiff; + } + } else { + target.translate(0, -topDiff); + sup.translate(0, -topDiff); + sub.translate(0, -topDiff); + space.height -= topDiff; + if (bottomDiff > 0) { + space.bottom = -topDiff; + } else { + space.height -= bottomDiff; + // 比较上下偏移, 获取正确的偏移值 + topDiff = -topDiff; + bottomDiff = -bottomDiff; + if (topDiff > bottomDiff) { + space.bottom = topDiff - bottomDiff; + } else { + space.top = bottomDiff - topDiff; + } + } + } + return space; + }, + applyUp: function(target, sup) { + var supBox = sup.getFixRenderBox(), targetBox = target.getFixRenderBox(), space = { + width: Math.max(targetBox.width, supBox.width), + height: supBox.height + targetBox.height, + top: 0, + bottom: supBox.height + }; + sup.translate((space.width - supBox.width) / 2, 0); + target.translate((space.width - targetBox.width) / 2, supBox.height); + return space; + }, + applyDown: function(target, sub) { + var subBox = sub.getFixRenderBox(), targetBox = target.getFixRenderBox(), space = { + width: Math.max(targetBox.width, subBox.width), + height: subBox.height + targetBox.height, + top: subBox.height, + bottom: 0 + }; + sub.translate((space.width - subBox.width) / 2, targetBox.height); + target.translate((space.width - targetBox.width) / 2, 0); + return space; + }, + applyUpDownScript: function(target, sup, sub) { + var supBox = sup.getFixRenderBox(), subBox = sub.getFixRenderBox(), targetBox = target.getFixRenderBox(), space = { + width: Math.max(targetBox.width, supBox.width, subBox.width), + height: supBox.height + subBox.height + targetBox.height, + top: 0, + bottom: 0 + }; + sup.translate((space.width - supBox.width) / 2, 0); + target.translate((space.width - targetBox.width) / 2, supBox.height); + sub.translate((space.width - subBox.width) / 2, supBox.height + targetBox.height); + return space; + } + }); + } +}; + +/** + * 分数操作符 + */ +_p[38] = { + value: function(require) { + var kity = _p.r(34), ZOOM = _p.r(47).zoom; + return kity.createClass("FractionOperator", { + base: _p.r(41), + constructor: function() { + this.callBase("Fraction"); + }, + applyOperand: function(upOperand, downOperand) { + upOperand.scale(ZOOM); + downOperand.scale(ZOOM); + var upWidth = Math.ceil(upOperand.getWidth()), downWidth = Math.ceil(downOperand.getWidth()), upHeight = Math.ceil(upOperand.getHeight()), downHeight = Math.ceil(downOperand.getHeight()), // 分数线overflow值 + overflow = 3, // 整体padding + padding = 1, maxWidth = Math.max(upWidth, downWidth), maxHeight = Math.max(upHeight, downHeight), operatorShape = generateOperator(maxWidth, overflow); + this.addOperatorShape(operatorShape); + upOperand.translate((maxWidth - upWidth) / 2 + overflow, 0); + operatorShape.translate(0, upHeight + 1); + // 下部不需要偏移 + downOperand.translate((maxWidth - downWidth) / 2 + overflow, upHeight + operatorShape.getHeight() + 1 * 2); + this.parentExpression.setOffset(maxHeight - upHeight, maxHeight - downHeight); + this.parentExpression.expand(padding * 2, padding * 2); + this.parentExpression.translateElement(padding, padding); + } + }); + function generateOperator(width, overflow) { + return new kity.Rect(width + overflow * 2, 1).fill("black"); + } + } +}; + +/** + * 函数操作符 + */ +_p[39] = { + value: function(require) { + var kity = _p.r(34), Text = _p.r(5), ScriptController = _p.r(37); + return kity.createClass("FunctionOperator", { + base: _p.r(41), + constructor: function(funcName) { + this.callBase("Function: " + funcName); + this.funcName = funcName; + }, + /* + * 积分操作符应用操作数 + * @param expr 函数表达式 + * @param sup 上限 + * @param sub 下限 + */ + applyOperand: function(expr, sup, sub) { + var opShape = generateOperator.call(this), expBox = expr.getFixRenderBox(), scriptHanlder = this.parentExpression.isSideScript() ? "applySide" : "applyUpDown", space = new ScriptController(this, opShape, sup, sub, { + zoom: .5 + })[scriptHanlder](), padding = 5, diff = (space.height + space.top + space.bottom - expBox.height) / 2; + // 应用偏移, 使图形在正确的位置上 + opShape.translate(0, space.top); + sup.translate(0, space.top); + sub.translate(0, space.top); + if (diff >= 0) { + expr.translate(space.width + padding, diff); + } else { + diff = -diff; + opShape.translate(0, diff); + sup.translate(0, diff); + sub.translate(0, diff); + expr.translate(space.width + padding, 0); + } + // 只扩展左边, 不扩展右边, 所以padding不 *2 + this.parentExpression.expand(padding, padding * 2); + this.parentExpression.translateElement(padding, padding); + } + }); + /* 返回操作符对象 */ + function generateOperator() { + var opShape = new Text(this.funcName, "KF AMS ROMAN"); + this.addOperatorShape(opShape); + // 为操作符图形创建baseline和meanline方法 + opShape.getBaseline = function() { + return opShape.getFixRenderBox().height; + }; + opShape.getMeanline = function() { + return 0; + }; + return opShape; + } + } +}; + +/** + * 积分操作符:∫ + */ +_p[40] = { + value: function(require) { + var kity = _p.r(34), ScriptController = _p.r(37); + return kity.createClass("IntegrationOperator", { + base: _p.r(41), + constructor: function(type) { + this.callBase("Integration"); + // 默认是普通单重积分 + this.opType = type || 1; + }, + setType: function(type) { + this.opType = type | 0; + }, + // 重置类型 + resetType: function() { + this.opType = 1; + }, + applyOperand: function(exp, sup, sub) { + var opShape = this.getOperatorShape(), padding = 3, expBox = exp.getFixRenderBox(), space = new ScriptController(this, opShape, sup, sub, { + supOffset: 3, + subOffset: -15 + }).applySide(), diff = (space.height + space.top - expBox.height) / 2; + opShape.translate(0, space.top); + sup.translate(0, space.top); + sub.translate(0, space.top); + if (diff >= 0) { + exp.translate(space.width + padding, diff); + } else { + diff = -diff; + opShape.translate(0, diff); + sup.translate(0, diff); + sub.translate(0, diff); + exp.translate(space.width + padding, 0); + } + this.parentExpression.expand(padding, padding * 2); + this.parentExpression.translateElement(padding, padding); + }, + getOperatorShape: function() { + var pathData = "M1.318,48.226c0,0,0.044,0.066,0.134,0.134c0.292,0.313,0.626,0.447,1.006,0.447c0.246,0.022,0.358-0.044,0.604-0.268 c0.782-0.782,1.497-2.838,2.324-6.727c0.514-2.369,0.938-4.693,1.586-8.448C8.559,24.068,9.9,17.878,11.978,9.52 c0.917-3.553,1.922-7.576,3.866-8.983C16.247,0.246,16.739,0,17.274,0c1.564,0,2.503,1.162,2.592,2.57 c0,0.827-0.424,1.386-1.273,1.386c-0.671,0-1.229-0.514-1.229-1.251c0-0.805,0.514-1.095,1.185-1.274 c0.022,0-0.291-0.29-0.425-0.379c-0.201-0.134-0.514-0.224-0.737-0.224c-0.067,0-0.112,0-0.157,0.022 c-0.469,0.134-0.983,0.939-1.453,2.234c-0.537,1.475-0.961,3.174-1.631,6.548c-0.424,2.101-0.693,3.464-1.229,6.727 c-1.608,9.185-2.949,15.487-5.006,23.756c-0.514,2.034-0.849,3.24-1.207,4.335c-0.559,1.698-1.162,2.95-1.811,3.799 c-0.514,0.715-1.385,1.408-2.436,1.408c-1.363,0-2.391-1.185-2.458-2.592c0-0.804,0.447-1.363,1.273-1.363 c0.671,0,1.229,0.514,1.229,1.251C2.503,47.757,1.989,48.047,1.318,48.226z", group = new kity.Group(), opGroup = new kity.Group(), opShape = new kity.Path(pathData).fill("black"), opBox = new kity.Rect(0, 0, 0, 0).fill("transparent"), tmpShape = null; + opGroup.addShape(opShape); + group.addShape(opBox); + group.addShape(opGroup); + this.addOperatorShape(group); + for (var i = 1; i < this.opType; i++) { + tmpShape = new kity.Use(opShape).translate(opShape.getWidth() / 2 * i, 0); + opGroup.addShape(tmpShape); + } + opGroup.scale(1.6); + tmpShape = null; + // 为操作符图形创建baseline和meanline方法 + group.getBaseline = function() { + return opGroup.getFixRenderBox().height; + }; + group.getMeanline = function() { + return 10; + }; + return group; + } + }); + } +}; + +/** + * 操作符抽象类 + * @abstract + */ +_p[41] = { + value: function(require) { + var kity = _p.r(34), GTYPE = _p.r(6); + return kity.createClass("Operator", { + base: _p.r(46), + constructor: function(operatorName) { + this.callBase(); + this.type = GTYPE.OP; + // 该操作符所属的表达式 + this.parentExpression = null; + // 操作符名称 + this.operatorName = operatorName; + // 操作符图形 + this.operatorShape = new kity.Group(); + this.addShape(this.operatorShape); + }, + applyOperand: function() { + throw new Error("applyOperand is abstract"); + }, + setParentExpression: function(exp) { + this.parentExpression = exp; + }, + getParentExpression: function() { + return this.parentExpression; + }, + clearParentExpression: function() { + this.parentExpression = null; + }, + // 提供给具体实现类附加其绘制的操作符图形的接口 + addOperatorShape: function(shpae) { + return this.operatorShape.addShape(shpae); + }, + getOperatorShape: function() { + return this.operatorShape; + } + }); + } +}; + +/** + * 开方操作符 + */ +_p[42] = { + value: function(require) { + var kity = _p.r(34), // 符号图形属性 + // 线条宽度 + SHAPE_DATA_WIDTH = 1, // 计算公式 + radians = 2 * Math.PI / 360, sin15 = Math.sin(15 * radians), cos15 = Math.cos(15 * radians), tan15 = Math.tan(15 * radians); + return kity.createClass("RadicalOperator", { + base: _p.r(41), + constructor: function() { + this.callBase("Radical"); + }, + applyOperand: function(radicand, exponent) { + generateOperator.call(this, radicand, exponent); + } + }); + // 根据给定的操作数生成操作符的pathData + // radicand 表示被开方数 + // exponent 表示指数 + function generateOperator(radicand, exponent) { + var decoration = generateDecoration(radicand), vLine = generateVLine(radicand), padding = 5, hLine = generateHLine(radicand); + this.addOperatorShape(decoration); + this.addOperatorShape(vLine); + this.addOperatorShape(hLine); + adjustmentPosition.call(this, mergeShape(decoration, vLine, hLine), this.operatorShape, radicand, exponent); + this.parentExpression.expand(0, padding * 2); + this.parentExpression.translateElement(0, padding); + } + // 生成根号中的左边装饰部分 + function generateDecoration(radicand) { + var shape = new kity.Path(), // 命名为a以便于精简表达式 + a = SHAPE_DATA_WIDTH, h = radicand.getHeight() / 3, drawer = shape.getDrawer(); + // 根号尾部左上角开始 + drawer.moveTo(0, cos15 * a * 6); + drawer.lineBy(sin15 * a, cos15 * a); + drawer.lineBy(cos15 * a * 3, -sin15 * a * 3); + drawer.lineBy(tan15 * h, h); + drawer.lineBy(sin15 * a * 3, -cos15 * a * 3); + drawer.lineBy(-sin15 * h, -h); + drawer.close(); + return shape.fill("black"); + } + // 根据操作数生成根号的竖直线部分 + function generateVLine(operand) { + var shape = new kity.Path(), // * 0.9 是为了在视觉上使斜线部分不至于太高 + h = operand.getHeight() * .9, drawer = shape.getDrawer(); + drawer.moveTo(tan15 * h, 0); + drawer.lineTo(0, h); + drawer.lineBy(sin15 * SHAPE_DATA_WIDTH * 3, cos15 * SHAPE_DATA_WIDTH * 3); + drawer.lineBy(tan15 * h + sin15 * SHAPE_DATA_WIDTH * 3, -(h + 3 * SHAPE_DATA_WIDTH * cos15)); + drawer.close(); + return shape.fill("black"); + } + // 根据操作数生成根号的水平线部分 + function generateHLine(operand) { + // 表达式宽度 + var w = operand.getWidth() + 2 * SHAPE_DATA_WIDTH; + return new kity.Rect(w, 2 * SHAPE_DATA_WIDTH).fill("black"); + } + // 合并根号的各个部分, 并返回根号的关键点位置数据 + function mergeShape(decoration, vLine, hLine) { + var decoBox = decoration.getFixRenderBox(), vLineBox = vLine.getFixRenderBox(); + vLine.translate(decoBox.width - sin15 * SHAPE_DATA_WIDTH * 3, 0); + decoration.translate(0, vLineBox.height - decoBox.height); + vLineBox = vLine.getFixRenderBox(); + hLine.translate(vLineBox.x + vLineBox.width - SHAPE_DATA_WIDTH / cos15, 0); + // 返回关键点数据 + return { + x: vLineBox.x + vLineBox.width - SHAPE_DATA_WIDTH / cos15, + y: 0 + }; + } + // 调整整个根号表达式的各个部分: 位置、操作符、被开方数、指数 + function adjustmentPosition(position, operator, radicand, exponent) { + var exponentBox = null, opOffset = { + x: 0, + y: 0 + }, opBox = operator.getFixRenderBox(); + exponent.scale(.66); + exponentBox = exponent.getFixRenderBox(); + if (exponentBox.width > 0 && exponentBox.height > 0) { + opOffset.y = exponentBox.height - opBox.height / 2; + // 指数不超出根号, 则移动指数 + if (opOffset.y < 0) { + exponent.translate(0, -opOffset.y); + opOffset.y = 0; + } + opOffset.x = exponentBox.width + opBox.height / 2 * tan15 - position.x; + } + operator.translate(opOffset.x, opOffset.y); + radicand.translate(opOffset.x + position.x + SHAPE_DATA_WIDTH, opOffset.y + 2 * SHAPE_DATA_WIDTH); + } + } +}; + +/** + * 上下标操作符 + */ +_p[43] = { + value: function(require) { + var kity = _p.r(34), ScriptController = _p.r(37); + return kity.createClass("ScriptOperator", { + base: _p.r(41), + constructor: function(operatorName) { + this.callBase(operatorName || "Script"); + }, + applyOperand: function(operand, sup, sub) { + var padding = 1, parent = this.parentExpression, space = new ScriptController(this, operand, sup, sub).applySide(); + this.getOperatorShape(); + space && parent.setOffset(space.top, space.bottom); + parent.expand(4, padding * 2); + parent.translateElement(2, padding); + } + }); + } +}; + +/** + * 求和操作符:∑ + */ +_p[44] = { + value: function(require) { + var kity = _p.r(34), ScriptController = _p.r(37); + return kity.createClass("SummationOperator", { + base: _p.r(41), + constructor: function() { + this.callBase("Summation"); + this.displayType = "equation"; + }, + applyOperand: function(expr, sup, sub) { + var opShape = this.getOperatorShape(), expBox = expr.getFixRenderBox(), padding = 0, space = new ScriptController(this, opShape, sup, sub).applyUpDown(), diff = (space.height - space.top - space.bottom - expBox.height) / 2; + if (diff >= 0) { + expr.translate(space.width + padding, diff + space.bottom); + } else { + diff = -diff; + opShape.translate(0, diff); + sup.translate(0, diff); + sub.translate(0, diff); + expr.translate(space.width + padding, space.bottom); + } + this.parentExpression.setOffset(space.top, space.bottom); + this.parentExpression.expand(padding, padding * 2); + this.parentExpression.translateElement(padding, padding); + }, + getOperatorShape: function() { + var pathData = "M0.672,33.603c-0.432,0-0.648,0-0.648-0.264c0-0.024,0-0.144,0.24-0.432l12.433-14.569L0,0.96c0-0.264,0-0.72,0.024-0.792 C0.096,0.024,0.12,0,0.672,0h28.371l2.904,6.745h-0.6C30.531,4.8,28.898,3.72,28.298,3.336c-1.896-1.2-3.984-1.608-5.28-1.8 c-0.216-0.048-2.4-0.384-5.617-0.384H4.248l11.185,15.289c0.168,0.24,0.168,0.312,0.168,0.36c0,0.12-0.048,0.192-0.216,0.384 L3.168,31.515h14.474c4.608,0,6.96-0.624,7.464-0.744c2.76-0.72,5.305-2.352,6.241-4.848h0.6l-2.904,7.681H0.672z", operatorShape = new kity.Path(pathData).fill("black"), opBgShape = new kity.Rect(0, 0, 0, 0).fill("transparent"), group = new kity.Group(), opRenderBox = null; + group.addShape(opBgShape); + group.addShape(operatorShape); + operatorShape.scale(1.6); + this.addOperatorShape(group); + opRenderBox = operatorShape.getFixRenderBox(); + if (this.displayType === "inline") { + operatorShape.translate(5, 15); + opBgShape.setSize(opRenderBox.width + 10, opRenderBox.height + 25); + } else { + operatorShape.translate(2, 5); + opBgShape.setSize(opRenderBox.width + 4, opRenderBox.height + 8); + } + return group; + } + }); + } +}; + +/*! + * 资源管理器 + * 负责管理资源的加载,并在资源ready之后提供Formula构造器 + */ +_p[45] = { + value: function(require) { + var kity = _p.r(34), cbList = [], RES_CONF = _p.r(47).resource, FontInstall = _p.r(24), Formula = _p.r(31), // 资源管理器就绪状态 + __readyState = false, // 资源管理器是否已启动 + inited = false; + return { + // 初始化 + ready: function(cb, options) { + if (!inited) { + inited = true; + init(options); + } + if (__readyState) { + window.setTimeout(function() { + cb(Formula); + }, 0); + } else { + cbList.push(cb); + } + } + }; + /** + * 资源初始化 + */ + function init(options) { + options = kity.Utils.extend({}, RES_CONF, options); + if (!/^(https?:)?\/\//.test(options.path)) { + options.path = getFullPath(options.path); + } + new FontInstall(document, options.path).mount(complete); + } + function complete() { + kity.Utils.each(cbList, function(cb) { + cb(Formula); + }); + } + function getFullPath(path) { + var pathname = location.pathname.split("/"), pathPart; + pathname.length -= 1; + pathname = pathname.join("/") + "/"; + pathPart = [ location.protocol, "//", location.host, pathname, path.replace(/^\//, "") ]; + return pathPart.join(""); + } + } +}; + +/*! + * 所有符号的基类 + * @abstract + */ +_p[46] = { + value: function(require) { + var kity = _p.r(34), GTYPE = _p.r(6); + return kity.createClass("SignGroup", { + base: kity.Group, + constructor: function() { + this.callBase(); + this.box = new kity.Rect(0, 0, 0, 0); + this.type = GTYPE.UNKNOWN; + this.addShape(this.box); + this.zoom = 1; + }, + setZoom: function(zoom) { + this.zoom = zoom; + }, + getZoom: function() { + return this.zoom; + }, + setBoxSize: function(w, h) { + return this.box.setSize(w, h); + }, + setBoxWidth: function(w) { + return this.box.setWidth(w); + }, + setBoxHeight: function(h) { + return this.box.setHeight(h); + }, + getType: function() { + return this.type; + }, + getBaseHeight: function() { + return this.getHeight(); + }, + getBaseWidth: function() { + return this.getWidth(); + }, + addedCall: function() {} + }); + } +}; + +/*! + * 系统项目配置文件. + */ +_p[47] = { + value: function(require) { + return { + zoom: .66, + font: { + meanline: Math.round(380 / 1e3 * 50), + baseline: Math.round(800 / 1e3 * 50), + baseHeight: 50, + // 系统字体列表 + list: [ _p.r(29), _p.r(27), _p.r(28), _p.r(26), _p.r(30) ] + }, + /*------------------------- 资源配置*/ + resource: { + path: "src/resource/" + }, + // 函数相关配置 + func: { + // 上下标在函数名上下两侧的函数列表 + "ud-script": { + lim: true + } + } + }; + } +}; + +/*! + * 启动代码 + */ +_p[48] = { + value: function(require) { + window.kf = { + // base + ResourceManager: _p.r(45), + Operator: _p.r(41), + // expression + Expression: _p.r(21), + CompoundExpression: _p.r(19), + TextExpression: _p.r(22), + EmptyExpression: _p.r(20), + CombinationExpression: _p.r(12), + FunctionExpression: _p.r(14), + FractionExpression: _p.r(13), + IntegrationExpression: _p.r(15), + RadicalExpression: _p.r(16), + ScriptExpression: _p.r(17), + SuperscriptExpression: _p.r(9), + SubscriptExpression: _p.r(8), + SummationExpression: _p.r(18), + // Brackets expressoin + BracketsExpression: _p.r(11) + }; + } +}; + +var moduleMapping = { + "kf.start": 48 +}; + +function use(name) { + _p.r([ moduleMapping[name] ]); +} +/** + * 模块暴露 + */ + +( function ( global ) { + + var oldGetRenderBox = kity.Shape.getRenderBox; + + kity.extendClass(kity.Shape, { + getFixRenderBox: function () { + return this.getRenderBox( this.container.container ); + }, + + getTranslate: function () { + return this.transform.translate; + } + }); + + // build环境中才含有use + try { + use( 'kf.start' ); + } catch ( e ) { + } + +} )( this ); +})(); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/js/kityformula-editor.all.min.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/js/kityformula-editor.all.min.js new file mode 100644 index 00000000..332ca588 --- /dev/null +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/js/kityformula-editor.all.min.js @@ -0,0 +1,12 @@ +/*! + * ==================================================== + * Kity Formula Editor - v1.0.0 - 2014-09-03 + * https://github.com/kitygraph/formula + * GitHub: https://github.com/kitygraph/formula.git + * Copyright (c) 2014 Baidu Kity Group; Licensed MIT + * ==================================================== + */ +!function(){function a(a){b.r([c[a]])}var b={r:function(a){if(b[a].inited)return b[a].value;if("function"!=typeof b[a].value)return b[a].inited=!0,b[a].value;var c={exports:{}},d=b[a].value(null,c.exports,c);if(b[a].inited=!0,b[a].value=d,void 0!==d)return d;for(var e in c.exports)if(c.exports.hasOwnProperty(e))return b[a].inited=!0,b[a].value=c.exports,c.exports}};b[0]={value:function(){function a(d,e,f,g){return g=0|g,g>b?f:(g++,c.each(f,function(b,f){d?!b||"object"!=typeof b&&"function"!=typeof b?e[f]=b:(e[f]=e[f]||(c.isArray(b)?[]:{}),e[f]=a(d,e[f],b,g)):e[f]=b}),e)}var b=10,c={extend:function(b,d){var e=!1;if("boolean"==typeof b?(e=b,b=d,d=[].splice.call(arguments,2)):d=[].splice.call(arguments,1),!b)throw new Error("Utils: extend, target can not be empty");return c.each(d,function(c){(c&&"object"==typeof c||"function"==typeof c)&&a(e,b,c)}),b},contains:function(a,b){return a.contains?a.contains(b):a.compareDocumentPosition?!!(16&a.compareDocumentPosition(b)):void 0},getRect:function(a){return a.getBoundingClientRect()},isArray:function(a){return a&&"[object Array]"==={}.toString.call(a)},isString:function(a){return"string"==typeof a},proxy:function(a,b){return function(){return a.apply(b,arguments)}},each:function(a,b){if(a)if("length"in a&&"number"==typeof a.length)for(var c=0,d=a.length;d>c&&b.call(null,a[c],c,a)!==!1;c++);else for(var e in a)if(a.hasOwnProperty(e)&&b.call(null,a[e],e,a)===!1)break}};return c}},b[1]={value:function(){var a=b.r(20);return a.createClass("Component",{constructor:function(){}})}},b[2]={value:function(){function a(){return++d}var c={},d=0,e=!0,f=b.r(3),g=b.r(0),h=function(a){var b=a.type,d=a.target,f=this.__kfe_eid,h=/^(?:before|after)/.test(b),j=c[f][b];return h||(i.trigger(d,"before"+b),e!==!1)?(g.each(j,function(b){return b&&b.call(d,a)===!1?e=!1:void 0}),void(h||i.trigger(d,"after"+b))):(e=!0,!1)},i={addEvent:function(b,d,e){var f=!0,g=null;b.__kfe_eid||(f=!1,b.__kfe_eid=a(),c[b.__kfe_eid]={}),g=c[b.__kfe_eid],g[d]||(f=!1,g[d]=[]),g[d].push(e),f||b.addEventListener(d,h,!1)},trigger:function(a,b,c){c=c||f.createEvent(b,c),a.dispatchEvent(c)}};return i}},b[3]={value:function(){return{createEvent:function(a){var b=document.createEvent("Event");return b.initEvent(a,!0,!0),b}}}},b[4]={value:function(){var a={},c=b.r(0);return c.extend(a,c,b.r(2)),a}},b[5]={value:function(){var a=b.r(20),c=b.r(8),d=a.createClass("ControllerComponent",{constructor:function(a){this.kfEditor=a,this.components={},this.initComponents()},initComponents:function(){this.components.listener=new c(this,this.kfEditor)}});return d}},b[6]={value:function(){var a={32:"\\,","s+219":"\\{","s+221":"\\}",220:"\\backslash","s+51":"\\#","s+52":"\\$","s+53":"\\%","s+54":"\\^","s+55":"\\&","s+189":"\\_","s+192":"\\~"};return{getReplaceString:function(b){return a[b]||null}}}},b[7]={value:function(){var a=b.r(20),c=b.r(4),d=b.r(6),e={LEFT:37,RIGHT:39,DELETE:8,INPUT:229};return a.createClass("InputComponent",{constructor:function(a,b){this.parentComponent=a,this.kfEditor=b,this.inputBox=this.createInputBox(),this.initServices(),this.initCommands(),this.initEvent()},initServices:function(){this.kfEditor.registerService("control.update.input",this,{updateInput:this.updateInput}),this.kfEditor.registerService("control.insert.string",this,{insertStr:this.insertStr})},initCommands:function(){this.kfEditor.registerCommand("focus",this,this.focus)},createInputBox:function(){var a=this.kfEditor.getContainer(),b=this.kfEditor.getDocument().createElement("input");return b.className="kf-editor-input-box",b.type="text",b.isTrusted=!1,a.appendChild(b),b},focus:function(){var a=null;this.inputBox.focus(),this.kfEditor.requestService("syntax.has.cursor.info")||(a=this.kfEditor.requestService("syntax.get.root.group.info"),this.kfEditor.requestService("syntax.update.record.cursor",{groupId:a.id,startOffset:0,endOffset:a.content.length}),this.kfEditor.requestService("control.update.input")),this.kfEditor.requestService("control.reselect")},setUntrusted:function(){this.inputBox.isTrusted=!1},setTrusted:function(){this.inputBox.isTrusted=!0},updateInput:function(){var a=this.kfEditor.requestService("syntax.serialization");this.setUntrusted(),this.inputBox.value=a.str,this.inputBox.selectionStart=a.startOffset,this.inputBox.selectionEnd=a.endOffset,this.inputBox.focus(),this.setTrusted()},insertStr:function(a){var b=this.kfEditor.requestService("syntax.serialization"),c=b.str;c=c.substring(0,b.startOffset)+" "+a+" "+c.substring(b.endOffset),this.restruct(c),this.updateInput(),this.kfEditor.requestService("ui.update.canvas.view")},initEvent:function(){var a=this;c.addEvent(this.inputBox,"keydown",function(b){var c=!1;if(b.ctrlKey)return void a.processUserCtrl(b);switch(b.keyCode){case e.INPUT:return;case e.LEFT:b.preventDefault(),a.leftMove(),c=!0;break;case e.RIGHT:b.preventDefault(),a.rightMove(),c=!0;break;case e.DELETE:b.preventDefault(),a.delete(),c=!0}c&&a.kfEditor.requestService("ui.update.canvas.view"),a.pretreatmentInput(b)||b.preventDefault()}),c.addEvent(this.inputBox,"input",function(){a.processingInput()}),c.addEvent(this.inputBox,"blur",function(){a.kfEditor.requestService("ui.toolbar.disable"),a.kfEditor.requestService("ui.toolbar.close"),a.kfEditor.requestService("control.cursor.hide"),a.kfEditor.requestService("render.clear.select")}),c.addEvent(this.inputBox,"focus",function(){a.kfEditor.requestService("ui.toolbar.enable"),this.isTrusted&&a.kfEditor.requestService("control.reselect")}),c.addEvent(this.inputBox,"paste",function(a){a.preventDefault()})},hasRootplaceholder:function(){return this.kfEditor.requestService("syntax.has.root.placeholder")},leftMove:function(){this.hasRootplaceholder()||(this.kfEditor.requestService("syntax.cursor.move.left"),this.update())},rightMove:function(){this.hasRootplaceholder()||(this.kfEditor.requestService("syntax.cursor.move.right"),this.update())},"delete":function(){var a=null;this.hasRootplaceholder()||(a=this.kfEditor.requestService("syntax.delete.group"),a?(this.updateInput(),this.processingInput()):(this.updateInput(),this.kfEditor.requestService("control.reselect")))},processUserCtrl:function(a){switch(a.preventDefault(),a.keyCode){case 65:this.kfEditor.requestService("control.select.all");break;case 83:this.kfEditor.requestService("print.image")}},pretreatmentInput:function(a){var b=this.getKeyCode(a),c=d.getReplaceString(b);return null===c?!0:(this.insertStr(c),!1)},getKeyCode:function(a){return(a.shiftKey?"s+":"")+a.keyCode},processingInput:function(){this.restruct(this.inputBox.value),this.kfEditor.requestService("ui.update.canvas.view")},restruct:function(a){this.kfEditor.requestService("render.draw",a),this.kfEditor.requestService("control.reselect")},update:function(){this.updateInput(),this.kfEditor.requestService("control.reselect")}})}},b[8]={value:function(){var a=b.r(20),c=b.r(9),d=b.r(7),e=b.r(10);return a.createClass("MoveComponent",{constructor:function(a,b){this.parentComponent=a,this.kfEditor=b,this.components={},this.initComponents()},initComponents:function(){this.components.location=new c(this,this.kfEditor),this.components.selection=new e(this,this.kfEditor),this.components.input=new d(this,this.kfEditor)}})}},b[9]={value:function(){function a(a){return a.getBoundingClientRect()}var c=b.r(20);return c.createClass("LocationComponent",{constructor:function(a,b){this.parentComponent=a,this.kfEditor=b,this.paper=this.getPaper(),this.cursorShape=this.createCursor(),this.initServices(),this.initEvent()},getPaper:function(){return this.kfEditor.requestService("render.get.paper")},initServices:function(){this.kfEditor.registerService("control.cursor.relocation",this,{relocationCursor:this.updateCursor}),this.kfEditor.registerService("control.cursor.hide",this,{hideCursor:this.hideCursor}),this.kfEditor.registerService("control.reselect",this,{reselect:this.reselect}),this.kfEditor.registerService("control.get.cursor.location",this,{getCursorLocation:this.getCursorLocation})},createCursor:function(){var a=new c.Rect(1,0,0,0).fill("black");return a.setAttr("style","display: none"),this.paper.addShape(a),a},initEvent:function(){var a=this.kfEditor.request("ui.canvas.container.event"),b=this;a.on("mousedown",function(a){a.preventDefault(),b.updateCursorInfo(a),b.kfEditor.requestService("control.update.input"),b.reselect()})},updateCursorInfo:function(a){var b=null,c=null,d=-1;return this.kfEditor.requestService("syntax.has.root.placeholder")?(this.kfEditor.requestService("syntax.update.record.cursor",{groupId:this.kfEditor.requestService("syntax.get.root.group.info").id,startOffset:0,endOffset:1}),!1):(b=this.kfEditor.requestService("position.get.wrap",a.target),b&&this.kfEditor.requestService("syntax.is.placeholder.node",b.id)?(c=this.kfEditor.requestService("position.get.group.info",b),void this.kfEditor.requestService("syntax.update.record.cursor",c.group.id,c.index,c.index+1)):(c=this.kfEditor.requestService("position.get.group",a.target),null===c&&(c=this.kfEditor.requestService("syntax.get.root.group.info")),d=this.getIndex(a.clientX,c),void this.kfEditor.requestService("syntax.update.record.cursor",c.id,d)))},hideCursor:function(){this.cursorShape.setAttr("style","display: none")},reselect:function(){var a=this.kfEditor.requestService("syntax.get.record.cursor"),b=null;return this.hideCursor(),this.kfEditor.requestService("syntax.is.select.placeholder")?(b=this.kfEditor.requestService("syntax.get.group.content",a.groupId),void this.kfEditor.requestService("render.select.group",b.content[a.startOffset].id)):void(a.startOffset===a.endOffset?(this.updateCursor(),this.kfEditor.requestService("render.tint.current.cursor")):this.kfEditor.requestService("render.select.current.cursor"))},updateCursor:function(){var b=this.kfEditor.requestService("syntax.get.record.cursor");if(b.startOffset!==b.endOffset)return void this.hideCursor();var c=this.kfEditor.requestService("syntax.get.group.content",b.groupId),d=0===b.endOffset,e=d?0:b.endOffset-1,f=c.content[e],g=a(this.paper.container.node),h=0,i=a(f),j=this.cursorShape.getTransform(this.cursorShape),k=this.kfEditor.requestService("render.get.canvas.zoom"),l=this.paper.getZoom();this.cursorShape.setHeight(i.height/k/l),h=d?i.left-2:i.left+i.width-2,h-=g.left,j.m.e=Math.floor(h/k/l)+.5,j.m.f=(i.top-g.top)/k/l,this.cursorShape.setMatrix(j),this.cursorShape.setAttr("style","display: block")},getCursorLocation:function(){var a=this.cursorShape.getRenderBox("paper");return{x:a.x,y:a.y}},getIndex:function(b,c){for(var d=-1,e=c.content,f=null,g=e.length-1,h=null;g>=0;g--)if(d=g,h=e[g],f=a(h),f.leftthis.startPoint.x,e={},f=null,g=!1,h=this.startGroup,i=null,j=this.getGroupInof(b,a);j.groupInfo.id===h.groupInfo.id?(e={groupId:j.groupInfo.id,startOffset:h.offset,endOffset:j.offset},this.startGroupIsPlaceholder&&(d?e.startOffset===e.endOffset&&(e.endOffset+=1):e.startOffset+=1)):c.contains(h.groupInfo.groupObj,j.groupInfo.groupObj)?e={groupId:h.groupInfo.id,startOffset:h.offset,endOffset:this.getIndex(h.groupInfo.groupObj,a,b)}:c.contains(j.groupInfo.groupObj,h.groupInfo.groupObj)?(e={groupId:j.groupInfo.id,startOffset:this.kfEditor.requestService("position.get.index",j.groupInfo.groupObj,h.groupInfo.groupObj),endOffset:j.offset},d||(e.startOffset+=1)):(f=this.getCommunityGroup(h.groupInfo,j.groupInfo),f.startOffset===f.endOffset?f.endOffset+=1:(i=f.group.content[f.endOffset],g=this.kfEditor.requestService("position.get.area",i,b),g&&(f.endOffset+=1),d||(f.startOffset+=1)),e={groupId:f.group.id,startOffset:f.startOffset,endOffset:f.endOffset}),this.kfEditor.requestService("syntax.update.record.cursor",e.groupId,e.startOffset,e.endOffset),this.kfEditor.requestService("control.reselect")},updateSelectionByTarget:function(a){var b=this.kfEditor.requestService("position.get.parent.group",a),c=null,d={};if(null!==b){if(this.kfEditor.requestService("syntax.is.root.node",b.id))return void this.selectAll();this.kfEditor.requestService("syntax.is.virtual.node",b.id)?(c=this.kfEditor.requestService("position.get.group.info",b.groupObj),d={groupId:c.group.id,startOffset:c.index,endOffset:c.index+1}):d={groupId:b.id,startOffset:0,endOffset:b.content.length},this.kfEditor.requestService("syntax.update.record.cursor",d),this.kfEditor.requestService("control.reselect"),this.kfEditor.requestService("control.update.input")}},selectAll:function(){var a=this.kfEditor.requestService("syntax.get.root.group.info"),b={groupId:a.id,startOffset:0,endOffset:a.content.length};this.kfEditor.requestService("syntax.update.record.cursor",b),this.kfEditor.requestService("control.reselect"),this.kfEditor.requestService("control.update.input")},getGroupInof:function(a,b){var c=this.kfEditor.requestService("position.get.group",b);null===c&&(c=this.kfEditor.requestService("syntax.get.root.group.info"));var d=this.kfEditor.requestService("position.get.location.info",a,c);return{groupInfo:c,offset:d}},getIndex:function(a,b,d){var e=this.kfEditor.requestService("position.get.index",a,b),f=this.kfEditor.requestService("syntax.get.group.content",a.id),g=f.content[e],h=c.getRect(g);return h.left+h.width/2k;k++)i=b.operand[k],h(b)?e(a,k,b,i):f(a,k,b,i);return b}function c(){return q+ ++s}function d(a,b){a.isResetId?b.attr["data-root"]="true":b.attr["data-type"]=r.VIRTUAL}function e(b,c,d,e){"brackets"===d.name&&2>c||("function"!==d.name||0!==c)&&(d.attr["data-type"]=r.VIRTUAL,e?"string"==typeof e?(d.operand[c]=j(b),d.operand[c].operand[0]=e):i(e)?(d.operand[c]=j(b),d.operand[c].operand[0]=a(b,e,d.operand[c])):d.operand[c]=a(b,e,d):d.operand[c]=e)}function f(b,c,d,e){d.attr["data-type"]=r.GROUP,d.operand[c]=e&&"string"!=typeof e?"text"===e.name?e:a(b,e,d):e}function g(a){var b=1;if(a.length>3)return!1;for(var c=0,d=a.length;d>c;c++)a[c]!==m&&a[c]&&"placeholder"===a[c].name&&b--;return!b}function h(a){return!!n[a.name]}function i(a){return"placeholder"===a.name}function j(a){return{name:p,attr:{"data-type":r.GROUP,id:a.getGroupId()},operand:[]}}var k=b.r(19).Parser,l=b.r(20),m=b.r(29).cursorCharacter,n=b.r(22),o=b.r(29).rootPlaceholder.content,p="combination",q="_kf_editor_",r=b.r(11),s=0,t=l.createClass("Parser",{constructor:function(a){this.kfEditor=a,this.callBase(),this.kfParser=k.use("latex"),this.initKFormulExtension(),this.pid=c(),this.groupRecord=0,this.tree=null,this.isResetId=!0,this.initServices()},parse:function(b,c){var d=null;return this.isResetId=!!c,this.isResetId&&this.resetGroupId(),d=this.kfParser.parse(b),a(this,d.tree),d},serialization:function(a){return this.kfParser.serialization(a)},initServices:function(){this.kfEditor.registerService("parser.parse",this,{parse:this.parse}),this.kfEditor.registerService("parser.latex.serialization",this,{serialization:this.serialization})},getKFParser:function(){return this.kfParser},initKFormulExtension:function(){b.r(17).ext(this)},resetGroupId:function(){this.groupRecord=0},getGroupId:function(){return this.pid+"_"+ ++this.groupRecord}});return t}},b[22]={value:function(){return{radical:!0,fraction:!0,summation:!0,integration:!0,placeholder:!0,script:!0,superscript:!0,subscript:!0,brackets:!0,"function":!0}}},b[23]={value:function(){function a(b,c,d){var e=null;return b.ownerSVGElement?(b=b.parentNode,e=b.tagName.toLowerCase(),b&&"body"!==e&&"svg"!==e?"kf-editor-group"===b.getAttribute("data-type")?b:c&&"kf-editor-virtual-group"===b.getAttribute("data-type")?b:d&&null!==b.getAttribute("data-flag")?b:a(b,c,d):null):null}var c=b.r(20),d=b.r(4),e=c.createClass("PositionComponenet",{constructor:function(a){this.kfEditor=a,this.initServices()},initServices:function(){this.kfEditor.registerService("position.get.group",this,{getGroupByTarget:this.getGroupByTarget}),this.kfEditor.registerService("position.get.index",this,{getIndexByTargetInGroup:this.getIndexByTargetInGroup}),this.kfEditor.registerService("position.get.location.info",this,{getLocationInfo:this.getLocationInfo}),this.kfEditor.registerService("position.get.parent.group",this,{getParentGroupByTarget:this.getParentGroupByTarget}),this.kfEditor.registerService("position.get.wrap",this,{getWrap:this.getWrap}),this.kfEditor.registerService("position.get.area",this,{getAreaByCursorInGroup:this.getAreaByCursorInGroup}),this.kfEditor.registerService("position.get.group.info",this,{getGroupInfoByNode:this.getGroupInfoByNode}),this.kfEditor.registerService("position.get.parent.info",this,{getParentInfoByNode:this.getParentInfoByNode})},getGroupByTarget:function(b){var c=a(b,!1,!1);return c?this.kfEditor.requestService("syntax.get.group.content",c.id):null},getIndexByTargetInGroup:function(a,b){var e=this.kfEditor.requestService("syntax.get.group.content",a.id),f=-1;return c.Utils.each(e.content,function(a,c){return f=c,d.contains(a,b)?!1:void 0}),f},getAreaByCursorInGroup:function(a,b){var c=d.getRect(a);return c.left+c.width/2=0;g--)if(c=g,h=e[g],f=d.getRect(h),f.leftg&&(c.index=g,!d.contains(f.content[g],b));g++);return c.group=f,c},getParentInfoByNode:function(b){var c=a(b,!0,!1);return c=this.kfEditor.requestService("syntax.get.group.content",c.id),{group:c,index:c.content.indexOf(b)}}});return e}},b[24]={value:function(){var a=b.r(20);return a.createClass("Printer",{constructor:function(a){this.kfEditor=a,this.initServices(),this.initCommands()},initServices:function(){this.kfEditor.registerService("print.image",this,{printImage:this.printImage})},initCommands:function(){this.kfEditor.registerCommand("get.image.data",this,this.getImageData)},printImage:function(){var a=this.kfEditor.requestService("render.get.paper");this._formatCanvas(),a.toPNG(function(a){document.body.innerHTML=''}),this._restoreCanvas()},getImageData:function(a){var b=this.kfEditor.requestService("render.get.canvas"),c=this.kfEditor.requestService("render.get.paper");this._formatCanvas(),c.toPNG(function(c){a({width:b.width,height:b.height,img:c})}),this._restoreCanvas()},_formatCanvas:function(){var a=this.kfEditor.requestService("render.get.canvas"),b=a.container.getRenderBox();a.node.setAttribute("width",b.width),a.node.setAttribute("height",b.height),this.kfEditor.requestService("render.clear.canvas.transform"),this.kfEditor.requestService("control.cursor.hide"),this.kfEditor.requestService("render.clear.select")},_restoreCanvas:function(){var a=this.kfEditor.requestService("render.get.canvas");a.node.setAttribute("width","100%"),a.node.setAttribute("height","100%"),this.kfEditor.requestService("render.revert.canvas.transform"),this.kfEditor.requestService("control.cursor.relocation"),this.kfEditor.requestService("render.reselect")}})}},b[25]={value:function(){var a=b.r(20),c=b.r(19).Assembly,d={autoresize:!1,fontsize:50,padding:[20,50]},e=a.createClass("RenderComponent",{base:b.r(1),constructor:function(b,c){this.callBase(),this.options=a.Utils.extend({},d,c),this.kfEditor=b,this.assembly=null,this.formula=null,this.relDisabled=!1,this.canvasZoom=1,this.record={select:{},cursor:{},canvas:{}},this.initCanvas(),this.initServices(),this.initCommands()},initCanvas:function(){var a=this.kfEditor.requestService("ui.get.canvas.container"),b=this.kfEditor.getFormulaClass();this.assembly=new c(new b(a,this.options)),this.formula=this.assembly.formula,this.setCanvasToCenter()},setCanvasOffset:function(a,b){var c=this.formula.getViewBox();b=void 0!==b?b:-c.height/2,this.formula.setViewBox(a,b,c.width,c.height)},setCanvasToCenter:function(){var a=this.formula.getViewBox();this.formula.setViewBox(-a.width/2,-a.height/2,a.width,a.height)},initServices:function(){this.kfEditor.registerService("render.get.canvas",this,{getCanvas:this.getCanvas}),this.kfEditor.registerService("render.get.content.size",this,{getContentSize:this.getContentSize}),this.kfEditor.registerService("render.clear.canvas.transform",this,{clearCanvasOffset:this.clearCanvasTransform}),this.kfEditor.registerService("render.set.canvas.offset",this,{setCanvasOffset:this.setCanvasOffset}),this.kfEditor.registerService("render.set.canvas.to.center",this,{setCanvasToCenter:this.setCanvasToCenter}),this.kfEditor.registerService("render.revert.canvas.transform",this,{revertCanvasTransform:this.revertCanvasTransform}),this.kfEditor.registerService("render.relocation",this,{relocation:this.relocation}),this.kfEditor.registerService("render.disable.relocation",this,{disableRelocation:this.disableRelocation}),this.kfEditor.registerService("render.enable.relocation",this,{enableRelocation:this.enableRelocation}),this.kfEditor.registerService("render.select.group.content",this,{selectGroupContent:this.selectGroupContent}),this.kfEditor.registerService("render.select.group",this,{selectGroup:this.selectGroup}),this.kfEditor.registerService("render.select.group.all",this,{selectAllGroup:this.selectAllGroup}),this.kfEditor.registerService("render.tint.current.cursor",this,{tintCurrentGroup:this.tintCurrentGroup}),this.kfEditor.registerService("render.select.current.cursor",this,{selectCurrentCursor:this.selectCurrentCursor}),this.kfEditor.registerService("render.reselect",this,{reselect:this.reselect}),this.kfEditor.registerService("render.clear.select",this,{clearSelect:this.clearSelect}),this.kfEditor.registerService("render.set.canvas.zoom",this,{setCanvasZoom:this.setCanvasZoom}),this.kfEditor.registerService("render.get.canvas.zoom",this,{getCanvasZoom:this.getCanvasZoom}),this.kfEditor.registerService("render.get.paper.offset",this,{getPaperOffset:this.getPaperOffset}),this.kfEditor.registerService("render.draw",this,{render:this.render}),this.kfEditor.registerService("render.insert.string",this,{insertString:this.insertString}),this.kfEditor.registerService("render.insert.group",this,{insertGroup:this.insertGroup}),this.kfEditor.registerService("render.get.paper",this,{getPaper:this.getPaper})},initCommands:function(){this.kfEditor.registerCommand("render",this,function(a){this.render(a),this.kfEditor.requestService("ui.update.canvas.view")}),this.kfEditor.registerCommand("getPaper",this,this.getPaper)},relocation:function(){this.relDisabled?this.relocationToLeft():this.relocationToCenter()},relocationToCenter:function(){var a=this.formula.container.getRenderBox();this.formula.container.setTranslate(-a.width/2,-a.height/2),this.setCanvasToCenter()},relocationToLeft:function(){var a=this.formula.container.getRenderBox();this.formula.container.setTranslate(0,-a.height/2),this.setCanvasOffset(0)},selectGroup:function(a){var b=this.kfEditor.requestService("syntax.get.group.object",a);this.clearSelect(),b.node.getAttribute("data-root")||(this.record.select.lastSelect=b,b.select())},selectGroupContent:function(a){null!==a.groupObj.getAttribute("data-placeholder")&&(a={id:a.content[0].id});var b=this.kfEditor.requestService("syntax.get.group.object",a.id);this.clearSelect(),this.record.select.lastSelect=b,b.node.getAttribute("data-root")||b.select()},selectAllGroup:function(a){null!==a.groupObj.getAttribute("data-placeholder")&&(a={id:a.content[0].id});var b=this.kfEditor.requestService("syntax.get.group.object",a.id);this.clearSelect(),this.record.select.lastSelect=b,b.selectAll()},selectCurrentCursor:function(){var a=this.kfEditor.requestService("syntax.get.record.cursor"),b=this.kfEditor.requestService("syntax.get.group.object",a.groupId),c=null,d=-1,e=0,f=Math.min(a.startOffset,a.endOffset),g=Math.max(a.startOffset,a.endOffset);this.clearSelect(),this.record.select.lastSelect=b;for(var h=f,i=g;i>h;h++)c=b.getOperand(h).getRenderBox(b),-1==d&&(d=c.x),e+=c.width;b.setBoxWidth(e),b.selectAll(),b.getBox().setTranslate(d,0)},tintCurrentGroup:function(){var a=this.kfEditor.requestService("syntax.get.record.cursor").groupId,b=this.kfEditor.requestService("syntax.get.group.object",a),c=this.kfEditor.requestService("syntax.is.placeholder.node",a);this.clearSelect(),b.node.getAttribute("data-root")||(c&&(b=this.kfEditor.requestService("syntax.get.group.object",b.operands[0].node.id)),this.record.select.lastSelect=b,b.select())},reselect:function(){var a=this.kfEditor.requestService("syntax.get.record.cursor"),b=null;b=this.kfEditor.requestService("syntax.get.group.object",a.groupId),this.clearSelect(),this.record.select.lastSelect=b,b.node.getAttribute("data-root")||b.select() +},clearSelect:function(){var a=null,b=this.record.select.lastSelect;b&&b.node.ownerSVGElement&&(b.unselect(),a=b.getRenderBox(b),b.setBoxWidth(a.width),b.getBox().setTranslate(0,0))},getPaper:function(){return this.formula},render:function(a){var b=this.kfEditor.requestService("parser.parse",a,!0),c=this.assembly.regenerateBy(b);this.kfEditor.requestService("syntax.update.objtree",c)},enableRelocation:function(){this.relDisabled=!1},disableRelocation:function(){this.relDisabled=!0},setCanvasZoom:function(a){var b=this.formula.getViewPort();this.canvasZoom=a,b.zoom=a,this.formula.setViewPort(b)},getCanvas:function(){return this.formula},getContentSize:function(){return this.formula.container.getRenderBox()},clearCanvasTransform:function(){var a=this.record.canvas;a.viewBox=this.formula.getViewBox(),a.contentOffset=this.formula.container.getTranslate(),this.setCanvasToCenter(),this.formula.node.removeAttribute("viewBox"),this.formula.container.setTranslate(0,0)},revertCanvasTransform:function(){var a=this.record.canvas,b=a.viewBox;return b?(this.formula.setViewBox(b.x,b.y,b.width,b.height),this.formula.container.setTranslate(a.contentOffset),a.viewBox=null,void(a.contentOffset=null)):!1},getCanvasZoom:function(){return this.canvasZoom}});return e}},b[26]={value:function(){var a=b.r(20);return a.createClass("DeleteComponent",{constructor:function(a,b){this.parentComponent=a,this.kfEditor=b},deleteGroup:function(){var a=this.parentComponent.getCursorRecord(),b=this.parentComponent.getObjectTree(),c=b.mapping[a.groupId].strGroup;return a.startOffset!==a.endOffset?this.parentComponent.isSelectPlaceholder()?this.parentComponent.isRootTree(c)?!1:(a=this.selectParentContainer(a.groupId),this.parentComponent.updateCursor(a),!1):this.deleteSelection(c,a):0===a.startOffset?this.parentComponent.isRootTree(c)?!1:(a=this.selectParentContainer(a.groupId),this.parentComponent.updateCursor(a),!1):c.operand.length>1?(a=this.deletePrevGroup(c,a),this.parentComponent.updateCursor(a),a.startOffset===a.endOffset?!0:!1):(a.startOffset=0,a.endOffset=1,c.operand[0].attr&&this.parentComponent.isGroupNode(c.operand[0].attr.id)?(this.parentComponent.updateCursor(a),!1):(c.operand[0]={name:"placeholder",operand:[]},this.parentComponent.updateCursor(a),!0))},deletePrevGroup:function(a,b){var c=b.startOffset-1,d=a.operand[c];return this.parentComponent.isLeafTree(d)?(a.operand.splice(c,1),b.startOffset-=1,b.endOffset-=1):b.startOffset-=1,b},deleteSelection:function(a,b){return 0===b.startOffset&&b.endOffset===a.operand.length?(a.operand.length=1,a.operand[0]={name:"placeholder",operand:[]},b.endOffset=1):(a.operand.splice(b.startOffset,b.endOffset-b.startOffset),b.endOffset=b.startOffset),this.parentComponent.updateCursor(b),!0},selectParentContainer:function(a){var b=this.parentComponent.getGroupObject(a).node,c=this.kfEditor.requestService("position.get.group",b),d=this.kfEditor.requestService("position.get.index",c.groupObj,b);return{groupId:c.id,startOffset:d,endOffset:d+1}}})}},b[27]={value:function(){function a(a){var b=null,c=this.parentComponent,f=null;return f=c.getGroupContent(a.groupId),c.isSelectPlaceholder()?e(this,f.content[a.startOffset],p.LEFT):(a.startOffset===a.endOffset?a.startOffset>0?(b=f.content[a.startOffset-1],l(b)?a=d(this,b,p.LEFT):(a.startOffset-=1,m(b)||(a.endOffset=a.startOffset))):a=e(this,f.groupObj,p.LEFT):(a.startOffset=Math.min(a.startOffset,a.endOffset),a.endOffset=a.startOffset),a)}function c(a){var b=null,c=this.parentComponent,f=null;return f=c.getGroupContent(a.groupId),c.isSelectPlaceholder()?e(this,f.content[a.startOffset],p.RIGHT):(a.startOffset===a.endOffset?a.startOffset1)return{groupId:d.group.id,startOffset:0,endOffset:0};d=c.requestService("position.get.parent.info",d.group.groupObj)}return k(d.group.groupObj)?{groupId:d.group.id,startOffset:d.index,endOffset:d.index}:(b=d.group.content[d.index-1],l(b)?k(b)?f(a,b):f(a,b):n(b)?g(a,b):{groupId:d.group.id,startOffset:d.index,endOffset:d.index})}function h(a,b){var c=a.parentComponent,d=null,e=null;if(l(b)){if(d=c.getGroupContent(b.id),e=d.content[0],k(b))return k(e)?h(a,e):m(e)?{groupId:b.id,startOffset:0,endOffset:1}:{groupId:b.id,startOffset:0,endOffset:0};for(;!k(e)&&!m(e)&&!n(e);)d=c.getGroupContent(e.id),e=d.content[0];return m(e)?{groupId:e.id,startOffset:0,endOffset:0}:n(e)?i(a,e):h(a,e)}return null}function i(a,b){var c=a.kfEditor,d=a.parentComponent,e=null,f=null;if(j(b))return null;for(e=c.requestService("position.get.parent.info",b);e.index===e.group.content.length-1;){if(j(e.group.groupObj))return{groupId:e.group.id,startOffset:e.group.content.length,endOffset:e.group.content.length};if(k(e.group.groupObj)&&e.group.content.length>1)return{groupId:e.group.id,startOffset:e.group.content.length,endOffset:e.group.content.length};e=c.requestService("position.get.parent.info",e.group.groupObj)}return b=e.group.content[e.index+1],n(b)?i(a,b):k(b)?(f=d.getGroupContent(b.id),d.isPlaceholder(f.content[0].id)?{groupId:b.id,startOffset:0,endOffset:1}:{groupId:b.id,startOffset:0,endOffset:0}):{groupId:e.group.id,startOffset:e.index+1,endOffset:e.index+1}}function j(a){return!!a.getAttribute("data-root")}function k(a){return"kf-editor-group"===a.getAttribute("data-type")}function l(a){var b=a.getAttribute("data-type");return"kf-editor-group"===b||"kf-editor-virtual-group"===b}function m(a){return"Placeholder"===a.getAttribute("data-flag")}function n(a){return"Empty"===a.getAttribute("data-flag")}var o=b.r(20),p={LEFT:"left",RIGHT:"right"};return o.createClass("MoveComponent",{constructor:function(a,b){this.parentComponent=a,this.kfEditor=b},leftMove:function(){var b=this.parentComponent.getCursorRecord();b=a.call(this,b),b&&this.parentComponent.updateCursor(b)},rightMove:function(){var a=this.parentComponent.getCursorRecord();a=c.call(this,a),a&&this.parentComponent.updateCursor(a)}})}},b[28]={value:function(){var a=b.r(20),c=b.r(27),d=b.r(26),e=b.r(29).cursorCharacter,f=b.r(11),g=a.createClass("SyntaxComponenet",{constructor:function(a){this.kfEditor=a,this.record={cursor:{group:null,startOffset:-1,endOffset:-1}},this.components={},this.objTree=null,this.initComponents(),this.initServices(),this.initCommands()},initComponents:function(){this.components.move=new c(this,this.kfEditor),this.components.delete=new d(this,this.kfEditor)},initServices:function(){this.kfEditor.registerService("syntax.update.objtree",this,{updateObjTree:this.updateObjTree}),this.kfEditor.registerService("syntax.get.objtree",this,{getObjectTree:this.getObjectTree}),this.kfEditor.registerService("syntax.get.group.object",this,{getGroupObject:this.getGroupObject}),this.kfEditor.registerService("syntax.is.root.node",this,{isRootNode:this.isRootNode}),this.kfEditor.registerService("syntax.is.group.node",this,{isGroupNode:this.isGroupNode}),this.kfEditor.registerService("syntax.is.virtual.node",this,{isVirtualNode:this.isVirtualNode}),this.kfEditor.registerService("syntax.is.placeholder.node",this,{isPlaceholder:this.isPlaceholder}),this.kfEditor.registerService("syntax.is.select.placeholder",this,{isSelectPlaceholder:this.isSelectPlaceholder}),this.kfEditor.registerService("syntax.has.root.placeholder",this,{hasRootplaceholder:this.hasRootplaceholder}),this.kfEditor.registerService("syntax.valid.brackets",this,{isBrackets:this.isBrackets}),this.kfEditor.registerService("syntax.get.group.content",this,{getGroupContent:this.getGroupContent}),this.kfEditor.registerService("syntax.get.root.group.info",this,{getRootGroupInfo:this.getRootGroupInfo}),this.kfEditor.registerService("syntax.get.root",this,{getRootObject:this.getRootObject}),this.kfEditor.registerService("syntax.update.record.cursor",this,{updateCursor:this.updateCursor}),this.kfEditor.registerService("syntax.update.selection",this,{updateSelection:this.updateSelection}),this.kfEditor.registerService("syntax.get.record.cursor",this,{getCursorRecord:this.getCursorRecord}),this.kfEditor.registerService("syntax.has.cursor.info",this,{hasCursorInfo:this.hasCursorInfo}),this.kfEditor.registerService("syntax.serialization",this,{serialization:this.serialization}),this.kfEditor.registerService("syntax.cursor.move.left",this,{leftMove:this.leftMove}),this.kfEditor.registerService("syntax.cursor.move.right",this,{rightMove:this.rightMove}),this.kfEditor.registerService("syntax.delete.group",this,{deleteGroup:this.deleteGroup})},initCommands:function(){this.kfEditor.registerCommand("get.source",this,this.getSource),this.kfEditor.registerCommand("content.is.empty",this,this.isEmpty)},updateObjTree:function(a){var b=a.select;b&&b.groupId&&this.updateCursor(b.groupId,b.startOffset,b.endOffset),this.objTree=a},hasCursorInfo:function(){return null!==this.record.cursor.group},isRootNode:function(a){return this.objTree.mapping.root.strGroup.attr.id===a},isGroupNode:function(a){var b=this.objTree.mapping[a].strGroup.attr["data-type"];return b===f.GROUP||b===f.VIRTUAL},isVirtualNode:function(a){return this.objTree.mapping[a].strGroup.attr["data-type"]===f.VIRTUAL},isPlaceholder:function(a){var b=this.objTree.mapping[a];return b?(b=b.objGroup.node,"Placeholder"===b.getAttribute("data-flag")):!1},isBrackets:function(a){return!!this.objTree.mapping[a].objGroup.node.getAttribute("data-brackets")},hasRootplaceholder:function(){return"placeholder"===this.objTree.mapping.root.strGroup.operand[0].name},isSelectPlaceholder:function(){var a=this.record.cursor,b=null;return a.endOffset-a.startOffset!==1?!1:(b=this.getGroupContent(a.groupId),this.isPlaceholder(b.content[a.startOffset].id)?!0:!1)},isLeafTree:function(a){return"string"==typeof a},isRootTree:function(a){return a.attr&&a.attr["data-root"]},getObjectTree:function(){return this.objTree},getGroupObject:function(a){return this.objTree.mapping[a].objGroup||null},getCursorRecord:function(){return a.Utils.extend({},this.record.cursor)||null},getGroupContent:function(b){var c=this.objTree.mapping[b],d=[],e=c.objGroup.operands,f=e.length-1,g="rtl"!==c.strGroup.traversal;return a.Utils.each(e,function(a,b){g?d.push(a.node):d[f-b]=a.node}),{id:b,traversal:c.strGroup.traversal||"ltr",groupObj:c.objGroup.node,content:d}},getRootObject:function(){return this.objTree.mapping.root.objGroup},getRootGroupInfo:function(){var a=this.objTree.mapping.root.strGroup.attr.id;return this.getGroupContent(a)},updateSelection:function(a){var b=this.objTree.mapping[a.id],c=b.strGroup,d=null,f=null,g=null,h=-1,i=-1;if(d=a,f=b,"combination"===c.name)this.record.cursor={groupId:d.id,startOffset:0,endOffset:c.operand.length},c.operand.unshift(e),c.operand.push(e);else{for(;"combination"!==f.strGroup.name||1===d.content;)a=d,b=f,d=this.kfEditor.requestService("position.get.parent.group",b.objGroup.node),f=this.objTree.mapping[d.id];var j=[].indexOf.call(d.content,a.groupObj);this.record.cursor={groupId:d.id,startOffset:j,endOffset:j+1},f.strGroup.operand.splice(j+1,0,e),f.strGroup.operand.splice(j,0,e)}return g=this.kfEditor.requestService("parser.latex.serialization",this.objTree.parsedTree),h=g.indexOf(e),g=g.replace(e,""),i=g.indexOf(e),f.strGroup.operand.splice(this.record.cursor.startOffset,1),f.strGroup.operand.splice(this.record.cursor.endOffset,1),{str:g,startOffset:h,endOffset:i}},getSource:function(){return this.serialization().str.replace(e,"").replace(e,"")},isEmpty:function(){return this.hasRootplaceholder()},serialization:function(){var a=this.record.cursor,b=this.objTree.mapping[a.groupId],c=b.strGroup,d=null,f=-1,g=-1;return f=Math.min(a.endOffset,a.startOffset),g=Math.max(a.endOffset,a.startOffset),c.operand.splice(g,0,e),c.operand.splice(f,0,e),g+=1,d=this.kfEditor.requestService("parser.latex.serialization",this.objTree.parsedTree),c.operand.splice(g,1),c.operand.splice(f,1),f=d.indexOf(e),a.startOffset===a.endOffset&&(d=d.replace(e,"")),g=d.lastIndexOf(e),{str:d,startOffset:f,endOffset:g}},updateCursor:function(a,b,c){var d=null;1===arguments.length&&(c=a.endOffset,b=a.startOffset,a=a.groupId),void 0===c&&(c=b),b>c&&(d=c,c=b,b=d),this.record.cursor={groupId:a,startOffset:b,endOffset:c}},leftMove:function(){this.components.move.leftMove()},rightMove:function(){this.components.move.rightMove()},deleteGroup:function(){return this.components.delete.deleteGroup()},insertSubtree:function(a){var b=this.record.cursor,c=0,d=0,e=null,f=0;this.isPlaceholder(b.groupId)?this.replaceTree(a):(c=Math.min(b.startOffset,b.endOffset),d=Math.max(b.startOffset,b.endOffset),f=d-c,e=this.objTree.mapping[b.groupId].strGroup,e.operand.splice(c,f,a),b.startOffset+=1,b.endOffset=b.startOffset)},replaceTree:function(a){var b=this.record.cursor,c=this.objTree.mapping[b.groupId].objGroup.node,d=this.kfEditor.requestService("position.get.parent.info",c),e=this.objTree.mapping[d.group.id].strGroup;e.operand[d.index]=a,b.groupId=d.group.id,b.startOffset=d.index+1,b.endOffset=d.index+1}});return g}},b[29]={value:function(){return{cursorCharacter:"\uf155",rootPlaceholder:{color:"#666",content:"\u5728\u6b64\u5904\u952e\u5165\u516c\u5f0f",fontsize:16},scrollbar:{padding:5,step:150}}}},b[30]={value:function(){return{"\\pm":{x:5,y:0},"\\infty":{x:42,y:0},"=":{x:79,y:0},"\\sim":{x:116,y:0},"\\times":{x:153,y:0},"\\div":{x:190,y:0},"!":{x:227,y:0},"<":{x:264,y:0},"\\ll":{x:301,y:0},">":{x:338,y:0},"\\gg":{x:375,y:0},"\\leq":{x:412,y:0},"\\geq":{x:449,y:0},"\\mp":{x:486,y:0},"\\cong":{x:523,y:0},"\\equiv":{x:560,y:0},"\\propto":{x:597,y:0},"\\approx":{x:634,y:0},"\\forall":{x:671,y:0},"\\partial":{x:708,y:0},"\\surd":{x:745,y:0},"\\cup":{x:782,y:0},"\\cap":{x:819,y:0},"\\varnothing":{x:856,y:0},"%":{x:893,y:0},"\\circ":{x:930,y:0},"\\exists":{x:967,y:0},"\\nexists":{x:1004,y:0},"\\in":{x:1041,y:0},"\\ni":{x:1078,y:0},"\\gets":{x:5,y:37},"\\uparrow":{x:42,y:37},"\\to":{x:79,y:37},"\\downarrow":{x:116,y:37},"\\leftrightarrow":{x:153,y:37},"\\therefore":{x:190,y:37},"\\because":{x:227,y:37},"+":{x:264,y:37},"-":{x:301,y:37},"\\neg":{x:338,y:37},"\\ast":{x:375,y:37},"\\cdot":{x:412,y:37},"\\vdots":{x:449,y:37},"\\ddots":{x:486,y:37},"\\aleph":{x:523,y:37},"\\beth":{x:560,y:37},"\\blacksquare":{x:597,y:37},"\\alpha":{x:634,y:37},"\\beta":{x:671,y:37},"\\gamma":{x:708,y:37},"\\delta":{x:745,y:37},"\\epsilon":{x:782,y:37},"\\zeta":{x:819,y:37},"\\eta":{x:856,y:37},"\\theta":{x:893,y:37},"\\iota":{x:930,y:37},"\\kappa":{x:967,y:37},"\\lambda":{x:1004,y:37},"\\mu":{x:1041,y:37},"\\nu":{x:1078,y:37},"\\xi":{x:5,y:74},"\\omicron":{x:42,y:74},"\\pi":{x:79,y:74},"\\rho":{x:116,y:74},"\\sigma":{x:153,y:74},"\\tau":{x:190,y:74},"\\upsilon":{x:227,y:74},"\\phi":{x:264,y:74},"\\chi":{x:301,y:74},"\\psi":{x:338,y:74},"\\omega":{x:375,y:74},"\\Alpha":{x:412,y:74},"\\Beta":{x:449,y:74},"\\Gamma":{x:486,y:74},"\\Delta":{x:523,y:74},"\\Epsilon":{x:560,y:74},"\\Zeta":{x:597,y:74},"\\Eta":{x:634,y:74},"\\Theta":{x:671,y:74},"\\Iota":{x:708,y:74},"\\Kappa":{x:745,y:74},"\\Lambda":{x:782,y:74},"\\Mu":{x:819,y:74},"\\Nu":{x:856,y:74},"\\Xi":{x:893,y:74},"\\Omicron":{x:930,y:74},"\\Pi":{x:967,y:74},"\\Rho":{x:1004,y:74},"\\Sigma":{x:1041,y:74},"\\Tau":{x:1078,y:74},"\\Upsilon":{x:5,y:111},"\\Phi":{x:42,y:111},"\\Chi":{x:79,y:111},"\\Psi":{x:116,y:111},"\\Omega":{x:153,y:111},"\\digamma":{x:190,y:111},"\\varepsilon":{x:227,y:111},"\\varkappa":{x:264,y:111},"\\varphi":{x:301,y:111},"\\varpi":{x:338,y:111},"\\varrho":{x:375,y:111},"\\varsigma":{x:412,y:111},"\\vartheta":{x:449,y:111},"\\neq":{x:486,y:111},"\\nless":{x:523,y:111},"\\ngtr":{x:560,y:111},"\\nleq":{x:597,y:111},"\\ngeq":{x:634,y:111},"\\nsim":{x:671,y:111},"\\lneqq":{x:708,y:111},"\\gneqq":{x:745,y:111},"\\nprec":{x:782,y:111},"\\nsucc":{x:819,y:111},"\\notin":{x:856,y:111},"\\nsubseteq":{x:893,y:111},"\\nsupseteq":{x:930,y:111},"\\subsetneq":{x:967,y:111},"\\supsetneq":{x:1004,y:111},"\\lnsim":{x:1041,y:111},"\\gnsim":{x:1078,y:111},"\\precnsim":{x:5,y:148},"\\succnsim":{x:42,y:148},"\\ntriangleleft":{x:79,y:148},"\\ntriangleright":{x:116,y:148},"\\ntrianglelefteq":{x:153,y:148},"\\ntrianglerighteq":{x:190,y:148},"\\nmid":{x:227,y:148},"\\nparallel":{x:264,y:148},"\\nvdash":{x:301,y:148},"\\nVdash":{x:338,y:148},"\\nvDash":{x:375,y:148},"\\nVDash":{x:412,y:148},"\\daleth":{x:449,y:148},"\\gimel":{x:486,y:148},"\\complement":{x:523,y:148},"\\ell":{x:560,y:148},"\\eth":{x:597,y:148},"\\hbar":{x:634,y:148},"\\hslash":{x:671,y:148},"\\mho":{x:708,y:148},"\\wp":{x:745,y:148},"\\circledS":{x:782,y:148},"\\Bbbk":{x:819,y:148},"\\Finv":{x:856,y:148},"\\Game":{x:893,y:148},"\\Im":{x:930,y:148},"\\Re":{x:967,y:148},"\\updownarrow":{x:1004,y:148},"\\Leftarrow":{x:1041,y:148},"\\Rightarrow":{x:1078,y:148},"\\Uparrow":{x:5,y:185},"\\Downarrow":{x:42,y:185},"\\Leftrightarrow":{x:79,y:185},"\\Updownarrow":{x:116,y:185},"\\longleftarrow":{x:153,y:185},"\\longrightarrow":{x:190,y:185},"\\longleftrightarrow":{x:227,y:185},"\\Longleftarrow":{x:264,y:185},"\\Longrightarrow":{x:301,y:185},"\\Longleftrightarrow":{x:338,y:185},"\\nearrow":{x:375,y:185},"\\nwarrow":{x:412,y:185},"\\searrow":{x:449,y:185},"\\swarrow":{x:486,y:185},"\\nleftarrow":{x:523,y:185},"\\nrightarrow":{x:560,y:185},"\\nLeftarrow":{x:597,y:185},"\\nRightarrow":{x:634,y:185},"\\nLeftrightarrow":{x:671,y:185},"\\leftharpoonup":{x:708,y:185},"\\leftharpoondown":{x:745,y:185},"\\rightharpoonup":{x:782,y:185},"\\rightharpoondown":{x:819,y:185},"\\upharpoonleft":{x:856,y:185},"\\upharpoonright":{x:893,y:185},"\\downharpoonleft":{x:930,y:185},"\\downharpoonright":{x:967,y:185},"\\leftrightharpoons":{x:1004,y:185},"\\rightleftharpoons":{x:1041,y:185},"\\leftleftarrows":{x:1078,y:185},"\\rightrightarrows":{x:5,y:222},"\\upuparrows":{x:42,y:222},"\\downdownarrows":{x:79,y:222},"\\leftrightarrows":{x:116,y:222},"\\rightleftarrows":{x:153,y:222},"\\looparrowleft":{x:190,y:222},"\\looparrowright":{x:227,y:222},"\\leftarrowtail":{x:264,y:222},"\\rightarrowtail":{x:301,y:222},"\\Lsh":{x:338,y:222},"\\Rsh":{x:375,y:222},"\\Lleftarrow":{x:412,y:222},"\\Rrightarrow":{x:449,y:222},"\\curvearrowleft":{x:486,y:222},"\\curvearrowright":{x:523,y:222},"\\circlearrowleft":{x:560,y:222},"\\circlearrowright":{x:597,y:222},"\\multimap":{x:634,y:222},"\\leftrightsquigarrow":{x:671,y:222},"\\twoheadleftarrow":{x:708,y:222},"\\twoheadrightarrow":{x:745,y:222},"\\rightsquigarrow":{x:782,y:222},"\\mathcal{A}":{x:819,y:222},"\\mathcal{B}":{x:856,y:222},"\\mathcal{C}":{x:893,y:222},"\\mathcal{D}":{x:930,y:222},"\\mathcal{E}":{x:967,y:222},"\\mathcal{F}":{x:1004,y:222},"\\mathcal{G}":{x:1041,y:222},"\\mathcal{H}":{x:1078,y:222},"\\mathcal{I}":{x:5,y:259},"\\mathcal{J}":{x:42,y:259},"\\mathcal{K}":{x:79,y:259},"\\mathcal{L}":{x:116,y:259},"\\mathcal{M}":{x:153,y:259},"\\mathcal{N}":{x:190,y:259},"\\mathcal{O}":{x:227,y:259},"\\mathcal{P}":{x:264,y:259},"\\mathcal{Q}":{x:301,y:259},"\\mathcal{R}":{x:338,y:259},"\\mathcal{S}":{x:375,y:259},"\\mathcal{T}":{x:412,y:259},"\\mathcal{U}":{x:449,y:259},"\\mathcal{V}":{x:486,y:259},"\\mathcal{W}":{x:523,y:259},"\\mathcal{X}":{x:560,y:259},"\\mathcal{Y}":{x:597,y:259},"\\mathcal{Z}":{x:634,y:259},"\\mathfrak{A}":{x:671,y:259},"\\mathfrak{B}":{x:708,y:259},"\\mathfrak{C}":{x:745,y:259},"\\mathfrak{D}":{x:782,y:259},"\\mathfrak{E}":{x:819,y:259},"\\mathfrak{F}":{x:856,y:259},"\\mathfrak{G}":{x:893,y:259},"\\mathfrak{H}":{x:930,y:259},"\\mathfrak{I}":{x:967,y:259},"\\mathfrak{J}":{x:1004,y:259},"\\mathfrak{K}":{x:1041,y:259},"\\mathfrak{L}":{x:1078,y:259},"\\mathfrak{M}":{x:5,y:296},"\\mathfrak{N}":{x:42,y:296},"\\mathfrak{O}":{x:79,y:296},"\\mathfrak{P}":{x:116,y:296},"\\mathfrak{Q}":{x:153,y:296},"\\mathfrak{R}":{x:190,y:296},"\\mathfrak{S}":{x:227,y:296},"\\mathfrak{T}":{x:264,y:296},"\\mathfrak{U}":{x:301,y:296},"\\mathfrak{V}":{x:338,y:296},"\\mathfrak{W}":{x:375,y:296},"\\mathfrak{X}":{x:412,y:296},"\\mathfrak{Y}":{x:449,y:296},"\\mathfrak{Z}":{x:486,y:296},"\\mathfrak{a}":{x:523,y:296},"\\mathfrak{b}":{x:560,y:296},"\\mathfrak{c}":{x:597,y:296},"\\mathfrak{d}":{x:634,y:296},"\\mathfrak{e}":{x:671,y:296},"\\mathfrak{f}":{x:708,y:296},"\\mathfrak{g}":{x:745,y:296},"\\mathfrak{h}":{x:782,y:296},"\\mathfrak{i}":{x:819,y:296},"\\mathfrak{j}":{x:856,y:296},"\\mathfrak{k}":{x:893,y:296},"\\mathfrak{l}":{x:930,y:296},"\\mathfrak{m}":{x:967,y:296},"\\mathfrak{n}":{x:1004,y:296},"\\mathfrak{o}":{x:1041,y:296},"\\mathfrak{p}":{x:1078,y:296},"\\mathfrak{q}":{x:5,y:333},"\\mathfrak{r}":{x:42,y:333},"\\mathfrak{s}":{x:79,y:333},"\\mathfrak{t}":{x:116,y:333},"\\mathfrak{u}":{x:153,y:333},"\\mathfrak{v}":{x:190,y:333},"\\mathfrak{w}":{x:227,y:333},"\\mathfrak{x}":{x:264,y:333},"\\mathfrak{y}":{x:301,y:333},"\\mathfrak{z}":{x:338,y:333},"\\mathbb{A}":{x:375,y:333},"\\mathbb{B}":{x:412,y:333},"\\mathbb{C}":{x:449,y:333},"\\mathbb{D}":{x:486,y:333},"\\mathbb{E}":{x:523,y:333},"\\mathbb{F}":{x:560,y:333},"\\mathbb{G}":{x:597,y:333},"\\mathbb{H}":{x:634,y:333},"\\mathbb{I}":{x:671,y:333},"\\mathbb{J}":{x:708,y:333},"\\mathbb{K}":{x:745,y:333},"\\mathbb{L}":{x:782,y:333},"\\mathbb{M}":{x:819,y:333},"\\mathbb{N}":{x:856,y:333},"\\mathbb{O}":{x:893,y:333},"\\mathbb{P}":{x:930,y:333},"\\mathbb{Q}":{x:967,y:333},"\\mathbb{R}":{x:1004,y:333},"\\mathbb{S}":{x:1041,y:333},"\\mathbb{T}":{x:1078,y:333},"\\mathbb{U}":{x:5,y:370},"\\mathbb{V}":{x:42,y:370},"\\mathbb{W}":{x:79,y:370},"\\mathbb{X}":{x:116,y:370},"\\mathbb{Y}":{x:153,y:370},"\\mathbb{Z}":{x:190,y:370},"\\mathrm{A}":{x:227,y:370},"\\mathrm{B}":{x:264,y:370},"\\mathrm{C}":{x:301,y:370},"\\mathrm{D}":{x:338,y:370},"\\mathrm{E}":{x:375,y:370},"\\mathrm{F}":{x:412,y:370},"\\mathrm{G}":{x:449,y:370},"\\mathrm{H}":{x:486,y:370},"\\mathrm{I}":{x:523,y:370},"\\mathrm{J}":{x:560,y:370},"\\mathrm{K}":{x:597,y:370},"\\mathrm{L}":{x:634,y:370},"\\mathrm{M}":{x:671,y:370},"\\mathrm{N}":{x:708,y:370},"\\mathrm{O}":{x:745,y:370},"\\mathrm{P}":{x:782,y:370},"\\mathrm{Q}":{x:819,y:370},"\\mathrm{R}":{x:856,y:370},"\\mathrm{S}":{x:893,y:370},"\\mathrm{T}":{x:930,y:370},"\\mathrm{U}":{x:967,y:370},"\\mathrm{V}":{x:1004,y:370},"\\mathrm{W}":{x:1041,y:370},"\\mathrm{X}":{x:1078,y:370},"\\mathrm{Y}":{x:5,y:407},"\\mathrm{Z}":{x:42,y:407},"\\mathrm{a}":{x:79,y:407},"\\mathrm{b}":{x:116,y:407},"\\mathrm{c}":{x:153,y:407},"\\mathrm{d}":{x:190,y:407},"\\mathrm{e}":{x:227,y:407},"\\mathrm{f}":{x:264,y:407},"\\mathrm{g}":{x:301,y:407},"\\mathrm{h}":{x:338,y:407},"\\mathrm{i}":{x:375,y:407},"\\mathrm{j}":{x:412,y:407},"\\mathrm{k}":{x:449,y:407},"\\mathrm{l}":{x:486,y:407},"\\mathrm{m}":{x:523,y:407},"\\mathrm{n}":{x:560,y:407},"\\mathrm{o}":{x:597,y:407},"\\mathrm{p}":{x:634,y:407},"\\mathrm{q}":{x:671,y:407},"\\mathrm{r}":{x:708,y:407},"\\mathrm{s}":{x:745,y:407},"\\mathrm{t}":{x:782,y:407},"\\mathrm{u}":{x:819,y:407},"\\mathrm{v}":{x:856,y:407},"\\mathrm{w}":{x:893,y:407},"\\mathrm{x}":{x:930,y:407},"\\mathrm{y}":{x:967,y:407},"\\mathrm{z}":{x:1004,y:407}}}},b[31]={value:function(){var a=b.r(4),c=b.r(20),d={min:1,max:2},e=c.createClass("ScrollZoomController",{constructor:function(b,c,e,f){this.kfEditor=c,this.target=e,this.zoom=1,this.step=.05,this.options=a.extend({},d,f),this.initEvent()},initEvent:function(){var b=this.kfEditor,c=this,d=this.options.min,e=this.options.max,f=this.step;a.addEvent(this.target,"mousewheel",function(a){a.preventDefault(),a.wheelDelta<0?c.zoom-=c.zoom*f:c.zoom+=c.zoom*f,c.zoom=Math.max(c.zoom,d),c.zoom=Math.min(c.zoom,e),b.requestService("render.set.canvas.zoom",c.zoom)})}});return e}},b[32]={value:function(){return{VIEW_STATE:{NO_OVERFLOW:0,OVERFLOW:1},scrollbar:{step:50,thumbMinSize:50}}}},b[33]={value:function(){return{"x=\\frac {-b\\pm\\sqrt {b^2-4ac}}{2a}":{pos:{x:0,y:0},size:{width:310,height:73}},"{\\placeholder/\\placeholder}":{pos:{x:315,y:0},size:{width:56,height:75}},"\\frac \\placeholder\\placeholder":{pos:{x:376,y:0},size:{width:56,height:75}},"a^2+b^2=c^2":{pos:{x:437,y:0},size:{width:310,height:73}},"{\\left(x+a\\right)}^2=\\sum^n_{k=0}{\\left(^n_k\\right)x^ka^{n-k}}":{pos:{x:752,y:0},size:{width:310,height:73}},"\\frac {dy}{dx}":{pos:{x:1067,y:0},size:{width:56,height:75}},"\\frac {\\Delta y}{\\Delta x}":{pos:{x:1128,y:0},size:{width:56,height:75}},"\\frac {\\delta y}{\\delta x}":{pos:{x:1189,y:0},size:{width:56,height:75}},"\\frac \\pi 2":{pos:{x:1250,y:0},size:{width:56,height:75}},"\\placeholder^\\placeholder":{pos:{x:1311,y:0},size:{width:56,height:75}},"\\placeholder^\\placeholder_\\placeholder":{pos:{x:1372,y:0},size:{width:56,height:75}},"\\placeholder_\\placeholder":{pos:{x:1433,y:0},size:{width:56,height:75}},"{^\\placeholder_\\placeholder\\placeholder}":{pos:{x:1494,y:0},size:{width:56,height:75}},"e^{-i\\omega t}":{pos:{x:1555,y:0},size:{width:56,height:75}},"x^2":{pos:{x:1616,y:0},size:{width:56,height:75}},"{}^n_1Y":{pos:{x:1677,y:0},size:{width:56,height:75}},"\\sqrt \\placeholder":{pos:{x:1738,y:0},size:{width:56,height:75}},"\\sqrt [\\placeholder] \\placeholder":{pos:{x:1799,y:0},size:{width:56,height:75}},"\\sqrt [2] \\placeholder":{pos:{x:1860,y:0},size:{width:56,height:75}},"\\sqrt [3] \\placeholder":{pos:{x:1921,y:0},size:{width:56,height:75}},"\\frac {-b\\pm\\sqrt{b^2-4ac}}{2a}":{pos:{x:1982,y:0},size:{width:137,height:75}},"\\sqrt {a^2+b^2}":{pos:{x:2124,y:0},size:{width:137,height:75}},"\\int \\placeholder":{pos:{x:2266,y:0},size:{width:56,height:75}},"\\int^\\placeholder_\\placeholder\\placeholder":{pos:{x:2327,y:0},size:{width:56,height:75}},"\\iint\\placeholder":{pos:{x:2388,y:0},size:{width:56,height:75}},"\\iint^\\placeholder_\\placeholder\\placeholder":{pos:{x:2449,y:0},size:{width:56,height:75}},"\\iiint\\placeholder":{pos:{x:2510,y:0},size:{width:56,height:75}},"\\iiint^\\placeholder_\\placeholder\\placeholder":{pos:{x:2571,y:0},size:{width:56,height:75}},"\\sum\\placeholder":{pos:{x:2632,y:0},size:{width:56,height:75}},"\\sum^\\placeholder_\\placeholder\\placeholder":{pos:{x:2693,y:0},size:{width:56,height:75}},"\\sum_\\placeholder\\placeholder":{pos:{x:2754,y:0},size:{width:56,height:75}},"\\left(\\placeholder\\right)":{pos:{x:2815,y:0},size:{width:56,height:75}},"\\left[\\placeholder\\right]":{pos:{x:2876,y:0},size:{width:56,height:75}},"\\left\\{\\placeholder\\right\\}":{pos:{x:2937,y:0},size:{width:56,height:75}},"\\left|\\placeholder\\right|":{pos:{x:2998,y:0},size:{width:56,height:75}},"\\sin\\placeholder":{pos:{x:3059,y:0},size:{width:56,height:75}},"\\cos\\placeholder":{pos:{x:3120,y:0},size:{width:56,height:75}},"\\tan\\placeholder":{pos:{x:3181,y:0},size:{width:56,height:75}},"\\csc\\placeholder":{pos:{x:3242,y:0},size:{width:56,height:75}},"\\sec\\placeholder":{pos:{x:3303,y:0},size:{width:56,height:75}},"\\cot\\placeholder":{pos:{x:3364,y:0},size:{width:56,height:75}},"\\sin\\theta":{pos:{x:3425,y:0},size:{width:56,height:75}},"\\cos{2x}":{pos:{x:3486,y:0},size:{width:56,height:75}},"\\tan\\theta=\\frac {\\sin\\theta}{\\cos\\theta}":{pos:{x:3547,y:0},size:{width:137,height:75}}}}},b[34]={value:function(){function a(a){var b=[],c=a.path,d=a.values;return e.Utils.each(d,function(a){var d=a,e=a;"string"!=typeof a?(d=a.img,e=a.key):e="\\"+a,b.push({item:{show:""+c+d.toLowerCase()+".png",val:e}})}),b}var c=b.r(41),d=b.r(40),e=b.r(20),f=[{type:c.DRAPDOWN_BOX,options:{button:{label:"\u9884\u8bbe
              ",className:"yushe-btn",icon:"assets/images/toolbar/button/fx.png",iconSize:{w:40}},box:{width:367,group:[{title:"\u9884\u8bbe\u516c\u5f0f",items:[{title:"\u9884\u8bbe\u516c\u5f0f",content:[{label:"\u4e8c\u6b21\u516c\u5f0f",item:{show:"assets/images/toolbar/ys/1.png",val:"x=\\frac {-b\\pm\\sqrt {b^2-4ac}}{2a}"}},{label:"\u4e8c\u9879\u5f0f\u5b9a\u7406",item:{show:"assets/images/toolbar/ys/2.png",val:"{\\left(x+a\\right)}^2=\\sum^n_{k=0}{\\left(^n_k\\right)x^ka^{n-k}}"}},{label:"\u52fe\u80a1\u5b9a\u7406",item:{show:"assets/images/toolbar/ys/3.png",val:"a^2+b^2=c^2"}}]}]}]}}},{type:c.DELIMITER},{type:c.AREA,options:{box:{fixOffset:!0,width:527,type:d.OVERLAP,group:[{title:"\u57fa\u7840\u6570\u5b66",items:[]},{title:"\u5e0c\u814a\u5b57\u6bcd",items:[]},{title:"\u6c42\u53cd\u5173\u7cfb\u8fd0\u7b97\u7b26",items:[]},{title:"\u5b57\u6bcd\u7c7b\u7b26\u53f7",items:[]},{title:"\u7bad\u5934",items:[]},{title:"\u624b\u5199\u4f53",items:[]}]}}},{type:c.DELIMITER},{type:c.DRAPDOWN_BOX,options:{button:{label:"\u5206\u6570
              ",icon:"assets/images/toolbar/button/frac.png"},box:{width:332,group:[{title:"\u5206\u6570",items:[{title:"\u5206\u6570",content:[{item:{show:"assets/images/toolbar/frac/1.png",val:"\\frac \\placeholder\\placeholder"}},{item:{show:"assets/images/toolbar/frac/2.png",val:"{\\placeholder/\\placeholder}"}}]},{title:"\u5e38\u7528\u5206\u6570",content:[{item:{show:"assets/images/toolbar/frac/c1.png",val:"\\frac {dy}{dx}"}},{item:{show:"assets/images/toolbar/frac/c2.png",val:"\\frac {\\Delta y}{\\Delta x}"}},{item:{show:"assets/images/toolbar/frac/c4.png",val:"\\frac {\\delta y}{\\delta x}"}},{item:{show:"assets/images/toolbar/frac/c5.png",val:"\\frac \\pi 2"}}]}]}]}}},{type:c.DRAPDOWN_BOX,options:{button:{label:"\u4e0a\u4e0b\u6807
              ",icon:"assets/images/toolbar/button/script.png"},box:{width:332,group:[{title:"\u4e0a\u6807\u548c\u4e0b\u6807",items:[{title:"\u4e0a\u6807\u548c\u4e0b\u6807",content:[{item:{show:"assets/images/toolbar/script/1.png",val:"\\placeholder^\\placeholder"}},{item:{show:"assets/images/toolbar/script/2.png",val:"\\placeholder_\\placeholder"}},{item:{show:"assets/images/toolbar/script/3.png",val:"\\placeholder^\\placeholder_\\placeholder"}},{item:{show:"assets/images/toolbar/script/4.png",val:"{^\\placeholder_\\placeholder\\placeholder}"}}]},{title:"\u5e38\u7528\u7684\u4e0a\u6807\u548c\u4e0b\u6807",content:[{item:{show:"assets/images/toolbar/script/c1.png",val:"e^{-i\\omega t}"}},{item:{show:"assets/images/toolbar/script/c2.png",val:"x^2"}},{item:{show:"assets/images/toolbar/script/c3.png",val:"{}^n_1Y"}}]}]}]}}},{type:c.DRAPDOWN_BOX,options:{button:{label:"\u6839\u5f0f
              ",icon:"assets/images/toolbar/button/sqrt.png"},box:{width:342,group:[{title:"\u6839\u5f0f",items:[{title:"\u6839\u5f0f",content:[{item:{show:"assets/images/toolbar/sqrt/1.png",val:"\\sqrt \\placeholder"}},{item:{show:"assets/images/toolbar/sqrt/2.png",val:"\\sqrt [\\placeholder] \\placeholder"}},{item:{show:"assets/images/toolbar/sqrt/3.png",val:"\\sqrt [2] \\placeholder"}},{item:{show:"assets/images/toolbar/sqrt/4.png",val:"\\sqrt [3] \\placeholder"}}]},{title:"\u5e38\u7528\u6839\u5f0f",content:[{item:{show:"assets/images/toolbar/sqrt/c1.png",val:"\\frac {-b\\pm\\sqrt{b^2-4ac}}{2a}"}},{item:{show:"assets/images/toolbar/sqrt/c2.png",val:"\\sqrt {a^2+b^2}"}}]}]}]}}},{type:c.DRAPDOWN_BOX,options:{button:{label:"\u79ef\u5206
              ",icon:"assets/images/toolbar/button/int.png"},box:{width:332,group:[{title:"\u79ef\u5206",items:[{title:"\u79ef\u5206",content:[{item:{show:"assets/images/toolbar/int/1.png",val:"\\int \\placeholder"}},{item:{show:"assets/images/toolbar/int/2.png",val:"\\int^\\placeholder_\\placeholder\\placeholder"}},{item:{show:"assets/images/toolbar/int/3.png",val:"\\iint\\placeholder"}},{item:{show:"assets/images/toolbar/int/4.png",val:"\\iint^\\placeholder_\\placeholder\\placeholder"}},{item:{show:"assets/images/toolbar/int/5.png",val:"\\iiint\\placeholder"}},{item:{show:"assets/images/toolbar/int/6.png",val:"\\iiint^\\placeholder_\\placeholder\\placeholder"}}]}]}]}}},{type:c.DRAPDOWN_BOX,options:{button:{label:"\u5927\u578b
              \u8fd0\u7b97\u7b26",icon:"assets/images/toolbar/button/sum.png"},box:{width:332,group:[{title:"\u6c42\u548c",items:[{title:"\u6c42\u548c",content:[{item:{show:"assets/images/toolbar/large/1.png",val:"\\sum\\placeholder"}},{item:{show:"assets/images/toolbar/large/2.png",val:"\\sum^\\placeholder_\\placeholder\\placeholder"}},{item:{show:"assets/images/toolbar/large/3.png",val:"\\sum_\\placeholder\\placeholder"}}]}]}]}}},{type:c.DRAPDOWN_BOX,options:{button:{label:"\u62ec\u53f7
              ",icon:"assets/images/toolbar/button/brackets.png"},box:{width:332,group:[{title:"\u65b9\u62ec\u53f7",items:[{title:"\u65b9\u62ec\u53f7",content:[{item:{show:"assets/images/toolbar/brackets/1.png",val:"\\left(\\placeholder\\right)"}},{item:{show:"assets/images/toolbar/brackets/2.png",val:"\\left[\\placeholder\\right]"}},{item:{show:"assets/images/toolbar/brackets/3.png",val:"\\left\\{\\placeholder\\right\\}"}},{item:{show:"assets/images/toolbar/brackets/4.png",val:"\\left|\\placeholder\\right|"}}]}]}]}}},{type:c.DRAPDOWN_BOX,options:{button:{label:"\u51fd\u6570
              ",icon:"assets/images/toolbar/button/sin.png"},box:{width:340,group:[{title:"\u51fd\u6570",items:[{title:"\u4e09\u89d2\u51fd\u6570",content:[{item:{show:"assets/images/toolbar/func/1.png",val:"\\sin\\placeholder"}},{item:{show:"assets/images/toolbar/func/2.png",val:"\\cos\\placeholder"}},{item:{show:"assets/images/toolbar/func/3.png",val:"\\tan\\placeholder"}},{item:{show:"assets/images/toolbar/func/4.png",val:"\\csc\\placeholder"}},{item:{show:"assets/images/toolbar/func/5.png",val:"\\sec\\placeholder"}},{item:{show:"assets/images/toolbar/func/6.png",val:"\\cot\\placeholder"}}]},{title:"\u5e38\u7528\u51fd\u6570",content:[{item:{show:"assets/images/toolbar/func/c1.png",val:"\\sin\\theta"}},{item:{show:"assets/images/toolbar/func/c2.png",val:"\\sin{2x}"}},{item:{show:"assets/images/toolbar/func/c3.png",val:"\\tan\\theta=\\frac {\\sin\\theta}{\\cos\\theta}"}}]}]}]}}}]; +return function(){var b=["pm","infty",{key:"=",img:"eq"},"sim","times","div",{key:"!",img:"tanhao"},{key:"<",img:"lt"},"ll",{key:">",img:"gt"},"gg","leq","geq","mp","cong","equiv","propto","approx","forall","partial","surd","cup","cap","varnothing",{key:"%",img:"baifenhao"},"circ","exists","nexists","in","ni","gets","uparrow","to","downarrow","leftrightarrow","therefore","because",{key:"+",img:"plus"},{key:"-",img:"minus"},"neg","ast","cdot","vdots","ddots","aleph","beth","blacksquare"],c=f[2].options.box.group[0].items;c.push({title:"\u57fa\u7840\u6570\u5b66",content:a({path:"assets/images/toolbar/char/math/",values:b})})}(),function(){var b=[{title:"\u5c0f\u5199",values:["alpha","beta","gamma","delta","epsilon","zeta","eta","theta","iota","kappa","lambda","mu","nu","xi","omicron","pi","rho","sigma","tau","upsilon","phi","chi","psi","omega"]},{title:"\u5927\u5199",values:["Alpha","Beta","Gamma","Delta","Epsilon","Zeta","Eta","Theta","Iota","Kappa","Lambda","Mu","Nu","Xi","Omicron","Pi","Rho","Sigma","Tau","Upsilon","Phi","Chi","Psi","Omega"]},{title:"\u53d8\u4f53",values:["digamma","varepsilon","varkappa","varphi","varpi","varrho","varsigma","vartheta"]}],c=f[2].options.box.group[1].items;c.push({title:b[0].title,content:a({path:"assets/images/toolbar/char/greek/lower/",values:b[0].values})}),c.push({title:b[1].title,content:a({path:"assets/images/toolbar/char/greek/upper/",values:b[1].values})}),c.push({title:b[2].title,content:a({path:"assets/images/toolbar/char/greek/misc/",values:b[2].values})})}(),function(){var b=[{title:"\u6c42\u53cd\u5173\u7cfb\u8fd0\u7b97\u7b26",values:["neq","nless","ngtr","nleq","ngeq","nsim","lneqq","gneqq","nprec","nsucc","notin","nsubseteq","nsupseteq","subsetneq","supsetneq","lnsim","gnsim","precnsim","succnsim","ntriangleleft","ntriangleright","ntrianglelefteq","ntrianglerighteq","nmid","nparallel","nvdash",{key:"\\nVdash",img:"nvdash-1"},{key:"\\nvDash",img:"nvdash-2"},{key:"\\nVDash",img:"nvdash-3"},"nexists"]}],c=f[2].options.box.group[2].items;c.push({title:b[0].title,content:a({path:"assets/images/toolbar/char/not/",values:b[0].values})})}(),function(){var b=["aleph","beth","daleth","gimel","complement","ell","eth","hbar","hslash","mho","partial","wp","circledS","Bbbk","Finv","Game","Im","Re"],c=f[2].options.box.group[3].items;c.push({title:"\u5b57\u6bcd\u7c7b\u7b26\u53f7",content:a({path:"assets/images/toolbar/alphabetic/",values:b})})}(),function(){var b=["gets","to","uparrow","downarrow","leftrightarrow","updownarrow",{key:"\\Leftarrow",img:"u-leftarrow"},{key:"\\Rightarrow",img:"u-rightarrow"},{key:"\\Uparrow",img:"u-uparrow"},{key:"\\Downarrow",img:"u-downarrow"},{key:"\\Leftrightarrow",img:"u-leftrightarrow"},{key:"\\Updownarrow",img:"u-updownarrow"},"longleftarrow","longrightarrow","longleftrightarrow",{key:"\\Longleftarrow",img:"u-longleftarrow"},{key:"\\Longrightarrow",img:"u-longrightarrow"},{key:"\\Longleftrightarrow",img:"u-longleftrightarrow"},"nearrow","nwarrow","searrow","swarrow","nleftarrow","nrightarrow",{key:"\\nLeftarrow",img:"u-nleftarrow"},{key:"\\nRightarrow",img:"u-nrightarrow"},{key:"\\nLeftrightarrow",img:"u-nleftrightarrow"},"leftharpoonup","leftharpoondown","rightharpoonup","rightharpoondown","upharpoonleft","upharpoonright","downharpoonleft","downharpoonright","leftrightharpoons","rightleftharpoons","leftleftarrows","rightrightarrows","upuparrows","downdownarrows","leftrightarrows","rightleftarrows","looparrowleft","looparrowright","leftarrowtail","rightarrowtail",{key:"\\Lsh",img:"u-lsh"},{key:"\\Rsh",img:"u-rsh"},{key:"\\Lleftarrow",img:"u-lleftarrow"},{key:"\\Rrightarrow",img:"u-rrightarrow"},"curvearrowleft","curvearrowright","circlearrowleft","circlearrowright","multimap","leftrightsquigarrow","twoheadleftarrow","twoheadrightarrow","rightsquigarrow"],c=f[2].options.box.group[4].items;c.push({title:"\u7bad\u5934",content:a({path:"assets/images/toolbar/arrow/",values:b})})}(),function(){var b=[{title:"\u624b\u5199\u4f53",values:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]},{title:"\u82b1\u4f53",values:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]},{title:"\u53cc\u7ebf",values:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]},{title:"\u7f57\u9a6c",values:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]}],c=f[2].options.box.group[5].items;e.Utils.each(b[0].values,function(a,c){b[0].values[c]={key:"\\mathcal{"+a+"}",img:a.toLowerCase()}}),e.Utils.each(b[1].values,function(a,c){b[1].values[c]={key:"\\mathfrak{"+a+"}",img:a.replace(/[A-Z]/,function(a){return"u"+a.toLowerCase()})}}),e.Utils.each(b[2].values,function(a,c){b[2].values[c]={key:"\\mathbb{"+a+"}",img:a.toLowerCase()}}),e.Utils.each(b[3].values,function(a,c){b[3].values[c]={key:"\\mathrm{"+a+"}",img:a.replace(/[A-Z]/,function(a){return"u"+a.toLowerCase()})}}),c.push({title:b[0].title,content:a({path:"assets/images/toolbar/char/cal/",values:b[0].values})}),c.push({title:b[1].title,content:a({path:"assets/images/toolbar/char/frak/",values:b[1].values})}),c.push({title:b[2].title,content:a({path:"assets/images/toolbar/char/bb/",values:b[2].values})}),c.push({title:b[3].title,content:a({path:"assets/images/toolbar/char/rm/",values:b[3].values})})}(),window.iconConfig=f,f}},b[35]={value:function(){function a(a,b){var c=[];return g.Utils.each(a,function(a){a.length>1&&(a="\\"+a),c.push({key:a,img:b,pos:e[a]})}),c}var c=b.r(41),d=b.r(40),e=b.r(30),f=b.r(33),g=b.r(20),h=[{type:c.DRAPDOWN_BOX,options:{button:{label:"\u9884\u8bbe
              ",className:"yushe-btn",icon:{src:"kityformula/assets/images/toolbar/btn.png",x:0,y:0},iconSize:{w:40}},box:{width:367,group:[{title:"\u9884\u8bbe\u516c\u5f0f",items:[{title:"\u9884\u8bbe\u516c\u5f0f",content:[{label:"\u4e8c\u6b21\u516c\u5f0f",item:{val:"x=\\frac {-b\\pm\\sqrt {b^2-4ac}}{2a}"}},{label:"\u4e8c\u9879\u5f0f\u5b9a\u7406",item:{val:"{\\left(x+a\\right)}^2=\\sum^n_{k=0}{\\left(^n_k\\right)x^ka^{n-k}}"}},{label:"\u52fe\u80a1\u5b9a\u7406",item:{val:"a^2+b^2=c^2"}}]}]}]}}},{type:c.DELIMITER},{type:c.AREA,options:{box:{fixOffset:!0,width:527,type:d.OVERLAP,group:[{title:"\u57fa\u7840\u6570\u5b66",items:[]},{title:"\u5e0c\u814a\u5b57\u6bcd",items:[]},{title:"\u6c42\u53cd\u5173\u7cfb\u8fd0\u7b97\u7b26",items:[]},{title:"\u5b57\u6bcd\u7c7b\u7b26\u53f7",items:[]},{title:"\u7bad\u5934",items:[]},{title:"\u624b\u5199\u4f53",items:[]}]}}},{type:c.DELIMITER},{type:c.DRAPDOWN_BOX,options:{button:{label:"\u5206\u6570
              ",icon:{src:"kityformula/assets/images/toolbar/btn.png",x:45,y:0}},box:{width:332,group:[{title:"\u5206\u6570",items:[{title:"\u5206\u6570",content:[{item:{val:"\\frac \\placeholder\\placeholder"}},{item:{val:"{\\placeholder/\\placeholder}"}}]},{title:"\u5e38\u7528\u5206\u6570",content:[{item:{val:"\\frac {dy}{dx}"}},{item:{val:"\\frac {\\Delta y}{\\Delta x}"}},{item:{val:"\\frac {\\delta y}{\\delta x}"}},{item:{val:"\\frac \\pi 2"}}]}]}]}}},{type:c.DRAPDOWN_BOX,options:{button:{label:"\u4e0a\u4e0b\u6807
              ",icon:{src:"kityformula/assets/images/toolbar/btn.png",x:82,y:0}},box:{width:332,group:[{title:"\u4e0a\u6807\u548c\u4e0b\u6807",items:[{title:"\u4e0a\u6807\u548c\u4e0b\u6807",content:[{item:{val:"\\placeholder^\\placeholder"}},{item:{val:"\\placeholder_\\placeholder"}},{item:{val:"\\placeholder^\\placeholder_\\placeholder"}},{item:{val:"{^\\placeholder_\\placeholder\\placeholder}"}}]},{title:"\u5e38\u7528\u7684\u4e0a\u6807\u548c\u4e0b\u6807",content:[{item:{val:"e^{-i\\omega t}"}},{item:{val:"x^2"}},{item:{val:"{}^n_1Y"}}]}]}]}}},{type:c.DRAPDOWN_BOX,options:{button:{label:"\u6839\u5f0f
              ",icon:{src:"kityformula/assets/images/toolbar/btn.png",x:119,y:0}},box:{width:342,group:[{title:"\u6839\u5f0f",items:[{title:"\u6839\u5f0f",content:[{item:{val:"\\sqrt \\placeholder"}},{item:{val:"\\sqrt [\\placeholder] \\placeholder"}},{item:{val:"\\sqrt [2] \\placeholder"}},{item:{val:"\\sqrt [3] \\placeholder"}}]},{title:"\u5e38\u7528\u6839\u5f0f",content:[{item:{val:"\\frac {-b\\pm\\sqrt{b^2-4ac}}{2a}"}},{item:{val:"\\sqrt {a^2+b^2}"}}]}]}]}}},{type:c.DRAPDOWN_BOX,options:{button:{label:"\u79ef\u5206
              ",icon:{src:"kityformula/assets/images/toolbar/btn.png",x:156,y:0}},box:{width:332,group:[{title:"\u79ef\u5206",items:[{title:"\u79ef\u5206",content:[{item:{val:"\\int \\placeholder"}},{item:{val:"\\int^\\placeholder_\\placeholder\\placeholder"}},{item:{val:"\\iint\\placeholder"}},{item:{val:"\\iint^\\placeholder_\\placeholder\\placeholder"}},{item:{val:"\\iiint\\placeholder"}},{item:{val:"\\iiint^\\placeholder_\\placeholder\\placeholder"}}]}]}]}}},{type:c.DRAPDOWN_BOX,options:{button:{label:"\u5927\u578b
              \u8fd0\u7b97\u7b26",icon:{src:"kityformula/assets/images/toolbar/btn.png",x:193,y:0}},box:{width:332,group:[{title:"\u6c42\u548c",items:[{title:"\u6c42\u548c",content:[{item:{val:"\\sum\\placeholder"}},{item:{val:"\\sum^\\placeholder_\\placeholder\\placeholder"}},{item:{val:"\\sum_\\placeholder\\placeholder"}}]}]}]}}},{type:c.DRAPDOWN_BOX,options:{button:{label:"\u62ec\u53f7
              ",icon:{src:"kityformula/assets/images/toolbar/btn.png",x:230,y:0}},box:{width:332,group:[{title:"\u65b9\u62ec\u53f7",items:[{title:"\u65b9\u62ec\u53f7",content:[{item:{val:"\\left(\\placeholder\\right)"}},{item:{val:"\\left[\\placeholder\\right]"}},{item:{val:"\\left\\{\\placeholder\\right\\}"}},{item:{val:"\\left|\\placeholder\\right|"}}]}]}]}}},{type:c.DRAPDOWN_BOX,options:{button:{label:"\u51fd\u6570
              ",icon:{src:"kityformula/assets/images/toolbar/btn.png",x:267,y:0}},box:{width:340,group:[{title:"\u51fd\u6570",items:[{title:"\u4e09\u89d2\u51fd\u6570",content:[{item:{val:"\\sin\\placeholder"}},{item:{val:"\\cos\\placeholder"}},{item:{val:"\\tan\\placeholder"}},{item:{val:"\\csc\\placeholder"}},{item:{val:"\\sec\\placeholder"}},{item:{val:"\\cot\\placeholder"}}]},{title:"\u5e38\u7528\u51fd\u6570",content:[{item:{val:"\\sin\\theta"}},{item:{val:"\\cos{2x}"}},{item:{val:"\\tan\\theta=\\frac {\\sin\\theta}{\\cos\\theta}"}}]}]}]}}}];return function(){var a=[],b="kityformula/assets/images/toolbar/other.png",d=[];g.Utils.each(h,function(b){b.type!==c.DELIMITER&&(b=b.options.box.group,a=a.concat(b))}),g.Utils.each(a,function(a){a=a.items;for(var b=0,c=a.length;c>b;b++)d=d.concat(a[b].content)}),g.Utils.each(d,function(a){var c=f[a.item.val];c&&(a.item.img=b,a.item.pos=c.pos,a.item.size=c.size)})}(),function(){var b=["pm","infty","=","sim","times","div","!","<","ll",">","gg","leq","geq","mp","cong","equiv","propto","approx","forall","partial","surd","cup","cap","varnothing","%","circ","exists","nexists","in","ni","gets","uparrow","to","downarrow","leftrightarrow","therefore","because","+","-","neg","ast","cdot","vdots","aleph","beth","blacksquare"],c=h[2].options.box.group[0].items;c.push({title:"\u57fa\u7840\u6570\u5b66",content:a(b,"kityformula/assets/images/toolbar/char.png")})}(),function(){var b=[{title:"\u5c0f\u5199",values:["alpha","beta","gamma","delta","epsilon","zeta","eta","theta","iota","kappa","lambda","mu","nu","xi","omicron","pi","rho","sigma","tau","upsilon","phi","chi","psi","omega"]},{title:"\u5927\u5199",values:["Alpha","Beta","Gamma","Delta","Epsilon","Zeta","Eta","Theta","Iota","Kappa","Lambda","Mu","Nu","Xi","Omicron","Pi","Rho","Sigma","Tau","Upsilon","Phi","Chi","Psi","Omega"]},{title:"\u53d8\u4f53",values:["digamma","varepsilon","varkappa","varphi","varpi","varrho","varsigma","vartheta"]}],c=h[2].options.box.group[1].items;c.push({title:b[0].title,content:a(b[0].values,"kityformula/assets/images/toolbar/char.png")}),c.push({title:b[1].title,content:a(b[1].values,"kityformula/assets/images/toolbar/char.png")}),c.push({title:b[2].title,content:a(b[2].values,"kityformula/assets/images/toolbar/char.png")})}(),function(){var b=[{title:"\u6c42\u53cd\u5173\u7cfb\u8fd0\u7b97\u7b26",values:["neq","nless","ngtr","nleq","ngeq","nsim","lneqq","gneqq","nprec","nsucc","notin","nsubseteq","nsupseteq","subsetneq","supsetneq","lnsim","gnsim","precnsim","succnsim","ntriangleleft","ntriangleright","ntrianglelefteq","ntrianglerighteq","nmid","nparallel","nvdash","nVdash","nvDash","nVDash","nexists"]}],c=h[2].options.box.group[2].items;c.push({title:b[0].title,content:a(b[0].values,"kityformula/assets/images/toolbar/char.png")})}(),function(){var b=["aleph","beth","daleth","gimel","complement","ell","eth","hbar","hslash","mho","partial","wp","circledS","Bbbk","Finv","Game","Im","Re"],c=h[2].options.box.group[3].items;c.push({title:"\u5b57\u6bcd\u7c7b\u7b26\u53f7",content:a(b,"kityformula/assets/images/toolbar/char.png")})}(),function(){var b=["gets","to","uparrow","downarrow","leftrightarrow","updownarrow","Leftarrow","Rightarrow","Uparrow","Downarrow","Leftrightarrow","Updownarrow","longleftarrow","longrightarrow","longleftrightarrow","Longleftarrow","Longrightarrow","Longleftrightarrow","nearrow","nwarrow","searrow","swarrow","nleftarrow","nrightarrow","nLeftarrow","nRightarrow","nLeftrightarrow","leftharpoonup","leftharpoondown","rightharpoonup","rightharpoondown","upharpoonleft","upharpoonright","downharpoonleft","downharpoonright","leftrightharpoons","rightleftharpoons","leftleftarrows","rightrightarrows","upuparrows","downdownarrows","leftrightarrows","rightleftarrows","looparrowleft","looparrowright","leftarrowtail","rightarrowtail","Lsh","Rsh","Lleftarrow","Rrightarrow","curvearrowleft","curvearrowright","circlearrowleft","circlearrowright","multimap","leftrightsquigarrow","twoheadleftarrow","twoheadrightarrow","rightsquigarrow"],c=h[2].options.box.group[4].items;c.push({title:"\u7bad\u5934",content:a(b,"kityformula/assets/images/toolbar/char.png")})}(),function(){var b=[{title:"\u624b\u5199\u4f53",values:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]},{title:"\u82b1\u4f53",values:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]},{title:"\u53cc\u7ebf",values:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]},{title:"\u7f57\u9a6c",values:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]}],c=h[2].options.box.group[5].items;g.Utils.each(b[0].values,function(a,c){b[0].values[c]="mathcal{"+a+"}"}),g.Utils.each(b[1].values,function(a,c){b[1].values[c]="mathfrak{"+a+"}"}),g.Utils.each(b[2].values,function(a,c){b[2].values[c]="mathbb{"+a+"}"}),g.Utils.each(b[3].values,function(a,c){b[3].values[c]="mathrm{"+a+"}"}),c.push({title:b[0].title,content:a(b[0].values,"kityformula/assets/images/toolbar/char.png")}),c.push({title:b[1].title,content:a(b[1].values,"kityformula/assets/images/toolbar/char.png")}),c.push({title:b[2].title,content:a(b[2].values,"kityformula/assets/images/toolbar/char.png")}),c.push({title:b[3].title,content:a(b[3].values,"kityformula/assets/images/toolbar/char.png")})}(),h}},b[36]={value:function(){function a(a,b,f){switch(a){case i.DRAPDOWN_BOX:return c(b,f);case i.DELIMITER:return d(b);case i.AREA:return e(b,f)}}function c(a,b){return new g.DrapdownBox(a,b)}function d(a){return new g.Delimiter(a)}function e(a,b){return new g.Area(a,b)}var f=b.r(20),g=b.r(48),h=b.r(47),i=b.r(41),j=f.createClass("Tollbar",{constructor:function(a,b,c){this.kfEditor=b,this.uiComponent=a,this.elementList=c,this.elements=[],this.initToolbarElements(),this.initServices(),this.initEvent()},initServices:function(){this.kfEditor.registerService("ui.toolbar.disable",this,{disableToolbar:this.disableToolbar}),this.kfEditor.registerService("ui.toolbar.enable",this,{enableToolbar:this.enableToolbar}),this.kfEditor.registerService("ui.toolbar.close",this,{closeToolbar:this.closeToolbar})},initEvent:function(){var a=this;h.on(this.uiComponent.toolbarContainer,"mousedown",function(a){a.preventDefault()}),h.on(this.uiComponent.toolbarContainer,"mousewheel",function(a){a.preventDefault()}),h.on(this.kfEditor.getContainer(),"mousedown",function(){a.notify("closeAll")}),h.subscribe("data.select",function(b){a.insertSource(b)})},insertSource:function(a){this.kfEditor.requestService("control.insert.string",a)},disableToolbar:function(){f.Utils.each(this.elements,function(a){a.disable&&a.disable()})},enableToolbar:function(){f.Utils.each(this.elements,function(a){a.enable&&a.enable()})},getContainer:function(){return this.kfEditor.requestService("ui.get.canvas.container")},closeToolbar:function(){this.closeElement()},notify:function(a){switch(a){case"closeAll":case"closeOther":return void this.closeElement(arguments[1])}},closeElement:function(a){f.Utils.each(this.elements,function(b){b!=a&&b.hide&&b.hide()})},initToolbarElements:function(){var b=this.elements,c=this.uiComponent.toolbarContainer.ownerDocument,d=this;f.Utils.each(this.elementList,function(e){var f=a(e.type,c,e.options);b.push(f),d.appendElement(f)})},appendElement:function(a){a.setToolbar(this),a.attachTo(this.uiComponent.toolbarContainer)}});return j}},b[37]={value:function(){var a=b.r(20),c="kf-editor-ui-",d=66,e=b.r(47),f=b.r(38),g=a.createClass("Area",{constructor:function(a,b){this.options=b,this.doc=a,this.toolbar=null,this.disabled=!0,this.panelIndex=0,this.maxPanelIndex=0,this.currentItemCount=0,this.lineMaxCount=9,this.element=this.createArea(),this.container=this.createContainer(),this.panel=this.createPanel(),this.buttonContainer=this.createButtonContainer(),this.button=this.createButton(),this.mountPoint=this.createMountPoint(),this.moveDownButton=this.createMoveDownButton(),this.moveUpButton=this.createMoveUpButton(),this.boxObject=this.createBox(),this.mergeElement(),this.mount(),this.setListener(),this.initEvent()},initEvent:function(){var a=this;e.on(this.button,"mousedown",function(b){b.preventDefault(),b.stopPropagation(),1!==b.which||a.disabled||(a.showMount(),a.toolbar.notify("closeOther",a))}),e.on(this.moveDownButton,"mousedown",function(b){b.preventDefault(),b.stopPropagation(),1!==b.which||a.disabled||(a.nextPanel(),a.toolbar.notify("closeOther",a))}),e.on(this.moveUpButton,"mousedown",function(b){b.preventDefault(),b.stopPropagation(),1!==b.which||a.disabled||(a.prevPanel(),a.toolbar.notify("closeOther",a))}),e.delegate(this.container,".kf-editor-ui-area-item","mousedown",function(b){b.preventDefault(),1!==b.which||a.disabled||e.publish("data.select",this.getAttribute("data-value"))}),this.boxObject.initEvent()},disable:function(){this.disabled=!0,this.boxObject.disable(),e.getClassList(this.element).remove(c+"enabled")},enable:function(){this.disabled=!1,this.boxObject.enable(),e.getClassList(this.element).add(c+"enabled")},setListener:function(){var a=this;this.boxObject.setSelectHandler(function(b){e.publish("data.select",b),a.hide()}),this.boxObject.setChangeHandler(function(){a.updateContent()})},createArea:function(){var a=e.ele(this.doc,"div",{className:c+"area"});return"width"in this.options&&(a.style.width=this.options.width+"px"),a},checkMaxPanelIndex:function(){this.maxPanelIndex=Math.ceil(this.currentItemCount/this.lineMaxCount/2)},updateContent:function(){var b=this.boxObject.getOverlapContent(),d=0,e=null,f=0,g=0,h=this.lineMaxCount,i=[];this.panel.innerHTML="",a.Utils.each(b,function(b){var j=b.content;a.Utils.each(j,function(a){f=Math.floor(d/h),g=d%h,d++,e="top: "+(33*f+5)+"px; left: "+(32*g+5)+"px;",i.push('
              ')})}),this.currentItemCount=d,this.panelIndex=0,this.panel.style.top=0,this.panel.innerHTML=i.join(""),this.checkMaxPanelIndex(),this.updatePanelButtonState()},mount:function(){this.boxObject.mountTo(this.mountPoint)},showMount:function(){this.mountPoint.style.display="block",this.boxObject.updateSize()},hideMount:function(){this.mountPoint.style.display="none"},hide:function(){this.hideMount(),this.boxObject.hide()},createButton:function(){return e.ele(this.doc,"div",{className:c+"area-button"})},createMoveDownButton:function(){return e.ele(this.doc,"div",{className:c+"movedown-button",content:""})},createMoveUpButton:function(){return e.ele(this.doc,"div",{className:c+"moveup-button",content:""})},createMountPoint:function(){return e.ele(this.doc,"div",{className:c+"area-mount"})},createBox:function(){return new f(this.doc,this.options.box)},createContainer:function(){return e.ele(this.doc,"div",{className:c+"area-container"})},createPanel:function(){return e.ele(this.doc,"div",{className:c+"area-panel"})},createButtonContainer:function(){return e.ele(this.doc,"div",{className:c+"area-button-container"})},mergeElement:function(){this.buttonContainer.appendChild(this.moveUpButton),this.buttonContainer.appendChild(this.moveDownButton),this.buttonContainer.appendChild(this.button),this.container.appendChild(this.panel),this.element.appendChild(this.container),this.element.appendChild(this.buttonContainer),this.element.appendChild(this.mountPoint)},disablePanelUp:function(){this.disabledUp=!0,e.getClassList(this.moveUpButton).add("kf-editor-ui-disabled")},enablePanelUp:function(){this.disabledUp=!1,e.getClassList(this.moveUpButton).remove("kf-editor-ui-disabled")},disablePanelDown:function(){this.disabledDown=!0,e.getClassList(this.moveDownButton).add("kf-editor-ui-disabled")},enablePanelDown:function(){this.disabledDown=!1,e.getClassList(this.moveDownButton).remove("kf-editor-ui-disabled")},updatePanelButtonState:function(){0===this.panelIndex?this.disablePanelUp():this.enablePanelUp(),this.panelIndex+1>=this.maxPanelIndex?this.disablePanelDown():this.enablePanelDown()},nextPanel:function(){this.disabledDown||this.panelIndex+1>=this.maxPanelIndex||(this.panelIndex++,this.panel.style.top=-this.panelIndex*d+"px",this.updatePanelButtonState())},prevPanel:function(){this.disabledUp||0!==this.panelIndex&&(this.panelIndex--,this.panel.style.top=-this.panelIndex*d+"px",this.updatePanelButtonState())},setToolbar:function(a){this.toolbar=a,this.boxObject.setToolbar(a)},attachTo:function(a){a.appendChild(this.element),this.updateContent(),this.updatePanelButtonState()}});return g}},b[38]={value:function(){function a(a,b,c){var d=[];return h.Utils.each(b,function(b){d.push(new q(c,a,b))}),d}function c(a){return j.ele(a,"div",{className:i+"overlap-container"})}function d(a,b){return new m(a,{className:"overlap-button",label:"",fixOffset:b.fixOffset})}function e(a,b){return new n(a,b)}function f(a){return a.getBoundingClientRect()}function g(a){var b="background: url( "+a.img+" ) no-repeat ";return b+=-a.pos.x+"px ",b+=-a.pos.y+"px;",b+=" width: "+a.size.width+"px;",b+=" height: "+a.size.height+"px;"}var h=b.r(20),i="kf-editor-ui-",j=b.r(47),k=b.r(40),l=b.r(42),m=b.r(39),n=b.r(45),o=20,p=h.createClass("Box",{constructor:function(a,b){this.options=b,this.toolbar=null,this.options.type=this.options.type||k.DETACHED,this.doc=a,this.itemPanels=null,this.overlapButtonObject=null,this.overlapIndex=-1,this.element=this.createBox(),this.groupContainer=this.createGroupContainer(),this.itemGroups=this.createItemGroup(),this.mergeElement()},createBox:function(){var a=j.ele(this.doc,"div",{className:i+"box"});return"width"in this.options&&(a.style.width=this.options.width+"px"),a},setToolbar:function(a){this.toolbar=a,this.overlapButtonObject&&this.overlapButtonObject.setToolbar(a)},updateSize:function(){var a=j.getRectBox(this.toolbar.getContainer()),b=30,c=j.getRectBox(this.element);if(this.options.type===k.DETACHED){if(c.bottom<=a.bottom)return void(this.element.scrollTop=0);this.element.style.height=c.height-(c.bottom-a.bottom+b)+"px"}else{var d=this.getCurrentItemPanel(),e=null;if(d.scrollTop=0,c.bottom<=a.bottom)return;e=f(d),d.style.height=a.bottom-e.top-b+"px"}},initEvent:function(){var a="."+i+"box-item",b=this;j.delegate(this.groupContainer,a,"mousedown",function(a){a.preventDefault(),1===a.which&&b.onselectHandler&&b.onselectHandler(this.getAttribute("data-value"))}),j.on(this.element,"mousedown",function(a){a.stopPropagation(),a.preventDefault()}),j.on(this.element,"mousewheel",function(a){a.preventDefault(),a.stopPropagation(),b.scroll(a.originalEvent.wheelDelta)})},getNode:function(){return this.element},setSelectHandler:function(a){this.onselectHandler=a},scroll:function(a){0>a?this.scrollDown():(this.scrollUp(),this.element.scrollTop-=20)},scrollDown:function(){this.options.type===k.DETACHED?this.element.scrollTop+=o:this.getCurrentItemPanel().scrollTop+=o},scrollUp:function(){this.options.type===k.DETACHED?this.element.scrollTop-=o:this.getCurrentItemPanel().scrollTop-=o},setChangeHandler:function(a){this.onchangeHandler=a},onchangeHandler:function(){},createGroupContainer:function(){return j.ele(this.doc,"div",{className:i+"box-container"})},getPositionInfo:function(){return j.getRectBox(this.element)},createItemGroup:function(){var a=this.createGroup();switch(this.options.type){case k.DETACHED:return a.items[0];case k.OVERLAP:return this.createOverlapGroup(a)}return null},enable:function(){this.overlapButtonObject&&this.overlapButtonObject.enable()},disable:function(){this.overlapButtonObject&&this.overlapButtonObject.disable()},hide:function(){this.overlapButtonObject&&this.overlapButtonObject.hideMount()},getOverlapContent:function(){return this.options.type!==k.OVERLAP?null:this.options.group[this.overlapIndex].items},createOverlapGroup:function(a){var b=a.title,f=this,g=c(this.doc),k=d(this.doc,{fixOffset:this.options.fixOffset}),l=e(this.doc,{width:150,items:b}),m=j.ele(this.doc,"div",{className:i+"wrap-group"});return this.overlapButtonObject=k,k.mount(l),k.initEvent(),l.initEvent(),h.Utils.each(a.items,function(b,c){var d=m.cloneNode(!1);h.Utils.each(b,function(a){d.appendChild(a)}),a.items[c]=d}),this.itemPanels=a.items,l.setSelectHandler(function(c,d){f.overlapIndex=c,k.setLabel(b[c]),k.hideMount(),a.items[d].style.display="none",a.items[c].style.display="block",c!==d&&f.updateSize(),f.onchangeHandler(c)}),g.appendChild(k.getNode()),h.Utils.each(a.items,function(a,b){b>0&&(a.style.display="none"),g.appendChild(a)}),l.select(0),[g]},getCurrentItemPanel:function(){return this.itemPanels[this.overlapIndex]},getGroupList:function(){var a=[];return h.Utils.each(this.options.group,function(b){a.push(b.title)}),{width:150,items:a}},createGroup:function(){var b=this.doc,c=[],d={title:[],items:[]},e=null,f=null,g=k.DETACHED===this.options.type?l.BIG:l.SMALL,m=null;return e=j.ele(this.doc,"div",{className:i+"box-group"}),m=e.cloneNode(!1),m.className=i+"box-group-item-container",h.Utils.each(this.options.group,function(k){d.title.push(k.title||""),c=[],h.Utils.each(k.items,function(d){e=e.cloneNode(!1),m=m.cloneNode(!1),f=j.ele(b,"div",{className:i+"box-group-title",content:d.title}),e.appendChild(f),e.appendChild(m),h.Utils.each(a(b,d.content,g),function(a){a.appendTo(m)}),c.push(e)}),d.items.push(c)}),d},mergeElement:function(){var a=this.groupContainer;this.element.appendChild(a),h.Utils.each(this.itemGroups,function(b){a.appendChild(b)})},mountTo:function(a){a.appendChild(this.element)},appendTo:function(a){a.appendChild(this.element)}}),q=h.createClass("BoxItem",{constructor:function(a,b,c){this.type=a,this.doc=b,this.options=c,this.element=this.createItem(),this.labelNode=this.createLabel(),this.contentNode=this.createContent(),this.mergeElement()},getNode:function(){return this.element},createItem:function(){var a=j.ele(this.doc,"div",{className:i+"box-item"});return a},createLabel:function(){var a=null;if("label"in this.options)return a=j.ele(this.doc,"div",{className:i+"box-item-label",content:this.options.label})},getContent:function(){},createContent:function(){switch(this.type){case l.BIG:return this.createBigContent();case l.SMALL:return this.createSmallContent()}},createBigContent:function(){var a=this.doc,b=j.ele(a,"div",{className:i+"box-item-content"}),c=i+"box-item-val",d=this.options.item,e=null,f=g(d);return e=j.ele(a,"div",{className:c}),e.innerHTML='
              ',this.element.setAttribute("data-value",d.val),b.appendChild(e),b},createSmallContent:function(){var a=this.doc,b=j.ele(a,"div",{className:i+"box-item-content"}),c=i+"box-item-val",d=this.options,e=null;return e=j.ele(a,"div",{className:c}),e.style.background="url( "+d.img+" )",e.style.backgroundPosition=-d.pos.x+"px "+-d.pos.y+"px",this.element.setAttribute("data-value",d.key),b.appendChild(e),b},mergeElement:function(){this.labelNode&&this.element.appendChild(this.labelNode),this.element.appendChild(this.contentNode)},appendTo:function(a){a.appendChild(this.element)}});return p}},b[39]={value:function(){function a(a){var b="url( "+a.src+" ) no-repeat ";return b+=-a.x+"px ",b+=-a.y+"px"}var c=b.r(20),d="kf-editor-ui-",e=7,f={iconSize:{w:32,h:32}},g=b.r(47),h=c.createClass("Button",{constructor:function(a,b){this.options=c.Utils.extend({},f,b),this.eventState=!1,this.toolbar=null,this.displayState=!1,this.fixOffset=b.fixOffset||!1,this.doc=a,this.element=this.createButton(),this.disabled=!0,this.mountElement=null,this.icon=this.createIcon(),this.label=this.createLabel(),this.sign=this.createSign(),this.mountPoint=this.createMountPoint(),this.mergeElement()},initEvent:function(){var a=this;this.eventState||(this.eventState=!0,g.on(this.element,"mousedown",function(b){b.preventDefault(),b.stopPropagation(),1===b.which&&(a.disabled||(a.toggleSelect(),a.toggleMountElement()))}))},setToolbar:function(a){this.toolbar=a},toggleMountElement:function(){this.displayState?this.hideMount():this.showMount()},setLabel:function(a){var b="";this.sign&&(b='
              '),this.label.innerHTML=a+b},toggleSelect:function(){g.getClassList(this.element).toggle(d+"button-in")},unselect:function(){g.getClassList(this.element).remove(d+"button-in")},select:function(){g.getClassList(this.element).add(d+"button-in")},show:function(){this.select(),this.showMount()},hide:function(){this.unselect(),this.hideMount()},showMount:function(){if(this.displayState=!0,this.mountPoint.style.display="block",this.fixOffset){var a=this.element.getBoundingClientRect();this.mountElement.setOffset(a.left+e,a.bottom)}var b=this.toolbar.getContainer(),c=null,d=g.getRectBox(b),f=this.mountElement.getPositionInfo();f.right>d.right&&(c=g.getRectBox(this.element),this.mountPoint.style.left=c.right-f.right-1+"px"),this.mountElement.updateSize&&this.mountElement.updateSize()},hideMount:function(){this.displayState=!1,this.mountPoint.style.display="none"},getNode:function(){return this.element},mount:function(a){this.mountElement=a,a.mountTo(this.mountPoint)},createButton:function(){var a=g.ele(this.doc,"div",{className:d+"button"});return this.options.className&&(a.className+=" "+d+this.options.className),a},createIcon:function(){if(!this.options.icon)return null;var b=g.ele(this.doc,"div",{className:d+"button-icon"});return"string"==typeof this.options.icon?b.style.backgroundImage="url("+this.options.icon+") no-repeat":b.style.background=a(this.options.icon),this.options.iconSize.w&&(b.style.width=this.options.iconSize.w+"px"),this.options.iconSize.h&&(b.style.height=this.options.iconSize.h+"px"),b},createLabel:function(){var a=g.ele(this.doc,"div",{className:d+"button-label",content:this.options.label});return a},createSign:function(){return this.options.sign===!1?null:g.ele(this.doc,"div",{className:d+"button-sign"})},createMountPoint:function(){return g.ele(this.doc,"div",{className:d+"button-mount-point"})},disable:function(){this.disabled=!0,g.getClassList(this.element).remove(d+"enabled") +},enable:function(){this.disabled=!1,g.getClassList(this.element).add(d+"enabled")},mergeElement:function(){this.icon&&this.element.appendChild(this.icon),this.element.appendChild(this.label),this.sign&&this.label.appendChild(this.sign),this.element.appendChild(this.mountPoint)}});return h}},b[40]={value:function(){return{DETACHED:1,OVERLAP:2}}},b[41]={value:function(){return{DRAPDOWN_BOX:1,AREA:2,DELIMITER:3}}},b[42]={value:function(){return{BIG:1,SMALL:2}}},b[43]={value:function(){var a=b.r(20),c="kf-editor-ui-",d=b.r(47),e=a.createClass("Delimiter",{constructor:function(a){this.doc=a,this.element=this.createDilimiter()},setToolbar:function(){},createDilimiter:function(){var a=d.ele(this.doc,"div",{className:c+"delimiter"});return a.appendChild(d.ele(this.doc,"div",{className:c+"delimiter-line"})),a},attachTo:function(a){a.appendChild(this.element)}});return e}},b[44]={value:function(){var a=b.r(20),c=b.r(47),d=b.r(39),e=b.r(38),f=a.createClass("DrapdownBox",{constructor:function(a,b){this.options=b,this.toolbar=null,this.doc=a,this.buttonElement=this.createButton(),this.element=this.buttonElement.getNode(),this.boxElement=this.createBox(),this.buttonElement.mount(this.boxElement),this.initEvent()},initEvent:function(){var a=this;c.on(this.element,"mousedown",function(b){b.preventDefault(),b.stopPropagation(),a.toolbar.notify("closeOther",a)}),this.buttonElement.initEvent(),this.boxElement.initEvent(),this.boxElement.setSelectHandler(function(b){c.publish("data.select",b),a.buttonElement.hide()})},disable:function(){this.buttonElement.disable()},enable:function(){this.buttonElement.enable()},setToolbar:function(a){this.toolbar=a,this.buttonElement.setToolbar(a),this.boxElement.setToolbar(a)},createButton:function(){return new d(this.doc,this.options.button)},show:function(){this.buttonElement.show()},hide:function(){this.buttonElement.hide()},createBox:function(){return new e(this.doc,this.options.box)},attachTo:function(a){a.appendChild(this.element)}});return f}},b[45]={value:function(){var a=b.r(20),c="kf-editor-ui-",d=b.r(47),e=a.createClass("List",{constructor:function(a,b){this.options=b,this.doc=a,this.onselectHandler=null,this.currentSelect=-1,this.element=this.createBox(),this.itemGroups=this.createItems(),this.mergeElement()},onselectHandler:function(){},setSelectHandler:function(a){this.onselectHandler=a},createBox:function(){var a=d.ele(this.doc,"div",{className:c+"list"}),b=d.ele(this.doc,"div",{className:c+"list-bg"});return"width"in this.options&&(a.style.width=this.options.width+"px"),a.appendChild(b),a},select:function(a){var b=this.currentSelect;-1===b&&(b=a),this.unselect(b),this.currentSelect=a,d.getClassList(this.itemGroups.items[a]).add(c+"list-item-select"),this.onselectHandler(a,b)},unselect:function(a){d.getClassList(this.itemGroups.items[a]).remove(c+"list-item-select")},setOffset:function(a,b){this.element.style.left=a+"px",this.element.style.top=b+"px"},initEvent:function(){var a="."+c+"list-item",b=this;d.delegate(this.itemGroups.container,a,"mousedown",function(a){a.preventDefault(),1===a.which&&b.select(this.getAttribute("data-index"))}),d.on(this.element,"mousedown",function(a){a.stopPropagation(),a.preventDefault()})},getPositionInfo:function(){return d.getRectBox(this.element)},createItems:function(){var b=this.doc,e=null,f=null,g=null,h=[],i=null;return e=d.ele(this.doc,"div",{className:c+"list-item"}),i=e.cloneNode(!1),i.className=c+"list-item-container",a.Utils.each(this.options.items,function(a,j){f=e.cloneNode(!1),g=e.cloneNode(!1),g.className=c+"list-item-icon",f.appendChild(g),f.appendChild(d.ele(b,"text",a)),f.setAttribute("data-index",j),h.push(f),i.appendChild(f)}),{container:i,items:h}},mergeElement:function(){this.element.appendChild(this.itemGroups.container)},mountTo:function(a){a.appendChild(this.element)}});return e}},b[46]={value:function(){function a(a,b,c){var d=a.createElement(b),e='
              ';return d.className=r+c,"thumb"===c&&(c=r+c,d.innerHTML=e.replace("$1",c+"-left").replace("$2",c+"-right")),d}function c(a){return a.getBoundingClientRect()}function d(a){q.addEvent(a,"mousedown",function(a){a.preventDefault()})}function d(a){q.addEvent(a.container,"mousedown",function(a){a.preventDefault()})}function e(a){q.addEvent(a.widgets.track,"mousedown",function(b){h(this,a,b)})}function f(a){q.addEvent(a.widgets.leftButton,"mousedown",function(){j(a,-p.step)}),q.addEvent(a.widgets.rightButton,"mousedown",function(){j(a,p.step)})}function g(a){var b=!1,c=0,d=0,e=a.values.trackWidth;q.addEvent(a.widgets.thumb,"mousedown",function(e){e.preventDefault(),e.stopPropagation(),b=!0,c=e.clientX,d=a.thumbLocationX}),q.addEvent(a.container.ownerDocument,"mouseup",function(){b=!1,c=0,d=0}),q.addEvent(a.container.ownerDocument,"mousemove",function(f){if(b){var g=f.clientX-c,h=d+g,j=a.values.thumbWidth;0>h?h=0:h+j>e&&(h=e-j),i(a,h)}})}function h(a,b,d){var e=c(a),f=b.values,g=f.viewWidth/(f.contentWidth-f.viewWidth)*f.trackWidth,h=d.clientX-e.left;h>f.offset?f.offset+g>f.trackWidth?k(b,f.trackWidth):k(b,f.offset+g):f.offset-g<0?k(b,0):k(b,f.offset-g)}function i(a,b){var c=a.values,d=c.trackWidth-c.thumbWidth,e=Math.floor(b/d*c.trackWidth);a.updateOffset(e),a.thumbLocationX=b,a.widgets.thumb.style.left=b+"px"}function j(a,b){var c=a.leftOverflow+b;0>c?c=0:c>a.values.scrollWidth&&(c=a.values.scrollWidth),m(a,c)}function k(a,b){var c=a.values,d=b/c.trackWidth,e=c.trackWidth-c.thumbWidth,f=0;f=Math.floor(d*e),0>b&&(b=0,f=0),a.updateOffset(b),a.widgets.thumb.style.left=f+"px",a.thumbLocationX=f}function l(a,b){var c=a.values,d=0,e=0;d=b/(c.contentWidth-c.viewWidth),e=Math.floor(d*c.trackWidth),k(a,e)}function m(a,b){var c=a.values,d=b/(c.contentWidth-c.viewWidth);k(a,d*c.trackWidth)}var n=b.r(20),o=b.r(32).scrollbar,p=b.r(29).scrollbar,q=b.r(4),r="kf-editor-ui-";return n.createClass("Scrollbar",{constructor:function(a,b){this.uiComponent=a,this.kfEditor=b,this.widgets=null,this.container=this.uiComponent.scrollbarContainer,this.state=!1,this.values={offset:0,left:0,viewWidth:0,contentWidth:0,trackWidth:0,thumbWidth:0,scrollWidth:0},this.thumbLocationX=0,this.leftOverflow=0,this.rightOverflow=0,this.isExpand=!0,this.initWidget(),this.mountWidget(),this.initSize(),this.hide(),this.initServices(),this.initEvent(),this.updateHandler=function(){}},initWidget:function(){var b=this.container.ownerDocument;this.widgets={leftButton:a(b,"div","left-button"),rightButton:a(b,"div","right-button"),track:a(b,"div","track"),thumb:a(b,"div","thumb"),thumbBody:a(b,"div","thumb-body")}},initSize:function(){var a=c(this.widgets.leftButton).width,b=c(this.widgets.rightButton).width;this.values.viewWidth=c(this.container).width,this.values.trackWidth=this.values.viewWidth-a-b,this.widgets.track.style.width=this.values.trackWidth+"px"},initServices:function(){this.kfEditor.registerService("ui.show.scrollbar",this,{showScrollbar:this.show}),this.kfEditor.registerService("ui.hide.scrollbar",this,{hideScrollbar:this.hide}),this.kfEditor.registerService("ui.update.scrollbar",this,{updateScrollbar:this.update}),this.kfEditor.registerService("ui.set.scrollbar.update.handler",this,{setUpdateHandler:this.setUpdateHandler}),this.kfEditor.registerService("ui.relocation.scrollbar",this,{relocation:this.relocation})},initEvent:function(){d(this),e(this),g(this),f(this)},mountWidget:function(){var a=this.widgets,b=this.container;for(var c in a)a.hasOwnProperty(c)&&b.appendChild(a[c]);a.thumb.appendChild(a.thumbBody),a.track.appendChild(a.thumb)},show:function(){this.state=!0,this.container.style.display="block"},hide:function(){this.state=!1,this.container.style.display="none"},update:function(a){var b=this.values.trackWidth,c=0;return this.isExpand=a>this.values.contentWidth,this.values.contentWidth=a,this.values.scrollWidth=a-this.values.viewWidth,b>=a?void this.hide():(c=Math.max(Math.ceil(b*b/a),o.thumbMinSize),this.values.thumbWidth=c,this.widgets.thumb.style.width=c+"px",void(this.widgets.thumbBody.style.width=c-10+"px"))},setUpdateHandler:function(a){this.updateHandler=a},updateOffset:function(a){var b=this.values;b.offset=a,b.left=a/b.trackWidth,this.leftOverflow=b.left*(b.contentWidth-b.viewWidth),this.rightOverflow=b.contentWidth-b.viewWidth-this.leftOverflow,this.updateHandler(b.left,b.offset,b)},relocation:function(){var a=this.kfEditor.requestService("control.get.cursor.location"),b=p.padding,c=this.values.contentWidth,d=this.values.viewWidth,e=this.values.left*(c-d),f=0;a.xe+d?(a.x+=b,a.x>c&&(a.x=c),f=a.x-d,l(this,f)):this.isExpand?m(this,this.leftOverflow):m(this,c-d-this.rightOverflow)}})}},b[47]={value:function(){function a(a){this.node=a,this.classes=a.className.replace(/^\s+|\s+$/g,"").split(/\s+/)}var c=b.r(14),d=b.r(20),e={},f={ele:function(a,b,c){var d=null;return"text"===b?a.createTextNode(c):(d=a.createElement(b),c.className&&(d.className=c.className),c.content&&(d.innerHTML=c.content),d)},getRectBox:function(a){return a.getBoundingClientRect()},on:function(a,b,d){return c(a).on(b,d),this},delegate:function(a,b,d,e){return c(a).delegate(b,d,e),this},publish:function(a,b){var c=e[a];c&&(b=[].slice.call(arguments,1),d.Utils.each(c,function(a){a.apply(null,b)}))},subscribe:function(a,b){e[a]||(e[a]=[]),e[a].push(b)},getClassList:function(b){return b.classList||new a(b)}};return a.prototype={constructor:a,contains:function(a){return-1!==this.classes.indexOf(a)},add:function(a){return-1==this.classes.indexOf(a)&&this.classes.push(a),this._update(),this},remove:function(a){var b=this.classes.indexOf(a);return-1!==b&&(this.classes.splice(b,1),this._update()),this},toggle:function(a){var b=this.contains(a)?"remove":"add";return this[b](a)},_update:function(){this.node.className=this.classes.join(" ")}},f}},b[48]={value:function(){return{DrapdownBox:b.r(44),Delimiter:b.r(43),Area:b.r(37)}}},b[49]={value:function(){function a(a){return h.ele(a,"div",{className:"kf-editor-toolbar"})}function c(a){return h.ele(a,"div",{className:"kf-editor-inner-toolbar"})}function d(a){var b=a.createElement("div");return b.className="kf-editor-edit-area",b.style.width="80%",b.style.height="800px",b}function e(a){var b=a.createElement("div");return b.className="kf-editor-canvas-container",b}function f(a){var b=a.createElement("div");return b.className="kf-editor-edit-scrollbar",b}var g=b.r(20),h=b.r(47),i=b.r(4),j=b.r(32).VIEW_STATE,k=b.r(46),l=b.r(36),m=(b.r(31),b.r(35)),n=g.createClass("UIComponent",{constructor:function(b,g){var h=null;this.options=g,this.container=b.getContainer(),h=this.container.ownerDocument,this.components={},this.canvasRect=null,this.viewState=j.NO_OVERFLOW,this.kfEditor=b,this.toolbarWrap=a(h),this.toolbarContainer=c(h),this.editArea=d(h),this.canvasContainer=e(h),this.scrollbarContainer=f(h),this.toolbarWrap.appendChild(this.toolbarContainer),this.container.appendChild(this.toolbarWrap),this.editArea.appendChild(this.canvasContainer),this.container.appendChild(this.editArea),this.container.appendChild(this.scrollbarContainer),this.initComponents(),this.initServices(),this.initEvent(),this.updateContainerSize(this.container,this.toolbarWrap,this.editArea,this.canvasContainer),this.initScrollEvent()},initComponents:function(){this.components.toolbar=new l(this,this.kfEditor,m),this.components.scrollbar=new k(this,this.kfEditor)},updateContainerSize:function(a,b,c){var d=a.getBoundingClientRect(),e=b.getBoundingClientRect();c.style.width=d.width+"px",c.style.height=d.bottom-e.bottom+"px"},initServices:function(){this.kfEditor.registerService("ui.get.canvas.container",this,{getCanvasContainer:this.getCanvasContainer}),this.kfEditor.registerService("ui.update.canvas.view",this,{updateCanvasView:this.updateCanvasView}),this.kfEditor.registerService("ui.canvas.container.event",this,{on:this.addEvent,off:this.removeEvent,trigger:this.trigger,fire:this.trigger})},initEvent:function(){},initScrollEvent:function(){var a=this;this.kfEditor.requestService("ui.set.scrollbar.update.handler",function(b,c,d){c=Math.floor(b*(d.contentWidth-d.viewWidth)),a.kfEditor.requestService("render.set.canvas.offset",c)})},getCanvasContainer:function(){return this.canvasContainer},addEvent:function(a,b){i.addEvent(this.canvasContainer,a,b)},removeEvent:function(){},trigger:function(a){i.trigger(this.canvasContainer,a)},updateCanvasView:function(){var a=this.kfEditor.requestService("render.get.canvas"),b=a.getContentContainer(),c=null;null===this.canvasRect&&(this.canvasRect=this.canvasContainer.getBoundingClientRect()),c=b.getRenderBox("paper"),c.width>this.canvasRect.width?(this.viewState===j.NO_OVERFLOW&&(this.toggleViewState(),this.kfEditor.requestService("ui.show.scrollbar"),this.kfEditor.requestService("render.disable.relocation")),this.kfEditor.requestService("render.relocation"),this.kfEditor.requestService("ui.update.scrollbar",c.width),this.kfEditor.requestService("ui.relocation.scrollbar")):(this.viewState===j.OVERFLOW&&(this.toggleViewState(),this.kfEditor.requestService("ui.hide.scrollbar"),this.kfEditor.requestService("render.enable.relocation")),this.kfEditor.requestService("render.relocation"))},toggleViewState:function(){this.viewState=this.viewState===j.NO_OVERFLOW?j.OVERFLOW:j.NO_OVERFLOW}});return n}},b[50]={value:function(){var a=b.r(12),c=b.r(13);a.registerComponents("ui",b.r(49)),a.registerComponents("parser",b.r(21)),a.registerComponents("render",b.r(25)),a.registerComponents("position",b.r(23)),a.registerComponents("syntax",b.r(28)),a.registerComponents("control",b.r(5)),a.registerComponents("print",b.r(24)),kf.EditorFactory=c}};var c={"kf.start":50};!function(){try{a("kf.start")}catch(b){}}(this)}(); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/js/kitygraph.all.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/js/kitygraph.all.js new file mode 100644 index 00000000..153d6e18 --- /dev/null +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/js/kitygraph.all.js @@ -0,0 +1,8572 @@ +/*! + * ==================================================== + * kity - v2.0.5 - 2015-11-12 + * https://github.com/fex-team/kity + * GitHub: https://github.com/fex-team/kity.git + * Copyright (c) 2015 Baidu FEX; Licensed BSD + * ==================================================== + */ + +(function () { +var _p = { + r: function(index) { + if (_p[index].inited) { + return _p[index].value; + } + if (typeof _p[index].value === "function") { + var module = { + exports: {} + }, returnValue = _p[index].value(null, module.exports, module); + _p[index].inited = true; + _p[index].value = returnValue; + if (returnValue !== undefined) { + return returnValue; + } else { + for (var key in module.exports) { + if (module.exports.hasOwnProperty(key)) { + _p[index].inited = true; + _p[index].value = module.exports; + return module.exports; + } + } + } + } else { + _p[index].inited = true; + return _p[index].value; + } + } +}; + +//src/animate/animator.js +/** + * @fileOverview + * + * 提供基本的动画支持 + */ +_p[0] = { + value: function(require) { + function parseTime(str) { + var value = parseFloat(str, 10); + if (/ms/.test(str)) { + return value; + } + if (/s/.test(str)) { + return value * 1e3; + } + if (/min/.test(str)) { + return value * 60 * 1e3; + } + return value; + } + var Timeline = _p.r(8); + var easingTable = _p.r(1); + /** + * @class kity.Animator + * @catalog animate + * @description 表示一个动画启动器,可以作用于不同的对象进行动画 + */ + var Animator = _p.r(11).createClass("Animator", { + /** + * @constructor + * @for kity.Animator + * @catalog animate + * + * @grammar new kity.Animator(beginValue, finishValue, setter) + * @grammar new kity.Animator(option) + * + * @param {any} beginValue|opt.beginValue + * 动画的起始值,允许的类型有数字、数组、字面量、kity.Point、kity.Vector、kity.Box、kity.Matrix + * + * @param {any} finishValue|opt.beginValue + * 动画的结束值,类型应于起始值相同 + * + * @param {Function} setter|opt.setter + * 值的使用函数,接受三个参数: function(target, value, timeline) + * target {object} 动画的目标 + * value {any} 动画的当前值 + * timeline {kity.Timeline} 动画当前的时间线对象 + */ + constructor: function(beginValue, finishValue, setter) { + if (arguments.length == 1) { + var opt = arguments[0]; + this.beginValue = opt.beginValue; + this.finishValue = opt.finishValue; + this.setter = opt.setter; + } else { + this.beginValue = beginValue; + this.finishValue = finishValue; + this.setter = setter; + } + }, + /** + * @method start() + * @for kity.Animator + * @description 使用当前的动画器启动在指定目标上启动动画 + * + * @grammar start(target, duration, easing, delay, callback) => {kity.Timeline} + * @grammar start(target, option) => {kity.Timeline} + * + * @param {object} target + * 启动动画的目标 + * + * @param {Number|String} duration|option.duration + * [Optional] 动画的持续时间,如 300、"300ms"、"1.5min" + * + * @param {String|Function} easing|option.easing + * [Optional] 动画使用的缓动函数,如 "ease"、"linear"、"swing" + * + * @param {Number|String} delay|option.delay + * [Optional] 动画的播放延迟时间 + * + * @param {Function} callback|option.callback + * [Optional] 动画结束后的回调函数 + * + * @example + * + * ```js + * var turnRed = new kity.Animator( + * new kity.Color('yellow'), + * new kity.Color('red'), + * function(target, value) { + * target.fill(value); + * }); + * + * turnRed.start(rect, 300, 'ease', function() { + * console.log('I am red!'); + * }); + * ``` + */ + start: function(target, duration, easing, delay, callback) { + if (arguments.length === 2 && typeof duration == "object") { + easing = duration.easing; + delay = duration.delay; + callback = duration.callback; + duration = duration.duration; + } + if (arguments.length === 4 && typeof delay == "function") { + callback = delay; + delay = 0; + } + var timeline = this.create(target, duration, easing, callback); + delay = parseTime(delay); + if (delay > 0) { + setTimeout(function() { + timeline.play(); + }, delay); + } else { + timeline.play(); + } + return timeline; + }, + /** + * @method create() + * @for kity.Animator + * @description 使用当前的动画器为指定目标创建时间线 + * + * @grammar create(target, duration, easing, callback) => {kity.Timeline} + * + * @param {object} target 要创建的时间线的目标 + * @param {Number|String} duration 要创建的时间线的长度,如 300、"5s"、"0.5min" + * @param {String|Function} easing 要创建的时间线的缓动函数,如 'ease'、'linear'、'swing' + * @param {Function} callback 时间线播放结束之后的回调函数 + * + * @example + * + * ```js + * var expand = new kity.Animator({ + * beginValue: function(target) { + * return target.getBox(); + * }, + * finishValue: function(target) { + * return target.getBox().expand(100, 100, 100, 100); + * }, + * setter: function(target, value) { + * target.setBox(value) + * } + * }); + * + * var timeline = expand.create(rect, 300); + * timeline.repeat(3).play(); + * ``` + */ + create: function(target, duration, easing, callback) { + var timeline; + duration = duration && parseTime(duration) || Animator.DEFAULT_DURATION; + easing = easing || Animator.DEFAULT_EASING; + if (typeof easing == "string") { + easing = easingTable[easing]; + } + timeline = new Timeline(this, target, duration, easing); + if (typeof callback == "function") { + timeline.on("finish", callback); + } + return timeline; + }, + /** + * @method reverse() + * @for kity.Animator + * @grammar reverse() => {kity.Animator} + * @description 创建一个与当前动画器相反的动画器 + * + * @example + * + * ```js + * var turnYellow = turnRed.reverse(); + * ``` + */ + reverse: function() { + return new Animator(this.finishValue, this.beginValue, this.setter); + } + }); + Animator.DEFAULT_DURATION = 300; + Animator.DEFAULT_EASING = "linear"; + var Shape = _p.r(60); + _p.r(11).extendClass(Shape, { + /** + * @method animate() + * @for kity.Shape + * @description 在图形上播放使用指定的动画器播放动画,如果图形当前有动画正在播放,则会加入播放队列 + * + * @grammar animate(animator, duration, easing, delay, callback) + * + * @param {object} animator 播放动画使用的动画器 + * @param {Number|String} duration 动画的播放长度,如 300、"5s"、"0.5min" + * @param {Number|String} delay 动画播放前的延时 + * @param {String|Function} easing 动画播放使用的缓动函数,如 'ease'、'linear'、'swing' + * @param {Function} callback 播放结束之后的回调函数 + * + * @example + * + * ```js + * rect.animate(turnRed, 300); // turnRect 是一个动画器 + * rect.animate(expand, 500); // turnRect 播放结束后播放 expand + * ``` + */ + animate: function(animator, duration, easing, delay, callback) { + var queue = this._KityAnimateQueue = this._KityAnimateQueue || []; + var timeline = animator.create(this, duration, easing, callback); + function dequeue() { + queue.shift(); + if (queue.length) { + setTimeout(queue[0].t.play.bind(queue[0].t), queue[0].d); + } + } + timeline.on("finish", dequeue); + queue.push({ + t: timeline, + d: delay + }); + if (queue.length == 1) { + setTimeout(timeline.play.bind(timeline), delay); + } + return this; + }, + /** + * @method timeline() + * @for kity.Shape + * @description 获得当前正在播放的动画的时间线 + * + * @grammar timeline() => {kity.Timeline} + * + * @example + * + * ```js + * rect.timeline().repeat(2); + * ``` + */ + timeline: function() { + return this._KityAnimateQueue[0].t; + }, + /** + * @method stop() + * @for kity.Shape + * @description 停止当前正在播放的动画 + * + * @grammar stop() => {this} + * + * @example + * + * ```js + * rect.stop(); // 停止 rect 上的动画 + * ``` + */ + stop: function() { + var queue = this._KityAnimateQueue; + if (queue) { + while (queue.length) { + queue.shift().t.stop(); + } + } + return this; + } + }); + return Animator; + } +}; + +//src/animate/easing.js +/** + * Kity Animate Easing modified from jQuery Easing + * Author: techird + * Changes: + * 1. make easing functions standalone + * 2. remove the 'x' parameter + */ +/* ============================================================ + * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ + * + * Open source under the BSD License. + * + * Copyright © 2008 George McGinley Smith + * All rights reserved. + * https://raw.github.com/danro/jquery-easing/master/LICENSE + * ======================================================== */ +_p[1] = { + value: function(require, exports, module) { + var easings = { + // t: current_time, b: begin_value, c: change_value, d: duration + linear: function(t, b, c, d) { + return c * (t / d) + b; + }, + swing: function(t, b, c, d) { + return easings.easeOutQuad(t, b, c, d); + }, + ease: function(t, b, c, d) { + return easings.easeInOutCubic(t, b, c, d); + }, + easeInQuad: function(t, b, c, d) { + return c * (t /= d) * t + b; + }, + easeOutQuad: function(t, b, c, d) { + return -c * (t /= d) * (t - 2) + b; + }, + easeInOutQuad: function(t, b, c, d) { + if ((t /= d / 2) < 1) return c / 2 * t * t + b; + return -c / 2 * (--t * (t - 2) - 1) + b; + }, + easeInCubic: function(t, b, c, d) { + return c * (t /= d) * t * t + b; + }, + easeOutCubic: function(t, b, c, d) { + return c * ((t = t / d - 1) * t * t + 1) + b; + }, + easeInOutCubic: function(t, b, c, d) { + if ((t /= d / 2) < 1) return c / 2 * t * t * t + b; + return c / 2 * ((t -= 2) * t * t + 2) + b; + }, + easeInQuart: function(t, b, c, d) { + return c * (t /= d) * t * t * t + b; + }, + easeOutQuart: function(t, b, c, d) { + return -c * ((t = t / d - 1) * t * t * t - 1) + b; + }, + easeInOutQuart: function(t, b, c, d) { + if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b; + return -c / 2 * ((t -= 2) * t * t * t - 2) + b; + }, + easeInQuint: function(t, b, c, d) { + return c * (t /= d) * t * t * t * t + b; + }, + easeOutQuint: function(t, b, c, d) { + return c * ((t = t / d - 1) * t * t * t * t + 1) + b; + }, + easeInOutQuint: function(t, b, c, d) { + if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b; + return c / 2 * ((t -= 2) * t * t * t * t + 2) + b; + }, + easeInSine: function(t, b, c, d) { + return -c * Math.cos(t / d * (Math.PI / 2)) + c + b; + }, + easeOutSine: function(t, b, c, d) { + return c * Math.sin(t / d * (Math.PI / 2)) + b; + }, + easeInOutSine: function(t, b, c, d) { + return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b; + }, + easeInExpo: function(t, b, c, d) { + return t === 0 ? b : c * Math.pow(2, 10 * (t / d - 1)) + b; + }, + easeOutExpo: function(t, b, c, d) { + return t == d ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; + }, + easeInOutExpo: function(t, b, c, d) { + if (t === 0) return b; + if (t == d) return b + c; + if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b; + return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b; + }, + easeInCirc: function(t, b, c, d) { + return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b; + }, + easeOutCirc: function(t, b, c, d) { + return c * Math.sqrt(1 - (t = t / d - 1) * t) + b; + }, + easeInOutCirc: function(t, b, c, d) { + if ((t /= d / 2) < 1) return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b; + return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b; + }, + easeInElastic: function(t, b, c, d) { + var s = 1.70158; + var p = 0; + var a = c; + if (t === 0) return b; + if ((t /= d) == 1) return b + c; + if (!p) p = d * .3; + if (a < Math.abs(c)) { + a = c; + s = p / 4; + } else s = p / (2 * Math.PI) * Math.asin(c / a); + return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; + }, + easeOutElastic: function(t, b, c, d) { + var s = 1.70158; + var p = 0; + var a = c; + if (t === 0) return b; + if ((t /= d) == 1) return b + c; + if (!p) p = d * .3; + if (a < Math.abs(c)) { + a = c; + s = p / 4; + } else s = p / (2 * Math.PI) * Math.asin(c / a); + return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b; + }, + easeInOutElastic: function(t, b, c, d) { + var s = 1.70158; + var p = 0; + var a = c; + if (t === 0) return b; + if ((t /= d / 2) == 2) return b + c; + if (!p) p = d * (.3 * 1.5); + if (a < Math.abs(c)) { + a = c; + var s = p / 4; + } else var s = p / (2 * Math.PI) * Math.asin(c / a); + if (t < 1) return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; + return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b; + }, + easeInBack: function(t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c * (t /= d) * t * ((s + 1) * t - s) + b; + }, + easeOutBack: function(t, b, c, d, s) { + if (s == undefined) s = 1.70158; + return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; + }, + easeInOutBack: function(t, b, c, d, s) { + if (s == undefined) s = 1.70158; + if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= 1.525) + 1) * t - s)) + b; + return c / 2 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) + b; + }, + easeInBounce: function(t, b, c, d) { + return c - easings.easeOutBounce(d - t, 0, c, d) + b; + }, + easeOutBounce: function(t, b, c, d) { + if ((t /= d) < 1 / 2.75) { + return c * (7.5625 * t * t) + b; + } else if (t < 2 / 2.75) { + return c * (7.5625 * (t -= 1.5 / 2.75) * t + .75) + b; + } else if (t < 2.5 / 2.75) { + return c * (7.5625 * (t -= 2.25 / 2.75) * t + .9375) + b; + } else { + return c * (7.5625 * (t -= 2.625 / 2.75) * t + .984375) + b; + } + }, + easeInOutBounce: function(t, b, c, d) { + if (t < d / 2) return easings.easeInBounce(t * 2, 0, c, d) * .5 + b; + return easings.easeOutBounce(t * 2 - d, 0, c, d) * .5 + c * .5 + b; + } + }; + return easings; + } +}; + +/* + * + * TERMS OF USE - EASING EQUATIONS + * + * Open source under the BSD License. + * + * Copyright © 2001 Robert Penner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * Neither the name of the author nor the names of contributors may be used to endorse + * or promote products derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +//src/animate/frame.js +/** + * @fileOverview + * + * 提供动画帧的基本支持 + */ +_p[2] = { + value: function(require, exports) { + // 原生动画帧方法 polyfill + var requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || function(fn) { + return setTimeout(fn, 1e3 / 60); + }; + var cancelAnimationFrame = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.msCancelAnimationFrame || window.clearTimeout; + // 上一个请求的原生动画帧 id + var frameRequestId; + // 等待执行的帧动作的集合,这些帧的方法将在下个原生动画帧同步执行 + var pendingFrames = []; + /** + * 添加一个帧到等待集合中 + * + * 如果添加的帧是序列的第一个,至少有一个帧需要被执行,则会请求一个原生动画帧来执行 + */ + function pushFrame(frame) { + if (pendingFrames.push(frame) === 1) { + frameRequestId = requestAnimationFrame(executePendingFrames); + } + } + /** + * 执行所有等待帧 + */ + function executePendingFrames() { + var frames = pendingFrames; + pendingFrames = []; + while (frames.length) { + executeFrame(frames.pop()); + } + frameRequestId = 0; + } + /** + * @method kity.requestFrame + * @catalog animate + * @grammar kity.requestFrame(action) => {frame} + * @description 请求一个帧,执行指定的动作。动作回调提供一些有用的信息 + * + * @param {Function} action + * + * 要执行的动作,该动作回调有一个参数 frame,其中: + * + * frame.time {Number} + * 动作执行时的时间戳(ms) + * + * frame.index {Number} + * 当前执行的帧的编号(首帧为 0) + * + * frame.dur {Number} + * 上一帧至当前帧经过的时间,单位 ms + * + * frame.elapsed {Number} + * 从首帧开始到当前帧经过的时间,单位 ms + * + * frame.action {Number} + * 指向当前的帧处理函数 + * + * frame.next() + * 表示下一帧继续执行。如果不调用该方法,将不会执行下一帧。 + * + * @example + * + * ```js + * kity.requestFrame(function(frame) { + * console.log('平均帧率:' + frame.elapsed / (frame.index + 1)); + * + * // 更新或渲染动作 + * + * frame.next(); //继续执行下一帧 + * }); + * ``` + */ + function requestFrame(action) { + var frame = initFrame(action); + pushFrame(frame); + return frame; + } + /** + * @method kity.releaseFrame + * @catalog animate + * @grammar kity.releaseFrame(frame) + * @description 释放一个已经请求过的帧,如果该帧在等待集合里,将移除,下个动画帧不会执行释放的帧 + * + * @param {frame} frame 使用 kity.requestFrame() 返回的帧 + * + * @example + * + * ```js + * var frame = kity.requestFrame(function() {....}); + * kity.releaseFrame(frame); + * ``` + */ + function releaseFrame(frame) { + var index = pendingFrames.indexOf(frame); + if (~index) { + pendingFrames.splice(index, 1); + } + if (pendingFrames.length === 0) { + cancelAnimationFrame(frameRequestId); + } + } + /** + * 初始化一个帧,主要用于后续计算 + */ + function initFrame(action) { + var frame = { + index: 0, + time: +new Date(), + elapsed: 0, + action: action, + next: function() { + pushFrame(frame); + } + }; + return frame; + } + /** + * 执行一个帧动作 + */ + function executeFrame(frame) { + // 当前帧时间错 + var time = +new Date(); + // 当上一帧到当前帧经过的时间 + var dur = time - frame.time; + // + // http://stackoverflow.com/questions/13133434/requestanimationframe-detect-stop + // 浏览器最小化或切换标签,requestAnimationFrame 不会执行。 + // 检测时间超过 200 ms(频率小于 5Hz ) 判定为计时器暂停,重置为一帧长度 + // + if (dur > 200) { + dur = 1e3 / 60; + } + frame.dur = dur; + frame.elapsed += dur; + frame.time = time; + frame.action.call(null, frame); + frame.index++; + } + // 暴露 + exports.requestFrame = requestFrame; + exports.releaseFrame = releaseFrame; + } +}; + +//src/animate/motionanimator.js +/** + * @fileOverview + * + * 路径动画器,可以让一个物体沿着某个轨迹运动 + */ +_p[3] = { + value: function(require) { + var Animator = _p.r(0); + var g = _p.r(34); + var Path = _p.r(46); + var Shape = _p.r(60); + /** + * @class kity.MotionAnimator + * @catalog animate + * @base kity.Animator + * @description 路径动画器,可以让一个物体沿着某个轨迹运动 + * + * @example + * + * ```js + * var motionAnimator = new MotionAnimator('M0,0C100,0,100,0,100,100L200,200'); + * motionAnimator.start(rect, 3000); + * ``` + */ + var MotionAnimator = _p.r(11).createClass("MotionAnimator", { + base: Animator, + /** + * @constructor + * @for kity.MotionAnimator + * @grammar new kity.MotionAnimator(path, doRotate) + * @param {kity.Path|String|PathSegment} path 运动的轨迹,或者是 kity.Path 对象 + * @param {boolean} doRotate 是否让运动的目标沿着路径的切线方向旋转 + */ + constructor: function(path, doRotate) { + var me = this; + this.callBase({ + beginValue: 0, + finishValue: 1, + setter: function(target, value) { + var path = me.motionPath instanceof Path ? me.motionPath.getPathData() : me.motionPath; + var point = g.pointAtPath(path, value); + target.setTranslate(point.x, point.y); + if (this.doRotate) target.setRotate(point.tan.getAngle()); + } + }); + /** + * @property doRotate + * @for kity.MotionAnimator + * @type {boolean} + * @description 是否让运动的目标沿着路径的切线方向旋转 + * + * @example + * + * ```js + * motionAnimator.doRotate = true; // 目标沿着切线方向旋转 + * ``` + */ + this.doRotate = doRotate; + /** + * @property motionPath + * @for kity.MotionAnimator + * @type {kity.Path|String|PathSegment} + * @description 运动沿着的路径,可以在动画过程中更新 + */ + this.motionPath = path; + } + }); + _p.r(11).extendClass(Shape, { + /** + * @method motion() + * @catalog animate + * @for kity.Shape + * @description 让图形沿着指定的路径运动 + * + * @grammar motion(path, duration, easing, delay, callback) => this + * + * @param {kity.Path|String|PathSegment} path 运动的轨迹,或者是 kity.Path 对象 + * @param {Number|String} duration 动画的播放长度,如 300、"5s"、"0.5min" + * @param {Number|String} delay 动画播放前的延时 + * @param {String|Function} easing 动画播放使用的缓动函数,如 'ease'、'linear'、'swing' + * @param {Function} callback 播放结束之后的回调函数 + */ + motion: function(path, duration, easing, delay, callback) { + return this.animate(new MotionAnimator(path), duration, easing, delay, callback); + } + }); + return MotionAnimator; + } +}; + +//src/animate/opacityanimator.js +/** + * @fileOverview + * + * 透明度动画器,让图形动画过度到指定的透明度。 + */ +_p[4] = { + value: function(require) { + var Animator = _p.r(0); + /** + * @class kity.OpacityAnimator + * @catalog animate + * @base kity.Animator + * @description 透明度动画器,让图形动画过度到指定的透明度 + */ + var OpacityAnimator = _p.r(11).createClass("OpacityAnimator", { + base: Animator, + /** + * @constructor + * @for kity.OpacityAnimator + * @grammar new kity.OpacityAnimator(opacity) + * + * @param {Number} opacity 目标透明度,取值范围 0 - 1 + */ + constructor: function(opacity) { + this.callBase({ + beginValue: function(target) { + return target.getOpacity(); + }, + finishValue: opacity, + setter: function(target, value) { + target.setOpacity(value); + } + }); + } + }); + var Shape = _p.r(60); + _p.r(11).extendClass(Shape, { + /** + * @method fxOpacity() + * @catalog animate + * @for kity.Shape + * @description 让图形的透明度以动画的形式过渡到指定的值 + * + * @grammar fxOpacity(opacity, duration, easing, delay, callback) => {this} + * + * @param {Number} opacity 动画的目标透明度 + * @param {Number|String} duration 动画的播放长度,如 300、"5s"、"0.5min" + * @param {Number|String} delay 动画播放前的延时 + * @param {String|Function} easing 动画播放使用的缓动函数,如 'ease'、'linear'、'swing' + * @param {Function} callback 播放结束之后的回调函数 + */ + fxOpacity: function(opacity, duration, easing, delay, callback) { + return this.animate(new OpacityAnimator(opacity), duration, easing, delay, callback); + }, + /** + * @method fadeTo() + * @catalog animate + * @for kity.Shape + * @description 让图形的透明度以动画的形式过渡到指定的值 + * + * @grammar fadeTo(opacity, duration, easing, delay, callback) => {this} + * + * @param {Number} opacity 动画的目标透明度 + * @param {Number|String} duration 动画的播放长度,如 300、"5s"、"0.5min" + * @param {Number|String} delay 动画播放前的延时 + * @param {String|Function} easing 动画播放使用的缓动函数,如 'ease'、'linear'、'swing' + * @param {Function} callback 播放结束之后的回调函数 + */ + fadeTo: function() { + return this.fxOpacity.apply(this, arguments); + }, + /** + * @method fadeIn() + * @catalog animate + * @for kity.Shape + * @description 让图形淡入 + * + * @grammar fadeIn(duration, easing, delay, callback) => {this} + * + * @param {Number|String} duration 动画的播放长度,如 300、"5s"、"0.5min" + * @param {Number|String} delay 动画播放前的延时 + * @param {String|Function} easing 动画播放使用的缓动函数,如 'ease'、'linear'、'swing' + * @param {Function} callback 播放结束之后的回调函数 + */ + fadeIn: function() { + return this.fxOpacity.apply(this, [ 1 ].concat([].slice.call(arguments))); + }, + /** + * @method fadeOut() + * @catalog animate + * @for kity.Shape + * @description 让图形淡出 + * + * @grammar fadeIn(duration, easing, delay, callback) => {this} + * + * @param {Number|String} duration 动画的播放长度,如 300、"5s"、"0.5min" + * @param {Number|String} delay 动画播放前的延时 + * @param {String|Function} easing 动画播放使用的缓动函数,如 'ease'、'linear'、'swing' + * @param {Function} callback 播放结束之后的回调函数 + */ + fadeOut: function() { + return this.fxOpacity.apply(this, [ 0 ].concat([].slice.call(arguments))); + } + }); + return OpacityAnimator; + } +}; + +//src/animate/pathanimator.js +/** + * @fileOverview + * + * 路径补间动画器,让图形从一个形状变为另一个形状 + */ +_p[5] = { + value: function(require) { + var Animator = _p.r(0); + var g = _p.r(34); + /** + * @catalog animate + * + * @class kity.PathAnimator + * @base kity.Animator + * @description 路径补间动画器,让图形从一个形状变为另一个形状 + * + * @example + * + * ```js + * var path = new kity.Path('M0,0L0,100'); + * var pa = new kity.PathAnimator('M0,0C100,0,100,0,100,100'); + * pa.start(path, 300); + * ``` + */ + var PathAnimator = _p.r(11).createClass("OpacityAnimator", { + base: Animator, + /** + * @constructor + * @for kity.PathAnimator + * + * @grammar new kity.Path.Animator(path) + * + * @param {String|PathSegment} path 目标形状的路径数据 + * + */ + constructor: function(path) { + this.callBase({ + beginValue: function(target) { + this.beginPath = target.getPathData(); + return 0; + }, + finishValue: 1, + setter: function(target, value) { + target.setPathData(g.pathTween(this.beginPath, path, value)); + } + }); + } + }); + var Path = _p.r(46); + _p.r(11).extendClass(Path, { + /** + * @catalog animate + * + * @method fxPath() + * @for kity.Shape + * @description 以动画的形式把路径变换为新路径 + * + * @grammar fxPath(path, duration, easing, delay, callback) => {this} + * + * @param {String|PathSegment} path 要变换新路径 + * @param {Number|String} duration 动画的播放长度,如 300、"5s"、"0.5min" + * @param {Number|String} delay 动画播放前的延时 + * @param {String|Function} easing 动画播放使用的缓动函数,如 'ease'、'linear'、'swing' + * @param {Function} callback 播放结束之后的回调函数 + */ + fxPath: function(path, duration, easing, delay, callback) { + return this.animate(new PathAnimator(path), duration, easing, delay, callback); + } + }); + return PathAnimator; + } +}; + +//src/animate/rotateanimator.js +/** + * @fileOverview + * + * 提供支持目标旋转的动画器 + */ +_p[6] = { + value: function(require) { + var Animator = _p.r(0); + /** + * @class kity.RotateAnimator + * @base Animator + * @description 提供支持目标旋转的动画器 + */ + var RotateAnimator = _p.r(11).createClass("RotateAnimator", { + base: Animator, + /** + * @constructor + * @for kity.RotateAnimator + * + * @grammar new kity.RotateAnimator(deg, ax, ay) + * + * @param {Number} deg 要旋转的角度 + */ + constructor: function(deg) { + this.callBase({ + beginValue: 0, + finishValue: deg, + setter: function(target, value, timeline) { + var delta = timeline.getDelta(); + target.rotate(delta, ax, ay); + } + }); + } + }); + var Shape = _p.r(60); + _p.r(11).extendClass(Shape, { + /** + * @method fxRotate() + * @for kity.Shape + * @description 让目标以动画旋转指定的角度 + * + * @grammar fxRotate(deg, duration, easing, delay) => {this} + * + * @param {Number} deg 要旋转的角度 + * @param {Number|String} duration 动画的播放长度,如 300、"5s"、"0.5min" + * @param {Number|String} delay 动画播放前的延时 + * @param {String|Function} easing 动画播放使用的缓动函数,如 'ease'、'linear'、'swing' + * @param {Function} callback 播放结束之后的回调函数 + */ + fxRotate: function(deg, duration, easing, delay, callback) { + return this.animate(new RotateAnimator(deg), duration, easing, delay, callback); + } + }); + return RotateAnimator; + } +}; + +//src/animate/scaleanimator.js +/** + * @fileOverview + * + * 提供支持目标缩放的动画器 + */ +_p[7] = { + value: function(require) { + var Animator = _p.r(0); + /** + * @class kity.ScaleAnimator + * @base kity.Animator + * @description 提供支持目标缩放的动画器 + */ + var ScaleAnimator = _p.r(11).createClass("ScaleAnimator", { + base: Animator, + /** + * @constructor + * @for kity.ScaleAnimator + * + * @grammar new kity.ScaleAnimator(sx, sy) + * @param {Number} sx x 轴的缩放比例 + * @param {Number} sy y 轴的缩放比例 + */ + constructor: function(sx, sy) { + this.callBase({ + beginValue: 0, + finishValue: 1, + setter: function(target, value, timeline) { + var delta = timeline.getDelta(); + var kx = Math.pow(sx, delta); + var ky = Math.pow(sy, delta); + target.scale(ky, kx); + } + }); + } + }); + var Shape = _p.r(60); + _p.r(11).extendClass(Shape, { + /** + * @method fxScale + * @for kity.Shape + * @description 动画缩放当前的图形 + * + * @grammar fxScale(sx, sy, duration, easing, delay, callback) => {this} + * + * @param {Number} sx x 轴的缩放比例 + * @param {Number} sy y 轴的缩放比例 + * @param {Number|String} duration 动画的播放长度,如 300、"5s"、"0.5min" + * @param {Number|String} delay 动画播放前的延时 + * @param {String|Function} easing 动画播放使用的缓动函数,如 'ease'、'linear'、'swing' + * @param {Function} callback 播放结束之后的回调函数 + */ + fxScale: function(sx, sy, duration, easing, delay, callback) { + return this.animate(new ScaleAnimator(sx, sy), duration, easing, delay, callback); + } + }); + return ScaleAnimator; + } +}; + +//src/animate/timeline.js +/** + * @fileOverview + * + * 动画时间线的实现 + */ +_p[8] = { + value: function(require) { + var EventHandler = _p.r(33); + var utils = _p.r(12); + var frame = _p.r(2); + function getPercentValue(b, f, p) { + return utils.paralle(b, f, function(b, f) { + return b + (f - b) * p; + }); + } + function getDelta(v1, v2) { + return utils.paralle(v1, v2, function(v1, v2) { + return v2 - v1; + }); + } + function TimelineEvent(timeline, type, param) { + this.timeline = timeline; + this.target = timeline.target; + this.type = type; + for (var name in param) { + if (param.hasOwnProperty(name)) { + this[name] = param[name]; + } + } + } + /** + * @class kity.Timeline + * @catalog animate + * @mixins EventHandler + * @description 动画时间线 + */ + var Timeline = _p.r(11).createClass("Timeline", { + mixins: [ EventHandler ], + /** + * @constructor + * @for kity.Timeline + * @private + * @description 时间线应该由动画器进行构造,不应手动创建 + * + */ + constructor: function(animator, target, duration, easing) { + this.callMixin(); + this.target = target; + this.time = 0; + this.duration = duration; + this.easing = easing; + this.animator = animator; + this.beginValue = animator.beginValue; + this.finishValue = animator.finishValue; + this.setter = animator.setter; + this.status = "ready"; + }, + /** + * @private + * + * 让时间线进入下一帧 + */ + nextFrame: function(frame) { + if (this.status != "playing") { + return; + } + this.time += frame.dur; + this.setValue(this.getValue()); + if (this.time >= this.duration) { + this.timeUp(); + } + frame.next(); + }, + /** + * @method getPlayTime() + * @for kity.Timeline + * @grammar getPlayTime() => {Number} + * @description 获得当前播放的时间,取值区间为 [0, duration] + */ + getPlayTime: function() { + return this.rollbacking ? this.duration - this.time : this.time; + }, + /** + * @method getTimeProportion() + * @for kity.Timeline + * @grammar getTimeProportion() => {Number} + * @description 获得当前播放时间的比例,取值区间为 [0, 1] + */ + getTimeProportion: function() { + return this.getPlayTime() / this.duration; + }, + /** + * @method getValueProportion() + * @for kity.Timeline + * @grammar getValueProportion() => {Number} + * @description 获得当前播放时间对应值的比例,取值区间为 [0, 1];该值实际上是时间比例值经过缓动函数计算之后的值。 + */ + getValueProportion: function() { + return this.easing(this.getPlayTime(), 0, 1, this.duration); + }, + /** + * @method getValue() + * @for kity.Timeline + * @grammar getValue() => {any} + * @description 返回当前播放时间对应的值。 + */ + getValue: function() { + var b = this.beginValue; + var f = this.finishValue; + var p = this.getValueProportion(); + return getPercentValue(b, f, p); + }, + /** + * @private + * + * 把值通过动画器的 setter 设置到目标上 + */ + setValue: function(value) { + this.lastValue = this.currentValue; + this.currentValue = value; + this.setter.call(this.target, this.target, value, this); + }, + /** + * @method getDelta() + * @for kity.Timeline + * @grammar getDelta() => {any} + * @description 返回当前值和上一帧的值的差值 + */ + getDelta: function() { + this.lastValue = this.lastValue === undefined ? this.beginValue : this.lastValue; + return getDelta(this.lastValue, this.currentValue); + }, + /** + * @method play() + * @for kity.Timeline + * @grammar play() => {this} + * @description 让时间线播放,如果时间线还没开始,或者已停止、已结束,则重头播放;如果是已暂停,从暂停的位置继续播放 + */ + play: function() { + var lastStatus = this.status; + this.status = "playing"; + switch (lastStatus) { + case "ready": + if (utils.isFunction(this.beginValue)) { + this.beginValue = this.beginValue.call(this.target, this.target); + } + if (utils.isFunction(this.finishValue)) { + this.finishValue = this.finishValue.call(this.target, this.target); + } + this.time = 0; + this.setValue(this.beginValue); + this.frame = frame.requestFrame(this.nextFrame.bind(this)); + break; + + case "finished": + case "stoped": + this.time = 0; + this.frame = frame.requestFrame(this.nextFrame.bind(this)); + break; + + case "paused": + this.frame.next(); + } + /** + * @event play + * @for kity.Timeline + * @description 在时间线播放后触发 + * + * @param {String} event.lastStatus + * 表示播放前的上一个状态,可能取值为 'ready'、'finished'、'stoped'、'paused' + */ + this.fire("play", new TimelineEvent(this, "play", { + lastStatus: lastStatus + })); + return this; + }, + /** + * @method pause() + * @for kity.Timeline + * @description 暂停当前的时间线 + * + * @grammar pause() => {this} + */ + pause: function() { + this.status = "paused"; + /** + * @event pause + * @for kity.Timeline + * @description 暂停事件,在时间线暂停时触发 + */ + this.fire("pause", new TimelineEvent(this, "pause")); + frame.releaseFrame(this.frame); + return this; + }, + /** + * @method stop() + * @for kity.Timeline + * @description 停止当前时间线 + * + * @grammar stop() => {this} + */ + stop: function() { + this.status = "stoped"; + this.setValue(this.finishValue); + this.rollbacking = false; + /** + * @event stop + * @for kity.Timeline + * @description 停止时间,在时间线停止时触发 + */ + this.fire("stop", new TimelineEvent(this, "stop")); + frame.releaseFrame(this.frame); + return this; + }, + /** + * @private + * + * 播放结束之后的处理 + */ + timeUp: function() { + if (this.repeatOption) { + this.time = 0; + if (this.rollback) { + if (this.rollbacking) { + this.decreaseRepeat(); + this.rollbacking = false; + } else { + this.rollbacking = true; + /** + * @event rollback + * @for kity.Timeline + * @description 回滚事件,在时间线回滚播放开始的时候触发 + */ + this.fire("rollback", new TimelineEvent(this, "rollback")); + } + } else { + this.decreaseRepeat(); + } + if (!this.repeatOption) { + this.finish(); + } else { + /** + * @event repeat + * @for kity.Timeline + * @description 循环事件,在时间线循环播放开始的时候触发 + */ + this.fire("repeat", new TimelineEvent(this, "repeat")); + } + } else { + this.finish(); + } + }, + /** + * @private + * + * 决定播放结束的处理 + */ + finish: function() { + this.setValue(this.finishValue); + this.status = "finished"; + /** + * @event finish + * @for kity.Timeline + * @description 结束事件,在时间线播放结束后触发(包括重复和回滚都结束) + */ + this.fire("finish", new TimelineEvent(this, "finish")); + frame.releaseFrame(this.frame); + }, + /** + * @private + * + * 循环次数递减 + */ + decreaseRepeat: function() { + if (this.repeatOption !== true) { + this.repeatOption--; + } + }, + /** + * @method repeat() + * @for kity.Timeline + * @description 设置时间线的重复选项 + * + * @grammar repeat(repeat, rollback) => {this} + * + * @param {Number|Boolean} repeat + * 是否重复播放,设置为 true 无限循环播放,设置数值则循环指定的次数 + * @param {Boolean} rollback + * 指示是否要回滚播放。 + * 如果设置为真,一次事件到 duration 则一个来回算一次循环次数,否则播放完成一次算一次循环次数 + * + */ + repeat: function(repeat, rollback) { + this.repeatOption = repeat; + this.rollback = rollback; + return this; + } + }); + Timeline.requestFrame = frame.requestFrame; + Timeline.releaseFrame = frame.releaseFrame; + return Timeline; + } +}; + +//src/animate/translateanimator.js +/** + * @fileOverview + * + * 提供让图形移动的动画器 + */ +_p[9] = { + value: function(require) { + var Animator = _p.r(0); + /** + * @class kity.TranslateAnimator + * @base kity.Animator + * @description 提供让图形移动的动画器 + */ + var TranslateAnimator = _p.r(11).createClass("TranslateAnimator", { + base: Animator, + /** + * @constructor + * @for kity.TranslateAnimator + * @grammar new kity.TranslateAnimator(x, y) + * @param {Number} x x 方向上需要移动的距离 + * @param {Number} y y 方向上需要移动的距离 + */ + constructor: function(x, y) { + this.callBase({ + x: 0, + y: 0 + }, { + x: x, + y: y + }, function(target, value, timeline) { + var delta = timeline.getDelta(); + target.translate(delta.x, delta.y); + }); + } + }); + var Shape = _p.r(60); + _p.r(11).extendClass(Shape, { + /** + * @method fxTranslate() + * @for kity.Shape + * @description 让目标以动画平移指定的距离 + * + * @grammar fxTranslate(x, y, duration, easing, delay, callback) => {this} + * + * @param {Number} x x 方向上需要移动的距离 + * @param {Number} y y 方向上需要移动的距离 + * @param {Number|String} duration 动画的播放长度,如 300、"5s"、"0.5min" + * @param {Number|String} delay 动画播放前的延时 + * @param {String|Function} easing 动画播放使用的缓动函数,如 'ease'、'linear'、'swing' + * @param {Function} callback 播放结束之后的回调函数 + */ + fxTranslate: function(x, y, duration, easing, delay, callback) { + return this.animate(new TranslateAnimator(x, y), duration, easing, delay, callback); + } + }); + return TranslateAnimator; + } +}; + +//src/core/browser.js +/** + * @fileOverview + * + * 提供浏览器判断的一些字段 + */ +_p[10] = { + value: function() { + /** + * @class kity.Browser + * @catalog core + * @static + * @description 提供浏览器信息 + */ + var browser = function() { + var agent = navigator.userAgent.toLowerCase(), opera = window.opera, browser; + // 浏览器对象 + browser = { + /** + * @property platform + * @description 获取浏览器所在系统,"Win"->Windows;"Mac"->Mac;"Lux"->Linux + * @type {String} + */ + platform: function(navigator) { + var _p = { + win32: "Win", + macintel: "Mac" + }; + return _p[navigator.platform.toLowerCase()] || "Lux"; + }(navigator), + /** + * 猎豹,区分两种不同内核 + */ + lb: function(agent) { + if (~agent.indexOf("lbbrowser")) { + return ~agent.indexOf("msie") ? "ie" : "chrome"; + } + return false; + }(agent), + /** + * 搜狗 + */ + sg: /se[\s\S]+metasr/.test(agent), + /** + * 百度 + */ + bd: !!~agent.indexOf("bidubrowser"), + /** + * edge浏览器 + */ + edge: !!~agent.indexOf("edge"), + /** + * chrome初始化为false + * @type {Boolean} + */ + chrome: false, + /** + * @property opera + * @for kity.Browser + * @description 判断是否为 Opera 浏览器 + * @type {boolean} + */ + opera: !!opera && opera.version, + /** + * @property webkit + * @for kity.Browser + * @description 判断是否为 Webkit 内核的浏览器 + * @type {boolean} + */ + webkit: agent.indexOf(" applewebkit/") > -1, + /** + * @property mac + * @for kity.Browser + * @description 判断是否为 Mac 下的浏览器 + * @type {boolean} + */ + mac: agent.indexOf("macintosh") > -1 + }; + /** + * @property ie + * @for kity.Browser + * @description 判断是否为 IE 浏览器 + * @type {boolean} + */ + browser.ie = !browser.lb && /(msie\s|trident.*rv:)([\w.]+)/.test(agent); + browser.gecko = navigator.product == "Gecko" && !browser.webkit && !browser.opera && !browser.ie; + var version = 0; + // Internet Explorer 6.0+ + if (browser.ie) { + version = (agent.match(/(msie\s|trident.*rv:)([\w.]+)/)[2] || 0) * 1; + browser.ie11Compat = document.documentMode == 11; + browser.ie9Compat = document.documentMode == 9; + } + // Gecko. + if (browser.gecko) { + var geckoRelease = agent.match(/rv:([\d\.]+)/); + if (geckoRelease) { + geckoRelease = geckoRelease[1].split("."); + version = geckoRelease[0] * 1e4 + (geckoRelease[1] || 0) * 100 + (geckoRelease[2] || 0) * 1; + } + } + // 排除其他chrome内核的浏览器的干扰 + if (/chrome\/(\d+\.\d)/i.test(agent) && !browser.bd && !browser.opera && !browser.lb && !browser.sg && !browser.edge) { + /** + * @property chrome + * @for kity.Browser + * @description 判断是否为 Chrome 浏览器 + * @type {boolean} + */ + browser.chrome = +RegExp["$1"]; + } + if (/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(agent) && !/chrome/i.test(agent)) { + browser.safari = +(RegExp["$1"] || RegExp["$2"]); + } + // Opera 9.50+ + if (browser.opera) version = parseFloat(opera.version()); + // WebKit 522+ (Safari 3+) + if (browser.webkit) version = parseFloat(agent.match(/ applewebkit\/(\d+)/)[1]); + // 搜狗版本号无从得知 + // 猎豹版本号无从得知 + // 百度 + if (browser.bd) version = parseFloat(agent.match(/bidubrowser\/(\d+)/)[1]); + // Opera 9.50+ + if (browser.opera) version = parseFloat(agent.match(/opr\/(\d+)/)[1]); + // edge + if (browser.edge) version = parseFloat(agent.match(/edge\/(\d+)/)[1]); + /** + * @property version + * @for kity.Browser + * @description 获取当前浏览器的版本 + * @type {Number} + */ + browser.version = version; + browser.isCompatible = !browser.mobile && (browser.ie && version >= 6 || browser.gecko && version >= 10801 || browser.opera && version >= 9.5 || browser.air && version >= 1 || browser.webkit && version >= 522 || false); + return browser; + }(); + return browser; + } +}; + +//src/core/class.js +/** + * @fileOverview + * + * 提供 Kity 的 OOP 支持 + */ +_p[11] = { + value: function(require, exports) { + /** + * @class kity.Class + * @catalog core + * @description 所有 kity 类的基类 + * @abstract + */ + function Class() {} + exports.Class = Class; + Class.__KityClassName = "Class"; + /** + * @method base() + * @for kity.Class + * @protected + * @grammar base(name, args...) => {any} + * @description 调用父类指定名称的函数 + * @param {string} name 函数的名称 + * @param {parameter} args... 传递给父类函数的参数 + * + * @example + * + * ```js + * var Person = kity.createClass('Person', { + * toString: function() { + * return 'I am a person'; + * } + * }); + * + * var Male = kity.createClass('Male', { + * base: Person, + * + * toString: function() { + * return 'I am a man'; + * }, + * + * speak: function() { + * return this.base('toString') + ',' + this.toString(); + * } + * }) + * ``` + */ + Class.prototype.base = function(name) { + var caller = arguments.callee.caller; + var method = caller.__KityMethodClass.__KityBaseClass.prototype[name]; + return method.apply(this, Array.prototype.slice.call(arguments, 1)); + }; + /** + * @method callBase() + * @for kity.Class + * @protected + * @grammar callBase(args...) => {any} + * @description 调用父类同名函数 + * @param {parameter} args... 传递到父类同名函数的参数 + * + * @example + * + * ```js + * var Animal = kity.createClass('Animal', { + * constructor: function(name) { + * this.name = name; + * }, + * toString: function() { + * return 'I am an animal name ' + this.name; + * } + * }); + * + * var Dog = kity.createClass('Dog', { + * constructor: function(name) { + * this.callBase(name); + * }, + * toString: function() { + * return this.callBase() + ', a dog'; + * } + * }); + * + * var dog = new Dog('Dummy'); + * console.log(dog.toString()); // "I am an animal name Dummy, a dog"; + * ``` + */ + Class.prototype.callBase = function() { + var caller = arguments.callee.caller; + var method = caller.__KityMethodClass.__KityBaseClass.prototype[caller.__KityMethodName]; + return method.apply(this, arguments); + }; + Class.prototype.mixin = function(name) { + var caller = arguments.callee.caller; + var mixins = caller.__KityMethodClass.__KityMixins; + if (!mixins) { + return this; + } + var method = mixins[name]; + return method.apply(this, Array.prototype.slice.call(arguments, 1)); + }; + Class.prototype.callMixin = function() { + var caller = arguments.callee.caller; + var methodName = caller.__KityMethodName; + var mixins = caller.__KityMethodClass.__KityMixins; + if (!mixins) { + return this; + } + var method = mixins[methodName]; + if (methodName == "constructor") { + for (var i = 0, l = method.length; i < l; i++) { + method[i].call(this); + } + return this; + } else { + return method.apply(this, arguments); + } + }; + /** + * @method pipe() + * @for kity.Class + * @grammar pipe() => {this} + * @description 以当前对象为上线文以及管道函数的第一个参数,执行一个管道函数 + * @param {Function} fn 进行管道操作的函数 + * + * @example + * + * ```js + * var rect = new kity.Rect().pipe(function() { + * this.setWidth(500); + * this.setHeight(300); + * }); + * ``` + */ + Class.prototype.pipe = function(fn) { + if (typeof fn == "function") { + fn.call(this, this); + } + return this; + }; + /** + * @method getType() + * @for kity.Class + * @grammar getType() => {string} + * @description 获得对象的类型 + * + * @example + * + * ```js + * var rect = new kity.Rect(); + * var circle = new kity.Circle(); + * + * console.log(rect.getType()); // "Rect" + * console.log(rect.getType()); // "Circle" + * ``` + */ + Class.prototype.getType = function() { + return this.__KityClassName; + }; + /** + * @method getClass() + * @for kity.Class + * @grammar getClass() => {Class} + * @description 获得对象的类 + * + * @example + * + * ```js + * var rect = new kity.Rect(); + * + * console.log(rect.getClass() === kity.Rect); // true + * console.log(rect instanceof kity.Rect); // true + * ``` + */ + Class.prototype.getClass = function() { + return this.constructor; + }; + // 检查基类是否调用了父类的构造函数 + // 该检查是弱检查,假如调用的代码被注释了,同样能检查成功(这个特性可用于知道建议调用,但是出于某些原因不想调用的情况) + function checkBaseConstructorCall(targetClass, classname) { + var code = targetClass.toString(); + if (!/this\.callBase/.test(code)) { + throw new Error(classname + " : 类构造函数没有调用父类的构造函数!为了安全,请调用父类的构造函数"); + } + } + var KITY_INHERIT_FLAG = "__KITY_INHERIT_FLAG_" + +new Date(); + function inherit(constructor, BaseClass, classname) { + var KityClass = eval("(function " + classname + "( __inherit__flag ) {" + "if( __inherit__flag != KITY_INHERIT_FLAG ) {" + "KityClass.__KityConstructor.apply(this, arguments);" + "}" + "this.__KityClassName = KityClass.__KityClassName;" + "})"); + KityClass.__KityConstructor = constructor; + KityClass.prototype = new BaseClass(KITY_INHERIT_FLAG); + for (var methodName in BaseClass.prototype) { + if (BaseClass.prototype.hasOwnProperty(methodName) && methodName.indexOf("__Kity") !== 0) { + KityClass.prototype[methodName] = BaseClass.prototype[methodName]; + } + } + KityClass.prototype.constructor = KityClass; + return KityClass; + } + function mixin(NewClass, mixins) { + if (false === mixins instanceof Array) { + return NewClass; + } + var i, length = mixins.length, proto, method; + NewClass.__KityMixins = { + constructor: [] + }; + for (i = 0; i < length; i++) { + proto = mixins[i].prototype; + for (method in proto) { + if (false === proto.hasOwnProperty(method) || method.indexOf("__Kity") === 0) { + continue; + } + if (method === "constructor") { + // constructor 特殊处理 + NewClass.__KityMixins.constructor.push(proto[method]); + } else { + NewClass.prototype[method] = NewClass.__KityMixins[method] = proto[method]; + } + } + } + return NewClass; + } + function extend(BaseClass, extension) { + if (extension.__KityClassName) { + extension = extension.prototype; + } + for (var methodName in extension) { + if (extension.hasOwnProperty(methodName) && methodName.indexOf("__Kity") && methodName != "constructor") { + var method = BaseClass.prototype[methodName] = extension[methodName]; + method.__KityMethodClass = BaseClass; + method.__KityMethodName = methodName; + } + } + return BaseClass; + } + /** + * @method kity.createClass() + * @grammar kity.createClass(classname, defines) => {Class} + * @description 创建一个类 + * @param {string} classname 类名,用于调试的时候查看,可选 + * @param {object} defines 类定义 + * defines.base {Class} + * 定义的类的基类,如果不配置,则表示基类为 kity.Class + * defines.mixins {Class[]} + * 定义的类要融合的类列表 + * defines.constructor {Function} + * 定义类的构造函数,如果父类显式定义了构造函数,需要在构造函数中使用 callBase() 方法调用父类的构造函数 + * defines.* {Function} + * 定义类的其它函数 + * + * @example 创建一个类 + * + * ```js + * var Animal = kity.createClass('Animal', { + * constructor: function(name) { + * this.name = name; + * }, + * toString: function() { + * return this.name; + * } + * }); + * + * var a = new Animal('kity'); + * console.log(a.toString()); // "kity" + * ``` + * + * @example 继承一个类 + * + * ```js + * var Cat = kity.createClass('Cat', { + * base: Animal, + * constructor: function(name, color) { + * // 调用父类构造函数 + * this.callBase(name); + * }, + * toString: function() { + * return 'A ' + this.color + ' cat, ' + this.callBase(); + * } + * }); + * + * var cat = new Cat('kity', 'black'); + * console.log(cat.toString()); // "A black cat, kity" + * ``` + * + * @example 混合类的能力 + * ```js + * var Walkable = kity.createClass('Walkable', { + * constructor: function() { + * this.speed = 'fast'; + * }, + * walk: function() { + * console.log('I am walking ' + this.speed); + * } + * }); + * + * var Dog = kity.createClass('Dog', { + * base: Animal, + * mixins: [Walkable], + * constructor: function(name) { + * this.callBase(name); + * this.callMixins(); + * } + * }); + * + * var dog = new Dog('doggy'); + * console.log(dog.toString() + ' say:'); + * dog.walk(); + * ``` + */ + exports.createClass = function(classname, defines) { + var constructor, NewClass, BaseClass; + if (arguments.length === 1) { + defines = arguments[0]; + classname = "AnonymousClass"; + } + BaseClass = defines.base || Class; + if (defines.hasOwnProperty("constructor")) { + constructor = defines.constructor; + if (BaseClass != Class) { + checkBaseConstructorCall(constructor, classname); + } + } else { + constructor = function() { + this.callBase.apply(this, arguments); + this.callMixin.apply(this, arguments); + }; + } + NewClass = inherit(constructor, BaseClass, classname); + NewClass = mixin(NewClass, defines.mixins); + NewClass.__KityClassName = constructor.__KityClassName = classname; + NewClass.__KityBaseClass = constructor.__KityBaseClass = BaseClass; + NewClass.__KityMethodName = constructor.__KityMethodName = "constructor"; + NewClass.__KityMethodClass = constructor.__KityMethodClass = NewClass; + // 下面这些不需要拷贝到原型链上 + delete defines.mixins; + delete defines.constructor; + delete defines.base; + NewClass = extend(NewClass, defines); + return NewClass; + }; + /** + * @method kity.extendClass() + * @grammar kity.extendClass(clazz, extension) => {Class} + * @description 拓展一个已有的类 + * + * @example + * + * ```js + * kity.extendClass(Dog, { + * spark: function() { + * console.log('wao wao wao!'); + * } + * }); + * + * new Dog().spark(); // "wao wao wao!"; + * ``` + */ + exports.extendClass = extend; + } +}; + +//src/core/utils.js +/** + * @fileOverview + * + * 一些常用的工具方法 + */ +_p[12] = { + value: function() { + /** + * @class kity.Utils + * @catalog core + * @static + * @description 提供常用的工具方法 + */ + var utils = { + /** + * @method each() + * @for kity.Utils + * @grammar each(obj, interator, context) + * @param {Object|Array} obj 要迭代的对象或数组 + * @param {Function} iterator 迭代函数 + * @param {Any} context 迭代函数的上下文 + * + * @example 迭代数组 + * + * ```js + * kity.Utils.each([1, 2, 3, 4, 5], function(value, index, array) { + * console.log(value, index); + * }); + * // 1, 0 + * // 2, 1 + * // 3, 2 + * // 4, 3 + * // 5, 4 + * ``` + * + * @example 迭代对象 + * + * ```js + * var obj = { + * name: 'kity', + * version: '1.2.1' + * }; + * var param = []; + * kity.Utils.each(obj, function(value, key, obj) { + * param.push(key + '=' + value); + * }); + * console.log(param.join('&')); // "name=kity&version=1.2.1" + * ``` + */ + each: function each(obj, iterator, context) { + if (obj === null) { + return; + } + if (obj.length === +obj.length) { + for (var i = 0, l = obj.length; i < l; i++) { + if (iterator.call(context, obj[i], i, obj) === false) { + return false; + } + } + } else { + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + if (iterator.call(context, obj[key], key, obj) === false) { + return false; + } + } + } + } + }, + /** + * @method extend() + * @for kity.Utils + * @grammar extend(target, sources..., notCover) => {object} + * @description 把源对象的属性合并到目标对象上 + * @param {object} target 目标对象 + * @param {parameter} sources 源对象 + * @param {boolean} notCover 是否不要覆盖源对象已有的属性 + * + * @example + * + * ```js + * var a = { + * key1: 'a1', + * key2: 'a2' + * }; + * + * var b = { + * key2: 'b2', + * key3: 'b3' + * }; + * + * var c = { + * key4: 'c4' + * }; + * + * var d = kity.extend(a, b, c); + * + * console.log(d === a); // true + * console.log(a); // {key1: 'a1', key2: 'b2', key3: 'b3', key4: 'c4'} + * ``` + */ + extend: function extend(t) { + var a = arguments, notCover = this.isBoolean(a[a.length - 1]) ? a[a.length - 1] : false, len = this.isBoolean(a[a.length - 1]) ? a.length - 1 : a.length; + for (var i = 1; i < len; i++) { + var x = a[i]; + for (var k in x) { + if (!notCover || !t.hasOwnProperty(k)) { + t[k] = x[k]; + } + } + } + return t; + }, + /** + * @method deepExtend() + * @for kity.Utils + * @grammar deepExtend(target, sources..., notCover) + * @description 把源对象的属性合并到目标对象上,如果属性是对象,会递归合并 + * @param {object} target 目标对象 + * @param {parameter} sources 源对象 + * @param {boolean} notCover 是否不要覆盖源对象已有的属性 + */ + deepExtend: function(t, s) { + var a = arguments, notCover = this.isBoolean(a[a.length - 1]) ? a[a.length - 1] : false, len = this.isBoolean(a[a.length - 1]) ? a.length - 1 : a.length; + for (var i = 1; i < len; i++) { + var x = a[i]; + for (var k in x) { + if (!notCover || !t.hasOwnProperty(k)) { + if (this.isObject(t[k]) && this.isObject(x[k])) { + this.deepExtend(t[k], x[k], notCover); + } else { + t[k] = x[k]; + } + } + } + } + return t; + }, + /** + * @method clone() + * @for kity.Utils + * @grammar clone(obj) => {object} + * @description 返回一个对象的克隆副本(非深度复制) + * @param {object} obj 要克隆的对象 + * + * @example + * + * ```js + * var source = { + * key1: { + * key2: 'value2' + * }, + * key3: 'value3' + * }; + * + * var target = kity.Utils.clone(source); + * + * console.log(target === source); // false + * console.log(target.key1 === source.key1); // true + * console.log(target.key3 === source.key3); // true + * ``` + */ + clone: function clone(obj) { + var cloned = {}; + for (var m in obj) { + if (obj.hasOwnProperty(m)) { + cloned[m] = obj[m]; + } + } + return cloned; + }, + /** + * @method copy() + * @for kity.Utils + * @grammar copy(obj) => {object} + * @description 返回一个对象的拷贝副本(深度复制) + * @param {object} obj 要拷贝的对象 + * + * @example + * + * ```js + * var source = { + * key1: { + * key2: 'value2' + * }, + * key3: 'value3' + * }; + * + * var target = kity.Utils.copy(source); + * + * console.log(target === source); // false + * console.log(target.key1 === source.key1); // false + * console.log(target.key3 === source.key3); // true,因为是值类型 + * ``` + */ + copy: function copy(obj) { + if (typeof obj !== "object") return obj; + if (typeof obj === "function") return null; + return JSON.parse(JSON.stringify(obj)); + }, + queryPath: function(path, obj) { + var arr = path.split("."); + var i = 0, tmp = obj, l = arr.length; + while (i < l) { + if (arr[i] in tmp) { + tmp = tmp[arr[i]]; + i++; + if (i >= l || tmp === undefined) { + return tmp; + } + } else { + return undefined; + } + } + }, + getValue: function(value, defaultValue) { + return value !== undefined ? value : defaultValue; + }, + /** + * @method flatten() + * @for kity.Utils + * @grammar flatten(arr) => {Array} + * @description 返回给定数组的扁平化版本 + * @param {Array} arr 要扁平化的数组 + * + * @example + * + * ```js + * var flattened = kity.Utils.flatten([[1, 2], [2, 3], [[4, 5], [6, 7]]]); + * console.log(flattened); // [1, 2, 3, 4, 5, 6, 7]; + * ``` + */ + flatten: function flatten(arr) { + var result = [], length = arr.length, i; + for (i = 0; i < length; i++) { + if (arr[i] instanceof Array) { + result = result.concat(utils.flatten(arr[i])); + } else { + result.push(arr[i]); + } + } + return result; + }, + /** + * @method paralle() + * @for kity.Utils + * @grammar paralle() => {Any} + * + * @description 平行地对 v1 和 v2 进行指定的操作 + * + * 如果 v1 是数字,那么直接进行 op 操作 + * 如果 v1 是对象,那么返回一个对象,其元素是 v1 和 v2 同键值的每个元素平行地进行 op 操作的结果 + * 如果 v1 是数组,那么返回一个数组,其元素是 v1 和 v2 同索引的每个元素平行地进行 op 操作的结果 + * + * @param {Number|Object|Array} v1 第一个操作数 + * @param {Number|Object|Array} v2 第二个操作数 + * @param {Function} op 操作函数 + * + * + * + * @example + * + * ```js + * var a = { + * value1: 1, + * value2: 2, + * value3: [3, 4, 5] + * }; + * + * var b = { + * value1: 2, + * value2: 3, + * value3: [4, 5, 6] + * }; + * + * var c = kity.Utils.paralle(a, b, function(v1, v2) { + * return v1 + v2; + * }); + * + * console.log(c.value1); // 3 + * console.log(c.value2); // 5 + * console.log(c.value3); // [7, 9, 11] + * + * ``` + */ + paralle: function paralle(v1, v2, op) { + var Class, field, index, name, value; + // 数组 + if (v1 instanceof Array) { + value = []; + for (index = 0; index < v1.length; index++) { + value.push(utils.paralle(v1[index], v2[index], op)); + } + return value; + } + // 对象 + if (v1 instanceof Object) { + // 如果值是一个支持原始表示的实例,获取其原始表示 + Class = v1.getClass && v1.getClass(); + if (Class && Class.parse) { + v1 = v1.valueOf(); + v2 = v2.valueOf(); + value = utils.paralle(v1, v2, op); + value = Class.parse(value); + } else { + value = {}; + for (name in v1) { + if (v1.hasOwnProperty(name) && v2.hasOwnProperty(name)) { + value[name] = utils.paralle(v1[name], v2[name], op); + } + } + } + return value; + } + // 是否数字 + if (false === isNaN(parseFloat(v1))) { + return op(v1, v2); + } + return value; + }, + /** + * 创建 op 操作的一个平行化版本 + */ + parallelize: function parallelize(op) { + return function(v1, v2) { + return utils.paralle(v1, v2, op); + }; + } + }; + /** + * @method isString() + * @for kity.Utils + * @grammar isString(unknown) => {boolean} + * @description 判断一个值是否为字符串类型 + * @param {any} unknown 要判断的值 + */ + /** + * @method isFunction() + * @for kity.Utils + * @grammar isFunction(unknown) => {boolean} + * @description 判断一个值是否为函数类型 + * @param {any} unknown 要判断的值 + */ + /** + * @method isArray() + * @for kity.Utils + * @grammar isArray(unknown) => {boolean} + * @description 判断一个值是否为数组类型 + * @param {any} unknown 要判断的值 + */ + /** + * @method isNumber() + * @for kity.Utils + * @grammar isNumber(unknown) => {boolean} + * @description 判断一个值是否为数字类型 + * @param {any} unknown 要判断的值 + */ + /** + * @method isRegExp() + * @for kity.Utils + * @grammar isRegExp(unknown) => {boolean} + * @description 判断一个值是否为正则表达式类型 + * @param {any} unknown 要判断的值 + */ + /** + * @method isObject() + * @for kity.Utils + * @grammar isObject(unknown) => {boolean} + * @description 判断一个值是否为对象类型 + * @param {any} unknown 要判断的值 + */ + /** + * @method isBoolean() + * @for kity.Utils + * @grammar isBoolean(unknown) => {boolean} + * @description 判断一个值是否为布尔类型 + * @param {any} unknown 要判断的值 + */ + utils.each([ "String", "Function", "Array", "Number", "RegExp", "Object", "Boolean" ], function(v) { + utils["is" + v] = function typeCheck(obj) { + return Object.prototype.toString.apply(obj) == "[object " + v + "]"; + }; + }); + return utils; + } +}; + +//src/filter/effect/colormatrixeffect.js +/** + * 颜色矩阵运算效果封装 + */ +_p[13] = { + value: function(require, exports, module) { + var Effect = _p.r(16), Utils = _p.r(12); + var ColorMatrixEffect = _p.r(11).createClass("ColorMatrixEffect", { + base: Effect, + constructor: function(type, input) { + this.callBase(Effect.NAME_COLOR_MATRIX); + this.set("type", Utils.getValue(type, ColorMatrixEffect.TYPE_MATRIX)); + this.set("in", Utils.getValue(input, Effect.INPUT_SOURCE_GRAPHIC)); + } + }); + Utils.extend(ColorMatrixEffect, { + // 类型常量 + TYPE_MATRIX: "matrix", + TYPE_SATURATE: "saturate", + TYPE_HUE_ROTATE: "hueRotate", + TYPE_LUMINANCE_TO_ALPHA: "luminanceToAlpha", + // 矩阵常量 + MATRIX_ORIGINAL: "10000010000010000010".split("").join(" "), + MATRIX_EMPTY: "00000000000000000000".split("").join(" ") + }); + return ColorMatrixEffect; + } +}; + +//src/filter/effect/compositeeffect.js +/** + * 高斯模糊效果封装 + */ +_p[14] = { + value: function(require, exports, module) { + var Effect = _p.r(16), Utils = _p.r(12); + var CompositeEffect = _p.r(11).createClass("CompositeEffect", { + base: Effect, + constructor: function(operator, input, input2) { + this.callBase(Effect.NAME_COMPOSITE); + this.set("operator", Utils.getValue(operator, CompositeEffect.OPERATOR_OVER)); + if (input) { + this.set("in", input); + } + if (input2) { + this.set("in2", input2); + } + } + }); + Utils.extend(CompositeEffect, { + // operator 常量 + OPERATOR_OVER: "over", + OPERATOR_IN: "in", + OPERATOR_OUT: "out", + OPERATOR_ATOP: "atop", + OPERATOR_XOR: "xor", + OPERATOR_ARITHMETIC: "arithmetic" + }); + return CompositeEffect; + } +}; + +//src/filter/effect/convolvematrixeffect.js +/** + * 像素级别的矩阵卷积运算效果封装 + */ +_p[15] = { + value: function(require, exports, module) { + var Effect = _p.r(16), Utils = _p.r(12); + var ConvolveMatrixEffect = _p.r(11).createClass("ConvolveMatrixEffect", { + base: Effect, + constructor: function(edgeMode, input) { + this.callBase(Effect.NAME_CONVOLVE_MATRIX); + this.set("edgeMode", Utils.getValue(edgeMode, ConvolveMatrixEffect.MODE_DUPLICATE)); + this.set("in", Utils.getValue(input, Effect.INPUT_SOURCE_GRAPHIC)); + } + }); + Utils.extend(ConvolveMatrixEffect, { + MODE_DUPLICATE: "duplicate", + MODE_WRAP: "wrap", + MODE_NONE: "none" + }); + return ConvolveMatrixEffect; + } +}; + +//src/filter/effect/effect.js +/* + * 效果类 + * 该类型的对象不存储任何内部属性, 所有操作都是针对该类对象所维护的节点进行的 + */ +_p[16] = { + value: function(require, exports, module) { + var svg = _p.r(67), Effect = _p.r(11).createClass("Effect", { + constructor: function(type) { + this.node = svg.createNode(type); + }, + getId: function() { + return this.node.id; + }, + setId: function(id) { + this.node.id = id; + return this; + }, + set: function(key, value) { + this.node.setAttribute(key, value); + return this; + }, + get: function(key) { + return this.node.getAttribute(key); + }, + getNode: function() { + return this.node; + }, + // 返回该效果的result + toString: function() { + return this.node.getAttribute("result") || ""; + } + }); + _p.r(12).extend(Effect, { + // 特效名称常量 + NAME_GAUSSIAN_BLUR: "feGaussianBlur", + NAME_OFFSET: "feOffset", + NAME_COMPOSITE: "feComposite", + NAME_COLOR_MATRIX: "feColorMatrix", + NAME_CONVOLVE_MATRIX: "feConvolveMatrix", + // 输入常量 + INPUT_SOURCE_GRAPHIC: "SourceGraphic", + INPUT_SOURCE_ALPHA: "SourceAlpha", + INPUT_BACKGROUND_IMAGE: "BackgroundImage", + INPUT_BACKGROUND_ALPHA: "BackgroundAlpha", + INPUT_FILL_PAINT: "FillPaint", + INPUT_STROKE_PAINT: "StrokePaint" + }); + return Effect; + } +}; + +//src/filter/effect/gaussianblureffect.js +/** + * 高斯模糊效果封装 + */ +_p[17] = { + value: function(require, exports, module) { + var Effect = _p.r(16), Utils = _p.r(12); + return _p.r(11).createClass("GaussianblurEffect", { + base: Effect, + constructor: function(stdDeviation, input) { + this.callBase(Effect.NAME_GAUSSIAN_BLUR); + this.set("stdDeviation", Utils.getValue(stdDeviation, 1)); + this.set("in", Utils.getValue(input, Effect.INPUT_SOURCE_GRAPHIC)); + } + }); + } +}; + +//src/filter/effect/offseteffect.js +/** + * 偏移效果封装 + */ +_p[18] = { + value: function(require, exports, module) { + var Effect = _p.r(16), Utils = _p.r(12); + return _p.r(11).createClass("OffsetEffect", { + base: Effect, + constructor: function(dx, dy, input) { + this.callBase(Effect.NAME_OFFSET); + this.set("dx", Utils.getValue(dx, 0)); + this.set("dy", Utils.getValue(dy, 0)); + this.set("in", Utils.getValue(input, Effect.INPUT_SOURCE_GRAPHIC)); + } + }); + } +}; + +//src/filter/effectcontainer.js +/* + * Effect所用的container + */ +_p[19] = { + value: function(require) { + return _p.r(11).createClass("EffectContainer", { + base: _p.r(29), + addEffect: function(point, pos) { + return this.addItem.apply(this, arguments); + }, + prependEffect: function() { + return this.prependItem.apply(this, arguments); + }, + appendEffect: function() { + return this.appendItem.apply(this, arguments); + }, + removeEffect: function(pos) { + return this.removeItem.apply(this, arguments); + }, + addEffects: function() { + return this.addItems.apply(this, arguments); + }, + setEffects: function() { + return this.setItems.apply(this, arguments); + }, + getEffect: function() { + return this.getItem.apply(this, arguments); + }, + getEffects: function() { + return this.getItems.apply(this, arguments); + }, + getFirstEffect: function() { + return this.getFirstItem.apply(this, arguments); + }, + getLastEffect: function() { + return this.getLastItem.apply(this, arguments); + }, + handleAdd: function(effectItem, pos) { + var count = this.getEffects().length, nextEffectItem = this.getItem(pos + 1); + // 最后一个节点, 直接追加 + if (count === pos + 1) { + this.node.appendChild(effectItem.getNode()); + return; + } + this.node.insertBefore(effectItem.getNode(), nextEffectItem.getNode()); + } + }); + } +}; + +//src/filter/filter.js +/** + * Filter 基类 + */ +_p[20] = { + value: function(require, exports, module) { + var svg = _p.r(67); + var Class = _p.r(11); + var Filter = Class.createClass("Filter", { + mixins: [ _p.r(19) ], + constructor: function(x, y, width, height) { + this.node = svg.createNode("filter"); + if (x !== undefined) { + this.set("x", x); + } + if (y !== undefined) { + this.set("y", y); + } + if (width !== undefined) { + this.set("width", width); + } + if (height !== undefined) { + this.set("height", height); + } + }, + getId: function() { + return this.id; + }, + setId: function(id) { + this.node.id = id; + return this; + }, + set: function(key, value) { + this.node.setAttribute(key, value); + return this; + }, + get: function(key) { + return this.node.getAttribute(key); + }, + getNode: function() { + return this.node; + } + }); + var Shape = _p.r(60); + Class.extendClass(Shape, { + applyFilter: function(filter) { + var filterId = filter.get("id"); + if (filterId) { + this.node.setAttribute("filter", "url(#" + filterId + ")"); + } + return this; + } + }); + return Filter; + } +}; + +//src/filter/gaussianblurfilter.js +/* + * 高斯模糊滤镜 + */ +_p[21] = { + value: function(require, exports, module) { + var GaussianblurEffect = _p.r(17); + return _p.r(11).createClass("GaussianblurFilter", { + base: _p.r(20), + constructor: function(stdDeviation) { + this.callBase(); + this.addEffect(new GaussianblurEffect(stdDeviation)); + } + }); + } +}; + +//src/filter/projectionfilter.js +/* + * 投影滤镜 + */ +_p[22] = { + value: function(require, exports, module) { + var GaussianblurEffect = _p.r(17), Effect = _p.r(16), ColorMatrixEffect = _p.r(13), Color = _p.r(28), Utils = _p.r(12), CompositeEffect = _p.r(14), OffsetEffect = _p.r(18); + return _p.r(11).createClass("ProjectionFilter", { + base: _p.r(20), + constructor: function(stdDeviation, dx, dy) { + this.callBase(); + this.gaussianblurEffect = new GaussianblurEffect(stdDeviation, Effect.INPUT_SOURCE_ALPHA); + this.gaussianblurEffect.set("result", "gaussianblur"); + this.addEffect(this.gaussianblurEffect); + this.offsetEffect = new OffsetEffect(dx, dy, this.gaussianblurEffect); + this.offsetEffect.set("result", "offsetBlur"); + this.addEffect(this.offsetEffect); + this.colorMatrixEffect = new ColorMatrixEffect(ColorMatrixEffect.TYPE_MATRIX, this.offsetEffect); + this.colorMatrixEffect.set("values", ColorMatrixEffect.MATRIX_ORIGINAL); + this.colorMatrixEffect.set("result", "colorOffsetBlur"); + this.addEffect(this.colorMatrixEffect); + this.compositeEffect = new CompositeEffect(CompositeEffect.OPERATOR_OVER, Effect.INPUT_SOURCE_GRAPHIC, this.colorMatrixEffect); + this.addEffect(this.compositeEffect); + }, + // 设置投影颜色 + setColor: function(color) { + var matrix = null, originMatrix = null, colorValue = []; + if (Utils.isString(color)) { + color = Color.parse(color); + } + if (!color) { + return this; + } + matrix = ColorMatrixEffect.MATRIX_EMPTY.split(" "); + colorValue.push(color.get("r")); + colorValue.push(color.get("g")); + colorValue.push(color.get("b")); + // rgb 分量更改 + for (var i = 0, len = colorValue.length; i < len; i++) { + matrix[i * 5 + 3] = colorValue[i] / 255; + } + // alpha 分量更改 + matrix[18] = color.get("a"); + this.colorMatrixEffect.set("values", matrix.join(" ")); + return this; + }, + // 设置投影透明度 + setOpacity: function(opacity) { + var matrix = this.colorMatrixEffect.get("values").split(" "); + matrix[18] = opacity; + this.colorMatrixEffect.set("values", matrix.join(" ")); + return this; + }, + // 设置阴影偏移量 + setOffset: function(dx, dy) { + this.setOffsetX(dx); + this.setOffsetY(dy); + }, + setOffsetX: function(dx) { + this.offsetEffect.set("dx", dx); + }, + setOffsetY: function(dy) { + this.offsetEffect.set("dy", dy); + }, + setDeviation: function(deviation) { + this.gaussianblurEffect.set("stdDeviation", deviation); + } + }); + } +}; + +//src/graphic/bezier.js +/** + * @fileOverview + * + * 贝塞尔曲线 + */ +_p[23] = { + value: function(require, exports, module) { + /** + * @class kity.Bezier + * @mixins kity.PointContainer + * @base kity.Path + * @description 绘制和使用贝塞尔曲线。贝塞尔曲线作为一个贝塞尔点的容器,任何贝塞尔点的改变都会更改贝塞尔曲线的外观 + */ + return _p.r(11).createClass("Bezier", { + mixins: [ _p.r(51) ], + base: _p.r(46), + /** + * @constructor + * @for kity.Bezier + * + * @grammar new kity.Bezier(bezierPoints) + * + * @param {kity.BezierPoints[]} bezierPoints 贝塞尔点集合,每个元素应该是 {kity.BezierPoint} 类型 + * + * @example + * + * ```js + * var bezier = new kity.Bezier([ + * new kity.BezierPoint(0, 0).setForward(100, 0), + * new kity.BezierPoint(100, 100).setBackward(100, 0) + * ]); + * ``` + */ + constructor: function(bezierPoints) { + this.callBase(); + bezierPoints = bezierPoints || []; + this.changeable = true; + this.setBezierPoints(bezierPoints); + }, + /** + * @method getBezierPoints() + * @for kity.Bezier + * @description 返回当前贝塞尔曲线的贝塞尔点集合 + * + * @grammar getBezierPoints() => {kity.BezierPoints[]} + * + */ + getBezierPoints: function() { + return this.getPoints(); + }, + /** + * @method setBezierPoints() + * @for kity.Bezier + * @description 设置当前贝塞尔曲线的贝塞尔点集合 + * + * @grammar setBeizerPoints(bezierPoints) => {this} + * + * @param {kity.BezierPoint[]} bezierPoints 贝塞尔点集合 + */ + setBezierPoints: function(bezierPoints) { + return this.setPoints(bezierPoints); + }, + //当点集合发生变化时采取的动作 + onContainerChanged: function() { + if (this.changeable) { + this.update(); + } + }, + update: function() { + var drawer = null, bezierPoints = this.getBezierPoints(); + //单独的一个点不画任何图形 + if (bezierPoints.length < 2) { + return; + } + drawer = this.getDrawer(); + drawer.clear(); + var vertex = bezierPoints[0].getVertex(), forward = null, backward = null; + drawer.moveTo(vertex.x, vertex.y); + for (var i = 1, len = bezierPoints.length; i < len; i++) { + vertex = bezierPoints[i].getVertex(); + backward = bezierPoints[i].getBackward(); + forward = bezierPoints[i - 1].getForward(); + drawer.bezierTo(forward.x, forward.y, backward.x, backward.y, vertex.x, vertex.y); + } + return this; + } + }); + } +}; + +//src/graphic/bezierpoint.js +/** + * @fileOverview + * + * 表示一个贝塞尔点 + */ +_p[24] = { + value: function(require, exports, module) { + var ShapePoint = _p.r(63); + var Vector = _p.r(73); + /** + * @class kity.BezierPoint + * + * @description 表示一个贝塞尔点 + * 一个贝塞尔点由顶点坐标(曲线经过的点)、前方控制点、后方控制点表示 + */ + var BezierPoint = _p.r(11).createClass("BezierPoint", { + /** + * @constructor + * @for kity.BezierPoint + * + * @description 创建一个具有默认顶点坐标的贝塞尔点,两个控制点的坐标和顶点一致 + * + * @param {Number} x 顶点的 x 坐标 + * @param {Number} y 顶点的 y 坐标 + * @param {Boolean} isSmooth 指示当前贝塞尔点是否光滑,光滑会约束顶点和两个控制点共线 + */ + constructor: function(x, y, isSmooth) { + //顶点 + this.vertex = new ShapePoint(x, y); + //控制点 + this.forward = new ShapePoint(x, y); + this.backward = new ShapePoint(x, y); + //是否平滑 + this.setSmooth(isSmooth === undefined || isSmooth); + this.setSymReflaction(true); + }, + /** + * @method clone() + * @for kity.BezierPoint + * @description 返回贝塞尔点的一份拷贝 + * + * @grammar clone() => {kity.BezierPoint} + */ + clone: function() { + var newPoint = new BezierPoint(), tmp = null; + tmp = this.getVertex(); + newPoint.setVertex(tmp.x, tmp.y); + tmp = this.getForward(); + newPoint.setForward(tmp.x, tmp.y); + tmp = this.getBackward(); + newPoint.setBackward(tmp.x, tmp.y); + newPoint.setSymReflaction(this.isSymReflaction); + newPoint.setSmooth(this.isSmooth()); + return newPoint; + }, + /** + * @method setVertex() + * @for kity.BezierPoint + * @description 设置贝塞尔点的顶点坐标,注意,控制点的坐标不会跟着变化。希望控制点的坐标跟着变化,请用 moveTo() 方法 + * + * @grammar setVertex(x, y) => {this} + * + * @param {Number} x 顶点的 x 坐标 + * @param {Number} y 顶点的 y 坐标 + */ + setVertex: function(x, y) { + this.vertex.setPoint(x, y); + this.update(); + return this; + }, + /** + * @method moveTo() + * @for kity.BezierPoint + * @description 同步移动整个贝塞尔点,使顶点的移动到指定的坐标中。控制点的位置相对顶点坐标固定。 + * + * @grammar moveTo() => {this} + * + * @param {Number} x 顶点的目标 x 坐标 + * @param {Number} y 顶点的目标 y 坐标 + * + */ + moveTo: function(x, y) { + var oldForward = this.forward.getPoint(), oldBackward = this.backward.getPoint(), oldVertex = this.vertex.getPoint(), //移动距离 + distance = { + left: x - oldVertex.x, + top: y - oldVertex.y + }; + // 更新 + this.forward.setPoint(oldForward.x + distance.left, oldForward.y + distance.top); + this.backward.setPoint(oldBackward.x + distance.left, oldBackward.y + distance.top); + this.vertex.setPoint(x, y); + this.update(); + }, + /** + * @method setForward() + * @for kity.BezierPoint + * @description 设置前方控制点的位置,如果贝塞尔点光滑,后方控制点会跟着联动 + * + * @grammar setForward(x, y) => {this} + * + * @param {Number} x 前方控制点的 x 坐标 + * @param {Number} y 前方控制点的 y 坐标 + */ + setForward: function(x, y) { + this.forward.setPoint(x, y); + //更新后置点 + if (this.smooth) { + this.updateAnother(this.forward, this.backward); + } + this.update(); + this.lastControlPointSet = this.forward; + return this; + }, + /** + * @method setBackward() + * @for kity.BezierPoint + * @description 设置后方控制点的位置,如果贝塞尔点光滑,前方控制点会跟着联动 + * + * @grammar setBackward(x, y) => {this} + * + * @param {Number} x 后方控制点的 x 坐标 + * @param {Number} y 后方控制点的 y 坐标 + */ + setBackward: function(x, y) { + this.backward.setPoint(x, y); + //更新前置点 + if (this.smooth) { + this.updateAnother(this.backward, this.forward); + } + this.update(); + this.lastControlPointSet = this.backward; + return this; + }, + /** + * @method setSymReflaction() + * @for kity.BezierPoint + * @description 设定是否镜像两个控制点的位置 + * + * @grammar setSymReflaction(value) => {this} + * + * @param {boolean} value 如果设置为 true,且贝塞尔点光滑,两个控制点离顶点的距离相等 + */ + setSymReflaction: function(value) { + this.symReflaction = value; + if (this.smooth) this.setSmooth(true); + return this; + }, + /** + * @method isSymReflaction() + * @for kity.BezierPoint + * @description 当前贝塞尔点的两个控制点是否被镜像约束 + * + * @grammar isSymReflaction() => {boolean} + */ + isSymReflaction: function() { + return this.symReflaction; + }, + /** + * @private + * + * 根据前方控制点或后方控制点更新另一方 + */ + updateAnother: function(p, q) { + var v = this.getVertex(), pv = Vector.fromPoints(p.getPoint(), v), vq = Vector.fromPoints(v, q.getPoint()); + vq = pv.normalize(this.isSymReflaction() ? pv.length() : vq.length()); + q.setPoint(v.x + vq.x, v.y + vq.y); + return this; + }, + /** + * @method setSmooth() + * @for kity.BezierPoint + * @description 设置贝塞尔点是否光滑,光滑会约束顶点和两个控制点共线 + * + * @param {Boolean} isSmooth 设置为 true 让贝塞尔点光滑 + */ + setSmooth: function(isSmooth) { + var lc; + this.smooth = !!isSmooth; + if (this.smooth && (lc = this.lastControlPointSet)) { + this.updateAnother(lc, lc == this.forward ? this.backward : this.forward); + } + return this; + }, + /** + * @method isSmooth() + * @for kity.BezierPoint + * @description 判断贝塞尔点是否光滑 + * + * @grammar isSmooth() => {boolean} + */ + isSmooth: function() { + return this.smooth; + }, + /** + * @method getVertex() + * @for kity.BezierPoint + * @description 获得当前贝塞尔点的顶点 + * + * @grammar getVertex() => {kity.ShapePoint} + */ + getVertex: function() { + return this.vertex.getPoint(); + }, + /** + * @method getForward() + * @for kity.BezierPoint + * @description 获得当前贝塞尔点的前方控制点 + * + * @grammar getForward() => {kity.ShapePoint} + */ + getForward: function() { + return this.forward.getPoint(); + }, + /** + * @method getBackward() + * @for kity.BezierPoint + * @description 获得当前贝塞尔点的后方控制点 + * + * @grammar getBackward() => {kity.ShapePoint} + */ + getBackward: function() { + return this.backward.getPoint(); + }, + /** + * @private + * + * 联动更新相关的贝塞尔曲线 + */ + update: function() { + if (!this.container) { + return this; + } + //新增参数 this, 把当前引起变化的点传递过去, 以便有需要的地方可以获取到引起变化的源 + if (this.container.update) this.container.update(this); + } + }); + return BezierPoint; + } +}; + +//src/graphic/box.js +/** + * @fileOverview + * + * 表示一个矩形区域 + */ +_p[25] = { + value: function(require, exports, module) { + /** + * @class kity.Box + * @description 表示一个矩形区域 + */ + var Box = _p.r(11).createClass("Box", { + /** + * @constructor + * @for kity.Box + * + * @grammar new kity.Box(x, y, width, height) + * @grammar new kity.Box(box) + * + * @param {Number} x|box.x 矩形区域的 x 坐标 + * @param {Number} y|box.y 矩形区域的 y 坐标 + * @param {Number} width|box.width 矩形区域的宽度 + * @param {Number} height|box.height 矩形区域的高度 + * + * @example + * + * ```js + * var box = new kity.Box(10, 20, 50, 50); + * var box2 = new kity.Box({x: 10, y: 20, width: 50, height: 50}); + * ``` + */ + constructor: function(x, y, width, height) { + var box = arguments[0]; + if (box && typeof box === "object") { + x = box.x; + y = box.y; + width = box.width; + height = box.height; + } + if (width < 0) { + x -= width = -width; + } + if (height < 0) { + y -= height = -height; + } + /** + * @property x + * @for kity.Box + * @type {Number} + * @readOnly + * @description 矩形区域的 x 坐标 + */ + this.x = x || 0; + /** + * @property y + * @for kity.Box + * @type {Number} + * @readOnly + * @description 矩形区域的 y 坐标 + */ + this.y = y || 0; + /** + * @property width + * @for kity.Box + * @type {Number} + * @readOnly + * @description 矩形区域的宽度 + */ + this.width = width || 0; + /** + * @property height + * @for kity.Box + * @type {Number} + * @readOnly + * @description 矩形区域的高度 + */ + this.height = height || 0; + /** + * @property left + * @for kity.Box + * @type {Number} + * @readOnly + * @description 矩形区域的最左侧坐标,等价于 x 的值 + */ + this.left = this.x; + /** + * @property right + * @for kity.Box + * @type {Number} + * @readOnly + * @description 矩形区域的最右侧坐标,等价于 x + width 的值 + */ + this.right = this.x + this.width; + /** + * @property top + * @for kity.Box + * @type {Number} + * @readOnly + * @description 矩形区域的最上侧坐标,等价于 y 的值 + */ + this.top = this.y; + /** + * @property bottom + * @for kity.Box + * @type {Number} + * @readOnly + * @description 矩形区域的最下侧坐标,等价于 y + height 的值 + */ + this.bottom = this.y + this.height; + /** + * @property cx + * @for kity.Box + * @type {Number} + * @readOnly + * @description 矩形区域的中心 x 坐标 + */ + this.cx = this.x + this.width / 2; + /** + * @property cy + * @for kity.Box + * @type {Number} + * @readOnly + * @description 矩形区域的中心 y 坐标 + */ + this.cy = this.y + this.height / 2; + }, + /** + * @method getRangeX() + * @for kity.Box + * @description 获得矩形区域的 x 值域 + * + * @grammar getRangeX() => {Number[]} + * + * @example + * + * var box = new kity.Box(10, 10, 30, 50); + * console.log(box.getRangeX()); // [10, 40] + */ + getRangeX: function() { + return [ this.left, this.right ]; + }, + /** + * @method getRangeY() + * @for kity.Box + * @description 获得矩形区域的 y 值域 + * + * @grammar getRangeY() => {Number[]} + * + * @example + * + * var box = new kity.Box(10, 10, 30, 50); + * console.log(box.getRangeY()); // [10, 60] + */ + getRangeY: function() { + return [ this.top, this.bottom ]; + }, + /** + * @method merge() + * @for kity.Box + * @description 把当前矩形区域和指定的矩形区域合并,返回一个新的矩形区域(即包含两个源矩形区域的最小矩形区域) + * + * @grammar merge(another) => {kity.Box} + * @param {kity.Box} another 要合并的矩形区域 + * + * @example + * + * ```js + * var box1 = new kity.Box(10, 10, 50, 50); + * var box2 = new kity.Box(30, 30, 50, 50); + * var box3 = box1.merge(box2); + * console.log(box3.valueOf()); // [10, 10, 70, 70] + * ``` + */ + merge: function(another) { + if (this.isEmpty()) { + return new Box(another.x, another.y, another.width, another.height); + } + var left = Math.min(this.left, another.left), right = Math.max(this.right, another.right), top = Math.min(this.top, another.top), bottom = Math.max(this.bottom, another.bottom); + return new Box(left, top, right - left, bottom - top); + }, + /** + * @method intersect() + * @for kity.Box + * @description 求当前矩形区域和指定的矩形区域重叠的矩形区域 + * + * @grammar intersect(another) => {kity.Box} + * @param {kity.Box} another 要求重叠的矩形区域 + * + * @example + * + * ```js + * var box1 = new kity.Box(10, 10, 50, 50); + * var box2 = new kity.Box(30, 30, 50, 50); + * var box3 = box1.intersect(box2); + * console.log(box3.valueOf()); // [30, 30, 20, 20] + * ``` + */ + intersect: function(another) { + if (!another instanceof Box) { + another = new Box(another); + } + var left = Math.max(this.left, another.left), right = Math.min(this.right, another.right), top = Math.max(this.top, another.top), bottom = Math.min(this.bottom, another.bottom); + if (left > right || top > bottom) return new Box(); + return new Box(left, top, right - left, bottom - top); + }, + /** + * @method expand() + * @for kity.Box + * @description 扩展(或收缩)当前的盒子,返回新的盒子 + * + * @param {Number} top + * 矩形区域的上边界往上扩展的值;如果是负数,则上边界往下收缩 + * + * @param {Number} right + * [Optional] 矩形区域的右边界往右拓展的值; + * 如果是负数,则右边界往左收缩; + * 如果不设置该值,使用和 top 同样的值。 + * + * @param {Number} bottom + * [Optional] 矩形区域的下边界往下拓展的值; + * 如果是负数,则下边界往上收缩; + * 如果不设置该值,使用和 top 同样的值。 + * + * @param {Number} left + * [Optional] 矩形区域的左边界往左拓展的值; + * 如果是负数,则左边界往右收缩; + * 如果不设置该值,使用和 right 同样的值。 + * + * @example + * + * ```js + * var box = new kity.Box(10, 10, 20, 20); + * var box1 = box.expand(10); // [0, 0, 40, 40] + * var box2 = box.expand(10, 20); // [0, -10, 40, 60] + * var box3 = box.expand(1, 2, 3, 4); // [9, 8, 24, 26] + * ``` + */ + expand: function(top, right, bottom, left) { + if (arguments.length < 1) { + return new Box(this); + } + if (arguments.length < 2) { + right = top; + } + if (arguments.length < 3) { + bottom = top; + } + if (arguments.length < 4) { + left = right; + } + var x = this.left - left, y = this.top - top, width = this.width + right, height = this.height + top; + return new Box(x, y, width, height); + }, + /** + * @method valueOf() + * @for kity.Box + * @description 返回当前盒子的数组表示 + * + * @grammar valueOf() => {Number[]} + * + * @example + * + * ```js + * var box = new kity.Box(0, 0, 200, 50); + * console.log(box.valueOf()); // [0, 0, 200, 50] + * ``` + */ + valueOf: function() { + return [ this.x, this.y, this.width, this.height ]; + }, + /** + * @method toString() + * @for kity.Box + * @description 返回当前盒子的字符串表示 + * + * @grammar toString() => {String} + * + * @example + * + * ```js + * var box = new kity.Box(0, 0, 200, 50); + * console.log(box.toString()); // "0 0 200 50" + */ + toString: function() { + return this.valueOf().join(" "); + }, + /** + * @method isEmpty() + * @for kity.Box + * @description 判断当前盒子是否具有尺寸(面积大 + * + * @grammar isEmpty() => {boolean} + * + * @example + * ```js + * var box = new kity.Box(0, 0, 0, 100000); + * console.log(box.isEmpty()); // true + * ``` + */ + isEmpty: function() { + return !this.width || !this.height; + } + }); + /** + * @method parse() + * @static + * @for kity.Box + * @description 解析一个字符串或数组为 kity.Box 对象 + * + * @grammar kity.Box.parse(any) => {kity.Box} + * + * @param {Number[]|String} any 要解析的字符串或数组 + * + * @example + * + * ```js + * console.log(kity.Box.parse('0 0 100 200')); + * console.log(kity.Box.parse([0, 0, 100, 200])); + * ``` + */ + Box.parse = function(any) { + if (typeof any == "string") { + return Box.parse(any.split(/[\s,]+/).map(parseFloat)); + } + if (any instanceof Array) { + return new Box(any[0], any[1], any[2], any[3]); + } + if ("x" in any) return new Box(any); + return null; + }; + return Box; + } +}; + +//src/graphic/circle.js +/** + * @fileOverview + * + * 绘制和使用圆形 + */ +_p[26] = { + value: function(require, exports, module) { + /** + * @class kity.Circle + * @base kity.Ellipse + * @description 表示一个圆形 + */ + return _p.r(11).createClass("Circle", { + base: _p.r(32), + /** + * @constructor + * @for kity.Circle + * + * @grammar new kity.Circle(radius, cx, cy) + * + * @param {Number} radius 半径 + * @param {Number} cx 圆心 x 坐标 + * @param {Number} cy 圆心 y 坐标 + */ + constructor: function(radius, cx, cy) { + this.callBase(radius, radius, cx, cy); + }, + /** + * @method + * @for kity.Circle + * @description 获取圆形的半径 + * + * @grammar getRadius() => {Number} + */ + getRadius: function() { + return this.getRadiusX(); + }, + /** + * @method + * @for kity.Circle + * @description 设置圆形的半径 + * + * @grammar setRadius() => {this} + * + * @param {Number} radius 半径大小 + */ + setRadius: function(radius) { + return this.callBase(radius, radius); + } + }); + } +}; + +//src/graphic/clip.js +/** + * @fileOverview + * + * 支持图形裁切 + */ +_p[27] = { + value: function(require, exports, module) { + var Class = _p.r(11); + var Shape = _p.r(60); + /** + * @class kity.Clip + * @base kity.Resource + * @mixins kity.ShapeContainer + * + * @description 创建图形裁切,用于裁切目标图形 + */ + var Clip = Class.createClass("Clip", { + base: Shape, + mixins: [ _p.r(61) ], + /** + * @constructor + * @for kity.Clip + * + * @grammar new kity.Clip(paper) + * + * @param {kity.Paper} paper 资源所属的文档 + * + * @example + * + * ```js + * var circle = paper.put(new kity.Circle(100).fill('yellow')); + * var clip = new kity.Clip(paper); + * clip.addShape(new kity.Circle(100, 50, 0)); + * clip.clip(circle); + * ``` + */ + constructor: function(paper) { + this.callBase("clipPath", paper); + }, + /** + * @method clip() + * @for kity.Clip + * @description 将裁切应用到指定的图形上,应用之后,目标图形将显示与裁切形状重合的部分 + * + * @grammar clip(shape) => {this} + * + * @param {kity.Shape} shape 要应用裁切的图形 + */ + clip: function(shape) { + shape.getNode().setAttribute("clip-path", this); + return this; + } + }); + Class.extendClass(Shape, { + /** + * @method clipWidth() + * @for kity.Shape + * + * @grammar clipWidth(clip) => {this} + * + * @param {kity.Clip|kity.Shape} clip 要用于裁切当前图形的图形; + * 如果 clip 本身是一个裁切对象(kity.Clip 类型),则直接裁切; + * 否则将创建新的裁切包含给定的图形,然后对当前图形进行裁切 + * + * @example + * + * ```js + * var circle = paper.put(new kity.Circle(100)); + * var rect = paper.put(new kity.Rect(100, 100, -100, 0)); + * + * circle.clipWidth(rect); + * ``` + */ + clipWith: function(clip) { + if (clip instanceof Shape) { + clip = new Clip(clip.getPaper()).addShape(clip); + } + clip.clip(this); + return this; + } + }); + return Clip; + } +}; + +//src/graphic/color.js +/** + * @fileOverview + * + * 提供颜色支持 + */ +_p[28] = { + value: function(require, exports, module) { + var Utils = _p.r(12), StandardColor = _p.r(64), ColorUtils = {}, /** + * @class kity.Color + * @description 表示一个颜色 + */ + Color = _p.r(11).createClass("Color", { + /** + * @constructor + * @for kity.Color + * + * @grammar new kity.Color(r, g, b) + * @grammar new kity.Color(r, g, b, a) + * @grammar new kity.Color(colorString) + * + * @param {Number} r 红色分量,取值 0 - 255 + * @param {Number} g 绿色分量,取值 0 - 255 + * @param {Number} b 蓝色分量,取值 0 - 255 + * @param {Number} a 透明度(可选),取值 0 - 100 + * @param {String} colorString 一个代表颜色的字符串,可以是: + * 熟知颜色表:如 'red', 'yellow' + * HEX 表示:如 '#368', '#123456' + * RGB 表示:如 'RGB(200, 200, 0)', 'RGBA(200, 200, 200, .5)' + * HSL 表示:如 'HSL(100, 60%, 80%)', 'HSLA(100, 60%, 80%, .5)' + */ + constructor: function() { + var colorValue = null; + //parse构造 + if (typeof arguments[0] === "string") { + colorValue = ColorUtils.parseToValue(arguments[0]); + //解析失败 + if (colorValue === null) { + colorValue = { + r: 0, + g: 0, + b: 0, + h: 0, + s: 0, + l: 0, + a: 1 + }; + } + } else { + colorValue = { + r: arguments[0] | 0, + g: arguments[1] | 0, + b: arguments[2] | 0, + //alpha 默认为1 + a: arguments[3] === undefined ? 1 : parseFloat(arguments[3]) + }; + colorValue = ColorUtils.overflowFormat(colorValue); + //获取hsl分量 + colorValue = Utils.extend(colorValue, ColorUtils.rgbValueToHslValue(colorValue)); + } + this._color = colorValue; + }, + /** + * @method set() + * @for kity.Color + * + * @description 设置当前颜色某个分量的值 + * + * @grammar set(name, value) => {this} + * + * @param {string} name 要设置的颜色通道的名称 + * r: 红色(Red),取值范围 [0, 255] + * g: 绿色(Green),取值范围 [0, 255] + * b: 蓝色(Blue),取值范围 [0, 255] + * a: 透明度(Alpha),取值范围 [0, 1] + * h: 色环角度(Hue),取值范围 [0, 359] + * s: 饱和度(Saturation),取值范围 [0, 100] + * l: 亮度(Lightness),取值范围 [0, 100] + * r、g、b 值和 h、s、l 值会联动修改 + * @param {number} value 要设置的值 + */ + set: function(name, value) { + var values = null; + //设置的值非法 + if (!Color._MAX_VALUE[name]) { + throw new Error("Color set(): Illegal parameter"); + } + if (name !== "a") { + value = Math.floor(value); + } + if (name == "h") { + value = (value + 360) % 360; + } + this._color[name] = Math.max(Color._MIN_VALUE[name], Math.min(Color._MAX_VALUE[name], value)); + if ("rgb".indexOf(name) !== -1) { + this._color = Utils.extend(this._color, ColorUtils.rgbValueToHslValue(this._color)); + } else if ("hsl".indexOf(name) !== -1) { + this._color = Utils.extend(this._color, ColorUtils.hslValueToRGBValue(this._color)); + } + return this; + }, + /** + * @method inc() + * + * @description 返回新的颜色,表示当前颜色增加指定通道的值之后的颜色 + * + * @grammar inc(name, value) => {this} + * + * @param {string} name 要增加的通道的名称,具体含义请查看 set 方法 + * @param {number} value 增量值 + */ + inc: function(name, value) { + value = this.get(name) + value; + if (name == "h") { + value = (value + 360) % 360; + } else { + value = Math.min(Color._MAX_VALUE[name], value); + value = Math.max(Color._MIN_VALUE[name], value); + } + return this.clone().set(name, value); + }, + /** + * @method dec() + * @for kity.Color + * + * @description 返回新的颜色,表示当前颜色减少指定通道的值之后的颜色 + * + * @grammar dec(name, value) => {this} + * + * @param {string} name 要减少值的通道的名称,具体含义请查看 set 方法 + * @param {number} value 减量值 + */ + dec: function(name, value) { + return this.inc(name, -value); + }, + /** + * @method clone() + * @for kity.Color + * + * @description 返回当前颜色的一个拷贝 + * + * @grammar clone() => {kity.Color} + */ + clone: function() { + return new Color(this.toRGBA()); + }, + /** + * @method get() + * @for kity.Color + * + * @description 返回当前颜色指定的分量 + * + * @grammar get() => {number} + */ + get: function(name) { + if (!Color._MAX_VALUE[name]) { + return null; + } + return this._color[name]; + }, + getValues: function() { + return Utils.clone(this._color); + }, + /** + * @method valueOf() + * @for kity.Color + * + * @description 返回当前颜色的一个字面量表示 + * + * @return {plain} 颜色字面量,其结构为: + * { + * r: 0, + * g: 0, + * b: 0, + * a: 0, + * h: 0, + * s: 0, + * l: 0 + * } + */ + valueOf: function() { + return this.getValues(); + }, + /** + * @method toRGB() + * @for kity.Color + * + * @description 返回当前颜色的 RGB 表示,如果颜色有透明度,将抛弃透明度属性(想要保留请使用 toRGBA())方法。 + * + * @grammar toRGB() => {string} + */ + toRGB: function() { + return ColorUtils.toString(this._color, "rgb"); + }, + /** + * @method toRGBA() + * @for kity.Color + * + * @description 返回当前颜色的 RGBA 表示 + * + * @grammar toRGBA() => {string} + */ + toRGBA: function() { + return ColorUtils.toString(this._color, "rgba"); + }, + /** + * @method toHEX() + * @for kity.Color + * + * @description 返回当前颜色的 HEX 表示,如果颜色有透明度,将抛弃透明度属性(想要保留请使用 toRGBA())方法。 + * + * @grammar toHEX() => {string} + */ + toHEX: function() { + return ColorUtils.toString(this._color, "hex"); + }, + /** + * @method toHSL() + * @for kity.Color + * + * @description 返回当前颜色的 HSL 表示,如果颜色有透明度,将抛弃透明度属性(想要保留请使用 toHSLA())方法。 + * + * @grammar toHSL() => {string} + */ + toHSL: function() { + return ColorUtils.toString(this._color, "hsl"); + }, + /** + * @method toHSLA() + * @for kity.Color + * + * @description 返回当前颜色的 HSLA 表示 + * + * @grammar toHSLA() => {string} + */ + toHSLA: function() { + return ColorUtils.toString(this._color, "hsla"); + }, + /** + * @method toString() + * @for kity.Color + * + * @description 返回当前颜色的 RGB 或 RGBA 表示,如果颜色有透明度,将使用 RGBA 形式,否则是 RGB 形式 + * @grammar toString() => {string} + */ + toString: function() { + if (this._color.a === 1) { + return this.toRGB(); + } + return this.toRGBA(); + } + }); + //Color 静态方法 + Utils.extend(Color, { + //各分量可表示的最大值 + _MAX_VALUE: { + r: 255, + g: 255, + b: 255, + h: 360, + s: 100, + l: 100, + a: 1 + }, + //各分量最小值 + _MIN_VALUE: { + r: 0, + g: 0, + b: 0, + h: 0, + s: 0, + l: 0, + a: 0 + }, + //分量常量 + R: "r", + G: "g", + B: "b", + H: "h", + S: "s", + L: "l", + A: "a", + /** + * @method parse() + * @static + * @for kity.Color + * + * @description 解析一个颜色字符串为 kity.Color 对象 + * + * @grammar kity.Color.parse(valStr) + * + * @param {string} valStr 一个代表颜色的字符串,可以是: + * 熟知颜色表:如 'red', 'yellow' + * HEX 表示:如 '#368', '#123456' + * RGB 表示:如 'RGB(200, 200, 0)', 'RGBA(200, 200, 200, .5)' + * HSL 表示:如 'HSL(100, 60%, 80%)', 'HSLA(100, 60%, 80%, .5)' + */ + parse: function(valStr) { + var rgbValue; + if (Utils.isString(valStr)) { + rgbValue = ColorUtils.parseToValue(valStr); + } + if (Utils.isObject(valStr) && "r" in valStr) { + rgbValue = valStr; + } + //解析失败, 返回一个默认color实例 + if (rgbValue === null) { + return new Color(); + } + return new Color(rgbValue.r, rgbValue.g, rgbValue.b, rgbValue.a); + }, + /** + * @method createHSL() + * @for kity.Color + * @static + * + * @description 创建一个 HSL 颜色 + * + * @grammar kity.Color.createHSL(h, s, l) => {kity.Color} + * + * @param {number} h 色环(Hue)分量值,取值范围 [0, 359] + * @param {number} s 饱和度(Saturation)分量值,取值范围 [0, 100] + * @param {number} l 亮度(Lighteness)分量值,取值范围 [0, 100] + */ + createHSL: function(h, s, l) { + return Color.createHSLA(h, s, l, 1); + }, + /** + * @method createHSLA() + * @for kity.Color + * @static + * + * @description 创建一个 HSLA 颜色 + * + * @grammar kity.Color.createHSLA(h, s, l, a) => {kity.Color} + * + * @param {number} h 色环(Hue)分量值,取值范围 [0, 359] + * @param {number} s 饱和度(Saturation)分量值,取值范围 [0, 100] + * @param {number} l 亮度(Lighteness)分量值,取值范围 [0, 100] + * @param {number} a 透明度(Alpha)分量值,取值范围 [0, 1] + */ + createHSLA: function(h, s, l, a) { + var colorValue = null; + s += "%"; + l += "%"; + colorValue = [ "hsla(" + h, s, l, a + ")" ]; + return Color.parse(colorValue.join(", ")); + }, + /** + * @method createRGB() + * @for kity.Color + * @static + * + * @description 创建一个 RGB 颜色 + * + * @grammar kity.Color.createRGB(r, g, b) => {kity.Color} + * + * @param {number} r 红色(Red)分量值,取值范围 [0, 255] + * @param {number} g 绿色(Green)分量值,取值范围 [0, 255] + * @param {number} b 蓝色(Blue)分量值,取值范围 [0, 255] + */ + createRGB: function(r, g, b) { + return Color.createRGBA(r, g, b, 1); + }, + /** + * @method createRGBA() + * @for kity.Color + * @static + * + * @description 创建一个 RGBA 颜色 + * + * @grammar kity.Color.createRGBA(r, g, b, a) => {kity.Color} + * + * @param {number} r 红色(Red)分量值,取值范围 [0, 255] + * @param {number} g 绿色(Green)分量值,取值范围 [0, 255] + * @param {number} b 蓝色(Blue)分量值,取值范围 [0, 255] + * @param {number} a 透明度(Alpha)分量值,取值范围 [0, 1] + */ + createRGBA: function(r, g, b, a) { + return new Color(r, g, b, a); + } + }); + //内部工具对象 + Utils.extend(ColorUtils, { + parseToValue: function(valStr) { + var rgbaValue = {}; + /* 优先检测在调色板中是否有对应的颜色 */ + valStr = StandardColor.EXTEND_STANDARD[valStr] || StandardColor.COLOR_STANDARD[valStr] || valStr; + /* 颜色转换 */ + //hex格式 + if (/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(valStr)) { + rgbaValue = ColorUtils.hexToValue(valStr); + } else if (/^(rgba?)/i.test(valStr)) { + rgbaValue = ColorUtils.rgbaToValue(valStr); + } else if (/^(hsla?)/i.test(valStr)) { + rgbaValue = ColorUtils.hslaToValue(valStr); + } else { + return null; + } + return ColorUtils.overflowFormat(rgbaValue); + }, + hexToValue: function(hexStr) { + var result = {}, keys = [ "r", "g", "b" ]; + if (/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(hexStr)) { + hexStr = RegExp.$1.split(""); + Utils.each(keys, function(key, index) { + if (hexStr.length === 3) { + result[key] = ColorUtils.toNumber(hexStr[index] + hexStr[index]); + } else { + result[key] = ColorUtils.toNumber(hexStr[index * 2] + hexStr[index * 2 + 1]); + } + }); + //转换出hsl值 + result = Utils.extend(result, ColorUtils.rgbValueToHslValue(result)); + result.a = 1; + return result; + } + return null; + }, + rgbaToValue: function(rgbaStr) { + var result = {}, hasAlpha = false, keys = [ "r", "g", "b" ]; + if (/^(rgba?)/i.test(rgbaStr)) { + hasAlpha = RegExp.$1.length === 4; + rgbaStr = rgbaStr.replace(/^rgba?/i, "").replace(/\s+/g, "").replace(/[^0-9,.]/g, "").split(","); + Utils.each(keys, function(key, index) { + result[key] = rgbaStr[index] | 0; + }); + //转换出hsl值 + result = Utils.extend(result, ColorUtils.rgbValueToHslValue(result)); + result.a = hasAlpha ? parseFloat(rgbaStr[3]) : 1; + return result; + } + return null; + }, + hslaToValue: function(hslaStr) { + var result = {}, hasAlpha = false; + if (/^(hsla?)/i.test(hslaStr)) { + hasAlpha = RegExp.$1.length === 4; + hslaStr = hslaStr.replace(/^hsla?/i, "").replace(/\s+/g, "").replace(/[^0-9,.]/g, "").split(","); + //记录hsl值 + result.h = hslaStr[0] | 0; + result.s = hslaStr[1] | 0; + result.l = hslaStr[2] | 0; + //转换出rgb值 + result = Utils.extend(result, ColorUtils.hslValueToRGBValue(result)); + //hsl值转换为rgb值 + result = ColorUtils.hslValueToRGBValue(result); + result.a = hasAlpha ? parseFloat(hslaStr[3]) : 1; + return result; + } + return null; + }, + //hsl值对象转换为rgb值对象 + hslValueToRGBValue: function(hslValue) { + function trans(v1, v2, vH) { + if (vH < 0) { + vH += 1; + } else if (vH > 1) { + vH -= 1; + } + if (6 * vH < 1) { + return v1 + (v2 - v1) * 6 * vH; + } else if (2 * vH < 1) { + return v2; + } else if (3 * vH < 2) { + return v1 + (v2 - v1) * ((2 / 3 - vH) * 6); + } + return v1; + } + var q = null, p = null, result = {}; + hslValue = Utils.extend({}, hslValue); + hslValue.h = hslValue.h / 360; + hslValue.s = hslValue.s / 100; + hslValue.l = hslValue.l / 100; + //分量计算 + if (hslValue.s === 0) { + result.r = result.g = result.b = hslValue.l; + } else { + if (hslValue.l < .5) { + q = hslValue.l * (1 + hslValue.s); + } else { + q = hslValue.l + hslValue.s - hslValue.l * hslValue.s; + } + p = 2 * hslValue.l - q; + result.r = trans(p, q, hslValue.h + 1 / 3); + result.g = trans(p, q, hslValue.h); + result.b = trans(p, q, hslValue.h - 1 / 3); + } + result.r = Math.min(Math.round(result.r * 255), 255); + result.g = Math.min(Math.round(result.g * 255), 255); + result.b = Math.min(Math.round(result.b * 255), 255); + return result; + }, + //rgb值对象转换为hsl值对象 + rgbValueToHslValue: function(rgbValue) { + var max = null, min = null, result = {}; + rgbValue = Utils.extend({}, rgbValue); + rgbValue.r = rgbValue.r / 255; + rgbValue.g = rgbValue.g / 255; + rgbValue.b = rgbValue.b / 255; + max = Math.max(rgbValue.r, rgbValue.g, rgbValue.b); + min = Math.min(rgbValue.r, rgbValue.g, rgbValue.b); + //h分量计算 + if (max === min) { + result.h = 0; + } else if (max === rgbValue.r) { + if (rgbValue.g >= rgbValue.b) { + result.h = 60 * (rgbValue.g - rgbValue.b) / (max - min); + } else { + result.h = 60 * (rgbValue.g - rgbValue.b) / (max - min) + 360; + } + } else if (max === rgbValue.g) { + result.h = 60 * (rgbValue.b - rgbValue.r) / (max - min) + 120; + } else if (max === rgbValue.b) { + result.h = 60 * (rgbValue.r - rgbValue.g) / (max - min) + 240; + } + //l分量计算 + result.l = (max + min) / 2; + //s分量计算 + if (result.l === 0 || max === min) { + result.s = 0; + } else if (result.l > 0 && result.l <= .5) { + result.s = (max - min) / (max + min); + } else { + result.s = (max - min) / (2 - max - min); + } + //格式化hsl结果 + result.h = Math.round(result.h); + result.s = Math.round(result.s * 100); + result.l = Math.round(result.l * 100); + return result; + }, + toString: function(colorValue, type) { + var vals = []; + colorValue = Utils.extend({}, colorValue); + if (type.indexOf("hsl") !== -1) { + colorValue.s += "%"; + colorValue.l += "%"; + } + if (type !== "hex") { + Utils.each(type.split(""), function(key) { + vals.push(colorValue[key]); + }); + return (type + "(" + vals.join(", ") + ")").toLowerCase(); + } else { + vals.push(ColorUtils.toHexValue(+colorValue.r)); + vals.push(ColorUtils.toHexValue(+colorValue.g)); + vals.push(ColorUtils.toHexValue(+colorValue.b)); + return ("#" + vals.join("")).toLowerCase(); + } + }, + //16进制的2个数字转化为10进制, 如果转化失败, 返回0 + toNumber: function(value) { + return Number("0x" + value) | 0; + }, + toHexValue: function(value) { + var result = value.toString(16); + return result.length === 1 ? "0" + result : result; + }, + //溢出控制 + overflowFormat: function(value) { + var tmpValue = Utils.extend({}, value), keys = "rgba"; + Utils.each(keys.split(""), function(key) { + if (!tmpValue.hasOwnProperty(key)) { + return; + } + //上溢出 + tmpValue[key] = Math.min(Color._MAX_VALUE[key], tmpValue[key]); + //下溢出 + tmpValue[key] = Math.max(Color._MIN_VALUE[key], tmpValue[key]); + }); + return tmpValue; + } + }); + return Color; + } +}; + +//src/graphic/container.js +_p[29] = { + value: function(require, exports, module) { + function itemRemove() { + this.container.removeItem(this); + return this; + } + return _p.r(11).createClass("Container", { + getItems: function() { + return this.items || (this.items = []); + }, + getItem: function(index) { + return this.getItems()[index]; + }, + getFirstItem: function() { + return this.getItem(0); + }, + getLastItem: function() { + return this.getItem(this.getItems().length - 1); + }, + indexOf: function(item) { + return this.getItems().indexOf(item); + }, + eachItem: function(fn) { + var items = this.getItems(), length = items.length, i; + for (i = 0; i < length; i++) { + fn.call(this, i, items[i]); + } + return this; + }, + addItem: function(item, pos, noEvent) { + var items = this.getItems(), length = items.length; + if (~items.indexOf(item)) { + return this; + } + if (!(pos >= 0 && pos < length)) { + pos = length; + } + items.splice(pos, 0, item); + if (typeof item === "object") { + item.container = this; + item.remove = itemRemove; + } + this.handleAdd(item, pos); + if (!noEvent) { + this.onContainerChanged("add", [ item ]); + } + return this; + }, + addItems: function(items) { + for (var i = 0, l = items.length; i < l; i++) { + this.addItem(items[i], -1, true); + } + this.onContainerChanged("add", items); + return this; + }, + setItems: function(items) { + return this.clear().addItems(items); + }, + appendItem: function(item) { + return this.addItem(item); + }, + prependItem: function(item) { + return this.addItem(item, 0); + }, + removeItem: function(pos, noEvent) { + if (typeof pos !== "number") { + return this.removeItem(this.indexOf(pos)); + } + var items = this.getItems(), length = items.length, item = items[pos]; + if (item === undefined) { + return this; + } + items.splice(pos, 1); + if (item.container) { + delete item.container; + } + if (item.remove) { + delete item.remove; + } + this.handleRemove(item, pos); + if (!noEvent) { + this.onContainerChanged("remove", [ item ]); + } + return this; + }, + clear: function() { + var removed = []; + var item; + while (item = this.getFirstItem()) { + removed.push(item); + this.removeItem(0, true); + } + this.onContainerChanged("remove", removed); + return this; + }, + onContainerChanged: function(type, items) {}, + handleAdd: function(item, index) {}, + handleRemove: function(item, index) {} + }); + } +}; + +//src/graphic/curve.js +/* + * 曲线 + * */ +_p[30] = { + value: function(require, exports, module) { + var Utils = _p.r(12), CurveUtil = { + /* + * 获取由两个以上的点组成的曲线的平移线 + * @param points 曲线上的点的集合, 集合中的点的数量必须大于2 + * @return 平移线数组 + */ + getCurvePanLines: function(points, smoothFactor) { + //计算原始点的中点坐标 + var centerPoints = CurveUtil.getCenterPoints(points), //注意:计算中点连线的中点坐标, 得出平移线 + panLines = CurveUtil.getPanLine(points.length, centerPoints); + //平移线移动到顶点 + return CurveUtil.getMovedPanLines(points, panLines, smoothFactor); + }, + /* + * 计算给定点集合的连线的中点 + * @param points + */ + getCenterPoints: function(points) { + var centerPoints = {}, key = null; + for (var i = 0, j = 0, len = points.length; i < len; i++) { + //j是下一个点的索引 + j = i === len - 1 ? 0 : i + 1; + key = i + "," + j; + //计算中点坐标 + centerPoints[key] = { + x: (points[i].x + points[j].y) / 2, + y: (points[i].x + points[j].y) / 2 + }; + } + return centerPoints; + }, + /* + * 对getCenterPoints()接口获取到的数据做处理, 计算出各个顶点对应的平移线数据 + * @param length 集合中点的个数 + * @param points 点集合, 该集合应该是getCenterPoints()接口返回的数据 + */ + getPanLine: function(length, points) { + var result = {}, //顶点索引 + pointIndex = null; + for (var i = 0, j; i < length; i++) { + var point1 = null, point2 = null; + //计算当前点 + j = (i + 1) % length; + //保存当前处理的顶点索引 + pointIndex = j; + point1 = points[i + "," + j]; + //计算下一个点 + i = j; + j = (i + 1) % length; + point2 = points[i + "," + j]; + result[pointIndex] = { + points: [ { + x: point1.x, + y: point1.y + }, { + x: point2.x, + y: point2.y + } ], + center: { + x: (point1.x + point2.x) / 2, + y: (point1.y + point2.y) / 2 + } + }; + //还原i值 + i = (pointIndex + length - 1) % length; + } + return result; + }, + /* + * 计算平移线移动到顶点后的位置 + * @param points 顶点集合 + * @param panLines 平移线集合 + */ + getMovedPanLines: function(points, panLines, smoothFactor) { + var result = {}; + Utils.each(points, function(point, index) { + //当前平移线 + var currentPanLine = panLines[index], //平移线中点 + center = currentPanLine.center, //移动距离 + distance = { + x: center.x - point.x, + y: center.y - point.y + }; + var currentResult = result[index] = { + points: [], + center: { + x: point.x, + y: point.y + } + }; + //计算控制点到顶点的距离, 并且应用平滑系数到距离上 + Utils.each(currentPanLine.points, function(controlPoint, index) { + var moved = { + x: controlPoint.x - distance.x, + y: controlPoint.y - distance.y + }; + var vertex = currentResult.center; + var dx = moved.x - vertex.x; + var dy = moved.y - vertex.y; + moved.x = vertex.x + smoothFactor * dx; + moved.y = vertex.y + smoothFactor * dy; + currentResult.points.push(moved); + }); + }); + return result; + } + }; + return _p.r(11).createClass("Curve", { + base: _p.r(46), + mixins: [ _p.r(51) ], + constructor: function(points, isColse) { + this.callBase(); + this.setPoints(points || []); + this.closeState = !!isColse; + this.changeable = true; + this.smoothFactor = 1; + this.update(); + }, + //当点集合发生变化时采取的动作 + onContainerChanged: function() { + if (this.changeable) { + this.update(); + } + }, + setSmoothFactor: function(factor) { + this.smoothFactor = factor < 0 ? 0 : factor; + this.update(); + return this; + }, + getSmoothFactor: function() { + return this.smoothFactor; + }, + update: function() { + var points = this.getPoints(), withControlPoints = null, drawer = this.getDrawer(), curPoint = null, curControlPoint = null, prevControlPoint = null; + drawer.clear(); + if (points.length === 0) { + return this; + } else { + drawer.moveTo(points[0]); + } + if (points.length === 1) { + return this; + } + if (points.length === 2) { + drawer.lineTo(points[1]); + return this; + } + //获取已转换过后的带控制点的所有点 + withControlPoints = CurveUtil.getCurvePanLines(points, this.getSmoothFactor()); + for (var i = 1, len = points.length; i < len; i++) { + //当前顶点 + curPoint = withControlPoints[i].center; + //当前控制点 + if (this.closeState || i != len - 1) { + curControlPoint = withControlPoints[i].points[0]; + } else { + //非闭合状态下最后一个点的处理 + curControlPoint = withControlPoints[i].center; + } + if (this.closeState || i != 1) { + prevControlPoint = withControlPoints[i - 1].points[1]; + } else { + //非闭合状态下第一个点的处理 + prevControlPoint = withControlPoints[i - 1].center; + } + drawer.bezierTo(prevControlPoint.x, prevControlPoint.y, curControlPoint.x, curControlPoint.y, curPoint.x, curPoint.y); + } + //处理闭合 + if (this.closeState) { + curPoint = withControlPoints[0].center; + curControlPoint = withControlPoints[0].points[0]; + prevControlPoint = withControlPoints[points.length - 1].points[1]; + drawer.bezierTo(prevControlPoint.x, prevControlPoint.y, curControlPoint.x, curControlPoint.y, curPoint.x, curPoint.y); + } + return this; + }, + close: function() { + this.closeState = true; + return this.update(); + }, + open: function() { + this.closeState = false; + return this.update(); + }, + isClose: function() { + return !!this.closeState; + } + }); + } +}; + +//src/graphic/data.js +_p[31] = { + value: function(require, exports, module) { + return _p.r(11).createClass("Data", { + constructor: function() { + this._data = {}; + }, + setData: function(name, value) { + this._data[name] = value; + return this; + }, + getData: function(name) { + return this._data[name]; + }, + removeData: function(name) { + delete this._data[name]; + return this; + } + }); + } +}; + +//src/graphic/ellipse.js +_p[32] = { + value: function(require, exports, module) { + var Utils = _p.r(12), Point = _p.r(50); + return _p.r(11).createClass("Ellipse", { + base: _p.r(46), + constructor: function(rx, ry, cx, cy) { + this.callBase(); + this.rx = rx || 0; + this.ry = ry || 0; + this.cx = cx || 0; + this.cy = cy || 0; + this.update(); + }, + update: function() { + var rx = this.rx, ry = this.ry, x1 = this.cx + rx, x2 = this.cx - rx, y = this.cy; + var drawer = this.getDrawer(); + drawer.clear(); + drawer.moveTo(x1, y); + drawer.arcTo(rx, ry, 0, 1, 1, x2, y); + drawer.arcTo(rx, ry, 0, 1, 1, x1, y); + return this; + }, + getRadius: function() { + return { + x: this.rx, + y: this.ry + }; + }, + getRadiusX: function() { + return this.rx; + }, + getRadiusY: function() { + return this.ry; + }, + getCenter: function() { + return new Point(this.cx, this.cy); + }, + getCenterX: function() { + return this.cx; + }, + getCenterY: function() { + return this.cy; + }, + setRadius: function(rx, ry) { + this.rx = rx; + this.ry = ry; + return this.update(); + }, + setRadiusX: function(rx) { + this.rx = rx; + return this.update(); + }, + setRadiusY: function(ry) { + this.ry = ry; + return this.update(); + }, + setCenter: function(cx, cy) { + if (arguments.length == 1) { + var p = Point.parse(arguments[0]); + cx = p.x; + cy = p.y; + } + this.cx = cx; + this.cy = cy; + return this.update(); + }, + setCenterX: function(cx) { + this.cx = cx; + return this.update(); + }, + setCenterY: function(cy) { + this.cy = cy; + return this.update(); + } + }); + } +}; + +//src/graphic/eventhandler.js +/* + * kity event 实现 + */ +_p[33] = { + value: function(require, exports, module) { + // polyfill + (function() { + function CustomEvent(event, params) { + params = params || { + bubbles: false, + cancelable: false, + detail: undefined + }; + var evt = document.createEvent("CustomEvent"); + evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); + return evt; + } + CustomEvent.prototype = window.Event.prototype; + window.CustomEvent = CustomEvent; + })(); + var Utils = _p.r(12), ShapeEvent = _p.r(62); + // 内部处理器缓存 + var INNER_HANDLER_CACHE = {}, // 用户处理器缓存 + USER_HANDLER_CACHE = {}, guid = 0; + // 添加事件统一入口 + function _addEvent(type, handler, isOnce) { + isOnce = !!isOnce; + if (Utils.isString(type)) { + type = type.match(/\S+/g); + } + Utils.each(type, function(currentType) { + listen.call(this, this.node, currentType, handler, isOnce); + }, this); + return this; + } + // 移除事件统一入口 + function _removeEvent(type, handler) { + var userHandlerList = null, eventId = this._EVNET_UID, isRemoveAll = handler === undefined; + userHandlerList = USER_HANDLER_CACHE[eventId][type]; + //移除指定的监听器 + if (!isRemoveAll) { + isRemoveAll = true; + Utils.each(userHandlerList, function removeKityEvent(fn, index) { + if (fn === handler) { + // 不能结束, 需要查找完整个list, 避免丢失移除多次绑定同一个处理器的情况 + delete userHandlerList[index]; + } else { + isRemoveAll = false; + } + }); + } + //删除所有监听器 + if (isRemoveAll) { + deleteDomEvent(this.node, type, INNER_HANDLER_CACHE[eventId][type]); + delete USER_HANDLER_CACHE[eventId][type]; + delete INNER_HANDLER_CACHE[eventId][type]; + } + return this; + } + // 执行绑定, 该方法context为shape或者mixin了eventhandler的对象 + function listen(node, type, handler, isOnce) { + var eid = this._EVNET_UID, targetObject = this; + // 初始化内部监听器 + if (!INNER_HANDLER_CACHE[eid]) { + INNER_HANDLER_CACHE[eid] = {}; + } + if (!INNER_HANDLER_CACHE[eid][type]) { + // 内部监听器 + INNER_HANDLER_CACHE[eid][type] = function kityEventHandler(e) { + e = new ShapeEvent(e || window.event); + Utils.each(USER_HANDLER_CACHE[eid][type], function executeKityEvent(fn) { + var result; + if (fn) { + result = fn.call(targetObject, e); + //once 绑定, 执行完后删除 + if (isOnce) { + targetObject.off(type, fn); + } + } + // 如果用户handler里return了false, 则该节点上的此后的同类型事件将不再执行 + return result; + }, targetObject); + }; + } + // 初始化用户监听器列表 + if (!USER_HANDLER_CACHE[eid]) { + USER_HANDLER_CACHE[eid] = {}; + } + if (!USER_HANDLER_CACHE[eid][type]) { + USER_HANDLER_CACHE[eid][type] = [ handler ]; + // 绑定对应类型的事件 + // dom对象利用dom event进行处理, 非dom对象, 由消息分发机制处理 + if (!!node && "on" + type in node) { + bindDomEvent(node, type, INNER_HANDLER_CACHE[eid][type]); + } + } else { + USER_HANDLER_CACHE[eid][type].push(handler); + } + } + // 绑定dom事件 + function bindDomEvent(node, type, handler) { + if (node.addEventListener) { + node.addEventListener(type, handler, false); + } else { + node.attachEvent("on" + type, handler); + } + } + // 删除dom事件 + function deleteDomEvent(node, type, handler) { + if (node.removeEventListener) { + node.removeEventListener(type, handler, false); + } else { + node.detachEvent(type, handler); + } + } + // 触发dom事件 + function triggerDomEvent(node, type, params) { + var event = new CustomEvent(type, { + bubbles: true, + cancelable: true + }); + event._kityParam = params; + node.dispatchEvent(event); + } + // 发送消息 + function sendMessage(messageObj, type, msg) { + var event = null, handler = null; + var handlers = INNER_HANDLER_CACHE[messageObj._EVNET_UID]; + if (!handlers) return; + handler = handlers[type]; + if (!handler) { + return; + } + event = Utils.extend({ + type: type, + target: messageObj + }, msg || {}); + handler.call(messageObj, event); + } + // 对外接口 + return _p.r(11).createClass("EventHandler", { + constructor: function() { + this._EVNET_UID = ++guid; + }, + addEventListener: function(type, handler) { + return _addEvent.call(this, type, handler, false); + }, + addOnceEventListener: function(type, handler) { + return _addEvent.call(this, type, handler, true); + }, + removeEventListener: function(type, handler) { + return _removeEvent.call(this, type, handler); + }, + on: function(type, handler) { + return this.addEventListener.apply(this, arguments); + }, + once: function(type, handler) { + return this.addOnceEventListener.apply(this, arguments); + }, + off: function() { + return this.removeEventListener.apply(this, arguments); + }, + fire: function(type, params) { + return this.trigger.apply(this, arguments); + }, + trigger: function(type, params) { + sendMessage(this, type, params); + return this; + } + }); + } +}; + +//src/graphic/geometry.js +_p[34] = { + value: function(require) { + var utils = _p.r(12); + var Point = _p.r(50); + var Vector = _p.r(73); + var Matrix = _p.r(43); + var g = {}; + var pathCommand = /([achlmrqstvz])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?\s*)+)/gi, pathValues = /(-?\d*\.?\d*(?:e[\-+]?\d+)?)\s*,?\s*/gi, paramCounts = { + a: 7, + c: 6, + h: 1, + l: 2, + m: 2, + q: 4, + s: 4, + t: 2, + v: 1, + z: 0 + }; + function pathClone(path) { + var result, i, j, segment, segmentCopy; + result = []; + for (i = 0; i < path.length; i++) { + segment = path[i]; + result.push(segmentCopy = []); + for (j = 0; j < segment.length; j++) { + segmentCopy.push(segment[j]); + } + } + if (path.isUniform) result.isUniform = true; + if (path.isAbsolute) result.isAbsolute = true; + if (path.isCurve) result.isCurve = true; + return result; + } + // 缓存函数 + // from raphael.js + function cacher(f, scope, postprocessor) { + function repush(array, item) { + for (var i = 0, ii = array.length; i < ii; i++) if (array[i] === item) { + return array.push(array.splice(i, 1)[0]); + } + } + function newf() { + var arg = Array.prototype.slice.call(arguments, 0), args = arg.join("␀"), cache = newf.cache = newf.cache || {}, count = newf.count = newf.count || []; + if (cache.hasOwnProperty(args)) { + repush(count, args); + return postprocessor ? postprocessor(cache[args]) : cache[args]; + } + if (count.length >= 1e3) { + delete cache[count.shift()]; + } + count.push(args); + cache[args] = f.apply(scope, arg); + return postprocessor ? postprocessor(cache[args]) : cache[args]; + } + return newf; + } + /** + * + * kity.g.pathToString(pathSegment) + * + * 返回表示 PathSegment 的字符串 + * + * @param {Array} pathSegment + * 要表示的 Path Segment + * + * @return {String} 表示该 Path 的字符串 + * + * @example + * + * var pathSegment = [['M', 0, 0], ['L', 10, 10]] + * var pathString = kity.g.pathToString(pathSegment); + * // 返回 'M0,0L10,10' + */ + g.pathToString = function(pathSegment) { + pathSegment = pathSegment || this; + if (typeof pathSegment == "string") return pathSegment; + if (pathSegment instanceof Array) { + pathSegment = utils.flatten(pathSegment); + return pathSegment.join(",").replace(/,?([achlmqrstvxz]),?/gi, "$1"); + } + }; + /** + * kity.g.parsePathString(pathString) + * + * 解析 Path 字符串成 PathSegment + * + * @copyright rapheal.js + * + * @example + * + * var seg = kity.g.parsePathString('M10,12l21-23-21.5,11z'); + * // 返回: [['M', 10, 12], ['l', 21, -23], ['l', -21.5, 11], ['z']] + * + * @param {String} pathString Path 字符串 + * @return {Array} + */ + g.parsePathString = cacher(function(pathString) { + var data = []; + pathString.replace(pathCommand, function(a, b, c) { + var params = [], name = b.toLowerCase(); + c.replace(pathValues, function(a, b) { + if (b) params.push(+b); + }); + if (name == "m" && params.length > 2) { + data.push([ b ].concat(params.splice(0, 2))); + name = "l"; + b = b == "m" ? "l" : "L"; + } + if (name == "r") { + data.push([ b ].concat(params)); + } else { + while (params.length >= paramCounts[name]) { + data.push([ b ].concat(params.splice(0, paramCounts[name]))); + if (!paramCounts[name]) { + break; + } + } + } + }); + data.isUniform = true; + data.toString = g.pathToString; + return data; + }); + /** + * kity.g.pathToAbsolute(path) + * + * 把路径转换为绝对路径的形式 + * + * @param {Array|String} path + * 要转换的 path 路径或者数组 + * + * @return {Array} + * 转换后的 Path Segment + * + * @example + * + * var path = 'M10,10l50,50'; + * var absPath = kity.g.pathToAbsolute(path); + * // 返回 [['M', 10, 10], ['L', 60, 60]] + */ + g.pathToAbsolute = cacher(function(path) { + var pathArray = path.isUniform ? path : g.parsePathString(g.pathToString(path)); + var res = [], x = 0, y = 0, mx = 0, my = 0, start = 0; + var r, pa, i, j, k, ii, jj, kk; + if (pathArray[0][0] == "M") { + x = +pathArray[0][1]; + y = +pathArray[0][2]; + mx = x; + my = y; + start++; + res[0] = [ "M", x, y ]; + } + for (r, pa, i = start, ii = pathArray.length; i < ii; i++) { + res.push(r = []); + pa = pathArray[i]; + if (pa[0] != pa[0].toUpperCase()) { + r[0] = pa[0].toUpperCase(); + switch (r[0]) { + case "A": + r[1] = pa[1]; + r[2] = pa[2]; + r[3] = pa[3]; + r[4] = pa[4]; + r[5] = pa[5]; + r[6] = +(pa[6] + x); + r[7] = +(pa[7] + y); + break; + + case "V": + r[1] = +pa[1] + y; + break; + + case "H": + r[1] = +pa[1] + x; + break; + + case "M": + mx = +pa[1] + x; + my = +pa[2] + y; + break; + + default: + for (j = 1, jj = pa.length; j < jj; j++) { + r[j] = +pa[j] + (j % 2 ? x : y); + } + } + } else { + for (k = 0, kk = pa.length; k < kk; k++) { + r[k] = pa[k]; + } + } + switch (r[0]) { + case "Z": + x = mx; + y = my; + break; + + case "H": + x = r[1]; + break; + + case "V": + y = r[1]; + break; + + case "M": + mx = r[r.length - 2]; + my = r[r.length - 1]; + break; + + default: + x = r[r.length - 2]; + y = r[r.length - 1]; + } + } + res.isUniform = true; + res.isAbsolute = true; + res.toString = g.pathToString; + return res; + }); + // 把圆弧绘制的曲线转化为对应的三次贝塞尔形式 + function a2c(x1, y1, rx, ry, angle, laf, sf, x2, y2, recursive) { + // copy from raphael.js + // for more information of where this math came from visit: + // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes + var math = Math, PI = math.PI, abs = Math.abs, _120 = PI * 120 / 180, rad = PI / 180 * (+angle || 0), res = [], xy, rotate = function(x, y, rad) { + var X = x * math.cos(rad) - y * math.sin(rad), Y = x * math.sin(rad) + y * math.cos(rad); + return { + x: X, + y: Y + }; + }; + var cos, sin, h, x, y, rx2, ry2, k, cx, cy, f1, f2, df, f2old, x2old, y2old, c1, s1, c2, s2, t, hx, hy, m1, m2, m3, m4, newres, i, ii; + if (!recursive) { + xy = rotate(x1, y1, -rad); + x1 = xy.x; + y1 = xy.y; + xy = rotate(x2, y2, -rad); + x2 = xy.x; + y2 = xy.y; + cos = math.cos(PI / 180 * angle); + sin = math.sin(PI / 180 * angle); + x = (x1 - x2) / 2; + y = (y1 - y2) / 2; + h = x * x / (rx * rx) + y * y / (ry * ry); + if (h > 1) { + h = math.sqrt(h); + rx = h * rx; + ry = h * ry; + } + rx2 = rx * rx; + ry2 = ry * ry; + k = (laf == sf ? -1 : 1) * math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))); + cx = k * rx * y / ry + (x1 + x2) / 2; + cy = k * -ry * x / rx + (y1 + y2) / 2; + f1 = math.asin(((y1 - cy) / ry).toFixed(9)); + f2 = math.asin(((y2 - cy) / ry).toFixed(9)); + f1 = x1 < cx ? PI - f1 : f1; + f2 = x2 < cx ? PI - f2 : f2; + if (f1 < 0) f1 = PI * 2 + f1; + if (f2 < 0) f2 = PI * 2 + f2; + if (sf && f1 > f2) { + f1 = f1 - PI * 2; + } + if (!sf && f2 > f1) { + f2 = f2 - PI * 2; + } + } else { + f1 = recursive[0]; + f2 = recursive[1]; + cx = recursive[2]; + cy = recursive[3]; + } + df = f2 - f1; + if (abs(df) > _120) { + f2old = f2; + x2old = x2; + y2old = y2; + f2 = f1 + _120 * (sf && f2 > f1 ? 1 : -1); + x2 = cx + rx * math.cos(f2); + y2 = cy + ry * math.sin(f2); + res = a2c(x2, y2, rx, ry, angle, 0, sf, x2old, y2old, [ f2, f2old, cx, cy ]); + } + df = f2 - f1; + c1 = math.cos(f1); + s1 = math.sin(f1); + c2 = math.cos(f2); + s2 = math.sin(f2); + t = math.tan(df / 4); + hx = 4 / 3 * rx * t; + hy = 4 / 3 * ry * t; + m1 = [ x1, y1 ]; + m2 = [ x1 + hx * s1, y1 - hy * c1 ]; + m3 = [ x2 + hx * s2, y2 - hy * c2 ]; + m4 = [ x2, y2 ]; + m2[0] = 2 * m1[0] - m2[0]; + m2[1] = 2 * m1[1] - m2[1]; + if (recursive) { + return [ m2, m3, m4 ].concat(res); + } else { + res = [ m2, m3, m4 ].concat(res).join().split(","); + newres = []; + for (i = 0, ii = res.length; i < ii; i++) { + newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x; + } + return newres; + } + } + // 把二次贝塞尔曲线参数转化为三次贝塞尔曲线参数 + function q2c(x1, y1, ax, ay, x2, y2) { + // copy from raphael.js + var _13 = 1 / 3, _23 = 2 / 3; + return [ _13 * x1 + _23 * ax, _13 * y1 + _23 * ay, _13 * x2 + _23 * ax, _13 * y2 + _23 * ay, x2, y2 ]; + } + /** + * kity.g.pathToCurve(path) + * + * 把路径转换为贝塞尔路径 + * + * @param {Array|String} path + * 要转换的 path 路径或数组 + * + * @return {Array} + * 转换后的 PathSegment,每一段都是 'C' + */ + g.pathToCurve = cacher(function(path) { + var i, j, command, param; + var initPoint, currentPoint, endPoint, shouldClose, lastControlPoint, aussumedControlPoint; + var controlPoint1, controlPoint2; + var res = []; + // 处理的路径要求是一个绝对路径 + if (!path.isAbsolute) path = g.pathToAbsolute(path); + for (i = 0; i < path.length; i++) { + command = path[i][0]; + param = path[i].slice(1); + // 画笔移动 + if (command == "M") { + initPoint = lastControlPoint = currentPoint = param; + res.push(path[i]); + continue; + } + // 路径闭合 + if (command == "Z") { + shouldClose = true; + command = "L"; + param = initPoint; + } + // 绘制命令的目的位置 + endPoint = param.slice(param.length - 2); + // 对 'H' 命令的修正 + if (command == "H") { + endPoint = [ param[0], currentPoint[1] ]; + command = "L"; + } + // 对 'V' 命令的修正 + if (command == "V") { + endPoint = [ currentPoint[0], param[0] ]; + command = "L"; + } + // 对 'S' 命令求出隐含的控制点位置 + if (command == "S" || command == "T") { + // 隐含控制点是上一个控制点关于当前位置的镜像 + aussumedControlPoint = [ currentPoint[0] + (currentPoint[0] - lastControlPoint[0]), currentPoint[1] + (currentPoint[1] - lastControlPoint[1]) ]; + } + // 针对不同的命令求控制点 + switch (command) { + case "L": + controlPoint1 = currentPoint; + controlPoint2 = endPoint; + break; + + case "C": + controlPoint1 = param.slice(0, 2); + controlPoint2 = param.slice(2, 4); + break; + + case "S": + controlPoint1 = aussumedControlPoint.slice(); + controlPoint2 = param.slice(0, 2); + break; + + case "Q": + lastControlPoint = param.slice(0, 2); + param = q2c.apply(null, currentPoint.concat(param)); + controlPoint1 = param.slice(0, 2); + controlPoint2 = param.slice(2, 4); + break; + + case "T": + param = q2c.apply(null, currentPoint.concat(aussumedControlPoint).concat(param)); + controlPoint1 = param.slice(0, 2); + controlPoint2 = param.slice(2, 4); + break; + + case "A": + param = a2c.apply(null, currentPoint.concat(param)); + j = 0; + while (j in param) { + controlPoint1 = param.slice(j, j + 2); + controlPoint2 = param.slice(j + 2, j + 4); + endPoint = param.slice(j + 4, j + 6); + // 写入当前一段曲线 + res.push([ "C" ].concat(controlPoint1).concat(controlPoint2).concat(endPoint)); + j += 6; + } + break; + } + if (command != "A") { + // 写入当前一段曲线 + res.push([ "C" ].concat(controlPoint1).concat(controlPoint2).concat(endPoint)); + } + // 为下次循环准备当前位置 + currentPoint = endPoint; + // 二次贝塞尔曲线自己已经记录了上个控制点的位置,其它的记录控制点 2 的位置 + if (command != "Q") { + lastControlPoint = controlPoint2; + } + if (shouldClose) { + res.push([ "Z" ]); + shouldClose = false; + } + } + res.isUniform = true; + res.isAbsolute = true; + res.isCurve = true; + res.toString = g.pathToString; + return res; + }); + /** + * 将贝塞尔曲线切成两部分 + * + * @see http://stackoverflow.com/questions/18655135/divide-bezier-curve-into-two-equal-halves + */ + function cutBezier(bezierArray, t) { + function __(t) { + return function(p, q) { + return p + t * (q - p); + }; + } + var _ = __(t || .5), ba = bezierArray, ax = ba[0], ay = ba[1], bx = ba[2], by = ba[3], cx = ba[4], cy = ba[5], dx = ba[6], dy = ba[7], ex = _(ax, bx), ey = _(ay, by), fx = _(bx, cx), fy = _(by, cy), gx = _(cx, dx), gy = _(cy, dy), hx = _(ex, fx), hy = _(ey, fy), jx = _(fx, gx), jy = _(fy, gy), kx = _(hx, jx), ky = _(hy, jy); + return [ [ ax, ay, ex, ey, hx, hy, kx, ky ], [ kx, ky, jx, jy, gx, gy, dx, dy ] ]; + } + /** + * kity.g.cutBezier(bezierArray, t) + * + * 在指定位置把贝塞尔曲线切割为两部分 + * + * @param {Array} bezierArray + * 表示贝塞尔曲线的一个数组 [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y] + * p1 和 p2 是贝塞尔曲线的起点和终点,c1 和 c2 是两个控制点 + * + * @param {Number} t + * 切割的位置(0 到 1) + * + * @return {Array} + * 切割的两个贝塞尔曲线:[ + * [p1x1, p1y1, c1x1, c1y1, c2x1, c2y1, p2x1, p2y1], + * [p1x2, p1y2, c1x2, c1y2, c2x2, c2y2, p2x2, p2y2] + * ] + * + */ + g.cutBezier = cacher(cutBezier); + /** + * 求一段贝塞尔曲线的子段 + * + * @param {Array} bezierArray + * 长度为 8 的数组,表示 [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y] + * + * @param {Number} t + * 子段的结束位置(0 到 1) + * + * @param {Number} t0 + * 字段的开始位置(0 到 t),可不传,默认为 0 + * + * @return {Array} + * 长度为 8 的数组,表示给定贝塞尔曲线的子段 + */ + g.subBezier = function(bezierArray, t, t0) { + var b2t = cutBezier(bezierArray, t)[0]; + return t0 ? cutBezier(b2t, t0 / t)[1] : b2t; + }; + /** + * 求贝塞尔曲线上的一个点 + * + * @param {Array} bezierArray + * 长度为 8 的数组,表示 [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y] + * + * @param {Number} t + * 所求点的开始位置(0 到 1) + * + * @return {Point} p + * p.x: x 坐标 + * p.y: y 坐标 + * p.tan: 在 t 处的切线方向(类型为 kity.Vector,模为 1) + */ + g.pointAtBezier = function(bezierArray, t) { + var b2t = cutBezier(bezierArray, t)[0]; + var p = Point.parse(b2t.slice(6)), c = Point.parse(b2t.slice(4, 2)), v = Vector.fromPoints(c, p); + if (t === 0) { + p.tan = g.pointAtBezier(bezierArray, .01).tan; + } else { + p.tan = v.normalize(); + } + return p; + }; + /** + * 求贝塞尔曲线的长度 + * + * @param {Array} bezierArray + * 长度为 8 的数组,表示 [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y] + * + * @param {Number} tolerate + * 允许的误差,默认是 0.1 + * + * @return {Number} 贝塞尔曲线的长度 + */ + g.bezierLength = cacher(function bezierLength(bezierArray) { + // 表示(c[0]*t^4 + c[1]*t^3 + c[2]*t^2 + c[3]*t^1 + c[4])^(1/2)的函数 + function f(x) { + var m = c0 * Math.pow(x, 4) + c1 * Math.pow(x, 3) + c2 * Math.pow(x, 2) + c3 * x + c4; + if (m < 0) { + m = 0; + } + return Math.pow(m, .5); + } + // 用Newton-Cotes型求积公式 + var arr = bezierArray; + // 三次贝塞尔曲线函数求导后,求出对应的方程系数,用cx[],cy[]表示x`(t)和y`(t)的系数 + var cx0, cx1, cx2; + var cy0, cy1, cy2; + // 用c[]表示x`(t)^2 + y`(t)^2的结果的系数 + var c0, c1, c2, c3, c4; + // 求x`(t) 和 y`(t)的系数 + cx0 = -3 * arr[0] + 9 * arr[2] - 9 * arr[4] + 3 * arr[6]; + cx1 = 6 * arr[0] - 12 * arr[2] + 6 * arr[4]; + cx2 = -3 * arr[0] + 3 * arr[2]; + cy0 = -3 * arr[1] + 9 * arr[3] - 9 * arr[5] + 3 * arr[7]; + cy1 = 6 * arr[1] - 12 * arr[3] + 6 * arr[5]; + cy2 = -3 * arr[1] + 3 * arr[3]; + // 求x`(t)^2 + y`(t)^2的结果的系数 c[] + c0 = Math.pow(cx0, 2) + Math.pow(cy0, 2); + c1 = 2 * (cx0 * cx1 + cy0 * cy1); + c2 = 2 * (cx0 * cx2 + cy0 * cy2) + Math.pow(cx1, 2) + Math.pow(cy1, 2); + c3 = 2 * (cx1 * cx2 + cy1 * cy2); + c4 = Math.pow(cx2, 2) + Math.pow(cy2, 2); + // 用cotes积分公式求值 + return (f(0) + f(1) + 4 * (f(.125) + f(.375) + f(.625) + f(.875)) + 2 * (f(.25) + f(.5) + f(.75))) / 24; + }); + // 计算一个 pathSegment 中每一段的在整体中所占的长度范围,以及总长度 + // 方法要求每一段都是贝塞尔曲线 + var getBezierPathSegmentRanges = cacher(function(pathSegment) { + var i, ii, segment, position, bezierLength, segmentRanges, totalLength; + segmentRanges = []; + // 总长度 + totalLength = 0; + for (i = 0, ii = pathSegment.length; i < ii; i++) { + segment = pathSegment[i]; + if (segment[0] == "M") { + position = segment.slice(1); + segmentRanges.push(null); + continue; + } + if (segment[0] == "Z") { + segmentRanges.push(null); + continue; + } + bezierLength = g.bezierLength(position.concat(segment.slice(1))); + segmentRanges.push([ totalLength, totalLength + bezierLength ]); + totalLength += bezierLength; + // 迭代当前位置 + position = segment.slice(4); + } + segmentRanges.totalLength = totalLength; + return segmentRanges; + }); + /** + * 求一段路径的子路径 + * + * @param {Array|String} path + * 原路径 + * + * @param {Number} t1 + * 要求的子路径的结束位置(0 到 1) + * + * @param {Number} t0 + * 要求的子路径的开始位置(0 到 t1),可不传,默认为 0 + * + * @return {Array} + * 子路径的 PathSegment + */ + g.subPath = function(path, t1, t0) { + var dt; + t0 = t0 || 0; + dt = t1 - t0; + dt = dt - (dt | 0); + t0 = t0 - (t0 | 0); + t1 = t0 + dt; + if (t1 > 1) { + return g.subPath(path, 1, t0).concat(g.subPath(path, t1 - 1)); + } + if (!path.isCurve) { + path = g.pathToCurve(path); + } + // path 每一段在整体中的长度区间 + var segmentRanges = getBezierPathSegmentRanges(path); + // path 总长度 + var totalLength = segmentRanges.totalLength; + // t1 和 t0 位置命中的长度位置 + var t1Length = totalLength * t1, t0Length = totalLength * (t0 || 0); + // 产生的子路径 + var subPath = []; + // 迭代变量,a 是一段的长度区间左值,b 是右值,d 是区间长度 + var i, ii, a, b, d; + var position; + var bezier, subBezier, stared; + for (i = 0, ii = path.length; i < ii; i++) { + if (path[i][0] == "M") { + position = path[i].slice(1); + if (stared) { + subPath.push(path[i].slice()); + } + continue; + } + if (path[i][0] == "Z") { + // subpath 路径不闭合 + continue; + } + a = segmentRanges[i][0]; + b = segmentRanges[i][1]; + d = b - a; + bezier = position.concat(path[i].slice(1)); + if (t0Length > b) { + // t0 和 t1 都右溢出 + // ----------------------------------- + // t0 t1 + // |________| + // + // 需要跳过当前块 + position = bezier.slice(bezier.length - 2); + continue; + } else if (t0Length >= a) { + // 命中 t0;t1 可能命中或右溢出 + // ----------------------------------- + // t0 t1 + // |______|__| + // + // or: |_|____|__| + // + // 取当前块 t0 到 t1 的部分 + subBezier = g.subBezier(bezier, Math.min((t1Length - a) / d, 1), (t0Length - a) / d); + stared = true; + position = subBezier.slice(0, 2); + subPath.push([ "M" ].concat(subBezier.slice(0, 2))); + subPath.push([ "C" ].concat(subBezier.slice(2))); + } else if (t1Length >= b) { + // t0 左溢出;t1 右溢出,整个块是需要的 + // ----------------------------------- + // t0 t1 + // |_________| + // + // 此时取整个块 + subPath.push(path[i].slice()); + } else if (t1Length >= a) { + // t0 左溢出;t1 命中,取当前块 t1 之前的部分 + // ----------------------------------- + // t0 t1 + // |__|______| + // 取当前块 t1 之前的部分 + subBezier = g.subBezier(bezier, (t1Length - a) / d); + subPath.push([ "C" ].concat(subBezier.slice(2))); + stared = false; + } else { + // 没有可以再要的了 + break; + } + position = bezier.slice(bezier.length - 2); + } + subPath.isAbsolute = true; + subPath.isCurve = true; + subPath.isUniform = true; + subPath.toString = g.pathToString; + return subPath; + }; + /** + * 求路径上的一个点 + * + * @param {Array|String} path + * 要求点的路径 + * + * @param {Number} t + * 要求的点的位置(0 到 1) + * + * @return {Point} p + * p.x: x 坐标 + * p.y: y 坐标 + * p.tan: 在 t 处的切线方向(类型为 kity.Vector,模为 1) + */ + g.pointAtPath = function(path, t) { + if (!path.isCurve) { + path = g.pathToCurve(path); + } + var subPath = g.subPath(path, t); + var lastCurve = subPath[subPath.length - 1][0] == "Z" ? subPath[subPath.length - 2] : subPath[subPath.length - 1]; + // 跳过 'C' 命令,只留参数 + lastCurve = lastCurve.slice(1); + var p = Point.parse(lastCurve.slice(4)), c = Point.parse(lastCurve.slice(2, 4)); + p.tan = Vector.fromPoints(c, p).normalize(); + return p; + }; + /** + * 求一段路径的长度 + * + * @param {string|Array} path + * 要求的路径 + * + * @return {Number} + * 路径的长度 + */ + g.pathLength = cacher(function(path) { + if (!path.isCurve) { + path = g.pathToCurve(path); + } + // path 每一段在整体中的长度区间 + var segmentRanges = getBezierPathSegmentRanges(path); + return segmentRanges.totalLength; + }); + /** + * 求一段路径的关键点 + * + * @param {string|Array} path + * 要求的路径 + * + * @return {Array} + * 关键点的集合 + */ + g.pathKeyPoints = cacher(function(path) { + var i, ii, command, keyPoints; + if (!path.isCurve) { + path = g.pathToCurve(path); + } + keyPoints = []; + for (i = 0, ii = path.length; i < ii; i++) { + if (path[i][0] == "z") continue; + keyPoints.push(path[i].slice(path[i].length - 2)); + } + return keyPoints; + }); + // 对比两个路径的关键位置,在合适的位置切割合适的路径,使得两个路径的段数一致 + // TODO: 使用插值算法,使对应点更合理 + var alignCurve = cacher(function(path1, path2) { + if (!path1.isCurve) path1 = g.pathToCurve(path1); + if (!path2.isCurve) path2 = g.pathToCurve(path2); + var p1 = pathClone(path1); + var p2 = pathClone(path2); + p1.i = 0; + p2.i = 0; + p1.o = p2; + p2.o = p1; + function command(p, i) { + return p[i || p.i] && p[i || p.i][0]; + } + function param(p, i) { + return p[i || p.i] && p[i || p.i].slice(1); + } + function point(p, i) { + var _param = param(p, i); + return _param && _param.slice(-2); + } + function fixZ(p) { + if (command(p) == "Z") { + p.splice(p.i, 1); + return true; + } + return false; + } + function fixM(p) { + if (command(p) == "M") { + p.o.splice(p.o.i, 0, [ "M" ].concat(point(p.o, p.o.i - 1))); + p.i++; + p.o.i++; + return true; + } + return false; + } + function fill(p) { + var lastPoint; + var i = 1; + while (!lastPoint) { + lastPoint = point(p, p.length - i++); + } + p.o.i = p.i; + while (p.length < p.o.length) { + if (fixZ(p.o)) continue; + if (fixM(p.o)) continue; + p.push([ "C" ].concat(lastPoint).concat(lastPoint).concat(lastPoint)); + p.i++; + p.o.i++; + } + } + while (p1.i < p1.length && p2.i < p2.length) { + if (fixZ(p1) || fixZ(p2)) continue; + if (command(p1) == command(p2)) { + p1.i++; + p2.i++; + continue; + } + if (fixM(p1) || fixM(p2)) continue; + p1.i++; + p2.i++; + } + if (p1.i == p1.length) fill(p1); + if (p2.i == p2.length) fill(p2); + delete p1.i; + delete p1.o; + delete p2.i; + delete p2.o; + return [ p1, p2 ]; + }); + g.alignCurve = alignCurve; + /** + * 获得两个路径的补间结果 + * + * @param {string|Array} path1 + * 补间起始路径 + * + * @param {string|Array} path2 + * 补间结束路径 + * + * @param {Number} t + * 补间比例,0 返回跟 path1 等效的结果;1 返回跟 path2 等效的结果 + * + * @return {PathSegment} + * 补间的结果 + */ + g.pathTween = function(path1, path2, t) { + if (t === 0) return path1; + if (t === 1) return path2; + var aligned = alignCurve(path1, path2); + var result = [], seg, i, j; + path1 = aligned[0]; + path2 = aligned[1]; + for (i = 0; i < path1.length; i++) { + result.push(seg = []); + seg.push(path1[i][0]); + for (j = 1; j < path1[i].length; j++) { + seg.push(path1[i][j] + t * (path2[i][j] - path1[i][j])); + } + } + result.isUniform = result.isCurve = result.isAbsolute = true; + return result; + }; + /** + * 变换指定的路径 + * + * @param {String|Array} path + * 需要变换的路径 + * + * @param {kity.Matrix} matrix + * 使用的变换矩阵 + * + * @return {Array} + * 变换后的路径 + */ + g.transformPath = cacher(function(path, matrix) { + var i, ii, j, result, seg, pair; + if (!path.isCurve) { + path = g.pathToCurve(path); + } + result = []; + for (i = 0, ii = path.length; i < ii; i++) { + result.push(seg = [ path[i][0] ]); + for (j = 1; j < path[i].length; j += 2) { + pair = path[i].slice(j, j + 2); + pair = matrix.transformPoint(Point.parse(pair)); + result.push(pair); + } + } + return result; + }); + // entend + _p.r(11).extendClass(Matrix, { + transformPath: function(path) { + return g.transformPath(path, this); + } + }); + return g; + } +}; + +//src/graphic/gradient.js +_p[35] = { + value: function(require, exports, module) { + var svg = _p.r(67); + var Resource = _p.r(58); + var Color = _p.r(28); + return _p.r(11).createClass("GradientBrush", { + base: Resource, + constructor: function(gradientNodeType, paper) { + this.callBase(gradientNodeType, paper); + this.stops = []; + }, + addStop: function(offset, color, opacity) { + var gstop = svg.createNode("stop"); + if (!(color instanceof Color)) { + color = Color.parse(color); + } + if (opacity === undefined) { + opacity = color.get("a"); + } + gstop.setAttribute("offset", offset); + gstop.setAttribute("stop-color", color.toRGB()); + if (opacity < 1) { + gstop.setAttribute("stop-opacity", opacity); + } + this.node.appendChild(gstop); + return this; + } + }); + } +}; + +//src/graphic/group.js +_p[36] = { + value: function(require, exports, module) { + var ShapeContainer = _p.r(61); + return _p.r(11).createClass("Group", { + mixins: [ ShapeContainer ], + base: _p.r(60), + constructor: function Group() { + this.callBase("g"); + } + }); + } +}; + +//src/graphic/hyperlink.js +_p[37] = { + value: function(require, exports, module) { + var ShapeContainer = _p.r(61); + return _p.r(11).createClass("HyperLink", { + mixins: [ ShapeContainer ], + base: _p.r(60), + constructor: function(url) { + this.callBase("a"); + this.setHref(url); + }, + setHref: function(href) { + this.node.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", href); + return this; + }, + getHref: function() { + return this.node.getAttributeNS("xlink:href"); + }, + setTarget: function(target) { + this.node.setAttribute("target", target); + return this; + }, + getTarget: function() { + return this.node.getAttribute("target"); + } + }); + } +}; + +//src/graphic/image.js +_p[38] = { + value: function(require, exports, module) { + return _p.r(11).createClass("Image", { + base: _p.r(60), + constructor: function(url, width, height, x, y) { + this.callBase("image"); + this.url = url; + this.width = width || 0; + this.height = height || 0; + this.x = x || 0; + this.y = y || 0; + this.update(); + }, + update: function() { + this.node.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", this.url); + this.node.setAttribute("x", this.x); + this.node.setAttribute("y", this.y); + this.node.setAttribute("width", this.width); + this.node.setAttribute("height", this.height); + return this; + }, + setUrl: function(url) { + this.url = url === "" ? null : url; + return this.update(); + }, + getUrl: function() { + return this.url; + }, + setWidth: function(width) { + this.width = width; + return this.update(); + }, + getWidth: function() { + return this.width; + }, + setHeight: function(height) { + this.height = height; + return this.update(); + }, + getHeight: function() { + return this.height; + }, + setX: function(x) { + this.x = x; + return this.update(); + }, + getX: function() { + return this.x; + }, + setY: function(y) { + this.y = y; + return this.update(); + }, + getY: function() { + return this.y; + } + }); + } +}; + +//src/graphic/line.js +_p[39] = { + value: function(require, exports, module) { + return _p.r(11).createClass("Line", { + base: _p.r(46), + constructor: function(x1, y1, x2, y2) { + this.callBase(); + this.point1 = { + x: x1 || 0, + y: y1 || 0 + }; + this.point2 = { + x: x2 || 0, + y: y2 || 0 + }; + this.update(); + }, + setPoint1: function(x, y) { + this.point1.x = x; + this.point1.y = y; + return this.update(); + }, + setPoint2: function(x, y) { + this.point2.x = x; + this.point2.y = y; + return this.update(); + }, + getPoint1: function() { + return { + x: this.point1.x, + y: this.point1.y + }; + }, + getPoint2: function() { + return { + x: this.point2.x, + y: this.point2.y + }; + }, + update: function() { + var drawer = this.getDrawer(); + drawer.clear(); + drawer.moveTo(this.point1.x, this.point1.y); + drawer.lineTo(this.point2.x, this.point2.y); + return this; + } + }); + } +}; + +//src/graphic/lineargradient.js +_p[40] = { + value: function(require, exports, module) { + var svg = _p.r(67); + var Gradient = _p.r(35); + return _p.r(11).createClass("LinearGradientBrush", { + base: Gradient, + constructor: function(paper) { + this.callBase("linearGradient", paper); + this.setStartPosition(0, 0); + this.setEndPosition(1, 0); + }, + setStartPosition: function(px, py) { + this.node.setAttribute("x1", px); + this.node.setAttribute("y1", py); + return this; + }, + setEndPosition: function(px, py) { + this.node.setAttribute("x2", px); + this.node.setAttribute("y2", py); + return this; + }, + getStartPosition: function() { + return { + x: +this.node.getAttribute("x1"), + y: +this.node.getAttribute("y1") + }; + }, + getEndPosition: function() { + return { + x: +this.node.getAttribute("x2"), + y: +this.node.getAttribute("y2") + }; + } + }); + } +}; + +//src/graphic/marker.js +_p[41] = { + value: function(require, exports, module) { + var Point = _p.r(50); + var Marker = _p.r(11).createClass("Marker", { + base: _p.r(58), + mixins: [ _p.r(61), _p.r(75) ], + constructor: function() { + this.callBase("marker"); + this.setOrient("auto"); + }, + setRef: function(x, y) { + if (arguments.length === 1) { + y = x.y; + x = x.x; + } + this.node.setAttribute("refX", x); + this.node.setAttribute("refY", y); + return this; + }, + getRef: function() { + return new Point(+this.node.getAttribute("refX"), +this.node.getAttribute("refY")); + }, + setWidth: function(width) { + this.node.setAttribute("markerWidth", this.width = width); + return this; + }, + setOrient: function(orient) { + this.node.setAttribute("orient", this.orient = orient); + return this; + }, + getOrient: function() { + return this.orient; + }, + getWidth: function() { + return +this.width; + }, + setHeight: function(height) { + this.node.setAttribute("markerHeight", this.height = height); + return this; + }, + getHeight: function() { + return +this.height; + } + }); + var Path = _p.r(46); + _p.r(11).extendClass(Path, { + setMarker: function(marker, pos) { + pos = pos || "end"; + if (!marker) { + this.node.removeAttribute("marker-" + pos); + } else { + this.node.setAttribute("marker-" + pos, marker.toString()); + } + return this; + } + }); + return Marker; + } +}; + +//src/graphic/mask.js +/** + * 蒙板 + */ +_p[42] = { + value: function(require, exports, module) { + var Class = _p.r(11); + var Shape = _p.r(60); + var Mask = Class.createClass("Mask", { + base: Shape, + mixins: [ _p.r(61) ], + constructor: function() { + this.callBase("mask"); + }, + mask: function(shape) { + shape.getNode().setAttribute("mask", "url(#" + this.getId() + ")"); + return this; + } + }); + Class.extendClass(Shape, { + maskWith: function(mask) { + mask.mask(this); + return this; + } + }); + return Mask; + } +}; + +//src/graphic/matrix.js +_p[43] = { + value: function(require, exports, module) { + var utils = _p.r(12); + var Box = _p.r(25); + var mPattern = /matrix\s*\((.+)\)/i; + var Point = _p.r(50); + // 注意,合并的结果是先执行m2,再执行m1的结果 + function mergeMatrixData(m2, m1) { + return { + a: m1.a * m2.a + m1.c * m2.b, + b: m1.b * m2.a + m1.d * m2.b, + c: m1.a * m2.c + m1.c * m2.d, + d: m1.b * m2.c + m1.d * m2.d, + e: m1.a * m2.e + m1.c * m2.f + m1.e, + f: m1.b * m2.e + m1.d * m2.f + m1.f + }; + } + function d2r(deg) { + return deg * Math.PI / 180; + } + var Matrix = _p.r(11).createClass("Matrix", { + constructor: function() { + if (arguments.length) { + this.setMatrix.apply(this, arguments); + } else { + this.setMatrix(1, 0, 0, 1, 0, 0); + } + }, + translate: function(x, y) { + this.m = mergeMatrixData(this.m, { + a: 1, + c: 0, + e: x, + b: 0, + d: 1, + f: y + }); + return this; + }, + rotate: function(deg) { + var rad = d2r(deg); + var sin = Math.sin(rad), cos = Math.cos(rad); + this.m = mergeMatrixData(this.m, { + a: cos, + c: -sin, + e: 0, + b: sin, + d: cos, + f: 0 + }); + return this; + }, + scale: function(sx, sy) { + if (sy === undefined) { + sy = sx; + } + this.m = mergeMatrixData(this.m, { + a: sx, + c: 0, + e: 0, + b: 0, + d: sy, + f: 0 + }); + return this; + }, + skew: function(degX, degY) { + if (degY === undefined) { + degY = degX; + } + var tx = Math.tan(d2r(degX)), ty = Math.tan(d2r(degY)); + this.m = mergeMatrixData(this.m, { + a: 1, + c: tx, + e: 0, + b: ty, + d: 1, + f: 0 + }); + return this; + }, + /** + * 获得反转矩阵 + * + * 这是我解方程算出来的 + */ + inverse: function() { + var m = this.m, a = m.a, b = m.b, c = m.c, d = m.d, e = m.e, f = m.f, k, aa, bb, cc, dd, ee, ff; + k = a * d - b * c; + aa = d / k; + bb = -b / k; + cc = -c / k; + dd = a / k; + ee = (c * f - e * d) / k; + ff = (b * e - a * f) / k; + return new Matrix(aa, bb, cc, dd, ee, ff); + }, + setMatrix: function(a, b, c, d, e, f) { + if (arguments.length === 1) { + this.m = utils.clone(arguments[0]); + } else { + this.m = { + a: a, + b: b, + c: c, + d: d, + e: e, + f: f + }; + } + return this; + }, + getMatrix: function() { + return utils.clone(this.m); + }, + getTranslate: function() { + var m = this.m; + return { + x: m.e / m.a, + y: m.f / m.d + }; + }, + mergeMatrix: function(matrix) { + return new Matrix(mergeMatrixData(this.m, matrix.m)); + }, + merge: function(matrix) { + return this.mergeMatrix(matrix); + }, + toString: function() { + return this.valueOf().join(" "); + }, + valueOf: function() { + var m = this.m; + return [ m.a, m.b, m.c, m.d, m.e, m.f ]; + }, + equals: function(matrix) { + var m1 = this.m, m2 = matrix.m; + return m1.a == m2.a && m1.b == m2.b && m1.c == m2.c && m1.d == m2.d && m1.e == m2.e && m1.f == m2.f; + }, + transformPoint: function() { + return Matrix.transformPoint.apply(null, [].slice.call(arguments).concat([ this.m ])); + }, + transformBox: function(box) { + return Matrix.transformBox(box, this.m); + }, + clone: function() { + return new Matrix(this.m); + } + }); + Matrix.parse = function(str) { + var match; + var f = parseFloat; + if (str instanceof Array) { + return new Matrix({ + a: str[0], + b: str[1], + c: str[2], + d: str[3], + e: str[4], + f: str[5] + }); + } + if (match = mPattern.exec(str)) { + var values = match[1].split(","); + if (values.length != 6) { + values = match[1].split(" "); + } + return new Matrix({ + a: f(values[0]), + b: f(values[1]), + c: f(values[2]), + d: f(values[3]), + e: f(values[4]), + f: f(values[5]) + }); + } + return new Matrix(); + }; + Matrix.transformPoint = function(x, y, m) { + if (arguments.length === 2) { + m = y; + y = x.y; + x = x.x; + } + return new Point(m.a * x + m.c * y + m.e, m.b * x + m.d * y + m.f); + }; + Matrix.transformBox = function(box, matrix) { + var xMin = Number.MAX_VALUE, xMax = -Number.MAX_VALUE, yMin = Number.MAX_VALUE, yMax = -Number.MAX_VALUE; + var bps = [ [ box.x, box.y ], [ box.x + box.width, box.y ], [ box.x, box.y + box.height ], [ box.x + box.width, box.y + box.height ] ]; + var bp, rp, rps = []; + while (bp = bps.pop()) { + rp = Matrix.transformPoint(bp[0], bp[1], matrix); + rps.push(rp); + xMin = Math.min(xMin, rp.x); + xMax = Math.max(xMax, rp.x); + yMin = Math.min(yMin, rp.y); + yMax = Math.max(yMax, rp.y); + } + box = new Box({ + x: xMin, + y: yMin, + width: xMax - xMin, + height: yMax - yMin + }); + utils.extend(box, { + closurePoints: rps + }); + return box; + }; + // 获得从 node 到 refer 的变换矩阵 + Matrix.getCTM = function(target, refer) { + var ctm = { + a: 1, + b: 0, + c: 0, + d: 1, + e: 0, + f: 0 + }; + var node = target.shapeNode || target.node; + refer = refer || "parent"; + /** + * 由于新版chrome(dev 48.0)移除了getTransformToElement这个方法可能导致报错,这里做兼容处理 + * @Date 2015-11-12 + * @Editor Naixor + */ + function getTransformToElement(target, source) { + var matrix; + try { + matrix = source.getScreenCTM().inverse(); + } catch (e) { + throw new Error("Can not inverse source element' ctm."); + } + return matrix.multiply(target.getScreenCTM()); + } + // 根据参照坐标系选区的不一样,返回不同的结果 + switch (refer) { + case "screen": + // 以浏览器屏幕为参照坐标系 + ctm = node.getScreenCTM(); + break; + + case "doc": + case "paper": + // 以文档(Paper)为参照坐标系 + ctm = node.getCTM(); + break; + + case "view": + case "top": + // 以顶层绘图容器(视野)为参照坐标系 + if (target.getPaper()) { + ctm = node.getTransformToElement !== undefined ? node.getTransformToElement(target.getPaper().shapeNode) : getTransformToElement(node, target.getPaper().shapeNode); + } + break; + + case "parent": + // 以父容器为参照坐标系 + if (target.node.parentNode) { + ctm = node.getTransformToElement !== undefined ? node.getTransformToElement(target.node.parentNode) : getTransformToElement(node, target.node.parentNode); + } + break; + + default: + // 其他情况,指定参照物 + if (refer.node) { + ctm = node.getTransformToElement !== undefined ? node.getTransformToElement(refer.shapeNode || refer.node) : getTransformToElement(node, refer.shapeNode || refer.node); + } + } + return ctm ? new Matrix(ctm.a, ctm.b, ctm.c, ctm.d, ctm.e, ctm.f) : new Matrix(); + }; + return Matrix; + } +}; + +//src/graphic/palette.js +/** + * 调色板 + */ +_p[44] = { + value: function(require, exports, module) { + //标准color + var StandardColor = _p.r(64), Color = _p.r(28), Utils = _p.r(12); + var Palette = _p.r(11).createClass("Palette", { + constructor: function() { + this.color = {}; + }, + /* + * 获取颜色名称所对应的颜色值的Color对象 + * @param name 需要获取的颜色名称 + * @return 对应颜色名称的color对象, 如果未找到对应的名称, 则返回null + */ + get: function(name) { + var colorValue = this.color[name] || StandardColor.EXTEND_STANDARD[name] || StandardColor.COLOR_STANDARD[name] || ""; + if (colorValue) { + return new Color(colorValue); + } + return null; + }, + /* + * 获取给定名称的颜色的hex值表示 + * @param name 需要获取的颜色名称 + * @return 如果找到对应的名称, 则返回该名称所对应的hex格式的值, 否则, 返回一个空字符串 + */ + getColorValue: function(name) { + return this.color[name] || StandardColor.EXTEND_STANDARD[name] || StandardColor.COLOR_STANDARD[name] || ""; + }, + /* + * 向调色板实例添加自己独有的颜色名称,对已存在的颜色名称, 将会覆盖掉 + * @param name 新添加的颜色名称 + * @param value 新添加的颜色名称所对应的值, 可以是一个合法的颜色字符串或者是一个color对象 + * @return 新添加的颜色的值 + */ + add: function(name, value) { + if (typeof value === "string") { + this.color[name] = new Color(value).toRGBA(); + } else { + this.color[name] = value.toRGBA(); + } + return value; + }, + /* + * 删除调色板实例上用户自己添加的颜色, 该方法不能删除内置的颜色 + * @param name 需要删除的颜色名称 + * @return 删除是否成功的bool值 + */ + remove: function(name) { + if (this.color.hasOwnProperty(name)) { + delete this.color[name]; + return true; + } + return false; + } + }); + Utils.extend(Palette, { + getColor: function(name) { + var colorValue = StandardColor.EXTEND_STANDARD[name] || StandardColor.COLOR_STANDARD[name]; + if (colorValue) { + return new Color(colorValue); + } + return null; + }, + /* + * 通过给定的名字获取标准的颜色值表示, 返回的值以hex的方式提供 + * @param name 需要获取的标准颜色名称 + * @return 名字所对应的颜色值的hex表示, 如果未找到对应名称的值, 则返回一个空字符串 + */ + getColorValue: function(name) { + return StandardColor.EXTEND_STANDARD[name] || StandardColor.COLOR_STANDARD[name] || ""; + }, + /* + * 向调色板添加颜色名称,新添加的颜色对所有的调色板对象都可见 + * 对已存在的颜色名称, 将会覆盖掉 + * @param name 新添加的颜色名称 + * @param value 新添加的颜色名称所对于的值, 应该是一个hex格式的颜色字符串, 如: ”#ff0000“ + * @return 新添加的颜色的值 + */ + addColor: function(name, value) { + if (typeof value === "string") { + StandardColor.EXTEND_STANDARD[name] = new Color(value).toRGBA(); + } else { + StandardColor.EXTEND_STANDARD[name] = value.toRGBA(); + } + return value; + }, + /* + * 删除用户自己添加的颜色, 该方法不能删除内置的颜色, 该方法不会影响调色板实例自由的颜色 + * @param name 需要删除的颜色名称 + * @return 删除是否成功的bool值 + */ + removeColor: function(name) { + if (StandardColor.EXTEND_STANDARD.hasOwnProperty(name)) { + delete StandardColor.EXTEND_STANDARD[name]; + return true; + } + return false; + } + }); + return Palette; + } +}; + +//src/graphic/paper.js +_p[45] = { + value: function(require, exports, module) { + var Class = _p.r(11); + var utils = _p.r(12); + var svg = _p.r(67); + var Container = _p.r(29); + var ShapeContainer = _p.r(61); + var ViewBox = _p.r(75); + var EventHandler = _p.r(33); + var Styled = _p.r(66); + var Matrix = _p.r(43); + var Paper = Class.createClass("Paper", { + mixins: [ ShapeContainer, EventHandler, Styled, ViewBox ], + constructor: function(container) { + this.callBase(); + this.node = this.createSVGNode(); + this.node.paper = this; + this.node.appendChild(this.resourceNode = svg.createNode("defs")); + this.node.appendChild(this.shapeNode = svg.createNode("g")); + this.resources = new Container(); + this.setWidth("100%").setHeight("100%"); + if (container) { + this.renderTo(container); + } + this.callMixin(); + }, + renderTo: function(container) { + if (utils.isString(container)) { + container = document.getElementById(container); + } + this.container = container; + container.appendChild(this.node); + }, + createSVGNode: function() { + var node = svg.createNode("svg"); + node.setAttribute("xmlns", "http://www.w3.org/2000/svg"); + node.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink"); + node.setAttribute("version", "1.1"); + return node; + }, + getNode: function() { + return this.node; + }, + getContainer: function() { + return this.container; + }, + getWidth: function() { + return this.node.clientWidth; + }, + setWidth: function(width) { + this.node.setAttribute("width", width); + return this; + }, + getHeight: function() { + return this.node.clientHeight; + }, + setHeight: function(height) { + this.node.setAttribute("height", height); + return this; + }, + setViewPort: function(cx, cy, zoom) { + var viewport, box; + if (arguments.length == 1) { + viewport = arguments[0]; + cx = viewport.center.x; + cy = viewport.center.y; + zoom = viewport.zoom; + } + zoom = zoom || 1; + box = this.getViewBox(); + var matrix = new Matrix(); + var dx = box.x + box.width / 2 - cx, dy = box.y + box.height / 2 - cy; + matrix.translate(-cx, -cy); + matrix.scale(zoom); + matrix.translate(cx, cy); + matrix.translate(dx, dy); + this.shapeNode.setAttribute("transform", "matrix(" + matrix + ")"); + this.viewport = { + center: { + x: cx, + y: cy + }, + offset: { + x: dx, + y: dy + }, + zoom: zoom + }; + return this; + }, + getViewPort: function() { + if (!this.viewport) { + var box = this.getViewBox(); + return { + zoom: 1, + center: { + x: box.x + box.width / 2, + y: box.y + box.height / 2 + }, + offset: { + x: 0, + y: 0 + } + }; + } + return this.viewport; + }, + getViewPortMatrix: function() { + return Matrix.parse(this.shapeNode.getAttribute("transform")); + }, + getViewPortTransform: function() { + var m = this.shapeNode.getCTM(); + return new Matrix(m.a, m.b, m.c, m.d, m.e, m.f); + }, + getTransform: function() { + return this.getViewPortTransform().reverse(); + }, + addResource: function(resource) { + this.resources.appendItem(resource); + if (resource.node) { + this.resourceNode.appendChild(resource.node); + } + return this; + }, + removeResource: function(resource) { + if (resource.remove) { + resource.remove(); + } + if (resource.node) { + this.resourceNode.removeChild(resource.node); + } + return this; + }, + getPaper: function() { + return this; + } + }); + var Shape = _p.r(60); + Class.extendClass(Shape, { + getPaper: function() { + var parent = this.container; + while (parent && parent instanceof Paper === false) { + parent = parent.container; + } + return parent; + }, + isAttached: function() { + return !!this.getPaper(); + }, + whenPaperReady: function(fn) { + var me = this; + function check() { + var paper = me.getPaper(); + if (paper && fn) { + fn.call(me, paper); + } + return paper; + } + if (!check()) { + this.on("add treeadd", function listen() { + if (check()) { + me.off("add", listen); + me.off("treeadd", listen); + } + }); + } + return this; + } + }); + return Paper; + } +}; + +//src/graphic/path.js +_p[46] = { + value: function(require, exports, module) { + var Utils = _p.r(12); + var createClass = _p.r(11).createClass; + var Shape = _p.r(60); + var svg = _p.r(67); + var g = _p.r(34); + var slice = Array.prototype.slice, flatten = Utils.flatten; + var PathDrawer = createClass("PathDrawer", { + constructor: function(path) { + this.segment = []; + this.path = path; + this.__clear = false; + }, + getPath: function() { + return this.path; + }, + redraw: function() { + this._transation = this._transation || []; + return this.clear(); + }, + done: function() { + var transation = this._transation; + this._transation = null; + this.push(transation); + return this; + }, + clear: function() { + if (this._transation) { + this._transation = []; + } else { + this.path.setPathData("M 0 0"); + } + this._clear = true; + return this; + }, + push: function() { + var segment = slice.call(arguments); + var originData; + if (this._transation) { + this._transation.push(segment); + return this; + } + if (this._clear) { + originData = ""; + this._clear = false; + } else { + originData = this.path.getPathData(); + } + originData = originData || ""; + this.path.setPathData(originData + g.pathToString(segment)); + return this; + }, + moveTo: function(x, y) { + return this.push("M", slice.call(arguments)); + }, + moveBy: function(dx, dy) { + return this.push("m", slice.call(arguments)); + }, + lineTo: function(x, y) { + return this.push("L", slice.call(arguments)); + }, + lineBy: function(dx, dy) { + return this.push("l", slice.call(arguments)); + }, + arcTo: function(rx, ry, xr, laf, sf, x, y) { + return this.push("A", slice.call(arguments)); + }, + arcBy: function(rx, ry, xr, laf, sf, dx, dy) { + return this.push("a", arguments); + }, + carcTo: function(r, laf, sf, x, y) { + return this.push("A", [ r, r, 0 ].concat(slice.call(arguments, 1))); + }, + carcBy: function(r, laf, sf, dx, dy) { + return this.push("a", [ r, r, 0 ].concat(slice.call(arguments, 1))); + }, + bezierTo: function(x1, y1, x2, y2, x, y) { + return this.push("C", slice.call(arguments)); + }, + bezierBy: function(dx1, dy1, dx2, dy2, dx, dy) { + return this.push("c", slice.call(arguments)); + }, + close: function() { + return this.push("z"); + } + }); + return createClass("Path", { + base: Shape, + constructor: function(data) { + this.callBase("path"); + if (data) { + this.setPathData(data); + } + this.node.setAttribute("fill", svg.defaults.fill); + this.node.setAttribute("stroke", svg.defaults.stroke); + }, + setPathData: function(data) { + data = data || "M0,0"; + this.pathdata = g.pathToString(data); + this.node.setAttribute("d", this.pathdata); + this.trigger("shapeupdate", { + type: "pathdata" + }); + return this; + }, + getPathData: function() { + return this.pathdata || ""; + }, + getDrawer: function() { + return new PathDrawer(this); + }, + isClosed: function() { + var data = this.getPathData(); + return !!~data.indexOf("z") || !!~data.indexOf("Z"); + } + }); + } +}; + +//src/graphic/pattern.js +_p[47] = { + value: function(require, exports, module) { + var Resource = _p.r(58); + var ShapeContainer = _p.r(61); + var svg = _p.r(67); + return _p.r(11).createClass("PatternBrush", { + base: Resource, + mixins: [ ShapeContainer ], + constructor: function(paper) { + this.callBase("pattern", paper); + this.node.setAttribute("patternUnits", "userSpaceOnUse"); + }, + setX: function(x) { + this.x = x; + this.node.setAttribute("x", x); + return this; + }, + setY: function(y) { + this.y = y; + this.node.setAttribute("y", y); + return this; + }, + setWidth: function(width) { + this.width = width; + this.node.setAttribute("width", width); + return this; + }, + setHeight: function(height) { + this.height = height; + this.node.setAttribute("height", height); + return this; + }, + getWidth: function() { + return this.width; + }, + getHeight: function() { + return this.height; + } + }); + } +}; + +//src/graphic/pen.js +_p[48] = { + value: function(require, exports, module) { + var Color = _p.r(28); + return _p.r(11).createClass("Pen", { + constructor: function(brush, width) { + this.brush = brush; + this.width = width || 1; + this.linecap = null; + this.linejoin = null; + this.dashArray = null; + this.opacity = 1; + }, + getBrush: function() { + return this.brush; + }, + setBrush: function(brush) { + this.brush = brush; + return this; + }, + setColor: function(color) { + return this.setBrush(color); + }, + getColor: function() { + return this.brush instanceof Color ? this.brush : null; + }, + getWidth: function() { + return this.width; + }, + setWidth: function(width) { + this.width = width; + return this; + }, + getOpacity: function() { + return this.opacity; + }, + setOpacity: function(opacity) { + this.opacity = opacity; + }, + getLineCap: function() { + return this.linecap; + }, + setLineCap: function(linecap) { + this.linecap = linecap; + return this; + }, + getLineJoin: function() { + return this.linejoin; + }, + setLineJoin: function(linejoin) { + this.linejoin = linejoin; + return this; + }, + getDashArray: function() { + return this.dashArray; + }, + setDashArray: function(dashArray) { + this.dashArray = dashArray; + return this; + }, + stroke: function(shape) { + var node = shape.node; + node.setAttribute("stroke", this.brush.toString()); + node.setAttribute("stroke-width", this.getWidth()); + if (this.getOpacity() < 1) { + node.setAttribute("stroke-opacity", this.getOpacity()); + } + if (this.getLineCap()) { + node.setAttribute("stroke-linecap", this.getLineCap()); + } + if (this.getLineJoin()) { + node.setAttribute("stroke-linejoin", this.getLineJoin()); + } + if (this.getDashArray()) { + node.setAttribute("stroke-dasharray", this.getDashArray()); + } + } + }); + } +}; + +//src/graphic/pie.js +_p[49] = { + value: function(require, exports, module) { + return _p.r(11).createClass({ + base: _p.r(68), + constructor: function(radius, angle, angleOffset) { + this.callBase([ 0, radius ], angle, angleOffset); + }, + getRadius: function() { + return this.getSectionArray()[1]; + }, + setRadius: function(radius) { + this.setSectionArray([ 0, radius ]); + } + }); + } +}; + +//src/graphic/point.js +/* + * 点对象抽象 + */ +_p[50] = { + value: function(require, exports, module) { + /** + * @class kity.Point + * @description 表示一个点 + */ + var Point = _p.r(11).createClass("Point", { + /** + * @constructor + * @for kity.Point + * @description 指定默认的 x 和 y 创建一个点 + * + * @param {Number} x 点的 x 坐标 + * @param {Number} y 点的 y 坐标 + */ + constructor: function(x, y) { + /** + * @property + * @for kity.Point + * @description 表示点的 x 坐标 + * @type {Number} + */ + this.x = x || 0; + /** + * @property + * @for kity.Point + * @description 表示点的 y 坐标 + * @type {Number} + */ + this.y = y || 0; + }, + offset: function(dx, dy) { + if (arguments.length == 1) { + dy = dx.y; + dx = dx.x; + } + return new Point(this.x + dx, this.y + dy); + }, + valueOf: function() { + return [ this.x, this.y ]; + }, + toString: function() { + return this.valueOf().join(" "); + }, + spof: function() { + return new Point((this.x | 0) + .5, (this.y | 0) + .5); + }, + round: function() { + return new Point(this.x | 0, this.y | 0); + }, + isOrigin: function() { + return this.x === 0 && this.y === 0; + } + }); + /** + * @static + * @method fromPolar() + * @for kity.Point + * @grammar kity.Point.fromPolar(radius, angle, unit) => kity.Point + * @param {Number} radius 极坐标中的半径 + * @param {Number} angle 极坐标中的角度 + * @param {String} unit 角度使用的单位,默认为 'deg' (角度),可以取值为 'rad',表示传入的是弧度值 + */ + Point.fromPolar = function(radius, angle, unit) { + if (unit != "rad") { + // deg to rad + angle = angle / 180 * Math.PI; + } + return new Point(radius * Math.cos(angle), radius * Math.sin(angle)); + }; + Point.parse = function(unknown) { + if (!unknown) return new Point(); + if (unknown instanceof Point) { + return unknown; + } + if (typeof unknown == "string") { + return Point.parse(unknown.split(/\s*[\s,]\s*/)); + } + if ("0" in unknown && "1" in unknown) { + return new Point(unknown[0], unknown[1]); + } + }; + return Point; + } +}; + +//src/graphic/pointcontainer.js +/** + * 点集合容器 + */ +_p[51] = { + value: function(require, exports, module) { + return _p.r(11).createClass("PointContainer", { + base: _p.r(29), + constructor: function() { + this.callBase(); + }, + addPoint: function(point, pos) { + return this.addItem.apply(this, arguments); + }, + prependPoint: function() { + return this.prependItem.apply(this, arguments); + }, + appendPoint: function() { + return this.appendItem.apply(this, arguments); + }, + removePoint: function(pos) { + return this.removeItem.apply(this, arguments); + }, + addPoints: function() { + return this.addItems.apply(this, arguments); + }, + setPoints: function() { + return this.setItems.apply(this, arguments); + }, + getPoint: function() { + return this.getItem.apply(this, arguments); + }, + getPoints: function() { + return this.getItems.apply(this, arguments); + }, + getFirstPoint: function() { + return this.getFirstItem.apply(this, arguments); + }, + getLastPoint: function() { + return this.getLastItem.apply(this, arguments); + } + }); + } +}; + +//src/graphic/poly.js +/* + * 通过点来决定图形的公共父类 + */ +_p[52] = { + value: function(require, exports, module) { + var Utils = _p.r(12); + return _p.r(11).createClass("Poly", { + base: _p.r(46), + mixins: [ _p.r(51) ], + constructor: function(points, closeable) { + this.callBase(); + //是否可闭合 + this.closeable = !!closeable; + this.setPoints(points || []); + this.changeable = true; + this.update(); + }, + //当点集合发生变化时采取的动作 + onContainerChanged: function() { + if (this.changeable) { + this.update(); + } + }, + update: function() { + var drawer = this.getDrawer(), points = this.getPoints(); + drawer.clear(); + if (!points.length) { + return this; + } + drawer.moveTo(points[0]); + for (var i = 1, point, len = points.length; i < len; i++) { + point = points[i]; + drawer.lineTo(point); + } + if (this.closeable && points.length > 2) { + drawer.close(); + } + return this; + } + }); + } +}; + +//src/graphic/polygon.js +_p[53] = { + value: function(require, exports, module) { + return _p.r(11).createClass("Polygon", { + base: _p.r(52), + constructor: function(points) { + this.callBase(points, true); + } + }); + } +}; + +//src/graphic/polyline.js +_p[54] = { + value: function(require, exports, module) { + return _p.r(11).createClass("Polyline", { + base: _p.r(52), + constructor: function(points) { + this.callBase(points); + } + }); + } +}; + +//src/graphic/radialgradient.js +_p[55] = { + value: function(require, exports, module) { + var Gradient = _p.r(35); + return _p.r(11).createClass("RadialGradientBrush", { + base: Gradient, + constructor: function(paper) { + this.callBase("radialGradient", paper); + this.setCenter(.5, .5); + this.setFocal(.5, .5); + this.setRadius(.5); + }, + setCenter: function(cx, cy) { + this.node.setAttribute("cx", cx); + this.node.setAttribute("cy", cy); + return this; + }, + getCenter: function() { + return { + x: +this.node.getAttribute("cx"), + y: +this.node.getAttribute("cy") + }; + }, + setFocal: function(fx, fy) { + this.node.setAttribute("fx", fx); + this.node.setAttribute("fy", fy); + return this; + }, + getFocal: function() { + return { + x: +this.node.getAttribute("fx"), + y: +this.node.getAttribute("fy") + }; + }, + setRadius: function(r) { + this.node.setAttribute("r", r); + return this; + }, + getRadius: function() { + return +this.node.getAttribute("r"); + } + }); + } +}; + +//src/graphic/rect.js +_p[56] = { + value: function(require, exports, module) { + var RectUtils = {}, Utils = _p.r(12), Point = _p.r(50), Box = _p.r(25); + Utils.extend(RectUtils, { + //根据传递进来的width、height和radius属性, + //获取最适合的radius值 + formatRadius: function(width, height, radius) { + var minValue = Math.floor(Math.min(width / 2, height / 2)); + return Math.min(minValue, radius); + } + }); + /** + * @class kity.Rect + * @description 表示一个矩形 + * @base kity.Path + */ + var Rect = _p.r(11).createClass("Rect", { + base: _p.r(46), + /** + * @constructor + * @for kity.Rect + * @grammar new kity.Rect(width, height, x, y, radius) + * @param {Number} width 矩形的初始化宽度 + * @param {Number} height 矩形的初始化高度 + * @param {Number} x 矩形的初始化 x 坐标 + * @param {Number} y 矩形的初始化 y 坐标 + * @param {Number} radius 矩形的初始化圆角大小 + */ + constructor: function(width, height, x, y, radius) { + this.callBase(); + this.x = x || 0; + this.y = y || 0; + this.width = width || 0; + this.height = height || 0; + this.radius = RectUtils.formatRadius(this.width, this.height, radius || 0); + this.update(); + }, + update: function() { + var x = this.x, y = this.y, w = this.width, h = this.height, r = this.radius; + var drawer = this.getDrawer().redraw(); + if (!r) { + // 直角 + drawer.push("M", x, y); + drawer.push("h", w); + drawer.push("v", h); + drawer.push("h", -w); + drawer.push("z"); + } else { + //圆角 + w -= 2 * r; + h -= 2 * r; + drawer.push("M", x + r, y); + drawer.push("h", w); + drawer.push("a", r, r, 0, 0, 1, r, r); + drawer.push("v", h); + drawer.push("a", r, r, 0, 0, 1, -r, r); + drawer.push("h", -w); + drawer.push("a", r, r, 0, 0, 1, -r, -r); + drawer.push("v", -h); + drawer.push("a", r, r, 0, 0, 1, r, -r); + drawer.push("z"); + } + drawer.done(); + return this; + }, + /** + * @method setWidth + * @for kity.Rect + * @grammar setWidth(width) => kity.Rect + * @description 设置矩形的宽度,设置后返回矩形实例本身 + * @param {Number} width 宽度值 + * + * @example + * ```js + * rect.setWidth(300); + * ``` + */ + setWidth: function(width) { + this.width = width; + return this.update(); + }, + /** + * @method setHeight + * @for kity.Rect + * @grammar setHeight(height) => kity.Rect + * @description 设置矩形的高度,设置后返回矩形实例本身 + * @param {Number} height 高度值 + * + * @example + * ```js + * rect.setHeight(200); + * ``` + */ + setHeight: function(height) { + this.height = height; + return this.update(); + }, + /** + * @method setSize + * @for kity.Rect + * @grammar setSize(width, height) => kity.Rect + * @description 设置矩形的尺寸,设置后返回矩形本身 + * @param {Number} width 矩形的宽度值 + * @param {Number} height 矩形的高度值 + * + * @example + * ```js + * rect.setSize(300, 200); + * ``` + */ + setSize: function(width, height) { + this.width = width; + this.height = height; + return this.update(); + }, + /** + * @method setBox + * @for kity.Rect + * @grammar setBox(box) => kity.Rect + * @description 使用一个 kity 的盒子数据, + * @param {kity.Box} box 盒子数据 + */ + setBox: function(box) { + this.x = box.x; + this.y = box.y; + this.width = box.width; + this.height = box.height; + return this.update(); + }, + getBox: function() { + return new Box(this.x, this.y, this.width, this.height); + }, + getRadius: function() { + return this.radius; + }, + setRadius: function(radius) { + this.radius = RectUtils.formatRadius(this.width, this.height, radius || 0); + return this.update(); + }, + getPosition: function() { + return new Point(this.x, this.y); + }, + setPosition: function(x, y) { + if (arguments.length == 1) { + var p = Point.parse(arguments[0]); + y = p.y; + x = p.x; + } + this.x = x; + this.y = y; + return this.update(); + }, + getWidth: function() { + return this.width; + }, + getHeight: function() { + return this.height; + }, + getPositionX: function() { + return this.x; + }, + getPositionY: function() { + return this.y; + }, + setPositionX: function(x) { + this.x = x; + return this.update(); + }, + setPositionY: function(y) { + this.y = y; + return this.update(); + } + }); + return Rect; + } +}; + +//src/graphic/regularpolygon.js +_p[57] = { + value: function(require, exports, module) { + var Point = _p.r(50); + return _p.r(11).createClass("RegularPolygon", { + base: _p.r(46), + constructor: function(side, radius, x, y) { + this.callBase(); + this.radius = radius || 0; + this.side = Math.max(side || 3, 3); + if (arguments.length > 2) { + if (arguments.length == 3) { + y = x.y; + x = x.x; + } + } + this.center = new Point(x, y); + this.draw(); + }, + getSide: function() { + return this.side; + }, + setSide: function(side) { + this.side = side; + return this.draw(); + }, + getRadius: function() { + return this.radius; + }, + setRadius: function(radius) { + this.radius = radius; + return this.draw(); + }, + draw: function() { + var radius = this.radius, side = this.side, step = Math.PI * 2 / side, drawer = this.getDrawer(), i; + drawer.clear(); + drawer.moveTo(Point.fromPolar(radius, Math.PI / 2, "rad").offset(this.center)); + for (i = 0; i <= side; i++) { + drawer.lineTo(Point.fromPolar(radius, step * i + Math.PI / 2, "rad").offset(this.center)); + } + drawer.close(); + return this; + } + }); + } +}; + +//src/graphic/resource.js +/** + * @fileOverview + * + * 资源节点基类 + * + * @author: techird + * @copyright: Baidu FEX, 2014 + */ +_p[58] = { + value: function(require, exports, module) { + var svg = _p.r(67); + return _p.r(11).createClass("Resource", { + constructor: function(nodeType, paper) { + this.callBase(); + this.node = svg.createNode(nodeType); + if (paper) { + paper.addResource(this); + } + }, + toString: function() { + return "url(#" + this.node.id + ")"; + } + }); + } +}; + +//src/graphic/ring.js +_p[59] = { + value: function(require, exports, module) { + return _p.r(11).createClass({ + base: _p.r(68), + constructor: function(innerRadius, outerRadius) { + this.callBase([ innerRadius, outerRadius ], 360, 0); + }, + getInnerRadius: function() { + return this.getSectionArray()[0]; + }, + getOuterRadius: function() { + return this.getSectionArray()[1]; + }, + setInnerRadius: function(value) { + this.setSectionArray([ value, this.getOuterRadius() ]); + }, + setOuterRadius: function(value) { + this.setSectionArray([ this.getInnerRadius(), value ]); + } + }); + } +}; + +//src/graphic/shape.js +_p[60] = { + value: function(require, exports, module) { + var svg = _p.r(67); + var utils = _p.r(12); + var EventHandler = _p.r(33); + var Styled = _p.r(66); + var Data = _p.r(31); + var Matrix = _p.r(43); + var Pen = _p.r(48); + var slice = Array.prototype.slice; + var Box = _p.r(25); + var Shape = _p.r(11).createClass("Shape", { + mixins: [ EventHandler, Styled, Data ], + constructor: function Shape(tagName) { + this.node = svg.createNode(tagName); + this.node.shape = this; + this.transform = { + translate: null, + rotate: null, + scale: null, + matrix: null + }; + this.callMixin(); + }, + getId: function() { + return this.node.id; + }, + setId: function(id) { + this.node.id = id; + return this; + }, + getNode: function() { + return this.node; + }, + getBoundaryBox: function() { + var box; + try { + box = this.node.getBBox(); + } catch (e) { + box = { + x: this.node.clientLeft, + y: this.node.clientTop, + width: this.node.clientWidth, + height: this.node.clientHeight + }; + } + return new Box(box); + }, + getRenderBox: function(refer) { + var box = this.getBoundaryBox(); + var matrix = this.getTransform(refer); + return matrix.transformBox(box); + }, + getWidth: function() { + return this.getRenderBox().width; + }, + getHeight: function() { + return this.getRenderBox().height; + }, + getSize: function() { + var box = this.getRenderBox(); + delete box.x; + delete box.y; + return box; + }, + setOpacity: function(value) { + this.node.setAttribute("opacity", value); + return this; + }, + getOpacity: function() { + var opacity = this.node.getAttribute("opacity"); + return opacity ? +opacity : 1; + }, + setVisible: function(value) { + if (value) { + this.node.removeAttribute("display"); + } else { + this.node.setAttribute("display", "none"); + } + return this; + }, + getVisible: function() { + this.node.getAttribute("display"); + }, + hasAncestor: function(node) { + var parent = this.container; + while (parent) { + if (parent === node) { + return true; + } + parent = parent.container; + } + return false; + }, + getTransform: function(refer) { + return Matrix.getCTM(this, refer); + }, + clearTransform: function() { + this.node.removeAttribute("transform"); + this.transform = { + translate: null, + rotate: null, + scale: null, + matrix: null + }; + this.trigger("shapeupdate", { + type: "transform" + }); + return this; + }, + _applyTransform: function() { + var t = this.transform, result = []; + if (t.translate) { + result.push([ "translate(", t.translate, ")" ]); + } + if (t.rotate) { + result.push([ "rotate(", t.rotate, ")" ]); + } + if (t.scale) { + result.push([ "scale(", t.scale, ")" ]); + } + if (t.matrix) { + result.push([ "matrix(", t.matrix, ")" ]); + } + this.node.setAttribute("transform", utils.flatten(result).join(" ")); + return this; + }, + setMatrix: function(m) { + this.transform.matrix = m; + return this._applyTransform(); + }, + setTranslate: function(t) { + this.transform.translate = t !== null && slice.call(arguments) || null; + return this._applyTransform(); + }, + setRotate: function(r) { + this.transform.rotate = r !== null && slice.call(arguments) || null; + return this._applyTransform(); + }, + setScale: function(s) { + this.transform.scale = s !== null && slice.call(arguments) || null; + return this._applyTransform(); + }, + translate: function(dx, dy) { + var m = this.transform.matrix || new Matrix(); + if (dy === undefined) { + dy = 0; + } + this.transform.matrix = m.translate(dx, dy); + return this._applyTransform(); + }, + rotate: function(deg) { + var m = this.transform.matrix || new Matrix(); + this.transform.matrix = m.rotate(deg); + return this._applyTransform(); + }, + scale: function(sx, sy) { + var m = this.transform.matrix || new Matrix(); + if (sy === undefined) { + sy = sx; + } + this.transform.matrix = m.scale(sx, sy); + return this._applyTransform(); + }, + skew: function(sx, sy) { + var m = this.transform.matrix || new Matrix(); + if (sy === undefined) { + sy = sx; + } + this.transform.matrix = m.skew(sx, sy); + return this._applyTransform(); + }, + stroke: function(pen, width) { + if (pen && pen.stroke) { + pen.stroke(this); + } else if (pen) { + // 字符串或重写了 toString 的对象 + this.node.setAttribute("stroke", pen.toString()); + if (width) { + this.node.setAttribute("stroke-width", width); + } + } else if (pen === null) { + this.node.removeAttribute("stroe"); + } + return this; + }, + fill: function(brush) { + // 字符串或重写了 toString 的对象 + if (brush) { + this.node.setAttribute("fill", brush.toString()); + } + if (brush === null) { + this.node.removeAttribute("fill"); + } + return this; + }, + setAttr: function(a, v) { + var me = this; + if (utils.isObject(a)) { + utils.each(a, function(val, key) { + me.setAttr(key, val); + }); + } + if (v === undefined || v === null || v === "") { + this.node.removeAttribute(a); + } else { + this.node.setAttribute(a, v); + } + return this; + }, + getAttr: function(a) { + return this.node.getAttribute(a); + } + }); + return Shape; + } +}; + +//src/graphic/shapecontainer.js +_p[61] = { + value: function(require, exports, module) { + var Container = _p.r(29); + var utils = _p.r(12); + var ShapeContainer = _p.r(11).createClass("ShapeContainer", { + base: Container, + isShapeContainer: true, + /* private */ + handleAdd: function(shape, index) { + var parent = this.getShapeNode(); + parent.insertBefore(shape.node, parent.childNodes[index] || null); + shape.trigger("add", { + container: this + }); + if (shape.notifyTreeModification) { + shape.notifyTreeModification("treeadd", this); + } + }, + /* private */ + handleRemove: function(shape, index) { + var parent = this.getShapeNode(); + parent.removeChild(shape.node); + shape.trigger("remove", { + container: this + }); + if (shape.notifyTreeModification) { + shape.notifyTreeModification("treeremove", this); + } + }, + /* private */ + notifyTreeModification: function(type, container) { + this.eachItem(function(index, shape) { + if (shape.notifyTreeModification) { + shape.notifyTreeModification(type, container); + } + shape.trigger(type, { + container: container + }); + }); + }, + /* public */ + getShape: function(index) { + return this.getItem(index); + }, + /* public */ + addShape: function(shape, index) { + return this.addItem(shape, index); + }, + put: function(shape) { + this.addShape(shape); + return shape; + }, + appendShape: function(shape) { + return this.addShape(shape); + }, + prependShape: function(shape) { + return this.addShape(shape, 0); + }, + replaceShape: function(replacer, origin) { + var index = this.indexOf(origin); + if (index === -1) { + return; + } + this.removeShape(index); + this.addShape(replacer, index); + return this; + }, + addShapeBefore: function(shape, refer) { + var index = this.indexOf(refer); + return this.addShape(shape, index); + }, + addShapeAfter: function(shape, refer) { + var index = this.indexOf(refer); + return this.addShape(shape, index === -1 ? undefined : index + 1); + }, + /* public */ + addShapes: function(shapes) { + return this.addItems(shapes); + }, + /* public */ + removeShape: function(index) { + return this.removeItem(index); + }, + getShapes: function() { + return this.getItems(); + }, + getShapesByType: function(name) { + var shapes = []; + function getShapes(shape) { + if (name.toLowerCase() == shape.getType().toLowerCase()) { + shapes.push(shape); + } + if (shape.isShapeContainer) { + utils.each(shape.getShapes(), function(n) { + getShapes(n); + }); + } + } + getShapes(this); + return shapes; + }, + /* public */ + getShapeById: function(id) { + return this.getShapeNode().getElementById(id).shape; + }, + arrangeShape: function(shape, index) { + return this.removeShape(shape).addShape(shape, index); + }, + /* protected */ + getShapeNode: function() { + return this.shapeNode || this.node; + } + }); + var Shape = _p.r(60); + _p.r(11).extendClass(Shape, { + bringTo: function(index) { + this.container.arrangeShape(this, index); + return this; + }, + bringFront: function() { + return this.bringTo(this.container.indexOf(this) + 1); + }, + bringBack: function() { + return this.bringTo(this.container.indexOf(this) - 1); + }, + bringTop: function() { + this.container.removeShape(this).addShape(this); + return this; + }, + bringRear: function() { + return this.bringTo(0); + }, + bringRefer: function(referShape, offset) { + if (referShape.container) { + if (this.remove) { + this.remove(); + } + referShape.container.addShape(this, referShape.container.indexOf(referShape) + (offset || 0)); + } + return this; + }, + bringAbove: function(referShape) { + return this.bringRefer(referShape); + }, + bringBelow: function(referShape) { + return this.bringRefer(referShape, 1); + }, + replaceBy: function(newShape) { + if (this.container) { + newShape.bringAbove(this); + this.remove(); + } + return this; + } + }); + return ShapeContainer; + } +}; + +//src/graphic/shapeevent.js +/* + * 图形事件包装类 + * */ +_p[62] = { + value: function(require, exprots, module) { + var Matrix = _p.r(43), Utils = _p.r(12), Point = _p.r(50); + return _p.r(11).createClass("ShapeEvent", { + constructor: function(event) { + var target = null; + // dom 事件封装对象 + if (!Utils.isObject(event.target)) { + this.type = event.type; + target = event.target; + // use标签有特殊属性, 需要区别对待 + if (target.correspondingUseElement) { + target = target.correspondingUseElement; + } + this.originEvent = event; + this.targetShape = target.shape || target.paper || event.currentTarget && (event.currentTarget.shape || event.currentTarget.paper); + if (event._kityParam) { + Utils.extend(this, event._kityParam); + } + } else { + Utils.extend(this, event); + } + }, + preventDefault: function() { + var evt = this.originEvent; + if (!evt) { + return true; + } + if (evt.preventDefault) { + evt.preventDefault(); + return evt.cancelable; + } else { + evt.returnValue = false; + return true; + } + }, + //当前鼠标事件在用户坐标系中点击的点的坐标位置 + getPosition: function(refer, touchIndex) { + if (!this.originEvent) { + return null; + } + var eventClient = this.originEvent.touches ? this.originEvent.touches[touchIndex || 0] : this.originEvent; + var target = this.targetShape; + var targetNode = target.shapeNode || target.node; + var pScreen = new Point(eventClient && eventClient.clientX || 0, eventClient && eventClient.clientY || 0); + var pTarget = Matrix.transformPoint(pScreen, targetNode.getScreenCTM().inverse()); + var pRefer = Matrix.getCTM(target, refer || "view").transformPoint(pTarget); + return pRefer; + }, + stopPropagation: function() { + var evt = this.originEvent; + if (!evt) { + return true; + } + if (evt.stopPropagation) { + evt.stopPropagation(); + } else { + evt.cancelBubble = false; + } + } + }); + } +}; + +//src/graphic/shapepoint.js +/* + * 图形上的点抽象 + */ +_p[63] = { + value: function(require, exports, module) { + return _p.r(11).createClass("ShapePoint", { + base: _p.r(50), + constructor: function(px, py) { + this.callBase(px, py); + }, + setX: function(x) { + return this.setPoint(x, this.y); + }, + setY: function(y) { + return this.setPoint(this.x, y); + }, + setPoint: function(x, y) { + this.x = x; + this.y = y; + this.update(); + return this; + }, + getPoint: function() { + return this; + }, + update: function() { + if (this.container && this.container.update) { + this.container.update(); + } + return this; + } + }); + } +}; + +//src/graphic/standardcolor.js +/** + * 标准颜色映射 + */ +_p[64] = { + value: { + COLOR_STANDARD: { + aliceblue: "#f0f8ff", + antiquewhite: "#faebd7", + aqua: "#00ffff", + aquamarine: "#7fffd4", + azure: "#f0ffff", + beige: "#f5f5dc", + bisque: "#ffe4c4", + black: "#000000", + blanchedalmond: "#ffebcd", + blue: "#0000ff", + blueviolet: "#8a2be2", + brown: "#a52a2a", + burlywood: "#deb887", + cadetblue: "#5f9ea0", + chartreuse: "#7fff00", + chocolate: "#d2691e", + coral: "#ff7f50", + cornflowerblue: "#6495ed", + cornsilk: "#fff8dc", + crimson: "#dc143c", + cyan: "#00ffff", + darkblue: "#00008b", + darkcyan: "#008b8b", + darkgoldenrod: "#b8860b", + darkgray: "#a9a9a9", + darkgreen: "#006400", + darkgrey: "#a9a9a9", + darkkhaki: "#bdb76b", + darkmagenta: "#8b008b", + darkolivegreen: "#556b2f", + darkorange: "#ff8c00", + darkorchid: "#9932cc", + darkred: "#8b0000", + darksalmon: "#e9967a", + darkseagreen: "#8fbc8f", + darkslateblue: "#483d8b", + darkslategray: "#2f4f4f", + darkslategrey: "#2f4f4f", + darkturquoise: "#00ced1", + darkviolet: "#9400d3", + deeppink: "#ff1493", + deepskyblue: "#00bfff", + dimgray: "#696969", + dimgrey: "#696969", + dodgerblue: "#1e90ff", + firebrick: "#b22222", + floralwhite: "#fffaf0", + forestgreen: "#228b22", + fuchsia: "#ff00ff", + gainsboro: "#dcdcdc", + ghostwhite: "#f8f8ff", + gold: "#ffd700", + goldenrod: "#daa520", + gray: "#808080", + green: "#008000", + greenyellow: "#adff2f", + grey: "#808080", + honeydew: "#f0fff0", + hotpink: "#ff69b4", + indianred: "#cd5c5c", + indigo: "#4b0082", + ivory: "#fffff0", + khaki: "#f0e68c", + lavender: "#e6e6fa", + lavenderblush: "#fff0f5", + lawngreen: "#7cfc00", + lemonchiffon: "#fffacd", + lightblue: "#add8e6", + lightcoral: "#f08080", + lightcyan: "#e0ffff", + lightgoldenrodyellow: "#fafad2", + lightgray: "#d3d3d3", + lightgreen: "#90ee90", + lightgrey: "#d3d3d3", + lightpink: "#ffb6c1", + lightsalmon: "#ffa07a", + lightseagreen: "#20b2aa", + lightskyblue: "#87cefa", + lightslategray: "#778899", + lightslategrey: "#778899", + lightsteelblue: "#b0c4de", + lightyellow: "#ffffe0", + lime: "#00ff00", + limegreen: "#32cd32", + linen: "#faf0e6", + magenta: "#ff00ff", + maroon: "#800000", + mediumaquamarine: "#66cdaa", + mediumblue: "#0000cd", + mediumorchid: "#ba55d3", + mediumpurple: "#9370db", + mediumseagreen: "#3cb371", + mediumslateblue: "#7b68ee", + mediumspringgreen: "#00fa9a", + mediumturquoise: "#48d1cc", + mediumvioletred: "#c71585", + midnightblue: "#191970", + mintcream: "#f5fffa", + mistyrose: "#ffe4e1", + moccasin: "#ffe4b5", + navajowhite: "#ffdead", + navy: "#000080", + oldlace: "#fdf5e6", + olive: "#808000", + olivedrab: "#6b8e23", + orange: "#ffa500", + orangered: "#ff4500", + orchid: "#da70d6", + palegoldenrod: "#eee8aa", + palegreen: "#98fb98", + paleturquoise: "#afeeee", + palevioletred: "#db7093", + papayawhip: "#ffefd5", + peachpuff: "#ffdab9", + peru: "#cd853f", + pink: "#ffc0cb", + plum: "#dda0dd", + powderblue: "#b0e0e6", + purple: "#800080", + red: "#ff0000", + rosybrown: "#bc8f8f", + royalblue: "#4169e1", + saddlebrown: "#8b4513", + salmon: "#fa8072", + sandybrown: "#f4a460", + seagreen: "#2e8b57", + seashell: "#fff5ee", + sienna: "#a0522d", + silver: "#c0c0c0", + skyblue: "#87ceeb", + slateblue: "#6a5acd", + slategray: "#708090", + slategrey: "#708090", + snow: "#fffafa", + springgreen: "#00ff7f", + steelblue: "#4682b4", + tan: "#d2b48c", + teal: "#008080", + thistle: "#d8bfd8", + tomato: "#ff6347", + turquoise: "#40e0d0", + violet: "#ee82ee", + wheat: "#f5deb3", + white: "#ffffff", + whitesmoke: "#f5f5f5", + yellow: "#ffff00" + }, + //标准扩展 + EXTEND_STANDARD: {} + } +}; + +//src/graphic/star.js +_p[65] = { + value: function(require, exports, module) { + /** + * @see http://www.jdawiseman.com/papers/easymath/surds_star_inner_radius.html + */ + var defaultRatioForStar = { + "3": .2, + // yy + "5": .38196601125, + "6": .57735026919, + "8": .541196100146, + "10": .726542528005, + "12": .707106781187 + }; + var Point = _p.r(50); + return _p.r(11).createClass("Star", { + base: _p.r(46), + constructor: function(vertex, radius, shrink, offset, angleOffset) { + this.callBase(); + this.vertex = vertex || 3; + this.radius = radius || 0; + this.shrink = shrink; + this.offset = offset || new Point(0, 0); + this.angleOffset = angleOffset || 0; + this.draw(); + }, + getVertex: function() { + return this.vertex; + }, + setVertex: function(value) { + this.vertex = value; + return this.draw(); + }, + getRadius: function() { + return this.radius; + }, + setRadius: function(value) { + this.radius = value; + return this.draw(); + }, + getShrink: function() { + return this.shrink; + }, + setShrink: function(value) { + this.shrink = value; + return this.draw(); + }, + getOffset: function() { + return this.offset; + }, + setOffset: function(value) { + this.offset = value; + return this.draw(); + }, + getAngleOffset: function() { + return this.angleOffset; + }, + setAngleOffset: function(value) { + this.angleOffset = value; + return this.draw(); + }, + draw: function() { + var innerRadius = this.radius, outerRadius = this.radius * (this.shrink || defaultRatioForStar[this.vertex] || .5), vertex = this.vertex, offset = this.offset, angleStart = 90, angleStep = 180 / vertex, angleOffset = this.angleOffset, drawer = this.getDrawer(), i, angle; + drawer.clear(); + drawer.moveTo(Point.fromPolar(outerRadius, angleStart)); + for (i = 1; i <= vertex * 2; i++) { + angle = angleStart + angleStep * i; + // 绘制内点 + if (i % 2) { + drawer.lineTo(Point.fromPolar(innerRadius, angle + angleOffset).offset(offset)); + } else { + drawer.lineTo(Point.fromPolar(outerRadius, angle)); + } + } + drawer.close(); + } + }); + } +}; + +//src/graphic/styled.js +_p[66] = { + value: function(require, exports, module) { + // polyfill for ie + var ClassList = _p.r(11).createClass("ClassList", { + constructor: function(node) { + this._node = node; + this._list = node.className.toString().split(" "); + }, + _update: function() { + this._node.className = this._list.join(" "); + }, + add: function(name) { + this._list.push(name); + this._update(); + }, + remove: function(name) { + var index = this._list.indexOf(name); + if (~index) { + this._list.splice(index, 1); + } + this._update(); + }, + contains: function(name) { + return !!~this._list.indexOf(name); + } + }); + function getClassList(node) { + if (!node.classList) { + node.classList = new ClassList(node); + } + return node.classList; + } + return _p.r(11).createClass("Styled", { + addClass: function(name) { + getClassList(this.node).add(name); + return this; + }, + removeClass: function(name) { + getClassList(this.node).remove(name); + return this; + }, + hasClass: function(name) { + return getClassList(this.node).contains(name); + }, + setStyle: function(styles) { + if (arguments.length == 2) { + this.node.style[arguments[0]] = arguments[1]; + return this; + } + for (var name in styles) { + if (styles.hasOwnProperty(name)) { + this.node.style[name] = styles[name]; + } + } + return this; + } + }); + } +}; + +//src/graphic/svg.js +_p[67] = { + value: function(require, exports, module) { + var doc = document; + var id = 0; + var svg = { + createNode: function(name) { + var node = doc.createElementNS(svg.ns, name); + node.id = "kity_" + name + "_" + id++; + return node; + }, + defaults: { + stroke: "none", + fill: "none" + }, + xlink: "http://www.w3.org/1999/xlink", + ns: "http://www.w3.org/2000/svg" + }; + return svg; + } +}; + +//src/graphic/sweep.js +_p[68] = { + value: function(require, exports, module) { + var Point = _p.r(50); + return _p.r(11).createClass("Sweep", { + base: _p.r(46), + constructor: function(sectionArray, angle, angleOffset) { + this.callBase(); + this.sectionArray = sectionArray || []; + this.angle = angle || 0; + this.angleOffset = angleOffset || 0; + this.draw(); + }, + getSectionArray: function() { + return this.sectionArray; + }, + setSectionArray: function(value) { + this.sectionArray = value; + return this.draw(); + }, + getAngle: function() { + return this.angle; + }, + setAngle: function(value) { + this.angle = value; + return this.draw(); + }, + getAngleOffset: function() { + return this.angleOffset; + }, + setAngleOffset: function(value) { + this.angleOffset = value; + return this.draw(); + }, + draw: function() { + var sectionArray = this.sectionArray, i; + for (i = 0; i < sectionArray.length; i += 2) { + this.drawSection(sectionArray[i], sectionArray[i + 1]); + } + return this; + }, + drawSection: function(from, to) { + var angleLength = this.angle && (this.angle % 360 ? this.angle % 360 : 360), angleStart = this.angleOffset, angleHalf = angleStart + angleLength / 2, angleEnd = angleStart + angleLength, sweepFlag = angleLength < 0 ? 0 : 1, drawer = this.getDrawer(); + drawer.redraw(); + if (angleLength === 0) { + drawer.done(); + return; + } + drawer.moveTo(Point.fromPolar(from, angleStart)); + drawer.lineTo(Point.fromPolar(to, angleStart)); + if (to) { + drawer.carcTo(to, 0, sweepFlag, Point.fromPolar(to, angleHalf)); + drawer.carcTo(to, 0, sweepFlag, Point.fromPolar(to, angleEnd)); + } + drawer.lineTo(Point.fromPolar(from, angleEnd)); + if (from) { + drawer.carcTo(from, 0, sweepFlag, Point.fromPolar(from, angleHalf)); + drawer.carcTo(from, 0, sweepFlag, Point.fromPolar(from, angleStart)); + } + drawer.close(); + drawer.done(); + } + }); + } +}; + +//src/graphic/text.js +_p[69] = { + value: function(require, exports, module) { + var TextContent = _p.r(70); + var ShapeContainer = _p.r(61); + var svg = _p.r(67); + var utils = _p.r(12); + var offsetHash = {}; + function getTextBoundOffset(text) { + var font = text._cachedFontHash; + if (offsetHash[font]) { + return offsetHash[font]; + } + var textContent = text.getContent(); + text.setContent("百度Fex"); + var bbox = text.getBoundaryBox(), y = text.getY(); + if (!bbox.height) return { + top: 0, + bottom: 0, + middle: 0 + }; + var topOffset = y - bbox.y + +text.node.getAttribute("dy"), bottomOffset = topOffset - bbox.height; + text.setContent(textContent); + return offsetHash[font] = { + top: topOffset, + bottom: bottomOffset, + middle: (topOffset + bottomOffset) / 2 + }; + } + return _p.r(11).createClass("Text", { + base: TextContent, + mixins: [ ShapeContainer ], + constructor: function(content) { + this.callBase("text"); + if (content !== undefined) { + this.setContent(content); + } + this._buildFontHash(); + }, + fixPosition: function() { + if (!this.__fixedPosition) { + this.setVerticalAlign(this.getVerticalAlign()); + } + }, + _buildFontHash: function() { + var style = window.getComputedStyle(this.node); + this._cachedFontHash = [ style.fontFamily, style.fontSize, style.fontStretch, style.fontStyle, style.fontVariant, style.fontWeight ].join("-"); + }, + _fontChanged: function(font) { + var last = this._lastFont; + var current = utils.extend({}, last, font); + if (!last) { + this._lastFont = font; + return true; + } + var changed = last.family != current.family || last.size != current.size || last.style != current.style || last.weight != current.weight; + this._lastFont = current; + return changed; + }, + setX: function(x) { + this.node.setAttribute("x", x); + return this; + }, + setPosition: function(x, y) { + return this.setX(x).setY(y); + }, + setY: function(y) { + this.node.setAttribute("y", y); + return this; + }, + getX: function() { + return +this.node.getAttribute("x") || 0; + }, + getY: function() { + return +this.node.getAttribute("y") || 0; + }, + setFont: function(font) { + this.callBase(font); + if (this._fontChanged(font)) { + this._buildFontHash(); + this.setVerticalAlign(this.getVerticalAlign()); + } + return this; + }, + setTextAnchor: function(anchor) { + this.node.setAttribute("text-anchor", anchor); + return this; + }, + getTextAnchor: function() { + return this.node.getAttribute("text-anchor") || "start"; + }, + // top/bottom/middle/baseline + setVerticalAlign: function(align) { + this.whenPaperReady(function() { + var dy; + switch (align) { + case "top": + dy = getTextBoundOffset(this).top; + break; + + case "bottom": + dy = getTextBoundOffset(this).bottom; + break; + + case "middle": + dy = getTextBoundOffset(this).middle; + break; + + default: + dy = 0; + } + if (dy) this.__fixedPosition = true; + this.node.setAttribute("dy", dy); + }); + this.verticalAlign = align; + return this; + }, + getVerticalAlign: function() { + return this.verticalAlign || "baseline"; + }, + setStartOffset: function(offset) { + // only for text path + if (this.shapeNode != this.node) { + this.shapeNode.setAttribute("startOffset", offset * 100 + "%"); + } + }, + addSpan: function(span) { + this.addShape(span); + return this; + }, + setPath: function(path) { + var textpath = this.shapeNode; + if (this.shapeNode == this.node) { + // 当前还不是 textpath + textpath = this.shapeNode = svg.createNode("textPath"); + while (this.node.firstChild) { + this.shapeNode.appendChild(this.node.firstChild); + } + this.node.appendChild(textpath); + } + textpath.setAttributeNS(svg.xlink, "xlink:href", "#" + path.node.id); + this.setTextAnchor(this.getTextAnchor()); + return this; + } + }); + } +}; + +//src/graphic/textcontent.js +_p[70] = { + value: function(require, exports, module) { + var Shape = _p.r(60); + return _p.r(11).createClass("TextContent", { + base: Shape, + constructor: function(nodeType) { + // call shape constructor + this.callBase(nodeType); + this.shapeNode = this.shapeNode || this.node; + this.shapeNode.setAttribute("text-rendering", "geometricPrecision"); + }, + clearContent: function() { + while (this.shapeNode.firstChild) { + this.shapeNode.removeChild(this.shapeNode.firstChild); + } + return this; + }, + setContent: function(content) { + this.shapeNode.textContent = content; + return this; + }, + getContent: function() { + return this.shapeNode.textContent; + }, + appendContent: function(content) { + this.shapeNode.textContent += content; + return this; + }, + setSize: function(value) { + return this.setFontSize(value); + }, + setFontSize: function(value) { + return this.setFont({ + size: value + }); + }, + setFontFamily: function(value) { + return this.setFont({ + family: value + }); + }, + setFontBold: function(bold) { + return this.setFont({ + weight: bold ? "bold" : "normal" + }); + }, + setFontItalic: function(italic) { + return this.setFont({ + style: italic ? "italic" : "normal" + }); + }, + setFont: function(font) { + var node = this.node; + [ "family", "size", "weight", "style" ].forEach(function(section) { + if (font[section] === null) { + node.removeAttribute("font-" + section); + } else if (font[section]) { + node.setAttribute("font-" + section, font[section]); + } + }); + return this; + }, + getExtentOfChar: function(index) { + return this.node.getExtentOfChar(index); + }, + getRotationOfChar: function(index) { + return this.node.getRotationOfChar(index); + }, + getCharNumAtPosition: function(x, y) { + return this.node.getCharNumAtPosition(this.node.viewportElement.createSVGPoint(x, y)); + } + }); + } +}; + +//src/graphic/textspan.js +_p[71] = { + value: function(require, exports, module) { + var TextContent = _p.r(70); + var Styled = _p.r(66); + return _p.r(11).createClass("TextSpan", { + base: TextContent, + mixins: [ Styled ], + constructor: function(content) { + this.callBase("tspan"); + this.setContent(content); + } + }); + } +}; + +//src/graphic/use.js +/* + * USE 功能 + */ +_p[72] = { + value: function(require, exports, module) { + var Svg = _p.r(67); + var Class = _p.r(11); + var Use = Class.createClass("Use", { + base: _p.r(60), + constructor: function(shape) { + this.callBase("use"); + this.ref(shape); + }, + ref: function(shape) { + if (!shape) { + this.node.removeAttributeNS(Svg.xlink, "xlink:href"); + return this; + } + var shapeId = shape.getId(); + if (shapeId) { + this.node.setAttributeNS(Svg.xlink, "xlink:href", "#" + shapeId); + } + // by techird + // 作为 Use 的图形,如果没有 fill 和 stroke,移除默认的 'none' 值,用于 Use 覆盖 + if (shape.node.getAttribute("fill") === "none") { + shape.node.removeAttribute("fill"); + } + if (shape.node.getAttribute("stroke") === "none") { + shape.node.removeAttribute("stroke"); + } + return this; + } + }); + var Shape = _p.r(60); + Class.extendClass(Shape, { + // fast-use + use: function() { + return new Use(this); + } + }); + return Use; + } +}; + +//src/graphic/vector.js +_p[73] = { + value: function(require, exports, module) { + var Point = _p.r(50); + var Matrix = _p.r(43); + var Vector = _p.r(11).createClass("Vector", { + base: Point, + constructor: function(x, y) { + this.callBase(x, y); + }, + square: function() { + return this.x * this.x + this.y * this.y; + }, + length: function() { + return Math.sqrt(this.square()); + }, + add: function(q) { + return new Vector(this.x + q.x, this.y + q.y); + }, + minus: function(q) { + return new Vector(this.x - q.x, this.y - q.y); + }, + dot: function(q) { + return this.x * q.x + this.y * q.y; + }, + project: function(q) { + return q.multipy(this.dot(q) / q.square()); + }, + normalize: function(length) { + if (length === undefined) { + length = 1; + } + return this.multipy(length / this.length()); + }, + multipy: function(scale) { + return new Vector(this.x * scale, this.y * scale); + }, + rotate: function(angle, unit) { + if (unit == "rad") { + angle = angle / Math.PI * 180; + } + var p = new Matrix().rotate(angle).transformPoint(this); + return new Vector(p.x, p.y); + }, + vertical: function() { + return new Vector(this.y, -this.x); + }, + reverse: function() { + return this.multipy(-1); + }, + getAngle: function() { + var length = this.length(); + if (length === 0) return 0; + var rad = Math.acos(this.x / length); + var sign = this.y > 0 ? 1 : -1; + return sign * 180 * rad / Math.PI; + } + }); + Vector.fromPoints = function(p1, p2) { + return new Vector(p2.x - p1.x, p2.y - p1.y); + }; + Vector.fromPolar = function() { + var p = Point.fromPolar.apply(Point, arguments); + return new Vector(p.x, p.y); + }; + _p.r(11).extendClass(Point, { + asVector: function() { + return new Vector(this.x, this.y); + } + }); + return Vector; + } +}; + +//src/graphic/view.js +_p[74] = { + value: function(require, exports, module) { + var ShapeContainer = _p.r(61); + var ViewBox = _p.r(75); + return _p.r(11).createClass("View", { + mixins: [ ShapeContainer, ViewBox ], + base: _p.r(74), + constructor: function() { + this.callBase("view"); + } + }); + } +}; + +//src/graphic/viewbox.js +_p[75] = { + value: function(require, exports, module) { + return _p.r(11).createClass("ViewBox", { + getViewBox: function() { + var attr = this.node.getAttribute("viewBox"); + if (attr === null) { + // firefox: + // 1. viewBox 没有设置过的时候获得的是 null + // 2. svg 标签没有指定绝对大小的时候 clientWidth 和 clientHeigt 为 0,需要在父容器上查找 + // TODO: 第 2 条取得的不准确(假如有 padding 之类的) + return { + x: 0, + y: 0, + width: this.node.clientWidth || this.node.parentNode.clientWidth, + height: this.node.clientHeight || this.node.parentNode.clientHeight + }; + } else { + attr = attr.split(" "); + return { + x: +attr[0], + y: +attr[1], + width: +attr[2], + height: +attr[3] + }; + } + }, + setViewBox: function(x, y, width, height) { + this.node.setAttribute("viewBox", [ x, y, width, height ].join(" ")); + return this; + } + }); + } +}; + +//src/kity.js +/** + * @fileOverview kity 暴露的方法或对象 + */ +_p[76] = { + value: function(require, exports, module) { + var kity = {}, utils = _p.r(12); + kity.version = "2.0.0"; + utils.extend(kity, { + // core + createClass: _p.r(11).createClass, + extendClass: _p.r(11).extendClass, + Utils: utils, + Browser: _p.r(10), + // shape + Box: _p.r(25), + Bezier: _p.r(23), + BezierPoint: _p.r(24), + Circle: _p.r(26), + Clip: _p.r(27), + Color: _p.r(28), + Container: _p.r(29), + Curve: _p.r(30), + Ellipse: _p.r(32), + Group: _p.r(36), + Gradient: _p.r(35), + HyperLink: _p.r(37), + Image: _p.r(38), + Line: _p.r(39), + LinearGradient: _p.r(40), + Mask: _p.r(42), + Matrix: _p.r(43), + Marker: _p.r(41), + Palette: _p.r(44), + Paper: _p.r(45), + Path: _p.r(46), + Pattern: _p.r(47), + Pen: _p.r(48), + Point: _p.r(50), + PointContainer: _p.r(51), + Polygon: _p.r(53), + Polyline: _p.r(54), + Pie: _p.r(49), + RadialGradient: _p.r(55), + Resource: _p.r(58), + Rect: _p.r(56), + RegularPolygon: _p.r(57), + Ring: _p.r(59), + Shape: _p.r(60), + ShapePoint: _p.r(63), + ShapeContainer: _p.r(61), + Sweep: _p.r(68), + Star: _p.r(65), + Text: _p.r(69), + TextSpan: _p.r(71), + Use: _p.r(72), + Vector: _p.r(73), + g: _p.r(34), + // animate + Animator: _p.r(0), + Easing: _p.r(1), + OpacityAnimator: _p.r(4), + RotateAnimator: _p.r(6), + ScaleAnimator: _p.r(7), + Timeline: _p.r(8), + TranslateAnimator: _p.r(9), + PathAnimator: _p.r(5), + MotionAnimator: _p.r(3), + requestFrame: _p.r(2).requestFrame, + releaseFrame: _p.r(2).releaseFrame, + // filter + Filter: _p.r(20), + GaussianblurFilter: _p.r(21), + ProjectionFilter: _p.r(22), + // effect + ColorMatrixEffect: _p.r(13), + CompositeEffect: _p.r(14), + ConvolveMatrixEffect: _p.r(15), + Effect: _p.r(16), + GaussianblurEffect: _p.r(17), + OffsetEffect: _p.r(18) + }); + return window.kity = kity; + } +}; + +var moduleMapping = { + kity: 76 +}; + +function use(name) { + _p.r([ moduleMapping[name] ]); +} +/* global use, inc: true */ + +/** + * 模块暴露 + */ +use('kity'); +})(); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/loading.gif b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..5bb90fd6a49107a321c35b9cee4a7b810314b51f GIT binary patch literal 1787 zcmZXTYfw{X9>&iJhvXcHF*h)T1OnEW1i^?zgDfop1p?usL*#PMGT;HQkSO{q6FlJyb$PWkPf|h*eTST}7h8z$}MF(XD(aQ)ZLZ zM?v0rT<1C4XHn<6PbNA{XL@>1^)apdD_@tcYDrW#m`k#MmslI7p^P;Az74wGs`!SI zLs$GEZHsafXsu1i-WleMzAL(yw$-LK{0hv;6hrx8kx!!4$``dAyBnY9Jz&DqJo2$A z!(L$H=KqBeY~CF_viHPz^tTglc?D97CqEBjzUwH}7GI zapg8YZM~>2Wk%E$d&r@9ly9b4Q zJpM7T@}r63I(OExUlG%Xcjz3MU+9U^r!SkpjNThDtaP)7>j6L5z%o5|^hlVOyI*uY zt^UU6NTuY?(Lb4ZIU2Zb5Vz}Pb7KF%ivf&j^CL>$cDz?rMNTQQ|NqDVD7mhghUp%h zhIA{gi{S8y9YhIIbSv$`B!JiPi!0#4#Jge0)p&YVPHchWcyAn zQhvb8ggXGXs9;k`u9Uq*YB>O+Q3Rq=2hlLFcG{Q3ORH_}JnY8C+r%@}6|%ySP%bWG zV~mA;?P`Q2L_Ss})nrJ{$TmeA9Tt*4=}X5x%RioM@_?ZsKSEST-f+GBv~Ya)xX3O{ z8!d=YthI-13OI;RN~`>|6u5L{z20oBp%9MIj)n$!Aw{Wpq&Rtr4~*_74Gjo@3el>B zz(Rk;;>2lp73<2;d=r*8z%WkdsG=vRuG_fvxO#uN^El|+5Qoz^X!2MfxJ3m}vyi?> zMLLDi8+${Z6YbUg?8GNR>-+SwHKdFyr%HqWcs|X_l*-DAC^bG&KCqWg7-_`UlwQ`EdOp_LJkr`L$mHHs75uP?fSgVfsDjuE#ft2b8HDt0yFt!+;C zEgL=)G9ZFt4wa+N3Xg7FGc0~`&EEt6_%7tyzmnb9B_h1~7~GD4V-Bhx7~QKRkF>&aT>(-!Us@aJxAY@8E?HW$G8g zSz@7Jcp>iCp;lU1ieF6n7!oAa-1E!rS0 zF1lBFVS%G#ZO}b@*+bIk+7@Q|iG60vIDVpV%4tW8rKyzwRo_<25;8*Ky@n z-sX>W*b;M){5lB_Edc@m1`VHy0@dg$PTR9uE$O2&a?KAe?xRlCj&Z$iZYwGl1E>Pnz&iXwC^mxf$|zYF zW?IQvyI8sb0OaH-uZPN2urh`iJJ?#U42;~`2V#AKcNOf@W zf}&VA%Il!y3^u}2a@+ki00sj-7Cg7c=i!F+wz70(m06=$aroM4^bM^E>&5P;< zkfFqcj0Oln^S>D2LUp%h3fV>q#)y@fOkAG-s);Ll7OSEaFZxVgv~eIEhk8LF6jMb= zAcr@Hw|>#n-dxCul9ZIqO`Z+UN*zE!)ug|BHfLTH)iz!Jm>Dbag=-)thOl-^>Qs3>HWxS7q`uX0S|IhC%Jo_~Q$q(Z5ZC9B)`w!m?!ul7L1 zdbkN(An9G{pHS}Xyq0`a-b1gKCze#;K6g?3ept7>;2NB#uNuM&Li$6z_e}qY!Ac2U z3m{@5JNwi)R5(=MWvZtya^&#ju(XGNJUNgx}S0D!mv1XU)9n0b9YzAPW51POldXZ z;Tc0{TBvc(z;`^-e!g)8ZX-*YR z!90pZqxp*B39y+k+KXot>0u1hB=jtX>H@ef#PThKjP~cqchciDP@2M+g!V#6qglg4 zIUYyv`fUXzEpaP-cI`Okn#24?e3a1|mbe~pBaFaUUuGfB4VEPH{X|#HM9$!iO@ZP! zrmr+fPhR}S{4v%7s>tMOubh8pXf+)wN?3*ND|`c#-oVu7UK_>+k2xunWE|QH^54rm zjeO+J04FMQFD6*f{oZBL7CLh$rln|cqYr2qUcv8QE$+1M4I{d=hrrdLh}!gk85M?d z3Fg0VaPSS6dPL+qbO!eFCVYw1SjV}=bL(|B=0Bl7&yY7%r{{6>qxA|Mcv|NrjhhZI z6Q`tl7O)0cQ{#WSa_u3e$XtFsGqrK_5uXuvUYTsbuev()sK15;U4~)!{ZNL^RmqaJ4Q&tNSp;KG zlsLZUyh7Gv+=#Z-tp_F8;LoeNFaqqe?uNJThkuzl^hkt~tj5tHD|Xpf7)xYrFy1(P z8A;%ysY=zyuOg0y&GhmKJiLl(h^?+0M~B;p?}GjF(7s>4#45?%grsv0j7>&9+iG~w zU?|?oj-uE*%i{`sgF67{L{KylI;3lD$nVZm2M_bsvh$nldK8jQl>+ z7XJ!be;CNxz^x%bo_QYCsj%F0utB4FnpF3w0cmBSumPSz*(3UCW8Qu-%Y(miwx?yr zJbpIjyDG8z+OmGds%Fk3{!VqO%@177%`e1*-H;Fa7Iv<>$jV?18E!}tIb9-AB;ORL zyKerGKDzt0ZvW~GM|p2KiI>NvNi=>;q^~Tzs-a(pmd5$2LdNbzGH%KJSF|_>iQ!?% zjiXV}n_usE*LYOSZe(mqam;PqB=9~;y*)Vh4s?0=$gDLTzVw6U05`X~aEBUw>oqVX zx*my3ejFnYH+`hd8do^N@Cm6V^^KD`q|IS21(g@?nw??muNcr&oQneU)+aDos#_7fb3!^bwWvbm_8MB!nX6_82mc#THpjD9a-sToZ$Y-9oDtfyQOO7rBKEhP~*L z3dNs>`Lqz+H_Jv0xJ~{F20)DX@LWg=W1d`mBG71RruX194a8i02E$4Ued%4S7h`qHsw5IZWwkr zea~|{0b>cI*EAA38Xn|+o;`wDhrSIQ;H9!>y%iY>nR5>;`WW(iQuHous#&{Z$S2^T z8c3F^vOi_m^e7zE@ZGt^=qjTB0sp5<1UX%{L^x-LL5hnavbVpakR*&g@3{tv>4lm` zo6wmsGd)LeQuJ-H)P)g`EOod5+fH>0$Z3+f(&qzXHGMjZ)6XKnGX0YjclimGsk{Y?1u_m9K}U zD}=@slJuQw_Y-GyGoObFks_cS%PP}f&Ik@yp-@TIe~(-^w0Z~sbnVl1!et`Wpf@VnKlythpU1A z`zx;}3yH5WL~5|Uyn84WLoKY&VpxolnXwfC=!VOIs`5si|D3};p3*Z9%d z*48%BeCaF2kt*}e=tqky>I`4k#`1n#oR!y;i$EAWh$NVEn3GYKn4l|U7PL!d6+jv* z{@|^MM5P7dlt0hdduQax--;o#_DOLAiJeIl&e_v0h4{Q0)-Z$-G$+M-`6mhd%d8O^ zlos^7NDo62tQ1=+|N5Sr-bDoT(w2tYorOmG^vm!on9*d`Rr@yodFM^H~d zhPD)+?I78@BkW6DM1igl!x3ltY#C$$aP*53U-c*({_dHfruhaYhMPlZ?pvA<5tLm~ zA>G)fHP~Se8-9l>-&qMA9-c4~j?*JVnGVU3dHy{apgY%ZQx~q^SoH^rXv|tx@lWNs zwR1>~;kw~uBkd#$Io$RbMuko_pVQqnm_*jKV7yjusAL!{%1N(Eo-=-SkGz?hq zgMd5q>;;u(uPWx|QwesB%-rH9npzJ#mmAe75g%AfgkWAZ6;o6xpG*z`-2>tI;x zf3$TlS`wKfV=y{%jd(N7zmeSa5keL7Rqrch#r{VAG!tU9e~)D&$i*boL&ASl;M@V= z@53^PmUums7%=bN3PmPuc*d=tX!|I93zV3-X?k@tQsmMOzIk4?n~gZAjPY1sAD0Ja zo7`=ZNf#!{Y8bFf^gYyka{Bu%W{Nxhq*tq{e)y3?8vA?G@=)(r#}EkGdyBt1ucvfl z7h{f`$(~A|UxgLeu;tX$y@M5hV74AOKrS!YK6HVB9P@APb%S$wh@F+IOV+4GFqMN- z90cp3i?Y&qL>MOVohgav1Nzc;`uWDe&g=F>Yb0KMv);WhO|Z@+oi#6E9`ZoUTnkQoIsu0;owRW^^L|b@3_5RwxFwA%%x%b$t z4XdE+WXb2E?6%%xXs9^8I8G$CvK!b$^Q7Z67(z41?(9dH^QovLAN+n24IZqmF#eZO z<(Aa9E_k^Yd$M5ofUPGIG z$vs-6EWe*}zxrK~M|5DW&$uvd*kn(pNu=LUs}Qr9hmF}`+^sf=RiB}H(;L)WbHj0< zRxj-Y4eH9#P$<@l3*jL<42)u#8O)F>pimXkD8(>kfpePTjkR~lo@Ww$@xP~w78MUu`w<^`@}~ z!LweMgLg9<@uB?QTd`k-I+byw%Y;Y1Yp%4AGsv@XvCdVoF4#;KD;v3mDLm!7xA&c0 zG>1o*u@*`9{Y0DnoS_SJT0I_CGvjM@5C`8gqeJgqGoS?o%b{aqSmA*-1F1ax)*xVB zs~Lo`84IM<_N^4p@B>{ynbYHDRuWa^i3cHqr-6Bq>vNq)Y=WCKRc+K>aO$b|neQF> zi-a5IMYS!j!W;Y9Kg48h(gVu)P`Qy4`U`2nU;RJxM|}*iQe5-OOCS zH-b`{1t+!@mTxSsE=K^cC)tAgDw65HwlmY>2ezYmV;5EY8T!C#dQ_s?Tog=;hD z40>q^lI->0@DV2nxCqeVK6x{nTf>%k@$sdVI;A7bMSuz!`5;lN0kN95fhodL_JVhD z4Cz3)lEO4Gqn2MuWr@tevJU)m2k){=KbBtJ7wciy${Cl7n$|rE&PE-|Yt-}tYkHF< zACt8~GvAKda=C7j?@Aga7@Xas&~Alg!EY3DrpxG)BnoQ-oa0QZr4^O8W=lQxhX!!o z!VeoOL=Dt6K6?(-$co=MjIP!pzQ{rglasHYlT_jt4{19ekBU7VHQemwzQ8Jc%F%MB z3I%1bqVshI)*D+I-sSbL2`N&BwEXo}>|1Tr&X#(b#HMv^`1ZQB(DUTx71CnvYj$m} zQNcGQ40q)o_4bX8={z1cK2~uV$Bz>($_doc+9h@n!bVqh$qUS7d0A+HB+E-HsMyIT zpopFGiks!5grsOl2$D)ASUO_Gcn_q^(-&ehI6BYKc$);e3Y7rz1$4kS)?ul@=$i6F zekRlKbFMszY+n611Z{ZONNNwM+T+I4I=j-$vvyGB6|U2bNE>!#pV+$g-bDS__shhU zF|igH9-;18K~8yz%-&AhK?HbWYvgb|$7}a&#h~5A_sghbih=buF-w&$yoY!1PBC;R zT}Vq~&YbHjwv&~b+=@2sIA?Q^>b8jXHiOy;nsHBiYKIk*)+rr#8yu%)GB4<^5BBwg z3*d<|`{et)f=2CE^V<+i_>M1@bQPS+EaWP)x66wW^WsU#nYOvwXyY_U9LQ5cZB>Zo z=66->W5NTH3c*_10X=EF>TLB*JxvW(kj(O!7#5Ve6v>tR&GV7o8i@xx(Am^ajX#Gr zv354wf@5@!Ui=pQjFs5oI=tJtRM`frE=tqd+>Ug86g`m~7^d*RS{@EC@$>6JL`a_u zx0|I62j+=6CTw?B z@Pfhpc82oBLm)-gC|Vuqz?6+5+`3$h@8=W|RoxoDH*~XjrD)A23z%&Q+!0wLgmM&S zve`y5`#IKyjp#l>nhWYt{YGt~P)n+Rj}e*Tv43@}^E~0d+O3=d&9}C&v9MUhu)+mm zF%ACc#);IH8$sU|6cA7l0O0!rTmgW8J(hPrZ=%97!@^(*Z;3E4UJ*sw1$J8u3}BMm zT3FkKqA3B{h*P(7d)z|dY0UA4Yh75eHsWELy$xCNXgD-zg-Qg`|K(U%*o9iq0F{8m zHE3tl@IXq`t)u9XOu^Ggq}=2w5{bkv;-;ZqptevyLt`Zq#(z#Hh0RGNM#Rt966mk>p0>lgCzg(5Y(x7|1wq3K5 z1Z;W;2!tu3L4@(g|L-0B8&^2-Ppe)4CXWe0B0-rPEkNQsI@5od4?Pw?cz#&?@IsGW z0W2KK-Ek9-VbwK;&BwrFPnl9(v25-YHb1-s2yzl10B$RoU(^ev(&PTP4|T?6615Ys zstx-v$^#&O*<*nTI87qnLfxtf0MPx*j!GR>?Uf^s8oMCEV_7E~QL0SU;QZu8;x<89 zr`bl@M#u}wWnyEee@0;rhagByS}t%Gz4v;uPuXbV!yWj9uk(a=mRm8qxy+a}L*}3j zJmc{8Enx0V&Ek)!mWD+I2oF!QJ4YdpZ&}wQmyu~9LwR{RmIlJERelccK_+(7u-Mc3 z!SLOy_<&*h{jm?la*TI84DRCZidbOHN}+x3xQ$f|P;$g=fl>-udqS zP!eO;zzc3?KW$yseMomhEG380;FcLj&W5;0cCI4O&n~>fKzUNf=!(=@^sfc6PLi6Q zi*@Gf=&j~_)*sZui>Jhq8#JD=xEO1Zf6O=TOjhWoy&I1wXZmA@KhOP4tqLaC8orb0 zRPg!!x9sGtZ>+iG`Yz^ne$gserJ|KBAbUwKb2vvJCEg|1UfT)swrcAoVHZHQ-~8y` WKVS!lK#me95g4F$!-{Avfd2tyqRXcM literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/resource/KF_AMS_CAL.woff b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/resource/KF_AMS_CAL.woff new file mode 100644 index 0000000000000000000000000000000000000000..f433b03af6a9396146bc669df2a4f74c58b6e61a GIT binary patch literal 5576 zcmZWtXHb(}w|xjkdQ(6k7^)z>N)1Sn4iYg)hXf)>2jP_>y-4r9cccWVA|j!egf1Xm zDJn%U6p^BooA>+f%>8lq%$hT6%|2_NJ?G5%v3(3RH4PC6LjYjH0aO4n*jNCPf7kyX z>YAFI06;Ik&YZFCL!0qTyD^yQ z)-??k@=$<_>*b}*vC0i{E@2QTjJuXn^ii#;b4Gj1Y^3O{a(&=CCwKmigI1r?la9i_ z)^hS|-_RRZV<#7_6v*E{M<~h3S=zXtFP&#NzZ1#7k`OAU6AEG4fbZ>~bV44t?Y z?NCTX^qI-NqH!2wAICC}QXbW3_n8mJnrF8wK52Vtf}{1+ z4lpt`HPzM(6IbSyl-FU&$!~Y?!Og^^sSgfPMG7#a@eO=*|9ZaiP(Lm&yTw9|P|s$4 zF;rTAV#;GyW?E)uXIg@3#CT#3FccW^*}s?=j1C5m5x`Vq95HmJ(`Fn^y=GFTQf3So zGmOvq_jub2kyXp0jKDY72|plHC#XrQ)>4l86+7>y;DHb;QYc+IZ7yuwQMSqYOBSs5ltmMa%t~#&+KC=;@?Vl2BT9KGok7F6^PbE*@s=kRDEbyovrcKgF#m6tgtVLe)+p0L030Y09zc5xDfw<2gBZfPj``x|o zD+X0mY)IxuCi>0;)4j(D@mWsX)0`OuJPS!q@iKxkdg<2=))Vf9ZJMp!p03~5{x}^l7HZU){A%VDi3*LkOfbsLV8M!@;dYU{4}k;ExN=rO*3-=j>2NU2qh)kWGF$W<^t$`Qr&cn0RvI+YbktljIX*R2 zN5w*E!~UA4uR;)&p)zihouq!RT^6uui*i4?W{cl34clAOwiF2Au$ypwQxN2KBcjLK zlxFQE&Z1VzAq0frD~Ob7>X@|GtccW%t0-@%ZYLqLXu=Z=@rwg!l%-oP{b921MEZfm z$Vi`yrAh29#&y*#!Ev%wHRU^TIL1zZSNjdt+TL0BS>l&Dp}=ui}{mULJ2ec7DU=s zvmp*+YQX0Tc|B}p_)4dI3F#hrnmr5RyF-rptc(K{6kc-qc)!#oEBNG~wUY>SI|ofv zbwuy`%c$FQa}ws*;${&qI@>cRT;B<@3KZR4$e`N^_PDQhYH+OD=Jw(>1hEJ!TP&9P z6Kd|+S{eI7I-dGyT^8F(8LSuR4iC{-bL>dRli40N`G_!V-*`q67hjv#`eXg8K-4!I z!YOMf2v&T+Oskc#89M>FUFck~Vx(YpE}W*GY0k^AA@20l$-37`GLsrCeVL{xrw!Q5 zDSz<5*1Y*jO&fMYu3V|AVOn-KJR(6zS};MgmW1XoJS~`<*2MVs+l9PwRV8VDW^Dt{ z#B0fu@-aA>rX1~|mZV--kH~5JL7Y_dGuY{*CY-HLvPX78 zYAjvL`a8ET_03h)0fNYIUWY8r9`PLW9MQCKLuxg$nXtYe_cEEjcGGtJQOu8tf6|U6 z!3a*mv3jX!dkKXMbDkA>QP0uKkI~KBOt*`sa>n)wM#>7T#q`sXzKB|a-lu_an>W~go+m#zQ#J1U$-r$hS z^3~tHBvYnhCbVjcxR|lPRE^9>3CvR;o0_vde^>`483N|miN??ED24dXLvc~Vr2$^= zsn~J7ThnLxWQ-`Rp3RTB4|Jfw;7KF??)dC%Ebl6hW1CIV-T4ys#aac&?^`OT zA~M@jBCqsKHS-;BmZ=SOYc*_12hc&iBrfVw8gZ&%wSSt(b-p*jqF?FEnOuOBJWkMB zBV~#N2!T-Md!*BGK1-Ulgcg=9eqk4=G=F84B8YvPHOCfzvunxoW0dIg;K3Md4~$hO zS3lMy4ezvVGyP9r$_y;TpMocF?zHQKSoNiOxjVyJM19S^=pQ}7YY(gHg zDgMyN@I1exa@uTPpI|_pLnVazQ_p))3#Or{czmakp&w+z6m;jp&IZN<`&)tif&a@$$>!#Q7<9(ucPTdd!O{S{ZCHqY1JqPKA zG~>sd1-M=d3?>xZlgbqy%jZu-@Dgky)2B$6c;5?D``Na`9VSncESzeDHJ8)ZLE$AG zrD=}IHq1PPkB?Iy%fDU~UH*WW+o*10Kl)oA+bRW_LYqyc3m52SM9wS-Mru|hOES(| zARm8}l>K~np>;;B@QSBcl zmKJ*_%8-8gyf;ibeNwo*IQ*g+FV}5Jf#2&c+t9ZQdo4G#S19q(HKi@0J4iRM-7C>k z>ZGH5h0yTvwdzm4jO(k9kMcXT;-tbP-uGcQzMi%F5fYyMTEr)hpdbDo)dE2SAm zR?eW_F)94^e>tSF+n!Jh8%p`I>e#PN4GqMz{ty*q3Pj&^NyymX+tab2SGONXn>$XK zyGcP;_o2wwfoj9Gd++DV!oy@*-S4QQ%Z4-(9Y??Cn&Y@s9sJ+^j3$i~9wrAB=&mG3 zm5NhZ5%pb*76Fk1Bh9y~UUHFIZHZ+QHV;!)u=yL<6?%MM}h@85NodExUz>__XuJ%K&B#W2Adn1(?}q4yZKd-6}T^n&h_ z)Dz`iRo`-8e}Bgp2K{9fS}{oT@Ii+5EkgyI^z&B{%bfLVoMhBOTMc(TBRWO3$yC@FrxJNLFW*-_b1lY~&pyp(kz(Cz z9S?VpJE@$@I%&Eu>14ox_+_nAr&f?@U=YJr$oj@9?|X1kSLR}Ye^ial75_x;7+aZn zG8wl7 z8-!_k@tPi|kYVXESNzjMz`!i%f)%Q%_<=!eu;-mR-U7t(A^cioq?iqsGjtT_KP$K{ z{K+g}!+6-a#43JQ1J?0I%0CAvZB151S2{I|_Hcj^e1aSzx`u;}lB=gLGbD;W4wFqU zE0^z9ptMn057N^`^bMD(i_~m=dSy!=9y~%ZK?66kR#xR#QD~WDiV!ta-F>l6toeEH z;d*eQ_U$`G*(!tO$(^3%6Rq@bcg0eURrDgU{m4PfWq6!BT;zyUvaNYD3d+8c_POu( z8a#j0D;qLgO#kSf(Vh4uX!|}PKw-k8hW6oOkR2l(Tvt`{Bq=XHOgFf6$RAd|*L43lTPlS4<>_dTvb zx)%JFw!2&?&>oy(#u)f^RcrCBk$Lo8hKSK}hXxA4)kBneWam75y;|5~-o@1$WHE0h zX^<#N$8a2HpgJ{Hnv|AVTQ26+HT-~eD>SjD)JRWtX?p5!bXiG(|F@`(cS^p_6QoWP zo1SEbEDt@Yyx_WxEv4H}YKL|WMU3c2p4M1~H-!i?xUxg;D|$~q`sq^HdnQ>LjdYIX zzWIG{XJ)Dmi?YLyHeS0kn8fpp;nV5G*gn|u{_#F{&-J2G|9E@Aix0ziR+qL1 zyc>J^F4qcdj2Jqs_ULU@lCpCISj5apoRMbV|G2T`ti9fNom6k-*fsA@;%R>x1iG9VymI<(ip_Egp6#lkxNG zRZzgL!AhH(i{n@Ob%yuXa+{{A_Rj(wSwwv7RQt`HbsfrSY_2O{_`< z2V~PoI)&l@9jaS3R^gjE?f>ka{p60-9Xa|gofXuP!Xbsii@L)Wyt!0k;l7@B+tYA) z-7XU8KP*^gY0ZR#Pd8+H)f<7m0oRaC9=E^mmV|CTeqQ?glv6_LNhRFJQs+~6dv2zs zkN{z{YX^co_IiLT|J#o><4Q!jQf&1Be*fu}k#5)?O>XnX@8k4r+Wl557!JjO2L z=Sfo z8TrMf341~_+dfP#q0Q%|a`oo|-j#H%1GH_dcacC`spEZ4iQEUNh}3Agiph-0NGgj1 z=0B{Xw|Df0Cj1QaV_sRqSr>(F4>yM{7+Y8lM};@qmlRe~DKR0#YjK%ZrxMtbq$p5s z{PtT0Pky1b5J3Se>gtBU#5TJ*rrkzD7*m688)_xpkkR>^_O;1U)omMCy3KdkhVb7h z4(r;r(svO{Mk`>_1$!=YNrj)M3ilhp-Tm~LT<;yKRe!3SrexD zLL;M~JD-yjDsSpi<;(PcCWzjx}vByyL#4m`-dJ7GY!_q zp|^(DFI7-Vj7tLgGs-vno67R3L8c!V@~qP^T%TtBXs~N`2|u!bG+yWMi|nYeBL!A< zpPFs;_N3Fj?cdC0eNGVRDhFg5{;6y(jemI1B=QnCE(#C30?UYL!HJ`s|4yz(l}ac6 zB@>;8q5oOCwS0Z^?T~0Ba+TDU;yRcU-``ChVWct&+K>28|2zv1}M4iRUG{QW`70rKr&yY3S~Z4 z3`E2O7M)aM|M5X0?L&~P*EO%xH;^2%^aL;ytB!#pID=-cu2iNDuCA`giUnC&7Fdw_ zha@~VrKp4;ie&t^Wa-2>xYBdkekM`varHK zr2#!W=ELtLmj`5}LaH-iTQ<-#+QNH=x8G`_s@a?*-*pHnKrInaYuoO3&8Hk>*Dm%bmx zZWhX)NRW7hk&*9q=`EWJPYyH>h{*ZAZAJR%AxID=qz0E7$wiI2<<_uK zv48!z&P=;+>j|0jZJzJR$u?gOWgJ`=J$o7dh^vSFRS-oC_{9+`Wm|%dOUf@9o>+LQ ztO2IMHZp<^JT_m}J2^`(UR?1cFUW~WW|VOu;v6jgCiT5e=JUohv$gg&%Nu-YkIb^G zFi&ERGBUBF+5d>Ml%uC}jq?ypF{m@9lV}FpFoCqYwEXcB9E^tt(L-DpHV`t{%FBRs zf;;TTAC`kt#7mZ@g`_di`yw+s+x4@HM=Nt*=(}VFvRJY`lVXE;+*{LjZ4BWC7}-AI pY8gK>?K-83x0zQb0c3tEwpssu2lhbt)flxVwJCAF`hcVj_#Z7?QSkr( literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/resource/KF_AMS_FRAK.woff b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/resource/KF_AMS_FRAK.woff new file mode 100644 index 0000000000000000000000000000000000000000..9c7e9d68e6d48f0e1d67c77d62af1d485cfbeff4 GIT binary patch literal 9956 zcmZX4bx>W+7v#esXmEGe;O_43?jGD7UT}8^4nc!E!QDN$Yk-H_!(tn-xixjXl%=GUH8hj~0O|t(BH%Na8~_miwf}#JOG%Le01)s10J+bnf4>Cs!c$60 zLlFR=0Dig&|AT$!`jWJSq|~QY@X5(PK?|?|P%5jluzhNSpIqS+Cc1s*GvjMuOG*gyg@t>P$36? zTgN_u`a&Sw+hcYR2!!2nfwXdT^tJAGhf6zrQy`qky!reQX`P&Z-Tv00c76SwBPe+K z`D{_0`5wRc^s$x|H^_VHq8-QB+#kHAuc(Cd(oW+)yfU!TBS^+bOULML>wG#NnaOFt z#Hbjr5Uta}&P8o&?I7m8GVgKO)pM5{SyIxbXusSrRt##F-j=uM!NEvxx(WJwwcd(! zb4_iIXU=O5v(GfV9_xk6fLDcEg=dd@$+l(w+p=>899$n?pLcCN3_C0}91)v@r(qMpF6WfKvJuEaF7|y>B*e4wb+a2Q>yfX7JC4(ZyxzR@aW3?1+zfWW=Oozgrl28%GLK0n zmcR9C@3c=T6ZuMApljCw29i#-hto^rbE76N)fxKP#KYLba4Z7gHK?bSxS)5qe4`i>0w>EX!!MRof?9+z1l4 zYc+90QCUq(NnSIQFLJg=c5+zR$8e&N-4{C;_w`=kkVGeC-owC3G?934S=-n=o&Fqf zvv(+(!Fxf`z<*+E34esVmMb#50fKFR zUWl|GTB_xRV0_;hr!x7Uk_ThJiAycHu^!kgzHN{CrN|j;-PY|Re&Hl2arbB)eMUO9 zhFrUzR@=EN{3@u_X%z+A{zc7=Fd?P`s`P?1qWvKWI}|A|CvRmbPJN1Po4^VhpBn{9 z>MVg<1aD40@o$u3u_C?4H1OtbDp|oDnt`oQfv}Br+Le+D`thRk@V>OFUXM1Ft8vl_ zp%1S$*5A8Ts6h|z+-P9p>fsfg^IPfNoZ~Lee)xnjvjh+wv&<1gNGB)VB zdzwkjuh(OP8n>I3XID%+$HK$6|DLd$q%W)2;4TLm$_1G(;PzVkN6O_C4&(5qJ-iZf zyQ|*5bcaaG9($qsoVE0!IFGGj?_&AzP|ahhu<`taY!b!lUhCbv?x=m)MK^oLdKPYj z9Vu{hs8fPj5UE}c^*C|U<*yQrr^Q6Ai{rKhhI9~;_I=#+sSRSrWj>E zMAeDszSl|WBclxrDj8{fzx=p-=bpJYrq+rKI{OfsFmnC@4Wpfyoruj6n>3yKE_b4B z^%gh3cLRxhAl@xt96lU6-73mD#5uTpO)&d~`wO$hGQ8iYJLR)M@qEGW>MCyRDaA6S zmAq}k)k+H7(NV=|EC7isqFd8PPW;)1d*?|rQ=26w_l#ayPWSSX@#d4}ahj8LRuIOz z*1nOJKVn&eyJ^WXUuCTlcT`m&qSCYuoJxAQTr8?JO+QWD>G5BY9{3ln$P*v8jY3|h zr)T=C`Co}CNz8>L7vVE~wNAzhs#VK%?BL!qY2j4>ErfRmM}U;B9&(O|f*z7!wo+(< zr>PUq;DG9Gh)U{AnH-|sxLpBZEd5Hnj3QbR1`J_SiR}(CxYRu9?^dx>j61eoVQNO8SC%;>h& zQhG2GjYfxhATnSdhoR~aAK*v?b3~`JC41N$6yHs;y%dac8V3Bn<1(AQIr^58W|@U;8KC6YXwR`5^Y#d}hHp zGq|-A&xO)*?@??l8Kggh-=bD3Azy^m4P@9XE*2EbmgNb{Y~4wAj=gIbncrHBWcyMv zpxPZs1`*B6XhnL23Ho~pL^W|EcWll3X6B%qt)#)s6va<9_2%HF0XVsdxl7gp@!8(? zoLKnnpOrIA>VrM>QL1Ws?iYD-!aR=~$=$}9TgWgfT_e$*p?B*DHiEW9XB(V&AK9B; zmctkgZO!XLOsYsrW|yA#zQA%R&Pwg@l zHE1-WCC-Pu3q(?J%C8OH$3bnHTf=uwjZx+Fm!QY1Vp2t-xk^B+?w%A@95i*iJl@vs zd>4EGx%cy1Pq6H2qH=E#{6*jM?tp)(W20ar-`g)PhN2X`BJ14lY;SMd$&j8!+9zhG zD?{)*?G3KUzs%#~?cMCoeDY$2KCUApqFTJ>jJXyo^4Dg(nnluAYLJYE$tvP73&+b|_icz~gz{&M0PvKJF` z{Mq%Cq57Vw>k9Yi!31m8lm3|#HQ_2-Lh(z1H@pDmZrJz&U4Uj*DFl5VdabfJ_;C=+ z(_j0|Vp_)HQGPPgN8MoCZIVw;&vidLg5p$y=9a1b>HE$L%GqgDWSyOEV%yOR3vvrvmHUrt-W({T=bH_x$9& zMnF?lGSKC0sGmTDhvCIR$$DUR=gv}OU!_ehUnkL!a_M+@C|t_Ih0^~j7_Fp$TYa)m z_8F`56#+M@Oo@^Mgp%dW$|{u-e5^l3UEE$;|HYP2g4ecPOiV9p=wxK!MNLtEi~$sP zKrEW95T7q2W8%vDU5wZ9MZbaQeUoWFE!5WkqPvS}{2}p2*7ozff$tCDu4JQT3r>Ge zhkz~}CKYQDrI-En;GZ{y(KH6_DY``)GIsL`HX= z2h3O99)@geE9~GHno2pMV8Il7U(Nah+uWaC(-4T>pp4PtT zRMWh$82kvF9jxfoG4Kc>E4F*+kxljGEvG(9zQt@kf|pfXh|9>aiTJG z{&S>|I(WEE@S5etzr%k!d(v=*Ui*mduCk$!Dq)eC38= zQsmtajOA%~H_c_m?vm0jtjgpwAB?}s_{e+oljPShk^0EtCgc%`8X^q^1;xKoAq06Z zJy<=>V0enp%x@us+@`lYfil`g>`myb^fTvb2d#Ow{H!P$Az&N@LwB2jGE>^pCMtHB)UMQ~T{Yf?&>m2KCb$t3QE|vgTfs61n zgB!y}X07SVNRRo3Xy_;VaE;+BE&24+E+hL;7;tioF!jfTBg}YchNT@YsPNcuMs%`v z&^S}68P7^ZjxMcF3FQ_-8QkRcch-;2>Bsq2vzzrlzW$G@wWu?q>m1qcXAr$NjnFfE zM8FAOn7u3$i<-9AYNp#!*3fKda^WYIq(9GW1#jPjeE%zgaGT%>+T667)#5$ zP5GZ{16N*iNO<={h59$h<&)!X()G_H%-g(~(_Uu{wj9>(rgD64QBVx%G6yOlbv-;m z-61-YGpm321%8H!fVre<4%cvHM6hv9{<1u%GkWN>^;-yzW=CR4<&@0nQqXpN+@S6a zTP)s`3>0aRnw?*%K=vXcgcb6&4^)SyL0+Jz(3PD#6?%uX{!ql^-p48<|5C>)R* z>@>%8jv3$8?2-L6sFi@zFumZkf7l~}m6nCUq5$2bAIfc;k(l%E5}=LQXl_2(JvWI; zdz3=HCMwB~Mgqf%Mvhei$Ll1h;AyvCAs9@YLaMG;T|;rPw>u0s$bjtS<;78?z|<`0 z{r0D1OEDoM39n%Y1a3<`0D~oX*Iq?s@il9>m$Z_9yG-3P>q?6!)#T9Tsc)=Q$m$;i z(Gi;}Tr`~t9&I~JIHOmYYu!@4mOFClohkyBmSFev`MvTWnj9&HUj0y5xW6XLOan6J z4V~e+WVa0^D+PT^k#+swnyfb?rxod1eo~PJa9~n%@Y!4UpH>KEDTWoO_9ILn~qkIj-9saYe<{l z>*9({_6(T3aswf{{}GcoO6x^{HW+=d;Yqpj9iv$#&iZ%ZL5~UWWK&@2{_=-t#dqN; z=XPM1wO7EJ8|ggG z`8*EvxtP!sth@CXOT<@-Q1R6e8Hxgh=FKVW@{n{3^=!@x=~<{Jm4Zn)`*T)tX)0a( zRu+g&0O-!`u%aCnQ>*HHt_ur-`*8CcT_#%h?*tyr zx*5fFgNh491EGmvw_+;; z89{AJE{I7;`cNr)5?H@XjRw$YjyWngP;C`7mv%RF)eOxq0{Qsq zHY47uh(+l%uxxI>w&a_K(HcPuV~)xXn`?vPJAG@5l;;>kCyDK8x}a#iP2QhQP3RuI zO=19VBXnkr3vOzSgJ{tGF7NeIIk^{wKSh42gvf0q%}qGQa=q9?Y8=Q6xH||Nai;jq zrStD{xYyjQ-jqzUML4jmY?*vbHt%_ADH9o@x)7%97fvOLmiwV$Z`k@Pqp8!-;t->c zqwIm26TJ`AGrRbsp$U_PjG7L;bJr%K4BPZB7{8+?pr8X4|A$s7ujgLqFWOp7otf&G zimi$*B>|=`Ed~CbM*JT@SMYb}gh0bAC`!xoEm1s_d|AAl+hcGV3G=J_UYXh}+YZhS z_6Eje_|lK1k*13s(Dl`wgc{w@i`nJ9<45-<@0$@zZ1MY2c4G`l!hB?2>)44 z5#VMeqYzuIKq{_=#p(CjXK6;NOkC|kW;LXpEs3J@3+ zD%Bu&NG(Z}8Cm^jVQ%$jpur;C=(P#;HnsBbo<*6e;gJW(GwkUAZoTz4XrsyAwjJ~K z52SD5O)Kp+f`8_PL5j0L?|7DD?nV2C_O;}@WvFLNKY42bT7Zpa<~97IO?eRRxT@+^ z7<>vyPtBl09a4^=OsF`>G^=tAfAZAS$V18{oDa8%4A(Q}ts;-0lWpJ)e;}AfO05pDYY!Eqef5?cVlG}vhSn*EX9CC$uU&0*I9@cZH|@mJR&#jgmz3pKy+z%Y7JI zP`9#~2{}E^-D!n@B`;>*vUAYFU|tcx0|4FYdEKJYxzG^@a%B(3?# z6NAc0lN(DL2TxA%^Q)3ngc$_G!2US+p7fGjHcY>-vEkXX{}rkPZQhQKcOCgfc3nU# z{m)|VB7Q}ziZmA-kvWNZLUW#gXHiPqxnp6fMjlFgG}>FAP?nSyB}@38dRMD;*)&XM zm_Bc=4V9zWrmCq%u|}v_Jyi!&DHAK>3V$z)>qR#Zi$Q!oHRE$VP(7@8DB6${B9J(Ug0D3axhzMp#W&0k`=u3D?1RB=ZPtitV za@(ale)5#dXaecc4fUj-B4F#@iofRd(fyt;*0UD-9(WBQ9SOm^LA>E&1>Tr_5|UuK zGNIBK$^L=dE;zF@UyVOYe0FSznL9qcO8LMn|)w_U0*9Lk&VY@2m}|Bz$4HS&IE zl+KmQw;;^7;a2lddMfP=U)(UaF;{S7B3L#@(?67ek&x<53_}59?PMfw`zsZaiv)g` z{HS=a3ePp#M>r_u#(V{s83eJ$n&CNFNHjP4Vyr~c!S%>bDESwE^f{$`Hc>01NJ!%f zVX&W#^X-J$xB*NM>@-0(^|H_TftD&!s}g#+XEc-iYo$uwDs7Dkb+=SPa*8{|&+A&109OxxAAyd5tS`7}sbR#s zxDoV(DqnL@XMZ>?pq{{O^OqY)=8j@j|rhVlcblve*6Z^Hffm(jUKpClM^?LbR+y-;mi?_)Sj6i)0xGEz&|FCFq!W=TK?apHi;gum)ssUQx1 z4DX-?50G!z6MV#Me!YcyG+icN`oehQAjRt`OX_vg4f@yF?>?=+`DF+kBFlxx9}pi8 zX(v)O3n*ug@h}KvCzr5o<;GQfS%>1T`2ehuJ|qp}^FI^F@d@YISCbHA%QQF!;>hc)wC=;ESa>2*$ONW%dJ-0`x{f%s6{E! z){pNwJ*(da{2lzlwua1vCVe0?A$kCLwZk#=-wQ$gGYM!JXw`9ZFVG~Be7LzS;tj|- zWKwul(W2bjzlPVP)|DQ}kIcPkGV(J1pr=`>IhkQF)C~IpkfH_5H0XB?-Z^haU3PzI1Mkks>U)4MAq3dQ0S%?|@#F*Gi)EHyGs+!fmOtWmUtw_#E&e;Qn z7Ihj*oIQjj40h2qM488lf~)fn(#}H5|DBRD=%77#(9+h>E~jhWX74Gez*<)Bk#ler zF_txyRAiaS0NcJ7BJkojfS0KqZxM#Ka{4aOgEh_ZV zq{a{%WY|=In0rB(Ub;t-WifUcA)YD$W4;Q;NruT8=~BM&Ya!Jdhi(ibwm4zmx(oU&-$VJ)oHi7FV8X6(2?V)Jw*HI5=3~cL28ulEjib2lP-uY*a zQ#|{|8L-Z0{Xg;=oW&(9G3k@l&zIt{lL1s%8l|Zela%Xa{s1U9d$tsAb+$0VeRwWS zi;tSdo_;^;tYuKrj&<%enVRqE8wVL{j*cS^ ze~96NGMBsL`tVhZXaX(765R1RpoF#E)HsdULT zW(OIjXswwy`#vq+E;C_W<_z|mK%cIDXph+<2Q9s%n%~7^GA0+Ye@I4Rz%5AKo4qnD zy3}Mz7-?DPSP{*XxC6x$MZ8Jn0x{zeumNP(I?oz$D(AnhpjqJ6z;dBtPy(Af-w65g zXBng@#jw=3p7LkjM#TKo^#cqkYRT%;aet&KTRe9qLEEg#RfG;EKP<}W=D+gXiB@l@ zt?1~ORaVe4PgKTMD@z}bl(&sTi|YxxDrEZ+2qZhD2%hnpPSs{@2ZY7wTxIoBx#g4n z#l6?xZ*%PTwFxuU;5)Q1_wWjU$t*$c$2SeJ?uOHq$X1)5$Zaid^H!3xz_*hxW=49y z6ZfgT)|=!0hDhVaa+HHoV?wYhCDHQ)tMhrO@ZlE7${HaUd6r; z`r7Gpo5AQ`X0`)2{lXZ)|? zW>TEpnV47wo8ZAp!J;`s+~D^4W5XhoPQjMo;br0$ z;a0wXz}*nxp?`dQ1nqnGJx(NK#p1X>xiXD>69}843nKiBp(k$T^mN0RW~$QL+E;I6lV;*n84#^xuDS z>}GRj?*T-A%MsqmgD#7EN337@wh8UZi<>D@1dz2uH2IvQ|2IEcV5dH`q2v(&G$R*M zEK+$dCP2&yGVj0lOq2X5qN13=yX}ufi;0OgAdy(Al@Kjj4SM^lNU1*hLG)CAzL2jcv+;yxwG_z?(uCl3AGWOF45`Yy zYUL_Esh>{KEDl)9N+%+X~ql0y0{_@b47 HXaoEo5^4Yf literal 0 HcmV?d00001 diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/resource/KF_AMS_MAIN.woff b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/kityformula/resource/KF_AMS_MAIN.woff new file mode 100644 index 0000000000000000000000000000000000000000..ed93f8e84f307c523934cfea59c18569ec257e4b GIT binary patch literal 52540 zcmZr$W2|sJw>-9O+qP}n#(Qkre2#6~wr$(CjeEZTx5>0wlWEg-@1$Lmy2*=)$*ZWy z0{~3(06+r(006S>0RaBB|4$JX6C?N&KmY*r-vIy;TTs((ONfc7$N~Tiy#2{>{s*hB zacFT7Q8563L6pCk&;$TrEa^|f_y;yntr1>}Kk|Y5=@gS>^={3Z?jRdaR$Q4g zQV=2X5S9c4C9xT<)6Pb%#Kgz!tjBFHzt>-JG2&`h^PL~Q*(wppt}YN1(dQg)C!am= zs8v4%4zC>l0?;Ib=ub<*)Xns&E7m$OF*wK$!rUJTweYIKlEfu{k0O^eaRhq%4#yWN(r-$~Tp}<~{R%KSiPo zyQRk^D;53=*b5sfe=J$qyq)|K#m4gXCGaKh|1g^awPbDb0?TDpU{K{r70*@RNK2t8 zcufl<%c&~TH>9rf;S|lwqn1=J(4H}$d7q(|WuedYn()7&w*TP?eJ&oJxt*s!@pw{p zhr*Sx&qF$MWs9TFfo;g8&MiA5Z_C}5z%P)WNk5G~*?c&CXn!zXqb&&G?=uge2P5qZ z?Az~~>^tx4>=W%v?SmP%F{q^xO`%Z*bLESkA*n%JhG++K2Y-f$hu}leL)AjwLi8f= zq5P0sy&!pfPhX1Cm#-4k8tN5xk$K8KXIwY;S+%cn)hg6l)RNR%(}$$aOdcFRRNPg( zZX7g^Ubd}r*8c0V_4K)TZeAs(zj}5HHS}cmotm7woXVWCH-lkLPoJ4GMPsB+hn3+# zo-ATmj}Dw?L>n1aVR)WGGXrnT<(%*y(=n-GbW5X83!9RkvLliT7Lkw2L4QV$L5M-^ zCe9$%BGjUXLLLrJ5Y;U3j#o25Lyepebt#xGxGwN1ATCfYfG+qa+A5kG)q~25=Hda} z)!psWJ-k!v`TB}?aDB_W{>ghwx`W+S*qzwL+%e#WG4=G`XC5*8Uv3Ov zJl{Q^C0{!q6@K@>>C&~*iPHJfY4cS1uvv#(X1-J(zWesm$K=^Vy+JS8GgeYkHb;@Z zv3kMzdqhEO;l!YUAS0tdA)&&=AfdxVqQXNX=5fJ?R2;z^qQiusg202rpn@PHwos7a zk|ObuVG%I$k>L?>GO;02(a=$lcdwkpASI=@%R^$KAY!8N%eJ&RdtWR+$En@Nm0WG# zqbJNShH2(0oN4$kbLLTcC~25TDLF})NVu4PY1@yX-e`OH3@gmhID_!Kw<8{*h|Ii$ z6n;P3(QkP}M`L+sabtCLO><*&Lq$hJc|{~YkpQ+382k7rXqcQM{03X@H{WHJhdYPX zjM}r76Z)M5 zM2=b_M}Z`caEd%}jjt+9vI^Gj&K5Ez)>4iXtry|(SucRbV(y{yizC6JV&Y+;*3r`P za?vnQ@)55vg!On4z~aMUWFuiCp(0?VBH*N8;-%Iyk>oRvQw(JO_+P?{#EA*Q#+=t4 zyyExxGN)mfUw!G+$!Vk%Tuf{Z=aa<93^{I*YJ@eV`Q*vjFS9^E7I z$6*4#7=!SK?}ncCB=t5H-p*1;zf@$TT%1gN8Le|~4qahwwwX8Ad23YhnEIVL_@8zS9i7~hJfVJCgc*=JhvWMh{-$)F}{H7Nc zzI*ie?8IDjS&s%fMzc|QYY4OCg<^3Qa?#T8vJ&SJNs3+Jh3*03kBc!UB!#13qr;)(B|H&j=U@BhUy_9$ykdVnUdoU;ddx9oNup#( zO$pdISa=v&!a25yt(+~C7Wjkl1~(0&#b5gBnco7?O=0X-8N05G-DhL=W%;xH*tZ|) z>~Z|w+Z?{;oZ@DCb2_im*R=P-wi?d?^6FAkz)_iv&8lq{0$kMV{(}uy=q89f4YV@?*4c; z0)@ey7z|iWBUzLcOvdjq&HHQuZHKBvjx0P_AiVhgnA7$1=<%h+tClvA=}cv}(3k$z ziTKrr?M`LK#%Bav`VgAYU(06ftz;rYLh0mf;STb8Dt~`k`f^JDdTJH=yY%;uu?JcL zelaBAi`@hJy|eU~-i@EmlIQa0djEJMd_F>6^V^sy7#Znkjfo*S8;;BCl@9THBx7LW z-H-0awKc7g*Rqe0io2Vo@nzt@HNV;4=g!b0jrBqwsl#1yattz$;$J?~yp$&A&)vEk>Yd)SRBdjNcQ49@IXuAb89BQGfe{Z-)7XN{s#+-Hc1%K>VBN6%Rk^&ifP^V}Kdk=iZ$cyY!tx=|;W5%LNn*A~v~1JLoWdWrQ)k$S+|Fln zJ(ls~h(6{c!(_A3(lGGX*mp1CJ$7OwhGvf-kD$;X(4bKe;@U(S zR2pO&a%~$@{Zs?1D-bJCE09o-!qO-#P*@2XE>Y&?&2z{eu|&OzRNSE#=F%RbYqQ?UdclzfpQE`&=pw{`8Ua5#-J5De5Wc zDe1}YDaKRUMdW(}eh&YL_mue-`KB2|5JB>NqYj~DUl#oqt5<0yNdL(G;C|L`@-MN- zU=XLz$QNy5kFmfXAj&Q9TJ$UQIWL8*mCeh|&n^B$Fnhji*ewWK7(8n|-+zJ_5CcAof1>bY;SI%;PCIw^ z1mca)5s@$1C8TkI!j+IOE}dUI#|*CT5uYtEUvxTafBJj^5AK~QMW2H{7kx7FgxqhK zJUf1Z@+9q!)RT3;*7C&d&e;(FpT~wAh0PZ}XW+_;%_D}~jVUNR$KXndEj)yLl`Tp< zGvNx6D_(?vpUGoBr{T(+$#;SzPnmb*%2k__(h_~E&sdq$(h>)*Cf8Y)$h2U#$**pT zxibU5E`qj1*A+oWhSQZwoj-O4)s<97TonJkdKf`{K{XjFkc022Q;{D+Jru@b+|2Ta_>v*P4$`2v)w=Me>}MFQ&F=^eB5R7yL{We ztGS;dT{7Os@3VReT^L^rd8tYCy&n(ewOL-xFU_zCtEAOR#=9GN{x3pRV1`C2(HrN}})fjCzmu{!QDp-Cbps&Lb{}@E<%Rth8 zJ1}_|IVfAmAC{wc1g|oRCPHfu4dJ(iyJ|!}#8)D7G2d3p!;;W4^g^Y=7g6Q;%>w!n z38Mic*C8k){m5(_Y#c9+m&LW-(e*>T;o68@>|fOZX~=xYQe<0lIQgs$cXmqR_vNF( zad>4tsrFnhE>`yEM3&yBClFLhg$8md;J)$CS= z*)%t)mkt`?7TuR@9wE9^^hx^T!Y`M1*>`?wlnG-{#S732?`eo@*KI6}5`2p@n>K^D zi8Cfxwy0^-6tGE;ONLG7&DIwnufoAm#A61o7A{|BFfMe?plpws1fh7Vyi46xDfQUO zEtjR|yfU}>vjY04D5;fXv=mxee65~5p7t%ho)k+Mmrc@*=jj~(?#vfluDRE~VYu)9HeqErUXCoE zwv(|d;rA;{437VGkHZ+1Y+C zC+%^MgERa+2yXlPqR*nATSK=ey1!R!US_tqAGmvWUA8m5Yd?PiKH>R&ju$y|&Ahdq&UfT* zeNMj9pO}wNe{wH--EX2I^n-csJQzL%cY+e(`92zEQzv_PepJ6!je9X)um28lJ{Vv3 zL+-`bL_dUIfBb6qrq}sGeDI&P5AnytfPb&wD6fxsxwXGY50n3TZw6=gOxrTPak;jb zxyoYUyxWA=?z_DFJIlTN%L=(=uW|z5-DdAzzQ0{|cgY8?>5{};w$KjHJAsB`Bxk0k zNHnX8+PP!qPlW<-uK>(^ZUd&T2pm+!JRGGw#T=zHJzZ2iG@FN7y;44R=uz-=LQYj6 z?=x*_ZZ@Iq+>C1(4UHuC9Kc_QedCmc-%M0M5 zYWFUvHB@#>4=0+g-`+cJYe4K?2Z5?CvB>!<-Z_fDY?=j&=>d{5tHPyeQj^ut(AlK+ zUnaP%?Wi|W>qb7Ozs`{jDW+^8sm3kf%hhwngswDiNk`nUnDEk@)Uq+-cI_G#9L;Tn z8)(^?b?YUe?6NY#DN(hQTX#RnKilc|yvmgE_1!qE)x(XmkxAEv?o;f&bci25RpV4r zw}Gzb+D{L7u`7)I&{`?5AF&JLca1d_)pRjvf-oyfY@1>=-3XmxJNlD?QKAf)x zsVD0AU$5NMS5Sk%BN(-u?N+>)$?JQnZbKx|Nl*Xn4)ZC!SiS(?Uv_VFs2Ei$*Mc*n zoM@vEfHy0ZYjD^a{fM~(pJYqWPtwZJ{{uNn7r1bfI7uI34g;YpxmnbZ3votU>c?Eu zR@RPu>bN=Yl{b8F5|G{^XrykRW6r3SQ#r;HS$Q;7RLj;@3X_&Di)9{tIYghlyJy=tb1k!L}D$nogFx}+* zQh7fKjWtqNG<2~H!&~+!wF)ADH8Ox5dcjNE>u%>G*Mrg=C&Vr>B^RLyhZv{xL;kED zI2e7yJjJsR+;p;=)nu?cM}VxV>)vI7ve~7V<0s(;7oRid#?p$#{B9&gh_83NGH9}l zeFLEG;<4CWP_;@esSSigZ~&hffLo32AUpc}l)ll)lJ)VC3>SBKkBU+Ast@EzxJr-I zDHcnPs=KIN~!=@R0^lNnf)64OjYM z{VL))1ZshU<}F`7ZG2PL(_eyLVH(Uf_!)nzRf}*{%ZclVk}wA%-{|uCpTp763;?~M zy*EhTIf>s(i&K8>3liSA_ENWapj%2Qk!Z$cT1|<@X%E4f=YB?xvs=MRC5*Ro9#Kx_ zyP^kFU zRaJ)bpq^$v(mZB1F_hyPj(e00nK1)WLbuo8C?I(tFCt#D2Hf+8HEL777O3TOgPKP< zq?d)GL^jaWFeN+O=CLpXH#Cr1V``sd3r{GEL8@zyaVx@^q@)N+)(5N19c-ecs6aUQ zYr#x|Ha{?VXtwaijL}k$rJhbMGmQo5Buk8e|x_F@S)%-;lhW!#e5r4 zP*Egpjt^!@)1;khHVep=Ofw#HKH$F30HNm*QLwDzx`wSo(jDBJbG1NkCw8tx#<-3c ztYAlwm}N^&^TL3}!9$q}vKjGzdgYPj&ZC{N2psh7y|0zA1_4*8IWeZ6oL42(q_&w1 ztuPC{I(w_alsfZ+Zo_mo<+*ZJg?dotF9w#D?S_umN$^*^Z|efroLU1nq0=SbzLlI8 zoTGUMuMJ9^+AQkXHsaV9YrSK3@!_)FUy8ys_2uu}?H?S* zBzkui&CycLOB0icUL!4Nu}P)d?Tq=_DwWge0oWzpvRVuArQx*-_meOd%r6{Y*vK-N zjV}`@R<@eF&0h0>;tM%sHUx>*VlAace{VzkB|_B?(+2cy=Z zSMTBNf$ks!n&W(;0@`=G4gE(h8g=b*OjD8+M@2n2uL>hPymo@VVKuWQOK+Vm(I?U; z#V1tOz>1Oiw`A$IHB8?(Qh#Jt&YeMl3w{NZd`93+^Cd0K2kY+hTD|4#DY*#+uJ0t> zl&}s_Z9oY^4pwd*Be^RjnCp_Qw8M{MUdTWzz47V-HQ&o6RY7O?#G{cf&!v1)5p1a8 zanheLMH?P1McZ0E|1YTqR~w5p2h!Y!a)qd)&*KTVwhE%98`rbzJH)CpxD`Eu?5oie z>2_U5)9DmlxpBk29ojxvq&0sTba^s3+J_`2o53Rt5Sa|M$%lKNN&9dZ>67kr zvT}!C?3VwHJZd%+85Vg+xP-Hv-U0i9l$jfh3)>k*b=i_dKz0dwb+vb{SPP%*na4=i zJ1uPdDt++Ny(X^rEqRZ7$|=XhS~+x^b4pC1vWdzDBq__Z;C%ca=zHl5c{2ZOk~|zW z&VS?tDq^tUHneEs@r7fW$JVZF+HDJd zRGpM+2kB}NUpJIV|J8JyW*o5<%busN-x?9F#i&s~bYnIIT{yNw4~YQ_b4BBg@dIN> zv=Y)wbneH-?+EJ=C$hU`;W$%Pb9yd)$5op+CQFf05bPE>m&bjwX-}=OpjF2&VJG&R zuwcfREkxK*RZdkABPV=a-t>9a{4JDkIayq*&tLCG&b7qdfPOdg28c+OP!7GbO3e{> zO?5>F`l2T$3Nu8}bnids05#bk%l613f=a6R&Y)$t#9t9KRPv~dTW+!#RdFL@pe7K@d-oW%&H$ zrbsYCg}TNmrMlH>Sv^yZw*|ZU-ow{Y`hL({>(U_h-cs!o5>uHDp8R0R!8s&j+%**g zbLkx5_i`k&`vM2sE*Q{~Ah$oat%i@ed@@MnM3@xx4PZa)JtQgeTE(JGa*cC89go-- zqUvr9G#h>IcR&_$Z#jCuQ8U-d*TRw;64wN;w6DNi8GR#g!%p|>-TOeX9sDv_5`q0P z?xqN>)=wpsvjpSLEO?OV2Wk)c-HV=}bYgj#FQ=k6@)=NM=Nkes6)$j~6HG^k;@~>E zmd->gk=X#CvR*mSjP}cCYo*+Tq?IIHWgSIntc7|2=fZ=qx1}ZL2Z4i4O!GO61Wh*n zi;*b>7z0Swvf~-@x(shJw-5%n_?k@3tx=wBG%PKaBP&$O+B*%L>iY37}w@Ww<6I2 z22okH?pMkJu9%f}+sk8g2eBm;oyb+y*`PWfI!+?5LC~d}NLElCS)6E)=i5ytQ4Z!U z*wSN+AJ-z*O8N0fx*=0rvN-O}#a-arRn!pbGT^zA)w)w~`+Jypu&A#+6nh{8zG3Jw3gF$r6U9SlliU(xWz>Ze*9TNr>Oc0p6)dr`fhc z*COHbvI8~m!H{P$V$^AURb+j_uv*z-g`{u9{5F7_ZiC*gDCz&r>C3txvirhMk*7>y zP(~zrn?|Rgz`@OBvZ4(bKdUJta>X`c+Uh|vW@%+7zQ}1w0p#W15w0-4s0BHIE9Uh= z@auM->r$52I9$jUy_9j>4ay1?F=0+9kmii|&+h>MJDv!K7IAAI)u*9K@q>`oO9seQ z$2;6F{?Okau0&LXUssckz48`#fWL~nbn6p)-{A2D+J*O`>Nc8;ND-=MD#r<-5FEiL zk+G_GK9ea!as@bHB#smup^nL9C!|QhFagaR4Dh44YX;}iLTA!}q83>oL3~Xg16}e{ zB7F9i0*tF#a*i)M%4?|##OuB}u4Qoq+ zFJZU;SX!~B<|i;m+ccJsZ5*xr$ACv#orHoHhQm@sQewpnK#L06?>Q*8hX7En;)s2o zT&Cs>jIusddmgl49Jd=VH=LM&-pAd?*NJOSkX741h-Y;2lw1qv4Mt+@1{b&=S1cER zGjtq%Bsqga;>$fLUbXODxz;nh*9KEIB{&raPh|;K^xt9xTerx0+QR9K2TuG_FeoP_spNRUbTYgTzL}Y@eZx9N}F3!C&`M`vVKQs$w8mM^EdZ?WUZ~3IN$)N_G!y}k$|Lm2oaukh4;wtf$~($ z30FG3XcHOiS1OhfASc@ zZ`g;q3OB^4C;{P%>7MSeg7kkZ-7ZC=RBr)*zG<-<1N%aFs$mq$D6rTtjd*IN;wPNc?=kZ{E6K5zl#qb6kbtiyNivk%EPi$u`jshC??M`2bVuW( z`>pHj`?~s60CI2{Syz!z&J~GQ>tVRl3Ceq|={P{JwtttUzF$80k(Q116PT4+S}72n zxirx(N;+!g9P~|CRJkMw7Wf`l-S^sUsS{hdIR89G%LnK5p(Qd)P#hK&don5_GOC08 zDBT)$Y4-C%nmI5yrIsj!l(yH){h3=7W0?i3tD^4=8#8W4_zO=l_^ZAftKWkGJP8q| z`lPnHr(KhS{+yTW>mQA)E!73*>G0@~4<&i5qJF5Er^*OJCKyhC6^|UACMoXb5|adk z_oCVpf|PT;8CyqorU|5MzL2vUYN^Rn=-79XBjoL7sBEx$dY4sZkIDokb1Q`aom4@j zl{fwiTjsThxHnWcXyf>xm85_6zOU%foU?fiPN9q$Qt`KKOBXegsw$&Ct=}be)Em6w z(W8xl;@0{La0Tl!Y*Ej@<@9*rgZ4Nc6r|h8o#qjv|1O4zi|!1V@w`97{_%Bgy5jK# zc{v5(0s!V$Ij_u>1B+Kdg7l2uR1qF$TzDSVAm9(A4!b8nNY@>S(|nk`n6~^&`o8mn z|Nb5w%BXEbs!e-V>&Dzy-v-ag%fA)H_e*0Dg@SB1Ua6U$(!k{kOnY;QzvXaUH-D|L z&xLY>p8rPcFT_x9vxVALrZM63;_-y?5hL4$CB zh&Fh>0!pFdNL%F0Y?^77R+ogF9cQCN#M7dHn~hW(222p|yJ=bJ_TtKlr{*-tpDPdd zP^Ny0dD8&pld5aISsYex-APsbD$id)O{=FmH z63>FyJt+xKt&Qo;3J;M@?#`gL?W1m{3;-00DLIIw>M)G60Esj96Cc7TCzA(P@&V0 zciG{6O|ptpQ)yFy{OZ9c&|;}5_QE^qndr>pT)2q5(WD*hNKiC*na?tDNS%dw@nu^O@XjR5Ob5H zqV&5XK4MZvhKw7V<4eK#P(M(0X#}WWG;zJz4=-~sOA|1UcNv3;49JNv5zpr>6K=K(OpHKP!TQ-6F|t$EGEn|g z4hUJBGhk|WJ?K@%8>9#1qOWiOxNis*`48+IW?LJ>BV6r=D^Fx+(#(=}3G=^*RPpft z^7W+kIB|0_viIO$jQ*u^u75{}>yb6+BX%@8lyC$dL1OX4l=N48+lOgXjJIR^ocdn> zq8OGZ)q|#6pnRsykEz@v$fs?_NTvmf`*+*o4f(Dpc~utg%&WbpH^bQs3uCMjZl27_ zuyse+Gwn&ypI>2WDLJf$^Z8Q*-Ox+XTP$&oy#h;IV@YS6&c3VQY`upv+q~GKYjgjcYT7 z43cC;mdt>(XtJcK4@mZRJtCe6(eEQ7&W)dLBWX|>L=+@D&Incq5PBKA9|rYzt>_Uf z%bOJ&+_bLUy6~h~dRt)WO5E5+1RDsG)X8?l1|>qP1%Vc0s?^8n;nkONFm9=g3THI@ zCE|4A@M#hL3^p8j#|734F%4caLT{nY^Z}+N9%C3YXs)$zPMsJFI9Bv$@r&z+HN9O6 zV4@2?dFq%2b2m4;7(OL>suEg}{U-EcZ+V?n-JNIug2WoDA>Q#0v`xX`P&!y|2oDT7 zVjY%Q(xIL~R@}8pq&AG3Lkc`VI4|6T5_|R%asU#y;)Cy$t(mb0&6xKIv4wz_J-*n& z#cG`$-MV3lKyQ$n1u9$8pM(N+aizMYGR($YkUo>q(Ae1WXYrX-m&4>$RP%E+aSK;7 zj&zJlO++l?rB2Q(PWZX_Wuy)lfhYL(lm8XOL{l162gFQ|2j~9X0VDbQgnmeUH9$r>}MvZ>(9l zI8#%BG?gc}xfV|VHz*=W^~f2^NJv?B^O>bGn}Qq51xm)`q{XcHv`3lVI0~r_*cKFy z;e-th{{iO?5mA$Hux-bU&-OQKp99vNZYCo7hIY@Mv5FzJ;^j3_~ZbppS?gq+Y3T7EQkenir$HG<-dRV=oS#rQaVzX9M@v2tfLc{3{0h*LM%ypl-0VdKbR|7 z@;=)Wk-s^V57%P2+#xqT))i|BrpjxO)2zsX5VEH?jF`=4F|hT!Uu+@sYpiN9ipDC) zX+NVSv>t$1!U2i_KbGAPvyQrs4ferfw+E|!r)W560mCNkLa%gRWRk$y2;i>Mh>h}% zwP+`XglGnY)D$!(-kpht?C)Kw;kUfKnKrt&*PowGw&(O|n_yK)zDIH>@E6CEdP(YS zVd@IF=Jl6>2)X_85xZxqTa+ow!*=>|Fnx7BR|GH9?D8~S1iVn6uB_IsG;68rAhHU| zYAb3D#b-&Q&Sa>oXHXKYvwCqqKVnK}O)d(6%VMQInawLYrdHOY!dEs10YvGEN4_W& zL`@{tox685|A;fMEq%CRaXWt&HG8==R*va?8&h{*(>ttfLg^$cmjuCxIFC6X-W?$+ zQ0p&XlAh3r;q`_}%9){%2$3D<`wk~(jDo!m``!0aCuim2X~I~s7Z&3RH>Gh<6(1u| z*sv!j=`eLk&1L9Voi}!$?0@EGde|=uE}frHf?VR#W?>d-#~5y zZ+8!$i}Ysks0PqrHz;U1=y}Nc48MF^ZJIaG$BFy3?3NKH`VQ6Z{0^HcrY|GGMihR1 zwHt?;g$>9^oCm{M(E6;o=G*SZ6PNabiZ`QTL!hnynqSWzT&{lGw&RMt_jiBcJxq|l zP{>~#0rHl1O#mOB*8g|%8xtj?U}+=ph%ex`SZM^dxLMt~AWm`y|PFSoPG*P6sUs4>psa1CDNBpX^Gtx%7T5=b9TZ+bKp}l9f~D zp3%Y9Sm#sf06)?v)F%da>-Q;=d10{5&Ri2z>fYQjr3`71n9UX@1Z5!{88(9LCN^Yy z1wc+EK|LWMDXzuxFt*AIDG+9M*8x{h<4kV=1G>Foid+%tsL1jlqDlJ)Mbv%!d3$t% z`*rzadpO3M+3=m|P?@=C<(&U!@0w46nq(=D*4tG>%Y{?ug+ zPLvS=CQ4X?%GB3aNsunxLD%W+r&jA88;x$H?OH}w(ClHTF3%uNI0a8DucmJJh-R}F z{524H4zvDLS0Kv3^lRjpWEH0Cs&?yQQBm8;dbb|djmhfUca+@0?>@Ig8l#@k6WP*` zQw(YOIYf4bOsV~pQ7kjLNv(<5?6P9t@Jax5Usf$5dsCmbqP^4QlMU!l$^}7GVv|f1 zDx-hKSVgm<3NM~izhz%gt$f!G$}O^uqn3u0laQ3KUP+Onytby2h;ZW=63C5^ep@%o z+wmH=*S3|vhlDLT?u;!T8Cz=wR%-%I2`z024YIY~%GKI$ZN4j6q*56SF|H^+QHr(c z(@w^7FJo9*LRvn=Sv;n_3+F!`Jvj-fi1jvZr?4X;9uAF9U`W6($5nR+n+jU`oUugR zG(}Rvg(XA>y11<_=gvEPUpkKZgQt+r%m2Q5kll4;sZQtv{gj!OdBkpaeeQF;w*gY9 zw3#=;PMOtFI*kli-vz42#e8>V2uqLSOPcJh#st@(S-EXQldo%x{VGWQb3vQX%;7Qy zEfTB&Zb7XAd;^vmh>UjAx!n|CCGTw0;V zfl_Yzav`_^MTFGfLLMk{lcf-0Efg0E04$K;T z{A#XD1s3P`L$ippU1tCR)}4Gui%j3gOkYasO3z5bPeaV6ga3CV34{%9R}m$jlDj20 zWjjffQG)P-6LX*eSSXiTO+BVSHnxHQ?qxz3OcYhUX3)}#^rrd@dN_IVHHgOXz`toU zFQ%5%^2A@x%E!WS6rt5TLnf^_JfFP=9s64LY_3{BK+4OUP{x$osV}1fsE4ZJSaJ3C zTTHk6dgh2{$4T!Tb^vxCr)Q0*P39Z5htJ$ug$Vze<)6+KJqraH`HW0$yc8MZ{{Z1I zcY!Kb4jl=2g^gpPfC12p4*a zFTtdubMO-AZ(`<;WUJo;vOY7Hsgaeiu(4$PVtu>er9NQttAK0n5&;92wI}mA&=o(* zIR~|Kt-bsql|_IEAmRQwBBoctCHoh9ojr!DU2T<^r!ECI34hl3zwuC3E)rrYYFezy zCWr|RvZq7*%#o0sk*w~K!UoM+_Kr9-Y|g#DpY8O>UV`BW=rni-1j}RMt-+!BiYgR| z`yx+a7g=R#=Rqk+hN@|Zj8YyP85krWOGXdM^!@cMxHW#vqQazh zHR+J~mDt?|mB(wS^hg;}vDA4zzr2=;IZgHMpt=^M80uV9=yils`>(^(exCg%ywHr z^EFu>XZRN`k`N<{@c$&MB$?=4hUYRy#95#j?S?0YsOd{!d9FC`-p0iKG>w)Wfg6UcBOuiX)h585#H zzuI4PgcK53BPmb@VsXHx61UmTPZ=_4O;Heo!H)}AGud&xoP(d(p!bDyyqvX~W51Nm zifeSZjR_$cZD>{Ek#ud3UIuk|*A>0W8sF09XgLU7X?Jqfg_W918cd`uGcQRnew!T& zFxIXTko<4$ubNi0FKJ;d!0{$EtlDEpC}x~YkY_28RU;naimj8Fgun?8OA{bcZUbCF zMzL*IvgxfEJM)09BW?A+>9;?BTB@}n59#ln?KG`j&pcns0~Lrq`YtuO0kQ*DwozF{ z-a6%j`L{Hkqw^H=x!1R)y}2feB%~yz5(RQpEtR+*E)NVjp)zJq8oE!9ajjDY#Gi{l zs7bkH;E4M42f+UUfbanbdf)-7HO>mM^y^TL#7sMs(RKuRN8SY=zMVKMWTo>TaU65~ zy(_0DO@NS(s66qb*o0a&m~9V@S|;DPkFrO~j%+#lCCt*ad4&LvcNkP!9h!!Q)`N>8 zG$yxfk9kp3rrd}iXFP%OqCQvrW%w_Fha^0^N>0%{FuHHFs7xUnZQMjNeVzew&zQ(1 z%HAWsQtc#|F(nthB~r`3Le z7CkIjUFGohmac+KL*pEeDpu*3RIr1*JCo}2!mWl5K4B_o?EU?G9N*7i0)WMy@>2+^ zwJa&lF{-}_6na*jEg}6{FpE@m+@n&FFs3T5aJ#%>lBm^%!Cn*jK zwTa#*)r8-AU8}v&L{MCdn^IEz4q8=5LaIG(iQ+(80WqWJXBQj6+xmyG2&bN2ZrYe<#kA=h$6_BSAcHJw6%k~kC zRdq>Ky>zpok?29KdJWY<=L4AMqX7_l-t8t8lh+MY@tGOl>o zCQ=7>?4PcVeUl#4=w7#l&R^@N)^)0<~YuO z3wBVN9iH1_EN3=mJK%=UW8PGaDa!h_t!ODrElsV7RyY%pLk~#{Dg%!_+@aqUvRqL* z6$A{5#PXVT1eC!li!4?Zylo<2?R`Fg)cUd&y9g^9$8e`V6kS(5uiFtsueU~PdTwCK zYRvU;n#1GUem=lrRdb+3Y}=X6F=czQi1qm!D7t`x`5;l_w0m>e%D3=tHB1xX1N-5+ z$FPD3&HT>VQ=IE;3uM*;IXFiu-=8I_wC&)mTd{7~1BN?w>WWy)30jz!;f>ohwwuu8 zaksbmxSJvR&eh29*U#!qbjChI2w4oN#YwzKV_8E1@cWg(A65{^n5}}7FVodA+OVo0 zc(goLvuxG2iMVqd@68d>-1(-@D|;vDu@bZBJ8iXP4jox)_~DM#3@48r2$-uIOxguh z%Gk%Sk@w^KR)&O-fdt+T+{b*~x@W%8{77~y7==0T64KN`O6A-kx-=91(UDLT z)QN9DK${M@oczIAwWFs)ZJH`tV5q2=TmM2b916=os1_Fph@}Tw>S%ZTWP-HUxLS_o z7k$4^FGYH`EAJ=tDR_?130sgE7^+flOuB8o;Uwpz~%WvXTABp({>>NZCk_D z1uZn6a?*HM@L5`?|wjVgA7RG#cGt1QdrC{+$A$V(H%xd8kqxd!<@Oq z^cwFgR}C?%#&o;Q`Uk2^8K4ggFVfdD*{@+gfbNu!Zl(KFAujd@Ixf#MiQ#D00>1c? zS<%=!uyif5TX#({;~N5ubrQOFR1IPhj{>9;C07bp7<_jjc5c#+v>+(NK|MUsvUNAg zIxE}Taq4fu27E`rV%s0f&5WWL~6eIDUg-y3d{Drz`Yaj0qt%ifadiqn{jNU&L$RR7bfD^x|x zGLN8w3le1@C%ejyg9QD#W9x#ys*)!!JaT)}M_Ye@h6G~bqEQXmJVu^^dwmG zeO)#ERNN*##BBpo2b9Nf0k5y$-VJBh1^Hs}25#LmnoobIm19Ay197S7Kv_be+37-n zxWa-`CST@KrC!sLTDuZz18~MnckO6PkG~dvt$Ym#;)= z_O*3`X$i-t^SJxSZN(?8J9VTTdb=`H@MR2R(;1wE(G~~gKo5QaM z?Db;S3K5<3Sxlb;WoDc+8>xRg+ej?p>~Qe=f_fPUDz0Pov-(e3&%;$wjj*G^<(0B6 zV6FTLhLI7*%}<_==vpY(*ij=2Hdz78bc2X>K0L0(-$72JgS9^kNP)o%*I{f!-N*C7a6c*w3DoW&cA3Jr`(+&wX z6m=vfl^mPsx_IRk4o8AS9xz}Sk-7@k`IPmsbh;g`at^SQym7%QKY_7>j#?7?7F_zF z+Lrh#cYVD8W32l;v5Lb$gxgWeg99ZBhjBvTiCDyCJ`Rs3Cm;=x;^CvbXq;%2`aj=`#nntV%z~!94kqnm)3QMecV!;we%SZ`cD&pwz z@U~kFQ^7Q$0m7yM6|`ycDK|cQzgpgKuB3gX)-fGWZpW5mq!IK?EF>@r*n{eb=Km5` z6a)q&E9WNMLR_=feRA%)q@k$?pynxG#Se_E5X0*F%PJ|xs1+;%A({w%qE(Dvf|-|j ztIbzU#7pON{WFJ7po|I6p>nEYf9ct6*bdRtd)KlfRLxO~h|yf^44gr=Q2VLYLmZLf z6f7GYw6}W^|M_kO^OGsL9kj^R1XMW(y^WULjyC$N_h0F;`Bn$v{xJKZ!VhoSX9V+( z^w81qX?nPQ9#3aif4Vt!T07jK1zV|&H0ViS63gLaefYk8)>9L$fW!kOX#npIt|vf) zBz?MCNgSt%;doh}hUKa_wPt$$M-@>1pRDgv9HgS)*0(({i*QWixXx05{&u7|viBZg zF9o#YQ3Z`@hj%lTZmAqj{){r&na#w|SNIV^xCmjh;Aq_)(M`AJ!8+1lpNLiO-}$#Q^FDEhj47L-<0trnL=B#(yukO&>gQ=;1U5+k=*t$gKQ{|8P$vA-!C`F^|Go6+QXc2RqF{490mN=xMqJkemmeyUwj zu!=;4Mk7Oh->TCI^ije5ZD9upIjL?euB+VUI{M%CQFB+P1g;=VPUeEvC;O;h8XP2W zoCqGUeeAQ1#8oZM)UGKN6h7G{6enJuL~yi7k8QvzgO_jHv{c$)+W?| z1&pcOxyM{)sd4UlLTh_C)C{(nDM$ltZdP7q$kO*YD!hYqB%TWI!Lt~1xvhnOX-_ot zc*Ao8bJQ?W%;>sAa_U9!hEjz0qtrbo&t0a=$`J znUXkaJUdO1<;m65vI08^4qIK}&XR**aB$t`ATOqS$ywoHHcNtVxNz*7L7Ws#o z2_kj~D_|$Gy~Z4!{srzu!qE>8k;1n8tx1~^8`&)suL#?Av9pa(r#E)(Pkl!U5m{p+ z7KSfax@jHvgU20?RQHR-*xLw(J;ND$!k>)T@IM*x4)kZgWeT!+xNps=AeGr%Z!9Jg zH$FkgM@|(U!;9|=-7W53;=kVBnl*tW%yVRgU`VLVC|A}JM{FzHzwHq!+-!FJ8^HXp zdsK_rHz0vL-nbQem6Pqr#k#GRe=5bVLkkhe$j(j0ODfy}71&IY@YJnxyz`XMJ)nxLby}rPO9);L+lPGx*k?)X-I@K9N)fG$Qbgx0Q*0ugnM965 zVkFsbFc}P%8j}mP-A(ZYk`sb6}<-J9OR$G*>;)dUacjqPe<*s5ADY^<+$y>-`{0!c~^j#c+B-Ddcl3q zfF1w)5N4bsdMBxURZzVTKjUg6&MrfHqT1H{3p@IBdwcs6cBF=s%=JszexxNP!&^7Q zzEJ)z=H3K8sv_$fo*24QMkgxqI<6hX4cWwH6j9kkKxI*sMP%Oz0g^zvlXTMietO?K z>CV29u!ntD5D^s_1x3Ye+_%vgXRO;(&GUSxZU+dcJoCQq@BO|nC5helR@JFf=bZYV zT27I4r;yy!I`st8iZk0ET~fz*Je%nwp2P-tAHMi{&HB|l;#*0mx$$$@OI}&#*LRx= z4jNjxI4)8Rf9kOZ`wu~cg>4(He?zB33lo`Nw@ zb_fo_&#!-(XbM&N`8gfGHEd9*!J;v0r#`ZXWg>DK*D(AY_z3pBRktzl?CQzK;a%8u zbp0vP{Bk?J3SL4A&FNKgEBb`ZdtR{|+EY)5zm&_wI2DD&N!J!wOO930o&z5m$Nn%} z0lokB!eLbr>!EyR#l$&-mn@tIkAdSAJ_LIk1M7TEzIq&pgKI6yz&esky$NqEdIg7P zw9Wkwm#9jt6{Z!I62lVIrm_*TTxML%!%pD8nd?`qS-IU&4KxdWrV~5qzy?dg>P7p_ zPl6Hfo17JHa(A;Zpnd8dI7(jM|J~7D-m%Xr;2GVNvWKy$v-B^{+)KZBvFDzK&tIji zDR(!0X`4`90p2`t#lP{@chIZf{pznkUSB=!xjZIkSF@{Ff5q%6g3l3h@M9-~XkU6S zz4vh8i3js?E7)x?o}uA*nq}3$a2Sq4OWiLoza5TB+uQi`XyH(HM?VFy9-oarRYs<; zN7L5M3M(6NtPSB<8>n^TC~&u@mgI!>FVat6>`AX}p^a^p23l2*j_4x97QbmmUEV;b zI?=MOt|cCV*MTgXKjcneH^TV3sjtCb;l1O#zvI)o4uhitwB)gd3GdNcKBo)+u7DUx7aOH+2g&&Jq8oNbO=3`t+Bs;O?!}>UXG)5-_Z=3+e~}5(;M0|#cJ9h49w2y zLp`C~>JjJ!d4w;Wd7^Fu_}pf95HxPJM~wi0uqWX?dX)YMvfq6rb-la@v<|h2 zutBGL$)w|VR?u#d=9CiNy&!q&r<0-sfi^AU+gBZ+4=j$%D-88bW&7B;Sm zYoEzqG6|-UQLjGt9ldt{XEA9#6kTl_f}PT$dF(P62M<-lTd=li@9S$xdqijnHY0tl z;I&s<%Z+we1Z8L-ReXK*JNDR%G&4QqwNOvv-q$mK`nyo`=-wqS0XMfjX)k)0gbN-9 zmih1k)_Weix8fm~ijpyw-hjZq#j}=gV*-!SX?NJ1Kum~8eF13RIScx*%vGU73fNKg zR&WCrcDFD|bzpZMtc(A!{x2;r?%lonJUp><#H1NBeh*I!D5-zHS=T~y>OW|wFKx`P z?|Eo-N%QfJ*FK?Few>>q6i+0d5sWd1vl2!D%ULny0g}6`u%d0+@u4spW{ri3u%My1 zb@_p3vF!`tY4e2H2v02=90?L|1hk0%tYyIoyH5eVx-{h3ti0niD=W%Y$iQSZAr76e`?;gQ^|&TR-aa6U zgrs3Bp!V^@@QaquT)3oOy9QOL#>0=vwpsQ$+KIi^`hg>MAVD);b2;5^my4rJbHw2! zL-K{Yrz+6^qC>G;4#y0ebnWZDqe8-oHTd*S2Z}%p>XY~3=(pZ@)bu^=SfBejBHJFq z_Nnfr&N3%I1CPbkMPMHaZte4j$`0RM66Cj&|4STr+~G_*o-YJ>t=jl zO4z-2FW&~L)Z(aA5KR> z&}doi@hJ~2e+-_0{NSqQX=nqgmj{bMiGE?xNITJ+K&J~rBJY5_$la@@%0&d+Ue?w= zTPN&=^_6uCJIVZQwm6PITf;jypou#U!N;9urzr{~>h=b=&fGQfv1g`?&4YOj#jBTW znBzt#2L{}hUxosK<`yLEGbe#J{?vK6%OEo_pwWHurma2>)b!uWigd zoV+F3N3hg7oGX#uYvjc?Q02kMHTTy&i#%(2taTU+Cu{)A7=G7ny-w1;3OLbvviVJt z`$_%FYd(dyNv#c5DtJcpzb#5q$THCG*?9-+19mSztl{*xgf@FZo`5g3fd>}(P_B8l zX!g`$SpM{pb4S4=gyqp2SP%Lr9Y(LCa(a^j-k*DH`diPRDBP+!i0_ACD|iiFlSdbt zM{-~Cl!M)6bD2GM9_s9{H{c4P?{4=yJS1n3ie4$|Xm&!CmM$6P{2Vzaa z7ZVg>9p6I@kqCM7O<6eP@!(Jy)%kQzGEbhve(9>Yr`Y58h|Xm%=N_Z;lQV^1Rr_dU zHrD!(Jol57jy?Z7Rnghf2|}MY7Fkhr^bKsKtJ10Ql(^OIia6TS$U2uF`@kDV2JeQq z!L^+JOmdIe);d?)*KP^>*YX%4hkdaB5k(H0B!11wYDThh>%?a9Yaw@k%AJLBQsA5G zU*J+Fx=OsDxVrO-lL|}S^lLs!4a#8+x_YsHeMbxJyCs93dZp^Moh_NvB327jb6ghj z_+41G--5$5kH@345mq>AExkb&G`o$8Qh3C;(r$F<98gMhA&BjAne+;_lbs)j4f9}A@Jdb4O_)42{oK|*a|A6=Ear*2yy5M>CerY^%v}}Q=&tfs``exF zK>Wpj{s`M3v6Um}&;GVo!aIQu1xnaGzy`x(szKu)8`P&C;_^z4&Anu@ANkry=-jL`T|ocPbP~H@ z=Be#no!}OC3UsnO9)?I%%MXu^lk-h0z9w%XxQ@@xU>Csebb-l`Z&8tF>Ol`+9#f9{*g89JWqxbM*itILaE4y#}7M4YC zq`IHz_w*)u+hCfB*!lL^EVt0$D`{O<)e&zm08QTJ6Yu(4;4?VzIAUUWs&u%1A@?;; z3H{Y4w&cOK)_+uOh^{{P)6YP@tb1hA@F&?SHULFl&6d{EakZ~)qHVPe=&00JZ2jA| z#(Jtbn9KIlJo-oBRYXWUq|kM+2kPfwN6%IbSo%!y%vrOig9>H@;iZ_{7lI%O8-0di zD9}H*wQxJVgl5qj=#B5pIsSlRJd9rT_>&8k%$fFlpOr1r-pzM*QQ=t3=kz%tM4aH) zjl72`*wqS{60T^Ui~i#N#dlUd00m@j^`f0`y!Poygv*A=k{zTnzGRywL5iOej`x#= z)lMx`l4oX3oU=kxyAg3%EB!-^&k(%@owT!)exS+_pYO~>SNBdK4hfYCO3M{&8(ZFO zrF=Q-O!ertQhuqt-Q(`a%Sl~Y@I*Dg}X4k04qQ+CBBx0NVj@Tyd~Q1Za^7mwYBIrmLno9ArEF%z}(JG*cerO zmqoMKQk}-TxkR!uqD_NHnx-Gxmbl;Ke~+m+ zFF^lGcu^CwHz-Li8|JmP6v8Zce*UCUPy~}av)9dBXWQ*)aRiJ`8xRecm3iz>S*2hK zDSY5^dweKN!(6WB4NhlU(Y{r$!}sv&Nq8TQ%LLDHpsQ1Fr}lv?hs}Xz`erlT zEKx?EPw>4cKA}ur!tT^O%toT|$&=5sd)MaCwr{e&2`(9wm!Q!y`5?oR{)+z8B~R0K zlbqfSiE%M@9ZA4ST9k4F6v@tSo)|})z6n}67mg&vAy`#B*_Q`nQYuo9f}Ry6K<1lfBGlQ z;M3CV4@}E6?3!Nek~}&=yi+J!!oFHt#;#1PrC%+|g~yP-4%c2O2;p8S2w~P^T8X~guA;a&_7EQw=x{n*wtn5l z)&nlmoTYLUJNSymbSUB_HrqXA2q#Ta9540>`xNL`vj1)Nq0OOJ(_H!t+bZ+v{Tk4d zq7|T#NZkQzpph@L@wZ=q3g5CFs5=iMv5%@U=zpWITdEySJ?J?;zx;OgeCk_S+2nj} zzJnBH#hvS%321^%(8#k-cG)%}7WTV*?hv7aMHd~BYLa=Skh)~W98gO1?M3REU`M*f zS!kQJ>qt%+R+zOKxl=1T4rkK2$-4z}6$&a!+|_5)Hk?%q(;vn%8eChjgeLTOq%t0c zolSY-K4%uyp1w-v(Ywq6zCFt4x%_sjPhR5$NPR5pVo!_fMQFqH611FUkGQc*GFfhx zlAn;QAgmzukxUZwbf49V*Vks!*~$9^Q`q6;C#Z9aY7qD*EN%x$?YSsn>$Ci5vHW@> zW~F|X`L#Tt9SMQECQp1Ns|j{~fPK2kJ_qS& zp2Ud+J%ztA#gCGY2&p=`y}xk@q8d9BuARY%FL)5g8bUvjH^O#w!ToC2TxTg- zFMGS~kfV*HT29|3i0$B~ccD_-W;%*Ym1gY>De%W%<%?h;n4{*HeYL%ll*z^Ev{5LV z$4+&Yv1=2Z^wd1m2voB~^5I0ro_EC+?{?F#FS&kQiO!dv>gbJM{q!$-Z9i7Y%q*8( zg4&g4<)z&X#xGq4BlXuaGQ9p`GAy2=dsC+_ZUQRMF72vA>x$L9Mqhn5lTM{41bV-m z3g3ME?YDP-#{QJY4xJIFi>izr+fLik1Hn(2f5Y%W180q4IatehSewkmDn6he3jTn! zdD~<4p`phC_5ihjj1Go9i{k9QF3a2uGNr?z%%f^1vXyL;%w*s`3^DnjN+C8wBQ3+u zP_qXn<}c_6*O8`Pi3OkT^o`~;LsHakiO$J*!s;IZcdjv5<|M5{<@ zQ`RDzZjfR{I>791bi~pDW>;hlvW0P2+r+U^B;g4-+b}2X4^_*fY%q~J6`IA=!Hhk1 zH2MaO)Mbjd(0>WA&G$*m>#eVETm2%!#zSSn5l$o6f+)LAcWD3OukYs((+k*S(^TS+ z8}}`xlkhXSZ%O|tdZ#VKclx-Uf#8Wl@eY*8J|R{%A&;%iT4dJ`Rg@ITx43qrnruNT zx11Y#Idhx;5f^WW{{tI;fi z(5uadxlqj2x5E}tff}?Hqe)NLwd`5en-<8>a=3Z;iEw-k&$HA%jc;Ct=V2w!^AaTN z^#uf(xQ>lrKH2PXPdd=faGSCb4Rj0ageESX1#SahdWd@cUO%Dt(+WC*`DFp={5Tj5 z<%{ivoAupj)|=63knHkPp!cfy^8O9b{BvAXRQ-hFn{$NTeuUn6BvZUeq{2nHnVO%) zZf&#Ev9QnaZSn4LNS0h}0iy%V-n>@JMzfP$?;Nm(^`|3L*( zdVOyw2FPG}_~pi}TaJ?4llwl|dJH}y^age{y@cJz9%NUsOm@8j25lR; z`;l!U8)t`~!S^SEEnta}+)vEa_NaabDT6k42ki^8I;XQL58hh%b@^5-ZRvZ<-i7xF zz3Z3vf2JA#c!=GhfFXsW77kR;T{I9LCu%3uDQI6*p)9mLOPj^9h!C$&jutFYyPFT1 zb{iiw7pK0Ll}?(cTg*E&;p#+}w+TH5sdJ{gOdSw`AP@6I_S3s)6}-ZR$h>^FjFlA5 zhEmBy?Lz}~wnHc5sHxdNSe3Y4pnNxljU&ssNWzI~y0f__z2*pgi_9w>@Yg)Wk*%WNUeZ8uSA&>BCYb;UJ+##CAqDT;{g=EnWx%5BMZaFuKXzbS?JO zJn<{qB;1>w)3;8UB7 zg#sB^tq@i6>Kdr!yN*0o9+{5k6TcDH2|m8n*+XheL9Ixs1^tGOVVBxB??Ubm$+;T$^BP~Gy9B$<#zR#Ye3r0|-o~!|f!%+A$z2w&A%be} z_64dB(aV0K_tBf^6(kh&cpwNtt6LMj`$Kjq?R77G((bhcwK&Gx%trN;UIW+wb`!gr z(3ey93$s3alFHa0C{Z@9Y$~a3sBLPgZ$cDyS>SnT6Vxj*i_jtyJZSI2^yGC zF%X-3`%@E^7cL!xGJY&QwbY5S_d+M%cxg=D(RGgFvToBza@NVjbDycmI#cp)&o7gA zxZP{=&Q4YF@}8H<>y>;(aL1f{_e#9NZNX98s(;2>$DR+bN(?WRS8P**)gmW6nQtc-3$@_W>A+B?I6XH@1?I3K3H46HttY*K`)EtO-(FWI(`t%%+ z1xk!2JE6&oKAoJErpr{S05+Z7JQwI>8Gl0yMzrM9v#gF{lN~fXl57c4rYZMAeZY@s zJ$ccmS7nuh0ZH^rB+{G30s$K&RUz_O9EVbTypvkdc5fB)w`PhzBySVEd>v!Hg*c#Cg8UelUV;T+_f?`bK7A{?$6iz?u1%g0VfTsy1=iK*x>Tsjn8tV>ze36@E-@@N)( z^yTgkUK|~%XfGzY@dGmtl2Zduhn{(UlPwvbye_p#x3Fnr~fNk4z_!_iZp<-H8s=hP{i z3L6RzKZ07>&#A2KOg^CMDPGr^TZjGQE}`VM;>)`m#KC zgG(K@`hnyYdLim|#Ss8^8#AWJ_1`XeZ`?bCEo4rCK7}ayFOSsp^UNVRt3>*CMzS$^ zm*A2@CZ}T@ogO7$<#3pAxO1CaHbTER{h-XRahu~1M^o!ZDAtse3E~c5EvcQ@js3)$ z&dg*_(JP?u>_vMVF-TAvrNTr~yIGS=Z!uVSDE)vnVkY7){3dF0Nl~PO0sg+pqxKU< zUY4~UiM1onjD^aKeAE3)M!xTY2xIKYt!hS*d zPxb@$aVlxYV*1)UMNenO=lpkO@)@yHh()kn9;hjE@-u8UdzqRH86#8H4?n_s0J|U9 z^*nCiVCcW;x!UFG3WwwAsj4!&v}hMFMu6~3coK2)-kY+Z{=_hPCD0*2ucQi~cf;57 zUM_9n%bf^lQj^(N!n9-320D5h%|fwPz%TI1_>hjYEECquia(G2!ER$&s5T0?873Uo z^9c55Fc}MoeFa*HPG@B*lU1ZLd2?8wzu-fS*~Ft08vN1)1$$Uj7PRmS3OJN@vcT`)4ffbQHcS>5-^*jR8?9JZpQJ!lLe%Hyi*G?wfZt27hel-vuf=6U z?pW+LD^J*Ci1brlD3_r`ONsB3!WvycFBNt5t5N`6EF#C0^2S6_fNv!%TH)R?n@!KBOQR!hOb*z9ZW$j;$-FqzSw zL46<7mp{%-<|D4!48D^!eyFa}gGsRh9K-I6Ja$w9({ z*;LDhqoZN*^E1X)gGEPJA@-@MlE*+e)2Hr$FGA=%aSWY@ewbIEhOU7w0WzT}gh%m-90MLeIabTPmHJ{zZ*w zz79y9*=d<53gU;UpHm;o>EGxjk!+HPQ81?2XjVm><92z`x%hunqWqx-9YM^J|u1Wa_K* zwt-YCYpL71Mj?KghMB2vc>`L3C0L7$?O+E45Vz4dexN64ivX!@EKc!*o*fiYtw0m_ zA%_h+AYO}gh}UI`>ygoevU4nmeNLw9EyQ{!i&qM?AM5`HyNX@IdOyzYRHQPq&K{$t z|CL4i&<8u-QEZ1JhW$%UPJ^eQkg(I|UdgePbT96Z@KAP+2`d@WN#$uq$vf#_{yS6L zNskLZKG3*e{)5H673>v6X;LAGCJtsn9n{p<*VHz7<2Y6}TWU%hN}v?69Xr_Vy#eAS z0!1(Cb#?`&0Z*|0iqs|Dp8t0i?M3@`eyTVChbwj#9Dg3hLos3heeRVUQ^{{pCce_O z&Rtfnz#4hrs*;jYRk5WUDxk<)TC=JiY7oRCrRUyzCF{;lR&Lz%ans+BGTOa_|IT8) zSl@YnRy+&itERV)*aL^5i6D7rUqQ0j06O4Fbg8bO1Kyzh6*==dX;vqFwi|hwVm`fF zK+x$h0C{%q_Pu*IZ$FS1gph-;6a>4WEuS3K(y0gX=+k3I3_mpPy}U#4it`YVU%I_i z%kCD~Ky)kl76X17HH+SpM{B#i(I96Jvpm+54Pt{R{-qD+(S~mNnpMrw`LS+LI2VgBbp04|BTDKF>+r40HlAkUo@2-=zK0 zdeyIMHx5aw)i+&x6;MMu>ESfHU+p}jC2TSqAlyItFCTw=>@S~w^w#J<|9Rx-L3ug< z9MnW7yhv}@PbV~CjwZTpA6?g!d38?mAZ8nk0~|XnJe*DcNaqU?W3?uLf*g@97Bsol z0gZoL>(~xLZ$2uE1^jM);6@wcN5RY%o1L)S{xNzF_+>F$VwIu-D$iVXIFMz$FVhCp zQ6mbXmS1&P5wh^B4sRLFZXP46G@5MqpfXZf#bf3~IOxp$fM0c3R&5N2s{;uIxGg(* z0A}kZM=i0uD3jXpXeXW4NgqwOmxb6!Qrtt&o@942IqM7TZp3u-Qav3_q=Jl8L5*qBO!OvdLLR5O%9BWA!`Mwo z9N#l|Grf^Mf`4y9seKf`zZt!+NAli8!Z#MQFPyhLf6;>Wf(@N*Yt}2IcAuj$bzyU{ z%o9SH4z!vO)a20?d4g}6(nIM5t>gc<8%etHye2+Euc4RGfdRsHW#O9wy~juec6o?B zOxSLDF*_l!y94Y`yp=-<-7TjluF{|5x1{m>+EM5r`bpiiUZFH$%cbPbX_MCc; z_JnotmF2@Bgw1CQWUQ1ah4F8yPQq(&vhDc3Lxe8CuW{g9AncmDb|^dqLza)2@-$%! zD1JSLEfrjLKflY;I`~o66BfhW-iJ;SIv=0@PW`*s3xd%E4hIn1BOlP*Gd$1hq9aj$ zrlvF8KT~SXzv!LagK*q=VGxey?w?cN$bUBo2Y&95t0fCwU!}-djl;`9EOyAIOmQOh z2SUJ^E2wG}0q`Q^cez}M zlBKIO*EoNO(o35@*hUp^z4A>})D?3XOY^YbUSu zWnnezv%mjer|wy?&x)^uCyM$PG6nRmY5rc-6X>W#znJLNjvt8!YE=p&SkN!9+wJHl zI{1upzGI-42de~4(dRJ`RVHLH5k z^+#vbnR=NzZ%CGbl1Q3%hwX8H$22^c%0jP0x1lI*a z&MKEf>Cow?U`e`Xc*G!J_eR*Gf%~16PBZEUp!*c{?(n?g+T~0H==DG^A+Q_5x`RZ& z&k;q7gDqfVm2~nO;&n&qgH&Y8e6Ru?9>eeIG&89^I+t1M`Y zRl00W@LKr_3c9&o($q+Y(xHt_GA9qx6M%rttq&1aLLU|AM8wk1;J=AK1XK@FA;b`=FemCh0zYc_B^jJfB zLPxRD%-Ma;)d_4A8-?^sUhai~ab&w+pm(r4qgtokZ#^3vCt!DJBZQ5jqcOYeoH23A zbN)%oJH?xS>?uC}Iw^2 zDVHy6R5dG_8|&K83lrb%qyxIUVKK=KOJxc;BnPz@x?%jzm)~~7v_4b#j34i_`t4ql znvoowj$I=;O+)0;PGSjk&EG=DBHS6fC4;(XF7J!W(Kc^b)||g+#quRfT9>b1v$}bM zf<29Xht6wrTGO1@gVAk@8;MxQAcg;AE8dV73P%JDaDu4P7;oU$tTfCN-ujXmoK&1^7B#+S!dVg#2Rsa zs^;A1oN_onXL`A=tW1%rNzE5)vd(>O$Xe>Lb|}OG`5I|~qDtCkk)Ndr`SY6T4j{JefeCq=v+v&qDUn3MQb-&Hz2K?Pu{Eo zH*ev_ZnSnFtvO$$vnE}bb&Kfia;4wvM$K`g=54t&DItA+ugd{=jBcyT5U;Mw6cu!s zKyPGs$=o)#oiF6^#b$8xTTIDaXg5cnl102OC-{gI!h_A6TS6zv>@kpTJpqfof|Ri5 z*v!o`v(;+J}jERy9U z7j$OQA+$*to}F^D4FX~(Bc$*F@;##~*U1ZWiEB!}B`$y7m@Hr33uVvEdJV|1C$Of&KI7A;@>enl22 z_gRD7n)-b)A{8Z05l;xlxY=Xib5$mDC1I}A0hw9jI6JTD=Qp(05Q+t(scw-4l_Bt) zF}^N-9*)P`8q_NO(u$2e@X~=ydTf*cev`M-wcJ?}FK@4GHFY5F-W1=n_SLH9P^~}a zkNFb5TH>p9*Fp{K)OD_0yK?Q4_-s&to?nA*3R)8OCVOo~)iP4GEWmG$onQX^l5rJ9 zdX=ftRB0|VtIR5!3QA!{WNzaU(zs+z`8F&nAwjJoZACOLP8Dh` zA%ntzLyV)$o?lV4LbXCwpj*r%1o&2lSB6(qFRfo$T^i8@h$c`PD8Z!ks9-wGQ!g!8 zTA-c}GeG6l2l>f)x7$bDKBpHEaC5Leo`@$Bks5!Ezt&R&&Cq0S)HUkb)Ey*z7s`B5V zszbT z5eRFC&*?x}jj7gF2fMInY;Q+3k4wy33tg>UT2WM}B!$YQ*jz2>ody^Afew{?(9Mt*-hHpgP;ixGAU-^=5&NUIrA>;#{~ z4}?14J~n`_g#Tx+-ymQ3<9heu8qA<>VhVZ6^I#u#@Q=GEG~=N zN&;q?*W$MXO+i!G95F_WQ9~7`YEzZzaN*&~L+}Iqu>Oa)$huaUn-harYgiB7JvI+9 z`eYWb(QEKy@@WIwKxME3liFY5AKx-Q_B7lDcP+YWBw4&dX0x5CQ@T|e8;z>!jfB5@ z=erHx!ng4Kf**&Fu)%NjbZyV^c$~bl96F@`zvv$&f&8NsI#R6W(Idr;!iemoEcL$d zSoY~YG+!8*o%)ha79P+3?HvD>VGewi=NOSKzDP$1zr|&CTp#!7J+UIQ(a|SDXG;| z>m#O!DQ>PaVnXY%qr1&IeMM@M@VhMe`8O;CiE8~T6|3oCK{9p-cXbY>ZF$AYLS>OT4a-~aFt~5HgbFSPkP+}nv=G5zqImst-%89t=L(x zxnT3Wx@mmP$x@;((U<8pm`W>FDN9u4m0CT~;#VpICW{IdLP4~swWzgXt!=ZT-V)}p z#-alyfvHu~+vm2=?NsiDI;i*7hw4L#P!v;5RYP5UZ9EnUkqCZO8^q+TMeEdF*;3e2 z7+dU~>nic;_)4ia40ULj>2>dX{0`FDA^y;jDHfyHHkajWTI{Xe&{@;I zv3+Cp4%i1RmZ*-$*D~wTQC_53R=l#Xc&TO~%!k>D>FWqp(1&D!peMjDAUbD1%wVz@ z&>_7UP422hX;c%`1j|Du!IB`Ct!Xf?v|vHO0`&}-0)<{p7zh#=a@9K5M^`sBwlsA_ zH^3&?TDEgBVG8z;%xJJ0&)0oF_`LxHaX+s=KrcB!2X~$sXOeZ|BSKt`;^Y36KDp6= zl|$+)CTv*5&~cmnXB?w6vt5TV=DG?ULfzr>hq)U%7ncGHpIT5ARV0Rl)Lr zCPXwLRaJ4FDz1*4Yo*Gogy(rH=NHVcm<`j2(yI$9aA0-2e3pSU)1Ap%hP(}*f zp}_o#f)y)QtSr!WX-7a6Q2Q%`mBI3;GEP<{%A%E_%1~KQ>Jy~)1(;v9bkWj9YNQsF z91xK1#jn$@@A!bNu>dG6+5}KGkrcW5o5RGGZ zqGLVjSYNdjsXl!f6EDzwiQ^!C196ab@3XYZ=lrvKGt-*2PJmtNEd?72Hq1+K%~DxP z3?+tALxsLVuT-xnd1mJGtL6e(0Qu3PrlO|GR{NUn+62?9=C&_vU%0t+HxPu;-uhsD zuqId)stVOrx7NSBeNV$?*a#ik=Hlk!*m8G1aiRwCEBd@4)S%PZZ0>J2;p^XN!p}Tl z?tsouaFmscnZhU>W!PjKY;t}M;Fswq^s7yD!KTcv7uY@cLIvp4hTiC?bQJ4KRHdrY zmHHL199D)@wW?ZOouh#`VzwZ^+)M9LBWN1f;TKNqP0?Yfqdx{|u$&~kpckgh~oqSO^Z0W1#} z;nyY2`qe<%p*d7nUsoS)hBm@7MhV4G?$w2KA#(!3WurF{3VJT~jCv3@7%X~~!ak>Rap8)>6$NOp zN}){B*@~bJlR8=&N6xt%PEs1LjOYXUfHtHKtHb5~3a`dfA>Di{&xd9DB4v@Xv`AB+ zDKHnnQs9crZ&-76X@-Y5TYOEyx?o+jIu^zhh%kmc$&nm~HnPnuij5Dp%(cl?O zd|O>Nk*(*KWV%*+R(m%3wuiQdwk9?=Z*E@G(YPTT55|2pz8ZJT86?i2(+6&nnwz>q z7$eb9zqxCH^ev>rB|a@g^?sFNF)VQ{@htHy4lW2U2rsEx9$y|WYAk6hX{%go*=UQK z0yvDIJ#}#OXtRI`@*|5H=GQN5FW6MHsc38IHr+PeCc_#lSz}#oZ-pudIXQ>jK6J>~ zR=#q2Yhk}B(;rzmPrDHErKU*WmrtGfeXfYR&RgTHBHpTSZB>0$eM4D?(7J9ANZ%#}o>^I*` zz25`k<|x+zjaLH|pfT(8I=zJlNmJvfs1NI-<|=-GH|h zphFun#RGJ>P}da3u7%aQW@R0rh4TMXgo#Bci*?0N2+L5Pm4p@kKBE2VKQkt5H60*? zA>i=YeRe@xWcVNI2p$IYnq zCBjwyfY0Z3V{&<%ghT!S54m#F7IEg`l%4K^37)6E~?x-Ms&dB=M$m3 zXiR4Cnq1cNuSYccOcArw0pP?|y_uSS!H%8hjo0==6_tTws z4`eXi#5xLMJ$1^uO8413Y0vmKOHc36lK{p5Nwlv1Bw3G`>d9>J>(sTvQ`zD-D0*YF z`LtGYG}6r{!+wuB=edgppS1U{9@$dMKvsFCH5al)T*qbz!uV{_clxSshWGqe%EWQPglr^`c7Nq2 z-ht`o$cv}5#XWCyafCz-{&Gd?2&=ug6kz^#E(+4nOPIxvuxr?^opWkdZ{W>*4c&ysg0r(;2rvTy8B zj3rIVrcdCXsNWypK~v9(l@0sGU?C{|oiYbsZ*}O*79QgVhboudW%t>F79!T-(}0Bs zY>xsm3xA>bU=P{&-YKlA2piEQvH`Q-fBEgHEp)R??=idV=WCtGZ;YCV7-uahz9UOx z08>D$zcTS9It_Az+a=E98+$lt=b6G>;BvSe9SR~{rA3Cz^yKXGo^**L*Qd!GFLid!5{U0^ zJqwt8$$7$*Y&!MyY+-8mch0`x7gq_-XVbFOyz~o7#9IgG9a0Tv-U*6>P)ukeJ19*1 zy>~*%QAj4Wq&`Z&^E(xZ-=(sJ7qV$(kLedDSv+z&>+FlGX*mMyxyj3gDsLbFA#RE) zy(HB}XUPo6XWRMK-QYLIPy!9?nUsz_Evqmae`SjNuAqmA&8b_?l-SKEOY)7jrSrnYc<6gc;{3{`ey0w_y1d|5N#CyCAhzDqnZ{ z#5pEN)&9>+&>|DM8e;A~x}=#96Mx|pr{--HA5>AvK8SzWnvpE|_j5w^ZxXLZ;&=Rt z_}vomT?4U`6Yus)%#nx>BJq=MWK#vT#mE=0FR+v$BxDDjDXa1Y0@6?;HEnnIra8Kr zWEDIJz2;kyIx27YNHPEKL8qe8R#~{&T`|27o%c3^|gw zGxeF!MIN7T<&T}`I+OFGt7%;&?m~WqtiNI8&+#F}em}HWeyp5I13|5n5HKnm3O+^kBlGm=!NFGe) z3VyfO>Eg-da%195@!CCSV1*sqkJ5{NzFJmkkzj=$4X=eHFJl!_Z@JFSFH5~88Ffr9 zyVH)Nn+biTPmx5iBQ;P+eTEJ1Dy2)WJZaSC^t(y&a#|_-4QjCKx|Qg}5>IC#i}fB8 zN+vpS+>H!mNv1V??%#`8($g`r??*%{4Jtk3w;>H z<2G~(%lW|V^>IDGfm`cyH~}08`e%Jd`_jEKZ;&54LhJ3Jn)-nIO3@Z)&wKy5Rg+FWFy&iiyq^Po9ABPXH4AqsT<{zPdI`~iP8IYfJj{Xo_f@kjH}D*VcN+$5(< z#IQhnKh6qoO|Nu|Q|Yq;?Ke{P*_<893rv(7+-X2$b6MShAc;7fXzSdBHPT#U>n_^+ zEm_d(b90&I%P`%08<}J`A&dSnd`z*Yj*;3cBr(~5TlPL}EVEC5J^EZgrvr;V{-f*CsBsH#u^VlK-SE`k=+ujd_f^c! z{)-JkfNJI&fx0`3bXH$>JKHETlw0_rzitvM9gy<+{4f6e6P-m6VqLwyToyG4r0B2R z+*z;9Yx3J%#gXat)9a_zPiZ1knwC_f$8&;K3M><)Ys81Lvxy}Kk=i`L) zBpg*1Q8>Hr9hyPkmbpV0c8?xRMvIzXH2xN&^pSHCes1{1PU$A$b}r$k+0gOq3Doai z7m@Hf+Ver?VB?^SPte-rFOy|2*u6vL<|9{7j_i#9J;u!68V3NEkr^78J zK6ZI+ekld4Bw!6%qh_A4HLos{tt+oFUSLX`cAq6k*p-J^?jaf5L~j)6-{^yV8ISdF z)7A{}GqG0qziCaTu&es)kXfBZPo=NYXYg8G%cB+k3$TpUX>-{KT02Riz4oA$&|!m_ zz+RJC4Hq)FD>?+dhQ2Oy2i+bXB;9KZTX^EEKrM9;%58nz5VHOn{PFSSYkL1)de#4q z^_4LXy-c9TX-WuNO+W|Xar+J5Nt8Qz>M%5akTBB~# zR%@#(YRYTd*K~I5ZVPxl5?-}>q?;+Ml}1u&EUPS0m#9_cWo4xaWxNDaS%fcC8$C8@ z>n<1wSiF{?Wk=zrf;EfFRTZULwN|YzR^_Ym)eCg9b+auqU^;>6-WlQ9;n~#-YV&LJ ztBWJ*h`OpYt}4i%w{+Taqs5AXN(>%rK;ed+i)AZphXa8Z0dCDBw;5xcN=gspnEx$Sek%>72jQO$c-Nrs**%X;-1dmXp6Lh{^H9~rxE&ArFVX%7d#u?x+!-Njc6IbvfxqgzubmIEc+`HOj`SrzqzX z%_&;CXw}T}eB&}G!iHb46hmB9u81q-3i)G*#%sdy82;48TB=*B+oS8lWa{lQhr?>( z8}W=4hO){+Cs_1k4EvKzS8UesgZ;l|6e3db`VF?uo+v@N$3!FDA<*j=y)&x%wzCqH zo>Aa?1FFmox^`W=x@A=(nYn%Znj!V1YLo0A?Z@`4J65wH*a0owWy4lxtFUUVT4R|` zMRcg9D={roFRmo?Hu|@V*t&;OH_LK2Jg};_j%7h9XdGs{*>2_6tVy!K?~&yx1W_R0 z!>7h~5H&rVx(%`Guf6Qw@Y_GTIFKFi+Z(-p?bIWx%@8LD;9M85R7lufd}M1{!+<>zRPeJ#mys$ zn@18iL_q1)Gy*pCXN^vyTjMSBmig7eik*YMn?!G2P8?YesGnRpbJ@&g`3se^)%nKd zP>ftOpP6Fm60G2BExWg_+qvo0=94kP2B&WQf1j7!lBLbqQ`9BUyIOyEdDmybxG&+Y z@z%Ivd}qqJfmI78y{(i~{&~vyfeQyNWLKB6L5@<;a~Hl#MsOg+!~;|idX?kvnp3OR z>)JIf>K1iPWeihT9V`u&`YT-qOj=hZaaZ_F;q;Vw6$Bg+Tg(t!Z`H76Q|1;bl||}h>Scyiwn|&21BD+d_?&VCi*iPZn=5V574)T* zwkjHnqS7{3H&?HYt_#24M0-T(ZB9}X;*ikqNLwVQ8Iv9=fT^6U|E3`)^VcZ18ur_& zyViTpVkiV%F11hPQ~Aq+6;;LYk~&qLs=ah`DcM}Q>;Gx)JHVqXw*Gp&a{qlb_!bC+P{z(cEuDd4r_xJSt)1GP zik*sG;$4DWg4V2tB+!sl8gE-^64(^3&@CogPy3wqK#2D&()xdLF02p#Z=F-O;um;? z?*WlCP?01=K%#jb%pSWct$?huxjDH7e3<~q1S-BNUzM*V8c9!sIWfL=JWH?ME zz`EVjR9;_RUsF|IQeVs` zv2aJ?LHVoNA}T}y83Np|gTAHGATx@LB4>7SN^wegW^L}lwQr{WGoLd4o{UjTS5C^J zj8B9jD%y6|c{W+dVpM3`UA|*$6WH3+QFWmBK=DD>LEAywG1Ey1=*sr>8c^saFXKRk{ z@7mvWruyw(I_O;i-!ekS+we@*{(Ow7Pf<0#6zY3cJ8&09ox_bi-IKEHi=`|^FsM+?9-JaPODYV)&yls1R2&~&SB zmuS7Zayoi95WPUk;WCZ@3Jqc-K;wN%9=8*(=`LWF6s@UG*qN}CzYiXT=W34i4Qt4K z9Wu238GZ}zx?Gxw=QA5h*E&}G_BcUQ2AOuaL$O^5a9no=o_mArLlfaFJo*n>I`6ts zX5S3YpwY*uT)t6v;>d|3L@wWlhsAr-cc$-5Y~D}_3O4cDGwV~zHkEC1ZiE}*^J#Mz z#AWAY7NpD4W!Wmep0Cf+r}X1zaLRu1yQb^}_$-;Si%u+hBkkhv7<4aZ5}Z{^Je6`;| zBJYiM5~p!2W}D4PejGNN)n+xD3KHp8g51p@Z38p>26F&H-yYi@Lo#&Ogd zg;GX-6iTH^snTfmdbw1s?1==hK&Q3P11`S9gz}LUmZgM`?*@gXdOn=_p9xDPr{7F{ zKaCZZ8(TqcTv+fr*mZ=l+s(HAjO*c>LM0Iw2(mL%5&$l`LCSMDYPDP@5lKV}g;uSQ zX{hrZWSYb3avP16HJ$rGNOS?(7GmH0;@j+t;eAx{N@Zt5XG3#q#m?eJdjrjm*k{;F zp-QEd0IfhP)QYuYg;16+%NG|EhzdkGqBLQeFiEmOHYxW(8RkNeFQW&uN|V~chMbz9 zLGPjnYqzrI{`uSkX^jbu31#bTs{t`gR*_LgJ`$sNpbP3^UC_z_E-1DU&uw*p-sh->Z>P@a zw*#Hg9M&0?ggB#iV+k;NOfI^EWGQr%I!axI><&^<4f)i2w*Dc`sE~C=^I2y!JJcB! z5oZ*)1!xZu=6|xn>^r-IXoxGm*_gxIFx2kT@IEd+SKrl9UQ%4)sqxg<%8VYs{l(}p zI)lR9t1y%*orG!&olHj-0~sI4_!1G(QIcFy2Kgk(HpyocJfOgL(<32$aPM3T0+C@r z>`_)n9p!unFUkIq->hhmR*R}dr4kSMxP^3hEFzQKBsWS-LICNx0Qs18wjNbt(K~c* zom*KdsgcwODss!f^3Lh?PZjl3g8yu1=WCnq)xIvGCB7}Zqnv6FWwc9el^N9rfgu%+ zhf^(c9djM4T#24UPkKpCMNWm72s2QYs4CReIu`{!?D5@j(05ZC=oW^=p6||dXBOv{ z=kHs6Hti!J-Te{HNQ+ySD=5enXNofwc{;I9te24@?EG~>tJUNJrefkgJ56NWqe9^> zE_4^V%RRN^)9Bjfc%$Sa`*+l;2m~l`+t?|BQhoDyU&2ph@8_ct3GYoS!GrqgSSr0m z+9ERl>VT*&uPWOc(>0;_;bQba-B$0aw&W(~ zC+EitSBNL(J}M(VIS|vc4858-;K7wDID|f?`?!X&eoJ73#>#5;tGz!gl2Yq5JgHF2BK+n_F^yL=ym74w-{yR*de)9vJ2oDXo(EU21XnKv;1F2}zRsukM}4>Q*eg=#WATY6kDw^04CHwEMPirO#dqe=k0lo_gYmg3>r&PU zSCfCT_dxnxkuvTtYOSlOt7-DI&>LOqa#^{oSkB)4C=piVSLBrnJyMUfR8~Ph>Te~y-1!@CK@h50Vs*!_Y?-_VL&^mHTL zm%QB27KZ-k6J80Lh3-d>p}7#{LNp9#neb?kVGxvgVMz&!#rGpI)!D7G6Qg@}i4n)hHz-i&dC zf(SyvQ_Vd)qnF2iz}tdE_yzPJUPz{Z20w^}c!>ZCyk1!Dh&G}1=s`3Gt%PVkL?iI% zVmx!^htHQ&+!Bf?4WJBRqNeizQP&ow zalzb|L=+=A-CO{HLJY-Hx84@*(HmfKLC5-v6^`XW>dIM&wFwQrr>nz!_xmb%n^y=| zsy2ZJ2V-k5-P5+KqS8X42AwX0%Oi%0=mMCop*7DeTzE>U6R6et&ZQ?Z%{n}G(TjoP zd;=*&>+rO%_)@)07X_6TtzCoen^=QyhtsdoYjo#_=oU1*9Yl5y_0P(qyHW98?m@KB z_apD*^ppA33eXtNEq}Uc@tKUnAdka6c;!p-e?A$+DDFWDCluXNa$j4Xms^fL^Uvbt zaWWRg&KZ{sQo^|htL-PtPM!l->{pkQ2DcQ93SWDPrsplx5i|4d*^eJ~X>F7I-<4=-u*M zircoEOcSv$n^#&AL}9t&<~Zy}yIMX2DICG74bw&~|8iN|wBpsEk(2P*!Y;WT_!IF* zyqWW|X3Mk5!@9Q)9Xh*xenZUB)OSgdhKYxklnB8U7bjl;^YThyX>`A~=99MMiiL3r zPmr=DyLY_)<-Sq-<6kf6BxNfWZC%zG4+sT(K@h3Le~h%n(k6iU(WKUjvi%3@-Xt%l zO`NwdCgrt_2V(17@mWCZ|oSoqH(hwfM>Nme0&0j5$)VZ);m8Av!#t1&1mwjq(?TS7h&5{!ZFE^?UYJ zRDvr-;e1#?!FtM~B7bDL-q(!(0bUskj#9vnA}{7tuG}}Veq!3n6n@{H)(UX;KI7yk2k+^?8sa7uV7AatWJlZ4 zjE*qBh_r+3oYGzdF9ke=Zf7hMIK~vfosvL}QY8d2_fVe<>bD ztaOoEWe?zDJHRRQ5W3WhImVC1=Q$Ng$YGlF{1#zMk0DCyc&egp^w6NWY z358$^o`mmO7?-CbrW||6OJ{)K%MIU8KZ&F4e1pD-^uR;uw`9CN|22T-a?}OVjmlh& zl)so(Qlzm^_<5JvS+uvft8gzs9?pX4=`WB)OyVJBiy<`FOWs72&|OEnyhelB#75y6 z^$?8O@xZwl6s0KD8-x@Ai!MCs+G)pM1UQC+za)d3)V!`XwWOh>qqeyjpf(tXM>CfQ zUyz*BoYaxgAV?Lg%ScKh9t|gCga-vic#u!QyUuW43PQzEG&FRc?iXV_dDMecgcR2u zBq9jUK9wI!7f2Tiyble|(*0k5{vCR<(@l&&dYwmYl$rn@+xf(IahIfJ(5N%e*amuT z$F8lqve@^Z1UR1achbX`(P%_QxD*m3GRSLTHp&@z{UFpg*Vlq_?VxwFDGU zr_^f_@UR(}gCCoyps~+%K1qoW1luYa%gc)jU0WML_r*R8Xn$n*j@`9~UDfW4+QqG_ z!Ij8x0gL-Y0nB>&;y*>^bI0cWna#q@1#y|{69C~&AN15GoE58=rY^O zTk8(KeC*uGS8ERxl~@f1qY)6J#>6ITGU|;$Yh-i=y&>O<|JL@8y9o3!#s6RsO)a13%E<5yt1@DxS(4g}LmN8*=~5rE+Qsk<+eD56 zS5oE1a#g_olS2{IxmD=#=U&EtYQi@eR2E{`0y{L?4CYpJ=Y^lqhzoWaibWaiqPeu< zb5e41g(7KU3Q-4~o|*7;8+wfpLvP+6eYxR0Mak5k3au7zH^aCrPWi+M|S*) ztm?gTG-TC3#_h+zEH~@jJ^IU@dVb-{z$f7>oRvD2Cb{jAe}}jI^9!G&JC77vO$KNS za*wD#L!JW<+5Pv6%Mj2wGzLk}1W+_gJvxit|5?IItxv34Uv;>tq1x*OzE?O6X8w=52XemE(|r>4$a1n?67?Y!o#HLa!1rAaj#n-js63E@eJ znH%{@{N~Koq^)G?9t*i_dN~mZLad%#&WA_4PL@~Ood!c0@mUV^0W)^*;%qx!b5WuyLhbN4$#%qsWD5EFrNlzG~^#SU{-mEkqV~dJ7C~NB`tWToe+KN?Be$ zm@$u$NNHeT0GE>@h?W$WmwLUm6#(6hZzU?Iw7{Y%6d55q5U|1v-hKVevlm`sTrwl1 zXPGIS>zQ*cPaKVNC;-mpY}h7sWqbL>6u^|lG?i<0!~*B$5bqg%Lr6nqL~pEVLxsee z(vWdE#X(QKw*&nR{b}xgJP6;HHX4tLp4ZI}{|(dB$H%fhfKSwL)6sDBOjGB#pSEv) z^pSO&@Ytxn_9);TY0oDi?fLk>)r)Ta2@V>a`Z>NAM=YC*hv2`xy8(@jI)$a2pbjjF z8i^Wsc6 zd%Mr_#rMKByO~Yfh}^LGI#g(c42wA51w6&;>Xd)8yK+ zf&lC%g-^9XXAxcWow-Owx^tyHj9B1AarCbH1)Rejwe5CK=Q;anV(YnSsviN=>oolA zhvz?onU!RI(R50*b*JWswXaUB#y6QH25kvl16XrZetO-jc@1eTYnwpiW4k9SHdog+RBQ!TR)yqu=;@-rwj=EF)1-^B z>oV3W#H*((=Fn7)WYvKskQlV3mERoy5HY*mW}<{`fR35Yu%-n6Y2QXPLF?9=1Z>)M z%74e4j+x%n`h=ayfUt=l0O=(D;A5Tbz8~2xrm$V?U7*P#OlaEDnqEgdjomR$x>!(T zVOU_$S18Zs@7P?KMY_8`);-UfVo;mZ^n#4RW^_~_=8bpIkj5fn_Cd;6mjnVWoG)Ft zo^&@UDP$ zR`r32*mXv+CzQm?E6HE(_RH&h zU-7g8T{h$sI$)kLu6%(-(lDLPzEDh!R=rVU1KjO#Z)s1#7I?C_(^YA*8fZo)JH1p$ zEggk6L%c?~0D?3)(=cg2;LcZ>DQvS678Fp2=2UvQf>d!Vr%PW-DTLJ)aK%eV6pMA# zkCi!Ot{$vxLLyEl-18srp)up~G<-WxV9GWUw}iVr560;hXVP`?5)T%Y)AcK zg|V{}Po*4RP*1B)zp(rOAs&@=YdL&&JDeu&>8XZ|DqiVp;$>`Exh!KEdB6UxW5-T6 z{e9=EGdU+nZAI~QvB#DI(m=A7rcyG7_g3Q5hDXMf=c4!8(0jpK514qRHx^bj5$)oX zhQr|D2aTBnVx?qD^pzpuTWk_fR8J~76R8N$H0`^Xkj8vJw^7(EvZP(33cRa(LO4Aq zp=TP=z6p32=jtj;!)YEcYNZl)K@cS0Pe#4Zxp)?h_B|Wop*)9{2H}~hk2@s1*Ca(t z!z1^GGJ?8q><;tBp=b%}mjwnJBdq#Ug+x-v18FQXg=d`npjYI3eV1J4-vrga1!Q2h?X+Fjda8C zgiTNvJ4dUQ$td)fo`rsQ$f=q)Tik`tG{Z-N_rl&Sa>2Qzd>YYEMB zIC>srs^WQD(qSDFiJlrjE$amTn-ZKHLhw|GmZ1fVi{?vr^boAo3WZ?uR7Oy+ZbN|} zJ3A${fOKF`=zu}|DISeSLLa|hcOW0?lqxXwMTRdBv)S0J(n5;)U~Oywox9+gkj{L7 zMx&7s3z(3RM_+{Zb?);P&MPQ__tG4Anu+wibgAuI@)_(uzXQo=QeFRfB46&OUte+o zg3r#q@$qLboO?QYBAmWR`V6@8w~+n#-6MH3mK{Fx>Y)Q?&hC$$J#+EW+0l{sX7s~* zgVDwJ!hB=U4?M)<6z+g+Z5yB{8eigwHo*A!9k4JO@w)9C5!}$$26q%jMXL0ZpyxwUa6KO$r^6d_Af5v78zG6n&V|ETxc8Ng64$=kizd*W z*7uz+E&O%uf&7;2DseBO}Y<#}n1S`o|7vA&!dK`WcGv{2CxL9?DcpcI8?i@Ir5Kw9gXG9=#AxL#x&j z2knJRXg$LMpqrtKtmbrARZjEl4adiMj}aN3agjkEpfNl&^&hZ119za|On|gU+V;1G z`5*N^&bwCezu_Z&JUc~OSH58(==wZfbwwvh=rQ9mB0KEBI2H%9uysuCanlYZiAK)=OJoWF; zmw`I)@E}CJYA5=-V?W{Gcoa{sejmlRK!z0+FAu?wIK%{##D>xF7dVb$(#EIieoHpn&m3M5E0ZVR6;NoOS?IE z>VN_K0X@fi0_*7&dt|{8ydOvtBVQwY?nT(&PdgCi&qHrhs1Z|N_ZNPO7<7`ccnB^1 zn<88}hTlP>8I?(49>{w$G#Z>1fKtDI3>W?Hn86?gdV+^DM!bw(WbpU+43F~u6+H4e zoJQz>#UB?~A<-}XI9?x4|Fl55hhN6_rIxrnCcNkU%VezX^REtMalkKzB#xi*%b1YF z@%R;N>Zu-^LaLu~c?_pFkvwUH%|y}jdQa_rFO0!cLh=N>*pty)&uY@N-hf=+TBPS~ z8j7dm{k+XX`+pw@H1&&k2}9Apue7q?Cj~dsLdqwR^4+c7f8iwt5O@*?ycVox6{*J8 z`pZ+i`vRzH_YIAViEpE-T@Z*IyZs_D6a>7a(C5CN=yUX?Ps>AOO$vY1jqd{86GF01 zOyEe!k`ewWS+XcRYG1yYCpl;`8jkKjW6@Yl{^H5e_{oqQc0Wqn*Vp^F?P>MIV6NbL z{70L38d#vy!U=H6JBbHmB^m9~lBz?mqFYe}q;8i>3v2WSoe?OFLW3M)E_@zGZdo3G zQdF_2kr=x%2V*T1!Zd6)n^W(mQ<#H>L?bS|fFi5*wZ#?TGk(`b9P7pcSH^@2~|gWVlWpPqgow#EeGQp>FOvU7Vj*lqBN|b1#bDpaH^Y2H(eos0^AgfB z(=s=SS3{7>As&=otyAk*Ts9ggsWp6-ssNKq$^VZewLFh zRY{}SYg(ioJ8kFs*?Ai3uFA@TPN2^^246Oz`*?0V0_EUc2NT^dr%vfT@TB=)i z9R6m1OX;OnbSpdvKUICT=7$wsFM880Dx=m4fz@obM$?+^Vr#n0v(iK>#9Gs8)i?q_ zg=c5sA@C9Sc=@!JCw8wrnp>x_P`?kTG#Zr@-G>uVC;8lm65P>|-KDIWT1fQHV}#%D zQfuOI_Q6_SF)NHYL=inn^fRm6iiurx`DyY^ITh1_s9&B5?@Kt>U8>IwXuXBLdw3<+ zu-{?#Z3FT=_p{tfh^B1~)Pa_<)!faiR(iywb83BGx@ZCH<^`(J_EZBrHcxdllKTD} z+OC0ZSDY2y{ipCOn>fTzFa=vXNLwS;GdhGcJa1Wbbwe|#s3118*)|XL=bd5fV=CCQZK=~PMqz-u^o0?}1m zJdX1ETO5f-WrAr$_8$yQopw8%jz`ZAdBXjgs_&k|o@Tj--w4w~uH@NjB(o>sx=G*C}b)7Dv5RRQkhsXJoc zf&T(z72}Z4<52^a-fw?3p%se(zJO0L6d**W2dFdrzwFyphTH6Ro81P`Yavc| z9VgV+r#|%t8d~ECc_jxT18TjdPhE}A;QNVB-T9yU)IWx!!Dt>255|9n=+8{#4|Q$6 zL4lLDf1eEVy^qfE5`G-Le>@q2p(94&+wtu`j6y@BKZBQ!HGH%6o`1!?L1v2=l3$O^ zsxaUv+v=a-IrzovAN-FMxD3UR2E67Gl`sj8j7@tG-~?>oJu>d?AAh{~_Sav2JmsEy z#!eX(J>cG+Z|6}Sni;}_2RVhMP1{|CL`hoMLnn`j?v?BLdEogcWKbi6op^>76jmBd`<^48}h@ZSkDw4}I?AmS>(-AfpO1EiKjHi@6r?aU&LLzBoEQKIu44xiJ>!a`iJUTA$BpS->a+e-#hihJ9*Ux6edF=VA)Gl{Zs;!PfaQqVbFqGxT;J0L6tq*-P zlQU4c?Ln*Ckef}D z?WED-t_4l+`qqVXr+WcBO%&#Bp^t{pz|Ye(YH{#osqbE1X%V|WlplS?!Ktj++u1-v zIMb%CSoHj+W2q;WG>=bsV)oLdTi#l~ducu0tWJG*MQ3&e@H;qVbk|Er4?v4J73BxI z>fTO&dudlrIp}L(0cjv7cWGSuq`FB5;wo|hd6h3@V|2=*Nfp^SD^{mYp!>S#_a3>h zeL=&#gGnE@e0Ju*fvU;vs}7{m-S~zHdskQH0771VJ{uiD!%5#mW7rTyDUzaPymKeZ zPT8wLGKV`Q`RO^af!If>{|oYedP*D3mC_wBHbCiUTOKJk1wDek=H-PS$vCs9X&h+a zaHWds{8Q6U(teRb#eqVCV45t-&R_i-;mn6s`MEnSshK}E4!Y?zu4HwG`c}$hUNS{s^Y9eN!tpFvnwIYEd-Z8HISv# zNY?Nmej00Bs;pW_;|2-Q>bAkdZ^~;A8_qCD#S_T{BC%K`O5B{eNT@c*%y2FmX_|^xwE{=P8e>aKL$2Dj$UE~dV|iOFsD1$m9KA4ZP>J%{{gAOs5SLt zfR18@YhZ5aN^3#&;^xi81(n$lmW#kIpXkX7u7xU9U%EBo%&AO}2DDyY+Iwbx+45gF zGat^}^#>oC`!jc7wzjOZ`_V}lVd$NW*jh`;0v3`V?MG9VbSFJ}Zw?VyJj3jc7P z-DNWC?K+ptD$~pLI;}zqy5(24GAd$y8OS`aOA3t+gVAL70AHE!%++}&UO^*T$nRj3 zznmwR>NEz0LF!UE4Gx3BEwE?Rv`vx2(IJZKh$>uPv<=_ zU_0^U4%EW#9Twu3cq*ZROu+ylZllp^DFW#A%TE)-KuokXWssfD1WyNGT< zULJ9~|9f6;xo<8+>4uVR9K05WM-3g4^Y39ddxs5e8`?H(SX)F}&9Fa34dwiM*loiH zjpYuSGi1=-byaZ*Beaygz?+oBlQr_wL)R zx7XeN8E*}*l-G7g*d06r4N6hL2V)lH^VMo9TR>$|TU{65LPHPd>|2$<&&bRy$=DWE z3kyrkRuGXntBM#@<6f?;IlOPez4tDk5E~uQw<@;w8BP(CPI`K-F=3W zCsRo!E>&f8gq~g=u)^<79w{reSg0%mtJuYp{dn=e|A${{`QH@5lE(c52!s^jE|~_oI8GB9?Dzdo3F7uKK=iU+3FL zYT98JY>kI6!uZ^KHpZ-<8JoEQf{5NIt6#?UMSexpZ>dU4+p;Ast!hhseN|O`R76uo z1!WuH8^H%50(CaL0UcTbWFT39HHW&Vu=EDbFrPN@9O*kUI10FJpGATlap0ul|9N%OlGsq zUb?69EHqK6)WXFt;z!f-)mo@e$N?`A2VA0{w>Gls^(I&ay@f6th(PP`LufR97EdB0 zFb1!|YtVyu6nYL#MkCM|v@$Bf;bDC(tI`P#02_RFF)D}JPGwT9Pz`$k>%0HL$i;!^ zPMZws0Wx&o#aQJQ1@*5icI&VQA_8fxKj)-qXjnscc(O^;9Oe6r=KF36$bU3lhcqq_ zp;fT6h`ojrk(!a7np&G)-&9xI*pObALf-9-5SY>z9v|`ZlONxQ2aSF5zI#7@3Jv=4 z(~p0S>Jtt8OE`W6k58TwwHnTGEZI7#3!Z_s09^?Qlphj~A48*FLVregppmbkhoU0T z9Q+7+7|+IY@WZ4y`HLRG52M+{YJQlQ+q0u02+N{~^E!!qdjAp+ZxVe@|3>%K5ran( zvvyW*9WlWhhY?%T>k<>w(-RZx(zkA{tJ@kC(f^=8qmjt~UO_%9(TZS%5}-R7(cPoj z5QL~;G!;6`zMtLL zb>9eOo1ihhBE2HjnFJGIiZneZJx7qD+5qtA>n9o;!zqG}0HnFyP-v)jRd~z1WmV2P zSP!dZ-aK!fGuMy}3>4}>YtlM(#SoA}H%3u^WT8NI#;dYs1mJ5Tvc&YE!lHDlE&4Lp z0zZWxQ3Qbp65e~E=$-(8KmfBA1e2K9`fvn9b$QhTU<5!AM}WM}`puA4ee zU=5^>Q+on}6igjg3?ixmXx{y^p?*0K$|o=u*Jjt}*JjtR=Uct1g@MJdm+|*ka+*Z+ zBn11_OliNF5G=2Ipn0*RgauWoJv0qR5W@m0N!1GA)8pE1Jx#TxP%0_1g+ob}Igj0D3u4busNxXX zs&IS%JYcN%V$fLCE}}9kug(Kz6BEU&N3~1@nt1KJs`w60k*BDnq>MO#Cbn-TgTZDq zSy}(S7abl@1SzpZD9lLTxE|o2uO+__orA>O8I31E=9*vM2^pbSC=lf9X=*SwS(jd~ zRBBbMQ{J1Y0a&2j>Twqp)z-DP1B9+a_*qUwPsX%9IZCj^5hzMtSE6oWP2_3Z4E$S?k+;9Ohf=k-vkTgm4cJ; z2l96IOTi5(Y!kgaIS{ug17=yXUD>Wg@2Uo{AKk*3Nj(M%$gi`jTk=|DEwr9uww~=* z*AvJvF5OI)utaB)w+ls7pP;4)9XJr^Bk7V-Ee7-O1B_Nq)HxYSkt4e#rfsQrZ6N13 z1>D*g3b+-33^Dh|gQ|tq>Pl&)bZhSJRIm(F&~Tkb&w^nqED7EOXTtA+@7fBt%9``y za75NTVunJsDR5M)x6sW+o5cen{(~G&5*4GU34VxxPtyD_DBltxo zsV=>Ii)V``%a%ryhv%lOPgyTq)q}zk;3x>N)UeIbP+V19RaQbX0hO7(upREsIk*~( zzzZ3bOxp_uM+DVCQ!bfpHsW*s-$PXkVtx&vtXCj^jWR1snK|$Gh~KYKreZ16c>7J2 z>ljqU*R~LD3>>rd#tg#mPt|Cj9>>=RgnZLO~aaA9fws#Zc5ma9!BN9*jE*y9j;* zcQIhm6E4{bqXV#uJ*bNj3Nb@;x>0S~RF*(|8FosgB&U$cz6#JO<*?X`q6{^TijvZj z(o%PsjeN{yumLtIngl?c$tXoiv5J1AYMC^jIBvaIlxCXs&1kk-UBF~^loT}~qHoC2r7EpUq*GRxY^jjrEhmxpDSsSMV@8dZ&?MzS@xGnLGsYu!+Y z`28o-6@A}Fpy?qmkKj05J376UW#y3Gpk@P!X{bSNHhA(r{7vXF?`eqtLMB_kQ~41b zxpeLF0)Bojq*tedaoh$&c_sMt$KJ~eY)hv(5mz1lV{gdGawX?ig9jq|4&GWrdJ__Y zz;UCyQ21BqUe*`xYxzkIo=lp&1CPaH5&4TI)412Z@5gZPy%2|gB|&$AetV5|)s+oV z5&sWG5ogo@000310002YJ)+M50002bzU2h~0002bz(F>6oMT{QU|`?_VhIKXAj!nQ z$iT>W6G*avc?=AU5DWkry8$nFoMT{NmS_CJz{&nBmo3lumB2rKTI)+F?J@=oL=^hiwVX*lF81z_xA1W?Y__3xBCNNMwtYG zO2ccD^62&}cttB)fM`_2SS-R`BqI%lxQ*Y~+SJ~>&Ai*3Yd&i(Fkd#?&3DYD<_DG_ zi&%m!VU}>sU#qSKXmzw8Ekp~`I%qw#joKD1R*Tp6Ysp%gmZ{}y#o86|5+CuEs!~mA zNPx`a!F^pZZ(Uk1u387GtFd3jmp%6xfOmdQp*kUf$psd7*J7zm>yJou;>=isccuvSeeX+h=kI|F#bUjx;73$-3Dn85K zxPEnWtue=&lNDFKo9niR%i`hkE5{YCxK_Kl;N-H ziYwd06&V~AQmQY~-`79U6ZKR*OFtRv?Q}Y?IuAG#oqL?ioO7K~&UTMm0gt>KX^tev zKF4my4#2U-v8v<{P?A&Z%N5m$B1r z6O7&V9KfFF_FOdr`$Z)u+`b>4YW90>{iBkwCu3XfF)mx2R~%Rzp=@m>>Yv4?q8mkO z-J;Qd&MZiA>yo^jvif|gWtQ_Udh7*{Jy-5m6*Eqi8!5nbmth5ZqGlDBxI9`YN(Z}y zDsG0c9s6=PM{)*d^CLA9!%a%ZDv9F}=J1Sr1v{^M*1G$bxc!^1J{^2)QoER{m;yaf zBq9mxu>l*g37fG6TM>(Gh(kQKBLO?GQ*nHV`zS>T)?zi5Vg*)W6+h-uF5_~p;7YFI zYOdj0e$6~asrXLv6zA|2p5__8%GWrTuQQi#@C4^^KHub9T)?-vkc+sO?=YH6R3>Av z4o7iJ<>)vQc?oyaJx@lKx*gfbVLDTIhzD3z<>)HD;Y+MVKL)Zk>#!RAS)KJ+Pi0MG z4F*sc#EZ1CkRd96P1uwz*@`XLoP*hqy;Uarum`)d8@qCZ%IPSM<`|CU5Dw)yj^`v! z<^)dU6i%hDIv+2ZXeLP9#Lu{;?&=M7c0b`4*l`60E^|FM;B%z&D{kSJ+)8g&VrBYp z8;Wp=71iBNg9DH77*5v3J>13jxQ1`>9pmsj9x{}z*_oZ#kc~J@opXD2-m~~3L> zU^D9M$PTKO+ORFd*@Y2oOe<&d1x{lmr>ol9$NfCUFPMpnrpoTR!80rWzcj+6UiAv_ zQZIQWc*6&k;fpG$3P1Rx8mglP0#FmR5Qy5SgSx1P`sxeN01eSdy^tCNRy2kU!3aSU zG=+|4XpRkJo5uMN(T@Zn;=!Wj-fu87v-spqA=!gCofPol< z!5D&}7>3~(fsq)6(HNt?GvhEG6EG2zFd0)Y^?#C=wfj$cB~K-$?8V4Jq^nNd{dI0V z-!oyql9}$_G~}xJ{+{uIf9z4{u``~re<_~(myynT*5DtEUZo>=oMT{QU|;}ZiP&E* z@%%Pl8Mv8W07V$iA8?!prw#uZvUM@P268zVm_VWcP8bXi0001ZoMT{QU|?4GZ^017 zuD}2UY+VeD3@Cu{763uG14#gQoQ;%8XjDNEhTrRcS=56N5D|BAxu`IsL~y}?5^)z4 zjo!pH;6dC_G~hvS&7y}nsnJYwP>iTxf){U-5y2%!ViXfl5EJnrDlQnsuV2-3X5vUZ zeEikbHC5Hs{l@?7#l6R#=e2lo|B4s4!_X(9rjNZY*7F5(!AsbBFF}0V)}kr=ui!OQ z!%KKiT%p>||6P2}b~U^^{I*&0IQ3hJe}*rB(J&U4!88~JW1x;0{N^b3CA8U#2Q$QP zhiaUvxrTaRVLWj$^eoI|?<4i!&`Y1{CaA*hW^W?)edxh1MW3TZW*t(~ zoP;VbX0}Ovzlrq_n2!AwDy2VD4hJD7b;7>(!YpDs(VegWmckY|4Y%Pc?1FRDb}_sM z)6Z`{=skAIJWT~~ho)O*?f<|&53Avb>JB&n%-!#mw_#t%p1W6fUb7Hx$({SFP&aSh zgKX$z7@Mi-lsXP-%|&7J5C6i&{QtwCR(AaS84^nUH99R zw32N{92U$W!4_+cHm$EY-8&13dRU<(6&KSABeH%IQIWy#(7Gwnph&RoS~Hc|%UMT6 zIrI6_d1@&dzNHNPk?XEl}R5;!IB-x0p^pic1D;Tx%11~KT$%GIwu<+-;%b8H-d zp0}`AD596bxynVow|eREH&BDk!~g&Q08jt{+5iA}oQ+V+O2a@DJ<}KXKwP<=ofXpQ zB$O@!E=nO#q;7aOIzPk`7uIiWz3^xo6J3_hbN^ z;28qD?-CCd3$(DcxP~U)Ew1BSxE42XBj-B(p57C6SM#Wft_ z&Eh()@nLZTXX4i4CZu?@xJCX2LllTGh2c4e#0(pr2{Jg)TctYgmA)1;H005W^zyiDux^w`-zxe+T8F_gS0DyoF0Fa0S092Th zz6oFC}w9u zD?l&d03NUG|8y}lHQ;UH1WEPpGPQ9PL>7_1t2g3W+Z|~(+8*id>8VLJWeHqz2SAhh;A>$w&7(i1KYdqxR@(7aZQv_Rc|W_3E>~}2v5YD^Z(g3Z zZvqmyI(>NwqYBr9mk@YKIq-Cwyf$OyVhhRMn#yBBczQn*nyPYcdgGZwozO5I8S;G_ z-S9OocR=CZwy^&C7m(#~?jB|bIo^3MpQU)ch4xiy?jn1Zp8&&MsBA0+|0t8GfqmrE z@o?ngQo@Wu^KA#8W#!ZvY;m!4#NXd(ZoP~B*+XS~#hk9G|Em{y=)(*4(B{6R%uEJbZD_9t*!WeslUE+p6xEupYp3 zF#`FPxfbB|()rZhnd(L0h1MfKy6&HWfsP+V$eL#rs|CvZsEEfYuq^ zNthlN?ZnONJu13P80wyCMqfrZmebb9y{yVdtD0@q_A~8ZS+6Ev+;2wtQzL=c(?@j= z_lfv>Vm4c&8&~*}tUoPn!!Q?7s#I6t@X7luKHpq&OchHFn#2CL&cJMjxx!t(=@3#m z6zP2FfuC7lrQR;~YLzo%3iFu#VJLwGtAsQ2BY6?$T_)botQ*#I@ebH;|F%*1m_2Zx_Xe*}ArQgQZxF(ORph>~{>O#D_I(ZA9#`Hnem%^VGLFu;1UQW@k2LfH+3 zFk!!x-}=ma#fuhbJJZjKaHicmSE_r@!{(0Z9nw~i+=`?g5YeeorYM&;K1J&vHNv?`h98;JS4QZ!Xx#B^wA^{2L~UDc|Fw^g|E z-@W<<@{hA-@6rD_!$@VQM2t)pEBjGQ>YK5eAkH%BuvWiVGb)awpzg6VMP^SK*vJn^ z6WP!vxlbz^ z)@{q2D7v|Mqn98DIlT)86B~y5lZ4Jpu}0=@{K8-oo(*z8HvcHfj6u=)k)l(6Kh&o- z#j->uix9qrtNzeJ zcNT(nOzo0P`02dR0}v}1jl#EzI%*RWDJ&5n!G6+vr0m2du} zMsA3{Saw{jc|ZJusKvGJ_HzM>N(~tXksfn|u!gat9L_-WaV5>#w1N!2eIO{hF!f1x zJo9n#^n-N4qCtB1Hqa})!P^A9szlV81dSA+pEi65QI>Ur?=c3U@-4eLkkT~|uLAIlF^6K=K0Y-5;1ldiPQkmAELeq;S-IhH zA-*+qr|v%d~)*;=yeWpp=XcnT1u2tI?Ps~VD&Oc2R0|2T-focIW^XFl@J((Do(%c$#9I15$inz0Jm~iPS3aI_nbM!r9oms>*hjITMyaRqJ0?sq z$*z;pQ_=K(2+aX*Q-ejAQ(GdBtI<;&-B$aP8wULfQsuM+W#-k2)V^N!dgnyPEQ>@2 znagb%9_Li)SSu7wZ>kGEX+$(pOgH9d{q}~AXj0ZSj2_<+xR}-;)~$^RmsHHA9aN~L z%J`*t2^1)y@O8F~PLS$+5vUp*>gJ*Xt= z?eSPqKx_x?I~kVA`?GvmgNFf;NUeLHian4>#?^}?-aqwd^hR_b=XkgxptKo@_RvAd zzikE1ad7hX%LtjK0bT%9c1wyxj8q1#=qOjl3NwgJ5pLsVEBjLzYlJaRue^SL0xI8b zkT)u4{aiz>nM`Qb|E?rY(SS->WJ4!vzGJSGGnkGmbKKAGcW}Hlgp2m__7m)k-=wD9 ze%&TP!-HHJTWQ`l@F7S*CM;6YeA;%7;QX^?B8GIUrj8;D2iXF35N6tgUD@SK%?!>Z zHSJxhIs}@@}Cjy?+>{`brSt7 z7)O#&IkKG;iAf~m%EA)Y9lgjrqB^Nklk_mOnYj(dNkfOWiA9ri3-1o*y{SuiJwx{s z6f+c9K8dRWut0s;stRJ{Ykf>VjL!Bg!<=rB_TniW&Op~Q_{XUAW2%XmQTa%RnzFlz zG8XJz%nQVnu~4a$hg{8br&~ynmQ{?TuADz&o!b36s@l|WP6~!XiWl{}Z+PyjkVS^m zrBE9;clJ}75gpZPt@kC;;S~cHHI0y?M zK@=u+*>#&L8QE7F26MK~ntBT1#iF!XH$^$m!+^>pPTISHbWIwD;y z*M(iKIZp4T%zGRVV1>U8 z-?xQXoILro=NR~eR*6-~z96e=Ssj#&CMk_A%BdaBe{epIG}B^-aK@RC*O>j;eL7{% z%`3dT%K5v>@aQ=pC-`O44qtU*1X()QGQZn|O5nOq#ymuqe z^jw#`qH`MX{)#X6G~kvHuXkJ@O*&hH(!i|*Yv z^lZydKOJOjnY*eQ3WRr8>wb!R9S8L_SHw z^EgNx@9-!(!)hP(&WJcGEL}wI|FcHg#h%q9)eqz8$acgiU9A3s_P4^eDYbvj2a-QI zQ8GD@vME@ZZ!>Z3HPgQNK5lBFXpJnNR>xn?B7~_!GKU`NFZ}WIW6fEb=a4`KvB-K^Y3H7 zj5y9%a^_B`fyoR+e#3BYSQqP0!HQ6!wducFLLAIG8YTLTRs!=I*H+60GAk|ZT3%c^ zV>*R=f2_kGn_J#37#{9+Ugk!9J-rmeVWM0|4dE*6^ab<5y?uftic|vOz*T!R~N^9E~TmkuAS^uV>xYTd{G$uFss0g5xiIA zpnw|t=~rh&d%<};IZYmSgN(sc;oL5b>K4gyGZW|2wf=L*HD>U2lY%*rGD~i!@?oZ&l6^ zmCod7Ii7>+z9*E&O3PkgcJ9JPTJv^*{#Cf|6tLHiEcJ{ z!O)PWa94P17kfkSLC{RuL-6Nj-_Y#EF`vFyamtmN`A34IP0BWlYmGJUvivzXq6XJ#ul6SW)MgJnh+ROmc=T71ttWA1-INn$NfFUI z0KGa!41cv)L}}Z7*lm1Gd&vz7LGx>5XcH)$q1}}t51zOmP&;}nh|K7SkQu$;@ffY; zwN_o*nww_4QEkqjG1`t)lU{`^4%-$#j(_tyK;pF7`st^HPuP_tZ221?k$=u zy%6*i+3q;Gy0QUqyFS)seYC(D>?r<)nKjn8{-LTEY2+R-p_`ROlUVf&(tFhVMI6{0 z0X7#2S<3*onuf+uc3nRhk6_UDZSpcKL{4Ni-7Fv<)4~R*3XlKL}Ab zO%0>xy;YE|SDp^x5*0S2H{qnY5G-F%F@3U5*rTRFJek@zk7m;hPpHOmAykLXj8a^ej=YK`0sV^rbSACdv5)Lx;Qw47UnXB6)~ zmApZF-c?Codfb^AI?Y8bK7lDu#-*CxL8E~&S@Fx-v6h=CJmYlwZQR3%@K|51_{1L| z-z8a4C%16@%@zMZS>f;F<5Co zcL5#ap9&m~$=&78SRL|P^DX_3St;^~;rK>Te~Mxk{}`R8py}A^iYRGvO?vTGtMB}c zO;hB%y_*7Vjv`XD6_By04|24d+zNqz;`^f3GNCIqtet4}9dYqW>=AS>q-;O5|s3)yuGhkMoiyw#xR$sy8fy`scls9VBYDy(Z zAMB&p%|L z?V*RA1RwDZv1>N7cOb^`s4bl-19AA_WF)ti|;Xa+B;Z7Wc#H z2y%$zFYdxPg!FR5=uw2^ilS*#SW|uFBDlaQ(Nx0-d-w+*3-XkMIMt$f(v*q$&lQbi zcD9-$d0L$p+gGw6O_;nfE|y`j$P`N#U4F-Ym6o3!^@pSp+6ibqh+XYZjQr4iaBVTdx$0FCRIb)dC-1Ur}ElSpQAqV);}5 z;#9ZP-v34U4Xx8Bzp?OUfF{DIy+0P=ViwaE3P1Mi{QUQm=MM;f*`nvz}T_-Z6%wK@ePocFeUYAN+Fc2&q(<+ zl~#oKQ-Cd+NU9_Z{2!=hg6LTU`~H9j@wcx#1prh50RDgLii1gj`y|N+za2^7N523Z|Lwzn35 z+|7~$QVmFJ5oDY0sn|rl>vJX&;}-ZOtwV*~?7~Qc<5~KHSEJ!0`Kp!{1D4ylS&NiE z@2`Fwahzsn4(UDz#dBzj%oC7^II<>mw==vS6KxHHM>j?3IN^f-4a#uY(J0wsjdX8V z@P~Et@M4EeQ^}YQj*tIU)R-5R%FlBKDiN@|H>6gCsPK%{?T9Z#VPB}AdDli2R@g6r z8`gY6q*VAhv>IcyNNrM0T;lP?i(5Y7hdw8Z_fzpIi&q23tu($pfA18_+5R|$bEtzR zbH%;uqPGd{50~(`vJmT}8JY(E9rA;F$lo^de+37kc(UFG%-U*<2>qtlx^o4y<(sAL nW;8e`EH$yetlVMM`B/g; + var path2=/data-latex="(.*?)"/g; + + if(sel.search(path)==0){ + sel.replace(path2,function($0,$1){ + var param=encodeURIComponent($1); + openDialog(param); + return $0; + }); + }; + }); + + var openDialog = function(param) { + return editor.windowManager.openUrl({ + title: '插入公式', + size: 'large', + width: 785, + height: 475, + url:param?baseURL+"?c="+param:baseURL, + buttons: [ + { + type: 'cancel', + text: 'Close' + }, + { + type: 'custom', + text: 'Save', + name: 'save', + primary: true + }, + ], + onAction: function (api, details) { + switch (details.name) { + case 'save': + api.sendMessage("save"); + break; + default: + break; + }; + } + }); + }; + + + editor.ui.registry.addButton('kityformula-editor', { + text: '公式', + tooltip: '插入公式', + onAction: function() { + openDialog(); + } + }); + editor.ui.registry.addMenuItem('kityformula-editor', { + text: '公式', + onAction: function() { + openDialog(); + } + }); + return { + getMetadata: function() { + return { + name: "公式", + url: "http://hgcserver.gitee.io", + }; + } + }; +}); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/plugin.min.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/plugin.min.js new file mode 100644 index 00000000..9b74d606 --- /dev/null +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/kityformula-editor/plugin.min.js @@ -0,0 +1,72 @@ +tinymce.PluginManager.add('kityformula-editor', function(editor, url) { + + var baseURL = tinymce.baseURL+'/plugins/kityformula-editor/kityFormula.html'; + + editor.on('dblclick',function(){ + var sel=editor.selection.getContent(); + var path=/\/g; + var path2=/data-latex="(.*?)"/g; + + if(sel.search(path)==0){ + sel.replace(path2,function($0,$1){ + var param=encodeURIComponent($1); + openDialog(param); + return $0; + }); + }; + }); + + var openDialog = function(param) { + return editor.windowManager.openUrl({ + title: '插入公式', + size: 'large', + width: 785, + height: 475, + url:param?baseURL+"?c="+param:baseURL, + buttons: [ + { + type: 'cancel', + text: 'Close' + }, + { + type: 'custom', + text: 'Save', + name: 'save', + primary: true + }, + ], + onAction: function (api, details) { + switch (details.name) { + case 'save': + api.sendMessage("save"); + break; + default: + break; + }; + } + }); + }; + + + editor.ui.registry.addButton('kityformula-editor', { + text: '公式', + tooltip: '插入公式', + onAction: function() { + openDialog(); + } + }); + editor.ui.registry.addMenuItem('kityformula-editor', { + text: '公式', + onAction: function() { + openDialog(); + } + }); + return { + getMetadata: function() { + return { + name: "公式", + url: "http://hgcserver.gitee.io", + }; + } + }; +}); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/legacyoutput/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/legacyoutput/plugin.js index 522564bf..d96f337f 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/legacyoutput/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/legacyoutput/plugin.js @@ -14,185 +14,184 @@ var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var getFontSizeFormats = function (editor) { - return editor.getParam('fontsize_formats'); + return editor.getParam('fontsize_formats'); }; var setFontSizeFormats = function (editor, fontsize_formats) { - editor.settings.fontsize_formats = fontsize_formats; + editor.settings.fontsize_formats = fontsize_formats; }; var getFontFormats = function (editor) { - return editor.getParam('font_formats'); + return editor.getParam('font_formats'); }; var setFontFormats = function (editor, font_formats) { - editor.settings.font_formats = font_formats; + editor.settings.font_formats = font_formats; }; var getFontSizeStyleValues = function (editor) { - return editor.getParam('font_size_style_values', 'xx-small,x-small,small,medium,large,x-large,xx-large'); + return editor.getParam('font_size_style_values', 'xx-small,x-small,small,medium,large,x-large,xx-large'); }; var setInlineStyles = function (editor, inline_styles) { - editor.settings.inline_styles = inline_styles; + editor.settings.inline_styles = inline_styles; }; var overrideFormats = function (editor) { - var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table', - fontSizes = global$1.explode(getFontSizeStyleValues(editor)), schema = editor.schema; - editor.formatter.register({ - alignleft: { - selector: alignElements, - attributes: {align: 'left'} - }, - aligncenter: { - selector: alignElements, - attributes: {align: 'center'} - }, - alignright: { - selector: alignElements, - attributes: {align: 'right'} - }, - alignjustify: { - selector: alignElements, - attributes: {align: 'justify'} - }, - bold: [ - { - inline: 'b', - remove: 'all', - preserve_attributes: [ - 'class', - 'style' - ] - }, - { - inline: 'strong', - remove: 'all', - preserve_attributes: [ - 'class', - 'style' - ] - }, - { - inline: 'span', - styles: {fontWeight: 'bold'} - } - ], - italic: [ - { - inline: 'i', - remove: 'all', - preserve_attributes: [ - 'class', - 'style' - ] - }, - { - inline: 'em', - remove: 'all', - preserve_attributes: [ - 'class', - 'style' - ] - }, - { - inline: 'span', - styles: {fontStyle: 'italic'} - } - ], - underline: [ - { - inline: 'u', - remove: 'all', - preserve_attributes: [ - 'class', - 'style' - ] - }, - { - inline: 'span', - styles: {textDecoration: 'underline'}, - exact: true - } - ], - strikethrough: [ - { - inline: 'strike', - remove: 'all', - preserve_attributes: [ - 'class', - 'style' - ] - }, - { - inline: 'span', - styles: {textDecoration: 'line-through'}, - exact: true - } - ], - fontname: { - inline: 'font', - toggle: false, - attributes: {face: '%value'} - }, - fontsize: { - inline: 'font', - toggle: false, - attributes: { - size: function (vars) { - return String(global$1.inArray(fontSizes, vars.value) + 1); - } - } - }, - forecolor: { - inline: 'font', - attributes: {color: '%value'}, - links: true, - remove_similar: true, - clear_child_styles: true - }, - hilitecolor: { - inline: 'font', - styles: {backgroundColor: '%value'}, - links: true, - remove_similar: true, - clear_child_styles: true + var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table', fontSizes = global$1.explode(getFontSizeStyleValues(editor)), schema = editor.schema; + editor.formatter.register({ + alignleft: { + selector: alignElements, + attributes: { align: 'left' } + }, + aligncenter: { + selector: alignElements, + attributes: { align: 'center' } + }, + alignright: { + selector: alignElements, + attributes: { align: 'right' } + }, + alignjustify: { + selector: alignElements, + attributes: { align: 'justify' } + }, + bold: [ + { + inline: 'b', + remove: 'all', + preserve_attributes: [ + 'class', + 'style' + ] + }, + { + inline: 'strong', + remove: 'all', + preserve_attributes: [ + 'class', + 'style' + ] + }, + { + inline: 'span', + styles: { fontWeight: 'bold' } + } + ], + italic: [ + { + inline: 'i', + remove: 'all', + preserve_attributes: [ + 'class', + 'style' + ] + }, + { + inline: 'em', + remove: 'all', + preserve_attributes: [ + 'class', + 'style' + ] + }, + { + inline: 'span', + styles: { fontStyle: 'italic' } + } + ], + underline: [ + { + inline: 'u', + remove: 'all', + preserve_attributes: [ + 'class', + 'style' + ] + }, + { + inline: 'span', + styles: { textDecoration: 'underline' }, + exact: true + } + ], + strikethrough: [ + { + inline: 'strike', + remove: 'all', + preserve_attributes: [ + 'class', + 'style' + ] + }, + { + inline: 'span', + styles: { textDecoration: 'line-through' }, + exact: true + } + ], + fontname: { + inline: 'font', + toggle: false, + attributes: { face: '%value' } + }, + fontsize: { + inline: 'font', + toggle: false, + attributes: { + size: function (vars) { + return String(global$1.inArray(fontSizes, vars.value) + 1); } - }); - global$1.each('b,i,u,strike'.split(','), function (name) { - schema.addValidElements(name + '[*]'); - }); - if (!schema.getElementRule('font')) { - schema.addValidElements('font[face|size|color|style]'); + } + }, + forecolor: { + inline: 'font', + attributes: { color: '%value' }, + links: true, + remove_similar: true, + clear_child_styles: true + }, + hilitecolor: { + inline: 'font', + styles: { backgroundColor: '%value' }, + links: true, + remove_similar: true, + clear_child_styles: true } - global$1.each(alignElements.split(','), function (name) { - var rule = schema.getElementRule(name); - if (rule) { - if (!rule.attributes.align) { - rule.attributes.align = {}; - rule.attributesOrder.push('align'); - } - } - }); + }); + global$1.each('b,i,u,strike'.split(','), function (name) { + schema.addValidElements(name + '[*]'); + }); + if (!schema.getElementRule('font')) { + schema.addValidElements('font[face|size|color|style]'); + } + global$1.each(alignElements.split(','), function (name) { + var rule = schema.getElementRule(name); + if (rule) { + if (!rule.attributes.align) { + rule.attributes.align = {}; + rule.attributesOrder.push('align'); + } + } + }); }; var overrideSettings = function (editor) { - var defaultFontsizeFormats = '8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7'; - var defaultFontsFormats = 'Andale Mono=andale mono,monospace;' + 'Arial=arial,helvetica,sans-serif;' + 'Arial Black=arial black,sans-serif;' + 'Book Antiqua=book antiqua,palatino,serif;' + 'Comic Sans MS=comic sans ms,sans-serif;' + 'Courier New=courier new,courier,monospace;' + 'Georgia=georgia,palatino,serif;' + 'Helvetica=helvetica,arial,sans-serif;' + 'Impact=impact,sans-serif;' + 'Symbol=symbol;' + 'Tahoma=tahoma,arial,helvetica,sans-serif;' + 'Terminal=terminal,monaco,monospace;' + 'Times New Roman=times new roman,times,serif;' + 'Trebuchet MS=trebuchet ms,geneva,sans-serif;' + 'Verdana=verdana,geneva,sans-serif;' + 'Webdings=webdings;' + 'Wingdings=wingdings,zapf dingbats'; - setInlineStyles(editor, false); - if (!getFontSizeFormats(editor)) { - setFontSizeFormats(editor, defaultFontsizeFormats); - } - if (!getFontFormats(editor)) { - setFontFormats(editor, defaultFontsFormats); - } + var defaultFontsizeFormats = '8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7'; + var defaultFontsFormats = 'Andale Mono=andale mono,monospace;' + 'Arial=arial,helvetica,sans-serif;' + 'Arial Black=arial black,sans-serif;' + 'Book Antiqua=book antiqua,palatino,serif;' + 'Comic Sans MS=comic sans ms,sans-serif;' + 'Courier New=courier new,courier,monospace;' + 'Georgia=georgia,palatino,serif;' + 'Helvetica=helvetica,arial,sans-serif;' + 'Impact=impact,sans-serif;' + 'Symbol=symbol;' + 'Tahoma=tahoma,arial,helvetica,sans-serif;' + 'Terminal=terminal,monaco,monospace;' + 'Times New Roman=times new roman,times,serif;' + 'Trebuchet MS=trebuchet ms,geneva,sans-serif;' + 'Verdana=verdana,geneva,sans-serif;' + 'Webdings=webdings;' + 'Wingdings=wingdings,zapf dingbats'; + setInlineStyles(editor, false); + if (!getFontSizeFormats(editor)) { + setFontSizeFormats(editor, defaultFontsizeFormats); + } + if (!getFontFormats(editor)) { + setFontFormats(editor, defaultFontsFormats); + } }; var setup = function (editor) { - overrideSettings(editor); - editor.on('PreInit', function () { - return overrideFormats(editor); - }); + overrideSettings(editor); + editor.on('PreInit', function () { + return overrideFormats(editor); + }); }; - function Plugin() { - global.add('legacyoutput', function (editor) { - setup(editor); - }); + function Plugin () { + global.add('legacyoutput', function (editor) { + setup(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/link/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/link/plugin.js index 59932bf6..a5cc018d 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/link/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/link/plugin.js @@ -14,31 +14,31 @@ var global$1 = tinymce.util.Tools.resolve('tinymce.util.VK'); var typeOf = function (x) { - var t = typeof x; - if (x === null) { - return 'null'; - } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { - return 'array'; - } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { - return 'string'; - } else { - return t; - } + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } }; var isType = function (type) { - return function (value) { - return typeOf(value) === type; - }; + return function (value) { + return typeOf(value) === type; + }; }; var isSimpleType = function (type) { - return function (value) { - return typeof value === type; - }; + return function (value) { + return typeof value === type; + }; }; var eq = function (t) { - return function (a) { - return t === a; - }; + return function (a) { + return t === a; + }; }; var isString = isType('string'); var isArray = isType('array'); @@ -47,640 +47,639 @@ var isFunction = isSimpleType('function'); var assumeExternalTargets = function (editor) { - var externalTargets = editor.getParam('link_assume_external_targets', false); - if (isBoolean(externalTargets) && externalTargets) { - return 1; - } else if (isString(externalTargets) && (externalTargets === 'http' || externalTargets === 'https')) { - return externalTargets; - } - return 0; + var externalTargets = editor.getParam('link_assume_external_targets', false); + if (isBoolean(externalTargets) && externalTargets) { + return 1; + } else if (isString(externalTargets) && (externalTargets === 'http' || externalTargets === 'https')) { + return externalTargets; + } + return 0; }; var hasContextToolbar = function (editor) { - return editor.getParam('link_context_toolbar', false, 'boolean'); + return editor.getParam('link_context_toolbar', false, 'boolean'); }; var getLinkList = function (editor) { - return editor.getParam('link_list'); + return editor.getParam('link_list'); }; var getDefaultLinkTarget = function (editor) { - return editor.getParam('default_link_target'); + return editor.getParam('default_link_target'); }; var getTargetList = function (editor) { - return editor.getParam('target_list', true); + return editor.getParam('target_list', true); }; var getRelList = function (editor) { - return editor.getParam('rel_list', [], 'array'); + return editor.getParam('rel_list', [], 'array'); }; var getLinkClassList = function (editor) { - return editor.getParam('link_class_list', [], 'array'); + return editor.getParam('link_class_list', [], 'array'); }; var shouldShowLinkTitle = function (editor) { - return editor.getParam('link_title', true, 'boolean'); + return editor.getParam('link_title', true, 'boolean'); }; var allowUnsafeLinkTarget = function (editor) { - return editor.getParam('allow_unsafe_link_target', false, 'boolean'); + return editor.getParam('allow_unsafe_link_target', false, 'boolean'); }; var useQuickLink = function (editor) { - return editor.getParam('link_quicklink', false, 'boolean'); + return editor.getParam('link_quicklink', false, 'boolean'); }; var getDefaultLinkProtocol = function (editor) { - return editor.getParam('link_default_protocol', 'http', 'string'); + return editor.getParam('link_default_protocol', 'http', 'string'); }; var noop = function () { }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; var never = constant(false); var always = constant(true); var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var nativeIndexOf = Array.prototype.indexOf; var nativePush = Array.prototype.push; var rawIndexOf = function (ts, t) { - return nativeIndexOf.call(ts, t); + return nativeIndexOf.call(ts, t); }; var contains = function (xs, x) { - return rawIndexOf(xs, x) > -1; + return rawIndexOf(xs, x) > -1; }; var map = function (xs, f) { - var len = xs.length; - var r = new Array(len); - for (var i = 0; i < len; i++) { - var x = xs[i]; - r[i] = f(x, i); - } - return r; + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; }; var each = function (xs, f) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - f(x, i); - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } }; var foldl = function (xs, f, acc) { - each(xs, function (x) { - acc = f(acc, x); - }); - return acc; + each(xs, function (x) { + acc = f(acc, x); + }); + return acc; }; var flatten = function (xs) { - var r = []; - for (var i = 0, len = xs.length; i < len; ++i) { - if (!isArray(xs[i])) { - throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); - } - nativePush.apply(r, xs[i]); + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); } - return r; + nativePush.apply(r, xs[i]); + } + return r; }; var bind = function (xs, f) { - return flatten(map(xs, f)); + return flatten(map(xs, f)); }; var findMap = function (arr, f) { - for (var i = 0; i < arr.length; i++) { - var r = f(arr[i], i); - if (r.isSome()) { - return r; - } + for (var i = 0; i < arr.length; i++) { + var r = f(arr[i], i); + if (r.isSome()) { + return r; } - return Optional.none(); + } + return Optional.none(); }; var cat = function (arr) { - var r = []; - var push = function (x) { - r.push(x); - }; - for (var i = 0; i < arr.length; i++) { - arr[i].each(push); - } - return r; + var r = []; + var push = function (x) { + r.push(x); + }; + for (var i = 0; i < arr.length; i++) { + arr[i].each(push); + } + return r; }; var someIf = function (b, a) { - return b ? Optional.some(a) : Optional.none(); + return b ? Optional.some(a) : Optional.none(); }; var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var getValue = function (item) { - return isString(item.value) ? item.value : ''; + return isString(item.value) ? item.value : ''; }; var getText = function (item) { - if (isString(item.text)) { - return item.text; - } else if (isString(item.title)) { - return item.title; - } else { - return ''; - } + if (isString(item.text)) { + return item.text; + } else if (isString(item.title)) { + return item.title; + } else { + return ''; + } }; var sanitizeList = function (list, extractValue) { - var out = []; - global$2.each(list, function (item) { - var text = getText(item); - if (item.menu !== undefined) { - var items = sanitizeList(item.menu, extractValue); - out.push({ - text: text, - items: items - }); - } else { - var value = extractValue(item); - out.push({ - text: text, - value: value - }); - } - }); - return out; + var out = []; + global$2.each(list, function (item) { + var text = getText(item); + if (item.menu !== undefined) { + var items = sanitizeList(item.menu, extractValue); + out.push({ + text: text, + items: items + }); + } else { + var value = extractValue(item); + out.push({ + text: text, + value: value + }); + } + }); + return out; }; var sanitizeWith = function (extracter) { - if (extracter === void 0) { - extracter = getValue; - } - return function (list) { - return Optional.from(list).map(function (list) { - return sanitizeList(list, extracter); - }); - }; + if (extracter === void 0) { + extracter = getValue; + } + return function (list) { + return Optional.from(list).map(function (list) { + return sanitizeList(list, extracter); + }); + }; }; var sanitize = function (list) { - return sanitizeWith(getValue)(list); + return sanitizeWith(getValue)(list); }; var createUi = function (name, label) { - return function (items) { - return { - name: name, - type: 'listbox', - label: label, - items: items - }; + return function (items) { + return { + name: name, + type: 'listbox', + label: label, + items: items }; + }; }; var ListOptions = { - sanitize: sanitize, - sanitizeWith: sanitizeWith, - createUi: createUi, - getValue: getValue + sanitize: sanitize, + sanitizeWith: sanitizeWith, + createUi: createUi, + getValue: getValue }; var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); }; var keys = Object.keys; var hasOwnProperty = Object.hasOwnProperty; var each$1 = function (obj, f) { - var props = keys(obj); - for (var k = 0, len = props.length; k < len; k++) { - var i = props[k]; - var x = obj[i]; - f(x, i); - } + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } }; var objAcc = function (r) { - return function (x, i) { - r[i] = x; - }; + return function (x, i) { + r[i] = x; + }; }; var internalFilter = function (obj, pred, onTrue, onFalse) { - var r = {}; - each$1(obj, function (x, i) { - (pred(x, i) ? onTrue : onFalse)(x, i); - }); - return r; + var r = {}; + each$1(obj, function (x, i) { + (pred(x, i) ? onTrue : onFalse)(x, i); + }); + return r; }; var filter = function (obj, pred) { - var t = {}; - internalFilter(obj, pred, objAcc(t), noop); - return t; + var t = {}; + internalFilter(obj, pred, objAcc(t), noop); + return t; }; var has = function (obj, key) { - return hasOwnProperty.call(obj, key); + return hasOwnProperty.call(obj, key); }; var hasNonNullableKey = function (obj, key) { - return has(obj, key) && obj[key] !== undefined && obj[key] !== null; + return has(obj, key) && obj[key] !== undefined && obj[key] !== null; }; var global$3 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker'); var isAnchor = function (elm) { - return elm && elm.nodeName.toLowerCase() === 'a'; + return elm && elm.nodeName.toLowerCase() === 'a'; }; var isLink = function (elm) { - return isAnchor(elm) && !!getHref(elm); + return isAnchor(elm) && !!getHref(elm); }; var collectNodesInRange = function (rng, predicate) { - if (rng.collapsed) { - return []; - } else { - var contents = rng.cloneContents(); - var walker = new global$3(contents.firstChild, contents); - var elements = []; - var current = contents.firstChild; - do { - if (predicate(current)) { - elements.push(current); - } - } while (current = walker.next()); - return elements; - } + if (rng.collapsed) { + return []; + } else { + var contents = rng.cloneContents(); + var walker = new global$3(contents.firstChild, contents); + var elements = []; + var current = contents.firstChild; + do { + if (predicate(current)) { + elements.push(current); + } + } while (current = walker.next()); + return elements; + } }; var hasProtocol = function (url) { - return /^\w+:/i.test(url); + return /^\w+:/i.test(url); }; var getHref = function (elm) { - var href = elm.getAttribute('data-mce-href'); - return href ? href : elm.getAttribute('href'); + var href = elm.getAttribute('data-mce-href'); + return href ? href : elm.getAttribute('href'); }; var applyRelTargetRules = function (rel, isUnsafe) { - var rules = ['noopener']; - var rels = rel ? rel.split(/\s+/) : []; - var toString = function (rels) { - return global$2.trim(rels.sort().join(' ')); - }; - var addTargetRules = function (rels) { - rels = removeTargetRules(rels); - return rels.length > 0 ? rels.concat(rules) : rules; - }; - var removeTargetRules = function (rels) { - return rels.filter(function (val) { - return global$2.inArray(rules, val) === -1; - }); - }; - var newRels = isUnsafe ? addTargetRules(rels) : removeTargetRules(rels); - return newRels.length > 0 ? toString(newRels) : ''; + var rules = ['noopener']; + var rels = rel ? rel.split(/\s+/) : []; + var toString = function (rels) { + return global$2.trim(rels.sort().join(' ')); + }; + var addTargetRules = function (rels) { + rels = removeTargetRules(rels); + return rels.length > 0 ? rels.concat(rules) : rules; + }; + var removeTargetRules = function (rels) { + return rels.filter(function (val) { + return global$2.inArray(rules, val) === -1; + }); + }; + var newRels = isUnsafe ? addTargetRules(rels) : removeTargetRules(rels); + return newRels.length > 0 ? toString(newRels) : ''; }; var trimCaretContainers = function (text) { - return text.replace(/\uFEFF/g, ''); + return text.replace(/\uFEFF/g, ''); }; var getAnchorElement = function (editor, selectedElm) { - selectedElm = selectedElm || editor.selection.getNode(); - if (isImageFigure(selectedElm)) { - return editor.dom.select('a[href]', selectedElm)[0]; - } else { - return editor.dom.getParent(selectedElm, 'a[href]'); - } + selectedElm = selectedElm || editor.selection.getNode(); + if (isImageFigure(selectedElm)) { + return editor.dom.select('a[href]', selectedElm)[0]; + } else { + return editor.dom.getParent(selectedElm, 'a[href]'); + } }; var getAnchorText = function (selection, anchorElm) { - var text = anchorElm ? anchorElm.innerText || anchorElm.textContent : selection.getContent({format: 'text'}); - return trimCaretContainers(text); + var text = anchorElm ? anchorElm.innerText || anchorElm.textContent : selection.getContent({ format: 'text' }); + return trimCaretContainers(text); }; var hasLinks = function (elements) { - return global$2.grep(elements, isLink).length > 0; + return global$2.grep(elements, isLink).length > 0; }; var hasLinksInSelection = function (rng) { - return collectNodesInRange(rng, isLink).length > 0; + return collectNodesInRange(rng, isLink).length > 0; }; var isOnlyTextSelected = function (editor) { - var inlineTextElements = editor.schema.getTextInlineElements(); - var isElement = function (elm) { - return elm.nodeType === 1 && !isAnchor(elm) && !has(inlineTextElements, elm.nodeName.toLowerCase()); - }; - var elements = collectNodesInRange(editor.selection.getRng(), isElement); - return elements.length === 0; + var inlineTextElements = editor.schema.getTextInlineElements(); + var isElement = function (elm) { + return elm.nodeType === 1 && !isAnchor(elm) && !has(inlineTextElements, elm.nodeName.toLowerCase()); + }; + var elements = collectNodesInRange(editor.selection.getRng(), isElement); + return elements.length === 0; }; var isImageFigure = function (elm) { - return elm && elm.nodeName === 'FIGURE' && /\bimage\b/i.test(elm.className); + return elm && elm.nodeName === 'FIGURE' && /\bimage\b/i.test(elm.className); }; var getLinkAttrs = function (data) { - return foldl([ - 'title', - 'rel', - 'class', - 'target' - ], function (acc, key) { - data[key].each(function (value) { - acc[key] = value.length > 0 ? value : null; - }); - return acc; - }, {href: data.href}); + return foldl([ + 'title', + 'rel', + 'class', + 'target' + ], function (acc, key) { + data[key].each(function (value) { + acc[key] = value.length > 0 ? value : null; + }); + return acc; + }, { href: data.href }); }; var handleExternalTargets = function (href, assumeExternalTargets) { - if ((assumeExternalTargets === 'http' || assumeExternalTargets === 'https') && !hasProtocol(href)) { - return assumeExternalTargets + '://' + href; - } - return href; + if ((assumeExternalTargets === 'http' || assumeExternalTargets === 'https') && !hasProtocol(href)) { + return assumeExternalTargets + '://' + href; + } + return href; }; var applyLinkOverrides = function (editor, linkAttrs) { - var newLinkAttrs = __assign({}, linkAttrs); - if (!(getRelList(editor).length > 0) && allowUnsafeLinkTarget(editor) === false) { - var newRel = applyRelTargetRules(newLinkAttrs.rel, newLinkAttrs.target === '_blank'); - newLinkAttrs.rel = newRel ? newRel : null; - } - if (Optional.from(newLinkAttrs.target).isNone() && getTargetList(editor) === false) { - newLinkAttrs.target = getDefaultLinkTarget(editor); - } - newLinkAttrs.href = handleExternalTargets(newLinkAttrs.href, assumeExternalTargets(editor)); - return newLinkAttrs; + var newLinkAttrs = __assign({}, linkAttrs); + if (!(getRelList(editor).length > 0) && allowUnsafeLinkTarget(editor) === false) { + var newRel = applyRelTargetRules(newLinkAttrs.rel, newLinkAttrs.target === '_blank'); + newLinkAttrs.rel = newRel ? newRel : null; + } + if (Optional.from(newLinkAttrs.target).isNone() && getTargetList(editor) === false) { + newLinkAttrs.target = getDefaultLinkTarget(editor); + } + newLinkAttrs.href = handleExternalTargets(newLinkAttrs.href, assumeExternalTargets(editor)); + return newLinkAttrs; }; var updateLink = function (editor, anchorElm, text, linkAttrs) { - text.each(function (text) { - if (anchorElm.hasOwnProperty('innerText')) { - anchorElm.innerText = text; - } else { - anchorElm.textContent = text; - } - }); - editor.dom.setAttribs(anchorElm, linkAttrs); - editor.selection.select(anchorElm); - }; - var createLink = function (editor, selectedElm, text, linkAttrs) { - if (isImageFigure(selectedElm)) { - linkImageFigure(editor, selectedElm, linkAttrs); + text.each(function (text) { + if (anchorElm.hasOwnProperty('innerText')) { + anchorElm.innerText = text; } else { - text.fold(function () { - editor.execCommand('mceInsertLink', false, linkAttrs); - }, function (text) { - editor.insertContent(editor.dom.createHTML('a', linkAttrs, editor.dom.encode(text))); - }); + anchorElm.textContent = text; } + }); + editor.dom.setAttribs(anchorElm, linkAttrs); + editor.selection.select(anchorElm); }; - var linkDomMutation = function (editor, attachState, data) { - var selectedElm = editor.selection.getNode(); - var anchorElm = getAnchorElement(editor, selectedElm); - var linkAttrs = applyLinkOverrides(editor, getLinkAttrs(data)); - editor.undoManager.transact(function () { - if (data.href === attachState.href) { - attachState.attach(); - } - if (anchorElm) { - editor.focus(); - updateLink(editor, anchorElm, data.text, linkAttrs); - } else { - createLink(editor, selectedElm, data.text, linkAttrs); - } + var createLink = function (editor, selectedElm, text, linkAttrs) { + if (isImageFigure(selectedElm)) { + linkImageFigure(editor, selectedElm, linkAttrs); + } else { + text.fold(function () { + editor.execCommand('mceInsertLink', false, linkAttrs); + }, function (text) { + editor.insertContent(editor.dom.createHTML('a', linkAttrs, editor.dom.encode(text))); }); + } }; - var unlinkSelection = function (editor) { - var dom = editor.dom, selection = editor.selection; - var bookmark = selection.getBookmark(); - var rng = selection.getRng().cloneRange(); - var startAnchorElm = dom.getParent(rng.startContainer, 'a[href]', editor.getBody()); - var endAnchorElm = dom.getParent(rng.endContainer, 'a[href]', editor.getBody()); - if (startAnchorElm) { - rng.setStartBefore(startAnchorElm); + var linkDomMutation = function (editor, attachState, data) { + var selectedElm = editor.selection.getNode(); + var anchorElm = getAnchorElement(editor, selectedElm); + var linkAttrs = applyLinkOverrides(editor, getLinkAttrs(data)); + editor.undoManager.transact(function () { + if (data.href === attachState.href) { + attachState.attach(); } - if (endAnchorElm) { - rng.setEndAfter(endAnchorElm); + if (anchorElm) { + editor.focus(); + updateLink(editor, anchorElm, data.text, linkAttrs); + } else { + createLink(editor, selectedElm, data.text, linkAttrs); } - selection.setRng(rng); - editor.execCommand('unlink'); - selection.moveToBookmark(bookmark); + }); + }; + var unlinkSelection = function (editor) { + var dom = editor.dom, selection = editor.selection; + var bookmark = selection.getBookmark(); + var rng = selection.getRng().cloneRange(); + var startAnchorElm = dom.getParent(rng.startContainer, 'a[href]', editor.getBody()); + var endAnchorElm = dom.getParent(rng.endContainer, 'a[href]', editor.getBody()); + if (startAnchorElm) { + rng.setStartBefore(startAnchorElm); + } + if (endAnchorElm) { + rng.setEndAfter(endAnchorElm); + } + selection.setRng(rng); + editor.execCommand('unlink'); + selection.moveToBookmark(bookmark); }; var unlinkDomMutation = function (editor) { - editor.undoManager.transact(function () { - var node = editor.selection.getNode(); - if (isImageFigure(node)) { - unlinkImageFigure(editor, node); - } else { - unlinkSelection(editor); - } - editor.focus(); - }); + editor.undoManager.transact(function () { + var node = editor.selection.getNode(); + if (isImageFigure(node)) { + unlinkImageFigure(editor, node); + } else { + unlinkSelection(editor); + } + editor.focus(); + }); }; var unwrapOptions = function (data) { - var cls = data.class, href = data.href, rel = data.rel, target = data.target, text = data.text, - title = data.title; - return filter({ - class: cls.getOrNull(), - href: href, - rel: rel.getOrNull(), - target: target.getOrNull(), - text: text.getOrNull(), - title: title.getOrNull() - }, function (v, _k) { - return isNull(v) === false; - }); + var cls = data.class, href = data.href, rel = data.rel, target = data.target, text = data.text, title = data.title; + return filter({ + class: cls.getOrNull(), + href: href, + rel: rel.getOrNull(), + target: target.getOrNull(), + text: text.getOrNull(), + title: title.getOrNull() + }, function (v, _k) { + return isNull(v) === false; + }); }; var link = function (editor, attachState, data) { - editor.hasPlugin('rtc', true) ? editor.execCommand('createlink', false, unwrapOptions(data)) : linkDomMutation(editor, attachState, data); + editor.hasPlugin('rtc', true) ? editor.execCommand('createlink', false, unwrapOptions(data)) : linkDomMutation(editor, attachState, data); }; var unlink = function (editor) { - editor.hasPlugin('rtc', true) ? editor.execCommand('unlink') : unlinkDomMutation(editor); + editor.hasPlugin('rtc', true) ? editor.execCommand('unlink') : unlinkDomMutation(editor); }; var unlinkImageFigure = function (editor, fig) { - var img = editor.dom.select('img', fig)[0]; - if (img) { - var a = editor.dom.getParents(img, 'a[href]', fig)[0]; - if (a) { - a.parentNode.insertBefore(img, a); - editor.dom.remove(a); - } + var img = editor.dom.select('img', fig)[0]; + if (img) { + var a = editor.dom.getParents(img, 'a[href]', fig)[0]; + if (a) { + a.parentNode.insertBefore(img, a); + editor.dom.remove(a); } + } }; var linkImageFigure = function (editor, fig, attrs) { - var img = editor.dom.select('img', fig)[0]; - if (img) { - var a = editor.dom.create('a', attrs); - img.parentNode.insertBefore(a, img); - a.appendChild(img); - } + var img = editor.dom.select('img', fig)[0]; + if (img) { + var a = editor.dom.create('a', attrs); + img.parentNode.insertBefore(a, img); + a.appendChild(img); + } }; var isListGroup = function (item) { - return hasNonNullableKey(item, 'items'); + return hasNonNullableKey(item, 'items'); }; var findTextByValue = function (value, catalog) { - return findMap(catalog, function (item) { - if (isListGroup(item)) { - return findTextByValue(value, item.items); - } else { - return someIf(item.value === value, item); - } - }); + return findMap(catalog, function (item) { + if (isListGroup(item)) { + return findTextByValue(value, item.items); + } else { + return someIf(item.value === value, item); + } + }); }; var getDelta = function (persistentText, fieldName, catalog, data) { - var value = data[fieldName]; - var hasPersistentText = persistentText.length > 0; - return value !== undefined ? findTextByValue(value, catalog).map(function (i) { - return { - url: { - value: i.value, - meta: { - text: hasPersistentText ? persistentText : i.text, - attach: noop - } - }, - text: hasPersistentText ? persistentText : i.text - }; - }) : Optional.none(); + var value = data[fieldName]; + var hasPersistentText = persistentText.length > 0; + return value !== undefined ? findTextByValue(value, catalog).map(function (i) { + return { + url: { + value: i.value, + meta: { + text: hasPersistentText ? persistentText : i.text, + attach: noop + } + }, + text: hasPersistentText ? persistentText : i.text + }; + }) : Optional.none(); }; var findCatalog = function (catalogs, fieldName) { - if (fieldName === 'link') { - return catalogs.link; - } else if (fieldName === 'anchor') { - return catalogs.anchor; - } else { - return Optional.none(); - } + if (fieldName === 'link') { + return catalogs.link; + } else if (fieldName === 'anchor') { + return catalogs.anchor; + } else { + return Optional.none(); + } }; var init = function (initialData, linkCatalog) { - var persistentData = { - text: initialData.text, - title: initialData.title - }; - var getTitleFromUrlChange = function (url) { - return someIf(persistentData.title.length <= 0, Optional.from(url.meta.title).getOr('')); - }; - var getTextFromUrlChange = function (url) { - return someIf(persistentData.text.length <= 0, Optional.from(url.meta.text).getOr(url.value)); - }; - var onUrlChange = function (data) { - var text = getTextFromUrlChange(data.url); - var title = getTitleFromUrlChange(data.url); - if (text.isSome() || title.isSome()) { - return Optional.some(__assign(__assign({}, text.map(function (text) { - return {text: text}; - }).getOr({})), title.map(function (title) { - return {title: title}; - }).getOr({}))); - } else { - return Optional.none(); - } - }; - var onCatalogChange = function (data, change) { - var catalog = findCatalog(linkCatalog, change.name).getOr([]); - return getDelta(persistentData.text, change.name, catalog, data); - }; - var onChange = function (getData, change) { - var name = change.name; - if (name === 'url') { - return onUrlChange(getData()); - } else if (contains([ - 'anchor', - 'link' - ], name)) { - return onCatalogChange(getData(), change); - } else if (name === 'text' || name === 'title') { - persistentData[name] = getData()[name]; - return Optional.none(); - } else { - return Optional.none(); - } - }; - return {onChange: onChange}; + var persistentData = { + text: initialData.text, + title: initialData.title + }; + var getTitleFromUrlChange = function (url) { + return someIf(persistentData.title.length <= 0, Optional.from(url.meta.title).getOr('')); + }; + var getTextFromUrlChange = function (url) { + return someIf(persistentData.text.length <= 0, Optional.from(url.meta.text).getOr(url.value)); + }; + var onUrlChange = function (data) { + var text = getTextFromUrlChange(data.url); + var title = getTitleFromUrlChange(data.url); + if (text.isSome() || title.isSome()) { + return Optional.some(__assign(__assign({}, text.map(function (text) { + return { text: text }; + }).getOr({})), title.map(function (title) { + return { title: title }; + }).getOr({}))); + } else { + return Optional.none(); + } + }; + var onCatalogChange = function (data, change) { + var catalog = findCatalog(linkCatalog, change.name).getOr([]); + return getDelta(persistentData.text, change.name, catalog, data); + }; + var onChange = function (getData, change) { + var name = change.name; + if (name === 'url') { + return onUrlChange(getData()); + } else if (contains([ + 'anchor', + 'link' + ], name)) { + return onCatalogChange(getData(), change); + } else if (name === 'text' || name === 'title') { + persistentData[name] = getData()[name]; + return Optional.none(); + } else { + return Optional.none(); + } + }; + return { onChange: onChange }; }; var DialogChanges = { - init: init, - getDelta: getDelta + init: init, + getDelta: getDelta }; var global$4 = tinymce.util.Tools.resolve('tinymce.util.Delay'); @@ -688,602 +687,602 @@ var global$5 = tinymce.util.Tools.resolve('tinymce.util.Promise'); var delayedConfirm = function (editor, message, callback) { - var rng = editor.selection.getRng(); - global$4.setEditorTimeout(editor, function () { - editor.windowManager.confirm(message, function (state) { - editor.selection.setRng(rng); - callback(state); - }); + var rng = editor.selection.getRng(); + global$4.setEditorTimeout(editor, function () { + editor.windowManager.confirm(message, function (state) { + editor.selection.setRng(rng); + callback(state); }); + }); }; var tryEmailTransform = function (data) { - var url = data.href; - var suggestMailTo = url.indexOf('@') > 0 && url.indexOf('/') === -1 && url.indexOf('mailto:') === -1; - return suggestMailTo ? Optional.some({ - message: 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?', - preprocess: function (oldData) { - return __assign(__assign({}, oldData), {href: 'mailto:' + url}); - } - }) : Optional.none(); + var url = data.href; + var suggestMailTo = url.indexOf('@') > 0 && url.indexOf('/') === -1 && url.indexOf('mailto:') === -1; + return suggestMailTo ? Optional.some({ + message: 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?', + preprocess: function (oldData) { + return __assign(__assign({}, oldData), { href: 'mailto:' + url }); + } + }) : Optional.none(); }; var tryProtocolTransform = function (assumeExternalTargets, defaultLinkProtocol) { - return function (data) { - var url = data.href; - var suggestProtocol = assumeExternalTargets === 1 && !hasProtocol(url) || assumeExternalTargets === 0 && /^\s*www(\.|\d\.)/i.test(url); - return suggestProtocol ? Optional.some({ - message: 'The URL you entered seems to be an external link. Do you want to add the required ' + defaultLinkProtocol + ':// prefix?', - preprocess: function (oldData) { - return __assign(__assign({}, oldData), {href: defaultLinkProtocol + '://' + url}); - } - }) : Optional.none(); - }; + return function (data) { + var url = data.href; + var suggestProtocol = assumeExternalTargets === 1 && !hasProtocol(url) || assumeExternalTargets === 0 && /^\s*www(\.|\d\.)/i.test(url); + return suggestProtocol ? Optional.some({ + message: 'The URL you entered seems to be an external link. Do you want to add the required ' + defaultLinkProtocol + ':// prefix?', + preprocess: function (oldData) { + return __assign(__assign({}, oldData), { href: defaultLinkProtocol + '://' + url }); + } + }) : Optional.none(); + }; }; var preprocess = function (editor, data) { - return findMap([ - tryEmailTransform, - tryProtocolTransform(assumeExternalTargets(editor), getDefaultLinkProtocol(editor)) - ], function (f) { - return f(data); - }).fold(function () { - return global$5.resolve(data); - }, function (transform) { - return new global$5(function (callback) { - delayedConfirm(editor, transform.message, function (state) { - callback(state ? transform.preprocess(data) : data); - }); - }); + return findMap([ + tryEmailTransform, + tryProtocolTransform(assumeExternalTargets(editor), getDefaultLinkProtocol(editor)) + ], function (f) { + return f(data); + }).fold(function () { + return global$5.resolve(data); + }, function (transform) { + return new global$5(function (callback) { + delayedConfirm(editor, transform.message, function (state) { + callback(state ? transform.preprocess(data) : data); + }); }); + }); }; - var DialogConfirms = {preprocess: preprocess}; + var DialogConfirms = { preprocess: preprocess }; var getAnchors = function (editor) { - var anchorNodes = editor.dom.select('a:not([href])'); - var anchors = bind(anchorNodes, function (anchor) { - var id = anchor.name || anchor.id; - return id ? [{ - text: id, - value: '#' + id - }] : []; - }); - return anchors.length > 0 ? Optional.some([{ - text: 'None', - value: '' + var anchorNodes = editor.dom.select('a:not([href])'); + var anchors = bind(anchorNodes, function (anchor) { + var id = anchor.name || anchor.id; + return id ? [{ + text: id, + value: '#' + id + }] : []; + }); + return anchors.length > 0 ? Optional.some([{ + text: 'None', + value: '' }].concat(anchors)) : Optional.none(); }; - var AnchorListOptions = {getAnchors: getAnchors}; + var AnchorListOptions = { getAnchors: getAnchors }; var getClasses = function (editor) { - var list = getLinkClassList(editor); - if (list.length > 0) { - return ListOptions.sanitize(list); - } - return Optional.none(); + var list = getLinkClassList(editor); + if (list.length > 0) { + return ListOptions.sanitize(list); + } + return Optional.none(); }; - var ClassListOptions = {getClasses: getClasses}; + var ClassListOptions = { getClasses: getClasses }; var global$6 = tinymce.util.Tools.resolve('tinymce.util.XHR'); var parseJson = function (text) { - try { - return Optional.some(JSON.parse(text)); - } catch (err) { - return Optional.none(); - } + try { + return Optional.some(JSON.parse(text)); + } catch (err) { + return Optional.none(); + } }; var getLinks = function (editor) { - var extractor = function (item) { - return editor.convertURL(item.value || item.url, 'href'); - }; - var linkList = getLinkList(editor); - return new global$5(function (callback) { - if (isString(linkList)) { - global$6.send({ - url: linkList, - success: function (text) { - return callback(parseJson(text)); - }, - error: function (_) { - return callback(Optional.none()); - } - }); - } else if (isFunction(linkList)) { - linkList(function (output) { - return callback(Optional.some(output)); - }); - } else { - callback(Optional.from(linkList)); + var extractor = function (item) { + return editor.convertURL(item.value || item.url, 'href'); + }; + var linkList = getLinkList(editor); + return new global$5(function (callback) { + if (isString(linkList)) { + global$6.send({ + url: linkList, + success: function (text) { + return callback(parseJson(text)); + }, + error: function (_) { + return callback(Optional.none()); } - }).then(function (optItems) { - return optItems.bind(ListOptions.sanitizeWith(extractor)).map(function (items) { - if (items.length > 0) { - var noneItem = [{ - text: 'None', - value: '' - }]; - return noneItem.concat(items); - } else { - return items; - } - }); + }); + } else if (isFunction(linkList)) { + linkList(function (output) { + return callback(Optional.some(output)); + }); + } else { + callback(Optional.from(linkList)); + } + }).then(function (optItems) { + return optItems.bind(ListOptions.sanitizeWith(extractor)).map(function (items) { + if (items.length > 0) { + var noneItem = [{ + text: 'None', + value: '' + }]; + return noneItem.concat(items); + } else { + return items; + } }); + }); }; - var LinkListOptions = {getLinks: getLinks}; + var LinkListOptions = { getLinks: getLinks }; var getRels = function (editor, initialTarget) { - var list = getRelList(editor); - if (list.length > 0) { - var isTargetBlank_1 = initialTarget.is('_blank'); - var enforceSafe = allowUnsafeLinkTarget(editor) === false; - var safeRelExtractor = function (item) { - return applyRelTargetRules(ListOptions.getValue(item), isTargetBlank_1); - }; - var sanitizer = enforceSafe ? ListOptions.sanitizeWith(safeRelExtractor) : ListOptions.sanitize; - return sanitizer(list); - } - return Optional.none(); + var list = getRelList(editor); + if (list.length > 0) { + var isTargetBlank_1 = initialTarget.is('_blank'); + var enforceSafe = allowUnsafeLinkTarget(editor) === false; + var safeRelExtractor = function (item) { + return applyRelTargetRules(ListOptions.getValue(item), isTargetBlank_1); + }; + var sanitizer = enforceSafe ? ListOptions.sanitizeWith(safeRelExtractor) : ListOptions.sanitize; + return sanitizer(list); + } + return Optional.none(); }; - var RelOptions = {getRels: getRels}; + var RelOptions = { getRels: getRels }; var fallbacks = [ - { - text: 'Current window', - value: '' - }, - { - text: 'New window', - value: '_blank' - } + { + text: 'Current window', + value: '' + }, + { + text: 'New window', + value: '_blank' + } ]; var getTargets = function (editor) { - var list = getTargetList(editor); - if (isArray(list)) { - return ListOptions.sanitize(list).orThunk(function () { - return Optional.some(fallbacks); - }); - } else if (list === false) { - return Optional.none(); - } - return Optional.some(fallbacks); + var list = getTargetList(editor); + if (isArray(list)) { + return ListOptions.sanitize(list).orThunk(function () { + return Optional.some(fallbacks); + }); + } else if (list === false) { + return Optional.none(); + } + return Optional.some(fallbacks); }; - var TargetOptions = {getTargets: getTargets}; + var TargetOptions = { getTargets: getTargets }; var nonEmptyAttr = function (dom, elem, name) { - var val = dom.getAttrib(elem, name); - return val !== null && val.length > 0 ? Optional.some(val) : Optional.none(); + var val = dom.getAttrib(elem, name); + return val !== null && val.length > 0 ? Optional.some(val) : Optional.none(); }; var extractFromAnchor = function (editor, anchor) { - var dom = editor.dom; - var onlyText = isOnlyTextSelected(editor); - var text = onlyText ? Optional.some(getAnchorText(editor.selection, anchor)) : Optional.none(); - var url = anchor ? Optional.some(dom.getAttrib(anchor, 'href')) : Optional.none(); - var target = anchor ? Optional.from(dom.getAttrib(anchor, 'target')) : Optional.none(); - var rel = nonEmptyAttr(dom, anchor, 'rel'); - var linkClass = nonEmptyAttr(dom, anchor, 'class'); - var title = nonEmptyAttr(dom, anchor, 'title'); - return { - url: url, - text: text, - title: title, - target: target, - rel: rel, - linkClass: linkClass - }; + var dom = editor.dom; + var onlyText = isOnlyTextSelected(editor); + var text = onlyText ? Optional.some(getAnchorText(editor.selection, anchor)) : Optional.none(); + var url = anchor ? Optional.some(dom.getAttrib(anchor, 'href')) : Optional.none(); + var target = anchor ? Optional.from(dom.getAttrib(anchor, 'target')) : Optional.none(); + var rel = nonEmptyAttr(dom, anchor, 'rel'); + var linkClass = nonEmptyAttr(dom, anchor, 'class'); + var title = nonEmptyAttr(dom, anchor, 'title'); + return { + url: url, + text: text, + title: title, + target: target, + rel: rel, + linkClass: linkClass + }; }; var collect = function (editor, linkNode) { - return LinkListOptions.getLinks(editor).then(function (links) { - var anchor = extractFromAnchor(editor, linkNode); - return { - anchor: anchor, - catalogs: { - targets: TargetOptions.getTargets(editor), - rels: RelOptions.getRels(editor, anchor.target), - classes: ClassListOptions.getClasses(editor), - anchor: AnchorListOptions.getAnchors(editor), - link: links - }, - optNode: Optional.from(linkNode), - flags: {titleEnabled: shouldShowLinkTitle(editor)} - }; - }); + return LinkListOptions.getLinks(editor).then(function (links) { + var anchor = extractFromAnchor(editor, linkNode); + return { + anchor: anchor, + catalogs: { + targets: TargetOptions.getTargets(editor), + rels: RelOptions.getRels(editor, anchor.target), + classes: ClassListOptions.getClasses(editor), + anchor: AnchorListOptions.getAnchors(editor), + link: links + }, + optNode: Optional.from(linkNode), + flags: { titleEnabled: shouldShowLinkTitle(editor) } + }; + }); }; - var DialogInfo = {collect: collect}; + var DialogInfo = { collect: collect }; var handleSubmit = function (editor, info) { - return function (api) { - var data = api.getData(); - if (!data.url.value) { - unlink(editor); - api.close(); - return; - } - var getChangedValue = function (key) { - return Optional.from(data[key]).filter(function (value) { - return !info.anchor[key].is(value); - }); - }; - var changedData = { - href: data.url.value, - text: getChangedValue('text'), - target: getChangedValue('target'), - rel: getChangedValue('rel'), - class: getChangedValue('linkClass'), - title: getChangedValue('title') - }; - var attachState = { - href: data.url.value, - attach: data.url.meta !== undefined && data.url.meta.attach ? data.url.meta.attach : function () { - } - }; - DialogConfirms.preprocess(editor, changedData).then(function (pData) { - link(editor, attachState, pData); - }); - api.close(); + return function (api) { + var data = api.getData(); + if (!data.url.value) { + unlink(editor); + api.close(); + return; + } + var getChangedValue = function (key) { + return Optional.from(data[key]).filter(function (value) { + return !info.anchor[key].is(value); + }); + }; + var changedData = { + href: data.url.value, + text: getChangedValue('text'), + target: getChangedValue('target'), + rel: getChangedValue('rel'), + class: getChangedValue('linkClass'), + title: getChangedValue('title') }; + var attachState = { + href: data.url.value, + attach: data.url.meta !== undefined && data.url.meta.attach ? data.url.meta.attach : function () { + } + }; + DialogConfirms.preprocess(editor, changedData).then(function (pData) { + link(editor, attachState, pData); + }); + api.close(); + }; }; var collectData = function (editor) { - var anchorNode = getAnchorElement(editor); - return DialogInfo.collect(editor, anchorNode); + var anchorNode = getAnchorElement(editor); + return DialogInfo.collect(editor, anchorNode); }; var getInitialData = function (info, defaultTarget) { - var anchor = info.anchor; - var url = anchor.url.getOr(''); - return { - url: { - value: url, - meta: {original: {value: url}} - }, - text: anchor.text.getOr(''), - title: anchor.title.getOr(''), - anchor: url, - link: url, - rel: anchor.rel.getOr(''), - target: anchor.target.or(defaultTarget).getOr(''), - linkClass: anchor.linkClass.getOr('') - }; + var anchor = info.anchor; + var url = anchor.url.getOr(''); + return { + url: { + value: url, + meta: { original: { value: url } } + }, + text: anchor.text.getOr(''), + title: anchor.title.getOr(''), + anchor: url, + link: url, + rel: anchor.rel.getOr(''), + target: anchor.target.or(defaultTarget).getOr(''), + linkClass: anchor.linkClass.getOr('') + }; }; var makeDialog = function (settings, onSubmit, editor) { - var urlInput = [{ - name: 'url', - type: 'urlinput', - filetype: 'file', - label: 'URL' + var urlInput = [{ + name: 'url', + type: 'urlinput', + filetype: 'file', + label: 'URL' }]; - var displayText = settings.anchor.text.map(function () { - return { - name: 'text', - type: 'input', - label: 'Text to display' - }; - }).toArray(); - var titleText = settings.flags.titleEnabled ? [{ - name: 'title', - type: 'input', - label: 'Title' - }] : []; - var defaultTarget = Optional.from(getDefaultLinkTarget(editor)); - var initialData = getInitialData(settings, defaultTarget); - var catalogs = settings.catalogs; - var dialogDelta = DialogChanges.init(initialData, catalogs); - var body = { - type: 'panel', - items: flatten([ - urlInput, - displayText, - titleText, - cat([ - catalogs.anchor.map(ListOptions.createUi('anchor', 'Anchors')), - catalogs.rels.map(ListOptions.createUi('rel', 'Rel')), - catalogs.targets.map(ListOptions.createUi('target', 'Open link in...')), - catalogs.link.map(ListOptions.createUi('link', 'Link list')), - catalogs.classes.map(ListOptions.createUi('linkClass', 'Class')) - ]) - ]) - }; + var displayText = settings.anchor.text.map(function () { return { - title: 'Insert/Edit Link', - size: 'normal', - body: body, - buttons: [ - { - type: 'cancel', - name: 'cancel', - text: 'Cancel' - }, - { - type: 'submit', - name: 'save', - text: 'Save', - primary: true - } - ], - initialData: initialData, - onChange: function (api, _a) { - var name = _a.name; - dialogDelta.onChange(api.getData, {name: name}).each(function (newData) { - api.setData(newData); - }); - }, - onSubmit: onSubmit + name: 'text', + type: 'input', + label: 'Text to display' }; + }).toArray(); + var titleText = settings.flags.titleEnabled ? [{ + name: 'title', + type: 'input', + label: 'Title' + }] : []; + var defaultTarget = Optional.from(getDefaultLinkTarget(editor)); + var initialData = getInitialData(settings, defaultTarget); + var catalogs = settings.catalogs; + var dialogDelta = DialogChanges.init(initialData, catalogs); + var body = { + type: 'panel', + items: flatten([ + urlInput, + displayText, + titleText, + cat([ + catalogs.anchor.map(ListOptions.createUi('anchor', 'Anchors')), + catalogs.rels.map(ListOptions.createUi('rel', 'Rel')), + catalogs.targets.map(ListOptions.createUi('target', 'Open link in...')), + catalogs.link.map(ListOptions.createUi('link', 'Link list')), + catalogs.classes.map(ListOptions.createUi('linkClass', 'Class')) + ]) + ]) + }; + return { + title: 'Insert/Edit Link', + size: 'normal', + body: body, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: initialData, + onChange: function (api, _a) { + var name = _a.name; + dialogDelta.onChange(api.getData, { name: name }).each(function (newData) { + api.setData(newData); + }); + }, + onSubmit: onSubmit + }; }; var open = function (editor) { - var data = collectData(editor); - data.then(function (info) { - var onSubmit = handleSubmit(editor, info); - return makeDialog(info, onSubmit, editor); - }).then(function (spec) { - editor.windowManager.open(spec); - }); + var data = collectData(editor); + data.then(function (info) { + var onSubmit = handleSubmit(editor, info); + return makeDialog(info, onSubmit, editor); + }).then(function (spec) { + editor.windowManager.open(spec); + }); }; var appendClickRemove = function (link, evt) { - document.body.appendChild(link); - link.dispatchEvent(evt); - document.body.removeChild(link); + document.body.appendChild(link); + link.dispatchEvent(evt); + document.body.removeChild(link); }; var open$1 = function (url) { - var link = document.createElement('a'); - link.target = '_blank'; - link.href = url; - link.rel = 'noreferrer noopener'; - var evt = document.createEvent('MouseEvents'); - evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); - appendClickRemove(link, evt); + var link = document.createElement('a'); + link.target = '_blank'; + link.href = url; + link.rel = 'noreferrer noopener'; + var evt = document.createEvent('MouseEvents'); + evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); + appendClickRemove(link, evt); }; var getLink = function (editor, elm) { - return editor.dom.getParent(elm, 'a[href]'); + return editor.dom.getParent(elm, 'a[href]'); }; var getSelectedLink = function (editor) { - return getLink(editor, editor.selection.getStart()); + return getLink(editor, editor.selection.getStart()); }; var hasOnlyAltModifier = function (e) { - return e.altKey === true && e.shiftKey === false && e.ctrlKey === false && e.metaKey === false; + return e.altKey === true && e.shiftKey === false && e.ctrlKey === false && e.metaKey === false; }; var gotoLink = function (editor, a) { - if (a) { - var href = getHref(a); - if (/^#/.test(href)) { - var targetEl = editor.$(href); - if (targetEl.length) { - editor.selection.scrollIntoView(targetEl[0], true); - } - } else { - open$1(a.href); - } + if (a) { + var href = getHref(a); + if (/^#/.test(href)) { + var targetEl = editor.$(href); + if (targetEl.length) { + editor.selection.scrollIntoView(targetEl[0], true); + } + } else { + open$1(a.href); } + } }; var openDialog = function (editor) { - return function () { - open(editor); - }; + return function () { + open(editor); + }; }; var gotoSelectedLink = function (editor) { - return function () { - gotoLink(editor, getSelectedLink(editor)); - }; + return function () { + gotoLink(editor, getSelectedLink(editor)); + }; }; var setupGotoLinks = function (editor) { - editor.on('click', function (e) { - var link = getLink(editor, e.target); - if (link && global$1.metaKeyPressed(e)) { - e.preventDefault(); - gotoLink(editor, link); - } - }); - editor.on('keydown', function (e) { - var link = getSelectedLink(editor); - if (link && e.keyCode === 13 && hasOnlyAltModifier(e)) { - e.preventDefault(); - gotoLink(editor, link); - } - }); + editor.on('click', function (e) { + var link = getLink(editor, e.target); + if (link && global$1.metaKeyPressed(e)) { + e.preventDefault(); + gotoLink(editor, link); + } + }); + editor.on('keydown', function (e) { + var link = getSelectedLink(editor); + if (link && e.keyCode === 13 && hasOnlyAltModifier(e)) { + e.preventDefault(); + gotoLink(editor, link); + } + }); }; var toggleState = function (editor, toggler) { - editor.on('NodeChange', toggler); - return function () { - return editor.off('NodeChange', toggler); - }; + editor.on('NodeChange', toggler); + return function () { + return editor.off('NodeChange', toggler); + }; }; var toggleActiveState = function (editor) { - return function (api) { - return toggleState(editor, function () { - api.setActive(!editor.mode.isReadOnly() && getAnchorElement(editor, editor.selection.getNode()) !== null); - }); - }; + return function (api) { + return toggleState(editor, function () { + api.setActive(!editor.mode.isReadOnly() && getAnchorElement(editor, editor.selection.getNode()) !== null); + }); + }; }; var toggleEnabledState = function (editor) { - return function (api) { - var updateState = function () { - return api.setDisabled(getAnchorElement(editor, editor.selection.getNode()) === null); - }; - updateState(); - return toggleState(editor, updateState); + return function (api) { + var updateState = function () { + return api.setDisabled(getAnchorElement(editor, editor.selection.getNode()) === null); }; + updateState(); + return toggleState(editor, updateState); + }; }; var toggleUnlinkState = function (editor) { - return function (api) { - var hasLinks$1 = function (parents) { - return hasLinks(parents) || hasLinksInSelection(editor.selection.getRng()); - }; - var parents = editor.dom.getParents(editor.selection.getStart()); - api.setDisabled(!hasLinks$1(parents)); - return toggleState(editor, function (e) { - return api.setDisabled(!hasLinks$1(e.parents)); - }); + return function (api) { + var hasLinks$1 = function (parents) { + return hasLinks(parents) || hasLinksInSelection(editor.selection.getRng()); }; + var parents = editor.dom.getParents(editor.selection.getStart()); + api.setDisabled(!hasLinks$1(parents)); + return toggleState(editor, function (e) { + return api.setDisabled(!hasLinks$1(e.parents)); + }); + }; }; var register = function (editor) { - editor.addCommand('mceLink', function () { - if (useQuickLink(editor)) { - editor.fire('contexttoolbar-show', {toolbarKey: 'quicklink'}); - } else { - openDialog(editor)(); - } - }); + editor.addCommand('mceLink', function () { + if (useQuickLink(editor)) { + editor.fire('contexttoolbar-show', { toolbarKey: 'quicklink' }); + } else { + openDialog(editor)(); + } + }); }; var setup = function (editor) { - editor.addShortcut('Meta+K', '', function () { - editor.execCommand('mceLink'); - }); + editor.addShortcut('Meta+K', '', function () { + editor.execCommand('mceLink'); + }); }; var setupButtons = function (editor) { - editor.ui.registry.addToggleButton('link', { - icon: 'link', - tooltip: 'Insert/edit link', - onAction: openDialog(editor), - onSetup: toggleActiveState(editor) - }); - editor.ui.registry.addButton('openlink', { - icon: 'new-tab', - tooltip: 'Open link', - onAction: gotoSelectedLink(editor), - onSetup: toggleEnabledState(editor) - }); - editor.ui.registry.addButton('unlink', { - icon: 'unlink', - tooltip: 'Remove link', - onAction: function () { - return unlink(editor); - }, - onSetup: toggleUnlinkState(editor) - }); + editor.ui.registry.addToggleButton('link', { + icon: 'link', + tooltip: 'Insert/edit link', + onAction: openDialog(editor), + onSetup: toggleActiveState(editor) + }); + editor.ui.registry.addButton('openlink', { + icon: 'new-tab', + tooltip: 'Open link', + onAction: gotoSelectedLink(editor), + onSetup: toggleEnabledState(editor) + }); + editor.ui.registry.addButton('unlink', { + icon: 'unlink', + tooltip: 'Remove link', + onAction: function () { + return unlink(editor); + }, + onSetup: toggleUnlinkState(editor) + }); }; var setupMenuItems = function (editor) { - editor.ui.registry.addMenuItem('openlink', { - text: 'Open link', - icon: 'new-tab', - onAction: gotoSelectedLink(editor), - onSetup: toggleEnabledState(editor) - }); - editor.ui.registry.addMenuItem('link', { - icon: 'link', - text: 'Link...', - shortcut: 'Meta+K', - onAction: openDialog(editor) - }); - editor.ui.registry.addMenuItem('unlink', { - icon: 'unlink', - text: 'Remove link', - onAction: function () { - return unlink(editor); - }, - onSetup: toggleUnlinkState(editor) - }); + editor.ui.registry.addMenuItem('openlink', { + text: 'Open link', + icon: 'new-tab', + onAction: gotoSelectedLink(editor), + onSetup: toggleEnabledState(editor) + }); + editor.ui.registry.addMenuItem('link', { + icon: 'link', + text: 'Link...', + shortcut: 'Meta+K', + onAction: openDialog(editor) + }); + editor.ui.registry.addMenuItem('unlink', { + icon: 'unlink', + text: 'Remove link', + onAction: function () { + return unlink(editor); + }, + onSetup: toggleUnlinkState(editor) + }); }; var setupContextMenu = function (editor) { - var inLink = 'link unlink openlink'; - var noLink = 'link'; - editor.ui.registry.addContextMenu('link', { - update: function (element) { - return hasLinks(editor.dom.getParents(element, 'a')) ? inLink : noLink; - } - }); + var inLink = 'link unlink openlink'; + var noLink = 'link'; + editor.ui.registry.addContextMenu('link', { + update: function (element) { + return hasLinks(editor.dom.getParents(element, 'a')) ? inLink : noLink; + } + }); }; var setupContextToolbars = function (editor) { - var collapseSelectionToEnd = function (editor) { - editor.selection.collapse(false); - }; - var onSetupLink = function (buttonApi) { - var node = editor.selection.getNode(); - buttonApi.setDisabled(!getAnchorElement(editor, node)); - return function () { - }; + var collapseSelectionToEnd = function (editor) { + editor.selection.collapse(false); + }; + var onSetupLink = function (buttonApi) { + var node = editor.selection.getNode(); + buttonApi.setDisabled(!getAnchorElement(editor, node)); + return function () { }; - editor.ui.registry.addContextForm('quicklink', { - launch: { - type: 'contextformtogglebutton', - icon: 'link', - tooltip: 'Link', - onSetup: toggleActiveState(editor) - }, - label: 'Link', - predicate: function (node) { - return !!getAnchorElement(editor, node) && hasContextToolbar(editor); - }, - initValue: function () { - var elm = getAnchorElement(editor); - return !!elm ? getHref(elm) : ''; + }; + editor.ui.registry.addContextForm('quicklink', { + launch: { + type: 'contextformtogglebutton', + icon: 'link', + tooltip: 'Link', + onSetup: toggleActiveState(editor) + }, + label: 'Link', + predicate: function (node) { + return !!getAnchorElement(editor, node) && hasContextToolbar(editor); + }, + initValue: function () { + var elm = getAnchorElement(editor); + return !!elm ? getHref(elm) : ''; + }, + commands: [ + { + type: 'contextformtogglebutton', + icon: 'link', + tooltip: 'Link', + primary: true, + onSetup: function (buttonApi) { + var node = editor.selection.getNode(); + buttonApi.setActive(!!getAnchorElement(editor, node)); + return toggleActiveState(editor)(buttonApi); }, - commands: [ - { - type: 'contextformtogglebutton', - icon: 'link', - tooltip: 'Link', - primary: true, - onSetup: function (buttonApi) { - var node = editor.selection.getNode(); - buttonApi.setActive(!!getAnchorElement(editor, node)); - return toggleActiveState(editor)(buttonApi); - }, - onAction: function (formApi) { - var anchor = getAnchorElement(editor); - var value = formApi.getValue(); - if (!anchor) { - var attachState = { - href: value, - attach: function () { - } - }; - var onlyText = isOnlyTextSelected(editor); - var text = onlyText ? Optional.some(getAnchorText(editor.selection, anchor)).filter(function (t) { - return t.length > 0; - }).or(Optional.from(value)) : Optional.none(); - link(editor, attachState, { - href: value, - text: text, - title: Optional.none(), - rel: Optional.none(), - target: Optional.none(), - class: Optional.none() - }); - formApi.hide(); - } else { - editor.undoManager.transact(function () { - editor.dom.setAttrib(anchor, 'href', value); - collapseSelectionToEnd(editor); - formApi.hide(); - }); - } - } - }, - { - type: 'contextformbutton', - icon: 'unlink', - tooltip: 'Remove link', - onSetup: onSetupLink, - onAction: function (formApi) { - unlink(editor); - formApi.hide(); - } - }, - { - type: 'contextformbutton', - icon: 'new-tab', - tooltip: 'Open link', - onSetup: onSetupLink, - onAction: function (formApi) { - gotoSelectedLink(editor)(); - formApi.hide(); - } - } - ] - }); + onAction: function (formApi) { + var anchor = getAnchorElement(editor); + var value = formApi.getValue(); + if (!anchor) { + var attachState = { + href: value, + attach: function () { + } + }; + var onlyText = isOnlyTextSelected(editor); + var text = onlyText ? Optional.some(getAnchorText(editor.selection, anchor)).filter(function (t) { + return t.length > 0; + }).or(Optional.from(value)) : Optional.none(); + link(editor, attachState, { + href: value, + text: text, + title: Optional.none(), + rel: Optional.none(), + target: Optional.none(), + class: Optional.none() + }); + formApi.hide(); + } else { + editor.undoManager.transact(function () { + editor.dom.setAttrib(anchor, 'href', value); + collapseSelectionToEnd(editor); + formApi.hide(); + }); + } + } + }, + { + type: 'contextformbutton', + icon: 'unlink', + tooltip: 'Remove link', + onSetup: onSetupLink, + onAction: function (formApi) { + unlink(editor); + formApi.hide(); + } + }, + { + type: 'contextformbutton', + icon: 'new-tab', + tooltip: 'Open link', + onSetup: onSetupLink, + onAction: function (formApi) { + gotoSelectedLink(editor)(); + formApi.hide(); + } + } + ] + }); }; - function Plugin() { - global.add('link', function (editor) { - setupButtons(editor); - setupMenuItems(editor); - setupContextMenu(editor); - setupContextToolbars(editor); - setupGotoLinks(editor); - register(editor); - setup(editor); - }); + function Plugin () { + global.add('link', function (editor) { + setupButtons(editor); + setupMenuItems(editor); + setupContextMenu(editor); + setupContextToolbars(editor); + setupGotoLinks(editor); + register(editor); + setup(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/lists/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/lists/plugin.js index f341f484..2505dbf6 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/lists/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/lists/plugin.js @@ -14,145 +14,145 @@ var noop = function () { }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; var not = function (f) { - return function (t) { - return !f(t); - }; + return function (t) { + return !f(t); + }; }; var never = constant(false); var always = constant(true); var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var typeOf = function (x) { - var t = typeof x; - if (x === null) { - return 'null'; - } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { - return 'array'; - } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { - return 'string'; - } else { - return t; - } + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } }; var isType = function (type) { - return function (value) { - return typeOf(value) === type; - }; + return function (value) { + return typeOf(value) === type; + }; }; var isSimpleType = function (type) { - return function (value) { - return typeof value === type; - }; + return function (value) { + return typeof value === type; + }; }; var isString = isType('string'); var isArray = isType('array'); @@ -163,338 +163,338 @@ var nativeSlice = Array.prototype.slice; var nativePush = Array.prototype.push; var map = function (xs, f) { - var len = xs.length; - var r = new Array(len); - for (var i = 0; i < len; i++) { - var x = xs[i]; - r[i] = f(x, i); - } - return r; + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; }; var each = function (xs, f) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - f(x, i); - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } }; var filter = function (xs, pred) { - var r = []; - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - r.push(x); - } + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); } - return r; + } + return r; }; var groupBy = function (xs, f) { - if (xs.length === 0) { - return []; - } else { - var wasType = f(xs[0]); - var r = []; - var group = []; - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - var type = f(x); - if (type !== wasType) { - r.push(group); - group = []; - } - wasType = type; - group.push(x); - } - if (group.length !== 0) { - r.push(group); - } - return r; + if (xs.length === 0) { + return []; + } else { + var wasType = f(xs[0]); + var r = []; + var group = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + var type = f(x); + if (type !== wasType) { + r.push(group); + group = []; + } + wasType = type; + group.push(x); + } + if (group.length !== 0) { + r.push(group); } + return r; + } }; var foldl = function (xs, f, acc) { - each(xs, function (x) { - acc = f(acc, x); - }); - return acc; + each(xs, function (x) { + acc = f(acc, x); + }); + return acc; }; var findUntil = function (xs, pred, until) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - return Optional.some(x); - } else if (until(x, i)) { - break; - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(x); + } else if (until(x, i)) { + break; } - return Optional.none(); + } + return Optional.none(); }; var find = function (xs, pred) { - return findUntil(xs, pred, never); + return findUntil(xs, pred, never); }; var flatten = function (xs) { - var r = []; - for (var i = 0, len = xs.length; i < len; ++i) { - if (!isArray(xs[i])) { - throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); - } - nativePush.apply(r, xs[i]); + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); } - return r; + nativePush.apply(r, xs[i]); + } + return r; }; var bind = function (xs, f) { - return flatten(map(xs, f)); + return flatten(map(xs, f)); }; var reverse = function (xs) { - var r = nativeSlice.call(xs, 0); - r.reverse(); - return r; + var r = nativeSlice.call(xs, 0); + r.reverse(); + return r; }; var get = function (xs, i) { - return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none(); + return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none(); }; var head = function (xs) { - return get(xs, 0); + return get(xs, 0); }; var last = function (xs) { - return get(xs, xs.length - 1); + return get(xs, xs.length - 1); }; var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); }; var cached = function (f) { - var called = false; - var r; - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (!called) { - called = true; - r = f.apply(null, args); - } - return r; - }; + var called = false; + var r; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!called) { + called = true; + r = f.apply(null, args); + } + return r; + }; }; var DeviceType = function (os, browser, userAgent, mediaMatch) { - var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true; - var isiPhone = os.isiOS() && !isiPad; - var isMobile = os.isiOS() || os.isAndroid(); - var isTouch = isMobile || mediaMatch('(pointer:coarse)'); - var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)'); - var isPhone = isiPhone || isMobile && !isTablet; - var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false; - var isDesktop = !isPhone && !isTablet && !iOSwebview; - return { - isiPad: constant(isiPad), - isiPhone: constant(isiPhone), - isTablet: constant(isTablet), - isPhone: constant(isPhone), - isTouch: constant(isTouch), - isAndroid: os.isAndroid, - isiOS: os.isiOS, - isWebView: constant(iOSwebview), - isDesktop: constant(isDesktop) - }; + var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true; + var isiPhone = os.isiOS() && !isiPad; + var isMobile = os.isiOS() || os.isAndroid(); + var isTouch = isMobile || mediaMatch('(pointer:coarse)'); + var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)'); + var isPhone = isiPhone || isMobile && !isTablet; + var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false; + var isDesktop = !isPhone && !isTablet && !iOSwebview; + return { + isiPad: constant(isiPad), + isiPhone: constant(isiPhone), + isTablet: constant(isTablet), + isPhone: constant(isPhone), + isTouch: constant(isTouch), + isAndroid: os.isAndroid, + isiOS: os.isiOS, + isWebView: constant(iOSwebview), + isDesktop: constant(isDesktop) + }; }; var firstMatch = function (regexes, s) { - for (var i = 0; i < regexes.length; i++) { - var x = regexes[i]; - if (x.test(s)) { - return x; - } + for (var i = 0; i < regexes.length; i++) { + var x = regexes[i]; + if (x.test(s)) { + return x; } - return undefined; + } + return undefined; }; var find$1 = function (regexes, agent) { - var r = firstMatch(regexes, agent); - if (!r) { - return { - major: 0, - minor: 0 - }; - } - var group = function (i) { - return Number(agent.replace(r, '$' + i)); + var r = firstMatch(regexes, agent); + if (!r) { + return { + major: 0, + minor: 0 }; - return nu(group(1), group(2)); + } + var group = function (i) { + return Number(agent.replace(r, '$' + i)); + }; + return nu(group(1), group(2)); }; var detect = function (versionRegexes, agent) { - var cleanedAgent = String(agent).toLowerCase(); - if (versionRegexes.length === 0) { - return unknown(); - } - return find$1(versionRegexes, cleanedAgent); + var cleanedAgent = String(agent).toLowerCase(); + if (versionRegexes.length === 0) { + return unknown(); + } + return find$1(versionRegexes, cleanedAgent); }; var unknown = function () { - return nu(0, 0); + return nu(0, 0); }; var nu = function (major, minor) { - return { - major: major, - minor: minor - }; + return { + major: major, + minor: minor + }; }; var Version = { - nu: nu, - detect: detect, - unknown: unknown + nu: nu, + detect: detect, + unknown: unknown }; var detect$1 = function (candidates, userAgent) { - var agent = String(userAgent).toLowerCase(); - return find(candidates, function (candidate) { - return candidate.search(agent); - }); + var agent = String(userAgent).toLowerCase(); + return find(candidates, function (candidate) { + return candidate.search(agent); + }); }; var detectBrowser = function (browsers, userAgent) { - return detect$1(browsers, userAgent).map(function (browser) { - var version = Version.detect(browser.versionRegexes, userAgent); - return { - current: browser.name, - version: version - }; - }); + return detect$1(browsers, userAgent).map(function (browser) { + var version = Version.detect(browser.versionRegexes, userAgent); + return { + current: browser.name, + version: version + }; + }); }; var detectOs = function (oses, userAgent) { - return detect$1(oses, userAgent).map(function (os) { - var version = Version.detect(os.versionRegexes, userAgent); - return { - current: os.name, - version: version - }; - }); + return detect$1(oses, userAgent).map(function (os) { + var version = Version.detect(os.versionRegexes, userAgent); + return { + current: os.name, + version: version + }; + }); }; var UaString = { - detectBrowser: detectBrowser, - detectOs: detectOs + detectBrowser: detectBrowser, + detectOs: detectOs }; var contains = function (str, substr) { - return str.indexOf(substr) !== -1; + return str.indexOf(substr) !== -1; }; var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/; var checkContains = function (target) { - return function (uastring) { - return contains(uastring, target); - }; + return function (uastring) { + return contains(uastring, target); + }; }; var browsers = [ - { - name: 'Edge', - versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/], - search: function (uastring) { - return contains(uastring, 'edge/') && contains(uastring, 'chrome') && contains(uastring, 'safari') && contains(uastring, 'applewebkit'); - } - }, - { - name: 'Chrome', - versionRegexes: [ - /.*?chrome\/([0-9]+)\.([0-9]+).*/, - normalVersionRegex - ], - search: function (uastring) { - return contains(uastring, 'chrome') && !contains(uastring, 'chromeframe'); - } - }, - { - name: 'IE', - versionRegexes: [ - /.*?msie\ ?([0-9]+)\.([0-9]+).*/, - /.*?rv:([0-9]+)\.([0-9]+).*/ - ], - search: function (uastring) { - return contains(uastring, 'msie') || contains(uastring, 'trident'); - } - }, - { - name: 'Opera', - versionRegexes: [ - normalVersionRegex, - /.*?opera\/([0-9]+)\.([0-9]+).*/ - ], - search: checkContains('opera') - }, - { - name: 'Firefox', - versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/], - search: checkContains('firefox') - }, - { - name: 'Safari', - versionRegexes: [ - normalVersionRegex, - /.*?cpu os ([0-9]+)_([0-9]+).*/ - ], - search: function (uastring) { - return (contains(uastring, 'safari') || contains(uastring, 'mobile/')) && contains(uastring, 'applewebkit'); - } - } + { + name: 'Edge', + versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/], + search: function (uastring) { + return contains(uastring, 'edge/') && contains(uastring, 'chrome') && contains(uastring, 'safari') && contains(uastring, 'applewebkit'); + } + }, + { + name: 'Chrome', + versionRegexes: [ + /.*?chrome\/([0-9]+)\.([0-9]+).*/, + normalVersionRegex + ], + search: function (uastring) { + return contains(uastring, 'chrome') && !contains(uastring, 'chromeframe'); + } + }, + { + name: 'IE', + versionRegexes: [ + /.*?msie\ ?([0-9]+)\.([0-9]+).*/, + /.*?rv:([0-9]+)\.([0-9]+).*/ + ], + search: function (uastring) { + return contains(uastring, 'msie') || contains(uastring, 'trident'); + } + }, + { + name: 'Opera', + versionRegexes: [ + normalVersionRegex, + /.*?opera\/([0-9]+)\.([0-9]+).*/ + ], + search: checkContains('opera') + }, + { + name: 'Firefox', + versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/], + search: checkContains('firefox') + }, + { + name: 'Safari', + versionRegexes: [ + normalVersionRegex, + /.*?cpu os ([0-9]+)_([0-9]+).*/ + ], + search: function (uastring) { + return (contains(uastring, 'safari') || contains(uastring, 'mobile/')) && contains(uastring, 'applewebkit'); + } + } ]; var oses = [ - { - name: 'Windows', - search: checkContains('win'), - versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/] - }, - { - name: 'iOS', - search: function (uastring) { - return contains(uastring, 'iphone') || contains(uastring, 'ipad'); - }, - versionRegexes: [ - /.*?version\/\ ?([0-9]+)\.([0-9]+).*/, - /.*cpu os ([0-9]+)_([0-9]+).*/, - /.*cpu iphone os ([0-9]+)_([0-9]+).*/ - ] - }, - { - name: 'Android', - search: checkContains('android'), - versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/] + { + name: 'Windows', + search: checkContains('win'), + versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'iOS', + search: function (uastring) { + return contains(uastring, 'iphone') || contains(uastring, 'ipad'); }, - { - name: 'OSX', - search: checkContains('mac os x'), - versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/] - }, - { - name: 'Linux', - search: checkContains('linux'), - versionRegexes: [] - }, - { - name: 'Solaris', - search: checkContains('sunos'), - versionRegexes: [] - }, - { - name: 'FreeBSD', - search: checkContains('freebsd'), - versionRegexes: [] - }, - { - name: 'ChromeOS', - search: checkContains('cros'), - versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/] - } + versionRegexes: [ + /.*?version\/\ ?([0-9]+)\.([0-9]+).*/, + /.*cpu os ([0-9]+)_([0-9]+).*/, + /.*cpu iphone os ([0-9]+)_([0-9]+).*/ + ] + }, + { + name: 'Android', + search: checkContains('android'), + versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'OSX', + search: checkContains('mac os x'), + versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/] + }, + { + name: 'Linux', + search: checkContains('linux'), + versionRegexes: [] + }, + { + name: 'Solaris', + search: checkContains('sunos'), + versionRegexes: [] + }, + { + name: 'FreeBSD', + search: checkContains('freebsd'), + versionRegexes: [] + }, + { + name: 'ChromeOS', + search: checkContains('cros'), + versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/] + } ]; var PlatformInfo = { - browsers: constant(browsers), - oses: constant(oses) + browsers: constant(browsers), + oses: constant(oses) }; var edge = 'Edge'; @@ -504,39 +504,39 @@ var firefox = 'Firefox'; var safari = 'Safari'; var unknown$1 = function () { - return nu$1({ - current: undefined, - version: Version.unknown() - }); + return nu$1({ + current: undefined, + version: Version.unknown() + }); }; var nu$1 = function (info) { - var current = info.current; - var version = info.version; - var isBrowser = function (name) { - return function () { - return current === name; - }; - }; - return { - current: current, - version: version, - isEdge: isBrowser(edge), - isChrome: isBrowser(chrome), - isIE: isBrowser(ie), - isOpera: isBrowser(opera), - isFirefox: isBrowser(firefox), - isSafari: isBrowser(safari) + var current = info.current; + var version = info.version; + var isBrowser = function (name) { + return function () { + return current === name; }; + }; + return { + current: current, + version: version, + isEdge: isBrowser(edge), + isChrome: isBrowser(chrome), + isIE: isBrowser(ie), + isOpera: isBrowser(opera), + isFirefox: isBrowser(firefox), + isSafari: isBrowser(safari) + }; }; var Browser = { - unknown: unknown$1, - nu: nu$1, - edge: constant(edge), - chrome: constant(chrome), - ie: constant(ie), - opera: constant(opera), - firefox: constant(firefox), - safari: constant(safari) + unknown: unknown$1, + nu: nu$1, + edge: constant(edge), + chrome: constant(chrome), + ie: constant(ie), + opera: constant(opera), + firefox: constant(firefox), + safari: constant(safari) }; var windows = 'Windows'; @@ -548,148 +548,148 @@ var freebsd = 'FreeBSD'; var chromeos = 'ChromeOS'; var unknown$2 = function () { - return nu$2({ - current: undefined, - version: Version.unknown() - }); + return nu$2({ + current: undefined, + version: Version.unknown() + }); }; var nu$2 = function (info) { - var current = info.current; - var version = info.version; - var isOS = function (name) { - return function () { - return current === name; - }; - }; - return { - current: current, - version: version, - isWindows: isOS(windows), - isiOS: isOS(ios), - isAndroid: isOS(android), - isOSX: isOS(osx), - isLinux: isOS(linux), - isSolaris: isOS(solaris), - isFreeBSD: isOS(freebsd), - isChromeOS: isOS(chromeos) + var current = info.current; + var version = info.version; + var isOS = function (name) { + return function () { + return current === name; }; + }; + return { + current: current, + version: version, + isWindows: isOS(windows), + isiOS: isOS(ios), + isAndroid: isOS(android), + isOSX: isOS(osx), + isLinux: isOS(linux), + isSolaris: isOS(solaris), + isFreeBSD: isOS(freebsd), + isChromeOS: isOS(chromeos) + }; }; var OperatingSystem = { - unknown: unknown$2, - nu: nu$2, - windows: constant(windows), - ios: constant(ios), - android: constant(android), - linux: constant(linux), - osx: constant(osx), - solaris: constant(solaris), - freebsd: constant(freebsd), - chromeos: constant(chromeos) + unknown: unknown$2, + nu: nu$2, + windows: constant(windows), + ios: constant(ios), + android: constant(android), + linux: constant(linux), + osx: constant(osx), + solaris: constant(solaris), + freebsd: constant(freebsd), + chromeos: constant(chromeos) }; var detect$2 = function (userAgent, mediaMatch) { - var browsers = PlatformInfo.browsers(); - var oses = PlatformInfo.oses(); - var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu); - var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu); - var deviceType = DeviceType(os, browser, userAgent, mediaMatch); - return { - browser: browser, - os: os, - deviceType: deviceType - }; - }; - var PlatformDetection = {detect: detect$2}; + var browsers = PlatformInfo.browsers(); + var oses = PlatformInfo.oses(); + var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu); + var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu); + var deviceType = DeviceType(os, browser, userAgent, mediaMatch); + return { + browser: browser, + os: os, + deviceType: deviceType + }; + }; + var PlatformDetection = { detect: detect$2 }; var mediaMatch = function (query) { - return window.matchMedia(query).matches; + return window.matchMedia(query).matches; }; var platform = cached(function () { - return PlatformDetection.detect(navigator.userAgent, mediaMatch); + return PlatformDetection.detect(navigator.userAgent, mediaMatch); }); var detect$3 = function () { - return platform(); + return platform(); }; var compareDocumentPosition = function (a, b, match) { - return (a.compareDocumentPosition(b) & match) !== 0; + return (a.compareDocumentPosition(b) & match) !== 0; }; var documentPositionContainedBy = function (a, b) { - return compareDocumentPosition(a, b, Node.DOCUMENT_POSITION_CONTAINED_BY); + return compareDocumentPosition(a, b, Node.DOCUMENT_POSITION_CONTAINED_BY); }; var ELEMENT = 1; var fromHtml = function (html, scope) { - var doc = scope || document; - var div = doc.createElement('div'); - div.innerHTML = html; - if (!div.hasChildNodes() || div.childNodes.length > 1) { - console.error('HTML does not have a single root node', html); - throw new Error('HTML must have a single root node'); - } - return fromDom(div.childNodes[0]); + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); }; var fromTag = function (tag, scope) { - var doc = scope || document; - var node = doc.createElement(tag); - return fromDom(node); + var doc = scope || document; + var node = doc.createElement(tag); + return fromDom(node); }; var fromText = function (text, scope) { - var doc = scope || document; - var node = doc.createTextNode(text); - return fromDom(node); + var doc = scope || document; + var node = doc.createTextNode(text); + return fromDom(node); }; var fromDom = function (node) { - if (node === null || node === undefined) { - throw new Error('Node cannot be null or undefined'); - } - return {dom: node}; + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: node }; }; var fromPoint = function (docElm, x, y) { - return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); + return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); }; var SugarElement = { - fromHtml: fromHtml, - fromTag: fromTag, - fromText: fromText, - fromDom: fromDom, - fromPoint: fromPoint + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint }; var is = function (element, selector) { - var dom = element.dom; - if (dom.nodeType !== ELEMENT) { - return false; + var dom = element.dom; + if (dom.nodeType !== ELEMENT) { + return false; + } else { + var elem = dom; + if (elem.matches !== undefined) { + return elem.matches(selector); + } else if (elem.msMatchesSelector !== undefined) { + return elem.msMatchesSelector(selector); + } else if (elem.webkitMatchesSelector !== undefined) { + return elem.webkitMatchesSelector(selector); + } else if (elem.mozMatchesSelector !== undefined) { + return elem.mozMatchesSelector(selector); } else { - var elem = dom; - if (elem.matches !== undefined) { - return elem.matches(selector); - } else if (elem.msMatchesSelector !== undefined) { - return elem.msMatchesSelector(selector); - } else if (elem.webkitMatchesSelector !== undefined) { - return elem.webkitMatchesSelector(selector); - } else if (elem.mozMatchesSelector !== undefined) { - return elem.mozMatchesSelector(selector); - } else { - throw new Error('Browser lacks native selectors'); - } + throw new Error('Browser lacks native selectors'); } + } }; var eq = function (e1, e2) { - return e1.dom === e2.dom; + return e1.dom === e2.dom; }; var regularContains = function (e1, e2) { - var d1 = e1.dom; - var d2 = e2.dom; - return d1 === d2 ? false : d1.contains(d2); + var d1 = e1.dom; + var d2 = e2.dom; + return d1 === d2 ? false : d1.contains(d2); }; var ieContains = function (e1, e2) { - return documentPositionContainedBy(e1.dom, e2.dom); + return documentPositionContainedBy(e1.dom, e2.dom); }; var contains$1 = function (e1, e2) { - return detect$3().browser.isIE() ? ieContains(e1, e2) : regularContains(e1, e2); + return detect$3().browser.isIE() ? ieContains(e1, e2) : regularContains(e1, e2); }; var is$1 = is; @@ -701,132 +701,132 @@ var keys = Object.keys; var each$1 = function (obj, f) { - var props = keys(obj); - for (var k = 0, len = props.length; k < len; k++) { - var i = props[k]; - var x = obj[i]; - f(x, i); - } + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } }; var objAcc = function (r) { - return function (x, i) { - r[i] = x; - }; + return function (x, i) { + r[i] = x; + }; }; var internalFilter = function (obj, pred, onTrue, onFalse) { - var r = {}; - each$1(obj, function (x, i) { - (pred(x, i) ? onTrue : onFalse)(x, i); - }); - return r; + var r = {}; + each$1(obj, function (x, i) { + (pred(x, i) ? onTrue : onFalse)(x, i); + }); + return r; }; var filter$1 = function (obj, pred) { - var t = {}; - internalFilter(obj, pred, objAcc(t), noop); - return t; + var t = {}; + internalFilter(obj, pred, objAcc(t), noop); + return t; }; var Global = typeof window !== 'undefined' ? window : Function('return this;')(); var name = function (element) { - var r = element.dom.nodeName; - return r.toLowerCase(); + var r = element.dom.nodeName; + return r.toLowerCase(); }; var type = function (element) { - return element.dom.nodeType; + return element.dom.nodeType; }; var isType$1 = function (t) { - return function (element) { - return type(element) === t; - }; + return function (element) { + return type(element) === t; + }; }; var isElement = isType$1(ELEMENT); var rawSet = function (dom, key, value) { - if (isString(value) || isBoolean(value) || isNumber(value)) { - dom.setAttribute(key, value + ''); - } else { - console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); - throw new Error('Attribute value was not simple'); - } + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); + throw new Error('Attribute value was not simple'); + } }; var setAll = function (element, attrs) { - var dom = element.dom; - each$1(attrs, function (v, k) { - rawSet(dom, k, v); - }); + var dom = element.dom; + each$1(attrs, function (v, k) { + rawSet(dom, k, v); + }); }; var clone = function (element) { - return foldl(element.dom.attributes, function (acc, attr) { - acc[attr.name] = attr.value; - return acc; - }, {}); + return foldl(element.dom.attributes, function (acc, attr) { + acc[attr.name] = attr.value; + return acc; + }, {}); }; var parent = function (element) { - return Optional.from(element.dom.parentNode).map(SugarElement.fromDom); + return Optional.from(element.dom.parentNode).map(SugarElement.fromDom); }; var children = function (element) { - return map(element.dom.childNodes, SugarElement.fromDom); + return map(element.dom.childNodes, SugarElement.fromDom); }; var child = function (element, index) { - var cs = element.dom.childNodes; - return Optional.from(cs[index]).map(SugarElement.fromDom); + var cs = element.dom.childNodes; + return Optional.from(cs[index]).map(SugarElement.fromDom); }; var firstChild = function (element) { - return child(element, 0); + return child(element, 0); }; var lastChild = function (element) { - return child(element, element.dom.childNodes.length - 1); + return child(element, element.dom.childNodes.length - 1); }; var before = function (marker, element) { - var parent$1 = parent(marker); - parent$1.each(function (v) { - v.dom.insertBefore(element.dom, marker.dom); - }); + var parent$1 = parent(marker); + parent$1.each(function (v) { + v.dom.insertBefore(element.dom, marker.dom); + }); }; var append = function (parent, element) { - parent.dom.appendChild(element.dom); + parent.dom.appendChild(element.dom); }; var before$1 = function (marker, elements) { - each(elements, function (x) { - before(marker, x); - }); + each(elements, function (x) { + before(marker, x); + }); }; var append$1 = function (parent, elements) { - each(elements, function (x) { - append(parent, x); - }); + each(elements, function (x) { + append(parent, x); + }); }; var remove = function (element) { - var dom = element.dom; - if (dom.parentNode !== null) { - dom.parentNode.removeChild(dom); - } + var dom = element.dom; + if (dom.parentNode !== null) { + dom.parentNode.removeChild(dom); + } }; var clone$1 = function (original, isDeep) { - return SugarElement.fromDom(original.dom.cloneNode(isDeep)); + return SugarElement.fromDom(original.dom.cloneNode(isDeep)); }; var deep = function (original) { - return clone$1(original, true); + return clone$1(original, true); }; var shallowAs = function (original, tag) { - var nu = SugarElement.fromTag(tag); - var attributes = clone(original); - setAll(nu, attributes); - return nu; + var nu = SugarElement.fromTag(tag); + var attributes = clone(original); + setAll(nu, attributes); + return nu; }; var mutate = function (original, tag) { - var nu = shallowAs(original, tag); - before(original, nu); - var children$1 = children(original); - append$1(nu, children$1); - remove(original); - return nu; + var nu = shallowAs(original, tag); + before(original, nu); + var children$1 = children(original); + append$1(nu, children$1); + remove(original); + return nu; }; var global$4 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); @@ -834,17 +834,17 @@ var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var matchNodeName = function (name) { - return function (node) { - return node && node.nodeName.toLowerCase() === name; - }; + return function (node) { + return node && node.nodeName.toLowerCase() === name; + }; }; var matchNodeNames = function (regex) { - return function (node) { - return node && regex.test(node.nodeName); - }; + return function (node) { + return node && regex.test(node.nodeName); + }; }; var isTextNode = function (node) { - return node && node.nodeType === 3; + return node && node.nodeType === 3; }; var isListNode = matchNodeNames(/^(OL|UL|DL)$/); var isOlUlNode = matchNodeNames(/^(OL|UL)$/); @@ -854,1294 +854,1293 @@ var isTableCellNode = matchNodeNames(/^(TH|TD)$/); var isBr = matchNodeName('br'); var isFirstChild = function (node) { - return node.parentNode.firstChild === node; + return node.parentNode.firstChild === node; }; var isTextBlock = function (editor, node) { - return node && !!editor.schema.getTextBlockElements()[node.nodeName]; + return node && !!editor.schema.getTextBlockElements()[node.nodeName]; }; var isBlock = function (node, blockElements) { - return node && node.nodeName in blockElements; + return node && node.nodeName in blockElements; }; var isBogusBr = function (dom, node) { - if (!isBr(node)) { - return false; - } - return dom.isBlock(node.nextSibling) && !isBr(node.previousSibling); + if (!isBr(node)) { + return false; + } + return dom.isBlock(node.nextSibling) && !isBr(node.previousSibling); }; var isEmpty = function (dom, elm, keepBookmarks) { - var empty = dom.isEmpty(elm); - if (keepBookmarks && dom.select('span[data-mce-type=bookmark]', elm).length > 0) { - return false; - } - return empty; + var empty = dom.isEmpty(elm); + if (keepBookmarks && dom.select('span[data-mce-type=bookmark]', elm).length > 0) { + return false; + } + return empty; }; var isChildOfBody = function (dom, elm) { - return dom.isChildOf(elm, dom.getRoot()); + return dom.isChildOf(elm, dom.getRoot()); }; var shouldIndentOnTab = function (editor) { - return editor.getParam('lists_indent_on_tab', true); + return editor.getParam('lists_indent_on_tab', true); }; var getForcedRootBlock = function (editor) { - var block = editor.getParam('forced_root_block', 'p'); - if (block === false) { - return ''; - } else if (block === true) { - return 'p'; - } else { - return block; - } + var block = editor.getParam('forced_root_block', 'p'); + if (block === false) { + return ''; + } else if (block === true) { + return 'p'; + } else { + return block; + } }; var getForcedRootBlockAttrs = function (editor) { - return editor.getParam('forced_root_block_attrs', {}); + return editor.getParam('forced_root_block_attrs', {}); }; var createTextBlock = function (editor, contentNode) { - var dom = editor.dom; - var blockElements = editor.schema.getBlockElements(); - var fragment = dom.createFragment(); - var blockName = getForcedRootBlock(editor); - var node, textBlock, hasContentNode; - if (blockName) { - textBlock = dom.create(blockName); - if (textBlock.tagName === blockName.toUpperCase()) { - dom.setAttribs(textBlock, getForcedRootBlockAttrs(editor)); - } - if (!isBlock(contentNode.firstChild, blockElements)) { + var dom = editor.dom; + var blockElements = editor.schema.getBlockElements(); + var fragment = dom.createFragment(); + var blockName = getForcedRootBlock(editor); + var node, textBlock, hasContentNode; + if (blockName) { + textBlock = dom.create(blockName); + if (textBlock.tagName === blockName.toUpperCase()) { + dom.setAttribs(textBlock, getForcedRootBlockAttrs(editor)); + } + if (!isBlock(contentNode.firstChild, blockElements)) { + fragment.appendChild(textBlock); + } + } + if (contentNode) { + while (node = contentNode.firstChild) { + var nodeName = node.nodeName; + if (!hasContentNode && (nodeName !== 'SPAN' || node.getAttribute('data-mce-type') !== 'bookmark')) { + hasContentNode = true; + } + if (isBlock(node, blockElements)) { + fragment.appendChild(node); + textBlock = null; + } else { + if (blockName) { + if (!textBlock) { + textBlock = dom.create(blockName); fragment.appendChild(textBlock); + } + textBlock.appendChild(node); + } else { + fragment.appendChild(node); } + } } - if (contentNode) { - while (node = contentNode.firstChild) { - var nodeName = node.nodeName; - if (!hasContentNode && (nodeName !== 'SPAN' || node.getAttribute('data-mce-type') !== 'bookmark')) { - hasContentNode = true; - } - if (isBlock(node, blockElements)) { - fragment.appendChild(node); - textBlock = null; - } else { - if (blockName) { - if (!textBlock) { - textBlock = dom.create(blockName); - fragment.appendChild(textBlock); - } - textBlock.appendChild(node); - } else { - fragment.appendChild(node); - } - } - } - } - if (!blockName) { - fragment.appendChild(dom.create('br')); - } else { - if (!hasContentNode) { - textBlock.appendChild(dom.create('br', {'data-mce-bogus': '1'})); - } + } + if (!blockName) { + fragment.appendChild(dom.create('br')); + } else { + if (!hasContentNode) { + textBlock.appendChild(dom.create('br', { 'data-mce-bogus': '1' })); } - return fragment; + } + return fragment; }; var DOM = global$4.DOM; var splitList = function (editor, ul, li) { - var removeAndKeepBookmarks = function (targetNode) { - global$5.each(bookmarks, function (node) { - targetNode.parentNode.insertBefore(node, li.parentNode); - }); - DOM.remove(targetNode); - }; - var bookmarks = DOM.select('span[data-mce-type="bookmark"]', ul); - var newBlock = createTextBlock(editor, li); - var tmpRng = DOM.createRng(); - tmpRng.setStartAfter(li); - tmpRng.setEndAfter(ul); - var fragment = tmpRng.extractContents(); - for (var node = fragment.firstChild; node; node = node.firstChild) { - if (node.nodeName === 'LI' && editor.dom.isEmpty(node)) { - DOM.remove(node); - break; - } - } - if (!editor.dom.isEmpty(fragment)) { - DOM.insertAfter(fragment, ul); - } - DOM.insertAfter(newBlock, ul); - if (isEmpty(editor.dom, li.parentNode)) { - removeAndKeepBookmarks(li.parentNode); - } - DOM.remove(li); - if (isEmpty(editor.dom, ul)) { - DOM.remove(ul); - } + var removeAndKeepBookmarks = function (targetNode) { + global$5.each(bookmarks, function (node) { + targetNode.parentNode.insertBefore(node, li.parentNode); + }); + DOM.remove(targetNode); + }; + var bookmarks = DOM.select('span[data-mce-type="bookmark"]', ul); + var newBlock = createTextBlock(editor, li); + var tmpRng = DOM.createRng(); + tmpRng.setStartAfter(li); + tmpRng.setEndAfter(ul); + var fragment = tmpRng.extractContents(); + for (var node = fragment.firstChild; node; node = node.firstChild) { + if (node.nodeName === 'LI' && editor.dom.isEmpty(node)) { + DOM.remove(node); + break; + } + } + if (!editor.dom.isEmpty(fragment)) { + DOM.insertAfter(fragment, ul); + } + DOM.insertAfter(newBlock, ul); + if (isEmpty(editor.dom, li.parentNode)) { + removeAndKeepBookmarks(li.parentNode); + } + DOM.remove(li); + if (isEmpty(editor.dom, ul)) { + DOM.remove(ul); + } }; var outdentDlItem = function (editor, item) { - if (is$1(item, 'dd')) { - mutate(item, 'dt'); - } else if (is$1(item, 'dt')) { - parent(item).each(function (dl) { - return splitList(editor, dl.dom, item.dom); - }); - } + if (is$1(item, 'dd')) { + mutate(item, 'dt'); + } else if (is$1(item, 'dt')) { + parent(item).each(function (dl) { + return splitList(editor, dl.dom, item.dom); + }); + } }; var indentDlItem = function (item) { - if (is$1(item, 'dt')) { - mutate(item, 'dd'); - } + if (is$1(item, 'dt')) { + mutate(item, 'dd'); + } }; var dlIndentation = function (editor, indentation, dlItems) { - if (indentation === 'Indent') { - each(dlItems, indentDlItem); - } else { - each(dlItems, function (item) { - return outdentDlItem(editor, item); - }); - } + if (indentation === 'Indent') { + each(dlItems, indentDlItem); + } else { + each(dlItems, function (item) { + return outdentDlItem(editor, item); + }); + } }; var getNormalizedPoint = function (container, offset) { - if (isTextNode(container)) { - return { - container: container, - offset: offset - }; - } - var node = global$1.getNode(container, offset); - if (isTextNode(node)) { - return { - container: node, - offset: offset >= container.childNodes.length ? node.data.length : 0 - }; - } else if (node.previousSibling && isTextNode(node.previousSibling)) { - return { - container: node.previousSibling, - offset: node.previousSibling.data.length - }; - } else if (node.nextSibling && isTextNode(node.nextSibling)) { - return { - container: node.nextSibling, - offset: 0 - }; - } + if (isTextNode(container)) { return { - container: container, - offset: offset + container: container, + offset: offset }; + } + var node = global$1.getNode(container, offset); + if (isTextNode(node)) { + return { + container: node, + offset: offset >= container.childNodes.length ? node.data.length : 0 + }; + } else if (node.previousSibling && isTextNode(node.previousSibling)) { + return { + container: node.previousSibling, + offset: node.previousSibling.data.length + }; + } else if (node.nextSibling && isTextNode(node.nextSibling)) { + return { + container: node.nextSibling, + offset: 0 + }; + } + return { + container: container, + offset: offset + }; }; var normalizeRange = function (rng) { - var outRng = rng.cloneRange(); - var rangeStart = getNormalizedPoint(rng.startContainer, rng.startOffset); - outRng.setStart(rangeStart.container, rangeStart.offset); - var rangeEnd = getNormalizedPoint(rng.endContainer, rng.endOffset); - outRng.setEnd(rangeEnd.container, rangeEnd.offset); - return outRng; + var outRng = rng.cloneRange(); + var rangeStart = getNormalizedPoint(rng.startContainer, rng.startOffset); + outRng.setStart(rangeStart.container, rangeStart.offset); + var rangeEnd = getNormalizedPoint(rng.endContainer, rng.endOffset); + outRng.setEnd(rangeEnd.container, rangeEnd.offset); + return outRng; }; var global$6 = tinymce.util.Tools.resolve('tinymce.dom.DomQuery'); var getParentList = function (editor, node) { - var selectionStart = node || editor.selection.getStart(true); - return editor.dom.getParent(selectionStart, 'OL,UL,DL', getClosestListRootElm(editor, selectionStart)); + var selectionStart = node || editor.selection.getStart(true); + return editor.dom.getParent(selectionStart, 'OL,UL,DL', getClosestListRootElm(editor, selectionStart)); }; var isParentListSelected = function (parentList, selectedBlocks) { - return parentList && selectedBlocks.length === 1 && selectedBlocks[0] === parentList; + return parentList && selectedBlocks.length === 1 && selectedBlocks[0] === parentList; }; var findSubLists = function (parentList) { - return global$5.grep(parentList.querySelectorAll('ol,ul,dl'), function (elm) { - return isListNode(elm); - }); + return global$5.grep(parentList.querySelectorAll('ol,ul,dl'), function (elm) { + return isListNode(elm); + }); }; var getSelectedSubLists = function (editor) { - var parentList = getParentList(editor); - var selectedBlocks = editor.selection.getSelectedBlocks(); - if (isParentListSelected(parentList, selectedBlocks)) { - return findSubLists(parentList); - } else { - return global$5.grep(selectedBlocks, function (elm) { - return isListNode(elm) && parentList !== elm; - }); - } + var parentList = getParentList(editor); + var selectedBlocks = editor.selection.getSelectedBlocks(); + if (isParentListSelected(parentList, selectedBlocks)) { + return findSubLists(parentList); + } else { + return global$5.grep(selectedBlocks, function (elm) { + return isListNode(elm) && parentList !== elm; + }); + } }; var findParentListItemsNodes = function (editor, elms) { - var listItemsElms = global$5.map(elms, function (elm) { - var parentLi = editor.dom.getParent(elm, 'li,dd,dt', getClosestListRootElm(editor, elm)); - return parentLi ? parentLi : elm; - }); - return global$6.unique(listItemsElms); + var listItemsElms = global$5.map(elms, function (elm) { + var parentLi = editor.dom.getParent(elm, 'li,dd,dt', getClosestListRootElm(editor, elm)); + return parentLi ? parentLi : elm; + }); + return global$6.unique(listItemsElms); }; var getSelectedListItems = function (editor) { - var selectedBlocks = editor.selection.getSelectedBlocks(); - return global$5.grep(findParentListItemsNodes(editor, selectedBlocks), function (block) { - return isListItemNode(block); - }); + var selectedBlocks = editor.selection.getSelectedBlocks(); + return global$5.grep(findParentListItemsNodes(editor, selectedBlocks), function (block) { + return isListItemNode(block); + }); }; var getSelectedDlItems = function (editor) { - return filter(getSelectedListItems(editor), isDlItemNode); + return filter(getSelectedListItems(editor), isDlItemNode); }; var getClosestListRootElm = function (editor, elm) { - var parentTableCell = editor.dom.getParents(elm, 'TD,TH'); - var root = parentTableCell.length > 0 ? parentTableCell[0] : editor.getBody(); - return root; + var parentTableCell = editor.dom.getParents(elm, 'TD,TH'); + var root = parentTableCell.length > 0 ? parentTableCell[0] : editor.getBody(); + return root; }; var findLastParentListNode = function (editor, elm) { - var parentLists = editor.dom.getParents(elm, 'ol,ul', getClosestListRootElm(editor, elm)); - return last(parentLists); + var parentLists = editor.dom.getParents(elm, 'ol,ul', getClosestListRootElm(editor, elm)); + return last(parentLists); }; var getSelectedLists = function (editor) { - var firstList = findLastParentListNode(editor, editor.selection.getStart()); - var subsequentLists = filter(editor.selection.getSelectedBlocks(), isOlUlNode); - return firstList.toArray().concat(subsequentLists); + var firstList = findLastParentListNode(editor, editor.selection.getStart()); + var subsequentLists = filter(editor.selection.getSelectedBlocks(), isOlUlNode); + return firstList.toArray().concat(subsequentLists); }; var getSelectedListRoots = function (editor) { - var selectedLists = getSelectedLists(editor); - return getUniqueListRoots(editor, selectedLists); + var selectedLists = getSelectedLists(editor); + return getUniqueListRoots(editor, selectedLists); }; var getUniqueListRoots = function (editor, lists) { - var listRoots = map(lists, function (list) { - return findLastParentListNode(editor, list).getOr(list); - }); - return global$6.unique(listRoots); + var listRoots = map(lists, function (list) { + return findLastParentListNode(editor, list).getOr(list); + }); + return global$6.unique(listRoots); }; var lift2 = function (oa, ob, f) { - return oa.isSome() && ob.isSome() ? Optional.some(f(oa.getOrDie(), ob.getOrDie())) : Optional.none(); + return oa.isSome() && ob.isSome() ? Optional.some(f(oa.getOrDie(), ob.getOrDie())) : Optional.none(); }; var fromElements = function (elements, scope) { - var doc = scope || document; - var fragment = doc.createDocumentFragment(); - each(elements, function (element) { - fragment.appendChild(element.dom); - }); - return SugarElement.fromDom(fragment); + var doc = scope || document; + var fragment = doc.createDocumentFragment(); + each(elements, function (element) { + fragment.appendChild(element.dom); + }); + return SugarElement.fromDom(fragment); }; var fireListEvent = function (editor, action, element) { - return editor.fire('ListMutation', { - action: action, - element: element - }); + return editor.fire('ListMutation', { + action: action, + element: element + }); }; var isSupported = function (dom) { - return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); }; var internalSet = function (dom, property, value) { - if (!isString(value)) { - console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom); - throw new Error('CSS value must be a string: ' + value); - } - if (isSupported(dom)) { - dom.style.setProperty(property, value); - } + if (!isString(value)) { + console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom); + throw new Error('CSS value must be a string: ' + value); + } + if (isSupported(dom)) { + dom.style.setProperty(property, value); + } }; var set = function (element, property, value) { - var dom = element.dom; - internalSet(dom, property, value); + var dom = element.dom; + internalSet(dom, property, value); }; var joinSegment = function (parent, child) { - append(parent.item, child.list); + append(parent.item, child.list); }; var joinSegments = function (segments) { - for (var i = 1; i < segments.length; i++) { - joinSegment(segments[i - 1], segments[i]); - } + for (var i = 1; i < segments.length; i++) { + joinSegment(segments[i - 1], segments[i]); + } }; var appendSegments = function (head$1, tail) { - lift2(last(head$1), head(tail), joinSegment); + lift2(last(head$1), head(tail), joinSegment); }; var createSegment = function (scope, listType) { - var segment = { - list: SugarElement.fromTag(listType, scope), - item: SugarElement.fromTag('li', scope) - }; - append(segment.list, segment.item); - return segment; + var segment = { + list: SugarElement.fromTag(listType, scope), + item: SugarElement.fromTag('li', scope) + }; + append(segment.list, segment.item); + return segment; }; var createSegments = function (scope, entry, size) { - var segments = []; - for (var i = 0; i < size; i++) { - segments.push(createSegment(scope, entry.listType)); - } - return segments; + var segments = []; + for (var i = 0; i < size; i++) { + segments.push(createSegment(scope, entry.listType)); + } + return segments; }; var populateSegments = function (segments, entry) { - for (var i = 0; i < segments.length - 1; i++) { - set(segments[i].item, 'list-style-type', 'none'); - } - last(segments).each(function (segment) { - setAll(segment.list, entry.listAttributes); - setAll(segment.item, entry.itemAttributes); - append$1(segment.item, entry.content); - }); + for (var i = 0; i < segments.length - 1; i++) { + set(segments[i].item, 'list-style-type', 'none'); + } + last(segments).each(function (segment) { + setAll(segment.list, entry.listAttributes); + setAll(segment.item, entry.itemAttributes); + append$1(segment.item, entry.content); + }); }; var normalizeSegment = function (segment, entry) { - if (name(segment.list) !== entry.listType) { - segment.list = mutate(segment.list, entry.listType); - } - setAll(segment.list, entry.listAttributes); + if (name(segment.list) !== entry.listType) { + segment.list = mutate(segment.list, entry.listType); + } + setAll(segment.list, entry.listAttributes); }; var createItem = function (scope, attr, content) { - var item = SugarElement.fromTag('li', scope); - setAll(item, attr); - append$1(item, content); - return item; + var item = SugarElement.fromTag('li', scope); + setAll(item, attr); + append$1(item, content); + return item; }; var appendItem = function (segment, item) { - append(segment.list, item); - segment.item = item; + append(segment.list, item); + segment.item = item; }; var writeShallow = function (scope, cast, entry) { - var newCast = cast.slice(0, entry.depth); - last(newCast).each(function (segment) { - var item = createItem(scope, entry.itemAttributes, entry.content); - appendItem(segment, item); - normalizeSegment(segment, entry); - }); - return newCast; + var newCast = cast.slice(0, entry.depth); + last(newCast).each(function (segment) { + var item = createItem(scope, entry.itemAttributes, entry.content); + appendItem(segment, item); + normalizeSegment(segment, entry); + }); + return newCast; }; var writeDeep = function (scope, cast, entry) { - var segments = createSegments(scope, entry, entry.depth - cast.length); - joinSegments(segments); - populateSegments(segments, entry); - appendSegments(cast, segments); - return cast.concat(segments); + var segments = createSegments(scope, entry, entry.depth - cast.length); + joinSegments(segments); + populateSegments(segments, entry); + appendSegments(cast, segments); + return cast.concat(segments); }; var composeList = function (scope, entries) { - var cast = foldl(entries, function (cast, entry) { - return entry.depth > cast.length ? writeDeep(scope, cast, entry) : writeShallow(scope, cast, entry); - }, []); - return head(cast).map(function (segment) { - return segment.list; - }); + var cast = foldl(entries, function (cast, entry) { + return entry.depth > cast.length ? writeDeep(scope, cast, entry) : writeShallow(scope, cast, entry); + }, []); + return head(cast).map(function (segment) { + return segment.list; + }); }; var isList = function (el) { - return is$1(el, 'OL,UL'); + return is$1(el, 'OL,UL'); }; var hasFirstChildList = function (el) { - return firstChild(el).map(isList).getOr(false); + return firstChild(el).map(isList).getOr(false); }; var hasLastChildList = function (el) { - return lastChild(el).map(isList).getOr(false); + return lastChild(el).map(isList).getOr(false); }; var isIndented = function (entry) { - return entry.depth > 0; + return entry.depth > 0; }; var isSelected = function (entry) { - return entry.isSelected; + return entry.isSelected; }; var cloneItemContent = function (li) { - var children$1 = children(li); - var content = hasLastChildList(li) ? children$1.slice(0, -1) : children$1; - return map(content, deep); + var children$1 = children(li); + var content = hasLastChildList(li) ? children$1.slice(0, -1) : children$1; + return map(content, deep); }; var createEntry = function (li, depth, isSelected) { - return parent(li).filter(isElement).map(function (list) { - return { - depth: depth, - dirty: false, - isSelected: isSelected, - content: cloneItemContent(li), - itemAttributes: clone(li), - listAttributes: clone(list), - listType: name(list) - }; - }); + return parent(li).filter(isElement).map(function (list) { + return { + depth: depth, + dirty: false, + isSelected: isSelected, + content: cloneItemContent(li), + itemAttributes: clone(li), + listAttributes: clone(list), + listType: name(list) + }; + }); }; var indentEntry = function (indentation, entry) { - switch (indentation) { - case 'Indent': - entry.depth++; - break; - case 'Outdent': - entry.depth--; - break; - case 'Flatten': - entry.depth = 0; - } - entry.dirty = true; + switch (indentation) { + case 'Indent': + entry.depth++; + break; + case 'Outdent': + entry.depth--; + break; + case 'Flatten': + entry.depth = 0; + } + entry.dirty = true; }; var cloneListProperties = function (target, source) { - target.listType = source.listType; - target.listAttributes = __assign({}, source.listAttributes); + target.listType = source.listType; + target.listAttributes = __assign({}, source.listAttributes); }; var cleanListProperties = function (entry) { - entry.listAttributes = filter$1(entry.listAttributes, function (_value, key) { - return key !== 'start'; - }); + entry.listAttributes = filter$1(entry.listAttributes, function (_value, key) { + return key !== 'start'; + }); }; var closestSiblingEntry = function (entries, start) { - var depth = entries[start].depth; - var matches = function (entry) { - return entry.depth === depth && !entry.dirty; - }; - var until = function (entry) { - return entry.depth < depth; - }; - return findUntil(reverse(entries.slice(0, start)), matches, until).orThunk(function () { - return findUntil(entries.slice(start + 1), matches, until); - }); + var depth = entries[start].depth; + var matches = function (entry) { + return entry.depth === depth && !entry.dirty; + }; + var until = function (entry) { + return entry.depth < depth; + }; + return findUntil(reverse(entries.slice(0, start)), matches, until).orThunk(function () { + return findUntil(entries.slice(start + 1), matches, until); + }); }; var normalizeEntries = function (entries) { - each(entries, function (entry, i) { - closestSiblingEntry(entries, i).fold(function () { - if (entry.dirty) { - cleanListProperties(entry); - } - }, function (matchingEntry) { - return cloneListProperties(entry, matchingEntry); - }); + each(entries, function (entry, i) { + closestSiblingEntry(entries, i).fold(function () { + if (entry.dirty) { + cleanListProperties(entry); + } + }, function (matchingEntry) { + return cloneListProperties(entry, matchingEntry); }); - return entries; + }); + return entries; }; var Cell = function (initial) { - var value = initial; - var get = function () { - return value; - }; - var set = function (v) { - value = v; - }; - return { - get: get, - set: set - }; + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; }; var parseItem = function (depth, itemSelection, selectionState, item) { - return firstChild(item).filter(isList).fold(function () { - itemSelection.each(function (selection) { - if (eq(selection.start, item)) { - selectionState.set(true); - } - }); - var currentItemEntry = createEntry(item, depth, selectionState.get()); - itemSelection.each(function (selection) { - if (eq(selection.end, item)) { - selectionState.set(false); - } - }); - var childListEntries = lastChild(item).filter(isList).map(function (list) { - return parseList(depth, itemSelection, selectionState, list); - }).getOr([]); - return currentItemEntry.toArray().concat(childListEntries); - }, function (list) { - return parseList(depth, itemSelection, selectionState, list); + return firstChild(item).filter(isList).fold(function () { + itemSelection.each(function (selection) { + if (eq(selection.start, item)) { + selectionState.set(true); + } + }); + var currentItemEntry = createEntry(item, depth, selectionState.get()); + itemSelection.each(function (selection) { + if (eq(selection.end, item)) { + selectionState.set(false); + } }); + var childListEntries = lastChild(item).filter(isList).map(function (list) { + return parseList(depth, itemSelection, selectionState, list); + }).getOr([]); + return currentItemEntry.toArray().concat(childListEntries); + }, function (list) { + return parseList(depth, itemSelection, selectionState, list); + }); }; var parseList = function (depth, itemSelection, selectionState, list) { - return bind(children(list), function (element) { - var parser = isList(element) ? parseList : parseItem; - var newDepth = depth + 1; - return parser(newDepth, itemSelection, selectionState, element); - }); + return bind(children(list), function (element) { + var parser = isList(element) ? parseList : parseItem; + var newDepth = depth + 1; + return parser(newDepth, itemSelection, selectionState, element); + }); }; var parseLists = function (lists, itemSelection) { - var selectionState = Cell(false); - var initialDepth = 0; - return map(lists, function (list) { - return { - sourceList: list, - entries: parseList(initialDepth, itemSelection, selectionState, list) - }; - }); + var selectionState = Cell(false); + var initialDepth = 0; + return map(lists, function (list) { + return { + sourceList: list, + entries: parseList(initialDepth, itemSelection, selectionState, list) + }; + }); }; var outdentedComposer = function (editor, entries) { - var normalizedEntries = normalizeEntries(entries); - return map(normalizedEntries, function (entry) { - var content = fromElements(entry.content); - return SugarElement.fromDom(createTextBlock(editor, content.dom)); - }); + var normalizedEntries = normalizeEntries(entries); + return map(normalizedEntries, function (entry) { + var content = fromElements(entry.content); + return SugarElement.fromDom(createTextBlock(editor, content.dom)); + }); }; var indentedComposer = function (editor, entries) { - var normalizedEntries = normalizeEntries(entries); - return composeList(editor.contentDocument, normalizedEntries).toArray(); + var normalizedEntries = normalizeEntries(entries); + return composeList(editor.contentDocument, normalizedEntries).toArray(); }; var composeEntries = function (editor, entries) { - return bind(groupBy(entries, isIndented), function (entries) { - var groupIsIndented = head(entries).map(isIndented).getOr(false); - return groupIsIndented ? indentedComposer(editor, entries) : outdentedComposer(editor, entries); - }); + return bind(groupBy(entries, isIndented), function (entries) { + var groupIsIndented = head(entries).map(isIndented).getOr(false); + return groupIsIndented ? indentedComposer(editor, entries) : outdentedComposer(editor, entries); + }); }; var indentSelectedEntries = function (entries, indentation) { - each(filter(entries, isSelected), function (entry) { - return indentEntry(indentation, entry); - }); + each(filter(entries, isSelected), function (entry) { + return indentEntry(indentation, entry); + }); }; var getItemSelection = function (editor) { - var selectedListItems = map(getSelectedListItems(editor), SugarElement.fromDom); - return lift2(find(selectedListItems, not(hasFirstChildList)), find(reverse(selectedListItems), not(hasFirstChildList)), function (start, end) { - return { - start: start, - end: end - }; - }); + var selectedListItems = map(getSelectedListItems(editor), SugarElement.fromDom); + return lift2(find(selectedListItems, not(hasFirstChildList)), find(reverse(selectedListItems), not(hasFirstChildList)), function (start, end) { + return { + start: start, + end: end + }; + }); }; var listIndentation = function (editor, lists, indentation) { - var entrySets = parseLists(lists, getItemSelection(editor)); - each(entrySets, function (entrySet) { - indentSelectedEntries(entrySet.entries, indentation); - var composedLists = composeEntries(editor, entrySet.entries); - each(composedLists, function (composedList) { - fireListEvent(editor, indentation === 'Indent' ? 'IndentList' : 'OutdentList', composedList.dom); - }); - before$1(entrySet.sourceList, composedLists); - remove(entrySet.sourceList); + var entrySets = parseLists(lists, getItemSelection(editor)); + each(entrySets, function (entrySet) { + indentSelectedEntries(entrySet.entries, indentation); + var composedLists = composeEntries(editor, entrySet.entries); + each(composedLists, function (composedList) { + fireListEvent(editor, indentation === 'Indent' ? 'IndentList' : 'OutdentList', composedList.dom); }); + before$1(entrySet.sourceList, composedLists); + remove(entrySet.sourceList); + }); }; var selectionIndentation = function (editor, indentation) { - var lists = map(getSelectedListRoots(editor), SugarElement.fromDom); - var dlItems = map(getSelectedDlItems(editor), SugarElement.fromDom); - var isHandled = false; - if (lists.length || dlItems.length) { - var bookmark = editor.selection.getBookmark(); - listIndentation(editor, lists, indentation); - dlIndentation(editor, indentation, dlItems); - editor.selection.moveToBookmark(bookmark); - editor.selection.setRng(normalizeRange(editor.selection.getRng())); - editor.nodeChanged(); - isHandled = true; - } - return isHandled; + var lists = map(getSelectedListRoots(editor), SugarElement.fromDom); + var dlItems = map(getSelectedDlItems(editor), SugarElement.fromDom); + var isHandled = false; + if (lists.length || dlItems.length) { + var bookmark = editor.selection.getBookmark(); + listIndentation(editor, lists, indentation); + dlIndentation(editor, indentation, dlItems); + editor.selection.moveToBookmark(bookmark); + editor.selection.setRng(normalizeRange(editor.selection.getRng())); + editor.nodeChanged(); + isHandled = true; + } + return isHandled; }; var indentListSelection = function (editor) { - return selectionIndentation(editor, 'Indent'); + return selectionIndentation(editor, 'Indent'); }; var outdentListSelection = function (editor) { - return selectionIndentation(editor, 'Outdent'); + return selectionIndentation(editor, 'Outdent'); }; var flattenListSelection = function (editor) { - return selectionIndentation(editor, 'Flatten'); + return selectionIndentation(editor, 'Flatten'); }; var global$7 = tinymce.util.Tools.resolve('tinymce.dom.BookmarkManager'); var DOM$1 = global$4.DOM; var createBookmark = function (rng) { - var bookmark = {}; - var setupEndPoint = function (start) { - var offsetNode, container, offset; - container = rng[start ? 'startContainer' : 'endContainer']; - offset = rng[start ? 'startOffset' : 'endOffset']; - if (container.nodeType === 1) { - offsetNode = DOM$1.create('span', {'data-mce-type': 'bookmark'}); - if (container.hasChildNodes()) { - offset = Math.min(offset, container.childNodes.length - 1); - if (start) { - container.insertBefore(offsetNode, container.childNodes[offset]); - } else { - DOM$1.insertAfter(offsetNode, container.childNodes[offset]); - } - } else { - container.appendChild(offsetNode); - } - container = offsetNode; - offset = 0; + var bookmark = {}; + var setupEndPoint = function (start) { + var offsetNode, container, offset; + container = rng[start ? 'startContainer' : 'endContainer']; + offset = rng[start ? 'startOffset' : 'endOffset']; + if (container.nodeType === 1) { + offsetNode = DOM$1.create('span', { 'data-mce-type': 'bookmark' }); + if (container.hasChildNodes()) { + offset = Math.min(offset, container.childNodes.length - 1); + if (start) { + container.insertBefore(offsetNode, container.childNodes[offset]); + } else { + DOM$1.insertAfter(offsetNode, container.childNodes[offset]); } - bookmark[start ? 'startContainer' : 'endContainer'] = container; - bookmark[start ? 'startOffset' : 'endOffset'] = offset; - }; - setupEndPoint(true); - if (!rng.collapsed) { - setupEndPoint(); - } - return bookmark; + } else { + container.appendChild(offsetNode); + } + container = offsetNode; + offset = 0; + } + bookmark[start ? 'startContainer' : 'endContainer'] = container; + bookmark[start ? 'startOffset' : 'endOffset'] = offset; + }; + setupEndPoint(true); + if (!rng.collapsed) { + setupEndPoint(); + } + return bookmark; }; var resolveBookmark = function (bookmark) { - function restoreEndPoint(start) { - var container, offset, node; - var nodeIndex = function (container) { - var node = container.parentNode.firstChild, idx = 0; - while (node) { - if (node === container) { - return idx; - } - if (node.nodeType !== 1 || node.getAttribute('data-mce-type') !== 'bookmark') { - idx++; - } - node = node.nextSibling; - } - return -1; - }; - container = node = bookmark[start ? 'startContainer' : 'endContainer']; - offset = bookmark[start ? 'startOffset' : 'endOffset']; - if (!container) { - return; + function restoreEndPoint(start) { + var container, offset, node; + var nodeIndex = function (container) { + var node = container.parentNode.firstChild, idx = 0; + while (node) { + if (node === container) { + return idx; } - if (container.nodeType === 1) { - offset = nodeIndex(container); - container = container.parentNode; - DOM$1.remove(node); - if (!container.hasChildNodes() && DOM$1.isBlock(container)) { - container.appendChild(DOM$1.create('br')); - } + if (node.nodeType !== 1 || node.getAttribute('data-mce-type') !== 'bookmark') { + idx++; } - bookmark[start ? 'startContainer' : 'endContainer'] = container; - bookmark[start ? 'startOffset' : 'endOffset'] = offset; - } - - restoreEndPoint(true); - restoreEndPoint(); - var rng = DOM$1.createRng(); - rng.setStart(bookmark.startContainer, bookmark.startOffset); - if (bookmark.endContainer) { - rng.setEnd(bookmark.endContainer, bookmark.endOffset); + node = node.nextSibling; + } + return -1; + }; + container = node = bookmark[start ? 'startContainer' : 'endContainer']; + offset = bookmark[start ? 'startOffset' : 'endOffset']; + if (!container) { + return; } - return normalizeRange(rng); + if (container.nodeType === 1) { + offset = nodeIndex(container); + container = container.parentNode; + DOM$1.remove(node); + if (!container.hasChildNodes() && DOM$1.isBlock(container)) { + container.appendChild(DOM$1.create('br')); + } + } + bookmark[start ? 'startContainer' : 'endContainer'] = container; + bookmark[start ? 'startOffset' : 'endOffset'] = offset; + } + restoreEndPoint(true); + restoreEndPoint(); + var rng = DOM$1.createRng(); + rng.setStart(bookmark.startContainer, bookmark.startOffset); + if (bookmark.endContainer) { + rng.setEnd(bookmark.endContainer, bookmark.endOffset); + } + return normalizeRange(rng); }; var listToggleActionFromListName = function (listName) { - switch (listName) { - case 'UL': - return 'ToggleUlList'; - case 'OL': - return 'ToggleOlList'; - case 'DL': - return 'ToggleDLList'; - } + switch (listName) { + case 'UL': + return 'ToggleUlList'; + case 'OL': + return 'ToggleOlList'; + case 'DL': + return 'ToggleDLList'; + } }; var isCustomList = function (list) { - return /\btox\-/.test(list.className); + return /\btox\-/.test(list.className); }; var listState = function (editor, listName, activate) { - var nodeChangeHandler = function (e) { - var inList = findUntil(e.parents, isListNode, isTableCellNode).filter(function (list) { - return list.nodeName === listName && !isCustomList(list); - }).isSome(); - activate(inList); - }; - var parents = editor.dom.getParents(editor.selection.getNode()); - nodeChangeHandler({parents: parents}); - editor.on('NodeChange', nodeChangeHandler); - return function () { - return editor.off('NodeChange', nodeChangeHandler); - }; + var nodeChangeHandler = function (e) { + var inList = findUntil(e.parents, isListNode, isTableCellNode).filter(function (list) { + return list.nodeName === listName && !isCustomList(list); + }).isSome(); + activate(inList); + }; + var parents = editor.dom.getParents(editor.selection.getNode()); + nodeChangeHandler({ parents: parents }); + editor.on('NodeChange', nodeChangeHandler); + return function () { + return editor.off('NodeChange', nodeChangeHandler); + }; }; var updateListStyle = function (dom, el, detail) { - var type = detail['list-style-type'] ? detail['list-style-type'] : null; - dom.setStyle(el, 'list-style-type', type); + var type = detail['list-style-type'] ? detail['list-style-type'] : null; + dom.setStyle(el, 'list-style-type', type); }; var setAttribs = function (elm, attrs) { - global$5.each(attrs, function (value, key) { - elm.setAttribute(key, value); - }); + global$5.each(attrs, function (value, key) { + elm.setAttribute(key, value); + }); }; var updateListAttrs = function (dom, el, detail) { - setAttribs(el, detail['list-attributes']); - global$5.each(dom.select('li', el), function (li) { - setAttribs(li, detail['list-item-attributes']); - }); + setAttribs(el, detail['list-attributes']); + global$5.each(dom.select('li', el), function (li) { + setAttribs(li, detail['list-item-attributes']); + }); }; var updateListWithDetails = function (dom, el, detail) { - updateListStyle(dom, el, detail); - updateListAttrs(dom, el, detail); + updateListStyle(dom, el, detail); + updateListAttrs(dom, el, detail); }; var removeStyles = function (dom, element, styles) { - global$5.each(styles, function (style) { - var _a; - return dom.setStyle(element, (_a = {}, _a[style] = '', _a)); - }); + global$5.each(styles, function (style) { + var _a; + return dom.setStyle(element, (_a = {}, _a[style] = '', _a)); + }); }; var getEndPointNode = function (editor, rng, start, root) { - var container = rng[start ? 'startContainer' : 'endContainer']; - var offset = rng[start ? 'startOffset' : 'endOffset']; - if (container.nodeType === 1) { - container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container; - } - if (!start && isBr(container.nextSibling)) { - container = container.nextSibling; - } - while (container.parentNode !== root) { - if (isTextBlock(editor, container)) { - return container; - } - if (/^(TD|TH)$/.test(container.parentNode.nodeName)) { - return container; - } - container = container.parentNode; - } - return container; + var container = rng[start ? 'startContainer' : 'endContainer']; + var offset = rng[start ? 'startOffset' : 'endOffset']; + if (container.nodeType === 1) { + container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container; + } + if (!start && isBr(container.nextSibling)) { + container = container.nextSibling; + } + while (container.parentNode !== root) { + if (isTextBlock(editor, container)) { + return container; + } + if (/^(TD|TH)$/.test(container.parentNode.nodeName)) { + return container; + } + container = container.parentNode; + } + return container; }; var getSelectedTextBlocks = function (editor, rng, root) { - var textBlocks = [], dom = editor.dom; - var startNode = getEndPointNode(editor, rng, true, root); - var endNode = getEndPointNode(editor, rng, false, root); - var block; - var siblings = []; - for (var node = startNode; node; node = node.nextSibling) { - siblings.push(node); - if (node === endNode) { - break; - } + var textBlocks = [], dom = editor.dom; + var startNode = getEndPointNode(editor, rng, true, root); + var endNode = getEndPointNode(editor, rng, false, root); + var block; + var siblings = []; + for (var node = startNode; node; node = node.nextSibling) { + siblings.push(node); + if (node === endNode) { + break; + } + } + global$5.each(siblings, function (node) { + if (isTextBlock(editor, node)) { + textBlocks.push(node); + block = null; + return; + } + if (dom.isBlock(node) || isBr(node)) { + if (isBr(node)) { + dom.remove(node); + } + block = null; + return; + } + var nextSibling = node.nextSibling; + if (global$7.isBookmarkNode(node)) { + if (isTextBlock(editor, nextSibling) || !nextSibling && node.parentNode === root) { + block = null; + return; + } } - global$5.each(siblings, function (node) { - if (isTextBlock(editor, node)) { - textBlocks.push(node); - block = null; - return; - } - if (dom.isBlock(node) || isBr(node)) { - if (isBr(node)) { - dom.remove(node); - } - block = null; - return; - } - var nextSibling = node.nextSibling; - if (global$7.isBookmarkNode(node)) { - if (isTextBlock(editor, nextSibling) || !nextSibling && node.parentNode === root) { - block = null; - return; - } - } - if (!block) { - block = dom.create('p'); - node.parentNode.insertBefore(block, node); - textBlocks.push(block); - } - block.appendChild(node); - }); - return textBlocks; + if (!block) { + block = dom.create('p'); + node.parentNode.insertBefore(block, node); + textBlocks.push(block); + } + block.appendChild(node); + }); + return textBlocks; }; var hasCompatibleStyle = function (dom, sib, detail) { - var sibStyle = dom.getStyle(sib, 'list-style-type'); - var detailStyle = detail ? detail['list-style-type'] : ''; - detailStyle = detailStyle === null ? '' : detailStyle; - return sibStyle === detailStyle; + var sibStyle = dom.getStyle(sib, 'list-style-type'); + var detailStyle = detail ? detail['list-style-type'] : ''; + detailStyle = detailStyle === null ? '' : detailStyle; + return sibStyle === detailStyle; }; var applyList = function (editor, listName, detail) { - if (detail === void 0) { - detail = {}; - } - var rng = editor.selection.getRng(); - var listItemName = 'LI'; - var root = getClosestListRootElm(editor, editor.selection.getStart(true)); - var dom = editor.dom; - if (dom.getContentEditable(editor.selection.getNode()) === 'false') { - return; - } - listName = listName.toUpperCase(); - if (listName === 'DL') { - listItemName = 'DT'; - } - var bookmark = createBookmark(rng); - global$5.each(getSelectedTextBlocks(editor, rng, root), function (block) { - var listBlock; - var sibling = block.previousSibling; - if (sibling && isListNode(sibling) && sibling.nodeName === listName && hasCompatibleStyle(dom, sibling, detail)) { - listBlock = sibling; - block = dom.rename(block, listItemName); - sibling.appendChild(block); - } else { - listBlock = dom.create(listName); - block.parentNode.insertBefore(listBlock, block); - listBlock.appendChild(block); - block = dom.rename(block, listItemName); - } - removeStyles(dom, block, [ - 'margin', - 'margin-right', - 'margin-bottom', - 'margin-left', - 'margin-top', - 'padding', - 'padding-right', - 'padding-bottom', - 'padding-left', - 'padding-top' - ]); - updateListWithDetails(dom, listBlock, detail); - mergeWithAdjacentLists(editor.dom, listBlock); - }); - editor.selection.setRng(resolveBookmark(bookmark)); + if (detail === void 0) { + detail = {}; + } + var rng = editor.selection.getRng(); + var listItemName = 'LI'; + var root = getClosestListRootElm(editor, editor.selection.getStart(true)); + var dom = editor.dom; + if (dom.getContentEditable(editor.selection.getNode()) === 'false') { + return; + } + listName = listName.toUpperCase(); + if (listName === 'DL') { + listItemName = 'DT'; + } + var bookmark = createBookmark(rng); + global$5.each(getSelectedTextBlocks(editor, rng, root), function (block) { + var listBlock; + var sibling = block.previousSibling; + if (sibling && isListNode(sibling) && sibling.nodeName === listName && hasCompatibleStyle(dom, sibling, detail)) { + listBlock = sibling; + block = dom.rename(block, listItemName); + sibling.appendChild(block); + } else { + listBlock = dom.create(listName); + block.parentNode.insertBefore(listBlock, block); + listBlock.appendChild(block); + block = dom.rename(block, listItemName); + } + removeStyles(dom, block, [ + 'margin', + 'margin-right', + 'margin-bottom', + 'margin-left', + 'margin-top', + 'padding', + 'padding-right', + 'padding-bottom', + 'padding-left', + 'padding-top' + ]); + updateListWithDetails(dom, listBlock, detail); + mergeWithAdjacentLists(editor.dom, listBlock); + }); + editor.selection.setRng(resolveBookmark(bookmark)); }; var isValidLists = function (list1, list2) { - return list1 && list2 && isListNode(list1) && list1.nodeName === list2.nodeName; + return list1 && list2 && isListNode(list1) && list1.nodeName === list2.nodeName; }; var hasSameListStyle = function (dom, list1, list2) { - var targetStyle = dom.getStyle(list1, 'list-style-type', true); - var style = dom.getStyle(list2, 'list-style-type', true); - return targetStyle === style; + var targetStyle = dom.getStyle(list1, 'list-style-type', true); + var style = dom.getStyle(list2, 'list-style-type', true); + return targetStyle === style; }; var hasSameClasses = function (elm1, elm2) { - return elm1.className === elm2.className; + return elm1.className === elm2.className; }; var shouldMerge = function (dom, list1, list2) { - return isValidLists(list1, list2) && hasSameListStyle(dom, list1, list2) && hasSameClasses(list1, list2); + return isValidLists(list1, list2) && hasSameListStyle(dom, list1, list2) && hasSameClasses(list1, list2); }; var mergeWithAdjacentLists = function (dom, listBlock) { - var sibling, node; - sibling = listBlock.nextSibling; - if (shouldMerge(dom, listBlock, sibling)) { - while (node = sibling.firstChild) { - listBlock.appendChild(node); - } - dom.remove(sibling); - } - sibling = listBlock.previousSibling; - if (shouldMerge(dom, listBlock, sibling)) { - while (node = sibling.lastChild) { - listBlock.insertBefore(node, listBlock.firstChild); - } - dom.remove(sibling); - } + var sibling, node; + sibling = listBlock.nextSibling; + if (shouldMerge(dom, listBlock, sibling)) { + while (node = sibling.firstChild) { + listBlock.appendChild(node); + } + dom.remove(sibling); + } + sibling = listBlock.previousSibling; + if (shouldMerge(dom, listBlock, sibling)) { + while (node = sibling.lastChild) { + listBlock.insertBefore(node, listBlock.firstChild); + } + dom.remove(sibling); + } }; var updateList = function (editor, list, listName, detail) { - if (list.nodeName !== listName) { - var newList = editor.dom.rename(list, listName); - updateListWithDetails(editor.dom, newList, detail); - fireListEvent(editor, listToggleActionFromListName(listName), newList); - } else { - updateListWithDetails(editor.dom, list, detail); - fireListEvent(editor, listToggleActionFromListName(listName), list); - } + if (list.nodeName !== listName) { + var newList = editor.dom.rename(list, listName); + updateListWithDetails(editor.dom, newList, detail); + fireListEvent(editor, listToggleActionFromListName(listName), newList); + } else { + updateListWithDetails(editor.dom, list, detail); + fireListEvent(editor, listToggleActionFromListName(listName), list); + } }; var toggleMultipleLists = function (editor, parentList, lists, listName, detail) { - if (parentList.nodeName === listName && !hasListStyleDetail(detail)) { - flattenListSelection(editor); - } else { - var bookmark = createBookmark(editor.selection.getRng(true)); - global$5.each([parentList].concat(lists), function (elm) { - updateList(editor, elm, listName, detail); - }); - editor.selection.setRng(resolveBookmark(bookmark)); - } + if (parentList.nodeName === listName && !hasListStyleDetail(detail)) { + flattenListSelection(editor); + } else { + var bookmark = createBookmark(editor.selection.getRng(true)); + global$5.each([parentList].concat(lists), function (elm) { + updateList(editor, elm, listName, detail); + }); + editor.selection.setRng(resolveBookmark(bookmark)); + } }; var hasListStyleDetail = function (detail) { - return 'list-style-type' in detail; + return 'list-style-type' in detail; }; var toggleSingleList = function (editor, parentList, listName, detail) { - if (parentList === editor.getBody()) { - return; - } - if (parentList) { - if (parentList.nodeName === listName && !hasListStyleDetail(detail) && !isCustomList(parentList)) { - flattenListSelection(editor); - } else { - var bookmark = createBookmark(editor.selection.getRng(true)); - updateListWithDetails(editor.dom, parentList, detail); - var newList = editor.dom.rename(parentList, listName); - mergeWithAdjacentLists(editor.dom, newList); - editor.selection.setRng(resolveBookmark(bookmark)); - fireListEvent(editor, listToggleActionFromListName(listName), newList); - } + if (parentList === editor.getBody()) { + return; + } + if (parentList) { + if (parentList.nodeName === listName && !hasListStyleDetail(detail) && !isCustomList(parentList)) { + flattenListSelection(editor); } else { - applyList(editor, listName, detail); - fireListEvent(editor, listToggleActionFromListName(listName), parentList); - } + var bookmark = createBookmark(editor.selection.getRng(true)); + updateListWithDetails(editor.dom, parentList, detail); + var newList = editor.dom.rename(parentList, listName); + mergeWithAdjacentLists(editor.dom, newList); + editor.selection.setRng(resolveBookmark(bookmark)); + fireListEvent(editor, listToggleActionFromListName(listName), newList); + } + } else { + applyList(editor, listName, detail); + fireListEvent(editor, listToggleActionFromListName(listName), parentList); + } }; var toggleList = function (editor, listName, detail) { - var parentList = getParentList(editor); - var selectedSubLists = getSelectedSubLists(editor); - detail = detail ? detail : {}; - if (parentList && selectedSubLists.length > 0) { - toggleMultipleLists(editor, parentList, selectedSubLists, listName, detail); - } else { - toggleSingleList(editor, parentList, listName, detail); - } + var parentList = getParentList(editor); + var selectedSubLists = getSelectedSubLists(editor); + detail = detail ? detail : {}; + if (parentList && selectedSubLists.length > 0) { + toggleMultipleLists(editor, parentList, selectedSubLists, listName, detail); + } else { + toggleSingleList(editor, parentList, listName, detail); + } }; var DOM$2 = global$4.DOM; var normalizeList = function (dom, ul) { - var sibling; - var parentNode = ul.parentNode; - if (parentNode.nodeName === 'LI' && parentNode.firstChild === ul) { - sibling = parentNode.previousSibling; - if (sibling && sibling.nodeName === 'LI') { - sibling.appendChild(ul); - if (isEmpty(dom, parentNode)) { - DOM$2.remove(parentNode); - } - } else { - DOM$2.setStyle(parentNode, 'listStyleType', 'none'); - } + var sibling; + var parentNode = ul.parentNode; + if (parentNode.nodeName === 'LI' && parentNode.firstChild === ul) { + sibling = parentNode.previousSibling; + if (sibling && sibling.nodeName === 'LI') { + sibling.appendChild(ul); + if (isEmpty(dom, parentNode)) { + DOM$2.remove(parentNode); + } + } else { + DOM$2.setStyle(parentNode, 'listStyleType', 'none'); } - if (isListNode(parentNode)) { - sibling = parentNode.previousSibling; - if (sibling && sibling.nodeName === 'LI') { - sibling.appendChild(ul); - } + } + if (isListNode(parentNode)) { + sibling = parentNode.previousSibling; + if (sibling && sibling.nodeName === 'LI') { + sibling.appendChild(ul); } + } }; var normalizeLists = function (dom, element) { - global$5.each(global$5.grep(dom.select('ol,ul', element)), function (ul) { - normalizeList(dom, ul); - }); + global$5.each(global$5.grep(dom.select('ol,ul', element)), function (ul) { + normalizeList(dom, ul); + }); }; var findNextCaretContainer = function (editor, rng, isForward, root) { - var node = rng.startContainer; - var offset = rng.startOffset; - if (isTextNode(node) && (isForward ? offset < node.data.length : offset > 0)) { - return node; - } - var nonEmptyBlocks = editor.schema.getNonEmptyElements(); - if (node.nodeType === 1) { - node = global$1.getNode(node, offset); - } - var walker = new global$2(node, root); - if (isForward) { - if (isBogusBr(editor.dom, node)) { - walker.next(); - } - } - while (node = walker[isForward ? 'next' : 'prev2']()) { - if (node.nodeName === 'LI' && !node.hasChildNodes()) { - return node; - } - if (nonEmptyBlocks[node.nodeName]) { - return node; - } - if (isTextNode(node) && node.data.length > 0) { - return node; - } - } + var node = rng.startContainer; + var offset = rng.startOffset; + if (isTextNode(node) && (isForward ? offset < node.data.length : offset > 0)) { + return node; + } + var nonEmptyBlocks = editor.schema.getNonEmptyElements(); + if (node.nodeType === 1) { + node = global$1.getNode(node, offset); + } + var walker = new global$2(node, root); + if (isForward) { + if (isBogusBr(editor.dom, node)) { + walker.next(); + } + } + while (node = walker[isForward ? 'next' : 'prev2']()) { + if (node.nodeName === 'LI' && !node.hasChildNodes()) { + return node; + } + if (nonEmptyBlocks[node.nodeName]) { + return node; + } + if (isTextNode(node) && node.data.length > 0) { + return node; + } + } }; var hasOnlyOneBlockChild = function (dom, elm) { - var childNodes = elm.childNodes; - return childNodes.length === 1 && !isListNode(childNodes[0]) && dom.isBlock(childNodes[0]); + var childNodes = elm.childNodes; + return childNodes.length === 1 && !isListNode(childNodes[0]) && dom.isBlock(childNodes[0]); }; var unwrapSingleBlockChild = function (dom, elm) { - if (hasOnlyOneBlockChild(dom, elm)) { - dom.remove(elm.firstChild, true); - } + if (hasOnlyOneBlockChild(dom, elm)) { + dom.remove(elm.firstChild, true); + } }; var moveChildren = function (dom, fromElm, toElm) { - var node; - var targetElm = hasOnlyOneBlockChild(dom, toElm) ? toElm.firstChild : toElm; - unwrapSingleBlockChild(dom, fromElm); - if (!isEmpty(dom, fromElm, true)) { - while (node = fromElm.firstChild) { - targetElm.appendChild(node); - } + var node; + var targetElm = hasOnlyOneBlockChild(dom, toElm) ? toElm.firstChild : toElm; + unwrapSingleBlockChild(dom, fromElm); + if (!isEmpty(dom, fromElm, true)) { + while (node = fromElm.firstChild) { + targetElm.appendChild(node); } + } }; var mergeLiElements = function (dom, fromElm, toElm) { - var listNode; - var ul = fromElm.parentNode; - if (!isChildOfBody(dom, fromElm) || !isChildOfBody(dom, toElm)) { - return; - } - if (isListNode(toElm.lastChild)) { - listNode = toElm.lastChild; - } - if (ul === toElm.lastChild) { - if (isBr(ul.previousSibling)) { - dom.remove(ul.previousSibling); - } - } - var node = toElm.lastChild; - if (node && isBr(node) && fromElm.hasChildNodes()) { - dom.remove(node); - } - if (isEmpty(dom, toElm, true)) { - dom.$(toElm).empty(); - } - moveChildren(dom, fromElm, toElm); - if (listNode) { - toElm.appendChild(listNode); - } - var contains = contains$1(SugarElement.fromDom(toElm), SugarElement.fromDom(fromElm)); - var nestedLists = contains ? dom.getParents(fromElm, isListNode, toElm) : []; - dom.remove(fromElm); - each(nestedLists, function (list) { - if (isEmpty(dom, list) && list !== dom.getRoot()) { - dom.remove(list); - } - }); + var listNode; + var ul = fromElm.parentNode; + if (!isChildOfBody(dom, fromElm) || !isChildOfBody(dom, toElm)) { + return; + } + if (isListNode(toElm.lastChild)) { + listNode = toElm.lastChild; + } + if (ul === toElm.lastChild) { + if (isBr(ul.previousSibling)) { + dom.remove(ul.previousSibling); + } + } + var node = toElm.lastChild; + if (node && isBr(node) && fromElm.hasChildNodes()) { + dom.remove(node); + } + if (isEmpty(dom, toElm, true)) { + dom.$(toElm).empty(); + } + moveChildren(dom, fromElm, toElm); + if (listNode) { + toElm.appendChild(listNode); + } + var contains = contains$1(SugarElement.fromDom(toElm), SugarElement.fromDom(fromElm)); + var nestedLists = contains ? dom.getParents(fromElm, isListNode, toElm) : []; + dom.remove(fromElm); + each(nestedLists, function (list) { + if (isEmpty(dom, list) && list !== dom.getRoot()) { + dom.remove(list); + } + }); }; var mergeIntoEmptyLi = function (editor, fromLi, toLi) { - editor.dom.$(toLi).empty(); - mergeLiElements(editor.dom, fromLi, toLi); - editor.selection.setCursorLocation(toLi); + editor.dom.$(toLi).empty(); + mergeLiElements(editor.dom, fromLi, toLi); + editor.selection.setCursorLocation(toLi); }; var mergeForward = function (editor, rng, fromLi, toLi) { - var dom = editor.dom; - if (dom.isEmpty(toLi)) { - mergeIntoEmptyLi(editor, fromLi, toLi); - } else { - var bookmark = createBookmark(rng); - mergeLiElements(dom, fromLi, toLi); - editor.selection.setRng(resolveBookmark(bookmark)); - } + var dom = editor.dom; + if (dom.isEmpty(toLi)) { + mergeIntoEmptyLi(editor, fromLi, toLi); + } else { + var bookmark = createBookmark(rng); + mergeLiElements(dom, fromLi, toLi); + editor.selection.setRng(resolveBookmark(bookmark)); + } }; var mergeBackward = function (editor, rng, fromLi, toLi) { - var bookmark = createBookmark(rng); - mergeLiElements(editor.dom, fromLi, toLi); - var resolvedBookmark = resolveBookmark(bookmark); - editor.selection.setRng(resolvedBookmark); + var bookmark = createBookmark(rng); + mergeLiElements(editor.dom, fromLi, toLi); + var resolvedBookmark = resolveBookmark(bookmark); + editor.selection.setRng(resolvedBookmark); }; var backspaceDeleteFromListToListCaret = function (editor, isForward) { - var dom = editor.dom, selection = editor.selection; - var selectionStartElm = selection.getStart(); - var root = getClosestListRootElm(editor, selectionStartElm); - var li = dom.getParent(selection.getStart(), 'LI', root); - if (li) { - var ul = li.parentNode; - if (ul === editor.getBody() && isEmpty(dom, ul)) { - return true; - } - var rng_1 = normalizeRange(selection.getRng()); - var otherLi_1 = dom.getParent(findNextCaretContainer(editor, rng_1, isForward, root), 'LI', root); - if (otherLi_1 && otherLi_1 !== li) { - editor.undoManager.transact(function () { - if (isForward) { - mergeForward(editor, rng_1, otherLi_1, li); - } else { - if (isFirstChild(li)) { - outdentListSelection(editor); - } else { - mergeBackward(editor, rng_1, li, otherLi_1); - } - } - }); - return true; - } else if (!otherLi_1) { - if (!isForward && rng_1.startOffset === 0 && rng_1.endOffset === 0) { - editor.undoManager.transact(function () { - flattenListSelection(editor); - }); - return true; - } + var dom = editor.dom, selection = editor.selection; + var selectionStartElm = selection.getStart(); + var root = getClosestListRootElm(editor, selectionStartElm); + var li = dom.getParent(selection.getStart(), 'LI', root); + if (li) { + var ul = li.parentNode; + if (ul === editor.getBody() && isEmpty(dom, ul)) { + return true; + } + var rng_1 = normalizeRange(selection.getRng()); + var otherLi_1 = dom.getParent(findNextCaretContainer(editor, rng_1, isForward, root), 'LI', root); + if (otherLi_1 && otherLi_1 !== li) { + editor.undoManager.transact(function () { + if (isForward) { + mergeForward(editor, rng_1, otherLi_1, li); + } else { + if (isFirstChild(li)) { + outdentListSelection(editor); + } else { + mergeBackward(editor, rng_1, li, otherLi_1); + } } + }); + return true; + } else if (!otherLi_1) { + if (!isForward && rng_1.startOffset === 0 && rng_1.endOffset === 0) { + editor.undoManager.transact(function () { + flattenListSelection(editor); + }); + return true; + } } - return false; + } + return false; }; var removeBlock = function (dom, block, root) { - var parentBlock = dom.getParent(block.parentNode, dom.isBlock, root); - dom.remove(block); - if (parentBlock && dom.isEmpty(parentBlock)) { - dom.remove(parentBlock); - } + var parentBlock = dom.getParent(block.parentNode, dom.isBlock, root); + dom.remove(block); + if (parentBlock && dom.isEmpty(parentBlock)) { + dom.remove(parentBlock); + } }; var backspaceDeleteIntoListCaret = function (editor, isForward) { - var dom = editor.dom; - var selectionStartElm = editor.selection.getStart(); - var root = getClosestListRootElm(editor, selectionStartElm); - var block = dom.getParent(selectionStartElm, dom.isBlock, root); - if (block && dom.isEmpty(block)) { - var rng = normalizeRange(editor.selection.getRng()); - var otherLi_2 = dom.getParent(findNextCaretContainer(editor, rng, isForward, root), 'LI', root); - if (otherLi_2) { - editor.undoManager.transact(function () { - removeBlock(dom, block, root); - mergeWithAdjacentLists(dom, otherLi_2.parentNode); - editor.selection.select(otherLi_2, true); - editor.selection.collapse(isForward); - }); - return true; - } - } - return false; + var dom = editor.dom; + var selectionStartElm = editor.selection.getStart(); + var root = getClosestListRootElm(editor, selectionStartElm); + var block = dom.getParent(selectionStartElm, dom.isBlock, root); + if (block && dom.isEmpty(block)) { + var rng = normalizeRange(editor.selection.getRng()); + var otherLi_2 = dom.getParent(findNextCaretContainer(editor, rng, isForward, root), 'LI', root); + if (otherLi_2) { + editor.undoManager.transact(function () { + removeBlock(dom, block, root); + mergeWithAdjacentLists(dom, otherLi_2.parentNode); + editor.selection.select(otherLi_2, true); + editor.selection.collapse(isForward); + }); + return true; + } + } + return false; }; var backspaceDeleteCaret = function (editor, isForward) { - return backspaceDeleteFromListToListCaret(editor, isForward) || backspaceDeleteIntoListCaret(editor, isForward); + return backspaceDeleteFromListToListCaret(editor, isForward) || backspaceDeleteIntoListCaret(editor, isForward); }; var backspaceDeleteRange = function (editor) { - var selectionStartElm = editor.selection.getStart(); - var root = getClosestListRootElm(editor, selectionStartElm); - var startListParent = editor.dom.getParent(selectionStartElm, 'LI,DT,DD', root); - if (startListParent || getSelectedListItems(editor).length > 0) { - editor.undoManager.transact(function () { - editor.execCommand('Delete'); - normalizeLists(editor.dom, editor.getBody()); - }); - return true; - } - return false; + var selectionStartElm = editor.selection.getStart(); + var root = getClosestListRootElm(editor, selectionStartElm); + var startListParent = editor.dom.getParent(selectionStartElm, 'LI,DT,DD', root); + if (startListParent || getSelectedListItems(editor).length > 0) { + editor.undoManager.transact(function () { + editor.execCommand('Delete'); + normalizeLists(editor.dom, editor.getBody()); + }); + return true; + } + return false; }; var backspaceDelete = function (editor, isForward) { - return editor.selection.isCollapsed() ? backspaceDeleteCaret(editor, isForward) : backspaceDeleteRange(editor); + return editor.selection.isCollapsed() ? backspaceDeleteCaret(editor, isForward) : backspaceDeleteRange(editor); }; var setup = function (editor) { - editor.on('keydown', function (e) { - if (e.keyCode === global$3.BACKSPACE) { - if (backspaceDelete(editor, false)) { - e.preventDefault(); - } - } else if (e.keyCode === global$3.DELETE) { - if (backspaceDelete(editor, true)) { - e.preventDefault(); - } - } - }); + editor.on('keydown', function (e) { + if (e.keyCode === global$3.BACKSPACE) { + if (backspaceDelete(editor, false)) { + e.preventDefault(); + } + } else if (e.keyCode === global$3.DELETE) { + if (backspaceDelete(editor, true)) { + e.preventDefault(); + } + } + }); }; var get$1 = function (editor) { - return { - backspaceDelete: function (isForward) { - backspaceDelete(editor, isForward); - } - }; + return { + backspaceDelete: function (isForward) { + backspaceDelete(editor, isForward); + } + }; }; var open = function (editor) { - var dom = editor.dom; - var currentList = getParentList(editor); - if (!isOlNode(currentList)) { - return; - } - editor.windowManager.open({ - title: 'List Properties', - body: { - type: 'panel', - items: [{ - type: 'input', - name: 'start', - label: 'Start list at number', - inputMode: 'numeric' - }] - }, - initialData: {start: dom.getAttrib(currentList, 'start') || '1'}, - buttons: [ - { - type: 'cancel', - name: 'cancel', - text: 'Cancel' - }, - { - type: 'submit', - name: 'save', - text: 'Save', - primary: true - } - ], - onSubmit: function (api) { - var data = api.getData(); - editor.undoManager.transact(function () { - dom.setAttrib(getParentList(editor), 'start', data.start === '1' ? '' : data.start); - }); - api.close(); - } - }); + var dom = editor.dom; + var currentList = getParentList(editor); + if (!isOlNode(currentList)) { + return; + } + editor.windowManager.open({ + title: 'List Properties', + body: { + type: 'panel', + items: [{ + type: 'input', + name: 'start', + label: 'Start list at number', + inputMode: 'numeric' + }] + }, + initialData: { start: dom.getAttrib(currentList, 'start') || '1' }, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + onSubmit: function (api) { + var data = api.getData(); + editor.undoManager.transact(function () { + dom.setAttrib(getParentList(editor), 'start', data.start === '1' ? '' : data.start); + }); + api.close(); + } + }); }; var queryListCommandState = function (editor, listName) { - return function () { - var parentList = editor.dom.getParent(editor.selection.getStart(), 'UL,OL,DL'); - return parentList && parentList.nodeName === listName; - }; + return function () { + var parentList = editor.dom.getParent(editor.selection.getStart(), 'UL,OL,DL'); + return parentList && parentList.nodeName === listName; + }; }; var register = function (editor) { - editor.on('BeforeExecCommand', function (e) { - var cmd = e.command.toLowerCase(); - if (cmd === 'indent') { - indentListSelection(editor); - } else if (cmd === 'outdent') { - outdentListSelection(editor); - } - }); - editor.addCommand('InsertUnorderedList', function (ui, detail) { - toggleList(editor, 'UL', detail); - }); - editor.addCommand('InsertOrderedList', function (ui, detail) { - toggleList(editor, 'OL', detail); - }); - editor.addCommand('InsertDefinitionList', function (ui, detail) { - toggleList(editor, 'DL', detail); - }); - editor.addCommand('RemoveList', function () { - flattenListSelection(editor); - }); - editor.addCommand('mceListProps', function () { - open(editor); - }); - editor.addQueryStateHandler('InsertUnorderedList', queryListCommandState(editor, 'UL')); - editor.addQueryStateHandler('InsertOrderedList', queryListCommandState(editor, 'OL')); - editor.addQueryStateHandler('InsertDefinitionList', queryListCommandState(editor, 'DL')); + editor.on('BeforeExecCommand', function (e) { + var cmd = e.command.toLowerCase(); + if (cmd === 'indent') { + indentListSelection(editor); + } else if (cmd === 'outdent') { + outdentListSelection(editor); + } + }); + editor.addCommand('InsertUnorderedList', function (ui, detail) { + toggleList(editor, 'UL', detail); + }); + editor.addCommand('InsertOrderedList', function (ui, detail) { + toggleList(editor, 'OL', detail); + }); + editor.addCommand('InsertDefinitionList', function (ui, detail) { + toggleList(editor, 'DL', detail); + }); + editor.addCommand('RemoveList', function () { + flattenListSelection(editor); + }); + editor.addCommand('mceListProps', function () { + open(editor); + }); + editor.addQueryStateHandler('InsertUnorderedList', queryListCommandState(editor, 'UL')); + editor.addQueryStateHandler('InsertOrderedList', queryListCommandState(editor, 'OL')); + editor.addQueryStateHandler('InsertDefinitionList', queryListCommandState(editor, 'DL')); }; var setupTabKey = function (editor) { - editor.on('keydown', function (e) { - if (e.keyCode !== global$3.TAB || global$3.metaKeyPressed(e)) { - return; - } - editor.undoManager.transact(function () { - if (e.shiftKey ? outdentListSelection(editor) : indentListSelection(editor)) { - e.preventDefault(); - } - }); + editor.on('keydown', function (e) { + if (e.keyCode !== global$3.TAB || global$3.metaKeyPressed(e)) { + return; + } + editor.undoManager.transact(function () { + if (e.shiftKey ? outdentListSelection(editor) : indentListSelection(editor)) { + e.preventDefault(); + } }); + }); }; var setup$1 = function (editor) { - if (shouldIndentOnTab(editor)) { - setupTabKey(editor); - } - setup(editor); + if (shouldIndentOnTab(editor)) { + setupTabKey(editor); + } + setup(editor); }; var register$1 = function (editor) { - var exec = function (command) { - return function () { - return editor.execCommand(command); - }; - }; - if (!editor.hasPlugin('advlist')) { - editor.ui.registry.addToggleButton('numlist', { - icon: 'ordered-list', - active: false, - tooltip: 'Numbered list', - onAction: exec('InsertOrderedList'), - onSetup: function (api) { - return listState(editor, 'OL', api.setActive); - } - }); - editor.ui.registry.addToggleButton('bullist', { - icon: 'unordered-list', - active: false, - tooltip: 'Bullet list', - onAction: exec('InsertUnorderedList'), - onSetup: function (api) { - return listState(editor, 'UL', api.setActive); - } - }); - } - }; - - var register$2 = function (editor) { - var listProperties = { - text: 'List properties...', - icon: 'ordered-list', - onAction: function () { - return open(editor); - }, - onSetup: function (api) { - return listState(editor, 'OL', function (active) { - return api.setDisabled(!active); - }); - } + var exec = function (command) { + return function () { + return editor.execCommand(command); }; - editor.ui.registry.addMenuItem('listprops', listProperties); - editor.ui.registry.addContextMenu('lists', { - update: function (node) { - var parentList = getParentList(editor, node); - return isOlNode(parentList) ? ['listprops'] : []; - } + }; + if (!editor.hasPlugin('advlist')) { + editor.ui.registry.addToggleButton('numlist', { + icon: 'ordered-list', + active: false, + tooltip: 'Numbered list', + onAction: exec('InsertOrderedList'), + onSetup: function (api) { + return listState(editor, 'OL', api.setActive); + } }); + editor.ui.registry.addToggleButton('bullist', { + icon: 'unordered-list', + active: false, + tooltip: 'Bullet list', + onAction: exec('InsertUnorderedList'), + onSetup: function (api) { + return listState(editor, 'UL', api.setActive); + } + }); + } }; - function Plugin() { - global.add('lists', function (editor) { - if (editor.hasPlugin('rtc', true) === false) { - setup$1(editor); - register(editor); - } - register$1(editor); - register$2(editor); - return get$1(editor); - }); + var register$2 = function (editor) { + var listProperties = { + text: 'List properties...', + icon: 'ordered-list', + onAction: function () { + return open(editor); + }, + onSetup: function (api) { + return listState(editor, 'OL', function (active) { + return api.setDisabled(!active); + }); + } + }; + editor.ui.registry.addMenuItem('listprops', listProperties); + editor.ui.registry.addContextMenu('lists', { + update: function (node) { + var parentList = getParentList(editor, node); + return isOlNode(parentList) ? ['listprops'] : []; + } + }); + }; + + function Plugin () { + global.add('lists', function (editor) { + if (editor.hasPlugin('rtc', true) === false) { + setup$1(editor); + register(editor); + } + register$1(editor); + register$2(editor); + return get$1(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/media/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/media/plugin.js index 98ff31bd..ef361c61 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/media/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/media/plugin.js @@ -12,150 +12,150 @@ var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); }; var noop = function () { }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; var never = constant(false); var always = constant(true); var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var typeOf = function (x) { - var t = typeof x; - if (x === null) { - return 'null'; - } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { - return 'array'; - } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { - return 'string'; - } else { - return t; - } + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } }; var isType = function (type) { - return function (value) { - return typeOf(value) === type; - }; + return function (value) { + return typeOf(value) === type; + }; }; var isString = isType('string'); var isObject = isType('object'); @@ -163,79 +163,79 @@ var nativePush = Array.prototype.push; var each = function (xs, f) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - f(x, i); - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } }; var flatten = function (xs) { - var r = []; - for (var i = 0, len = xs.length; i < len; ++i) { - if (!isArray(xs[i])) { - throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); - } - nativePush.apply(r, xs[i]); + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); } - return r; + nativePush.apply(r, xs[i]); + } + return r; }; var Cell = function (initial) { - var value = initial; - var get = function () { - return value; - }; - var set = function (v) { - value = v; - }; - return { - get: get, - set: set - }; + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; }; var keys = Object.keys; var hasOwnProperty = Object.hasOwnProperty; var each$1 = function (obj, f) { - var props = keys(obj); - for (var k = 0, len = props.length; k < len; k++) { - var i = props[k]; - var x = obj[i]; - f(x, i); - } + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } }; var get = function (obj, key) { - return has(obj, key) ? Optional.from(obj[key]) : Optional.none(); + return has(obj, key) ? Optional.from(obj[key]) : Optional.none(); }; var has = function (obj, key) { - return hasOwnProperty.call(obj, key); + return hasOwnProperty.call(obj, key); }; var getScripts = function (editor) { - return editor.getParam('media_scripts'); + return editor.getParam('media_scripts'); }; var getAudioTemplateCallback = function (editor) { - return editor.getParam('audio_template_callback'); + return editor.getParam('audio_template_callback'); }; var getVideoTemplateCallback = function (editor) { - return editor.getParam('video_template_callback'); + return editor.getParam('video_template_callback'); }; var hasLiveEmbeds = function (editor) { - return editor.getParam('media_live_embeds', true); + return editor.getParam('media_live_embeds', true); }; var shouldFilterHtml = function (editor) { - return editor.getParam('media_filter_html', true); + return editor.getParam('media_filter_html', true); }; var getUrlResolver = function (editor) { - return editor.getParam('media_url_resolver'); + return editor.getParam('media_url_resolver'); }; var hasAltSource = function (editor) { - return editor.getParam('media_alt_source', true); + return editor.getParam('media_alt_source', true); }; var hasPoster = function (editor) { - return editor.getParam('media_poster', true); + return editor.getParam('media_poster', true); }; var hasDimensions = function (editor) { - return editor.getParam('media_dimensions', true); + return editor.getParam('media_dimensions', true); }; var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); @@ -245,95 +245,95 @@ var global$3 = tinymce.util.Tools.resolve('tinymce.html.SaxParser'); var getVideoScriptMatch = function (prefixes, src) { - if (prefixes) { - for (var i = 0; i < prefixes.length; i++) { - if (src.indexOf(prefixes[i].filter) !== -1) { - return prefixes[i]; - } - } + if (prefixes) { + for (var i = 0; i < prefixes.length; i++) { + if (src.indexOf(prefixes[i].filter) !== -1) { + return prefixes[i]; + } } + } }; var DOM = global$2.DOM; var trimPx = function (value) { - return value.replace(/px$/, ''); + return value.replace(/px$/, ''); }; var getEphoxEmbedData = function (attrs) { - var style = attrs.map.style; - var styles = style ? DOM.parseStyle(style) : {}; - return { - type: 'ephox-embed-iri', - source: attrs.map['data-ephox-embed-iri'], - altsource: '', - poster: '', - width: get(styles, 'max-width').map(trimPx).getOr(''), - height: get(styles, 'max-height').map(trimPx).getOr('') - }; + var style = attrs.map.style; + var styles = style ? DOM.parseStyle(style) : {}; + return { + type: 'ephox-embed-iri', + source: attrs.map['data-ephox-embed-iri'], + altsource: '', + poster: '', + width: get(styles, 'max-width').map(trimPx).getOr(''), + height: get(styles, 'max-height').map(trimPx).getOr('') + }; }; var htmlToData = function (prefixes, html) { - var isEphoxEmbed = Cell(false); - var data = {}; - global$3({ - validate: false, - allow_conditional_comments: true, - start: function (name, attrs) { - if (isEphoxEmbed.get()) ; else if (has(attrs.map, 'data-ephox-embed-iri')) { - isEphoxEmbed.set(true); - data = getEphoxEmbedData(attrs); - } else { - if (!data.source && name === 'param') { - data.source = attrs.map.movie; - } - if (name === 'iframe' || name === 'object' || name === 'embed' || name === 'video' || name === 'audio') { - if (!data.type) { - data.type = name; - } - data = global$1.extend(attrs.map, data); - } - if (name === 'script') { - var videoScript = getVideoScriptMatch(prefixes, attrs.map.src); - if (!videoScript) { - return; - } - data = { - type: 'script', - source: attrs.map.src, - width: String(videoScript.width), - height: String(videoScript.height) - }; - } - if (name === 'source') { - if (!data.source) { - data.source = attrs.map.src; - } else if (!data.altsource) { - data.altsource = attrs.map.src; - } - } - if (name === 'img' && !data.poster) { - data.poster = attrs.map.src; - } - } + var isEphoxEmbed = Cell(false); + var data = {}; + global$3({ + validate: false, + allow_conditional_comments: true, + start: function (name, attrs) { + if (isEphoxEmbed.get()) ; else if (has(attrs.map, 'data-ephox-embed-iri')) { + isEphoxEmbed.set(true); + data = getEphoxEmbedData(attrs); + } else { + if (!data.source && name === 'param') { + data.source = attrs.map.movie; + } + if (name === 'iframe' || name === 'object' || name === 'embed' || name === 'video' || name === 'audio') { + if (!data.type) { + data.type = name; + } + data = global$1.extend(attrs.map, data); + } + if (name === 'script') { + var videoScript = getVideoScriptMatch(prefixes, attrs.map.src); + if (!videoScript) { + return; + } + data = { + type: 'script', + source: attrs.map.src, + width: String(videoScript.width), + height: String(videoScript.height) + }; + } + if (name === 'source') { + if (!data.source) { + data.source = attrs.map.src; + } else if (!data.altsource) { + data.altsource = attrs.map.src; + } } - }).parse(html); - data.source = data.source || data.src || data.data; - data.altsource = data.altsource || ''; - data.poster = data.poster || ''; - return data; + if (name === 'img' && !data.poster) { + data.poster = attrs.map.src; + } + } + } + }).parse(html); + data.source = data.source || data.src || data.data; + data.altsource = data.altsource || ''; + data.poster = data.poster || ''; + return data; }; var guess = function (url) { - var mimes = { - mp3: 'audio/mpeg', - m4a: 'audio/x-m4a', - wav: 'audio/wav', - mp4: 'video/mp4', - webm: 'video/webm', - ogg: 'video/ogg', - swf: 'application/x-shockwave-flash' - }; - var fileEnd = url.toLowerCase().split('.').pop(); - var mime = mimes[fileEnd]; - return mime ? mime : ''; + var mimes = { + mp3: 'audio/mpeg', + m4a: 'audio/x-m4a', + wav: 'audio/wav', + mp4: 'video/mp4', + webm: 'video/webm', + ogg: 'video/ogg', + swf: 'application/x-shockwave-flash' + }; + var fileEnd = url.toLowerCase().split('.').pop(); + var mime = mimes[fileEnd]; + return mime ? mime : ''; }; var global$4 = tinymce.util.Tools.resolve('tinymce.html.Schema'); @@ -342,654 +342,654 @@ var DOM$1 = global$2.DOM; var addPx = function (value) { - return /^[0-9.]+$/.test(value) ? value + 'px' : value; + return /^[0-9.]+$/.test(value) ? value + 'px' : value; }; var setAttributes = function (attrs, updatedAttrs) { - each$1(updatedAttrs, function (val, name) { - var value = '' + val; - if (attrs.map[name]) { - var i = attrs.length; - while (i--) { - var attr = attrs[i]; - if (attr.name === name) { - if (value) { - attrs.map[name] = value; - attr.value = value; - } else { - delete attrs.map[name]; - attrs.splice(i, 1); - } - } - } - } else if (value) { - attrs.push({ - name: name, - value: value - }); + each$1(updatedAttrs, function (val, name) { + var value = '' + val; + if (attrs.map[name]) { + var i = attrs.length; + while (i--) { + var attr = attrs[i]; + if (attr.name === name) { + if (value) { attrs.map[name] = value; + attr.value = value; + } else { + delete attrs.map[name]; + attrs.splice(i, 1); + } } - }); + } + } else if (value) { + attrs.push({ + name: name, + value: value + }); + attrs.map[name] = value; + } + }); }; var updateEphoxEmbed = function (data, attrs) { - var style = attrs.map.style; - var styleMap = style ? DOM$1.parseStyle(style) : {}; - styleMap['max-width'] = addPx(data.width); - styleMap['max-height'] = addPx(data.height); - setAttributes(attrs, {style: DOM$1.serializeStyle(styleMap)}); + var style = attrs.map.style; + var styleMap = style ? DOM$1.parseStyle(style) : {}; + styleMap['max-width'] = addPx(data.width); + styleMap['max-height'] = addPx(data.height); + setAttributes(attrs, { style: DOM$1.serializeStyle(styleMap) }); }; var sources = [ - 'source', - 'altsource' + 'source', + 'altsource' ]; var updateHtml = function (html, data, updateAll) { - var writer = global$5(); - var isEphoxEmbed = Cell(false); - var sourceCount = 0; - var hasImage; - global$3({ - validate: false, - allow_conditional_comments: true, - comment: function (text) { - writer.comment(text); - }, - cdata: function (text) { - writer.cdata(text); - }, - text: function (text, raw) { - writer.text(text, raw); - }, - start: function (name, attrs, empty) { - if (isEphoxEmbed.get()) ; else if (has(attrs.map, 'data-ephox-embed-iri')) { - isEphoxEmbed.set(true); - updateEphoxEmbed(data, attrs); - } else { - switch (name) { - case 'video': - case 'object': - case 'embed': - case 'img': - case 'iframe': - if (data.height !== undefined && data.width !== undefined) { - setAttributes(attrs, { - width: data.width, - height: data.height - }); - } - break; - } - if (updateAll) { - switch (name) { - case 'video': - setAttributes(attrs, { - poster: data.poster, - src: '' - }); - if (data.altsource) { - setAttributes(attrs, {src: ''}); - } - break; - case 'iframe': - setAttributes(attrs, {src: data.source}); - break; - case 'source': - if (sourceCount < 2) { - setAttributes(attrs, { - src: data[sources[sourceCount]], - type: data[sources[sourceCount] + 'mime'] - }); - if (!data[sources[sourceCount]]) { - return; - } - } - sourceCount++; - break; - case 'img': - if (!data.poster) { - return; - } - hasImage = true; - break; - } - } + var writer = global$5(); + var isEphoxEmbed = Cell(false); + var sourceCount = 0; + var hasImage; + global$3({ + validate: false, + allow_conditional_comments: true, + comment: function (text) { + writer.comment(text); + }, + cdata: function (text) { + writer.cdata(text); + }, + text: function (text, raw) { + writer.text(text, raw); + }, + start: function (name, attrs, empty) { + if (isEphoxEmbed.get()) ; else if (has(attrs.map, 'data-ephox-embed-iri')) { + isEphoxEmbed.set(true); + updateEphoxEmbed(data, attrs); + } else { + switch (name) { + case 'video': + case 'object': + case 'embed': + case 'img': + case 'iframe': + if (data.height !== undefined && data.width !== undefined) { + setAttributes(attrs, { + width: data.width, + height: data.height + }); + } + break; + } + if (updateAll) { + switch (name) { + case 'video': + setAttributes(attrs, { + poster: data.poster, + src: '' + }); + if (data.altsource) { + setAttributes(attrs, { src: '' }); + } + break; + case 'iframe': + setAttributes(attrs, { src: data.source }); + break; + case 'source': + if (sourceCount < 2) { + setAttributes(attrs, { + src: data[sources[sourceCount]], + type: data[sources[sourceCount] + 'mime'] + }); + if (!data[sources[sourceCount]]) { + return; + } } - writer.start(name, attrs, empty); - }, - end: function (name) { - if (!isEphoxEmbed.get()) { - if (name === 'video' && updateAll) { - for (var index = 0; index < 2; index++) { - if (data[sources[index]]) { - var attrs = []; - attrs.map = {}; - if (sourceCount <= index) { - setAttributes(attrs, { - src: data[sources[index]], - type: data[sources[index] + 'mime'] - }); - writer.start('source', attrs, true); - } - } - } - } - if (data.poster && name === 'object' && updateAll && !hasImage) { - var imgAttrs = []; - imgAttrs.map = {}; - setAttributes(imgAttrs, { - src: data.poster, - width: data.width, - height: data.height - }); - writer.start('img', imgAttrs, true); - } + sourceCount++; + break; + case 'img': + if (!data.poster) { + return; } - writer.end(name); + hasImage = true; + break; + } } - }, global$4({})).parse(html); - return writer.getContent(); + } + writer.start(name, attrs, empty); + }, + end: function (name) { + if (!isEphoxEmbed.get()) { + if (name === 'video' && updateAll) { + for (var index = 0; index < 2; index++) { + if (data[sources[index]]) { + var attrs = []; + attrs.map = {}; + if (sourceCount <= index) { + setAttributes(attrs, { + src: data[sources[index]], + type: data[sources[index] + 'mime'] + }); + writer.start('source', attrs, true); + } + } + } + } + if (data.poster && name === 'object' && updateAll && !hasImage) { + var imgAttrs = []; + imgAttrs.map = {}; + setAttributes(imgAttrs, { + src: data.poster, + width: data.width, + height: data.height + }); + writer.start('img', imgAttrs, true); + } + } + writer.end(name); + } + }, global$4({})).parse(html); + return writer.getContent(); }; var urlPatterns = [ - { - regex: /youtu\.be\/([\w\-_\?&=.]+)/i, - type: 'iframe', - w: 560, - h: 314, - url: 'www.youtube.com/embed/$1', - allowFullscreen: true - }, - { - regex: /youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i, - type: 'iframe', - w: 560, - h: 314, - url: 'www.youtube.com/embed/$2?$4', - allowFullscreen: true - }, - { - regex: /youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i, - type: 'iframe', - w: 560, - h: 314, - url: 'www.youtube.com/embed/$1', - allowFullscreen: true - }, - { - regex: /vimeo\.com\/([0-9]+)/, - type: 'iframe', - w: 425, - h: 350, - url: 'player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc', - allowFullscreen: true - }, - { - regex: /vimeo\.com\/(.*)\/([0-9]+)/, - type: 'iframe', - w: 425, - h: 350, - url: 'player.vimeo.com/video/$2?title=0&byline=0', - allowFullscreen: true - }, - { - regex: /maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/, - type: 'iframe', - w: 425, - h: 350, - url: 'maps.google.com/maps/ms?msid=$2&output=embed"', - allowFullscreen: false - }, - { - regex: /dailymotion\.com\/video\/([^_]+)/, - type: 'iframe', - w: 480, - h: 270, - url: 'www.dailymotion.com/embed/video/$1', - allowFullscreen: true - }, - { - regex: /dai\.ly\/([^_]+)/, - type: 'iframe', - w: 480, - h: 270, - url: 'www.dailymotion.com/embed/video/$1', - allowFullscreen: true - } + { + regex: /youtu\.be\/([\w\-_\?&=.]+)/i, + type: 'iframe', + w: 560, + h: 314, + url: 'www.youtube.com/embed/$1', + allowFullscreen: true + }, + { + regex: /youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i, + type: 'iframe', + w: 560, + h: 314, + url: 'www.youtube.com/embed/$2?$4', + allowFullscreen: true + }, + { + regex: /youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i, + type: 'iframe', + w: 560, + h: 314, + url: 'www.youtube.com/embed/$1', + allowFullscreen: true + }, + { + regex: /vimeo\.com\/([0-9]+)/, + type: 'iframe', + w: 425, + h: 350, + url: 'player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc', + allowFullscreen: true + }, + { + regex: /vimeo\.com\/(.*)\/([0-9]+)/, + type: 'iframe', + w: 425, + h: 350, + url: 'player.vimeo.com/video/$2?title=0&byline=0', + allowFullscreen: true + }, + { + regex: /maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/, + type: 'iframe', + w: 425, + h: 350, + url: 'maps.google.com/maps/ms?msid=$2&output=embed"', + allowFullscreen: false + }, + { + regex: /dailymotion\.com\/video\/([^_]+)/, + type: 'iframe', + w: 480, + h: 270, + url: 'www.dailymotion.com/embed/video/$1', + allowFullscreen: true + }, + { + regex: /dai\.ly\/([^_]+)/, + type: 'iframe', + w: 480, + h: 270, + url: 'www.dailymotion.com/embed/video/$1', + allowFullscreen: true + } ]; var getProtocol = function (url) { - var protocolMatches = url.match(/^(https?:\/\/|www\.)(.+)$/i); - if (protocolMatches && protocolMatches.length > 1) { - return protocolMatches[1] === 'www.' ? 'https://' : protocolMatches[1]; - } else { - return 'https://'; - } + var protocolMatches = url.match(/^(https?:\/\/|www\.)(.+)$/i); + if (protocolMatches && protocolMatches.length > 1) { + return protocolMatches[1] === 'www.' ? 'https://' : protocolMatches[1]; + } else { + return 'https://'; + } }; var getUrl = function (pattern, url) { - var protocol = getProtocol(url); - var match = pattern.regex.exec(url); - var newUrl = protocol + pattern.url; - var _loop_1 = function (i) { - newUrl = newUrl.replace('$' + i, function () { - return match[i] ? match[i] : ''; - }); - }; - for (var i = 0; i < match.length; i++) { - _loop_1(i); - } - return newUrl.replace(/\?$/, ''); + var protocol = getProtocol(url); + var match = pattern.regex.exec(url); + var newUrl = protocol + pattern.url; + var _loop_1 = function (i) { + newUrl = newUrl.replace('$' + i, function () { + return match[i] ? match[i] : ''; + }); + }; + for (var i = 0; i < match.length; i++) { + _loop_1(i); + } + return newUrl.replace(/\?$/, ''); }; var matchPattern = function (url) { - var patterns = urlPatterns.filter(function (pattern) { - return pattern.regex.test(url); - }); - if (patterns.length > 0) { - return global$1.extend({}, patterns[0], {url: getUrl(patterns[0], url)}); - } else { - return null; - } + var patterns = urlPatterns.filter(function (pattern) { + return pattern.regex.test(url); + }); + if (patterns.length > 0) { + return global$1.extend({}, patterns[0], { url: getUrl(patterns[0], url) }); + } else { + return null; + } }; var getIframeHtml = function (data) { - var allowFullscreen = data.allowFullscreen ? ' allowFullscreen="1"' : ''; - return ''; + var allowFullscreen = data.allowFullscreen ? ' allowFullscreen="1"' : ''; + return ''; }; var getFlashHtml = function (data) { - var html = ''; - if (data.poster) { - html += ''; - } - html += ''; - return html; + var html = ''; + if (data.poster) { + html += ''; + } + html += ''; + return html; }; var getAudioHtml = function (data, audioTemplateCallback) { - if (audioTemplateCallback) { - return audioTemplateCallback(data); - } else { - return ''; - } + if (audioTemplateCallback) { + return audioTemplateCallback(data); + } else { + return ''; + } }; var getVideoHtml = function (data, videoTemplateCallback) { - if (videoTemplateCallback) { - return videoTemplateCallback(data); - } else { - return ''; - } + if (videoTemplateCallback) { + return videoTemplateCallback(data); + } else { + return ''; + } }; var getScriptHtml = function (data) { - return ''; + return ''; }; var dataToHtml = function (editor, dataIn) { - var data = global$1.extend({}, dataIn); + var data = global$1.extend({}, dataIn); + if (!data.source) { + global$1.extend(data, htmlToData(getScripts(editor), data.embed)); if (!data.source) { - global$1.extend(data, htmlToData(getScripts(editor), data.embed)); - if (!data.source) { - return ''; - } - } - if (!data.altsource) { - data.altsource = ''; + return ''; } - if (!data.poster) { - data.poster = ''; + } + if (!data.altsource) { + data.altsource = ''; + } + if (!data.poster) { + data.poster = ''; + } + data.source = editor.convertURL(data.source, 'source'); + data.altsource = editor.convertURL(data.altsource, 'source'); + data.sourcemime = guess(data.source); + data.altsourcemime = guess(data.altsource); + data.poster = editor.convertURL(data.poster, 'poster'); + var pattern = matchPattern(data.source); + if (pattern) { + data.source = pattern.url; + data.type = pattern.type; + data.allowFullscreen = pattern.allowFullscreen; + data.width = data.width || String(pattern.w); + data.height = data.height || String(pattern.h); + } + if (data.embed) { + return updateHtml(data.embed, data, true); + } else { + var videoScript = getVideoScriptMatch(getScripts(editor), data.source); + if (videoScript) { + data.type = 'script'; + data.width = String(videoScript.width); + data.height = String(videoScript.height); } - data.source = editor.convertURL(data.source, 'source'); - data.altsource = editor.convertURL(data.altsource, 'source'); - data.sourcemime = guess(data.source); - data.altsourcemime = guess(data.altsource); - data.poster = editor.convertURL(data.poster, 'poster'); - var pattern = matchPattern(data.source); - if (pattern) { - data.source = pattern.url; - data.type = pattern.type; - data.allowFullscreen = pattern.allowFullscreen; - data.width = data.width || String(pattern.w); - data.height = data.height || String(pattern.h); - } - if (data.embed) { - return updateHtml(data.embed, data, true); + var audioTemplateCallback = getAudioTemplateCallback(editor); + var videoTemplateCallback = getVideoTemplateCallback(editor); + data.width = data.width || '300'; + data.height = data.height || '150'; + global$1.each(data, function (value, key) { + data[key] = editor.dom.encode('' + value); + }); + if (data.type === 'iframe') { + return getIframeHtml(data); + } else if (data.sourcemime === 'application/x-shockwave-flash') { + return getFlashHtml(data); + } else if (data.sourcemime.indexOf('audio') !== -1) { + return getAudioHtml(data, audioTemplateCallback); + } else if (data.type === 'script') { + return getScriptHtml(data); } else { - var videoScript = getVideoScriptMatch(getScripts(editor), data.source); - if (videoScript) { - data.type = 'script'; - data.width = String(videoScript.width); - data.height = String(videoScript.height); - } - var audioTemplateCallback = getAudioTemplateCallback(editor); - var videoTemplateCallback = getVideoTemplateCallback(editor); - data.width = data.width || '300'; - data.height = data.height || '150'; - global$1.each(data, function (value, key) { - data[key] = editor.dom.encode('' + value); - }); - if (data.type === 'iframe') { - return getIframeHtml(data); - } else if (data.sourcemime === 'application/x-shockwave-flash') { - return getFlashHtml(data); - } else if (data.sourcemime.indexOf('audio') !== -1) { - return getAudioHtml(data, audioTemplateCallback); - } else if (data.type === 'script') { - return getScriptHtml(data); - } else { - return getVideoHtml(data, videoTemplateCallback); - } + return getVideoHtml(data, videoTemplateCallback); } + } }; var global$6 = tinymce.util.Tools.resolve('tinymce.util.Promise'); var cache = {}; var embedPromise = function (data, dataToHtml, handler) { - return new global$6(function (res, rej) { - var wrappedResolve = function (response) { - if (response.html) { - cache[data.source] = response; - } - return res({ - url: data.source, - html: response.html ? response.html : dataToHtml(data) - }); - }; - if (cache[data.source]) { - wrappedResolve(cache[data.source]); - } else { - handler({url: data.source}, wrappedResolve, rej); - } - }); + return new global$6(function (res, rej) { + var wrappedResolve = function (response) { + if (response.html) { + cache[data.source] = response; + } + return res({ + url: data.source, + html: response.html ? response.html : dataToHtml(data) + }); + }; + if (cache[data.source]) { + wrappedResolve(cache[data.source]); + } else { + handler({ url: data.source }, wrappedResolve, rej); + } + }); }; var defaultPromise = function (data, dataToHtml) { - return new global$6(function (res) { - res({ - html: dataToHtml(data), - url: data.source - }); + return new global$6(function (res) { + res({ + html: dataToHtml(data), + url: data.source }); + }); }; var loadedData = function (editor) { - return function (data) { - return dataToHtml(editor, data); - }; + return function (data) { + return dataToHtml(editor, data); + }; }; var getEmbedHtml = function (editor, data) { - var embedHandler = getUrlResolver(editor); - return embedHandler ? embedPromise(data, loadedData(editor), embedHandler) : defaultPromise(data, loadedData(editor)); + var embedHandler = getUrlResolver(editor); + return embedHandler ? embedPromise(data, loadedData(editor), embedHandler) : defaultPromise(data, loadedData(editor)); }; var isCached = function (url) { - return cache.hasOwnProperty(url); + return cache.hasOwnProperty(url); }; var extractMeta = function (sourceInput, data) { - return get(data, sourceInput).bind(function (mainData) { - return get(mainData, 'meta'); - }); + return get(data, sourceInput).bind(function (mainData) { + return get(mainData, 'meta'); + }); }; var getValue = function (data, metaData, sourceInput) { - return function (prop) { - var _a; - var getFromData = function () { - return get(data, prop); - }; - var getFromMetaData = function () { - return get(metaData, prop); - }; - var getNonEmptyValue = function (c) { - return get(c, 'value').bind(function (v) { - return v.length > 0 ? Optional.some(v) : Optional.none(); - }); - }; - var getFromValueFirst = function () { - return getFromData().bind(function (child) { - return isObject(child) ? getNonEmptyValue(child).orThunk(getFromMetaData) : getFromMetaData().orThunk(function () { - return Optional.from(child); - }); - }); - }; - var getFromMetaFirst = function () { - return getFromMetaData().orThunk(function () { - return getFromData().bind(function (child) { - return isObject(child) ? getNonEmptyValue(child) : Optional.from(child); - }); - }); - }; - return _a = {}, _a[prop] = (prop === sourceInput ? getFromValueFirst() : getFromMetaFirst()).getOr(''), _a; + return function (prop) { + var _a; + var getFromData = function () { + return get(data, prop); + }; + var getFromMetaData = function () { + return get(metaData, prop); + }; + var getNonEmptyValue = function (c) { + return get(c, 'value').bind(function (v) { + return v.length > 0 ? Optional.some(v) : Optional.none(); + }); + }; + var getFromValueFirst = function () { + return getFromData().bind(function (child) { + return isObject(child) ? getNonEmptyValue(child).orThunk(getFromMetaData) : getFromMetaData().orThunk(function () { + return Optional.from(child); + }); + }); }; + var getFromMetaFirst = function () { + return getFromMetaData().orThunk(function () { + return getFromData().bind(function (child) { + return isObject(child) ? getNonEmptyValue(child) : Optional.from(child); + }); + }); + }; + return _a = {}, _a[prop] = (prop === sourceInput ? getFromValueFirst() : getFromMetaFirst()).getOr(''), _a; + }; }; var getDimensions = function (data, metaData) { - var dimensions = {}; - get(data, 'dimensions').each(function (dims) { - each([ - 'width', - 'height' - ], function (prop) { - get(metaData, prop).orThunk(function () { - return get(dims, prop); - }).each(function (value) { - return dimensions[prop] = value; - }); - }); + var dimensions = {}; + get(data, 'dimensions').each(function (dims) { + each([ + 'width', + 'height' + ], function (prop) { + get(metaData, prop).orThunk(function () { + return get(dims, prop); + }).each(function (value) { + return dimensions[prop] = value; + }); }); - return dimensions; + }); + return dimensions; }; var unwrap = function (data, sourceInput) { - var metaData = sourceInput ? extractMeta(sourceInput, data).getOr({}) : {}; - var get = getValue(data, metaData, sourceInput); - return __assign(__assign(__assign(__assign(__assign({}, get('source')), get('altsource')), get('poster')), get('embed')), getDimensions(data, metaData)); + var metaData = sourceInput ? extractMeta(sourceInput, data).getOr({}) : {}; + var get = getValue(data, metaData, sourceInput); + return __assign(__assign(__assign(__assign(__assign({}, get('source')), get('altsource')), get('poster')), get('embed')), getDimensions(data, metaData)); }; var wrap = function (data) { - var wrapped = __assign(__assign({}, data), { - source: {value: get(data, 'source').getOr('')}, - altsource: {value: get(data, 'altsource').getOr('')}, - poster: {value: get(data, 'poster').getOr('')} - }); - each([ - 'width', - 'height' - ], function (prop) { - get(data, prop).each(function (value) { - var dimensions = wrapped.dimensions || {}; - dimensions[prop] = value; - wrapped.dimensions = dimensions; - }); + var wrapped = __assign(__assign({}, data), { + source: { value: get(data, 'source').getOr('') }, + altsource: { value: get(data, 'altsource').getOr('') }, + poster: { value: get(data, 'poster').getOr('') } + }); + each([ + 'width', + 'height' + ], function (prop) { + get(data, prop).each(function (value) { + var dimensions = wrapped.dimensions || {}; + dimensions[prop] = value; + wrapped.dimensions = dimensions; }); - return wrapped; + }); + return wrapped; }; var handleError = function (editor) { - return function (error) { - var errorMessage = error && error.msg ? 'Media embed handler error: ' + error.msg : 'Media embed handler threw unknown error.'; - editor.notificationManager.open({ - type: 'error', - text: errorMessage - }); - }; + return function (error) { + var errorMessage = error && error.msg ? 'Media embed handler error: ' + error.msg : 'Media embed handler threw unknown error.'; + editor.notificationManager.open({ + type: 'error', + text: errorMessage + }); + }; }; var snippetToData = function (editor, embedSnippet) { - return htmlToData(getScripts(editor), embedSnippet); + return htmlToData(getScripts(editor), embedSnippet); }; var isMediaElement = function (element) { - return element.getAttribute('data-mce-object') || element.getAttribute('data-ephox-embed-iri'); + return element.getAttribute('data-mce-object') || element.getAttribute('data-ephox-embed-iri'); }; var getEditorData = function (editor) { - var element = editor.selection.getNode(); - var snippet = isMediaElement(element) ? editor.serializer.serialize(element, {selection: true}) : ''; - return __assign({embed: snippet}, htmlToData(getScripts(editor), snippet)); + var element = editor.selection.getNode(); + var snippet = isMediaElement(element) ? editor.serializer.serialize(element, { selection: true }) : ''; + return __assign({ embed: snippet }, htmlToData(getScripts(editor), snippet)); }; var addEmbedHtml = function (api, editor) { - return function (response) { - if (isString(response.url) && response.url.trim().length > 0) { - var html = response.html; - var snippetData = snippetToData(editor, html); - var nuData = __assign(__assign({}, snippetData), { - source: response.url, - embed: html - }); - api.setData(wrap(nuData)); - } - }; + return function (response) { + if (isString(response.url) && response.url.trim().length > 0) { + var html = response.html; + var snippetData = snippetToData(editor, html); + var nuData = __assign(__assign({}, snippetData), { + source: response.url, + embed: html + }); + api.setData(wrap(nuData)); + } + }; }; var selectPlaceholder = function (editor, beforeObjects) { - var afterObjects = editor.dom.select('img[data-mce-object]'); - for (var i = 0; i < beforeObjects.length; i++) { - for (var y = afterObjects.length - 1; y >= 0; y--) { - if (beforeObjects[i] === afterObjects[y]) { - afterObjects.splice(y, 1); - } - } + var afterObjects = editor.dom.select('img[data-mce-object]'); + for (var i = 0; i < beforeObjects.length; i++) { + for (var y = afterObjects.length - 1; y >= 0; y--) { + if (beforeObjects[i] === afterObjects[y]) { + afterObjects.splice(y, 1); + } } - editor.selection.select(afterObjects[0]); + } + editor.selection.select(afterObjects[0]); }; var handleInsert = function (editor, html) { - var beforeObjects = editor.dom.select('img[data-mce-object]'); - editor.insertContent(html); - selectPlaceholder(editor, beforeObjects); - editor.nodeChanged(); + var beforeObjects = editor.dom.select('img[data-mce-object]'); + editor.insertContent(html); + selectPlaceholder(editor, beforeObjects); + editor.nodeChanged(); }; var submitForm = function (prevData, newData, editor) { - newData.embed = updateHtml(newData.embed, newData); - if (newData.embed && (prevData.source === newData.source || isCached(newData.source))) { - handleInsert(editor, newData.embed); - } else { - getEmbedHtml(editor, newData).then(function (response) { - handleInsert(editor, response.html); - }).catch(handleError(editor)); - } + newData.embed = updateHtml(newData.embed, newData); + if (newData.embed && (prevData.source === newData.source || isCached(newData.source))) { + handleInsert(editor, newData.embed); + } else { + getEmbedHtml(editor, newData).then(function (response) { + handleInsert(editor, response.html); + }).catch(handleError(editor)); + } }; var showDialog = function (editor) { - var editorData = getEditorData(editor); - var currentData = Cell(editorData); - var initialData = wrap(editorData); - var handleSource = function (prevData, api) { - var serviceData = unwrap(api.getData(), 'source'); - if (prevData.source !== serviceData.source) { - addEmbedHtml(win, editor)({ - url: serviceData.source, - html: '' - }); - getEmbedHtml(editor, serviceData).then(addEmbedHtml(win, editor)).catch(handleError(editor)); - } - }; - var handleEmbed = function (api) { - var data = unwrap(api.getData()); - var dataFromEmbed = snippetToData(editor, data.embed); - api.setData(wrap(dataFromEmbed)); - }; - var handleUpdate = function (api, sourceInput) { - var data = unwrap(api.getData(), sourceInput); - var embed = dataToHtml(editor, data); - api.setData(wrap(__assign(__assign({}, data), {embed: embed}))); - }; - var mediaInput = [{ - name: 'source', - type: 'urlinput', - filetype: 'media', - label: 'Source' + var editorData = getEditorData(editor); + var currentData = Cell(editorData); + var initialData = wrap(editorData); + var handleSource = function (prevData, api) { + var serviceData = unwrap(api.getData(), 'source'); + if (prevData.source !== serviceData.source) { + addEmbedHtml(win, editor)({ + url: serviceData.source, + html: '' + }); + getEmbedHtml(editor, serviceData).then(addEmbedHtml(win, editor)).catch(handleError(editor)); + } + }; + var handleEmbed = function (api) { + var data = unwrap(api.getData()); + var dataFromEmbed = snippetToData(editor, data.embed); + api.setData(wrap(dataFromEmbed)); + }; + var handleUpdate = function (api, sourceInput) { + var data = unwrap(api.getData(), sourceInput); + var embed = dataToHtml(editor, data); + api.setData(wrap(__assign(__assign({}, data), { embed: embed }))); + }; + var mediaInput = [{ + name: 'source', + type: 'urlinput', + filetype: 'media', + label: 'Source' }]; - var sizeInput = !hasDimensions(editor) ? [] : [{ - type: 'sizeinput', - name: 'dimensions', - label: 'Constrain proportions', - constrain: true + var sizeInput = !hasDimensions(editor) ? [] : [{ + type: 'sizeinput', + name: 'dimensions', + label: 'Constrain proportions', + constrain: true }]; - var generalTab = { - title: 'General', - name: 'general', - items: flatten([ - mediaInput, - sizeInput - ]) - }; - var embedTextarea = { - type: 'textarea', - name: 'embed', - label: 'Paste your embed code below:' - }; - var embedTab = { - title: 'Embed', - items: [embedTextarea] - }; - var advancedFormItems = []; - if (hasAltSource(editor)) { - advancedFormItems.push({ - name: 'altsource', - type: 'urlinput', - filetype: 'media', - label: 'Alternative source URL' - }); - } - if (hasPoster(editor)) { - advancedFormItems.push({ - name: 'poster', - type: 'urlinput', - filetype: 'image', - label: 'Media poster (Image URL)' - }); - } - var advancedTab = { - title: 'Advanced', - name: 'advanced', - items: advancedFormItems - }; - var tabs = [ - generalTab, - embedTab - ]; - if (advancedFormItems.length > 0) { - tabs.push(advancedTab); - } - var body = { - type: 'tabpanel', - tabs: tabs - }; - var win = editor.windowManager.open({ - title: 'Insert/Edit Media', - size: 'normal', - body: body, - buttons: [ - { - type: 'cancel', - name: 'cancel', - text: 'Cancel' - }, - { - type: 'submit', - name: 'save', - text: 'Save', - primary: true - } - ], - onSubmit: function (api) { - var serviceData = unwrap(api.getData()); - submitForm(currentData.get(), serviceData, editor); - api.close(); - }, - onChange: function (api, detail) { - switch (detail.name) { - case 'source': - handleSource(currentData.get(), api); - break; - case 'embed': - handleEmbed(api); - break; - case 'dimensions': - case 'altsource': - case 'poster': - handleUpdate(api, detail.name); - break; - } - currentData.set(unwrap(api.getData())); - }, - initialData: initialData + var generalTab = { + title: 'General', + name: 'general', + items: flatten([ + mediaInput, + sizeInput + ]) + }; + var embedTextarea = { + type: 'textarea', + name: 'embed', + label: 'Paste your embed code below:' + }; + var embedTab = { + title: 'Embed', + items: [embedTextarea] + }; + var advancedFormItems = []; + if (hasAltSource(editor)) { + advancedFormItems.push({ + name: 'altsource', + type: 'urlinput', + filetype: 'media', + label: 'Alternative source URL' }); + } + if (hasPoster(editor)) { + advancedFormItems.push({ + name: 'poster', + type: 'urlinput', + filetype: 'image', + label: 'Media poster (Image URL)' + }); + } + var advancedTab = { + title: 'Advanced', + name: 'advanced', + items: advancedFormItems + }; + var tabs = [ + generalTab, + embedTab + ]; + if (advancedFormItems.length > 0) { + tabs.push(advancedTab); + } + var body = { + type: 'tabpanel', + tabs: tabs + }; + var win = editor.windowManager.open({ + title: 'Insert/Edit Media', + size: 'normal', + body: body, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + onSubmit: function (api) { + var serviceData = unwrap(api.getData()); + submitForm(currentData.get(), serviceData, editor); + api.close(); + }, + onChange: function (api, detail) { + switch (detail.name) { + case 'source': + handleSource(currentData.get(), api); + break; + case 'embed': + handleEmbed(api); + break; + case 'dimensions': + case 'altsource': + case 'poster': + handleUpdate(api, detail.name); + break; + } + currentData.set(unwrap(api.getData())); + }, + initialData: initialData + }); }; var get$1 = function (editor) { - var showDialog$1 = function () { - showDialog(editor); - }; - return {showDialog: showDialog$1}; + var showDialog$1 = function () { + showDialog(editor); + }; + return { showDialog: showDialog$1 }; }; var register = function (editor) { - var showDialog$1 = function () { - showDialog(editor); - }; - editor.addCommand('mceMedia', showDialog$1); + var showDialog$1 = function () { + showDialog(editor); + }; + editor.addCommand('mceMedia', showDialog$1); }; var global$7 = tinymce.util.Tools.resolve('tinymce.html.Node'); @@ -997,317 +997,317 @@ var global$8 = tinymce.util.Tools.resolve('tinymce.Env'); var sanitize = function (editor, html) { - if (shouldFilterHtml(editor) === false) { - return html; - } - var writer = global$5(); - var blocked; - global$3({ - validate: false, - allow_conditional_comments: false, - comment: function (text) { - writer.comment(text); - }, - cdata: function (text) { - writer.cdata(text); - }, - text: function (text, raw) { - writer.text(text, raw); - }, - start: function (name, attrs, empty) { - blocked = true; - if (name === 'script' || name === 'noscript' || name === 'svg') { - return; - } - for (var i = attrs.length - 1; i >= 0; i--) { - var attrName = attrs[i].name; - if (attrName.indexOf('on') === 0) { - delete attrs.map[attrName]; - attrs.splice(i, 1); - } - if (attrName === 'style') { - attrs[i].value = editor.dom.serializeStyle(editor.dom.parseStyle(attrs[i].value), name); - } - } - writer.start(name, attrs, empty); - blocked = false; - }, - end: function (name) { - if (blocked) { - return; - } - writer.end(name); + if (shouldFilterHtml(editor) === false) { + return html; + } + var writer = global$5(); + var blocked; + global$3({ + validate: false, + allow_conditional_comments: false, + comment: function (text) { + writer.comment(text); + }, + cdata: function (text) { + writer.cdata(text); + }, + text: function (text, raw) { + writer.text(text, raw); + }, + start: function (name, attrs, empty) { + blocked = true; + if (name === 'script' || name === 'noscript' || name === 'svg') { + return; + } + for (var i = attrs.length - 1; i >= 0; i--) { + var attrName = attrs[i].name; + if (attrName.indexOf('on') === 0) { + delete attrs.map[attrName]; + attrs.splice(i, 1); + } + if (attrName === 'style') { + attrs[i].value = editor.dom.serializeStyle(editor.dom.parseStyle(attrs[i].value), name); } - }, global$4({})).parse(html); - return writer.getContent(); + } + writer.start(name, attrs, empty); + blocked = false; + }, + end: function (name) { + if (blocked) { + return; + } + writer.end(name); + } + }, global$4({})).parse(html); + return writer.getContent(); }; var createPlaceholderNode = function (editor, node) { - var name = node.name; - var placeHolder = new global$7('img', 1); - placeHolder.shortEnded = true; - retainAttributesAndInnerHtml(editor, node, placeHolder); - placeHolder.attr({ - 'width': node.attr('width') || '300', - 'height': node.attr('height') || (name === 'audio' ? '30' : '150'), - 'style': node.attr('style'), - 'src': global$8.transparentSrc, - 'data-mce-object': name, - 'class': 'mce-object mce-object-' + name - }); - return placeHolder; + var name = node.name; + var placeHolder = new global$7('img', 1); + placeHolder.shortEnded = true; + retainAttributesAndInnerHtml(editor, node, placeHolder); + placeHolder.attr({ + 'width': node.attr('width') || '300', + 'height': node.attr('height') || (name === 'audio' ? '30' : '150'), + 'style': node.attr('style'), + 'src': global$8.transparentSrc, + 'data-mce-object': name, + 'class': 'mce-object mce-object-' + name + }); + return placeHolder; }; var createPreviewIframeNode = function (editor, node) { - var name = node.name; - var previewWrapper = new global$7('span', 1); - previewWrapper.attr({ - 'contentEditable': 'false', - 'style': node.attr('style'), - 'data-mce-object': name, - 'class': 'mce-preview-object mce-object-' + name - }); - retainAttributesAndInnerHtml(editor, node, previewWrapper); - var previewNode = new global$7(name, 1); - previewNode.attr({ - src: node.attr('src'), - allowfullscreen: node.attr('allowfullscreen'), - style: node.attr('style'), - class: node.attr('class'), - width: node.attr('width'), - height: node.attr('height'), - frameborder: '0' - }); - var shimNode = new global$7('span', 1); - shimNode.attr('class', 'mce-shim'); - previewWrapper.append(previewNode); - previewWrapper.append(shimNode); - return previewWrapper; + var name = node.name; + var previewWrapper = new global$7('span', 1); + previewWrapper.attr({ + 'contentEditable': 'false', + 'style': node.attr('style'), + 'data-mce-object': name, + 'class': 'mce-preview-object mce-object-' + name + }); + retainAttributesAndInnerHtml(editor, node, previewWrapper); + var previewNode = new global$7(name, 1); + previewNode.attr({ + src: node.attr('src'), + allowfullscreen: node.attr('allowfullscreen'), + style: node.attr('style'), + class: node.attr('class'), + width: node.attr('width'), + height: node.attr('height'), + frameborder: '0' + }); + var shimNode = new global$7('span', 1); + shimNode.attr('class', 'mce-shim'); + previewWrapper.append(previewNode); + previewWrapper.append(shimNode); + return previewWrapper; }; var retainAttributesAndInnerHtml = function (editor, sourceNode, targetNode) { - var attrName; - var attrValue; - var ai; - var attribs = sourceNode.attributes; - ai = attribs.length; - while (ai--) { - attrName = attribs[ai].name; - attrValue = attribs[ai].value; - if (attrName !== 'width' && attrName !== 'height' && attrName !== 'style') { - if (attrName === 'data' || attrName === 'src') { - attrValue = editor.convertURL(attrValue, attrName); - } - targetNode.attr('data-mce-p-' + attrName, attrValue); - } - } - var innerHtml = sourceNode.firstChild && sourceNode.firstChild.value; - if (innerHtml) { - targetNode.attr('data-mce-html', escape(sanitize(editor, innerHtml))); - targetNode.firstChild = null; + var attrName; + var attrValue; + var ai; + var attribs = sourceNode.attributes; + ai = attribs.length; + while (ai--) { + attrName = attribs[ai].name; + attrValue = attribs[ai].value; + if (attrName !== 'width' && attrName !== 'height' && attrName !== 'style') { + if (attrName === 'data' || attrName === 'src') { + attrValue = editor.convertURL(attrValue, attrName); + } + targetNode.attr('data-mce-p-' + attrName, attrValue); } + } + var innerHtml = sourceNode.firstChild && sourceNode.firstChild.value; + if (innerHtml) { + targetNode.attr('data-mce-html', escape(sanitize(editor, innerHtml))); + targetNode.firstChild = null; + } }; var isPageEmbedWrapper = function (node) { - var nodeClass = node.attr('class'); - return nodeClass && /\btiny-pageembed\b/.test(nodeClass); + var nodeClass = node.attr('class'); + return nodeClass && /\btiny-pageembed\b/.test(nodeClass); }; var isWithinEmbedWrapper = function (node) { - while (node = node.parent) { - if (node.attr('data-ephox-embed-iri') || isPageEmbedWrapper(node)) { - return true; - } + while (node = node.parent) { + if (node.attr('data-ephox-embed-iri') || isPageEmbedWrapper(node)) { + return true; } - return false; + } + return false; }; var placeHolderConverter = function (editor) { - return function (nodes) { - var i = nodes.length; - var node; - var videoScript; - while (i--) { - node = nodes[i]; - if (!node.parent) { - continue; - } - if (node.parent.attr('data-mce-object')) { - continue; - } - if (node.name === 'script') { - videoScript = getVideoScriptMatch(getScripts(editor), node.attr('src')); - if (!videoScript) { - continue; - } - } - if (videoScript) { - if (videoScript.width) { - node.attr('width', videoScript.width.toString()); - } - if (videoScript.height) { - node.attr('height', videoScript.height.toString()); - } - } - if (node.name === 'iframe' && hasLiveEmbeds(editor) && global$8.ceFalse) { - if (!isWithinEmbedWrapper(node)) { - node.replace(createPreviewIframeNode(editor, node)); - } - } else { - if (!isWithinEmbedWrapper(node)) { - node.replace(createPlaceholderNode(editor, node)); - } - } + return function (nodes) { + var i = nodes.length; + var node; + var videoScript; + while (i--) { + node = nodes[i]; + if (!node.parent) { + continue; + } + if (node.parent.attr('data-mce-object')) { + continue; + } + if (node.name === 'script') { + videoScript = getVideoScriptMatch(getScripts(editor), node.attr('src')); + if (!videoScript) { + continue; } - }; + } + if (videoScript) { + if (videoScript.width) { + node.attr('width', videoScript.width.toString()); + } + if (videoScript.height) { + node.attr('height', videoScript.height.toString()); + } + } + if (node.name === 'iframe' && hasLiveEmbeds(editor) && global$8.ceFalse) { + if (!isWithinEmbedWrapper(node)) { + node.replace(createPreviewIframeNode(editor, node)); + } + } else { + if (!isWithinEmbedWrapper(node)) { + node.replace(createPlaceholderNode(editor, node)); + } + } + } + }; }; var setup = function (editor) { - editor.on('preInit', function () { - var specialElements = editor.schema.getSpecialElements(); - global$1.each('video audio iframe object'.split(' '), function (name) { - specialElements[name] = new RegExp(']*>', 'gi'); - }); - var boolAttrs = editor.schema.getBoolAttrs(); - global$1.each('webkitallowfullscreen mozallowfullscreen allowfullscreen'.split(' '), function (name) { - boolAttrs[name] = {}; - }); - editor.parser.addNodeFilter('iframe,video,audio,object,embed,script', placeHolderConverter(editor)); - editor.serializer.addAttributeFilter('data-mce-object', function (nodes, name) { - var i = nodes.length; - var node; - var realElm; - var ai; - var attribs; - var innerHtml; - var innerNode; - var realElmName; - var className; - while (i--) { - node = nodes[i]; - if (!node.parent) { - continue; - } - realElmName = node.attr(name); - realElm = new global$7(realElmName, 1); - if (realElmName !== 'audio' && realElmName !== 'script') { - className = node.attr('class'); - if (className && className.indexOf('mce-preview-object') !== -1) { - realElm.attr({ - width: node.firstChild.attr('width'), - height: node.firstChild.attr('height') - }); - } else { - realElm.attr({ - width: node.attr('width'), - height: node.attr('height') - }); - } - } - realElm.attr({style: node.attr('style')}); - attribs = node.attributes; - ai = attribs.length; - while (ai--) { - var attrName = attribs[ai].name; - if (attrName.indexOf('data-mce-p-') === 0) { - realElm.attr(attrName.substr(11), attribs[ai].value); - } - } - if (realElmName === 'script') { - realElm.attr('type', 'text/javascript'); - } - innerHtml = node.attr('data-mce-html'); - if (innerHtml) { - innerNode = new global$7('#text', 3); - innerNode.raw = true; - innerNode.value = sanitize(editor, unescape(innerHtml)); - realElm.append(innerNode); - } - node.replace(realElm); - } - }); + editor.on('preInit', function () { + var specialElements = editor.schema.getSpecialElements(); + global$1.each('video audio iframe object'.split(' '), function (name) { + specialElements[name] = new RegExp(']*>', 'gi'); }); - editor.on('SetContent', function () { - editor.$('span.mce-preview-object').each(function (index, elm) { - var $elm = editor.$(elm); - if ($elm.find('span.mce-shim').length === 0) { - $elm.append(''); - } - }); + var boolAttrs = editor.schema.getBoolAttrs(); + global$1.each('webkitallowfullscreen mozallowfullscreen allowfullscreen'.split(' '), function (name) { + boolAttrs[name] = {}; }); + editor.parser.addNodeFilter('iframe,video,audio,object,embed,script', placeHolderConverter(editor)); + editor.serializer.addAttributeFilter('data-mce-object', function (nodes, name) { + var i = nodes.length; + var node; + var realElm; + var ai; + var attribs; + var innerHtml; + var innerNode; + var realElmName; + var className; + while (i--) { + node = nodes[i]; + if (!node.parent) { + continue; + } + realElmName = node.attr(name); + realElm = new global$7(realElmName, 1); + if (realElmName !== 'audio' && realElmName !== 'script') { + className = node.attr('class'); + if (className && className.indexOf('mce-preview-object') !== -1) { + realElm.attr({ + width: node.firstChild.attr('width'), + height: node.firstChild.attr('height') + }); + } else { + realElm.attr({ + width: node.attr('width'), + height: node.attr('height') + }); + } + } + realElm.attr({ style: node.attr('style') }); + attribs = node.attributes; + ai = attribs.length; + while (ai--) { + var attrName = attribs[ai].name; + if (attrName.indexOf('data-mce-p-') === 0) { + realElm.attr(attrName.substr(11), attribs[ai].value); + } + } + if (realElmName === 'script') { + realElm.attr('type', 'text/javascript'); + } + innerHtml = node.attr('data-mce-html'); + if (innerHtml) { + innerNode = new global$7('#text', 3); + innerNode.raw = true; + innerNode.value = sanitize(editor, unescape(innerHtml)); + realElm.append(innerNode); + } + node.replace(realElm); + } + }); + }); + editor.on('SetContent', function () { + editor.$('span.mce-preview-object').each(function (index, elm) { + var $elm = editor.$(elm); + if ($elm.find('span.mce-shim').length === 0) { + $elm.append(''); + } + }); + }); }; var setup$1 = function (editor) { - editor.on('ResolveName', function (e) { - var name; - if (e.target.nodeType === 1 && (name = e.target.getAttribute('data-mce-object'))) { - e.name = name; - } - }); + editor.on('ResolveName', function (e) { + var name; + if (e.target.nodeType === 1 && (name = e.target.getAttribute('data-mce-object'))) { + e.name = name; + } + }); }; var setup$2 = function (editor) { - editor.on('click keyup touchend', function () { - var selectedNode = editor.selection.getNode(); - if (selectedNode && editor.dom.hasClass(selectedNode, 'mce-preview-object')) { - if (editor.dom.getAttrib(selectedNode, 'data-mce-selected')) { - selectedNode.setAttribute('data-mce-selected', '2'); - } - } - }); - editor.on('ObjectSelected', function (e) { - var objectType = e.target.getAttribute('data-mce-object'); - if (objectType === 'audio' || objectType === 'script') { - e.preventDefault(); - } - }); - editor.on('ObjectResized', function (e) { - var target = e.target; - var html; - if (target.getAttribute('data-mce-object')) { - html = target.getAttribute('data-mce-html'); - if (html) { - html = unescape(html); - target.setAttribute('data-mce-html', escape(updateHtml(html, { - width: String(e.width), - height: String(e.height) - }))); - } - } - }); + editor.on('click keyup touchend', function () { + var selectedNode = editor.selection.getNode(); + if (selectedNode && editor.dom.hasClass(selectedNode, 'mce-preview-object')) { + if (editor.dom.getAttrib(selectedNode, 'data-mce-selected')) { + selectedNode.setAttribute('data-mce-selected', '2'); + } + } + }); + editor.on('ObjectSelected', function (e) { + var objectType = e.target.getAttribute('data-mce-object'); + if (objectType === 'audio' || objectType === 'script') { + e.preventDefault(); + } + }); + editor.on('ObjectResized', function (e) { + var target = e.target; + var html; + if (target.getAttribute('data-mce-object')) { + html = target.getAttribute('data-mce-html'); + if (html) { + html = unescape(html); + target.setAttribute('data-mce-html', escape(updateHtml(html, { + width: String(e.width), + height: String(e.height) + }))); + } + } + }); }; var stateSelectorAdapter = function (editor, selector) { - return function (buttonApi) { - return editor.selection.selectorChangedWithUnbind(selector.join(','), buttonApi.setActive).unbind; - }; + return function (buttonApi) { + return editor.selection.selectorChangedWithUnbind(selector.join(','), buttonApi.setActive).unbind; + }; }; var register$1 = function (editor) { - editor.ui.registry.addToggleButton('media', { - tooltip: 'Insert/edit media', - icon: 'embed', - onAction: function () { - editor.execCommand('mceMedia'); - }, - onSetup: stateSelectorAdapter(editor, [ - 'img[data-mce-object]', - 'span[data-mce-object]', - 'div[data-ephox-embed-iri]' - ]) - }); - editor.ui.registry.addMenuItem('media', { - icon: 'embed', - text: 'Media...', - onAction: function () { - editor.execCommand('mceMedia'); - } - }); + editor.ui.registry.addToggleButton('media', { + tooltip: 'Insert/edit media', + icon: 'embed', + onAction: function () { + editor.execCommand('mceMedia'); + }, + onSetup: stateSelectorAdapter(editor, [ + 'img[data-mce-object]', + 'span[data-mce-object]', + 'div[data-ephox-embed-iri]' + ]) + }); + editor.ui.registry.addMenuItem('media', { + icon: 'embed', + text: 'Media...', + onAction: function () { + editor.execCommand('mceMedia'); + } + }); }; - function Plugin() { - global.add('media', function (editor) { - register(editor); - register$1(editor); - setup$1(editor); - setup(editor); - setup$2(editor); - return get$1(editor); - }); + function Plugin () { + global.add('media', function (editor) { + register(editor); + register$1(editor); + setup$1(editor); + setup(editor); + setup$2(editor); + return get$1(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/nonbreaking/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/nonbreaking/plugin.js index 1ddd98ab..f010f83e 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/nonbreaking/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/nonbreaking/plugin.js @@ -12,88 +12,88 @@ var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var getKeyboardSpaces = function (editor) { - var spaces = editor.getParam('nonbreaking_force_tab', 0); - if (typeof spaces === 'boolean') { - return spaces === true ? 3 : 0; - } else { - return spaces; - } + var spaces = editor.getParam('nonbreaking_force_tab', 0); + if (typeof spaces === 'boolean') { + return spaces === true ? 3 : 0; + } else { + return spaces; + } }; var wrapNbsps = function (editor) { - return editor.getParam('nonbreaking_wrap', true, 'boolean'); + return editor.getParam('nonbreaking_wrap', true, 'boolean'); }; var stringRepeat = function (string, repeats) { - var str = ''; - for (var index = 0; index < repeats; index++) { - str += string; - } - return str; + var str = ''; + for (var index = 0; index < repeats; index++) { + str += string; + } + return str; }; var isVisualCharsEnabled = function (editor) { - return editor.plugins.visualchars ? editor.plugins.visualchars.isEnabled() : false; + return editor.plugins.visualchars ? editor.plugins.visualchars.isEnabled() : false; }; var insertNbsp = function (editor, times) { - var classes = function () { - return isVisualCharsEnabled(editor) ? 'mce-nbsp-wrap mce-nbsp' : 'mce-nbsp-wrap'; - }; - var nbspSpan = function () { - return '' + stringRepeat(' ', times) + ''; - }; - var shouldWrap = wrapNbsps(editor); - var html = shouldWrap || editor.plugins.visualchars ? nbspSpan() : stringRepeat(' ', times); - editor.undoManager.transact(function () { - return editor.insertContent(html); - }); + var classes = function () { + return isVisualCharsEnabled(editor) ? 'mce-nbsp-wrap mce-nbsp' : 'mce-nbsp-wrap'; + }; + var nbspSpan = function () { + return '' + stringRepeat(' ', times) + ''; + }; + var shouldWrap = wrapNbsps(editor); + var html = shouldWrap || editor.plugins.visualchars ? nbspSpan() : stringRepeat(' ', times); + editor.undoManager.transact(function () { + return editor.insertContent(html); + }); }; var register = function (editor) { - editor.addCommand('mceNonBreaking', function () { - insertNbsp(editor, 1); - }); + editor.addCommand('mceNonBreaking', function () { + insertNbsp(editor, 1); + }); }; var global$1 = tinymce.util.Tools.resolve('tinymce.util.VK'); var setup = function (editor) { - var spaces = getKeyboardSpaces(editor); - if (spaces > 0) { - editor.on('keydown', function (e) { - if (e.keyCode === global$1.TAB && !e.isDefaultPrevented()) { - if (e.shiftKey) { - return; - } - e.preventDefault(); - e.stopImmediatePropagation(); - insertNbsp(editor, spaces); - } - }); - } + var spaces = getKeyboardSpaces(editor); + if (spaces > 0) { + editor.on('keydown', function (e) { + if (e.keyCode === global$1.TAB && !e.isDefaultPrevented()) { + if (e.shiftKey) { + return; + } + e.preventDefault(); + e.stopImmediatePropagation(); + insertNbsp(editor, spaces); + } + }); + } }; var register$1 = function (editor) { - editor.ui.registry.addButton('nonbreaking', { - icon: 'non-breaking', - tooltip: 'Nonbreaking space', - onAction: function () { - return editor.execCommand('mceNonBreaking'); - } - }); - editor.ui.registry.addMenuItem('nonbreaking', { - icon: 'non-breaking', - text: 'Nonbreaking space', - onAction: function () { - return editor.execCommand('mceNonBreaking'); - } - }); + editor.ui.registry.addButton('nonbreaking', { + icon: 'non-breaking', + tooltip: 'Nonbreaking space', + onAction: function () { + return editor.execCommand('mceNonBreaking'); + } + }); + editor.ui.registry.addMenuItem('nonbreaking', { + icon: 'non-breaking', + text: 'Nonbreaking space', + onAction: function () { + return editor.execCommand('mceNonBreaking'); + } + }); }; - function Plugin() { - global.add('nonbreaking', function (editor) { - register(editor); - register$1(editor); - setup(editor); - }); + function Plugin () { + global.add('nonbreaking', function (editor) { + register(editor); + register$1(editor); + setup(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/noneditable/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/noneditable/plugin.js index a59d8e77..46b09868 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/noneditable/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/noneditable/plugin.js @@ -14,102 +14,102 @@ var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var getNonEditableClass = function (editor) { - return editor.getParam('noneditable_noneditable_class', 'mceNonEditable'); + return editor.getParam('noneditable_noneditable_class', 'mceNonEditable'); }; var getEditableClass = function (editor) { - return editor.getParam('noneditable_editable_class', 'mceEditable'); + return editor.getParam('noneditable_editable_class', 'mceEditable'); }; var getNonEditableRegExps = function (editor) { - var nonEditableRegExps = editor.getParam('noneditable_regexp', []); - if (nonEditableRegExps && nonEditableRegExps.constructor === RegExp) { - return [nonEditableRegExps]; - } else { - return nonEditableRegExps; - } + var nonEditableRegExps = editor.getParam('noneditable_regexp', []); + if (nonEditableRegExps && nonEditableRegExps.constructor === RegExp) { + return [nonEditableRegExps]; + } else { + return nonEditableRegExps; + } }; var hasClass = function (checkClassName) { - return function (node) { - return (' ' + node.attr('class') + ' ').indexOf(checkClassName) !== -1; - }; + return function (node) { + return (' ' + node.attr('class') + ' ').indexOf(checkClassName) !== -1; + }; }; var replaceMatchWithSpan = function (editor, content, cls) { - return function (match) { - var args = arguments, index = args[args.length - 2]; - var prevChar = index > 0 ? content.charAt(index - 1) : ''; - if (prevChar === '"') { - return match; - } - if (prevChar === '>') { - var findStartTagIndex = content.lastIndexOf('<', index); - if (findStartTagIndex !== -1) { - var tagHtml = content.substring(findStartTagIndex, index); - if (tagHtml.indexOf('contenteditable="false"') !== -1) { - return match; - } - } + return function (match) { + var args = arguments, index = args[args.length - 2]; + var prevChar = index > 0 ? content.charAt(index - 1) : ''; + if (prevChar === '"') { + return match; + } + if (prevChar === '>') { + var findStartTagIndex = content.lastIndexOf('<', index); + if (findStartTagIndex !== -1) { + var tagHtml = content.substring(findStartTagIndex, index); + if (tagHtml.indexOf('contenteditable="false"') !== -1) { + return match; } - return '' + editor.dom.encode(typeof args[1] === 'string' ? args[1] : args[0]) + ''; - }; + } + } + return '' + editor.dom.encode(typeof args[1] === 'string' ? args[1] : args[0]) + ''; + }; }; var convertRegExpsToNonEditable = function (editor, nonEditableRegExps, e) { - var i = nonEditableRegExps.length, content = e.content; - if (e.format === 'raw') { - return; - } - while (i--) { - content = content.replace(nonEditableRegExps[i], replaceMatchWithSpan(editor, content, getNonEditableClass(editor))); - } - e.content = content; + var i = nonEditableRegExps.length, content = e.content; + if (e.format === 'raw') { + return; + } + while (i--) { + content = content.replace(nonEditableRegExps[i], replaceMatchWithSpan(editor, content, getNonEditableClass(editor))); + } + e.content = content; }; var setup = function (editor) { - var contentEditableAttrName = 'contenteditable'; - var editClass = ' ' + global$1.trim(getEditableClass(editor)) + ' '; - var nonEditClass = ' ' + global$1.trim(getNonEditableClass(editor)) + ' '; - var hasEditClass = hasClass(editClass); - var hasNonEditClass = hasClass(nonEditClass); - var nonEditableRegExps = getNonEditableRegExps(editor); - editor.on('PreInit', function () { - if (nonEditableRegExps.length > 0) { - editor.on('BeforeSetContent', function (e) { - convertRegExpsToNonEditable(editor, nonEditableRegExps, e); - }); + var contentEditableAttrName = 'contenteditable'; + var editClass = ' ' + global$1.trim(getEditableClass(editor)) + ' '; + var nonEditClass = ' ' + global$1.trim(getNonEditableClass(editor)) + ' '; + var hasEditClass = hasClass(editClass); + var hasNonEditClass = hasClass(nonEditClass); + var nonEditableRegExps = getNonEditableRegExps(editor); + editor.on('PreInit', function () { + if (nonEditableRegExps.length > 0) { + editor.on('BeforeSetContent', function (e) { + convertRegExpsToNonEditable(editor, nonEditableRegExps, e); + }); + } + editor.parser.addAttributeFilter('class', function (nodes) { + var i = nodes.length, node; + while (i--) { + node = nodes[i]; + if (hasEditClass(node)) { + node.attr(contentEditableAttrName, 'true'); + } else if (hasNonEditClass(node)) { + node.attr(contentEditableAttrName, 'false'); } - editor.parser.addAttributeFilter('class', function (nodes) { - var i = nodes.length, node; - while (i--) { - node = nodes[i]; - if (hasEditClass(node)) { - node.attr(contentEditableAttrName, 'true'); - } else if (hasNonEditClass(node)) { - node.attr(contentEditableAttrName, 'false'); - } - } - }); - editor.serializer.addAttributeFilter(contentEditableAttrName, function (nodes) { - var i = nodes.length, node; - while (i--) { - node = nodes[i]; - if (!hasEditClass(node) && !hasNonEditClass(node)) { - continue; - } - if (nonEditableRegExps.length > 0 && node.attr('data-mce-content')) { - node.name = '#text'; - node.type = 3; - node.raw = true; - node.value = node.attr('data-mce-content'); - } else { - node.attr(contentEditableAttrName, null); - } - } - }); + } }); + editor.serializer.addAttributeFilter(contentEditableAttrName, function (nodes) { + var i = nodes.length, node; + while (i--) { + node = nodes[i]; + if (!hasEditClass(node) && !hasNonEditClass(node)) { + continue; + } + if (nonEditableRegExps.length > 0 && node.attr('data-mce-content')) { + node.name = '#text'; + node.type = 3; + node.raw = true; + node.value = node.attr('data-mce-content'); + } else { + node.attr(contentEditableAttrName, null); + } + } + }); + }); }; - function Plugin() { - global.add('noneditable', function (editor) { - setup(editor); - }); + function Plugin () { + global.add('noneditable', function (editor) { + setup(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/pagebreak/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/pagebreak/plugin.js index 5a940dfb..1d00fd9a 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/pagebreak/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/pagebreak/plugin.js @@ -14,92 +14,92 @@ var global$1 = tinymce.util.Tools.resolve('tinymce.Env'); var getSeparatorHtml = function (editor) { - return editor.getParam('pagebreak_separator', ''); + return editor.getParam('pagebreak_separator', ''); }; var shouldSplitBlock = function (editor) { - return editor.getParam('pagebreak_split_block', false); + return editor.getParam('pagebreak_split_block', false); }; var getPageBreakClass = function () { - return 'mce-pagebreak'; + return 'mce-pagebreak'; }; var getPlaceholderHtml = function () { - return ''; + return ''; }; var setup = function (editor) { - var separatorHtml = getSeparatorHtml(editor); - var pageBreakSeparatorRegExp = new RegExp(separatorHtml.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function (a) { - return '\\' + a; - }), 'gi'); - editor.on('BeforeSetContent', function (e) { - e.content = e.content.replace(pageBreakSeparatorRegExp, getPlaceholderHtml()); - }); - editor.on('PreInit', function () { - editor.serializer.addNodeFilter('img', function (nodes) { - var i = nodes.length, node, className; - while (i--) { - node = nodes[i]; - className = node.attr('class'); - if (className && className.indexOf('mce-pagebreak') !== -1) { - var parentNode = node.parent; - if (editor.schema.getBlockElements()[parentNode.name] && shouldSplitBlock(editor)) { - parentNode.type = 3; - parentNode.value = separatorHtml; - parentNode.raw = true; - node.remove(); - continue; - } - node.type = 3; - node.value = separatorHtml; - node.raw = true; - } - } - }); + var separatorHtml = getSeparatorHtml(editor); + var pageBreakSeparatorRegExp = new RegExp(separatorHtml.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function (a) { + return '\\' + a; + }), 'gi'); + editor.on('BeforeSetContent', function (e) { + e.content = e.content.replace(pageBreakSeparatorRegExp, getPlaceholderHtml()); + }); + editor.on('PreInit', function () { + editor.serializer.addNodeFilter('img', function (nodes) { + var i = nodes.length, node, className; + while (i--) { + node = nodes[i]; + className = node.attr('class'); + if (className && className.indexOf('mce-pagebreak') !== -1) { + var parentNode = node.parent; + if (editor.schema.getBlockElements()[parentNode.name] && shouldSplitBlock(editor)) { + parentNode.type = 3; + parentNode.value = separatorHtml; + parentNode.raw = true; + node.remove(); + continue; + } + node.type = 3; + node.value = separatorHtml; + node.raw = true; + } + } }); + }); }; var register = function (editor) { - editor.addCommand('mcePageBreak', function () { - if (shouldSplitBlock(editor)) { - editor.insertContent('

              ' + getPlaceholderHtml() + '

              '); - } else { - editor.insertContent(getPlaceholderHtml()); - } - }); + editor.addCommand('mcePageBreak', function () { + if (shouldSplitBlock(editor)) { + editor.insertContent('

              ' + getPlaceholderHtml() + '

              '); + } else { + editor.insertContent(getPlaceholderHtml()); + } + }); }; var setup$1 = function (editor) { - editor.on('ResolveName', function (e) { - if (e.target.nodeName === 'IMG' && editor.dom.hasClass(e.target, getPageBreakClass())) { - e.name = 'pagebreak'; - } - }); + editor.on('ResolveName', function (e) { + if (e.target.nodeName === 'IMG' && editor.dom.hasClass(e.target, getPageBreakClass())) { + e.name = 'pagebreak'; + } + }); }; var register$1 = function (editor) { - editor.ui.registry.addButton('pagebreak', { - icon: 'page-break', - tooltip: 'Page break', - onAction: function () { - return editor.execCommand('mcePageBreak'); - } - }); - editor.ui.registry.addMenuItem('pagebreak', { - text: 'Page break', - icon: 'page-break', - onAction: function () { - return editor.execCommand('mcePageBreak'); - } - }); + editor.ui.registry.addButton('pagebreak', { + icon: 'page-break', + tooltip: 'Page break', + onAction: function () { + return editor.execCommand('mcePageBreak'); + } + }); + editor.ui.registry.addMenuItem('pagebreak', { + text: 'Page break', + icon: 'page-break', + onAction: function () { + return editor.execCommand('mcePageBreak'); + } + }); }; - function Plugin() { - global.add('pagebreak', function (editor) { - register(editor); - register$1(editor); - setup(editor); - setup$1(editor); - }); + function Plugin () { + global.add('pagebreak', function (editor) { + register(editor); + register$1(editor); + setup(editor); + setup$1(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/paste/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/paste/plugin.js index 2fc0136a..4aaccd32 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/paste/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/paste/plugin.js @@ -10,246 +10,246 @@ 'use strict'; var Cell = function (initial) { - var value = initial; - var get = function () { - return value; - }; - var set = function (v) { - value = v; - }; - return { - get: get, - set: set - }; + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; }; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var hasProPlugin = function (editor) { - if (editor.hasPlugin('powerpaste', true)) { - if (typeof window.console !== 'undefined' && window.console.log) { - window.console.log('PowerPaste is incompatible with Paste plugin! Remove \'paste\' from the \'plugins\' option.'); - } - return true; - } else { - return false; + if (editor.hasPlugin('powerpaste', true)) { + if (typeof window.console !== 'undefined' && window.console.log) { + window.console.log('PowerPaste is incompatible with Paste plugin! Remove \'paste\' from the \'plugins\' option.'); } + return true; + } else { + return false; + } }; var get = function (clipboard, quirks) { - return { - clipboard: clipboard, - quirks: quirks - }; + return { + clipboard: clipboard, + quirks: quirks + }; }; var noop = function () { }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; var never = constant(false); var always = constant(true); var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var isSimpleType = function (type) { - return function (value) { - return typeof value === type; - }; + return function (value) { + return typeof value === type; + }; }; var isNullable = function (a) { - return a === null || a === undefined; + return a === null || a === undefined; }; var isNonNullable = function (a) { - return !isNullable(a); + return !isNullable(a); }; var isFunction = isSimpleType('function'); var nativeSlice = Array.prototype.slice; var exists = function (xs, pred) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - return true; - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return true; } - return false; + } + return false; }; var map = function (xs, f) { - var len = xs.length; - var r = new Array(len); - for (var i = 0; i < len; i++) { - var x = xs[i]; - r[i] = f(x, i); - } - return r; + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; }; var each = function (xs, f) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - f(x, i); - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } }; var filter = function (xs, pred) { - var r = []; - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - r.push(x); - } + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); } - return r; + } + return r; }; var foldl = function (xs, f, acc) { - each(xs, function (x) { - acc = f(acc, x); - }); - return acc; + each(xs, function (x) { + acc = f(acc, x); + }); + return acc; }; var from$1 = isFunction(Array.from) ? Array.from : function (x) { - return nativeSlice.call(x); + return nativeSlice.call(x); }; var value = function () { - var subject = Cell(Optional.none()); - var clear = function () { - return subject.set(Optional.none()); - }; - var set = function (s) { - return subject.set(Optional.some(s)); - }; - var isSet = function () { - return subject.get().isSome(); - }; - var on = function (f) { - return subject.get().each(f); - }; - return { - clear: clear, - set: set, - isSet: isSet, - on: on - }; + var subject = Cell(Optional.none()); + var clear = function () { + return subject.set(Optional.none()); + }; + var set = function (s) { + return subject.set(Optional.some(s)); + }; + var isSet = function () { + return subject.get().isSome(); + }; + var on = function (f) { + return subject.get().each(f); + }; + return { + clear: clear, + set: set, + isSet: isSet, + on: on + }; }; var checkRange = function (str, substr, start) { - return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr; + return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr; }; var startsWith = function (str, prefix) { - return checkRange(str, prefix, 0); + return checkRange(str, prefix, 0); }; var endsWith = function (str, suffix) { - return checkRange(str, suffix, str.length - suffix.length); + return checkRange(str, suffix, str.length - suffix.length); }; var repeat = function (s, count) { - return count <= 0 ? '' : new Array(count + 1).join(s); + return count <= 0 ? '' : new Array(count + 1).join(s); }; var global$1 = tinymce.util.Tools.resolve('tinymce.Env'); @@ -261,153 +261,153 @@ var global$4 = tinymce.util.Tools.resolve('tinymce.util.VK'); var firePastePreProcess = function (editor, html, internal, isWordHtml) { - return editor.fire('PastePreProcess', { - content: html, - internal: internal, - wordContent: isWordHtml - }); + return editor.fire('PastePreProcess', { + content: html, + internal: internal, + wordContent: isWordHtml + }); }; var firePastePostProcess = function (editor, node, internal, isWordHtml) { - return editor.fire('PastePostProcess', { - node: node, - internal: internal, - wordContent: isWordHtml - }); + return editor.fire('PastePostProcess', { + node: node, + internal: internal, + wordContent: isWordHtml + }); }; var firePastePlainTextToggle = function (editor, state) { - return editor.fire('PastePlainTextToggle', {state: state}); + return editor.fire('PastePlainTextToggle', { state: state }); }; var firePaste = function (editor, ieFake) { - return editor.fire('paste', {ieFake: ieFake}); + return editor.fire('paste', { ieFake: ieFake }); }; var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var shouldBlockDrop = function (editor) { - return editor.getParam('paste_block_drop', false); + return editor.getParam('paste_block_drop', false); }; var shouldPasteDataImages = function (editor) { - return editor.getParam('paste_data_images', false); + return editor.getParam('paste_data_images', false); }; var shouldFilterDrop = function (editor) { - return editor.getParam('paste_filter_drop', true); + return editor.getParam('paste_filter_drop', true); }; var getPreProcess = function (editor) { - return editor.getParam('paste_preprocess'); + return editor.getParam('paste_preprocess'); }; var getPostProcess = function (editor) { - return editor.getParam('paste_postprocess'); + return editor.getParam('paste_postprocess'); }; var getWebkitStyles = function (editor) { - return editor.getParam('paste_webkit_styles'); + return editor.getParam('paste_webkit_styles'); }; var shouldRemoveWebKitStyles = function (editor) { - return editor.getParam('paste_remove_styles_if_webkit', true); + return editor.getParam('paste_remove_styles_if_webkit', true); }; var shouldMergeFormats = function (editor) { - return editor.getParam('paste_merge_formats', true); + return editor.getParam('paste_merge_formats', true); }; var isSmartPasteEnabled = function (editor) { - return editor.getParam('smart_paste', true); + return editor.getParam('smart_paste', true); }; var isPasteAsTextEnabled = function (editor) { - return editor.getParam('paste_as_text', false); + return editor.getParam('paste_as_text', false); }; var getRetainStyleProps = function (editor) { - return editor.getParam('paste_retain_style_properties'); + return editor.getParam('paste_retain_style_properties'); }; var getWordValidElements = function (editor) { - var defaultValidElements = '-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,' + '-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,' + 'td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody'; - return editor.getParam('paste_word_valid_elements', defaultValidElements); + var defaultValidElements = '-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,' + '-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,' + 'td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody'; + return editor.getParam('paste_word_valid_elements', defaultValidElements); }; var shouldConvertWordFakeLists = function (editor) { - return editor.getParam('paste_convert_word_fake_lists', true); + return editor.getParam('paste_convert_word_fake_lists', true); }; var shouldUseDefaultFilters = function (editor) { - return editor.getParam('paste_enable_default_filters', true); + return editor.getParam('paste_enable_default_filters', true); }; var getValidate = function (editor) { - return editor.getParam('validate'); + return editor.getParam('validate'); }; var getAllowHtmlDataUrls = function (editor) { - return editor.getParam('allow_html_data_urls', false, 'boolean'); + return editor.getParam('allow_html_data_urls', false, 'boolean'); }; var getPasteDataImages = function (editor) { - return editor.getParam('paste_data_images', false, 'boolean'); + return editor.getParam('paste_data_images', false, 'boolean'); }; var getImagesDataImgFilter = function (editor) { - return editor.getParam('images_dataimg_filter'); + return editor.getParam('images_dataimg_filter'); }; var getImagesReuseFilename = function (editor) { - return editor.getParam('images_reuse_filename'); + return editor.getParam('images_reuse_filename'); }; var getForcedRootBlock = function (editor) { - return editor.getParam('forced_root_block'); + return editor.getParam('forced_root_block'); }; var getForcedRootBlockAttrs = function (editor) { - return editor.getParam('forced_root_block_attrs'); + return editor.getParam('forced_root_block_attrs'); }; var getTabSpaces = function (editor) { - return editor.getParam('paste_tab_spaces', 4, 'number'); + return editor.getParam('paste_tab_spaces', 4, 'number'); }; var getAllowedImageFileTypes = function (editor) { - var defaultImageFileTypes = 'jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp'; - return global$5.explode(editor.getParam('images_file_types', defaultImageFileTypes, 'string')); + var defaultImageFileTypes = 'jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp'; + return global$5.explode(editor.getParam('images_file_types', defaultImageFileTypes, 'string')); }; var internalMimeType = 'x-tinymce/html'; var internalMark = ''; var mark = function (html) { - return internalMark + html; + return internalMark + html; }; var unmark = function (html) { - return html.replace(internalMark, ''); + return html.replace(internalMark, ''); }; var isMarked = function (html) { - return html.indexOf(internalMark) !== -1; + return html.indexOf(internalMark) !== -1; }; var internalHtmlMime = function () { - return internalMimeType; + return internalMimeType; }; var global$6 = tinymce.util.Tools.resolve('tinymce.html.Entities'); var isPlainText = function (text) { - return !/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(text); + return !/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(text); }; var toBRs = function (text) { - return text.replace(/\r?\n/g, '
              '); + return text.replace(/\r?\n/g, '
              '); }; var openContainer = function (rootTag, rootAttrs) { - var key; - var attrs = []; - var tag = '<' + rootTag; - if (typeof rootAttrs === 'object') { - for (key in rootAttrs) { - if (rootAttrs.hasOwnProperty(key)) { - attrs.push(key + '="' + global$6.encodeAllRaw(rootAttrs[key]) + '"'); - } - } - if (attrs.length) { - tag += ' ' + attrs.join(' '); - } + var key; + var attrs = []; + var tag = '<' + rootTag; + if (typeof rootAttrs === 'object') { + for (key in rootAttrs) { + if (rootAttrs.hasOwnProperty(key)) { + attrs.push(key + '="' + global$6.encodeAllRaw(rootAttrs[key]) + '"'); + } + } + if (attrs.length) { + tag += ' ' + attrs.join(' '); } - return tag + '>'; + } + return tag + '>'; }; var toBlockElements = function (text, rootTag, rootAttrs) { - var blocks = text.split(/\n\n/); - var tagOpen = openContainer(rootTag, rootAttrs); - var tagClose = ''; - var paragraphs = global$5.map(blocks, function (p) { - return p.split(/\n/).join('
              '); - }); - var stitch = function (p) { - return tagOpen + p + tagClose; - }; - return paragraphs.length === 1 ? paragraphs[0] : global$5.map(paragraphs, stitch).join(''); + var blocks = text.split(/\n\n/); + var tagOpen = openContainer(rootTag, rootAttrs); + var tagClose = ''; + var paragraphs = global$5.map(blocks, function (p) { + return p.split(/\n/).join('
              '); + }); + var stitch = function (p) { + return tagOpen + p + tagClose; + }; + return paragraphs.length === 1 ? paragraphs[0] : global$5.map(paragraphs, stitch).join(''); }; var convert = function (text, rootTag, rootAttrs) { - return rootTag ? toBlockElements(text, rootTag === true ? 'p' : rootTag, rootAttrs) : toBRs(text); + return rootTag ? toBlockElements(text, rootTag === true ? 'p' : rootTag, rootAttrs) : toBRs(text); }; var global$7 = tinymce.util.Tools.resolve('tinymce.html.DomParser'); @@ -421,1367 +421,1342 @@ var global$a = tinymce.util.Tools.resolve('tinymce.html.Schema'); function filter$1(content, items) { - global$5.each(items, function (v) { - if (v.constructor === RegExp) { - content = content.replace(v, ''); - } else { - content = content.replace(v[0], v[1]); - } - }); - return content; + global$5.each(items, function (v) { + if (v.constructor === RegExp) { + content = content.replace(v, ''); + } else { + content = content.replace(v[0], v[1]); + } + }); + return content; } - function innerText(html) { - var schema = global$a(); - var domParser = global$7({}, schema); - var text = ''; - var shortEndedElements = schema.getShortEndedElements(); - var ignoreElements = global$5.makeMap('script noscript style textarea video audio iframe object', ' '); - var blockElements = schema.getBlockElements(); - - function walk(node) { - var name = node.name, currentNode = node; - if (name === 'br') { - text += '\n'; - return; - } - if (name === 'wbr') { - return; - } - if (shortEndedElements[name]) { - text += ' '; - } - if (ignoreElements[name]) { - text += ' '; - return; - } - if (node.type === 3) { - text += node.value; - } - if (!node.shortEnded) { - if (node = node.firstChild) { - do { - walk(node); - } while (node = node.next); - } - } - if (blockElements[name] && currentNode.next) { - text += '\n'; - if (name === 'p') { - text += '\n'; - } - } + var schema = global$a(); + var domParser = global$7({}, schema); + var text = ''; + var shortEndedElements = schema.getShortEndedElements(); + var ignoreElements = global$5.makeMap('script noscript style textarea video audio iframe object', ' '); + var blockElements = schema.getBlockElements(); + function walk(node) { + var name = node.name, currentNode = node; + if (name === 'br') { + text += '\n'; + return; } - - html = filter$1(html, [//g]); - walk(domParser.parse(html)); - return text; + if (name === 'wbr') { + return; + } + if (shortEndedElements[name]) { + text += ' '; + } + if (ignoreElements[name]) { + text += ' '; + return; + } + if (node.type === 3) { + text += node.value; + } + if (!node.shortEnded) { + if (node = node.firstChild) { + do { + walk(node); + } while (node = node.next); + } + } + if (blockElements[name] && currentNode.next) { + text += '\n'; + if (name === 'p') { + text += '\n'; + } + } + } + html = filter$1(html, [//g]); + walk(domParser.parse(html)); + return text; } - function trimHtml(html) { - function trimSpaces(all, s1, s2) { - if (!s1 && !s2) { - return ' '; - } - return nbsp; + function trimSpaces(all, s1, s2) { + if (!s1 && !s2) { + return ' '; } - - html = filter$1(html, [ - /^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/ig, - /|/g, - [ - /( ?)\u00a0<\/span>( ?)/g, - trimSpaces - ], - /
              /g, - /
              $/i - ]); - return html; + return nbsp; + } + html = filter$1(html, [ + /^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/ig, + /|/g, + [ + /( ?)\u00a0<\/span>( ?)/g, + trimSpaces + ], + /
              /g, + /
              $/i + ]); + return html; } - function createIdGenerator(prefix) { - var count = 0; - return function () { - return prefix + count++; - }; + var count = 0; + return function () { + return prefix + count++; + }; } - var getImageMimeType = function (ext) { - var mimeOverrides = { - jpg: 'jpeg', - jpe: 'jpeg', - jfi: 'jpeg', - jif: 'jpeg', - jfif: 'jpeg', - pjpeg: 'jpeg', - pjp: 'jpeg', - svg: 'svg+xml' - }; - return global$5.hasOwn(mimeOverrides, ext) ? 'image/' + mimeOverrides[ext] : 'image/' + ext; + var mimeOverrides = { + jpg: 'jpeg', + jpe: 'jpeg', + jfi: 'jpeg', + jif: 'jpeg', + jfif: 'jpeg', + pjpeg: 'jpeg', + pjp: 'jpeg', + svg: 'svg+xml' + }; + return global$5.hasOwn(mimeOverrides, ext) ? 'image/' + mimeOverrides[ext] : 'image/' + ext; }; function isWordContent(content) { - return / 1) { - currentListNode.attr('start', '' + start); - } - paragraphNode.wrap(currentListNode); - } else { - currentListNode.append(paragraphNode); - } - paragraphNode.name = 'li'; - if (level > lastLevel && prevListNode) { - prevListNode.lastChild.append(currentListNode); + if (node = node.firstChild) { + do { + if (!trimListStart(node, regExp)) { + return false; } - lastLevel = level; - removeIgnoredNodes(paragraphNode); - trimListStart(paragraphNode, /^\u00a0+/); - trimListStart(paragraphNode, /^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/); - trimListStart(paragraphNode, /^\u00a0+/); + } while (node = node.next); } - - var elements = []; - var child = node.firstChild; - while (typeof child !== 'undefined' && child !== null) { - elements.push(child); + return true; + } + function removeIgnoredNodes(node) { + if (node._listIgnore) { + node.remove(); + return; + } + if (node = node.firstChild) { + do { + removeIgnoredNodes(node); + } while (node = node.next); + } + } + function convertParagraphToLi(paragraphNode, listName, start) { + var level = paragraphNode._listLevel || lastLevel; + if (level !== lastLevel) { + if (level < lastLevel) { + if (currentListNode) { + currentListNode = currentListNode.parent.parent; + } + } else { + prevListNode = currentListNode; + currentListNode = null; + } + } + if (!currentListNode || currentListNode.name !== listName) { + prevListNode = prevListNode || currentListNode; + currentListNode = new global$9(listName, 1); + if (start > 1) { + currentListNode.attr('start', '' + start); + } + paragraphNode.wrap(currentListNode); + } else { + currentListNode.append(paragraphNode); + } + paragraphNode.name = 'li'; + if (level > lastLevel && prevListNode) { + prevListNode.lastChild.append(currentListNode); + } + lastLevel = level; + removeIgnoredNodes(paragraphNode); + trimListStart(paragraphNode, /^\u00a0+/); + trimListStart(paragraphNode, /^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/); + trimListStart(paragraphNode, /^\u00a0+/); + } + var elements = []; + var child = node.firstChild; + while (typeof child !== 'undefined' && child !== null) { + elements.push(child); + child = child.walk(); + if (child !== null) { + while (typeof child !== 'undefined' && child.parent !== node) { child = child.walk(); - if (child !== null) { - while (typeof child !== 'undefined' && child.parent !== node) { - child = child.walk(); - } - } + } } - for (var i = 0; i < elements.length; i++) { - node = elements[i]; - if (node.name === 'p' && node.firstChild) { - var nodeText = getText(node); - if (isBulletList(nodeText)) { - convertParagraphToLi(node, 'ul'); - continue; - } - if (isNumericList(nodeText)) { - var matches = /([0-9]+)\./.exec(nodeText); - var start = 1; - if (matches) { - start = parseInt(matches[1], 10); - } - convertParagraphToLi(node, 'ol', start); - continue; - } - if (node._listLevel) { - convertParagraphToLi(node, 'ul', 1); - continue; - } - currentListNode = null; - } else { - prevListNode = currentListNode; - currentListNode = null; - } + } + for (var i = 0; i < elements.length; i++) { + node = elements[i]; + if (node.name === 'p' && node.firstChild) { + var nodeText = getText(node); + if (isBulletList(nodeText)) { + convertParagraphToLi(node, 'ul'); + continue; + } + if (isNumericList(nodeText)) { + var matches = /([0-9]+)\./.exec(nodeText); + var start = 1; + if (matches) { + start = parseInt(matches[1], 10); + } + convertParagraphToLi(node, 'ol', start); + continue; + } + if (node._listLevel) { + convertParagraphToLi(node, 'ul', 1); + continue; + } + currentListNode = null; + } else { + prevListNode = currentListNode; + currentListNode = null; } + } } - function filterStyles(editor, validStyles, node, styleValue) { - var outputStyles = {}, matches; - var styles = editor.dom.parseStyle(styleValue); - global$5.each(styles, function (value, name) { - switch (name) { - case 'mso-list': - matches = /\w+ \w+([0-9]+)/i.exec(styleValue); - if (matches) { - node._listLevel = parseInt(matches[1], 10); - } - if (/Ignore/i.test(value) && node.firstChild) { - node._listIgnore = true; - node.firstChild._listIgnore = true; - } - break; - case 'horiz-align': - name = 'text-align'; - break; - case 'vert-align': - name = 'vertical-align'; - break; - case 'font-color': - case 'mso-foreground': - name = 'color'; - break; - case 'mso-background': - case 'mso-highlight': - name = 'background'; - break; - case 'font-weight': - case 'font-style': - if (value !== 'normal') { - outputStyles[name] = value; - } - return; - case 'mso-element': - if (/^(comment|comment-list)$/i.test(value)) { - node.remove(); - return; - } - break; - } - if (name.indexOf('mso-comment') === 0) { - node.remove(); - return; - } - if (name.indexOf('mso-') === 0) { - return; - } - if (getRetainStyleProps(editor) === 'all' || validStyles && validStyles[name]) { - outputStyles[name] = value; - } - }); - if (/(bold)/i.test(outputStyles['font-weight'])) { - delete outputStyles['font-weight']; - node.wrap(new global$9('b', 1)); + var outputStyles = {}, matches; + var styles = editor.dom.parseStyle(styleValue); + global$5.each(styles, function (value, name) { + switch (name) { + case 'mso-list': + matches = /\w+ \w+([0-9]+)/i.exec(styleValue); + if (matches) { + node._listLevel = parseInt(matches[1], 10); + } + if (/Ignore/i.test(value) && node.firstChild) { + node._listIgnore = true; + node.firstChild._listIgnore = true; + } + break; + case 'horiz-align': + name = 'text-align'; + break; + case 'vert-align': + name = 'vertical-align'; + break; + case 'font-color': + case 'mso-foreground': + name = 'color'; + break; + case 'mso-background': + case 'mso-highlight': + name = 'background'; + break; + case 'font-weight': + case 'font-style': + if (value !== 'normal') { + outputStyles[name] = value; + } + return; + case 'mso-element': + if (/^(comment|comment-list)$/i.test(value)) { + node.remove(); + return; + } + break; } - if (/(italic)/i.test(outputStyles['font-style'])) { - delete outputStyles['font-style']; - node.wrap(new global$9('i', 1)); + if (name.indexOf('mso-comment') === 0) { + node.remove(); + return; } - outputStyles = editor.dom.serializeStyle(outputStyles, node.name); - if (outputStyles) { - return outputStyles; + if (name.indexOf('mso-') === 0) { + return; } - return null; + if (getRetainStyleProps(editor) === 'all' || validStyles && validStyles[name]) { + outputStyles[name] = value; + } + }); + if (/(bold)/i.test(outputStyles['font-weight'])) { + delete outputStyles['font-weight']; + node.wrap(new global$9('b', 1)); + } + if (/(italic)/i.test(outputStyles['font-style'])) { + delete outputStyles['font-style']; + node.wrap(new global$9('i', 1)); + } + outputStyles = editor.dom.serializeStyle(outputStyles, node.name); + if (outputStyles) { + return outputStyles; + } + return null; } - var filterWordContent = function (editor, content) { - var validStyles; - var retainStyleProperties = getRetainStyleProps(editor); - if (retainStyleProperties) { - validStyles = global$5.makeMap(retainStyleProperties.split(/[, ]/)); - } - content = filter$1(content, [ - /
              /gi, - /]+id="?docs-internal-[^>]*>/gi, - //gi, - /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi, - [ - /<(\/?)s>/gi, - '<$1strike>' - ], - [ - / /gi, - nbsp - ], - [ - /([\s\u00a0]*)<\/span>/gi, - function (str, spaces) { - return spaces.length > 0 ? spaces.replace(/./, ' ').slice(Math.floor(spaces.length / 2)).split('').join(nbsp) : ''; - } - ] - ]); - var validElements = getWordValidElements(editor); - var schema = global$a({ - valid_elements: validElements, - valid_children: '-li[p]' - }); - global$5.each(schema.elements, function (rule) { - if (!rule.attributes.class) { - rule.attributes.class = {}; - rule.attributesOrder.push('class'); - } - if (!rule.attributes.style) { - rule.attributes.style = {}; - rule.attributesOrder.push('style'); - } - }); - var domParser = global$7({}, schema); - domParser.addAttributeFilter('style', function (nodes) { - var i = nodes.length, node; - while (i--) { - node = nodes[i]; - node.attr('style', filterStyles(editor, validStyles, node, node.attr('style'))); - if (node.name === 'span' && node.parent && !node.attributes.length) { - node.unwrap(); - } - } - }); - domParser.addAttributeFilter('class', function (nodes) { - var i = nodes.length, node, className; - while (i--) { - node = nodes[i]; - className = node.attr('class'); - if (/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(className)) { - node.remove(); - } - node.attr('class', null); - } - }); - domParser.addNodeFilter('del', function (nodes) { - var i = nodes.length; - while (i--) { - nodes[i].remove(); - } - }); - domParser.addNodeFilter('a', function (nodes) { - var i = nodes.length, node, href, name; - while (i--) { - node = nodes[i]; - href = node.attr('href'); - name = node.attr('name'); - if (href && href.indexOf('#_msocom_') !== -1) { - node.remove(); - continue; - } - if (href && href.indexOf('file://') === 0) { - href = href.split('#')[1]; - if (href) { - href = '#' + href; - } - } - if (!href && !name) { - node.unwrap(); - } else { - if (name && !/^_?(?:toc|edn|ftn)/i.test(name)) { - node.unwrap(); - continue; - } - node.attr({ - href: href, - name: name - }); - } - } - }); - var rootNode = domParser.parse(content); - if (shouldConvertWordFakeLists(editor)) { - convertFakeListsToProperLists(rootNode); + var validStyles; + var retainStyleProperties = getRetainStyleProps(editor); + if (retainStyleProperties) { + validStyles = global$5.makeMap(retainStyleProperties.split(/[, ]/)); + } + content = filter$1(content, [ + /
              /gi, + /]+id="?docs-internal-[^>]*>/gi, + //gi, + /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi, + [ + /<(\/?)s>/gi, + '<$1strike>' + ], + [ + / /gi, + nbsp + ], + [ + /([\s\u00a0]*)<\/span>/gi, + function (str, spaces) { + return spaces.length > 0 ? spaces.replace(/./, ' ').slice(Math.floor(spaces.length / 2)).split('').join(nbsp) : ''; + } + ] + ]); + var validElements = getWordValidElements(editor); + var schema = global$a({ + valid_elements: validElements, + valid_children: '-li[p]' + }); + global$5.each(schema.elements, function (rule) { + if (!rule.attributes.class) { + rule.attributes.class = {}; + rule.attributesOrder.push('class'); } - content = global$8({validate: getValidate(editor)}, schema).serialize(rootNode); - return content; + if (!rule.attributes.style) { + rule.attributes.style = {}; + rule.attributesOrder.push('style'); + } + }); + var domParser = global$7({}, schema); + domParser.addAttributeFilter('style', function (nodes) { + var i = nodes.length, node; + while (i--) { + node = nodes[i]; + node.attr('style', filterStyles(editor, validStyles, node, node.attr('style'))); + if (node.name === 'span' && node.parent && !node.attributes.length) { + node.unwrap(); + } + } + }); + domParser.addAttributeFilter('class', function (nodes) { + var i = nodes.length, node, className; + while (i--) { + node = nodes[i]; + className = node.attr('class'); + if (/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(className)) { + node.remove(); + } + node.attr('class', null); + } + }); + domParser.addNodeFilter('del', function (nodes) { + var i = nodes.length; + while (i--) { + nodes[i].remove(); + } + }); + domParser.addNodeFilter('a', function (nodes) { + var i = nodes.length, node, href, name; + while (i--) { + node = nodes[i]; + href = node.attr('href'); + name = node.attr('name'); + if (href && href.indexOf('#_msocom_') !== -1) { + node.remove(); + continue; + } + if (href && href.indexOf('file://') === 0) { + href = href.split('#')[1]; + if (href) { + href = '#' + href; + } + } + if (!href && !name) { + node.unwrap(); + } else { + if (name && !/^_?(?:toc|edn|ftn)/i.test(name)) { + node.unwrap(); + continue; + } + node.attr({ + href: href, + name: name + }); + } + } + }); + var rootNode = domParser.parse(content); + if (shouldConvertWordFakeLists(editor)) { + convertFakeListsToProperLists(rootNode); + } + content = global$8({ validate: getValidate(editor) }, schema).serialize(rootNode); + return content; }; var preProcess = function (editor, content) { - return shouldUseDefaultFilters(editor) ? filterWordContent(editor, content) : content; + return shouldUseDefaultFilters(editor) ? filterWordContent(editor, content) : content; }; var preProcess$1 = function (editor, html) { - var parser = global$7({}, editor.schema); - parser.addNodeFilter('meta', function (nodes) { - global$5.each(nodes, function (node) { - node.remove(); - }); + var parser = global$7({}, editor.schema); + parser.addNodeFilter('meta', function (nodes) { + global$5.each(nodes, function (node) { + node.remove(); }); - var fragment = parser.parse(html, { - forced_root_block: false, - isRootContent: true - }); - return global$8({validate: getValidate(editor)}, editor.schema).serialize(fragment); + }); + var fragment = parser.parse(html, { + forced_root_block: false, + isRootContent: true + }); + return global$8({ validate: getValidate(editor) }, editor.schema).serialize(fragment); }; var processResult = function (content, cancelled) { - return { - content: content, - cancelled: cancelled - }; + return { + content: content, + cancelled: cancelled + }; }; var postProcessFilter = function (editor, html, internal, isWordHtml) { - var tempBody = editor.dom.create('div', {style: 'display:none'}, html); - var postProcessArgs = firePastePostProcess(editor, tempBody, internal, isWordHtml); - return processResult(postProcessArgs.node.innerHTML, postProcessArgs.isDefaultPrevented()); + var tempBody = editor.dom.create('div', { style: 'display:none' }, html); + var postProcessArgs = firePastePostProcess(editor, tempBody, internal, isWordHtml); + return processResult(postProcessArgs.node.innerHTML, postProcessArgs.isDefaultPrevented()); }; var filterContent = function (editor, content, internal, isWordHtml) { - var preProcessArgs = firePastePreProcess(editor, content, internal, isWordHtml); - var filteredContent = preProcess$1(editor, preProcessArgs.content); - if (editor.hasEventListeners('PastePostProcess') && !preProcessArgs.isDefaultPrevented()) { - return postProcessFilter(editor, filteredContent, internal, isWordHtml); - } else { - return processResult(filteredContent, preProcessArgs.isDefaultPrevented()); - } + var preProcessArgs = firePastePreProcess(editor, content, internal, isWordHtml); + var filteredContent = preProcess$1(editor, preProcessArgs.content); + if (editor.hasEventListeners('PastePostProcess') && !preProcessArgs.isDefaultPrevented()) { + return postProcessFilter(editor, filteredContent, internal, isWordHtml); + } else { + return processResult(filteredContent, preProcessArgs.isDefaultPrevented()); + } }; var process = function (editor, html, internal) { - var isWordHtml = isWordContent(html); - var content = isWordHtml ? preProcess(editor, html) : html; - return filterContent(editor, content, internal, isWordHtml); + var isWordHtml = isWordContent(html); + var content = isWordHtml ? preProcess(editor, html) : html; + return filterContent(editor, content, internal, isWordHtml); }; var pasteHtml = function (editor, html) { - editor.insertContent(html, { - merge: shouldMergeFormats(editor), - paste: true - }); - return true; + editor.insertContent(html, { + merge: shouldMergeFormats(editor), + paste: true + }); + return true; }; var isAbsoluteUrl = function (url) { - return /^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(url); + return /^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(url); }; var isImageUrl = function (editor, url) { - return isAbsoluteUrl(url) && exists(getAllowedImageFileTypes(editor), function (type) { - return endsWith(url, '.' + type); - }); + return isAbsoluteUrl(url) && exists(getAllowedImageFileTypes(editor), function (type) { + return endsWith(url, '.' + type); + }); }; var createImage = function (editor, url, pasteHtmlFn) { - editor.undoManager.extra(function () { - pasteHtmlFn(editor, url); - }, function () { - editor.insertContent(''); - }); - return true; + editor.undoManager.extra(function () { + pasteHtmlFn(editor, url); + }, function () { + editor.insertContent(''); + }); + return true; }; var createLink = function (editor, url, pasteHtmlFn) { - editor.undoManager.extra(function () { - pasteHtmlFn(editor, url); - }, function () { - editor.execCommand('mceInsertLink', false, url); - }); - return true; + editor.undoManager.extra(function () { + pasteHtmlFn(editor, url); + }, function () { + editor.execCommand('mceInsertLink', false, url); + }); + return true; }; var linkSelection = function (editor, html, pasteHtmlFn) { - return editor.selection.isCollapsed() === false && isAbsoluteUrl(html) ? createLink(editor, html, pasteHtmlFn) : false; + return editor.selection.isCollapsed() === false && isAbsoluteUrl(html) ? createLink(editor, html, pasteHtmlFn) : false; }; var insertImage = function (editor, html, pasteHtmlFn) { - return isImageUrl(editor, html) ? createImage(editor, html, pasteHtmlFn) : false; + return isImageUrl(editor, html) ? createImage(editor, html, pasteHtmlFn) : false; }; var smartInsertContent = function (editor, html) { - global$5.each([ - linkSelection, - insertImage, - pasteHtml - ], function (action) { - return action(editor, html, pasteHtml) !== true; - }); + global$5.each([ + linkSelection, + insertImage, + pasteHtml + ], function (action) { + return action(editor, html, pasteHtml) !== true; + }); }; var insertContent = function (editor, html, pasteAsText) { - if (pasteAsText || isSmartPasteEnabled(editor) === false) { - pasteHtml(editor, html); - } else { - smartInsertContent(editor, html); - } + if (pasteAsText || isSmartPasteEnabled(editor) === false) { + pasteHtml(editor, html); + } else { + smartInsertContent(editor, html); + } }; var isCollapsibleWhitespace = function (c) { - return ' \f\t\x0B'.indexOf(c) !== -1; + return ' \f\t\x0B'.indexOf(c) !== -1; }; var isNewLineChar = function (c) { - return c === '\n' || c === '\r'; + return c === '\n' || c === '\r'; }; var isNewline = function (text, idx) { - return idx < text.length && idx >= 0 ? isNewLineChar(text[idx]) : false; + return idx < text.length && idx >= 0 ? isNewLineChar(text[idx]) : false; }; var normalizeWhitespace = function (editor, text) { - var tabSpace = repeat(' ', getTabSpaces(editor)); - var normalizedText = text.replace(/\t/g, tabSpace); - var result = foldl(normalizedText, function (acc, c) { - if (isCollapsibleWhitespace(c) || c === nbsp) { - if (acc.pcIsSpace || acc.str === '' || acc.str.length === normalizedText.length - 1 || isNewline(normalizedText, acc.str.length + 1)) { - return { - pcIsSpace: false, - str: acc.str + nbsp - }; - } else { - return { - pcIsSpace: true, - str: acc.str + ' ' - }; - } - } else { - return { - pcIsSpace: isNewLineChar(c), - str: acc.str + c - }; - } - }, { - pcIsSpace: false, - str: '' - }); - return result.str; + var tabSpace = repeat(' ', getTabSpaces(editor)); + var normalizedText = text.replace(/\t/g, tabSpace); + var result = foldl(normalizedText, function (acc, c) { + if (isCollapsibleWhitespace(c) || c === nbsp) { + if (acc.pcIsSpace || acc.str === '' || acc.str.length === normalizedText.length - 1 || isNewline(normalizedText, acc.str.length + 1)) { + return { + pcIsSpace: false, + str: acc.str + nbsp + }; + } else { + return { + pcIsSpace: true, + str: acc.str + ' ' + }; + } + } else { + return { + pcIsSpace: isNewLineChar(c), + str: acc.str + c + }; + } + }, { + pcIsSpace: false, + str: '' + }); + return result.str; }; var doPaste = function (editor, content, internal, pasteAsText) { - var args = process(editor, content, internal); - if (args.cancelled === false) { - insertContent(editor, args.content, pasteAsText); - } + var args = process(editor, content, internal); + if (args.cancelled === false) { + insertContent(editor, args.content, pasteAsText); + } }; var pasteHtml$1 = function (editor, html, internalFlag) { - var internal = internalFlag ? internalFlag : isMarked(html); - doPaste(editor, unmark(html), internal, false); + var internal = internalFlag ? internalFlag : isMarked(html); + doPaste(editor, unmark(html), internal, false); }; var pasteText = function (editor, text) { - var encodedText = editor.dom.encode(text).replace(/\r\n/g, '\n'); - var normalizedText = normalizeWhitespace(editor, encodedText); - var html = convert(normalizedText, getForcedRootBlock(editor), getForcedRootBlockAttrs(editor)); - doPaste(editor, html, false, true); + var encodedText = editor.dom.encode(text).replace(/\r\n/g, '\n'); + var normalizedText = normalizeWhitespace(editor, encodedText); + var html = convert(normalizedText, getForcedRootBlock(editor), getForcedRootBlockAttrs(editor)); + doPaste(editor, html, false, true); }; var getDataTransferItems = function (dataTransfer) { - var items = {}; - var mceInternalUrlPrefix = 'data:text/mce-internal,'; - if (dataTransfer) { - if (dataTransfer.getData) { - var legacyText = dataTransfer.getData('Text'); - if (legacyText && legacyText.length > 0) { - if (legacyText.indexOf(mceInternalUrlPrefix) === -1) { - items['text/plain'] = legacyText; - } - } - } - if (dataTransfer.types) { - for (var i = 0; i < dataTransfer.types.length; i++) { - var contentType = dataTransfer.types[i]; - try { - items[contentType] = dataTransfer.getData(contentType); - } catch (ex) { - items[contentType] = ''; - } - } + var items = {}; + var mceInternalUrlPrefix = 'data:text/mce-internal,'; + if (dataTransfer) { + if (dataTransfer.getData) { + var legacyText = dataTransfer.getData('Text'); + if (legacyText && legacyText.length > 0) { + if (legacyText.indexOf(mceInternalUrlPrefix) === -1) { + items['text/plain'] = legacyText; + } + } + } + if (dataTransfer.types) { + for (var i = 0; i < dataTransfer.types.length; i++) { + var contentType = dataTransfer.types[i]; + try { + items[contentType] = dataTransfer.getData(contentType); + } catch (ex) { + items[contentType] = ''; } + } } - return items; + } + return items; }; var getClipboardContent = function (editor, clipboardEvent) { - return getDataTransferItems(clipboardEvent.clipboardData || editor.getDoc().dataTransfer); + return getDataTransferItems(clipboardEvent.clipboardData || editor.getDoc().dataTransfer); }; var hasContentType = function (clipboardContent, mimeType) { - return mimeType in clipboardContent && clipboardContent[mimeType].length > 0; + return mimeType in clipboardContent && clipboardContent[mimeType].length > 0; }; var hasHtmlOrText = function (content) { - return hasContentType(content, 'text/html') || hasContentType(content, 'text/plain'); + return hasContentType(content, 'text/html') || hasContentType(content, 'text/plain'); }; var parseDataUri = function (uri) { - var matches = /data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(uri); - if (matches) { - return { - type: matches[1], - data: decodeURIComponent(matches[2]) - }; - } else { - return { - type: null, - data: null - }; - } + var matches = /data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(uri); + if (matches) { + return { + type: matches[1], + data: decodeURIComponent(matches[2]) + }; + } else { + return { + type: null, + data: null + }; + } }; var isValidDataUriImage = function (editor, imgElm) { - var filter = getImagesDataImgFilter(editor); - return filter ? filter(imgElm) : true; + var filter = getImagesDataImgFilter(editor); + return filter ? filter(imgElm) : true; }; var extractFilename = function (editor, str) { - var m = str.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i); - return isNonNullable(m) ? editor.dom.encode(m[1]) : null; + var m = str.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i); + return isNonNullable(m) ? editor.dom.encode(m[1]) : null; }; var uniqueId = createIdGenerator('mceclip'); var pasteImage = function (editor, imageItem) { - var _a = parseDataUri(imageItem.uri), base64 = _a.data, type = _a.type; - var id = uniqueId(); - var file = imageItem.blob; - var img = new Image(); - img.src = imageItem.uri; - if (isValidDataUriImage(editor, img)) { - var blobCache = editor.editorUpload.blobCache; - var blobInfo = void 0; - var existingBlobInfo = blobCache.getByData(base64, type); - if (!existingBlobInfo) { - var useFileName = getImagesReuseFilename(editor) && isNonNullable(file.name); - var name_1 = useFileName ? extractFilename(editor, file.name) : id; - var filename = useFileName ? file.name : undefined; - blobInfo = blobCache.create(id, file, base64, name_1, filename); - blobCache.add(blobInfo); - } else { - blobInfo = existingBlobInfo; - } - pasteHtml$1(editor, '', false); + var _a = parseDataUri(imageItem.uri), base64 = _a.data, type = _a.type; + var id = uniqueId(); + var file = imageItem.blob; + var img = new Image(); + img.src = imageItem.uri; + if (isValidDataUriImage(editor, img)) { + var blobCache = editor.editorUpload.blobCache; + var blobInfo = void 0; + var existingBlobInfo = blobCache.getByData(base64, type); + if (!existingBlobInfo) { + var useFileName = getImagesReuseFilename(editor) && isNonNullable(file.name); + var name_1 = useFileName ? extractFilename(editor, file.name) : id; + var filename = useFileName ? file.name : undefined; + blobInfo = blobCache.create(id, file, base64, name_1, filename); + blobCache.add(blobInfo); } else { - pasteHtml$1(editor, '', false); + blobInfo = existingBlobInfo; } + pasteHtml$1(editor, '', false); + } else { + pasteHtml$1(editor, '', false); + } }; var isClipboardEvent = function (event) { - return event.type === 'paste'; + return event.type === 'paste'; }; var isDataTransferItem = function (item) { - return isNonNullable(item.getAsFile); + return isNonNullable(item.getAsFile); }; var readFilesAsDataUris = function (items) { - return global$3.all(map(items, function (item) { - return new global$3(function (resolve) { - var blob = isDataTransferItem(item) ? item.getAsFile() : item; - var reader = new window.FileReader(); - reader.onload = function () { - resolve({ - blob: blob, - uri: reader.result - }); - }; - reader.readAsDataURL(blob); + return global$3.all(map(items, function (item) { + return new global$3(function (resolve) { + var blob = isDataTransferItem(item) ? item.getAsFile() : item; + var reader = new window.FileReader(); + reader.onload = function () { + resolve({ + blob: blob, + uri: reader.result }); - })); + }; + reader.readAsDataURL(blob); + }); + })); }; var isImage = function (editor) { - var allowedExtensions = getAllowedImageFileTypes(editor); - return function (file) { - return startsWith(file.type, 'image/') && exists(allowedExtensions, function (extension) { - return getImageMimeType(extension) === file.type; - }); - }; + var allowedExtensions = getAllowedImageFileTypes(editor); + return function (file) { + return startsWith(file.type, 'image/') && exists(allowedExtensions, function (extension) { + return getImageMimeType(extension) === file.type; + }); + }; }; var getImagesFromDataTransfer = function (editor, dataTransfer) { - var items = dataTransfer.items ? map(from$1(dataTransfer.items), function (item) { - return item.getAsFile(); - }) : []; - var files = dataTransfer.files ? from$1(dataTransfer.files) : []; - return filter(items.length > 0 ? items : files, isImage(editor)); + var items = dataTransfer.items ? map(from$1(dataTransfer.items), function (item) { + return item.getAsFile(); + }) : []; + var files = dataTransfer.files ? from$1(dataTransfer.files) : []; + return filter(items.length > 0 ? items : files, isImage(editor)); }; var pasteImageData = function (editor, e, rng) { - var dataTransfer = isClipboardEvent(e) ? e.clipboardData : e.dataTransfer; - if (getPasteDataImages(editor) && dataTransfer) { - var images = getImagesFromDataTransfer(editor, dataTransfer); - if (images.length > 0) { - e.preventDefault(); - readFilesAsDataUris(images).then(function (fileResults) { - if (rng) { - editor.selection.setRng(rng); - } - each(fileResults, function (result) { - pasteImage(editor, result); - }); - }); - return true; - } + var dataTransfer = isClipboardEvent(e) ? e.clipboardData : e.dataTransfer; + if (getPasteDataImages(editor) && dataTransfer) { + var images = getImagesFromDataTransfer(editor, dataTransfer); + if (images.length > 0) { + e.preventDefault(); + readFilesAsDataUris(images).then(function (fileResults) { + if (rng) { + editor.selection.setRng(rng); + } + each(fileResults, function (result) { + pasteImage(editor, result); + }); + }); + return true; } - return false; + } + return false; }; var isBrokenAndroidClipboardEvent = function (e) { - var clipboardData = e.clipboardData; - return navigator.userAgent.indexOf('Android') !== -1 && clipboardData && clipboardData.items && clipboardData.items.length === 0; + var clipboardData = e.clipboardData; + return navigator.userAgent.indexOf('Android') !== -1 && clipboardData && clipboardData.items && clipboardData.items.length === 0; }; var isKeyboardPasteEvent = function (e) { - return global$4.metaKeyPressed(e) && e.keyCode === 86 || e.shiftKey && e.keyCode === 45; + return global$4.metaKeyPressed(e) && e.keyCode === 86 || e.shiftKey && e.keyCode === 45; }; var registerEventHandlers = function (editor, pasteBin, pasteFormat) { - var keyboardPasteEvent = value(); - var keyboardPastePressed = value(); - var keyboardPastePlainTextState; - editor.on('keyup', keyboardPastePressed.clear); - editor.on('keydown', function (e) { - var removePasteBinOnKeyUp = function (e) { - if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) { - pasteBin.remove(); - } - }; - if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) { - keyboardPastePlainTextState = e.shiftKey && e.keyCode === 86; - if (keyboardPastePlainTextState && global$1.webkit && navigator.userAgent.indexOf('Version/') !== -1) { - return; - } - e.stopImmediatePropagation(); - keyboardPasteEvent.set(e); - keyboardPastePressed.set(true); - if (global$1.ie && keyboardPastePlainTextState) { - e.preventDefault(); - firePaste(editor, true); - return; - } - pasteBin.remove(); - pasteBin.create(); - editor.once('keyup', removePasteBinOnKeyUp); - editor.once('paste', function () { - editor.off('keyup', removePasteBinOnKeyUp); - }); - } - }); - - function insertClipboardContent(editor, clipboardContent, isKeyBoardPaste, plainTextMode, internal) { - var content; - if (hasContentType(clipboardContent, 'text/html')) { - content = clipboardContent['text/html']; - } else { - content = pasteBin.getHtml(); - internal = internal ? internal : isMarked(content); - if (pasteBin.isDefaultContent(content)) { - plainTextMode = true; - } - } - content = trimHtml(content); + var keyboardPasteEvent = value(); + var keyboardPastePressed = value(); + var keyboardPastePlainTextState; + editor.on('keyup', keyboardPastePressed.clear); + editor.on('keydown', function (e) { + var removePasteBinOnKeyUp = function (e) { + if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) { pasteBin.remove(); - var isPlainTextHtml = internal === false && isPlainText(content); - var isImage = isImageUrl(editor, content); - if (!content.length || isPlainTextHtml && !isImage) { - plainTextMode = true; - } - if (plainTextMode || isImage) { - if (hasContentType(clipboardContent, 'text/plain') && isPlainTextHtml) { - content = clipboardContent['text/plain']; - } else { - content = innerText(content); - } - } - if (pasteBin.isDefaultContent(content)) { - if (!isKeyBoardPaste) { - editor.windowManager.alert('Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.'); - } - return; - } - if (plainTextMode) { - pasteText(editor, content); - } else { - pasteHtml$1(editor, content, internal); - } - } - - var getLastRng = function () { - return pasteBin.getLastRng() || editor.selection.getRng(); + } }; - editor.on('paste', function (e) { - var isKeyboardPaste = keyboardPasteEvent.isSet() || keyboardPastePressed.isSet(); - if (isKeyboardPaste) { - keyboardPasteEvent.clear(); - } - var clipboardContent = getClipboardContent(editor, e); - var plainTextMode = pasteFormat.get() === 'text' || keyboardPastePlainTextState; - var internal = hasContentType(clipboardContent, internalHtmlMime()); - keyboardPastePlainTextState = false; - if (e.isDefaultPrevented() || isBrokenAndroidClipboardEvent(e)) { - pasteBin.remove(); - return; - } - if (!hasHtmlOrText(clipboardContent) && pasteImageData(editor, e, getLastRng())) { - pasteBin.remove(); - return; - } - if (!isKeyboardPaste) { - e.preventDefault(); - } - if (global$1.ie && (!isKeyboardPaste || e.ieFake) && !hasContentType(clipboardContent, 'text/html')) { - pasteBin.create(); - editor.dom.bind(pasteBin.getEl(), 'paste', function (e) { - e.stopPropagation(); - }); - editor.getDoc().execCommand('Paste', false, null); - clipboardContent['text/html'] = pasteBin.getHtml(); - } - if (hasContentType(clipboardContent, 'text/html')) { - e.preventDefault(); - if (!internal) { - internal = isMarked(clipboardContent['text/html']); - } - insertClipboardContent(editor, clipboardContent, isKeyboardPaste, plainTextMode, internal); - } else { - global$2.setEditorTimeout(editor, function () { - insertClipboardContent(editor, clipboardContent, isKeyboardPaste, plainTextMode, internal); - }, 0); - } - }); + if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) { + keyboardPastePlainTextState = e.shiftKey && e.keyCode === 86; + if (keyboardPastePlainTextState && global$1.webkit && navigator.userAgent.indexOf('Version/') !== -1) { + return; + } + e.stopImmediatePropagation(); + keyboardPasteEvent.set(e); + keyboardPastePressed.set(true); + if (global$1.ie && keyboardPastePlainTextState) { + e.preventDefault(); + firePaste(editor, true); + return; + } + pasteBin.remove(); + pasteBin.create(); + editor.once('keyup', removePasteBinOnKeyUp); + editor.once('paste', function () { + editor.off('keyup', removePasteBinOnKeyUp); + }); + } + }); + function insertClipboardContent(editor, clipboardContent, isKeyBoardPaste, plainTextMode, internal) { + var content; + if (hasContentType(clipboardContent, 'text/html')) { + content = clipboardContent['text/html']; + } else { + content = pasteBin.getHtml(); + internal = internal ? internal : isMarked(content); + if (pasteBin.isDefaultContent(content)) { + plainTextMode = true; + } + } + content = trimHtml(content); + pasteBin.remove(); + var isPlainTextHtml = internal === false && isPlainText(content); + var isImage = isImageUrl(editor, content); + if (!content.length || isPlainTextHtml && !isImage) { + plainTextMode = true; + } + if (plainTextMode || isImage) { + if (hasContentType(clipboardContent, 'text/plain') && isPlainTextHtml) { + content = clipboardContent['text/plain']; + } else { + content = innerText(content); + } + } + if (pasteBin.isDefaultContent(content)) { + if (!isKeyBoardPaste) { + editor.windowManager.alert('Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.'); + } + return; + } + if (plainTextMode) { + pasteText(editor, content); + } else { + pasteHtml$1(editor, content, internal); + } + } + var getLastRng = function () { + return pasteBin.getLastRng() || editor.selection.getRng(); + }; + editor.on('paste', function (e) { + var isKeyboardPaste = keyboardPasteEvent.isSet() || keyboardPastePressed.isSet(); + if (isKeyboardPaste) { + keyboardPasteEvent.clear(); + } + var clipboardContent = getClipboardContent(editor, e); + var plainTextMode = pasteFormat.get() === 'text' || keyboardPastePlainTextState; + var internal = hasContentType(clipboardContent, internalHtmlMime()); + keyboardPastePlainTextState = false; + if (e.isDefaultPrevented() || isBrokenAndroidClipboardEvent(e)) { + pasteBin.remove(); + return; + } + if (!hasHtmlOrText(clipboardContent) && pasteImageData(editor, e, getLastRng())) { + pasteBin.remove(); + return; + } + if (!isKeyboardPaste) { + e.preventDefault(); + } + if (global$1.ie && (!isKeyboardPaste || e.ieFake) && !hasContentType(clipboardContent, 'text/html')) { + pasteBin.create(); + editor.dom.bind(pasteBin.getEl(), 'paste', function (e) { + e.stopPropagation(); + }); + editor.getDoc().execCommand('Paste', false, null); + clipboardContent['text/html'] = pasteBin.getHtml(); + } + if (hasContentType(clipboardContent, 'text/html')) { + e.preventDefault(); + if (!internal) { + internal = isMarked(clipboardContent['text/html']); + } + insertClipboardContent(editor, clipboardContent, isKeyboardPaste, plainTextMode, internal); + } else { + global$2.setEditorTimeout(editor, function () { + insertClipboardContent(editor, clipboardContent, isKeyboardPaste, plainTextMode, internal); + }, 0); + } + }); }; var registerEventsAndFilters = function (editor, pasteBin, pasteFormat) { - registerEventHandlers(editor, pasteBin, pasteFormat); - var src; - editor.parser.addNodeFilter('img', function (nodes, name, args) { - var isPasteInsert = function (args) { - return args.data && args.data.paste === true; - }; - var remove = function (node) { - if (!node.attr('data-mce-object') && src !== global$1.transparentSrc) { - node.remove(); - } - }; - var isWebKitFakeUrl = function (src) { - return src.indexOf('webkit-fake-url') === 0; - }; - var isDataUri = function (src) { - return src.indexOf('data:') === 0; - }; - if (!getPasteDataImages(editor) && isPasteInsert(args)) { - var i = nodes.length; - while (i--) { - src = nodes[i].attr('src'); - if (!src) { - continue; - } - if (isWebKitFakeUrl(src)) { - remove(nodes[i]); - } else if (!getAllowHtmlDataUrls(editor) && isDataUri(src)) { - remove(nodes[i]); - } - } - } - }); + registerEventHandlers(editor, pasteBin, pasteFormat); + var src; + editor.parser.addNodeFilter('img', function (nodes, name, args) { + var isPasteInsert = function (args) { + return args.data && args.data.paste === true; + }; + var remove = function (node) { + if (!node.attr('data-mce-object') && src !== global$1.transparentSrc) { + node.remove(); + } + }; + var isWebKitFakeUrl = function (src) { + return src.indexOf('webkit-fake-url') === 0; + }; + var isDataUri = function (src) { + return src.indexOf('data:') === 0; + }; + if (!getPasteDataImages(editor) && isPasteInsert(args)) { + var i = nodes.length; + while (i--) { + src = nodes[i].attr('src'); + if (!src) { + continue; + } + if (isWebKitFakeUrl(src)) { + remove(nodes[i]); + } else if (!getAllowHtmlDataUrls(editor) && isDataUri(src)) { + remove(nodes[i]); + } + } + } + }); }; var getPasteBinParent = function (editor) { - return global$1.ie && editor.inline ? document.body : editor.getBody(); + return global$1.ie && editor.inline ? document.body : editor.getBody(); }; var isExternalPasteBin = function (editor) { - return getPasteBinParent(editor) !== editor.getBody(); + return getPasteBinParent(editor) !== editor.getBody(); }; var delegatePasteEvents = function (editor, pasteBinElm, pasteBinDefaultContent) { - if (isExternalPasteBin(editor)) { - editor.dom.bind(pasteBinElm, 'paste keyup', function (_e) { - if (!isDefault(editor, pasteBinDefaultContent)) { - editor.fire('paste'); - } - }); - } + if (isExternalPasteBin(editor)) { + editor.dom.bind(pasteBinElm, 'paste keyup', function (_e) { + if (!isDefault(editor, pasteBinDefaultContent)) { + editor.fire('paste'); + } + }); + } }; var create = function (editor, lastRngCell, pasteBinDefaultContent) { - var dom = editor.dom, body = editor.getBody(); - lastRngCell.set(editor.selection.getRng()); - var pasteBinElm = editor.dom.add(getPasteBinParent(editor), 'div', { - 'id': 'mcepastebin', - 'class': 'mce-pastebin', - 'contentEditable': true, - 'data-mce-bogus': 'all', - 'style': 'position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0' - }, pasteBinDefaultContent); - if (global$1.ie || global$1.gecko) { - dom.setStyle(pasteBinElm, 'left', dom.getStyle(body, 'direction', true) === 'rtl' ? 65535 : -65535); - } - dom.bind(pasteBinElm, 'beforedeactivate focusin focusout', function (e) { - e.stopPropagation(); - }); - delegatePasteEvents(editor, pasteBinElm, pasteBinDefaultContent); - pasteBinElm.focus(); - editor.selection.select(pasteBinElm, true); + var dom = editor.dom, body = editor.getBody(); + lastRngCell.set(editor.selection.getRng()); + var pasteBinElm = editor.dom.add(getPasteBinParent(editor), 'div', { + 'id': 'mcepastebin', + 'class': 'mce-pastebin', + 'contentEditable': true, + 'data-mce-bogus': 'all', + 'style': 'position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0' + }, pasteBinDefaultContent); + if (global$1.ie || global$1.gecko) { + dom.setStyle(pasteBinElm, 'left', dom.getStyle(body, 'direction', true) === 'rtl' ? 65535 : -65535); + } + dom.bind(pasteBinElm, 'beforedeactivate focusin focusout', function (e) { + e.stopPropagation(); + }); + delegatePasteEvents(editor, pasteBinElm, pasteBinDefaultContent); + pasteBinElm.focus(); + editor.selection.select(pasteBinElm, true); }; var remove = function (editor, lastRngCell) { - if (getEl(editor)) { - var pasteBinClone = void 0; - var lastRng = lastRngCell.get(); - while (pasteBinClone = editor.dom.get('mcepastebin')) { - editor.dom.remove(pasteBinClone); - editor.dom.unbind(pasteBinClone); - } - if (lastRng) { - editor.selection.setRng(lastRng); - } + if (getEl(editor)) { + var pasteBinClone = void 0; + var lastRng = lastRngCell.get(); + while (pasteBinClone = editor.dom.get('mcepastebin')) { + editor.dom.remove(pasteBinClone); + editor.dom.unbind(pasteBinClone); + } + if (lastRng) { + editor.selection.setRng(lastRng); } - lastRngCell.set(null); + } + lastRngCell.set(null); }; var getEl = function (editor) { - return editor.dom.get('mcepastebin'); + return editor.dom.get('mcepastebin'); }; var getHtml = function (editor) { - var copyAndRemove = function (toElm, fromElm) { - toElm.appendChild(fromElm); - editor.dom.remove(fromElm, true); - }; - var pasteBinClones = global$5.grep(getPasteBinParent(editor).childNodes, function (elm) { - return elm.id === 'mcepastebin'; - }); - var pasteBinElm = pasteBinClones.shift(); - global$5.each(pasteBinClones, function (pasteBinClone) { - copyAndRemove(pasteBinElm, pasteBinClone); - }); - var dirtyWrappers = editor.dom.select('div[id=mcepastebin]', pasteBinElm); - for (var i = dirtyWrappers.length - 1; i >= 0; i--) { - var cleanWrapper = editor.dom.create('div'); - pasteBinElm.insertBefore(cleanWrapper, dirtyWrappers[i]); - copyAndRemove(cleanWrapper, dirtyWrappers[i]); - } - return pasteBinElm ? pasteBinElm.innerHTML : ''; + var copyAndRemove = function (toElm, fromElm) { + toElm.appendChild(fromElm); + editor.dom.remove(fromElm, true); + }; + var pasteBinClones = global$5.grep(getPasteBinParent(editor).childNodes, function (elm) { + return elm.id === 'mcepastebin'; + }); + var pasteBinElm = pasteBinClones.shift(); + global$5.each(pasteBinClones, function (pasteBinClone) { + copyAndRemove(pasteBinElm, pasteBinClone); + }); + var dirtyWrappers = editor.dom.select('div[id=mcepastebin]', pasteBinElm); + for (var i = dirtyWrappers.length - 1; i >= 0; i--) { + var cleanWrapper = editor.dom.create('div'); + pasteBinElm.insertBefore(cleanWrapper, dirtyWrappers[i]); + copyAndRemove(cleanWrapper, dirtyWrappers[i]); + } + return pasteBinElm ? pasteBinElm.innerHTML : ''; }; var getLastRng = function (lastRng) { - return lastRng.get(); + return lastRng.get(); }; var isDefaultContent = function (pasteBinDefaultContent, content) { - return content === pasteBinDefaultContent; + return content === pasteBinDefaultContent; }; var isPasteBin = function (elm) { - return elm && elm.id === 'mcepastebin'; + return elm && elm.id === 'mcepastebin'; }; var isDefault = function (editor, pasteBinDefaultContent) { - var pasteBinElm = getEl(editor); - return isPasteBin(pasteBinElm) && isDefaultContent(pasteBinDefaultContent, pasteBinElm.innerHTML); + var pasteBinElm = getEl(editor); + return isPasteBin(pasteBinElm) && isDefaultContent(pasteBinDefaultContent, pasteBinElm.innerHTML); }; var PasteBin = function (editor) { - var lastRng = Cell(null); - var pasteBinDefaultContent = '%MCEPASTEBIN%'; - return { - create: function () { - return create(editor, lastRng, pasteBinDefaultContent); - }, - remove: function () { - return remove(editor, lastRng); - }, - getEl: function () { - return getEl(editor); - }, - getHtml: function () { - return getHtml(editor); - }, - getLastRng: function () { - return getLastRng(lastRng); - }, - isDefault: function () { - return isDefault(editor, pasteBinDefaultContent); - }, - isDefaultContent: function (content) { - return isDefaultContent(pasteBinDefaultContent, content); - } - }; + var lastRng = Cell(null); + var pasteBinDefaultContent = '%MCEPASTEBIN%'; + return { + create: function () { + return create(editor, lastRng, pasteBinDefaultContent); + }, + remove: function () { + return remove(editor, lastRng); + }, + getEl: function () { + return getEl(editor); + }, + getHtml: function () { + return getHtml(editor); + }, + getLastRng: function () { + return getLastRng(lastRng); + }, + isDefault: function () { + return isDefault(editor, pasteBinDefaultContent); + }, + isDefaultContent: function (content) { + return isDefaultContent(pasteBinDefaultContent, content); + } + }; }; var Clipboard = function (editor, pasteFormat) { - var pasteBin = PasteBin(editor); - editor.on('PreInit', function () { - return registerEventsAndFilters(editor, pasteBin, pasteFormat); - }); - return { - pasteFormat: pasteFormat, - pasteHtml: function (html, internalFlag) { - return pasteHtml$1(editor, html, internalFlag); - }, - pasteText: function (text) { - return pasteText(editor, text); - }, - pasteImageData: function (e, rng) { - return pasteImageData(editor, e, rng); - }, - getDataTransferItems: getDataTransferItems, - hasHtmlOrText: hasHtmlOrText, - hasContentType: hasContentType - }; + var pasteBin = PasteBin(editor); + editor.on('PreInit', function () { + return registerEventsAndFilters(editor, pasteBin, pasteFormat); + }); + return { + pasteFormat: pasteFormat, + pasteHtml: function (html, internalFlag) { + return pasteHtml$1(editor, html, internalFlag); + }, + pasteText: function (text) { + return pasteText(editor, text); + }, + pasteImageData: function (e, rng) { + return pasteImageData(editor, e, rng); + }, + getDataTransferItems: getDataTransferItems, + hasHtmlOrText: hasHtmlOrText, + hasContentType: hasContentType + }; }; var togglePlainTextPaste = function (editor, clipboard) { - if (clipboard.pasteFormat.get() === 'text') { - clipboard.pasteFormat.set('html'); - firePastePlainTextToggle(editor, false); - } else { - clipboard.pasteFormat.set('text'); - firePastePlainTextToggle(editor, true); - } - editor.focus(); + if (clipboard.pasteFormat.get() === 'text') { + clipboard.pasteFormat.set('html'); + firePastePlainTextToggle(editor, false); + } else { + clipboard.pasteFormat.set('text'); + firePastePlainTextToggle(editor, true); + } + editor.focus(); }; var register = function (editor, clipboard) { - editor.addCommand('mceTogglePlainTextPaste', function () { - togglePlainTextPaste(editor, clipboard); - }); - editor.addCommand('mceInsertClipboardContent', function (ui, value) { - if (value.content) { - clipboard.pasteHtml(value.content, value.internal); - } - if (value.text) { - clipboard.pasteText(value.text); - } - }); + editor.addCommand('mceTogglePlainTextPaste', function () { + togglePlainTextPaste(editor, clipboard); + }); + editor.addCommand('mceInsertClipboardContent', function (ui, value) { + if (value.content) { + clipboard.pasteHtml(value.content, value.internal); + } + if (value.text) { + clipboard.pasteText(value.text); + } + }); }; var hasWorkingClipboardApi = function (clipboardData) { - return global$1.iOS === false && typeof (clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.setData) === 'function'; + return global$1.iOS === false && typeof (clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.setData) === 'function'; }; var setHtml5Clipboard = function (clipboardData, html, text) { - if (hasWorkingClipboardApi(clipboardData)) { - try { - clipboardData.clearData(); - clipboardData.setData('text/html', html); - clipboardData.setData('text/plain', text); - clipboardData.setData(internalHtmlMime(), html); - return true; - } catch (e) { - return false; - } - } else { - return false; + if (hasWorkingClipboardApi(clipboardData)) { + try { + clipboardData.clearData(); + clipboardData.setData('text/html', html); + clipboardData.setData('text/plain', text); + clipboardData.setData(internalHtmlMime(), html); + return true; + } catch (e) { + return false; } + } else { + return false; + } }; var setClipboardData = function (evt, data, fallback, done) { - if (setHtml5Clipboard(evt.clipboardData, data.html, data.text)) { - evt.preventDefault(); - done(); - } else { - fallback(data.html, done); - } + if (setHtml5Clipboard(evt.clipboardData, data.html, data.text)) { + evt.preventDefault(); + done(); + } else { + fallback(data.html, done); + } }; var fallback = function (editor) { - return function (html, done) { - var markedHtml = mark(html); - var outer = editor.dom.create('div', { - 'contenteditable': 'false', - 'data-mce-bogus': 'all' - }); - var inner = editor.dom.create('div', {contenteditable: 'true'}, markedHtml); - editor.dom.setStyles(outer, { - position: 'fixed', - top: '0', - left: '-3000px', - width: '1000px', - overflow: 'hidden' - }); - outer.appendChild(inner); - editor.dom.add(editor.getBody(), outer); - var range = editor.selection.getRng(); - inner.focus(); - var offscreenRange = editor.dom.createRng(); - offscreenRange.selectNodeContents(inner); - editor.selection.setRng(offscreenRange); - global$2.setTimeout(function () { - editor.selection.setRng(range); - outer.parentNode.removeChild(outer); - done(); - }, 0); - }; + return function (html, done) { + var markedHtml = mark(html); + var outer = editor.dom.create('div', { + 'contenteditable': 'false', + 'data-mce-bogus': 'all' + }); + var inner = editor.dom.create('div', { contenteditable: 'true' }, markedHtml); + editor.dom.setStyles(outer, { + position: 'fixed', + top: '0', + left: '-3000px', + width: '1000px', + overflow: 'hidden' + }); + outer.appendChild(inner); + editor.dom.add(editor.getBody(), outer); + var range = editor.selection.getRng(); + inner.focus(); + var offscreenRange = editor.dom.createRng(); + offscreenRange.selectNodeContents(inner); + editor.selection.setRng(offscreenRange); + global$2.setTimeout(function () { + editor.selection.setRng(range); + outer.parentNode.removeChild(outer); + done(); + }, 0); + }; }; var getData = function (editor) { - return { - html: editor.selection.getContent({contextual: true}), - text: editor.selection.getContent({format: 'text'}) - }; + return { + html: editor.selection.getContent({ contextual: true }), + text: editor.selection.getContent({ format: 'text' }) + }; }; var isTableSelection = function (editor) { - return !!editor.dom.getParent(editor.selection.getStart(), 'td[data-mce-selected],th[data-mce-selected]', editor.getBody()); + return !!editor.dom.getParent(editor.selection.getStart(), 'td[data-mce-selected],th[data-mce-selected]', editor.getBody()); }; var hasSelectedContent = function (editor) { - return !editor.selection.isCollapsed() || isTableSelection(editor); + return !editor.selection.isCollapsed() || isTableSelection(editor); }; var cut = function (editor) { - return function (evt) { - if (hasSelectedContent(editor)) { - setClipboardData(evt, getData(editor), fallback(editor), function () { - if (global$1.browser.isChrome() || global$1.browser.isFirefox()) { - var rng_1 = editor.selection.getRng(); - global$2.setEditorTimeout(editor, function () { - editor.selection.setRng(rng_1); - editor.execCommand('Delete'); - }, 0); - } else { - editor.execCommand('Delete'); - } - }); + return function (evt) { + if (hasSelectedContent(editor)) { + setClipboardData(evt, getData(editor), fallback(editor), function () { + if (global$1.browser.isChrome() || global$1.browser.isFirefox()) { + var rng_1 = editor.selection.getRng(); + global$2.setEditorTimeout(editor, function () { + editor.selection.setRng(rng_1); + editor.execCommand('Delete'); + }, 0); + } else { + editor.execCommand('Delete'); } - }; + }); + } + }; }; var copy = function (editor) { - return function (evt) { - if (hasSelectedContent(editor)) { - setClipboardData(evt, getData(editor), fallback(editor), function () { - }); - } - }; + return function (evt) { + if (hasSelectedContent(editor)) { + setClipboardData(evt, getData(editor), fallback(editor), function () { + }); + } + }; }; var register$1 = function (editor) { - editor.on('cut', cut(editor)); - editor.on('copy', copy(editor)); + editor.on('cut', cut(editor)); + editor.on('copy', copy(editor)); }; var global$b = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils'); var getCaretRangeFromEvent = function (editor, e) { - return global$b.getCaretRangeFromPoint(e.clientX, e.clientY, editor.getDoc()); + return global$b.getCaretRangeFromPoint(e.clientX, e.clientY, editor.getDoc()); }; var isPlainTextFileUrl = function (content) { - var plainTextContent = content['text/plain']; - return plainTextContent ? plainTextContent.indexOf('file://') === 0 : false; + var plainTextContent = content['text/plain']; + return plainTextContent ? plainTextContent.indexOf('file://') === 0 : false; }; var setFocusedRange = function (editor, rng) { - editor.focus(); - editor.selection.setRng(rng); + editor.focus(); + editor.selection.setRng(rng); }; var setup = function (editor, clipboard, draggingInternallyState) { - if (shouldBlockDrop(editor)) { - editor.on('dragend dragover draggesture dragdrop drop drag', function (e) { - e.preventDefault(); - e.stopPropagation(); - }); + if (shouldBlockDrop(editor)) { + editor.on('dragend dragover draggesture dragdrop drop drag', function (e) { + e.preventDefault(); + e.stopPropagation(); + }); + } + if (!shouldPasteDataImages(editor)) { + editor.on('drop', function (e) { + var dataTransfer = e.dataTransfer; + if (dataTransfer && dataTransfer.files && dataTransfer.files.length > 0) { + e.preventDefault(); + } + }); + } + editor.on('drop', function (e) { + var rng = getCaretRangeFromEvent(editor, e); + if (e.isDefaultPrevented() || draggingInternallyState.get()) { + return; } - if (!shouldPasteDataImages(editor)) { - editor.on('drop', function (e) { - var dataTransfer = e.dataTransfer; - if (dataTransfer && dataTransfer.files && dataTransfer.files.length > 0) { - e.preventDefault(); - } - }); + var dropContent = clipboard.getDataTransferItems(e.dataTransfer); + var internal = clipboard.hasContentType(dropContent, internalHtmlMime()); + if ((!clipboard.hasHtmlOrText(dropContent) || isPlainTextFileUrl(dropContent)) && clipboard.pasteImageData(e, rng)) { + return; } - editor.on('drop', function (e) { - var rng = getCaretRangeFromEvent(editor, e); - if (e.isDefaultPrevented() || draggingInternallyState.get()) { - return; - } - var dropContent = clipboard.getDataTransferItems(e.dataTransfer); - var internal = clipboard.hasContentType(dropContent, internalHtmlMime()); - if ((!clipboard.hasHtmlOrText(dropContent) || isPlainTextFileUrl(dropContent)) && clipboard.pasteImageData(e, rng)) { - return; - } - if (rng && shouldFilterDrop(editor)) { - var content_1 = dropContent['mce-internal'] || dropContent['text/html'] || dropContent['text/plain']; - if (content_1) { - e.preventDefault(); - global$2.setEditorTimeout(editor, function () { - editor.undoManager.transact(function () { - if (dropContent['mce-internal']) { - editor.execCommand('Delete'); - } - setFocusedRange(editor, rng); - content_1 = trimHtml(content_1); - if (!dropContent['text/html']) { - clipboard.pasteText(content_1); - } else { - clipboard.pasteHtml(content_1, internal); - } - }); - }); + if (rng && shouldFilterDrop(editor)) { + var content_1 = dropContent['mce-internal'] || dropContent['text/html'] || dropContent['text/plain']; + if (content_1) { + e.preventDefault(); + global$2.setEditorTimeout(editor, function () { + editor.undoManager.transact(function () { + if (dropContent['mce-internal']) { + editor.execCommand('Delete'); } - } - }); - editor.on('dragstart', function (_e) { - draggingInternallyState.set(true); - }); - editor.on('dragover dragend', function (e) { - if (shouldPasteDataImages(editor) && draggingInternallyState.get() === false) { - e.preventDefault(); - setFocusedRange(editor, getCaretRangeFromEvent(editor, e)); - } - if (e.type === 'dragend') { - draggingInternallyState.set(false); - } - }); - }; - - var setup$1 = function (editor) { - var plugin = editor.plugins.paste; - var preProcess = getPreProcess(editor); - if (preProcess) { - editor.on('PastePreProcess', function (e) { - preProcess.call(plugin, plugin, e); + setFocusedRange(editor, rng); + content_1 = trimHtml(content_1); + if (!dropContent['text/html']) { + clipboard.pasteText(content_1); + } else { + clipboard.pasteHtml(content_1, internal); + } + }); }); + } } - var postProcess = getPostProcess(editor); - if (postProcess) { - editor.on('PastePostProcess', function (e) { - postProcess.call(plugin, plugin, e); - }); + }); + editor.on('dragstart', function (_e) { + draggingInternallyState.set(true); + }); + editor.on('dragover dragend', function (e) { + if (shouldPasteDataImages(editor) && draggingInternallyState.get() === false) { + e.preventDefault(); + setFocusedRange(editor, getCaretRangeFromEvent(editor, e)); + } + if (e.type === 'dragend') { + draggingInternallyState.set(false); } + }); }; - function addPreProcessFilter(editor, filterFunc) { + var setup$1 = function (editor) { + var plugin = editor.plugins.paste; + var preProcess = getPreProcess(editor); + if (preProcess) { editor.on('PastePreProcess', function (e) { - e.content = filterFunc(editor, e.content, e.internal, e.wordContent); + preProcess.call(plugin, plugin, e); }); - } - - function addPostProcessFilter(editor, filterFunc) { + } + var postProcess = getPostProcess(editor); + if (postProcess) { editor.on('PastePostProcess', function (e) { - filterFunc(editor, e.node); + postProcess.call(plugin, plugin, e); }); - } + } + }; + function addPreProcessFilter(editor, filterFunc) { + editor.on('PastePreProcess', function (e) { + e.content = filterFunc(editor, e.content, e.internal, e.wordContent); + }); + } + function addPostProcessFilter(editor, filterFunc) { + editor.on('PastePostProcess', function (e) { + filterFunc(editor, e.node); + }); + } function removeExplorerBrElementsAfterBlocks(editor, html) { - if (!isWordContent(html)) { - return html; - } - var blockElements = []; - global$5.each(editor.schema.getBlockElements(), function (block, blockName) { - blockElements.push(blockName); - }); - var explorerBlocksRegExp = new RegExp('(?:
               [\\s\\r\\n]+|
              )*(<\\/?(' + blockElements.join('|') + ')[^>]*>)(?:
               [\\s\\r\\n]+|
              )*', 'g'); - html = filter$1(html, [[ - explorerBlocksRegExp, - '$1' - ]]); - html = filter$1(html, [ - [ - /

              /g, - '

              ' - ], - [ - /
              /g, - ' ' - ], - [ - /

              /g, - '
              ' - ] - ]); + if (!isWordContent(html)) { return html; + } + var blockElements = []; + global$5.each(editor.schema.getBlockElements(), function (block, blockName) { + blockElements.push(blockName); + }); + var explorerBlocksRegExp = new RegExp('(?:
               [\\s\\r\\n]+|
              )*(<\\/?(' + blockElements.join('|') + ')[^>]*>)(?:
               [\\s\\r\\n]+|
              )*', 'g'); + html = filter$1(html, [[ + explorerBlocksRegExp, + '$1' + ]]); + html = filter$1(html, [ + [ + /

              /g, + '

              ' + ], + [ + /
              /g, + ' ' + ], + [ + /

              /g, + '
              ' + ] + ]); + return html; } - function removeWebKitStyles(editor, content, internal, isWordHtml) { - if (isWordHtml || internal) { - return content; - } - var webKitStylesSetting = getWebkitStyles(editor); - var webKitStyles; - if (shouldRemoveWebKitStyles(editor) === false || webKitStylesSetting === 'all') { - return content; - } - if (webKitStylesSetting) { - webKitStyles = webKitStylesSetting.split(/[, ]/); - } - if (webKitStyles) { - var dom_1 = editor.dom, node_1 = editor.selection.getNode(); - content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, function (all, before, value, after) { - var inputStyles = dom_1.parseStyle(dom_1.decode(value)); - var outputStyles = {}; - if (webKitStyles === 'none') { - return before + after; - } - for (var i = 0; i < webKitStyles.length; i++) { - var inputValue = inputStyles[webKitStyles[i]], - currentValue = dom_1.getStyle(node_1, webKitStyles[i], true); - if (/color/.test(webKitStyles[i])) { - inputValue = dom_1.toHex(inputValue); - currentValue = dom_1.toHex(currentValue); - } - if (currentValue !== inputValue) { - outputStyles[webKitStyles[i]] = inputValue; - } - } - outputStyles = dom_1.serializeStyle(outputStyles, 'span'); - if (outputStyles) { - return before + ' style="' + outputStyles + '"' + after; - } - return before + after; - }); - } else { - content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, '$1$3'); - } - content = content.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi, function (all, before, value, after) { - return before + ' style="' + value + '"' + after; - }); + if (isWordHtml || internal) { + return content; + } + var webKitStylesSetting = getWebkitStyles(editor); + var webKitStyles; + if (shouldRemoveWebKitStyles(editor) === false || webKitStylesSetting === 'all') { return content; + } + if (webKitStylesSetting) { + webKitStyles = webKitStylesSetting.split(/[, ]/); + } + if (webKitStyles) { + var dom_1 = editor.dom, node_1 = editor.selection.getNode(); + content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, function (all, before, value, after) { + var inputStyles = dom_1.parseStyle(dom_1.decode(value)); + var outputStyles = {}; + if (webKitStyles === 'none') { + return before + after; + } + for (var i = 0; i < webKitStyles.length; i++) { + var inputValue = inputStyles[webKitStyles[i]], currentValue = dom_1.getStyle(node_1, webKitStyles[i], true); + if (/color/.test(webKitStyles[i])) { + inputValue = dom_1.toHex(inputValue); + currentValue = dom_1.toHex(currentValue); + } + if (currentValue !== inputValue) { + outputStyles[webKitStyles[i]] = inputValue; + } + } + outputStyles = dom_1.serializeStyle(outputStyles, 'span'); + if (outputStyles) { + return before + ' style="' + outputStyles + '"' + after; + } + return before + after; + }); + } else { + content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, '$1$3'); + } + content = content.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi, function (all, before, value, after) { + return before + ' style="' + value + '"' + after; + }); + return content; } - function removeUnderlineAndFontInAnchor(editor, root) { - editor.$('a', root).find('font,u').each(function (i, node) { - editor.dom.remove(node, true); - }); + editor.$('a', root).find('font,u').each(function (i, node) { + editor.dom.remove(node, true); + }); } - var setup$2 = function (editor) { - if (global$1.webkit) { - addPreProcessFilter(editor, removeWebKitStyles); - } - if (global$1.ie) { - addPreProcessFilter(editor, removeExplorerBrElementsAfterBlocks); - addPostProcessFilter(editor, removeUnderlineAndFontInAnchor); - } + if (global$1.webkit) { + addPreProcessFilter(editor, removeWebKitStyles); + } + if (global$1.ie) { + addPreProcessFilter(editor, removeExplorerBrElementsAfterBlocks); + addPostProcessFilter(editor, removeUnderlineAndFontInAnchor); + } }; var makeSetupHandler = function (editor, clipboard) { - return function (api) { - api.setActive(clipboard.pasteFormat.get() === 'text'); - var pastePlainTextToggleHandler = function (e) { - return api.setActive(e.state); - }; - editor.on('PastePlainTextToggle', pastePlainTextToggleHandler); - return function () { - return editor.off('PastePlainTextToggle', pastePlainTextToggleHandler); - }; + return function (api) { + api.setActive(clipboard.pasteFormat.get() === 'text'); + var pastePlainTextToggleHandler = function (e) { + return api.setActive(e.state); + }; + editor.on('PastePlainTextToggle', pastePlainTextToggleHandler); + return function () { + return editor.off('PastePlainTextToggle', pastePlainTextToggleHandler); }; + }; }; var register$2 = function (editor, clipboard) { - editor.ui.registry.addToggleButton('pastetext', { - active: false, - icon: 'paste-text', - tooltip: 'Paste as text', - onAction: function () { - return editor.execCommand('mceTogglePlainTextPaste'); - }, - onSetup: makeSetupHandler(editor, clipboard) - }); - editor.ui.registry.addToggleMenuItem('pastetext', { - text: 'Paste as text', - icon: 'paste-text', - onAction: function () { - return editor.execCommand('mceTogglePlainTextPaste'); - }, - onSetup: makeSetupHandler(editor, clipboard) - }); - }; - - function Plugin() { - global.add('paste', function (editor) { - if (hasProPlugin(editor) === false) { - var draggingInternallyState = Cell(false); - var pasteFormat = Cell(isPasteAsTextEnabled(editor) ? 'text' : 'html'); - var clipboard = Clipboard(editor, pasteFormat); - var quirks = setup$2(editor); - register$2(editor, clipboard); - register(editor, clipboard); - setup$1(editor); - register$1(editor); - setup(editor, clipboard, draggingInternallyState); - return get(clipboard, quirks); - } - }); + editor.ui.registry.addToggleButton('pastetext', { + active: false, + icon: 'paste-text', + tooltip: 'Paste as text', + onAction: function () { + return editor.execCommand('mceTogglePlainTextPaste'); + }, + onSetup: makeSetupHandler(editor, clipboard) + }); + editor.ui.registry.addToggleMenuItem('pastetext', { + text: 'Paste as text', + icon: 'paste-text', + onAction: function () { + return editor.execCommand('mceTogglePlainTextPaste'); + }, + onSetup: makeSetupHandler(editor, clipboard) + }); + }; + + function Plugin () { + global.add('paste', function (editor) { + if (hasProPlugin(editor) === false) { + var draggingInternallyState = Cell(false); + var pasteFormat = Cell(isPasteAsTextEnabled(editor) ? 'text' : 'html'); + var clipboard = Clipboard(editor, pasteFormat); + var quirks = setup$2(editor); + register$2(editor, clipboard); + register(editor, clipboard); + setup$1(editor); + register$1(editor); + setup(editor, clipboard, draggingInternallyState); + return get(clipboard, quirks); + } + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/preview/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/preview/plugin.js index ea5c09ba..9e67e286 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/preview/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/preview/plugin.js @@ -16,110 +16,110 @@ var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var getContentStyle = function (editor) { - return editor.getParam('content_style', '', 'string'); + return editor.getParam('content_style', '', 'string'); }; var shouldUseContentCssCors = function (editor) { - return editor.getParam('content_css_cors', false, 'boolean'); + return editor.getParam('content_css_cors', false, 'boolean'); }; var getBodyClassByHash = function (editor) { - var bodyClass = editor.getParam('body_class', '', 'hash'); - return bodyClass[editor.id] || ''; + var bodyClass = editor.getParam('body_class', '', 'hash'); + return bodyClass[editor.id] || ''; }; var getBodyClass = function (editor) { - var bodyClass = editor.getParam('body_class', '', 'string'); - if (bodyClass.indexOf('=') === -1) { - return bodyClass; - } else { - return getBodyClassByHash(editor); - } + var bodyClass = editor.getParam('body_class', '', 'string'); + if (bodyClass.indexOf('=') === -1) { + return bodyClass; + } else { + return getBodyClassByHash(editor); + } }; var getBodyIdByHash = function (editor) { - var bodyId = editor.getParam('body_id', '', 'hash'); - return bodyId[editor.id] || bodyId; + var bodyId = editor.getParam('body_id', '', 'hash'); + return bodyId[editor.id] || bodyId; }; var getBodyId = function (editor) { - var bodyId = editor.getParam('body_id', 'tinymce', 'string'); - if (bodyId.indexOf('=') === -1) { - return bodyId; - } else { - return getBodyIdByHash(editor); - } + var bodyId = editor.getParam('body_id', 'tinymce', 'string'); + if (bodyId.indexOf('=') === -1) { + return bodyId; + } else { + return getBodyIdByHash(editor); + } }; var getPreviewHtml = function (editor) { - var headHtml = ''; - var encode = editor.dom.encode; - var contentStyle = getContentStyle(editor); - headHtml += ''; - if (contentStyle) { - headHtml += ''; - } - var cors = shouldUseContentCssCors(editor) ? ' crossorigin="anonymous"' : ''; - global$2.each(editor.contentCSS, function (url) { - headHtml += ''; - }); - var bodyId = getBodyId(editor); - var bodyClass = getBodyClass(editor); - var isMetaKeyPressed = global$1.mac ? 'e.metaKey' : 'e.ctrlKey && !e.altKey'; - var preventClicksOnLinksScript = ' '; - var directionality = editor.getBody().dir; - var dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : ''; - var previewHtml = '' + '' + '' + headHtml + '' + '' + editor.getContent() + preventClicksOnLinksScript + '' + ''; - return previewHtml; + var headHtml = ''; + var encode = editor.dom.encode; + var contentStyle = getContentStyle(editor); + headHtml += ''; + if (contentStyle) { + headHtml += ''; + } + var cors = shouldUseContentCssCors(editor) ? ' crossorigin="anonymous"' : ''; + global$2.each(editor.contentCSS, function (url) { + headHtml += ''; + }); + var bodyId = getBodyId(editor); + var bodyClass = getBodyClass(editor); + var isMetaKeyPressed = global$1.mac ? 'e.metaKey' : 'e.ctrlKey && !e.altKey'; + var preventClicksOnLinksScript = ' '; + var directionality = editor.getBody().dir; + var dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : ''; + var previewHtml = '' + '' + '' + headHtml + '' + '' + editor.getContent() + preventClicksOnLinksScript + '' + ''; + return previewHtml; }; var open = function (editor) { - var content = getPreviewHtml(editor); - var dataApi = editor.windowManager.open({ - title: 'Preview', - size: 'large', - body: { - type: 'panel', - items: [{ - name: 'preview', - type: 'iframe', - sandboxed: true - }] - }, - buttons: [{ - type: 'cancel', - name: 'close', - text: 'Close', - primary: true - }], - initialData: {preview: content} - }); - dataApi.focus('close'); + var content = getPreviewHtml(editor); + var dataApi = editor.windowManager.open({ + title: 'Preview', + size: 'large', + body: { + type: 'panel', + items: [{ + name: 'preview', + type: 'iframe', + sandboxed: true + }] + }, + buttons: [{ + type: 'cancel', + name: 'close', + text: 'Close', + primary: true + }], + initialData: { preview: content } + }); + dataApi.focus('close'); }; var register = function (editor) { - editor.addCommand('mcePreview', function () { - open(editor); - }); + editor.addCommand('mcePreview', function () { + open(editor); + }); }; var register$1 = function (editor) { - editor.ui.registry.addButton('preview', { - icon: 'preview', - tooltip: 'Preview', - onAction: function () { - return editor.execCommand('mcePreview'); - } - }); - editor.ui.registry.addMenuItem('preview', { - icon: 'preview', - text: 'Preview', - onAction: function () { - return editor.execCommand('mcePreview'); - } - }); + editor.ui.registry.addButton('preview', { + icon: 'preview', + tooltip: 'Preview', + onAction: function () { + return editor.execCommand('mcePreview'); + } + }); + editor.ui.registry.addMenuItem('preview', { + icon: 'preview', + text: 'Preview', + onAction: function () { + return editor.execCommand('mcePreview'); + } + }); }; - function Plugin() { - global.add('preview', function (editor) { - register(editor); - register$1(editor); - }); + function Plugin () { + global.add('preview', function (editor) { + register(editor); + register$1(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/print/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/print/plugin.js index 04700e6d..7fe33d15 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/print/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/print/plugin.js @@ -14,38 +14,38 @@ var global$1 = tinymce.util.Tools.resolve('tinymce.Env'); var register = function (editor) { - editor.addCommand('mcePrint', function () { - if (global$1.browser.isIE()) { - editor.getDoc().execCommand('print', false, null); - } else { - editor.getWin().print(); - } - }); + editor.addCommand('mcePrint', function () { + if (global$1.browser.isIE()) { + editor.getDoc().execCommand('print', false, null); + } else { + editor.getWin().print(); + } + }); }; var register$1 = function (editor) { - editor.ui.registry.addButton('print', { - icon: 'print', - tooltip: 'Print', - onAction: function () { - return editor.execCommand('mcePrint'); - } - }); - editor.ui.registry.addMenuItem('print', { - text: 'Print...', - icon: 'print', - onAction: function () { - return editor.execCommand('mcePrint'); - } - }); + editor.ui.registry.addButton('print', { + icon: 'print', + tooltip: 'Print', + onAction: function () { + return editor.execCommand('mcePrint'); + } + }); + editor.ui.registry.addMenuItem('print', { + text: 'Print...', + icon: 'print', + onAction: function () { + return editor.execCommand('mcePrint'); + } + }); }; - function Plugin() { - global.add('print', function (editor) { - register(editor); - register$1(editor); - editor.addShortcut('Meta+P', '', 'mcePrint'); - }); + function Plugin () { + global.add('print', function (editor) { + register(editor); + register$1(editor); + editor.addShortcut('Meta+P', '', 'mcePrint'); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/quickbars/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/quickbars/plugin.js index 03f9c61e..f0e3c5c2 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/quickbars/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/quickbars/plugin.js @@ -13,61 +13,61 @@ var unique = 0; var generate = function (prefix) { - var date = new Date(); - var time = date.getTime(); - var random = Math.floor(Math.random() * 1000000000); - unique++; - return prefix + '_' + random + unique + String(time); + var date = new Date(); + var time = date.getTime(); + var random = Math.floor(Math.random() * 1000000000); + unique++; + return prefix + '_' + random + unique + String(time); }; var createTableHtml = function (cols, rows) { - var x, y, html; - html = ''; - html += ''; - for (y = 0; y < rows; y++) { - html += ''; - for (x = 0; x < cols; x++) { - html += ''; - } - html += ''; + var x, y, html; + html = '

              '; + html += ''; + for (y = 0; y < rows; y++) { + html += ''; + for (x = 0; x < cols; x++) { + html += ''; } - html += ''; - html += '

              '; - return html; + html += ''; + } + html += ''; + html += ''; + return html; }; var getInsertedElement = function (editor) { - var elms = editor.dom.select('*[data-mce-id]'); - return elms[0]; + var elms = editor.dom.select('*[data-mce-id]'); + return elms[0]; }; var insertTableHtml = function (editor, cols, rows) { - editor.undoManager.transact(function () { - editor.insertContent(createTableHtml(cols, rows)); - var tableElm = getInsertedElement(editor); - tableElm.removeAttribute('data-mce-id'); - var cellElm = editor.dom.select('td,th', tableElm); - editor.selection.setCursorLocation(cellElm[0], 0); - }); + editor.undoManager.transact(function () { + editor.insertContent(createTableHtml(cols, rows)); + var tableElm = getInsertedElement(editor); + tableElm.removeAttribute('data-mce-id'); + var cellElm = editor.dom.select('td,th', tableElm); + editor.selection.setCursorLocation(cellElm[0], 0); + }); }; var insertTable = function (editor, cols, rows) { - editor.plugins.table ? editor.plugins.table.insertTable(cols, rows) : insertTableHtml(editor, cols, rows); + editor.plugins.table ? editor.plugins.table.insertTable(cols, rows) : insertTableHtml(editor, cols, rows); }; var insertBlob = function (editor, base64, blob) { - var blobCache = editor.editorUpload.blobCache; - var blobInfo = blobCache.create(generate('mceu'), blob, base64); - blobCache.add(blobInfo); - editor.insertContent(editor.dom.createHTML('img', {src: blobInfo.blobUri()})); + var blobCache = editor.editorUpload.blobCache; + var blobInfo = blobCache.create(generate('mceu'), blob, base64); + blobCache.add(blobInfo); + editor.insertContent(editor.dom.createHTML('img', { src: blobInfo.blobUri() })); }; var global$1 = tinymce.util.Tools.resolve('tinymce.util.Promise'); var blobToBase64 = function (blob) { - return new global$1(function (resolve) { - var reader = new FileReader(); - reader.onloadend = function () { - resolve(reader.result.split(',')[1]); - }; - reader.readAsDataURL(blob); - }); + return new global$1(function (resolve) { + var reader = new FileReader(); + reader.onloadend = function () { + resolve(reader.result.split(',')[1]); + }; + reader.readAsDataURL(blob); + }); }; var global$2 = tinymce.util.Tools.resolve('tinymce.Env'); @@ -75,202 +75,202 @@ var global$3 = tinymce.util.Tools.resolve('tinymce.util.Delay'); var pickFile = function (editor) { - return new global$1(function (resolve) { - var fileInput = document.createElement('input'); - fileInput.type = 'file'; - fileInput.accept = 'image/*'; - fileInput.style.position = 'fixed'; - fileInput.style.left = '0'; - fileInput.style.top = '0'; - fileInput.style.opacity = '0.001'; - document.body.appendChild(fileInput); - var changeHandler = function (e) { - resolve(Array.prototype.slice.call(e.target.files)); - }; - fileInput.addEventListener('change', changeHandler); - var cancelHandler = function (e) { - var cleanup = function () { - resolve([]); - fileInput.parentNode.removeChild(fileInput); - }; - if (global$2.os.isAndroid() && e.type !== 'remove') { - global$3.setEditorTimeout(editor, cleanup, 0); - } else { - cleanup(); - } - editor.off('focusin remove', cancelHandler); - }; - editor.on('focusin remove', cancelHandler); - fileInput.click(); - }); + return new global$1(function (resolve) { + var fileInput = document.createElement('input'); + fileInput.type = 'file'; + fileInput.accept = 'image/*'; + fileInput.style.position = 'fixed'; + fileInput.style.left = '0'; + fileInput.style.top = '0'; + fileInput.style.opacity = '0.001'; + document.body.appendChild(fileInput); + var changeHandler = function (e) { + resolve(Array.prototype.slice.call(e.target.files)); + }; + fileInput.addEventListener('change', changeHandler); + var cancelHandler = function (e) { + var cleanup = function () { + resolve([]); + fileInput.parentNode.removeChild(fileInput); + }; + if (global$2.os.isAndroid() && e.type !== 'remove') { + global$3.setEditorTimeout(editor, cleanup, 0); + } else { + cleanup(); + } + editor.off('focusin remove', cancelHandler); + }; + editor.on('focusin remove', cancelHandler); + fileInput.click(); + }); }; var setupButtons = function (editor) { - editor.ui.registry.addButton('quickimage', { - icon: 'image', - tooltip: 'Insert image', - onAction: function () { - pickFile(editor).then(function (files) { - if (files.length > 0) { - var blob_1 = files[0]; - blobToBase64(blob_1).then(function (base64) { - insertBlob(editor, base64, blob_1); - }); - } - }); - } - }); - editor.ui.registry.addButton('quicktable', { - icon: 'table', - tooltip: 'Insert table', - onAction: function () { - insertTable(editor, 2, 2); + editor.ui.registry.addButton('quickimage', { + icon: 'image', + tooltip: 'Insert image', + onAction: function () { + pickFile(editor).then(function (files) { + if (files.length > 0) { + var blob_1 = files[0]; + blobToBase64(blob_1).then(function (base64) { + insertBlob(editor, base64, blob_1); + }); } - }); + }); + } + }); + editor.ui.registry.addButton('quicktable', { + icon: 'table', + tooltip: 'Insert table', + onAction: function () { + insertTable(editor, 2, 2); + } + }); }; var noop = function () { }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; var never = constant(false); var always = constant(true); var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var typeOf = function (x) { - var t = typeof x; - if (x === null) { - return 'null'; - } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { - return 'array'; - } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { - return 'string'; - } else { - return t; - } + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } }; var isType = function (type) { - return function (value) { - return typeOf(value) === type; - }; + return function (value) { + return typeOf(value) === type; + }; }; var isSimpleType = function (type) { - return function (value) { - return typeof value === type; - }; + return function (value) { + return typeof value === type; + }; }; var eq = function (t) { - return function (a) { - return t === a; - }; + return function (a) { + return t === a; + }; }; var isString = isType('string'); var isObject = isType('object'); @@ -279,211 +279,211 @@ var isUndefined = eq(undefined); var isFunction = isSimpleType('function'); - function ClosestOrAncestor(is, ancestor, scope, a, isRoot) { - if (is(scope, a)) { - return Optional.some(scope); - } else if (isFunction(isRoot) && isRoot(scope)) { - return Optional.none(); - } else { - return ancestor(scope, a, isRoot); - } + function ClosestOrAncestor (is, ancestor, scope, a, isRoot) { + if (is(scope, a)) { + return Optional.some(scope); + } else if (isFunction(isRoot) && isRoot(scope)) { + return Optional.none(); + } else { + return ancestor(scope, a, isRoot); + } } var ELEMENT = 1; var fromHtml = function (html, scope) { - var doc = scope || document; - var div = doc.createElement('div'); - div.innerHTML = html; - if (!div.hasChildNodes() || div.childNodes.length > 1) { - console.error('HTML does not have a single root node', html); - throw new Error('HTML must have a single root node'); - } - return fromDom(div.childNodes[0]); + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); }; var fromTag = function (tag, scope) { - var doc = scope || document; - var node = doc.createElement(tag); - return fromDom(node); + var doc = scope || document; + var node = doc.createElement(tag); + return fromDom(node); }; var fromText = function (text, scope) { - var doc = scope || document; - var node = doc.createTextNode(text); - return fromDom(node); + var doc = scope || document; + var node = doc.createTextNode(text); + return fromDom(node); }; var fromDom = function (node) { - if (node === null || node === undefined) { - throw new Error('Node cannot be null or undefined'); - } - return {dom: node}; + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: node }; }; var fromPoint = function (docElm, x, y) { - return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); + return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); }; var SugarElement = { - fromHtml: fromHtml, - fromTag: fromTag, - fromText: fromText, - fromDom: fromDom, - fromPoint: fromPoint + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint }; var is = function (element, selector) { - var dom = element.dom; - if (dom.nodeType !== ELEMENT) { - return false; + var dom = element.dom; + if (dom.nodeType !== ELEMENT) { + return false; + } else { + var elem = dom; + if (elem.matches !== undefined) { + return elem.matches(selector); + } else if (elem.msMatchesSelector !== undefined) { + return elem.msMatchesSelector(selector); + } else if (elem.webkitMatchesSelector !== undefined) { + return elem.webkitMatchesSelector(selector); + } else if (elem.mozMatchesSelector !== undefined) { + return elem.mozMatchesSelector(selector); } else { - var elem = dom; - if (elem.matches !== undefined) { - return elem.matches(selector); - } else if (elem.msMatchesSelector !== undefined) { - return elem.msMatchesSelector(selector); - } else if (elem.webkitMatchesSelector !== undefined) { - return elem.webkitMatchesSelector(selector); - } else if (elem.mozMatchesSelector !== undefined) { - return elem.mozMatchesSelector(selector); - } else { - throw new Error('Browser lacks native selectors'); - } + throw new Error('Browser lacks native selectors'); } + } }; var Global = typeof window !== 'undefined' ? window : Function('return this;')(); var name = function (element) { - var r = element.dom.nodeName; - return r.toLowerCase(); + var r = element.dom.nodeName; + return r.toLowerCase(); }; var ancestor = function (scope, predicate, isRoot) { - var element = scope.dom; - var stop = isFunction(isRoot) ? isRoot : never; - while (element.parentNode) { - element = element.parentNode; - var el = SugarElement.fromDom(element); - if (predicate(el)) { - return Optional.some(el); - } else if (stop(el)) { - break; - } + var element = scope.dom; + var stop = isFunction(isRoot) ? isRoot : never; + while (element.parentNode) { + element = element.parentNode; + var el = SugarElement.fromDom(element); + if (predicate(el)) { + return Optional.some(el); + } else if (stop(el)) { + break; } - return Optional.none(); + } + return Optional.none(); }; var closest = function (scope, predicate, isRoot) { - var is = function (s, test) { - return test(s); - }; - return ClosestOrAncestor(is, ancestor, scope, predicate, isRoot); + var is = function (s, test) { + return test(s); + }; + return ClosestOrAncestor(is, ancestor, scope, predicate, isRoot); }; var ancestor$1 = function (scope, selector, isRoot) { - return ancestor(scope, function (e) { - return is(e, selector); - }, isRoot); + return ancestor(scope, function (e) { + return is(e, selector); + }, isRoot); }; var closest$1 = function (scope, selector, isRoot) { - var is$1 = function (element, selector) { - return is(element, selector); - }; - return ClosestOrAncestor(is$1, ancestor$1, scope, selector, isRoot); + var is$1 = function (element, selector) { + return is(element, selector); + }; + return ClosestOrAncestor(is$1, ancestor$1, scope, selector, isRoot); }; var validDefaultOrDie = function (value, predicate) { - if (predicate(value)) { - return true; - } - throw new Error('Default value doesn\'t match requested type.'); + if (predicate(value)) { + return true; + } + throw new Error('Default value doesn\'t match requested type.'); }; var items = function (value, defaultValue) { - if (isArray(value) || isObject(value)) { - throw new Error('expected a string but found: ' + value); - } - if (isUndefined(value)) { - return defaultValue; - } - if (isBoolean(value)) { - return value === false ? '' : defaultValue; - } - return value; + if (isArray(value) || isObject(value)) { + throw new Error('expected a string but found: ' + value); + } + if (isUndefined(value)) { + return defaultValue; + } + if (isBoolean(value)) { + return value === false ? '' : defaultValue; + } + return value; }; var getToolbarItemsOr_ = function (predicate) { - return function (editor, name, defaultValue) { - validDefaultOrDie(defaultValue, predicate); - var value = editor.getParam(name, defaultValue); - return items(value, defaultValue); - }; + return function (editor, name, defaultValue) { + validDefaultOrDie(defaultValue, predicate); + var value = editor.getParam(name, defaultValue); + return items(value, defaultValue); + }; }; var getToolbarItemsOr = getToolbarItemsOr_(isString); var getTextSelectionToolbarItems = function (editor) { - return getToolbarItemsOr(editor, 'quickbars_selection_toolbar', 'bold italic | quicklink h2 h3 blockquote'); + return getToolbarItemsOr(editor, 'quickbars_selection_toolbar', 'bold italic | quicklink h2 h3 blockquote'); }; var getInsertToolbarItems = function (editor) { - return getToolbarItemsOr(editor, 'quickbars_insert_toolbar', 'quickimage quicktable'); + return getToolbarItemsOr(editor, 'quickbars_insert_toolbar', 'quickimage quicktable'); }; var getImageToolbarItems = function (editor) { - return getToolbarItemsOr(editor, 'quickbars_image_toolbar', 'alignleft aligncenter alignright'); + return getToolbarItemsOr(editor, 'quickbars_image_toolbar', 'alignleft aligncenter alignright'); }; var addToEditor = function (editor) { - var insertToolbarItems = getInsertToolbarItems(editor); - if (insertToolbarItems.trim().length > 0) { - editor.ui.registry.addContextToolbar('quickblock', { - predicate: function (node) { - var sugarNode = SugarElement.fromDom(node); - var textBlockElementsMap = editor.schema.getTextBlockElements(); - var isRoot = function (elem) { - return elem.dom === editor.getBody(); - }; - return closest$1(sugarNode, 'table', isRoot).fold(function () { - return closest(sugarNode, function (elem) { - return name(elem) in textBlockElementsMap && editor.dom.isEmpty(elem.dom); - }, isRoot).isSome(); - }, function () { - return false; - }); - }, - items: insertToolbarItems, - position: 'line', - scope: 'editor' + var insertToolbarItems = getInsertToolbarItems(editor); + if (insertToolbarItems.trim().length > 0) { + editor.ui.registry.addContextToolbar('quickblock', { + predicate: function (node) { + var sugarNode = SugarElement.fromDom(node); + var textBlockElementsMap = editor.schema.getTextBlockElements(); + var isRoot = function (elem) { + return elem.dom === editor.getBody(); + }; + return closest$1(sugarNode, 'table', isRoot).fold(function () { + return closest(sugarNode, function (elem) { + return name(elem) in textBlockElementsMap && editor.dom.isEmpty(elem.dom); + }, isRoot).isSome(); + }, function () { + return false; }); - } + }, + items: insertToolbarItems, + position: 'line', + scope: 'editor' + }); + } }; var addToEditor$1 = function (editor) { - var isEditable = function (node) { - return editor.dom.getContentEditableParent(node) !== 'false'; - }; - var isImage = function (node) { - return node.nodeName === 'IMG' || node.nodeName === 'FIGURE' && /image/i.test(node.className); - }; - var imageToolbarItems = getImageToolbarItems(editor); - if (imageToolbarItems.trim().length > 0) { - editor.ui.registry.addContextToolbar('imageselection', { - predicate: isImage, - items: imageToolbarItems, - position: 'node' - }); - } - var textToolbarItems = getTextSelectionToolbarItems(editor); - if (textToolbarItems.trim().length > 0) { - editor.ui.registry.addContextToolbar('textselection', { - predicate: function (node) { - return !isImage(node) && !editor.selection.isCollapsed() && isEditable(node); - }, - items: textToolbarItems, - position: 'selection', - scope: 'editor' - }); - } + var isEditable = function (node) { + return editor.dom.getContentEditableParent(node) !== 'false'; + }; + var isImage = function (node) { + return node.nodeName === 'IMG' || node.nodeName === 'FIGURE' && /image/i.test(node.className); + }; + var imageToolbarItems = getImageToolbarItems(editor); + if (imageToolbarItems.trim().length > 0) { + editor.ui.registry.addContextToolbar('imageselection', { + predicate: isImage, + items: imageToolbarItems, + position: 'node' + }); + } + var textToolbarItems = getTextSelectionToolbarItems(editor); + if (textToolbarItems.trim().length > 0) { + editor.ui.registry.addContextToolbar('textselection', { + predicate: function (node) { + return !isImage(node) && !editor.selection.isCollapsed() && isEditable(node); + }, + items: textToolbarItems, + position: 'selection', + scope: 'editor' + }); + } }; - function Plugin() { - global.add('quickbars', function (editor) { - setupButtons(editor); - addToEditor(editor); - addToEditor$1(editor); - }); + function Plugin () { + global.add('quickbars', function (editor) { + setupButtons(editor); + addToEditor(editor); + addToEditor$1(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/save/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/save/plugin.js index a963c651..e1c11c27 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/save/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/save/plugin.js @@ -16,102 +16,102 @@ var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var enableWhenDirty = function (editor) { - return editor.getParam('save_enablewhendirty', true); + return editor.getParam('save_enablewhendirty', true); }; var hasOnSaveCallback = function (editor) { - return !!editor.getParam('save_onsavecallback'); + return !!editor.getParam('save_onsavecallback'); }; var hasOnCancelCallback = function (editor) { - return !!editor.getParam('save_oncancelcallback'); + return !!editor.getParam('save_oncancelcallback'); }; var displayErrorMessage = function (editor, message) { - editor.notificationManager.open({ - text: message, - type: 'error' - }); + editor.notificationManager.open({ + text: message, + type: 'error' + }); }; var save = function (editor) { - var formObj = global$1.DOM.getParent(editor.id, 'form'); - if (enableWhenDirty(editor) && !editor.isDirty()) { - return; - } - editor.save(); - if (hasOnSaveCallback(editor)) { - editor.execCallback('save_onsavecallback', editor); - editor.nodeChanged(); - return; - } - if (formObj) { - editor.setDirty(false); - if (!formObj.onsubmit || formObj.onsubmit()) { - if (typeof formObj.submit === 'function') { - formObj.submit(); - } else { - displayErrorMessage(editor, 'Error: Form submit field collision.'); - } - } - editor.nodeChanged(); - } else { - displayErrorMessage(editor, 'Error: No form element found.'); + var formObj = global$1.DOM.getParent(editor.id, 'form'); + if (enableWhenDirty(editor) && !editor.isDirty()) { + return; + } + editor.save(); + if (hasOnSaveCallback(editor)) { + editor.execCallback('save_onsavecallback', editor); + editor.nodeChanged(); + return; + } + if (formObj) { + editor.setDirty(false); + if (!formObj.onsubmit || formObj.onsubmit()) { + if (typeof formObj.submit === 'function') { + formObj.submit(); + } else { + displayErrorMessage(editor, 'Error: Form submit field collision.'); + } } + editor.nodeChanged(); + } else { + displayErrorMessage(editor, 'Error: No form element found.'); + } }; var cancel = function (editor) { - var h = global$2.trim(editor.startContent); - if (hasOnCancelCallback(editor)) { - editor.execCallback('save_oncancelcallback', editor); - return; - } - editor.resetContent(h); + var h = global$2.trim(editor.startContent); + if (hasOnCancelCallback(editor)) { + editor.execCallback('save_oncancelcallback', editor); + return; + } + editor.resetContent(h); }; var register = function (editor) { - editor.addCommand('mceSave', function () { - save(editor); - }); - editor.addCommand('mceCancel', function () { - cancel(editor); - }); + editor.addCommand('mceSave', function () { + save(editor); + }); + editor.addCommand('mceCancel', function () { + cancel(editor); + }); }; var stateToggle = function (editor) { - return function (api) { - var handler = function () { - api.setDisabled(enableWhenDirty(editor) && !editor.isDirty()); - }; - editor.on('NodeChange dirty', handler); - return function () { - return editor.off('NodeChange dirty', handler); - }; + return function (api) { + var handler = function () { + api.setDisabled(enableWhenDirty(editor) && !editor.isDirty()); + }; + editor.on('NodeChange dirty', handler); + return function () { + return editor.off('NodeChange dirty', handler); }; + }; }; var register$1 = function (editor) { - editor.ui.registry.addButton('save', { - icon: 'save', - tooltip: 'Save', - disabled: true, - onAction: function () { - return editor.execCommand('mceSave'); - }, - onSetup: stateToggle(editor) - }); - editor.ui.registry.addButton('cancel', { - icon: 'cancel', - tooltip: 'Cancel', - disabled: true, - onAction: function () { - return editor.execCommand('mceCancel'); - }, - onSetup: stateToggle(editor) - }); - editor.addShortcut('Meta+S', '', 'mceSave'); + editor.ui.registry.addButton('save', { + icon: 'save', + tooltip: 'Save', + disabled: true, + onAction: function () { + return editor.execCommand('mceSave'); + }, + onSetup: stateToggle(editor) + }); + editor.ui.registry.addButton('cancel', { + icon: 'cancel', + tooltip: 'Cancel', + disabled: true, + onAction: function () { + return editor.execCommand('mceCancel'); + }, + onSetup: stateToggle(editor) + }); + editor.addShortcut('Meta+S', '', 'mceSave'); }; - function Plugin() { - global.add('save', function (editor) { - register$1(editor); - register(editor); - }); + function Plugin () { + global.add('save', function (editor) { + register$1(editor); + register(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/searchreplace/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/searchreplace/plugin.js index be472734..31f8f671 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/searchreplace/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/searchreplace/plugin.js @@ -10,40 +10,40 @@ 'use strict'; var Cell = function (initial) { - var value = initial; - var get = function () { - return value; - }; - var set = function (v) { - value = v; - }; - return { - get: get, - set: set - }; + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; }; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); }; var noop = function () { }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; var never = constant(false); var always = constant(true); @@ -53,109 +53,109 @@ var punctuation = constant(punctuationStr); var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var punctuation$1 = punctuation; @@ -163,26 +163,26 @@ var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var typeOf = function (x) { - var t = typeof x; - if (x === null) { - return 'null'; - } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { - return 'array'; - } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { - return 'string'; - } else { - return t; - } + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } }; var isType = function (type) { - return function (value) { - return typeOf(value) === type; - }; + return function (value) { + return typeOf(value) === type; + }; }; var isSimpleType = function (type) { - return function (value) { - return typeof value === type; - }; + return function (value) { + return typeof value === type; + }; }; var isString = isType('string'); var isArray = isType('array'); @@ -192,77 +192,77 @@ var nativeSlice = Array.prototype.slice; var nativePush = Array.prototype.push; var map = function (xs, f) { - var len = xs.length; - var r = new Array(len); - for (var i = 0; i < len; i++) { - var x = xs[i]; - r[i] = f(x, i); - } - return r; + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; }; var each = function (xs, f) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - f(x, i); - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } }; var eachr = function (xs, f) { - for (var i = xs.length - 1; i >= 0; i--) { - var x = xs[i]; - f(x, i); - } + for (var i = xs.length - 1; i >= 0; i--) { + var x = xs[i]; + f(x, i); + } }; var groupBy = function (xs, f) { - if (xs.length === 0) { - return []; - } else { - var wasType = f(xs[0]); - var r = []; - var group = []; - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - var type = f(x); - if (type !== wasType) { - r.push(group); - group = []; - } - wasType = type; - group.push(x); - } - if (group.length !== 0) { - r.push(group); - } - return r; + if (xs.length === 0) { + return []; + } else { + var wasType = f(xs[0]); + var r = []; + var group = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + var type = f(x); + if (type !== wasType) { + r.push(group); + group = []; + } + wasType = type; + group.push(x); + } + if (group.length !== 0) { + r.push(group); } + return r; + } }; var foldl = function (xs, f, acc) { - each(xs, function (x) { - acc = f(acc, x); - }); - return acc; + each(xs, function (x) { + acc = f(acc, x); + }); + return acc; }; var flatten = function (xs) { - var r = []; - for (var i = 0, len = xs.length; i < len; ++i) { - if (!isArray(xs[i])) { - throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); - } - nativePush.apply(r, xs[i]); + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); } - return r; + nativePush.apply(r, xs[i]); + } + return r; }; var bind = function (xs, f) { - return flatten(map(xs, f)); + return flatten(map(xs, f)); }; var sort = function (xs, comparator) { - var copy = nativeSlice.call(xs, 0); - copy.sort(comparator); - return copy; + var copy = nativeSlice.call(xs, 0); + copy.sort(comparator); + return copy; }; var hasOwnProperty = Object.hasOwnProperty; var has = function (obj, key) { - return hasOwnProperty.call(obj, key); + return hasOwnProperty.call(obj, key); }; var Global = typeof window !== 'undefined' ? window : Function('return this;')(); @@ -273,893 +273,889 @@ var TEXT = 3; var type = function (element) { - return element.dom.nodeType; + return element.dom.nodeType; }; var isType$1 = function (t) { - return function (element) { - return type(element) === t; - }; + return function (element) { + return type(element) === t; + }; }; var isText = isType$1(TEXT); var rawSet = function (dom, key, value) { - if (isString(value) || isBoolean(value) || isNumber(value)) { - dom.setAttribute(key, value + ''); - } else { - console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); - throw new Error('Attribute value was not simple'); - } + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); + throw new Error('Attribute value was not simple'); + } }; var set = function (element, key, value) { - rawSet(element.dom, key, value); + rawSet(element.dom, key, value); }; var compareDocumentPosition = function (a, b, match) { - return (a.compareDocumentPosition(b) & match) !== 0; + return (a.compareDocumentPosition(b) & match) !== 0; }; var documentPositionPreceding = function (a, b) { - return compareDocumentPosition(a, b, Node.DOCUMENT_POSITION_PRECEDING); + return compareDocumentPosition(a, b, Node.DOCUMENT_POSITION_PRECEDING); }; var fromHtml = function (html, scope) { - var doc = scope || document; - var div = doc.createElement('div'); - div.innerHTML = html; - if (!div.hasChildNodes() || div.childNodes.length > 1) { - console.error('HTML does not have a single root node', html); - throw new Error('HTML must have a single root node'); - } - return fromDom(div.childNodes[0]); + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); }; var fromTag = function (tag, scope) { - var doc = scope || document; - var node = doc.createElement(tag); - return fromDom(node); + var doc = scope || document; + var node = doc.createElement(tag); + return fromDom(node); }; var fromText = function (text, scope) { - var doc = scope || document; - var node = doc.createTextNode(text); - return fromDom(node); + var doc = scope || document; + var node = doc.createTextNode(text); + return fromDom(node); }; var fromDom = function (node) { - if (node === null || node === undefined) { - throw new Error('Node cannot be null or undefined'); - } - return {dom: node}; + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: node }; }; var fromPoint = function (docElm, x, y) { - return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); + return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); }; var SugarElement = { - fromHtml: fromHtml, - fromTag: fromTag, - fromText: fromText, - fromDom: fromDom, - fromPoint: fromPoint + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint }; var bypassSelector = function (dom) { - return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0; + return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0; }; var all = function (selector, scope) { - var base = scope === undefined ? document : scope.dom; - return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), SugarElement.fromDom); + var base = scope === undefined ? document : scope.dom; + return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), SugarElement.fromDom); }; var parent = function (element) { - return Optional.from(element.dom.parentNode).map(SugarElement.fromDom); + return Optional.from(element.dom.parentNode).map(SugarElement.fromDom); }; var children = function (element) { - return map(element.dom.childNodes, SugarElement.fromDom); + return map(element.dom.childNodes, SugarElement.fromDom); }; var spot = function (element, offset) { - return { - element: element, - offset: offset - }; + return { + element: element, + offset: offset + }; }; var leaf = function (element, offset) { - var cs = children(element); - return cs.length > 0 && offset < cs.length ? spot(cs[offset], 0) : spot(element, offset); + var cs = children(element); + return cs.length > 0 && offset < cs.length ? spot(cs[offset], 0) : spot(element, offset); }; var before = function (marker, element) { - var parent$1 = parent(marker); - parent$1.each(function (v) { - v.dom.insertBefore(element.dom, marker.dom); - }); + var parent$1 = parent(marker); + parent$1.each(function (v) { + v.dom.insertBefore(element.dom, marker.dom); + }); }; var append = function (parent, element) { - parent.dom.appendChild(element.dom); + parent.dom.appendChild(element.dom); }; var wrap = function (element, wrapper) { - before(element, wrapper); - append(wrapper, element); + before(element, wrapper); + append(wrapper, element); }; - function NodeValue(is, name) { - var get = function (element) { - if (!is(element)) { - throw new Error('Can only get ' + name + ' value of a ' + name + ' node'); - } - return getOption(element).getOr(''); - }; - var getOption = function (element) { - return is(element) ? Optional.from(element.dom.nodeValue) : Optional.none(); - }; - var set = function (element, value) { - if (!is(element)) { - throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node'); - } - element.dom.nodeValue = value; - }; - return { - get: get, - getOption: getOption, - set: set - }; + function NodeValue (is, name) { + var get = function (element) { + if (!is(element)) { + throw new Error('Can only get ' + name + ' value of a ' + name + ' node'); + } + return getOption(element).getOr(''); + }; + var getOption = function (element) { + return is(element) ? Optional.from(element.dom.nodeValue) : Optional.none(); + }; + var set = function (element, value) { + if (!is(element)) { + throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node'); + } + element.dom.nodeValue = value; + }; + return { + get: get, + getOption: getOption, + set: set + }; } var api = NodeValue(isText, 'text'); var get = function (element) { - return api.get(element); + return api.get(element); }; var descendants = function (scope, selector) { - return all(selector, scope); + return all(selector, scope); }; var global$2 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker'); var isSimpleBoundary = function (dom, node) { - return dom.isBlock(node) || has(dom.schema.getShortEndedElements(), node.nodeName); + return dom.isBlock(node) || has(dom.schema.getShortEndedElements(), node.nodeName); }; var isContentEditableFalse = function (dom, node) { - return dom.getContentEditable(node) === 'false'; + return dom.getContentEditable(node) === 'false'; }; var isContentEditableTrueInCef = function (dom, node) { - return dom.getContentEditable(node) === 'true' && dom.getContentEditableParent(node.parentNode) === 'false'; + return dom.getContentEditable(node) === 'true' && dom.getContentEditableParent(node.parentNode) === 'false'; }; var isHidden = function (dom, node) { - return !dom.isBlock(node) && has(dom.schema.getWhiteSpaceElements(), node.nodeName); + return !dom.isBlock(node) && has(dom.schema.getWhiteSpaceElements(), node.nodeName); }; var isBoundary = function (dom, node) { - return isSimpleBoundary(dom, node) || isContentEditableFalse(dom, node) || isHidden(dom, node) || isContentEditableTrueInCef(dom, node); + return isSimpleBoundary(dom, node) || isContentEditableFalse(dom, node) || isHidden(dom, node) || isContentEditableTrueInCef(dom, node); }; var isText$1 = function (node) { - return node.nodeType === 3; + return node.nodeType === 3; }; var nuSection = function () { - return { - sOffset: 0, - fOffset: 0, - elements: [] - }; + return { + sOffset: 0, + fOffset: 0, + elements: [] + }; }; var toLeaf = function (node, offset) { - return leaf(SugarElement.fromDom(node), offset); + return leaf(SugarElement.fromDom(node), offset); }; var walk = function (dom, walkerFn, startNode, callbacks, endNode, skipStart) { - if (skipStart === void 0) { - skipStart = true; + if (skipStart === void 0) { + skipStart = true; + } + var next = skipStart ? walkerFn(false) : startNode; + while (next) { + var isCefNode = isContentEditableFalse(dom, next); + if (isCefNode || isHidden(dom, next)) { + var stopWalking = isCefNode ? callbacks.cef(next) : callbacks.boundary(next); + if (stopWalking) { + break; + } else { + next = walkerFn(true); + continue; + } + } else if (isSimpleBoundary(dom, next)) { + if (callbacks.boundary(next)) { + break; + } + } else if (isText$1(next)) { + callbacks.text(next); } - var next = skipStart ? walkerFn(false) : startNode; - while (next) { - var isCefNode = isContentEditableFalse(dom, next); - if (isCefNode || isHidden(dom, next)) { - var stopWalking = isCefNode ? callbacks.cef(next) : callbacks.boundary(next); - if (stopWalking) { - break; - } else { - next = walkerFn(true); - continue; - } - } else if (isSimpleBoundary(dom, next)) { - if (callbacks.boundary(next)) { - break; - } - } else if (isText$1(next)) { - callbacks.text(next); - } - if (next === endNode) { - break; - } else { - next = walkerFn(false); - } + if (next === endNode) { + break; + } else { + next = walkerFn(false); } + } }; var collectTextToBoundary = function (dom, section, node, rootNode, forwards) { - if (isBoundary(dom, node)) { - return; + if (isBoundary(dom, node)) { + return; + } + var rootBlock = dom.getParent(rootNode, dom.isBlock); + var walker = new global$2(node, rootBlock); + var walkerFn = forwards ? walker.next : walker.prev; + walk(dom, walkerFn, node, { + boundary: always, + cef: always, + text: function (next) { + if (forwards) { + section.fOffset += next.length; + } else { + section.sOffset += next.length; + } + section.elements.push(SugarElement.fromDom(next)); } - var rootBlock = dom.getParent(rootNode, dom.isBlock); - var walker = new global$2(node, rootBlock); - var walkerFn = forwards ? walker.next : walker.prev; - walk(dom, walkerFn, node, { - boundary: always, - cef: always, - text: function (next) { - if (forwards) { - section.fOffset += next.length; - } else { - section.sOffset += next.length; - } - section.elements.push(SugarElement.fromDom(next)); - } - }); + }); }; var collect = function (dom, rootNode, startNode, endNode, callbacks, skipStart) { - if (skipStart === void 0) { - skipStart = true; + if (skipStart === void 0) { + skipStart = true; + } + var walker = new global$2(startNode, rootNode); + var sections = []; + var current = nuSection(); + collectTextToBoundary(dom, current, startNode, rootNode, false); + var finishSection = function () { + if (current.elements.length > 0) { + sections.push(current); + current = nuSection(); } - var walker = new global$2(startNode, rootNode); - var sections = []; - var current = nuSection(); - collectTextToBoundary(dom, current, startNode, rootNode, false); - var finishSection = function () { - if (current.elements.length > 0) { - sections.push(current); - current = nuSection(); - } - return false; - }; - walk(dom, walker.next, startNode, { - boundary: finishSection, - cef: function (node) { - finishSection(); - if (callbacks) { - sections.push.apply(sections, callbacks.cef(node)); - } - return false; - }, - text: function (next) { - current.elements.push(SugarElement.fromDom(next)); - if (callbacks) { - callbacks.text(next, current); - } - } - }, endNode, skipStart); - if (endNode) { - collectTextToBoundary(dom, current, endNode, rootNode, true); + return false; + }; + walk(dom, walker.next, startNode, { + boundary: finishSection, + cef: function (node) { + finishSection(); + if (callbacks) { + sections.push.apply(sections, callbacks.cef(node)); + } + return false; + }, + text: function (next) { + current.elements.push(SugarElement.fromDom(next)); + if (callbacks) { + callbacks.text(next, current); + } } - finishSection(); - return sections; + }, endNode, skipStart); + if (endNode) { + collectTextToBoundary(dom, current, endNode, rootNode, true); + } + finishSection(); + return sections; }; var collectRangeSections = function (dom, rng) { - var start = toLeaf(rng.startContainer, rng.startOffset); - var startNode = start.element.dom; - var end = toLeaf(rng.endContainer, rng.endOffset); - var endNode = end.element.dom; - return collect(dom, rng.commonAncestorContainer, startNode, endNode, { - text: function (node, section) { - if (node === endNode) { - section.fOffset += node.length - end.offset; - } else if (node === startNode) { - section.sOffset += start.offset; - } - }, - cef: function (node) { - var sections = bind(descendants(SugarElement.fromDom(node), '*[contenteditable=true]'), function (e) { - var ceTrueNode = e.dom; - return collect(dom, ceTrueNode, ceTrueNode); - }); - return sort(sections, function (a, b) { - return documentPositionPreceding(a.elements[0].dom, b.elements[0].dom) ? 1 : -1; - }); - } - }, false); + var start = toLeaf(rng.startContainer, rng.startOffset); + var startNode = start.element.dom; + var end = toLeaf(rng.endContainer, rng.endOffset); + var endNode = end.element.dom; + return collect(dom, rng.commonAncestorContainer, startNode, endNode, { + text: function (node, section) { + if (node === endNode) { + section.fOffset += node.length - end.offset; + } else if (node === startNode) { + section.sOffset += start.offset; + } + }, + cef: function (node) { + var sections = bind(descendants(SugarElement.fromDom(node), '*[contenteditable=true]'), function (e) { + var ceTrueNode = e.dom; + return collect(dom, ceTrueNode, ceTrueNode); + }); + return sort(sections, function (a, b) { + return documentPositionPreceding(a.elements[0].dom, b.elements[0].dom) ? 1 : -1; + }); + } + }, false); }; var fromRng = function (dom, rng) { - return rng.collapsed ? [] : collectRangeSections(dom, rng); + return rng.collapsed ? [] : collectRangeSections(dom, rng); }; var fromNode = function (dom, node) { - var rng = dom.createRng(); - rng.selectNode(node); - return fromRng(dom, rng); + var rng = dom.createRng(); + rng.selectNode(node); + return fromRng(dom, rng); }; var fromNodes = function (dom, nodes) { - return bind(nodes, function (node) { - return fromNode(dom, node); - }); + return bind(nodes, function (node) { + return fromNode(dom, node); + }); }; var find = function (text, pattern, start, finish) { - if (start === void 0) { - start = 0; - } - if (finish === void 0) { - finish = text.length; + if (start === void 0) { + start = 0; + } + if (finish === void 0) { + finish = text.length; + } + var regex = pattern.regex; + regex.lastIndex = start; + var results = []; + var match; + while (match = regex.exec(text)) { + var matchedText = match[pattern.matchIndex]; + var matchStart = match.index + match[0].indexOf(matchedText); + var matchFinish = matchStart + matchedText.length; + if (matchFinish > finish) { + break; } - var regex = pattern.regex; - regex.lastIndex = start; - var results = []; - var match; - while (match = regex.exec(text)) { - var matchedText = match[pattern.matchIndex]; - var matchStart = match.index + match[0].indexOf(matchedText); - var matchFinish = matchStart + matchedText.length; - if (matchFinish > finish) { - break; - } - results.push({ - start: matchStart, - finish: matchFinish - }); - regex.lastIndex = matchFinish; - } - return results; + results.push({ + start: matchStart, + finish: matchFinish + }); + regex.lastIndex = matchFinish; + } + return results; }; var extract = function (elements, matches) { - var nodePositions = foldl(elements, function (acc, element) { - var content = get(element); - var start = acc.last; - var finish = start + content.length; - var positions = bind(matches, function (match, matchIdx) { - if (match.start < finish && match.finish > start) { - return [{ - element: element, - start: Math.max(start, match.start) - start, - finish: Math.min(finish, match.finish) - start, - matchId: matchIdx - }]; - } else { - return []; - } - }); - return { - results: acc.results.concat(positions), - last: finish - }; - }, { - results: [], - last: 0 - }).results; - return groupBy(nodePositions, function (position) { - return position.matchId; + var nodePositions = foldl(elements, function (acc, element) { + var content = get(element); + var start = acc.last; + var finish = start + content.length; + var positions = bind(matches, function (match, matchIdx) { + if (match.start < finish && match.finish > start) { + return [{ + element: element, + start: Math.max(start, match.start) - start, + finish: Math.min(finish, match.finish) - start, + matchId: matchIdx + }]; + } else { + return []; + } }); + return { + results: acc.results.concat(positions), + last: finish + }; + }, { + results: [], + last: 0 + }).results; + return groupBy(nodePositions, function (position) { + return position.matchId; + }); }; var find$1 = function (pattern, sections) { - return bind(sections, function (section) { - var elements = section.elements; - var content = map(elements, get).join(''); - var positions = find(content, pattern, section.sOffset, content.length - section.fOffset); - return extract(elements, positions); - }); + return bind(sections, function (section) { + var elements = section.elements; + var content = map(elements, get).join(''); + var positions = find(content, pattern, section.sOffset, content.length - section.fOffset); + return extract(elements, positions); + }); }; var mark = function (matches, replacementNode) { - eachr(matches, function (match, idx) { - eachr(match, function (pos) { - var wrapper = SugarElement.fromDom(replacementNode.cloneNode(false)); - set(wrapper, 'data-mce-index', idx); - var textNode = pos.element.dom; - if (textNode.length === pos.finish && pos.start === 0) { - wrap(pos.element, wrapper); - } else { - if (textNode.length !== pos.finish) { - textNode.splitText(pos.finish); - } - var matchNode = textNode.splitText(pos.start); - wrap(SugarElement.fromDom(matchNode), wrapper); - } - }); + eachr(matches, function (match, idx) { + eachr(match, function (pos) { + var wrapper = SugarElement.fromDom(replacementNode.cloneNode(false)); + set(wrapper, 'data-mce-index', idx); + var textNode = pos.element.dom; + if (textNode.length === pos.finish && pos.start === 0) { + wrap(pos.element, wrapper); + } else { + if (textNode.length !== pos.finish) { + textNode.splitText(pos.finish); + } + var matchNode = textNode.splitText(pos.start); + wrap(SugarElement.fromDom(matchNode), wrapper); + } }); + }); }; var findAndMark = function (dom, pattern, node, replacementNode) { - var textSections = fromNode(dom, node); - var matches = find$1(pattern, textSections); - mark(matches, replacementNode); - return matches.length; + var textSections = fromNode(dom, node); + var matches = find$1(pattern, textSections); + mark(matches, replacementNode); + return matches.length; }; var findAndMarkInSelection = function (dom, pattern, selection, replacementNode) { - var bookmark = selection.getBookmark(); - var nodes = dom.select('td[data-mce-selected],th[data-mce-selected]'); - var textSections = nodes.length > 0 ? fromNodes(dom, nodes) : fromRng(dom, selection.getRng()); - var matches = find$1(pattern, textSections); - mark(matches, replacementNode); - selection.moveToBookmark(bookmark); - return matches.length; + var bookmark = selection.getBookmark(); + var nodes = dom.select('td[data-mce-selected],th[data-mce-selected]'); + var textSections = nodes.length > 0 ? fromNodes(dom, nodes) : fromRng(dom, selection.getRng()); + var matches = find$1(pattern, textSections); + mark(matches, replacementNode); + selection.moveToBookmark(bookmark); + return matches.length; }; var getElmIndex = function (elm) { - var value = elm.getAttribute('data-mce-index'); - if (typeof value === 'number') { - return '' + value; - } - return value; + var value = elm.getAttribute('data-mce-index'); + if (typeof value === 'number') { + return '' + value; + } + return value; }; var markAllMatches = function (editor, currentSearchState, pattern, inSelection) { - var marker = editor.dom.create('span', {'data-mce-bogus': 1}); - marker.className = 'mce-match-marker'; - var node = editor.getBody(); - done(editor, currentSearchState, false); - if (inSelection) { - return findAndMarkInSelection(editor.dom, pattern, editor.selection, marker); - } else { - return findAndMark(editor.dom, pattern, node, marker); - } + var marker = editor.dom.create('span', { 'data-mce-bogus': 1 }); + marker.className = 'mce-match-marker'; + var node = editor.getBody(); + done(editor, currentSearchState, false); + if (inSelection) { + return findAndMarkInSelection(editor.dom, pattern, editor.selection, marker); + } else { + return findAndMark(editor.dom, pattern, node, marker); + } }; var unwrap = function (node) { - var parentNode = node.parentNode; - if (node.firstChild) { - parentNode.insertBefore(node.firstChild, node); - } - node.parentNode.removeChild(node); + var parentNode = node.parentNode; + if (node.firstChild) { + parentNode.insertBefore(node.firstChild, node); + } + node.parentNode.removeChild(node); }; var findSpansByIndex = function (editor, index) { - var spans = []; - var nodes = global$1.toArray(editor.getBody().getElementsByTagName('span')); - if (nodes.length) { - for (var i = 0; i < nodes.length; i++) { - var nodeIndex = getElmIndex(nodes[i]); - if (nodeIndex === null || !nodeIndex.length) { - continue; - } - if (nodeIndex === index.toString()) { - spans.push(nodes[i]); - } - } + var spans = []; + var nodes = global$1.toArray(editor.getBody().getElementsByTagName('span')); + if (nodes.length) { + for (var i = 0; i < nodes.length; i++) { + var nodeIndex = getElmIndex(nodes[i]); + if (nodeIndex === null || !nodeIndex.length) { + continue; + } + if (nodeIndex === index.toString()) { + spans.push(nodes[i]); + } } - return spans; + } + return spans; }; var moveSelection = function (editor, currentSearchState, forward) { - var searchState = currentSearchState.get(); - var testIndex = searchState.index; - var dom = editor.dom; - forward = forward !== false; - if (forward) { - if (testIndex + 1 === searchState.count) { - testIndex = 0; - } else { - testIndex++; - } + var searchState = currentSearchState.get(); + var testIndex = searchState.index; + var dom = editor.dom; + forward = forward !== false; + if (forward) { + if (testIndex + 1 === searchState.count) { + testIndex = 0; } else { - if (testIndex - 1 === -1) { - testIndex = searchState.count - 1; - } else { - testIndex--; - } + testIndex++; } - dom.removeClass(findSpansByIndex(editor, searchState.index), 'mce-match-marker-selected'); - var spans = findSpansByIndex(editor, testIndex); - if (spans.length) { - dom.addClass(findSpansByIndex(editor, testIndex), 'mce-match-marker-selected'); - editor.selection.scrollIntoView(spans[0]); - return testIndex; + } else { + if (testIndex - 1 === -1) { + testIndex = searchState.count - 1; + } else { + testIndex--; } - return -1; + } + dom.removeClass(findSpansByIndex(editor, searchState.index), 'mce-match-marker-selected'); + var spans = findSpansByIndex(editor, testIndex); + if (spans.length) { + dom.addClass(findSpansByIndex(editor, testIndex), 'mce-match-marker-selected'); + editor.selection.scrollIntoView(spans[0]); + return testIndex; + } + return -1; }; var removeNode = function (dom, node) { - var parent = node.parentNode; - dom.remove(node); - if (dom.isEmpty(parent)) { - dom.remove(parent); - } + var parent = node.parentNode; + dom.remove(node); + if (dom.isEmpty(parent)) { + dom.remove(parent); + } }; var escapeSearchText = function (text, wholeWord) { - var escapedText = text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&').replace(/\s/g, '[^\\S\\r\\n\\uFEFF]'); - var wordRegex = '(' + escapedText + ')'; - return wholeWord ? '(?:^|\\s|' + punctuation$1() + ')' + wordRegex + ('(?=$|\\s|' + punctuation$1() + ')') : wordRegex; + var escapedText = text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&').replace(/\s/g, '[^\\S\\r\\n\\uFEFF]'); + var wordRegex = '(' + escapedText + ')'; + return wholeWord ? '(?:^|\\s|' + punctuation$1() + ')' + wordRegex + ('(?=$|\\s|' + punctuation$1() + ')') : wordRegex; }; var find$2 = function (editor, currentSearchState, text, matchCase, wholeWord, inSelection) { - var escapedText = escapeSearchText(text, wholeWord); - var pattern = { - regex: new RegExp(escapedText, matchCase ? 'g' : 'gi'), - matchIndex: 1 - }; - var count = markAllMatches(editor, currentSearchState, pattern, inSelection); - if (count) { - var newIndex = moveSelection(editor, currentSearchState, true); - currentSearchState.set({ - index: newIndex, - count: count, - text: text, - matchCase: matchCase, - wholeWord: wholeWord, - inSelection: inSelection - }); - } - return count; + var escapedText = escapeSearchText(text, wholeWord); + var pattern = { + regex: new RegExp(escapedText, matchCase ? 'g' : 'gi'), + matchIndex: 1 + }; + var count = markAllMatches(editor, currentSearchState, pattern, inSelection); + if (count) { + var newIndex = moveSelection(editor, currentSearchState, true); + currentSearchState.set({ + index: newIndex, + count: count, + text: text, + matchCase: matchCase, + wholeWord: wholeWord, + inSelection: inSelection + }); + } + return count; }; var next = function (editor, currentSearchState) { - var index = moveSelection(editor, currentSearchState, true); - currentSearchState.set(__assign(__assign({}, currentSearchState.get()), {index: index})); + var index = moveSelection(editor, currentSearchState, true); + currentSearchState.set(__assign(__assign({}, currentSearchState.get()), { index: index })); }; var prev = function (editor, currentSearchState) { - var index = moveSelection(editor, currentSearchState, false); - currentSearchState.set(__assign(__assign({}, currentSearchState.get()), {index: index})); + var index = moveSelection(editor, currentSearchState, false); + currentSearchState.set(__assign(__assign({}, currentSearchState.get()), { index: index })); }; var isMatchSpan = function (node) { - var matchIndex = getElmIndex(node); - return matchIndex !== null && matchIndex.length > 0; + var matchIndex = getElmIndex(node); + return matchIndex !== null && matchIndex.length > 0; }; var replace = function (editor, currentSearchState, text, forward, all) { - var searchState = currentSearchState.get(); - var currentIndex = searchState.index; - var currentMatchIndex, nextIndex = currentIndex; - forward = forward !== false; - var node = editor.getBody(); - var nodes = global$1.grep(global$1.toArray(node.getElementsByTagName('span')), isMatchSpan); - for (var i = 0; i < nodes.length; i++) { - var nodeIndex = getElmIndex(nodes[i]); - var matchIndex = currentMatchIndex = parseInt(nodeIndex, 10); - if (all || matchIndex === searchState.index) { - if (text.length) { - nodes[i].firstChild.nodeValue = text; - unwrap(nodes[i]); - } else { - removeNode(editor.dom, nodes[i]); - } - while (nodes[++i]) { - matchIndex = parseInt(getElmIndex(nodes[i]), 10); - if (matchIndex === currentMatchIndex) { - removeNode(editor.dom, nodes[i]); - } else { - i--; - break; - } - } - if (forward) { - nextIndex--; - } - } else if (currentMatchIndex > currentIndex) { - nodes[i].setAttribute('data-mce-index', String(currentMatchIndex - 1)); + var searchState = currentSearchState.get(); + var currentIndex = searchState.index; + var currentMatchIndex, nextIndex = currentIndex; + forward = forward !== false; + var node = editor.getBody(); + var nodes = global$1.grep(global$1.toArray(node.getElementsByTagName('span')), isMatchSpan); + for (var i = 0; i < nodes.length; i++) { + var nodeIndex = getElmIndex(nodes[i]); + var matchIndex = currentMatchIndex = parseInt(nodeIndex, 10); + if (all || matchIndex === searchState.index) { + if (text.length) { + nodes[i].firstChild.nodeValue = text; + unwrap(nodes[i]); + } else { + removeNode(editor.dom, nodes[i]); + } + while (nodes[++i]) { + matchIndex = parseInt(getElmIndex(nodes[i]), 10); + if (matchIndex === currentMatchIndex) { + removeNode(editor.dom, nodes[i]); + } else { + i--; + break; } + } + if (forward) { + nextIndex--; + } + } else if (currentMatchIndex > currentIndex) { + nodes[i].setAttribute('data-mce-index', String(currentMatchIndex - 1)); } - currentSearchState.set(__assign(__assign({}, searchState), { - count: all ? 0 : searchState.count - 1, - index: nextIndex - })); - if (forward) { - next(editor, currentSearchState); - } else { - prev(editor, currentSearchState); - } - return !all && currentSearchState.get().count > 0; + } + currentSearchState.set(__assign(__assign({}, searchState), { + count: all ? 0 : searchState.count - 1, + index: nextIndex + })); + if (forward) { + next(editor, currentSearchState); + } else { + prev(editor, currentSearchState); + } + return !all && currentSearchState.get().count > 0; }; var done = function (editor, currentSearchState, keepEditorSelection) { - var i, startContainer, endContainer; - var searchState = currentSearchState.get(); - var nodes = global$1.toArray(editor.getBody().getElementsByTagName('span')); - for (i = 0; i < nodes.length; i++) { - var nodeIndex = getElmIndex(nodes[i]); - if (nodeIndex !== null && nodeIndex.length) { - if (nodeIndex === searchState.index.toString()) { - if (!startContainer) { - startContainer = nodes[i].firstChild; - } - endContainer = nodes[i].firstChild; - } - unwrap(nodes[i]); + var i, startContainer, endContainer; + var searchState = currentSearchState.get(); + var nodes = global$1.toArray(editor.getBody().getElementsByTagName('span')); + for (i = 0; i < nodes.length; i++) { + var nodeIndex = getElmIndex(nodes[i]); + if (nodeIndex !== null && nodeIndex.length) { + if (nodeIndex === searchState.index.toString()) { + if (!startContainer) { + startContainer = nodes[i].firstChild; } + endContainer = nodes[i].firstChild; + } + unwrap(nodes[i]); } - currentSearchState.set(__assign(__assign({}, searchState), { - index: -1, - count: 0, - text: '' - })); - if (startContainer && endContainer) { - var rng = editor.dom.createRng(); - rng.setStart(startContainer, 0); - rng.setEnd(endContainer, endContainer.data.length); - if (keepEditorSelection !== false) { - editor.selection.setRng(rng); - } - return rng; + } + currentSearchState.set(__assign(__assign({}, searchState), { + index: -1, + count: 0, + text: '' + })); + if (startContainer && endContainer) { + var rng = editor.dom.createRng(); + rng.setStart(startContainer, 0); + rng.setEnd(endContainer, endContainer.data.length); + if (keepEditorSelection !== false) { + editor.selection.setRng(rng); } + return rng; + } }; var hasNext = function (editor, currentSearchState) { - return currentSearchState.get().count > 1; + return currentSearchState.get().count > 1; }; var hasPrev = function (editor, currentSearchState) { - return currentSearchState.get().count > 1; + return currentSearchState.get().count > 1; }; var get$1 = function (editor, currentState) { - var done$1 = function (keepEditorSelection) { - return done(editor, currentState, keepEditorSelection); - }; - var find = function (text, matchCase, wholeWord, inSelection) { - if (inSelection === void 0) { - inSelection = false; - } - return find$2(editor, currentState, text, matchCase, wholeWord, inSelection); - }; - var next$1 = function () { - return next(editor, currentState); - }; - var prev$1 = function () { - return prev(editor, currentState); - }; - var replace$1 = function (text, forward, all) { - return replace(editor, currentState, text, forward, all); - }; - return { - done: done$1, - find: find, - next: next$1, - prev: prev$1, - replace: replace$1 - }; + var done$1 = function (keepEditorSelection) { + return done(editor, currentState, keepEditorSelection); + }; + var find = function (text, matchCase, wholeWord, inSelection) { + if (inSelection === void 0) { + inSelection = false; + } + return find$2(editor, currentState, text, matchCase, wholeWord, inSelection); + }; + var next$1 = function () { + return next(editor, currentState); + }; + var prev$1 = function () { + return prev(editor, currentState); + }; + var replace$1 = function (text, forward, all) { + return replace(editor, currentState, text, forward, all); + }; + return { + done: done$1, + find: find, + next: next$1, + prev: prev$1, + replace: replace$1 + }; }; var value = function () { - var subject = Cell(Optional.none()); - var clear = function () { - return subject.set(Optional.none()); - }; - var set = function (s) { - return subject.set(Optional.some(s)); - }; - var isSet = function () { - return subject.get().isSome(); - }; - var on = function (f) { - return subject.get().each(f); - }; - return { - clear: clear, - set: set, - isSet: isSet, - on: on - }; + var subject = Cell(Optional.none()); + var clear = function () { + return subject.set(Optional.none()); + }; + var set = function (s) { + return subject.set(Optional.some(s)); + }; + var isSet = function () { + return subject.get().isSome(); + }; + var on = function (f) { + return subject.get().each(f); + }; + return { + clear: clear, + set: set, + isSet: isSet, + on: on + }; }; var global$3 = tinymce.util.Tools.resolve('tinymce.Env'); var open = function (editor, currentSearchState) { - var dialogApi = value(); - editor.undoManager.add(); - var selectedText = global$1.trim(editor.selection.getContent({format: 'text'})); - - function updateButtonStates(api) { - var updateNext = hasNext(editor, currentSearchState) ? api.enable : api.disable; - updateNext('next'); - var updatePrev = hasPrev(editor, currentSearchState) ? api.enable : api.disable; - updatePrev('prev'); + var dialogApi = value(); + editor.undoManager.add(); + var selectedText = global$1.trim(editor.selection.getContent({ format: 'text' })); + function updateButtonStates(api) { + var updateNext = hasNext(editor, currentSearchState) ? api.enable : api.disable; + updateNext('next'); + var updatePrev = hasPrev(editor, currentSearchState) ? api.enable : api.disable; + updatePrev('prev'); + } + var updateSearchState = function (api) { + var data = api.getData(); + var current = currentSearchState.get(); + currentSearchState.set(__assign(__assign({}, current), { + matchCase: data.matchcase, + wholeWord: data.wholewords, + inSelection: data.inselection + })); + }; + var disableAll = function (api, disable) { + var buttons = [ + 'replace', + 'replaceall', + 'prev', + 'next' + ]; + var toggle = disable ? api.disable : api.enable; + each(buttons, toggle); + }; + function notFoundAlert(api) { + editor.windowManager.alert('Could not find the specified string.', function () { + api.focus('findtext'); + }); + } + var focusButtonIfRequired = function (api, name) { + if (global$3.browser.isSafari() && global$3.deviceType.isTouch() && (name === 'find' || name === 'replace' || name === 'replaceall')) { + api.focus(name); } - - var updateSearchState = function (api) { - var data = api.getData(); - var current = currentSearchState.get(); - currentSearchState.set(__assign(__assign({}, current), { - matchCase: data.matchcase, - wholeWord: data.wholewords, - inSelection: data.inselection - })); - }; - var disableAll = function (api, disable) { - var buttons = [ - 'replace', - 'replaceall', - 'prev', - 'next' - ]; - var toggle = disable ? api.disable : api.enable; - each(buttons, toggle); - }; - - function notFoundAlert(api) { - editor.windowManager.alert('Could not find the specified string.', function () { - api.focus('findtext'); - }); + }; + var reset = function (api) { + done(editor, currentSearchState, false); + disableAll(api, true); + updateButtonStates(api); + }; + var doFind = function (api) { + var data = api.getData(); + var last = currentSearchState.get(); + if (!data.findtext.length) { + reset(api); + return; } - - var focusButtonIfRequired = function (api, name) { - if (global$3.browser.isSafari() && global$3.deviceType.isTouch() && (name === 'find' || name === 'replace' || name === 'replaceall')) { - api.focus(name); - } - }; - var reset = function (api) { - done(editor, currentSearchState, false); - disableAll(api, true); - updateButtonStates(api); - }; - var doFind = function (api) { - var data = api.getData(); - var last = currentSearchState.get(); - if (!data.findtext.length) { - reset(api); - return; - } - if (last.text === data.findtext && last.matchCase === data.matchcase && last.wholeWord === data.wholewords) { - next(editor, currentSearchState); - } else { - var count = find$2(editor, currentSearchState, data.findtext, data.matchcase, data.wholewords, data.inselection); - if (count <= 0) { - notFoundAlert(api); - } - disableAll(api, count === 0); - } - updateButtonStates(api); - }; - var initialState = currentSearchState.get(); - var initialData = { - findtext: selectedText, - replacetext: '', - wholewords: initialState.wholeWord, - matchcase: initialState.matchCase, - inselection: initialState.inSelection - }; - var spec = { - title: 'Find and Replace', - size: 'normal', - body: { - type: 'panel', - items: [ - { - type: 'bar', - items: [ - { - type: 'input', - name: 'findtext', - placeholder: 'Find', - maximized: true, - inputMode: 'search' - }, - { - type: 'button', - name: 'prev', - text: 'Previous', - icon: 'action-prev', - disabled: true, - borderless: true - }, - { - type: 'button', - name: 'next', - text: 'Next', - icon: 'action-next', - disabled: true, - borderless: true - } - ] - }, - { - type: 'input', - name: 'replacetext', - placeholder: 'Replace with', - inputMode: 'search' - } - ] - }, - buttons: [ - { - type: 'menu', - name: 'options', - icon: 'preferences', - tooltip: 'Preferences', - align: 'start', - items: [ - { - type: 'togglemenuitem', - name: 'matchcase', - text: 'Match case' - }, - { - type: 'togglemenuitem', - name: 'wholewords', - text: 'Find whole words only' - }, - { - type: 'togglemenuitem', - name: 'inselection', - text: 'Find in selection' - } - ] - }, + if (last.text === data.findtext && last.matchCase === data.matchcase && last.wholeWord === data.wholewords) { + next(editor, currentSearchState); + } else { + var count = find$2(editor, currentSearchState, data.findtext, data.matchcase, data.wholewords, data.inselection); + if (count <= 0) { + notFoundAlert(api); + } + disableAll(api, count === 0); + } + updateButtonStates(api); + }; + var initialState = currentSearchState.get(); + var initialData = { + findtext: selectedText, + replacetext: '', + wholewords: initialState.wholeWord, + matchcase: initialState.matchCase, + inselection: initialState.inSelection + }; + var spec = { + title: 'Find and Replace', + size: 'normal', + body: { + type: 'panel', + items: [ + { + type: 'bar', + items: [ { - type: 'custom', - name: 'find', - text: 'Find', - primary: true + type: 'input', + name: 'findtext', + placeholder: 'Find', + maximized: true, + inputMode: 'search' }, { - type: 'custom', - name: 'replace', - text: 'Replace', - disabled: true + type: 'button', + name: 'prev', + text: 'Previous', + icon: 'action-prev', + disabled: true, + borderless: true }, { - type: 'custom', - name: 'replaceall', - text: 'Replace All', - disabled: true - } - ], - initialData: initialData, - onChange: function (api, details) { - if (details.name === 'findtext' && currentSearchState.get().count > 0) { - reset(api); - } - }, - onAction: function (api, details) { - var data = api.getData(); - switch (details.name) { - case 'find': - doFind(api); - break; - case 'replace': - if (!replace(editor, currentSearchState, data.replacetext)) { - reset(api); - } else { - updateButtonStates(api); - } - break; - case 'replaceall': - replace(editor, currentSearchState, data.replacetext, true, true); - reset(api); - break; - case 'prev': - prev(editor, currentSearchState); - updateButtonStates(api); - break; - case 'next': - next(editor, currentSearchState); - updateButtonStates(api); - break; - case 'matchcase': - case 'wholewords': - case 'inselection': - updateSearchState(api); - reset(api); - break; + type: 'button', + name: 'next', + text: 'Next', + icon: 'action-next', + disabled: true, + borderless: true } - focusButtonIfRequired(api, details.name); - }, - onSubmit: function (api) { - doFind(api); - focusButtonIfRequired(api, 'find'); + ] }, - onClose: function () { - editor.focus(); - done(editor, currentSearchState); - editor.undoManager.add(); + { + type: 'input', + name: 'replacetext', + placeholder: 'Replace with', + inputMode: 'search' } - }; - dialogApi.set(editor.windowManager.open(spec, {inline: 'toolbar'})); + ] + }, + buttons: [ + { + type: 'menu', + name: 'options', + icon: 'preferences', + tooltip: 'Preferences', + align: 'start', + items: [ + { + type: 'togglemenuitem', + name: 'matchcase', + text: 'Match case' + }, + { + type: 'togglemenuitem', + name: 'wholewords', + text: 'Find whole words only' + }, + { + type: 'togglemenuitem', + name: 'inselection', + text: 'Find in selection' + } + ] + }, + { + type: 'custom', + name: 'find', + text: 'Find', + primary: true + }, + { + type: 'custom', + name: 'replace', + text: 'Replace', + disabled: true + }, + { + type: 'custom', + name: 'replaceall', + text: 'Replace All', + disabled: true + } + ], + initialData: initialData, + onChange: function (api, details) { + if (details.name === 'findtext' && currentSearchState.get().count > 0) { + reset(api); + } + }, + onAction: function (api, details) { + var data = api.getData(); + switch (details.name) { + case 'find': + doFind(api); + break; + case 'replace': + if (!replace(editor, currentSearchState, data.replacetext)) { + reset(api); + } else { + updateButtonStates(api); + } + break; + case 'replaceall': + replace(editor, currentSearchState, data.replacetext, true, true); + reset(api); + break; + case 'prev': + prev(editor, currentSearchState); + updateButtonStates(api); + break; + case 'next': + next(editor, currentSearchState); + updateButtonStates(api); + break; + case 'matchcase': + case 'wholewords': + case 'inselection': + updateSearchState(api); + reset(api); + break; + } + focusButtonIfRequired(api, details.name); + }, + onSubmit: function (api) { + doFind(api); + focusButtonIfRequired(api, 'find'); + }, + onClose: function () { + editor.focus(); + done(editor, currentSearchState); + editor.undoManager.add(); + } + }; + dialogApi.set(editor.windowManager.open(spec, { inline: 'toolbar' })); }; var register = function (editor, currentSearchState) { - editor.addCommand('SearchReplace', function () { - open(editor, currentSearchState); - }); + editor.addCommand('SearchReplace', function () { + open(editor, currentSearchState); + }); }; var showDialog = function (editor, currentSearchState) { - return function () { - open(editor, currentSearchState); - }; + return function () { + open(editor, currentSearchState); + }; }; var register$1 = function (editor, currentSearchState) { - editor.ui.registry.addMenuItem('searchreplace', { - text: 'Find and replace...', - shortcut: 'Meta+F', - onAction: showDialog(editor, currentSearchState), - icon: 'search' - }); - editor.ui.registry.addButton('searchreplace', { - tooltip: 'Find and replace', - onAction: showDialog(editor, currentSearchState), - icon: 'search' - }); - editor.shortcuts.add('Meta+F', '', showDialog(editor, currentSearchState)); + editor.ui.registry.addMenuItem('searchreplace', { + text: 'Find and replace...', + shortcut: 'Meta+F', + onAction: showDialog(editor, currentSearchState), + icon: 'search' + }); + editor.ui.registry.addButton('searchreplace', { + tooltip: 'Find and replace', + onAction: showDialog(editor, currentSearchState), + icon: 'search' + }); + editor.shortcuts.add('Meta+F', '', showDialog(editor, currentSearchState)); }; - function Plugin() { - global.add('searchreplace', function (editor) { - var currentSearchState = Cell({ - index: -1, - count: 0, - text: '', - matchCase: false, - wholeWord: false, - inSelection: false - }); - register(editor, currentSearchState); - register$1(editor, currentSearchState); - return get$1(editor, currentSearchState); + function Plugin () { + global.add('searchreplace', function (editor) { + var currentSearchState = Cell({ + index: -1, + count: 0, + text: '', + matchCase: false, + wholeWord: false, + inSelection: false }); + register(editor, currentSearchState); + register$1(editor, currentSearchState); + return get$1(editor, currentSearchState); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/spellchecker/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/spellchecker/plugin.js index 3c101e21..cd0b1f04 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/spellchecker/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/spellchecker/plugin.js @@ -10,40 +10,40 @@ 'use strict'; var Cell = function (initial) { - var value = initial; - var get = function () { - return value; - }; - var set = function (v) { - value = v; - }; - return { - get: get, - set: set - }; + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; }; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var hasProPlugin = function (editor) { - if (editor.hasPlugin('tinymcespellchecker', true)) { - if (typeof window.console !== 'undefined' && window.console.log) { - window.console.log('Spell Checker Pro is incompatible with Spell Checker plugin! ' + 'Remove \'spellchecker\' from the \'plugins\' option.'); - } - return true; - } else { - return false; + if (editor.hasPlugin('tinymcespellchecker', true)) { + if (typeof window.console !== 'undefined' && window.console.log) { + window.console.log('Spell Checker Pro is incompatible with Spell Checker plugin! ' + 'Remove \'spellchecker\' from the \'plugins\' option.'); } + return true; + } else { + return false; + } }; var hasOwnProperty = Object.hasOwnProperty; var isEmpty = function (r) { - for (var x in r) { - if (hasOwnProperty.call(r, x)) { - return false; - } + for (var x in r) { + if (hasOwnProperty.call(r, x)) { + return false; } - return true; + } + return true; }; var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); @@ -53,706 +53,683 @@ var global$3 = tinymce.util.Tools.resolve('tinymce.util.XHR'); var fireSpellcheckStart = function (editor) { - return editor.fire('SpellcheckStart'); + return editor.fire('SpellcheckStart'); }; var fireSpellcheckEnd = function (editor) { - return editor.fire('SpellcheckEnd'); + return editor.fire('SpellcheckEnd'); }; var getLanguages = function (editor) { - var defaultLanguages = 'English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv'; - return editor.getParam('spellchecker_languages', defaultLanguages); + var defaultLanguages = 'English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv'; + return editor.getParam('spellchecker_languages', defaultLanguages); }; var getLanguage = function (editor) { - var defaultLanguage = editor.getParam('language', 'en'); - return editor.getParam('spellchecker_language', defaultLanguage); + var defaultLanguage = editor.getParam('language', 'en'); + return editor.getParam('spellchecker_language', defaultLanguage); }; var getRpcUrl = function (editor) { - return editor.getParam('spellchecker_rpc_url'); + return editor.getParam('spellchecker_rpc_url'); }; var getSpellcheckerCallback = function (editor) { - return editor.getParam('spellchecker_callback'); + return editor.getParam('spellchecker_callback'); }; var getSpellcheckerWordcharPattern = function (editor) { - var defaultPattern = new RegExp('[^' + '\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`' + '\xA7\xA9\xAB\xAE\xB1\xB6\xB7\xB8\xBB' + '\xBC\xBD\xBE\xBF\xD7\xF7\xA4\u201D\u201C\u201E\xA0\u2002\u2003\u2009' + ']+', 'g'); - return editor.getParam('spellchecker_wordchar_pattern', defaultPattern); + var defaultPattern = new RegExp('[^' + '\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`' + '\xA7\xA9\xAB\xAE\xB1\xB6\xB7\xB8\xBB' + '\xBC\xBD\xBE\xBF\xD7\xF7\xA4\u201D\u201C\u201E\xA0\u2002\u2003\u2009' + ']+', 'g'); + return editor.getParam('spellchecker_wordchar_pattern', defaultPattern); }; function isContentEditableFalse(node) { - return node && node.nodeType === 1 && node.contentEditable === 'false'; + return node && node.nodeType === 1 && node.contentEditable === 'false'; } - var DomTextMatcher = function (node, editor) { - var m, matches = []; - var dom = editor.dom; - var blockElementsMap = editor.schema.getBlockElements(); - var hiddenTextElementsMap = editor.schema.getWhiteSpaceElements(); - var shortEndedElementsMap = editor.schema.getShortEndedElements(); - - function createMatch(m, data) { - if (!m[0]) { - throw new Error('findAndReplaceDOMText cannot handle zero-length matches'); - } - return { - start: m.index, - end: m.index + m[0].length, - text: m[0], - data: data - }; + var m, matches = []; + var dom = editor.dom; + var blockElementsMap = editor.schema.getBlockElements(); + var hiddenTextElementsMap = editor.schema.getWhiteSpaceElements(); + var shortEndedElementsMap = editor.schema.getShortEndedElements(); + function createMatch(m, data) { + if (!m[0]) { + throw new Error('findAndReplaceDOMText cannot handle zero-length matches'); } - - function getText(node) { - var txt; - if (node.nodeType === 3) { - return node.data; - } - if (hiddenTextElementsMap[node.nodeName] && !blockElementsMap[node.nodeName]) { - return ''; - } - if (isContentEditableFalse(node)) { - return '\n'; - } - txt = ''; - if (blockElementsMap[node.nodeName] || shortEndedElementsMap[node.nodeName]) { - txt += '\n'; - } - if (node = node.firstChild) { - do { - txt += getText(node); - } while (node = node.nextSibling); - } - return txt; + return { + start: m.index, + end: m.index + m[0].length, + text: m[0], + data: data + }; + } + function getText(node) { + var txt; + if (node.nodeType === 3) { + return node.data; } - - function stepThroughMatches(node, matches, replaceFn) { - var startNode, endNode, startNodeIndex, endNodeIndex, innerNodes = [], atIndex = 0, curNode = node, - matchLocation, matchIndex = 0; - matches = matches.slice(0); - matches.sort(function (a, b) { - return a.start - b.start; - }); - matchLocation = matches.shift(); - out: - while (true) { - if (blockElementsMap[curNode.nodeName] || shortEndedElementsMap[curNode.nodeName] || isContentEditableFalse(curNode)) { - atIndex++; - } - if (curNode.nodeType === 3) { - if (!endNode && curNode.length + atIndex >= matchLocation.end) { - endNode = curNode; - endNodeIndex = matchLocation.end - atIndex; - } else if (startNode) { - innerNodes.push(curNode); - } - if (!startNode && curNode.length + atIndex > matchLocation.start) { - startNode = curNode; - startNodeIndex = matchLocation.start - atIndex; - } - atIndex += curNode.length; - } - if (startNode && endNode) { - curNode = replaceFn({ - startNode: startNode, - startNodeIndex: startNodeIndex, - endNode: endNode, - endNodeIndex: endNodeIndex, - innerNodes: innerNodes, - match: matchLocation.text, - matchIndex: matchIndex - }); - atIndex -= endNode.length - endNodeIndex; - startNode = null; - endNode = null; - innerNodes = []; - matchLocation = matches.shift(); - matchIndex++; - if (!matchLocation) { - break; - } - } else if ((!hiddenTextElementsMap[curNode.nodeName] || blockElementsMap[curNode.nodeName]) && curNode.firstChild) { - if (!isContentEditableFalse(curNode)) { - curNode = curNode.firstChild; - continue; - } - } else if (curNode.nextSibling) { - curNode = curNode.nextSibling; - continue; - } - while (true) { - if (curNode.nextSibling) { - curNode = curNode.nextSibling; - break; - } else if (curNode.parentNode !== node) { - curNode = curNode.parentNode; - } else { - break out; - } - } - } + if (hiddenTextElementsMap[node.nodeName] && !blockElementsMap[node.nodeName]) { + return ''; } - - function genReplacer(callback) { - function makeReplacementNode(fill, matchIndex) { - var match = matches[matchIndex]; - if (!match.stencil) { - match.stencil = callback(match); - } - var clone = match.stencil.cloneNode(false); - clone.setAttribute('data-mce-index', matchIndex); - if (fill) { - clone.appendChild(dom.doc.createTextNode(fill)); - } - return clone; - } - - return function (range) { - var before; - var after; - var parentNode; - var startNode = range.startNode; - var endNode = range.endNode; - var matchIndex = range.matchIndex; - var doc = dom.doc; - if (startNode === endNode) { - var node_1 = startNode; - parentNode = node_1.parentNode; - if (range.startNodeIndex > 0) { - before = doc.createTextNode(node_1.data.substring(0, range.startNodeIndex)); - parentNode.insertBefore(before, node_1); - } - var el = makeReplacementNode(range.match, matchIndex); - parentNode.insertBefore(el, node_1); - if (range.endNodeIndex < node_1.length) { - after = doc.createTextNode(node_1.data.substring(range.endNodeIndex)); - parentNode.insertBefore(after, node_1); - } - node_1.parentNode.removeChild(node_1); - return el; - } - before = doc.createTextNode(startNode.data.substring(0, range.startNodeIndex)); - after = doc.createTextNode(endNode.data.substring(range.endNodeIndex)); - var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex); - for (var i = 0, l = range.innerNodes.length; i < l; ++i) { - var innerNode = range.innerNodes[i]; - var innerEl = makeReplacementNode(innerNode.data, matchIndex); - innerNode.parentNode.replaceChild(innerEl, innerNode); - } - var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex); - parentNode = startNode.parentNode; - parentNode.insertBefore(before, startNode); - parentNode.insertBefore(elA, startNode); - parentNode.removeChild(startNode); - parentNode = endNode.parentNode; - parentNode.insertBefore(elB, endNode); - parentNode.insertBefore(after, endNode); - parentNode.removeChild(endNode); - return elB; - }; + if (isContentEditableFalse(node)) { + return '\n'; } - - function unwrapElement(element) { - var parentNode = element.parentNode; - while (element.childNodes.length > 0) { - parentNode.insertBefore(element.childNodes[0], element); - } - parentNode.removeChild(element); + txt = ''; + if (blockElementsMap[node.nodeName] || shortEndedElementsMap[node.nodeName]) { + txt += '\n'; } - - function hasClass(elm) { - return elm.className.indexOf('mce-spellchecker-word') !== -1; + if (node = node.firstChild) { + do { + txt += getText(node); + } while (node = node.nextSibling); } - - function getWrappersByIndex(index) { - var elements = node.getElementsByTagName('*'), wrappers = []; - index = typeof index === 'number' ? '' + index : null; - for (var i = 0; i < elements.length; i++) { - var element = elements[i], dataIndex = element.getAttribute('data-mce-index'); - if (dataIndex !== null && dataIndex.length && hasClass(element)) { - if (dataIndex === index || index === null) { - wrappers.push(element); - } - } + return txt; + } + function stepThroughMatches(node, matches, replaceFn) { + var startNode, endNode, startNodeIndex, endNodeIndex, innerNodes = [], atIndex = 0, curNode = node, matchLocation, matchIndex = 0; + matches = matches.slice(0); + matches.sort(function (a, b) { + return a.start - b.start; + }); + matchLocation = matches.shift(); + out: + while (true) { + if (blockElementsMap[curNode.nodeName] || shortEndedElementsMap[curNode.nodeName] || isContentEditableFalse(curNode)) { + atIndex++; } - return wrappers; - } - - function indexOf(match) { - var i = matches.length; - while (i--) { - if (matches[i] === match) { - return i; - } + if (curNode.nodeType === 3) { + if (!endNode && curNode.length + atIndex >= matchLocation.end) { + endNode = curNode; + endNodeIndex = matchLocation.end - atIndex; + } else if (startNode) { + innerNodes.push(curNode); + } + if (!startNode && curNode.length + atIndex > matchLocation.start) { + startNode = curNode; + startNodeIndex = matchLocation.start - atIndex; + } + atIndex += curNode.length; } - return -1; - } - - function filter(callback) { - var filteredMatches = []; - each(function (match, i) { - if (callback(match, i)) { - filteredMatches.push(match); - } - }); - matches = filteredMatches; - return this; - } - - function each(callback) { - for (var i = 0, l = matches.length; i < l; i++) { - if (callback(matches[i], i) === false) { - break; - } + if (startNode && endNode) { + curNode = replaceFn({ + startNode: startNode, + startNodeIndex: startNodeIndex, + endNode: endNode, + endNodeIndex: endNodeIndex, + innerNodes: innerNodes, + match: matchLocation.text, + matchIndex: matchIndex + }); + atIndex -= endNode.length - endNodeIndex; + startNode = null; + endNode = null; + innerNodes = []; + matchLocation = matches.shift(); + matchIndex++; + if (!matchLocation) { + break; + } + } else if ((!hiddenTextElementsMap[curNode.nodeName] || blockElementsMap[curNode.nodeName]) && curNode.firstChild) { + if (!isContentEditableFalse(curNode)) { + curNode = curNode.firstChild; + continue; + } + } else if (curNode.nextSibling) { + curNode = curNode.nextSibling; + continue; } - return this; - } - - function wrap(callback) { - if (matches.length) { - stepThroughMatches(node, matches, genReplacer(callback)); + while (true) { + if (curNode.nextSibling) { + curNode = curNode.nextSibling; + break; + } else if (curNode.parentNode !== node) { + curNode = curNode.parentNode; + } else { + break out; + } } - return this; + } + } + function genReplacer(callback) { + function makeReplacementNode(fill, matchIndex) { + var match = matches[matchIndex]; + if (!match.stencil) { + match.stencil = callback(match); + } + var clone = match.stencil.cloneNode(false); + clone.setAttribute('data-mce-index', matchIndex); + if (fill) { + clone.appendChild(dom.doc.createTextNode(fill)); + } + return clone; } - - function find(regex, data) { - if (text && regex.global) { - while (m = regex.exec(text)) { - matches.push(createMatch(m, data)); - } + return function (range) { + var before; + var after; + var parentNode; + var startNode = range.startNode; + var endNode = range.endNode; + var matchIndex = range.matchIndex; + var doc = dom.doc; + if (startNode === endNode) { + var node_1 = startNode; + parentNode = node_1.parentNode; + if (range.startNodeIndex > 0) { + before = doc.createTextNode(node_1.data.substring(0, range.startNodeIndex)); + parentNode.insertBefore(before, node_1); + } + var el = makeReplacementNode(range.match, matchIndex); + parentNode.insertBefore(el, node_1); + if (range.endNodeIndex < node_1.length) { + after = doc.createTextNode(node_1.data.substring(range.endNodeIndex)); + parentNode.insertBefore(after, node_1); } - return this; + node_1.parentNode.removeChild(node_1); + return el; + } + before = doc.createTextNode(startNode.data.substring(0, range.startNodeIndex)); + after = doc.createTextNode(endNode.data.substring(range.endNodeIndex)); + var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex); + for (var i = 0, l = range.innerNodes.length; i < l; ++i) { + var innerNode = range.innerNodes[i]; + var innerEl = makeReplacementNode(innerNode.data, matchIndex); + innerNode.parentNode.replaceChild(innerEl, innerNode); + } + var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex); + parentNode = startNode.parentNode; + parentNode.insertBefore(before, startNode); + parentNode.insertBefore(elA, startNode); + parentNode.removeChild(startNode); + parentNode = endNode.parentNode; + parentNode.insertBefore(elB, endNode); + parentNode.insertBefore(after, endNode); + parentNode.removeChild(endNode); + return elB; + }; + } + function unwrapElement(element) { + var parentNode = element.parentNode; + while (element.childNodes.length > 0) { + parentNode.insertBefore(element.childNodes[0], element); } - - function unwrap(match) { - var i; - var elements = getWrappersByIndex(match ? indexOf(match) : null); - i = elements.length; - while (i--) { - unwrapElement(elements[i]); + parentNode.removeChild(element); + } + function hasClass(elm) { + return elm.className.indexOf('mce-spellchecker-word') !== -1; + } + function getWrappersByIndex(index) { + var elements = node.getElementsByTagName('*'), wrappers = []; + index = typeof index === 'number' ? '' + index : null; + for (var i = 0; i < elements.length; i++) { + var element = elements[i], dataIndex = element.getAttribute('data-mce-index'); + if (dataIndex !== null && dataIndex.length && hasClass(element)) { + if (dataIndex === index || index === null) { + wrappers.push(element); } - return this; + } } - - function matchFromElement(element) { - return matches[element.getAttribute('data-mce-index')]; + return wrappers; + } + function indexOf(match) { + var i = matches.length; + while (i--) { + if (matches[i] === match) { + return i; + } } - - function elementFromMatch(match) { - return getWrappersByIndex(indexOf(match))[0]; + return -1; + } + function filter(callback) { + var filteredMatches = []; + each(function (match, i) { + if (callback(match, i)) { + filteredMatches.push(match); + } + }); + matches = filteredMatches; + return this; + } + function each(callback) { + for (var i = 0, l = matches.length; i < l; i++) { + if (callback(matches[i], i) === false) { + break; + } } - - function add(start, length, data) { - matches.push({ - start: start, - end: start + length, - text: text.substr(start, length), - data: data - }); - return this; + return this; + } + function wrap(callback) { + if (matches.length) { + stepThroughMatches(node, matches, genReplacer(callback)); } - - function rangeFromMatch(match) { - var wrappers = getWrappersByIndex(indexOf(match)); - var rng = editor.dom.createRng(); - rng.setStartBefore(wrappers[0]); - rng.setEndAfter(wrappers[wrappers.length - 1]); - return rng; + return this; + } + function find(regex, data) { + if (text && regex.global) { + while (m = regex.exec(text)) { + matches.push(createMatch(m, data)); + } } - - function replace(match, text) { - var rng = rangeFromMatch(match); - rng.deleteContents(); - if (text.length > 0) { - rng.insertNode(editor.dom.doc.createTextNode(text)); - } - return rng; + return this; + } + function unwrap(match) { + var i; + var elements = getWrappersByIndex(match ? indexOf(match) : null); + i = elements.length; + while (i--) { + unwrapElement(elements[i]); } - - function reset() { - matches.splice(0, matches.length); - unwrap(); - return this; + return this; + } + function matchFromElement(element) { + return matches[element.getAttribute('data-mce-index')]; + } + function elementFromMatch(match) { + return getWrappersByIndex(indexOf(match))[0]; + } + function add(start, length, data) { + matches.push({ + start: start, + end: start + length, + text: text.substr(start, length), + data: data + }); + return this; + } + function rangeFromMatch(match) { + var wrappers = getWrappersByIndex(indexOf(match)); + var rng = editor.dom.createRng(); + rng.setStartBefore(wrappers[0]); + rng.setEndAfter(wrappers[wrappers.length - 1]); + return rng; + } + function replace(match, text) { + var rng = rangeFromMatch(match); + rng.deleteContents(); + if (text.length > 0) { + rng.insertNode(editor.dom.doc.createTextNode(text)); } - - var text = getText(node); - return { - text: text, - matches: matches, - each: each, - filter: filter, - reset: reset, - matchFromElement: matchFromElement, - elementFromMatch: elementFromMatch, - find: find, - add: add, - wrap: wrap, - unwrap: unwrap, - replace: replace, - rangeFromMatch: rangeFromMatch, - indexOf: indexOf - }; + return rng; + } + function reset() { + matches.splice(0, matches.length); + unwrap(); + return this; + } + var text = getText(node); + return { + text: text, + matches: matches, + each: each, + filter: filter, + reset: reset, + matchFromElement: matchFromElement, + elementFromMatch: elementFromMatch, + find: find, + add: add, + wrap: wrap, + unwrap: unwrap, + replace: replace, + rangeFromMatch: rangeFromMatch, + indexOf: indexOf + }; }; var getTextMatcher = function (editor, textMatcherState) { - if (!textMatcherState.get()) { - var textMatcher = DomTextMatcher(editor.getBody(), editor); - textMatcherState.set(textMatcher); - } - return textMatcherState.get(); + if (!textMatcherState.get()) { + var textMatcher = DomTextMatcher(editor.getBody(), editor); + textMatcherState.set(textMatcher); + } + return textMatcherState.get(); }; var defaultSpellcheckCallback = function (editor, pluginUrl, currentLanguageState) { - return function (method, text, doneCallback, errorCallback) { - var data = { - method: method, - lang: currentLanguageState.get() - }; - var postData = ''; - data[method === 'addToDictionary' ? 'word' : 'text'] = text; - global$1.each(data, function (value, key) { - if (postData) { - postData += '&'; - } - postData += key + '=' + encodeURIComponent(value); - }); - global$3.send({ - url: new global$2(pluginUrl).toAbsolute(getRpcUrl(editor)), - type: 'post', - content_type: 'application/x-www-form-urlencoded', - data: postData, - success: function (result) { - var parseResult = JSON.parse(result); - if (!parseResult) { - var message = editor.translate('Server response wasn\'t proper JSON.'); - errorCallback(message); - } else if (parseResult.error) { - errorCallback(parseResult.error); - } else { - doneCallback(parseResult); - } - }, - error: function () { - var message = editor.translate('The spelling service was not found: (') + getRpcUrl(editor) + editor.translate(')'); - errorCallback(message); - } - }); + return function (method, text, doneCallback, errorCallback) { + var data = { + method: method, + lang: currentLanguageState.get() }; + var postData = ''; + data[method === 'addToDictionary' ? 'word' : 'text'] = text; + global$1.each(data, function (value, key) { + if (postData) { + postData += '&'; + } + postData += key + '=' + encodeURIComponent(value); + }); + global$3.send({ + url: new global$2(pluginUrl).toAbsolute(getRpcUrl(editor)), + type: 'post', + content_type: 'application/x-www-form-urlencoded', + data: postData, + success: function (result) { + var parseResult = JSON.parse(result); + if (!parseResult) { + var message = editor.translate('Server response wasn\'t proper JSON.'); + errorCallback(message); + } else if (parseResult.error) { + errorCallback(parseResult.error); + } else { + doneCallback(parseResult); + } + }, + error: function () { + var message = editor.translate('The spelling service was not found: (') + getRpcUrl(editor) + editor.translate(')'); + errorCallback(message); + } + }); + }; }; var sendRpcCall = function (editor, pluginUrl, currentLanguageState, name, data, successCallback, errorCallback) { - var userSpellcheckCallback = getSpellcheckerCallback(editor); - var spellCheckCallback = userSpellcheckCallback ? userSpellcheckCallback : defaultSpellcheckCallback(editor, pluginUrl, currentLanguageState); - spellCheckCallback.call(editor.plugins.spellchecker, name, data, successCallback, errorCallback); + var userSpellcheckCallback = getSpellcheckerCallback(editor); + var spellCheckCallback = userSpellcheckCallback ? userSpellcheckCallback : defaultSpellcheckCallback(editor, pluginUrl, currentLanguageState); + spellCheckCallback.call(editor.plugins.spellchecker, name, data, successCallback, errorCallback); }; var spellcheck = function (editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState) { - if (finish(editor, startedState, textMatcherState)) { - return; - } - var errorCallback = function (message) { - editor.notificationManager.open({ - text: message, - type: 'error' - }); - editor.setProgressState(false); - finish(editor, startedState, textMatcherState); - }; - var successCallback = function (data) { - markErrors(editor, startedState, textMatcherState, lastSuggestionsState, data); - }; - editor.setProgressState(true); - sendRpcCall(editor, pluginUrl, currentLanguageState, 'spellcheck', getTextMatcher(editor, textMatcherState).text, successCallback, errorCallback); - editor.focus(); + if (finish(editor, startedState, textMatcherState)) { + return; + } + var errorCallback = function (message) { + editor.notificationManager.open({ + text: message, + type: 'error' + }); + editor.setProgressState(false); + finish(editor, startedState, textMatcherState); + }; + var successCallback = function (data) { + markErrors(editor, startedState, textMatcherState, lastSuggestionsState, data); + }; + editor.setProgressState(true); + sendRpcCall(editor, pluginUrl, currentLanguageState, 'spellcheck', getTextMatcher(editor, textMatcherState).text, successCallback, errorCallback); + editor.focus(); }; var checkIfFinished = function (editor, startedState, textMatcherState) { - if (!editor.dom.select('span.mce-spellchecker-word').length) { - finish(editor, startedState, textMatcherState); - } + if (!editor.dom.select('span.mce-spellchecker-word').length) { + finish(editor, startedState, textMatcherState); + } }; var addToDictionary = function (editor, pluginUrl, startedState, textMatcherState, currentLanguageState, word, spans) { - editor.setProgressState(true); - sendRpcCall(editor, pluginUrl, currentLanguageState, 'addToDictionary', word, function () { - editor.setProgressState(false); - editor.dom.remove(spans, true); - checkIfFinished(editor, startedState, textMatcherState); - }, function (message) { - editor.notificationManager.open({ - text: message, - type: 'error' - }); - editor.setProgressState(false); + editor.setProgressState(true); + sendRpcCall(editor, pluginUrl, currentLanguageState, 'addToDictionary', word, function () { + editor.setProgressState(false); + editor.dom.remove(spans, true); + checkIfFinished(editor, startedState, textMatcherState); + }, function (message) { + editor.notificationManager.open({ + text: message, + type: 'error' }); + editor.setProgressState(false); + }); }; var ignoreWord = function (editor, startedState, textMatcherState, word, spans, all) { - editor.selection.collapse(); - if (all) { - global$1.each(editor.dom.select('span.mce-spellchecker-word'), function (span) { - if (span.getAttribute('data-mce-word') === word) { - editor.dom.remove(span, true); - } - }); - } else { - editor.dom.remove(spans, true); - } - checkIfFinished(editor, startedState, textMatcherState); + editor.selection.collapse(); + if (all) { + global$1.each(editor.dom.select('span.mce-spellchecker-word'), function (span) { + if (span.getAttribute('data-mce-word') === word) { + editor.dom.remove(span, true); + } + }); + } else { + editor.dom.remove(spans, true); + } + checkIfFinished(editor, startedState, textMatcherState); }; var finish = function (editor, startedState, textMatcherState) { - var bookmark = editor.selection.getBookmark(); - getTextMatcher(editor, textMatcherState).reset(); - editor.selection.moveToBookmark(bookmark); - textMatcherState.set(null); - if (startedState.get()) { - startedState.set(false); - fireSpellcheckEnd(editor); - return true; - } + var bookmark = editor.selection.getBookmark(); + getTextMatcher(editor, textMatcherState).reset(); + editor.selection.moveToBookmark(bookmark); + textMatcherState.set(null); + if (startedState.get()) { + startedState.set(false); + fireSpellcheckEnd(editor); + return true; + } }; var getElmIndex = function (elm) { - var value = elm.getAttribute('data-mce-index'); - if (typeof value === 'number') { - return '' + value; - } - return value; + var value = elm.getAttribute('data-mce-index'); + if (typeof value === 'number') { + return '' + value; + } + return value; }; var findSpansByIndex = function (editor, index) { - var spans = []; - var nodes = global$1.toArray(editor.getBody().getElementsByTagName('span')); - if (nodes.length) { - for (var i = 0; i < nodes.length; i++) { - var nodeIndex = getElmIndex(nodes[i]); - if (nodeIndex === null || !nodeIndex.length) { - continue; - } - if (nodeIndex === index.toString()) { - spans.push(nodes[i]); - } - } + var spans = []; + var nodes = global$1.toArray(editor.getBody().getElementsByTagName('span')); + if (nodes.length) { + for (var i = 0; i < nodes.length; i++) { + var nodeIndex = getElmIndex(nodes[i]); + if (nodeIndex === null || !nodeIndex.length) { + continue; + } + if (nodeIndex === index.toString()) { + spans.push(nodes[i]); + } } - return spans; + } + return spans; }; var markErrors = function (editor, startedState, textMatcherState, lastSuggestionsState, data) { - var hasDictionarySupport = !!data.dictionary; - var suggestions = data.words; - editor.setProgressState(false); - if (isEmpty(suggestions)) { - var message = editor.translate('No misspellings found.'); - editor.notificationManager.open({ - text: message, - type: 'info' - }); - startedState.set(false); - return; - } - lastSuggestionsState.set({ - suggestions: suggestions, - hasDictionarySupport: hasDictionarySupport + var hasDictionarySupport = !!data.dictionary; + var suggestions = data.words; + editor.setProgressState(false); + if (isEmpty(suggestions)) { + var message = editor.translate('No misspellings found.'); + editor.notificationManager.open({ + text: message, + type: 'info' }); - var bookmark = editor.selection.getBookmark(); - getTextMatcher(editor, textMatcherState).find(getSpellcheckerWordcharPattern(editor)).filter(function (match) { - return !!suggestions[match.text]; - }).wrap(function (match) { - return editor.dom.create('span', { - 'class': 'mce-spellchecker-word', - 'aria-invalid': 'spelling', - 'data-mce-bogus': 1, - 'data-mce-word': match.text - }); + startedState.set(false); + return; + } + lastSuggestionsState.set({ + suggestions: suggestions, + hasDictionarySupport: hasDictionarySupport + }); + var bookmark = editor.selection.getBookmark(); + getTextMatcher(editor, textMatcherState).find(getSpellcheckerWordcharPattern(editor)).filter(function (match) { + return !!suggestions[match.text]; + }).wrap(function (match) { + return editor.dom.create('span', { + 'class': 'mce-spellchecker-word', + 'aria-invalid': 'spelling', + 'data-mce-bogus': 1, + 'data-mce-word': match.text }); - editor.selection.moveToBookmark(bookmark); - startedState.set(true); - fireSpellcheckStart(editor); + }); + editor.selection.moveToBookmark(bookmark); + startedState.set(true); + fireSpellcheckStart(editor); }; var get = function (editor, startedState, lastSuggestionsState, textMatcherState, currentLanguageState, _url) { - var getLanguage = function () { - return currentLanguageState.get(); - }; - var getWordCharPattern = function () { - return getSpellcheckerWordcharPattern(editor); - }; - var markErrors$1 = function (data) { - markErrors(editor, startedState, textMatcherState, lastSuggestionsState, data); - }; - var getTextMatcher = function () { - return textMatcherState.get(); - }; - return { - getTextMatcher: getTextMatcher, - getWordCharPattern: getWordCharPattern, - markErrors: markErrors$1, - getLanguage: getLanguage - }; + var getLanguage = function () { + return currentLanguageState.get(); + }; + var getWordCharPattern = function () { + return getSpellcheckerWordcharPattern(editor); + }; + var markErrors$1 = function (data) { + markErrors(editor, startedState, textMatcherState, lastSuggestionsState, data); + }; + var getTextMatcher = function () { + return textMatcherState.get(); + }; + return { + getTextMatcher: getTextMatcher, + getWordCharPattern: getWordCharPattern, + markErrors: markErrors$1, + getLanguage: getLanguage + }; }; var register = function (editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState) { - editor.addCommand('mceSpellCheck', function () { - spellcheck(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState); - }); + editor.addCommand('mceSpellCheck', function () { + spellcheck(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState); + }); }; var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); }; var spellcheckerEvents = 'SpellcheckStart SpellcheckEnd'; var buildMenuItems = function (listName, languageValues) { - var items = []; - global$1.each(languageValues, function (languageValue) { - items.push({ - selectable: true, - text: languageValue.name, - data: languageValue.value - }); + var items = []; + global$1.each(languageValues, function (languageValue) { + items.push({ + selectable: true, + text: languageValue.name, + data: languageValue.value }); - return items; + }); + return items; }; var getItems = function (editor) { - return global$1.map(getLanguages(editor).split(','), function (langPair) { - var langPairs = langPair.split('='); - return { - name: langPairs[0], - value: langPairs[1] - }; - }); + return global$1.map(getLanguages(editor).split(','), function (langPair) { + var langPairs = langPair.split('='); + return { + name: langPairs[0], + value: langPairs[1] + }; + }); }; var register$1 = function (editor, pluginUrl, startedState, textMatcherState, currentLanguageState, lastSuggestionsState) { - var languageMenuItems = buildMenuItems('Language', getItems(editor)); - var startSpellchecking = function () { - spellcheck(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState); - }; - var buttonArgs = { - tooltip: 'Spellcheck', - onAction: startSpellchecking, - icon: 'spell-check', - onSetup: function (buttonApi) { - var setButtonState = function () { - buttonApi.setActive(startedState.get()); - }; - editor.on(spellcheckerEvents, setButtonState); - return function () { - editor.off(spellcheckerEvents, setButtonState); - }; - } - }; - var splitButtonArgs = __assign(__assign({}, buttonArgs), { - type: 'splitbutton', - select: function (value) { - return value === currentLanguageState.get(); - }, - fetch: function (callback) { - var items = global$1.map(languageMenuItems, function (languageItem) { - return { - type: 'choiceitem', - value: languageItem.data, - text: languageItem.text - }; - }); - callback(items); - }, - onItemAction: function (splitButtonApi, value) { - currentLanguageState.set(value); - } - }); - if (languageMenuItems.length > 1) { - editor.ui.registry.addSplitButton('spellchecker', splitButtonArgs); - } else { - editor.ui.registry.addToggleButton('spellchecker', buttonArgs); + var languageMenuItems = buildMenuItems('Language', getItems(editor)); + var startSpellchecking = function () { + spellcheck(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState); + }; + var buttonArgs = { + tooltip: 'Spellcheck', + onAction: startSpellchecking, + icon: 'spell-check', + onSetup: function (buttonApi) { + var setButtonState = function () { + buttonApi.setActive(startedState.get()); + }; + editor.on(spellcheckerEvents, setButtonState); + return function () { + editor.off(spellcheckerEvents, setButtonState); + }; } - editor.ui.registry.addToggleMenuItem('spellchecker', { - text: 'Spellcheck', - icon: 'spell-check', - onSetup: function (menuApi) { - menuApi.setActive(startedState.get()); - var setMenuItemCheck = function () { - menuApi.setActive(startedState.get()); - }; - editor.on(spellcheckerEvents, setMenuItemCheck); - return function () { - editor.off(spellcheckerEvents, setMenuItemCheck); - }; - }, - onAction: startSpellchecking - }); + }; + var splitButtonArgs = __assign(__assign({}, buttonArgs), { + type: 'splitbutton', + select: function (value) { + return value === currentLanguageState.get(); + }, + fetch: function (callback) { + var items = global$1.map(languageMenuItems, function (languageItem) { + return { + type: 'choiceitem', + value: languageItem.data, + text: languageItem.text + }; + }); + callback(items); + }, + onItemAction: function (splitButtonApi, value) { + currentLanguageState.set(value); + } + }); + if (languageMenuItems.length > 1) { + editor.ui.registry.addSplitButton('spellchecker', splitButtonArgs); + } else { + editor.ui.registry.addToggleButton('spellchecker', buttonArgs); + } + editor.ui.registry.addToggleMenuItem('spellchecker', { + text: 'Spellcheck', + icon: 'spell-check', + onSetup: function (menuApi) { + menuApi.setActive(startedState.get()); + var setMenuItemCheck = function () { + menuApi.setActive(startedState.get()); + }; + editor.on(spellcheckerEvents, setMenuItemCheck); + return function () { + editor.off(spellcheckerEvents, setMenuItemCheck); + }; + }, + onAction: startSpellchecking + }); }; var ignoreAll = true; var getSuggestions = function (editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState, word, spans) { - var items = []; - var suggestions = lastSuggestionsState.get().suggestions[word]; - global$1.each(suggestions, function (suggestion) { - items.push({ - text: suggestion, - onAction: function () { - editor.insertContent(editor.dom.encode(suggestion)); - editor.dom.remove(spans); - checkIfFinished(editor, startedState, textMatcherState); - } - }); + var items = []; + var suggestions = lastSuggestionsState.get().suggestions[word]; + global$1.each(suggestions, function (suggestion) { + items.push({ + text: suggestion, + onAction: function () { + editor.insertContent(editor.dom.encode(suggestion)); + editor.dom.remove(spans); + checkIfFinished(editor, startedState, textMatcherState); + } }); - var hasDictionarySupport = lastSuggestionsState.get().hasDictionarySupport; - if (hasDictionarySupport) { - items.push({type: 'separator'}); - items.push({ - text: 'Add to dictionary', - onAction: function () { - addToDictionary(editor, pluginUrl, startedState, textMatcherState, currentLanguageState, word, spans); - } - }); + }); + var hasDictionarySupport = lastSuggestionsState.get().hasDictionarySupport; + if (hasDictionarySupport) { + items.push({ type: 'separator' }); + items.push({ + text: 'Add to dictionary', + onAction: function () { + addToDictionary(editor, pluginUrl, startedState, textMatcherState, currentLanguageState, word, spans); + } + }); + } + items.push.apply(items, [ + { type: 'separator' }, + { + text: 'Ignore', + onAction: function () { + ignoreWord(editor, startedState, textMatcherState, word, spans); + } + }, + { + text: 'Ignore all', + onAction: function () { + ignoreWord(editor, startedState, textMatcherState, word, spans, ignoreAll); + } } - items.push.apply(items, [ - {type: 'separator'}, - { - text: 'Ignore', - onAction: function () { - ignoreWord(editor, startedState, textMatcherState, word, spans); - } - }, - { - text: 'Ignore all', - onAction: function () { - ignoreWord(editor, startedState, textMatcherState, word, spans, ignoreAll); - } - } - ]); - return items; + ]); + return items; }; var setup = function (editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState) { - var update = function (element) { - var target = element; - if (target.className === 'mce-spellchecker-word') { - var spans = findSpansByIndex(editor, getElmIndex(target)); - if (spans.length > 0) { - var rng = editor.dom.createRng(); - rng.setStartBefore(spans[0]); - rng.setEndAfter(spans[spans.length - 1]); - editor.selection.setRng(rng); - return getSuggestions(editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState, target.getAttribute('data-mce-word'), spans); - } - } else { - return []; - } - }; - editor.ui.registry.addContextMenu('spellchecker', {update: update}); + var update = function (element) { + var target = element; + if (target.className === 'mce-spellchecker-word') { + var spans = findSpansByIndex(editor, getElmIndex(target)); + if (spans.length > 0) { + var rng = editor.dom.createRng(); + rng.setStartBefore(spans[0]); + rng.setEndAfter(spans[spans.length - 1]); + editor.selection.setRng(rng); + return getSuggestions(editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState, target.getAttribute('data-mce-word'), spans); + } + } else { + return []; + } + }; + editor.ui.registry.addContextMenu('spellchecker', { update: update }); }; - function Plugin() { - global.add('spellchecker', function (editor, pluginUrl) { - if (hasProPlugin(editor) === false) { - var startedState = Cell(false); - var currentLanguageState = Cell(getLanguage(editor)); - var textMatcherState = Cell(null); - var lastSuggestionsState = Cell(null); - register$1(editor, pluginUrl, startedState, textMatcherState, currentLanguageState, lastSuggestionsState); - setup(editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState); - register(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState); - return get(editor, startedState, lastSuggestionsState, textMatcherState, currentLanguageState); - } - }); + function Plugin () { + global.add('spellchecker', function (editor, pluginUrl) { + if (hasProPlugin(editor) === false) { + var startedState = Cell(false); + var currentLanguageState = Cell(getLanguage(editor)); + var textMatcherState = Cell(null); + var lastSuggestionsState = Cell(null); + register$1(editor, pluginUrl, startedState, textMatcherState, currentLanguageState, lastSuggestionsState); + setup(editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState); + register(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState); + return get(editor, startedState, lastSuggestionsState, textMatcherState, currentLanguageState); + } + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/tabfocus/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/tabfocus/plugin.js index a5f0c57c..52d85aa5 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/tabfocus/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/tabfocus/plugin.js @@ -24,110 +24,104 @@ var global$6 = tinymce.util.Tools.resolve('tinymce.util.VK'); var getTabFocusElements = function (editor) { - return editor.getParam('tabfocus_elements', ':prev,:next'); + return editor.getParam('tabfocus_elements', ':prev,:next'); }; var getTabFocus = function (editor) { - return editor.getParam('tab_focus', getTabFocusElements(editor)); + return editor.getParam('tab_focus', getTabFocusElements(editor)); }; var DOM = global$1.DOM; var tabCancel = function (e) { - if (e.keyCode === global$6.TAB && !e.ctrlKey && !e.altKey && !e.metaKey) { - e.preventDefault(); - } + if (e.keyCode === global$6.TAB && !e.ctrlKey && !e.altKey && !e.metaKey) { + e.preventDefault(); + } }; var setup = function (editor) { - function tabHandler(e) { - var x, i; - if (e.keyCode !== global$6.TAB || e.ctrlKey || e.altKey || e.metaKey || e.isDefaultPrevented()) { - return; - } - - function find(direction) { - var el = DOM.select(':input:enabled,*[tabindex]:not(iframe)'); - - function canSelectRecursive(e) { - return e.nodeName === 'BODY' || e.type !== 'hidden' && e.style.display !== 'none' && e.style.visibility !== 'hidden' && canSelectRecursive(e.parentNode); - } - - function canSelect(el) { - return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && global$2.get(e.id) && el.tabIndex !== -1 && canSelectRecursive(el); - } - - global$5.each(el, function (e, i) { - if (e.id === editor.id) { - x = i; - return false; - } - }); - if (direction > 0) { - for (i = x + 1; i < el.length; i++) { - if (canSelect(el[i])) { - return el[i]; - } - } - } else { - for (i = x - 1; i >= 0; i--) { - if (canSelect(el[i])) { - return el[i]; - } - } - } - return null; - } - - var v = global$5.explode(getTabFocus(editor)); - if (v.length === 1) { - v[1] = v[0]; - v[0] = ':prev'; + function tabHandler(e) { + var x, i; + if (e.keyCode !== global$6.TAB || e.ctrlKey || e.altKey || e.metaKey || e.isDefaultPrevented()) { + return; + } + function find(direction) { + var el = DOM.select(':input:enabled,*[tabindex]:not(iframe)'); + function canSelectRecursive(e) { + return e.nodeName === 'BODY' || e.type !== 'hidden' && e.style.display !== 'none' && e.style.visibility !== 'hidden' && canSelectRecursive(e.parentNode); + } + function canSelect(el) { + return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && global$2.get(e.id) && el.tabIndex !== -1 && canSelectRecursive(el); + } + global$5.each(el, function (e, i) { + if (e.id === editor.id) { + x = i; + return false; } - var el; - if (e.shiftKey) { - if (v[0] === ':prev') { - el = find(-1); - } else { - el = DOM.get(v[0]); - } - } else { - if (v[1] === ':next') { - el = find(1); - } else { - el = DOM.get(v[1]); - } + }); + if (direction > 0) { + for (i = x + 1; i < el.length; i++) { + if (canSelect(el[i])) { + return el[i]; + } } - if (el) { - var focusEditor = global$2.get(el.id || el.name); - if (el.id && focusEditor) { - focusEditor.focus(); - } else { - global$4.setTimeout(function () { - if (!global$3.webkit) { - window.focus(); - } - el.focus(); - }, 10); - } - e.preventDefault(); + } else { + for (i = x - 1; i >= 0; i--) { + if (canSelect(el[i])) { + return el[i]; + } } + } + return null; } - - editor.on('init', function () { - if (editor.inline) { - DOM.setAttrib(editor.getBody(), 'tabIndex', null); - } - editor.on('keyup', tabCancel); - if (global$3.gecko) { - editor.on('keypress keydown', tabHandler); - } else { - editor.on('keydown', tabHandler); - } - }); + var v = global$5.explode(getTabFocus(editor)); + if (v.length === 1) { + v[1] = v[0]; + v[0] = ':prev'; + } + var el; + if (e.shiftKey) { + if (v[0] === ':prev') { + el = find(-1); + } else { + el = DOM.get(v[0]); + } + } else { + if (v[1] === ':next') { + el = find(1); + } else { + el = DOM.get(v[1]); + } + } + if (el) { + var focusEditor = global$2.get(el.id || el.name); + if (el.id && focusEditor) { + focusEditor.focus(); + } else { + global$4.setTimeout(function () { + if (!global$3.webkit) { + window.focus(); + } + el.focus(); + }, 10); + } + e.preventDefault(); + } + } + editor.on('init', function () { + if (editor.inline) { + DOM.setAttrib(editor.getBody(), 'tabIndex', null); + } + editor.on('keyup', tabCancel); + if (global$3.gecko) { + editor.on('keypress keydown', tabHandler); + } else { + editor.on('keydown', tabHandler); + } + }); }; - function Plugin() { - global.add('tabfocus', function (editor) { - setup(editor); - }); + function Plugin () { + global.add('tabfocus', function (editor) { + setup(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/table/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/table/plugin.js index 36902f53..6e6262a2 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/table/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/table/plugin.js @@ -12,188 +12,186 @@ var noop = function () { }; var compose = function (fa, fb) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return fa(fb.apply(null, args)); - }; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return fa(fb.apply(null, args)); + }; }; var compose1 = function (fbc, fab) { - return function (a) { - return fbc(fab(a)); - }; + return function (a) { + return fbc(fab(a)); + }; }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; var identity = function (x) { - return x; + return x; }; - function curry(fn) { - var initialArgs = []; - for (var _i = 1; _i < arguments.length; _i++) { - initialArgs[_i - 1] = arguments[_i]; - } - return function () { - var restArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - restArgs[_i] = arguments[_i]; - } - var all = initialArgs.concat(restArgs); - return fn.apply(null, all); - }; + var initialArgs = []; + for (var _i = 1; _i < arguments.length; _i++) { + initialArgs[_i - 1] = arguments[_i]; + } + return function () { + var restArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + restArgs[_i] = arguments[_i]; + } + var all = initialArgs.concat(restArgs); + return fn.apply(null, all); + }; } - var not = function (f) { - return function (t) { - return !f(t); - }; + return function (t) { + return !f(t); + }; }; var die = function (msg) { - return function () { - throw new Error(msg); - }; + return function () { + throw new Error(msg); + }; }; var never = constant(false); var always = constant(true); var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var typeOf = function (x) { - var t = typeof x; - if (x === null) { - return 'null'; - } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { - return 'array'; - } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { - return 'string'; - } else { - return t; - } + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } }; var isType = function (type) { - return function (value) { - return typeOf(value) === type; - }; + return function (value) { + return typeOf(value) === type; + }; }; var isSimpleType = function (type) { - return function (value) { - return typeof value === type; - }; + return function (value) { + return typeof value === type; + }; }; var eq = function (t) { - return function (a) { - return t === a; - }; + return function (a) { + return t === a; + }; }; var isString = isType('string'); var isObject = isType('object'); @@ -201,10 +199,10 @@ var isBoolean = isSimpleType('boolean'); var isUndefined = eq(undefined); var isNullable = function (a) { - return a === null || a === undefined; + return a === null || a === undefined; }; var isNonNullable = function (a) { - return !isNullable(a); + return !isNullable(a); }; var isFunction = isSimpleType('function'); var isNumber = isSimpleType('number'); @@ -213,419 +211,418 @@ var nativeIndexOf = Array.prototype.indexOf; var nativePush = Array.prototype.push; var rawIndexOf = function (ts, t) { - return nativeIndexOf.call(ts, t); + return nativeIndexOf.call(ts, t); }; var contains = function (xs, x) { - return rawIndexOf(xs, x) > -1; + return rawIndexOf(xs, x) > -1; }; var exists = function (xs, pred) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - return true; - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return true; } - return false; + } + return false; }; var range = function (num, f) { - var r = []; - for (var i = 0; i < num; i++) { - r.push(f(i)); - } - return r; + var r = []; + for (var i = 0; i < num; i++) { + r.push(f(i)); + } + return r; }; var map = function (xs, f) { - var len = xs.length; - var r = new Array(len); - for (var i = 0; i < len; i++) { - var x = xs[i]; - r[i] = f(x, i); - } - return r; + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; }; var each = function (xs, f) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - f(x, i); - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } }; var eachr = function (xs, f) { - for (var i = xs.length - 1; i >= 0; i--) { - var x = xs[i]; - f(x, i); - } + for (var i = xs.length - 1; i >= 0; i--) { + var x = xs[i]; + f(x, i); + } }; var partition = function (xs, pred) { - var pass = []; - var fail = []; - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - var arr = pred(x, i) ? pass : fail; - arr.push(x); - } - return { - pass: pass, - fail: fail - }; + var pass = []; + var fail = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + var arr = pred(x, i) ? pass : fail; + arr.push(x); + } + return { + pass: pass, + fail: fail + }; }; var filter = function (xs, pred) { - var r = []; - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - r.push(x); - } + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); } - return r; + } + return r; }; var foldr = function (xs, f, acc) { - eachr(xs, function (x) { - acc = f(acc, x); - }); - return acc; + eachr(xs, function (x) { + acc = f(acc, x); + }); + return acc; }; var foldl = function (xs, f, acc) { - each(xs, function (x) { - acc = f(acc, x); - }); - return acc; + each(xs, function (x) { + acc = f(acc, x); + }); + return acc; }; var findUntil = function (xs, pred, until) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - return Optional.some(x); - } else if (until(x, i)) { - break; - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(x); + } else if (until(x, i)) { + break; } - return Optional.none(); + } + return Optional.none(); }; var find = function (xs, pred) { - return findUntil(xs, pred, never); + return findUntil(xs, pred, never); }; var findIndex = function (xs, pred) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - return Optional.some(i); - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(i); } - return Optional.none(); + } + return Optional.none(); }; var flatten = function (xs) { - var r = []; - for (var i = 0, len = xs.length; i < len; ++i) { - if (!isArray(xs[i])) { - throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); - } - nativePush.apply(r, xs[i]); + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); } - return r; + nativePush.apply(r, xs[i]); + } + return r; }; var bind = function (xs, f) { - return flatten(map(xs, f)); + return flatten(map(xs, f)); }; var forall = function (xs, pred) { - for (var i = 0, len = xs.length; i < len; ++i) { - var x = xs[i]; - if (pred(x, i) !== true) { - return false; - } + for (var i = 0, len = xs.length; i < len; ++i) { + var x = xs[i]; + if (pred(x, i) !== true) { + return false; } - return true; + } + return true; }; var reverse = function (xs) { - var r = nativeSlice.call(xs, 0); - r.reverse(); - return r; + var r = nativeSlice.call(xs, 0); + r.reverse(); + return r; }; var pure = function (x) { - return [x]; + return [x]; }; var get = function (xs, i) { - return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none(); + return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none(); }; var head = function (xs) { - return get(xs, 0); + return get(xs, 0); }; var last = function (xs) { - return get(xs, xs.length - 1); + return get(xs, xs.length - 1); }; var findMap = function (arr, f) { - for (var i = 0; i < arr.length; i++) { - var r = f(arr[i], i); - if (r.isSome()) { - return r; - } + for (var i = 0; i < arr.length; i++) { + var r = f(arr[i], i); + if (r.isSome()) { + return r; } - return Optional.none(); + } + return Optional.none(); }; var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); }; - function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) - s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; + for (var s = 0, i = 0, il = arguments.length; i < il; i++) + s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; } var cached = function (f) { - var called = false; - var r; - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (!called) { - called = true; - r = f.apply(null, args); - } - return r; - }; + var called = false; + var r; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!called) { + called = true; + r = f.apply(null, args); + } + return r; + }; }; var DeviceType = function (os, browser, userAgent, mediaMatch) { - var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true; - var isiPhone = os.isiOS() && !isiPad; - var isMobile = os.isiOS() || os.isAndroid(); - var isTouch = isMobile || mediaMatch('(pointer:coarse)'); - var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)'); - var isPhone = isiPhone || isMobile && !isTablet; - var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false; - var isDesktop = !isPhone && !isTablet && !iOSwebview; - return { - isiPad: constant(isiPad), - isiPhone: constant(isiPhone), - isTablet: constant(isTablet), - isPhone: constant(isPhone), - isTouch: constant(isTouch), - isAndroid: os.isAndroid, - isiOS: os.isiOS, - isWebView: constant(iOSwebview), - isDesktop: constant(isDesktop) - }; + var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true; + var isiPhone = os.isiOS() && !isiPad; + var isMobile = os.isiOS() || os.isAndroid(); + var isTouch = isMobile || mediaMatch('(pointer:coarse)'); + var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)'); + var isPhone = isiPhone || isMobile && !isTablet; + var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false; + var isDesktop = !isPhone && !isTablet && !iOSwebview; + return { + isiPad: constant(isiPad), + isiPhone: constant(isiPhone), + isTablet: constant(isTablet), + isPhone: constant(isPhone), + isTouch: constant(isTouch), + isAndroid: os.isAndroid, + isiOS: os.isiOS, + isWebView: constant(iOSwebview), + isDesktop: constant(isDesktop) + }; }; var firstMatch = function (regexes, s) { - for (var i = 0; i < regexes.length; i++) { - var x = regexes[i]; - if (x.test(s)) { - return x; - } + for (var i = 0; i < regexes.length; i++) { + var x = regexes[i]; + if (x.test(s)) { + return x; } - return undefined; + } + return undefined; }; var find$1 = function (regexes, agent) { - var r = firstMatch(regexes, agent); - if (!r) { - return { - major: 0, - minor: 0 - }; - } - var group = function (i) { - return Number(agent.replace(r, '$' + i)); + var r = firstMatch(regexes, agent); + if (!r) { + return { + major: 0, + minor: 0 }; - return nu(group(1), group(2)); + } + var group = function (i) { + return Number(agent.replace(r, '$' + i)); + }; + return nu(group(1), group(2)); }; var detect = function (versionRegexes, agent) { - var cleanedAgent = String(agent).toLowerCase(); - if (versionRegexes.length === 0) { - return unknown(); - } - return find$1(versionRegexes, cleanedAgent); + var cleanedAgent = String(agent).toLowerCase(); + if (versionRegexes.length === 0) { + return unknown(); + } + return find$1(versionRegexes, cleanedAgent); }; var unknown = function () { - return nu(0, 0); + return nu(0, 0); }; var nu = function (major, minor) { - return { - major: major, - minor: minor - }; + return { + major: major, + minor: minor + }; }; var Version = { - nu: nu, - detect: detect, - unknown: unknown + nu: nu, + detect: detect, + unknown: unknown }; var detect$1 = function (candidates, userAgent) { - var agent = String(userAgent).toLowerCase(); - return find(candidates, function (candidate) { - return candidate.search(agent); - }); + var agent = String(userAgent).toLowerCase(); + return find(candidates, function (candidate) { + return candidate.search(agent); + }); }; var detectBrowser = function (browsers, userAgent) { - return detect$1(browsers, userAgent).map(function (browser) { - var version = Version.detect(browser.versionRegexes, userAgent); - return { - current: browser.name, - version: version - }; - }); + return detect$1(browsers, userAgent).map(function (browser) { + var version = Version.detect(browser.versionRegexes, userAgent); + return { + current: browser.name, + version: version + }; + }); }; var detectOs = function (oses, userAgent) { - return detect$1(oses, userAgent).map(function (os) { - var version = Version.detect(os.versionRegexes, userAgent); - return { - current: os.name, - version: version - }; - }); + return detect$1(oses, userAgent).map(function (os) { + var version = Version.detect(os.versionRegexes, userAgent); + return { + current: os.name, + version: version + }; + }); }; var UaString = { - detectBrowser: detectBrowser, - detectOs: detectOs + detectBrowser: detectBrowser, + detectOs: detectOs }; var checkRange = function (str, substr, start) { - return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr; + return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr; }; var contains$1 = function (str, substr) { - return str.indexOf(substr) !== -1; + return str.indexOf(substr) !== -1; }; var startsWith = function (str, prefix) { - return checkRange(str, prefix, 0); + return checkRange(str, prefix, 0); }; var endsWith = function (str, suffix) { - return checkRange(str, suffix, str.length - suffix.length); + return checkRange(str, suffix, str.length - suffix.length); }; var blank = function (r) { - return function (s) { - return s.replace(r, ''); - }; + return function (s) { + return s.replace(r, ''); + }; }; var trim = blank(/^\s+|\s+$/g); var isNotEmpty = function (s) { - return s.length > 0; + return s.length > 0; }; var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/; var checkContains = function (target) { - return function (uastring) { - return contains$1(uastring, target); - }; + return function (uastring) { + return contains$1(uastring, target); + }; }; var browsers = [ - { - name: 'Edge', - versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/], - search: function (uastring) { - return contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit'); - } - }, - { - name: 'Chrome', - versionRegexes: [ - /.*?chrome\/([0-9]+)\.([0-9]+).*/, - normalVersionRegex - ], - search: function (uastring) { - return contains$1(uastring, 'chrome') && !contains$1(uastring, 'chromeframe'); - } - }, - { - name: 'IE', - versionRegexes: [ - /.*?msie\ ?([0-9]+)\.([0-9]+).*/, - /.*?rv:([0-9]+)\.([0-9]+).*/ - ], - search: function (uastring) { - return contains$1(uastring, 'msie') || contains$1(uastring, 'trident'); - } - }, - { - name: 'Opera', - versionRegexes: [ - normalVersionRegex, - /.*?opera\/([0-9]+)\.([0-9]+).*/ - ], - search: checkContains('opera') - }, - { - name: 'Firefox', - versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/], - search: checkContains('firefox') - }, - { - name: 'Safari', - versionRegexes: [ - normalVersionRegex, - /.*?cpu os ([0-9]+)_([0-9]+).*/ - ], - search: function (uastring) { - return (contains$1(uastring, 'safari') || contains$1(uastring, 'mobile/')) && contains$1(uastring, 'applewebkit'); - } + { + name: 'Edge', + versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/], + search: function (uastring) { + return contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit'); + } + }, + { + name: 'Chrome', + versionRegexes: [ + /.*?chrome\/([0-9]+)\.([0-9]+).*/, + normalVersionRegex + ], + search: function (uastring) { + return contains$1(uastring, 'chrome') && !contains$1(uastring, 'chromeframe'); + } + }, + { + name: 'IE', + versionRegexes: [ + /.*?msie\ ?([0-9]+)\.([0-9]+).*/, + /.*?rv:([0-9]+)\.([0-9]+).*/ + ], + search: function (uastring) { + return contains$1(uastring, 'msie') || contains$1(uastring, 'trident'); + } + }, + { + name: 'Opera', + versionRegexes: [ + normalVersionRegex, + /.*?opera\/([0-9]+)\.([0-9]+).*/ + ], + search: checkContains('opera') + }, + { + name: 'Firefox', + versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/], + search: checkContains('firefox') + }, + { + name: 'Safari', + versionRegexes: [ + normalVersionRegex, + /.*?cpu os ([0-9]+)_([0-9]+).*/ + ], + search: function (uastring) { + return (contains$1(uastring, 'safari') || contains$1(uastring, 'mobile/')) && contains$1(uastring, 'applewebkit'); } + } ]; var oses = [ - { - name: 'Windows', - search: checkContains('win'), - versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/] - }, - { - name: 'iOS', - search: function (uastring) { - return contains$1(uastring, 'iphone') || contains$1(uastring, 'ipad'); - }, - versionRegexes: [ - /.*?version\/\ ?([0-9]+)\.([0-9]+).*/, - /.*cpu os ([0-9]+)_([0-9]+).*/, - /.*cpu iphone os ([0-9]+)_([0-9]+).*/ - ] - }, - { - name: 'Android', - search: checkContains('android'), - versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/] - }, - { - name: 'OSX', - search: checkContains('mac os x'), - versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/] - }, - { - name: 'Linux', - search: checkContains('linux'), - versionRegexes: [] - }, - { - name: 'Solaris', - search: checkContains('sunos'), - versionRegexes: [] - }, - { - name: 'FreeBSD', - search: checkContains('freebsd'), - versionRegexes: [] + { + name: 'Windows', + search: checkContains('win'), + versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'iOS', + search: function (uastring) { + return contains$1(uastring, 'iphone') || contains$1(uastring, 'ipad'); }, - { - name: 'ChromeOS', - search: checkContains('cros'), - versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/] - } + versionRegexes: [ + /.*?version\/\ ?([0-9]+)\.([0-9]+).*/, + /.*cpu os ([0-9]+)_([0-9]+).*/, + /.*cpu iphone os ([0-9]+)_([0-9]+).*/ + ] + }, + { + name: 'Android', + search: checkContains('android'), + versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'OSX', + search: checkContains('mac os x'), + versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/] + }, + { + name: 'Linux', + search: checkContains('linux'), + versionRegexes: [] + }, + { + name: 'Solaris', + search: checkContains('sunos'), + versionRegexes: [] + }, + { + name: 'FreeBSD', + search: checkContains('freebsd'), + versionRegexes: [] + }, + { + name: 'ChromeOS', + search: checkContains('cros'), + versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/] + } ]; var PlatformInfo = { - browsers: constant(browsers), - oses: constant(oses) + browsers: constant(browsers), + oses: constant(oses) }; var edge = 'Edge'; @@ -635,39 +632,39 @@ var firefox = 'Firefox'; var safari = 'Safari'; var unknown$1 = function () { - return nu$1({ - current: undefined, - version: Version.unknown() - }); + return nu$1({ + current: undefined, + version: Version.unknown() + }); }; var nu$1 = function (info) { - var current = info.current; - var version = info.version; - var isBrowser = function (name) { - return function () { - return current === name; - }; - }; - return { - current: current, - version: version, - isEdge: isBrowser(edge), - isChrome: isBrowser(chrome), - isIE: isBrowser(ie), - isOpera: isBrowser(opera), - isFirefox: isBrowser(firefox), - isSafari: isBrowser(safari) - }; + var current = info.current; + var version = info.version; + var isBrowser = function (name) { + return function () { + return current === name; + }; + }; + return { + current: current, + version: version, + isEdge: isBrowser(edge), + isChrome: isBrowser(chrome), + isIE: isBrowser(ie), + isOpera: isBrowser(opera), + isFirefox: isBrowser(firefox), + isSafari: isBrowser(safari) + }; }; var Browser = { - unknown: unknown$1, - nu: nu$1, - edge: constant(edge), - chrome: constant(chrome), - ie: constant(ie), - opera: constant(opera), - firefox: constant(firefox), - safari: constant(safari) + unknown: unknown$1, + nu: nu$1, + edge: constant(edge), + chrome: constant(chrome), + ie: constant(ie), + opera: constant(opera), + firefox: constant(firefox), + safari: constant(safari) }; var windows = 'Windows'; @@ -679,74 +676,74 @@ var freebsd = 'FreeBSD'; var chromeos = 'ChromeOS'; var unknown$2 = function () { - return nu$2({ - current: undefined, - version: Version.unknown() - }); + return nu$2({ + current: undefined, + version: Version.unknown() + }); }; var nu$2 = function (info) { - var current = info.current; - var version = info.version; - var isOS = function (name) { - return function () { - return current === name; - }; - }; - return { - current: current, - version: version, - isWindows: isOS(windows), - isiOS: isOS(ios), - isAndroid: isOS(android), - isOSX: isOS(osx), - isLinux: isOS(linux), - isSolaris: isOS(solaris), - isFreeBSD: isOS(freebsd), - isChromeOS: isOS(chromeos) - }; + var current = info.current; + var version = info.version; + var isOS = function (name) { + return function () { + return current === name; + }; + }; + return { + current: current, + version: version, + isWindows: isOS(windows), + isiOS: isOS(ios), + isAndroid: isOS(android), + isOSX: isOS(osx), + isLinux: isOS(linux), + isSolaris: isOS(solaris), + isFreeBSD: isOS(freebsd), + isChromeOS: isOS(chromeos) + }; }; var OperatingSystem = { - unknown: unknown$2, - nu: nu$2, - windows: constant(windows), - ios: constant(ios), - android: constant(android), - linux: constant(linux), - osx: constant(osx), - solaris: constant(solaris), - freebsd: constant(freebsd), - chromeos: constant(chromeos) + unknown: unknown$2, + nu: nu$2, + windows: constant(windows), + ios: constant(ios), + android: constant(android), + linux: constant(linux), + osx: constant(osx), + solaris: constant(solaris), + freebsd: constant(freebsd), + chromeos: constant(chromeos) }; var detect$2 = function (userAgent, mediaMatch) { - var browsers = PlatformInfo.browsers(); - var oses = PlatformInfo.oses(); - var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu); - var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu); - var deviceType = DeviceType(os, browser, userAgent, mediaMatch); - return { - browser: browser, - os: os, - deviceType: deviceType - }; - }; - var PlatformDetection = {detect: detect$2}; + var browsers = PlatformInfo.browsers(); + var oses = PlatformInfo.oses(); + var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu); + var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu); + var deviceType = DeviceType(os, browser, userAgent, mediaMatch); + return { + browser: browser, + os: os, + deviceType: deviceType + }; + }; + var PlatformDetection = { detect: detect$2 }; var mediaMatch = function (query) { - return window.matchMedia(query).matches; + return window.matchMedia(query).matches; }; var platform = cached(function () { - return PlatformDetection.detect(navigator.userAgent, mediaMatch); + return PlatformDetection.detect(navigator.userAgent, mediaMatch); }); var detect$3 = function () { - return platform(); + return platform(); }; var compareDocumentPosition = function (a, b, match) { - return (a.compareDocumentPosition(b) & match) !== 0; + return (a.compareDocumentPosition(b) & match) !== 0; }; var documentPositionContainedBy = function (a, b) { - return compareDocumentPosition(a, b, Node.DOCUMENT_POSITION_CONTAINED_BY); + return compareDocumentPosition(a, b, Node.DOCUMENT_POSITION_CONTAINED_BY); }; var COMMENT = 8; @@ -756,1184 +753,1184 @@ var TEXT = 3; var fromHtml = function (html, scope) { - var doc = scope || document; - var div = doc.createElement('div'); - div.innerHTML = html; - if (!div.hasChildNodes() || div.childNodes.length > 1) { - console.error('HTML does not have a single root node', html); - throw new Error('HTML must have a single root node'); - } - return fromDom(div.childNodes[0]); + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); }; var fromTag = function (tag, scope) { - var doc = scope || document; - var node = doc.createElement(tag); - return fromDom(node); + var doc = scope || document; + var node = doc.createElement(tag); + return fromDom(node); }; var fromText = function (text, scope) { - var doc = scope || document; - var node = doc.createTextNode(text); - return fromDom(node); + var doc = scope || document; + var node = doc.createTextNode(text); + return fromDom(node); }; var fromDom = function (node) { - if (node === null || node === undefined) { - throw new Error('Node cannot be null or undefined'); - } - return {dom: node}; + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: node }; }; var fromPoint = function (docElm, x, y) { - return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); + return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); }; var SugarElement = { - fromHtml: fromHtml, - fromTag: fromTag, - fromText: fromText, - fromDom: fromDom, - fromPoint: fromPoint + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint }; var is = function (element, selector) { - var dom = element.dom; - if (dom.nodeType !== ELEMENT) { - return false; + var dom = element.dom; + if (dom.nodeType !== ELEMENT) { + return false; + } else { + var elem = dom; + if (elem.matches !== undefined) { + return elem.matches(selector); + } else if (elem.msMatchesSelector !== undefined) { + return elem.msMatchesSelector(selector); + } else if (elem.webkitMatchesSelector !== undefined) { + return elem.webkitMatchesSelector(selector); + } else if (elem.mozMatchesSelector !== undefined) { + return elem.mozMatchesSelector(selector); } else { - var elem = dom; - if (elem.matches !== undefined) { - return elem.matches(selector); - } else if (elem.msMatchesSelector !== undefined) { - return elem.msMatchesSelector(selector); - } else if (elem.webkitMatchesSelector !== undefined) { - return elem.webkitMatchesSelector(selector); - } else if (elem.mozMatchesSelector !== undefined) { - return elem.mozMatchesSelector(selector); - } else { - throw new Error('Browser lacks native selectors'); - } + throw new Error('Browser lacks native selectors'); } + } }; var bypassSelector = function (dom) { - return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0; + return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0; }; var all = function (selector, scope) { - var base = scope === undefined ? document : scope.dom; - return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), SugarElement.fromDom); + var base = scope === undefined ? document : scope.dom; + return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), SugarElement.fromDom); }; var one = function (selector, scope) { - var base = scope === undefined ? document : scope.dom; - return bypassSelector(base) ? Optional.none() : Optional.from(base.querySelector(selector)).map(SugarElement.fromDom); + var base = scope === undefined ? document : scope.dom; + return bypassSelector(base) ? Optional.none() : Optional.from(base.querySelector(selector)).map(SugarElement.fromDom); }; var eq$1 = function (e1, e2) { - return e1.dom === e2.dom; + return e1.dom === e2.dom; }; var regularContains = function (e1, e2) { - var d1 = e1.dom; - var d2 = e2.dom; - return d1 === d2 ? false : d1.contains(d2); + var d1 = e1.dom; + var d2 = e2.dom; + return d1 === d2 ? false : d1.contains(d2); }; var ieContains = function (e1, e2) { - return documentPositionContainedBy(e1.dom, e2.dom); + return documentPositionContainedBy(e1.dom, e2.dom); }; var contains$2 = function (e1, e2) { - return detect$3().browser.isIE() ? ieContains(e1, e2) : regularContains(e1, e2); + return detect$3().browser.isIE() ? ieContains(e1, e2) : regularContains(e1, e2); }; var is$1 = is; var keys = Object.keys; var hasOwnProperty = Object.hasOwnProperty; var each$1 = function (obj, f) { - var props = keys(obj); - for (var k = 0, len = props.length; k < len; k++) { - var i = props[k]; - var x = obj[i]; - f(x, i); - } + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } }; var map$1 = function (obj, f) { - return tupleMap(obj, function (x, i) { - return { - k: i, - v: f(x, i) - }; - }); + return tupleMap(obj, function (x, i) { + return { + k: i, + v: f(x, i) + }; + }); }; var tupleMap = function (obj, f) { - var r = {}; - each$1(obj, function (x, i) { - var tuple = f(x, i); - r[tuple.k] = tuple.v; - }); - return r; + var r = {}; + each$1(obj, function (x, i) { + var tuple = f(x, i); + r[tuple.k] = tuple.v; + }); + return r; }; var objAcc = function (r) { - return function (x, i) { - r[i] = x; - }; + return function (x, i) { + r[i] = x; + }; }; var internalFilter = function (obj, pred, onTrue, onFalse) { - var r = {}; - each$1(obj, function (x, i) { - (pred(x, i) ? onTrue : onFalse)(x, i); - }); - return r; + var r = {}; + each$1(obj, function (x, i) { + (pred(x, i) ? onTrue : onFalse)(x, i); + }); + return r; }; var filter$1 = function (obj, pred) { - var t = {}; - internalFilter(obj, pred, objAcc(t), noop); - return t; + var t = {}; + internalFilter(obj, pred, objAcc(t), noop); + return t; }; var mapToArray = function (obj, f) { - var r = []; - each$1(obj, function (value, name) { - r.push(f(value, name)); - }); - return r; + var r = []; + each$1(obj, function (value, name) { + r.push(f(value, name)); + }); + return r; }; var values = function (obj) { - return mapToArray(obj, function (v) { - return v; - }); + return mapToArray(obj, function (v) { + return v; + }); }; var get$1 = function (obj, key) { - return has(obj, key) ? Optional.from(obj[key]) : Optional.none(); + return has(obj, key) ? Optional.from(obj[key]) : Optional.none(); }; var has = function (obj, key) { - return hasOwnProperty.call(obj, key); + return hasOwnProperty.call(obj, key); }; var hasNonNullableKey = function (obj, key) { - return has(obj, key) && obj[key] !== undefined && obj[key] !== null; + return has(obj, key) && obj[key] !== undefined && obj[key] !== null; }; var isEmpty = function (r) { - for (var x in r) { - if (hasOwnProperty.call(r, x)) { - return false; - } + for (var x in r) { + if (hasOwnProperty.call(r, x)) { + return false; } - return true; + } + return true; }; var validSectionList = [ - 'tfoot', - 'thead', - 'tbody', - 'colgroup' + 'tfoot', + 'thead', + 'tbody', + 'colgroup' ]; var isValidSection = function (parentName) { - return contains(validSectionList, parentName); + return contains(validSectionList, parentName); }; var grid = function (rows, columns) { - return { - rows: rows, - columns: columns - }; + return { + rows: rows, + columns: columns + }; }; var address = function (row, column) { - return { - row: row, - column: column - }; + return { + row: row, + column: column + }; }; var detail = function (element, rowspan, colspan) { - return { - element: element, - rowspan: rowspan, - colspan: colspan - }; + return { + element: element, + rowspan: rowspan, + colspan: colspan + }; }; var detailnew = function (element, rowspan, colspan, isNew) { - return { - element: element, - rowspan: rowspan, - colspan: colspan, - isNew: isNew - }; + return { + element: element, + rowspan: rowspan, + colspan: colspan, + isNew: isNew + }; }; var extended = function (element, rowspan, colspan, row, column) { - return { - element: element, - rowspan: rowspan, - colspan: colspan, - row: row, - column: column - }; + return { + element: element, + rowspan: rowspan, + colspan: colspan, + row: row, + column: column + }; }; var rowdata = function (element, cells, section) { - return { - element: element, - cells: cells, - section: section - }; + return { + element: element, + cells: cells, + section: section + }; }; var elementnew = function (element, isNew) { - return { - element: element, - isNew: isNew - }; + return { + element: element, + isNew: isNew + }; }; var rowdatanew = function (element, cells, section, isNew) { - return { - element: element, - cells: cells, - section: section, - isNew: isNew - }; + return { + element: element, + cells: cells, + section: section, + isNew: isNew + }; }; var rowcells = function (cells, section) { - return { - cells: cells, - section: section - }; + return { + cells: cells, + section: section + }; }; var rowdetails = function (details, section) { - return { - details: details, - section: section - }; + return { + details: details, + section: section + }; }; var bounds = function (startRow, startCol, finishRow, finishCol) { - return { - startRow: startRow, - startCol: startCol, - finishRow: finishRow, - finishCol: finishCol - }; + return { + startRow: startRow, + startCol: startCol, + finishRow: finishRow, + finishCol: finishCol + }; }; var columnext = function (element, colspan, column) { - return { - element: element, - colspan: colspan, - column: column - }; + return { + element: element, + colspan: colspan, + column: column + }; }; var Global = typeof window !== 'undefined' ? window : Function('return this;')(); var name = function (element) { - var r = element.dom.nodeName; - return r.toLowerCase(); + var r = element.dom.nodeName; + return r.toLowerCase(); }; var type = function (element) { - return element.dom.nodeType; + return element.dom.nodeType; }; var isType$1 = function (t) { - return function (element) { - return type(element) === t; - }; + return function (element) { + return type(element) === t; + }; }; var isComment = function (element) { - return type(element) === COMMENT || name(element) === '#comment'; + return type(element) === COMMENT || name(element) === '#comment'; }; var isElement = isType$1(ELEMENT); var isText = isType$1(TEXT); var isDocument = isType$1(DOCUMENT); var isDocumentFragment = isType$1(DOCUMENT_FRAGMENT); var isTag = function (tag) { - return function (e) { - return isElement(e) && name(e) === tag; - }; + return function (e) { + return isElement(e) && name(e) === tag; + }; }; var owner = function (element) { - return SugarElement.fromDom(element.dom.ownerDocument); + return SugarElement.fromDom(element.dom.ownerDocument); }; var documentOrOwner = function (dos) { - return isDocument(dos) ? dos : owner(dos); + return isDocument(dos) ? dos : owner(dos); }; var defaultView = function (element) { - return SugarElement.fromDom(documentOrOwner(element).dom.defaultView); + return SugarElement.fromDom(documentOrOwner(element).dom.defaultView); }; var parent = function (element) { - return Optional.from(element.dom.parentNode).map(SugarElement.fromDom); + return Optional.from(element.dom.parentNode).map(SugarElement.fromDom); }; var parents = function (element, isRoot) { - var stop = isFunction(isRoot) ? isRoot : never; - var dom = element.dom; - var ret = []; - while (dom.parentNode !== null && dom.parentNode !== undefined) { - var rawParent = dom.parentNode; - var p = SugarElement.fromDom(rawParent); - ret.push(p); - if (stop(p) === true) { - break; - } else { - dom = rawParent; - } + var stop = isFunction(isRoot) ? isRoot : never; + var dom = element.dom; + var ret = []; + while (dom.parentNode !== null && dom.parentNode !== undefined) { + var rawParent = dom.parentNode; + var p = SugarElement.fromDom(rawParent); + ret.push(p); + if (stop(p) === true) { + break; + } else { + dom = rawParent; } - return ret; + } + return ret; }; var offsetParent = function (element) { - return Optional.from(element.dom.offsetParent).map(SugarElement.fromDom); + return Optional.from(element.dom.offsetParent).map(SugarElement.fromDom); }; var prevSibling = function (element) { - return Optional.from(element.dom.previousSibling).map(SugarElement.fromDom); + return Optional.from(element.dom.previousSibling).map(SugarElement.fromDom); }; var nextSibling = function (element) { - return Optional.from(element.dom.nextSibling).map(SugarElement.fromDom); + return Optional.from(element.dom.nextSibling).map(SugarElement.fromDom); }; var children = function (element) { - return map(element.dom.childNodes, SugarElement.fromDom); + return map(element.dom.childNodes, SugarElement.fromDom); }; var child = function (element, index) { - var cs = element.dom.childNodes; - return Optional.from(cs[index]).map(SugarElement.fromDom); + var cs = element.dom.childNodes; + return Optional.from(cs[index]).map(SugarElement.fromDom); }; var firstChild = function (element) { - return child(element, 0); + return child(element, 0); }; var isShadowRoot = function (dos) { - return isDocumentFragment(dos); + return isDocumentFragment(dos); }; var supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode); var isSupported = constant(supported); var getRootNode = supported ? function (e) { - return SugarElement.fromDom(e.dom.getRootNode()); + return SugarElement.fromDom(e.dom.getRootNode()); } : documentOrOwner; var getShadowRoot = function (e) { - var r = getRootNode(e); - return isShadowRoot(r) ? Optional.some(r) : Optional.none(); + var r = getRootNode(e); + return isShadowRoot(r) ? Optional.some(r) : Optional.none(); }; var getShadowHost = function (e) { - return SugarElement.fromDom(e.dom.host); + return SugarElement.fromDom(e.dom.host); }; var getOriginalEventTarget = function (event) { - if (isSupported() && isNonNullable(event.target)) { - var el = SugarElement.fromDom(event.target); - if (isElement(el) && isOpenShadowHost(el)) { - if (event.composed && event.composedPath) { - var composedPath = event.composedPath(); - if (composedPath) { - return head(composedPath); - } - } + if (isSupported() && isNonNullable(event.target)) { + var el = SugarElement.fromDom(event.target); + if (isElement(el) && isOpenShadowHost(el)) { + if (event.composed && event.composedPath) { + var composedPath = event.composedPath(); + if (composedPath) { + return head(composedPath); } + } } - return Optional.from(event.target); + } + return Optional.from(event.target); }; var isOpenShadowHost = function (element) { - return isNonNullable(element.dom.shadowRoot); + return isNonNullable(element.dom.shadowRoot); }; var inBody = function (element) { - var dom = isText(element) ? element.dom.parentNode : element.dom; - if (dom === undefined || dom === null || dom.ownerDocument === null) { - return false; - } - var doc = dom.ownerDocument; - return getShadowRoot(SugarElement.fromDom(dom)).fold(function () { - return doc.body.contains(dom); - }, compose1(inBody, getShadowHost)); + var dom = isText(element) ? element.dom.parentNode : element.dom; + if (dom === undefined || dom === null || dom.ownerDocument === null) { + return false; + } + var doc = dom.ownerDocument; + return getShadowRoot(SugarElement.fromDom(dom)).fold(function () { + return doc.body.contains(dom); + }, compose1(inBody, getShadowHost)); }; var body = function () { - return getBody(SugarElement.fromDom(document)); + return getBody(SugarElement.fromDom(document)); }; var getBody = function (doc) { - var b = doc.dom.body; - if (b === null || b === undefined) { - throw new Error('Body is not available yet'); - } - return SugarElement.fromDom(b); + var b = doc.dom.body; + if (b === null || b === undefined) { + throw new Error('Body is not available yet'); + } + return SugarElement.fromDom(b); }; var ancestors = function (scope, predicate, isRoot) { - return filter(parents(scope, isRoot), predicate); + return filter(parents(scope, isRoot), predicate); }; var children$1 = function (scope, predicate) { - return filter(children(scope), predicate); + return filter(children(scope), predicate); }; var descendants = function (scope, predicate) { - var result = []; - each(children(scope), function (x) { - if (predicate(x)) { - result = result.concat([x]); - } - result = result.concat(descendants(x, predicate)); - }); - return result; + var result = []; + each(children(scope), function (x) { + if (predicate(x)) { + result = result.concat([x]); + } + result = result.concat(descendants(x, predicate)); + }); + return result; }; var ancestors$1 = function (scope, selector, isRoot) { - return ancestors(scope, function (e) { - return is(e, selector); - }, isRoot); + return ancestors(scope, function (e) { + return is(e, selector); + }, isRoot); }; var children$2 = function (scope, selector) { - return children$1(scope, function (e) { - return is(e, selector); - }); + return children$1(scope, function (e) { + return is(e, selector); + }); }; var descendants$1 = function (scope, selector) { - return all(selector, scope); + return all(selector, scope); }; - function ClosestOrAncestor(is, ancestor, scope, a, isRoot) { - if (is(scope, a)) { - return Optional.some(scope); - } else if (isFunction(isRoot) && isRoot(scope)) { - return Optional.none(); - } else { - return ancestor(scope, a, isRoot); - } + function ClosestOrAncestor (is, ancestor, scope, a, isRoot) { + if (is(scope, a)) { + return Optional.some(scope); + } else if (isFunction(isRoot) && isRoot(scope)) { + return Optional.none(); + } else { + return ancestor(scope, a, isRoot); + } } var ancestor = function (scope, predicate, isRoot) { - var element = scope.dom; - var stop = isFunction(isRoot) ? isRoot : never; - while (element.parentNode) { - element = element.parentNode; - var el = SugarElement.fromDom(element); - if (predicate(el)) { - return Optional.some(el); - } else if (stop(el)) { - break; - } - } - return Optional.none(); + var element = scope.dom; + var stop = isFunction(isRoot) ? isRoot : never; + while (element.parentNode) { + element = element.parentNode; + var el = SugarElement.fromDom(element); + if (predicate(el)) { + return Optional.some(el); + } else if (stop(el)) { + break; + } + } + return Optional.none(); }; var closest = function (scope, predicate, isRoot) { - var is = function (s, test) { - return test(s); - }; - return ClosestOrAncestor(is, ancestor, scope, predicate, isRoot); + var is = function (s, test) { + return test(s); + }; + return ClosestOrAncestor(is, ancestor, scope, predicate, isRoot); }; var child$1 = function (scope, predicate) { - var pred = function (node) { - return predicate(SugarElement.fromDom(node)); - }; - var result = find(scope.dom.childNodes, pred); - return result.map(SugarElement.fromDom); + var pred = function (node) { + return predicate(SugarElement.fromDom(node)); + }; + var result = find(scope.dom.childNodes, pred); + return result.map(SugarElement.fromDom); }; var descendant = function (scope, predicate) { - var descend = function (node) { - for (var i = 0; i < node.childNodes.length; i++) { - var child_1 = SugarElement.fromDom(node.childNodes[i]); - if (predicate(child_1)) { - return Optional.some(child_1); - } - var res = descend(node.childNodes[i]); - if (res.isSome()) { - return res; - } - } - return Optional.none(); - }; - return descend(scope.dom); + var descend = function (node) { + for (var i = 0; i < node.childNodes.length; i++) { + var child_1 = SugarElement.fromDom(node.childNodes[i]); + if (predicate(child_1)) { + return Optional.some(child_1); + } + var res = descend(node.childNodes[i]); + if (res.isSome()) { + return res; + } + } + return Optional.none(); + }; + return descend(scope.dom); }; var ancestor$1 = function (scope, selector, isRoot) { - return ancestor(scope, function (e) { - return is(e, selector); - }, isRoot); + return ancestor(scope, function (e) { + return is(e, selector); + }, isRoot); }; var child$2 = function (scope, selector) { - return child$1(scope, function (e) { - return is(e, selector); - }); + return child$1(scope, function (e) { + return is(e, selector); + }); }; var descendant$1 = function (scope, selector) { - return one(selector, scope); + return one(selector, scope); }; var closest$1 = function (scope, selector, isRoot) { - var is$1 = function (element, selector) { - return is(element, selector); - }; - return ClosestOrAncestor(is$1, ancestor$1, scope, selector, isRoot); + var is$1 = function (element, selector) { + return is(element, selector); + }; + return ClosestOrAncestor(is$1, ancestor$1, scope, selector, isRoot); }; var rawSet = function (dom, key, value) { - if (isString(value) || isBoolean(value) || isNumber(value)) { - dom.setAttribute(key, value + ''); - } else { - console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); - throw new Error('Attribute value was not simple'); - } + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); + throw new Error('Attribute value was not simple'); + } }; var set = function (element, key, value) { - rawSet(element.dom, key, value); + rawSet(element.dom, key, value); }; var setAll = function (element, attrs) { - var dom = element.dom; - each$1(attrs, function (v, k) { - rawSet(dom, k, v); - }); + var dom = element.dom; + each$1(attrs, function (v, k) { + rawSet(dom, k, v); + }); }; var get$2 = function (element, key) { - var v = element.dom.getAttribute(key); - return v === null ? undefined : v; + var v = element.dom.getAttribute(key); + return v === null ? undefined : v; }; var getOpt = function (element, key) { - return Optional.from(get$2(element, key)); + return Optional.from(get$2(element, key)); }; var remove = function (element, key) { - element.dom.removeAttribute(key); + element.dom.removeAttribute(key); }; var clone = function (element) { - return foldl(element.dom.attributes, function (acc, attr) { - acc[attr.name] = attr.value; - return acc; - }, {}); + return foldl(element.dom.attributes, function (acc, attr) { + acc[attr.name] = attr.value; + return acc; + }, {}); }; var isSupported$1 = function (dom) { - return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); }; var internalSet = function (dom, property, value) { - if (!isString(value)) { - console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom); - throw new Error('CSS value must be a string: ' + value); - } - if (isSupported$1(dom)) { - dom.style.setProperty(property, value); - } + if (!isString(value)) { + console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom); + throw new Error('CSS value must be a string: ' + value); + } + if (isSupported$1(dom)) { + dom.style.setProperty(property, value); + } }; var internalRemove = function (dom, property) { - if (isSupported$1(dom)) { - dom.style.removeProperty(property); - } + if (isSupported$1(dom)) { + dom.style.removeProperty(property); + } }; var set$1 = function (element, property, value) { - var dom = element.dom; - internalSet(dom, property, value); + var dom = element.dom; + internalSet(dom, property, value); }; var setAll$1 = function (element, css) { - var dom = element.dom; - each$1(css, function (v, k) { - internalSet(dom, k, v); - }); + var dom = element.dom; + each$1(css, function (v, k) { + internalSet(dom, k, v); + }); }; var get$3 = function (element, property) { - var dom = element.dom; - var styles = window.getComputedStyle(dom); - var r = styles.getPropertyValue(property); - return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; + var dom = element.dom; + var styles = window.getComputedStyle(dom); + var r = styles.getPropertyValue(property); + return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; }; var getUnsafeProperty = function (dom, property) { - return isSupported$1(dom) ? dom.style.getPropertyValue(property) : ''; + return isSupported$1(dom) ? dom.style.getPropertyValue(property) : ''; }; var getRaw = function (element, property) { - var dom = element.dom; - var raw = getUnsafeProperty(dom, property); - return Optional.from(raw).filter(function (r) { - return r.length > 0; - }); + var dom = element.dom; + var raw = getUnsafeProperty(dom, property); + return Optional.from(raw).filter(function (r) { + return r.length > 0; + }); }; var remove$1 = function (element, property) { - var dom = element.dom; - internalRemove(dom, property); - if (getOpt(element, 'style').map(trim).is('')) { - remove(element, 'style'); - } + var dom = element.dom; + internalRemove(dom, property); + if (getOpt(element, 'style').map(trim).is('')) { + remove(element, 'style'); + } }; var copy = function (source, target) { - var sourceDom = source.dom; - var targetDom = target.dom; - if (isSupported$1(sourceDom) && isSupported$1(targetDom)) { - targetDom.style.cssText = sourceDom.style.cssText; - } + var sourceDom = source.dom; + var targetDom = target.dom; + if (isSupported$1(sourceDom) && isSupported$1(targetDom)) { + targetDom.style.cssText = sourceDom.style.cssText; + } }; var getAttrValue = function (cell, name, fallback) { - if (fallback === void 0) { - fallback = 0; - } - return getOpt(cell, name).map(function (value) { - return parseInt(value, 10); - }).getOr(fallback); + if (fallback === void 0) { + fallback = 0; + } + return getOpt(cell, name).map(function (value) { + return parseInt(value, 10); + }).getOr(fallback); }; var getSpan = function (cell, type) { - return getAttrValue(cell, type, 1); + return getAttrValue(cell, type, 1); }; var hasColspan = function (cell) { - return getSpan(cell, 'colspan') > 1; + return getSpan(cell, 'colspan') > 1; }; var hasRowspan = function (cell) { - return getSpan(cell, 'rowspan') > 1; + return getSpan(cell, 'rowspan') > 1; }; var getCssValue = function (element, property) { - return parseInt(get$3(element, property), 10); + return parseInt(get$3(element, property), 10); }; var minWidth = constant(10); var minHeight = constant(10); var firstLayer = function (scope, selector) { - return filterFirstLayer(scope, selector, always); + return filterFirstLayer(scope, selector, always); }; var filterFirstLayer = function (scope, selector, predicate) { - return bind(children(scope), function (x) { - if (is(x, selector)) { - return predicate(x) ? [x] : []; - } else { - return filterFirstLayer(x, selector, predicate); - } - }); + return bind(children(scope), function (x) { + if (is(x, selector)) { + return predicate(x) ? [x] : []; + } else { + return filterFirstLayer(x, selector, predicate); + } + }); }; var lookup = function (tags, element, isRoot) { - if (isRoot === void 0) { - isRoot = never; - } - if (isRoot(element)) { - return Optional.none(); - } - if (contains(tags, name(element))) { - return Optional.some(element); - } - var isRootOrUpperTable = function (elm) { - return is(elm, 'table') || isRoot(elm); - }; - return ancestor$1(element, tags.join(','), isRootOrUpperTable); + if (isRoot === void 0) { + isRoot = never; + } + if (isRoot(element)) { + return Optional.none(); + } + if (contains(tags, name(element))) { + return Optional.some(element); + } + var isRootOrUpperTable = function (elm) { + return is(elm, 'table') || isRoot(elm); + }; + return ancestor$1(element, tags.join(','), isRootOrUpperTable); }; var cell = function (element, isRoot) { - return lookup([ - 'td', - 'th' - ], element, isRoot); + return lookup([ + 'td', + 'th' + ], element, isRoot); }; var cells = function (ancestor) { - return firstLayer(ancestor, 'th,td'); + return firstLayer(ancestor, 'th,td'); }; var columns = function (ancestor) { - if (is(ancestor, 'colgroup')) { - return children$2(ancestor, 'col'); - } else { - return bind(columnGroups(ancestor), function (columnGroup) { - return children$2(columnGroup, 'col'); - }); - } + if (is(ancestor, 'colgroup')) { + return children$2(ancestor, 'col'); + } else { + return bind(columnGroups(ancestor), function (columnGroup) { + return children$2(columnGroup, 'col'); + }); + } }; var table = function (element, isRoot) { - return closest$1(element, 'table', isRoot); + return closest$1(element, 'table', isRoot); }; var rows = function (ancestor) { - return firstLayer(ancestor, 'tr'); + return firstLayer(ancestor, 'tr'); }; var columnGroups = function (ancestor) { - return table(ancestor).fold(constant([]), function (table) { - return children$2(table, 'colgroup'); - }); + return table(ancestor).fold(constant([]), function (table) { + return children$2(table, 'colgroup'); + }); }; var fromRowsOrColGroups = function (elems, getSection) { - return map(elems, function (row) { - if (name(row) === 'colgroup') { - var cells$1 = map(columns(row), function (column) { - var colspan = getAttrValue(column, 'span', 1); - return detail(column, 1, colspan); - }); - return rowdata(row, cells$1, 'colgroup'); - } else { - var cells$1 = map(cells(row), function (cell) { - var rowspan = getAttrValue(cell, 'rowspan', 1); - var colspan = getAttrValue(cell, 'colspan', 1); - return detail(cell, rowspan, colspan); - }); - return rowdata(row, cells$1, getSection(row)); - } - }); + return map(elems, function (row) { + if (name(row) === 'colgroup') { + var cells$1 = map(columns(row), function (column) { + var colspan = getAttrValue(column, 'span', 1); + return detail(column, 1, colspan); + }); + return rowdata(row, cells$1, 'colgroup'); + } else { + var cells$1 = map(cells(row), function (cell) { + var rowspan = getAttrValue(cell, 'rowspan', 1); + var colspan = getAttrValue(cell, 'colspan', 1); + return detail(cell, rowspan, colspan); + }); + return rowdata(row, cells$1, getSection(row)); + } + }); }; var getParentSection = function (group) { - return parent(group).map(function (parent) { - var parentName = name(parent); - return isValidSection(parentName) ? parentName : 'tbody'; - }).getOr('tbody'); + return parent(group).map(function (parent) { + var parentName = name(parent); + return isValidSection(parentName) ? parentName : 'tbody'; + }).getOr('tbody'); }; var fromTable = function (table) { - var rows$1 = rows(table); - var columnGroups$1 = columnGroups(table); - var elems = __spreadArrays(columnGroups$1, rows$1); - return fromRowsOrColGroups(elems, getParentSection); + var rows$1 = rows(table); + var columnGroups$1 = columnGroups(table); + var elems = __spreadArrays(columnGroups$1, rows$1); + return fromRowsOrColGroups(elems, getParentSection); }; var fromPastedRows = function (elems, section) { - return fromRowsOrColGroups(elems, function () { - return section; - }); + return fromRowsOrColGroups(elems, function () { + return section; + }); }; var key = function (row, column) { - return row + ',' + column; + return row + ',' + column; }; var getAt = function (warehouse, row, column) { - var raw = warehouse.access[key(row, column)]; - return raw !== undefined ? Optional.some(raw) : Optional.none(); + var raw = warehouse.access[key(row, column)]; + return raw !== undefined ? Optional.some(raw) : Optional.none(); }; var findItem = function (warehouse, item, comparator) { - var filtered = filterItems(warehouse, function (detail) { - return comparator(item, detail.element); - }); - return filtered.length > 0 ? Optional.some(filtered[0]) : Optional.none(); + var filtered = filterItems(warehouse, function (detail) { + return comparator(item, detail.element); + }); + return filtered.length > 0 ? Optional.some(filtered[0]) : Optional.none(); }; var filterItems = function (warehouse, predicate) { - var all = bind(warehouse.all, function (r) { - return r.cells; - }); - return filter(all, predicate); + var all = bind(warehouse.all, function (r) { + return r.cells; + }); + return filter(all, predicate); }; var generateColumns = function (rowData) { - var columnsGroup = {}; - var index = 0; - each(rowData.cells, function (column) { - var colspan = column.colspan; - range(colspan, function (columnIndex) { - var colIndex = index + columnIndex; - columnsGroup[colIndex] = columnext(column.element, colspan, colIndex); - }); - index += colspan; - }); - return columnsGroup; + var columnsGroup = {}; + var index = 0; + each(rowData.cells, function (column) { + var colspan = column.colspan; + range(colspan, function (columnIndex) { + var colIndex = index + columnIndex; + columnsGroup[colIndex] = columnext(column.element, colspan, colIndex); + }); + index += colspan; + }); + return columnsGroup; }; var generate = function (list) { - var access = {}; - var cells = []; - var columns = {}; - var maxRows = 0; - var maxColumns = 0; - var rowCount = 0; - each(list, function (rowData) { - if (rowData.section === 'colgroup') { - columns = generateColumns(rowData); - } else { - var currentRow_1 = []; - each(rowData.cells, function (rowCell) { - var start = 0; - while (access[key(rowCount, start)] !== undefined) { - start++; - } - var current = extended(rowCell.element, rowCell.rowspan, rowCell.colspan, rowCount, start); - for (var occupiedColumnPosition = 0; occupiedColumnPosition < rowCell.colspan; occupiedColumnPosition++) { - for (var occupiedRowPosition = 0; occupiedRowPosition < rowCell.rowspan; occupiedRowPosition++) { - var rowPosition = rowCount + occupiedRowPosition; - var columnPosition = start + occupiedColumnPosition; - var newpos = key(rowPosition, columnPosition); - access[newpos] = current; - maxColumns = Math.max(maxColumns, columnPosition + 1); - } - } - currentRow_1.push(current); - }); - maxRows++; - cells.push(rowdata(rowData.element, currentRow_1, rowData.section)); - rowCount++; - } - }); - var grid$1 = grid(maxRows, maxColumns); - return { - grid: grid$1, - access: access, - all: cells, - columns: columns - }; + var access = {}; + var cells = []; + var columns = {}; + var maxRows = 0; + var maxColumns = 0; + var rowCount = 0; + each(list, function (rowData) { + if (rowData.section === 'colgroup') { + columns = generateColumns(rowData); + } else { + var currentRow_1 = []; + each(rowData.cells, function (rowCell) { + var start = 0; + while (access[key(rowCount, start)] !== undefined) { + start++; + } + var current = extended(rowCell.element, rowCell.rowspan, rowCell.colspan, rowCount, start); + for (var occupiedColumnPosition = 0; occupiedColumnPosition < rowCell.colspan; occupiedColumnPosition++) { + for (var occupiedRowPosition = 0; occupiedRowPosition < rowCell.rowspan; occupiedRowPosition++) { + var rowPosition = rowCount + occupiedRowPosition; + var columnPosition = start + occupiedColumnPosition; + var newpos = key(rowPosition, columnPosition); + access[newpos] = current; + maxColumns = Math.max(maxColumns, columnPosition + 1); + } + } + currentRow_1.push(current); + }); + maxRows++; + cells.push(rowdata(rowData.element, currentRow_1, rowData.section)); + rowCount++; + } + }); + var grid$1 = grid(maxRows, maxColumns); + return { + grid: grid$1, + access: access, + all: cells, + columns: columns + }; }; var fromTable$1 = function (table) { - var list = fromTable(table); - return generate(list); + var list = fromTable(table); + return generate(list); }; var justCells = function (warehouse) { - return bind(warehouse.all, function (w) { - return w.cells; - }); + return bind(warehouse.all, function (w) { + return w.cells; + }); }; var justColumns = function (warehouse) { - return values(warehouse.columns); + return values(warehouse.columns); }; var hasColumns = function (warehouse) { - return keys(warehouse.columns).length > 0; + return keys(warehouse.columns).length > 0; }; var getColumnAt = function (warehouse, columnIndex) { - return Optional.from(warehouse.columns[columnIndex]); + return Optional.from(warehouse.columns[columnIndex]); }; var Warehouse = { - fromTable: fromTable$1, - generate: generate, - getAt: getAt, - findItem: findItem, - filterItems: filterItems, - justCells: justCells, - justColumns: justColumns, - hasColumns: hasColumns, - getColumnAt: getColumnAt + fromTable: fromTable$1, + generate: generate, + getAt: getAt, + findItem: findItem, + filterItems: filterItems, + justCells: justCells, + justColumns: justColumns, + hasColumns: hasColumns, + getColumnAt: getColumnAt }; var inSelection = function (bounds, detail) { - var leftEdge = detail.column; - var rightEdge = detail.column + detail.colspan - 1; - var topEdge = detail.row; - var bottomEdge = detail.row + detail.rowspan - 1; - return leftEdge <= bounds.finishCol && rightEdge >= bounds.startCol && (topEdge <= bounds.finishRow && bottomEdge >= bounds.startRow); + var leftEdge = detail.column; + var rightEdge = detail.column + detail.colspan - 1; + var topEdge = detail.row; + var bottomEdge = detail.row + detail.rowspan - 1; + return leftEdge <= bounds.finishCol && rightEdge >= bounds.startCol && (topEdge <= bounds.finishRow && bottomEdge >= bounds.startRow); }; var isWithin = function (bounds, detail) { - return detail.column >= bounds.startCol && detail.column + detail.colspan - 1 <= bounds.finishCol && detail.row >= bounds.startRow && detail.row + detail.rowspan - 1 <= bounds.finishRow; + return detail.column >= bounds.startCol && detail.column + detail.colspan - 1 <= bounds.finishCol && detail.row >= bounds.startRow && detail.row + detail.rowspan - 1 <= bounds.finishRow; }; var isRectangular = function (warehouse, bounds) { - var isRect = true; - var detailIsWithin = curry(isWithin, bounds); - for (var i = bounds.startRow; i <= bounds.finishRow; i++) { - for (var j = bounds.startCol; j <= bounds.finishCol; j++) { - isRect = isRect && Warehouse.getAt(warehouse, i, j).exists(detailIsWithin); - } + var isRect = true; + var detailIsWithin = curry(isWithin, bounds); + for (var i = bounds.startRow; i <= bounds.finishRow; i++) { + for (var j = bounds.startCol; j <= bounds.finishCol; j++) { + isRect = isRect && Warehouse.getAt(warehouse, i, j).exists(detailIsWithin); } - return isRect ? Optional.some(bounds) : Optional.none(); + } + return isRect ? Optional.some(bounds) : Optional.none(); }; var getBounds = function (detailA, detailB) { - return bounds(Math.min(detailA.row, detailB.row), Math.min(detailA.column, detailB.column), Math.max(detailA.row + detailA.rowspan - 1, detailB.row + detailB.rowspan - 1), Math.max(detailA.column + detailA.colspan - 1, detailB.column + detailB.colspan - 1)); + return bounds(Math.min(detailA.row, detailB.row), Math.min(detailA.column, detailB.column), Math.max(detailA.row + detailA.rowspan - 1, detailB.row + detailB.rowspan - 1), Math.max(detailA.column + detailA.colspan - 1, detailB.column + detailB.colspan - 1)); }; var getAnyBox = function (warehouse, startCell, finishCell) { - var startCoords = Warehouse.findItem(warehouse, startCell, eq$1); - var finishCoords = Warehouse.findItem(warehouse, finishCell, eq$1); - return startCoords.bind(function (sc) { - return finishCoords.map(function (fc) { - return getBounds(sc, fc); - }); + var startCoords = Warehouse.findItem(warehouse, startCell, eq$1); + var finishCoords = Warehouse.findItem(warehouse, finishCell, eq$1); + return startCoords.bind(function (sc) { + return finishCoords.map(function (fc) { + return getBounds(sc, fc); }); + }); }; var getBox = function (warehouse, startCell, finishCell) { - return getAnyBox(warehouse, startCell, finishCell).bind(function (bounds) { - return isRectangular(warehouse, bounds); - }); + return getAnyBox(warehouse, startCell, finishCell).bind(function (bounds) { + return isRectangular(warehouse, bounds); + }); }; var moveBy = function (warehouse, cell, row, column) { - return Warehouse.findItem(warehouse, cell, eq$1).bind(function (detail) { - var startRow = row > 0 ? detail.row + detail.rowspan - 1 : detail.row; - var startCol = column > 0 ? detail.column + detail.colspan - 1 : detail.column; - var dest = Warehouse.getAt(warehouse, startRow + row, startCol + column); - return dest.map(function (d) { - return d.element; - }); + return Warehouse.findItem(warehouse, cell, eq$1).bind(function (detail) { + var startRow = row > 0 ? detail.row + detail.rowspan - 1 : detail.row; + var startCol = column > 0 ? detail.column + detail.colspan - 1 : detail.column; + var dest = Warehouse.getAt(warehouse, startRow + row, startCol + column); + return dest.map(function (d) { + return d.element; }); + }); }; var intercepts = function (warehouse, start, finish) { - return getAnyBox(warehouse, start, finish).map(function (bounds) { - var inside = Warehouse.filterItems(warehouse, curry(inSelection, bounds)); - return map(inside, function (detail) { - return detail.element; - }); + return getAnyBox(warehouse, start, finish).map(function (bounds) { + var inside = Warehouse.filterItems(warehouse, curry(inSelection, bounds)); + return map(inside, function (detail) { + return detail.element; }); + }); }; var parentCell = function (warehouse, innerCell) { - var isContainedBy = function (c1, c2) { - return contains$2(c2, c1); - }; - return Warehouse.findItem(warehouse, innerCell, isContainedBy).map(function (detail) { - return detail.element; - }); + var isContainedBy = function (c1, c2) { + return contains$2(c2, c1); + }; + return Warehouse.findItem(warehouse, innerCell, isContainedBy).map(function (detail) { + return detail.element; + }); }; var moveBy$1 = function (cell, deltaRow, deltaColumn) { - return table(cell).bind(function (table) { - var warehouse = getWarehouse(table); - return moveBy(warehouse, cell, deltaRow, deltaColumn); - }); + return table(cell).bind(function (table) { + var warehouse = getWarehouse(table); + return moveBy(warehouse, cell, deltaRow, deltaColumn); + }); }; var intercepts$1 = function (table, first, last) { - var warehouse = getWarehouse(table); - return intercepts(warehouse, first, last); + var warehouse = getWarehouse(table); + return intercepts(warehouse, first, last); }; var nestedIntercepts = function (table, first, firstTable, last, lastTable) { - var warehouse = getWarehouse(table); - var optStartCell = eq$1(table, firstTable) ? Optional.some(first) : parentCell(warehouse, first); - var optLastCell = eq$1(table, lastTable) ? Optional.some(last) : parentCell(warehouse, last); - return optStartCell.bind(function (startCell) { - return optLastCell.bind(function (lastCell) { - return intercepts(warehouse, startCell, lastCell); - }); + var warehouse = getWarehouse(table); + var optStartCell = eq$1(table, firstTable) ? Optional.some(first) : parentCell(warehouse, first); + var optLastCell = eq$1(table, lastTable) ? Optional.some(last) : parentCell(warehouse, last); + return optStartCell.bind(function (startCell) { + return optLastCell.bind(function (lastCell) { + return intercepts(warehouse, startCell, lastCell); }); + }); }; var getBox$1 = function (table, first, last) { - var warehouse = getWarehouse(table); - return getBox(warehouse, first, last); + var warehouse = getWarehouse(table); + return getBox(warehouse, first, last); }; var getWarehouse = Warehouse.fromTable; var before = function (marker, element) { - var parent$1 = parent(marker); - parent$1.each(function (v) { - v.dom.insertBefore(element.dom, marker.dom); - }); + var parent$1 = parent(marker); + parent$1.each(function (v) { + v.dom.insertBefore(element.dom, marker.dom); + }); }; var after = function (marker, element) { - var sibling = nextSibling(marker); - sibling.fold(function () { - var parent$1 = parent(marker); - parent$1.each(function (v) { - append(v, element); - }); - }, function (v) { - before(v, element); + var sibling = nextSibling(marker); + sibling.fold(function () { + var parent$1 = parent(marker); + parent$1.each(function (v) { + append(v, element); }); + }, function (v) { + before(v, element); + }); }; var prepend = function (parent, element) { - var firstChild$1 = firstChild(parent); - firstChild$1.fold(function () { - append(parent, element); - }, function (v) { - parent.dom.insertBefore(element.dom, v.dom); - }); + var firstChild$1 = firstChild(parent); + firstChild$1.fold(function () { + append(parent, element); + }, function (v) { + parent.dom.insertBefore(element.dom, v.dom); + }); }; var append = function (parent, element) { - parent.dom.appendChild(element.dom); + parent.dom.appendChild(element.dom); }; var wrap = function (element, wrapper) { - before(element, wrapper); - append(wrapper, element); + before(element, wrapper); + append(wrapper, element); }; var before$1 = function (marker, elements) { - each(elements, function (x) { - before(marker, x); - }); + each(elements, function (x) { + before(marker, x); + }); }; var after$1 = function (marker, elements) { - each(elements, function (x, i) { - var e = i === 0 ? marker : elements[i - 1]; - after(e, x); - }); + each(elements, function (x, i) { + var e = i === 0 ? marker : elements[i - 1]; + after(e, x); + }); }; var append$1 = function (parent, elements) { - each(elements, function (x) { - append(parent, x); - }); + each(elements, function (x) { + append(parent, x); + }); }; var empty = function (element) { - element.dom.textContent = ''; - each(children(element), function (rogue) { - remove$2(rogue); - }); + element.dom.textContent = ''; + each(children(element), function (rogue) { + remove$2(rogue); + }); }; var remove$2 = function (element) { - var dom = element.dom; - if (dom.parentNode !== null) { - dom.parentNode.removeChild(dom); - } + var dom = element.dom; + if (dom.parentNode !== null) { + dom.parentNode.removeChild(dom); + } }; var unwrap = function (wrapper) { - var children$1 = children(wrapper); - if (children$1.length > 0) { - before$1(wrapper, children$1); - } - remove$2(wrapper); - }; - - function NodeValue(is, name) { - var get = function (element) { - if (!is(element)) { - throw new Error('Can only get ' + name + ' value of a ' + name + ' node'); - } - return getOption(element).getOr(''); - }; - var getOption = function (element) { - return is(element) ? Optional.from(element.dom.nodeValue) : Optional.none(); - }; - var set = function (element, value) { - if (!is(element)) { - throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node'); - } - element.dom.nodeValue = value; - }; - return { - get: get, - getOption: getOption, - set: set - }; + var children$1 = children(wrapper); + if (children$1.length > 0) { + before$1(wrapper, children$1); + } + remove$2(wrapper); + }; + + function NodeValue (is, name) { + var get = function (element) { + if (!is(element)) { + throw new Error('Can only get ' + name + ' value of a ' + name + ' node'); + } + return getOption(element).getOr(''); + }; + var getOption = function (element) { + return is(element) ? Optional.from(element.dom.nodeValue) : Optional.none(); + }; + var set = function (element, value) { + if (!is(element)) { + throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node'); + } + element.dom.nodeValue = value; + }; + return { + get: get, + getOption: getOption, + set: set + }; } var api = NodeValue(isText, 'text'); var get$4 = function (element) { - return api.get(element); + return api.get(element); }; var getOption = function (element) { - return api.getOption(element); + return api.getOption(element); }; var set$2 = function (element, value) { - return api.set(element, value); + return api.set(element, value); }; var TagBoundaries = [ - 'body', - 'p', - 'div', - 'article', - 'aside', - 'figcaption', - 'figure', - 'footer', - 'header', - 'nav', - 'section', - 'ol', - 'ul', - 'li', - 'table', - 'thead', - 'tbody', - 'tfoot', - 'caption', - 'tr', - 'td', - 'th', - 'h1', - 'h2', - 'h3', - 'h4', - 'h5', - 'h6', - 'blockquote', - 'pre', - 'address' + 'body', + 'p', + 'div', + 'article', + 'aside', + 'figcaption', + 'figure', + 'footer', + 'header', + 'nav', + 'section', + 'ol', + 'ul', + 'li', + 'table', + 'thead', + 'tbody', + 'tfoot', + 'caption', + 'tr', + 'td', + 'th', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'blockquote', + 'pre', + 'address' ]; - function DomUniverse() { - var clone$1 = function (element) { - return SugarElement.fromDom(element.dom.cloneNode(false)); - }; - var document = function (element) { - return documentOrOwner(element).dom; - }; - var isBoundary = function (element) { - if (!isElement(element)) { - return false; - } - if (name(element) === 'body') { - return true; - } - return contains(TagBoundaries, name(element)); - }; - var isEmptyTag = function (element) { - if (!isElement(element)) { - return false; - } - return contains([ - 'br', - 'img', - 'hr', - 'input' - ], name(element)); - }; - var isNonEditable = function (element) { - return isElement(element) && get$2(element, 'contenteditable') === 'false'; - }; - var comparePosition = function (element, other) { - return element.dom.compareDocumentPosition(other.dom); - }; - var copyAttributesTo = function (source, destination) { - var as = clone(source); - setAll(destination, as); - }; - return { - up: constant({ - selector: ancestor$1, - closest: closest$1, - predicate: ancestor, - all: parents - }), - down: constant({ - selector: descendants$1, - predicate: descendants - }), - styles: constant({ - get: get$3, - getRaw: getRaw, - set: set$1, - remove: remove$1 - }), - attrs: constant({ - get: get$2, - set: set, - remove: remove, - copyTo: copyAttributesTo - }), - insert: constant({ - before: before, - after: after, - afterAll: after$1, - append: append, - appendAll: append$1, - prepend: prepend, - wrap: wrap - }), - remove: constant({ - unwrap: unwrap, - remove: remove$2 - }), - create: constant({ - nu: SugarElement.fromTag, - clone: clone$1, - text: SugarElement.fromText - }), - query: constant({ - comparePosition: comparePosition, - prevSibling: prevSibling, - nextSibling: nextSibling - }), - property: constant({ - children: children, - name: name, - parent: parent, - document: document, - isText: isText, - isComment: isComment, - isElement: isElement, - getText: get$4, - setText: set$2, - isBoundary: isBoundary, - isEmptyTag: isEmptyTag, - isNonEditable: isNonEditable - }), - eq: eq$1, - is: is$1 - }; + function DomUniverse () { + var clone$1 = function (element) { + return SugarElement.fromDom(element.dom.cloneNode(false)); + }; + var document = function (element) { + return documentOrOwner(element).dom; + }; + var isBoundary = function (element) { + if (!isElement(element)) { + return false; + } + if (name(element) === 'body') { + return true; + } + return contains(TagBoundaries, name(element)); + }; + var isEmptyTag = function (element) { + if (!isElement(element)) { + return false; + } + return contains([ + 'br', + 'img', + 'hr', + 'input' + ], name(element)); + }; + var isNonEditable = function (element) { + return isElement(element) && get$2(element, 'contenteditable') === 'false'; + }; + var comparePosition = function (element, other) { + return element.dom.compareDocumentPosition(other.dom); + }; + var copyAttributesTo = function (source, destination) { + var as = clone(source); + setAll(destination, as); + }; + return { + up: constant({ + selector: ancestor$1, + closest: closest$1, + predicate: ancestor, + all: parents + }), + down: constant({ + selector: descendants$1, + predicate: descendants + }), + styles: constant({ + get: get$3, + getRaw: getRaw, + set: set$1, + remove: remove$1 + }), + attrs: constant({ + get: get$2, + set: set, + remove: remove, + copyTo: copyAttributesTo + }), + insert: constant({ + before: before, + after: after, + afterAll: after$1, + append: append, + appendAll: append$1, + prepend: prepend, + wrap: wrap + }), + remove: constant({ + unwrap: unwrap, + remove: remove$2 + }), + create: constant({ + nu: SugarElement.fromTag, + clone: clone$1, + text: SugarElement.fromText + }), + query: constant({ + comparePosition: comparePosition, + prevSibling: prevSibling, + nextSibling: nextSibling + }), + property: constant({ + children: children, + name: name, + parent: parent, + document: document, + isText: isText, + isComment: isComment, + isElement: isElement, + getText: get$4, + setText: set$2, + isBoundary: isBoundary, + isEmptyTag: isEmptyTag, + isNonEditable: isNonEditable + }), + eq: eq$1, + is: is$1 + }; } var all$1 = function (universe, look, elements, f) { - var head = elements[0]; - var tail = elements.slice(1); - return f(universe, look, head, tail); + var head = elements[0]; + var tail = elements.slice(1); + return f(universe, look, head, tail); }; var oneAll = function (universe, look, elements) { - return elements.length > 0 ? all$1(universe, look, elements, unsafeOne) : Optional.none(); + return elements.length > 0 ? all$1(universe, look, elements, unsafeOne) : Optional.none(); }; var unsafeOne = function (universe, look, head, tail) { - var start = look(universe, head); - return foldr(tail, function (b, a) { - var current = look(universe, a); - return commonElement(universe, b, current); - }, start); + var start = look(universe, head); + return foldr(tail, function (b, a) { + var current = look(universe, a); + return commonElement(universe, b, current); + }, start); }; var commonElement = function (universe, start, end) { - return start.bind(function (s) { - return end.filter(curry(universe.eq, s)); - }); + return start.bind(function (s) { + return end.filter(curry(universe.eq, s)); + }); }; var eq$2 = function (universe, item) { - return curry(universe.eq, item); + return curry(universe.eq, item); }; var ancestors$2 = function (universe, start, end, isRoot) { - if (isRoot === void 0) { - isRoot = never; - } - var ps1 = [start].concat(universe.up().all(start)); - var ps2 = [end].concat(universe.up().all(end)); - var prune = function (path) { - var index = findIndex(path, isRoot); - return index.fold(function () { - return path; - }, function (ind) { - return path.slice(0, ind + 1); - }); - }; - var pruned1 = prune(ps1); - var pruned2 = prune(ps2); - var shared = find(pruned1, function (x) { - return exists(pruned2, eq$2(universe, x)); + if (isRoot === void 0) { + isRoot = never; + } + var ps1 = [start].concat(universe.up().all(start)); + var ps2 = [end].concat(universe.up().all(end)); + var prune = function (path) { + var index = findIndex(path, isRoot); + return index.fold(function () { + return path; + }, function (ind) { + return path.slice(0, ind + 1); }); - return { - firstpath: pruned1, - secondpath: pruned2, - shared: shared - }; + }; + var pruned1 = prune(ps1); + var pruned2 = prune(ps2); + var shared = find(pruned1, function (x) { + return exists(pruned2, eq$2(universe, x)); + }); + return { + firstpath: pruned1, + secondpath: pruned2, + shared: shared + }; }; var sharedOne = oneAll; @@ -1941,554 +1938,554 @@ var universe = DomUniverse(); var sharedOne$1 = function (look, elements) { - return sharedOne(universe, function (_universe, element) { - return look(element); - }, elements); + return sharedOne(universe, function (_universe, element) { + return look(element); + }, elements); }; var ancestors$4 = function (start, finish, isRoot) { - return ancestors$3(universe, start, finish, isRoot); + return ancestors$3(universe, start, finish, isRoot); }; var lookupTable = function (container) { - return ancestor$1(container, 'table'); + return ancestor$1(container, 'table'); }; var identify = function (start, finish, isRoot) { - var getIsRoot = function (rootTable) { - return function (element) { - return isRoot !== undefined && isRoot(element) || eq$1(element, rootTable); - }; - }; - if (eq$1(start, finish)) { - return Optional.some({ - boxes: Optional.some([start]), + var getIsRoot = function (rootTable) { + return function (element) { + return isRoot !== undefined && isRoot(element) || eq$1(element, rootTable); + }; + }; + if (eq$1(start, finish)) { + return Optional.some({ + boxes: Optional.some([start]), + start: start, + finish: finish + }); + } else { + return lookupTable(start).bind(function (startTable) { + return lookupTable(finish).bind(function (finishTable) { + if (eq$1(startTable, finishTable)) { + return Optional.some({ + boxes: intercepts$1(startTable, start, finish), start: start, finish: finish - }); - } else { - return lookupTable(start).bind(function (startTable) { - return lookupTable(finish).bind(function (finishTable) { - if (eq$1(startTable, finishTable)) { - return Optional.some({ - boxes: intercepts$1(startTable, start, finish), - start: start, - finish: finish - }); - } else if (contains$2(startTable, finishTable)) { - var ancestorCells = ancestors$1(finish, 'td,th', getIsRoot(startTable)); - var finishCell = ancestorCells.length > 0 ? ancestorCells[ancestorCells.length - 1] : finish; - return Optional.some({ - boxes: nestedIntercepts(startTable, start, startTable, finish, finishTable), - start: start, - finish: finishCell - }); - } else if (contains$2(finishTable, startTable)) { - var ancestorCells = ancestors$1(start, 'td,th', getIsRoot(finishTable)); - var startCell = ancestorCells.length > 0 ? ancestorCells[ancestorCells.length - 1] : start; - return Optional.some({ - boxes: nestedIntercepts(finishTable, start, startTable, finish, finishTable), - start: start, - finish: startCell - }); - } else { - return ancestors$4(start, finish).shared.bind(function (lca) { - return closest$1(lca, 'table', isRoot).bind(function (lcaTable) { - var finishAncestorCells = ancestors$1(finish, 'td,th', getIsRoot(lcaTable)); - var finishCell = finishAncestorCells.length > 0 ? finishAncestorCells[finishAncestorCells.length - 1] : finish; - var startAncestorCells = ancestors$1(start, 'td,th', getIsRoot(lcaTable)); - var startCell = startAncestorCells.length > 0 ? startAncestorCells[startAncestorCells.length - 1] : start; - return Optional.some({ - boxes: nestedIntercepts(lcaTable, start, startTable, finish, finishTable), - start: startCell, - finish: finishCell - }); - }); - }); - } + }); + } else if (contains$2(startTable, finishTable)) { + var ancestorCells = ancestors$1(finish, 'td,th', getIsRoot(startTable)); + var finishCell = ancestorCells.length > 0 ? ancestorCells[ancestorCells.length - 1] : finish; + return Optional.some({ + boxes: nestedIntercepts(startTable, start, startTable, finish, finishTable), + start: start, + finish: finishCell + }); + } else if (contains$2(finishTable, startTable)) { + var ancestorCells = ancestors$1(start, 'td,th', getIsRoot(finishTable)); + var startCell = ancestorCells.length > 0 ? ancestorCells[ancestorCells.length - 1] : start; + return Optional.some({ + boxes: nestedIntercepts(finishTable, start, startTable, finish, finishTable), + start: start, + finish: startCell + }); + } else { + return ancestors$4(start, finish).shared.bind(function (lca) { + return closest$1(lca, 'table', isRoot).bind(function (lcaTable) { + var finishAncestorCells = ancestors$1(finish, 'td,th', getIsRoot(lcaTable)); + var finishCell = finishAncestorCells.length > 0 ? finishAncestorCells[finishAncestorCells.length - 1] : finish; + var startAncestorCells = ancestors$1(start, 'td,th', getIsRoot(lcaTable)); + var startCell = startAncestorCells.length > 0 ? startAncestorCells[startAncestorCells.length - 1] : start; + return Optional.some({ + boxes: nestedIntercepts(lcaTable, start, startTable, finish, finishTable), + start: startCell, + finish: finishCell + }); }); - }); - } + }); + } + }); + }); + } }; var retrieve = function (container, selector) { - var sels = descendants$1(container, selector); - return sels.length > 0 ? Optional.some(sels) : Optional.none(); + var sels = descendants$1(container, selector); + return sels.length > 0 ? Optional.some(sels) : Optional.none(); }; var getLast = function (boxes, lastSelectedSelector) { - return find(boxes, function (box) { - return is(box, lastSelectedSelector); - }); + return find(boxes, function (box) { + return is(box, lastSelectedSelector); + }); }; var getEdges = function (container, firstSelectedSelector, lastSelectedSelector) { - return descendant$1(container, firstSelectedSelector).bind(function (first) { - return descendant$1(container, lastSelectedSelector).bind(function (last) { - return sharedOne$1(lookupTable, [ - first, - last - ]).map(function (table) { - return { - first: first, - last: last, - table: table - }; - }); - }); + return descendant$1(container, firstSelectedSelector).bind(function (first) { + return descendant$1(container, lastSelectedSelector).bind(function (last) { + return sharedOne$1(lookupTable, [ + first, + last + ]).map(function (table) { + return { + first: first, + last: last, + table: table + }; + }); }); + }); }; var expandTo = function (finish, firstSelectedSelector) { - return ancestor$1(finish, 'table').bind(function (table) { - return descendant$1(table, firstSelectedSelector).bind(function (start) { - return identify(start, finish).bind(function (identified) { - return identified.boxes.map(function (boxes) { - return { - boxes: boxes, - start: identified.start, - finish: identified.finish - }; - }); - }); + return ancestor$1(finish, 'table').bind(function (table) { + return descendant$1(table, firstSelectedSelector).bind(function (start) { + return identify(start, finish).bind(function (identified) { + return identified.boxes.map(function (boxes) { + return { + boxes: boxes, + start: identified.start, + finish: identified.finish + }; }); + }); }); + }); }; var shiftSelection = function (boxes, deltaRow, deltaColumn, firstSelectedSelector, lastSelectedSelector) { - return getLast(boxes, lastSelectedSelector).bind(function (last) { - return moveBy$1(last, deltaRow, deltaColumn).bind(function (finish) { - return expandTo(finish, firstSelectedSelector); - }); + return getLast(boxes, lastSelectedSelector).bind(function (last) { + return moveBy$1(last, deltaRow, deltaColumn).bind(function (finish) { + return expandTo(finish, firstSelectedSelector); }); + }); }; var retrieve$1 = function (container, selector) { - return retrieve(container, selector); + return retrieve(container, selector); }; var retrieveBox = function (container, firstSelectedSelector, lastSelectedSelector) { - return getEdges(container, firstSelectedSelector, lastSelectedSelector).bind(function (edges) { - var isRoot = function (ancestor) { - return eq$1(container, ancestor); - }; - var sectionSelector = 'thead,tfoot,tbody,table'; - var firstAncestor = ancestor$1(edges.first, sectionSelector, isRoot); - var lastAncestor = ancestor$1(edges.last, sectionSelector, isRoot); - return firstAncestor.bind(function (fA) { - return lastAncestor.bind(function (lA) { - return eq$1(fA, lA) ? getBox$1(edges.table, edges.first, edges.last) : Optional.none(); - }); - }); + return getEdges(container, firstSelectedSelector, lastSelectedSelector).bind(function (edges) { + var isRoot = function (ancestor) { + return eq$1(container, ancestor); + }; + var sectionSelector = 'thead,tfoot,tbody,table'; + var firstAncestor = ancestor$1(edges.first, sectionSelector, isRoot); + var lastAncestor = ancestor$1(edges.last, sectionSelector, isRoot); + return firstAncestor.bind(function (fA) { + return lastAncestor.bind(function (lA) { + return eq$1(fA, lA) ? getBox$1(edges.table, edges.first, edges.last) : Optional.none(); + }); }); + }); }; var generate$1 = function (cases) { - if (!isArray(cases)) { - throw new Error('cases must be an array'); - } - if (cases.length === 0) { - throw new Error('there must be at least one case'); - } - var constructors = []; - var adt = {}; - each(cases, function (acase, count) { - var keys$1 = keys(acase); - if (keys$1.length !== 1) { - throw new Error('one and only one name per case'); - } - var key = keys$1[0]; - var value = acase[key]; - if (adt[key] !== undefined) { - throw new Error('duplicate key detected:' + key); - } else if (key === 'cata') { - throw new Error('cannot have a case named cata (sorry)'); - } else if (!isArray(value)) { - throw new Error('case arguments must be an array'); + if (!isArray(cases)) { + throw new Error('cases must be an array'); + } + if (cases.length === 0) { + throw new Error('there must be at least one case'); + } + var constructors = []; + var adt = {}; + each(cases, function (acase, count) { + var keys$1 = keys(acase); + if (keys$1.length !== 1) { + throw new Error('one and only one name per case'); + } + var key = keys$1[0]; + var value = acase[key]; + if (adt[key] !== undefined) { + throw new Error('duplicate key detected:' + key); + } else if (key === 'cata') { + throw new Error('cannot have a case named cata (sorry)'); + } else if (!isArray(value)) { + throw new Error('case arguments must be an array'); + } + constructors.push(key); + adt[key] = function () { + var argLength = arguments.length; + if (argLength !== value.length) { + throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength); + } + var args = new Array(argLength); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + var match = function (branches) { + var branchKeys = keys(branches); + if (constructors.length !== branchKeys.length) { + throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\nActual: ' + branchKeys.join(',')); + } + var allReqd = forall(constructors, function (reqKey) { + return contains(branchKeys, reqKey); + }); + if (!allReqd) { + throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', ')); + } + return branches[key].apply(null, args); + }; + return { + fold: function () { + if (arguments.length !== cases.length) { + throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + arguments.length); + } + var target = arguments[count]; + return target.apply(null, args); + }, + match: match, + log: function (label) { + console.log(label, { + constructors: constructors, + constructor: key, + params: args + }); } - constructors.push(key); - adt[key] = function () { - var argLength = arguments.length; - if (argLength !== value.length) { - throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength); - } - var args = new Array(argLength); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - var match = function (branches) { - var branchKeys = keys(branches); - if (constructors.length !== branchKeys.length) { - throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\nActual: ' + branchKeys.join(',')); - } - var allReqd = forall(constructors, function (reqKey) { - return contains(branchKeys, reqKey); - }); - if (!allReqd) { - throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', ')); - } - return branches[key].apply(null, args); - }; - return { - fold: function () { - if (arguments.length !== cases.length) { - throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + arguments.length); - } - var target = arguments[count]; - return target.apply(null, args); - }, - match: match, - log: function (label) { - console.log(label, { - constructors: constructors, - constructor: key, - params: args - }); - } - }; - }; - }); - return adt; + }; + }; + }); + return adt; }; - var Adt = {generate: generate$1}; + var Adt = { generate: generate$1 }; var type$1 = Adt.generate([ - {none: []}, - {multiple: ['elements']}, - {single: ['element']} + { none: [] }, + { multiple: ['elements'] }, + { single: ['element'] } ]); var cata = function (subject, onNone, onMultiple, onSingle) { - return subject.fold(onNone, onMultiple, onSingle); + return subject.fold(onNone, onMultiple, onSingle); }; var none$1 = type$1.none; var multiple = type$1.multiple; var single = type$1.single; var Selections = function (lazyRoot, getStart, selectedSelector) { - var get = function () { - return retrieve$1(lazyRoot(), selectedSelector).fold(function () { - return getStart().map(single).getOrThunk(none$1); - }, function (cells) { - return multiple(cells); - }); - }; - return {get: get}; + var get = function () { + return retrieve$1(lazyRoot(), selectedSelector).fold(function () { + return getStart().map(single).getOrThunk(none$1); + }, function (cells) { + return multiple(cells); + }); + }; + return { get: get }; }; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var statsStruct = function (minRow, minCol, maxRow, maxCol) { - return { - minRow: minRow, - minCol: minCol, - maxRow: maxRow, - maxCol: maxCol - }; + return { + minRow: minRow, + minCol: minCol, + maxRow: maxRow, + maxCol: maxCol + }; }; var findSelectedStats = function (house, isSelected) { - var totalColumns = house.grid.columns; - var totalRows = house.grid.rows; - var minRow = totalRows; - var minCol = totalColumns; - var maxRow = 0; - var maxCol = 0; - each$1(house.access, function (detail) { - if (isSelected(detail)) { - var startRow = detail.row; - var endRow = startRow + detail.rowspan - 1; - var startCol = detail.column; - var endCol = startCol + detail.colspan - 1; - if (startRow < minRow) { - minRow = startRow; - } else if (endRow > maxRow) { - maxRow = endRow; - } - if (startCol < minCol) { - minCol = startCol; - } else if (endCol > maxCol) { - maxCol = endCol; - } - } - }); - return statsStruct(minRow, minCol, maxRow, maxCol); + var totalColumns = house.grid.columns; + var totalRows = house.grid.rows; + var minRow = totalRows; + var minCol = totalColumns; + var maxRow = 0; + var maxCol = 0; + each$1(house.access, function (detail) { + if (isSelected(detail)) { + var startRow = detail.row; + var endRow = startRow + detail.rowspan - 1; + var startCol = detail.column; + var endCol = startCol + detail.colspan - 1; + if (startRow < minRow) { + minRow = startRow; + } else if (endRow > maxRow) { + maxRow = endRow; + } + if (startCol < minCol) { + minCol = startCol; + } else if (endCol > maxCol) { + maxCol = endCol; + } + } + }); + return statsStruct(minRow, minCol, maxRow, maxCol); }; var makeCell = function (list, seenSelected, rowIndex) { - var row = list[rowIndex].element; - var td = SugarElement.fromTag('td'); - append(td, SugarElement.fromTag('br')); - var f = seenSelected ? append : prepend; - f(row, td); + var row = list[rowIndex].element; + var td = SugarElement.fromTag('td'); + append(td, SugarElement.fromTag('br')); + var f = seenSelected ? append : prepend; + f(row, td); }; var fillInGaps = function (list, house, stats, isSelected) { - var totalColumns = house.grid.columns; - var totalRows = house.grid.rows; - for (var i = 0; i < totalRows; i++) { - var seenSelected = false; - for (var j = 0; j < totalColumns; j++) { - if (!(i < stats.minRow || i > stats.maxRow || j < stats.minCol || j > stats.maxCol)) { - var needCell = Warehouse.getAt(house, i, j).filter(isSelected).isNone(); - if (needCell) { - makeCell(list, seenSelected, i); - } else { - seenSelected = true; - } - } + var totalColumns = house.grid.columns; + var totalRows = house.grid.rows; + for (var i = 0; i < totalRows; i++) { + var seenSelected = false; + for (var j = 0; j < totalColumns; j++) { + if (!(i < stats.minRow || i > stats.maxRow || j < stats.minCol || j > stats.maxCol)) { + var needCell = Warehouse.getAt(house, i, j).filter(isSelected).isNone(); + if (needCell) { + makeCell(list, seenSelected, i); + } else { + seenSelected = true; } + } } + } }; var clean = function (table, stats) { - var emptyRows = filter(firstLayer(table, 'tr'), function (row) { - return row.dom.childElementCount === 0; - }); - each(emptyRows, remove$2); - if (stats.minCol === stats.maxCol || stats.minRow === stats.maxRow) { - each(firstLayer(table, 'th,td'), function (cell) { - remove(cell, 'rowspan'); - remove(cell, 'colspan'); - }); - } - remove(table, 'width'); - remove(table, 'height'); - remove$1(table, 'width'); - remove$1(table, 'height'); + var emptyRows = filter(firstLayer(table, 'tr'), function (row) { + return row.dom.childElementCount === 0; + }); + each(emptyRows, remove$2); + if (stats.minCol === stats.maxCol || stats.minRow === stats.maxRow) { + each(firstLayer(table, 'th,td'), function (cell) { + remove(cell, 'rowspan'); + remove(cell, 'colspan'); + }); + } + remove(table, 'width'); + remove(table, 'height'); + remove$1(table, 'width'); + remove$1(table, 'height'); }; var extract = function (table, selectedSelector) { - var isSelected = function (detail) { - return is(detail.element, selectedSelector); - }; - var list = fromTable(table); - var house = Warehouse.generate(list); - var stats = findSelectedStats(house, isSelected); - var selector = 'th:not(' + selectedSelector + ')' + ',td:not(' + selectedSelector + ')'; - var unselectedCells = filterFirstLayer(table, 'th,td', function (cell) { - return is(cell, selector); - }); - each(unselectedCells, remove$2); - fillInGaps(list, house, stats, isSelected); - clean(table, stats); - return table; + var isSelected = function (detail) { + return is(detail.element, selectedSelector); + }; + var list = fromTable(table); + var house = Warehouse.generate(list); + var stats = findSelectedStats(house, isSelected); + var selector = 'th:not(' + selectedSelector + ')' + ',td:not(' + selectedSelector + ')'; + var unselectedCells = filterFirstLayer(table, 'th,td', function (cell) { + return is(cell, selector); + }); + each(unselectedCells, remove$2); + fillInGaps(list, house, stats, isSelected); + clean(table, stats); + return table; }; var nbsp = '\xA0'; var getEnd = function (element) { - return name(element) === 'img' ? 1 : getOption(element).fold(function () { - return children(element).length; - }, function (v) { - return v.length; - }); + return name(element) === 'img' ? 1 : getOption(element).fold(function () { + return children(element).length; + }, function (v) { + return v.length; + }); }; var isTextNodeWithCursorPosition = function (el) { - return getOption(el).filter(function (text) { - return text.trim().length !== 0 || text.indexOf(nbsp) > -1; - }).isSome(); + return getOption(el).filter(function (text) { + return text.trim().length !== 0 || text.indexOf(nbsp) > -1; + }).isSome(); }; var elementsWithCursorPosition = [ - 'img', - 'br' + 'img', + 'br' ]; var isCursorPosition = function (elem) { - var hasCursorPosition = isTextNodeWithCursorPosition(elem); - return hasCursorPosition || contains(elementsWithCursorPosition, name(elem)); + var hasCursorPosition = isTextNodeWithCursorPosition(elem); + return hasCursorPosition || contains(elementsWithCursorPosition, name(elem)); }; var first = function (element) { - return descendant(element, isCursorPosition); + return descendant(element, isCursorPosition); }; var last$1 = function (element) { - return descendantRtl(element, isCursorPosition); + return descendantRtl(element, isCursorPosition); }; var descendantRtl = function (scope, predicate) { - var descend = function (element) { - var children$1 = children(element); - for (var i = children$1.length - 1; i >= 0; i--) { - var child = children$1[i]; - if (predicate(child)) { - return Optional.some(child); - } - var res = descend(child); - if (res.isSome()) { - return res; - } - } - return Optional.none(); - }; - return descend(scope); + var descend = function (element) { + var children$1 = children(element); + for (var i = children$1.length - 1; i >= 0; i--) { + var child = children$1[i]; + if (predicate(child)) { + return Optional.some(child); + } + var res = descend(child); + if (res.isSome()) { + return res; + } + } + return Optional.none(); + }; + return descend(scope); }; var clone$1 = function (original, isDeep) { - return SugarElement.fromDom(original.dom.cloneNode(isDeep)); + return SugarElement.fromDom(original.dom.cloneNode(isDeep)); }; var shallow = function (original) { - return clone$1(original, false); + return clone$1(original, false); }; var deep = function (original) { - return clone$1(original, true); + return clone$1(original, true); }; var shallowAs = function (original, tag) { - var nu = SugarElement.fromTag(tag); - var attributes = clone(original); - setAll(nu, attributes); - return nu; + var nu = SugarElement.fromTag(tag); + var attributes = clone(original); + setAll(nu, attributes); + return nu; }; var copy$1 = function (original, tag) { - var nu = shallowAs(original, tag); - var cloneChildren = children(deep(original)); - append$1(nu, cloneChildren); - return nu; + var nu = shallowAs(original, tag); + var cloneChildren = children(deep(original)); + append$1(nu, cloneChildren); + return nu; }; var transferableAttributes = { - scope: [ - 'row', - 'col' - ] + scope: [ + 'row', + 'col' + ] }; var createCell = function () { - var td = SugarElement.fromTag('td'); - append(td, SugarElement.fromTag('br')); - return td; + var td = SugarElement.fromTag('td'); + append(td, SugarElement.fromTag('br')); + return td; }; var createCol = function () { - return SugarElement.fromTag('col'); + return SugarElement.fromTag('col'); }; var createColgroup = function () { - return SugarElement.fromTag('colgroup'); + return SugarElement.fromTag('colgroup'); }; var replace = function (cell, tag, attrs) { - var replica = copy$1(cell, tag); - each$1(attrs, function (v, k) { - if (v === null) { - remove(replica, k); - } else { - set(replica, k, v); - } - }); - return replica; + var replica = copy$1(cell, tag); + each$1(attrs, function (v, k) { + if (v === null) { + remove(replica, k); + } else { + set(replica, k, v); + } + }); + return replica; }; var pasteReplace = function (cell) { - return cell; + return cell; }; var newRow = function (doc) { - return function () { - return SugarElement.fromTag('tr', doc.dom); - }; + return function () { + return SugarElement.fromTag('tr', doc.dom); + }; }; var cloneFormats = function (oldCell, newCell, formats) { - var first$1 = first(oldCell); - return first$1.map(function (firstText) { - var formatSelector = formats.join(','); - var parents = ancestors$1(firstText, formatSelector, function (element) { - return eq$1(element, oldCell); - }); - return foldr(parents, function (last, parent) { - var clonedFormat = shallow(parent); - remove(clonedFormat, 'contenteditable'); - append(last, clonedFormat); - return clonedFormat; - }, newCell); - }).getOr(newCell); + var first$1 = first(oldCell); + return first$1.map(function (firstText) { + var formatSelector = formats.join(','); + var parents = ancestors$1(firstText, formatSelector, function (element) { + return eq$1(element, oldCell); + }); + return foldr(parents, function (last, parent) { + var clonedFormat = shallow(parent); + remove(clonedFormat, 'contenteditable'); + append(last, clonedFormat); + return clonedFormat; + }, newCell); + }).getOr(newCell); }; var cloneAppropriateAttributes = function (original, clone) { - each$1(transferableAttributes, function (validAttributes, attributeName) { - return getOpt(original, attributeName).filter(function (attribute) { - return contains(validAttributes, attribute); - }).each(function (attribute) { - return set(clone, attributeName, attribute); - }); + each$1(transferableAttributes, function (validAttributes, attributeName) { + return getOpt(original, attributeName).filter(function (attribute) { + return contains(validAttributes, attribute); + }).each(function (attribute) { + return set(clone, attributeName, attribute); }); + }); }; var cellOperations = function (mutate, doc, formatsToClone) { - var cloneCss = function (prev, clone) { - copy(prev.element, clone); - remove$1(clone, 'height'); - if (prev.colspan !== 1) { - remove$1(prev.element, 'width'); - } - }; - var newCell = function (prev) { - var docu = owner(prev.element); - var td = SugarElement.fromTag(name(prev.element), docu.dom); - var formats = formatsToClone.getOr([ - 'strong', - 'em', - 'b', - 'i', - 'span', - 'font', - 'h1', - 'h2', - 'h3', - 'h4', - 'h5', - 'h6', - 'p', - 'div' - ]); - var lastNode = formats.length > 0 ? cloneFormats(prev.element, td, formats) : td; - append(lastNode, SugarElement.fromTag('br')); - cloneCss(prev, td); - cloneAppropriateAttributes(prev.element, td); - mutate(prev.element, td); - return td; - }; - var newCol = function (prev) { - var doc = owner(prev.element); - var col = SugarElement.fromTag(name(prev.element), doc.dom); - cloneCss(prev, col); - mutate(prev.element, col); - return col; - }; - return { - col: newCol, - colgroup: createColgroup, - row: newRow(doc), - cell: newCell, - replace: replace, - gap: createCell - }; + var cloneCss = function (prev, clone) { + copy(prev.element, clone); + remove$1(clone, 'height'); + if (prev.colspan !== 1) { + remove$1(prev.element, 'width'); + } + }; + var newCell = function (prev) { + var docu = owner(prev.element); + var td = SugarElement.fromTag(name(prev.element), docu.dom); + var formats = formatsToClone.getOr([ + 'strong', + 'em', + 'b', + 'i', + 'span', + 'font', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'p', + 'div' + ]); + var lastNode = formats.length > 0 ? cloneFormats(prev.element, td, formats) : td; + append(lastNode, SugarElement.fromTag('br')); + cloneCss(prev, td); + cloneAppropriateAttributes(prev.element, td); + mutate(prev.element, td); + return td; + }; + var newCol = function (prev) { + var doc = owner(prev.element); + var col = SugarElement.fromTag(name(prev.element), doc.dom); + cloneCss(prev, col); + mutate(prev.element, col); + return col; + }; + return { + col: newCol, + colgroup: createColgroup, + row: newRow(doc), + cell: newCell, + replace: replace, + gap: createCell + }; }; var paste = function (doc) { - return { - col: createCol, - colgroup: createColgroup, - row: newRow(doc), - cell: createCell, - replace: pasteReplace, - gap: createCell - }; + return { + col: createCol, + colgroup: createColgroup, + row: newRow(doc), + cell: createCell, + replace: pasteReplace, + gap: createCell + }; }; var fromHtml$1 = function (html, scope) { - var doc = scope || document; - var div = doc.createElement('div'); - div.innerHTML = html; - return children(SugarElement.fromDom(div)); + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + return children(SugarElement.fromDom(div)); }; var fromDom$1 = function (nodes) { - return map(nodes, SugarElement.fromDom); + return map(nodes, SugarElement.fromDom); }; var selection = function (selections) { - return cata(selections.get(), constant([]), identity, pure); + return cata(selections.get(), constant([]), identity, pure); }; var unmergable = function (selections) { - var hasSpan = function (elem, type) { - return getOpt(elem, type).exists(function (span) { - return parseInt(span, 10) > 1; - }); - }; - var hasRowOrColSpan = function (elem) { - return hasSpan(elem, 'rowspan') || hasSpan(elem, 'colspan'); - }; - var candidates = selection(selections); - return candidates.length > 0 && forall(candidates, hasRowOrColSpan) ? Optional.some(candidates) : Optional.none(); + var hasSpan = function (elem, type) { + return getOpt(elem, type).exists(function (span) { + return parseInt(span, 10) > 1; + }); + }; + var hasRowOrColSpan = function (elem) { + return hasSpan(elem, 'rowspan') || hasSpan(elem, 'colspan'); + }; + var candidates = selection(selections); + return candidates.length > 0 && forall(candidates, hasRowOrColSpan) ? Optional.some(candidates) : Optional.none(); }; var mergable = function (table, selections, ephemera) { - return cata(selections.get(), Optional.none, function (cells) { - if (cells.length <= 1) { - return Optional.none(); - } else { - return retrieveBox(table, ephemera.firstSelectedSelector, ephemera.lastSelectedSelector).map(function (bounds) { - return { - bounds: bounds, - cells: cells - }; - }); - } - }, Optional.none); + return cata(selections.get(), Optional.none, function (cells) { + if (cells.length <= 1) { + return Optional.none(); + } else { + return retrieveBox(table, ephemera.firstSelectedSelector, ephemera.lastSelectedSelector).map(function (bounds) { + return { + bounds: bounds, + cells: cells + }; + }); + } + }, Optional.none); }; var strSelected = 'data-mce-selected'; @@ -2500,1260 +2497,1260 @@ var strLastSelectedSelector = 'td[' + strLastSelected + '],th[' + strLastSelected + ']'; var attributeSelector = strAttributeSelector; var ephemera = { - selected: strSelected, - selectedSelector: strSelectedSelector, - firstSelected: strFirstSelected, - firstSelectedSelector: strFirstSelectedSelector, - lastSelected: strLastSelected, - lastSelectedSelector: strLastSelectedSelector + selected: strSelected, + selectedSelector: strSelectedSelector, + firstSelected: strFirstSelected, + firstSelectedSelector: strFirstSelectedSelector, + lastSelected: strLastSelected, + lastSelectedSelector: strLastSelectedSelector }; var noMenu = function (cell) { - return { - element: cell, - mergable: Optional.none(), - unmergable: Optional.none(), - selection: [cell] - }; + return { + element: cell, + mergable: Optional.none(), + unmergable: Optional.none(), + selection: [cell] + }; }; var forMenu = function (selections, table, cell) { - return { - element: cell, - mergable: mergable(table, selections, ephemera), - unmergable: unmergable(selections), - selection: selection(selections) - }; + return { + element: cell, + mergable: mergable(table, selections, ephemera), + unmergable: unmergable(selections), + selection: selection(selections) + }; }; var paste$1 = function (element, clipboard, generators) { - return { - element: element, - clipboard: clipboard, - generators: generators - }; + return { + element: element, + clipboard: clipboard, + generators: generators + }; }; var pasteRows = function (selections, cell, clipboard, generators) { - return { - selection: selection(selections), - clipboard: clipboard, - generators: generators - }; + return { + selection: selection(selections), + clipboard: clipboard, + generators: generators + }; }; var extractSelected = function (cells) { - return table(cells[0]).map(deep).map(function (replica) { - return [extract(replica, attributeSelector)]; - }); + return table(cells[0]).map(deep).map(function (replica) { + return [extract(replica, attributeSelector)]; + }); }; var serializeElements = function (editor, elements) { - return map(elements, function (elm) { - return editor.selection.serializer.serialize(elm.dom, {}); - }).join(''); + return map(elements, function (elm) { + return editor.selection.serializer.serialize(elm.dom, {}); + }).join(''); }; var getTextContent = function (elements) { - return map(elements, function (element) { - return element.dom.innerText; - }).join(''); + return map(elements, function (element) { + return element.dom.innerText; + }).join(''); }; var registerEvents = function (editor, selections, actions, cellSelection) { - editor.on('BeforeGetContent', function (e) { - var multiCellContext = function (cells) { + editor.on('BeforeGetContent', function (e) { + var multiCellContext = function (cells) { + e.preventDefault(); + extractSelected(cells).each(function (elements) { + e.content = e.format === 'text' ? getTextContent(elements) : serializeElements(editor, elements); + }); + }; + if (e.selection === true) { + cata(selections.get(), noop, multiCellContext, noop); + } + }); + editor.on('BeforeSetContent', function (e) { + if (e.selection === true && e.paste === true) { + var cellOpt = Optional.from(editor.dom.getParent(editor.selection.getStart(), 'th,td')); + cellOpt.each(function (domCell) { + var cell = SugarElement.fromDom(domCell); + table(cell).each(function (table) { + var elements = filter(fromHtml$1(e.content), function (content) { + return name(content) !== 'meta'; + }); + var isTable = function (elm) { + return name(elm) === 'table'; + }; + if (elements.length === 1 && isTable(elements[0])) { e.preventDefault(); - extractSelected(cells).each(function (elements) { - e.content = e.format === 'text' ? getTextContent(elements) : serializeElements(editor, elements); - }); - }; - if (e.selection === true) { - cata(selections.get(), noop, multiCellContext, noop); - } - }); - editor.on('BeforeSetContent', function (e) { - if (e.selection === true && e.paste === true) { - var cellOpt = Optional.from(editor.dom.getParent(editor.selection.getStart(), 'th,td')); - cellOpt.each(function (domCell) { - var cell = SugarElement.fromDom(domCell); - table(cell).each(function (table) { - var elements = filter(fromHtml$1(e.content), function (content) { - return name(content) !== 'meta'; - }); - var isTable = function (elm) { - return name(elm) === 'table'; - }; - if (elements.length === 1 && isTable(elements[0])) { - e.preventDefault(); - var doc = SugarElement.fromDom(editor.getDoc()); - var generators = paste(doc); - var targets = paste$1(cell, elements[0], generators); - actions.pasteCells(table, targets).each(function (rng) { - editor.selection.setRng(rng); - editor.focus(); - cellSelection.clear(table); - }); - } - }); + var doc = SugarElement.fromDom(editor.getDoc()); + var generators = paste(doc); + var targets = paste$1(cell, elements[0], generators); + actions.pasteCells(table, targets).each(function (rng) { + editor.selection.setRng(rng); + editor.focus(); + cellSelection.clear(table); }); - } - }); + } + }); + }); + } + }); }; var adt = Adt.generate([ - {none: []}, - {only: ['index']}, - { - left: [ - 'index', - 'next' - ] - }, - { - middle: [ - 'prev', - 'index', - 'next' - ] - }, - { - right: [ - 'prev', - 'index' - ] - } + { none: [] }, + { only: ['index'] }, + { + left: [ + 'index', + 'next' + ] + }, + { + middle: [ + 'prev', + 'index', + 'next' + ] + }, + { + right: [ + 'prev', + 'index' + ] + } ]); var ColumnContext = __assign({}, adt); var neighbours = function (input, index) { - if (input.length === 0) { - return ColumnContext.none(); - } - if (input.length === 1) { - return ColumnContext.only(0); - } - if (index === 0) { - return ColumnContext.left(0, 1); - } - if (index === input.length - 1) { - return ColumnContext.right(index - 1, index); - } - if (index > 0 && index < input.length - 1) { - return ColumnContext.middle(index - 1, index, index + 1); - } + if (input.length === 0) { return ColumnContext.none(); + } + if (input.length === 1) { + return ColumnContext.only(0); + } + if (index === 0) { + return ColumnContext.left(0, 1); + } + if (index === input.length - 1) { + return ColumnContext.right(index - 1, index); + } + if (index > 0 && index < input.length - 1) { + return ColumnContext.middle(index - 1, index, index + 1); + } + return ColumnContext.none(); }; var determine = function (input, column, step, tableSize, resize) { - var result = input.slice(0); - var context = neighbours(input, column); - var onNone = constant(map(result, constant(0))); - var onOnly = function (index) { - return tableSize.singleColumnWidth(result[index], step); - }; - var onLeft = function (index, next) { - return resize.calcLeftEdgeDeltas(result, index, next, step, tableSize.minCellWidth(), tableSize.isRelative); - }; - var onMiddle = function (prev, index, next) { - return resize.calcMiddleDeltas(result, prev, index, next, step, tableSize.minCellWidth(), tableSize.isRelative); - }; - var onRight = function (prev, index) { - return resize.calcRightEdgeDeltas(result, prev, index, step, tableSize.minCellWidth(), tableSize.isRelative); - }; - return context.fold(onNone, onOnly, onLeft, onMiddle, onRight); + var result = input.slice(0); + var context = neighbours(input, column); + var onNone = constant(map(result, constant(0))); + var onOnly = function (index) { + return tableSize.singleColumnWidth(result[index], step); + }; + var onLeft = function (index, next) { + return resize.calcLeftEdgeDeltas(result, index, next, step, tableSize.minCellWidth(), tableSize.isRelative); + }; + var onMiddle = function (prev, index, next) { + return resize.calcMiddleDeltas(result, prev, index, next, step, tableSize.minCellWidth(), tableSize.isRelative); + }; + var onRight = function (prev, index) { + return resize.calcRightEdgeDeltas(result, prev, index, step, tableSize.minCellWidth(), tableSize.isRelative); + }; + return context.fold(onNone, onOnly, onLeft, onMiddle, onRight); }; var cat = function (arr) { - var r = []; - var push = function (x) { - r.push(x); - }; - for (var i = 0; i < arr.length; i++) { - arr[i].each(push); - } - return r; + var r = []; + var push = function (x) { + r.push(x); + }; + for (var i = 0; i < arr.length; i++) { + arr[i].each(push); + } + return r; }; var lift2 = function (oa, ob, f) { - return oa.isSome() && ob.isSome() ? Optional.some(f(oa.getOrDie(), ob.getOrDie())) : Optional.none(); + return oa.isSome() && ob.isSome() ? Optional.some(f(oa.getOrDie(), ob.getOrDie())) : Optional.none(); }; var bindFrom = function (a, f) { - return a !== undefined && a !== null ? f(a) : Optional.none(); + return a !== undefined && a !== null ? f(a) : Optional.none(); }; - function Dimension(name, getOffset) { - var set = function (element, h) { - if (!isNumber(h) && !h.match(/^[0-9]+$/)) { - throw new Error(name + '.set accepts only positive integer values. Value was ' + h); - } - var dom = element.dom; - if (isSupported$1(dom)) { - dom.style[name] = h + 'px'; - } - }; - var get = function (element) { - var r = getOffset(element); - if (r <= 0 || r === null) { - var css = get$3(element, name); - return parseFloat(css) || 0; - } - return r; - }; - var getOuter = get; - var aggregate = function (element, properties) { - return foldl(properties, function (acc, property) { - var val = get$3(element, property); - var value = val === undefined ? 0 : parseInt(val, 10); - return isNaN(value) ? acc : acc + value; - }, 0); - }; - var max = function (element, value, properties) { - var cumulativeInclusions = aggregate(element, properties); - var absoluteMax = value > cumulativeInclusions ? value - cumulativeInclusions : 0; - return absoluteMax; - }; - return { - set: set, - get: get, - getOuter: getOuter, - aggregate: aggregate, - max: max - }; + function Dimension (name, getOffset) { + var set = function (element, h) { + if (!isNumber(h) && !h.match(/^[0-9]+$/)) { + throw new Error(name + '.set accepts only positive integer values. Value was ' + h); + } + var dom = element.dom; + if (isSupported$1(dom)) { + dom.style[name] = h + 'px'; + } + }; + var get = function (element) { + var r = getOffset(element); + if (r <= 0 || r === null) { + var css = get$3(element, name); + return parseFloat(css) || 0; + } + return r; + }; + var getOuter = get; + var aggregate = function (element, properties) { + return foldl(properties, function (acc, property) { + var val = get$3(element, property); + var value = val === undefined ? 0 : parseInt(val, 10); + return isNaN(value) ? acc : acc + value; + }, 0); + }; + var max = function (element, value, properties) { + var cumulativeInclusions = aggregate(element, properties); + var absoluteMax = value > cumulativeInclusions ? value - cumulativeInclusions : 0; + return absoluteMax; + }; + return { + set: set, + get: get, + getOuter: getOuter, + aggregate: aggregate, + max: max + }; } var api$1 = Dimension('width', function (element) { - return element.dom.offsetWidth; + return element.dom.offsetWidth; }); var get$5 = function (element) { - return api$1.get(element); + return api$1.get(element); }; var getOuter = function (element) { - return api$1.getOuter(element); + return api$1.getOuter(element); }; var columns$1 = function (warehouse) { - var grid = warehouse.grid; - var cols = range(grid.columns, identity); - var rowsArr = range(grid.rows, identity); - return map(cols, function (col) { - var getBlock = function () { - return bind(rowsArr, function (r) { - return Warehouse.getAt(warehouse, r, col).filter(function (detail) { - return detail.column === col; - }).toArray(); - }); - }; - var isSingle = function (detail) { - return detail.colspan === 1; - }; - var getFallback = function () { - return Warehouse.getAt(warehouse, 0, col); - }; - return decide(getBlock, isSingle, getFallback); - }); + var grid = warehouse.grid; + var cols = range(grid.columns, identity); + var rowsArr = range(grid.rows, identity); + return map(cols, function (col) { + var getBlock = function () { + return bind(rowsArr, function (r) { + return Warehouse.getAt(warehouse, r, col).filter(function (detail) { + return detail.column === col; + }).toArray(); + }); + }; + var isSingle = function (detail) { + return detail.colspan === 1; + }; + var getFallback = function () { + return Warehouse.getAt(warehouse, 0, col); + }; + return decide(getBlock, isSingle, getFallback); + }); }; var decide = function (getBlock, isSingle, getFallback) { - var inBlock = getBlock(); - var singleInBlock = find(inBlock, isSingle); - var detailOption = singleInBlock.orThunk(function () { - return Optional.from(inBlock[0]).orThunk(getFallback); - }); - return detailOption.map(function (detail) { - return detail.element; - }); + var inBlock = getBlock(); + var singleInBlock = find(inBlock, isSingle); + var detailOption = singleInBlock.orThunk(function () { + return Optional.from(inBlock[0]).orThunk(getFallback); + }); + return detailOption.map(function (detail) { + return detail.element; + }); }; var rows$1 = function (warehouse) { - var grid = warehouse.grid; - var rowsArr = range(grid.rows, identity); - var cols = range(grid.columns, identity); - return map(rowsArr, function (row) { - var getBlock = function () { - return bind(cols, function (c) { - return Warehouse.getAt(warehouse, row, c).filter(function (detail) { - return detail.row === row; - }).fold(constant([]), function (detail) { - return [detail]; - }); - }); - }; - var isSingle = function (detail) { - return detail.rowspan === 1; - }; - var getFallback = function () { - return Warehouse.getAt(warehouse, row, 0); - }; - return decide(getBlock, isSingle, getFallback); - }); + var grid = warehouse.grid; + var rowsArr = range(grid.rows, identity); + var cols = range(grid.columns, identity); + return map(rowsArr, function (row) { + var getBlock = function () { + return bind(cols, function (c) { + return Warehouse.getAt(warehouse, row, c).filter(function (detail) { + return detail.row === row; + }).fold(constant([]), function (detail) { + return [detail]; + }); + }); + }; + var isSingle = function (detail) { + return detail.rowspan === 1; + }; + var getFallback = function () { + return Warehouse.getAt(warehouse, row, 0); + }; + return decide(getBlock, isSingle, getFallback); + }); }; var deduce = function (xs, index) { - if (index < 0 || index >= xs.length - 1) { - return Optional.none(); - } - var current = xs[index].fold(function () { - var rest = reverse(xs.slice(0, index)); - return findMap(rest, function (a, i) { - return a.map(function (aa) { - return { - value: aa, - delta: i + 1 - }; - }); - }); - }, function (c) { - return Optional.some({ - value: c, - delta: 0 - }); + if (index < 0 || index >= xs.length - 1) { + return Optional.none(); + } + var current = xs[index].fold(function () { + var rest = reverse(xs.slice(0, index)); + return findMap(rest, function (a, i) { + return a.map(function (aa) { + return { + value: aa, + delta: i + 1 + }; + }); + }); + }, function (c) { + return Optional.some({ + value: c, + delta: 0 + }); + }); + var next = xs[index + 1].fold(function () { + var rest = xs.slice(index + 1); + return findMap(rest, function (a, i) { + return a.map(function (aa) { + return { + value: aa, + delta: i + 1 + }; + }); }); - var next = xs[index + 1].fold(function () { - var rest = xs.slice(index + 1); - return findMap(rest, function (a, i) { - return a.map(function (aa) { - return { - value: aa, - delta: i + 1 - }; - }); - }); - }, function (n) { - return Optional.some({ - value: n, - delta: 1 - }); + }, function (n) { + return Optional.some({ + value: n, + delta: 1 }); - return current.bind(function (c) { - return next.map(function (n) { - var extras = n.delta + c.delta; - return Math.abs(n.value - c.value) / extras; - }); + }); + return current.bind(function (c) { + return next.map(function (n) { + var extras = n.delta + c.delta; + return Math.abs(n.value - c.value) / extras; }); + }); }; var onDirection = function (isLtr, isRtl) { - return function (element) { - return getDirection(element) === 'rtl' ? isRtl : isLtr; - }; + return function (element) { + return getDirection(element) === 'rtl' ? isRtl : isLtr; + }; }; var getDirection = function (element) { - return get$3(element, 'direction') === 'rtl' ? 'rtl' : 'ltr'; + return get$3(element, 'direction') === 'rtl' ? 'rtl' : 'ltr'; }; var api$2 = Dimension('height', function (element) { - var dom = element.dom; - return inBody(element) ? dom.getBoundingClientRect().height : dom.offsetHeight; + var dom = element.dom; + return inBody(element) ? dom.getBoundingClientRect().height : dom.offsetHeight; }); var get$6 = function (element) { - return api$2.get(element); + return api$2.get(element); }; var getOuter$1 = function (element) { - return api$2.getOuter(element); + return api$2.getOuter(element); }; var r = function (left, top) { - var translate = function (x, y) { - return r(left + x, top + y); - }; - return { - left: left, - top: top, - translate: translate - }; + var translate = function (x, y) { + return r(left + x, top + y); + }; + return { + left: left, + top: top, + translate: translate + }; }; var SugarPosition = r; var boxPosition = function (dom) { - var box = dom.getBoundingClientRect(); - return SugarPosition(box.left, box.top); + var box = dom.getBoundingClientRect(); + return SugarPosition(box.left, box.top); }; var firstDefinedOrZero = function (a, b) { - if (a !== undefined) { - return a; - } else { - return b !== undefined ? b : 0; - } + if (a !== undefined) { + return a; + } else { + return b !== undefined ? b : 0; + } }; var absolute = function (element) { - var doc = element.dom.ownerDocument; - var body = doc.body; - var win = doc.defaultView; - var html = doc.documentElement; - if (body === element.dom) { - return SugarPosition(body.offsetLeft, body.offsetTop); - } - var scrollTop = firstDefinedOrZero(win === null || win === void 0 ? void 0 : win.pageYOffset, html.scrollTop); - var scrollLeft = firstDefinedOrZero(win === null || win === void 0 ? void 0 : win.pageXOffset, html.scrollLeft); - var clientTop = firstDefinedOrZero(html.clientTop, body.clientTop); - var clientLeft = firstDefinedOrZero(html.clientLeft, body.clientLeft); - return viewport(element).translate(scrollLeft - clientLeft, scrollTop - clientTop); + var doc = element.dom.ownerDocument; + var body = doc.body; + var win = doc.defaultView; + var html = doc.documentElement; + if (body === element.dom) { + return SugarPosition(body.offsetLeft, body.offsetTop); + } + var scrollTop = firstDefinedOrZero(win === null || win === void 0 ? void 0 : win.pageYOffset, html.scrollTop); + var scrollLeft = firstDefinedOrZero(win === null || win === void 0 ? void 0 : win.pageXOffset, html.scrollLeft); + var clientTop = firstDefinedOrZero(html.clientTop, body.clientTop); + var clientLeft = firstDefinedOrZero(html.clientLeft, body.clientLeft); + return viewport(element).translate(scrollLeft - clientLeft, scrollTop - clientTop); }; var viewport = function (element) { - var dom = element.dom; - var doc = dom.ownerDocument; - var body = doc.body; - if (body === dom) { - return SugarPosition(body.offsetLeft, body.offsetTop); - } - if (!inBody(element)) { - return SugarPosition(0, 0); - } - return boxPosition(dom); + var dom = element.dom; + var doc = dom.ownerDocument; + var body = doc.body; + if (body === dom) { + return SugarPosition(body.offsetLeft, body.offsetTop); + } + if (!inBody(element)) { + return SugarPosition(0, 0); + } + return boxPosition(dom); }; var rowInfo = function (row, y) { - return { - row: row, - y: y - }; + return { + row: row, + y: y + }; }; var colInfo = function (col, x) { - return { - col: col, - x: x - }; + return { + col: col, + x: x + }; }; var rtlEdge = function (cell) { - var pos = absolute(cell); - return pos.left + getOuter(cell); + var pos = absolute(cell); + return pos.left + getOuter(cell); }; var ltrEdge = function (cell) { - return absolute(cell).left; + return absolute(cell).left; }; var getLeftEdge = function (index, cell) { - return colInfo(index, ltrEdge(cell)); + return colInfo(index, ltrEdge(cell)); }; var getRightEdge = function (index, cell) { - return colInfo(index, rtlEdge(cell)); + return colInfo(index, rtlEdge(cell)); }; var getTop = function (cell) { - return absolute(cell).top; + return absolute(cell).top; }; var getTopEdge = function (index, cell) { - return rowInfo(index, getTop(cell)); + return rowInfo(index, getTop(cell)); }; var getBottomEdge = function (index, cell) { - return rowInfo(index, getTop(cell) + getOuter$1(cell)); + return rowInfo(index, getTop(cell) + getOuter$1(cell)); }; var findPositions = function (getInnerEdge, getOuterEdge, array) { - if (array.length === 0) { - return []; - } - var lines = map(array.slice(1), function (cellOption, index) { - return cellOption.map(function (cell) { - return getInnerEdge(index, cell); - }); - }); - var lastLine = array[array.length - 1].map(function (cell) { - return getOuterEdge(array.length - 1, cell); - }); - return lines.concat([lastLine]); + if (array.length === 0) { + return []; + } + var lines = map(array.slice(1), function (cellOption, index) { + return cellOption.map(function (cell) { + return getInnerEdge(index, cell); + }); + }); + var lastLine = array[array.length - 1].map(function (cell) { + return getOuterEdge(array.length - 1, cell); + }); + return lines.concat([lastLine]); }; var negate = function (step) { - return -step; + return -step; }; var height = { - delta: identity, - positions: function (optElements) { - return findPositions(getTopEdge, getBottomEdge, optElements); - }, - edge: getTop + delta: identity, + positions: function (optElements) { + return findPositions(getTopEdge, getBottomEdge, optElements); + }, + edge: getTop }; var ltr = { - delta: identity, - edge: ltrEdge, - positions: function (optElements) { - return findPositions(getLeftEdge, getRightEdge, optElements); - } + delta: identity, + edge: ltrEdge, + positions: function (optElements) { + return findPositions(getLeftEdge, getRightEdge, optElements); + } }; var rtl = { - delta: negate, - edge: rtlEdge, - positions: function (optElements) { - return findPositions(getRightEdge, getLeftEdge, optElements); - } + delta: negate, + edge: rtlEdge, + positions: function (optElements) { + return findPositions(getRightEdge, getLeftEdge, optElements); + } }; var detect$4 = onDirection(ltr, rtl); var width = { - delta: function (amount, table) { - return detect$4(table).delta(amount, table); - }, - positions: function (cols, table) { - return detect$4(table).positions(cols, table); - }, - edge: function (cell) { - return detect$4(cell).edge(cell); - } + delta: function (amount, table) { + return detect$4(table).delta(amount, table); + }, + positions: function (cols, table) { + return detect$4(table).positions(cols, table); + }, + edge: function (cell) { + return detect$4(cell).edge(cell); + } }; var units = { - unsupportedLength: [ - 'em', - 'ex', - 'cap', - 'ch', - 'ic', - 'rem', - 'lh', - 'rlh', - 'vw', - 'vh', - 'vi', - 'vb', - 'vmin', - 'vmax', - 'cm', - 'mm', - 'Q', - 'in', - 'pc', - 'pt', - 'px' - ], - fixed: [ - 'px', - 'pt' - ], - relative: ['%'], - empty: [''] + unsupportedLength: [ + 'em', + 'ex', + 'cap', + 'ch', + 'ic', + 'rem', + 'lh', + 'rlh', + 'vw', + 'vh', + 'vi', + 'vb', + 'vmin', + 'vmax', + 'cm', + 'mm', + 'Q', + 'in', + 'pc', + 'pt', + 'px' + ], + fixed: [ + 'px', + 'pt' + ], + relative: ['%'], + empty: [''] }; var pattern = function () { - var decimalDigits = '[0-9]+'; - var signedInteger = '[+-]?' + decimalDigits; - var exponentPart = '[eE]' + signedInteger; - var dot = '\\.'; - var opt = function (input) { - return '(?:' + input + ')?'; - }; - var unsignedDecimalLiteral = [ - 'Infinity', - decimalDigits + dot + opt(decimalDigits) + opt(exponentPart), - dot + decimalDigits + opt(exponentPart), - decimalDigits + opt(exponentPart) - ].join('|'); - var float = '[+-]?(?:' + unsignedDecimalLiteral + ')'; - return new RegExp('^(' + float + ')(.*)$'); + var decimalDigits = '[0-9]+'; + var signedInteger = '[+-]?' + decimalDigits; + var exponentPart = '[eE]' + signedInteger; + var dot = '\\.'; + var opt = function (input) { + return '(?:' + input + ')?'; + }; + var unsignedDecimalLiteral = [ + 'Infinity', + decimalDigits + dot + opt(decimalDigits) + opt(exponentPart), + dot + decimalDigits + opt(exponentPart), + decimalDigits + opt(exponentPart) + ].join('|'); + var float = '[+-]?(?:' + unsignedDecimalLiteral + ')'; + return new RegExp('^(' + float + ')(.*)$'); }(); var isUnit = function (unit, accepted) { - return exists(accepted, function (acc) { - return exists(units[acc], function (check) { - return unit === check; - }); + return exists(accepted, function (acc) { + return exists(units[acc], function (check) { + return unit === check; }); + }); }; var parse = function (input, accepted) { - var match = Optional.from(pattern.exec(input)); - return match.bind(function (array) { - var value = Number(array[1]); - var unitRaw = array[2]; - if (isUnit(unitRaw, accepted)) { - return Optional.some({ - value: value, - unit: unitRaw - }); - } else { - return Optional.none(); - } - }); + var match = Optional.from(pattern.exec(input)); + return match.bind(function (array) { + var value = Number(array[1]); + var unitRaw = array[2]; + if (isUnit(unitRaw, accepted)) { + return Optional.some({ + value: value, + unit: unitRaw + }); + } else { + return Optional.none(); + } + }); }; var needManualCalc = function () { - var browser = detect$3().browser; - return browser.isIE() || browser.isEdge(); + var browser = detect$3().browser; + return browser.isIE() || browser.isEdge(); }; var toNumber = function (px, fallback) { - var num = parseFloat(px); - return isNaN(num) ? fallback : num; + var num = parseFloat(px); + return isNaN(num) ? fallback : num; }; var getProp = function (elm, name, fallback) { - return toNumber(get$3(elm, name), fallback); + return toNumber(get$3(elm, name), fallback); }; var getCalculatedHeight = function (cell) { - var height = cell.dom.getBoundingClientRect().height; - var boxSizing = get$3(cell, 'box-sizing'); - if (boxSizing === 'border-box') { - return height; - } else { - var paddingTop = getProp(cell, 'padding-top', 0); - var paddingBottom = getProp(cell, 'padding-bottom', 0); - var borderTop = getProp(cell, 'border-top-width', 0); - var borderBottom = getProp(cell, 'border-bottom-width', 0); - var borders = borderTop + borderBottom; - return height - paddingTop - paddingBottom - borders; - } + var height = cell.dom.getBoundingClientRect().height; + var boxSizing = get$3(cell, 'box-sizing'); + if (boxSizing === 'border-box') { + return height; + } else { + var paddingTop = getProp(cell, 'padding-top', 0); + var paddingBottom = getProp(cell, 'padding-bottom', 0); + var borderTop = getProp(cell, 'border-top-width', 0); + var borderBottom = getProp(cell, 'border-bottom-width', 0); + var borders = borderTop + borderBottom; + return height - paddingTop - paddingBottom - borders; + } }; var getCalculatedWidth = function (cell) { - var width = cell.dom.getBoundingClientRect().width; - var boxSizing = get$3(cell, 'box-sizing'); - if (boxSizing === 'border-box') { - return width; - } else { - var paddingLeft = getProp(cell, 'padding-left', 0); - var paddingRight = getProp(cell, 'padding-right', 0); - var borderLeft = getProp(cell, 'border-left-width', 0); - var borderRight = getProp(cell, 'border-right-width', 0); - var borders = borderLeft + borderRight; - return width - paddingLeft - paddingRight - borders; - } + var width = cell.dom.getBoundingClientRect().width; + var boxSizing = get$3(cell, 'box-sizing'); + if (boxSizing === 'border-box') { + return width; + } else { + var paddingLeft = getProp(cell, 'padding-left', 0); + var paddingRight = getProp(cell, 'padding-right', 0); + var borderLeft = getProp(cell, 'border-left-width', 0); + var borderRight = getProp(cell, 'border-right-width', 0); + var borders = borderLeft + borderRight; + return width - paddingLeft - paddingRight - borders; + } }; var getHeight = function (cell) { - return needManualCalc() ? getCalculatedHeight(cell) : getProp(cell, 'height', get$6(cell)); + return needManualCalc() ? getCalculatedHeight(cell) : getProp(cell, 'height', get$6(cell)); }; var getWidth = function (cell) { - return needManualCalc() ? getCalculatedWidth(cell) : getProp(cell, 'width', get$5(cell)); + return needManualCalc() ? getCalculatedWidth(cell) : getProp(cell, 'width', get$5(cell)); }; var rPercentageBasedSizeRegex = /(\d+(\.\d+)?)%/; var rPixelBasedSizeRegex = /(\d+(\.\d+)?)px|em/; var getPercentSize = function (elm, getter) { - var relativeParent = offsetParent(elm).getOr(getBody(owner(elm))); - return getter(elm) / getter(relativeParent) * 100; + var relativeParent = offsetParent(elm).getOr(getBody(owner(elm))); + return getter(elm) / getter(relativeParent) * 100; }; var setPixelWidth = function (cell, amount) { - set$1(cell, 'width', amount + 'px'); + set$1(cell, 'width', amount + 'px'); }; var setPercentageWidth = function (cell, amount) { - set$1(cell, 'width', amount + '%'); + set$1(cell, 'width', amount + '%'); }; var setHeight = function (cell, amount) { - set$1(cell, 'height', amount + 'px'); + set$1(cell, 'height', amount + 'px'); }; var getHeightValue = function (cell) { - return getRaw(cell, 'height').getOrThunk(function () { - return getHeight(cell) + 'px'; - }); + return getRaw(cell, 'height').getOrThunk(function () { + return getHeight(cell) + 'px'; + }); }; var convert = function (cell, number, getter, setter) { - var newSize = table(cell).map(function (table) { - var total = getter(table); - return Math.floor(number / 100 * total); - }).getOr(number); - setter(cell, newSize); - return newSize; + var newSize = table(cell).map(function (table) { + var total = getter(table); + return Math.floor(number / 100 * total); + }).getOr(number); + setter(cell, newSize); + return newSize; }; var normalizePixelSize = function (value, cell, getter, setter) { - var number = parseInt(value, 10); - return endsWith(value, '%') && name(cell) !== 'table' ? convert(cell, number, getter, setter) : number; + var number = parseInt(value, 10); + return endsWith(value, '%') && name(cell) !== 'table' ? convert(cell, number, getter, setter) : number; }; var getTotalHeight = function (cell) { - var value = getHeightValue(cell); - if (!value) { - return get$6(cell); - } - return normalizePixelSize(value, cell, get$6, setHeight); + var value = getHeightValue(cell); + if (!value) { + return get$6(cell); + } + return normalizePixelSize(value, cell, get$6, setHeight); }; var get$7 = function (cell, type, f) { - var v = f(cell); - var span = getSpan(cell, type); - return v / span; + var v = f(cell); + var span = getSpan(cell, type); + return v / span; }; var getRawWidth = function (element) { - var cssWidth = getRaw(element, 'width'); - return cssWidth.fold(function () { - return Optional.from(get$2(element, 'width')); - }, function (width) { - return Optional.some(width); - }); + var cssWidth = getRaw(element, 'width'); + return cssWidth.fold(function () { + return Optional.from(get$2(element, 'width')); + }, function (width) { + return Optional.some(width); + }); }; var normalizePercentageWidth = function (cellWidth, tableSize) { - return cellWidth / tableSize.pixelWidth() * 100; + return cellWidth / tableSize.pixelWidth() * 100; }; var choosePercentageSize = function (element, width, tableSize) { - var percentMatch = rPercentageBasedSizeRegex.exec(width); - if (percentMatch !== null) { - return parseFloat(percentMatch[1]); - } else { - var intWidth = getWidth(element); - return normalizePercentageWidth(intWidth, tableSize); - } + var percentMatch = rPercentageBasedSizeRegex.exec(width); + if (percentMatch !== null) { + return parseFloat(percentMatch[1]); + } else { + var intWidth = getWidth(element); + return normalizePercentageWidth(intWidth, tableSize); + } }; var getPercentageWidth = function (cell, tableSize) { - var width = getRawWidth(cell); - return width.fold(function () { - var intWidth = get$5(cell); - return normalizePercentageWidth(intWidth, tableSize); - }, function (w) { - return choosePercentageSize(cell, w, tableSize); - }); + var width = getRawWidth(cell); + return width.fold(function () { + var intWidth = get$5(cell); + return normalizePercentageWidth(intWidth, tableSize); + }, function (w) { + return choosePercentageSize(cell, w, tableSize); + }); }; var normalizePixelWidth = function (cellWidth, tableSize) { - return cellWidth / 100 * tableSize.pixelWidth(); + return cellWidth / 100 * tableSize.pixelWidth(); }; var choosePixelSize = function (element, width, tableSize) { - var pixelMatch = rPixelBasedSizeRegex.exec(width); - if (pixelMatch !== null) { - return parseInt(pixelMatch[1], 10); - } - var percentMatch = rPercentageBasedSizeRegex.exec(width); - if (percentMatch !== null) { - var floatWidth = parseFloat(percentMatch[1]); - return normalizePixelWidth(floatWidth, tableSize); - } - return getWidth(element); + var pixelMatch = rPixelBasedSizeRegex.exec(width); + if (pixelMatch !== null) { + return parseInt(pixelMatch[1], 10); + } + var percentMatch = rPercentageBasedSizeRegex.exec(width); + if (percentMatch !== null) { + var floatWidth = parseFloat(percentMatch[1]); + return normalizePixelWidth(floatWidth, tableSize); + } + return getWidth(element); }; var getPixelWidth = function (cell, tableSize) { - var width = getRawWidth(cell); - return width.fold(function () { - return getWidth(cell); - }, function (w) { - return choosePixelSize(cell, w, tableSize); - }); + var width = getRawWidth(cell); + return width.fold(function () { + return getWidth(cell); + }, function (w) { + return choosePixelSize(cell, w, tableSize); + }); }; var getHeight$1 = function (cell) { - return get$7(cell, 'rowspan', getTotalHeight); + return get$7(cell, 'rowspan', getTotalHeight); }; var getGenericWidth = function (cell) { - var width = getRawWidth(cell); - return width.bind(function (w) { - return parse(w, [ - 'fixed', - 'relative', - 'empty' - ]); - }); + var width = getRawWidth(cell); + return width.bind(function (w) { + return parse(w, [ + 'fixed', + 'relative', + 'empty' + ]); + }); }; var setGenericWidth = function (cell, amount, unit) { - set$1(cell, 'width', amount + unit); + set$1(cell, 'width', amount + unit); }; var getPixelTableWidth = function (table) { - return get$5(table) + 'px'; + return get$5(table) + 'px'; }; var getPercentTableWidth = function (table) { - return getPercentSize(table, get$5) + '%'; + return getPercentSize(table, get$5) + '%'; }; var isPercentSizing = function (table) { - return getRawWidth(table).exists(function (size) { - return rPercentageBasedSizeRegex.test(size); - }); + return getRawWidth(table).exists(function (size) { + return rPercentageBasedSizeRegex.test(size); + }); }; var isPixelSizing = function (table) { - return getRawWidth(table).exists(function (size) { - return rPixelBasedSizeRegex.test(size); - }); + return getRawWidth(table).exists(function (size) { + return rPixelBasedSizeRegex.test(size); + }); }; var isNoneSizing = function (table) { - return getRawWidth(table).isNone(); + return getRawWidth(table).isNone(); }; var percentageBasedSizeRegex = constant(rPercentageBasedSizeRegex); var pixelBasedSizeRegex = constant(rPixelBasedSizeRegex); var isCol = isTag('col'); var getRaw$1 = function (cell, property, getter) { - return getRaw(cell, property).fold(function () { - return getter(cell) + 'px'; - }, function (raw) { - return raw; - }); + return getRaw(cell, property).fold(function () { + return getter(cell) + 'px'; + }, function (raw) { + return raw; + }); }; var getRawW = function (cell, tableSize) { - var fallback = function (e) { - return isCol(e) ? get$5(e) : getPixelWidth(e, tableSize); - }; - return getRaw$1(cell, 'width', fallback); + var fallback = function (e) { + return isCol(e) ? get$5(e) : getPixelWidth(e, tableSize); + }; + return getRaw$1(cell, 'width', fallback); }; var getRawH = function (cell) { - return getRaw$1(cell, 'height', getHeight$1); + return getRaw$1(cell, 'height', getHeight$1); }; var justCols = function (warehouse) { - return map(Warehouse.justColumns(warehouse), function (column) { - return Optional.from(column.element); - }); + return map(Warehouse.justColumns(warehouse), function (column) { + return Optional.from(column.element); + }); }; var isValidColumn = function (cell) { - return !isCol(cell) || getRaw(cell, 'width').isSome(); + return !isCol(cell) || getRaw(cell, 'width').isSome(); }; var getDimension = function (cellOpt, index, backups, filter, getter, fallback) { - return cellOpt.filter(filter).fold(function () { - return fallback(deduce(backups, index)); - }, function (cell) { - return getter(cell); - }); + return cellOpt.filter(filter).fold(function () { + return fallback(deduce(backups, index)); + }, function (cell) { + return getter(cell); + }); }; var getWidthFrom = function (warehouse, table, getWidth, fallback, tableSize) { - var columnCells = columns$1(warehouse); - var columns = Warehouse.hasColumns(warehouse) ? justCols(warehouse) : columnCells; - var backups = [Optional.some(width.edge(table))].concat(map(width.positions(columnCells, table), function (pos) { - return pos.map(function (p) { - return p.x; - }); - })); - var colFilter = not(hasColspan); - return map(columns, function (cellOption, c) { - return getDimension(cellOption, c, backups, colFilter, function (column) { - if (isValidColumn(column)) { - return getWidth(column, tableSize); - } else { - var cell = bindFrom(columnCells[c], identity); - return getDimension(cell, c, backups, colFilter, function (cell) { - return fallback(Optional.some(get$5(cell))); - }, fallback); - } + var columnCells = columns$1(warehouse); + var columns = Warehouse.hasColumns(warehouse) ? justCols(warehouse) : columnCells; + var backups = [Optional.some(width.edge(table))].concat(map(width.positions(columnCells, table), function (pos) { + return pos.map(function (p) { + return p.x; + }); + })); + var colFilter = not(hasColspan); + return map(columns, function (cellOption, c) { + return getDimension(cellOption, c, backups, colFilter, function (column) { + if (isValidColumn(column)) { + return getWidth(column, tableSize); + } else { + var cell = bindFrom(columnCells[c], identity); + return getDimension(cell, c, backups, colFilter, function (cell) { + return fallback(Optional.some(get$5(cell))); }, fallback); - }); + } + }, fallback); + }); }; var getDeduced = function (deduced) { - return deduced.map(function (d) { - return d + 'px'; - }).getOr(''); + return deduced.map(function (d) { + return d + 'px'; + }).getOr(''); }; var getRawWidths = function (warehouse, table, tableSize) { - return getWidthFrom(warehouse, table, getRawW, getDeduced, tableSize); + return getWidthFrom(warehouse, table, getRawW, getDeduced, tableSize); }; var getPercentageWidths = function (warehouse, table, tableSize) { - return getWidthFrom(warehouse, table, getPercentageWidth, function (deduced) { - return deduced.fold(function () { - return tableSize.minCellWidth(); - }, function (cellWidth) { - return cellWidth / tableSize.pixelWidth() * 100; - }); - }, tableSize); + return getWidthFrom(warehouse, table, getPercentageWidth, function (deduced) { + return deduced.fold(function () { + return tableSize.minCellWidth(); + }, function (cellWidth) { + return cellWidth / tableSize.pixelWidth() * 100; + }); + }, tableSize); }; var getPixelWidths = function (warehouse, table, tableSize) { - return getWidthFrom(warehouse, table, getPixelWidth, function (deduced) { - return deduced.getOrThunk(tableSize.minCellWidth); - }, tableSize); + return getWidthFrom(warehouse, table, getPixelWidth, function (deduced) { + return deduced.getOrThunk(tableSize.minCellWidth); + }, tableSize); }; var getHeightFrom = function (warehouse, table, direction, getHeight, fallback) { - var rows = rows$1(warehouse); - var backups = [Optional.some(direction.edge(table))].concat(map(direction.positions(rows, table), function (pos) { - return pos.map(function (p) { - return p.y; - }); - })); - return map(rows, function (cellOption, c) { - return getDimension(cellOption, c, backups, not(hasRowspan), getHeight, fallback); + var rows = rows$1(warehouse); + var backups = [Optional.some(direction.edge(table))].concat(map(direction.positions(rows, table), function (pos) { + return pos.map(function (p) { + return p.y; }); + })); + return map(rows, function (cellOption, c) { + return getDimension(cellOption, c, backups, not(hasRowspan), getHeight, fallback); + }); }; var getPixelHeights = function (warehouse, table, direction) { - return getHeightFrom(warehouse, table, direction, getHeight$1, function (deduced) { - return deduced.getOrThunk(minHeight); - }); + return getHeightFrom(warehouse, table, direction, getHeight$1, function (deduced) { + return deduced.getOrThunk(minHeight); + }); }; var getRawHeights = function (warehouse, table, direction) { - return getHeightFrom(warehouse, table, direction, getRawH, getDeduced); + return getHeightFrom(warehouse, table, direction, getRawH, getDeduced); }; var total = function (start, end, measures) { - var r = 0; - for (var i = start; i < end; i++) { - r += measures[i] !== undefined ? measures[i] : 0; - } - return r; + var r = 0; + for (var i = start; i < end; i++) { + r += measures[i] !== undefined ? measures[i] : 0; + } + return r; }; var recalculateWidthForCells = function (warehouse, widths) { - var all = Warehouse.justCells(warehouse); - return map(all, function (cell) { - var width = total(cell.column, cell.column + cell.colspan, widths); - return { - element: cell.element, - width: width, - colspan: cell.colspan - }; - }); + var all = Warehouse.justCells(warehouse); + return map(all, function (cell) { + var width = total(cell.column, cell.column + cell.colspan, widths); + return { + element: cell.element, + width: width, + colspan: cell.colspan + }; + }); }; var recalculateWidthForColumns = function (warehouse, widths) { - var groups = Warehouse.justColumns(warehouse); - return map(groups, function (column, index) { - return { - element: column.element, - width: widths[index], - colspan: column.colspan - }; - }); + var groups = Warehouse.justColumns(warehouse); + return map(groups, function (column, index) { + return { + element: column.element, + width: widths[index], + colspan: column.colspan + }; + }); }; var recalculateHeightForCells = function (warehouse, heights) { - var all = Warehouse.justCells(warehouse); - return map(all, function (cell) { - var height = total(cell.row, cell.row + cell.rowspan, heights); - return { - element: cell.element, - height: height, - rowspan: cell.rowspan - }; - }); + var all = Warehouse.justCells(warehouse); + return map(all, function (cell) { + var height = total(cell.row, cell.row + cell.rowspan, heights); + return { + element: cell.element, + height: height, + rowspan: cell.rowspan + }; + }); }; var matchRowHeight = function (warehouse, heights) { - return map(warehouse.all, function (row, i) { - return { - element: row.element, - height: heights[i] - }; - }); + return map(warehouse.all, function (row, i) { + return { + element: row.element, + height: heights[i] + }; + }); }; var sumUp = function (newSize) { - return foldr(newSize, function (b, a) { - return b + a; - }, 0); + return foldr(newSize, function (b, a) { + return b + a; + }, 0); }; var recalculate = function (warehouse, widths) { - if (Warehouse.hasColumns(warehouse)) { - return recalculateWidthForColumns(warehouse, widths); - } else { - return recalculateWidthForCells(warehouse, widths); - } + if (Warehouse.hasColumns(warehouse)) { + return recalculateWidthForColumns(warehouse, widths); + } else { + return recalculateWidthForCells(warehouse, widths); + } }; var recalculateAndApply = function (warehouse, widths, tableSize) { - var newSizes = recalculate(warehouse, widths); - each(newSizes, function (cell) { - tableSize.setElementWidth(cell.element, cell.width); - }); + var newSizes = recalculate(warehouse, widths); + each(newSizes, function (cell) { + tableSize.setElementWidth(cell.element, cell.width); + }); }; var adjustWidth = function (table, delta, index, resizing, tableSize) { - var warehouse = Warehouse.fromTable(table); - var step = tableSize.getCellDelta(delta); - var widths = tableSize.getWidths(warehouse, tableSize); - var isLastColumn = index === warehouse.grid.columns - 1; - var clampedStep = resizing.clampTableDelta(widths, index, step, tableSize.minCellWidth(), isLastColumn); - var deltas = determine(widths, index, clampedStep, tableSize, resizing); - var newWidths = map(deltas, function (dx, i) { - return dx + widths[i]; - }); - recalculateAndApply(warehouse, newWidths, tableSize); - resizing.resizeTable(tableSize.adjustTableWidth, clampedStep, isLastColumn); + var warehouse = Warehouse.fromTable(table); + var step = tableSize.getCellDelta(delta); + var widths = tableSize.getWidths(warehouse, tableSize); + var isLastColumn = index === warehouse.grid.columns - 1; + var clampedStep = resizing.clampTableDelta(widths, index, step, tableSize.minCellWidth(), isLastColumn); + var deltas = determine(widths, index, clampedStep, tableSize, resizing); + var newWidths = map(deltas, function (dx, i) { + return dx + widths[i]; + }); + recalculateAndApply(warehouse, newWidths, tableSize); + resizing.resizeTable(tableSize.adjustTableWidth, clampedStep, isLastColumn); }; var adjustHeight = function (table, delta, index, direction) { - var warehouse = Warehouse.fromTable(table); - var heights = getPixelHeights(warehouse, table, direction); - var newHeights = map(heights, function (dy, i) { - return index === i ? Math.max(delta + dy, minHeight()) : dy; - }); - var newCellSizes = recalculateHeightForCells(warehouse, newHeights); - var newRowSizes = matchRowHeight(warehouse, newHeights); - each(newRowSizes, function (row) { - setHeight(row.element, row.height); - }); - each(newCellSizes, function (cell) { - setHeight(cell.element, cell.height); - }); - var total = sumUp(newHeights); - setHeight(table, total); + var warehouse = Warehouse.fromTable(table); + var heights = getPixelHeights(warehouse, table, direction); + var newHeights = map(heights, function (dy, i) { + return index === i ? Math.max(delta + dy, minHeight()) : dy; + }); + var newCellSizes = recalculateHeightForCells(warehouse, newHeights); + var newRowSizes = matchRowHeight(warehouse, newHeights); + each(newRowSizes, function (row) { + setHeight(row.element, row.height); + }); + each(newCellSizes, function (cell) { + setHeight(cell.element, cell.height); + }); + var total = sumUp(newHeights); + setHeight(table, total); }; var adjustWidthTo = function (table, list, tableSize) { - var warehouse = Warehouse.generate(list); - var widths = tableSize.getWidths(warehouse, tableSize); - recalculateAndApply(warehouse, widths, tableSize); + var warehouse = Warehouse.generate(list); + var widths = tableSize.getWidths(warehouse, tableSize); + recalculateAndApply(warehouse, widths, tableSize); }; var zero = function (array) { - return map(array, constant(0)); + return map(array, constant(0)); }; var surround = function (sizes, startIndex, endIndex, results, f) { - return f(sizes.slice(0, startIndex)).concat(results).concat(f(sizes.slice(endIndex))); + return f(sizes.slice(0, startIndex)).concat(results).concat(f(sizes.slice(endIndex))); }; var clampDeltaHelper = function (predicate) { - return function (sizes, index, delta, minCellSize) { - if (!predicate(delta)) { - return delta; - } else { - var newSize = Math.max(minCellSize, sizes[index] - Math.abs(delta)); - var diff = Math.abs(newSize - sizes[index]); - return delta >= 0 ? diff : -diff; - } - }; + return function (sizes, index, delta, minCellSize) { + if (!predicate(delta)) { + return delta; + } else { + var newSize = Math.max(minCellSize, sizes[index] - Math.abs(delta)); + var diff = Math.abs(newSize - sizes[index]); + return delta >= 0 ? diff : -diff; + } + }; }; var clampNegativeDelta = clampDeltaHelper(function (delta) { - return delta < 0; + return delta < 0; }); var clampDelta = clampDeltaHelper(always); var resizeTable = function () { - var calcFixedDeltas = function (sizes, index, next, delta, minCellSize) { - var clampedDelta = clampNegativeDelta(sizes, index, delta, minCellSize); - return surround(sizes, index, next + 1, [ - clampedDelta, - 0 - ], zero); - }; - var calcRelativeDeltas = function (sizes, index, delta, minCellSize) { - var ratio = (100 + delta) / 100; - var newThis = Math.max(minCellSize, (sizes[index] + delta) / ratio); - return map(sizes, function (size, idx) { - var newSize = idx === index ? newThis : size / ratio; - return newSize - size; - }); - }; - var calcLeftEdgeDeltas = function (sizes, index, next, delta, minCellSize, relativeSizing) { - if (relativeSizing) { - return calcRelativeDeltas(sizes, index, delta, minCellSize); - } else { - return calcFixedDeltas(sizes, index, next, delta, minCellSize); - } - }; - var calcMiddleDeltas = function (sizes, _prev, index, next, delta, minCellSize, relativeSizing) { - return calcLeftEdgeDeltas(sizes, index, next, delta, minCellSize, relativeSizing); - }; - var resizeTable = function (resizer, delta) { - return resizer(delta); - }; - var calcRightEdgeDeltas = function (sizes, _prev, index, delta, minCellSize, relativeSizing) { - if (relativeSizing) { - return calcRelativeDeltas(sizes, index, delta, minCellSize); - } else { - var clampedDelta = clampNegativeDelta(sizes, index, delta, minCellSize); - return zero(sizes.slice(0, index)).concat([clampedDelta]); - } - }; - return { - resizeTable: resizeTable, - clampTableDelta: clampNegativeDelta, - calcLeftEdgeDeltas: calcLeftEdgeDeltas, - calcMiddleDeltas: calcMiddleDeltas, - calcRightEdgeDeltas: calcRightEdgeDeltas - }; + var calcFixedDeltas = function (sizes, index, next, delta, minCellSize) { + var clampedDelta = clampNegativeDelta(sizes, index, delta, minCellSize); + return surround(sizes, index, next + 1, [ + clampedDelta, + 0 + ], zero); + }; + var calcRelativeDeltas = function (sizes, index, delta, minCellSize) { + var ratio = (100 + delta) / 100; + var newThis = Math.max(minCellSize, (sizes[index] + delta) / ratio); + return map(sizes, function (size, idx) { + var newSize = idx === index ? newThis : size / ratio; + return newSize - size; + }); + }; + var calcLeftEdgeDeltas = function (sizes, index, next, delta, minCellSize, relativeSizing) { + if (relativeSizing) { + return calcRelativeDeltas(sizes, index, delta, minCellSize); + } else { + return calcFixedDeltas(sizes, index, next, delta, minCellSize); + } + }; + var calcMiddleDeltas = function (sizes, _prev, index, next, delta, minCellSize, relativeSizing) { + return calcLeftEdgeDeltas(sizes, index, next, delta, minCellSize, relativeSizing); + }; + var resizeTable = function (resizer, delta) { + return resizer(delta); + }; + var calcRightEdgeDeltas = function (sizes, _prev, index, delta, minCellSize, relativeSizing) { + if (relativeSizing) { + return calcRelativeDeltas(sizes, index, delta, minCellSize); + } else { + var clampedDelta = clampNegativeDelta(sizes, index, delta, minCellSize); + return zero(sizes.slice(0, index)).concat([clampedDelta]); + } + }; + return { + resizeTable: resizeTable, + clampTableDelta: clampNegativeDelta, + calcLeftEdgeDeltas: calcLeftEdgeDeltas, + calcMiddleDeltas: calcMiddleDeltas, + calcRightEdgeDeltas: calcRightEdgeDeltas + }; }; var preserveTable = function () { - var calcLeftEdgeDeltas = function (sizes, index, next, delta, minCellSize) { - var idx = delta >= 0 ? next : index; - var clampedDelta = clampDelta(sizes, idx, delta, minCellSize); - return surround(sizes, index, next + 1, [ - clampedDelta, - -clampedDelta - ], zero); - }; - var calcMiddleDeltas = function (sizes, _prev, index, next, delta, minCellSize) { - return calcLeftEdgeDeltas(sizes, index, next, delta, minCellSize); - }; - var resizeTable = function (resizer, delta, isLastColumn) { - if (isLastColumn) { - resizer(delta); - } - }; - var calcRightEdgeDeltas = function (sizes, _prev, _index, delta, _minCellSize, relativeSizing) { - if (relativeSizing) { - return zero(sizes); - } else { - var diff = delta / sizes.length; - return map(sizes, constant(diff)); - } - }; - var clampTableDelta = function (sizes, index, delta, minCellSize, isLastColumn) { - if (isLastColumn) { - if (delta >= 0) { - return delta; - } else { - var maxDelta = foldl(sizes, function (a, b) { - return a + b - minCellSize; - }, 0); - return Math.max(-maxDelta, delta); - } - } else { - return clampNegativeDelta(sizes, index, delta, minCellSize); - } - }; - return { - resizeTable: resizeTable, - clampTableDelta: clampTableDelta, - calcLeftEdgeDeltas: calcLeftEdgeDeltas, - calcMiddleDeltas: calcMiddleDeltas, - calcRightEdgeDeltas: calcRightEdgeDeltas - }; + var calcLeftEdgeDeltas = function (sizes, index, next, delta, minCellSize) { + var idx = delta >= 0 ? next : index; + var clampedDelta = clampDelta(sizes, idx, delta, minCellSize); + return surround(sizes, index, next + 1, [ + clampedDelta, + -clampedDelta + ], zero); + }; + var calcMiddleDeltas = function (sizes, _prev, index, next, delta, minCellSize) { + return calcLeftEdgeDeltas(sizes, index, next, delta, minCellSize); + }; + var resizeTable = function (resizer, delta, isLastColumn) { + if (isLastColumn) { + resizer(delta); + } + }; + var calcRightEdgeDeltas = function (sizes, _prev, _index, delta, _minCellSize, relativeSizing) { + if (relativeSizing) { + return zero(sizes); + } else { + var diff = delta / sizes.length; + return map(sizes, constant(diff)); + } + }; + var clampTableDelta = function (sizes, index, delta, minCellSize, isLastColumn) { + if (isLastColumn) { + if (delta >= 0) { + return delta; + } else { + var maxDelta = foldl(sizes, function (a, b) { + return a + b - minCellSize; + }, 0); + return Math.max(-maxDelta, delta); + } + } else { + return clampNegativeDelta(sizes, index, delta, minCellSize); + } + }; + return { + resizeTable: resizeTable, + clampTableDelta: clampTableDelta, + calcLeftEdgeDeltas: calcLeftEdgeDeltas, + calcMiddleDeltas: calcMiddleDeltas, + calcRightEdgeDeltas: calcRightEdgeDeltas + }; }; var only = function (element, isResizable) { - var parent = Optional.from(element.dom.documentElement).map(SugarElement.fromDom).getOr(element); - return { - parent: constant(parent), - view: constant(element), - origin: constant(SugarPosition(0, 0)), - isResizable: isResizable - }; + var parent = Optional.from(element.dom.documentElement).map(SugarElement.fromDom).getOr(element); + return { + parent: constant(parent), + view: constant(element), + origin: constant(SugarPosition(0, 0)), + isResizable: isResizable + }; }; var detached = function (editable, chrome, isResizable) { - var origin = function () { - return absolute(chrome); - }; - return { - parent: constant(chrome), - view: constant(editable), - origin: origin, - isResizable: isResizable - }; + var origin = function () { + return absolute(chrome); + }; + return { + parent: constant(chrome), + view: constant(editable), + origin: origin, + isResizable: isResizable + }; }; var body$1 = function (editable, chrome, isResizable) { - return { - parent: constant(chrome), - view: constant(editable), - origin: constant(SugarPosition(0, 0)), - isResizable: isResizable - }; + return { + parent: constant(chrome), + view: constant(editable), + origin: constant(SugarPosition(0, 0)), + isResizable: isResizable + }; }; var ResizeWire = { - only: only, - detached: detached, - body: body$1 + only: only, + detached: detached, + body: body$1 }; var adt$1 = Adt.generate([ - {invalid: ['raw']}, - {pixels: ['value']}, - {percent: ['value']} + { invalid: ['raw'] }, + { pixels: ['value'] }, + { percent: ['value'] } ]); var validateFor = function (suffix, type, value) { - var rawAmount = value.substring(0, value.length - suffix.length); - var amount = parseFloat(rawAmount); - return rawAmount === amount.toString() ? type(amount) : adt$1.invalid(value); + var rawAmount = value.substring(0, value.length - suffix.length); + var amount = parseFloat(rawAmount); + return rawAmount === amount.toString() ? type(amount) : adt$1.invalid(value); }; var from$1 = function (value) { - if (endsWith(value, '%')) { - return validateFor('%', adt$1.percent, value); - } - if (endsWith(value, 'px')) { - return validateFor('px', adt$1.pixels, value); - } - return adt$1.invalid(value); + if (endsWith(value, '%')) { + return validateFor('%', adt$1.percent, value); + } + if (endsWith(value, 'px')) { + return validateFor('px', adt$1.pixels, value); + } + return adt$1.invalid(value); }; - var Size = __assign(__assign({}, adt$1), {from: from$1}); + var Size = __assign(__assign({}, adt$1), { from: from$1 }); var redistributeToPercent = function (widths, totalWidth) { - return map(widths, function (w) { - var colType = Size.from(w); - return colType.fold(function () { - return w; - }, function (px) { - var ratio = px / totalWidth * 100; - return ratio + '%'; - }, function (pc) { - return pc + '%'; - }); + return map(widths, function (w) { + var colType = Size.from(w); + return colType.fold(function () { + return w; + }, function (px) { + var ratio = px / totalWidth * 100; + return ratio + '%'; + }, function (pc) { + return pc + '%'; }); + }); }; var redistributeToPx = function (widths, totalWidth, newTotalWidth) { - var scale = newTotalWidth / totalWidth; - return map(widths, function (w) { - var colType = Size.from(w); - return colType.fold(function () { - return w; - }, function (px) { - return px * scale + 'px'; - }, function (pc) { - return pc / 100 * newTotalWidth + 'px'; - }); + var scale = newTotalWidth / totalWidth; + return map(widths, function (w) { + var colType = Size.from(w); + return colType.fold(function () { + return w; + }, function (px) { + return px * scale + 'px'; + }, function (pc) { + return pc / 100 * newTotalWidth + 'px'; }); + }); }; var redistributeEmpty = function (newWidthType, columns) { - var f = newWidthType.fold(function () { - return constant(''); - }, function (pixels) { - var num = pixels / columns; - return constant(num + 'px'); - }, function () { - var num = 100 / columns; - return constant(num + '%'); - }); - return range(columns, f); + var f = newWidthType.fold(function () { + return constant(''); + }, function (pixels) { + var num = pixels / columns; + return constant(num + 'px'); + }, function () { + var num = 100 / columns; + return constant(num + '%'); + }); + return range(columns, f); }; var redistributeValues = function (newWidthType, widths, totalWidth) { - return newWidthType.fold(function () { - return widths; - }, function (px) { - return redistributeToPx(widths, totalWidth, px); - }, function (_pc) { - return redistributeToPercent(widths, totalWidth); - }); + return newWidthType.fold(function () { + return widths; + }, function (px) { + return redistributeToPx(widths, totalWidth, px); + }, function (_pc) { + return redistributeToPercent(widths, totalWidth); + }); }; var redistribute = function (widths, totalWidth, newWidth) { - var newType = Size.from(newWidth); - var floats = forall(widths, function (s) { - return s === '0px'; - }) ? redistributeEmpty(newType, widths.length) : redistributeValues(newType, widths, totalWidth); - return normalize(floats); + var newType = Size.from(newWidth); + var floats = forall(widths, function (s) { + return s === '0px'; + }) ? redistributeEmpty(newType, widths.length) : redistributeValues(newType, widths, totalWidth); + return normalize(floats); }; var sum = function (values, fallback) { - if (values.length === 0) { - return fallback; - } - return foldr(values, function (rest, v) { - return Size.from(v).fold(constant(0), identity, identity) + rest; - }, 0); + if (values.length === 0) { + return fallback; + } + return foldr(values, function (rest, v) { + return Size.from(v).fold(constant(0), identity, identity) + rest; + }, 0); }; var roundDown = function (num, unit) { - var floored = Math.floor(num); - return { - value: floored + unit, - remainder: num - floored - }; + var floored = Math.floor(num); + return { + value: floored + unit, + remainder: num - floored + }; }; var add = function (value, amount) { - return Size.from(value).fold(constant(value), function (px) { - return px + amount + 'px'; - }, function (pc) { - return pc + amount + '%'; - }); + return Size.from(value).fold(constant(value), function (px) { + return px + amount + 'px'; + }, function (pc) { + return pc + amount + '%'; + }); }; var normalize = function (values) { - if (values.length === 0) { - return values; - } - var scan = foldr(values, function (rest, value) { - var info = Size.from(value).fold(function () { - return { - value: value, - remainder: 0 - }; - }, function (num) { - return roundDown(num, 'px'); - }, function (num) { - return { - value: num + '%', - remainder: 0 - }; - }); - return { - output: [info.value].concat(rest.output), - remainder: rest.remainder + info.remainder - }; - }, { - output: [], + if (values.length === 0) { + return values; + } + var scan = foldr(values, function (rest, value) { + var info = Size.from(value).fold(function () { + return { + value: value, + remainder: 0 + }; + }, function (num) { + return roundDown(num, 'px'); + }, function (num) { + return { + value: num + '%', remainder: 0 + }; }); - var r = scan.output; - return r.slice(0, r.length - 1).concat([add(r[r.length - 1], Math.round(scan.remainder))]); + return { + output: [info.value].concat(rest.output), + remainder: rest.remainder + info.remainder + }; + }, { + output: [], + remainder: 0 + }); + var r = scan.output; + return r.slice(0, r.length - 1).concat([add(r[r.length - 1], Math.round(scan.remainder))]); }; var validate = Size.from; var redistributeToW = function (newWidths, cells, unit) { - each(cells, function (cell) { - var widths = newWidths.slice(cell.column, cell.colspan + cell.column); - var w = sum(widths, minWidth()); - set$1(cell.element, 'width', w + unit); - }); + each(cells, function (cell) { + var widths = newWidths.slice(cell.column, cell.colspan + cell.column); + var w = sum(widths, minWidth()); + set$1(cell.element, 'width', w + unit); + }); }; var redistributeToColumns = function (newWidths, columns, unit) { - each(columns, function (column, index) { - var width = sum([newWidths[index]], minWidth()); - set$1(column.element, 'width', width + unit); - }); + each(columns, function (column, index) { + var width = sum([newWidths[index]], minWidth()); + set$1(column.element, 'width', width + unit); + }); }; var redistributeToH = function (newHeights, rows, cells, unit) { - each(cells, function (cell) { - var heights = newHeights.slice(cell.row, cell.rowspan + cell.row); - var h = sum(heights, minHeight()); - set$1(cell.element, 'height', h + unit); - }); - each(rows, function (row, i) { - set$1(row.element, 'height', newHeights[i]); - }); + each(cells, function (cell) { + var heights = newHeights.slice(cell.row, cell.rowspan + cell.row); + var h = sum(heights, minHeight()); + set$1(cell.element, 'height', h + unit); + }); + each(rows, function (row, i) { + set$1(row.element, 'height', newHeights[i]); + }); }; var getUnit = function (newSize) { - return validate(newSize).fold(constant('px'), constant('px'), constant('%')); + return validate(newSize).fold(constant('px'), constant('px'), constant('%')); }; var redistribute$1 = function (table, optWidth, optHeight, tableSize) { - var warehouse = Warehouse.fromTable(table); - var rows = warehouse.all; - var cells = Warehouse.justCells(warehouse); - var columns = Warehouse.justColumns(warehouse); - optWidth.each(function (newWidth) { - var widthUnit = getUnit(newWidth); - var totalWidth = get$5(table); - var oldWidths = getRawWidths(warehouse, table, tableSize); - var nuWidths = redistribute(oldWidths, totalWidth, newWidth); - if (Warehouse.hasColumns(warehouse)) { - redistributeToColumns(nuWidths, columns, widthUnit); - } else { - redistributeToW(nuWidths, cells, widthUnit); - } - set$1(table, 'width', newWidth); - }); - optHeight.each(function (newHeight) { - var hUnit = getUnit(newHeight); - var totalHeight = get$6(table); - var oldHeights = getRawHeights(warehouse, table, height); - var nuHeights = redistribute(oldHeights, totalHeight, newHeight); - redistributeToH(nuHeights, rows, cells, hUnit); - set$1(table, 'height', newHeight); - }); + var warehouse = Warehouse.fromTable(table); + var rows = warehouse.all; + var cells = Warehouse.justCells(warehouse); + var columns = Warehouse.justColumns(warehouse); + optWidth.each(function (newWidth) { + var widthUnit = getUnit(newWidth); + var totalWidth = get$5(table); + var oldWidths = getRawWidths(warehouse, table, tableSize); + var nuWidths = redistribute(oldWidths, totalWidth, newWidth); + if (Warehouse.hasColumns(warehouse)) { + redistributeToColumns(nuWidths, columns, widthUnit); + } else { + redistributeToW(nuWidths, cells, widthUnit); + } + set$1(table, 'width', newWidth); + }); + optHeight.each(function (newHeight) { + var hUnit = getUnit(newHeight); + var totalHeight = get$6(table); + var oldHeights = getRawHeights(warehouse, table, height); + var nuHeights = redistribute(oldHeights, totalHeight, newHeight); + redistributeToH(nuHeights, rows, cells, hUnit); + set$1(table, 'height', newHeight); + }); }; var isPercentSizing$1 = isPercentSizing; var isPixelSizing$1 = isPixelSizing; @@ -3761,583 +3758,583 @@ var getPercentTableWidth$1 = getPercentTableWidth; var getGridSize = function (table) { - var warehouse = Warehouse.fromTable(table); - return warehouse.grid; + var warehouse = Warehouse.fromTable(table); + return warehouse.grid; }; var Event = function (fields) { - var handlers = []; - var bind = function (handler) { - if (handler === undefined) { - throw new Error('Event bind error: undefined handler'); - } - handlers.push(handler); - }; - var unbind = function (handler) { - handlers = filter(handlers, function (h) { - return h !== handler; - }); - }; - var trigger = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var event = {}; - each(fields, function (name, i) { - event[name] = args[i]; - }); - each(handlers, function (handler) { - handler(event); - }); - }; - return { - bind: bind, - unbind: unbind, - trigger: trigger - }; + var handlers = []; + var bind = function (handler) { + if (handler === undefined) { + throw new Error('Event bind error: undefined handler'); + } + handlers.push(handler); + }; + var unbind = function (handler) { + handlers = filter(handlers, function (h) { + return h !== handler; + }); + }; + var trigger = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var event = {}; + each(fields, function (name, i) { + event[name] = args[i]; + }); + each(handlers, function (handler) { + handler(event); + }); + }; + return { + bind: bind, + unbind: unbind, + trigger: trigger + }; }; var create = function (typeDefs) { - var registry = map$1(typeDefs, function (event) { - return { - bind: event.bind, - unbind: event.unbind - }; - }); - var trigger = map$1(typeDefs, function (event) { - return event.trigger; - }); + var registry = map$1(typeDefs, function (event) { return { - registry: registry, - trigger: trigger + bind: event.bind, + unbind: event.unbind }; + }); + var trigger = map$1(typeDefs, function (event) { + return event.trigger; + }); + return { + registry: registry, + trigger: trigger + }; }; var last$2 = function (fn, rate) { - var timer = null; - var cancel = function () { - if (timer !== null) { - clearTimeout(timer); - timer = null; - } - }; - var throttle = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (timer !== null) { - clearTimeout(timer); - } - timer = setTimeout(function () { - fn.apply(null, args); - timer = null; - }, rate); - }; - return { - cancel: cancel, - throttle: throttle - }; + var timer = null; + var cancel = function () { + if (timer !== null) { + clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer !== null) { + clearTimeout(timer); + } + timer = setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + }; + return { + cancel: cancel, + throttle: throttle + }; }; var sort = function (arr) { - return arr.slice(0).sort(); + return arr.slice(0).sort(); }; var reqMessage = function (required, keys) { - throw new Error('All required keys (' + sort(required).join(', ') + ') were not specified. Specified keys were: ' + sort(keys).join(', ') + '.'); + throw new Error('All required keys (' + sort(required).join(', ') + ') were not specified. Specified keys were: ' + sort(keys).join(', ') + '.'); }; var unsuppMessage = function (unsupported) { - throw new Error('Unsupported keys for object: ' + sort(unsupported).join(', ')); + throw new Error('Unsupported keys for object: ' + sort(unsupported).join(', ')); }; var validateStrArr = function (label, array) { - if (!isArray(array)) { - throw new Error('The ' + label + ' fields must be an array. Was: ' + array + '.'); + if (!isArray(array)) { + throw new Error('The ' + label + ' fields must be an array. Was: ' + array + '.'); + } + each(array, function (a) { + if (!isString(a)) { + throw new Error('The value ' + a + ' in the ' + label + ' fields was not a string.'); } - each(array, function (a) { - if (!isString(a)) { - throw new Error('The value ' + a + ' in the ' + label + ' fields was not a string.'); - } - }); + }); }; var invalidTypeMessage = function (incorrect, type) { - throw new Error('All values need to be of type: ' + type + '. Keys (' + sort(incorrect).join(', ') + ') were not.'); + throw new Error('All values need to be of type: ' + type + '. Keys (' + sort(incorrect).join(', ') + ') were not.'); }; var checkDupes = function (everything) { - var sorted = sort(everything); - var dupe = find(sorted, function (s, i) { - return i < sorted.length - 1 && s === sorted[i + 1]; - }); - dupe.each(function (d) { - throw new Error('The field: ' + d + ' occurs more than once in the combined fields: [' + sorted.join(', ') + '].'); - }); + var sorted = sort(everything); + var dupe = find(sorted, function (s, i) { + return i < sorted.length - 1 && s === sorted[i + 1]; + }); + dupe.each(function (d) { + throw new Error('The field: ' + d + ' occurs more than once in the combined fields: [' + sorted.join(', ') + '].'); + }); }; var base = function (handleUnsupported, required) { - return baseWith(handleUnsupported, required, { - validate: isFunction, - label: 'function' - }); + return baseWith(handleUnsupported, required, { + validate: isFunction, + label: 'function' + }); }; var baseWith = function (handleUnsupported, required, pred) { - if (required.length === 0) { - throw new Error('You must specify at least one required field.'); - } - validateStrArr('required', required); - checkDupes(required); - return function (obj) { - var keys$1 = keys(obj); - var allReqd = forall(required, function (req) { - return contains(keys$1, req); - }); - if (!allReqd) { - reqMessage(required, keys$1); - } - handleUnsupported(required, keys$1); - var invalidKeys = filter(required, function (key) { - return !pred.validate(obj[key], key); - }); - if (invalidKeys.length > 0) { - invalidTypeMessage(invalidKeys, pred.label); - } - return obj; - }; - }; - var handleExact = function (required, keys) { - var unsupported = filter(keys, function (key) { - return !contains(required, key); + if (required.length === 0) { + throw new Error('You must specify at least one required field.'); + } + validateStrArr('required', required); + checkDupes(required); + return function (obj) { + var keys$1 = keys(obj); + var allReqd = forall(required, function (req) { + return contains(keys$1, req); + }); + if (!allReqd) { + reqMessage(required, keys$1); + } + handleUnsupported(required, keys$1); + var invalidKeys = filter(required, function (key) { + return !pred.validate(obj[key], key); }); - if (unsupported.length > 0) { - unsuppMessage(unsupported); + if (invalidKeys.length > 0) { + invalidTypeMessage(invalidKeys, pred.label); } + return obj; + }; + }; + var handleExact = function (required, keys) { + var unsupported = filter(keys, function (key) { + return !contains(required, key); + }); + if (unsupported.length > 0) { + unsuppMessage(unsupported); + } }; var exactly = function (required) { - return base(handleExact, required); + return base(handleExact, required); }; var DragMode = exactly([ - 'compare', - 'extract', - 'mutate', - 'sink' + 'compare', + 'extract', + 'mutate', + 'sink' ]); var DragSink = exactly([ - 'element', - 'start', - 'stop', - 'destroy' + 'element', + 'start', + 'stop', + 'destroy' ]); var DragApi = exactly([ - 'forceDrop', - 'drop', - 'move', - 'delayDrop' + 'forceDrop', + 'drop', + 'move', + 'delayDrop' ]); - function InDrag() { - var previous = Optional.none(); - var reset = function () { - previous = Optional.none(); - }; - var update = function (mode, nu) { - var result = previous.map(function (old) { - return mode.compare(old, nu); - }); - previous = Optional.some(nu); - return result; - }; - var onEvent = function (event, mode) { - var dataOption = mode.extract(event); - dataOption.each(function (data) { - var offset = update(mode, data); - offset.each(function (d) { - events.trigger.move(d); - }); - }); - }; - var events = create({move: Event(['info'])}); - return { - onEvent: onEvent, - reset: reset, - events: events.registry - }; + function InDrag () { + var previous = Optional.none(); + var reset = function () { + previous = Optional.none(); + }; + var update = function (mode, nu) { + var result = previous.map(function (old) { + return mode.compare(old, nu); + }); + previous = Optional.some(nu); + return result; + }; + var onEvent = function (event, mode) { + var dataOption = mode.extract(event); + dataOption.each(function (data) { + var offset = update(mode, data); + offset.each(function (d) { + events.trigger.move(d); + }); + }); + }; + var events = create({ move: Event(['info']) }); + return { + onEvent: onEvent, + reset: reset, + events: events.registry + }; } - function NoDrag() { - return { - onEvent: noop, - reset: noop - }; + function NoDrag () { + return { + onEvent: noop, + reset: noop + }; } - function Movement() { - var noDragState = NoDrag(); - var inDragState = InDrag(); - var dragState = noDragState; - var on = function () { - dragState.reset(); - dragState = inDragState; - }; - var off = function () { - dragState.reset(); - dragState = noDragState; - }; - var onEvent = function (event, mode) { - dragState.onEvent(event, mode); - }; - var isOn = function () { - return dragState === inDragState; - }; - return { - on: on, - off: off, - isOn: isOn, - onEvent: onEvent, - events: inDragState.events - }; + function Movement () { + var noDragState = NoDrag(); + var inDragState = InDrag(); + var dragState = noDragState; + var on = function () { + dragState.reset(); + dragState = inDragState; + }; + var off = function () { + dragState.reset(); + dragState = noDragState; + }; + var onEvent = function (event, mode) { + dragState.onEvent(event, mode); + }; + var isOn = function () { + return dragState === inDragState; + }; + return { + on: on, + off: off, + isOn: isOn, + onEvent: onEvent, + events: inDragState.events + }; } var setup = function (mutation, mode, settings) { - var active = false; - var events = create({ - start: Event([]), - stop: Event([]) - }); - var movement = Movement(); - var drop = function () { - sink.stop(); - if (movement.isOn()) { - movement.off(); - events.trigger.stop(); - } - }; - var throttledDrop = last$2(drop, 200); - var go = function (parent) { - sink.start(parent); - movement.on(); - events.trigger.start(); - }; - var mousemove = function (event) { - throttledDrop.cancel(); - movement.onEvent(event, mode); - }; - movement.events.move.bind(function (event) { - mode.mutate(mutation, event.info); - }); - var on = function () { - active = true; - }; - var off = function () { - active = false; - }; - var runIfActive = function (f) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (active) { - f.apply(null, args); - } - }; - }; - var sink = mode.sink(DragApi({ - forceDrop: drop, - drop: runIfActive(drop), - move: runIfActive(mousemove), - delayDrop: runIfActive(throttledDrop.throttle) - }), settings); - var destroy = function () { - sink.destroy(); - }; - return { - element: sink.element, - go: go, - on: on, - off: off, - destroy: destroy, - events: events.registry - }; + var active = false; + var events = create({ + start: Event([]), + stop: Event([]) + }); + var movement = Movement(); + var drop = function () { + sink.stop(); + if (movement.isOn()) { + movement.off(); + events.trigger.stop(); + } + }; + var throttledDrop = last$2(drop, 200); + var go = function (parent) { + sink.start(parent); + movement.on(); + events.trigger.start(); + }; + var mousemove = function (event) { + throttledDrop.cancel(); + movement.onEvent(event, mode); + }; + movement.events.move.bind(function (event) { + mode.mutate(mutation, event.info); + }); + var on = function () { + active = true; + }; + var off = function () { + active = false; + }; + var runIfActive = function (f) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (active) { + f.apply(null, args); + } + }; + }; + var sink = mode.sink(DragApi({ + forceDrop: drop, + drop: runIfActive(drop), + move: runIfActive(mousemove), + delayDrop: runIfActive(throttledDrop.throttle) + }), settings); + var destroy = function () { + sink.destroy(); + }; + return { + element: sink.element, + go: go, + on: on, + off: off, + destroy: destroy, + events: events.registry + }; }; var mkEvent = function (target, x, y, stop, prevent, kill, raw) { - return { - target: target, - x: x, - y: y, - stop: stop, - prevent: prevent, - kill: kill, - raw: raw - }; + return { + target: target, + x: x, + y: y, + stop: stop, + prevent: prevent, + kill: kill, + raw: raw + }; }; var fromRawEvent = function (rawEvent) { - var target = SugarElement.fromDom(getOriginalEventTarget(rawEvent).getOr(rawEvent.target)); - var stop = function () { - return rawEvent.stopPropagation(); - }; - var prevent = function () { - return rawEvent.preventDefault(); - }; - var kill = compose(prevent, stop); - return mkEvent(target, rawEvent.clientX, rawEvent.clientY, stop, prevent, kill, rawEvent); + var target = SugarElement.fromDom(getOriginalEventTarget(rawEvent).getOr(rawEvent.target)); + var stop = function () { + return rawEvent.stopPropagation(); + }; + var prevent = function () { + return rawEvent.preventDefault(); + }; + var kill = compose(prevent, stop); + return mkEvent(target, rawEvent.clientX, rawEvent.clientY, stop, prevent, kill, rawEvent); }; var handle = function (filter, handler) { - return function (rawEvent) { - if (filter(rawEvent)) { - handler(fromRawEvent(rawEvent)); - } - }; + return function (rawEvent) { + if (filter(rawEvent)) { + handler(fromRawEvent(rawEvent)); + } + }; }; var binder = function (element, event, filter, handler, useCapture) { - var wrapped = handle(filter, handler); - element.dom.addEventListener(event, wrapped, useCapture); - return {unbind: curry(unbind, element, event, wrapped, useCapture)}; + var wrapped = handle(filter, handler); + element.dom.addEventListener(event, wrapped, useCapture); + return { unbind: curry(unbind, element, event, wrapped, useCapture) }; }; var bind$1 = function (element, event, filter, handler) { - return binder(element, event, filter, handler, false); + return binder(element, event, filter, handler, false); }; var unbind = function (element, event, handler, useCapture) { - element.dom.removeEventListener(event, handler, useCapture); + element.dom.removeEventListener(event, handler, useCapture); }; var filter$2 = always; var bind$2 = function (element, event, handler) { - return bind$1(element, event, filter$2, handler); + return bind$1(element, event, filter$2, handler); }; var fromRawEvent$1 = fromRawEvent; var read = function (element, attr) { - var value = get$2(element, attr); - return value === undefined || value === '' ? [] : value.split(' '); + var value = get$2(element, attr); + return value === undefined || value === '' ? [] : value.split(' '); }; var add$1 = function (element, attr, id) { - var old = read(element, attr); - var nu = old.concat([id]); - set(element, attr, nu.join(' ')); - return true; + var old = read(element, attr); + var nu = old.concat([id]); + set(element, attr, nu.join(' ')); + return true; }; var remove$3 = function (element, attr, id) { - var nu = filter(read(element, attr), function (v) { - return v !== id; - }); - if (nu.length > 0) { - set(element, attr, nu.join(' ')); - } else { - remove(element, attr); - } - return false; + var nu = filter(read(element, attr), function (v) { + return v !== id; + }); + if (nu.length > 0) { + set(element, attr, nu.join(' ')); + } else { + remove(element, attr); + } + return false; }; var supports = function (element) { - return element.dom.classList !== undefined; + return element.dom.classList !== undefined; }; var get$8 = function (element) { - return read(element, 'class'); + return read(element, 'class'); }; var add$2 = function (element, clazz) { - return add$1(element, 'class', clazz); + return add$1(element, 'class', clazz); }; var remove$4 = function (element, clazz) { - return remove$3(element, 'class', clazz); + return remove$3(element, 'class', clazz); }; var add$3 = function (element, clazz) { - if (supports(element)) { - element.dom.classList.add(clazz); - } else { - add$2(element, clazz); - } + if (supports(element)) { + element.dom.classList.add(clazz); + } else { + add$2(element, clazz); + } }; var cleanClass = function (element) { - var classList = supports(element) ? element.dom.classList : get$8(element); - if (classList.length === 0) { - remove(element, 'class'); - } + var classList = supports(element) ? element.dom.classList : get$8(element); + if (classList.length === 0) { + remove(element, 'class'); + } }; var remove$5 = function (element, clazz) { - if (supports(element)) { - var classList = element.dom.classList; - classList.remove(clazz); - } else { - remove$4(element, clazz); - } - cleanClass(element); + if (supports(element)) { + var classList = element.dom.classList; + classList.remove(clazz); + } else { + remove$4(element, clazz); + } + cleanClass(element); }; var has$1 = function (element, clazz) { - return supports(element) && element.dom.classList.contains(clazz); + return supports(element) && element.dom.classList.contains(clazz); }; var css = function (namespace) { - var dashNamespace = namespace.replace(/\./g, '-'); - var resolve = function (str) { - return dashNamespace + '-' + str; - }; - return {resolve: resolve}; + var dashNamespace = namespace.replace(/\./g, '-'); + var resolve = function (str) { + return dashNamespace + '-' + str; + }; + return { resolve: resolve }; }; var styles = css('ephox-dragster'); var resolve = styles.resolve; var Blocker = function (options) { - var settings = __assign({layerClass: resolve('blocker')}, options); - var div = SugarElement.fromTag('div'); - set(div, 'role', 'presentation'); - setAll$1(div, { - position: 'fixed', - left: '0px', - top: '0px', - width: '100%', - height: '100%' - }); - add$3(div, resolve('blocker')); - add$3(div, settings.layerClass); - var element = function () { - return div; - }; - var destroy = function () { - remove$2(div); - }; - return { - element: element, - destroy: destroy - }; + var settings = __assign({ layerClass: resolve('blocker') }, options); + var div = SugarElement.fromTag('div'); + set(div, 'role', 'presentation'); + setAll$1(div, { + position: 'fixed', + left: '0px', + top: '0px', + width: '100%', + height: '100%' + }); + add$3(div, resolve('blocker')); + add$3(div, settings.layerClass); + var element = function () { + return div; + }; + var destroy = function () { + remove$2(div); + }; + return { + element: element, + destroy: destroy + }; }; var compare = function (old, nu) { - return SugarPosition(nu.left - old.left, nu.top - old.top); + return SugarPosition(nu.left - old.left, nu.top - old.top); }; var extract$1 = function (event) { - return Optional.some(SugarPosition(event.x, event.y)); + return Optional.some(SugarPosition(event.x, event.y)); }; var mutate = function (mutation, info) { - mutation.mutate(info.left, info.top); + mutation.mutate(info.left, info.top); }; var sink = function (dragApi, settings) { - var blocker = Blocker(settings); - var mdown = bind$2(blocker.element(), 'mousedown', dragApi.forceDrop); - var mup = bind$2(blocker.element(), 'mouseup', dragApi.drop); - var mmove = bind$2(blocker.element(), 'mousemove', dragApi.move); - var mout = bind$2(blocker.element(), 'mouseout', dragApi.delayDrop); - var destroy = function () { - blocker.destroy(); - mup.unbind(); - mmove.unbind(); - mout.unbind(); - mdown.unbind(); - }; - var start = function (parent) { - append(parent, blocker.element()); - }; - var stop = function () { - remove$2(blocker.element()); - }; - return DragSink({ - element: blocker.element, - start: start, - stop: stop, - destroy: destroy - }); + var blocker = Blocker(settings); + var mdown = bind$2(blocker.element(), 'mousedown', dragApi.forceDrop); + var mup = bind$2(blocker.element(), 'mouseup', dragApi.drop); + var mmove = bind$2(blocker.element(), 'mousemove', dragApi.move); + var mout = bind$2(blocker.element(), 'mouseout', dragApi.delayDrop); + var destroy = function () { + blocker.destroy(); + mup.unbind(); + mmove.unbind(); + mout.unbind(); + mdown.unbind(); + }; + var start = function (parent) { + append(parent, blocker.element()); + }; + var stop = function () { + remove$2(blocker.element()); + }; + return DragSink({ + element: blocker.element, + start: start, + stop: stop, + destroy: destroy + }); }; var MouseDrag = DragMode({ - compare: compare, - extract: extract$1, - sink: sink, - mutate: mutate + compare: compare, + extract: extract$1, + sink: sink, + mutate: mutate }); var transform = function (mutation, settings) { - if (settings === void 0) { - settings = {}; - } - var mode = settings.mode !== undefined ? settings.mode : MouseDrag; - return setup(mutation, mode, settings); + if (settings === void 0) { + settings = {}; + } + var mode = settings.mode !== undefined ? settings.mode : MouseDrag; + return setup(mutation, mode, settings); }; var isContentEditableTrue = function (elm) { - return get$2(elm, 'contenteditable') === 'true'; + return get$2(elm, 'contenteditable') === 'true'; }; var findClosestContentEditable = function (target, isRoot) { - return closest$1(target, '[contenteditable]', isRoot); + return closest$1(target, '[contenteditable]', isRoot); }; var styles$1 = css('ephox-snooker'); var resolve$1 = styles$1.resolve; var Mutation = function () { - var events = create({ - drag: Event([ - 'xDelta', - 'yDelta' - ]) - }); - var mutate = function (x, y) { - events.trigger.drag(x, y); - }; - return { - mutate: mutate, - events: events.registry - }; + var events = create({ + drag: Event([ + 'xDelta', + 'yDelta' + ]) + }); + var mutate = function (x, y) { + events.trigger.drag(x, y); + }; + return { + mutate: mutate, + events: events.registry + }; }; var BarMutation = function () { - var events = create({ - drag: Event([ - 'xDelta', - 'yDelta', - 'target' - ]) - }); - var target = Optional.none(); - var delegate = Mutation(); - delegate.events.drag.bind(function (event) { - target.each(function (t) { - events.trigger.drag(event.xDelta, event.yDelta, t); - }); - }); - var assign = function (t) { - target = Optional.some(t); - }; - var get = function () { - return target; - }; - return { - assign: assign, - get: get, - mutate: delegate.mutate, - events: events.registry - }; + var events = create({ + drag: Event([ + 'xDelta', + 'yDelta', + 'target' + ]) + }); + var target = Optional.none(); + var delegate = Mutation(); + delegate.events.drag.bind(function (event) { + target.each(function (t) { + events.trigger.drag(event.xDelta, event.yDelta, t); + }); + }); + var assign = function (t) { + target = Optional.some(t); + }; + var get = function () { + return target; + }; + return { + assign: assign, + get: get, + mutate: delegate.mutate, + events: events.registry + }; }; var col = function (column, x, y, w, h) { - var bar = SugarElement.fromTag('div'); - setAll$1(bar, { - position: 'absolute', - left: x - w / 2 + 'px', - top: y + 'px', - height: h + 'px', - width: w + 'px' - }); - setAll(bar, { - 'data-column': column, - 'role': 'presentation' - }); - return bar; + var bar = SugarElement.fromTag('div'); + setAll$1(bar, { + position: 'absolute', + left: x - w / 2 + 'px', + top: y + 'px', + height: h + 'px', + width: w + 'px' + }); + setAll(bar, { + 'data-column': column, + 'role': 'presentation' + }); + return bar; }; var row = function (r, x, y, w, h) { - var bar = SugarElement.fromTag('div'); - setAll$1(bar, { - position: 'absolute', - left: x + 'px', - top: y - h / 2 + 'px', - height: h + 'px', - width: w + 'px' - }); - setAll(bar, { - 'data-row': r, - 'role': 'presentation' - }); - return bar; + var bar = SugarElement.fromTag('div'); + setAll$1(bar, { + position: 'absolute', + left: x + 'px', + top: y - h / 2 + 'px', + height: h + 'px', + width: w + 'px' + }); + setAll(bar, { + 'data-row': r, + 'role': 'presentation' + }); + return bar; }; var resizeBar = resolve$1('resizer-bar'); @@ -4345,2030 +4342,2030 @@ var resizeColBar = resolve$1('resizer-cols'); var BAR_THICKNESS = 7; var resizableRows = function (warehouse, isResizable) { - return bind(warehouse.all, function (row, i) { - return isResizable(row.element) ? [i] : []; - }); + return bind(warehouse.all, function (row, i) { + return isResizable(row.element) ? [i] : []; + }); }; var resizableColumns = function (warehouse, isResizable) { - var resizableCols = []; - range(warehouse.grid.columns, function (index) { - var colElmOpt = Warehouse.getColumnAt(warehouse, index).map(function (col) { - return col.element; - }); - if (colElmOpt.forall(isResizable)) { - resizableCols.push(index); - } + var resizableCols = []; + range(warehouse.grid.columns, function (index) { + var colElmOpt = Warehouse.getColumnAt(warehouse, index).map(function (col) { + return col.element; }); - return filter(resizableCols, function (colIndex) { - var columnCells = Warehouse.filterItems(warehouse, function (cell) { - return cell.column === colIndex; - }); - return forall(columnCells, function (cell) { - return isResizable(cell.element); - }); + if (colElmOpt.forall(isResizable)) { + resizableCols.push(index); + } + }); + return filter(resizableCols, function (colIndex) { + var columnCells = Warehouse.filterItems(warehouse, function (cell) { + return cell.column === colIndex; + }); + return forall(columnCells, function (cell) { + return isResizable(cell.element); }); + }); }; var destroy = function (wire) { - var previous = descendants$1(wire.parent(), '.' + resizeBar); - each(previous, remove$2); + var previous = descendants$1(wire.parent(), '.' + resizeBar); + each(previous, remove$2); }; var drawBar = function (wire, positions, create) { - var origin = wire.origin(); - each(positions, function (cpOption) { - cpOption.each(function (cp) { - var bar = create(origin, cp); - add$3(bar, resizeBar); - append(wire.parent(), bar); - }); + var origin = wire.origin(); + each(positions, function (cpOption) { + cpOption.each(function (cp) { + var bar = create(origin, cp); + add$3(bar, resizeBar); + append(wire.parent(), bar); }); + }); }; var refreshCol = function (wire, colPositions, position, tableHeight) { - drawBar(wire, colPositions, function (origin, cp) { - var colBar = col(cp.col, cp.x - origin.left, position.top - origin.top, BAR_THICKNESS, tableHeight); - add$3(colBar, resizeColBar); - return colBar; - }); + drawBar(wire, colPositions, function (origin, cp) { + var colBar = col(cp.col, cp.x - origin.left, position.top - origin.top, BAR_THICKNESS, tableHeight); + add$3(colBar, resizeColBar); + return colBar; + }); }; var refreshRow = function (wire, rowPositions, position, tableWidth) { - drawBar(wire, rowPositions, function (origin, cp) { - var rowBar = row(cp.row, position.left - origin.left, cp.y - origin.top, tableWidth, BAR_THICKNESS); - add$3(rowBar, resizeRowBar); - return rowBar; - }); + drawBar(wire, rowPositions, function (origin, cp) { + var rowBar = row(cp.row, position.left - origin.left, cp.y - origin.top, tableWidth, BAR_THICKNESS); + add$3(rowBar, resizeRowBar); + return rowBar; + }); }; var refreshGrid = function (warhouse, wire, table, rows, cols) { - var position = absolute(table); - var isResizable = wire.isResizable; - var rowPositions = rows.length > 0 ? height.positions(rows, table) : []; - var resizableRowBars = rowPositions.length > 0 ? resizableRows(warhouse, isResizable) : []; - var resizableRowPositions = filter(rowPositions, function (_pos, i) { - return exists(resizableRowBars, function (barIndex) { - return i === barIndex; - }); - }); - refreshRow(wire, resizableRowPositions, position, getOuter(table)); - var colPositions = cols.length > 0 ? width.positions(cols, table) : []; - var resizableColBars = colPositions.length > 0 ? resizableColumns(warhouse, isResizable) : []; - var resizableColPositions = filter(colPositions, function (_pos, i) { - return exists(resizableColBars, function (barIndex) { - return i === barIndex; - }); - }); - refreshCol(wire, resizableColPositions, position, getOuter$1(table)); + var position = absolute(table); + var isResizable = wire.isResizable; + var rowPositions = rows.length > 0 ? height.positions(rows, table) : []; + var resizableRowBars = rowPositions.length > 0 ? resizableRows(warhouse, isResizable) : []; + var resizableRowPositions = filter(rowPositions, function (_pos, i) { + return exists(resizableRowBars, function (barIndex) { + return i === barIndex; + }); + }); + refreshRow(wire, resizableRowPositions, position, getOuter(table)); + var colPositions = cols.length > 0 ? width.positions(cols, table) : []; + var resizableColBars = colPositions.length > 0 ? resizableColumns(warhouse, isResizable) : []; + var resizableColPositions = filter(colPositions, function (_pos, i) { + return exists(resizableColBars, function (barIndex) { + return i === barIndex; + }); + }); + refreshCol(wire, resizableColPositions, position, getOuter$1(table)); }; var refresh = function (wire, table) { - destroy(wire); - if (wire.isResizable(table)) { - var warehouse = Warehouse.fromTable(table); - var rows = rows$1(warehouse); - var cols = columns$1(warehouse); - refreshGrid(warehouse, wire, table, rows, cols); - } + destroy(wire); + if (wire.isResizable(table)) { + var warehouse = Warehouse.fromTable(table); + var rows = rows$1(warehouse); + var cols = columns$1(warehouse); + refreshGrid(warehouse, wire, table, rows, cols); + } }; var each$2 = function (wire, f) { - var bars = descendants$1(wire.parent(), '.' + resizeBar); - each(bars, f); + var bars = descendants$1(wire.parent(), '.' + resizeBar); + each(bars, f); }; var hide = function (wire) { - each$2(wire, function (bar) { - set$1(bar, 'display', 'none'); - }); + each$2(wire, function (bar) { + set$1(bar, 'display', 'none'); + }); }; var show = function (wire) { - each$2(wire, function (bar) { - set$1(bar, 'display', 'block'); - }); + each$2(wire, function (bar) { + set$1(bar, 'display', 'block'); + }); }; var isRowBar = function (element) { - return has$1(element, resizeRowBar); + return has$1(element, resizeRowBar); }; var isColBar = function (element) { - return has$1(element, resizeColBar); + return has$1(element, resizeColBar); }; var resizeBarDragging = resolve$1('resizer-bar-dragging'); var BarManager = function (wire) { - var mutation = BarMutation(); - var resizing = transform(mutation, {}); - var hoverTable = Optional.none(); - var getResizer = function (element, type) { - return Optional.from(get$2(element, type)); - }; - mutation.events.drag.bind(function (event) { - getResizer(event.target, 'data-row').each(function (_dataRow) { - var currentRow = getCssValue(event.target, 'top'); - set$1(event.target, 'top', currentRow + event.yDelta + 'px'); - }); - getResizer(event.target, 'data-column').each(function (_dataCol) { - var currentCol = getCssValue(event.target, 'left'); - set$1(event.target, 'left', currentCol + event.xDelta + 'px'); - }); - }); - var getDelta = function (target, dir) { - var newX = getCssValue(target, dir); - var oldX = getAttrValue(target, 'data-initial-' + dir, 0); - return newX - oldX; - }; - resizing.events.stop.bind(function () { - mutation.get().each(function (target) { - hoverTable.each(function (table) { - getResizer(target, 'data-row').each(function (row) { - var delta = getDelta(target, 'top'); - remove(target, 'data-initial-top'); - events.trigger.adjustHeight(table, delta, parseInt(row, 10)); - }); - getResizer(target, 'data-column').each(function (column) { - var delta = getDelta(target, 'left'); - remove(target, 'data-initial-left'); - events.trigger.adjustWidth(table, delta, parseInt(column, 10)); - }); - refresh(wire, table); - }); - }); - }); - var handler = function (target, dir) { - events.trigger.startAdjust(); - mutation.assign(target); - set(target, 'data-initial-' + dir, getCssValue(target, dir)); - add$3(target, resizeBarDragging); - set$1(target, 'opacity', '0.2'); - resizing.go(wire.parent()); - }; - var mousedown = bind$2(wire.parent(), 'mousedown', function (event) { - if (isRowBar(event.target)) { - handler(event.target, 'top'); - } - if (isColBar(event.target)) { - handler(event.target, 'left'); - } - }); - var isRoot = function (e) { - return eq$1(e, wire.view()); - }; - var findClosestEditableTable = function (target) { - return closest$1(target, 'table', isRoot).filter(function (table) { - return findClosestContentEditable(table, isRoot).exists(isContentEditableTrue); - }); - }; - var mouseover = bind$2(wire.view(), 'mouseover', function (event) { - findClosestEditableTable(event.target).fold(function () { - if (inBody(event.target)) { - destroy(wire); - } - }, function (table) { - hoverTable = Optional.some(table); - refresh(wire, table); - }); - }); - var destroy$1 = function () { - mousedown.unbind(); - mouseover.unbind(); - resizing.destroy(); + var mutation = BarMutation(); + var resizing = transform(mutation, {}); + var hoverTable = Optional.none(); + var getResizer = function (element, type) { + return Optional.from(get$2(element, type)); + }; + mutation.events.drag.bind(function (event) { + getResizer(event.target, 'data-row').each(function (_dataRow) { + var currentRow = getCssValue(event.target, 'top'); + set$1(event.target, 'top', currentRow + event.yDelta + 'px'); + }); + getResizer(event.target, 'data-column').each(function (_dataCol) { + var currentCol = getCssValue(event.target, 'left'); + set$1(event.target, 'left', currentCol + event.xDelta + 'px'); + }); + }); + var getDelta = function (target, dir) { + var newX = getCssValue(target, dir); + var oldX = getAttrValue(target, 'data-initial-' + dir, 0); + return newX - oldX; + }; + resizing.events.stop.bind(function () { + mutation.get().each(function (target) { + hoverTable.each(function (table) { + getResizer(target, 'data-row').each(function (row) { + var delta = getDelta(target, 'top'); + remove(target, 'data-initial-top'); + events.trigger.adjustHeight(table, delta, parseInt(row, 10)); + }); + getResizer(target, 'data-column').each(function (column) { + var delta = getDelta(target, 'left'); + remove(target, 'data-initial-left'); + events.trigger.adjustWidth(table, delta, parseInt(column, 10)); + }); + refresh(wire, table); + }); + }); + }); + var handler = function (target, dir) { + events.trigger.startAdjust(); + mutation.assign(target); + set(target, 'data-initial-' + dir, getCssValue(target, dir)); + add$3(target, resizeBarDragging); + set$1(target, 'opacity', '0.2'); + resizing.go(wire.parent()); + }; + var mousedown = bind$2(wire.parent(), 'mousedown', function (event) { + if (isRowBar(event.target)) { + handler(event.target, 'top'); + } + if (isColBar(event.target)) { + handler(event.target, 'left'); + } + }); + var isRoot = function (e) { + return eq$1(e, wire.view()); + }; + var findClosestEditableTable = function (target) { + return closest$1(target, 'table', isRoot).filter(function (table) { + return findClosestContentEditable(table, isRoot).exists(isContentEditableTrue); + }); + }; + var mouseover = bind$2(wire.view(), 'mouseover', function (event) { + findClosestEditableTable(event.target).fold(function () { + if (inBody(event.target)) { destroy(wire); - }; - var refresh$1 = function (tbl) { - refresh(wire, tbl); - }; - var events = create({ - adjustHeight: Event([ - 'table', - 'delta', - 'row' - ]), - adjustWidth: Event([ - 'table', - 'delta', - 'column' - ]), - startAdjust: Event([]) - }); - return { - destroy: destroy$1, - refresh: refresh$1, - on: resizing.on, - off: resizing.off, - hideBars: curry(hide, wire), - showBars: curry(show, wire), - events: events.registry - }; + } + }, function (table) { + hoverTable = Optional.some(table); + refresh(wire, table); + }); + }); + var destroy$1 = function () { + mousedown.unbind(); + mouseover.unbind(); + resizing.destroy(); + destroy(wire); + }; + var refresh$1 = function (tbl) { + refresh(wire, tbl); + }; + var events = create({ + adjustHeight: Event([ + 'table', + 'delta', + 'row' + ]), + adjustWidth: Event([ + 'table', + 'delta', + 'column' + ]), + startAdjust: Event([]) + }); + return { + destroy: destroy$1, + refresh: refresh$1, + on: resizing.on, + off: resizing.off, + hideBars: curry(hide, wire), + showBars: curry(show, wire), + events: events.registry + }; }; var create$1 = function (wire, resizing, lazySizing) { - var hdirection = height; - var vdirection = width; - var manager = BarManager(wire); - var events = create({ - beforeResize: Event([ - 'table', - 'type' - ]), - afterResize: Event([ - 'table', - 'type' - ]), - startDrag: Event([]) - }); - manager.events.adjustHeight.bind(function (event) { - var table = event.table; - events.trigger.beforeResize(table, 'row'); - var delta = hdirection.delta(event.delta, table); - adjustHeight(table, delta, event.row, hdirection); - events.trigger.afterResize(table, 'row'); - }); - manager.events.startAdjust.bind(function (_event) { - events.trigger.startDrag(); - }); - manager.events.adjustWidth.bind(function (event) { - var table = event.table; - events.trigger.beforeResize(table, 'col'); - var delta = vdirection.delta(event.delta, table); - var tableSize = lazySizing(table); - adjustWidth(table, delta, event.column, resizing, tableSize); - events.trigger.afterResize(table, 'col'); - }); - return { - on: manager.on, - off: manager.off, - hideBars: manager.hideBars, - showBars: manager.showBars, - destroy: manager.destroy, - events: events.registry - }; - }; - var TableResize = {create: create$1}; + var hdirection = height; + var vdirection = width; + var manager = BarManager(wire); + var events = create({ + beforeResize: Event([ + 'table', + 'type' + ]), + afterResize: Event([ + 'table', + 'type' + ]), + startDrag: Event([]) + }); + manager.events.adjustHeight.bind(function (event) { + var table = event.table; + events.trigger.beforeResize(table, 'row'); + var delta = hdirection.delta(event.delta, table); + adjustHeight(table, delta, event.row, hdirection); + events.trigger.afterResize(table, 'row'); + }); + manager.events.startAdjust.bind(function (_event) { + events.trigger.startDrag(); + }); + manager.events.adjustWidth.bind(function (event) { + var table = event.table; + events.trigger.beforeResize(table, 'col'); + var delta = vdirection.delta(event.delta, table); + var tableSize = lazySizing(table); + adjustWidth(table, delta, event.column, resizing, tableSize); + events.trigger.afterResize(table, 'col'); + }); + return { + on: manager.on, + off: manager.off, + hideBars: manager.hideBars, + showBars: manager.showBars, + destroy: manager.destroy, + events: events.registry + }; + }; + var TableResize = { create: create$1 }; var fireNewRow = function (editor, row) { - return editor.fire('newrow', {node: row}); + return editor.fire('newrow', { node: row }); }; var fireNewCell = function (editor, cell) { - return editor.fire('newcell', {node: cell}); + return editor.fire('newcell', { node: cell }); }; var fireObjectResizeStart = function (editor, target, width, height, origin) { - editor.fire('ObjectResizeStart', { - target: target, - width: width, - height: height, - origin: origin - }); + editor.fire('ObjectResizeStart', { + target: target, + width: width, + height: height, + origin: origin + }); }; var fireObjectResized = function (editor, target, width, height, origin) { - editor.fire('ObjectResized', { - target: target, - width: width, - height: height, - origin: origin - }); + editor.fire('ObjectResized', { + target: target, + width: width, + height: height, + origin: origin + }); }; var fireTableSelectionChange = function (editor, cells, start, finish, otherCells) { - editor.fire('TableSelectionChange', { - cells: cells, - start: start, - finish: finish, - otherCells: otherCells - }); + editor.fire('TableSelectionChange', { + cells: cells, + start: start, + finish: finish, + otherCells: otherCells + }); }; var fireTableSelectionClear = function (editor) { - editor.fire('TableSelectionClear'); + editor.fire('TableSelectionClear'); }; var fireTableModified = function (editor, table, data) { - editor.fire('TableModified', __assign(__assign({}, data), {table: table})); + editor.fire('TableModified', __assign(__assign({}, data), { table: table })); }; var defaultTableToolbar = 'tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol'; var defaultStyles = { - 'border-collapse': 'collapse', - 'width': '100%' + 'border-collapse': 'collapse', + 'width': '100%' }; var determineDefaultStyles = function (editor) { - if (isPixelsForced(editor)) { - var editorWidth = editor.getBody().offsetWidth; - return __assign(__assign({}, defaultStyles), {width: editorWidth + 'px'}); - } else if (isResponsiveForced(editor)) { - return filter$1(defaultStyles, function (_value, key) { - return key !== 'width'; - }); - } else { - return defaultStyles; - } - }; - var defaultAttributes = {border: '1'}; + if (isPixelsForced(editor)) { + var editorWidth = editor.getBody().offsetWidth; + return __assign(__assign({}, defaultStyles), { width: editorWidth + 'px' }); + } else if (isResponsiveForced(editor)) { + return filter$1(defaultStyles, function (_value, key) { + return key !== 'width'; + }); + } else { + return defaultStyles; + } + }; + var defaultAttributes = { border: '1' }; var defaultColumnResizingBehaviour = 'preservetable'; var getTableSizingMode = function (editor) { - return editor.getParam('table_sizing_mode', 'auto'); + return editor.getParam('table_sizing_mode', 'auto'); }; var getTableResponseWidth = function (editor) { - return editor.getParam('table_responsive_width'); + return editor.getParam('table_responsive_width'); }; var getDefaultAttributes = function (editor) { - return editor.getParam('table_default_attributes', defaultAttributes, 'object'); + return editor.getParam('table_default_attributes', defaultAttributes, 'object'); }; var getDefaultStyles = function (editor) { - return editor.getParam('table_default_styles', determineDefaultStyles(editor), 'object'); + return editor.getParam('table_default_styles', determineDefaultStyles(editor), 'object'); }; var hasTableResizeBars = function (editor) { - return editor.getParam('table_resize_bars', true, 'boolean'); + return editor.getParam('table_resize_bars', true, 'boolean'); }; var hasTabNavigation = function (editor) { - return editor.getParam('table_tab_navigation', true, 'boolean'); + return editor.getParam('table_tab_navigation', true, 'boolean'); }; var hasAdvancedCellTab = function (editor) { - return editor.getParam('table_cell_advtab', true, 'boolean'); + return editor.getParam('table_cell_advtab', true, 'boolean'); }; var hasAdvancedRowTab = function (editor) { - return editor.getParam('table_row_advtab', true, 'boolean'); + return editor.getParam('table_row_advtab', true, 'boolean'); }; var hasAdvancedTableTab = function (editor) { - return editor.getParam('table_advtab', true, 'boolean'); + return editor.getParam('table_advtab', true, 'boolean'); }; var hasAppearanceOptions = function (editor) { - return editor.getParam('table_appearance_options', true, 'boolean'); + return editor.getParam('table_appearance_options', true, 'boolean'); }; var hasTableGrid = function (editor) { - return editor.getParam('table_grid', true, 'boolean'); + return editor.getParam('table_grid', true, 'boolean'); }; var shouldStyleWithCss = function (editor) { - return editor.getParam('table_style_by_css', false, 'boolean'); + return editor.getParam('table_style_by_css', false, 'boolean'); }; var getCellClassList = function (editor) { - return editor.getParam('table_cell_class_list', [], 'array'); + return editor.getParam('table_cell_class_list', [], 'array'); }; var getRowClassList = function (editor) { - return editor.getParam('table_row_class_list', [], 'array'); + return editor.getParam('table_row_class_list', [], 'array'); }; var getTableClassList = function (editor) { - return editor.getParam('table_class_list', [], 'array'); + return editor.getParam('table_class_list', [], 'array'); }; var isPercentagesForced = function (editor) { - return getTableSizingMode(editor) === 'relative' || getTableResponseWidth(editor) === true; + return getTableSizingMode(editor) === 'relative' || getTableResponseWidth(editor) === true; }; var isPixelsForced = function (editor) { - return getTableSizingMode(editor) === 'fixed' || getTableResponseWidth(editor) === false; + return getTableSizingMode(editor) === 'fixed' || getTableResponseWidth(editor) === false; }; var isResponsiveForced = function (editor) { - return getTableSizingMode(editor) === 'responsive'; + return getTableSizingMode(editor) === 'responsive'; }; var getToolbar = function (editor) { - return editor.getParam('table_toolbar', defaultTableToolbar); + return editor.getParam('table_toolbar', defaultTableToolbar); }; var useColumnGroup = function (editor) { - return editor.getParam('table_use_colgroups', false, 'boolean'); + return editor.getParam('table_use_colgroups', false, 'boolean'); }; var getTableHeaderType = function (editor) { - var defaultValue = 'section'; - var value = editor.getParam('table_header_type', defaultValue, 'string'); - var validValues = [ - 'section', - 'cells', - 'sectionCells', - 'auto' - ]; - if (!contains(validValues, value)) { - return defaultValue; - } else { - return value; - } + var defaultValue = 'section'; + var value = editor.getParam('table_header_type', defaultValue, 'string'); + var validValues = [ + 'section', + 'cells', + 'sectionCells', + 'auto' + ]; + if (!contains(validValues, value)) { + return defaultValue; + } else { + return value; + } }; var getColumnResizingBehaviour = function (editor) { - var validModes = [ - 'preservetable', - 'resizetable' - ]; - var givenMode = editor.getParam('table_column_resizing', defaultColumnResizingBehaviour, 'string'); - return find(validModes, function (mode) { - return mode === givenMode; - }).getOr(defaultColumnResizingBehaviour); + var validModes = [ + 'preservetable', + 'resizetable' + ]; + var givenMode = editor.getParam('table_column_resizing', defaultColumnResizingBehaviour, 'string'); + return find(validModes, function (mode) { + return mode === givenMode; + }).getOr(defaultColumnResizingBehaviour); }; var isPreserveTableColumnResizing = function (editor) { - return getColumnResizingBehaviour(editor) === 'preservetable'; + return getColumnResizingBehaviour(editor) === 'preservetable'; }; var getCloneElements = function (editor) { - var cloneElements = editor.getParam('table_clone_elements'); - if (isString(cloneElements)) { - return Optional.some(cloneElements.split(/[ ,]/)); - } else if (Array.isArray(cloneElements)) { - return Optional.some(cloneElements); - } else { - return Optional.none(); - } + var cloneElements = editor.getParam('table_clone_elements'); + if (isString(cloneElements)) { + return Optional.some(cloneElements.split(/[ ,]/)); + } else if (Array.isArray(cloneElements)) { + return Optional.some(cloneElements); + } else { + return Optional.none(); + } }; var hasObjectResizing = function (editor) { - var objectResizing = editor.getParam('object_resizing', true); - return isString(objectResizing) ? objectResizing === 'table' : objectResizing; + var objectResizing = editor.getParam('object_resizing', true); + return isString(objectResizing) ? objectResizing === 'table' : objectResizing; }; var getNodeName = function (elm) { - return elm.nodeName.toLowerCase(); + return elm.nodeName.toLowerCase(); }; var getBody$1 = function (editor) { - return SugarElement.fromDom(editor.getBody()); + return SugarElement.fromDom(editor.getBody()); }; var getPixelWidth$1 = function (elm) { - return elm.getBoundingClientRect().width; + return elm.getBoundingClientRect().width; }; var getPixelHeight = function (elm) { - return elm.getBoundingClientRect().height; + return elm.getBoundingClientRect().height; }; var getIsRoot = function (editor) { - return function (element) { - return eq$1(element, getBody$1(editor)); - }; + return function (element) { + return eq$1(element, getBody$1(editor)); + }; }; var removePxSuffix = function (size) { - return size ? size.replace(/px$/, '') : ''; + return size ? size.replace(/px$/, '') : ''; }; var addPxSuffix = function (size) { - return /^\d+(\.\d+)?$/.test(size) ? size + 'px' : size; + return /^\d+(\.\d+)?$/.test(size) ? size + 'px' : size; }; var removeDataStyle = function (table) { - remove(table, 'data-mce-style'); - var removeStyleAttribute = function (element) { - return remove(element, 'data-mce-style'); - }; - each(cells(table), removeStyleAttribute); - each(columns(table), removeStyleAttribute); + remove(table, 'data-mce-style'); + var removeStyleAttribute = function (element) { + return remove(element, 'data-mce-style'); + }; + each(cells(table), removeStyleAttribute); + each(columns(table), removeStyleAttribute); }; var getRawWidth$1 = function (editor, elm) { - var raw = editor.dom.getStyle(elm, 'width') || editor.dom.getAttrib(elm, 'width'); - return Optional.from(raw).filter(isNotEmpty); + var raw = editor.dom.getStyle(elm, 'width') || editor.dom.getAttrib(elm, 'width'); + return Optional.from(raw).filter(isNotEmpty); }; var isPercentage = function (value) { - return /^(\d+(\.\d+)?)%$/.test(value); + return /^(\d+(\.\d+)?)%$/.test(value); }; var isPixel = function (value) { - return /^(\d+(\.\d+)?)px$/.test(value); + return /^(\d+(\.\d+)?)px$/.test(value); }; var getSelectionStart = function (editor) { - return SugarElement.fromDom(editor.selection.getStart()); + return SugarElement.fromDom(editor.selection.getStart()); }; var Cell = function (initial) { - var value = initial; - var get = function () { - return value; - }; - var set = function (v) { - value = v; - }; - return { - get: get, - set: set - }; + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; }; var noneSize = function (table) { - var getWidth = function () { - return get$5(table); - }; - var zero = constant(0); - var getWidths = function (warehouse, tableSize) { - return getPixelWidths(warehouse, table, tableSize); - }; - return { - width: getWidth, - pixelWidth: getWidth, - getWidths: getWidths, - getCellDelta: zero, - singleColumnWidth: constant([0]), - minCellWidth: zero, - setElementWidth: noop, - adjustTableWidth: noop, - isRelative: true, - label: 'none' - }; + var getWidth = function () { + return get$5(table); + }; + var zero = constant(0); + var getWidths = function (warehouse, tableSize) { + return getPixelWidths(warehouse, table, tableSize); + }; + return { + width: getWidth, + pixelWidth: getWidth, + getWidths: getWidths, + getCellDelta: zero, + singleColumnWidth: constant([0]), + minCellWidth: zero, + setElementWidth: noop, + adjustTableWidth: noop, + isRelative: true, + label: 'none' + }; }; var percentageSize = function (initialWidth, table) { - var floatWidth = Cell(parseFloat(initialWidth)); - var pixelWidth = Cell(get$5(table)); - var getCellDelta = function (delta) { - return delta / pixelWidth.get() * 100; - }; - var singleColumnWidth = function (w, _delta) { - return [100 - w]; - }; - var minCellWidth = function () { - return minWidth() / pixelWidth.get() * 100; - }; - var adjustTableWidth = function (delta) { - var currentWidth = floatWidth.get(); - var change = delta / 100 * currentWidth; - var newWidth = currentWidth + change; - setPercentageWidth(table, newWidth); - floatWidth.set(newWidth); - pixelWidth.set(get$5(table)); - }; - var getWidths = function (warehouse, tableSize) { - return getPercentageWidths(warehouse, table, tableSize); - }; - return { - width: floatWidth.get, - pixelWidth: pixelWidth.get, - getWidths: getWidths, - getCellDelta: getCellDelta, - singleColumnWidth: singleColumnWidth, - minCellWidth: minCellWidth, - setElementWidth: setPercentageWidth, - adjustTableWidth: adjustTableWidth, - isRelative: true, - label: 'percent' - }; + var floatWidth = Cell(parseFloat(initialWidth)); + var pixelWidth = Cell(get$5(table)); + var getCellDelta = function (delta) { + return delta / pixelWidth.get() * 100; + }; + var singleColumnWidth = function (w, _delta) { + return [100 - w]; + }; + var minCellWidth = function () { + return minWidth() / pixelWidth.get() * 100; + }; + var adjustTableWidth = function (delta) { + var currentWidth = floatWidth.get(); + var change = delta / 100 * currentWidth; + var newWidth = currentWidth + change; + setPercentageWidth(table, newWidth); + floatWidth.set(newWidth); + pixelWidth.set(get$5(table)); + }; + var getWidths = function (warehouse, tableSize) { + return getPercentageWidths(warehouse, table, tableSize); + }; + return { + width: floatWidth.get, + pixelWidth: pixelWidth.get, + getWidths: getWidths, + getCellDelta: getCellDelta, + singleColumnWidth: singleColumnWidth, + minCellWidth: minCellWidth, + setElementWidth: setPercentageWidth, + adjustTableWidth: adjustTableWidth, + isRelative: true, + label: 'percent' + }; }; var pixelSize = function (initialWidth, table) { - var width = Cell(initialWidth); - var getWidth = width.get; - var getCellDelta = identity; - var singleColumnWidth = function (w, delta) { - var newNext = Math.max(minWidth(), w + delta); - return [newNext - w]; - }; - var adjustTableWidth = function (delta) { - var newWidth = getWidth() + delta; - setPixelWidth(table, newWidth); - width.set(newWidth); - }; - var getWidths = function (warehouse, tableSize) { - return getPixelWidths(warehouse, table, tableSize); - }; - return { - width: getWidth, - pixelWidth: getWidth, - getWidths: getWidths, - getCellDelta: getCellDelta, - singleColumnWidth: singleColumnWidth, - minCellWidth: minWidth, - setElementWidth: setPixelWidth, - adjustTableWidth: adjustTableWidth, - isRelative: false, - label: 'pixel' - }; + var width = Cell(initialWidth); + var getWidth = width.get; + var getCellDelta = identity; + var singleColumnWidth = function (w, delta) { + var newNext = Math.max(minWidth(), w + delta); + return [newNext - w]; + }; + var adjustTableWidth = function (delta) { + var newWidth = getWidth() + delta; + setPixelWidth(table, newWidth); + width.set(newWidth); + }; + var getWidths = function (warehouse, tableSize) { + return getPixelWidths(warehouse, table, tableSize); + }; + return { + width: getWidth, + pixelWidth: getWidth, + getWidths: getWidths, + getCellDelta: getCellDelta, + singleColumnWidth: singleColumnWidth, + minCellWidth: minWidth, + setElementWidth: setPixelWidth, + adjustTableWidth: adjustTableWidth, + isRelative: false, + label: 'pixel' + }; }; var chooseSize = function (element, width) { - var percentMatch = percentageBasedSizeRegex().exec(width); - if (percentMatch !== null) { - return percentageSize(percentMatch[1], element); - } - var pixelMatch = pixelBasedSizeRegex().exec(width); - if (pixelMatch !== null) { - var intWidth = parseInt(pixelMatch[1], 10); - return pixelSize(intWidth, element); - } - var fallbackWidth = get$5(element); - return pixelSize(fallbackWidth, element); + var percentMatch = percentageBasedSizeRegex().exec(width); + if (percentMatch !== null) { + return percentageSize(percentMatch[1], element); + } + var pixelMatch = pixelBasedSizeRegex().exec(width); + if (pixelMatch !== null) { + var intWidth = parseInt(pixelMatch[1], 10); + return pixelSize(intWidth, element); + } + var fallbackWidth = get$5(element); + return pixelSize(fallbackWidth, element); }; var getTableSize = function (table) { - var width = getRawWidth(table); - return width.fold(function () { - return noneSize(table); - }, function (w) { - return chooseSize(table, w); - }); + var width = getRawWidth(table); + return width.fold(function () { + return noneSize(table); + }, function (w) { + return chooseSize(table, w); + }); }; var TableSize = { - getTableSize: getTableSize, - pixelSize: pixelSize, - percentageSize: percentageSize, - noneSize: noneSize + getTableSize: getTableSize, + pixelSize: pixelSize, + percentageSize: percentageSize, + noneSize: noneSize }; var get$9 = function (editor, table) { - if (isPercentagesForced(editor)) { - var width = getRawWidth$1(editor, table.dom).filter(isPercentage).getOrThunk(function () { - return getPercentTableWidth$1(table); - }); - return TableSize.percentageSize(width, table); - } else if (isPixelsForced(editor)) { - return TableSize.pixelSize(get$5(table), table); - } else { - return TableSize.getTableSize(table); - } + if (isPercentagesForced(editor)) { + var width = getRawWidth$1(editor, table.dom).filter(isPercentage).getOrThunk(function () { + return getPercentTableWidth$1(table); + }); + return TableSize.percentageSize(width, table); + } else if (isPixelsForced(editor)) { + return TableSize.pixelSize(get$5(table), table); + } else { + return TableSize.getTableSize(table); + } }; var cleanupLegacyAttributes = function (element) { - remove(element, 'width'); + remove(element, 'width'); }; var convertToPercentSize = function (table, tableSize) { - var newWidth = getPercentTableWidth(table); - redistribute$1(table, Optional.some(newWidth), Optional.none(), tableSize); - cleanupLegacyAttributes(table); + var newWidth = getPercentTableWidth(table); + redistribute$1(table, Optional.some(newWidth), Optional.none(), tableSize); + cleanupLegacyAttributes(table); }; var convertToPixelSize = function (table, tableSize) { - var newWidth = getPixelTableWidth(table); - redistribute$1(table, Optional.some(newWidth), Optional.none(), tableSize); - cleanupLegacyAttributes(table); + var newWidth = getPixelTableWidth(table); + redistribute$1(table, Optional.some(newWidth), Optional.none(), tableSize); + cleanupLegacyAttributes(table); }; var convertToNoneSize = function (table) { - remove$1(table, 'width'); - var columns$1 = columns(table); - var rowElements = columns$1.length > 0 ? columns$1 : cells(table); - each(rowElements, function (cell) { - remove$1(cell, 'width'); - cleanupLegacyAttributes(cell); - }); - cleanupLegacyAttributes(table); + remove$1(table, 'width'); + var columns$1 = columns(table); + var rowElements = columns$1.length > 0 ? columns$1 : cells(table); + each(rowElements, function (cell) { + remove$1(cell, 'width'); + cleanupLegacyAttributes(cell); + }); + cleanupLegacyAttributes(table); }; var enforcePercentage = function (editor, table) { - var tableSizing = get$9(editor, table); - convertToPercentSize(table, tableSizing); + var tableSizing = get$9(editor, table); + convertToPercentSize(table, tableSizing); }; var enforcePixels = function (editor, table) { - var tableSizing = get$9(editor, table); - convertToPixelSize(table, tableSizing); + var tableSizing = get$9(editor, table); + convertToPixelSize(table, tableSizing); }; var enforceNone = convertToNoneSize; var syncPixels = function (table) { - var warehouse = Warehouse.fromTable(table); - if (!Warehouse.hasColumns(warehouse)) { - each(cells(table), function (cell) { - var computedWidth = get$3(cell, 'width'); - set$1(cell, 'width', computedWidth); - remove(cell, 'width'); - }); - } + var warehouse = Warehouse.fromTable(table); + if (!Warehouse.hasColumns(warehouse)) { + each(cells(table), function (cell) { + var computedWidth = get$3(cell, 'width'); + set$1(cell, 'width', computedWidth); + remove(cell, 'width'); + }); + } }; var createContainer = function () { - var container = SugarElement.fromTag('div'); - setAll$1(container, { - position: 'static', - height: '0', - width: '0', - padding: '0', - margin: '0', - border: '0' - }); - append(body(), container); - return container; + var container = SugarElement.fromTag('div'); + setAll$1(container, { + position: 'static', + height: '0', + width: '0', + padding: '0', + margin: '0', + border: '0' + }); + append(body(), container); + return container; }; var get$a = function (editor, isResizable) { - return editor.inline ? ResizeWire.body(getBody$1(editor), createContainer(), isResizable) : ResizeWire.only(SugarElement.fromDom(editor.getDoc()), isResizable); + return editor.inline ? ResizeWire.body(getBody$1(editor), createContainer(), isResizable) : ResizeWire.only(SugarElement.fromDom(editor.getDoc()), isResizable); }; var remove$6 = function (editor, wire) { - if (editor.inline) { - remove$2(wire.parent()); - } + if (editor.inline) { + remove$2(wire.parent()); + } }; var barResizerPrefix = 'bar-'; var isResizable = function (elm) { - return get$2(elm, 'data-mce-resize') !== 'false'; + return get$2(elm, 'data-mce-resize') !== 'false'; }; var getResizeHandler = function (editor) { - var selectionRng = Optional.none(); - var resize = Optional.none(); - var wire = Optional.none(); - var startW; - var startRawW; - var isTable = function (elm) { - return elm.nodeName === 'TABLE'; - }; - var lazyResize = function () { - return resize; - }; - var lazyWire = function () { - return wire.getOr(ResizeWire.only(SugarElement.fromDom(editor.getBody()), isResizable)); - }; - var lazySizing = function (table) { - return get$9(editor, table); - }; - var lazyResizingBehaviour = function () { - return isPreserveTableColumnResizing(editor) ? preserveTable() : resizeTable(); - }; - var getNumColumns = function (table) { - return getGridSize(table).columns; - }; - var afterCornerResize = function (table, origin, width) { - var isRightEdgeResize = endsWith(origin, 'e'); - if (startRawW === '') { - enforcePercentage(editor, table); - } - if (width !== startW && startRawW !== '') { - set$1(table, 'width', startRawW); - var resizing = lazyResizingBehaviour(); - var tableSize = lazySizing(table); - var col = isPreserveTableColumnResizing(editor) || isRightEdgeResize ? getNumColumns(table) - 1 : 0; - adjustWidth(table, width - startW, col, resizing, tableSize); - } else if (isPercentage(startRawW)) { - var percentW = parseFloat(startRawW.replace('%', '')); - var targetPercentW = width * percentW / startW; - set$1(table, 'width', targetPercentW + '%'); - } - if (isPixel(startRawW)) { - syncPixels(table); - } - }; - var destroy = function () { - resize.each(function (sz) { - sz.destroy(); - }); - wire.each(function (w) { - remove$6(editor, w); - }); - }; - editor.on('init', function () { - var rawWire = get$a(editor, isResizable); - wire = Optional.some(rawWire); - if (hasObjectResizing(editor) && hasTableResizeBars(editor)) { - var resizing = lazyResizingBehaviour(); - var sz = TableResize.create(rawWire, resizing, lazySizing); - sz.on(); - sz.events.startDrag.bind(function (_event) { - selectionRng = Optional.some(editor.selection.getRng()); - }); - sz.events.beforeResize.bind(function (event) { - var rawTable = event.table.dom; - fireObjectResizeStart(editor, rawTable, getPixelWidth$1(rawTable), getPixelHeight(rawTable), barResizerPrefix + event.type); - }); - sz.events.afterResize.bind(function (event) { - var table = event.table; - var rawTable = table.dom; - removeDataStyle(table); - selectionRng.each(function (rng) { - editor.selection.setRng(rng); - editor.focus(); - }); - fireObjectResized(editor, rawTable, getPixelWidth$1(rawTable), getPixelHeight(rawTable), barResizerPrefix + event.type); - editor.undoManager.add(); - }); - resize = Optional.some(sz); - } - }); - editor.on('ObjectResizeStart', function (e) { - var targetElm = e.target; - if (isTable(targetElm)) { - var table = SugarElement.fromDom(targetElm); - each(editor.dom.select('.mce-clonedresizable'), function (clone) { - editor.dom.addClass(clone, 'mce-' + getColumnResizingBehaviour(editor) + '-columns'); - }); - if (!isPixelSizing$1(table) && isPixelsForced(editor)) { - enforcePixels(editor, table); - } else if (!isPercentSizing$1(table) && isPercentagesForced(editor)) { - enforcePercentage(editor, table); - } - if (isNoneSizing$1(table) && startsWith(e.origin, barResizerPrefix)) { - enforcePercentage(editor, table); - } - startW = e.width; - startRawW = isResponsiveForced(editor) ? '' : getRawWidth$1(editor, targetElm).getOr(''); - } - }); - editor.on('ObjectResized', function (e) { - var targetElm = e.target; - if (isTable(targetElm)) { - var table = SugarElement.fromDom(targetElm); - var origin_1 = e.origin; - if (startsWith(origin_1, 'corner-')) { - afterCornerResize(table, origin_1, e.width); - } - removeDataStyle(table); - fireTableModified(editor, table.dom); - } - }); - editor.on('SwitchMode', function () { - lazyResize().each(function (resize) { - if (editor.mode.isReadOnly()) { - resize.hideBars(); - } else { - resize.showBars(); - } + var selectionRng = Optional.none(); + var resize = Optional.none(); + var wire = Optional.none(); + var startW; + var startRawW; + var isTable = function (elm) { + return elm.nodeName === 'TABLE'; + }; + var lazyResize = function () { + return resize; + }; + var lazyWire = function () { + return wire.getOr(ResizeWire.only(SugarElement.fromDom(editor.getBody()), isResizable)); + }; + var lazySizing = function (table) { + return get$9(editor, table); + }; + var lazyResizingBehaviour = function () { + return isPreserveTableColumnResizing(editor) ? preserveTable() : resizeTable(); + }; + var getNumColumns = function (table) { + return getGridSize(table).columns; + }; + var afterCornerResize = function (table, origin, width) { + var isRightEdgeResize = endsWith(origin, 'e'); + if (startRawW === '') { + enforcePercentage(editor, table); + } + if (width !== startW && startRawW !== '') { + set$1(table, 'width', startRawW); + var resizing = lazyResizingBehaviour(); + var tableSize = lazySizing(table); + var col = isPreserveTableColumnResizing(editor) || isRightEdgeResize ? getNumColumns(table) - 1 : 0; + adjustWidth(table, width - startW, col, resizing, tableSize); + } else if (isPercentage(startRawW)) { + var percentW = parseFloat(startRawW.replace('%', '')); + var targetPercentW = width * percentW / startW; + set$1(table, 'width', targetPercentW + '%'); + } + if (isPixel(startRawW)) { + syncPixels(table); + } + }; + var destroy = function () { + resize.each(function (sz) { + sz.destroy(); + }); + wire.each(function (w) { + remove$6(editor, w); + }); + }; + editor.on('init', function () { + var rawWire = get$a(editor, isResizable); + wire = Optional.some(rawWire); + if (hasObjectResizing(editor) && hasTableResizeBars(editor)) { + var resizing = lazyResizingBehaviour(); + var sz = TableResize.create(rawWire, resizing, lazySizing); + sz.on(); + sz.events.startDrag.bind(function (_event) { + selectionRng = Optional.some(editor.selection.getRng()); + }); + sz.events.beforeResize.bind(function (event) { + var rawTable = event.table.dom; + fireObjectResizeStart(editor, rawTable, getPixelWidth$1(rawTable), getPixelHeight(rawTable), barResizerPrefix + event.type); + }); + sz.events.afterResize.bind(function (event) { + var table = event.table; + var rawTable = table.dom; + removeDataStyle(table); + selectionRng.each(function (rng) { + editor.selection.setRng(rng); + editor.focus(); }); - }); - return { - lazyResize: lazyResize, - lazyWire: lazyWire, - destroy: destroy - }; + fireObjectResized(editor, rawTable, getPixelWidth$1(rawTable), getPixelHeight(rawTable), barResizerPrefix + event.type); + editor.undoManager.add(); + }); + resize = Optional.some(sz); + } + }); + editor.on('ObjectResizeStart', function (e) { + var targetElm = e.target; + if (isTable(targetElm)) { + var table = SugarElement.fromDom(targetElm); + each(editor.dom.select('.mce-clonedresizable'), function (clone) { + editor.dom.addClass(clone, 'mce-' + getColumnResizingBehaviour(editor) + '-columns'); + }); + if (!isPixelSizing$1(table) && isPixelsForced(editor)) { + enforcePixels(editor, table); + } else if (!isPercentSizing$1(table) && isPercentagesForced(editor)) { + enforcePercentage(editor, table); + } + if (isNoneSizing$1(table) && startsWith(e.origin, barResizerPrefix)) { + enforcePercentage(editor, table); + } + startW = e.width; + startRawW = isResponsiveForced(editor) ? '' : getRawWidth$1(editor, targetElm).getOr(''); + } + }); + editor.on('ObjectResized', function (e) { + var targetElm = e.target; + if (isTable(targetElm)) { + var table = SugarElement.fromDom(targetElm); + var origin_1 = e.origin; + if (startsWith(origin_1, 'corner-')) { + afterCornerResize(table, origin_1, e.width); + } + removeDataStyle(table); + fireTableModified(editor, table.dom); + } + }); + editor.on('SwitchMode', function () { + lazyResize().each(function (resize) { + if (editor.mode.isReadOnly()) { + resize.hideBars(); + } else { + resize.showBars(); + } + }); + }); + return { + lazyResize: lazyResize, + lazyWire: lazyWire, + destroy: destroy + }; }; var point = function (element, offset) { - return { - element: element, - offset: offset - }; + return { + element: element, + offset: offset + }; }; var scan = function (universe, element, direction) { - if (universe.property().isText(element) && universe.property().getText(element).trim().length === 0 || universe.property().isComment(element)) { - return direction(element).bind(function (elem) { - return scan(universe, elem, direction).orThunk(function () { - return Optional.some(elem); - }); - }); - } else { - return Optional.none(); - } + if (universe.property().isText(element) && universe.property().getText(element).trim().length === 0 || universe.property().isComment(element)) { + return direction(element).bind(function (elem) { + return scan(universe, elem, direction).orThunk(function () { + return Optional.some(elem); + }); + }); + } else { + return Optional.none(); + } }; var toEnd = function (universe, element) { - if (universe.property().isText(element)) { - return universe.property().getText(element).length; - } - var children = universe.property().children(element); - return children.length; + if (universe.property().isText(element)) { + return universe.property().getText(element).length; + } + var children = universe.property().children(element); + return children.length; }; var freefallRtl = function (universe, element) { - var candidate = scan(universe, element, universe.query().prevSibling).getOr(element); - if (universe.property().isText(candidate)) { - return point(candidate, toEnd(universe, candidate)); - } - var children = universe.property().children(candidate); - return children.length > 0 ? freefallRtl(universe, children[children.length - 1]) : point(candidate, toEnd(universe, candidate)); + var candidate = scan(universe, element, universe.query().prevSibling).getOr(element); + if (universe.property().isText(candidate)) { + return point(candidate, toEnd(universe, candidate)); + } + var children = universe.property().children(candidate); + return children.length > 0 ? freefallRtl(universe, children[children.length - 1]) : point(candidate, toEnd(universe, candidate)); }; var freefallRtl$1 = freefallRtl; var universe$1 = DomUniverse(); var freefallRtl$2 = function (element) { - return freefallRtl$1(universe$1, element); + return freefallRtl$1(universe$1, element); }; var halve = function (main, other) { - var width = getGenericWidth(main); - width.each(function (w) { - var newWidth = w.value / 2; - setGenericWidth(main, newWidth, w.unit); - setGenericWidth(other, newWidth, w.unit); - }); + var width = getGenericWidth(main); + width.each(function (w) { + var newWidth = w.value / 2; + setGenericWidth(main, newWidth, w.unit); + setGenericWidth(other, newWidth, w.unit); + }); }; var addCell = function (gridRow, index, cell) { - var cells = gridRow.cells; - var before = cells.slice(0, index); - var after = cells.slice(index); - var newCells = before.concat([cell]).concat(after); - return setCells(gridRow, newCells); + var cells = gridRow.cells; + var before = cells.slice(0, index); + var after = cells.slice(index); + var newCells = before.concat([cell]).concat(after); + return setCells(gridRow, newCells); }; var mutateCell = function (gridRow, index, cell) { - var cells = gridRow.cells; - cells[index] = cell; + var cells = gridRow.cells; + cells[index] = cell; }; var setCells = function (gridRow, cells) { - return rowcells(cells, gridRow.section); + return rowcells(cells, gridRow.section); }; var mapCells = function (gridRow, f) { - var cells = gridRow.cells; - var r = map(cells, f); - return rowcells(r, gridRow.section); + var cells = gridRow.cells; + var r = map(cells, f); + return rowcells(r, gridRow.section); }; var getCell = function (gridRow, index) { - return gridRow.cells[index]; + return gridRow.cells[index]; }; var getCellElement = function (gridRow, index) { - return getCell(gridRow, index).element; + return getCell(gridRow, index).element; }; var cellLength = function (gridRow) { - return gridRow.cells.length; + return gridRow.cells.length; }; var extractGridDetails = function (grid) { - var result = partition(grid, function (row) { - return row.section === 'colgroup'; - }); - return { - rows: result.fail, - cols: result.pass - }; + var result = partition(grid, function (row) { + return row.section === 'colgroup'; + }); + return { + rows: result.fail, + cols: result.pass + }; }; var setIfNot = function (element, property, value, ignore) { - if (value === ignore) { - remove(element, property); - } else { - set(element, property, value); - } + if (value === ignore) { + remove(element, property); + } else { + set(element, property, value); + } }; var insert = function (table, selector, element) { - last(children$2(table, selector)).fold(function () { - return prepend(table, element); - }, function (child) { - return after(child, element); - }); + last(children$2(table, selector)).fold(function () { + return prepend(table, element); + }, function (child) { + return after(child, element); + }); }; var generateSection = function (table, sectionName) { - var section = child$2(table, sectionName).getOrThunk(function () { - var newSection = SugarElement.fromTag(sectionName, owner(table).dom); - if (sectionName === 'thead') { - insert(table, 'caption,colgroup', newSection); - } else if (sectionName === 'colgroup') { - insert(table, 'caption', newSection); - } else { - append(table, newSection); - } - return newSection; - }); - empty(section); - return section; + var section = child$2(table, sectionName).getOrThunk(function () { + var newSection = SugarElement.fromTag(sectionName, owner(table).dom); + if (sectionName === 'thead') { + insert(table, 'caption,colgroup', newSection); + } else if (sectionName === 'colgroup') { + insert(table, 'caption', newSection); + } else { + append(table, newSection); + } + return newSection; + }); + empty(section); + return section; }; var render = function (table, grid) { - var newRows = []; - var newCells = []; - var syncRows = function (gridSection) { - return map(gridSection, function (row) { - if (row.isNew) { - newRows.push(row.element); - } - var tr = row.element; - empty(tr); - each(row.cells, function (cell) { - if (cell.isNew) { - newCells.push(cell.element); - } - setIfNot(cell.element, 'colspan', cell.colspan, 1); - setIfNot(cell.element, 'rowspan', cell.rowspan, 1); - append(tr, cell.element); - }); - return tr; - }); - }; - var syncColGroup = function (gridSection) { - return bind(gridSection, function (colGroup) { - return map(colGroup.cells, function (col) { - setIfNot(col.element, 'span', col.colspan, 1); - return col.element; - }); - }); - }; - var renderSection = function (gridSection, sectionName) { - var section = generateSection(table, sectionName); - var sync = sectionName === 'colgroup' ? syncColGroup : syncRows; - var sectionElems = sync(gridSection); - append$1(section, sectionElems); - }; - var removeSection = function (sectionName) { - child$2(table, sectionName).each(remove$2); - }; - var renderOrRemoveSection = function (gridSection, sectionName) { - if (gridSection.length > 0) { - renderSection(gridSection, sectionName); - } else { - removeSection(sectionName); - } - }; - var headSection = []; - var bodySection = []; - var footSection = []; - var columnGroupsSection = []; - each(grid, function (row) { - switch (row.section) { - case 'thead': - headSection.push(row); - break; - case 'tbody': - bodySection.push(row); - break; - case 'tfoot': - footSection.push(row); - break; - case 'colgroup': - columnGroupsSection.push(row); - break; - } - }); - renderOrRemoveSection(columnGroupsSection, 'colgroup'); - renderOrRemoveSection(headSection, 'thead'); - renderOrRemoveSection(bodySection, 'tbody'); - renderOrRemoveSection(footSection, 'tfoot'); - return { - newRows: newRows, - newCells: newCells - }; + var newRows = []; + var newCells = []; + var syncRows = function (gridSection) { + return map(gridSection, function (row) { + if (row.isNew) { + newRows.push(row.element); + } + var tr = row.element; + empty(tr); + each(row.cells, function (cell) { + if (cell.isNew) { + newCells.push(cell.element); + } + setIfNot(cell.element, 'colspan', cell.colspan, 1); + setIfNot(cell.element, 'rowspan', cell.rowspan, 1); + append(tr, cell.element); + }); + return tr; + }); + }; + var syncColGroup = function (gridSection) { + return bind(gridSection, function (colGroup) { + return map(colGroup.cells, function (col) { + setIfNot(col.element, 'span', col.colspan, 1); + return col.element; + }); + }); + }; + var renderSection = function (gridSection, sectionName) { + var section = generateSection(table, sectionName); + var sync = sectionName === 'colgroup' ? syncColGroup : syncRows; + var sectionElems = sync(gridSection); + append$1(section, sectionElems); + }; + var removeSection = function (sectionName) { + child$2(table, sectionName).each(remove$2); + }; + var renderOrRemoveSection = function (gridSection, sectionName) { + if (gridSection.length > 0) { + renderSection(gridSection, sectionName); + } else { + removeSection(sectionName); + } + }; + var headSection = []; + var bodySection = []; + var footSection = []; + var columnGroupsSection = []; + each(grid, function (row) { + switch (row.section) { + case 'thead': + headSection.push(row); + break; + case 'tbody': + bodySection.push(row); + break; + case 'tfoot': + footSection.push(row); + break; + case 'colgroup': + columnGroupsSection.push(row); + break; + } + }); + renderOrRemoveSection(columnGroupsSection, 'colgroup'); + renderOrRemoveSection(headSection, 'thead'); + renderOrRemoveSection(bodySection, 'tbody'); + renderOrRemoveSection(footSection, 'tfoot'); + return { + newRows: newRows, + newCells: newCells + }; }; var copy$2 = function (grid) { - return map(grid, function (row) { - var tr = shallow(row.element); - each(row.cells, function (cell) { - var clonedCell = deep(cell.element); - setIfNot(clonedCell, 'colspan', cell.colspan, 1); - setIfNot(clonedCell, 'rowspan', cell.rowspan, 1); - append(tr, clonedCell); - }); - return tr; + return map(grid, function (row) { + var tr = shallow(row.element); + each(row.cells, function (cell) { + var clonedCell = deep(cell.element); + setIfNot(clonedCell, 'colspan', cell.colspan, 1); + setIfNot(clonedCell, 'rowspan', cell.rowspan, 1); + append(tr, clonedCell); }); + return tr; + }); }; var getColumn = function (grid, index) { - return map(grid, function (row) { - return getCell(row, index); - }); + return map(grid, function (row) { + return getCell(row, index); + }); }; var getRow = function (grid, index) { - return grid[index]; + return grid[index]; }; var findDiff = function (xs, comp) { - if (xs.length === 0) { - return 0; - } - var first = xs[0]; - var index = findIndex(xs, function (x) { - return !comp(first.element, x.element); - }); - return index.fold(function () { - return xs.length; - }, function (ind) { - return ind; - }); + if (xs.length === 0) { + return 0; + } + var first = xs[0]; + var index = findIndex(xs, function (x) { + return !comp(first.element, x.element); + }); + return index.fold(function () { + return xs.length; + }, function (ind) { + return ind; + }); }; var subgrid = function (grid, row, column, comparator) { - var restOfRow = getRow(grid, row).cells.slice(column); - var endColIndex = findDiff(restOfRow, comparator); - var restOfColumn = getColumn(grid, column).slice(row); - var endRowIndex = findDiff(restOfColumn, comparator); - return { - colspan: endColIndex, - rowspan: endRowIndex - }; + var restOfRow = getRow(grid, row).cells.slice(column); + var endColIndex = findDiff(restOfRow, comparator); + var restOfColumn = getColumn(grid, column).slice(row); + var endRowIndex = findDiff(restOfColumn, comparator); + return { + colspan: endColIndex, + rowspan: endRowIndex + }; }; var toDetails = function (grid, comparator) { - var seen = map(grid, function (row) { - return map(row.cells, never); - }); - var updateSeen = function (rowIndex, columnIndex, rowspan, colspan) { - for (var row = rowIndex; row < rowIndex + rowspan; row++) { - for (var column = columnIndex; column < columnIndex + colspan; column++) { - seen[row][column] = true; - } - } - }; - return map(grid, function (row, rowIndex) { - var details = bind(row.cells, function (cell, columnIndex) { - if (seen[rowIndex][columnIndex] === false) { - var result = subgrid(grid, rowIndex, columnIndex, comparator); - updateSeen(rowIndex, columnIndex, result.rowspan, result.colspan); - return [detailnew(cell.element, result.rowspan, result.colspan, cell.isNew)]; - } else { - return []; - } - }); - return rowdetails(details, row.section); + var seen = map(grid, function (row) { + return map(row.cells, never); + }); + var updateSeen = function (rowIndex, columnIndex, rowspan, colspan) { + for (var row = rowIndex; row < rowIndex + rowspan; row++) { + for (var column = columnIndex; column < columnIndex + colspan; column++) { + seen[row][column] = true; + } + } + }; + return map(grid, function (row, rowIndex) { + var details = bind(row.cells, function (cell, columnIndex) { + if (seen[rowIndex][columnIndex] === false) { + var result = subgrid(grid, rowIndex, columnIndex, comparator); + updateSeen(rowIndex, columnIndex, result.rowspan, result.colspan); + return [detailnew(cell.element, result.rowspan, result.colspan, cell.isNew)]; + } else { + return []; + } }); + return rowdetails(details, row.section); + }); }; var toGrid = function (warehouse, generators, isNew) { - var grid = []; - if (Warehouse.hasColumns(warehouse)) { - var groupElementNew = map(Warehouse.justColumns(warehouse), function (column) { - return elementnew(column.element, isNew); - }); - grid.push(rowcells(groupElementNew, 'colgroup')); - } - for (var rowIndex = 0; rowIndex < warehouse.grid.rows; rowIndex++) { - var rowCells = []; - for (var columnIndex = 0; columnIndex < warehouse.grid.columns; columnIndex++) { - var element = Warehouse.getAt(warehouse, rowIndex, columnIndex).map(function (item) { - return elementnew(item.element, isNew); - }).getOrThunk(function () { - return elementnew(generators.gap(), true); - }); - rowCells.push(element); - } - var row = rowcells(rowCells, warehouse.all[rowIndex].section); - grid.push(row); - } - return grid; + var grid = []; + if (Warehouse.hasColumns(warehouse)) { + var groupElementNew = map(Warehouse.justColumns(warehouse), function (column) { + return elementnew(column.element, isNew); + }); + grid.push(rowcells(groupElementNew, 'colgroup')); + } + for (var rowIndex = 0; rowIndex < warehouse.grid.rows; rowIndex++) { + var rowCells = []; + for (var columnIndex = 0; columnIndex < warehouse.grid.columns; columnIndex++) { + var element = Warehouse.getAt(warehouse, rowIndex, columnIndex).map(function (item) { + return elementnew(item.element, isNew); + }).getOrThunk(function () { + return elementnew(generators.gap(), true); + }); + rowCells.push(element); + } + var row = rowcells(rowCells, warehouse.all[rowIndex].section); + grid.push(row); + } + return grid; }; var fromWarehouse = function (warehouse, generators) { - return toGrid(warehouse, generators, false); + return toGrid(warehouse, generators, false); }; var deriveRows = function (rendered, generators) { - var findRow = function (details) { - var rowOfCells = findMap(details, function (detail) { - return parent(detail.element).map(function (row) { - var isNew = parent(row).isNone(); - return elementnew(row, isNew); - }); - }); - return rowOfCells.getOrThunk(function () { - return elementnew(generators.row(), true); - }); - }; - return map(rendered, function (details) { - var row = findRow(details.details); - return rowdatanew(row.element, details.details, details.section, row.isNew); - }); + var findRow = function (details) { + var rowOfCells = findMap(details, function (detail) { + return parent(detail.element).map(function (row) { + var isNew = parent(row).isNone(); + return elementnew(row, isNew); + }); + }); + return rowOfCells.getOrThunk(function () { + return elementnew(generators.row(), true); + }); + }; + return map(rendered, function (details) { + var row = findRow(details.details); + return rowdatanew(row.element, details.details, details.section, row.isNew); + }); }; var toDetailList = function (grid, generators) { - var rendered = toDetails(grid, eq$1); - return deriveRows(rendered, generators); + var rendered = toDetails(grid, eq$1); + return deriveRows(rendered, generators); }; var findInWarehouse = function (warehouse, element) { - return findMap(warehouse.all, function (r) { - return find(r.cells, function (e) { - return eq$1(element, e.element); - }); + return findMap(warehouse.all, function (r) { + return find(r.cells, function (e) { + return eq$1(element, e.element); }); + }); }; var run = function (operation, extract, adjustment, postAction, genWrappers) { - return function (wire, table, target, generators, sizing) { - var warehouse = Warehouse.fromTable(table); - var output = extract(warehouse, target).map(function (info) { - var model = fromWarehouse(warehouse, generators); - var result = operation(model, info, eq$1, genWrappers(generators)); - var grid = toDetailList(result.grid, generators); - return { - grid: grid, - cursor: result.cursor - }; - }); - return output.fold(function () { - return Optional.none(); - }, function (out) { - var newElements = render(table, out.grid); - var tableSizing = Optional.from(sizing).getOrThunk(function () { - return TableSize.getTableSize(table); - }); - adjustment(table, out.grid, tableSizing); - postAction(table); - refresh(wire, table); - return Optional.some({ - cursor: out.cursor, - newRows: newElements.newRows, - newCells: newElements.newCells - }); - }); - }; + return function (wire, table, target, generators, sizing) { + var warehouse = Warehouse.fromTable(table); + var output = extract(warehouse, target).map(function (info) { + var model = fromWarehouse(warehouse, generators); + var result = operation(model, info, eq$1, genWrappers(generators)); + var grid = toDetailList(result.grid, generators); + return { + grid: grid, + cursor: result.cursor + }; + }); + return output.fold(function () { + return Optional.none(); + }, function (out) { + var newElements = render(table, out.grid); + var tableSizing = Optional.from(sizing).getOrThunk(function () { + return TableSize.getTableSize(table); + }); + adjustment(table, out.grid, tableSizing); + postAction(table); + refresh(wire, table); + return Optional.some({ + cursor: out.cursor, + newRows: newElements.newRows, + newCells: newElements.newCells + }); + }); + }; }; var onCell = function (warehouse, target) { - return cell(target.element).bind(function (cell) { - return findInWarehouse(warehouse, cell); - }); + return cell(target.element).bind(function (cell) { + return findInWarehouse(warehouse, cell); + }); }; var onPaste = function (warehouse, target) { - return cell(target.element).bind(function (cell) { - return findInWarehouse(warehouse, cell).map(function (details) { - var value = __assign(__assign({}, details), { - generators: target.generators, - clipboard: target.clipboard - }); - return value; - }); + return cell(target.element).bind(function (cell) { + return findInWarehouse(warehouse, cell).map(function (details) { + var value = __assign(__assign({}, details), { + generators: target.generators, + clipboard: target.clipboard + }); + return value; }); + }); }; var onPasteByEditor = function (warehouse, target) { - var details = map(target.selection, function (cell$1) { - return cell(cell$1).bind(function (lc) { - return findInWarehouse(warehouse, lc); - }); - }); - var cells = cat(details); - return cells.length > 0 ? Optional.some({ - cells: cells, - generators: target.generators, - clipboard: target.clipboard - }) : Optional.none(); + var details = map(target.selection, function (cell$1) { + return cell(cell$1).bind(function (lc) { + return findInWarehouse(warehouse, lc); + }); + }); + var cells = cat(details); + return cells.length > 0 ? Optional.some({ + cells: cells, + generators: target.generators, + clipboard: target.clipboard + }) : Optional.none(); }; var onMergable = function (_warehouse, target) { - return target.mergable; + return target.mergable; }; var onUnmergable = function (_warehouse, target) { - return target.unmergable; + return target.unmergable; }; var onCells = function (warehouse, target) { - var details = map(target.selection, function (cell$1) { - return cell(cell$1).bind(function (lc) { - return findInWarehouse(warehouse, lc); - }); + var details = map(target.selection, function (cell$1) { + return cell(cell$1).bind(function (lc) { + return findInWarehouse(warehouse, lc); }); - var cells = cat(details); - return cells.length > 0 ? Optional.some(cells) : Optional.none(); + }); + var cells = cat(details); + return cells.length > 0 ? Optional.some(cells) : Optional.none(); }; var merge = function (grid, bounds, comparator, substitution) { - var rows = extractGridDetails(grid).rows; - if (rows.length === 0) { - return grid; - } - for (var i = bounds.startRow; i <= bounds.finishRow; i++) { - for (var j = bounds.startCol; j <= bounds.finishCol; j++) { - mutateCell(rows[i], j, elementnew(substitution(), false)); - } - } + var rows = extractGridDetails(grid).rows; + if (rows.length === 0) { return grid; + } + for (var i = bounds.startRow; i <= bounds.finishRow; i++) { + for (var j = bounds.startCol; j <= bounds.finishCol; j++) { + mutateCell(rows[i], j, elementnew(substitution(), false)); + } + } + return grid; }; var unmerge = function (grid, target, comparator, substitution) { - var rows = extractGridDetails(grid).rows; - var first = true; - for (var i = 0; i < rows.length; i++) { - for (var j = 0; j < cellLength(rows[0]); j++) { - var current = getCellElement(rows[i], j); - var isToReplace = comparator(current, target); - if (isToReplace === true && first === false) { - mutateCell(rows[i], j, elementnew(substitution(), true)); - } else if (isToReplace === true) { - first = false; - } - } - } - return grid; + var rows = extractGridDetails(grid).rows; + var first = true; + for (var i = 0; i < rows.length; i++) { + for (var j = 0; j < cellLength(rows[0]); j++) { + var current = getCellElement(rows[i], j); + var isToReplace = comparator(current, target); + if (isToReplace === true && first === false) { + mutateCell(rows[i], j, elementnew(substitution(), true)); + } else if (isToReplace === true) { + first = false; + } + } + } + return grid; }; var uniqueCells = function (row, comparator) { - return foldl(row, function (rest, cell) { - return exists(rest, function (currentCell) { - return comparator(currentCell.element, cell.element); - }) ? rest : rest.concat([cell]); - }, []); + return foldl(row, function (rest, cell) { + return exists(rest, function (currentCell) { + return comparator(currentCell.element, cell.element); + }) ? rest : rest.concat([cell]); + }, []); }; var splitCols = function (grid, index, comparator, substitution) { - if (index > 0 && index < grid[0].cells.length) { - each(grid, function (row) { - var prevCell = row.cells[index - 1]; - var current = row.cells[index]; - var isToReplace = comparator(current.element, prevCell.element); - if (isToReplace) { - mutateCell(row, index, elementnew(substitution(), true)); - } - }); - } - return grid; + if (index > 0 && index < grid[0].cells.length) { + each(grid, function (row) { + var prevCell = row.cells[index - 1]; + var current = row.cells[index]; + var isToReplace = comparator(current.element, prevCell.element); + if (isToReplace) { + mutateCell(row, index, elementnew(substitution(), true)); + } + }); + } + return grid; }; var splitRows = function (grid, index, comparator, substitution) { - var rows = extractGridDetails(grid).rows; - if (index > 0 && index < rows.length) { - var rowPrevCells = rows[index - 1].cells; - var cells = uniqueCells(rowPrevCells, comparator); - each(cells, function (cell) { - var replacement = Optional.none(); - var _loop_1 = function (i) { - var _loop_2 = function (j) { - var current = rows[i].cells[j]; - var isToReplace = comparator(current.element, cell.element); - if (isToReplace) { - if (replacement.isNone()) { - replacement = Optional.some(substitution()); - } - replacement.each(function (sub) { - mutateCell(rows[i], j, elementnew(sub, true)); - }); - } - }; - for (var j = 0; j < cellLength(rows[0]); j++) { - _loop_2(j); - } - }; - for (var i = index; i < rows.length; i++) { - _loop_1(i); + var rows = extractGridDetails(grid).rows; + if (index > 0 && index < rows.length) { + var rowPrevCells = rows[index - 1].cells; + var cells = uniqueCells(rowPrevCells, comparator); + each(cells, function (cell) { + var replacement = Optional.none(); + var _loop_1 = function (i) { + var _loop_2 = function (j) { + var current = rows[i].cells[j]; + var isToReplace = comparator(current.element, cell.element); + if (isToReplace) { + if (replacement.isNone()) { + replacement = Optional.some(substitution()); } - }); - } - return grid; + replacement.each(function (sub) { + mutateCell(rows[i], j, elementnew(sub, true)); + }); + } + }; + for (var j = 0; j < cellLength(rows[0]); j++) { + _loop_2(j); + } + }; + for (var i = index; i < rows.length; i++) { + _loop_1(i); + } + }); + } + return grid; }; var value = function (o) { - var is = function (v) { - return o === v; - }; - var or = function (_opt) { - return value(o); - }; - var orThunk = function (_f) { - return value(o); - }; - var map = function (f) { - return value(f(o)); - }; - var mapError = function (_f) { - return value(o); - }; - var each = function (f) { - f(o); - }; - var bind = function (f) { - return f(o); - }; - var fold = function (_, onValue) { - return onValue(o); - }; - var exists = function (f) { - return f(o); - }; - var forall = function (f) { - return f(o); - }; - var toOptional = function () { - return Optional.some(o); - }; - return { - is: is, - isValue: always, - isError: never, - getOr: constant(o), - getOrThunk: constant(o), - getOrDie: constant(o), - or: or, - orThunk: orThunk, - fold: fold, - map: map, - mapError: mapError, - each: each, - bind: bind, - exists: exists, - forall: forall, - toOptional: toOptional - }; + var is = function (v) { + return o === v; + }; + var or = function (_opt) { + return value(o); + }; + var orThunk = function (_f) { + return value(o); + }; + var map = function (f) { + return value(f(o)); + }; + var mapError = function (_f) { + return value(o); + }; + var each = function (f) { + f(o); + }; + var bind = function (f) { + return f(o); + }; + var fold = function (_, onValue) { + return onValue(o); + }; + var exists = function (f) { + return f(o); + }; + var forall = function (f) { + return f(o); + }; + var toOptional = function () { + return Optional.some(o); + }; + return { + is: is, + isValue: always, + isError: never, + getOr: constant(o), + getOrThunk: constant(o), + getOrDie: constant(o), + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: each, + bind: bind, + exists: exists, + forall: forall, + toOptional: toOptional + }; }; var error = function (message) { - var getOrThunk = function (f) { - return f(); - }; - var getOrDie = function () { - return die(String(message))(); - }; - var or = function (opt) { - return opt; - }; - var orThunk = function (f) { - return f(); - }; - var map = function (_f) { - return error(message); - }; - var mapError = function (f) { - return error(f(message)); - }; - var bind = function (_f) { - return error(message); - }; - var fold = function (onError, _) { - return onError(message); - }; - return { - is: never, - isValue: never, - isError: always, - getOr: identity, - getOrThunk: getOrThunk, - getOrDie: getOrDie, - or: or, - orThunk: orThunk, - fold: fold, - map: map, - mapError: mapError, - each: noop, - bind: bind, - exists: never, - forall: always, - toOptional: Optional.none - }; + var getOrThunk = function (f) { + return f(); + }; + var getOrDie = function () { + return die(String(message))(); + }; + var or = function (opt) { + return opt; + }; + var orThunk = function (f) { + return f(); + }; + var map = function (_f) { + return error(message); + }; + var mapError = function (f) { + return error(f(message)); + }; + var bind = function (_f) { + return error(message); + }; + var fold = function (onError, _) { + return onError(message); + }; + return { + is: never, + isValue: never, + isError: always, + getOr: identity, + getOrThunk: getOrThunk, + getOrDie: getOrDie, + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: noop, + bind: bind, + exists: never, + forall: always, + toOptional: Optional.none + }; }; var fromOption = function (opt, err) { - return opt.fold(function () { - return error(err); - }, value); + return opt.fold(function () { + return error(err); + }, value); }; var Result = { - value: value, - error: error, - fromOption: fromOption + value: value, + error: error, + fromOption: fromOption }; var measure = function (startAddress, gridA, gridB) { - if (startAddress.row >= gridA.length || startAddress.column > cellLength(gridA[0])) { - return Result.error('invalid start address out of table bounds, row: ' + startAddress.row + ', column: ' + startAddress.column); - } - var rowRemainder = gridA.slice(startAddress.row); - var colRemainder = rowRemainder[0].cells.slice(startAddress.column); - var colRequired = cellLength(gridB[0]); - var rowRequired = gridB.length; - return Result.value({ - rowDelta: rowRemainder.length - rowRequired, - colDelta: colRemainder.length - colRequired - }); + if (startAddress.row >= gridA.length || startAddress.column > cellLength(gridA[0])) { + return Result.error('invalid start address out of table bounds, row: ' + startAddress.row + ', column: ' + startAddress.column); + } + var rowRemainder = gridA.slice(startAddress.row); + var colRemainder = rowRemainder[0].cells.slice(startAddress.column); + var colRequired = cellLength(gridB[0]); + var rowRequired = gridB.length; + return Result.value({ + rowDelta: rowRemainder.length - rowRequired, + colDelta: colRemainder.length - colRequired + }); }; var measureWidth = function (gridA, gridB) { - var colLengthA = cellLength(gridA[0]); - var colLengthB = cellLength(gridB[0]); - return { - rowDelta: 0, - colDelta: colLengthA - colLengthB - }; + var colLengthA = cellLength(gridA[0]); + var colLengthB = cellLength(gridB[0]); + return { + rowDelta: 0, + colDelta: colLengthA - colLengthB + }; }; var measureHeight = function (gridA, gridB) { - var rowLengthA = gridA.length; - var rowLengthB = gridB.length; - return { - rowDelta: rowLengthA - rowLengthB, - colDelta: 0 - }; + var rowLengthA = gridA.length; + var rowLengthB = gridB.length; + return { + rowDelta: rowLengthA - rowLengthB, + colDelta: 0 + }; }; var generateElements = function (cells, row, generators) { - var getGenerator = row.section === 'colgroup' ? generators.col : generators.cell; - return map(cells, function () { - return elementnew(getGenerator(), true); - }); + var getGenerator = row.section === 'colgroup' ? generators.col : generators.cell; + return map(cells, function () { + return elementnew(getGenerator(), true); + }); }; var rowFill = function (grid, amount, generators) { - return grid.concat(range(amount, function () { - var row = grid[grid.length - 1]; - return setCells(row, generateElements(row.cells, row, generators)); - })); + return grid.concat(range(amount, function () { + var row = grid[grid.length - 1]; + return setCells(row, generateElements(row.cells, row, generators)); + })); }; var colFill = function (grid, amount, generators) { - return map(grid, function (row) { - var newChildren = generateElements(range(amount, identity), row, generators); - return setCells(row, row.cells.concat(newChildren)); - }); + return map(grid, function (row) { + var newChildren = generateElements(range(amount, identity), row, generators); + return setCells(row, row.cells.concat(newChildren)); + }); }; var tailor = function (gridA, delta, generators) { - var fillCols = delta.colDelta < 0 ? colFill : identity; - var fillRows = delta.rowDelta < 0 ? rowFill : identity; - var modifiedCols = fillCols(gridA, Math.abs(delta.colDelta), generators); - return fillRows(modifiedCols, Math.abs(delta.rowDelta), generators); + var fillCols = delta.colDelta < 0 ? colFill : identity; + var fillRows = delta.rowDelta < 0 ? rowFill : identity; + var modifiedCols = fillCols(gridA, Math.abs(delta.colDelta), generators); + return fillRows(modifiedCols, Math.abs(delta.rowDelta), generators); }; var isSpanning = function (grid, row, col, comparator) { - var candidate = getCell(grid[row], col); - var matching = curry(comparator, candidate.element); - var currentRow = grid[row]; - return grid.length > 1 && cellLength(currentRow) > 1 && (col > 0 && matching(getCellElement(currentRow, col - 1)) || col < currentRow.cells.length - 1 && matching(getCellElement(currentRow, col + 1)) || row > 0 && matching(getCellElement(grid[row - 1], col)) || row < grid.length - 1 && matching(getCellElement(grid[row + 1], col))); + var candidate = getCell(grid[row], col); + var matching = curry(comparator, candidate.element); + var currentRow = grid[row]; + return grid.length > 1 && cellLength(currentRow) > 1 && (col > 0 && matching(getCellElement(currentRow, col - 1)) || col < currentRow.cells.length - 1 && matching(getCellElement(currentRow, col + 1)) || row > 0 && matching(getCellElement(grid[row - 1], col)) || row < grid.length - 1 && matching(getCellElement(grid[row + 1], col))); }; var mergeTables = function (startAddress, gridA, gridB, generator, comparator) { - var startRow = startAddress.row; - var startCol = startAddress.column; - var mergeHeight = gridB.length; - var mergeWidth = cellLength(gridB[0]); - var endRow = startRow + mergeHeight; - var endCol = startCol + mergeWidth; - for (var r = startRow; r < endRow; r++) { - for (var c = startCol; c < endCol; c++) { - if (isSpanning(gridA, r, c, comparator)) { - unmerge(gridA, getCellElement(gridA[r], c), comparator, generator.cell); - } - var newCell = getCellElement(gridB[r - startRow], c - startCol); - var replacement = generator.replace(newCell); - mutateCell(gridA[r], c, elementnew(replacement, true)); - } - } - return gridA; + var startRow = startAddress.row; + var startCol = startAddress.column; + var mergeHeight = gridB.length; + var mergeWidth = cellLength(gridB[0]); + var endRow = startRow + mergeHeight; + var endCol = startCol + mergeWidth; + for (var r = startRow; r < endRow; r++) { + for (var c = startCol; c < endCol; c++) { + if (isSpanning(gridA, r, c, comparator)) { + unmerge(gridA, getCellElement(gridA[r], c), comparator, generator.cell); + } + var newCell = getCellElement(gridB[r - startRow], c - startCol); + var replacement = generator.replace(newCell); + mutateCell(gridA[r], c, elementnew(replacement, true)); + } + } + return gridA; }; var merge$1 = function (startAddress, gridA, gridB, generator, comparator) { - var result = measure(startAddress, gridA, gridB); - return result.map(function (delta) { - var fittedGrid = tailor(gridA, delta, generator); - return mergeTables(startAddress, fittedGrid, gridB, generator, comparator); - }); + var result = measure(startAddress, gridA, gridB); + return result.map(function (delta) { + var fittedGrid = tailor(gridA, delta, generator); + return mergeTables(startAddress, fittedGrid, gridB, generator, comparator); + }); }; var insertCols = function (index, gridA, gridB, generator, comparator) { - splitCols(gridA, index, comparator, generator.cell); - var delta = measureHeight(gridB, gridA); - var fittedNewGrid = tailor(gridB, delta, generator); - var secondDelta = measureHeight(gridA, fittedNewGrid); - var fittedOldGrid = tailor(gridA, secondDelta, generator); - return map(fittedOldGrid, function (gridRow, i) { - var newCells = gridRow.cells.slice(0, index).concat(fittedNewGrid[i].cells).concat(gridRow.cells.slice(index, gridRow.cells.length)); - return setCells(gridRow, newCells); - }); + splitCols(gridA, index, comparator, generator.cell); + var delta = measureHeight(gridB, gridA); + var fittedNewGrid = tailor(gridB, delta, generator); + var secondDelta = measureHeight(gridA, fittedNewGrid); + var fittedOldGrid = tailor(gridA, secondDelta, generator); + return map(fittedOldGrid, function (gridRow, i) { + var newCells = gridRow.cells.slice(0, index).concat(fittedNewGrid[i].cells).concat(gridRow.cells.slice(index, gridRow.cells.length)); + return setCells(gridRow, newCells); + }); }; var insertRows = function (index, gridA, gridB, generator, comparator) { - splitRows(gridA, index, comparator, generator.cell); - var delta = measureWidth(gridB, gridA); - var fittedNewGrid = tailor(gridB, delta, generator); - var secondDelta = measureWidth(gridA, fittedNewGrid); - var fittedOldGrid = tailor(gridA, secondDelta, generator); - var _a = extractGridDetails(fittedOldGrid), oldCols = _a.cols, oldRows = _a.rows; - return oldCols.concat(oldRows.slice(0, index)).concat(fittedNewGrid).concat(oldRows.slice(index, oldRows.length)); + splitRows(gridA, index, comparator, generator.cell); + var delta = measureWidth(gridB, gridA); + var fittedNewGrid = tailor(gridB, delta, generator); + var secondDelta = measureWidth(gridA, fittedNewGrid); + var fittedOldGrid = tailor(gridA, secondDelta, generator); + var _a = extractGridDetails(fittedOldGrid), oldCols = _a.cols, oldRows = _a.rows; + return oldCols.concat(oldRows.slice(0, index)).concat(fittedNewGrid).concat(oldRows.slice(index, oldRows.length)); }; var insertRowAt = function (grid, index, example, comparator, substitution) { - var _a = extractGridDetails(grid), rows = _a.rows, cols = _a.cols; - var before = rows.slice(0, index); - var after = rows.slice(index); - var between = mapCells(rows[example], function (ex, c) { - var withinSpan = index > 0 && index < rows.length && comparator(getCellElement(rows[index - 1], c), getCellElement(rows[index], c)); - var ret = withinSpan ? getCell(rows[index], c) : elementnew(substitution(ex.element, comparator), true); - return ret; - }); - return cols.concat(before).concat([between]).concat(after); + var _a = extractGridDetails(grid), rows = _a.rows, cols = _a.cols; + var before = rows.slice(0, index); + var after = rows.slice(index); + var between = mapCells(rows[example], function (ex, c) { + var withinSpan = index > 0 && index < rows.length && comparator(getCellElement(rows[index - 1], c), getCellElement(rows[index], c)); + var ret = withinSpan ? getCell(rows[index], c) : elementnew(substitution(ex.element, comparator), true); + return ret; + }); + return cols.concat(before).concat([between]).concat(after); }; var getElementFor = function (row, column, section, withinSpan, example, comparator, substitution) { - if (section === 'colgroup' || !withinSpan) { - return elementnew(substitution(getCellElement(row, example), comparator), true); - } else { - return getCell(row, column); - } + if (section === 'colgroup' || !withinSpan) { + return elementnew(substitution(getCellElement(row, example), comparator), true); + } else { + return getCell(row, column); + } }; var insertColumnAt = function (grid, index, example, comparator, substitution) { - return map(grid, function (row) { - var withinSpan = index > 0 && index < cellLength(row) && comparator(getCellElement(row, index - 1), getCellElement(row, index)); - var sub = getElementFor(row, index, row.section, withinSpan, example, comparator, substitution); - return addCell(row, index, sub); - }); + return map(grid, function (row) { + var withinSpan = index > 0 && index < cellLength(row) && comparator(getCellElement(row, index - 1), getCellElement(row, index)); + var sub = getElementFor(row, index, row.section, withinSpan, example, comparator, substitution); + return addCell(row, index, sub); + }); }; var deleteColumnsAt = function (grid, start, finish) { - var rows = map(grid, function (row) { - var cells = row.cells.slice(0, start).concat(row.cells.slice(finish + 1)); - return rowcells(cells, row.section); - }); - return filter(rows, function (row) { - return row.cells.length > 0; - }); + var rows = map(grid, function (row) { + var cells = row.cells.slice(0, start).concat(row.cells.slice(finish + 1)); + return rowcells(cells, row.section); + }); + return filter(rows, function (row) { + return row.cells.length > 0; + }); }; var deleteRowsAt = function (grid, start, finish) { - var _a = extractGridDetails(grid), rows = _a.rows, cols = _a.cols; - return cols.concat(rows.slice(0, start)).concat(rows.slice(finish + 1)); + var _a = extractGridDetails(grid), rows = _a.rows, cols = _a.cols; + return cols.concat(rows.slice(0, start)).concat(rows.slice(finish + 1)); }; var replaceIn = function (grid, targets, comparator, substitution) { - var isTarget = function (cell) { - return exists(targets, function (target) { - return comparator(cell.element, target.element); - }); - }; - return map(grid, function (row) { - return mapCells(row, function (cell) { - return isTarget(cell) ? elementnew(substitution(cell.element, comparator), true) : cell; - }); + var isTarget = function (cell) { + return exists(targets, function (target) { + return comparator(cell.element, target.element); + }); + }; + return map(grid, function (row) { + return mapCells(row, function (cell) { + return isTarget(cell) ? elementnew(substitution(cell.element, comparator), true) : cell; }); + }); }; var notStartRow = function (grid, rowIndex, colIndex, comparator) { - return getCellElement(grid[rowIndex], colIndex) !== undefined && (rowIndex > 0 && comparator(getCellElement(grid[rowIndex - 1], colIndex), getCellElement(grid[rowIndex], colIndex))); + return getCellElement(grid[rowIndex], colIndex) !== undefined && (rowIndex > 0 && comparator(getCellElement(grid[rowIndex - 1], colIndex), getCellElement(grid[rowIndex], colIndex))); }; var notStartColumn = function (row, index, comparator) { - return index > 0 && comparator(getCellElement(row, index - 1), getCellElement(row, index)); + return index > 0 && comparator(getCellElement(row, index - 1), getCellElement(row, index)); }; var replaceColumn = function (grid, index, comparator, substitution) { - var targets = bind(grid, function (row, i) { - var alreadyAdded = notStartRow(grid, i, index, comparator) || notStartColumn(row, index, comparator); - return alreadyAdded ? [] : [getCell(row, index)]; - }); - return replaceIn(grid, targets, comparator, substitution); + var targets = bind(grid, function (row, i) { + var alreadyAdded = notStartRow(grid, i, index, comparator) || notStartColumn(row, index, comparator); + return alreadyAdded ? [] : [getCell(row, index)]; + }); + return replaceIn(grid, targets, comparator, substitution); }; var replaceRow = function (grid, index, comparator, substitution) { - var rows = extractGridDetails(grid).rows; - var targetRow = rows[index]; - var targets = bind(targetRow.cells, function (item, i) { - var alreadyAdded = notStartRow(rows, index, i, comparator) || notStartColumn(targetRow, i, comparator); - return alreadyAdded ? [] : [item]; - }); - return replaceIn(grid, targets, comparator, substitution); + var rows = extractGridDetails(grid).rows; + var targetRow = rows[index]; + var targets = bind(targetRow.cells, function (item, i) { + var alreadyAdded = notStartRow(rows, index, i, comparator) || notStartColumn(targetRow, i, comparator); + return alreadyAdded ? [] : [item]; + }); + return replaceIn(grid, targets, comparator, substitution); }; var verifyGenerators = exactly([ - 'cell', - 'row', - 'replace', - 'gap', - 'col', - 'colgroup' + 'cell', + 'row', + 'replace', + 'gap', + 'col', + 'colgroup' ]); var elementToData = function (element) { - var colspan = getAttrValue(element, 'colspan', 1); - var rowspan = getAttrValue(element, 'rowspan', 1); - return { - element: element, - colspan: colspan, - rowspan: rowspan - }; + var colspan = getAttrValue(element, 'colspan', 1); + var rowspan = getAttrValue(element, 'rowspan', 1); + return { + element: element, + colspan: colspan, + rowspan: rowspan + }; }; var modification = function (generators, toData) { - if (toData === void 0) { - toData = elementToData; - } - verifyGenerators(generators); - var position = Cell(Optional.none()); - var nu = function (data) { - switch (name(data.element)) { - case 'col': - return generators.col(data); - default: - return generators.cell(data); - } - }; - var nuFrom = function (element) { - var data = toData(element); - return nu(data); - }; - var add = function (element) { - var replacement = nuFrom(element); - if (position.get().isNone()) { - position.set(Optional.some(replacement)); - } - recent = Optional.some({ - item: element, - replacement: replacement - }); - return replacement; - }; - var recent = Optional.none(); - var getOrInit = function (element, comparator) { - return recent.fold(function () { - return add(element); - }, function (p) { - return comparator(element, p.item) ? p.replacement : add(element); - }); - }; - return { - getOrInit: getOrInit, - cursor: position.get - }; + if (toData === void 0) { + toData = elementToData; + } + verifyGenerators(generators); + var position = Cell(Optional.none()); + var nu = function (data) { + switch (name(data.element)) { + case 'col': + return generators.col(data); + default: + return generators.cell(data); + } + }; + var nuFrom = function (element) { + var data = toData(element); + return nu(data); + }; + var add = function (element) { + var replacement = nuFrom(element); + if (position.get().isNone()) { + position.set(Optional.some(replacement)); + } + recent = Optional.some({ + item: element, + replacement: replacement + }); + return replacement; + }; + var recent = Optional.none(); + var getOrInit = function (element, comparator) { + return recent.fold(function () { + return add(element); + }, function (p) { + return comparator(element, p.item) ? p.replacement : add(element); + }); + }; + return { + getOrInit: getOrInit, + cursor: position.get + }; }; var transform$1 = function (scope, tag) { - return function (generators) { - var position = Cell(Optional.none()); - verifyGenerators(generators); - var list = []; - var find$1 = function (element, comparator) { - return find(list, function (x) { - return comparator(x.item, element); - }); - }; - var makeNew = function (element) { - var attrs = {scope: scope}; - var cell = generators.replace(element, tag, attrs); - list.push({ - item: element, - sub: cell - }); - if (position.get().isNone()) { - position.set(Optional.some(cell)); - } - return cell; - }; - var replaceOrInit = function (element, comparator) { - return find$1(element, comparator).fold(function () { - return makeNew(element); - }, function (p) { - return comparator(element, p.item) ? p.sub : makeNew(element); - }); - }; - return { - replaceOrInit: replaceOrInit, - cursor: position.get - }; - }; - }; - var merging = function (generators) { - verifyGenerators(generators); + return function (generators) { var position = Cell(Optional.none()); - var combine = function (cell) { - if (position.get().isNone()) { - position.set(Optional.some(cell)); - } - return function () { - var raw = generators.cell({ - element: cell, - colspan: 1, - rowspan: 1 - }); - remove$1(raw, 'width'); - remove$1(cell, 'width'); - return raw; - }; + verifyGenerators(generators); + var list = []; + var find$1 = function (element, comparator) { + return find(list, function (x) { + return comparator(x.item, element); + }); + }; + var makeNew = function (element) { + var attrs = { scope: scope }; + var cell = generators.replace(element, tag, attrs); + list.push({ + item: element, + sub: cell + }); + if (position.get().isNone()) { + position.set(Optional.some(cell)); + } + return cell; + }; + var replaceOrInit = function (element, comparator) { + return find$1(element, comparator).fold(function () { + return makeNew(element); + }, function (p) { + return comparator(element, p.item) ? p.sub : makeNew(element); + }); }; return { - combine: combine, - cursor: position.get + replaceOrInit: replaceOrInit, + cursor: position.get }; + }; + }; + var merging = function (generators) { + verifyGenerators(generators); + var position = Cell(Optional.none()); + var combine = function (cell) { + if (position.get().isNone()) { + position.set(Optional.some(cell)); + } + return function () { + var raw = generators.cell({ + element: cell, + colspan: 1, + rowspan: 1 + }); + remove$1(raw, 'width'); + remove$1(cell, 'width'); + return raw; + }; + }; + return { + combine: combine, + cursor: position.get + }; }; var Generators = { - modification: modification, - transform: transform$1, - merging: merging + modification: modification, + transform: transform$1, + merging: merging }; var blockList = [ - 'body', - 'p', - 'div', - 'article', - 'aside', - 'figcaption', - 'figure', - 'footer', - 'header', - 'nav', - 'section', - 'ol', - 'ul', - 'table', - 'thead', - 'tfoot', - 'tbody', - 'caption', - 'tr', - 'td', - 'th', - 'h1', - 'h2', - 'h3', - 'h4', - 'h5', - 'h6', - 'blockquote', - 'pre', - 'address' + 'body', + 'p', + 'div', + 'article', + 'aside', + 'figcaption', + 'figure', + 'footer', + 'header', + 'nav', + 'section', + 'ol', + 'ul', + 'table', + 'thead', + 'tfoot', + 'tbody', + 'caption', + 'tr', + 'td', + 'th', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'blockquote', + 'pre', + 'address' ]; var isList = function (universe, item) { - var tagName = universe.property().name(item); - return contains([ - 'ol', - 'ul' - ], tagName); + var tagName = universe.property().name(item); + return contains([ + 'ol', + 'ul' + ], tagName); }; var isBlock = function (universe, item) { - var tagName = universe.property().name(item); - return contains(blockList, tagName); + var tagName = universe.property().name(item); + return contains(blockList, tagName); }; var isEmptyTag = function (universe, item) { - return contains([ - 'br', - 'img', - 'hr', - 'input' - ], universe.property().name(item)); + return contains([ + 'br', + 'img', + 'hr', + 'input' + ], universe.property().name(item)); }; var universe$2 = DomUniverse(); var isBlock$1 = function (element) { - return isBlock(universe$2, element); + return isBlock(universe$2, element); }; var isList$1 = function (element) { - return isList(universe$2, element); + return isList(universe$2, element); }; var isEmptyTag$1 = function (element) { - return isEmptyTag(universe$2, element); + return isEmptyTag(universe$2, element); }; var merge$2 = function (cells) { - var isBr = function (el) { - return name(el) === 'br'; - }; - var advancedBr = function (children) { - return forall(children, function (c) { - return isBr(c) || isText(c) && get$4(c).trim().length === 0; - }); - }; - var isListItem = function (el) { - return name(el) === 'li' || ancestor(el, isList$1).isSome(); - }; - var siblingIsBlock = function (el) { - return nextSibling(el).map(function (rightSibling) { - if (isBlock$1(rightSibling)) { - return true; - } - if (isEmptyTag$1(rightSibling)) { - return name(rightSibling) === 'img' ? false : true; - } - return false; - }).getOr(false); - }; - var markCell = function (cell) { - return last$1(cell).bind(function (rightEdge) { - var rightSiblingIsBlock = siblingIsBlock(rightEdge); - return parent(rightEdge).map(function (parent) { - return rightSiblingIsBlock === true || isListItem(parent) || isBr(rightEdge) || isBlock$1(parent) && !eq$1(cell, parent) ? [] : [SugarElement.fromTag('br')]; - }); - }).getOr([]); - }; - var markContent = function () { - var content = bind(cells, function (cell) { - var children$1 = children(cell); - return advancedBr(children$1) ? [] : children$1.concat(markCell(cell)); - }); - return content.length === 0 ? [SugarElement.fromTag('br')] : content; - }; - var contents = markContent(); - empty(cells[0]); - append$1(cells[0], contents); + var isBr = function (el) { + return name(el) === 'br'; + }; + var advancedBr = function (children) { + return forall(children, function (c) { + return isBr(c) || isText(c) && get$4(c).trim().length === 0; + }); + }; + var isListItem = function (el) { + return name(el) === 'li' || ancestor(el, isList$1).isSome(); + }; + var siblingIsBlock = function (el) { + return nextSibling(el).map(function (rightSibling) { + if (isBlock$1(rightSibling)) { + return true; + } + if (isEmptyTag$1(rightSibling)) { + return name(rightSibling) === 'img' ? false : true; + } + return false; + }).getOr(false); + }; + var markCell = function (cell) { + return last$1(cell).bind(function (rightEdge) { + var rightSiblingIsBlock = siblingIsBlock(rightEdge); + return parent(rightEdge).map(function (parent) { + return rightSiblingIsBlock === true || isListItem(parent) || isBr(rightEdge) || isBlock$1(parent) && !eq$1(cell, parent) ? [] : [SugarElement.fromTag('br')]; + }); + }).getOr([]); + }; + var markContent = function () { + var content = bind(cells, function (cell) { + var children$1 = children(cell); + return advancedBr(children$1) ? [] : children$1.concat(markCell(cell)); + }); + return content.length === 0 ? [SugarElement.fromTag('br')] : content; + }; + var contents = markContent(); + empty(cells[0]); + append$1(cells[0], contents); }; var prune = function (table) { - var cells$1 = cells(table); - if (cells$1.length === 0) { - remove$2(table); - } + var cells$1 = cells(table); + if (cells$1.length === 0) { + remove$2(table); + } }; var outcome = function (grid, cursor) { - return { - grid: grid, - cursor: cursor - }; + return { + grid: grid, + cursor: cursor + }; }; var elementFromGrid = function (grid, row, column) { - var rows = extractGridDetails(grid).rows; - return findIn(rows, row, column).orThunk(function () { - return findIn(rows, 0, 0); - }); + var rows = extractGridDetails(grid).rows; + return findIn(rows, row, column).orThunk(function () { + return findIn(rows, 0, 0); + }); }; var findIn = function (grid, row, column) { - return Optional.from(grid[row]).bind(function (r) { - return Optional.from(r.cells[column]).bind(function (c) { - return Optional.from(c.element); - }); + return Optional.from(grid[row]).bind(function (r) { + return Optional.from(r.cells[column]).bind(function (c) { + return Optional.from(c.element); }); + }); }; var bundle = function (grid, row, column) { - var rows = extractGridDetails(grid).rows; - return outcome(grid, findIn(rows, row, column)); + var rows = extractGridDetails(grid).rows; + return outcome(grid, findIn(rows, row, column)); }; var uniqueRows = function (details) { - var rowCompilation = function (rest, detail) { - var rowExists = exists(rest, function (currentDetail) { - return currentDetail.row === detail.row; - }); - return rowExists ? rest : rest.concat([detail]); - }; - return foldl(details, rowCompilation, []).sort(function (detailA, detailB) { - return detailA.row - detailB.row; + var rowCompilation = function (rest, detail) { + var rowExists = exists(rest, function (currentDetail) { + return currentDetail.row === detail.row; }); + return rowExists ? rest : rest.concat([detail]); + }; + return foldl(details, rowCompilation, []).sort(function (detailA, detailB) { + return detailA.row - detailB.row; + }); }; var uniqueColumns = function (details) { - var uniqueCheck = function (rest, detail) { - var columnExists = exists(rest, function (currentDetail) { - return currentDetail.column === detail.column; - }); - return columnExists ? rest : rest.concat([detail]); - }; - return foldl(details, uniqueCheck, []).sort(function (detailA, detailB) { - return detailA.column - detailB.column; + var uniqueCheck = function (rest, detail) { + var columnExists = exists(rest, function (currentDetail) { + return currentDetail.column === detail.column; }); + return columnExists ? rest : rest.concat([detail]); + }; + return foldl(details, uniqueCheck, []).sort(function (detailA, detailB) { + return detailA.column - detailB.column; + }); }; var opInsertRowsBefore = function (grid, details, comparator, genWrappers) { - var example = details[0].row; - var targetIndex = details[0].row; - var rows = uniqueRows(details); - var newGrid = foldl(rows, function (newG, _row) { - return insertRowAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); - }, grid); - return bundle(newGrid, targetIndex, details[0].column); + var example = details[0].row; + var targetIndex = details[0].row; + var rows = uniqueRows(details); + var newGrid = foldl(rows, function (newG, _row) { + return insertRowAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); + }, grid); + return bundle(newGrid, targetIndex, details[0].column); }; var opInsertRowsAfter = function (grid, details, comparator, genWrappers) { - var rows = uniqueRows(details); - var example = rows[rows.length - 1].row; - var targetIndex = rows[rows.length - 1].row + rows[rows.length - 1].rowspan; - var newGrid = foldl(rows, function (newG, _row) { - return insertRowAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); - }, grid); - return bundle(newGrid, targetIndex, details[0].column); + var rows = uniqueRows(details); + var example = rows[rows.length - 1].row; + var targetIndex = rows[rows.length - 1].row + rows[rows.length - 1].rowspan; + var newGrid = foldl(rows, function (newG, _row) { + return insertRowAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); + }, grid); + return bundle(newGrid, targetIndex, details[0].column); }; var opInsertColumnsBefore = function (grid, details, comparator, genWrappers) { - var columns = uniqueColumns(details); - var example = columns[0].column; - var targetIndex = columns[0].column; - var newGrid = foldl(columns, function (newG, _row) { - return insertColumnAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); - }, grid); - return bundle(newGrid, details[0].row, targetIndex); + var columns = uniqueColumns(details); + var example = columns[0].column; + var targetIndex = columns[0].column; + var newGrid = foldl(columns, function (newG, _row) { + return insertColumnAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); + }, grid); + return bundle(newGrid, details[0].row, targetIndex); }; var opInsertColumnsAfter = function (grid, details, comparator, genWrappers) { - var example = details[details.length - 1].column; - var targetIndex = details[details.length - 1].column + details[details.length - 1].colspan; - var columns = uniqueColumns(details); - var newGrid = foldl(columns, function (newG, _row) { - return insertColumnAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); - }, grid); - return bundle(newGrid, details[0].row, targetIndex); + var example = details[details.length - 1].column; + var targetIndex = details[details.length - 1].column + details[details.length - 1].colspan; + var columns = uniqueColumns(details); + var newGrid = foldl(columns, function (newG, _row) { + return insertColumnAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); + }, grid); + return bundle(newGrid, details[0].row, targetIndex); }; var opMakeRowHeader = function (grid, detail, comparator, genWrappers) { - var newGrid = replaceRow(grid, detail.row, comparator, genWrappers.replaceOrInit); - return bundle(newGrid, detail.row, detail.column); + var newGrid = replaceRow(grid, detail.row, comparator, genWrappers.replaceOrInit); + return bundle(newGrid, detail.row, detail.column); }; var opMakeRowsHeader = function (initialGrid, details, comparator, genWrappers) { - var rows = uniqueRows(details); - var replacer = function (currentGrid, row) { - return replaceRow(currentGrid, row.row, comparator, genWrappers.replaceOrInit); - }; - var newGrid = foldl(rows, replacer, initialGrid); - return bundle(newGrid, details[0].row, details[0].column); + var rows = uniqueRows(details); + var replacer = function (currentGrid, row) { + return replaceRow(currentGrid, row.row, comparator, genWrappers.replaceOrInit); + }; + var newGrid = foldl(rows, replacer, initialGrid); + return bundle(newGrid, details[0].row, details[0].column); }; var opMakeColumnHeader = function (initialGrid, detail, comparator, genWrappers) { - var newGrid = replaceColumn(initialGrid, detail.column, comparator, genWrappers.replaceOrInit); - return bundle(newGrid, detail.row, detail.column); + var newGrid = replaceColumn(initialGrid, detail.column, comparator, genWrappers.replaceOrInit); + return bundle(newGrid, detail.row, detail.column); }; var opMakeColumnsHeader = function (initialGrid, details, comparator, genWrappers) { - var columns = uniqueColumns(details); - var replacer = function (currentGrid, column) { - return replaceColumn(currentGrid, column.column, comparator, genWrappers.replaceOrInit); - }; - var newGrid = foldl(columns, replacer, initialGrid); - return bundle(newGrid, details[0].row, details[0].column); + var columns = uniqueColumns(details); + var replacer = function (currentGrid, column) { + return replaceColumn(currentGrid, column.column, comparator, genWrappers.replaceOrInit); + }; + var newGrid = foldl(columns, replacer, initialGrid); + return bundle(newGrid, details[0].row, details[0].column); }; var opUnmakeRowHeader = function (grid, detail, comparator, genWrappers) { - var newGrid = replaceRow(grid, detail.row, comparator, genWrappers.replaceOrInit); - return bundle(newGrid, detail.row, detail.column); + var newGrid = replaceRow(grid, detail.row, comparator, genWrappers.replaceOrInit); + return bundle(newGrid, detail.row, detail.column); }; var opUnmakeRowsHeader = function (initialGrid, details, comparator, genWrappers) { - var rows = uniqueRows(details); - var replacer = function (currentGrid, row) { - return replaceRow(currentGrid, row.row, comparator, genWrappers.replaceOrInit); - }; - var newGrid = foldl(rows, replacer, initialGrid); - return bundle(newGrid, details[0].row, details[0].column); + var rows = uniqueRows(details); + var replacer = function (currentGrid, row) { + return replaceRow(currentGrid, row.row, comparator, genWrappers.replaceOrInit); + }; + var newGrid = foldl(rows, replacer, initialGrid); + return bundle(newGrid, details[0].row, details[0].column); }; var opUnmakeColumnHeader = function (initialGrid, detail, comparator, genWrappers) { - var newGrid = replaceColumn(initialGrid, detail.column, comparator, genWrappers.replaceOrInit); - return bundle(newGrid, detail.row, detail.column); + var newGrid = replaceColumn(initialGrid, detail.column, comparator, genWrappers.replaceOrInit); + return bundle(newGrid, detail.row, detail.column); }; var opUnmakeColumnsHeader = function (initialGrid, details, comparator, genWrappers) { - var columns = uniqueColumns(details); - var replacer = function (currentGrid, column) { - return replaceColumn(currentGrid, column.column, comparator, genWrappers.replaceOrInit); - }; - var newGrid = foldl(columns, replacer, initialGrid); - return bundle(newGrid, details[0].row, details[0].column); + var columns = uniqueColumns(details); + var replacer = function (currentGrid, column) { + return replaceColumn(currentGrid, column.column, comparator, genWrappers.replaceOrInit); + }; + var newGrid = foldl(columns, replacer, initialGrid); + return bundle(newGrid, details[0].row, details[0].column); }; var opEraseColumns = function (grid, details, _comparator, _genWrappers) { - var columns = uniqueColumns(details); - var newGrid = deleteColumnsAt(grid, columns[0].column, columns[columns.length - 1].column); - var cursor = elementFromGrid(newGrid, details[0].row, details[0].column); - return outcome(newGrid, cursor); + var columns = uniqueColumns(details); + var newGrid = deleteColumnsAt(grid, columns[0].column, columns[columns.length - 1].column); + var cursor = elementFromGrid(newGrid, details[0].row, details[0].column); + return outcome(newGrid, cursor); }; var opEraseRows = function (grid, details, _comparator, _genWrappers) { - var rows = uniqueRows(details); - var newGrid = deleteRowsAt(grid, rows[0].row, rows[rows.length - 1].row); - var cursor = elementFromGrid(newGrid, details[0].row, details[0].column); - return outcome(newGrid, cursor); + var rows = uniqueRows(details); + var newGrid = deleteRowsAt(grid, rows[0].row, rows[rows.length - 1].row); + var cursor = elementFromGrid(newGrid, details[0].row, details[0].column); + return outcome(newGrid, cursor); }; var opMergeCells = function (grid, mergable, comparator, _genWrappers) { - var cells = mergable.cells; - merge$2(cells); - var newGrid = merge(grid, mergable.bounds, comparator, constant(cells[0])); - return outcome(newGrid, Optional.from(cells[0])); + var cells = mergable.cells; + merge$2(cells); + var newGrid = merge(grid, mergable.bounds, comparator, constant(cells[0])); + return outcome(newGrid, Optional.from(cells[0])); }; var opUnmergeCells = function (grid, unmergable, comparator, genWrappers) { - var newGrid = foldr(unmergable, function (b, cell) { - return unmerge(b, cell, comparator, genWrappers.combine(cell)); - }, grid); - return outcome(newGrid, Optional.from(unmergable[0])); + var newGrid = foldr(unmergable, function (b, cell) { + return unmerge(b, cell, comparator, genWrappers.combine(cell)); + }, grid); + return outcome(newGrid, Optional.from(unmergable[0])); }; var opPasteCells = function (grid, pasteDetails, comparator, _genWrappers) { - var gridify = function (table, generators) { - var wh = Warehouse.fromTable(table); - return toGrid(wh, generators, true); - }; - var gridB = gridify(pasteDetails.clipboard, pasteDetails.generators); - var startAddress = address(pasteDetails.row, pasteDetails.column); - var mergedGrid = merge$1(startAddress, grid, gridB, pasteDetails.generators, comparator); - return mergedGrid.fold(function () { - return outcome(grid, Optional.some(pasteDetails.element)); - }, function (newGrid) { - var cursor = elementFromGrid(newGrid, pasteDetails.row, pasteDetails.column); - return outcome(newGrid, cursor); - }); + var gridify = function (table, generators) { + var wh = Warehouse.fromTable(table); + return toGrid(wh, generators, true); + }; + var gridB = gridify(pasteDetails.clipboard, pasteDetails.generators); + var startAddress = address(pasteDetails.row, pasteDetails.column); + var mergedGrid = merge$1(startAddress, grid, gridB, pasteDetails.generators, comparator); + return mergedGrid.fold(function () { + return outcome(grid, Optional.some(pasteDetails.element)); + }, function (newGrid) { + var cursor = elementFromGrid(newGrid, pasteDetails.row, pasteDetails.column); + return outcome(newGrid, cursor); + }); }; var gridifyRows = function (rows, generators, context) { - var pasteDetails = fromPastedRows(rows, context.section); - var wh = Warehouse.generate(pasteDetails); - return toGrid(wh, generators, true); + var pasteDetails = fromPastedRows(rows, context.section); + var wh = Warehouse.generate(pasteDetails); + return toGrid(wh, generators, true); }; var opPasteColsBefore = function (grid, pasteDetails, comparator, _genWrappers) { - var rows = extractGridDetails(grid).rows; - var index = pasteDetails.cells[0].column; - var context = rows[pasteDetails.cells[0].row]; - var gridB = gridifyRows(pasteDetails.clipboard, pasteDetails.generators, context); - var mergedGrid = insertCols(index, grid, gridB, pasteDetails.generators, comparator); - var cursor = elementFromGrid(mergedGrid, pasteDetails.cells[0].row, pasteDetails.cells[0].column); - return outcome(mergedGrid, cursor); + var rows = extractGridDetails(grid).rows; + var index = pasteDetails.cells[0].column; + var context = rows[pasteDetails.cells[0].row]; + var gridB = gridifyRows(pasteDetails.clipboard, pasteDetails.generators, context); + var mergedGrid = insertCols(index, grid, gridB, pasteDetails.generators, comparator); + var cursor = elementFromGrid(mergedGrid, pasteDetails.cells[0].row, pasteDetails.cells[0].column); + return outcome(mergedGrid, cursor); }; var opPasteColsAfter = function (grid, pasteDetails, comparator, _genWrappers) { - var rows = extractGridDetails(grid).rows; - var index = pasteDetails.cells[pasteDetails.cells.length - 1].column + pasteDetails.cells[pasteDetails.cells.length - 1].colspan; - var context = rows[pasteDetails.cells[0].row]; - var gridB = gridifyRows(pasteDetails.clipboard, pasteDetails.generators, context); - var mergedGrid = insertCols(index, grid, gridB, pasteDetails.generators, comparator); - var cursor = elementFromGrid(mergedGrid, pasteDetails.cells[0].row, pasteDetails.cells[0].column); - return outcome(mergedGrid, cursor); + var rows = extractGridDetails(grid).rows; + var index = pasteDetails.cells[pasteDetails.cells.length - 1].column + pasteDetails.cells[pasteDetails.cells.length - 1].colspan; + var context = rows[pasteDetails.cells[0].row]; + var gridB = gridifyRows(pasteDetails.clipboard, pasteDetails.generators, context); + var mergedGrid = insertCols(index, grid, gridB, pasteDetails.generators, comparator); + var cursor = elementFromGrid(mergedGrid, pasteDetails.cells[0].row, pasteDetails.cells[0].column); + return outcome(mergedGrid, cursor); }; var opPasteRowsBefore = function (grid, pasteDetails, comparator, _genWrappers) { - var rows = extractGridDetails(grid).rows; - var index = pasteDetails.cells[0].row; - var context = rows[index]; - var gridB = gridifyRows(pasteDetails.clipboard, pasteDetails.generators, context); - var mergedGrid = insertRows(index, grid, gridB, pasteDetails.generators, comparator); - var cursor = elementFromGrid(mergedGrid, pasteDetails.cells[0].row, pasteDetails.cells[0].column); - return outcome(mergedGrid, cursor); + var rows = extractGridDetails(grid).rows; + var index = pasteDetails.cells[0].row; + var context = rows[index]; + var gridB = gridifyRows(pasteDetails.clipboard, pasteDetails.generators, context); + var mergedGrid = insertRows(index, grid, gridB, pasteDetails.generators, comparator); + var cursor = elementFromGrid(mergedGrid, pasteDetails.cells[0].row, pasteDetails.cells[0].column); + return outcome(mergedGrid, cursor); }; var opPasteRowsAfter = function (grid, pasteDetails, comparator, _genWrappers) { - var rows = extractGridDetails(grid).rows; - var index = pasteDetails.cells[pasteDetails.cells.length - 1].row + pasteDetails.cells[pasteDetails.cells.length - 1].rowspan; - var context = rows[pasteDetails.cells[0].row]; - var gridB = gridifyRows(pasteDetails.clipboard, pasteDetails.generators, context); - var mergedGrid = insertRows(index, grid, gridB, pasteDetails.generators, comparator); - var cursor = elementFromGrid(mergedGrid, pasteDetails.cells[0].row, pasteDetails.cells[0].column); - return outcome(mergedGrid, cursor); + var rows = extractGridDetails(grid).rows; + var index = pasteDetails.cells[pasteDetails.cells.length - 1].row + pasteDetails.cells[pasteDetails.cells.length - 1].rowspan; + var context = rows[pasteDetails.cells[0].row]; + var gridB = gridifyRows(pasteDetails.clipboard, pasteDetails.generators, context); + var mergedGrid = insertRows(index, grid, gridB, pasteDetails.generators, comparator); + var cursor = elementFromGrid(mergedGrid, pasteDetails.cells[0].row, pasteDetails.cells[0].column); + return outcome(mergedGrid, cursor); }; var opGetColumnType = function (table, target) { - var house = Warehouse.fromTable(table); - var details = onCells(house, target); - return details.bind(function (selectedCells) { - var lastSelectedCell = selectedCells[selectedCells.length - 1]; - var minColRange = selectedCells[0].column; - var maxColRange = lastSelectedCell.column + lastSelectedCell.colspan; - var selectedColumnCells = flatten(map(house.all, function (row) { - return filter(row.cells, function (cell) { - return cell.column >= minColRange && cell.column < maxColRange; - }); - })); - return getCellsType(selectedColumnCells, function (cell) { - return name(cell.element) === 'th'; - }); - }).getOr(''); + var house = Warehouse.fromTable(table); + var details = onCells(house, target); + return details.bind(function (selectedCells) { + var lastSelectedCell = selectedCells[selectedCells.length - 1]; + var minColRange = selectedCells[0].column; + var maxColRange = lastSelectedCell.column + lastSelectedCell.colspan; + var selectedColumnCells = flatten(map(house.all, function (row) { + return filter(row.cells, function (cell) { + return cell.column >= minColRange && cell.column < maxColRange; + }); + })); + return getCellsType(selectedColumnCells, function (cell) { + return name(cell.element) === 'th'; + }); + }).getOr(''); }; var getCellsType = function (cells, headerPred) { - var headerCells = filter(cells, headerPred); - if (headerCells.length === 0) { - return Optional.some('td'); - } else if (headerCells.length === cells.length) { - return Optional.some('th'); - } else { - return Optional.none(); - } + var headerCells = filter(cells, headerPred); + if (headerCells.length === 0) { + return Optional.some('td'); + } else if (headerCells.length === cells.length) { + return Optional.some('th'); + } else { + return Optional.none(); + } }; var resize = adjustWidthTo; var insertRowsBefore = run(opInsertRowsBefore, onCells, noop, noop, Generators.modification); @@ -6395,4105 +6392,4102 @@ var getColumnType = opGetColumnType; var getSection = function (elm) { - return getNodeName(elm.parentNode); + return getNodeName(elm.parentNode); }; var mapSectionNameToType = function (section) { - if (section === 'thead') { - return 'header'; - } else if (section === 'tfoot') { - return 'footer'; - } else { - return 'body'; - } + if (section === 'thead') { + return 'header'; + } else if (section === 'tfoot') { + return 'footer'; + } else { + return 'body'; + } }; var detectHeaderRow = function (editor, elm) { - var isThead = getSection(elm) === 'thead'; - var areAllCellsThs = !exists(elm.cells, function (c) { - return getNodeName(c) !== 'th'; - }); - return isThead || areAllCellsThs ? Optional.some({ - thead: isThead, - ths: areAllCellsThs - }) : Optional.none(); + var isThead = getSection(elm) === 'thead'; + var areAllCellsThs = !exists(elm.cells, function (c) { + return getNodeName(c) !== 'th'; + }); + return isThead || areAllCellsThs ? Optional.some({ + thead: isThead, + ths: areAllCellsThs + }) : Optional.none(); }; var getRowType = function (editor, elm) { - return mapSectionNameToType(detectHeaderRow(editor, elm).fold(function () { - return getSection(elm); - }, function (_rowConfig) { - return 'thead'; - })); + return mapSectionNameToType(detectHeaderRow(editor, elm).fold(function () { + return getSection(elm); + }, function (_rowConfig) { + return 'thead'; + })); }; var switchRowSection = function (dom, rowElm, newSectionName) { - var tableElm = dom.getParent(rowElm, 'table'); - var oldSectionElm = rowElm.parentNode; - var oldSectionName = getNodeName(oldSectionElm); - if (newSectionName !== oldSectionName) { - var sectionElm_1 = dom.select(newSectionName, tableElm)[0]; - if (!sectionElm_1) { - sectionElm_1 = dom.create(newSectionName); - var firstTableChild_1 = tableElm.firstChild; - if (newSectionName === 'thead') { - last(children$2(SugarElement.fromDom(tableElm), 'caption,colgroup')).fold(function () { - return tableElm.insertBefore(sectionElm_1, firstTableChild_1); - }, function (c) { - return dom.insertAfter(sectionElm_1, c.dom); - }); - } else { - tableElm.appendChild(sectionElm_1); - } - } - if (newSectionName === 'tbody' && oldSectionName === 'thead' && sectionElm_1.firstChild) { - sectionElm_1.insertBefore(rowElm, sectionElm_1.firstChild); - } else { - sectionElm_1.appendChild(rowElm); - } - if (!oldSectionElm.hasChildNodes()) { - dom.remove(oldSectionElm); - } + var tableElm = dom.getParent(rowElm, 'table'); + var oldSectionElm = rowElm.parentNode; + var oldSectionName = getNodeName(oldSectionElm); + if (newSectionName !== oldSectionName) { + var sectionElm_1 = dom.select(newSectionName, tableElm)[0]; + if (!sectionElm_1) { + sectionElm_1 = dom.create(newSectionName); + var firstTableChild_1 = tableElm.firstChild; + if (newSectionName === 'thead') { + last(children$2(SugarElement.fromDom(tableElm), 'caption,colgroup')).fold(function () { + return tableElm.insertBefore(sectionElm_1, firstTableChild_1); + }, function (c) { + return dom.insertAfter(sectionElm_1, c.dom); + }); + } else { + tableElm.appendChild(sectionElm_1); + } + } + if (newSectionName === 'tbody' && oldSectionName === 'thead' && sectionElm_1.firstChild) { + sectionElm_1.insertBefore(rowElm, sectionElm_1.firstChild); + } else { + sectionElm_1.appendChild(rowElm); } + if (!oldSectionElm.hasChildNodes()) { + dom.remove(oldSectionElm); + } + } }; var renameCell = function (editor, cell, newCellType) { - if (isNonNullable(newCellType) && getNodeName(cell) !== newCellType) { - var newCellElm = editor.dom.rename(cell, newCellType); - fireNewCell(editor, newCellElm); - return newCellElm; - } else { - return cell; - } + if (isNonNullable(newCellType) && getNodeName(cell) !== newCellType) { + var newCellElm = editor.dom.rename(cell, newCellType); + fireNewCell(editor, newCellElm); + return newCellElm; + } else { + return cell; + } }; var switchCellType = function (editor, cell, newCellType, scope) { - var dom = editor.dom; - var newCell = renameCell(editor, cell, newCellType); - if (!isUndefined(scope)) { - dom.setAttrib(newCell, 'scope', scope); - } - return newCell; + var dom = editor.dom; + var newCell = renameCell(editor, cell, newCellType); + if (!isUndefined(scope)) { + dom.setAttrib(newCell, 'scope', scope); + } + return newCell; }; var switchCellsType = function (editor, cells, newCellType, scope) { - return each(cells, function (c) { - return switchCellType(editor, c, newCellType, scope); - }); + return each(cells, function (c) { + return switchCellType(editor, c, newCellType, scope); + }); }; var switchSectionType = function (editor, rowElm, newType) { - var determineHeaderRowType = function () { - var allTableRows = table(SugarElement.fromDom(rowElm.cells[0])).map(function (table) { - return rows(table); - }).getOr([]); - return findMap(allTableRows, function (row) { - return detectHeaderRow(editor, row.dom); - }).map(function (detectedType) { - if (detectedType.thead && detectedType.ths) { - return 'sectionCells'; - } else { - return detectedType.thead ? 'section' : 'cells'; - } - }).getOr('section'); - }; - var dom = editor.dom; - if (newType === 'header') { - var headerRowTypeSetting = getTableHeaderType(editor); - var headerRowType = headerRowTypeSetting === 'auto' ? determineHeaderRowType() : headerRowTypeSetting; - switchCellsType(editor, rowElm.cells, headerRowType === 'section' ? 'td' : 'th', 'col'); - switchRowSection(dom, rowElm, headerRowType === 'cells' ? 'tbody' : 'thead'); - } else { - switchCellsType(editor, rowElm.cells, 'td', null); - switchRowSection(dom, rowElm, newType === 'footer' ? 'tfoot' : 'tbody'); - } + var determineHeaderRowType = function () { + var allTableRows = table(SugarElement.fromDom(rowElm.cells[0])).map(function (table) { + return rows(table); + }).getOr([]); + return findMap(allTableRows, function (row) { + return detectHeaderRow(editor, row.dom); + }).map(function (detectedType) { + if (detectedType.thead && detectedType.ths) { + return 'sectionCells'; + } else { + return detectedType.thead ? 'section' : 'cells'; + } + }).getOr('section'); + }; + var dom = editor.dom; + if (newType === 'header') { + var headerRowTypeSetting = getTableHeaderType(editor); + var headerRowType = headerRowTypeSetting === 'auto' ? determineHeaderRowType() : headerRowTypeSetting; + switchCellsType(editor, rowElm.cells, headerRowType === 'section' ? 'td' : 'th', 'col'); + switchRowSection(dom, rowElm, headerRowType === 'cells' ? 'tbody' : 'thead'); + } else { + switchCellsType(editor, rowElm.cells, 'td', null); + switchRowSection(dom, rowElm, newType === 'footer' ? 'tfoot' : 'tbody'); + } }; var getSelectionStartCellFallback = function (start) { - return table(start).bind(function (table) { - return retrieve$1(table, ephemera.firstSelectedSelector); - }).fold(function () { - return start; - }, function (cells) { - return cells[0]; - }); + return table(start).bind(function (table) { + return retrieve$1(table, ephemera.firstSelectedSelector); + }).fold(function () { + return start; + }, function (cells) { + return cells[0]; + }); }; var getSelectionStartFromSelector = function (selector) { - return function (start) { - var startCellName = name(start); - var startCell = startCellName === 'col' || startCellName === 'colgroup' ? getSelectionStartCellFallback(start) : start; - return closest$1(startCell, selector); - }; + return function (start) { + var startCellName = name(start); + var startCell = startCellName === 'col' || startCellName === 'colgroup' ? getSelectionStartCellFallback(start) : start; + return closest$1(startCell, selector); + }; }; var getSelectionStartCell = getSelectionStartFromSelector('th,td'); var getSelectionStartCellOrCaption = getSelectionStartFromSelector('th,td,caption'); var getCellsFromSelection = function (start, selections) { - return getSelectionStartCell(start).map(function (_cell) { - return selection(selections); - }).getOr([]); + return getSelectionStartCell(start).map(function (_cell) { + return selection(selections); + }).getOr([]); }; var getRowsFromSelection = function (start, selector) { - var cellOpt = getSelectionStartCell(start); - var rowsOpt = cellOpt.bind(function (cell) { - return table(cell); - }).map(function (table) { - return rows(table); - }); - return lift2(cellOpt, rowsOpt, function (cell, rows) { - return filter(rows, function (row) { - return exists(fromDom$1(row.dom.cells), function (rowCell) { - return get$2(rowCell, selector) === '1' || eq$1(rowCell, cell); - }); - }); - }).getOr([]); + var cellOpt = getSelectionStartCell(start); + var rowsOpt = cellOpt.bind(function (cell) { + return table(cell); + }).map(function (table) { + return rows(table); + }); + return lift2(cellOpt, rowsOpt, function (cell, rows) { + return filter(rows, function (row) { + return exists(fromDom$1(row.dom.cells), function (rowCell) { + return get$2(rowCell, selector) === '1' || eq$1(rowCell, cell); + }); + }); + }).getOr([]); }; var TableActions = function (editor, lazyWire, selections) { - var isTableBody = function (editor) { - return name(getBody$1(editor)) === 'table'; - }; - var lastRowGuard = function (table) { - return isTableBody(editor) === false || getGridSize(table).rows > 1; - }; - var lastColumnGuard = function (table) { - return isTableBody(editor) === false || getGridSize(table).columns > 1; - }; - var cloneFormats = getCloneElements(editor); - var execute = function (operation, guard, mutate, lazyWire) { - return function (table, target) { - removeDataStyle(table); - var wire = lazyWire(); - var doc = SugarElement.fromDom(editor.getDoc()); - var generators = cellOperations(mutate, doc, cloneFormats); - var sizing = get$9(editor, table); - return guard(table) ? operation(wire, table, target, generators, sizing).bind(function (result) { - each(result.newRows, function (row) { - fireNewRow(editor, row.dom); - }); - each(result.newCells, function (cell) { - fireNewCell(editor, cell.dom); - }); - return result.cursor.map(function (cell) { - var des = freefallRtl$2(cell); - var rng = editor.dom.createRng(); - rng.setStart(des.element.dom, des.offset); - rng.setEnd(des.element.dom, des.offset); - return rng; - }); - }) : Optional.none(); - }; - }; - var deleteRow = execute(eraseRows, lastRowGuard, noop, lazyWire); - var deleteColumn = execute(eraseColumns, lastColumnGuard, noop, lazyWire); - var insertRowsBefore$1 = execute(insertRowsBefore, always, noop, lazyWire); - var insertRowsAfter$1 = execute(insertRowsAfter, always, noop, lazyWire); - var insertColumnsBefore$1 = execute(insertColumnsBefore, always, halve, lazyWire); - var insertColumnsAfter$1 = execute(insertColumnsAfter, always, halve, lazyWire); - var mergeCells$1 = execute(mergeCells, always, noop, lazyWire); - var unmergeCells$1 = execute(unmergeCells, always, noop, lazyWire); - var pasteColsBefore$1 = execute(pasteColsBefore, always, noop, lazyWire); - var pasteColsAfter$1 = execute(pasteColsAfter, always, noop, lazyWire); - var pasteRowsBefore$1 = execute(pasteRowsBefore, always, noop, lazyWire); - var pasteRowsAfter$1 = execute(pasteRowsAfter, always, noop, lazyWire); - var pasteCells$1 = execute(pasteCells, always, noop, lazyWire); - var extractType = function (args, validTypes) { - return get$1(args, 'type').filter(function (type) { - return contains(validTypes, type); - }); - }; - var setTableCellType = function (editor, args) { - return extractType(args, [ - 'td', - 'th' - ]).each(function (type) { - var cells = map(getCellsFromSelection(getSelectionStart(editor), selections), function (c) { - return c.dom; - }); - switchCellsType(editor, cells, type, null); - }); - }; - var setTableRowType = function (editor, args) { - return extractType(args, [ - 'header', - 'body', - 'footer' - ]).each(function (type) { - map(getRowsFromSelection(getSelectionStart(editor), ephemera.selected), function (row) { - return switchSectionType(editor, row.dom, type); - }); - }); - }; - var makeColumnsHeader$1 = execute(makeColumnsHeader, always, noop, lazyWire); - var unmakeColumnsHeader$1 = execute(unmakeColumnsHeader, always, noop, lazyWire); - var getTableRowType = function (editor) { - var rows = getRowsFromSelection(getSelectionStart(editor), ephemera.selected); - if (rows.length > 0) { - var rowTypes = map(rows, function (r) { - return getRowType(editor, r.dom); - }); - var hasHeader = contains(rowTypes, 'header'); - var hasFooter = contains(rowTypes, 'footer'); - if (!hasHeader && !hasFooter) { - return 'body'; - } else { - var hasBody = contains(rowTypes, 'body'); - if (hasHeader && !hasBody && !hasFooter) { - return 'header'; - } else if (!hasHeader && !hasBody && hasFooter) { - return 'footer'; - } else { - return ''; - } - } + var isTableBody = function (editor) { + return name(getBody$1(editor)) === 'table'; + }; + var lastRowGuard = function (table) { + return isTableBody(editor) === false || getGridSize(table).rows > 1; + }; + var lastColumnGuard = function (table) { + return isTableBody(editor) === false || getGridSize(table).columns > 1; + }; + var cloneFormats = getCloneElements(editor); + var execute = function (operation, guard, mutate, lazyWire) { + return function (table, target) { + removeDataStyle(table); + var wire = lazyWire(); + var doc = SugarElement.fromDom(editor.getDoc()); + var generators = cellOperations(mutate, doc, cloneFormats); + var sizing = get$9(editor, table); + return guard(table) ? operation(wire, table, target, generators, sizing).bind(function (result) { + each(result.newRows, function (row) { + fireNewRow(editor, row.dom); + }); + each(result.newCells, function (cell) { + fireNewCell(editor, cell.dom); + }); + return result.cursor.map(function (cell) { + var des = freefallRtl$2(cell); + var rng = editor.dom.createRng(); + rng.setStart(des.element.dom, des.offset); + rng.setEnd(des.element.dom, des.offset); + return rng; + }); + }) : Optional.none(); + }; + }; + var deleteRow = execute(eraseRows, lastRowGuard, noop, lazyWire); + var deleteColumn = execute(eraseColumns, lastColumnGuard, noop, lazyWire); + var insertRowsBefore$1 = execute(insertRowsBefore, always, noop, lazyWire); + var insertRowsAfter$1 = execute(insertRowsAfter, always, noop, lazyWire); + var insertColumnsBefore$1 = execute(insertColumnsBefore, always, halve, lazyWire); + var insertColumnsAfter$1 = execute(insertColumnsAfter, always, halve, lazyWire); + var mergeCells$1 = execute(mergeCells, always, noop, lazyWire); + var unmergeCells$1 = execute(unmergeCells, always, noop, lazyWire); + var pasteColsBefore$1 = execute(pasteColsBefore, always, noop, lazyWire); + var pasteColsAfter$1 = execute(pasteColsAfter, always, noop, lazyWire); + var pasteRowsBefore$1 = execute(pasteRowsBefore, always, noop, lazyWire); + var pasteRowsAfter$1 = execute(pasteRowsAfter, always, noop, lazyWire); + var pasteCells$1 = execute(pasteCells, always, noop, lazyWire); + var extractType = function (args, validTypes) { + return get$1(args, 'type').filter(function (type) { + return contains(validTypes, type); + }); + }; + var setTableCellType = function (editor, args) { + return extractType(args, [ + 'td', + 'th' + ]).each(function (type) { + var cells = map(getCellsFromSelection(getSelectionStart(editor), selections), function (c) { + return c.dom; + }); + switchCellsType(editor, cells, type, null); + }); + }; + var setTableRowType = function (editor, args) { + return extractType(args, [ + 'header', + 'body', + 'footer' + ]).each(function (type) { + map(getRowsFromSelection(getSelectionStart(editor), ephemera.selected), function (row) { + return switchSectionType(editor, row.dom, type); + }); + }); + }; + var makeColumnsHeader$1 = execute(makeColumnsHeader, always, noop, lazyWire); + var unmakeColumnsHeader$1 = execute(unmakeColumnsHeader, always, noop, lazyWire); + var getTableRowType = function (editor) { + var rows = getRowsFromSelection(getSelectionStart(editor), ephemera.selected); + if (rows.length > 0) { + var rowTypes = map(rows, function (r) { + return getRowType(editor, r.dom); + }); + var hasHeader = contains(rowTypes, 'header'); + var hasFooter = contains(rowTypes, 'footer'); + if (!hasHeader && !hasFooter) { + return 'body'; + } else { + var hasBody = contains(rowTypes, 'body'); + if (hasHeader && !hasBody && !hasFooter) { + return 'header'; + } else if (!hasHeader && !hasBody && hasFooter) { + return 'footer'; + } else { + return ''; } - }; - var getTableCellType = function (editor) { - return getCellsType(getCellsFromSelection(getSelectionStart(editor), selections), function (cell) { - return name(cell) === 'th'; - }).getOr(''); - }; - var getTableColType = getColumnType; - return { - deleteRow: deleteRow, - deleteColumn: deleteColumn, - insertRowsBefore: insertRowsBefore$1, - insertRowsAfter: insertRowsAfter$1, - insertColumnsBefore: insertColumnsBefore$1, - insertColumnsAfter: insertColumnsAfter$1, - mergeCells: mergeCells$1, - unmergeCells: unmergeCells$1, - pasteColsBefore: pasteColsBefore$1, - pasteColsAfter: pasteColsAfter$1, - pasteRowsBefore: pasteRowsBefore$1, - pasteRowsAfter: pasteRowsAfter$1, - pasteCells: pasteCells$1, - setTableCellType: setTableCellType, - setTableRowType: setTableRowType, - makeColumnsHeader: makeColumnsHeader$1, - unmakeColumnsHeader: unmakeColumnsHeader$1, - getTableRowType: getTableRowType, - getTableCellType: getTableCellType, - getTableColType: getTableColType - }; + } + } + }; + var getTableCellType = function (editor) { + return getCellsType(getCellsFromSelection(getSelectionStart(editor), selections), function (cell) { + return name(cell) === 'th'; + }).getOr(''); + }; + var getTableColType = getColumnType; + return { + deleteRow: deleteRow, + deleteColumn: deleteColumn, + insertRowsBefore: insertRowsBefore$1, + insertRowsAfter: insertRowsAfter$1, + insertColumnsBefore: insertColumnsBefore$1, + insertColumnsAfter: insertColumnsAfter$1, + mergeCells: mergeCells$1, + unmergeCells: unmergeCells$1, + pasteColsBefore: pasteColsBefore$1, + pasteColsAfter: pasteColsAfter$1, + pasteRowsBefore: pasteRowsBefore$1, + pasteRowsAfter: pasteRowsAfter$1, + pasteCells: pasteCells$1, + setTableCellType: setTableCellType, + setTableRowType: setTableRowType, + makeColumnsHeader: makeColumnsHeader$1, + unmakeColumnsHeader: unmakeColumnsHeader$1, + getTableRowType: getTableRowType, + getTableCellType: getTableCellType, + getTableColType: getTableColType + }; }; var DefaultRenderOptions = { - styles: { - 'border-collapse': 'collapse', - 'width': '100%' - }, - attributes: {border: '1'}, - colGroups: false + styles: { + 'border-collapse': 'collapse', + 'width': '100%' + }, + attributes: { border: '1' }, + colGroups: false }; var tableHeaderCell = function () { - return SugarElement.fromTag('th'); + return SugarElement.fromTag('th'); }; var tableCell = function () { - return SugarElement.fromTag('td'); + return SugarElement.fromTag('td'); }; var tableColumn = function () { - return SugarElement.fromTag('col'); + return SugarElement.fromTag('col'); }; var createRow = function (columns, rowHeaders, columnHeaders, rowIndex) { - var tr = SugarElement.fromTag('tr'); - for (var j = 0; j < columns; j++) { - var td = rowIndex < rowHeaders || j < columnHeaders ? tableHeaderCell() : tableCell(); - if (j < columnHeaders) { - set(td, 'scope', 'row'); - } - if (rowIndex < rowHeaders) { - set(td, 'scope', 'col'); - } - append(td, SugarElement.fromTag('br')); - append(tr, td); + var tr = SugarElement.fromTag('tr'); + for (var j = 0; j < columns; j++) { + var td = rowIndex < rowHeaders || j < columnHeaders ? tableHeaderCell() : tableCell(); + if (j < columnHeaders) { + set(td, 'scope', 'row'); } - return tr; + if (rowIndex < rowHeaders) { + set(td, 'scope', 'col'); + } + append(td, SugarElement.fromTag('br')); + append(tr, td); + } + return tr; }; var createGroupRow = function (columns) { - var columnGroup = SugarElement.fromTag('colgroup'); - range(columns, function () { - return append(columnGroup, tableColumn()); - }); - return columnGroup; + var columnGroup = SugarElement.fromTag('colgroup'); + range(columns, function () { + return append(columnGroup, tableColumn()); + }); + return columnGroup; }; var createRows = function (rows, columns, rowHeaders, columnHeaders) { - return range(rows, function (r) { - return createRow(columns, rowHeaders, columnHeaders, r); - }); + return range(rows, function (r) { + return createRow(columns, rowHeaders, columnHeaders, r); + }); }; var render$1 = function (rows, columns, rowHeaders, columnHeaders, headerType, renderOpts) { - if (renderOpts === void 0) { - renderOpts = DefaultRenderOptions; - } - var table = SugarElement.fromTag('table'); - var rowHeadersGoInThead = headerType !== 'cells'; - setAll$1(table, renderOpts.styles); - setAll(table, renderOpts.attributes); - if (renderOpts.colGroups) { - append(table, createGroupRow(columns)); - } - var actualRowHeaders = Math.min(rows, rowHeaders); - if (rowHeadersGoInThead && rowHeaders > 0) { - var thead = SugarElement.fromTag('thead'); - append(table, thead); - var theadRowHeaders = headerType === 'sectionCells' ? actualRowHeaders : 0; - var theadRows = createRows(rowHeaders, columns, theadRowHeaders, columnHeaders); - append$1(thead, theadRows); - } - var tbody = SugarElement.fromTag('tbody'); - append(table, tbody); - var numRows = rowHeadersGoInThead ? rows - actualRowHeaders : rows; - var numRowHeaders = rowHeadersGoInThead ? 0 : rowHeaders; - var tbodyRows = createRows(numRows, columns, numRowHeaders, columnHeaders); - append$1(tbody, tbodyRows); - return table; + if (renderOpts === void 0) { + renderOpts = DefaultRenderOptions; + } + var table = SugarElement.fromTag('table'); + var rowHeadersGoInThead = headerType !== 'cells'; + setAll$1(table, renderOpts.styles); + setAll(table, renderOpts.attributes); + if (renderOpts.colGroups) { + append(table, createGroupRow(columns)); + } + var actualRowHeaders = Math.min(rows, rowHeaders); + if (rowHeadersGoInThead && rowHeaders > 0) { + var thead = SugarElement.fromTag('thead'); + append(table, thead); + var theadRowHeaders = headerType === 'sectionCells' ? actualRowHeaders : 0; + var theadRows = createRows(rowHeaders, columns, theadRowHeaders, columnHeaders); + append$1(thead, theadRows); + } + var tbody = SugarElement.fromTag('tbody'); + append(table, tbody); + var numRows = rowHeadersGoInThead ? rows - actualRowHeaders : rows; + var numRowHeaders = rowHeadersGoInThead ? 0 : rowHeaders; + var tbodyRows = createRows(numRows, columns, numRowHeaders, columnHeaders); + append$1(tbody, tbodyRows); + return table; }; var get$b = function (element) { - return element.dom.innerHTML; + return element.dom.innerHTML; }; var getOuter$2 = function (element) { - var container = SugarElement.fromTag('div'); - var clone = SugarElement.fromDom(element.dom.cloneNode(true)); - append(container, clone); - return get$b(container); + var container = SugarElement.fromTag('div'); + var clone = SugarElement.fromDom(element.dom.cloneNode(true)); + append(container, clone); + return get$b(container); }; var placeCaretInCell = function (editor, cell) { - editor.selection.select(cell.dom, true); - editor.selection.collapse(true); + editor.selection.select(cell.dom, true); + editor.selection.collapse(true); }; var selectFirstCellInTable = function (editor, tableElm) { - descendant$1(tableElm, 'td,th').each(curry(placeCaretInCell, editor)); + descendant$1(tableElm, 'td,th').each(curry(placeCaretInCell, editor)); }; var fireEvents = function (editor, table) { - each(descendants$1(table, 'tr'), function (row) { - fireNewRow(editor, row.dom); - each(descendants$1(row, 'th,td'), function (cell) { - fireNewCell(editor, cell.dom); - }); + each(descendants$1(table, 'tr'), function (row) { + fireNewRow(editor, row.dom); + each(descendants$1(row, 'th,td'), function (cell) { + fireNewCell(editor, cell.dom); }); + }); }; var isPercentage$1 = function (width) { - return isString(width) && width.indexOf('%') !== -1; + return isString(width) && width.indexOf('%') !== -1; }; var insert$1 = function (editor, columns, rows, colHeaders, rowHeaders) { - var defaultStyles = getDefaultStyles(editor); - var options = { - styles: defaultStyles, - attributes: getDefaultAttributes(editor), - colGroups: useColumnGroup(editor) - }; - editor.undoManager.ignore(function () { - var table = render$1(rows, columns, rowHeaders, colHeaders, getTableHeaderType(editor), options); - set(table, 'data-mce-id', '__mce'); - var html = getOuter$2(table); - editor.insertContent(html); - editor.addVisual(); - }); - return descendant$1(getBody$1(editor), 'table[data-mce-id="__mce"]').map(function (table) { - if (isPixelsForced(editor)) { - enforcePixels(editor, table); - } else if (isResponsiveForced(editor)) { - enforceNone(table); - } else if (isPercentagesForced(editor) || isPercentage$1(defaultStyles.width)) { - enforcePercentage(editor, table); - } - removeDataStyle(table); - remove(table, 'data-mce-id'); - fireEvents(editor, table); - selectFirstCellInTable(editor, table); - return table.dom; - }).getOr(null); + var defaultStyles = getDefaultStyles(editor); + var options = { + styles: defaultStyles, + attributes: getDefaultAttributes(editor), + colGroups: useColumnGroup(editor) + }; + editor.undoManager.ignore(function () { + var table = render$1(rows, columns, rowHeaders, colHeaders, getTableHeaderType(editor), options); + set(table, 'data-mce-id', '__mce'); + var html = getOuter$2(table); + editor.insertContent(html); + editor.addVisual(); + }); + return descendant$1(getBody$1(editor), 'table[data-mce-id="__mce"]').map(function (table) { + if (isPixelsForced(editor)) { + enforcePixels(editor, table); + } else if (isResponsiveForced(editor)) { + enforceNone(table); + } else if (isPercentagesForced(editor) || isPercentage$1(defaultStyles.width)) { + enforcePercentage(editor, table); + } + removeDataStyle(table); + remove(table, 'data-mce-id'); + fireEvents(editor, table); + selectFirstCellInTable(editor, table); + return table.dom; + }).getOr(null); }; var insertTableWithDataValidation = function (editor, rows, columns, options, errorMsg) { - if (options === void 0) { - options = {}; - } - var checkInput = function (val) { - return isNumber(val) && val > 0; - }; - if (checkInput(rows) && checkInput(columns)) { - var headerRows = options.headerRows || 0; - var headerColumns = options.headerColumns || 0; - return insert$1(editor, columns, rows, headerColumns, headerRows); - } else { - console.error(errorMsg); - return null; - } + if (options === void 0) { + options = {}; + } + var checkInput = function (val) { + return isNumber(val) && val > 0; + }; + if (checkInput(rows) && checkInput(columns)) { + var headerRows = options.headerRows || 0; + var headerColumns = options.headerColumns || 0; + return insert$1(editor, columns, rows, headerColumns, headerRows); + } else { + console.error(errorMsg); + return null; + } }; var getClipboardElements = function (getClipboard) { - return function () { - return getClipboard().fold(function () { - return []; - }, function (elems) { - return map(elems, function (e) { - return e.dom; - }); - }); - }; + return function () { + return getClipboard().fold(function () { + return []; + }, function (elems) { + return map(elems, function (e) { + return e.dom; + }); + }); + }; }; var setClipboardElements = function (setClipboard) { - return function (elems) { - var elmsOpt = elems.length > 0 ? Optional.some(fromDom$1(elems)) : Optional.none(); - setClipboard(elmsOpt); - }; + return function (elems) { + var elmsOpt = elems.length > 0 ? Optional.some(fromDom$1(elems)) : Optional.none(); + setClipboard(elmsOpt); + }; }; var insertTable = function (editor) { - return function (columns, rows, options) { - if (options === void 0) { - options = {}; - } - var table = insertTableWithDataValidation(editor, rows, columns, options, 'Invalid values for insertTable - rows and columns values are required to insert a table.'); - editor.undoManager.add(); - return table; - }; + return function (columns, rows, options) { + if (options === void 0) { + options = {}; + } + var table = insertTableWithDataValidation(editor, rows, columns, options, 'Invalid values for insertTable - rows and columns values are required to insert a table.'); + editor.undoManager.add(); + return table; + }; }; var getApi = function (editor, clipboard, resizeHandler, selectionTargets) { - return { - insertTable: insertTable(editor), - setClipboardRows: setClipboardElements(clipboard.setRows), - getClipboardRows: getClipboardElements(clipboard.getRows), - setClipboardCols: setClipboardElements(clipboard.setColumns), - getClipboardCols: getClipboardElements(clipboard.getColumns), - resizeHandler: resizeHandler, - selectionTargets: selectionTargets - }; + return { + insertTable: insertTable(editor), + setClipboardRows: setClipboardElements(clipboard.setRows), + getClipboardRows: getClipboardElements(clipboard.getRows), + setClipboardCols: setClipboardElements(clipboard.setColumns), + getClipboardCols: getClipboardElements(clipboard.getColumns), + resizeHandler: resizeHandler, + selectionTargets: selectionTargets + }; }; var constrainSpan = function (element, property, value) { - var currentColspan = getAttrValue(element, property, 1); - if (value === 1 || currentColspan <= 1) { - remove(element, property); - } else { - set(element, property, Math.min(value, currentColspan)); - } + var currentColspan = getAttrValue(element, property, 1); + if (value === 1 || currentColspan <= 1) { + remove(element, property); + } else { + set(element, property, Math.min(value, currentColspan)); + } }; var generateColGroup = function (house, minColRange, maxColRange) { - if (Warehouse.hasColumns(house)) { - var colsToCopy = filter(Warehouse.justColumns(house), function (col) { - return col.column >= minColRange && col.column < maxColRange; - }); - var copiedCols = map(colsToCopy, function (c) { - var clonedCol = deep(c.element); - constrainSpan(clonedCol, 'span', maxColRange - minColRange); - return clonedCol; - }); - var fakeColgroup = SugarElement.fromTag('colgroup'); - append$1(fakeColgroup, copiedCols); - return [fakeColgroup]; - } else { - return []; - } + if (Warehouse.hasColumns(house)) { + var colsToCopy = filter(Warehouse.justColumns(house), function (col) { + return col.column >= minColRange && col.column < maxColRange; + }); + var copiedCols = map(colsToCopy, function (c) { + var clonedCol = deep(c.element); + constrainSpan(clonedCol, 'span', maxColRange - minColRange); + return clonedCol; + }); + var fakeColgroup = SugarElement.fromTag('colgroup'); + append$1(fakeColgroup, copiedCols); + return [fakeColgroup]; + } else { + return []; + } }; var generateRows = function (house, minColRange, maxColRange) { - return map(house.all, function (row) { - var cellsToCopy = filter(row.cells, function (cell) { - return cell.column >= minColRange && cell.column < maxColRange; - }); - var copiedCells = map(cellsToCopy, function (cell) { - var clonedCell = deep(cell.element); - constrainSpan(clonedCell, 'colspan', maxColRange - minColRange); - return clonedCell; - }); - var fakeTR = SugarElement.fromTag('tr'); - append$1(fakeTR, copiedCells); - return fakeTR; + return map(house.all, function (row) { + var cellsToCopy = filter(row.cells, function (cell) { + return cell.column >= minColRange && cell.column < maxColRange; }); + var copiedCells = map(cellsToCopy, function (cell) { + var clonedCell = deep(cell.element); + constrainSpan(clonedCell, 'colspan', maxColRange - minColRange); + return clonedCell; + }); + var fakeTR = SugarElement.fromTag('tr'); + append$1(fakeTR, copiedCells); + return fakeTR; + }); }; var copyCols = function (table, target) { - var house = Warehouse.fromTable(table); - var details = onCells(house, target); - return details.map(function (selectedCells) { - var lastSelectedCell = selectedCells[selectedCells.length - 1]; - var minColRange = selectedCells[0].column; - var maxColRange = lastSelectedCell.column + lastSelectedCell.colspan; - var fakeColGroups = generateColGroup(house, minColRange, maxColRange); - var fakeRows = generateRows(house, minColRange, maxColRange); - return __spreadArrays(fakeColGroups, fakeRows); - }); + var house = Warehouse.fromTable(table); + var details = onCells(house, target); + return details.map(function (selectedCells) { + var lastSelectedCell = selectedCells[selectedCells.length - 1]; + var minColRange = selectedCells[0].column; + var maxColRange = lastSelectedCell.column + lastSelectedCell.colspan; + var fakeColGroups = generateColGroup(house, minColRange, maxColRange); + var fakeRows = generateRows(house, minColRange, maxColRange); + return __spreadArrays(fakeColGroups, fakeRows); + }); }; var copyRows = function (table, target, generators) { - var warehouse = Warehouse.fromTable(table); - var details = onCells(warehouse, target); - return details.map(function (selectedCells) { - var grid = toGrid(warehouse, generators, false); - var rows = extractGridDetails(grid).rows; - var slicedGrid = rows.slice(selectedCells[0].row, selectedCells[selectedCells.length - 1].row + selectedCells[selectedCells.length - 1].rowspan); - var slicedDetails = toDetailList(slicedGrid, generators); - return copy$2(slicedDetails); - }); + var warehouse = Warehouse.fromTable(table); + var details = onCells(warehouse, target); + return details.map(function (selectedCells) { + var grid = toGrid(warehouse, generators, false); + var rows = extractGridDetails(grid).rows; + var slicedGrid = rows.slice(selectedCells[0].row, selectedCells[selectedCells.length - 1].row + selectedCells[selectedCells.length - 1].rowspan); + var slicedDetails = toDetailList(slicedGrid, generators); + return copy$2(slicedDetails); + }); }; var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var getTDTHOverallStyle = function (dom, elm, name) { - var cells = dom.select('td,th', elm); - var firstChildStyle; - var checkChildren = function (firstChildStyle, elms) { - for (var i = 0; i < elms.length; i++) { - var currentStyle = dom.getStyle(elms[i], name); - if (typeof firstChildStyle === 'undefined') { - firstChildStyle = currentStyle; - } - if (firstChildStyle !== currentStyle) { - return ''; - } - } - return firstChildStyle; - }; - return checkChildren(firstChildStyle, cells); + var cells = dom.select('td,th', elm); + var firstChildStyle; + var checkChildren = function (firstChildStyle, elms) { + for (var i = 0; i < elms.length; i++) { + var currentStyle = dom.getStyle(elms[i], name); + if (typeof firstChildStyle === 'undefined') { + firstChildStyle = currentStyle; + } + if (firstChildStyle !== currentStyle) { + return ''; + } + } + return firstChildStyle; + }; + return checkChildren(firstChildStyle, cells); }; var applyAlign = function (editor, elm, name) { - if (name) { - editor.formatter.apply('align' + name, {}, elm); - } + if (name) { + editor.formatter.apply('align' + name, {}, elm); + } }; var applyVAlign = function (editor, elm, name) { - if (name) { - editor.formatter.apply('valign' + name, {}, elm); - } + if (name) { + editor.formatter.apply('valign' + name, {}, elm); + } }; var unApplyAlign = function (editor, elm) { - global$1.each('left center right'.split(' '), function (name) { - editor.formatter.remove('align' + name, {}, elm); - }); + global$1.each('left center right'.split(' '), function (name) { + editor.formatter.remove('align' + name, {}, elm); + }); }; var unApplyVAlign = function (editor, elm) { - global$1.each('top middle bottom'.split(' '), function (name) { - editor.formatter.remove('valign' + name, {}, elm); - }); + global$1.each('top middle bottom'.split(' '), function (name) { + editor.formatter.remove('valign' + name, {}, elm); + }); }; var isListGroup = function (item) { - return hasNonNullableKey(item, 'menu'); + return hasNonNullableKey(item, 'menu'); }; var buildListItems = function (inputList, startItems) { - var appendItems = function (values, acc) { - return acc.concat(map(values, function (item) { - var text = item.text || item.title; - if (isListGroup(item)) { - return { - text: text, - items: buildListItems(item.menu) - }; - } else { - return { - text: text, - value: item.value - }; - } - })); - }; - return appendItems(inputList, startItems || []); + var appendItems = function (values, acc) { + return acc.concat(map(values, function (item) { + var text = item.text || item.title; + if (isListGroup(item)) { + return { + text: text, + items: buildListItems(item.menu) + }; + } else { + return { + text: text, + value: item.value + }; + } + })); + }; + return appendItems(inputList, startItems || []); }; var rgbToHex = function (dom) { - return function (value) { - return startsWith(value, 'rgb') ? dom.toHex(value) : value; - }; + return function (value) { + return startsWith(value, 'rgb') ? dom.toHex(value) : value; + }; }; var extractAdvancedStyles = function (dom, elm) { - var element = SugarElement.fromDom(elm); - return { - borderwidth: getRaw(element, 'border-width').getOr(''), - borderstyle: getRaw(element, 'border-style').getOr(''), - bordercolor: getRaw(element, 'border-color').map(rgbToHex(dom)).getOr(''), - backgroundcolor: getRaw(element, 'background-color').map(rgbToHex(dom)).getOr('') - }; + var element = SugarElement.fromDom(elm); + return { + borderwidth: getRaw(element, 'border-width').getOr(''), + borderstyle: getRaw(element, 'border-style').getOr(''), + bordercolor: getRaw(element, 'border-color').map(rgbToHex(dom)).getOr(''), + backgroundcolor: getRaw(element, 'background-color').map(rgbToHex(dom)).getOr('') + }; }; var getSharedValues = function (data) { - var baseData = data[0]; - var comparisonData = data.slice(1); - each(comparisonData, function (items) { - each(keys(baseData), function (key) { - each$1(items, function (itemValue, itemKey) { - var comparisonValue = baseData[key]; - if (comparisonValue !== '' && key === itemKey) { - if (comparisonValue !== itemValue) { - baseData[key] = ''; - } - } - }); - }); - }); - return baseData; + var baseData = data[0]; + var comparisonData = data.slice(1); + each(comparisonData, function (items) { + each(keys(baseData), function (key) { + each$1(items, function (itemValue, itemKey) { + var comparisonValue = baseData[key]; + if (comparisonValue !== '' && key === itemKey) { + if (comparisonValue !== itemValue) { + baseData[key] = ''; + } + } + }); + }); + }); + return baseData; }; var getAdvancedTab = function (dialogName) { - var advTabItems = [ + var advTabItems = [ + { + name: 'borderstyle', + type: 'listbox', + label: 'Border style', + items: [ + { + text: 'Select...', + value: '' + }, + { + text: 'Solid', + value: 'solid' + }, + { + text: 'Dotted', + value: 'dotted' + }, + { + text: 'Dashed', + value: 'dashed' + }, + { + text: 'Double', + value: 'double' + }, + { + text: 'Groove', + value: 'groove' + }, + { + text: 'Ridge', + value: 'ridge' + }, + { + text: 'Inset', + value: 'inset' + }, { - name: 'borderstyle', - type: 'listbox', - label: 'Border style', - items: [ - { - text: 'Select...', - value: '' - }, - { - text: 'Solid', - value: 'solid' - }, - { - text: 'Dotted', - value: 'dotted' - }, - { - text: 'Dashed', - value: 'dashed' - }, - { - text: 'Double', - value: 'double' - }, - { - text: 'Groove', - value: 'groove' - }, - { - text: 'Ridge', - value: 'ridge' - }, - { - text: 'Inset', - value: 'inset' - }, - { - text: 'Outset', - value: 'outset' - }, - { - text: 'None', - value: 'none' - }, - { - text: 'Hidden', - value: 'hidden' - } - ] + text: 'Outset', + value: 'outset' }, { - name: 'bordercolor', - type: 'colorinput', - label: 'Border color' + text: 'None', + value: 'none' }, { - name: 'backgroundcolor', - type: 'colorinput', - label: 'Background color' + text: 'Hidden', + value: 'hidden' } - ]; - var borderWidth = { - name: 'borderwidth', - type: 'input', - label: 'Border width' - }; - var items = dialogName === 'cell' ? [borderWidth].concat(advTabItems) : advTabItems; - return { - title: 'Advanced', - name: 'advanced', - items: items - }; + ] + }, + { + name: 'bordercolor', + type: 'colorinput', + label: 'Border color' + }, + { + name: 'backgroundcolor', + type: 'colorinput', + label: 'Background color' + } + ]; + var borderWidth = { + name: 'borderwidth', + type: 'input', + label: 'Border width' + }; + var items = dialogName === 'cell' ? [borderWidth].concat(advTabItems) : advTabItems; + return { + title: 'Advanced', + name: 'advanced', + items: items + }; }; var getAlignment = function (formats, formatName, editor, elm) { - return find(formats, function (name) { - return editor.formatter.matchNode(elm, formatName + name); - }).getOr(''); + return find(formats, function (name) { + return editor.formatter.matchNode(elm, formatName + name); + }).getOr(''); }; var getHAlignment = curry(getAlignment, [ - 'left', - 'center', - 'right' + 'left', + 'center', + 'right' ], 'align'); var getVAlignment = curry(getAlignment, [ - 'top', - 'middle', - 'bottom' + 'top', + 'middle', + 'bottom' ], 'valign'); var extractDataFromSettings = function (editor, hasAdvTableTab) { - var style = getDefaultStyles(editor); - var attrs = getDefaultAttributes(editor); - var extractAdvancedStyleData = function (dom) { - return { - borderstyle: get$1(style, 'border-style').getOr(''), - bordercolor: rgbToHex(dom)(get$1(style, 'border-color').getOr('')), - backgroundcolor: rgbToHex(dom)(get$1(style, 'background-color').getOr('')) - }; - }; - var defaultData = { - height: '', - width: '100%', - cellspacing: '', - cellpadding: '', - caption: false, - class: '', - align: '', - border: '' - }; - var getBorder = function () { - var borderWidth = style['border-width']; - if (shouldStyleWithCss(editor) && borderWidth) { - return {border: borderWidth}; - } - return get$1(attrs, 'border').fold(function () { - return {}; - }, function (border) { - return {border: border}; - }); - }; - var advStyle = hasAdvTableTab ? extractAdvancedStyleData(editor.dom) : {}; - var getCellPaddingCellSpacing = function () { - var spacing = get$1(style, 'border-spacing').or(get$1(attrs, 'cellspacing')).fold(function () { - return {}; - }, function (cellspacing) { - return {cellspacing: cellspacing}; - }); - var padding = get$1(style, 'border-padding').or(get$1(attrs, 'cellpadding')).fold(function () { - return {}; - }, function (cellpadding) { - return {cellpadding: cellpadding}; - }); - return __assign(__assign({}, spacing), padding); - }; - var data = __assign(__assign(__assign(__assign(__assign(__assign({}, defaultData), style), attrs), advStyle), getBorder()), getCellPaddingCellSpacing()); - return data; + var style = getDefaultStyles(editor); + var attrs = getDefaultAttributes(editor); + var extractAdvancedStyleData = function (dom) { + return { + borderstyle: get$1(style, 'border-style').getOr(''), + bordercolor: rgbToHex(dom)(get$1(style, 'border-color').getOr('')), + backgroundcolor: rgbToHex(dom)(get$1(style, 'background-color').getOr('')) + }; + }; + var defaultData = { + height: '', + width: '100%', + cellspacing: '', + cellpadding: '', + caption: false, + class: '', + align: '', + border: '' + }; + var getBorder = function () { + var borderWidth = style['border-width']; + if (shouldStyleWithCss(editor) && borderWidth) { + return { border: borderWidth }; + } + return get$1(attrs, 'border').fold(function () { + return {}; + }, function (border) { + return { border: border }; + }); + }; + var advStyle = hasAdvTableTab ? extractAdvancedStyleData(editor.dom) : {}; + var getCellPaddingCellSpacing = function () { + var spacing = get$1(style, 'border-spacing').or(get$1(attrs, 'cellspacing')).fold(function () { + return {}; + }, function (cellspacing) { + return { cellspacing: cellspacing }; + }); + var padding = get$1(style, 'border-padding').or(get$1(attrs, 'cellpadding')).fold(function () { + return {}; + }, function (cellpadding) { + return { cellpadding: cellpadding }; + }); + return __assign(__assign({}, spacing), padding); + }; + var data = __assign(__assign(__assign(__assign(__assign(__assign({}, defaultData), style), attrs), advStyle), getBorder()), getCellPaddingCellSpacing()); + return data; }; var extractDataFromTableElement = function (editor, elm, hasAdvTableTab) { - var getBorder = function (dom, elm) { - var optBorderWidth = getRaw(SugarElement.fromDom(elm), 'border-width'); - if (shouldStyleWithCss(editor) && optBorderWidth.isSome()) { - return optBorderWidth.getOr(''); - } - return dom.getAttrib(elm, 'border') || getTDTHOverallStyle(editor.dom, elm, 'border-width') || getTDTHOverallStyle(editor.dom, elm, 'border'); - }; - var dom = editor.dom; - return __assign({ - width: dom.getStyle(elm, 'width') || dom.getAttrib(elm, 'width'), - height: dom.getStyle(elm, 'height') || dom.getAttrib(elm, 'height'), - cellspacing: dom.getStyle(elm, 'border-spacing') || dom.getAttrib(elm, 'cellspacing'), - cellpadding: dom.getAttrib(elm, 'cellpadding') || getTDTHOverallStyle(editor.dom, elm, 'padding'), - border: getBorder(dom, elm), - caption: !!dom.select('caption', elm)[0], - class: dom.getAttrib(elm, 'class', ''), - align: getHAlignment(editor, elm) - }, hasAdvTableTab ? extractAdvancedStyles(dom, elm) : {}); + var getBorder = function (dom, elm) { + var optBorderWidth = getRaw(SugarElement.fromDom(elm), 'border-width'); + if (shouldStyleWithCss(editor) && optBorderWidth.isSome()) { + return optBorderWidth.getOr(''); + } + return dom.getAttrib(elm, 'border') || getTDTHOverallStyle(editor.dom, elm, 'border-width') || getTDTHOverallStyle(editor.dom, elm, 'border'); + }; + var dom = editor.dom; + return __assign({ + width: dom.getStyle(elm, 'width') || dom.getAttrib(elm, 'width'), + height: dom.getStyle(elm, 'height') || dom.getAttrib(elm, 'height'), + cellspacing: dom.getStyle(elm, 'border-spacing') || dom.getAttrib(elm, 'cellspacing'), + cellpadding: dom.getAttrib(elm, 'cellpadding') || getTDTHOverallStyle(editor.dom, elm, 'padding'), + border: getBorder(dom, elm), + caption: !!dom.select('caption', elm)[0], + class: dom.getAttrib(elm, 'class', ''), + align: getHAlignment(editor, elm) + }, hasAdvTableTab ? extractAdvancedStyles(dom, elm) : {}); }; var extractDataFromRowElement = function (editor, elm, hasAdvancedRowTab) { - var dom = editor.dom; - return __assign({ - height: dom.getStyle(elm, 'height') || dom.getAttrib(elm, 'height'), - scope: dom.getAttrib(elm, 'scope'), - class: dom.getAttrib(elm, 'class', ''), - type: getRowType(editor, elm), - align: getHAlignment(editor, elm) - }, hasAdvancedRowTab ? extractAdvancedStyles(dom, elm) : {}); + var dom = editor.dom; + return __assign({ + height: dom.getStyle(elm, 'height') || dom.getAttrib(elm, 'height'), + scope: dom.getAttrib(elm, 'scope'), + class: dom.getAttrib(elm, 'class', ''), + type: getRowType(editor, elm), + align: getHAlignment(editor, elm) + }, hasAdvancedRowTab ? extractAdvancedStyles(dom, elm) : {}); }; var extractDataFromCellElement = function (editor, cell, hasAdvancedCellTab, column) { - var dom = editor.dom; - var colElm = column.getOr(cell); - var getStyle = function (element, style) { - return dom.getStyle(element, style) || dom.getAttrib(element, style); - }; - return __assign({ - width: getStyle(colElm, 'width'), - height: getStyle(cell, 'height'), - scope: dom.getAttrib(cell, 'scope'), - celltype: getNodeName(cell), - class: dom.getAttrib(cell, 'class', ''), - halign: getHAlignment(editor, cell), - valign: getVAlignment(editor, cell) - }, hasAdvancedCellTab ? extractAdvancedStyles(dom, cell) : {}); + var dom = editor.dom; + var colElm = column.getOr(cell); + var getStyle = function (element, style) { + return dom.getStyle(element, style) || dom.getAttrib(element, style); + }; + return __assign({ + width: getStyle(colElm, 'width'), + height: getStyle(cell, 'height'), + scope: dom.getAttrib(cell, 'scope'), + celltype: getNodeName(cell), + class: dom.getAttrib(cell, 'class', ''), + halign: getHAlignment(editor, cell), + valign: getVAlignment(editor, cell) + }, hasAdvancedCellTab ? extractAdvancedStyles(dom, cell) : {}); }; var getClassList = function (editor) { - var classes = buildListItems(getCellClassList(editor)); - if (classes.length > 0) { - return Optional.some({ - name: 'class', - type: 'listbox', - label: 'Class', - items: classes - }); - } - return Optional.none(); + var classes = buildListItems(getCellClassList(editor)); + if (classes.length > 0) { + return Optional.some({ + name: 'class', + type: 'listbox', + label: 'Class', + items: classes + }); + } + return Optional.none(); }; var children$3 = [ - { - name: 'width', - type: 'input', - label: 'Width' - }, - { - name: 'height', - type: 'input', - label: 'Height' - }, - { - name: 'celltype', - type: 'listbox', - label: 'Cell type', - items: [ - { - text: 'Cell', - value: 'td' - }, - { - text: 'Header cell', - value: 'th' - } - ] - }, - { - name: 'scope', - type: 'listbox', - label: 'Scope', - items: [ - { - text: 'None', - value: '' - }, - { - text: 'Row', - value: 'row' - }, - { - text: 'Column', - value: 'col' - }, - { - text: 'Row group', - value: 'rowgroup' - }, - { - text: 'Column group', - value: 'colgroup' - } - ] - }, - { - name: 'halign', - type: 'listbox', - label: 'H Align', - items: [ - { - text: 'None', - value: '' - }, - { - text: 'Left', - value: 'left' - }, - { - text: 'Center', - value: 'center' - }, - { - text: 'Right', - value: 'right' - } - ] - }, - { - name: 'valign', - type: 'listbox', - label: 'V Align', - items: [ - { - text: 'None', - value: '' - }, - { - text: 'Top', - value: 'top' - }, - { - text: 'Middle', - value: 'middle' - }, - { - text: 'Bottom', - value: 'bottom' - } - ] - } + { + name: 'width', + type: 'input', + label: 'Width' + }, + { + name: 'height', + type: 'input', + label: 'Height' + }, + { + name: 'celltype', + type: 'listbox', + label: 'Cell type', + items: [ + { + text: 'Cell', + value: 'td' + }, + { + text: 'Header cell', + value: 'th' + } + ] + }, + { + name: 'scope', + type: 'listbox', + label: 'Scope', + items: [ + { + text: 'None', + value: '' + }, + { + text: 'Row', + value: 'row' + }, + { + text: 'Column', + value: 'col' + }, + { + text: 'Row group', + value: 'rowgroup' + }, + { + text: 'Column group', + value: 'colgroup' + } + ] + }, + { + name: 'halign', + type: 'listbox', + label: 'H Align', + items: [ + { + text: 'None', + value: '' + }, + { + text: 'Left', + value: 'left' + }, + { + text: 'Center', + value: 'center' + }, + { + text: 'Right', + value: 'right' + } + ] + }, + { + name: 'valign', + type: 'listbox', + label: 'V Align', + items: [ + { + text: 'None', + value: '' + }, + { + text: 'Top', + value: 'top' + }, + { + text: 'Middle', + value: 'middle' + }, + { + text: 'Bottom', + value: 'bottom' + } + ] + } ]; var getItems = function (editor) { - return children$3.concat(getClassList(editor).toArray()); + return children$3.concat(getClassList(editor).toArray()); }; var modifiers = function (testTruthy) { - return function (editor, node) { - var dom = editor.dom; - var setAttrib = function (attr, value) { - if (!testTruthy || value) { - dom.setAttrib(node, attr, value); - } - }; - var setStyle = function (prop, value) { - if (!testTruthy || value) { - dom.setStyle(node, prop, value); - } - }; - var setFormat = function (formatName, value) { - if (!testTruthy || value) { - if (value === '') { - editor.formatter.remove(formatName, {value: null}, node, true); - } else { - editor.formatter.apply(formatName, {value: value}, node); - } - } - }; - return { - setAttrib: setAttrib, - setStyle: setStyle, - setFormat: setFormat - }; + return function (editor, node) { + var dom = editor.dom; + var setAttrib = function (attr, value) { + if (!testTruthy || value) { + dom.setAttrib(node, attr, value); + } + }; + var setStyle = function (prop, value) { + if (!testTruthy || value) { + dom.setStyle(node, prop, value); + } + }; + var setFormat = function (formatName, value) { + if (!testTruthy || value) { + if (value === '') { + editor.formatter.remove(formatName, { value: null }, node, true); + } else { + editor.formatter.apply(formatName, { value: value }, node); + } + } }; + return { + setAttrib: setAttrib, + setStyle: setStyle, + setFormat: setFormat + }; + }; }; var DomModifier = { - normal: modifiers(false), - ifTruthy: modifiers(true) + normal: modifiers(false), + ifTruthy: modifiers(true) }; var getSelectedCells = function (cells) { - return table(cells[0]).map(function (table) { - var warehouse = Warehouse.fromTable(table); - var allCells = Warehouse.justCells(warehouse); - var filtered = filter(allCells, function (cellA) { - return exists(cells, function (cellB) { - return eq$1(cellA.element, cellB); - }); - }); - return map(filtered, function (cell) { - return { - element: cell.element.dom, - column: Warehouse.getColumnAt(warehouse, cell.column).map(function (col) { - return col.element.dom; - }) - }; - }); - }); + return table(cells[0]).map(function (table) { + var warehouse = Warehouse.fromTable(table); + var allCells = Warehouse.justCells(warehouse); + var filtered = filter(allCells, function (cellA) { + return exists(cells, function (cellB) { + return eq$1(cellA.element, cellB); + }); + }); + return map(filtered, function (cell) { + return { + element: cell.element.dom, + column: Warehouse.getColumnAt(warehouse, cell.column).map(function (col) { + return col.element.dom; + }) + }; + }); + }); }; var updateSimpleProps = function (modifier, colModifier, data) { - modifier.setAttrib('scope', data.scope); - modifier.setAttrib('class', data.class); - modifier.setStyle('height', addPxSuffix(data.height)); - colModifier.setStyle('width', addPxSuffix(data.width)); + modifier.setAttrib('scope', data.scope); + modifier.setAttrib('class', data.class); + modifier.setStyle('height', addPxSuffix(data.height)); + colModifier.setStyle('width', addPxSuffix(data.width)); }; var updateAdvancedProps = function (modifier, data) { - modifier.setFormat('tablecellbackgroundcolor', data.backgroundcolor); - modifier.setFormat('tablecellbordercolor', data.bordercolor); - modifier.setFormat('tablecellborderstyle', data.borderstyle); - modifier.setFormat('tablecellborderwidth', addPxSuffix(data.borderwidth)); + modifier.setFormat('tablecellbackgroundcolor', data.backgroundcolor); + modifier.setFormat('tablecellbordercolor', data.bordercolor); + modifier.setFormat('tablecellborderstyle', data.borderstyle); + modifier.setFormat('tablecellborderwidth', addPxSuffix(data.borderwidth)); }; var applyCellData = function (editor, cells, data) { - var isSingleCell = cells.length === 1; - if (cells.length >= 1) { - var tableOpt = table(cells[0]); - getSelectedCells(cells).each(function (selectedCells) { - each(selectedCells, function (item) { - var cellElm = switchCellType(editor, item.element, data.celltype); - var modifier = isSingleCell ? DomModifier.normal(editor, cellElm) : DomModifier.ifTruthy(editor, cellElm); - var colModifier = item.column.map(function (col) { - return isSingleCell ? DomModifier.normal(editor, col) : DomModifier.ifTruthy(editor, col); - }).getOr(modifier); - updateSimpleProps(modifier, colModifier, data); - if (hasAdvancedCellTab(editor)) { - updateAdvancedProps(modifier, data); - } - if (isSingleCell) { - unApplyAlign(editor, cellElm); - unApplyVAlign(editor, cellElm); - } - if (data.halign) { - applyAlign(editor, cellElm, data.halign); - } - if (data.valign) { - applyVAlign(editor, cellElm, data.valign); - } - }); - }); - tableOpt.each(function (table) { - return fireTableModified(editor, table.dom); - }); - } + var isSingleCell = cells.length === 1; + if (cells.length >= 1) { + var tableOpt = table(cells[0]); + getSelectedCells(cells).each(function (selectedCells) { + each(selectedCells, function (item) { + var cellElm = switchCellType(editor, item.element, data.celltype); + var modifier = isSingleCell ? DomModifier.normal(editor, cellElm) : DomModifier.ifTruthy(editor, cellElm); + var colModifier = item.column.map(function (col) { + return isSingleCell ? DomModifier.normal(editor, col) : DomModifier.ifTruthy(editor, col); + }).getOr(modifier); + updateSimpleProps(modifier, colModifier, data); + if (hasAdvancedCellTab(editor)) { + updateAdvancedProps(modifier, data); + } + if (isSingleCell) { + unApplyAlign(editor, cellElm); + unApplyVAlign(editor, cellElm); + } + if (data.halign) { + applyAlign(editor, cellElm, data.halign); + } + if (data.valign) { + applyVAlign(editor, cellElm, data.valign); + } + }); + }); + tableOpt.each(function (table) { + return fireTableModified(editor, table.dom); + }); + } }; var onSubmitCellForm = function (editor, cells, api) { - var data = api.getData(); - api.close(); - editor.undoManager.transact(function () { - applyCellData(editor, cells, data); - editor.focus(); - }); + var data = api.getData(); + api.close(); + editor.undoManager.transact(function () { + applyCellData(editor, cells, data); + editor.focus(); + }); }; var getData = function (editor, cells) { - var cellsData = getSelectedCells(cells).map(function (selectedCells) { - return map(selectedCells, function (item) { - return extractDataFromCellElement(editor, item.element, hasAdvancedCellTab(editor), item.column); - }); + var cellsData = getSelectedCells(cells).map(function (selectedCells) { + return map(selectedCells, function (item) { + return extractDataFromCellElement(editor, item.element, hasAdvancedCellTab(editor), item.column); }); - return getSharedValues(cellsData.getOrDie()); + }); + return getSharedValues(cellsData.getOrDie()); }; var open = function (editor, selections) { - var cells = getCellsFromSelection(getSelectionStart(editor), selections); - if (cells.length === 0) { - return; - } - var data = getData(editor, cells); - var dialogTabPanel = { - type: 'tabpanel', - tabs: [ - { - title: 'General', - name: 'general', - items: getItems(editor) - }, - getAdvancedTab('cell') - ] - }; - var dialogPanel = { - type: 'panel', - items: [{ - type: 'grid', - columns: 2, - items: getItems(editor) - }] - }; - editor.windowManager.open({ - title: 'Cell Properties', - size: 'normal', - body: hasAdvancedCellTab(editor) ? dialogTabPanel : dialogPanel, - buttons: [ - { - type: 'cancel', - name: 'cancel', - text: 'Cancel' - }, - { - type: 'submit', - name: 'save', - text: 'Save', - primary: true - } - ], - initialData: data, - onSubmit: curry(onSubmitCellForm, editor, cells) - }); + var cells = getCellsFromSelection(getSelectionStart(editor), selections); + if (cells.length === 0) { + return; + } + var data = getData(editor, cells); + var dialogTabPanel = { + type: 'tabpanel', + tabs: [ + { + title: 'General', + name: 'general', + items: getItems(editor) + }, + getAdvancedTab('cell') + ] + }; + var dialogPanel = { + type: 'panel', + items: [{ + type: 'grid', + columns: 2, + items: getItems(editor) + }] + }; + editor.windowManager.open({ + title: 'Cell Properties', + size: 'normal', + body: hasAdvancedCellTab(editor) ? dialogTabPanel : dialogPanel, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: data, + onSubmit: curry(onSubmitCellForm, editor, cells) + }); }; var getClassList$1 = function (editor) { - var classes = buildListItems(getRowClassList(editor)); - if (classes.length > 0) { - return Optional.some({ - name: 'class', - type: 'listbox', - label: 'Class', - items: classes - }); - } - return Optional.none(); + var classes = buildListItems(getRowClassList(editor)); + if (classes.length > 0) { + return Optional.some({ + name: 'class', + type: 'listbox', + label: 'Class', + items: classes + }); + } + return Optional.none(); }; var formChildren = [ - { - type: 'listbox', - name: 'type', - label: 'Row type', - items: [ - { - text: 'Header', - value: 'header' - }, - { - text: 'Body', - value: 'body' - }, - { - text: 'Footer', - value: 'footer' - } - ] - }, - { - type: 'listbox', - name: 'align', - label: 'Alignment', - items: [ - { - text: 'None', - value: '' - }, - { - text: 'Left', - value: 'left' - }, - { - text: 'Center', - value: 'center' - }, - { - text: 'Right', - value: 'right' - } - ] - }, - { - label: 'Height', - name: 'height', - type: 'input' - } + { + type: 'listbox', + name: 'type', + label: 'Row type', + items: [ + { + text: 'Header', + value: 'header' + }, + { + text: 'Body', + value: 'body' + }, + { + text: 'Footer', + value: 'footer' + } + ] + }, + { + type: 'listbox', + name: 'align', + label: 'Alignment', + items: [ + { + text: 'None', + value: '' + }, + { + text: 'Left', + value: 'left' + }, + { + text: 'Center', + value: 'center' + }, + { + text: 'Right', + value: 'right' + } + ] + }, + { + label: 'Height', + name: 'height', + type: 'input' + } ]; var getItems$1 = function (editor) { - return formChildren.concat(getClassList$1(editor).toArray()); + return formChildren.concat(getClassList$1(editor).toArray()); }; var updateSimpleProps$1 = function (modifier, data) { - modifier.setAttrib('scope', data.scope); - modifier.setAttrib('class', data.class); - modifier.setStyle('height', addPxSuffix(data.height)); + modifier.setAttrib('scope', data.scope); + modifier.setAttrib('class', data.class); + modifier.setStyle('height', addPxSuffix(data.height)); }; var updateAdvancedProps$1 = function (modifier, data) { - modifier.setStyle('background-color', data.backgroundcolor); - modifier.setStyle('border-color', data.bordercolor); - modifier.setStyle('border-style', data.borderstyle); + modifier.setStyle('background-color', data.backgroundcolor); + modifier.setStyle('border-color', data.bordercolor); + modifier.setStyle('border-style', data.borderstyle); }; var applyRowData = function (editor, rows, oldData, data) { - var isSingleRow = rows.length === 1; - each(rows, function (rowElm) { - if (data.type !== getNodeName(rowElm.parentNode)) { - switchSectionType(editor, rowElm, data.type); - } - var modifier = isSingleRow ? DomModifier.normal(editor, rowElm) : DomModifier.ifTruthy(editor, rowElm); - updateSimpleProps$1(modifier, data); - if (hasAdvancedRowTab(editor)) { - updateAdvancedProps$1(modifier, data); - } - if (data.align !== oldData.align) { - unApplyAlign(editor, rowElm); - applyAlign(editor, rowElm, data.align); - } - }); - table(SugarElement.fromDom(rows[0])).each(function (table) { - return fireTableModified(editor, table.dom); - }); - }; + var isSingleRow = rows.length === 1; + each(rows, function (rowElm) { + if (data.type !== getNodeName(rowElm.parentNode)) { + switchSectionType(editor, rowElm, data.type); + } + var modifier = isSingleRow ? DomModifier.normal(editor, rowElm) : DomModifier.ifTruthy(editor, rowElm); + updateSimpleProps$1(modifier, data); + if (hasAdvancedRowTab(editor)) { + updateAdvancedProps$1(modifier, data); + } + if (data.align !== oldData.align) { + unApplyAlign(editor, rowElm); + applyAlign(editor, rowElm, data.align); + } + }); + table(SugarElement.fromDom(rows[0])).each(function (table) { + return fireTableModified(editor, table.dom); + }); + }; var onSubmitRowForm = function (editor, rows, oldData, api) { - var data = api.getData(); - api.close(); - editor.undoManager.transact(function () { - applyRowData(editor, rows, oldData, data); - editor.focus(); - }); + var data = api.getData(); + api.close(); + editor.undoManager.transact(function () { + applyRowData(editor, rows, oldData, data); + editor.focus(); + }); }; var open$1 = function (editor) { - var rows = getRowsFromSelection(getSelectionStart(editor), ephemera.selected); - if (rows.length === 0) { - return; - } - var rowsData = map(rows, function (rowElm) { - return extractDataFromRowElement(editor, rowElm.dom, hasAdvancedRowTab(editor)); - }); - var data = getSharedValues(rowsData); - var dialogTabPanel = { - type: 'tabpanel', - tabs: [ - { - title: 'General', - name: 'general', - items: getItems$1(editor) - }, - getAdvancedTab('row') - ] - }; - var dialogPanel = { - type: 'panel', - items: [{ - type: 'grid', - columns: 2, - items: getItems$1(editor) - }] - }; - editor.windowManager.open({ - title: 'Row Properties', - size: 'normal', - body: hasAdvancedRowTab(editor) ? dialogTabPanel : dialogPanel, - buttons: [ - { - type: 'cancel', - name: 'cancel', - text: 'Cancel' - }, - { - type: 'submit', - name: 'save', - text: 'Save', - primary: true - } - ], - initialData: data, - onSubmit: curry(onSubmitRowForm, editor, map(rows, function (r) { - return r.dom; - }), data) - }); + var rows = getRowsFromSelection(getSelectionStart(editor), ephemera.selected); + if (rows.length === 0) { + return; + } + var rowsData = map(rows, function (rowElm) { + return extractDataFromRowElement(editor, rowElm.dom, hasAdvancedRowTab(editor)); + }); + var data = getSharedValues(rowsData); + var dialogTabPanel = { + type: 'tabpanel', + tabs: [ + { + title: 'General', + name: 'general', + items: getItems$1(editor) + }, + getAdvancedTab('row') + ] + }; + var dialogPanel = { + type: 'panel', + items: [{ + type: 'grid', + columns: 2, + items: getItems$1(editor) + }] + }; + editor.windowManager.open({ + title: 'Row Properties', + size: 'normal', + body: hasAdvancedRowTab(editor) ? dialogTabPanel : dialogPanel, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: data, + onSubmit: curry(onSubmitRowForm, editor, map(rows, function (r) { + return r.dom; + }), data) + }); }; var global$2 = tinymce.util.Tools.resolve('tinymce.Env'); var getItems$2 = function (editor, classes, insertNewTable) { - var rowColCountItems = !insertNewTable ? [] : [ - { - type: 'input', - name: 'cols', - label: 'Cols', - inputMode: 'numeric' - }, - { - type: 'input', - name: 'rows', - label: 'Rows', - inputMode: 'numeric' - } - ]; - var alwaysItems = [ - { - type: 'input', - name: 'width', - label: 'Width' - }, - { - type: 'input', - name: 'height', - label: 'Height' - } - ]; - var appearanceItems = hasAppearanceOptions(editor) ? [ + var rowColCountItems = !insertNewTable ? [] : [ + { + type: 'input', + name: 'cols', + label: 'Cols', + inputMode: 'numeric' + }, + { + type: 'input', + name: 'rows', + label: 'Rows', + inputMode: 'numeric' + } + ]; + var alwaysItems = [ + { + type: 'input', + name: 'width', + label: 'Width' + }, + { + type: 'input', + name: 'height', + label: 'Height' + } + ]; + var appearanceItems = hasAppearanceOptions(editor) ? [ + { + type: 'input', + name: 'cellspacing', + label: 'Cell spacing', + inputMode: 'numeric' + }, + { + type: 'input', + name: 'cellpadding', + label: 'Cell padding', + inputMode: 'numeric' + }, + { + type: 'input', + name: 'border', + label: 'Border width' + }, + { + type: 'label', + label: 'Caption', + items: [{ + type: 'checkbox', + name: 'caption', + label: 'Show caption' + }] + } + ] : []; + var alignmentItem = [{ + type: 'listbox', + name: 'align', + label: 'Alignment', + items: [ { - type: 'input', - name: 'cellspacing', - label: 'Cell spacing', - inputMode: 'numeric' + text: 'None', + value: '' }, { - type: 'input', - name: 'cellpadding', - label: 'Cell padding', - inputMode: 'numeric' + text: 'Left', + value: 'left' }, { - type: 'input', - name: 'border', - label: 'Border width' + text: 'Center', + value: 'center' }, { - type: 'label', - label: 'Caption', - items: [{ - type: 'checkbox', - name: 'caption', - label: 'Show caption' - }] + text: 'Right', + value: 'right' } - ] : []; - var alignmentItem = [{ - type: 'listbox', - name: 'align', - label: 'Alignment', - items: [ - { - text: 'None', - value: '' - }, - { - text: 'Left', - value: 'left' - }, - { - text: 'Center', - value: 'center' - }, - { - text: 'Right', - value: 'right' - } - ] + ] }]; - var classListItem = classes.length > 0 ? [{ - type: 'listbox', - name: 'class', - label: 'Class', - items: classes + var classListItem = classes.length > 0 ? [{ + type: 'listbox', + name: 'class', + label: 'Class', + items: classes }] : []; - return rowColCountItems.concat(alwaysItems).concat(appearanceItems).concat(alignmentItem).concat(classListItem); + return rowColCountItems.concat(alwaysItems).concat(appearanceItems).concat(alignmentItem).concat(classListItem); }; var styleTDTH = function (dom, elm, name, value) { - if (elm.tagName === 'TD' || elm.tagName === 'TH') { - if (isString(name)) { - dom.setStyle(elm, name, value); - } else { - dom.setStyle(elm, name); - } + if (elm.tagName === 'TD' || elm.tagName === 'TH') { + if (isString(name)) { + dom.setStyle(elm, name, value); } else { - if (elm.children) { - for (var i = 0; i < elm.children.length; i++) { - styleTDTH(dom, elm.children[i], name, value); - } - } + dom.setStyle(elm, name); + } + } else { + if (elm.children) { + for (var i = 0; i < elm.children.length; i++) { + styleTDTH(dom, elm.children[i], name, value); + } } + } }; var applyDataToElement = function (editor, tableElm, data) { - var dom = editor.dom; - var attrs = {}; - var styles = {}; - attrs.class = data.class; - styles.height = addPxSuffix(data.height); - if (dom.getAttrib(tableElm, 'width') && !shouldStyleWithCss(editor)) { - attrs.width = removePxSuffix(data.width); - } else { - styles.width = addPxSuffix(data.width); - } - if (shouldStyleWithCss(editor)) { - styles['border-width'] = addPxSuffix(data.border); - styles['border-spacing'] = addPxSuffix(data.cellspacing); - } else { - attrs.border = data.border; - attrs.cellpadding = data.cellpadding; - attrs.cellspacing = data.cellspacing; - } - if (shouldStyleWithCss(editor) && tableElm.children) { - for (var i = 0; i < tableElm.children.length; i++) { - styleTDTH(dom, tableElm.children[i], { - 'border-width': addPxSuffix(data.border), - 'padding': addPxSuffix(data.cellpadding) - }); - if (hasAdvancedTableTab(editor)) { - styleTDTH(dom, tableElm.children[i], {'border-color': data.bordercolor}); - } - } - } - if (hasAdvancedTableTab(editor)) { - styles['background-color'] = data.backgroundcolor; - styles['border-color'] = data.bordercolor; - styles['border-style'] = data.borderstyle; - } - attrs.style = dom.serializeStyle(__assign(__assign({}, getDefaultStyles(editor)), styles)); - dom.setAttribs(tableElm, __assign(__assign({}, getDefaultAttributes(editor)), attrs)); - fireTableModified(editor, tableElm); + var dom = editor.dom; + var attrs = {}; + var styles = {}; + attrs.class = data.class; + styles.height = addPxSuffix(data.height); + if (dom.getAttrib(tableElm, 'width') && !shouldStyleWithCss(editor)) { + attrs.width = removePxSuffix(data.width); + } else { + styles.width = addPxSuffix(data.width); + } + if (shouldStyleWithCss(editor)) { + styles['border-width'] = addPxSuffix(data.border); + styles['border-spacing'] = addPxSuffix(data.cellspacing); + } else { + attrs.border = data.border; + attrs.cellpadding = data.cellpadding; + attrs.cellspacing = data.cellspacing; + } + if (shouldStyleWithCss(editor) && tableElm.children) { + for (var i = 0; i < tableElm.children.length; i++) { + styleTDTH(dom, tableElm.children[i], { + 'border-width': addPxSuffix(data.border), + 'padding': addPxSuffix(data.cellpadding) + }); + if (hasAdvancedTableTab(editor)) { + styleTDTH(dom, tableElm.children[i], { 'border-color': data.bordercolor }); + } + } + } + if (hasAdvancedTableTab(editor)) { + styles['background-color'] = data.backgroundcolor; + styles['border-color'] = data.bordercolor; + styles['border-style'] = data.borderstyle; + } + attrs.style = dom.serializeStyle(__assign(__assign({}, getDefaultStyles(editor)), styles)); + dom.setAttribs(tableElm, __assign(__assign({}, getDefaultAttributes(editor)), attrs)); + fireTableModified(editor, tableElm); }; var onSubmitTableForm = function (editor, tableElm, api) { - var dom = editor.dom; - var captionElm; - var data = api.getData(); - api.close(); - if (data.class === '') { - delete data.class; - } - editor.undoManager.transact(function () { - if (!tableElm) { - var cols = parseInt(data.cols, 10) || 1; - var rows = parseInt(data.rows, 10) || 1; - tableElm = insert$1(editor, cols, rows, 0, 0); - } - applyDataToElement(editor, tableElm, data); - captionElm = dom.select('caption', tableElm)[0]; - if (captionElm && !data.caption) { - dom.remove(captionElm); - } - if (!captionElm && data.caption) { - captionElm = dom.create('caption'); - captionElm.innerHTML = !global$2.ie ? '
              ' : nbsp; - tableElm.insertBefore(captionElm, tableElm.firstChild); - } - if (data.align === '') { - unApplyAlign(editor, tableElm); - } else { - applyAlign(editor, tableElm, data.align); - } - editor.focus(); - editor.addVisual(); - }); + var dom = editor.dom; + var captionElm; + var data = api.getData(); + api.close(); + if (data.class === '') { + delete data.class; + } + editor.undoManager.transact(function () { + if (!tableElm) { + var cols = parseInt(data.cols, 10) || 1; + var rows = parseInt(data.rows, 10) || 1; + tableElm = insert$1(editor, cols, rows, 0, 0); + } + applyDataToElement(editor, tableElm, data); + captionElm = dom.select('caption', tableElm)[0]; + if (captionElm && !data.caption) { + dom.remove(captionElm); + } + if (!captionElm && data.caption) { + captionElm = dom.create('caption'); + captionElm.innerHTML = !global$2.ie ? '
              ' : nbsp; + tableElm.insertBefore(captionElm, tableElm.firstChild); + } + if (data.align === '') { + unApplyAlign(editor, tableElm); + } else { + applyAlign(editor, tableElm, data.align); + } + editor.focus(); + editor.addVisual(); + }); }; var open$2 = function (editor, insertNewTable) { - var dom = editor.dom; - var tableElm; - var data = extractDataFromSettings(editor, hasAdvancedTableTab(editor)); - if (insertNewTable === false) { - tableElm = dom.getParent(editor.selection.getStart(), 'table'); - if (tableElm) { - data = extractDataFromTableElement(editor, tableElm, hasAdvancedTableTab(editor)); - } else { - if (hasAdvancedTableTab(editor)) { - data.borderstyle = ''; - data.bordercolor = ''; - data.backgroundcolor = ''; - } - } + var dom = editor.dom; + var tableElm; + var data = extractDataFromSettings(editor, hasAdvancedTableTab(editor)); + if (insertNewTable === false) { + tableElm = dom.getParent(editor.selection.getStart(), 'table'); + if (tableElm) { + data = extractDataFromTableElement(editor, tableElm, hasAdvancedTableTab(editor)); } else { - data.cols = '1'; - data.rows = '1'; - if (hasAdvancedTableTab(editor)) { - data.borderstyle = ''; - data.bordercolor = ''; - data.backgroundcolor = ''; - } - } - var classes = buildListItems(getTableClassList(editor)); - if (classes.length > 0) { - if (data.class) { - data.class = data.class.replace(/\s*mce\-item\-table\s*/g, ''); - } - } - var generalPanel = { - type: 'grid', - columns: 2, - items: getItems$2(editor, classes, insertNewTable) - }; - var nonAdvancedForm = function () { - return { - type: 'panel', - items: [generalPanel] - }; - }; - var advancedForm = function () { - return { - type: 'tabpanel', - tabs: [ - { - title: 'General', - name: 'general', - items: [generalPanel] - }, - getAdvancedTab('table') - ] - }; + if (hasAdvancedTableTab(editor)) { + data.borderstyle = ''; + data.bordercolor = ''; + data.backgroundcolor = ''; + } + } + } else { + data.cols = '1'; + data.rows = '1'; + if (hasAdvancedTableTab(editor)) { + data.borderstyle = ''; + data.bordercolor = ''; + data.backgroundcolor = ''; + } + } + var classes = buildListItems(getTableClassList(editor)); + if (classes.length > 0) { + if (data.class) { + data.class = data.class.replace(/\s*mce\-item\-table\s*/g, ''); + } + } + var generalPanel = { + type: 'grid', + columns: 2, + items: getItems$2(editor, classes, insertNewTable) + }; + var nonAdvancedForm = function () { + return { + type: 'panel', + items: [generalPanel] }; - var dialogBody = hasAdvancedTableTab(editor) ? advancedForm() : nonAdvancedForm(); - editor.windowManager.open({ - title: 'Table Properties', - size: 'normal', - body: dialogBody, - onSubmit: curry(onSubmitTableForm, editor, tableElm), - buttons: [ - { - type: 'cancel', - name: 'cancel', - text: 'Cancel' - }, - { - type: 'submit', - name: 'save', - text: 'Save', - primary: true - } - ], - initialData: data - }); + }; + var advancedForm = function () { + return { + type: 'tabpanel', + tabs: [ + { + title: 'General', + name: 'general', + items: [generalPanel] + }, + getAdvancedTab('table') + ] + }; + }; + var dialogBody = hasAdvancedTableTab(editor) ? advancedForm() : nonAdvancedForm(); + editor.windowManager.open({ + title: 'Table Properties', + size: 'normal', + body: dialogBody, + onSubmit: curry(onSubmitTableForm, editor, tableElm), + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: data + }); }; var getSelectionStartCellOrCaption$1 = function (editor) { - return getSelectionStartCellOrCaption(getSelectionStart(editor)); + return getSelectionStartCellOrCaption(getSelectionStart(editor)); }; var getSelectionStartCell$1 = function (editor) { - return getSelectionStartCell(getSelectionStart(editor)); + return getSelectionStartCell(getSelectionStart(editor)); }; var registerCommands = function (editor, actions, cellSelection, selections, clipboard) { - var isRoot = getIsRoot(editor); - var eraseTable = function () { - return getSelectionStartCellOrCaption$1(editor).each(function (cellOrCaption) { - table(cellOrCaption, isRoot).filter(not(isRoot)).each(function (table) { - var cursor = SugarElement.fromText(''); - after(table, cursor); - remove$2(table); - if (editor.dom.isEmpty(editor.getBody())) { - editor.setContent(''); - editor.selection.setCursorLocation(); - } else { - var rng = editor.dom.createRng(); - rng.setStart(cursor.dom, 0); - rng.setEnd(cursor.dom, 0); - editor.selection.setRng(rng); - editor.nodeChanged(); - } - }); - }); - }; - var setSizingMode = function (sizing) { - return getSelectionStartCellOrCaption$1(editor).each(function (cellOrCaption) { - var isForcedSizing = isResponsiveForced(editor) || isPixelsForced(editor) || isPercentagesForced(editor); - if (!isForcedSizing) { - table(cellOrCaption, isRoot).each(function (table) { - if (sizing === 'relative' && !isPercentSizing$1(table)) { - enforcePercentage(editor, table); - } else if (sizing === 'fixed' && !isPixelSizing$1(table)) { - enforcePixels(editor, table); - } else if (sizing === 'responsive' && !isNoneSizing$1(table)) { - enforceNone(table); - } - removeDataStyle(table); - fireTableModified(editor, table.dom); - }); - } - }); - }; - var getTableFromCell = function (cell) { - return table(cell, isRoot); - }; - var postExecute = function (table) { - return function (rng) { - editor.selection.setRng(rng); - editor.focus(); - cellSelection.clear(table); - removeDataStyle(table); - fireTableModified(editor, table.dom); - }; - }; - var actOnSelection = function (execute) { - return getSelectionStartCell$1(editor).each(function (cell) { - getTableFromCell(cell).each(function (table) { - var targets = forMenu(selections, table, cell); - execute(table, targets).each(postExecute(table)); - }); - }); - }; - var copyRowSelection = function () { - return getSelectionStartCell$1(editor).map(function (cell) { - return getTableFromCell(cell).bind(function (table) { - var targets = forMenu(selections, table, cell); - var generators = cellOperations(noop, SugarElement.fromDom(editor.getDoc()), Optional.none()); - return copyRows(table, targets, generators); - }); - }); - }; - var copyColSelection = function () { - return getSelectionStartCell$1(editor).map(function (cell) { - return getTableFromCell(cell).bind(function (table) { - var targets = forMenu(selections, table, cell); - return copyCols(table, targets); - }); - }); - }; - var pasteOnSelection = function (execute, getRows) { - return getRows().each(function (rows) { - var clonedRows = map(rows, function (row) { - return deep(row); - }); - getSelectionStartCell$1(editor).each(function (cell) { - return getTableFromCell(cell).each(function (table) { - var generators = paste(SugarElement.fromDom(editor.getDoc())); - var targets = pasteRows(selections, cell, clonedRows, generators); - execute(table, targets).each(postExecute(table)); - }); - }); - }); - }; - each$1({ - mceTableSplitCells: function () { - return actOnSelection(actions.unmergeCells); - }, - mceTableMergeCells: function () { - return actOnSelection(actions.mergeCells); - }, - mceTableInsertRowBefore: function () { - return actOnSelection(actions.insertRowsBefore); - }, - mceTableInsertRowAfter: function () { - return actOnSelection(actions.insertRowsAfter); - }, - mceTableInsertColBefore: function () { - return actOnSelection(actions.insertColumnsBefore); - }, - mceTableInsertColAfter: function () { - return actOnSelection(actions.insertColumnsAfter); - }, - mceTableDeleteCol: function () { - return actOnSelection(actions.deleteColumn); - }, - mceTableDeleteRow: function () { - return actOnSelection(actions.deleteRow); - }, - mceTableCutCol: function (_grid) { - return copyColSelection().each(function (selection) { - clipboard.setColumns(selection); - actOnSelection(actions.deleteColumn); - }); - }, - mceTableCutRow: function (_grid) { - return copyRowSelection().each(function (selection) { - clipboard.setRows(selection); - actOnSelection(actions.deleteRow); - }); - }, - mceTableCopyCol: function (_grid) { - return copyColSelection().each(function (selection) { - return clipboard.setColumns(selection); - }); - }, - mceTableCopyRow: function (_grid) { - return copyRowSelection().each(function (selection) { - return clipboard.setRows(selection); - }); - }, - mceTablePasteColBefore: function (_grid) { - return pasteOnSelection(actions.pasteColsBefore, clipboard.getColumns); - }, - mceTablePasteColAfter: function (_grid) { - return pasteOnSelection(actions.pasteColsAfter, clipboard.getColumns); - }, - mceTablePasteRowBefore: function (_grid) { - return pasteOnSelection(actions.pasteRowsBefore, clipboard.getRows); - }, - mceTablePasteRowAfter: function (_grid) { - return pasteOnSelection(actions.pasteRowsAfter, clipboard.getRows); - }, - mceTableDelete: eraseTable, - mceTableSizingMode: function (ui, sizing) { - return setSizingMode(sizing); - } - }, function (func, name) { - return editor.addCommand(name, func); - }); - var fireTableModifiedForSelection = function (editor, tableOpt) { - tableOpt.each(function (table) { - fireTableModified(editor, table.dom); - }); + var isRoot = getIsRoot(editor); + var eraseTable = function () { + return getSelectionStartCellOrCaption$1(editor).each(function (cellOrCaption) { + table(cellOrCaption, isRoot).filter(not(isRoot)).each(function (table) { + var cursor = SugarElement.fromText(''); + after(table, cursor); + remove$2(table); + if (editor.dom.isEmpty(editor.getBody())) { + editor.setContent(''); + editor.selection.setCursorLocation(); + } else { + var rng = editor.dom.createRng(); + rng.setStart(cursor.dom, 0); + rng.setEnd(cursor.dom, 0); + editor.selection.setRng(rng); + editor.nodeChanged(); + } + }); + }); + }; + var setSizingMode = function (sizing) { + return getSelectionStartCellOrCaption$1(editor).each(function (cellOrCaption) { + var isForcedSizing = isResponsiveForced(editor) || isPixelsForced(editor) || isPercentagesForced(editor); + if (!isForcedSizing) { + table(cellOrCaption, isRoot).each(function (table) { + if (sizing === 'relative' && !isPercentSizing$1(table)) { + enforcePercentage(editor, table); + } else if (sizing === 'fixed' && !isPixelSizing$1(table)) { + enforcePixels(editor, table); + } else if (sizing === 'responsive' && !isNoneSizing$1(table)) { + enforceNone(table); + } + removeDataStyle(table); + fireTableModified(editor, table.dom); + }); + } + }); + }; + var getTableFromCell = function (cell) { + return table(cell, isRoot); + }; + var postExecute = function (table) { + return function (rng) { + editor.selection.setRng(rng); + editor.focus(); + cellSelection.clear(table); + removeDataStyle(table); + fireTableModified(editor, table.dom); + }; + }; + var actOnSelection = function (execute) { + return getSelectionStartCell$1(editor).each(function (cell) { + getTableFromCell(cell).each(function (table) { + var targets = forMenu(selections, table, cell); + execute(table, targets).each(postExecute(table)); + }); + }); + }; + var copyRowSelection = function () { + return getSelectionStartCell$1(editor).map(function (cell) { + return getTableFromCell(cell).bind(function (table) { + var targets = forMenu(selections, table, cell); + var generators = cellOperations(noop, SugarElement.fromDom(editor.getDoc()), Optional.none()); + return copyRows(table, targets, generators); + }); + }); + }; + var copyColSelection = function () { + return getSelectionStartCell$1(editor).map(function (cell) { + return getTableFromCell(cell).bind(function (table) { + var targets = forMenu(selections, table, cell); + return copyCols(table, targets); + }); + }); + }; + var pasteOnSelection = function (execute, getRows) { + return getRows().each(function (rows) { + var clonedRows = map(rows, function (row) { + return deep(row); + }); + getSelectionStartCell$1(editor).each(function (cell) { + return getTableFromCell(cell).each(function (table) { + var generators = paste(SugarElement.fromDom(editor.getDoc())); + var targets = pasteRows(selections, cell, clonedRows, generators); + execute(table, targets).each(postExecute(table)); + }); + }); + }); + }; + each$1({ + mceTableSplitCells: function () { + return actOnSelection(actions.unmergeCells); + }, + mceTableMergeCells: function () { + return actOnSelection(actions.mergeCells); + }, + mceTableInsertRowBefore: function () { + return actOnSelection(actions.insertRowsBefore); + }, + mceTableInsertRowAfter: function () { + return actOnSelection(actions.insertRowsAfter); + }, + mceTableInsertColBefore: function () { + return actOnSelection(actions.insertColumnsBefore); + }, + mceTableInsertColAfter: function () { + return actOnSelection(actions.insertColumnsAfter); + }, + mceTableDeleteCol: function () { + return actOnSelection(actions.deleteColumn); + }, + mceTableDeleteRow: function () { + return actOnSelection(actions.deleteRow); + }, + mceTableCutCol: function (_grid) { + return copyColSelection().each(function (selection) { + clipboard.setColumns(selection); + actOnSelection(actions.deleteColumn); + }); + }, + mceTableCutRow: function (_grid) { + return copyRowSelection().each(function (selection) { + clipboard.setRows(selection); + actOnSelection(actions.deleteRow); + }); + }, + mceTableCopyCol: function (_grid) { + return copyColSelection().each(function (selection) { + return clipboard.setColumns(selection); + }); + }, + mceTableCopyRow: function (_grid) { + return copyRowSelection().each(function (selection) { + return clipboard.setRows(selection); + }); + }, + mceTablePasteColBefore: function (_grid) { + return pasteOnSelection(actions.pasteColsBefore, clipboard.getColumns); + }, + mceTablePasteColAfter: function (_grid) { + return pasteOnSelection(actions.pasteColsAfter, clipboard.getColumns); + }, + mceTablePasteRowBefore: function (_grid) { + return pasteOnSelection(actions.pasteRowsBefore, clipboard.getRows); + }, + mceTablePasteRowAfter: function (_grid) { + return pasteOnSelection(actions.pasteRowsAfter, clipboard.getRows); + }, + mceTableDelete: eraseTable, + mceTableSizingMode: function (ui, sizing) { + return setSizingMode(sizing); + } + }, function (func, name) { + return editor.addCommand(name, func); + }); + var fireTableModifiedForSelection = function (editor, tableOpt) { + tableOpt.each(function (table) { + fireTableModified(editor, table.dom); + }); + }; + each$1({ + mceTableCellType: function (_ui, args) { + var tableOpt = table(getSelectionStart(editor), isRoot); + actions.setTableCellType(editor, args); + fireTableModifiedForSelection(editor, tableOpt); + }, + mceTableRowType: function (_ui, args) { + var tableOpt = table(getSelectionStart(editor), isRoot); + actions.setTableRowType(editor, args); + fireTableModifiedForSelection(editor, tableOpt); + } + }, function (func, name) { + return editor.addCommand(name, func); + }); + editor.addCommand('mceTableColType', function (_ui, args) { + return get$1(args, 'type').each(function (type) { + return actOnSelection(type === 'th' ? actions.makeColumnsHeader : actions.unmakeColumnsHeader); + }); + }); + each$1({ + mceTableProps: curry(open$2, editor, false), + mceTableRowProps: curry(open$1, editor), + mceTableCellProps: curry(open, editor, selections) + }, function (func, name) { + return editor.addCommand(name, function () { + return func(); + }); + }); + editor.addCommand('mceInsertTable', function (_ui, args) { + if (isObject(args) && keys(args).length > 0) { + insertTableWithDataValidation(editor, args.rows, args.columns, args.options, 'Invalid values for mceInsertTable - rows and columns values are required to insert a table.'); + } else { + open$2(editor, true); + } + }); + editor.addCommand('mceTableApplyCellStyle', function (_ui, args) { + var getFormatName = function (style) { + return 'tablecell' + style.toLowerCase().replace('-', ''); }; - each$1({ - mceTableCellType: function (_ui, args) { - var tableOpt = table(getSelectionStart(editor), isRoot); - actions.setTableCellType(editor, args); - fireTableModifiedForSelection(editor, tableOpt); - }, - mceTableRowType: function (_ui, args) { - var tableOpt = table(getSelectionStart(editor), isRoot); - actions.setTableRowType(editor, args); - fireTableModifiedForSelection(editor, tableOpt); - } - }, function (func, name) { - return editor.addCommand(name, func); - }); - editor.addCommand('mceTableColType', function (_ui, args) { - return get$1(args, 'type').each(function (type) { - return actOnSelection(type === 'th' ? actions.makeColumnsHeader : actions.unmakeColumnsHeader); - }); + if (!isObject(args)) { + return; + } + var cells = getCellsFromSelection(getSelectionStart(editor), selections); + if (cells.length === 0) { + return; + } + var validArgs = filter$1(args, function (value, style) { + return editor.formatter.has(getFormatName(style)) && isString(value); }); - each$1({ - mceTableProps: curry(open$2, editor, false), - mceTableRowProps: curry(open$1, editor), - mceTableCellProps: curry(open, editor, selections) - }, function (func, name) { - return editor.addCommand(name, function () { - return func(); - }); + if (isEmpty(validArgs)) { + return; + } + each$1(validArgs, function (value, style) { + each(cells, function (cell) { + DomModifier.normal(editor, cell.dom).setFormat(getFormatName(style), value); + }); }); - editor.addCommand('mceInsertTable', function (_ui, args) { - if (isObject(args) && keys(args).length > 0) { - insertTableWithDataValidation(editor, args.rows, args.columns, args.options, 'Invalid values for mceInsertTable - rows and columns values are required to insert a table.'); - } else { - open$2(editor, true); - } - }); - editor.addCommand('mceTableApplyCellStyle', function (_ui, args) { - var getFormatName = function (style) { - return 'tablecell' + style.toLowerCase().replace('-', ''); - }; - if (!isObject(args)) { - return; - } - var cells = getCellsFromSelection(getSelectionStart(editor), selections); - if (cells.length === 0) { - return; - } - var validArgs = filter$1(args, function (value, style) { - return editor.formatter.has(getFormatName(style)) && isString(value); - }); - if (isEmpty(validArgs)) { - return; - } - each$1(validArgs, function (value, style) { - each(cells, function (cell) { - DomModifier.normal(editor, cell.dom).setFormat(getFormatName(style), value); - }); - }); - getTableFromCell(cells[0]).each(function (table) { - return fireTableModified(editor, table.dom, { - structure: false, - style: true - }); - }); + getTableFromCell(cells[0]).each(function (table) { + return fireTableModified(editor, table.dom, { + structure: false, + style: true + }); }); + }); }; var registerQueryCommands = function (editor, actions, selections) { - var isRoot = getIsRoot(editor); - var getTableFromCell = function (cell) { - return table(cell, isRoot); - }; - each$1({ - mceTableRowType: function () { - return actions.getTableRowType(editor); - }, - mceTableCellType: function () { - return actions.getTableCellType(editor); - }, - mceTableColType: function () { - return getSelectionStartCell(getSelectionStart(editor)).bind(function (cell) { - return getTableFromCell(cell).map(function (table) { - var targets = forMenu(selections, table, cell); - return actions.getTableColType(table, targets); - }); - }).getOr(''); - } - }, function (func, name) { - return editor.addQueryValueHandler(name, func); - }); + var isRoot = getIsRoot(editor); + var getTableFromCell = function (cell) { + return table(cell, isRoot); + }; + each$1({ + mceTableRowType: function () { + return actions.getTableRowType(editor); + }, + mceTableCellType: function () { + return actions.getTableCellType(editor); + }, + mceTableColType: function () { + return getSelectionStartCell(getSelectionStart(editor)).bind(function (cell) { + return getTableFromCell(cell).map(function (table) { + var targets = forMenu(selections, table, cell); + return actions.getTableColType(table, targets); + }); + }).getOr(''); + } + }, function (func, name) { + return editor.addQueryValueHandler(name, func); + }); }; var Clipboard = function () { - var rows = Cell(Optional.none()); - var cols = Cell(Optional.none()); - var clearClipboard = function (clipboard) { - clipboard.set(Optional.none()); - }; - return { - getRows: rows.get, - setRows: function (r) { - rows.set(r); - clearClipboard(cols); - }, - clearRows: function () { - return clearClipboard(rows); - }, - getColumns: cols.get, - setColumns: function (c) { - cols.set(c); - clearClipboard(rows); - }, - clearColumns: function () { - return clearClipboard(cols); - } - }; - }; - - var cellFormats = { - tablecellbackgroundcolor: { - selector: 'td,th', - styles: {backgroundColor: '%value'}, - remove_similar: true + var rows = Cell(Optional.none()); + var cols = Cell(Optional.none()); + var clearClipboard = function (clipboard) { + clipboard.set(Optional.none()); + }; + return { + getRows: rows.get, + setRows: function (r) { + rows.set(r); + clearClipboard(cols); }, - tablecellbordercolor: { - selector: 'td,th', - styles: {borderColor: '%value'}, - remove_similar: true + clearRows: function () { + return clearClipboard(rows); }, - tablecellborderstyle: { - selector: 'td,th', - styles: {borderStyle: '%value'}, - remove_similar: true + getColumns: cols.get, + setColumns: function (c) { + cols.set(c); + clearClipboard(rows); }, - tablecellborderwidth: { - selector: 'td,th', - styles: {borderWidth: '%value'}, - remove_similar: true + clearColumns: function () { + return clearClipboard(cols); } + }; + }; + + var cellFormats = { + tablecellbackgroundcolor: { + selector: 'td,th', + styles: { backgroundColor: '%value' }, + remove_similar: true + }, + tablecellbordercolor: { + selector: 'td,th', + styles: { borderColor: '%value' }, + remove_similar: true + }, + tablecellborderstyle: { + selector: 'td,th', + styles: { borderStyle: '%value' }, + remove_similar: true + }, + tablecellborderwidth: { + selector: 'td,th', + styles: { borderWidth: '%value' }, + remove_similar: true + } }; var registerFormats = function (editor) { - editor.formatter.register(cellFormats); + editor.formatter.register(cellFormats); }; var adt$2 = Adt.generate([ - {none: ['current']}, - {first: ['current']}, - { - middle: [ - 'current', - 'target' - ] - }, - {last: ['current']} + { none: ['current'] }, + { first: ['current'] }, + { + middle: [ + 'current', + 'target' + ] + }, + { last: ['current'] } ]); var none$2 = function (current) { - if (current === void 0) { - current = undefined; - } - return adt$2.none(current); + if (current === void 0) { + current = undefined; + } + return adt$2.none(current); }; - var CellLocation = __assign(__assign({}, adt$2), {none: none$2}); + var CellLocation = __assign(__assign({}, adt$2), { none: none$2 }); var detect$5 = function (current, isRoot) { - return table(current, isRoot).bind(function (table) { - var all = cells(table); - var index = findIndex(all, function (x) { - return eq$1(current, x); - }); - return index.map(function (index) { - return { - index: index, - all: all - }; - }); + return table(current, isRoot).bind(function (table) { + var all = cells(table); + var index = findIndex(all, function (x) { + return eq$1(current, x); + }); + return index.map(function (index) { + return { + index: index, + all: all + }; }); + }); }; var next = function (current, isRoot) { - var detection = detect$5(current, isRoot); - return detection.fold(function () { - return CellLocation.none(current); - }, function (info) { - return info.index + 1 < info.all.length ? CellLocation.middle(current, info.all[info.index + 1]) : CellLocation.last(current); - }); + var detection = detect$5(current, isRoot); + return detection.fold(function () { + return CellLocation.none(current); + }, function (info) { + return info.index + 1 < info.all.length ? CellLocation.middle(current, info.all[info.index + 1]) : CellLocation.last(current); + }); }; var prev = function (current, isRoot) { - var detection = detect$5(current, isRoot); - return detection.fold(function () { - return CellLocation.none(); - }, function (info) { - return info.index - 1 >= 0 ? CellLocation.middle(current, info.all[info.index - 1]) : CellLocation.first(current); - }); + var detection = detect$5(current, isRoot); + return detection.fold(function () { + return CellLocation.none(); + }, function (info) { + return info.index - 1 >= 0 ? CellLocation.middle(current, info.all[info.index - 1]) : CellLocation.first(current); + }); }; var create$2 = function (start, soffset, finish, foffset) { - return { - start: start, - soffset: soffset, - finish: finish, - foffset: foffset - }; + return { + start: start, + soffset: soffset, + finish: finish, + foffset: foffset + }; }; - var SimRange = {create: create$2}; + var SimRange = { create: create$2 }; var adt$3 = Adt.generate([ - {before: ['element']}, - { - on: [ - 'element', - 'offset' - ] - }, - {after: ['element']} + { before: ['element'] }, + { + on: [ + 'element', + 'offset' + ] + }, + { after: ['element'] } ]); var cata$1 = function (subject, onBefore, onOn, onAfter) { - return subject.fold(onBefore, onOn, onAfter); + return subject.fold(onBefore, onOn, onAfter); }; var getStart = function (situ) { - return situ.fold(identity, identity, identity); + return situ.fold(identity, identity, identity); }; var before$2 = adt$3.before; var on = adt$3.on; var after$2 = adt$3.after; var Situ = { - before: before$2, - on: on, - after: after$2, - cata: cata$1, - getStart: getStart + before: before$2, + on: on, + after: after$2, + cata: cata$1, + getStart: getStart }; var adt$4 = Adt.generate([ - {domRange: ['rng']}, - { - relative: [ - 'startSitu', - 'finishSitu' - ] - }, - { - exact: [ - 'start', - 'soffset', - 'finish', - 'foffset' - ] - } + { domRange: ['rng'] }, + { + relative: [ + 'startSitu', + 'finishSitu' + ] + }, + { + exact: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + } ]); var exactFromRange = function (simRange) { - return adt$4.exact(simRange.start, simRange.soffset, simRange.finish, simRange.foffset); + return adt$4.exact(simRange.start, simRange.soffset, simRange.finish, simRange.foffset); }; var getStart$1 = function (selection) { - return selection.match({ - domRange: function (rng) { - return SugarElement.fromDom(rng.startContainer); - }, - relative: function (startSitu, _finishSitu) { - return Situ.getStart(startSitu); - }, - exact: function (start, _soffset, _finish, _foffset) { - return start; - } - }); + return selection.match({ + domRange: function (rng) { + return SugarElement.fromDom(rng.startContainer); + }, + relative: function (startSitu, _finishSitu) { + return Situ.getStart(startSitu); + }, + exact: function (start, _soffset, _finish, _foffset) { + return start; + } + }); }; var domRange = adt$4.domRange; var relative = adt$4.relative; var exact = adt$4.exact; var getWin = function (selection) { - var start = getStart$1(selection); - return defaultView(start); + var start = getStart$1(selection); + return defaultView(start); }; var range$1 = SimRange.create; var SimSelection = { - domRange: domRange, - relative: relative, - exact: exact, - exactFromRange: exactFromRange, - getWin: getWin, - range: range$1 + domRange: domRange, + relative: relative, + exact: exact, + exactFromRange: exactFromRange, + getWin: getWin, + range: range$1 }; var selectNodeContents = function (win, element) { - var rng = win.document.createRange(); - selectNodeContentsUsing(rng, element); - return rng; + var rng = win.document.createRange(); + selectNodeContentsUsing(rng, element); + return rng; }; var selectNodeContentsUsing = function (rng, element) { - return rng.selectNodeContents(element.dom); + return rng.selectNodeContents(element.dom); }; var setStart = function (rng, situ) { - situ.fold(function (e) { - rng.setStartBefore(e.dom); - }, function (e, o) { - rng.setStart(e.dom, o); - }, function (e) { - rng.setStartAfter(e.dom); - }); + situ.fold(function (e) { + rng.setStartBefore(e.dom); + }, function (e, o) { + rng.setStart(e.dom, o); + }, function (e) { + rng.setStartAfter(e.dom); + }); }; var setFinish = function (rng, situ) { - situ.fold(function (e) { - rng.setEndBefore(e.dom); - }, function (e, o) { - rng.setEnd(e.dom, o); - }, function (e) { - rng.setEndAfter(e.dom); - }); + situ.fold(function (e) { + rng.setEndBefore(e.dom); + }, function (e, o) { + rng.setEnd(e.dom, o); + }, function (e) { + rng.setEndAfter(e.dom); + }); }; var relativeToNative = function (win, startSitu, finishSitu) { - var range = win.document.createRange(); - setStart(range, startSitu); - setFinish(range, finishSitu); - return range; + var range = win.document.createRange(); + setStart(range, startSitu); + setFinish(range, finishSitu); + return range; }; var exactToNative = function (win, start, soffset, finish, foffset) { - var rng = win.document.createRange(); - rng.setStart(start.dom, soffset); - rng.setEnd(finish.dom, foffset); - return rng; + var rng = win.document.createRange(); + rng.setStart(start.dom, soffset); + rng.setEnd(finish.dom, foffset); + return rng; }; var toRect = function (rect) { - return { - left: rect.left, - top: rect.top, - right: rect.right, - bottom: rect.bottom, - width: rect.width, - height: rect.height - }; + return { + left: rect.left, + top: rect.top, + right: rect.right, + bottom: rect.bottom, + width: rect.width, + height: rect.height + }; }; var getFirstRect = function (rng) { - var rects = rng.getClientRects(); - var rect = rects.length > 0 ? rects[0] : rng.getBoundingClientRect(); - return rect.width > 0 || rect.height > 0 ? Optional.some(rect).map(toRect) : Optional.none(); + var rects = rng.getClientRects(); + var rect = rects.length > 0 ? rects[0] : rng.getBoundingClientRect(); + return rect.width > 0 || rect.height > 0 ? Optional.some(rect).map(toRect) : Optional.none(); }; var adt$5 = Adt.generate([ - { - ltr: [ - 'start', - 'soffset', - 'finish', - 'foffset' - ] - }, - { - rtl: [ - 'start', - 'soffset', - 'finish', - 'foffset' - ] - } + { + ltr: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + }, + { + rtl: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + } ]); var fromRange = function (win, type, range) { - return type(SugarElement.fromDom(range.startContainer), range.startOffset, SugarElement.fromDom(range.endContainer), range.endOffset); + return type(SugarElement.fromDom(range.startContainer), range.startOffset, SugarElement.fromDom(range.endContainer), range.endOffset); }; var getRanges = function (win, selection) { - return selection.match({ - domRange: function (rng) { - return { - ltr: constant(rng), - rtl: Optional.none - }; - }, - relative: function (startSitu, finishSitu) { - return { - ltr: cached(function () { - return relativeToNative(win, startSitu, finishSitu); - }), - rtl: cached(function () { - return Optional.some(relativeToNative(win, finishSitu, startSitu)); - }) - }; - }, - exact: function (start, soffset, finish, foffset) { - return { - ltr: cached(function () { - return exactToNative(win, start, soffset, finish, foffset); - }), - rtl: cached(function () { - return Optional.some(exactToNative(win, finish, foffset, start, soffset)); - }) - }; - } - }); + return selection.match({ + domRange: function (rng) { + return { + ltr: constant(rng), + rtl: Optional.none + }; + }, + relative: function (startSitu, finishSitu) { + return { + ltr: cached(function () { + return relativeToNative(win, startSitu, finishSitu); + }), + rtl: cached(function () { + return Optional.some(relativeToNative(win, finishSitu, startSitu)); + }) + }; + }, + exact: function (start, soffset, finish, foffset) { + return { + ltr: cached(function () { + return exactToNative(win, start, soffset, finish, foffset); + }), + rtl: cached(function () { + return Optional.some(exactToNative(win, finish, foffset, start, soffset)); + }) + }; + } + }); }; var doDiagnose = function (win, ranges) { - var rng = ranges.ltr(); - if (rng.collapsed) { - var reversed = ranges.rtl().filter(function (rev) { - return rev.collapsed === false; - }); - return reversed.map(function (rev) { - return adt$5.rtl(SugarElement.fromDom(rev.endContainer), rev.endOffset, SugarElement.fromDom(rev.startContainer), rev.startOffset); - }).getOrThunk(function () { - return fromRange(win, adt$5.ltr, rng); - }); - } else { - return fromRange(win, adt$5.ltr, rng); - } + var rng = ranges.ltr(); + if (rng.collapsed) { + var reversed = ranges.rtl().filter(function (rev) { + return rev.collapsed === false; + }); + return reversed.map(function (rev) { + return adt$5.rtl(SugarElement.fromDom(rev.endContainer), rev.endOffset, SugarElement.fromDom(rev.startContainer), rev.startOffset); + }).getOrThunk(function () { + return fromRange(win, adt$5.ltr, rng); + }); + } else { + return fromRange(win, adt$5.ltr, rng); + } }; var diagnose = function (win, selection) { - var ranges = getRanges(win, selection); - return doDiagnose(win, ranges); + var ranges = getRanges(win, selection); + return doDiagnose(win, ranges); }; var asLtrRange = function (win, selection) { - var diagnosis = diagnose(win, selection); - return diagnosis.match({ - ltr: function (start, soffset, finish, foffset) { - var rng = win.document.createRange(); - rng.setStart(start.dom, soffset); - rng.setEnd(finish.dom, foffset); - return rng; - }, - rtl: function (start, soffset, finish, foffset) { - var rng = win.document.createRange(); - rng.setStart(finish.dom, foffset); - rng.setEnd(start.dom, soffset); - return rng; - } - }); + var diagnosis = diagnose(win, selection); + return diagnosis.match({ + ltr: function (start, soffset, finish, foffset) { + var rng = win.document.createRange(); + rng.setStart(start.dom, soffset); + rng.setEnd(finish.dom, foffset); + return rng; + }, + rtl: function (start, soffset, finish, foffset) { + var rng = win.document.createRange(); + rng.setStart(finish.dom, foffset); + rng.setEnd(start.dom, soffset); + return rng; + } + }); }; var ltr$1 = adt$5.ltr; var rtl$1 = adt$5.rtl; var searchForPoint = function (rectForOffset, x, y, maxX, length) { - if (length === 0) { - return 0; - } else if (x === maxX) { - return length - 1; - } - var xDelta = maxX; - for (var i = 1; i < length; i++) { - var rect = rectForOffset(i); - var curDeltaX = Math.abs(x - rect.left); - if (y <= rect.bottom) { - if (y < rect.top || curDeltaX > xDelta) { - return i - 1; - } else { - xDelta = curDeltaX; - } - } - } + if (length === 0) { return 0; + } else if (x === maxX) { + return length - 1; + } + var xDelta = maxX; + for (var i = 1; i < length; i++) { + var rect = rectForOffset(i); + var curDeltaX = Math.abs(x - rect.left); + if (y <= rect.bottom) { + if (y < rect.top || curDeltaX > xDelta) { + return i - 1; + } else { + xDelta = curDeltaX; + } + } + } + return 0; }; var inRect = function (rect, x, y) { - return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom; + return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom; }; var locateOffset = function (doc, textnode, x, y, rect) { - var rangeForOffset = function (o) { - var r = doc.dom.createRange(); - r.setStart(textnode.dom, o); - r.collapse(true); - return r; - }; - var rectForOffset = function (o) { - var r = rangeForOffset(o); - return r.getBoundingClientRect(); - }; - var length = get$4(textnode).length; - var offset = searchForPoint(rectForOffset, x, y, rect.right, length); - return rangeForOffset(offset); + var rangeForOffset = function (o) { + var r = doc.dom.createRange(); + r.setStart(textnode.dom, o); + r.collapse(true); + return r; + }; + var rectForOffset = function (o) { + var r = rangeForOffset(o); + return r.getBoundingClientRect(); + }; + var length = get$4(textnode).length; + var offset = searchForPoint(rectForOffset, x, y, rect.right, length); + return rangeForOffset(offset); }; var locate = function (doc, node, x, y) { - var r = doc.dom.createRange(); - r.selectNode(node.dom); - var rects = r.getClientRects(); - var foundRect = findMap(rects, function (rect) { - return inRect(rect, x, y) ? Optional.some(rect) : Optional.none(); - }); - return foundRect.map(function (rect) { - return locateOffset(doc, node, x, y, rect); - }); + var r = doc.dom.createRange(); + r.selectNode(node.dom); + var rects = r.getClientRects(); + var foundRect = findMap(rects, function (rect) { + return inRect(rect, x, y) ? Optional.some(rect) : Optional.none(); + }); + return foundRect.map(function (rect) { + return locateOffset(doc, node, x, y, rect); + }); }; var searchInChildren = function (doc, node, x, y) { - var r = doc.dom.createRange(); - var nodes = children(node); - return findMap(nodes, function (n) { - r.selectNode(n.dom); - return inRect(r.getBoundingClientRect(), x, y) ? locateNode(doc, n, x, y) : Optional.none(); - }); + var r = doc.dom.createRange(); + var nodes = children(node); + return findMap(nodes, function (n) { + r.selectNode(n.dom); + return inRect(r.getBoundingClientRect(), x, y) ? locateNode(doc, n, x, y) : Optional.none(); + }); }; var locateNode = function (doc, node, x, y) { - return isText(node) ? locate(doc, node, x, y) : searchInChildren(doc, node, x, y); + return isText(node) ? locate(doc, node, x, y) : searchInChildren(doc, node, x, y); }; var locate$1 = function (doc, node, x, y) { - var r = doc.dom.createRange(); - r.selectNode(node.dom); - var rect = r.getBoundingClientRect(); - var boundedX = Math.max(rect.left, Math.min(rect.right, x)); - var boundedY = Math.max(rect.top, Math.min(rect.bottom, y)); - return locateNode(doc, node, boundedX, boundedY); + var r = doc.dom.createRange(); + r.selectNode(node.dom); + var rect = r.getBoundingClientRect(); + var boundedX = Math.max(rect.left, Math.min(rect.right, x)); + var boundedY = Math.max(rect.top, Math.min(rect.bottom, y)); + return locateNode(doc, node, boundedX, boundedY); }; var COLLAPSE_TO_LEFT = true; var COLLAPSE_TO_RIGHT = false; var getCollapseDirection = function (rect, x) { - return x - rect.left < rect.right - x ? COLLAPSE_TO_LEFT : COLLAPSE_TO_RIGHT; + return x - rect.left < rect.right - x ? COLLAPSE_TO_LEFT : COLLAPSE_TO_RIGHT; }; var createCollapsedNode = function (doc, target, collapseDirection) { - var r = doc.dom.createRange(); - r.selectNode(target.dom); - r.collapse(collapseDirection); - return r; + var r = doc.dom.createRange(); + r.selectNode(target.dom); + r.collapse(collapseDirection); + return r; }; var locateInElement = function (doc, node, x) { - var cursorRange = doc.dom.createRange(); - cursorRange.selectNode(node.dom); - var rect = cursorRange.getBoundingClientRect(); - var collapseDirection = getCollapseDirection(rect, x); - var f = collapseDirection === COLLAPSE_TO_LEFT ? first : last$1; - return f(node).map(function (target) { - return createCollapsedNode(doc, target, collapseDirection); - }); + var cursorRange = doc.dom.createRange(); + cursorRange.selectNode(node.dom); + var rect = cursorRange.getBoundingClientRect(); + var collapseDirection = getCollapseDirection(rect, x); + var f = collapseDirection === COLLAPSE_TO_LEFT ? first : last$1; + return f(node).map(function (target) { + return createCollapsedNode(doc, target, collapseDirection); + }); }; var locateInEmpty = function (doc, node, x) { - var rect = node.dom.getBoundingClientRect(); - var collapseDirection = getCollapseDirection(rect, x); - return Optional.some(createCollapsedNode(doc, node, collapseDirection)); + var rect = node.dom.getBoundingClientRect(); + var collapseDirection = getCollapseDirection(rect, x); + return Optional.some(createCollapsedNode(doc, node, collapseDirection)); }; var search = function (doc, node, x) { - var f = children(node).length === 0 ? locateInEmpty : locateInElement; - return f(doc, node, x); + var f = children(node).length === 0 ? locateInEmpty : locateInElement; + return f(doc, node, x); }; var caretPositionFromPoint = function (doc, x, y) { - return Optional.from(doc.dom.caretPositionFromPoint(x, y)).bind(function (pos) { - if (pos.offsetNode === null) { - return Optional.none(); - } - var r = doc.dom.createRange(); - r.setStart(pos.offsetNode, pos.offset); - r.collapse(); - return Optional.some(r); - }); + return Optional.from(doc.dom.caretPositionFromPoint(x, y)).bind(function (pos) { + if (pos.offsetNode === null) { + return Optional.none(); + } + var r = doc.dom.createRange(); + r.setStart(pos.offsetNode, pos.offset); + r.collapse(); + return Optional.some(r); + }); }; var caretRangeFromPoint = function (doc, x, y) { - return Optional.from(doc.dom.caretRangeFromPoint(x, y)); + return Optional.from(doc.dom.caretRangeFromPoint(x, y)); }; var searchTextNodes = function (doc, node, x, y) { - var r = doc.dom.createRange(); - r.selectNode(node.dom); - var rect = r.getBoundingClientRect(); - var boundedX = Math.max(rect.left, Math.min(rect.right, x)); - var boundedY = Math.max(rect.top, Math.min(rect.bottom, y)); - return locate$1(doc, node, boundedX, boundedY); + var r = doc.dom.createRange(); + r.selectNode(node.dom); + var rect = r.getBoundingClientRect(); + var boundedX = Math.max(rect.left, Math.min(rect.right, x)); + var boundedY = Math.max(rect.top, Math.min(rect.bottom, y)); + return locate$1(doc, node, boundedX, boundedY); }; var searchFromPoint = function (doc, x, y) { - return SugarElement.fromPoint(doc, x, y).bind(function (elem) { - var fallback = function () { - return search(doc, elem, x); - }; - return children(elem).length === 0 ? fallback() : searchTextNodes(doc, elem, x, y).orThunk(fallback); - }); + return SugarElement.fromPoint(doc, x, y).bind(function (elem) { + var fallback = function () { + return search(doc, elem, x); + }; + return children(elem).length === 0 ? fallback() : searchTextNodes(doc, elem, x, y).orThunk(fallback); + }); }; var availableSearch = function () { - if (document.caretPositionFromPoint) { - return caretPositionFromPoint; - } else if (document.caretRangeFromPoint) { - return caretRangeFromPoint; - } else { - return searchFromPoint; - } + if (document.caretPositionFromPoint) { + return caretPositionFromPoint; + } else if (document.caretRangeFromPoint) { + return caretRangeFromPoint; + } else { + return searchFromPoint; + } }(); var fromPoint$1 = function (win, x, y) { - var doc = SugarElement.fromDom(win.document); - return availableSearch(doc, x, y).map(function (rng) { - return SimRange.create(SugarElement.fromDom(rng.startContainer), rng.startOffset, SugarElement.fromDom(rng.endContainer), rng.endOffset); - }); + var doc = SugarElement.fromDom(win.document); + return availableSearch(doc, x, y).map(function (rng) { + return SimRange.create(SugarElement.fromDom(rng.startContainer), rng.startOffset, SugarElement.fromDom(rng.endContainer), rng.endOffset); + }); }; var beforeSpecial = function (element, offset) { - var name$1 = name(element); - if ('input' === name$1) { - return Situ.after(element); - } else if (!contains([ - 'br', - 'img' + var name$1 = name(element); + if ('input' === name$1) { + return Situ.after(element); + } else if (!contains([ + 'br', + 'img' ], name$1)) { - return Situ.on(element, offset); - } else { - return offset === 0 ? Situ.before(element) : Situ.after(element); - } + return Situ.on(element, offset); + } else { + return offset === 0 ? Situ.before(element) : Situ.after(element); + } }; var preprocessRelative = function (startSitu, finishSitu) { - var start = startSitu.fold(Situ.before, beforeSpecial, Situ.after); - var finish = finishSitu.fold(Situ.before, beforeSpecial, Situ.after); - return SimSelection.relative(start, finish); + var start = startSitu.fold(Situ.before, beforeSpecial, Situ.after); + var finish = finishSitu.fold(Situ.before, beforeSpecial, Situ.after); + return SimSelection.relative(start, finish); }; var preprocessExact = function (start, soffset, finish, foffset) { - var startSitu = beforeSpecial(start, soffset); - var finishSitu = beforeSpecial(finish, foffset); - return SimSelection.relative(startSitu, finishSitu); + var startSitu = beforeSpecial(start, soffset); + var finishSitu = beforeSpecial(finish, foffset); + return SimSelection.relative(startSitu, finishSitu); }; var preprocess = function (selection) { - return selection.match({ - domRange: function (rng) { - var start = SugarElement.fromDom(rng.startContainer); - var finish = SugarElement.fromDom(rng.endContainer); - return preprocessExact(start, rng.startOffset, finish, rng.endOffset); - }, - relative: preprocessRelative, - exact: preprocessExact - }); + return selection.match({ + domRange: function (rng) { + var start = SugarElement.fromDom(rng.startContainer); + var finish = SugarElement.fromDom(rng.endContainer); + return preprocessExact(start, rng.startOffset, finish, rng.endOffset); + }, + relative: preprocessRelative, + exact: preprocessExact + }); }; var makeRange = function (start, soffset, finish, foffset) { - var doc = owner(start); - var rng = doc.dom.createRange(); - rng.setStart(start.dom, soffset); - rng.setEnd(finish.dom, foffset); - return rng; + var doc = owner(start); + var rng = doc.dom.createRange(); + rng.setStart(start.dom, soffset); + rng.setEnd(finish.dom, foffset); + return rng; }; var after$3 = function (start, soffset, finish, foffset) { - var r = makeRange(start, soffset, finish, foffset); - var same = eq$1(start, finish) && soffset === foffset; - return r.collapsed && !same; + var r = makeRange(start, soffset, finish, foffset); + var same = eq$1(start, finish) && soffset === foffset; + return r.collapsed && !same; }; var getNativeSelection = function (win) { - return Optional.from(win.getSelection()); + return Optional.from(win.getSelection()); }; var doSetNativeRange = function (win, rng) { - getNativeSelection(win).each(function (selection) { - selection.removeAllRanges(); - selection.addRange(rng); - }); + getNativeSelection(win).each(function (selection) { + selection.removeAllRanges(); + selection.addRange(rng); + }); }; var doSetRange = function (win, start, soffset, finish, foffset) { - var rng = exactToNative(win, start, soffset, finish, foffset); - doSetNativeRange(win, rng); + var rng = exactToNative(win, start, soffset, finish, foffset); + doSetNativeRange(win, rng); }; var setLegacyRtlRange = function (win, selection, start, soffset, finish, foffset) { - selection.collapse(start.dom, soffset); - selection.extend(finish.dom, foffset); + selection.collapse(start.dom, soffset); + selection.extend(finish.dom, foffset); }; var setRangeFromRelative = function (win, relative) { - return diagnose(win, relative).match({ - ltr: function (start, soffset, finish, foffset) { - doSetRange(win, start, soffset, finish, foffset); - }, - rtl: function (start, soffset, finish, foffset) { - getNativeSelection(win).each(function (selection) { - if (selection.setBaseAndExtent) { - selection.setBaseAndExtent(start.dom, soffset, finish.dom, foffset); - } else if (selection.extend) { - try { - setLegacyRtlRange(win, selection, start, soffset, finish, foffset); - } catch (e) { - doSetRange(win, finish, foffset, start, soffset); - } - } else { - doSetRange(win, finish, foffset, start, soffset); - } - }); + return diagnose(win, relative).match({ + ltr: function (start, soffset, finish, foffset) { + doSetRange(win, start, soffset, finish, foffset); + }, + rtl: function (start, soffset, finish, foffset) { + getNativeSelection(win).each(function (selection) { + if (selection.setBaseAndExtent) { + selection.setBaseAndExtent(start.dom, soffset, finish.dom, foffset); + } else if (selection.extend) { + try { + setLegacyRtlRange(win, selection, start, soffset, finish, foffset); + } catch (e) { + doSetRange(win, finish, foffset, start, soffset); + } + } else { + doSetRange(win, finish, foffset, start, soffset); } - }); + }); + } + }); }; var setExact = function (win, start, soffset, finish, foffset) { - var relative = preprocessExact(start, soffset, finish, foffset); - setRangeFromRelative(win, relative); + var relative = preprocessExact(start, soffset, finish, foffset); + setRangeFromRelative(win, relative); }; var setRelative = function (win, startSitu, finishSitu) { - var relative = preprocessRelative(startSitu, finishSitu); - setRangeFromRelative(win, relative); + var relative = preprocessRelative(startSitu, finishSitu); + setRangeFromRelative(win, relative); }; var toNative = function (selection) { - var win = SimSelection.getWin(selection).dom; - var getDomRange = function (start, soffset, finish, foffset) { - return exactToNative(win, start, soffset, finish, foffset); - }; - var filtered = preprocess(selection); - return diagnose(win, filtered).match({ - ltr: getDomRange, - rtl: getDomRange - }); + var win = SimSelection.getWin(selection).dom; + var getDomRange = function (start, soffset, finish, foffset) { + return exactToNative(win, start, soffset, finish, foffset); + }; + var filtered = preprocess(selection); + return diagnose(win, filtered).match({ + ltr: getDomRange, + rtl: getDomRange + }); }; var readRange = function (selection) { - if (selection.rangeCount > 0) { - var firstRng = selection.getRangeAt(0); - var lastRng = selection.getRangeAt(selection.rangeCount - 1); - return Optional.some(SimRange.create(SugarElement.fromDom(firstRng.startContainer), firstRng.startOffset, SugarElement.fromDom(lastRng.endContainer), lastRng.endOffset)); - } else { - return Optional.none(); - } + if (selection.rangeCount > 0) { + var firstRng = selection.getRangeAt(0); + var lastRng = selection.getRangeAt(selection.rangeCount - 1); + return Optional.some(SimRange.create(SugarElement.fromDom(firstRng.startContainer), firstRng.startOffset, SugarElement.fromDom(lastRng.endContainer), lastRng.endOffset)); + } else { + return Optional.none(); + } }; var doGetExact = function (selection) { - if (selection.anchorNode === null || selection.focusNode === null) { - return readRange(selection); - } else { - var anchor = SugarElement.fromDom(selection.anchorNode); - var focus_1 = SugarElement.fromDom(selection.focusNode); - return after$3(anchor, selection.anchorOffset, focus_1, selection.focusOffset) ? Optional.some(SimRange.create(anchor, selection.anchorOffset, focus_1, selection.focusOffset)) : readRange(selection); - } + if (selection.anchorNode === null || selection.focusNode === null) { + return readRange(selection); + } else { + var anchor = SugarElement.fromDom(selection.anchorNode); + var focus_1 = SugarElement.fromDom(selection.focusNode); + return after$3(anchor, selection.anchorOffset, focus_1, selection.focusOffset) ? Optional.some(SimRange.create(anchor, selection.anchorOffset, focus_1, selection.focusOffset)) : readRange(selection); + } }; var setToElement = function (win, element) { - var rng = selectNodeContents(win, element); - doSetNativeRange(win, rng); + var rng = selectNodeContents(win, element); + doSetNativeRange(win, rng); }; var getExact = function (win) { - return getNativeSelection(win).filter(function (sel) { - return sel.rangeCount > 0; - }).bind(doGetExact); + return getNativeSelection(win).filter(function (sel) { + return sel.rangeCount > 0; + }).bind(doGetExact); }; var get$c = function (win) { - return getExact(win).map(function (range) { - return SimSelection.exact(range.start, range.soffset, range.finish, range.foffset); - }); + return getExact(win).map(function (range) { + return SimSelection.exact(range.start, range.soffset, range.finish, range.foffset); + }); }; var getFirstRect$1 = function (win, selection) { - var rng = asLtrRange(win, selection); - return getFirstRect(rng); + var rng = asLtrRange(win, selection); + return getFirstRect(rng); }; var getAtPoint = function (win, x, y) { - return fromPoint$1(win, x, y); + return fromPoint$1(win, x, y); }; var clear = function (win) { - getNativeSelection(win).each(function (selection) { - return selection.removeAllRanges(); - }); + getNativeSelection(win).each(function (selection) { + return selection.removeAllRanges(); + }); }; var global$3 = tinymce.util.Tools.resolve('tinymce.util.VK'); var forward = function (editor, isRoot, cell, actions) { - return go(editor, isRoot, next(cell), actions); + return go(editor, isRoot, next(cell), actions); }; var backward = function (editor, isRoot, cell, actions) { - return go(editor, isRoot, prev(cell), actions); + return go(editor, isRoot, prev(cell), actions); }; var getCellFirstCursorPosition = function (editor, cell) { - var selection = SimSelection.exact(cell, 0, cell, 0); - return toNative(selection); + var selection = SimSelection.exact(cell, 0, cell, 0); + return toNative(selection); }; var getNewRowCursorPosition = function (editor, table) { - var rows = descendants$1(table, 'tr'); - return last(rows).bind(function (last) { - return descendant$1(last, 'td,th').map(function (first) { - return getCellFirstCursorPosition(editor, first); - }); + var rows = descendants$1(table, 'tr'); + return last(rows).bind(function (last) { + return descendant$1(last, 'td,th').map(function (first) { + return getCellFirstCursorPosition(editor, first); }); + }); }; var go = function (editor, isRoot, cell, actions) { - return cell.fold(Optional.none, Optional.none, function (current, next) { - return first(next).map(function (cell) { - return getCellFirstCursorPosition(editor, cell); - }); - }, function (current) { - return table(current, isRoot).bind(function (table) { - var targets = noMenu(current); - editor.undoManager.transact(function () { - actions.insertRowsAfter(table, targets); - }); - return getNewRowCursorPosition(editor, table); - }); + return cell.fold(Optional.none, Optional.none, function (current, next) { + return first(next).map(function (cell) { + return getCellFirstCursorPosition(editor, cell); + }); + }, function (current) { + return table(current, isRoot).bind(function (table) { + var targets = noMenu(current); + editor.undoManager.transact(function () { + actions.insertRowsAfter(table, targets); + }); + return getNewRowCursorPosition(editor, table); }); + }); }; var rootElements = [ - 'table', - 'li', - 'dl' + 'table', + 'li', + 'dl' ]; var handle$1 = function (event, editor, actions) { - if (event.keyCode === global$3.TAB) { - var body_1 = getBody$1(editor); - var isRoot_1 = function (element) { - var name$1 = name(element); - return eq$1(element, body_1) || contains(rootElements, name$1); - }; - var rng = editor.selection.getRng(); - if (rng.collapsed) { - var start = SugarElement.fromDom(rng.startContainer); - cell(start, isRoot_1).each(function (cell) { - event.preventDefault(); - var navigation = event.shiftKey ? backward : forward; - var rng = navigation(editor, isRoot_1, cell, actions); - rng.each(function (range) { - editor.selection.setRng(range); - }); - }); - } + if (event.keyCode === global$3.TAB) { + var body_1 = getBody$1(editor); + var isRoot_1 = function (element) { + var name$1 = name(element); + return eq$1(element, body_1) || contains(rootElements, name$1); + }; + var rng = editor.selection.getRng(); + if (rng.collapsed) { + var start = SugarElement.fromDom(rng.startContainer); + cell(start, isRoot_1).each(function (cell) { + event.preventDefault(); + var navigation = event.shiftKey ? backward : forward; + var rng = navigation(editor, isRoot_1, cell, actions); + rng.each(function (range) { + editor.selection.setRng(range); + }); + }); } + } }; var create$3 = function (selection, kill) { - return { - selection: selection, - kill: kill - }; + return { + selection: selection, + kill: kill + }; }; - var Response = {create: create$3}; + var Response = { create: create$3 }; var create$4 = function (start, soffset, finish, foffset) { - return { - start: Situ.on(start, soffset), - finish: Situ.on(finish, foffset) - }; + return { + start: Situ.on(start, soffset), + finish: Situ.on(finish, foffset) + }; }; - var Situs = {create: create$4}; + var Situs = { create: create$4 }; var convertToRange = function (win, selection) { - var rng = asLtrRange(win, selection); - return SimRange.create(SugarElement.fromDom(rng.startContainer), rng.startOffset, SugarElement.fromDom(rng.endContainer), rng.endOffset); + var rng = asLtrRange(win, selection); + return SimRange.create(SugarElement.fromDom(rng.startContainer), rng.startOffset, SugarElement.fromDom(rng.endContainer), rng.endOffset); }; var makeSitus = Situs.create; var sync = function (container, isRoot, start, soffset, finish, foffset, selectRange) { - if (!(eq$1(start, finish) && soffset === foffset)) { - return closest$1(start, 'td,th', isRoot).bind(function (s) { - return closest$1(finish, 'td,th', isRoot).bind(function (f) { - return detect$6(container, isRoot, s, f, selectRange); - }); - }); - } else { - return Optional.none(); - } + if (!(eq$1(start, finish) && soffset === foffset)) { + return closest$1(start, 'td,th', isRoot).bind(function (s) { + return closest$1(finish, 'td,th', isRoot).bind(function (f) { + return detect$6(container, isRoot, s, f, selectRange); + }); + }); + } else { + return Optional.none(); + } }; var detect$6 = function (container, isRoot, start, finish, selectRange) { - if (!eq$1(start, finish)) { - return identify(start, finish, isRoot).bind(function (cellSel) { - var boxes = cellSel.boxes.getOr([]); - if (boxes.length > 0) { - selectRange(container, boxes, cellSel.start, cellSel.finish); - return Optional.some(Response.create(Optional.some(makeSitus(start, 0, start, getEnd(start))), true)); - } else { - return Optional.none(); - } - }); - } else { + if (!eq$1(start, finish)) { + return identify(start, finish, isRoot).bind(function (cellSel) { + var boxes = cellSel.boxes.getOr([]); + if (boxes.length > 0) { + selectRange(container, boxes, cellSel.start, cellSel.finish); + return Optional.some(Response.create(Optional.some(makeSitus(start, 0, start, getEnd(start))), true)); + } else { return Optional.none(); - } + } + }); + } else { + return Optional.none(); + } }; var update = function (rows, columns, container, selected, annotations) { - var updateSelection = function (newSels) { - annotations.clearBeforeUpdate(container); - annotations.selectRange(container, newSels.boxes, newSels.start, newSels.finish); - return newSels.boxes; - }; - return shiftSelection(selected, rows, columns, annotations.firstSelectedSelector, annotations.lastSelectedSelector).map(updateSelection); + var updateSelection = function (newSels) { + annotations.clearBeforeUpdate(container); + annotations.selectRange(container, newSels.boxes, newSels.start, newSels.finish); + return newSels.boxes; + }; + return shiftSelection(selected, rows, columns, annotations.firstSelectedSelector, annotations.lastSelectedSelector).map(updateSelection); }; var traverse = function (item, mode) { - return { - item: item, - mode: mode - }; + return { + item: item, + mode: mode + }; }; var backtrack = function (universe, item, _direction, transition) { - if (transition === void 0) { - transition = sidestep; - } - return universe.property().parent(item).map(function (p) { - return traverse(p, transition); - }); + if (transition === void 0) { + transition = sidestep; + } + return universe.property().parent(item).map(function (p) { + return traverse(p, transition); + }); }; var sidestep = function (universe, item, direction, transition) { - if (transition === void 0) { - transition = advance; - } - return direction.sibling(universe, item).map(function (p) { - return traverse(p, transition); - }); + if (transition === void 0) { + transition = advance; + } + return direction.sibling(universe, item).map(function (p) { + return traverse(p, transition); + }); }; var advance = function (universe, item, direction, transition) { - if (transition === void 0) { - transition = advance; - } - var children = universe.property().children(item); - var result = direction.first(children); - return result.map(function (r) { - return traverse(r, transition); - }); + if (transition === void 0) { + transition = advance; + } + var children = universe.property().children(item); + var result = direction.first(children); + return result.map(function (r) { + return traverse(r, transition); + }); }; var successors = [ - { - current: backtrack, - next: sidestep, - fallback: Optional.none() - }, - { - current: sidestep, - next: advance, - fallback: Optional.some(backtrack) - }, - { - current: advance, - next: advance, - fallback: Optional.some(sidestep) - } + { + current: backtrack, + next: sidestep, + fallback: Optional.none() + }, + { + current: sidestep, + next: advance, + fallback: Optional.some(backtrack) + }, + { + current: advance, + next: advance, + fallback: Optional.some(sidestep) + } ]; var go$1 = function (universe, item, mode, direction, rules) { - if (rules === void 0) { - rules = successors; - } - var ruleOpt = find(rules, function (succ) { - return succ.current === mode; - }); - return ruleOpt.bind(function (rule) { - return rule.current(universe, item, direction, rule.next).orThunk(function () { - return rule.fallback.bind(function (fb) { - return go$1(universe, item, fb, direction); - }); - }); + if (rules === void 0) { + rules = successors; + } + var ruleOpt = find(rules, function (succ) { + return succ.current === mode; + }); + return ruleOpt.bind(function (rule) { + return rule.current(universe, item, direction, rule.next).orThunk(function () { + return rule.fallback.bind(function (fb) { + return go$1(universe, item, fb, direction); + }); }); + }); }; var left = function () { - var sibling = function (universe, item) { - return universe.query().prevSibling(item); - }; - var first = function (children) { - return children.length > 0 ? Optional.some(children[children.length - 1]) : Optional.none(); - }; - return { - sibling: sibling, - first: first - }; + var sibling = function (universe, item) { + return universe.query().prevSibling(item); + }; + var first = function (children) { + return children.length > 0 ? Optional.some(children[children.length - 1]) : Optional.none(); + }; + return { + sibling: sibling, + first: first + }; }; var right = function () { - var sibling = function (universe, item) { - return universe.query().nextSibling(item); - }; - var first = function (children) { - return children.length > 0 ? Optional.some(children[0]) : Optional.none(); - }; - return { - sibling: sibling, - first: first - }; + var sibling = function (universe, item) { + return universe.query().nextSibling(item); + }; + var first = function (children) { + return children.length > 0 ? Optional.some(children[0]) : Optional.none(); + }; + return { + sibling: sibling, + first: first + }; }; var Walkers = { - left: left, - right: right + left: left, + right: right }; var hone = function (universe, item, predicate, mode, direction, isRoot) { - var next = go$1(universe, item, mode, direction); - return next.bind(function (n) { - if (isRoot(n.item)) { - return Optional.none(); - } else { - return predicate(n.item) ? Optional.some(n.item) : hone(universe, n.item, predicate, n.mode, direction, isRoot); - } - }); + var next = go$1(universe, item, mode, direction); + return next.bind(function (n) { + if (isRoot(n.item)) { + return Optional.none(); + } else { + return predicate(n.item) ? Optional.some(n.item) : hone(universe, n.item, predicate, n.mode, direction, isRoot); + } + }); }; var left$1 = function (universe, item, predicate, isRoot) { - return hone(universe, item, predicate, sidestep, Walkers.left(), isRoot); + return hone(universe, item, predicate, sidestep, Walkers.left(), isRoot); }; var right$1 = function (universe, item, predicate, isRoot) { - return hone(universe, item, predicate, sidestep, Walkers.right(), isRoot); + return hone(universe, item, predicate, sidestep, Walkers.right(), isRoot); }; var isLeaf = function (universe) { - return function (element) { - return universe.property().children(element).length === 0; - }; + return function (element) { + return universe.property().children(element).length === 0; + }; }; var before$3 = function (universe, item, isRoot) { - return seekLeft(universe, item, isLeaf(universe), isRoot); + return seekLeft(universe, item, isLeaf(universe), isRoot); }; var after$4 = function (universe, item, isRoot) { - return seekRight(universe, item, isLeaf(universe), isRoot); + return seekRight(universe, item, isLeaf(universe), isRoot); }; var seekLeft = left$1; var seekRight = right$1; var universe$3 = DomUniverse(); var before$4 = function (element, isRoot) { - return before$3(universe$3, element, isRoot); + return before$3(universe$3, element, isRoot); }; var after$5 = function (element, isRoot) { - return after$4(universe$3, element, isRoot); + return after$4(universe$3, element, isRoot); }; var seekLeft$1 = function (element, predicate, isRoot) { - return seekLeft(universe$3, element, predicate, isRoot); + return seekLeft(universe$3, element, predicate, isRoot); }; var seekRight$1 = function (element, predicate, isRoot) { - return seekRight(universe$3, element, predicate, isRoot); + return seekRight(universe$3, element, predicate, isRoot); }; var ancestor$2 = function (scope, predicate, isRoot) { - return ancestor(scope, predicate, isRoot).isSome(); + return ancestor(scope, predicate, isRoot).isSome(); }; var adt$6 = Adt.generate([ - {none: ['message']}, - {success: []}, - {failedUp: ['cell']}, - {failedDown: ['cell']} + { none: ['message'] }, + { success: [] }, + { failedUp: ['cell'] }, + { failedDown: ['cell'] } ]); var isOverlapping = function (bridge, before, after) { - var beforeBounds = bridge.getRect(before); - var afterBounds = bridge.getRect(after); - return afterBounds.right > beforeBounds.left && afterBounds.left < beforeBounds.right; + var beforeBounds = bridge.getRect(before); + var afterBounds = bridge.getRect(after); + return afterBounds.right > beforeBounds.left && afterBounds.left < beforeBounds.right; }; var isRow = function (elem) { - return closest$1(elem, 'tr'); + return closest$1(elem, 'tr'); }; var verify = function (bridge, before, beforeOffset, after, afterOffset, failure, isRoot) { - return closest$1(after, 'td,th', isRoot).bind(function (afterCell) { - return closest$1(before, 'td,th', isRoot).map(function (beforeCell) { - if (!eq$1(afterCell, beforeCell)) { - return sharedOne$1(isRow, [ - afterCell, - beforeCell - ]).fold(function () { - return isOverlapping(bridge, beforeCell, afterCell) ? adt$6.success() : failure(beforeCell); - }, function (_sharedRow) { - return failure(beforeCell); - }); - } else { - return eq$1(after, afterCell) && getEnd(afterCell) === afterOffset ? failure(beforeCell) : adt$6.none('in same cell'); - } - }); - }).getOr(adt$6.none('default')); + return closest$1(after, 'td,th', isRoot).bind(function (afterCell) { + return closest$1(before, 'td,th', isRoot).map(function (beforeCell) { + if (!eq$1(afterCell, beforeCell)) { + return sharedOne$1(isRow, [ + afterCell, + beforeCell + ]).fold(function () { + return isOverlapping(bridge, beforeCell, afterCell) ? adt$6.success() : failure(beforeCell); + }, function (_sharedRow) { + return failure(beforeCell); + }); + } else { + return eq$1(after, afterCell) && getEnd(afterCell) === afterOffset ? failure(beforeCell) : adt$6.none('in same cell'); + } + }); + }).getOr(adt$6.none('default')); }; var cata$2 = function (subject, onNone, onSuccess, onFailedUp, onFailedDown) { - return subject.fold(onNone, onSuccess, onFailedUp, onFailedDown); + return subject.fold(onNone, onSuccess, onFailedUp, onFailedDown); }; var BeforeAfter = __assign(__assign({}, adt$6), { - verify: verify, - cata: cata$2 + verify: verify, + cata: cata$2 }); var inParent = function (parent, children, element, index) { - return { - parent: parent, - children: children, - element: element, - index: index - }; + return { + parent: parent, + children: children, + element: element, + index: index + }; }; var indexInParent = function (element) { - return parent(element).bind(function (parent) { - var children$1 = children(parent); - return indexOf(children$1, element).map(function (index) { - return inParent(parent, children$1, element, index); - }); + return parent(element).bind(function (parent) { + var children$1 = children(parent); + return indexOf(children$1, element).map(function (index) { + return inParent(parent, children$1, element, index); }); + }); }; var indexOf = function (elements, element) { - return findIndex(elements, curry(eq$1, element)); + return findIndex(elements, curry(eq$1, element)); }; var isBr = function (elem) { - return name(elem) === 'br'; + return name(elem) === 'br'; }; var gatherer = function (cand, gather, isRoot) { - return gather(cand, isRoot).bind(function (target) { - return isText(target) && get$4(target).trim().length === 0 ? gatherer(target, gather, isRoot) : Optional.some(target); - }); + return gather(cand, isRoot).bind(function (target) { + return isText(target) && get$4(target).trim().length === 0 ? gatherer(target, gather, isRoot) : Optional.some(target); + }); }; var handleBr = function (isRoot, element, direction) { - return direction.traverse(element).orThunk(function () { - return gatherer(element, direction.gather, isRoot); - }).map(direction.relative); + return direction.traverse(element).orThunk(function () { + return gatherer(element, direction.gather, isRoot); + }).map(direction.relative); }; var findBr = function (element, offset) { - return child(element, offset).filter(isBr).orThunk(function () { - return child(element, offset - 1).filter(isBr); - }); + return child(element, offset).filter(isBr).orThunk(function () { + return child(element, offset - 1).filter(isBr); + }); }; var handleParent = function (isRoot, element, offset, direction) { - return findBr(element, offset).bind(function (br) { - return direction.traverse(br).fold(function () { - return gatherer(br, direction.gather, isRoot).map(direction.relative); - }, function (adjacent) { - return indexInParent(adjacent).map(function (info) { - return Situ.on(info.parent, info.index); - }); - }); + return findBr(element, offset).bind(function (br) { + return direction.traverse(br).fold(function () { + return gatherer(br, direction.gather, isRoot).map(direction.relative); + }, function (adjacent) { + return indexInParent(adjacent).map(function (info) { + return Situ.on(info.parent, info.index); + }); }); + }); }; var tryBr = function (isRoot, element, offset, direction) { - var target = isBr(element) ? handleBr(isRoot, element, direction) : handleParent(isRoot, element, offset, direction); - return target.map(function (tgt) { - return { - start: tgt, - finish: tgt - }; - }); + var target = isBr(element) ? handleBr(isRoot, element, direction) : handleParent(isRoot, element, offset, direction); + return target.map(function (tgt) { + return { + start: tgt, + finish: tgt + }; + }); }; var process = function (analysis) { - return BeforeAfter.cata(analysis, function (_message) { - return Optional.none(); - }, function () { - return Optional.none(); - }, function (cell) { - return Optional.some(point(cell, 0)); - }, function (cell) { - return Optional.some(point(cell, getEnd(cell))); - }); + return BeforeAfter.cata(analysis, function (_message) { + return Optional.none(); + }, function () { + return Optional.none(); + }, function (cell) { + return Optional.some(point(cell, 0)); + }, function (cell) { + return Optional.some(point(cell, getEnd(cell))); + }); }; var moveDown = function (caret, amount) { - return { - left: caret.left, - top: caret.top + amount, - right: caret.right, - bottom: caret.bottom + amount - }; + return { + left: caret.left, + top: caret.top + amount, + right: caret.right, + bottom: caret.bottom + amount + }; }; var moveUp = function (caret, amount) { - return { - left: caret.left, - top: caret.top - amount, - right: caret.right, - bottom: caret.bottom - amount - }; + return { + left: caret.left, + top: caret.top - amount, + right: caret.right, + bottom: caret.bottom - amount + }; }; - var translate = function (caret, xDelta, yDelta) { - return { - left: caret.left + xDelta, - top: caret.top + yDelta, - right: caret.right + xDelta, - bottom: caret.bottom + yDelta - }; + var translate = function (caret, xDelta, yDelta) { + return { + left: caret.left + xDelta, + top: caret.top + yDelta, + right: caret.right + xDelta, + bottom: caret.bottom + yDelta + }; }; var getTop$1 = function (caret) { - return caret.top; + return caret.top; }; var getBottom = function (caret) { - return caret.bottom; + return caret.bottom; }; var getPartialBox = function (bridge, element, offset) { - if (offset >= 0 && offset < getEnd(element)) { - return bridge.getRangedRect(element, offset, element, offset + 1); - } else if (offset > 0) { - return bridge.getRangedRect(element, offset - 1, element, offset); - } - return Optional.none(); + if (offset >= 0 && offset < getEnd(element)) { + return bridge.getRangedRect(element, offset, element, offset + 1); + } else if (offset > 0) { + return bridge.getRangedRect(element, offset - 1, element, offset); + } + return Optional.none(); }; var toCaret = function (rect) { - return { - left: rect.left, - top: rect.top, - right: rect.right, - bottom: rect.bottom - }; + return { + left: rect.left, + top: rect.top, + right: rect.right, + bottom: rect.bottom + }; }; var getElemBox = function (bridge, element) { - return Optional.some(bridge.getRect(element)); + return Optional.some(bridge.getRect(element)); }; var getBoxAt = function (bridge, element, offset) { - if (isElement(element)) { - return getElemBox(bridge, element).map(toCaret); - } else if (isText(element)) { - return getPartialBox(bridge, element, offset).map(toCaret); - } else { - return Optional.none(); - } + if (isElement(element)) { + return getElemBox(bridge, element).map(toCaret); + } else if (isText(element)) { + return getPartialBox(bridge, element, offset).map(toCaret); + } else { + return Optional.none(); + } }; var getEntireBox = function (bridge, element) { - if (isElement(element)) { - return getElemBox(bridge, element).map(toCaret); - } else if (isText(element)) { - return bridge.getRangedRect(element, 0, element, getEnd(element)).map(toCaret); - } else { - return Optional.none(); - } + if (isElement(element)) { + return getElemBox(bridge, element).map(toCaret); + } else if (isText(element)) { + return bridge.getRangedRect(element, 0, element, getEnd(element)).map(toCaret); + } else { + return Optional.none(); + } }; var JUMP_SIZE = 5; var NUM_RETRIES = 100; var adt$7 = Adt.generate([ - {none: []}, - {retry: ['caret']} + { none: [] }, + { retry: ['caret'] } ]); var isOutside = function (caret, box) { - return caret.left < box.left || Math.abs(box.right - caret.left) < 1 || caret.left > box.right; + return caret.left < box.left || Math.abs(box.right - caret.left) < 1 || caret.left > box.right; }; var inOutsideBlock = function (bridge, element, caret) { - return closest(element, isBlock$1).fold(never, function (cell) { - return getEntireBox(bridge, cell).exists(function (box) { - return isOutside(caret, box); - }); + return closest(element, isBlock$1).fold(never, function (cell) { + return getEntireBox(bridge, cell).exists(function (box) { + return isOutside(caret, box); }); + }); }; var adjustDown = function (bridge, element, guessBox, original, caret) { - var lowerCaret = moveDown(caret, JUMP_SIZE); - if (Math.abs(guessBox.bottom - original.bottom) < 1) { - return adt$7.retry(lowerCaret); - } else if (guessBox.top > caret.bottom) { - return adt$7.retry(lowerCaret); - } else if (guessBox.top === caret.bottom) { - return adt$7.retry(moveDown(caret, 1)); - } else { - return inOutsideBlock(bridge, element, caret) ? adt$7.retry(translate(lowerCaret, JUMP_SIZE, 0)) : adt$7.none(); - } + var lowerCaret = moveDown(caret, JUMP_SIZE); + if (Math.abs(guessBox.bottom - original.bottom) < 1) { + return adt$7.retry(lowerCaret); + } else if (guessBox.top > caret.bottom) { + return adt$7.retry(lowerCaret); + } else if (guessBox.top === caret.bottom) { + return adt$7.retry(moveDown(caret, 1)); + } else { + return inOutsideBlock(bridge, element, caret) ? adt$7.retry(translate(lowerCaret, JUMP_SIZE, 0)) : adt$7.none(); + } }; var adjustUp = function (bridge, element, guessBox, original, caret) { - var higherCaret = moveUp(caret, JUMP_SIZE); - if (Math.abs(guessBox.top - original.top) < 1) { - return adt$7.retry(higherCaret); - } else if (guessBox.bottom < caret.top) { - return adt$7.retry(higherCaret); - } else if (guessBox.bottom === caret.top) { - return adt$7.retry(moveUp(caret, 1)); - } else { - return inOutsideBlock(bridge, element, caret) ? adt$7.retry(translate(higherCaret, JUMP_SIZE, 0)) : adt$7.none(); - } + var higherCaret = moveUp(caret, JUMP_SIZE); + if (Math.abs(guessBox.top - original.top) < 1) { + return adt$7.retry(higherCaret); + } else if (guessBox.bottom < caret.top) { + return adt$7.retry(higherCaret); + } else if (guessBox.bottom === caret.top) { + return adt$7.retry(moveUp(caret, 1)); + } else { + return inOutsideBlock(bridge, element, caret) ? adt$7.retry(translate(higherCaret, JUMP_SIZE, 0)) : adt$7.none(); + } }; var upMovement = { - point: getTop$1, - adjuster: adjustUp, - move: moveUp, - gather: before$4 + point: getTop$1, + adjuster: adjustUp, + move: moveUp, + gather: before$4 }; var downMovement = { - point: getBottom, - adjuster: adjustDown, - move: moveDown, - gather: after$5 + point: getBottom, + adjuster: adjustDown, + move: moveDown, + gather: after$5 }; var isAtTable = function (bridge, x, y) { - return bridge.elementFromPoint(x, y).filter(function (elm) { - return name(elm) === 'table'; - }).isSome(); + return bridge.elementFromPoint(x, y).filter(function (elm) { + return name(elm) === 'table'; + }).isSome(); }; var adjustForTable = function (bridge, movement, original, caret, numRetries) { - return adjustTil(bridge, movement, original, movement.move(caret, JUMP_SIZE), numRetries); + return adjustTil(bridge, movement, original, movement.move(caret, JUMP_SIZE), numRetries); }; var adjustTil = function (bridge, movement, original, caret, numRetries) { - if (numRetries === 0) { + if (numRetries === 0) { + return Optional.some(caret); + } + if (isAtTable(bridge, caret.left, movement.point(caret))) { + return adjustForTable(bridge, movement, original, caret, numRetries - 1); + } + return bridge.situsFromPoint(caret.left, movement.point(caret)).bind(function (guess) { + return guess.start.fold(Optional.none, function (element) { + return getEntireBox(bridge, element).bind(function (guessBox) { + return movement.adjuster(bridge, element, guessBox, original, caret).fold(Optional.none, function (newCaret) { + return adjustTil(bridge, movement, original, newCaret, numRetries - 1); + }); + }).orThunk(function () { return Optional.some(caret); - } - if (isAtTable(bridge, caret.left, movement.point(caret))) { - return adjustForTable(bridge, movement, original, caret, numRetries - 1); - } - return bridge.situsFromPoint(caret.left, movement.point(caret)).bind(function (guess) { - return guess.start.fold(Optional.none, function (element) { - return getEntireBox(bridge, element).bind(function (guessBox) { - return movement.adjuster(bridge, element, guessBox, original, caret).fold(Optional.none, function (newCaret) { - return adjustTil(bridge, movement, original, newCaret, numRetries - 1); - }); - }).orThunk(function () { - return Optional.some(caret); - }); - }, Optional.none); - }); + }); + }, Optional.none); + }); }; var ieTryDown = function (bridge, caret) { - return bridge.situsFromPoint(caret.left, caret.bottom + JUMP_SIZE); + return bridge.situsFromPoint(caret.left, caret.bottom + JUMP_SIZE); }; var ieTryUp = function (bridge, caret) { - return bridge.situsFromPoint(caret.left, caret.top - JUMP_SIZE); + return bridge.situsFromPoint(caret.left, caret.top - JUMP_SIZE); }; var checkScroll = function (movement, adjusted, bridge) { - if (movement.point(adjusted) > bridge.getInnerHeight()) { - return Optional.some(movement.point(adjusted) - bridge.getInnerHeight()); - } else if (movement.point(adjusted) < 0) { - return Optional.some(-movement.point(adjusted)); - } else { - return Optional.none(); - } + if (movement.point(adjusted) > bridge.getInnerHeight()) { + return Optional.some(movement.point(adjusted) - bridge.getInnerHeight()); + } else if (movement.point(adjusted) < 0) { + return Optional.some(-movement.point(adjusted)); + } else { + return Optional.none(); + } }; var retry = function (movement, bridge, caret) { - var moved = movement.move(caret, JUMP_SIZE); - var adjusted = adjustTil(bridge, movement, caret, moved, NUM_RETRIES).getOr(moved); - return checkScroll(movement, adjusted, bridge).fold(function () { - return bridge.situsFromPoint(adjusted.left, movement.point(adjusted)); - }, function (delta) { - bridge.scrollBy(0, delta); - return bridge.situsFromPoint(adjusted.left, movement.point(adjusted) - delta); - }); + var moved = movement.move(caret, JUMP_SIZE); + var adjusted = adjustTil(bridge, movement, caret, moved, NUM_RETRIES).getOr(moved); + return checkScroll(movement, adjusted, bridge).fold(function () { + return bridge.situsFromPoint(adjusted.left, movement.point(adjusted)); + }, function (delta) { + bridge.scrollBy(0, delta); + return bridge.situsFromPoint(adjusted.left, movement.point(adjusted) - delta); + }); }; var Retries = { - tryUp: curry(retry, upMovement), - tryDown: curry(retry, downMovement), - ieTryUp: ieTryUp, - ieTryDown: ieTryDown, - getJumpSize: constant(JUMP_SIZE) + tryUp: curry(retry, upMovement), + tryDown: curry(retry, downMovement), + ieTryUp: ieTryUp, + ieTryDown: ieTryDown, + getJumpSize: constant(JUMP_SIZE) }; var MAX_RETRIES = 20; var findSpot = function (bridge, isRoot, direction) { - return bridge.getSelection().bind(function (sel) { - return tryBr(isRoot, sel.finish, sel.foffset, direction).fold(function () { - return Optional.some(point(sel.finish, sel.foffset)); - }, function (brNeighbour) { - var range = bridge.fromSitus(brNeighbour); - var analysis = BeforeAfter.verify(bridge, sel.finish, sel.foffset, range.finish, range.foffset, direction.failure, isRoot); - return process(analysis); - }); + return bridge.getSelection().bind(function (sel) { + return tryBr(isRoot, sel.finish, sel.foffset, direction).fold(function () { + return Optional.some(point(sel.finish, sel.foffset)); + }, function (brNeighbour) { + var range = bridge.fromSitus(brNeighbour); + var analysis = BeforeAfter.verify(bridge, sel.finish, sel.foffset, range.finish, range.foffset, direction.failure, isRoot); + return process(analysis); }); + }); }; var scan$1 = function (bridge, isRoot, element, offset, direction, numRetries) { - if (numRetries === 0) { - return Optional.none(); - } - return tryCursor(bridge, isRoot, element, offset, direction).bind(function (situs) { - var range = bridge.fromSitus(situs); - var analysis = BeforeAfter.verify(bridge, element, offset, range.finish, range.foffset, direction.failure, isRoot); - return BeforeAfter.cata(analysis, function () { - return Optional.none(); - }, function () { - return Optional.some(situs); - }, function (cell) { - if (eq$1(element, cell) && offset === 0) { - return tryAgain(bridge, element, offset, moveUp, direction); - } else { - return scan$1(bridge, isRoot, cell, 0, direction, numRetries - 1); - } - }, function (cell) { - if (eq$1(element, cell) && offset === getEnd(cell)) { - return tryAgain(bridge, element, offset, moveDown, direction); - } else { - return scan$1(bridge, isRoot, cell, getEnd(cell), direction, numRetries - 1); - } - }); + if (numRetries === 0) { + return Optional.none(); + } + return tryCursor(bridge, isRoot, element, offset, direction).bind(function (situs) { + var range = bridge.fromSitus(situs); + var analysis = BeforeAfter.verify(bridge, element, offset, range.finish, range.foffset, direction.failure, isRoot); + return BeforeAfter.cata(analysis, function () { + return Optional.none(); + }, function () { + return Optional.some(situs); + }, function (cell) { + if (eq$1(element, cell) && offset === 0) { + return tryAgain(bridge, element, offset, moveUp, direction); + } else { + return scan$1(bridge, isRoot, cell, 0, direction, numRetries - 1); + } + }, function (cell) { + if (eq$1(element, cell) && offset === getEnd(cell)) { + return tryAgain(bridge, element, offset, moveDown, direction); + } else { + return scan$1(bridge, isRoot, cell, getEnd(cell), direction, numRetries - 1); + } }); + }); }; var tryAgain = function (bridge, element, offset, move, direction) { - return getBoxAt(bridge, element, offset).bind(function (box) { - return tryAt(bridge, direction, move(box, Retries.getJumpSize())); - }); + return getBoxAt(bridge, element, offset).bind(function (box) { + return tryAt(bridge, direction, move(box, Retries.getJumpSize())); + }); }; var tryAt = function (bridge, direction, box) { - var browser = detect$3().browser; - if (browser.isChrome() || browser.isSafari() || browser.isFirefox() || browser.isEdge()) { - return direction.otherRetry(bridge, box); - } else if (browser.isIE()) { - return direction.ieRetry(bridge, box); - } else { - return Optional.none(); - } + var browser = detect$3().browser; + if (browser.isChrome() || browser.isSafari() || browser.isFirefox() || browser.isEdge()) { + return direction.otherRetry(bridge, box); + } else if (browser.isIE()) { + return direction.ieRetry(bridge, box); + } else { + return Optional.none(); + } }; var tryCursor = function (bridge, isRoot, element, offset, direction) { - return getBoxAt(bridge, element, offset).bind(function (box) { - return tryAt(bridge, direction, box); - }); + return getBoxAt(bridge, element, offset).bind(function (box) { + return tryAt(bridge, direction, box); + }); }; var handle$2 = function (bridge, isRoot, direction) { - return findSpot(bridge, isRoot, direction).bind(function (spot) { - return scan$1(bridge, isRoot, spot.element, spot.offset, direction, MAX_RETRIES).map(bridge.fromSitus); - }); + return findSpot(bridge, isRoot, direction).bind(function (spot) { + return scan$1(bridge, isRoot, spot.element, spot.offset, direction, MAX_RETRIES).map(bridge.fromSitus); + }); }; var inSameTable = function (elem, table) { - return ancestor$2(elem, function (e) { - return parent(e).exists(function (p) { - return eq$1(p, table); - }); + return ancestor$2(elem, function (e) { + return parent(e).exists(function (p) { + return eq$1(p, table); }); + }); }; var simulate = function (bridge, isRoot, direction, initial, anchor) { - return closest$1(initial, 'td,th', isRoot).bind(function (start) { - return closest$1(start, 'table', isRoot).bind(function (table) { - if (!inSameTable(anchor, table)) { - return Optional.none(); - } - return handle$2(bridge, isRoot, direction).bind(function (range) { - return closest$1(range.finish, 'td,th', isRoot).map(function (finish) { - return { - start: start, - finish: finish, - range: range - }; - }); - }); + return closest$1(initial, 'td,th', isRoot).bind(function (start) { + return closest$1(start, 'table', isRoot).bind(function (table) { + if (!inSameTable(anchor, table)) { + return Optional.none(); + } + return handle$2(bridge, isRoot, direction).bind(function (range) { + return closest$1(range.finish, 'td,th', isRoot).map(function (finish) { + return { + start: start, + finish: finish, + range: range + }; }); + }); }); + }); }; var navigate = function (bridge, isRoot, direction, initial, anchor, precheck) { - if (detect$3().browser.isIE()) { - return Optional.none(); - } else { - return precheck(initial, isRoot).orThunk(function () { - return simulate(bridge, isRoot, direction, initial, anchor).map(function (info) { - var range = info.range; - return Response.create(Optional.some(makeSitus(range.start, range.soffset, range.finish, range.foffset)), true); - }); - }); - } + if (detect$3().browser.isIE()) { + return Optional.none(); + } else { + return precheck(initial, isRoot).orThunk(function () { + return simulate(bridge, isRoot, direction, initial, anchor).map(function (info) { + var range = info.range; + return Response.create(Optional.some(makeSitus(range.start, range.soffset, range.finish, range.foffset)), true); + }); + }); + } }; var firstUpCheck = function (initial, isRoot) { - return closest$1(initial, 'tr', isRoot).bind(function (startRow) { - return closest$1(startRow, 'table', isRoot).bind(function (table) { - var rows = descendants$1(table, 'tr'); - if (eq$1(startRow, rows[0])) { - return seekLeft$1(table, function (element) { - return last$1(element).isSome(); - }, isRoot).map(function (last) { - var lastOffset = getEnd(last); - return Response.create(Optional.some(makeSitus(last, lastOffset, last, lastOffset)), true); - }); - } else { - return Optional.none(); - } - }); + return closest$1(initial, 'tr', isRoot).bind(function (startRow) { + return closest$1(startRow, 'table', isRoot).bind(function (table) { + var rows = descendants$1(table, 'tr'); + if (eq$1(startRow, rows[0])) { + return seekLeft$1(table, function (element) { + return last$1(element).isSome(); + }, isRoot).map(function (last) { + var lastOffset = getEnd(last); + return Response.create(Optional.some(makeSitus(last, lastOffset, last, lastOffset)), true); + }); + } else { + return Optional.none(); + } }); + }); }; var lastDownCheck = function (initial, isRoot) { - return closest$1(initial, 'tr', isRoot).bind(function (startRow) { - return closest$1(startRow, 'table', isRoot).bind(function (table) { - var rows = descendants$1(table, 'tr'); - if (eq$1(startRow, rows[rows.length - 1])) { - return seekRight$1(table, function (element) { - return first(element).isSome(); - }, isRoot).map(function (first) { - return Response.create(Optional.some(makeSitus(first, 0, first, 0)), true); - }); - } else { - return Optional.none(); - } - }); + return closest$1(initial, 'tr', isRoot).bind(function (startRow) { + return closest$1(startRow, 'table', isRoot).bind(function (table) { + var rows = descendants$1(table, 'tr'); + if (eq$1(startRow, rows[rows.length - 1])) { + return seekRight$1(table, function (element) { + return first(element).isSome(); + }, isRoot).map(function (first) { + return Response.create(Optional.some(makeSitus(first, 0, first, 0)), true); + }); + } else { + return Optional.none(); + } }); + }); }; var select = function (bridge, container, isRoot, direction, initial, anchor, selectRange) { - return simulate(bridge, isRoot, direction, initial, anchor).bind(function (info) { - return detect$6(container, isRoot, info.start, info.finish, selectRange); - }); + return simulate(bridge, isRoot, direction, initial, anchor).bind(function (info) { + return detect$6(container, isRoot, info.start, info.finish, selectRange); + }); }; var value$1 = function () { - var subject = Cell(Optional.none()); - var clear = function () { - return subject.set(Optional.none()); - }; - var set = function (s) { - return subject.set(Optional.some(s)); - }; - var isSet = function () { - return subject.get().isSome(); - }; - var on = function (f) { - return subject.get().each(f); - }; - return { - clear: clear, - set: set, - isSet: isSet, - on: on - }; + var subject = Cell(Optional.none()); + var clear = function () { + return subject.set(Optional.none()); + }; + var set = function (s) { + return subject.set(Optional.some(s)); + }; + var isSet = function () { + return subject.get().isSome(); + }; + var on = function (f) { + return subject.get().each(f); + }; + return { + clear: clear, + set: set, + isSet: isSet, + on: on + }; }; var findCell = function (target, isRoot) { - return closest$1(target, 'td,th', isRoot); - }; - - function MouseSelection(bridge, container, isRoot, annotations) { - var cursor = value$1(); - var clearstate = cursor.clear; - var mousedown = function (event) { - annotations.clear(container); - findCell(event.target, isRoot).each(cursor.set); - }; - var mouseover = function (event) { - cursor.on(function (start) { - annotations.clearBeforeUpdate(container); - findCell(event.target, isRoot).each(function (finish) { - identify(start, finish, isRoot).each(function (cellSel) { - var boxes = cellSel.boxes.getOr([]); - if (boxes.length > 1 || boxes.length === 1 && !eq$1(start, finish)) { - annotations.selectRange(container, boxes, cellSel.start, cellSel.finish); - bridge.selectContents(finish); - } - }); - }); - }); - }; - var mouseup = function (_event) { - clearstate(); - }; - return { - clearstate: clearstate, - mousedown: mousedown, - mouseover: mouseover, - mouseup: mouseup - }; + return closest$1(target, 'td,th', isRoot); + }; + function MouseSelection (bridge, container, isRoot, annotations) { + var cursor = value$1(); + var clearstate = cursor.clear; + var mousedown = function (event) { + annotations.clear(container); + findCell(event.target, isRoot).each(cursor.set); + }; + var mouseover = function (event) { + cursor.on(function (start) { + annotations.clearBeforeUpdate(container); + findCell(event.target, isRoot).each(function (finish) { + identify(start, finish, isRoot).each(function (cellSel) { + var boxes = cellSel.boxes.getOr([]); + if (boxes.length > 1 || boxes.length === 1 && !eq$1(start, finish)) { + annotations.selectRange(container, boxes, cellSel.start, cellSel.finish); + bridge.selectContents(finish); + } + }); + }); + }); + }; + var mouseup = function (_event) { + clearstate(); + }; + return { + clearstate: clearstate, + mousedown: mousedown, + mouseover: mouseover, + mouseup: mouseup + }; } var down = { - traverse: nextSibling, - gather: after$5, - relative: Situ.before, - otherRetry: Retries.tryDown, - ieRetry: Retries.ieTryDown, - failure: BeforeAfter.failedDown + traverse: nextSibling, + gather: after$5, + relative: Situ.before, + otherRetry: Retries.tryDown, + ieRetry: Retries.ieTryDown, + failure: BeforeAfter.failedDown }; var up = { - traverse: prevSibling, - gather: before$4, - relative: Situ.before, - otherRetry: Retries.tryUp, - ieRetry: Retries.ieTryUp, - failure: BeforeAfter.failedUp + traverse: prevSibling, + gather: before$4, + relative: Situ.before, + otherRetry: Retries.tryUp, + ieRetry: Retries.ieTryUp, + failure: BeforeAfter.failedUp }; var isKey = function (key) { - return function (keycode) { - return keycode === key; - }; + return function (keycode) { + return keycode === key; + }; }; var isUp = isKey(38); var isDown = isKey(40); var isNavigation = function (keycode) { - return keycode >= 37 && keycode <= 40; + return keycode >= 37 && keycode <= 40; }; var ltr$2 = { - isBackward: isKey(37), - isForward: isKey(39) + isBackward: isKey(37), + isForward: isKey(39) }; var rtl$2 = { - isBackward: isKey(39), - isForward: isKey(37) + isBackward: isKey(39), + isForward: isKey(37) }; var get$d = function (_DOC) { - var doc = _DOC !== undefined ? _DOC.dom : document; - var x = doc.body.scrollLeft || doc.documentElement.scrollLeft; - var y = doc.body.scrollTop || doc.documentElement.scrollTop; - return SugarPosition(x, y); + var doc = _DOC !== undefined ? _DOC.dom : document; + var x = doc.body.scrollLeft || doc.documentElement.scrollLeft; + var y = doc.body.scrollTop || doc.documentElement.scrollTop; + return SugarPosition(x, y); }; var by = function (x, y, _DOC) { - var doc = _DOC !== undefined ? _DOC.dom : document; - var win = doc.defaultView; - if (win) { - win.scrollBy(x, y); - } + var doc = _DOC !== undefined ? _DOC.dom : document; + var win = doc.defaultView; + if (win) { + win.scrollBy(x, y); + } }; var WindowBridge = function (win) { - var elementFromPoint = function (x, y) { - return SugarElement.fromPoint(SugarElement.fromDom(win.document), x, y); - }; - var getRect = function (element) { - return element.dom.getBoundingClientRect(); - }; - var getRangedRect = function (start, soffset, finish, foffset) { - var sel = SimSelection.exact(start, soffset, finish, foffset); - return getFirstRect$1(win, sel); - }; - var getSelection = function () { - return get$c(win).map(function (exactAdt) { - return convertToRange(win, exactAdt); - }); - }; - var fromSitus = function (situs) { - var relative = SimSelection.relative(situs.start, situs.finish); - return convertToRange(win, relative); - }; - var situsFromPoint = function (x, y) { - return getAtPoint(win, x, y).map(function (exact) { - return Situs.create(exact.start, exact.soffset, exact.finish, exact.foffset); - }); - }; - var clearSelection = function () { - clear(win); - }; - var collapseSelection = function (toStart) { - if (toStart === void 0) { - toStart = false; - } - get$c(win).each(function (sel) { - return sel.fold(function (rng) { - return rng.collapse(toStart); - }, function (startSitu, finishSitu) { - var situ = toStart ? startSitu : finishSitu; - setRelative(win, situ, situ); - }, function (start, soffset, finish, foffset) { - var node = toStart ? start : finish; - var offset = toStart ? soffset : foffset; - setExact(win, node, offset, node, offset); - }); - }); - }; - var selectContents = function (element) { - setToElement(win, element); - }; - var setSelection = function (sel) { - setExact(win, sel.start, sel.soffset, sel.finish, sel.foffset); - }; - var setRelativeSelection = function (start, finish) { - setRelative(win, start, finish); - }; - var getInnerHeight = function () { - return win.innerHeight; - }; - var getScrollY = function () { - var pos = get$d(SugarElement.fromDom(win.document)); - return pos.top; - }; - var scrollBy = function (x, y) { - by(x, y, SugarElement.fromDom(win.document)); - }; - return { - elementFromPoint: elementFromPoint, - getRect: getRect, - getRangedRect: getRangedRect, - getSelection: getSelection, - fromSitus: fromSitus, - situsFromPoint: situsFromPoint, - clearSelection: clearSelection, - collapseSelection: collapseSelection, - setSelection: setSelection, - setRelativeSelection: setRelativeSelection, - selectContents: selectContents, - getInnerHeight: getInnerHeight, - getScrollY: getScrollY, - scrollBy: scrollBy - }; + var elementFromPoint = function (x, y) { + return SugarElement.fromPoint(SugarElement.fromDom(win.document), x, y); + }; + var getRect = function (element) { + return element.dom.getBoundingClientRect(); + }; + var getRangedRect = function (start, soffset, finish, foffset) { + var sel = SimSelection.exact(start, soffset, finish, foffset); + return getFirstRect$1(win, sel); + }; + var getSelection = function () { + return get$c(win).map(function (exactAdt) { + return convertToRange(win, exactAdt); + }); + }; + var fromSitus = function (situs) { + var relative = SimSelection.relative(situs.start, situs.finish); + return convertToRange(win, relative); + }; + var situsFromPoint = function (x, y) { + return getAtPoint(win, x, y).map(function (exact) { + return Situs.create(exact.start, exact.soffset, exact.finish, exact.foffset); + }); + }; + var clearSelection = function () { + clear(win); + }; + var collapseSelection = function (toStart) { + if (toStart === void 0) { + toStart = false; + } + get$c(win).each(function (sel) { + return sel.fold(function (rng) { + return rng.collapse(toStart); + }, function (startSitu, finishSitu) { + var situ = toStart ? startSitu : finishSitu; + setRelative(win, situ, situ); + }, function (start, soffset, finish, foffset) { + var node = toStart ? start : finish; + var offset = toStart ? soffset : foffset; + setExact(win, node, offset, node, offset); + }); + }); + }; + var selectContents = function (element) { + setToElement(win, element); + }; + var setSelection = function (sel) { + setExact(win, sel.start, sel.soffset, sel.finish, sel.foffset); + }; + var setRelativeSelection = function (start, finish) { + setRelative(win, start, finish); + }; + var getInnerHeight = function () { + return win.innerHeight; + }; + var getScrollY = function () { + var pos = get$d(SugarElement.fromDom(win.document)); + return pos.top; + }; + var scrollBy = function (x, y) { + by(x, y, SugarElement.fromDom(win.document)); + }; + return { + elementFromPoint: elementFromPoint, + getRect: getRect, + getRangedRect: getRangedRect, + getSelection: getSelection, + fromSitus: fromSitus, + situsFromPoint: situsFromPoint, + clearSelection: clearSelection, + collapseSelection: collapseSelection, + setSelection: setSelection, + setRelativeSelection: setRelativeSelection, + selectContents: selectContents, + getInnerHeight: getInnerHeight, + getScrollY: getScrollY, + scrollBy: scrollBy + }; }; var rc = function (rows, cols) { - return { - rows: rows, - cols: cols - }; + return { + rows: rows, + cols: cols + }; }; var mouse = function (win, container, isRoot, annotations) { - var bridge = WindowBridge(win); - var handlers = MouseSelection(bridge, container, isRoot, annotations); - return { - clearstate: handlers.clearstate, - mousedown: handlers.mousedown, - mouseover: handlers.mouseover, - mouseup: handlers.mouseup - }; + var bridge = WindowBridge(win); + var handlers = MouseSelection(bridge, container, isRoot, annotations); + return { + clearstate: handlers.clearstate, + mousedown: handlers.mousedown, + mouseover: handlers.mouseover, + mouseup: handlers.mouseup + }; }; var keyboard = function (win, container, isRoot, annotations) { - var bridge = WindowBridge(win); - var clearToNavigate = function () { - annotations.clear(container); + var bridge = WindowBridge(win); + var clearToNavigate = function () { + annotations.clear(container); + return Optional.none(); + }; + var keydown = function (event, start, soffset, finish, foffset, direction) { + var realEvent = event.raw; + var keycode = realEvent.which; + var shiftKey = realEvent.shiftKey === true; + var handler = retrieve(container, annotations.selectedSelector).fold(function () { + if (isDown(keycode) && shiftKey) { + return curry(select, bridge, container, isRoot, down, finish, start, annotations.selectRange); + } else if (isUp(keycode) && shiftKey) { + return curry(select, bridge, container, isRoot, up, finish, start, annotations.selectRange); + } else if (isDown(keycode)) { + return curry(navigate, bridge, isRoot, down, finish, start, lastDownCheck); + } else if (isUp(keycode)) { + return curry(navigate, bridge, isRoot, up, finish, start, firstUpCheck); + } else { + return Optional.none; + } + }, function (selected) { + var update$1 = function (attempts) { + return function () { + var navigation = findMap(attempts, function (delta) { + return update(delta.rows, delta.cols, container, selected, annotations); + }); + return navigation.fold(function () { + return getEdges(container, annotations.firstSelectedSelector, annotations.lastSelectedSelector).map(function (edges) { + var relative = isDown(keycode) || direction.isForward(keycode) ? Situ.after : Situ.before; + bridge.setRelativeSelection(Situ.on(edges.first, 0), relative(edges.table)); + annotations.clear(container); + return Response.create(Optional.none(), true); + }); + }, function (_) { + return Optional.some(Response.create(Optional.none(), true)); + }); + }; + }; + if (isDown(keycode) && shiftKey) { + return update$1([rc(+1, 0)]); + } else if (isUp(keycode) && shiftKey) { + return update$1([rc(-1, 0)]); + } else if (direction.isBackward(keycode) && shiftKey) { + return update$1([ + rc(0, -1), + rc(-1, 0) + ]); + } else if (direction.isForward(keycode) && shiftKey) { + return update$1([ + rc(0, +1), + rc(+1, 0) + ]); + } else if (isNavigation(keycode) && shiftKey === false) { + return clearToNavigate; + } else { + return Optional.none; + } + }); + return handler(); + }; + var keyup = function (event, start, soffset, finish, foffset) { + return retrieve(container, annotations.selectedSelector).fold(function () { + var realEvent = event.raw; + var keycode = realEvent.which; + var shiftKey = realEvent.shiftKey === true; + if (shiftKey === false) { return Optional.none(); - }; - var keydown = function (event, start, soffset, finish, foffset, direction) { - var realEvent = event.raw; - var keycode = realEvent.which; - var shiftKey = realEvent.shiftKey === true; - var handler = retrieve(container, annotations.selectedSelector).fold(function () { - if (isDown(keycode) && shiftKey) { - return curry(select, bridge, container, isRoot, down, finish, start, annotations.selectRange); - } else if (isUp(keycode) && shiftKey) { - return curry(select, bridge, container, isRoot, up, finish, start, annotations.selectRange); - } else if (isDown(keycode)) { - return curry(navigate, bridge, isRoot, down, finish, start, lastDownCheck); - } else if (isUp(keycode)) { - return curry(navigate, bridge, isRoot, up, finish, start, firstUpCheck); - } else { - return Optional.none; - } - }, function (selected) { - var update$1 = function (attempts) { - return function () { - var navigation = findMap(attempts, function (delta) { - return update(delta.rows, delta.cols, container, selected, annotations); - }); - return navigation.fold(function () { - return getEdges(container, annotations.firstSelectedSelector, annotations.lastSelectedSelector).map(function (edges) { - var relative = isDown(keycode) || direction.isForward(keycode) ? Situ.after : Situ.before; - bridge.setRelativeSelection(Situ.on(edges.first, 0), relative(edges.table)); - annotations.clear(container); - return Response.create(Optional.none(), true); - }); - }, function (_) { - return Optional.some(Response.create(Optional.none(), true)); - }); - }; - }; - if (isDown(keycode) && shiftKey) { - return update$1([rc(+1, 0)]); - } else if (isUp(keycode) && shiftKey) { - return update$1([rc(-1, 0)]); - } else if (direction.isBackward(keycode) && shiftKey) { - return update$1([ - rc(0, -1), - rc(-1, 0) - ]); - } else if (direction.isForward(keycode) && shiftKey) { - return update$1([ - rc(0, +1), - rc(+1, 0) - ]); - } else if (isNavigation(keycode) && shiftKey === false) { - return clearToNavigate; - } else { - return Optional.none; - } - }); - return handler(); - }; - var keyup = function (event, start, soffset, finish, foffset) { - return retrieve(container, annotations.selectedSelector).fold(function () { - var realEvent = event.raw; - var keycode = realEvent.which; - var shiftKey = realEvent.shiftKey === true; - if (shiftKey === false) { - return Optional.none(); - } - if (isNavigation(keycode)) { - return sync(container, isRoot, start, soffset, finish, foffset, annotations.selectRange); - } else { - return Optional.none(); - } - }, Optional.none); - }; - return { - keydown: keydown, - keyup: keyup - }; + } + if (isNavigation(keycode)) { + return sync(container, isRoot, start, soffset, finish, foffset, annotations.selectRange); + } else { + return Optional.none(); + } + }, Optional.none); + }; + return { + keydown: keydown, + keyup: keyup + }; }; var external = function (win, container, isRoot, annotations) { - var bridge = WindowBridge(win); - return function (start, finish) { - annotations.clearBeforeUpdate(container); - identify(start, finish, isRoot).each(function (cellSel) { - var boxes = cellSel.boxes.getOr([]); - annotations.selectRange(container, boxes, cellSel.start, cellSel.finish); - bridge.selectContents(finish); - bridge.collapseSelection(); - }); - }; + var bridge = WindowBridge(win); + return function (start, finish) { + annotations.clearBeforeUpdate(container); + identify(start, finish, isRoot).each(function (cellSel) { + var boxes = cellSel.boxes.getOr([]); + annotations.selectRange(container, boxes, cellSel.start, cellSel.finish); + bridge.selectContents(finish); + bridge.collapseSelection(); + }); + }; }; var remove$7 = function (element, classes) { - each(classes, function (x) { - remove$5(element, x); - }); + each(classes, function (x) { + remove$5(element, x); + }); }; var addClass = function (clazz) { - return function (element) { - add$3(element, clazz); - }; + return function (element) { + add$3(element, clazz); + }; }; var removeClasses = function (classes) { - return function (element) { - remove$7(element, classes); - }; + return function (element) { + remove$7(element, classes); + }; }; var byClass = function (ephemera) { - var addSelectionClass = addClass(ephemera.selected); - var removeSelectionClasses = removeClasses([ - ephemera.selected, - ephemera.lastSelected, - ephemera.firstSelected - ]); - var clear = function (container) { - var sels = descendants$1(container, ephemera.selectedSelector); - each(sels, removeSelectionClasses); - }; - var selectRange = function (container, cells, start, finish) { - clear(container); - each(cells, addSelectionClass); - add$3(start, ephemera.firstSelected); - add$3(finish, ephemera.lastSelected); - }; - return { - clearBeforeUpdate: clear, - clear: clear, - selectRange: selectRange, - selectedSelector: ephemera.selectedSelector, - firstSelectedSelector: ephemera.firstSelectedSelector, - lastSelectedSelector: ephemera.lastSelectedSelector - }; + var addSelectionClass = addClass(ephemera.selected); + var removeSelectionClasses = removeClasses([ + ephemera.selected, + ephemera.lastSelected, + ephemera.firstSelected + ]); + var clear = function (container) { + var sels = descendants$1(container, ephemera.selectedSelector); + each(sels, removeSelectionClasses); + }; + var selectRange = function (container, cells, start, finish) { + clear(container); + each(cells, addSelectionClass); + add$3(start, ephemera.firstSelected); + add$3(finish, ephemera.lastSelected); + }; + return { + clearBeforeUpdate: clear, + clear: clear, + selectRange: selectRange, + selectedSelector: ephemera.selectedSelector, + firstSelectedSelector: ephemera.firstSelectedSelector, + lastSelectedSelector: ephemera.lastSelectedSelector + }; }; var byAttr = function (ephemera, onSelection, onClear) { - var removeSelectionAttributes = function (element) { - remove(element, ephemera.selected); - remove(element, ephemera.firstSelected); - remove(element, ephemera.lastSelected); - }; - var addSelectionAttribute = function (element) { - set(element, ephemera.selected, '1'); - }; - var clear = function (container) { - clearBeforeUpdate(container); - onClear(); - }; - var clearBeforeUpdate = function (container) { - var sels = descendants$1(container, ephemera.selectedSelector); - each(sels, removeSelectionAttributes); - }; - var selectRange = function (container, cells, start, finish) { - clear(container); - each(cells, addSelectionAttribute); - set(start, ephemera.firstSelected, '1'); - set(finish, ephemera.lastSelected, '1'); - onSelection(cells, start, finish); - }; - return { - clearBeforeUpdate: clearBeforeUpdate, - clear: clear, - selectRange: selectRange, - selectedSelector: ephemera.selectedSelector, - firstSelectedSelector: ephemera.firstSelectedSelector, - lastSelectedSelector: ephemera.lastSelectedSelector - }; + var removeSelectionAttributes = function (element) { + remove(element, ephemera.selected); + remove(element, ephemera.firstSelected); + remove(element, ephemera.lastSelected); + }; + var addSelectionAttribute = function (element) { + set(element, ephemera.selected, '1'); + }; + var clear = function (container) { + clearBeforeUpdate(container); + onClear(); + }; + var clearBeforeUpdate = function (container) { + var sels = descendants$1(container, ephemera.selectedSelector); + each(sels, removeSelectionAttributes); + }; + var selectRange = function (container, cells, start, finish) { + clear(container); + each(cells, addSelectionAttribute); + set(start, ephemera.firstSelected, '1'); + set(finish, ephemera.lastSelected, '1'); + onSelection(cells, start, finish); + }; + return { + clearBeforeUpdate: clearBeforeUpdate, + clear: clear, + selectRange: selectRange, + selectedSelector: ephemera.selectedSelector, + firstSelectedSelector: ephemera.firstSelectedSelector, + lastSelectedSelector: ephemera.lastSelectedSelector + }; }; var SelectionAnnotation = { - byClass: byClass, - byAttr: byAttr + byClass: byClass, + byAttr: byAttr }; var getUpOrLeftCells = function (grid, selectedCells, generators) { - var upGrid = grid.slice(0, selectedCells[selectedCells.length - 1].row + 1); - var upDetails = toDetailList(upGrid, generators); - return bind(upDetails, function (detail) { - var slicedCells = detail.cells.slice(0, selectedCells[selectedCells.length - 1].column + 1); - return map(slicedCells, function (cell) { - return cell.element; - }); + var upGrid = grid.slice(0, selectedCells[selectedCells.length - 1].row + 1); + var upDetails = toDetailList(upGrid, generators); + return bind(upDetails, function (detail) { + var slicedCells = detail.cells.slice(0, selectedCells[selectedCells.length - 1].column + 1); + return map(slicedCells, function (cell) { + return cell.element; }); + }); }; var getDownOrRightCells = function (grid, selectedCells, generators) { - var downGrid = grid.slice(selectedCells[0].row + selectedCells[0].rowspan - 1, grid.length); - var downDetails = toDetailList(downGrid, generators); - return bind(downDetails, function (detail) { - var slicedCells = detail.cells.slice(selectedCells[0].column + selectedCells[0].colspan - 1, detail.cells.length); - return map(slicedCells, function (cell) { - return cell.element; - }); + var downGrid = grid.slice(selectedCells[0].row + selectedCells[0].rowspan - 1, grid.length); + var downDetails = toDetailList(downGrid, generators); + return bind(downDetails, function (detail) { + var slicedCells = detail.cells.slice(selectedCells[0].column + selectedCells[0].colspan - 1, detail.cells.length); + return map(slicedCells, function (cell) { + return cell.element; }); + }); }; var getOtherCells = function (table, target, generators) { - var warehouse = Warehouse.fromTable(table); - var details = onCells(warehouse, target); - return details.map(function (selectedCells) { - var grid = toGrid(warehouse, generators, false); - var upOrLeftCells = getUpOrLeftCells(grid, selectedCells, generators); - var downOrRightCells = getDownOrRightCells(grid, selectedCells, generators); - return { - upOrLeftCells: upOrLeftCells, - downOrRightCells: downOrRightCells - }; - }); + var warehouse = Warehouse.fromTable(table); + var details = onCells(warehouse, target); + return details.map(function (selectedCells) { + var grid = toGrid(warehouse, generators, false); + var upOrLeftCells = getUpOrLeftCells(grid, selectedCells, generators); + var downOrRightCells = getDownOrRightCells(grid, selectedCells, generators); + return { + upOrLeftCells: upOrLeftCells, + downOrRightCells: downOrRightCells + }; + }); }; var hasInternalTarget = function (e) { - return has$1(SugarElement.fromDom(e.target), 'ephox-snooker-resizer-bar') === false; - }; - - function CellSelection(editor, lazyResize, selectionTargets) { - var onSelection = function (cells, start, finish) { - selectionTargets.targets().each(function (targets) { - var tableOpt = table(start); - tableOpt.each(function (table) { - var cloneFormats = getCloneElements(editor); - var generators = cellOperations(noop, SugarElement.fromDom(editor.getDoc()), cloneFormats); - var otherCells = getOtherCells(table, targets, generators); - fireTableSelectionChange(editor, cells, start, finish, otherCells); - }); - }); - }; - var onClear = function () { - return fireTableSelectionClear(editor); - }; - var annotations = SelectionAnnotation.byAttr(ephemera, onSelection, onClear); - editor.on('init', function (_e) { - var win = editor.getWin(); - var body = getBody$1(editor); - var isRoot = getIsRoot(editor); - var syncSelection = function () { - var sel = editor.selection; - var start = SugarElement.fromDom(sel.getStart()); - var end = SugarElement.fromDom(sel.getEnd()); - var shared = sharedOne$1(table, [ - start, - end - ]); - shared.fold(function () { - return annotations.clear(body); - }, noop); - }; - var mouseHandlers = mouse(win, body, isRoot, annotations); - var keyHandlers = keyboard(win, body, isRoot, annotations); - var external$1 = external(win, body, isRoot, annotations); - var hasShiftKey = function (event) { - return event.raw.shiftKey === true; - }; - editor.on('TableSelectorChange', function (e) { - return external$1(e.start, e.finish); - }); - var handleResponse = function (event, response) { - if (!hasShiftKey(event)) { - return; - } - if (response.kill) { - event.kill(); - } - response.selection.each(function (ns) { - var relative = SimSelection.relative(ns.start, ns.finish); - var rng = asLtrRange(win, relative); - editor.selection.setRng(rng); - }); - }; - var keyup = function (event) { - var wrappedEvent = fromRawEvent$1(event); - if (wrappedEvent.raw.shiftKey && isNavigation(wrappedEvent.raw.which)) { - var rng = editor.selection.getRng(); - var start = SugarElement.fromDom(rng.startContainer); - var end = SugarElement.fromDom(rng.endContainer); - keyHandlers.keyup(wrappedEvent, start, rng.startOffset, end, rng.endOffset).each(function (response) { - handleResponse(wrappedEvent, response); - }); - } - }; - var keydown = function (event) { - var wrappedEvent = fromRawEvent$1(event); - lazyResize().each(function (resize) { - return resize.hideBars(); - }); - var rng = editor.selection.getRng(); - var start = SugarElement.fromDom(rng.startContainer); - var end = SugarElement.fromDom(rng.endContainer); - var direction = onDirection(ltr$2, rtl$2)(SugarElement.fromDom(editor.selection.getStart())); - keyHandlers.keydown(wrappedEvent, start, rng.startOffset, end, rng.endOffset, direction).each(function (response) { - handleResponse(wrappedEvent, response); - }); - lazyResize().each(function (resize) { - return resize.showBars(); - }); - }; - var isLeftMouse = function (raw) { - return raw.button === 0; - }; - var isLeftButtonPressed = function (raw) { - if (raw.buttons === undefined) { - return true; - } - if (global$2.browser.isEdge() && raw.buttons === 0) { - return true; - } - return (raw.buttons & 1) !== 0; - }; - var dragStart = function (_e) { - mouseHandlers.clearstate(); - }; - var mouseDown = function (e) { - if (isLeftMouse(e) && hasInternalTarget(e)) { - mouseHandlers.mousedown(fromRawEvent$1(e)); - } - }; - var mouseOver = function (e) { - if (isLeftButtonPressed(e) && hasInternalTarget(e)) { - mouseHandlers.mouseover(fromRawEvent$1(e)); - } - }; - var mouseUp = function (e) { - if (isLeftMouse(e) && hasInternalTarget(e)) { - mouseHandlers.mouseup(fromRawEvent$1(e)); - } - }; - var getDoubleTap = function () { - var lastTarget = Cell(SugarElement.fromDom(body)); - var lastTimeStamp = Cell(0); - var touchEnd = function (t) { - var target = SugarElement.fromDom(t.target); - if (name(target) === 'td' || name(target) === 'th') { - var lT = lastTarget.get(); - var lTS = lastTimeStamp.get(); - if (eq$1(lT, target) && t.timeStamp - lTS < 300) { - t.preventDefault(); - external$1(target, target); - } - } - lastTarget.set(target); - lastTimeStamp.set(t.timeStamp); - }; - return {touchEnd: touchEnd}; - }; - var doubleTap = getDoubleTap(); - editor.on('dragstart', dragStart); - editor.on('mousedown', mouseDown); - editor.on('mouseover', mouseOver); - editor.on('mouseup', mouseUp); - editor.on('touchend', doubleTap.touchEnd); - editor.on('keyup', keyup); - editor.on('keydown', keydown); - editor.on('NodeChange', syncSelection); - }); - return {clear: annotations.clear}; + return has$1(SugarElement.fromDom(e.target), 'ephox-snooker-resizer-bar') === false; + }; + function CellSelection (editor, lazyResize, selectionTargets) { + var onSelection = function (cells, start, finish) { + selectionTargets.targets().each(function (targets) { + var tableOpt = table(start); + tableOpt.each(function (table) { + var cloneFormats = getCloneElements(editor); + var generators = cellOperations(noop, SugarElement.fromDom(editor.getDoc()), cloneFormats); + var otherCells = getOtherCells(table, targets, generators); + fireTableSelectionChange(editor, cells, start, finish, otherCells); + }); + }); + }; + var onClear = function () { + return fireTableSelectionClear(editor); + }; + var annotations = SelectionAnnotation.byAttr(ephemera, onSelection, onClear); + editor.on('init', function (_e) { + var win = editor.getWin(); + var body = getBody$1(editor); + var isRoot = getIsRoot(editor); + var syncSelection = function () { + var sel = editor.selection; + var start = SugarElement.fromDom(sel.getStart()); + var end = SugarElement.fromDom(sel.getEnd()); + var shared = sharedOne$1(table, [ + start, + end + ]); + shared.fold(function () { + return annotations.clear(body); + }, noop); + }; + var mouseHandlers = mouse(win, body, isRoot, annotations); + var keyHandlers = keyboard(win, body, isRoot, annotations); + var external$1 = external(win, body, isRoot, annotations); + var hasShiftKey = function (event) { + return event.raw.shiftKey === true; + }; + editor.on('TableSelectorChange', function (e) { + return external$1(e.start, e.finish); + }); + var handleResponse = function (event, response) { + if (!hasShiftKey(event)) { + return; + } + if (response.kill) { + event.kill(); + } + response.selection.each(function (ns) { + var relative = SimSelection.relative(ns.start, ns.finish); + var rng = asLtrRange(win, relative); + editor.selection.setRng(rng); + }); + }; + var keyup = function (event) { + var wrappedEvent = fromRawEvent$1(event); + if (wrappedEvent.raw.shiftKey && isNavigation(wrappedEvent.raw.which)) { + var rng = editor.selection.getRng(); + var start = SugarElement.fromDom(rng.startContainer); + var end = SugarElement.fromDom(rng.endContainer); + keyHandlers.keyup(wrappedEvent, start, rng.startOffset, end, rng.endOffset).each(function (response) { + handleResponse(wrappedEvent, response); + }); + } + }; + var keydown = function (event) { + var wrappedEvent = fromRawEvent$1(event); + lazyResize().each(function (resize) { + return resize.hideBars(); + }); + var rng = editor.selection.getRng(); + var start = SugarElement.fromDom(rng.startContainer); + var end = SugarElement.fromDom(rng.endContainer); + var direction = onDirection(ltr$2, rtl$2)(SugarElement.fromDom(editor.selection.getStart())); + keyHandlers.keydown(wrappedEvent, start, rng.startOffset, end, rng.endOffset, direction).each(function (response) { + handleResponse(wrappedEvent, response); + }); + lazyResize().each(function (resize) { + return resize.showBars(); + }); + }; + var isLeftMouse = function (raw) { + return raw.button === 0; + }; + var isLeftButtonPressed = function (raw) { + if (raw.buttons === undefined) { + return true; + } + if (global$2.browser.isEdge() && raw.buttons === 0) { + return true; + } + return (raw.buttons & 1) !== 0; + }; + var dragStart = function (_e) { + mouseHandlers.clearstate(); + }; + var mouseDown = function (e) { + if (isLeftMouse(e) && hasInternalTarget(e)) { + mouseHandlers.mousedown(fromRawEvent$1(e)); + } + }; + var mouseOver = function (e) { + if (isLeftButtonPressed(e) && hasInternalTarget(e)) { + mouseHandlers.mouseover(fromRawEvent$1(e)); + } + }; + var mouseUp = function (e) { + if (isLeftMouse(e) && hasInternalTarget(e)) { + mouseHandlers.mouseup(fromRawEvent$1(e)); + } + }; + var getDoubleTap = function () { + var lastTarget = Cell(SugarElement.fromDom(body)); + var lastTimeStamp = Cell(0); + var touchEnd = function (t) { + var target = SugarElement.fromDom(t.target); + if (name(target) === 'td' || name(target) === 'th') { + var lT = lastTarget.get(); + var lTS = lastTimeStamp.get(); + if (eq$1(lT, target) && t.timeStamp - lTS < 300) { + t.preventDefault(); + external$1(target, target); + } + } + lastTarget.set(target); + lastTimeStamp.set(t.timeStamp); + }; + return { touchEnd: touchEnd }; + }; + var doubleTap = getDoubleTap(); + editor.on('dragstart', dragStart); + editor.on('mousedown', mouseDown); + editor.on('mouseover', mouseOver); + editor.on('mouseup', mouseUp); + editor.on('touchend', doubleTap.touchEnd); + editor.on('keyup', keyup); + editor.on('keydown', keydown); + editor.on('NodeChange', syncSelection); + }); + return { clear: annotations.clear }; } var getSelectionTargets = function (editor, selections) { - var targets = Cell(Optional.none()); - var changeHandlers = Cell([]); - var findTargets = function () { - return getSelectionStartCellOrCaption(getSelectionStart(editor)).bind(function (cellOrCaption) { - var table$1 = table(cellOrCaption); - var isCaption = function (elem) { - return name(elem) === 'caption'; - }; - return table$1.map(function (table) { - if (isCaption(cellOrCaption)) { - return noMenu(cellOrCaption); - } else { - return forMenu(selections, table, cellOrCaption); - } - }); - }); - }; - var resetTargets = function () { - targets.set(cached(findTargets)()); - each(changeHandlers.get(), function (handler) { - return handler(); - }); - }; - var onSetup = function (api, isDisabled) { - var handler = function () { - return targets.get().fold(function () { - api.setDisabled(true); - }, function (targets) { - api.setDisabled(isDisabled(targets)); - }); - }; - handler(); - changeHandlers.set(changeHandlers.get().concat([handler])); - return function () { - changeHandlers.set(filter(changeHandlers.get(), function (h) { - return h !== handler; - })); - }; - }; - var onSetupTable = function (api) { - return onSetup(api, function (_) { - return false; - }); - }; - var onSetupCellOrRow = function (api) { - return onSetup(api, function (targets) { - return name(targets.element) === 'caption'; - }); - }; - var onSetupPasteable = function (getClipboardData) { - return function (api) { - return onSetup(api, function (targets) { - return name(targets.element) === 'caption' || getClipboardData().isNone(); - }); - }; - }; - var onSetupMergeable = function (api) { - return onSetup(api, function (targets) { - return targets.mergable.isNone(); - }); - }; - var onSetupUnmergeable = function (api) { - return onSetup(api, function (targets) { - return targets.unmergable.isNone(); - }); - }; - editor.on('NodeChange ExecCommand TableSelectorChange', resetTargets); - return { - onSetupTable: onSetupTable, - onSetupCellOrRow: onSetupCellOrRow, - onSetupPasteable: onSetupPasteable, - onSetupMergeable: onSetupMergeable, - onSetupUnmergeable: onSetupUnmergeable, - resetTargets: resetTargets, - targets: function () { - return targets.get(); - } - }; + var targets = Cell(Optional.none()); + var changeHandlers = Cell([]); + var findTargets = function () { + return getSelectionStartCellOrCaption(getSelectionStart(editor)).bind(function (cellOrCaption) { + var table$1 = table(cellOrCaption); + var isCaption = function (elem) { + return name(elem) === 'caption'; + }; + return table$1.map(function (table) { + if (isCaption(cellOrCaption)) { + return noMenu(cellOrCaption); + } else { + return forMenu(selections, table, cellOrCaption); + } + }); + }); + }; + var resetTargets = function () { + targets.set(cached(findTargets)()); + each(changeHandlers.get(), function (handler) { + return handler(); + }); + }; + var onSetup = function (api, isDisabled) { + var handler = function () { + return targets.get().fold(function () { + api.setDisabled(true); + }, function (targets) { + api.setDisabled(isDisabled(targets)); + }); + }; + handler(); + changeHandlers.set(changeHandlers.get().concat([handler])); + return function () { + changeHandlers.set(filter(changeHandlers.get(), function (h) { + return h !== handler; + })); + }; + }; + var onSetupTable = function (api) { + return onSetup(api, function (_) { + return false; + }); + }; + var onSetupCellOrRow = function (api) { + return onSetup(api, function (targets) { + return name(targets.element) === 'caption'; + }); + }; + var onSetupPasteable = function (getClipboardData) { + return function (api) { + return onSetup(api, function (targets) { + return name(targets.element) === 'caption' || getClipboardData().isNone(); + }); + }; + }; + var onSetupMergeable = function (api) { + return onSetup(api, function (targets) { + return targets.mergable.isNone(); + }); + }; + var onSetupUnmergeable = function (api) { + return onSetup(api, function (targets) { + return targets.unmergable.isNone(); + }); + }; + editor.on('NodeChange ExecCommand TableSelectorChange', resetTargets); + return { + onSetupTable: onSetupTable, + onSetupCellOrRow: onSetupCellOrRow, + onSetupPasteable: onSetupPasteable, + onSetupMergeable: onSetupMergeable, + onSetupUnmergeable: onSetupUnmergeable, + resetTargets: resetTargets, + targets: function () { + return targets.get(); + } + }; }; var addButtons = function (editor, selectionTargets, clipboard) { - editor.ui.registry.addMenuButton('table', { - tooltip: 'Table', - icon: 'table', - fetch: function (callback) { - return callback('inserttable | cell row column | advtablesort | tableprops deletetable'); - } - }); - var cmd = function (command) { - return function () { - return editor.execCommand(command); - }; - }; - editor.ui.registry.addButton('tableprops', { - tooltip: 'Table properties', - onAction: cmd('mceTableProps'), - icon: 'table', - onSetup: selectionTargets.onSetupTable - }); - editor.ui.registry.addButton('tabledelete', { - tooltip: 'Delete table', - onAction: cmd('mceTableDelete'), - icon: 'table-delete-table', - onSetup: selectionTargets.onSetupTable - }); - editor.ui.registry.addButton('tablecellprops', { - tooltip: 'Cell properties', - onAction: cmd('mceTableCellProps'), - icon: 'table-cell-properties', - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addButton('tablemergecells', { - tooltip: 'Merge cells', - onAction: cmd('mceTableMergeCells'), - icon: 'table-merge-cells', - onSetup: selectionTargets.onSetupMergeable - }); - editor.ui.registry.addButton('tablesplitcells', { - tooltip: 'Split cell', - onAction: cmd('mceTableSplitCells'), - icon: 'table-split-cells', - onSetup: selectionTargets.onSetupUnmergeable - }); - editor.ui.registry.addButton('tableinsertrowbefore', { - tooltip: 'Insert row before', - onAction: cmd('mceTableInsertRowBefore'), - icon: 'table-insert-row-above', - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addButton('tableinsertrowafter', { - tooltip: 'Insert row after', - onAction: cmd('mceTableInsertRowAfter'), - icon: 'table-insert-row-after', - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addButton('tabledeleterow', { - tooltip: 'Delete row', - onAction: cmd('mceTableDeleteRow'), - icon: 'table-delete-row', - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addButton('tablerowprops', { - tooltip: 'Row properties', - onAction: cmd('mceTableRowProps'), - icon: 'table-row-properties', - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addButton('tableinsertcolbefore', { - tooltip: 'Insert column before', - onAction: cmd('mceTableInsertColBefore'), - icon: 'table-insert-column-before', - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addButton('tableinsertcolafter', { - tooltip: 'Insert column after', - onAction: cmd('mceTableInsertColAfter'), - icon: 'table-insert-column-after', - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addButton('tabledeletecol', { - tooltip: 'Delete column', - onAction: cmd('mceTableDeleteCol'), - icon: 'table-delete-column', - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addButton('tablecutrow', { - tooltip: 'Cut row', - icon: 'cut-row', - onAction: cmd('mceTableCutRow'), - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addButton('tablecopyrow', { - tooltip: 'Copy row', - icon: 'duplicate-row', - onAction: cmd('mceTableCopyRow'), - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addButton('tablepasterowbefore', { - tooltip: 'Paste row before', - icon: 'paste-row-before', - onAction: cmd('mceTablePasteRowBefore'), - onSetup: selectionTargets.onSetupPasteable(clipboard.getRows) - }); - editor.ui.registry.addButton('tablepasterowafter', { - tooltip: 'Paste row after', - icon: 'paste-row-after', - onAction: cmd('mceTablePasteRowAfter'), - onSetup: selectionTargets.onSetupPasteable(clipboard.getRows) - }); - editor.ui.registry.addButton('tablecutcol', { - tooltip: 'Cut column', - icon: 'cut-column', - onAction: cmd('mceTableCutCol'), - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addButton('tablecopycol', { - tooltip: 'Copy column', - icon: 'duplicate-column', - onAction: cmd('mceTableCopyCol'), - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addButton('tablepastecolbefore', { - tooltip: 'Paste column before', - icon: 'paste-column-before', - onAction: cmd('mceTablePasteColBefore'), - onSetup: selectionTargets.onSetupPasteable(clipboard.getColumns) - }); - editor.ui.registry.addButton('tablepastecolafter', { - tooltip: 'Paste column after', - icon: 'paste-column-after', - onAction: cmd('mceTablePasteColAfter'), - onSetup: selectionTargets.onSetupPasteable(clipboard.getColumns) - }); - editor.ui.registry.addButton('tableinsertdialog', { - tooltip: 'Insert table', - onAction: cmd('mceInsertTable'), - icon: 'table' - }); + editor.ui.registry.addMenuButton('table', { + tooltip: 'Table', + icon: 'table', + fetch: function (callback) { + return callback('inserttable | cell row column | advtablesort | tableprops deletetable'); + } + }); + var cmd = function (command) { + return function () { + return editor.execCommand(command); + }; + }; + editor.ui.registry.addButton('tableprops', { + tooltip: 'Table properties', + onAction: cmd('mceTableProps'), + icon: 'table', + onSetup: selectionTargets.onSetupTable + }); + editor.ui.registry.addButton('tabledelete', { + tooltip: 'Delete table', + onAction: cmd('mceTableDelete'), + icon: 'table-delete-table', + onSetup: selectionTargets.onSetupTable + }); + editor.ui.registry.addButton('tablecellprops', { + tooltip: 'Cell properties', + onAction: cmd('mceTableCellProps'), + icon: 'table-cell-properties', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablemergecells', { + tooltip: 'Merge cells', + onAction: cmd('mceTableMergeCells'), + icon: 'table-merge-cells', + onSetup: selectionTargets.onSetupMergeable + }); + editor.ui.registry.addButton('tablesplitcells', { + tooltip: 'Split cell', + onAction: cmd('mceTableSplitCells'), + icon: 'table-split-cells', + onSetup: selectionTargets.onSetupUnmergeable + }); + editor.ui.registry.addButton('tableinsertrowbefore', { + tooltip: 'Insert row before', + onAction: cmd('mceTableInsertRowBefore'), + icon: 'table-insert-row-above', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tableinsertrowafter', { + tooltip: 'Insert row after', + onAction: cmd('mceTableInsertRowAfter'), + icon: 'table-insert-row-after', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tabledeleterow', { + tooltip: 'Delete row', + onAction: cmd('mceTableDeleteRow'), + icon: 'table-delete-row', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablerowprops', { + tooltip: 'Row properties', + onAction: cmd('mceTableRowProps'), + icon: 'table-row-properties', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tableinsertcolbefore', { + tooltip: 'Insert column before', + onAction: cmd('mceTableInsertColBefore'), + icon: 'table-insert-column-before', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tableinsertcolafter', { + tooltip: 'Insert column after', + onAction: cmd('mceTableInsertColAfter'), + icon: 'table-insert-column-after', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tabledeletecol', { + tooltip: 'Delete column', + onAction: cmd('mceTableDeleteCol'), + icon: 'table-delete-column', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablecutrow', { + tooltip: 'Cut row', + icon: 'cut-row', + onAction: cmd('mceTableCutRow'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablecopyrow', { + tooltip: 'Copy row', + icon: 'duplicate-row', + onAction: cmd('mceTableCopyRow'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablepasterowbefore', { + tooltip: 'Paste row before', + icon: 'paste-row-before', + onAction: cmd('mceTablePasteRowBefore'), + onSetup: selectionTargets.onSetupPasteable(clipboard.getRows) + }); + editor.ui.registry.addButton('tablepasterowafter', { + tooltip: 'Paste row after', + icon: 'paste-row-after', + onAction: cmd('mceTablePasteRowAfter'), + onSetup: selectionTargets.onSetupPasteable(clipboard.getRows) + }); + editor.ui.registry.addButton('tablecutcol', { + tooltip: 'Cut column', + icon: 'cut-column', + onAction: cmd('mceTableCutCol'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablecopycol', { + tooltip: 'Copy column', + icon: 'duplicate-column', + onAction: cmd('mceTableCopyCol'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablepastecolbefore', { + tooltip: 'Paste column before', + icon: 'paste-column-before', + onAction: cmd('mceTablePasteColBefore'), + onSetup: selectionTargets.onSetupPasteable(clipboard.getColumns) + }); + editor.ui.registry.addButton('tablepastecolafter', { + tooltip: 'Paste column after', + icon: 'paste-column-after', + onAction: cmd('mceTablePasteColAfter'), + onSetup: selectionTargets.onSetupPasteable(clipboard.getColumns) + }); + editor.ui.registry.addButton('tableinsertdialog', { + tooltip: 'Insert table', + onAction: cmd('mceInsertTable'), + icon: 'table' + }); }; var addToolbars = function (editor) { - var isTable = function (table) { - return editor.dom.is(table, 'table') && editor.getBody().contains(table); - }; - var toolbar = getToolbar(editor); - if (toolbar.length > 0) { - editor.ui.registry.addContextToolbar('table', { - predicate: isTable, - items: toolbar, - scope: 'node', - position: 'node' - }); - } + var isTable = function (table) { + return editor.dom.is(table, 'table') && editor.getBody().contains(table); + }; + var toolbar = getToolbar(editor); + if (toolbar.length > 0) { + editor.ui.registry.addContextToolbar('table', { + predicate: isTable, + items: toolbar, + scope: 'node', + position: 'node' + }); + } }; var addMenuItems = function (editor, selectionTargets, clipboard) { - var cmd = function (command) { - return function () { - return editor.execCommand(command); - }; - }; - var insertTableAction = function (data) { - editor.execCommand('mceInsertTable', false, { - rows: data.numRows, - columns: data.numColumns - }); - }; - var tableProperties = { - text: 'Table properties', - onSetup: selectionTargets.onSetupTable, - onAction: cmd('mceTableProps') - }; - var deleteTable = { - text: 'Delete table', - icon: 'table-delete-table', - onSetup: selectionTargets.onSetupTable, - onAction: cmd('mceTableDelete') - }; - editor.ui.registry.addMenuItem('tableinsertrowbefore', { - text: 'Insert row before', - icon: 'table-insert-row-above', - onAction: cmd('mceTableInsertRowBefore'), - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addMenuItem('tableinsertrowafter', { - text: 'Insert row after', - icon: 'table-insert-row-after', - onAction: cmd('mceTableInsertRowAfter'), - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addMenuItem('tabledeleterow', { - text: 'Delete row', - icon: 'table-delete-row', - onAction: cmd('mceTableDeleteRow'), - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addMenuItem('tablerowprops', { - text: 'Row properties', - icon: 'table-row-properties', - onAction: cmd('mceTableRowProps'), - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addMenuItem('tablecutrow', { - text: 'Cut row', - icon: 'cut-row', - onAction: cmd('mceTableCutRow'), - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addMenuItem('tablecopyrow', { - text: 'Copy row', - icon: 'duplicate-row', - onAction: cmd('mceTableCopyRow'), - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addMenuItem('tablepasterowbefore', { - text: 'Paste row before', - icon: 'paste-row-before', - onAction: cmd('mceTablePasteRowBefore'), - onSetup: selectionTargets.onSetupPasteable(clipboard.getRows) - }); - editor.ui.registry.addMenuItem('tablepasterowafter', { - text: 'Paste row after', - icon: 'paste-row-after', - onAction: cmd('mceTablePasteRowAfter'), - onSetup: selectionTargets.onSetupPasteable(clipboard.getRows) - }); - var row = { - type: 'nestedmenuitem', - text: 'Row', - getSubmenuItems: function () { - return 'tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter'; - } - }; - editor.ui.registry.addMenuItem('tableinsertcolumnbefore', { - text: 'Insert column before', - icon: 'table-insert-column-before', - onAction: cmd('mceTableInsertColBefore'), - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addMenuItem('tableinsertcolumnafter', { - text: 'Insert column after', - icon: 'table-insert-column-after', - onAction: cmd('mceTableInsertColAfter'), - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addMenuItem('tabledeletecolumn', { - text: 'Delete column', - icon: 'table-delete-column', - onAction: cmd('mceTableDeleteCol'), - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addMenuItem('tablecutcolumn', { - text: 'Cut column', - icon: 'cut-column', - onAction: cmd('mceTableCutCol'), - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addMenuItem('tablecopycolumn', { - text: 'Copy column', - icon: 'duplicate-column', - onAction: cmd('mceTableCopyCol'), - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addMenuItem('tablepastecolumnbefore', { - text: 'Paste column before', - icon: 'paste-column-before', - onAction: cmd('mceTablePasteColBefore'), - onSetup: selectionTargets.onSetupPasteable(clipboard.getColumns) - }); - editor.ui.registry.addMenuItem('tablepastecolumnafter', { - text: 'Paste column after', - icon: 'paste-column-after', - onAction: cmd('mceTablePasteColAfter'), - onSetup: selectionTargets.onSetupPasteable(clipboard.getColumns) - }); - var column = { - type: 'nestedmenuitem', - text: 'Column', - getSubmenuItems: function () { - return 'tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter'; - } - }; - editor.ui.registry.addMenuItem('tablecellprops', { - text: 'Cell properties', - icon: 'table-cell-properties', - onAction: cmd('mceTableCellProps'), - onSetup: selectionTargets.onSetupCellOrRow - }); - editor.ui.registry.addMenuItem('tablemergecells', { - text: 'Merge cells', - icon: 'table-merge-cells', - onAction: cmd('mceTableMergeCells'), - onSetup: selectionTargets.onSetupMergeable - }); - editor.ui.registry.addMenuItem('tablesplitcells', { - text: 'Split cell', - icon: 'table-split-cells', - onAction: cmd('mceTableSplitCells'), - onSetup: selectionTargets.onSetupUnmergeable - }); - var cell = { - type: 'nestedmenuitem', - text: 'Cell', - getSubmenuItems: function () { - return 'tablecellprops tablemergecells tablesplitcells'; + var cmd = function (command) { + return function () { + return editor.execCommand(command); + }; + }; + var insertTableAction = function (data) { + editor.execCommand('mceInsertTable', false, { + rows: data.numRows, + columns: data.numColumns + }); + }; + var tableProperties = { + text: 'Table properties', + onSetup: selectionTargets.onSetupTable, + onAction: cmd('mceTableProps') + }; + var deleteTable = { + text: 'Delete table', + icon: 'table-delete-table', + onSetup: selectionTargets.onSetupTable, + onAction: cmd('mceTableDelete') + }; + editor.ui.registry.addMenuItem('tableinsertrowbefore', { + text: 'Insert row before', + icon: 'table-insert-row-above', + onAction: cmd('mceTableInsertRowBefore'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tableinsertrowafter', { + text: 'Insert row after', + icon: 'table-insert-row-after', + onAction: cmd('mceTableInsertRowAfter'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tabledeleterow', { + text: 'Delete row', + icon: 'table-delete-row', + onAction: cmd('mceTableDeleteRow'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tablerowprops', { + text: 'Row properties', + icon: 'table-row-properties', + onAction: cmd('mceTableRowProps'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tablecutrow', { + text: 'Cut row', + icon: 'cut-row', + onAction: cmd('mceTableCutRow'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tablecopyrow', { + text: 'Copy row', + icon: 'duplicate-row', + onAction: cmd('mceTableCopyRow'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tablepasterowbefore', { + text: 'Paste row before', + icon: 'paste-row-before', + onAction: cmd('mceTablePasteRowBefore'), + onSetup: selectionTargets.onSetupPasteable(clipboard.getRows) + }); + editor.ui.registry.addMenuItem('tablepasterowafter', { + text: 'Paste row after', + icon: 'paste-row-after', + onAction: cmd('mceTablePasteRowAfter'), + onSetup: selectionTargets.onSetupPasteable(clipboard.getRows) + }); + var row = { + type: 'nestedmenuitem', + text: 'Row', + getSubmenuItems: function () { + return 'tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter'; + } + }; + editor.ui.registry.addMenuItem('tableinsertcolumnbefore', { + text: 'Insert column before', + icon: 'table-insert-column-before', + onAction: cmd('mceTableInsertColBefore'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tableinsertcolumnafter', { + text: 'Insert column after', + icon: 'table-insert-column-after', + onAction: cmd('mceTableInsertColAfter'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tabledeletecolumn', { + text: 'Delete column', + icon: 'table-delete-column', + onAction: cmd('mceTableDeleteCol'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tablecutcolumn', { + text: 'Cut column', + icon: 'cut-column', + onAction: cmd('mceTableCutCol'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tablecopycolumn', { + text: 'Copy column', + icon: 'duplicate-column', + onAction: cmd('mceTableCopyCol'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tablepastecolumnbefore', { + text: 'Paste column before', + icon: 'paste-column-before', + onAction: cmd('mceTablePasteColBefore'), + onSetup: selectionTargets.onSetupPasteable(clipboard.getColumns) + }); + editor.ui.registry.addMenuItem('tablepastecolumnafter', { + text: 'Paste column after', + icon: 'paste-column-after', + onAction: cmd('mceTablePasteColAfter'), + onSetup: selectionTargets.onSetupPasteable(clipboard.getColumns) + }); + var column = { + type: 'nestedmenuitem', + text: 'Column', + getSubmenuItems: function () { + return 'tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter'; + } + }; + editor.ui.registry.addMenuItem('tablecellprops', { + text: 'Cell properties', + icon: 'table-cell-properties', + onAction: cmd('mceTableCellProps'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tablemergecells', { + text: 'Merge cells', + icon: 'table-merge-cells', + onAction: cmd('mceTableMergeCells'), + onSetup: selectionTargets.onSetupMergeable + }); + editor.ui.registry.addMenuItem('tablesplitcells', { + text: 'Split cell', + icon: 'table-split-cells', + onAction: cmd('mceTableSplitCells'), + onSetup: selectionTargets.onSetupUnmergeable + }); + var cell = { + type: 'nestedmenuitem', + text: 'Cell', + getSubmenuItems: function () { + return 'tablecellprops tablemergecells tablesplitcells'; + } + }; + if (hasTableGrid(editor) === false) { + editor.ui.registry.addMenuItem('inserttable', { + text: 'Table', + icon: 'table', + onAction: cmd('mceInsertTable') + }); + } else { + editor.ui.registry.addNestedMenuItem('inserttable', { + text: 'Table', + icon: 'table', + getSubmenuItems: function () { + return [{ + type: 'fancymenuitem', + fancytype: 'inserttable', + onAction: insertTableAction + }]; + } + }); + } + editor.ui.registry.addMenuItem('inserttabledialog', { + text: 'Insert table', + icon: 'table', + onAction: cmd('mceInsertTable') + }); + editor.ui.registry.addMenuItem('tableprops', tableProperties); + editor.ui.registry.addMenuItem('deletetable', deleteTable); + editor.ui.registry.addNestedMenuItem('row', row); + editor.ui.registry.addNestedMenuItem('column', column); + editor.ui.registry.addNestedMenuItem('cell', cell); + editor.ui.registry.addContextMenu('table', { + update: function () { + selectionTargets.resetTargets(); + return selectionTargets.targets().fold(function () { + return ''; + }, function (targets) { + if (name(targets.element) === 'caption') { + return 'tableprops deletetable'; + } else { + return 'cell row column | advtablesort | tableprops deletetable'; } - }; - if (hasTableGrid(editor) === false) { - editor.ui.registry.addMenuItem('inserttable', { - text: 'Table', - icon: 'table', - onAction: cmd('mceInsertTable') - }); - } else { - editor.ui.registry.addNestedMenuItem('inserttable', { - text: 'Table', - icon: 'table', - getSubmenuItems: function () { - return [{ - type: 'fancymenuitem', - fancytype: 'inserttable', - onAction: insertTableAction - }]; - } - }); + }); } - editor.ui.registry.addMenuItem('inserttabledialog', { - text: 'Insert table', - icon: 'table', - onAction: cmd('mceInsertTable') - }); - editor.ui.registry.addMenuItem('tableprops', tableProperties); - editor.ui.registry.addMenuItem('deletetable', deleteTable); - editor.ui.registry.addNestedMenuItem('row', row); - editor.ui.registry.addNestedMenuItem('column', column); - editor.ui.registry.addNestedMenuItem('cell', cell); - editor.ui.registry.addContextMenu('table', { - update: function () { - selectionTargets.resetTargets(); - return selectionTargets.targets().fold(function () { - return ''; - }, function (targets) { - if (name(targets.element) === 'caption') { - return 'tableprops deletetable'; - } else { - return 'cell row column | advtablesort | tableprops deletetable'; - } - }); - } - }); + }); }; function Plugin(editor) { - var selections = Selections(function () { - return getBody$1(editor); - }, function () { - return getSelectionStartCellOrCaption(getSelectionStart(editor)); - }, ephemera.selectedSelector); - var selectionTargets = getSelectionTargets(editor, selections); - var resizeHandler = getResizeHandler(editor); - var cellSelection = CellSelection(editor, resizeHandler.lazyResize, selectionTargets); - var actions = TableActions(editor, resizeHandler.lazyWire, selections); - var clipboard = Clipboard(); - registerCommands(editor, actions, cellSelection, selections, clipboard); - registerQueryCommands(editor, actions, selections); - registerEvents(editor, selections, actions, cellSelection); - addMenuItems(editor, selectionTargets, clipboard); - addButtons(editor, selectionTargets, clipboard); - addToolbars(editor); - editor.on('PreInit', function () { - editor.serializer.addTempAttr(ephemera.firstSelected); - editor.serializer.addTempAttr(ephemera.lastSelected); - registerFormats(editor); - }); - if (hasTabNavigation(editor)) { - editor.on('keydown', function (e) { - handle$1(e, editor, actions); - }); - } - editor.on('remove', function () { - resizeHandler.destroy(); - }); - return getApi(editor, clipboard, resizeHandler, selectionTargets); + var selections = Selections(function () { + return getBody$1(editor); + }, function () { + return getSelectionStartCellOrCaption(getSelectionStart(editor)); + }, ephemera.selectedSelector); + var selectionTargets = getSelectionTargets(editor, selections); + var resizeHandler = getResizeHandler(editor); + var cellSelection = CellSelection(editor, resizeHandler.lazyResize, selectionTargets); + var actions = TableActions(editor, resizeHandler.lazyWire, selections); + var clipboard = Clipboard(); + registerCommands(editor, actions, cellSelection, selections, clipboard); + registerQueryCommands(editor, actions, selections); + registerEvents(editor, selections, actions, cellSelection); + addMenuItems(editor, selectionTargets, clipboard); + addButtons(editor, selectionTargets, clipboard); + addToolbars(editor); + editor.on('PreInit', function () { + editor.serializer.addTempAttr(ephemera.firstSelected); + editor.serializer.addTempAttr(ephemera.lastSelected); + registerFormats(editor); + }); + if (hasTabNavigation(editor)) { + editor.on('keydown', function (e) { + handle$1(e, editor, actions); + }); + } + editor.on('remove', function () { + resizeHandler.destroy(); + }); + return getApi(editor, clipboard, resizeHandler, selectionTargets); } - - function Plugin$1() { - global.add('table', Plugin); + function Plugin$1 () { + global.add('table', Plugin); } Plugin$1(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/template/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/template/plugin.js index 6fc111c6..0c991827 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/template/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/template/plugin.js @@ -14,26 +14,24 @@ var noop = function () { }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; - function curry(fn) { - var initialArgs = []; - for (var _i = 1; _i < arguments.length; _i++) { - initialArgs[_i - 1] = arguments[_i]; + var initialArgs = []; + for (var _i = 1; _i < arguments.length; _i++) { + initialArgs[_i - 1] = arguments[_i]; + } + return function () { + var restArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + restArgs[_i] = arguments[_i]; } - return function () { - var restArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - restArgs[_i] = arguments[_i]; - } - var all = initialArgs.concat(restArgs); - return fn.apply(null, all); - }; + var all = initialArgs.concat(restArgs); + return fn.apply(null, all); + }; } - var never = constant(false); var always = constant(true); @@ -42,300 +40,300 @@ var global$2 = tinymce.util.Tools.resolve('tinymce.util.XHR'); var getCreationDateClasses = function (editor) { - return editor.getParam('template_cdate_classes', 'cdate'); + return editor.getParam('template_cdate_classes', 'cdate'); }; var getModificationDateClasses = function (editor) { - return editor.getParam('template_mdate_classes', 'mdate'); + return editor.getParam('template_mdate_classes', 'mdate'); }; var getSelectedContentClasses = function (editor) { - return editor.getParam('template_selected_content_classes', 'selcontent'); + return editor.getParam('template_selected_content_classes', 'selcontent'); }; var getPreviewReplaceValues = function (editor) { - return editor.getParam('template_preview_replace_values'); + return editor.getParam('template_preview_replace_values'); }; var getContentStyle = function (editor) { - return editor.getParam('content_style', '', 'string'); + return editor.getParam('content_style', '', 'string'); }; var shouldUseContentCssCors = function (editor) { - return editor.getParam('content_css_cors', false, 'boolean'); + return editor.getParam('content_css_cors', false, 'boolean'); }; var getTemplateReplaceValues = function (editor) { - return editor.getParam('template_replace_values'); + return editor.getParam('template_replace_values'); }; var getTemplates = function (editor) { - return editor.getParam('templates'); + return editor.getParam('templates'); }; var getCdateFormat = function (editor) { - return editor.getParam('template_cdate_format', editor.translate('%Y-%m-%d')); + return editor.getParam('template_cdate_format', editor.translate('%Y-%m-%d')); }; var getMdateFormat = function (editor) { - return editor.getParam('template_mdate_format', editor.translate('%Y-%m-%d')); + return editor.getParam('template_mdate_format', editor.translate('%Y-%m-%d')); }; var getBodyClassFromHash = function (editor) { - var bodyClass = editor.getParam('body_class', '', 'hash'); - return bodyClass[editor.id] || ''; + var bodyClass = editor.getParam('body_class', '', 'hash'); + return bodyClass[editor.id] || ''; }; var getBodyClass = function (editor) { - var bodyClass = editor.getParam('body_class', '', 'string'); - if (bodyClass.indexOf('=') === -1) { - return bodyClass; - } else { - return getBodyClassFromHash(editor); - } + var bodyClass = editor.getParam('body_class', '', 'string'); + if (bodyClass.indexOf('=') === -1) { + return bodyClass; + } else { + return getBodyClassFromHash(editor); + } }; var addZeros = function (value, len) { - value = '' + value; - if (value.length < len) { - for (var i = 0; i < len - value.length; i++) { - value = '0' + value; - } + value = '' + value; + if (value.length < len) { + for (var i = 0; i < len - value.length; i++) { + value = '0' + value; } - return value; + } + return value; }; var getDateTime = function (editor, fmt, date) { - var daysShort = 'Sun Mon Tue Wed Thu Fri Sat Sun'.split(' '); - var daysLong = 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday'.split(' '); - var monthsShort = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' '); - var monthsLong = 'January February March April May June July August September October November December'.split(' '); - date = date || new Date(); - fmt = fmt.replace('%D', '%m/%d/%Y'); - fmt = fmt.replace('%r', '%I:%M:%S %p'); - fmt = fmt.replace('%Y', '' + date.getFullYear()); - fmt = fmt.replace('%y', '' + date.getYear()); - fmt = fmt.replace('%m', addZeros(date.getMonth() + 1, 2)); - fmt = fmt.replace('%d', addZeros(date.getDate(), 2)); - fmt = fmt.replace('%H', '' + addZeros(date.getHours(), 2)); - fmt = fmt.replace('%M', '' + addZeros(date.getMinutes(), 2)); - fmt = fmt.replace('%S', '' + addZeros(date.getSeconds(), 2)); - fmt = fmt.replace('%I', '' + ((date.getHours() + 11) % 12 + 1)); - fmt = fmt.replace('%p', '' + (date.getHours() < 12 ? 'AM' : 'PM')); - fmt = fmt.replace('%B', '' + editor.translate(monthsLong[date.getMonth()])); - fmt = fmt.replace('%b', '' + editor.translate(monthsShort[date.getMonth()])); - fmt = fmt.replace('%A', '' + editor.translate(daysLong[date.getDay()])); - fmt = fmt.replace('%a', '' + editor.translate(daysShort[date.getDay()])); - fmt = fmt.replace('%%', '%'); - return fmt; + var daysShort = 'Sun Mon Tue Wed Thu Fri Sat Sun'.split(' '); + var daysLong = 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday'.split(' '); + var monthsShort = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' '); + var monthsLong = 'January February March April May June July August September October November December'.split(' '); + date = date || new Date(); + fmt = fmt.replace('%D', '%m/%d/%Y'); + fmt = fmt.replace('%r', '%I:%M:%S %p'); + fmt = fmt.replace('%Y', '' + date.getFullYear()); + fmt = fmt.replace('%y', '' + date.getYear()); + fmt = fmt.replace('%m', addZeros(date.getMonth() + 1, 2)); + fmt = fmt.replace('%d', addZeros(date.getDate(), 2)); + fmt = fmt.replace('%H', '' + addZeros(date.getHours(), 2)); + fmt = fmt.replace('%M', '' + addZeros(date.getMinutes(), 2)); + fmt = fmt.replace('%S', '' + addZeros(date.getSeconds(), 2)); + fmt = fmt.replace('%I', '' + ((date.getHours() + 11) % 12 + 1)); + fmt = fmt.replace('%p', '' + (date.getHours() < 12 ? 'AM' : 'PM')); + fmt = fmt.replace('%B', '' + editor.translate(monthsLong[date.getMonth()])); + fmt = fmt.replace('%b', '' + editor.translate(monthsShort[date.getMonth()])); + fmt = fmt.replace('%A', '' + editor.translate(daysLong[date.getDay()])); + fmt = fmt.replace('%a', '' + editor.translate(daysShort[date.getDay()])); + fmt = fmt.replace('%%', '%'); + return fmt; }; var createTemplateList = function (editor, callback) { - return function () { - var templateList = getTemplates(editor); - if (typeof templateList === 'function') { - templateList(callback); - return; - } - if (typeof templateList === 'string') { - global$2.send({ - url: templateList, - success: function (text) { - callback(JSON.parse(text)); - } - }); - } else { - callback(templateList); + return function () { + var templateList = getTemplates(editor); + if (typeof templateList === 'function') { + templateList(callback); + return; + } + if (typeof templateList === 'string') { + global$2.send({ + url: templateList, + success: function (text) { + callback(JSON.parse(text)); } - }; + }); + } else { + callback(templateList); + } + }; }; var replaceTemplateValues = function (html, templateValues) { - global$1.each(templateValues, function (v, k) { - if (typeof v === 'function') { - v = v(k); - } - html = html.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v); - }); - return html; + global$1.each(templateValues, function (v, k) { + if (typeof v === 'function') { + v = v(k); + } + html = html.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v); + }); + return html; }; var replaceVals = function (editor, e) { - var dom = editor.dom, vl = getTemplateReplaceValues(editor); - global$1.each(dom.select('*', e), function (e) { - global$1.each(vl, function (v, k) { - if (dom.hasClass(e, k)) { - if (typeof vl[k] === 'function') { - vl[k](e); - } - } - }); + var dom = editor.dom, vl = getTemplateReplaceValues(editor); + global$1.each(dom.select('*', e), function (e) { + global$1.each(vl, function (v, k) { + if (dom.hasClass(e, k)) { + if (typeof vl[k] === 'function') { + vl[k](e); + } + } }); + }); }; var hasClass = function (n, c) { - return new RegExp('\\b' + c + '\\b', 'g').test(n.className); + return new RegExp('\\b' + c + '\\b', 'g').test(n.className); }; var insertTemplate = function (editor, _ui, html) { - var el; - var dom = editor.dom; - var sel = editor.selection.getContent(); - html = replaceTemplateValues(html, getTemplateReplaceValues(editor)); - el = dom.create('div', null, html); - var n = dom.select('.mceTmpl', el); - if (n && n.length > 0) { - el = dom.create('div', null); - el.appendChild(n[0].cloneNode(true)); + var el; + var dom = editor.dom; + var sel = editor.selection.getContent(); + html = replaceTemplateValues(html, getTemplateReplaceValues(editor)); + el = dom.create('div', null, html); + var n = dom.select('.mceTmpl', el); + if (n && n.length > 0) { + el = dom.create('div', null); + el.appendChild(n[0].cloneNode(true)); + } + global$1.each(dom.select('*', el), function (n) { + if (hasClass(n, getCreationDateClasses(editor).replace(/\s+/g, '|'))) { + n.innerHTML = getDateTime(editor, getCdateFormat(editor)); } - global$1.each(dom.select('*', el), function (n) { - if (hasClass(n, getCreationDateClasses(editor).replace(/\s+/g, '|'))) { - n.innerHTML = getDateTime(editor, getCdateFormat(editor)); - } - if (hasClass(n, getModificationDateClasses(editor).replace(/\s+/g, '|'))) { - n.innerHTML = getDateTime(editor, getMdateFormat(editor)); - } - if (hasClass(n, getSelectedContentClasses(editor).replace(/\s+/g, '|'))) { - n.innerHTML = sel; - } - }); - replaceVals(editor, el); - editor.execCommand('mceInsertContent', false, el.innerHTML); - editor.addVisual(); + if (hasClass(n, getModificationDateClasses(editor).replace(/\s+/g, '|'))) { + n.innerHTML = getDateTime(editor, getMdateFormat(editor)); + } + if (hasClass(n, getSelectedContentClasses(editor).replace(/\s+/g, '|'))) { + n.innerHTML = sel; + } + }); + replaceVals(editor, el); + editor.execCommand('mceInsertContent', false, el.innerHTML); + editor.addVisual(); }; var register = function (editor) { - editor.addCommand('mceInsertTemplate', curry(insertTemplate, editor)); + editor.addCommand('mceInsertTemplate', curry(insertTemplate, editor)); }; var setup = function (editor) { - editor.on('PreProcess', function (o) { - var dom = editor.dom, dateFormat = getMdateFormat(editor); - global$1.each(dom.select('div', o.node), function (e) { - if (dom.hasClass(e, 'mceTmpl')) { - global$1.each(dom.select('*', e), function (e) { - if (dom.hasClass(e, getModificationDateClasses(editor).replace(/\s+/g, '|'))) { - e.innerHTML = getDateTime(editor, dateFormat); - } - }); - replaceVals(editor, e); - } + editor.on('PreProcess', function (o) { + var dom = editor.dom, dateFormat = getMdateFormat(editor); + global$1.each(dom.select('div', o.node), function (e) { + if (dom.hasClass(e, 'mceTmpl')) { + global$1.each(dom.select('*', e), function (e) { + if (dom.hasClass(e, getModificationDateClasses(editor).replace(/\s+/g, '|'))) { + e.innerHTML = getDateTime(editor, dateFormat); + } }); + replaceVals(editor, e); + } }); + }); }; var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var map = function (xs, f) { - var len = xs.length; - var r = new Array(len); - for (var i = 0; i < len; i++) { - var x = xs[i]; - r[i] = f(x, i); - } - return r; + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; }; var findUntil = function (xs, pred, until) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - return Optional.some(x); - } else if (until(x, i)) { - break; - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(x); + } else if (until(x, i)) { + break; } - return Optional.none(); + } + return Optional.none(); }; var find = function (xs, pred) { - return findUntil(xs, pred, never); + return findUntil(xs, pred, never); }; var global$3 = tinymce.util.Tools.resolve('tinymce.Env'); @@ -344,234 +342,234 @@ var hasOwnProperty = Object.hasOwnProperty; var get = function (obj, key) { - return has(obj, key) ? Optional.from(obj[key]) : Optional.none(); + return has(obj, key) ? Optional.from(obj[key]) : Optional.none(); }; var has = function (obj, key) { - return hasOwnProperty.call(obj, key); + return hasOwnProperty.call(obj, key); }; var entitiesAttr = { - '"': '"', - '<': '<', - '>': '>', - '&': '&', - '\'': ''' + '"': '"', + '<': '<', + '>': '>', + '&': '&', + '\'': ''' }; var htmlEscape = function (html) { - return html.replace(/["'<>&]/g, function (match) { - return get(entitiesAttr, match).getOr(match); - }); + return html.replace(/["'<>&]/g, function (match) { + return get(entitiesAttr, match).getOr(match); + }); }; var getPreviewContent = function (editor, html) { - if (html.indexOf('') === -1) { - var contentCssEntries_1 = ''; - var contentStyle = getContentStyle(editor); - if (contentStyle) { - contentCssEntries_1 += ''; - } - var cors_1 = shouldUseContentCssCors(editor) ? ' crossorigin="anonymous"' : ''; - global$1.each(editor.contentCSS, function (url) { - contentCssEntries_1 += ''; - }); - var bodyClass = getBodyClass(editor); - var encode = editor.dom.encode; - var isMetaKeyPressed = global$3.mac ? 'e.metaKey' : 'e.ctrlKey && !e.altKey'; - var preventClicksOnLinksScript = ' '; - var directionality = editor.getBody().dir; - var dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : ''; - html = '' + '' + '' + '' + contentCssEntries_1 + preventClicksOnLinksScript + '' + '' + html + '' + ''; + if (html.indexOf('') === -1) { + var contentCssEntries_1 = ''; + var contentStyle = getContentStyle(editor); + if (contentStyle) { + contentCssEntries_1 += ''; } - return replaceTemplateValues(html, getPreviewReplaceValues(editor)); + var cors_1 = shouldUseContentCssCors(editor) ? ' crossorigin="anonymous"' : ''; + global$1.each(editor.contentCSS, function (url) { + contentCssEntries_1 += ''; + }); + var bodyClass = getBodyClass(editor); + var encode = editor.dom.encode; + var isMetaKeyPressed = global$3.mac ? 'e.metaKey' : 'e.ctrlKey && !e.altKey'; + var preventClicksOnLinksScript = ' '; + var directionality = editor.getBody().dir; + var dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : ''; + html = '' + '' + '' + '' + contentCssEntries_1 + preventClicksOnLinksScript + '' + '' + html + '' + ''; + } + return replaceTemplateValues(html, getPreviewReplaceValues(editor)); }; var open = function (editor, templateList) { - var createTemplates = function () { - if (!templateList || templateList.length === 0) { - var message = editor.translate('No templates defined.'); - editor.notificationManager.open({ - text: message, - type: 'info' - }); - return Optional.none(); + var createTemplates = function () { + if (!templateList || templateList.length === 0) { + var message = editor.translate('No templates defined.'); + editor.notificationManager.open({ + text: message, + type: 'info' + }); + return Optional.none(); + } + return Optional.from(global$1.map(templateList, function (template, index) { + var isUrlTemplate = function (t) { + return t.url !== undefined; + }; + return { + selected: index === 0, + text: template.title, + value: { + url: isUrlTemplate(template) ? Optional.from(template.url) : Optional.none(), + content: !isUrlTemplate(template) ? Optional.from(template.content) : Optional.none(), + description: template.description } - return Optional.from(global$1.map(templateList, function (template, index) { - var isUrlTemplate = function (t) { - return t.url !== undefined; - }; - return { - selected: index === 0, - text: template.title, - value: { - url: isUrlTemplate(template) ? Optional.from(template.url) : Optional.none(), - content: !isUrlTemplate(template) ? Optional.from(template.content) : Optional.none(), - description: template.description - } - }; - })); - }; - var createSelectBoxItems = function (templates) { - return map(templates, function (t) { - return { - text: t.text, - value: t.text - }; - }); - }; - var findTemplate = function (templates, templateTitle) { - return find(templates, function (t) { - return t.text === templateTitle; + }; + })); + }; + var createSelectBoxItems = function (templates) { + return map(templates, function (t) { + return { + text: t.text, + value: t.text + }; + }); + }; + var findTemplate = function (templates, templateTitle) { + return find(templates, function (t) { + return t.text === templateTitle; + }); + }; + var loadFailedAlert = function (api) { + editor.windowManager.alert('Could not load the specified template.', function () { + return api.focus('template'); + }); + }; + var getTemplateContent = function (t) { + return new global$4(function (resolve, reject) { + t.value.url.fold(function () { + return resolve(t.value.content.getOr('')); + }, function (url) { + return global$2.send({ + url: url, + success: function (html) { + resolve(html); + }, + error: function (e) { + reject(e); + } }); - }; - var loadFailedAlert = function (api) { - editor.windowManager.alert('Could not load the specified template.', function () { - return api.focus('template'); + }); + }); + }; + var onChange = function (templates, updateDialog) { + return function (api, change) { + if (change.name === 'template') { + var newTemplateTitle = api.getData().template; + findTemplate(templates, newTemplateTitle).each(function (t) { + api.block('Loading...'); + getTemplateContent(t).then(function (previewHtml) { + updateDialog(api, t, previewHtml); + }).catch(function () { + updateDialog(api, t, ''); + api.disable('save'); + loadFailedAlert(api); + }); }); + } }; - var getTemplateContent = function (t) { - return new global$4(function (resolve, reject) { - t.value.url.fold(function () { - return resolve(t.value.content.getOr('')); - }, function (url) { - return global$2.send({ - url: url, - success: function (html) { - resolve(html); - }, - error: function (e) { - reject(e); - } - }); - }); + }; + var onSubmit = function (templates) { + return function (api) { + var data = api.getData(); + findTemplate(templates, data.template).each(function (t) { + getTemplateContent(t).then(function (previewHtml) { + insertTemplate(editor, false, previewHtml); + api.close(); + }).catch(function () { + api.disable('save'); + loadFailedAlert(api); }); + }); }; - var onChange = function (templates, updateDialog) { - return function (api, change) { - if (change.name === 'template') { - var newTemplateTitle = api.getData().template; - findTemplate(templates, newTemplateTitle).each(function (t) { - api.block('Loading...'); - getTemplateContent(t).then(function (previewHtml) { - updateDialog(api, t, previewHtml); - }).catch(function () { - updateDialog(api, t, ''); - api.disable('save'); - loadFailedAlert(api); - }); - }); - } - }; - }; - var onSubmit = function (templates) { - return function (api) { - var data = api.getData(); - findTemplate(templates, data.template).each(function (t) { - getTemplateContent(t).then(function (previewHtml) { - insertTemplate(editor, false, previewHtml); - api.close(); - }).catch(function () { - api.disable('save'); - loadFailedAlert(api); - }); - }); - }; + }; + var openDialog = function (templates) { + var selectBoxItems = createSelectBoxItems(templates); + var buildDialogSpec = function (bodyItems, initialData) { + return { + title: 'Insert Template', + size: 'large', + body: { + type: 'panel', + items: bodyItems + }, + initialData: initialData, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + onSubmit: onSubmit(templates), + onChange: onChange(templates, updateDialog) + }; }; - var openDialog = function (templates) { - var selectBoxItems = createSelectBoxItems(templates); - var buildDialogSpec = function (bodyItems, initialData) { - return { - title: 'Insert Template', - size: 'large', - body: { - type: 'panel', - items: bodyItems - }, - initialData: initialData, - buttons: [ - { - type: 'cancel', - name: 'cancel', - text: 'Cancel' - }, - { - type: 'submit', - name: 'save', - text: 'Save', - primary: true - } - ], - onSubmit: onSubmit(templates), - onChange: onChange(templates, updateDialog) - }; - }; - var updateDialog = function (dialogApi, template, previewHtml) { - var content = getPreviewContent(editor, previewHtml); - var bodyItems = [ - { - type: 'selectbox', - name: 'template', - label: 'Templates', - items: selectBoxItems - }, - { - type: 'htmlpanel', - html: '

              ' + htmlEscape(template.value.description) + '

              ' - }, - { - label: 'Preview', - type: 'iframe', - name: 'preview', - sandboxed: false - } - ]; - var initialData = { - template: template.text, - preview: content - }; - dialogApi.unblock(); - dialogApi.redial(buildDialogSpec(bodyItems, initialData)); - dialogApi.focus('template'); - }; - var dialogApi = editor.windowManager.open(buildDialogSpec([], { - template: '', - preview: '' - })); - dialogApi.block('Loading...'); - getTemplateContent(templates[0]).then(function (previewHtml) { - updateDialog(dialogApi, templates[0], previewHtml); - }).catch(function () { - updateDialog(dialogApi, templates[0], ''); - dialogApi.disable('save'); - loadFailedAlert(dialogApi); - }); + var updateDialog = function (dialogApi, template, previewHtml) { + var content = getPreviewContent(editor, previewHtml); + var bodyItems = [ + { + type: 'selectbox', + name: 'template', + label: 'Templates', + items: selectBoxItems + }, + { + type: 'htmlpanel', + html: '

              ' + htmlEscape(template.value.description) + '

              ' + }, + { + label: 'Preview', + type: 'iframe', + name: 'preview', + sandboxed: false + } + ]; + var initialData = { + template: template.text, + preview: content + }; + dialogApi.unblock(); + dialogApi.redial(buildDialogSpec(bodyItems, initialData)); + dialogApi.focus('template'); }; - var optTemplates = createTemplates(); - optTemplates.each(openDialog); + var dialogApi = editor.windowManager.open(buildDialogSpec([], { + template: '', + preview: '' + })); + dialogApi.block('Loading...'); + getTemplateContent(templates[0]).then(function (previewHtml) { + updateDialog(dialogApi, templates[0], previewHtml); + }).catch(function () { + updateDialog(dialogApi, templates[0], ''); + dialogApi.disable('save'); + loadFailedAlert(dialogApi); + }); + }; + var optTemplates = createTemplates(); + optTemplates.each(openDialog); }; var showDialog = function (editor) { - return function (templates) { - open(editor, templates); - }; + return function (templates) { + open(editor, templates); + }; }; var register$1 = function (editor) { - editor.ui.registry.addButton('template', { - icon: 'template', - tooltip: 'Insert template', - onAction: createTemplateList(editor, showDialog(editor)) - }); - editor.ui.registry.addMenuItem('template', { - icon: 'template', - text: 'Insert template...', - onAction: createTemplateList(editor, showDialog(editor)) - }); + editor.ui.registry.addButton('template', { + icon: 'template', + tooltip: 'Insert template', + onAction: createTemplateList(editor, showDialog(editor)) + }); + editor.ui.registry.addMenuItem('template', { + icon: 'template', + text: 'Insert template...', + onAction: createTemplateList(editor, showDialog(editor)) + }); }; - function Plugin() { - global.add('template', function (editor) { - register$1(editor); - register(editor); - setup(editor); - }); + function Plugin () { + global.add('template', function (editor) { + register$1(editor); + register(editor); + setup(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/textcolor/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/textcolor/plugin.js index 2d8d8522..16dcf462 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/textcolor/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/textcolor/plugin.js @@ -11,10 +11,10 @@ var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); - function Plugin() { - global.add('textcolor', function () { - console.warn('Text color plugin is now built in to the core editor, please remove it from your editor configuration'); - }); + function Plugin () { + global.add('textcolor', function () { + console.warn('Text color plugin is now built in to the core editor, please remove it from your editor configuration'); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/textpattern/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/textpattern/plugin.js index 10ac4898..15d010e3 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/textpattern/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/textpattern/plugin.js @@ -10,183 +10,182 @@ 'use strict'; var Cell = function (initial) { - var value = initial; - var get = function () { - return value; - }; - var set = function (v) { - value = v; - }; - return { - get: get, - set: set - }; + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; }; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); }; - function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) - s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; + for (var s = 0, i = 0, il = arguments.length; i < il; i++) + s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; } var noop = function () { }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; var identity = function (x) { - return x; + return x; }; var die = function (msg) { - return function () { - throw new Error(msg); - }; + return function () { + throw new Error(msg); + }; }; var never = constant(false); var always = constant(true); var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var typeOf = function (x) { - var t = typeof x; - if (x === null) { - return 'null'; - } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { - return 'array'; - } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { - return 'string'; - } else { - return t; - } + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } }; var isType = function (type) { - return function (value) { - return typeOf(value) === type; - }; + return function (value) { + return typeOf(value) === type; + }; }; var isString = isType('string'); var isObject = isType('object'); @@ -195,574 +194,574 @@ var nativeSlice = Array.prototype.slice; var nativeIndexOf = Array.prototype.indexOf; var rawIndexOf = function (ts, t) { - return nativeIndexOf.call(ts, t); + return nativeIndexOf.call(ts, t); }; var contains = function (xs, x) { - return rawIndexOf(xs, x) > -1; + return rawIndexOf(xs, x) > -1; }; var map = function (xs, f) { - var len = xs.length; - var r = new Array(len); - for (var i = 0; i < len; i++) { - var x = xs[i]; - r[i] = f(x, i); - } - return r; + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; }; var each = function (xs, f) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - f(x, i); - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } }; var eachr = function (xs, f) { - for (var i = xs.length - 1; i >= 0; i--) { - var x = xs[i]; - f(x, i); - } + for (var i = xs.length - 1; i >= 0; i--) { + var x = xs[i]; + f(x, i); + } }; var filter = function (xs, pred) { - var r = []; - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - r.push(x); - } + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); } - return r; + } + return r; }; var foldr = function (xs, f, acc) { - eachr(xs, function (x) { - acc = f(acc, x); - }); - return acc; + eachr(xs, function (x) { + acc = f(acc, x); + }); + return acc; }; var foldl = function (xs, f, acc) { - each(xs, function (x) { - acc = f(acc, x); - }); - return acc; + each(xs, function (x) { + acc = f(acc, x); + }); + return acc; }; var findUntil = function (xs, pred, until) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - return Optional.some(x); - } else if (until(x, i)) { - break; - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(x); + } else if (until(x, i)) { + break; } - return Optional.none(); + } + return Optional.none(); }; var find = function (xs, pred) { - return findUntil(xs, pred, never); + return findUntil(xs, pred, never); }; var forall = function (xs, pred) { - for (var i = 0, len = xs.length; i < len; ++i) { - var x = xs[i]; - if (pred(x, i) !== true) { - return false; - } + for (var i = 0, len = xs.length; i < len; ++i) { + var x = xs[i]; + if (pred(x, i) !== true) { + return false; } - return true; + } + return true; }; var sort = function (xs, comparator) { - var copy = nativeSlice.call(xs, 0); - copy.sort(comparator); - return copy; + var copy = nativeSlice.call(xs, 0); + copy.sort(comparator); + return copy; }; var get = function (xs, i) { - return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none(); + return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none(); }; var head = function (xs) { - return get(xs, 0); + return get(xs, 0); }; var keys = Object.keys; var hasOwnProperty = Object.hasOwnProperty; var has = function (obj, key) { - return hasOwnProperty.call(obj, key); + return hasOwnProperty.call(obj, key); }; var generate = function (cases) { - if (!isArray(cases)) { - throw new Error('cases must be an array'); + if (!isArray(cases)) { + throw new Error('cases must be an array'); + } + if (cases.length === 0) { + throw new Error('there must be at least one case'); + } + var constructors = []; + var adt = {}; + each(cases, function (acase, count) { + var keys$1 = keys(acase); + if (keys$1.length !== 1) { + throw new Error('one and only one name per case'); } - if (cases.length === 0) { - throw new Error('there must be at least one case'); + var key = keys$1[0]; + var value = acase[key]; + if (adt[key] !== undefined) { + throw new Error('duplicate key detected:' + key); + } else if (key === 'cata') { + throw new Error('cannot have a case named cata (sorry)'); + } else if (!isArray(value)) { + throw new Error('case arguments must be an array'); } - var constructors = []; - var adt = {}; - each(cases, function (acase, count) { - var keys$1 = keys(acase); - if (keys$1.length !== 1) { - throw new Error('one and only one name per case'); + constructors.push(key); + adt[key] = function () { + var argLength = arguments.length; + if (argLength !== value.length) { + throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength); + } + var args = new Array(argLength); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + var match = function (branches) { + var branchKeys = keys(branches); + if (constructors.length !== branchKeys.length) { + throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\nActual: ' + branchKeys.join(',')); } - var key = keys$1[0]; - var value = acase[key]; - if (adt[key] !== undefined) { - throw new Error('duplicate key detected:' + key); - } else if (key === 'cata') { - throw new Error('cannot have a case named cata (sorry)'); - } else if (!isArray(value)) { - throw new Error('case arguments must be an array'); + var allReqd = forall(constructors, function (reqKey) { + return contains(branchKeys, reqKey); + }); + if (!allReqd) { + throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', ')); } - constructors.push(key); - adt[key] = function () { - var argLength = arguments.length; - if (argLength !== value.length) { - throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength); - } - var args = new Array(argLength); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - var match = function (branches) { - var branchKeys = keys(branches); - if (constructors.length !== branchKeys.length) { - throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\nActual: ' + branchKeys.join(',')); - } - var allReqd = forall(constructors, function (reqKey) { - return contains(branchKeys, reqKey); - }); - if (!allReqd) { - throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', ')); - } - return branches[key].apply(null, args); - }; - return { - fold: function () { - if (arguments.length !== cases.length) { - throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + arguments.length); - } - var target = arguments[count]; - return target.apply(null, args); - }, - match: match, - log: function (label) { - console.log(label, { - constructors: constructors, - constructor: key, - params: args - }); - } - }; - }; - }); - return adt; + return branches[key].apply(null, args); + }; + return { + fold: function () { + if (arguments.length !== cases.length) { + throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + arguments.length); + } + var target = arguments[count]; + return target.apply(null, args); + }, + match: match, + log: function (label) { + console.log(label, { + constructors: constructors, + constructor: key, + params: args + }); + } + }; + }; + }); + return adt; }; - var Adt = {generate: generate}; + var Adt = { generate: generate }; var comparison = Adt.generate([ - { - bothErrors: [ - 'error1', - 'error2' - ] - }, - { - firstError: [ - 'error1', - 'value2' - ] - }, - { - secondError: [ - 'value1', - 'error2' - ] - }, - { - bothValues: [ - 'value1', - 'value2' - ] - } + { + bothErrors: [ + 'error1', + 'error2' + ] + }, + { + firstError: [ + 'error1', + 'value2' + ] + }, + { + secondError: [ + 'value1', + 'error2' + ] + }, + { + bothValues: [ + 'value1', + 'value2' + ] + } ]); var partition = function (results) { - var errors = []; - var values = []; - each(results, function (result) { - result.fold(function (err) { - errors.push(err); - }, function (value) { - values.push(value); - }); + var errors = []; + var values = []; + each(results, function (result) { + result.fold(function (err) { + errors.push(err); + }, function (value) { + values.push(value); }); - return { - errors: errors, - values: values - }; + }); + return { + errors: errors, + values: values + }; }; var value = function (o) { - var is = function (v) { - return o === v; - }; - var or = function (_opt) { - return value(o); - }; - var orThunk = function (_f) { - return value(o); - }; - var map = function (f) { - return value(f(o)); - }; - var mapError = function (_f) { - return value(o); - }; - var each = function (f) { - f(o); - }; - var bind = function (f) { - return f(o); - }; - var fold = function (_, onValue) { - return onValue(o); - }; - var exists = function (f) { - return f(o); - }; - var forall = function (f) { - return f(o); - }; - var toOptional = function () { - return Optional.some(o); - }; - return { - is: is, - isValue: always, - isError: never, - getOr: constant(o), - getOrThunk: constant(o), - getOrDie: constant(o), - or: or, - orThunk: orThunk, - fold: fold, - map: map, - mapError: mapError, - each: each, - bind: bind, - exists: exists, - forall: forall, - toOptional: toOptional - }; + var is = function (v) { + return o === v; + }; + var or = function (_opt) { + return value(o); + }; + var orThunk = function (_f) { + return value(o); + }; + var map = function (f) { + return value(f(o)); + }; + var mapError = function (_f) { + return value(o); + }; + var each = function (f) { + f(o); + }; + var bind = function (f) { + return f(o); + }; + var fold = function (_, onValue) { + return onValue(o); + }; + var exists = function (f) { + return f(o); + }; + var forall = function (f) { + return f(o); + }; + var toOptional = function () { + return Optional.some(o); + }; + return { + is: is, + isValue: always, + isError: never, + getOr: constant(o), + getOrThunk: constant(o), + getOrDie: constant(o), + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: each, + bind: bind, + exists: exists, + forall: forall, + toOptional: toOptional + }; }; var error = function (message) { - var getOrThunk = function (f) { - return f(); - }; - var getOrDie = function () { - return die(String(message))(); - }; - var or = function (opt) { - return opt; - }; - var orThunk = function (f) { - return f(); - }; - var map = function (_f) { - return error(message); - }; - var mapError = function (f) { - return error(f(message)); - }; - var bind = function (_f) { - return error(message); - }; - var fold = function (onError, _) { - return onError(message); - }; - return { - is: never, - isValue: never, - isError: always, - getOr: identity, - getOrThunk: getOrThunk, - getOrDie: getOrDie, - or: or, - orThunk: orThunk, - fold: fold, - map: map, - mapError: mapError, - each: noop, - bind: bind, - exists: never, - forall: always, - toOptional: Optional.none - }; + var getOrThunk = function (f) { + return f(); + }; + var getOrDie = function () { + return die(String(message))(); + }; + var or = function (opt) { + return opt; + }; + var orThunk = function (f) { + return f(); + }; + var map = function (_f) { + return error(message); + }; + var mapError = function (f) { + return error(f(message)); + }; + var bind = function (_f) { + return error(message); + }; + var fold = function (onError, _) { + return onError(message); + }; + return { + is: never, + isValue: never, + isError: always, + getOr: identity, + getOrThunk: getOrThunk, + getOrDie: getOrDie, + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: noop, + bind: bind, + exists: never, + forall: always, + toOptional: Optional.none + }; }; var fromOption = function (opt, err) { - return opt.fold(function () { - return error(err); - }, value); + return opt.fold(function () { + return error(err); + }, value); }; var Result = { - value: value, - error: error, - fromOption: fromOption + value: value, + error: error, + fromOption: fromOption }; var isInlinePattern = function (pattern) { - return pattern.type === 'inline-command' || pattern.type === 'inline-format'; + return pattern.type === 'inline-command' || pattern.type === 'inline-format'; }; var isBlockPattern = function (pattern) { - return pattern.type === 'block-command' || pattern.type === 'block-format'; + return pattern.type === 'block-command' || pattern.type === 'block-format'; }; var sortPatterns = function (patterns) { - return sort(patterns, function (a, b) { - if (a.start.length === b.start.length) { - return 0; - } - return a.start.length > b.start.length ? -1 : 1; - }); + return sort(patterns, function (a, b) { + if (a.start.length === b.start.length) { + return 0; + } + return a.start.length > b.start.length ? -1 : 1; + }); }; var normalizePattern = function (pattern) { - var err = function (message) { - return Result.error({ - message: message, - pattern: pattern - }); - }; - var formatOrCmd = function (name, onFormat, onCommand) { - if (pattern.format !== undefined) { - var formats = void 0; - if (isArray(pattern.format)) { - if (!forall(pattern.format, isString)) { - return err(name + ' pattern has non-string items in the `format` array'); - } - formats = pattern.format; - } else if (isString(pattern.format)) { - formats = [pattern.format]; - } else { - return err(name + ' pattern has non-string `format` parameter'); - } - return Result.value(onFormat(formats)); - } else if (pattern.cmd !== undefined) { - if (!isString(pattern.cmd)) { - return err(name + ' pattern has non-string `cmd` parameter'); - } - return Result.value(onCommand(pattern.cmd, pattern.value)); - } else { - return err(name + ' pattern is missing both `format` and `cmd` parameters'); + var err = function (message) { + return Result.error({ + message: message, + pattern: pattern + }); + }; + var formatOrCmd = function (name, onFormat, onCommand) { + if (pattern.format !== undefined) { + var formats = void 0; + if (isArray(pattern.format)) { + if (!forall(pattern.format, isString)) { + return err(name + ' pattern has non-string items in the `format` array'); } - }; - if (!isObject(pattern)) { - return err('Raw pattern is not an object'); + formats = pattern.format; + } else if (isString(pattern.format)) { + formats = [pattern.format]; + } else { + return err(name + ' pattern has non-string `format` parameter'); + } + return Result.value(onFormat(formats)); + } else if (pattern.cmd !== undefined) { + if (!isString(pattern.cmd)) { + return err(name + ' pattern has non-string `cmd` parameter'); + } + return Result.value(onCommand(pattern.cmd, pattern.value)); + } else { + return err(name + ' pattern is missing both `format` and `cmd` parameters'); } - if (!isString(pattern.start)) { - return err('Raw pattern is missing `start` parameter'); + }; + if (!isObject(pattern)) { + return err('Raw pattern is not an object'); + } + if (!isString(pattern.start)) { + return err('Raw pattern is missing `start` parameter'); + } + if (pattern.end !== undefined) { + if (!isString(pattern.end)) { + return err('Inline pattern has non-string `end` parameter'); } - if (pattern.end !== undefined) { - if (!isString(pattern.end)) { - return err('Inline pattern has non-string `end` parameter'); - } - if (pattern.start.length === 0 && pattern.end.length === 0) { - return err('Inline pattern has empty `start` and `end` parameters'); - } - var start_1 = pattern.start; - var end_1 = pattern.end; - if (end_1.length === 0) { - end_1 = start_1; - start_1 = ''; - } - return formatOrCmd('Inline', function (format) { - return { - type: 'inline-format', - start: start_1, - end: end_1, - format: format - }; - }, function (cmd, value) { - return { - type: 'inline-command', - start: start_1, - end: end_1, - cmd: cmd, - value: value - }; - }); - } else if (pattern.replacement !== undefined) { - if (!isString(pattern.replacement)) { - return err('Replacement pattern has non-string `replacement` parameter'); - } - if (pattern.start.length === 0) { - return err('Replacement pattern has empty `start` parameter'); - } - return Result.value({ - type: 'inline-command', - start: '', - end: pattern.start, - cmd: 'mceInsertContent', - value: pattern.replacement - }); - } else { - if (pattern.start.length === 0) { - return err('Block pattern has empty `start` parameter'); - } - return formatOrCmd('Block', function (formats) { - return { - type: 'block-format', - start: pattern.start, - format: formats[0] - }; - }, function (command, commandValue) { - return { - type: 'block-command', - start: pattern.start, - cmd: command, - value: commandValue - }; - }); + if (pattern.start.length === 0 && pattern.end.length === 0) { + return err('Inline pattern has empty `start` and `end` parameters'); } + var start_1 = pattern.start; + var end_1 = pattern.end; + if (end_1.length === 0) { + end_1 = start_1; + start_1 = ''; + } + return formatOrCmd('Inline', function (format) { + return { + type: 'inline-format', + start: start_1, + end: end_1, + format: format + }; + }, function (cmd, value) { + return { + type: 'inline-command', + start: start_1, + end: end_1, + cmd: cmd, + value: value + }; + }); + } else if (pattern.replacement !== undefined) { + if (!isString(pattern.replacement)) { + return err('Replacement pattern has non-string `replacement` parameter'); + } + if (pattern.start.length === 0) { + return err('Replacement pattern has empty `start` parameter'); + } + return Result.value({ + type: 'inline-command', + start: '', + end: pattern.start, + cmd: 'mceInsertContent', + value: pattern.replacement + }); + } else { + if (pattern.start.length === 0) { + return err('Block pattern has empty `start` parameter'); + } + return formatOrCmd('Block', function (formats) { + return { + type: 'block-format', + start: pattern.start, + format: formats[0] + }; + }, function (command, commandValue) { + return { + type: 'block-command', + start: pattern.start, + cmd: command, + value: commandValue + }; + }); + } }; var denormalizePattern = function (pattern) { - if (pattern.type === 'block-command') { - return { - start: pattern.start, - cmd: pattern.cmd, - value: pattern.value - }; - } else if (pattern.type === 'block-format') { - return { - start: pattern.start, - format: pattern.format - }; - } else if (pattern.type === 'inline-command') { - if (pattern.cmd === 'mceInsertContent' && pattern.start === '') { - return { - start: pattern.end, - replacement: pattern.value - }; - } else { - return { - start: pattern.start, - end: pattern.end, - cmd: pattern.cmd, - value: pattern.value - }; - } - } else if (pattern.type === 'inline-format') { - return { - start: pattern.start, - end: pattern.end, - format: pattern.format.length === 1 ? pattern.format[0] : pattern.format - }; + if (pattern.type === 'block-command') { + return { + start: pattern.start, + cmd: pattern.cmd, + value: pattern.value + }; + } else if (pattern.type === 'block-format') { + return { + start: pattern.start, + format: pattern.format + }; + } else if (pattern.type === 'inline-command') { + if (pattern.cmd === 'mceInsertContent' && pattern.start === '') { + return { + start: pattern.end, + replacement: pattern.value + }; + } else { + return { + start: pattern.start, + end: pattern.end, + cmd: pattern.cmd, + value: pattern.value + }; } - }; - var createPatternSet = function (patterns) { + } else if (pattern.type === 'inline-format') { return { - inlinePatterns: filter(patterns, isInlinePattern), - blockPatterns: sortPatterns(filter(patterns, isBlockPattern)) + start: pattern.start, + end: pattern.end, + format: pattern.format.length === 1 ? pattern.format[0] : pattern.format }; + } + }; + var createPatternSet = function (patterns) { + return { + inlinePatterns: filter(patterns, isInlinePattern), + blockPatterns: sortPatterns(filter(patterns, isBlockPattern)) + }; }; var get$1 = function (patternsState) { - var setPatterns = function (newPatterns) { - var normalized = partition(map(newPatterns, normalizePattern)); - if (normalized.errors.length > 0) { - var firstError = normalized.errors[0]; - throw new Error(firstError.message + ':\n' + JSON.stringify(firstError.pattern, null, 2)); - } - patternsState.set(createPatternSet(normalized.values)); - }; - var getPatterns = function () { - return __spreadArrays(map(patternsState.get().inlinePatterns, denormalizePattern), map(patternsState.get().blockPatterns, denormalizePattern)); - }; - return { - setPatterns: setPatterns, - getPatterns: getPatterns - }; + var setPatterns = function (newPatterns) { + var normalized = partition(map(newPatterns, normalizePattern)); + if (normalized.errors.length > 0) { + var firstError = normalized.errors[0]; + throw new Error(firstError.message + ':\n' + JSON.stringify(firstError.pattern, null, 2)); + } + patternsState.set(createPatternSet(normalized.values)); + }; + var getPatterns = function () { + return __spreadArrays(map(patternsState.get().inlinePatterns, denormalizePattern), map(patternsState.get().blockPatterns, denormalizePattern)); + }; + return { + setPatterns: setPatterns, + getPatterns: getPatterns + }; }; var Global = typeof window !== 'undefined' ? window : Function('return this;')(); var error$1 = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var console = Global.console; - if (console) { - if (console.error) { - console.error.apply(console, args); - } else { - console.log.apply(console, args); - } + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var console = Global.console; + if (console) { + if (console.error) { + console.error.apply(console, args); + } else { + console.log.apply(console, args); } + } }; var defaultPatterns = [ - { - start: '*', - end: '*', - format: 'italic' - }, - { - start: '**', - end: '**', - format: 'bold' - }, - { - start: '#', - format: 'h1' - }, - { - start: '##', - format: 'h2' - }, - { - start: '###', - format: 'h3' - }, - { - start: '####', - format: 'h4' - }, - { - start: '#####', - format: 'h5' - }, - { - start: '######', - format: 'h6' - }, - { - start: '1. ', - cmd: 'InsertOrderedList' - }, - { - start: '* ', - cmd: 'InsertUnorderedList' - }, - { - start: '- ', - cmd: 'InsertUnorderedList' - } + { + start: '*', + end: '*', + format: 'italic' + }, + { + start: '**', + end: '**', + format: 'bold' + }, + { + start: '#', + format: 'h1' + }, + { + start: '##', + format: 'h2' + }, + { + start: '###', + format: 'h3' + }, + { + start: '####', + format: 'h4' + }, + { + start: '#####', + format: 'h5' + }, + { + start: '######', + format: 'h6' + }, + { + start: '1. ', + cmd: 'InsertOrderedList' + }, + { + start: '* ', + cmd: 'InsertUnorderedList' + }, + { + start: '- ', + cmd: 'InsertUnorderedList' + } ]; var getPatternSet = function (editor) { - var patterns = editor.getParam('textpattern_patterns', defaultPatterns, 'array'); - if (!isArray(patterns)) { - error$1('The setting textpattern_patterns should be an array'); - return { - inlinePatterns: [], - blockPatterns: [] - }; - } - var normalized = partition(map(patterns, normalizePattern)); - each(normalized.errors, function (err) { - return error$1(err.message, err.pattern); - }); - return createPatternSet(normalized.values); + var patterns = editor.getParam('textpattern_patterns', defaultPatterns, 'array'); + if (!isArray(patterns)) { + error$1('The setting textpattern_patterns should be an array'); + return { + inlinePatterns: [], + blockPatterns: [] + }; + } + var normalized = partition(map(patterns, normalizePattern)); + each(normalized.errors, function (err) { + return error$1(err.message, err.pattern); + }); + return createPatternSet(normalized.values); }; var getForcedRootBlock = function (editor) { - var block = editor.getParam('forced_root_block', 'p'); - if (block === false) { - return ''; - } else if (block === true) { - return 'p'; - } else { - return block; - } + var block = editor.getParam('forced_root_block', 'p'); + if (block === false) { + return ''; + } else if (block === true) { + return 'p'; + } else { + return block; + } }; var global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay'); @@ -779,611 +778,611 @@ var global$5 = tinymce.util.Tools.resolve('tinymce.dom.TextSeeker'); var point = function (container, offset) { - return { - container: container, - offset: offset - }; + return { + container: container, + offset: offset + }; }; var isText = function (node) { - return node.nodeType === Node.TEXT_NODE; + return node.nodeType === Node.TEXT_NODE; }; var cleanEmptyNodes = function (dom, node, isRoot) { - if (node && dom.isEmpty(node) && !isRoot(node)) { - var parent_1 = node.parentNode; - dom.remove(node); - cleanEmptyNodes(dom, parent_1, isRoot); - } + if (node && dom.isEmpty(node) && !isRoot(node)) { + var parent_1 = node.parentNode; + dom.remove(node); + cleanEmptyNodes(dom, parent_1, isRoot); + } }; var deleteRng = function (dom, rng, isRoot, clean) { - if (clean === void 0) { - clean = true; + if (clean === void 0) { + clean = true; + } + var startParent = rng.startContainer.parentNode; + var endParent = rng.endContainer.parentNode; + rng.deleteContents(); + if (clean && !isRoot(rng.startContainer)) { + if (isText(rng.startContainer) && rng.startContainer.data.length === 0) { + dom.remove(rng.startContainer); } - var startParent = rng.startContainer.parentNode; - var endParent = rng.endContainer.parentNode; - rng.deleteContents(); - if (clean && !isRoot(rng.startContainer)) { - if (isText(rng.startContainer) && rng.startContainer.data.length === 0) { - dom.remove(rng.startContainer); - } - if (isText(rng.endContainer) && rng.endContainer.data.length === 0) { - dom.remove(rng.endContainer); - } - cleanEmptyNodes(dom, startParent, isRoot); - if (startParent !== endParent) { - cleanEmptyNodes(dom, endParent, isRoot); - } + if (isText(rng.endContainer) && rng.endContainer.data.length === 0) { + dom.remove(rng.endContainer); } + cleanEmptyNodes(dom, startParent, isRoot); + if (startParent !== endParent) { + cleanEmptyNodes(dom, endParent, isRoot); + } + } }; var isBlockFormatName = function (name, formatter) { - var formatSet = formatter.get(name); - return isArray(formatSet) && head(formatSet).exists(function (format) { - return has(format, 'block'); - }); + var formatSet = formatter.get(name); + return isArray(formatSet) && head(formatSet).exists(function (format) { + return has(format, 'block'); + }); }; var isReplacementPattern = function (pattern) { - return pattern.start.length === 0; + return pattern.start.length === 0; }; var getParentBlock = function (editor, rng) { - var parentBlockOpt = Optional.from(editor.dom.getParent(rng.startContainer, editor.dom.isBlock)); - if (getForcedRootBlock(editor) === '') { - return parentBlockOpt.orThunk(function () { - return Optional.some(editor.getBody()); - }); - } else { - return parentBlockOpt; - } + var parentBlockOpt = Optional.from(editor.dom.getParent(rng.startContainer, editor.dom.isBlock)); + if (getForcedRootBlock(editor) === '') { + return parentBlockOpt.orThunk(function () { + return Optional.some(editor.getBody()); + }); + } else { + return parentBlockOpt; + } }; var DOM = global$4.DOM; var alwaysNext = function (startNode) { - return function (node) { - return startNode === node ? -1 : 0; - }; + return function (node) { + return startNode === node ? -1 : 0; + }; }; var isBoundary = function (dom) { - return function (node) { - return dom.isBlock(node) || contains([ - 'BR', - 'IMG', - 'HR', - 'INPUT' - ], node.nodeName) || dom.getContentEditable(node) === 'false'; - }; + return function (node) { + return dom.isBlock(node) || contains([ + 'BR', + 'IMG', + 'HR', + 'INPUT' + ], node.nodeName) || dom.getContentEditable(node) === 'false'; + }; }; var textBefore = function (node, offset, rootNode) { - if (isText(node) && offset >= 0) { - return Optional.some(point(node, offset)); - } else { - var textSeeker = global$5(DOM); - return Optional.from(textSeeker.backwards(node, offset, alwaysNext(node), rootNode)).map(function (prev) { - return point(prev.container, prev.container.data.length); - }); - } + if (isText(node) && offset >= 0) { + return Optional.some(point(node, offset)); + } else { + var textSeeker = global$5(DOM); + return Optional.from(textSeeker.backwards(node, offset, alwaysNext(node), rootNode)).map(function (prev) { + return point(prev.container, prev.container.data.length); + }); + } }; var textAfter = function (node, offset, rootNode) { - if (isText(node) && offset >= node.length) { - return Optional.some(point(node, offset)); - } else { - var textSeeker = global$5(DOM); - return Optional.from(textSeeker.forwards(node, offset, alwaysNext(node), rootNode)).map(function (prev) { - return point(prev.container, 0); - }); - } + if (isText(node) && offset >= node.length) { + return Optional.some(point(node, offset)); + } else { + var textSeeker = global$5(DOM); + return Optional.from(textSeeker.forwards(node, offset, alwaysNext(node), rootNode)).map(function (prev) { + return point(prev.container, 0); + }); + } }; var scanLeft = function (node, offset, rootNode) { - if (!isText(node)) { - return Optional.none(); - } - var text = node.textContent; - if (offset >= 0 && offset <= text.length) { - return Optional.some(point(node, offset)); - } else { - var textSeeker = global$5(DOM); - return Optional.from(textSeeker.backwards(node, offset, alwaysNext(node), rootNode)).bind(function (prev) { - var prevText = prev.container.data; - return scanLeft(prev.container, offset + prevText.length, rootNode); - }); - } + if (!isText(node)) { + return Optional.none(); + } + var text = node.textContent; + if (offset >= 0 && offset <= text.length) { + return Optional.some(point(node, offset)); + } else { + var textSeeker = global$5(DOM); + return Optional.from(textSeeker.backwards(node, offset, alwaysNext(node), rootNode)).bind(function (prev) { + var prevText = prev.container.data; + return scanLeft(prev.container, offset + prevText.length, rootNode); + }); + } }; var scanRight = function (node, offset, rootNode) { - if (!isText(node)) { - return Optional.none(); - } - var text = node.textContent; - if (offset <= text.length) { - return Optional.some(point(node, offset)); - } else { - var textSeeker = global$5(DOM); - return Optional.from(textSeeker.forwards(node, offset, alwaysNext(node), rootNode)).bind(function (next) { - return scanRight(next.container, offset - text.length, rootNode); - }); - } + if (!isText(node)) { + return Optional.none(); + } + var text = node.textContent; + if (offset <= text.length) { + return Optional.some(point(node, offset)); + } else { + var textSeeker = global$5(DOM); + return Optional.from(textSeeker.forwards(node, offset, alwaysNext(node), rootNode)).bind(function (next) { + return scanRight(next.container, offset - text.length, rootNode); + }); + } }; var repeatLeft = function (dom, node, offset, process, rootNode) { - var search = global$5(dom, isBoundary(dom)); - return Optional.from(search.backwards(node, offset, process, rootNode)); + var search = global$5(dom, isBoundary(dom)); + return Optional.from(search.backwards(node, offset, process, rootNode)); }; var generatePath = function (root, node, offset) { - if (isText(node) && (offset < 0 || offset > node.data.length)) { - return []; - } - var p = [offset]; - var current = node; - while (current !== root && current.parentNode) { - var parent_1 = current.parentNode; - for (var i = 0; i < parent_1.childNodes.length; i++) { - if (parent_1.childNodes[i] === current) { - p.push(i); - break; - } - } - current = parent_1; + if (isText(node) && (offset < 0 || offset > node.data.length)) { + return []; + } + var p = [offset]; + var current = node; + while (current !== root && current.parentNode) { + var parent_1 = current.parentNode; + for (var i = 0; i < parent_1.childNodes.length; i++) { + if (parent_1.childNodes[i] === current) { + p.push(i); + break; + } } - return current === root ? p.reverse() : []; + current = parent_1; + } + return current === root ? p.reverse() : []; }; var generatePathRange = function (root, startNode, startOffset, endNode, endOffset) { - var start = generatePath(root, startNode, startOffset); - var end = generatePath(root, endNode, endOffset); - return { - start: start, - end: end - }; + var start = generatePath(root, startNode, startOffset); + var end = generatePath(root, endNode, endOffset); + return { + start: start, + end: end + }; }; var resolvePath = function (root, path) { - var nodePath = path.slice(); - var offset = nodePath.pop(); - var resolvedNode = foldl(nodePath, function (optNode, index) { - return optNode.bind(function (node) { - return Optional.from(node.childNodes[index]); - }); - }, Optional.some(root)); - return resolvedNode.bind(function (node) { - if (isText(node) && (offset < 0 || offset > node.data.length)) { - return Optional.none(); - } else { - return Optional.some({ - node: node, - offset: offset - }); - } + var nodePath = path.slice(); + var offset = nodePath.pop(); + var resolvedNode = foldl(nodePath, function (optNode, index) { + return optNode.bind(function (node) { + return Optional.from(node.childNodes[index]); }); + }, Optional.some(root)); + return resolvedNode.bind(function (node) { + if (isText(node) && (offset < 0 || offset > node.data.length)) { + return Optional.none(); + } else { + return Optional.some({ + node: node, + offset: offset + }); + } + }); }; var resolvePathRange = function (root, range) { - return resolvePath(root, range.start).bind(function (_a) { - var startNode = _a.node, startOffset = _a.offset; - return resolvePath(root, range.end).map(function (_a) { - var endNode = _a.node, endOffset = _a.offset; - var rng = document.createRange(); - rng.setStart(startNode, startOffset); - rng.setEnd(endNode, endOffset); - return rng; - }); + return resolvePath(root, range.start).bind(function (_a) { + var startNode = _a.node, startOffset = _a.offset; + return resolvePath(root, range.end).map(function (_a) { + var endNode = _a.node, endOffset = _a.offset; + var rng = document.createRange(); + rng.setStart(startNode, startOffset); + rng.setEnd(endNode, endOffset); + return rng; }); + }); }; var generatePathRangeFromRange = function (root, range) { - return generatePathRange(root, range.startContainer, range.startOffset, range.endContainer, range.endOffset); + return generatePathRange(root, range.startContainer, range.startOffset, range.endContainer, range.endOffset); }; var stripPattern = function (dom, block, pattern) { - var firstTextNode = textAfter(block, 0, block); - firstTextNode.each(function (spot) { - var node = spot.container; - scanRight(node, pattern.start.length, block).each(function (end) { - var rng = dom.createRng(); - rng.setStart(node, 0); - rng.setEnd(end.container, end.offset); - deleteRng(dom, rng, function (e) { - return e === block; - }); - }); + var firstTextNode = textAfter(block, 0, block); + firstTextNode.each(function (spot) { + var node = spot.container; + scanRight(node, pattern.start.length, block).each(function (end) { + var rng = dom.createRng(); + rng.setStart(node, 0); + rng.setEnd(end.container, end.offset); + deleteRng(dom, rng, function (e) { + return e === block; + }); }); + }); }; var applyPattern = function (editor, match) { - var dom = editor.dom; - var pattern = match.pattern; - var rng = resolvePathRange(dom.getRoot(), match.range).getOrDie('Unable to resolve path range'); - getParentBlock(editor, rng).each(function (block) { - if (pattern.type === 'block-format') { - if (isBlockFormatName(pattern.format, editor.formatter)) { - editor.undoManager.transact(function () { - stripPattern(editor.dom, block, pattern); - editor.formatter.apply(pattern.format); - }); - } - } else if (pattern.type === 'block-command') { - editor.undoManager.transact(function () { - stripPattern(editor.dom, block, pattern); - editor.execCommand(pattern.cmd, false, pattern.value); - }); - } - }); - return true; + var dom = editor.dom; + var pattern = match.pattern; + var rng = resolvePathRange(dom.getRoot(), match.range).getOrDie('Unable to resolve path range'); + getParentBlock(editor, rng).each(function (block) { + if (pattern.type === 'block-format') { + if (isBlockFormatName(pattern.format, editor.formatter)) { + editor.undoManager.transact(function () { + stripPattern(editor.dom, block, pattern); + editor.formatter.apply(pattern.format); + }); + } + } else if (pattern.type === 'block-command') { + editor.undoManager.transact(function () { + stripPattern(editor.dom, block, pattern); + editor.execCommand(pattern.cmd, false, pattern.value); + }); + } + }); + return true; }; var findPattern = function (patterns, text) { - var nuText = text.replace(nbsp, ' '); - return find(patterns, function (pattern) { - return text.indexOf(pattern.start) === 0 || nuText.indexOf(pattern.start) === 0; - }); + var nuText = text.replace(nbsp, ' '); + return find(patterns, function (pattern) { + return text.indexOf(pattern.start) === 0 || nuText.indexOf(pattern.start) === 0; + }); }; var findPatterns = function (editor, patterns) { - var dom = editor.dom; - var rng = editor.selection.getRng(); - return getParentBlock(editor, rng).filter(function (block) { - var forcedRootBlock = getForcedRootBlock(editor); - var matchesForcedRootBlock = forcedRootBlock === '' && dom.is(block, 'body') || dom.is(block, forcedRootBlock); - return block !== null && matchesForcedRootBlock; - }).bind(function (block) { - var blockText = block.textContent; - var matchedPattern = findPattern(patterns, blockText); - return matchedPattern.map(function (pattern) { - if (global$3.trim(blockText).length === pattern.start.length) { - return []; - } - return [{ - pattern: pattern, - range: generatePathRange(dom.getRoot(), block, 0, block, 0) - }]; - }); - }).getOr([]); + var dom = editor.dom; + var rng = editor.selection.getRng(); + return getParentBlock(editor, rng).filter(function (block) { + var forcedRootBlock = getForcedRootBlock(editor); + var matchesForcedRootBlock = forcedRootBlock === '' && dom.is(block, 'body') || dom.is(block, forcedRootBlock); + return block !== null && matchesForcedRootBlock; + }).bind(function (block) { + var blockText = block.textContent; + var matchedPattern = findPattern(patterns, blockText); + return matchedPattern.map(function (pattern) { + if (global$3.trim(blockText).length === pattern.start.length) { + return []; + } + return [{ + pattern: pattern, + range: generatePathRange(dom.getRoot(), block, 0, block, 0) + }]; + }); + }).getOr([]); }; var applyMatches = function (editor, matches) { - if (matches.length === 0) { - return; - } - var bookmark = editor.selection.getBookmark(); - each(matches, function (match) { - return applyPattern(editor, match); - }); - editor.selection.moveToBookmark(bookmark); + if (matches.length === 0) { + return; + } + var bookmark = editor.selection.getBookmark(); + each(matches, function (match) { + return applyPattern(editor, match); + }); + editor.selection.moveToBookmark(bookmark); }; var unique = 0; var generate$1 = function (prefix) { - var date = new Date(); - var time = date.getTime(); - var random = Math.floor(Math.random() * 1000000000); - unique++; - return prefix + '_' + random + unique + String(time); + var date = new Date(); + var time = date.getTime(); + var random = Math.floor(Math.random() * 1000000000); + unique++; + return prefix + '_' + random + unique + String(time); }; var checkRange = function (str, substr, start) { - return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr; + return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr; }; var endsWith = function (str, suffix) { - return checkRange(str, suffix, str.length - suffix.length); + return checkRange(str, suffix, str.length - suffix.length); }; var newMarker = function (dom, id) { - return dom.create('span', { - 'data-mce-type': 'bookmark', - id: id - }); + return dom.create('span', { + 'data-mce-type': 'bookmark', + id: id + }); }; var rangeFromMarker = function (dom, marker) { - var rng = dom.createRng(); - rng.setStartAfter(marker.start); - rng.setEndBefore(marker.end); - return rng; + var rng = dom.createRng(); + rng.setStartAfter(marker.start); + rng.setEndBefore(marker.end); + return rng; }; var createMarker = function (dom, markerPrefix, pathRange) { - var rng = resolvePathRange(dom.getRoot(), pathRange).getOrDie('Unable to resolve path range'); - var startNode = rng.startContainer; - var endNode = rng.endContainer; - var textEnd = rng.endOffset === 0 ? endNode : endNode.splitText(rng.endOffset); - var textStart = rng.startOffset === 0 ? startNode : startNode.splitText(rng.startOffset); - return { - prefix: markerPrefix, - end: textEnd.parentNode.insertBefore(newMarker(dom, markerPrefix + '-end'), textEnd), - start: textStart.parentNode.insertBefore(newMarker(dom, markerPrefix + '-start'), textStart) - }; + var rng = resolvePathRange(dom.getRoot(), pathRange).getOrDie('Unable to resolve path range'); + var startNode = rng.startContainer; + var endNode = rng.endContainer; + var textEnd = rng.endOffset === 0 ? endNode : endNode.splitText(rng.endOffset); + var textStart = rng.startOffset === 0 ? startNode : startNode.splitText(rng.startOffset); + return { + prefix: markerPrefix, + end: textEnd.parentNode.insertBefore(newMarker(dom, markerPrefix + '-end'), textEnd), + start: textStart.parentNode.insertBefore(newMarker(dom, markerPrefix + '-start'), textStart) + }; }; var removeMarker = function (dom, marker, isRoot) { - cleanEmptyNodes(dom, dom.get(marker.prefix + '-end'), isRoot); - cleanEmptyNodes(dom, dom.get(marker.prefix + '-start'), isRoot); + cleanEmptyNodes(dom, dom.get(marker.prefix + '-end'), isRoot); + cleanEmptyNodes(dom, dom.get(marker.prefix + '-start'), isRoot); }; var matchesPattern = function (dom, block, patternContent) { - return function (element, offset) { - var text = element.data; - var searchText = text.substring(0, offset); - var startEndIndex = searchText.lastIndexOf(patternContent.charAt(patternContent.length - 1)); - var startIndex = searchText.lastIndexOf(patternContent); - if (startIndex !== -1) { - return startIndex + patternContent.length; - } else if (startEndIndex !== -1) { - return startEndIndex + 1; - } else { - return -1; - } - }; + return function (element, offset) { + var text = element.data; + var searchText = text.substring(0, offset); + var startEndIndex = searchText.lastIndexOf(patternContent.charAt(patternContent.length - 1)); + var startIndex = searchText.lastIndexOf(patternContent); + if (startIndex !== -1) { + return startIndex + patternContent.length; + } else if (startEndIndex !== -1) { + return startEndIndex + 1; + } else { + return -1; + } + }; }; var findPatternStartFromSpot = function (dom, pattern, block, spot) { - var startPattern = pattern.start; - var startSpot = repeatLeft(dom, spot.container, spot.offset, matchesPattern(dom, block, startPattern), block); - return startSpot.bind(function (spot) { - if (spot.offset >= startPattern.length) { - var rng = dom.createRng(); - rng.setStart(spot.container, spot.offset - startPattern.length); - rng.setEnd(spot.container, spot.offset); - return Optional.some(rng); - } else { - var offset = spot.offset - startPattern.length; - return scanLeft(spot.container, offset, block).map(function (nextSpot) { - var rng = dom.createRng(); - rng.setStart(nextSpot.container, nextSpot.offset); - rng.setEnd(spot.container, spot.offset); - return rng; - }).filter(function (rng) { - return rng.toString() === startPattern; - }).orThunk(function () { - return findPatternStartFromSpot(dom, pattern, block, point(spot.container, 0)); - }); - } - }); - }; - var findPatternStart = function (dom, pattern, node, offset, block, requireGap) { - if (requireGap === void 0) { - requireGap = false; - } - if (pattern.start.length === 0 && !requireGap) { + var startPattern = pattern.start; + var startSpot = repeatLeft(dom, spot.container, spot.offset, matchesPattern(dom, block, startPattern), block); + return startSpot.bind(function (spot) { + if (spot.offset >= startPattern.length) { + var rng = dom.createRng(); + rng.setStart(spot.container, spot.offset - startPattern.length); + rng.setEnd(spot.container, spot.offset); + return Optional.some(rng); + } else { + var offset = spot.offset - startPattern.length; + return scanLeft(spot.container, offset, block).map(function (nextSpot) { var rng = dom.createRng(); - rng.setStart(node, offset); - rng.setEnd(node, offset); - return Optional.some(rng); + rng.setStart(nextSpot.container, nextSpot.offset); + rng.setEnd(spot.container, spot.offset); + return rng; + }).filter(function (rng) { + return rng.toString() === startPattern; + }).orThunk(function () { + return findPatternStartFromSpot(dom, pattern, block, point(spot.container, 0)); + }); } - return textBefore(node, offset, block).bind(function (spot) { - var start = findPatternStartFromSpot(dom, pattern, block, spot); - return start.bind(function (startRange) { - if (requireGap) { - if (startRange.endContainer === spot.container && startRange.endOffset === spot.offset) { - return Optional.none(); - } else if (spot.offset === 0 && startRange.endContainer.textContent.length === startRange.endOffset) { - return Optional.none(); - } - } - return Optional.some(startRange); - }); - }); + }); }; - var findPattern$1 = function (editor, block, details) { - var dom = editor.dom; - var root = dom.getRoot(); - var pattern = details.pattern; - var endNode = details.position.container; - var endOffset = details.position.offset; - return scanLeft(endNode, endOffset - details.pattern.end.length, block).bind(function (spot) { - var endPathRng = generatePathRange(root, spot.container, spot.offset, endNode, endOffset); - if (isReplacementPattern(pattern)) { - return Optional.some({ - matches: [{ - pattern: pattern, - startRng: endPathRng, - endRng: endPathRng - }], - position: spot - }); - } else { - var resultsOpt = findPatternsRec(editor, details.remainingPatterns, spot.container, spot.offset, block); - var results_1 = resultsOpt.getOr({ - matches: [], - position: spot - }); - var pos = results_1.position; - var start = findPatternStart(dom, pattern, pos.container, pos.offset, block, resultsOpt.isNone()); - return start.map(function (startRng) { - var startPathRng = generatePathRangeFromRange(root, startRng); - return { - matches: results_1.matches.concat([{ - pattern: pattern, - startRng: startPathRng, - endRng: endPathRng - }]), - position: point(startRng.startContainer, startRng.startOffset) - }; - }); + var findPatternStart = function (dom, pattern, node, offset, block, requireGap) { + if (requireGap === void 0) { + requireGap = false; + } + if (pattern.start.length === 0 && !requireGap) { + var rng = dom.createRng(); + rng.setStart(node, offset); + rng.setEnd(node, offset); + return Optional.some(rng); + } + return textBefore(node, offset, block).bind(function (spot) { + var start = findPatternStartFromSpot(dom, pattern, block, spot); + return start.bind(function (startRange) { + if (requireGap) { + if (startRange.endContainer === spot.container && startRange.endOffset === spot.offset) { + return Optional.none(); + } else if (spot.offset === 0 && startRange.endContainer.textContent.length === startRange.endOffset) { + return Optional.none(); } + } + return Optional.some(startRange); }); + }); + }; + var findPattern$1 = function (editor, block, details) { + var dom = editor.dom; + var root = dom.getRoot(); + var pattern = details.pattern; + var endNode = details.position.container; + var endOffset = details.position.offset; + return scanLeft(endNode, endOffset - details.pattern.end.length, block).bind(function (spot) { + var endPathRng = generatePathRange(root, spot.container, spot.offset, endNode, endOffset); + if (isReplacementPattern(pattern)) { + return Optional.some({ + matches: [{ + pattern: pattern, + startRng: endPathRng, + endRng: endPathRng + }], + position: spot + }); + } else { + var resultsOpt = findPatternsRec(editor, details.remainingPatterns, spot.container, spot.offset, block); + var results_1 = resultsOpt.getOr({ + matches: [], + position: spot + }); + var pos = results_1.position; + var start = findPatternStart(dom, pattern, pos.container, pos.offset, block, resultsOpt.isNone()); + return start.map(function (startRng) { + var startPathRng = generatePathRangeFromRange(root, startRng); + return { + matches: results_1.matches.concat([{ + pattern: pattern, + startRng: startPathRng, + endRng: endPathRng + }]), + position: point(startRng.startContainer, startRng.startOffset) + }; + }); + } + }); }; var findPatternsRec = function (editor, patterns, node, offset, block) { - var dom = editor.dom; - return textBefore(node, offset, dom.getRoot()).bind(function (endSpot) { - var rng = dom.createRng(); - rng.setStart(block, 0); - rng.setEnd(node, offset); - var text = rng.toString(); - for (var i = 0; i < patterns.length; i++) { - var pattern = patterns[i]; - if (!endsWith(text, pattern.end)) { - continue; - } - var patternsWithoutCurrent = patterns.slice(); - patternsWithoutCurrent.splice(i, 1); - var result = findPattern$1(editor, block, { - pattern: pattern, - remainingPatterns: patternsWithoutCurrent, - position: endSpot - }); - if (result.isSome()) { - return result; - } - } - return Optional.none(); - }); + var dom = editor.dom; + return textBefore(node, offset, dom.getRoot()).bind(function (endSpot) { + var rng = dom.createRng(); + rng.setStart(block, 0); + rng.setEnd(node, offset); + var text = rng.toString(); + for (var i = 0; i < patterns.length; i++) { + var pattern = patterns[i]; + if (!endsWith(text, pattern.end)) { + continue; + } + var patternsWithoutCurrent = patterns.slice(); + patternsWithoutCurrent.splice(i, 1); + var result = findPattern$1(editor, block, { + pattern: pattern, + remainingPatterns: patternsWithoutCurrent, + position: endSpot + }); + if (result.isSome()) { + return result; + } + } + return Optional.none(); + }); }; var applyPattern$1 = function (editor, pattern, patternRange) { - editor.selection.setRng(patternRange); - if (pattern.type === 'inline-format') { - each(pattern.format, function (format) { - editor.formatter.apply(format); - }); - } else { - editor.execCommand(pattern.cmd, false, pattern.value); - } + editor.selection.setRng(patternRange); + if (pattern.type === 'inline-format') { + each(pattern.format, function (format) { + editor.formatter.apply(format); + }); + } else { + editor.execCommand(pattern.cmd, false, pattern.value); + } }; var applyReplacementPattern = function (editor, pattern, marker, isRoot) { - var markerRange = rangeFromMarker(editor.dom, marker); - deleteRng(editor.dom, markerRange, isRoot); - applyPattern$1(editor, pattern, markerRange); + var markerRange = rangeFromMarker(editor.dom, marker); + deleteRng(editor.dom, markerRange, isRoot); + applyPattern$1(editor, pattern, markerRange); }; var applyPatternWithContent = function (editor, pattern, startMarker, endMarker, isRoot) { - var dom = editor.dom; - var markerEndRange = rangeFromMarker(dom, endMarker); - var markerStartRange = rangeFromMarker(dom, startMarker); - deleteRng(dom, markerStartRange, isRoot); - deleteRng(dom, markerEndRange, isRoot); - var patternMarker = { - prefix: startMarker.prefix, - start: startMarker.end, - end: endMarker.start - }; - var patternRange = rangeFromMarker(dom, patternMarker); - applyPattern$1(editor, pattern, patternRange); + var dom = editor.dom; + var markerEndRange = rangeFromMarker(dom, endMarker); + var markerStartRange = rangeFromMarker(dom, startMarker); + deleteRng(dom, markerStartRange, isRoot); + deleteRng(dom, markerEndRange, isRoot); + var patternMarker = { + prefix: startMarker.prefix, + start: startMarker.end, + end: endMarker.start + }; + var patternRange = rangeFromMarker(dom, patternMarker); + applyPattern$1(editor, pattern, patternRange); }; var addMarkers = function (dom, matches) { - var markerPrefix = generate$1('mce_textpattern'); - var matchesWithEnds = foldr(matches, function (acc, match) { - var endMarker = createMarker(dom, markerPrefix + ('_end' + acc.length), match.endRng); - return acc.concat([__assign(__assign({}, match), {endMarker: endMarker})]); - }, []); - return foldr(matchesWithEnds, function (acc, match) { - var idx = matchesWithEnds.length - acc.length - 1; - var startMarker = isReplacementPattern(match.pattern) ? match.endMarker : createMarker(dom, markerPrefix + ('_start' + idx), match.startRng); - return acc.concat([__assign(__assign({}, match), {startMarker: startMarker})]); - }, []); + var markerPrefix = generate$1('mce_textpattern'); + var matchesWithEnds = foldr(matches, function (acc, match) { + var endMarker = createMarker(dom, markerPrefix + ('_end' + acc.length), match.endRng); + return acc.concat([__assign(__assign({}, match), { endMarker: endMarker })]); + }, []); + return foldr(matchesWithEnds, function (acc, match) { + var idx = matchesWithEnds.length - acc.length - 1; + var startMarker = isReplacementPattern(match.pattern) ? match.endMarker : createMarker(dom, markerPrefix + ('_start' + idx), match.startRng); + return acc.concat([__assign(__assign({}, match), { startMarker: startMarker })]); + }, []); }; var findPatterns$1 = function (editor, patterns, space) { - var rng = editor.selection.getRng(); - if (rng.collapsed === false) { - return []; - } - return getParentBlock(editor, rng).bind(function (block) { - var offset = rng.startOffset - (space ? 1 : 0); - return findPatternsRec(editor, patterns, rng.startContainer, offset, block); - }).fold(function () { - return []; - }, function (result) { - return result.matches; - }); + var rng = editor.selection.getRng(); + if (rng.collapsed === false) { + return []; + } + return getParentBlock(editor, rng).bind(function (block) { + var offset = rng.startOffset - (space ? 1 : 0); + return findPatternsRec(editor, patterns, rng.startContainer, offset, block); + }).fold(function () { + return []; + }, function (result) { + return result.matches; + }); }; var applyMatches$1 = function (editor, matches) { - if (matches.length === 0) { - return; + if (matches.length === 0) { + return; + } + var dom = editor.dom; + var bookmark = editor.selection.getBookmark(); + var matchesWithMarkers = addMarkers(dom, matches); + each(matchesWithMarkers, function (match) { + var block = dom.getParent(match.startMarker.start, dom.isBlock); + var isRoot = function (node) { + return node === block; + }; + if (isReplacementPattern(match.pattern)) { + applyReplacementPattern(editor, match.pattern, match.endMarker, isRoot); + } else { + applyPatternWithContent(editor, match.pattern, match.startMarker, match.endMarker, isRoot); } - var dom = editor.dom; - var bookmark = editor.selection.getBookmark(); - var matchesWithMarkers = addMarkers(dom, matches); - each(matchesWithMarkers, function (match) { - var block = dom.getParent(match.startMarker.start, dom.isBlock); - var isRoot = function (node) { - return node === block; - }; - if (isReplacementPattern(match.pattern)) { - applyReplacementPattern(editor, match.pattern, match.endMarker, isRoot); - } else { - applyPatternWithContent(editor, match.pattern, match.startMarker, match.endMarker, isRoot); - } - removeMarker(dom, match.endMarker, isRoot); - removeMarker(dom, match.startMarker, isRoot); - }); - editor.selection.moveToBookmark(bookmark); + removeMarker(dom, match.endMarker, isRoot); + removeMarker(dom, match.startMarker, isRoot); + }); + editor.selection.moveToBookmark(bookmark); }; var handleEnter = function (editor, patternSet) { - if (!editor.selection.isCollapsed()) { - return false; - } - var inlineMatches = findPatterns$1(editor, patternSet.inlinePatterns, false); - var blockMatches = findPatterns(editor, patternSet.blockPatterns); - if (blockMatches.length > 0 || inlineMatches.length > 0) { - editor.undoManager.add(); - editor.undoManager.extra(function () { - editor.execCommand('mceInsertNewLine'); - }, function () { - editor.insertContent(zeroWidth); - applyMatches$1(editor, inlineMatches); - applyMatches(editor, blockMatches); - var range = editor.selection.getRng(); - var spot = textBefore(range.startContainer, range.startOffset, editor.dom.getRoot()); - editor.execCommand('mceInsertNewLine'); - spot.each(function (s) { - var node = s.container; - if (node.data.charAt(s.offset - 1) === zeroWidth) { - node.deleteData(s.offset - 1, 1); - cleanEmptyNodes(editor.dom, node.parentNode, function (e) { - return e === editor.dom.getRoot(); - }); - } - }); - }); - return true; - } + if (!editor.selection.isCollapsed()) { return false; + } + var inlineMatches = findPatterns$1(editor, patternSet.inlinePatterns, false); + var blockMatches = findPatterns(editor, patternSet.blockPatterns); + if (blockMatches.length > 0 || inlineMatches.length > 0) { + editor.undoManager.add(); + editor.undoManager.extra(function () { + editor.execCommand('mceInsertNewLine'); + }, function () { + editor.insertContent(zeroWidth); + applyMatches$1(editor, inlineMatches); + applyMatches(editor, blockMatches); + var range = editor.selection.getRng(); + var spot = textBefore(range.startContainer, range.startOffset, editor.dom.getRoot()); + editor.execCommand('mceInsertNewLine'); + spot.each(function (s) { + var node = s.container; + if (node.data.charAt(s.offset - 1) === zeroWidth) { + node.deleteData(s.offset - 1, 1); + cleanEmptyNodes(editor.dom, node.parentNode, function (e) { + return e === editor.dom.getRoot(); + }); + } + }); + }); + return true; + } + return false; }; var handleInlineKey = function (editor, patternSet) { - var inlineMatches = findPatterns$1(editor, patternSet.inlinePatterns, true); - if (inlineMatches.length > 0) { - editor.undoManager.transact(function () { - applyMatches$1(editor, inlineMatches); - }); - } + var inlineMatches = findPatterns$1(editor, patternSet.inlinePatterns, true); + if (inlineMatches.length > 0) { + editor.undoManager.transact(function () { + applyMatches$1(editor, inlineMatches); + }); + } }; var checkKeyEvent = function (codes, event, predicate) { - for (var i = 0; i < codes.length; i++) { - if (predicate(codes[i], event)) { - return true; - } + for (var i = 0; i < codes.length; i++) { + if (predicate(codes[i], event)) { + return true; } + } }; var checkKeyCode = function (codes, event) { - return checkKeyEvent(codes, event, function (code, event) { - return code === event.keyCode && global$2.modifierPressed(event) === false; - }); + return checkKeyEvent(codes, event, function (code, event) { + return code === event.keyCode && global$2.modifierPressed(event) === false; + }); }; var checkCharCode = function (chars, event) { - return checkKeyEvent(chars, event, function (chr, event) { - return chr.charCodeAt(0) === event.charCode; - }); + return checkKeyEvent(chars, event, function (chr, event) { + return chr.charCodeAt(0) === event.charCode; + }); }; var setup = function (editor, patternsState) { - var charCodes = [ - ',', - '.', - ';', - ':', - '!', - '?' - ]; - var keyCodes = [32]; - editor.on('keydown', function (e) { - if (e.keyCode === 13 && !global$2.modifierPressed(e)) { - if (handleEnter(editor, patternsState.get())) { - e.preventDefault(); - } - } - }, true); - editor.on('keyup', function (e) { - if (checkKeyCode(keyCodes, e)) { - handleInlineKey(editor, patternsState.get()); - } - }); - editor.on('keypress', function (e) { - if (checkCharCode(charCodes, e)) { - global$1.setEditorTimeout(editor, function () { - handleInlineKey(editor, patternsState.get()); - }); - } - }); + var charCodes = [ + ',', + '.', + ';', + ':', + '!', + '?' + ]; + var keyCodes = [32]; + editor.on('keydown', function (e) { + if (e.keyCode === 13 && !global$2.modifierPressed(e)) { + if (handleEnter(editor, patternsState.get())) { + e.preventDefault(); + } + } + }, true); + editor.on('keyup', function (e) { + if (checkKeyCode(keyCodes, e)) { + handleInlineKey(editor, patternsState.get()); + } + }); + editor.on('keypress', function (e) { + if (checkCharCode(charCodes, e)) { + global$1.setEditorTimeout(editor, function () { + handleInlineKey(editor, patternsState.get()); + }); + } + }); }; - function Plugin() { - global.add('textpattern', function (editor) { - var patternsState = Cell(getPatternSet(editor)); - setup(editor, patternsState); - return get$1(patternsState); - }); + function Plugin () { + global.add('textpattern', function (editor) { + var patternsState = Cell(getPatternSet(editor)); + setup(editor, patternsState); + return get$1(patternsState); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/toc/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/toc/plugin.js index 893dcfdf..e206cd38 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/toc/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/toc/plugin.js @@ -18,217 +18,217 @@ var global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var getTocClass = function (editor) { - return editor.getParam('toc_class', 'mce-toc'); + return editor.getParam('toc_class', 'mce-toc'); }; var getTocHeader = function (editor) { - var tagName = editor.getParam('toc_header', 'h2'); - return /^h[1-6]$/.test(tagName) ? tagName : 'h2'; + var tagName = editor.getParam('toc_header', 'h2'); + return /^h[1-6]$/.test(tagName) ? tagName : 'h2'; }; var getTocDepth = function (editor) { - var depth = parseInt(editor.getParam('toc_depth', '3'), 10); - return depth >= 1 && depth <= 9 ? depth : 3; + var depth = parseInt(editor.getParam('toc_depth', '3'), 10); + return depth >= 1 && depth <= 9 ? depth : 3; }; var create = function (prefix) { - var counter = 0; - return function () { - var guid = new Date().getTime().toString(32); - return prefix + guid + (counter++).toString(32); - }; + var counter = 0; + return function () { + var guid = new Date().getTime().toString(32); + return prefix + guid + (counter++).toString(32); + }; }; var tocId = create('mcetoc_'); var generateSelector = function (depth) { - var i; - var selector = []; - for (i = 1; i <= depth; i++) { - selector.push('h' + i); - } - return selector.join(','); + var i; + var selector = []; + for (i = 1; i <= depth; i++) { + selector.push('h' + i); + } + return selector.join(','); }; var hasHeaders = function (editor) { - return readHeaders(editor).length > 0; + return readHeaders(editor).length > 0; }; var readHeaders = function (editor) { - var tocClass = getTocClass(editor); - var headerTag = getTocHeader(editor); - var selector = generateSelector(getTocDepth(editor)); - var headers = editor.$(selector); - if (headers.length && /^h[1-9]$/i.test(headerTag)) { - headers = headers.filter(function (i, el) { - return !editor.dom.hasClass(el.parentNode, tocClass); - }); - } - return global$3.map(headers, function (h) { - var id = h.id; - return { - id: id ? id : tocId(), - level: parseInt(h.nodeName.replace(/^H/i, ''), 10), - title: editor.$.text(h), - element: h - }; + var tocClass = getTocClass(editor); + var headerTag = getTocHeader(editor); + var selector = generateSelector(getTocDepth(editor)); + var headers = editor.$(selector); + if (headers.length && /^h[1-9]$/i.test(headerTag)) { + headers = headers.filter(function (i, el) { + return !editor.dom.hasClass(el.parentNode, tocClass); }); + } + return global$3.map(headers, function (h) { + var id = h.id; + return { + id: id ? id : tocId(), + level: parseInt(h.nodeName.replace(/^H/i, ''), 10), + title: editor.$.text(h), + element: h + }; + }); }; var getMinLevel = function (headers) { - var i, minLevel = 9; - for (i = 0; i < headers.length; i++) { - if (headers[i].level < minLevel) { - minLevel = headers[i].level; - } - if (minLevel === 1) { - return minLevel; - } + var i, minLevel = 9; + for (i = 0; i < headers.length; i++) { + if (headers[i].level < minLevel) { + minLevel = headers[i].level; + } + if (minLevel === 1) { + return minLevel; } - return minLevel; + } + return minLevel; }; var generateTitle = function (tag, title) { - var openTag = '<' + tag + ' contenteditable="true">'; - var closeTag = ''; - return openTag + global$1.DOM.encode(title) + closeTag; + var openTag = '<' + tag + ' contenteditable="true">'; + var closeTag = ''; + return openTag + global$1.DOM.encode(title) + closeTag; }; var generateTocHtml = function (editor) { - var html = generateTocContentHtml(editor); - return '
              ' + html + '
              '; + var html = generateTocContentHtml(editor); + return '
              ' + html + '
              '; }; var generateTocContentHtml = function (editor) { - var html = ''; - var headers = readHeaders(editor); - var prevLevel = getMinLevel(headers) - 1; - var i, ii, h, nextLevel; - if (!headers.length) { - return ''; + var html = ''; + var headers = readHeaders(editor); + var prevLevel = getMinLevel(headers) - 1; + var i, ii, h, nextLevel; + if (!headers.length) { + return ''; + } + html += generateTitle(getTocHeader(editor), global$2.translate('Table of Contents')); + for (i = 0; i < headers.length; i++) { + h = headers[i]; + h.element.id = h.id; + nextLevel = headers[i + 1] && headers[i + 1].level; + if (prevLevel === h.level) { + html += '
            • '; + } else { + for (ii = prevLevel; ii < h.level; ii++) { + html += '
              • '; + } } - html += generateTitle(getTocHeader(editor), global$2.translate('Table of Contents')); - for (i = 0; i < headers.length; i++) { - h = headers[i]; - h.element.id = h.id; - nextLevel = headers[i + 1] && headers[i + 1].level; - if (prevLevel === h.level) { - html += '
              • '; - } else { - for (ii = prevLevel; ii < h.level; ii++) { - html += '
                • '; - } - } - html += '' + h.title + ''; - if (nextLevel === h.level || !nextLevel) { - html += '
                • '; - if (!nextLevel) { - html += '
                '; - } - } else { - for (ii = h.level; ii > nextLevel; ii--) { - html += '
            • '; - } - } - prevLevel = h.level; + html += '' + h.title + ''; + if (nextLevel === h.level || !nextLevel) { + html += '
            • '; + if (!nextLevel) { + html += ''; + } + } else { + for (ii = h.level; ii > nextLevel; ii--) { + html += '
            • '; + } } - return html; + prevLevel = h.level; + } + return html; }; var isEmptyOrOffscren = function (editor, nodes) { - return !nodes.length || editor.dom.getParents(nodes[0], '.mce-offscreen-selection').length > 0; + return !nodes.length || editor.dom.getParents(nodes[0], '.mce-offscreen-selection').length > 0; }; var insertToc = function (editor) { - var tocClass = getTocClass(editor); - var $tocElm = editor.$('.' + tocClass); - if (isEmptyOrOffscren(editor, $tocElm)) { - editor.insertContent(generateTocHtml(editor)); - } else { - updateToc(editor); - } + var tocClass = getTocClass(editor); + var $tocElm = editor.$('.' + tocClass); + if (isEmptyOrOffscren(editor, $tocElm)) { + editor.insertContent(generateTocHtml(editor)); + } else { + updateToc(editor); + } }; var updateToc = function (editor) { - var tocClass = getTocClass(editor); - var $tocElm = editor.$('.' + tocClass); - if ($tocElm.length) { - editor.undoManager.transact(function () { - $tocElm.html(generateTocContentHtml(editor)); - }); - } + var tocClass = getTocClass(editor); + var $tocElm = editor.$('.' + tocClass); + if ($tocElm.length) { + editor.undoManager.transact(function () { + $tocElm.html(generateTocContentHtml(editor)); + }); + } }; var register = function (editor) { - editor.addCommand('mceInsertToc', function () { - insertToc(editor); - }); - editor.addCommand('mceUpdateToc', function () { - updateToc(editor); - }); + editor.addCommand('mceInsertToc', function () { + insertToc(editor); + }); + editor.addCommand('mceUpdateToc', function () { + updateToc(editor); + }); }; var setup = function (editor) { - var $ = editor.$, tocClass = getTocClass(editor); - editor.on('PreProcess', function (e) { - var $tocElm = $('.' + tocClass, e.node); - if ($tocElm.length) { - $tocElm.removeAttr('contentEditable'); - $tocElm.find('[contenteditable]').removeAttr('contentEditable'); - } - }); - editor.on('SetContent', function () { - var $tocElm = $('.' + tocClass); - if ($tocElm.length) { - $tocElm.attr('contentEditable', false); - $tocElm.children(':first-child').attr('contentEditable', true); - } - }); + var $ = editor.$, tocClass = getTocClass(editor); + editor.on('PreProcess', function (e) { + var $tocElm = $('.' + tocClass, e.node); + if ($tocElm.length) { + $tocElm.removeAttr('contentEditable'); + $tocElm.find('[contenteditable]').removeAttr('contentEditable'); + } + }); + editor.on('SetContent', function () { + var $tocElm = $('.' + tocClass); + if ($tocElm.length) { + $tocElm.attr('contentEditable', false); + $tocElm.children(':first-child').attr('contentEditable', true); + } + }); }; var toggleState = function (editor) { - return function (api) { - var toggleDisabledState = function () { - return api.setDisabled(editor.mode.isReadOnly() || !hasHeaders(editor)); - }; - toggleDisabledState(); - editor.on('LoadContent SetContent change', toggleDisabledState); - return function () { - return editor.on('LoadContent SetContent change', toggleDisabledState); - }; + return function (api) { + var toggleDisabledState = function () { + return api.setDisabled(editor.mode.isReadOnly() || !hasHeaders(editor)); + }; + toggleDisabledState(); + editor.on('LoadContent SetContent change', toggleDisabledState); + return function () { + return editor.on('LoadContent SetContent change', toggleDisabledState); }; + }; }; var isToc = function (editor) { - return function (elm) { - return elm && editor.dom.is(elm, '.' + getTocClass(editor)) && editor.getBody().contains(elm); - }; + return function (elm) { + return elm && editor.dom.is(elm, '.' + getTocClass(editor)) && editor.getBody().contains(elm); + }; }; var register$1 = function (editor) { - editor.ui.registry.addButton('toc', { - icon: 'toc', - tooltip: 'Table of contents', - onAction: function () { - return editor.execCommand('mceInsertToc'); - }, - onSetup: toggleState(editor) - }); - editor.ui.registry.addButton('tocupdate', { - icon: 'reload', - tooltip: 'Update', - onAction: function () { - return editor.execCommand('mceUpdateToc'); - } - }); - editor.ui.registry.addMenuItem('toc', { - icon: 'toc', - text: 'Table of contents', - onAction: function () { - return editor.execCommand('mceInsertToc'); - }, - onSetup: toggleState(editor) - }); - editor.ui.registry.addContextToolbar('toc', { - items: 'tocupdate', - predicate: isToc(editor), - scope: 'node', - position: 'node' - }); + editor.ui.registry.addButton('toc', { + icon: 'toc', + tooltip: 'Table of contents', + onAction: function () { + return editor.execCommand('mceInsertToc'); + }, + onSetup: toggleState(editor) + }); + editor.ui.registry.addButton('tocupdate', { + icon: 'reload', + tooltip: 'Update', + onAction: function () { + return editor.execCommand('mceUpdateToc'); + } + }); + editor.ui.registry.addMenuItem('toc', { + icon: 'toc', + text: 'Table of contents', + onAction: function () { + return editor.execCommand('mceInsertToc'); + }, + onSetup: toggleState(editor) + }); + editor.ui.registry.addContextToolbar('toc', { + items: 'tocupdate', + predicate: isToc(editor), + scope: 'node', + position: 'node' + }); }; - function Plugin() { - global.add('toc', function (editor) { - register(editor); - register$1(editor); - setup(editor); - }); + function Plugin () { + global.add('toc', function (editor) { + register(editor); + register$1(editor); + setup(editor); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/visualblocks/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/visualblocks/plugin.js index 591d69f0..acd2a5e4 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/visualblocks/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/visualblocks/plugin.js @@ -10,93 +10,93 @@ 'use strict'; var Cell = function (initial) { - var value = initial; - var get = function () { - return value; - }; - var set = function (v) { - value = v; - }; - return { - get: get, - set: set - }; + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; }; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var fireVisualBlocks = function (editor, state) { - editor.fire('VisualBlocks', {state: state}); + editor.fire('VisualBlocks', { state: state }); }; var toggleVisualBlocks = function (editor, pluginUrl, enabledState) { - var dom = editor.dom; - dom.toggleClass(editor.getBody(), 'mce-visualblocks'); - enabledState.set(!enabledState.get()); - fireVisualBlocks(editor, enabledState.get()); + var dom = editor.dom; + dom.toggleClass(editor.getBody(), 'mce-visualblocks'); + enabledState.set(!enabledState.get()); + fireVisualBlocks(editor, enabledState.get()); }; var register = function (editor, pluginUrl, enabledState) { - editor.addCommand('mceVisualBlocks', function () { - toggleVisualBlocks(editor, pluginUrl, enabledState); - }); + editor.addCommand('mceVisualBlocks', function () { + toggleVisualBlocks(editor, pluginUrl, enabledState); + }); }; var isEnabledByDefault = function (editor) { - return editor.getParam('visualblocks_default_state', false, 'boolean'); + return editor.getParam('visualblocks_default_state', false, 'boolean'); }; var setup = function (editor, pluginUrl, enabledState) { - editor.on('PreviewFormats AfterPreviewFormats', function (e) { - if (enabledState.get()) { - editor.dom.toggleClass(editor.getBody(), 'mce-visualblocks', e.type === 'afterpreviewformats'); - } - }); - editor.on('init', function () { - if (isEnabledByDefault(editor)) { - toggleVisualBlocks(editor, pluginUrl, enabledState); - } - }); + editor.on('PreviewFormats AfterPreviewFormats', function (e) { + if (enabledState.get()) { + editor.dom.toggleClass(editor.getBody(), 'mce-visualblocks', e.type === 'afterpreviewformats'); + } + }); + editor.on('init', function () { + if (isEnabledByDefault(editor)) { + toggleVisualBlocks(editor, pluginUrl, enabledState); + } + }); }; var toggleActiveState = function (editor, enabledState) { - return function (api) { - api.setActive(enabledState.get()); - var editorEventCallback = function (e) { - return api.setActive(e.state); - }; - editor.on('VisualBlocks', editorEventCallback); - return function () { - return editor.off('VisualBlocks', editorEventCallback); - }; + return function (api) { + api.setActive(enabledState.get()); + var editorEventCallback = function (e) { + return api.setActive(e.state); + }; + editor.on('VisualBlocks', editorEventCallback); + return function () { + return editor.off('VisualBlocks', editorEventCallback); }; + }; }; var register$1 = function (editor, enabledState) { - editor.ui.registry.addToggleButton('visualblocks', { - icon: 'visualblocks', - tooltip: 'Show blocks', - onAction: function () { - return editor.execCommand('mceVisualBlocks'); - }, - onSetup: toggleActiveState(editor, enabledState) - }); - editor.ui.registry.addToggleMenuItem('visualblocks', { - text: 'Show blocks', - icon: 'visualblocks', - onAction: function () { - return editor.execCommand('mceVisualBlocks'); - }, - onSetup: toggleActiveState(editor, enabledState) - }); + editor.ui.registry.addToggleButton('visualblocks', { + icon: 'visualblocks', + tooltip: 'Show blocks', + onAction: function () { + return editor.execCommand('mceVisualBlocks'); + }, + onSetup: toggleActiveState(editor, enabledState) + }); + editor.ui.registry.addToggleMenuItem('visualblocks', { + text: 'Show blocks', + icon: 'visualblocks', + onAction: function () { + return editor.execCommand('mceVisualBlocks'); + }, + onSetup: toggleActiveState(editor, enabledState) + }); }; - function Plugin() { - global.add('visualblocks', function (editor, pluginUrl) { - var enabledState = Cell(false); - register(editor, pluginUrl, enabledState); - register$1(editor, enabledState); - setup(editor, pluginUrl, enabledState); - }); + function Plugin () { + global.add('visualblocks', function (editor, pluginUrl) { + var enabledState = Cell(false); + register(editor, pluginUrl, enabledState); + register$1(editor, enabledState); + setup(editor, pluginUrl, enabledState); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/visualchars/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/visualchars/plugin.js index 4e8eb8d6..77c50fa1 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/visualchars/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/visualchars/plugin.js @@ -10,208 +10,208 @@ 'use strict'; var Cell = function (initial) { - var value = initial; - var get = function () { - return value; - }; - var set = function (v) { - value = v; - }; - return { - get: get, - set: set - }; + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; }; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var get = function (toggleState) { - var isEnabled = function () { - return toggleState.get(); - }; - return {isEnabled: isEnabled}; + var isEnabled = function () { + return toggleState.get(); + }; + return { isEnabled: isEnabled }; }; var fireVisualChars = function (editor, state) { - return editor.fire('VisualChars', {state: state}); + return editor.fire('VisualChars', { state: state }); }; var noop = function () { }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; var never = constant(false); var always = constant(true); var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var typeOf = function (x) { - var t = typeof x; - if (x === null) { - return 'null'; - } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { - return 'array'; - } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { - return 'string'; - } else { - return t; - } + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } }; var isType = function (type) { - return function (value) { - return typeOf(value) === type; - }; + return function (value) { + return typeOf(value) === type; + }; }; var isSimpleType = function (type) { - return function (value) { - return typeof value === type; - }; + return function (value) { + return typeof value === type; + }; }; var isString = isType('string'); var isBoolean = isSimpleType('boolean'); var isNumber = isSimpleType('number'); var map = function (xs, f) { - var len = xs.length; - var r = new Array(len); - for (var i = 0; i < len; i++) { - var x = xs[i]; - r[i] = f(x, i); - } - return r; + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; }; var each = function (xs, f) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - f(x, i); - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } }; var filter = function (xs, pred) { - var r = []; - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - r.push(x); - } + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); } - return r; + } + return r; }; var keys = Object.keys; var each$1 = function (obj, f) { - var props = keys(obj); - for (var k = 0, len = props.length; k < len; k++) { - var i = props[k]; - var x = obj[i]; - f(x, i); - } + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } }; var Global = typeof window !== 'undefined' ? window : Function('return this;')(); @@ -219,152 +219,152 @@ var TEXT = 3; var type = function (element) { - return element.dom.nodeType; + return element.dom.nodeType; }; var value = function (element) { - return element.dom.nodeValue; + return element.dom.nodeValue; }; var isType$1 = function (t) { - return function (element) { - return type(element) === t; - }; + return function (element) { + return type(element) === t; + }; }; var isText = isType$1(TEXT); var rawSet = function (dom, key, value) { - if (isString(value) || isBoolean(value) || isNumber(value)) { - dom.setAttribute(key, value + ''); - } else { - console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); - throw new Error('Attribute value was not simple'); - } + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); + throw new Error('Attribute value was not simple'); + } }; var set = function (element, key, value) { - rawSet(element.dom, key, value); + rawSet(element.dom, key, value); }; var get$1 = function (element, key) { - var v = element.dom.getAttribute(key); - return v === null ? undefined : v; + var v = element.dom.getAttribute(key); + return v === null ? undefined : v; }; var remove = function (element, key) { - element.dom.removeAttribute(key); + element.dom.removeAttribute(key); }; var read = function (element, attr) { - var value = get$1(element, attr); - return value === undefined || value === '' ? [] : value.split(' '); + var value = get$1(element, attr); + return value === undefined || value === '' ? [] : value.split(' '); }; var add = function (element, attr, id) { - var old = read(element, attr); - var nu = old.concat([id]); - set(element, attr, nu.join(' ')); - return true; + var old = read(element, attr); + var nu = old.concat([id]); + set(element, attr, nu.join(' ')); + return true; }; var remove$1 = function (element, attr, id) { - var nu = filter(read(element, attr), function (v) { - return v !== id; - }); - if (nu.length > 0) { - set(element, attr, nu.join(' ')); - } else { - remove(element, attr); - } - return false; + var nu = filter(read(element, attr), function (v) { + return v !== id; + }); + if (nu.length > 0) { + set(element, attr, nu.join(' ')); + } else { + remove(element, attr); + } + return false; }; var supports = function (element) { - return element.dom.classList !== undefined; + return element.dom.classList !== undefined; }; var get$2 = function (element) { - return read(element, 'class'); + return read(element, 'class'); }; var add$1 = function (element, clazz) { - return add(element, 'class', clazz); + return add(element, 'class', clazz); }; var remove$2 = function (element, clazz) { - return remove$1(element, 'class', clazz); + return remove$1(element, 'class', clazz); }; var add$2 = function (element, clazz) { - if (supports(element)) { - element.dom.classList.add(clazz); - } else { - add$1(element, clazz); - } + if (supports(element)) { + element.dom.classList.add(clazz); + } else { + add$1(element, clazz); + } }; var cleanClass = function (element) { - var classList = supports(element) ? element.dom.classList : get$2(element); - if (classList.length === 0) { - remove(element, 'class'); - } + var classList = supports(element) ? element.dom.classList : get$2(element); + if (classList.length === 0) { + remove(element, 'class'); + } }; var remove$3 = function (element, clazz) { - if (supports(element)) { - var classList = element.dom.classList; - classList.remove(clazz); - } else { - remove$2(element, clazz); - } - cleanClass(element); + if (supports(element)) { + var classList = element.dom.classList; + classList.remove(clazz); + } else { + remove$2(element, clazz); + } + cleanClass(element); }; var fromHtml = function (html, scope) { - var doc = scope || document; - var div = doc.createElement('div'); - div.innerHTML = html; - if (!div.hasChildNodes() || div.childNodes.length > 1) { - console.error('HTML does not have a single root node', html); - throw new Error('HTML must have a single root node'); - } - return fromDom(div.childNodes[0]); + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); }; var fromTag = function (tag, scope) { - var doc = scope || document; - var node = doc.createElement(tag); - return fromDom(node); + var doc = scope || document; + var node = doc.createElement(tag); + return fromDom(node); }; var fromText = function (text, scope) { - var doc = scope || document; - var node = doc.createTextNode(text); - return fromDom(node); + var doc = scope || document; + var node = doc.createTextNode(text); + return fromDom(node); }; var fromDom = function (node) { - if (node === null || node === undefined) { - throw new Error('Node cannot be null or undefined'); - } - return {dom: node}; + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: node }; }; var fromPoint = function (docElm, x, y) { - return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); + return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); }; var SugarElement = { - fromHtml: fromHtml, - fromTag: fromTag, - fromText: fromText, - fromDom: fromDom, - fromPoint: fromPoint + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint }; var charMap = { - '\xA0': 'nbsp', - '\xAD': 'shy' + '\xA0': 'nbsp', + '\xAD': 'shy' }; var charMapToRegExp = function (charMap, global) { - var regExp = ''; - each$1(charMap, function (_value, key) { - regExp += key; - }); - return new RegExp('[' + regExp + ']', global ? 'g' : ''); + var regExp = ''; + each$1(charMap, function (_value, key) { + regExp += key; + }); + return new RegExp('[' + regExp + ']', global ? 'g' : ''); }; var charMapToSelector = function (charMap) { - var selector = ''; - each$1(charMap, function (value) { - if (selector) { - selector += ','; - } - selector += 'span.mce-' + value; - }); - return selector; + var selector = ''; + each$1(charMap, function (value) { + if (selector) { + selector += ','; + } + selector += 'span.mce-' + value; + }); + return selector; }; var regExp = charMapToRegExp(charMap); var regExpGlobal = charMapToRegExp(charMap, true); @@ -372,168 +372,168 @@ var nbspClass = 'mce-nbsp'; var wrapCharWithSpan = function (value) { - return '' + value + ''; + return '' + value + ''; }; var isMatch = function (n) { - var value$1 = value(n); - return isText(n) && value$1 !== undefined && regExp.test(value$1); + var value$1 = value(n); + return isText(n) && value$1 !== undefined && regExp.test(value$1); }; var filterDescendants = function (scope, predicate) { - var result = []; - var dom = scope.dom; - var children = map(dom.childNodes, SugarElement.fromDom); - each(children, function (x) { - if (predicate(x)) { - result = result.concat([x]); - } - result = result.concat(filterDescendants(x, predicate)); - }); - return result; + var result = []; + var dom = scope.dom; + var children = map(dom.childNodes, SugarElement.fromDom); + each(children, function (x) { + if (predicate(x)) { + result = result.concat([x]); + } + result = result.concat(filterDescendants(x, predicate)); + }); + return result; }; var findParentElm = function (elm, rootElm) { - while (elm.parentNode) { - if (elm.parentNode === rootElm) { - return elm; - } - elm = elm.parentNode; + while (elm.parentNode) { + if (elm.parentNode === rootElm) { + return elm; } + elm = elm.parentNode; + } }; var replaceWithSpans = function (text) { - return text.replace(regExpGlobal, wrapCharWithSpan); + return text.replace(regExpGlobal, wrapCharWithSpan); }; var isWrappedNbsp = function (node) { - return node.nodeName.toLowerCase() === 'span' && node.classList.contains('mce-nbsp-wrap'); + return node.nodeName.toLowerCase() === 'span' && node.classList.contains('mce-nbsp-wrap'); }; var show = function (editor, rootElm) { - var nodeList = filterDescendants(SugarElement.fromDom(rootElm), isMatch); - each(nodeList, function (n) { - var parent = n.dom.parentNode; - if (isWrappedNbsp(parent)) { - add$2(SugarElement.fromDom(parent), nbspClass); - } else { - var withSpans = replaceWithSpans(editor.dom.encode(value(n))); - var div = editor.dom.create('div', null, withSpans); - var node = void 0; - while (node = div.lastChild) { - editor.dom.insertAfter(node, n.dom); - } - editor.dom.remove(n.dom); - } - }); + var nodeList = filterDescendants(SugarElement.fromDom(rootElm), isMatch); + each(nodeList, function (n) { + var parent = n.dom.parentNode; + if (isWrappedNbsp(parent)) { + add$2(SugarElement.fromDom(parent), nbspClass); + } else { + var withSpans = replaceWithSpans(editor.dom.encode(value(n))); + var div = editor.dom.create('div', null, withSpans); + var node = void 0; + while (node = div.lastChild) { + editor.dom.insertAfter(node, n.dom); + } + editor.dom.remove(n.dom); + } + }); }; var hide = function (editor, rootElm) { - var nodeList = editor.dom.select(selector, rootElm); - each(nodeList, function (node) { - if (isWrappedNbsp(node)) { - remove$3(SugarElement.fromDom(node), nbspClass); - } else { - editor.dom.remove(node, true); - } - }); + var nodeList = editor.dom.select(selector, rootElm); + each(nodeList, function (node) { + if (isWrappedNbsp(node)) { + remove$3(SugarElement.fromDom(node), nbspClass); + } else { + editor.dom.remove(node, true); + } + }); }; var toggle = function (editor) { - var body = editor.getBody(); - var bookmark = editor.selection.getBookmark(); - var parentNode = findParentElm(editor.selection.getNode(), body); - parentNode = parentNode !== undefined ? parentNode : body; - hide(editor, parentNode); - show(editor, parentNode); - editor.selection.moveToBookmark(bookmark); + var body = editor.getBody(); + var bookmark = editor.selection.getBookmark(); + var parentNode = findParentElm(editor.selection.getNode(), body); + parentNode = parentNode !== undefined ? parentNode : body; + hide(editor, parentNode); + show(editor, parentNode); + editor.selection.moveToBookmark(bookmark); }; var applyVisualChars = function (editor, toggleState) { - fireVisualChars(editor, toggleState.get()); - var body = editor.getBody(); - if (toggleState.get() === true) { - show(editor, body); - } else { - hide(editor, body); - } + fireVisualChars(editor, toggleState.get()); + var body = editor.getBody(); + if (toggleState.get() === true) { + show(editor, body); + } else { + hide(editor, body); + } }; var toggleVisualChars = function (editor, toggleState) { - toggleState.set(!toggleState.get()); - var bookmark = editor.selection.getBookmark(); - applyVisualChars(editor, toggleState); - editor.selection.moveToBookmark(bookmark); + toggleState.set(!toggleState.get()); + var bookmark = editor.selection.getBookmark(); + applyVisualChars(editor, toggleState); + editor.selection.moveToBookmark(bookmark); }; var register = function (editor, toggleState) { - editor.addCommand('mceVisualChars', function () { - toggleVisualChars(editor, toggleState); - }); + editor.addCommand('mceVisualChars', function () { + toggleVisualChars(editor, toggleState); + }); }; var isEnabledByDefault = function (editor) { - return editor.getParam('visualchars_default_state', false); + return editor.getParam('visualchars_default_state', false); }; var hasForcedRootBlock = function (editor) { - return editor.getParam('forced_root_block') !== false; + return editor.getParam('forced_root_block') !== false; }; var setup = function (editor, toggleState) { - editor.on('init', function () { - applyVisualChars(editor, toggleState); - }); + editor.on('init', function () { + applyVisualChars(editor, toggleState); + }); }; var global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay'); var setup$1 = function (editor, toggleState) { - var debouncedToggle = global$1.debounce(function () { - toggle(editor); - }, 300); - if (hasForcedRootBlock(editor)) { - editor.on('keydown', function (e) { - if (toggleState.get() === true) { - e.keyCode === 13 ? toggle(editor) : debouncedToggle(); - } - }); - } - editor.on('remove', debouncedToggle.stop); + var debouncedToggle = global$1.debounce(function () { + toggle(editor); + }, 300); + if (hasForcedRootBlock(editor)) { + editor.on('keydown', function (e) { + if (toggleState.get() === true) { + e.keyCode === 13 ? toggle(editor) : debouncedToggle(); + } + }); + } + editor.on('remove', debouncedToggle.stop); }; var toggleActiveState = function (editor, enabledStated) { - return function (api) { - api.setActive(enabledStated.get()); - var editorEventCallback = function (e) { - return api.setActive(e.state); - }; - editor.on('VisualChars', editorEventCallback); - return function () { - return editor.off('VisualChars', editorEventCallback); - }; + return function (api) { + api.setActive(enabledStated.get()); + var editorEventCallback = function (e) { + return api.setActive(e.state); + }; + editor.on('VisualChars', editorEventCallback); + return function () { + return editor.off('VisualChars', editorEventCallback); }; + }; }; var register$1 = function (editor, toggleState) { - editor.ui.registry.addToggleButton('visualchars', { - tooltip: 'Show invisible characters', - icon: 'visualchars', - onAction: function () { - return editor.execCommand('mceVisualChars'); - }, - onSetup: toggleActiveState(editor, toggleState) - }); - editor.ui.registry.addToggleMenuItem('visualchars', { - text: 'Show invisible characters', - icon: 'visualchars', - onAction: function () { - return editor.execCommand('mceVisualChars'); - }, - onSetup: toggleActiveState(editor, toggleState) - }); + editor.ui.registry.addToggleButton('visualchars', { + tooltip: 'Show invisible characters', + icon: 'visualchars', + onAction: function () { + return editor.execCommand('mceVisualChars'); + }, + onSetup: toggleActiveState(editor, toggleState) + }); + editor.ui.registry.addToggleMenuItem('visualchars', { + text: 'Show invisible characters', + icon: 'visualchars', + onAction: function () { + return editor.execCommand('mceVisualChars'); + }, + onSetup: toggleActiveState(editor, toggleState) + }); }; - function Plugin() { - global.add('visualchars', function (editor) { - var toggleState = Cell(isEnabledByDefault(editor)); - register(editor, toggleState); - register$1(editor, toggleState); - setup$1(editor, toggleState); - setup(editor, toggleState); - return get(toggleState); - }); + function Plugin () { + global.add('visualchars', function (editor) { + var toggleState = Cell(isEnabledByDefault(editor)); + register(editor, toggleState); + register$1(editor, toggleState); + setup$1(editor, toggleState); + setup(editor, toggleState); + return get(toggleState); + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/wordcount/plugin.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/wordcount/plugin.js index 1e82a3a6..5b9cf2f2 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/wordcount/plugin.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/plugins/wordcount/plugin.js @@ -12,83 +12,83 @@ var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var identity = function (x) { - return x; + return x; }; var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); }; var zeroWidth = '\uFEFF'; var removeZwsp = function (s) { - return s.replace(/\uFEFF/g, ''); + return s.replace(/\uFEFF/g, ''); }; var map = function (xs, f) { - var len = xs.length; - var r = new Array(len); - for (var i = 0; i < len; i++) { - var x = xs[i]; - r[i] = f(x, i); - } - return r; + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; }; var punctuationStr = '[!-#%-*,-\\/:;?@\\[-\\]_{}\xA1\xAB\xB7\xBB\xBF;\xB7\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1361-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u3008\u3009\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30\u2E31\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uff3f\uFF5B\uFF5D\uFF5F-\uFF65]'; var regExps = { - aletter: '[A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05F3\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bc0-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u24B6-\u24E9\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005\u303b\u303c\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790\ua791\ua7a0-\ua7a9\ua7fa-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uffa0-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]', - midnumlet: '[-\'\\.\u2018\u2019\u2024\uFE52\uFF07\uFF0E]', - midletter: '[:\xB7\xB7\u05F4\u2027\uFE13\uFE55\uFF1A]', - midnum: '[\xB1+*/,;;\u0589\u060C\u060D\u066C\u07F8\u2044\uFE10\uFE14\uFE50\uFE54\uFF0C\uFF1B]', - numeric: '[0-9\u0660-\u0669\u066B\u06f0-\u06f9\u07c0-\u07c9\u0966-\u096f\u09e6-\u09ef\u0a66-\u0a6f\u0ae6-\u0aef\u0b66-\u0b6f\u0be6-\u0bef\u0c66-\u0c6f\u0ce6-\u0cef\u0d66-\u0d6f\u0e50-\u0e59\u0ed0-\u0ed9\u0f20-\u0f29\u1040-\u1049\u1090-\u1099\u17e0-\u17e9\u1810-\u1819\u1946-\u194f\u19d0-\u19d9\u1a80-\u1a89\u1a90-\u1a99\u1b50-\u1b59\u1bb0-\u1bb9\u1c40-\u1c49\u1c50-\u1c59\ua620-\ua629\ua8d0-\ua8d9\ua900-\ua909\ua9d0-\ua9d9\uaa50-\uaa59\uabf0-\uabf9]', - cr: '\\r', - lf: '\\n', - newline: '[\x0B\f\x85\u2028\u2029]', - extend: '[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f\u109a-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b6-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u192b\u1930-\u193b\u19b0-\u19c0\u19c8\u19c9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f\u1b00-\u1b04\u1b34-\u1b44\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1baa\u1be6-\u1bf3\u1c24-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\uA672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe3-\uabea\uabec\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]', - format: '[\xAD\u0600-\u0603\u06DD\u070F\u17b4\u17b5\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\uFEFF\uFFF9-\uFFFB]', - katakana: '[\u3031-\u3035\u309B\u309C\u30A0-\u30fa\u30fc-\u30ff\u31f0-\u31ff\u32D0-\u32FE\u3300-\u3357\uff66-\uff9d]', - extendnumlet: '[=_\u203f\u2040\u2054\ufe33\ufe34\ufe4d-\ufe4f\uff3f\u2200-\u22FF<>]', - punctuation: punctuationStr + aletter: '[A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05F3\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bc0-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u24B6-\u24E9\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005\u303b\u303c\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790\ua791\ua7a0-\ua7a9\ua7fa-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uffa0-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]', + midnumlet: '[-\'\\.\u2018\u2019\u2024\uFE52\uFF07\uFF0E]', + midletter: '[:\xB7\xB7\u05F4\u2027\uFE13\uFE55\uFF1A]', + midnum: '[\xB1+*/,;;\u0589\u060C\u060D\u066C\u07F8\u2044\uFE10\uFE14\uFE50\uFE54\uFF0C\uFF1B]', + numeric: '[0-9\u0660-\u0669\u066B\u06f0-\u06f9\u07c0-\u07c9\u0966-\u096f\u09e6-\u09ef\u0a66-\u0a6f\u0ae6-\u0aef\u0b66-\u0b6f\u0be6-\u0bef\u0c66-\u0c6f\u0ce6-\u0cef\u0d66-\u0d6f\u0e50-\u0e59\u0ed0-\u0ed9\u0f20-\u0f29\u1040-\u1049\u1090-\u1099\u17e0-\u17e9\u1810-\u1819\u1946-\u194f\u19d0-\u19d9\u1a80-\u1a89\u1a90-\u1a99\u1b50-\u1b59\u1bb0-\u1bb9\u1c40-\u1c49\u1c50-\u1c59\ua620-\ua629\ua8d0-\ua8d9\ua900-\ua909\ua9d0-\ua9d9\uaa50-\uaa59\uabf0-\uabf9]', + cr: '\\r', + lf: '\\n', + newline: '[\x0B\f\x85\u2028\u2029]', + extend: '[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f\u109a-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b6-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u192b\u1930-\u193b\u19b0-\u19c0\u19c8\u19c9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f\u1b00-\u1b04\u1b34-\u1b44\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1baa\u1be6-\u1bf3\u1c24-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\uA672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe3-\uabea\uabec\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]', + format: '[\xAD\u0600-\u0603\u06DD\u070F\u17b4\u17b5\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\uFEFF\uFFF9-\uFFFB]', + katakana: '[\u3031-\u3035\u309B\u309C\u30A0-\u30fa\u30fc-\u30ff\u31f0-\u31ff\u32D0-\u32FE\u3300-\u3357\uff66-\uff9d]', + extendnumlet: '[=_\u203f\u2040\u2054\ufe33\ufe34\ufe4d-\ufe4f\uff3f\u2200-\u22FF<>]', + punctuation: punctuationStr }; var characterIndices = { - ALETTER: 0, - MIDNUMLET: 1, - MIDLETTER: 2, - MIDNUM: 3, - NUMERIC: 4, - CR: 5, - LF: 6, - NEWLINE: 7, - EXTEND: 8, - FORMAT: 9, - KATAKANA: 10, - EXTENDNUMLET: 11, - AT: 12, - OTHER: 13 + ALETTER: 0, + MIDNUMLET: 1, + MIDLETTER: 2, + MIDNUM: 3, + NUMERIC: 4, + CR: 5, + LF: 6, + NEWLINE: 7, + EXTEND: 8, + FORMAT: 9, + KATAKANA: 10, + EXTENDNUMLET: 11, + AT: 12, + OTHER: 13 }; var SETS = [ - new RegExp(regExps.aletter), - new RegExp(regExps.midnumlet), - new RegExp(regExps.midletter), - new RegExp(regExps.midnum), - new RegExp(regExps.numeric), - new RegExp(regExps.cr), - new RegExp(regExps.lf), - new RegExp(regExps.newline), - new RegExp(regExps.extend), - new RegExp(regExps.format), - new RegExp(regExps.katakana), - new RegExp(regExps.extendnumlet), - new RegExp('@') + new RegExp(regExps.aletter), + new RegExp(regExps.midnumlet), + new RegExp(regExps.midletter), + new RegExp(regExps.midnum), + new RegExp(regExps.numeric), + new RegExp(regExps.cr), + new RegExp(regExps.lf), + new RegExp(regExps.newline), + new RegExp(regExps.extend), + new RegExp(regExps.format), + new RegExp(regExps.katakana), + new RegExp(regExps.extendnumlet), + new RegExp('@') ]; var EMPTY_STRING = ''; var PUNCTUATION = new RegExp('^' + regExps.punctuation + '$'); @@ -97,150 +97,151 @@ var SETS$1 = SETS; var OTHER = characterIndices.OTHER; var getType = function (char) { - var type = OTHER; - var setsLength = SETS$1.length; - for (var j = 0; j < setsLength; ++j) { - var set = SETS$1[j]; - if (set && set.test(char)) { - type = j; - break; - } + var type = OTHER; + var setsLength = SETS$1.length; + for (var j = 0; j < setsLength; ++j) { + var set = SETS$1[j]; + if (set && set.test(char)) { + type = j; + break; } - return type; + } + return type; }; var memoize = function (func) { - var cache = {}; - return function (char) { - if (cache[char]) { - return cache[char]; - } else { - var result = func(char); - cache[char] = result; - return result; - } - }; + var cache = {}; + return function (char) { + if (cache[char]) { + return cache[char]; + } else { + var result = func(char); + cache[char] = result; + return result; + } + }; }; var classify = function (characters) { - var memoized = memoize(getType); - return map(characters, memoized); + var memoized = memoize(getType); + return map(characters, memoized); }; var isWordBoundary = function (map, index) { - var type = map[index]; - var nextType = map[index + 1]; - if (index < 0 || index > map.length - 1 && index !== 0) { - return false; - } - if (type === characterIndices.ALETTER && nextType === characterIndices.ALETTER) { - return false; - } - var nextNextType = map[index + 2]; - if (type === characterIndices.ALETTER && (nextType === characterIndices.MIDLETTER || nextType === characterIndices.MIDNUMLET || nextType === characterIndices.AT) && nextNextType === characterIndices.ALETTER) { - return false; - } - var prevType = map[index - 1]; - if ((type === characterIndices.MIDLETTER || type === characterIndices.MIDNUMLET || nextType === characterIndices.AT) && nextType === characterIndices.ALETTER && prevType === characterIndices.ALETTER) { - return false; - } - if ((type === characterIndices.NUMERIC || type === characterIndices.ALETTER) && (nextType === characterIndices.NUMERIC || nextType === characterIndices.ALETTER)) { - return false; - } - if ((type === characterIndices.MIDNUM || type === characterIndices.MIDNUMLET) && nextType === characterIndices.NUMERIC && prevType === characterIndices.NUMERIC) { - return false; - } - if (type === characterIndices.NUMERIC && (nextType === characterIndices.MIDNUM || nextType === characterIndices.MIDNUMLET) && nextNextType === characterIndices.NUMERIC) { - return false; - } - if (type === characterIndices.EXTEND || type === characterIndices.FORMAT || prevType === characterIndices.EXTEND || prevType === characterIndices.FORMAT || nextType === characterIndices.EXTEND || nextType === characterIndices.FORMAT) { - return false; - } - if (type === characterIndices.CR && nextType === characterIndices.LF) { - return false; - } - if (type === characterIndices.NEWLINE || type === characterIndices.CR || type === characterIndices.LF) { - return true; - } - if (nextType === characterIndices.NEWLINE || nextType === characterIndices.CR || nextType === characterIndices.LF) { - return true; - } - if (type === characterIndices.KATAKANA && nextType === characterIndices.KATAKANA) { - return false; - } - if (nextType === characterIndices.EXTENDNUMLET && (type === characterIndices.ALETTER || type === characterIndices.NUMERIC || type === characterIndices.KATAKANA || type === characterIndices.EXTENDNUMLET)) { - return false; - } - if (type === characterIndices.EXTENDNUMLET && (nextType === characterIndices.ALETTER || nextType === characterIndices.NUMERIC || nextType === characterIndices.KATAKANA)) { - return false; - } - if (type === characterIndices.AT) { - return false; - } + var type = map[index]; + var nextType = map[index + 1]; + if (index < 0 || index > map.length - 1 && index !== 0) { + return false; + } + if (type === characterIndices.ALETTER && nextType === characterIndices.ALETTER) { + return false; + } + var nextNextType = map[index + 2]; + if (type === characterIndices.ALETTER && (nextType === characterIndices.MIDLETTER || nextType === characterIndices.MIDNUMLET || nextType === characterIndices.AT) && nextNextType === characterIndices.ALETTER) { + return false; + } + var prevType = map[index - 1]; + if ((type === characterIndices.MIDLETTER || type === characterIndices.MIDNUMLET || nextType === characterIndices.AT) && nextType === characterIndices.ALETTER && prevType === characterIndices.ALETTER) { + return false; + } + if ((type === characterIndices.NUMERIC || type === characterIndices.ALETTER) && (nextType === characterIndices.NUMERIC || nextType === characterIndices.ALETTER)) { + return false; + } + if ((type === characterIndices.MIDNUM || type === characterIndices.MIDNUMLET) && nextType === characterIndices.NUMERIC && prevType === characterIndices.NUMERIC) { + return false; + } + if (type === characterIndices.NUMERIC && (nextType === characterIndices.MIDNUM || nextType === characterIndices.MIDNUMLET) && nextNextType === characterIndices.NUMERIC) { + return false; + } + if (type === characterIndices.EXTEND || type === characterIndices.FORMAT || prevType === characterIndices.EXTEND || prevType === characterIndices.FORMAT || nextType === characterIndices.EXTEND || nextType === characterIndices.FORMAT) { + return false; + } + if (type === characterIndices.CR && nextType === characterIndices.LF) { + return false; + } + if (type === characterIndices.NEWLINE || type === characterIndices.CR || type === characterIndices.LF) { return true; + } + if (nextType === characterIndices.NEWLINE || nextType === characterIndices.CR || nextType === characterIndices.LF) { + return true; + } + if (type === characterIndices.KATAKANA && nextType === characterIndices.KATAKANA) { + return false; + } + if (nextType === characterIndices.EXTENDNUMLET && (type === characterIndices.ALETTER || type === characterIndices.NUMERIC || type === characterIndices.KATAKANA || type === characterIndices.EXTENDNUMLET)) { + return false; + } + if (type === characterIndices.EXTENDNUMLET && (nextType === characterIndices.ALETTER || nextType === characterIndices.NUMERIC || nextType === characterIndices.KATAKANA)) { + return false; + } + if (type === characterIndices.AT) { + return false; + } + return true; }; + var EMPTY_STRING$1 = EMPTY_STRING; var WHITESPACE$1 = WHITESPACE; var PUNCTUATION$1 = PUNCTUATION; var isProtocol = function (str) { - return str === 'http' || str === 'https'; + return str === 'http' || str === 'https'; }; var findWordEnd = function (characters, startIndex) { - var i; - for (i = startIndex; i < characters.length; i++) { - if (WHITESPACE$1.test(characters[i])) { - break; - } + var i; + for (i = startIndex; i < characters.length; i++) { + if (WHITESPACE$1.test(characters[i])) { + break; } - return i; + } + return i; }; var findUrlEnd = function (characters, startIndex) { - var endIndex = findWordEnd(characters, startIndex + 1); - var peakedWord = characters.slice(startIndex + 1, endIndex).join(EMPTY_STRING$1); - return peakedWord.substr(0, 3) === '://' ? endIndex : startIndex; + var endIndex = findWordEnd(characters, startIndex + 1); + var peakedWord = characters.slice(startIndex + 1, endIndex).join(EMPTY_STRING$1); + return peakedWord.substr(0, 3) === '://' ? endIndex : startIndex; }; var findWords = function (chars, sChars, characterMap, options) { - var words = []; - var word = []; - for (var i = 0; i < characterMap.length; ++i) { - word.push(chars[i]); - if (isWordBoundary(characterMap, i)) { - var ch = sChars[i]; - if ((options.includeWhitespace || !WHITESPACE$1.test(ch)) && (options.includePunctuation || !PUNCTUATION$1.test(ch))) { - var startOfWord = i - word.length + 1; - var endOfWord = i + 1; - var str = sChars.slice(startOfWord, endOfWord).join(EMPTY_STRING$1); - if (isProtocol(str)) { - var endOfUrl = findUrlEnd(sChars, i); - var url = chars.slice(endOfWord, endOfUrl); - Array.prototype.push.apply(word, url); - i = endOfUrl; - } - words.push(word); - } - word = []; + var words = []; + var word = []; + for (var i = 0; i < characterMap.length; ++i) { + word.push(chars[i]); + if (isWordBoundary(characterMap, i)) { + var ch = sChars[i]; + if ((options.includeWhitespace || !WHITESPACE$1.test(ch)) && (options.includePunctuation || !PUNCTUATION$1.test(ch))) { + var startOfWord = i - word.length + 1; + var endOfWord = i + 1; + var str = sChars.slice(startOfWord, endOfWord).join(EMPTY_STRING$1); + if (isProtocol(str)) { + var endOfUrl = findUrlEnd(sChars, i); + var url = chars.slice(endOfWord, endOfUrl); + Array.prototype.push.apply(word, url); + i = endOfUrl; } + words.push(word); + } + word = []; } - return words; + } + return words; }; var getDefaultOptions = function () { - return { - includeWhitespace: false, - includePunctuation: false - }; + return { + includeWhitespace: false, + includePunctuation: false + }; }; var getWords = function (chars, extract, options) { - options = __assign(__assign({}, getDefaultOptions()), options); - var filteredChars = []; - var extractedChars = []; - for (var i = 0; i < chars.length; i++) { - var ch = extract(chars[i]); - if (ch !== zeroWidth) { - filteredChars.push(chars[i]); - extractedChars.push(ch); - } + options = __assign(__assign({}, getDefaultOptions()), options); + var filteredChars = []; + var extractedChars = []; + for (var i = 0; i < chars.length; i++) { + var ch = extract(chars[i]); + if (ch !== zeroWidth) { + filteredChars.push(chars[i]); + extractedChars.push(ch); } - var characterMap = classify(extractedChars); - return findWords(filteredChars, extractedChars, characterMap, options); + } + var characterMap = classify(extractedChars); + return findWords(filteredChars, extractedChars, characterMap, options); }; var getWords$1 = getWords; @@ -248,167 +249,167 @@ var global$1 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker'); var getText = function (node, schema) { - var blockElements = schema.getBlockElements(); - var shortEndedElements = schema.getShortEndedElements(); - var isNewline = function (node) { - return blockElements[node.nodeName] || shortEndedElements[node.nodeName]; - }; - var textBlocks = []; - var txt = ''; - var treeWalker = new global$1(node, node); - while (node = treeWalker.next()) { - if (node.nodeType === 3) { - txt += removeZwsp(node.data); - } else if (isNewline(node) && txt.length) { - textBlocks.push(txt); - txt = ''; - } + var blockElements = schema.getBlockElements(); + var shortEndedElements = schema.getShortEndedElements(); + var isNewline = function (node) { + return blockElements[node.nodeName] || shortEndedElements[node.nodeName]; + }; + var textBlocks = []; + var txt = ''; + var treeWalker = new global$1(node, node); + while (node = treeWalker.next()) { + if (node.nodeType === 3) { + txt += removeZwsp(node.data); + } else if (isNewline(node) && txt.length) { + textBlocks.push(txt); + txt = ''; } - if (txt.length) { - textBlocks.push(txt); - } - return textBlocks; + } + if (txt.length) { + textBlocks.push(txt); + } + return textBlocks; }; var strLen = function (str) { - return str.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length; + return str.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length; }; var countWords = function (node, schema) { - var text = getText(node, schema).join('\n'); - return getWords$1(text.split(''), identity).length; + var text = getText(node, schema).join('\n'); + return getWords$1(text.split(''), identity).length; }; var countCharacters = function (node, schema) { - var text = getText(node, schema).join(''); - return strLen(text); + var text = getText(node, schema).join(''); + return strLen(text); }; var countCharactersWithoutSpaces = function (node, schema) { - var text = getText(node, schema).join('').replace(/\s/g, ''); - return strLen(text); + var text = getText(node, schema).join('').replace(/\s/g, ''); + return strLen(text); }; var createBodyCounter = function (editor, count) { - return function () { - return count(editor.getBody(), editor.schema); - }; + return function () { + return count(editor.getBody(), editor.schema); + }; }; var createSelectionCounter = function (editor, count) { - return function () { - return count(editor.selection.getRng().cloneContents(), editor.schema); - }; + return function () { + return count(editor.selection.getRng().cloneContents(), editor.schema); + }; }; var createBodyWordCounter = function (editor) { - return createBodyCounter(editor, countWords); + return createBodyCounter(editor, countWords); }; var get = function (editor) { - return { - body: { - getWordCount: createBodyWordCounter(editor), - getCharacterCount: createBodyCounter(editor, countCharacters), - getCharacterCountWithoutSpaces: createBodyCounter(editor, countCharactersWithoutSpaces) - }, - selection: { - getWordCount: createSelectionCounter(editor, countWords), - getCharacterCount: createSelectionCounter(editor, countCharacters), - getCharacterCountWithoutSpaces: createSelectionCounter(editor, countCharactersWithoutSpaces) - }, - getCount: createBodyWordCounter(editor) - }; + return { + body: { + getWordCount: createBodyWordCounter(editor), + getCharacterCount: createBodyCounter(editor, countCharacters), + getCharacterCountWithoutSpaces: createBodyCounter(editor, countCharactersWithoutSpaces) + }, + selection: { + getWordCount: createSelectionCounter(editor, countWords), + getCharacterCount: createSelectionCounter(editor, countCharacters), + getCharacterCountWithoutSpaces: createSelectionCounter(editor, countCharactersWithoutSpaces) + }, + getCount: createBodyWordCounter(editor) + }; }; var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay'); var fireWordCountUpdate = function (editor, api) { - editor.fire('wordCountUpdate', { - wordCount: { - words: api.body.getWordCount(), - characters: api.body.getCharacterCount(), - charactersWithoutSpaces: api.body.getCharacterCountWithoutSpaces() - } - }); + editor.fire('wordCountUpdate', { + wordCount: { + words: api.body.getWordCount(), + characters: api.body.getCharacterCount(), + charactersWithoutSpaces: api.body.getCharacterCountWithoutSpaces() + } + }); }; var updateCount = function (editor, api) { - fireWordCountUpdate(editor, api); + fireWordCountUpdate(editor, api); }; var setup = function (editor, api, delay) { - var debouncedUpdate = global$2.debounce(function () { - return updateCount(editor, api); - }, delay); - editor.on('init', function () { - updateCount(editor, api); - global$2.setEditorTimeout(editor, function () { - editor.on('SetContent BeforeAddUndo Undo Redo keyup', debouncedUpdate); - }, 0); - }); + var debouncedUpdate = global$2.debounce(function () { + return updateCount(editor, api); + }, delay); + editor.on('init', function () { + updateCount(editor, api); + global$2.setEditorTimeout(editor, function () { + editor.on('SetContent BeforeAddUndo Undo Redo keyup', debouncedUpdate); + }, 0); + }); }; var open = function (editor, api) { - editor.windowManager.open({ - title: 'Word Count', - body: { - type: 'panel', - items: [{ - type: 'table', - header: [ - 'Count', - 'Document', - 'Selection' - ], - cells: [ - [ - 'Words', - String(api.body.getWordCount()), - String(api.selection.getWordCount()) - ], - [ - 'Characters (no spaces)', - String(api.body.getCharacterCountWithoutSpaces()), - String(api.selection.getCharacterCountWithoutSpaces()) - ], - [ - 'Characters', - String(api.body.getCharacterCount()), - String(api.selection.getCharacterCount()) - ] - ] - }] - }, - buttons: [{ - type: 'cancel', - name: 'close', - text: 'Close', - primary: true + editor.windowManager.open({ + title: 'Word Count', + body: { + type: 'panel', + items: [{ + type: 'table', + header: [ + 'Count', + 'Document', + 'Selection' + ], + cells: [ + [ + 'Words', + String(api.body.getWordCount()), + String(api.selection.getWordCount()) + ], + [ + 'Characters (no spaces)', + String(api.body.getCharacterCountWithoutSpaces()), + String(api.selection.getCharacterCountWithoutSpaces()) + ], + [ + 'Characters', + String(api.body.getCharacterCount()), + String(api.selection.getCharacterCount()) + ] + ] }] - }); + }, + buttons: [{ + type: 'cancel', + name: 'close', + text: 'Close', + primary: true + }] + }); }; var register = function (editor, api) { - editor.ui.registry.addButton('wordcount', { - tooltip: 'Word count', - icon: 'character-count', - onAction: function () { - return open(editor, api); - } - }); - editor.ui.registry.addMenuItem('wordcount', { - text: 'Word count', - icon: 'character-count', - onAction: function () { - return open(editor, api); - } - }); + editor.ui.registry.addButton('wordcount', { + tooltip: 'Word count', + icon: 'character-count', + onAction: function () { + return open(editor, api); + } + }); + editor.ui.registry.addMenuItem('wordcount', { + text: 'Word count', + icon: 'character-count', + onAction: function () { + return open(editor, api); + } + }); }; - function Plugin(delay) { - if (delay === void 0) { - delay = 300; - } - global.add('wordcount', function (editor) { - var api = get(editor); - register(editor, api); - setup(editor, api, delay); - return api; - }); + function Plugin (delay) { + if (delay === void 0) { + delay = 300; + } + global.add('wordcount', function (editor) { + var api = get(editor); + register(editor, api); + setup(editor, api, delay); + return api; + }); } Plugin(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/content/dark/content.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/content/dark/content.css index 351538fb..bae7923f 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/content/dark/content.css +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/content/dark/content.css @@ -5,80 +5,68 @@ * For commercial licenses see https://www.tiny.cloud/ */ body { - background-color: #2f3742; - color: #dfe0e4; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; - line-height: 1.4; - margin: 1rem; + background-color: #2f3742; + color: #dfe0e4; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + line-height: 1.4; + margin: 1rem; } - a { - color: #4099ff; + color: #4099ff; } - table { - border-collapse: collapse; + border-collapse: collapse; } - /* Apply a default padding if legacy cellpadding attribute is missing */ table:not([cellpadding]) th, table:not([cellpadding]) td { - padding: 0.4rem; + padding: 0.4rem; } - /* Set default table styles if a table has a positive border attribute and no inline css */ table[border]:not([border="0"]):not([style*="border-width"]) th, table[border]:not([border="0"]):not([style*="border-width"]) td { - border-width: 1px; + border-width: 1px; } - /* Set default table styles if a table has a positive border attribute and no inline css */ table[border]:not([border="0"]):not([style*="border-style"]) th, table[border]:not([border="0"]):not([style*="border-style"]) td { - border-style: solid; + border-style: solid; } - /* Set default table styles if a table has a positive border attribute and no inline css */ table[border]:not([border="0"]):not([style*="border-color"]) th, table[border]:not([border="0"]):not([style*="border-color"]) td { - border-color: #6d737b; + border-color: #6d737b; } - figure { - display: table; - margin: 1rem auto; + display: table; + margin: 1rem auto; } - figure figcaption { - color: #8a8f97; - display: block; - margin-top: 0.25rem; - text-align: center; + color: #8a8f97; + display: block; + margin-top: 0.25rem; + text-align: center; } - hr { - border-color: #6d737b; - border-style: solid; - border-width: 1px 0 0 0; + border-color: #6d737b; + border-style: solid; + border-width: 1px 0 0 0; } - code { - background-color: #6d737b; - border-radius: 3px; - padding: 0.1rem 0.2rem; + background-color: #6d737b; + border-radius: 3px; + padding: 0.1rem 0.2rem; } - .mce-content-body:not([dir=rtl]) blockquote { - border-left: 2px solid #6d737b; - margin-left: 1.5rem; - padding-left: 1rem; + border-left: 2px solid #6d737b; + margin-left: 1.5rem; + padding-left: 1rem; } - .mce-content-body[dir=rtl] blockquote { - border-right: 2px solid #6d737b; - margin-right: 1.5rem; - padding-right: 1rem; + border-right: 2px solid #6d737b; + margin-right: 1.5rem; + padding-right: 1rem; } diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/content/default/content.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/content/default/content.css index 2032a5a6..dd6a5c1c 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/content/default/content.css +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/content/default/content.css @@ -5,74 +5,63 @@ * For commercial licenses see https://www.tiny.cloud/ */ body { - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; - line-height: 1.4; - margin: 1rem; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + line-height: 1.4; + margin: 1rem; } - table { - border-collapse: collapse; + border-collapse: collapse; } - /* Apply a default padding if legacy cellpadding attribute is missing */ table:not([cellpadding]) th, table:not([cellpadding]) td { - padding: 0.4rem; + padding: 0.4rem; } - /* Set default table styles if a table has a positive border attribute and no inline css */ table[border]:not([border="0"]):not([style*="border-width"]) th, table[border]:not([border="0"]):not([style*="border-width"]) td { - border-width: 1px; + border-width: 1px; } - /* Set default table styles if a table has a positive border attribute and no inline css */ table[border]:not([border="0"]):not([style*="border-style"]) th, table[border]:not([border="0"]):not([style*="border-style"]) td { - border-style: solid; + border-style: solid; } - /* Set default table styles if a table has a positive border attribute and no inline css */ table[border]:not([border="0"]):not([style*="border-color"]) th, table[border]:not([border="0"]):not([style*="border-color"]) td { - border-color: #ccc; + border-color: #ccc; } - figure { - display: table; - margin: 1rem auto; + display: table; + margin: 1rem auto; } - figure figcaption { - color: #999; - display: block; - margin-top: 0.25rem; - text-align: center; + color: #999; + display: block; + margin-top: 0.25rem; + text-align: center; } - hr { - border-color: #ccc; - border-style: solid; - border-width: 1px 0 0 0; + border-color: #ccc; + border-style: solid; + border-width: 1px 0 0 0; } - code { - background-color: #e8e8e8; - border-radius: 3px; - padding: 0.1rem 0.2rem; + background-color: #e8e8e8; + border-radius: 3px; + padding: 0.1rem 0.2rem; } - .mce-content-body:not([dir=rtl]) blockquote { - border-left: 2px solid #ccc; - margin-left: 1.5rem; - padding-left: 1rem; + border-left: 2px solid #ccc; + margin-left: 1.5rem; + padding-left: 1rem; } - .mce-content-body[dir=rtl] blockquote { - border-right: 2px solid #ccc; - margin-right: 1.5rem; - padding-right: 1rem; + border-right: 2px solid #ccc; + margin-right: 1.5rem; + padding-right: 1rem; } diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/content/document/content.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/content/document/content.css index cce545bd..75f637a1 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/content/document/content.css +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/content/document/content.css @@ -5,79 +5,68 @@ * For commercial licenses see https://www.tiny.cloud/ */ @media screen { - html { - background: #f4f4f4; - min-height: 100%; - } + html { + background: #f4f4f4; + min-height: 100%; + } } - body { - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; } - @media screen { - body { - background-color: #fff; - box-shadow: 0 0 4px rgba(0, 0, 0, 0.15); - box-sizing: border-box; - margin: 1rem auto 0; - max-width: 820px; - min-height: calc(100vh - 1rem); - padding: 4rem 6rem 6rem 6rem; - } + body { + background-color: #fff; + box-shadow: 0 0 4px rgba(0, 0, 0, 0.15); + box-sizing: border-box; + margin: 1rem auto 0; + max-width: 820px; + min-height: calc(100vh - 1rem); + padding: 4rem 6rem 6rem 6rem; + } } - table { - border-collapse: collapse; + border-collapse: collapse; } - /* Apply a default padding if legacy cellpadding attribute is missing */ table:not([cellpadding]) th, table:not([cellpadding]) td { - padding: 0.4rem; + padding: 0.4rem; } - /* Set default table styles if a table has a positive border attribute and no inline css */ table[border]:not([border="0"]):not([style*="border-width"]) th, table[border]:not([border="0"]):not([style*="border-width"]) td { - border-width: 1px; + border-width: 1px; } - /* Set default table styles if a table has a positive border attribute and no inline css */ table[border]:not([border="0"]):not([style*="border-style"]) th, table[border]:not([border="0"]):not([style*="border-style"]) td { - border-style: solid; + border-style: solid; } - /* Set default table styles if a table has a positive border attribute and no inline css */ table[border]:not([border="0"]):not([style*="border-color"]) th, table[border]:not([border="0"]):not([style*="border-color"]) td { - border-color: #ccc; + border-color: #ccc; } - figure figcaption { - color: #999; - margin-top: 0.25rem; - text-align: center; + color: #999; + margin-top: 0.25rem; + text-align: center; } - hr { - border-color: #ccc; - border-style: solid; - border-width: 1px 0 0 0; + border-color: #ccc; + border-style: solid; + border-width: 1px 0 0 0; } - .mce-content-body:not([dir=rtl]) blockquote { - border-left: 2px solid #ccc; - margin-left: 1.5rem; - padding-left: 1rem; + border-left: 2px solid #ccc; + margin-left: 1.5rem; + padding-left: 1rem; } - .mce-content-body[dir=rtl] blockquote { - border-right: 2px solid #ccc; - margin-right: 1.5rem; - padding-right: 1rem; + border-right: 2px solid #ccc; + margin-right: 1.5rem; + padding-right: 1rem; } diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/content/writer/content.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/content/writer/content.css index e39542d7..ceee3599 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/content/writer/content.css +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/content/writer/content.css @@ -5,75 +5,64 @@ * For commercial licenses see https://www.tiny.cloud/ */ body { - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; - line-height: 1.4; - margin: 1rem auto; - max-width: 900px; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + line-height: 1.4; + margin: 1rem auto; + max-width: 900px; } - table { - border-collapse: collapse; + border-collapse: collapse; } - /* Apply a default padding if legacy cellpadding attribute is missing */ table:not([cellpadding]) th, table:not([cellpadding]) td { - padding: 0.4rem; + padding: 0.4rem; } - /* Set default table styles if a table has a positive border attribute and no inline css */ table[border]:not([border="0"]):not([style*="border-width"]) th, table[border]:not([border="0"]):not([style*="border-width"]) td { - border-width: 1px; + border-width: 1px; } - /* Set default table styles if a table has a positive border attribute and no inline css */ table[border]:not([border="0"]):not([style*="border-style"]) th, table[border]:not([border="0"]):not([style*="border-style"]) td { - border-style: solid; + border-style: solid; } - /* Set default table styles if a table has a positive border attribute and no inline css */ table[border]:not([border="0"]):not([style*="border-color"]) th, table[border]:not([border="0"]):not([style*="border-color"]) td { - border-color: #ccc; + border-color: #ccc; } - figure { - display: table; - margin: 1rem auto; + display: table; + margin: 1rem auto; } - figure figcaption { - color: #999; - display: block; - margin-top: 0.25rem; - text-align: center; + color: #999; + display: block; + margin-top: 0.25rem; + text-align: center; } - hr { - border-color: #ccc; - border-style: solid; - border-width: 1px 0 0 0; + border-color: #ccc; + border-style: solid; + border-width: 1px 0 0 0; } - code { - background-color: #e8e8e8; - border-radius: 3px; - padding: 0.1rem 0.2rem; + background-color: #e8e8e8; + border-radius: 3px; + padding: 0.1rem 0.2rem; } - .mce-content-body:not([dir=rtl]) blockquote { - border-left: 2px solid #ccc; - margin-left: 1.5rem; - padding-left: 1rem; + border-left: 2px solid #ccc; + margin-left: 1.5rem; + padding-left: 1rem; } - .mce-content-body[dir=rtl] blockquote { - border-right: 2px solid #ccc; - margin-right: 1.5rem; - padding-right: 1rem; + border-right: 2px solid #ccc; + margin-right: 1.5rem; + padding-right: 1rem; } diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/content.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/content.css index 0c78f492..33229047 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/content.css +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/content.css @@ -5,56 +5,48 @@ * For commercial licenses see https://www.tiny.cloud/ */ .mce-content-body .mce-item-anchor { - background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%20fill%3D%22%23cccccc%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; - cursor: default; - display: inline-block; - height: 12px !important; - padding: 0 2px; - -webkit-user-modify: read-only; - -moz-user-modify: read-only; - -webkit-user-select: all; - -moz-user-select: all; - -ms-user-select: all; - user-select: all; - width: 8px !important; -} - + background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%20fill%3D%22%23cccccc%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; + cursor: default; + display: inline-block; + height: 12px !important; + padding: 0 2px; + -webkit-user-modify: read-only; + -moz-user-modify: read-only; + -webkit-user-select: all; + -moz-user-select: all; + -ms-user-select: all; + user-select: all; + width: 8px !important; +} .mce-content-body .mce-item-anchor[data-mce-selected] { - outline-offset: 1px; + outline-offset: 1px; } - .tox-comments-visible .tox-comment { - background-color: #fff0b7; + background-color: #fff0b7; } - .tox-comments-visible .tox-comment--active { - background-color: #ffe168; + background-color: #ffe168; } - .tox-checklist > li:not(.tox-checklist--hidden) { - list-style: none; - margin: 0.25em 0; + list-style: none; + margin: 0.25em 0; } - .tox-checklist > li:not(.tox-checklist--hidden)::before { - content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%236d737b%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); - cursor: pointer; - height: 1em; - margin-left: -1.5em; - margin-top: 0.125em; - position: absolute; - width: 1em; -} - + content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%236d737b%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); + cursor: pointer; + height: 1em; + margin-left: -1.5em; + margin-top: 0.125em; + position: absolute; + width: 1em; +} .tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before { - content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); + content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); } - [dir=rtl] .tox-checklist > li:not(.tox-checklist--hidden)::before { - margin-left: 0; - margin-right: -1.5em; + margin-left: 0; + margin-right: -1.5em; } - /* stylelint-disable */ /* http://prismjs.com/ */ /** @@ -65,598 +57,500 @@ */ code[class*="language-"], pre[class*="language-"] { - color: #f8f8f2; - background: none; - text-shadow: 0 1px rgba(0, 0, 0, 0.3); - font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; - text-align: left; - white-space: pre; - word-spacing: normal; - word-break: normal; - word-wrap: normal; - line-height: 1.5; - -moz-tab-size: 4; - tab-size: 4; - -webkit-hyphens: none; - -ms-hyphens: none; - hyphens: none; -} - + color: #f8f8f2; + background: none; + text-shadow: 0 1px rgba(0, 0, 0, 0.3); + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + -moz-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} /* Code blocks */ pre[class*="language-"] { - padding: 1em; - margin: 0.5em 0; - overflow: auto; - border-radius: 0.3em; + padding: 1em; + margin: 0.5em 0; + overflow: auto; + border-radius: 0.3em; } - :not(pre) > code[class*="language-"], pre[class*="language-"] { - background: #282a36; + background: #282a36; } - /* Inline code */ :not(pre) > code[class*="language-"] { - padding: 0.1em; - border-radius: 0.3em; - white-space: normal; + padding: 0.1em; + border-radius: 0.3em; + white-space: normal; } - .token.comment, .token.prolog, .token.doctype, .token.cdata { - color: #6272a4; + color: #6272a4; } - .token.punctuation { - color: #f8f8f2; + color: #f8f8f2; } - .namespace { - opacity: 0.7; + opacity: 0.7; } - .token.property, .token.tag, .token.constant, .token.symbol, .token.deleted { - color: #ff79c6; + color: #ff79c6; } - .token.boolean, .token.number { - color: #bd93f9; + color: #bd93f9; } - .token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { - color: #50fa7b; + color: #50fa7b; } - .token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string, .token.variable { - color: #f8f8f2; + color: #f8f8f2; } - .token.atrule, .token.attr-value, .token.function, .token.class-name { - color: #f1fa8c; + color: #f1fa8c; } - .token.keyword { - color: #8be9fd; + color: #8be9fd; } - .token.regex, .token.important { - color: #ffb86c; + color: #ffb86c; } - .token.important, .token.bold { - font-weight: bold; + font-weight: bold; } - .token.italic { - font-style: italic; + font-style: italic; } - .token.entity { - cursor: help; + cursor: help; } - /* stylelint-enable */ .mce-content-body { - overflow-wrap: break-word; - word-wrap: break-word; + overflow-wrap: break-word; + word-wrap: break-word; } - .mce-content-body .mce-visual-caret { - background-color: black; - background-color: currentColor; - position: absolute; + background-color: black; + background-color: currentColor; + position: absolute; } - .mce-content-body .mce-visual-caret-hidden { - display: none; + display: none; } - .mce-content-body *[data-mce-caret] { - left: -1000px; - margin: 0; - padding: 0; - position: absolute; - right: auto; - top: 0; -} - + left: -1000px; + margin: 0; + padding: 0; + position: absolute; + right: auto; + top: 0; +} .mce-content-body .mce-offscreen-selection { - left: -2000000px; - max-width: 1000000px; - position: absolute; + left: -2000000px; + max-width: 1000000px; + position: absolute; } - .mce-content-body *[contentEditable=false] { - cursor: default; + cursor: default; } - .mce-content-body *[contentEditable=true] { - cursor: text; + cursor: text; } - .tox-cursor-format-painter { - cursor: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"), default; + cursor: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"), default; } - .mce-content-body figure.align-left { - float: left; + float: left; } - .mce-content-body figure.align-right { - float: right; + float: right; } - .mce-content-body figure.image.align-center { - display: table; - margin-left: auto; - margin-right: auto; + display: table; + margin-left: auto; + margin-right: auto; } - .mce-preview-object { - border: 1px solid gray; - display: inline-block; - line-height: 0; - margin: 0 2px 0 2px; - position: relative; + border: 1px solid gray; + display: inline-block; + line-height: 0; + margin: 0 2px 0 2px; + position: relative; } - .mce-preview-object .mce-shim { - background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; -} - + background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} .mce-preview-object[data-mce-selected="2"] .mce-shim { - display: none; + display: none; } - .mce-object { - background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%20fill%3D%22%23cccccc%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; - border: 1px dashed #aaa; + background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%20fill%3D%22%23cccccc%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; + border: 1px dashed #aaa; } - .mce-pagebreak { - border: 1px dashed #aaa; - cursor: default; - display: block; - height: 5px; - margin-top: 15px; - page-break-before: always; - width: 100%; -} - + border: 1px dashed #aaa; + cursor: default; + display: block; + height: 5px; + margin-top: 15px; + page-break-before: always; + width: 100%; +} @media print { - .mce-pagebreak { - border: 0; - } + .mce-pagebreak { + border: 0; + } } - .tiny-pageembed .mce-shim { - background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; -} - + background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} .tiny-pageembed[data-mce-selected="2"] .mce-shim { - display: none; + display: none; } - .tiny-pageembed { - display: inline-block; - position: relative; + display: inline-block; + position: relative; } - .tiny-pageembed--21by9, .tiny-pageembed--16by9, .tiny-pageembed--4by3, .tiny-pageembed--1by1 { - display: block; - overflow: hidden; - padding: 0; - position: relative; - width: 100%; + display: block; + overflow: hidden; + padding: 0; + position: relative; + width: 100%; } - .tiny-pageembed--21by9 { - padding-top: 42.857143%; + padding-top: 42.857143%; } - .tiny-pageembed--16by9 { - padding-top: 56.25%; + padding-top: 56.25%; } - .tiny-pageembed--4by3 { - padding-top: 75%; + padding-top: 75%; } - .tiny-pageembed--1by1 { - padding-top: 100%; + padding-top: 100%; } - .tiny-pageembed--21by9 iframe, .tiny-pageembed--16by9 iframe, .tiny-pageembed--4by3 iframe, .tiny-pageembed--1by1 iframe { - border: 0; - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; + border: 0; + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; } - .mce-content-body[data-mce-placeholder] { - position: relative; + position: relative; } - .mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before { - color: rgba(34, 47, 62, 0.7); - content: attr(data-mce-placeholder); - position: absolute; + color: rgba(34, 47, 62, 0.7); + content: attr(data-mce-placeholder); + position: absolute; } - .mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before { - left: 1px; + left: 1px; } - .mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before { - right: 1px; + right: 1px; } - .mce-content-body div.mce-resizehandle { - background-color: #4099ff; - border-color: #4099ff; - border-style: solid; - border-width: 1px; - box-sizing: border-box; - height: 10px; - position: absolute; - width: 10px; - z-index: 10000; -} - + background-color: #4099ff; + border-color: #4099ff; + border-style: solid; + border-width: 1px; + box-sizing: border-box; + height: 10px; + position: absolute; + width: 10px; + z-index: 10000; +} .mce-content-body div.mce-resizehandle:hover { - background-color: #4099ff; + background-color: #4099ff; } - .mce-content-body div.mce-resizehandle:nth-of-type(1) { - cursor: nwse-resize; + cursor: nwse-resize; } - .mce-content-body div.mce-resizehandle:nth-of-type(2) { - cursor: nesw-resize; + cursor: nesw-resize; } - .mce-content-body div.mce-resizehandle:nth-of-type(3) { - cursor: nwse-resize; + cursor: nwse-resize; } - .mce-content-body div.mce-resizehandle:nth-of-type(4) { - cursor: nesw-resize; + cursor: nesw-resize; } - .mce-content-body .mce-clonedresizable { - opacity: 0.5; - outline: 1px dashed black; - position: absolute; - z-index: 10000; + opacity: 0.5; + outline: 1px dashed black; + position: absolute; + z-index: 10000; } - .mce-content-body .mce-clonedresizable.mce-resizetable-columns th, .mce-content-body .mce-clonedresizable.mce-resizetable-columns td { - border: 0; + border: 0; } - .mce-content-body .mce-resize-helper { - background: #555; - background: rgba(0, 0, 0, 0.75); - border: 1px; - border-radius: 3px; - color: white; - display: none; - font-family: sans-serif; - font-size: 12px; - line-height: 14px; - margin: 5px 10px; - padding: 5px; - position: absolute; - white-space: nowrap; - z-index: 10001; -} - + background: #555; + background: rgba(0, 0, 0, 0.75); + border: 1px; + border-radius: 3px; + color: white; + display: none; + font-family: sans-serif; + font-size: 12px; + line-height: 14px; + margin: 5px 10px; + padding: 5px; + position: absolute; + white-space: nowrap; + z-index: 10001; +} .tox-rtc-user-selection { - position: relative; + position: relative; } - .tox-rtc-user-cursor { - bottom: 0; - cursor: default; - position: absolute; - top: 0; - width: 2px; + bottom: 0; + cursor: default; + position: absolute; + top: 0; + width: 2px; } - .tox-rtc-user-cursor::before { - background-color: inherit; - border-radius: 50%; - content: ''; - display: block; - height: 8px; - position: absolute; - right: -3px; - top: -3px; - width: 8px; -} - + background-color: inherit; + border-radius: 50%; + content: ''; + display: block; + height: 8px; + position: absolute; + right: -3px; + top: -3px; + width: 8px; +} .tox-rtc-user-cursor:hover::after { - background-color: inherit; - border-radius: 100px; - box-sizing: border-box; - color: #fff; - content: attr(data-user); - display: block; - font-size: 12px; - font-weight: bold; - left: -5px; - min-height: 8px; - min-width: 8px; - padding: 0 12px; - position: absolute; - top: -11px; - white-space: nowrap; - z-index: 1000; -} - + background-color: inherit; + border-radius: 100px; + box-sizing: border-box; + color: #fff; + content: attr(data-user); + display: block; + font-size: 12px; + font-weight: bold; + left: -5px; + min-height: 8px; + min-width: 8px; + padding: 0 12px; + position: absolute; + top: -11px; + white-space: nowrap; + z-index: 1000; +} .tox-rtc-user-selection--1 .tox-rtc-user-cursor { - background-color: #2dc26b; + background-color: #2dc26b; } - .tox-rtc-user-selection--2 .tox-rtc-user-cursor { - background-color: #e03e2d; + background-color: #e03e2d; } - .tox-rtc-user-selection--3 .tox-rtc-user-cursor { - background-color: #f1c40f; + background-color: #f1c40f; } - .tox-rtc-user-selection--4 .tox-rtc-user-cursor { - background-color: #3598db; + background-color: #3598db; } - .tox-rtc-user-selection--5 .tox-rtc-user-cursor { - background-color: #b96ad9; + background-color: #b96ad9; } - .tox-rtc-user-selection--6 .tox-rtc-user-cursor { - background-color: #e67e23; + background-color: #e67e23; } - .tox-rtc-user-selection--7 .tox-rtc-user-cursor { - background-color: #aaa69d; + background-color: #aaa69d; } - .tox-rtc-user-selection--8 .tox-rtc-user-cursor { - background-color: #f368e0; + background-color: #f368e0; } - .tox-rtc-remote-image { - background: #eaeaea url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A") no-repeat center center; - border: 1px solid #ccc; - min-height: 240px; - min-width: 320px; + background: #eaeaea url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A") no-repeat center center; + border: 1px solid #ccc; + min-height: 240px; + min-width: 320px; } - .mce-match-marker { - background: #aaa; - color: #fff; + background: #aaa; + color: #fff; } - .mce-match-marker-selected { - background: #39f; - color: #fff; + background: #39f; + color: #fff; } - .mce-match-marker-selected::-moz-selection { - background: #39f; - color: #fff; + background: #39f; + color: #fff; } - .mce-match-marker-selected::selection { - background: #39f; - color: #fff; + background: #39f; + color: #fff; } - .mce-content-body img[data-mce-selected], .mce-content-body video[data-mce-selected], .mce-content-body audio[data-mce-selected], .mce-content-body object[data-mce-selected], .mce-content-body embed[data-mce-selected], .mce-content-body table[data-mce-selected] { - outline: 3px solid #4099ff; + outline: 3px solid #4099ff; } - .mce-content-body hr[data-mce-selected] { - outline: 3px solid #4099ff; - outline-offset: 1px; + outline: 3px solid #4099ff; + outline-offset: 1px; } - .mce-content-body *[contentEditable=false] *[contentEditable=true]:focus { - outline: 3px solid #4099ff; + outline: 3px solid #4099ff; } - .mce-content-body *[contentEditable=false] *[contentEditable=true]:hover { - outline: 3px solid #4099ff; + outline: 3px solid #4099ff; } - .mce-content-body *[contentEditable=false][data-mce-selected] { - cursor: not-allowed; - outline: 3px solid #4099ff; + cursor: not-allowed; + outline: 3px solid #4099ff; } - .mce-content-body.mce-content-readonly *[contentEditable=true]:focus, .mce-content-body.mce-content-readonly *[contentEditable=true]:hover { - outline: none; + outline: none; } - .mce-content-body *[data-mce-selected="inline-boundary"] { - background-color: #4099ff; + background-color: #4099ff; } - .mce-content-body .mce-edit-focus { - outline: 3px solid #4099ff; + outline: 3px solid #4099ff; } - .mce-content-body td[data-mce-selected], .mce-content-body th[data-mce-selected] { - position: relative; + position: relative; } - .mce-content-body td[data-mce-selected]::-moz-selection, .mce-content-body th[data-mce-selected]::-moz-selection { - background: none; + background: none; } - .mce-content-body td[data-mce-selected]::selection, .mce-content-body th[data-mce-selected]::selection { - background: none; + background: none; } - .mce-content-body td[data-mce-selected] *, .mce-content-body th[data-mce-selected] * { - outline: none; - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - + outline: none; + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} .mce-content-body td[data-mce-selected]::after, .mce-content-body th[data-mce-selected]::after { - background-color: rgba(180, 215, 255, 0.7); - border: 1px solid transparent; - bottom: -1px; - content: ''; - left: -1px; - mix-blend-mode: lighten; - position: absolute; - right: -1px; - top: -1px; -} - + background-color: rgba(180, 215, 255, 0.7); + border: 1px solid transparent; + bottom: -1px; + content: ''; + left: -1px; + mix-blend-mode: lighten; + position: absolute; + right: -1px; + top: -1px; +} @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { - .mce-content-body td[data-mce-selected]::after, - .mce-content-body th[data-mce-selected]::after { - border-color: rgba(0, 84, 180, 0.7); - } + .mce-content-body td[data-mce-selected]::after, + .mce-content-body th[data-mce-selected]::after { + border-color: rgba(0, 84, 180, 0.7); + } } - .mce-content-body img::-moz-selection { - background: none; + background: none; } - .mce-content-body img::selection { - background: none; + background: none; } - .ephox-snooker-resizer-bar { - background-color: #4099ff; - opacity: 0; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - + background-color: #4099ff; + opacity: 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} .ephox-snooker-resizer-cols { - cursor: col-resize; + cursor: col-resize; } - .ephox-snooker-resizer-rows { - cursor: row-resize; + cursor: row-resize; } - .ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging { - opacity: 1; + opacity: 1; } - .mce-spellchecker-word { - background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); - background-position: 0 calc(100% + 1px); - background-repeat: repeat-x; - background-size: auto 6px; - cursor: default; - height: 2rem; -} - + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); + background-position: 0 calc(100% + 1px); + background-repeat: repeat-x; + background-size: auto 6px; + cursor: default; + height: 2rem; +} .mce-spellchecker-grammar { - background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); - background-position: 0 calc(100% + 1px); - background-repeat: repeat-x; - background-size: auto 6px; - cursor: default; + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); + background-position: 0 calc(100% + 1px); + background-repeat: repeat-x; + background-size: auto 6px; + cursor: default; } - .mce-toc { - border: 1px solid gray; + border: 1px solid gray; } - .mce-toc h2 { - margin: 4px; + margin: 4px; } - .mce-toc li { - list-style-type: none; + list-style-type: none; } - table[style*="border-width: 0px"], .mce-item-table:not([border]), .mce-item-table[border="0"], @@ -669,9 +563,8 @@ table[style*="border-width: 0px"] th, table[style*="border-width: 0px"] caption, .mce-item-table:not([border]) caption, .mce-item-table[border="0"] caption { - border: 1px dashed #bbb; + border: 1px dashed #bbb; } - .mce-visualblocks p, .mce-visualblocks h1, .mce-visualblocks h2, @@ -692,92 +585,71 @@ table[style*="border-width: 0px"] caption, .mce-visualblocks ul, .mce-visualblocks ol, .mce-visualblocks dl { - background-repeat: no-repeat; - border: 1px dashed #bbb; - margin-left: 3px; - padding-top: 10px; + background-repeat: no-repeat; + border: 1px dashed #bbb; + margin-left: 3px; + padding-top: 10px; } - .mce-visualblocks p { - background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); + background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); } - .mce-visualblocks h1 { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); } - .mce-visualblocks h2 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); } - .mce-visualblocks h3 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); } - .mce-visualblocks h4 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); } - .mce-visualblocks h5 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); } - .mce-visualblocks h6 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); } - .mce-visualblocks div:not([data-mce-bogus]) { - background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); + background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); } - .mce-visualblocks section { - background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); + background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); } - .mce-visualblocks article { - background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); + background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); } - .mce-visualblocks blockquote { - background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); + background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); } - .mce-visualblocks address { - background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); + background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); } - .mce-visualblocks pre { - background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); } - .mce-visualblocks figure { - background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); + background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); } - .mce-visualblocks figcaption { - border: 1px dashed #bbb; + border: 1px dashed #bbb; } - .mce-visualblocks hgroup { - background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); + background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); } - .mce-visualblocks aside { - background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); + background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); } - .mce-visualblocks ul { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==); } - .mce-visualblocks ol { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); } - .mce-visualblocks dl { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==); } - .mce-visualblocks:not([dir=rtl]) p, .mce-visualblocks:not([dir=rtl]) h1, .mce-visualblocks:not([dir=rtl]) h2, @@ -798,9 +670,8 @@ table[style*="border-width: 0px"] caption, .mce-visualblocks:not([dir=rtl]) ul, .mce-visualblocks:not([dir=rtl]) ol, .mce-visualblocks:not([dir=rtl]) dl { - margin-left: 3px; + margin-left: 3px; } - .mce-visualblocks[dir=rtl] p, .mce-visualblocks[dir=rtl] h1, .mce-visualblocks[dir=rtl] h2, @@ -821,23 +692,19 @@ table[style*="border-width: 0px"] caption, .mce-visualblocks[dir=rtl] ul, .mce-visualblocks[dir=rtl] ol, .mce-visualblocks[dir=rtl] dl { - background-position-x: right; - margin-right: 3px; + background-position-x: right; + margin-right: 3px; } - .mce-nbsp, .mce-shy { - background: #aaa; + background: #aaa; } - .mce-shy::after { - content: '-'; + content: '-'; } - body { - font-family: sans-serif; + font-family: sans-serif; } - table { - border-collapse: collapse; + border-collapse: collapse; } diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/content.inline.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/content.inline.css index a36c6fb7..280d6fc7 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/content.inline.css +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/content.inline.css @@ -5,56 +5,48 @@ * For commercial licenses see https://www.tiny.cloud/ */ .mce-content-body .mce-item-anchor { - background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; - cursor: default; - display: inline-block; - height: 12px !important; - padding: 0 2px; - -webkit-user-modify: read-only; - -moz-user-modify: read-only; - -webkit-user-select: all; - -moz-user-select: all; - -ms-user-select: all; - user-select: all; - width: 8px !important; -} - + background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; + cursor: default; + display: inline-block; + height: 12px !important; + padding: 0 2px; + -webkit-user-modify: read-only; + -moz-user-modify: read-only; + -webkit-user-select: all; + -moz-user-select: all; + -ms-user-select: all; + user-select: all; + width: 8px !important; +} .mce-content-body .mce-item-anchor[data-mce-selected] { - outline-offset: 1px; + outline-offset: 1px; } - .tox-comments-visible .tox-comment { - background-color: #fff0b7; + background-color: #fff0b7; } - .tox-comments-visible .tox-comment--active { - background-color: #ffe168; + background-color: #ffe168; } - .tox-checklist > li:not(.tox-checklist--hidden) { - list-style: none; - margin: 0.25em 0; + list-style: none; + margin: 0.25em 0; } - .tox-checklist > li:not(.tox-checklist--hidden)::before { - content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); - cursor: pointer; - height: 1em; - margin-left: -1.5em; - margin-top: 0.125em; - position: absolute; - width: 1em; -} - + content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); + cursor: pointer; + height: 1em; + margin-left: -1.5em; + margin-top: 0.125em; + position: absolute; + width: 1em; +} .tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before { - content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); + content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); } - [dir=rtl] .tox-checklist > li:not(.tox-checklist--hidden)::before { - margin-left: 0; - margin-right: -1.5em; + margin-left: 0; + margin-right: -1.5em; } - /* stylelint-disable */ /* http://prismjs.com/ */ /** @@ -64,81 +56,71 @@ */ code[class*="language-"], pre[class*="language-"] { - color: black; - background: none; - text-shadow: 0 1px white; - font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; - font-size: 1em; - text-align: left; - white-space: pre; - word-spacing: normal; - word-break: normal; - word-wrap: normal; - line-height: 1.5; - -moz-tab-size: 4; - tab-size: 4; - -webkit-hyphens: none; - -ms-hyphens: none; - hyphens: none; -} - + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-size: 1em; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + -moz-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { - text-shadow: none; - background: #b3d4fc; + text-shadow: none; + background: #b3d4fc; } - pre[class*="language-"]::selection, pre[class*="language-"] ::selection, code[class*="language-"]::selection, code[class*="language-"] ::selection { - text-shadow: none; - background: #b3d4fc; + text-shadow: none; + background: #b3d4fc; } - @media print { - code[class*="language-"], - pre[class*="language-"] { - text-shadow: none; - } + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } } - /* Code blocks */ pre[class*="language-"] { - padding: 1em; - margin: 0.5em 0; - overflow: auto; + padding: 1em; + margin: 0.5em 0; + overflow: auto; } - :not(pre) > code[class*="language-"], pre[class*="language-"] { - background: #f5f2f0; + background: #f5f2f0; } - /* Inline code */ :not(pre) > code[class*="language-"] { - padding: 0.1em; - border-radius: 0.3em; - white-space: normal; + padding: 0.1em; + border-radius: 0.3em; + white-space: normal; } - .token.comment, .token.prolog, .token.doctype, .token.cdata { - color: slategray; + color: slategray; } - .token.punctuation { - color: #999; + color: #999; } - .namespace { - opacity: 0.7; + opacity: 0.7; } - .token.property, .token.tag, .token.boolean, @@ -146,537 +128,447 @@ pre[class*="language-"] { .token.constant, .token.symbol, .token.deleted { - color: #905; + color: #905; } - .token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { - color: #690; + color: #690; } - .token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { - color: #9a6e3a; - background: hsla(0, 0%, 100%, 0.5); + color: #9a6e3a; + background: hsla(0, 0%, 100%, 0.5); } - .token.atrule, .token.attr-value, .token.keyword { - color: #07a; + color: #07a; } - .token.function, .token.class-name { - color: #DD4A68; + color: #DD4A68; } - .token.regex, .token.important, .token.variable { - color: #e90; + color: #e90; } - .token.important, .token.bold { - font-weight: bold; + font-weight: bold; } - .token.italic { - font-style: italic; + font-style: italic; } - .token.entity { - cursor: help; + cursor: help; } - /* stylelint-enable */ .mce-content-body { - overflow-wrap: break-word; - word-wrap: break-word; + overflow-wrap: break-word; + word-wrap: break-word; } - .mce-content-body .mce-visual-caret { - background-color: black; - background-color: currentColor; - position: absolute; + background-color: black; + background-color: currentColor; + position: absolute; } - .mce-content-body .mce-visual-caret-hidden { - display: none; + display: none; } - .mce-content-body *[data-mce-caret] { - left: -1000px; - margin: 0; - padding: 0; - position: absolute; - right: auto; - top: 0; -} - + left: -1000px; + margin: 0; + padding: 0; + position: absolute; + right: auto; + top: 0; +} .mce-content-body .mce-offscreen-selection { - left: -2000000px; - max-width: 1000000px; - position: absolute; + left: -2000000px; + max-width: 1000000px; + position: absolute; } - .mce-content-body *[contentEditable=false] { - cursor: default; + cursor: default; } - .mce-content-body *[contentEditable=true] { - cursor: text; + cursor: text; } - .tox-cursor-format-painter { - cursor: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"), default; + cursor: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"), default; } - .mce-content-body figure.align-left { - float: left; + float: left; } - .mce-content-body figure.align-right { - float: right; + float: right; } - .mce-content-body figure.image.align-center { - display: table; - margin-left: auto; - margin-right: auto; + display: table; + margin-left: auto; + margin-right: auto; } - .mce-preview-object { - border: 1px solid gray; - display: inline-block; - line-height: 0; - margin: 0 2px 0 2px; - position: relative; + border: 1px solid gray; + display: inline-block; + line-height: 0; + margin: 0 2px 0 2px; + position: relative; } - .mce-preview-object .mce-shim { - background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; -} - + background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} .mce-preview-object[data-mce-selected="2"] .mce-shim { - display: none; + display: none; } - .mce-object { - background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; - border: 1px dashed #aaa; + background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; + border: 1px dashed #aaa; } - .mce-pagebreak { - border: 1px dashed #aaa; - cursor: default; - display: block; - height: 5px; - margin-top: 15px; - page-break-before: always; - width: 100%; -} - + border: 1px dashed #aaa; + cursor: default; + display: block; + height: 5px; + margin-top: 15px; + page-break-before: always; + width: 100%; +} @media print { - .mce-pagebreak { - border: 0; - } + .mce-pagebreak { + border: 0; + } } - .tiny-pageembed .mce-shim { - background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; -} - + background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} .tiny-pageembed[data-mce-selected="2"] .mce-shim { - display: none; + display: none; } - .tiny-pageembed { - display: inline-block; - position: relative; + display: inline-block; + position: relative; } - .tiny-pageembed--21by9, .tiny-pageembed--16by9, .tiny-pageembed--4by3, .tiny-pageembed--1by1 { - display: block; - overflow: hidden; - padding: 0; - position: relative; - width: 100%; + display: block; + overflow: hidden; + padding: 0; + position: relative; + width: 100%; } - .tiny-pageembed--21by9 { - padding-top: 42.857143%; + padding-top: 42.857143%; } - .tiny-pageembed--16by9 { - padding-top: 56.25%; + padding-top: 56.25%; } - .tiny-pageembed--4by3 { - padding-top: 75%; + padding-top: 75%; } - .tiny-pageembed--1by1 { - padding-top: 100%; + padding-top: 100%; } - .tiny-pageembed--21by9 iframe, .tiny-pageembed--16by9 iframe, .tiny-pageembed--4by3 iframe, .tiny-pageembed--1by1 iframe { - border: 0; - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; + border: 0; + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; } - .mce-content-body[data-mce-placeholder] { - position: relative; + position: relative; } - .mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before { - color: rgba(34, 47, 62, 0.7); - content: attr(data-mce-placeholder); - position: absolute; + color: rgba(34, 47, 62, 0.7); + content: attr(data-mce-placeholder); + position: absolute; } - .mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before { - left: 1px; + left: 1px; } - .mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before { - right: 1px; + right: 1px; } - .mce-content-body div.mce-resizehandle { - background-color: #4099ff; - border-color: #4099ff; - border-style: solid; - border-width: 1px; - box-sizing: border-box; - height: 10px; - position: absolute; - width: 10px; - z-index: 10000; -} - + background-color: #4099ff; + border-color: #4099ff; + border-style: solid; + border-width: 1px; + box-sizing: border-box; + height: 10px; + position: absolute; + width: 10px; + z-index: 10000; +} .mce-content-body div.mce-resizehandle:hover { - background-color: #4099ff; + background-color: #4099ff; } - .mce-content-body div.mce-resizehandle:nth-of-type(1) { - cursor: nwse-resize; + cursor: nwse-resize; } - .mce-content-body div.mce-resizehandle:nth-of-type(2) { - cursor: nesw-resize; + cursor: nesw-resize; } - .mce-content-body div.mce-resizehandle:nth-of-type(3) { - cursor: nwse-resize; + cursor: nwse-resize; } - .mce-content-body div.mce-resizehandle:nth-of-type(4) { - cursor: nesw-resize; + cursor: nesw-resize; } - .mce-content-body .mce-clonedresizable { - opacity: 0.5; - outline: 1px dashed black; - position: absolute; - z-index: 10000; + opacity: 0.5; + outline: 1px dashed black; + position: absolute; + z-index: 10000; } - .mce-content-body .mce-clonedresizable.mce-resizetable-columns th, .mce-content-body .mce-clonedresizable.mce-resizetable-columns td { - border: 0; + border: 0; } - .mce-content-body .mce-resize-helper { - background: #555; - background: rgba(0, 0, 0, 0.75); - border: 1px; - border-radius: 3px; - color: white; - display: none; - font-family: sans-serif; - font-size: 12px; - line-height: 14px; - margin: 5px 10px; - padding: 5px; - position: absolute; - white-space: nowrap; - z-index: 10001; -} - + background: #555; + background: rgba(0, 0, 0, 0.75); + border: 1px; + border-radius: 3px; + color: white; + display: none; + font-family: sans-serif; + font-size: 12px; + line-height: 14px; + margin: 5px 10px; + padding: 5px; + position: absolute; + white-space: nowrap; + z-index: 10001; +} .tox-rtc-user-selection { - position: relative; + position: relative; } - .tox-rtc-user-cursor { - bottom: 0; - cursor: default; - position: absolute; - top: 0; - width: 2px; + bottom: 0; + cursor: default; + position: absolute; + top: 0; + width: 2px; } - .tox-rtc-user-cursor::before { - background-color: inherit; - border-radius: 50%; - content: ''; - display: block; - height: 8px; - position: absolute; - right: -3px; - top: -3px; - width: 8px; -} - + background-color: inherit; + border-radius: 50%; + content: ''; + display: block; + height: 8px; + position: absolute; + right: -3px; + top: -3px; + width: 8px; +} .tox-rtc-user-cursor:hover::after { - background-color: inherit; - border-radius: 100px; - box-sizing: border-box; - color: #fff; - content: attr(data-user); - display: block; - font-size: 12px; - font-weight: bold; - left: -5px; - min-height: 8px; - min-width: 8px; - padding: 0 12px; - position: absolute; - top: -11px; - white-space: nowrap; - z-index: 1000; -} - + background-color: inherit; + border-radius: 100px; + box-sizing: border-box; + color: #fff; + content: attr(data-user); + display: block; + font-size: 12px; + font-weight: bold; + left: -5px; + min-height: 8px; + min-width: 8px; + padding: 0 12px; + position: absolute; + top: -11px; + white-space: nowrap; + z-index: 1000; +} .tox-rtc-user-selection--1 .tox-rtc-user-cursor { - background-color: #2dc26b; + background-color: #2dc26b; } - .tox-rtc-user-selection--2 .tox-rtc-user-cursor { - background-color: #e03e2d; + background-color: #e03e2d; } - .tox-rtc-user-selection--3 .tox-rtc-user-cursor { - background-color: #f1c40f; + background-color: #f1c40f; } - .tox-rtc-user-selection--4 .tox-rtc-user-cursor { - background-color: #3598db; + background-color: #3598db; } - .tox-rtc-user-selection--5 .tox-rtc-user-cursor { - background-color: #b96ad9; + background-color: #b96ad9; } - .tox-rtc-user-selection--6 .tox-rtc-user-cursor { - background-color: #e67e23; + background-color: #e67e23; } - .tox-rtc-user-selection--7 .tox-rtc-user-cursor { - background-color: #aaa69d; + background-color: #aaa69d; } - .tox-rtc-user-selection--8 .tox-rtc-user-cursor { - background-color: #f368e0; + background-color: #f368e0; } - .tox-rtc-remote-image { - background: #eaeaea url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A") no-repeat center center; - border: 1px solid #ccc; - min-height: 240px; - min-width: 320px; + background: #eaeaea url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A") no-repeat center center; + border: 1px solid #ccc; + min-height: 240px; + min-width: 320px; } - .mce-match-marker { - background: #aaa; - color: #fff; + background: #aaa; + color: #fff; } - .mce-match-marker-selected { - background: #39f; - color: #fff; + background: #39f; + color: #fff; } - .mce-match-marker-selected::-moz-selection { - background: #39f; - color: #fff; + background: #39f; + color: #fff; } - .mce-match-marker-selected::selection { - background: #39f; - color: #fff; + background: #39f; + color: #fff; } - .mce-content-body img[data-mce-selected], .mce-content-body video[data-mce-selected], .mce-content-body audio[data-mce-selected], .mce-content-body object[data-mce-selected], .mce-content-body embed[data-mce-selected], .mce-content-body table[data-mce-selected] { - outline: 3px solid #b4d7ff; + outline: 3px solid #b4d7ff; } - .mce-content-body hr[data-mce-selected] { - outline: 3px solid #b4d7ff; - outline-offset: 1px; + outline: 3px solid #b4d7ff; + outline-offset: 1px; } - .mce-content-body *[contentEditable=false] *[contentEditable=true]:focus { - outline: 3px solid #b4d7ff; + outline: 3px solid #b4d7ff; } - .mce-content-body *[contentEditable=false] *[contentEditable=true]:hover { - outline: 3px solid #b4d7ff; + outline: 3px solid #b4d7ff; } - .mce-content-body *[contentEditable=false][data-mce-selected] { - cursor: not-allowed; - outline: 3px solid #b4d7ff; + cursor: not-allowed; + outline: 3px solid #b4d7ff; } - .mce-content-body.mce-content-readonly *[contentEditable=true]:focus, .mce-content-body.mce-content-readonly *[contentEditable=true]:hover { - outline: none; + outline: none; } - .mce-content-body *[data-mce-selected="inline-boundary"] { - background-color: #b4d7ff; + background-color: #b4d7ff; } - .mce-content-body .mce-edit-focus { - outline: 3px solid #b4d7ff; + outline: 3px solid #b4d7ff; } - .mce-content-body td[data-mce-selected], .mce-content-body th[data-mce-selected] { - position: relative; + position: relative; } - .mce-content-body td[data-mce-selected]::-moz-selection, .mce-content-body th[data-mce-selected]::-moz-selection { - background: none; + background: none; } - .mce-content-body td[data-mce-selected]::selection, .mce-content-body th[data-mce-selected]::selection { - background: none; + background: none; } - .mce-content-body td[data-mce-selected] *, .mce-content-body th[data-mce-selected] * { - outline: none; - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - + outline: none; + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} .mce-content-body td[data-mce-selected]::after, .mce-content-body th[data-mce-selected]::after { - background-color: rgba(180, 215, 255, 0.7); - border: 1px solid rgba(180, 215, 255, 0.7); - bottom: -1px; - content: ''; - left: -1px; - mix-blend-mode: multiply; - position: absolute; - right: -1px; - top: -1px; -} - + background-color: rgba(180, 215, 255, 0.7); + border: 1px solid rgba(180, 215, 255, 0.7); + bottom: -1px; + content: ''; + left: -1px; + mix-blend-mode: multiply; + position: absolute; + right: -1px; + top: -1px; +} @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { - .mce-content-body td[data-mce-selected]::after, - .mce-content-body th[data-mce-selected]::after { - border-color: rgba(0, 84, 180, 0.7); - } + .mce-content-body td[data-mce-selected]::after, + .mce-content-body th[data-mce-selected]::after { + border-color: rgba(0, 84, 180, 0.7); + } } - .mce-content-body img::-moz-selection { - background: none; + background: none; } - .mce-content-body img::selection { - background: none; + background: none; } - .ephox-snooker-resizer-bar { - background-color: #b4d7ff; - opacity: 0; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - + background-color: #b4d7ff; + opacity: 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} .ephox-snooker-resizer-cols { - cursor: col-resize; + cursor: col-resize; } - .ephox-snooker-resizer-rows { - cursor: row-resize; + cursor: row-resize; } - .ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging { - opacity: 1; + opacity: 1; } - .mce-spellchecker-word { - background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); - background-position: 0 calc(100% + 1px); - background-repeat: repeat-x; - background-size: auto 6px; - cursor: default; - height: 2rem; -} - + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); + background-position: 0 calc(100% + 1px); + background-repeat: repeat-x; + background-size: auto 6px; + cursor: default; + height: 2rem; +} .mce-spellchecker-grammar { - background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); - background-position: 0 calc(100% + 1px); - background-repeat: repeat-x; - background-size: auto 6px; - cursor: default; + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); + background-position: 0 calc(100% + 1px); + background-repeat: repeat-x; + background-size: auto 6px; + cursor: default; } - .mce-toc { - border: 1px solid gray; + border: 1px solid gray; } - .mce-toc h2 { - margin: 4px; + margin: 4px; } - .mce-toc li { - list-style-type: none; + list-style-type: none; } - table[style*="border-width: 0px"], .mce-item-table:not([border]), .mce-item-table[border="0"], @@ -689,9 +581,8 @@ table[style*="border-width: 0px"] th, table[style*="border-width: 0px"] caption, .mce-item-table:not([border]) caption, .mce-item-table[border="0"] caption { - border: 1px dashed #bbb; + border: 1px dashed #bbb; } - .mce-visualblocks p, .mce-visualblocks h1, .mce-visualblocks h2, @@ -712,92 +603,71 @@ table[style*="border-width: 0px"] caption, .mce-visualblocks ul, .mce-visualblocks ol, .mce-visualblocks dl { - background-repeat: no-repeat; - border: 1px dashed #bbb; - margin-left: 3px; - padding-top: 10px; + background-repeat: no-repeat; + border: 1px dashed #bbb; + margin-left: 3px; + padding-top: 10px; } - .mce-visualblocks p { - background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); + background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); } - .mce-visualblocks h1 { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); } - .mce-visualblocks h2 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); } - .mce-visualblocks h3 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); } - .mce-visualblocks h4 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); } - .mce-visualblocks h5 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); } - .mce-visualblocks h6 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); } - .mce-visualblocks div:not([data-mce-bogus]) { - background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); + background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); } - .mce-visualblocks section { - background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); + background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); } - .mce-visualblocks article { - background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); + background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); } - .mce-visualblocks blockquote { - background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); + background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); } - .mce-visualblocks address { - background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); + background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); } - .mce-visualblocks pre { - background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); } - .mce-visualblocks figure { - background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); + background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); } - .mce-visualblocks figcaption { - border: 1px dashed #bbb; + border: 1px dashed #bbb; } - .mce-visualblocks hgroup { - background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); + background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); } - .mce-visualblocks aside { - background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); + background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); } - .mce-visualblocks ul { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==); } - .mce-visualblocks ol { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); } - .mce-visualblocks dl { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==); } - .mce-visualblocks:not([dir=rtl]) p, .mce-visualblocks:not([dir=rtl]) h1, .mce-visualblocks:not([dir=rtl]) h2, @@ -818,9 +688,8 @@ table[style*="border-width: 0px"] caption, .mce-visualblocks:not([dir=rtl]) ul, .mce-visualblocks:not([dir=rtl]) ol, .mce-visualblocks:not([dir=rtl]) dl { - margin-left: 3px; + margin-left: 3px; } - .mce-visualblocks[dir=rtl] p, .mce-visualblocks[dir=rtl] h1, .mce-visualblocks[dir=rtl] h2, @@ -841,15 +710,13 @@ table[style*="border-width: 0px"] caption, .mce-visualblocks[dir=rtl] ul, .mce-visualblocks[dir=rtl] ol, .mce-visualblocks[dir=rtl] dl { - background-position-x: right; - margin-right: 3px; + background-position-x: right; + margin-right: 3px; } - .mce-nbsp, .mce-shy { - background: #aaa; + background: #aaa; } - .mce-shy::after { - content: '-'; + content: '-'; } diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/content.mobile.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/content.mobile.css index 12e82070..4bdb8bab 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/content.mobile.css +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/content.mobile.css @@ -5,30 +5,25 @@ * For commercial licenses see https://www.tiny.cloud/ */ .tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection { - /* Note: this file is used inside the content, so isn't part of theming */ - background-color: green; - display: inline-block; - opacity: 0.5; - position: absolute; + /* Note: this file is used inside the content, so isn't part of theming */ + background-color: green; + display: inline-block; + opacity: 0.5; + position: absolute; } - body { - -webkit-text-size-adjust: none; + -webkit-text-size-adjust: none; } - body img { - /* this is related to the content margin */ - max-width: 96vw; + /* this is related to the content margin */ + max-width: 96vw; } - body table img { - max-width: 95%; + max-width: 95%; } - body { - font-family: sans-serif; + font-family: sans-serif; } - table { - border-collapse: collapse; + border-collapse: collapse; } diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/skin.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/skin.css index 7aea8939..f7bef771 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/skin.css +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/skin.css @@ -5,2514 +5,2100 @@ * For commercial licenses see https://www.tiny.cloud/ */ .tox { - box-sizing: content-box; - color: #2A3746; - cursor: auto; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 16px; - font-style: normal; - font-weight: normal; - line-height: normal; - -webkit-tap-highlight-color: transparent; - text-decoration: none; - text-shadow: none; - text-transform: none; - vertical-align: initial; - white-space: normal; -} - + box-sizing: content-box; + color: #2A3746; + cursor: auto; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 16px; + font-style: normal; + font-weight: normal; + line-height: normal; + -webkit-tap-highlight-color: transparent; + text-decoration: none; + text-shadow: none; + text-transform: none; + vertical-align: initial; + white-space: normal; +} .tox *:not(svg):not(rect) { - box-sizing: inherit; - color: inherit; - cursor: inherit; - direction: inherit; - font-family: inherit; - font-size: inherit; - font-style: inherit; - font-weight: inherit; - line-height: inherit; - -webkit-tap-highlight-color: inherit; - text-align: inherit; - text-decoration: inherit; - text-shadow: inherit; - text-transform: inherit; - vertical-align: inherit; - white-space: inherit; -} - + box-sizing: inherit; + color: inherit; + cursor: inherit; + direction: inherit; + font-family: inherit; + font-size: inherit; + font-style: inherit; + font-weight: inherit; + line-height: inherit; + -webkit-tap-highlight-color: inherit; + text-align: inherit; + text-decoration: inherit; + text-shadow: inherit; + text-transform: inherit; + vertical-align: inherit; + white-space: inherit; +} .tox *:not(svg):not(rect) { - /* stylelint-disable-line no-duplicate-selectors */ - background: transparent; - border: 0; - float: none; - height: auto; - margin: 0; - max-width: none; - outline: 0; - padding: 0; - position: static; - width: auto; -} - + /* stylelint-disable-line no-duplicate-selectors */ + background: transparent; + border: 0; + float: none; + height: auto; + margin: 0; + max-width: none; + outline: 0; + padding: 0; + position: static; + width: auto; +} .tox:not([dir=rtl]) { - direction: ltr; - text-align: left; + direction: ltr; + text-align: left; } - .tox[dir=rtl] { - direction: rtl; - text-align: right; + direction: rtl; + text-align: right; } - .tox-tinymce { - border: 1px solid #000000; - border-radius: 0; - box-shadow: none; - box-sizing: border-box; - display: flex; - flex-direction: column; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - overflow: hidden; - position: relative; - visibility: inherit !important; + border: 1px solid #000000; + border-radius: 0; + box-shadow: none; + box-sizing: border-box; + display: flex; + flex-direction: column; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + overflow: hidden; + position: relative; + visibility: inherit !important; } - .tox-tinymce-inline { - border: none; - box-shadow: none; + border: none; + box-shadow: none; } - .tox-tinymce-inline .tox-editor-header { - border: 1px solid #000000; - border-radius: 0; - box-shadow: none; + border: 1px solid #000000; + border-radius: 0; + box-shadow: none; } - .tox-tinymce-aux { - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - z-index: 1300; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + z-index: 1300; } - .tox-tinymce *:focus, .tox-tinymce-aux *:focus { - outline: none; + outline: none; } - button::-moz-focus-inner { - border: 0; + border: 0; } - .tox .accessibility-issue__header { - align-items: center; - display: flex; - margin-bottom: 4px; + align-items: center; + display: flex; + margin-bottom: 4px; } - .tox .accessibility-issue__description { - align-items: stretch; - border: 1px solid #000000; - border-radius: 3px; - display: flex; - justify-content: space-between; + align-items: stretch; + border: 1px solid #000000; + border-radius: 3px; + display: flex; + justify-content: space-between; } - .tox .accessibility-issue__description > div { - padding-bottom: 4px; + padding-bottom: 4px; } - .tox .accessibility-issue__description > div > div { - align-items: center; - display: flex; - margin-bottom: 4px; + align-items: center; + display: flex; + margin-bottom: 4px; } - .tox .accessibility-issue__description > *:last-child:not(:only-child) { - border-color: #000000; - border-style: solid; + border-color: #000000; + border-style: solid; } - .tox .accessibility-issue__repair { - margin-top: 16px; + margin-top: 16px; } - .tox .tox-dialog__body-content .accessibility-issue--info .accessibility-issue__description { - background-color: rgba(32, 122, 183, 0.5); - border-color: #207ab7; - color: #fff; + background-color: rgba(32, 122, 183, 0.5); + border-color: #207ab7; + color: #fff; } - .tox .tox-dialog__body-content .accessibility-issue--info .accessibility-issue__description > *:last-child { - border-color: #207ab7; + border-color: #207ab7; } - .tox .tox-dialog__body-content .accessibility-issue--info .tox-form__group h2 { - color: #fff; + color: #fff; } - .tox .tox-dialog__body-content .accessibility-issue--info .tox-icon svg { - fill: #fff; + fill: #fff; } - .tox .tox-dialog__body-content .accessibility-issue--info a .tox-icon { - color: #fff; + color: #fff; } - .tox .tox-dialog__body-content .accessibility-issue--warn .accessibility-issue__description { - background-color: rgba(255, 165, 0, 0.5); - border-color: rgba(255, 165, 0, 0.8); - color: #fff; + background-color: rgba(255, 165, 0, 0.5); + border-color: rgba(255, 165, 0, 0.8); + color: #fff; } - .tox .tox-dialog__body-content .accessibility-issue--warn .accessibility-issue__description > *:last-child { - border-color: rgba(255, 165, 0, 0.8); + border-color: rgba(255, 165, 0, 0.8); } - .tox .tox-dialog__body-content .accessibility-issue--warn .tox-form__group h2 { - color: #fff; + color: #fff; } - .tox .tox-dialog__body-content .accessibility-issue--warn .tox-icon svg { - fill: #fff; + fill: #fff; } - .tox .tox-dialog__body-content .accessibility-issue--warn a .tox-icon { - color: #fff; + color: #fff; } - .tox .tox-dialog__body-content .accessibility-issue--error .accessibility-issue__description { - background-color: rgba(204, 0, 0, 0.5); - border-color: rgba(204, 0, 0, 0.8); - color: #fff; + background-color: rgba(204, 0, 0, 0.5); + border-color: rgba(204, 0, 0, 0.8); + color: #fff; } - .tox .tox-dialog__body-content .accessibility-issue--error .accessibility-issue__description > *:last-child { - border-color: rgba(204, 0, 0, 0.8); + border-color: rgba(204, 0, 0, 0.8); } - .tox .tox-dialog__body-content .accessibility-issue--error .tox-form__group h2 { - color: #fff; + color: #fff; } - .tox .tox-dialog__body-content .accessibility-issue--error .tox-icon svg { - fill: #fff; + fill: #fff; } - .tox .tox-dialog__body-content .accessibility-issue--error a .tox-icon { - color: #fff; + color: #fff; } - .tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description { - background-color: rgba(120, 171, 70, 0.5); - border-color: rgba(120, 171, 70, 0.8); - color: #fff; + background-color: rgba(120, 171, 70, 0.5); + border-color: rgba(120, 171, 70, 0.8); + color: #fff; } - .tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description > *:last-child { - border-color: rgba(120, 171, 70, 0.8); + border-color: rgba(120, 171, 70, 0.8); } - .tox .tox-dialog__body-content .accessibility-issue--success .tox-form__group h2 { - color: #fff; + color: #fff; } - .tox .tox-dialog__body-content .accessibility-issue--success .tox-icon svg { - fill: #fff; + fill: #fff; } - .tox .tox-dialog__body-content .accessibility-issue--success a .tox-icon { - color: #fff; + color: #fff; } - .tox .tox-dialog__body-content .accessibility-issue__header h1, .tox .tox-dialog__body-content .tox-form__group .accessibility-issue__description h2 { - margin-top: 0; + margin-top: 0; } - .tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header .tox-button { - margin-left: 4px; + margin-left: 4px; } - .tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header > *:nth-last-child(2) { - margin-left: auto; + margin-left: auto; } - .tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__description { - padding: 4px 4px 4px 8px; + padding: 4px 4px 4px 8px; } - .tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__description > *:last-child { - border-left-width: 1px; - padding-left: 4px; + border-left-width: 1px; + padding-left: 4px; } - .tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header .tox-button { - margin-right: 4px; + margin-right: 4px; } - .tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header > *:nth-last-child(2) { - margin-right: auto; + margin-right: auto; } - .tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__description { - padding: 4px 8px 4px 4px; + padding: 4px 8px 4px 4px; } - .tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__description > *:last-child { - border-right-width: 1px; - padding-right: 4px; + border-right-width: 1px; + padding-right: 4px; } - .tox .tox-anchorbar { - display: flex; - flex: 0 0 auto; + display: flex; + flex: 0 0 auto; } - .tox .tox-bar { - display: flex; - flex: 0 0 auto; + display: flex; + flex: 0 0 auto; } - .tox .tox-button { - background-color: #207ab7; - background-image: none; - background-position: 0 0; - background-repeat: repeat; - border-color: #207ab7; - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: none; - box-sizing: border-box; - color: #fff; - cursor: pointer; - display: inline-block; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 14px; - font-style: normal; - font-weight: bold; - letter-spacing: normal; - line-height: 24px; - margin: 0; - outline: none; - padding: 4px 16px; - text-align: center; - text-decoration: none; - text-transform: capitalize; - white-space: nowrap; -} - + background-color: #207ab7; + background-image: none; + background-position: 0 0; + background-repeat: repeat; + border-color: #207ab7; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + box-sizing: border-box; + color: #fff; + cursor: pointer; + display: inline-block; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 14px; + font-style: normal; + font-weight: bold; + letter-spacing: normal; + line-height: 24px; + margin: 0; + outline: none; + padding: 4px 16px; + text-align: center; + text-decoration: none; + text-transform: capitalize; + white-space: nowrap; +} .tox .tox-button[disabled] { - background-color: #207ab7; - background-image: none; - border-color: #207ab7; - box-shadow: none; - color: rgba(255, 255, 255, 0.5); - cursor: not-allowed; -} - + background-color: #207ab7; + background-image: none; + border-color: #207ab7; + box-shadow: none; + color: rgba(255, 255, 255, 0.5); + cursor: not-allowed; +} .tox .tox-button:focus:not(:disabled) { - background-color: #1c6ca1; - background-image: none; - border-color: #1c6ca1; - box-shadow: none; - color: #fff; + background-color: #1c6ca1; + background-image: none; + border-color: #1c6ca1; + box-shadow: none; + color: #fff; } - .tox .tox-button:hover:not(:disabled) { - background-color: #1c6ca1; - background-image: none; - border-color: #1c6ca1; - box-shadow: none; - color: #fff; + background-color: #1c6ca1; + background-image: none; + border-color: #1c6ca1; + box-shadow: none; + color: #fff; } - .tox .tox-button:active:not(:disabled) { - background-color: #185d8c; - background-image: none; - border-color: #185d8c; - box-shadow: none; - color: #fff; + background-color: #185d8c; + background-image: none; + border-color: #185d8c; + box-shadow: none; + color: #fff; } - .tox .tox-button--secondary { - background-color: #3d546f; - background-image: none; - background-position: 0 0; - background-repeat: repeat; - border-color: #3d546f; - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: none; - color: #fff; - font-size: 14px; - font-style: normal; - font-weight: bold; - letter-spacing: normal; - outline: none; - padding: 4px 16px; - text-decoration: none; - text-transform: capitalize; -} - + background-color: #3d546f; + background-image: none; + background-position: 0 0; + background-repeat: repeat; + border-color: #3d546f; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + color: #fff; + font-size: 14px; + font-style: normal; + font-weight: bold; + letter-spacing: normal; + outline: none; + padding: 4px 16px; + text-decoration: none; + text-transform: capitalize; +} .tox .tox-button--secondary[disabled] { - background-color: #3d546f; - background-image: none; - border-color: #3d546f; - box-shadow: none; - color: rgba(255, 255, 255, 0.5); + background-color: #3d546f; + background-image: none; + border-color: #3d546f; + box-shadow: none; + color: rgba(255, 255, 255, 0.5); } - .tox .tox-button--secondary:focus:not(:disabled) { - background-color: #34485f; - background-image: none; - border-color: #34485f; - box-shadow: none; - color: #fff; + background-color: #34485f; + background-image: none; + border-color: #34485f; + box-shadow: none; + color: #fff; } - .tox .tox-button--secondary:hover:not(:disabled) { - background-color: #34485f; - background-image: none; - border-color: #34485f; - box-shadow: none; - color: #fff; + background-color: #34485f; + background-image: none; + border-color: #34485f; + box-shadow: none; + color: #fff; } - .tox .tox-button--secondary:active:not(:disabled) { - background-color: #2b3b4e; - background-image: none; - border-color: #2b3b4e; - box-shadow: none; - color: #fff; + background-color: #2b3b4e; + background-image: none; + border-color: #2b3b4e; + box-shadow: none; + color: #fff; } - .tox .tox-button--icon, .tox .tox-button.tox-button--icon, .tox .tox-button.tox-button--secondary.tox-button--icon { - padding: 4px; + padding: 4px; } - .tox .tox-button--icon .tox-icon svg, .tox .tox-button.tox-button--icon .tox-icon svg, .tox .tox-button.tox-button--secondary.tox-button--icon .tox-icon svg { - display: block; - fill: currentColor; + display: block; + fill: currentColor; } - .tox .tox-button-link { - background: 0; - border: none; - box-sizing: border-box; - cursor: pointer; - display: inline-block; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 16px; - font-weight: normal; - line-height: 1.3; - margin: 0; - padding: 0; - white-space: nowrap; -} - + background: 0; + border: none; + box-sizing: border-box; + cursor: pointer; + display: inline-block; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 16px; + font-weight: normal; + line-height: 1.3; + margin: 0; + padding: 0; + white-space: nowrap; +} .tox .tox-button-link--sm { - font-size: 14px; + font-size: 14px; } - .tox .tox-button--naked { - background-color: transparent; - border-color: transparent; - box-shadow: unset; - color: #fff; + background-color: transparent; + border-color: transparent; + box-shadow: unset; + color: #fff; } - .tox .tox-button--naked[disabled] { - background-color: #3d546f; - border-color: #3d546f; - box-shadow: none; - color: rgba(255, 255, 255, 0.5); + background-color: #3d546f; + border-color: #3d546f; + box-shadow: none; + color: rgba(255, 255, 255, 0.5); } - .tox .tox-button--naked:hover:not(:disabled) { - background-color: #34485f; - border-color: #34485f; - box-shadow: none; - color: #fff; + background-color: #34485f; + border-color: #34485f; + box-shadow: none; + color: #fff; } - .tox .tox-button--naked:focus:not(:disabled) { - background-color: #34485f; - border-color: #34485f; - box-shadow: none; - color: #fff; + background-color: #34485f; + border-color: #34485f; + box-shadow: none; + color: #fff; } - .tox .tox-button--naked:active:not(:disabled) { - background-color: #2b3b4e; - border-color: #2b3b4e; - box-shadow: none; - color: #fff; + background-color: #2b3b4e; + border-color: #2b3b4e; + box-shadow: none; + color: #fff; } - .tox .tox-button--naked .tox-icon svg { - fill: currentColor; + fill: currentColor; } - .tox .tox-button--naked.tox-button--icon:hover:not(:disabled) { - color: #fff; + color: #fff; } - .tox .tox-checkbox { - align-items: center; - border-radius: 3px; - cursor: pointer; - display: flex; - height: 36px; - min-width: 36px; -} - + align-items: center; + border-radius: 3px; + cursor: pointer; + display: flex; + height: 36px; + min-width: 36px; +} .tox .tox-checkbox__input { - /* Hide from view but visible to screen readers */ - height: 1px; - overflow: hidden; - position: absolute; - top: auto; - width: 1px; -} - + /* Hide from view but visible to screen readers */ + height: 1px; + overflow: hidden; + position: absolute; + top: auto; + width: 1px; +} .tox .tox-checkbox__icons { - align-items: center; - border-radius: 3px; - box-shadow: 0 0 0 2px transparent; - box-sizing: content-box; - display: flex; - height: 24px; - justify-content: center; - padding: calc(4px - 1px); - width: 24px; -} - + align-items: center; + border-radius: 3px; + box-shadow: 0 0 0 2px transparent; + box-sizing: content-box; + display: flex; + height: 24px; + justify-content: center; + padding: calc(4px - 1px); + width: 24px; +} .tox .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { - display: block; - fill: rgba(255, 255, 255, 0.2); + display: block; + fill: rgba(255, 255, 255, 0.2); } - .tox .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg { - display: none; - fill: #207ab7; + display: none; + fill: #207ab7; } - .tox .tox-checkbox__icons .tox-checkbox-icon__checked svg { - display: none; - fill: #207ab7; + display: none; + fill: #207ab7; } - .tox .tox-checkbox--disabled { - color: rgba(255, 255, 255, 0.5); - cursor: not-allowed; + color: rgba(255, 255, 255, 0.5); + cursor: not-allowed; } - .tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__checked svg { - fill: rgba(255, 255, 255, 0.5); + fill: rgba(255, 255, 255, 0.5); } - .tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { - fill: rgba(255, 255, 255, 0.5); + fill: rgba(255, 255, 255, 0.5); } - .tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg { - fill: rgba(255, 255, 255, 0.5); + fill: rgba(255, 255, 255, 0.5); } - .tox input.tox-checkbox__input:checked + .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { - display: none; + display: none; } - .tox input.tox-checkbox__input:checked + .tox-checkbox__icons .tox-checkbox-icon__checked svg { - display: block; + display: block; } - .tox input.tox-checkbox__input:indeterminate + .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { - display: none; + display: none; } - .tox input.tox-checkbox__input:indeterminate + .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg { - display: block; + display: block; } - .tox input.tox-checkbox__input:focus + .tox-checkbox__icons { - border-radius: 3px; - box-shadow: inset 0 0 0 1px #207ab7; - padding: calc(4px - 1px); + border-radius: 3px; + box-shadow: inset 0 0 0 1px #207ab7; + padding: calc(4px - 1px); } - .tox:not([dir=rtl]) .tox-checkbox__label { - margin-left: 4px; + margin-left: 4px; } - .tox:not([dir=rtl]) .tox-checkbox__input { - left: -10000px; + left: -10000px; } - .tox:not([dir=rtl]) .tox-bar .tox-checkbox { - margin-left: 4px; + margin-left: 4px; } - .tox[dir=rtl] .tox-checkbox__label { - margin-right: 4px; + margin-right: 4px; } - .tox[dir=rtl] .tox-checkbox__input { - right: -10000px; + right: -10000px; } - .tox[dir=rtl] .tox-bar .tox-checkbox { - margin-right: 4px; + margin-right: 4px; } - .tox { - /* stylelint-disable-next-line no-descending-specificity */ + /* stylelint-disable-next-line no-descending-specificity */ } - .tox .tox-collection--toolbar .tox-collection__group { - display: flex; - padding: 0; + display: flex; + padding: 0; } - .tox .tox-collection--grid .tox-collection__group { - display: flex; - flex-wrap: wrap; - max-height: 208px; - overflow-x: hidden; - overflow-y: auto; - padding: 0; -} - + display: flex; + flex-wrap: wrap; + max-height: 208px; + overflow-x: hidden; + overflow-y: auto; + padding: 0; +} .tox .tox-collection--list .tox-collection__group { - border-bottom-width: 0; - border-color: #1a1a1a; - border-left-width: 0; - border-right-width: 0; - border-style: solid; - border-top-width: 1px; - padding: 4px 0; -} - + border-bottom-width: 0; + border-color: #1a1a1a; + border-left-width: 0; + border-right-width: 0; + border-style: solid; + border-top-width: 1px; + padding: 4px 0; +} .tox .tox-collection--list .tox-collection__group:first-child { - border-top-width: 0; + border-top-width: 0; } - .tox .tox-collection__group-heading { - background-color: #333333; - color: #fff; - cursor: default; - font-size: 12px; - font-style: normal; - font-weight: normal; - margin-bottom: 4px; - margin-top: -4px; - padding: 4px 8px; - text-transform: none; - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - + background-color: #333333; + color: #fff; + cursor: default; + font-size: 12px; + font-style: normal; + font-weight: normal; + margin-bottom: 4px; + margin-top: -4px; + padding: 4px 8px; + text-transform: none; + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} .tox .tox-collection__item { - align-items: center; - color: #fff; - cursor: pointer; - display: flex; - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - + align-items: center; + color: #fff; + cursor: pointer; + display: flex; + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} .tox .tox-collection--list .tox-collection__item { - padding: 4px 8px; + padding: 4px 8px; } - .tox .tox-collection--toolbar .tox-collection__item { - border-radius: 3px; - padding: 4px; + border-radius: 3px; + padding: 4px; } - .tox .tox-collection--grid .tox-collection__item { - border-radius: 3px; - padding: 4px; + border-radius: 3px; + padding: 4px; } - .tox .tox-collection--list .tox-collection__item--enabled { - background-color: #2b3b4e; - color: #fff; + background-color: #2b3b4e; + color: #fff; } - .tox .tox-collection--list .tox-collection__item--active { - background-color: #4a5562; + background-color: #4a5562; } - .tox .tox-collection--toolbar .tox-collection__item--enabled { - background-color: #757d87; - color: #fff; + background-color: #757d87; + color: #fff; } - .tox .tox-collection--toolbar .tox-collection__item--active { - background-color: #4a5562; + background-color: #4a5562; } - .tox .tox-collection--grid .tox-collection__item--enabled { - background-color: #757d87; - color: #fff; + background-color: #757d87; + color: #fff; } - .tox .tox-collection--grid .tox-collection__item--active:not(.tox-collection__item--state-disabled) { - background-color: #4a5562; - color: #fff; + background-color: #4a5562; + color: #fff; } - .tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled) { - color: #fff; + color: #fff; } - .tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled) { - color: #fff; + color: #fff; } - .tox .tox-collection__item--state-disabled { - background-color: transparent; - color: rgba(255, 255, 255, 0.5); - cursor: not-allowed; + background-color: transparent; + color: rgba(255, 255, 255, 0.5); + cursor: not-allowed; } - .tox .tox-collection__item-icon, .tox .tox-collection__item-checkmark { - align-items: center; - display: flex; - height: 24px; - justify-content: center; - width: 24px; + align-items: center; + display: flex; + height: 24px; + justify-content: center; + width: 24px; } - .tox .tox-collection__item-icon svg, .tox .tox-collection__item-checkmark svg { - fill: currentColor; + fill: currentColor; } - .tox .tox-collection--toolbar-lg .tox-collection__item-icon { - height: 48px; - width: 48px; + height: 48px; + width: 48px; } - .tox .tox-collection__item-label { - color: currentColor; - display: inline-block; - flex: 1; - -ms-flex-preferred-size: auto; - font-size: 14px; - font-style: normal; - font-weight: normal; - line-height: 24px; - text-transform: none; - word-break: break-all; -} - + color: currentColor; + display: inline-block; + flex: 1; + -ms-flex-preferred-size: auto; + font-size: 14px; + font-style: normal; + font-weight: normal; + line-height: 24px; + text-transform: none; + word-break: break-all; +} .tox .tox-collection__item-accessory { - color: rgba(255, 255, 255, 0.5); - display: inline-block; - font-size: 14px; - height: 24px; - line-height: 24px; - text-transform: none; -} - + color: rgba(255, 255, 255, 0.5); + display: inline-block; + font-size: 14px; + height: 24px; + line-height: 24px; + text-transform: none; +} .tox .tox-collection__item-caret { - align-items: center; - display: flex; - min-height: 24px; + align-items: center; + display: flex; + min-height: 24px; } - .tox .tox-collection__item-caret::after { - content: ''; - font-size: 0; - min-height: inherit; + content: ''; + font-size: 0; + min-height: inherit; } - .tox .tox-collection__item-caret svg { - fill: #fff; + fill: #fff; } - .tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg { - display: none; + display: none; } - .tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-accessory + .tox-collection__item-checkmark { - display: none; + display: none; } - .tox .tox-collection--horizontal { - background-color: #2b3b4e; - border: 1px solid #1a1a1a; - border-radius: 3px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); - display: flex; - flex: 0 0 auto; - flex-shrink: 0; - flex-wrap: nowrap; - margin-bottom: 0; - overflow-x: auto; - padding: 0; + background-color: #2b3b4e; + border: 1px solid #1a1a1a; + border-radius: 3px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); + display: flex; + flex: 0 0 auto; + flex-shrink: 0; + flex-wrap: nowrap; + margin-bottom: 0; + overflow-x: auto; + padding: 0; } - .tox .tox-collection--horizontal .tox-collection__group { - align-items: center; - display: flex; - flex-wrap: nowrap; - margin: 0; - padding: 0 4px; + align-items: center; + display: flex; + flex-wrap: nowrap; + margin: 0; + padding: 0 4px; } - .tox .tox-collection--horizontal .tox-collection__item { - height: 34px; - margin: 2px 0 3px 0; - padding: 0 4px; + height: 34px; + margin: 2px 0 3px 0; + padding: 0 4px; } - .tox .tox-collection--horizontal .tox-collection__item-label { - white-space: nowrap; + white-space: nowrap; } - .tox .tox-collection--horizontal .tox-collection__item-caret { - margin-left: 4px; + margin-left: 4px; } - .tox .tox-collection__item-container { - display: flex; + display: flex; } - .tox .tox-collection__item-container--row { - align-items: center; - flex: 1 1 auto; - flex-direction: row; + align-items: center; + flex: 1 1 auto; + flex-direction: row; } - .tox .tox-collection__item-container--row.tox-collection__item-container--align-left { - margin-right: auto; + margin-right: auto; } - .tox .tox-collection__item-container--row.tox-collection__item-container--align-right { - justify-content: flex-end; - margin-left: auto; + justify-content: flex-end; + margin-left: auto; } - .tox .tox-collection__item-container--row.tox-collection__item-container--valign-top { - align-items: flex-start; - margin-bottom: auto; + align-items: flex-start; + margin-bottom: auto; } - .tox .tox-collection__item-container--row.tox-collection__item-container--valign-middle { - align-items: center; + align-items: center; } - .tox .tox-collection__item-container--row.tox-collection__item-container--valign-bottom { - align-items: flex-end; - margin-top: auto; + align-items: flex-end; + margin-top: auto; } - .tox .tox-collection__item-container--column { - -ms-grid-row-align: center; - align-self: center; - flex: 1 1 auto; - flex-direction: column; + -ms-grid-row-align: center; + align-self: center; + flex: 1 1 auto; + flex-direction: column; } - .tox .tox-collection__item-container--column.tox-collection__item-container--align-left { - align-items: flex-start; + align-items: flex-start; } - .tox .tox-collection__item-container--column.tox-collection__item-container--align-right { - align-items: flex-end; + align-items: flex-end; } - .tox .tox-collection__item-container--column.tox-collection__item-container--valign-top { - align-self: flex-start; + align-self: flex-start; } - .tox .tox-collection__item-container--column.tox-collection__item-container--valign-middle { - -ms-grid-row-align: center; - align-self: center; + -ms-grid-row-align: center; + align-self: center; } - .tox .tox-collection__item-container--column.tox-collection__item-container--valign-bottom { - align-self: flex-end; + align-self: flex-end; } - .tox:not([dir=rtl]) .tox-collection--horizontal .tox-collection__group:not(:last-of-type) { - border-right: 1px solid #000000; + border-right: 1px solid #000000; } - .tox:not([dir=rtl]) .tox-collection--list .tox-collection__item > *:not(:first-child) { - margin-left: 8px; + margin-left: 8px; } - .tox:not([dir=rtl]) .tox-collection--list .tox-collection__item > .tox-collection__item-label:first-child { - margin-left: 4px; + margin-left: 4px; } - .tox:not([dir=rtl]) .tox-collection__item-accessory { - margin-left: 16px; - text-align: right; + margin-left: 16px; + text-align: right; } - .tox:not([dir=rtl]) .tox-collection .tox-collection__item-caret { - margin-left: 16px; + margin-left: 16px; } - .tox[dir=rtl] .tox-collection--horizontal .tox-collection__group:not(:last-of-type) { - border-left: 1px solid #000000; + border-left: 1px solid #000000; } - .tox[dir=rtl] .tox-collection--list .tox-collection__item > *:not(:first-child) { - margin-right: 8px; + margin-right: 8px; } - .tox[dir=rtl] .tox-collection--list .tox-collection__item > .tox-collection__item-label:first-child { - margin-right: 4px; + margin-right: 4px; } - .tox[dir=rtl] .tox-collection__item-icon-rtl { - /* stylelint-disable-next-line no-descending-specificity */ + /* stylelint-disable-next-line no-descending-specificity */ } - .tox[dir=rtl] .tox-collection__item-icon-rtl .tox-collection__item-icon svg { - transform: rotateY(180deg); + transform: rotateY(180deg); } - .tox[dir=rtl] .tox-collection__item-accessory { - margin-right: 16px; - text-align: left; + margin-right: 16px; + text-align: left; } - .tox[dir=rtl] .tox-collection .tox-collection__item-caret { - margin-right: 16px; - transform: rotateY(180deg); + margin-right: 16px; + transform: rotateY(180deg); } - .tox[dir=rtl] .tox-collection--horizontal .tox-collection__item-caret { - margin-right: 4px; + margin-right: 4px; } - .tox .tox-color-picker-container { - display: flex; - flex-direction: row; - height: 225px; - margin: 0; + display: flex; + flex-direction: row; + height: 225px; + margin: 0; } - .tox .tox-sv-palette { - box-sizing: border-box; - display: flex; - height: 100%; + box-sizing: border-box; + display: flex; + height: 100%; } - .tox .tox-sv-palette-spectrum { - height: 100%; + height: 100%; } - .tox .tox-sv-palette, .tox .tox-sv-palette-spectrum { - width: 225px; + width: 225px; } - .tox .tox-sv-palette-thumb { - background: none; - border: 1px solid black; - border-radius: 50%; - box-sizing: content-box; - height: 12px; - position: absolute; - width: 12px; -} - + background: none; + border: 1px solid black; + border-radius: 50%; + box-sizing: content-box; + height: 12px; + position: absolute; + width: 12px; +} .tox .tox-sv-palette-inner-thumb { - border: 1px solid white; - border-radius: 50%; - height: 10px; - position: absolute; - width: 10px; + border: 1px solid white; + border-radius: 50%; + height: 10px; + position: absolute; + width: 10px; } - .tox .tox-hue-slider { - box-sizing: border-box; - height: 100%; - width: 25px; + box-sizing: border-box; + height: 100%; + width: 25px; } - .tox .tox-hue-slider-spectrum { - background: linear-gradient(to bottom, #f00, #ff0080, #f0f, #8000ff, #00f, #0080ff, #0ff, #00ff80, #0f0, #80ff00, #ff0, #ff8000, #f00); - height: 100%; - width: 100%; + background: linear-gradient(to bottom, #f00, #ff0080, #f0f, #8000ff, #00f, #0080ff, #0ff, #00ff80, #0f0, #80ff00, #ff0, #ff8000, #f00); + height: 100%; + width: 100%; } - .tox .tox-hue-slider, .tox .tox-hue-slider-spectrum { - width: 20px; + width: 20px; } - .tox .tox-hue-slider-thumb { - background: white; - border: 1px solid black; - box-sizing: content-box; - height: 4px; - width: 100%; + background: white; + border: 1px solid black; + box-sizing: content-box; + height: 4px; + width: 100%; } - .tox .tox-rgb-form { - display: flex; - flex-direction: column; - justify-content: space-between; + display: flex; + flex-direction: column; + justify-content: space-between; } - .tox .tox-rgb-form div { - align-items: center; - display: flex; - justify-content: space-between; - margin-bottom: 5px; - width: inherit; + align-items: center; + display: flex; + justify-content: space-between; + margin-bottom: 5px; + width: inherit; } - .tox .tox-rgb-form input { - width: 6em; + width: 6em; } - .tox .tox-rgb-form input.tox-invalid { - /* Need !important to override Chrome's focus styling unfortunately */ - border: 1px solid red !important; + /* Need !important to override Chrome's focus styling unfortunately */ + border: 1px solid red !important; } - .tox .tox-rgb-form .tox-rgba-preview { - border: 1px solid black; - flex-grow: 2; - margin-bottom: 0; + border: 1px solid black; + flex-grow: 2; + margin-bottom: 0; } - .tox:not([dir=rtl]) .tox-sv-palette { - margin-right: 15px; + margin-right: 15px; } - .tox:not([dir=rtl]) .tox-hue-slider { - margin-right: 15px; + margin-right: 15px; } - .tox:not([dir=rtl]) .tox-hue-slider-thumb { - margin-left: -1px; + margin-left: -1px; } - .tox:not([dir=rtl]) .tox-rgb-form label { - margin-right: 0.5em; + margin-right: 0.5em; } - .tox[dir=rtl] .tox-sv-palette { - margin-left: 15px; + margin-left: 15px; } - .tox[dir=rtl] .tox-hue-slider { - margin-left: 15px; + margin-left: 15px; } - .tox[dir=rtl] .tox-hue-slider-thumb { - margin-right: -1px; + margin-right: -1px; } - .tox[dir=rtl] .tox-rgb-form label { - margin-left: 0.5em; + margin-left: 0.5em; } - .tox .tox-toolbar .tox-swatches, .tox .tox-toolbar__primary .tox-swatches, .tox .tox-toolbar__overflow .tox-swatches { - margin: 2px 0 3px 4px; + margin: 2px 0 3px 4px; } - .tox .tox-collection--list .tox-collection__group .tox-swatches-menu { - border: 0; - margin: -4px 0; + border: 0; + margin: -4px 0; } - .tox .tox-swatches__row { - display: flex; + display: flex; } - .tox .tox-swatch { - height: 30px; - transition: transform 0.15s, box-shadow 0.15s; - width: 30px; + height: 30px; + transition: transform 0.15s, box-shadow 0.15s; + width: 30px; } - .tox .tox-swatch:hover, .tox .tox-swatch:focus { - box-shadow: 0 0 0 1px rgba(127, 127, 127, 0.3) inset; - transform: scale(0.8); + box-shadow: 0 0 0 1px rgba(127, 127, 127, 0.3) inset; + transform: scale(0.8); } - .tox .tox-swatch--remove { - align-items: center; - display: flex; - justify-content: center; + align-items: center; + display: flex; + justify-content: center; } - .tox .tox-swatch--remove svg path { - stroke: #e74c3c; + stroke: #e74c3c; } - .tox .tox-swatches__picker-btn { - align-items: center; - background-color: transparent; - border: 0; - cursor: pointer; - display: flex; - height: 30px; - justify-content: center; - outline: none; - padding: 0; - width: 30px; -} - + align-items: center; + background-color: transparent; + border: 0; + cursor: pointer; + display: flex; + height: 30px; + justify-content: center; + outline: none; + padding: 0; + width: 30px; +} .tox .tox-swatches__picker-btn svg { - height: 24px; - width: 24px; + height: 24px; + width: 24px; } - .tox .tox-swatches__picker-btn:hover { - background: #4a5562; + background: #4a5562; } - .tox:not([dir=rtl]) .tox-swatches__picker-btn { - margin-left: auto; + margin-left: auto; } - .tox[dir=rtl] .tox-swatches__picker-btn { - margin-right: auto; + margin-right: auto; } - .tox .tox-comment-thread { - background: #2b3b4e; - position: relative; + background: #2b3b4e; + position: relative; } - .tox .tox-comment-thread > *:not(:first-child) { - margin-top: 8px; + margin-top: 8px; } - .tox .tox-comment { - background: #2b3b4e; - border: 1px solid #000000; - border-radius: 3px; - box-shadow: 0 4px 8px 0 rgba(42, 55, 70, 0.1); - padding: 8px 8px 16px 8px; - position: relative; -} - + background: #2b3b4e; + border: 1px solid #000000; + border-radius: 3px; + box-shadow: 0 4px 8px 0 rgba(42, 55, 70, 0.1); + padding: 8px 8px 16px 8px; + position: relative; +} .tox .tox-comment__header { - align-items: center; - color: #fff; - display: flex; - justify-content: space-between; + align-items: center; + color: #fff; + display: flex; + justify-content: space-between; } - .tox .tox-comment__date { - color: rgba(255, 255, 255, 0.5); - font-size: 12px; + color: rgba(255, 255, 255, 0.5); + font-size: 12px; } - .tox .tox-comment__body { - color: #fff; - font-size: 14px; - font-style: normal; - font-weight: normal; - line-height: 1.3; - margin-top: 8px; - position: relative; - text-transform: initial; -} - + color: #fff; + font-size: 14px; + font-style: normal; + font-weight: normal; + line-height: 1.3; + margin-top: 8px; + position: relative; + text-transform: initial; +} .tox .tox-comment__body textarea { - resize: none; - white-space: normal; - width: 100%; + resize: none; + white-space: normal; + width: 100%; } - .tox .tox-comment__expander { - padding-top: 8px; + padding-top: 8px; } - .tox .tox-comment__expander p { - color: rgba(255, 255, 255, 0.5); - font-size: 14px; - font-style: normal; + color: rgba(255, 255, 255, 0.5); + font-size: 14px; + font-style: normal; } - .tox .tox-comment__body p { - margin: 0; + margin: 0; } - .tox .tox-comment__buttonspacing { - padding-top: 16px; - text-align: center; + padding-top: 16px; + text-align: center; } - .tox .tox-comment-thread__overlay::after { - background: #2b3b4e; - bottom: 0; - content: ""; - display: flex; - left: 0; - opacity: 0.9; - position: absolute; - right: 0; - top: 0; - z-index: 5; -} - + background: #2b3b4e; + bottom: 0; + content: ""; + display: flex; + left: 0; + opacity: 0.9; + position: absolute; + right: 0; + top: 0; + z-index: 5; +} .tox .tox-comment__reply { - display: flex; - flex-shrink: 0; - flex-wrap: wrap; - justify-content: flex-end; - margin-top: 8px; + display: flex; + flex-shrink: 0; + flex-wrap: wrap; + justify-content: flex-end; + margin-top: 8px; } - .tox .tox-comment__reply > *:first-child { - margin-bottom: 8px; - width: 100%; + margin-bottom: 8px; + width: 100%; } - .tox .tox-comment__edit { - display: flex; - flex-wrap: wrap; - justify-content: flex-end; - margin-top: 16px; + display: flex; + flex-wrap: wrap; + justify-content: flex-end; + margin-top: 16px; } - .tox .tox-comment__gradient::after { - background: linear-gradient(rgba(43, 59, 78, 0), #2b3b4e); - bottom: 0; - content: ""; - display: block; - height: 5em; - margin-top: -40px; - position: absolute; - width: 100%; -} - + background: linear-gradient(rgba(43, 59, 78, 0), #2b3b4e); + bottom: 0; + content: ""; + display: block; + height: 5em; + margin-top: -40px; + position: absolute; + width: 100%; +} .tox .tox-comment__overlay { - background: #2b3b4e; - bottom: 0; - display: flex; - flex-direction: column; - flex-grow: 1; - left: 0; - opacity: 0.9; - position: absolute; - right: 0; - text-align: center; - top: 0; - z-index: 5; -} - + background: #2b3b4e; + bottom: 0; + display: flex; + flex-direction: column; + flex-grow: 1; + left: 0; + opacity: 0.9; + position: absolute; + right: 0; + text-align: center; + top: 0; + z-index: 5; +} .tox .tox-comment__loading-text { - align-items: center; - color: #fff; - display: flex; - flex-direction: column; - position: relative; + align-items: center; + color: #fff; + display: flex; + flex-direction: column; + position: relative; } - .tox .tox-comment__loading-text > div { - padding-bottom: 16px; + padding-bottom: 16px; } - .tox .tox-comment__overlaytext { - bottom: 0; - flex-direction: column; - font-size: 14px; - left: 0; - padding: 1em; - position: absolute; - right: 0; - top: 0; - z-index: 10; -} - + bottom: 0; + flex-direction: column; + font-size: 14px; + left: 0; + padding: 1em; + position: absolute; + right: 0; + top: 0; + z-index: 10; +} .tox .tox-comment__overlaytext p { - background-color: #2b3b4e; - box-shadow: 0 0 8px 8px #2b3b4e; - color: #fff; - text-align: center; + background-color: #2b3b4e; + box-shadow: 0 0 8px 8px #2b3b4e; + color: #fff; + text-align: center; } - .tox .tox-comment__overlaytext div:nth-of-type(2) { - font-size: 0.8em; + font-size: 0.8em; } - .tox .tox-comment__busy-spinner { - align-items: center; - background-color: #2b3b4e; - bottom: 0; - display: flex; - justify-content: center; - left: 0; - position: absolute; - right: 0; - top: 0; - z-index: 20; -} - + align-items: center; + background-color: #2b3b4e; + bottom: 0; + display: flex; + justify-content: center; + left: 0; + position: absolute; + right: 0; + top: 0; + z-index: 20; +} .tox .tox-comment__scroll { - display: flex; - flex-direction: column; - flex-shrink: 1; - overflow: auto; + display: flex; + flex-direction: column; + flex-shrink: 1; + overflow: auto; } - .tox .tox-conversations { - margin: 8px; + margin: 8px; } - .tox:not([dir=rtl]) .tox-comment__edit { - margin-left: 8px; + margin-left: 8px; } - .tox:not([dir=rtl]) .tox-comment__buttonspacing > *:last-child, .tox:not([dir=rtl]) .tox-comment__edit > *:last-child, .tox:not([dir=rtl]) .tox-comment__reply > *:last-child { - margin-left: 8px; + margin-left: 8px; } - .tox[dir=rtl] .tox-comment__edit { - margin-right: 8px; + margin-right: 8px; } - .tox[dir=rtl] .tox-comment__buttonspacing > *:last-child, .tox[dir=rtl] .tox-comment__edit > *:last-child, .tox[dir=rtl] .tox-comment__reply > *:last-child { - margin-right: 8px; + margin-right: 8px; } - .tox .tox-user { - align-items: center; - display: flex; + align-items: center; + display: flex; } - .tox .tox-user__avatar svg { - fill: rgba(255, 255, 255, 0.5); + fill: rgba(255, 255, 255, 0.5); } - .tox .tox-user__name { - color: rgba(255, 255, 255, 0.5); - font-size: 12px; - font-style: normal; - font-weight: bold; - text-transform: uppercase; + color: rgba(255, 255, 255, 0.5); + font-size: 12px; + font-style: normal; + font-weight: bold; + text-transform: uppercase; } - .tox:not([dir=rtl]) .tox-user__avatar svg { - margin-right: 8px; + margin-right: 8px; } - .tox:not([dir=rtl]) .tox-user__avatar + .tox-user__name { - margin-left: 8px; + margin-left: 8px; } - .tox[dir=rtl] .tox-user__avatar svg { - margin-left: 8px; + margin-left: 8px; } - .tox[dir=rtl] .tox-user__avatar + .tox-user__name { - margin-right: 8px; + margin-right: 8px; } - .tox .tox-dialog-wrap { - align-items: center; - bottom: 0; - display: flex; - justify-content: center; - left: 0; - position: fixed; - right: 0; - top: 0; - z-index: 1100; -} - + align-items: center; + bottom: 0; + display: flex; + justify-content: center; + left: 0; + position: fixed; + right: 0; + top: 0; + z-index: 1100; +} .tox .tox-dialog-wrap__backdrop { - background-color: rgba(34, 47, 62, 0.75); - bottom: 0; - left: 0; - position: absolute; - right: 0; - top: 0; - z-index: 1; -} - + background-color: rgba(34, 47, 62, 0.75); + bottom: 0; + left: 0; + position: absolute; + right: 0; + top: 0; + z-index: 1; +} .tox .tox-dialog-wrap__backdrop--opaque { - background-color: #222f3e; + background-color: #222f3e; } - .tox .tox-dialog { - background-color: #2b3b4e; - border-color: #000000; - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: 0 16px 16px -10px rgba(42, 55, 70, 0.15), 0 0 40px 1px rgba(42, 55, 70, 0.15); - display: flex; - flex-direction: column; - max-height: 100%; - max-width: 480px; - overflow: hidden; - position: relative; - width: 95vw; - z-index: 2; -} - -@media only screen and (max-width: 767px) { - body:not(.tox-force-desktop) .tox .tox-dialog { - align-self: flex-start; - margin: 8px auto; - width: calc(100vw - 16px); - } -} - + background-color: #2b3b4e; + border-color: #000000; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: 0 16px 16px -10px rgba(42, 55, 70, 0.15), 0 0 40px 1px rgba(42, 55, 70, 0.15); + display: flex; + flex-direction: column; + max-height: 100%; + max-width: 480px; + overflow: hidden; + position: relative; + width: 95vw; + z-index: 2; +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox .tox-dialog { + align-self: flex-start; + margin: 8px auto; + width: calc(100vw - 16px); + } +} .tox .tox-dialog-inline { - z-index: 1100; + z-index: 1100; } - .tox .tox-dialog__header { - align-items: center; - background-color: #2b3b4e; - border-bottom: none; - color: #fff; - display: flex; - font-size: 16px; - justify-content: space-between; - padding: 8px 16px 0 16px; - position: relative; -} - + align-items: center; + background-color: #2b3b4e; + border-bottom: none; + color: #fff; + display: flex; + font-size: 16px; + justify-content: space-between; + padding: 8px 16px 0 16px; + position: relative; +} .tox .tox-dialog__header .tox-button { - z-index: 1; + z-index: 1; } - .tox .tox-dialog__draghandle { - cursor: grab; - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; -} - + cursor: grab; + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} .tox .tox-dialog__draghandle:active { - cursor: grabbing; + cursor: grabbing; } - .tox .tox-dialog__dismiss { - margin-left: auto; + margin-left: auto; } - .tox .tox-dialog__title { - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 20px; - font-style: normal; - font-weight: normal; - line-height: 1.3; - margin: 0; - text-transform: none; -} - + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 20px; + font-style: normal; + font-weight: normal; + line-height: 1.3; + margin: 0; + text-transform: none; +} .tox .tox-dialog__body { - color: #fff; - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; - font-size: 16px; - font-style: normal; - font-weight: normal; - line-height: 1.3; - min-width: 0; - text-align: left; - text-transform: none; -} - -@media only screen and (max-width: 767px) { - body:not(.tox-force-desktop) .tox .tox-dialog__body { - flex-direction: column; - } -} - -.tox .tox-dialog__body-nav { - align-items: flex-start; - display: flex; + color: #fff; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; + font-size: 16px; + font-style: normal; + font-weight: normal; + line-height: 1.3; + min-width: 0; + text-align: left; + text-transform: none; +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox .tox-dialog__body { flex-direction: column; - padding: 16px 16px; -} - -@media only screen and (max-width: 767px) { - body:not(.tox-force-desktop) .tox .tox-dialog__body-nav { - flex-direction: row; - -webkit-overflow-scrolling: touch; - overflow-x: auto; - padding-bottom: 0; - } -} - + } +} +.tox .tox-dialog__body-nav { + align-items: flex-start; + display: flex; + flex-direction: column; + padding: 16px 16px; +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox .tox-dialog__body-nav { + flex-direction: row; + -webkit-overflow-scrolling: touch; + overflow-x: auto; + padding-bottom: 0; + } +} .tox .tox-dialog__body-nav-item { - border-bottom: 2px solid transparent; - color: rgba(255, 255, 255, 0.5); - display: inline-block; - font-size: 14px; - line-height: 1.3; - margin-bottom: 8px; - text-decoration: none; - white-space: nowrap; -} - + border-bottom: 2px solid transparent; + color: rgba(255, 255, 255, 0.5); + display: inline-block; + font-size: 14px; + line-height: 1.3; + margin-bottom: 8px; + text-decoration: none; + white-space: nowrap; +} .tox .tox-dialog__body-nav-item:focus { - background-color: rgba(32, 122, 183, 0.1); + background-color: rgba(32, 122, 183, 0.1); } - .tox .tox-dialog__body-nav-item--active { - border-bottom: 2px solid #207ab7; - color: #207ab7; + border-bottom: 2px solid #207ab7; + color: #207ab7; } - .tox .tox-dialog__body-content { - box-sizing: border-box; - display: flex; - flex: 1; - flex-direction: column; - -ms-flex-preferred-size: auto; - max-height: 650px; - overflow: auto; - -webkit-overflow-scrolling: touch; - padding: 16px 16px; + box-sizing: border-box; + display: flex; + flex: 1; + flex-direction: column; + -ms-flex-preferred-size: auto; + max-height: 650px; + overflow: auto; + -webkit-overflow-scrolling: touch; + padding: 16px 16px; } - .tox .tox-dialog__body-content > * { - margin-bottom: 0; - margin-top: 16px; + margin-bottom: 0; + margin-top: 16px; } - .tox .tox-dialog__body-content > *:first-child { - margin-top: 0; + margin-top: 0; } - .tox .tox-dialog__body-content > *:last-child { - margin-bottom: 0; + margin-bottom: 0; } - .tox .tox-dialog__body-content > *:only-child { - margin-bottom: 0; - margin-top: 0; + margin-bottom: 0; + margin-top: 0; } - .tox .tox-dialog__body-content a { - color: #207ab7; - cursor: pointer; - text-decoration: none; + color: #207ab7; + cursor: pointer; + text-decoration: none; } - .tox .tox-dialog__body-content a:hover, .tox .tox-dialog__body-content a:focus { - color: #185d8c; - text-decoration: none; + color: #185d8c; + text-decoration: none; } - .tox .tox-dialog__body-content a:active { - color: #185d8c; - text-decoration: none; + color: #185d8c; + text-decoration: none; } - .tox .tox-dialog__body-content svg { - fill: #fff; + fill: #fff; } - .tox .tox-dialog__body-content ul { - display: block; - list-style-type: disc; - margin-bottom: 16px; - -webkit-margin-end: 0; - margin-inline-end: 0; - -webkit-margin-start: 0; - margin-inline-start: 0; - -webkit-padding-start: 2.5rem; - padding-inline-start: 2.5rem; -} - + display: block; + list-style-type: disc; + margin-bottom: 16px; + -webkit-margin-end: 0; + margin-inline-end: 0; + -webkit-margin-start: 0; + margin-inline-start: 0; + -webkit-padding-start: 2.5rem; + padding-inline-start: 2.5rem; +} .tox .tox-dialog__body-content .tox-form__group h1 { - color: #fff; - font-size: 20px; - font-style: normal; - font-weight: bold; - letter-spacing: normal; - margin-bottom: 16px; - margin-top: 2rem; - text-transform: none; -} - + color: #fff; + font-size: 20px; + font-style: normal; + font-weight: bold; + letter-spacing: normal; + margin-bottom: 16px; + margin-top: 2rem; + text-transform: none; +} .tox .tox-dialog__body-content .tox-form__group h2 { - color: #fff; - font-size: 16px; - font-style: normal; - font-weight: bold; - letter-spacing: normal; - margin-bottom: 16px; - margin-top: 2rem; - text-transform: none; -} - + color: #fff; + font-size: 16px; + font-style: normal; + font-weight: bold; + letter-spacing: normal; + margin-bottom: 16px; + margin-top: 2rem; + text-transform: none; +} .tox .tox-dialog__body-content .tox-form__group p { - margin-bottom: 16px; + margin-bottom: 16px; } - .tox .tox-dialog__body-content .tox-form__group h1:first-child, .tox .tox-dialog__body-content .tox-form__group h2:first-child, .tox .tox-dialog__body-content .tox-form__group p:first-child { - margin-top: 0; + margin-top: 0; } - .tox .tox-dialog__body-content .tox-form__group h1:last-child, .tox .tox-dialog__body-content .tox-form__group h2:last-child, .tox .tox-dialog__body-content .tox-form__group p:last-child { - margin-bottom: 0; + margin-bottom: 0; } - .tox .tox-dialog__body-content .tox-form__group h1:only-child, .tox .tox-dialog__body-content .tox-form__group h2:only-child, .tox .tox-dialog__body-content .tox-form__group p:only-child { - margin-bottom: 0; - margin-top: 0; + margin-bottom: 0; + margin-top: 0; } - .tox .tox-dialog--width-lg { - height: 650px; - max-width: 1200px; + height: 650px; + max-width: 1200px; } - .tox .tox-dialog--width-md { - max-width: 800px; + max-width: 800px; } - .tox .tox-dialog--width-md .tox-dialog__body-content { - overflow: auto; + overflow: auto; } - .tox .tox-dialog__body-content--centered { - text-align: center; + text-align: center; } - .tox .tox-dialog__footer { - align-items: center; - background-color: #2b3b4e; - border-top: 1px solid #000000; - display: flex; - justify-content: space-between; - padding: 8px 16px; -} - + align-items: center; + background-color: #2b3b4e; + border-top: 1px solid #000000; + display: flex; + justify-content: space-between; + padding: 8px 16px; +} .tox .tox-dialog__footer-start, .tox .tox-dialog__footer-end { - display: flex; + display: flex; } - .tox .tox-dialog__busy-spinner { - align-items: center; - background-color: rgba(34, 47, 62, 0.75); - bottom: 0; - display: flex; - justify-content: center; - left: 0; - position: absolute; - right: 0; - top: 0; - z-index: 3; -} - + align-items: center; + background-color: rgba(34, 47, 62, 0.75); + bottom: 0; + display: flex; + justify-content: center; + left: 0; + position: absolute; + right: 0; + top: 0; + z-index: 3; +} .tox .tox-dialog__table { - border-collapse: collapse; - width: 100%; + border-collapse: collapse; + width: 100%; } - .tox .tox-dialog__table thead th { - font-weight: bold; - padding-bottom: 8px; + font-weight: bold; + padding-bottom: 8px; } - .tox .tox-dialog__table tbody tr { - border-bottom: 1px solid #000000; + border-bottom: 1px solid #000000; } - .tox .tox-dialog__table tbody tr:last-child { - border-bottom: none; + border-bottom: none; } - .tox .tox-dialog__table td { - padding-bottom: 8px; - padding-top: 8px; + padding-bottom: 8px; + padding-top: 8px; } - .tox .tox-dialog__popups { - position: absolute; - width: 100%; - z-index: 1100; + position: absolute; + width: 100%; + z-index: 1100; } - .tox .tox-dialog__body-iframe { - display: flex; - flex: 1; - flex-direction: column; - -ms-flex-preferred-size: auto; + display: flex; + flex: 1; + flex-direction: column; + -ms-flex-preferred-size: auto; } - .tox .tox-dialog__body-iframe .tox-navobj { - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; } - .tox .tox-dialog__body-iframe .tox-navobj :nth-child(2) { - flex: 1; - -ms-flex-preferred-size: auto; - height: 100%; + flex: 1; + -ms-flex-preferred-size: auto; + height: 100%; } - .tox .tox-dialog-dock-fadeout { - opacity: 0; - visibility: hidden; + opacity: 0; + visibility: hidden; } - .tox .tox-dialog-dock-fadein { - opacity: 1; - visibility: visible; + opacity: 1; + visibility: visible; } - .tox .tox-dialog-dock-transition { - transition: visibility 0s linear 0.3s, opacity 0.3s ease; + transition: visibility 0s linear 0.3s, opacity 0.3s ease; } - .tox .tox-dialog-dock-transition.tox-dialog-dock-fadein { - transition-delay: 0s; + transition-delay: 0s; } - .tox.tox-platform-ie { - /* IE11 CSS styles go here */ + /* IE11 CSS styles go here */ } - .tox.tox-platform-ie .tox-dialog-wrap { - position: -ms-device-fixed; + position: -ms-device-fixed; } - -@media only screen and (max-width: 767px) { - body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav { - margin-right: 0; - } +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav { + margin-right: 0; + } } - -@media only screen and (max-width: 767px) { - body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav-item:not(:first-child) { - margin-left: 8px; - } +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav-item:not(:first-child) { + margin-left: 8px; + } } - .tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-start > *, .tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-end > * { - margin-left: 8px; + margin-left: 8px; } - .tox[dir=rtl] .tox-dialog__body { - text-align: right; + text-align: right; } - -@media only screen and (max-width: 767px) { - body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav { - margin-left: 0; - } +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav { + margin-left: 0; + } } - -@media only screen and (max-width: 767px) { - body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav-item:not(:first-child) { - margin-right: 8px; - } +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav-item:not(:first-child) { + margin-right: 8px; + } } - .tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-start > *, .tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-end > * { - margin-right: 8px; + margin-right: 8px; } - body.tox-dialog__disable-scroll { - overflow: hidden; + overflow: hidden; } - .tox .tox-dropzone-container { - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; } - .tox .tox-dropzone { - align-items: center; - background: #fff; - border: 2px dashed #000000; - box-sizing: border-box; - display: flex; - flex-direction: column; - flex-grow: 1; - justify-content: center; - min-height: 100px; - padding: 10px; + align-items: center; + background: #fff; + border: 2px dashed #000000; + box-sizing: border-box; + display: flex; + flex-direction: column; + flex-grow: 1; + justify-content: center; + min-height: 100px; + padding: 10px; } - .tox .tox-dropzone p { - color: rgba(255, 255, 255, 0.5); - margin: 0 0 16px 0; + color: rgba(255, 255, 255, 0.5); + margin: 0 0 16px 0; } - .tox .tox-edit-area { - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; - overflow: hidden; - position: relative; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; + overflow: hidden; + position: relative; } - .tox .tox-edit-area__iframe { - background-color: #fff; - border: 0; - box-sizing: border-box; - flex: 1; - -ms-flex-preferred-size: auto; - height: 100%; - position: absolute; - width: 100%; -} - + background-color: #fff; + border: 0; + box-sizing: border-box; + flex: 1; + -ms-flex-preferred-size: auto; + height: 100%; + position: absolute; + width: 100%; +} .tox.tox-inline-edit-area { - border: 1px dotted #000000; + border: 1px dotted #000000; } - .tox .tox-editor-container { - display: flex; - flex: 1 1 auto; - flex-direction: column; - overflow: hidden; + display: flex; + flex: 1 1 auto; + flex-direction: column; + overflow: hidden; } - .tox .tox-editor-header { - z-index: 1; + z-index: 1; } - .tox:not(.tox-tinymce-inline) .tox-editor-header { - box-shadow: none; - transition: box-shadow 0.5s; + box-shadow: none; + transition: box-shadow 0.5s; } - .tox.tox-tinymce--toolbar-bottom .tox-editor-header, .tox.tox-tinymce-inline .tox-editor-header { - margin-bottom: -1px; + margin-bottom: -1px; } - .tox.tox-tinymce--toolbar-sticky-on .tox-editor-header { - box-shadow: 0 4px 4px -3px rgba(0, 0, 0, 0.25); + box-shadow: 0 4px 4px -3px rgba(0, 0, 0, 0.25); } - .tox-editor-dock-fadeout { - opacity: 0; - visibility: hidden; + opacity: 0; + visibility: hidden; } - .tox-editor-dock-fadein { - opacity: 1; - visibility: visible; + opacity: 1; + visibility: visible; } - .tox-editor-dock-transition { - transition: visibility 0s linear 0.25s, opacity 0.25s ease; + transition: visibility 0s linear 0.25s, opacity 0.25s ease; } - .tox-editor-dock-transition.tox-editor-dock-fadein { - transition-delay: 0s; + transition-delay: 0s; } - .tox .tox-control-wrap { - flex: 1; - position: relative; + flex: 1; + position: relative; } - .tox .tox-control-wrap:not(.tox-control-wrap--status-invalid) .tox-control-wrap__status-icon-invalid, .tox .tox-control-wrap:not(.tox-control-wrap--status-unknown) .tox-control-wrap__status-icon-unknown, .tox .tox-control-wrap:not(.tox-control-wrap--status-valid) .tox-control-wrap__status-icon-valid { - display: none; + display: none; } - .tox .tox-control-wrap svg { - display: block; + display: block; } - .tox .tox-control-wrap__status-icon-wrap { - position: absolute; - top: 50%; - transform: translateY(-50%); + position: absolute; + top: 50%; + transform: translateY(-50%); } - .tox .tox-control-wrap__status-icon-invalid svg { - fill: #c00; + fill: #c00; } - .tox .tox-control-wrap__status-icon-unknown svg { - fill: orange; + fill: orange; } - .tox .tox-control-wrap__status-icon-valid svg { - fill: green; + fill: green; } - .tox:not([dir=rtl]) .tox-control-wrap--status-invalid .tox-textfield, .tox:not([dir=rtl]) .tox-control-wrap--status-unknown .tox-textfield, .tox:not([dir=rtl]) .tox-control-wrap--status-valid .tox-textfield { - padding-right: 32px; + padding-right: 32px; } - .tox:not([dir=rtl]) .tox-control-wrap__status-icon-wrap { - right: 4px; + right: 4px; } - .tox[dir=rtl] .tox-control-wrap--status-invalid .tox-textfield, .tox[dir=rtl] .tox-control-wrap--status-unknown .tox-textfield, .tox[dir=rtl] .tox-control-wrap--status-valid .tox-textfield { - padding-left: 32px; + padding-left: 32px; } - .tox[dir=rtl] .tox-control-wrap__status-icon-wrap { - left: 4px; + left: 4px; } - .tox .tox-autocompleter { - max-width: 25em; + max-width: 25em; } - .tox .tox-autocompleter .tox-menu { - max-width: 25em; + max-width: 25em; } - .tox .tox-autocompleter .tox-autocompleter-highlight { - font-weight: bold; + font-weight: bold; } - .tox .tox-color-input { - display: flex; - position: relative; - z-index: 1; + display: flex; + position: relative; + z-index: 1; } - .tox .tox-color-input .tox-textfield { - z-index: -1; + z-index: -1; } - .tox .tox-color-input span { - border-color: rgba(42, 55, 70, 0.2); - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: none; - box-sizing: border-box; - height: 24px; - position: absolute; - top: 6px; - width: 24px; -} - + border-color: rgba(42, 55, 70, 0.2); + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + box-sizing: border-box; + height: 24px; + position: absolute; + top: 6px; + width: 24px; +} .tox .tox-color-input span:hover:not([aria-disabled=true]), .tox .tox-color-input span:focus:not([aria-disabled=true]) { - border-color: #207ab7; - cursor: pointer; + border-color: #207ab7; + cursor: pointer; } - .tox .tox-color-input span::before { - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.25) 25%, transparent 25%), linear-gradient(-45deg, rgba(255, 255, 255, 0.25) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.25) 75%), linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.25) 75%); - background-position: 0 0, 0 6px, 6px -6px, -6px 0; - background-size: 12px 12px; - border: 1px solid #2b3b4e; - border-radius: 3px; - box-sizing: border-box; - content: ''; - height: 24px; - left: -1px; - position: absolute; - top: -1px; - width: 24px; - z-index: -1; -} - + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.25) 25%, transparent 25%), linear-gradient(-45deg, rgba(255, 255, 255, 0.25) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.25) 75%), linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.25) 75%); + background-position: 0 0, 0 6px, 6px -6px, -6px 0; + background-size: 12px 12px; + border: 1px solid #2b3b4e; + border-radius: 3px; + box-sizing: border-box; + content: ''; + height: 24px; + left: -1px; + position: absolute; + top: -1px; + width: 24px; + z-index: -1; +} .tox .tox-color-input span[aria-disabled=true] { - cursor: not-allowed; + cursor: not-allowed; } - .tox:not([dir=rtl]) .tox-color-input { - /* stylelint-disable-next-line no-descending-specificity */ + /* stylelint-disable-next-line no-descending-specificity */ } - .tox:not([dir=rtl]) .tox-color-input .tox-textfield { - padding-left: 36px; + padding-left: 36px; } - .tox:not([dir=rtl]) .tox-color-input span { - left: 6px; + left: 6px; } - .tox[dir="rtl"] .tox-color-input { - /* stylelint-disable-next-line no-descending-specificity */ + /* stylelint-disable-next-line no-descending-specificity */ } - .tox[dir="rtl"] .tox-color-input .tox-textfield { - padding-right: 36px; + padding-right: 36px; } - .tox[dir="rtl"] .tox-color-input span { - right: 6px; + right: 6px; } - .tox .tox-label, .tox .tox-toolbar-label { - color: rgba(255, 255, 255, 0.5); - display: block; - font-size: 14px; - font-style: normal; - font-weight: normal; - line-height: 1.3; - padding: 0 8px 0 0; - text-transform: none; - white-space: nowrap; -} - + color: rgba(255, 255, 255, 0.5); + display: block; + font-size: 14px; + font-style: normal; + font-weight: normal; + line-height: 1.3; + padding: 0 8px 0 0; + text-transform: none; + white-space: nowrap; +} .tox .tox-toolbar-label { - padding: 0 8px; + padding: 0 8px; } - .tox[dir=rtl] .tox-label { - padding: 0 0 0 8px; + padding: 0 0 0 8px; } - .tox .tox-form { - display: flex; - flex: 1; - flex-direction: column; - -ms-flex-preferred-size: auto; + display: flex; + flex: 1; + flex-direction: column; + -ms-flex-preferred-size: auto; } - .tox .tox-form__group { - box-sizing: border-box; - margin-bottom: 4px; + box-sizing: border-box; + margin-bottom: 4px; } - .tox .tox-form-group--maximize { - flex: 1; + flex: 1; } - .tox .tox-form__group--error { - color: #c00; + color: #c00; } - .tox .tox-form__group--collection { - display: flex; + display: flex; } - .tox .tox-form__grid { - display: flex; - flex-direction: row; - flex-wrap: wrap; - justify-content: space-between; + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between; } - .tox .tox-form__grid--2col > .tox-form__group { - width: calc(50% - (8px / 2)); + width: calc(50% - (8px / 2)); } - .tox .tox-form__grid--3col > .tox-form__group { - width: calc(100% / 3 - (8px / 2)); + width: calc(100% / 3 - (8px / 2)); } - .tox .tox-form__grid--4col > .tox-form__group { - width: calc(25% - (8px / 2)); + width: calc(25% - (8px / 2)); } - .tox .tox-form__controls-h-stack { - align-items: center; - display: flex; + align-items: center; + display: flex; } - .tox .tox-form__group--inline { - align-items: center; - display: flex; + align-items: center; + display: flex; } - .tox .tox-form__group--stretched { - display: flex; - flex: 1; - flex-direction: column; - -ms-flex-preferred-size: auto; + display: flex; + flex: 1; + flex-direction: column; + -ms-flex-preferred-size: auto; } - .tox .tox-form__group--stretched .tox-textarea { - flex: 1; - -ms-flex-preferred-size: auto; + flex: 1; + -ms-flex-preferred-size: auto; } - .tox .tox-form__group--stretched .tox-navobj { - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; } - .tox .tox-form__group--stretched .tox-navobj :nth-child(2) { - flex: 1; - -ms-flex-preferred-size: auto; - height: 100%; + flex: 1; + -ms-flex-preferred-size: auto; + height: 100%; } - .tox:not([dir=rtl]) .tox-form__controls-h-stack > *:not(:first-child) { - margin-left: 4px; + margin-left: 4px; } - .tox[dir=rtl] .tox-form__controls-h-stack > *:not(:first-child) { - margin-right: 4px; + margin-right: 4px; } - .tox .tox-lock.tox-locked .tox-lock-icon__unlock, .tox .tox-lock:not(.tox-locked) .tox-lock-icon__lock { - display: none; + display: none; } - .tox .tox-textfield, .tox .tox-toolbar-textfield, .tox .tox-listboxfield .tox-listbox--select, .tox .tox-textarea { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #2b3b4e; - border-color: #000000; - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: none; - box-sizing: border-box; - color: #fff; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 16px; - line-height: 24px; - margin: 0; - min-height: 34px; - outline: none; - padding: 5px 4.75px; - resize: none; - width: 100%; -} - + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background-color: #2b3b4e; + border-color: #000000; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + box-sizing: border-box; + color: #fff; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 16px; + line-height: 24px; + margin: 0; + min-height: 34px; + outline: none; + padding: 5px 4.75px; + resize: none; + width: 100%; +} .tox .tox-textfield[disabled], .tox .tox-textarea[disabled] { - background-color: #222f3e; - color: rgba(255, 255, 255, 0.85); - cursor: not-allowed; + background-color: #222f3e; + color: rgba(255, 255, 255, 0.85); + cursor: not-allowed; } - .tox .tox-textfield:focus, .tox .tox-listboxfield .tox-listbox--select:focus, .tox .tox-textarea:focus { - background-color: #2b3b4e; - border-color: #207ab7; - box-shadow: none; - outline: none; + background-color: #2b3b4e; + border-color: #207ab7; + box-shadow: none; + outline: none; } - .tox .tox-toolbar-textfield { - border-width: 0; - margin-bottom: 3px; - margin-top: 2px; - max-width: 250px; + border-width: 0; + margin-bottom: 3px; + margin-top: 2px; + max-width: 250px; } - .tox .tox-naked-btn { - background-color: transparent; - border: 0; - border-color: transparent; - box-shadow: unset; - color: #207ab7; - cursor: pointer; - display: block; - margin: 0; - padding: 0; -} - + background-color: transparent; + border: 0; + border-color: transparent; + box-shadow: unset; + color: #207ab7; + cursor: pointer; + display: block; + margin: 0; + padding: 0; +} .tox .tox-naked-btn svg { - display: block; - fill: #fff; + display: block; + fill: #fff; } - .tox:not([dir=rtl]) .tox-toolbar-textfield + * { - margin-left: 4px; + margin-left: 4px; } - .tox[dir=rtl] .tox-toolbar-textfield + * { - margin-right: 4px; + margin-right: 4px; } - .tox .tox-listboxfield { - cursor: pointer; - position: relative; + cursor: pointer; + position: relative; } - .tox .tox-listboxfield .tox-listbox--select[disabled] { - background-color: #19232e; - color: rgba(255, 255, 255, 0.85); - cursor: not-allowed; + background-color: #19232e; + color: rgba(255, 255, 255, 0.85); + cursor: not-allowed; } - .tox .tox-listbox__select-label { - cursor: default; - flex: 1; - margin: 0 4px; + cursor: default; + flex: 1; + margin: 0 4px; } - .tox .tox-listbox__select-chevron { - align-items: center; - display: flex; - justify-content: center; - width: 16px; + align-items: center; + display: flex; + justify-content: center; + width: 16px; } - .tox .tox-listbox__select-chevron svg { - fill: #fff; + fill: #fff; } - .tox .tox-listboxfield .tox-listbox--select { - align-items: center; - display: flex; + align-items: center; + display: flex; } - .tox:not([dir=rtl]) .tox-listboxfield svg { - right: 8px; + right: 8px; } - .tox[dir=rtl] .tox-listboxfield svg { - left: 8px; + left: 8px; } - .tox .tox-selectfield { - cursor: pointer; - position: relative; + cursor: pointer; + position: relative; } - .tox .tox-selectfield select { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #2b3b4e; - border-color: #000000; - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: none; - box-sizing: border-box; - color: #fff; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 16px; - line-height: 24px; - margin: 0; - min-height: 34px; - outline: none; - padding: 5px 4.75px; - resize: none; - width: 100%; -} - + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background-color: #2b3b4e; + border-color: #000000; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + box-sizing: border-box; + color: #fff; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 16px; + line-height: 24px; + margin: 0; + min-height: 34px; + outline: none; + padding: 5px 4.75px; + resize: none; + width: 100%; +} .tox .tox-selectfield select[disabled] { - background-color: #19232e; - color: rgba(255, 255, 255, 0.85); - cursor: not-allowed; + background-color: #19232e; + color: rgba(255, 255, 255, 0.85); + cursor: not-allowed; } - .tox .tox-selectfield select::-ms-expand { - display: none; + display: none; } - .tox .tox-selectfield select:focus { - background-color: #2b3b4e; - border-color: #207ab7; - box-shadow: none; - outline: none; + background-color: #2b3b4e; + border-color: #207ab7; + box-shadow: none; + outline: none; } - .tox .tox-selectfield svg { - pointer-events: none; - position: absolute; - top: 50%; - transform: translateY(-50%); + pointer-events: none; + position: absolute; + top: 50%; + transform: translateY(-50%); } - .tox:not([dir=rtl]) .tox-selectfield select[size="0"], .tox:not([dir=rtl]) .tox-selectfield select[size="1"] { - padding-right: 24px; + padding-right: 24px; } - .tox:not([dir=rtl]) .tox-selectfield svg { - right: 8px; + right: 8px; } - .tox[dir=rtl] .tox-selectfield select[size="0"], .tox[dir=rtl] .tox-selectfield select[size="1"] { - padding-left: 24px; + padding-left: 24px; } - .tox[dir=rtl] .tox-selectfield svg { - left: 8px; + left: 8px; } - .tox .tox-textarea { - -webkit-appearance: textarea; - -moz-appearance: textarea; - appearance: textarea; - white-space: pre-wrap; + -webkit-appearance: textarea; + -moz-appearance: textarea; + appearance: textarea; + white-space: pre-wrap; } - .tox-fullscreen { - border: 0; - height: 100%; - left: 0; - margin: 0; - overflow: hidden; - -ms-scroll-chaining: none; - overscroll-behavior: none; - padding: 0; - position: fixed; - top: 0; - touch-action: pinch-zoom; - width: 100%; -} - + border: 0; + height: 100%; + left: 0; + margin: 0; + overflow: hidden; + -ms-scroll-chaining: none; + overscroll-behavior: none; + padding: 0; + position: fixed; + top: 0; + touch-action: pinch-zoom; + width: 100%; +} .tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle { - display: none; + display: none; } - .tox.tox-tinymce.tox-fullscreen { - z-index: 1200; + z-index: 1200; } - .tox-shadowhost.tox-fullscreen { - z-index: 1200; + z-index: 1200; } - .tox-fullscreen .tox.tox-tinymce-aux, .tox-fullscreen ~ .tox.tox-tinymce-aux { - z-index: 1201; + z-index: 1201; } - .tox .tox-help__more-link { - list-style: none; - margin-top: 1em; + list-style: none; + margin-top: 1em; } - .tox .tox-image-tools { - width: 100%; + width: 100%; } - .tox .tox-image-tools__toolbar { - align-items: center; - display: flex; - justify-content: center; + align-items: center; + display: flex; + justify-content: center; } - .tox .tox-image-tools__image { - background-color: #666; - height: 380px; - overflow: auto; - position: relative; - width: 100%; + background-color: #666; + height: 380px; + overflow: auto; + position: relative; + width: 100%; } - .tox .tox-image-tools__image, .tox .tox-image-tools__image + .tox-image-tools__toolbar { - margin-top: 8px; + margin-top: 8px; } - .tox .tox-image-tools__image-bg { - background: url(data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==); + background: url(data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==); } - .tox .tox-image-tools__toolbar > .tox-spacer { - flex: 1; - -ms-flex-preferred-size: auto; + flex: 1; + -ms-flex-preferred-size: auto; } - .tox .tox-croprect-block { - background: black; - filter: alpha(opacity=50); - opacity: 0.5; - position: absolute; - zoom: 1; + background: black; + filter: alpha(opacity=50); + opacity: 0.5; + position: absolute; + zoom: 1; } - .tox .tox-croprect-handle { - border: 2px solid white; - height: 20px; - left: 0; - position: absolute; - top: 0; - width: 20px; -} - + border: 2px solid white; + height: 20px; + left: 0; + position: absolute; + top: 0; + width: 20px; +} .tox .tox-croprect-handle-move { - border: 0; - cursor: move; - position: absolute; + border: 0; + cursor: move; + position: absolute; } - .tox .tox-croprect-handle-nw { - border-width: 2px 0 0 2px; - cursor: nw-resize; - left: 100px; - margin: -2px 0 0 -2px; - top: 100px; + border-width: 2px 0 0 2px; + cursor: nw-resize; + left: 100px; + margin: -2px 0 0 -2px; + top: 100px; } - .tox .tox-croprect-handle-ne { - border-width: 2px 2px 0 0; - cursor: ne-resize; - left: 200px; - margin: -2px 0 0 -20px; - top: 100px; + border-width: 2px 2px 0 0; + cursor: ne-resize; + left: 200px; + margin: -2px 0 0 -20px; + top: 100px; } - .tox .tox-croprect-handle-sw { - border-width: 0 0 2px 2px; - cursor: sw-resize; - left: 100px; - margin: -20px 2px 0 -2px; - top: 200px; + border-width: 0 0 2px 2px; + cursor: sw-resize; + left: 100px; + margin: -20px 2px 0 -2px; + top: 200px; } - .tox .tox-croprect-handle-se { - border-width: 0 2px 2px 0; - cursor: se-resize; - left: 200px; - margin: -20px 0 0 -20px; - top: 200px; + border-width: 0 2px 2px 0; + cursor: se-resize; + left: 200px; + margin: -20px 0 0 -20px; + top: 200px; } - .tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-slider:not(:first-of-type) { - margin-left: 8px; + margin-left: 8px; } - .tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-button + .tox-slider { - margin-left: 32px; + margin-left: 32px; } - .tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-slider + .tox-button { - margin-left: 32px; + margin-left: 32px; } - .tox[dir=rtl] .tox-image-tools__toolbar > .tox-slider:not(:first-of-type) { - margin-right: 8px; + margin-right: 8px; } - .tox[dir=rtl] .tox-image-tools__toolbar > .tox-button + .tox-slider { - margin-right: 32px; + margin-right: 32px; } - .tox[dir=rtl] .tox-image-tools__toolbar > .tox-slider + .tox-button { - margin-right: 32px; + margin-right: 32px; } - .tox .tox-insert-table-picker { - display: flex; - flex-wrap: wrap; - width: 170px; + display: flex; + flex-wrap: wrap; + width: 170px; } - .tox .tox-insert-table-picker > div { - border-color: #000000; - border-style: solid; - border-width: 0 1px 1px 0; - box-sizing: border-box; - height: 17px; - width: 17px; -} - + border-color: #000000; + border-style: solid; + border-width: 0 1px 1px 0; + box-sizing: border-box; + height: 17px; + width: 17px; +} .tox .tox-collection--list .tox-collection__group .tox-insert-table-picker { - margin: -4px 0; + margin: -4px 0; } - .tox .tox-insert-table-picker .tox-insert-table-picker__selected { - background-color: rgba(32, 122, 183, 0.5); - border-color: rgba(32, 122, 183, 0.5); + background-color: rgba(32, 122, 183, 0.5); + border-color: rgba(32, 122, 183, 0.5); } - .tox .tox-insert-table-picker__label { - color: #fff; - display: block; - font-size: 14px; - padding: 4px; - text-align: center; - width: 100%; -} - + color: #fff; + display: block; + font-size: 14px; + padding: 4px; + text-align: center; + width: 100%; +} .tox:not([dir=rtl]) { - /* stylelint-disable-next-line no-descending-specificity */ + /* stylelint-disable-next-line no-descending-specificity */ } - .tox:not([dir=rtl]) .tox-insert-table-picker > div:nth-child(10n) { - border-right: 0; + border-right: 0; } - .tox[dir=rtl] { - /* stylelint-disable-next-line no-descending-specificity */ + /* stylelint-disable-next-line no-descending-specificity */ } - .tox[dir=rtl] .tox-insert-table-picker > div:nth-child(10n+1) { - border-right: 0; + border-right: 0; } - .tox { - /* stylelint-disable */ - /* stylelint-enable */ + /* stylelint-disable */ + /* stylelint-enable */ } - .tox .tox-menu { - background-color: #2b3b4e; - border: 1px solid #000000; - border-radius: 3px; - box-shadow: 0 4px 8px 0 rgba(42, 55, 70, 0.1); - display: inline-block; - overflow: hidden; - vertical-align: top; - z-index: 1150; -} - + background-color: #2b3b4e; + border: 1px solid #000000; + border-radius: 3px; + box-shadow: 0 4px 8px 0 rgba(42, 55, 70, 0.1); + display: inline-block; + overflow: hidden; + vertical-align: top; + z-index: 1150; +} .tox .tox-menu.tox-collection.tox-collection--list { - padding: 0; + padding: 0; } - .tox .tox-menu.tox-collection.tox-collection--toolbar { - padding: 4px; + padding: 4px; } - .tox .tox-menu.tox-collection.tox-collection--grid { - padding: 4px; + padding: 4px; } - .tox .tox-menu__label h1, .tox .tox-menu__label h2, .tox .tox-menu__label h3, @@ -2522,1083 +2108,917 @@ body.tox-dialog__disable-scroll { .tox .tox-menu__label p, .tox .tox-menu__label blockquote, .tox .tox-menu__label code { - margin: 0; + margin: 0; } - .tox .tox-menubar { - background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23000000'/%3E%3C/svg%3E") left 0 top 0 #222f3e; - background-color: #222f3e; - display: flex; - flex: 0 0 auto; - flex-shrink: 0; - flex-wrap: wrap; - padding: 0 4px 0 4px; -} - + background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23000000'/%3E%3C/svg%3E") left 0 top 0 #222f3e; + background-color: #222f3e; + display: flex; + flex: 0 0 auto; + flex-shrink: 0; + flex-wrap: wrap; + padding: 0 4px 0 4px; +} .tox.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-menubar { - border-top: 1px solid #000000; + border-top: 1px solid #000000; } - /* Deprecated. Remove in next major release */ .tox .tox-mbtn { - align-items: center; - background: transparent; - border: 0; - border-radius: 3px; - box-shadow: none; - color: #fff; - display: flex; - flex: 0 0 auto; - font-size: 14px; - font-style: normal; - font-weight: normal; - height: 34px; - justify-content: center; - margin: 2px 0 3px 0; - outline: none; - overflow: hidden; - padding: 0 4px; - text-transform: none; - width: auto; -} - + align-items: center; + background: transparent; + border: 0; + border-radius: 3px; + box-shadow: none; + color: #fff; + display: flex; + flex: 0 0 auto; + font-size: 14px; + font-style: normal; + font-weight: normal; + height: 34px; + justify-content: center; + margin: 2px 0 3px 0; + outline: none; + overflow: hidden; + padding: 0 4px; + text-transform: none; + width: auto; +} .tox .tox-mbtn[disabled] { - background-color: transparent; - border: 0; - box-shadow: none; - color: rgba(255, 255, 255, 0.5); - cursor: not-allowed; + background-color: transparent; + border: 0; + box-shadow: none; + color: rgba(255, 255, 255, 0.5); + cursor: not-allowed; } - .tox .tox-mbtn:focus:not(:disabled) { - background: #4a5562; - border: 0; - box-shadow: none; - color: #fff; + background: #4a5562; + border: 0; + box-shadow: none; + color: #fff; } - .tox .tox-mbtn--active { - background: #757d87; - border: 0; - box-shadow: none; - color: #fff; + background: #757d87; + border: 0; + box-shadow: none; + color: #fff; } - .tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active) { - background: #4a5562; - border: 0; - box-shadow: none; - color: #fff; + background: #4a5562; + border: 0; + box-shadow: none; + color: #fff; } - .tox .tox-mbtn__select-label { - cursor: default; - font-weight: normal; - margin: 0 4px; + cursor: default; + font-weight: normal; + margin: 0 4px; } - .tox .tox-mbtn[disabled] .tox-mbtn__select-label { - cursor: not-allowed; + cursor: not-allowed; } - .tox .tox-mbtn__select-chevron { - align-items: center; - display: flex; - justify-content: center; - width: 16px; - display: none; + align-items: center; + display: flex; + justify-content: center; + width: 16px; + display: none; } - .tox .tox-notification { - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: none; - box-sizing: border-box; - display: -ms-grid; - display: grid; - font-size: 14px; - font-weight: normal; - -ms-grid-columns: minmax(40px, 1fr) auto minmax(40px, 1fr); - grid-template-columns: minmax(40px, 1fr) auto minmax(40px, 1fr); - margin-top: 4px; - opacity: 0; - padding: 4px; - transition: transform 100ms ease-in, opacity 150ms ease-in; -} - + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + box-sizing: border-box; + display: -ms-grid; + display: grid; + font-size: 14px; + font-weight: normal; + -ms-grid-columns: minmax(40px, 1fr) auto minmax(40px, 1fr); + grid-template-columns: minmax(40px, 1fr) auto minmax(40px, 1fr); + margin-top: 4px; + opacity: 0; + padding: 4px; + transition: transform 100ms ease-in, opacity 150ms ease-in; +} .tox .tox-notification p { - font-size: 14px; - font-weight: normal; + font-size: 14px; + font-weight: normal; } - .tox .tox-notification a { - text-decoration: underline; + text-decoration: underline; } - .tox .tox-notification--in { - opacity: 1; + opacity: 1; } - .tox .tox-notification--success { - background-color: #e4eeda; - border-color: #d7e6c8; - color: #fff; + background-color: #e4eeda; + border-color: #d7e6c8; + color: #fff; } - .tox .tox-notification--success p { - color: #fff; + color: #fff; } - .tox .tox-notification--success a { - color: #547831; + color: #547831; } - .tox .tox-notification--success svg { - fill: #fff; + fill: #fff; } - .tox .tox-notification--error { - background-color: #f8dede; - border-color: #f2bfbf; - color: #fff; + background-color: #f8dede; + border-color: #f2bfbf; + color: #fff; } - .tox .tox-notification--error p { - color: #fff; + color: #fff; } - .tox .tox-notification--error a { - color: #c00; + color: #c00; } - .tox .tox-notification--error svg { - fill: #fff; + fill: #fff; } - .tox .tox-notification--warn, .tox .tox-notification--warning { - background-color: #fffaea; - border-color: #ffe89d; - color: #fff; + background-color: #fffaea; + border-color: #ffe89d; + color: #fff; } - .tox .tox-notification--warn p, .tox .tox-notification--warning p { - color: #fff; + color: #fff; } - .tox .tox-notification--warn a, .tox .tox-notification--warning a { - color: #fff; + color: #fff; } - .tox .tox-notification--warn svg, .tox .tox-notification--warning svg { - fill: #fff; + fill: #fff; } - .tox .tox-notification--info { - background-color: #d9edf7; - border-color: #779ecb; - color: #fff; + background-color: #d9edf7; + border-color: #779ecb; + color: #fff; } - .tox .tox-notification--info p { - color: #fff; + color: #fff; } - .tox .tox-notification--info a { - color: #fff; + color: #fff; } - .tox .tox-notification--info svg { - fill: #fff; + fill: #fff; } - .tox .tox-notification__body { - -ms-grid-row-align: center; - align-self: center; - color: #fff; - font-size: 14px; - -ms-grid-column-span: 1; - grid-column-end: 3; - -ms-grid-column: 2; - grid-column-start: 2; - -ms-grid-row-span: 1; - grid-row-end: 2; - -ms-grid-row: 1; - grid-row-start: 1; - text-align: center; - white-space: normal; - word-break: break-all; - word-break: break-word; -} - + -ms-grid-row-align: center; + align-self: center; + color: #fff; + font-size: 14px; + -ms-grid-column-span: 1; + grid-column-end: 3; + -ms-grid-column: 2; + grid-column-start: 2; + -ms-grid-row-span: 1; + grid-row-end: 2; + -ms-grid-row: 1; + grid-row-start: 1; + text-align: center; + white-space: normal; + word-break: break-all; + word-break: break-word; +} .tox .tox-notification__body > * { - margin: 0; + margin: 0; } - .tox .tox-notification__body > * + * { - margin-top: 1rem; + margin-top: 1rem; } - .tox .tox-notification__icon { - -ms-grid-row-align: center; - align-self: center; - -ms-grid-column-span: 1; - grid-column-end: 2; - -ms-grid-column: 1; - grid-column-start: 1; - -ms-grid-row-span: 1; - grid-row-end: 2; - -ms-grid-row: 1; - grid-row-start: 1; - -ms-grid-column-align: end; - justify-self: end; -} - + -ms-grid-row-align: center; + align-self: center; + -ms-grid-column-span: 1; + grid-column-end: 2; + -ms-grid-column: 1; + grid-column-start: 1; + -ms-grid-row-span: 1; + grid-row-end: 2; + -ms-grid-row: 1; + grid-row-start: 1; + -ms-grid-column-align: end; + justify-self: end; +} .tox .tox-notification__icon svg { - display: block; + display: block; } - .tox .tox-notification__dismiss { - -ms-grid-row-align: start; - align-self: start; - -ms-grid-column-span: 1; - grid-column-end: 4; - -ms-grid-column: 3; - grid-column-start: 3; - -ms-grid-row-span: 1; - grid-row-end: 2; - -ms-grid-row: 1; - grid-row-start: 1; - -ms-grid-column-align: end; - justify-self: end; -} - + -ms-grid-row-align: start; + align-self: start; + -ms-grid-column-span: 1; + grid-column-end: 4; + -ms-grid-column: 3; + grid-column-start: 3; + -ms-grid-row-span: 1; + grid-row-end: 2; + -ms-grid-row: 1; + grid-row-start: 1; + -ms-grid-column-align: end; + justify-self: end; +} .tox .tox-notification .tox-progress-bar { - -ms-grid-column-span: 3; - grid-column-end: 4; - -ms-grid-column: 1; - grid-column-start: 1; - -ms-grid-row-span: 1; - grid-row-end: 3; - -ms-grid-row: 2; - grid-row-start: 2; - -ms-grid-column-align: center; - justify-self: center; -} - + -ms-grid-column-span: 3; + grid-column-end: 4; + -ms-grid-column: 1; + grid-column-start: 1; + -ms-grid-row-span: 1; + grid-row-end: 3; + -ms-grid-row: 2; + grid-row-start: 2; + -ms-grid-column-align: center; + justify-self: center; +} .tox .tox-pop { - display: inline-block; - position: relative; + display: inline-block; + position: relative; } - .tox .tox-pop--resizing { - transition: width 0.1s ease; + transition: width 0.1s ease; } - .tox .tox-pop--resizing .tox-toolbar { - flex-wrap: nowrap; + flex-wrap: nowrap; } - .tox .tox-pop__dialog { - background-color: #222f3e; - border: 1px solid #000000; - border-radius: 3px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); - min-width: 0; - overflow: hidden; -} - + background-color: #222f3e; + border: 1px solid #000000; + border-radius: 3px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); + min-width: 0; + overflow: hidden; +} .tox .tox-pop__dialog > *:not(.tox-toolbar) { - margin: 4px 4px 4px 8px; + margin: 4px 4px 4px 8px; } - .tox .tox-pop__dialog .tox-toolbar { - background-color: transparent; - margin-bottom: -1px; + background-color: transparent; + margin-bottom: -1px; } - .tox .tox-pop::before, .tox .tox-pop::after { - border-style: solid; - content: ''; - display: block; - height: 0; - position: absolute; - width: 0; -} - + border-style: solid; + content: ''; + display: block; + height: 0; + position: absolute; + width: 0; +} .tox .tox-pop.tox-pop--bottom::before, .tox .tox-pop.tox-pop--bottom::after { - left: 50%; - top: 100%; + left: 50%; + top: 100%; } - .tox .tox-pop.tox-pop--bottom::after { - border-color: #222f3e transparent transparent transparent; - border-width: 8px; - margin-left: -8px; - margin-top: -1px; + border-color: #222f3e transparent transparent transparent; + border-width: 8px; + margin-left: -8px; + margin-top: -1px; } - .tox .tox-pop.tox-pop--bottom::before { - border-color: #000000 transparent transparent transparent; - border-width: 9px; - margin-left: -9px; + border-color: #000000 transparent transparent transparent; + border-width: 9px; + margin-left: -9px; } - .tox .tox-pop.tox-pop--top::before, .tox .tox-pop.tox-pop--top::after { - left: 50%; - top: 0; - transform: translateY(-100%); + left: 50%; + top: 0; + transform: translateY(-100%); } - .tox .tox-pop.tox-pop--top::after { - border-color: transparent transparent #222f3e transparent; - border-width: 8px; - margin-left: -8px; - margin-top: 1px; + border-color: transparent transparent #222f3e transparent; + border-width: 8px; + margin-left: -8px; + margin-top: 1px; } - .tox .tox-pop.tox-pop--top::before { - border-color: transparent transparent #000000 transparent; - border-width: 9px; - margin-left: -9px; + border-color: transparent transparent #000000 transparent; + border-width: 9px; + margin-left: -9px; } - .tox .tox-pop.tox-pop--left::before, .tox .tox-pop.tox-pop--left::after { - left: 0; - top: calc(50% - 1px); - transform: translateY(-50%); + left: 0; + top: calc(50% - 1px); + transform: translateY(-50%); } - .tox .tox-pop.tox-pop--left::after { - border-color: transparent #222f3e transparent transparent; - border-width: 8px; - margin-left: -15px; + border-color: transparent #222f3e transparent transparent; + border-width: 8px; + margin-left: -15px; } - .tox .tox-pop.tox-pop--left::before { - border-color: transparent #000000 transparent transparent; - border-width: 10px; - margin-left: -19px; + border-color: transparent #000000 transparent transparent; + border-width: 10px; + margin-left: -19px; } - .tox .tox-pop.tox-pop--right::before, .tox .tox-pop.tox-pop--right::after { - left: 100%; - top: calc(50% + 1px); - transform: translateY(-50%); + left: 100%; + top: calc(50% + 1px); + transform: translateY(-50%); } - .tox .tox-pop.tox-pop--right::after { - border-color: transparent transparent transparent #222f3e; - border-width: 8px; - margin-left: -1px; + border-color: transparent transparent transparent #222f3e; + border-width: 8px; + margin-left: -1px; } - .tox .tox-pop.tox-pop--right::before { - border-color: transparent transparent transparent #000000; - border-width: 10px; - margin-left: -1px; + border-color: transparent transparent transparent #000000; + border-width: 10px; + margin-left: -1px; } - .tox .tox-pop.tox-pop--align-left::before, .tox .tox-pop.tox-pop--align-left::after { - left: 20px; + left: 20px; } - .tox .tox-pop.tox-pop--align-right::before, .tox .tox-pop.tox-pop--align-right::after { - left: calc(100% - 20px); + left: calc(100% - 20px); } - .tox .tox-sidebar-wrap { - display: flex; - flex-direction: row; - flex-grow: 1; - -ms-flex-preferred-size: 0; - min-height: 0; + display: flex; + flex-direction: row; + flex-grow: 1; + -ms-flex-preferred-size: 0; + min-height: 0; } - .tox .tox-sidebar { - background-color: #222f3e; - display: flex; - flex-direction: row; - justify-content: flex-end; + background-color: #222f3e; + display: flex; + flex-direction: row; + justify-content: flex-end; } - .tox .tox-sidebar__slider { - display: flex; - overflow: hidden; + display: flex; + overflow: hidden; } - .tox .tox-sidebar__pane-container { - display: flex; + display: flex; } - .tox .tox-sidebar__pane { - display: flex; + display: flex; } - .tox .tox-sidebar--sliding-closed { - opacity: 0; + opacity: 0; } - .tox .tox-sidebar--sliding-open { - opacity: 1; + opacity: 1; } - .tox .tox-sidebar--sliding-growing, .tox .tox-sidebar--sliding-shrinking { - transition: width 0.5s ease, opacity 0.5s ease; + transition: width 0.5s ease, opacity 0.5s ease; } - .tox .tox-selector { - background-color: #4099ff; - border-color: #4099ff; - border-style: solid; - border-width: 1px; - box-sizing: border-box; - display: inline-block; - height: 10px; - position: absolute; - width: 10px; -} - + background-color: #4099ff; + border-color: #4099ff; + border-style: solid; + border-width: 1px; + box-sizing: border-box; + display: inline-block; + height: 10px; + position: absolute; + width: 10px; +} .tox.tox-platform-touch .tox-selector { - height: 12px; - width: 12px; + height: 12px; + width: 12px; } - .tox .tox-slider { - align-items: center; - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; - height: 24px; - justify-content: center; - position: relative; -} - + align-items: center; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; + height: 24px; + justify-content: center; + position: relative; +} .tox .tox-slider__rail { - background-color: transparent; - border: 1px solid #000000; - border-radius: 3px; - height: 10px; - min-width: 120px; - width: 100%; -} - + background-color: transparent; + border: 1px solid #000000; + border-radius: 3px; + height: 10px; + min-width: 120px; + width: 100%; +} .tox .tox-slider__handle { - background-color: #207ab7; - border: 2px solid #185d8c; - border-radius: 3px; - box-shadow: none; - height: 24px; - left: 50%; - position: absolute; - top: 50%; - transform: translateX(-50%) translateY(-50%); - width: 14px; -} - + background-color: #207ab7; + border: 2px solid #185d8c; + border-radius: 3px; + box-shadow: none; + height: 24px; + left: 50%; + position: absolute; + top: 50%; + transform: translateX(-50%) translateY(-50%); + width: 14px; +} .tox .tox-source-code { - overflow: auto; + overflow: auto; } - .tox .tox-spinner { - display: flex; + display: flex; } - .tox .tox-spinner > div { - animation: tam-bouncing-dots 1.5s ease-in-out 0s infinite both; - background-color: rgba(255, 255, 255, 0.5); - border-radius: 100%; - height: 8px; - width: 8px; + animation: tam-bouncing-dots 1.5s ease-in-out 0s infinite both; + background-color: rgba(255, 255, 255, 0.5); + border-radius: 100%; + height: 8px; + width: 8px; } - .tox .tox-spinner > div:nth-child(1) { - animation-delay: -0.32s; + animation-delay: -0.32s; } - .tox .tox-spinner > div:nth-child(2) { - animation-delay: -0.16s; + animation-delay: -0.16s; } - @keyframes tam-bouncing-dots { - 0%, - 80%, - 100% { - transform: scale(0); - } - 40% { - transform: scale(1); - } -} - + 0%, + 80%, + 100% { + transform: scale(0); + } + 40% { + transform: scale(1); + } +} .tox:not([dir=rtl]) .tox-spinner > div:not(:first-child) { - margin-left: 4px; + margin-left: 4px; } - .tox[dir=rtl] .tox-spinner > div:not(:first-child) { - margin-right: 4px; + margin-right: 4px; } - .tox .tox-statusbar { - align-items: center; - background-color: #222f3e; - border-top: 1px solid #000000; - color: #fff; - display: flex; - flex: 0 0 auto; - font-size: 12px; - font-weight: normal; - height: 18px; - overflow: hidden; - padding: 0 8px; - position: relative; - text-transform: uppercase; -} - + align-items: center; + background-color: #222f3e; + border-top: 1px solid #000000; + color: #fff; + display: flex; + flex: 0 0 auto; + font-size: 12px; + font-weight: normal; + height: 18px; + overflow: hidden; + padding: 0 8px; + position: relative; + text-transform: uppercase; +} .tox .tox-statusbar__text-container { - display: flex; - flex: 1 1 auto; - justify-content: flex-end; - overflow: hidden; + display: flex; + flex: 1 1 auto; + justify-content: flex-end; + overflow: hidden; } - .tox .tox-statusbar__path { - display: flex; - flex: 1 1 auto; - margin-right: auto; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - + display: flex; + flex: 1 1 auto; + margin-right: auto; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} .tox .tox-statusbar__path > * { - display: inline; - white-space: nowrap; + display: inline; + white-space: nowrap; } - .tox .tox-statusbar__wordcount { - flex: 0 0 auto; - margin-left: 1ch; + flex: 0 0 auto; + margin-left: 1ch; } - .tox .tox-statusbar a, .tox .tox-statusbar__path-item, .tox .tox-statusbar__wordcount { - color: #fff; - text-decoration: none; + color: #fff; + text-decoration: none; } - .tox .tox-statusbar a:hover:not(:disabled):not([aria-disabled=true]), .tox .tox-statusbar__path-item:hover:not(:disabled):not([aria-disabled=true]), .tox .tox-statusbar__wordcount:hover:not(:disabled):not([aria-disabled=true]), .tox .tox-statusbar a:focus:not(:disabled):not([aria-disabled=true]), .tox .tox-statusbar__path-item:focus:not(:disabled):not([aria-disabled=true]), .tox .tox-statusbar__wordcount:focus:not(:disabled):not([aria-disabled=true]) { - cursor: pointer; - text-decoration: underline; + cursor: pointer; + text-decoration: underline; } - .tox .tox-statusbar__resize-handle { - align-items: flex-end; - align-self: stretch; - cursor: nwse-resize; - display: flex; - flex: 0 0 auto; - justify-content: flex-end; - margin-left: auto; - margin-right: -8px; - padding-left: 1ch; -} - + align-items: flex-end; + align-self: stretch; + cursor: nwse-resize; + display: flex; + flex: 0 0 auto; + justify-content: flex-end; + margin-left: auto; + margin-right: -8px; + padding-left: 1ch; +} .tox .tox-statusbar__resize-handle svg { - display: block; - fill: #fff; + display: block; + fill: #fff; } - .tox:not([dir=rtl]) .tox-statusbar__path > * { - margin-right: 4px; + margin-right: 4px; } - .tox:not([dir=rtl]) .tox-statusbar__branding { - margin-left: 1ch; + margin-left: 1ch; } - .tox[dir=rtl] .tox-statusbar { - flex-direction: row-reverse; + flex-direction: row-reverse; } - .tox[dir=rtl] .tox-statusbar__path > * { - margin-left: 4px; + margin-left: 4px; } - .tox .tox-throbber { - z-index: 1400; + z-index: 1400; } - .tox .tox-throbber__busy-spinner { - align-items: center; - background-color: rgba(34, 47, 62, 0.6); - bottom: 0; - display: flex; - justify-content: center; - left: 0; - position: absolute; - right: 0; - top: 0; -} - + align-items: center; + background-color: rgba(34, 47, 62, 0.6); + bottom: 0; + display: flex; + justify-content: center; + left: 0; + position: absolute; + right: 0; + top: 0; +} .tox .tox-tbtn { - align-items: center; - background: transparent; - border: 0; - border-radius: 3px; - box-shadow: none; - color: #fff; - display: flex; - flex: 0 0 auto; - font-size: 14px; - font-style: normal; - font-weight: normal; - height: 34px; - justify-content: center; - margin: 2px 0 3px 0; - outline: none; - overflow: hidden; - padding: 0; - text-transform: none; - width: 34px; -} - + align-items: center; + background: transparent; + border: 0; + border-radius: 3px; + box-shadow: none; + color: #fff; + display: flex; + flex: 0 0 auto; + font-size: 14px; + font-style: normal; + font-weight: normal; + height: 34px; + justify-content: center; + margin: 2px 0 3px 0; + outline: none; + overflow: hidden; + padding: 0; + text-transform: none; + width: 34px; +} .tox .tox-tbtn svg { - display: block; - fill: #fff; + display: block; + fill: #fff; } - .tox .tox-tbtn.tox-tbtn-more { - padding-left: 5px; - padding-right: 5px; - width: inherit; + padding-left: 5px; + padding-right: 5px; + width: inherit; } - .tox .tox-tbtn:focus { - background: #4a5562; - border: 0; - box-shadow: none; + background: #4a5562; + border: 0; + box-shadow: none; } - .tox .tox-tbtn:hover { - background: #4a5562; - border: 0; - box-shadow: none; - color: #fff; + background: #4a5562; + border: 0; + box-shadow: none; + color: #fff; } - .tox .tox-tbtn:hover svg { - fill: #fff; + fill: #fff; } - .tox .tox-tbtn:active { - background: #757d87; - border: 0; - box-shadow: none; - color: #fff; + background: #757d87; + border: 0; + box-shadow: none; + color: #fff; } - .tox .tox-tbtn:active svg { - fill: #fff; + fill: #fff; } - .tox .tox-tbtn--disabled, .tox .tox-tbtn--disabled:hover, .tox .tox-tbtn:disabled, .tox .tox-tbtn:disabled:hover { - background: transparent; - border: 0; - box-shadow: none; - color: rgba(255, 255, 255, 0.5); - cursor: not-allowed; + background: transparent; + border: 0; + box-shadow: none; + color: rgba(255, 255, 255, 0.5); + cursor: not-allowed; } - .tox .tox-tbtn--disabled svg, .tox .tox-tbtn--disabled:hover svg, .tox .tox-tbtn:disabled svg, .tox .tox-tbtn:disabled:hover svg { - /* stylelint-disable-line no-descending-specificity */ - fill: rgba(255, 255, 255, 0.5); + /* stylelint-disable-line no-descending-specificity */ + fill: rgba(255, 255, 255, 0.5); } - .tox .tox-tbtn--enabled, .tox .tox-tbtn--enabled:hover { - background: #757d87; - border: 0; - box-shadow: none; - color: #fff; + background: #757d87; + border: 0; + box-shadow: none; + color: #fff; } - .tox .tox-tbtn--enabled > *, .tox .tox-tbtn--enabled:hover > * { - transform: none; + transform: none; } - .tox .tox-tbtn--enabled svg, .tox .tox-tbtn--enabled:hover svg { - /* stylelint-disable-line no-descending-specificity */ - fill: #fff; + /* stylelint-disable-line no-descending-specificity */ + fill: #fff; } - .tox .tox-tbtn:focus:not(.tox-tbtn--disabled) { - color: #fff; + color: #fff; } - .tox .tox-tbtn:focus:not(.tox-tbtn--disabled) svg { - fill: #fff; + fill: #fff; } - .tox .tox-tbtn:active > * { - transform: none; + transform: none; } - .tox .tox-tbtn--md { - height: 51px; - width: 51px; + height: 51px; + width: 51px; } - .tox .tox-tbtn--lg { - flex-direction: column; - height: 68px; - width: 68px; + flex-direction: column; + height: 68px; + width: 68px; } - .tox .tox-tbtn--return { - -ms-grid-row-align: stretch; - align-self: stretch; - height: unset; - width: 16px; + -ms-grid-row-align: stretch; + align-self: stretch; + height: unset; + width: 16px; } - .tox .tox-tbtn--labeled { - padding: 0 4px; - width: unset; + padding: 0 4px; + width: unset; } - .tox .tox-tbtn__vlabel { - display: block; - font-size: 10px; - font-weight: normal; - letter-spacing: -0.025em; - margin-bottom: 4px; - white-space: nowrap; -} - + display: block; + font-size: 10px; + font-weight: normal; + letter-spacing: -0.025em; + margin-bottom: 4px; + white-space: nowrap; +} .tox .tox-tbtn--select { - margin: 2px 0 3px 0; - padding: 0 4px; - width: auto; + margin: 2px 0 3px 0; + padding: 0 4px; + width: auto; } - .tox .tox-tbtn__select-label { - cursor: default; - font-weight: normal; - margin: 0 4px; + cursor: default; + font-weight: normal; + margin: 0 4px; } - .tox .tox-tbtn__select-chevron { - align-items: center; - display: flex; - justify-content: center; - width: 16px; + align-items: center; + display: flex; + justify-content: center; + width: 16px; } - .tox .tox-tbtn__select-chevron svg { - fill: rgba(255, 255, 255, 0.5); + fill: rgba(255, 255, 255, 0.5); } - .tox .tox-tbtn--bespoke .tox-tbtn__select-label { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - width: 7em; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 7em; } - .tox .tox-split-button { - border: 0; - border-radius: 3px; - box-sizing: border-box; - display: flex; - margin: 2px 0 3px 0; - overflow: hidden; -} - + border: 0; + border-radius: 3px; + box-sizing: border-box; + display: flex; + margin: 2px 0 3px 0; + overflow: hidden; +} .tox .tox-split-button:hover { - box-shadow: 0 0 0 1px #4a5562 inset; + box-shadow: 0 0 0 1px #4a5562 inset; } - .tox .tox-split-button:focus { - background: #4a5562; - box-shadow: none; - color: #fff; + background: #4a5562; + box-shadow: none; + color: #fff; } - .tox .tox-split-button > * { - border-radius: 0; + border-radius: 0; } - .tox .tox-split-button__chevron { - width: 16px; + width: 16px; } - .tox .tox-split-button__chevron svg { - fill: rgba(255, 255, 255, 0.5); + fill: rgba(255, 255, 255, 0.5); } - .tox .tox-split-button .tox-tbtn { - margin: 0; + margin: 0; } - .tox.tox-platform-touch .tox-split-button .tox-tbtn:first-child { - width: 30px; + width: 30px; } - .tox.tox-platform-touch .tox-split-button__chevron { - width: 20px; + width: 20px; } - .tox .tox-split-button.tox-tbtn--disabled:hover, .tox .tox-split-button.tox-tbtn--disabled:focus, .tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:hover, .tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:focus { - background: transparent; - box-shadow: none; - color: rgba(255, 255, 255, 0.5); + background: transparent; + box-shadow: none; + color: rgba(255, 255, 255, 0.5); } - .tox .tox-toolbar-overlord { - background-color: #222f3e; + background-color: #222f3e; } - .tox .tox-toolbar, .tox .tox-toolbar__primary, .tox .tox-toolbar__overflow { - background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23000000'/%3E%3C/svg%3E") left 0 top 0 #222f3e; - background-color: #222f3e; - display: flex; - flex: 0 0 auto; - flex-shrink: 0; - flex-wrap: wrap; - padding: 0 0; -} - + background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23000000'/%3E%3C/svg%3E") left 0 top 0 #222f3e; + background-color: #222f3e; + display: flex; + flex: 0 0 auto; + flex-shrink: 0; + flex-wrap: wrap; + padding: 0 0; +} .tox .tox-toolbar__overflow.tox-toolbar__overflow--closed { - height: 0; - opacity: 0; - padding-bottom: 0; - padding-top: 0; - visibility: hidden; + height: 0; + opacity: 0; + padding-bottom: 0; + padding-top: 0; + visibility: hidden; } - .tox .tox-toolbar__overflow--growing { - transition: height 0.3s ease, opacity 0.2s linear 0.1s; + transition: height 0.3s ease, opacity 0.2s linear 0.1s; } - .tox .tox-toolbar__overflow--shrinking { - transition: opacity 0.3s ease, height 0.2s linear 0.1s, visibility 0s linear 0.3s; + transition: opacity 0.3s ease, height 0.2s linear 0.1s, visibility 0s linear 0.3s; } - .tox .tox-menubar + .tox-toolbar, .tox .tox-menubar + .tox-toolbar-overlord .tox-toolbar__primary { - border-top: 1px solid #000000; - margin-top: -1px; + border-top: 1px solid #000000; + margin-top: -1px; } - .tox .tox-toolbar--scrolling { - flex-wrap: nowrap; - overflow-x: auto; + flex-wrap: nowrap; + overflow-x: auto; } - .tox .tox-pop .tox-toolbar { - border-width: 0; + border-width: 0; } - .tox .tox-toolbar--no-divider { - background-image: none; + background-image: none; } - .tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar:first-child, .tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar-overlord:first-child .tox-toolbar__primary { - border-top: 1px solid #000000; + border-top: 1px solid #000000; } - .tox.tox-tinymce-aux .tox-toolbar__overflow { - background-color: #222f3e; - border: 1px solid #000000; - border-radius: 3px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); + background-color: #222f3e; + border: 1px solid #000000; + border-radius: 3px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); } - .tox[dir=rtl] .tox-tbtn__icon-rtl svg { - transform: rotateY(180deg); + transform: rotateY(180deg); } - .tox .tox-toolbar__group { - align-items: center; - display: flex; - flex-wrap: wrap; - margin: 0 0; - padding: 0 4px 0 4px; + align-items: center; + display: flex; + flex-wrap: wrap; + margin: 0 0; + padding: 0 4px 0 4px; } - .tox .tox-toolbar__group--pull-right { - margin-left: auto; + margin-left: auto; } - .tox .tox-toolbar--scrolling .tox-toolbar__group { - flex-shrink: 0; - flex-wrap: nowrap; + flex-shrink: 0; + flex-wrap: nowrap; } - .tox:not([dir=rtl]) .tox-toolbar__group:not(:last-of-type) { - border-right: 1px solid #000000; + border-right: 1px solid #000000; } - .tox[dir=rtl] .tox-toolbar__group:not(:last-of-type) { - border-left: 1px solid #000000; + border-left: 1px solid #000000; } - .tox .tox-tooltip { - display: inline-block; - padding: 8px; - position: relative; + display: inline-block; + padding: 8px; + position: relative; } - .tox .tox-tooltip__body { - background-color: #3d546f; - border-radius: 3px; - box-shadow: 0 2px 4px rgba(42, 55, 70, 0.3); - color: rgba(255, 255, 255, 0.75); - font-size: 14px; - font-style: normal; - font-weight: normal; - padding: 4px 8px; - text-transform: none; -} - + background-color: #3d546f; + border-radius: 3px; + box-shadow: 0 2px 4px rgba(42, 55, 70, 0.3); + color: rgba(255, 255, 255, 0.75); + font-size: 14px; + font-style: normal; + font-weight: normal; + padding: 4px 8px; + text-transform: none; +} .tox .tox-tooltip__arrow { - position: absolute; + position: absolute; } - .tox .tox-tooltip--down .tox-tooltip__arrow { - border-left: 8px solid transparent; - border-right: 8px solid transparent; - border-top: 8px solid #3d546f; - bottom: 0; - left: 50%; - position: absolute; - transform: translateX(-50%); -} - + border-left: 8px solid transparent; + border-right: 8px solid transparent; + border-top: 8px solid #3d546f; + bottom: 0; + left: 50%; + position: absolute; + transform: translateX(-50%); +} .tox .tox-tooltip--up .tox-tooltip__arrow { - border-bottom: 8px solid #3d546f; - border-left: 8px solid transparent; - border-right: 8px solid transparent; - left: 50%; - position: absolute; - top: 0; - transform: translateX(-50%); -} - + border-bottom: 8px solid #3d546f; + border-left: 8px solid transparent; + border-right: 8px solid transparent; + left: 50%; + position: absolute; + top: 0; + transform: translateX(-50%); +} .tox .tox-tooltip--right .tox-tooltip__arrow { - border-bottom: 8px solid transparent; - border-left: 8px solid #3d546f; - border-top: 8px solid transparent; - position: absolute; - right: 0; - top: 50%; - transform: translateY(-50%); -} - + border-bottom: 8px solid transparent; + border-left: 8px solid #3d546f; + border-top: 8px solid transparent; + position: absolute; + right: 0; + top: 50%; + transform: translateY(-50%); +} .tox .tox-tooltip--left .tox-tooltip__arrow { - border-bottom: 8px solid transparent; - border-right: 8px solid #3d546f; - border-top: 8px solid transparent; - left: 0; - position: absolute; - top: 50%; - transform: translateY(-50%); -} - + border-bottom: 8px solid transparent; + border-right: 8px solid #3d546f; + border-top: 8px solid transparent; + left: 0; + position: absolute; + top: 50%; + transform: translateY(-50%); +} .tox .tox-well { - border: 1px solid #000000; - border-radius: 3px; - padding: 8px; - width: 100%; + border: 1px solid #000000; + border-radius: 3px; + padding: 8px; + width: 100%; } - .tox .tox-well > *:first-child { - margin-top: 0; + margin-top: 0; } - .tox .tox-well > *:last-child { - margin-bottom: 0; + margin-bottom: 0; } - .tox .tox-well > *:only-child { - margin: 0; + margin: 0; } - .tox .tox-custom-editor { - border: 1px solid #000000; - border-radius: 3px; - display: flex; - flex: 1; - position: relative; + border: 1px solid #000000; + border-radius: 3px; + display: flex; + flex: 1; + position: relative; } - /* stylelint-disable */ .tox { - /* stylelint-enable */ + /* stylelint-enable */ } - .tox .tox-dialog-loading::before { - background-color: rgba(0, 0, 0, 0.5); - content: ""; - height: 100%; - position: absolute; - width: 100%; - z-index: 1000; -} - + background-color: rgba(0, 0, 0, 0.5); + content: ""; + height: 100%; + position: absolute; + width: 100%; + z-index: 1000; +} .tox .tox-tab { - cursor: pointer; + cursor: pointer; } - .tox .tox-dialog__content-js { - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; } - .tox .tox-dialog__body-content .tox-collection { - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; } - .tox .tox-image-tools-edit-panel { - height: 60px; + height: 60px; } - .tox .tox-image-tools__sidebar { - height: 60px; + height: 60px; } diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/skin.mobile.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/skin.mobile.css index d6652d64..875721a2 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/skin.mobile.css +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/skin.mobile.css @@ -6,793 +6,668 @@ */ /* RESET all the things! */ .tinymce-mobile-outer-container { - all: initial; - display: block; + all: initial; + display: block; } - .tinymce-mobile-outer-container * { - border: 0; - box-sizing: initial; - cursor: inherit; - float: none; - line-height: 1; - margin: 0; - outline: 0; - padding: 0; - -webkit-tap-highlight-color: transparent; - /* TBIO-3691, stop the gray flicker on touch. */ - text-shadow: none; - white-space: nowrap; -} - + border: 0; + box-sizing: initial; + cursor: inherit; + float: none; + line-height: 1; + margin: 0; + outline: 0; + padding: 0; + -webkit-tap-highlight-color: transparent; + /* TBIO-3691, stop the gray flicker on touch. */ + text-shadow: none; + white-space: nowrap; +} .tinymce-mobile-icon-arrow-back::before { - content: "\e5cd"; + content: "\e5cd"; } - .tinymce-mobile-icon-image::before { - content: "\e412"; + content: "\e412"; } - .tinymce-mobile-icon-cancel-circle::before { - content: "\e5c9"; + content: "\e5c9"; } - .tinymce-mobile-icon-full-dot::before { - content: "\e061"; + content: "\e061"; } - .tinymce-mobile-icon-align-center::before { - content: "\e234"; + content: "\e234"; } - .tinymce-mobile-icon-align-left::before { - content: "\e236"; + content: "\e236"; } - .tinymce-mobile-icon-align-right::before { - content: "\e237"; + content: "\e237"; } - .tinymce-mobile-icon-bold::before { - content: "\e238"; + content: "\e238"; } - .tinymce-mobile-icon-italic::before { - content: "\e23f"; + content: "\e23f"; } - .tinymce-mobile-icon-unordered-list::before { - content: "\e241"; + content: "\e241"; } - .tinymce-mobile-icon-ordered-list::before { - content: "\e242"; + content: "\e242"; } - .tinymce-mobile-icon-font-size::before { - content: "\e245"; + content: "\e245"; } - .tinymce-mobile-icon-underline::before { - content: "\e249"; + content: "\e249"; } - .tinymce-mobile-icon-link::before { - content: "\e157"; + content: "\e157"; } - .tinymce-mobile-icon-unlink::before { - content: "\eca2"; + content: "\eca2"; } - .tinymce-mobile-icon-color::before { - content: "\e891"; + content: "\e891"; } - .tinymce-mobile-icon-previous::before { - content: "\e314"; + content: "\e314"; } - .tinymce-mobile-icon-next::before { - content: "\e315"; + content: "\e315"; } - .tinymce-mobile-icon-large-font::before, .tinymce-mobile-icon-style-formats::before { - content: "\e264"; + content: "\e264"; } - .tinymce-mobile-icon-undo::before { - content: "\e166"; + content: "\e166"; } - .tinymce-mobile-icon-redo::before { - content: "\e15a"; + content: "\e15a"; } - .tinymce-mobile-icon-removeformat::before { - content: "\e239"; + content: "\e239"; } - .tinymce-mobile-icon-small-font::before { - content: "\e906"; + content: "\e906"; } - .tinymce-mobile-icon-readonly-back::before, .tinymce-mobile-format-matches::after { - content: "\e5ca"; + content: "\e5ca"; } - .tinymce-mobile-icon-small-heading::before { - content: "small"; + content: "small"; } - .tinymce-mobile-icon-large-heading::before { - content: "large"; + content: "large"; } - .tinymce-mobile-icon-small-heading::before, .tinymce-mobile-icon-large-heading::before { - font-family: sans-serif; - font-size: 80%; + font-family: sans-serif; + font-size: 80%; } - .tinymce-mobile-mask-edit-icon::before { - content: "\e254"; + content: "\e254"; } - .tinymce-mobile-icon-back::before { - content: "\e5c4"; + content: "\e5c4"; } - .tinymce-mobile-icon-heading::before { - /* TODO: Translate */ - content: "Headings"; - font-family: sans-serif; - font-size: 80%; - font-weight: bold; + /* TODO: Translate */ + content: "Headings"; + font-family: sans-serif; + font-size: 80%; + font-weight: bold; } - .tinymce-mobile-icon-h1::before { - content: "H1"; - font-weight: bold; + content: "H1"; + font-weight: bold; } - .tinymce-mobile-icon-h2::before { - content: "H2"; - font-weight: bold; + content: "H2"; + font-weight: bold; } - .tinymce-mobile-icon-h3::before { - content: "H3"; - font-weight: bold; + content: "H3"; + font-weight: bold; } - .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask { - align-items: center; - display: flex; - justify-content: center; - background: rgba(51, 51, 51, 0.5); - height: 100%; - position: absolute; - top: 0; - width: 100%; -} - + align-items: center; + display: flex; + justify-content: center; + background: rgba(51, 51, 51, 0.5); + height: 100%; + position: absolute; + top: 0; + width: 100%; +} .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container { - align-items: center; - border-radius: 50%; - display: flex; - flex-direction: column; - font-family: sans-serif; - font-size: 1em; - justify-content: space-between; -} - + align-items: center; + border-radius: 50%; + display: flex; + flex-direction: column; + font-family: sans-serif; + font-size: 1em; + justify-content: space-between; +} .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .mixin-menu-item { - align-items: center; - display: flex; - justify-content: center; - border-radius: 50%; - height: 2.1em; - width: 2.1em; -} - + align-items: center; + display: flex; + justify-content: center; + border-radius: 50%; + height: 2.1em; + width: 2.1em; +} .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section { - align-items: center; - display: flex; - justify-content: center; - flex-direction: column; - font-size: 1em; -} - -@media only screen and (min-device-width: 700px) { - .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section { - font-size: 1.2em; - } -} - + align-items: center; + display: flex; + justify-content: center; + flex-direction: column; + font-size: 1em; +} +@media only screen and (min-device-width:700px) { + .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section { + font-size: 1.2em; + } +} .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon { - align-items: center; - display: flex; - justify-content: center; - border-radius: 50%; - height: 2.1em; - width: 2.1em; - background-color: white; - color: #207ab7; -} - + align-items: center; + display: flex; + justify-content: center; + border-radius: 50%; + height: 2.1em; + width: 2.1em; + background-color: white; + color: #207ab7; +} .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon::before { - content: "\e900"; - font-family: 'tinymce-mobile', sans-serif; + content: "\e900"; + font-family: 'tinymce-mobile', sans-serif; } - .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section:not(.tinymce-mobile-mask-tap-icon-selected) .tinymce-mobile-mask-tap-icon { - z-index: 2; + z-index: 2; } - .tinymce-mobile-android-container.tinymce-mobile-android-maximized { - background: #ffffff; - border: none; - bottom: 0; - display: flex; - flex-direction: column; - left: 0; - position: fixed; - right: 0; - top: 0; -} - + background: #ffffff; + border: none; + bottom: 0; + display: flex; + flex-direction: column; + left: 0; + position: fixed; + right: 0; + top: 0; +} .tinymce-mobile-android-container:not(.tinymce-mobile-android-maximized) { - position: relative; + position: relative; } - .tinymce-mobile-android-container .tinymce-mobile-editor-socket { - display: flex; - flex-grow: 1; + display: flex; + flex-grow: 1; } - .tinymce-mobile-android-container .tinymce-mobile-editor-socket iframe { - display: flex !important; - flex-grow: 1; - height: auto !important; + display: flex !important; + flex-grow: 1; + height: auto !important; } - .tinymce-mobile-android-scroll-reload { - overflow: hidden; + overflow: hidden; } - :not(.tinymce-mobile-readonly-mode) > .tinymce-mobile-android-selection-context-toolbar { - margin-top: 23px; + margin-top: 23px; } - .tinymce-mobile-toolstrip { - background: #fff; - display: flex; - flex: 0 0 auto; - z-index: 1; + background: #fff; + display: flex; + flex: 0 0 auto; + z-index: 1; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar { - align-items: center; - background-color: #fff; - border-bottom: 1px solid #cccccc; - display: flex; - flex: 1; - height: 2.5em; - width: 100%; - /* Make it no larger than the toolstrip, so that it needs to scroll */ -} - + align-items: center; + background-color: #fff; + border-bottom: 1px solid #cccccc; + display: flex; + flex: 1; + height: 2.5em; + width: 100%; + /* Make it no larger than the toolstrip, so that it needs to scroll */ +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group { - align-items: center; - display: flex; - height: 100%; - flex-shrink: 1; + align-items: center; + display: flex; + height: 100%; + flex-shrink: 1; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group > div { - align-items: center; - display: flex; - height: 100%; - flex: 1; + align-items: center; + display: flex; + height: 100%; + flex: 1; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-exit-container { - background: #f44336; + background: #f44336; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-toolbar-scrollable-group { - flex-grow: 1; + flex-grow: 1; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item { - padding-left: 0.5em; - padding-right: 0.5em; + padding-left: 0.5em; + padding-right: 0.5em; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button { - align-items: center; - display: flex; - height: 80%; - margin-left: 2px; - margin-right: 2px; + align-items: center; + display: flex; + height: 80%; + margin-left: 2px; + margin-right: 2px; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button.tinymce-mobile-toolbar-button-selected { - background: #c8cbcf; - color: #cccccc; + background: #c8cbcf; + color: #cccccc; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:first-of-type, .tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:last-of-type { - background: #207ab7; - color: #eceff1; + background: #207ab7; + color: #eceff1; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar { - /* Note, this file is imported inside .tinymce-mobile-context-toolbar, so that prefix is on everything here. */ + /* Note, this file is imported inside .tinymce-mobile-context-toolbar, so that prefix is on everything here. */ } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group { - align-items: center; - display: flex; - height: 100%; - flex: 1; - padding-bottom: 0.4em; - padding-top: 0.4em; - /* Make any buttons appearing on the left and right display in the centre (e.g. color edges) */ - /* For widgets like the colour picker, use the whole height */ -} - + align-items: center; + display: flex; + height: 100%; + flex: 1; + padding-bottom: 0.4em; + padding-top: 0.4em; + /* Make any buttons appearing on the left and right display in the centre (e.g. color edges) */ + /* For widgets like the colour picker, use the whole height */ +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog { - display: flex; - min-height: 1.5em; - overflow: hidden; - padding-left: 0; - padding-right: 0; - position: relative; - width: 100%; -} - + display: flex; + min-height: 1.5em; + overflow: hidden; + padding-left: 0; + padding-right: 0; + position: relative; + width: 100%; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain { - display: flex; - height: 100%; - transition: left cubic-bezier(0.4, 0, 1, 1) 0.15s; - width: 100%; + display: flex; + height: 100%; + transition: left cubic-bezier(0.4, 0, 1, 1) 0.15s; + width: 100%; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen { - display: flex; - flex: 0 0 auto; - justify-content: space-between; - width: 100%; + display: flex; + flex: 0 0 auto; + justify-content: space-between; + width: 100%; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen input { - font-family: Sans-serif; + font-family: Sans-serif; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container { - display: flex; - flex-grow: 1; - position: relative; + display: flex; + flex-grow: 1; + position: relative; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container .tinymce-mobile-input-container-x { - -ms-grid-row-align: center; - align-self: center; - background: inherit; - border: none; - border-radius: 50%; - color: #888; - font-size: 0.6em; - font-weight: bold; - height: 100%; - padding-right: 2px; - position: absolute; - right: 0; -} - + -ms-grid-row-align: center; + align-self: center; + background: inherit; + border: none; + border-radius: 50%; + color: #888; + font-size: 0.6em; + font-weight: bold; + height: 100%; + padding-right: 2px; + position: absolute; + right: 0; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container.tinymce-mobile-input-container-empty .tinymce-mobile-input-container-x { - display: none; + display: none; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous, .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next { - align-items: center; - display: flex; + align-items: center; + display: flex; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous::before, .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next::before { - align-items: center; - display: flex; - font-weight: bold; - height: 100%; - padding-left: 0.5em; - padding-right: 0.5em; -} - + align-items: center; + display: flex; + font-weight: bold; + height: 100%; + padding-left: 0.5em; + padding-right: 0.5em; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous.tinymce-mobile-toolbar-navigation-disabled::before, .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next.tinymce-mobile-toolbar-navigation-disabled::before { - visibility: hidden; + visibility: hidden; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item { - color: #cccccc; - font-size: 10px; - line-height: 10px; - margin: 0 2px; - padding-top: 3px; + color: #cccccc; + font-size: 10px; + line-height: 10px; + margin: 0 2px; + padding-top: 3px; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item.tinymce-mobile-dot-active { - color: #c8cbcf; + color: #c8cbcf; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-font::before, .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-heading::before { - margin-left: 0.5em; - margin-right: 0.9em; + margin-left: 0.5em; + margin-right: 0.9em; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-font::before, .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-heading::before { - margin-left: 0.9em; - margin-right: 0.5em; + margin-left: 0.9em; + margin-right: 0.5em; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider { - display: flex; - flex: 1; - margin-left: 0; - margin-right: 0; - padding: 0.28em 0; - position: relative; -} - + display: flex; + flex: 1; + margin-left: 0; + margin-right: 0; + padding: 0.28em 0; + position: relative; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container { - align-items: center; - display: flex; - flex-grow: 1; - height: 100%; + align-items: center; + display: flex; + flex-grow: 1; + height: 100%; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container .tinymce-mobile-slider-size-line { - background: #cccccc; - display: flex; - flex: 1; - height: 0.2em; - margin-bottom: 0.3em; - margin-top: 0.3em; -} - + background: #cccccc; + display: flex; + flex: 1; + height: 0.2em; + margin-bottom: 0.3em; + margin-top: 0.3em; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container { - padding-left: 2em; - padding-right: 2em; + padding-left: 2em; + padding-right: 2em; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container { - align-items: center; - display: flex; - flex-grow: 1; - height: 100%; + align-items: center; + display: flex; + flex-grow: 1; + height: 100%; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container .tinymce-mobile-slider-gradient { - background: linear-gradient(to right, hsl(0, 100%, 50%) 0%, hsl(60, 100%, 50%) 17%, hsl(120, 100%, 50%) 33%, hsl(180, 100%, 50%) 50%, hsl(240, 100%, 50%) 67%, hsl(300, 100%, 50%) 83%, hsl(0, 100%, 50%) 100%); - display: flex; - flex: 1; - height: 0.2em; - margin-bottom: 0.3em; - margin-top: 0.3em; -} - + background: linear-gradient(to right, hsl(0, 100%, 50%) 0%, hsl(60, 100%, 50%) 17%, hsl(120, 100%, 50%) 33%, hsl(180, 100%, 50%) 50%, hsl(240, 100%, 50%) 67%, hsl(300, 100%, 50%) 83%, hsl(0, 100%, 50%) 100%); + display: flex; + flex: 1; + height: 0.2em; + margin-bottom: 0.3em; + margin-top: 0.3em; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-black { - /* Not part of theming */ - background: black; - height: 0.2em; - margin-bottom: 0.3em; - margin-top: 0.3em; - width: 1.2em; -} - + /* Not part of theming */ + background: black; + height: 0.2em; + margin-bottom: 0.3em; + margin-top: 0.3em; + width: 1.2em; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-white { - /* Not part of theming */ - background: white; - height: 0.2em; - margin-bottom: 0.3em; - margin-top: 0.3em; - width: 1.2em; -} - + /* Not part of theming */ + background: white; + height: 0.2em; + margin-bottom: 0.3em; + margin-top: 0.3em; + width: 1.2em; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb { - /* vertically centering trick (margin: auto, top: 0, bottom: 0). On iOS and Safari, if you leave - * out these values, then it shows the thumb at the top of the spectrum. This is probably because it is - * absolutely positioned with only a left value, and not a top. Note, on Chrome it seems to be fine without - * this approach. - */ - align-items: center; - background-clip: padding-box; - background-color: #455a64; - border: 0.5em solid rgba(136, 136, 136, 0); - border-radius: 3em; - bottom: 0; - color: #fff; - display: flex; - height: 0.5em; - justify-content: center; - left: -10px; - margin: auto; - position: absolute; - top: 0; - transition: border 120ms cubic-bezier(0.39, 0.58, 0.57, 1); - width: 0.5em; -} - + /* vertically centering trick (margin: auto, top: 0, bottom: 0). On iOS and Safari, if you leave + * out these values, then it shows the thumb at the top of the spectrum. This is probably because it is + * absolutely positioned with only a left value, and not a top. Note, on Chrome it seems to be fine without + * this approach. + */ + align-items: center; + background-clip: padding-box; + background-color: #455a64; + border: 0.5em solid rgba(136, 136, 136, 0); + border-radius: 3em; + bottom: 0; + color: #fff; + display: flex; + height: 0.5em; + justify-content: center; + left: -10px; + margin: auto; + position: absolute; + top: 0; + transition: border 120ms cubic-bezier(0.39, 0.58, 0.57, 1); + width: 0.5em; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb.tinymce-mobile-thumb-active { - border: 0.5em solid rgba(136, 136, 136, 0.39); + border: 0.5em solid rgba(136, 136, 136, 0.39); } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper, .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group > div { - align-items: center; - display: flex; - height: 100%; - flex: 1; + align-items: center; + display: flex; + height: 100%; + flex: 1; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper { - flex-direction: column; - justify-content: center; + flex-direction: column; + justify-content: center; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item { - align-items: center; - display: flex; + align-items: center; + display: flex; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item:not(.tinymce-mobile-serialised-dialog) { - height: 100%; + height: 100%; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-container { - display: flex; + display: flex; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input { - background: #ffffff; - border: none; - border-radius: 0; - color: #455a64; - flex-grow: 1; - font-size: 0.85em; - padding-bottom: 0.1em; - padding-left: 5px; - padding-top: 0.1em; -} - + background: #ffffff; + border: none; + border-radius: 0; + color: #455a64; + flex-grow: 1; + font-size: 0.85em; + padding-bottom: 0.1em; + padding-left: 5px; + padding-top: 0.1em; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::-webkit-input-placeholder { - /* WebKit, Blink, Edge */ - color: #888; + /* WebKit, Blink, Edge */ + color: #888; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::placeholder { - /* WebKit, Blink, Edge */ - color: #888; + /* WebKit, Blink, Edge */ + color: #888; } - /* dropup */ .tinymce-mobile-dropup { - background: white; - display: flex; - overflow: hidden; - width: 100%; + background: white; + display: flex; + overflow: hidden; + width: 100%; } - .tinymce-mobile-dropup.tinymce-mobile-dropup-shrinking { - transition: height 0.3s ease-out; + transition: height 0.3s ease-out; } - .tinymce-mobile-dropup.tinymce-mobile-dropup-growing { - transition: height 0.3s ease-in; + transition: height 0.3s ease-in; } - .tinymce-mobile-dropup.tinymce-mobile-dropup-closed { - flex-grow: 0; + flex-grow: 0; } - .tinymce-mobile-dropup.tinymce-mobile-dropup-open:not(.tinymce-mobile-dropup-growing) { - flex-grow: 1; + flex-grow: 1; } - /* TODO min-height for device size and orientation */ .tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) { - min-height: 200px; + min-height: 200px; } - @media only screen and (orientation: landscape) { - .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) { - min-height: 200px; - } + .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) { + min-height: 200px; + } } - -@media only screen and (min-device-width: 320px) and (max-device-width: 568px) and (orientation: landscape) { - .tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) { - min-height: 150px; - } +@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape) { + .tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) { + min-height: 150px; + } } - /* styles menu */ .tinymce-mobile-styles-menu { - font-family: sans-serif; - outline: 4px solid black; - overflow: hidden; - position: relative; - width: 100%; + font-family: sans-serif; + outline: 4px solid black; + overflow: hidden; + position: relative; + width: 100%; } - .tinymce-mobile-styles-menu [role="menu"] { - display: flex; - flex-direction: column; - height: 100%; - position: absolute; - width: 100%; + display: flex; + flex-direction: column; + height: 100%; + position: absolute; + width: 100%; } - .tinymce-mobile-styles-menu [role="menu"].transitioning { - transition: transform 0.5s ease-in-out; + transition: transform 0.5s ease-in-out; } - .tinymce-mobile-styles-menu .tinymce-mobile-styles-item { - border-bottom: 1px solid #ddd; - color: #455a64; - cursor: pointer; - display: flex; - padding: 1em 1em; - position: relative; -} - + border-bottom: 1px solid #ddd; + color: #455a64; + cursor: pointer; + display: flex; + padding: 1em 1em; + position: relative; +} .tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser .tinymce-mobile-styles-collapse-icon::before { - color: #455a64; - content: "\e314"; - font-family: 'tinymce-mobile', sans-serif; + color: #455a64; + content: "\e314"; + font-family: 'tinymce-mobile', sans-serif; } - .tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-styles-item-is-menu::after { - color: #455a64; - content: "\e315"; - font-family: 'tinymce-mobile', sans-serif; - padding-left: 1em; - padding-right: 1em; - position: absolute; - right: 0; -} - + color: #455a64; + content: "\e315"; + font-family: 'tinymce-mobile', sans-serif; + padding-left: 1em; + padding-right: 1em; + position: absolute; + right: 0; +} .tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-format-matches::after { - font-family: 'tinymce-mobile', sans-serif; - padding-left: 1em; - padding-right: 1em; - position: absolute; - right: 0; + font-family: 'tinymce-mobile', sans-serif; + padding-left: 1em; + padding-right: 1em; + position: absolute; + right: 0; } - .tinymce-mobile-styles-menu .tinymce-mobile-styles-separator, .tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser { - align-items: center; - background: #fff; - border-top: #455a64; - color: #455a64; - display: flex; - min-height: 2.5em; - padding-left: 1em; - padding-right: 1em; -} - + align-items: center; + background: #fff; + border-top: #455a64; + color: #455a64; + display: flex; + min-height: 2.5em; + padding-left: 1em; + padding-right: 1em; +} .tinymce-mobile-styles-menu [data-transitioning-destination="before"][data-transitioning-state], .tinymce-mobile-styles-menu [data-transitioning-state="before"] { - transform: translate(-100%); + transform: translate(-100%); } - .tinymce-mobile-styles-menu [data-transitioning-destination="current"][data-transitioning-state], .tinymce-mobile-styles-menu [data-transitioning-state="current"] { - transform: translate(0%); + transform: translate(0%); } - .tinymce-mobile-styles-menu [data-transitioning-destination="after"][data-transitioning-state], .tinymce-mobile-styles-menu [data-transitioning-state="after"] { - transform: translate(100%); + transform: translate(100%); } - @font-face { - font-family: 'tinymce-mobile'; - font-style: normal; - font-weight: normal; - src: url('fonts/tinymce-mobile.woff?8x92w3') format('woff'); + font-family: 'tinymce-mobile'; + font-style: normal; + font-weight: normal; + src: url('fonts/tinymce-mobile.woff?8x92w3') format('woff'); } - @media (min-device-width: 700px) { - .tinymce-mobile-outer-container, - .tinymce-mobile-outer-container input { - font-size: 25px; - } + .tinymce-mobile-outer-container, + .tinymce-mobile-outer-container input { + font-size: 25px; + } } - @media (max-device-width: 700px) { - .tinymce-mobile-outer-container, - .tinymce-mobile-outer-container input { - font-size: 18px; - } + .tinymce-mobile-outer-container, + .tinymce-mobile-outer-container input { + font-size: 18px; + } } - .tinymce-mobile-icon { - font-family: 'tinymce-mobile', sans-serif; + font-family: 'tinymce-mobile', sans-serif; } - .mixin-flex-and-centre { - align-items: center; - display: flex; - justify-content: center; + align-items: center; + display: flex; + justify-content: center; } - .mixin-flex-bar { - align-items: center; - display: flex; - height: 100%; + align-items: center; + display: flex; + height: 100%; } - .tinymce-mobile-outer-container .tinymce-mobile-editor-socket iframe { - background-color: #fff; - width: 100%; + background-color: #fff; + width: 100%; } - .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon { - /* Note, on the iPod touch in landscape, this isn't visible when the navbar appears */ - background-color: #207ab7; - border-radius: 50%; - bottom: 1em; - color: white; - font-size: 1em; - height: 2.1em; - position: fixed; - right: 2em; - width: 2.1em; - align-items: center; - display: flex; - justify-content: center; -} - -@media only screen and (min-device-width: 700px) { - .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon { - font-size: 1.2em; - } -} - + /* Note, on the iPod touch in landscape, this isn't visible when the navbar appears */ + background-color: #207ab7; + border-radius: 50%; + bottom: 1em; + color: white; + font-size: 1em; + height: 2.1em; + position: fixed; + right: 2em; + width: 2.1em; + align-items: center; + display: flex; + justify-content: center; +} +@media only screen and (min-device-width:700px) { + .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon { + font-size: 1.2em; + } +} .tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket { - height: 300px; - overflow: hidden; + height: 300px; + overflow: hidden; } - .tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket iframe { - height: 100%; + height: 100%; } - .tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-toolstrip { - display: none; + display: none; } - /* Note, that if you don't include this (::-webkit-file-upload-button), the toolbar width gets increased and the whole body becomes scrollable. It's important! */ input[type="file"]::-webkit-file-upload-button { - display: none; + display: none; } - -@media only screen and (min-device-width: 320px) and (max-device-width: 568px) and (orientation: landscape) { - .tinymce-mobile-ios-container .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon { - bottom: 50%; - } +@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape) { + .tinymce-mobile-ios-container .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon { + bottom: 50%; + } } diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/skin.shadowdom.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/skin.shadowdom.css index d6b491a7..a9d2cbe4 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide-dark/skin.shadowdom.css @@ -5,37 +5,32 @@ * For commercial licenses see https://www.tiny.cloud/ */ body.tox-dialog__disable-scroll { - overflow: hidden; + overflow: hidden; } - .tox-fullscreen { - border: 0; - height: 100%; - left: 0; - margin: 0; - overflow: hidden; - -ms-scroll-chaining: none; - overscroll-behavior: none; - padding: 0; - position: fixed; - top: 0; - touch-action: pinch-zoom; - width: 100%; + border: 0; + height: 100%; + left: 0; + margin: 0; + overflow: hidden; + -ms-scroll-chaining: none; + overscroll-behavior: none; + padding: 0; + position: fixed; + top: 0; + touch-action: pinch-zoom; + width: 100%; } - .tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle { - display: none; + display: none; } - .tox.tox-tinymce.tox-fullscreen { - z-index: 1200; + z-index: 1200; } - .tox-shadowhost.tox-fullscreen { - z-index: 1200; + z-index: 1200; } - .tox-fullscreen .tox.tox-tinymce-aux, .tox-fullscreen ~ .tox.tox-tinymce-aux { - z-index: 1201; + z-index: 1201; } diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/content.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/content.css index 18be63ee..be3940ae 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/content.css +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/content.css @@ -5,56 +5,48 @@ * For commercial licenses see https://www.tiny.cloud/ */ .mce-content-body .mce-item-anchor { - background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; - cursor: default; - display: inline-block; - height: 12px !important; - padding: 0 2px; - -webkit-user-modify: read-only; - -moz-user-modify: read-only; - -webkit-user-select: all; - -moz-user-select: all; - -ms-user-select: all; - user-select: all; - width: 8px !important; -} - + background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; + cursor: default; + display: inline-block; + height: 12px !important; + padding: 0 2px; + -webkit-user-modify: read-only; + -moz-user-modify: read-only; + -webkit-user-select: all; + -moz-user-select: all; + -ms-user-select: all; + user-select: all; + width: 8px !important; +} .mce-content-body .mce-item-anchor[data-mce-selected] { - outline-offset: 1px; + outline-offset: 1px; } - .tox-comments-visible .tox-comment { - background-color: #fff0b7; + background-color: #fff0b7; } - .tox-comments-visible .tox-comment--active { - background-color: #ffe168; + background-color: #ffe168; } - .tox-checklist > li:not(.tox-checklist--hidden) { - list-style: none; - margin: 0.25em 0; + list-style: none; + margin: 0.25em 0; } - .tox-checklist > li:not(.tox-checklist--hidden)::before { - content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); - cursor: pointer; - height: 1em; - margin-left: -1.5em; - margin-top: 0.125em; - position: absolute; - width: 1em; -} - + content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); + cursor: pointer; + height: 1em; + margin-left: -1.5em; + margin-top: 0.125em; + position: absolute; + width: 1em; +} .tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before { - content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); + content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); } - [dir=rtl] .tox-checklist > li:not(.tox-checklist--hidden)::before { - margin-left: 0; - margin-right: -1.5em; + margin-left: 0; + margin-right: -1.5em; } - /* stylelint-disable */ /* http://prismjs.com/ */ /** @@ -64,81 +56,71 @@ */ code[class*="language-"], pre[class*="language-"] { - color: black; - background: none; - text-shadow: 0 1px white; - font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; - font-size: 1em; - text-align: left; - white-space: pre; - word-spacing: normal; - word-break: normal; - word-wrap: normal; - line-height: 1.5; - -moz-tab-size: 4; - tab-size: 4; - -webkit-hyphens: none; - -ms-hyphens: none; - hyphens: none; -} - + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-size: 1em; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + -moz-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { - text-shadow: none; - background: #b3d4fc; + text-shadow: none; + background: #b3d4fc; } - pre[class*="language-"]::selection, pre[class*="language-"] ::selection, code[class*="language-"]::selection, code[class*="language-"] ::selection { - text-shadow: none; - background: #b3d4fc; + text-shadow: none; + background: #b3d4fc; } - @media print { - code[class*="language-"], - pre[class*="language-"] { - text-shadow: none; - } + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } } - /* Code blocks */ pre[class*="language-"] { - padding: 1em; - margin: 0.5em 0; - overflow: auto; + padding: 1em; + margin: 0.5em 0; + overflow: auto; } - :not(pre) > code[class*="language-"], pre[class*="language-"] { - background: #f5f2f0; + background: #f5f2f0; } - /* Inline code */ :not(pre) > code[class*="language-"] { - padding: 0.1em; - border-radius: 0.3em; - white-space: normal; + padding: 0.1em; + border-radius: 0.3em; + white-space: normal; } - .token.comment, .token.prolog, .token.doctype, .token.cdata { - color: slategray; + color: slategray; } - .token.punctuation { - color: #999; + color: #999; } - .namespace { - opacity: 0.7; + opacity: 0.7; } - .token.property, .token.tag, .token.boolean, @@ -146,537 +128,447 @@ pre[class*="language-"] { .token.constant, .token.symbol, .token.deleted { - color: #905; + color: #905; } - .token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { - color: #690; + color: #690; } - .token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { - color: #9a6e3a; - background: hsla(0, 0%, 100%, 0.5); + color: #9a6e3a; + background: hsla(0, 0%, 100%, 0.5); } - .token.atrule, .token.attr-value, .token.keyword { - color: #07a; + color: #07a; } - .token.function, .token.class-name { - color: #DD4A68; + color: #DD4A68; } - .token.regex, .token.important, .token.variable { - color: #e90; + color: #e90; } - .token.important, .token.bold { - font-weight: bold; + font-weight: bold; } - .token.italic { - font-style: italic; + font-style: italic; } - .token.entity { - cursor: help; + cursor: help; } - /* stylelint-enable */ .mce-content-body { - overflow-wrap: break-word; - word-wrap: break-word; + overflow-wrap: break-word; + word-wrap: break-word; } - .mce-content-body .mce-visual-caret { - background-color: black; - background-color: currentColor; - position: absolute; + background-color: black; + background-color: currentColor; + position: absolute; } - .mce-content-body .mce-visual-caret-hidden { - display: none; + display: none; } - .mce-content-body *[data-mce-caret] { - left: -1000px; - margin: 0; - padding: 0; - position: absolute; - right: auto; - top: 0; -} - + left: -1000px; + margin: 0; + padding: 0; + position: absolute; + right: auto; + top: 0; +} .mce-content-body .mce-offscreen-selection { - left: -2000000px; - max-width: 1000000px; - position: absolute; + left: -2000000px; + max-width: 1000000px; + position: absolute; } - .mce-content-body *[contentEditable=false] { - cursor: default; + cursor: default; } - .mce-content-body *[contentEditable=true] { - cursor: text; + cursor: text; } - .tox-cursor-format-painter { - cursor: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"), default; + cursor: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"), default; } - .mce-content-body figure.align-left { - float: left; + float: left; } - .mce-content-body figure.align-right { - float: right; + float: right; } - .mce-content-body figure.image.align-center { - display: table; - margin-left: auto; - margin-right: auto; + display: table; + margin-left: auto; + margin-right: auto; } - .mce-preview-object { - border: 1px solid gray; - display: inline-block; - line-height: 0; - margin: 0 2px 0 2px; - position: relative; + border: 1px solid gray; + display: inline-block; + line-height: 0; + margin: 0 2px 0 2px; + position: relative; } - .mce-preview-object .mce-shim { - background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; -} - + background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} .mce-preview-object[data-mce-selected="2"] .mce-shim { - display: none; + display: none; } - .mce-object { - background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; - border: 1px dashed #aaa; + background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; + border: 1px dashed #aaa; } - .mce-pagebreak { - border: 1px dashed #aaa; - cursor: default; - display: block; - height: 5px; - margin-top: 15px; - page-break-before: always; - width: 100%; -} - + border: 1px dashed #aaa; + cursor: default; + display: block; + height: 5px; + margin-top: 15px; + page-break-before: always; + width: 100%; +} @media print { - .mce-pagebreak { - border: 0; - } + .mce-pagebreak { + border: 0; + } } - .tiny-pageembed .mce-shim { - background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; -} - + background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} .tiny-pageembed[data-mce-selected="2"] .mce-shim { - display: none; + display: none; } - .tiny-pageembed { - display: inline-block; - position: relative; + display: inline-block; + position: relative; } - .tiny-pageembed--21by9, .tiny-pageembed--16by9, .tiny-pageembed--4by3, .tiny-pageembed--1by1 { - display: block; - overflow: hidden; - padding: 0; - position: relative; - width: 100%; + display: block; + overflow: hidden; + padding: 0; + position: relative; + width: 100%; } - .tiny-pageembed--21by9 { - padding-top: 42.857143%; + padding-top: 42.857143%; } - .tiny-pageembed--16by9 { - padding-top: 56.25%; + padding-top: 56.25%; } - .tiny-pageembed--4by3 { - padding-top: 75%; + padding-top: 75%; } - .tiny-pageembed--1by1 { - padding-top: 100%; + padding-top: 100%; } - .tiny-pageembed--21by9 iframe, .tiny-pageembed--16by9 iframe, .tiny-pageembed--4by3 iframe, .tiny-pageembed--1by1 iframe { - border: 0; - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; + border: 0; + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; } - .mce-content-body[data-mce-placeholder] { - position: relative; + position: relative; } - .mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before { - color: rgba(34, 47, 62, 0.7); - content: attr(data-mce-placeholder); - position: absolute; + color: rgba(34, 47, 62, 0.7); + content: attr(data-mce-placeholder); + position: absolute; } - .mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before { - left: 1px; + left: 1px; } - .mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before { - right: 1px; + right: 1px; } - .mce-content-body div.mce-resizehandle { - background-color: #4099ff; - border-color: #4099ff; - border-style: solid; - border-width: 1px; - box-sizing: border-box; - height: 10px; - position: absolute; - width: 10px; - z-index: 10000; -} - + background-color: #4099ff; + border-color: #4099ff; + border-style: solid; + border-width: 1px; + box-sizing: border-box; + height: 10px; + position: absolute; + width: 10px; + z-index: 10000; +} .mce-content-body div.mce-resizehandle:hover { - background-color: #4099ff; + background-color: #4099ff; } - .mce-content-body div.mce-resizehandle:nth-of-type(1) { - cursor: nwse-resize; + cursor: nwse-resize; } - .mce-content-body div.mce-resizehandle:nth-of-type(2) { - cursor: nesw-resize; + cursor: nesw-resize; } - .mce-content-body div.mce-resizehandle:nth-of-type(3) { - cursor: nwse-resize; + cursor: nwse-resize; } - .mce-content-body div.mce-resizehandle:nth-of-type(4) { - cursor: nesw-resize; + cursor: nesw-resize; } - .mce-content-body .mce-clonedresizable { - opacity: 0.5; - outline: 1px dashed black; - position: absolute; - z-index: 10000; + opacity: 0.5; + outline: 1px dashed black; + position: absolute; + z-index: 10000; } - .mce-content-body .mce-clonedresizable.mce-resizetable-columns th, .mce-content-body .mce-clonedresizable.mce-resizetable-columns td { - border: 0; + border: 0; } - .mce-content-body .mce-resize-helper { - background: #555; - background: rgba(0, 0, 0, 0.75); - border: 1px; - border-radius: 3px; - color: white; - display: none; - font-family: sans-serif; - font-size: 12px; - line-height: 14px; - margin: 5px 10px; - padding: 5px; - position: absolute; - white-space: nowrap; - z-index: 10001; -} - + background: #555; + background: rgba(0, 0, 0, 0.75); + border: 1px; + border-radius: 3px; + color: white; + display: none; + font-family: sans-serif; + font-size: 12px; + line-height: 14px; + margin: 5px 10px; + padding: 5px; + position: absolute; + white-space: nowrap; + z-index: 10001; +} .tox-rtc-user-selection { - position: relative; + position: relative; } - .tox-rtc-user-cursor { - bottom: 0; - cursor: default; - position: absolute; - top: 0; - width: 2px; + bottom: 0; + cursor: default; + position: absolute; + top: 0; + width: 2px; } - .tox-rtc-user-cursor::before { - background-color: inherit; - border-radius: 50%; - content: ''; - display: block; - height: 8px; - position: absolute; - right: -3px; - top: -3px; - width: 8px; -} - + background-color: inherit; + border-radius: 50%; + content: ''; + display: block; + height: 8px; + position: absolute; + right: -3px; + top: -3px; + width: 8px; +} .tox-rtc-user-cursor:hover::after { - background-color: inherit; - border-radius: 100px; - box-sizing: border-box; - color: #fff; - content: attr(data-user); - display: block; - font-size: 12px; - font-weight: bold; - left: -5px; - min-height: 8px; - min-width: 8px; - padding: 0 12px; - position: absolute; - top: -11px; - white-space: nowrap; - z-index: 1000; -} - + background-color: inherit; + border-radius: 100px; + box-sizing: border-box; + color: #fff; + content: attr(data-user); + display: block; + font-size: 12px; + font-weight: bold; + left: -5px; + min-height: 8px; + min-width: 8px; + padding: 0 12px; + position: absolute; + top: -11px; + white-space: nowrap; + z-index: 1000; +} .tox-rtc-user-selection--1 .tox-rtc-user-cursor { - background-color: #2dc26b; + background-color: #2dc26b; } - .tox-rtc-user-selection--2 .tox-rtc-user-cursor { - background-color: #e03e2d; + background-color: #e03e2d; } - .tox-rtc-user-selection--3 .tox-rtc-user-cursor { - background-color: #f1c40f; + background-color: #f1c40f; } - .tox-rtc-user-selection--4 .tox-rtc-user-cursor { - background-color: #3598db; + background-color: #3598db; } - .tox-rtc-user-selection--5 .tox-rtc-user-cursor { - background-color: #b96ad9; + background-color: #b96ad9; } - .tox-rtc-user-selection--6 .tox-rtc-user-cursor { - background-color: #e67e23; + background-color: #e67e23; } - .tox-rtc-user-selection--7 .tox-rtc-user-cursor { - background-color: #aaa69d; + background-color: #aaa69d; } - .tox-rtc-user-selection--8 .tox-rtc-user-cursor { - background-color: #f368e0; + background-color: #f368e0; } - .tox-rtc-remote-image { - background: #eaeaea url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A") no-repeat center center; - border: 1px solid #ccc; - min-height: 240px; - min-width: 320px; + background: #eaeaea url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A") no-repeat center center; + border: 1px solid #ccc; + min-height: 240px; + min-width: 320px; } - .mce-match-marker { - background: #aaa; - color: #fff; + background: #aaa; + color: #fff; } - .mce-match-marker-selected { - background: #39f; - color: #fff; + background: #39f; + color: #fff; } - .mce-match-marker-selected::-moz-selection { - background: #39f; - color: #fff; + background: #39f; + color: #fff; } - .mce-match-marker-selected::selection { - background: #39f; - color: #fff; + background: #39f; + color: #fff; } - .mce-content-body img[data-mce-selected], .mce-content-body video[data-mce-selected], .mce-content-body audio[data-mce-selected], .mce-content-body object[data-mce-selected], .mce-content-body embed[data-mce-selected], .mce-content-body table[data-mce-selected] { - outline: 3px solid #b4d7ff; + outline: 3px solid #b4d7ff; } - .mce-content-body hr[data-mce-selected] { - outline: 3px solid #b4d7ff; - outline-offset: 1px; + outline: 3px solid #b4d7ff; + outline-offset: 1px; } - .mce-content-body *[contentEditable=false] *[contentEditable=true]:focus { - outline: 3px solid #b4d7ff; + outline: 3px solid #b4d7ff; } - .mce-content-body *[contentEditable=false] *[contentEditable=true]:hover { - outline: 3px solid #b4d7ff; + outline: 3px solid #b4d7ff; } - .mce-content-body *[contentEditable=false][data-mce-selected] { - cursor: not-allowed; - outline: 3px solid #b4d7ff; + cursor: not-allowed; + outline: 3px solid #b4d7ff; } - .mce-content-body.mce-content-readonly *[contentEditable=true]:focus, .mce-content-body.mce-content-readonly *[contentEditable=true]:hover { - outline: none; + outline: none; } - .mce-content-body *[data-mce-selected="inline-boundary"] { - background-color: #b4d7ff; + background-color: #b4d7ff; } - .mce-content-body .mce-edit-focus { - outline: 3px solid #b4d7ff; + outline: 3px solid #b4d7ff; } - .mce-content-body td[data-mce-selected], .mce-content-body th[data-mce-selected] { - position: relative; + position: relative; } - .mce-content-body td[data-mce-selected]::-moz-selection, .mce-content-body th[data-mce-selected]::-moz-selection { - background: none; + background: none; } - .mce-content-body td[data-mce-selected]::selection, .mce-content-body th[data-mce-selected]::selection { - background: none; + background: none; } - .mce-content-body td[data-mce-selected] *, .mce-content-body th[data-mce-selected] * { - outline: none; - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - + outline: none; + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} .mce-content-body td[data-mce-selected]::after, .mce-content-body th[data-mce-selected]::after { - background-color: rgba(180, 215, 255, 0.7); - border: 1px solid rgba(180, 215, 255, 0.7); - bottom: -1px; - content: ''; - left: -1px; - mix-blend-mode: multiply; - position: absolute; - right: -1px; - top: -1px; -} - + background-color: rgba(180, 215, 255, 0.7); + border: 1px solid rgba(180, 215, 255, 0.7); + bottom: -1px; + content: ''; + left: -1px; + mix-blend-mode: multiply; + position: absolute; + right: -1px; + top: -1px; +} @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { - .mce-content-body td[data-mce-selected]::after, - .mce-content-body th[data-mce-selected]::after { - border-color: rgba(0, 84, 180, 0.7); - } + .mce-content-body td[data-mce-selected]::after, + .mce-content-body th[data-mce-selected]::after { + border-color: rgba(0, 84, 180, 0.7); + } } - .mce-content-body img::-moz-selection { - background: none; + background: none; } - .mce-content-body img::selection { - background: none; + background: none; } - .ephox-snooker-resizer-bar { - background-color: #b4d7ff; - opacity: 0; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - + background-color: #b4d7ff; + opacity: 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} .ephox-snooker-resizer-cols { - cursor: col-resize; + cursor: col-resize; } - .ephox-snooker-resizer-rows { - cursor: row-resize; + cursor: row-resize; } - .ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging { - opacity: 1; + opacity: 1; } - .mce-spellchecker-word { - background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); - background-position: 0 calc(100% + 1px); - background-repeat: repeat-x; - background-size: auto 6px; - cursor: default; - height: 2rem; -} - + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); + background-position: 0 calc(100% + 1px); + background-repeat: repeat-x; + background-size: auto 6px; + cursor: default; + height: 2rem; +} .mce-spellchecker-grammar { - background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); - background-position: 0 calc(100% + 1px); - background-repeat: repeat-x; - background-size: auto 6px; - cursor: default; + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); + background-position: 0 calc(100% + 1px); + background-repeat: repeat-x; + background-size: auto 6px; + cursor: default; } - .mce-toc { - border: 1px solid gray; + border: 1px solid gray; } - .mce-toc h2 { - margin: 4px; + margin: 4px; } - .mce-toc li { - list-style-type: none; + list-style-type: none; } - table[style*="border-width: 0px"], .mce-item-table:not([border]), .mce-item-table[border="0"], @@ -689,9 +581,8 @@ table[style*="border-width: 0px"] th, table[style*="border-width: 0px"] caption, .mce-item-table:not([border]) caption, .mce-item-table[border="0"] caption { - border: 1px dashed #bbb; + border: 1px dashed #bbb; } - .mce-visualblocks p, .mce-visualblocks h1, .mce-visualblocks h2, @@ -712,92 +603,71 @@ table[style*="border-width: 0px"] caption, .mce-visualblocks ul, .mce-visualblocks ol, .mce-visualblocks dl { - background-repeat: no-repeat; - border: 1px dashed #bbb; - margin-left: 3px; - padding-top: 10px; + background-repeat: no-repeat; + border: 1px dashed #bbb; + margin-left: 3px; + padding-top: 10px; } - .mce-visualblocks p { - background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); + background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); } - .mce-visualblocks h1 { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); } - .mce-visualblocks h2 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); } - .mce-visualblocks h3 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); } - .mce-visualblocks h4 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); } - .mce-visualblocks h5 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); } - .mce-visualblocks h6 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); } - .mce-visualblocks div:not([data-mce-bogus]) { - background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); + background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); } - .mce-visualblocks section { - background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); + background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); } - .mce-visualblocks article { - background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); + background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); } - .mce-visualblocks blockquote { - background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); + background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); } - .mce-visualblocks address { - background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); + background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); } - .mce-visualblocks pre { - background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); } - .mce-visualblocks figure { - background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); + background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); } - .mce-visualblocks figcaption { - border: 1px dashed #bbb; + border: 1px dashed #bbb; } - .mce-visualblocks hgroup { - background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); + background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); } - .mce-visualblocks aside { - background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); + background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); } - .mce-visualblocks ul { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==); } - .mce-visualblocks ol { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); } - .mce-visualblocks dl { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==); } - .mce-visualblocks:not([dir=rtl]) p, .mce-visualblocks:not([dir=rtl]) h1, .mce-visualblocks:not([dir=rtl]) h2, @@ -818,9 +688,8 @@ table[style*="border-width: 0px"] caption, .mce-visualblocks:not([dir=rtl]) ul, .mce-visualblocks:not([dir=rtl]) ol, .mce-visualblocks:not([dir=rtl]) dl { - margin-left: 3px; + margin-left: 3px; } - .mce-visualblocks[dir=rtl] p, .mce-visualblocks[dir=rtl] h1, .mce-visualblocks[dir=rtl] h2, @@ -841,23 +710,19 @@ table[style*="border-width: 0px"] caption, .mce-visualblocks[dir=rtl] ul, .mce-visualblocks[dir=rtl] ol, .mce-visualblocks[dir=rtl] dl { - background-position-x: right; - margin-right: 3px; + background-position-x: right; + margin-right: 3px; } - .mce-nbsp, .mce-shy { - background: #aaa; + background: #aaa; } - .mce-shy::after { - content: '-'; + content: '-'; } - body { - font-family: sans-serif; + font-family: sans-serif; } - table { - border-collapse: collapse; + border-collapse: collapse; } diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/content.inline.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/content.inline.css index a36c6fb7..280d6fc7 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/content.inline.css +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/content.inline.css @@ -5,56 +5,48 @@ * For commercial licenses see https://www.tiny.cloud/ */ .mce-content-body .mce-item-anchor { - background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; - cursor: default; - display: inline-block; - height: 12px !important; - padding: 0 2px; - -webkit-user-modify: read-only; - -moz-user-modify: read-only; - -webkit-user-select: all; - -moz-user-select: all; - -ms-user-select: all; - user-select: all; - width: 8px !important; -} - + background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; + cursor: default; + display: inline-block; + height: 12px !important; + padding: 0 2px; + -webkit-user-modify: read-only; + -moz-user-modify: read-only; + -webkit-user-select: all; + -moz-user-select: all; + -ms-user-select: all; + user-select: all; + width: 8px !important; +} .mce-content-body .mce-item-anchor[data-mce-selected] { - outline-offset: 1px; + outline-offset: 1px; } - .tox-comments-visible .tox-comment { - background-color: #fff0b7; + background-color: #fff0b7; } - .tox-comments-visible .tox-comment--active { - background-color: #ffe168; + background-color: #ffe168; } - .tox-checklist > li:not(.tox-checklist--hidden) { - list-style: none; - margin: 0.25em 0; + list-style: none; + margin: 0.25em 0; } - .tox-checklist > li:not(.tox-checklist--hidden)::before { - content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); - cursor: pointer; - height: 1em; - margin-left: -1.5em; - margin-top: 0.125em; - position: absolute; - width: 1em; -} - + content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); + cursor: pointer; + height: 1em; + margin-left: -1.5em; + margin-top: 0.125em; + position: absolute; + width: 1em; +} .tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before { - content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); + content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); } - [dir=rtl] .tox-checklist > li:not(.tox-checklist--hidden)::before { - margin-left: 0; - margin-right: -1.5em; + margin-left: 0; + margin-right: -1.5em; } - /* stylelint-disable */ /* http://prismjs.com/ */ /** @@ -64,81 +56,71 @@ */ code[class*="language-"], pre[class*="language-"] { - color: black; - background: none; - text-shadow: 0 1px white; - font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; - font-size: 1em; - text-align: left; - white-space: pre; - word-spacing: normal; - word-break: normal; - word-wrap: normal; - line-height: 1.5; - -moz-tab-size: 4; - tab-size: 4; - -webkit-hyphens: none; - -ms-hyphens: none; - hyphens: none; -} - + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + font-size: 1em; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + -moz-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { - text-shadow: none; - background: #b3d4fc; + text-shadow: none; + background: #b3d4fc; } - pre[class*="language-"]::selection, pre[class*="language-"] ::selection, code[class*="language-"]::selection, code[class*="language-"] ::selection { - text-shadow: none; - background: #b3d4fc; + text-shadow: none; + background: #b3d4fc; } - @media print { - code[class*="language-"], - pre[class*="language-"] { - text-shadow: none; - } + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } } - /* Code blocks */ pre[class*="language-"] { - padding: 1em; - margin: 0.5em 0; - overflow: auto; + padding: 1em; + margin: 0.5em 0; + overflow: auto; } - :not(pre) > code[class*="language-"], pre[class*="language-"] { - background: #f5f2f0; + background: #f5f2f0; } - /* Inline code */ :not(pre) > code[class*="language-"] { - padding: 0.1em; - border-radius: 0.3em; - white-space: normal; + padding: 0.1em; + border-radius: 0.3em; + white-space: normal; } - .token.comment, .token.prolog, .token.doctype, .token.cdata { - color: slategray; + color: slategray; } - .token.punctuation { - color: #999; + color: #999; } - .namespace { - opacity: 0.7; + opacity: 0.7; } - .token.property, .token.tag, .token.boolean, @@ -146,537 +128,447 @@ pre[class*="language-"] { .token.constant, .token.symbol, .token.deleted { - color: #905; + color: #905; } - .token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { - color: #690; + color: #690; } - .token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { - color: #9a6e3a; - background: hsla(0, 0%, 100%, 0.5); + color: #9a6e3a; + background: hsla(0, 0%, 100%, 0.5); } - .token.atrule, .token.attr-value, .token.keyword { - color: #07a; + color: #07a; } - .token.function, .token.class-name { - color: #DD4A68; + color: #DD4A68; } - .token.regex, .token.important, .token.variable { - color: #e90; + color: #e90; } - .token.important, .token.bold { - font-weight: bold; + font-weight: bold; } - .token.italic { - font-style: italic; + font-style: italic; } - .token.entity { - cursor: help; + cursor: help; } - /* stylelint-enable */ .mce-content-body { - overflow-wrap: break-word; - word-wrap: break-word; + overflow-wrap: break-word; + word-wrap: break-word; } - .mce-content-body .mce-visual-caret { - background-color: black; - background-color: currentColor; - position: absolute; + background-color: black; + background-color: currentColor; + position: absolute; } - .mce-content-body .mce-visual-caret-hidden { - display: none; + display: none; } - .mce-content-body *[data-mce-caret] { - left: -1000px; - margin: 0; - padding: 0; - position: absolute; - right: auto; - top: 0; -} - + left: -1000px; + margin: 0; + padding: 0; + position: absolute; + right: auto; + top: 0; +} .mce-content-body .mce-offscreen-selection { - left: -2000000px; - max-width: 1000000px; - position: absolute; + left: -2000000px; + max-width: 1000000px; + position: absolute; } - .mce-content-body *[contentEditable=false] { - cursor: default; + cursor: default; } - .mce-content-body *[contentEditable=true] { - cursor: text; + cursor: text; } - .tox-cursor-format-painter { - cursor: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"), default; + cursor: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"), default; } - .mce-content-body figure.align-left { - float: left; + float: left; } - .mce-content-body figure.align-right { - float: right; + float: right; } - .mce-content-body figure.image.align-center { - display: table; - margin-left: auto; - margin-right: auto; + display: table; + margin-left: auto; + margin-right: auto; } - .mce-preview-object { - border: 1px solid gray; - display: inline-block; - line-height: 0; - margin: 0 2px 0 2px; - position: relative; + border: 1px solid gray; + display: inline-block; + line-height: 0; + margin: 0 2px 0 2px; + position: relative; } - .mce-preview-object .mce-shim { - background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; -} - + background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} .mce-preview-object[data-mce-selected="2"] .mce-shim { - display: none; + display: none; } - .mce-object { - background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; - border: 1px dashed #aaa; + background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; + border: 1px dashed #aaa; } - .mce-pagebreak { - border: 1px dashed #aaa; - cursor: default; - display: block; - height: 5px; - margin-top: 15px; - page-break-before: always; - width: 100%; -} - + border: 1px dashed #aaa; + cursor: default; + display: block; + height: 5px; + margin-top: 15px; + page-break-before: always; + width: 100%; +} @media print { - .mce-pagebreak { - border: 0; - } + .mce-pagebreak { + border: 0; + } } - .tiny-pageembed .mce-shim { - background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; -} - + background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} .tiny-pageembed[data-mce-selected="2"] .mce-shim { - display: none; + display: none; } - .tiny-pageembed { - display: inline-block; - position: relative; + display: inline-block; + position: relative; } - .tiny-pageembed--21by9, .tiny-pageembed--16by9, .tiny-pageembed--4by3, .tiny-pageembed--1by1 { - display: block; - overflow: hidden; - padding: 0; - position: relative; - width: 100%; + display: block; + overflow: hidden; + padding: 0; + position: relative; + width: 100%; } - .tiny-pageembed--21by9 { - padding-top: 42.857143%; + padding-top: 42.857143%; } - .tiny-pageembed--16by9 { - padding-top: 56.25%; + padding-top: 56.25%; } - .tiny-pageembed--4by3 { - padding-top: 75%; + padding-top: 75%; } - .tiny-pageembed--1by1 { - padding-top: 100%; + padding-top: 100%; } - .tiny-pageembed--21by9 iframe, .tiny-pageembed--16by9 iframe, .tiny-pageembed--4by3 iframe, .tiny-pageembed--1by1 iframe { - border: 0; - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; + border: 0; + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; } - .mce-content-body[data-mce-placeholder] { - position: relative; + position: relative; } - .mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before { - color: rgba(34, 47, 62, 0.7); - content: attr(data-mce-placeholder); - position: absolute; + color: rgba(34, 47, 62, 0.7); + content: attr(data-mce-placeholder); + position: absolute; } - .mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before { - left: 1px; + left: 1px; } - .mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before { - right: 1px; + right: 1px; } - .mce-content-body div.mce-resizehandle { - background-color: #4099ff; - border-color: #4099ff; - border-style: solid; - border-width: 1px; - box-sizing: border-box; - height: 10px; - position: absolute; - width: 10px; - z-index: 10000; -} - + background-color: #4099ff; + border-color: #4099ff; + border-style: solid; + border-width: 1px; + box-sizing: border-box; + height: 10px; + position: absolute; + width: 10px; + z-index: 10000; +} .mce-content-body div.mce-resizehandle:hover { - background-color: #4099ff; + background-color: #4099ff; } - .mce-content-body div.mce-resizehandle:nth-of-type(1) { - cursor: nwse-resize; + cursor: nwse-resize; } - .mce-content-body div.mce-resizehandle:nth-of-type(2) { - cursor: nesw-resize; + cursor: nesw-resize; } - .mce-content-body div.mce-resizehandle:nth-of-type(3) { - cursor: nwse-resize; + cursor: nwse-resize; } - .mce-content-body div.mce-resizehandle:nth-of-type(4) { - cursor: nesw-resize; + cursor: nesw-resize; } - .mce-content-body .mce-clonedresizable { - opacity: 0.5; - outline: 1px dashed black; - position: absolute; - z-index: 10000; + opacity: 0.5; + outline: 1px dashed black; + position: absolute; + z-index: 10000; } - .mce-content-body .mce-clonedresizable.mce-resizetable-columns th, .mce-content-body .mce-clonedresizable.mce-resizetable-columns td { - border: 0; + border: 0; } - .mce-content-body .mce-resize-helper { - background: #555; - background: rgba(0, 0, 0, 0.75); - border: 1px; - border-radius: 3px; - color: white; - display: none; - font-family: sans-serif; - font-size: 12px; - line-height: 14px; - margin: 5px 10px; - padding: 5px; - position: absolute; - white-space: nowrap; - z-index: 10001; -} - + background: #555; + background: rgba(0, 0, 0, 0.75); + border: 1px; + border-radius: 3px; + color: white; + display: none; + font-family: sans-serif; + font-size: 12px; + line-height: 14px; + margin: 5px 10px; + padding: 5px; + position: absolute; + white-space: nowrap; + z-index: 10001; +} .tox-rtc-user-selection { - position: relative; + position: relative; } - .tox-rtc-user-cursor { - bottom: 0; - cursor: default; - position: absolute; - top: 0; - width: 2px; + bottom: 0; + cursor: default; + position: absolute; + top: 0; + width: 2px; } - .tox-rtc-user-cursor::before { - background-color: inherit; - border-radius: 50%; - content: ''; - display: block; - height: 8px; - position: absolute; - right: -3px; - top: -3px; - width: 8px; -} - + background-color: inherit; + border-radius: 50%; + content: ''; + display: block; + height: 8px; + position: absolute; + right: -3px; + top: -3px; + width: 8px; +} .tox-rtc-user-cursor:hover::after { - background-color: inherit; - border-radius: 100px; - box-sizing: border-box; - color: #fff; - content: attr(data-user); - display: block; - font-size: 12px; - font-weight: bold; - left: -5px; - min-height: 8px; - min-width: 8px; - padding: 0 12px; - position: absolute; - top: -11px; - white-space: nowrap; - z-index: 1000; -} - + background-color: inherit; + border-radius: 100px; + box-sizing: border-box; + color: #fff; + content: attr(data-user); + display: block; + font-size: 12px; + font-weight: bold; + left: -5px; + min-height: 8px; + min-width: 8px; + padding: 0 12px; + position: absolute; + top: -11px; + white-space: nowrap; + z-index: 1000; +} .tox-rtc-user-selection--1 .tox-rtc-user-cursor { - background-color: #2dc26b; + background-color: #2dc26b; } - .tox-rtc-user-selection--2 .tox-rtc-user-cursor { - background-color: #e03e2d; + background-color: #e03e2d; } - .tox-rtc-user-selection--3 .tox-rtc-user-cursor { - background-color: #f1c40f; + background-color: #f1c40f; } - .tox-rtc-user-selection--4 .tox-rtc-user-cursor { - background-color: #3598db; + background-color: #3598db; } - .tox-rtc-user-selection--5 .tox-rtc-user-cursor { - background-color: #b96ad9; + background-color: #b96ad9; } - .tox-rtc-user-selection--6 .tox-rtc-user-cursor { - background-color: #e67e23; + background-color: #e67e23; } - .tox-rtc-user-selection--7 .tox-rtc-user-cursor { - background-color: #aaa69d; + background-color: #aaa69d; } - .tox-rtc-user-selection--8 .tox-rtc-user-cursor { - background-color: #f368e0; + background-color: #f368e0; } - .tox-rtc-remote-image { - background: #eaeaea url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A") no-repeat center center; - border: 1px solid #ccc; - min-height: 240px; - min-width: 320px; + background: #eaeaea url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A") no-repeat center center; + border: 1px solid #ccc; + min-height: 240px; + min-width: 320px; } - .mce-match-marker { - background: #aaa; - color: #fff; + background: #aaa; + color: #fff; } - .mce-match-marker-selected { - background: #39f; - color: #fff; + background: #39f; + color: #fff; } - .mce-match-marker-selected::-moz-selection { - background: #39f; - color: #fff; + background: #39f; + color: #fff; } - .mce-match-marker-selected::selection { - background: #39f; - color: #fff; + background: #39f; + color: #fff; } - .mce-content-body img[data-mce-selected], .mce-content-body video[data-mce-selected], .mce-content-body audio[data-mce-selected], .mce-content-body object[data-mce-selected], .mce-content-body embed[data-mce-selected], .mce-content-body table[data-mce-selected] { - outline: 3px solid #b4d7ff; + outline: 3px solid #b4d7ff; } - .mce-content-body hr[data-mce-selected] { - outline: 3px solid #b4d7ff; - outline-offset: 1px; + outline: 3px solid #b4d7ff; + outline-offset: 1px; } - .mce-content-body *[contentEditable=false] *[contentEditable=true]:focus { - outline: 3px solid #b4d7ff; + outline: 3px solid #b4d7ff; } - .mce-content-body *[contentEditable=false] *[contentEditable=true]:hover { - outline: 3px solid #b4d7ff; + outline: 3px solid #b4d7ff; } - .mce-content-body *[contentEditable=false][data-mce-selected] { - cursor: not-allowed; - outline: 3px solid #b4d7ff; + cursor: not-allowed; + outline: 3px solid #b4d7ff; } - .mce-content-body.mce-content-readonly *[contentEditable=true]:focus, .mce-content-body.mce-content-readonly *[contentEditable=true]:hover { - outline: none; + outline: none; } - .mce-content-body *[data-mce-selected="inline-boundary"] { - background-color: #b4d7ff; + background-color: #b4d7ff; } - .mce-content-body .mce-edit-focus { - outline: 3px solid #b4d7ff; + outline: 3px solid #b4d7ff; } - .mce-content-body td[data-mce-selected], .mce-content-body th[data-mce-selected] { - position: relative; + position: relative; } - .mce-content-body td[data-mce-selected]::-moz-selection, .mce-content-body th[data-mce-selected]::-moz-selection { - background: none; + background: none; } - .mce-content-body td[data-mce-selected]::selection, .mce-content-body th[data-mce-selected]::selection { - background: none; + background: none; } - .mce-content-body td[data-mce-selected] *, .mce-content-body th[data-mce-selected] * { - outline: none; - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - + outline: none; + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} .mce-content-body td[data-mce-selected]::after, .mce-content-body th[data-mce-selected]::after { - background-color: rgba(180, 215, 255, 0.7); - border: 1px solid rgba(180, 215, 255, 0.7); - bottom: -1px; - content: ''; - left: -1px; - mix-blend-mode: multiply; - position: absolute; - right: -1px; - top: -1px; -} - + background-color: rgba(180, 215, 255, 0.7); + border: 1px solid rgba(180, 215, 255, 0.7); + bottom: -1px; + content: ''; + left: -1px; + mix-blend-mode: multiply; + position: absolute; + right: -1px; + top: -1px; +} @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { - .mce-content-body td[data-mce-selected]::after, - .mce-content-body th[data-mce-selected]::after { - border-color: rgba(0, 84, 180, 0.7); - } + .mce-content-body td[data-mce-selected]::after, + .mce-content-body th[data-mce-selected]::after { + border-color: rgba(0, 84, 180, 0.7); + } } - .mce-content-body img::-moz-selection { - background: none; + background: none; } - .mce-content-body img::selection { - background: none; + background: none; } - .ephox-snooker-resizer-bar { - background-color: #b4d7ff; - opacity: 0; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - + background-color: #b4d7ff; + opacity: 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} .ephox-snooker-resizer-cols { - cursor: col-resize; + cursor: col-resize; } - .ephox-snooker-resizer-rows { - cursor: row-resize; + cursor: row-resize; } - .ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging { - opacity: 1; + opacity: 1; } - .mce-spellchecker-word { - background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); - background-position: 0 calc(100% + 1px); - background-repeat: repeat-x; - background-size: auto 6px; - cursor: default; - height: 2rem; -} - + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); + background-position: 0 calc(100% + 1px); + background-repeat: repeat-x; + background-size: auto 6px; + cursor: default; + height: 2rem; +} .mce-spellchecker-grammar { - background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); - background-position: 0 calc(100% + 1px); - background-repeat: repeat-x; - background-size: auto 6px; - cursor: default; + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); + background-position: 0 calc(100% + 1px); + background-repeat: repeat-x; + background-size: auto 6px; + cursor: default; } - .mce-toc { - border: 1px solid gray; + border: 1px solid gray; } - .mce-toc h2 { - margin: 4px; + margin: 4px; } - .mce-toc li { - list-style-type: none; + list-style-type: none; } - table[style*="border-width: 0px"], .mce-item-table:not([border]), .mce-item-table[border="0"], @@ -689,9 +581,8 @@ table[style*="border-width: 0px"] th, table[style*="border-width: 0px"] caption, .mce-item-table:not([border]) caption, .mce-item-table[border="0"] caption { - border: 1px dashed #bbb; + border: 1px dashed #bbb; } - .mce-visualblocks p, .mce-visualblocks h1, .mce-visualblocks h2, @@ -712,92 +603,71 @@ table[style*="border-width: 0px"] caption, .mce-visualblocks ul, .mce-visualblocks ol, .mce-visualblocks dl { - background-repeat: no-repeat; - border: 1px dashed #bbb; - margin-left: 3px; - padding-top: 10px; + background-repeat: no-repeat; + border: 1px dashed #bbb; + margin-left: 3px; + padding-top: 10px; } - .mce-visualblocks p { - background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); + background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); } - .mce-visualblocks h1 { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); } - .mce-visualblocks h2 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); } - .mce-visualblocks h3 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); } - .mce-visualblocks h4 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); } - .mce-visualblocks h5 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); } - .mce-visualblocks h6 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); } - .mce-visualblocks div:not([data-mce-bogus]) { - background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); + background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); } - .mce-visualblocks section { - background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); + background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); } - .mce-visualblocks article { - background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); + background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); } - .mce-visualblocks blockquote { - background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); + background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); } - .mce-visualblocks address { - background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); + background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); } - .mce-visualblocks pre { - background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); } - .mce-visualblocks figure { - background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); + background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); } - .mce-visualblocks figcaption { - border: 1px dashed #bbb; + border: 1px dashed #bbb; } - .mce-visualblocks hgroup { - background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); + background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); } - .mce-visualblocks aside { - background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); + background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); } - .mce-visualblocks ul { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==); } - .mce-visualblocks ol { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); } - .mce-visualblocks dl { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==); + background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==); } - .mce-visualblocks:not([dir=rtl]) p, .mce-visualblocks:not([dir=rtl]) h1, .mce-visualblocks:not([dir=rtl]) h2, @@ -818,9 +688,8 @@ table[style*="border-width: 0px"] caption, .mce-visualblocks:not([dir=rtl]) ul, .mce-visualblocks:not([dir=rtl]) ol, .mce-visualblocks:not([dir=rtl]) dl { - margin-left: 3px; + margin-left: 3px; } - .mce-visualblocks[dir=rtl] p, .mce-visualblocks[dir=rtl] h1, .mce-visualblocks[dir=rtl] h2, @@ -841,15 +710,13 @@ table[style*="border-width: 0px"] caption, .mce-visualblocks[dir=rtl] ul, .mce-visualblocks[dir=rtl] ol, .mce-visualblocks[dir=rtl] dl { - background-position-x: right; - margin-right: 3px; + background-position-x: right; + margin-right: 3px; } - .mce-nbsp, .mce-shy { - background: #aaa; + background: #aaa; } - .mce-shy::after { - content: '-'; + content: '-'; } diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/content.mobile.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/content.mobile.css index 12e82070..4bdb8bab 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/content.mobile.css +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/content.mobile.css @@ -5,30 +5,25 @@ * For commercial licenses see https://www.tiny.cloud/ */ .tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection { - /* Note: this file is used inside the content, so isn't part of theming */ - background-color: green; - display: inline-block; - opacity: 0.5; - position: absolute; + /* Note: this file is used inside the content, so isn't part of theming */ + background-color: green; + display: inline-block; + opacity: 0.5; + position: absolute; } - body { - -webkit-text-size-adjust: none; + -webkit-text-size-adjust: none; } - body img { - /* this is related to the content margin */ - max-width: 96vw; + /* this is related to the content margin */ + max-width: 96vw; } - body table img { - max-width: 95%; + max-width: 95%; } - body { - font-family: sans-serif; + font-family: sans-serif; } - table { - border-collapse: collapse; + border-collapse: collapse; } diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/skin.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/skin.css index d1ff1c56..645478bf 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/skin.css +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/skin.css @@ -5,2514 +5,2100 @@ * For commercial licenses see https://www.tiny.cloud/ */ .tox { - box-sizing: content-box; - color: #222f3e; - cursor: auto; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 16px; - font-style: normal; - font-weight: normal; - line-height: normal; - -webkit-tap-highlight-color: transparent; - text-decoration: none; - text-shadow: none; - text-transform: none; - vertical-align: initial; - white-space: normal; -} - + box-sizing: content-box; + color: #222f3e; + cursor: auto; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 16px; + font-style: normal; + font-weight: normal; + line-height: normal; + -webkit-tap-highlight-color: transparent; + text-decoration: none; + text-shadow: none; + text-transform: none; + vertical-align: initial; + white-space: normal; +} .tox *:not(svg):not(rect) { - box-sizing: inherit; - color: inherit; - cursor: inherit; - direction: inherit; - font-family: inherit; - font-size: inherit; - font-style: inherit; - font-weight: inherit; - line-height: inherit; - -webkit-tap-highlight-color: inherit; - text-align: inherit; - text-decoration: inherit; - text-shadow: inherit; - text-transform: inherit; - vertical-align: inherit; - white-space: inherit; -} - + box-sizing: inherit; + color: inherit; + cursor: inherit; + direction: inherit; + font-family: inherit; + font-size: inherit; + font-style: inherit; + font-weight: inherit; + line-height: inherit; + -webkit-tap-highlight-color: inherit; + text-align: inherit; + text-decoration: inherit; + text-shadow: inherit; + text-transform: inherit; + vertical-align: inherit; + white-space: inherit; +} .tox *:not(svg):not(rect) { - /* stylelint-disable-line no-duplicate-selectors */ - background: transparent; - border: 0; - float: none; - height: auto; - margin: 0; - max-width: none; - outline: 0; - padding: 0; - position: static; - width: auto; -} - + /* stylelint-disable-line no-duplicate-selectors */ + background: transparent; + border: 0; + float: none; + height: auto; + margin: 0; + max-width: none; + outline: 0; + padding: 0; + position: static; + width: auto; +} .tox:not([dir=rtl]) { - direction: ltr; - text-align: left; + direction: ltr; + text-align: left; } - .tox[dir=rtl] { - direction: rtl; - text-align: right; + direction: rtl; + text-align: right; } - .tox-tinymce { - border: 1px solid #cccccc; - border-radius: 0; - box-shadow: none; - box-sizing: border-box; - display: flex; - flex-direction: column; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - overflow: hidden; - position: relative; - visibility: inherit !important; + border: 1px solid #cccccc; + border-radius: 0; + box-shadow: none; + box-sizing: border-box; + display: flex; + flex-direction: column; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + overflow: hidden; + position: relative; + visibility: inherit !important; } - .tox-tinymce-inline { - border: none; - box-shadow: none; + border: none; + box-shadow: none; } - .tox-tinymce-inline .tox-editor-header { - border: 1px solid #cccccc; - border-radius: 0; - box-shadow: none; + border: 1px solid #cccccc; + border-radius: 0; + box-shadow: none; } - .tox-tinymce-aux { - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - z-index: 1300; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + z-index: 1300; } - .tox-tinymce *:focus, .tox-tinymce-aux *:focus { - outline: none; + outline: none; } - button::-moz-focus-inner { - border: 0; + border: 0; } - .tox .accessibility-issue__header { - align-items: center; - display: flex; - margin-bottom: 4px; + align-items: center; + display: flex; + margin-bottom: 4px; } - .tox .accessibility-issue__description { - align-items: stretch; - border: 1px solid #cccccc; - border-radius: 3px; - display: flex; - justify-content: space-between; + align-items: stretch; + border: 1px solid #cccccc; + border-radius: 3px; + display: flex; + justify-content: space-between; } - .tox .accessibility-issue__description > div { - padding-bottom: 4px; + padding-bottom: 4px; } - .tox .accessibility-issue__description > div > div { - align-items: center; - display: flex; - margin-bottom: 4px; + align-items: center; + display: flex; + margin-bottom: 4px; } - .tox .accessibility-issue__description > *:last-child:not(:only-child) { - border-color: #cccccc; - border-style: solid; + border-color: #cccccc; + border-style: solid; } - .tox .accessibility-issue__repair { - margin-top: 16px; + margin-top: 16px; } - .tox .tox-dialog__body-content .accessibility-issue--info .accessibility-issue__description { - background-color: rgba(32, 122, 183, 0.1); - border-color: rgba(32, 122, 183, 0.4); - color: #222f3e; + background-color: rgba(32, 122, 183, 0.1); + border-color: rgba(32, 122, 183, 0.4); + color: #222f3e; } - .tox .tox-dialog__body-content .accessibility-issue--info .accessibility-issue__description > *:last-child { - border-color: rgba(32, 122, 183, 0.4); + border-color: rgba(32, 122, 183, 0.4); } - .tox .tox-dialog__body-content .accessibility-issue--info .tox-form__group h2 { - color: #207ab7; + color: #207ab7; } - .tox .tox-dialog__body-content .accessibility-issue--info .tox-icon svg { - fill: #207ab7; + fill: #207ab7; } - .tox .tox-dialog__body-content .accessibility-issue--info a .tox-icon { - color: #207ab7; + color: #207ab7; } - .tox .tox-dialog__body-content .accessibility-issue--warn .accessibility-issue__description { - background-color: rgba(255, 165, 0, 0.1); - border-color: rgba(255, 165, 0, 0.5); - color: #222f3e; + background-color: rgba(255, 165, 0, 0.1); + border-color: rgba(255, 165, 0, 0.5); + color: #222f3e; } - .tox .tox-dialog__body-content .accessibility-issue--warn .accessibility-issue__description > *:last-child { - border-color: rgba(255, 165, 0, 0.5); + border-color: rgba(255, 165, 0, 0.5); } - .tox .tox-dialog__body-content .accessibility-issue--warn .tox-form__group h2 { - color: #cc8500; + color: #cc8500; } - .tox .tox-dialog__body-content .accessibility-issue--warn .tox-icon svg { - fill: #cc8500; + fill: #cc8500; } - .tox .tox-dialog__body-content .accessibility-issue--warn a .tox-icon { - color: #cc8500; + color: #cc8500; } - .tox .tox-dialog__body-content .accessibility-issue--error .accessibility-issue__description { - background-color: rgba(204, 0, 0, 0.1); - border-color: rgba(204, 0, 0, 0.4); - color: #222f3e; + background-color: rgba(204, 0, 0, 0.1); + border-color: rgba(204, 0, 0, 0.4); + color: #222f3e; } - .tox .tox-dialog__body-content .accessibility-issue--error .accessibility-issue__description > *:last-child { - border-color: rgba(204, 0, 0, 0.4); + border-color: rgba(204, 0, 0, 0.4); } - .tox .tox-dialog__body-content .accessibility-issue--error .tox-form__group h2 { - color: #c00; + color: #c00; } - .tox .tox-dialog__body-content .accessibility-issue--error .tox-icon svg { - fill: #c00; + fill: #c00; } - .tox .tox-dialog__body-content .accessibility-issue--error a .tox-icon { - color: #c00; + color: #c00; } - .tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description { - background-color: rgba(120, 171, 70, 0.1); - border-color: rgba(120, 171, 70, 0.4); - color: #222f3e; + background-color: rgba(120, 171, 70, 0.1); + border-color: rgba(120, 171, 70, 0.4); + color: #222f3e; } - .tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description > *:last-child { - border-color: rgba(120, 171, 70, 0.4); + border-color: rgba(120, 171, 70, 0.4); } - .tox .tox-dialog__body-content .accessibility-issue--success .tox-form__group h2 { - color: #78AB46; + color: #78AB46; } - .tox .tox-dialog__body-content .accessibility-issue--success .tox-icon svg { - fill: #78AB46; + fill: #78AB46; } - .tox .tox-dialog__body-content .accessibility-issue--success a .tox-icon { - color: #78AB46; + color: #78AB46; } - .tox .tox-dialog__body-content .accessibility-issue__header h1, .tox .tox-dialog__body-content .tox-form__group .accessibility-issue__description h2 { - margin-top: 0; + margin-top: 0; } - .tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header .tox-button { - margin-left: 4px; + margin-left: 4px; } - .tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header > *:nth-last-child(2) { - margin-left: auto; + margin-left: auto; } - .tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__description { - padding: 4px 4px 4px 8px; + padding: 4px 4px 4px 8px; } - .tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__description > *:last-child { - border-left-width: 1px; - padding-left: 4px; + border-left-width: 1px; + padding-left: 4px; } - .tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header .tox-button { - margin-right: 4px; + margin-right: 4px; } - .tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header > *:nth-last-child(2) { - margin-right: auto; + margin-right: auto; } - .tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__description { - padding: 4px 8px 4px 4px; + padding: 4px 8px 4px 4px; } - .tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__description > *:last-child { - border-right-width: 1px; - padding-right: 4px; + border-right-width: 1px; + padding-right: 4px; } - .tox .tox-anchorbar { - display: flex; - flex: 0 0 auto; + display: flex; + flex: 0 0 auto; } - .tox .tox-bar { - display: flex; - flex: 0 0 auto; + display: flex; + flex: 0 0 auto; } - .tox .tox-button { - background-color: #207ab7; - background-image: none; - background-position: 0 0; - background-repeat: repeat; - border-color: #207ab7; - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: none; - box-sizing: border-box; - color: #fff; - cursor: pointer; - display: inline-block; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 14px; - font-style: normal; - font-weight: bold; - letter-spacing: normal; - line-height: 24px; - margin: 0; - outline: none; - padding: 4px 16px; - text-align: center; - text-decoration: none; - text-transform: capitalize; - white-space: nowrap; -} - + background-color: #207ab7; + background-image: none; + background-position: 0 0; + background-repeat: repeat; + border-color: #207ab7; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + box-sizing: border-box; + color: #fff; + cursor: pointer; + display: inline-block; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 14px; + font-style: normal; + font-weight: bold; + letter-spacing: normal; + line-height: 24px; + margin: 0; + outline: none; + padding: 4px 16px; + text-align: center; + text-decoration: none; + text-transform: capitalize; + white-space: nowrap; +} .tox .tox-button[disabled] { - background-color: #207ab7; - background-image: none; - border-color: #207ab7; - box-shadow: none; - color: rgba(255, 255, 255, 0.5); - cursor: not-allowed; -} - + background-color: #207ab7; + background-image: none; + border-color: #207ab7; + box-shadow: none; + color: rgba(255, 255, 255, 0.5); + cursor: not-allowed; +} .tox .tox-button:focus:not(:disabled) { - background-color: #1c6ca1; - background-image: none; - border-color: #1c6ca1; - box-shadow: none; - color: #fff; + background-color: #1c6ca1; + background-image: none; + border-color: #1c6ca1; + box-shadow: none; + color: #fff; } - .tox .tox-button:hover:not(:disabled) { - background-color: #1c6ca1; - background-image: none; - border-color: #1c6ca1; - box-shadow: none; - color: #fff; + background-color: #1c6ca1; + background-image: none; + border-color: #1c6ca1; + box-shadow: none; + color: #fff; } - .tox .tox-button:active:not(:disabled) { - background-color: #185d8c; - background-image: none; - border-color: #185d8c; - box-shadow: none; - color: #fff; + background-color: #185d8c; + background-image: none; + border-color: #185d8c; + box-shadow: none; + color: #fff; } - .tox .tox-button--secondary { - background-color: #f0f0f0; - background-image: none; - background-position: 0 0; - background-repeat: repeat; - border-color: #f0f0f0; - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: none; - color: #222f3e; - font-size: 14px; - font-style: normal; - font-weight: bold; - letter-spacing: normal; - outline: none; - padding: 4px 16px; - text-decoration: none; - text-transform: capitalize; -} - + background-color: #f0f0f0; + background-image: none; + background-position: 0 0; + background-repeat: repeat; + border-color: #f0f0f0; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + color: #222f3e; + font-size: 14px; + font-style: normal; + font-weight: bold; + letter-spacing: normal; + outline: none; + padding: 4px 16px; + text-decoration: none; + text-transform: capitalize; +} .tox .tox-button--secondary[disabled] { - background-color: #f0f0f0; - background-image: none; - border-color: #f0f0f0; - box-shadow: none; - color: rgba(34, 47, 62, 0.5); + background-color: #f0f0f0; + background-image: none; + border-color: #f0f0f0; + box-shadow: none; + color: rgba(34, 47, 62, 0.5); } - .tox .tox-button--secondary:focus:not(:disabled) { - background-color: #e3e3e3; - background-image: none; - border-color: #e3e3e3; - box-shadow: none; - color: #222f3e; + background-color: #e3e3e3; + background-image: none; + border-color: #e3e3e3; + box-shadow: none; + color: #222f3e; } - .tox .tox-button--secondary:hover:not(:disabled) { - background-color: #e3e3e3; - background-image: none; - border-color: #e3e3e3; - box-shadow: none; - color: #222f3e; + background-color: #e3e3e3; + background-image: none; + border-color: #e3e3e3; + box-shadow: none; + color: #222f3e; } - .tox .tox-button--secondary:active:not(:disabled) { - background-color: #d6d6d6; - background-image: none; - border-color: #d6d6d6; - box-shadow: none; - color: #222f3e; + background-color: #d6d6d6; + background-image: none; + border-color: #d6d6d6; + box-shadow: none; + color: #222f3e; } - .tox .tox-button--icon, .tox .tox-button.tox-button--icon, .tox .tox-button.tox-button--secondary.tox-button--icon { - padding: 4px; + padding: 4px; } - .tox .tox-button--icon .tox-icon svg, .tox .tox-button.tox-button--icon .tox-icon svg, .tox .tox-button.tox-button--secondary.tox-button--icon .tox-icon svg { - display: block; - fill: currentColor; + display: block; + fill: currentColor; } - .tox .tox-button-link { - background: 0; - border: none; - box-sizing: border-box; - cursor: pointer; - display: inline-block; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 16px; - font-weight: normal; - line-height: 1.3; - margin: 0; - padding: 0; - white-space: nowrap; -} - + background: 0; + border: none; + box-sizing: border-box; + cursor: pointer; + display: inline-block; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 16px; + font-weight: normal; + line-height: 1.3; + margin: 0; + padding: 0; + white-space: nowrap; +} .tox .tox-button-link--sm { - font-size: 14px; + font-size: 14px; } - .tox .tox-button--naked { - background-color: transparent; - border-color: transparent; - box-shadow: unset; - color: #222f3e; + background-color: transparent; + border-color: transparent; + box-shadow: unset; + color: #222f3e; } - .tox .tox-button--naked[disabled] { - background-color: #f0f0f0; - border-color: #f0f0f0; - box-shadow: none; - color: rgba(34, 47, 62, 0.5); + background-color: #f0f0f0; + border-color: #f0f0f0; + box-shadow: none; + color: rgba(34, 47, 62, 0.5); } - .tox .tox-button--naked:hover:not(:disabled) { - background-color: #e3e3e3; - border-color: #e3e3e3; - box-shadow: none; - color: #222f3e; + background-color: #e3e3e3; + border-color: #e3e3e3; + box-shadow: none; + color: #222f3e; } - .tox .tox-button--naked:focus:not(:disabled) { - background-color: #e3e3e3; - border-color: #e3e3e3; - box-shadow: none; - color: #222f3e; + background-color: #e3e3e3; + border-color: #e3e3e3; + box-shadow: none; + color: #222f3e; } - .tox .tox-button--naked:active:not(:disabled) { - background-color: #d6d6d6; - border-color: #d6d6d6; - box-shadow: none; - color: #222f3e; + background-color: #d6d6d6; + border-color: #d6d6d6; + box-shadow: none; + color: #222f3e; } - .tox .tox-button--naked .tox-icon svg { - fill: currentColor; + fill: currentColor; } - .tox .tox-button--naked.tox-button--icon:hover:not(:disabled) { - color: #222f3e; + color: #222f3e; } - .tox .tox-checkbox { - align-items: center; - border-radius: 3px; - cursor: pointer; - display: flex; - height: 36px; - min-width: 36px; -} - + align-items: center; + border-radius: 3px; + cursor: pointer; + display: flex; + height: 36px; + min-width: 36px; +} .tox .tox-checkbox__input { - /* Hide from view but visible to screen readers */ - height: 1px; - overflow: hidden; - position: absolute; - top: auto; - width: 1px; -} - + /* Hide from view but visible to screen readers */ + height: 1px; + overflow: hidden; + position: absolute; + top: auto; + width: 1px; +} .tox .tox-checkbox__icons { - align-items: center; - border-radius: 3px; - box-shadow: 0 0 0 2px transparent; - box-sizing: content-box; - display: flex; - height: 24px; - justify-content: center; - padding: calc(4px - 1px); - width: 24px; -} - + align-items: center; + border-radius: 3px; + box-shadow: 0 0 0 2px transparent; + box-sizing: content-box; + display: flex; + height: 24px; + justify-content: center; + padding: calc(4px - 1px); + width: 24px; +} .tox .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { - display: block; - fill: rgba(34, 47, 62, 0.3); + display: block; + fill: rgba(34, 47, 62, 0.3); } - .tox .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg { - display: none; - fill: #207ab7; + display: none; + fill: #207ab7; } - .tox .tox-checkbox__icons .tox-checkbox-icon__checked svg { - display: none; - fill: #207ab7; + display: none; + fill: #207ab7; } - .tox .tox-checkbox--disabled { - color: rgba(34, 47, 62, 0.5); - cursor: not-allowed; + color: rgba(34, 47, 62, 0.5); + cursor: not-allowed; } - .tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__checked svg { - fill: rgba(34, 47, 62, 0.5); + fill: rgba(34, 47, 62, 0.5); } - .tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { - fill: rgba(34, 47, 62, 0.5); + fill: rgba(34, 47, 62, 0.5); } - .tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg { - fill: rgba(34, 47, 62, 0.5); + fill: rgba(34, 47, 62, 0.5); } - .tox input.tox-checkbox__input:checked + .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { - display: none; + display: none; } - .tox input.tox-checkbox__input:checked + .tox-checkbox__icons .tox-checkbox-icon__checked svg { - display: block; + display: block; } - .tox input.tox-checkbox__input:indeterminate + .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { - display: none; + display: none; } - .tox input.tox-checkbox__input:indeterminate + .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg { - display: block; + display: block; } - .tox input.tox-checkbox__input:focus + .tox-checkbox__icons { - border-radius: 3px; - box-shadow: inset 0 0 0 1px #207ab7; - padding: calc(4px - 1px); + border-radius: 3px; + box-shadow: inset 0 0 0 1px #207ab7; + padding: calc(4px - 1px); } - .tox:not([dir=rtl]) .tox-checkbox__label { - margin-left: 4px; + margin-left: 4px; } - .tox:not([dir=rtl]) .tox-checkbox__input { - left: -10000px; + left: -10000px; } - .tox:not([dir=rtl]) .tox-bar .tox-checkbox { - margin-left: 4px; + margin-left: 4px; } - .tox[dir=rtl] .tox-checkbox__label { - margin-right: 4px; + margin-right: 4px; } - .tox[dir=rtl] .tox-checkbox__input { - right: -10000px; + right: -10000px; } - .tox[dir=rtl] .tox-bar .tox-checkbox { - margin-right: 4px; + margin-right: 4px; } - .tox { - /* stylelint-disable-next-line no-descending-specificity */ + /* stylelint-disable-next-line no-descending-specificity */ } - .tox .tox-collection--toolbar .tox-collection__group { - display: flex; - padding: 0; + display: flex; + padding: 0; } - .tox .tox-collection--grid .tox-collection__group { - display: flex; - flex-wrap: wrap; - max-height: 208px; - overflow-x: hidden; - overflow-y: auto; - padding: 0; -} - + display: flex; + flex-wrap: wrap; + max-height: 208px; + overflow-x: hidden; + overflow-y: auto; + padding: 0; +} .tox .tox-collection--list .tox-collection__group { - border-bottom-width: 0; - border-color: #cccccc; - border-left-width: 0; - border-right-width: 0; - border-style: solid; - border-top-width: 1px; - padding: 4px 0; -} - + border-bottom-width: 0; + border-color: #cccccc; + border-left-width: 0; + border-right-width: 0; + border-style: solid; + border-top-width: 1px; + padding: 4px 0; +} .tox .tox-collection--list .tox-collection__group:first-child { - border-top-width: 0; + border-top-width: 0; } - .tox .tox-collection__group-heading { - background-color: #e6e6e6; - color: rgba(34, 47, 62, 0.7); - cursor: default; - font-size: 12px; - font-style: normal; - font-weight: normal; - margin-bottom: 4px; - margin-top: -4px; - padding: 4px 8px; - text-transform: none; - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - + background-color: #e6e6e6; + color: rgba(34, 47, 62, 0.7); + cursor: default; + font-size: 12px; + font-style: normal; + font-weight: normal; + margin-bottom: 4px; + margin-top: -4px; + padding: 4px 8px; + text-transform: none; + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} .tox .tox-collection__item { - align-items: center; - color: #222f3e; - cursor: pointer; - display: flex; - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - + align-items: center; + color: #222f3e; + cursor: pointer; + display: flex; + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} .tox .tox-collection--list .tox-collection__item { - padding: 4px 8px; + padding: 4px 8px; } - .tox .tox-collection--toolbar .tox-collection__item { - border-radius: 3px; - padding: 4px; + border-radius: 3px; + padding: 4px; } - .tox .tox-collection--grid .tox-collection__item { - border-radius: 3px; - padding: 4px; + border-radius: 3px; + padding: 4px; } - .tox .tox-collection--list .tox-collection__item--enabled { - background-color: #fff; - color: #222f3e; + background-color: #fff; + color: #222f3e; } - .tox .tox-collection--list .tox-collection__item--active { - background-color: #dee0e2; + background-color: #dee0e2; } - .tox .tox-collection--toolbar .tox-collection__item--enabled { - background-color: #c8cbcf; - color: #222f3e; + background-color: #c8cbcf; + color: #222f3e; } - .tox .tox-collection--toolbar .tox-collection__item--active { - background-color: #dee0e2; + background-color: #dee0e2; } - .tox .tox-collection--grid .tox-collection__item--enabled { - background-color: #c8cbcf; - color: #222f3e; + background-color: #c8cbcf; + color: #222f3e; } - .tox .tox-collection--grid .tox-collection__item--active:not(.tox-collection__item--state-disabled) { - background-color: #dee0e2; - color: #222f3e; + background-color: #dee0e2; + color: #222f3e; } - .tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled) { - color: #222f3e; + color: #222f3e; } - .tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled) { - color: #222f3e; + color: #222f3e; } - .tox .tox-collection__item--state-disabled { - background-color: transparent; - color: rgba(34, 47, 62, 0.5); - cursor: not-allowed; + background-color: transparent; + color: rgba(34, 47, 62, 0.5); + cursor: not-allowed; } - .tox .tox-collection__item-icon, .tox .tox-collection__item-checkmark { - align-items: center; - display: flex; - height: 24px; - justify-content: center; - width: 24px; + align-items: center; + display: flex; + height: 24px; + justify-content: center; + width: 24px; } - .tox .tox-collection__item-icon svg, .tox .tox-collection__item-checkmark svg { - fill: currentColor; + fill: currentColor; } - .tox .tox-collection--toolbar-lg .tox-collection__item-icon { - height: 48px; - width: 48px; + height: 48px; + width: 48px; } - .tox .tox-collection__item-label { - color: currentColor; - display: inline-block; - flex: 1; - -ms-flex-preferred-size: auto; - font-size: 14px; - font-style: normal; - font-weight: normal; - line-height: 24px; - text-transform: none; - word-break: break-all; -} - + color: currentColor; + display: inline-block; + flex: 1; + -ms-flex-preferred-size: auto; + font-size: 14px; + font-style: normal; + font-weight: normal; + line-height: 24px; + text-transform: none; + word-break: break-all; +} .tox .tox-collection__item-accessory { - color: rgba(34, 47, 62, 0.7); - display: inline-block; - font-size: 14px; - height: 24px; - line-height: 24px; - text-transform: none; -} - + color: rgba(34, 47, 62, 0.7); + display: inline-block; + font-size: 14px; + height: 24px; + line-height: 24px; + text-transform: none; +} .tox .tox-collection__item-caret { - align-items: center; - display: flex; - min-height: 24px; + align-items: center; + display: flex; + min-height: 24px; } - .tox .tox-collection__item-caret::after { - content: ''; - font-size: 0; - min-height: inherit; + content: ''; + font-size: 0; + min-height: inherit; } - .tox .tox-collection__item-caret svg { - fill: #222f3e; + fill: #222f3e; } - .tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg { - display: none; + display: none; } - .tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-accessory + .tox-collection__item-checkmark { - display: none; + display: none; } - .tox .tox-collection--horizontal { - background-color: #fff; - border: 1px solid #cccccc; - border-radius: 3px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); - display: flex; - flex: 0 0 auto; - flex-shrink: 0; - flex-wrap: nowrap; - margin-bottom: 0; - overflow-x: auto; - padding: 0; + background-color: #fff; + border: 1px solid #cccccc; + border-radius: 3px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); + display: flex; + flex: 0 0 auto; + flex-shrink: 0; + flex-wrap: nowrap; + margin-bottom: 0; + overflow-x: auto; + padding: 0; } - .tox .tox-collection--horizontal .tox-collection__group { - align-items: center; - display: flex; - flex-wrap: nowrap; - margin: 0; - padding: 0 4px; + align-items: center; + display: flex; + flex-wrap: nowrap; + margin: 0; + padding: 0 4px; } - .tox .tox-collection--horizontal .tox-collection__item { - height: 34px; - margin: 2px 0 3px 0; - padding: 0 4px; + height: 34px; + margin: 2px 0 3px 0; + padding: 0 4px; } - .tox .tox-collection--horizontal .tox-collection__item-label { - white-space: nowrap; + white-space: nowrap; } - .tox .tox-collection--horizontal .tox-collection__item-caret { - margin-left: 4px; + margin-left: 4px; } - .tox .tox-collection__item-container { - display: flex; + display: flex; } - .tox .tox-collection__item-container--row { - align-items: center; - flex: 1 1 auto; - flex-direction: row; + align-items: center; + flex: 1 1 auto; + flex-direction: row; } - .tox .tox-collection__item-container--row.tox-collection__item-container--align-left { - margin-right: auto; + margin-right: auto; } - .tox .tox-collection__item-container--row.tox-collection__item-container--align-right { - justify-content: flex-end; - margin-left: auto; + justify-content: flex-end; + margin-left: auto; } - .tox .tox-collection__item-container--row.tox-collection__item-container--valign-top { - align-items: flex-start; - margin-bottom: auto; + align-items: flex-start; + margin-bottom: auto; } - .tox .tox-collection__item-container--row.tox-collection__item-container--valign-middle { - align-items: center; + align-items: center; } - .tox .tox-collection__item-container--row.tox-collection__item-container--valign-bottom { - align-items: flex-end; - margin-top: auto; + align-items: flex-end; + margin-top: auto; } - .tox .tox-collection__item-container--column { - -ms-grid-row-align: center; - align-self: center; - flex: 1 1 auto; - flex-direction: column; + -ms-grid-row-align: center; + align-self: center; + flex: 1 1 auto; + flex-direction: column; } - .tox .tox-collection__item-container--column.tox-collection__item-container--align-left { - align-items: flex-start; + align-items: flex-start; } - .tox .tox-collection__item-container--column.tox-collection__item-container--align-right { - align-items: flex-end; + align-items: flex-end; } - .tox .tox-collection__item-container--column.tox-collection__item-container--valign-top { - align-self: flex-start; + align-self: flex-start; } - .tox .tox-collection__item-container--column.tox-collection__item-container--valign-middle { - -ms-grid-row-align: center; - align-self: center; + -ms-grid-row-align: center; + align-self: center; } - .tox .tox-collection__item-container--column.tox-collection__item-container--valign-bottom { - align-self: flex-end; + align-self: flex-end; } - .tox:not([dir=rtl]) .tox-collection--horizontal .tox-collection__group:not(:last-of-type) { - border-right: 1px solid #cccccc; + border-right: 1px solid #cccccc; } - .tox:not([dir=rtl]) .tox-collection--list .tox-collection__item > *:not(:first-child) { - margin-left: 8px; + margin-left: 8px; } - .tox:not([dir=rtl]) .tox-collection--list .tox-collection__item > .tox-collection__item-label:first-child { - margin-left: 4px; + margin-left: 4px; } - .tox:not([dir=rtl]) .tox-collection__item-accessory { - margin-left: 16px; - text-align: right; + margin-left: 16px; + text-align: right; } - .tox:not([dir=rtl]) .tox-collection .tox-collection__item-caret { - margin-left: 16px; + margin-left: 16px; } - .tox[dir=rtl] .tox-collection--horizontal .tox-collection__group:not(:last-of-type) { - border-left: 1px solid #cccccc; + border-left: 1px solid #cccccc; } - .tox[dir=rtl] .tox-collection--list .tox-collection__item > *:not(:first-child) { - margin-right: 8px; + margin-right: 8px; } - .tox[dir=rtl] .tox-collection--list .tox-collection__item > .tox-collection__item-label:first-child { - margin-right: 4px; + margin-right: 4px; } - .tox[dir=rtl] .tox-collection__item-icon-rtl { - /* stylelint-disable-next-line no-descending-specificity */ + /* stylelint-disable-next-line no-descending-specificity */ } - .tox[dir=rtl] .tox-collection__item-icon-rtl .tox-collection__item-icon svg { - transform: rotateY(180deg); + transform: rotateY(180deg); } - .tox[dir=rtl] .tox-collection__item-accessory { - margin-right: 16px; - text-align: left; + margin-right: 16px; + text-align: left; } - .tox[dir=rtl] .tox-collection .tox-collection__item-caret { - margin-right: 16px; - transform: rotateY(180deg); + margin-right: 16px; + transform: rotateY(180deg); } - .tox[dir=rtl] .tox-collection--horizontal .tox-collection__item-caret { - margin-right: 4px; + margin-right: 4px; } - .tox .tox-color-picker-container { - display: flex; - flex-direction: row; - height: 225px; - margin: 0; + display: flex; + flex-direction: row; + height: 225px; + margin: 0; } - .tox .tox-sv-palette { - box-sizing: border-box; - display: flex; - height: 100%; + box-sizing: border-box; + display: flex; + height: 100%; } - .tox .tox-sv-palette-spectrum { - height: 100%; + height: 100%; } - .tox .tox-sv-palette, .tox .tox-sv-palette-spectrum { - width: 225px; + width: 225px; } - .tox .tox-sv-palette-thumb { - background: none; - border: 1px solid black; - border-radius: 50%; - box-sizing: content-box; - height: 12px; - position: absolute; - width: 12px; -} - + background: none; + border: 1px solid black; + border-radius: 50%; + box-sizing: content-box; + height: 12px; + position: absolute; + width: 12px; +} .tox .tox-sv-palette-inner-thumb { - border: 1px solid white; - border-radius: 50%; - height: 10px; - position: absolute; - width: 10px; + border: 1px solid white; + border-radius: 50%; + height: 10px; + position: absolute; + width: 10px; } - .tox .tox-hue-slider { - box-sizing: border-box; - height: 100%; - width: 25px; + box-sizing: border-box; + height: 100%; + width: 25px; } - .tox .tox-hue-slider-spectrum { - background: linear-gradient(to bottom, #f00, #ff0080, #f0f, #8000ff, #00f, #0080ff, #0ff, #00ff80, #0f0, #80ff00, #ff0, #ff8000, #f00); - height: 100%; - width: 100%; + background: linear-gradient(to bottom, #f00, #ff0080, #f0f, #8000ff, #00f, #0080ff, #0ff, #00ff80, #0f0, #80ff00, #ff0, #ff8000, #f00); + height: 100%; + width: 100%; } - .tox .tox-hue-slider, .tox .tox-hue-slider-spectrum { - width: 20px; + width: 20px; } - .tox .tox-hue-slider-thumb { - background: white; - border: 1px solid black; - box-sizing: content-box; - height: 4px; - width: 100%; + background: white; + border: 1px solid black; + box-sizing: content-box; + height: 4px; + width: 100%; } - .tox .tox-rgb-form { - display: flex; - flex-direction: column; - justify-content: space-between; + display: flex; + flex-direction: column; + justify-content: space-between; } - .tox .tox-rgb-form div { - align-items: center; - display: flex; - justify-content: space-between; - margin-bottom: 5px; - width: inherit; + align-items: center; + display: flex; + justify-content: space-between; + margin-bottom: 5px; + width: inherit; } - .tox .tox-rgb-form input { - width: 6em; + width: 6em; } - .tox .tox-rgb-form input.tox-invalid { - /* Need !important to override Chrome's focus styling unfortunately */ - border: 1px solid red !important; + /* Need !important to override Chrome's focus styling unfortunately */ + border: 1px solid red !important; } - .tox .tox-rgb-form .tox-rgba-preview { - border: 1px solid black; - flex-grow: 2; - margin-bottom: 0; + border: 1px solid black; + flex-grow: 2; + margin-bottom: 0; } - .tox:not([dir=rtl]) .tox-sv-palette { - margin-right: 15px; + margin-right: 15px; } - .tox:not([dir=rtl]) .tox-hue-slider { - margin-right: 15px; + margin-right: 15px; } - .tox:not([dir=rtl]) .tox-hue-slider-thumb { - margin-left: -1px; + margin-left: -1px; } - .tox:not([dir=rtl]) .tox-rgb-form label { - margin-right: 0.5em; + margin-right: 0.5em; } - .tox[dir=rtl] .tox-sv-palette { - margin-left: 15px; + margin-left: 15px; } - .tox[dir=rtl] .tox-hue-slider { - margin-left: 15px; + margin-left: 15px; } - .tox[dir=rtl] .tox-hue-slider-thumb { - margin-right: -1px; + margin-right: -1px; } - .tox[dir=rtl] .tox-rgb-form label { - margin-left: 0.5em; + margin-left: 0.5em; } - .tox .tox-toolbar .tox-swatches, .tox .tox-toolbar__primary .tox-swatches, .tox .tox-toolbar__overflow .tox-swatches { - margin: 2px 0 3px 4px; + margin: 2px 0 3px 4px; } - .tox .tox-collection--list .tox-collection__group .tox-swatches-menu { - border: 0; - margin: -4px 0; + border: 0; + margin: -4px 0; } - .tox .tox-swatches__row { - display: flex; + display: flex; } - .tox .tox-swatch { - height: 30px; - transition: transform 0.15s, box-shadow 0.15s; - width: 30px; + height: 30px; + transition: transform 0.15s, box-shadow 0.15s; + width: 30px; } - .tox .tox-swatch:hover, .tox .tox-swatch:focus { - box-shadow: 0 0 0 1px rgba(127, 127, 127, 0.3) inset; - transform: scale(0.8); + box-shadow: 0 0 0 1px rgba(127, 127, 127, 0.3) inset; + transform: scale(0.8); } - .tox .tox-swatch--remove { - align-items: center; - display: flex; - justify-content: center; + align-items: center; + display: flex; + justify-content: center; } - .tox .tox-swatch--remove svg path { - stroke: #e74c3c; + stroke: #e74c3c; } - .tox .tox-swatches__picker-btn { - align-items: center; - background-color: transparent; - border: 0; - cursor: pointer; - display: flex; - height: 30px; - justify-content: center; - outline: none; - padding: 0; - width: 30px; -} - + align-items: center; + background-color: transparent; + border: 0; + cursor: pointer; + display: flex; + height: 30px; + justify-content: center; + outline: none; + padding: 0; + width: 30px; +} .tox .tox-swatches__picker-btn svg { - height: 24px; - width: 24px; + height: 24px; + width: 24px; } - .tox .tox-swatches__picker-btn:hover { - background: #dee0e2; + background: #dee0e2; } - .tox:not([dir=rtl]) .tox-swatches__picker-btn { - margin-left: auto; + margin-left: auto; } - .tox[dir=rtl] .tox-swatches__picker-btn { - margin-right: auto; + margin-right: auto; } - .tox .tox-comment-thread { - background: #fff; - position: relative; + background: #fff; + position: relative; } - .tox .tox-comment-thread > *:not(:first-child) { - margin-top: 8px; + margin-top: 8px; } - .tox .tox-comment { - background: #fff; - border: 1px solid #cccccc; - border-radius: 3px; - box-shadow: 0 4px 8px 0 rgba(34, 47, 62, 0.1); - padding: 8px 8px 16px 8px; - position: relative; -} - + background: #fff; + border: 1px solid #cccccc; + border-radius: 3px; + box-shadow: 0 4px 8px 0 rgba(34, 47, 62, 0.1); + padding: 8px 8px 16px 8px; + position: relative; +} .tox .tox-comment__header { - align-items: center; - color: #222f3e; - display: flex; - justify-content: space-between; + align-items: center; + color: #222f3e; + display: flex; + justify-content: space-between; } - .tox .tox-comment__date { - color: rgba(34, 47, 62, 0.7); - font-size: 12px; + color: rgba(34, 47, 62, 0.7); + font-size: 12px; } - .tox .tox-comment__body { - color: #222f3e; - font-size: 14px; - font-style: normal; - font-weight: normal; - line-height: 1.3; - margin-top: 8px; - position: relative; - text-transform: initial; -} - + color: #222f3e; + font-size: 14px; + font-style: normal; + font-weight: normal; + line-height: 1.3; + margin-top: 8px; + position: relative; + text-transform: initial; +} .tox .tox-comment__body textarea { - resize: none; - white-space: normal; - width: 100%; + resize: none; + white-space: normal; + width: 100%; } - .tox .tox-comment__expander { - padding-top: 8px; + padding-top: 8px; } - .tox .tox-comment__expander p { - color: rgba(34, 47, 62, 0.7); - font-size: 14px; - font-style: normal; + color: rgba(34, 47, 62, 0.7); + font-size: 14px; + font-style: normal; } - .tox .tox-comment__body p { - margin: 0; + margin: 0; } - .tox .tox-comment__buttonspacing { - padding-top: 16px; - text-align: center; + padding-top: 16px; + text-align: center; } - .tox .tox-comment-thread__overlay::after { - background: #fff; - bottom: 0; - content: ""; - display: flex; - left: 0; - opacity: 0.9; - position: absolute; - right: 0; - top: 0; - z-index: 5; -} - + background: #fff; + bottom: 0; + content: ""; + display: flex; + left: 0; + opacity: 0.9; + position: absolute; + right: 0; + top: 0; + z-index: 5; +} .tox .tox-comment__reply { - display: flex; - flex-shrink: 0; - flex-wrap: wrap; - justify-content: flex-end; - margin-top: 8px; + display: flex; + flex-shrink: 0; + flex-wrap: wrap; + justify-content: flex-end; + margin-top: 8px; } - .tox .tox-comment__reply > *:first-child { - margin-bottom: 8px; - width: 100%; + margin-bottom: 8px; + width: 100%; } - .tox .tox-comment__edit { - display: flex; - flex-wrap: wrap; - justify-content: flex-end; - margin-top: 16px; + display: flex; + flex-wrap: wrap; + justify-content: flex-end; + margin-top: 16px; } - .tox .tox-comment__gradient::after { - background: linear-gradient(rgba(255, 255, 255, 0), #fff); - bottom: 0; - content: ""; - display: block; - height: 5em; - margin-top: -40px; - position: absolute; - width: 100%; -} - + background: linear-gradient(rgba(255, 255, 255, 0), #fff); + bottom: 0; + content: ""; + display: block; + height: 5em; + margin-top: -40px; + position: absolute; + width: 100%; +} .tox .tox-comment__overlay { - background: #fff; - bottom: 0; - display: flex; - flex-direction: column; - flex-grow: 1; - left: 0; - opacity: 0.9; - position: absolute; - right: 0; - text-align: center; - top: 0; - z-index: 5; -} - + background: #fff; + bottom: 0; + display: flex; + flex-direction: column; + flex-grow: 1; + left: 0; + opacity: 0.9; + position: absolute; + right: 0; + text-align: center; + top: 0; + z-index: 5; +} .tox .tox-comment__loading-text { - align-items: center; - color: #222f3e; - display: flex; - flex-direction: column; - position: relative; + align-items: center; + color: #222f3e; + display: flex; + flex-direction: column; + position: relative; } - .tox .tox-comment__loading-text > div { - padding-bottom: 16px; + padding-bottom: 16px; } - .tox .tox-comment__overlaytext { - bottom: 0; - flex-direction: column; - font-size: 14px; - left: 0; - padding: 1em; - position: absolute; - right: 0; - top: 0; - z-index: 10; -} - + bottom: 0; + flex-direction: column; + font-size: 14px; + left: 0; + padding: 1em; + position: absolute; + right: 0; + top: 0; + z-index: 10; +} .tox .tox-comment__overlaytext p { - background-color: #fff; - box-shadow: 0 0 8px 8px #fff; - color: #222f3e; - text-align: center; + background-color: #fff; + box-shadow: 0 0 8px 8px #fff; + color: #222f3e; + text-align: center; } - .tox .tox-comment__overlaytext div:nth-of-type(2) { - font-size: 0.8em; + font-size: 0.8em; } - .tox .tox-comment__busy-spinner { - align-items: center; - background-color: #fff; - bottom: 0; - display: flex; - justify-content: center; - left: 0; - position: absolute; - right: 0; - top: 0; - z-index: 20; -} - + align-items: center; + background-color: #fff; + bottom: 0; + display: flex; + justify-content: center; + left: 0; + position: absolute; + right: 0; + top: 0; + z-index: 20; +} .tox .tox-comment__scroll { - display: flex; - flex-direction: column; - flex-shrink: 1; - overflow: auto; + display: flex; + flex-direction: column; + flex-shrink: 1; + overflow: auto; } - .tox .tox-conversations { - margin: 8px; + margin: 8px; } - .tox:not([dir=rtl]) .tox-comment__edit { - margin-left: 8px; + margin-left: 8px; } - .tox:not([dir=rtl]) .tox-comment__buttonspacing > *:last-child, .tox:not([dir=rtl]) .tox-comment__edit > *:last-child, .tox:not([dir=rtl]) .tox-comment__reply > *:last-child { - margin-left: 8px; + margin-left: 8px; } - .tox[dir=rtl] .tox-comment__edit { - margin-right: 8px; + margin-right: 8px; } - .tox[dir=rtl] .tox-comment__buttonspacing > *:last-child, .tox[dir=rtl] .tox-comment__edit > *:last-child, .tox[dir=rtl] .tox-comment__reply > *:last-child { - margin-right: 8px; + margin-right: 8px; } - .tox .tox-user { - align-items: center; - display: flex; + align-items: center; + display: flex; } - .tox .tox-user__avatar svg { - fill: rgba(34, 47, 62, 0.7); + fill: rgba(34, 47, 62, 0.7); } - .tox .tox-user__name { - color: rgba(34, 47, 62, 0.7); - font-size: 12px; - font-style: normal; - font-weight: bold; - text-transform: uppercase; + color: rgba(34, 47, 62, 0.7); + font-size: 12px; + font-style: normal; + font-weight: bold; + text-transform: uppercase; } - .tox:not([dir=rtl]) .tox-user__avatar svg { - margin-right: 8px; + margin-right: 8px; } - .tox:not([dir=rtl]) .tox-user__avatar + .tox-user__name { - margin-left: 8px; + margin-left: 8px; } - .tox[dir=rtl] .tox-user__avatar svg { - margin-left: 8px; + margin-left: 8px; } - .tox[dir=rtl] .tox-user__avatar + .tox-user__name { - margin-right: 8px; + margin-right: 8px; } - .tox .tox-dialog-wrap { - align-items: center; - bottom: 0; - display: flex; - justify-content: center; - left: 0; - position: fixed; - right: 0; - top: 0; - z-index: 1100; -} - + align-items: center; + bottom: 0; + display: flex; + justify-content: center; + left: 0; + position: fixed; + right: 0; + top: 0; + z-index: 1100; +} .tox .tox-dialog-wrap__backdrop { - background-color: rgba(255, 255, 255, 0.75); - bottom: 0; - left: 0; - position: absolute; - right: 0; - top: 0; - z-index: 1; -} - + background-color: rgba(255, 255, 255, 0.75); + bottom: 0; + left: 0; + position: absolute; + right: 0; + top: 0; + z-index: 1; +} .tox .tox-dialog-wrap__backdrop--opaque { - background-color: #fff; + background-color: #fff; } - .tox .tox-dialog { - background-color: #fff; - border-color: #cccccc; - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: 0 16px 16px -10px rgba(34, 47, 62, 0.15), 0 0 40px 1px rgba(34, 47, 62, 0.15); - display: flex; - flex-direction: column; - max-height: 100%; - max-width: 480px; - overflow: hidden; - position: relative; - width: 95vw; - z-index: 2; -} - -@media only screen and (max-width: 767px) { - body:not(.tox-force-desktop) .tox .tox-dialog { - align-self: flex-start; - margin: 8px auto; - width: calc(100vw - 16px); - } -} - + background-color: #fff; + border-color: #cccccc; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: 0 16px 16px -10px rgba(34, 47, 62, 0.15), 0 0 40px 1px rgba(34, 47, 62, 0.15); + display: flex; + flex-direction: column; + max-height: 100%; + max-width: 480px; + overflow: hidden; + position: relative; + width: 95vw; + z-index: 2; +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox .tox-dialog { + align-self: flex-start; + margin: 8px auto; + width: calc(100vw - 16px); + } +} .tox .tox-dialog-inline { - z-index: 1100; + z-index: 1100; } - .tox .tox-dialog__header { - align-items: center; - background-color: #fff; - border-bottom: none; - color: #222f3e; - display: flex; - font-size: 16px; - justify-content: space-between; - padding: 8px 16px 0 16px; - position: relative; -} - + align-items: center; + background-color: #fff; + border-bottom: none; + color: #222f3e; + display: flex; + font-size: 16px; + justify-content: space-between; + padding: 8px 16px 0 16px; + position: relative; +} .tox .tox-dialog__header .tox-button { - z-index: 1; + z-index: 1; } - .tox .tox-dialog__draghandle { - cursor: grab; - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; -} - + cursor: grab; + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} .tox .tox-dialog__draghandle:active { - cursor: grabbing; + cursor: grabbing; } - .tox .tox-dialog__dismiss { - margin-left: auto; + margin-left: auto; } - .tox .tox-dialog__title { - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 20px; - font-style: normal; - font-weight: normal; - line-height: 1.3; - margin: 0; - text-transform: none; -} - + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 20px; + font-style: normal; + font-weight: normal; + line-height: 1.3; + margin: 0; + text-transform: none; +} .tox .tox-dialog__body { - color: #222f3e; - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; - font-size: 16px; - font-style: normal; - font-weight: normal; - line-height: 1.3; - min-width: 0; - text-align: left; - text-transform: none; -} - -@media only screen and (max-width: 767px) { - body:not(.tox-force-desktop) .tox .tox-dialog__body { - flex-direction: column; - } -} - -.tox .tox-dialog__body-nav { - align-items: flex-start; - display: flex; + color: #222f3e; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; + font-size: 16px; + font-style: normal; + font-weight: normal; + line-height: 1.3; + min-width: 0; + text-align: left; + text-transform: none; +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox .tox-dialog__body { flex-direction: column; - padding: 16px 16px; -} - -@media only screen and (max-width: 767px) { - body:not(.tox-force-desktop) .tox .tox-dialog__body-nav { - flex-direction: row; - -webkit-overflow-scrolling: touch; - overflow-x: auto; - padding-bottom: 0; - } -} - + } +} +.tox .tox-dialog__body-nav { + align-items: flex-start; + display: flex; + flex-direction: column; + padding: 16px 16px; +} +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox .tox-dialog__body-nav { + flex-direction: row; + -webkit-overflow-scrolling: touch; + overflow-x: auto; + padding-bottom: 0; + } +} .tox .tox-dialog__body-nav-item { - border-bottom: 2px solid transparent; - color: rgba(34, 47, 62, 0.7); - display: inline-block; - font-size: 14px; - line-height: 1.3; - margin-bottom: 8px; - text-decoration: none; - white-space: nowrap; -} - + border-bottom: 2px solid transparent; + color: rgba(34, 47, 62, 0.7); + display: inline-block; + font-size: 14px; + line-height: 1.3; + margin-bottom: 8px; + text-decoration: none; + white-space: nowrap; +} .tox .tox-dialog__body-nav-item:focus { - background-color: rgba(32, 122, 183, 0.1); + background-color: rgba(32, 122, 183, 0.1); } - .tox .tox-dialog__body-nav-item--active { - border-bottom: 2px solid #207ab7; - color: #207ab7; + border-bottom: 2px solid #207ab7; + color: #207ab7; } - .tox .tox-dialog__body-content { - box-sizing: border-box; - display: flex; - flex: 1; - flex-direction: column; - -ms-flex-preferred-size: auto; - max-height: 650px; - overflow: auto; - -webkit-overflow-scrolling: touch; - padding: 16px 16px; + box-sizing: border-box; + display: flex; + flex: 1; + flex-direction: column; + -ms-flex-preferred-size: auto; + max-height: 650px; + overflow: auto; + -webkit-overflow-scrolling: touch; + padding: 16px 16px; } - .tox .tox-dialog__body-content > * { - margin-bottom: 0; - margin-top: 16px; + margin-bottom: 0; + margin-top: 16px; } - .tox .tox-dialog__body-content > *:first-child { - margin-top: 0; + margin-top: 0; } - .tox .tox-dialog__body-content > *:last-child { - margin-bottom: 0; + margin-bottom: 0; } - .tox .tox-dialog__body-content > *:only-child { - margin-bottom: 0; - margin-top: 0; + margin-bottom: 0; + margin-top: 0; } - .tox .tox-dialog__body-content a { - color: #207ab7; - cursor: pointer; - text-decoration: none; + color: #207ab7; + cursor: pointer; + text-decoration: none; } - .tox .tox-dialog__body-content a:hover, .tox .tox-dialog__body-content a:focus { - color: #185d8c; - text-decoration: none; + color: #185d8c; + text-decoration: none; } - .tox .tox-dialog__body-content a:active { - color: #185d8c; - text-decoration: none; + color: #185d8c; + text-decoration: none; } - .tox .tox-dialog__body-content svg { - fill: #222f3e; + fill: #222f3e; } - .tox .tox-dialog__body-content ul { - display: block; - list-style-type: disc; - margin-bottom: 16px; - -webkit-margin-end: 0; - margin-inline-end: 0; - -webkit-margin-start: 0; - margin-inline-start: 0; - -webkit-padding-start: 2.5rem; - padding-inline-start: 2.5rem; -} - + display: block; + list-style-type: disc; + margin-bottom: 16px; + -webkit-margin-end: 0; + margin-inline-end: 0; + -webkit-margin-start: 0; + margin-inline-start: 0; + -webkit-padding-start: 2.5rem; + padding-inline-start: 2.5rem; +} .tox .tox-dialog__body-content .tox-form__group h1 { - color: #222f3e; - font-size: 20px; - font-style: normal; - font-weight: bold; - letter-spacing: normal; - margin-bottom: 16px; - margin-top: 2rem; - text-transform: none; -} - + color: #222f3e; + font-size: 20px; + font-style: normal; + font-weight: bold; + letter-spacing: normal; + margin-bottom: 16px; + margin-top: 2rem; + text-transform: none; +} .tox .tox-dialog__body-content .tox-form__group h2 { - color: #222f3e; - font-size: 16px; - font-style: normal; - font-weight: bold; - letter-spacing: normal; - margin-bottom: 16px; - margin-top: 2rem; - text-transform: none; -} - + color: #222f3e; + font-size: 16px; + font-style: normal; + font-weight: bold; + letter-spacing: normal; + margin-bottom: 16px; + margin-top: 2rem; + text-transform: none; +} .tox .tox-dialog__body-content .tox-form__group p { - margin-bottom: 16px; + margin-bottom: 16px; } - .tox .tox-dialog__body-content .tox-form__group h1:first-child, .tox .tox-dialog__body-content .tox-form__group h2:first-child, .tox .tox-dialog__body-content .tox-form__group p:first-child { - margin-top: 0; + margin-top: 0; } - .tox .tox-dialog__body-content .tox-form__group h1:last-child, .tox .tox-dialog__body-content .tox-form__group h2:last-child, .tox .tox-dialog__body-content .tox-form__group p:last-child { - margin-bottom: 0; + margin-bottom: 0; } - .tox .tox-dialog__body-content .tox-form__group h1:only-child, .tox .tox-dialog__body-content .tox-form__group h2:only-child, .tox .tox-dialog__body-content .tox-form__group p:only-child { - margin-bottom: 0; - margin-top: 0; + margin-bottom: 0; + margin-top: 0; } - .tox .tox-dialog--width-lg { - height: 650px; - max-width: 1200px; + height: 650px; + max-width: 1200px; } - .tox .tox-dialog--width-md { - max-width: 800px; + max-width: 800px; } - .tox .tox-dialog--width-md .tox-dialog__body-content { - overflow: auto; + overflow: auto; } - .tox .tox-dialog__body-content--centered { - text-align: center; + text-align: center; } - .tox .tox-dialog__footer { - align-items: center; - background-color: #fff; - border-top: 1px solid #cccccc; - display: flex; - justify-content: space-between; - padding: 8px 16px; -} - + align-items: center; + background-color: #fff; + border-top: 1px solid #cccccc; + display: flex; + justify-content: space-between; + padding: 8px 16px; +} .tox .tox-dialog__footer-start, .tox .tox-dialog__footer-end { - display: flex; + display: flex; } - .tox .tox-dialog__busy-spinner { - align-items: center; - background-color: rgba(255, 255, 255, 0.75); - bottom: 0; - display: flex; - justify-content: center; - left: 0; - position: absolute; - right: 0; - top: 0; - z-index: 3; -} - + align-items: center; + background-color: rgba(255, 255, 255, 0.75); + bottom: 0; + display: flex; + justify-content: center; + left: 0; + position: absolute; + right: 0; + top: 0; + z-index: 3; +} .tox .tox-dialog__table { - border-collapse: collapse; - width: 100%; + border-collapse: collapse; + width: 100%; } - .tox .tox-dialog__table thead th { - font-weight: bold; - padding-bottom: 8px; + font-weight: bold; + padding-bottom: 8px; } - .tox .tox-dialog__table tbody tr { - border-bottom: 1px solid #cccccc; + border-bottom: 1px solid #cccccc; } - .tox .tox-dialog__table tbody tr:last-child { - border-bottom: none; + border-bottom: none; } - .tox .tox-dialog__table td { - padding-bottom: 8px; - padding-top: 8px; + padding-bottom: 8px; + padding-top: 8px; } - .tox .tox-dialog__popups { - position: absolute; - width: 100%; - z-index: 1100; + position: absolute; + width: 100%; + z-index: 1100; } - .tox .tox-dialog__body-iframe { - display: flex; - flex: 1; - flex-direction: column; - -ms-flex-preferred-size: auto; + display: flex; + flex: 1; + flex-direction: column; + -ms-flex-preferred-size: auto; } - .tox .tox-dialog__body-iframe .tox-navobj { - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; } - .tox .tox-dialog__body-iframe .tox-navobj :nth-child(2) { - flex: 1; - -ms-flex-preferred-size: auto; - height: 100%; + flex: 1; + -ms-flex-preferred-size: auto; + height: 100%; } - .tox .tox-dialog-dock-fadeout { - opacity: 0; - visibility: hidden; + opacity: 0; + visibility: hidden; } - .tox .tox-dialog-dock-fadein { - opacity: 1; - visibility: visible; + opacity: 1; + visibility: visible; } - .tox .tox-dialog-dock-transition { - transition: visibility 0s linear 0.3s, opacity 0.3s ease; + transition: visibility 0s linear 0.3s, opacity 0.3s ease; } - .tox .tox-dialog-dock-transition.tox-dialog-dock-fadein { - transition-delay: 0s; + transition-delay: 0s; } - .tox.tox-platform-ie { - /* IE11 CSS styles go here */ + /* IE11 CSS styles go here */ } - .tox.tox-platform-ie .tox-dialog-wrap { - position: -ms-device-fixed; + position: -ms-device-fixed; } - -@media only screen and (max-width: 767px) { - body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav { - margin-right: 0; - } +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav { + margin-right: 0; + } } - -@media only screen and (max-width: 767px) { - body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav-item:not(:first-child) { - margin-left: 8px; - } +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav-item:not(:first-child) { + margin-left: 8px; + } } - .tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-start > *, .tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-end > * { - margin-left: 8px; + margin-left: 8px; } - .tox[dir=rtl] .tox-dialog__body { - text-align: right; + text-align: right; } - -@media only screen and (max-width: 767px) { - body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav { - margin-left: 0; - } +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav { + margin-left: 0; + } } - -@media only screen and (max-width: 767px) { - body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav-item:not(:first-child) { - margin-right: 8px; - } +@media only screen and (max-width:767px) { + body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav-item:not(:first-child) { + margin-right: 8px; + } } - .tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-start > *, .tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-end > * { - margin-right: 8px; + margin-right: 8px; } - body.tox-dialog__disable-scroll { - overflow: hidden; + overflow: hidden; } - .tox .tox-dropzone-container { - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; } - .tox .tox-dropzone { - align-items: center; - background: #fff; - border: 2px dashed #cccccc; - box-sizing: border-box; - display: flex; - flex-direction: column; - flex-grow: 1; - justify-content: center; - min-height: 100px; - padding: 10px; + align-items: center; + background: #fff; + border: 2px dashed #cccccc; + box-sizing: border-box; + display: flex; + flex-direction: column; + flex-grow: 1; + justify-content: center; + min-height: 100px; + padding: 10px; } - .tox .tox-dropzone p { - color: rgba(34, 47, 62, 0.7); - margin: 0 0 16px 0; + color: rgba(34, 47, 62, 0.7); + margin: 0 0 16px 0; } - .tox .tox-edit-area { - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; - overflow: hidden; - position: relative; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; + overflow: hidden; + position: relative; } - .tox .tox-edit-area__iframe { - background-color: #fff; - border: 0; - box-sizing: border-box; - flex: 1; - -ms-flex-preferred-size: auto; - height: 100%; - position: absolute; - width: 100%; -} - + background-color: #fff; + border: 0; + box-sizing: border-box; + flex: 1; + -ms-flex-preferred-size: auto; + height: 100%; + position: absolute; + width: 100%; +} .tox.tox-inline-edit-area { - border: 1px dotted #cccccc; + border: 1px dotted #cccccc; } - .tox .tox-editor-container { - display: flex; - flex: 1 1 auto; - flex-direction: column; - overflow: hidden; + display: flex; + flex: 1 1 auto; + flex-direction: column; + overflow: hidden; } - .tox .tox-editor-header { - z-index: 1; + z-index: 1; } - .tox:not(.tox-tinymce-inline) .tox-editor-header { - box-shadow: none; - transition: box-shadow 0.5s; + box-shadow: none; + transition: box-shadow 0.5s; } - .tox.tox-tinymce--toolbar-bottom .tox-editor-header, .tox.tox-tinymce-inline .tox-editor-header { - margin-bottom: -1px; + margin-bottom: -1px; } - .tox.tox-tinymce--toolbar-sticky-on .tox-editor-header { - box-shadow: 0 4px 4px -3px rgba(0, 0, 0, 0.25); + box-shadow: 0 4px 4px -3px rgba(0, 0, 0, 0.25); } - .tox-editor-dock-fadeout { - opacity: 0; - visibility: hidden; + opacity: 0; + visibility: hidden; } - .tox-editor-dock-fadein { - opacity: 1; - visibility: visible; + opacity: 1; + visibility: visible; } - .tox-editor-dock-transition { - transition: visibility 0s linear 0.25s, opacity 0.25s ease; + transition: visibility 0s linear 0.25s, opacity 0.25s ease; } - .tox-editor-dock-transition.tox-editor-dock-fadein { - transition-delay: 0s; + transition-delay: 0s; } - .tox .tox-control-wrap { - flex: 1; - position: relative; + flex: 1; + position: relative; } - .tox .tox-control-wrap:not(.tox-control-wrap--status-invalid) .tox-control-wrap__status-icon-invalid, .tox .tox-control-wrap:not(.tox-control-wrap--status-unknown) .tox-control-wrap__status-icon-unknown, .tox .tox-control-wrap:not(.tox-control-wrap--status-valid) .tox-control-wrap__status-icon-valid { - display: none; + display: none; } - .tox .tox-control-wrap svg { - display: block; + display: block; } - .tox .tox-control-wrap__status-icon-wrap { - position: absolute; - top: 50%; - transform: translateY(-50%); + position: absolute; + top: 50%; + transform: translateY(-50%); } - .tox .tox-control-wrap__status-icon-invalid svg { - fill: #c00; + fill: #c00; } - .tox .tox-control-wrap__status-icon-unknown svg { - fill: orange; + fill: orange; } - .tox .tox-control-wrap__status-icon-valid svg { - fill: green; + fill: green; } - .tox:not([dir=rtl]) .tox-control-wrap--status-invalid .tox-textfield, .tox:not([dir=rtl]) .tox-control-wrap--status-unknown .tox-textfield, .tox:not([dir=rtl]) .tox-control-wrap--status-valid .tox-textfield { - padding-right: 32px; + padding-right: 32px; } - .tox:not([dir=rtl]) .tox-control-wrap__status-icon-wrap { - right: 4px; + right: 4px; } - .tox[dir=rtl] .tox-control-wrap--status-invalid .tox-textfield, .tox[dir=rtl] .tox-control-wrap--status-unknown .tox-textfield, .tox[dir=rtl] .tox-control-wrap--status-valid .tox-textfield { - padding-left: 32px; + padding-left: 32px; } - .tox[dir=rtl] .tox-control-wrap__status-icon-wrap { - left: 4px; + left: 4px; } - .tox .tox-autocompleter { - max-width: 25em; + max-width: 25em; } - .tox .tox-autocompleter .tox-menu { - max-width: 25em; + max-width: 25em; } - .tox .tox-autocompleter .tox-autocompleter-highlight { - font-weight: bold; + font-weight: bold; } - .tox .tox-color-input { - display: flex; - position: relative; - z-index: 1; + display: flex; + position: relative; + z-index: 1; } - .tox .tox-color-input .tox-textfield { - z-index: -1; + z-index: -1; } - .tox .tox-color-input span { - border-color: rgba(34, 47, 62, 0.2); - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: none; - box-sizing: border-box; - height: 24px; - position: absolute; - top: 6px; - width: 24px; -} - + border-color: rgba(34, 47, 62, 0.2); + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + box-sizing: border-box; + height: 24px; + position: absolute; + top: 6px; + width: 24px; +} .tox .tox-color-input span:hover:not([aria-disabled=true]), .tox .tox-color-input span:focus:not([aria-disabled=true]) { - border-color: #207ab7; - cursor: pointer; + border-color: #207ab7; + cursor: pointer; } - .tox .tox-color-input span::before { - background-image: linear-gradient(45deg, rgba(0, 0, 0, 0.25) 25%, transparent 25%), linear-gradient(-45deg, rgba(0, 0, 0, 0.25) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.25) 75%), linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.25) 75%); - background-position: 0 0, 0 6px, 6px -6px, -6px 0; - background-size: 12px 12px; - border: 1px solid #fff; - border-radius: 3px; - box-sizing: border-box; - content: ''; - height: 24px; - left: -1px; - position: absolute; - top: -1px; - width: 24px; - z-index: -1; -} - + background-image: linear-gradient(45deg, rgba(0, 0, 0, 0.25) 25%, transparent 25%), linear-gradient(-45deg, rgba(0, 0, 0, 0.25) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.25) 75%), linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.25) 75%); + background-position: 0 0, 0 6px, 6px -6px, -6px 0; + background-size: 12px 12px; + border: 1px solid #fff; + border-radius: 3px; + box-sizing: border-box; + content: ''; + height: 24px; + left: -1px; + position: absolute; + top: -1px; + width: 24px; + z-index: -1; +} .tox .tox-color-input span[aria-disabled=true] { - cursor: not-allowed; + cursor: not-allowed; } - .tox:not([dir=rtl]) .tox-color-input { - /* stylelint-disable-next-line no-descending-specificity */ + /* stylelint-disable-next-line no-descending-specificity */ } - .tox:not([dir=rtl]) .tox-color-input .tox-textfield { - padding-left: 36px; + padding-left: 36px; } - .tox:not([dir=rtl]) .tox-color-input span { - left: 6px; + left: 6px; } - .tox[dir="rtl"] .tox-color-input { - /* stylelint-disable-next-line no-descending-specificity */ + /* stylelint-disable-next-line no-descending-specificity */ } - .tox[dir="rtl"] .tox-color-input .tox-textfield { - padding-right: 36px; + padding-right: 36px; } - .tox[dir="rtl"] .tox-color-input span { - right: 6px; + right: 6px; } - .tox .tox-label, .tox .tox-toolbar-label { - color: rgba(34, 47, 62, 0.7); - display: block; - font-size: 14px; - font-style: normal; - font-weight: normal; - line-height: 1.3; - padding: 0 8px 0 0; - text-transform: none; - white-space: nowrap; -} - + color: rgba(34, 47, 62, 0.7); + display: block; + font-size: 14px; + font-style: normal; + font-weight: normal; + line-height: 1.3; + padding: 0 8px 0 0; + text-transform: none; + white-space: nowrap; +} .tox .tox-toolbar-label { - padding: 0 8px; + padding: 0 8px; } - .tox[dir=rtl] .tox-label { - padding: 0 0 0 8px; + padding: 0 0 0 8px; } - .tox .tox-form { - display: flex; - flex: 1; - flex-direction: column; - -ms-flex-preferred-size: auto; + display: flex; + flex: 1; + flex-direction: column; + -ms-flex-preferred-size: auto; } - .tox .tox-form__group { - box-sizing: border-box; - margin-bottom: 4px; + box-sizing: border-box; + margin-bottom: 4px; } - .tox .tox-form-group--maximize { - flex: 1; + flex: 1; } - .tox .tox-form__group--error { - color: #c00; + color: #c00; } - .tox .tox-form__group--collection { - display: flex; + display: flex; } - .tox .tox-form__grid { - display: flex; - flex-direction: row; - flex-wrap: wrap; - justify-content: space-between; + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between; } - .tox .tox-form__grid--2col > .tox-form__group { - width: calc(50% - (8px / 2)); + width: calc(50% - (8px / 2)); } - .tox .tox-form__grid--3col > .tox-form__group { - width: calc(100% / 3 - (8px / 2)); + width: calc(100% / 3 - (8px / 2)); } - .tox .tox-form__grid--4col > .tox-form__group { - width: calc(25% - (8px / 2)); + width: calc(25% - (8px / 2)); } - .tox .tox-form__controls-h-stack { - align-items: center; - display: flex; + align-items: center; + display: flex; } - .tox .tox-form__group--inline { - align-items: center; - display: flex; + align-items: center; + display: flex; } - .tox .tox-form__group--stretched { - display: flex; - flex: 1; - flex-direction: column; - -ms-flex-preferred-size: auto; + display: flex; + flex: 1; + flex-direction: column; + -ms-flex-preferred-size: auto; } - .tox .tox-form__group--stretched .tox-textarea { - flex: 1; - -ms-flex-preferred-size: auto; + flex: 1; + -ms-flex-preferred-size: auto; } - .tox .tox-form__group--stretched .tox-navobj { - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; } - .tox .tox-form__group--stretched .tox-navobj :nth-child(2) { - flex: 1; - -ms-flex-preferred-size: auto; - height: 100%; + flex: 1; + -ms-flex-preferred-size: auto; + height: 100%; } - .tox:not([dir=rtl]) .tox-form__controls-h-stack > *:not(:first-child) { - margin-left: 4px; + margin-left: 4px; } - .tox[dir=rtl] .tox-form__controls-h-stack > *:not(:first-child) { - margin-right: 4px; + margin-right: 4px; } - .tox .tox-lock.tox-locked .tox-lock-icon__unlock, .tox .tox-lock:not(.tox-locked) .tox-lock-icon__lock { - display: none; + display: none; } - .tox .tox-textfield, .tox .tox-toolbar-textfield, .tox .tox-listboxfield .tox-listbox--select, .tox .tox-textarea { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #fff; - border-color: #cccccc; - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: none; - box-sizing: border-box; - color: #222f3e; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 16px; - line-height: 24px; - margin: 0; - min-height: 34px; - outline: none; - padding: 5px 4.75px; - resize: none; - width: 100%; -} - + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background-color: #fff; + border-color: #cccccc; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + box-sizing: border-box; + color: #222f3e; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 16px; + line-height: 24px; + margin: 0; + min-height: 34px; + outline: none; + padding: 5px 4.75px; + resize: none; + width: 100%; +} .tox .tox-textfield[disabled], .tox .tox-textarea[disabled] { - background-color: #f2f2f2; - color: rgba(34, 47, 62, 0.85); - cursor: not-allowed; + background-color: #f2f2f2; + color: rgba(34, 47, 62, 0.85); + cursor: not-allowed; } - .tox .tox-textfield:focus, .tox .tox-listboxfield .tox-listbox--select:focus, .tox .tox-textarea:focus { - background-color: #fff; - border-color: #207ab7; - box-shadow: none; - outline: none; + background-color: #fff; + border-color: #207ab7; + box-shadow: none; + outline: none; } - .tox .tox-toolbar-textfield { - border-width: 0; - margin-bottom: 3px; - margin-top: 2px; - max-width: 250px; + border-width: 0; + margin-bottom: 3px; + margin-top: 2px; + max-width: 250px; } - .tox .tox-naked-btn { - background-color: transparent; - border: 0; - border-color: transparent; - box-shadow: unset; - color: #207ab7; - cursor: pointer; - display: block; - margin: 0; - padding: 0; -} - + background-color: transparent; + border: 0; + border-color: transparent; + box-shadow: unset; + color: #207ab7; + cursor: pointer; + display: block; + margin: 0; + padding: 0; +} .tox .tox-naked-btn svg { - display: block; - fill: #222f3e; + display: block; + fill: #222f3e; } - .tox:not([dir=rtl]) .tox-toolbar-textfield + * { - margin-left: 4px; + margin-left: 4px; } - .tox[dir=rtl] .tox-toolbar-textfield + * { - margin-right: 4px; + margin-right: 4px; } - .tox .tox-listboxfield { - cursor: pointer; - position: relative; + cursor: pointer; + position: relative; } - .tox .tox-listboxfield .tox-listbox--select[disabled] { - background-color: #f2f2f2; - color: rgba(34, 47, 62, 0.85); - cursor: not-allowed; + background-color: #f2f2f2; + color: rgba(34, 47, 62, 0.85); + cursor: not-allowed; } - .tox .tox-listbox__select-label { - cursor: default; - flex: 1; - margin: 0 4px; + cursor: default; + flex: 1; + margin: 0 4px; } - .tox .tox-listbox__select-chevron { - align-items: center; - display: flex; - justify-content: center; - width: 16px; + align-items: center; + display: flex; + justify-content: center; + width: 16px; } - .tox .tox-listbox__select-chevron svg { - fill: #222f3e; + fill: #222f3e; } - .tox .tox-listboxfield .tox-listbox--select { - align-items: center; - display: flex; + align-items: center; + display: flex; } - .tox:not([dir=rtl]) .tox-listboxfield svg { - right: 8px; + right: 8px; } - .tox[dir=rtl] .tox-listboxfield svg { - left: 8px; + left: 8px; } - .tox .tox-selectfield { - cursor: pointer; - position: relative; + cursor: pointer; + position: relative; } - .tox .tox-selectfield select { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #fff; - border-color: #cccccc; - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: none; - box-sizing: border-box; - color: #222f3e; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 16px; - line-height: 24px; - margin: 0; - min-height: 34px; - outline: none; - padding: 5px 4.75px; - resize: none; - width: 100%; -} - + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background-color: #fff; + border-color: #cccccc; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + box-sizing: border-box; + color: #222f3e; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-size: 16px; + line-height: 24px; + margin: 0; + min-height: 34px; + outline: none; + padding: 5px 4.75px; + resize: none; + width: 100%; +} .tox .tox-selectfield select[disabled] { - background-color: #f2f2f2; - color: rgba(34, 47, 62, 0.85); - cursor: not-allowed; + background-color: #f2f2f2; + color: rgba(34, 47, 62, 0.85); + cursor: not-allowed; } - .tox .tox-selectfield select::-ms-expand { - display: none; + display: none; } - .tox .tox-selectfield select:focus { - background-color: #fff; - border-color: #207ab7; - box-shadow: none; - outline: none; + background-color: #fff; + border-color: #207ab7; + box-shadow: none; + outline: none; } - .tox .tox-selectfield svg { - pointer-events: none; - position: absolute; - top: 50%; - transform: translateY(-50%); + pointer-events: none; + position: absolute; + top: 50%; + transform: translateY(-50%); } - .tox:not([dir=rtl]) .tox-selectfield select[size="0"], .tox:not([dir=rtl]) .tox-selectfield select[size="1"] { - padding-right: 24px; + padding-right: 24px; } - .tox:not([dir=rtl]) .tox-selectfield svg { - right: 8px; + right: 8px; } - .tox[dir=rtl] .tox-selectfield select[size="0"], .tox[dir=rtl] .tox-selectfield select[size="1"] { - padding-left: 24px; + padding-left: 24px; } - .tox[dir=rtl] .tox-selectfield svg { - left: 8px; + left: 8px; } - .tox .tox-textarea { - -webkit-appearance: textarea; - -moz-appearance: textarea; - appearance: textarea; - white-space: pre-wrap; + -webkit-appearance: textarea; + -moz-appearance: textarea; + appearance: textarea; + white-space: pre-wrap; } - .tox-fullscreen { - border: 0; - height: 100%; - left: 0; - margin: 0; - overflow: hidden; - -ms-scroll-chaining: none; - overscroll-behavior: none; - padding: 0; - position: fixed; - top: 0; - touch-action: pinch-zoom; - width: 100%; -} - + border: 0; + height: 100%; + left: 0; + margin: 0; + overflow: hidden; + -ms-scroll-chaining: none; + overscroll-behavior: none; + padding: 0; + position: fixed; + top: 0; + touch-action: pinch-zoom; + width: 100%; +} .tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle { - display: none; + display: none; } - .tox.tox-tinymce.tox-fullscreen { - z-index: 1200; + z-index: 1200; } - .tox-shadowhost.tox-fullscreen { - z-index: 1200; + z-index: 1200; } - .tox-fullscreen .tox.tox-tinymce-aux, .tox-fullscreen ~ .tox.tox-tinymce-aux { - z-index: 1201; + z-index: 1201; } - .tox .tox-help__more-link { - list-style: none; - margin-top: 1em; + list-style: none; + margin-top: 1em; } - .tox .tox-image-tools { - width: 100%; + width: 100%; } - .tox .tox-image-tools__toolbar { - align-items: center; - display: flex; - justify-content: center; + align-items: center; + display: flex; + justify-content: center; } - .tox .tox-image-tools__image { - background-color: #666; - height: 380px; - overflow: auto; - position: relative; - width: 100%; + background-color: #666; + height: 380px; + overflow: auto; + position: relative; + width: 100%; } - .tox .tox-image-tools__image, .tox .tox-image-tools__image + .tox-image-tools__toolbar { - margin-top: 8px; + margin-top: 8px; } - .tox .tox-image-tools__image-bg { - background: url(data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==); + background: url(data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==); } - .tox .tox-image-tools__toolbar > .tox-spacer { - flex: 1; - -ms-flex-preferred-size: auto; + flex: 1; + -ms-flex-preferred-size: auto; } - .tox .tox-croprect-block { - background: black; - filter: alpha(opacity=50); - opacity: 0.5; - position: absolute; - zoom: 1; + background: black; + filter: alpha(opacity=50); + opacity: 0.5; + position: absolute; + zoom: 1; } - .tox .tox-croprect-handle { - border: 2px solid white; - height: 20px; - left: 0; - position: absolute; - top: 0; - width: 20px; -} - + border: 2px solid white; + height: 20px; + left: 0; + position: absolute; + top: 0; + width: 20px; +} .tox .tox-croprect-handle-move { - border: 0; - cursor: move; - position: absolute; + border: 0; + cursor: move; + position: absolute; } - .tox .tox-croprect-handle-nw { - border-width: 2px 0 0 2px; - cursor: nw-resize; - left: 100px; - margin: -2px 0 0 -2px; - top: 100px; + border-width: 2px 0 0 2px; + cursor: nw-resize; + left: 100px; + margin: -2px 0 0 -2px; + top: 100px; } - .tox .tox-croprect-handle-ne { - border-width: 2px 2px 0 0; - cursor: ne-resize; - left: 200px; - margin: -2px 0 0 -20px; - top: 100px; + border-width: 2px 2px 0 0; + cursor: ne-resize; + left: 200px; + margin: -2px 0 0 -20px; + top: 100px; } - .tox .tox-croprect-handle-sw { - border-width: 0 0 2px 2px; - cursor: sw-resize; - left: 100px; - margin: -20px 2px 0 -2px; - top: 200px; + border-width: 0 0 2px 2px; + cursor: sw-resize; + left: 100px; + margin: -20px 2px 0 -2px; + top: 200px; } - .tox .tox-croprect-handle-se { - border-width: 0 2px 2px 0; - cursor: se-resize; - left: 200px; - margin: -20px 0 0 -20px; - top: 200px; + border-width: 0 2px 2px 0; + cursor: se-resize; + left: 200px; + margin: -20px 0 0 -20px; + top: 200px; } - .tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-slider:not(:first-of-type) { - margin-left: 8px; + margin-left: 8px; } - .tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-button + .tox-slider { - margin-left: 32px; + margin-left: 32px; } - .tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-slider + .tox-button { - margin-left: 32px; + margin-left: 32px; } - .tox[dir=rtl] .tox-image-tools__toolbar > .tox-slider:not(:first-of-type) { - margin-right: 8px; + margin-right: 8px; } - .tox[dir=rtl] .tox-image-tools__toolbar > .tox-button + .tox-slider { - margin-right: 32px; + margin-right: 32px; } - .tox[dir=rtl] .tox-image-tools__toolbar > .tox-slider + .tox-button { - margin-right: 32px; + margin-right: 32px; } - .tox .tox-insert-table-picker { - display: flex; - flex-wrap: wrap; - width: 170px; + display: flex; + flex-wrap: wrap; + width: 170px; } - .tox .tox-insert-table-picker > div { - border-color: #cccccc; - border-style: solid; - border-width: 0 1px 1px 0; - box-sizing: border-box; - height: 17px; - width: 17px; -} - + border-color: #cccccc; + border-style: solid; + border-width: 0 1px 1px 0; + box-sizing: border-box; + height: 17px; + width: 17px; +} .tox .tox-collection--list .tox-collection__group .tox-insert-table-picker { - margin: -4px 0; + margin: -4px 0; } - .tox .tox-insert-table-picker .tox-insert-table-picker__selected { - background-color: rgba(32, 122, 183, 0.5); - border-color: rgba(32, 122, 183, 0.5); + background-color: rgba(32, 122, 183, 0.5); + border-color: rgba(32, 122, 183, 0.5); } - .tox .tox-insert-table-picker__label { - color: rgba(34, 47, 62, 0.7); - display: block; - font-size: 14px; - padding: 4px; - text-align: center; - width: 100%; -} - + color: rgba(34, 47, 62, 0.7); + display: block; + font-size: 14px; + padding: 4px; + text-align: center; + width: 100%; +} .tox:not([dir=rtl]) { - /* stylelint-disable-next-line no-descending-specificity */ + /* stylelint-disable-next-line no-descending-specificity */ } - .tox:not([dir=rtl]) .tox-insert-table-picker > div:nth-child(10n) { - border-right: 0; + border-right: 0; } - .tox[dir=rtl] { - /* stylelint-disable-next-line no-descending-specificity */ + /* stylelint-disable-next-line no-descending-specificity */ } - .tox[dir=rtl] .tox-insert-table-picker > div:nth-child(10n+1) { - border-right: 0; + border-right: 0; } - .tox { - /* stylelint-disable */ - /* stylelint-enable */ + /* stylelint-disable */ + /* stylelint-enable */ } - .tox .tox-menu { - background-color: #fff; - border: 1px solid #cccccc; - border-radius: 3px; - box-shadow: 0 4px 8px 0 rgba(34, 47, 62, 0.1); - display: inline-block; - overflow: hidden; - vertical-align: top; - z-index: 1150; -} - + background-color: #fff; + border: 1px solid #cccccc; + border-radius: 3px; + box-shadow: 0 4px 8px 0 rgba(34, 47, 62, 0.1); + display: inline-block; + overflow: hidden; + vertical-align: top; + z-index: 1150; +} .tox .tox-menu.tox-collection.tox-collection--list { - padding: 0; + padding: 0; } - .tox .tox-menu.tox-collection.tox-collection--toolbar { - padding: 4px; + padding: 4px; } - .tox .tox-menu.tox-collection.tox-collection--grid { - padding: 4px; + padding: 4px; } - .tox .tox-menu__label h1, .tox .tox-menu__label h2, .tox .tox-menu__label h3, @@ -2522,1083 +2108,917 @@ body.tox-dialog__disable-scroll { .tox .tox-menu__label p, .tox .tox-menu__label blockquote, .tox .tox-menu__label code { - margin: 0; + margin: 0; } - .tox .tox-menubar { - background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23cccccc'/%3E%3C/svg%3E") left 0 top 0 #fff; - background-color: #fff; - display: flex; - flex: 0 0 auto; - flex-shrink: 0; - flex-wrap: wrap; - padding: 0 4px 0 4px; -} - + background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23cccccc'/%3E%3C/svg%3E") left 0 top 0 #fff; + background-color: #fff; + display: flex; + flex: 0 0 auto; + flex-shrink: 0; + flex-wrap: wrap; + padding: 0 4px 0 4px; +} .tox.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-menubar { - border-top: 1px solid #cccccc; + border-top: 1px solid #cccccc; } - /* Deprecated. Remove in next major release */ .tox .tox-mbtn { - align-items: center; - background: transparent; - border: 0; - border-radius: 3px; - box-shadow: none; - color: #222f3e; - display: flex; - flex: 0 0 auto; - font-size: 14px; - font-style: normal; - font-weight: normal; - height: 34px; - justify-content: center; - margin: 2px 0 3px 0; - outline: none; - overflow: hidden; - padding: 0 4px; - text-transform: none; - width: auto; -} - + align-items: center; + background: transparent; + border: 0; + border-radius: 3px; + box-shadow: none; + color: #222f3e; + display: flex; + flex: 0 0 auto; + font-size: 14px; + font-style: normal; + font-weight: normal; + height: 34px; + justify-content: center; + margin: 2px 0 3px 0; + outline: none; + overflow: hidden; + padding: 0 4px; + text-transform: none; + width: auto; +} .tox .tox-mbtn[disabled] { - background-color: transparent; - border: 0; - box-shadow: none; - color: rgba(34, 47, 62, 0.5); - cursor: not-allowed; + background-color: transparent; + border: 0; + box-shadow: none; + color: rgba(34, 47, 62, 0.5); + cursor: not-allowed; } - .tox .tox-mbtn:focus:not(:disabled) { - background: #dee0e2; - border: 0; - box-shadow: none; - color: #222f3e; + background: #dee0e2; + border: 0; + box-shadow: none; + color: #222f3e; } - .tox .tox-mbtn--active { - background: #c8cbcf; - border: 0; - box-shadow: none; - color: #222f3e; + background: #c8cbcf; + border: 0; + box-shadow: none; + color: #222f3e; } - .tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active) { - background: #dee0e2; - border: 0; - box-shadow: none; - color: #222f3e; + background: #dee0e2; + border: 0; + box-shadow: none; + color: #222f3e; } - .tox .tox-mbtn__select-label { - cursor: default; - font-weight: normal; - margin: 0 4px; + cursor: default; + font-weight: normal; + margin: 0 4px; } - .tox .tox-mbtn[disabled] .tox-mbtn__select-label { - cursor: not-allowed; + cursor: not-allowed; } - .tox .tox-mbtn__select-chevron { - align-items: center; - display: flex; - justify-content: center; - width: 16px; - display: none; + align-items: center; + display: flex; + justify-content: center; + width: 16px; + display: none; } - .tox .tox-notification { - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: none; - box-sizing: border-box; - display: -ms-grid; - display: grid; - font-size: 14px; - font-weight: normal; - -ms-grid-columns: minmax(40px, 1fr) auto minmax(40px, 1fr); - grid-template-columns: minmax(40px, 1fr) auto minmax(40px, 1fr); - margin-top: 4px; - opacity: 0; - padding: 4px; - transition: transform 100ms ease-in, opacity 150ms ease-in; -} - + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + box-sizing: border-box; + display: -ms-grid; + display: grid; + font-size: 14px; + font-weight: normal; + -ms-grid-columns: minmax(40px, 1fr) auto minmax(40px, 1fr); + grid-template-columns: minmax(40px, 1fr) auto minmax(40px, 1fr); + margin-top: 4px; + opacity: 0; + padding: 4px; + transition: transform 100ms ease-in, opacity 150ms ease-in; +} .tox .tox-notification p { - font-size: 14px; - font-weight: normal; + font-size: 14px; + font-weight: normal; } - .tox .tox-notification a { - text-decoration: underline; + text-decoration: underline; } - .tox .tox-notification--in { - opacity: 1; + opacity: 1; } - .tox .tox-notification--success { - background-color: #e4eeda; - border-color: #d7e6c8; - color: #222f3e; + background-color: #e4eeda; + border-color: #d7e6c8; + color: #222f3e; } - .tox .tox-notification--success p { - color: #222f3e; + color: #222f3e; } - .tox .tox-notification--success a { - color: #547831; + color: #547831; } - .tox .tox-notification--success svg { - fill: #222f3e; + fill: #222f3e; } - .tox .tox-notification--error { - background-color: #f8dede; - border-color: #f2bfbf; - color: #222f3e; + background-color: #f8dede; + border-color: #f2bfbf; + color: #222f3e; } - .tox .tox-notification--error p { - color: #222f3e; + color: #222f3e; } - .tox .tox-notification--error a { - color: #c00; + color: #c00; } - .tox .tox-notification--error svg { - fill: #222f3e; + fill: #222f3e; } - .tox .tox-notification--warn, .tox .tox-notification--warning { - background-color: #fffaea; - border-color: #ffe89d; - color: #222f3e; + background-color: #fffaea; + border-color: #ffe89d; + color: #222f3e; } - .tox .tox-notification--warn p, .tox .tox-notification--warning p { - color: #222f3e; + color: #222f3e; } - .tox .tox-notification--warn a, .tox .tox-notification--warning a { - color: #222f3e; + color: #222f3e; } - .tox .tox-notification--warn svg, .tox .tox-notification--warning svg { - fill: #222f3e; + fill: #222f3e; } - .tox .tox-notification--info { - background-color: #d9edf7; - border-color: #779ecb; - color: #222f3e; + background-color: #d9edf7; + border-color: #779ecb; + color: #222f3e; } - .tox .tox-notification--info p { - color: #222f3e; + color: #222f3e; } - .tox .tox-notification--info a { - color: #222f3e; + color: #222f3e; } - .tox .tox-notification--info svg { - fill: #222f3e; + fill: #222f3e; } - .tox .tox-notification__body { - -ms-grid-row-align: center; - align-self: center; - color: #222f3e; - font-size: 14px; - -ms-grid-column-span: 1; - grid-column-end: 3; - -ms-grid-column: 2; - grid-column-start: 2; - -ms-grid-row-span: 1; - grid-row-end: 2; - -ms-grid-row: 1; - grid-row-start: 1; - text-align: center; - white-space: normal; - word-break: break-all; - word-break: break-word; -} - + -ms-grid-row-align: center; + align-self: center; + color: #222f3e; + font-size: 14px; + -ms-grid-column-span: 1; + grid-column-end: 3; + -ms-grid-column: 2; + grid-column-start: 2; + -ms-grid-row-span: 1; + grid-row-end: 2; + -ms-grid-row: 1; + grid-row-start: 1; + text-align: center; + white-space: normal; + word-break: break-all; + word-break: break-word; +} .tox .tox-notification__body > * { - margin: 0; + margin: 0; } - .tox .tox-notification__body > * + * { - margin-top: 1rem; + margin-top: 1rem; } - .tox .tox-notification__icon { - -ms-grid-row-align: center; - align-self: center; - -ms-grid-column-span: 1; - grid-column-end: 2; - -ms-grid-column: 1; - grid-column-start: 1; - -ms-grid-row-span: 1; - grid-row-end: 2; - -ms-grid-row: 1; - grid-row-start: 1; - -ms-grid-column-align: end; - justify-self: end; -} - + -ms-grid-row-align: center; + align-self: center; + -ms-grid-column-span: 1; + grid-column-end: 2; + -ms-grid-column: 1; + grid-column-start: 1; + -ms-grid-row-span: 1; + grid-row-end: 2; + -ms-grid-row: 1; + grid-row-start: 1; + -ms-grid-column-align: end; + justify-self: end; +} .tox .tox-notification__icon svg { - display: block; + display: block; } - .tox .tox-notification__dismiss { - -ms-grid-row-align: start; - align-self: start; - -ms-grid-column-span: 1; - grid-column-end: 4; - -ms-grid-column: 3; - grid-column-start: 3; - -ms-grid-row-span: 1; - grid-row-end: 2; - -ms-grid-row: 1; - grid-row-start: 1; - -ms-grid-column-align: end; - justify-self: end; -} - + -ms-grid-row-align: start; + align-self: start; + -ms-grid-column-span: 1; + grid-column-end: 4; + -ms-grid-column: 3; + grid-column-start: 3; + -ms-grid-row-span: 1; + grid-row-end: 2; + -ms-grid-row: 1; + grid-row-start: 1; + -ms-grid-column-align: end; + justify-self: end; +} .tox .tox-notification .tox-progress-bar { - -ms-grid-column-span: 3; - grid-column-end: 4; - -ms-grid-column: 1; - grid-column-start: 1; - -ms-grid-row-span: 1; - grid-row-end: 3; - -ms-grid-row: 2; - grid-row-start: 2; - -ms-grid-column-align: center; - justify-self: center; -} - + -ms-grid-column-span: 3; + grid-column-end: 4; + -ms-grid-column: 1; + grid-column-start: 1; + -ms-grid-row-span: 1; + grid-row-end: 3; + -ms-grid-row: 2; + grid-row-start: 2; + -ms-grid-column-align: center; + justify-self: center; +} .tox .tox-pop { - display: inline-block; - position: relative; + display: inline-block; + position: relative; } - .tox .tox-pop--resizing { - transition: width 0.1s ease; + transition: width 0.1s ease; } - .tox .tox-pop--resizing .tox-toolbar { - flex-wrap: nowrap; + flex-wrap: nowrap; } - .tox .tox-pop__dialog { - background-color: #fff; - border: 1px solid #cccccc; - border-radius: 3px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); - min-width: 0; - overflow: hidden; -} - + background-color: #fff; + border: 1px solid #cccccc; + border-radius: 3px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); + min-width: 0; + overflow: hidden; +} .tox .tox-pop__dialog > *:not(.tox-toolbar) { - margin: 4px 4px 4px 8px; + margin: 4px 4px 4px 8px; } - .tox .tox-pop__dialog .tox-toolbar { - background-color: transparent; - margin-bottom: -1px; + background-color: transparent; + margin-bottom: -1px; } - .tox .tox-pop::before, .tox .tox-pop::after { - border-style: solid; - content: ''; - display: block; - height: 0; - position: absolute; - width: 0; -} - + border-style: solid; + content: ''; + display: block; + height: 0; + position: absolute; + width: 0; +} .tox .tox-pop.tox-pop--bottom::before, .tox .tox-pop.tox-pop--bottom::after { - left: 50%; - top: 100%; + left: 50%; + top: 100%; } - .tox .tox-pop.tox-pop--bottom::after { - border-color: #fff transparent transparent transparent; - border-width: 8px; - margin-left: -8px; - margin-top: -1px; + border-color: #fff transparent transparent transparent; + border-width: 8px; + margin-left: -8px; + margin-top: -1px; } - .tox .tox-pop.tox-pop--bottom::before { - border-color: #cccccc transparent transparent transparent; - border-width: 9px; - margin-left: -9px; + border-color: #cccccc transparent transparent transparent; + border-width: 9px; + margin-left: -9px; } - .tox .tox-pop.tox-pop--top::before, .tox .tox-pop.tox-pop--top::after { - left: 50%; - top: 0; - transform: translateY(-100%); + left: 50%; + top: 0; + transform: translateY(-100%); } - .tox .tox-pop.tox-pop--top::after { - border-color: transparent transparent #fff transparent; - border-width: 8px; - margin-left: -8px; - margin-top: 1px; + border-color: transparent transparent #fff transparent; + border-width: 8px; + margin-left: -8px; + margin-top: 1px; } - .tox .tox-pop.tox-pop--top::before { - border-color: transparent transparent #cccccc transparent; - border-width: 9px; - margin-left: -9px; + border-color: transparent transparent #cccccc transparent; + border-width: 9px; + margin-left: -9px; } - .tox .tox-pop.tox-pop--left::before, .tox .tox-pop.tox-pop--left::after { - left: 0; - top: calc(50% - 1px); - transform: translateY(-50%); + left: 0; + top: calc(50% - 1px); + transform: translateY(-50%); } - .tox .tox-pop.tox-pop--left::after { - border-color: transparent #fff transparent transparent; - border-width: 8px; - margin-left: -15px; + border-color: transparent #fff transparent transparent; + border-width: 8px; + margin-left: -15px; } - .tox .tox-pop.tox-pop--left::before { - border-color: transparent #cccccc transparent transparent; - border-width: 10px; - margin-left: -19px; + border-color: transparent #cccccc transparent transparent; + border-width: 10px; + margin-left: -19px; } - .tox .tox-pop.tox-pop--right::before, .tox .tox-pop.tox-pop--right::after { - left: 100%; - top: calc(50% + 1px); - transform: translateY(-50%); + left: 100%; + top: calc(50% + 1px); + transform: translateY(-50%); } - .tox .tox-pop.tox-pop--right::after { - border-color: transparent transparent transparent #fff; - border-width: 8px; - margin-left: -1px; + border-color: transparent transparent transparent #fff; + border-width: 8px; + margin-left: -1px; } - .tox .tox-pop.tox-pop--right::before { - border-color: transparent transparent transparent #cccccc; - border-width: 10px; - margin-left: -1px; + border-color: transparent transparent transparent #cccccc; + border-width: 10px; + margin-left: -1px; } - .tox .tox-pop.tox-pop--align-left::before, .tox .tox-pop.tox-pop--align-left::after { - left: 20px; + left: 20px; } - .tox .tox-pop.tox-pop--align-right::before, .tox .tox-pop.tox-pop--align-right::after { - left: calc(100% - 20px); + left: calc(100% - 20px); } - .tox .tox-sidebar-wrap { - display: flex; - flex-direction: row; - flex-grow: 1; - -ms-flex-preferred-size: 0; - min-height: 0; + display: flex; + flex-direction: row; + flex-grow: 1; + -ms-flex-preferred-size: 0; + min-height: 0; } - .tox .tox-sidebar { - background-color: #fff; - display: flex; - flex-direction: row; - justify-content: flex-end; + background-color: #fff; + display: flex; + flex-direction: row; + justify-content: flex-end; } - .tox .tox-sidebar__slider { - display: flex; - overflow: hidden; + display: flex; + overflow: hidden; } - .tox .tox-sidebar__pane-container { - display: flex; + display: flex; } - .tox .tox-sidebar__pane { - display: flex; + display: flex; } - .tox .tox-sidebar--sliding-closed { - opacity: 0; + opacity: 0; } - .tox .tox-sidebar--sliding-open { - opacity: 1; + opacity: 1; } - .tox .tox-sidebar--sliding-growing, .tox .tox-sidebar--sliding-shrinking { - transition: width 0.5s ease, opacity 0.5s ease; + transition: width 0.5s ease, opacity 0.5s ease; } - .tox .tox-selector { - background-color: #4099ff; - border-color: #4099ff; - border-style: solid; - border-width: 1px; - box-sizing: border-box; - display: inline-block; - height: 10px; - position: absolute; - width: 10px; -} - + background-color: #4099ff; + border-color: #4099ff; + border-style: solid; + border-width: 1px; + box-sizing: border-box; + display: inline-block; + height: 10px; + position: absolute; + width: 10px; +} .tox.tox-platform-touch .tox-selector { - height: 12px; - width: 12px; + height: 12px; + width: 12px; } - .tox .tox-slider { - align-items: center; - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; - height: 24px; - justify-content: center; - position: relative; -} - + align-items: center; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; + height: 24px; + justify-content: center; + position: relative; +} .tox .tox-slider__rail { - background-color: transparent; - border: 1px solid #cccccc; - border-radius: 3px; - height: 10px; - min-width: 120px; - width: 100%; -} - + background-color: transparent; + border: 1px solid #cccccc; + border-radius: 3px; + height: 10px; + min-width: 120px; + width: 100%; +} .tox .tox-slider__handle { - background-color: #207ab7; - border: 2px solid #185d8c; - border-radius: 3px; - box-shadow: none; - height: 24px; - left: 50%; - position: absolute; - top: 50%; - transform: translateX(-50%) translateY(-50%); - width: 14px; -} - + background-color: #207ab7; + border: 2px solid #185d8c; + border-radius: 3px; + box-shadow: none; + height: 24px; + left: 50%; + position: absolute; + top: 50%; + transform: translateX(-50%) translateY(-50%); + width: 14px; +} .tox .tox-source-code { - overflow: auto; + overflow: auto; } - .tox .tox-spinner { - display: flex; + display: flex; } - .tox .tox-spinner > div { - animation: tam-bouncing-dots 1.5s ease-in-out 0s infinite both; - background-color: rgba(34, 47, 62, 0.7); - border-radius: 100%; - height: 8px; - width: 8px; + animation: tam-bouncing-dots 1.5s ease-in-out 0s infinite both; + background-color: rgba(34, 47, 62, 0.7); + border-radius: 100%; + height: 8px; + width: 8px; } - .tox .tox-spinner > div:nth-child(1) { - animation-delay: -0.32s; + animation-delay: -0.32s; } - .tox .tox-spinner > div:nth-child(2) { - animation-delay: -0.16s; + animation-delay: -0.16s; } - @keyframes tam-bouncing-dots { - 0%, - 80%, - 100% { - transform: scale(0); - } - 40% { - transform: scale(1); - } -} - + 0%, + 80%, + 100% { + transform: scale(0); + } + 40% { + transform: scale(1); + } +} .tox:not([dir=rtl]) .tox-spinner > div:not(:first-child) { - margin-left: 4px; + margin-left: 4px; } - .tox[dir=rtl] .tox-spinner > div:not(:first-child) { - margin-right: 4px; + margin-right: 4px; } - .tox .tox-statusbar { - align-items: center; - background-color: #fff; - border-top: 1px solid #cccccc; - color: rgba(34, 47, 62, 0.7); - display: flex; - flex: 0 0 auto; - font-size: 12px; - font-weight: normal; - height: 18px; - overflow: hidden; - padding: 0 8px; - position: relative; - text-transform: uppercase; -} - + align-items: center; + background-color: #fff; + border-top: 1px solid #cccccc; + color: rgba(34, 47, 62, 0.7); + display: flex; + flex: 0 0 auto; + font-size: 12px; + font-weight: normal; + height: 18px; + overflow: hidden; + padding: 0 8px; + position: relative; + text-transform: uppercase; +} .tox .tox-statusbar__text-container { - display: flex; - flex: 1 1 auto; - justify-content: flex-end; - overflow: hidden; + display: flex; + flex: 1 1 auto; + justify-content: flex-end; + overflow: hidden; } - .tox .tox-statusbar__path { - display: flex; - flex: 1 1 auto; - margin-right: auto; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - + display: flex; + flex: 1 1 auto; + margin-right: auto; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} .tox .tox-statusbar__path > * { - display: inline; - white-space: nowrap; + display: inline; + white-space: nowrap; } - .tox .tox-statusbar__wordcount { - flex: 0 0 auto; - margin-left: 1ch; + flex: 0 0 auto; + margin-left: 1ch; } - .tox .tox-statusbar a, .tox .tox-statusbar__path-item, .tox .tox-statusbar__wordcount { - color: rgba(34, 47, 62, 0.7); - text-decoration: none; + color: rgba(34, 47, 62, 0.7); + text-decoration: none; } - .tox .tox-statusbar a:hover:not(:disabled):not([aria-disabled=true]), .tox .tox-statusbar__path-item:hover:not(:disabled):not([aria-disabled=true]), .tox .tox-statusbar__wordcount:hover:not(:disabled):not([aria-disabled=true]), .tox .tox-statusbar a:focus:not(:disabled):not([aria-disabled=true]), .tox .tox-statusbar__path-item:focus:not(:disabled):not([aria-disabled=true]), .tox .tox-statusbar__wordcount:focus:not(:disabled):not([aria-disabled=true]) { - cursor: pointer; - text-decoration: underline; + cursor: pointer; + text-decoration: underline; } - .tox .tox-statusbar__resize-handle { - align-items: flex-end; - align-self: stretch; - cursor: nwse-resize; - display: flex; - flex: 0 0 auto; - justify-content: flex-end; - margin-left: auto; - margin-right: -8px; - padding-left: 1ch; -} - + align-items: flex-end; + align-self: stretch; + cursor: nwse-resize; + display: flex; + flex: 0 0 auto; + justify-content: flex-end; + margin-left: auto; + margin-right: -8px; + padding-left: 1ch; +} .tox .tox-statusbar__resize-handle svg { - display: block; - fill: rgba(34, 47, 62, 0.7); + display: block; + fill: rgba(34, 47, 62, 0.7); } - .tox:not([dir=rtl]) .tox-statusbar__path > * { - margin-right: 4px; + margin-right: 4px; } - .tox:not([dir=rtl]) .tox-statusbar__branding { - margin-left: 1ch; + margin-left: 1ch; } - .tox[dir=rtl] .tox-statusbar { - flex-direction: row-reverse; + flex-direction: row-reverse; } - .tox[dir=rtl] .tox-statusbar__path > * { - margin-left: 4px; + margin-left: 4px; } - .tox .tox-throbber { - z-index: 1400; + z-index: 1400; } - .tox .tox-throbber__busy-spinner { - align-items: center; - background-color: rgba(255, 255, 255, 0.6); - bottom: 0; - display: flex; - justify-content: center; - left: 0; - position: absolute; - right: 0; - top: 0; -} - + align-items: center; + background-color: rgba(255, 255, 255, 0.6); + bottom: 0; + display: flex; + justify-content: center; + left: 0; + position: absolute; + right: 0; + top: 0; +} .tox .tox-tbtn { - align-items: center; - background: transparent; - border: 0; - border-radius: 3px; - box-shadow: none; - color: #222f3e; - display: flex; - flex: 0 0 auto; - font-size: 14px; - font-style: normal; - font-weight: normal; - height: 34px; - justify-content: center; - margin: 2px 0 3px 0; - outline: none; - overflow: hidden; - padding: 0; - text-transform: none; - width: 34px; -} - + align-items: center; + background: transparent; + border: 0; + border-radius: 3px; + box-shadow: none; + color: #222f3e; + display: flex; + flex: 0 0 auto; + font-size: 14px; + font-style: normal; + font-weight: normal; + height: 34px; + justify-content: center; + margin: 2px 0 3px 0; + outline: none; + overflow: hidden; + padding: 0; + text-transform: none; + width: 34px; +} .tox .tox-tbtn svg { - display: block; - fill: #222f3e; + display: block; + fill: #222f3e; } - .tox .tox-tbtn.tox-tbtn-more { - padding-left: 5px; - padding-right: 5px; - width: inherit; + padding-left: 5px; + padding-right: 5px; + width: inherit; } - .tox .tox-tbtn:focus { - background: #dee0e2; - border: 0; - box-shadow: none; + background: #dee0e2; + border: 0; + box-shadow: none; } - .tox .tox-tbtn:hover { - background: #dee0e2; - border: 0; - box-shadow: none; - color: #222f3e; + background: #dee0e2; + border: 0; + box-shadow: none; + color: #222f3e; } - .tox .tox-tbtn:hover svg { - fill: #222f3e; + fill: #222f3e; } - .tox .tox-tbtn:active { - background: #c8cbcf; - border: 0; - box-shadow: none; - color: #222f3e; + background: #c8cbcf; + border: 0; + box-shadow: none; + color: #222f3e; } - .tox .tox-tbtn:active svg { - fill: #222f3e; + fill: #222f3e; } - .tox .tox-tbtn--disabled, .tox .tox-tbtn--disabled:hover, .tox .tox-tbtn:disabled, .tox .tox-tbtn:disabled:hover { - background: transparent; - border: 0; - box-shadow: none; - color: rgba(34, 47, 62, 0.5); - cursor: not-allowed; + background: transparent; + border: 0; + box-shadow: none; + color: rgba(34, 47, 62, 0.5); + cursor: not-allowed; } - .tox .tox-tbtn--disabled svg, .tox .tox-tbtn--disabled:hover svg, .tox .tox-tbtn:disabled svg, .tox .tox-tbtn:disabled:hover svg { - /* stylelint-disable-line no-descending-specificity */ - fill: rgba(34, 47, 62, 0.5); + /* stylelint-disable-line no-descending-specificity */ + fill: rgba(34, 47, 62, 0.5); } - .tox .tox-tbtn--enabled, .tox .tox-tbtn--enabled:hover { - background: #c8cbcf; - border: 0; - box-shadow: none; - color: #222f3e; + background: #c8cbcf; + border: 0; + box-shadow: none; + color: #222f3e; } - .tox .tox-tbtn--enabled > *, .tox .tox-tbtn--enabled:hover > * { - transform: none; + transform: none; } - .tox .tox-tbtn--enabled svg, .tox .tox-tbtn--enabled:hover svg { - /* stylelint-disable-line no-descending-specificity */ - fill: #222f3e; + /* stylelint-disable-line no-descending-specificity */ + fill: #222f3e; } - .tox .tox-tbtn:focus:not(.tox-tbtn--disabled) { - color: #222f3e; + color: #222f3e; } - .tox .tox-tbtn:focus:not(.tox-tbtn--disabled) svg { - fill: #222f3e; + fill: #222f3e; } - .tox .tox-tbtn:active > * { - transform: none; + transform: none; } - .tox .tox-tbtn--md { - height: 51px; - width: 51px; + height: 51px; + width: 51px; } - .tox .tox-tbtn--lg { - flex-direction: column; - height: 68px; - width: 68px; + flex-direction: column; + height: 68px; + width: 68px; } - .tox .tox-tbtn--return { - -ms-grid-row-align: stretch; - align-self: stretch; - height: unset; - width: 16px; + -ms-grid-row-align: stretch; + align-self: stretch; + height: unset; + width: 16px; } - .tox .tox-tbtn--labeled { - padding: 0 4px; - width: unset; + padding: 0 4px; + width: unset; } - .tox .tox-tbtn__vlabel { - display: block; - font-size: 10px; - font-weight: normal; - letter-spacing: -0.025em; - margin-bottom: 4px; - white-space: nowrap; -} - + display: block; + font-size: 10px; + font-weight: normal; + letter-spacing: -0.025em; + margin-bottom: 4px; + white-space: nowrap; +} .tox .tox-tbtn--select { - margin: 2px 0 3px 0; - padding: 0 4px; - width: auto; + margin: 2px 0 3px 0; + padding: 0 4px; + width: auto; } - .tox .tox-tbtn__select-label { - cursor: default; - font-weight: normal; - margin: 0 4px; + cursor: default; + font-weight: normal; + margin: 0 4px; } - .tox .tox-tbtn__select-chevron { - align-items: center; - display: flex; - justify-content: center; - width: 16px; + align-items: center; + display: flex; + justify-content: center; + width: 16px; } - .tox .tox-tbtn__select-chevron svg { - fill: rgba(34, 47, 62, 0.5); + fill: rgba(34, 47, 62, 0.5); } - .tox .tox-tbtn--bespoke .tox-tbtn__select-label { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - width: 7em; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 7em; } - .tox .tox-split-button { - border: 0; - border-radius: 3px; - box-sizing: border-box; - display: flex; - margin: 2px 0 3px 0; - overflow: hidden; -} - + border: 0; + border-radius: 3px; + box-sizing: border-box; + display: flex; + margin: 2px 0 3px 0; + overflow: hidden; +} .tox .tox-split-button:hover { - box-shadow: 0 0 0 1px #dee0e2 inset; + box-shadow: 0 0 0 1px #dee0e2 inset; } - .tox .tox-split-button:focus { - background: #dee0e2; - box-shadow: none; - color: #222f3e; + background: #dee0e2; + box-shadow: none; + color: #222f3e; } - .tox .tox-split-button > * { - border-radius: 0; + border-radius: 0; } - .tox .tox-split-button__chevron { - width: 16px; + width: 16px; } - .tox .tox-split-button__chevron svg { - fill: rgba(34, 47, 62, 0.5); + fill: rgba(34, 47, 62, 0.5); } - .tox .tox-split-button .tox-tbtn { - margin: 0; + margin: 0; } - .tox.tox-platform-touch .tox-split-button .tox-tbtn:first-child { - width: 30px; + width: 30px; } - .tox.tox-platform-touch .tox-split-button__chevron { - width: 20px; + width: 20px; } - .tox .tox-split-button.tox-tbtn--disabled:hover, .tox .tox-split-button.tox-tbtn--disabled:focus, .tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:hover, .tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:focus { - background: transparent; - box-shadow: none; - color: rgba(34, 47, 62, 0.5); + background: transparent; + box-shadow: none; + color: rgba(34, 47, 62, 0.5); } - .tox .tox-toolbar-overlord { - background-color: #fff; + background-color: #fff; } - .tox .tox-toolbar, .tox .tox-toolbar__primary, .tox .tox-toolbar__overflow { - background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23cccccc'/%3E%3C/svg%3E") left 0 top 0 #fff; - background-color: #fff; - display: flex; - flex: 0 0 auto; - flex-shrink: 0; - flex-wrap: wrap; - padding: 0 0; -} - + background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23cccccc'/%3E%3C/svg%3E") left 0 top 0 #fff; + background-color: #fff; + display: flex; + flex: 0 0 auto; + flex-shrink: 0; + flex-wrap: wrap; + padding: 0 0; +} .tox .tox-toolbar__overflow.tox-toolbar__overflow--closed { - height: 0; - opacity: 0; - padding-bottom: 0; - padding-top: 0; - visibility: hidden; + height: 0; + opacity: 0; + padding-bottom: 0; + padding-top: 0; + visibility: hidden; } - .tox .tox-toolbar__overflow--growing { - transition: height 0.3s ease, opacity 0.2s linear 0.1s; + transition: height 0.3s ease, opacity 0.2s linear 0.1s; } - .tox .tox-toolbar__overflow--shrinking { - transition: opacity 0.3s ease, height 0.2s linear 0.1s, visibility 0s linear 0.3s; + transition: opacity 0.3s ease, height 0.2s linear 0.1s, visibility 0s linear 0.3s; } - .tox .tox-menubar + .tox-toolbar, .tox .tox-menubar + .tox-toolbar-overlord .tox-toolbar__primary { - border-top: 1px solid #cccccc; - margin-top: -1px; + border-top: 1px solid #cccccc; + margin-top: -1px; } - .tox .tox-toolbar--scrolling { - flex-wrap: nowrap; - overflow-x: auto; + flex-wrap: nowrap; + overflow-x: auto; } - .tox .tox-pop .tox-toolbar { - border-width: 0; + border-width: 0; } - .tox .tox-toolbar--no-divider { - background-image: none; + background-image: none; } - .tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar:first-child, .tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar-overlord:first-child .tox-toolbar__primary { - border-top: 1px solid #cccccc; + border-top: 1px solid #cccccc; } - .tox.tox-tinymce-aux .tox-toolbar__overflow { - background-color: #fff; - border: 1px solid #cccccc; - border-radius: 3px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); + background-color: #fff; + border: 1px solid #cccccc; + border-radius: 3px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); } - .tox[dir=rtl] .tox-tbtn__icon-rtl svg { - transform: rotateY(180deg); + transform: rotateY(180deg); } - .tox .tox-toolbar__group { - align-items: center; - display: flex; - flex-wrap: wrap; - margin: 0 0; - padding: 0 4px 0 4px; + align-items: center; + display: flex; + flex-wrap: wrap; + margin: 0 0; + padding: 0 4px 0 4px; } - .tox .tox-toolbar__group--pull-right { - margin-left: auto; + margin-left: auto; } - .tox .tox-toolbar--scrolling .tox-toolbar__group { - flex-shrink: 0; - flex-wrap: nowrap; + flex-shrink: 0; + flex-wrap: nowrap; } - .tox:not([dir=rtl]) .tox-toolbar__group:not(:last-of-type) { - border-right: 1px solid #cccccc; + border-right: 1px solid #cccccc; } - .tox[dir=rtl] .tox-toolbar__group:not(:last-of-type) { - border-left: 1px solid #cccccc; + border-left: 1px solid #cccccc; } - .tox .tox-tooltip { - display: inline-block; - padding: 8px; - position: relative; + display: inline-block; + padding: 8px; + position: relative; } - .tox .tox-tooltip__body { - background-color: #222f3e; - border-radius: 3px; - box-shadow: 0 2px 4px rgba(34, 47, 62, 0.3); - color: rgba(255, 255, 255, 0.75); - font-size: 14px; - font-style: normal; - font-weight: normal; - padding: 4px 8px; - text-transform: none; -} - + background-color: #222f3e; + border-radius: 3px; + box-shadow: 0 2px 4px rgba(34, 47, 62, 0.3); + color: rgba(255, 255, 255, 0.75); + font-size: 14px; + font-style: normal; + font-weight: normal; + padding: 4px 8px; + text-transform: none; +} .tox .tox-tooltip__arrow { - position: absolute; + position: absolute; } - .tox .tox-tooltip--down .tox-tooltip__arrow { - border-left: 8px solid transparent; - border-right: 8px solid transparent; - border-top: 8px solid #222f3e; - bottom: 0; - left: 50%; - position: absolute; - transform: translateX(-50%); -} - + border-left: 8px solid transparent; + border-right: 8px solid transparent; + border-top: 8px solid #222f3e; + bottom: 0; + left: 50%; + position: absolute; + transform: translateX(-50%); +} .tox .tox-tooltip--up .tox-tooltip__arrow { - border-bottom: 8px solid #222f3e; - border-left: 8px solid transparent; - border-right: 8px solid transparent; - left: 50%; - position: absolute; - top: 0; - transform: translateX(-50%); -} - + border-bottom: 8px solid #222f3e; + border-left: 8px solid transparent; + border-right: 8px solid transparent; + left: 50%; + position: absolute; + top: 0; + transform: translateX(-50%); +} .tox .tox-tooltip--right .tox-tooltip__arrow { - border-bottom: 8px solid transparent; - border-left: 8px solid #222f3e; - border-top: 8px solid transparent; - position: absolute; - right: 0; - top: 50%; - transform: translateY(-50%); -} - + border-bottom: 8px solid transparent; + border-left: 8px solid #222f3e; + border-top: 8px solid transparent; + position: absolute; + right: 0; + top: 50%; + transform: translateY(-50%); +} .tox .tox-tooltip--left .tox-tooltip__arrow { - border-bottom: 8px solid transparent; - border-right: 8px solid #222f3e; - border-top: 8px solid transparent; - left: 0; - position: absolute; - top: 50%; - transform: translateY(-50%); -} - + border-bottom: 8px solid transparent; + border-right: 8px solid #222f3e; + border-top: 8px solid transparent; + left: 0; + position: absolute; + top: 50%; + transform: translateY(-50%); +} .tox .tox-well { - border: 1px solid #cccccc; - border-radius: 3px; - padding: 8px; - width: 100%; + border: 1px solid #cccccc; + border-radius: 3px; + padding: 8px; + width: 100%; } - .tox .tox-well > *:first-child { - margin-top: 0; + margin-top: 0; } - .tox .tox-well > *:last-child { - margin-bottom: 0; + margin-bottom: 0; } - .tox .tox-well > *:only-child { - margin: 0; + margin: 0; } - .tox .tox-custom-editor { - border: 1px solid #cccccc; - border-radius: 3px; - display: flex; - flex: 1; - position: relative; + border: 1px solid #cccccc; + border-radius: 3px; + display: flex; + flex: 1; + position: relative; } - /* stylelint-disable */ .tox { - /* stylelint-enable */ + /* stylelint-enable */ } - .tox .tox-dialog-loading::before { - background-color: rgba(0, 0, 0, 0.5); - content: ""; - height: 100%; - position: absolute; - width: 100%; - z-index: 1000; -} - + background-color: rgba(0, 0, 0, 0.5); + content: ""; + height: 100%; + position: absolute; + width: 100%; + z-index: 1000; +} .tox .tox-tab { - cursor: pointer; + cursor: pointer; } - .tox .tox-dialog__content-js { - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; } - .tox .tox-dialog__body-content .tox-collection { - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; + display: flex; + flex: 1; + -ms-flex-preferred-size: auto; } - .tox .tox-image-tools-edit-panel { - height: 60px; + height: 60px; } - .tox .tox-image-tools__sidebar { - height: 60px; + height: 60px; } diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/skin.mobile.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/skin.mobile.css index d6652d64..875721a2 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/skin.mobile.css +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/skin.mobile.css @@ -6,793 +6,668 @@ */ /* RESET all the things! */ .tinymce-mobile-outer-container { - all: initial; - display: block; + all: initial; + display: block; } - .tinymce-mobile-outer-container * { - border: 0; - box-sizing: initial; - cursor: inherit; - float: none; - line-height: 1; - margin: 0; - outline: 0; - padding: 0; - -webkit-tap-highlight-color: transparent; - /* TBIO-3691, stop the gray flicker on touch. */ - text-shadow: none; - white-space: nowrap; -} - + border: 0; + box-sizing: initial; + cursor: inherit; + float: none; + line-height: 1; + margin: 0; + outline: 0; + padding: 0; + -webkit-tap-highlight-color: transparent; + /* TBIO-3691, stop the gray flicker on touch. */ + text-shadow: none; + white-space: nowrap; +} .tinymce-mobile-icon-arrow-back::before { - content: "\e5cd"; + content: "\e5cd"; } - .tinymce-mobile-icon-image::before { - content: "\e412"; + content: "\e412"; } - .tinymce-mobile-icon-cancel-circle::before { - content: "\e5c9"; + content: "\e5c9"; } - .tinymce-mobile-icon-full-dot::before { - content: "\e061"; + content: "\e061"; } - .tinymce-mobile-icon-align-center::before { - content: "\e234"; + content: "\e234"; } - .tinymce-mobile-icon-align-left::before { - content: "\e236"; + content: "\e236"; } - .tinymce-mobile-icon-align-right::before { - content: "\e237"; + content: "\e237"; } - .tinymce-mobile-icon-bold::before { - content: "\e238"; + content: "\e238"; } - .tinymce-mobile-icon-italic::before { - content: "\e23f"; + content: "\e23f"; } - .tinymce-mobile-icon-unordered-list::before { - content: "\e241"; + content: "\e241"; } - .tinymce-mobile-icon-ordered-list::before { - content: "\e242"; + content: "\e242"; } - .tinymce-mobile-icon-font-size::before { - content: "\e245"; + content: "\e245"; } - .tinymce-mobile-icon-underline::before { - content: "\e249"; + content: "\e249"; } - .tinymce-mobile-icon-link::before { - content: "\e157"; + content: "\e157"; } - .tinymce-mobile-icon-unlink::before { - content: "\eca2"; + content: "\eca2"; } - .tinymce-mobile-icon-color::before { - content: "\e891"; + content: "\e891"; } - .tinymce-mobile-icon-previous::before { - content: "\e314"; + content: "\e314"; } - .tinymce-mobile-icon-next::before { - content: "\e315"; + content: "\e315"; } - .tinymce-mobile-icon-large-font::before, .tinymce-mobile-icon-style-formats::before { - content: "\e264"; + content: "\e264"; } - .tinymce-mobile-icon-undo::before { - content: "\e166"; + content: "\e166"; } - .tinymce-mobile-icon-redo::before { - content: "\e15a"; + content: "\e15a"; } - .tinymce-mobile-icon-removeformat::before { - content: "\e239"; + content: "\e239"; } - .tinymce-mobile-icon-small-font::before { - content: "\e906"; + content: "\e906"; } - .tinymce-mobile-icon-readonly-back::before, .tinymce-mobile-format-matches::after { - content: "\e5ca"; + content: "\e5ca"; } - .tinymce-mobile-icon-small-heading::before { - content: "small"; + content: "small"; } - .tinymce-mobile-icon-large-heading::before { - content: "large"; + content: "large"; } - .tinymce-mobile-icon-small-heading::before, .tinymce-mobile-icon-large-heading::before { - font-family: sans-serif; - font-size: 80%; + font-family: sans-serif; + font-size: 80%; } - .tinymce-mobile-mask-edit-icon::before { - content: "\e254"; + content: "\e254"; } - .tinymce-mobile-icon-back::before { - content: "\e5c4"; + content: "\e5c4"; } - .tinymce-mobile-icon-heading::before { - /* TODO: Translate */ - content: "Headings"; - font-family: sans-serif; - font-size: 80%; - font-weight: bold; + /* TODO: Translate */ + content: "Headings"; + font-family: sans-serif; + font-size: 80%; + font-weight: bold; } - .tinymce-mobile-icon-h1::before { - content: "H1"; - font-weight: bold; + content: "H1"; + font-weight: bold; } - .tinymce-mobile-icon-h2::before { - content: "H2"; - font-weight: bold; + content: "H2"; + font-weight: bold; } - .tinymce-mobile-icon-h3::before { - content: "H3"; - font-weight: bold; + content: "H3"; + font-weight: bold; } - .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask { - align-items: center; - display: flex; - justify-content: center; - background: rgba(51, 51, 51, 0.5); - height: 100%; - position: absolute; - top: 0; - width: 100%; -} - + align-items: center; + display: flex; + justify-content: center; + background: rgba(51, 51, 51, 0.5); + height: 100%; + position: absolute; + top: 0; + width: 100%; +} .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container { - align-items: center; - border-radius: 50%; - display: flex; - flex-direction: column; - font-family: sans-serif; - font-size: 1em; - justify-content: space-between; -} - + align-items: center; + border-radius: 50%; + display: flex; + flex-direction: column; + font-family: sans-serif; + font-size: 1em; + justify-content: space-between; +} .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .mixin-menu-item { - align-items: center; - display: flex; - justify-content: center; - border-radius: 50%; - height: 2.1em; - width: 2.1em; -} - + align-items: center; + display: flex; + justify-content: center; + border-radius: 50%; + height: 2.1em; + width: 2.1em; +} .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section { - align-items: center; - display: flex; - justify-content: center; - flex-direction: column; - font-size: 1em; -} - -@media only screen and (min-device-width: 700px) { - .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section { - font-size: 1.2em; - } -} - + align-items: center; + display: flex; + justify-content: center; + flex-direction: column; + font-size: 1em; +} +@media only screen and (min-device-width:700px) { + .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section { + font-size: 1.2em; + } +} .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon { - align-items: center; - display: flex; - justify-content: center; - border-radius: 50%; - height: 2.1em; - width: 2.1em; - background-color: white; - color: #207ab7; -} - + align-items: center; + display: flex; + justify-content: center; + border-radius: 50%; + height: 2.1em; + width: 2.1em; + background-color: white; + color: #207ab7; +} .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon::before { - content: "\e900"; - font-family: 'tinymce-mobile', sans-serif; + content: "\e900"; + font-family: 'tinymce-mobile', sans-serif; } - .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section:not(.tinymce-mobile-mask-tap-icon-selected) .tinymce-mobile-mask-tap-icon { - z-index: 2; + z-index: 2; } - .tinymce-mobile-android-container.tinymce-mobile-android-maximized { - background: #ffffff; - border: none; - bottom: 0; - display: flex; - flex-direction: column; - left: 0; - position: fixed; - right: 0; - top: 0; -} - + background: #ffffff; + border: none; + bottom: 0; + display: flex; + flex-direction: column; + left: 0; + position: fixed; + right: 0; + top: 0; +} .tinymce-mobile-android-container:not(.tinymce-mobile-android-maximized) { - position: relative; + position: relative; } - .tinymce-mobile-android-container .tinymce-mobile-editor-socket { - display: flex; - flex-grow: 1; + display: flex; + flex-grow: 1; } - .tinymce-mobile-android-container .tinymce-mobile-editor-socket iframe { - display: flex !important; - flex-grow: 1; - height: auto !important; + display: flex !important; + flex-grow: 1; + height: auto !important; } - .tinymce-mobile-android-scroll-reload { - overflow: hidden; + overflow: hidden; } - :not(.tinymce-mobile-readonly-mode) > .tinymce-mobile-android-selection-context-toolbar { - margin-top: 23px; + margin-top: 23px; } - .tinymce-mobile-toolstrip { - background: #fff; - display: flex; - flex: 0 0 auto; - z-index: 1; + background: #fff; + display: flex; + flex: 0 0 auto; + z-index: 1; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar { - align-items: center; - background-color: #fff; - border-bottom: 1px solid #cccccc; - display: flex; - flex: 1; - height: 2.5em; - width: 100%; - /* Make it no larger than the toolstrip, so that it needs to scroll */ -} - + align-items: center; + background-color: #fff; + border-bottom: 1px solid #cccccc; + display: flex; + flex: 1; + height: 2.5em; + width: 100%; + /* Make it no larger than the toolstrip, so that it needs to scroll */ +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group { - align-items: center; - display: flex; - height: 100%; - flex-shrink: 1; + align-items: center; + display: flex; + height: 100%; + flex-shrink: 1; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group > div { - align-items: center; - display: flex; - height: 100%; - flex: 1; + align-items: center; + display: flex; + height: 100%; + flex: 1; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-exit-container { - background: #f44336; + background: #f44336; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-toolbar-scrollable-group { - flex-grow: 1; + flex-grow: 1; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item { - padding-left: 0.5em; - padding-right: 0.5em; + padding-left: 0.5em; + padding-right: 0.5em; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button { - align-items: center; - display: flex; - height: 80%; - margin-left: 2px; - margin-right: 2px; + align-items: center; + display: flex; + height: 80%; + margin-left: 2px; + margin-right: 2px; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button.tinymce-mobile-toolbar-button-selected { - background: #c8cbcf; - color: #cccccc; + background: #c8cbcf; + color: #cccccc; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:first-of-type, .tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:last-of-type { - background: #207ab7; - color: #eceff1; + background: #207ab7; + color: #eceff1; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar { - /* Note, this file is imported inside .tinymce-mobile-context-toolbar, so that prefix is on everything here. */ + /* Note, this file is imported inside .tinymce-mobile-context-toolbar, so that prefix is on everything here. */ } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group { - align-items: center; - display: flex; - height: 100%; - flex: 1; - padding-bottom: 0.4em; - padding-top: 0.4em; - /* Make any buttons appearing on the left and right display in the centre (e.g. color edges) */ - /* For widgets like the colour picker, use the whole height */ -} - + align-items: center; + display: flex; + height: 100%; + flex: 1; + padding-bottom: 0.4em; + padding-top: 0.4em; + /* Make any buttons appearing on the left and right display in the centre (e.g. color edges) */ + /* For widgets like the colour picker, use the whole height */ +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog { - display: flex; - min-height: 1.5em; - overflow: hidden; - padding-left: 0; - padding-right: 0; - position: relative; - width: 100%; -} - + display: flex; + min-height: 1.5em; + overflow: hidden; + padding-left: 0; + padding-right: 0; + position: relative; + width: 100%; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain { - display: flex; - height: 100%; - transition: left cubic-bezier(0.4, 0, 1, 1) 0.15s; - width: 100%; + display: flex; + height: 100%; + transition: left cubic-bezier(0.4, 0, 1, 1) 0.15s; + width: 100%; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen { - display: flex; - flex: 0 0 auto; - justify-content: space-between; - width: 100%; + display: flex; + flex: 0 0 auto; + justify-content: space-between; + width: 100%; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen input { - font-family: Sans-serif; + font-family: Sans-serif; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container { - display: flex; - flex-grow: 1; - position: relative; + display: flex; + flex-grow: 1; + position: relative; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container .tinymce-mobile-input-container-x { - -ms-grid-row-align: center; - align-self: center; - background: inherit; - border: none; - border-radius: 50%; - color: #888; - font-size: 0.6em; - font-weight: bold; - height: 100%; - padding-right: 2px; - position: absolute; - right: 0; -} - + -ms-grid-row-align: center; + align-self: center; + background: inherit; + border: none; + border-radius: 50%; + color: #888; + font-size: 0.6em; + font-weight: bold; + height: 100%; + padding-right: 2px; + position: absolute; + right: 0; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container.tinymce-mobile-input-container-empty .tinymce-mobile-input-container-x { - display: none; + display: none; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous, .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next { - align-items: center; - display: flex; + align-items: center; + display: flex; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous::before, .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next::before { - align-items: center; - display: flex; - font-weight: bold; - height: 100%; - padding-left: 0.5em; - padding-right: 0.5em; -} - + align-items: center; + display: flex; + font-weight: bold; + height: 100%; + padding-left: 0.5em; + padding-right: 0.5em; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous.tinymce-mobile-toolbar-navigation-disabled::before, .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next.tinymce-mobile-toolbar-navigation-disabled::before { - visibility: hidden; + visibility: hidden; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item { - color: #cccccc; - font-size: 10px; - line-height: 10px; - margin: 0 2px; - padding-top: 3px; + color: #cccccc; + font-size: 10px; + line-height: 10px; + margin: 0 2px; + padding-top: 3px; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item.tinymce-mobile-dot-active { - color: #c8cbcf; + color: #c8cbcf; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-font::before, .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-heading::before { - margin-left: 0.5em; - margin-right: 0.9em; + margin-left: 0.5em; + margin-right: 0.9em; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-font::before, .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-heading::before { - margin-left: 0.9em; - margin-right: 0.5em; + margin-left: 0.9em; + margin-right: 0.5em; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider { - display: flex; - flex: 1; - margin-left: 0; - margin-right: 0; - padding: 0.28em 0; - position: relative; -} - + display: flex; + flex: 1; + margin-left: 0; + margin-right: 0; + padding: 0.28em 0; + position: relative; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container { - align-items: center; - display: flex; - flex-grow: 1; - height: 100%; + align-items: center; + display: flex; + flex-grow: 1; + height: 100%; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container .tinymce-mobile-slider-size-line { - background: #cccccc; - display: flex; - flex: 1; - height: 0.2em; - margin-bottom: 0.3em; - margin-top: 0.3em; -} - + background: #cccccc; + display: flex; + flex: 1; + height: 0.2em; + margin-bottom: 0.3em; + margin-top: 0.3em; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container { - padding-left: 2em; - padding-right: 2em; + padding-left: 2em; + padding-right: 2em; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container { - align-items: center; - display: flex; - flex-grow: 1; - height: 100%; + align-items: center; + display: flex; + flex-grow: 1; + height: 100%; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container .tinymce-mobile-slider-gradient { - background: linear-gradient(to right, hsl(0, 100%, 50%) 0%, hsl(60, 100%, 50%) 17%, hsl(120, 100%, 50%) 33%, hsl(180, 100%, 50%) 50%, hsl(240, 100%, 50%) 67%, hsl(300, 100%, 50%) 83%, hsl(0, 100%, 50%) 100%); - display: flex; - flex: 1; - height: 0.2em; - margin-bottom: 0.3em; - margin-top: 0.3em; -} - + background: linear-gradient(to right, hsl(0, 100%, 50%) 0%, hsl(60, 100%, 50%) 17%, hsl(120, 100%, 50%) 33%, hsl(180, 100%, 50%) 50%, hsl(240, 100%, 50%) 67%, hsl(300, 100%, 50%) 83%, hsl(0, 100%, 50%) 100%); + display: flex; + flex: 1; + height: 0.2em; + margin-bottom: 0.3em; + margin-top: 0.3em; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-black { - /* Not part of theming */ - background: black; - height: 0.2em; - margin-bottom: 0.3em; - margin-top: 0.3em; - width: 1.2em; -} - + /* Not part of theming */ + background: black; + height: 0.2em; + margin-bottom: 0.3em; + margin-top: 0.3em; + width: 1.2em; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-white { - /* Not part of theming */ - background: white; - height: 0.2em; - margin-bottom: 0.3em; - margin-top: 0.3em; - width: 1.2em; -} - + /* Not part of theming */ + background: white; + height: 0.2em; + margin-bottom: 0.3em; + margin-top: 0.3em; + width: 1.2em; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb { - /* vertically centering trick (margin: auto, top: 0, bottom: 0). On iOS and Safari, if you leave - * out these values, then it shows the thumb at the top of the spectrum. This is probably because it is - * absolutely positioned with only a left value, and not a top. Note, on Chrome it seems to be fine without - * this approach. - */ - align-items: center; - background-clip: padding-box; - background-color: #455a64; - border: 0.5em solid rgba(136, 136, 136, 0); - border-radius: 3em; - bottom: 0; - color: #fff; - display: flex; - height: 0.5em; - justify-content: center; - left: -10px; - margin: auto; - position: absolute; - top: 0; - transition: border 120ms cubic-bezier(0.39, 0.58, 0.57, 1); - width: 0.5em; -} - + /* vertically centering trick (margin: auto, top: 0, bottom: 0). On iOS and Safari, if you leave + * out these values, then it shows the thumb at the top of the spectrum. This is probably because it is + * absolutely positioned with only a left value, and not a top. Note, on Chrome it seems to be fine without + * this approach. + */ + align-items: center; + background-clip: padding-box; + background-color: #455a64; + border: 0.5em solid rgba(136, 136, 136, 0); + border-radius: 3em; + bottom: 0; + color: #fff; + display: flex; + height: 0.5em; + justify-content: center; + left: -10px; + margin: auto; + position: absolute; + top: 0; + transition: border 120ms cubic-bezier(0.39, 0.58, 0.57, 1); + width: 0.5em; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb.tinymce-mobile-thumb-active { - border: 0.5em solid rgba(136, 136, 136, 0.39); + border: 0.5em solid rgba(136, 136, 136, 0.39); } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper, .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group > div { - align-items: center; - display: flex; - height: 100%; - flex: 1; + align-items: center; + display: flex; + height: 100%; + flex: 1; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper { - flex-direction: column; - justify-content: center; + flex-direction: column; + justify-content: center; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item { - align-items: center; - display: flex; + align-items: center; + display: flex; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item:not(.tinymce-mobile-serialised-dialog) { - height: 100%; + height: 100%; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-container { - display: flex; + display: flex; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input { - background: #ffffff; - border: none; - border-radius: 0; - color: #455a64; - flex-grow: 1; - font-size: 0.85em; - padding-bottom: 0.1em; - padding-left: 5px; - padding-top: 0.1em; -} - + background: #ffffff; + border: none; + border-radius: 0; + color: #455a64; + flex-grow: 1; + font-size: 0.85em; + padding-bottom: 0.1em; + padding-left: 5px; + padding-top: 0.1em; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::-webkit-input-placeholder { - /* WebKit, Blink, Edge */ - color: #888; + /* WebKit, Blink, Edge */ + color: #888; } - .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::placeholder { - /* WebKit, Blink, Edge */ - color: #888; + /* WebKit, Blink, Edge */ + color: #888; } - /* dropup */ .tinymce-mobile-dropup { - background: white; - display: flex; - overflow: hidden; - width: 100%; + background: white; + display: flex; + overflow: hidden; + width: 100%; } - .tinymce-mobile-dropup.tinymce-mobile-dropup-shrinking { - transition: height 0.3s ease-out; + transition: height 0.3s ease-out; } - .tinymce-mobile-dropup.tinymce-mobile-dropup-growing { - transition: height 0.3s ease-in; + transition: height 0.3s ease-in; } - .tinymce-mobile-dropup.tinymce-mobile-dropup-closed { - flex-grow: 0; + flex-grow: 0; } - .tinymce-mobile-dropup.tinymce-mobile-dropup-open:not(.tinymce-mobile-dropup-growing) { - flex-grow: 1; + flex-grow: 1; } - /* TODO min-height for device size and orientation */ .tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) { - min-height: 200px; + min-height: 200px; } - @media only screen and (orientation: landscape) { - .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) { - min-height: 200px; - } + .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) { + min-height: 200px; + } } - -@media only screen and (min-device-width: 320px) and (max-device-width: 568px) and (orientation: landscape) { - .tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) { - min-height: 150px; - } +@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape) { + .tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) { + min-height: 150px; + } } - /* styles menu */ .tinymce-mobile-styles-menu { - font-family: sans-serif; - outline: 4px solid black; - overflow: hidden; - position: relative; - width: 100%; + font-family: sans-serif; + outline: 4px solid black; + overflow: hidden; + position: relative; + width: 100%; } - .tinymce-mobile-styles-menu [role="menu"] { - display: flex; - flex-direction: column; - height: 100%; - position: absolute; - width: 100%; + display: flex; + flex-direction: column; + height: 100%; + position: absolute; + width: 100%; } - .tinymce-mobile-styles-menu [role="menu"].transitioning { - transition: transform 0.5s ease-in-out; + transition: transform 0.5s ease-in-out; } - .tinymce-mobile-styles-menu .tinymce-mobile-styles-item { - border-bottom: 1px solid #ddd; - color: #455a64; - cursor: pointer; - display: flex; - padding: 1em 1em; - position: relative; -} - + border-bottom: 1px solid #ddd; + color: #455a64; + cursor: pointer; + display: flex; + padding: 1em 1em; + position: relative; +} .tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser .tinymce-mobile-styles-collapse-icon::before { - color: #455a64; - content: "\e314"; - font-family: 'tinymce-mobile', sans-serif; + color: #455a64; + content: "\e314"; + font-family: 'tinymce-mobile', sans-serif; } - .tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-styles-item-is-menu::after { - color: #455a64; - content: "\e315"; - font-family: 'tinymce-mobile', sans-serif; - padding-left: 1em; - padding-right: 1em; - position: absolute; - right: 0; -} - + color: #455a64; + content: "\e315"; + font-family: 'tinymce-mobile', sans-serif; + padding-left: 1em; + padding-right: 1em; + position: absolute; + right: 0; +} .tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-format-matches::after { - font-family: 'tinymce-mobile', sans-serif; - padding-left: 1em; - padding-right: 1em; - position: absolute; - right: 0; + font-family: 'tinymce-mobile', sans-serif; + padding-left: 1em; + padding-right: 1em; + position: absolute; + right: 0; } - .tinymce-mobile-styles-menu .tinymce-mobile-styles-separator, .tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser { - align-items: center; - background: #fff; - border-top: #455a64; - color: #455a64; - display: flex; - min-height: 2.5em; - padding-left: 1em; - padding-right: 1em; -} - + align-items: center; + background: #fff; + border-top: #455a64; + color: #455a64; + display: flex; + min-height: 2.5em; + padding-left: 1em; + padding-right: 1em; +} .tinymce-mobile-styles-menu [data-transitioning-destination="before"][data-transitioning-state], .tinymce-mobile-styles-menu [data-transitioning-state="before"] { - transform: translate(-100%); + transform: translate(-100%); } - .tinymce-mobile-styles-menu [data-transitioning-destination="current"][data-transitioning-state], .tinymce-mobile-styles-menu [data-transitioning-state="current"] { - transform: translate(0%); + transform: translate(0%); } - .tinymce-mobile-styles-menu [data-transitioning-destination="after"][data-transitioning-state], .tinymce-mobile-styles-menu [data-transitioning-state="after"] { - transform: translate(100%); + transform: translate(100%); } - @font-face { - font-family: 'tinymce-mobile'; - font-style: normal; - font-weight: normal; - src: url('fonts/tinymce-mobile.woff?8x92w3') format('woff'); + font-family: 'tinymce-mobile'; + font-style: normal; + font-weight: normal; + src: url('fonts/tinymce-mobile.woff?8x92w3') format('woff'); } - @media (min-device-width: 700px) { - .tinymce-mobile-outer-container, - .tinymce-mobile-outer-container input { - font-size: 25px; - } + .tinymce-mobile-outer-container, + .tinymce-mobile-outer-container input { + font-size: 25px; + } } - @media (max-device-width: 700px) { - .tinymce-mobile-outer-container, - .tinymce-mobile-outer-container input { - font-size: 18px; - } + .tinymce-mobile-outer-container, + .tinymce-mobile-outer-container input { + font-size: 18px; + } } - .tinymce-mobile-icon { - font-family: 'tinymce-mobile', sans-serif; + font-family: 'tinymce-mobile', sans-serif; } - .mixin-flex-and-centre { - align-items: center; - display: flex; - justify-content: center; + align-items: center; + display: flex; + justify-content: center; } - .mixin-flex-bar { - align-items: center; - display: flex; - height: 100%; + align-items: center; + display: flex; + height: 100%; } - .tinymce-mobile-outer-container .tinymce-mobile-editor-socket iframe { - background-color: #fff; - width: 100%; + background-color: #fff; + width: 100%; } - .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon { - /* Note, on the iPod touch in landscape, this isn't visible when the navbar appears */ - background-color: #207ab7; - border-radius: 50%; - bottom: 1em; - color: white; - font-size: 1em; - height: 2.1em; - position: fixed; - right: 2em; - width: 2.1em; - align-items: center; - display: flex; - justify-content: center; -} - -@media only screen and (min-device-width: 700px) { - .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon { - font-size: 1.2em; - } -} - + /* Note, on the iPod touch in landscape, this isn't visible when the navbar appears */ + background-color: #207ab7; + border-radius: 50%; + bottom: 1em; + color: white; + font-size: 1em; + height: 2.1em; + position: fixed; + right: 2em; + width: 2.1em; + align-items: center; + display: flex; + justify-content: center; +} +@media only screen and (min-device-width:700px) { + .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon { + font-size: 1.2em; + } +} .tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket { - height: 300px; - overflow: hidden; + height: 300px; + overflow: hidden; } - .tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket iframe { - height: 100%; + height: 100%; } - .tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-toolstrip { - display: none; + display: none; } - /* Note, that if you don't include this (::-webkit-file-upload-button), the toolbar width gets increased and the whole body becomes scrollable. It's important! */ input[type="file"]::-webkit-file-upload-button { - display: none; + display: none; } - -@media only screen and (min-device-width: 320px) and (max-device-width: 568px) and (orientation: landscape) { - .tinymce-mobile-ios-container .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon { - bottom: 50%; - } +@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape) { + .tinymce-mobile-ios-container .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon { + bottom: 50%; + } } diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/skin.shadowdom.css b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/skin.shadowdom.css index d6b491a7..a9d2cbe4 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/skin.shadowdom.css +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/skins/ui/oxide/skin.shadowdom.css @@ -5,37 +5,32 @@ * For commercial licenses see https://www.tiny.cloud/ */ body.tox-dialog__disable-scroll { - overflow: hidden; + overflow: hidden; } - .tox-fullscreen { - border: 0; - height: 100%; - left: 0; - margin: 0; - overflow: hidden; - -ms-scroll-chaining: none; - overscroll-behavior: none; - padding: 0; - position: fixed; - top: 0; - touch-action: pinch-zoom; - width: 100%; + border: 0; + height: 100%; + left: 0; + margin: 0; + overflow: hidden; + -ms-scroll-chaining: none; + overscroll-behavior: none; + padding: 0; + position: fixed; + top: 0; + touch-action: pinch-zoom; + width: 100%; } - .tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle { - display: none; + display: none; } - .tox.tox-tinymce.tox-fullscreen { - z-index: 1200; + z-index: 1200; } - .tox-shadowhost.tox-fullscreen { - z-index: 1200; + z-index: 1200; } - .tox-fullscreen .tox.tox-tinymce-aux, .tox-fullscreen ~ .tox.tox-tinymce-aux { - z-index: 1201; + z-index: 1201; } diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/themes/mobile/theme.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/themes/mobile/theme.js index 3c828c4e..1f1ec559 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/themes/mobile/theme.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/themes/mobile/theme.js @@ -10,271 +10,267 @@ 'use strict'; var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); }; - function __rest(s, e) { - var t = {}; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === 'function') - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; + var t = {}; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === 'function') + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; } - function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) - s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; + for (var s = 0, i = 0, il = arguments.length; i < il; i++) + s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; } var noop = function () { }; var compose = function (fa, fb) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return fa(fb.apply(null, args)); - }; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return fa(fb.apply(null, args)); + }; }; var compose1 = function (fbc, fab) { - return function (a) { - return fbc(fab(a)); - }; + return function (a) { + return fbc(fab(a)); + }; }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; var identity = function (x) { - return x; + return x; }; - function curry(fn) { - var initialArgs = []; - for (var _i = 1; _i < arguments.length; _i++) { - initialArgs[_i - 1] = arguments[_i]; + var initialArgs = []; + for (var _i = 1; _i < arguments.length; _i++) { + initialArgs[_i - 1] = arguments[_i]; + } + return function () { + var restArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + restArgs[_i] = arguments[_i]; } - return function () { - var restArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - restArgs[_i] = arguments[_i]; - } - var all = initialArgs.concat(restArgs); - return fn.apply(null, all); - }; + var all = initialArgs.concat(restArgs); + return fn.apply(null, all); + }; } - var not = function (f) { - return function (t) { - return !f(t); - }; + return function (t) { + return !f(t); + }; }; var die = function (msg) { - return function () { - throw new Error(msg); - }; + return function () { + throw new Error(msg); + }; }; var apply = function (f) { - return f(); + return f(); }; var never = constant(false); var always = constant(true); var cached = function (f) { - var called = false; - var r; - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (!called) { - called = true; - r = f.apply(null, args); - } - return r; - }; + var called = false; + var r; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!called) { + called = true; + r = f.apply(null, args); + } + return r; + }; }; var DeviceType = function (os, browser, userAgent, mediaMatch) { - var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true; - var isiPhone = os.isiOS() && !isiPad; - var isMobile = os.isiOS() || os.isAndroid(); - var isTouch = isMobile || mediaMatch('(pointer:coarse)'); - var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)'); - var isPhone = isiPhone || isMobile && !isTablet; - var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false; - var isDesktop = !isPhone && !isTablet && !iOSwebview; - return { - isiPad: constant(isiPad), - isiPhone: constant(isiPhone), - isTablet: constant(isTablet), - isPhone: constant(isPhone), - isTouch: constant(isTouch), - isAndroid: os.isAndroid, - isiOS: os.isiOS, - isWebView: constant(iOSwebview), - isDesktop: constant(isDesktop) - }; + var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true; + var isiPhone = os.isiOS() && !isiPad; + var isMobile = os.isiOS() || os.isAndroid(); + var isTouch = isMobile || mediaMatch('(pointer:coarse)'); + var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)'); + var isPhone = isiPhone || isMobile && !isTablet; + var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false; + var isDesktop = !isPhone && !isTablet && !iOSwebview; + return { + isiPad: constant(isiPad), + isiPhone: constant(isiPhone), + isTablet: constant(isTablet), + isPhone: constant(isPhone), + isTouch: constant(isTouch), + isAndroid: os.isAndroid, + isiOS: os.isiOS, + isWebView: constant(iOSwebview), + isDesktop: constant(isDesktop) + }; }; var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var typeOf = function (x) { - var t = typeof x; - if (x === null) { - return 'null'; - } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { - return 'array'; - } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { - return 'string'; - } else { - return t; - } + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } }; var isType = function (type) { - return function (value) { - return typeOf(value) === type; - }; + return function (value) { + return typeOf(value) === type; + }; }; var isSimpleType = function (type) { - return function (value) { - return typeof value === type; - }; + return function (value) { + return typeof value === type; + }; }; var isString = isType('string'); var isObject = isType('object'); var isArray = isType('array'); var isBoolean = isSimpleType('boolean'); var isNullable = function (a) { - return a === null || a === undefined; + return a === null || a === undefined; }; var isNonNullable = function (a) { - return !isNullable(a); + return !isNullable(a); }; var isFunction = isSimpleType('function'); var isNumber = isSimpleType('number'); @@ -283,350 +279,350 @@ var nativeIndexOf = Array.prototype.indexOf; var nativePush = Array.prototype.push; var rawIndexOf = function (ts, t) { - return nativeIndexOf.call(ts, t); + return nativeIndexOf.call(ts, t); }; var contains = function (xs, x) { - return rawIndexOf(xs, x) > -1; + return rawIndexOf(xs, x) > -1; }; var exists = function (xs, pred) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - return true; - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return true; } - return false; + } + return false; }; var map = function (xs, f) { - var len = xs.length; - var r = new Array(len); - for (var i = 0; i < len; i++) { - var x = xs[i]; - r[i] = f(x, i); - } - return r; + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; }; var each = function (xs, f) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - f(x, i); - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } }; var eachr = function (xs, f) { - for (var i = xs.length - 1; i >= 0; i--) { - var x = xs[i]; - f(x, i); - } + for (var i = xs.length - 1; i >= 0; i--) { + var x = xs[i]; + f(x, i); + } }; var filter = function (xs, pred) { - var r = []; - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - r.push(x); - } + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); } - return r; + } + return r; }; var foldr = function (xs, f, acc) { - eachr(xs, function (x) { - acc = f(acc, x); - }); - return acc; + eachr(xs, function (x) { + acc = f(acc, x); + }); + return acc; }; var foldl = function (xs, f, acc) { - each(xs, function (x) { - acc = f(acc, x); - }); - return acc; + each(xs, function (x) { + acc = f(acc, x); + }); + return acc; }; var findUntil = function (xs, pred, until) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - return Optional.some(x); - } else if (until(x, i)) { - break; - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(x); + } else if (until(x, i)) { + break; } - return Optional.none(); + } + return Optional.none(); }; var find = function (xs, pred) { - return findUntil(xs, pred, never); + return findUntil(xs, pred, never); }; var findIndex = function (xs, pred) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - return Optional.some(i); - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(i); } - return Optional.none(); + } + return Optional.none(); }; var flatten = function (xs) { - var r = []; - for (var i = 0, len = xs.length; i < len; ++i) { - if (!isArray(xs[i])) { - throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); - } - nativePush.apply(r, xs[i]); + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); } - return r; + nativePush.apply(r, xs[i]); + } + return r; }; var bind = function (xs, f) { - return flatten(map(xs, f)); + return flatten(map(xs, f)); }; var forall = function (xs, pred) { - for (var i = 0, len = xs.length; i < len; ++i) { - var x = xs[i]; - if (pred(x, i) !== true) { - return false; - } + for (var i = 0, len = xs.length; i < len; ++i) { + var x = xs[i]; + if (pred(x, i) !== true) { + return false; } - return true; + } + return true; }; var reverse = function (xs) { - var r = nativeSlice.call(xs, 0); - r.reverse(); - return r; + var r = nativeSlice.call(xs, 0); + r.reverse(); + return r; }; var difference = function (a1, a2) { - return filter(a1, function (x) { - return !contains(a2, x); - }); + return filter(a1, function (x) { + return !contains(a2, x); + }); }; var pure = function (x) { - return [x]; + return [x]; }; var sort = function (xs, comparator) { - var copy = nativeSlice.call(xs, 0); - copy.sort(comparator); - return copy; + var copy = nativeSlice.call(xs, 0); + copy.sort(comparator); + return copy; }; var get = function (xs, i) { - return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none(); + return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none(); }; var head = function (xs) { - return get(xs, 0); + return get(xs, 0); }; var findMap = function (arr, f) { - for (var i = 0; i < arr.length; i++) { - var r = f(arr[i], i); - if (r.isSome()) { - return r; - } + for (var i = 0; i < arr.length; i++) { + var r = f(arr[i], i); + if (r.isSome()) { + return r; } - return Optional.none(); + } + return Optional.none(); }; var firstMatch = function (regexes, s) { - for (var i = 0; i < regexes.length; i++) { - var x = regexes[i]; - if (x.test(s)) { - return x; - } + for (var i = 0; i < regexes.length; i++) { + var x = regexes[i]; + if (x.test(s)) { + return x; } - return undefined; + } + return undefined; }; var find$1 = function (regexes, agent) { - var r = firstMatch(regexes, agent); - if (!r) { - return { - major: 0, - minor: 0 - }; - } - var group = function (i) { - return Number(agent.replace(r, '$' + i)); + var r = firstMatch(regexes, agent); + if (!r) { + return { + major: 0, + minor: 0 }; - return nu(group(1), group(2)); + } + var group = function (i) { + return Number(agent.replace(r, '$' + i)); + }; + return nu(group(1), group(2)); }; var detect = function (versionRegexes, agent) { - var cleanedAgent = String(agent).toLowerCase(); - if (versionRegexes.length === 0) { - return unknown(); - } - return find$1(versionRegexes, cleanedAgent); + var cleanedAgent = String(agent).toLowerCase(); + if (versionRegexes.length === 0) { + return unknown(); + } + return find$1(versionRegexes, cleanedAgent); }; var unknown = function () { - return nu(0, 0); + return nu(0, 0); }; var nu = function (major, minor) { - return { - major: major, - minor: minor - }; + return { + major: major, + minor: minor + }; }; var Version = { - nu: nu, - detect: detect, - unknown: unknown + nu: nu, + detect: detect, + unknown: unknown }; var detect$1 = function (candidates, userAgent) { - var agent = String(userAgent).toLowerCase(); - return find(candidates, function (candidate) { - return candidate.search(agent); - }); + var agent = String(userAgent).toLowerCase(); + return find(candidates, function (candidate) { + return candidate.search(agent); + }); }; var detectBrowser = function (browsers, userAgent) { - return detect$1(browsers, userAgent).map(function (browser) { - var version = Version.detect(browser.versionRegexes, userAgent); - return { - current: browser.name, - version: version - }; - }); + return detect$1(browsers, userAgent).map(function (browser) { + var version = Version.detect(browser.versionRegexes, userAgent); + return { + current: browser.name, + version: version + }; + }); }; var detectOs = function (oses, userAgent) { - return detect$1(oses, userAgent).map(function (os) { - var version = Version.detect(os.versionRegexes, userAgent); - return { - current: os.name, - version: version - }; - }); + return detect$1(oses, userAgent).map(function (os) { + var version = Version.detect(os.versionRegexes, userAgent); + return { + current: os.name, + version: version + }; + }); }; var UaString = { - detectBrowser: detectBrowser, - detectOs: detectOs + detectBrowser: detectBrowser, + detectOs: detectOs }; var checkRange = function (str, substr, start) { - return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr; + return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr; }; var supplant = function (str, obj) { - var isStringOrNumber = function (a) { - var t = typeof a; - return t === 'string' || t === 'number'; - }; - return str.replace(/\$\{([^{}]*)\}/g, function (fullMatch, key) { - var value = obj[key]; - return isStringOrNumber(value) ? value.toString() : fullMatch; - }); + var isStringOrNumber = function (a) { + var t = typeof a; + return t === 'string' || t === 'number'; + }; + return str.replace(/\$\{([^{}]*)\}/g, function (fullMatch, key) { + var value = obj[key]; + return isStringOrNumber(value) ? value.toString() : fullMatch; + }); }; var contains$1 = function (str, substr) { - return str.indexOf(substr) !== -1; + return str.indexOf(substr) !== -1; }; var endsWith = function (str, suffix) { - return checkRange(str, suffix, str.length - suffix.length); + return checkRange(str, suffix, str.length - suffix.length); }; var blank = function (r) { - return function (s) { - return s.replace(r, ''); - }; + return function (s) { + return s.replace(r, ''); + }; }; var trim = blank(/^\s+|\s+$/g); var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/; var checkContains = function (target) { - return function (uastring) { - return contains$1(uastring, target); - }; + return function (uastring) { + return contains$1(uastring, target); + }; }; var browsers = [ - { - name: 'Edge', - versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/], - search: function (uastring) { - return contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit'); - } - }, - { - name: 'Chrome', - versionRegexes: [ - /.*?chrome\/([0-9]+)\.([0-9]+).*/, - normalVersionRegex - ], - search: function (uastring) { - return contains$1(uastring, 'chrome') && !contains$1(uastring, 'chromeframe'); - } - }, - { - name: 'IE', - versionRegexes: [ - /.*?msie\ ?([0-9]+)\.([0-9]+).*/, - /.*?rv:([0-9]+)\.([0-9]+).*/ - ], - search: function (uastring) { - return contains$1(uastring, 'msie') || contains$1(uastring, 'trident'); - } - }, - { - name: 'Opera', - versionRegexes: [ - normalVersionRegex, - /.*?opera\/([0-9]+)\.([0-9]+).*/ - ], - search: checkContains('opera') - }, - { - name: 'Firefox', - versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/], - search: checkContains('firefox') - }, - { - name: 'Safari', - versionRegexes: [ - normalVersionRegex, - /.*?cpu os ([0-9]+)_([0-9]+).*/ - ], - search: function (uastring) { - return (contains$1(uastring, 'safari') || contains$1(uastring, 'mobile/')) && contains$1(uastring, 'applewebkit'); - } + { + name: 'Edge', + versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/], + search: function (uastring) { + return contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit'); + } + }, + { + name: 'Chrome', + versionRegexes: [ + /.*?chrome\/([0-9]+)\.([0-9]+).*/, + normalVersionRegex + ], + search: function (uastring) { + return contains$1(uastring, 'chrome') && !contains$1(uastring, 'chromeframe'); + } + }, + { + name: 'IE', + versionRegexes: [ + /.*?msie\ ?([0-9]+)\.([0-9]+).*/, + /.*?rv:([0-9]+)\.([0-9]+).*/ + ], + search: function (uastring) { + return contains$1(uastring, 'msie') || contains$1(uastring, 'trident'); + } + }, + { + name: 'Opera', + versionRegexes: [ + normalVersionRegex, + /.*?opera\/([0-9]+)\.([0-9]+).*/ + ], + search: checkContains('opera') + }, + { + name: 'Firefox', + versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/], + search: checkContains('firefox') + }, + { + name: 'Safari', + versionRegexes: [ + normalVersionRegex, + /.*?cpu os ([0-9]+)_([0-9]+).*/ + ], + search: function (uastring) { + return (contains$1(uastring, 'safari') || contains$1(uastring, 'mobile/')) && contains$1(uastring, 'applewebkit'); } + } ]; var oses = [ - { - name: 'Windows', - search: checkContains('win'), - versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/] - }, - { - name: 'iOS', - search: function (uastring) { - return contains$1(uastring, 'iphone') || contains$1(uastring, 'ipad'); - }, - versionRegexes: [ - /.*?version\/\ ?([0-9]+)\.([0-9]+).*/, - /.*cpu os ([0-9]+)_([0-9]+).*/, - /.*cpu iphone os ([0-9]+)_([0-9]+).*/ - ] - }, - { - name: 'Android', - search: checkContains('android'), - versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/] - }, - { - name: 'OSX', - search: checkContains('mac os x'), - versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/] - }, - { - name: 'Linux', - search: checkContains('linux'), - versionRegexes: [] - }, - { - name: 'Solaris', - search: checkContains('sunos'), - versionRegexes: [] - }, - { - name: 'FreeBSD', - search: checkContains('freebsd'), - versionRegexes: [] + { + name: 'Windows', + search: checkContains('win'), + versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'iOS', + search: function (uastring) { + return contains$1(uastring, 'iphone') || contains$1(uastring, 'ipad'); }, - { - name: 'ChromeOS', - search: checkContains('cros'), - versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/] - } + versionRegexes: [ + /.*?version\/\ ?([0-9]+)\.([0-9]+).*/, + /.*cpu os ([0-9]+)_([0-9]+).*/, + /.*cpu iphone os ([0-9]+)_([0-9]+).*/ + ] + }, + { + name: 'Android', + search: checkContains('android'), + versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'OSX', + search: checkContains('mac os x'), + versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/] + }, + { + name: 'Linux', + search: checkContains('linux'), + versionRegexes: [] + }, + { + name: 'Solaris', + search: checkContains('sunos'), + versionRegexes: [] + }, + { + name: 'FreeBSD', + search: checkContains('freebsd'), + versionRegexes: [] + }, + { + name: 'ChromeOS', + search: checkContains('cros'), + versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/] + } ]; var PlatformInfo = { - browsers: constant(browsers), - oses: constant(oses) + browsers: constant(browsers), + oses: constant(oses) }; var edge = 'Edge'; @@ -636,39 +632,39 @@ var firefox = 'Firefox'; var safari = 'Safari'; var unknown$1 = function () { - return nu$1({ - current: undefined, - version: Version.unknown() - }); + return nu$1({ + current: undefined, + version: Version.unknown() + }); }; var nu$1 = function (info) { - var current = info.current; - var version = info.version; - var isBrowser = function (name) { - return function () { - return current === name; - }; - }; - return { - current: current, - version: version, - isEdge: isBrowser(edge), - isChrome: isBrowser(chrome), - isIE: isBrowser(ie), - isOpera: isBrowser(opera), - isFirefox: isBrowser(firefox), - isSafari: isBrowser(safari) - }; + var current = info.current; + var version = info.version; + var isBrowser = function (name) { + return function () { + return current === name; + }; + }; + return { + current: current, + version: version, + isEdge: isBrowser(edge), + isChrome: isBrowser(chrome), + isIE: isBrowser(ie), + isOpera: isBrowser(opera), + isFirefox: isBrowser(firefox), + isSafari: isBrowser(safari) + }; }; var Browser = { - unknown: unknown$1, - nu: nu$1, - edge: constant(edge), - chrome: constant(chrome), - ie: constant(ie), - opera: constant(opera), - firefox: constant(firefox), - safari: constant(safari) + unknown: unknown$1, + nu: nu$1, + edge: constant(edge), + chrome: constant(chrome), + ie: constant(ie), + opera: constant(opera), + firefox: constant(firefox), + safari: constant(safari) }; var windows = 'Windows'; @@ -680,67 +676,67 @@ var freebsd = 'FreeBSD'; var chromeos = 'ChromeOS'; var unknown$2 = function () { - return nu$2({ - current: undefined, - version: Version.unknown() - }); + return nu$2({ + current: undefined, + version: Version.unknown() + }); }; var nu$2 = function (info) { - var current = info.current; - var version = info.version; - var isOS = function (name) { - return function () { - return current === name; - }; - }; - return { - current: current, - version: version, - isWindows: isOS(windows), - isiOS: isOS(ios), - isAndroid: isOS(android), - isOSX: isOS(osx), - isLinux: isOS(linux), - isSolaris: isOS(solaris), - isFreeBSD: isOS(freebsd), - isChromeOS: isOS(chromeos) - }; + var current = info.current; + var version = info.version; + var isOS = function (name) { + return function () { + return current === name; + }; + }; + return { + current: current, + version: version, + isWindows: isOS(windows), + isiOS: isOS(ios), + isAndroid: isOS(android), + isOSX: isOS(osx), + isLinux: isOS(linux), + isSolaris: isOS(solaris), + isFreeBSD: isOS(freebsd), + isChromeOS: isOS(chromeos) + }; }; var OperatingSystem = { - unknown: unknown$2, - nu: nu$2, - windows: constant(windows), - ios: constant(ios), - android: constant(android), - linux: constant(linux), - osx: constant(osx), - solaris: constant(solaris), - freebsd: constant(freebsd), - chromeos: constant(chromeos) + unknown: unknown$2, + nu: nu$2, + windows: constant(windows), + ios: constant(ios), + android: constant(android), + linux: constant(linux), + osx: constant(osx), + solaris: constant(solaris), + freebsd: constant(freebsd), + chromeos: constant(chromeos) }; var detect$2 = function (userAgent, mediaMatch) { - var browsers = PlatformInfo.browsers(); - var oses = PlatformInfo.oses(); - var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu); - var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu); - var deviceType = DeviceType(os, browser, userAgent, mediaMatch); - return { - browser: browser, - os: os, - deviceType: deviceType - }; - }; - var PlatformDetection = {detect: detect$2}; + var browsers = PlatformInfo.browsers(); + var oses = PlatformInfo.oses(); + var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu); + var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu); + var deviceType = DeviceType(os, browser, userAgent, mediaMatch); + return { + browser: browser, + os: os, + deviceType: deviceType + }; + }; + var PlatformDetection = { detect: detect$2 }; var mediaMatch = function (query) { - return window.matchMedia(query).matches; + return window.matchMedia(query).matches; }; var platform = cached(function () { - return PlatformDetection.detect(navigator.userAgent, mediaMatch); + return PlatformDetection.detect(navigator.userAgent, mediaMatch); }); var detect$3 = function () { - return platform(); + return platform(); }; var constant$1 = constant; @@ -760,9 +756,9 @@ var selectstart = constant$1('selectstart'); var prefixName = function (name) { - return constant('alloy.' + name); + return constant('alloy.' + name); }; - var alloy = {tap: prefixName('tap')}; + var alloy = { tap: prefixName('tap') }; var focus = prefixName('focus'); var postBlur = prefixName('blur.post'); var postPaste = prefixName('paste.post'); @@ -779,26 +775,26 @@ var dehighlight = prefixName('dehighlight'); var emit = function (component, event) { - dispatchWith(component, component.element, event, {}); + dispatchWith(component, component.element, event, {}); }; var emitWith = function (component, event, properties) { - dispatchWith(component, component.element, event, properties); + dispatchWith(component, component.element, event, properties); }; var emitExecute = function (component) { - emit(component, execute()); + emit(component, execute()); }; var dispatch = function (component, target, event) { - dispatchWith(component, target, event, {}); + dispatchWith(component, target, event, {}); }; var dispatchWith = function (component, target, event, properties) { - var data = __assign({target: target}, properties); - component.getSystem().triggerEvent(event, target, data); + var data = __assign({ target: target }, properties); + component.getSystem().triggerEvent(event, target, data); }; var dispatchEvent = function (component, target, event, simulatedEvent) { - component.getSystem().triggerEvent(event, target, simulatedEvent.event); + component.getSystem().triggerEvent(event, target, simulatedEvent.event); }; var dispatchFocus = function (component, target) { - component.getSystem().triggerFocus(target, component.element); + component.getSystem().triggerFocus(target, component.element); }; var DOCUMENT = 9; @@ -807,90 +803,90 @@ var TEXT = 3; var fromHtml = function (html, scope) { - var doc = scope || document; - var div = doc.createElement('div'); - div.innerHTML = html; - if (!div.hasChildNodes() || div.childNodes.length > 1) { - console.error('HTML does not have a single root node', html); - throw new Error('HTML must have a single root node'); - } - return fromDom(div.childNodes[0]); + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); }; var fromTag = function (tag, scope) { - var doc = scope || document; - var node = doc.createElement(tag); - return fromDom(node); + var doc = scope || document; + var node = doc.createElement(tag); + return fromDom(node); }; var fromText = function (text, scope) { - var doc = scope || document; - var node = doc.createTextNode(text); - return fromDom(node); + var doc = scope || document; + var node = doc.createTextNode(text); + return fromDom(node); }; var fromDom = function (node) { - if (node === null || node === undefined) { - throw new Error('Node cannot be null or undefined'); - } - return {dom: node}; + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: node }; }; var fromPoint = function (docElm, x, y) { - return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); + return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); }; var SugarElement = { - fromHtml: fromHtml, - fromTag: fromTag, - fromText: fromText, - fromDom: fromDom, - fromPoint: fromPoint + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint }; var is = function (element, selector) { - var dom = element.dom; - if (dom.nodeType !== ELEMENT) { - return false; + var dom = element.dom; + if (dom.nodeType !== ELEMENT) { + return false; + } else { + var elem = dom; + if (elem.matches !== undefined) { + return elem.matches(selector); + } else if (elem.msMatchesSelector !== undefined) { + return elem.msMatchesSelector(selector); + } else if (elem.webkitMatchesSelector !== undefined) { + return elem.webkitMatchesSelector(selector); + } else if (elem.mozMatchesSelector !== undefined) { + return elem.mozMatchesSelector(selector); } else { - var elem = dom; - if (elem.matches !== undefined) { - return elem.matches(selector); - } else if (elem.msMatchesSelector !== undefined) { - return elem.msMatchesSelector(selector); - } else if (elem.webkitMatchesSelector !== undefined) { - return elem.webkitMatchesSelector(selector); - } else if (elem.mozMatchesSelector !== undefined) { - return elem.mozMatchesSelector(selector); - } else { - throw new Error('Browser lacks native selectors'); - } + throw new Error('Browser lacks native selectors'); } + } }; var bypassSelector = function (dom) { - return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0; + return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0; }; var all = function (selector, scope) { - var base = scope === undefined ? document : scope.dom; - return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), SugarElement.fromDom); + var base = scope === undefined ? document : scope.dom; + return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), SugarElement.fromDom); }; var one = function (selector, scope) { - var base = scope === undefined ? document : scope.dom; - return bypassSelector(base) ? Optional.none() : Optional.from(base.querySelector(selector)).map(SugarElement.fromDom); + var base = scope === undefined ? document : scope.dom; + return bypassSelector(base) ? Optional.none() : Optional.from(base.querySelector(selector)).map(SugarElement.fromDom); }; var eq = function (e1, e2) { - return e1.dom === e2.dom; + return e1.dom === e2.dom; }; var Global = typeof window !== 'undefined' ? window : Function('return this;')(); var name = function (element) { - var r = element.dom.nodeName; - return r.toLowerCase(); + var r = element.dom.nodeName; + return r.toLowerCase(); }; var type = function (element) { - return element.dom.nodeType; + return element.dom.nodeType; }; var isType$1 = function (t) { - return function (element) { - return type(element) === t; - }; + return function (element) { + return type(element) === t; + }; }; var isElement = isType$1(ELEMENT); var isText = isType$1(TEXT); @@ -898,437 +894,437 @@ var isDocumentFragment = isType$1(DOCUMENT_FRAGMENT); var owner = function (element) { - return SugarElement.fromDom(element.dom.ownerDocument); + return SugarElement.fromDom(element.dom.ownerDocument); }; var documentOrOwner = function (dos) { - return isDocument(dos) ? dos : owner(dos); + return isDocument(dos) ? dos : owner(dos); }; var defaultView = function (element) { - return SugarElement.fromDom(documentOrOwner(element).dom.defaultView); + return SugarElement.fromDom(documentOrOwner(element).dom.defaultView); }; var parent = function (element) { - return Optional.from(element.dom.parentNode).map(SugarElement.fromDom); + return Optional.from(element.dom.parentNode).map(SugarElement.fromDom); }; var parents = function (element, isRoot) { - var stop = isFunction(isRoot) ? isRoot : never; - var dom = element.dom; - var ret = []; - while (dom.parentNode !== null && dom.parentNode !== undefined) { - var rawParent = dom.parentNode; - var p = SugarElement.fromDom(rawParent); - ret.push(p); - if (stop(p) === true) { - break; - } else { - dom = rawParent; - } + var stop = isFunction(isRoot) ? isRoot : never; + var dom = element.dom; + var ret = []; + while (dom.parentNode !== null && dom.parentNode !== undefined) { + var rawParent = dom.parentNode; + var p = SugarElement.fromDom(rawParent); + ret.push(p); + if (stop(p) === true) { + break; + } else { + dom = rawParent; } - return ret; + } + return ret; }; var siblings = function (element) { - var filterSelf = function (elements) { - return filter(elements, function (x) { - return !eq(element, x); - }); - }; - return parent(element).map(children).map(filterSelf).getOr([]); + var filterSelf = function (elements) { + return filter(elements, function (x) { + return !eq(element, x); + }); + }; + return parent(element).map(children).map(filterSelf).getOr([]); }; var nextSibling = function (element) { - return Optional.from(element.dom.nextSibling).map(SugarElement.fromDom); + return Optional.from(element.dom.nextSibling).map(SugarElement.fromDom); }; var children = function (element) { - return map(element.dom.childNodes, SugarElement.fromDom); + return map(element.dom.childNodes, SugarElement.fromDom); }; var child = function (element, index) { - var cs = element.dom.childNodes; - return Optional.from(cs[index]).map(SugarElement.fromDom); + var cs = element.dom.childNodes; + return Optional.from(cs[index]).map(SugarElement.fromDom); }; var firstChild = function (element) { - return child(element, 0); + return child(element, 0); }; var before = function (marker, element) { - var parent$1 = parent(marker); - parent$1.each(function (v) { - v.dom.insertBefore(element.dom, marker.dom); - }); + var parent$1 = parent(marker); + parent$1.each(function (v) { + v.dom.insertBefore(element.dom, marker.dom); + }); }; var after = function (marker, element) { - var sibling = nextSibling(marker); - sibling.fold(function () { - var parent$1 = parent(marker); - parent$1.each(function (v) { - append(v, element); - }); - }, function (v) { - before(v, element); + var sibling = nextSibling(marker); + sibling.fold(function () { + var parent$1 = parent(marker); + parent$1.each(function (v) { + append(v, element); }); + }, function (v) { + before(v, element); + }); }; var prepend = function (parent, element) { - var firstChild$1 = firstChild(parent); - firstChild$1.fold(function () { - append(parent, element); - }, function (v) { - parent.dom.insertBefore(element.dom, v.dom); - }); + var firstChild$1 = firstChild(parent); + firstChild$1.fold(function () { + append(parent, element); + }, function (v) { + parent.dom.insertBefore(element.dom, v.dom); + }); }; var append = function (parent, element) { - parent.dom.appendChild(element.dom); + parent.dom.appendChild(element.dom); }; var appendAt = function (parent, element, index) { - child(parent, index).fold(function () { - append(parent, element); - }, function (v) { - before(v, element); - }); + child(parent, index).fold(function () { + append(parent, element); + }, function (v) { + before(v, element); + }); }; var append$1 = function (parent, elements) { - each(elements, function (x) { - append(parent, x); - }); + each(elements, function (x) { + append(parent, x); + }); }; var empty = function (element) { - element.dom.textContent = ''; - each(children(element), function (rogue) { - remove(rogue); - }); + element.dom.textContent = ''; + each(children(element), function (rogue) { + remove(rogue); + }); }; var remove = function (element) { - var dom = element.dom; - if (dom.parentNode !== null) { - dom.parentNode.removeChild(dom); - } + var dom = element.dom; + if (dom.parentNode !== null) { + dom.parentNode.removeChild(dom); + } }; var isShadowRoot = function (dos) { - return isDocumentFragment(dos); + return isDocumentFragment(dos); }; var supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode); var isSupported = constant(supported); var getRootNode = supported ? function (e) { - return SugarElement.fromDom(e.dom.getRootNode()); + return SugarElement.fromDom(e.dom.getRootNode()); } : documentOrOwner; var getShadowRoot = function (e) { - var r = getRootNode(e); - return isShadowRoot(r) ? Optional.some(r) : Optional.none(); + var r = getRootNode(e); + return isShadowRoot(r) ? Optional.some(r) : Optional.none(); }; var getShadowHost = function (e) { - return SugarElement.fromDom(e.dom.host); + return SugarElement.fromDom(e.dom.host); }; var getOriginalEventTarget = function (event) { - if (isSupported() && isNonNullable(event.target)) { - var el = SugarElement.fromDom(event.target); - if (isElement(el) && isOpenShadowHost(el)) { - if (event.composed && event.composedPath) { - var composedPath = event.composedPath(); - if (composedPath) { - return head(composedPath); - } - } - } + if (isSupported() && isNonNullable(event.target)) { + var el = SugarElement.fromDom(event.target); + if (isElement(el) && isOpenShadowHost(el)) { + if (event.composed && event.composedPath) { + var composedPath = event.composedPath(); + if (composedPath) { + return head(composedPath); + } + } } - return Optional.from(event.target); + } + return Optional.from(event.target); }; var isOpenShadowHost = function (element) { - return isNonNullable(element.dom.shadowRoot); + return isNonNullable(element.dom.shadowRoot); }; var inBody = function (element) { - var dom = isText(element) ? element.dom.parentNode : element.dom; - if (dom === undefined || dom === null || dom.ownerDocument === null) { - return false; - } - var doc = dom.ownerDocument; - return getShadowRoot(SugarElement.fromDom(dom)).fold(function () { - return doc.body.contains(dom); - }, compose1(inBody, getShadowHost)); + var dom = isText(element) ? element.dom.parentNode : element.dom; + if (dom === undefined || dom === null || dom.ownerDocument === null) { + return false; + } + var doc = dom.ownerDocument; + return getShadowRoot(SugarElement.fromDom(dom)).fold(function () { + return doc.body.contains(dom); + }, compose1(inBody, getShadowHost)); }; var body = function () { - return getBody(SugarElement.fromDom(document)); + return getBody(SugarElement.fromDom(document)); }; var getBody = function (doc) { - var b = doc.dom.body; - if (b === null || b === undefined) { - throw new Error('Body is not available yet'); - } - return SugarElement.fromDom(b); + var b = doc.dom.body; + if (b === null || b === undefined) { + throw new Error('Body is not available yet'); + } + return SugarElement.fromDom(b); }; var fireDetaching = function (component) { - emit(component, detachedFromDom()); - var children = component.components(); - each(children, fireDetaching); + emit(component, detachedFromDom()); + var children = component.components(); + each(children, fireDetaching); }; var fireAttaching = function (component) { - var children = component.components(); - each(children, fireAttaching); - emit(component, attachedToDom()); + var children = component.components(); + each(children, fireAttaching); + emit(component, attachedToDom()); }; var attach = function (parent, child) { - append(parent.element, child.element); + append(parent.element, child.element); }; var detachChildren = function (component) { - each(component.components(), function (childComp) { - return remove(childComp.element); - }); - empty(component.element); - component.syncComponents(); + each(component.components(), function (childComp) { + return remove(childComp.element); + }); + empty(component.element); + component.syncComponents(); }; var replaceChildren = function (component, newChildren) { - var subs = component.components(); - detachChildren(component); - var deleted = difference(subs, newChildren); - each(deleted, function (comp) { - fireDetaching(comp); - component.getSystem().removeFromWorld(comp); - }); - each(newChildren, function (childComp) { - if (!childComp.getSystem().isConnected()) { - component.getSystem().addToWorld(childComp); - attach(component, childComp); - if (inBody(component.element)) { - fireAttaching(childComp); - } - } else { - attach(component, childComp); - } - component.syncComponents(); - }); + var subs = component.components(); + detachChildren(component); + var deleted = difference(subs, newChildren); + each(deleted, function (comp) { + fireDetaching(comp); + component.getSystem().removeFromWorld(comp); + }); + each(newChildren, function (childComp) { + if (!childComp.getSystem().isConnected()) { + component.getSystem().addToWorld(childComp); + attach(component, childComp); + if (inBody(component.element)) { + fireAttaching(childComp); + } + } else { + attach(component, childComp); + } + component.syncComponents(); + }); }; var attach$1 = function (parent, child) { - attachWith(parent, child, append); + attachWith(parent, child, append); }; var attachWith = function (parent, child, insertion) { - parent.getSystem().addToWorld(child); - insertion(parent.element, child.element); - if (inBody(parent.element)) { - fireAttaching(child); - } - parent.syncComponents(); + parent.getSystem().addToWorld(child); + insertion(parent.element, child.element); + if (inBody(parent.element)) { + fireAttaching(child); + } + parent.syncComponents(); }; var doDetach = function (component) { - fireDetaching(component); - remove(component.element); - component.getSystem().removeFromWorld(component); + fireDetaching(component); + remove(component.element); + component.getSystem().removeFromWorld(component); }; var detach = function (component) { - var parent$1 = parent(component.element).bind(function (p) { - return component.getSystem().getByDom(p).toOptional(); - }); - doDetach(component); - parent$1.each(function (p) { - p.syncComponents(); - }); + var parent$1 = parent(component.element).bind(function (p) { + return component.getSystem().getByDom(p).toOptional(); + }); + doDetach(component); + parent$1.each(function (p) { + p.syncComponents(); + }); }; var attachSystemAfter = function (element, guiSystem) { - attachSystemWith(element, guiSystem, after); + attachSystemWith(element, guiSystem, after); }; var attachSystemWith = function (element, guiSystem, inserter) { - inserter(element, guiSystem.element); - var children$1 = children(guiSystem.element); - each(children$1, function (child) { - guiSystem.getByDom(child).each(fireAttaching); - }); + inserter(element, guiSystem.element); + var children$1 = children(guiSystem.element); + each(children$1, function (child) { + guiSystem.getByDom(child).each(fireAttaching); + }); }; var detachSystem = function (guiSystem) { - var children$1 = children(guiSystem.element); - each(children$1, function (child) { - guiSystem.getByDom(child).each(fireDetaching); - }); - remove(guiSystem.element); + var children$1 = children(guiSystem.element); + each(children$1, function (child) { + guiSystem.getByDom(child).each(fireDetaching); + }); + remove(guiSystem.element); }; var keys = Object.keys; var hasOwnProperty = Object.hasOwnProperty; var each$1 = function (obj, f) { - var props = keys(obj); - for (var k = 0, len = props.length; k < len; k++) { - var i = props[k]; - var x = obj[i]; - f(x, i); - } + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } }; var map$1 = function (obj, f) { - return tupleMap(obj, function (x, i) { - return { - k: i, - v: f(x, i) - }; - }); + return tupleMap(obj, function (x, i) { + return { + k: i, + v: f(x, i) + }; + }); }; var tupleMap = function (obj, f) { - var r = {}; - each$1(obj, function (x, i) { - var tuple = f(x, i); - r[tuple.k] = tuple.v; - }); - return r; + var r = {}; + each$1(obj, function (x, i) { + var tuple = f(x, i); + r[tuple.k] = tuple.v; + }); + return r; }; var objAcc = function (r) { - return function (x, i) { - r[i] = x; - }; + return function (x, i) { + r[i] = x; + }; }; var internalFilter = function (obj, pred, onTrue, onFalse) { - var r = {}; - each$1(obj, function (x, i) { - (pred(x, i) ? onTrue : onFalse)(x, i); - }); - return r; + var r = {}; + each$1(obj, function (x, i) { + (pred(x, i) ? onTrue : onFalse)(x, i); + }); + return r; }; var filter$1 = function (obj, pred) { - var t = {}; - internalFilter(obj, pred, objAcc(t), noop); - return t; + var t = {}; + internalFilter(obj, pred, objAcc(t), noop); + return t; }; var mapToArray = function (obj, f) { - var r = []; - each$1(obj, function (value, name) { - r.push(f(value, name)); - }); - return r; + var r = []; + each$1(obj, function (value, name) { + r.push(f(value, name)); + }); + return r; }; var find$2 = function (obj, pred) { - var props = keys(obj); - for (var k = 0, len = props.length; k < len; k++) { - var i = props[k]; - var x = obj[i]; - if (pred(x, i, obj)) { - return Optional.some(x); - } + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + if (pred(x, i, obj)) { + return Optional.some(x); } - return Optional.none(); + } + return Optional.none(); }; var values = function (obj) { - return mapToArray(obj, function (v) { - return v; - }); + return mapToArray(obj, function (v) { + return v; + }); }; var get$1 = function (obj, key) { - return has(obj, key) ? Optional.from(obj[key]) : Optional.none(); + return has(obj, key) ? Optional.from(obj[key]) : Optional.none(); }; var has = function (obj, key) { - return hasOwnProperty.call(obj, key); + return hasOwnProperty.call(obj, key); }; var hasNonNullableKey = function (obj, key) { - return has(obj, key) && obj[key] !== undefined && obj[key] !== null; + return has(obj, key) && obj[key] !== undefined && obj[key] !== null; }; var rawSet = function (dom, key, value) { - if (isString(value) || isBoolean(value) || isNumber(value)) { - dom.setAttribute(key, value + ''); - } else { - console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); - throw new Error('Attribute value was not simple'); - } + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); + throw new Error('Attribute value was not simple'); + } }; var set = function (element, key, value) { - rawSet(element.dom, key, value); + rawSet(element.dom, key, value); }; var setAll = function (element, attrs) { - var dom = element.dom; - each$1(attrs, function (v, k) { - rawSet(dom, k, v); - }); + var dom = element.dom; + each$1(attrs, function (v, k) { + rawSet(dom, k, v); + }); }; var get$2 = function (element, key) { - var v = element.dom.getAttribute(key); - return v === null ? undefined : v; + var v = element.dom.getAttribute(key); + return v === null ? undefined : v; }; var getOpt = function (element, key) { - return Optional.from(get$2(element, key)); + return Optional.from(get$2(element, key)); }; var has$1 = function (element, key) { - var dom = element.dom; - return dom && dom.hasAttribute ? dom.hasAttribute(key) : false; + var dom = element.dom; + return dom && dom.hasAttribute ? dom.hasAttribute(key) : false; }; var remove$1 = function (element, key) { - element.dom.removeAttribute(key); + element.dom.removeAttribute(key); }; var read = function (element, attr) { - var value = get$2(element, attr); - return value === undefined || value === '' ? [] : value.split(' '); + var value = get$2(element, attr); + return value === undefined || value === '' ? [] : value.split(' '); }; var add = function (element, attr, id) { - var old = read(element, attr); - var nu = old.concat([id]); - set(element, attr, nu.join(' ')); - return true; + var old = read(element, attr); + var nu = old.concat([id]); + set(element, attr, nu.join(' ')); + return true; }; var remove$2 = function (element, attr, id) { - var nu = filter(read(element, attr), function (v) { - return v !== id; - }); - if (nu.length > 0) { - set(element, attr, nu.join(' ')); - } else { - remove$1(element, attr); - } - return false; + var nu = filter(read(element, attr), function (v) { + return v !== id; + }); + if (nu.length > 0) { + set(element, attr, nu.join(' ')); + } else { + remove$1(element, attr); + } + return false; }; var supports = function (element) { - return element.dom.classList !== undefined; + return element.dom.classList !== undefined; }; var get$3 = function (element) { - return read(element, 'class'); + return read(element, 'class'); }; var add$1 = function (element, clazz) { - return add(element, 'class', clazz); + return add(element, 'class', clazz); }; var remove$3 = function (element, clazz) { - return remove$2(element, 'class', clazz); + return remove$2(element, 'class', clazz); }; var add$2 = function (element, clazz) { - if (supports(element)) { - element.dom.classList.add(clazz); - } else { - add$1(element, clazz); - } + if (supports(element)) { + element.dom.classList.add(clazz); + } else { + add$1(element, clazz); + } }; var cleanClass = function (element) { - var classList = supports(element) ? element.dom.classList : get$3(element); - if (classList.length === 0) { - remove$1(element, 'class'); - } + var classList = supports(element) ? element.dom.classList : get$3(element); + if (classList.length === 0) { + remove$1(element, 'class'); + } }; var remove$4 = function (element, clazz) { - if (supports(element)) { - var classList = element.dom.classList; - classList.remove(clazz); - } else { - remove$3(element, clazz); - } - cleanClass(element); + if (supports(element)) { + var classList = element.dom.classList; + classList.remove(clazz); + } else { + remove$3(element, clazz); + } + cleanClass(element); }; var has$2 = function (element, clazz) { - return supports(element) && element.dom.classList.contains(clazz); + return supports(element) && element.dom.classList.contains(clazz); }; var swap = function (element, addCls, removeCls) { - remove$4(element, removeCls); - add$2(element, addCls); + remove$4(element, removeCls); + add$2(element, addCls); }; var toAlpha = function (component, swapConfig, _swapState) { - swap(component.element, swapConfig.alpha, swapConfig.omega); + swap(component.element, swapConfig.alpha, swapConfig.omega); }; var toOmega = function (component, swapConfig, _swapState) { - swap(component.element, swapConfig.omega, swapConfig.alpha); + swap(component.element, swapConfig.omega, swapConfig.alpha); }; var clear = function (component, swapConfig, _swapState) { - remove$4(component.element, swapConfig.alpha); - remove$4(component.element, swapConfig.omega); + remove$4(component.element, swapConfig.alpha); + remove$4(component.element, swapConfig.omega); }; var isAlpha = function (component, swapConfig, _swapState) { - return has$2(component.element, swapConfig.alpha); + return has$2(component.element, swapConfig.alpha); }; var isOmega = function (component, swapConfig, _swapState) { - return has$2(component.element, swapConfig.omega); + return has$2(component.element, swapConfig.omega); }; var SwapApis = /*#__PURE__*/Object.freeze({ @@ -1341,314 +1337,314 @@ }); var value = function (o) { - var is = function (v) { - return o === v; - }; - var or = function (_opt) { - return value(o); - }; - var orThunk = function (_f) { - return value(o); - }; - var map = function (f) { - return value(f(o)); - }; - var mapError = function (_f) { - return value(o); - }; - var each = function (f) { - f(o); - }; - var bind = function (f) { - return f(o); - }; - var fold = function (_, onValue) { - return onValue(o); - }; - var exists = function (f) { - return f(o); - }; - var forall = function (f) { - return f(o); - }; - var toOptional = function () { - return Optional.some(o); - }; - return { - is: is, - isValue: always, - isError: never, - getOr: constant(o), - getOrThunk: constant(o), - getOrDie: constant(o), - or: or, - orThunk: orThunk, - fold: fold, - map: map, - mapError: mapError, - each: each, - bind: bind, - exists: exists, - forall: forall, - toOptional: toOptional - }; + var is = function (v) { + return o === v; + }; + var or = function (_opt) { + return value(o); + }; + var orThunk = function (_f) { + return value(o); + }; + var map = function (f) { + return value(f(o)); + }; + var mapError = function (_f) { + return value(o); + }; + var each = function (f) { + f(o); + }; + var bind = function (f) { + return f(o); + }; + var fold = function (_, onValue) { + return onValue(o); + }; + var exists = function (f) { + return f(o); + }; + var forall = function (f) { + return f(o); + }; + var toOptional = function () { + return Optional.some(o); + }; + return { + is: is, + isValue: always, + isError: never, + getOr: constant(o), + getOrThunk: constant(o), + getOrDie: constant(o), + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: each, + bind: bind, + exists: exists, + forall: forall, + toOptional: toOptional + }; }; var error = function (message) { - var getOrThunk = function (f) { - return f(); - }; - var getOrDie = function () { - return die(String(message))(); - }; - var or = function (opt) { - return opt; - }; - var orThunk = function (f) { - return f(); - }; - var map = function (_f) { - return error(message); - }; - var mapError = function (f) { - return error(f(message)); - }; - var bind = function (_f) { - return error(message); - }; - var fold = function (onError, _) { - return onError(message); - }; - return { - is: never, - isValue: never, - isError: always, - getOr: identity, - getOrThunk: getOrThunk, - getOrDie: getOrDie, - or: or, - orThunk: orThunk, - fold: fold, - map: map, - mapError: mapError, - each: noop, - bind: bind, - exists: never, - forall: always, - toOptional: Optional.none - }; + var getOrThunk = function (f) { + return f(); + }; + var getOrDie = function () { + return die(String(message))(); + }; + var or = function (opt) { + return opt; + }; + var orThunk = function (f) { + return f(); + }; + var map = function (_f) { + return error(message); + }; + var mapError = function (f) { + return error(f(message)); + }; + var bind = function (_f) { + return error(message); + }; + var fold = function (onError, _) { + return onError(message); + }; + return { + is: never, + isValue: never, + isError: always, + getOr: identity, + getOrThunk: getOrThunk, + getOrDie: getOrDie, + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: noop, + bind: bind, + exists: never, + forall: always, + toOptional: Optional.none + }; }; var fromOption = function (opt, err) { - return opt.fold(function () { - return error(err); - }, value); + return opt.fold(function () { + return error(err); + }, value); }; var Result = { - value: value, - error: error, - fromOption: fromOption + value: value, + error: error, + fromOption: fromOption }; var SimpleResultType; (function (SimpleResultType) { - SimpleResultType[SimpleResultType['Error'] = 0] = 'Error'; - SimpleResultType[SimpleResultType['Value'] = 1] = 'Value'; + SimpleResultType[SimpleResultType['Error'] = 0] = 'Error'; + SimpleResultType[SimpleResultType['Value'] = 1] = 'Value'; }(SimpleResultType || (SimpleResultType = {}))); var fold = function (res, onError, onValue) { - return res.stype === SimpleResultType.Error ? onError(res.serror) : onValue(res.svalue); + return res.stype === SimpleResultType.Error ? onError(res.serror) : onValue(res.svalue); }; var partition = function (results) { - var values = []; - var errors = []; - each(results, function (obj) { - fold(obj, function (err) { - return errors.push(err); - }, function (val) { - return values.push(val); - }); - }); - return { - values: values, - errors: errors - }; + var values = []; + var errors = []; + each(results, function (obj) { + fold(obj, function (err) { + return errors.push(err); + }, function (val) { + return values.push(val); + }); + }); + return { + values: values, + errors: errors + }; }; var mapError = function (res, f) { - if (res.stype === SimpleResultType.Error) { - return { - stype: SimpleResultType.Error, - serror: f(res.serror) - }; - } else { - return res; - } + if (res.stype === SimpleResultType.Error) { + return { + stype: SimpleResultType.Error, + serror: f(res.serror) + }; + } else { + return res; + } }; var map$2 = function (res, f) { - if (res.stype === SimpleResultType.Value) { - return { - stype: SimpleResultType.Value, - svalue: f(res.svalue) - }; - } else { - return res; - } + if (res.stype === SimpleResultType.Value) { + return { + stype: SimpleResultType.Value, + svalue: f(res.svalue) + }; + } else { + return res; + } }; var bind$1 = function (res, f) { - if (res.stype === SimpleResultType.Value) { - return f(res.svalue); - } else { - return res; - } + if (res.stype === SimpleResultType.Value) { + return f(res.svalue); + } else { + return res; + } }; var bindError = function (res, f) { - if (res.stype === SimpleResultType.Error) { - return f(res.serror); - } else { - return res; - } + if (res.stype === SimpleResultType.Error) { + return f(res.serror); + } else { + return res; + } }; var svalue = function (v) { - return { - stype: SimpleResultType.Value, - svalue: v - }; + return { + stype: SimpleResultType.Value, + svalue: v + }; }; var serror = function (e) { - return { - stype: SimpleResultType.Error, - serror: e - }; + return { + stype: SimpleResultType.Error, + serror: e + }; }; var toResult = function (res) { - return fold(res, Result.error, Result.value); + return fold(res, Result.error, Result.value); }; var fromResult = function (res) { - return res.fold(serror, svalue); + return res.fold(serror, svalue); }; var SimpleResult = { - fromResult: fromResult, - toResult: toResult, - svalue: svalue, - partition: partition, - serror: serror, - bind: bind$1, - bindError: bindError, - map: map$2, - mapError: mapError, - fold: fold + fromResult: fromResult, + toResult: toResult, + svalue: svalue, + partition: partition, + serror: serror, + bind: bind$1, + bindError: bindError, + map: map$2, + mapError: mapError, + fold: fold }; var generate = function (cases) { - if (!isArray(cases)) { - throw new Error('cases must be an array'); - } - if (cases.length === 0) { - throw new Error('there must be at least one case'); - } - var constructors = []; - var adt = {}; - each(cases, function (acase, count) { - var keys$1 = keys(acase); - if (keys$1.length !== 1) { - throw new Error('one and only one name per case'); - } - var key = keys$1[0]; - var value = acase[key]; - if (adt[key] !== undefined) { - throw new Error('duplicate key detected:' + key); - } else if (key === 'cata') { - throw new Error('cannot have a case named cata (sorry)'); - } else if (!isArray(value)) { - throw new Error('case arguments must be an array'); + if (!isArray(cases)) { + throw new Error('cases must be an array'); + } + if (cases.length === 0) { + throw new Error('there must be at least one case'); + } + var constructors = []; + var adt = {}; + each(cases, function (acase, count) { + var keys$1 = keys(acase); + if (keys$1.length !== 1) { + throw new Error('one and only one name per case'); + } + var key = keys$1[0]; + var value = acase[key]; + if (adt[key] !== undefined) { + throw new Error('duplicate key detected:' + key); + } else if (key === 'cata') { + throw new Error('cannot have a case named cata (sorry)'); + } else if (!isArray(value)) { + throw new Error('case arguments must be an array'); + } + constructors.push(key); + adt[key] = function () { + var argLength = arguments.length; + if (argLength !== value.length) { + throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength); + } + var args = new Array(argLength); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + var match = function (branches) { + var branchKeys = keys(branches); + if (constructors.length !== branchKeys.length) { + throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\nActual: ' + branchKeys.join(',')); + } + var allReqd = forall(constructors, function (reqKey) { + return contains(branchKeys, reqKey); + }); + if (!allReqd) { + throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', ')); + } + return branches[key].apply(null, args); + }; + return { + fold: function () { + if (arguments.length !== cases.length) { + throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + arguments.length); + } + var target = arguments[count]; + return target.apply(null, args); + }, + match: match, + log: function (label) { + console.log(label, { + constructors: constructors, + constructor: key, + params: args + }); } - constructors.push(key); - adt[key] = function () { - var argLength = arguments.length; - if (argLength !== value.length) { - throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength); - } - var args = new Array(argLength); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - var match = function (branches) { - var branchKeys = keys(branches); - if (constructors.length !== branchKeys.length) { - throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\nActual: ' + branchKeys.join(',')); - } - var allReqd = forall(constructors, function (reqKey) { - return contains(branchKeys, reqKey); - }); - if (!allReqd) { - throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', ')); - } - return branches[key].apply(null, args); - }; - return { - fold: function () { - if (arguments.length !== cases.length) { - throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + arguments.length); - } - var target = arguments[count]; - return target.apply(null, args); - }, - match: match, - log: function (label) { - console.log(label, { - constructors: constructors, - constructor: key, - params: args - }); - } - }; - }; - }); - return adt; + }; + }; + }); + return adt; }; - var Adt = {generate: generate}; + var Adt = { generate: generate }; var hasOwnProperty$1 = Object.prototype.hasOwnProperty; var shallow = function (old, nu) { - return nu; + return nu; }; var deep = function (old, nu) { - var bothObjects = isObject(old) && isObject(nu); - return bothObjects ? deepMerge(old, nu) : nu; + var bothObjects = isObject(old) && isObject(nu); + return bothObjects ? deepMerge(old, nu) : nu; }; var baseMerge = function (merger) { - return function () { - var objects = new Array(arguments.length); - for (var i = 0; i < objects.length; i++) { - objects[i] = arguments[i]; - } - if (objects.length === 0) { - throw new Error('Can\'t merge zero objects'); - } - var ret = {}; - for (var j = 0; j < objects.length; j++) { - var curObject = objects[j]; - for (var key in curObject) { - if (hasOwnProperty$1.call(curObject, key)) { - ret[key] = merger(ret[key], curObject[key]); - } - } - } - return ret; - }; + return function () { + var objects = new Array(arguments.length); + for (var i = 0; i < objects.length; i++) { + objects[i] = arguments[i]; + } + if (objects.length === 0) { + throw new Error('Can\'t merge zero objects'); + } + var ret = {}; + for (var j = 0; j < objects.length; j++) { + var curObject = objects[j]; + for (var key in curObject) { + if (hasOwnProperty$1.call(curObject, key)) { + ret[key] = merger(ret[key], curObject[key]); + } + } + } + return ret; + }; }; var deepMerge = baseMerge(deep); var merge = baseMerge(shallow); var adt = Adt.generate([ - {strict: []}, - {defaultedThunk: ['fallbackThunk']}, - {asOption: []}, - {asDefaultedOptionThunk: ['fallbackThunk']}, - {mergeWithThunk: ['baseThunk']} + { strict: [] }, + { defaultedThunk: ['fallbackThunk'] }, + { asOption: [] }, + { asDefaultedOptionThunk: ['fallbackThunk'] }, + { mergeWithThunk: ['baseThunk'] } ]); var defaulted = function (fallback) { - return adt.defaultedThunk(constant(fallback)); + return adt.defaultedThunk(constant(fallback)); }; var mergeWith = function (base) { - return adt.mergeWithThunk(constant(base)); + return adt.mergeWithThunk(constant(base)); }; var strict = adt.strict; var asOption = adt.asOption; @@ -1657,626 +1653,626 @@ var mergeWithThunk = adt.mergeWithThunk; var comparison = Adt.generate([ - { - bothErrors: [ - 'error1', - 'error2' - ] - }, - { - firstError: [ - 'error1', - 'value2' - ] - }, - { - secondError: [ - 'value1', - 'error2' - ] - }, - { - bothValues: [ - 'value1', - 'value2' - ] - } + { + bothErrors: [ + 'error1', + 'error2' + ] + }, + { + firstError: [ + 'error1', + 'value2' + ] + }, + { + secondError: [ + 'value1', + 'error2' + ] + }, + { + bothValues: [ + 'value1', + 'value2' + ] + } ]); var partition$1 = function (results) { - var errors = []; - var values = []; - each(results, function (result) { - result.fold(function (err) { - errors.push(err); - }, function (value) { - values.push(value); - }); + var errors = []; + var values = []; + each(results, function (result) { + result.fold(function (err) { + errors.push(err); + }, function (value) { + values.push(value); }); - return { - errors: errors, - values: values - }; + }); + return { + errors: errors, + values: values + }; }; var exclude = function (obj, fields) { - var r = {}; - each$1(obj, function (v, k) { - if (!contains(fields, k)) { - r[k] = v; - } - }); - return r; + var r = {}; + each$1(obj, function (v, k) { + if (!contains(fields, k)) { + r[k] = v; + } + }); + return r; }; var wrap = function (key, value) { - var _a; - return _a = {}, _a[key] = value, _a; + var _a; + return _a = {}, _a[key] = value, _a; }; var wrapAll = function (keyvalues) { - var r = {}; - each(keyvalues, function (kv) { - r[kv.key] = kv.value; - }); - return r; + var r = {}; + each(keyvalues, function (kv) { + r[kv.key] = kv.value; + }); + return r; }; var exclude$1 = function (obj, fields) { - return exclude(obj, fields); + return exclude(obj, fields); }; var wrap$1 = function (key, value) { - return wrap(key, value); + return wrap(key, value); }; var wrapAll$1 = function (keyvalues) { - return wrapAll(keyvalues); + return wrapAll(keyvalues); }; var mergeValues = function (values, base) { - return values.length === 0 ? Result.value(base) : Result.value(deepMerge(base, merge.apply(undefined, values))); + return values.length === 0 ? Result.value(base) : Result.value(deepMerge(base, merge.apply(undefined, values))); }; var mergeErrors = function (errors) { - return Result.error(flatten(errors)); + return Result.error(flatten(errors)); }; var consolidate = function (objs, base) { - var partitions = partition$1(objs); - return partitions.errors.length > 0 ? mergeErrors(partitions.errors) : mergeValues(partitions.values, base); + var partitions = partition$1(objs); + return partitions.errors.length > 0 ? mergeErrors(partitions.errors) : mergeValues(partitions.values, base); }; var mergeValues$1 = function (values, base) { - return values.length > 0 ? SimpleResult.svalue(deepMerge(base, merge.apply(undefined, values))) : SimpleResult.svalue(base); + return values.length > 0 ? SimpleResult.svalue(deepMerge(base, merge.apply(undefined, values))) : SimpleResult.svalue(base); }; var mergeErrors$1 = function (errors) { - return compose(SimpleResult.serror, flatten)(errors); + return compose(SimpleResult.serror, flatten)(errors); }; var consolidateObj = function (objects, base) { - var partition = SimpleResult.partition(objects); - return partition.errors.length > 0 ? mergeErrors$1(partition.errors) : mergeValues$1(partition.values, base); + var partition = SimpleResult.partition(objects); + return partition.errors.length > 0 ? mergeErrors$1(partition.errors) : mergeValues$1(partition.values, base); }; var consolidateArr = function (objects) { - var partitions = SimpleResult.partition(objects); - return partitions.errors.length > 0 ? mergeErrors$1(partitions.errors) : SimpleResult.svalue(partitions.values); + var partitions = SimpleResult.partition(objects); + return partitions.errors.length > 0 ? mergeErrors$1(partitions.errors) : SimpleResult.svalue(partitions.values); }; var ResultCombine = { - consolidateObj: consolidateObj, - consolidateArr: consolidateArr + consolidateObj: consolidateObj, + consolidateArr: consolidateArr }; var formatObj = function (input) { - return isObject(input) && keys(input).length > 100 ? ' removed due to size' : JSON.stringify(input, null, 2); + return isObject(input) && keys(input).length > 100 ? ' removed due to size' : JSON.stringify(input, null, 2); }; var formatErrors = function (errors) { - var es = errors.length > 10 ? errors.slice(0, 10).concat([{ - path: [], - getErrorInfo: function () { - return '... (only showing first ten failures)'; - } + var es = errors.length > 10 ? errors.slice(0, 10).concat([{ + path: [], + getErrorInfo: function () { + return '... (only showing first ten failures)'; + } }]) : errors; - return map(es, function (e) { - return 'Failed path: (' + e.path.join(' > ') + ')\n' + e.getErrorInfo(); - }); + return map(es, function (e) { + return 'Failed path: (' + e.path.join(' > ') + ')\n' + e.getErrorInfo(); + }); }; var nu$3 = function (path, getErrorInfo) { - return SimpleResult.serror([{ - path: path, - getErrorInfo: getErrorInfo + return SimpleResult.serror([{ + path: path, + getErrorInfo: getErrorInfo }]); }; var missingStrict = function (path, key, obj) { - return nu$3(path, function () { - return 'Could not find valid *strict* value for "' + key + '" in ' + formatObj(obj); - }); + return nu$3(path, function () { + return 'Could not find valid *strict* value for "' + key + '" in ' + formatObj(obj); + }); }; var missingKey = function (path, key) { - return nu$3(path, function () { - return 'Choice schema did not contain choice key: "' + key + '"'; - }); + return nu$3(path, function () { + return 'Choice schema did not contain choice key: "' + key + '"'; + }); }; var missingBranch = function (path, branches, branch) { - return nu$3(path, function () { - return 'The chosen schema: "' + branch + '" did not exist in branches: ' + formatObj(branches); - }); + return nu$3(path, function () { + return 'The chosen schema: "' + branch + '" did not exist in branches: ' + formatObj(branches); + }); }; var unsupportedFields = function (path, unsupported) { - return nu$3(path, function () { - return 'There are unsupported fields: [' + unsupported.join(', ') + '] specified'; - }); + return nu$3(path, function () { + return 'There are unsupported fields: [' + unsupported.join(', ') + '] specified'; + }); }; var custom = function (path, err) { - return nu$3(path, function () { - return err; - }); + return nu$3(path, function () { + return err; + }); }; var adt$1 = Adt.generate([ - { - field: [ - 'key', - 'okey', - 'presence', - 'prop' - ] - }, - { - state: [ - 'okey', - 'instantiator' - ] - } + { + field: [ + 'key', + 'okey', + 'presence', + 'prop' + ] + }, + { + state: [ + 'okey', + 'instantiator' + ] + } ]); var strictAccess = function (path, obj, key) { - return get$1(obj, key).fold(function () { - return missingStrict(path, key, obj); - }, SimpleResult.svalue); + return get$1(obj, key).fold(function () { + return missingStrict(path, key, obj); + }, SimpleResult.svalue); }; var fallbackAccess = function (obj, key, fallbackThunk) { - var v = get$1(obj, key).fold(function () { - return fallbackThunk(obj); - }, identity); - return SimpleResult.svalue(v); + var v = get$1(obj, key).fold(function () { + return fallbackThunk(obj); + }, identity); + return SimpleResult.svalue(v); }; var optionAccess = function (obj, key) { - return SimpleResult.svalue(get$1(obj, key)); + return SimpleResult.svalue(get$1(obj, key)); }; var optionDefaultedAccess = function (obj, key, fallback) { - var opt = get$1(obj, key).map(function (val) { - return val === true ? fallback(obj) : val; - }); - return SimpleResult.svalue(opt); + var opt = get$1(obj, key).map(function (val) { + return val === true ? fallback(obj) : val; + }); + return SimpleResult.svalue(opt); }; var cExtractOne = function (path, obj, field, strength) { - return field.fold(function (key, okey, presence, prop) { - var bundle = function (av) { - var result = prop.extract(path.concat([key]), strength, av); - return SimpleResult.map(result, function (res) { - return wrap(okey, strength(res)); - }); - }; - var bundleAsOption = function (optValue) { - return optValue.fold(function () { - var outcome = wrap(okey, strength(Optional.none())); - return SimpleResult.svalue(outcome); - }, function (ov) { - var result = prop.extract(path.concat([key]), strength, ov); - return SimpleResult.map(result, function (res) { - return wrap(okey, strength(Optional.some(res))); - }); - }); - }; - return function () { - return presence.fold(function () { - return SimpleResult.bind(strictAccess(path, obj, key), bundle); - }, function (fallbackThunk) { - return SimpleResult.bind(fallbackAccess(obj, key, fallbackThunk), bundle); - }, function () { - return SimpleResult.bind(optionAccess(obj, key), bundleAsOption); - }, function (fallbackThunk) { - return SimpleResult.bind(optionDefaultedAccess(obj, key, fallbackThunk), bundleAsOption); - }, function (baseThunk) { - var base = baseThunk(obj); - var result = SimpleResult.map(fallbackAccess(obj, key, constant({})), function (v) { - return deepMerge(base, v); - }); - return SimpleResult.bind(result, bundle); - }); - }(); - }, function (okey, instantiator) { - var state = instantiator(obj); - return SimpleResult.svalue(wrap(okey, strength(state))); - }); + return field.fold(function (key, okey, presence, prop) { + var bundle = function (av) { + var result = prop.extract(path.concat([key]), strength, av); + return SimpleResult.map(result, function (res) { + return wrap(okey, strength(res)); + }); + }; + var bundleAsOption = function (optValue) { + return optValue.fold(function () { + var outcome = wrap(okey, strength(Optional.none())); + return SimpleResult.svalue(outcome); + }, function (ov) { + var result = prop.extract(path.concat([key]), strength, ov); + return SimpleResult.map(result, function (res) { + return wrap(okey, strength(Optional.some(res))); + }); + }); + }; + return function () { + return presence.fold(function () { + return SimpleResult.bind(strictAccess(path, obj, key), bundle); + }, function (fallbackThunk) { + return SimpleResult.bind(fallbackAccess(obj, key, fallbackThunk), bundle); + }, function () { + return SimpleResult.bind(optionAccess(obj, key), bundleAsOption); + }, function (fallbackThunk) { + return SimpleResult.bind(optionDefaultedAccess(obj, key, fallbackThunk), bundleAsOption); + }, function (baseThunk) { + var base = baseThunk(obj); + var result = SimpleResult.map(fallbackAccess(obj, key, constant({})), function (v) { + return deepMerge(base, v); + }); + return SimpleResult.bind(result, bundle); + }); + }(); + }, function (okey, instantiator) { + var state = instantiator(obj); + return SimpleResult.svalue(wrap(okey, strength(state))); + }); }; var cExtract = function (path, obj, fields, strength) { - var results = map(fields, function (field) { - return cExtractOne(path, obj, field, strength); - }); - return ResultCombine.consolidateObj(results, {}); + var results = map(fields, function (field) { + return cExtractOne(path, obj, field, strength); + }); + return ResultCombine.consolidateObj(results, {}); }; var value$1 = function (validator) { - var extract = function (path, strength, val) { - return SimpleResult.bindError(validator(val, strength), function (err) { - return custom(path, err); - }); - }; - var toString = function () { - return 'val'; - }; - return { - extract: extract, - toString: toString - }; + var extract = function (path, strength, val) { + return SimpleResult.bindError(validator(val, strength), function (err) { + return custom(path, err); + }); + }; + var toString = function () { + return 'val'; + }; + return { + extract: extract, + toString: toString + }; }; var getSetKeys = function (obj) { - return keys(filter$1(obj, function (value) { - return value !== undefined && value !== null; - })); + return keys(filter$1(obj, function (value) { + return value !== undefined && value !== null; + })); }; var objOfOnly = function (fields) { - var delegate = objOf(fields); - var fieldNames = foldr(fields, function (acc, f) { - return f.fold(function (key) { - return deepMerge(acc, wrap$1(key, true)); - }, constant(acc)); - }, {}); - var extract = function (path, strength, o) { - var keys = isBoolean(o) ? [] : getSetKeys(o); - var extra = filter(keys, function (k) { - return !hasNonNullableKey(fieldNames, k); - }); - return extra.length === 0 ? delegate.extract(path, strength, o) : unsupportedFields(path, extra); - }; - return { - extract: extract, - toString: delegate.toString - }; + var delegate = objOf(fields); + var fieldNames = foldr(fields, function (acc, f) { + return f.fold(function (key) { + return deepMerge(acc, wrap$1(key, true)); + }, constant(acc)); + }, {}); + var extract = function (path, strength, o) { + var keys = isBoolean(o) ? [] : getSetKeys(o); + var extra = filter(keys, function (k) { + return !hasNonNullableKey(fieldNames, k); + }); + return extra.length === 0 ? delegate.extract(path, strength, o) : unsupportedFields(path, extra); + }; + return { + extract: extract, + toString: delegate.toString + }; }; var objOf = function (fields) { - var extract = function (path, strength, o) { - return cExtract(path, o, fields, strength); - }; - var toString = function () { - var fieldStrings = map(fields, function (field) { - return field.fold(function (key, okey, presence, prop) { - return key + ' -> ' + prop.toString(); - }, function (okey, _instantiator) { - return 'state(' + okey + ')'; - }); - }); - return 'obj{\n' + fieldStrings.join('\n') + '}'; - }; - return { - extract: extract, - toString: toString - }; + var extract = function (path, strength, o) { + return cExtract(path, o, fields, strength); + }; + var toString = function () { + var fieldStrings = map(fields, function (field) { + return field.fold(function (key, okey, presence, prop) { + return key + ' -> ' + prop.toString(); + }, function (okey, _instantiator) { + return 'state(' + okey + ')'; + }); + }); + return 'obj{\n' + fieldStrings.join('\n') + '}'; + }; + return { + extract: extract, + toString: toString + }; }; var arrOf = function (prop) { - var extract = function (path, strength, array) { - var results = map(array, function (a, i) { - return prop.extract(path.concat(['[' + i + ']']), strength, a); - }); - return ResultCombine.consolidateArr(results); - }; - var toString = function () { - return 'array(' + prop.toString() + ')'; - }; - return { - extract: extract, - toString: toString - }; + var extract = function (path, strength, array) { + var results = map(array, function (a, i) { + return prop.extract(path.concat(['[' + i + ']']), strength, a); + }); + return ResultCombine.consolidateArr(results); + }; + var toString = function () { + return 'array(' + prop.toString() + ')'; + }; + return { + extract: extract, + toString: toString + }; }; var setOf = function (validator, prop) { - var validateKeys = function (path, keys) { - return arrOf(value$1(validator)).extract(path, identity, keys); - }; - var extract = function (path, strength, o) { - var keys$1 = keys(o); - var validatedKeys = validateKeys(path, keys$1); - return SimpleResult.bind(validatedKeys, function (validKeys) { - var schema = map(validKeys, function (vk) { - return adt$1.field(vk, vk, strict(), prop); - }); - return objOf(schema).extract(path, strength, o); - }); - }; - var toString = function () { - return 'setOf(' + prop.toString() + ')'; - }; - return { - extract: extract, - toString: toString - }; + var validateKeys = function (path, keys) { + return arrOf(value$1(validator)).extract(path, identity, keys); + }; + var extract = function (path, strength, o) { + var keys$1 = keys(o); + var validatedKeys = validateKeys(path, keys$1); + return SimpleResult.bind(validatedKeys, function (validKeys) { + var schema = map(validKeys, function (vk) { + return adt$1.field(vk, vk, strict(), prop); + }); + return objOf(schema).extract(path, strength, o); + }); + }; + var toString = function () { + return 'setOf(' + prop.toString() + ')'; + }; + return { + extract: extract, + toString: toString + }; }; var anyValue = constant(value$1(SimpleResult.svalue)); var state = adt$1.state; var field = adt$1.field; var chooseFrom = function (path, strength, input, branches, ch) { - var fields = get$1(branches, ch); - return fields.fold(function () { - return missingBranch(path, branches, ch); - }, function (vp) { - return vp.extract(path.concat(['branch: ' + ch]), strength, input); - }); + var fields = get$1(branches, ch); + return fields.fold(function () { + return missingBranch(path, branches, ch); + }, function (vp) { + return vp.extract(path.concat(['branch: ' + ch]), strength, input); + }); }; var choose = function (key, branches) { - var extract = function (path, strength, input) { - var choice = get$1(input, key); - return choice.fold(function () { - return missingKey(path, key); - }, function (chosen) { - return chooseFrom(path, strength, input, branches, chosen); - }); - }; - var toString = function () { - return 'chooseOn(' + key + '). Possible values: ' + keys(branches); - }; - return { - extract: extract, - toString: toString - }; + var extract = function (path, strength, input) { + var choice = get$1(input, key); + return choice.fold(function () { + return missingKey(path, key); + }, function (chosen) { + return chooseFrom(path, strength, input, branches, chosen); + }); + }; + var toString = function () { + return 'chooseOn(' + key + '). Possible values: ' + keys(branches); + }; + return { + extract: extract, + toString: toString + }; }; var _anyValue = value$1(SimpleResult.svalue); var valueOf = function (validator) { - return value$1(function (v) { - return validator(v).fold(SimpleResult.serror, SimpleResult.svalue); - }); + return value$1(function (v) { + return validator(v).fold(SimpleResult.serror, SimpleResult.svalue); + }); }; var setOf$1 = function (validator, prop) { - return setOf(function (v) { - return SimpleResult.fromResult(validator(v)); - }, prop); + return setOf(function (v) { + return SimpleResult.fromResult(validator(v)); + }, prop); }; var extract = function (label, prop, strength, obj) { - var res = prop.extract([label], strength, obj); - return SimpleResult.mapError(res, function (errs) { - return { - input: obj, - errors: errs - }; - }); + var res = prop.extract([label], strength, obj); + return SimpleResult.mapError(res, function (errs) { + return { + input: obj, + errors: errs + }; + }); }; var asRaw = function (label, prop, obj) { - return SimpleResult.toResult(extract(label, prop, identity, obj)); + return SimpleResult.toResult(extract(label, prop, identity, obj)); }; var getOrDie = function (extraction) { - return extraction.fold(function (errInfo) { - throw new Error(formatError(errInfo)); - }, identity); + return extraction.fold(function (errInfo) { + throw new Error(formatError(errInfo)); + }, identity); }; var asRawOrDie = function (label, prop, obj) { - return getOrDie(asRaw(label, prop, obj)); + return getOrDie(asRaw(label, prop, obj)); }; var formatError = function (errInfo) { - return 'Errors: \n' + formatErrors(errInfo.errors).join('\n') + '\n\nInput object: ' + formatObj(errInfo.input); + return 'Errors: \n' + formatErrors(errInfo.errors).join('\n') + '\n\nInput object: ' + formatObj(errInfo.input); }; var choose$1 = function (key, branches) { - return choose(key, map$1(branches, objOf)); + return choose(key, map$1(branches, objOf)); }; var anyValue$1 = constant(_anyValue); var typedValue = function (validator, expectedType) { - return value$1(function (a) { - var actualType = typeof a; - return validator(a) ? SimpleResult.svalue(a) : SimpleResult.serror('Expected type: ' + expectedType + ' but got: ' + actualType); - }); + return value$1(function (a) { + var actualType = typeof a; + return validator(a) ? SimpleResult.svalue(a) : SimpleResult.serror('Expected type: ' + expectedType + ' but got: ' + actualType); + }); }; var functionProcessor = typedValue(isFunction, 'function'); var strict$1 = function (key) { - return field(key, key, strict(), anyValue()); + return field(key, key, strict(), anyValue()); }; var strictOf = function (key, schema) { - return field(key, key, strict(), schema); + return field(key, key, strict(), schema); }; var strictFunction = function (key) { - return strictOf(key, functionProcessor); + return strictOf(key, functionProcessor); }; var forbid = function (key, message) { - return field(key, key, asOption(), value$1(function (_v) { - return SimpleResult.serror('The field: ' + key + ' is forbidden. ' + message); - })); + return field(key, key, asOption(), value$1(function (_v) { + return SimpleResult.serror('The field: ' + key + ' is forbidden. ' + message); + })); }; var strictObjOf = function (key, objSchema) { - return field(key, key, strict(), objOf(objSchema)); + return field(key, key, strict(), objOf(objSchema)); }; var option = function (key) { - return field(key, key, asOption(), anyValue()); + return field(key, key, asOption(), anyValue()); }; var optionOf = function (key, schema) { - return field(key, key, asOption(), schema); + return field(key, key, asOption(), schema); }; var optionObjOf = function (key, objSchema) { - return optionOf(key, objOf(objSchema)); + return optionOf(key, objOf(objSchema)); }; var optionObjOfOnly = function (key, objSchema) { - return optionOf(key, objOfOnly(objSchema)); + return optionOf(key, objOfOnly(objSchema)); }; var defaulted$1 = function (key, fallback) { - return field(key, key, defaulted(fallback), anyValue()); + return field(key, key, defaulted(fallback), anyValue()); }; var defaultedOf = function (key, fallback, schema) { - return field(key, key, defaulted(fallback), schema); + return field(key, key, defaulted(fallback), schema); }; var defaultedFunction = function (key, fallback) { - return defaultedOf(key, fallback, functionProcessor); + return defaultedOf(key, fallback, functionProcessor); }; var defaultedObjOf = function (key, fallback, objSchema) { - return defaultedOf(key, fallback, objOf(objSchema)); + return defaultedOf(key, fallback, objOf(objSchema)); }; var state$1 = function (okey, instantiator) { - return state(okey, instantiator); + return state(okey, instantiator); }; var SwapSchema = [ - strict$1('alpha'), - strict$1('omega') + strict$1('alpha'), + strict$1('omega') ]; var ensureIsRoot = function (isRoot) { - return isFunction(isRoot) ? isRoot : never; + return isFunction(isRoot) ? isRoot : never; }; var ancestor = function (scope, transform, isRoot) { - var element = scope.dom; - var stop = ensureIsRoot(isRoot); - while (element.parentNode) { - element = element.parentNode; - var el = SugarElement.fromDom(element); - var transformed = transform(el); - if (transformed.isSome()) { - return transformed; - } else if (stop(el)) { - break; - } + var element = scope.dom; + var stop = ensureIsRoot(isRoot); + while (element.parentNode) { + element = element.parentNode; + var el = SugarElement.fromDom(element); + var transformed = transform(el); + if (transformed.isSome()) { + return transformed; + } else if (stop(el)) { + break; } - return Optional.none(); + } + return Optional.none(); }; var closest = function (scope, transform, isRoot) { - var current = transform(scope); - var stop = ensureIsRoot(isRoot); - return current.orThunk(function () { - return stop(scope) ? Optional.none() : ancestor(scope, transform, stop); - }); + var current = transform(scope); + var stop = ensureIsRoot(isRoot); + return current.orThunk(function () { + return stop(scope) ? Optional.none() : ancestor(scope, transform, stop); + }); }; var isSource = function (component, simulatedEvent) { - return eq(component.element, simulatedEvent.event.target); + return eq(component.element, simulatedEvent.event.target); }; var nu$4 = function (parts) { - if (!hasNonNullableKey(parts, 'can') && !hasNonNullableKey(parts, 'abort') && !hasNonNullableKey(parts, 'run')) { - throw new Error('EventHandler defined by: ' + JSON.stringify(parts, null, 2) + ' does not have can, abort, or run!'); - } - return asRawOrDie('Extracting event.handler', objOfOnly([ - defaulted$1('can', always), - defaulted$1('abort', never), - defaulted$1('run', noop) - ]), parts); + if (!hasNonNullableKey(parts, 'can') && !hasNonNullableKey(parts, 'abort') && !hasNonNullableKey(parts, 'run')) { + throw new Error('EventHandler defined by: ' + JSON.stringify(parts, null, 2) + ' does not have can, abort, or run!'); + } + return asRawOrDie('Extracting event.handler', objOfOnly([ + defaulted$1('can', always), + defaulted$1('abort', never), + defaulted$1('run', noop) + ]), parts); }; var all$1 = function (handlers, f) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return foldl(handlers, function (acc, handler) { - return acc && f(handler).apply(undefined, args); - }, true); - }; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return foldl(handlers, function (acc, handler) { + return acc && f(handler).apply(undefined, args); + }, true); + }; }; var any = function (handlers, f) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return foldl(handlers, function (acc, handler) { - return acc || f(handler).apply(undefined, args); - }, false); - }; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return foldl(handlers, function (acc, handler) { + return acc || f(handler).apply(undefined, args); + }, false); + }; }; var read$1 = function (handler) { - return isFunction(handler) ? { - can: constant(true), - abort: constant(false), - run: handler - } : handler; + return isFunction(handler) ? { + can: constant(true), + abort: constant(false), + run: handler + } : handler; }; var fuse = function (handlers) { - var can = all$1(handlers, function (handler) { - return handler.can; - }); - var abort = any(handlers, function (handler) { - return handler.abort; - }); - var run = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - each(handlers, function (handler) { - handler.run.apply(undefined, args); - }); - }; - return nu$4({ - can: can, - abort: abort, - run: run + var can = all$1(handlers, function (handler) { + return handler.can; + }); + var abort = any(handlers, function (handler) { + return handler.abort; + }); + var run = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + each(handlers, function (handler) { + handler.run.apply(undefined, args); }); + }; + return nu$4({ + can: can, + abort: abort, + run: run + }); }; var derive = function (configs) { - return wrapAll$1(configs); + return wrapAll$1(configs); }; var abort = function (name, predicate) { - return { - key: name, - value: nu$4({abort: predicate}) - }; + return { + key: name, + value: nu$4({ abort: predicate }) + }; }; var can = function (name, predicate) { - return { - key: name, - value: nu$4({can: predicate}) - }; + return { + key: name, + value: nu$4({ can: predicate }) + }; }; var run = function (name, handler) { - return { - key: name, - value: nu$4({run: handler}) - }; + return { + key: name, + value: nu$4({ run: handler }) + }; }; var runActionExtra = function (name, action, extra) { - return { - key: name, - value: nu$4({ - run: function (component, simulatedEvent) { - action.apply(undefined, [ - component, - simulatedEvent - ].concat(extra)); - } - }) - }; + return { + key: name, + value: nu$4({ + run: function (component, simulatedEvent) { + action.apply(undefined, [ + component, + simulatedEvent + ].concat(extra)); + } + }) + }; }; var runOnName = function (name) { - return function (handler) { - return run(name, handler); - }; + return function (handler) { + return run(name, handler); + }; }; var runOnSourceName = function (name) { - return function (handler) { - return { - key: name, - value: nu$4({ - run: function (component, simulatedEvent) { - if (isSource(component, simulatedEvent)) { - handler(component, simulatedEvent); - } - } - }) - }; + return function (handler) { + return { + key: name, + value: nu$4({ + run: function (component, simulatedEvent) { + if (isSource(component, simulatedEvent)) { + handler(component, simulatedEvent); + } + } + }) }; + }; }; var redirectToUid = function (name, uid) { - return run(name, function (component, simulatedEvent) { - component.getSystem().getByUid(uid).each(function (redirectee) { - dispatchEvent(redirectee, redirectee.element, name, simulatedEvent); - }); + return run(name, function (component, simulatedEvent) { + component.getSystem().getByUid(uid).each(function (redirectee) { + dispatchEvent(redirectee, redirectee.element, name, simulatedEvent); }); + }); }; var redirectToPart = function (name, detail, partName) { - var uid = detail.partUids[partName]; - return redirectToUid(name, uid); + var uid = detail.partUids[partName]; + return redirectToUid(name, uid); }; var cutter = function (name) { - return run(name, function (component, simulatedEvent) { - simulatedEvent.cut(); - }); + return run(name, function (component, simulatedEvent) { + simulatedEvent.cut(); + }); }; var stopper = function (name) { - return run(name, function (component, simulatedEvent) { - simulatedEvent.stop(); - }); + return run(name, function (component, simulatedEvent) { + simulatedEvent.stop(); + }); }; var runOnSource = function (name, f) { - return runOnSourceName(name)(f); + return runOnSourceName(name)(f); }; var runOnAttached = runOnSourceName(attachedToDom()); var runOnDetached = runOnSourceName(detachedFromDom()); @@ -2284,250 +2280,250 @@ var runOnExecute = runOnName(execute()); var markAsBehaviourApi = function (f, apiName, apiFunction) { - var delegate = apiFunction.toString(); - var endIndex = delegate.indexOf(')') + 1; - var openBracketIndex = delegate.indexOf('('); - var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\s*/); - f.toFunctionAnnotation = function () { - return { - name: apiName, - parameters: cleanParameters(parameters.slice(0, 1).concat(parameters.slice(3))) - }; + var delegate = apiFunction.toString(); + var endIndex = delegate.indexOf(')') + 1; + var openBracketIndex = delegate.indexOf('('); + var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\s*/); + f.toFunctionAnnotation = function () { + return { + name: apiName, + parameters: cleanParameters(parameters.slice(0, 1).concat(parameters.slice(3))) }; - return f; + }; + return f; }; var cleanParameters = function (parameters) { - return map(parameters, function (p) { - return endsWith(p, '/*') ? p.substring(0, p.length - '/*'.length) : p; - }); + return map(parameters, function (p) { + return endsWith(p, '/*') ? p.substring(0, p.length - '/*'.length) : p; + }); }; var markAsExtraApi = function (f, extraName) { - var delegate = f.toString(); - var endIndex = delegate.indexOf(')') + 1; - var openBracketIndex = delegate.indexOf('('); - var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\s*/); - f.toFunctionAnnotation = function () { - return { - name: extraName, - parameters: cleanParameters(parameters) - }; + var delegate = f.toString(); + var endIndex = delegate.indexOf(')') + 1; + var openBracketIndex = delegate.indexOf('('); + var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\s*/); + f.toFunctionAnnotation = function () { + return { + name: extraName, + parameters: cleanParameters(parameters) }; - return f; + }; + return f; }; var markAsSketchApi = function (f, apiFunction) { - var delegate = apiFunction.toString(); - var endIndex = delegate.indexOf(')') + 1; - var openBracketIndex = delegate.indexOf('('); - var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\s*/); - f.toFunctionAnnotation = function () { - return { - name: 'OVERRIDE', - parameters: cleanParameters(parameters.slice(1)) - }; + var delegate = apiFunction.toString(); + var endIndex = delegate.indexOf(')') + 1; + var openBracketIndex = delegate.indexOf('('); + var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\s*/); + f.toFunctionAnnotation = function () { + return { + name: 'OVERRIDE', + parameters: cleanParameters(parameters.slice(1)) }; - return f; + }; + return f; }; var nu$5 = function (s) { - return { - classes: s.classes !== undefined ? s.classes : [], - attributes: s.attributes !== undefined ? s.attributes : {}, - styles: s.styles !== undefined ? s.styles : {} - }; + return { + classes: s.classes !== undefined ? s.classes : [], + attributes: s.attributes !== undefined ? s.attributes : {}, + styles: s.styles !== undefined ? s.styles : {} + }; }; var merge$1 = function (defnA, mod) { - return __assign(__assign({}, defnA), { - attributes: __assign(__assign({}, defnA.attributes), mod.attributes), - styles: __assign(__assign({}, defnA.styles), mod.styles), - classes: defnA.classes.concat(mod.classes) - }); + return __assign(__assign({}, defnA), { + attributes: __assign(__assign({}, defnA.attributes), mod.attributes), + styles: __assign(__assign({}, defnA.styles), mod.styles), + classes: defnA.classes.concat(mod.classes) + }); }; var executeEvent = function (bConfig, bState, executor) { - return runOnExecute(function (component) { - executor(component, bConfig, bState); - }); + return runOnExecute(function (component) { + executor(component, bConfig, bState); + }); }; var loadEvent = function (bConfig, bState, f) { - return runOnInit(function (component, _simulatedEvent) { - f(component, bConfig, bState); - }); + return runOnInit(function (component, _simulatedEvent) { + f(component, bConfig, bState); + }); }; var create = function (schema, name, active, apis, extra, state) { - var configSchema = objOfOnly(schema); - var schemaSchema = optionObjOf(name, [optionObjOfOnly('config', schema)]); - return doCreate(configSchema, schemaSchema, name, active, apis, extra, state); + var configSchema = objOfOnly(schema); + var schemaSchema = optionObjOf(name, [optionObjOfOnly('config', schema)]); + return doCreate(configSchema, schemaSchema, name, active, apis, extra, state); }; var createModes = function (modes, name, active, apis, extra, state) { - var configSchema = modes; - var schemaSchema = optionObjOf(name, [optionOf('config', modes)]); - return doCreate(configSchema, schemaSchema, name, active, apis, extra, state); + var configSchema = modes; + var schemaSchema = optionObjOf(name, [optionOf('config', modes)]); + return doCreate(configSchema, schemaSchema, name, active, apis, extra, state); }; var wrapApi = function (bName, apiFunction, apiName) { - var f = function (component) { - var rest = []; - for (var _i = 1; _i < arguments.length; _i++) { - rest[_i - 1] = arguments[_i]; - } - var args = [component].concat(rest); - return component.config({name: constant(bName)}).fold(function () { - throw new Error('We could not find any behaviour configuration for: ' + bName + '. Using API: ' + apiName); - }, function (info) { - var rest = Array.prototype.slice.call(args, 1); - return apiFunction.apply(undefined, [ - component, - info.config, - info.state - ].concat(rest)); - }); - }; - return markAsBehaviourApi(f, apiName, apiFunction); + var f = function (component) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + var args = [component].concat(rest); + return component.config({ name: constant(bName) }).fold(function () { + throw new Error('We could not find any behaviour configuration for: ' + bName + '. Using API: ' + apiName); + }, function (info) { + var rest = Array.prototype.slice.call(args, 1); + return apiFunction.apply(undefined, [ + component, + info.config, + info.state + ].concat(rest)); + }); + }; + return markAsBehaviourApi(f, apiName, apiFunction); }; var revokeBehaviour = function (name) { - return { - key: name, - value: undefined - }; + return { + key: name, + value: undefined + }; }; var doCreate = function (configSchema, schemaSchema, name, active, apis, extra, state) { - var getConfig = function (info) { - return hasNonNullableKey(info, name) ? info[name]() : Optional.none(); - }; - var wrappedApis = map$1(apis, function (apiF, apiName) { - return wrapApi(name, apiF, apiName); - }); - var wrappedExtra = map$1(extra, function (extraF, extraName) { - return markAsExtraApi(extraF, extraName); - }); - var me = __assign(__assign(__assign({}, wrappedExtra), wrappedApis), { - revoke: curry(revokeBehaviour, name), - config: function (spec) { - var prepared = asRawOrDie(name + '-config', configSchema, spec); - return { - key: name, - value: { - config: prepared, - me: me, - configAsRaw: cached(function () { - return asRawOrDie(name + '-config', configSchema, spec); - }), - initialConfig: spec, - state: state - } - }; - }, - schema: function () { - return schemaSchema; - }, - exhibit: function (info, base) { - return getConfig(info).bind(function (behaviourInfo) { - return get$1(active, 'exhibit').map(function (exhibitor) { - return exhibitor(base, behaviourInfo.config, behaviourInfo.state); - }); - }).getOr(nu$5({})); - }, - name: function () { - return name; - }, - handlers: function (info) { - return getConfig(info).map(function (behaviourInfo) { - var getEvents = get$1(active, 'events').getOr(function () { - return {}; - }); - return getEvents(behaviourInfo.config, behaviourInfo.state); - }).getOr({}); - } - }); - return me; + var getConfig = function (info) { + return hasNonNullableKey(info, name) ? info[name]() : Optional.none(); + }; + var wrappedApis = map$1(apis, function (apiF, apiName) { + return wrapApi(name, apiF, apiName); + }); + var wrappedExtra = map$1(extra, function (extraF, extraName) { + return markAsExtraApi(extraF, extraName); + }); + var me = __assign(__assign(__assign({}, wrappedExtra), wrappedApis), { + revoke: curry(revokeBehaviour, name), + config: function (spec) { + var prepared = asRawOrDie(name + '-config', configSchema, spec); + return { + key: name, + value: { + config: prepared, + me: me, + configAsRaw: cached(function () { + return asRawOrDie(name + '-config', configSchema, spec); + }), + initialConfig: spec, + state: state + } + }; + }, + schema: function () { + return schemaSchema; + }, + exhibit: function (info, base) { + return getConfig(info).bind(function (behaviourInfo) { + return get$1(active, 'exhibit').map(function (exhibitor) { + return exhibitor(base, behaviourInfo.config, behaviourInfo.state); + }); + }).getOr(nu$5({})); + }, + name: function () { + return name; + }, + handlers: function (info) { + return getConfig(info).map(function (behaviourInfo) { + var getEvents = get$1(active, 'events').getOr(function () { + return {}; + }); + return getEvents(behaviourInfo.config, behaviourInfo.state); + }).getOr({}); + } + }); + return me; }; var NoState = { - init: function () { - return nu$6({ - readState: function () { - return 'No State required'; - } - }); - } + init: function () { + return nu$6({ + readState: function () { + return 'No State required'; + } + }); + } }; var nu$6 = function (spec) { - return spec; + return spec; }; var derive$1 = function (capabilities) { - return wrapAll$1(capabilities); + return wrapAll$1(capabilities); }; var simpleSchema = objOfOnly([ - strict$1('fields'), - strict$1('name'), - defaulted$1('active', {}), - defaulted$1('apis', {}), - defaulted$1('state', NoState), - defaulted$1('extra', {}) + strict$1('fields'), + strict$1('name'), + defaulted$1('active', {}), + defaulted$1('apis', {}), + defaulted$1('state', NoState), + defaulted$1('extra', {}) ]); var create$1 = function (data) { - var value = asRawOrDie('Creating behaviour: ' + data.name, simpleSchema, data); - return create(value.fields, value.name, value.active, value.apis, value.extra, value.state); + var value = asRawOrDie('Creating behaviour: ' + data.name, simpleSchema, data); + return create(value.fields, value.name, value.active, value.apis, value.extra, value.state); }; var modeSchema = objOfOnly([ - strict$1('branchKey'), - strict$1('branches'), - strict$1('name'), - defaulted$1('active', {}), - defaulted$1('apis', {}), - defaulted$1('state', NoState), - defaulted$1('extra', {}) + strict$1('branchKey'), + strict$1('branches'), + strict$1('name'), + defaulted$1('active', {}), + defaulted$1('apis', {}), + defaulted$1('state', NoState), + defaulted$1('extra', {}) ]); var createModes$1 = function (data) { - var value = asRawOrDie('Creating behaviour: ' + data.name, modeSchema, data); - return createModes(choose$1(value.branchKey, value.branches), value.name, value.active, value.apis, value.extra, value.state); + var value = asRawOrDie('Creating behaviour: ' + data.name, modeSchema, data); + return createModes(choose$1(value.branchKey, value.branches), value.name, value.active, value.apis, value.extra, value.state); }; var revoke = constant(undefined); var Swapping = create$1({ - fields: SwapSchema, - name: 'swapping', - apis: SwapApis + fields: SwapSchema, + name: 'swapping', + apis: SwapApis }); var Cell = function (initial) { - var value = initial; - var get = function () { - return value; - }; - var set = function (v) { - value = v; - }; - return { - get: get, - set: set - }; + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; }; var getDocument = function () { - return SugarElement.fromDom(document); + return SugarElement.fromDom(document); }; var focus$1 = function (element) { - return element.dom.focus(); + return element.dom.focus(); }; var blur = function (element) { - return element.dom.blur(); + return element.dom.blur(); }; var hasFocus = function (element) { - var root = getRootNode(element).dom; - return element.dom === root.activeElement; + var root = getRootNode(element).dom; + return element.dom === root.activeElement; }; var active = function (root) { - if (root === void 0) { - root = getDocument(); - } - return Optional.from(root.dom.activeElement).map(SugarElement.fromDom); + if (root === void 0) { + root = getDocument(); + } + return Optional.from(root.dom.activeElement).map(SugarElement.fromDom); }; var search = function (element) { - return active(getRootNode(element)).filter(function (e) { - return element.dom.contains(e.dom); - }); + return active(getRootNode(element)).filter(function (e) { + return element.dom.contains(e.dom); + }); }; var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); @@ -2535,158 +2531,158 @@ var global$2 = tinymce.util.Tools.resolve('tinymce.ThemeManager'); var openLink = function (target) { - var link = document.createElement('a'); - link.target = '_blank'; - link.href = target.href; - link.rel = 'noreferrer noopener'; - var nuEvt = document.createEvent('MouseEvents'); - nuEvt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); - document.body.appendChild(link); - link.dispatchEvent(nuEvt); - document.body.removeChild(link); + var link = document.createElement('a'); + link.target = '_blank'; + link.href = target.href; + link.rel = 'noreferrer noopener'; + var nuEvt = document.createEvent('MouseEvents'); + nuEvt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); + document.body.appendChild(link); + link.dispatchEvent(nuEvt); + document.body.removeChild(link); }; var DefaultStyleFormats = [ - { - title: 'Headings', - items: [ - { - title: 'Heading 1', - format: 'h1' - }, - { - title: 'Heading 2', - format: 'h2' - }, - { - title: 'Heading 3', - format: 'h3' - }, - { - title: 'Heading 4', - format: 'h4' - }, - { - title: 'Heading 5', - format: 'h5' - }, - { - title: 'Heading 6', - format: 'h6' - } - ] - }, - { - title: 'Inline', - items: [ - { - title: 'Bold', - icon: 'bold', - format: 'bold' - }, - { - title: 'Italic', - icon: 'italic', - format: 'italic' - }, - { - title: 'Underline', - icon: 'underline', - format: 'underline' - }, - { - title: 'Strikethrough', - icon: 'strikethrough', - format: 'strikethrough' - }, - { - title: 'Superscript', - icon: 'superscript', - format: 'superscript' - }, - { - title: 'Subscript', - icon: 'subscript', - format: 'subscript' - }, - { - title: 'Code', - icon: 'code', - format: 'code' - } - ] - }, - { - title: 'Blocks', - items: [ - { - title: 'Paragraph', - format: 'p' - }, - { - title: 'Blockquote', - format: 'blockquote' - }, - { - title: 'Div', - format: 'div' - }, - { - title: 'Pre', - format: 'pre' - } - ] - }, - { - title: 'Alignment', - items: [ - { - title: 'Left', - icon: 'alignleft', - format: 'alignleft' - }, - { - title: 'Center', - icon: 'aligncenter', - format: 'aligncenter' - }, - { - title: 'Right', - icon: 'alignright', - format: 'alignright' - }, - { - title: 'Justify', - icon: 'alignjustify', - format: 'alignjustify' - } - ] - } + { + title: 'Headings', + items: [ + { + title: 'Heading 1', + format: 'h1' + }, + { + title: 'Heading 2', + format: 'h2' + }, + { + title: 'Heading 3', + format: 'h3' + }, + { + title: 'Heading 4', + format: 'h4' + }, + { + title: 'Heading 5', + format: 'h5' + }, + { + title: 'Heading 6', + format: 'h6' + } + ] + }, + { + title: 'Inline', + items: [ + { + title: 'Bold', + icon: 'bold', + format: 'bold' + }, + { + title: 'Italic', + icon: 'italic', + format: 'italic' + }, + { + title: 'Underline', + icon: 'underline', + format: 'underline' + }, + { + title: 'Strikethrough', + icon: 'strikethrough', + format: 'strikethrough' + }, + { + title: 'Superscript', + icon: 'superscript', + format: 'superscript' + }, + { + title: 'Subscript', + icon: 'subscript', + format: 'subscript' + }, + { + title: 'Code', + icon: 'code', + format: 'code' + } + ] + }, + { + title: 'Blocks', + items: [ + { + title: 'Paragraph', + format: 'p' + }, + { + title: 'Blockquote', + format: 'blockquote' + }, + { + title: 'Div', + format: 'div' + }, + { + title: 'Pre', + format: 'pre' + } + ] + }, + { + title: 'Alignment', + items: [ + { + title: 'Left', + icon: 'alignleft', + format: 'alignleft' + }, + { + title: 'Center', + icon: 'aligncenter', + format: 'aligncenter' + }, + { + title: 'Right', + icon: 'alignright', + format: 'alignright' + }, + { + title: 'Justify', + icon: 'alignjustify', + format: 'alignjustify' + } + ] + } ]; var defaults = [ - 'undo', - 'bold', - 'italic', - 'link', - 'image', - 'bullist', - 'styleselect' + 'undo', + 'bold', + 'italic', + 'link', + 'image', + 'bullist', + 'styleselect' ]; var isSkinDisabled = function (editor) { - return editor.getParam('skin') === false; + return editor.getParam('skin') === false; }; var readOnlyOnInit = function (_editor) { - return false; + return false; }; var getToolbar = function (editor) { - return editor.getParam('toolbar', defaults, 'array'); + return editor.getParam('toolbar', defaults, 'array'); }; var getStyleFormats = function (editor) { - return editor.getParam('style_formats', DefaultStyleFormats, 'array'); + return editor.getParam('style_formats', DefaultStyleFormats, 'array'); }; var getSkinUrl = function (editor) { - return editor.getParam('skin_url'); + return editor.getParam('skin_url'); }; var formatChanged = 'formatChanged'; @@ -2694,64 +2690,64 @@ var dropupDismissed = 'dropupDismissed'; var fromHtml$1 = function (html, scope) { - var doc = scope || document; - var div = doc.createElement('div'); - div.innerHTML = html; - return children(SugarElement.fromDom(div)); + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + return children(SugarElement.fromDom(div)); }; var get$4 = function (element) { - return element.dom.innerHTML; + return element.dom.innerHTML; }; var set$1 = function (element, content) { - var owner$1 = owner(element); - var docDom = owner$1.dom; - var fragment = SugarElement.fromDom(docDom.createDocumentFragment()); - var contentElements = fromHtml$1(content, docDom); - append$1(fragment, contentElements); - empty(element); - append(element, fragment); + var owner$1 = owner(element); + var docDom = owner$1.dom; + var fragment = SugarElement.fromDom(docDom.createDocumentFragment()); + var contentElements = fromHtml$1(content, docDom); + append$1(fragment, contentElements); + empty(element); + append(element, fragment); }; var getOuter = function (element) { - var container = SugarElement.fromTag('div'); - var clone = SugarElement.fromDom(element.dom.cloneNode(true)); - append(container, clone); - return get$4(container); + var container = SugarElement.fromTag('div'); + var clone = SugarElement.fromDom(element.dom.cloneNode(true)); + append(container, clone); + return get$4(container); }; var clone = function (original, isDeep) { - return SugarElement.fromDom(original.dom.cloneNode(isDeep)); + return SugarElement.fromDom(original.dom.cloneNode(isDeep)); }; var shallow$1 = function (original) { - return clone(original, false); + return clone(original, false); }; var getHtml = function (element) { - var clone = shallow$1(element); - return getOuter(clone); + var clone = shallow$1(element); + return getOuter(clone); }; var element = function (elem) { - return getHtml(elem); + return getHtml(elem); }; var chooseChannels = function (channels, message) { - return message.universal ? channels : filter(channels, function (ch) { - return contains(message.channels, ch); - }); + return message.universal ? channels : filter(channels, function (ch) { + return contains(message.channels, ch); + }); }; var events = function (receiveConfig) { - return derive([run(receive(), function (component, message) { - var channelMap = receiveConfig.channels; - var channels = keys(channelMap); - var receivingData = message; - var targetChannels = chooseChannels(channels, receivingData); - each(targetChannels, function (ch) { - var channelInfo = channelMap[ch]; - var channelSchema = channelInfo.schema; - var data = asRawOrDie('channel[' + ch + '] data\nReceiver: ' + element(component.element), channelSchema, receivingData.data); - channelInfo.onReceive(component, data); - }); + return derive([run(receive(), function (component, message) { + var channelMap = receiveConfig.channels; + var channels = keys(channelMap); + var receivingData = message; + var targetChannels = chooseChannels(channels, receivingData); + each(targetChannels, function (ch) { + var channelInfo = channelMap[ch]; + var channelSchema = channelInfo.schema; + var data = asRawOrDie('channel[' + ch + '] data\nReceiver: ' + element(component.element), channelSchema, receivingData.data); + channelInfo.onReceive(component, data); + }); })]); }; @@ -2763,255 +2759,255 @@ var unknown$3 = 'unknown'; var EventConfiguration; (function (EventConfiguration) { - EventConfiguration[EventConfiguration['STOP'] = 0] = 'STOP'; - EventConfiguration[EventConfiguration['NORMAL'] = 1] = 'NORMAL'; - EventConfiguration[EventConfiguration['LOGGING'] = 2] = 'LOGGING'; + EventConfiguration[EventConfiguration['STOP'] = 0] = 'STOP'; + EventConfiguration[EventConfiguration['NORMAL'] = 1] = 'NORMAL'; + EventConfiguration[EventConfiguration['LOGGING'] = 2] = 'LOGGING'; }(EventConfiguration || (EventConfiguration = {}))); var eventConfig = Cell({}); var makeEventLogger = function (eventName, initialTarget) { - var sequence = []; - var startTime = new Date().getTime(); - return { - logEventCut: function (_name, target, purpose) { - sequence.push({ - outcome: 'cut', - target: target, - purpose: purpose - }); - }, - logEventStopped: function (_name, target, purpose) { - sequence.push({ - outcome: 'stopped', - target: target, - purpose: purpose - }); - }, - logNoParent: function (_name, target, purpose) { - sequence.push({ - outcome: 'no-parent', - target: target, - purpose: purpose - }); - }, - logEventNoHandlers: function (_name, target) { - sequence.push({ - outcome: 'no-handlers-left', - target: target - }); - }, - logEventResponse: function (_name, target, purpose) { - sequence.push({ - outcome: 'response', - purpose: purpose, - target: target - }); - }, - write: function () { - var finishTime = new Date().getTime(); - if (contains([ - 'mousemove', - 'mouseover', - 'mouseout', - systemInit() - ], eventName)) { - return; - } - console.log(eventName, { - event: eventName, - time: finishTime - startTime, - target: initialTarget.dom, - sequence: map(sequence, function (s) { - if (!contains([ - 'cut', - 'stopped', - 'response' - ], s.outcome)) { - return s.outcome; - } else { - return '{' + s.purpose + '} ' + s.outcome + ' at (' + element(s.target) + ')'; - } - }) - }); - } - }; + var sequence = []; + var startTime = new Date().getTime(); + return { + logEventCut: function (_name, target, purpose) { + sequence.push({ + outcome: 'cut', + target: target, + purpose: purpose + }); + }, + logEventStopped: function (_name, target, purpose) { + sequence.push({ + outcome: 'stopped', + target: target, + purpose: purpose + }); + }, + logNoParent: function (_name, target, purpose) { + sequence.push({ + outcome: 'no-parent', + target: target, + purpose: purpose + }); + }, + logEventNoHandlers: function (_name, target) { + sequence.push({ + outcome: 'no-handlers-left', + target: target + }); + }, + logEventResponse: function (_name, target, purpose) { + sequence.push({ + outcome: 'response', + purpose: purpose, + target: target + }); + }, + write: function () { + var finishTime = new Date().getTime(); + if (contains([ + 'mousemove', + 'mouseover', + 'mouseout', + systemInit() + ], eventName)) { + return; + } + console.log(eventName, { + event: eventName, + time: finishTime - startTime, + target: initialTarget.dom, + sequence: map(sequence, function (s) { + if (!contains([ + 'cut', + 'stopped', + 'response' + ], s.outcome)) { + return s.outcome; + } else { + return '{' + s.purpose + '} ' + s.outcome + ' at (' + element(s.target) + ')'; + } + }) + }); + } + }; }; var processEvent = function (eventName, initialTarget, f) { - var status = get$1(eventConfig.get(), eventName).orThunk(function () { - var patterns = keys(eventConfig.get()); - return findMap(patterns, function (p) { - return eventName.indexOf(p) > -1 ? Optional.some(eventConfig.get()[p]) : Optional.none(); - }); - }).getOr(EventConfiguration.NORMAL); - switch (status) { - case EventConfiguration.NORMAL: - return f(noLogger()); - case EventConfiguration.LOGGING: { - var logger = makeEventLogger(eventName, initialTarget); - var output = f(logger); - logger.write(); - return output; - } - case EventConfiguration.STOP: - return true; + var status = get$1(eventConfig.get(), eventName).orThunk(function () { + var patterns = keys(eventConfig.get()); + return findMap(patterns, function (p) { + return eventName.indexOf(p) > -1 ? Optional.some(eventConfig.get()[p]) : Optional.none(); + }); + }).getOr(EventConfiguration.NORMAL); + switch (status) { + case EventConfiguration.NORMAL: + return f(noLogger()); + case EventConfiguration.LOGGING: { + var logger = makeEventLogger(eventName, initialTarget); + var output = f(logger); + logger.write(); + return output; } + case EventConfiguration.STOP: + return true; + } }; var path = [ - 'alloy/data/Fields', - 'alloy/debugging/Debugging' + 'alloy/data/Fields', + 'alloy/debugging/Debugging' ]; var getTrace = function () { - var err = new Error(); - if (err.stack !== undefined) { - var lines = err.stack.split('\n'); - return find(lines, function (line) { - return line.indexOf('alloy') > 0 && !exists(path, function (p) { - return line.indexOf(p) > -1; - }); - }).getOr(unknown$3); - } else { - return unknown$3; - } + var err = new Error(); + if (err.stack !== undefined) { + var lines = err.stack.split('\n'); + return find(lines, function (line) { + return line.indexOf('alloy') > 0 && !exists(path, function (p) { + return line.indexOf(p) > -1; + }); + }).getOr(unknown$3); + } else { + return unknown$3; + } }; var ignoreEvent = { - logEventCut: noop, - logEventStopped: noop, - logNoParent: noop, - logEventNoHandlers: noop, - logEventResponse: noop, - write: noop + logEventCut: noop, + logEventStopped: noop, + logNoParent: noop, + logEventNoHandlers: noop, + logEventResponse: noop, + write: noop }; var monitorEvent = function (eventName, initialTarget, f) { - return processEvent(eventName, initialTarget, f); + return processEvent(eventName, initialTarget, f); }; var noLogger = constant(ignoreEvent); var menuFields = constant([ - strict$1('menu'), - strict$1('selectedMenu') + strict$1('menu'), + strict$1('selectedMenu') ]); var itemFields = constant([ - strict$1('item'), - strict$1('selectedItem') + strict$1('item'), + strict$1('selectedItem') ]); var schema = constant(objOf(itemFields().concat(menuFields()))); var itemSchema = constant(objOf(itemFields())); var _initSize = strictObjOf('initSize', [ - strict$1('numColumns'), - strict$1('numRows') + strict$1('numColumns'), + strict$1('numRows') ]); var itemMarkers = function () { - return strictOf('markers', itemSchema()); + return strictOf('markers', itemSchema()); }; var tieredMenuMarkers = function () { - return strictObjOf('markers', [strict$1('backgroundMenu')].concat(menuFields()).concat(itemFields())); + return strictObjOf('markers', [strict$1('backgroundMenu')].concat(menuFields()).concat(itemFields())); }; var markers = function (required) { - return strictObjOf('markers', map(required, strict$1)); + return strictObjOf('markers', map(required, strict$1)); }; var onPresenceHandler = function (label, fieldName, presence) { - var trace = getTrace(); - return field(fieldName, fieldName, presence, valueOf(function (f) { - return Result.value(function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return f.apply(undefined, args); - }); - })); + var trace = getTrace(); + return field(fieldName, fieldName, presence, valueOf(function (f) { + return Result.value(function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return f.apply(undefined, args); + }); + })); }; var onHandler = function (fieldName) { - return onPresenceHandler('onHandler', fieldName, defaulted(noop)); + return onPresenceHandler('onHandler', fieldName, defaulted(noop)); }; var onKeyboardHandler = function (fieldName) { - return onPresenceHandler('onKeyboardHandler', fieldName, defaulted(Optional.none)); + return onPresenceHandler('onKeyboardHandler', fieldName, defaulted(Optional.none)); }; var onStrictHandler = function (fieldName) { - return onPresenceHandler('onHandler', fieldName, strict()); + return onPresenceHandler('onHandler', fieldName, strict()); }; var onStrictKeyboardHandler = function (fieldName) { - return onPresenceHandler('onKeyboardHandler', fieldName, strict()); + return onPresenceHandler('onKeyboardHandler', fieldName, strict()); }; var output = function (name, value) { - return state$1(name, constant(value)); + return state$1(name, constant(value)); }; var snapshot = function (name) { - return state$1(name, identity); + return state$1(name, identity); }; var initSize = constant(_initSize); var ReceivingSchema = [strictOf('channels', setOf$1(Result.value, objOfOnly([ onStrictHandler('onReceive'), defaulted$1('schema', anyValue$1()) - ])))]; + ])))]; var Receiving = create$1({ - fields: ReceivingSchema, - name: 'receiving', - active: ActiveReceiving + fields: ReceivingSchema, + name: 'receiving', + active: ActiveReceiving }); var SetupBehaviourCellState = function (initialState) { - var init = function () { - var cell = Cell(initialState); - var get = function () { - return cell.get(); - }; - var set = function (newState) { - return cell.set(newState); - }; - var clear = function () { - return cell.set(initialState); - }; - var readState = function () { - return cell.get(); - }; - return { - get: get, - set: set, - clear: clear, - readState: readState - }; + var init = function () { + var cell = Cell(initialState); + var get = function () { + return cell.get(); + }; + var set = function (newState) { + return cell.set(newState); + }; + var clear = function () { + return cell.set(initialState); + }; + var readState = function () { + return cell.get(); + }; + return { + get: get, + set: set, + clear: clear, + readState: readState }; - return {init: init}; + }; + return { init: init }; }; var updateAriaState = function (component, toggleConfig, toggleState) { - var ariaInfo = toggleConfig.aria; - ariaInfo.update(component, ariaInfo, toggleState.get()); + var ariaInfo = toggleConfig.aria; + ariaInfo.update(component, ariaInfo, toggleState.get()); }; var updateClass = function (component, toggleConfig, toggleState) { - toggleConfig.toggleClass.each(function (toggleClass) { - if (toggleState.get()) { - add$2(component.element, toggleClass); - } else { - remove$4(component.element, toggleClass); - } - }); + toggleConfig.toggleClass.each(function (toggleClass) { + if (toggleState.get()) { + add$2(component.element, toggleClass); + } else { + remove$4(component.element, toggleClass); + } + }); }; var toggle = function (component, toggleConfig, toggleState) { - set$2(component, toggleConfig, toggleState, !toggleState.get()); + set$2(component, toggleConfig, toggleState, !toggleState.get()); }; var on = function (component, toggleConfig, toggleState) { - toggleState.set(true); - updateClass(component, toggleConfig, toggleState); - updateAriaState(component, toggleConfig, toggleState); + toggleState.set(true); + updateClass(component, toggleConfig, toggleState); + updateAriaState(component, toggleConfig, toggleState); }; var off = function (component, toggleConfig, toggleState) { - toggleState.set(false); - updateClass(component, toggleConfig, toggleState); - updateAriaState(component, toggleConfig, toggleState); + toggleState.set(false); + updateClass(component, toggleConfig, toggleState); + updateAriaState(component, toggleConfig, toggleState); }; var set$2 = function (component, toggleConfig, toggleState, state) { - var action = state ? on : off; - action(component, toggleConfig, toggleState); + var action = state ? on : off; + action(component, toggleConfig, toggleState); }; var isOn = function (component, toggleConfig, toggleState) { - return toggleState.get(); + return toggleState.get(); }; var onLoad = function (component, toggleConfig, toggleState) { - set$2(component, toggleConfig, toggleState, toggleConfig.selected); + set$2(component, toggleConfig, toggleState, toggleConfig.selected); }; var ToggleApis = /*#__PURE__*/Object.freeze({ @@ -3025,15 +3021,15 @@ }); var exhibit = function () { - return nu$5({}); + return nu$5({}); }; var events$1 = function (toggleConfig, toggleState) { - var execute = executeEvent(toggleConfig, toggleState, toggle); - var load = loadEvent(toggleConfig, toggleState, onLoad); - return derive(flatten([ - toggleConfig.toggleOnExecute ? [execute] : [], - [load] - ])); + var execute = executeEvent(toggleConfig, toggleState, toggle); + var load = loadEvent(toggleConfig, toggleState, onLoad); + return derive(flatten([ + toggleConfig.toggleOnExecute ? [execute] : [], + [load] + ])); }; var ActiveToggle = /*#__PURE__*/Object.freeze({ @@ -3043,109 +3039,109 @@ }); var updatePressed = function (component, ariaInfo, status) { - set(component.element, 'aria-pressed', status); - if (ariaInfo.syncWithExpanded) { - updateExpanded(component, ariaInfo, status); - } + set(component.element, 'aria-pressed', status); + if (ariaInfo.syncWithExpanded) { + updateExpanded(component, ariaInfo, status); + } }; var updateSelected = function (component, ariaInfo, status) { - set(component.element, 'aria-selected', status); + set(component.element, 'aria-selected', status); }; var updateChecked = function (component, ariaInfo, status) { - set(component.element, 'aria-checked', status); + set(component.element, 'aria-checked', status); }; var updateExpanded = function (component, ariaInfo, status) { - set(component.element, 'aria-expanded', status); + set(component.element, 'aria-expanded', status); }; var ToggleSchema = [ - defaulted$1('selected', false), - option('toggleClass'), - defaulted$1('toggleOnExecute', true), - defaultedOf('aria', {mode: 'none'}, choose$1('mode', { - pressed: [ - defaulted$1('syncWithExpanded', false), - output('update', updatePressed) - ], - checked: [output('update', updateChecked)], - expanded: [output('update', updateExpanded)], - selected: [output('update', updateSelected)], - none: [output('update', noop)] - })) + defaulted$1('selected', false), + option('toggleClass'), + defaulted$1('toggleOnExecute', true), + defaultedOf('aria', { mode: 'none' }, choose$1('mode', { + pressed: [ + defaulted$1('syncWithExpanded', false), + output('update', updatePressed) + ], + checked: [output('update', updateChecked)], + expanded: [output('update', updateExpanded)], + selected: [output('update', updateSelected)], + none: [output('update', noop)] + })) ]; var Toggling = create$1({ - fields: ToggleSchema, - name: 'toggling', - active: ActiveToggle, - apis: ToggleApis, - state: SetupBehaviourCellState(false) + fields: ToggleSchema, + name: 'toggling', + active: ActiveToggle, + apis: ToggleApis, + state: SetupBehaviourCellState(false) }); var format = function (command, update) { - return Receiving.config({ - channels: wrap$1(formatChanged, { - onReceive: function (button, data) { - if (data.command === command) { - update(button, data.state); - } - } - }) - }); + return Receiving.config({ + channels: wrap$1(formatChanged, { + onReceive: function (button, data) { + if (data.command === command) { + update(button, data.state); + } + } + }) + }); }; var orientation = function (onReceive) { - return Receiving.config({channels: wrap$1(orientationChanged, {onReceive: onReceive})}); + return Receiving.config({ channels: wrap$1(orientationChanged, { onReceive: onReceive }) }); }; var receive$1 = function (channel, onReceive) { - return { - key: channel, - value: {onReceive: onReceive} - }; + return { + key: channel, + value: { onReceive: onReceive } + }; }; var prefix = 'tinymce-mobile'; var resolve = function (p) { - return prefix + '-' + p; + return prefix + '-' + p; }; var pointerEvents = function () { - var onClick = function (component, simulatedEvent) { - simulatedEvent.stop(); - emitExecute(component); - }; - return [ - run(click(), onClick), - run(tap(), onClick), - cutter(touchstart()), - cutter(mousedown()) - ]; + var onClick = function (component, simulatedEvent) { + simulatedEvent.stop(); + emitExecute(component); + }; + return [ + run(click(), onClick), + run(tap(), onClick), + cutter(touchstart()), + cutter(mousedown()) + ]; }; var events$2 = function (optAction) { - var executeHandler = function (action) { - return runOnExecute(function (component, simulatedEvent) { - action(component); - simulatedEvent.stop(); - }); - }; - return derive(flatten([ - optAction.map(executeHandler).toArray(), - pointerEvents() - ])); + var executeHandler = function (action) { + return runOnExecute(function (component, simulatedEvent) { + action(component); + simulatedEvent.stop(); + }); + }; + return derive(flatten([ + optAction.map(executeHandler).toArray(), + pointerEvents() + ])); }; var focus$2 = function (component, focusConfig) { - if (!focusConfig.ignore) { - focus$1(component.element); - focusConfig.onFocus(component); - } + if (!focusConfig.ignore) { + focus$1(component.element); + focusConfig.onFocus(component); + } }; var blur$1 = function (component, focusConfig) { - if (!focusConfig.ignore) { - blur(component.element); - } + if (!focusConfig.ignore) { + blur(component.element); + } }; var isFocused = function (component) { - return hasFocus(component.element); + return hasFocus(component.element); }; var FocusApis = /*#__PURE__*/Object.freeze({ @@ -3156,15 +3152,15 @@ }); var exhibit$1 = function (base, focusConfig) { - var mod = focusConfig.ignore ? {} : {attributes: {tabindex: '-1'}}; - return nu$5(mod); + var mod = focusConfig.ignore ? {} : { attributes: { tabindex: '-1' } }; + return nu$5(mod); }; var events$3 = function (focusConfig) { - return derive([run(focus(), function (component, simulatedEvent) { - focus$2(component, focusConfig); - simulatedEvent.stop(); + return derive([run(focus(), function (component, simulatedEvent) { + focus$2(component, focusConfig); + simulatedEvent.stop(); })].concat(focusConfig.stopMousedown ? [run(mousedown(), function (_, simulatedEvent) { - simulatedEvent.event.prevent(); + simulatedEvent.event.prevent(); })] : [])); }; @@ -3175,208 +3171,208 @@ }); var FocusSchema = [ - onHandler('onFocus'), - defaulted$1('stopMousedown', false), - defaulted$1('ignore', false) + onHandler('onFocus'), + defaulted$1('stopMousedown', false), + defaulted$1('ignore', false) ]; var Focusing = create$1({ - fields: FocusSchema, - name: 'focusing', - active: ActiveFocus, - apis: FocusApis + fields: FocusSchema, + name: 'focusing', + active: ActiveFocus, + apis: FocusApis }); var isSupported$1 = function (dom) { - return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); }; var internalSet = function (dom, property, value) { - if (!isString(value)) { - console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom); - throw new Error('CSS value must be a string: ' + value); - } - if (isSupported$1(dom)) { - dom.style.setProperty(property, value); - } + if (!isString(value)) { + console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom); + throw new Error('CSS value must be a string: ' + value); + } + if (isSupported$1(dom)) { + dom.style.setProperty(property, value); + } }; var internalRemove = function (dom, property) { - if (isSupported$1(dom)) { - dom.style.removeProperty(property); - } + if (isSupported$1(dom)) { + dom.style.removeProperty(property); + } }; var set$3 = function (element, property, value) { - var dom = element.dom; - internalSet(dom, property, value); + var dom = element.dom; + internalSet(dom, property, value); }; var setAll$1 = function (element, css) { - var dom = element.dom; - each$1(css, function (v, k) { - internalSet(dom, k, v); - }); + var dom = element.dom; + each$1(css, function (v, k) { + internalSet(dom, k, v); + }); }; var get$5 = function (element, property) { - var dom = element.dom; - var styles = window.getComputedStyle(dom); - var r = styles.getPropertyValue(property); - return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; + var dom = element.dom; + var styles = window.getComputedStyle(dom); + var r = styles.getPropertyValue(property); + return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; }; var getUnsafeProperty = function (dom, property) { - return isSupported$1(dom) ? dom.style.getPropertyValue(property) : ''; + return isSupported$1(dom) ? dom.style.getPropertyValue(property) : ''; }; var getRaw = function (element, property) { - var dom = element.dom; - var raw = getUnsafeProperty(dom, property); - return Optional.from(raw).filter(function (r) { - return r.length > 0; - }); + var dom = element.dom; + var raw = getUnsafeProperty(dom, property); + return Optional.from(raw).filter(function (r) { + return r.length > 0; + }); }; var remove$5 = function (element, property) { - var dom = element.dom; - internalRemove(dom, property); - if (getOpt(element, 'style').map(trim).is('')) { - remove$1(element, 'style'); - } + var dom = element.dom; + internalRemove(dom, property); + if (getOpt(element, 'style').map(trim).is('')) { + remove$1(element, 'style'); + } }; var reflow = function (e) { - return e.dom.offsetWidth; + return e.dom.offsetWidth; }; - function Dimension(name, getOffset) { - var set = function (element, h) { - if (!isNumber(h) && !h.match(/^[0-9]+$/)) { - throw new Error(name + '.set accepts only positive integer values. Value was ' + h); - } - var dom = element.dom; - if (isSupported$1(dom)) { - dom.style[name] = h + 'px'; - } - }; - var get = function (element) { - var r = getOffset(element); - if (r <= 0 || r === null) { - var css = get$5(element, name); - return parseFloat(css) || 0; - } - return r; - }; - var getOuter = get; - var aggregate = function (element, properties) { - return foldl(properties, function (acc, property) { - var val = get$5(element, property); - var value = val === undefined ? 0 : parseInt(val, 10); - return isNaN(value) ? acc : acc + value; - }, 0); - }; - var max = function (element, value, properties) { - var cumulativeInclusions = aggregate(element, properties); - var absoluteMax = value > cumulativeInclusions ? value - cumulativeInclusions : 0; - return absoluteMax; - }; - return { - set: set, - get: get, - getOuter: getOuter, - aggregate: aggregate, - max: max - }; + function Dimension (name, getOffset) { + var set = function (element, h) { + if (!isNumber(h) && !h.match(/^[0-9]+$/)) { + throw new Error(name + '.set accepts only positive integer values. Value was ' + h); + } + var dom = element.dom; + if (isSupported$1(dom)) { + dom.style[name] = h + 'px'; + } + }; + var get = function (element) { + var r = getOffset(element); + if (r <= 0 || r === null) { + var css = get$5(element, name); + return parseFloat(css) || 0; + } + return r; + }; + var getOuter = get; + var aggregate = function (element, properties) { + return foldl(properties, function (acc, property) { + var val = get$5(element, property); + var value = val === undefined ? 0 : parseInt(val, 10); + return isNaN(value) ? acc : acc + value; + }, 0); + }; + var max = function (element, value, properties) { + var cumulativeInclusions = aggregate(element, properties); + var absoluteMax = value > cumulativeInclusions ? value - cumulativeInclusions : 0; + return absoluteMax; + }; + return { + set: set, + get: get, + getOuter: getOuter, + aggregate: aggregate, + max: max + }; } var api = Dimension('height', function (element) { - var dom = element.dom; - return inBody(element) ? dom.getBoundingClientRect().height : dom.offsetHeight; + var dom = element.dom; + return inBody(element) ? dom.getBoundingClientRect().height : dom.offsetHeight; }); var get$6 = function (element) { - return api.get(element); + return api.get(element); }; var ancestors = function (scope, predicate, isRoot) { - return filter(parents(scope, isRoot), predicate); + return filter(parents(scope, isRoot), predicate); }; var siblings$1 = function (scope, predicate) { - return filter(siblings(scope), predicate); + return filter(siblings(scope), predicate); }; var all$2 = function (selector) { - return all(selector); + return all(selector); }; var ancestors$1 = function (scope, selector, isRoot) { - return ancestors(scope, function (e) { - return is(e, selector); - }, isRoot); + return ancestors(scope, function (e) { + return is(e, selector); + }, isRoot); }; var siblings$2 = function (scope, selector) { - return siblings$1(scope, function (e) { - return is(e, selector); - }); + return siblings$1(scope, function (e) { + return is(e, selector); + }); }; var descendants = function (scope, selector) { - return all(selector, scope); + return all(selector, scope); }; - function ClosestOrAncestor(is, ancestor, scope, a, isRoot) { - if (is(scope, a)) { - return Optional.some(scope); - } else if (isFunction(isRoot) && isRoot(scope)) { - return Optional.none(); - } else { - return ancestor(scope, a, isRoot); - } + function ClosestOrAncestor (is, ancestor, scope, a, isRoot) { + if (is(scope, a)) { + return Optional.some(scope); + } else if (isFunction(isRoot) && isRoot(scope)) { + return Optional.none(); + } else { + return ancestor(scope, a, isRoot); + } } var ancestor$1 = function (scope, predicate, isRoot) { - var element = scope.dom; - var stop = isFunction(isRoot) ? isRoot : never; - while (element.parentNode) { - element = element.parentNode; - var el = SugarElement.fromDom(element); - if (predicate(el)) { - return Optional.some(el); - } else if (stop(el)) { - break; - } + var element = scope.dom; + var stop = isFunction(isRoot) ? isRoot : never; + while (element.parentNode) { + element = element.parentNode; + var el = SugarElement.fromDom(element); + if (predicate(el)) { + return Optional.some(el); + } else if (stop(el)) { + break; } - return Optional.none(); + } + return Optional.none(); }; var closest$1 = function (scope, predicate, isRoot) { - var is = function (s, test) { - return test(s); - }; - return ClosestOrAncestor(is, ancestor$1, scope, predicate, isRoot); + var is = function (s, test) { + return test(s); + }; + return ClosestOrAncestor(is, ancestor$1, scope, predicate, isRoot); }; var descendant = function (scope, predicate) { - var descend = function (node) { - for (var i = 0; i < node.childNodes.length; i++) { - var child_1 = SugarElement.fromDom(node.childNodes[i]); - if (predicate(child_1)) { - return Optional.some(child_1); - } - var res = descend(node.childNodes[i]); - if (res.isSome()) { - return res; - } - } - return Optional.none(); - }; - return descend(scope.dom); + var descend = function (node) { + for (var i = 0; i < node.childNodes.length; i++) { + var child_1 = SugarElement.fromDom(node.childNodes[i]); + if (predicate(child_1)) { + return Optional.some(child_1); + } + var res = descend(node.childNodes[i]); + if (res.isSome()) { + return res; + } + } + return Optional.none(); + }; + return descend(scope.dom); }; var first = function (selector) { - return one(selector); + return one(selector); }; var ancestor$2 = function (scope, selector, isRoot) { - return ancestor$1(scope, function (e) { - return is(e, selector); - }, isRoot); + return ancestor$1(scope, function (e) { + return is(e, selector); + }, isRoot); }; var descendant$1 = function (scope, selector) { - return one(selector, scope); + return one(selector, scope); }; var closest$2 = function (scope, selector, isRoot) { - var is$1 = function (element, selector) { - return is(element, selector); - }; - return ClosestOrAncestor(is$1, ancestor$2, scope, selector, isRoot); + var is$1 = function (element, selector) { + return is(element, selector); + }; + return ClosestOrAncestor(is$1, ancestor$2, scope, selector, isRoot); }; var BACKSPACE = [8]; @@ -3390,205 +3386,205 @@ var DOWN = [40]; var cyclePrev = function (values, index, predicate) { - var before = reverse(values.slice(0, index)); - var after = reverse(values.slice(index + 1)); - return find(before.concat(after), predicate); + var before = reverse(values.slice(0, index)); + var after = reverse(values.slice(index + 1)); + return find(before.concat(after), predicate); }; var tryPrev = function (values, index, predicate) { - var before = reverse(values.slice(0, index)); - return find(before, predicate); + var before = reverse(values.slice(0, index)); + return find(before, predicate); }; var cycleNext = function (values, index, predicate) { - var before = values.slice(0, index); - var after = values.slice(index + 1); - return find(after.concat(before), predicate); + var before = values.slice(0, index); + var after = values.slice(index + 1); + return find(after.concat(before), predicate); }; var tryNext = function (values, index, predicate) { - var after = values.slice(index + 1); - return find(after, predicate); + var after = values.slice(index + 1); + return find(after, predicate); }; var inSet = function (keys) { - return function (event) { - var raw = event.raw; - return contains(keys, raw.which); - }; + return function (event) { + var raw = event.raw; + return contains(keys, raw.which); + }; }; var and = function (preds) { - return function (event) { - return forall(preds, function (pred) { - return pred(event); - }); - }; + return function (event) { + return forall(preds, function (pred) { + return pred(event); + }); + }; }; var isShift = function (event) { - var raw = event.raw; - return raw.shiftKey === true; + var raw = event.raw; + return raw.shiftKey === true; }; var isControl = function (event) { - var raw = event.raw; - return raw.ctrlKey === true; + var raw = event.raw; + return raw.ctrlKey === true; }; var isNotShift = not(isShift); var rule = function (matches, action) { - return { - matches: matches, - classification: action - }; + return { + matches: matches, + classification: action + }; }; var choose$2 = function (transitions, event) { - var transition = find(transitions, function (t) { - return t.matches(event); - }); - return transition.map(function (t) { - return t.classification; - }); + var transition = find(transitions, function (t) { + return t.matches(event); + }); + return transition.map(function (t) { + return t.classification; + }); }; var cycleBy = function (value, delta, min, max) { - var r = value + delta; - if (r > max) { - return min; - } else if (r < min) { - return max; - } else { - return r; - } + var r = value + delta; + if (r > max) { + return min; + } else if (r < min) { + return max; + } else { + return r; + } }; var clamp = function (value, min, max) { - return Math.min(Math.max(value, min), max); + return Math.min(Math.max(value, min), max); }; var cat = function (arr) { - var r = []; - var push = function (x) { - r.push(x); - }; - for (var i = 0; i < arr.length; i++) { - arr[i].each(push); - } - return r; + var r = []; + var push = function (x) { + r.push(x); + }; + for (var i = 0; i < arr.length; i++) { + arr[i].each(push); + } + return r; }; var sequence = function (arr) { - var r = []; - for (var i = 0; i < arr.length; i++) { - var x = arr[i]; - if (x.isSome()) { - r.push(x.getOrDie()); - } else { - return Optional.none(); - } + var r = []; + for (var i = 0; i < arr.length; i++) { + var x = arr[i]; + if (x.isSome()) { + r.push(x.getOrDie()); + } else { + return Optional.none(); } - return Optional.some(r); + } + return Optional.some(r); }; var someIf = function (b, a) { - return b ? Optional.some(a) : Optional.none(); + return b ? Optional.some(a) : Optional.none(); }; var dehighlightAllExcept = function (component, hConfig, hState, skip) { - var highlighted = descendants(component.element, '.' + hConfig.highlightClass); - each(highlighted, function (h) { - if (!exists(skip, function (skipComp) { - return skipComp.element === h; - })) { - remove$4(h, hConfig.highlightClass); - component.getSystem().getByDom(h).each(function (target) { - hConfig.onDehighlight(component, target); - emit(target, dehighlight()); - }); - } - }); + var highlighted = descendants(component.element, '.' + hConfig.highlightClass); + each(highlighted, function (h) { + if (!exists(skip, function (skipComp) { + return skipComp.element === h; + })) { + remove$4(h, hConfig.highlightClass); + component.getSystem().getByDom(h).each(function (target) { + hConfig.onDehighlight(component, target); + emit(target, dehighlight()); + }); + } + }); }; var dehighlightAll = function (component, hConfig, hState) { - return dehighlightAllExcept(component, hConfig, hState, []); + return dehighlightAllExcept(component, hConfig, hState, []); }; var dehighlight$1 = function (component, hConfig, hState, target) { - if (isHighlighted(component, hConfig, hState, target)) { - remove$4(target.element, hConfig.highlightClass); - hConfig.onDehighlight(component, target); - emit(target, dehighlight()); - } + if (isHighlighted(component, hConfig, hState, target)) { + remove$4(target.element, hConfig.highlightClass); + hConfig.onDehighlight(component, target); + emit(target, dehighlight()); + } }; var highlight$1 = function (component, hConfig, hState, target) { - dehighlightAllExcept(component, hConfig, hState, [target]); - if (!isHighlighted(component, hConfig, hState, target)) { - add$2(target.element, hConfig.highlightClass); - hConfig.onHighlight(component, target); - emit(target, highlight()); - } + dehighlightAllExcept(component, hConfig, hState, [target]); + if (!isHighlighted(component, hConfig, hState, target)) { + add$2(target.element, hConfig.highlightClass); + hConfig.onHighlight(component, target); + emit(target, highlight()); + } }; var highlightFirst = function (component, hConfig, hState) { - getFirst(component, hConfig).each(function (firstComp) { - highlight$1(component, hConfig, hState, firstComp); - }); + getFirst(component, hConfig).each(function (firstComp) { + highlight$1(component, hConfig, hState, firstComp); + }); }; var highlightLast = function (component, hConfig, hState) { - getLast(component, hConfig).each(function (lastComp) { - highlight$1(component, hConfig, hState, lastComp); - }); + getLast(component, hConfig).each(function (lastComp) { + highlight$1(component, hConfig, hState, lastComp); + }); }; var highlightAt = function (component, hConfig, hState, index) { - getByIndex(component, hConfig, hState, index).fold(function (err) { - throw new Error(err); - }, function (firstComp) { - highlight$1(component, hConfig, hState, firstComp); - }); + getByIndex(component, hConfig, hState, index).fold(function (err) { + throw new Error(err); + }, function (firstComp) { + highlight$1(component, hConfig, hState, firstComp); + }); }; var highlightBy = function (component, hConfig, hState, predicate) { - var candidates = getCandidates(component, hConfig); - var targetComp = find(candidates, predicate); - targetComp.each(function (c) { - highlight$1(component, hConfig, hState, c); - }); + var candidates = getCandidates(component, hConfig); + var targetComp = find(candidates, predicate); + targetComp.each(function (c) { + highlight$1(component, hConfig, hState, c); + }); }; var isHighlighted = function (component, hConfig, hState, queryTarget) { - return has$2(queryTarget.element, hConfig.highlightClass); + return has$2(queryTarget.element, hConfig.highlightClass); }; var getHighlighted = function (component, hConfig, _hState) { - return descendant$1(component.element, '.' + hConfig.highlightClass).bind(function (e) { - return component.getSystem().getByDom(e).toOptional(); - }); + return descendant$1(component.element, '.' + hConfig.highlightClass).bind(function (e) { + return component.getSystem().getByDom(e).toOptional(); + }); }; var getByIndex = function (component, hConfig, hState, index) { - var items = descendants(component.element, '.' + hConfig.itemClass); - return Optional.from(items[index]).fold(function () { - return Result.error('No element found with index ' + index); - }, component.getSystem().getByDom); + var items = descendants(component.element, '.' + hConfig.itemClass); + return Optional.from(items[index]).fold(function () { + return Result.error('No element found with index ' + index); + }, component.getSystem().getByDom); }; var getFirst = function (component, hConfig, _hState) { - return descendant$1(component.element, '.' + hConfig.itemClass).bind(function (e) { - return component.getSystem().getByDom(e).toOptional(); - }); + return descendant$1(component.element, '.' + hConfig.itemClass).bind(function (e) { + return component.getSystem().getByDom(e).toOptional(); + }); }; var getLast = function (component, hConfig, _hState) { - var items = descendants(component.element, '.' + hConfig.itemClass); - var last = items.length > 0 ? Optional.some(items[items.length - 1]) : Optional.none(); - return last.bind(function (c) { - return component.getSystem().getByDom(c).toOptional(); - }); + var items = descendants(component.element, '.' + hConfig.itemClass); + var last = items.length > 0 ? Optional.some(items[items.length - 1]) : Optional.none(); + return last.bind(function (c) { + return component.getSystem().getByDom(c).toOptional(); + }); }; var getDelta = function (component, hConfig, hState, delta) { - var items = descendants(component.element, '.' + hConfig.itemClass); - var current = findIndex(items, function (item) { - return has$2(item, hConfig.highlightClass); - }); - return current.bind(function (selected) { - var dest = cycleBy(selected, delta, 0, items.length - 1); - return component.getSystem().getByDom(items[dest]).toOptional(); - }); + var items = descendants(component.element, '.' + hConfig.itemClass); + var current = findIndex(items, function (item) { + return has$2(item, hConfig.highlightClass); + }); + return current.bind(function (selected) { + var dest = cycleBy(selected, delta, 0, items.length - 1); + return component.getSystem().getByDom(items[dest]).toOptional(); + }); }; var getPrevious = function (component, hConfig, hState) { - return getDelta(component, hConfig, hState, -1); + return getDelta(component, hConfig, hState, -1); }; var getNext = function (component, hConfig, hState) { - return getDelta(component, hConfig, hState, +1); + return getDelta(component, hConfig, hState, +1); }; var getCandidates = function (component, hConfig, _hState) { - var items = descendants(component.element, '.' + hConfig.itemClass); - return cat(map(items, function (i) { - return component.getSystem().getByDom(i).toOptional(); - })); + var items = descendants(component.element, '.' + hConfig.itemClass); + return cat(map(items, function (i) { + return component.getSystem().getByDom(i).toOptional(); + })); }; var HighlightApis = /*#__PURE__*/Object.freeze({ @@ -3610,223 +3606,223 @@ }); var HighlightSchema = [ - strict$1('highlightClass'), - strict$1('itemClass'), - onHandler('onHighlight'), - onHandler('onDehighlight') + strict$1('highlightClass'), + strict$1('itemClass'), + onHandler('onHighlight'), + onHandler('onDehighlight') ]; var Highlighting = create$1({ - fields: HighlightSchema, - name: 'highlighting', - apis: HighlightApis + fields: HighlightSchema, + name: 'highlighting', + apis: HighlightApis }); var reportFocusShifting = function (component, prevFocus, newFocus) { - var noChange = prevFocus.exists(function (p) { - return newFocus.exists(function (n) { - return eq(n, p); - }); + var noChange = prevFocus.exists(function (p) { + return newFocus.exists(function (n) { + return eq(n, p); }); - if (!noChange) { - emitWith(component, focusShifted(), { - prevFocus: prevFocus, - newFocus: newFocus - }); - } + }); + if (!noChange) { + emitWith(component, focusShifted(), { + prevFocus: prevFocus, + newFocus: newFocus + }); + } }; var dom = function () { - var get = function (component) { - return search(component.element); - }; - var set = function (component, focusee) { - var prevFocus = get(component); - component.getSystem().triggerFocus(focusee, component.element); - var newFocus = get(component); - reportFocusShifting(component, prevFocus, newFocus); - }; - return { - get: get, - set: set - }; + var get = function (component) { + return search(component.element); + }; + var set = function (component, focusee) { + var prevFocus = get(component); + component.getSystem().triggerFocus(focusee, component.element); + var newFocus = get(component); + reportFocusShifting(component, prevFocus, newFocus); + }; + return { + get: get, + set: set + }; }; var highlights = function () { - var get = function (component) { - return Highlighting.getHighlighted(component).map(function (item) { - return item.element; - }); - }; - var set = function (component, element) { - var prevFocus = get(component); - component.getSystem().getByDom(element).fold(noop, function (item) { - Highlighting.highlight(component, item); - }); - var newFocus = get(component); - reportFocusShifting(component, prevFocus, newFocus); - }; - return { - get: get, - set: set - }; + var get = function (component) { + return Highlighting.getHighlighted(component).map(function (item) { + return item.element; + }); + }; + var set = function (component, element) { + var prevFocus = get(component); + component.getSystem().getByDom(element).fold(noop, function (item) { + Highlighting.highlight(component, item); + }); + var newFocus = get(component); + reportFocusShifting(component, prevFocus, newFocus); + }; + return { + get: get, + set: set + }; }; var FocusInsideModes; (function (FocusInsideModes) { - FocusInsideModes['OnFocusMode'] = 'onFocus'; - FocusInsideModes['OnEnterOrSpaceMode'] = 'onEnterOrSpace'; - FocusInsideModes['OnApiMode'] = 'onApi'; + FocusInsideModes['OnFocusMode'] = 'onFocus'; + FocusInsideModes['OnEnterOrSpaceMode'] = 'onEnterOrSpace'; + FocusInsideModes['OnApiMode'] = 'onApi'; }(FocusInsideModes || (FocusInsideModes = {}))); var typical = function (infoSchema, stateInit, getKeydownRules, getKeyupRules, optFocusIn) { - var schema = function () { - return infoSchema.concat([ - defaulted$1('focusManager', dom()), - defaultedOf('focusInside', 'onFocus', valueOf(function (val) { - return contains([ - 'onFocus', - 'onEnterOrSpace', - 'onApi' - ], val) ? Result.value(val) : Result.error('Invalid value for focusInside'); - })), - output('handler', me), - output('state', stateInit), - output('sendFocusIn', optFocusIn) - ]); - }; - var processKey = function (component, simulatedEvent, getRules, keyingConfig, keyingState) { - var rules = getRules(component, simulatedEvent, keyingConfig, keyingState); - return choose$2(rules, simulatedEvent.event).bind(function (rule) { - return rule(component, simulatedEvent, keyingConfig, keyingState); - }); - }; - var toEvents = function (keyingConfig, keyingState) { - var onFocusHandler = keyingConfig.focusInside !== FocusInsideModes.OnFocusMode ? Optional.none() : optFocusIn(keyingConfig).map(function (focusIn) { - return run(focus(), function (component, simulatedEvent) { - focusIn(component, keyingConfig, keyingState); - simulatedEvent.stop(); - }); - }); - var tryGoInsideComponent = function (component, simulatedEvent) { - var isEnterOrSpace = inSet(SPACE.concat(ENTER))(simulatedEvent.event); - if (keyingConfig.focusInside === FocusInsideModes.OnEnterOrSpaceMode && isEnterOrSpace && isSource(component, simulatedEvent)) { - optFocusIn(keyingConfig).each(function (focusIn) { - focusIn(component, keyingConfig, keyingState); - simulatedEvent.stop(); - }); - } - }; - var keyboardEvents = [ - run(keydown(), function (component, simulatedEvent) { - processKey(component, simulatedEvent, getKeydownRules, keyingConfig, keyingState).fold(function () { - tryGoInsideComponent(component, simulatedEvent); - }, function (_) { - simulatedEvent.stop(); - }); - }), - run(keyup(), function (component, simulatedEvent) { - processKey(component, simulatedEvent, getKeyupRules, keyingConfig, keyingState).each(function (_) { - simulatedEvent.stop(); - }); - }) - ]; - return derive(onFocusHandler.toArray().concat(keyboardEvents)); - }; - var me = { - schema: schema, - processKey: processKey, - toEvents: toEvents - }; - return me; + var schema = function () { + return infoSchema.concat([ + defaulted$1('focusManager', dom()), + defaultedOf('focusInside', 'onFocus', valueOf(function (val) { + return contains([ + 'onFocus', + 'onEnterOrSpace', + 'onApi' + ], val) ? Result.value(val) : Result.error('Invalid value for focusInside'); + })), + output('handler', me), + output('state', stateInit), + output('sendFocusIn', optFocusIn) + ]); + }; + var processKey = function (component, simulatedEvent, getRules, keyingConfig, keyingState) { + var rules = getRules(component, simulatedEvent, keyingConfig, keyingState); + return choose$2(rules, simulatedEvent.event).bind(function (rule) { + return rule(component, simulatedEvent, keyingConfig, keyingState); + }); + }; + var toEvents = function (keyingConfig, keyingState) { + var onFocusHandler = keyingConfig.focusInside !== FocusInsideModes.OnFocusMode ? Optional.none() : optFocusIn(keyingConfig).map(function (focusIn) { + return run(focus(), function (component, simulatedEvent) { + focusIn(component, keyingConfig, keyingState); + simulatedEvent.stop(); + }); + }); + var tryGoInsideComponent = function (component, simulatedEvent) { + var isEnterOrSpace = inSet(SPACE.concat(ENTER))(simulatedEvent.event); + if (keyingConfig.focusInside === FocusInsideModes.OnEnterOrSpaceMode && isEnterOrSpace && isSource(component, simulatedEvent)) { + optFocusIn(keyingConfig).each(function (focusIn) { + focusIn(component, keyingConfig, keyingState); + simulatedEvent.stop(); + }); + } + }; + var keyboardEvents = [ + run(keydown(), function (component, simulatedEvent) { + processKey(component, simulatedEvent, getKeydownRules, keyingConfig, keyingState).fold(function () { + tryGoInsideComponent(component, simulatedEvent); + }, function (_) { + simulatedEvent.stop(); + }); + }), + run(keyup(), function (component, simulatedEvent) { + processKey(component, simulatedEvent, getKeyupRules, keyingConfig, keyingState).each(function (_) { + simulatedEvent.stop(); + }); + }) + ]; + return derive(onFocusHandler.toArray().concat(keyboardEvents)); + }; + var me = { + schema: schema, + processKey: processKey, + toEvents: toEvents + }; + return me; }; var create$2 = function (cyclicField) { - var schema = [ - option('onEscape'), - option('onEnter'), - defaulted$1('selector', '[data-alloy-tabstop="true"]:not(:disabled)'), - defaulted$1('firstTabstop', 0), - defaulted$1('useTabstopAt', always), - option('visibilitySelector') - ].concat([cyclicField]); - var isVisible = function (tabbingConfig, element) { - var target = tabbingConfig.visibilitySelector.bind(function (sel) { - return closest$2(element, sel); - }).getOr(element); - return get$6(target) > 0; - }; - var findInitial = function (component, tabbingConfig) { - var tabstops = descendants(component.element, tabbingConfig.selector); - var visibles = filter(tabstops, function (elem) { - return isVisible(tabbingConfig, elem); - }); - return Optional.from(visibles[tabbingConfig.firstTabstop]); - }; - var findCurrent = function (component, tabbingConfig) { - return tabbingConfig.focusManager.get(component).bind(function (elem) { - return closest$2(elem, tabbingConfig.selector); - }); - }; - var isTabstop = function (tabbingConfig, element) { - return isVisible(tabbingConfig, element) && tabbingConfig.useTabstopAt(element); - }; - var focusIn = function (component, tabbingConfig, _tabbingState) { - findInitial(component, tabbingConfig).each(function (target) { - tabbingConfig.focusManager.set(component, target); - }); - }; - var goFromTabstop = function (component, tabstops, stopIndex, tabbingConfig, cycle) { - return cycle(tabstops, stopIndex, function (elem) { - return isTabstop(tabbingConfig, elem); - }).fold(function () { - return tabbingConfig.cyclic ? Optional.some(true) : Optional.none(); - }, function (target) { - tabbingConfig.focusManager.set(component, target); - return Optional.some(true); - }); - }; - var go = function (component, _simulatedEvent, tabbingConfig, cycle) { - var tabstops = descendants(component.element, tabbingConfig.selector); - return findCurrent(component, tabbingConfig).bind(function (tabstop) { - var optStopIndex = findIndex(tabstops, curry(eq, tabstop)); - return optStopIndex.bind(function (stopIndex) { - return goFromTabstop(component, tabstops, stopIndex, tabbingConfig, cycle); - }); - }); - }; - var goBackwards = function (component, simulatedEvent, tabbingConfig) { - var navigate = tabbingConfig.cyclic ? cyclePrev : tryPrev; - return go(component, simulatedEvent, tabbingConfig, navigate); - }; - var goForwards = function (component, simulatedEvent, tabbingConfig) { - var navigate = tabbingConfig.cyclic ? cycleNext : tryNext; - return go(component, simulatedEvent, tabbingConfig, navigate); - }; - var execute = function (component, simulatedEvent, tabbingConfig) { - return tabbingConfig.onEnter.bind(function (f) { - return f(component, simulatedEvent); - }); - }; - var exit = function (component, simulatedEvent, tabbingConfig) { - return tabbingConfig.onEscape.bind(function (f) { - return f(component, simulatedEvent); - }); - }; - var getKeydownRules = constant([ - rule(and([ - isShift, - inSet(TAB) - ]), goBackwards), - rule(inSet(TAB), goForwards), - rule(inSet(ESCAPE), exit), - rule(and([ - isNotShift, - inSet(ENTER) - ]), execute) - ]); - var getKeyupRules = constant([]); - return typical(schema, NoState.init, getKeydownRules, getKeyupRules, function () { - return Optional.some(focusIn); - }); + var schema = [ + option('onEscape'), + option('onEnter'), + defaulted$1('selector', '[data-alloy-tabstop="true"]:not(:disabled)'), + defaulted$1('firstTabstop', 0), + defaulted$1('useTabstopAt', always), + option('visibilitySelector') + ].concat([cyclicField]); + var isVisible = function (tabbingConfig, element) { + var target = tabbingConfig.visibilitySelector.bind(function (sel) { + return closest$2(element, sel); + }).getOr(element); + return get$6(target) > 0; + }; + var findInitial = function (component, tabbingConfig) { + var tabstops = descendants(component.element, tabbingConfig.selector); + var visibles = filter(tabstops, function (elem) { + return isVisible(tabbingConfig, elem); + }); + return Optional.from(visibles[tabbingConfig.firstTabstop]); + }; + var findCurrent = function (component, tabbingConfig) { + return tabbingConfig.focusManager.get(component).bind(function (elem) { + return closest$2(elem, tabbingConfig.selector); + }); + }; + var isTabstop = function (tabbingConfig, element) { + return isVisible(tabbingConfig, element) && tabbingConfig.useTabstopAt(element); + }; + var focusIn = function (component, tabbingConfig, _tabbingState) { + findInitial(component, tabbingConfig).each(function (target) { + tabbingConfig.focusManager.set(component, target); + }); + }; + var goFromTabstop = function (component, tabstops, stopIndex, tabbingConfig, cycle) { + return cycle(tabstops, stopIndex, function (elem) { + return isTabstop(tabbingConfig, elem); + }).fold(function () { + return tabbingConfig.cyclic ? Optional.some(true) : Optional.none(); + }, function (target) { + tabbingConfig.focusManager.set(component, target); + return Optional.some(true); + }); + }; + var go = function (component, _simulatedEvent, tabbingConfig, cycle) { + var tabstops = descendants(component.element, tabbingConfig.selector); + return findCurrent(component, tabbingConfig).bind(function (tabstop) { + var optStopIndex = findIndex(tabstops, curry(eq, tabstop)); + return optStopIndex.bind(function (stopIndex) { + return goFromTabstop(component, tabstops, stopIndex, tabbingConfig, cycle); + }); + }); + }; + var goBackwards = function (component, simulatedEvent, tabbingConfig) { + var navigate = tabbingConfig.cyclic ? cyclePrev : tryPrev; + return go(component, simulatedEvent, tabbingConfig, navigate); + }; + var goForwards = function (component, simulatedEvent, tabbingConfig) { + var navigate = tabbingConfig.cyclic ? cycleNext : tryNext; + return go(component, simulatedEvent, tabbingConfig, navigate); + }; + var execute = function (component, simulatedEvent, tabbingConfig) { + return tabbingConfig.onEnter.bind(function (f) { + return f(component, simulatedEvent); + }); + }; + var exit = function (component, simulatedEvent, tabbingConfig) { + return tabbingConfig.onEscape.bind(function (f) { + return f(component, simulatedEvent); + }); + }; + var getKeydownRules = constant([ + rule(and([ + isShift, + inSet(TAB) + ]), goBackwards), + rule(inSet(TAB), goForwards), + rule(inSet(ESCAPE), exit), + rule(and([ + isNotShift, + inSet(ENTER) + ]), execute) + ]); + var getKeyupRules = constant([]); + return typical(schema, NoState.init, getKeydownRules, getKeyupRules, function () { + return Optional.some(focusIn); + }); }; var AcyclicType = create$2(state$1('cyclic', never)); @@ -3834,85 +3830,85 @@ var CyclicType = create$2(state$1('cyclic', always)); var inside = function (target) { - return name(target) === 'input' && get$2(target, 'type') !== 'radio' || name(target) === 'textarea'; + return name(target) === 'input' && get$2(target, 'type') !== 'radio' || name(target) === 'textarea'; }; var doDefaultExecute = function (component, _simulatedEvent, focused) { - dispatch(component, focused, execute()); - return Optional.some(true); + dispatch(component, focused, execute()); + return Optional.some(true); }; var defaultExecute = function (component, simulatedEvent, focused) { - var isComplex = inside(focused) && inSet(SPACE)(simulatedEvent.event); - return isComplex ? Optional.none() : doDefaultExecute(component, simulatedEvent, focused); + var isComplex = inside(focused) && inSet(SPACE)(simulatedEvent.event); + return isComplex ? Optional.none() : doDefaultExecute(component, simulatedEvent, focused); }; var stopEventForFirefox = function (_component, _simulatedEvent) { - return Optional.some(true); + return Optional.some(true); }; var schema$1 = [ - defaulted$1('execute', defaultExecute), - defaulted$1('useSpace', false), - defaulted$1('useEnter', true), - defaulted$1('useControlEnter', false), - defaulted$1('useDown', false) + defaulted$1('execute', defaultExecute), + defaulted$1('useSpace', false), + defaulted$1('useEnter', true), + defaulted$1('useControlEnter', false), + defaulted$1('useDown', false) ]; var execute$1 = function (component, simulatedEvent, executeConfig) { - return executeConfig.execute(component, simulatedEvent, component.element); + return executeConfig.execute(component, simulatedEvent, component.element); }; var getKeydownRules = function (component, _simulatedEvent, executeConfig, _executeState) { - var spaceExec = executeConfig.useSpace && !inside(component.element) ? SPACE : []; - var enterExec = executeConfig.useEnter ? ENTER : []; - var downExec = executeConfig.useDown ? DOWN : []; - var execKeys = spaceExec.concat(enterExec).concat(downExec); - return [rule(inSet(execKeys), execute$1)].concat(executeConfig.useControlEnter ? [rule(and([ - isControl, - inSet(ENTER) + var spaceExec = executeConfig.useSpace && !inside(component.element) ? SPACE : []; + var enterExec = executeConfig.useEnter ? ENTER : []; + var downExec = executeConfig.useDown ? DOWN : []; + var execKeys = spaceExec.concat(enterExec).concat(downExec); + return [rule(inSet(execKeys), execute$1)].concat(executeConfig.useControlEnter ? [rule(and([ + isControl, + inSet(ENTER) ]), execute$1)] : []); }; var getKeyupRules = function (component, _simulatedEvent, executeConfig, _executeState) { - return executeConfig.useSpace && !inside(component.element) ? [rule(inSet(SPACE), stopEventForFirefox)] : []; + return executeConfig.useSpace && !inside(component.element) ? [rule(inSet(SPACE), stopEventForFirefox)] : []; }; var ExecutionType = typical(schema$1, NoState.init, getKeydownRules, getKeyupRules, function () { - return Optional.none(); + return Optional.none(); }); var flatgrid = function () { - var dimensions = Cell(Optional.none()); - var setGridSize = function (numRows, numColumns) { - dimensions.set(Optional.some({ - numRows: numRows, - numColumns: numColumns - })); - }; - var getNumRows = function () { - return dimensions.get().map(function (d) { - return d.numRows; - }); - }; - var getNumColumns = function () { - return dimensions.get().map(function (d) { - return d.numColumns; - }); - }; - return nu$6({ - readState: function () { - return dimensions.get().map(function (d) { - return { - numRows: String(d.numRows), - numColumns: String(d.numColumns) - }; - }).getOr({ - numRows: '?', - numColumns: '?' - }); - }, - setGridSize: setGridSize, - getNumRows: getNumRows, - getNumColumns: getNumColumns - }); + var dimensions = Cell(Optional.none()); + var setGridSize = function (numRows, numColumns) { + dimensions.set(Optional.some({ + numRows: numRows, + numColumns: numColumns + })); + }; + var getNumRows = function () { + return dimensions.get().map(function (d) { + return d.numRows; + }); + }; + var getNumColumns = function () { + return dimensions.get().map(function (d) { + return d.numColumns; + }); + }; + return nu$6({ + readState: function () { + return dimensions.get().map(function (d) { + return { + numRows: String(d.numRows), + numColumns: String(d.numColumns) + }; + }).getOr({ + numRows: '?', + numColumns: '?' + }); + }, + setGridSize: setGridSize, + getNumRows: getNumRows, + getNumColumns: getNumColumns + }); }; var init = function (spec) { - return spec.state(spec); + return spec.state(spec); }; var KeyingState = /*#__PURE__*/Object.freeze({ @@ -3922,469 +3918,469 @@ }); var onDirection = function (isLtr, isRtl) { - return function (element) { - return getDirection(element) === 'rtl' ? isRtl : isLtr; - }; + return function (element) { + return getDirection(element) === 'rtl' ? isRtl : isLtr; + }; }; var getDirection = function (element) { - return get$5(element, 'direction') === 'rtl' ? 'rtl' : 'ltr'; + return get$5(element, 'direction') === 'rtl' ? 'rtl' : 'ltr'; }; var useH = function (movement) { - return function (component, simulatedEvent, config, state) { - var move = movement(component.element); - return use(move, component, simulatedEvent, config, state); - }; + return function (component, simulatedEvent, config, state) { + var move = movement(component.element); + return use(move, component, simulatedEvent, config, state); + }; }; var west = function (moveLeft, moveRight) { - var movement = onDirection(moveLeft, moveRight); - return useH(movement); + var movement = onDirection(moveLeft, moveRight); + return useH(movement); }; var east = function (moveLeft, moveRight) { - var movement = onDirection(moveRight, moveLeft); - return useH(movement); + var movement = onDirection(moveRight, moveLeft); + return useH(movement); }; var useV = function (move) { - return function (component, simulatedEvent, config, state) { - return use(move, component, simulatedEvent, config, state); - }; + return function (component, simulatedEvent, config, state) { + return use(move, component, simulatedEvent, config, state); + }; }; var use = function (move, component, simulatedEvent, config, state) { - var outcome = config.focusManager.get(component).bind(function (focused) { - return move(component.element, focused, config, state); - }); - return outcome.map(function (newFocus) { - config.focusManager.set(component, newFocus); - return true; - }); + var outcome = config.focusManager.get(component).bind(function (focused) { + return move(component.element, focused, config, state); + }); + return outcome.map(function (newFocus) { + config.focusManager.set(component, newFocus); + return true; + }); }; var north = useV; var south = useV; var move = useV; var isHidden = function (dom) { - return dom.offsetWidth <= 0 && dom.offsetHeight <= 0; + return dom.offsetWidth <= 0 && dom.offsetHeight <= 0; }; var isVisible = function (element) { - return !isHidden(element.dom); + return !isHidden(element.dom); }; var locate = function (candidates, predicate) { - return findIndex(candidates, predicate).map(function (index) { - return { - index: index, - candidates: candidates - }; - }); + return findIndex(candidates, predicate).map(function (index) { + return { + index: index, + candidates: candidates + }; + }); }; var locateVisible = function (container, current, selector) { - var predicate = function (x) { - return eq(x, current); - }; - var candidates = descendants(container, selector); - var visible = filter(candidates, isVisible); - return locate(visible, predicate); + var predicate = function (x) { + return eq(x, current); + }; + var candidates = descendants(container, selector); + var visible = filter(candidates, isVisible); + return locate(visible, predicate); }; var findIndex$1 = function (elements, target) { - return findIndex(elements, function (elem) { - return eq(target, elem); - }); + return findIndex(elements, function (elem) { + return eq(target, elem); + }); }; var withGrid = function (values, index, numCols, f) { - var oldRow = Math.floor(index / numCols); - var oldColumn = index % numCols; - return f(oldRow, oldColumn).bind(function (address) { - var newIndex = address.row * numCols + address.column; - return newIndex >= 0 && newIndex < values.length ? Optional.some(values[newIndex]) : Optional.none(); - }); + var oldRow = Math.floor(index / numCols); + var oldColumn = index % numCols; + return f(oldRow, oldColumn).bind(function (address) { + var newIndex = address.row * numCols + address.column; + return newIndex >= 0 && newIndex < values.length ? Optional.some(values[newIndex]) : Optional.none(); + }); }; var cycleHorizontal = function (values, index, numRows, numCols, delta) { - return withGrid(values, index, numCols, function (oldRow, oldColumn) { - var onLastRow = oldRow === numRows - 1; - var colsInRow = onLastRow ? values.length - oldRow * numCols : numCols; - var newColumn = cycleBy(oldColumn, delta, 0, colsInRow - 1); - return Optional.some({ - row: oldRow, - column: newColumn - }); + return withGrid(values, index, numCols, function (oldRow, oldColumn) { + var onLastRow = oldRow === numRows - 1; + var colsInRow = onLastRow ? values.length - oldRow * numCols : numCols; + var newColumn = cycleBy(oldColumn, delta, 0, colsInRow - 1); + return Optional.some({ + row: oldRow, + column: newColumn }); + }); }; var cycleVertical = function (values, index, numRows, numCols, delta) { - return withGrid(values, index, numCols, function (oldRow, oldColumn) { - var newRow = cycleBy(oldRow, delta, 0, numRows - 1); - var onLastRow = newRow === numRows - 1; - var colsInRow = onLastRow ? values.length - newRow * numCols : numCols; - var newCol = clamp(oldColumn, 0, colsInRow - 1); - return Optional.some({ - row: newRow, - column: newCol - }); + return withGrid(values, index, numCols, function (oldRow, oldColumn) { + var newRow = cycleBy(oldRow, delta, 0, numRows - 1); + var onLastRow = newRow === numRows - 1; + var colsInRow = onLastRow ? values.length - newRow * numCols : numCols; + var newCol = clamp(oldColumn, 0, colsInRow - 1); + return Optional.some({ + row: newRow, + column: newCol }); + }); }; var cycleRight = function (values, index, numRows, numCols) { - return cycleHorizontal(values, index, numRows, numCols, +1); + return cycleHorizontal(values, index, numRows, numCols, +1); }; var cycleLeft = function (values, index, numRows, numCols) { - return cycleHorizontal(values, index, numRows, numCols, -1); + return cycleHorizontal(values, index, numRows, numCols, -1); }; var cycleUp = function (values, index, numRows, numCols) { - return cycleVertical(values, index, numRows, numCols, -1); + return cycleVertical(values, index, numRows, numCols, -1); }; var cycleDown = function (values, index, numRows, numCols) { - return cycleVertical(values, index, numRows, numCols, +1); + return cycleVertical(values, index, numRows, numCols, +1); }; var schema$2 = [ - strict$1('selector'), - defaulted$1('execute', defaultExecute), - onKeyboardHandler('onEscape'), - defaulted$1('captureTab', false), - initSize() + strict$1('selector'), + defaulted$1('execute', defaultExecute), + onKeyboardHandler('onEscape'), + defaulted$1('captureTab', false), + initSize() ]; var focusIn = function (component, gridConfig, _gridState) { - descendant$1(component.element, gridConfig.selector).each(function (first) { - gridConfig.focusManager.set(component, first); - }); + descendant$1(component.element, gridConfig.selector).each(function (first) { + gridConfig.focusManager.set(component, first); + }); }; var findCurrent = function (component, gridConfig) { - return gridConfig.focusManager.get(component).bind(function (elem) { - return closest$2(elem, gridConfig.selector); - }); + return gridConfig.focusManager.get(component).bind(function (elem) { + return closest$2(elem, gridConfig.selector); + }); }; var execute$2 = function (component, simulatedEvent, gridConfig, _gridState) { - return findCurrent(component, gridConfig).bind(function (focused) { - return gridConfig.execute(component, simulatedEvent, focused); - }); + return findCurrent(component, gridConfig).bind(function (focused) { + return gridConfig.execute(component, simulatedEvent, focused); + }); }; var doMove = function (cycle) { - return function (element, focused, gridConfig, gridState) { - return locateVisible(element, focused, gridConfig.selector).bind(function (identified) { - return cycle(identified.candidates, identified.index, gridState.getNumRows().getOr(gridConfig.initSize.numRows), gridState.getNumColumns().getOr(gridConfig.initSize.numColumns)); - }); - }; + return function (element, focused, gridConfig, gridState) { + return locateVisible(element, focused, gridConfig.selector).bind(function (identified) { + return cycle(identified.candidates, identified.index, gridState.getNumRows().getOr(gridConfig.initSize.numRows), gridState.getNumColumns().getOr(gridConfig.initSize.numColumns)); + }); + }; }; var handleTab = function (_component, _simulatedEvent, gridConfig) { - return gridConfig.captureTab ? Optional.some(true) : Optional.none(); + return gridConfig.captureTab ? Optional.some(true) : Optional.none(); }; var doEscape = function (component, simulatedEvent, gridConfig) { - return gridConfig.onEscape(component, simulatedEvent); + return gridConfig.onEscape(component, simulatedEvent); }; var moveLeft = doMove(cycleLeft); var moveRight = doMove(cycleRight); var moveNorth = doMove(cycleUp); var moveSouth = doMove(cycleDown); var getKeydownRules$1 = constant([ - rule(inSet(LEFT), west(moveLeft, moveRight)), - rule(inSet(RIGHT), east(moveLeft, moveRight)), - rule(inSet(UP), north(moveNorth)), - rule(inSet(DOWN), south(moveSouth)), - rule(and([ - isShift, - inSet(TAB) - ]), handleTab), - rule(and([ - isNotShift, - inSet(TAB) - ]), handleTab), - rule(inSet(ESCAPE), doEscape), - rule(inSet(SPACE.concat(ENTER)), execute$2) + rule(inSet(LEFT), west(moveLeft, moveRight)), + rule(inSet(RIGHT), east(moveLeft, moveRight)), + rule(inSet(UP), north(moveNorth)), + rule(inSet(DOWN), south(moveSouth)), + rule(and([ + isShift, + inSet(TAB) + ]), handleTab), + rule(and([ + isNotShift, + inSet(TAB) + ]), handleTab), + rule(inSet(ESCAPE), doEscape), + rule(inSet(SPACE.concat(ENTER)), execute$2) ]); var getKeyupRules$1 = constant([rule(inSet(SPACE), stopEventForFirefox)]); var FlatgridType = typical(schema$2, flatgrid, getKeydownRules$1, getKeyupRules$1, function () { - return Optional.some(focusIn); + return Optional.some(focusIn); }); var horizontal = function (container, selector, current, delta) { - var isDisabledButton = function (candidate) { - return name(candidate) === 'button' && get$2(candidate, 'disabled') === 'disabled'; - }; - var tryCycle = function (initial, index, candidates) { - var newIndex = cycleBy(index, delta, 0, candidates.length - 1); - if (newIndex === initial) { - return Optional.none(); - } else { - return isDisabledButton(candidates[newIndex]) ? tryCycle(initial, newIndex, candidates) : Optional.from(candidates[newIndex]); - } - }; - return locateVisible(container, current, selector).bind(function (identified) { - var index = identified.index; - var candidates = identified.candidates; - return tryCycle(index, index, candidates); - }); + var isDisabledButton = function (candidate) { + return name(candidate) === 'button' && get$2(candidate, 'disabled') === 'disabled'; + }; + var tryCycle = function (initial, index, candidates) { + var newIndex = cycleBy(index, delta, 0, candidates.length - 1); + if (newIndex === initial) { + return Optional.none(); + } else { + return isDisabledButton(candidates[newIndex]) ? tryCycle(initial, newIndex, candidates) : Optional.from(candidates[newIndex]); + } + }; + return locateVisible(container, current, selector).bind(function (identified) { + var index = identified.index; + var candidates = identified.candidates; + return tryCycle(index, index, candidates); + }); }; var schema$3 = [ - strict$1('selector'), - defaulted$1('getInitial', Optional.none), - defaulted$1('execute', defaultExecute), - onKeyboardHandler('onEscape'), - defaulted$1('executeOnMove', false), - defaulted$1('allowVertical', true) + strict$1('selector'), + defaulted$1('getInitial', Optional.none), + defaulted$1('execute', defaultExecute), + onKeyboardHandler('onEscape'), + defaulted$1('executeOnMove', false), + defaulted$1('allowVertical', true) ]; var findCurrent$1 = function (component, flowConfig) { - return flowConfig.focusManager.get(component).bind(function (elem) { - return closest$2(elem, flowConfig.selector); - }); + return flowConfig.focusManager.get(component).bind(function (elem) { + return closest$2(elem, flowConfig.selector); + }); }; var execute$3 = function (component, simulatedEvent, flowConfig) { - return findCurrent$1(component, flowConfig).bind(function (focused) { - return flowConfig.execute(component, simulatedEvent, focused); - }); + return findCurrent$1(component, flowConfig).bind(function (focused) { + return flowConfig.execute(component, simulatedEvent, focused); + }); }; var focusIn$1 = function (component, flowConfig, _state) { - flowConfig.getInitial(component).orThunk(function () { - return descendant$1(component.element, flowConfig.selector); - }).each(function (first) { - flowConfig.focusManager.set(component, first); - }); + flowConfig.getInitial(component).orThunk(function () { + return descendant$1(component.element, flowConfig.selector); + }).each(function (first) { + flowConfig.focusManager.set(component, first); + }); }; var moveLeft$1 = function (element, focused, info) { - return horizontal(element, info.selector, focused, -1); + return horizontal(element, info.selector, focused, -1); }; var moveRight$1 = function (element, focused, info) { - return horizontal(element, info.selector, focused, +1); + return horizontal(element, info.selector, focused, +1); }; var doMove$1 = function (movement) { - return function (component, simulatedEvent, flowConfig, flowState) { - return movement(component, simulatedEvent, flowConfig, flowState).bind(function () { - return flowConfig.executeOnMove ? execute$3(component, simulatedEvent, flowConfig) : Optional.some(true); - }); - }; + return function (component, simulatedEvent, flowConfig, flowState) { + return movement(component, simulatedEvent, flowConfig, flowState).bind(function () { + return flowConfig.executeOnMove ? execute$3(component, simulatedEvent, flowConfig) : Optional.some(true); + }); + }; }; var doEscape$1 = function (component, simulatedEvent, flowConfig) { - return flowConfig.onEscape(component, simulatedEvent); + return flowConfig.onEscape(component, simulatedEvent); }; var getKeydownRules$2 = function (_component, _se, flowConfig, _flowState) { - var westMovers = LEFT.concat(flowConfig.allowVertical ? UP : []); - var eastMovers = RIGHT.concat(flowConfig.allowVertical ? DOWN : []); - return [ - rule(inSet(westMovers), doMove$1(west(moveLeft$1, moveRight$1))), - rule(inSet(eastMovers), doMove$1(east(moveLeft$1, moveRight$1))), - rule(inSet(ENTER), execute$3), - rule(inSet(SPACE), execute$3), - rule(inSet(ESCAPE), doEscape$1) - ]; + var westMovers = LEFT.concat(flowConfig.allowVertical ? UP : []); + var eastMovers = RIGHT.concat(flowConfig.allowVertical ? DOWN : []); + return [ + rule(inSet(westMovers), doMove$1(west(moveLeft$1, moveRight$1))), + rule(inSet(eastMovers), doMove$1(east(moveLeft$1, moveRight$1))), + rule(inSet(ENTER), execute$3), + rule(inSet(SPACE), execute$3), + rule(inSet(ESCAPE), doEscape$1) + ]; }; var getKeyupRules$2 = constant([rule(inSet(SPACE), stopEventForFirefox)]); var FlowType = typical(schema$3, NoState.init, getKeydownRules$2, getKeyupRules$2, function () { - return Optional.some(focusIn$1); + return Optional.some(focusIn$1); }); var toCell = function (matrix, rowIndex, columnIndex) { - return Optional.from(matrix[rowIndex]).bind(function (row) { - return Optional.from(row[columnIndex]).map(function (cell) { - return { - rowIndex: rowIndex, - columnIndex: columnIndex, - cell: cell - }; - }); + return Optional.from(matrix[rowIndex]).bind(function (row) { + return Optional.from(row[columnIndex]).map(function (cell) { + return { + rowIndex: rowIndex, + columnIndex: columnIndex, + cell: cell + }; }); + }); }; var cycleHorizontal$1 = function (matrix, rowIndex, startCol, deltaCol) { - var row = matrix[rowIndex]; - var colsInRow = row.length; - var newColIndex = cycleBy(startCol, deltaCol, 0, colsInRow - 1); - return toCell(matrix, rowIndex, newColIndex); + var row = matrix[rowIndex]; + var colsInRow = row.length; + var newColIndex = cycleBy(startCol, deltaCol, 0, colsInRow - 1); + return toCell(matrix, rowIndex, newColIndex); }; var cycleVertical$1 = function (matrix, colIndex, startRow, deltaRow) { - var nextRowIndex = cycleBy(startRow, deltaRow, 0, matrix.length - 1); - var colsInNextRow = matrix[nextRowIndex].length; - var nextColIndex = clamp(colIndex, 0, colsInNextRow - 1); - return toCell(matrix, nextRowIndex, nextColIndex); + var nextRowIndex = cycleBy(startRow, deltaRow, 0, matrix.length - 1); + var colsInNextRow = matrix[nextRowIndex].length; + var nextColIndex = clamp(colIndex, 0, colsInNextRow - 1); + return toCell(matrix, nextRowIndex, nextColIndex); }; var moveHorizontal = function (matrix, rowIndex, startCol, deltaCol) { - var row = matrix[rowIndex]; - var colsInRow = row.length; - var newColIndex = clamp(startCol + deltaCol, 0, colsInRow - 1); - return toCell(matrix, rowIndex, newColIndex); + var row = matrix[rowIndex]; + var colsInRow = row.length; + var newColIndex = clamp(startCol + deltaCol, 0, colsInRow - 1); + return toCell(matrix, rowIndex, newColIndex); }; var moveVertical = function (matrix, colIndex, startRow, deltaRow) { - var nextRowIndex = clamp(startRow + deltaRow, 0, matrix.length - 1); - var colsInNextRow = matrix[nextRowIndex].length; - var nextColIndex = clamp(colIndex, 0, colsInNextRow - 1); - return toCell(matrix, nextRowIndex, nextColIndex); + var nextRowIndex = clamp(startRow + deltaRow, 0, matrix.length - 1); + var colsInNextRow = matrix[nextRowIndex].length; + var nextColIndex = clamp(colIndex, 0, colsInNextRow - 1); + return toCell(matrix, nextRowIndex, nextColIndex); }; var cycleRight$1 = function (matrix, startRow, startCol) { - return cycleHorizontal$1(matrix, startRow, startCol, +1); + return cycleHorizontal$1(matrix, startRow, startCol, +1); }; var cycleLeft$1 = function (matrix, startRow, startCol) { - return cycleHorizontal$1(matrix, startRow, startCol, -1); + return cycleHorizontal$1(matrix, startRow, startCol, -1); }; var cycleUp$1 = function (matrix, startRow, startCol) { - return cycleVertical$1(matrix, startCol, startRow, -1); + return cycleVertical$1(matrix, startCol, startRow, -1); }; var cycleDown$1 = function (matrix, startRow, startCol) { - return cycleVertical$1(matrix, startCol, startRow, +1); + return cycleVertical$1(matrix, startCol, startRow, +1); }; var moveLeft$2 = function (matrix, startRow, startCol) { - return moveHorizontal(matrix, startRow, startCol, -1); + return moveHorizontal(matrix, startRow, startCol, -1); }; var moveRight$2 = function (matrix, startRow, startCol) { - return moveHorizontal(matrix, startRow, startCol, +1); + return moveHorizontal(matrix, startRow, startCol, +1); }; var moveUp = function (matrix, startRow, startCol) { - return moveVertical(matrix, startCol, startRow, -1); + return moveVertical(matrix, startCol, startRow, -1); }; var moveDown = function (matrix, startRow, startCol) { - return moveVertical(matrix, startCol, startRow, +1); + return moveVertical(matrix, startCol, startRow, +1); }; var schema$4 = [ - strictObjOf('selectors', [ - strict$1('row'), - strict$1('cell') - ]), - defaulted$1('cycles', true), - defaulted$1('previousSelector', Optional.none), - defaulted$1('execute', defaultExecute) + strictObjOf('selectors', [ + strict$1('row'), + strict$1('cell') + ]), + defaulted$1('cycles', true), + defaulted$1('previousSelector', Optional.none), + defaulted$1('execute', defaultExecute) ]; var focusIn$2 = function (component, matrixConfig, _state) { - var focused = matrixConfig.previousSelector(component).orThunk(function () { - var selectors = matrixConfig.selectors; - return descendant$1(component.element, selectors.cell); - }); - focused.each(function (cell) { - matrixConfig.focusManager.set(component, cell); - }); + var focused = matrixConfig.previousSelector(component).orThunk(function () { + var selectors = matrixConfig.selectors; + return descendant$1(component.element, selectors.cell); + }); + focused.each(function (cell) { + matrixConfig.focusManager.set(component, cell); + }); }; var execute$4 = function (component, simulatedEvent, matrixConfig) { - return search(component.element).bind(function (focused) { - return matrixConfig.execute(component, simulatedEvent, focused); - }); + return search(component.element).bind(function (focused) { + return matrixConfig.execute(component, simulatedEvent, focused); + }); }; var toMatrix = function (rows, matrixConfig) { - return map(rows, function (row) { - return descendants(row, matrixConfig.selectors.cell); - }); + return map(rows, function (row) { + return descendants(row, matrixConfig.selectors.cell); + }); }; var doMove$2 = function (ifCycle, ifMove) { - return function (element, focused, matrixConfig) { - var move = matrixConfig.cycles ? ifCycle : ifMove; - return closest$2(focused, matrixConfig.selectors.row).bind(function (inRow) { - var cellsInRow = descendants(inRow, matrixConfig.selectors.cell); - return findIndex$1(cellsInRow, focused).bind(function (colIndex) { - var allRows = descendants(element, matrixConfig.selectors.row); - return findIndex$1(allRows, inRow).bind(function (rowIndex) { - var matrix = toMatrix(allRows, matrixConfig); - return move(matrix, rowIndex, colIndex).map(function (next) { - return next.cell; - }); - }); - }); - }); - }; + return function (element, focused, matrixConfig) { + var move = matrixConfig.cycles ? ifCycle : ifMove; + return closest$2(focused, matrixConfig.selectors.row).bind(function (inRow) { + var cellsInRow = descendants(inRow, matrixConfig.selectors.cell); + return findIndex$1(cellsInRow, focused).bind(function (colIndex) { + var allRows = descendants(element, matrixConfig.selectors.row); + return findIndex$1(allRows, inRow).bind(function (rowIndex) { + var matrix = toMatrix(allRows, matrixConfig); + return move(matrix, rowIndex, colIndex).map(function (next) { + return next.cell; + }); + }); + }); + }); + }; }; var moveLeft$3 = doMove$2(cycleLeft$1, moveLeft$2); var moveRight$3 = doMove$2(cycleRight$1, moveRight$2); var moveNorth$1 = doMove$2(cycleUp$1, moveUp); var moveSouth$1 = doMove$2(cycleDown$1, moveDown); var getKeydownRules$3 = constant([ - rule(inSet(LEFT), west(moveLeft$3, moveRight$3)), - rule(inSet(RIGHT), east(moveLeft$3, moveRight$3)), - rule(inSet(UP), north(moveNorth$1)), - rule(inSet(DOWN), south(moveSouth$1)), - rule(inSet(SPACE.concat(ENTER)), execute$4) + rule(inSet(LEFT), west(moveLeft$3, moveRight$3)), + rule(inSet(RIGHT), east(moveLeft$3, moveRight$3)), + rule(inSet(UP), north(moveNorth$1)), + rule(inSet(DOWN), south(moveSouth$1)), + rule(inSet(SPACE.concat(ENTER)), execute$4) ]); var getKeyupRules$3 = constant([rule(inSet(SPACE), stopEventForFirefox)]); var MatrixType = typical(schema$4, NoState.init, getKeydownRules$3, getKeyupRules$3, function () { - return Optional.some(focusIn$2); + return Optional.some(focusIn$2); }); var schema$5 = [ - strict$1('selector'), - defaulted$1('execute', defaultExecute), - defaulted$1('moveOnTab', false) + strict$1('selector'), + defaulted$1('execute', defaultExecute), + defaulted$1('moveOnTab', false) ]; var execute$5 = function (component, simulatedEvent, menuConfig) { - return menuConfig.focusManager.get(component).bind(function (focused) { - return menuConfig.execute(component, simulatedEvent, focused); - }); + return menuConfig.focusManager.get(component).bind(function (focused) { + return menuConfig.execute(component, simulatedEvent, focused); + }); }; var focusIn$3 = function (component, menuConfig, _state) { - descendant$1(component.element, menuConfig.selector).each(function (first) { - menuConfig.focusManager.set(component, first); - }); + descendant$1(component.element, menuConfig.selector).each(function (first) { + menuConfig.focusManager.set(component, first); + }); }; var moveUp$1 = function (element, focused, info) { - return horizontal(element, info.selector, focused, -1); + return horizontal(element, info.selector, focused, -1); }; var moveDown$1 = function (element, focused, info) { - return horizontal(element, info.selector, focused, +1); + return horizontal(element, info.selector, focused, +1); }; var fireShiftTab = function (component, simulatedEvent, menuConfig, menuState) { - return menuConfig.moveOnTab ? move(moveUp$1)(component, simulatedEvent, menuConfig, menuState) : Optional.none(); + return menuConfig.moveOnTab ? move(moveUp$1)(component, simulatedEvent, menuConfig, menuState) : Optional.none(); }; var fireTab = function (component, simulatedEvent, menuConfig, menuState) { - return menuConfig.moveOnTab ? move(moveDown$1)(component, simulatedEvent, menuConfig, menuState) : Optional.none(); + return menuConfig.moveOnTab ? move(moveDown$1)(component, simulatedEvent, menuConfig, menuState) : Optional.none(); }; var getKeydownRules$4 = constant([ - rule(inSet(UP), move(moveUp$1)), - rule(inSet(DOWN), move(moveDown$1)), - rule(and([ - isShift, - inSet(TAB) - ]), fireShiftTab), - rule(and([ - isNotShift, - inSet(TAB) - ]), fireTab), - rule(inSet(ENTER), execute$5), - rule(inSet(SPACE), execute$5) + rule(inSet(UP), move(moveUp$1)), + rule(inSet(DOWN), move(moveDown$1)), + rule(and([ + isShift, + inSet(TAB) + ]), fireShiftTab), + rule(and([ + isNotShift, + inSet(TAB) + ]), fireTab), + rule(inSet(ENTER), execute$5), + rule(inSet(SPACE), execute$5) ]); var getKeyupRules$4 = constant([rule(inSet(SPACE), stopEventForFirefox)]); var MenuType = typical(schema$5, NoState.init, getKeydownRules$4, getKeyupRules$4, function () { - return Optional.some(focusIn$3); + return Optional.some(focusIn$3); }); var schema$6 = [ - onKeyboardHandler('onSpace'), - onKeyboardHandler('onEnter'), - onKeyboardHandler('onShiftEnter'), - onKeyboardHandler('onLeft'), - onKeyboardHandler('onRight'), - onKeyboardHandler('onTab'), - onKeyboardHandler('onShiftTab'), - onKeyboardHandler('onUp'), - onKeyboardHandler('onDown'), - onKeyboardHandler('onEscape'), - defaulted$1('stopSpaceKeyup', false), - option('focusIn') + onKeyboardHandler('onSpace'), + onKeyboardHandler('onEnter'), + onKeyboardHandler('onShiftEnter'), + onKeyboardHandler('onLeft'), + onKeyboardHandler('onRight'), + onKeyboardHandler('onTab'), + onKeyboardHandler('onShiftTab'), + onKeyboardHandler('onUp'), + onKeyboardHandler('onDown'), + onKeyboardHandler('onEscape'), + defaulted$1('stopSpaceKeyup', false), + option('focusIn') ]; var getKeydownRules$5 = function (component, simulatedEvent, specialInfo) { - return [ - rule(inSet(SPACE), specialInfo.onSpace), - rule(and([ - isNotShift, - inSet(ENTER) - ]), specialInfo.onEnter), - rule(and([ - isShift, - inSet(ENTER) - ]), specialInfo.onShiftEnter), - rule(and([ - isShift, - inSet(TAB) - ]), specialInfo.onShiftTab), - rule(and([ - isNotShift, - inSet(TAB) - ]), specialInfo.onTab), - rule(inSet(UP), specialInfo.onUp), - rule(inSet(DOWN), specialInfo.onDown), - rule(inSet(LEFT), specialInfo.onLeft), - rule(inSet(RIGHT), specialInfo.onRight), - rule(inSet(SPACE), specialInfo.onSpace), - rule(inSet(ESCAPE), specialInfo.onEscape) - ]; + return [ + rule(inSet(SPACE), specialInfo.onSpace), + rule(and([ + isNotShift, + inSet(ENTER) + ]), specialInfo.onEnter), + rule(and([ + isShift, + inSet(ENTER) + ]), specialInfo.onShiftEnter), + rule(and([ + isShift, + inSet(TAB) + ]), specialInfo.onShiftTab), + rule(and([ + isNotShift, + inSet(TAB) + ]), specialInfo.onTab), + rule(inSet(UP), specialInfo.onUp), + rule(inSet(DOWN), specialInfo.onDown), + rule(inSet(LEFT), specialInfo.onLeft), + rule(inSet(RIGHT), specialInfo.onRight), + rule(inSet(SPACE), specialInfo.onSpace), + rule(inSet(ESCAPE), specialInfo.onEscape) + ]; }; var getKeyupRules$5 = function (component, simulatedEvent, specialInfo) { - return specialInfo.stopSpaceKeyup ? [rule(inSet(SPACE), stopEventForFirefox)] : []; + return specialInfo.stopSpaceKeyup ? [rule(inSet(SPACE), stopEventForFirefox)] : []; }; var SpecialType = typical(schema$6, NoState.init, getKeydownRules$5, getKeyupRules$5, function (specialInfo) { - return specialInfo.focusIn; + return specialInfo.focusIn; }); var acyclic = AcyclicType.schema(); @@ -4409,152 +4405,152 @@ }); var isFlatgridState = function (keyState) { - return hasNonNullableKey(keyState, 'setGridSize'); + return hasNonNullableKey(keyState, 'setGridSize'); }; var Keying = createModes$1({ - branchKey: 'mode', - branches: KeyboardBranches, - name: 'keying', - active: { - events: function (keyingConfig, keyingState) { - var handler = keyingConfig.handler; - return handler.toEvents(keyingConfig, keyingState); - } - }, - apis: { - focusIn: function (component, keyConfig, keyState) { - keyConfig.sendFocusIn(keyConfig).fold(function () { - component.getSystem().triggerFocus(component.element, component.element); - }, function (sendFocusIn) { - sendFocusIn(component, keyConfig, keyState); - }); - }, - setGridSize: function (component, keyConfig, keyState, numRows, numColumns) { - if (!isFlatgridState(keyState)) { - console.error('Layout does not support setGridSize'); - } else { - keyState.setGridSize(numRows, numColumns); - } - } + branchKey: 'mode', + branches: KeyboardBranches, + name: 'keying', + active: { + events: function (keyingConfig, keyingState) { + var handler = keyingConfig.handler; + return handler.toEvents(keyingConfig, keyingState); + } + }, + apis: { + focusIn: function (component, keyConfig, keyState) { + keyConfig.sendFocusIn(keyConfig).fold(function () { + component.getSystem().triggerFocus(component.element, component.element); + }, function (sendFocusIn) { + sendFocusIn(component, keyConfig, keyState); + }); }, - state: KeyingState + setGridSize: function (component, keyConfig, keyState, numRows, numColumns) { + if (!isFlatgridState(keyState)) { + console.error('Layout does not support setGridSize'); + } else { + keyState.setGridSize(numRows, numColumns); + } + } + }, + state: KeyingState }); var field$1 = function (name, forbidden) { - return defaultedObjOf(name, {}, map(forbidden, function (f) { - return forbid(f.name(), 'Cannot configure ' + f.name() + ' for ' + name); - }).concat([state$1('dump', identity)])); + return defaultedObjOf(name, {}, map(forbidden, function (f) { + return forbid(f.name(), 'Cannot configure ' + f.name() + ' for ' + name); + }).concat([state$1('dump', identity)])); }; var get$7 = function (data) { - return data.dump; + return data.dump; }; var augment = function (data, original) { - return __assign(__assign({}, data.dump), derive$1(original)); + return __assign(__assign({}, data.dump), derive$1(original)); }; var SketchBehaviours = { - field: field$1, - augment: augment, - get: get$7 + field: field$1, + augment: augment, + get: get$7 }; var _placeholder = 'placeholder'; var adt$2 = Adt.generate([ - { - single: [ - 'required', - 'valueThunk' - ] - }, - { - multiple: [ - 'required', - 'valueThunks' - ] - } + { + single: [ + 'required', + 'valueThunk' + ] + }, + { + multiple: [ + 'required', + 'valueThunks' + ] + } ]); var isSubstituted = function (spec) { - return has(spec, 'uiType'); + return has(spec, 'uiType'); }; var subPlaceholder = function (owner, detail, compSpec, placeholders) { - if (owner.exists(function (o) { - return o !== compSpec.owner; + if (owner.exists(function (o) { + return o !== compSpec.owner; })) { - return adt$2.single(true, constant(compSpec)); - } - return get$1(placeholders, compSpec.name).fold(function () { - throw new Error('Unknown placeholder component: ' + compSpec.name + '\nKnown: [' + keys(placeholders) + ']\nNamespace: ' + owner.getOr('none') + '\nSpec: ' + JSON.stringify(compSpec, null, 2)); - }, function (newSpec) { - return newSpec.replace(); - }); + return adt$2.single(true, constant(compSpec)); + } + return get$1(placeholders, compSpec.name).fold(function () { + throw new Error('Unknown placeholder component: ' + compSpec.name + '\nKnown: [' + keys(placeholders) + ']\nNamespace: ' + owner.getOr('none') + '\nSpec: ' + JSON.stringify(compSpec, null, 2)); + }, function (newSpec) { + return newSpec.replace(); + }); }; var scan = function (owner, detail, compSpec, placeholders) { - if (isSubstituted(compSpec) && compSpec.uiType === _placeholder) { - return subPlaceholder(owner, detail, compSpec, placeholders); - } else { - return adt$2.single(false, constant(compSpec)); - } + if (isSubstituted(compSpec) && compSpec.uiType === _placeholder) { + return subPlaceholder(owner, detail, compSpec, placeholders); + } else { + return adt$2.single(false, constant(compSpec)); + } }; var substitute = function (owner, detail, compSpec, placeholders) { - var base = scan(owner, detail, compSpec, placeholders); - return base.fold(function (req, valueThunk) { - var value = isSubstituted(compSpec) ? valueThunk(detail, compSpec.config, compSpec.validated) : valueThunk(detail); - var childSpecs = get$1(value, 'components').getOr([]); - var substituted = bind(childSpecs, function (c) { - return substitute(owner, detail, c, placeholders); - }); - return [__assign(__assign({}, value), {components: substituted})]; - }, function (req, valuesThunk) { - if (isSubstituted(compSpec)) { - var values = valuesThunk(detail, compSpec.config, compSpec.validated); - var preprocessor = compSpec.validated.preprocess.getOr(identity); - return preprocessor(values); - } else { - return valuesThunk(detail); - } - }); + var base = scan(owner, detail, compSpec, placeholders); + return base.fold(function (req, valueThunk) { + var value = isSubstituted(compSpec) ? valueThunk(detail, compSpec.config, compSpec.validated) : valueThunk(detail); + var childSpecs = get$1(value, 'components').getOr([]); + var substituted = bind(childSpecs, function (c) { + return substitute(owner, detail, c, placeholders); + }); + return [__assign(__assign({}, value), { components: substituted })]; + }, function (req, valuesThunk) { + if (isSubstituted(compSpec)) { + var values = valuesThunk(detail, compSpec.config, compSpec.validated); + var preprocessor = compSpec.validated.preprocess.getOr(identity); + return preprocessor(values); + } else { + return valuesThunk(detail); + } + }); }; var substituteAll = function (owner, detail, components, placeholders) { - return bind(components, function (c) { - return substitute(owner, detail, c, placeholders); - }); + return bind(components, function (c) { + return substitute(owner, detail, c, placeholders); + }); }; var oneReplace = function (label, replacements) { - var called = false; - var used = function () { - return called; - }; - var replace = function () { - if (called) { - throw new Error('Trying to use the same placeholder more than once: ' + label); - } - called = true; - return replacements; - }; - var required = function () { - return replacements.fold(function (req, _) { - return req; - }, function (req, _) { - return req; - }); - }; - return { - name: constant(label), - required: required, - used: used, - replace: replace - }; + var called = false; + var used = function () { + return called; + }; + var replace = function () { + if (called) { + throw new Error('Trying to use the same placeholder more than once: ' + label); + } + called = true; + return replacements; + }; + var required = function () { + return replacements.fold(function (req, _) { + return req; + }, function (req, _) { + return req; + }); + }; + return { + name: constant(label), + required: required, + used: used, + replace: replace + }; }; var substitutePlaces = function (owner, detail, components, placeholders) { - var ps = map$1(placeholders, function (ph, name) { - return oneReplace(name, ph); - }); - var outcome = substituteAll(owner, detail, components, ps); - each$1(ps, function (p) { - if (p.used() === false && p.required()) { - throw new Error('Placeholder: ' + p.name() + ' was not found in components list\nNamespace: ' + owner.getOr('none') + '\nComponents: ' + JSON.stringify(detail.components, null, 2)); - } - }); - return outcome; + var ps = map$1(placeholders, function (ph, name) { + return oneReplace(name, ph); + }); + var outcome = substituteAll(owner, detail, components, ps); + each$1(ps, function (p) { + if (p.used() === false && p.required()) { + throw new Error('Placeholder: ' + p.name() + ' was not found in components list\nNamespace: ' + owner.getOr('none') + '\nComponents: ' + JSON.stringify(detail.components, null, 2)); + } + }); + return outcome; }; var single = adt$2.single; var multiple = adt$2.multiple; @@ -4562,76 +4558,76 @@ var unique = 0; var generate$1 = function (prefix) { - var date = new Date(); - var time = date.getTime(); - var random = Math.floor(Math.random() * 1000000000); - unique++; - return prefix + '_' + random + unique + String(time); + var date = new Date(); + var time = date.getTime(); + var random = Math.floor(Math.random() * 1000000000); + unique++; + return prefix + '_' + random + unique + String(time); }; var adt$3 = Adt.generate([ - {required: ['data']}, - {external: ['data']}, - {optional: ['data']}, - {group: ['data']} + { required: ['data'] }, + { external: ['data'] }, + { optional: ['data'] }, + { group: ['data'] } ]); - var fFactory = defaulted$1('factory', {sketch: identity}); + var fFactory = defaulted$1('factory', { sketch: identity }); var fSchema = defaulted$1('schema', []); var fName = strict$1('name'); var fPname = field('pname', 'pname', defaultedThunk(function (typeSpec) { - return ''; + return ''; }), anyValue$1()); var fGroupSchema = state$1('schema', function () { - return [option('preprocess')]; + return [option('preprocess')]; }); var fDefaults = defaulted$1('defaults', constant({})); var fOverrides = defaulted$1('overrides', constant({})); var requiredSpec = objOf([ - fFactory, - fSchema, - fName, - fPname, - fDefaults, - fOverrides + fFactory, + fSchema, + fName, + fPname, + fDefaults, + fOverrides ]); var externalSpec = objOf([ - fFactory, - fSchema, - fName, - fDefaults, - fOverrides + fFactory, + fSchema, + fName, + fDefaults, + fOverrides ]); var optionalSpec = objOf([ - fFactory, - fSchema, - fName, - fPname, - fDefaults, - fOverrides + fFactory, + fSchema, + fName, + fPname, + fDefaults, + fOverrides ]); var groupSpec = objOf([ - fFactory, - fGroupSchema, - fName, - strict$1('unit'), - fPname, - fDefaults, - fOverrides + fFactory, + fGroupSchema, + fName, + strict$1('unit'), + fPname, + fDefaults, + fOverrides ]); var asNamedPart = function (part) { - return part.fold(Optional.some, Optional.none, Optional.some, Optional.some); + return part.fold(Optional.some, Optional.none, Optional.some, Optional.some); }; var name$1 = function (part) { - var get = function (data) { - return data.name; - }; - return part.fold(get, get, get, get); + var get = function (data) { + return data.name; + }; + return part.fold(get, get, get, get); }; var convert = function (adtConstructor, partSchema) { - return function (spec) { - var data = asRawOrDie('Converting part type', partSchema, spec); - return adtConstructor(data); - }; + return function (spec) { + var data = asRawOrDie('Converting part type', partSchema, spec); + return adtConstructor(data); + }; }; var required = convert(adt$3.required, requiredSpec); var external = convert(adt$3.external, externalSpec); @@ -4640,132 +4636,132 @@ var original = constant('entirety'); var combine = function (detail, data, partSpec, partValidated) { - return deepMerge(data.defaults(detail, partSpec, partValidated), partSpec, {uid: detail.partUids[data.name]}, data.overrides(detail, partSpec, partValidated)); + return deepMerge(data.defaults(detail, partSpec, partValidated), partSpec, { uid: detail.partUids[data.name] }, data.overrides(detail, partSpec, partValidated)); }; var subs = function (owner, detail, parts) { - var internals = {}; - var externals = {}; - each(parts, function (part) { - part.fold(function (data) { - internals[data.pname] = single(true, function (detail, partSpec, partValidated) { - return data.factory.sketch(combine(detail, data, partSpec, partValidated)); - }); - }, function (data) { - var partSpec = detail.parts[data.name]; - externals[data.name] = constant(data.factory.sketch(combine(detail, data, partSpec[original()]), partSpec)); - }, function (data) { - internals[data.pname] = single(false, function (detail, partSpec, partValidated) { - return data.factory.sketch(combine(detail, data, partSpec, partValidated)); - }); - }, function (data) { - internals[data.pname] = multiple(true, function (detail, _partSpec, _partValidated) { - var units = detail[data.name]; - return map(units, function (u) { - return data.factory.sketch(deepMerge(data.defaults(detail, u, _partValidated), u, data.overrides(detail, u))); - }); - }); + var internals = {}; + var externals = {}; + each(parts, function (part) { + part.fold(function (data) { + internals[data.pname] = single(true, function (detail, partSpec, partValidated) { + return data.factory.sketch(combine(detail, data, partSpec, partValidated)); + }); + }, function (data) { + var partSpec = detail.parts[data.name]; + externals[data.name] = constant(data.factory.sketch(combine(detail, data, partSpec[original()]), partSpec)); + }, function (data) { + internals[data.pname] = single(false, function (detail, partSpec, partValidated) { + return data.factory.sketch(combine(detail, data, partSpec, partValidated)); + }); + }, function (data) { + internals[data.pname] = multiple(true, function (detail, _partSpec, _partValidated) { + var units = detail[data.name]; + return map(units, function (u) { + return data.factory.sketch(deepMerge(data.defaults(detail, u, _partValidated), u, data.overrides(detail, u))); }); + }); }); - return { - internals: constant(internals), - externals: constant(externals) - }; + }); + return { + internals: constant(internals), + externals: constant(externals) + }; }; var generate$2 = function (owner, parts) { - var r = {}; - each(parts, function (part) { - asNamedPart(part).each(function (np) { - var g = doGenerateOne(owner, np.pname); - r[np.name] = function (config) { - var validated = asRawOrDie('Part: ' + np.name + ' in ' + owner, objOf(np.schema), config); - return __assign(__assign({}, g), { - config: config, - validated: validated - }); - }; + var r = {}; + each(parts, function (part) { + asNamedPart(part).each(function (np) { + var g = doGenerateOne(owner, np.pname); + r[np.name] = function (config) { + var validated = asRawOrDie('Part: ' + np.name + ' in ' + owner, objOf(np.schema), config); + return __assign(__assign({}, g), { + config: config, + validated: validated }); + }; }); - return r; + }); + return r; }; var doGenerateOne = function (owner, pname) { - return { - uiType: placeholder(), - owner: owner, - name: pname - }; + return { + uiType: placeholder(), + owner: owner, + name: pname + }; }; var generateOne = function (owner, pname, config) { - return { - uiType: placeholder(), - owner: owner, - name: pname, - config: config, - validated: {} - }; + return { + uiType: placeholder(), + owner: owner, + name: pname, + config: config, + validated: {} + }; }; var schemas = function (parts) { - return bind(parts, function (part) { - return part.fold(Optional.none, Optional.some, Optional.none, Optional.none).map(function (data) { - return strictObjOf(data.name, data.schema.concat([snapshot(original())])); - }).toArray(); - }); + return bind(parts, function (part) { + return part.fold(Optional.none, Optional.some, Optional.none, Optional.none).map(function (data) { + return strictObjOf(data.name, data.schema.concat([snapshot(original())])); + }).toArray(); + }); }; var names = function (parts) { - return map(parts, name$1); + return map(parts, name$1); }; var substitutes = function (owner, detail, parts) { - return subs(owner, detail, parts); + return subs(owner, detail, parts); }; var components = function (owner, detail, internals) { - return substitutePlaces(Optional.some(owner), detail, detail.components, internals); + return substitutePlaces(Optional.some(owner), detail, detail.components, internals); }; var getPart = function (component, detail, partKey) { - var uid = detail.partUids[partKey]; - return component.getSystem().getByUid(uid).toOptional(); + var uid = detail.partUids[partKey]; + return component.getSystem().getByUid(uid).toOptional(); }; var getPartOrDie = function (component, detail, partKey) { - return getPart(component, detail, partKey).getOrDie('Could not find part: ' + partKey); + return getPart(component, detail, partKey).getOrDie('Could not find part: ' + partKey); }; var getAllParts = function (component, detail) { - var system = component.getSystem(); - return map$1(detail.partUids, function (pUid, _k) { - return constant(system.getByUid(pUid)); - }); + var system = component.getSystem(); + return map$1(detail.partUids, function (pUid, _k) { + return constant(system.getByUid(pUid)); + }); }; var defaultUids = function (baseUid, partTypes) { - var partNames = names(partTypes); - return wrapAll$1(map(partNames, function (pn) { - return { - key: pn, - value: baseUid + '-' + pn - }; - })); + var partNames = names(partTypes); + return wrapAll$1(map(partNames, function (pn) { + return { + key: pn, + value: baseUid + '-' + pn + }; + })); }; var defaultUidsSchema = function (partTypes) { - return field('partUids', 'partUids', mergeWithThunk(function (spec) { - return defaultUids(spec.uid, partTypes); - }), anyValue$1()); + return field('partUids', 'partUids', mergeWithThunk(function (spec) { + return defaultUids(spec.uid, partTypes); + }), anyValue$1()); }; var premadeTag = generate$1('alloy-premade'); var premade = function (comp) { - return wrap$1(premadeTag, comp); + return wrap$1(premadeTag, comp); }; var getPremade = function (spec) { - return get$1(spec, premadeTag); + return get$1(spec, premadeTag); }; var makeApi = function (f) { - return markAsSketchApi(function (component) { - var rest = []; - for (var _i = 1; _i < arguments.length; _i++) { - rest[_i - 1] = arguments[_i]; - } - return f.apply(void 0, __spreadArrays([ - component.getApis(), - component - ], rest)); - }, f); + return markAsSketchApi(function (component) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + return f.apply(void 0, __spreadArrays([ + component.getApis(), + component + ], rest)); + }, f); }; var prefix$1 = constant('alloy-id-'); @@ -4774,180 +4770,179 @@ var prefix$2 = prefix$1(); var idAttr$1 = idAttr(); var write = function (label, elem) { - var id = generate$1(prefix$2 + label); - writeOnly(elem, id); - return id; + var id = generate$1(prefix$2 + label); + writeOnly(elem, id); + return id; }; var writeOnly = function (elem, uid) { - Object.defineProperty(elem.dom, idAttr$1, { - value: uid, - writable: true - }); + Object.defineProperty(elem.dom, idAttr$1, { + value: uid, + writable: true + }); }; var read$2 = function (elem) { - var id = isElement(elem) ? elem.dom[idAttr$1] : null; - return Optional.from(id); + var id = isElement(elem) ? elem.dom[idAttr$1] : null; + return Optional.from(id); }; var generate$3 = function (prefix) { - return generate$1(prefix); + return generate$1(prefix); }; var base = function (partSchemas, partUidsSchemas) { - var ps = partSchemas.length > 0 ? [strictObjOf('parts', partSchemas)] : []; - return ps.concat([ - strict$1('uid'), - defaulted$1('dom', {}), - defaulted$1('components', []), - snapshot('originalSpec'), - defaulted$1('debug.sketcher', {}) - ]).concat(partUidsSchemas); + var ps = partSchemas.length > 0 ? [strictObjOf('parts', partSchemas)] : []; + return ps.concat([ + strict$1('uid'), + defaulted$1('dom', {}), + defaulted$1('components', []), + snapshot('originalSpec'), + defaulted$1('debug.sketcher', {}) + ]).concat(partUidsSchemas); }; var asRawOrDie$1 = function (label, schema, spec, partSchemas, partUidsSchemas) { - var baseS = base(partSchemas, partUidsSchemas); - return asRawOrDie(label + ' [SpecSchema]', objOfOnly(baseS.concat(schema)), spec); + var baseS = base(partSchemas, partUidsSchemas); + return asRawOrDie(label + ' [SpecSchema]', objOfOnly(baseS.concat(schema)), spec); }; var single$1 = function (owner, schema, factory, spec) { - var specWithUid = supplyUid(spec); - var detail = asRawOrDie$1(owner, schema, specWithUid, [], []); - return factory(detail, specWithUid); + var specWithUid = supplyUid(spec); + var detail = asRawOrDie$1(owner, schema, specWithUid, [], []); + return factory(detail, specWithUid); }; var composite = function (owner, schema, partTypes, factory, spec) { - var specWithUid = supplyUid(spec); - var partSchemas = schemas(partTypes); - var partUidsSchema = defaultUidsSchema(partTypes); - var detail = asRawOrDie$1(owner, schema, specWithUid, partSchemas, [partUidsSchema]); - var subs = substitutes(owner, detail, partTypes); - var components$1 = components(owner, detail, subs.internals()); - return factory(detail, components$1, specWithUid, subs.externals()); + var specWithUid = supplyUid(spec); + var partSchemas = schemas(partTypes); + var partUidsSchema = defaultUidsSchema(partTypes); + var detail = asRawOrDie$1(owner, schema, specWithUid, partSchemas, [partUidsSchema]); + var subs = substitutes(owner, detail, partTypes); + var components$1 = components(owner, detail, subs.internals()); + return factory(detail, components$1, specWithUid, subs.externals()); }; var hasUid = function (spec) { - return has(spec, 'uid'); + return has(spec, 'uid'); }; var supplyUid = function (spec) { - return hasUid(spec) ? spec : __assign(__assign({}, spec), {uid: generate$3('uid')}); + return hasUid(spec) ? spec : __assign(__assign({}, spec), { uid: generate$3('uid') }); }; function isSketchSpec(spec) { - return spec.uid !== undefined; + return spec.uid !== undefined; } - var singleSchema = objOfOnly([ - strict$1('name'), - strict$1('factory'), - strict$1('configFields'), - defaulted$1('apis', {}), - defaulted$1('extraApis', {}) + strict$1('name'), + strict$1('factory'), + strict$1('configFields'), + defaulted$1('apis', {}), + defaulted$1('extraApis', {}) ]); var compositeSchema = objOfOnly([ - strict$1('name'), - strict$1('factory'), - strict$1('configFields'), - strict$1('partFields'), - defaulted$1('apis', {}), - defaulted$1('extraApis', {}) + strict$1('name'), + strict$1('factory'), + strict$1('configFields'), + strict$1('partFields'), + defaulted$1('apis', {}), + defaulted$1('extraApis', {}) ]); var single$2 = function (rawConfig) { - var config = asRawOrDie('Sketcher for ' + rawConfig.name, singleSchema, rawConfig); - var sketch = function (spec) { - return single$1(config.name, config.configFields, config.factory, spec); - }; - var apis = map$1(config.apis, makeApi); - var extraApis = map$1(config.extraApis, function (f, k) { - return markAsExtraApi(f, k); - }); - return __assign(__assign({ - name: config.name, - configFields: config.configFields, - sketch: sketch - }, apis), extraApis); + var config = asRawOrDie('Sketcher for ' + rawConfig.name, singleSchema, rawConfig); + var sketch = function (spec) { + return single$1(config.name, config.configFields, config.factory, spec); + }; + var apis = map$1(config.apis, makeApi); + var extraApis = map$1(config.extraApis, function (f, k) { + return markAsExtraApi(f, k); + }); + return __assign(__assign({ + name: config.name, + configFields: config.configFields, + sketch: sketch + }, apis), extraApis); }; var composite$1 = function (rawConfig) { - var config = asRawOrDie('Sketcher for ' + rawConfig.name, compositeSchema, rawConfig); - var sketch = function (spec) { - return composite(config.name, config.configFields, config.partFields, config.factory, spec); - }; - var parts = generate$2(config.name, config.partFields); - var apis = map$1(config.apis, makeApi); - var extraApis = map$1(config.extraApis, function (f, k) { - return markAsExtraApi(f, k); - }); - return __assign(__assign({ - name: config.name, - partFields: config.partFields, - configFields: config.configFields, - sketch: sketch, - parts: parts - }, apis), extraApis); + var config = asRawOrDie('Sketcher for ' + rawConfig.name, compositeSchema, rawConfig); + var sketch = function (spec) { + return composite(config.name, config.configFields, config.partFields, config.factory, spec); + }; + var parts = generate$2(config.name, config.partFields); + var apis = map$1(config.apis, makeApi); + var extraApis = map$1(config.extraApis, function (f, k) { + return markAsExtraApi(f, k); + }); + return __assign(__assign({ + name: config.name, + partFields: config.partFields, + configFields: config.configFields, + sketch: sketch, + parts: parts + }, apis), extraApis); }; var factory = function (detail) { - var events = events$2(detail.action); - var tag = detail.dom.tag; - var lookupAttr = function (attr) { - return get$1(detail.dom, 'attributes').bind(function (attrs) { - return get$1(attrs, attr); - }); - }; - var getModAttributes = function () { - if (tag === 'button') { - var type = lookupAttr('type').getOr('button'); - var roleAttrs = lookupAttr('role').map(function (role) { - return {role: role}; - }).getOr({}); - return __assign({type: type}, roleAttrs); - } else { - var role = lookupAttr('role').getOr('button'); - return {role: role}; - } - }; - return { - uid: detail.uid, - dom: detail.dom, - components: detail.components, - events: events, - behaviours: SketchBehaviours.augment(detail.buttonBehaviours, [ - Focusing.config({}), - Keying.config({ - mode: 'execution', - useSpace: true, - useEnter: true - }) - ]), - domModification: {attributes: getModAttributes()}, - eventOrder: detail.eventOrder - }; + var events = events$2(detail.action); + var tag = detail.dom.tag; + var lookupAttr = function (attr) { + return get$1(detail.dom, 'attributes').bind(function (attrs) { + return get$1(attrs, attr); + }); + }; + var getModAttributes = function () { + if (tag === 'button') { + var type = lookupAttr('type').getOr('button'); + var roleAttrs = lookupAttr('role').map(function (role) { + return { role: role }; + }).getOr({}); + return __assign({ type: type }, roleAttrs); + } else { + var role = lookupAttr('role').getOr('button'); + return { role: role }; + } + }; + return { + uid: detail.uid, + dom: detail.dom, + components: detail.components, + events: events, + behaviours: SketchBehaviours.augment(detail.buttonBehaviours, [ + Focusing.config({}), + Keying.config({ + mode: 'execution', + useSpace: true, + useEnter: true + }) + ]), + domModification: { attributes: getModAttributes() }, + eventOrder: detail.eventOrder + }; }; var Button = single$2({ - name: 'Button', - factory: factory, - configFields: [ - defaulted$1('uid', undefined), - strict$1('dom'), - defaulted$1('components', []), - SketchBehaviours.field('buttonBehaviours', [ - Focusing, - Keying - ]), - option('action'), - option('role'), - defaulted$1('eventOrder', {}) - ] + name: 'Button', + factory: factory, + configFields: [ + defaulted$1('uid', undefined), + strict$1('dom'), + defaulted$1('components', []), + SketchBehaviours.field('buttonBehaviours', [ + Focusing, + Keying + ]), + option('action'), + option('role'), + defaulted$1('eventOrder', {}) + ] }); var exhibit$2 = function () { - return nu$5({ - styles: { - '-webkit-user-select': 'none', - 'user-select': 'none', - '-ms-user-select': 'none', - '-moz-user-select': '-moz-none' - }, - attributes: {unselectable: 'on'} - }); + return nu$5({ + styles: { + '-webkit-user-select': 'none', + 'user-select': 'none', + '-ms-user-select': 'none', + '-moz-user-select': '-moz-none' + }, + attributes: { unselectable: 'on' } + }); }; var events$4 = function () { - return derive([abort(selectstart(), always)]); + return derive([abort(selectstart(), always)]); }; var ActiveUnselecting = /*#__PURE__*/Object.freeze({ @@ -4957,121 +4952,121 @@ }); var Unselecting = create$1({ - fields: [], - name: 'unselecting', - active: ActiveUnselecting + fields: [], + name: 'unselecting', + active: ActiveUnselecting }); var getAttrs = function (elem) { - var attributes = elem.dom.attributes !== undefined ? elem.dom.attributes : []; - return foldl(attributes, function (b, attr) { - var _a; - if (attr.name === 'class') { - return b; - } else { - return __assign(__assign({}, b), (_a = {}, _a[attr.name] = attr.value, _a)); - } - }, {}); + var attributes = elem.dom.attributes !== undefined ? elem.dom.attributes : []; + return foldl(attributes, function (b, attr) { + var _a; + if (attr.name === 'class') { + return b; + } else { + return __assign(__assign({}, b), (_a = {}, _a[attr.name] = attr.value, _a)); + } + }, {}); }; var getClasses = function (elem) { - return Array.prototype.slice.call(elem.dom.classList, 0); + return Array.prototype.slice.call(elem.dom.classList, 0); }; var fromHtml$2 = function (html) { - var elem = SugarElement.fromHtml(html); - var children$1 = children(elem); - var attrs = getAttrs(elem); - var classes = getClasses(elem); - var contents = children$1.length === 0 ? {} : {innerHtml: get$4(elem)}; - return __assign({ - tag: name(elem), - classes: classes, - attributes: attrs - }, contents); + var elem = SugarElement.fromHtml(html); + var children$1 = children(elem); + var attrs = getAttrs(elem); + var classes = getClasses(elem); + var contents = children$1.length === 0 ? {} : { innerHtml: get$4(elem) }; + return __assign({ + tag: name(elem), + classes: classes, + attributes: attrs + }, contents); }; var dom$1 = function (rawHtml) { - var html = supplant(rawHtml, {prefix: prefix}); - return fromHtml$2(html); + var html = supplant(rawHtml, { prefix: prefix }); + return fromHtml$2(html); }; var spec = function (rawHtml) { - return {dom: dom$1(rawHtml)}; + return { dom: dom$1(rawHtml) }; }; var forToolbarCommand = function (editor, command) { - return forToolbar(command, function () { - editor.execCommand(command); - }, {}, editor); + return forToolbar(command, function () { + editor.execCommand(command); + }, {}, editor); }; var getToggleBehaviours = function (command) { - return derive$1([ - Toggling.config({ - toggleClass: resolve('toolbar-button-selected'), - toggleOnExecute: false, - aria: {mode: 'pressed'} - }), - format(command, function (button, status) { - var toggle = status ? Toggling.on : Toggling.off; - toggle(button); - }) - ]); + return derive$1([ + Toggling.config({ + toggleClass: resolve('toolbar-button-selected'), + toggleOnExecute: false, + aria: { mode: 'pressed' } + }), + format(command, function (button, status) { + var toggle = status ? Toggling.on : Toggling.off; + toggle(button); + }) + ]); }; var forToolbarStateCommand = function (editor, command) { - var extraBehaviours = getToggleBehaviours(command); - return forToolbar(command, function () { - editor.execCommand(command); - }, extraBehaviours, editor); + var extraBehaviours = getToggleBehaviours(command); + return forToolbar(command, function () { + editor.execCommand(command); + }, extraBehaviours, editor); }; var forToolbarStateAction = function (editor, clazz, command, action) { - var extraBehaviours = getToggleBehaviours(command); - return forToolbar(clazz, action, extraBehaviours, editor); + var extraBehaviours = getToggleBehaviours(command); + return forToolbar(clazz, action, extraBehaviours, editor); }; var getToolbarIconButton = function (clazz, editor) { - var icons = editor.ui.registry.getAll().icons; - var optOxideIcon = Optional.from(icons[clazz]); - return optOxideIcon.fold(function () { - return dom$1(''); - }, function (icon) { - return dom$1('' + icon + ''); - }); + var icons = editor.ui.registry.getAll().icons; + var optOxideIcon = Optional.from(icons[clazz]); + return optOxideIcon.fold(function () { + return dom$1(''); + }, function (icon) { + return dom$1('' + icon + ''); + }); }; var forToolbar = function (clazz, action, extraBehaviours, editor) { - return Button.sketch({ - dom: getToolbarIconButton(clazz, editor), - action: action, - buttonBehaviours: deepMerge(derive$1([Unselecting.config({})]), extraBehaviours) - }); + return Button.sketch({ + dom: getToolbarIconButton(clazz, editor), + action: action, + buttonBehaviours: deepMerge(derive$1([Unselecting.config({})]), extraBehaviours) + }); }; var labelPart = optional({ - schema: [strict$1('dom')], - name: 'label' + schema: [strict$1('dom')], + name: 'label' }); var edgePart = function (name) { - return optional({ - name: '' + name + '-edge', - overrides: function (detail) { - var action = detail.model.manager.edgeActions[name]; - return action.fold(function () { - return {}; - }, function (a) { - return { - events: derive([ - runActionExtra(touchstart(), function (comp, se, d) { - return a(comp, d); - }, [detail]), - runActionExtra(mousedown(), function (comp, se, d) { - return a(comp, d); - }, [detail]), - runActionExtra(mousemove(), function (comp, se, det) { - if (det.mouseIsDown.get()) { - a(comp, det); - } - }, [detail]) - ]) - }; - }); - } - }); + return optional({ + name: '' + name + '-edge', + overrides: function (detail) { + var action = detail.model.manager.edgeActions[name]; + return action.fold(function () { + return {}; + }, function (a) { + return { + events: derive([ + runActionExtra(touchstart(), function (comp, se, d) { + return a(comp, d); + }, [detail]), + runActionExtra(mousedown(), function (comp, se, d) { + return a(comp, d); + }, [detail]), + runActionExtra(mousemove(), function (comp, se, det) { + if (det.mouseIsDown.get()) { + a(comp, det); + } + }, [detail]) + ]) + }; + }); + } + }); }; var tlEdgePart = edgePart('top-left'); var tedgePart = edgePart('top'); @@ -5082,94 +5077,94 @@ var blEdgePart = edgePart('bottom-left'); var ledgePart = edgePart('left'); var thumbPart = required({ - name: 'thumb', - defaults: constant({dom: {styles: {position: 'absolute'}}}), - overrides: function (detail) { - return { - events: derive([ - redirectToPart(touchstart(), detail, 'spectrum'), - redirectToPart(touchmove(), detail, 'spectrum'), - redirectToPart(touchend(), detail, 'spectrum'), - redirectToPart(mousedown(), detail, 'spectrum'), - redirectToPart(mousemove(), detail, 'spectrum'), - redirectToPart(mouseup(), detail, 'spectrum') - ]) - }; - } + name: 'thumb', + defaults: constant({ dom: { styles: { position: 'absolute' } } }), + overrides: function (detail) { + return { + events: derive([ + redirectToPart(touchstart(), detail, 'spectrum'), + redirectToPart(touchmove(), detail, 'spectrum'), + redirectToPart(touchend(), detail, 'spectrum'), + redirectToPart(mousedown(), detail, 'spectrum'), + redirectToPart(mousemove(), detail, 'spectrum'), + redirectToPart(mouseup(), detail, 'spectrum') + ]) + }; + } }); var spectrumPart = required({ - schema: [state$1('mouseIsDown', function () { - return Cell(false); + schema: [state$1('mouseIsDown', function () { + return Cell(false); })], - name: 'spectrum', - overrides: function (detail) { - var modelDetail = detail.model; - var model = modelDetail.manager; - var setValueFrom = function (component, simulatedEvent) { - return model.getValueFromEvent(simulatedEvent).map(function (value) { - return model.setValueFrom(component, detail, value); - }); - }; - return { - behaviours: derive$1([ - Keying.config({ - mode: 'special', - onLeft: function (spectrum) { - return model.onLeft(spectrum, detail); - }, - onRight: function (spectrum) { - return model.onRight(spectrum, detail); - }, - onUp: function (spectrum) { - return model.onUp(spectrum, detail); - }, - onDown: function (spectrum) { - return model.onDown(spectrum, detail); - } - }), - Focusing.config({}) - ]), - events: derive([ - run(touchstart(), setValueFrom), - run(touchmove(), setValueFrom), - run(mousedown(), setValueFrom), - run(mousemove(), function (spectrum, se) { - if (detail.mouseIsDown.get()) { - setValueFrom(spectrum, se); - } - }) - ]) - }; - } - }); - var SliderParts = [ - labelPart, - ledgePart, - redgePart, - tedgePart, - bedgePart, - tlEdgePart, - trEdgePart, - blEdgePart, - brEdgePart, - thumbPart, - spectrumPart + name: 'spectrum', + overrides: function (detail) { + var modelDetail = detail.model; + var model = modelDetail.manager; + var setValueFrom = function (component, simulatedEvent) { + return model.getValueFromEvent(simulatedEvent).map(function (value) { + return model.setValueFrom(component, detail, value); + }); + }; + return { + behaviours: derive$1([ + Keying.config({ + mode: 'special', + onLeft: function (spectrum) { + return model.onLeft(spectrum, detail); + }, + onRight: function (spectrum) { + return model.onRight(spectrum, detail); + }, + onUp: function (spectrum) { + return model.onUp(spectrum, detail); + }, + onDown: function (spectrum) { + return model.onDown(spectrum, detail); + } + }), + Focusing.config({}) + ]), + events: derive([ + run(touchstart(), setValueFrom), + run(touchmove(), setValueFrom), + run(mousedown(), setValueFrom), + run(mousemove(), function (spectrum, se) { + if (detail.mouseIsDown.get()) { + setValueFrom(spectrum, se); + } + }) + ]) + }; + } + }); + var SliderParts = [ + labelPart, + ledgePart, + redgePart, + tedgePart, + bedgePart, + tlEdgePart, + trEdgePart, + blEdgePart, + brEdgePart, + thumbPart, + spectrumPart ]; var onLoad$1 = function (component, repConfig, repState) { - repConfig.store.manager.onLoad(component, repConfig, repState); + repConfig.store.manager.onLoad(component, repConfig, repState); }; var onUnload = function (component, repConfig, repState) { - repConfig.store.manager.onUnload(component, repConfig, repState); + repConfig.store.manager.onUnload(component, repConfig, repState); }; var setValue = function (component, repConfig, repState, data) { - repConfig.store.manager.setValue(component, repConfig, repState, data); + repConfig.store.manager.setValue(component, repConfig, repState, data); }; var getValue = function (component, repConfig, repState) { - return repConfig.store.manager.getValue(component, repConfig, repState); + return repConfig.store.manager.getValue(component, repConfig, repState); }; var getState = function (component, repConfig, repState) { - return repState; + return repState; }; var RepresentApis = /*#__PURE__*/Object.freeze({ @@ -5182,15 +5177,15 @@ }); var events$5 = function (repConfig, repState) { - var es = repConfig.resetOnDom ? [ - runOnAttached(function (comp, _se) { - onLoad$1(comp, repConfig, repState); - }), - runOnDetached(function (comp, _se) { - onUnload(comp, repConfig, repState); - }) - ] : [loadEvent(repConfig, repState, onLoad$1)]; - return derive(es); + var es = repConfig.resetOnDom ? [ + runOnAttached(function (comp, _se) { + onLoad$1(comp, repConfig, repState); + }), + runOnDetached(function (comp, _se) { + onUnload(comp, repConfig, repState); + }) + ] : [loadEvent(repConfig, repState, onLoad$1)]; + return derive(es); }; var ActiveRepresenting = /*#__PURE__*/Object.freeze({ @@ -5199,76 +5194,76 @@ }); var memory = function () { - var data = Cell(null); - var readState = function () { - return { - mode: 'memory', - value: data.get() - }; - }; - var isNotSet = function () { - return data.get() === null; - }; - var clear = function () { - data.set(null); - }; - return nu$6({ - set: data.set, - get: data.get, - isNotSet: isNotSet, - clear: clear, - readState: readState - }); + var data = Cell(null); + var readState = function () { + return { + mode: 'memory', + value: data.get() + }; + }; + var isNotSet = function () { + return data.get() === null; + }; + var clear = function () { + data.set(null); + }; + return nu$6({ + set: data.set, + get: data.get, + isNotSet: isNotSet, + clear: clear, + readState: readState + }); }; var manual = function () { - var readState = function () { - }; - return nu$6({readState: readState}); + var readState = function () { + }; + return nu$6({ readState: readState }); }; var dataset = function () { - var dataByValue = Cell({}); - var dataByText = Cell({}); - var readState = function () { - return { - mode: 'dataset', - dataByValue: dataByValue.get(), - dataByText: dataByText.get() - }; - }; - var clear = function () { - dataByValue.set({}); - dataByText.set({}); - }; - var lookup = function (itemString) { - return get$1(dataByValue.get(), itemString).orThunk(function () { - return get$1(dataByText.get(), itemString); - }); - }; - var update = function (items) { - var currentDataByValue = dataByValue.get(); - var currentDataByText = dataByText.get(); - var newDataByValue = {}; - var newDataByText = {}; - each(items, function (item) { - newDataByValue[item.value] = item; - get$1(item, 'meta').each(function (meta) { - get$1(meta, 'text').each(function (text) { - newDataByText[text] = item; - }); - }); - }); - dataByValue.set(__assign(__assign({}, currentDataByValue), newDataByValue)); - dataByText.set(__assign(__assign({}, currentDataByText), newDataByText)); - }; - return nu$6({ - readState: readState, - lookup: lookup, - update: update, - clear: clear - }); + var dataByValue = Cell({}); + var dataByText = Cell({}); + var readState = function () { + return { + mode: 'dataset', + dataByValue: dataByValue.get(), + dataByText: dataByText.get() + }; + }; + var clear = function () { + dataByValue.set({}); + dataByText.set({}); + }; + var lookup = function (itemString) { + return get$1(dataByValue.get(), itemString).orThunk(function () { + return get$1(dataByText.get(), itemString); + }); + }; + var update = function (items) { + var currentDataByValue = dataByValue.get(); + var currentDataByText = dataByText.get(); + var newDataByValue = {}; + var newDataByText = {}; + each(items, function (item) { + newDataByValue[item.value] = item; + get$1(item, 'meta').each(function (meta) { + get$1(meta, 'text').each(function (text) { + newDataByText[text] = item; + }); + }); + }); + dataByValue.set(__assign(__assign({}, currentDataByValue), newDataByValue)); + dataByText.set(__assign(__assign({}, currentDataByText), newDataByText)); + }; + return nu$6({ + readState: readState, + lookup: lookup, + update: update, + clear: clear + }); }; var init$1 = function (spec) { - return spec.store.manager.state(spec); + return spec.store.manager.state(spec); }; var RepresentState = /*#__PURE__*/Object.freeze({ @@ -5280,520 +5275,515 @@ }); var setValue$1 = function (component, repConfig, repState, data) { - var store = repConfig.store; - repState.update([data]); - store.setValue(component, data); - repConfig.onSetValue(component, data); + var store = repConfig.store; + repState.update([data]); + store.setValue(component, data); + repConfig.onSetValue(component, data); }; var getValue$1 = function (component, repConfig, repState) { - var store = repConfig.store; - var key = store.getDataKey(component); - return repState.lookup(key).fold(function () { - return store.getFallbackEntry(key); - }, function (data) { - return data; - }); + var store = repConfig.store; + var key = store.getDataKey(component); + return repState.lookup(key).fold(function () { + return store.getFallbackEntry(key); + }, function (data) { + return data; + }); }; var onLoad$2 = function (component, repConfig, repState) { - var store = repConfig.store; - store.initialValue.each(function (data) { - setValue$1(component, repConfig, repState, data); - }); + var store = repConfig.store; + store.initialValue.each(function (data) { + setValue$1(component, repConfig, repState, data); + }); }; var onUnload$1 = function (component, repConfig, repState) { - repState.clear(); + repState.clear(); }; var DatasetStore = [ - option('initialValue'), - strict$1('getFallbackEntry'), - strict$1('getDataKey'), - strict$1('setValue'), - output('manager', { - setValue: setValue$1, - getValue: getValue$1, - onLoad: onLoad$2, - onUnload: onUnload$1, - state: dataset - }) + option('initialValue'), + strict$1('getFallbackEntry'), + strict$1('getDataKey'), + strict$1('setValue'), + output('manager', { + setValue: setValue$1, + getValue: getValue$1, + onLoad: onLoad$2, + onUnload: onUnload$1, + state: dataset + }) ]; var getValue$2 = function (component, repConfig, _repState) { - return repConfig.store.getValue(component); + return repConfig.store.getValue(component); }; var setValue$2 = function (component, repConfig, _repState, data) { - repConfig.store.setValue(component, data); - repConfig.onSetValue(component, data); + repConfig.store.setValue(component, data); + repConfig.onSetValue(component, data); }; var onLoad$3 = function (component, repConfig, _repState) { - repConfig.store.initialValue.each(function (data) { - repConfig.store.setValue(component, data); - }); + repConfig.store.initialValue.each(function (data) { + repConfig.store.setValue(component, data); + }); }; var ManualStore = [ - strict$1('getValue'), - defaulted$1('setValue', noop), - option('initialValue'), - output('manager', { - setValue: setValue$2, - getValue: getValue$2, - onLoad: onLoad$3, - onUnload: noop, - state: NoState.init - }) + strict$1('getValue'), + defaulted$1('setValue', noop), + option('initialValue'), + output('manager', { + setValue: setValue$2, + getValue: getValue$2, + onLoad: onLoad$3, + onUnload: noop, + state: NoState.init + }) ]; var setValue$3 = function (component, repConfig, repState, data) { - repState.set(data); - repConfig.onSetValue(component, data); + repState.set(data); + repConfig.onSetValue(component, data); }; var getValue$3 = function (component, repConfig, repState) { - return repState.get(); + return repState.get(); }; var onLoad$4 = function (component, repConfig, repState) { - repConfig.store.initialValue.each(function (initVal) { - if (repState.isNotSet()) { - repState.set(initVal); - } - }); + repConfig.store.initialValue.each(function (initVal) { + if (repState.isNotSet()) { + repState.set(initVal); + } + }); }; var onUnload$2 = function (component, repConfig, repState) { - repState.clear(); + repState.clear(); }; var MemoryStore = [ - option('initialValue'), - output('manager', { - setValue: setValue$3, - getValue: getValue$3, - onLoad: onLoad$4, - onUnload: onUnload$2, - state: memory - }) + option('initialValue'), + output('manager', { + setValue: setValue$3, + getValue: getValue$3, + onLoad: onLoad$4, + onUnload: onUnload$2, + state: memory + }) ]; var RepresentSchema = [ - defaultedOf('store', {mode: 'memory'}, choose$1('mode', { - memory: MemoryStore, - manual: ManualStore, - dataset: DatasetStore - })), - onHandler('onSetValue'), - defaulted$1('resetOnDom', false) + defaultedOf('store', { mode: 'memory' }, choose$1('mode', { + memory: MemoryStore, + manual: ManualStore, + dataset: DatasetStore + })), + onHandler('onSetValue'), + defaulted$1('resetOnDom', false) ]; var Representing = create$1({ - fields: RepresentSchema, - name: 'representing', - active: ActiveRepresenting, - apis: RepresentApis, - extra: { - setValueFrom: function (component, source) { - var value = Representing.getValue(source); - Representing.setValue(component, value); - } - }, - state: RepresentState + fields: RepresentSchema, + name: 'representing', + active: ActiveRepresenting, + apis: RepresentApis, + extra: { + setValueFrom: function (component, source) { + var value = Representing.getValue(source); + Representing.setValue(component, value); + } + }, + state: RepresentState }); var api$1 = Dimension('width', function (element) { - return element.dom.offsetWidth; + return element.dom.offsetWidth; }); var set$4 = function (element, h) { - return api$1.set(element, h); + return api$1.set(element, h); }; var get$8 = function (element) { - return api$1.get(element); + return api$1.get(element); }; var r = function (left, top) { - var translate = function (x, y) { - return r(left + x, top + y); - }; - return { - left: left, - top: top, - translate: translate - }; + var translate = function (x, y) { + return r(left + x, top + y); + }; + return { + left: left, + top: top, + translate: translate + }; }; var SugarPosition = r; var _sliderChangeEvent = 'slider.change.value'; var sliderChangeEvent = constant(_sliderChangeEvent); var isTouchEvent = function (evt) { - return evt.type.indexOf('touch') !== -1; + return evt.type.indexOf('touch') !== -1; }; var getEventSource = function (simulatedEvent) { - var evt = simulatedEvent.event.raw; - if (isTouchEvent(evt)) { - var touchEvent = evt; - return touchEvent.touches !== undefined && touchEvent.touches.length === 1 ? Optional.some(touchEvent.touches[0]).map(function (t) { - return SugarPosition(t.clientX, t.clientY); - }) : Optional.none(); - } else { - var mouseEvent = evt; - return mouseEvent.clientX !== undefined ? Optional.some(mouseEvent).map(function (me) { - return SugarPosition(me.clientX, me.clientY); - }) : Optional.none(); - } + var evt = simulatedEvent.event.raw; + if (isTouchEvent(evt)) { + var touchEvent = evt; + return touchEvent.touches !== undefined && touchEvent.touches.length === 1 ? Optional.some(touchEvent.touches[0]).map(function (t) { + return SugarPosition(t.clientX, t.clientY); + }) : Optional.none(); + } else { + var mouseEvent = evt; + return mouseEvent.clientX !== undefined ? Optional.some(mouseEvent).map(function (me) { + return SugarPosition(me.clientX, me.clientY); + }) : Optional.none(); + } }; var t = 'top', r$1 = 'right', b = 'bottom', l = 'left'; var minX = function (detail) { - return detail.model.minX; + return detail.model.minX; }; var minY = function (detail) { - return detail.model.minY; + return detail.model.minY; }; var min1X = function (detail) { - return detail.model.minX - 1; + return detail.model.minX - 1; }; var min1Y = function (detail) { - return detail.model.minY - 1; + return detail.model.minY - 1; }; var maxX = function (detail) { - return detail.model.maxX; + return detail.model.maxX; }; var maxY = function (detail) { - return detail.model.maxY; + return detail.model.maxY; }; var max1X = function (detail) { - return detail.model.maxX + 1; + return detail.model.maxX + 1; }; var max1Y = function (detail) { - return detail.model.maxY + 1; + return detail.model.maxY + 1; }; var range = function (detail, max, min) { - return max(detail) - min(detail); + return max(detail) - min(detail); }; var xRange = function (detail) { - return range(detail, maxX, minX); + return range(detail, maxX, minX); }; var yRange = function (detail) { - return range(detail, maxY, minY); + return range(detail, maxY, minY); }; var halfX = function (detail) { - return xRange(detail) / 2; + return xRange(detail) / 2; }; var halfY = function (detail) { - return yRange(detail) / 2; + return yRange(detail) / 2; }; var step = function (detail) { - return detail.stepSize; + return detail.stepSize; }; var snap = function (detail) { - return detail.snapToGrid; + return detail.snapToGrid; }; var snapStart = function (detail) { - return detail.snapStart; + return detail.snapStart; }; var rounded = function (detail) { - return detail.rounded; + return detail.rounded; }; var hasEdge = function (detail, edgeName) { - return detail[edgeName + '-edge'] !== undefined; + return detail[edgeName + '-edge'] !== undefined; }; var hasLEdge = function (detail) { - return hasEdge(detail, l); + return hasEdge(detail, l); }; var hasREdge = function (detail) { - return hasEdge(detail, r$1); + return hasEdge(detail, r$1); }; var hasTEdge = function (detail) { - return hasEdge(detail, t); + return hasEdge(detail, t); }; var hasBEdge = function (detail) { - return hasEdge(detail, b); + return hasEdge(detail, b); }; var currentValue = function (detail) { - return detail.model.value.get(); + return detail.model.value.get(); }; var xValue = function (x) { - return {x: x}; + return { x: x }; }; var yValue = function (y) { - return {y: y}; + return { y: y }; }; var xyValue = function (x, y) { - return { - x: x, - y: y - }; + return { + x: x, + y: y + }; }; var fireSliderChange = function (component, value) { - emitWith(component, sliderChangeEvent(), {value: value}); + emitWith(component, sliderChangeEvent(), { value: value }); }; var setToTLEdgeXY = function (edge, detail) { - fireSliderChange(edge, xyValue(min1X(detail), min1Y(detail))); + fireSliderChange(edge, xyValue(min1X(detail), min1Y(detail))); }; var setToTEdge = function (edge, detail) { - fireSliderChange(edge, yValue(min1Y(detail))); + fireSliderChange(edge, yValue(min1Y(detail))); }; var setToTEdgeXY = function (edge, detail) { - fireSliderChange(edge, xyValue(halfX(detail), min1Y(detail))); + fireSliderChange(edge, xyValue(halfX(detail), min1Y(detail))); }; var setToTREdgeXY = function (edge, detail) { - fireSliderChange(edge, xyValue(max1X(detail), min1Y(detail))); + fireSliderChange(edge, xyValue(max1X(detail), min1Y(detail))); }; var setToREdge = function (edge, detail) { - fireSliderChange(edge, xValue(max1X(detail))); + fireSliderChange(edge, xValue(max1X(detail))); }; var setToREdgeXY = function (edge, detail) { - fireSliderChange(edge, xyValue(max1X(detail), halfY(detail))); + fireSliderChange(edge, xyValue(max1X(detail), halfY(detail))); }; var setToBREdgeXY = function (edge, detail) { - fireSliderChange(edge, xyValue(max1X(detail), max1Y(detail))); + fireSliderChange(edge, xyValue(max1X(detail), max1Y(detail))); }; var setToBEdge = function (edge, detail) { - fireSliderChange(edge, yValue(max1Y(detail))); + fireSliderChange(edge, yValue(max1Y(detail))); }; var setToBEdgeXY = function (edge, detail) { - fireSliderChange(edge, xyValue(halfX(detail), max1Y(detail))); + fireSliderChange(edge, xyValue(halfX(detail), max1Y(detail))); }; var setToBLEdgeXY = function (edge, detail) { - fireSliderChange(edge, xyValue(min1X(detail), max1Y(detail))); + fireSliderChange(edge, xyValue(min1X(detail), max1Y(detail))); }; var setToLEdge = function (edge, detail) { - fireSliderChange(edge, xValue(min1X(detail))); + fireSliderChange(edge, xValue(min1X(detail))); }; var setToLEdgeXY = function (edge, detail) { - fireSliderChange(edge, xyValue(min1X(detail), halfY(detail))); + fireSliderChange(edge, xyValue(min1X(detail), halfY(detail))); }; var reduceBy = function (value, min, max, step) { - if (value < min) { - return value; - } else if (value > max) { - return max; - } else if (value === min) { - return min - 1; - } else { - return Math.max(min, value - step); - } + if (value < min) { + return value; + } else if (value > max) { + return max; + } else if (value === min) { + return min - 1; + } else { + return Math.max(min, value - step); + } }; var increaseBy = function (value, min, max, step) { - if (value > max) { - return value; - } else if (value < min) { - return min; - } else if (value === max) { - return max + 1; - } else { - return Math.min(max, value + step); - } + if (value > max) { + return value; + } else if (value < min) { + return min; + } else if (value === max) { + return max + 1; + } else { + return Math.min(max, value + step); + } }; var capValue = function (value, min, max) { - return Math.max(min, Math.min(max, value)); + return Math.max(min, Math.min(max, value)); }; var snapValueOf = function (value, min, max, step, snapStart) { - return snapStart.fold(function () { - var initValue = value - min; - var extraValue = Math.round(initValue / step) * step; - return capValue(min + extraValue, min - 1, max + 1); - }, function (start) { - var remainder = (value - start) % step; - var adjustment = Math.round(remainder / step); - var rawSteps = Math.floor((value - start) / step); - var maxSteps = Math.floor((max - start) / step); - var numSteps = Math.min(maxSteps, rawSteps + adjustment); - var r = start + numSteps * step; - return Math.max(start, r); - }); + return snapStart.fold(function () { + var initValue = value - min; + var extraValue = Math.round(initValue / step) * step; + return capValue(min + extraValue, min - 1, max + 1); + }, function (start) { + var remainder = (value - start) % step; + var adjustment = Math.round(remainder / step); + var rawSteps = Math.floor((value - start) / step); + var maxSteps = Math.floor((max - start) / step); + var numSteps = Math.min(maxSteps, rawSteps + adjustment); + var r = start + numSteps * step; + return Math.max(start, r); + }); }; var findOffsetOf = function (value, min, max) { - return Math.min(max, Math.max(value, min)) - min; + return Math.min(max, Math.max(value, min)) - min; }; var findValueOf = function (args) { - var min = args.min, max = args.max, range = args.range, value = args.value, step = args.step, snap = args.snap, - snapStart = args.snapStart, rounded = args.rounded, hasMinEdge = args.hasMinEdge, - hasMaxEdge = args.hasMaxEdge, minBound = args.minBound, maxBound = args.maxBound, - screenRange = args.screenRange; - var capMin = hasMinEdge ? min - 1 : min; - var capMax = hasMaxEdge ? max + 1 : max; - if (value < minBound) { - return capMin; - } else if (value > maxBound) { - return capMax; + var min = args.min, max = args.max, range = args.range, value = args.value, step = args.step, snap = args.snap, snapStart = args.snapStart, rounded = args.rounded, hasMinEdge = args.hasMinEdge, hasMaxEdge = args.hasMaxEdge, minBound = args.minBound, maxBound = args.maxBound, screenRange = args.screenRange; + var capMin = hasMinEdge ? min - 1 : min; + var capMax = hasMaxEdge ? max + 1 : max; + if (value < minBound) { + return capMin; + } else if (value > maxBound) { + return capMax; + } else { + var offset = findOffsetOf(value, minBound, maxBound); + var newValue = capValue(offset / screenRange * range + min, capMin, capMax); + if (snap && newValue >= min && newValue <= max) { + return snapValueOf(newValue, min, max, step, snapStart); + } else if (rounded) { + return Math.round(newValue); } else { - var offset = findOffsetOf(value, minBound, maxBound); - var newValue = capValue(offset / screenRange * range + min, capMin, capMax); - if (snap && newValue >= min && newValue <= max) { - return snapValueOf(newValue, min, max, step, snapStart); - } else if (rounded) { - return Math.round(newValue); - } else { - return newValue; - } + return newValue; } + } }; var findOffsetOfValue = function (args) { - var min = args.min, max = args.max, range = args.range, value = args.value, hasMinEdge = args.hasMinEdge, - hasMaxEdge = args.hasMaxEdge, maxBound = args.maxBound, maxOffset = args.maxOffset, - centerMinEdge = args.centerMinEdge, centerMaxEdge = args.centerMaxEdge; - if (value < min) { - return hasMinEdge ? 0 : centerMinEdge; - } else if (value > max) { - return hasMaxEdge ? maxBound : centerMaxEdge; - } else { - return (value - min) / range * maxOffset; - } + var min = args.min, max = args.max, range = args.range, value = args.value, hasMinEdge = args.hasMinEdge, hasMaxEdge = args.hasMaxEdge, maxBound = args.maxBound, maxOffset = args.maxOffset, centerMinEdge = args.centerMinEdge, centerMaxEdge = args.centerMaxEdge; + if (value < min) { + return hasMinEdge ? 0 : centerMinEdge; + } else if (value > max) { + return hasMaxEdge ? maxBound : centerMaxEdge; + } else { + return (value - min) / range * maxOffset; + } }; var top = 'top', right = 'right', bottom = 'bottom', left = 'left', width = 'width', height = 'height'; var getBounds = function (component) { - return component.element.dom.getBoundingClientRect(); + return component.element.dom.getBoundingClientRect(); }; var getBoundsProperty = function (bounds, property) { - return bounds[property]; + return bounds[property]; }; var getMinXBounds = function (component) { - var bounds = getBounds(component); - return getBoundsProperty(bounds, left); + var bounds = getBounds(component); + return getBoundsProperty(bounds, left); }; var getMaxXBounds = function (component) { - var bounds = getBounds(component); - return getBoundsProperty(bounds, right); + var bounds = getBounds(component); + return getBoundsProperty(bounds, right); }; var getMinYBounds = function (component) { - var bounds = getBounds(component); - return getBoundsProperty(bounds, top); + var bounds = getBounds(component); + return getBoundsProperty(bounds, top); }; var getMaxYBounds = function (component) { - var bounds = getBounds(component); - return getBoundsProperty(bounds, bottom); + var bounds = getBounds(component); + return getBoundsProperty(bounds, bottom); }; var getXScreenRange = function (component) { - var bounds = getBounds(component); - return getBoundsProperty(bounds, width); + var bounds = getBounds(component); + return getBoundsProperty(bounds, width); }; var getYScreenRange = function (component) { - var bounds = getBounds(component); - return getBoundsProperty(bounds, height); + var bounds = getBounds(component); + return getBoundsProperty(bounds, height); }; var getCenterOffsetOf = function (componentMinEdge, componentMaxEdge, spectrumMinEdge) { - return (componentMinEdge + componentMaxEdge) / 2 - spectrumMinEdge; + return (componentMinEdge + componentMaxEdge) / 2 - spectrumMinEdge; }; var getXCenterOffSetOf = function (component, spectrum) { - var componentBounds = getBounds(component); - var spectrumBounds = getBounds(spectrum); - var componentMinEdge = getBoundsProperty(componentBounds, left); - var componentMaxEdge = getBoundsProperty(componentBounds, right); - var spectrumMinEdge = getBoundsProperty(spectrumBounds, left); - return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge); + var componentBounds = getBounds(component); + var spectrumBounds = getBounds(spectrum); + var componentMinEdge = getBoundsProperty(componentBounds, left); + var componentMaxEdge = getBoundsProperty(componentBounds, right); + var spectrumMinEdge = getBoundsProperty(spectrumBounds, left); + return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge); }; var getYCenterOffSetOf = function (component, spectrum) { - var componentBounds = getBounds(component); - var spectrumBounds = getBounds(spectrum); - var componentMinEdge = getBoundsProperty(componentBounds, top); - var componentMaxEdge = getBoundsProperty(componentBounds, bottom); - var spectrumMinEdge = getBoundsProperty(spectrumBounds, top); - return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge); + var componentBounds = getBounds(component); + var spectrumBounds = getBounds(spectrum); + var componentMinEdge = getBoundsProperty(componentBounds, top); + var componentMaxEdge = getBoundsProperty(componentBounds, bottom); + var spectrumMinEdge = getBoundsProperty(spectrumBounds, top); + return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge); }; var fireSliderChange$1 = function (spectrum, value) { - emitWith(spectrum, sliderChangeEvent(), {value: value}); + emitWith(spectrum, sliderChangeEvent(), { value: value }); }; var sliderValue = function (x) { - return {x: x}; + return { x: x }; }; var findValueOfOffset = function (spectrum, detail, left) { - var args = { - min: minX(detail), - max: maxX(detail), - range: xRange(detail), - value: left, - step: step(detail), - snap: snap(detail), - snapStart: snapStart(detail), - rounded: rounded(detail), - hasMinEdge: hasLEdge(detail), - hasMaxEdge: hasREdge(detail), - minBound: getMinXBounds(spectrum), - maxBound: getMaxXBounds(spectrum), - screenRange: getXScreenRange(spectrum) - }; - return findValueOf(args); + var args = { + min: minX(detail), + max: maxX(detail), + range: xRange(detail), + value: left, + step: step(detail), + snap: snap(detail), + snapStart: snapStart(detail), + rounded: rounded(detail), + hasMinEdge: hasLEdge(detail), + hasMaxEdge: hasREdge(detail), + minBound: getMinXBounds(spectrum), + maxBound: getMaxXBounds(spectrum), + screenRange: getXScreenRange(spectrum) + }; + return findValueOf(args); }; var setValueFrom = function (spectrum, detail, value) { - var xValue = findValueOfOffset(spectrum, detail, value); - var sliderVal = sliderValue(xValue); - fireSliderChange$1(spectrum, sliderVal); - return xValue; + var xValue = findValueOfOffset(spectrum, detail, value); + var sliderVal = sliderValue(xValue); + fireSliderChange$1(spectrum, sliderVal); + return xValue; }; var setToMin = function (spectrum, detail) { - var min = minX(detail); - fireSliderChange$1(spectrum, sliderValue(min)); + var min = minX(detail); + fireSliderChange$1(spectrum, sliderValue(min)); }; var setToMax = function (spectrum, detail) { - var max = maxX(detail); - fireSliderChange$1(spectrum, sliderValue(max)); + var max = maxX(detail); + fireSliderChange$1(spectrum, sliderValue(max)); }; var moveBy = function (direction, spectrum, detail) { - var f = direction > 0 ? increaseBy : reduceBy; - var xValue = f(currentValue(detail).x, minX(detail), maxX(detail), step(detail)); - fireSliderChange$1(spectrum, sliderValue(xValue)); - return Optional.some(xValue); + var f = direction > 0 ? increaseBy : reduceBy; + var xValue = f(currentValue(detail).x, minX(detail), maxX(detail), step(detail)); + fireSliderChange$1(spectrum, sliderValue(xValue)); + return Optional.some(xValue); }; var handleMovement = function (direction) { - return function (spectrum, detail) { - return moveBy(direction, spectrum, detail).map(function () { - return true; - }); - }; + return function (spectrum, detail) { + return moveBy(direction, spectrum, detail).map(function () { + return true; + }); + }; }; var getValueFromEvent = function (simulatedEvent) { - var pos = getEventSource(simulatedEvent); - return pos.map(function (p) { - return p.left; - }); + var pos = getEventSource(simulatedEvent); + return pos.map(function (p) { + return p.left; + }); }; var findOffsetOfValue$1 = function (spectrum, detail, value, minEdge, maxEdge) { - var minOffset = 0; - var maxOffset = getXScreenRange(spectrum); - var centerMinEdge = minEdge.bind(function (edge) { - return Optional.some(getXCenterOffSetOf(edge, spectrum)); - }).getOr(minOffset); - var centerMaxEdge = maxEdge.bind(function (edge) { - return Optional.some(getXCenterOffSetOf(edge, spectrum)); - }).getOr(maxOffset); - var args = { - min: minX(detail), - max: maxX(detail), - range: xRange(detail), - value: value, - hasMinEdge: hasLEdge(detail), - hasMaxEdge: hasREdge(detail), - minBound: getMinXBounds(spectrum), - minOffset: minOffset, - maxBound: getMaxXBounds(spectrum), - maxOffset: maxOffset, - centerMinEdge: centerMinEdge, - centerMaxEdge: centerMaxEdge - }; - return findOffsetOfValue(args); + var minOffset = 0; + var maxOffset = getXScreenRange(spectrum); + var centerMinEdge = minEdge.bind(function (edge) { + return Optional.some(getXCenterOffSetOf(edge, spectrum)); + }).getOr(minOffset); + var centerMaxEdge = maxEdge.bind(function (edge) { + return Optional.some(getXCenterOffSetOf(edge, spectrum)); + }).getOr(maxOffset); + var args = { + min: minX(detail), + max: maxX(detail), + range: xRange(detail), + value: value, + hasMinEdge: hasLEdge(detail), + hasMaxEdge: hasREdge(detail), + minBound: getMinXBounds(spectrum), + minOffset: minOffset, + maxBound: getMaxXBounds(spectrum), + maxOffset: maxOffset, + centerMinEdge: centerMinEdge, + centerMaxEdge: centerMaxEdge + }; + return findOffsetOfValue(args); }; var findPositionOfValue = function (slider, spectrum, value, minEdge, maxEdge, detail) { - var offset = findOffsetOfValue$1(spectrum, detail, value, minEdge, maxEdge); - return getMinXBounds(spectrum) - getMinXBounds(slider) + offset; + var offset = findOffsetOfValue$1(spectrum, detail, value, minEdge, maxEdge); + return getMinXBounds(spectrum) - getMinXBounds(slider) + offset; }; var setPositionFromValue = function (slider, thumb, detail, edges) { - var value = currentValue(detail); - var pos = findPositionOfValue(slider, edges.getSpectrum(slider), value.x, edges.getLeftEdge(slider), edges.getRightEdge(slider), detail); - var thumbRadius = get$8(thumb.element) / 2; - set$3(thumb.element, 'left', pos - thumbRadius + 'px'); + var value = currentValue(detail); + var pos = findPositionOfValue(slider, edges.getSpectrum(slider), value.x, edges.getLeftEdge(slider), edges.getRightEdge(slider), detail); + var thumbRadius = get$8(thumb.element) / 2; + set$3(thumb.element, 'left', pos - thumbRadius + 'px'); }; var onLeft = handleMovement(-1); var onRight = handleMovement(1); var onUp = Optional.none; var onDown = Optional.none; var edgeActions = { - 'top-left': Optional.none(), - 'top': Optional.none(), - 'top-right': Optional.none(), - 'right': Optional.some(setToREdge), - 'bottom-right': Optional.none(), - 'bottom': Optional.none(), - 'bottom-left': Optional.none(), - 'left': Optional.some(setToLEdge) + 'top-left': Optional.none(), + 'top': Optional.none(), + 'top-right': Optional.none(), + 'right': Optional.some(setToREdge), + 'bottom-right': Optional.none(), + 'bottom': Optional.none(), + 'bottom-left': Optional.none(), + 'left': Optional.some(setToLEdge) }; var HorizontalModel = /*#__PURE__*/Object.freeze({ @@ -5813,110 +5803,110 @@ }); var fireSliderChange$2 = function (spectrum, value) { - emitWith(spectrum, sliderChangeEvent(), {value: value}); + emitWith(spectrum, sliderChangeEvent(), { value: value }); }; var sliderValue$1 = function (y) { - return {y: y}; + return { y: y }; }; var findValueOfOffset$1 = function (spectrum, detail, top) { - var args = { - min: minY(detail), - max: maxY(detail), - range: yRange(detail), - value: top, - step: step(detail), - snap: snap(detail), - snapStart: snapStart(detail), - rounded: rounded(detail), - hasMinEdge: hasTEdge(detail), - hasMaxEdge: hasBEdge(detail), - minBound: getMinYBounds(spectrum), - maxBound: getMaxYBounds(spectrum), - screenRange: getYScreenRange(spectrum) - }; - return findValueOf(args); + var args = { + min: minY(detail), + max: maxY(detail), + range: yRange(detail), + value: top, + step: step(detail), + snap: snap(detail), + snapStart: snapStart(detail), + rounded: rounded(detail), + hasMinEdge: hasTEdge(detail), + hasMaxEdge: hasBEdge(detail), + minBound: getMinYBounds(spectrum), + maxBound: getMaxYBounds(spectrum), + screenRange: getYScreenRange(spectrum) + }; + return findValueOf(args); }; var setValueFrom$1 = function (spectrum, detail, value) { - var yValue = findValueOfOffset$1(spectrum, detail, value); - var sliderVal = sliderValue$1(yValue); - fireSliderChange$2(spectrum, sliderVal); - return yValue; + var yValue = findValueOfOffset$1(spectrum, detail, value); + var sliderVal = sliderValue$1(yValue); + fireSliderChange$2(spectrum, sliderVal); + return yValue; }; var setToMin$1 = function (spectrum, detail) { - var min = minY(detail); - fireSliderChange$2(spectrum, sliderValue$1(min)); + var min = minY(detail); + fireSliderChange$2(spectrum, sliderValue$1(min)); }; var setToMax$1 = function (spectrum, detail) { - var max = maxY(detail); - fireSliderChange$2(spectrum, sliderValue$1(max)); + var max = maxY(detail); + fireSliderChange$2(spectrum, sliderValue$1(max)); }; var moveBy$1 = function (direction, spectrum, detail) { - var f = direction > 0 ? increaseBy : reduceBy; - var yValue = f(currentValue(detail).y, minY(detail), maxY(detail), step(detail)); - fireSliderChange$2(spectrum, sliderValue$1(yValue)); - return Optional.some(yValue); + var f = direction > 0 ? increaseBy : reduceBy; + var yValue = f(currentValue(detail).y, minY(detail), maxY(detail), step(detail)); + fireSliderChange$2(spectrum, sliderValue$1(yValue)); + return Optional.some(yValue); }; var handleMovement$1 = function (direction) { - return function (spectrum, detail) { - return moveBy$1(direction, spectrum, detail).map(function () { - return true; - }); - }; + return function (spectrum, detail) { + return moveBy$1(direction, spectrum, detail).map(function () { + return true; + }); + }; }; var getValueFromEvent$1 = function (simulatedEvent) { - var pos = getEventSource(simulatedEvent); - return pos.map(function (p) { - return p.top; - }); + var pos = getEventSource(simulatedEvent); + return pos.map(function (p) { + return p.top; + }); }; var findOffsetOfValue$2 = function (spectrum, detail, value, minEdge, maxEdge) { - var minOffset = 0; - var maxOffset = getYScreenRange(spectrum); - var centerMinEdge = minEdge.bind(function (edge) { - return Optional.some(getYCenterOffSetOf(edge, spectrum)); - }).getOr(minOffset); - var centerMaxEdge = maxEdge.bind(function (edge) { - return Optional.some(getYCenterOffSetOf(edge, spectrum)); - }).getOr(maxOffset); - var args = { - min: minY(detail), - max: maxY(detail), - range: yRange(detail), - value: value, - hasMinEdge: hasTEdge(detail), - hasMaxEdge: hasBEdge(detail), - minBound: getMinYBounds(spectrum), - minOffset: minOffset, - maxBound: getMaxYBounds(spectrum), - maxOffset: maxOffset, - centerMinEdge: centerMinEdge, - centerMaxEdge: centerMaxEdge - }; - return findOffsetOfValue(args); + var minOffset = 0; + var maxOffset = getYScreenRange(spectrum); + var centerMinEdge = minEdge.bind(function (edge) { + return Optional.some(getYCenterOffSetOf(edge, spectrum)); + }).getOr(minOffset); + var centerMaxEdge = maxEdge.bind(function (edge) { + return Optional.some(getYCenterOffSetOf(edge, spectrum)); + }).getOr(maxOffset); + var args = { + min: minY(detail), + max: maxY(detail), + range: yRange(detail), + value: value, + hasMinEdge: hasTEdge(detail), + hasMaxEdge: hasBEdge(detail), + minBound: getMinYBounds(spectrum), + minOffset: minOffset, + maxBound: getMaxYBounds(spectrum), + maxOffset: maxOffset, + centerMinEdge: centerMinEdge, + centerMaxEdge: centerMaxEdge + }; + return findOffsetOfValue(args); }; var findPositionOfValue$1 = function (slider, spectrum, value, minEdge, maxEdge, detail) { - var offset = findOffsetOfValue$2(spectrum, detail, value, minEdge, maxEdge); - return getMinYBounds(spectrum) - getMinYBounds(slider) + offset; + var offset = findOffsetOfValue$2(spectrum, detail, value, minEdge, maxEdge); + return getMinYBounds(spectrum) - getMinYBounds(slider) + offset; }; var setPositionFromValue$1 = function (slider, thumb, detail, edges) { - var value = currentValue(detail); - var pos = findPositionOfValue$1(slider, edges.getSpectrum(slider), value.y, edges.getTopEdge(slider), edges.getBottomEdge(slider), detail); - var thumbRadius = get$6(thumb.element) / 2; - set$3(thumb.element, 'top', pos - thumbRadius + 'px'); + var value = currentValue(detail); + var pos = findPositionOfValue$1(slider, edges.getSpectrum(slider), value.y, edges.getTopEdge(slider), edges.getBottomEdge(slider), detail); + var thumbRadius = get$6(thumb.element) / 2; + set$3(thumb.element, 'top', pos - thumbRadius + 'px'); }; var onLeft$1 = Optional.none; var onRight$1 = Optional.none; var onUp$1 = handleMovement$1(-1); var onDown$1 = handleMovement$1(1); var edgeActions$1 = { - 'top-left': Optional.none(), - 'top': Optional.some(setToTEdge), - 'top-right': Optional.none(), - 'right': Optional.none(), - 'bottom-right': Optional.none(), - 'bottom': Optional.some(setToBEdge), - 'bottom-left': Optional.none(), - 'left': Optional.none() + 'top-left': Optional.none(), + 'top': Optional.some(setToTEdge), + 'top-right': Optional.none(), + 'right': Optional.none(), + 'bottom-right': Optional.none(), + 'bottom': Optional.some(setToBEdge), + 'bottom-left': Optional.none(), + 'left': Optional.none() }; var VerticalModel = /*#__PURE__*/Object.freeze({ @@ -5936,70 +5926,70 @@ }); var fireSliderChange$3 = function (spectrum, value) { - emitWith(spectrum, sliderChangeEvent(), {value: value}); + emitWith(spectrum, sliderChangeEvent(), { value: value }); }; var sliderValue$2 = function (x, y) { - return { - x: x, - y: y - }; + return { + x: x, + y: y + }; }; var setValueFrom$2 = function (spectrum, detail, value) { - var xValue = findValueOfOffset(spectrum, detail, value.left); - var yValue = findValueOfOffset$1(spectrum, detail, value.top); - var val = sliderValue$2(xValue, yValue); - fireSliderChange$3(spectrum, val); - return val; + var xValue = findValueOfOffset(spectrum, detail, value.left); + var yValue = findValueOfOffset$1(spectrum, detail, value.top); + var val = sliderValue$2(xValue, yValue); + fireSliderChange$3(spectrum, val); + return val; }; var moveBy$2 = function (direction, isVerticalMovement, spectrum, detail) { - var f = direction > 0 ? increaseBy : reduceBy; - var xValue = isVerticalMovement ? currentValue(detail).x : f(currentValue(detail).x, minX(detail), maxX(detail), step(detail)); - var yValue = !isVerticalMovement ? currentValue(detail).y : f(currentValue(detail).y, minY(detail), maxY(detail), step(detail)); - fireSliderChange$3(spectrum, sliderValue$2(xValue, yValue)); - return Optional.some(xValue); + var f = direction > 0 ? increaseBy : reduceBy; + var xValue = isVerticalMovement ? currentValue(detail).x : f(currentValue(detail).x, minX(detail), maxX(detail), step(detail)); + var yValue = !isVerticalMovement ? currentValue(detail).y : f(currentValue(detail).y, minY(detail), maxY(detail), step(detail)); + fireSliderChange$3(spectrum, sliderValue$2(xValue, yValue)); + return Optional.some(xValue); }; var handleMovement$2 = function (direction, isVerticalMovement) { - return function (spectrum, detail) { - return moveBy$2(direction, isVerticalMovement, spectrum, detail).map(function () { - return true; - }); - }; + return function (spectrum, detail) { + return moveBy$2(direction, isVerticalMovement, spectrum, detail).map(function () { + return true; + }); + }; }; var setToMin$2 = function (spectrum, detail) { - var mX = minX(detail); - var mY = minY(detail); - fireSliderChange$3(spectrum, sliderValue$2(mX, mY)); + var mX = minX(detail); + var mY = minY(detail); + fireSliderChange$3(spectrum, sliderValue$2(mX, mY)); }; var setToMax$2 = function (spectrum, detail) { - var mX = maxX(detail); - var mY = maxY(detail); - fireSliderChange$3(spectrum, sliderValue$2(mX, mY)); + var mX = maxX(detail); + var mY = maxY(detail); + fireSliderChange$3(spectrum, sliderValue$2(mX, mY)); }; var getValueFromEvent$2 = function (simulatedEvent) { - return getEventSource(simulatedEvent); + return getEventSource(simulatedEvent); }; var setPositionFromValue$2 = function (slider, thumb, detail, edges) { - var value = currentValue(detail); - var xPos = findPositionOfValue(slider, edges.getSpectrum(slider), value.x, edges.getLeftEdge(slider), edges.getRightEdge(slider), detail); - var yPos = findPositionOfValue$1(slider, edges.getSpectrum(slider), value.y, edges.getTopEdge(slider), edges.getBottomEdge(slider), detail); - var thumbXRadius = get$8(thumb.element) / 2; - var thumbYRadius = get$6(thumb.element) / 2; - set$3(thumb.element, 'left', xPos - thumbXRadius + 'px'); - set$3(thumb.element, 'top', yPos - thumbYRadius + 'px'); + var value = currentValue(detail); + var xPos = findPositionOfValue(slider, edges.getSpectrum(slider), value.x, edges.getLeftEdge(slider), edges.getRightEdge(slider), detail); + var yPos = findPositionOfValue$1(slider, edges.getSpectrum(slider), value.y, edges.getTopEdge(slider), edges.getBottomEdge(slider), detail); + var thumbXRadius = get$8(thumb.element) / 2; + var thumbYRadius = get$6(thumb.element) / 2; + set$3(thumb.element, 'left', xPos - thumbXRadius + 'px'); + set$3(thumb.element, 'top', yPos - thumbYRadius + 'px'); }; var onLeft$2 = handleMovement$2(-1, false); var onRight$2 = handleMovement$2(1, false); var onUp$2 = handleMovement$2(-1, true); var onDown$2 = handleMovement$2(1, true); var edgeActions$2 = { - 'top-left': Optional.some(setToTLEdgeXY), - 'top': Optional.some(setToTEdgeXY), - 'top-right': Optional.some(setToTREdgeXY), - 'right': Optional.some(setToREdgeXY), - 'bottom-right': Optional.some(setToBREdgeXY), - 'bottom': Optional.some(setToBEdgeXY), - 'bottom-left': Optional.some(setToBLEdgeXY), - 'left': Optional.some(setToLEdgeXY) + 'top-left': Optional.some(setToTLEdgeXY), + 'top': Optional.some(setToTEdgeXY), + 'top-right': Optional.some(setToTREdgeXY), + 'right': Optional.some(setToREdgeXY), + 'bottom-right': Optional.some(setToBREdgeXY), + 'bottom': Optional.some(setToBEdgeXY), + 'bottom-left': Optional.some(setToBLEdgeXY), + 'left': Optional.some(setToLEdgeXY) }; var TwoDModel = /*#__PURE__*/Object.freeze({ @@ -6017,834 +6007,822 @@ }); var SliderSchema = [ - defaulted$1('stepSize', 1), - defaulted$1('onChange', noop), - defaulted$1('onChoose', noop), - defaulted$1('onInit', noop), - defaulted$1('onDragStart', noop), - defaulted$1('onDragEnd', noop), - defaulted$1('snapToGrid', false), - defaulted$1('rounded', true), - option('snapStart'), - strictOf('model', choose$1('mode', { - x: [ - defaulted$1('minX', 0), - defaulted$1('maxX', 100), - state$1('value', function (spec) { - return Cell(spec.mode.minX); - }), - strict$1('getInitialValue'), - output('manager', HorizontalModel) - ], - y: [ - defaulted$1('minY', 0), - defaulted$1('maxY', 100), - state$1('value', function (spec) { - return Cell(spec.mode.minY); - }), - strict$1('getInitialValue'), - output('manager', VerticalModel) - ], - xy: [ - defaulted$1('minX', 0), - defaulted$1('maxX', 100), - defaulted$1('minY', 0), - defaulted$1('maxY', 100), - state$1('value', function (spec) { - return Cell({ - x: spec.mode.minX, - y: spec.mode.minY - }); - }), - strict$1('getInitialValue'), - output('manager', TwoDModel) - ] - })), - field$1('sliderBehaviours', [ - Keying, - Representing - ]), - state$1('mouseIsDown', function () { - return Cell(false); - }) + defaulted$1('stepSize', 1), + defaulted$1('onChange', noop), + defaulted$1('onChoose', noop), + defaulted$1('onInit', noop), + defaulted$1('onDragStart', noop), + defaulted$1('onDragEnd', noop), + defaulted$1('snapToGrid', false), + defaulted$1('rounded', true), + option('snapStart'), + strictOf('model', choose$1('mode', { + x: [ + defaulted$1('minX', 0), + defaulted$1('maxX', 100), + state$1('value', function (spec) { + return Cell(spec.mode.minX); + }), + strict$1('getInitialValue'), + output('manager', HorizontalModel) + ], + y: [ + defaulted$1('minY', 0), + defaulted$1('maxY', 100), + state$1('value', function (spec) { + return Cell(spec.mode.minY); + }), + strict$1('getInitialValue'), + output('manager', VerticalModel) + ], + xy: [ + defaulted$1('minX', 0), + defaulted$1('maxX', 100), + defaulted$1('minY', 0), + defaulted$1('maxY', 100), + state$1('value', function (spec) { + return Cell({ + x: spec.mode.minX, + y: spec.mode.minY + }); + }), + strict$1('getInitialValue'), + output('manager', TwoDModel) + ] + })), + field$1('sliderBehaviours', [ + Keying, + Representing + ]), + state$1('mouseIsDown', function () { + return Cell(false); + }) ]; var mouseReleased = constant('mouse.released'); var sketch = function (detail, components, _spec, _externals) { - var _a; - var getThumb = function (component) { - return getPartOrDie(component, detail, 'thumb'); - }; - var getSpectrum = function (component) { - return getPartOrDie(component, detail, 'spectrum'); - }; - var getLeftEdge = function (component) { - return getPart(component, detail, 'left-edge'); - }; - var getRightEdge = function (component) { - return getPart(component, detail, 'right-edge'); - }; - var getTopEdge = function (component) { - return getPart(component, detail, 'top-edge'); - }; - var getBottomEdge = function (component) { - return getPart(component, detail, 'bottom-edge'); - }; - var modelDetail = detail.model; - var model = modelDetail.manager; - var refresh = function (slider, thumb) { - model.setPositionFromValue(slider, thumb, detail, { - getLeftEdge: getLeftEdge, - getRightEdge: getRightEdge, - getTopEdge: getTopEdge, - getBottomEdge: getBottomEdge, - getSpectrum: getSpectrum - }); - }; - var changeValue = function (slider, newValue) { - modelDetail.value.set(newValue); + var _a; + var getThumb = function (component) { + return getPartOrDie(component, detail, 'thumb'); + }; + var getSpectrum = function (component) { + return getPartOrDie(component, detail, 'spectrum'); + }; + var getLeftEdge = function (component) { + return getPart(component, detail, 'left-edge'); + }; + var getRightEdge = function (component) { + return getPart(component, detail, 'right-edge'); + }; + var getTopEdge = function (component) { + return getPart(component, detail, 'top-edge'); + }; + var getBottomEdge = function (component) { + return getPart(component, detail, 'bottom-edge'); + }; + var modelDetail = detail.model; + var model = modelDetail.manager; + var refresh = function (slider, thumb) { + model.setPositionFromValue(slider, thumb, detail, { + getLeftEdge: getLeftEdge, + getRightEdge: getRightEdge, + getTopEdge: getTopEdge, + getBottomEdge: getBottomEdge, + getSpectrum: getSpectrum + }); + }; + var changeValue = function (slider, newValue) { + modelDetail.value.set(newValue); + var thumb = getThumb(slider); + refresh(slider, thumb); + detail.onChange(slider, thumb, newValue); + return Optional.some(true); + }; + var resetToMin = function (slider) { + model.setToMin(slider, detail); + }; + var resetToMax = function (slider) { + model.setToMax(slider, detail); + }; + var choose = function (slider) { + var fireOnChoose = function () { + getPart(slider, detail, 'thumb').each(function (thumb) { + var value = modelDetail.value.get(); + detail.onChoose(slider, thumb, value); + }); + }; + var wasDown = detail.mouseIsDown.get(); + detail.mouseIsDown.set(false); + if (wasDown) { + fireOnChoose(); + } + }; + var onDragStart = function (slider, simulatedEvent) { + simulatedEvent.stop(); + detail.mouseIsDown.set(true); + detail.onDragStart(slider, getThumb(slider)); + }; + var onDragEnd = function (slider, simulatedEvent) { + simulatedEvent.stop(); + detail.onDragEnd(slider, getThumb(slider)); + choose(slider); + }; + return { + uid: detail.uid, + dom: detail.dom, + components: components, + behaviours: augment(detail.sliderBehaviours, [ + Keying.config({ + mode: 'special', + focusIn: function (slider) { + return getPart(slider, detail, 'spectrum').map(Keying.focusIn).map(always); + } + }), + Representing.config({ + store: { + mode: 'manual', + getValue: function (_) { + return modelDetail.value.get(); + } + } + }), + Receiving.config({ channels: (_a = {}, _a[mouseReleased()] = { onReceive: choose }, _a) }) + ]), + events: derive([ + run(sliderChangeEvent(), function (slider, simulatedEvent) { + changeValue(slider, simulatedEvent.event.value); + }), + runOnAttached(function (slider, _simulatedEvent) { + var getInitial = modelDetail.getInitialValue(); + modelDetail.value.set(getInitial); var thumb = getThumb(slider); refresh(slider, thumb); - detail.onChange(slider, thumb, newValue); - return Optional.some(true); - }; - var resetToMin = function (slider) { - model.setToMin(slider, detail); - }; - var resetToMax = function (slider) { - model.setToMax(slider, detail); - }; - var choose = function (slider) { - var fireOnChoose = function () { - getPart(slider, detail, 'thumb').each(function (thumb) { - var value = modelDetail.value.get(); - detail.onChoose(slider, thumb, value); - }); - }; - var wasDown = detail.mouseIsDown.get(); - detail.mouseIsDown.set(false); - if (wasDown) { - fireOnChoose(); - } - }; - var onDragStart = function (slider, simulatedEvent) { - simulatedEvent.stop(); - detail.mouseIsDown.set(true); - detail.onDragStart(slider, getThumb(slider)); - }; - var onDragEnd = function (slider, simulatedEvent) { - simulatedEvent.stop(); - detail.onDragEnd(slider, getThumb(slider)); - choose(slider); - }; - return { - uid: detail.uid, - dom: detail.dom, - components: components, - behaviours: augment(detail.sliderBehaviours, [ - Keying.config({ - mode: 'special', - focusIn: function (slider) { - return getPart(slider, detail, 'spectrum').map(Keying.focusIn).map(always); - } - }), - Representing.config({ - store: { - mode: 'manual', - getValue: function (_) { - return modelDetail.value.get(); - } - } - }), - Receiving.config({channels: (_a = {}, _a[mouseReleased()] = {onReceive: choose}, _a)}) - ]), - events: derive([ - run(sliderChangeEvent(), function (slider, simulatedEvent) { - changeValue(slider, simulatedEvent.event.value); - }), - runOnAttached(function (slider, _simulatedEvent) { - var getInitial = modelDetail.getInitialValue(); - modelDetail.value.set(getInitial); - var thumb = getThumb(slider); - refresh(slider, thumb); - var spectrum = getSpectrum(slider); - detail.onInit(slider, thumb, spectrum, modelDetail.value.get()); - }), - run(touchstart(), onDragStart), - run(touchend(), onDragEnd), - run(mousedown(), onDragStart), - run(mouseup(), onDragEnd) - ]), - apis: { - resetToMin: resetToMin, - resetToMax: resetToMax, - changeValue: changeValue, - refresh: refresh - }, - domModification: {styles: {position: 'relative'}} - }; + var spectrum = getSpectrum(slider); + detail.onInit(slider, thumb, spectrum, modelDetail.value.get()); + }), + run(touchstart(), onDragStart), + run(touchend(), onDragEnd), + run(mousedown(), onDragStart), + run(mouseup(), onDragEnd) + ]), + apis: { + resetToMin: resetToMin, + resetToMax: resetToMax, + changeValue: changeValue, + refresh: refresh + }, + domModification: { styles: { position: 'relative' } } + }; }; var Slider = composite$1({ - name: 'Slider', - configFields: SliderSchema, - partFields: SliderParts, - factory: sketch, - apis: { - resetToMin: function (apis, slider) { - apis.resetToMin(slider); - }, - resetToMax: function (apis, slider) { - apis.resetToMax(slider); - }, - refresh: function (apis, slider) { - apis.refresh(slider); - } + name: 'Slider', + configFields: SliderSchema, + partFields: SliderParts, + factory: sketch, + apis: { + resetToMin: function (apis, slider) { + apis.resetToMin(slider); + }, + resetToMax: function (apis, slider) { + apis.resetToMax(slider); + }, + refresh: function (apis, slider) { + apis.refresh(slider); } + } }); var button = function (realm, clazz, makeItems, editor) { - return forToolbar(clazz, function () { - var items = makeItems(); - realm.setContextToolbar([{ - label: clazz + ' group', - items: items - }]); - }, {}, editor); + return forToolbar(clazz, function () { + var items = makeItems(); + realm.setContextToolbar([{ + label: clazz + ' group', + items: items + }]); + }, {}, editor); }; var BLACK = -1; var makeSlider = function (spec$1) { - var getColor = function (hue) { - if (hue < 0) { - return 'black'; - } else if (hue > 360) { - return 'white'; - } else { - return 'hsl(' + hue + ', 100%, 50%)'; - } - }; - var onInit = function (slider, thumb, spectrum, value) { - var color = getColor(value.x()); - set$3(thumb.element, 'background-color', color); - }; - var onChange = function (slider, thumb, value) { - var color = getColor(value.x()); - set$3(thumb.element, 'background-color', color); - spec$1.onChange(slider, thumb, color); - }; - return Slider.sketch({ - dom: dom$1('
              '), - components: [ - Slider.parts['left-edge'](spec('
              ')), - Slider.parts.spectrum({ - dom: dom$1('
              '), - components: [spec('
              ')], - behaviours: derive$1([Toggling.config({toggleClass: resolve('thumb-active')})]) - }), - Slider.parts['right-edge'](spec('
              ')), - Slider.parts.thumb({ - dom: dom$1('
              '), - behaviours: derive$1([Toggling.config({toggleClass: resolve('thumb-active')})]) - }) - ], - onChange: onChange, - onDragStart: function (slider, thumb) { - Toggling.on(thumb); - }, - onDragEnd: function (slider, thumb) { - Toggling.off(thumb); - }, - onInit: onInit, - stepSize: 10, - model: { - mode: 'x', - minX: 0, - maxX: 360, - getInitialValue: function () { - return {x: spec$1.getInitialValue()}; - } - }, - sliderBehaviours: derive$1([orientation(Slider.refresh)]) - }); + var getColor = function (hue) { + if (hue < 0) { + return 'black'; + } else if (hue > 360) { + return 'white'; + } else { + return 'hsl(' + hue + ', 100%, 50%)'; + } + }; + var onInit = function (slider, thumb, spectrum, value) { + var color = getColor(value.x()); + set$3(thumb.element, 'background-color', color); + }; + var onChange = function (slider, thumb, value) { + var color = getColor(value.x()); + set$3(thumb.element, 'background-color', color); + spec$1.onChange(slider, thumb, color); + }; + return Slider.sketch({ + dom: dom$1('
              '), + components: [ + Slider.parts['left-edge'](spec('
              ')), + Slider.parts.spectrum({ + dom: dom$1('
              '), + components: [spec('
              ')], + behaviours: derive$1([Toggling.config({ toggleClass: resolve('thumb-active') })]) + }), + Slider.parts['right-edge'](spec('
              ')), + Slider.parts.thumb({ + dom: dom$1('
              '), + behaviours: derive$1([Toggling.config({ toggleClass: resolve('thumb-active') })]) + }) + ], + onChange: onChange, + onDragStart: function (slider, thumb) { + Toggling.on(thumb); + }, + onDragEnd: function (slider, thumb) { + Toggling.off(thumb); + }, + onInit: onInit, + stepSize: 10, + model: { + mode: 'x', + minX: 0, + maxX: 360, + getInitialValue: function () { + return { x: spec$1.getInitialValue() }; + } + }, + sliderBehaviours: derive$1([orientation(Slider.refresh)]) + }); }; var makeItems = function (spec) { - return [makeSlider(spec)]; + return [makeSlider(spec)]; }; var sketch$1 = function (realm, editor) { - var spec = { - onChange: function (slider, thumb, color) { - editor.undoManager.transact(function () { - editor.formatter.apply('forecolor', {value: color}); - editor.nodeChanged(); - }); - }, - getInitialValue: function () { - return BLACK; - } - }; - return button(realm, 'color-levels', function () { - return makeItems(spec); - }, editor); + var spec = { + onChange: function (slider, thumb, color) { + editor.undoManager.transact(function () { + editor.formatter.apply('forecolor', { value: color }); + editor.nodeChanged(); + }); + }, + getInitialValue: function () { + return BLACK; + } + }; + return button(realm, 'color-levels', function () { + return makeItems(spec); + }, editor); }; var candidatesArray = [ - '9px', - '10px', - '11px', - '12px', - '14px', - '16px', - '18px', - '20px', - '24px', - '32px', - '36px' + '9px', + '10px', + '11px', + '12px', + '14px', + '16px', + '18px', + '20px', + '24px', + '32px', + '36px' ]; var defaultSize = 'medium'; var defaultIndex = 2; var indexToSize = function (index) { - return Optional.from(candidatesArray[index]); + return Optional.from(candidatesArray[index]); }; var sizeToIndex = function (size) { - return findIndex(candidatesArray, function (v) { - return v === size; - }); + return findIndex(candidatesArray, function (v) { + return v === size; + }); }; var getRawOrComputed = function (isRoot, rawStart) { - var optStart = isElement(rawStart) ? Optional.some(rawStart) : parent(rawStart).filter(isElement); - return optStart.map(function (start) { - var inline = closest$1(start, function (elem) { - return getRaw(elem, 'font-size').isSome(); - }, isRoot).bind(function (elem) { - return getRaw(elem, 'font-size'); - }); - return inline.getOrThunk(function () { - return get$5(start, 'font-size'); - }); - }).getOr(''); + var optStart = isElement(rawStart) ? Optional.some(rawStart) : parent(rawStart).filter(isElement); + return optStart.map(function (start) { + var inline = closest$1(start, function (elem) { + return getRaw(elem, 'font-size').isSome(); + }, isRoot).bind(function (elem) { + return getRaw(elem, 'font-size'); + }); + return inline.getOrThunk(function () { + return get$5(start, 'font-size'); + }); + }).getOr(''); }; var getSize = function (editor) { - var node = editor.selection.getStart(); - var elem = SugarElement.fromDom(node); - var root = SugarElement.fromDom(editor.getBody()); - var isRoot = function (e) { - return eq(root, e); - }; - var elemSize = getRawOrComputed(isRoot, elem); - return find(candidatesArray, function (size) { - return elemSize === size; - }).getOr(defaultSize); + var node = editor.selection.getStart(); + var elem = SugarElement.fromDom(node); + var root = SugarElement.fromDom(editor.getBody()); + var isRoot = function (e) { + return eq(root, e); + }; + var elemSize = getRawOrComputed(isRoot, elem); + return find(candidatesArray, function (size) { + return elemSize === size; + }).getOr(defaultSize); }; var applySize = function (editor, value) { - var currentValue = getSize(editor); - if (currentValue !== value) { - editor.execCommand('fontSize', false, value); - } + var currentValue = getSize(editor); + if (currentValue !== value) { + editor.execCommand('fontSize', false, value); + } }; var get$9 = function (editor) { - var size = getSize(editor); - return sizeToIndex(size).getOr(defaultIndex); + var size = getSize(editor); + return sizeToIndex(size).getOr(defaultIndex); }; var apply$1 = function (editor, index) { - indexToSize(index).each(function (size) { - applySize(editor, size); - }); + indexToSize(index).each(function (size) { + applySize(editor, size); + }); }; var candidates = constant(candidatesArray); var schema$7 = objOfOnly([ - strict$1('getInitialValue'), - strict$1('onChange'), - strict$1('category'), - strict$1('sizes') + strict$1('getInitialValue'), + strict$1('onChange'), + strict$1('category'), + strict$1('sizes') ]); var sketch$2 = function (rawSpec) { - var spec$1 = asRawOrDie('SizeSlider', schema$7, rawSpec); - var isValidValue = function (valueIndex) { - return valueIndex >= 0 && valueIndex < spec$1.sizes.length; - }; - var onChange = function (slider, thumb, valueIndex) { - var index = valueIndex.x(); - if (isValidValue(index)) { - spec$1.onChange(index); - } - }; - return Slider.sketch({ - dom: { - tag: 'div', - classes: [ - resolve('slider-' + spec$1.category + '-size-container'), - resolve('slider'), - resolve('slider-size-container') - ] - }, - onChange: onChange, - onDragStart: function (slider, thumb) { - Toggling.on(thumb); - }, - onDragEnd: function (slider, thumb) { - Toggling.off(thumb); - }, - model: { - mode: 'x', - minX: 0, - maxX: spec$1.sizes.length - 1, - getInitialValue: function () { - return {x: spec$1.getInitialValue()}; - } - }, - stepSize: 1, - snapToGrid: true, - sliderBehaviours: derive$1([orientation(Slider.refresh)]), - components: [ - Slider.parts.spectrum({ - dom: dom$1('
              '), - components: [spec('
              ')] - }), - Slider.parts.thumb({ - dom: dom$1('
              '), - behaviours: derive$1([Toggling.config({toggleClass: resolve('thumb-active')})]) - }) - ] - }); + var spec$1 = asRawOrDie('SizeSlider', schema$7, rawSpec); + var isValidValue = function (valueIndex) { + return valueIndex >= 0 && valueIndex < spec$1.sizes.length; + }; + var onChange = function (slider, thumb, valueIndex) { + var index = valueIndex.x(); + if (isValidValue(index)) { + spec$1.onChange(index); + } + }; + return Slider.sketch({ + dom: { + tag: 'div', + classes: [ + resolve('slider-' + spec$1.category + '-size-container'), + resolve('slider'), + resolve('slider-size-container') + ] + }, + onChange: onChange, + onDragStart: function (slider, thumb) { + Toggling.on(thumb); + }, + onDragEnd: function (slider, thumb) { + Toggling.off(thumb); + }, + model: { + mode: 'x', + minX: 0, + maxX: spec$1.sizes.length - 1, + getInitialValue: function () { + return { x: spec$1.getInitialValue() }; + } + }, + stepSize: 1, + snapToGrid: true, + sliderBehaviours: derive$1([orientation(Slider.refresh)]), + components: [ + Slider.parts.spectrum({ + dom: dom$1('
              '), + components: [spec('
              ')] + }), + Slider.parts.thumb({ + dom: dom$1('
              '), + behaviours: derive$1([Toggling.config({ toggleClass: resolve('thumb-active') })]) + }) + ] + }); }; var sizes = candidates(); var makeSlider$1 = function (spec) { - return sketch$2({ - onChange: spec.onChange, - sizes: sizes, - category: 'font', - getInitialValue: spec.getInitialValue - }); + return sketch$2({ + onChange: spec.onChange, + sizes: sizes, + category: 'font', + getInitialValue: spec.getInitialValue + }); }; var makeItems$1 = function (spec$1) { - return [ - spec(''), - makeSlider$1(spec$1), - spec('') - ]; + return [ + spec(''), + makeSlider$1(spec$1), + spec('') + ]; }; var sketch$3 = function (realm, editor) { - var spec = { - onChange: function (value) { - apply$1(editor, value); - }, - getInitialValue: function () { - return get$9(editor); - } - }; - return button(realm, 'font-size', function () { - return makeItems$1(spec); - }, editor); + var spec = { + onChange: function (value) { + apply$1(editor, value); + }, + getInitialValue: function () { + return get$9(editor); + } + }; + return button(realm, 'font-size', function () { + return makeItems$1(spec); + }, editor); }; var record = function (spec) { - var uid = isSketchSpec(spec) && hasNonNullableKey(spec, 'uid') ? spec.uid : generate$3('memento'); - var get = function (anyInSystem) { - return anyInSystem.getSystem().getByUid(uid).getOrDie(); - }; - var getOpt = function (anyInSystem) { - return anyInSystem.getSystem().getByUid(uid).toOptional(); - }; - var asSpec = function () { - return __assign(__assign({}, spec), {uid: uid}); - }; - return { - get: get, - getOpt: getOpt, - asSpec: asSpec - }; + var uid = isSketchSpec(spec) && hasNonNullableKey(spec, 'uid') ? spec.uid : generate$3('memento'); + var get = function (anyInSystem) { + return anyInSystem.getSystem().getByUid(uid).getOrDie(); + }; + var getOpt = function (anyInSystem) { + return anyInSystem.getSystem().getByUid(uid).toOptional(); + }; + var asSpec = function () { + return __assign(__assign({}, spec), { uid: uid }); + }; + return { + get: get, + getOpt: getOpt, + asSpec: asSpec + }; }; var promise = function () { - var Promise = function (fn) { - if (typeof this !== 'object') { - throw new TypeError('Promises must be constructed via new'); - } - if (typeof fn !== 'function') { - throw new TypeError('not a function'); - } - this._state = null; - this._value = null; - this._deferreds = []; - doResolve(fn, bind(resolve, this), bind(reject, this)); - }; - var anyWindow = window; - var asap = Promise.immediateFn || typeof anyWindow.setImmediate === 'function' && anyWindow.setImmediate || function (fn) { - setTimeout(fn, 1); - }; - - function bind(fn, thisArg) { - return function () { - return fn.apply(thisArg, arguments); - }; + var Promise = function (fn) { + if (typeof this !== 'object') { + throw new TypeError('Promises must be constructed via new'); } - - var isArray = Array.isArray || function (value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - - function handle(deferred) { - var me = this; - if (this._state === null) { - this._deferreds.push(deferred); - return; - } - asap(function () { - var cb = me._state ? deferred.onFulfilled : deferred.onRejected; - if (cb === null) { - (me._state ? deferred.resolve : deferred.reject)(me._value); - return; - } - var ret; - try { - ret = cb(me._value); - } catch (e) { - deferred.reject(e); - return; - } - deferred.resolve(ret); - }); + if (typeof fn !== 'function') { + throw new TypeError('not a function'); } - - function resolve(newValue) { - try { - if (newValue === this) { - throw new TypeError('A promise cannot be resolved with itself.'); - } - if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { - var then = newValue.then; - if (typeof then === 'function') { - doResolve(bind(then, newValue), bind(resolve, this), bind(reject, this)); - return; - } - } - this._state = true; - this._value = newValue; - finale.call(this); - } catch (e) { - reject.call(this, e); - } + this._state = null; + this._value = null; + this._deferreds = []; + doResolve(fn, bind(resolve, this), bind(reject, this)); + }; + var anyWindow = window; + var asap = Promise.immediateFn || typeof anyWindow.setImmediate === 'function' && anyWindow.setImmediate || function (fn) { + setTimeout(fn, 1); + }; + function bind(fn, thisArg) { + return function () { + return fn.apply(thisArg, arguments); + }; + } + var isArray = Array.isArray || function (value) { + return Object.prototype.toString.call(value) === '[object Array]'; + }; + function handle(deferred) { + var me = this; + if (this._state === null) { + this._deferreds.push(deferred); + return; } - - function reject(newValue) { - this._state = false; - this._value = newValue; - finale.call(this); + asap(function () { + var cb = me._state ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (me._state ? deferred.resolve : deferred.reject)(me._value); + return; + } + var ret; + try { + ret = cb(me._value); + } catch (e) { + deferred.reject(e); + return; + } + deferred.resolve(ret); + }); + } + function resolve(newValue) { + try { + if (newValue === this) { + throw new TypeError('A promise cannot be resolved with itself.'); + } + if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { + var then = newValue.then; + if (typeof then === 'function') { + doResolve(bind(then, newValue), bind(resolve, this), bind(reject, this)); + return; + } + } + this._state = true; + this._value = newValue; + finale.call(this); + } catch (e) { + reject.call(this, e); } - - function finale() { - for (var _i = 0, _a = this._deferreds; _i < _a.length; _i++) { - var deferred = _a[_i]; - handle.call(this, deferred); - } - this._deferreds = []; + } + function reject(newValue) { + this._state = false; + this._value = newValue; + finale.call(this); + } + function finale() { + for (var _i = 0, _a = this._deferreds; _i < _a.length; _i++) { + var deferred = _a[_i]; + handle.call(this, deferred); } - - function Handler(onFulfilled, onRejected, resolve, reject) { - this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; - this.onRejected = typeof onRejected === 'function' ? onRejected : null; - this.resolve = resolve; - this.reject = reject; + this._deferreds = []; + } + function Handler(onFulfilled, onRejected, resolve, reject) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.resolve = resolve; + this.reject = reject; + } + function doResolve(fn, onFulfilled, onRejected) { + var done = false; + try { + fn(function (value) { + if (done) { + return; + } + done = true; + onFulfilled(value); + }, function (reason) { + if (done) { + return; + } + done = true; + onRejected(reason); + }); + } catch (ex) { + if (done) { + return; + } + done = true; + onRejected(ex); } - - function doResolve(fn, onFulfilled, onRejected) { - var done = false; + } + Promise.prototype.catch = function (onRejected) { + return this.then(null, onRejected); + }; + Promise.prototype.then = function (onFulfilled, onRejected) { + var me = this; + return new Promise(function (resolve, reject) { + handle.call(me, new Handler(onFulfilled, onRejected, resolve, reject)); + }); + }; + Promise.all = function () { + var values = []; + for (var _i = 0; _i < arguments.length; _i++) { + values[_i] = arguments[_i]; + } + var args = Array.prototype.slice.call(values.length === 1 && isArray(values[0]) ? values[0] : values); + return new Promise(function (resolve, reject) { + if (args.length === 0) { + return resolve([]); + } + var remaining = args.length; + function res(i, val) { try { - fn(function (value) { - if (done) { - return; - } - done = true; - onFulfilled(value); - }, function (reason) { - if (done) { - return; - } - done = true; - onRejected(reason); - }); - } catch (ex) { - if (done) { - return; + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call(val, function (val) { + res(i, val); + }, reject); + return; } - done = true; - onRejected(ex); + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); } + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; } - - Promise.prototype.catch = function (onRejected) { - return this.then(null, onRejected); - }; - Promise.prototype.then = function (onFulfilled, onRejected) { - var me = this; - return new Promise(function (resolve, reject) { - handle.call(me, new Handler(onFulfilled, onRejected, resolve, reject)); - }); - }; - Promise.all = function () { - var values = []; - for (var _i = 0; _i < arguments.length; _i++) { - values[_i] = arguments[_i]; - } - var args = Array.prototype.slice.call(values.length === 1 && isArray(values[0]) ? values[0] : values); - return new Promise(function (resolve, reject) { - if (args.length === 0) { - return resolve([]); - } - var remaining = args.length; - - function res(i, val) { - try { - if (val && (typeof val === 'object' || typeof val === 'function')) { - var then = val.then; - if (typeof then === 'function') { - then.call(val, function (val) { - res(i, val); - }, reject); - return; - } - } - args[i] = val; - if (--remaining === 0) { - resolve(args); - } - } catch (ex) { - reject(ex); - } - } - - for (var i = 0; i < args.length; i++) { - res(i, args[i]); - } - }); - }; - Promise.resolve = function (value) { - if (value && typeof value === 'object' && value.constructor === Promise) { - return value; - } - return new Promise(function (resolve) { - resolve(value); - }); - }; - Promise.reject = function (reason) { - return new Promise(function (resolve, reject) { - reject(reason); - }); - }; - Promise.race = function (values) { - return new Promise(function (resolve, reject) { - for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { - var value = values_1[_i]; - value.then(resolve, reject); - } - }); - }; - return Promise; - }; - var Promise = window.Promise ? window.Promise : promise(); + return new Promise(function (resolve) { + resolve(value); + }); + }; + Promise.reject = function (reason) { + return new Promise(function (resolve, reject) { + reject(reason); + }); + }; + Promise.race = function (values) { + return new Promise(function (resolve, reject) { + for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { + var value = values_1[_i]; + value.then(resolve, reject); + } + }); + }; + return Promise; + }; + var Promise = window.Promise ? window.Promise : promise(); function blobToDataUri(blob) { - return new Promise(function (resolve) { - var reader = new FileReader(); - reader.onloadend = function () { - resolve(reader.result); - }; - reader.readAsDataURL(blob); - }); + return new Promise(function (resolve) { + var reader = new FileReader(); + reader.onloadend = function () { + resolve(reader.result); + }; + reader.readAsDataURL(blob); + }); } - function blobToBase64(blob) { - return blobToDataUri(blob).then(function (dataUri) { - return dataUri.split(',')[1]; - }); + return blobToDataUri(blob).then(function (dataUri) { + return dataUri.split(',')[1]; + }); } var blobToBase64$1 = function (blob) { - return blobToBase64(blob); + return blobToBase64(blob); }; var addImage = function (editor, blob) { - blobToBase64$1(blob).then(function (base64) { - editor.undoManager.transact(function () { - var cache = editor.editorUpload.blobCache; - var info = cache.create(generate$1('mceu'), blob, base64); - cache.add(info); - var img = editor.dom.createHTML('img', {src: info.blobUri()}); - editor.insertContent(img); - }); + blobToBase64$1(blob).then(function (base64) { + editor.undoManager.transact(function () { + var cache = editor.editorUpload.blobCache; + var info = cache.create(generate$1('mceu'), blob, base64); + cache.add(info); + var img = editor.dom.createHTML('img', { src: info.blobUri() }); + editor.insertContent(img); }); + }); }; var extractBlob = function (simulatedEvent) { - var event = simulatedEvent.event.raw; - var files = event.target.files || event.dataTransfer.files; - return Optional.from(files[0]); + var event = simulatedEvent.event.raw; + var files = event.target.files || event.dataTransfer.files; + return Optional.from(files[0]); }; var sketch$4 = function (editor) { - var pickerDom = { - tag: 'input', - attributes: { - accept: 'image/*', - type: 'file', - title: '' - }, - styles: { - visibility: 'hidden', - position: 'absolute' - } - }; - var memPicker = record({ - dom: pickerDom, - events: derive([ - cutter(click()), - run(change(), function (picker, simulatedEvent) { - extractBlob(simulatedEvent).each(function (blob) { - addImage(editor, blob); - }); - }) - ]) - }); - return Button.sketch({ - dom: getToolbarIconButton('image', editor), - components: [memPicker.asSpec()], - action: function (button) { - var picker = memPicker.get(button); - picker.element.dom.click(); - } - }); + var pickerDom = { + tag: 'input', + attributes: { + accept: 'image/*', + type: 'file', + title: '' + }, + styles: { + visibility: 'hidden', + position: 'absolute' + } + }; + var memPicker = record({ + dom: pickerDom, + events: derive([ + cutter(click()), + run(change(), function (picker, simulatedEvent) { + extractBlob(simulatedEvent).each(function (blob) { + addImage(editor, blob); + }); + }) + ]) + }); + return Button.sketch({ + dom: getToolbarIconButton('image', editor), + components: [memPicker.asSpec()], + action: function (button) { + var picker = memPicker.get(button); + picker.element.dom.click(); + } + }); }; var get$a = function (element) { - return element.dom.textContent; + return element.dom.textContent; }; var set$5 = function (element, value) { - element.dom.textContent = value; + element.dom.textContent = value; }; var isNotEmpty = function (val) { - return val.length > 0; + return val.length > 0; }; var defaultToEmpty = function (str) { - return str === undefined || str === null ? '' : str; + return str === undefined || str === null ? '' : str; }; var noLink = function (editor) { - var text = editor.selection.getContent({format: 'text'}); - return { - url: '', - text: text, - title: '', - target: '', - link: Optional.none() - }; + var text = editor.selection.getContent({ format: 'text' }); + return { + url: '', + text: text, + title: '', + target: '', + link: Optional.none() + }; }; var fromLink = function (link) { - var text = get$a(link); - var url = get$2(link, 'href'); - var title = get$2(link, 'title'); - var target = get$2(link, 'target'); - return { - url: defaultToEmpty(url), - text: text !== url ? defaultToEmpty(text) : '', - title: defaultToEmpty(title), - target: defaultToEmpty(target), - link: Optional.some(link) - }; + var text = get$a(link); + var url = get$2(link, 'href'); + var title = get$2(link, 'title'); + var target = get$2(link, 'target'); + return { + url: defaultToEmpty(url), + text: text !== url ? defaultToEmpty(text) : '', + title: defaultToEmpty(title), + target: defaultToEmpty(target), + link: Optional.some(link) + }; }; var getInfo = function (editor) { - return query(editor).fold(function () { - return noLink(editor); - }, function (link) { - return fromLink(link); - }); + return query(editor).fold(function () { + return noLink(editor); + }, function (link) { + return fromLink(link); + }); }; var wasSimple = function (link) { - var prevHref = get$2(link, 'href'); - var prevText = get$a(link); - return prevHref === prevText; + var prevHref = get$2(link, 'href'); + var prevText = get$a(link); + return prevHref === prevText; }; var getTextToApply = function (link, url, info) { - return info.text.toOptional().filter(isNotEmpty).fold(function () { - return wasSimple(link) ? Optional.some(url) : Optional.none(); - }, Optional.some); + return info.text.toOptional().filter(isNotEmpty).fold(function () { + return wasSimple(link) ? Optional.some(url) : Optional.none(); + }, Optional.some); }; var unlinkIfRequired = function (editor, info) { - var activeLink = info.link.bind(identity); - activeLink.each(function (_link) { - editor.execCommand('unlink'); - }); + var activeLink = info.link.bind(identity); + activeLink.each(function (_link) { + editor.execCommand('unlink'); + }); }; var getAttrs$1 = function (url, info) { - var attrs = {}; - attrs.href = url; - info.title.toOptional().filter(isNotEmpty).each(function (title) { - attrs.title = title; - }); - info.target.toOptional().filter(isNotEmpty).each(function (target) { - attrs.target = target; - }); - return attrs; + var attrs = {}; + attrs.href = url; + info.title.toOptional().filter(isNotEmpty).each(function (title) { + attrs.title = title; + }); + info.target.toOptional().filter(isNotEmpty).each(function (target) { + attrs.target = target; + }); + return attrs; }; var applyInfo = function (editor, info) { - info.url.toOptional().filter(isNotEmpty).fold(function () { - unlinkIfRequired(editor, info); - }, function (url) { - var attrs = getAttrs$1(url, info); - var activeLink = info.link.bind(identity); - activeLink.fold(function () { - var text = info.text.toOptional().filter(isNotEmpty).getOr(url); - editor.insertContent(editor.dom.createHTML('a', attrs, editor.dom.encode(text))); - }, function (link) { - var text = getTextToApply(link, url, info); - setAll(link, attrs); - text.each(function (newText) { - set$5(link, newText); - }); - }); + info.url.toOptional().filter(isNotEmpty).fold(function () { + unlinkIfRequired(editor, info); + }, function (url) { + var attrs = getAttrs$1(url, info); + var activeLink = info.link.bind(identity); + activeLink.fold(function () { + var text = info.text.toOptional().filter(isNotEmpty).getOr(url); + editor.insertContent(editor.dom.createHTML('a', attrs, editor.dom.encode(text))); + }, function (link) { + var text = getTextToApply(link, url, info); + setAll(link, attrs); + text.each(function (newText) { + set$5(link, newText); + }); }); + }); }; var query = function (editor) { - var start = SugarElement.fromDom(editor.selection.getStart()); - return closest$2(start, 'a'); + var start = SugarElement.fromDom(editor.selection.getStart()); + return closest$2(start, 'a'); }; var platform$1 = detect$3(); var preserve = function (f, editor) { - var rng = editor.selection.getRng(); - f(); - editor.selection.setRng(rng); + var rng = editor.selection.getRng(); + f(); + editor.selection.setRng(rng); }; var forAndroid = function (editor, f) { - var wrapper = platform$1.os.isAndroid() ? preserve : apply; - wrapper(f, editor); + var wrapper = platform$1.os.isAndroid() ? preserve : apply; + wrapper(f, editor); }; var events$6 = function (name, eventHandlers) { - var events = derive(eventHandlers); - return create$1({ - fields: [strict$1('enabled')], - name: name, - active: {events: constant(events)} - }); + var events = derive(eventHandlers); + return create$1({ + fields: [strict$1('enabled')], + name: name, + active: { events: constant(events) } + }); }; var config = function (name, eventHandlers) { - var me = events$6(name, eventHandlers); - return { - key: name, - value: { - config: {}, - me: me, - configAsRaw: constant({}), - initialConfig: {}, - state: NoState - } - }; + var me = events$6(name, eventHandlers); + return { + key: name, + value: { + config: {}, + me: me, + configAsRaw: constant({}), + initialConfig: {}, + state: NoState + } + }; }; var getCurrent = function (component, composeConfig, _composeState) { - return composeConfig.find(component); + return composeConfig.find(component); }; var ComposeApis = /*#__PURE__*/Object.freeze({ @@ -6855,153 +6833,153 @@ var ComposeSchema = [strict$1('find')]; var Composing = create$1({ - fields: ComposeSchema, - name: 'composing', - apis: ComposeApis + fields: ComposeSchema, + name: 'composing', + apis: ComposeApis }); var factory$1 = function (detail) { - var _a = detail.dom, attributes = _a.attributes, domWithoutAttributes = __rest(_a, ['attributes']); - return { - uid: detail.uid, - dom: __assign({ - tag: 'div', - attributes: __assign({role: 'presentation'}, attributes) - }, domWithoutAttributes), - components: detail.components, - behaviours: get$7(detail.containerBehaviours), - events: detail.events, - domModification: detail.domModification, - eventOrder: detail.eventOrder - }; + var _a = detail.dom, attributes = _a.attributes, domWithoutAttributes = __rest(_a, ['attributes']); + return { + uid: detail.uid, + dom: __assign({ + tag: 'div', + attributes: __assign({ role: 'presentation' }, attributes) + }, domWithoutAttributes), + components: detail.components, + behaviours: get$7(detail.containerBehaviours), + events: detail.events, + domModification: detail.domModification, + eventOrder: detail.eventOrder + }; }; var Container = single$2({ - name: 'Container', - factory: factory$1, - configFields: [ - defaulted$1('components', []), - field$1('containerBehaviours', []), - defaulted$1('events', {}), - defaulted$1('domModification', {}), - defaulted$1('eventOrder', {}) - ] + name: 'Container', + factory: factory$1, + configFields: [ + defaulted$1('components', []), + field$1('containerBehaviours', []), + defaulted$1('events', {}), + defaulted$1('domModification', {}), + defaulted$1('eventOrder', {}) + ] }); var factory$2 = function (detail) { - return { - uid: detail.uid, - dom: detail.dom, - behaviours: SketchBehaviours.augment(detail.dataBehaviours, [ - Representing.config({ - store: { - mode: 'memory', - initialValue: detail.getInitialValue() - } - }), - Composing.config({find: Optional.some}) - ]), - events: derive([runOnAttached(function (component, _simulatedEvent) { - Representing.setValue(component, detail.getInitialValue()); - })]) - }; + return { + uid: detail.uid, + dom: detail.dom, + behaviours: SketchBehaviours.augment(detail.dataBehaviours, [ + Representing.config({ + store: { + mode: 'memory', + initialValue: detail.getInitialValue() + } + }), + Composing.config({ find: Optional.some }) + ]), + events: derive([runOnAttached(function (component, _simulatedEvent) { + Representing.setValue(component, detail.getInitialValue()); + })]) + }; }; var DataField = single$2({ - name: 'DataField', - factory: factory$2, - configFields: [ - strict$1('uid'), - strict$1('dom'), - strict$1('getInitialValue'), - SketchBehaviours.field('dataBehaviours', [ - Representing, - Composing - ]) - ] + name: 'DataField', + factory: factory$2, + configFields: [ + strict$1('uid'), + strict$1('dom'), + strict$1('getInitialValue'), + SketchBehaviours.field('dataBehaviours', [ + Representing, + Composing + ]) + ] }); var get$b = function (element) { - return element.dom.value; + return element.dom.value; }; var set$6 = function (element, value) { - if (value === undefined) { - throw new Error('Value.set was undefined'); - } - element.dom.value = value; + if (value === undefined) { + throw new Error('Value.set was undefined'); + } + element.dom.value = value; }; var schema$8 = constant([ - option('data'), - defaulted$1('inputAttributes', {}), - defaulted$1('inputStyles', {}), - defaulted$1('tag', 'input'), - defaulted$1('inputClasses', []), - onHandler('onSetValue'), - defaulted$1('styles', {}), - defaulted$1('eventOrder', {}), - field$1('inputBehaviours', [ - Representing, - Focusing - ]), - defaulted$1('selectOnFocus', true) + option('data'), + defaulted$1('inputAttributes', {}), + defaulted$1('inputStyles', {}), + defaulted$1('tag', 'input'), + defaulted$1('inputClasses', []), + onHandler('onSetValue'), + defaulted$1('styles', {}), + defaulted$1('eventOrder', {}), + field$1('inputBehaviours', [ + Representing, + Focusing + ]), + defaulted$1('selectOnFocus', true) ]); var focusBehaviours = function (detail) { - return derive$1([Focusing.config({ - onFocus: !detail.selectOnFocus ? noop : function (component) { - var input = component.element; - var value = get$b(input); - input.dom.setSelectionRange(0, value.length); - } + return derive$1([Focusing.config({ + onFocus: !detail.selectOnFocus ? noop : function (component) { + var input = component.element; + var value = get$b(input); + input.dom.setSelectionRange(0, value.length); + } })]); }; var behaviours = function (detail) { - return __assign(__assign({}, focusBehaviours(detail)), augment(detail.inputBehaviours, [Representing.config({ - store: __assign(__assign({mode: 'manual'}, detail.data.map(function (data) { - return {initialValue: data}; - }).getOr({})), { - getValue: function (input) { - return get$b(input.element); - }, - setValue: function (input, data) { - var current = get$b(input.element); - if (current !== data) { - set$6(input.element, data); - } - } - }), - onSetValue: detail.onSetValue + return __assign(__assign({}, focusBehaviours(detail)), augment(detail.inputBehaviours, [Representing.config({ + store: __assign(__assign({ mode: 'manual' }, detail.data.map(function (data) { + return { initialValue: data }; + }).getOr({})), { + getValue: function (input) { + return get$b(input.element); + }, + setValue: function (input, data) { + var current = get$b(input.element); + if (current !== data) { + set$6(input.element, data); + } + } + }), + onSetValue: detail.onSetValue })])); }; var dom$2 = function (detail) { - return { - tag: detail.tag, - attributes: __assign({type: 'text'}, detail.inputAttributes), - styles: detail.inputStyles, - classes: detail.inputClasses - }; + return { + tag: detail.tag, + attributes: __assign({ type: 'text' }, detail.inputAttributes), + styles: detail.inputStyles, + classes: detail.inputClasses + }; }; var factory$3 = function (detail, _spec) { - return { - uid: detail.uid, - dom: dom$2(detail), - components: [], - behaviours: behaviours(detail), - eventOrder: detail.eventOrder - }; + return { + uid: detail.uid, + dom: dom$2(detail), + components: [], + behaviours: behaviours(detail), + eventOrder: detail.eventOrder + }; }; var Input = single$2({ - name: 'Input', - configFields: schema$8(), - factory: factory$3 + name: 'Input', + configFields: schema$8(), + factory: factory$3 }); var exhibit$3 = function (base, tabConfig) { - return nu$5({ - attributes: wrapAll$1([{ - key: tabConfig.tabAttr, - value: 'true' - }]) - }); + return nu$5({ + attributes: wrapAll$1([{ + key: tabConfig.tabAttr, + value: 'true' + }]) + }); }; var ActiveTabstopping = /*#__PURE__*/Object.freeze({ @@ -7012,127 +6990,127 @@ var TabstopSchema = [defaulted$1('tabAttr', 'data-alloy-tabstop')]; var Tabstopping = create$1({ - fields: TabstopSchema, - name: 'tabstopping', - active: ActiveTabstopping + fields: TabstopSchema, + name: 'tabstopping', + active: ActiveTabstopping }); var global$3 = tinymce.util.Tools.resolve('tinymce.util.I18n'); var clearInputBehaviour = 'input-clearing'; var field$2 = function (name, placeholder) { - var inputSpec = record(Input.sketch({ - inputAttributes: {placeholder: global$3.translate(placeholder)}, - onSetValue: function (input$1, _data) { - emit(input$1, input()); - }, - inputBehaviours: derive$1([ - Composing.config({find: Optional.some}), - Tabstopping.config({}), - Keying.config({mode: 'execution'}) - ]), - selectOnFocus: false - })); - var buttonSpec = record(Button.sketch({ - dom: dom$1(''), - action: function (button) { - var input = inputSpec.get(button); - Representing.setValue(input, ''); - } - })); - return { - name: name, - spec: Container.sketch({ - dom: dom$1('
              '), - components: [ - inputSpec.asSpec(), - buttonSpec.asSpec() - ], - containerBehaviours: derive$1([ - Toggling.config({toggleClass: resolve('input-container-empty')}), - Composing.config({ - find: function (comp) { - return Optional.some(inputSpec.get(comp)); - } - }), - config(clearInputBehaviour, [run(input(), function (iContainer) { - var input = inputSpec.get(iContainer); - var val = Representing.getValue(input); - var f = val.length > 0 ? Toggling.off : Toggling.on; - f(iContainer); - })]) - ]) - }) - }; + var inputSpec = record(Input.sketch({ + inputAttributes: { placeholder: global$3.translate(placeholder) }, + onSetValue: function (input$1, _data) { + emit(input$1, input()); + }, + inputBehaviours: derive$1([ + Composing.config({ find: Optional.some }), + Tabstopping.config({}), + Keying.config({ mode: 'execution' }) + ]), + selectOnFocus: false + })); + var buttonSpec = record(Button.sketch({ + dom: dom$1(''), + action: function (button) { + var input = inputSpec.get(button); + Representing.setValue(input, ''); + } + })); + return { + name: name, + spec: Container.sketch({ + dom: dom$1('
              '), + components: [ + inputSpec.asSpec(), + buttonSpec.asSpec() + ], + containerBehaviours: derive$1([ + Toggling.config({ toggleClass: resolve('input-container-empty') }), + Composing.config({ + find: function (comp) { + return Optional.some(inputSpec.get(comp)); + } + }), + config(clearInputBehaviour, [run(input(), function (iContainer) { + var input = inputSpec.get(iContainer); + var val = Representing.getValue(input); + var f = val.length > 0 ? Toggling.off : Toggling.on; + f(iContainer); + })]) + ]) + }) + }; }; var hidden = function (name) { - return { - name: name, - spec: DataField.sketch({ - dom: { - tag: 'span', - styles: {display: 'none'} - }, - getInitialValue: function () { - return Optional.none(); - } - }) - }; + return { + name: name, + spec: DataField.sketch({ + dom: { + tag: 'span', + styles: { display: 'none' } + }, + getInitialValue: function () { + return Optional.none(); + } + }) + }; }; var nativeDisabled = [ - 'input', - 'button', - 'textarea', - 'select' + 'input', + 'button', + 'textarea', + 'select' ]; var onLoad$5 = function (component, disableConfig, disableState) { - var f = disableConfig.disabled() ? disable : enable; - f(component, disableConfig); + var f = disableConfig.disabled() ? disable : enable; + f(component, disableConfig); }; var hasNative = function (component, config) { - return config.useNative === true && contains(nativeDisabled, name(component.element)); + return config.useNative === true && contains(nativeDisabled, name(component.element)); }; var nativeIsDisabled = function (component) { - return has$1(component.element, 'disabled'); + return has$1(component.element, 'disabled'); }; var nativeDisable = function (component) { - set(component.element, 'disabled', 'disabled'); + set(component.element, 'disabled', 'disabled'); }; var nativeEnable = function (component) { - remove$1(component.element, 'disabled'); + remove$1(component.element, 'disabled'); }; var ariaIsDisabled = function (component) { - return get$2(component.element, 'aria-disabled') === 'true'; + return get$2(component.element, 'aria-disabled') === 'true'; }; var ariaDisable = function (component) { - set(component.element, 'aria-disabled', 'true'); + set(component.element, 'aria-disabled', 'true'); }; var ariaEnable = function (component) { - set(component.element, 'aria-disabled', 'false'); + set(component.element, 'aria-disabled', 'false'); }; var disable = function (component, disableConfig, _disableState) { - disableConfig.disableClass.each(function (disableClass) { - add$2(component.element, disableClass); - }); - var f = hasNative(component, disableConfig) ? nativeDisable : ariaDisable; - f(component); - disableConfig.onDisabled(component); + disableConfig.disableClass.each(function (disableClass) { + add$2(component.element, disableClass); + }); + var f = hasNative(component, disableConfig) ? nativeDisable : ariaDisable; + f(component); + disableConfig.onDisabled(component); }; var enable = function (component, disableConfig, _disableState) { - disableConfig.disableClass.each(function (disableClass) { - remove$4(component.element, disableClass); - }); - var f = hasNative(component, disableConfig) ? nativeEnable : ariaEnable; - f(component); - disableConfig.onEnabled(component); + disableConfig.disableClass.each(function (disableClass) { + remove$4(component.element, disableClass); + }); + var f = hasNative(component, disableConfig) ? nativeEnable : ariaEnable; + f(component); + disableConfig.onEnabled(component); }; var isDisabled = function (component, disableConfig) { - return hasNative(component, disableConfig) ? nativeIsDisabled(component) : ariaIsDisabled(component); + return hasNative(component, disableConfig) ? nativeIsDisabled(component) : ariaIsDisabled(component); }; var set$7 = function (component, disableConfig, disableState, disabled) { - var f = disabled ? disable : enable; - f(component, disableConfig); + var f = disabled ? disable : enable; + f(component, disableConfig); }; var DisableApis = /*#__PURE__*/Object.freeze({ @@ -7145,15 +7123,15 @@ }); var exhibit$4 = function (base, disableConfig) { - return nu$5({classes: disableConfig.disabled() ? disableConfig.disableClass.toArray() : []}); + return nu$5({ classes: disableConfig.disabled() ? disableConfig.disableClass.toArray() : [] }); }; var events$7 = function (disableConfig, disableState) { - return derive([ - abort(execute(), function (component, _simulatedEvent) { - return isDisabled(component, disableConfig); - }), - loadEvent(disableConfig, disableState, onLoad$5) - ]); + return derive([ + abort(execute(), function (component, _simulatedEvent) { + return isDisabled(component, disableConfig); + }), + loadEvent(disableConfig, disableState, onLoad$5) + ]); }; var ActiveDisable = /*#__PURE__*/Object.freeze({ @@ -7163,414 +7141,414 @@ }); var DisableSchema = [ - defaultedFunction('disabled', never), - defaulted$1('useNative', true), - option('disableClass'), - onHandler('onDisabled'), - onHandler('onEnabled') + defaultedFunction('disabled', never), + defaulted$1('useNative', true), + option('disableClass'), + onHandler('onDisabled'), + onHandler('onEnabled') ]; var Disabling = create$1({ - fields: DisableSchema, - name: 'disabling', - active: ActiveDisable, - apis: DisableApis + fields: DisableSchema, + name: 'disabling', + active: ActiveDisable, + apis: DisableApis }); var owner$1 = 'form'; var schema$9 = [field$1('formBehaviours', [Representing])]; var getPartName = function (name) { - return ''; + return ''; }; var sketch$5 = function (fSpec) { - var parts = function () { - var record = []; - var field = function (name, config) { - record.push(name); - return generateOne(owner$1, getPartName(name), config); - }; - return { - field: field, - record: function () { - return record; - } - }; - }(); - var spec = fSpec(parts); - var partNames = parts.record(); - var fieldParts = map(partNames, function (n) { - return required({ - name: n, - pname: getPartName(n) - }); - }); - return composite(owner$1, schema$9, fieldParts, make, spec); + var parts = function () { + var record = []; + var field = function (name, config) { + record.push(name); + return generateOne(owner$1, getPartName(name), config); + }; + return { + field: field, + record: function () { + return record; + } + }; + }(); + var spec = fSpec(parts); + var partNames = parts.record(); + var fieldParts = map(partNames, function (n) { + return required({ + name: n, + pname: getPartName(n) + }); + }); + return composite(owner$1, schema$9, fieldParts, make, spec); }; var toResult$1 = function (o, e) { - return o.fold(function () { - return Result.error(e); - }, Result.value); + return o.fold(function () { + return Result.error(e); + }, Result.value); }; var make = function (detail, components) { - return { - uid: detail.uid, - dom: detail.dom, - components: components, - behaviours: augment(detail.formBehaviours, [Representing.config({ - store: { - mode: 'manual', - getValue: function (form) { - var resPs = getAllParts(form, detail); - return map$1(resPs, function (resPThunk, pName) { - return resPThunk().bind(function (v) { - var opt = Composing.getCurrent(v); - return toResult$1(opt, new Error('Cannot find a current component to extract the value from for form part \'' + pName + '\': ' + element(v.element))); - }).map(Representing.getValue); - }); - }, - setValue: function (form, values) { - each$1(values, function (newValue, key) { - getPart(form, detail, key).each(function (wrapper) { - Composing.getCurrent(wrapper).each(function (field) { - Representing.setValue(field, newValue); - }); - }); - }); - } - } - })]), - apis: { - getField: function (form, key) { - return getPart(form, detail, key).bind(Composing.getCurrent); - } + return { + uid: detail.uid, + dom: detail.dom, + components: components, + behaviours: augment(detail.formBehaviours, [Representing.config({ + store: { + mode: 'manual', + getValue: function (form) { + var resPs = getAllParts(form, detail); + return map$1(resPs, function (resPThunk, pName) { + return resPThunk().bind(function (v) { + var opt = Composing.getCurrent(v); + return toResult$1(opt, new Error('Cannot find a current component to extract the value from for form part \'' + pName + '\': ' + element(v.element))); + }).map(Representing.getValue); + }); + }, + setValue: function (form, values) { + each$1(values, function (newValue, key) { + getPart(form, detail, key).each(function (wrapper) { + Composing.getCurrent(wrapper).each(function (field) { + Representing.setValue(field, newValue); + }); + }); + }); + } } - }; + })]), + apis: { + getField: function (form, key) { + return getPart(form, detail, key).bind(Composing.getCurrent); + } + } + }; }; var Form = { - getField: makeApi(function (apis, component, key) { - return apis.getField(component, key); - }), - sketch: sketch$5 + getField: makeApi(function (apis, component, key) { + return apis.getField(component, key); + }), + sketch: sketch$5 }; var api$2 = function () { - var subject = Cell(Optional.none()); - var revoke = function () { - return subject.get().each(function (s) { - return s.destroy(); - }); - }; - var clear = function () { - revoke(); - subject.set(Optional.none()); - }; - var set = function (s) { - revoke(); - subject.set(Optional.some(s)); - }; - var run = function (f) { - return subject.get().each(f); - }; - var isSet = function () { - return subject.get().isSome(); - }; - return { - clear: clear, - isSet: isSet, - set: set, - run: run - }; + var subject = Cell(Optional.none()); + var revoke = function () { + return subject.get().each(function (s) { + return s.destroy(); + }); + }; + var clear = function () { + revoke(); + subject.set(Optional.none()); + }; + var set = function (s) { + revoke(); + subject.set(Optional.some(s)); + }; + var run = function (f) { + return subject.get().each(f); + }; + var isSet = function () { + return subject.get().isSome(); + }; + return { + clear: clear, + isSet: isSet, + set: set, + run: run + }; }; var value$2 = function () { - var subject = Cell(Optional.none()); - var clear = function () { - return subject.set(Optional.none()); - }; - var set = function (s) { - return subject.set(Optional.some(s)); - }; - var isSet = function () { - return subject.get().isSome(); - }; - var on = function (f) { - return subject.get().each(f); - }; - return { - clear: clear, - set: set, - isSet: isSet, - on: on - }; + var subject = Cell(Optional.none()); + var clear = function () { + return subject.set(Optional.none()); + }; + var set = function (s) { + return subject.set(Optional.some(s)); + }; + var isSet = function () { + return subject.get().isSome(); + }; + var on = function (f) { + return subject.get().each(f); + }; + return { + clear: clear, + set: set, + isSet: isSet, + on: on + }; }; var SWIPING_LEFT = 1; var SWIPING_RIGHT = -1; var SWIPING_NONE = 0; var init$2 = function (xValue) { - return { - xValue: xValue, - points: [] - }; + return { + xValue: xValue, + points: [] + }; }; var move$1 = function (model, xValue) { - if (xValue === model.xValue) { - return model; - } - var currentDirection = xValue - model.xValue > 0 ? SWIPING_LEFT : SWIPING_RIGHT; - var newPoint = { - direction: currentDirection, - xValue: xValue - }; - var priorPoints = function () { - if (model.points.length === 0) { - return []; - } else { - var prev = model.points[model.points.length - 1]; - return prev.direction === currentDirection ? model.points.slice(0, model.points.length - 1) : model.points; - } - }(); - return { - xValue: xValue, - points: priorPoints.concat([newPoint]) - }; - }; - var complete = function (model) { + if (xValue === model.xValue) { + return model; + } + var currentDirection = xValue - model.xValue > 0 ? SWIPING_LEFT : SWIPING_RIGHT; + var newPoint = { + direction: currentDirection, + xValue: xValue + }; + var priorPoints = function () { if (model.points.length === 0) { - return SWIPING_NONE; + return []; } else { - var firstDirection = model.points[0].direction; - var lastDirection = model.points[model.points.length - 1].direction; - return firstDirection === SWIPING_RIGHT && lastDirection === SWIPING_RIGHT ? SWIPING_RIGHT : firstDirection === SWIPING_LEFT && lastDirection === SWIPING_LEFT ? SWIPING_LEFT : SWIPING_NONE; + var prev = model.points[model.points.length - 1]; + return prev.direction === currentDirection ? model.points.slice(0, model.points.length - 1) : model.points; } + }(); + return { + xValue: xValue, + points: priorPoints.concat([newPoint]) + }; + }; + var complete = function (model) { + if (model.points.length === 0) { + return SWIPING_NONE; + } else { + var firstDirection = model.points[0].direction; + var lastDirection = model.points[model.points.length - 1].direction; + return firstDirection === SWIPING_RIGHT && lastDirection === SWIPING_RIGHT ? SWIPING_RIGHT : firstDirection === SWIPING_LEFT && lastDirection === SWIPING_LEFT ? SWIPING_LEFT : SWIPING_NONE; + } }; var sketch$6 = function (rawSpec) { - var navigateEvent = 'navigateEvent'; - var wrapperAdhocEvents = 'serializer-wrapper-events'; - var formAdhocEvents = 'form-events'; - var schema = objOf([ - strict$1('fields'), - defaulted$1('maxFieldIndex', rawSpec.fields.length - 1), - strict$1('onExecute'), - strict$1('getInitialValue'), - state$1('state', function () { - return { - dialogSwipeState: value$2(), - currentScreen: Cell(0) - }; - }) - ]); - var spec$1 = asRawOrDie('SerialisedDialog', schema, rawSpec); - var navigationButton = function (direction, directionName, enabled) { - return Button.sketch({ - dom: dom$1(''), - action: function (button) { - emitWith(button, navigateEvent, {direction: direction}); - }, - buttonBehaviours: derive$1([Disabling.config({ - disableClass: resolve('toolbar-navigation-disabled'), - disabled: function () { - return !enabled; - } - })]) - }); - }; - var reposition = function (dialog, message) { - descendant$1(dialog.element, '.' + resolve('serialised-dialog-chain')).each(function (parent) { - set$3(parent, 'left', -spec$1.state.currentScreen.get() * message.width + 'px'); - }); - }; - var navigate = function (dialog, direction) { - var screens = descendants(dialog.element, '.' + resolve('serialised-dialog-screen')); - descendant$1(dialog.element, '.' + resolve('serialised-dialog-chain')).each(function (parent) { - if (spec$1.state.currentScreen.get() + direction >= 0 && spec$1.state.currentScreen.get() + direction < screens.length) { - getRaw(parent, 'left').each(function (left) { - var currentLeft = parseInt(left, 10); - var w = get$8(screens[0]); - set$3(parent, 'left', currentLeft - direction * w + 'px'); - }); - spec$1.state.currentScreen.set(spec$1.state.currentScreen.get() + direction); - } - }); - }; - var focusInput = function (dialog) { - var inputs = descendants(dialog.element, 'input'); - var optInput = Optional.from(inputs[spec$1.state.currentScreen.get()]); - optInput.each(function (input) { - dialog.getSystem().getByDom(input).each(function (inputComp) { - dispatchFocus(dialog, inputComp.element); - }); - }); - var dotitems = memDots.get(dialog); - Highlighting.highlightAt(dotitems, spec$1.state.currentScreen.get()); - }; - var resetState = function () { - spec$1.state.currentScreen.set(0); - spec$1.state.dialogSwipeState.clear(); - }; - var memForm = record(Form.sketch(function (parts) { - return { - dom: dom$1('
              '), - components: [Container.sketch({ - dom: dom$1('
              '), - components: map(spec$1.fields, function (field, i) { - return i <= spec$1.maxFieldIndex ? Container.sketch({ - dom: dom$1('
              '), - components: [ - navigationButton(-1, 'previous', i > 0), - parts.field(field.name, field.spec), - navigationButton(+1, 'next', i < spec$1.maxFieldIndex) - ] - }) : parts.field(field.name, field.spec); - }) - })], - formBehaviours: derive$1([ - orientation(function (dialog, message) { - reposition(dialog, message); - }), - Keying.config({ - mode: 'special', - focusIn: function (dialog, _specialInfo) { - focusInput(dialog); - }, - onTab: function (dialog, _specialInfo) { - navigate(dialog, +1); - return Optional.some(true); - }, - onShiftTab: function (dialog, _specialInfo) { - navigate(dialog, -1); - return Optional.some(true); - } - }), - config(formAdhocEvents, [ - runOnAttached(function (dialog, _simulatedEvent) { - resetState(); - var dotitems = memDots.get(dialog); - Highlighting.highlightFirst(dotitems); - spec$1.getInitialValue(dialog).each(function (v) { - Representing.setValue(dialog, v); - }); - }), - runOnExecute(spec$1.onExecute), - run(transitionend(), function (dialog, simulatedEvent) { - var event = simulatedEvent.event; - if (event.raw.propertyName === 'left') { - focusInput(dialog); - } - }), - run(navigateEvent, function (dialog, simulatedEvent) { - var event = simulatedEvent.event; - var direction = event.direction; - navigate(dialog, direction); - }) - ]) - ]) - }; - })); - var memDots = record({ - dom: dom$1('
              '), - behaviours: derive$1([Highlighting.config({ - highlightClass: resolve('dot-active'), - itemClass: resolve('dot-item') - })]), - components: bind(spec$1.fields, function (_f, i) { - return i <= spec$1.maxFieldIndex ? [spec('
              ')] : []; - }) + var navigateEvent = 'navigateEvent'; + var wrapperAdhocEvents = 'serializer-wrapper-events'; + var formAdhocEvents = 'form-events'; + var schema = objOf([ + strict$1('fields'), + defaulted$1('maxFieldIndex', rawSpec.fields.length - 1), + strict$1('onExecute'), + strict$1('getInitialValue'), + state$1('state', function () { + return { + dialogSwipeState: value$2(), + currentScreen: Cell(0) + }; + }) + ]); + var spec$1 = asRawOrDie('SerialisedDialog', schema, rawSpec); + var navigationButton = function (direction, directionName, enabled) { + return Button.sketch({ + dom: dom$1(''), + action: function (button) { + emitWith(button, navigateEvent, { direction: direction }); + }, + buttonBehaviours: derive$1([Disabling.config({ + disableClass: resolve('toolbar-navigation-disabled'), + disabled: function () { + return !enabled; + } + })]) }); + }; + var reposition = function (dialog, message) { + descendant$1(dialog.element, '.' + resolve('serialised-dialog-chain')).each(function (parent) { + set$3(parent, 'left', -spec$1.state.currentScreen.get() * message.width + 'px'); + }); + }; + var navigate = function (dialog, direction) { + var screens = descendants(dialog.element, '.' + resolve('serialised-dialog-screen')); + descendant$1(dialog.element, '.' + resolve('serialised-dialog-chain')).each(function (parent) { + if (spec$1.state.currentScreen.get() + direction >= 0 && spec$1.state.currentScreen.get() + direction < screens.length) { + getRaw(parent, 'left').each(function (left) { + var currentLeft = parseInt(left, 10); + var w = get$8(screens[0]); + set$3(parent, 'left', currentLeft - direction * w + 'px'); + }); + spec$1.state.currentScreen.set(spec$1.state.currentScreen.get() + direction); + } + }); + }; + var focusInput = function (dialog) { + var inputs = descendants(dialog.element, 'input'); + var optInput = Optional.from(inputs[spec$1.state.currentScreen.get()]); + optInput.each(function (input) { + dialog.getSystem().getByDom(input).each(function (inputComp) { + dispatchFocus(dialog, inputComp.element); + }); + }); + var dotitems = memDots.get(dialog); + Highlighting.highlightAt(dotitems, spec$1.state.currentScreen.get()); + }; + var resetState = function () { + spec$1.state.currentScreen.set(0); + spec$1.state.dialogSwipeState.clear(); + }; + var memForm = record(Form.sketch(function (parts) { return { - dom: dom$1('
              '), - components: [ - memForm.asSpec(), - memDots.asSpec() - ], - behaviours: derive$1([ - Keying.config({ - mode: 'special', - focusIn: function (wrapper) { - var form = memForm.get(wrapper); - Keying.focusIn(form); - } - }), - config(wrapperAdhocEvents, [ - run(touchstart(), function (_wrapper, simulatedEvent) { - var event = simulatedEvent.event; - spec$1.state.dialogSwipeState.set(init$2(event.raw.touches[0].clientX)); - }), - run(touchmove(), function (_wrapper, simulatedEvent) { - var event = simulatedEvent.event; - spec$1.state.dialogSwipeState.on(function (state) { - simulatedEvent.event.prevent(); - spec$1.state.dialogSwipeState.set(move$1(state, event.raw.touches[0].clientX)); - }); - }), - run(touchend(), function (wrapper, _simulatedEvent) { - spec$1.state.dialogSwipeState.on(function (state) { - var dialog = memForm.get(wrapper); - var direction = -1 * complete(state); - navigate(dialog, direction); - }); - }) - ]) + dom: dom$1('
              '), + components: [Container.sketch({ + dom: dom$1('
              '), + components: map(spec$1.fields, function (field, i) { + return i <= spec$1.maxFieldIndex ? Container.sketch({ + dom: dom$1('
              '), + components: [ + navigationButton(-1, 'previous', i > 0), + parts.field(field.name, field.spec), + navigationButton(+1, 'next', i < spec$1.maxFieldIndex) + ] + }) : parts.field(field.name, field.spec); + }) + })], + formBehaviours: derive$1([ + orientation(function (dialog, message) { + reposition(dialog, message); + }), + Keying.config({ + mode: 'special', + focusIn: function (dialog, _specialInfo) { + focusInput(dialog); + }, + onTab: function (dialog, _specialInfo) { + navigate(dialog, +1); + return Optional.some(true); + }, + onShiftTab: function (dialog, _specialInfo) { + navigate(dialog, -1); + return Optional.some(true); + } + }), + config(formAdhocEvents, [ + runOnAttached(function (dialog, _simulatedEvent) { + resetState(); + var dotitems = memDots.get(dialog); + Highlighting.highlightFirst(dotitems); + spec$1.getInitialValue(dialog).each(function (v) { + Representing.setValue(dialog, v); + }); + }), + runOnExecute(spec$1.onExecute), + run(transitionend(), function (dialog, simulatedEvent) { + var event = simulatedEvent.event; + if (event.raw.propertyName === 'left') { + focusInput(dialog); + } + }), + run(navigateEvent, function (dialog, simulatedEvent) { + var event = simulatedEvent.event; + var direction = event.direction; + navigate(dialog, direction); + }) ]) - }; + ]) + }; + })); + var memDots = record({ + dom: dom$1('
              '), + behaviours: derive$1([Highlighting.config({ + highlightClass: resolve('dot-active'), + itemClass: resolve('dot-item') + })]), + components: bind(spec$1.fields, function (_f, i) { + return i <= spec$1.maxFieldIndex ? [spec('
              ')] : []; + }) + }); + return { + dom: dom$1('
              '), + components: [ + memForm.asSpec(), + memDots.asSpec() + ], + behaviours: derive$1([ + Keying.config({ + mode: 'special', + focusIn: function (wrapper) { + var form = memForm.get(wrapper); + Keying.focusIn(form); + } + }), + config(wrapperAdhocEvents, [ + run(touchstart(), function (_wrapper, simulatedEvent) { + var event = simulatedEvent.event; + spec$1.state.dialogSwipeState.set(init$2(event.raw.touches[0].clientX)); + }), + run(touchmove(), function (_wrapper, simulatedEvent) { + var event = simulatedEvent.event; + spec$1.state.dialogSwipeState.on(function (state) { + simulatedEvent.event.prevent(); + spec$1.state.dialogSwipeState.set(move$1(state, event.raw.touches[0].clientX)); + }); + }), + run(touchend(), function (wrapper, _simulatedEvent) { + spec$1.state.dialogSwipeState.on(function (state) { + var dialog = memForm.get(wrapper); + var direction = -1 * complete(state); + navigate(dialog, direction); + }); + }) + ]) + ]) + }; }; var getGroups = cached(function (realm, editor) { - return [{ - label: 'the link group', - items: [sketch$6({ - fields: [ - field$2('url', 'Type or paste URL'), - field$2('text', 'Link text'), - field$2('title', 'Link title'), - field$2('target', 'Link target'), - hidden('link') - ], - maxFieldIndex: [ - 'url', - 'text', - 'title', - 'target' - ].length - 1, - getInitialValue: function () { - return Optional.some(getInfo(editor)); - }, - onExecute: function (dialog, _simulatedEvent) { - var info = Representing.getValue(dialog); - applyInfo(editor, info); - realm.restoreToolbar(); - editor.focus(); - } + return [{ + label: 'the link group', + items: [sketch$6({ + fields: [ + field$2('url', 'Type or paste URL'), + field$2('text', 'Link text'), + field$2('title', 'Link title'), + field$2('target', 'Link target'), + hidden('link') + ], + maxFieldIndex: [ + 'url', + 'text', + 'title', + 'target' + ].length - 1, + getInitialValue: function () { + return Optional.some(getInfo(editor)); + }, + onExecute: function (dialog, _simulatedEvent) { + var info = Representing.getValue(dialog); + applyInfo(editor, info); + realm.restoreToolbar(); + editor.focus(); + } })] }]; }); var sketch$7 = function (realm, editor) { - return forToolbarStateAction(editor, 'link', 'link', function () { - var groups = getGroups(realm, editor); - realm.setContextToolbar(groups); - forAndroid(editor, function () { - realm.focusToolbar(); - }); - query(editor).each(function (link) { - editor.selection.select(link.dom); - }); + return forToolbarStateAction(editor, 'link', 'link', function () { + var groups = getGroups(realm, editor); + realm.setContextToolbar(groups); + forAndroid(editor, function () { + realm.focusToolbar(); }); + query(editor).each(function (link) { + editor.selection.select(link.dom); + }); + }); }; var isRecursive = function (component, originator, target) { - return eq(originator, component.element) && !eq(originator, target); + return eq(originator, component.element) && !eq(originator, target); }; var events$8 = derive([can(focus(), function (component, simulatedEvent) { var event = simulatedEvent.event; var originator = event.originator; var target = event.target; if (isRecursive(component, originator, target)) { - console.warn(focus() + ' did not get interpreted by the desired target. ' + '\nOriginator: ' + element(originator) + '\nTarget: ' + element(target) + '\nCheck the ' + focus() + ' event handlers'); - return false; + console.warn(focus() + ' did not get interpreted by the desired target. ' + '\nOriginator: ' + element(originator) + '\nTarget: ' + element(target) + '\nCheck the ' + focus() + ' event handlers'); + return false; } else { - return true; + return true; } - })]); + })]); var DefaultEvents = /*#__PURE__*/Object.freeze({ __proto__: null, @@ -7580,878 +7558,878 @@ var make$1 = identity; var NoContextApi = function (getComp) { - var fail = function (event) { - return function () { - throw new Error('The component must be in a context to send: ' + event + (getComp ? '\n' + element(getComp().element) + ' is not in context.' : '')); - }; - }; - return { - debugInfo: constant('fake'), - triggerEvent: fail('triggerEvent'), - triggerFocus: fail('triggerFocus'), - triggerEscape: fail('triggerEscape'), - build: fail('build'), - addToWorld: fail('addToWorld'), - removeFromWorld: fail('removeFromWorld'), - addToGui: fail('addToGui'), - removeFromGui: fail('removeFromGui'), - getByUid: fail('getByUid'), - getByDom: fail('getByDom'), - broadcast: fail('broadcast'), - broadcastOn: fail('broadcastOn'), - broadcastEvent: fail('broadcastEvent'), - isConnected: never - }; + var fail = function (event) { + return function () { + throw new Error('The component must be in a context to send: ' + event + (getComp ? '\n' + element(getComp().element) + ' is not in context.' : '')); + }; + }; + return { + debugInfo: constant('fake'), + triggerEvent: fail('triggerEvent'), + triggerFocus: fail('triggerFocus'), + triggerEscape: fail('triggerEscape'), + build: fail('build'), + addToWorld: fail('addToWorld'), + removeFromWorld: fail('removeFromWorld'), + addToGui: fail('addToGui'), + removeFromGui: fail('removeFromGui'), + getByUid: fail('getByUid'), + getByDom: fail('getByDom'), + broadcast: fail('broadcast'), + broadcastOn: fail('broadcastOn'), + broadcastEvent: fail('broadcastEvent'), + isConnected: never + }; }; var singleton = NoContextApi(); var generateFrom = function (spec, all) { - var schema = map(all, function (a) { - return optionObjOf(a.name(), [ - strict$1('config'), - defaulted$1('state', NoState) - ]); - }); - var validated = asRaw('component.behaviours', objOf(schema), spec.behaviours).fold(function (errInfo) { - throw new Error(formatError(errInfo) + '\nComplete spec:\n' + JSON.stringify(spec, null, 2)); - }, function (v) { - return v; - }); - return { - list: all, - data: map$1(validated, function (optBlobThunk) { - var output = optBlobThunk.map(function (blob) { - return { - config: blob.config, - state: blob.state.init(blob.config) - }; - }); - return function () { - return output; - }; - }) - }; + var schema = map(all, function (a) { + return optionObjOf(a.name(), [ + strict$1('config'), + defaulted$1('state', NoState) + ]); + }); + var validated = asRaw('component.behaviours', objOf(schema), spec.behaviours).fold(function (errInfo) { + throw new Error(formatError(errInfo) + '\nComplete spec:\n' + JSON.stringify(spec, null, 2)); + }, function (v) { + return v; + }); + return { + list: all, + data: map$1(validated, function (optBlobThunk) { + var output = optBlobThunk.map(function (blob) { + return { + config: blob.config, + state: blob.state.init(blob.config) + }; + }); + return function () { + return output; + }; + }) + }; }; var getBehaviours = function (bData) { - return bData.list; + return bData.list; }; var getData = function (bData) { - return bData.data; + return bData.data; }; var byInnerKey = function (data, tuple) { - var r = {}; - each$1(data, function (detail, key) { - each$1(detail, function (value, indexKey) { - var chain = get$1(r, indexKey).getOr([]); - r[indexKey] = chain.concat([tuple(key, value)]); - }); + var r = {}; + each$1(data, function (detail, key) { + each$1(detail, function (value, indexKey) { + var chain = get$1(r, indexKey).getOr([]); + r[indexKey] = chain.concat([tuple(key, value)]); }); - return r; + }); + return r; }; var combine$1 = function (info, baseMod, behaviours, base) { - var modsByBehaviour = __assign({}, baseMod); - each(behaviours, function (behaviour) { - modsByBehaviour[behaviour.name()] = behaviour.exhibit(info, base); - }); - var byAspect = byInnerKey(modsByBehaviour, function (name, modification) { - return { - name: name, - modification: modification - }; - }); - var combineObjects = function (objects) { - return foldr(objects, function (b, a) { - return __assign(__assign({}, a.modification), b); - }, {}); + var modsByBehaviour = __assign({}, baseMod); + each(behaviours, function (behaviour) { + modsByBehaviour[behaviour.name()] = behaviour.exhibit(info, base); + }); + var byAspect = byInnerKey(modsByBehaviour, function (name, modification) { + return { + name: name, + modification: modification }; - var combinedClasses = foldr(byAspect.classes, function (b, a) { - return a.modification.concat(b); - }, []); - var combinedAttributes = combineObjects(byAspect.attributes); - var combinedStyles = combineObjects(byAspect.styles); - return nu$5({ - classes: combinedClasses, - attributes: combinedAttributes, - styles: combinedStyles - }); + }); + var combineObjects = function (objects) { + return foldr(objects, function (b, a) { + return __assign(__assign({}, a.modification), b); + }, {}); + }; + var combinedClasses = foldr(byAspect.classes, function (b, a) { + return a.modification.concat(b); + }, []); + var combinedAttributes = combineObjects(byAspect.attributes); + var combinedStyles = combineObjects(byAspect.styles); + return nu$5({ + classes: combinedClasses, + attributes: combinedAttributes, + styles: combinedStyles + }); }; var sortKeys = function (label, keyName, array, order) { - try { - var sorted = sort(array, function (a, b) { - var aKey = a[keyName]; - var bKey = b[keyName]; - var aIndex = order.indexOf(aKey); - var bIndex = order.indexOf(bKey); - if (aIndex === -1) { - throw new Error('The ordering for ' + label + ' does not have an entry for ' + aKey + '.\nOrder specified: ' + JSON.stringify(order, null, 2)); - } - if (bIndex === -1) { - throw new Error('The ordering for ' + label + ' does not have an entry for ' + bKey + '.\nOrder specified: ' + JSON.stringify(order, null, 2)); - } - if (aIndex < bIndex) { - return -1; - } else if (bIndex < aIndex) { - return 1; - } else { - return 0; - } - }); - return Result.value(sorted); - } catch (err) { - return Result.error([err]); - } + try { + var sorted = sort(array, function (a, b) { + var aKey = a[keyName]; + var bKey = b[keyName]; + var aIndex = order.indexOf(aKey); + var bIndex = order.indexOf(bKey); + if (aIndex === -1) { + throw new Error('The ordering for ' + label + ' does not have an entry for ' + aKey + '.\nOrder specified: ' + JSON.stringify(order, null, 2)); + } + if (bIndex === -1) { + throw new Error('The ordering for ' + label + ' does not have an entry for ' + bKey + '.\nOrder specified: ' + JSON.stringify(order, null, 2)); + } + if (aIndex < bIndex) { + return -1; + } else if (bIndex < aIndex) { + return 1; + } else { + return 0; + } + }); + return Result.value(sorted); + } catch (err) { + return Result.error([err]); + } }; var uncurried = function (handler, purpose) { - return { - handler: handler, - purpose: purpose - }; + return { + handler: handler, + purpose: purpose + }; }; var curried = function (handler, purpose) { - return { - cHandler: handler, - purpose: purpose - }; + return { + cHandler: handler, + purpose: purpose + }; }; var curryArgs = function (descHandler, extraArgs) { - return curried(curry.apply(undefined, [descHandler.handler].concat(extraArgs)), descHandler.purpose); + return curried(curry.apply(undefined, [descHandler.handler].concat(extraArgs)), descHandler.purpose); }; var getCurried = function (descHandler) { - return descHandler.cHandler; + return descHandler.cHandler; }; var behaviourTuple = function (name, handler) { - return { - name: name, - handler: handler - }; + return { + name: name, + handler: handler + }; }; var nameToHandlers = function (behaviours, info) { - var r = {}; - each(behaviours, function (behaviour) { - r[behaviour.name()] = behaviour.handlers(info); - }); - return r; + var r = {}; + each(behaviours, function (behaviour) { + r[behaviour.name()] = behaviour.handlers(info); + }); + return r; }; var groupByEvents = function (info, behaviours, base) { - var behaviourEvents = __assign(__assign({}, base), nameToHandlers(behaviours, info)); - return byInnerKey(behaviourEvents, behaviourTuple); + var behaviourEvents = __assign(__assign({}, base), nameToHandlers(behaviours, info)); + return byInnerKey(behaviourEvents, behaviourTuple); }; var combine$2 = function (info, eventOrder, behaviours, base) { - var byEventName = groupByEvents(info, behaviours, base); - return combineGroups(byEventName, eventOrder); + var byEventName = groupByEvents(info, behaviours, base); + return combineGroups(byEventName, eventOrder); }; var assemble = function (rawHandler) { - var handler = read$1(rawHandler); - return function (component, simulatedEvent) { - var rest = []; - for (var _i = 2; _i < arguments.length; _i++) { - rest[_i - 2] = arguments[_i]; - } - var args = [ - component, - simulatedEvent - ].concat(rest); - if (handler.abort.apply(undefined, args)) { - simulatedEvent.stop(); - } else if (handler.can.apply(undefined, args)) { - handler.run.apply(undefined, args); - } - }; + var handler = read$1(rawHandler); + return function (component, simulatedEvent) { + var rest = []; + for (var _i = 2; _i < arguments.length; _i++) { + rest[_i - 2] = arguments[_i]; + } + var args = [ + component, + simulatedEvent + ].concat(rest); + if (handler.abort.apply(undefined, args)) { + simulatedEvent.stop(); + } else if (handler.can.apply(undefined, args)) { + handler.run.apply(undefined, args); + } + }; }; var missingOrderError = function (eventName, tuples) { - return Result.error(['The event (' + eventName + ') has more than one behaviour that listens to it.\nWhen this occurs, you must ' + 'specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that ' + 'can trigger it are: ' + JSON.stringify(map(tuples, function (c) { - return c.name; + return Result.error(['The event (' + eventName + ') has more than one behaviour that listens to it.\nWhen this occurs, you must ' + 'specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that ' + 'can trigger it are: ' + JSON.stringify(map(tuples, function (c) { + return c.name; }), null, 2)]); }; var fuse$1 = function (tuples, eventOrder, eventName) { - var order = eventOrder[eventName]; - if (!order) { - return missingOrderError(eventName, tuples); - } else { - return sortKeys('Event: ' + eventName, 'name', tuples, order).map(function (sortedTuples) { - var handlers = map(sortedTuples, function (tuple) { - return tuple.handler; - }); - return fuse(handlers); - }); - } + var order = eventOrder[eventName]; + if (!order) { + return missingOrderError(eventName, tuples); + } else { + return sortKeys('Event: ' + eventName, 'name', tuples, order).map(function (sortedTuples) { + var handlers = map(sortedTuples, function (tuple) { + return tuple.handler; + }); + return fuse(handlers); + }); + } }; var combineGroups = function (byEventName, eventOrder) { - var r = mapToArray(byEventName, function (tuples, eventName) { - var combined = tuples.length === 1 ? Result.value(tuples[0].handler) : fuse$1(tuples, eventOrder, eventName); - return combined.map(function (handler) { - var assembled = assemble(handler); - var purpose = tuples.length > 1 ? filter(eventOrder[eventName], function (o) { - return exists(tuples, function (t) { - return t.name === o; - }); - }).join(' > ') : tuples[0].name; - return wrap$1(eventName, uncurried(assembled, purpose)); + var r = mapToArray(byEventName, function (tuples, eventName) { + var combined = tuples.length === 1 ? Result.value(tuples[0].handler) : fuse$1(tuples, eventOrder, eventName); + return combined.map(function (handler) { + var assembled = assemble(handler); + var purpose = tuples.length > 1 ? filter(eventOrder[eventName], function (o) { + return exists(tuples, function (t) { + return t.name === o; }); + }).join(' > ') : tuples[0].name; + return wrap$1(eventName, uncurried(assembled, purpose)); }); - return consolidate(r, {}); + }); + return consolidate(r, {}); }; var baseBehaviour = 'alloy.base.behaviour'; var toInfo = function (spec) { - var _a; - return asRaw('custom.definition', objOf([ - field('dom', 'dom', strict(), objOf([ - strict$1('tag'), - defaulted$1('styles', {}), - defaulted$1('classes', []), - defaulted$1('attributes', {}), - option('value'), - option('innerHtml') - ])), - strict$1('components'), - strict$1('uid'), - defaulted$1('events', {}), - defaulted$1('apis', {}), - field('eventOrder', 'eventOrder', mergeWith((_a = {}, _a[execute()] = [ - 'disabling', - baseBehaviour, - 'toggling', - 'typeaheadevents' - ], _a[focus()] = [ - baseBehaviour, - 'focusing', - 'keying' - ], _a[systemInit()] = [ - baseBehaviour, - 'disabling', - 'toggling', - 'representing' - ], _a[input()] = [ - baseBehaviour, - 'representing', - 'streaming', - 'invalidating' - ], _a[detachedFromDom()] = [ - baseBehaviour, - 'representing', - 'item-events', - 'tooltipping' - ], _a[mousedown()] = [ - 'focusing', - baseBehaviour, - 'item-type-events' - ], _a[touchstart()] = [ - 'focusing', - baseBehaviour, - 'item-type-events' - ], _a[mouseover()] = [ - 'item-type-events', - 'tooltipping' - ], _a[receive()] = [ - 'receiving', - 'reflecting', - 'tooltipping' - ], _a)), anyValue$1()), - option('domModification') - ]), spec); + var _a; + return asRaw('custom.definition', objOf([ + field('dom', 'dom', strict(), objOf([ + strict$1('tag'), + defaulted$1('styles', {}), + defaulted$1('classes', []), + defaulted$1('attributes', {}), + option('value'), + option('innerHtml') + ])), + strict$1('components'), + strict$1('uid'), + defaulted$1('events', {}), + defaulted$1('apis', {}), + field('eventOrder', 'eventOrder', mergeWith((_a = {}, _a[execute()] = [ + 'disabling', + baseBehaviour, + 'toggling', + 'typeaheadevents' + ], _a[focus()] = [ + baseBehaviour, + 'focusing', + 'keying' + ], _a[systemInit()] = [ + baseBehaviour, + 'disabling', + 'toggling', + 'representing' + ], _a[input()] = [ + baseBehaviour, + 'representing', + 'streaming', + 'invalidating' + ], _a[detachedFromDom()] = [ + baseBehaviour, + 'representing', + 'item-events', + 'tooltipping' + ], _a[mousedown()] = [ + 'focusing', + baseBehaviour, + 'item-type-events' + ], _a[touchstart()] = [ + 'focusing', + baseBehaviour, + 'item-type-events' + ], _a[mouseover()] = [ + 'item-type-events', + 'tooltipping' + ], _a[receive()] = [ + 'receiving', + 'reflecting', + 'tooltipping' + ], _a)), anyValue$1()), + option('domModification') + ]), spec); }; var toDefinition = function (detail) { - return __assign(__assign({}, detail.dom), { - uid: detail.uid, - domChildren: map(detail.components, function (comp) { - return comp.element; - }) - }); + return __assign(__assign({}, detail.dom), { + uid: detail.uid, + domChildren: map(detail.components, function (comp) { + return comp.element; + }) + }); }; var toModification = function (detail) { - return detail.domModification.fold(function () { - return nu$5({}); - }, nu$5); + return detail.domModification.fold(function () { + return nu$5({}); + }, nu$5); }; var toEvents = function (info) { - return info.events; + return info.events; }; var add$3 = function (element, classes) { - each(classes, function (x) { - add$2(element, x); - }); + each(classes, function (x) { + add$2(element, x); + }); }; var remove$6 = function (element, classes) { - each(classes, function (x) { - remove$4(element, x); - }); + each(classes, function (x) { + remove$4(element, x); + }); }; var renderToDom = function (definition) { - var subject = SugarElement.fromTag(definition.tag); - setAll(subject, definition.attributes); - add$3(subject, definition.classes); - setAll$1(subject, definition.styles); - definition.innerHtml.each(function (html) { - return set$1(subject, html); - }); - var children = definition.domChildren; - append$1(subject, children); - definition.value.each(function (value) { - set$6(subject, value); - }); - if (!definition.uid) { - debugger; - } - writeOnly(subject, definition.uid); - return subject; + var subject = SugarElement.fromTag(definition.tag); + setAll(subject, definition.attributes); + add$3(subject, definition.classes); + setAll$1(subject, definition.styles); + definition.innerHtml.each(function (html) { + return set$1(subject, html); + }); + var children = definition.domChildren; + append$1(subject, children); + definition.value.each(function (value) { + set$6(subject, value); + }); + if (!definition.uid) { + debugger; + } + writeOnly(subject, definition.uid); + return subject; }; var getBehaviours$1 = function (spec) { - var behaviours = get$1(spec, 'behaviours').getOr({}); - var keys$1 = filter(keys(behaviours), function (k) { - return behaviours[k] !== undefined; - }); - return map(keys$1, function (k) { - return behaviours[k].me; - }); + var behaviours = get$1(spec, 'behaviours').getOr({}); + var keys$1 = filter(keys(behaviours), function (k) { + return behaviours[k] !== undefined; + }); + return map(keys$1, function (k) { + return behaviours[k].me; + }); }; var generateFrom$1 = function (spec, all) { - return generateFrom(spec, all); + return generateFrom(spec, all); }; var generate$4 = function (spec) { - var all = getBehaviours$1(spec); - return generateFrom$1(spec, all); + var all = getBehaviours$1(spec); + return generateFrom$1(spec, all); }; var getDomDefinition = function (info, bList, bData) { - var definition = toDefinition(info); - var infoModification = toModification(info); - var baseModification = {'alloy.base.modification': infoModification}; - var modification = bList.length > 0 ? combine$1(bData, baseModification, bList, definition) : infoModification; - return merge$1(definition, modification); + var definition = toDefinition(info); + var infoModification = toModification(info); + var baseModification = { 'alloy.base.modification': infoModification }; + var modification = bList.length > 0 ? combine$1(bData, baseModification, bList, definition) : infoModification; + return merge$1(definition, modification); }; var getEvents = function (info, bList, bData) { - var baseEvents = {'alloy.base.behaviour': toEvents(info)}; - return combine$2(bData, info.eventOrder, bList, baseEvents).getOrDie(); + var baseEvents = { 'alloy.base.behaviour': toEvents(info) }; + return combine$2(bData, info.eventOrder, bList, baseEvents).getOrDie(); }; var build = function (spec) { - var getMe = function () { - return me; - }; - var systemApi = Cell(singleton); - var info = getOrDie(toInfo(spec)); - var bBlob = generate$4(spec); - var bList = getBehaviours(bBlob); - var bData = getData(bBlob); - var modDefinition = getDomDefinition(info, bList, bData); - var item = renderToDom(modDefinition); - var events = getEvents(info, bList, bData); - var subcomponents = Cell(info.components); - var connect = function (newApi) { - systemApi.set(newApi); - }; - var disconnect = function () { - systemApi.set(NoContextApi(getMe)); - }; - var syncComponents = function () { - var children$1 = children(item); - var subs = bind(children$1, function (child) { - return systemApi.get().getByDom(child).fold(function () { - return []; - }, function (c) { - return [c]; - }); - }); - subcomponents.set(subs); - }; - var config = function (behaviour) { - var b = bData; - var f = isFunction(b[behaviour.name()]) ? b[behaviour.name()] : function () { - throw new Error('Could not find ' + behaviour.name() + ' in ' + JSON.stringify(spec, null, 2)); - }; - return f(); - }; - var hasConfigured = function (behaviour) { - return isFunction(bData[behaviour.name()]); - }; - var getApis = function () { - return info.apis; - }; - var readState = function (behaviourName) { - return bData[behaviourName]().map(function (b) { - return b.state.readState(); - }).getOr('not enabled'); - }; - var me = { - getSystem: systemApi.get, - config: config, - hasConfigured: hasConfigured, - spec: spec, - readState: readState, - getApis: getApis, - connect: connect, - disconnect: disconnect, - element: item, - syncComponents: syncComponents, - components: subcomponents.get, - events: events - }; + var getMe = function () { return me; + }; + var systemApi = Cell(singleton); + var info = getOrDie(toInfo(spec)); + var bBlob = generate$4(spec); + var bList = getBehaviours(bBlob); + var bData = getData(bBlob); + var modDefinition = getDomDefinition(info, bList, bData); + var item = renderToDom(modDefinition); + var events = getEvents(info, bList, bData); + var subcomponents = Cell(info.components); + var connect = function (newApi) { + systemApi.set(newApi); + }; + var disconnect = function () { + systemApi.set(NoContextApi(getMe)); + }; + var syncComponents = function () { + var children$1 = children(item); + var subs = bind(children$1, function (child) { + return systemApi.get().getByDom(child).fold(function () { + return []; + }, function (c) { + return [c]; + }); + }); + subcomponents.set(subs); + }; + var config = function (behaviour) { + var b = bData; + var f = isFunction(b[behaviour.name()]) ? b[behaviour.name()] : function () { + throw new Error('Could not find ' + behaviour.name() + ' in ' + JSON.stringify(spec, null, 2)); + }; + return f(); + }; + var hasConfigured = function (behaviour) { + return isFunction(bData[behaviour.name()]); + }; + var getApis = function () { + return info.apis; + }; + var readState = function (behaviourName) { + return bData[behaviourName]().map(function (b) { + return b.state.readState(); + }).getOr('not enabled'); + }; + var me = { + getSystem: systemApi.get, + config: config, + hasConfigured: hasConfigured, + spec: spec, + readState: readState, + getApis: getApis, + connect: connect, + disconnect: disconnect, + element: item, + syncComponents: syncComponents, + components: subcomponents.get, + events: events + }; + return me; }; var buildSubcomponents = function (spec) { - var components = get$1(spec, 'components').getOr([]); - return map(components, build$1); + var components = get$1(spec, 'components').getOr([]); + return map(components, build$1); }; var buildFromSpec = function (userSpec) { - var _a = make$1(userSpec), specEvents = _a.events, spec = __rest(_a, ['events']); - var components = buildSubcomponents(spec); - var completeSpec = __assign(__assign({}, spec), { - events: __assign(__assign({}, DefaultEvents), specEvents), - components: components - }); - return Result.value(build(completeSpec)); + var _a = make$1(userSpec), specEvents = _a.events, spec = __rest(_a, ['events']); + var components = buildSubcomponents(spec); + var completeSpec = __assign(__assign({}, spec), { + events: __assign(__assign({}, DefaultEvents), specEvents), + components: components + }); + return Result.value(build(completeSpec)); }; var text = function (textContent) { - var element = SugarElement.fromText(textContent); - return external$1({element: element}); + var element = SugarElement.fromText(textContent); + return external$1({ element: element }); }; var external$1 = function (spec) { - var extSpec = asRawOrDie('external.component', objOfOnly([ - strict$1('element'), - option('uid') - ]), spec); - var systemApi = Cell(NoContextApi()); - var connect = function (newApi) { - systemApi.set(newApi); - }; - var disconnect = function () { - systemApi.set(NoContextApi(function () { - return me; - })); - }; - extSpec.uid.each(function (uid) { - writeOnly(extSpec.element, uid); - }); - var me = { - getSystem: systemApi.get, - config: Optional.none, - hasConfigured: never, - connect: connect, - disconnect: disconnect, - getApis: function () { - return {}; - }, - element: extSpec.element, - spec: spec, - readState: constant('No state'), - syncComponents: noop, - components: constant([]), - events: {} - }; - return premade(me); + var extSpec = asRawOrDie('external.component', objOfOnly([ + strict$1('element'), + option('uid') + ]), spec); + var systemApi = Cell(NoContextApi()); + var connect = function (newApi) { + systemApi.set(newApi); + }; + var disconnect = function () { + systemApi.set(NoContextApi(function () { + return me; + })); + }; + extSpec.uid.each(function (uid) { + writeOnly(extSpec.element, uid); + }); + var me = { + getSystem: systemApi.get, + config: Optional.none, + hasConfigured: never, + connect: connect, + disconnect: disconnect, + getApis: function () { + return {}; + }, + element: extSpec.element, + spec: spec, + readState: constant('No state'), + syncComponents: noop, + components: constant([]), + events: {} + }; + return premade(me); }; var uids = generate$3; var build$1 = function (spec) { - return getPremade(spec).fold(function () { - var userSpecWithUid = spec.hasOwnProperty('uid') ? spec : __assign({uid: uids('')}, spec); - return buildFromSpec(userSpecWithUid).getOrDie(); - }, function (prebuilt) { - return prebuilt; - }); + return getPremade(spec).fold(function () { + var userSpecWithUid = spec.hasOwnProperty('uid') ? spec : __assign({ uid: uids('') }, spec); + return buildFromSpec(userSpecWithUid).getOrDie(); + }, function (prebuilt) { + return prebuilt; + }); }; var premade$1 = premade; var hoverEvent = 'alloy.item-hover'; var focusEvent = 'alloy.item-focus'; var onHover = function (item) { - if (search(item.element).isNone() || Focusing.isFocused(item)) { - if (!Focusing.isFocused(item)) { - Focusing.focus(item); - } - emitWith(item, hoverEvent, {item: item}); + if (search(item.element).isNone() || Focusing.isFocused(item)) { + if (!Focusing.isFocused(item)) { + Focusing.focus(item); } + emitWith(item, hoverEvent, { item: item }); + } }; var onFocus = function (item) { - emitWith(item, focusEvent, {item: item}); + emitWith(item, focusEvent, { item: item }); }; var hover = constant(hoverEvent); var focus$3 = constant(focusEvent); var builder = function (detail) { - return { - dom: detail.dom, - domModification: __assign(__assign({}, detail.domModification), {attributes: __assign(__assign(__assign({'role': detail.toggling.isSome() ? 'menuitemcheckbox' : 'menuitem'}, detail.domModification.attributes), {'aria-haspopup': detail.hasSubmenu}), detail.hasSubmenu ? {'aria-expanded': false} : {})}), - behaviours: SketchBehaviours.augment(detail.itemBehaviours, [ - detail.toggling.fold(Toggling.revoke, function (tConfig) { - return Toggling.config(__assign({aria: {mode: 'checked'}}, tConfig)); - }), - Focusing.config({ - ignore: detail.ignoreFocus, - stopMousedown: detail.ignoreFocus, - onFocus: function (component) { - onFocus(component); - } - }), - Keying.config({mode: 'execution'}), - Representing.config({ - store: { - mode: 'memory', - initialValue: detail.data - } - }), - config('item-type-events', __spreadArrays(pointerEvents(), [ - run(mouseover(), onHover), - run(focusItem(), Focusing.focus) - ])) - ]), - components: detail.components, - eventOrder: detail.eventOrder - }; + return { + dom: detail.dom, + domModification: __assign(__assign({}, detail.domModification), { attributes: __assign(__assign(__assign({ 'role': detail.toggling.isSome() ? 'menuitemcheckbox' : 'menuitem' }, detail.domModification.attributes), { 'aria-haspopup': detail.hasSubmenu }), detail.hasSubmenu ? { 'aria-expanded': false } : {}) }), + behaviours: SketchBehaviours.augment(detail.itemBehaviours, [ + detail.toggling.fold(Toggling.revoke, function (tConfig) { + return Toggling.config(__assign({ aria: { mode: 'checked' } }, tConfig)); + }), + Focusing.config({ + ignore: detail.ignoreFocus, + stopMousedown: detail.ignoreFocus, + onFocus: function (component) { + onFocus(component); + } + }), + Keying.config({ mode: 'execution' }), + Representing.config({ + store: { + mode: 'memory', + initialValue: detail.data + } + }), + config('item-type-events', __spreadArrays(pointerEvents(), [ + run(mouseover(), onHover), + run(focusItem(), Focusing.focus) + ])) + ]), + components: detail.components, + eventOrder: detail.eventOrder + }; }; var schema$a = [ - strict$1('data'), - strict$1('components'), - strict$1('dom'), - defaulted$1('hasSubmenu', false), - option('toggling'), - SketchBehaviours.field('itemBehaviours', [ - Toggling, - Focusing, - Keying, - Representing - ]), - defaulted$1('ignoreFocus', false), - defaulted$1('domModification', {}), - output('builder', builder), - defaulted$1('eventOrder', {}) + strict$1('data'), + strict$1('components'), + strict$1('dom'), + defaulted$1('hasSubmenu', false), + option('toggling'), + SketchBehaviours.field('itemBehaviours', [ + Toggling, + Focusing, + Keying, + Representing + ]), + defaulted$1('ignoreFocus', false), + defaulted$1('domModification', {}), + output('builder', builder), + defaulted$1('eventOrder', {}) ]; var builder$1 = function (detail) { - return { - dom: detail.dom, - components: detail.components, - events: derive([stopper(focusItem())]) - }; + return { + dom: detail.dom, + components: detail.components, + events: derive([stopper(focusItem())]) + }; }; var schema$b = [ - strict$1('dom'), - strict$1('components'), - output('builder', builder$1) + strict$1('dom'), + strict$1('components'), + output('builder', builder$1) ]; var owner$2 = function () { - return 'item-widget'; + return 'item-widget'; }; var parts = constant([required({ name: 'widget', overrides: function (detail) { - return { - behaviours: derive$1([Representing.config({ - store: { - mode: 'manual', - getValue: function (_component) { - return detail.data; - }, - setValue: function () { - } - } - })]) - }; + return { + behaviours: derive$1([Representing.config({ + store: { + mode: 'manual', + getValue: function (_component) { + return detail.data; + }, + setValue: function () { + } + } + })]) + }; } - })]); + })]); var builder$2 = function (detail) { - var subs = substitutes(owner$2(), detail, parts()); - var components$1 = components(owner$2(), detail, subs.internals()); - var focusWidget = function (component) { - return getPart(component, detail, 'widget').map(function (widget) { - Keying.focusIn(widget); - return widget; - }); - }; - var onHorizontalArrow = function (component, simulatedEvent) { - return inside(simulatedEvent.event.target) ? Optional.none() : function () { - if (detail.autofocus) { - simulatedEvent.setSource(component.element); - return Optional.none(); - } else { - return Optional.none(); - } - }(); - }; - return { - dom: detail.dom, - components: components$1, - domModification: detail.domModification, - events: derive([ - runOnExecute(function (component, simulatedEvent) { - focusWidget(component).each(function (_widget) { - simulatedEvent.stop(); - }); - }), - run(mouseover(), onHover), - run(focusItem(), function (component, _simulatedEvent) { - if (detail.autofocus) { - focusWidget(component); - } else { - Focusing.focus(component); - } - }) - ]), - behaviours: SketchBehaviours.augment(detail.widgetBehaviours, [ - Representing.config({ - store: { - mode: 'memory', - initialValue: detail.data - } - }), - Focusing.config({ - ignore: detail.ignoreFocus, - onFocus: function (component) { - onFocus(component); - } - }), - Keying.config({ - mode: 'special', - focusIn: detail.autofocus ? function (component) { - focusWidget(component); - } : revoke(), - onLeft: onHorizontalArrow, - onRight: onHorizontalArrow, - onEscape: function (component, simulatedEvent) { - if (!Focusing.isFocused(component) && !detail.autofocus) { - Focusing.focus(component); - return Optional.some(true); - } else if (detail.autofocus) { - simulatedEvent.setSource(component.element); - return Optional.none(); - } else { - return Optional.none(); - } - } - }) - ]) - }; + var subs = substitutes(owner$2(), detail, parts()); + var components$1 = components(owner$2(), detail, subs.internals()); + var focusWidget = function (component) { + return getPart(component, detail, 'widget').map(function (widget) { + Keying.focusIn(widget); + return widget; + }); + }; + var onHorizontalArrow = function (component, simulatedEvent) { + return inside(simulatedEvent.event.target) ? Optional.none() : function () { + if (detail.autofocus) { + simulatedEvent.setSource(component.element); + return Optional.none(); + } else { + return Optional.none(); + } + }(); + }; + return { + dom: detail.dom, + components: components$1, + domModification: detail.domModification, + events: derive([ + runOnExecute(function (component, simulatedEvent) { + focusWidget(component).each(function (_widget) { + simulatedEvent.stop(); + }); + }), + run(mouseover(), onHover), + run(focusItem(), function (component, _simulatedEvent) { + if (detail.autofocus) { + focusWidget(component); + } else { + Focusing.focus(component); + } + }) + ]), + behaviours: SketchBehaviours.augment(detail.widgetBehaviours, [ + Representing.config({ + store: { + mode: 'memory', + initialValue: detail.data + } + }), + Focusing.config({ + ignore: detail.ignoreFocus, + onFocus: function (component) { + onFocus(component); + } + }), + Keying.config({ + mode: 'special', + focusIn: detail.autofocus ? function (component) { + focusWidget(component); + } : revoke(), + onLeft: onHorizontalArrow, + onRight: onHorizontalArrow, + onEscape: function (component, simulatedEvent) { + if (!Focusing.isFocused(component) && !detail.autofocus) { + Focusing.focus(component); + return Optional.some(true); + } else if (detail.autofocus) { + simulatedEvent.setSource(component.element); + return Optional.none(); + } else { + return Optional.none(); + } + } + }) + ]) + }; }; var schema$c = [ - strict$1('uid'), - strict$1('data'), - strict$1('components'), - strict$1('dom'), - defaulted$1('autofocus', false), - defaulted$1('ignoreFocus', false), - SketchBehaviours.field('widgetBehaviours', [ - Representing, - Focusing, - Keying - ]), - defaulted$1('domModification', {}), - defaultUidsSchema(parts()), - output('builder', builder$2) + strict$1('uid'), + strict$1('data'), + strict$1('components'), + strict$1('dom'), + defaulted$1('autofocus', false), + defaulted$1('ignoreFocus', false), + SketchBehaviours.field('widgetBehaviours', [ + Representing, + Focusing, + Keying + ]), + defaulted$1('domModification', {}), + defaultUidsSchema(parts()), + output('builder', builder$2) ]; var itemSchema$1 = choose$1('type', { - widget: schema$c, - item: schema$a, - separator: schema$b + widget: schema$c, + item: schema$a, + separator: schema$b }); var configureGrid = function (detail, movementInfo) { - return { - mode: 'flatgrid', - selector: '.' + detail.markers.item, - initSize: { - numColumns: movementInfo.initSize.numColumns, - numRows: movementInfo.initSize.numRows - }, - focusManager: detail.focusManager - }; + return { + mode: 'flatgrid', + selector: '.' + detail.markers.item, + initSize: { + numColumns: movementInfo.initSize.numColumns, + numRows: movementInfo.initSize.numRows + }, + focusManager: detail.focusManager + }; }; var configureMatrix = function (detail, movementInfo) { - return { - mode: 'matrix', - selectors: { - row: movementInfo.rowSelector, - cell: '.' + detail.markers.item - }, - focusManager: detail.focusManager - }; + return { + mode: 'matrix', + selectors: { + row: movementInfo.rowSelector, + cell: '.' + detail.markers.item + }, + focusManager: detail.focusManager + }; }; var configureMenu = function (detail, movementInfo) { - return { - mode: 'menu', - selector: '.' + detail.markers.item, - moveOnTab: movementInfo.moveOnTab, - focusManager: detail.focusManager - }; + return { + mode: 'menu', + selector: '.' + detail.markers.item, + moveOnTab: movementInfo.moveOnTab, + focusManager: detail.focusManager + }; }; var parts$1 = constant([group({ factory: { - sketch: function (spec) { - var itemInfo = asRawOrDie('menu.spec item', itemSchema$1, spec); - return itemInfo.builder(itemInfo); - } + sketch: function (spec) { + var itemInfo = asRawOrDie('menu.spec item', itemSchema$1, spec); + return itemInfo.builder(itemInfo); + } }, name: 'items', unit: 'item', defaults: function (detail, u) { - return u.hasOwnProperty('uid') ? u : __assign(__assign({}, u), {uid: generate$3('item')}); + return u.hasOwnProperty('uid') ? u : __assign(__assign({}, u), { uid: generate$3('item') }); }, overrides: function (detail, u) { - return { - type: u.type, - ignoreFocus: detail.fakeFocus, - domModification: {classes: [detail.markers.item]} - }; + return { + type: u.type, + ignoreFocus: detail.fakeFocus, + domModification: { classes: [detail.markers.item] } + }; } - })]); + })]); var schema$d = constant([ - strict$1('value'), - strict$1('items'), - strict$1('dom'), - strict$1('components'), - defaulted$1('eventOrder', {}), - field$1('menuBehaviours', [ - Highlighting, - Representing, - Composing, - Keying - ]), - defaultedOf('movement', { - mode: 'menu', - moveOnTab: true - }, choose$1('mode', { - grid: [ - initSize(), - output('config', configureGrid) - ], - matrix: [ - output('config', configureMatrix), - strict$1('rowSelector') - ], - menu: [ - defaulted$1('moveOnTab', true), - output('config', configureMenu) - ] - })), - itemMarkers(), - defaulted$1('fakeFocus', false), - defaulted$1('focusManager', dom()), - onHandler('onHighlight') + strict$1('value'), + strict$1('items'), + strict$1('dom'), + strict$1('components'), + defaulted$1('eventOrder', {}), + field$1('menuBehaviours', [ + Highlighting, + Representing, + Composing, + Keying + ]), + defaultedOf('movement', { + mode: 'menu', + moveOnTab: true + }, choose$1('mode', { + grid: [ + initSize(), + output('config', configureGrid) + ], + matrix: [ + output('config', configureMatrix), + strict$1('rowSelector') + ], + menu: [ + defaulted$1('moveOnTab', true), + output('config', configureMenu) + ] + })), + itemMarkers(), + defaulted$1('fakeFocus', false), + defaulted$1('focusManager', dom()), + onHandler('onHighlight') ]); var focus$4 = constant('alloy.menu-focus'); var make$2 = function (detail, components, _spec, _externals) { - return { - uid: detail.uid, - dom: detail.dom, - markers: detail.markers, - behaviours: augment(detail.menuBehaviours, [ - Highlighting.config({ - highlightClass: detail.markers.selectedItem, - itemClass: detail.markers.item, - onHighlight: detail.onHighlight - }), - Representing.config({ - store: { - mode: 'memory', - initialValue: detail.value - } - }), - Composing.config({find: Optional.some}), - Keying.config(detail.movement.config(detail, detail.movement)) - ]), - events: derive([ - run(focus$3(), function (menu, simulatedEvent) { - var event = simulatedEvent.event; - menu.getSystem().getByDom(event.target).each(function (item) { - Highlighting.highlight(menu, item); - simulatedEvent.stop(); - emitWith(menu, focus$4(), { - menu: menu, - item: item - }); - }); - }), - run(hover(), function (menu, simulatedEvent) { - var item = simulatedEvent.event.item; - Highlighting.highlight(menu, item); - }) - ]), - components: components, - eventOrder: detail.eventOrder, - domModification: {attributes: {role: 'menu'}} - }; + return { + uid: detail.uid, + dom: detail.dom, + markers: detail.markers, + behaviours: augment(detail.menuBehaviours, [ + Highlighting.config({ + highlightClass: detail.markers.selectedItem, + itemClass: detail.markers.item, + onHighlight: detail.onHighlight + }), + Representing.config({ + store: { + mode: 'memory', + initialValue: detail.value + } + }), + Composing.config({ find: Optional.some }), + Keying.config(detail.movement.config(detail, detail.movement)) + ]), + events: derive([ + run(focus$3(), function (menu, simulatedEvent) { + var event = simulatedEvent.event; + menu.getSystem().getByDom(event.target).each(function (item) { + Highlighting.highlight(menu, item); + simulatedEvent.stop(); + emitWith(menu, focus$4(), { + menu: menu, + item: item + }); + }); + }), + run(hover(), function (menu, simulatedEvent) { + var item = simulatedEvent.event.item; + Highlighting.highlight(menu, item); + }) + ]), + components: components, + eventOrder: detail.eventOrder, + domModification: { attributes: { role: 'menu' } } + }; }; var Menu = composite$1({ - name: 'Menu', - configFields: schema$d(), - partFields: parts$1(), - factory: make$2 + name: 'Menu', + configFields: schema$d(), + partFields: parts$1(), + factory: make$2 }); var preserve$1 = function (f, container) { - var dos = getRootNode(container); - var refocus = active(dos).bind(function (focused) { - var hasFocus = function (elem) { - return eq(focused, elem); - }; - return hasFocus(container) ? Optional.some(container) : descendant(container, hasFocus); - }); - var result = f(container); - refocus.each(function (oldFocus) { - active(dos).filter(function (newFocus) { - return eq(newFocus, oldFocus); - }).fold(function () { - focus$1(oldFocus); - }, noop); - }); - return result; + var dos = getRootNode(container); + var refocus = active(dos).bind(function (focused) { + var hasFocus = function (elem) { + return eq(focused, elem); + }; + return hasFocus(container) ? Optional.some(container) : descendant(container, hasFocus); + }); + var result = f(container); + refocus.each(function (oldFocus) { + active(dos).filter(function (newFocus) { + return eq(newFocus, oldFocus); + }).fold(function () { + focus$1(oldFocus); + }, noop); + }); + return result; }; var set$8 = function (component, replaceConfig, replaceState, data) { - preserve$1(function () { - var newChildren = map(data, component.getSystem().build); - replaceChildren(component, newChildren); - }, component.element); + preserve$1(function () { + var newChildren = map(data, component.getSystem().build); + replaceChildren(component, newChildren); + }, component.element); }; var insert = function (component, replaceConfig, insertion, childSpec) { - var child = component.getSystem().build(childSpec); - attachWith(component, child, insertion); + var child = component.getSystem().build(childSpec); + attachWith(component, child, insertion); }; var append$2 = function (component, replaceConfig, replaceState, appendee) { - insert(component, replaceConfig, append, appendee); + insert(component, replaceConfig, append, appendee); }; var prepend$1 = function (component, replaceConfig, replaceState, prependee) { - insert(component, replaceConfig, prepend, prependee); + insert(component, replaceConfig, prepend, prependee); }; var remove$7 = function (component, replaceConfig, replaceState, removee) { - var children = contents(component); - var foundChild = find(children, function (child) { - return eq(removee.element, child.element); - }); - foundChild.each(detach); + var children = contents(component); + var foundChild = find(children, function (child) { + return eq(removee.element, child.element); + }); + foundChild.each(detach); }; var contents = function (component, _replaceConfig) { - return component.components(); + return component.components(); }; var replaceAt = function (component, replaceConfig, replaceState, replaceeIndex, replacer) { - var children = contents(component); - return Optional.from(children[replaceeIndex]).map(function (replacee) { - remove$7(component, replaceConfig, replaceState, replacee); - replacer.each(function (r) { - insert(component, replaceConfig, function (p, c) { - appendAt(p, c, replaceeIndex); - }, r); - }); - return replacee; + var children = contents(component); + return Optional.from(children[replaceeIndex]).map(function (replacee) { + remove$7(component, replaceConfig, replaceState, replacee); + replacer.each(function (r) { + insert(component, replaceConfig, function (p, c) { + appendAt(p, c, replaceeIndex); + }, r); }); + return replacee; + }); }; var replaceBy = function (component, replaceConfig, replaceState, replaceePred, replacer) { - var children = contents(component); - return findIndex(children, replaceePred).bind(function (replaceeIndex) { - return replaceAt(component, replaceConfig, replaceState, replaceeIndex, replacer); - }); + var children = contents(component); + return findIndex(children, replaceePred).bind(function (replaceeIndex) { + return replaceAt(component, replaceConfig, replaceState, replaceeIndex, replacer); + }); }; var ReplaceApis = /*#__PURE__*/Object.freeze({ @@ -8466,628 +8444,628 @@ }); var Replacing = create$1({ - fields: [], - name: 'replacing', - apis: ReplaceApis + fields: [], + name: 'replacing', + apis: ReplaceApis }); var transpose = function (obj) { - return tupleMap(obj, function (v, k) { - return { - k: v, - v: k - }; - }); + return tupleMap(obj, function (v, k) { + return { + k: v, + v: k + }; + }); }; var trace = function (items, byItem, byMenu, finish) { - return get$1(byMenu, finish).bind(function (triggerItem) { - return get$1(items, triggerItem).bind(function (triggerMenu) { - var rest = trace(items, byItem, byMenu, triggerMenu); - return Optional.some([triggerMenu].concat(rest)); - }); - }).getOr([]); + return get$1(byMenu, finish).bind(function (triggerItem) { + return get$1(items, triggerItem).bind(function (triggerMenu) { + var rest = trace(items, byItem, byMenu, triggerMenu); + return Optional.some([triggerMenu].concat(rest)); + }); + }).getOr([]); }; var generate$5 = function (menus, expansions) { - var items = {}; - each$1(menus, function (menuItems, menu) { - each(menuItems, function (item) { - items[item] = menu; - }); - }); - var byItem = expansions; - var byMenu = transpose(expansions); - var menuPaths = map$1(byMenu, function (_triggerItem, submenu) { - return [submenu].concat(trace(items, byItem, byMenu, submenu)); - }); - return map$1(items, function (menu) { - return get$1(menuPaths, menu).getOr([menu]); - }); + var items = {}; + each$1(menus, function (menuItems, menu) { + each(menuItems, function (item) { + items[item] = menu; + }); + }); + var byItem = expansions; + var byMenu = transpose(expansions); + var menuPaths = map$1(byMenu, function (_triggerItem, submenu) { + return [submenu].concat(trace(items, byItem, byMenu, submenu)); + }); + return map$1(items, function (menu) { + return get$1(menuPaths, menu).getOr([menu]); + }); }; var init$3 = function () { - var expansions = Cell({}); - var menus = Cell({}); - var paths = Cell({}); - var primary = Cell(Optional.none()); - var directory = Cell({}); - var clear = function () { - expansions.set({}); - menus.set({}); - paths.set({}); - primary.set(Optional.none()); - }; - var isClear = function () { - return primary.get().isNone(); - }; - var setMenuBuilt = function (menuName, built) { - var _a; - menus.set(__assign(__assign({}, menus.get()), (_a = {}, _a[menuName] = { - type: 'prepared', - menu: built - }, _a))); - }; - var setContents = function (sPrimary, sMenus, sExpansions, dir) { - primary.set(Optional.some(sPrimary)); - expansions.set(sExpansions); - menus.set(sMenus); - directory.set(dir); - var sPaths = generate$5(dir, sExpansions); - paths.set(sPaths); - }; - var getTriggeringItem = function (menuValue) { - return find$2(expansions.get(), function (v, _k) { - return v === menuValue; - }); - }; - var getTriggerData = function (menuValue, getItemByValue, path) { - return getPreparedMenu(menuValue).bind(function (menu) { - return getTriggeringItem(menuValue).bind(function (triggeringItemValue) { - return getItemByValue(triggeringItemValue).map(function (triggeredItem) { - return { - triggeredMenu: menu, - triggeringItem: triggeredItem, - triggeringPath: path - }; - }); - }); - }); - }; - var getTriggeringPath = function (itemValue, getItemByValue) { - var extraPath = filter(lookupItem(itemValue).toArray(), function (menuValue) { - return getPreparedMenu(menuValue).isSome(); - }); - return get$1(paths.get(), itemValue).bind(function (path) { - var revPath = reverse(extraPath.concat(path)); - var triggers = bind(revPath, function (menuValue, menuIndex) { - return getTriggerData(menuValue, getItemByValue, revPath.slice(0, menuIndex + 1)).fold(function () { - return primary.get().is(menuValue) ? [] : [Optional.none()]; - }, function (data) { - return [Optional.some(data)]; - }); - }); - return sequence(triggers); - }); - }; - var expand = function (itemValue) { - return get$1(expansions.get(), itemValue).map(function (menu) { - var current = get$1(paths.get(), itemValue).getOr([]); - return [menu].concat(current); - }); - }; - var collapse = function (itemValue) { - return get$1(paths.get(), itemValue).bind(function (path) { - return path.length > 1 ? Optional.some(path.slice(1)) : Optional.none(); - }); - }; - var refresh = function (itemValue) { - return get$1(paths.get(), itemValue); - }; - var getPreparedMenu = function (menuValue) { - return lookupMenu(menuValue).bind(extractPreparedMenu); - }; - var lookupMenu = function (menuValue) { - return get$1(menus.get(), menuValue); - }; - var lookupItem = function (itemValue) { - return get$1(expansions.get(), itemValue); - }; - var otherMenus = function (path) { - var menuValues = directory.get(); - return difference(keys(menuValues), path); - }; - var getPrimary = function () { - return primary.get().bind(getPreparedMenu); - }; - var getMenus = function () { - return menus.get(); - }; - return { - setMenuBuilt: setMenuBuilt, - setContents: setContents, - expand: expand, - refresh: refresh, - collapse: collapse, - lookupMenu: lookupMenu, - lookupItem: lookupItem, - otherMenus: otherMenus, - getPrimary: getPrimary, - getMenus: getMenus, - clear: clear, - isClear: isClear, - getTriggeringPath: getTriggeringPath - }; + var expansions = Cell({}); + var menus = Cell({}); + var paths = Cell({}); + var primary = Cell(Optional.none()); + var directory = Cell({}); + var clear = function () { + expansions.set({}); + menus.set({}); + paths.set({}); + primary.set(Optional.none()); + }; + var isClear = function () { + return primary.get().isNone(); + }; + var setMenuBuilt = function (menuName, built) { + var _a; + menus.set(__assign(__assign({}, menus.get()), (_a = {}, _a[menuName] = { + type: 'prepared', + menu: built + }, _a))); + }; + var setContents = function (sPrimary, sMenus, sExpansions, dir) { + primary.set(Optional.some(sPrimary)); + expansions.set(sExpansions); + menus.set(sMenus); + directory.set(dir); + var sPaths = generate$5(dir, sExpansions); + paths.set(sPaths); + }; + var getTriggeringItem = function (menuValue) { + return find$2(expansions.get(), function (v, _k) { + return v === menuValue; + }); + }; + var getTriggerData = function (menuValue, getItemByValue, path) { + return getPreparedMenu(menuValue).bind(function (menu) { + return getTriggeringItem(menuValue).bind(function (triggeringItemValue) { + return getItemByValue(triggeringItemValue).map(function (triggeredItem) { + return { + triggeredMenu: menu, + triggeringItem: triggeredItem, + triggeringPath: path + }; + }); + }); + }); + }; + var getTriggeringPath = function (itemValue, getItemByValue) { + var extraPath = filter(lookupItem(itemValue).toArray(), function (menuValue) { + return getPreparedMenu(menuValue).isSome(); + }); + return get$1(paths.get(), itemValue).bind(function (path) { + var revPath = reverse(extraPath.concat(path)); + var triggers = bind(revPath, function (menuValue, menuIndex) { + return getTriggerData(menuValue, getItemByValue, revPath.slice(0, menuIndex + 1)).fold(function () { + return primary.get().is(menuValue) ? [] : [Optional.none()]; + }, function (data) { + return [Optional.some(data)]; + }); + }); + return sequence(triggers); + }); + }; + var expand = function (itemValue) { + return get$1(expansions.get(), itemValue).map(function (menu) { + var current = get$1(paths.get(), itemValue).getOr([]); + return [menu].concat(current); + }); + }; + var collapse = function (itemValue) { + return get$1(paths.get(), itemValue).bind(function (path) { + return path.length > 1 ? Optional.some(path.slice(1)) : Optional.none(); + }); + }; + var refresh = function (itemValue) { + return get$1(paths.get(), itemValue); + }; + var getPreparedMenu = function (menuValue) { + return lookupMenu(menuValue).bind(extractPreparedMenu); + }; + var lookupMenu = function (menuValue) { + return get$1(menus.get(), menuValue); + }; + var lookupItem = function (itemValue) { + return get$1(expansions.get(), itemValue); + }; + var otherMenus = function (path) { + var menuValues = directory.get(); + return difference(keys(menuValues), path); + }; + var getPrimary = function () { + return primary.get().bind(getPreparedMenu); + }; + var getMenus = function () { + return menus.get(); + }; + return { + setMenuBuilt: setMenuBuilt, + setContents: setContents, + expand: expand, + refresh: refresh, + collapse: collapse, + lookupMenu: lookupMenu, + lookupItem: lookupItem, + otherMenus: otherMenus, + getPrimary: getPrimary, + getMenus: getMenus, + clear: clear, + isClear: isClear, + getTriggeringPath: getTriggeringPath + }; }; var extractPreparedMenu = function (prep) { - return prep.type === 'prepared' ? Optional.some(prep.menu) : Optional.none(); + return prep.type === 'prepared' ? Optional.some(prep.menu) : Optional.none(); }; var LayeredState = { - init: init$3, - extractPreparedMenu: extractPreparedMenu + init: init$3, + extractPreparedMenu: extractPreparedMenu }; var make$3 = function (detail, _rawUiSpec) { - var submenuParentItems = Cell(Optional.none()); - var buildMenus = function (container, primaryName, menus) { - return map$1(menus, function (spec, name) { - var makeSketch = function () { - return Menu.sketch(__assign(__assign({}, spec), { - value: name, - markers: detail.markers, - fakeFocus: detail.fakeFocus, - onHighlight: detail.onHighlight, - focusManager: detail.fakeFocus ? highlights() : dom() - })); - }; - return name === primaryName ? { - type: 'prepared', - menu: container.getSystem().build(makeSketch()) - } : { - type: 'notbuilt', - nbMenu: makeSketch - }; - }); - }; - var layeredState = LayeredState.init(); - var setup = function (container) { - var componentMap = buildMenus(container, detail.data.primary, detail.data.menus); - var directory = toDirectory(); - layeredState.setContents(detail.data.primary, componentMap, detail.data.expansions, directory); - return layeredState.getPrimary(); - }; - var getItemValue = function (item) { - return Representing.getValue(item).value; - }; - var getItemByValue = function (_container, menus, itemValue) { - return findMap(menus, function (menu) { - if (!menu.getSystem().isConnected()) { - return Optional.none(); - } - var candidates = Highlighting.getCandidates(menu); - return find(candidates, function (c) { - return getItemValue(c) === itemValue; - }); - }); - }; - var toDirectory = function (_container) { - return map$1(detail.data.menus, function (data, _menuName) { - return bind(data.items, function (item) { - return item.type === 'separator' ? [] : [item.data.value]; - }); - }); - }; - var setActiveMenu = function (container, menu) { - Highlighting.highlight(container, menu); - Highlighting.getHighlighted(menu).orThunk(function () { - return Highlighting.getFirst(menu); - }).each(function (item) { - dispatch(container, item.element, focusItem()); - }); - }; - var getMenus = function (state, menuValues) { - return cat(map(menuValues, function (mv) { - return state.lookupMenu(mv).bind(function (prep) { - return prep.type === 'prepared' ? Optional.some(prep.menu) : Optional.none(); - }); + var submenuParentItems = Cell(Optional.none()); + var buildMenus = function (container, primaryName, menus) { + return map$1(menus, function (spec, name) { + var makeSketch = function () { + return Menu.sketch(__assign(__assign({}, spec), { + value: name, + markers: detail.markers, + fakeFocus: detail.fakeFocus, + onHighlight: detail.onHighlight, + focusManager: detail.fakeFocus ? highlights() : dom() })); - }; - var closeOthers = function (container, state, path) { - var others = getMenus(state, state.otherMenus(path)); - each(others, function (o) { - remove$6(o.element, [detail.markers.backgroundMenu]); - if (!detail.stayInDom) { - Replacing.remove(container, o); - } - }); - }; - var getSubmenuParents = function (container) { - return submenuParentItems.get().getOrThunk(function () { - var r = {}; - var items = descendants(container.element, '.' + detail.markers.item); - var parentItems = filter(items, function (i) { - return get$2(i, 'aria-haspopup') === 'true'; - }); - each(parentItems, function (i) { - container.getSystem().getByDom(i).each(function (itemComp) { - var key = getItemValue(itemComp); - r[key] = itemComp; - }); - }); - submenuParentItems.set(Optional.some(r)); - return r; - }); - }; - var updateAriaExpansions = function (container, path) { - var parentItems = getSubmenuParents(container); - each$1(parentItems, function (v, k) { - var expanded = contains(path, k); - set(v.element, 'aria-expanded', expanded); - }); - }; - var updateMenuPath = function (container, state, path) { - return Optional.from(path[0]).bind(function (latestMenuName) { - return state.lookupMenu(latestMenuName).bind(function (menuPrep) { - if (menuPrep.type === 'notbuilt') { - return Optional.none(); - } else { - var activeMenu = menuPrep.menu; - var rest = getMenus(state, path.slice(1)); - each(rest, function (r) { - add$2(r.element, detail.markers.backgroundMenu); - }); - if (!inBody(activeMenu.element)) { - Replacing.append(container, premade$1(activeMenu)); - } - remove$6(activeMenu.element, [detail.markers.backgroundMenu]); - setActiveMenu(container, activeMenu); - closeOthers(container, state, path); - return Optional.some(activeMenu); - } - }); - }); - }; - var ExpandHighlightDecision; - (function (ExpandHighlightDecision) { - ExpandHighlightDecision[ExpandHighlightDecision['HighlightSubmenu'] = 0] = 'HighlightSubmenu'; - ExpandHighlightDecision[ExpandHighlightDecision['HighlightParent'] = 1] = 'HighlightParent'; - }(ExpandHighlightDecision || (ExpandHighlightDecision = {}))); - var buildIfRequired = function (container, menuName, menuPrep) { + }; + return name === primaryName ? { + type: 'prepared', + menu: container.getSystem().build(makeSketch()) + } : { + type: 'notbuilt', + nbMenu: makeSketch + }; + }); + }; + var layeredState = LayeredState.init(); + var setup = function (container) { + var componentMap = buildMenus(container, detail.data.primary, detail.data.menus); + var directory = toDirectory(); + layeredState.setContents(detail.data.primary, componentMap, detail.data.expansions, directory); + return layeredState.getPrimary(); + }; + var getItemValue = function (item) { + return Representing.getValue(item).value; + }; + var getItemByValue = function (_container, menus, itemValue) { + return findMap(menus, function (menu) { + if (!menu.getSystem().isConnected()) { + return Optional.none(); + } + var candidates = Highlighting.getCandidates(menu); + return find(candidates, function (c) { + return getItemValue(c) === itemValue; + }); + }); + }; + var toDirectory = function (_container) { + return map$1(detail.data.menus, function (data, _menuName) { + return bind(data.items, function (item) { + return item.type === 'separator' ? [] : [item.data.value]; + }); + }); + }; + var setActiveMenu = function (container, menu) { + Highlighting.highlight(container, menu); + Highlighting.getHighlighted(menu).orThunk(function () { + return Highlighting.getFirst(menu); + }).each(function (item) { + dispatch(container, item.element, focusItem()); + }); + }; + var getMenus = function (state, menuValues) { + return cat(map(menuValues, function (mv) { + return state.lookupMenu(mv).bind(function (prep) { + return prep.type === 'prepared' ? Optional.some(prep.menu) : Optional.none(); + }); + })); + }; + var closeOthers = function (container, state, path) { + var others = getMenus(state, state.otherMenus(path)); + each(others, function (o) { + remove$6(o.element, [detail.markers.backgroundMenu]); + if (!detail.stayInDom) { + Replacing.remove(container, o); + } + }); + }; + var getSubmenuParents = function (container) { + return submenuParentItems.get().getOrThunk(function () { + var r = {}; + var items = descendants(container.element, '.' + detail.markers.item); + var parentItems = filter(items, function (i) { + return get$2(i, 'aria-haspopup') === 'true'; + }); + each(parentItems, function (i) { + container.getSystem().getByDom(i).each(function (itemComp) { + var key = getItemValue(itemComp); + r[key] = itemComp; + }); + }); + submenuParentItems.set(Optional.some(r)); + return r; + }); + }; + var updateAriaExpansions = function (container, path) { + var parentItems = getSubmenuParents(container); + each$1(parentItems, function (v, k) { + var expanded = contains(path, k); + set(v.element, 'aria-expanded', expanded); + }); + }; + var updateMenuPath = function (container, state, path) { + return Optional.from(path[0]).bind(function (latestMenuName) { + return state.lookupMenu(latestMenuName).bind(function (menuPrep) { if (menuPrep.type === 'notbuilt') { - var menu = container.getSystem().build(menuPrep.nbMenu()); - layeredState.setMenuBuilt(menuName, menu); - return menu; + return Optional.none(); } else { - return menuPrep.menu; - } - }; - var expandRight = function (container, item, decision) { - if (decision === void 0) { - decision = ExpandHighlightDecision.HighlightSubmenu; - } - var value = getItemValue(item); - return layeredState.expand(value).bind(function (path) { - updateAriaExpansions(container, path); - return Optional.from(path[0]).bind(function (menuName) { - return layeredState.lookupMenu(menuName).bind(function (activeMenuPrep) { - var activeMenu = buildIfRequired(container, menuName, activeMenuPrep); - if (!inBody(activeMenu.element)) { - Replacing.append(container, premade$1(activeMenu)); - } - detail.onOpenSubmenu(container, item, activeMenu, reverse(path)); - if (decision === ExpandHighlightDecision.HighlightSubmenu) { - Highlighting.highlightFirst(activeMenu); - return updateMenuPath(container, layeredState, path); - } else { - Highlighting.dehighlightAll(activeMenu); - return Optional.some(item); - } - }); - }); - }); - }; - var collapseLeft = function (container, item) { - var value = getItemValue(item); - return layeredState.collapse(value).bind(function (path) { - updateAriaExpansions(container, path); - return updateMenuPath(container, layeredState, path).map(function (activeMenu) { - detail.onCollapseMenu(container, item, activeMenu); - return activeMenu; - }); - }); - }; - var updateView = function (container, item) { - var value = getItemValue(item); - return layeredState.refresh(value).bind(function (path) { - updateAriaExpansions(container, path); + var activeMenu = menuPrep.menu; + var rest = getMenus(state, path.slice(1)); + each(rest, function (r) { + add$2(r.element, detail.markers.backgroundMenu); + }); + if (!inBody(activeMenu.element)) { + Replacing.append(container, premade$1(activeMenu)); + } + remove$6(activeMenu.element, [detail.markers.backgroundMenu]); + setActiveMenu(container, activeMenu); + closeOthers(container, state, path); + return Optional.some(activeMenu); + } + }); + }); + }; + var ExpandHighlightDecision; + (function (ExpandHighlightDecision) { + ExpandHighlightDecision[ExpandHighlightDecision['HighlightSubmenu'] = 0] = 'HighlightSubmenu'; + ExpandHighlightDecision[ExpandHighlightDecision['HighlightParent'] = 1] = 'HighlightParent'; + }(ExpandHighlightDecision || (ExpandHighlightDecision = {}))); + var buildIfRequired = function (container, menuName, menuPrep) { + if (menuPrep.type === 'notbuilt') { + var menu = container.getSystem().build(menuPrep.nbMenu()); + layeredState.setMenuBuilt(menuName, menu); + return menu; + } else { + return menuPrep.menu; + } + }; + var expandRight = function (container, item, decision) { + if (decision === void 0) { + decision = ExpandHighlightDecision.HighlightSubmenu; + } + var value = getItemValue(item); + return layeredState.expand(value).bind(function (path) { + updateAriaExpansions(container, path); + return Optional.from(path[0]).bind(function (menuName) { + return layeredState.lookupMenu(menuName).bind(function (activeMenuPrep) { + var activeMenu = buildIfRequired(container, menuName, activeMenuPrep); + if (!inBody(activeMenu.element)) { + Replacing.append(container, premade$1(activeMenu)); + } + detail.onOpenSubmenu(container, item, activeMenu, reverse(path)); + if (decision === ExpandHighlightDecision.HighlightSubmenu) { + Highlighting.highlightFirst(activeMenu); return updateMenuPath(container, layeredState, path); - }); - }; - var onRight = function (container, item) { - return inside(item.element) ? Optional.none() : expandRight(container, item, ExpandHighlightDecision.HighlightSubmenu); - }; - var onLeft = function (container, item) { - return inside(item.element) ? Optional.none() : collapseLeft(container, item); - }; - var onEscape = function (container, item) { - return collapseLeft(container, item).orThunk(function () { - return detail.onEscape(container, item).map(function () { - return container; - }); - }); - }; - var keyOnItem = function (f) { - return function (container, simulatedEvent) { - return closest$2(simulatedEvent.getSource(), '.' + detail.markers.item).bind(function (target) { - return container.getSystem().getByDom(target).toOptional().bind(function (item) { - return f(container, item).map(function () { - return true; - }); - }); - }); - }; - }; - var events = derive([ - run(focus$4(), function (sandbox, simulatedEvent) { - var item = simulatedEvent.event.item; - layeredState.lookupItem(getItemValue(item)).each(function () { - var menu = simulatedEvent.event.menu; - Highlighting.highlight(sandbox, menu); - var value = getItemValue(simulatedEvent.event.item); - layeredState.refresh(value).each(function (path) { - return closeOthers(sandbox, layeredState, path); - }); - }); - }), - runOnExecute(function (component, simulatedEvent) { - var target = simulatedEvent.event.target; - component.getSystem().getByDom(target).each(function (item) { - var itemValue = getItemValue(item); - if (itemValue.indexOf('collapse-item') === 0) { - collapseLeft(component, item); - } - expandRight(component, item, ExpandHighlightDecision.HighlightSubmenu).fold(function () { - detail.onExecute(component, item); - }, function () { - }); - }); - }), - runOnAttached(function (container, _simulatedEvent) { - setup(container).each(function (primary) { - Replacing.append(container, premade$1(primary)); - detail.onOpenMenu(container, primary); - if (detail.highlightImmediately) { - setActiveMenu(container, primary); - } - }); - }) - ].concat(detail.navigateOnHover ? [run(hover(), function (sandbox, simulatedEvent) { - var item = simulatedEvent.event.item; - updateView(sandbox, item); - expandRight(sandbox, item, ExpandHighlightDecision.HighlightParent); - detail.onHover(sandbox, item); + } else { + Highlighting.dehighlightAll(activeMenu); + return Optional.some(item); + } + }); + }); + }); + }; + var collapseLeft = function (container, item) { + var value = getItemValue(item); + return layeredState.collapse(value).bind(function (path) { + updateAriaExpansions(container, path); + return updateMenuPath(container, layeredState, path).map(function (activeMenu) { + detail.onCollapseMenu(container, item, activeMenu); + return activeMenu; + }); + }); + }; + var updateView = function (container, item) { + var value = getItemValue(item); + return layeredState.refresh(value).bind(function (path) { + updateAriaExpansions(container, path); + return updateMenuPath(container, layeredState, path); + }); + }; + var onRight = function (container, item) { + return inside(item.element) ? Optional.none() : expandRight(container, item, ExpandHighlightDecision.HighlightSubmenu); + }; + var onLeft = function (container, item) { + return inside(item.element) ? Optional.none() : collapseLeft(container, item); + }; + var onEscape = function (container, item) { + return collapseLeft(container, item).orThunk(function () { + return detail.onEscape(container, item).map(function () { + return container; + }); + }); + }; + var keyOnItem = function (f) { + return function (container, simulatedEvent) { + return closest$2(simulatedEvent.getSource(), '.' + detail.markers.item).bind(function (target) { + return container.getSystem().getByDom(target).toOptional().bind(function (item) { + return f(container, item).map(function () { + return true; + }); + }); + }); + }; + }; + var events = derive([ + run(focus$4(), function (sandbox, simulatedEvent) { + var item = simulatedEvent.event.item; + layeredState.lookupItem(getItemValue(item)).each(function () { + var menu = simulatedEvent.event.menu; + Highlighting.highlight(sandbox, menu); + var value = getItemValue(simulatedEvent.event.item); + layeredState.refresh(value).each(function (path) { + return closeOthers(sandbox, layeredState, path); + }); + }); + }), + runOnExecute(function (component, simulatedEvent) { + var target = simulatedEvent.event.target; + component.getSystem().getByDom(target).each(function (item) { + var itemValue = getItemValue(item); + if (itemValue.indexOf('collapse-item') === 0) { + collapseLeft(component, item); + } + expandRight(component, item, ExpandHighlightDecision.HighlightSubmenu).fold(function () { + detail.onExecute(component, item); + }, function () { + }); + }); + }), + runOnAttached(function (container, _simulatedEvent) { + setup(container).each(function (primary) { + Replacing.append(container, premade$1(primary)); + detail.onOpenMenu(container, primary); + if (detail.highlightImmediately) { + setActiveMenu(container, primary); + } + }); + }) + ].concat(detail.navigateOnHover ? [run(hover(), function (sandbox, simulatedEvent) { + var item = simulatedEvent.event.item; + updateView(sandbox, item); + expandRight(sandbox, item, ExpandHighlightDecision.HighlightParent); + detail.onHover(sandbox, item); })] : [])); - var getActiveItem = function (container) { - return Highlighting.getHighlighted(container).bind(Highlighting.getHighlighted); - }; - var collapseMenuApi = function (container) { - getActiveItem(container).each(function (currentItem) { - collapseLeft(container, currentItem); - }); - }; - var highlightPrimary = function (container) { - layeredState.getPrimary().each(function (primary) { - setActiveMenu(container, primary); - }); - }; - var extractMenuFromContainer = function (container) { - return Optional.from(container.components()[0]).filter(function (comp) { - return get$2(comp.element, 'role') === 'menu'; - }); - }; - var repositionMenus = function (container) { - var maybeActivePrimary = layeredState.getPrimary().bind(function (primary) { - return getActiveItem(container).bind(function (currentItem) { - var itemValue = getItemValue(currentItem); - var allMenus = values(layeredState.getMenus()); - var preparedMenus = cat(map(allMenus, LayeredState.extractPreparedMenu)); - return layeredState.getTriggeringPath(itemValue, function (v) { - return getItemByValue(container, preparedMenus, v); - }); - }).map(function (triggeringPath) { - return { - primary: primary, - triggeringPath: triggeringPath - }; - }); - }); - maybeActivePrimary.fold(function () { - extractMenuFromContainer(container).each(function (primaryMenu) { - detail.onRepositionMenu(container, primaryMenu, []); - }); - }, function (_a) { - var primary = _a.primary, triggeringPath = _a.triggeringPath; - detail.onRepositionMenu(container, primary, triggeringPath); - }); - }; - var apis = { - collapseMenu: collapseMenuApi, - highlightPrimary: highlightPrimary, - repositionMenus: repositionMenus - }; - return { - uid: detail.uid, - dom: detail.dom, - markers: detail.markers, - behaviours: augment(detail.tmenuBehaviours, [ - Keying.config({ - mode: 'special', - onRight: keyOnItem(onRight), - onLeft: keyOnItem(onLeft), - onEscape: keyOnItem(onEscape), - focusIn: function (container, _keyInfo) { - layeredState.getPrimary().each(function (primary) { - dispatch(container, primary.element, focusItem()); - }); - } - }), - Highlighting.config({ - highlightClass: detail.markers.selectedMenu, - itemClass: detail.markers.menu - }), - Composing.config({ - find: function (container) { - return Highlighting.getHighlighted(container); - } - }), - Replacing.config({}) - ]), - eventOrder: detail.eventOrder, - apis: apis, - events: events - }; + var getActiveItem = function (container) { + return Highlighting.getHighlighted(container).bind(Highlighting.getHighlighted); + }; + var collapseMenuApi = function (container) { + getActiveItem(container).each(function (currentItem) { + collapseLeft(container, currentItem); + }); + }; + var highlightPrimary = function (container) { + layeredState.getPrimary().each(function (primary) { + setActiveMenu(container, primary); + }); + }; + var extractMenuFromContainer = function (container) { + return Optional.from(container.components()[0]).filter(function (comp) { + return get$2(comp.element, 'role') === 'menu'; + }); + }; + var repositionMenus = function (container) { + var maybeActivePrimary = layeredState.getPrimary().bind(function (primary) { + return getActiveItem(container).bind(function (currentItem) { + var itemValue = getItemValue(currentItem); + var allMenus = values(layeredState.getMenus()); + var preparedMenus = cat(map(allMenus, LayeredState.extractPreparedMenu)); + return layeredState.getTriggeringPath(itemValue, function (v) { + return getItemByValue(container, preparedMenus, v); + }); + }).map(function (triggeringPath) { + return { + primary: primary, + triggeringPath: triggeringPath + }; + }); + }); + maybeActivePrimary.fold(function () { + extractMenuFromContainer(container).each(function (primaryMenu) { + detail.onRepositionMenu(container, primaryMenu, []); + }); + }, function (_a) { + var primary = _a.primary, triggeringPath = _a.triggeringPath; + detail.onRepositionMenu(container, primary, triggeringPath); + }); + }; + var apis = { + collapseMenu: collapseMenuApi, + highlightPrimary: highlightPrimary, + repositionMenus: repositionMenus + }; + return { + uid: detail.uid, + dom: detail.dom, + markers: detail.markers, + behaviours: augment(detail.tmenuBehaviours, [ + Keying.config({ + mode: 'special', + onRight: keyOnItem(onRight), + onLeft: keyOnItem(onLeft), + onEscape: keyOnItem(onEscape), + focusIn: function (container, _keyInfo) { + layeredState.getPrimary().each(function (primary) { + dispatch(container, primary.element, focusItem()); + }); + } + }), + Highlighting.config({ + highlightClass: detail.markers.selectedMenu, + itemClass: detail.markers.menu + }), + Composing.config({ + find: function (container) { + return Highlighting.getHighlighted(container); + } + }), + Replacing.config({}) + ]), + eventOrder: detail.eventOrder, + apis: apis, + events: events + }; }; var collapseItem = constant('collapse-item'); var tieredData = function (primary, menus, expansions) { - return { - primary: primary, - menus: menus, - expansions: expansions - }; + return { + primary: primary, + menus: menus, + expansions: expansions + }; }; var singleData = function (name, menu) { - return { - primary: name, - menus: wrap$1(name, menu), - expansions: {} - }; + return { + primary: name, + menus: wrap$1(name, menu), + expansions: {} + }; }; var collapseItem$1 = function (text) { - return { - value: generate$1(collapseItem()), - meta: {text: text} - }; + return { + value: generate$1(collapseItem()), + meta: { text: text } + }; }; var tieredMenu = single$2({ - name: 'TieredMenu', - configFields: [ - onStrictKeyboardHandler('onExecute'), - onStrictKeyboardHandler('onEscape'), - onStrictHandler('onOpenMenu'), - onStrictHandler('onOpenSubmenu'), - onHandler('onRepositionMenu'), - onHandler('onCollapseMenu'), - defaulted$1('highlightImmediately', true), - strictObjOf('data', [ - strict$1('primary'), - strict$1('menus'), - strict$1('expansions') - ]), - defaulted$1('fakeFocus', false), - onHandler('onHighlight'), - onHandler('onHover'), - tieredMenuMarkers(), - strict$1('dom'), - defaulted$1('navigateOnHover', true), - defaulted$1('stayInDom', false), - field$1('tmenuBehaviours', [ - Keying, - Highlighting, - Composing, - Replacing - ]), - defaulted$1('eventOrder', {}) - ], - apis: { - collapseMenu: function (apis, tmenu) { - apis.collapseMenu(tmenu); - }, - highlightPrimary: function (apis, tmenu) { - apis.highlightPrimary(tmenu); - }, - repositionMenus: function (apis, tmenu) { - apis.repositionMenus(tmenu); - } + name: 'TieredMenu', + configFields: [ + onStrictKeyboardHandler('onExecute'), + onStrictKeyboardHandler('onEscape'), + onStrictHandler('onOpenMenu'), + onStrictHandler('onOpenSubmenu'), + onHandler('onRepositionMenu'), + onHandler('onCollapseMenu'), + defaulted$1('highlightImmediately', true), + strictObjOf('data', [ + strict$1('primary'), + strict$1('menus'), + strict$1('expansions') + ]), + defaulted$1('fakeFocus', false), + onHandler('onHighlight'), + onHandler('onHover'), + tieredMenuMarkers(), + strict$1('dom'), + defaulted$1('navigateOnHover', true), + defaulted$1('stayInDom', false), + field$1('tmenuBehaviours', [ + Keying, + Highlighting, + Composing, + Replacing + ]), + defaulted$1('eventOrder', {}) + ], + apis: { + collapseMenu: function (apis, tmenu) { + apis.collapseMenu(tmenu); + }, + highlightPrimary: function (apis, tmenu) { + apis.highlightPrimary(tmenu); }, - factory: make$3, - extraApis: { - tieredData: tieredData, - singleData: singleData, - collapseItem: collapseItem$1 + repositionMenus: function (apis, tmenu) { + apis.repositionMenus(tmenu); } + }, + factory: make$3, + extraApis: { + tieredData: tieredData, + singleData: singleData, + collapseItem: collapseItem$1 + } }); var findRoute = function (component, transConfig, transState, route) { - return get$1(transConfig.routes, route.start).bind(function (sConfig) { - return get$1(sConfig, route.destination); - }); + return get$1(transConfig.routes, route.start).bind(function (sConfig) { + return get$1(sConfig, route.destination); + }); }; var getTransition = function (comp, transConfig, transState) { - var route = getCurrentRoute(comp, transConfig); - return route.bind(function (r) { - return getTransitionOf(comp, transConfig, transState, r); - }); + var route = getCurrentRoute(comp, transConfig); + return route.bind(function (r) { + return getTransitionOf(comp, transConfig, transState, r); + }); }; var getTransitionOf = function (comp, transConfig, transState, route) { - return findRoute(comp, transConfig, transState, route).bind(function (r) { - return r.transition.map(function (t) { - return { - transition: t, - route: r - }; - }); + return findRoute(comp, transConfig, transState, route).bind(function (r) { + return r.transition.map(function (t) { + return { + transition: t, + route: r + }; }); + }); }; var disableTransition = function (comp, transConfig, transState) { - getTransition(comp, transConfig, transState).each(function (routeTransition) { - var t = routeTransition.transition; - remove$4(comp.element, t.transitionClass); - remove$1(comp.element, transConfig.destinationAttr); - }); + getTransition(comp, transConfig, transState).each(function (routeTransition) { + var t = routeTransition.transition; + remove$4(comp.element, t.transitionClass); + remove$1(comp.element, transConfig.destinationAttr); + }); }; var getNewRoute = function (comp, transConfig, transState, destination) { - return { - start: get$2(comp.element, transConfig.stateAttr), - destination: destination - }; + return { + start: get$2(comp.element, transConfig.stateAttr), + destination: destination + }; }; var getCurrentRoute = function (comp, transConfig, _transState) { - var el = comp.element; - return getOpt(el, transConfig.destinationAttr).map(function (destination) { - return { - start: get$2(comp.element, transConfig.stateAttr), - destination: destination - }; - }); + var el = comp.element; + return getOpt(el, transConfig.destinationAttr).map(function (destination) { + return { + start: get$2(comp.element, transConfig.stateAttr), + destination: destination + }; + }); }; var jumpTo = function (comp, transConfig, transState, destination) { - disableTransition(comp, transConfig, transState); - if (has$1(comp.element, transConfig.stateAttr) && get$2(comp.element, transConfig.stateAttr) !== destination) { - transConfig.onFinish(comp, destination); - } - set(comp.element, transConfig.stateAttr, destination); + disableTransition(comp, transConfig, transState); + if (has$1(comp.element, transConfig.stateAttr) && get$2(comp.element, transConfig.stateAttr) !== destination) { + transConfig.onFinish(comp, destination); + } + set(comp.element, transConfig.stateAttr, destination); }; var fasttrack = function (comp, transConfig, _transState, _destination) { - if (has$1(comp.element, transConfig.destinationAttr)) { - getOpt(comp.element, transConfig.destinationAttr).each(function (destination) { - set(comp.element, transConfig.stateAttr, destination); - }); - remove$1(comp.element, transConfig.destinationAttr); - } + if (has$1(comp.element, transConfig.destinationAttr)) { + getOpt(comp.element, transConfig.destinationAttr).each(function (destination) { + set(comp.element, transConfig.stateAttr, destination); + }); + remove$1(comp.element, transConfig.destinationAttr); + } }; var progressTo = function (comp, transConfig, transState, destination) { - fasttrack(comp, transConfig); - var route = getNewRoute(comp, transConfig, transState, destination); - getTransitionOf(comp, transConfig, transState, route).fold(function () { - jumpTo(comp, transConfig, transState, destination); - }, function (routeTransition) { - disableTransition(comp, transConfig, transState); - var t = routeTransition.transition; - add$2(comp.element, t.transitionClass); - set(comp.element, transConfig.destinationAttr, destination); - }); + fasttrack(comp, transConfig); + var route = getNewRoute(comp, transConfig, transState, destination); + getTransitionOf(comp, transConfig, transState, route).fold(function () { + jumpTo(comp, transConfig, transState, destination); + }, function (routeTransition) { + disableTransition(comp, transConfig, transState); + var t = routeTransition.transition; + add$2(comp.element, t.transitionClass); + set(comp.element, transConfig.destinationAttr, destination); + }); }; var getState$1 = function (comp, transConfig, _transState) { - return getOpt(comp.element, transConfig.stateAttr); + return getOpt(comp.element, transConfig.stateAttr); }; var TransitionApis = /*#__PURE__*/Object.freeze({ @@ -9101,24 +9079,24 @@ }); var events$9 = function (transConfig, transState) { - return derive([ - run(transitionend(), function (component, simulatedEvent) { - var raw = simulatedEvent.event.raw; - getCurrentRoute(component, transConfig).each(function (route) { - findRoute(component, transConfig, transState, route).each(function (rInfo) { - rInfo.transition.each(function (rTransition) { - if (raw.propertyName === rTransition.property) { - jumpTo(component, transConfig, transState, route.destination); - transConfig.onTransition(component, route); - } - }); - }); - }); - }), - runOnAttached(function (comp, _se) { - jumpTo(comp, transConfig, transState, transConfig.initialState); - }) - ]); + return derive([ + run(transitionend(), function (component, simulatedEvent) { + var raw = simulatedEvent.event.raw; + getCurrentRoute(component, transConfig).each(function (route) { + findRoute(component, transConfig, transState, route).each(function (rInfo) { + rInfo.transition.each(function (rTransition) { + if (raw.propertyName === rTransition.property) { + jumpTo(component, transConfig, transState, route.destination); + transConfig.onTransition(component, route); + } + }); + }); + }); + }), + runOnAttached(function (comp, _se) { + jumpTo(comp, transConfig, transState, transConfig.initialState); + }) + ]); }; var ActiveTransitioning = /*#__PURE__*/Object.freeze({ @@ -9127,540 +9105,540 @@ }); var TransitionSchema = [ - defaulted$1('destinationAttr', 'data-transitioning-destination'), - defaulted$1('stateAttr', 'data-transitioning-state'), - strict$1('initialState'), - onHandler('onTransition'), - onHandler('onFinish'), - strictOf('routes', setOf$1(Result.value, setOf$1(Result.value, objOfOnly([optionObjOfOnly('transition', [ - strict$1('property'), - strict$1('transitionClass') + defaulted$1('destinationAttr', 'data-transitioning-destination'), + defaulted$1('stateAttr', 'data-transitioning-state'), + strict$1('initialState'), + onHandler('onTransition'), + onHandler('onFinish'), + strictOf('routes', setOf$1(Result.value, setOf$1(Result.value, objOfOnly([optionObjOfOnly('transition', [ + strict$1('property'), + strict$1('transitionClass') ])])))) ]; var createRoutes = function (routes) { - var r = {}; - each$1(routes, function (v, k) { - var waypoints = k.split('<->'); - r[waypoints[0]] = wrap$1(waypoints[1], v); - r[waypoints[1]] = wrap$1(waypoints[0], v); - }); - return r; + var r = {}; + each$1(routes, function (v, k) { + var waypoints = k.split('<->'); + r[waypoints[0]] = wrap$1(waypoints[1], v); + r[waypoints[1]] = wrap$1(waypoints[0], v); + }); + return r; }; var createBistate = function (first, second, transitions) { - return wrapAll$1([ + return wrapAll$1([ + { + key: first, + value: wrap$1(second, transitions) + }, + { + key: second, + value: wrap$1(first, transitions) + } + ]); + }; + var createTristate = function (first, second, third, transitions) { + return wrapAll$1([ + { + key: first, + value: wrapAll$1([ { - key: first, - value: wrap$1(second, transitions) + key: second, + value: transitions }, { - key: second, - value: wrap$1(first, transitions) + key: third, + value: transitions } - ]); - }; - var createTristate = function (first, second, third, transitions) { - return wrapAll$1([ + ]) + }, + { + key: second, + value: wrapAll$1([ { - key: first, - value: wrapAll$1([ - { - key: second, - value: transitions - }, - { - key: third, - value: transitions - } - ]) + key: first, + value: transitions }, { - key: second, - value: wrapAll$1([ - { - key: first, - value: transitions - }, - { - key: third, - value: transitions - } - ]) + key: third, + value: transitions + } + ]) + }, + { + key: third, + value: wrapAll$1([ + { + key: first, + value: transitions }, { - key: third, - value: wrapAll$1([ - { - key: first, - value: transitions - }, - { - key: second, - value: transitions - } - ]) + key: second, + value: transitions } - ]); + ]) + } + ]); }; var Transitioning = create$1({ - fields: TransitionSchema, - name: 'transitioning', - active: ActiveTransitioning, - apis: TransitionApis, - extra: { - createRoutes: createRoutes, - createBistate: createBistate, - createTristate: createTristate - } + fields: TransitionSchema, + name: 'transitioning', + active: ActiveTransitioning, + apis: TransitionApis, + extra: { + createRoutes: createRoutes, + createBistate: createBistate, + createTristate: createTristate + } }); var scrollableStyle = resolve('scrollable'); var register = function (element) { - add$2(element, scrollableStyle); + add$2(element, scrollableStyle); }; var deregister = function (element) { - remove$4(element, scrollableStyle); + remove$4(element, scrollableStyle); }; var scrollable = scrollableStyle; var getValue$4 = function (item) { - return get$1(item, 'format').getOr(item.title); + return get$1(item, 'format').getOr(item.title); }; var convert$1 = function (formats, memMenuThunk) { - var mainMenu = makeMenu('Styles', [].concat(map(formats.items, function (k) { - return makeItem(getValue$4(k), k.title, k.isSelected(), k.getPreview(), hasNonNullableKey(formats.expansions, getValue$4(k))); - })), memMenuThunk, false); - var submenus = map$1(formats.menus, function (menuItems, menuName) { - var items = map(menuItems, function (item) { - return makeItem(getValue$4(item), item.title, item.isSelected !== undefined ? item.isSelected() : false, item.getPreview !== undefined ? item.getPreview() : '', hasNonNullableKey(formats.expansions, getValue$4(item))); - }); - return makeMenu(menuName, items, memMenuThunk, true); - }); - var menus = deepMerge(submenus, wrap$1('styles', mainMenu)); - var tmenu = tieredMenu.tieredData('styles', menus, formats.expansions); - return {tmenu: tmenu}; + var mainMenu = makeMenu('Styles', [].concat(map(formats.items, function (k) { + return makeItem(getValue$4(k), k.title, k.isSelected(), k.getPreview(), hasNonNullableKey(formats.expansions, getValue$4(k))); + })), memMenuThunk, false); + var submenus = map$1(formats.menus, function (menuItems, menuName) { + var items = map(menuItems, function (item) { + return makeItem(getValue$4(item), item.title, item.isSelected !== undefined ? item.isSelected() : false, item.getPreview !== undefined ? item.getPreview() : '', hasNonNullableKey(formats.expansions, getValue$4(item))); + }); + return makeMenu(menuName, items, memMenuThunk, true); + }); + var menus = deepMerge(submenus, wrap$1('styles', mainMenu)); + var tmenu = tieredMenu.tieredData('styles', menus, formats.expansions); + return { tmenu: tmenu }; }; var makeItem = function (value, text, selected, preview, isMenu) { - return { - data: { - value: value, - text: text - }, - type: 'item', + return { + data: { + value: value, + text: text + }, + type: 'item', + dom: { + tag: 'div', + classes: isMenu ? [resolve('styles-item-is-menu')] : [] + }, + toggling: { + toggleOnExecute: false, + toggleClass: resolve('format-matches'), + selected: selected + }, + itemBehaviours: derive$1(isMenu ? [] : [format(value, function (comp, status) { + var toggle = status ? Toggling.on : Toggling.off; + toggle(comp); + })]), + components: [{ dom: { - tag: 'div', - classes: isMenu ? [resolve('styles-item-is-menu')] : [] - }, - toggling: { - toggleOnExecute: false, - toggleClass: resolve('format-matches'), - selected: selected + tag: 'div', + attributes: { style: preview }, + innerHtml: text + } + }] + }; + }; + var makeMenu = function (value, items, memMenuThunk, collapsable) { + return { + value: value, + dom: { tag: 'div' }, + components: [ + Button.sketch({ + dom: { + tag: 'div', + classes: [resolve('styles-collapser')] }, - itemBehaviours: derive$1(isMenu ? [] : [format(value, function (comp, status) { - var toggle = status ? Toggling.on : Toggling.off; - toggle(comp); - })]), - components: [{ + components: collapsable ? [ + { dom: { - tag: 'div', - attributes: {style: preview}, - innerHtml: text + tag: 'span', + classes: [resolve('styles-collapse-icon')] } - }] - }; - }; - var makeMenu = function (value, items, memMenuThunk, collapsable) { - return { - value: value, - dom: {tag: 'div'}, - components: [ - Button.sketch({ - dom: { - tag: 'div', - classes: [resolve('styles-collapser')] - }, - components: collapsable ? [ - { - dom: { - tag: 'span', - classes: [resolve('styles-collapse-icon')] - } - }, - text(value) - ] : [text(value)], - action: function (item) { - if (collapsable) { - var comp = memMenuThunk().get(item); - tieredMenu.collapseMenu(comp); - } - } + }, + text(value) + ] : [text(value)], + action: function (item) { + if (collapsable) { + var comp = memMenuThunk().get(item); + tieredMenu.collapseMenu(comp); + } + } + }), + { + dom: { + tag: 'div', + classes: [resolve('styles-menu-items-container')] + }, + components: [Menu.parts.items({})], + behaviours: derive$1([config('adhoc-scrollable-menu', [ + runOnAttached(function (component, _simulatedEvent) { + set$3(component.element, 'overflow-y', 'auto'); + set$3(component.element, '-webkit-overflow-scrolling', 'touch'); + register(component.element); }), - { - dom: { - tag: 'div', - classes: [resolve('styles-menu-items-container')] - }, - components: [Menu.parts.items({})], - behaviours: derive$1([config('adhoc-scrollable-menu', [ - runOnAttached(function (component, _simulatedEvent) { - set$3(component.element, 'overflow-y', 'auto'); - set$3(component.element, '-webkit-overflow-scrolling', 'touch'); - register(component.element); - }), - runOnDetached(function (component) { - remove$5(component.element, 'overflow-y'); - remove$5(component.element, '-webkit-overflow-scrolling'); - deregister(component.element); - }) - ])]) - } - ], - items: items, - menuBehaviours: derive$1([Transitioning.config({ - initialState: 'after', - routes: Transitioning.createTristate('before', 'current', 'after', { - transition: { - property: 'transform', - transitionClass: 'transitioning' - } + runOnDetached(function (component) { + remove$5(component.element, 'overflow-y'); + remove$5(component.element, '-webkit-overflow-scrolling'); + deregister(component.element); }) - })]) - }; + ])]) + } + ], + items: items, + menuBehaviours: derive$1([Transitioning.config({ + initialState: 'after', + routes: Transitioning.createTristate('before', 'current', 'after', { + transition: { + property: 'transform', + transitionClass: 'transitioning' + } + }) + })]) + }; }; var sketch$8 = function (settings) { - var dataset = convert$1(settings.formats, function () { - return memMenu; - }); - var memMenu = record(tieredMenu.sketch({ - dom: { - tag: 'div', - classes: [resolve('styles-menu')] - }, - components: [], - fakeFocus: true, - stayInDom: true, - onExecute: function (_tmenu, item) { - var v = Representing.getValue(item); - settings.handle(item, v.value); - return Optional.none(); - }, - onEscape: function () { - return Optional.none(); - }, - onOpenMenu: function (container, menu) { - var w = get$8(container.element); - set$4(menu.element, w); - Transitioning.jumpTo(menu, 'current'); - }, - onOpenSubmenu: function (container, item, submenu) { - var w = get$8(container.element); - var menu = ancestor$2(item.element, '[role="menu"]').getOrDie('hacky'); - var menuComp = container.getSystem().getByDom(menu).getOrDie(); - set$4(submenu.element, w); - Transitioning.progressTo(menuComp, 'before'); - Transitioning.jumpTo(submenu, 'after'); - Transitioning.progressTo(submenu, 'current'); - }, - onCollapseMenu: function (container, item, menu) { - var submenu = ancestor$2(item.element, '[role="menu"]').getOrDie('hacky'); - var submenuComp = container.getSystem().getByDom(submenu).getOrDie(); - Transitioning.progressTo(submenuComp, 'after'); - Transitioning.progressTo(menu, 'current'); - }, - navigateOnHover: false, - highlightImmediately: true, - data: dataset.tmenu, - markers: { - backgroundMenu: resolve('styles-background-menu'), - menu: resolve('styles-menu'), - selectedMenu: resolve('styles-selected-menu'), - item: resolve('styles-item'), - selectedItem: resolve('styles-selected-item') - } - })); - return memMenu.asSpec(); + var dataset = convert$1(settings.formats, function () { + return memMenu; + }); + var memMenu = record(tieredMenu.sketch({ + dom: { + tag: 'div', + classes: [resolve('styles-menu')] + }, + components: [], + fakeFocus: true, + stayInDom: true, + onExecute: function (_tmenu, item) { + var v = Representing.getValue(item); + settings.handle(item, v.value); + return Optional.none(); + }, + onEscape: function () { + return Optional.none(); + }, + onOpenMenu: function (container, menu) { + var w = get$8(container.element); + set$4(menu.element, w); + Transitioning.jumpTo(menu, 'current'); + }, + onOpenSubmenu: function (container, item, submenu) { + var w = get$8(container.element); + var menu = ancestor$2(item.element, '[role="menu"]').getOrDie('hacky'); + var menuComp = container.getSystem().getByDom(menu).getOrDie(); + set$4(submenu.element, w); + Transitioning.progressTo(menuComp, 'before'); + Transitioning.jumpTo(submenu, 'after'); + Transitioning.progressTo(submenu, 'current'); + }, + onCollapseMenu: function (container, item, menu) { + var submenu = ancestor$2(item.element, '[role="menu"]').getOrDie('hacky'); + var submenuComp = container.getSystem().getByDom(submenu).getOrDie(); + Transitioning.progressTo(submenuComp, 'after'); + Transitioning.progressTo(menu, 'current'); + }, + navigateOnHover: false, + highlightImmediately: true, + data: dataset.tmenu, + markers: { + backgroundMenu: resolve('styles-background-menu'), + menu: resolve('styles-menu'), + selectedMenu: resolve('styles-selected-menu'), + item: resolve('styles-item'), + selectedItem: resolve('styles-selected-item') + } + })); + return memMenu.asSpec(); }; var getFromExpandingItem = function (item) { - var newItem = deepMerge(exclude$1(item, ['items']), {menu: true}); - var rest = expand(item.items); - var newMenus = deepMerge(rest.menus, wrap$1(item.title, rest.items)); - var newExpansions = deepMerge(rest.expansions, wrap$1(item.title, item.title)); - return { - item: newItem, - menus: newMenus, - expansions: newExpansions - }; + var newItem = deepMerge(exclude$1(item, ['items']), { menu: true }); + var rest = expand(item.items); + var newMenus = deepMerge(rest.menus, wrap$1(item.title, rest.items)); + var newExpansions = deepMerge(rest.expansions, wrap$1(item.title, item.title)); + return { + item: newItem, + menus: newMenus, + expansions: newExpansions + }; }; var getFromItem = function (item) { - return hasNonNullableKey(item, 'items') ? getFromExpandingItem(item) : { - item: item, - menus: {}, - expansions: {} - }; + return hasNonNullableKey(item, 'items') ? getFromExpandingItem(item) : { + item: item, + menus: {}, + expansions: {} + }; }; var expand = function (items) { - return foldr(items, function (acc, item) { - var newData = getFromItem(item); - return { - menus: deepMerge(acc.menus, newData.menus), - items: [newData.item].concat(acc.items), - expansions: deepMerge(acc.expansions, newData.expansions) - }; - }, { - menus: {}, - expansions: {}, - items: [] - }); + return foldr(items, function (acc, item) { + var newData = getFromItem(item); + return { + menus: deepMerge(acc.menus, newData.menus), + items: [newData.item].concat(acc.items), + expansions: deepMerge(acc.expansions, newData.expansions) + }; + }, { + menus: {}, + expansions: {}, + items: [] + }); }; var register$1 = function (editor) { - var isSelectedFor = function (format) { - return function () { - return editor.formatter.match(format); - }; - }; - var getPreview = function (format) { - return function () { - return editor.formatter.getCssText(format); - }; - }; - var enrichSupported = function (item) { - return deepMerge(item, { - isSelected: isSelectedFor(item.format), - getPreview: getPreview(item.format) - }); - }; - var enrichMenu = function (item) { - return deepMerge(item, { - isSelected: never, - getPreview: constant('') - }); - }; - var enrichCustom = function (item) { - var formatName = generate$1(item.title); - var newItem = deepMerge(item, { - format: formatName, - isSelected: isSelectedFor(formatName), - getPreview: getPreview(formatName) - }); - editor.formatter.register(formatName, newItem); - return newItem; - }; - var doEnrich = function (items) { - return map(items, function (item) { - if (hasNonNullableKey(item, 'items')) { - var newItems = doEnrich(item.items); - return deepMerge(enrichMenu(item), {items: newItems}); - } else if (hasNonNullableKey(item, 'format')) { - return enrichSupported(item); - } else { - return enrichCustom(item); - } - }); + var isSelectedFor = function (format) { + return function () { + return editor.formatter.match(format); }; - return doEnrich(getStyleFormats(editor)); + }; + var getPreview = function (format) { + return function () { + return editor.formatter.getCssText(format); + }; + }; + var enrichSupported = function (item) { + return deepMerge(item, { + isSelected: isSelectedFor(item.format), + getPreview: getPreview(item.format) + }); + }; + var enrichMenu = function (item) { + return deepMerge(item, { + isSelected: never, + getPreview: constant('') + }); + }; + var enrichCustom = function (item) { + var formatName = generate$1(item.title); + var newItem = deepMerge(item, { + format: formatName, + isSelected: isSelectedFor(formatName), + getPreview: getPreview(formatName) + }); + editor.formatter.register(formatName, newItem); + return newItem; + }; + var doEnrich = function (items) { + return map(items, function (item) { + if (hasNonNullableKey(item, 'items')) { + var newItems = doEnrich(item.items); + return deepMerge(enrichMenu(item), { items: newItems }); + } else if (hasNonNullableKey(item, 'format')) { + return enrichSupported(item); + } else { + return enrichCustom(item); + } + }); + }; + return doEnrich(getStyleFormats(editor)); }; var prune = function (editor, formats) { - var doPrune = function (items) { - return bind(items, function (item) { - if (item.items !== undefined) { - var newItems = doPrune(item.items); - return newItems.length > 0 ? [item] : []; - } else { - var keep = hasNonNullableKey(item, 'format') ? editor.formatter.canApply(item.format) : true; - return keep ? [item] : []; - } - }); - }; - var prunedItems = doPrune(formats); - return expand(prunedItems); + var doPrune = function (items) { + return bind(items, function (item) { + if (item.items !== undefined) { + var newItems = doPrune(item.items); + return newItems.length > 0 ? [item] : []; + } else { + var keep = hasNonNullableKey(item, 'format') ? editor.formatter.canApply(item.format) : true; + return keep ? [item] : []; + } + }); + }; + var prunedItems = doPrune(formats); + return expand(prunedItems); }; var ui = function (editor, formats, onDone) { - var pruned = prune(editor, formats); - return sketch$8({ - formats: pruned, - handle: function (item, value) { - editor.undoManager.transact(function () { - if (Toggling.isOn(item)) { - editor.formatter.remove(value); - } else { - editor.formatter.apply(value); - } - }); - onDone(); + var pruned = prune(editor, formats); + return sketch$8({ + formats: pruned, + handle: function (item, value) { + editor.undoManager.transact(function () { + if (Toggling.isOn(item)) { + editor.formatter.remove(value); + } else { + editor.formatter.apply(value); } - }); + }); + onDone(); + } + }); }; var extract$1 = function (rawToolbar) { - var toolbar = rawToolbar.replace(/\|/g, ' ').trim(); - return toolbar.length > 0 ? toolbar.split(/\s+/) : []; + var toolbar = rawToolbar.replace(/\|/g, ' ').trim(); + return toolbar.length > 0 ? toolbar.split(/\s+/) : []; }; var identifyFromArray = function (toolbar) { - return bind(toolbar, function (item) { - return isArray(item) ? identifyFromArray(item) : extract$1(item); - }); + return bind(toolbar, function (item) { + return isArray(item) ? identifyFromArray(item) : extract$1(item); + }); }; var identify = function (editor) { - var toolbar = getToolbar(editor); - return isArray(toolbar) ? identifyFromArray(toolbar) : extract$1(toolbar); + var toolbar = getToolbar(editor); + return isArray(toolbar) ? identifyFromArray(toolbar) : extract$1(toolbar); }; var setup = function (realm, editor) { - var commandSketch = function (name) { - return function () { - return forToolbarCommand(editor, name); - }; - }; - var stateCommandSketch = function (name) { - return function () { - return forToolbarStateCommand(editor, name); - }; - }; - var actionSketch = function (name, query, action) { - return function () { - return forToolbarStateAction(editor, name, query, action); - }; - }; - var undo = commandSketch('undo'); - var redo = commandSketch('redo'); - var bold = stateCommandSketch('bold'); - var italic = stateCommandSketch('italic'); - var underline = stateCommandSketch('underline'); - var removeformat = commandSketch('removeformat'); - var link = function () { - return sketch$7(realm, editor); - }; - var unlink = actionSketch('unlink', 'link', function () { - editor.execCommand('unlink', null, false); - }); - var image = function () { - return sketch$4(editor); - }; - var bullist = actionSketch('unordered-list', 'ul', function () { - editor.execCommand('InsertUnorderedList', null, false); - }); - var numlist = actionSketch('ordered-list', 'ol', function () { - editor.execCommand('InsertOrderedList', null, false); - }); - var fontsizeselect = function () { - return sketch$3(realm, editor); - }; - var forecolor = function () { - return sketch$1(realm, editor); - }; - var styleFormats = register$1(editor); - var styleFormatsMenu = function () { - return ui(editor, styleFormats, function () { - editor.fire('scrollIntoView'); - }); - }; - var styleselect = function () { - return forToolbar('style-formats', function (button) { - editor.fire('toReading'); - realm.dropup.appear(styleFormatsMenu, Toggling.on, button); - }, derive$1([ - Toggling.config({ - toggleClass: resolve('toolbar-button-selected'), - toggleOnExecute: false, - aria: {mode: 'pressed'} - }), - Receiving.config({ - channels: wrapAll$1([ - receive$1(orientationChanged, Toggling.off), - receive$1(dropupDismissed, Toggling.off) - ]) - }) - ]), editor); + var commandSketch = function (name) { + return function () { + return forToolbarCommand(editor, name); }; - var feature = function (prereq, sketch) { - return { - isSupported: function () { - var buttons = editor.ui.registry.getAll().buttons; - return prereq.forall(function (p) { - return hasNonNullableKey(buttons, p); - }); - }, - sketch: sketch - }; + }; + var stateCommandSketch = function (name) { + return function () { + return forToolbarStateCommand(editor, name); }; + }; + var actionSketch = function (name, query, action) { + return function () { + return forToolbarStateAction(editor, name, query, action); + }; + }; + var undo = commandSketch('undo'); + var redo = commandSketch('redo'); + var bold = stateCommandSketch('bold'); + var italic = stateCommandSketch('italic'); + var underline = stateCommandSketch('underline'); + var removeformat = commandSketch('removeformat'); + var link = function () { + return sketch$7(realm, editor); + }; + var unlink = actionSketch('unlink', 'link', function () { + editor.execCommand('unlink', null, false); + }); + var image = function () { + return sketch$4(editor); + }; + var bullist = actionSketch('unordered-list', 'ul', function () { + editor.execCommand('InsertUnorderedList', null, false); + }); + var numlist = actionSketch('ordered-list', 'ol', function () { + editor.execCommand('InsertOrderedList', null, false); + }); + var fontsizeselect = function () { + return sketch$3(realm, editor); + }; + var forecolor = function () { + return sketch$1(realm, editor); + }; + var styleFormats = register$1(editor); + var styleFormatsMenu = function () { + return ui(editor, styleFormats, function () { + editor.fire('scrollIntoView'); + }); + }; + var styleselect = function () { + return forToolbar('style-formats', function (button) { + editor.fire('toReading'); + realm.dropup.appear(styleFormatsMenu, Toggling.on, button); + }, derive$1([ + Toggling.config({ + toggleClass: resolve('toolbar-button-selected'), + toggleOnExecute: false, + aria: { mode: 'pressed' } + }), + Receiving.config({ + channels: wrapAll$1([ + receive$1(orientationChanged, Toggling.off), + receive$1(dropupDismissed, Toggling.off) + ]) + }) + ]), editor); + }; + var feature = function (prereq, sketch) { return { - undo: feature(Optional.none(), undo), - redo: feature(Optional.none(), redo), - bold: feature(Optional.none(), bold), - italic: feature(Optional.none(), italic), - underline: feature(Optional.none(), underline), - removeformat: feature(Optional.none(), removeformat), - link: feature(Optional.none(), link), - unlink: feature(Optional.none(), unlink), - image: feature(Optional.none(), image), - bullist: feature(Optional.some('bullist'), bullist), - numlist: feature(Optional.some('numlist'), numlist), - fontsizeselect: feature(Optional.none(), fontsizeselect), - forecolor: feature(Optional.none(), forecolor), - styleselect: feature(Optional.none(), styleselect) - }; + isSupported: function () { + var buttons = editor.ui.registry.getAll().buttons; + return prereq.forall(function (p) { + return hasNonNullableKey(buttons, p); + }); + }, + sketch: sketch + }; + }; + return { + undo: feature(Optional.none(), undo), + redo: feature(Optional.none(), redo), + bold: feature(Optional.none(), bold), + italic: feature(Optional.none(), italic), + underline: feature(Optional.none(), underline), + removeformat: feature(Optional.none(), removeformat), + link: feature(Optional.none(), link), + unlink: feature(Optional.none(), unlink), + image: feature(Optional.none(), image), + bullist: feature(Optional.some('bullist'), bullist), + numlist: feature(Optional.some('numlist'), numlist), + fontsizeselect: feature(Optional.none(), fontsizeselect), + forecolor: feature(Optional.none(), forecolor), + styleselect: feature(Optional.none(), styleselect) + }; }; var detect$4 = function (editor, features) { - var itemNames = identify(editor); - var present = {}; - return bind(itemNames, function (iName) { - var r = !hasNonNullableKey(present, iName) && hasNonNullableKey(features, iName) && features[iName].isSupported() ? [features[iName].sketch()] : []; - present[iName] = true; - return r; - }); + var itemNames = identify(editor); + var present = {}; + return bind(itemNames, function (iName) { + var r = !hasNonNullableKey(present, iName) && hasNonNullableKey(features, iName) && features[iName].isSupported() ? [features[iName].sketch()] : []; + present[iName] = true; + return r; + }); }; var mkEvent = function (target, x, y, stop, prevent, kill, raw) { - return { - target: target, - x: x, - y: y, - stop: stop, - prevent: prevent, - kill: kill, - raw: raw - }; + return { + target: target, + x: x, + y: y, + stop: stop, + prevent: prevent, + kill: kill, + raw: raw + }; }; var fromRawEvent = function (rawEvent) { - var target = SugarElement.fromDom(getOriginalEventTarget(rawEvent).getOr(rawEvent.target)); - var stop = function () { - return rawEvent.stopPropagation(); - }; - var prevent = function () { - return rawEvent.preventDefault(); - }; - var kill = compose(prevent, stop); - return mkEvent(target, rawEvent.clientX, rawEvent.clientY, stop, prevent, kill, rawEvent); + var target = SugarElement.fromDom(getOriginalEventTarget(rawEvent).getOr(rawEvent.target)); + var stop = function () { + return rawEvent.stopPropagation(); + }; + var prevent = function () { + return rawEvent.preventDefault(); + }; + var kill = compose(prevent, stop); + return mkEvent(target, rawEvent.clientX, rawEvent.clientY, stop, prevent, kill, rawEvent); }; var handle = function (filter, handler) { - return function (rawEvent) { - if (filter(rawEvent)) { - handler(fromRawEvent(rawEvent)); - } - }; + return function (rawEvent) { + if (filter(rawEvent)) { + handler(fromRawEvent(rawEvent)); + } + }; }; var binder = function (element, event, filter, handler, useCapture) { - var wrapped = handle(filter, handler); - element.dom.addEventListener(event, wrapped, useCapture); - return {unbind: curry(unbind, element, event, wrapped, useCapture)}; + var wrapped = handle(filter, handler); + element.dom.addEventListener(event, wrapped, useCapture); + return { unbind: curry(unbind, element, event, wrapped, useCapture) }; }; var bind$2 = function (element, event, filter, handler) { - return binder(element, event, filter, handler, false); + return binder(element, event, filter, handler, false); }; var capture = function (element, event, filter, handler) { - return binder(element, event, filter, handler, true); + return binder(element, event, filter, handler, true); }; var unbind = function (element, event, handler, useCapture) { - element.dom.removeEventListener(event, handler, useCapture); + element.dom.removeEventListener(event, handler, useCapture); }; var filter$2 = always; var bind$3 = function (element, event, handler) { - return bind$2(element, event, filter$2, handler); + return bind$2(element, event, filter$2, handler); }; var capture$1 = function (element, event, handler) { - return capture(element, event, filter$2, handler); + return capture(element, event, filter$2, handler); }; var global$4 = tinymce.util.Tools.resolve('tinymce.util.Delay'); @@ -9668,543 +9646,543 @@ var INTERVAL = 50; var INSURANCE = 1000 / INTERVAL; var get$c = function (outerWindow) { - var isPortrait = outerWindow.matchMedia('(orientation: portrait)').matches; - return {isPortrait: constant(isPortrait)}; + var isPortrait = outerWindow.matchMedia('(orientation: portrait)').matches; + return { isPortrait: constant(isPortrait) }; }; var getActualWidth = function (outerWindow) { - var isIos = detect$3().os.isiOS(); - var isPortrait = get$c(outerWindow).isPortrait(); - return isIos && !isPortrait ? outerWindow.screen.height : outerWindow.screen.width; + var isIos = detect$3().os.isiOS(); + var isPortrait = get$c(outerWindow).isPortrait(); + return isIos && !isPortrait ? outerWindow.screen.height : outerWindow.screen.width; }; var onChange = function (outerWindow, listeners) { - var win = SugarElement.fromDom(outerWindow); - var poller = null; - var change = function () { + var win = SugarElement.fromDom(outerWindow); + var poller = null; + var change = function () { + global$4.clearInterval(poller); + var orientation = get$c(outerWindow); + listeners.onChange(orientation); + onAdjustment(function () { + listeners.onReady(orientation); + }); + }; + var orientationHandle = bind$3(win, 'orientationchange', change); + var onAdjustment = function (f) { + global$4.clearInterval(poller); + var flag = outerWindow.innerHeight; + var insurance = 0; + poller = global$4.setInterval(function () { + if (flag !== outerWindow.innerHeight) { global$4.clearInterval(poller); - var orientation = get$c(outerWindow); - listeners.onChange(orientation); - onAdjustment(function () { - listeners.onReady(orientation); - }); - }; - var orientationHandle = bind$3(win, 'orientationchange', change); - var onAdjustment = function (f) { + f(Optional.some(outerWindow.innerHeight)); + } else if (insurance > INSURANCE) { global$4.clearInterval(poller); - var flag = outerWindow.innerHeight; - var insurance = 0; - poller = global$4.setInterval(function () { - if (flag !== outerWindow.innerHeight) { - global$4.clearInterval(poller); - f(Optional.some(outerWindow.innerHeight)); - } else if (insurance > INSURANCE) { - global$4.clearInterval(poller); - f(Optional.none()); - } - insurance++; - }, INTERVAL); - }; - var destroy = function () { - orientationHandle.unbind(); - }; - return { - onAdjustment: onAdjustment, - destroy: destroy - }; + f(Optional.none()); + } + insurance++; + }, INTERVAL); + }; + var destroy = function () { + orientationHandle.unbind(); + }; + return { + onAdjustment: onAdjustment, + destroy: destroy + }; }; var setStart = function (rng, situ) { - situ.fold(function (e) { - rng.setStartBefore(e.dom); - }, function (e, o) { - rng.setStart(e.dom, o); - }, function (e) { - rng.setStartAfter(e.dom); - }); + situ.fold(function (e) { + rng.setStartBefore(e.dom); + }, function (e, o) { + rng.setStart(e.dom, o); + }, function (e) { + rng.setStartAfter(e.dom); + }); }; var setFinish = function (rng, situ) { - situ.fold(function (e) { - rng.setEndBefore(e.dom); - }, function (e, o) { - rng.setEnd(e.dom, o); - }, function (e) { - rng.setEndAfter(e.dom); - }); + situ.fold(function (e) { + rng.setEndBefore(e.dom); + }, function (e, o) { + rng.setEnd(e.dom, o); + }, function (e) { + rng.setEndAfter(e.dom); + }); }; var relativeToNative = function (win, startSitu, finishSitu) { - var range = win.document.createRange(); - setStart(range, startSitu); - setFinish(range, finishSitu); - return range; + var range = win.document.createRange(); + setStart(range, startSitu); + setFinish(range, finishSitu); + return range; }; var exactToNative = function (win, start, soffset, finish, foffset) { - var rng = win.document.createRange(); - rng.setStart(start.dom, soffset); - rng.setEnd(finish.dom, foffset); - return rng; + var rng = win.document.createRange(); + rng.setStart(start.dom, soffset); + rng.setEnd(finish.dom, foffset); + return rng; }; var toRect = function (rect) { - return { - left: rect.left, - top: rect.top, - right: rect.right, - bottom: rect.bottom, - width: rect.width, - height: rect.height - }; + return { + left: rect.left, + top: rect.top, + right: rect.right, + bottom: rect.bottom, + width: rect.width, + height: rect.height + }; }; var getFirstRect = function (rng) { - var rects = rng.getClientRects(); - var rect = rects.length > 0 ? rects[0] : rng.getBoundingClientRect(); - return rect.width > 0 || rect.height > 0 ? Optional.some(rect).map(toRect) : Optional.none(); + var rects = rng.getClientRects(); + var rect = rects.length > 0 ? rects[0] : rng.getBoundingClientRect(); + return rect.width > 0 || rect.height > 0 ? Optional.some(rect).map(toRect) : Optional.none(); }; var adt$4 = Adt.generate([ - { - ltr: [ - 'start', - 'soffset', - 'finish', - 'foffset' - ] - }, - { - rtl: [ - 'start', - 'soffset', - 'finish', - 'foffset' - ] - } + { + ltr: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + }, + { + rtl: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + } ]); var fromRange = function (win, type, range) { - return type(SugarElement.fromDom(range.startContainer), range.startOffset, SugarElement.fromDom(range.endContainer), range.endOffset); + return type(SugarElement.fromDom(range.startContainer), range.startOffset, SugarElement.fromDom(range.endContainer), range.endOffset); }; var getRanges = function (win, selection) { - return selection.match({ - domRange: function (rng) { - return { - ltr: constant(rng), - rtl: Optional.none - }; - }, - relative: function (startSitu, finishSitu) { - return { - ltr: cached(function () { - return relativeToNative(win, startSitu, finishSitu); - }), - rtl: cached(function () { - return Optional.some(relativeToNative(win, finishSitu, startSitu)); - }) - }; - }, - exact: function (start, soffset, finish, foffset) { - return { - ltr: cached(function () { - return exactToNative(win, start, soffset, finish, foffset); - }), - rtl: cached(function () { - return Optional.some(exactToNative(win, finish, foffset, start, soffset)); - }) - }; - } - }); + return selection.match({ + domRange: function (rng) { + return { + ltr: constant(rng), + rtl: Optional.none + }; + }, + relative: function (startSitu, finishSitu) { + return { + ltr: cached(function () { + return relativeToNative(win, startSitu, finishSitu); + }), + rtl: cached(function () { + return Optional.some(relativeToNative(win, finishSitu, startSitu)); + }) + }; + }, + exact: function (start, soffset, finish, foffset) { + return { + ltr: cached(function () { + return exactToNative(win, start, soffset, finish, foffset); + }), + rtl: cached(function () { + return Optional.some(exactToNative(win, finish, foffset, start, soffset)); + }) + }; + } + }); }; var doDiagnose = function (win, ranges) { - var rng = ranges.ltr(); - if (rng.collapsed) { - var reversed = ranges.rtl().filter(function (rev) { - return rev.collapsed === false; - }); - return reversed.map(function (rev) { - return adt$4.rtl(SugarElement.fromDom(rev.endContainer), rev.endOffset, SugarElement.fromDom(rev.startContainer), rev.startOffset); - }).getOrThunk(function () { - return fromRange(win, adt$4.ltr, rng); - }); - } else { - return fromRange(win, adt$4.ltr, rng); - } + var rng = ranges.ltr(); + if (rng.collapsed) { + var reversed = ranges.rtl().filter(function (rev) { + return rev.collapsed === false; + }); + return reversed.map(function (rev) { + return adt$4.rtl(SugarElement.fromDom(rev.endContainer), rev.endOffset, SugarElement.fromDom(rev.startContainer), rev.startOffset); + }).getOrThunk(function () { + return fromRange(win, adt$4.ltr, rng); + }); + } else { + return fromRange(win, adt$4.ltr, rng); + } }; var diagnose = function (win, selection) { - var ranges = getRanges(win, selection); - return doDiagnose(win, ranges); + var ranges = getRanges(win, selection); + return doDiagnose(win, ranges); }; var asLtrRange = function (win, selection) { - var diagnosis = diagnose(win, selection); - return diagnosis.match({ - ltr: function (start, soffset, finish, foffset) { - var rng = win.document.createRange(); - rng.setStart(start.dom, soffset); - rng.setEnd(finish.dom, foffset); - return rng; - }, - rtl: function (start, soffset, finish, foffset) { - var rng = win.document.createRange(); - rng.setStart(finish.dom, foffset); - rng.setEnd(start.dom, soffset); - return rng; - } - }); + var diagnosis = diagnose(win, selection); + return diagnosis.match({ + ltr: function (start, soffset, finish, foffset) { + var rng = win.document.createRange(); + rng.setStart(start.dom, soffset); + rng.setEnd(finish.dom, foffset); + return rng; + }, + rtl: function (start, soffset, finish, foffset) { + var rng = win.document.createRange(); + rng.setStart(finish.dom, foffset); + rng.setEnd(start.dom, soffset); + return rng; + } + }); }; var ltr = adt$4.ltr; var rtl = adt$4.rtl; var create$3 = function (start, soffset, finish, foffset) { - return { - start: start, - soffset: soffset, - finish: finish, - foffset: foffset - }; - }; - var SimRange = {create: create$3}; - - function NodeValue(is, name) { - var get = function (element) { - if (!is(element)) { - throw new Error('Can only get ' + name + ' value of a ' + name + ' node'); - } - return getOption(element).getOr(''); - }; - var getOption = function (element) { - return is(element) ? Optional.from(element.dom.nodeValue) : Optional.none(); - }; - var set = function (element, value) { - if (!is(element)) { - throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node'); - } - element.dom.nodeValue = value; - }; - return { - get: get, - getOption: getOption, - set: set - }; + return { + start: start, + soffset: soffset, + finish: finish, + foffset: foffset + }; + }; + var SimRange = { create: create$3 }; + + function NodeValue (is, name) { + var get = function (element) { + if (!is(element)) { + throw new Error('Can only get ' + name + ' value of a ' + name + ' node'); + } + return getOption(element).getOr(''); + }; + var getOption = function (element) { + return is(element) ? Optional.from(element.dom.nodeValue) : Optional.none(); + }; + var set = function (element, value) { + if (!is(element)) { + throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node'); + } + element.dom.nodeValue = value; + }; + return { + get: get, + getOption: getOption, + set: set + }; } var api$3 = NodeValue(isText, 'text'); var getOption = function (element) { - return api$3.getOption(element); + return api$3.getOption(element); }; var getEnd = function (element) { - return name(element) === 'img' ? 1 : getOption(element).fold(function () { - return children(element).length; - }, function (v) { - return v.length; - }); + return name(element) === 'img' ? 1 : getOption(element).fold(function () { + return children(element).length; + }, function (v) { + return v.length; + }); }; var adt$5 = Adt.generate([ - {before: ['element']}, - { - on: [ - 'element', - 'offset' - ] - }, - {after: ['element']} + { before: ['element'] }, + { + on: [ + 'element', + 'offset' + ] + }, + { after: ['element'] } ]); var cata = function (subject, onBefore, onOn, onAfter) { - return subject.fold(onBefore, onOn, onAfter); + return subject.fold(onBefore, onOn, onAfter); }; var getStart = function (situ) { - return situ.fold(identity, identity, identity); + return situ.fold(identity, identity, identity); }; var before$1 = adt$5.before; var on$1 = adt$5.on; var after$1 = adt$5.after; var Situ = { - before: before$1, - on: on$1, - after: after$1, - cata: cata, - getStart: getStart + before: before$1, + on: on$1, + after: after$1, + cata: cata, + getStart: getStart }; var adt$6 = Adt.generate([ - {domRange: ['rng']}, - { - relative: [ - 'startSitu', - 'finishSitu' - ] - }, - { - exact: [ - 'start', - 'soffset', - 'finish', - 'foffset' - ] - } + { domRange: ['rng'] }, + { + relative: [ + 'startSitu', + 'finishSitu' + ] + }, + { + exact: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + } ]); var exactFromRange = function (simRange) { - return adt$6.exact(simRange.start, simRange.soffset, simRange.finish, simRange.foffset); + return adt$6.exact(simRange.start, simRange.soffset, simRange.finish, simRange.foffset); }; var getStart$1 = function (selection) { - return selection.match({ - domRange: function (rng) { - return SugarElement.fromDom(rng.startContainer); - }, - relative: function (startSitu, _finishSitu) { - return Situ.getStart(startSitu); - }, - exact: function (start, _soffset, _finish, _foffset) { - return start; - } - }); + return selection.match({ + domRange: function (rng) { + return SugarElement.fromDom(rng.startContainer); + }, + relative: function (startSitu, _finishSitu) { + return Situ.getStart(startSitu); + }, + exact: function (start, _soffset, _finish, _foffset) { + return start; + } + }); }; var domRange = adt$6.domRange; var relative = adt$6.relative; var exact = adt$6.exact; var getWin = function (selection) { - var start = getStart$1(selection); - return defaultView(start); + var start = getStart$1(selection); + return defaultView(start); }; var range$1 = SimRange.create; var SimSelection = { - domRange: domRange, - relative: relative, - exact: exact, - exactFromRange: exactFromRange, - getWin: getWin, - range: range$1 + domRange: domRange, + relative: relative, + exact: exact, + exactFromRange: exactFromRange, + getWin: getWin, + range: range$1 }; var beforeSpecial = function (element, offset) { - var name$1 = name(element); - if ('input' === name$1) { - return Situ.after(element); - } else if (!contains([ - 'br', - 'img' + var name$1 = name(element); + if ('input' === name$1) { + return Situ.after(element); + } else if (!contains([ + 'br', + 'img' ], name$1)) { - return Situ.on(element, offset); - } else { - return offset === 0 ? Situ.before(element) : Situ.after(element); - } + return Situ.on(element, offset); + } else { + return offset === 0 ? Situ.before(element) : Situ.after(element); + } }; var preprocessExact = function (start, soffset, finish, foffset) { - var startSitu = beforeSpecial(start, soffset); - var finishSitu = beforeSpecial(finish, foffset); - return SimSelection.relative(startSitu, finishSitu); + var startSitu = beforeSpecial(start, soffset); + var finishSitu = beforeSpecial(finish, foffset); + return SimSelection.relative(startSitu, finishSitu); }; var makeRange = function (start, soffset, finish, foffset) { - var doc = owner(start); - var rng = doc.dom.createRange(); - rng.setStart(start.dom, soffset); - rng.setEnd(finish.dom, foffset); - return rng; + var doc = owner(start); + var rng = doc.dom.createRange(); + rng.setStart(start.dom, soffset); + rng.setEnd(finish.dom, foffset); + return rng; }; var after$2 = function (start, soffset, finish, foffset) { - var r = makeRange(start, soffset, finish, foffset); - var same = eq(start, finish) && soffset === foffset; - return r.collapsed && !same; + var r = makeRange(start, soffset, finish, foffset); + var same = eq(start, finish) && soffset === foffset; + return r.collapsed && !same; }; var getNativeSelection = function (win) { - return Optional.from(win.getSelection()); + return Optional.from(win.getSelection()); }; var doSetNativeRange = function (win, rng) { - getNativeSelection(win).each(function (selection) { - selection.removeAllRanges(); - selection.addRange(rng); - }); + getNativeSelection(win).each(function (selection) { + selection.removeAllRanges(); + selection.addRange(rng); + }); }; var doSetRange = function (win, start, soffset, finish, foffset) { - var rng = exactToNative(win, start, soffset, finish, foffset); - doSetNativeRange(win, rng); + var rng = exactToNative(win, start, soffset, finish, foffset); + doSetNativeRange(win, rng); }; var setLegacyRtlRange = function (win, selection, start, soffset, finish, foffset) { - selection.collapse(start.dom, soffset); - selection.extend(finish.dom, foffset); + selection.collapse(start.dom, soffset); + selection.extend(finish.dom, foffset); }; var setRangeFromRelative = function (win, relative) { - return diagnose(win, relative).match({ - ltr: function (start, soffset, finish, foffset) { - doSetRange(win, start, soffset, finish, foffset); - }, - rtl: function (start, soffset, finish, foffset) { - getNativeSelection(win).each(function (selection) { - if (selection.setBaseAndExtent) { - selection.setBaseAndExtent(start.dom, soffset, finish.dom, foffset); - } else if (selection.extend) { - try { - setLegacyRtlRange(win, selection, start, soffset, finish, foffset); - } catch (e) { - doSetRange(win, finish, foffset, start, soffset); - } - } else { - doSetRange(win, finish, foffset, start, soffset); - } - }); + return diagnose(win, relative).match({ + ltr: function (start, soffset, finish, foffset) { + doSetRange(win, start, soffset, finish, foffset); + }, + rtl: function (start, soffset, finish, foffset) { + getNativeSelection(win).each(function (selection) { + if (selection.setBaseAndExtent) { + selection.setBaseAndExtent(start.dom, soffset, finish.dom, foffset); + } else if (selection.extend) { + try { + setLegacyRtlRange(win, selection, start, soffset, finish, foffset); + } catch (e) { + doSetRange(win, finish, foffset, start, soffset); + } + } else { + doSetRange(win, finish, foffset, start, soffset); } - }); + }); + } + }); }; var setExact = function (win, start, soffset, finish, foffset) { - var relative = preprocessExact(start, soffset, finish, foffset); - setRangeFromRelative(win, relative); + var relative = preprocessExact(start, soffset, finish, foffset); + setRangeFromRelative(win, relative); }; var readRange = function (selection) { - if (selection.rangeCount > 0) { - var firstRng = selection.getRangeAt(0); - var lastRng = selection.getRangeAt(selection.rangeCount - 1); - return Optional.some(SimRange.create(SugarElement.fromDom(firstRng.startContainer), firstRng.startOffset, SugarElement.fromDom(lastRng.endContainer), lastRng.endOffset)); - } else { - return Optional.none(); - } + if (selection.rangeCount > 0) { + var firstRng = selection.getRangeAt(0); + var lastRng = selection.getRangeAt(selection.rangeCount - 1); + return Optional.some(SimRange.create(SugarElement.fromDom(firstRng.startContainer), firstRng.startOffset, SugarElement.fromDom(lastRng.endContainer), lastRng.endOffset)); + } else { + return Optional.none(); + } }; var doGetExact = function (selection) { - if (selection.anchorNode === null || selection.focusNode === null) { - return readRange(selection); - } else { - var anchor = SugarElement.fromDom(selection.anchorNode); - var focus_1 = SugarElement.fromDom(selection.focusNode); - return after$2(anchor, selection.anchorOffset, focus_1, selection.focusOffset) ? Optional.some(SimRange.create(anchor, selection.anchorOffset, focus_1, selection.focusOffset)) : readRange(selection); - } + if (selection.anchorNode === null || selection.focusNode === null) { + return readRange(selection); + } else { + var anchor = SugarElement.fromDom(selection.anchorNode); + var focus_1 = SugarElement.fromDom(selection.focusNode); + return after$2(anchor, selection.anchorOffset, focus_1, selection.focusOffset) ? Optional.some(SimRange.create(anchor, selection.anchorOffset, focus_1, selection.focusOffset)) : readRange(selection); + } }; var getExact = function (win) { - return getNativeSelection(win).filter(function (sel) { - return sel.rangeCount > 0; - }).bind(doGetExact); + return getNativeSelection(win).filter(function (sel) { + return sel.rangeCount > 0; + }).bind(doGetExact); }; var get$d = function (win) { - return getExact(win).map(function (range) { - return SimSelection.exact(range.start, range.soffset, range.finish, range.foffset); - }); + return getExact(win).map(function (range) { + return SimSelection.exact(range.start, range.soffset, range.finish, range.foffset); + }); }; var getFirstRect$1 = function (win, selection) { - var rng = asLtrRange(win, selection); - return getFirstRect(rng); + var rng = asLtrRange(win, selection); + return getFirstRect(rng); }; var clear$1 = function (win) { - getNativeSelection(win).each(function (selection) { - return selection.removeAllRanges(); - }); + getNativeSelection(win).each(function (selection) { + return selection.removeAllRanges(); + }); }; var getBodyFromFrame = function (frame) { - return Optional.some(SugarElement.fromDom(frame.dom.contentWindow.document.body)); + return Optional.some(SugarElement.fromDom(frame.dom.contentWindow.document.body)); }; var getDocFromFrame = function (frame) { - return Optional.some(SugarElement.fromDom(frame.dom.contentWindow.document)); + return Optional.some(SugarElement.fromDom(frame.dom.contentWindow.document)); }; var getWinFromFrame = function (frame) { - return Optional.from(frame.dom.contentWindow); + return Optional.from(frame.dom.contentWindow); }; var getSelectionFromFrame = function (frame) { - var optWin = getWinFromFrame(frame); - return optWin.bind(getExact); + var optWin = getWinFromFrame(frame); + return optWin.bind(getExact); }; var getFrame = function (editor) { - return editor.getFrame(); + return editor.getFrame(); }; var getOrDerive = function (name, f) { - return function (editor) { - var g = editor[name].getOrThunk(function () { - var frame = getFrame(editor); - return function () { - return f(frame); - }; - }); - return g(); - }; + return function (editor) { + var g = editor[name].getOrThunk(function () { + var frame = getFrame(editor); + return function () { + return f(frame); + }; + }); + return g(); + }; }; var getOrListen = function (editor, doc, name, type) { - return editor[name].getOrThunk(function () { - return function (handler) { - return bind$3(doc, type, handler); - }; - }); + return editor[name].getOrThunk(function () { + return function (handler) { + return bind$3(doc, type, handler); + }; + }); }; var getActiveApi = function (editor) { - var frame = getFrame(editor); - var tryFallbackBox = function (win) { - var isCollapsed = function (sel) { - return eq(sel.start, sel.finish) && sel.soffset === sel.foffset; - }; - var toStartRect = function (sel) { - var rect = sel.start.dom.getBoundingClientRect(); - return rect.width > 0 || rect.height > 0 ? Optional.some(rect) : Optional.none(); - }; - return getExact(win).filter(isCollapsed).bind(toStartRect); - }; - return getBodyFromFrame(frame).bind(function (body) { - return getDocFromFrame(frame).bind(function (doc) { - return getWinFromFrame(frame).map(function (win) { - var html = SugarElement.fromDom(doc.dom.documentElement); - var getCursorBox = editor.getCursorBox.getOrThunk(function () { - return function () { - return get$d(win).bind(function (sel) { - return getFirstRect$1(win, sel).orThunk(function () { - return tryFallbackBox(win); - }); - }); - }; - }); - var setSelection = editor.setSelection.getOrThunk(function () { - return function (start, soffset, finish, foffset) { - setExact(win, start, soffset, finish, foffset); - }; - }); - var clearSelection = editor.clearSelection.getOrThunk(function () { - return function () { - clear$1(win); - }; - }); - return { - body: body, - doc: doc, - win: win, - html: html, - getSelection: curry(getSelectionFromFrame, frame), - setSelection: setSelection, - clearSelection: clearSelection, - frame: frame, - onKeyup: getOrListen(editor, doc, 'onKeyup', 'keyup'), - onNodeChanged: getOrListen(editor, doc, 'onNodeChanged', 'SelectionChange'), - onDomChanged: editor.onDomChanged, - onScrollToCursor: editor.onScrollToCursor, - onScrollToElement: editor.onScrollToElement, - onToReading: editor.onToReading, - onToEditing: editor.onToEditing, - onToolbarScrollStart: editor.onToolbarScrollStart, - onTouchContent: editor.onTouchContent, - onTapContent: editor.onTapContent, - onTouchToolstrip: editor.onTouchToolstrip, - getCursorBox: getCursorBox - }; + var frame = getFrame(editor); + var tryFallbackBox = function (win) { + var isCollapsed = function (sel) { + return eq(sel.start, sel.finish) && sel.soffset === sel.foffset; + }; + var toStartRect = function (sel) { + var rect = sel.start.dom.getBoundingClientRect(); + return rect.width > 0 || rect.height > 0 ? Optional.some(rect) : Optional.none(); + }; + return getExact(win).filter(isCollapsed).bind(toStartRect); + }; + return getBodyFromFrame(frame).bind(function (body) { + return getDocFromFrame(frame).bind(function (doc) { + return getWinFromFrame(frame).map(function (win) { + var html = SugarElement.fromDom(doc.dom.documentElement); + var getCursorBox = editor.getCursorBox.getOrThunk(function () { + return function () { + return get$d(win).bind(function (sel) { + return getFirstRect$1(win, sel).orThunk(function () { + return tryFallbackBox(win); + }); }); + }; + }); + var setSelection = editor.setSelection.getOrThunk(function () { + return function (start, soffset, finish, foffset) { + setExact(win, start, soffset, finish, foffset); + }; }); + var clearSelection = editor.clearSelection.getOrThunk(function () { + return function () { + clear$1(win); + }; + }); + return { + body: body, + doc: doc, + win: win, + html: html, + getSelection: curry(getSelectionFromFrame, frame), + setSelection: setSelection, + clearSelection: clearSelection, + frame: frame, + onKeyup: getOrListen(editor, doc, 'onKeyup', 'keyup'), + onNodeChanged: getOrListen(editor, doc, 'onNodeChanged', 'SelectionChange'), + onDomChanged: editor.onDomChanged, + onScrollToCursor: editor.onScrollToCursor, + onScrollToElement: editor.onScrollToElement, + onToReading: editor.onToReading, + onToEditing: editor.onToEditing, + onToolbarScrollStart: editor.onToolbarScrollStart, + onTouchContent: editor.onTouchContent, + onTapContent: editor.onTapContent, + onTouchToolstrip: editor.onTouchToolstrip, + getCursorBox: getCursorBox + }; + }); }); + }); }; var getWin$1 = getOrDerive('getWin', getWinFromFrame); var tag = function () { - var head = first('head').getOrDie(); - var nu = function () { - var meta = SugarElement.fromTag('meta'); - set(meta, 'name', 'viewport'); - append(head, meta); - return meta; - }; - var element = first('meta[name="viewport"]').getOrThunk(nu); - var backup = get$2(element, 'content'); - var maximize = function () { - set(element, 'content', 'width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0'); - }; - var restore = function () { - if (backup !== undefined && backup !== null && backup.length > 0) { - set(element, 'content', backup); - } else { - set(element, 'content', 'user-scalable=yes'); - } - }; - return { - maximize: maximize, - restore: restore - }; + var head = first('head').getOrDie(); + var nu = function () { + var meta = SugarElement.fromTag('meta'); + set(meta, 'name', 'viewport'); + append(head, meta); + return meta; + }; + var element = first('meta[name="viewport"]').getOrThunk(nu); + var backup = get$2(element, 'content'); + var maximize = function () { + set(element, 'content', 'width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0'); + }; + var restore = function () { + if (backup !== undefined && backup !== null && backup.length > 0) { + set(element, 'content', backup); + } else { + set(element, 'content', 'user-scalable=yes'); + } + }; + return { + maximize: maximize, + restore: restore + }; }; var attr = 'data-ephox-mobile-fullscreen-style'; @@ -10214,868 +10192,868 @@ var bgFallback = 'background-color:rgb(255,255,255)!important;'; var isAndroid = detect$3().os.isAndroid(); var matchColor = function (editorBody) { - var color = get$5(editorBody, 'background-color'); - return color !== undefined && color !== '' ? 'background-color:' + color + '!important' : bgFallback; + var color = get$5(editorBody, 'background-color'); + return color !== undefined && color !== '' ? 'background-color:' + color + '!important' : bgFallback; }; var clobberStyles = function (container, editorBody) { - var gatherSiblings = function (element) { - return siblings$2(element, '*'); - }; - var clobber = function (clobberStyle) { - return function (element) { - var styles = get$2(element, 'style'); - var backup = styles === undefined ? 'no-styles' : styles.trim(); - if (backup === clobberStyle) { - return; - } else { - set(element, attr, backup); - set(element, 'style', clobberStyle); - } - }; - }; - var ancestors = ancestors$1(container, '*'); - var siblings = bind(ancestors, gatherSiblings); - var bgColor = matchColor(editorBody); - each(siblings, clobber(siblingStyles)); - each(ancestors, clobber(ancestorPosition + ancestorStyles + bgColor)); - var containerStyles = isAndroid === true ? '' : ancestorPosition; - clobber(containerStyles + ancestorStyles + bgColor)(container); + var gatherSiblings = function (element) { + return siblings$2(element, '*'); + }; + var clobber = function (clobberStyle) { + return function (element) { + var styles = get$2(element, 'style'); + var backup = styles === undefined ? 'no-styles' : styles.trim(); + if (backup === clobberStyle) { + return; + } else { + set(element, attr, backup); + set(element, 'style', clobberStyle); + } + }; + }; + var ancestors = ancestors$1(container, '*'); + var siblings = bind(ancestors, gatherSiblings); + var bgColor = matchColor(editorBody); + each(siblings, clobber(siblingStyles)); + each(ancestors, clobber(ancestorPosition + ancestorStyles + bgColor)); + var containerStyles = isAndroid === true ? '' : ancestorPosition; + clobber(containerStyles + ancestorStyles + bgColor)(container); }; var restoreStyles = function () { - var clobberedEls = all$2('[' + attr + ']'); - each(clobberedEls, function (element) { - var restore = get$2(element, attr); - if (restore !== 'no-styles') { - set(element, 'style', restore); - } else { - remove$1(element, 'style'); - } - remove$1(element, attr); - }); + var clobberedEls = all$2('[' + attr + ']'); + each(clobberedEls, function (element) { + var restore = get$2(element, attr); + if (restore !== 'no-styles') { + set(element, 'style', restore); + } else { + remove$1(element, 'style'); + } + remove$1(element, attr); + }); }; - function DelayedFunction(fun, delay) { - var ref = null; - var schedule = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - ref = setTimeout(function () { - fun.apply(null, args); - ref = null; - }, delay); - }; - var cancel = function () { - if (ref !== null) { - clearTimeout(ref); - ref = null; - } - }; - return { - cancel: cancel, - schedule: schedule - }; + function DelayedFunction (fun, delay) { + var ref = null; + var schedule = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + ref = setTimeout(function () { + fun.apply(null, args); + ref = null; + }, delay); + }; + var cancel = function () { + if (ref !== null) { + clearTimeout(ref); + ref = null; + } + }; + return { + cancel: cancel, + schedule: schedule + }; } var SIGNIFICANT_MOVE = 5; var LONGPRESS_DELAY = 400; var getTouch = function (event) { - var raw = event.raw; - if (raw.touches === undefined || raw.touches.length !== 1) { - return Optional.none(); - } - return Optional.some(raw.touches[0]); + var raw = event.raw; + if (raw.touches === undefined || raw.touches.length !== 1) { + return Optional.none(); + } + return Optional.some(raw.touches[0]); }; var isFarEnough = function (touch, data) { - var distX = Math.abs(touch.clientX - data.x); - var distY = Math.abs(touch.clientY - data.y); - return distX > SIGNIFICANT_MOVE || distY > SIGNIFICANT_MOVE; + var distX = Math.abs(touch.clientX - data.x); + var distY = Math.abs(touch.clientY - data.y); + return distX > SIGNIFICANT_MOVE || distY > SIGNIFICANT_MOVE; }; var monitor = function (settings) { - var startData = Cell(Optional.none()); - var longpressFired = Cell(false); - var longpress$1 = DelayedFunction(function (event) { - settings.triggerEvent(longpress(), event); - longpressFired.set(true); - }, LONGPRESS_DELAY); - var handleTouchstart = function (event) { - getTouch(event).each(function (touch) { - longpress$1.cancel(); - var data = { - x: touch.clientX, - y: touch.clientY, - target: event.target - }; - longpress$1.schedule(event); - longpressFired.set(false); - startData.set(Optional.some(data)); - }); - return Optional.none(); - }; - var handleTouchmove = function (event) { - longpress$1.cancel(); - getTouch(event).each(function (touch) { - startData.get().each(function (data) { - if (isFarEnough(touch, data)) { - startData.set(Optional.none()); - } - }); - }); - return Optional.none(); - }; - var handleTouchend = function (event) { - longpress$1.cancel(); - var isSame = function (data) { - return eq(data.target, event.target); - }; - return startData.get().filter(isSame).map(function (_data) { - if (longpressFired.get()) { - event.prevent(); - return false; - } else { - return settings.triggerEvent(tap(), event); - } - }); - }; - var handlers = wrapAll$1([ - { - key: touchstart(), - value: handleTouchstart - }, - { - key: touchmove(), - value: handleTouchmove - }, - { - key: touchend(), - value: handleTouchend + var startData = Cell(Optional.none()); + var longpressFired = Cell(false); + var longpress$1 = DelayedFunction(function (event) { + settings.triggerEvent(longpress(), event); + longpressFired.set(true); + }, LONGPRESS_DELAY); + var handleTouchstart = function (event) { + getTouch(event).each(function (touch) { + longpress$1.cancel(); + var data = { + x: touch.clientX, + y: touch.clientY, + target: event.target + }; + longpress$1.schedule(event); + longpressFired.set(false); + startData.set(Optional.some(data)); + }); + return Optional.none(); + }; + var handleTouchmove = function (event) { + longpress$1.cancel(); + getTouch(event).each(function (touch) { + startData.get().each(function (data) { + if (isFarEnough(touch, data)) { + startData.set(Optional.none()); } - ]); - var fireIfReady = function (event, type) { - return get$1(handlers, type).bind(function (handler) { - return handler(event); - }); - }; - return {fireIfReady: fireIfReady}; + }); + }); + return Optional.none(); + }; + var handleTouchend = function (event) { + longpress$1.cancel(); + var isSame = function (data) { + return eq(data.target, event.target); + }; + return startData.get().filter(isSame).map(function (_data) { + if (longpressFired.get()) { + event.prevent(); + return false; + } else { + return settings.triggerEvent(tap(), event); + } + }); + }; + var handlers = wrapAll$1([ + { + key: touchstart(), + value: handleTouchstart + }, + { + key: touchmove(), + value: handleTouchmove + }, + { + key: touchend(), + value: handleTouchend + } + ]); + var fireIfReady = function (event, type) { + return get$1(handlers, type).bind(function (handler) { + return handler(event); + }); + }; + return { fireIfReady: fireIfReady }; }; var monitor$1 = function (editorApi) { - var tapEvent = monitor({ - triggerEvent: function (type, evt) { - editorApi.onTapContent(evt); - } - }); - var onTouchend = function () { - return bind$3(editorApi.body, 'touchend', function (evt) { - tapEvent.fireIfReady(evt, 'touchend'); - }); - }; - var onTouchmove = function () { - return bind$3(editorApi.body, 'touchmove', function (evt) { - tapEvent.fireIfReady(evt, 'touchmove'); - }); - }; - var fireTouchstart = function (evt) { - tapEvent.fireIfReady(evt, 'touchstart'); - }; - return { - fireTouchstart: fireTouchstart, - onTouchend: onTouchend, - onTouchmove: onTouchmove - }; + var tapEvent = monitor({ + triggerEvent: function (type, evt) { + editorApi.onTapContent(evt); + } + }); + var onTouchend = function () { + return bind$3(editorApi.body, 'touchend', function (evt) { + tapEvent.fireIfReady(evt, 'touchend'); + }); + }; + var onTouchmove = function () { + return bind$3(editorApi.body, 'touchmove', function (evt) { + tapEvent.fireIfReady(evt, 'touchmove'); + }); + }; + var fireTouchstart = function (evt) { + tapEvent.fireIfReady(evt, 'touchstart'); + }; + return { + fireTouchstart: fireTouchstart, + onTouchend: onTouchend, + onTouchmove: onTouchmove + }; }; var isAndroid6 = detect$3().os.version.major >= 6; var initEvents = function (editorApi, toolstrip, alloy) { - var tapping = monitor$1(editorApi); - var outerDoc = owner(toolstrip); - var isRanged = function (sel) { - return !eq(sel.start, sel.finish) || sel.soffset !== sel.foffset; - }; - var hasRangeInUi = function () { - return active(outerDoc).filter(function (input) { - return name(input) === 'input'; - }).exists(function (input) { - return input.dom.selectionStart !== input.dom.selectionEnd; - }); - }; - var updateMargin = function () { - var rangeInContent = editorApi.doc.dom.hasFocus() && editorApi.getSelection().exists(isRanged); - alloy.getByDom(toolstrip).each((rangeInContent || hasRangeInUi()) === true ? Toggling.on : Toggling.off); - }; - var listeners = [ - bind$3(editorApi.body, 'touchstart', function (evt) { - editorApi.onTouchContent(); - tapping.fireTouchstart(evt); - }), - tapping.onTouchmove(), - tapping.onTouchend(), - bind$3(toolstrip, 'touchstart', function (_evt) { - editorApi.onTouchToolstrip(); - }), - editorApi.onToReading(function () { - blur(editorApi.body); - }), - editorApi.onToEditing(noop), - editorApi.onScrollToCursor(function (tinyEvent) { - tinyEvent.preventDefault(); - editorApi.getCursorBox().each(function (bounds) { - var cWin = editorApi.win; - var isOutside = bounds.top > cWin.innerHeight || bounds.bottom > cWin.innerHeight; - var cScrollBy = isOutside ? bounds.bottom - cWin.innerHeight + 50 : 0; - if (cScrollBy !== 0) { - cWin.scrollTo(cWin.pageXOffset, cWin.pageYOffset + cScrollBy); - } - }); - }) - ].concat(isAndroid6 === true ? [] : [ - bind$3(SugarElement.fromDom(editorApi.win), 'blur', function () { - alloy.getByDom(toolstrip).each(Toggling.off); - }), - bind$3(outerDoc, 'select', updateMargin), - bind$3(editorApi.doc, 'selectionchange', updateMargin) - ]); - var destroy = function () { - each(listeners, function (l) { - l.unbind(); - }); - }; - return {destroy: destroy}; + var tapping = monitor$1(editorApi); + var outerDoc = owner(toolstrip); + var isRanged = function (sel) { + return !eq(sel.start, sel.finish) || sel.soffset !== sel.foffset; + }; + var hasRangeInUi = function () { + return active(outerDoc).filter(function (input) { + return name(input) === 'input'; + }).exists(function (input) { + return input.dom.selectionStart !== input.dom.selectionEnd; + }); + }; + var updateMargin = function () { + var rangeInContent = editorApi.doc.dom.hasFocus() && editorApi.getSelection().exists(isRanged); + alloy.getByDom(toolstrip).each((rangeInContent || hasRangeInUi()) === true ? Toggling.on : Toggling.off); + }; + var listeners = [ + bind$3(editorApi.body, 'touchstart', function (evt) { + editorApi.onTouchContent(); + tapping.fireTouchstart(evt); + }), + tapping.onTouchmove(), + tapping.onTouchend(), + bind$3(toolstrip, 'touchstart', function (_evt) { + editorApi.onTouchToolstrip(); + }), + editorApi.onToReading(function () { + blur(editorApi.body); + }), + editorApi.onToEditing(noop), + editorApi.onScrollToCursor(function (tinyEvent) { + tinyEvent.preventDefault(); + editorApi.getCursorBox().each(function (bounds) { + var cWin = editorApi.win; + var isOutside = bounds.top > cWin.innerHeight || bounds.bottom > cWin.innerHeight; + var cScrollBy = isOutside ? bounds.bottom - cWin.innerHeight + 50 : 0; + if (cScrollBy !== 0) { + cWin.scrollTo(cWin.pageXOffset, cWin.pageYOffset + cScrollBy); + } + }); + }) + ].concat(isAndroid6 === true ? [] : [ + bind$3(SugarElement.fromDom(editorApi.win), 'blur', function () { + alloy.getByDom(toolstrip).each(Toggling.off); + }), + bind$3(outerDoc, 'select', updateMargin), + bind$3(editorApi.doc, 'selectionchange', updateMargin) + ]); + var destroy = function () { + each(listeners, function (l) { + l.unbind(); + }); + }; + return { destroy: destroy }; }; var safeParse = function (element, attribute) { - var parsed = parseInt(get$2(element, attribute), 10); - return isNaN(parsed) ? 0 : parsed; + var parsed = parseInt(get$2(element, attribute), 10); + return isNaN(parsed) ? 0 : parsed; }; var COLLAPSED_WIDTH = 2; var collapsedRect = function (rect) { - return __assign(__assign({}, rect), {width: COLLAPSED_WIDTH}); + return __assign(__assign({}, rect), { width: COLLAPSED_WIDTH }); }; var toRect$1 = function (rawRect) { - return { - left: rawRect.left, - top: rawRect.top, - right: rawRect.right, - bottom: rawRect.bottom, - width: rawRect.width, - height: rawRect.height - }; + return { + left: rawRect.left, + top: rawRect.top, + right: rawRect.right, + bottom: rawRect.bottom, + width: rawRect.width, + height: rawRect.height + }; }; var getRectsFromRange = function (range) { - if (!range.collapsed) { - return map(range.getClientRects(), toRect$1); - } else { - var start_1 = SugarElement.fromDom(range.startContainer); - return parent(start_1).bind(function (parent) { - var selection = SimSelection.exact(start_1, range.startOffset, parent, getEnd(parent)); - var optRect = getFirstRect$1(range.startContainer.ownerDocument.defaultView, selection); - return optRect.map(collapsedRect).map(pure); - }).getOr([]); - } + if (!range.collapsed) { + return map(range.getClientRects(), toRect$1); + } else { + var start_1 = SugarElement.fromDom(range.startContainer); + return parent(start_1).bind(function (parent) { + var selection = SimSelection.exact(start_1, range.startOffset, parent, getEnd(parent)); + var optRect = getFirstRect$1(range.startContainer.ownerDocument.defaultView, selection); + return optRect.map(collapsedRect).map(pure); + }).getOr([]); + } }; var getRectangles = function (cWin) { - var sel = cWin.getSelection(); - return sel !== undefined && sel.rangeCount > 0 ? getRectsFromRange(sel.getRangeAt(0)) : []; + var sel = cWin.getSelection(); + return sel !== undefined && sel.rangeCount > 0 ? getRectsFromRange(sel.getRangeAt(0)) : []; }; var autocompleteHack = function () { - return function (f) { - global$4.setTimeout(function () { - f(); - }, 0); - }; + return function (f) { + global$4.setTimeout(function () { + f(); + }, 0); + }; }; var resume = function (cWin) { - cWin.focus(); - var iBody = SugarElement.fromDom(cWin.document.body); - var inInput = active().exists(function (elem) { - return contains([ - 'input', - 'textarea' - ], name(elem)); - }); - var transaction = inInput ? autocompleteHack() : apply; - transaction(function () { - active().each(blur); - focus$1(iBody); - }); + cWin.focus(); + var iBody = SugarElement.fromDom(cWin.document.body); + var inInput = active().exists(function (elem) { + return contains([ + 'input', + 'textarea' + ], name(elem)); + }); + var transaction = inInput ? autocompleteHack() : apply; + transaction(function () { + active().each(blur); + focus$1(iBody); + }); }; var EXTRA_SPACING = 50; var data = 'data-' + resolve('last-outer-height'); var setLastHeight = function (cBody, value) { - set(cBody, data, value); + set(cBody, data, value); }; var getLastHeight = function (cBody) { - return safeParse(cBody, data); + return safeParse(cBody, data); }; var getBoundsFrom = function (rect) { - return { - top: rect.top, - bottom: rect.top + rect.height - }; + return { + top: rect.top, + bottom: rect.top + rect.height + }; }; var getBounds$1 = function (cWin) { - var rects = getRectangles(cWin); - return rects.length > 0 ? Optional.some(rects[0]).map(getBoundsFrom) : Optional.none(); + var rects = getRectangles(cWin); + return rects.length > 0 ? Optional.some(rects[0]).map(getBoundsFrom) : Optional.none(); }; var findDelta = function (outerWindow, cBody) { - var last = getLastHeight(cBody); - var current = outerWindow.innerHeight; - return last > current ? Optional.some(last - current) : Optional.none(); + var last = getLastHeight(cBody); + var current = outerWindow.innerHeight; + return last > current ? Optional.some(last - current) : Optional.none(); }; var calculate = function (cWin, bounds, delta) { - var isOutside = bounds.top > cWin.innerHeight || bounds.bottom > cWin.innerHeight; - return isOutside ? Math.min(delta, bounds.bottom - cWin.innerHeight + EXTRA_SPACING) : 0; + var isOutside = bounds.top > cWin.innerHeight || bounds.bottom > cWin.innerHeight; + return isOutside ? Math.min(delta, bounds.bottom - cWin.innerHeight + EXTRA_SPACING) : 0; }; var setup$1 = function (outerWindow, cWin) { - var cBody = SugarElement.fromDom(cWin.document.body); - var toEditing = function () { - resume(cWin); - }; - var onResize = bind$3(SugarElement.fromDom(outerWindow), 'resize', function () { - findDelta(outerWindow, cBody).each(function (delta) { - getBounds$1(cWin).each(function (bounds) { - var cScrollBy = calculate(cWin, bounds, delta); - if (cScrollBy !== 0) { - cWin.scrollTo(cWin.pageXOffset, cWin.pageYOffset + cScrollBy); - } - }); - }); - setLastHeight(cBody, outerWindow.innerHeight); + var cBody = SugarElement.fromDom(cWin.document.body); + var toEditing = function () { + resume(cWin); + }; + var onResize = bind$3(SugarElement.fromDom(outerWindow), 'resize', function () { + findDelta(outerWindow, cBody).each(function (delta) { + getBounds$1(cWin).each(function (bounds) { + var cScrollBy = calculate(cWin, bounds, delta); + if (cScrollBy !== 0) { + cWin.scrollTo(cWin.pageXOffset, cWin.pageYOffset + cScrollBy); + } + }); }); setLastHeight(cBody, outerWindow.innerHeight); - var destroy = function () { - onResize.unbind(); - }; - return { - toEditing: toEditing, - destroy: destroy - }; + }); + setLastHeight(cBody, outerWindow.innerHeight); + var destroy = function () { + onResize.unbind(); + }; + return { + toEditing: toEditing, + destroy: destroy + }; }; var create$4 = function (platform, mask) { - var meta = tag(); - var androidApi = api$2(); - var androidEvents = api$2(); - var enter = function () { - mask.hide(); - add$2(platform.container, resolve('fullscreen-maximized')); - add$2(platform.container, resolve('android-maximized')); - meta.maximize(); - add$2(platform.body, resolve('android-scroll-reload')); - androidApi.set(setup$1(platform.win, getWin$1(platform.editor).getOrDie('no'))); - getActiveApi(platform.editor).each(function (editorApi) { - clobberStyles(platform.container, editorApi.body); - androidEvents.set(initEvents(editorApi, platform.toolstrip, platform.alloy)); - }); - }; - var exit = function () { - meta.restore(); - mask.show(); - remove$4(platform.container, resolve('fullscreen-maximized')); - remove$4(platform.container, resolve('android-maximized')); - restoreStyles(); - remove$4(platform.body, resolve('android-scroll-reload')); - androidEvents.clear(); - androidApi.clear(); - }; - return { - enter: enter, - exit: exit - }; + var meta = tag(); + var androidApi = api$2(); + var androidEvents = api$2(); + var enter = function () { + mask.hide(); + add$2(platform.container, resolve('fullscreen-maximized')); + add$2(platform.container, resolve('android-maximized')); + meta.maximize(); + add$2(platform.body, resolve('android-scroll-reload')); + androidApi.set(setup$1(platform.win, getWin$1(platform.editor).getOrDie('no'))); + getActiveApi(platform.editor).each(function (editorApi) { + clobberStyles(platform.container, editorApi.body); + androidEvents.set(initEvents(editorApi, platform.toolstrip, platform.alloy)); + }); + }; + var exit = function () { + meta.restore(); + mask.show(); + remove$4(platform.container, resolve('fullscreen-maximized')); + remove$4(platform.container, resolve('android-maximized')); + restoreStyles(); + remove$4(platform.body, resolve('android-scroll-reload')); + androidEvents.clear(); + androidApi.clear(); + }; + return { + enter: enter, + exit: exit + }; }; var first$1 = function (fn, rate) { - var timer = null; - var cancel = function () { - if (timer !== null) { - clearTimeout(timer); - timer = null; - } - }; - var throttle = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (timer === null) { - timer = setTimeout(function () { - fn.apply(null, args); - timer = null; - }, rate); - } - }; - return { - cancel: cancel, - throttle: throttle - }; + var timer = null; + var cancel = function () { + if (timer !== null) { + clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer === null) { + timer = setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + } + }; + return { + cancel: cancel, + throttle: throttle + }; }; var last = function (fn, rate) { - var timer = null; - var cancel = function () { - if (timer !== null) { - clearTimeout(timer); - timer = null; - } - }; - var throttle = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (timer !== null) { - clearTimeout(timer); - } - timer = setTimeout(function () { - fn.apply(null, args); - timer = null; - }, rate); - }; - return { - cancel: cancel, - throttle: throttle - }; + var timer = null; + var cancel = function () { + if (timer !== null) { + clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer !== null) { + clearTimeout(timer); + } + timer = setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + }; + return { + cancel: cancel, + throttle: throttle + }; }; var sketch$9 = function (onView, _translate) { - var memIcon = record(Container.sketch({ - dom: dom$1(''), - containerBehaviours: derive$1([Toggling.config({ - toggleClass: resolve('mask-tap-icon-selected'), - toggleOnExecute: false - })]) - })); - var onViewThrottle = first$1(onView, 200); - return Container.sketch({ - dom: dom$1('
              '), - components: [Container.sketch({ - dom: dom$1('
              '), - components: [Button.sketch({ - dom: dom$1('
              '), - components: [memIcon.asSpec()], - action: function (_button) { - onViewThrottle.throttle(); - }, - buttonBehaviours: derive$1([Toggling.config({toggleClass: resolve('mask-tap-icon-selected')})]) - })] - })] - }); + var memIcon = record(Container.sketch({ + dom: dom$1(''), + containerBehaviours: derive$1([Toggling.config({ + toggleClass: resolve('mask-tap-icon-selected'), + toggleOnExecute: false + })]) + })); + var onViewThrottle = first$1(onView, 200); + return Container.sketch({ + dom: dom$1('
              '), + components: [Container.sketch({ + dom: dom$1('
              '), + components: [Button.sketch({ + dom: dom$1('
              '), + components: [memIcon.asSpec()], + action: function (_button) { + onViewThrottle.throttle(); + }, + buttonBehaviours: derive$1([Toggling.config({ toggleClass: resolve('mask-tap-icon-selected') })]) + })] + })] + }); }; - var unbindNoop = constant({unbind: noop}); + var unbindNoop = constant({ unbind: noop }); var MobileSchema = objOf([ - strictObjOf('editor', [ - strict$1('getFrame'), - option('getBody'), - option('getDoc'), - option('getWin'), - option('getSelection'), - option('setSelection'), - option('clearSelection'), - option('cursorSaver'), - option('onKeyup'), - option('onNodeChanged'), - option('getCursorBox'), - strict$1('onDomChanged'), - defaulted$1('onTouchContent', noop), - defaulted$1('onTapContent', noop), - defaulted$1('onTouchToolstrip', noop), - defaulted$1('onScrollToCursor', unbindNoop), - defaulted$1('onScrollToElement', unbindNoop), - defaulted$1('onToEditing', unbindNoop), - defaulted$1('onToReading', unbindNoop), - defaulted$1('onToolbarScrollStart', identity) - ]), - strict$1('socket'), - strict$1('toolstrip'), - strict$1('dropup'), - strict$1('toolbar'), - strict$1('container'), - strict$1('alloy'), - state$1('win', function (spec) { - return owner(spec.socket).dom.defaultView; - }), - state$1('body', function (spec) { - return SugarElement.fromDom(spec.socket.dom.ownerDocument.body); - }), - defaulted$1('translate', identity), - defaulted$1('setReadOnly', noop), - defaulted$1('readOnlyOnInit', always) + strictObjOf('editor', [ + strict$1('getFrame'), + option('getBody'), + option('getDoc'), + option('getWin'), + option('getSelection'), + option('setSelection'), + option('clearSelection'), + option('cursorSaver'), + option('onKeyup'), + option('onNodeChanged'), + option('getCursorBox'), + strict$1('onDomChanged'), + defaulted$1('onTouchContent', noop), + defaulted$1('onTapContent', noop), + defaulted$1('onTouchToolstrip', noop), + defaulted$1('onScrollToCursor', unbindNoop), + defaulted$1('onScrollToElement', unbindNoop), + defaulted$1('onToEditing', unbindNoop), + defaulted$1('onToReading', unbindNoop), + defaulted$1('onToolbarScrollStart', identity) + ]), + strict$1('socket'), + strict$1('toolstrip'), + strict$1('dropup'), + strict$1('toolbar'), + strict$1('container'), + strict$1('alloy'), + state$1('win', function (spec) { + return owner(spec.socket).dom.defaultView; + }), + state$1('body', function (spec) { + return SugarElement.fromDom(spec.socket.dom.ownerDocument.body); + }), + defaulted$1('translate', identity), + defaulted$1('setReadOnly', noop), + defaulted$1('readOnlyOnInit', always) ]); var produce = function (raw) { - var mobile = asRawOrDie('Getting AndroidWebapp schema', MobileSchema, raw); - set$3(mobile.toolstrip, 'width', '100%'); - var onTap = function () { - mobile.setReadOnly(mobile.readOnlyOnInit()); - mode.enter(); - }; - var mask = build$1(sketch$9(onTap, mobile.translate)); - mobile.alloy.add(mask); - var maskApi = { - show: function () { - mobile.alloy.add(mask); - }, - hide: function () { - mobile.alloy.remove(mask); - } - }; - append(mobile.container, mask.element); - var mode = create$4(mobile, maskApi); - return { - setReadOnly: mobile.setReadOnly, - refreshStructure: noop, - enter: mode.enter, - exit: mode.exit, - destroy: noop - }; + var mobile = asRawOrDie('Getting AndroidWebapp schema', MobileSchema, raw); + set$3(mobile.toolstrip, 'width', '100%'); + var onTap = function () { + mobile.setReadOnly(mobile.readOnlyOnInit()); + mode.enter(); + }; + var mask = build$1(sketch$9(onTap, mobile.translate)); + mobile.alloy.add(mask); + var maskApi = { + show: function () { + mobile.alloy.add(mask); + }, + hide: function () { + mobile.alloy.remove(mask); + } + }; + append(mobile.container, mask.element); + var mode = create$4(mobile, maskApi); + return { + setReadOnly: mobile.setReadOnly, + refreshStructure: noop, + enter: mode.enter, + exit: mode.exit, + destroy: noop + }; }; var schema$e = constant([ - strict$1('dom'), - defaulted$1('shell', true), - field$1('toolbarBehaviours', [Replacing]) + strict$1('dom'), + defaulted$1('shell', true), + field$1('toolbarBehaviours', [Replacing]) ]); var enhanceGroups = function () { - return {behaviours: derive$1([Replacing.config({})])}; + return { behaviours: derive$1([Replacing.config({})]) }; }; var parts$2 = constant([optional({ name: 'groups', overrides: enhanceGroups - })]); + })]); var factory$4 = function (detail, components, _spec, _externals) { - var setGroups = function (toolbar, groups) { - getGroupContainer(toolbar).fold(function () { - console.error('Toolbar was defined to not be a shell, but no groups container was specified in components'); - throw new Error('Toolbar was defined to not be a shell, but no groups container was specified in components'); - }, function (container) { - Replacing.set(container, groups); - }); - }; - var getGroupContainer = function (component) { - return detail.shell ? Optional.some(component) : getPart(component, detail, 'groups'); - }; - var extra = detail.shell ? { - behaviours: [Replacing.config({})], - components: [] - } : { - behaviours: [], - components: components - }; - return { - uid: detail.uid, - dom: detail.dom, - components: extra.components, - behaviours: augment(detail.toolbarBehaviours, extra.behaviours), - apis: {setGroups: setGroups}, - domModification: {attributes: {role: 'group'}} - }; + var setGroups = function (toolbar, groups) { + getGroupContainer(toolbar).fold(function () { + console.error('Toolbar was defined to not be a shell, but no groups container was specified in components'); + throw new Error('Toolbar was defined to not be a shell, but no groups container was specified in components'); + }, function (container) { + Replacing.set(container, groups); + }); + }; + var getGroupContainer = function (component) { + return detail.shell ? Optional.some(component) : getPart(component, detail, 'groups'); + }; + var extra = detail.shell ? { + behaviours: [Replacing.config({})], + components: [] + } : { + behaviours: [], + components: components + }; + return { + uid: detail.uid, + dom: detail.dom, + components: extra.components, + behaviours: augment(detail.toolbarBehaviours, extra.behaviours), + apis: { setGroups: setGroups }, + domModification: { attributes: { role: 'group' } } + }; }; var Toolbar = composite$1({ - name: 'Toolbar', - configFields: schema$e(), - partFields: parts$2(), - factory: factory$4, - apis: { - setGroups: function (apis, toolbar, groups) { - apis.setGroups(toolbar, groups); - } + name: 'Toolbar', + configFields: schema$e(), + partFields: parts$2(), + factory: factory$4, + apis: { + setGroups: function (apis, toolbar, groups) { + apis.setGroups(toolbar, groups); } + } }); var schema$f = constant([ - strict$1('items'), - markers(['itemSelector']), - field$1('tgroupBehaviours', [Keying]) + strict$1('items'), + markers(['itemSelector']), + field$1('tgroupBehaviours', [Keying]) ]); var parts$3 = constant([group({ name: 'items', unit: 'item' - })]); + })]); var factory$5 = function (detail, components, _spec, _externals) { - return { - uid: detail.uid, - dom: detail.dom, - components: components, - behaviours: augment(detail.tgroupBehaviours, [Keying.config({ - mode: 'flow', - selector: detail.markers.itemSelector - })]), - domModification: {attributes: {role: 'toolbar'}} - }; + return { + uid: detail.uid, + dom: detail.dom, + components: components, + behaviours: augment(detail.tgroupBehaviours, [Keying.config({ + mode: 'flow', + selector: detail.markers.itemSelector + })]), + domModification: { attributes: { role: 'toolbar' } } + }; }; var ToolbarGroup = composite$1({ - name: 'ToolbarGroup', - configFields: schema$f(), - partFields: parts$3(), - factory: factory$5 + name: 'ToolbarGroup', + configFields: schema$f(), + partFields: parts$3(), + factory: factory$5 }); var dataHorizontal = 'data-' + resolve('horizontal-scroll'); var canScrollVertically = function (container) { - container.dom.scrollTop = 1; - var result = container.dom.scrollTop !== 0; - container.dom.scrollTop = 0; - return result; + container.dom.scrollTop = 1; + var result = container.dom.scrollTop !== 0; + container.dom.scrollTop = 0; + return result; }; var canScrollHorizontally = function (container) { - container.dom.scrollLeft = 1; - var result = container.dom.scrollLeft !== 0; - container.dom.scrollLeft = 0; - return result; + container.dom.scrollLeft = 1; + var result = container.dom.scrollLeft !== 0; + container.dom.scrollLeft = 0; + return result; }; var hasVerticalScroll = function (container) { - return container.dom.scrollTop > 0 || canScrollVertically(container); + return container.dom.scrollTop > 0 || canScrollVertically(container); }; var hasHorizontalScroll = function (container) { - return container.dom.scrollLeft > 0 || canScrollHorizontally(container); + return container.dom.scrollLeft > 0 || canScrollHorizontally(container); }; var markAsHorizontal = function (container) { - set(container, dataHorizontal, 'true'); + set(container, dataHorizontal, 'true'); }; var hasScroll = function (container) { - return get$2(container, dataHorizontal) === 'true' ? hasHorizontalScroll(container) : hasVerticalScroll(container); + return get$2(container, dataHorizontal) === 'true' ? hasHorizontalScroll(container) : hasVerticalScroll(container); }; var exclusive = function (scope, selector) { - return bind$3(scope, 'touchmove', function (event) { - closest$2(event.target, selector).filter(hasScroll).fold(function () { - event.prevent(); - }, noop); - }); + return bind$3(scope, 'touchmove', function (event) { + closest$2(event.target, selector).filter(hasScroll).fold(function () { + event.prevent(); + }, noop); + }); }; var ScrollingToolbar = function () { - var makeGroup = function (gSpec) { - var scrollClass = gSpec.scrollable === true ? '${prefix}-toolbar-scrollable-group' : ''; - return { - dom: dom$1('
              '), - tgroupBehaviours: derive$1([config('adhoc-scrollable-toolbar', gSpec.scrollable === true ? [runOnInit(function (component, _simulatedEvent) { - set$3(component.element, 'overflow-x', 'auto'); - markAsHorizontal(component.element); - register(component.element); - })] : [])]), - components: [Container.sketch({components: [ToolbarGroup.parts.items({})]})], - markers: {itemSelector: '.' + resolve('toolbar-group-item')}, - items: gSpec.items - }; - }; - var toolbar = build$1(Toolbar.sketch({ - dom: dom$1('
              '), - components: [Toolbar.parts.groups({})], - toolbarBehaviours: derive$1([ - Toggling.config({ - toggleClass: resolve('context-toolbar'), - toggleOnExecute: false, - aria: {mode: 'none'} - }), - Keying.config({mode: 'cyclic'}) - ]), - shell: true - })); - var wrapper = build$1(Container.sketch({ - dom: {classes: [resolve('toolstrip')]}, - components: [premade$1(toolbar)], - containerBehaviours: derive$1([Toggling.config({ - toggleClass: resolve('android-selection-context-toolbar'), - toggleOnExecute: false - })]) - })); - var resetGroups = function () { - Toolbar.setGroups(toolbar, initGroups.get()); - Toggling.off(toolbar); - }; - var initGroups = Cell([]); - var setGroups = function (gs) { - initGroups.set(gs); - resetGroups(); - }; - var createGroups = function (gs) { - return map(gs, compose(ToolbarGroup.sketch, makeGroup)); - }; - var refresh = function () { - }; - var setContextToolbar = function (gs) { - Toggling.on(toolbar); - Toolbar.setGroups(toolbar, gs); - }; - var restoreToolbar = function () { - if (Toggling.isOn(toolbar)) { - resetGroups(); - } - }; - var focus = function () { - Keying.focusIn(toolbar); - }; + var makeGroup = function (gSpec) { + var scrollClass = gSpec.scrollable === true ? '${prefix}-toolbar-scrollable-group' : ''; return { - wrapper: wrapper, - toolbar: toolbar, - createGroups: createGroups, - setGroups: setGroups, - setContextToolbar: setContextToolbar, - restoreToolbar: restoreToolbar, - refresh: refresh, - focus: focus - }; + dom: dom$1('
              '), + tgroupBehaviours: derive$1([config('adhoc-scrollable-toolbar', gSpec.scrollable === true ? [runOnInit(function (component, _simulatedEvent) { + set$3(component.element, 'overflow-x', 'auto'); + markAsHorizontal(component.element); + register(component.element); + })] : [])]), + components: [Container.sketch({ components: [ToolbarGroup.parts.items({})] })], + markers: { itemSelector: '.' + resolve('toolbar-group-item') }, + items: gSpec.items + }; + }; + var toolbar = build$1(Toolbar.sketch({ + dom: dom$1('
              '), + components: [Toolbar.parts.groups({})], + toolbarBehaviours: derive$1([ + Toggling.config({ + toggleClass: resolve('context-toolbar'), + toggleOnExecute: false, + aria: { mode: 'none' } + }), + Keying.config({ mode: 'cyclic' }) + ]), + shell: true + })); + var wrapper = build$1(Container.sketch({ + dom: { classes: [resolve('toolstrip')] }, + components: [premade$1(toolbar)], + containerBehaviours: derive$1([Toggling.config({ + toggleClass: resolve('android-selection-context-toolbar'), + toggleOnExecute: false + })]) + })); + var resetGroups = function () { + Toolbar.setGroups(toolbar, initGroups.get()); + Toggling.off(toolbar); + }; + var initGroups = Cell([]); + var setGroups = function (gs) { + initGroups.set(gs); + resetGroups(); + }; + var createGroups = function (gs) { + return map(gs, compose(ToolbarGroup.sketch, makeGroup)); + }; + var refresh = function () { + }; + var setContextToolbar = function (gs) { + Toggling.on(toolbar); + Toolbar.setGroups(toolbar, gs); + }; + var restoreToolbar = function () { + if (Toggling.isOn(toolbar)) { + resetGroups(); + } + }; + var focus = function () { + Keying.focusIn(toolbar); + }; + return { + wrapper: wrapper, + toolbar: toolbar, + createGroups: createGroups, + setGroups: setGroups, + setContextToolbar: setContextToolbar, + restoreToolbar: restoreToolbar, + refresh: refresh, + focus: focus + }; }; var makeEditSwitch = function (webapp) { - return build$1(Button.sketch({ - dom: dom$1('
              '), - action: function () { - webapp.run(function (w) { - w.setReadOnly(false); - }); - } - })); + return build$1(Button.sketch({ + dom: dom$1('
              '), + action: function () { + webapp.run(function (w) { + w.setReadOnly(false); + }); + } + })); }; var makeSocket = function () { - return build$1(Container.sketch({ - dom: dom$1('
              '), - components: [], - containerBehaviours: derive$1([Replacing.config({})]) - })); + return build$1(Container.sketch({ + dom: dom$1('
              '), + components: [], + containerBehaviours: derive$1([Replacing.config({})]) + })); }; var showEdit = function (socket, switchToEdit) { - Replacing.append(socket, premade$1(switchToEdit)); + Replacing.append(socket, premade$1(switchToEdit)); }; var hideEdit = function (socket, switchToEdit) { - Replacing.remove(socket, switchToEdit); + Replacing.remove(socket, switchToEdit); }; var updateMode = function (socket, switchToEdit, readOnly, root) { - var swap = readOnly === true ? Swapping.toAlpha : Swapping.toOmega; - swap(root); - var f = readOnly ? showEdit : hideEdit; - f(socket, switchToEdit); + var swap = readOnly === true ? Swapping.toAlpha : Swapping.toOmega; + swap(root); + var f = readOnly ? showEdit : hideEdit; + f(socket, switchToEdit); }; var getAnimationRoot = function (component, slideConfig) { - return slideConfig.getAnimationRoot.fold(function () { - return component.element; - }, function (get) { - return get(component); - }); + return slideConfig.getAnimationRoot.fold(function () { + return component.element; + }, function (get) { + return get(component); + }); }; var getDimensionProperty = function (slideConfig) { - return slideConfig.dimension.property; + return slideConfig.dimension.property; }; var getDimension = function (slideConfig, elem) { - return slideConfig.dimension.getDimension(elem); + return slideConfig.dimension.getDimension(elem); }; var disableTransitions = function (component, slideConfig) { - var root = getAnimationRoot(component, slideConfig); - remove$6(root, [ - slideConfig.shrinkingClass, - slideConfig.growingClass - ]); + var root = getAnimationRoot(component, slideConfig); + remove$6(root, [ + slideConfig.shrinkingClass, + slideConfig.growingClass + ]); }; var setShrunk = function (component, slideConfig) { - remove$4(component.element, slideConfig.openClass); - add$2(component.element, slideConfig.closedClass); - set$3(component.element, getDimensionProperty(slideConfig), '0px'); - reflow(component.element); + remove$4(component.element, slideConfig.openClass); + add$2(component.element, slideConfig.closedClass); + set$3(component.element, getDimensionProperty(slideConfig), '0px'); + reflow(component.element); }; var setGrown = function (component, slideConfig) { - remove$4(component.element, slideConfig.closedClass); - add$2(component.element, slideConfig.openClass); - remove$5(component.element, getDimensionProperty(slideConfig)); + remove$4(component.element, slideConfig.closedClass); + add$2(component.element, slideConfig.openClass); + remove$5(component.element, getDimensionProperty(slideConfig)); }; var doImmediateShrink = function (component, slideConfig, slideState, _calculatedSize) { - slideState.setCollapsed(); - set$3(component.element, getDimensionProperty(slideConfig), getDimension(slideConfig, component.element)); - reflow(component.element); - disableTransitions(component, slideConfig); - setShrunk(component, slideConfig); - slideConfig.onStartShrink(component); - slideConfig.onShrunk(component); + slideState.setCollapsed(); + set$3(component.element, getDimensionProperty(slideConfig), getDimension(slideConfig, component.element)); + reflow(component.element); + disableTransitions(component, slideConfig); + setShrunk(component, slideConfig); + slideConfig.onStartShrink(component); + slideConfig.onShrunk(component); }; var doStartShrink = function (component, slideConfig, slideState, calculatedSize) { - var size = calculatedSize.getOrThunk(function () { - return getDimension(slideConfig, component.element); - }); - slideState.setCollapsed(); - set$3(component.element, getDimensionProperty(slideConfig), size); - reflow(component.element); - var root = getAnimationRoot(component, slideConfig); - remove$4(root, slideConfig.growingClass); - add$2(root, slideConfig.shrinkingClass); - setShrunk(component, slideConfig); - slideConfig.onStartShrink(component); + var size = calculatedSize.getOrThunk(function () { + return getDimension(slideConfig, component.element); + }); + slideState.setCollapsed(); + set$3(component.element, getDimensionProperty(slideConfig), size); + reflow(component.element); + var root = getAnimationRoot(component, slideConfig); + remove$4(root, slideConfig.growingClass); + add$2(root, slideConfig.shrinkingClass); + setShrunk(component, slideConfig); + slideConfig.onStartShrink(component); }; var doStartSmartShrink = function (component, slideConfig, slideState) { - var size = getDimension(slideConfig, component.element); - var shrinker = size === '0px' ? doImmediateShrink : doStartShrink; - shrinker(component, slideConfig, slideState, Optional.some(size)); + var size = getDimension(slideConfig, component.element); + var shrinker = size === '0px' ? doImmediateShrink : doStartShrink; + shrinker(component, slideConfig, slideState, Optional.some(size)); }; var doStartGrow = function (component, slideConfig, slideState) { - var root = getAnimationRoot(component, slideConfig); - var wasShrinking = has$2(root, slideConfig.shrinkingClass); - var beforeSize = getDimension(slideConfig, component.element); - setGrown(component, slideConfig); - var fullSize = getDimension(slideConfig, component.element); - var startPartialGrow = function () { - set$3(component.element, getDimensionProperty(slideConfig), beforeSize); - reflow(component.element); - }; - var startCompleteGrow = function () { - setShrunk(component, slideConfig); - }; - var setStartSize = wasShrinking ? startPartialGrow : startCompleteGrow; - setStartSize(); - remove$4(root, slideConfig.shrinkingClass); - add$2(root, slideConfig.growingClass); - setGrown(component, slideConfig); - set$3(component.element, getDimensionProperty(slideConfig), fullSize); - slideState.setExpanded(); - slideConfig.onStartGrow(component); + var root = getAnimationRoot(component, slideConfig); + var wasShrinking = has$2(root, slideConfig.shrinkingClass); + var beforeSize = getDimension(slideConfig, component.element); + setGrown(component, slideConfig); + var fullSize = getDimension(slideConfig, component.element); + var startPartialGrow = function () { + set$3(component.element, getDimensionProperty(slideConfig), beforeSize); + reflow(component.element); + }; + var startCompleteGrow = function () { + setShrunk(component, slideConfig); + }; + var setStartSize = wasShrinking ? startPartialGrow : startCompleteGrow; + setStartSize(); + remove$4(root, slideConfig.shrinkingClass); + add$2(root, slideConfig.growingClass); + setGrown(component, slideConfig); + set$3(component.element, getDimensionProperty(slideConfig), fullSize); + slideState.setExpanded(); + slideConfig.onStartGrow(component); }; var refresh = function (component, slideConfig, slideState) { - if (slideState.isExpanded()) { - remove$5(component.element, getDimensionProperty(slideConfig)); - var fullSize = getDimension(slideConfig, component.element); - set$3(component.element, getDimensionProperty(slideConfig), fullSize); - } + if (slideState.isExpanded()) { + remove$5(component.element, getDimensionProperty(slideConfig)); + var fullSize = getDimension(slideConfig, component.element); + set$3(component.element, getDimensionProperty(slideConfig), fullSize); + } }; var grow = function (component, slideConfig, slideState) { - if (!slideState.isExpanded()) { - doStartGrow(component, slideConfig, slideState); - } + if (!slideState.isExpanded()) { + doStartGrow(component, slideConfig, slideState); + } }; var shrink = function (component, slideConfig, slideState) { - if (slideState.isExpanded()) { - doStartSmartShrink(component, slideConfig, slideState); - } + if (slideState.isExpanded()) { + doStartSmartShrink(component, slideConfig, slideState); + } }; var immediateShrink = function (component, slideConfig, slideState) { - if (slideState.isExpanded()) { - doImmediateShrink(component, slideConfig, slideState, Optional.none()); - } + if (slideState.isExpanded()) { + doImmediateShrink(component, slideConfig, slideState, Optional.none()); + } }; var hasGrown = function (component, slideConfig, slideState) { - return slideState.isExpanded(); + return slideState.isExpanded(); }; var hasShrunk = function (component, slideConfig, slideState) { - return slideState.isCollapsed(); + return slideState.isCollapsed(); }; var isGrowing = function (component, slideConfig, _slideState) { - var root = getAnimationRoot(component, slideConfig); - return has$2(root, slideConfig.growingClass) === true; + var root = getAnimationRoot(component, slideConfig); + return has$2(root, slideConfig.growingClass) === true; }; var isShrinking = function (component, slideConfig, _slideState) { - var root = getAnimationRoot(component, slideConfig); - return has$2(root, slideConfig.shrinkingClass) === true; + var root = getAnimationRoot(component, slideConfig); + return has$2(root, slideConfig.shrinkingClass) === true; }; var isTransitioning = function (component, slideConfig, slideState) { - return isGrowing(component, slideConfig) === true || isShrinking(component, slideConfig) === true; + return isGrowing(component, slideConfig) === true || isShrinking(component, slideConfig) === true; }; var toggleGrow = function (component, slideConfig, slideState) { - var f = slideState.isExpanded() ? doStartSmartShrink : doStartGrow; - f(component, slideConfig, slideState); + var f = slideState.isExpanded() ? doStartSmartShrink : doStartGrow; + f(component, slideConfig, slideState); }; var SlidingApis = /*#__PURE__*/Object.freeze({ @@ -11094,26 +11072,26 @@ }); var exhibit$5 = function (base, slideConfig, _slideState) { - var expanded = slideConfig.expanded; - return expanded ? nu$5({ - classes: [slideConfig.openClass], - styles: {} - }) : nu$5({ - classes: [slideConfig.closedClass], - styles: wrap$1(slideConfig.dimension.property, '0px') - }); + var expanded = slideConfig.expanded; + return expanded ? nu$5({ + classes: [slideConfig.openClass], + styles: {} + }) : nu$5({ + classes: [slideConfig.closedClass], + styles: wrap$1(slideConfig.dimension.property, '0px') + }); }; var events$a = function (slideConfig, slideState) { - return derive([runOnSource(transitionend(), function (component, simulatedEvent) { - var raw = simulatedEvent.event.raw; - if (raw.propertyName === slideConfig.dimension.property) { - disableTransitions(component, slideConfig); - if (slideState.isExpanded()) { - remove$5(component.element, slideConfig.dimension.property); - } - var notify = slideState.isExpanded() ? slideConfig.onGrown : slideConfig.onShrunk; - notify(component); - } + return derive([runOnSource(transitionend(), function (component, simulatedEvent) { + var raw = simulatedEvent.event.raw; + if (raw.propertyName === slideConfig.dimension.property) { + disableTransitions(component, slideConfig); + if (slideState.isExpanded()) { + remove$5(component.element, slideConfig.dimension.property); + } + var notify = slideState.isExpanded() ? slideConfig.onGrown : slideConfig.onShrunk; + notify(component); + } })]); }; @@ -11124,48 +11102,48 @@ }); var SlidingSchema = [ - strict$1('closedClass'), - strict$1('openClass'), - strict$1('shrinkingClass'), - strict$1('growingClass'), - option('getAnimationRoot'), - onHandler('onShrunk'), - onHandler('onStartShrink'), - onHandler('onGrown'), - onHandler('onStartGrow'), - defaulted$1('expanded', false), - strictOf('dimension', choose$1('property', { - width: [ - output('property', 'width'), - output('getDimension', function (elem) { - return get$8(elem) + 'px'; - }) - ], - height: [ - output('property', 'height'), - output('getDimension', function (elem) { - return get$6(elem) + 'px'; - }) - ] - })) + strict$1('closedClass'), + strict$1('openClass'), + strict$1('shrinkingClass'), + strict$1('growingClass'), + option('getAnimationRoot'), + onHandler('onShrunk'), + onHandler('onStartShrink'), + onHandler('onGrown'), + onHandler('onStartGrow'), + defaulted$1('expanded', false), + strictOf('dimension', choose$1('property', { + width: [ + output('property', 'width'), + output('getDimension', function (elem) { + return get$8(elem) + 'px'; + }) + ], + height: [ + output('property', 'height'), + output('getDimension', function (elem) { + return get$6(elem) + 'px'; + }) + ] + })) ]; var init$4 = function (spec) { - var state = Cell(spec.expanded); - var readState = function () { - return 'expanded: ' + state.get(); - }; - return nu$6({ - isExpanded: function () { - return state.get() === true; - }, - isCollapsed: function () { - return state.get() === false; - }, - setCollapsed: curry(state.set, false), - setExpanded: curry(state.set, true), - readState: readState - }); + var state = Cell(spec.expanded); + var readState = function () { + return 'expanded: ' + state.get(); + }; + return nu$6({ + isExpanded: function () { + return state.get() === true; + }, + isCollapsed: function () { + return state.get() === false; + }, + setCollapsed: curry(state.set, false), + setExpanded: curry(state.set, true), + readState: readState + }); }; var SlidingState = /*#__PURE__*/Object.freeze({ @@ -11174,1764 +11152,1733 @@ }); var Sliding = create$1({ - fields: SlidingSchema, - name: 'sliding', - active: ActiveSliding, - apis: SlidingApis, - state: SlidingState + fields: SlidingSchema, + name: 'sliding', + active: ActiveSliding, + apis: SlidingApis, + state: SlidingState }); var build$2 = function (refresh, scrollIntoView) { - var dropup = build$1(Container.sketch({ - dom: { - tag: 'div', - classes: [resolve('dropup')] + var dropup = build$1(Container.sketch({ + dom: { + tag: 'div', + classes: [resolve('dropup')] + }, + components: [], + containerBehaviours: derive$1([ + Replacing.config({}), + Sliding.config({ + closedClass: resolve('dropup-closed'), + openClass: resolve('dropup-open'), + shrinkingClass: resolve('dropup-shrinking'), + growingClass: resolve('dropup-growing'), + dimension: { property: 'height' }, + onShrunk: function (component) { + refresh(); + scrollIntoView(); + Replacing.set(component, []); }, - components: [], - containerBehaviours: derive$1([ - Replacing.config({}), - Sliding.config({ - closedClass: resolve('dropup-closed'), - openClass: resolve('dropup-open'), - shrinkingClass: resolve('dropup-shrinking'), - growingClass: resolve('dropup-growing'), - dimension: {property: 'height'}, - onShrunk: function (component) { - refresh(); - scrollIntoView(); - Replacing.set(component, []); - }, - onGrown: function (_component) { - refresh(); - scrollIntoView(); - } - }), - orientation(function (_component, _data) { - disappear(noop); - }) - ]) - })); - var appear = function (menu, update, component) { - if (Sliding.hasShrunk(dropup) === true && Sliding.isTransitioning(dropup) === false) { - window.requestAnimationFrame(function () { - update(component); - Replacing.set(dropup, [menu()]); - Sliding.grow(dropup); - }); - } - }; - var disappear = function (onReadyToShrink) { - window.requestAnimationFrame(function () { - onReadyToShrink(); - Sliding.shrink(dropup); - }); - }; - return { - appear: appear, - disappear: disappear, - component: dropup, - element: dropup.element - }; + onGrown: function (_component) { + refresh(); + scrollIntoView(); + } + }), + orientation(function (_component, _data) { + disappear(noop); + }) + ]) + })); + var appear = function (menu, update, component) { + if (Sliding.hasShrunk(dropup) === true && Sliding.isTransitioning(dropup) === false) { + window.requestAnimationFrame(function () { + update(component); + Replacing.set(dropup, [menu()]); + Sliding.grow(dropup); + }); + } + }; + var disappear = function (onReadyToShrink) { + window.requestAnimationFrame(function () { + onReadyToShrink(); + Sliding.shrink(dropup); + }); + }; + return { + appear: appear, + disappear: disappear, + component: dropup, + element: dropup.element + }; }; var closest$3 = function (scope, selector, isRoot) { - return closest$2(scope, selector, isRoot).isSome(); + return closest$2(scope, selector, isRoot).isSome(); }; var isDangerous = function (event) { - var keyEv = event.raw; - return keyEv.which === BACKSPACE[0] && !contains([ - 'input', - 'textarea' - ], name(event.target)) && !closest$3(event.target, '[contenteditable="true"]'); + var keyEv = event.raw; + return keyEv.which === BACKSPACE[0] && !contains([ + 'input', + 'textarea' + ], name(event.target)) && !closest$3(event.target, '[contenteditable="true"]'); }; var isFirefox = function () { - return detect$3().browser.isFirefox(); + return detect$3().browser.isFirefox(); }; var settingsSchema = objOfOnly([ - strictFunction('triggerEvent'), - defaulted$1('stopBackspace', true) + strictFunction('triggerEvent'), + defaulted$1('stopBackspace', true) ]); var bindFocus = function (container, handler) { - if (isFirefox()) { - return capture$1(container, 'focus', handler); - } else { - return bind$3(container, 'focusin', handler); - } + if (isFirefox()) { + return capture$1(container, 'focus', handler); + } else { + return bind$3(container, 'focusin', handler); + } }; var bindBlur = function (container, handler) { - if (isFirefox()) { - return capture$1(container, 'blur', handler); - } else { - return bind$3(container, 'focusout', handler); - } + if (isFirefox()) { + return capture$1(container, 'blur', handler); + } else { + return bind$3(container, 'focusout', handler); + } }; var setup$2 = function (container, rawSettings) { - var settings = asRawOrDie('Getting GUI events settings', settingsSchema, rawSettings); - var pointerEvents = [ - 'touchstart', - 'touchmove', - 'touchend', - 'touchcancel', - 'gesturestart', - 'mousedown', - 'mouseup', - 'mouseover', - 'mousemove', - 'mouseout', - 'click' - ]; - var tapEvent = monitor(settings); - var simpleEvents = map(pointerEvents.concat([ - 'selectstart', - 'input', - 'contextmenu', - 'change', - 'transitionend', - 'drag', - 'dragstart', - 'dragend', - 'dragenter', - 'dragleave', - 'dragover', - 'drop', - 'keyup' - ]), function (type) { - return bind$3(container, type, function (event) { - tapEvent.fireIfReady(event, type).each(function (tapStopped) { - if (tapStopped) { - event.kill(); - } - }); - var stopped = settings.triggerEvent(type, event); - if (stopped) { - event.kill(); - } - }); - }); - var pasteTimeout = Cell(Optional.none()); - var onPaste = bind$3(container, 'paste', function (event) { - tapEvent.fireIfReady(event, 'paste').each(function (tapStopped) { - if (tapStopped) { - event.kill(); - } - }); - var stopped = settings.triggerEvent('paste', event); - if (stopped) { - event.kill(); - } - pasteTimeout.set(Optional.some(setTimeout(function () { - settings.triggerEvent(postPaste(), event); - }, 0))); - }); - var onKeydown = bind$3(container, 'keydown', function (event) { - var stopped = settings.triggerEvent('keydown', event); - if (stopped) { - event.kill(); - } else if (settings.stopBackspace === true && isDangerous(event)) { - event.prevent(); - } - }); - var onFocusIn = bindFocus(container, function (event) { - var stopped = settings.triggerEvent('focusin', event); - if (stopped) { - event.kill(); - } - }); - var focusoutTimeout = Cell(Optional.none()); - var onFocusOut = bindBlur(container, function (event) { - var stopped = settings.triggerEvent('focusout', event); - if (stopped) { - event.kill(); - } - focusoutTimeout.set(Optional.some(setTimeout(function () { - settings.triggerEvent(postBlur(), event); - }, 0))); - }); - var unbind = function () { - each(simpleEvents, function (e) { - e.unbind(); - }); - onKeydown.unbind(); - onFocusIn.unbind(); - onFocusOut.unbind(); - onPaste.unbind(); - pasteTimeout.get().each(clearTimeout); - focusoutTimeout.get().each(clearTimeout); - }; - return {unbind: unbind}; + var settings = asRawOrDie('Getting GUI events settings', settingsSchema, rawSettings); + var pointerEvents = [ + 'touchstart', + 'touchmove', + 'touchend', + 'touchcancel', + 'gesturestart', + 'mousedown', + 'mouseup', + 'mouseover', + 'mousemove', + 'mouseout', + 'click' + ]; + var tapEvent = monitor(settings); + var simpleEvents = map(pointerEvents.concat([ + 'selectstart', + 'input', + 'contextmenu', + 'change', + 'transitionend', + 'drag', + 'dragstart', + 'dragend', + 'dragenter', + 'dragleave', + 'dragover', + 'drop', + 'keyup' + ]), function (type) { + return bind$3(container, type, function (event) { + tapEvent.fireIfReady(event, type).each(function (tapStopped) { + if (tapStopped) { + event.kill(); + } + }); + var stopped = settings.triggerEvent(type, event); + if (stopped) { + event.kill(); + } + }); + }); + var pasteTimeout = Cell(Optional.none()); + var onPaste = bind$3(container, 'paste', function (event) { + tapEvent.fireIfReady(event, 'paste').each(function (tapStopped) { + if (tapStopped) { + event.kill(); + } + }); + var stopped = settings.triggerEvent('paste', event); + if (stopped) { + event.kill(); + } + pasteTimeout.set(Optional.some(setTimeout(function () { + settings.triggerEvent(postPaste(), event); + }, 0))); + }); + var onKeydown = bind$3(container, 'keydown', function (event) { + var stopped = settings.triggerEvent('keydown', event); + if (stopped) { + event.kill(); + } else if (settings.stopBackspace === true && isDangerous(event)) { + event.prevent(); + } + }); + var onFocusIn = bindFocus(container, function (event) { + var stopped = settings.triggerEvent('focusin', event); + if (stopped) { + event.kill(); + } + }); + var focusoutTimeout = Cell(Optional.none()); + var onFocusOut = bindBlur(container, function (event) { + var stopped = settings.triggerEvent('focusout', event); + if (stopped) { + event.kill(); + } + focusoutTimeout.set(Optional.some(setTimeout(function () { + settings.triggerEvent(postBlur(), event); + }, 0))); + }); + var unbind = function () { + each(simpleEvents, function (e) { + e.unbind(); + }); + onKeydown.unbind(); + onFocusIn.unbind(); + onFocusOut.unbind(); + onPaste.unbind(); + pasteTimeout.get().each(clearTimeout); + focusoutTimeout.get().each(clearTimeout); + }; + return { unbind: unbind }; }; var derive$2 = function (rawEvent, rawTarget) { - var source = get$1(rawEvent, 'target').getOr(rawTarget); - return Cell(source); + var source = get$1(rawEvent, 'target').getOr(rawTarget); + return Cell(source); }; var fromSource = function (event, source) { - var stopper = Cell(false); - var cutter = Cell(false); - var stop = function () { - stopper.set(true); - }; - var cut = function () { - cutter.set(true); - }; - return { - stop: stop, - cut: cut, - isStopped: stopper.get, - isCut: cutter.get, - event: event, - setSource: source.set, - getSource: source.get - }; + var stopper = Cell(false); + var cutter = Cell(false); + var stop = function () { + stopper.set(true); + }; + var cut = function () { + cutter.set(true); + }; + return { + stop: stop, + cut: cut, + isStopped: stopper.get, + isCut: cutter.get, + event: event, + setSource: source.set, + getSource: source.get + }; }; var fromExternal = function (event) { - var stopper = Cell(false); - var stop = function () { - stopper.set(true); - }; - return { - stop: stop, - cut: noop, - isStopped: stopper.get, - isCut: never, - event: event, - setSource: die('Cannot set source of a broadcasted event'), - getSource: die('Cannot get source of a broadcasted event') - }; + var stopper = Cell(false); + var stop = function () { + stopper.set(true); + }; + return { + stop: stop, + cut: noop, + isStopped: stopper.get, + isCut: never, + event: event, + setSource: die('Cannot set source of a broadcasted event'), + getSource: die('Cannot get source of a broadcasted event') + }; }; var adt$7 = Adt.generate([ - {stopped: []}, - {resume: ['element']}, - {complete: []} + { stopped: [] }, + { resume: ['element'] }, + { complete: [] } ]); var doTriggerHandler = function (lookup, eventType, rawEvent, target, source, logger) { - var handler = lookup(eventType, target); - var simulatedEvent = fromSource(rawEvent, source); - return handler.fold(function () { - logger.logEventNoHandlers(eventType, target); + var handler = lookup(eventType, target); + var simulatedEvent = fromSource(rawEvent, source); + return handler.fold(function () { + logger.logEventNoHandlers(eventType, target); + return adt$7.complete(); + }, function (handlerInfo) { + var descHandler = handlerInfo.descHandler; + var eventHandler = getCurried(descHandler); + eventHandler(simulatedEvent); + if (simulatedEvent.isStopped()) { + logger.logEventStopped(eventType, handlerInfo.element, descHandler.purpose); + return adt$7.stopped(); + } else if (simulatedEvent.isCut()) { + logger.logEventCut(eventType, handlerInfo.element, descHandler.purpose); + return adt$7.complete(); + } else { + return parent(handlerInfo.element).fold(function () { + logger.logNoParent(eventType, handlerInfo.element, descHandler.purpose); return adt$7.complete(); - }, function (handlerInfo) { - var descHandler = handlerInfo.descHandler; - var eventHandler = getCurried(descHandler); - eventHandler(simulatedEvent); - if (simulatedEvent.isStopped()) { - logger.logEventStopped(eventType, handlerInfo.element, descHandler.purpose); - return adt$7.stopped(); - } else if (simulatedEvent.isCut()) { - logger.logEventCut(eventType, handlerInfo.element, descHandler.purpose); - return adt$7.complete(); - } else { - return parent(handlerInfo.element).fold(function () { - logger.logNoParent(eventType, handlerInfo.element, descHandler.purpose); - return adt$7.complete(); - }, function (parent) { - logger.logEventResponse(eventType, handlerInfo.element, descHandler.purpose); - return adt$7.resume(parent); - }); - } - }); + }, function (parent) { + logger.logEventResponse(eventType, handlerInfo.element, descHandler.purpose); + return adt$7.resume(parent); + }); + } + }); }; var doTriggerOnUntilStopped = function (lookup, eventType, rawEvent, rawTarget, source, logger) { - return doTriggerHandler(lookup, eventType, rawEvent, rawTarget, source, logger).fold(function () { - return true; - }, function (parent) { - return doTriggerOnUntilStopped(lookup, eventType, rawEvent, parent, source, logger); - }, function () { - return false; - }); + return doTriggerHandler(lookup, eventType, rawEvent, rawTarget, source, logger).fold(function () { + return true; + }, function (parent) { + return doTriggerOnUntilStopped(lookup, eventType, rawEvent, parent, source, logger); + }, function () { + return false; + }); }; var triggerHandler = function (lookup, eventType, rawEvent, target, logger) { - var source = derive$2(rawEvent, target); - return doTriggerHandler(lookup, eventType, rawEvent, target, source, logger); + var source = derive$2(rawEvent, target); + return doTriggerHandler(lookup, eventType, rawEvent, target, source, logger); }; var broadcast = function (listeners, rawEvent, _logger) { - var simulatedEvent = fromExternal(rawEvent); - each(listeners, function (listener) { - var descHandler = listener.descHandler; - var handler = getCurried(descHandler); - handler(simulatedEvent); - }); - return simulatedEvent.isStopped(); + var simulatedEvent = fromExternal(rawEvent); + each(listeners, function (listener) { + var descHandler = listener.descHandler; + var handler = getCurried(descHandler); + handler(simulatedEvent); + }); + return simulatedEvent.isStopped(); }; var triggerUntilStopped = function (lookup, eventType, rawEvent, logger) { - return triggerOnUntilStopped(lookup, eventType, rawEvent, rawEvent.target, logger); + return triggerOnUntilStopped(lookup, eventType, rawEvent, rawEvent.target, logger); }; var triggerOnUntilStopped = function (lookup, eventType, rawEvent, rawTarget, logger) { - var source = derive$2(rawEvent, rawTarget); - return doTriggerOnUntilStopped(lookup, eventType, rawEvent, rawTarget, source, logger); + var source = derive$2(rawEvent, rawTarget); + return doTriggerOnUntilStopped(lookup, eventType, rawEvent, rawTarget, source, logger); }; var eventHandler = function (element, descHandler) { - return { - element: element, - descHandler: descHandler - }; + return { + element: element, + descHandler: descHandler + }; }; var broadcastHandler = function (id, handler) { - return { - id: id, - descHandler: handler - }; - }; - - function EventRegistry() { - var registry = {}; - var registerId = function (extraArgs, id, events) { - each$1(events, function (v, k) { - var handlers = registry[k] !== undefined ? registry[k] : {}; - handlers[id] = curryArgs(v, extraArgs); - registry[k] = handlers; - }); - }; - var findHandler = function (handlers, elem) { - return read$2(elem).fold(function () { - return Optional.none(); - }, function (id) { - return handlers.bind(function (h) { - return get$1(h, id); - }).map(function (descHandler) { - return eventHandler(elem, descHandler); - }); - }); - }; - var filterByType = function (type) { - return get$1(registry, type).map(function (handlers) { - return mapToArray(handlers, function (f, id) { - return broadcastHandler(id, f); - }); - }).getOr([]); - }; - var find = function (isAboveRoot, type, target) { - var handlers = get$1(registry, type); - return closest(target, function (elem) { - return findHandler(handlers, elem); - }, isAboveRoot); - }; - var unregisterId = function (id) { - each$1(registry, function (handlersById, _eventName) { - if (handlersById.hasOwnProperty(id)) { - delete handlersById[id]; - } - }); - }; - return { - registerId: registerId, - unregisterId: unregisterId, - filterByType: filterByType, - find: find - }; + return { + id: id, + descHandler: handler + }; + }; + function EventRegistry () { + var registry = {}; + var registerId = function (extraArgs, id, events) { + each$1(events, function (v, k) { + var handlers = registry[k] !== undefined ? registry[k] : {}; + handlers[id] = curryArgs(v, extraArgs); + registry[k] = handlers; + }); + }; + var findHandler = function (handlers, elem) { + return read$2(elem).fold(function () { + return Optional.none(); + }, function (id) { + return handlers.bind(function (h) { + return get$1(h, id); + }).map(function (descHandler) { + return eventHandler(elem, descHandler); + }); + }); + }; + var filterByType = function (type) { + return get$1(registry, type).map(function (handlers) { + return mapToArray(handlers, function (f, id) { + return broadcastHandler(id, f); + }); + }).getOr([]); + }; + var find = function (isAboveRoot, type, target) { + var handlers = get$1(registry, type); + return closest(target, function (elem) { + return findHandler(handlers, elem); + }, isAboveRoot); + }; + var unregisterId = function (id) { + each$1(registry, function (handlersById, _eventName) { + if (handlersById.hasOwnProperty(id)) { + delete handlersById[id]; + } + }); + }; + return { + registerId: registerId, + unregisterId: unregisterId, + filterByType: filterByType, + find: find + }; } - function Registry() { - var events = EventRegistry(); - var components = {}; - var readOrTag = function (component) { - var elem = component.element; - return read$2(elem).fold(function () { - return write('uid-', component.element); - }, function (uid) { - return uid; - }); - }; - var failOnDuplicate = function (component, tagId) { - var conflict = components[tagId]; - if (conflict === component) { - unregister(component); - } else { - throw new Error('The tagId "' + tagId + '" is already used by: ' + element(conflict.element) + '\nCannot use it for: ' + element(component.element) + '\n' + 'The conflicting element is' + (inBody(conflict.element) ? ' ' : ' not ') + 'already in the DOM'); - } - }; - var register = function (component) { - var tagId = readOrTag(component); - if (hasNonNullableKey(components, tagId)) { - failOnDuplicate(component, tagId); - } - var extraArgs = [component]; - events.registerId(extraArgs, tagId, component.events); - components[tagId] = component; - }; - var unregister = function (component) { - read$2(component.element).each(function (tagId) { - delete components[tagId]; - events.unregisterId(tagId); - }); - }; - var filter = function (type) { - return events.filterByType(type); - }; - var find = function (isAboveRoot, type, target) { - return events.find(isAboveRoot, type, target); - }; - var getById = function (id) { - return get$1(components, id); - }; - return { - find: find, - filter: filter, - register: register, - unregister: unregister, - getById: getById - }; + function Registry () { + var events = EventRegistry(); + var components = {}; + var readOrTag = function (component) { + var elem = component.element; + return read$2(elem).fold(function () { + return write('uid-', component.element); + }, function (uid) { + return uid; + }); + }; + var failOnDuplicate = function (component, tagId) { + var conflict = components[tagId]; + if (conflict === component) { + unregister(component); + } else { + throw new Error('The tagId "' + tagId + '" is already used by: ' + element(conflict.element) + '\nCannot use it for: ' + element(component.element) + '\n' + 'The conflicting element is' + (inBody(conflict.element) ? ' ' : ' not ') + 'already in the DOM'); + } + }; + var register = function (component) { + var tagId = readOrTag(component); + if (hasNonNullableKey(components, tagId)) { + failOnDuplicate(component, tagId); + } + var extraArgs = [component]; + events.registerId(extraArgs, tagId, component.events); + components[tagId] = component; + }; + var unregister = function (component) { + read$2(component.element).each(function (tagId) { + delete components[tagId]; + events.unregisterId(tagId); + }); + }; + var filter = function (type) { + return events.filterByType(type); + }; + var find = function (isAboveRoot, type, target) { + return events.find(isAboveRoot, type, target); + }; + var getById = function (id) { + return get$1(components, id); + }; + return { + find: find, + filter: filter, + register: register, + unregister: unregister, + getById: getById + }; } var takeover = function (root) { - var isAboveRoot = function (el) { - return parent(root.element).fold(function () { - return true; - }, function (parent) { - return eq(el, parent); - }); - }; - var registry = Registry(); - var lookup = function (eventName, target) { - return registry.find(isAboveRoot, eventName, target); - }; - var domEvents = setup$2(root.element, { - triggerEvent: function (eventName, event) { - return monitorEvent(eventName, event.target, function (logger) { - return triggerUntilStopped(lookup, eventName, event, logger); - }); - } - }); - var systemApi = { - debugInfo: constant('real'), - triggerEvent: function (eventName, target, data) { - monitorEvent(eventName, target, function (logger) { - return triggerOnUntilStopped(lookup, eventName, data, target, logger); - }); - }, - triggerFocus: function (target, originator) { - read$2(target).fold(function () { - focus$1(target); - }, function (_alloyId) { - monitorEvent(focus(), target, function (logger) { - triggerHandler(lookup, focus(), { - originator: originator, - kill: noop, - prevent: noop, - target: target - }, target, logger); - return false; - }); - }); - }, - triggerEscape: function (comp, simulatedEvent) { - systemApi.triggerEvent('keydown', comp.element, simulatedEvent.event); - }, - getByUid: function (uid) { - return getByUid(uid); - }, - getByDom: function (elem) { - return getByDom(elem); - }, - build: build$1, - addToGui: function (c) { - add(c); - }, - removeFromGui: function (c) { - remove$1(c); - }, - addToWorld: function (c) { - addToWorld(c); - }, - removeFromWorld: function (c) { - removeFromWorld(c); - }, - broadcast: function (message) { - broadcast$1(message); - }, - broadcastOn: function (channels, message) { - broadcastOn(channels, message); - }, - broadcastEvent: function (eventName, event) { - broadcastEvent(eventName, event); - }, - isConnected: always - }; - var addToWorld = function (component) { - component.connect(systemApi); - if (!isText(component.element)) { - registry.register(component); - each(component.components(), addToWorld); - systemApi.triggerEvent(systemInit(), component.element, {target: component.element}); - } - }; - var removeFromWorld = function (component) { - if (!isText(component.element)) { - each(component.components(), removeFromWorld); - registry.unregister(component); - } - component.disconnect(); - }; - var add = function (component) { - attach$1(root, component); - }; - var remove$1 = function (component) { - detach(component); - }; - var destroy = function () { - domEvents.unbind(); - remove(root.element); - }; - var broadcastData = function (data) { - var receivers = registry.filter(receive()); - each(receivers, function (receiver) { - var descHandler = receiver.descHandler; - var handler = getCurried(descHandler); - handler(data); - }); - }; - var broadcast$1 = function (message) { - broadcastData({ - universal: true, - data: message - }); - }; - var broadcastOn = function (channels, message) { - broadcastData({ - universal: false, - channels: channels, - data: message - }); - }; - var broadcastEvent = function (eventName, event) { - var listeners = registry.filter(eventName); - return broadcast(listeners, event); - }; - var getByUid = function (uid) { - return registry.getById(uid).fold(function () { - return Result.error(new Error('Could not find component with uid: "' + uid + '" in system.')); - }, Result.value); - }; - var getByDom = function (elem) { - var uid = read$2(elem).getOr('not found'); - return getByUid(uid); - }; - addToWorld(root); - return { - root: root, - element: root.element, - destroy: destroy, - add: add, - remove: remove$1, - getByUid: getByUid, - getByDom: getByDom, - addToWorld: addToWorld, - removeFromWorld: removeFromWorld, - broadcast: broadcast$1, - broadcastOn: broadcastOn, - broadcastEvent: broadcastEvent - }; + var isAboveRoot = function (el) { + return parent(root.element).fold(function () { + return true; + }, function (parent) { + return eq(el, parent); + }); + }; + var registry = Registry(); + var lookup = function (eventName, target) { + return registry.find(isAboveRoot, eventName, target); + }; + var domEvents = setup$2(root.element, { + triggerEvent: function (eventName, event) { + return monitorEvent(eventName, event.target, function (logger) { + return triggerUntilStopped(lookup, eventName, event, logger); + }); + } + }); + var systemApi = { + debugInfo: constant('real'), + triggerEvent: function (eventName, target, data) { + monitorEvent(eventName, target, function (logger) { + return triggerOnUntilStopped(lookup, eventName, data, target, logger); + }); + }, + triggerFocus: function (target, originator) { + read$2(target).fold(function () { + focus$1(target); + }, function (_alloyId) { + monitorEvent(focus(), target, function (logger) { + triggerHandler(lookup, focus(), { + originator: originator, + kill: noop, + prevent: noop, + target: target + }, target, logger); + return false; + }); + }); + }, + triggerEscape: function (comp, simulatedEvent) { + systemApi.triggerEvent('keydown', comp.element, simulatedEvent.event); + }, + getByUid: function (uid) { + return getByUid(uid); + }, + getByDom: function (elem) { + return getByDom(elem); + }, + build: build$1, + addToGui: function (c) { + add(c); + }, + removeFromGui: function (c) { + remove$1(c); + }, + addToWorld: function (c) { + addToWorld(c); + }, + removeFromWorld: function (c) { + removeFromWorld(c); + }, + broadcast: function (message) { + broadcast$1(message); + }, + broadcastOn: function (channels, message) { + broadcastOn(channels, message); + }, + broadcastEvent: function (eventName, event) { + broadcastEvent(eventName, event); + }, + isConnected: always + }; + var addToWorld = function (component) { + component.connect(systemApi); + if (!isText(component.element)) { + registry.register(component); + each(component.components(), addToWorld); + systemApi.triggerEvent(systemInit(), component.element, { target: component.element }); + } + }; + var removeFromWorld = function (component) { + if (!isText(component.element)) { + each(component.components(), removeFromWorld); + registry.unregister(component); + } + component.disconnect(); + }; + var add = function (component) { + attach$1(root, component); + }; + var remove$1 = function (component) { + detach(component); + }; + var destroy = function () { + domEvents.unbind(); + remove(root.element); + }; + var broadcastData = function (data) { + var receivers = registry.filter(receive()); + each(receivers, function (receiver) { + var descHandler = receiver.descHandler; + var handler = getCurried(descHandler); + handler(data); + }); + }; + var broadcast$1 = function (message) { + broadcastData({ + universal: true, + data: message + }); + }; + var broadcastOn = function (channels, message) { + broadcastData({ + universal: false, + channels: channels, + data: message + }); + }; + var broadcastEvent = function (eventName, event) { + var listeners = registry.filter(eventName); + return broadcast(listeners, event); + }; + var getByUid = function (uid) { + return registry.getById(uid).fold(function () { + return Result.error(new Error('Could not find component with uid: "' + uid + '" in system.')); + }, Result.value); + }; + var getByDom = function (elem) { + var uid = read$2(elem).getOr('not found'); + return getByUid(uid); + }; + addToWorld(root); + return { + root: root, + element: root.element, + destroy: destroy, + add: add, + remove: remove$1, + getByUid: getByUid, + getByDom: getByDom, + addToWorld: addToWorld, + removeFromWorld: removeFromWorld, + broadcast: broadcast$1, + broadcastOn: broadcastOn, + broadcastEvent: broadcastEvent + }; }; var READ_ONLY_MODE_CLASS = resolve('readonly-mode'); var EDIT_MODE_CLASS = resolve('edit-mode'); - - function OuterContainer(spec) { - var root = build$1(Container.sketch({ - dom: {classes: [resolve('outer-container')].concat(spec.classes)}, - containerBehaviours: derive$1([Swapping.config({ - alpha: READ_ONLY_MODE_CLASS, - omega: EDIT_MODE_CLASS - })]) - })); - return takeover(root); + function OuterContainer (spec) { + var root = build$1(Container.sketch({ + dom: { classes: [resolve('outer-container')].concat(spec.classes) }, + containerBehaviours: derive$1([Swapping.config({ + alpha: READ_ONLY_MODE_CLASS, + omega: EDIT_MODE_CLASS + })]) + })); + return takeover(root); } - function AndroidRealm(scrollIntoView) { - var alloy = OuterContainer({classes: [resolve('android-container')]}); - var toolbar = ScrollingToolbar(); - var webapp = api$2(); - var switchToEdit = makeEditSwitch(webapp); - var socket = makeSocket(); - var dropup = build$2(noop, scrollIntoView); - alloy.add(toolbar.wrapper); - alloy.add(socket); - alloy.add(dropup.component); - var setToolbarGroups = function (rawGroups) { - var groups = toolbar.createGroups(rawGroups); - toolbar.setGroups(groups); - }; - var setContextToolbar = function (rawGroups) { - var groups = toolbar.createGroups(rawGroups); - toolbar.setContextToolbar(groups); - }; - var focusToolbar = function () { - toolbar.focus(); - }; - var restoreToolbar = function () { - toolbar.restoreToolbar(); - }; - var init = function (spec) { - webapp.set(produce(spec)); - }; - var exit = function () { - webapp.run(function (w) { - w.exit(); - Replacing.remove(socket, switchToEdit); - }); - }; - var updateMode$1 = function (readOnly) { - updateMode(socket, switchToEdit, readOnly, alloy.root); - }; - return { - system: alloy, - element: alloy.element, - init: init, - exit: exit, - setToolbarGroups: setToolbarGroups, - setContextToolbar: setContextToolbar, - focusToolbar: focusToolbar, - restoreToolbar: restoreToolbar, - updateMode: updateMode$1, - socket: socket, - dropup: dropup - }; + function AndroidRealm (scrollIntoView) { + var alloy = OuterContainer({ classes: [resolve('android-container')] }); + var toolbar = ScrollingToolbar(); + var webapp = api$2(); + var switchToEdit = makeEditSwitch(webapp); + var socket = makeSocket(); + var dropup = build$2(noop, scrollIntoView); + alloy.add(toolbar.wrapper); + alloy.add(socket); + alloy.add(dropup.component); + var setToolbarGroups = function (rawGroups) { + var groups = toolbar.createGroups(rawGroups); + toolbar.setGroups(groups); + }; + var setContextToolbar = function (rawGroups) { + var groups = toolbar.createGroups(rawGroups); + toolbar.setContextToolbar(groups); + }; + var focusToolbar = function () { + toolbar.focus(); + }; + var restoreToolbar = function () { + toolbar.restoreToolbar(); + }; + var init = function (spec) { + webapp.set(produce(spec)); + }; + var exit = function () { + webapp.run(function (w) { + w.exit(); + Replacing.remove(socket, switchToEdit); + }); + }; + var updateMode$1 = function (readOnly) { + updateMode(socket, switchToEdit, readOnly, alloy.root); + }; + return { + system: alloy, + element: alloy.element, + init: init, + exit: exit, + setToolbarGroups: setToolbarGroups, + setContextToolbar: setContextToolbar, + focusToolbar: focusToolbar, + restoreToolbar: restoreToolbar, + updateMode: updateMode$1, + socket: socket, + dropup: dropup + }; } var input$1 = function (parent, operation) { - var input = SugarElement.fromTag('input'); - setAll$1(input, { - opacity: '0', - position: 'absolute', - top: '-1000px', - left: '-1000px' - }); - append(parent, input); - focus$1(input); - operation(input); - remove(input); + var input = SugarElement.fromTag('input'); + setAll$1(input, { + opacity: '0', + position: 'absolute', + top: '-1000px', + left: '-1000px' + }); + append(parent, input); + focus$1(input); + operation(input); + remove(input); }; var refresh$1 = function (winScope) { - var sel = winScope.getSelection(); - if (sel.rangeCount > 0) { - var br = sel.getRangeAt(0); - var r = winScope.document.createRange(); - r.setStart(br.startContainer, br.startOffset); - r.setEnd(br.endContainer, br.endOffset); - sel.removeAllRanges(); - sel.addRange(r); - } + var sel = winScope.getSelection(); + if (sel.rangeCount > 0) { + var br = sel.getRangeAt(0); + var r = winScope.document.createRange(); + r.setStart(br.startContainer, br.startOffset); + r.setEnd(br.endContainer, br.endOffset); + sel.removeAllRanges(); + sel.addRange(r); + } }; var resume$1 = function (cWin, frame) { - active().each(function (active) { - if (!eq(active, frame)) { - blur(active); - } - }); - cWin.focus(); - focus$1(SugarElement.fromDom(cWin.document.body)); - refresh$1(cWin); + active().each(function (active) { + if (!eq(active, frame)) { + blur(active); + } + }); + cWin.focus(); + focus$1(SugarElement.fromDom(cWin.document.body)); + refresh$1(cWin); }; var stubborn = function (outerBody, cWin, page, frame) { - var toEditing = function () { - resume$1(cWin, frame); - }; - var toReading = function () { - input$1(outerBody, blur); - }; - var captureInput = bind$3(page, 'keydown', function (evt) { - if (!contains([ - 'input', - 'textarea' - ], name(evt.target))) { - toEditing(); - } - }); - var onToolbarTouch = function () { - }; - var destroy = function () { - captureInput.unbind(); - }; - return { - toReading: toReading, - toEditing: toEditing, - onToolbarTouch: onToolbarTouch, - destroy: destroy - }; - }; - - var initEvents$1 = function (editorApi, iosApi, toolstrip, socket, _dropup) { - var saveSelectionFirst = function () { - iosApi.run(function (api) { - api.highlightSelection(); - }); - }; - var refreshIosSelection = function () { - iosApi.run(function (api) { - api.refreshSelection(); - }); - }; - var scrollToY = function (yTop, height) { - var y = yTop - socket.dom.scrollTop; - iosApi.run(function (api) { - api.scrollIntoView(y, y + height); - }); - }; - var scrollToElement = function (_target) { - scrollToY(iosApi, socket); - }; - var scrollToCursor = function () { - editorApi.getCursorBox().each(function (box) { - scrollToY(box.top, box.height); - }); - }; - var clearSelection = function () { - iosApi.run(function (api) { - api.clearSelection(); - }); - }; - var clearAndRefresh = function () { - clearSelection(); - refreshThrottle.throttle(); - }; - var refreshView = function () { - scrollToCursor(); - iosApi.run(function (api) { - api.syncHeight(); - }); - }; - var reposition = function () { - var toolbarHeight = get$6(toolstrip); - iosApi.run(function (api) { - api.setViewportOffset(toolbarHeight); - }); - refreshIosSelection(); - refreshView(); - }; - var toEditing = function () { - iosApi.run(function (api) { - api.toEditing(); - }); - }; - var toReading = function () { - iosApi.run(function (api) { - api.toReading(); - }); - }; - var onToolbarTouch = function (event) { - iosApi.run(function (api) { - api.onToolbarTouch(event); - }); - }; - var tapping = monitor$1(editorApi); - var refreshThrottle = last(refreshView, 300); - var listeners = [ - editorApi.onKeyup(clearAndRefresh), - editorApi.onNodeChanged(refreshIosSelection), - editorApi.onDomChanged(refreshThrottle.throttle), - editorApi.onDomChanged(refreshIosSelection), - editorApi.onScrollToCursor(function (tinyEvent) { - tinyEvent.preventDefault(); - refreshThrottle.throttle(); - }), - editorApi.onScrollToElement(function (event) { - scrollToElement(event.element); - }), - editorApi.onToEditing(toEditing), - editorApi.onToReading(toReading), - bind$3(editorApi.doc, 'touchend', function (touchEvent) { - if (eq(editorApi.html, touchEvent.target) || eq(editorApi.body, touchEvent.target)) ; - }), - bind$3(toolstrip, 'transitionend', function (transitionEvent) { - if (transitionEvent.raw.propertyName === 'height') { - reposition(); - } - }), - capture$1(toolstrip, 'touchstart', function (touchEvent) { - saveSelectionFirst(); - onToolbarTouch(touchEvent); - editorApi.onTouchToolstrip(); - }), - bind$3(editorApi.body, 'touchstart', function (evt) { - clearSelection(); - editorApi.onTouchContent(); - tapping.fireTouchstart(evt); - }), - tapping.onTouchmove(), - tapping.onTouchend(), - bind$3(editorApi.body, 'click', function (event) { - event.kill(); - }), - bind$3(toolstrip, 'touchmove', function () { - editorApi.onToolbarScrollStart(); - }) - ]; - var destroy = function () { - each(listeners, function (l) { - l.unbind(); - }); - }; - return {destroy: destroy}; + var toEditing = function () { + resume$1(cWin, frame); + }; + var toReading = function () { + input$1(outerBody, blur); + }; + var captureInput = bind$3(page, 'keydown', function (evt) { + if (!contains([ + 'input', + 'textarea' + ], name(evt.target))) { + toEditing(); + } + }); + var onToolbarTouch = function () { + }; + var destroy = function () { + captureInput.unbind(); + }; + return { + toReading: toReading, + toEditing: toEditing, + onToolbarTouch: onToolbarTouch, + destroy: destroy + }; }; - function FakeSelection(win, frame) { - var doc = win.document; - var container = SugarElement.fromTag('div'); - add$2(container, resolve('unfocused-selections')); - append(SugarElement.fromDom(doc.documentElement), container); - var onTouch = bind$3(container, 'touchstart', function (event) { - event.prevent(); - resume$1(win, frame); - clear(); - }); - var make = function (rectangle) { - var span = SugarElement.fromTag('span'); - add$3(span, [ - resolve('layer-editor'), - resolve('unfocused-selection') - ]); - setAll$1(span, { - left: rectangle.left + 'px', - top: rectangle.top + 'px', - width: rectangle.width + 'px', - height: rectangle.height + 'px' - }); - return span; - }; - var update = function () { - clear(); - var rectangles = getRectangles(win); - var spans = map(rectangles, make); - append$1(container, spans); - }; - var clear = function () { - empty(container); - }; - var destroy = function () { - onTouch.unbind(); - remove(container); - }; - var isActive = function () { - return children(container).length > 0; - }; - return { - update: update, - isActive: isActive, - destroy: destroy, - clear: clear - }; + var initEvents$1 = function (editorApi, iosApi, toolstrip, socket, _dropup) { + var saveSelectionFirst = function () { + iosApi.run(function (api) { + api.highlightSelection(); + }); + }; + var refreshIosSelection = function () { + iosApi.run(function (api) { + api.refreshSelection(); + }); + }; + var scrollToY = function (yTop, height) { + var y = yTop - socket.dom.scrollTop; + iosApi.run(function (api) { + api.scrollIntoView(y, y + height); + }); + }; + var scrollToElement = function (_target) { + scrollToY(iosApi, socket); + }; + var scrollToCursor = function () { + editorApi.getCursorBox().each(function (box) { + scrollToY(box.top, box.height); + }); + }; + var clearSelection = function () { + iosApi.run(function (api) { + api.clearSelection(); + }); + }; + var clearAndRefresh = function () { + clearSelection(); + refreshThrottle.throttle(); + }; + var refreshView = function () { + scrollToCursor(); + iosApi.run(function (api) { + api.syncHeight(); + }); + }; + var reposition = function () { + var toolbarHeight = get$6(toolstrip); + iosApi.run(function (api) { + api.setViewportOffset(toolbarHeight); + }); + refreshIosSelection(); + refreshView(); + }; + var toEditing = function () { + iosApi.run(function (api) { + api.toEditing(); + }); + }; + var toReading = function () { + iosApi.run(function (api) { + api.toReading(); + }); + }; + var onToolbarTouch = function (event) { + iosApi.run(function (api) { + api.onToolbarTouch(event); + }); + }; + var tapping = monitor$1(editorApi); + var refreshThrottle = last(refreshView, 300); + var listeners = [ + editorApi.onKeyup(clearAndRefresh), + editorApi.onNodeChanged(refreshIosSelection), + editorApi.onDomChanged(refreshThrottle.throttle), + editorApi.onDomChanged(refreshIosSelection), + editorApi.onScrollToCursor(function (tinyEvent) { + tinyEvent.preventDefault(); + refreshThrottle.throttle(); + }), + editorApi.onScrollToElement(function (event) { + scrollToElement(event.element); + }), + editorApi.onToEditing(toEditing), + editorApi.onToReading(toReading), + bind$3(editorApi.doc, 'touchend', function (touchEvent) { + if (eq(editorApi.html, touchEvent.target) || eq(editorApi.body, touchEvent.target)) ; + }), + bind$3(toolstrip, 'transitionend', function (transitionEvent) { + if (transitionEvent.raw.propertyName === 'height') { + reposition(); + } + }), + capture$1(toolstrip, 'touchstart', function (touchEvent) { + saveSelectionFirst(); + onToolbarTouch(touchEvent); + editorApi.onTouchToolstrip(); + }), + bind$3(editorApi.body, 'touchstart', function (evt) { + clearSelection(); + editorApi.onTouchContent(); + tapping.fireTouchstart(evt); + }), + tapping.onTouchmove(), + tapping.onTouchend(), + bind$3(editorApi.body, 'click', function (event) { + event.kill(); + }), + bind$3(toolstrip, 'touchmove', function () { + editorApi.onToolbarScrollStart(); + }) + ]; + var destroy = function () { + each(listeners, function (l) { + l.unbind(); + }); + }; + return { destroy: destroy }; + }; + + function FakeSelection (win, frame) { + var doc = win.document; + var container = SugarElement.fromTag('div'); + add$2(container, resolve('unfocused-selections')); + append(SugarElement.fromDom(doc.documentElement), container); + var onTouch = bind$3(container, 'touchstart', function (event) { + event.prevent(); + resume$1(win, frame); + clear(); + }); + var make = function (rectangle) { + var span = SugarElement.fromTag('span'); + add$3(span, [ + resolve('layer-editor'), + resolve('unfocused-selection') + ]); + setAll$1(span, { + left: rectangle.left + 'px', + top: rectangle.top + 'px', + width: rectangle.width + 'px', + height: rectangle.height + 'px' + }); + return span; + }; + var update = function () { + clear(); + var rectangles = getRectangles(win); + var spans = map(rectangles, make); + append$1(container, spans); + }; + var clear = function () { + empty(container); + }; + var destroy = function () { + onTouch.unbind(); + remove(container); + }; + var isActive = function () { + return children(container).length > 0; + }; + return { + update: update, + isActive: isActive, + destroy: destroy, + clear: clear + }; } - var exports$1 = {}, module = {exports: exports$1}; + var exports$1 = {}, module = { exports: exports$1 }; (function (define, exports, module, require) { - (function (f) { - if (typeof exports === 'object' && typeof module !== 'undefined') { - module.exports = f(); - } else if (typeof define === 'function' && define.amd) { - define([], f); - } else { - var g; - if (typeof window !== 'undefined') { - g = window; - } else if (typeof global !== 'undefined') { - g = global; - } else if (typeof self !== 'undefined') { - g = self; + (function (f) { + if (typeof exports === 'object' && typeof module !== 'undefined') { + module.exports = f(); + } else if (typeof define === 'function' && define.amd) { + define([], f); + } else { + var g; + if (typeof window !== 'undefined') { + g = window; + } else if (typeof global !== 'undefined') { + g = global; + } else if (typeof self !== 'undefined') { + g = self; + } else { + g = this; + } + g.EphoxContactWrapper = f(); + } + }(function () { + return function () { + function r(e, n, t) { + function o(i, f) { + if (!n[i]) { + if (!e[i]) { + var c = 'function' == typeof require && require; + if (!f && c) + return c(i, !0); + if (u) + return u(i, !0); + var a = new Error('Cannot find module \'' + i + '\''); + throw a.code = 'MODULE_NOT_FOUND', a; + } + var p = n[i] = { exports: {} }; + e[i][0].call(p.exports, function (r) { + var n = e[i][1][r]; + return o(n || r); + }, p, p.exports, r, e, n, t); + } + return n[i].exports; + } + for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++) + o(t[i]); + return o; + } + return r; + }()({ + 1: [ + function (require, module, exports) { + var process = module.exports = {}; + var cachedSetTimeout; + var cachedClearTimeout; + function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); + } + function defaultClearTimeout() { + throw new Error('clearTimeout has not been defined'); + } + (function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } + }()); + function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + return setTimeout(fun, 0); + } + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + return cachedSetTimeout(fun, 0); + } catch (e) { + try { + return cachedSetTimeout.call(null, fun, 0); + } catch (e) { + return cachedSetTimeout.call(this, fun, 0); + } + } + } + function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + return clearTimeout(marker); + } + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + return cachedClearTimeout(marker); + } catch (e) { + try { + return cachedClearTimeout.call(null, marker); + } catch (e) { + return cachedClearTimeout.call(this, marker); + } + } + } + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); } else { - g = this; + queueIndex = -1; } - g.EphoxContactWrapper = f(); - } - }(function () { - return function () { - function r(e, n, t) { - function o(i, f) { - if (!n[i]) { - if (!e[i]) { - var c = 'function' == typeof require && require; - if (!f && c) - return c(i, !0); - if (u) - return u(i, !0); - var a = new Error('Cannot find module \'' + i + '\''); - throw a.code = 'MODULE_NOT_FOUND', a; - } - var p = n[i] = {exports: {}}; - e[i][0].call(p.exports, function (r) { - var n = e[i][1][r]; - return o(n || r); - }, p, p.exports, r, e, n, t); - } - return n[i].exports; + if (queue.length) { + drainQueue(); + } + } + function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + var len = queue.length; + while (len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); } - - for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++) - o(t[i]); - return o; + } + queueIndex = -1; + len = queue.length; } - - return r; - }()({ - 1: [ - function (require, module, exports) { - var process = module.exports = {}; - var cachedSetTimeout; - var cachedClearTimeout; - - function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); - } - - function defaultClearTimeout() { - throw new Error('clearTimeout has not been defined'); - } - - (function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } - }()); - - function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - return setTimeout(fun, 0); - } - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - return cachedSetTimeout(fun, 0); - } catch (e) { - try { - return cachedSetTimeout.call(null, fun, 0); - } catch (e) { - return cachedSetTimeout.call(this, fun, 0); - } - } - } - - function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - return clearTimeout(marker); - } - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - return cachedClearTimeout(marker); - } catch (e) { - try { - return cachedClearTimeout.call(null, marker); - } catch (e) { - return cachedClearTimeout.call(this, marker); - } - } - } - - var queue = []; - var draining = false; - var currentQueue; - var queueIndex = -1; - - function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } + currentQueue = null; + draining = false; + runClearTimeout(timeout); + } + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } + }; + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; + process.versions = {}; + function noop() { + } + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + process.prependListener = noop; + process.prependOnceListener = noop; + process.listeners = function (name) { + return []; + }; + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + process.cwd = function () { + return '/'; + }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function () { + return 0; + }; + }, + {} + ], + 2: [ + function (require, module, exports) { + (function (setImmediate) { + (function (root) { + var setTimeoutFunc = setTimeout; + function noop() { + } + function bind(fn, thisArg) { + return function () { + fn.apply(thisArg, arguments); + }; + } + function Promise(fn) { + if (typeof this !== 'object') + throw new TypeError('Promises must be constructed via new'); + if (typeof fn !== 'function') + throw new TypeError('not a function'); + this._state = 0; + this._handled = false; + this._value = undefined; + this._deferreds = []; + doResolve(fn, this); + } + function handle(self, deferred) { + while (self._state === 3) { + self = self._value; + } + if (self._state === 0) { + self._deferreds.push(deferred); + return; + } + self._handled = true; + Promise._immediateFn(function () { + var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (self._state === 1 ? resolve : reject)(deferred.promise, self._value); + return; + } + var ret; + try { + ret = cb(self._value); + } catch (e) { + reject(deferred.promise, e); + return; + } + resolve(deferred.promise, ret); + }); + } + function resolve(self, newValue) { + try { + if (newValue === self) + throw new TypeError('A promise cannot be resolved with itself.'); + if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { + var then = newValue.then; + if (newValue instanceof Promise) { + self._state = 3; + self._value = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(bind(then, newValue), self); + return; } - - function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - var len = queue.length; - while (len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); + } + self._state = 1; + self._value = newValue; + finale(self); + } catch (e) { + reject(self, e); + } + } + function reject(self, newValue) { + self._state = 2; + self._value = newValue; + finale(self); + } + function finale(self) { + if (self._state === 2 && self._deferreds.length === 0) { + Promise._immediateFn(function () { + if (!self._handled) { + Promise._unhandledRejectionFn(self._value); } - - process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); + }); + } + for (var i = 0, len = self._deferreds.length; i < len; i++) { + handle(self, self._deferreds[i]); + } + self._deferreds = null; + } + function Handler(onFulfilled, onRejected, promise) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; + } + function doResolve(fn, self) { + var done = false; + try { + fn(function (value) { + if (done) + return; + done = true; + resolve(self, value); + }, function (reason) { + if (done) + return; + done = true; + reject(self, reason); + }); + } catch (ex) { + if (done) + return; + done = true; + reject(self, ex); + } + } + Promise.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); + }; + Promise.prototype.then = function (onFulfilled, onRejected) { + var prom = new this.constructor(noop); + handle(this, new Handler(onFulfilled, onRejected, prom)); + return prom; + }; + Promise.all = function (arr) { + var args = Array.prototype.slice.call(arr); + return new Promise(function (resolve, reject) { + if (args.length === 0) + return resolve([]); + var remaining = args.length; + function res(i, val) { + try { + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call(val, function (val) { + res(i, val); + }, reject); + return; } - }; - - function Item(fun, array) { - this.fun = fun; - this.array = array; - } - - Item.prototype.run = function () { - this.fun.apply(null, this.array); - }; - process.title = 'browser'; - process.browser = true; - process.env = {}; - process.argv = []; - process.version = ''; - process.versions = {}; - - function noop() { + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); } - - process.on = noop; - process.addListener = noop; - process.once = noop; - process.off = noop; - process.removeListener = noop; - process.removeAllListeners = noop; - process.emit = noop; - process.prependListener = noop; - process.prependOnceListener = noop; - process.listeners = function (name) { - return []; - }; - process.binding = function (name) { - throw new Error('process.binding is not supported'); - }; - process.cwd = function () { - return '/'; - }; - process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); - }; - process.umask = function () { - return 0; - }; - }, - {} - ], - 2: [ - function (require, module, exports) { - (function (setImmediate) { - (function (root) { - var setTimeoutFunc = setTimeout; - - function noop() { - } - - function bind(fn, thisArg) { - return function () { - fn.apply(thisArg, arguments); - }; - } - - function Promise(fn) { - if (typeof this !== 'object') - throw new TypeError('Promises must be constructed via new'); - if (typeof fn !== 'function') - throw new TypeError('not a function'); - this._state = 0; - this._handled = false; - this._value = undefined; - this._deferreds = []; - doResolve(fn, this); - } - - function handle(self, deferred) { - while (self._state === 3) { - self = self._value; - } - if (self._state === 0) { - self._deferreds.push(deferred); - return; - } - self._handled = true; - Promise._immediateFn(function () { - var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; - if (cb === null) { - (self._state === 1 ? resolve : reject)(deferred.promise, self._value); - return; - } - var ret; - try { - ret = cb(self._value); - } catch (e) { - reject(deferred.promise, e); - return; - } - resolve(deferred.promise, ret); - }); - } - - function resolve(self, newValue) { - try { - if (newValue === self) - throw new TypeError('A promise cannot be resolved with itself.'); - if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { - var then = newValue.then; - if (newValue instanceof Promise) { - self._state = 3; - self._value = newValue; - finale(self); - return; - } else if (typeof then === 'function') { - doResolve(bind(then, newValue), self); - return; - } - } - self._state = 1; - self._value = newValue; - finale(self); - } catch (e) { - reject(self, e); - } - } - - function reject(self, newValue) { - self._state = 2; - self._value = newValue; - finale(self); - } - - function finale(self) { - if (self._state === 2 && self._deferreds.length === 0) { - Promise._immediateFn(function () { - if (!self._handled) { - Promise._unhandledRejectionFn(self._value); - } - }); - } - for (var i = 0, len = self._deferreds.length; i < len; i++) { - handle(self, self._deferreds[i]); - } - self._deferreds = null; - } - - function Handler(onFulfilled, onRejected, promise) { - this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; - this.onRejected = typeof onRejected === 'function' ? onRejected : null; - this.promise = promise; - } - - function doResolve(fn, self) { - var done = false; - try { - fn(function (value) { - if (done) - return; - done = true; - resolve(self, value); - }, function (reason) { - if (done) - return; - done = true; - reject(self, reason); - }); - } catch (ex) { - if (done) - return; - done = true; - reject(self, ex); - } - } - - Promise.prototype['catch'] = function (onRejected) { - return this.then(null, onRejected); - }; - Promise.prototype.then = function (onFulfilled, onRejected) { - var prom = new this.constructor(noop); - handle(this, new Handler(onFulfilled, onRejected, prom)); - return prom; - }; - Promise.all = function (arr) { - var args = Array.prototype.slice.call(arr); - return new Promise(function (resolve, reject) { - if (args.length === 0) - return resolve([]); - var remaining = args.length; - - function res(i, val) { - try { - if (val && (typeof val === 'object' || typeof val === 'function')) { - var then = val.then; - if (typeof then === 'function') { - then.call(val, function (val) { - res(i, val); - }, reject); - return; - } - } - args[i] = val; - if (--remaining === 0) { - resolve(args); - } - } catch (ex) { - reject(ex); - } - } - - for (var i = 0; i < args.length; i++) { - res(i, args[i]); - } - }); - }; - Promise.resolve = function (value) { - if (value && typeof value === 'object' && value.constructor === Promise) { - return value; - } - return new Promise(function (resolve) { - resolve(value); - }); - }; - Promise.reject = function (value) { - return new Promise(function (resolve, reject) { - reject(value); - }); - }; - Promise.race = function (values) { - return new Promise(function (resolve, reject) { - for (var i = 0, len = values.length; i < len; i++) { - values[i].then(resolve, reject); - } - }); - }; - Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) { - setImmediate(fn); - } : function (fn) { - setTimeoutFunc(fn, 0); - }; - Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { - if (typeof console !== 'undefined' && console) { - console.warn('Possible Unhandled Promise Rejection:', err); - } - }; - Promise._setImmediateFn = function _setImmediateFn(fn) { - Promise._immediateFn = fn; - }; - Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) { - Promise._unhandledRejectionFn = fn; - }; - if (typeof module !== 'undefined' && module.exports) { - module.exports = Promise; - } else if (!root.Promise) { - root.Promise = Promise; - } - }(this)); - }.call(this, require('timers').setImmediate)); - }, - {'timers': 3} - ], - 3: [ - function (require, module, exports) { - (function (setImmediate, clearImmediate) { - var nextTick = require('process/browser.js').nextTick; - var apply = Function.prototype.apply; - var slice = Array.prototype.slice; - var immediateIds = {}; - var nextImmediateId = 0; - exports.setTimeout = function () { - return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); - }; - exports.setInterval = function () { - return new Timeout(apply.call(setInterval, window, arguments), clearInterval); - }; - exports.clearTimeout = exports.clearInterval = function (timeout) { - timeout.close(); - }; - - function Timeout(id, clearFn) { - this._id = id; - this._clearFn = clearFn; - } - - Timeout.prototype.unref = Timeout.prototype.ref = function () { - }; - Timeout.prototype.close = function () { - this._clearFn.call(window, this._id); - }; - exports.enroll = function (item, msecs) { - clearTimeout(item._idleTimeoutId); - item._idleTimeout = msecs; - }; - exports.unenroll = function (item) { - clearTimeout(item._idleTimeoutId); - item._idleTimeout = -1; - }; - exports._unrefActive = exports.active = function (item) { - clearTimeout(item._idleTimeoutId); - var msecs = item._idleTimeout; - if (msecs >= 0) { - item._idleTimeoutId = setTimeout(function onTimeout() { - if (item._onTimeout) - item._onTimeout(); - }, msecs); - } - }; - exports.setImmediate = typeof setImmediate === 'function' ? setImmediate : function (fn) { - var id = nextImmediateId++; - var args = arguments.length < 2 ? false : slice.call(arguments, 1); - immediateIds[id] = true; - nextTick(function onNextTick() { - if (immediateIds[id]) { - if (args) { - fn.apply(null, args); - } else { - fn.call(null); - } - exports.clearImmediate(id); - } - }); - return id; - }; - exports.clearImmediate = typeof clearImmediate === 'function' ? clearImmediate : function (id) { - delete immediateIds[id]; - }; - }.call(this, require('timers').setImmediate, require('timers').clearImmediate)); - }, - { - 'process/browser.js': 1, - 'timers': 3 + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; } - ], - 4: [ - function (require, module, exports) { - var promisePolyfill = require('promise-polyfill'); - var Global = function () { - if (typeof window !== 'undefined') { - return window; - } else { - return Function('return this;')(); - } - }(); - module.exports = {boltExport: Global.Promise || promisePolyfill}; - }, - {'promise-polyfill': 2} - ] - }, {}, [4])(4); - })); + return new Promise(function (resolve) { + resolve(value); + }); + }; + Promise.reject = function (value) { + return new Promise(function (resolve, reject) { + reject(value); + }); + }; + Promise.race = function (values) { + return new Promise(function (resolve, reject) { + for (var i = 0, len = values.length; i < len; i++) { + values[i].then(resolve, reject); + } + }); + }; + Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) { + setImmediate(fn); + } : function (fn) { + setTimeoutFunc(fn, 0); + }; + Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { + if (typeof console !== 'undefined' && console) { + console.warn('Possible Unhandled Promise Rejection:', err); + } + }; + Promise._setImmediateFn = function _setImmediateFn(fn) { + Promise._immediateFn = fn; + }; + Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) { + Promise._unhandledRejectionFn = fn; + }; + if (typeof module !== 'undefined' && module.exports) { + module.exports = Promise; + } else if (!root.Promise) { + root.Promise = Promise; + } + }(this)); + }.call(this, require('timers').setImmediate)); + }, + { 'timers': 3 } + ], + 3: [ + function (require, module, exports) { + (function (setImmediate, clearImmediate) { + var nextTick = require('process/browser.js').nextTick; + var apply = Function.prototype.apply; + var slice = Array.prototype.slice; + var immediateIds = {}; + var nextImmediateId = 0; + exports.setTimeout = function () { + return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); + }; + exports.setInterval = function () { + return new Timeout(apply.call(setInterval, window, arguments), clearInterval); + }; + exports.clearTimeout = exports.clearInterval = function (timeout) { + timeout.close(); + }; + function Timeout(id, clearFn) { + this._id = id; + this._clearFn = clearFn; + } + Timeout.prototype.unref = Timeout.prototype.ref = function () { + }; + Timeout.prototype.close = function () { + this._clearFn.call(window, this._id); + }; + exports.enroll = function (item, msecs) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = msecs; + }; + exports.unenroll = function (item) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = -1; + }; + exports._unrefActive = exports.active = function (item) { + clearTimeout(item._idleTimeoutId); + var msecs = item._idleTimeout; + if (msecs >= 0) { + item._idleTimeoutId = setTimeout(function onTimeout() { + if (item._onTimeout) + item._onTimeout(); + }, msecs); + } + }; + exports.setImmediate = typeof setImmediate === 'function' ? setImmediate : function (fn) { + var id = nextImmediateId++; + var args = arguments.length < 2 ? false : slice.call(arguments, 1); + immediateIds[id] = true; + nextTick(function onNextTick() { + if (immediateIds[id]) { + if (args) { + fn.apply(null, args); + } else { + fn.call(null); + } + exports.clearImmediate(id); + } + }); + return id; + }; + exports.clearImmediate = typeof clearImmediate === 'function' ? clearImmediate : function (id) { + delete immediateIds[id]; + }; + }.call(this, require('timers').setImmediate, require('timers').clearImmediate)); + }, + { + 'process/browser.js': 1, + 'timers': 3 + } + ], + 4: [ + function (require, module, exports) { + var promisePolyfill = require('promise-polyfill'); + var Global = function () { + if (typeof window !== 'undefined') { + return window; + } else { + return Function('return this;')(); + } + }(); + module.exports = { boltExport: Global.Promise || promisePolyfill }; + }, + { 'promise-polyfill': 2 } + ] + }, {}, [4])(4); + })); }(undefined, exports$1, module, undefined)); var Promise$1 = module.exports.boltExport; var nu$7 = function (baseFn) { - var data = Optional.none(); - var callbacks = []; - var map = function (f) { - return nu$7(function (nCallback) { - get(function (data) { - nCallback(f(data)); - }); - }); - }; - var get = function (nCallback) { - if (isReady()) { - call(nCallback); - } else { - callbacks.push(nCallback); - } - }; - var set = function (x) { - if (!isReady()) { - data = Optional.some(x); - run(callbacks); - callbacks = []; - } - }; - var isReady = function () { - return data.isSome(); - }; - var run = function (cbs) { - each(cbs, call); - }; - var call = function (cb) { - data.each(function (x) { - setTimeout(function () { - cb(x); - }, 0); - }); - }; - baseFn(set); - return { - get: get, - map: map, - isReady: isReady - }; + var data = Optional.none(); + var callbacks = []; + var map = function (f) { + return nu$7(function (nCallback) { + get(function (data) { + nCallback(f(data)); + }); + }); + }; + var get = function (nCallback) { + if (isReady()) { + call(nCallback); + } else { + callbacks.push(nCallback); + } + }; + var set = function (x) { + if (!isReady()) { + data = Optional.some(x); + run(callbacks); + callbacks = []; + } + }; + var isReady = function () { + return data.isSome(); + }; + var run = function (cbs) { + each(cbs, call); + }; + var call = function (cb) { + data.each(function (x) { + setTimeout(function () { + cb(x); + }, 0); + }); + }; + baseFn(set); + return { + get: get, + map: map, + isReady: isReady + }; }; var pure$1 = function (a) { - return nu$7(function (callback) { - callback(a); - }); + return nu$7(function (callback) { + callback(a); + }); }; var LazyValue = { - nu: nu$7, - pure: pure$1 + nu: nu$7, + pure: pure$1 }; var errorReporter = function (err) { - setTimeout(function () { - throw err; - }, 0); + setTimeout(function () { + throw err; + }, 0); }; var make$4 = function (run) { - var get = function (callback) { - run().then(callback, errorReporter); - }; - var map = function (fab) { - return make$4(function () { - return run().then(fab); - }); - }; - var bind = function (aFutureB) { - return make$4(function () { - return run().then(function (v) { - return aFutureB(v).toPromise(); - }); - }); - }; - var anonBind = function (futureB) { - return make$4(function () { - return run().then(function () { - return futureB.toPromise(); - }); - }); - }; - var toLazy = function () { - return LazyValue.nu(get); - }; - var toCached = function () { - var cache = null; - return make$4(function () { - if (cache === null) { - cache = run(); - } - return cache; - }); - }; - var toPromise = run; - return { - map: map, - bind: bind, - anonBind: anonBind, - toLazy: toLazy, - toCached: toCached, - toPromise: toPromise, - get: get - }; - }; - var nu$8 = function (baseFn) { + var get = function (callback) { + run().then(callback, errorReporter); + }; + var map = function (fab) { return make$4(function () { - return new Promise$1(baseFn); + return run().then(fab); }); - }; - var pure$2 = function (a) { + }; + var bind = function (aFutureB) { return make$4(function () { - return Promise$1.resolve(a); + return run().then(function (v) { + return aFutureB(v).toPromise(); + }); }); + }; + var anonBind = function (futureB) { + return make$4(function () { + return run().then(function () { + return futureB.toPromise(); + }); + }); + }; + var toLazy = function () { + return LazyValue.nu(get); + }; + var toCached = function () { + var cache = null; + return make$4(function () { + if (cache === null) { + cache = run(); + } + return cache; + }); + }; + var toPromise = run; + return { + map: map, + bind: bind, + anonBind: anonBind, + toLazy: toLazy, + toCached: toCached, + toPromise: toPromise, + get: get + }; + }; + var nu$8 = function (baseFn) { + return make$4(function () { + return new Promise$1(baseFn); + }); + }; + var pure$2 = function (a) { + return make$4(function () { + return Promise$1.resolve(a); + }); }; var Future = { - nu: nu$8, - pure: pure$2 + nu: nu$8, + pure: pure$2 }; var adjust = function (value, destination, amount) { - if (Math.abs(value - destination) <= amount) { - return Optional.none(); - } else if (value < destination) { - return Optional.some(value + amount); - } else { - return Optional.some(value - amount); - } + if (Math.abs(value - destination) <= amount) { + return Optional.none(); + } else if (value < destination) { + return Optional.some(value + amount); + } else { + return Optional.some(value - amount); + } }; var create$5 = function () { - var interval = null; - var animate = function (getCurrent, destination, amount, increment, doFinish, rate) { - var finished = false; - var finish = function (v) { - finished = true; - doFinish(v); - }; + var interval = null; + var animate = function (getCurrent, destination, amount, increment, doFinish, rate) { + var finished = false; + var finish = function (v) { + finished = true; + doFinish(v); + }; + global$4.clearInterval(interval); + var abort = function (v) { + global$4.clearInterval(interval); + finish(v); + }; + interval = global$4.setInterval(function () { + var value = getCurrent(); + adjust(value, destination, amount).fold(function () { global$4.clearInterval(interval); - var abort = function (v) { + finish(destination); + }, function (s) { + increment(s, abort); + if (!finished) { + var newValue = getCurrent(); + if (newValue !== s || Math.abs(newValue - destination) > Math.abs(value - destination)) { global$4.clearInterval(interval); - finish(v); - }; - interval = global$4.setInterval(function () { - var value = getCurrent(); - adjust(value, destination, amount).fold(function () { - global$4.clearInterval(interval); - finish(destination); - }, function (s) { - increment(s, abort); - if (!finished) { - var newValue = getCurrent(); - if (newValue !== s || Math.abs(newValue - destination) > Math.abs(value - destination)) { - global$4.clearInterval(interval); - finish(destination); - } - } - }); - }, rate); - }; - return {animate: animate}; + finish(destination); + } + } + }); + }, rate); + }; + return { animate: animate }; }; var findDevice = function (deviceWidth, deviceHeight) { - var devices = [ - { - width: 320, - height: 480, - keyboard: { - portrait: 300, - landscape: 240 - } - }, - { - width: 320, - height: 568, - keyboard: { - portrait: 300, - landscape: 240 - } - }, - { - width: 375, - height: 667, - keyboard: { - portrait: 305, - landscape: 240 - } - }, - { - width: 414, - height: 736, - keyboard: { - portrait: 320, - landscape: 240 - } - }, - { - width: 768, - height: 1024, - keyboard: { - portrait: 320, - landscape: 400 - } - }, - { - width: 1024, - height: 1366, - keyboard: { - portrait: 380, - landscape: 460 - } - } - ]; - return findMap(devices, function (device) { - return someIf(deviceWidth <= device.width && deviceHeight <= device.height, device.keyboard); - }).getOr({ - portrait: deviceHeight / 5, - landscape: deviceWidth / 4 - }); + var devices = [ + { + width: 320, + height: 480, + keyboard: { + portrait: 300, + landscape: 240 + } + }, + { + width: 320, + height: 568, + keyboard: { + portrait: 300, + landscape: 240 + } + }, + { + width: 375, + height: 667, + keyboard: { + portrait: 305, + landscape: 240 + } + }, + { + width: 414, + height: 736, + keyboard: { + portrait: 320, + landscape: 240 + } + }, + { + width: 768, + height: 1024, + keyboard: { + portrait: 320, + landscape: 400 + } + }, + { + width: 1024, + height: 1366, + keyboard: { + portrait: 380, + landscape: 460 + } + } + ]; + return findMap(devices, function (device) { + return someIf(deviceWidth <= device.width && deviceHeight <= device.height, device.keyboard); + }).getOr({ + portrait: deviceHeight / 5, + landscape: deviceWidth / 4 + }); }; var softKeyboardLimits = function (outerWindow) { - return findDevice(outerWindow.screen.width, outerWindow.screen.height); + return findDevice(outerWindow.screen.width, outerWindow.screen.height); }; var accountableKeyboardHeight = function (outerWindow) { - var portrait = get$c(outerWindow).isPortrait(); - var limits = softKeyboardLimits(outerWindow); - var keyboard = portrait ? limits.portrait : limits.landscape; - var visualScreenHeight = portrait ? outerWindow.screen.height : outerWindow.screen.width; - return visualScreenHeight - outerWindow.innerHeight > keyboard ? 0 : keyboard; + var portrait = get$c(outerWindow).isPortrait(); + var limits = softKeyboardLimits(outerWindow); + var keyboard = portrait ? limits.portrait : limits.landscape; + var visualScreenHeight = portrait ? outerWindow.screen.height : outerWindow.screen.width; + return visualScreenHeight - outerWindow.innerHeight > keyboard ? 0 : keyboard; }; var getGreenzone = function (socket, dropup) { - var outerWindow = owner(socket).dom.defaultView; - var viewportHeight = get$6(socket) + get$6(dropup); - var acc = accountableKeyboardHeight(outerWindow); - return viewportHeight - acc; + var outerWindow = owner(socket).dom.defaultView; + var viewportHeight = get$6(socket) + get$6(dropup); + var acc = accountableKeyboardHeight(outerWindow); + return viewportHeight - acc; }; var updatePadding = function (contentBody, socket, dropup) { - var greenzoneHeight = getGreenzone(socket, dropup); - var deltaHeight = get$6(socket) + get$6(dropup) - greenzoneHeight; - set$3(contentBody, 'padding-bottom', deltaHeight + 'px'); + var greenzoneHeight = getGreenzone(socket, dropup); + var deltaHeight = get$6(socket) + get$6(dropup) - greenzoneHeight; + set$3(contentBody, 'padding-bottom', deltaHeight + 'px'); }; var fixture = Adt.generate([ - { - fixed: [ - 'element', - 'property', - 'offsetY' - ] - }, - { - scroller: [ - 'element', - 'offsetY' - ] - } + { + fixed: [ + 'element', + 'property', + 'offsetY' + ] + }, + { + scroller: [ + 'element', + 'offsetY' + ] + } ]); var yFixedData = 'data-' + resolve('position-y-fixed'); var yFixedProperty = 'data-' + resolve('y-property'); var yScrollingData = 'data-' + resolve('scrolling'); var windowSizeData = 'data-' + resolve('last-window-height'); var getYFixedData = function (element) { - return safeParse(element, yFixedData); + return safeParse(element, yFixedData); }; var getYFixedProperty = function (element) { - return get$2(element, yFixedProperty); + return get$2(element, yFixedProperty); }; var getLastWindowSize = function (element) { - return safeParse(element, windowSizeData); + return safeParse(element, windowSizeData); }; var classifyFixed = function (element, offsetY) { - var prop = getYFixedProperty(element); - return fixture.fixed(element, prop, offsetY); + var prop = getYFixedProperty(element); + return fixture.fixed(element, prop, offsetY); }; var classifyScrolling = function (element, offsetY) { - return fixture.scroller(element, offsetY); + return fixture.scroller(element, offsetY); }; var classify = function (element) { - var offsetY = getYFixedData(element); - var classifier = get$2(element, yScrollingData) === 'true' ? classifyScrolling : classifyFixed; - return classifier(element, offsetY); + var offsetY = getYFixedData(element); + var classifier = get$2(element, yScrollingData) === 'true' ? classifyScrolling : classifyFixed; + return classifier(element, offsetY); }; var findFixtures = function (container) { - var candidates = descendants(container, '[' + yFixedData + ']'); - return map(candidates, classify); + var candidates = descendants(container, '[' + yFixedData + ']'); + return map(candidates, classify); }; var takeoverToolbar = function (toolbar) { - var oldToolbarStyle = get$2(toolbar, 'style'); - setAll$1(toolbar, { - position: 'absolute', - top: '0px' - }); - set(toolbar, yFixedData, '0px'); - set(toolbar, yFixedProperty, 'top'); - var restore = function () { - set(toolbar, 'style', oldToolbarStyle || ''); - remove$1(toolbar, yFixedData); - remove$1(toolbar, yFixedProperty); - }; - return {restore: restore}; + var oldToolbarStyle = get$2(toolbar, 'style'); + setAll$1(toolbar, { + position: 'absolute', + top: '0px' + }); + set(toolbar, yFixedData, '0px'); + set(toolbar, yFixedProperty, 'top'); + var restore = function () { + set(toolbar, 'style', oldToolbarStyle || ''); + remove$1(toolbar, yFixedData); + remove$1(toolbar, yFixedProperty); + }; + return { restore: restore }; }; var takeoverViewport = function (toolbarHeight, height, viewport) { - var oldViewportStyle = get$2(viewport, 'style'); - register(viewport); - setAll$1(viewport, { - position: 'absolute', - height: height + 'px', - width: '100%', - top: toolbarHeight + 'px' - }); - set(viewport, yFixedData, toolbarHeight + 'px'); - set(viewport, yScrollingData, 'true'); - set(viewport, yFixedProperty, 'top'); - var restore = function () { - deregister(viewport); - set(viewport, 'style', oldViewportStyle || ''); - remove$1(viewport, yFixedData); - remove$1(viewport, yScrollingData); - remove$1(viewport, yFixedProperty); - }; - return {restore: restore}; + var oldViewportStyle = get$2(viewport, 'style'); + register(viewport); + setAll$1(viewport, { + position: 'absolute', + height: height + 'px', + width: '100%', + top: toolbarHeight + 'px' + }); + set(viewport, yFixedData, toolbarHeight + 'px'); + set(viewport, yScrollingData, 'true'); + set(viewport, yFixedProperty, 'top'); + var restore = function () { + deregister(viewport); + set(viewport, 'style', oldViewportStyle || ''); + remove$1(viewport, yFixedData); + remove$1(viewport, yScrollingData); + remove$1(viewport, yFixedProperty); + }; + return { restore: restore }; }; var takeoverDropup = function (dropup) { - var oldDropupStyle = get$2(dropup, 'style'); - setAll$1(dropup, { - position: 'absolute', - bottom: '0px' - }); - set(dropup, yFixedData, '0px'); - set(dropup, yFixedProperty, 'bottom'); - var restore = function () { - set(dropup, 'style', oldDropupStyle || ''); - remove$1(dropup, yFixedData); - remove$1(dropup, yFixedProperty); - }; - return {restore: restore}; + var oldDropupStyle = get$2(dropup, 'style'); + setAll$1(dropup, { + position: 'absolute', + bottom: '0px' + }); + set(dropup, yFixedData, '0px'); + set(dropup, yFixedProperty, 'bottom'); + var restore = function () { + set(dropup, 'style', oldDropupStyle || ''); + remove$1(dropup, yFixedData); + remove$1(dropup, yFixedProperty); + }; + return { restore: restore }; }; var deriveViewportHeight = function (viewport, toolbarHeight, dropupHeight) { - var outerWindow = owner(viewport).dom.defaultView; - var winH = outerWindow.innerHeight; - set(viewport, windowSizeData, winH + 'px'); - return winH - toolbarHeight - dropupHeight; + var outerWindow = owner(viewport).dom.defaultView; + var winH = outerWindow.innerHeight; + set(viewport, windowSizeData, winH + 'px'); + return winH - toolbarHeight - dropupHeight; }; var takeover$1 = function (viewport, contentBody, toolbar, dropup) { - var outerWindow = owner(viewport).dom.defaultView; - var toolbarSetup = takeoverToolbar(toolbar); - var toolbarHeight = get$6(toolbar); - var dropupHeight = get$6(dropup); - var viewportHeight = deriveViewportHeight(viewport, toolbarHeight, dropupHeight); - var viewportSetup = takeoverViewport(toolbarHeight, viewportHeight, viewport); - var dropupSetup = takeoverDropup(dropup); - var isActive = true; - var restore = function () { - isActive = false; - toolbarSetup.restore(); - viewportSetup.restore(); - dropupSetup.restore(); - }; - var isExpanding = function () { - var currentWinHeight = outerWindow.innerHeight; - var lastWinHeight = getLastWindowSize(viewport); - return currentWinHeight > lastWinHeight; - }; - var refresh = function () { - if (isActive) { - var newToolbarHeight = get$6(toolbar); - var dropupHeight_1 = get$6(dropup); - var newHeight = deriveViewportHeight(viewport, newToolbarHeight, dropupHeight_1); - set(viewport, yFixedData, newToolbarHeight + 'px'); - set$3(viewport, 'height', newHeight + 'px'); - updatePadding(contentBody, viewport, dropup); - } - }; - var setViewportOffset = function (newYOffset) { - var offsetPx = newYOffset + 'px'; - set(viewport, yFixedData, offsetPx); - refresh(); - }; - updatePadding(contentBody, viewport, dropup); - return { - setViewportOffset: setViewportOffset, - isExpanding: isExpanding, - isShrinking: not(isExpanding), - refresh: refresh, - restore: restore - }; + var outerWindow = owner(viewport).dom.defaultView; + var toolbarSetup = takeoverToolbar(toolbar); + var toolbarHeight = get$6(toolbar); + var dropupHeight = get$6(dropup); + var viewportHeight = deriveViewportHeight(viewport, toolbarHeight, dropupHeight); + var viewportSetup = takeoverViewport(toolbarHeight, viewportHeight, viewport); + var dropupSetup = takeoverDropup(dropup); + var isActive = true; + var restore = function () { + isActive = false; + toolbarSetup.restore(); + viewportSetup.restore(); + dropupSetup.restore(); + }; + var isExpanding = function () { + var currentWinHeight = outerWindow.innerHeight; + var lastWinHeight = getLastWindowSize(viewport); + return currentWinHeight > lastWinHeight; + }; + var refresh = function () { + if (isActive) { + var newToolbarHeight = get$6(toolbar); + var dropupHeight_1 = get$6(dropup); + var newHeight = deriveViewportHeight(viewport, newToolbarHeight, dropupHeight_1); + set(viewport, yFixedData, newToolbarHeight + 'px'); + set$3(viewport, 'height', newHeight + 'px'); + updatePadding(contentBody, viewport, dropup); + } + }; + var setViewportOffset = function (newYOffset) { + var offsetPx = newYOffset + 'px'; + set(viewport, yFixedData, offsetPx); + refresh(); + }; + updatePadding(contentBody, viewport, dropup); + return { + setViewportOffset: setViewportOffset, + isExpanding: isExpanding, + isShrinking: not(isExpanding), + refresh: refresh, + restore: restore + }; }; var animator = create$5(); @@ -12940,705 +12887,704 @@ var ANIMATION_RATE = 10; var lastScroll = 'data-' + resolve('last-scroll-top'); var getTop = function (element) { - var raw = getRaw(element, 'top').getOr('0'); - return parseInt(raw, 10); + var raw = getRaw(element, 'top').getOr('0'); + return parseInt(raw, 10); }; var getScrollTop = function (element) { - return parseInt(element.dom.scrollTop, 10); + return parseInt(element.dom.scrollTop, 10); }; var moveScrollAndTop = function (element, destination, finalTop) { - return Future.nu(function (callback) { - var getCurrent = curry(getScrollTop, element); - var update = function (newScroll) { - element.dom.scrollTop = newScroll; - set$3(element, 'top', getTop(element) + ANIMATION_STEP + 'px'); - }; - var finish = function () { - element.dom.scrollTop = destination; - set$3(element, 'top', finalTop + 'px'); - callback(destination); - }; - animator.animate(getCurrent, destination, ANIMATION_STEP, update, finish, ANIMATION_RATE); - }); + return Future.nu(function (callback) { + var getCurrent = curry(getScrollTop, element); + var update = function (newScroll) { + element.dom.scrollTop = newScroll; + set$3(element, 'top', getTop(element) + ANIMATION_STEP + 'px'); + }; + var finish = function () { + element.dom.scrollTop = destination; + set$3(element, 'top', finalTop + 'px'); + callback(destination); + }; + animator.animate(getCurrent, destination, ANIMATION_STEP, update, finish, ANIMATION_RATE); + }); }; var moveOnlyScroll = function (element, destination) { - return Future.nu(function (callback) { - var getCurrent = curry(getScrollTop, element); - set(element, lastScroll, getCurrent()); - var update = function (newScroll, abort) { - var previous = safeParse(element, lastScroll); - if (previous !== element.dom.scrollTop) { - abort(element.dom.scrollTop); - } else { - element.dom.scrollTop = newScroll; - set(element, lastScroll, newScroll); - } - }; - var finish = function () { - element.dom.scrollTop = destination; - set(element, lastScroll, destination); - callback(destination); - }; - var distance = Math.abs(destination - getCurrent()); - var step = Math.ceil(distance / NUM_TOP_ANIMATION_FRAMES); - animator.animate(getCurrent, destination, step, update, finish, ANIMATION_RATE); - }); + return Future.nu(function (callback) { + var getCurrent = curry(getScrollTop, element); + set(element, lastScroll, getCurrent()); + var update = function (newScroll, abort) { + var previous = safeParse(element, lastScroll); + if (previous !== element.dom.scrollTop) { + abort(element.dom.scrollTop); + } else { + element.dom.scrollTop = newScroll; + set(element, lastScroll, newScroll); + } + }; + var finish = function () { + element.dom.scrollTop = destination; + set(element, lastScroll, destination); + callback(destination); + }; + var distance = Math.abs(destination - getCurrent()); + var step = Math.ceil(distance / NUM_TOP_ANIMATION_FRAMES); + animator.animate(getCurrent, destination, step, update, finish, ANIMATION_RATE); + }); }; var moveOnlyTop = function (element, destination) { - return Future.nu(function (callback) { - var getCurrent = curry(getTop, element); - var update = function (newTop) { - set$3(element, 'top', newTop + 'px'); - }; - var finish = function () { - update(destination); - callback(destination); - }; - var distance = Math.abs(destination - getCurrent()); - var step = Math.ceil(distance / NUM_TOP_ANIMATION_FRAMES); - animator.animate(getCurrent, destination, step, update, finish, ANIMATION_RATE); - }); + return Future.nu(function (callback) { + var getCurrent = curry(getTop, element); + var update = function (newTop) { + set$3(element, 'top', newTop + 'px'); + }; + var finish = function () { + update(destination); + callback(destination); + }; + var distance = Math.abs(destination - getCurrent()); + var step = Math.ceil(distance / NUM_TOP_ANIMATION_FRAMES); + animator.animate(getCurrent, destination, step, update, finish, ANIMATION_RATE); + }); }; var updateTop = function (element, amount) { - var newTop = amount + getYFixedData(element) + 'px'; - set$3(element, 'top', newTop); + var newTop = amount + getYFixedData(element) + 'px'; + set$3(element, 'top', newTop); }; var moveWindowScroll = function (toolbar, viewport, destY) { - var outerWindow = owner(toolbar).dom.defaultView; - return Future.nu(function (callback) { - updateTop(toolbar, destY); - updateTop(viewport, destY); - outerWindow.scrollTo(0, destY); - callback(destY); - }); - }; - - function BackgroundActivity(doAction) { - var action = Cell(LazyValue.pure({})); - var start = function (value) { - var future = LazyValue.nu(function (callback) { - return doAction(value).get(callback); - }); - action.set(future); - }; - var idle = function (g) { - action.get().get(function () { - g(); - }); - }; - return { - start: start, - idle: idle - }; + var outerWindow = owner(toolbar).dom.defaultView; + return Future.nu(function (callback) { + updateTop(toolbar, destY); + updateTop(viewport, destY); + outerWindow.scrollTo(0, destY); + callback(destY); + }); + }; + + function BackgroundActivity (doAction) { + var action = Cell(LazyValue.pure({})); + var start = function (value) { + var future = LazyValue.nu(function (callback) { + return doAction(value).get(callback); + }); + action.set(future); + }; + var idle = function (g) { + action.get().get(function () { + g(); + }); + }; + return { + start: start, + idle: idle + }; } var scrollIntoView = function (cWin, socket, dropup, top, bottom) { - var greenzone = getGreenzone(socket, dropup); - var refreshCursor = curry(refresh$1, cWin); - if (top > greenzone || bottom > greenzone) { - moveOnlyScroll(socket, socket.dom.scrollTop - greenzone + bottom).get(refreshCursor); - } else if (top < 0) { - moveOnlyScroll(socket, socket.dom.scrollTop + top).get(refreshCursor); - } else ; + var greenzone = getGreenzone(socket, dropup); + var refreshCursor = curry(refresh$1, cWin); + if (top > greenzone || bottom > greenzone) { + moveOnlyScroll(socket, socket.dom.scrollTop - greenzone + bottom).get(refreshCursor); + } else if (top < 0) { + moveOnlyScroll(socket, socket.dom.scrollTop + top).get(refreshCursor); + } else ; }; var par = function (asyncValues, nu) { - return nu(function (callback) { - var r = []; - var count = 0; - var cb = function (i) { - return function (value) { - r[i] = value; - count++; - if (count >= asyncValues.length) { - callback(r); - } - }; - }; - if (asyncValues.length === 0) { - callback([]); - } else { - each(asyncValues, function (asyncValue, i) { - asyncValue.get(cb(i)); - }); - } - }); + return nu(function (callback) { + var r = []; + var count = 0; + var cb = function (i) { + return function (value) { + r[i] = value; + count++; + if (count >= asyncValues.length) { + callback(r); + } + }; + }; + if (asyncValues.length === 0) { + callback([]); + } else { + each(asyncValues, function (asyncValue, i) { + asyncValue.get(cb(i)); + }); + } + }); }; var par$1 = function (futures) { - return par(futures, Future.nu); + return par(futures, Future.nu); }; var updateFixed = function (element, property, winY, offsetY) { - var destination = winY + offsetY; - set$3(element, property, destination + 'px'); - return Future.pure(offsetY); + var destination = winY + offsetY; + set$3(element, property, destination + 'px'); + return Future.pure(offsetY); }; var updateScrollingFixed = function (element, winY, offsetY) { - var destTop = winY + offsetY; - var oldProp = getRaw(element, 'top').getOr(offsetY); - var delta = destTop - parseInt(oldProp, 10); - var destScroll = element.dom.scrollTop + delta; - return moveScrollAndTop(element, destScroll, destTop); + var destTop = winY + offsetY; + var oldProp = getRaw(element, 'top').getOr(offsetY); + var delta = destTop - parseInt(oldProp, 10); + var destScroll = element.dom.scrollTop + delta; + return moveScrollAndTop(element, destScroll, destTop); }; var updateFixture = function (fixture, winY) { - return fixture.fold(function (element, property, offsetY) { - return updateFixed(element, property, winY, offsetY); - }, function (element, offsetY) { - return updateScrollingFixed(element, winY, offsetY); - }); + return fixture.fold(function (element, property, offsetY) { + return updateFixed(element, property, winY, offsetY); + }, function (element, offsetY) { + return updateScrollingFixed(element, winY, offsetY); + }); }; var updatePositions = function (container, winY) { - var fixtures = findFixtures(container); - var updates = map(fixtures, function (fixture) { - return updateFixture(fixture, winY); - }); - return par$1(updates); + var fixtures = findFixtures(container); + var updates = map(fixtures, function (fixture) { + return updateFixture(fixture, winY); + }); + return par$1(updates); }; var VIEW_MARGIN = 5; var register$2 = function (toolstrip, socket, container, outerWindow, structure, cWin) { - var scroller = BackgroundActivity(function (y) { - return moveWindowScroll(toolstrip, socket, y); - }); - var scrollBounds = function () { - var rects = getRectangles(cWin); - return Optional.from(rects[0]).bind(function (rect) { - var viewTop = rect.top - socket.dom.scrollTop; - var outside = viewTop > outerWindow.innerHeight + VIEW_MARGIN || viewTop < -VIEW_MARGIN; - return outside ? Optional.some({ - top: viewTop, - bottom: viewTop + rect.height - }) : Optional.none(); - }); - }; - var scrollThrottle = last(function () { - scroller.idle(function () { - updatePositions(container, outerWindow.pageYOffset).get(function () { - var extraScroll = scrollBounds(); - extraScroll.each(function (extra) { - socket.dom.scrollTop = socket.dom.scrollTop + extra.top; - }); - scroller.start(0); - structure.refresh(); - }); - }); - }, 1000); - var onScroll = bind$3(SugarElement.fromDom(outerWindow), 'scroll', function () { - if (outerWindow.pageYOffset < 0) { - return; - } - scrollThrottle.throttle(); + var scroller = BackgroundActivity(function (y) { + return moveWindowScroll(toolstrip, socket, y); + }); + var scrollBounds = function () { + var rects = getRectangles(cWin); + return Optional.from(rects[0]).bind(function (rect) { + var viewTop = rect.top - socket.dom.scrollTop; + var outside = viewTop > outerWindow.innerHeight + VIEW_MARGIN || viewTop < -VIEW_MARGIN; + return outside ? Optional.some({ + top: viewTop, + bottom: viewTop + rect.height + }) : Optional.none(); + }); + }; + var scrollThrottle = last(function () { + scroller.idle(function () { + updatePositions(container, outerWindow.pageYOffset).get(function () { + var extraScroll = scrollBounds(); + extraScroll.each(function (extra) { + socket.dom.scrollTop = socket.dom.scrollTop + extra.top; + }); + scroller.start(0); + structure.refresh(); + }); }); - updatePositions(container, outerWindow.pageYOffset).get(identity); - return {unbind: onScroll.unbind}; + }, 1000); + var onScroll = bind$3(SugarElement.fromDom(outerWindow), 'scroll', function () { + if (outerWindow.pageYOffset < 0) { + return; + } + scrollThrottle.throttle(); + }); + updatePositions(container, outerWindow.pageYOffset).get(identity); + return { unbind: onScroll.unbind }; }; var setup$3 = function (bag) { - var cWin = bag.cWin; - var ceBody = bag.ceBody; - var socket = bag.socket; - var toolstrip = bag.toolstrip; - var contentElement = bag.contentElement; - var keyboardType = bag.keyboardType; - var outerWindow = bag.outerWindow; - var dropup = bag.dropup; - var outerBody = bag.outerBody; - var structure = takeover$1(socket, ceBody, toolstrip, dropup); - var keyboardModel = keyboardType(outerBody, cWin, body(), contentElement); - var toEditing = function () { - keyboardModel.toEditing(); - clearSelection(); - }; - var toReading = function () { - keyboardModel.toReading(); - }; - var onToolbarTouch = function (_event) { - keyboardModel.onToolbarTouch(); - }; - var onOrientation = onChange(outerWindow, { - onChange: noop, - onReady: structure.refresh - }); - onOrientation.onAdjustment(function () { - structure.refresh(); - }); - var onResize = bind$3(SugarElement.fromDom(outerWindow), 'resize', function () { - if (structure.isExpanding()) { - structure.refresh(); - } - }); - var onScroll = register$2(toolstrip, socket, outerBody, outerWindow, structure, cWin); - var unfocusedSelection = FakeSelection(cWin, contentElement); - var refreshSelection = function () { - if (unfocusedSelection.isActive()) { - unfocusedSelection.update(); - } - }; - var highlightSelection = function () { - unfocusedSelection.update(); - }; - var clearSelection = function () { - unfocusedSelection.clear(); - }; - var scrollIntoView$1 = function (top, bottom) { - scrollIntoView(cWin, socket, dropup, top, bottom); - }; - var syncHeight = function () { - set$3(contentElement, 'height', contentElement.dom.contentWindow.document.body.scrollHeight + 'px'); - }; - var setViewportOffset = function (newYOffset) { - structure.setViewportOffset(newYOffset); - moveOnlyTop(socket, newYOffset).get(identity); - }; - var destroy = function () { - structure.restore(); - onOrientation.destroy(); - onScroll.unbind(); - onResize.unbind(); - keyboardModel.destroy(); - unfocusedSelection.destroy(); - input$1(body(), blur); - }; - return { - toEditing: toEditing, - toReading: toReading, - onToolbarTouch: onToolbarTouch, - refreshSelection: refreshSelection, - clearSelection: clearSelection, - highlightSelection: highlightSelection, - scrollIntoView: scrollIntoView$1, - updateToolbarPadding: noop, - setViewportOffset: setViewportOffset, - syncHeight: syncHeight, - refreshStructure: structure.refresh, - destroy: destroy - }; + var cWin = bag.cWin; + var ceBody = bag.ceBody; + var socket = bag.socket; + var toolstrip = bag.toolstrip; + var contentElement = bag.contentElement; + var keyboardType = bag.keyboardType; + var outerWindow = bag.outerWindow; + var dropup = bag.dropup; + var outerBody = bag.outerBody; + var structure = takeover$1(socket, ceBody, toolstrip, dropup); + var keyboardModel = keyboardType(outerBody, cWin, body(), contentElement); + var toEditing = function () { + keyboardModel.toEditing(); + clearSelection(); + }; + var toReading = function () { + keyboardModel.toReading(); + }; + var onToolbarTouch = function (_event) { + keyboardModel.onToolbarTouch(); + }; + var onOrientation = onChange(outerWindow, { + onChange: noop, + onReady: structure.refresh + }); + onOrientation.onAdjustment(function () { + structure.refresh(); + }); + var onResize = bind$3(SugarElement.fromDom(outerWindow), 'resize', function () { + if (structure.isExpanding()) { + structure.refresh(); + } + }); + var onScroll = register$2(toolstrip, socket, outerBody, outerWindow, structure, cWin); + var unfocusedSelection = FakeSelection(cWin, contentElement); + var refreshSelection = function () { + if (unfocusedSelection.isActive()) { + unfocusedSelection.update(); + } + }; + var highlightSelection = function () { + unfocusedSelection.update(); + }; + var clearSelection = function () { + unfocusedSelection.clear(); + }; + var scrollIntoView$1 = function (top, bottom) { + scrollIntoView(cWin, socket, dropup, top, bottom); + }; + var syncHeight = function () { + set$3(contentElement, 'height', contentElement.dom.contentWindow.document.body.scrollHeight + 'px'); + }; + var setViewportOffset = function (newYOffset) { + structure.setViewportOffset(newYOffset); + moveOnlyTop(socket, newYOffset).get(identity); + }; + var destroy = function () { + structure.restore(); + onOrientation.destroy(); + onScroll.unbind(); + onResize.unbind(); + keyboardModel.destroy(); + unfocusedSelection.destroy(); + input$1(body(), blur); + }; + return { + toEditing: toEditing, + toReading: toReading, + onToolbarTouch: onToolbarTouch, + refreshSelection: refreshSelection, + clearSelection: clearSelection, + highlightSelection: highlightSelection, + scrollIntoView: scrollIntoView$1, + updateToolbarPadding: noop, + setViewportOffset: setViewportOffset, + syncHeight: syncHeight, + refreshStructure: structure.refresh, + destroy: destroy + }; }; var create$6 = function (platform, mask) { - var meta = tag(); - var priorState = value$2(); - var scrollEvents = value$2(); - var iosApi = api$2(); - var iosEvents = api$2(); - var enter = function () { - mask.hide(); - var doc = SugarElement.fromDom(document); - getActiveApi(platform.editor).each(function (editorApi) { - priorState.set({ - socketHeight: getRaw(platform.socket, 'height'), - iframeHeight: getRaw(editorApi.frame, 'height'), - outerScroll: document.body.scrollTop - }); - scrollEvents.set({exclusives: exclusive(doc, '.' + scrollable)}); - add$2(platform.container, resolve('fullscreen-maximized')); - clobberStyles(platform.container, editorApi.body); - meta.maximize(); - set$3(platform.socket, 'overflow', 'scroll'); - set$3(platform.socket, '-webkit-overflow-scrolling', 'touch'); - focus$1(editorApi.body); - iosApi.set(setup$3({ - cWin: editorApi.win, - ceBody: editorApi.body, - socket: platform.socket, - toolstrip: platform.toolstrip, - dropup: platform.dropup.element, - contentElement: editorApi.frame, - outerBody: platform.body, - outerWindow: platform.win, - keyboardType: stubborn - })); - iosApi.run(function (api) { - api.syncHeight(); - }); - iosEvents.set(initEvents$1(editorApi, iosApi, platform.toolstrip, platform.socket, platform.dropup)); - }); - }; - var exit = function () { - meta.restore(); - iosEvents.clear(); - iosApi.clear(); - mask.show(); - priorState.on(function (s) { - s.socketHeight.each(function (h) { - set$3(platform.socket, 'height', h); - }); - s.iframeHeight.each(function (h) { - set$3(platform.editor.getFrame(), 'height', h); - }); - document.body.scrollTop = s.scrollTop; - }); - priorState.clear(); - scrollEvents.on(function (s) { - s.exclusives.unbind(); - }); - scrollEvents.clear(); - remove$4(platform.container, resolve('fullscreen-maximized')); - restoreStyles(); - deregister(platform.toolbar); - remove$5(platform.socket, 'overflow'); - remove$5(platform.socket, '-webkit-overflow-scrolling'); - blur(platform.editor.getFrame()); - getActiveApi(platform.editor).each(function (editorApi) { - editorApi.clearSelection(); - }); - }; - var refreshStructure = function () { - iosApi.run(function (api) { - api.refreshStructure(); - }); - }; - return { - enter: enter, - refreshStructure: refreshStructure, - exit: exit - }; + var meta = tag(); + var priorState = value$2(); + var scrollEvents = value$2(); + var iosApi = api$2(); + var iosEvents = api$2(); + var enter = function () { + mask.hide(); + var doc = SugarElement.fromDom(document); + getActiveApi(platform.editor).each(function (editorApi) { + priorState.set({ + socketHeight: getRaw(platform.socket, 'height'), + iframeHeight: getRaw(editorApi.frame, 'height'), + outerScroll: document.body.scrollTop + }); + scrollEvents.set({ exclusives: exclusive(doc, '.' + scrollable) }); + add$2(platform.container, resolve('fullscreen-maximized')); + clobberStyles(platform.container, editorApi.body); + meta.maximize(); + set$3(platform.socket, 'overflow', 'scroll'); + set$3(platform.socket, '-webkit-overflow-scrolling', 'touch'); + focus$1(editorApi.body); + iosApi.set(setup$3({ + cWin: editorApi.win, + ceBody: editorApi.body, + socket: platform.socket, + toolstrip: platform.toolstrip, + dropup: platform.dropup.element, + contentElement: editorApi.frame, + outerBody: platform.body, + outerWindow: platform.win, + keyboardType: stubborn + })); + iosApi.run(function (api) { + api.syncHeight(); + }); + iosEvents.set(initEvents$1(editorApi, iosApi, platform.toolstrip, platform.socket, platform.dropup)); + }); + }; + var exit = function () { + meta.restore(); + iosEvents.clear(); + iosApi.clear(); + mask.show(); + priorState.on(function (s) { + s.socketHeight.each(function (h) { + set$3(platform.socket, 'height', h); + }); + s.iframeHeight.each(function (h) { + set$3(platform.editor.getFrame(), 'height', h); + }); + document.body.scrollTop = s.scrollTop; + }); + priorState.clear(); + scrollEvents.on(function (s) { + s.exclusives.unbind(); + }); + scrollEvents.clear(); + remove$4(platform.container, resolve('fullscreen-maximized')); + restoreStyles(); + deregister(platform.toolbar); + remove$5(platform.socket, 'overflow'); + remove$5(platform.socket, '-webkit-overflow-scrolling'); + blur(platform.editor.getFrame()); + getActiveApi(platform.editor).each(function (editorApi) { + editorApi.clearSelection(); + }); + }; + var refreshStructure = function () { + iosApi.run(function (api) { + api.refreshStructure(); + }); + }; + return { + enter: enter, + refreshStructure: refreshStructure, + exit: exit + }; }; var produce$1 = function (raw) { - var mobile = asRawOrDie('Getting IosWebapp schema', MobileSchema, raw); - set$3(mobile.toolstrip, 'width', '100%'); - set$3(mobile.container, 'position', 'relative'); - var onView = function () { - mobile.setReadOnly(mobile.readOnlyOnInit()); - mode.enter(); - }; - var mask = build$1(sketch$9(onView, mobile.translate)); - mobile.alloy.add(mask); - var maskApi = { - show: function () { - mobile.alloy.add(mask); - }, - hide: function () { - mobile.alloy.remove(mask); - } - }; - var mode = create$6(mobile, maskApi); - return { - setReadOnly: mobile.setReadOnly, - refreshStructure: mode.refreshStructure, - enter: mode.enter, - exit: mode.exit, - destroy: noop - }; - }; - - function IosRealm(scrollIntoView) { - var alloy = OuterContainer({classes: [resolve('ios-container')]}); - var toolbar = ScrollingToolbar(); - var webapp = api$2(); - var switchToEdit = makeEditSwitch(webapp); - var socket = makeSocket(); - var dropup = build$2(function () { - webapp.run(function (w) { - w.refreshStructure(); - }); - }, scrollIntoView); - alloy.add(toolbar.wrapper); - alloy.add(socket); - alloy.add(dropup.component); - var setToolbarGroups = function (rawGroups) { - var groups = toolbar.createGroups(rawGroups); - toolbar.setGroups(groups); - }; - var setContextToolbar = function (rawGroups) { - var groups = toolbar.createGroups(rawGroups); - toolbar.setContextToolbar(groups); - }; - var focusToolbar = function () { - toolbar.focus(); - }; - var restoreToolbar = function () { - toolbar.restoreToolbar(); - }; - var init = function (spec) { - webapp.set(produce$1(spec)); - }; - var exit = function () { - webapp.run(function (w) { - Replacing.remove(socket, switchToEdit); - w.exit(); - }); - }; - var updateMode$1 = function (readOnly) { - updateMode(socket, switchToEdit, readOnly, alloy.root); - }; - return { - system: alloy, - element: alloy.element, - init: init, - exit: exit, - setToolbarGroups: setToolbarGroups, - setContextToolbar: setContextToolbar, - focusToolbar: focusToolbar, - restoreToolbar: restoreToolbar, - updateMode: updateMode$1, - socket: socket, - dropup: dropup - }; + var mobile = asRawOrDie('Getting IosWebapp schema', MobileSchema, raw); + set$3(mobile.toolstrip, 'width', '100%'); + set$3(mobile.container, 'position', 'relative'); + var onView = function () { + mobile.setReadOnly(mobile.readOnlyOnInit()); + mode.enter(); + }; + var mask = build$1(sketch$9(onView, mobile.translate)); + mobile.alloy.add(mask); + var maskApi = { + show: function () { + mobile.alloy.add(mask); + }, + hide: function () { + mobile.alloy.remove(mask); + } + }; + var mode = create$6(mobile, maskApi); + return { + setReadOnly: mobile.setReadOnly, + refreshStructure: mode.refreshStructure, + enter: mode.enter, + exit: mode.exit, + destroy: noop + }; + }; + + function IosRealm (scrollIntoView) { + var alloy = OuterContainer({ classes: [resolve('ios-container')] }); + var toolbar = ScrollingToolbar(); + var webapp = api$2(); + var switchToEdit = makeEditSwitch(webapp); + var socket = makeSocket(); + var dropup = build$2(function () { + webapp.run(function (w) { + w.refreshStructure(); + }); + }, scrollIntoView); + alloy.add(toolbar.wrapper); + alloy.add(socket); + alloy.add(dropup.component); + var setToolbarGroups = function (rawGroups) { + var groups = toolbar.createGroups(rawGroups); + toolbar.setGroups(groups); + }; + var setContextToolbar = function (rawGroups) { + var groups = toolbar.createGroups(rawGroups); + toolbar.setContextToolbar(groups); + }; + var focusToolbar = function () { + toolbar.focus(); + }; + var restoreToolbar = function () { + toolbar.restoreToolbar(); + }; + var init = function (spec) { + webapp.set(produce$1(spec)); + }; + var exit = function () { + webapp.run(function (w) { + Replacing.remove(socket, switchToEdit); + w.exit(); + }); + }; + var updateMode$1 = function (readOnly) { + updateMode(socket, switchToEdit, readOnly, alloy.root); + }; + return { + system: alloy, + element: alloy.element, + init: init, + exit: exit, + setToolbarGroups: setToolbarGroups, + setContextToolbar: setContextToolbar, + focusToolbar: focusToolbar, + restoreToolbar: restoreToolbar, + updateMode: updateMode$1, + socket: socket, + dropup: dropup + }; } var global$5 = tinymce.util.Tools.resolve('tinymce.EditorManager'); var derive$3 = function (editor) { - var base = Optional.from(getSkinUrl(editor)).fold(function () { - return global$5.baseURL + '/skins/ui/oxide'; - }, function (url) { - return url; - }); - return { - content: base + '/content.mobile.min.css', - ui: base + '/skin.mobile.min.css' - }; + var base = Optional.from(getSkinUrl(editor)).fold(function () { + return global$5.baseURL + '/skins/ui/oxide'; + }, function (url) { + return url; + }); + return { + content: base + '/content.mobile.min.css', + ui: base + '/skin.mobile.min.css' + }; }; var fireChange = function (realm, command, state) { - realm.system.broadcastOn([formatChanged], { - command: command, - state: state - }); + realm.system.broadcastOn([formatChanged], { + command: command, + state: state + }); }; var init$5 = function (realm, editor) { - var allFormats = keys(editor.formatter.get()); - each(allFormats, function (command) { - editor.formatter.formatChanged(command, function (state) { - fireChange(realm, command, state); - }); + var allFormats = keys(editor.formatter.get()); + each(allFormats, function (command) { + editor.formatter.formatChanged(command, function (state) { + fireChange(realm, command, state); }); - each([ - 'ul', - 'ol' - ], function (command) { - editor.selection.selectorChanged(command, function (state, _data) { - fireChange(realm, command, state); - }); + }); + each([ + 'ul', + 'ol' + ], function (command) { + editor.selection.selectorChanged(command, function (state, _data) { + fireChange(realm, command, state); }); + }); }; var fireSkinLoaded = function (editor) { - return function () { - var done = function () { - editor._skinLoaded = true; - editor.fire('SkinLoaded'); - }; - if (editor.initialized) { - done(); - } else { - editor.on('init', done); - } + return function () { + var done = function () { + editor._skinLoaded = true; + editor.fire('SkinLoaded'); }; + if (editor.initialized) { + done(); + } else { + editor.on('init', done); + } + }; }; var READING = 'toReading'; var EDITING = 'toEditing'; var renderMobileTheme = function (editor) { - var renderUI = function () { - var targetNode = editor.getElement(); - var cssUrls = derive$3(editor); - if (isSkinDisabled(editor) === false) { - var styleSheetLoader_1 = global$1.DOM.styleSheetLoader; - editor.contentCSS.push(cssUrls.content); - styleSheetLoader_1.load(cssUrls.ui, fireSkinLoaded(editor)); - editor.on('remove', function () { - return styleSheetLoader_1.unload(cssUrls.ui); - }); - } else { - fireSkinLoaded(editor)(); - } - var doScrollIntoView = function () { - editor.fire('ScrollIntoView'); - }; - var realm = detect$3().os.isAndroid() ? AndroidRealm(doScrollIntoView) : IosRealm(doScrollIntoView); - var original = SugarElement.fromDom(targetNode); - attachSystemAfter(original, realm.system); - var findFocusIn = function (elem) { - return search(elem).bind(function (focused) { - return realm.system.getByDom(focused).toOptional(); + var renderUI = function () { + var targetNode = editor.getElement(); + var cssUrls = derive$3(editor); + if (isSkinDisabled(editor) === false) { + var styleSheetLoader_1 = global$1.DOM.styleSheetLoader; + editor.contentCSS.push(cssUrls.content); + styleSheetLoader_1.load(cssUrls.ui, fireSkinLoaded(editor)); + editor.on('remove', function () { + return styleSheetLoader_1.unload(cssUrls.ui); + }); + } else { + fireSkinLoaded(editor)(); + } + var doScrollIntoView = function () { + editor.fire('ScrollIntoView'); + }; + var realm = detect$3().os.isAndroid() ? AndroidRealm(doScrollIntoView) : IosRealm(doScrollIntoView); + var original = SugarElement.fromDom(targetNode); + attachSystemAfter(original, realm.system); + var findFocusIn = function (elem) { + return search(elem).bind(function (focused) { + return realm.system.getByDom(focused).toOptional(); + }); + }; + var outerWindow = targetNode.ownerDocument.defaultView; + var orientation = onChange(outerWindow, { + onChange: function () { + var alloy = realm.system; + alloy.broadcastOn([orientationChanged], { width: getActualWidth(outerWindow) }); + }, + onReady: noop + }); + var setReadOnly = function (dynamicGroup, readOnlyGroups, mainGroups, ro) { + if (ro === false) { + editor.selection.collapse(); + } + var toolbars = configureToolbar(dynamicGroup, readOnlyGroups, mainGroups); + realm.setToolbarGroups(ro === true ? toolbars.readOnly : toolbars.main); + editor.setMode(ro === true ? 'readonly' : 'design'); + editor.fire(ro === true ? READING : EDITING); + realm.updateMode(ro); + }; + var configureToolbar = function (dynamicGroup, readOnlyGroups, mainGroups) { + var dynamic = dynamicGroup.get(); + var toolbars = { + readOnly: dynamic.backToMask.concat(readOnlyGroups.get()), + main: dynamic.backToMask.concat(mainGroups.get()) + }; + return toolbars; + }; + var bindHandler = function (label, handler) { + editor.on(label, handler); + return { + unbind: function () { + editor.off(label); + } + }; + }; + editor.on('init', function () { + realm.init({ + editor: { + getFrame: function () { + return SugarElement.fromDom(editor.contentAreaContainer.querySelector('iframe')); + }, + onDomChanged: function () { + return { unbind: noop }; + }, + onToReading: function (handler) { + return bindHandler(READING, handler); + }, + onToEditing: function (handler) { + return bindHandler(EDITING, handler); + }, + onScrollToCursor: function (handler) { + editor.on('ScrollIntoView', function (tinyEvent) { + handler(tinyEvent); }); - }; - var outerWindow = targetNode.ownerDocument.defaultView; - var orientation = onChange(outerWindow, { - onChange: function () { - var alloy = realm.system; - alloy.broadcastOn([orientationChanged], {width: getActualWidth(outerWindow)}); - }, - onReady: noop - }); - var setReadOnly = function (dynamicGroup, readOnlyGroups, mainGroups, ro) { - if (ro === false) { - editor.selection.collapse(); - } - var toolbars = configureToolbar(dynamicGroup, readOnlyGroups, mainGroups); - realm.setToolbarGroups(ro === true ? toolbars.readOnly : toolbars.main); - editor.setMode(ro === true ? 'readonly' : 'design'); - editor.fire(ro === true ? READING : EDITING); - realm.updateMode(ro); - }; - var configureToolbar = function (dynamicGroup, readOnlyGroups, mainGroups) { - var dynamic = dynamicGroup.get(); - var toolbars = { - readOnly: dynamic.backToMask.concat(readOnlyGroups.get()), - main: dynamic.backToMask.concat(mainGroups.get()) + var unbind = function () { + editor.off('ScrollIntoView'); + orientation.destroy(); }; - return toolbars; - }; - var bindHandler = function (label, handler) { - editor.on(label, handler); - return { - unbind: function () { - editor.off(label); + return { unbind: unbind }; + }, + onTouchToolstrip: function () { + hideDropup(); + }, + onTouchContent: function () { + var toolbar = SugarElement.fromDom(editor.editorContainer.querySelector('.' + resolve('toolbar'))); + findFocusIn(toolbar).each(emitExecute); + realm.restoreToolbar(); + hideDropup(); + }, + onTapContent: function (evt) { + var target = evt.target; + if (name(target) === 'img') { + editor.selection.select(target.dom); + evt.kill(); + } else if (name(target) === 'a') { + var component = realm.system.getByDom(SugarElement.fromDom(editor.editorContainer)); + component.each(function (container) { + if (Swapping.isAlpha(container)) { + openLink(target.dom); } - }; - }; - editor.on('init', function () { - realm.init({ - editor: { - getFrame: function () { - return SugarElement.fromDom(editor.contentAreaContainer.querySelector('iframe')); - }, - onDomChanged: function () { - return {unbind: noop}; - }, - onToReading: function (handler) { - return bindHandler(READING, handler); - }, - onToEditing: function (handler) { - return bindHandler(EDITING, handler); - }, - onScrollToCursor: function (handler) { - editor.on('ScrollIntoView', function (tinyEvent) { - handler(tinyEvent); - }); - var unbind = function () { - editor.off('ScrollIntoView'); - orientation.destroy(); - }; - return {unbind: unbind}; - }, - onTouchToolstrip: function () { - hideDropup(); - }, - onTouchContent: function () { - var toolbar = SugarElement.fromDom(editor.editorContainer.querySelector('.' + resolve('toolbar'))); - findFocusIn(toolbar).each(emitExecute); - realm.restoreToolbar(); - hideDropup(); - }, - onTapContent: function (evt) { - var target = evt.target; - if (name(target) === 'img') { - editor.selection.select(target.dom); - evt.kill(); - } else if (name(target) === 'a') { - var component = realm.system.getByDom(SugarElement.fromDom(editor.editorContainer)); - component.each(function (container) { - if (Swapping.isAlpha(container)) { - openLink(target.dom); - } - }); - } - } - }, - container: SugarElement.fromDom(editor.editorContainer), - socket: SugarElement.fromDom(editor.contentAreaContainer), - toolstrip: SugarElement.fromDom(editor.editorContainer.querySelector('.' + resolve('toolstrip'))), - toolbar: SugarElement.fromDom(editor.editorContainer.querySelector('.' + resolve('toolbar'))), - dropup: realm.dropup, - alloy: realm.system, - translate: noop, - setReadOnly: function (ro) { - setReadOnly(dynamicGroup, readOnlyGroups, mainGroups, ro); - }, - readOnlyOnInit: function () { - return readOnlyOnInit(); - } - }); - var hideDropup = function () { - realm.dropup.disappear(function () { - realm.system.broadcastOn([dropupDismissed], {}); - }); - }; - var backToMaskGroup = { - label: 'The first group', - scrollable: false, - items: [forToolbar('back', function () { - editor.selection.collapse(); - realm.exit(); - }, {}, editor)] - }; - var backToReadOnlyGroup = { - label: 'Back to read only', - scrollable: false, - items: [forToolbar('readonly-back', function () { - setReadOnly(dynamicGroup, readOnlyGroups, mainGroups, true); - }, {}, editor)] - }; - var readOnlyGroup = { - label: 'The read only mode group', - scrollable: true, - items: [] - }; - var features = setup(realm, editor); - var items = detect$4(editor, features); - var actionGroup = { - label: 'the action group', - scrollable: true, - items: items - }; - var extraGroup = { - label: 'The extra group', - scrollable: false, - items: [] - }; - var mainGroups = Cell([ - actionGroup, - extraGroup - ]); - var readOnlyGroups = Cell([ - readOnlyGroup, - extraGroup - ]); - var dynamicGroup = Cell({ - backToMask: [backToMaskGroup], - backToReadOnly: [backToReadOnlyGroup] - }); - init$5(realm, editor); - }); - editor.on('remove', function () { + }); + } + } + }, + container: SugarElement.fromDom(editor.editorContainer), + socket: SugarElement.fromDom(editor.contentAreaContainer), + toolstrip: SugarElement.fromDom(editor.editorContainer.querySelector('.' + resolve('toolstrip'))), + toolbar: SugarElement.fromDom(editor.editorContainer.querySelector('.' + resolve('toolbar'))), + dropup: realm.dropup, + alloy: realm.system, + translate: noop, + setReadOnly: function (ro) { + setReadOnly(dynamicGroup, readOnlyGroups, mainGroups, ro); + }, + readOnlyOnInit: function () { + return readOnlyOnInit(); + } + }); + var hideDropup = function () { + realm.dropup.disappear(function () { + realm.system.broadcastOn([dropupDismissed], {}); + }); + }; + var backToMaskGroup = { + label: 'The first group', + scrollable: false, + items: [forToolbar('back', function () { + editor.selection.collapse(); realm.exit(); - }); - editor.on('detach', function () { - detachSystem(realm.system); - realm.system.destroy(); - }); - return { - iframeContainer: realm.socket.element.dom, - editorContainer: realm.element.dom - }; - }; + }, {}, editor)] + }; + var backToReadOnlyGroup = { + label: 'Back to read only', + scrollable: false, + items: [forToolbar('readonly-back', function () { + setReadOnly(dynamicGroup, readOnlyGroups, mainGroups, true); + }, {}, editor)] + }; + var readOnlyGroup = { + label: 'The read only mode group', + scrollable: true, + items: [] + }; + var features = setup(realm, editor); + var items = detect$4(editor, features); + var actionGroup = { + label: 'the action group', + scrollable: true, + items: items + }; + var extraGroup = { + label: 'The extra group', + scrollable: false, + items: [] + }; + var mainGroups = Cell([ + actionGroup, + extraGroup + ]); + var readOnlyGroups = Cell([ + readOnlyGroup, + extraGroup + ]); + var dynamicGroup = Cell({ + backToMask: [backToMaskGroup], + backToReadOnly: [backToReadOnlyGroup] + }); + init$5(realm, editor); + }); + editor.on('remove', function () { + realm.exit(); + }); + editor.on('detach', function () { + detachSystem(realm.system); + realm.system.destroy(); + }); return { - getNotificationManagerImpl: function () { - return { - open: constant({ - progressBar: {value: noop}, - close: noop, - text: noop, - getEl: constant(null), - moveTo: noop, - moveRel: noop, - settings: {} - }), - close: noop, - reposition: noop, - getArgs: constant({}) - }; - }, - renderUI: renderUI - }; + iframeContainer: realm.socket.element.dom, + editorContainer: realm.element.dom + }; + }; + return { + getNotificationManagerImpl: function () { + return { + open: constant({ + progressBar: { value: noop }, + close: noop, + text: noop, + getEl: constant(null), + moveTo: noop, + moveRel: noop, + settings: {} + }), + close: noop, + reposition: noop, + getArgs: constant({}) + }; + }, + renderUI: renderUI + }; }; - - function Theme() { - global$2.add('mobile', renderMobileTheme); + function Theme () { + global$2.add('mobile', renderMobileTheme); } Theme(); diff --git a/src/main/resources/static/component/pear/module/tinymce/tinymce/themes/silver/theme.js b/src/main/resources/static/component/pear/module/tinymce/tinymce/themes/silver/theme.js index a1deeb3f..920f4fef 100644 --- a/src/main/resources/static/component/pear/module/tinymce/tinymce/themes/silver/theme.js +++ b/src/main/resources/static/component/pear/module/tinymce/tinymce/themes/silver/theme.js @@ -12,57 +12,55 @@ var noop = function () { }; var noarg = function (f) { - return function () { - return f(); - }; + return function () { + return f(); + }; }; var compose = function (fa, fb) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return fa(fb.apply(null, args)); - }; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return fa(fb.apply(null, args)); + }; }; var compose1 = function (fbc, fab) { - return function (a) { - return fbc(fab(a)); - }; + return function (a) { + return fbc(fab(a)); + }; }; var constant = function (value) { - return function () { - return value; - }; + return function () { + return value; + }; }; var identity = function (x) { - return x; + return x; }; - function curry(fn) { - var initialArgs = []; - for (var _i = 1; _i < arguments.length; _i++) { - initialArgs[_i - 1] = arguments[_i]; - } - return function () { - var restArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - restArgs[_i] = arguments[_i]; - } - var all = initialArgs.concat(restArgs); - return fn.apply(null, all); - }; + var initialArgs = []; + for (var _i = 1; _i < arguments.length; _i++) { + initialArgs[_i - 1] = arguments[_i]; + } + return function () { + var restArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + restArgs[_i] = arguments[_i]; + } + var all = initialArgs.concat(restArgs); + return fn.apply(null, all); + }; } - var not = function (f) { - return function (t) { - return !f(t); - }; + return function (t) { + return !f(t); + }; }; var die = function (msg) { - return function () { - throw new Error(msg); - }; + return function () { + throw new Error(msg); + }; }; var never = constant(false); var always = constant(true); @@ -70,172 +68,170 @@ var global$1 = tinymce.util.Tools.resolve('tinymce.ThemeManager'); var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); }; - function __rest(s, e) { - var t = {}; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === 'function') - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; + var t = {}; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === 'function') + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; } - function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) - s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; + for (var s = 0, i = 0, il = arguments.length; i < il; i++) + s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; } var none = function () { - return NONE; + return NONE; }; var NONE = function () { - var eq = function (o) { - return o.isNone(); - }; - var call = function (thunk) { - return thunk(); - }; - var id = function (n) { - return n; - }; - var me = { - fold: function (n, _s) { - return n(); - }, - is: never, - isSome: never, - isNone: always, - getOr: id, - getOrThunk: call, - getOrDie: function (msg) { - throw new Error(msg || 'error: getOrDie called on none.'); - }, - getOrNull: constant(null), - getOrUndefined: constant(undefined), - or: id, - orThunk: call, - map: none, - each: noop, - bind: none, - exists: never, - forall: always, - filter: none, - equals: eq, - equals_: eq, - toArray: function () { - return []; - }, - toString: constant('none()') - }; - return me; + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; }(); var some = function (a) { - var constant_a = constant(a); - var self = function () { - return me; - }; - var bind = function (f) { - return f(a); - }; - var me = { - fold: function (n, s) { - return s(a); - }, - is: function (v) { - return a === v; - }, - isSome: always, - isNone: never, - getOr: constant_a, - getOrThunk: constant_a, - getOrDie: constant_a, - getOrNull: constant_a, - getOrUndefined: constant_a, - or: self, - orThunk: self, - map: function (f) { - return some(f(a)); - }, - each: function (f) { - f(a); - }, - bind: bind, - exists: bind, - forall: bind, - filter: function (f) { - return f(a) ? me : NONE; - }, - toArray: function () { - return [a]; - }, - toString: function () { - return 'some(' + a + ')'; - }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never, function (b) { - return elementEq(a, b); - }); - } - }; + var constant_a = constant(a); + var self = function () { return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; }; var from = function (value) { - return value === null || value === undefined ? NONE : some(value); + return value === null || value === undefined ? NONE : some(value); }; var Optional = { - some: some, - none: none, - from: from + some: some, + none: none, + from: from }; var typeOf = function (x) { - var t = typeof x; - if (x === null) { - return 'null'; - } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { - return 'array'; - } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { - return 'string'; - } else { - return t; - } + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } }; var isType = function (type) { - return function (value) { - return typeOf(value) === type; - }; + return function (value) { + return typeOf(value) === type; + }; }; var isSimpleType = function (type) { - return function (value) { - return typeof value === type; - }; + return function (value) { + return typeof value === type; + }; }; var eq = function (t) { - return function (a) { - return t === a; - }; + return function (a) { + return t === a; + }; }; var isString = isType('string'); var isObject = isType('object'); @@ -243,609 +239,609 @@ var isBoolean = isSimpleType('boolean'); var isUndefined = eq(undefined); var isNullable = function (a) { - return a === null || a === undefined; + return a === null || a === undefined; }; var isNonNullable = function (a) { - return !isNullable(a); + return !isNullable(a); }; var isFunction = isSimpleType('function'); var isNumber = isSimpleType('number'); var isArrayOf = function (value, pred) { - if (isArray(value)) { - for (var i = 0, len = value.length; i < len; ++i) { - if (!pred(value[i])) { - return false; - } - } - return true; + if (isArray(value)) { + for (var i = 0, len = value.length; i < len; ++i) { + if (!pred(value[i])) { + return false; + } } - return false; + return true; + } + return false; }; var nativeSlice = Array.prototype.slice; var nativeIndexOf = Array.prototype.indexOf; var nativePush = Array.prototype.push; var rawIndexOf = function (ts, t) { - return nativeIndexOf.call(ts, t); + return nativeIndexOf.call(ts, t); }; var indexOf = function (xs, x) { - var r = rawIndexOf(xs, x); - return r === -1 ? Optional.none() : Optional.some(r); + var r = rawIndexOf(xs, x); + return r === -1 ? Optional.none() : Optional.some(r); }; var contains = function (xs, x) { - return rawIndexOf(xs, x) > -1; + return rawIndexOf(xs, x) > -1; }; var exists = function (xs, pred) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - return true; - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return true; } - return false; + } + return false; }; var range = function (num, f) { - var r = []; - for (var i = 0; i < num; i++) { - r.push(f(i)); - } - return r; + var r = []; + for (var i = 0; i < num; i++) { + r.push(f(i)); + } + return r; }; var chunk = function (array, size) { - var r = []; - for (var i = 0; i < array.length; i += size) { - var s = nativeSlice.call(array, i, i + size); - r.push(s); - } - return r; + var r = []; + for (var i = 0; i < array.length; i += size) { + var s = nativeSlice.call(array, i, i + size); + r.push(s); + } + return r; }; var map = function (xs, f) { - var len = xs.length; - var r = new Array(len); - for (var i = 0; i < len; i++) { - var x = xs[i]; - r[i] = f(x, i); - } - return r; + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; }; var each = function (xs, f) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - f(x, i); - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } }; var eachr = function (xs, f) { - for (var i = xs.length - 1; i >= 0; i--) { - var x = xs[i]; - f(x, i); - } + for (var i = xs.length - 1; i >= 0; i--) { + var x = xs[i]; + f(x, i); + } }; var partition = function (xs, pred) { - var pass = []; - var fail = []; - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - var arr = pred(x, i) ? pass : fail; - arr.push(x); - } - return { - pass: pass, - fail: fail - }; + var pass = []; + var fail = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + var arr = pred(x, i) ? pass : fail; + arr.push(x); + } + return { + pass: pass, + fail: fail + }; }; var filter = function (xs, pred) { - var r = []; - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - r.push(x); - } + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); } - return r; + } + return r; }; var foldr = function (xs, f, acc) { - eachr(xs, function (x) { - acc = f(acc, x); - }); - return acc; + eachr(xs, function (x) { + acc = f(acc, x); + }); + return acc; }; var foldl = function (xs, f, acc) { - each(xs, function (x) { - acc = f(acc, x); - }); - return acc; + each(xs, function (x) { + acc = f(acc, x); + }); + return acc; }; var findUntil = function (xs, pred, until) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - return Optional.some(x); - } else if (until(x, i)) { - break; - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(x); + } else if (until(x, i)) { + break; } - return Optional.none(); + } + return Optional.none(); }; var find = function (xs, pred) { - return findUntil(xs, pred, never); + return findUntil(xs, pred, never); }; var findIndex = function (xs, pred) { - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - if (pred(x, i)) { - return Optional.some(i); - } + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(i); } - return Optional.none(); + } + return Optional.none(); }; var flatten = function (xs) { - var r = []; - for (var i = 0, len = xs.length; i < len; ++i) { - if (!isArray(xs[i])) { - throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); - } - nativePush.apply(r, xs[i]); + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); } - return r; + nativePush.apply(r, xs[i]); + } + return r; }; var bind = function (xs, f) { - return flatten(map(xs, f)); + return flatten(map(xs, f)); }; var forall = function (xs, pred) { - for (var i = 0, len = xs.length; i < len; ++i) { - var x = xs[i]; - if (pred(x, i) !== true) { - return false; - } + for (var i = 0, len = xs.length; i < len; ++i) { + var x = xs[i]; + if (pred(x, i) !== true) { + return false; } - return true; + } + return true; }; var reverse = function (xs) { - var r = nativeSlice.call(xs, 0); - r.reverse(); - return r; + var r = nativeSlice.call(xs, 0); + r.reverse(); + return r; }; var difference = function (a1, a2) { - return filter(a1, function (x) { - return !contains(a2, x); - }); + return filter(a1, function (x) { + return !contains(a2, x); + }); }; var mapToObject = function (xs, f) { - var r = {}; - for (var i = 0, len = xs.length; i < len; i++) { - var x = xs[i]; - r[String(x)] = f(x, i); - } - return r; + var r = {}; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + r[String(x)] = f(x, i); + } + return r; }; var sort = function (xs, comparator) { - var copy = nativeSlice.call(xs, 0); - copy.sort(comparator); - return copy; + var copy = nativeSlice.call(xs, 0); + copy.sort(comparator); + return copy; }; var get = function (xs, i) { - return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none(); + return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none(); }; var head = function (xs) { - return get(xs, 0); + return get(xs, 0); }; var last = function (xs) { - return get(xs, xs.length - 1); + return get(xs, xs.length - 1); }; var from$1 = isFunction(Array.from) ? Array.from : function (x) { - return nativeSlice.call(x); + return nativeSlice.call(x); }; var findMap = function (arr, f) { - for (var i = 0; i < arr.length; i++) { - var r = f(arr[i], i); - if (r.isSome()) { - return r; - } + for (var i = 0; i < arr.length; i++) { + var r = f(arr[i], i); + if (r.isSome()) { + return r; } - return Optional.none(); + } + return Optional.none(); }; var value = function (o) { - var is = function (v) { - return o === v; - }; - var or = function (_opt) { - return value(o); - }; - var orThunk = function (_f) { - return value(o); - }; - var map = function (f) { - return value(f(o)); - }; - var mapError = function (_f) { - return value(o); - }; - var each = function (f) { - f(o); - }; - var bind = function (f) { - return f(o); - }; - var fold = function (_, onValue) { - return onValue(o); - }; - var exists = function (f) { - return f(o); - }; - var forall = function (f) { - return f(o); - }; - var toOptional = function () { - return Optional.some(o); - }; - return { - is: is, - isValue: always, - isError: never, - getOr: constant(o), - getOrThunk: constant(o), - getOrDie: constant(o), - or: or, - orThunk: orThunk, - fold: fold, - map: map, - mapError: mapError, - each: each, - bind: bind, - exists: exists, - forall: forall, - toOptional: toOptional - }; + var is = function (v) { + return o === v; + }; + var or = function (_opt) { + return value(o); + }; + var orThunk = function (_f) { + return value(o); + }; + var map = function (f) { + return value(f(o)); + }; + var mapError = function (_f) { + return value(o); + }; + var each = function (f) { + f(o); + }; + var bind = function (f) { + return f(o); + }; + var fold = function (_, onValue) { + return onValue(o); + }; + var exists = function (f) { + return f(o); + }; + var forall = function (f) { + return f(o); + }; + var toOptional = function () { + return Optional.some(o); + }; + return { + is: is, + isValue: always, + isError: never, + getOr: constant(o), + getOrThunk: constant(o), + getOrDie: constant(o), + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: each, + bind: bind, + exists: exists, + forall: forall, + toOptional: toOptional + }; }; var error = function (message) { - var getOrThunk = function (f) { - return f(); - }; - var getOrDie = function () { - return die(String(message))(); - }; - var or = function (opt) { - return opt; - }; - var orThunk = function (f) { - return f(); - }; - var map = function (_f) { - return error(message); - }; - var mapError = function (f) { - return error(f(message)); - }; - var bind = function (_f) { - return error(message); - }; - var fold = function (onError, _) { - return onError(message); - }; - return { - is: never, - isValue: never, - isError: always, - getOr: identity, - getOrThunk: getOrThunk, - getOrDie: getOrDie, - or: or, - orThunk: orThunk, - fold: fold, - map: map, - mapError: mapError, - each: noop, - bind: bind, - exists: never, - forall: always, - toOptional: Optional.none - }; + var getOrThunk = function (f) { + return f(); + }; + var getOrDie = function () { + return die(String(message))(); + }; + var or = function (opt) { + return opt; + }; + var orThunk = function (f) { + return f(); + }; + var map = function (_f) { + return error(message); + }; + var mapError = function (f) { + return error(f(message)); + }; + var bind = function (_f) { + return error(message); + }; + var fold = function (onError, _) { + return onError(message); + }; + return { + is: never, + isValue: never, + isError: always, + getOr: identity, + getOrThunk: getOrThunk, + getOrDie: getOrDie, + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: noop, + bind: bind, + exists: never, + forall: always, + toOptional: Optional.none + }; }; var fromOption = function (opt, err) { - return opt.fold(function () { - return error(err); - }, value); + return opt.fold(function () { + return error(err); + }, value); }; var Result = { - value: value, - error: error, - fromOption: fromOption + value: value, + error: error, + fromOption: fromOption }; var SimpleResultType; (function (SimpleResultType) { - SimpleResultType[SimpleResultType['Error'] = 0] = 'Error'; - SimpleResultType[SimpleResultType['Value'] = 1] = 'Value'; + SimpleResultType[SimpleResultType['Error'] = 0] = 'Error'; + SimpleResultType[SimpleResultType['Value'] = 1] = 'Value'; }(SimpleResultType || (SimpleResultType = {}))); var fold = function (res, onError, onValue) { - return res.stype === SimpleResultType.Error ? onError(res.serror) : onValue(res.svalue); + return res.stype === SimpleResultType.Error ? onError(res.serror) : onValue(res.svalue); }; var partition$1 = function (results) { - var values = []; - var errors = []; - each(results, function (obj) { - fold(obj, function (err) { - return errors.push(err); - }, function (val) { - return values.push(val); - }); - }); - return { - values: values, - errors: errors - }; + var values = []; + var errors = []; + each(results, function (obj) { + fold(obj, function (err) { + return errors.push(err); + }, function (val) { + return values.push(val); + }); + }); + return { + values: values, + errors: errors + }; }; var mapError = function (res, f) { - if (res.stype === SimpleResultType.Error) { - return { - stype: SimpleResultType.Error, - serror: f(res.serror) - }; - } else { - return res; - } + if (res.stype === SimpleResultType.Error) { + return { + stype: SimpleResultType.Error, + serror: f(res.serror) + }; + } else { + return res; + } }; var map$1 = function (res, f) { - if (res.stype === SimpleResultType.Value) { - return { - stype: SimpleResultType.Value, - svalue: f(res.svalue) - }; - } else { - return res; - } + if (res.stype === SimpleResultType.Value) { + return { + stype: SimpleResultType.Value, + svalue: f(res.svalue) + }; + } else { + return res; + } }; var bind$1 = function (res, f) { - if (res.stype === SimpleResultType.Value) { - return f(res.svalue); - } else { - return res; - } + if (res.stype === SimpleResultType.Value) { + return f(res.svalue); + } else { + return res; + } }; var bindError = function (res, f) { - if (res.stype === SimpleResultType.Error) { - return f(res.serror); - } else { - return res; - } + if (res.stype === SimpleResultType.Error) { + return f(res.serror); + } else { + return res; + } }; var svalue = function (v) { - return { - stype: SimpleResultType.Value, - svalue: v - }; + return { + stype: SimpleResultType.Value, + svalue: v + }; }; var serror = function (e) { - return { - stype: SimpleResultType.Error, - serror: e - }; + return { + stype: SimpleResultType.Error, + serror: e + }; }; var toResult = function (res) { - return fold(res, Result.error, Result.value); + return fold(res, Result.error, Result.value); }; var fromResult = function (res) { - return res.fold(serror, svalue); + return res.fold(serror, svalue); }; var SimpleResult = { - fromResult: fromResult, - toResult: toResult, - svalue: svalue, - partition: partition$1, - serror: serror, - bind: bind$1, - bindError: bindError, - map: map$1, - mapError: mapError, - fold: fold + fromResult: fromResult, + toResult: toResult, + svalue: svalue, + partition: partition$1, + serror: serror, + bind: bind$1, + bindError: bindError, + map: map$1, + mapError: mapError, + fold: fold }; var keys = Object.keys; var hasOwnProperty = Object.hasOwnProperty; var each$1 = function (obj, f) { - var props = keys(obj); - for (var k = 0, len = props.length; k < len; k++) { - var i = props[k]; - var x = obj[i]; - f(x, i); - } + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } }; var map$2 = function (obj, f) { - return tupleMap(obj, function (x, i) { - return { - k: i, - v: f(x, i) - }; - }); + return tupleMap(obj, function (x, i) { + return { + k: i, + v: f(x, i) + }; + }); }; var tupleMap = function (obj, f) { - var r = {}; - each$1(obj, function (x, i) { - var tuple = f(x, i); - r[tuple.k] = tuple.v; - }); - return r; + var r = {}; + each$1(obj, function (x, i) { + var tuple = f(x, i); + r[tuple.k] = tuple.v; + }); + return r; }; var objAcc = function (r) { - return function (x, i) { - r[i] = x; - }; + return function (x, i) { + r[i] = x; + }; }; var internalFilter = function (obj, pred, onTrue, onFalse) { - var r = {}; - each$1(obj, function (x, i) { - (pred(x, i) ? onTrue : onFalse)(x, i); - }); - return r; + var r = {}; + each$1(obj, function (x, i) { + (pred(x, i) ? onTrue : onFalse)(x, i); + }); + return r; }; var filter$1 = function (obj, pred) { - var t = {}; - internalFilter(obj, pred, objAcc(t), noop); - return t; + var t = {}; + internalFilter(obj, pred, objAcc(t), noop); + return t; }; var mapToArray = function (obj, f) { - var r = []; - each$1(obj, function (value, name) { - r.push(f(value, name)); - }); - return r; + var r = []; + each$1(obj, function (value, name) { + r.push(f(value, name)); + }); + return r; }; var find$1 = function (obj, pred) { - var props = keys(obj); - for (var k = 0, len = props.length; k < len; k++) { - var i = props[k]; - var x = obj[i]; - if (pred(x, i, obj)) { - return Optional.some(x); - } + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + if (pred(x, i, obj)) { + return Optional.some(x); } - return Optional.none(); + } + return Optional.none(); }; var values = function (obj) { - return mapToArray(obj, function (v) { - return v; - }); + return mapToArray(obj, function (v) { + return v; + }); }; var get$1 = function (obj, key) { - return has(obj, key) ? Optional.from(obj[key]) : Optional.none(); + return has(obj, key) ? Optional.from(obj[key]) : Optional.none(); }; var has = function (obj, key) { - return hasOwnProperty.call(obj, key); + return hasOwnProperty.call(obj, key); }; var hasNonNullableKey = function (obj, key) { - return has(obj, key) && obj[key] !== undefined && obj[key] !== null; + return has(obj, key) && obj[key] !== undefined && obj[key] !== null; }; var generate = function (cases) { - if (!isArray(cases)) { - throw new Error('cases must be an array'); - } - if (cases.length === 0) { - throw new Error('there must be at least one case'); - } - var constructors = []; - var adt = {}; - each(cases, function (acase, count) { - var keys$1 = keys(acase); - if (keys$1.length !== 1) { - throw new Error('one and only one name per case'); - } - var key = keys$1[0]; - var value = acase[key]; - if (adt[key] !== undefined) { - throw new Error('duplicate key detected:' + key); - } else if (key === 'cata') { - throw new Error('cannot have a case named cata (sorry)'); - } else if (!isArray(value)) { - throw new Error('case arguments must be an array'); - } - constructors.push(key); - adt[key] = function () { - var argLength = arguments.length; - if (argLength !== value.length) { - throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength); - } - var args = new Array(argLength); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - var match = function (branches) { - var branchKeys = keys(branches); - if (constructors.length !== branchKeys.length) { - throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\nActual: ' + branchKeys.join(',')); - } - var allReqd = forall(constructors, function (reqKey) { - return contains(branchKeys, reqKey); - }); - if (!allReqd) { - throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', ')); - } - return branches[key].apply(null, args); - }; - return { - fold: function () { - if (arguments.length !== cases.length) { - throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + arguments.length); - } - var target = arguments[count]; - return target.apply(null, args); - }, - match: match, - log: function (label) { - console.log(label, { - constructors: constructors, - constructor: key, - params: args - }); - } - }; - }; - }); - return adt; - }; - var Adt = {generate: generate}; + if (!isArray(cases)) { + throw new Error('cases must be an array'); + } + if (cases.length === 0) { + throw new Error('there must be at least one case'); + } + var constructors = []; + var adt = {}; + each(cases, function (acase, count) { + var keys$1 = keys(acase); + if (keys$1.length !== 1) { + throw new Error('one and only one name per case'); + } + var key = keys$1[0]; + var value = acase[key]; + if (adt[key] !== undefined) { + throw new Error('duplicate key detected:' + key); + } else if (key === 'cata') { + throw new Error('cannot have a case named cata (sorry)'); + } else if (!isArray(value)) { + throw new Error('case arguments must be an array'); + } + constructors.push(key); + adt[key] = function () { + var argLength = arguments.length; + if (argLength !== value.length) { + throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength); + } + var args = new Array(argLength); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + var match = function (branches) { + var branchKeys = keys(branches); + if (constructors.length !== branchKeys.length) { + throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\nActual: ' + branchKeys.join(',')); + } + var allReqd = forall(constructors, function (reqKey) { + return contains(branchKeys, reqKey); + }); + if (!allReqd) { + throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', ')); + } + return branches[key].apply(null, args); + }; + return { + fold: function () { + if (arguments.length !== cases.length) { + throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + arguments.length); + } + var target = arguments[count]; + return target.apply(null, args); + }, + match: match, + log: function (label) { + console.log(label, { + constructors: constructors, + constructor: key, + params: args + }); + } + }; + }; + }); + return adt; + }; + var Adt = { generate: generate }; var hasOwnProperty$1 = Object.prototype.hasOwnProperty; var shallow = function (old, nu) { - return nu; + return nu; }; var deep = function (old, nu) { - var bothObjects = isObject(old) && isObject(nu); - return bothObjects ? deepMerge(old, nu) : nu; + var bothObjects = isObject(old) && isObject(nu); + return bothObjects ? deepMerge(old, nu) : nu; }; var baseMerge = function (merger) { - return function () { - var objects = new Array(arguments.length); - for (var i = 0; i < objects.length; i++) { - objects[i] = arguments[i]; - } - if (objects.length === 0) { - throw new Error('Can\'t merge zero objects'); - } - var ret = {}; - for (var j = 0; j < objects.length; j++) { - var curObject = objects[j]; - for (var key in curObject) { - if (hasOwnProperty$1.call(curObject, key)) { - ret[key] = merger(ret[key], curObject[key]); - } - } + return function () { + var objects = new Array(arguments.length); + for (var i = 0; i < objects.length; i++) { + objects[i] = arguments[i]; + } + if (objects.length === 0) { + throw new Error('Can\'t merge zero objects'); + } + var ret = {}; + for (var j = 0; j < objects.length; j++) { + var curObject = objects[j]; + for (var key in curObject) { + if (hasOwnProperty$1.call(curObject, key)) { + ret[key] = merger(ret[key], curObject[key]); } - return ret; - }; + } + } + return ret; + }; }; var deepMerge = baseMerge(deep); var merge = baseMerge(shallow); var cached = function (f) { - var called = false; - var r; - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (!called) { - called = true; - r = f.apply(null, args); - } - return r; - }; + var called = false; + var r; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!called) { + called = true; + r = f.apply(null, args); + } + return r; + }; }; var adt = Adt.generate([ - {strict: []}, - {defaultedThunk: ['fallbackThunk']}, - {asOption: []}, - {asDefaultedOptionThunk: ['fallbackThunk']}, - {mergeWithThunk: ['baseThunk']} + { strict: [] }, + { defaultedThunk: ['fallbackThunk'] }, + { asOption: [] }, + { asDefaultedOptionThunk: ['fallbackThunk'] }, + { mergeWithThunk: ['baseThunk'] } ]); var defaulted = function (fallback) { - return adt.defaultedThunk(constant(fallback)); + return adt.defaultedThunk(constant(fallback)); }; var mergeWith = function (base) { - return adt.mergeWithThunk(constant(base)); + return adt.mergeWithThunk(constant(base)); }; var strict = adt.strict; var asOption = adt.asOption; @@ -854,381 +850,381 @@ var mergeWithThunk = adt.mergeWithThunk; var comparison = Adt.generate([ - { - bothErrors: [ - 'error1', - 'error2' - ] - }, - { - firstError: [ - 'error1', - 'value2' - ] - }, - { - secondError: [ - 'value1', - 'error2' - ] - }, - { - bothValues: [ - 'value1', - 'value2' - ] - } + { + bothErrors: [ + 'error1', + 'error2' + ] + }, + { + firstError: [ + 'error1', + 'value2' + ] + }, + { + secondError: [ + 'value1', + 'error2' + ] + }, + { + bothValues: [ + 'value1', + 'value2' + ] + } ]); var partition$2 = function (results) { - var errors = []; - var values = []; - each(results, function (result) { - result.fold(function (err) { - errors.push(err); - }, function (value) { - values.push(value); - }); + var errors = []; + var values = []; + each(results, function (result) { + result.fold(function (err) { + errors.push(err); + }, function (value) { + values.push(value); }); - return { - errors: errors, - values: values - }; + }); + return { + errors: errors, + values: values + }; }; var exclude = function (obj, fields) { - var r = {}; - each$1(obj, function (v, k) { - if (!contains(fields, k)) { - r[k] = v; - } - }); - return r; + var r = {}; + each$1(obj, function (v, k) { + if (!contains(fields, k)) { + r[k] = v; + } + }); + return r; }; var wrap = function (key, value) { - var _a; - return _a = {}, _a[key] = value, _a; + var _a; + return _a = {}, _a[key] = value, _a; }; var wrapAll = function (keyvalues) { - var r = {}; - each(keyvalues, function (kv) { - r[kv.key] = kv.value; - }); - return r; + var r = {}; + each(keyvalues, function (kv) { + r[kv.key] = kv.value; + }); + return r; }; var exclude$1 = function (obj, fields) { - return exclude(obj, fields); + return exclude(obj, fields); }; var wrap$1 = function (key, value) { - return wrap(key, value); + return wrap(key, value); }; var wrapAll$1 = function (keyvalues) { - return wrapAll(keyvalues); + return wrapAll(keyvalues); }; var mergeValues = function (values, base) { - return values.length === 0 ? Result.value(base) : Result.value(deepMerge(base, merge.apply(undefined, values))); + return values.length === 0 ? Result.value(base) : Result.value(deepMerge(base, merge.apply(undefined, values))); }; var mergeErrors = function (errors) { - return Result.error(flatten(errors)); + return Result.error(flatten(errors)); }; var consolidate = function (objs, base) { - var partitions = partition$2(objs); - return partitions.errors.length > 0 ? mergeErrors(partitions.errors) : mergeValues(partitions.values, base); + var partitions = partition$2(objs); + return partitions.errors.length > 0 ? mergeErrors(partitions.errors) : mergeValues(partitions.values, base); }; var mergeValues$1 = function (values, base) { - return values.length > 0 ? SimpleResult.svalue(deepMerge(base, merge.apply(undefined, values))) : SimpleResult.svalue(base); + return values.length > 0 ? SimpleResult.svalue(deepMerge(base, merge.apply(undefined, values))) : SimpleResult.svalue(base); }; var mergeErrors$1 = function (errors) { - return compose(SimpleResult.serror, flatten)(errors); + return compose(SimpleResult.serror, flatten)(errors); }; var consolidateObj = function (objects, base) { - var partition = SimpleResult.partition(objects); - return partition.errors.length > 0 ? mergeErrors$1(partition.errors) : mergeValues$1(partition.values, base); + var partition = SimpleResult.partition(objects); + return partition.errors.length > 0 ? mergeErrors$1(partition.errors) : mergeValues$1(partition.values, base); }; var consolidateArr = function (objects) { - var partitions = SimpleResult.partition(objects); - return partitions.errors.length > 0 ? mergeErrors$1(partitions.errors) : SimpleResult.svalue(partitions.values); + var partitions = SimpleResult.partition(objects); + return partitions.errors.length > 0 ? mergeErrors$1(partitions.errors) : SimpleResult.svalue(partitions.values); }; var ResultCombine = { - consolidateObj: consolidateObj, - consolidateArr: consolidateArr + consolidateObj: consolidateObj, + consolidateArr: consolidateArr }; var formatObj = function (input) { - return isObject(input) && keys(input).length > 100 ? ' removed due to size' : JSON.stringify(input, null, 2); + return isObject(input) && keys(input).length > 100 ? ' removed due to size' : JSON.stringify(input, null, 2); }; var formatErrors = function (errors) { - var es = errors.length > 10 ? errors.slice(0, 10).concat([{ - path: [], - getErrorInfo: function () { - return '... (only showing first ten failures)'; - } + var es = errors.length > 10 ? errors.slice(0, 10).concat([{ + path: [], + getErrorInfo: function () { + return '... (only showing first ten failures)'; + } }]) : errors; - return map(es, function (e) { - return 'Failed path: (' + e.path.join(' > ') + ')\n' + e.getErrorInfo(); - }); + return map(es, function (e) { + return 'Failed path: (' + e.path.join(' > ') + ')\n' + e.getErrorInfo(); + }); }; var nu = function (path, getErrorInfo) { - return SimpleResult.serror([{ - path: path, - getErrorInfo: getErrorInfo + return SimpleResult.serror([{ + path: path, + getErrorInfo: getErrorInfo }]); }; var missingStrict = function (path, key, obj) { - return nu(path, function () { - return 'Could not find valid *strict* value for "' + key + '" in ' + formatObj(obj); - }); + return nu(path, function () { + return 'Could not find valid *strict* value for "' + key + '" in ' + formatObj(obj); + }); }; var missingKey = function (path, key) { - return nu(path, function () { - return 'Choice schema did not contain choice key: "' + key + '"'; - }); + return nu(path, function () { + return 'Choice schema did not contain choice key: "' + key + '"'; + }); }; var missingBranch = function (path, branches, branch) { - return nu(path, function () { - return 'The chosen schema: "' + branch + '" did not exist in branches: ' + formatObj(branches); - }); + return nu(path, function () { + return 'The chosen schema: "' + branch + '" did not exist in branches: ' + formatObj(branches); + }); }; var unsupportedFields = function (path, unsupported) { - return nu(path, function () { - return 'There are unsupported fields: [' + unsupported.join(', ') + '] specified'; - }); + return nu(path, function () { + return 'There are unsupported fields: [' + unsupported.join(', ') + '] specified'; + }); }; var custom = function (path, err) { - return nu(path, function () { - return err; - }); + return nu(path, function () { + return err; + }); }; var adt$1 = Adt.generate([ - { - field: [ - 'key', - 'okey', - 'presence', - 'prop' - ] - }, - { - state: [ - 'okey', - 'instantiator' - ] - } + { + field: [ + 'key', + 'okey', + 'presence', + 'prop' + ] + }, + { + state: [ + 'okey', + 'instantiator' + ] + } ]); var strictAccess = function (path, obj, key) { - return get$1(obj, key).fold(function () { - return missingStrict(path, key, obj); - }, SimpleResult.svalue); + return get$1(obj, key).fold(function () { + return missingStrict(path, key, obj); + }, SimpleResult.svalue); }; var fallbackAccess = function (obj, key, fallbackThunk) { - var v = get$1(obj, key).fold(function () { - return fallbackThunk(obj); - }, identity); - return SimpleResult.svalue(v); + var v = get$1(obj, key).fold(function () { + return fallbackThunk(obj); + }, identity); + return SimpleResult.svalue(v); }; var optionAccess = function (obj, key) { - return SimpleResult.svalue(get$1(obj, key)); + return SimpleResult.svalue(get$1(obj, key)); }; var optionDefaultedAccess = function (obj, key, fallback) { - var opt = get$1(obj, key).map(function (val) { - return val === true ? fallback(obj) : val; - }); - return SimpleResult.svalue(opt); + var opt = get$1(obj, key).map(function (val) { + return val === true ? fallback(obj) : val; + }); + return SimpleResult.svalue(opt); }; var cExtractOne = function (path, obj, field, strength) { - return field.fold(function (key, okey, presence, prop) { - var bundle = function (av) { - var result = prop.extract(path.concat([key]), strength, av); - return SimpleResult.map(result, function (res) { - return wrap(okey, strength(res)); - }); - }; - var bundleAsOption = function (optValue) { - return optValue.fold(function () { - var outcome = wrap(okey, strength(Optional.none())); - return SimpleResult.svalue(outcome); - }, function (ov) { - var result = prop.extract(path.concat([key]), strength, ov); - return SimpleResult.map(result, function (res) { - return wrap(okey, strength(Optional.some(res))); - }); - }); - }; - return function () { - return presence.fold(function () { - return SimpleResult.bind(strictAccess(path, obj, key), bundle); - }, function (fallbackThunk) { - return SimpleResult.bind(fallbackAccess(obj, key, fallbackThunk), bundle); - }, function () { - return SimpleResult.bind(optionAccess(obj, key), bundleAsOption); - }, function (fallbackThunk) { - return SimpleResult.bind(optionDefaultedAccess(obj, key, fallbackThunk), bundleAsOption); - }, function (baseThunk) { - var base = baseThunk(obj); - var result = SimpleResult.map(fallbackAccess(obj, key, constant({})), function (v) { - return deepMerge(base, v); - }); - return SimpleResult.bind(result, bundle); - }); - }(); - }, function (okey, instantiator) { - var state = instantiator(obj); - return SimpleResult.svalue(wrap(okey, strength(state))); - }); + return field.fold(function (key, okey, presence, prop) { + var bundle = function (av) { + var result = prop.extract(path.concat([key]), strength, av); + return SimpleResult.map(result, function (res) { + return wrap(okey, strength(res)); + }); + }; + var bundleAsOption = function (optValue) { + return optValue.fold(function () { + var outcome = wrap(okey, strength(Optional.none())); + return SimpleResult.svalue(outcome); + }, function (ov) { + var result = prop.extract(path.concat([key]), strength, ov); + return SimpleResult.map(result, function (res) { + return wrap(okey, strength(Optional.some(res))); + }); + }); + }; + return function () { + return presence.fold(function () { + return SimpleResult.bind(strictAccess(path, obj, key), bundle); + }, function (fallbackThunk) { + return SimpleResult.bind(fallbackAccess(obj, key, fallbackThunk), bundle); + }, function () { + return SimpleResult.bind(optionAccess(obj, key), bundleAsOption); + }, function (fallbackThunk) { + return SimpleResult.bind(optionDefaultedAccess(obj, key, fallbackThunk), bundleAsOption); + }, function (baseThunk) { + var base = baseThunk(obj); + var result = SimpleResult.map(fallbackAccess(obj, key, constant({})), function (v) { + return deepMerge(base, v); + }); + return SimpleResult.bind(result, bundle); + }); + }(); + }, function (okey, instantiator) { + var state = instantiator(obj); + return SimpleResult.svalue(wrap(okey, strength(state))); + }); }; var cExtract = function (path, obj, fields, strength) { - var results = map(fields, function (field) { - return cExtractOne(path, obj, field, strength); - }); - return ResultCombine.consolidateObj(results, {}); + var results = map(fields, function (field) { + return cExtractOne(path, obj, field, strength); + }); + return ResultCombine.consolidateObj(results, {}); }; var valueThunk = function (getDelegate) { - var extract = function (path, strength, val) { - return getDelegate().extract(path, strength, val); - }; - var toString = function () { - return getDelegate().toString(); - }; - return { - extract: extract, - toString: toString - }; + var extract = function (path, strength, val) { + return getDelegate().extract(path, strength, val); + }; + var toString = function () { + return getDelegate().toString(); + }; + return { + extract: extract, + toString: toString + }; }; var value$1 = function (validator) { - var extract = function (path, strength, val) { - return SimpleResult.bindError(validator(val, strength), function (err) { - return custom(path, err); - }); - }; - var toString = function () { - return 'val'; - }; - return { - extract: extract, - toString: toString - }; + var extract = function (path, strength, val) { + return SimpleResult.bindError(validator(val, strength), function (err) { + return custom(path, err); + }); + }; + var toString = function () { + return 'val'; + }; + return { + extract: extract, + toString: toString + }; }; var getSetKeys = function (obj) { - return keys(filter$1(obj, function (value) { - return value !== undefined && value !== null; - })); + return keys(filter$1(obj, function (value) { + return value !== undefined && value !== null; + })); }; var objOfOnly = function (fields) { - var delegate = objOf(fields); - var fieldNames = foldr(fields, function (acc, f) { - return f.fold(function (key) { - return deepMerge(acc, wrap$1(key, true)); - }, constant(acc)); - }, {}); - var extract = function (path, strength, o) { - var keys = isBoolean(o) ? [] : getSetKeys(o); - var extra = filter(keys, function (k) { - return !hasNonNullableKey(fieldNames, k); - }); - return extra.length === 0 ? delegate.extract(path, strength, o) : unsupportedFields(path, extra); - }; - return { - extract: extract, - toString: delegate.toString - }; + var delegate = objOf(fields); + var fieldNames = foldr(fields, function (acc, f) { + return f.fold(function (key) { + return deepMerge(acc, wrap$1(key, true)); + }, constant(acc)); + }, {}); + var extract = function (path, strength, o) { + var keys = isBoolean(o) ? [] : getSetKeys(o); + var extra = filter(keys, function (k) { + return !hasNonNullableKey(fieldNames, k); + }); + return extra.length === 0 ? delegate.extract(path, strength, o) : unsupportedFields(path, extra); + }; + return { + extract: extract, + toString: delegate.toString + }; }; var objOf = function (fields) { - var extract = function (path, strength, o) { - return cExtract(path, o, fields, strength); - }; - var toString = function () { - var fieldStrings = map(fields, function (field) { - return field.fold(function (key, okey, presence, prop) { - return key + ' -> ' + prop.toString(); - }, function (okey, _instantiator) { - return 'state(' + okey + ')'; - }); - }); - return 'obj{\n' + fieldStrings.join('\n') + '}'; - }; - return { - extract: extract, - toString: toString - }; + var extract = function (path, strength, o) { + return cExtract(path, o, fields, strength); + }; + var toString = function () { + var fieldStrings = map(fields, function (field) { + return field.fold(function (key, okey, presence, prop) { + return key + ' -> ' + prop.toString(); + }, function (okey, _instantiator) { + return 'state(' + okey + ')'; + }); + }); + return 'obj{\n' + fieldStrings.join('\n') + '}'; + }; + return { + extract: extract, + toString: toString + }; }; var arrOf = function (prop) { - var extract = function (path, strength, array) { - var results = map(array, function (a, i) { - return prop.extract(path.concat(['[' + i + ']']), strength, a); - }); - return ResultCombine.consolidateArr(results); - }; - var toString = function () { - return 'array(' + prop.toString() + ')'; - }; - return { - extract: extract, - toString: toString - }; + var extract = function (path, strength, array) { + var results = map(array, function (a, i) { + return prop.extract(path.concat(['[' + i + ']']), strength, a); + }); + return ResultCombine.consolidateArr(results); + }; + var toString = function () { + return 'array(' + prop.toString() + ')'; + }; + return { + extract: extract, + toString: toString + }; }; var oneOf = function (props) { - var extract = function (path, strength, val) { - var errors = []; - for (var _i = 0, props_1 = props; _i < props_1.length; _i++) { - var prop = props_1[_i]; - var res = prop.extract(path, strength, val); - if (res.stype === SimpleResultType.Value) { - return res; - } - errors.push(res); - } - return ResultCombine.consolidateArr(errors); - }; - var toString = function () { - return 'oneOf(' + map(props, function (prop) { - return prop.toString(); - }).join(', ') + ')'; - }; - return { - extract: extract, - toString: toString - }; + var extract = function (path, strength, val) { + var errors = []; + for (var _i = 0, props_1 = props; _i < props_1.length; _i++) { + var prop = props_1[_i]; + var res = prop.extract(path, strength, val); + if (res.stype === SimpleResultType.Value) { + return res; + } + errors.push(res); + } + return ResultCombine.consolidateArr(errors); + }; + var toString = function () { + return 'oneOf(' + map(props, function (prop) { + return prop.toString(); + }).join(', ') + ')'; + }; + return { + extract: extract, + toString: toString + }; }; var setOf = function (validator, prop) { - var validateKeys = function (path, keys) { - return arrOf(value$1(validator)).extract(path, identity, keys); - }; - var extract = function (path, strength, o) { - var keys$1 = keys(o); - var validatedKeys = validateKeys(path, keys$1); - return SimpleResult.bind(validatedKeys, function (validKeys) { - var schema = map(validKeys, function (vk) { - return adt$1.field(vk, vk, strict(), prop); - }); - return objOf(schema).extract(path, strength, o); - }); - }; - var toString = function () { - return 'setOf(' + prop.toString() + ')'; - }; - return { - extract: extract, - toString: toString - }; + var validateKeys = function (path, keys) { + return arrOf(value$1(validator)).extract(path, identity, keys); + }; + var extract = function (path, strength, o) { + var keys$1 = keys(o); + var validatedKeys = validateKeys(path, keys$1); + return SimpleResult.bind(validatedKeys, function (validKeys) { + var schema = map(validKeys, function (vk) { + return adt$1.field(vk, vk, strict(), prop); + }); + return objOf(schema).extract(path, strength, o); + }); + }; + var toString = function () { + return 'setOf(' + prop.toString() + ')'; + }; + return { + extract: extract, + toString: toString + }; }; var thunk = function (desc, processor) { - var getP = cached(function () { - return processor(); - }); - var extract = function (path, strength, val) { - return getP().extract(path, strength, val); - }; - var toString = function () { - return getP().toString(); - }; - return { - extract: extract, - toString: toString - }; + var getP = cached(function () { + return processor(); + }); + var extract = function (path, strength, val) { + return getP().extract(path, strength, val); + }; + var toString = function () { + return getP().toString(); + }; + return { + extract: extract, + toString: toString + }; }; var anyValue = constant(value$1(SimpleResult.svalue)); var arrOfObj = compose(arrOf, objOf); @@ -1236,504 +1232,504 @@ var field = adt$1.field; var chooseFrom = function (path, strength, input, branches, ch) { - var fields = get$1(branches, ch); - return fields.fold(function () { - return missingBranch(path, branches, ch); - }, function (vp) { - return vp.extract(path.concat(['branch: ' + ch]), strength, input); - }); + var fields = get$1(branches, ch); + return fields.fold(function () { + return missingBranch(path, branches, ch); + }, function (vp) { + return vp.extract(path.concat(['branch: ' + ch]), strength, input); + }); }; var choose = function (key, branches) { - var extract = function (path, strength, input) { - var choice = get$1(input, key); - return choice.fold(function () { - return missingKey(path, key); - }, function (chosen) { - return chooseFrom(path, strength, input, branches, chosen); - }); - }; - var toString = function () { - return 'chooseOn(' + key + '). Possible values: ' + keys(branches); - }; - return { - extract: extract, - toString: toString - }; + var extract = function (path, strength, input) { + var choice = get$1(input, key); + return choice.fold(function () { + return missingKey(path, key); + }, function (chosen) { + return chooseFrom(path, strength, input, branches, chosen); + }); + }; + var toString = function () { + return 'chooseOn(' + key + '). Possible values: ' + keys(branches); + }; + return { + extract: extract, + toString: toString + }; }; var _anyValue = value$1(SimpleResult.svalue); var arrOfObj$1 = function (objFields) { - return arrOfObj(objFields); + return arrOfObj(objFields); }; var arrOfVal = function () { - return arrOf(_anyValue); + return arrOf(_anyValue); }; var valueThunkOf = valueThunk; var valueOf = function (validator) { - return value$1(function (v) { - return validator(v).fold(SimpleResult.serror, SimpleResult.svalue); - }); + return value$1(function (v) { + return validator(v).fold(SimpleResult.serror, SimpleResult.svalue); + }); }; var setOf$1 = function (validator, prop) { - return setOf(function (v) { - return SimpleResult.fromResult(validator(v)); - }, prop); + return setOf(function (v) { + return SimpleResult.fromResult(validator(v)); + }, prop); }; var extract = function (label, prop, strength, obj) { - var res = prop.extract([label], strength, obj); - return SimpleResult.mapError(res, function (errs) { - return { - input: obj, - errors: errs - }; - }); + var res = prop.extract([label], strength, obj); + return SimpleResult.mapError(res, function (errs) { + return { + input: obj, + errors: errs + }; + }); }; var asRaw = function (label, prop, obj) { - return SimpleResult.toResult(extract(label, prop, identity, obj)); + return SimpleResult.toResult(extract(label, prop, identity, obj)); }; var getOrDie = function (extraction) { - return extraction.fold(function (errInfo) { - throw new Error(formatError(errInfo)); - }, identity); + return extraction.fold(function (errInfo) { + throw new Error(formatError(errInfo)); + }, identity); }; var asRawOrDie = function (label, prop, obj) { - return getOrDie(asRaw(label, prop, obj)); + return getOrDie(asRaw(label, prop, obj)); }; var formatError = function (errInfo) { - return 'Errors: \n' + formatErrors(errInfo.errors).join('\n') + '\n\nInput object: ' + formatObj(errInfo.input); + return 'Errors: \n' + formatErrors(errInfo.errors).join('\n') + '\n\nInput object: ' + formatObj(errInfo.input); }; var chooseProcessor = function (key, branches) { - return choose(key, branches); + return choose(key, branches); }; var choose$1 = function (key, branches) { - return choose(key, map$2(branches, objOf)); + return choose(key, map$2(branches, objOf)); }; var thunkOf = function (desc, schema) { - return thunk(desc, schema); + return thunk(desc, schema); }; var anyValue$1 = constant(_anyValue); var typedValue = function (validator, expectedType) { - return value$1(function (a) { - var actualType = typeof a; - return validator(a) ? SimpleResult.svalue(a) : SimpleResult.serror('Expected type: ' + expectedType + ' but got: ' + actualType); - }); + return value$1(function (a) { + var actualType = typeof a; + return validator(a) ? SimpleResult.svalue(a) : SimpleResult.serror('Expected type: ' + expectedType + ' but got: ' + actualType); + }); }; var number = typedValue(isNumber, 'number'); var string = typedValue(isString, 'string'); var boolean = typedValue(isBoolean, 'boolean'); var functionProcessor = typedValue(isFunction, 'function'); var isPostMessageable = function (val) { - var every = function (iter, callbackFn) { - var result = iter.next(); - while (!result.done) { - if (!callbackFn(result.value)) { - return false; - } - result = iter.next(); - } - return true; - }; - if (Object(val) !== val) { - return true; - } - switch ({}.toString.call(val).slice(8, -1)) { - case 'Boolean': - case 'Number': - case 'String': - case 'Date': - case 'RegExp': - case 'Blob': - case 'FileList': - case 'ImageData': - case 'ImageBitmap': - case 'ArrayBuffer': - return true; - case 'Array': - case 'Object': - return Object.keys(val).every(function (prop) { - return isPostMessageable(val[prop]); - }); - case 'Map': - return every(val.keys(), isPostMessageable) && every(val.values(), isPostMessageable); - case 'Set': - return every(val.keys(), isPostMessageable); - default: - return false; + var every = function (iter, callbackFn) { + var result = iter.next(); + while (!result.done) { + if (!callbackFn(result.value)) { + return false; + } + result = iter.next(); } + return true; + }; + if (Object(val) !== val) { + return true; + } + switch ({}.toString.call(val).slice(8, -1)) { + case 'Boolean': + case 'Number': + case 'String': + case 'Date': + case 'RegExp': + case 'Blob': + case 'FileList': + case 'ImageData': + case 'ImageBitmap': + case 'ArrayBuffer': + return true; + case 'Array': + case 'Object': + return Object.keys(val).every(function (prop) { + return isPostMessageable(val[prop]); + }); + case 'Map': + return every(val.keys(), isPostMessageable) && every(val.values(), isPostMessageable); + case 'Set': + return every(val.keys(), isPostMessageable); + default: + return false; + } }; var postMessageable = value$1(function (a) { - return isPostMessageable(a) ? SimpleResult.svalue(a) : SimpleResult.serror('Expected value to be acceptable for sending via postMessage'); + return isPostMessageable(a) ? SimpleResult.svalue(a) : SimpleResult.serror('Expected value to be acceptable for sending via postMessage'); }); var validateEnum = function (values) { - return valueOf(function (value) { - return contains(values, value) ? Result.value(value) : Result.error('Unsupported value: "' + value + '", choose one of "' + values.join(', ') + '".'); - }); + return valueOf(function (value) { + return contains(values, value) ? Result.value(value) : Result.error('Unsupported value: "' + value + '", choose one of "' + values.join(', ') + '".'); + }); }; var strict$1 = function (key) { - return field(key, key, strict(), anyValue()); + return field(key, key, strict(), anyValue()); }; var strictOf = function (key, schema) { - return field(key, key, strict(), schema); + return field(key, key, strict(), schema); }; var strictNumber = function (key) { - return strictOf(key, number); + return strictOf(key, number); }; var strictString = function (key) { - return strictOf(key, string); + return strictOf(key, string); }; var strictStringEnum = function (key, values) { - return field(key, key, strict(), validateEnum(values)); + return field(key, key, strict(), validateEnum(values)); }; var strictBoolean = function (key) { - return strictOf(key, boolean); + return strictOf(key, boolean); }; var strictFunction = function (key) { - return strictOf(key, functionProcessor); + return strictOf(key, functionProcessor); }; var forbid = function (key, message) { - return field(key, key, asOption(), value$1(function (_v) { - return SimpleResult.serror('The field: ' + key + ' is forbidden. ' + message); - })); + return field(key, key, asOption(), value$1(function (_v) { + return SimpleResult.serror('The field: ' + key + ' is forbidden. ' + message); + })); }; var strictObjOf = function (key, objSchema) { - return field(key, key, strict(), objOf(objSchema)); + return field(key, key, strict(), objOf(objSchema)); }; var strictArrayOfObj = function (key, objFields) { - return field(key, key, strict(), arrOfObj(objFields)); + return field(key, key, strict(), arrOfObj(objFields)); }; var strictArrayOf = function (key, schema) { - return field(key, key, strict(), arrOf(schema)); + return field(key, key, strict(), arrOf(schema)); }; var option = function (key) { - return field(key, key, asOption(), anyValue()); + return field(key, key, asOption(), anyValue()); }; var optionOf = function (key, schema) { - return field(key, key, asOption(), schema); + return field(key, key, asOption(), schema); }; var optionNumber = function (key) { - return optionOf(key, number); + return optionOf(key, number); }; var optionString = function (key) { - return optionOf(key, string); + return optionOf(key, string); }; var optionFunction = function (key) { - return optionOf(key, functionProcessor); + return optionOf(key, functionProcessor); }; var optionArrayOf = function (key, schema) { - return optionOf(key, arrOf(schema)); + return optionOf(key, arrOf(schema)); }; var optionObjOf = function (key, objSchema) { - return optionOf(key, objOf(objSchema)); + return optionOf(key, objOf(objSchema)); }; var optionObjOfOnly = function (key, objSchema) { - return optionOf(key, objOfOnly(objSchema)); + return optionOf(key, objOfOnly(objSchema)); }; var defaulted$1 = function (key, fallback) { - return field(key, key, defaulted(fallback), anyValue()); + return field(key, key, defaulted(fallback), anyValue()); }; var defaultedOf = function (key, fallback, schema) { - return field(key, key, defaulted(fallback), schema); + return field(key, key, defaulted(fallback), schema); }; var defaultedNumber = function (key, fallback) { - return defaultedOf(key, fallback, number); + return defaultedOf(key, fallback, number); }; var defaultedString = function (key, fallback) { - return defaultedOf(key, fallback, string); + return defaultedOf(key, fallback, string); }; var defaultedStringEnum = function (key, fallback, values) { - return defaultedOf(key, fallback, validateEnum(values)); + return defaultedOf(key, fallback, validateEnum(values)); }; var defaultedBoolean = function (key, fallback) { - return defaultedOf(key, fallback, boolean); + return defaultedOf(key, fallback, boolean); }; var defaultedFunction = function (key, fallback) { - return defaultedOf(key, fallback, functionProcessor); + return defaultedOf(key, fallback, functionProcessor); }; var defaultedPostMsg = function (key, fallback) { - return defaultedOf(key, fallback, postMessageable); + return defaultedOf(key, fallback, postMessageable); }; var defaultedArrayOf = function (key, fallback, schema) { - return defaultedOf(key, fallback, arrOf(schema)); + return defaultedOf(key, fallback, arrOf(schema)); }; var defaultedObjOf = function (key, fallback, objSchema) { - return defaultedOf(key, fallback, objOf(objSchema)); + return defaultedOf(key, fallback, objOf(objSchema)); }; var state$1 = function (okey, instantiator) { - return state(okey, instantiator); + return state(okey, instantiator); }; var Cell = function (initial) { - var value = initial; - var get = function () { - return value; - }; - var set = function (v) { - value = v; - }; - return { - get: get, - set: set - }; + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; }; var fromHtml = function (html, scope) { - var doc = scope || document; - var div = doc.createElement('div'); - div.innerHTML = html; - if (!div.hasChildNodes() || div.childNodes.length > 1) { - console.error('HTML does not have a single root node', html); - throw new Error('HTML must have a single root node'); - } - return fromDom(div.childNodes[0]); + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); }; var fromTag = function (tag, scope) { - var doc = scope || document; - var node = doc.createElement(tag); - return fromDom(node); + var doc = scope || document; + var node = doc.createElement(tag); + return fromDom(node); }; var fromText = function (text, scope) { - var doc = scope || document; - var node = doc.createTextNode(text); - return fromDom(node); + var doc = scope || document; + var node = doc.createTextNode(text); + return fromDom(node); }; var fromDom = function (node) { - if (node === null || node === undefined) { - throw new Error('Node cannot be null or undefined'); - } - return {dom: node}; + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: node }; }; var fromPoint = function (docElm, x, y) { - return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); + return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); }; var SugarElement = { - fromHtml: fromHtml, - fromTag: fromTag, - fromText: fromText, - fromDom: fromDom, - fromPoint: fromPoint + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint }; var DeviceType = function (os, browser, userAgent, mediaMatch) { - var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true; - var isiPhone = os.isiOS() && !isiPad; - var isMobile = os.isiOS() || os.isAndroid(); - var isTouch = isMobile || mediaMatch('(pointer:coarse)'); - var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)'); - var isPhone = isiPhone || isMobile && !isTablet; - var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false; - var isDesktop = !isPhone && !isTablet && !iOSwebview; - return { - isiPad: constant(isiPad), - isiPhone: constant(isiPhone), - isTablet: constant(isTablet), - isPhone: constant(isPhone), - isTouch: constant(isTouch), - isAndroid: os.isAndroid, - isiOS: os.isiOS, - isWebView: constant(iOSwebview), - isDesktop: constant(isDesktop) - }; + var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true; + var isiPhone = os.isiOS() && !isiPad; + var isMobile = os.isiOS() || os.isAndroid(); + var isTouch = isMobile || mediaMatch('(pointer:coarse)'); + var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)'); + var isPhone = isiPhone || isMobile && !isTablet; + var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false; + var isDesktop = !isPhone && !isTablet && !iOSwebview; + return { + isiPad: constant(isiPad), + isiPhone: constant(isiPhone), + isTablet: constant(isTablet), + isPhone: constant(isPhone), + isTouch: constant(isTouch), + isAndroid: os.isAndroid, + isiOS: os.isiOS, + isWebView: constant(iOSwebview), + isDesktop: constant(isDesktop) + }; }; var firstMatch = function (regexes, s) { - for (var i = 0; i < regexes.length; i++) { - var x = regexes[i]; - if (x.test(s)) { - return x; - } + for (var i = 0; i < regexes.length; i++) { + var x = regexes[i]; + if (x.test(s)) { + return x; } - return undefined; + } + return undefined; }; var find$2 = function (regexes, agent) { - var r = firstMatch(regexes, agent); - if (!r) { - return { - major: 0, - minor: 0 - }; - } - var group = function (i) { - return Number(agent.replace(r, '$' + i)); + var r = firstMatch(regexes, agent); + if (!r) { + return { + major: 0, + minor: 0 }; - return nu$1(group(1), group(2)); + } + var group = function (i) { + return Number(agent.replace(r, '$' + i)); + }; + return nu$1(group(1), group(2)); }; var detect = function (versionRegexes, agent) { - var cleanedAgent = String(agent).toLowerCase(); - if (versionRegexes.length === 0) { - return unknown(); - } - return find$2(versionRegexes, cleanedAgent); + var cleanedAgent = String(agent).toLowerCase(); + if (versionRegexes.length === 0) { + return unknown(); + } + return find$2(versionRegexes, cleanedAgent); }; var unknown = function () { - return nu$1(0, 0); + return nu$1(0, 0); }; var nu$1 = function (major, minor) { - return { - major: major, - minor: minor - }; + return { + major: major, + minor: minor + }; }; var Version = { - nu: nu$1, - detect: detect, - unknown: unknown + nu: nu$1, + detect: detect, + unknown: unknown }; var detect$1 = function (candidates, userAgent) { - var agent = String(userAgent).toLowerCase(); - return find(candidates, function (candidate) { - return candidate.search(agent); - }); + var agent = String(userAgent).toLowerCase(); + return find(candidates, function (candidate) { + return candidate.search(agent); + }); }; var detectBrowser = function (browsers, userAgent) { - return detect$1(browsers, userAgent).map(function (browser) { - var version = Version.detect(browser.versionRegexes, userAgent); - return { - current: browser.name, - version: version - }; - }); + return detect$1(browsers, userAgent).map(function (browser) { + var version = Version.detect(browser.versionRegexes, userAgent); + return { + current: browser.name, + version: version + }; + }); }; var detectOs = function (oses, userAgent) { - return detect$1(oses, userAgent).map(function (os) { - var version = Version.detect(os.versionRegexes, userAgent); - return { - current: os.name, - version: version - }; - }); + return detect$1(oses, userAgent).map(function (os) { + var version = Version.detect(os.versionRegexes, userAgent); + return { + current: os.name, + version: version + }; + }); }; var UaString = { - detectBrowser: detectBrowser, - detectOs: detectOs + detectBrowser: detectBrowser, + detectOs: detectOs }; var checkRange = function (str, substr, start) { - return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr; + return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr; }; var contains$1 = function (str, substr) { - return str.indexOf(substr) !== -1; + return str.indexOf(substr) !== -1; }; var endsWith = function (str, suffix) { - return checkRange(str, suffix, str.length - suffix.length); + return checkRange(str, suffix, str.length - suffix.length); }; var blank = function (r) { - return function (s) { - return s.replace(r, ''); - }; + return function (s) { + return s.replace(r, ''); + }; }; var trim = blank(/^\s+|\s+$/g); var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/; var checkContains = function (target) { - return function (uastring) { - return contains$1(uastring, target); - }; + return function (uastring) { + return contains$1(uastring, target); + }; }; var browsers = [ - { - name: 'Edge', - versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/], - search: function (uastring) { - return contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit'); - } - }, - { - name: 'Chrome', - versionRegexes: [ - /.*?chrome\/([0-9]+)\.([0-9]+).*/, - normalVersionRegex - ], - search: function (uastring) { - return contains$1(uastring, 'chrome') && !contains$1(uastring, 'chromeframe'); - } - }, - { - name: 'IE', - versionRegexes: [ - /.*?msie\ ?([0-9]+)\.([0-9]+).*/, - /.*?rv:([0-9]+)\.([0-9]+).*/ - ], - search: function (uastring) { - return contains$1(uastring, 'msie') || contains$1(uastring, 'trident'); - } - }, - { - name: 'Opera', - versionRegexes: [ - normalVersionRegex, - /.*?opera\/([0-9]+)\.([0-9]+).*/ - ], - search: checkContains('opera') - }, - { - name: 'Firefox', - versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/], - search: checkContains('firefox') - }, - { - name: 'Safari', - versionRegexes: [ - normalVersionRegex, - /.*?cpu os ([0-9]+)_([0-9]+).*/ - ], - search: function (uastring) { - return (contains$1(uastring, 'safari') || contains$1(uastring, 'mobile/')) && contains$1(uastring, 'applewebkit'); - } + { + name: 'Edge', + versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/], + search: function (uastring) { + return contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit'); + } + }, + { + name: 'Chrome', + versionRegexes: [ + /.*?chrome\/([0-9]+)\.([0-9]+).*/, + normalVersionRegex + ], + search: function (uastring) { + return contains$1(uastring, 'chrome') && !contains$1(uastring, 'chromeframe'); + } + }, + { + name: 'IE', + versionRegexes: [ + /.*?msie\ ?([0-9]+)\.([0-9]+).*/, + /.*?rv:([0-9]+)\.([0-9]+).*/ + ], + search: function (uastring) { + return contains$1(uastring, 'msie') || contains$1(uastring, 'trident'); + } + }, + { + name: 'Opera', + versionRegexes: [ + normalVersionRegex, + /.*?opera\/([0-9]+)\.([0-9]+).*/ + ], + search: checkContains('opera') + }, + { + name: 'Firefox', + versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/], + search: checkContains('firefox') + }, + { + name: 'Safari', + versionRegexes: [ + normalVersionRegex, + /.*?cpu os ([0-9]+)_([0-9]+).*/ + ], + search: function (uastring) { + return (contains$1(uastring, 'safari') || contains$1(uastring, 'mobile/')) && contains$1(uastring, 'applewebkit'); } + } ]; var oses = [ - { - name: 'Windows', - search: checkContains('win'), - versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/] - }, - { - name: 'iOS', - search: function (uastring) { - return contains$1(uastring, 'iphone') || contains$1(uastring, 'ipad'); - }, - versionRegexes: [ - /.*?version\/\ ?([0-9]+)\.([0-9]+).*/, - /.*cpu os ([0-9]+)_([0-9]+).*/, - /.*cpu iphone os ([0-9]+)_([0-9]+).*/ - ] - }, - { - name: 'Android', - search: checkContains('android'), - versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/] - }, - { - name: 'OSX', - search: checkContains('mac os x'), - versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/] - }, - { - name: 'Linux', - search: checkContains('linux'), - versionRegexes: [] - }, - { - name: 'Solaris', - search: checkContains('sunos'), - versionRegexes: [] - }, - { - name: 'FreeBSD', - search: checkContains('freebsd'), - versionRegexes: [] + { + name: 'Windows', + search: checkContains('win'), + versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'iOS', + search: function (uastring) { + return contains$1(uastring, 'iphone') || contains$1(uastring, 'ipad'); }, - { - name: 'ChromeOS', - search: checkContains('cros'), - versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/] - } + versionRegexes: [ + /.*?version\/\ ?([0-9]+)\.([0-9]+).*/, + /.*cpu os ([0-9]+)_([0-9]+).*/, + /.*cpu iphone os ([0-9]+)_([0-9]+).*/ + ] + }, + { + name: 'Android', + search: checkContains('android'), + versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'OSX', + search: checkContains('mac os x'), + versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/] + }, + { + name: 'Linux', + search: checkContains('linux'), + versionRegexes: [] + }, + { + name: 'Solaris', + search: checkContains('sunos'), + versionRegexes: [] + }, + { + name: 'FreeBSD', + search: checkContains('freebsd'), + versionRegexes: [] + }, + { + name: 'ChromeOS', + search: checkContains('cros'), + versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/] + } ]; var PlatformInfo = { - browsers: constant(browsers), - oses: constant(oses) + browsers: constant(browsers), + oses: constant(oses) }; var edge = 'Edge'; @@ -1743,39 +1739,39 @@ var firefox = 'Firefox'; var safari = 'Safari'; var unknown$1 = function () { - return nu$2({ - current: undefined, - version: Version.unknown() - }); + return nu$2({ + current: undefined, + version: Version.unknown() + }); }; var nu$2 = function (info) { - var current = info.current; - var version = info.version; - var isBrowser = function (name) { - return function () { - return current === name; - }; - }; - return { - current: current, - version: version, - isEdge: isBrowser(edge), - isChrome: isBrowser(chrome), - isIE: isBrowser(ie), - isOpera: isBrowser(opera), - isFirefox: isBrowser(firefox), - isSafari: isBrowser(safari) - }; + var current = info.current; + var version = info.version; + var isBrowser = function (name) { + return function () { + return current === name; + }; + }; + return { + current: current, + version: version, + isEdge: isBrowser(edge), + isChrome: isBrowser(chrome), + isIE: isBrowser(ie), + isOpera: isBrowser(opera), + isFirefox: isBrowser(firefox), + isSafari: isBrowser(safari) + }; }; var Browser = { - unknown: unknown$1, - nu: nu$2, - edge: constant(edge), - chrome: constant(chrome), - ie: constant(ie), - opera: constant(opera), - firefox: constant(firefox), - safari: constant(safari) + unknown: unknown$1, + nu: nu$2, + edge: constant(edge), + chrome: constant(chrome), + ie: constant(ie), + opera: constant(opera), + firefox: constant(firefox), + safari: constant(safari) }; var windows = 'Windows'; @@ -1787,74 +1783,74 @@ var freebsd = 'FreeBSD'; var chromeos = 'ChromeOS'; var unknown$2 = function () { - return nu$3({ - current: undefined, - version: Version.unknown() - }); + return nu$3({ + current: undefined, + version: Version.unknown() + }); }; var nu$3 = function (info) { - var current = info.current; - var version = info.version; - var isOS = function (name) { - return function () { - return current === name; - }; - }; - return { - current: current, - version: version, - isWindows: isOS(windows), - isiOS: isOS(ios), - isAndroid: isOS(android), - isOSX: isOS(osx), - isLinux: isOS(linux), - isSolaris: isOS(solaris), - isFreeBSD: isOS(freebsd), - isChromeOS: isOS(chromeos) - }; + var current = info.current; + var version = info.version; + var isOS = function (name) { + return function () { + return current === name; + }; + }; + return { + current: current, + version: version, + isWindows: isOS(windows), + isiOS: isOS(ios), + isAndroid: isOS(android), + isOSX: isOS(osx), + isLinux: isOS(linux), + isSolaris: isOS(solaris), + isFreeBSD: isOS(freebsd), + isChromeOS: isOS(chromeos) + }; }; var OperatingSystem = { - unknown: unknown$2, - nu: nu$3, - windows: constant(windows), - ios: constant(ios), - android: constant(android), - linux: constant(linux), - osx: constant(osx), - solaris: constant(solaris), - freebsd: constant(freebsd), - chromeos: constant(chromeos) + unknown: unknown$2, + nu: nu$3, + windows: constant(windows), + ios: constant(ios), + android: constant(android), + linux: constant(linux), + osx: constant(osx), + solaris: constant(solaris), + freebsd: constant(freebsd), + chromeos: constant(chromeos) }; var detect$2 = function (userAgent, mediaMatch) { - var browsers = PlatformInfo.browsers(); - var oses = PlatformInfo.oses(); - var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu); - var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu); - var deviceType = DeviceType(os, browser, userAgent, mediaMatch); - return { - browser: browser, - os: os, - deviceType: deviceType - }; - }; - var PlatformDetection = {detect: detect$2}; + var browsers = PlatformInfo.browsers(); + var oses = PlatformInfo.oses(); + var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu); + var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu); + var deviceType = DeviceType(os, browser, userAgent, mediaMatch); + return { + browser: browser, + os: os, + deviceType: deviceType + }; + }; + var PlatformDetection = { detect: detect$2 }; var mediaMatch = function (query) { - return window.matchMedia(query).matches; + return window.matchMedia(query).matches; }; var platform = cached(function () { - return PlatformDetection.detect(navigator.userAgent, mediaMatch); + return PlatformDetection.detect(navigator.userAgent, mediaMatch); }); var detect$3 = function () { - return platform(); + return platform(); }; var compareDocumentPosition = function (a, b, match) { - return (a.compareDocumentPosition(b) & match) !== 0; + return (a.compareDocumentPosition(b) & match) !== 0; }; var documentPositionContainedBy = function (a, b) { - return compareDocumentPosition(a, b, Node.DOCUMENT_POSITION_CONTAINED_BY); + return compareDocumentPosition(a, b, Node.DOCUMENT_POSITION_CONTAINED_BY); }; var DOCUMENT = 9; @@ -1863,141 +1859,141 @@ var TEXT = 3; var is = function (element, selector) { - var dom = element.dom; - if (dom.nodeType !== ELEMENT) { - return false; + var dom = element.dom; + if (dom.nodeType !== ELEMENT) { + return false; + } else { + var elem = dom; + if (elem.matches !== undefined) { + return elem.matches(selector); + } else if (elem.msMatchesSelector !== undefined) { + return elem.msMatchesSelector(selector); + } else if (elem.webkitMatchesSelector !== undefined) { + return elem.webkitMatchesSelector(selector); + } else if (elem.mozMatchesSelector !== undefined) { + return elem.mozMatchesSelector(selector); } else { - var elem = dom; - if (elem.matches !== undefined) { - return elem.matches(selector); - } else if (elem.msMatchesSelector !== undefined) { - return elem.msMatchesSelector(selector); - } else if (elem.webkitMatchesSelector !== undefined) { - return elem.webkitMatchesSelector(selector); - } else if (elem.mozMatchesSelector !== undefined) { - return elem.mozMatchesSelector(selector); - } else { - throw new Error('Browser lacks native selectors'); - } + throw new Error('Browser lacks native selectors'); } + } }; var bypassSelector = function (dom) { - return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0; + return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0; }; var all = function (selector, scope) { - var base = scope === undefined ? document : scope.dom; - return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), SugarElement.fromDom); + var base = scope === undefined ? document : scope.dom; + return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), SugarElement.fromDom); }; var one = function (selector, scope) { - var base = scope === undefined ? document : scope.dom; - return bypassSelector(base) ? Optional.none() : Optional.from(base.querySelector(selector)).map(SugarElement.fromDom); + var base = scope === undefined ? document : scope.dom; + return bypassSelector(base) ? Optional.none() : Optional.from(base.querySelector(selector)).map(SugarElement.fromDom); }; var eq$1 = function (e1, e2) { - return e1.dom === e2.dom; + return e1.dom === e2.dom; }; var regularContains = function (e1, e2) { - var d1 = e1.dom; - var d2 = e2.dom; - return d1 === d2 ? false : d1.contains(d2); + var d1 = e1.dom; + var d2 = e2.dom; + return d1 === d2 ? false : d1.contains(d2); }; var ieContains = function (e1, e2) { - return documentPositionContainedBy(e1.dom, e2.dom); + return documentPositionContainedBy(e1.dom, e2.dom); }; var contains$2 = function (e1, e2) { - return detect$3().browser.isIE() ? ieContains(e1, e2) : regularContains(e1, e2); + return detect$3().browser.isIE() ? ieContains(e1, e2) : regularContains(e1, e2); }; var ensureIsRoot = function (isRoot) { - return isFunction(isRoot) ? isRoot : never; + return isFunction(isRoot) ? isRoot : never; }; var ancestor = function (scope, transform, isRoot) { - var element = scope.dom; - var stop = ensureIsRoot(isRoot); - while (element.parentNode) { - element = element.parentNode; - var el = SugarElement.fromDom(element); - var transformed = transform(el); - if (transformed.isSome()) { - return transformed; - } else if (stop(el)) { - break; - } - } - return Optional.none(); + var element = scope.dom; + var stop = ensureIsRoot(isRoot); + while (element.parentNode) { + element = element.parentNode; + var el = SugarElement.fromDom(element); + var transformed = transform(el); + if (transformed.isSome()) { + return transformed; + } else if (stop(el)) { + break; + } + } + return Optional.none(); }; var closest = function (scope, transform, isRoot) { - var current = transform(scope); - var stop = ensureIsRoot(isRoot); - return current.orThunk(function () { - return stop(scope) ? Optional.none() : ancestor(scope, transform, stop); - }); + var current = transform(scope); + var stop = ensureIsRoot(isRoot); + return current.orThunk(function () { + return stop(scope) ? Optional.none() : ancestor(scope, transform, stop); + }); }; var isSource = function (component, simulatedEvent) { - return eq$1(component.element, simulatedEvent.event.target); + return eq$1(component.element, simulatedEvent.event.target); }; var nu$4 = function (parts) { - if (!hasNonNullableKey(parts, 'can') && !hasNonNullableKey(parts, 'abort') && !hasNonNullableKey(parts, 'run')) { - throw new Error('EventHandler defined by: ' + JSON.stringify(parts, null, 2) + ' does not have can, abort, or run!'); - } - return asRawOrDie('Extracting event.handler', objOfOnly([ - defaulted$1('can', always), - defaulted$1('abort', never), - defaulted$1('run', noop) - ]), parts); + if (!hasNonNullableKey(parts, 'can') && !hasNonNullableKey(parts, 'abort') && !hasNonNullableKey(parts, 'run')) { + throw new Error('EventHandler defined by: ' + JSON.stringify(parts, null, 2) + ' does not have can, abort, or run!'); + } + return asRawOrDie('Extracting event.handler', objOfOnly([ + defaulted$1('can', always), + defaulted$1('abort', never), + defaulted$1('run', noop) + ]), parts); }; var all$1 = function (handlers, f) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return foldl(handlers, function (acc, handler) { - return acc && f(handler).apply(undefined, args); - }, true); - }; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return foldl(handlers, function (acc, handler) { + return acc && f(handler).apply(undefined, args); + }, true); + }; }; var any = function (handlers, f) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return foldl(handlers, function (acc, handler) { - return acc || f(handler).apply(undefined, args); - }, false); - }; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return foldl(handlers, function (acc, handler) { + return acc || f(handler).apply(undefined, args); + }, false); + }; }; var read = function (handler) { - return isFunction(handler) ? { - can: constant(true), - abort: constant(false), - run: handler - } : handler; + return isFunction(handler) ? { + can: constant(true), + abort: constant(false), + run: handler + } : handler; }; var fuse = function (handlers) { - var can = all$1(handlers, function (handler) { - return handler.can; - }); - var abort = any(handlers, function (handler) { - return handler.abort; - }); - var run = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - each(handlers, function (handler) { - handler.run.apply(undefined, args); - }); - }; - return nu$4({ - can: can, - abort: abort, - run: run - }); + var can = all$1(handlers, function (handler) { + return handler.can; + }); + var abort = any(handlers, function (handler) { + return handler.abort; + }); + var run = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + each(handlers, function (handler) { + handler.run.apply(undefined, args); + }); + }; + return nu$4({ + can: can, + abort: abort, + run: run + }); }; var constant$1 = constant; @@ -2021,9 +2017,9 @@ var selectstart = constant$1('selectstart'); var prefixName = function (name) { - return constant('alloy.' + name); + return constant('alloy.' + name); }; - var alloy = {tap: prefixName('tap')}; + var alloy = { tap: prefixName('tap') }; var focus = prefixName('focus'); var postBlur = prefixName('blur.post'); var postPaste = prefixName('paste.post'); @@ -2051,125 +2047,125 @@ var dehighlight = prefixName('dehighlight'); var emit = function (component, event) { - dispatchWith(component, component.element, event, {}); + dispatchWith(component, component.element, event, {}); }; var emitWith = function (component, event, properties) { - dispatchWith(component, component.element, event, properties); + dispatchWith(component, component.element, event, properties); }; var emitExecute = function (component) { - emit(component, execute()); + emit(component, execute()); }; var dispatch = function (component, target, event) { - dispatchWith(component, target, event, {}); + dispatchWith(component, target, event, {}); }; var dispatchWith = function (component, target, event, properties) { - var data = __assign({target: target}, properties); - component.getSystem().triggerEvent(event, target, data); + var data = __assign({ target: target }, properties); + component.getSystem().triggerEvent(event, target, data); }; var dispatchEvent = function (component, target, event, simulatedEvent) { - component.getSystem().triggerEvent(event, target, simulatedEvent.event); + component.getSystem().triggerEvent(event, target, simulatedEvent.event); }; var derive = function (configs) { - return wrapAll$1(configs); + return wrapAll$1(configs); }; var abort = function (name, predicate) { - return { - key: name, - value: nu$4({abort: predicate}) - }; + return { + key: name, + value: nu$4({ abort: predicate }) + }; }; var can = function (name, predicate) { - return { - key: name, - value: nu$4({can: predicate}) - }; + return { + key: name, + value: nu$4({ can: predicate }) + }; }; var preventDefault = function (name) { - return { - key: name, - value: nu$4({ - run: function (component, simulatedEvent) { - simulatedEvent.event.prevent(); - } - }) - }; + return { + key: name, + value: nu$4({ + run: function (component, simulatedEvent) { + simulatedEvent.event.prevent(); + } + }) + }; }; var run = function (name, handler) { - return { - key: name, - value: nu$4({run: handler}) - }; + return { + key: name, + value: nu$4({ run: handler }) + }; }; var runActionExtra = function (name, action, extra) { - return { - key: name, - value: nu$4({ - run: function (component, simulatedEvent) { - action.apply(undefined, [ - component, - simulatedEvent - ].concat(extra)); - } - }) - }; + return { + key: name, + value: nu$4({ + run: function (component, simulatedEvent) { + action.apply(undefined, [ + component, + simulatedEvent + ].concat(extra)); + } + }) + }; }; var runOnName = function (name) { - return function (handler) { - return run(name, handler); - }; + return function (handler) { + return run(name, handler); + }; }; var runOnSourceName = function (name) { - return function (handler) { - return { - key: name, - value: nu$4({ - run: function (component, simulatedEvent) { - if (isSource(component, simulatedEvent)) { - handler(component, simulatedEvent); - } - } - }) - }; + return function (handler) { + return { + key: name, + value: nu$4({ + run: function (component, simulatedEvent) { + if (isSource(component, simulatedEvent)) { + handler(component, simulatedEvent); + } + } + }) }; + }; }; var redirectToUid = function (name, uid) { - return run(name, function (component, simulatedEvent) { - component.getSystem().getByUid(uid).each(function (redirectee) { - dispatchEvent(redirectee, redirectee.element, name, simulatedEvent); - }); + return run(name, function (component, simulatedEvent) { + component.getSystem().getByUid(uid).each(function (redirectee) { + dispatchEvent(redirectee, redirectee.element, name, simulatedEvent); }); + }); }; var redirectToPart = function (name, detail, partName) { - var uid = detail.partUids[partName]; - return redirectToUid(name, uid); + var uid = detail.partUids[partName]; + return redirectToUid(name, uid); }; var runWithTarget = function (name, f) { - return run(name, function (component, simulatedEvent) { - var ev = simulatedEvent.event; - var target = component.getSystem().getByDom(ev.target).fold(function () { - var closest$1 = closest(ev.target, function (el) { - return component.getSystem().getByDom(el).toOptional(); - }, never); - return closest$1.getOr(component); - }, function (c) { - return c; - }); - f(component, target, simulatedEvent); - }); + return run(name, function (component, simulatedEvent) { + var ev = simulatedEvent.event; + var target = component.getSystem().getByDom(ev.target).fold(function () { + var closest$1 = closest(ev.target, function (el) { + return component.getSystem().getByDom(el).toOptional(); + }, never); + return closest$1.getOr(component); + }, function (c) { + return c; + }); + f(component, target, simulatedEvent); + }); }; var cutter = function (name) { - return run(name, function (component, simulatedEvent) { - simulatedEvent.cut(); - }); + return run(name, function (component, simulatedEvent) { + simulatedEvent.cut(); + }); }; var stopper = function (name) { - return run(name, function (component, simulatedEvent) { - simulatedEvent.stop(); - }); + return run(name, function (component, simulatedEvent) { + simulatedEvent.stop(); + }); }; var runOnSource = function (name, f) { - return runOnSourceName(name)(f); + return runOnSourceName(name)(f); }; var runOnAttached = runOnSourceName(attachedToDom()); var runOnDetached = runOnSourceName(detachedFromDom()); @@ -2179,16 +2175,16 @@ var Global = typeof window !== 'undefined' ? window : Function('return this;')(); var name = function (element) { - var r = element.dom.nodeName; - return r.toLowerCase(); + var r = element.dom.nodeName; + return r.toLowerCase(); }; var type = function (element) { - return element.dom.nodeType; + return element.dom.nodeType; }; var isType$1 = function (t) { - return function (element) { - return type(element) === t; - }; + return function (element) { + return type(element) === t; + }; }; var isElement = isType$1(ELEMENT); var isText = isType$1(TEXT); @@ -2196,195 +2192,195 @@ var isDocumentFragment = isType$1(DOCUMENT_FRAGMENT); var owner = function (element) { - return SugarElement.fromDom(element.dom.ownerDocument); + return SugarElement.fromDom(element.dom.ownerDocument); }; var documentOrOwner = function (dos) { - return isDocument(dos) ? dos : owner(dos); + return isDocument(dos) ? dos : owner(dos); }; var documentElement = function (element) { - return SugarElement.fromDom(documentOrOwner(element).dom.documentElement); + return SugarElement.fromDom(documentOrOwner(element).dom.documentElement); }; var defaultView = function (element) { - return SugarElement.fromDom(documentOrOwner(element).dom.defaultView); + return SugarElement.fromDom(documentOrOwner(element).dom.defaultView); }; var parent = function (element) { - return Optional.from(element.dom.parentNode).map(SugarElement.fromDom); + return Optional.from(element.dom.parentNode).map(SugarElement.fromDom); }; var parentNode = function (element) { - return parent(element); + return parent(element); }; var offsetParent = function (element) { - return Optional.from(element.dom.offsetParent).map(SugarElement.fromDom); + return Optional.from(element.dom.offsetParent).map(SugarElement.fromDom); }; var nextSibling = function (element) { - return Optional.from(element.dom.nextSibling).map(SugarElement.fromDom); + return Optional.from(element.dom.nextSibling).map(SugarElement.fromDom); }; var children = function (element) { - return map(element.dom.childNodes, SugarElement.fromDom); + return map(element.dom.childNodes, SugarElement.fromDom); }; var child = function (element, index) { - var cs = element.dom.childNodes; - return Optional.from(cs[index]).map(SugarElement.fromDom); + var cs = element.dom.childNodes; + return Optional.from(cs[index]).map(SugarElement.fromDom); }; var firstChild = function (element) { - return child(element, 0); + return child(element, 0); }; var before = function (marker, element) { - var parent$1 = parent(marker); - parent$1.each(function (v) { - v.dom.insertBefore(element.dom, marker.dom); - }); + var parent$1 = parent(marker); + parent$1.each(function (v) { + v.dom.insertBefore(element.dom, marker.dom); + }); }; var after = function (marker, element) { - var sibling = nextSibling(marker); - sibling.fold(function () { - var parent$1 = parent(marker); - parent$1.each(function (v) { - append(v, element); - }); - }, function (v) { - before(v, element); + var sibling = nextSibling(marker); + sibling.fold(function () { + var parent$1 = parent(marker); + parent$1.each(function (v) { + append(v, element); }); + }, function (v) { + before(v, element); + }); }; var prepend = function (parent, element) { - var firstChild$1 = firstChild(parent); - firstChild$1.fold(function () { - append(parent, element); - }, function (v) { - parent.dom.insertBefore(element.dom, v.dom); - }); + var firstChild$1 = firstChild(parent); + firstChild$1.fold(function () { + append(parent, element); + }, function (v) { + parent.dom.insertBefore(element.dom, v.dom); + }); }; var append = function (parent, element) { - parent.dom.appendChild(element.dom); + parent.dom.appendChild(element.dom); }; var appendAt = function (parent, element, index) { - child(parent, index).fold(function () { - append(parent, element); - }, function (v) { - before(v, element); - }); + child(parent, index).fold(function () { + append(parent, element); + }, function (v) { + before(v, element); + }); }; var before$1 = function (marker, elements) { - each(elements, function (x) { - before(marker, x); - }); + each(elements, function (x) { + before(marker, x); + }); }; var append$1 = function (parent, elements) { - each(elements, function (x) { - append(parent, x); - }); + each(elements, function (x) { + append(parent, x); + }); }; var empty = function (element) { - element.dom.textContent = ''; - each(children(element), function (rogue) { - remove(rogue); - }); + element.dom.textContent = ''; + each(children(element), function (rogue) { + remove(rogue); + }); }; var remove = function (element) { - var dom = element.dom; - if (dom.parentNode !== null) { - dom.parentNode.removeChild(dom); - } + var dom = element.dom; + if (dom.parentNode !== null) { + dom.parentNode.removeChild(dom); + } }; var unwrap = function (wrapper) { - var children$1 = children(wrapper); - if (children$1.length > 0) { - before$1(wrapper, children$1); - } - remove(wrapper); + var children$1 = children(wrapper); + if (children$1.length > 0) { + before$1(wrapper, children$1); + } + remove(wrapper); }; var fromHtml$1 = function (html, scope) { - var doc = scope || document; - var div = doc.createElement('div'); - div.innerHTML = html; - return children(SugarElement.fromDom(div)); + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + return children(SugarElement.fromDom(div)); }; var get$2 = function (element) { - return element.dom.innerHTML; + return element.dom.innerHTML; }; var set = function (element, content) { - var owner$1 = owner(element); - var docDom = owner$1.dom; - var fragment = SugarElement.fromDom(docDom.createDocumentFragment()); - var contentElements = fromHtml$1(content, docDom); - append$1(fragment, contentElements); - empty(element); - append(element, fragment); + var owner$1 = owner(element); + var docDom = owner$1.dom; + var fragment = SugarElement.fromDom(docDom.createDocumentFragment()); + var contentElements = fromHtml$1(content, docDom); + append$1(fragment, contentElements); + empty(element); + append(element, fragment); }; var getOuter = function (element) { - var container = SugarElement.fromTag('div'); - var clone = SugarElement.fromDom(element.dom.cloneNode(true)); - append(container, clone); - return get$2(container); + var container = SugarElement.fromTag('div'); + var clone = SugarElement.fromDom(element.dom.cloneNode(true)); + append(container, clone); + return get$2(container); }; var rawSet = function (dom, key, value) { - if (isString(value) || isBoolean(value) || isNumber(value)) { - dom.setAttribute(key, value + ''); - } else { - console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); - throw new Error('Attribute value was not simple'); - } + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); + throw new Error('Attribute value was not simple'); + } }; var set$1 = function (element, key, value) { - rawSet(element.dom, key, value); + rawSet(element.dom, key, value); }; var setAll = function (element, attrs) { - var dom = element.dom; - each$1(attrs, function (v, k) { - rawSet(dom, k, v); - }); + var dom = element.dom; + each$1(attrs, function (v, k) { + rawSet(dom, k, v); + }); }; var get$3 = function (element, key) { - var v = element.dom.getAttribute(key); - return v === null ? undefined : v; + var v = element.dom.getAttribute(key); + return v === null ? undefined : v; }; var getOpt = function (element, key) { - return Optional.from(get$3(element, key)); + return Optional.from(get$3(element, key)); }; var has$1 = function (element, key) { - var dom = element.dom; - return dom && dom.hasAttribute ? dom.hasAttribute(key) : false; + var dom = element.dom; + return dom && dom.hasAttribute ? dom.hasAttribute(key) : false; }; var remove$1 = function (element, key) { - element.dom.removeAttribute(key); + element.dom.removeAttribute(key); }; var clone = function (original, isDeep) { - return SugarElement.fromDom(original.dom.cloneNode(isDeep)); + return SugarElement.fromDom(original.dom.cloneNode(isDeep)); }; var shallow$1 = function (original) { - return clone(original, false); + return clone(original, false); }; var getHtml = function (element) { - var clone = shallow$1(element); - return getOuter(clone); + var clone = shallow$1(element); + return getOuter(clone); }; var element = function (elem) { - return getHtml(elem); + return getHtml(elem); }; var isRecursive = function (component, originator, target) { - return eq$1(originator, component.element) && !eq$1(originator, target); + return eq$1(originator, component.element) && !eq$1(originator, target); }; var events = derive([can(focus(), function (component, simulatedEvent) { var event = simulatedEvent.event; var originator = event.originator; var target = event.target; if (isRecursive(component, originator, target)) { - console.warn(focus() + ' did not get interpreted by the desired target. ' + '\nOriginator: ' + element(originator) + '\nTarget: ' + element(target) + '\nCheck the ' + focus() + ' event handlers'); - return false; + console.warn(focus() + ' did not get interpreted by the desired target. ' + '\nOriginator: ' + element(originator) + '\nTarget: ' + element(target) + '\nCheck the ' + focus() + ' event handlers'); + return false; } else { - return true; + return true; } - })]); + })]); var DefaultEvents = /*#__PURE__*/Object.freeze({ __proto__: null, @@ -2393,11 +2389,11 @@ var unique = 0; var generate$1 = function (prefix) { - var date = new Date(); - var time = date.getTime(); - var random = Math.floor(Math.random() * 1000000000); - unique++; - return prefix + '_' + random + unique + String(time); + var date = new Date(); + var time = date.getTime(); + var random = Math.floor(Math.random() * 1000000000); + unique++; + return prefix + '_' + random + unique + String(time); }; var prefix = constant('alloy-id-'); @@ -2406,1058 +2402,1058 @@ var prefix$1 = prefix(); var idAttr$1 = idAttr(); var write = function (label, elem) { - var id = generate$1(prefix$1 + label); - writeOnly(elem, id); - return id; + var id = generate$1(prefix$1 + label); + writeOnly(elem, id); + return id; }; var writeOnly = function (elem, uid) { - Object.defineProperty(elem.dom, idAttr$1, { - value: uid, - writable: true - }); + Object.defineProperty(elem.dom, idAttr$1, { + value: uid, + writable: true + }); }; var read$1 = function (elem) { - var id = isElement(elem) ? elem.dom[idAttr$1] : null; - return Optional.from(id); + var id = isElement(elem) ? elem.dom[idAttr$1] : null; + return Optional.from(id); }; var generate$2 = function (prefix) { - return generate$1(prefix); + return generate$1(prefix); }; var make = identity; var NoContextApi = function (getComp) { - var fail = function (event) { - return function () { - throw new Error('The component must be in a context to send: ' + event + (getComp ? '\n' + element(getComp().element) + ' is not in context.' : '')); - }; - }; - return { - debugInfo: constant('fake'), - triggerEvent: fail('triggerEvent'), - triggerFocus: fail('triggerFocus'), - triggerEscape: fail('triggerEscape'), - build: fail('build'), - addToWorld: fail('addToWorld'), - removeFromWorld: fail('removeFromWorld'), - addToGui: fail('addToGui'), - removeFromGui: fail('removeFromGui'), - getByUid: fail('getByUid'), - getByDom: fail('getByDom'), - broadcast: fail('broadcast'), - broadcastOn: fail('broadcastOn'), - broadcastEvent: fail('broadcastEvent'), - isConnected: never - }; + var fail = function (event) { + return function () { + throw new Error('The component must be in a context to send: ' + event + (getComp ? '\n' + element(getComp().element) + ' is not in context.' : '')); + }; + }; + return { + debugInfo: constant('fake'), + triggerEvent: fail('triggerEvent'), + triggerFocus: fail('triggerFocus'), + triggerEscape: fail('triggerEscape'), + build: fail('build'), + addToWorld: fail('addToWorld'), + removeFromWorld: fail('removeFromWorld'), + addToGui: fail('addToGui'), + removeFromGui: fail('removeFromGui'), + getByUid: fail('getByUid'), + getByDom: fail('getByDom'), + broadcast: fail('broadcast'), + broadcastOn: fail('broadcastOn'), + broadcastEvent: fail('broadcastEvent'), + isConnected: never + }; }; var singleton = NoContextApi(); var markAsBehaviourApi = function (f, apiName, apiFunction) { - var delegate = apiFunction.toString(); - var endIndex = delegate.indexOf(')') + 1; - var openBracketIndex = delegate.indexOf('('); - var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\s*/); - f.toFunctionAnnotation = function () { - return { - name: apiName, - parameters: cleanParameters(parameters.slice(0, 1).concat(parameters.slice(3))) - }; + var delegate = apiFunction.toString(); + var endIndex = delegate.indexOf(')') + 1; + var openBracketIndex = delegate.indexOf('('); + var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\s*/); + f.toFunctionAnnotation = function () { + return { + name: apiName, + parameters: cleanParameters(parameters.slice(0, 1).concat(parameters.slice(3))) }; - return f; + }; + return f; }; var cleanParameters = function (parameters) { - return map(parameters, function (p) { - return endsWith(p, '/*') ? p.substring(0, p.length - '/*'.length) : p; - }); + return map(parameters, function (p) { + return endsWith(p, '/*') ? p.substring(0, p.length - '/*'.length) : p; + }); }; var markAsExtraApi = function (f, extraName) { - var delegate = f.toString(); - var endIndex = delegate.indexOf(')') + 1; - var openBracketIndex = delegate.indexOf('('); - var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\s*/); - f.toFunctionAnnotation = function () { - return { - name: extraName, - parameters: cleanParameters(parameters) - }; + var delegate = f.toString(); + var endIndex = delegate.indexOf(')') + 1; + var openBracketIndex = delegate.indexOf('('); + var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\s*/); + f.toFunctionAnnotation = function () { + return { + name: extraName, + parameters: cleanParameters(parameters) }; - return f; + }; + return f; }; var markAsSketchApi = function (f, apiFunction) { - var delegate = apiFunction.toString(); - var endIndex = delegate.indexOf(')') + 1; - var openBracketIndex = delegate.indexOf('('); - var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\s*/); - f.toFunctionAnnotation = function () { - return { - name: 'OVERRIDE', - parameters: cleanParameters(parameters.slice(1)) - }; + var delegate = apiFunction.toString(); + var endIndex = delegate.indexOf(')') + 1; + var openBracketIndex = delegate.indexOf('('); + var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\s*/); + f.toFunctionAnnotation = function () { + return { + name: 'OVERRIDE', + parameters: cleanParameters(parameters.slice(1)) }; - return f; + }; + return f; }; var premadeTag = generate$1('alloy-premade'); var premade = function (comp) { - return wrap$1(premadeTag, comp); + return wrap$1(premadeTag, comp); }; var getPremade = function (spec) { - return get$1(spec, premadeTag); + return get$1(spec, premadeTag); }; var makeApi = function (f) { - return markAsSketchApi(function (component) { - var rest = []; - for (var _i = 1; _i < arguments.length; _i++) { - rest[_i - 1] = arguments[_i]; - } - return f.apply(void 0, __spreadArrays([ - component.getApis(), - component - ], rest)); - }, f); + return markAsSketchApi(function (component) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + return f.apply(void 0, __spreadArrays([ + component.getApis(), + component + ], rest)); + }, f); }; var NoState = { - init: function () { - return nu$5({ - readState: function () { - return 'No State required'; - } - }); - } + init: function () { + return nu$5({ + readState: function () { + return 'No State required'; + } + }); + } }; var nu$5 = function (spec) { - return spec; + return spec; }; var generateFrom = function (spec, all) { - var schema = map(all, function (a) { - return optionObjOf(a.name(), [ - strict$1('config'), - defaulted$1('state', NoState) - ]); - }); - var validated = asRaw('component.behaviours', objOf(schema), spec.behaviours).fold(function (errInfo) { - throw new Error(formatError(errInfo) + '\nComplete spec:\n' + JSON.stringify(spec, null, 2)); - }, function (v) { - return v; - }); - return { - list: all, - data: map$2(validated, function (optBlobThunk) { - var output = optBlobThunk.map(function (blob) { - return { - config: blob.config, - state: blob.state.init(blob.config) - }; - }); - return function () { - return output; - }; - }) - }; + var schema = map(all, function (a) { + return optionObjOf(a.name(), [ + strict$1('config'), + defaulted$1('state', NoState) + ]); + }); + var validated = asRaw('component.behaviours', objOf(schema), spec.behaviours).fold(function (errInfo) { + throw new Error(formatError(errInfo) + '\nComplete spec:\n' + JSON.stringify(spec, null, 2)); + }, function (v) { + return v; + }); + return { + list: all, + data: map$2(validated, function (optBlobThunk) { + var output = optBlobThunk.map(function (blob) { + return { + config: blob.config, + state: blob.state.init(blob.config) + }; + }); + return function () { + return output; + }; + }) + }; }; var getBehaviours = function (bData) { - return bData.list; + return bData.list; }; var getData = function (bData) { - return bData.data; + return bData.data; }; var byInnerKey = function (data, tuple) { - var r = {}; - each$1(data, function (detail, key) { - each$1(detail, function (value, indexKey) { - var chain = get$1(r, indexKey).getOr([]); - r[indexKey] = chain.concat([tuple(key, value)]); - }); + var r = {}; + each$1(data, function (detail, key) { + each$1(detail, function (value, indexKey) { + var chain = get$1(r, indexKey).getOr([]); + r[indexKey] = chain.concat([tuple(key, value)]); }); - return r; + }); + return r; }; var nu$6 = function (s) { - return { - classes: s.classes !== undefined ? s.classes : [], - attributes: s.attributes !== undefined ? s.attributes : {}, - styles: s.styles !== undefined ? s.styles : {} - }; + return { + classes: s.classes !== undefined ? s.classes : [], + attributes: s.attributes !== undefined ? s.attributes : {}, + styles: s.styles !== undefined ? s.styles : {} + }; }; var merge$1 = function (defnA, mod) { - return __assign(__assign({}, defnA), { - attributes: __assign(__assign({}, defnA.attributes), mod.attributes), - styles: __assign(__assign({}, defnA.styles), mod.styles), - classes: defnA.classes.concat(mod.classes) - }); + return __assign(__assign({}, defnA), { + attributes: __assign(__assign({}, defnA.attributes), mod.attributes), + styles: __assign(__assign({}, defnA.styles), mod.styles), + classes: defnA.classes.concat(mod.classes) + }); }; var combine = function (info, baseMod, behaviours, base) { - var modsByBehaviour = __assign({}, baseMod); - each(behaviours, function (behaviour) { - modsByBehaviour[behaviour.name()] = behaviour.exhibit(info, base); - }); - var byAspect = byInnerKey(modsByBehaviour, function (name, modification) { - return { - name: name, - modification: modification - }; - }); - var combineObjects = function (objects) { - return foldr(objects, function (b, a) { - return __assign(__assign({}, a.modification), b); - }, {}); + var modsByBehaviour = __assign({}, baseMod); + each(behaviours, function (behaviour) { + modsByBehaviour[behaviour.name()] = behaviour.exhibit(info, base); + }); + var byAspect = byInnerKey(modsByBehaviour, function (name, modification) { + return { + name: name, + modification: modification }; - var combinedClasses = foldr(byAspect.classes, function (b, a) { - return a.modification.concat(b); - }, []); - var combinedAttributes = combineObjects(byAspect.attributes); - var combinedStyles = combineObjects(byAspect.styles); - return nu$6({ - classes: combinedClasses, - attributes: combinedAttributes, - styles: combinedStyles - }); + }); + var combineObjects = function (objects) { + return foldr(objects, function (b, a) { + return __assign(__assign({}, a.modification), b); + }, {}); + }; + var combinedClasses = foldr(byAspect.classes, function (b, a) { + return a.modification.concat(b); + }, []); + var combinedAttributes = combineObjects(byAspect.attributes); + var combinedStyles = combineObjects(byAspect.styles); + return nu$6({ + classes: combinedClasses, + attributes: combinedAttributes, + styles: combinedStyles + }); }; var sortKeys = function (label, keyName, array, order) { - try { - var sorted = sort(array, function (a, b) { - var aKey = a[keyName]; - var bKey = b[keyName]; - var aIndex = order.indexOf(aKey); - var bIndex = order.indexOf(bKey); - if (aIndex === -1) { - throw new Error('The ordering for ' + label + ' does not have an entry for ' + aKey + '.\nOrder specified: ' + JSON.stringify(order, null, 2)); - } - if (bIndex === -1) { - throw new Error('The ordering for ' + label + ' does not have an entry for ' + bKey + '.\nOrder specified: ' + JSON.stringify(order, null, 2)); - } - if (aIndex < bIndex) { - return -1; - } else if (bIndex < aIndex) { - return 1; - } else { - return 0; - } - }); - return Result.value(sorted); - } catch (err) { - return Result.error([err]); - } + try { + var sorted = sort(array, function (a, b) { + var aKey = a[keyName]; + var bKey = b[keyName]; + var aIndex = order.indexOf(aKey); + var bIndex = order.indexOf(bKey); + if (aIndex === -1) { + throw new Error('The ordering for ' + label + ' does not have an entry for ' + aKey + '.\nOrder specified: ' + JSON.stringify(order, null, 2)); + } + if (bIndex === -1) { + throw new Error('The ordering for ' + label + ' does not have an entry for ' + bKey + '.\nOrder specified: ' + JSON.stringify(order, null, 2)); + } + if (aIndex < bIndex) { + return -1; + } else if (bIndex < aIndex) { + return 1; + } else { + return 0; + } + }); + return Result.value(sorted); + } catch (err) { + return Result.error([err]); + } }; var uncurried = function (handler, purpose) { - return { - handler: handler, - purpose: purpose - }; + return { + handler: handler, + purpose: purpose + }; }; var curried = function (handler, purpose) { - return { - cHandler: handler, - purpose: purpose - }; + return { + cHandler: handler, + purpose: purpose + }; }; var curryArgs = function (descHandler, extraArgs) { - return curried(curry.apply(undefined, [descHandler.handler].concat(extraArgs)), descHandler.purpose); + return curried(curry.apply(undefined, [descHandler.handler].concat(extraArgs)), descHandler.purpose); }; var getCurried = function (descHandler) { - return descHandler.cHandler; + return descHandler.cHandler; }; var behaviourTuple = function (name, handler) { - return { - name: name, - handler: handler - }; + return { + name: name, + handler: handler + }; }; var nameToHandlers = function (behaviours, info) { - var r = {}; - each(behaviours, function (behaviour) { - r[behaviour.name()] = behaviour.handlers(info); - }); - return r; + var r = {}; + each(behaviours, function (behaviour) { + r[behaviour.name()] = behaviour.handlers(info); + }); + return r; }; var groupByEvents = function (info, behaviours, base) { - var behaviourEvents = __assign(__assign({}, base), nameToHandlers(behaviours, info)); - return byInnerKey(behaviourEvents, behaviourTuple); + var behaviourEvents = __assign(__assign({}, base), nameToHandlers(behaviours, info)); + return byInnerKey(behaviourEvents, behaviourTuple); }; var combine$1 = function (info, eventOrder, behaviours, base) { - var byEventName = groupByEvents(info, behaviours, base); - return combineGroups(byEventName, eventOrder); + var byEventName = groupByEvents(info, behaviours, base); + return combineGroups(byEventName, eventOrder); }; var assemble = function (rawHandler) { - var handler = read(rawHandler); - return function (component, simulatedEvent) { - var rest = []; - for (var _i = 2; _i < arguments.length; _i++) { - rest[_i - 2] = arguments[_i]; - } - var args = [ - component, - simulatedEvent - ].concat(rest); - if (handler.abort.apply(undefined, args)) { - simulatedEvent.stop(); - } else if (handler.can.apply(undefined, args)) { - handler.run.apply(undefined, args); - } - }; + var handler = read(rawHandler); + return function (component, simulatedEvent) { + var rest = []; + for (var _i = 2; _i < arguments.length; _i++) { + rest[_i - 2] = arguments[_i]; + } + var args = [ + component, + simulatedEvent + ].concat(rest); + if (handler.abort.apply(undefined, args)) { + simulatedEvent.stop(); + } else if (handler.can.apply(undefined, args)) { + handler.run.apply(undefined, args); + } + }; }; var missingOrderError = function (eventName, tuples) { - return Result.error(['The event (' + eventName + ') has more than one behaviour that listens to it.\nWhen this occurs, you must ' + 'specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that ' + 'can trigger it are: ' + JSON.stringify(map(tuples, function (c) { - return c.name; + return Result.error(['The event (' + eventName + ') has more than one behaviour that listens to it.\nWhen this occurs, you must ' + 'specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that ' + 'can trigger it are: ' + JSON.stringify(map(tuples, function (c) { + return c.name; }), null, 2)]); }; var fuse$1 = function (tuples, eventOrder, eventName) { - var order = eventOrder[eventName]; - if (!order) { - return missingOrderError(eventName, tuples); - } else { - return sortKeys('Event: ' + eventName, 'name', tuples, order).map(function (sortedTuples) { - var handlers = map(sortedTuples, function (tuple) { - return tuple.handler; - }); - return fuse(handlers); - }); - } + var order = eventOrder[eventName]; + if (!order) { + return missingOrderError(eventName, tuples); + } else { + return sortKeys('Event: ' + eventName, 'name', tuples, order).map(function (sortedTuples) { + var handlers = map(sortedTuples, function (tuple) { + return tuple.handler; + }); + return fuse(handlers); + }); + } }; var combineGroups = function (byEventName, eventOrder) { - var r = mapToArray(byEventName, function (tuples, eventName) { - var combined = tuples.length === 1 ? Result.value(tuples[0].handler) : fuse$1(tuples, eventOrder, eventName); - return combined.map(function (handler) { - var assembled = assemble(handler); - var purpose = tuples.length > 1 ? filter(eventOrder[eventName], function (o) { - return exists(tuples, function (t) { - return t.name === o; - }); - }).join(' > ') : tuples[0].name; - return wrap$1(eventName, uncurried(assembled, purpose)); + var r = mapToArray(byEventName, function (tuples, eventName) { + var combined = tuples.length === 1 ? Result.value(tuples[0].handler) : fuse$1(tuples, eventOrder, eventName); + return combined.map(function (handler) { + var assembled = assemble(handler); + var purpose = tuples.length > 1 ? filter(eventOrder[eventName], function (o) { + return exists(tuples, function (t) { + return t.name === o; }); + }).join(' > ') : tuples[0].name; + return wrap$1(eventName, uncurried(assembled, purpose)); }); - return consolidate(r, {}); + }); + return consolidate(r, {}); }; var baseBehaviour = 'alloy.base.behaviour'; var toInfo = function (spec) { - var _a; - return asRaw('custom.definition', objOf([ - field('dom', 'dom', strict(), objOf([ - strict$1('tag'), - defaulted$1('styles', {}), - defaulted$1('classes', []), - defaulted$1('attributes', {}), - option('value'), - option('innerHtml') - ])), - strict$1('components'), - strict$1('uid'), - defaulted$1('events', {}), - defaulted$1('apis', {}), - field('eventOrder', 'eventOrder', mergeWith((_a = {}, _a[execute()] = [ - 'disabling', - baseBehaviour, - 'toggling', - 'typeaheadevents' - ], _a[focus()] = [ - baseBehaviour, - 'focusing', - 'keying' - ], _a[systemInit()] = [ - baseBehaviour, - 'disabling', - 'toggling', - 'representing' - ], _a[input()] = [ - baseBehaviour, - 'representing', - 'streaming', - 'invalidating' - ], _a[detachedFromDom()] = [ - baseBehaviour, - 'representing', - 'item-events', - 'tooltipping' - ], _a[mousedown()] = [ - 'focusing', - baseBehaviour, - 'item-type-events' - ], _a[touchstart()] = [ - 'focusing', - baseBehaviour, - 'item-type-events' - ], _a[mouseover()] = [ - 'item-type-events', - 'tooltipping' - ], _a[receive()] = [ - 'receiving', - 'reflecting', - 'tooltipping' - ], _a)), anyValue$1()), - option('domModification') - ]), spec); + var _a; + return asRaw('custom.definition', objOf([ + field('dom', 'dom', strict(), objOf([ + strict$1('tag'), + defaulted$1('styles', {}), + defaulted$1('classes', []), + defaulted$1('attributes', {}), + option('value'), + option('innerHtml') + ])), + strict$1('components'), + strict$1('uid'), + defaulted$1('events', {}), + defaulted$1('apis', {}), + field('eventOrder', 'eventOrder', mergeWith((_a = {}, _a[execute()] = [ + 'disabling', + baseBehaviour, + 'toggling', + 'typeaheadevents' + ], _a[focus()] = [ + baseBehaviour, + 'focusing', + 'keying' + ], _a[systemInit()] = [ + baseBehaviour, + 'disabling', + 'toggling', + 'representing' + ], _a[input()] = [ + baseBehaviour, + 'representing', + 'streaming', + 'invalidating' + ], _a[detachedFromDom()] = [ + baseBehaviour, + 'representing', + 'item-events', + 'tooltipping' + ], _a[mousedown()] = [ + 'focusing', + baseBehaviour, + 'item-type-events' + ], _a[touchstart()] = [ + 'focusing', + baseBehaviour, + 'item-type-events' + ], _a[mouseover()] = [ + 'item-type-events', + 'tooltipping' + ], _a[receive()] = [ + 'receiving', + 'reflecting', + 'tooltipping' + ], _a)), anyValue$1()), + option('domModification') + ]), spec); }; var toDefinition = function (detail) { - return __assign(__assign({}, detail.dom), { - uid: detail.uid, - domChildren: map(detail.components, function (comp) { - return comp.element; - }) - }); + return __assign(__assign({}, detail.dom), { + uid: detail.uid, + domChildren: map(detail.components, function (comp) { + return comp.element; + }) + }); }; var toModification = function (detail) { - return detail.domModification.fold(function () { - return nu$6({}); - }, nu$6); + return detail.domModification.fold(function () { + return nu$6({}); + }, nu$6); }; var toEvents = function (info) { - return info.events; + return info.events; }; var read$2 = function (element, attr) { - var value = get$3(element, attr); - return value === undefined || value === '' ? [] : value.split(' '); + var value = get$3(element, attr); + return value === undefined || value === '' ? [] : value.split(' '); }; var add = function (element, attr, id) { - var old = read$2(element, attr); - var nu = old.concat([id]); - set$1(element, attr, nu.join(' ')); - return true; + var old = read$2(element, attr); + var nu = old.concat([id]); + set$1(element, attr, nu.join(' ')); + return true; }; var remove$2 = function (element, attr, id) { - var nu = filter(read$2(element, attr), function (v) { - return v !== id; - }); - if (nu.length > 0) { - set$1(element, attr, nu.join(' ')); - } else { - remove$1(element, attr); - } - return false; + var nu = filter(read$2(element, attr), function (v) { + return v !== id; + }); + if (nu.length > 0) { + set$1(element, attr, nu.join(' ')); + } else { + remove$1(element, attr); + } + return false; }; var supports = function (element) { - return element.dom.classList !== undefined; + return element.dom.classList !== undefined; }; var get$4 = function (element) { - return read$2(element, 'class'); + return read$2(element, 'class'); }; var add$1 = function (element, clazz) { - return add(element, 'class', clazz); + return add(element, 'class', clazz); }; var remove$3 = function (element, clazz) { - return remove$2(element, 'class', clazz); + return remove$2(element, 'class', clazz); }; var add$2 = function (element, clazz) { - if (supports(element)) { - element.dom.classList.add(clazz); - } else { - add$1(element, clazz); - } + if (supports(element)) { + element.dom.classList.add(clazz); + } else { + add$1(element, clazz); + } }; var cleanClass = function (element) { - var classList = supports(element) ? element.dom.classList : get$4(element); - if (classList.length === 0) { - remove$1(element, 'class'); - } + var classList = supports(element) ? element.dom.classList : get$4(element); + if (classList.length === 0) { + remove$1(element, 'class'); + } }; var remove$4 = function (element, clazz) { - if (supports(element)) { - var classList = element.dom.classList; - classList.remove(clazz); - } else { - remove$3(element, clazz); - } - cleanClass(element); + if (supports(element)) { + var classList = element.dom.classList; + classList.remove(clazz); + } else { + remove$3(element, clazz); + } + cleanClass(element); }; var has$2 = function (element, clazz) { - return supports(element) && element.dom.classList.contains(clazz); + return supports(element) && element.dom.classList.contains(clazz); }; var add$3 = function (element, classes) { - each(classes, function (x) { - add$2(element, x); - }); + each(classes, function (x) { + add$2(element, x); + }); }; var remove$5 = function (element, classes) { - each(classes, function (x) { - remove$4(element, x); - }); + each(classes, function (x) { + remove$4(element, x); + }); }; var isSupported = function (dom) { - return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); }; var isShadowRoot = function (dos) { - return isDocumentFragment(dos); + return isDocumentFragment(dos); }; var supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode); var isSupported$1 = constant(supported); var getRootNode = supported ? function (e) { - return SugarElement.fromDom(e.dom.getRootNode()); + return SugarElement.fromDom(e.dom.getRootNode()); } : documentOrOwner; var getContentContainer = function (dos) { - return isShadowRoot(dos) ? dos : SugarElement.fromDom(documentOrOwner(dos).dom.body); + return isShadowRoot(dos) ? dos : SugarElement.fromDom(documentOrOwner(dos).dom.body); }; var isInShadowRoot = function (e) { - return getShadowRoot(e).isSome(); + return getShadowRoot(e).isSome(); }; var getShadowRoot = function (e) { - var r = getRootNode(e); - return isShadowRoot(r) ? Optional.some(r) : Optional.none(); + var r = getRootNode(e); + return isShadowRoot(r) ? Optional.some(r) : Optional.none(); }; var getShadowHost = function (e) { - return SugarElement.fromDom(e.dom.host); + return SugarElement.fromDom(e.dom.host); }; var getOriginalEventTarget = function (event) { - if (isSupported$1() && isNonNullable(event.target)) { - var el = SugarElement.fromDom(event.target); - if (isElement(el) && isOpenShadowHost(el)) { - if (event.composed && event.composedPath) { - var composedPath = event.composedPath(); - if (composedPath) { - return head(composedPath); - } - } + if (isSupported$1() && isNonNullable(event.target)) { + var el = SugarElement.fromDom(event.target); + if (isElement(el) && isOpenShadowHost(el)) { + if (event.composed && event.composedPath) { + var composedPath = event.composedPath(); + if (composedPath) { + return head(composedPath); } + } } - return Optional.from(event.target); + } + return Optional.from(event.target); }; var isOpenShadowHost = function (element) { - return isNonNullable(element.dom.shadowRoot); + return isNonNullable(element.dom.shadowRoot); }; var inBody = function (element) { - var dom = isText(element) ? element.dom.parentNode : element.dom; - if (dom === undefined || dom === null || dom.ownerDocument === null) { - return false; - } - var doc = dom.ownerDocument; - return getShadowRoot(SugarElement.fromDom(dom)).fold(function () { - return doc.body.contains(dom); - }, compose1(inBody, getShadowHost)); + var dom = isText(element) ? element.dom.parentNode : element.dom; + if (dom === undefined || dom === null || dom.ownerDocument === null) { + return false; + } + var doc = dom.ownerDocument; + return getShadowRoot(SugarElement.fromDom(dom)).fold(function () { + return doc.body.contains(dom); + }, compose1(inBody, getShadowHost)); }; var body = function () { - return getBody(SugarElement.fromDom(document)); + return getBody(SugarElement.fromDom(document)); }; var getBody = function (doc) { - var b = doc.dom.body; - if (b === null || b === undefined) { - throw new Error('Body is not available yet'); - } - return SugarElement.fromDom(b); + var b = doc.dom.body; + if (b === null || b === undefined) { + throw new Error('Body is not available yet'); + } + return SugarElement.fromDom(b); }; var internalSet = function (dom, property, value) { - if (!isString(value)) { - console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom); - throw new Error('CSS value must be a string: ' + value); - } - if (isSupported(dom)) { - dom.style.setProperty(property, value); - } + if (!isString(value)) { + console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom); + throw new Error('CSS value must be a string: ' + value); + } + if (isSupported(dom)) { + dom.style.setProperty(property, value); + } }; var internalRemove = function (dom, property) { - if (isSupported(dom)) { - dom.style.removeProperty(property); - } + if (isSupported(dom)) { + dom.style.removeProperty(property); + } }; var set$2 = function (element, property, value) { - var dom = element.dom; - internalSet(dom, property, value); + var dom = element.dom; + internalSet(dom, property, value); }; var setAll$1 = function (element, css) { - var dom = element.dom; - each$1(css, function (v, k) { - internalSet(dom, k, v); - }); + var dom = element.dom; + each$1(css, function (v, k) { + internalSet(dom, k, v); + }); }; var setOptions = function (element, css) { - var dom = element.dom; - each$1(css, function (v, k) { - v.fold(function () { - internalRemove(dom, k); - }, function (value) { - internalSet(dom, k, value); - }); + var dom = element.dom; + each$1(css, function (v, k) { + v.fold(function () { + internalRemove(dom, k); + }, function (value) { + internalSet(dom, k, value); }); + }); }; var get$5 = function (element, property) { - var dom = element.dom; - var styles = window.getComputedStyle(dom); - var r = styles.getPropertyValue(property); - return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; + var dom = element.dom; + var styles = window.getComputedStyle(dom); + var r = styles.getPropertyValue(property); + return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; }; var getUnsafeProperty = function (dom, property) { - return isSupported(dom) ? dom.style.getPropertyValue(property) : ''; + return isSupported(dom) ? dom.style.getPropertyValue(property) : ''; }; var getRaw = function (element, property) { - var dom = element.dom; - var raw = getUnsafeProperty(dom, property); - return Optional.from(raw).filter(function (r) { - return r.length > 0; - }); + var dom = element.dom; + var raw = getUnsafeProperty(dom, property); + return Optional.from(raw).filter(function (r) { + return r.length > 0; + }); }; var getAllRaw = function (element) { - var css = {}; - var dom = element.dom; - if (isSupported(dom)) { - for (var i = 0; i < dom.style.length; i++) { - var ruleName = dom.style.item(i); - css[ruleName] = dom.style[ruleName]; - } + var css = {}; + var dom = element.dom; + if (isSupported(dom)) { + for (var i = 0; i < dom.style.length; i++) { + var ruleName = dom.style.item(i); + css[ruleName] = dom.style[ruleName]; } - return css; + } + return css; }; var isValidValue = function (tag, property, value) { - var element = SugarElement.fromTag(tag); - set$2(element, property, value); - var style = getRaw(element, property); - return style.isSome(); + var element = SugarElement.fromTag(tag); + set$2(element, property, value); + var style = getRaw(element, property); + return style.isSome(); }; var remove$6 = function (element, property) { - var dom = element.dom; - internalRemove(dom, property); - if (getOpt(element, 'style').map(trim).is('')) { - remove$1(element, 'style'); - } + var dom = element.dom; + internalRemove(dom, property); + if (getOpt(element, 'style').map(trim).is('')) { + remove$1(element, 'style'); + } }; var reflow = function (e) { - return e.dom.offsetWidth; + return e.dom.offsetWidth; }; var get$6 = function (element) { - return element.dom.value; + return element.dom.value; }; var set$3 = function (element, value) { - if (value === undefined) { - throw new Error('Value.set was undefined'); - } - element.dom.value = value; + if (value === undefined) { + throw new Error('Value.set was undefined'); + } + element.dom.value = value; }; var renderToDom = function (definition) { - var subject = SugarElement.fromTag(definition.tag); - setAll(subject, definition.attributes); - add$3(subject, definition.classes); - setAll$1(subject, definition.styles); - definition.innerHtml.each(function (html) { - return set(subject, html); - }); - var children = definition.domChildren; - append$1(subject, children); - definition.value.each(function (value) { - set$3(subject, value); - }); - if (!definition.uid) { - debugger; - } - writeOnly(subject, definition.uid); - return subject; + var subject = SugarElement.fromTag(definition.tag); + setAll(subject, definition.attributes); + add$3(subject, definition.classes); + setAll$1(subject, definition.styles); + definition.innerHtml.each(function (html) { + return set(subject, html); + }); + var children = definition.domChildren; + append$1(subject, children); + definition.value.each(function (value) { + set$3(subject, value); + }); + if (!definition.uid) { + debugger; + } + writeOnly(subject, definition.uid); + return subject; }; var getBehaviours$1 = function (spec) { - var behaviours = get$1(spec, 'behaviours').getOr({}); - var keys$1 = filter(keys(behaviours), function (k) { - return behaviours[k] !== undefined; - }); - return map(keys$1, function (k) { - return behaviours[k].me; - }); + var behaviours = get$1(spec, 'behaviours').getOr({}); + var keys$1 = filter(keys(behaviours), function (k) { + return behaviours[k] !== undefined; + }); + return map(keys$1, function (k) { + return behaviours[k].me; + }); }; var generateFrom$1 = function (spec, all) { - return generateFrom(spec, all); + return generateFrom(spec, all); }; var generate$3 = function (spec) { - var all = getBehaviours$1(spec); - return generateFrom$1(spec, all); + var all = getBehaviours$1(spec); + return generateFrom$1(spec, all); }; var getDomDefinition = function (info, bList, bData) { - var definition = toDefinition(info); - var infoModification = toModification(info); - var baseModification = {'alloy.base.modification': infoModification}; - var modification = bList.length > 0 ? combine(bData, baseModification, bList, definition) : infoModification; - return merge$1(definition, modification); + var definition = toDefinition(info); + var infoModification = toModification(info); + var baseModification = { 'alloy.base.modification': infoModification }; + var modification = bList.length > 0 ? combine(bData, baseModification, bList, definition) : infoModification; + return merge$1(definition, modification); }; var getEvents = function (info, bList, bData) { - var baseEvents = {'alloy.base.behaviour': toEvents(info)}; - return combine$1(bData, info.eventOrder, bList, baseEvents).getOrDie(); + var baseEvents = { 'alloy.base.behaviour': toEvents(info) }; + return combine$1(bData, info.eventOrder, bList, baseEvents).getOrDie(); }; var build = function (spec) { - var getMe = function () { - return me; - }; - var systemApi = Cell(singleton); - var info = getOrDie(toInfo(spec)); - var bBlob = generate$3(spec); - var bList = getBehaviours(bBlob); - var bData = getData(bBlob); - var modDefinition = getDomDefinition(info, bList, bData); - var item = renderToDom(modDefinition); - var events = getEvents(info, bList, bData); - var subcomponents = Cell(info.components); - var connect = function (newApi) { - systemApi.set(newApi); - }; - var disconnect = function () { - systemApi.set(NoContextApi(getMe)); - }; - var syncComponents = function () { - var children$1 = children(item); - var subs = bind(children$1, function (child) { - return systemApi.get().getByDom(child).fold(function () { - return []; - }, function (c) { - return [c]; - }); - }); - subcomponents.set(subs); - }; - var config = function (behaviour) { - var b = bData; - var f = isFunction(b[behaviour.name()]) ? b[behaviour.name()] : function () { - throw new Error('Could not find ' + behaviour.name() + ' in ' + JSON.stringify(spec, null, 2)); - }; - return f(); - }; - var hasConfigured = function (behaviour) { - return isFunction(bData[behaviour.name()]); - }; - var getApis = function () { - return info.apis; - }; - var readState = function (behaviourName) { - return bData[behaviourName]().map(function (b) { - return b.state.readState(); - }).getOr('not enabled'); - }; - var me = { - getSystem: systemApi.get, - config: config, - hasConfigured: hasConfigured, - spec: spec, - readState: readState, - getApis: getApis, - connect: connect, - disconnect: disconnect, - element: item, - syncComponents: syncComponents, - components: subcomponents.get, - events: events - }; + var getMe = function () { return me; + }; + var systemApi = Cell(singleton); + var info = getOrDie(toInfo(spec)); + var bBlob = generate$3(spec); + var bList = getBehaviours(bBlob); + var bData = getData(bBlob); + var modDefinition = getDomDefinition(info, bList, bData); + var item = renderToDom(modDefinition); + var events = getEvents(info, bList, bData); + var subcomponents = Cell(info.components); + var connect = function (newApi) { + systemApi.set(newApi); + }; + var disconnect = function () { + systemApi.set(NoContextApi(getMe)); + }; + var syncComponents = function () { + var children$1 = children(item); + var subs = bind(children$1, function (child) { + return systemApi.get().getByDom(child).fold(function () { + return []; + }, function (c) { + return [c]; + }); + }); + subcomponents.set(subs); + }; + var config = function (behaviour) { + var b = bData; + var f = isFunction(b[behaviour.name()]) ? b[behaviour.name()] : function () { + throw new Error('Could not find ' + behaviour.name() + ' in ' + JSON.stringify(spec, null, 2)); + }; + return f(); + }; + var hasConfigured = function (behaviour) { + return isFunction(bData[behaviour.name()]); + }; + var getApis = function () { + return info.apis; + }; + var readState = function (behaviourName) { + return bData[behaviourName]().map(function (b) { + return b.state.readState(); + }).getOr('not enabled'); + }; + var me = { + getSystem: systemApi.get, + config: config, + hasConfigured: hasConfigured, + spec: spec, + readState: readState, + getApis: getApis, + connect: connect, + disconnect: disconnect, + element: item, + syncComponents: syncComponents, + components: subcomponents.get, + events: events + }; + return me; }; var buildSubcomponents = function (spec) { - var components = get$1(spec, 'components').getOr([]); - return map(components, build$1); + var components = get$1(spec, 'components').getOr([]); + return map(components, build$1); }; var buildFromSpec = function (userSpec) { - var _a = make(userSpec), specEvents = _a.events, spec = __rest(_a, ['events']); - var components = buildSubcomponents(spec); - var completeSpec = __assign(__assign({}, spec), { - events: __assign(__assign({}, DefaultEvents), specEvents), - components: components - }); - return Result.value(build(completeSpec)); + var _a = make(userSpec), specEvents = _a.events, spec = __rest(_a, ['events']); + var components = buildSubcomponents(spec); + var completeSpec = __assign(__assign({}, spec), { + events: __assign(__assign({}, DefaultEvents), specEvents), + components: components + }); + return Result.value(build(completeSpec)); }; var text = function (textContent) { - var element = SugarElement.fromText(textContent); - return external({element: element}); + var element = SugarElement.fromText(textContent); + return external({ element: element }); }; var external = function (spec) { - var extSpec = asRawOrDie('external.component', objOfOnly([ - strict$1('element'), - option('uid') - ]), spec); - var systemApi = Cell(NoContextApi()); - var connect = function (newApi) { - systemApi.set(newApi); - }; - var disconnect = function () { - systemApi.set(NoContextApi(function () { - return me; - })); - }; - extSpec.uid.each(function (uid) { - writeOnly(extSpec.element, uid); - }); - var me = { - getSystem: systemApi.get, - config: Optional.none, - hasConfigured: never, - connect: connect, - disconnect: disconnect, - getApis: function () { - return {}; - }, - element: extSpec.element, - spec: spec, - readState: constant('No state'), - syncComponents: noop, - components: constant([]), - events: {} - }; - return premade(me); + var extSpec = asRawOrDie('external.component', objOfOnly([ + strict$1('element'), + option('uid') + ]), spec); + var systemApi = Cell(NoContextApi()); + var connect = function (newApi) { + systemApi.set(newApi); + }; + var disconnect = function () { + systemApi.set(NoContextApi(function () { + return me; + })); + }; + extSpec.uid.each(function (uid) { + writeOnly(extSpec.element, uid); + }); + var me = { + getSystem: systemApi.get, + config: Optional.none, + hasConfigured: never, + connect: connect, + disconnect: disconnect, + getApis: function () { + return {}; + }, + element: extSpec.element, + spec: spec, + readState: constant('No state'), + syncComponents: noop, + components: constant([]), + events: {} + }; + return premade(me); }; var uids = generate$2; var build$1 = function (spec) { - return getPremade(spec).fold(function () { - var userSpecWithUid = spec.hasOwnProperty('uid') ? spec : __assign({uid: uids('')}, spec); - return buildFromSpec(userSpecWithUid).getOrDie(); - }, function (prebuilt) { - return prebuilt; - }); + return getPremade(spec).fold(function () { + var userSpecWithUid = spec.hasOwnProperty('uid') ? spec : __assign({ uid: uids('') }, spec); + return buildFromSpec(userSpecWithUid).getOrDie(); + }, function (prebuilt) { + return prebuilt; + }); }; var premade$1 = premade; - function Dimension(name, getOffset) { - var set = function (element, h) { - if (!isNumber(h) && !h.match(/^[0-9]+$/)) { - throw new Error(name + '.set accepts only positive integer values. Value was ' + h); - } - var dom = element.dom; - if (isSupported(dom)) { - dom.style[name] = h + 'px'; - } - }; - var get = function (element) { - var r = getOffset(element); - if (r <= 0 || r === null) { - var css = get$5(element, name); - return parseFloat(css) || 0; - } - return r; - }; - var getOuter = get; - var aggregate = function (element, properties) { - return foldl(properties, function (acc, property) { - var val = get$5(element, property); - var value = val === undefined ? 0 : parseInt(val, 10); - return isNaN(value) ? acc : acc + value; - }, 0); - }; - var max = function (element, value, properties) { - var cumulativeInclusions = aggregate(element, properties); - var absoluteMax = value > cumulativeInclusions ? value - cumulativeInclusions : 0; - return absoluteMax; - }; - return { - set: set, - get: get, - getOuter: getOuter, - aggregate: aggregate, - max: max - }; + function Dimension (name, getOffset) { + var set = function (element, h) { + if (!isNumber(h) && !h.match(/^[0-9]+$/)) { + throw new Error(name + '.set accepts only positive integer values. Value was ' + h); + } + var dom = element.dom; + if (isSupported(dom)) { + dom.style[name] = h + 'px'; + } + }; + var get = function (element) { + var r = getOffset(element); + if (r <= 0 || r === null) { + var css = get$5(element, name); + return parseFloat(css) || 0; + } + return r; + }; + var getOuter = get; + var aggregate = function (element, properties) { + return foldl(properties, function (acc, property) { + var val = get$5(element, property); + var value = val === undefined ? 0 : parseInt(val, 10); + return isNaN(value) ? acc : acc + value; + }, 0); + }; + var max = function (element, value, properties) { + var cumulativeInclusions = aggregate(element, properties); + var absoluteMax = value > cumulativeInclusions ? value - cumulativeInclusions : 0; + return absoluteMax; + }; + return { + set: set, + get: get, + getOuter: getOuter, + aggregate: aggregate, + max: max + }; } var api = Dimension('height', function (element) { - var dom = element.dom; - return inBody(element) ? dom.getBoundingClientRect().height : dom.offsetHeight; + var dom = element.dom; + return inBody(element) ? dom.getBoundingClientRect().height : dom.offsetHeight; }); var get$7 = function (element) { - return api.get(element); + return api.get(element); }; var getOuter$1 = function (element) { - return api.getOuter(element); + return api.getOuter(element); }; var setMax = function (element, value) { - var inclusions = [ - 'margin-top', - 'border-top-width', - 'padding-top', - 'padding-bottom', - 'border-bottom-width', - 'margin-bottom' - ]; - var absMax = api.max(element, value, inclusions); - set$2(element, 'max-height', absMax + 'px'); + var inclusions = [ + 'margin-top', + 'border-top-width', + 'padding-top', + 'padding-bottom', + 'border-bottom-width', + 'margin-bottom' + ]; + var absMax = api.max(element, value, inclusions); + set$2(element, 'max-height', absMax + 'px'); }; var r = function (left, top) { - var translate = function (x, y) { - return r(left + x, top + y); - }; - return { - left: left, - top: top, - translate: translate - }; + var translate = function (x, y) { + return r(left + x, top + y); + }; + return { + left: left, + top: top, + translate: translate + }; }; var SugarPosition = r; var boxPosition = function (dom) { - var box = dom.getBoundingClientRect(); - return SugarPosition(box.left, box.top); + var box = dom.getBoundingClientRect(); + return SugarPosition(box.left, box.top); }; var firstDefinedOrZero = function (a, b) { - if (a !== undefined) { - return a; - } else { - return b !== undefined ? b : 0; - } + if (a !== undefined) { + return a; + } else { + return b !== undefined ? b : 0; + } }; var absolute = function (element) { - var doc = element.dom.ownerDocument; - var body = doc.body; - var win = doc.defaultView; - var html = doc.documentElement; - if (body === element.dom) { - return SugarPosition(body.offsetLeft, body.offsetTop); - } - var scrollTop = firstDefinedOrZero(win === null || win === void 0 ? void 0 : win.pageYOffset, html.scrollTop); - var scrollLeft = firstDefinedOrZero(win === null || win === void 0 ? void 0 : win.pageXOffset, html.scrollLeft); - var clientTop = firstDefinedOrZero(html.clientTop, body.clientTop); - var clientLeft = firstDefinedOrZero(html.clientLeft, body.clientLeft); - return viewport(element).translate(scrollLeft - clientLeft, scrollTop - clientTop); + var doc = element.dom.ownerDocument; + var body = doc.body; + var win = doc.defaultView; + var html = doc.documentElement; + if (body === element.dom) { + return SugarPosition(body.offsetLeft, body.offsetTop); + } + var scrollTop = firstDefinedOrZero(win === null || win === void 0 ? void 0 : win.pageYOffset, html.scrollTop); + var scrollLeft = firstDefinedOrZero(win === null || win === void 0 ? void 0 : win.pageXOffset, html.scrollLeft); + var clientTop = firstDefinedOrZero(html.clientTop, body.clientTop); + var clientLeft = firstDefinedOrZero(html.clientLeft, body.clientLeft); + return viewport(element).translate(scrollLeft - clientLeft, scrollTop - clientTop); }; var viewport = function (element) { - var dom = element.dom; - var doc = dom.ownerDocument; - var body = doc.body; - if (body === dom) { - return SugarPosition(body.offsetLeft, body.offsetTop); - } - if (!inBody(element)) { - return SugarPosition(0, 0); - } - return boxPosition(dom); + var dom = element.dom; + var doc = dom.ownerDocument; + var body = doc.body; + if (body === dom) { + return SugarPosition(body.offsetLeft, body.offsetTop); + } + if (!inBody(element)) { + return SugarPosition(0, 0); + } + return boxPosition(dom); }; var api$1 = Dimension('width', function (element) { - return element.dom.offsetWidth; + return element.dom.offsetWidth; }); var set$4 = function (element, h) { - return api$1.set(element, h); + return api$1.set(element, h); }; var get$8 = function (element) { - return api$1.get(element); + return api$1.get(element); }; var getOuter$2 = function (element) { - return api$1.getOuter(element); + return api$1.getOuter(element); }; var setMax$1 = function (element, value) { - var inclusions = [ - 'margin-left', - 'border-left-width', - 'padding-left', - 'padding-right', - 'border-right-width', - 'margin-right' - ]; - var absMax = api$1.max(element, value, inclusions); - set$2(element, 'max-width', absMax + 'px'); + var inclusions = [ + 'margin-left', + 'border-left-width', + 'padding-left', + 'padding-right', + 'border-right-width', + 'margin-right' + ]; + var absMax = api$1.max(element, value, inclusions); + set$2(element, 'max-width', absMax + 'px'); }; var mkEvent = function (target, x, y, stop, prevent, kill, raw) { - return { - target: target, - x: x, - y: y, - stop: stop, - prevent: prevent, - kill: kill, - raw: raw - }; + return { + target: target, + x: x, + y: y, + stop: stop, + prevent: prevent, + kill: kill, + raw: raw + }; }; var fromRawEvent = function (rawEvent) { - var target = SugarElement.fromDom(getOriginalEventTarget(rawEvent).getOr(rawEvent.target)); - var stop = function () { - return rawEvent.stopPropagation(); - }; - var prevent = function () { - return rawEvent.preventDefault(); - }; - var kill = compose(prevent, stop); - return mkEvent(target, rawEvent.clientX, rawEvent.clientY, stop, prevent, kill, rawEvent); + var target = SugarElement.fromDom(getOriginalEventTarget(rawEvent).getOr(rawEvent.target)); + var stop = function () { + return rawEvent.stopPropagation(); + }; + var prevent = function () { + return rawEvent.preventDefault(); + }; + var kill = compose(prevent, stop); + return mkEvent(target, rawEvent.clientX, rawEvent.clientY, stop, prevent, kill, rawEvent); }; var handle = function (filter, handler) { - return function (rawEvent) { - if (filter(rawEvent)) { - handler(fromRawEvent(rawEvent)); - } - }; + return function (rawEvent) { + if (filter(rawEvent)) { + handler(fromRawEvent(rawEvent)); + } + }; }; var binder = function (element, event, filter, handler, useCapture) { - var wrapped = handle(filter, handler); - element.dom.addEventListener(event, wrapped, useCapture); - return {unbind: curry(unbind, element, event, wrapped, useCapture)}; + var wrapped = handle(filter, handler); + element.dom.addEventListener(event, wrapped, useCapture); + return { unbind: curry(unbind, element, event, wrapped, useCapture) }; }; var bind$2 = function (element, event, filter, handler) { - return binder(element, event, filter, handler, false); + return binder(element, event, filter, handler, false); }; var capture = function (element, event, filter, handler) { - return binder(element, event, filter, handler, true); + return binder(element, event, filter, handler, true); }; var unbind = function (element, event, handler, useCapture) { - element.dom.removeEventListener(event, handler, useCapture); + element.dom.removeEventListener(event, handler, useCapture); }; var get$9 = function (_DOC) { - var doc = _DOC !== undefined ? _DOC.dom : document; - var x = doc.body.scrollLeft || doc.documentElement.scrollLeft; - var y = doc.body.scrollTop || doc.documentElement.scrollTop; - return SugarPosition(x, y); + var doc = _DOC !== undefined ? _DOC.dom : document; + var x = doc.body.scrollLeft || doc.documentElement.scrollLeft; + var y = doc.body.scrollTop || doc.documentElement.scrollTop; + return SugarPosition(x, y); }; var to = function (x, y, _DOC) { - var doc = _DOC !== undefined ? _DOC.dom : document; - var win = doc.defaultView; - if (win) { - win.scrollTo(x, y); - } + var doc = _DOC !== undefined ? _DOC.dom : document; + var win = doc.defaultView; + if (win) { + win.scrollTo(x, y); + } }; var get$a = function (_win) { - var win = _win === undefined ? window : _win; - return Optional.from(win['visualViewport']); + var win = _win === undefined ? window : _win; + return Optional.from(win['visualViewport']); }; var bounds = function (x, y, width, height) { - return { - x: x, - y: y, - width: width, - height: height, - right: x + width, - bottom: y + height - }; + return { + x: x, + y: y, + width: width, + height: height, + right: x + width, + bottom: y + height + }; }; var getBounds = function (_win) { - var win = _win === undefined ? window : _win; - var doc = win.document; - var scroll = get$9(SugarElement.fromDom(doc)); - return get$a(win).fold(function () { - var html = win.document.documentElement; - var width = html.clientWidth; - var height = html.clientHeight; - return bounds(scroll.left, scroll.top, width, height); - }, function (visualViewport) { - return bounds(Math.max(visualViewport.pageLeft, scroll.left), Math.max(visualViewport.pageTop, scroll.top), visualViewport.width, visualViewport.height); - }); + var win = _win === undefined ? window : _win; + var doc = win.document; + var scroll = get$9(SugarElement.fromDom(doc)); + return get$a(win).fold(function () { + var html = win.document.documentElement; + var width = html.clientWidth; + var height = html.clientHeight; + return bounds(scroll.left, scroll.top, width, height); + }, function (visualViewport) { + return bounds(Math.max(visualViewport.pageLeft, scroll.left), Math.max(visualViewport.pageTop, scroll.top), visualViewport.width, visualViewport.height); + }); }; var walkUp = function (navigation, doc) { - var frame = navigation.view(doc); - return frame.fold(constant([]), function (f) { - var parent = navigation.owner(f); - var rest = walkUp(navigation, parent); - return [f].concat(rest); - }); + var frame = navigation.view(doc); + return frame.fold(constant([]), function (f) { + var parent = navigation.owner(f); + var rest = walkUp(navigation, parent); + return [f].concat(rest); + }); }; var pathTo = function (element, navigation) { - var d = navigation.owner(element); - var paths = walkUp(navigation, d); - return Optional.some(paths); + var d = navigation.owner(element); + var paths = walkUp(navigation, d); + return Optional.some(paths); }; var view = function (doc) { - var _a; - var element = doc.dom === document ? Optional.none() : Optional.from((_a = doc.dom.defaultView) === null || _a === void 0 ? void 0 : _a.frameElement); - return element.map(SugarElement.fromDom); + var _a; + var element = doc.dom === document ? Optional.none() : Optional.from((_a = doc.dom.defaultView) === null || _a === void 0 ? void 0 : _a.frameElement); + return element.map(SugarElement.fromDom); }; var owner$1 = function (element) { - return owner(element); + return owner(element); }; var Navigation = /*#__PURE__*/Object.freeze({ @@ -3467,382 +3463,382 @@ }); var find$3 = function (element) { - var doc = SugarElement.fromDom(document); - var scroll = get$9(doc); - var path = pathTo(element, Navigation); - return path.fold(curry(absolute, element), function (frames) { - var offset = viewport(element); - var r = foldr(frames, function (b, a) { - var loc = viewport(a); - return { - left: b.left + loc.left, - top: b.top + loc.top - }; - }, { - left: 0, - top: 0 - }); - return SugarPosition(r.left + offset.left + scroll.left, r.top + offset.top + scroll.top); + var doc = SugarElement.fromDom(document); + var scroll = get$9(doc); + var path = pathTo(element, Navigation); + return path.fold(curry(absolute, element), function (frames) { + var offset = viewport(element); + var r = foldr(frames, function (b, a) { + var loc = viewport(a); + return { + left: b.left + loc.left, + top: b.top + loc.top + }; + }, { + left: 0, + top: 0 }); + return SugarPosition(r.left + offset.left + scroll.left, r.top + offset.top + scroll.top); + }); }; var pointed = function (point, width, height) { - return { - point: point, - width: width, - height: height - }; + return { + point: point, + width: width, + height: height + }; }; var rect = function (x, y, width, height) { - return { - x: x, - y: y, - width: width, - height: height - }; + return { + x: x, + y: y, + width: width, + height: height + }; }; var bounds$1 = function (x, y, width, height) { - return { - x: x, - y: y, - width: width, - height: height, - right: x + width, - bottom: y + height - }; + return { + x: x, + y: y, + width: width, + height: height, + right: x + width, + bottom: y + height + }; }; var box = function (element) { - var xy = absolute(element); - var w = getOuter$2(element); - var h = getOuter$1(element); - return bounds$1(xy.left, xy.top, w, h); + var xy = absolute(element); + var w = getOuter$2(element); + var h = getOuter$1(element); + return bounds$1(xy.left, xy.top, w, h); }; var absolute$1 = function (element) { - var position = find$3(element); - var width = getOuter$2(element); - var height = getOuter$1(element); - return bounds$1(position.left, position.top, width, height); + var position = find$3(element); + var width = getOuter$2(element); + var height = getOuter$1(element); + return bounds$1(position.left, position.top, width, height); }; var win = function () { - return getBounds(window); + return getBounds(window); }; - function ClosestOrAncestor(is, ancestor, scope, a, isRoot) { - if (is(scope, a)) { - return Optional.some(scope); - } else if (isFunction(isRoot) && isRoot(scope)) { - return Optional.none(); - } else { - return ancestor(scope, a, isRoot); - } + function ClosestOrAncestor (is, ancestor, scope, a, isRoot) { + if (is(scope, a)) { + return Optional.some(scope); + } else if (isFunction(isRoot) && isRoot(scope)) { + return Optional.none(); + } else { + return ancestor(scope, a, isRoot); + } } var ancestor$1 = function (scope, predicate, isRoot) { - var element = scope.dom; - var stop = isFunction(isRoot) ? isRoot : never; - while (element.parentNode) { - element = element.parentNode; - var el = SugarElement.fromDom(element); - if (predicate(el)) { - return Optional.some(el); - } else if (stop(el)) { - break; - } - } - return Optional.none(); + var element = scope.dom; + var stop = isFunction(isRoot) ? isRoot : never; + while (element.parentNode) { + element = element.parentNode; + var el = SugarElement.fromDom(element); + if (predicate(el)) { + return Optional.some(el); + } else if (stop(el)) { + break; + } + } + return Optional.none(); }; var closest$1 = function (scope, predicate, isRoot) { - var is = function (s, test) { - return test(s); - }; - return ClosestOrAncestor(is, ancestor$1, scope, predicate, isRoot); + var is = function (s, test) { + return test(s); + }; + return ClosestOrAncestor(is, ancestor$1, scope, predicate, isRoot); }; var descendant = function (scope, predicate) { - var descend = function (node) { - for (var i = 0; i < node.childNodes.length; i++) { - var child_1 = SugarElement.fromDom(node.childNodes[i]); - if (predicate(child_1)) { - return Optional.some(child_1); - } - var res = descend(node.childNodes[i]); - if (res.isSome()) { - return res; - } - } - return Optional.none(); - }; - return descend(scope.dom); + var descend = function (node) { + for (var i = 0; i < node.childNodes.length; i++) { + var child_1 = SugarElement.fromDom(node.childNodes[i]); + if (predicate(child_1)) { + return Optional.some(child_1); + } + var res = descend(node.childNodes[i]); + if (res.isSome()) { + return res; + } + } + return Optional.none(); + }; + return descend(scope.dom); }; var closest$2 = function (scope, predicate, isRoot) { - return closest$1(scope, predicate, isRoot).isSome(); + return closest$1(scope, predicate, isRoot).isSome(); }; var ancestor$2 = function (scope, selector, isRoot) { - return ancestor$1(scope, function (e) { - return is(e, selector); - }, isRoot); + return ancestor$1(scope, function (e) { + return is(e, selector); + }, isRoot); }; var descendant$1 = function (scope, selector) { - return one(selector, scope); + return one(selector, scope); }; var closest$3 = function (scope, selector, isRoot) { - var is$1 = function (element, selector) { - return is(element, selector); - }; - return ClosestOrAncestor(is$1, ancestor$2, scope, selector, isRoot); + var is$1 = function (element, selector) { + return is(element, selector); + }; + return ClosestOrAncestor(is$1, ancestor$2, scope, selector, isRoot); }; var find$4 = function (queryElem) { - var dependent = closest$1(queryElem, function (elem) { - if (!isElement(elem)) { - return false; - } - var id = get$3(elem, 'id'); - return id !== undefined && id.indexOf('aria-owns') > -1; - }); - return dependent.bind(function (dep) { - var id = get$3(dep, 'id'); - var dos = getRootNode(dep); - return descendant$1(dos, '[aria-owns="' + id + '"]'); - }); + var dependent = closest$1(queryElem, function (elem) { + if (!isElement(elem)) { + return false; + } + var id = get$3(elem, 'id'); + return id !== undefined && id.indexOf('aria-owns') > -1; + }); + return dependent.bind(function (dep) { + var id = get$3(dep, 'id'); + var dos = getRootNode(dep); + return descendant$1(dos, '[aria-owns="' + id + '"]'); + }); }; var manager = function () { - var ariaId = generate$1('aria-owns'); - var link = function (elem) { - set$1(elem, 'aria-owns', ariaId); - }; - var unlink = function (elem) { - remove$1(elem, 'aria-owns'); - }; - return { - id: ariaId, - link: link, - unlink: unlink - }; + var ariaId = generate$1('aria-owns'); + var link = function (elem) { + set$1(elem, 'aria-owns', ariaId); + }; + var unlink = function (elem) { + remove$1(elem, 'aria-owns'); + }; + return { + id: ariaId, + link: link, + unlink: unlink + }; }; var isAriaPartOf = function (component, queryElem) { - return find$4(queryElem).exists(function (owner) { - return isPartOf(component, owner); - }); + return find$4(queryElem).exists(function (owner) { + return isPartOf(component, owner); + }); }; var isPartOf = function (component, queryElem) { - return closest$2(queryElem, function (el) { - return eq$1(el, component.element); - }, never) || isAriaPartOf(component, queryElem); + return closest$2(queryElem, function (el) { + return eq$1(el, component.element); + }, never) || isAriaPartOf(component, queryElem); }; var unknown$3 = 'unknown'; var EventConfiguration; (function (EventConfiguration) { - EventConfiguration[EventConfiguration['STOP'] = 0] = 'STOP'; - EventConfiguration[EventConfiguration['NORMAL'] = 1] = 'NORMAL'; - EventConfiguration[EventConfiguration['LOGGING'] = 2] = 'LOGGING'; + EventConfiguration[EventConfiguration['STOP'] = 0] = 'STOP'; + EventConfiguration[EventConfiguration['NORMAL'] = 1] = 'NORMAL'; + EventConfiguration[EventConfiguration['LOGGING'] = 2] = 'LOGGING'; }(EventConfiguration || (EventConfiguration = {}))); var eventConfig = Cell({}); var makeEventLogger = function (eventName, initialTarget) { - var sequence = []; - var startTime = new Date().getTime(); - return { - logEventCut: function (_name, target, purpose) { - sequence.push({ - outcome: 'cut', - target: target, - purpose: purpose - }); - }, - logEventStopped: function (_name, target, purpose) { - sequence.push({ - outcome: 'stopped', - target: target, - purpose: purpose - }); - }, - logNoParent: function (_name, target, purpose) { - sequence.push({ - outcome: 'no-parent', - target: target, - purpose: purpose - }); - }, - logEventNoHandlers: function (_name, target) { - sequence.push({ - outcome: 'no-handlers-left', - target: target - }); - }, - logEventResponse: function (_name, target, purpose) { - sequence.push({ - outcome: 'response', - purpose: purpose, - target: target - }); - }, - write: function () { - var finishTime = new Date().getTime(); - if (contains([ - 'mousemove', - 'mouseover', - 'mouseout', - systemInit() - ], eventName)) { - return; - } - console.log(eventName, { - event: eventName, - time: finishTime - startTime, - target: initialTarget.dom, - sequence: map(sequence, function (s) { - if (!contains([ - 'cut', - 'stopped', - 'response' - ], s.outcome)) { - return s.outcome; - } else { - return '{' + s.purpose + '} ' + s.outcome + ' at (' + element(s.target) + ')'; - } - }) - }); - } - }; + var sequence = []; + var startTime = new Date().getTime(); + return { + logEventCut: function (_name, target, purpose) { + sequence.push({ + outcome: 'cut', + target: target, + purpose: purpose + }); + }, + logEventStopped: function (_name, target, purpose) { + sequence.push({ + outcome: 'stopped', + target: target, + purpose: purpose + }); + }, + logNoParent: function (_name, target, purpose) { + sequence.push({ + outcome: 'no-parent', + target: target, + purpose: purpose + }); + }, + logEventNoHandlers: function (_name, target) { + sequence.push({ + outcome: 'no-handlers-left', + target: target + }); + }, + logEventResponse: function (_name, target, purpose) { + sequence.push({ + outcome: 'response', + purpose: purpose, + target: target + }); + }, + write: function () { + var finishTime = new Date().getTime(); + if (contains([ + 'mousemove', + 'mouseover', + 'mouseout', + systemInit() + ], eventName)) { + return; + } + console.log(eventName, { + event: eventName, + time: finishTime - startTime, + target: initialTarget.dom, + sequence: map(sequence, function (s) { + if (!contains([ + 'cut', + 'stopped', + 'response' + ], s.outcome)) { + return s.outcome; + } else { + return '{' + s.purpose + '} ' + s.outcome + ' at (' + element(s.target) + ')'; + } + }) + }); + } + }; }; var processEvent = function (eventName, initialTarget, f) { - var status = get$1(eventConfig.get(), eventName).orThunk(function () { - var patterns = keys(eventConfig.get()); - return findMap(patterns, function (p) { - return eventName.indexOf(p) > -1 ? Optional.some(eventConfig.get()[p]) : Optional.none(); - }); - }).getOr(EventConfiguration.NORMAL); - switch (status) { - case EventConfiguration.NORMAL: - return f(noLogger()); - case EventConfiguration.LOGGING: { - var logger = makeEventLogger(eventName, initialTarget); - var output = f(logger); - logger.write(); - return output; - } - case EventConfiguration.STOP: - return true; - } + var status = get$1(eventConfig.get(), eventName).orThunk(function () { + var patterns = keys(eventConfig.get()); + return findMap(patterns, function (p) { + return eventName.indexOf(p) > -1 ? Optional.some(eventConfig.get()[p]) : Optional.none(); + }); + }).getOr(EventConfiguration.NORMAL); + switch (status) { + case EventConfiguration.NORMAL: + return f(noLogger()); + case EventConfiguration.LOGGING: { + var logger = makeEventLogger(eventName, initialTarget); + var output = f(logger); + logger.write(); + return output; + } + case EventConfiguration.STOP: + return true; + } }; var path = [ - 'alloy/data/Fields', - 'alloy/debugging/Debugging' + 'alloy/data/Fields', + 'alloy/debugging/Debugging' ]; var getTrace = function () { - var err = new Error(); - if (err.stack !== undefined) { - var lines = err.stack.split('\n'); - return find(lines, function (line) { - return line.indexOf('alloy') > 0 && !exists(path, function (p) { - return line.indexOf(p) > -1; - }); - }).getOr(unknown$3); - } else { - return unknown$3; - } + var err = new Error(); + if (err.stack !== undefined) { + var lines = err.stack.split('\n'); + return find(lines, function (line) { + return line.indexOf('alloy') > 0 && !exists(path, function (p) { + return line.indexOf(p) > -1; + }); + }).getOr(unknown$3); + } else { + return unknown$3; + } }; var ignoreEvent = { - logEventCut: noop, - logEventStopped: noop, - logNoParent: noop, - logEventNoHandlers: noop, - logEventResponse: noop, - write: noop + logEventCut: noop, + logEventStopped: noop, + logNoParent: noop, + logEventNoHandlers: noop, + logEventResponse: noop, + write: noop }; var monitorEvent = function (eventName, initialTarget, f) { - return processEvent(eventName, initialTarget, f); + return processEvent(eventName, initialTarget, f); }; var noLogger = constant(ignoreEvent); var menuFields = constant([ - strict$1('menu'), - strict$1('selectedMenu') + strict$1('menu'), + strict$1('selectedMenu') ]); var itemFields = constant([ - strict$1('item'), - strict$1('selectedItem') + strict$1('item'), + strict$1('selectedItem') ]); var schema = constant(objOf(itemFields().concat(menuFields()))); var itemSchema = constant(objOf(itemFields())); var _initSize = strictObjOf('initSize', [ - strict$1('numColumns'), - strict$1('numRows') + strict$1('numColumns'), + strict$1('numRows') ]); var itemMarkers = function () { - return strictOf('markers', itemSchema()); + return strictOf('markers', itemSchema()); }; var tieredMenuMarkers = function () { - return strictObjOf('markers', [strict$1('backgroundMenu')].concat(menuFields()).concat(itemFields())); + return strictObjOf('markers', [strict$1('backgroundMenu')].concat(menuFields()).concat(itemFields())); }; var markers = function (required) { - return strictObjOf('markers', map(required, strict$1)); + return strictObjOf('markers', map(required, strict$1)); }; var onPresenceHandler = function (label, fieldName, presence) { - var trace = getTrace(); - return field(fieldName, fieldName, presence, valueOf(function (f) { - return Result.value(function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return f.apply(undefined, args); - }); - })); + var trace = getTrace(); + return field(fieldName, fieldName, presence, valueOf(function (f) { + return Result.value(function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return f.apply(undefined, args); + }); + })); }; var onHandler = function (fieldName) { - return onPresenceHandler('onHandler', fieldName, defaulted(noop)); + return onPresenceHandler('onHandler', fieldName, defaulted(noop)); }; var onKeyboardHandler = function (fieldName) { - return onPresenceHandler('onKeyboardHandler', fieldName, defaulted(Optional.none)); + return onPresenceHandler('onKeyboardHandler', fieldName, defaulted(Optional.none)); }; var onStrictHandler = function (fieldName) { - return onPresenceHandler('onHandler', fieldName, strict()); + return onPresenceHandler('onHandler', fieldName, strict()); }; var onStrictKeyboardHandler = function (fieldName) { - return onPresenceHandler('onKeyboardHandler', fieldName, strict()); + return onPresenceHandler('onKeyboardHandler', fieldName, strict()); }; var output = function (name, value) { - return state$1(name, constant(value)); + return state$1(name, constant(value)); }; var snapshot = function (name) { - return state$1(name, identity); + return state$1(name, identity); }; var initSize = constant(_initSize); var nu$7 = function (x, y, bubble, direction, boundsRestriction, label) { - return { - x: x, - y: y, - bubble: bubble, - direction: direction, - boundsRestriction: boundsRestriction, - label: label - }; + return { + x: x, + y: y, + bubble: bubble, + direction: direction, + boundsRestriction: boundsRestriction, + label: label + }; }; var adt$2 = Adt.generate([ - {southeast: []}, - {southwest: []}, - {northeast: []}, - {northwest: []}, - {south: []}, - {north: []}, - {east: []}, - {west: []} + { southeast: [] }, + { southwest: [] }, + { northeast: [] }, + { northwest: [] }, + { south: [] }, + { north: [] }, + { east: [] }, + { west: [] } ]); var cata = function (subject, southeast, southwest, northeast, northwest, south, north, east, west) { - return subject.fold(southeast, southwest, northeast, northwest, south, north, east, west); + return subject.fold(southeast, southwest, northeast, northwest, south, north, east, west); }; var cataVertical = function (subject, south, middle, north) { - return subject.fold(south, south, north, north, south, north, middle, middle); + return subject.fold(south, south, north, north, south, north, middle, middle); }; var cataHorizontal = function (subject, east, middle, west) { - return subject.fold(east, west, east, west, middle, middle, east, west); + return subject.fold(east, west, east, west, middle, middle, east, west); }; var southeast = adt$2.southeast; var southwest = adt$2.southwest; @@ -3854,191 +3850,191 @@ var west = adt$2.west; var getRestriction = function (anchor, restriction) { - switch (restriction) { - case 1: - return anchor.x; - case 0: - return anchor.x + anchor.width; - case 2: - return anchor.y; - case 3: - return anchor.y + anchor.height; - } + switch (restriction) { + case 1: + return anchor.x; + case 0: + return anchor.x + anchor.width; + case 2: + return anchor.y; + case 3: + return anchor.y + anchor.height; + } }; var boundsRestriction = function (anchor, restrictions) { - return mapToObject([ - 'left', - 'right', - 'top', - 'bottom' - ], function (dir) { - return get$1(restrictions, dir).map(function (restriction) { - return getRestriction(anchor, restriction); - }); + return mapToObject([ + 'left', + 'right', + 'top', + 'bottom' + ], function (dir) { + return get$1(restrictions, dir).map(function (restriction) { + return getRestriction(anchor, restriction); }); + }); }; var adjustBounds = function (bounds, boundsRestrictions, bubbleOffsets) { - var applyRestriction = function (dir, current) { - var bubbleOffset = dir === 'top' || dir === 'bottom' ? bubbleOffsets.top : bubbleOffsets.left; - return get$1(boundsRestrictions, dir).bind(identity).bind(function (restriction) { - if (dir === 'left' || dir === 'top') { - return restriction >= current ? Optional.some(restriction) : Optional.none(); - } else { - return restriction <= current ? Optional.some(restriction) : Optional.none(); - } - }).map(function (restriction) { - return restriction + bubbleOffset; - }).getOr(current); - }; - var adjustedLeft = applyRestriction('left', bounds.x); - var adjustedTop = applyRestriction('top', bounds.y); - var adjustedRight = applyRestriction('right', bounds.right); - var adjustedBottom = applyRestriction('bottom', bounds.bottom); - return bounds$1(adjustedLeft, adjustedTop, adjustedRight - adjustedLeft, adjustedBottom - adjustedTop); + var applyRestriction = function (dir, current) { + var bubbleOffset = dir === 'top' || dir === 'bottom' ? bubbleOffsets.top : bubbleOffsets.left; + return get$1(boundsRestrictions, dir).bind(identity).bind(function (restriction) { + if (dir === 'left' || dir === 'top') { + return restriction >= current ? Optional.some(restriction) : Optional.none(); + } else { + return restriction <= current ? Optional.some(restriction) : Optional.none(); + } + }).map(function (restriction) { + return restriction + bubbleOffset; + }).getOr(current); + }; + var adjustedLeft = applyRestriction('left', bounds.x); + var adjustedTop = applyRestriction('top', bounds.y); + var adjustedRight = applyRestriction('right', bounds.right); + var adjustedBottom = applyRestriction('bottom', bounds.bottom); + return bounds$1(adjustedLeft, adjustedTop, adjustedRight - adjustedLeft, adjustedBottom - adjustedTop); }; var eastX = function (anchor) { - return anchor.x; + return anchor.x; }; var middleX = function (anchor, element) { - return anchor.x + anchor.width / 2 - element.width / 2; + return anchor.x + anchor.width / 2 - element.width / 2; }; var westX = function (anchor, element) { - return anchor.x + anchor.width - element.width; + return anchor.x + anchor.width - element.width; }; var northY = function (anchor, element) { - return anchor.y - element.height; + return anchor.y - element.height; }; var southY = function (anchor) { - return anchor.y + anchor.height; + return anchor.y + anchor.height; }; var centreY = function (anchor, element) { - return anchor.y + anchor.height / 2 - element.height / 2; + return anchor.y + anchor.height / 2 - element.height / 2; }; var eastEdgeX = function (anchor) { - return anchor.x + anchor.width; + return anchor.x + anchor.width; }; var westEdgeX = function (anchor, element) { - return anchor.x - element.width; + return anchor.x - element.width; }; var southeast$1 = function (anchor, element, bubbles) { - return nu$7(eastX(anchor), southY(anchor), bubbles.southeast(), southeast(), boundsRestriction(anchor, { - left: 1, - top: 3 - }), 'layout-se'); + return nu$7(eastX(anchor), southY(anchor), bubbles.southeast(), southeast(), boundsRestriction(anchor, { + left: 1, + top: 3 + }), 'layout-se'); }; var southwest$1 = function (anchor, element, bubbles) { - return nu$7(westX(anchor, element), southY(anchor), bubbles.southwest(), southwest(), boundsRestriction(anchor, { - right: 0, - top: 3 - }), 'layout-sw'); + return nu$7(westX(anchor, element), southY(anchor), bubbles.southwest(), southwest(), boundsRestriction(anchor, { + right: 0, + top: 3 + }), 'layout-sw'); }; var northeast$1 = function (anchor, element, bubbles) { - return nu$7(eastX(anchor), northY(anchor, element), bubbles.northeast(), northeast(), boundsRestriction(anchor, { - left: 1, - bottom: 2 - }), 'layout-ne'); + return nu$7(eastX(anchor), northY(anchor, element), bubbles.northeast(), northeast(), boundsRestriction(anchor, { + left: 1, + bottom: 2 + }), 'layout-ne'); }; var northwest$1 = function (anchor, element, bubbles) { - return nu$7(westX(anchor, element), northY(anchor, element), bubbles.northwest(), northwest(), boundsRestriction(anchor, { - right: 0, - bottom: 2 - }), 'layout-nw'); + return nu$7(westX(anchor, element), northY(anchor, element), bubbles.northwest(), northwest(), boundsRestriction(anchor, { + right: 0, + bottom: 2 + }), 'layout-nw'); }; var north$1 = function (anchor, element, bubbles) { - return nu$7(middleX(anchor, element), northY(anchor, element), bubbles.north(), north(), boundsRestriction(anchor, {bottom: 2}), 'layout-n'); + return nu$7(middleX(anchor, element), northY(anchor, element), bubbles.north(), north(), boundsRestriction(anchor, { bottom: 2 }), 'layout-n'); }; var south$1 = function (anchor, element, bubbles) { - return nu$7(middleX(anchor, element), southY(anchor), bubbles.south(), south(), boundsRestriction(anchor, {top: 3}), 'layout-s'); + return nu$7(middleX(anchor, element), southY(anchor), bubbles.south(), south(), boundsRestriction(anchor, { top: 3 }), 'layout-s'); }; var east$1 = function (anchor, element, bubbles) { - return nu$7(eastEdgeX(anchor), centreY(anchor, element), bubbles.east(), east(), boundsRestriction(anchor, {left: 0}), 'layout-e'); + return nu$7(eastEdgeX(anchor), centreY(anchor, element), bubbles.east(), east(), boundsRestriction(anchor, { left: 0 }), 'layout-e'); }; var west$1 = function (anchor, element, bubbles) { - return nu$7(westEdgeX(anchor, element), centreY(anchor, element), bubbles.west(), west(), boundsRestriction(anchor, {right: 1}), 'layout-w'); + return nu$7(westEdgeX(anchor, element), centreY(anchor, element), bubbles.west(), west(), boundsRestriction(anchor, { right: 1 }), 'layout-w'); }; var all$2 = function () { - return [ - southeast$1, - southwest$1, - northeast$1, - northwest$1, - south$1, - north$1, - east$1, - west$1 - ]; + return [ + southeast$1, + southwest$1, + northeast$1, + northwest$1, + south$1, + north$1, + east$1, + west$1 + ]; }; var allRtl = function () { - return [ - southwest$1, - southeast$1, - northwest$1, - northeast$1, - south$1, - north$1, - east$1, - west$1 - ]; + return [ + southwest$1, + southeast$1, + northwest$1, + northeast$1, + south$1, + north$1, + east$1, + west$1 + ]; }; var aboveOrBelow = function () { - return [ - northeast$1, - northwest$1, - southeast$1, - southwest$1, - north$1, - south$1 - ]; + return [ + northeast$1, + northwest$1, + southeast$1, + southwest$1, + north$1, + south$1 + ]; }; var aboveOrBelowRtl = function () { - return [ - northwest$1, - northeast$1, - southwest$1, - southeast$1, - north$1, - south$1 - ]; + return [ + northwest$1, + northeast$1, + southwest$1, + southeast$1, + north$1, + south$1 + ]; }; var belowOrAbove = function () { - return [ - southeast$1, - southwest$1, - northeast$1, - northwest$1, - south$1, - north$1 - ]; + return [ + southeast$1, + southwest$1, + northeast$1, + northwest$1, + south$1, + north$1 + ]; }; var belowOrAboveRtl = function () { - return [ - southwest$1, - southeast$1, - northwest$1, - northeast$1, - south$1, - north$1 - ]; + return [ + southwest$1, + southeast$1, + northwest$1, + northeast$1, + south$1, + north$1 + ]; }; var chooseChannels = function (channels, message) { - return message.universal ? channels : filter(channels, function (ch) { - return contains(message.channels, ch); - }); + return message.universal ? channels : filter(channels, function (ch) { + return contains(message.channels, ch); + }); }; var events$1 = function (receiveConfig) { - return derive([run(receive(), function (component, message) { - var channelMap = receiveConfig.channels; - var channels = keys(channelMap); - var receivingData = message; - var targetChannels = chooseChannels(channels, receivingData); - each(targetChannels, function (ch) { - var channelInfo = channelMap[ch]; - var channelSchema = channelInfo.schema; - var data = asRawOrDie('channel[' + ch + '] data\nReceiver: ' + element(component.element), channelSchema, receivingData.data); - channelInfo.onReceive(component, data); - }); + return derive([run(receive(), function (component, message) { + var channelMap = receiveConfig.channels; + var channels = keys(channelMap); + var receivingData = message; + var targetChannels = chooseChannels(channels, receivingData); + each(targetChannels, function (ch) { + var channelInfo = channelMap[ch]; + var channelSchema = channelInfo.schema; + var data = asRawOrDie('channel[' + ch + '] data\nReceiver: ' + element(component.element), channelSchema, receivingData.data); + channelInfo.onReceive(component, data); + }); })]); }; @@ -4050,147 +4046,147 @@ var ReceivingSchema = [strictOf('channels', setOf$1(Result.value, objOfOnly([ onStrictHandler('onReceive'), defaulted$1('schema', anyValue$1()) - ])))]; + ])))]; var executeEvent = function (bConfig, bState, executor) { - return runOnExecute(function (component) { - executor(component, bConfig, bState); - }); + return runOnExecute(function (component) { + executor(component, bConfig, bState); + }); }; var loadEvent = function (bConfig, bState, f) { - return runOnInit(function (component, _simulatedEvent) { - f(component, bConfig, bState); - }); + return runOnInit(function (component, _simulatedEvent) { + f(component, bConfig, bState); + }); }; var create = function (schema, name, active, apis, extra, state) { - var configSchema = objOfOnly(schema); - var schemaSchema = optionObjOf(name, [optionObjOfOnly('config', schema)]); - return doCreate(configSchema, schemaSchema, name, active, apis, extra, state); + var configSchema = objOfOnly(schema); + var schemaSchema = optionObjOf(name, [optionObjOfOnly('config', schema)]); + return doCreate(configSchema, schemaSchema, name, active, apis, extra, state); }; var createModes = function (modes, name, active, apis, extra, state) { - var configSchema = modes; - var schemaSchema = optionObjOf(name, [optionOf('config', modes)]); - return doCreate(configSchema, schemaSchema, name, active, apis, extra, state); + var configSchema = modes; + var schemaSchema = optionObjOf(name, [optionOf('config', modes)]); + return doCreate(configSchema, schemaSchema, name, active, apis, extra, state); }; var wrapApi = function (bName, apiFunction, apiName) { - var f = function (component) { - var rest = []; - for (var _i = 1; _i < arguments.length; _i++) { - rest[_i - 1] = arguments[_i]; - } - var args = [component].concat(rest); - return component.config({name: constant(bName)}).fold(function () { - throw new Error('We could not find any behaviour configuration for: ' + bName + '. Using API: ' + apiName); - }, function (info) { - var rest = Array.prototype.slice.call(args, 1); - return apiFunction.apply(undefined, [ - component, - info.config, - info.state - ].concat(rest)); - }); - }; - return markAsBehaviourApi(f, apiName, apiFunction); + var f = function (component) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + var args = [component].concat(rest); + return component.config({ name: constant(bName) }).fold(function () { + throw new Error('We could not find any behaviour configuration for: ' + bName + '. Using API: ' + apiName); + }, function (info) { + var rest = Array.prototype.slice.call(args, 1); + return apiFunction.apply(undefined, [ + component, + info.config, + info.state + ].concat(rest)); + }); + }; + return markAsBehaviourApi(f, apiName, apiFunction); }; var revokeBehaviour = function (name) { - return { - key: name, - value: undefined - }; + return { + key: name, + value: undefined + }; }; var doCreate = function (configSchema, schemaSchema, name, active, apis, extra, state) { - var getConfig = function (info) { - return hasNonNullableKey(info, name) ? info[name]() : Optional.none(); - }; - var wrappedApis = map$2(apis, function (apiF, apiName) { - return wrapApi(name, apiF, apiName); - }); - var wrappedExtra = map$2(extra, function (extraF, extraName) { - return markAsExtraApi(extraF, extraName); - }); - var me = __assign(__assign(__assign({}, wrappedExtra), wrappedApis), { - revoke: curry(revokeBehaviour, name), - config: function (spec) { - var prepared = asRawOrDie(name + '-config', configSchema, spec); - return { - key: name, - value: { - config: prepared, - me: me, - configAsRaw: cached(function () { - return asRawOrDie(name + '-config', configSchema, spec); - }), - initialConfig: spec, - state: state - } - }; - }, - schema: function () { - return schemaSchema; - }, - exhibit: function (info, base) { - return getConfig(info).bind(function (behaviourInfo) { - return get$1(active, 'exhibit').map(function (exhibitor) { - return exhibitor(base, behaviourInfo.config, behaviourInfo.state); - }); - }).getOr(nu$6({})); - }, - name: function () { - return name; - }, - handlers: function (info) { - return getConfig(info).map(function (behaviourInfo) { - var getEvents = get$1(active, 'events').getOr(function () { - return {}; - }); - return getEvents(behaviourInfo.config, behaviourInfo.state); - }).getOr({}); - } - }); - return me; + var getConfig = function (info) { + return hasNonNullableKey(info, name) ? info[name]() : Optional.none(); + }; + var wrappedApis = map$2(apis, function (apiF, apiName) { + return wrapApi(name, apiF, apiName); + }); + var wrappedExtra = map$2(extra, function (extraF, extraName) { + return markAsExtraApi(extraF, extraName); + }); + var me = __assign(__assign(__assign({}, wrappedExtra), wrappedApis), { + revoke: curry(revokeBehaviour, name), + config: function (spec) { + var prepared = asRawOrDie(name + '-config', configSchema, spec); + return { + key: name, + value: { + config: prepared, + me: me, + configAsRaw: cached(function () { + return asRawOrDie(name + '-config', configSchema, spec); + }), + initialConfig: spec, + state: state + } + }; + }, + schema: function () { + return schemaSchema; + }, + exhibit: function (info, base) { + return getConfig(info).bind(function (behaviourInfo) { + return get$1(active, 'exhibit').map(function (exhibitor) { + return exhibitor(base, behaviourInfo.config, behaviourInfo.state); + }); + }).getOr(nu$6({})); + }, + name: function () { + return name; + }, + handlers: function (info) { + return getConfig(info).map(function (behaviourInfo) { + var getEvents = get$1(active, 'events').getOr(function () { + return {}; + }); + return getEvents(behaviourInfo.config, behaviourInfo.state); + }).getOr({}); + } + }); + return me; }; var derive$1 = function (capabilities) { - return wrapAll$1(capabilities); + return wrapAll$1(capabilities); }; var simpleSchema = objOfOnly([ - strict$1('fields'), - strict$1('name'), - defaulted$1('active', {}), - defaulted$1('apis', {}), - defaulted$1('state', NoState), - defaulted$1('extra', {}) + strict$1('fields'), + strict$1('name'), + defaulted$1('active', {}), + defaulted$1('apis', {}), + defaulted$1('state', NoState), + defaulted$1('extra', {}) ]); var create$1 = function (data) { - var value = asRawOrDie('Creating behaviour: ' + data.name, simpleSchema, data); - return create(value.fields, value.name, value.active, value.apis, value.extra, value.state); + var value = asRawOrDie('Creating behaviour: ' + data.name, simpleSchema, data); + return create(value.fields, value.name, value.active, value.apis, value.extra, value.state); }; var modeSchema = objOfOnly([ - strict$1('branchKey'), - strict$1('branches'), - strict$1('name'), - defaulted$1('active', {}), - defaulted$1('apis', {}), - defaulted$1('state', NoState), - defaulted$1('extra', {}) + strict$1('branchKey'), + strict$1('branches'), + strict$1('name'), + defaulted$1('active', {}), + defaulted$1('apis', {}), + defaulted$1('state', NoState), + defaulted$1('extra', {}) ]); var createModes$1 = function (data) { - var value = asRawOrDie('Creating behaviour: ' + data.name, modeSchema, data); - return createModes(choose$1(value.branchKey, value.branches), value.name, value.active, value.apis, value.extra, value.state); + var value = asRawOrDie('Creating behaviour: ' + data.name, modeSchema, data); + return createModes(choose$1(value.branchKey, value.branches), value.name, value.active, value.apis, value.extra, value.state); }; var revoke = constant(undefined); var Receiving = create$1({ - fields: ReceivingSchema, - name: 'receiving', - active: ActiveReceiving + fields: ReceivingSchema, + name: 'receiving', + active: ActiveReceiving }); var exhibit = function (base, posConfig) { - return nu$6({ - classes: [], - styles: posConfig.useFixed() ? {} : {position: 'relative'} - }); + return nu$6({ + classes: [], + styles: posConfig.useFixed() ? {} : { position: 'relative' } + }); }; var ActivePosition = /*#__PURE__*/Object.freeze({ @@ -4199,1234 +4195,1232 @@ }); var getDocument = function () { - return SugarElement.fromDom(document); + return SugarElement.fromDom(document); }; var focus$1 = function (element) { - return element.dom.focus(); + return element.dom.focus(); }; var blur = function (element) { - return element.dom.blur(); + return element.dom.blur(); }; var hasFocus = function (element) { - var root = getRootNode(element).dom; - return element.dom === root.activeElement; + var root = getRootNode(element).dom; + return element.dom === root.activeElement; }; var active = function (root) { - if (root === void 0) { - root = getDocument(); - } - return Optional.from(root.dom.activeElement).map(SugarElement.fromDom); + if (root === void 0) { + root = getDocument(); + } + return Optional.from(root.dom.activeElement).map(SugarElement.fromDom); }; var search = function (element) { - return active(getRootNode(element)).filter(function (e) { - return element.dom.contains(e.dom); - }); + return active(getRootNode(element)).filter(function (e) { + return element.dom.contains(e.dom); + }); }; var preserve = function (f, container) { - var dos = getRootNode(container); - var refocus = active(dos).bind(function (focused) { - var hasFocus = function (elem) { - return eq$1(focused, elem); - }; - return hasFocus(container) ? Optional.some(container) : descendant(container, hasFocus); - }); - var result = f(container); - refocus.each(function (oldFocus) { - active(dos).filter(function (newFocus) { - return eq$1(newFocus, oldFocus); - }).fold(function () { - focus$1(oldFocus); - }, noop); - }); - return result; + var dos = getRootNode(container); + var refocus = active(dos).bind(function (focused) { + var hasFocus = function (elem) { + return eq$1(focused, elem); + }; + return hasFocus(container) ? Optional.some(container) : descendant(container, hasFocus); + }); + var result = f(container); + refocus.each(function (oldFocus) { + active(dos).filter(function (newFocus) { + return eq$1(newFocus, oldFocus); + }).fold(function () { + focus$1(oldFocus); + }, noop); + }); + return result; }; var NuPositionCss = function (position, left, top, right, bottom) { - return { - position: position, - left: left, - top: top, - right: right, - bottom: bottom - }; + return { + position: position, + left: left, + top: top, + right: right, + bottom: bottom + }; }; var applyPositionCss = function (element, position) { - var addPx = function (num) { - return num + 'px'; - }; - setOptions(element, { - position: Optional.some(position.position), - left: position.left.map(addPx), - top: position.top.map(addPx), - right: position.right.map(addPx), - bottom: position.bottom.map(addPx) - }); + var addPx = function (num) { + return num + 'px'; + }; + setOptions(element, { + position: Optional.some(position.position), + left: position.left.map(addPx), + top: position.top.map(addPx), + right: position.right.map(addPx), + bottom: position.bottom.map(addPx) + }); }; var adt$3 = Adt.generate([ - {none: []}, - { - relative: [ - 'x', - 'y', - 'width', - 'height' - ] - }, - { - fixed: [ - 'x', - 'y', - 'width', - 'height' - ] - } + { none: [] }, + { + relative: [ + 'x', + 'y', + 'width', + 'height' + ] + }, + { + fixed: [ + 'x', + 'y', + 'width', + 'height' + ] + } ]); var positionWithDirection = function (posName, decision, x, y, width, height) { - var decisionX = decision.x - x; - var decisionY = decision.y - y; - var decisionWidth = decision.width; - var decisionHeight = decision.height; - var decisionRight = width - (decisionX + decisionWidth); - var decisionBottom = height - (decisionY + decisionHeight); - var left = Optional.some(decisionX); - var top = Optional.some(decisionY); - var right = Optional.some(decisionRight); - var bottom = Optional.some(decisionBottom); - var none = Optional.none(); - return cata(decision.direction, function () { - return NuPositionCss(posName, left, top, none, none); - }, function () { - return NuPositionCss(posName, none, top, right, none); - }, function () { - return NuPositionCss(posName, left, none, none, bottom); - }, function () { - return NuPositionCss(posName, none, none, right, bottom); - }, function () { - return NuPositionCss(posName, left, top, none, none); - }, function () { - return NuPositionCss(posName, left, none, none, bottom); - }, function () { - return NuPositionCss(posName, left, top, none, none); - }, function () { - return NuPositionCss(posName, none, top, right, none); - }); + var decisionX = decision.x - x; + var decisionY = decision.y - y; + var decisionWidth = decision.width; + var decisionHeight = decision.height; + var decisionRight = width - (decisionX + decisionWidth); + var decisionBottom = height - (decisionY + decisionHeight); + var left = Optional.some(decisionX); + var top = Optional.some(decisionY); + var right = Optional.some(decisionRight); + var bottom = Optional.some(decisionBottom); + var none = Optional.none(); + return cata(decision.direction, function () { + return NuPositionCss(posName, left, top, none, none); + }, function () { + return NuPositionCss(posName, none, top, right, none); + }, function () { + return NuPositionCss(posName, left, none, none, bottom); + }, function () { + return NuPositionCss(posName, none, none, right, bottom); + }, function () { + return NuPositionCss(posName, left, top, none, none); + }, function () { + return NuPositionCss(posName, left, none, none, bottom); + }, function () { + return NuPositionCss(posName, left, top, none, none); + }, function () { + return NuPositionCss(posName, none, top, right, none); + }); }; var reposition = function (origin, decision) { - return origin.fold(function () { - return NuPositionCss('absolute', Optional.some(decision.x), Optional.some(decision.y), Optional.none(), Optional.none()); - }, function (x, y, width, height) { - return positionWithDirection('absolute', decision, x, y, width, height); - }, function (x, y, width, height) { - return positionWithDirection('fixed', decision, x, y, width, height); - }); + return origin.fold(function () { + return NuPositionCss('absolute', Optional.some(decision.x), Optional.some(decision.y), Optional.none(), Optional.none()); + }, function (x, y, width, height) { + return positionWithDirection('absolute', decision, x, y, width, height); + }, function (x, y, width, height) { + return positionWithDirection('fixed', decision, x, y, width, height); + }); }; var toBox = function (origin, element) { - var rel = curry(find$3, element); - var position = origin.fold(rel, rel, function () { - var scroll = get$9(); - return find$3(element).translate(-scroll.left, -scroll.top); - }); - var width = getOuter$2(element); - var height = getOuter$1(element); - return bounds$1(position.left, position.top, width, height); + var rel = curry(find$3, element); + var position = origin.fold(rel, rel, function () { + var scroll = get$9(); + return find$3(element).translate(-scroll.left, -scroll.top); + }); + var width = getOuter$2(element); + var height = getOuter$1(element); + return bounds$1(position.left, position.top, width, height); }; var viewport$1 = function (origin, getBounds) { - return getBounds.fold(function () { - return origin.fold(win, win, bounds$1); - }, function (b) { - return origin.fold(b, b, function () { - var bounds = b(); - var pos = translate(origin, bounds.x, bounds.y); - return bounds$1(pos.left, pos.top, bounds.width, bounds.height); - }); + return getBounds.fold(function () { + return origin.fold(win, win, bounds$1); + }, function (b) { + return origin.fold(b, b, function () { + var bounds = b(); + var pos = translate(origin, bounds.x, bounds.y); + return bounds$1(pos.left, pos.top, bounds.width, bounds.height); }); + }); }; var translate = function (origin, x, y) { - var pos = SugarPosition(x, y); - var removeScroll = function () { - var outerScroll = get$9(); - return pos.translate(-outerScroll.left, -outerScroll.top); - }; - return origin.fold(constant(pos), constant(pos), removeScroll); + var pos = SugarPosition(x, y); + var removeScroll = function () { + var outerScroll = get$9(); + return pos.translate(-outerScroll.left, -outerScroll.top); + }; + return origin.fold(constant(pos), constant(pos), removeScroll); }; var cata$1 = function (subject, onNone, onRelative, onFixed) { - return subject.fold(onNone, onRelative, onFixed); + return subject.fold(onNone, onRelative, onFixed); }; var none$1 = adt$3.none; var relative = adt$3.relative; var fixed = adt$3.fixed; var anchor = function (anchorBox, origin) { - return { - anchorBox: anchorBox, - origin: origin - }; + return { + anchorBox: anchorBox, + origin: origin + }; }; var box$1 = function (anchorBox, origin) { - return anchor(anchorBox, origin); + return anchor(anchorBox, origin); }; var cycleBy = function (value, delta, min, max) { - var r = value + delta; - if (r > max) { - return min; - } else if (r < min) { - return max; - } else { - return r; - } + var r = value + delta; + if (r > max) { + return min; + } else if (r < min) { + return max; + } else { + return r; + } }; var clamp = function (value, min, max) { - return Math.min(Math.max(value, min), max); + return Math.min(Math.max(value, min), max); }; var adt$4 = Adt.generate([ - {fit: ['reposition']}, - { - nofit: [ - 'reposition', - 'deltaW', - 'deltaH' - ] - } + { fit: ['reposition'] }, + { + nofit: [ + 'reposition', + 'deltaW', + 'deltaH' + ] + } ]); var calcReposition = function (newX, newY, width, height, bounds) { - var boundsX = bounds.x; - var boundsY = bounds.y; - var boundsWidth = bounds.width; - var boundsHeight = bounds.height; - var xInBounds = newX >= boundsX; - var yInBounds = newY >= boundsY; - var originInBounds = xInBounds && yInBounds; - var xFit = newX + width <= boundsX + boundsWidth; - var yFit = newY + height <= boundsY + boundsHeight; - var sizeInBounds = xFit && yFit; - var deltaW = Math.abs(Math.min(width, xInBounds ? boundsX + boundsWidth - newX : boundsX - (newX + width))); - var deltaH = Math.abs(Math.min(height, yInBounds ? boundsY + boundsHeight - newY : boundsY - (newY + height))); - var maxX = Math.max(bounds.x, bounds.right - width); - var maxY = Math.max(bounds.y, bounds.bottom - height); - var limitX = clamp(newX, bounds.x, maxX); - var limitY = clamp(newY, bounds.y, maxY); - return { - originInBounds: originInBounds, - sizeInBounds: sizeInBounds, - limitX: limitX, - limitY: limitY, - deltaW: deltaW, - deltaH: deltaH - }; + var boundsX = bounds.x; + var boundsY = bounds.y; + var boundsWidth = bounds.width; + var boundsHeight = bounds.height; + var xInBounds = newX >= boundsX; + var yInBounds = newY >= boundsY; + var originInBounds = xInBounds && yInBounds; + var xFit = newX + width <= boundsX + boundsWidth; + var yFit = newY + height <= boundsY + boundsHeight; + var sizeInBounds = xFit && yFit; + var deltaW = Math.abs(Math.min(width, xInBounds ? boundsX + boundsWidth - newX : boundsX - (newX + width))); + var deltaH = Math.abs(Math.min(height, yInBounds ? boundsY + boundsHeight - newY : boundsY - (newY + height))); + var maxX = Math.max(bounds.x, bounds.right - width); + var maxY = Math.max(bounds.y, bounds.bottom - height); + var limitX = clamp(newX, bounds.x, maxX); + var limitY = clamp(newY, bounds.y, maxY); + return { + originInBounds: originInBounds, + sizeInBounds: sizeInBounds, + limitX: limitX, + limitY: limitY, + deltaW: deltaW, + deltaH: deltaH + }; }; var attempt = function (candidate, width, height, bounds) { - var candidateX = candidate.x; - var candidateY = candidate.y; - var bubbleOffsets = candidate.bubble.offset; - var bubbleLeft = bubbleOffsets.left; - var bubbleTop = bubbleOffsets.top; - var adjustedBounds = adjustBounds(bounds, candidate.boundsRestriction, bubbleOffsets); - var boundsY = adjustedBounds.y; - var boundsBottom = adjustedBounds.bottom; - var boundsX = adjustedBounds.x; - var boundsRight = adjustedBounds.right; - var newX = candidateX + bubbleLeft; - var newY = candidateY + bubbleTop; - var _a = calcReposition(newX, newY, width, height, adjustedBounds), originInBounds = _a.originInBounds, - sizeInBounds = _a.sizeInBounds, limitX = _a.limitX, limitY = _a.limitY, deltaW = _a.deltaW, - deltaH = _a.deltaH; - var upAvailable = constant(limitY + deltaH - boundsY); - var downAvailable = constant(boundsBottom - limitY); - var maxHeight = cataVertical(candidate.direction, downAvailable, downAvailable, upAvailable); - var westAvailable = constant(limitX + deltaW - boundsX); - var eastAvailable = constant(boundsRight - limitX); - var maxWidth = cataHorizontal(candidate.direction, eastAvailable, eastAvailable, westAvailable); - var reposition = { - x: limitX, - y: limitY, - width: deltaW, - height: deltaH, - maxHeight: maxHeight, - maxWidth: maxWidth, - direction: candidate.direction, - classes: { - on: candidate.bubble.classesOn, - off: candidate.bubble.classesOff - }, - label: candidate.label, - candidateYforTest: newY - }; - return originInBounds && sizeInBounds ? adt$4.fit(reposition) : adt$4.nofit(reposition, deltaW, deltaH); + var candidateX = candidate.x; + var candidateY = candidate.y; + var bubbleOffsets = candidate.bubble.offset; + var bubbleLeft = bubbleOffsets.left; + var bubbleTop = bubbleOffsets.top; + var adjustedBounds = adjustBounds(bounds, candidate.boundsRestriction, bubbleOffsets); + var boundsY = adjustedBounds.y; + var boundsBottom = adjustedBounds.bottom; + var boundsX = adjustedBounds.x; + var boundsRight = adjustedBounds.right; + var newX = candidateX + bubbleLeft; + var newY = candidateY + bubbleTop; + var _a = calcReposition(newX, newY, width, height, adjustedBounds), originInBounds = _a.originInBounds, sizeInBounds = _a.sizeInBounds, limitX = _a.limitX, limitY = _a.limitY, deltaW = _a.deltaW, deltaH = _a.deltaH; + var upAvailable = constant(limitY + deltaH - boundsY); + var downAvailable = constant(boundsBottom - limitY); + var maxHeight = cataVertical(candidate.direction, downAvailable, downAvailable, upAvailable); + var westAvailable = constant(limitX + deltaW - boundsX); + var eastAvailable = constant(boundsRight - limitX); + var maxWidth = cataHorizontal(candidate.direction, eastAvailable, eastAvailable, westAvailable); + var reposition = { + x: limitX, + y: limitY, + width: deltaW, + height: deltaH, + maxHeight: maxHeight, + maxWidth: maxWidth, + direction: candidate.direction, + classes: { + on: candidate.bubble.classesOn, + off: candidate.bubble.classesOff + }, + label: candidate.label, + candidateYforTest: newY + }; + return originInBounds && sizeInBounds ? adt$4.fit(reposition) : adt$4.nofit(reposition, deltaW, deltaH); }; var attempts = function (candidates, anchorBox, elementBox, bubbles, bounds) { - var panelWidth = elementBox.width; - var panelHeight = elementBox.height; - var attemptBestFit = function (layout, reposition, deltaW, deltaH) { - var next = layout(anchorBox, elementBox, bubbles); - var attemptLayout = attempt(next, panelWidth, panelHeight, bounds); - return attemptLayout.fold(adt$4.fit, function (newReposition, newDeltaW, newDeltaH) { - var improved = newDeltaH > deltaH || newDeltaW > deltaW; - return improved ? adt$4.nofit(newReposition, newDeltaW, newDeltaH) : adt$4.nofit(reposition, deltaW, deltaH); - }); - }; - var abc = foldl(candidates, function (b, a) { - var bestNext = curry(attemptBestFit, a); - return b.fold(adt$4.fit, bestNext); - }, adt$4.nofit({ - x: anchorBox.x, - y: anchorBox.y, - width: elementBox.width, - height: elementBox.height, - maxHeight: elementBox.height, - maxWidth: elementBox.width, - direction: southeast(), - classes: { - on: [], - off: [] - }, - label: 'none', - candidateYforTest: anchorBox.y - }, -1, -1)); - return abc.fold(identity, identity); + var panelWidth = elementBox.width; + var panelHeight = elementBox.height; + var attemptBestFit = function (layout, reposition, deltaW, deltaH) { + var next = layout(anchorBox, elementBox, bubbles); + var attemptLayout = attempt(next, panelWidth, panelHeight, bounds); + return attemptLayout.fold(adt$4.fit, function (newReposition, newDeltaW, newDeltaH) { + var improved = newDeltaH > deltaH || newDeltaW > deltaW; + return improved ? adt$4.nofit(newReposition, newDeltaW, newDeltaH) : adt$4.nofit(reposition, deltaW, deltaH); + }); + }; + var abc = foldl(candidates, function (b, a) { + var bestNext = curry(attemptBestFit, a); + return b.fold(adt$4.fit, bestNext); + }, adt$4.nofit({ + x: anchorBox.x, + y: anchorBox.y, + width: elementBox.width, + height: elementBox.height, + maxHeight: elementBox.height, + maxWidth: elementBox.width, + direction: southeast(), + classes: { + on: [], + off: [] + }, + label: 'none', + candidateYforTest: anchorBox.y + }, -1, -1)); + return abc.fold(identity, identity); }; var elementSize = function (p) { - return { - width: getOuter$2(p), - height: getOuter$1(p) - }; + return { + width: getOuter$2(p), + height: getOuter$1(p) + }; }; var layout = function (anchorBox, element, bubbles, options) { - remove$6(element, 'max-height'); - remove$6(element, 'max-width'); - var elementBox = elementSize(element); - return attempts(options.preference, anchorBox, elementBox, bubbles, options.bounds); + remove$6(element, 'max-height'); + remove$6(element, 'max-width'); + var elementBox = elementSize(element); + return attempts(options.preference, anchorBox, elementBox, bubbles, options.bounds); }; var setClasses = function (element, decision) { - var classInfo = decision.classes; - remove$5(element, classInfo.off); - add$3(element, classInfo.on); + var classInfo = decision.classes; + remove$5(element, classInfo.off); + add$3(element, classInfo.on); }; var setHeight = function (element, decision, options) { - var maxHeightFunction = options.maxHeightFunction; - maxHeightFunction(element, decision.maxHeight); + var maxHeightFunction = options.maxHeightFunction; + maxHeightFunction(element, decision.maxHeight); }; var setWidth = function (element, decision, options) { - var maxWidthFunction = options.maxWidthFunction; - maxWidthFunction(element, decision.maxWidth); + var maxWidthFunction = options.maxWidthFunction; + maxWidthFunction(element, decision.maxWidth); }; var position = function (element, decision, options) { - applyPositionCss(element, reposition(options.origin, decision)); + applyPositionCss(element, reposition(options.origin, decision)); }; var setMaxHeight = function (element, maxHeight) { - setMax(element, Math.floor(maxHeight)); + setMax(element, Math.floor(maxHeight)); }; var anchored = constant(function (element, available) { - setMaxHeight(element, available); - setAll$1(element, { - 'overflow-x': 'hidden', - 'overflow-y': 'auto' - }); + setMaxHeight(element, available); + setAll$1(element, { + 'overflow-x': 'hidden', + 'overflow-y': 'auto' + }); }); var expandable = constant(function (element, available) { - setMaxHeight(element, available); + setMaxHeight(element, available); }); var defaultOr = function (options, key, dephault) { - return options[key] === undefined ? dephault : options[key]; + return options[key] === undefined ? dephault : options[key]; }; var simple = function (anchor, element, bubble, layouts, getBounds, overrideOptions) { - var maxHeightFunction = defaultOr(overrideOptions, 'maxHeightFunction', anchored()); - var maxWidthFunction = defaultOr(overrideOptions, 'maxWidthFunction', noop); - var anchorBox = anchor.anchorBox; - var origin = anchor.origin; - var options = { - bounds: viewport$1(origin, getBounds), - origin: origin, - preference: layouts, - maxHeightFunction: maxHeightFunction, - maxWidthFunction: maxWidthFunction - }; - go(anchorBox, element, bubble, options); + var maxHeightFunction = defaultOr(overrideOptions, 'maxHeightFunction', anchored()); + var maxWidthFunction = defaultOr(overrideOptions, 'maxWidthFunction', noop); + var anchorBox = anchor.anchorBox; + var origin = anchor.origin; + var options = { + bounds: viewport$1(origin, getBounds), + origin: origin, + preference: layouts, + maxHeightFunction: maxHeightFunction, + maxWidthFunction: maxWidthFunction + }; + go(anchorBox, element, bubble, options); }; var go = function (anchorBox, element, bubble, options) { - var decision = layout(anchorBox, element, bubble, options); - position(element, decision, options); - setClasses(element, decision); - setHeight(element, decision, options); - setWidth(element, decision, options); + var decision = layout(anchorBox, element, bubble, options); + position(element, decision, options); + setClasses(element, decision); + setHeight(element, decision, options); + setWidth(element, decision, options); }; var allAlignments = [ - 'valignCentre', - 'alignLeft', - 'alignRight', - 'alignCentre', - 'top', - 'bottom', - 'left', - 'right' + 'valignCentre', + 'alignLeft', + 'alignRight', + 'alignCentre', + 'top', + 'bottom', + 'left', + 'right' ]; var nu$8 = function (width, yoffset, classes) { - var getClasses = function (prop) { - return get$1(classes, prop).getOr([]); - }; - var make = function (xDelta, yDelta, alignmentsOn) { - var alignmentsOff = difference(allAlignments, alignmentsOn); - return { - offset: SugarPosition(xDelta, yDelta), - classesOn: bind(alignmentsOn, getClasses), - classesOff: bind(alignmentsOff, getClasses) - }; - }; + var getClasses = function (prop) { + return get$1(classes, prop).getOr([]); + }; + var make = function (xDelta, yDelta, alignmentsOn) { + var alignmentsOff = difference(allAlignments, alignmentsOn); return { - southeast: function () { - return make(-width, yoffset, [ - 'top', - 'alignLeft' - ]); - }, - southwest: function () { - return make(width, yoffset, [ - 'top', - 'alignRight' - ]); - }, - south: function () { - return make(-width / 2, yoffset, [ - 'top', - 'alignCentre' - ]); - }, - northeast: function () { - return make(-width, -yoffset, [ - 'bottom', - 'alignLeft' - ]); - }, - northwest: function () { - return make(width, -yoffset, [ - 'bottom', - 'alignRight' - ]); - }, - north: function () { - return make(-width / 2, -yoffset, [ - 'bottom', - 'alignCentre' - ]); - }, - east: function () { - return make(width, -yoffset / 2, [ - 'valignCentre', - 'left' - ]); - }, - west: function () { - return make(-width, -yoffset / 2, [ - 'valignCentre', - 'right' - ]); - }, - innerNorthwest: function () { - return make(-width, yoffset, [ - 'top', - 'alignRight' - ]); - }, - innerNortheast: function () { - return make(width, yoffset, [ - 'top', - 'alignLeft' - ]); - }, - innerNorth: function () { - return make(-width / 2, yoffset, [ - 'top', - 'alignCentre' - ]); - }, - innerSouthwest: function () { - return make(-width, -yoffset, [ - 'bottom', - 'alignRight' - ]); - }, - innerSoutheast: function () { - return make(width, -yoffset, [ - 'bottom', - 'alignLeft' - ]); - }, - innerSouth: function () { - return make(-width / 2, -yoffset, [ - 'bottom', - 'alignCentre' - ]); - }, - innerWest: function () { - return make(width, -yoffset / 2, [ - 'valignCentre', - 'right' - ]); - }, - innerEast: function () { - return make(-width, -yoffset / 2, [ - 'valignCentre', - 'left' - ]); - } - }; + offset: SugarPosition(xDelta, yDelta), + classesOn: bind(alignmentsOn, getClasses), + classesOff: bind(alignmentsOff, getClasses) + }; + }; + return { + southeast: function () { + return make(-width, yoffset, [ + 'top', + 'alignLeft' + ]); + }, + southwest: function () { + return make(width, yoffset, [ + 'top', + 'alignRight' + ]); + }, + south: function () { + return make(-width / 2, yoffset, [ + 'top', + 'alignCentre' + ]); + }, + northeast: function () { + return make(-width, -yoffset, [ + 'bottom', + 'alignLeft' + ]); + }, + northwest: function () { + return make(width, -yoffset, [ + 'bottom', + 'alignRight' + ]); + }, + north: function () { + return make(-width / 2, -yoffset, [ + 'bottom', + 'alignCentre' + ]); + }, + east: function () { + return make(width, -yoffset / 2, [ + 'valignCentre', + 'left' + ]); + }, + west: function () { + return make(-width, -yoffset / 2, [ + 'valignCentre', + 'right' + ]); + }, + innerNorthwest: function () { + return make(-width, yoffset, [ + 'top', + 'alignRight' + ]); + }, + innerNortheast: function () { + return make(width, yoffset, [ + 'top', + 'alignLeft' + ]); + }, + innerNorth: function () { + return make(-width / 2, yoffset, [ + 'top', + 'alignCentre' + ]); + }, + innerSouthwest: function () { + return make(-width, -yoffset, [ + 'bottom', + 'alignRight' + ]); + }, + innerSoutheast: function () { + return make(width, -yoffset, [ + 'bottom', + 'alignLeft' + ]); + }, + innerSouth: function () { + return make(-width / 2, -yoffset, [ + 'bottom', + 'alignCentre' + ]); + }, + innerWest: function () { + return make(width, -yoffset / 2, [ + 'valignCentre', + 'right' + ]); + }, + innerEast: function () { + return make(-width, -yoffset / 2, [ + 'valignCentre', + 'left' + ]); + } + }; }; var fallback = function () { - return nu$8(0, 0, {}); + return nu$8(0, 0, {}); }; var nu$9 = function (x) { - return x; + return x; }; var onDirection = function (isLtr, isRtl) { - return function (element) { - return getDirection(element) === 'rtl' ? isRtl : isLtr; - }; + return function (element) { + return getDirection(element) === 'rtl' ? isRtl : isLtr; + }; }; var getDirection = function (element) { - return get$5(element, 'direction') === 'rtl' ? 'rtl' : 'ltr'; + return get$5(element, 'direction') === 'rtl' ? 'rtl' : 'ltr'; }; var AttributeValue; (function (AttributeValue) { - AttributeValue['TopToBottom'] = 'toptobottom'; - AttributeValue['BottomToTop'] = 'bottomtotop'; + AttributeValue['TopToBottom'] = 'toptobottom'; + AttributeValue['BottomToTop'] = 'bottomtotop'; }(AttributeValue || (AttributeValue = {}))); var Attribute = 'data-alloy-vertical-dir'; var isBottomToTopDir = function (el) { - return closest$2(el, function (current) { - return isElement(current) && get$3(current, 'data-alloy-vertical-dir') === AttributeValue.BottomToTop; - }); + return closest$2(el, function (current) { + return isElement(current) && get$3(current, 'data-alloy-vertical-dir') === AttributeValue.BottomToTop; + }); }; var schema$1 = function () { - return optionObjOf('layouts', [ - strict$1('onLtr'), - strict$1('onRtl'), - option('onBottomLtr'), - option('onBottomRtl') - ]); + return optionObjOf('layouts', [ + strict$1('onLtr'), + strict$1('onRtl'), + option('onBottomLtr'), + option('onBottomRtl') + ]); }; var get$b = function (elem, info, defaultLtr, defaultRtl, defaultBottomLtr, defaultBottomRtl, dirElement) { - var isBottomToTop = dirElement.map(isBottomToTopDir).getOr(false); - var customLtr = info.layouts.map(function (ls) { - return ls.onLtr(elem); - }); - var customRtl = info.layouts.map(function (ls) { - return ls.onRtl(elem); - }); - var ltr = isBottomToTop ? info.layouts.bind(function (ls) { - return ls.onBottomLtr.map(function (f) { - return f(elem); - }); - }).or(customLtr).getOr(defaultBottomLtr) : customLtr.getOr(defaultLtr); - var rtl = isBottomToTop ? info.layouts.bind(function (ls) { - return ls.onBottomRtl.map(function (f) { - return f(elem); - }); - }).or(customRtl).getOr(defaultBottomRtl) : customRtl.getOr(defaultRtl); - var f = onDirection(ltr, rtl); - return f(elem); + var isBottomToTop = dirElement.map(isBottomToTopDir).getOr(false); + var customLtr = info.layouts.map(function (ls) { + return ls.onLtr(elem); + }); + var customRtl = info.layouts.map(function (ls) { + return ls.onRtl(elem); + }); + var ltr = isBottomToTop ? info.layouts.bind(function (ls) { + return ls.onBottomLtr.map(function (f) { + return f(elem); + }); + }).or(customLtr).getOr(defaultBottomLtr) : customLtr.getOr(defaultLtr); + var rtl = isBottomToTop ? info.layouts.bind(function (ls) { + return ls.onBottomRtl.map(function (f) { + return f(elem); + }); + }).or(customRtl).getOr(defaultBottomRtl) : customRtl.getOr(defaultRtl); + var f = onDirection(ltr, rtl); + return f(elem); }; var placement = function (component, anchorInfo, origin) { - var hotspot = anchorInfo.hotspot; - var anchorBox = toBox(origin, hotspot.element); - var layouts = get$b(component.element, anchorInfo, belowOrAbove(), belowOrAboveRtl(), aboveOrBelow(), aboveOrBelowRtl(), Optional.some(anchorInfo.hotspot.element)); - return Optional.some(nu$9({ - anchorBox: anchorBox, - bubble: anchorInfo.bubble.getOr(fallback()), - overrides: anchorInfo.overrides, - layouts: layouts, - placer: Optional.none() - })); + var hotspot = anchorInfo.hotspot; + var anchorBox = toBox(origin, hotspot.element); + var layouts = get$b(component.element, anchorInfo, belowOrAbove(), belowOrAboveRtl(), aboveOrBelow(), aboveOrBelowRtl(), Optional.some(anchorInfo.hotspot.element)); + return Optional.some(nu$9({ + anchorBox: anchorBox, + bubble: anchorInfo.bubble.getOr(fallback()), + overrides: anchorInfo.overrides, + layouts: layouts, + placer: Optional.none() + })); }; var HotspotAnchor = [ - strict$1('hotspot'), - option('bubble'), - defaulted$1('overrides', {}), - schema$1(), - output('placement', placement) + strict$1('hotspot'), + option('bubble'), + defaulted$1('overrides', {}), + schema$1(), + output('placement', placement) ]; var placement$1 = function (component, anchorInfo, origin) { - var pos = translate(origin, anchorInfo.x, anchorInfo.y); - var anchorBox = bounds$1(pos.left, pos.top, anchorInfo.width, anchorInfo.height); - var layouts = get$b(component.element, anchorInfo, all$2(), allRtl(), all$2(), allRtl(), Optional.none()); - return Optional.some(nu$9({ - anchorBox: anchorBox, - bubble: anchorInfo.bubble, - overrides: anchorInfo.overrides, - layouts: layouts, - placer: Optional.none() - })); + var pos = translate(origin, anchorInfo.x, anchorInfo.y); + var anchorBox = bounds$1(pos.left, pos.top, anchorInfo.width, anchorInfo.height); + var layouts = get$b(component.element, anchorInfo, all$2(), allRtl(), all$2(), allRtl(), Optional.none()); + return Optional.some(nu$9({ + anchorBox: anchorBox, + bubble: anchorInfo.bubble, + overrides: anchorInfo.overrides, + layouts: layouts, + placer: Optional.none() + })); }; var MakeshiftAnchor = [ - strict$1('x'), - strict$1('y'), - defaulted$1('height', 0), - defaulted$1('width', 0), - defaulted$1('bubble', fallback()), - defaulted$1('overrides', {}), - schema$1(), - output('placement', placement$1) + strict$1('x'), + strict$1('y'), + defaulted$1('height', 0), + defaulted$1('width', 0), + defaulted$1('bubble', fallback()), + defaulted$1('overrides', {}), + schema$1(), + output('placement', placement$1) ]; var zeroWidth = '\uFEFF'; var nbsp = '\xA0'; var create$2 = function (start, soffset, finish, foffset) { - return { - start: start, - soffset: soffset, - finish: finish, - foffset: foffset - }; + return { + start: start, + soffset: soffset, + finish: finish, + foffset: foffset + }; }; - var SimRange = {create: create$2}; + var SimRange = { create: create$2 }; var adt$5 = Adt.generate([ - {before: ['element']}, - { - on: [ - 'element', - 'offset' - ] - }, - {after: ['element']} + { before: ['element'] }, + { + on: [ + 'element', + 'offset' + ] + }, + { after: ['element'] } ]); var cata$2 = function (subject, onBefore, onOn, onAfter) { - return subject.fold(onBefore, onOn, onAfter); + return subject.fold(onBefore, onOn, onAfter); }; var getStart = function (situ) { - return situ.fold(identity, identity, identity); + return situ.fold(identity, identity, identity); }; var before$2 = adt$5.before; var on = adt$5.on; var after$1 = adt$5.after; var Situ = { - before: before$2, - on: on, - after: after$1, - cata: cata$2, - getStart: getStart + before: before$2, + on: on, + after: after$1, + cata: cata$2, + getStart: getStart }; var adt$6 = Adt.generate([ - {domRange: ['rng']}, - { - relative: [ - 'startSitu', - 'finishSitu' - ] - }, - { - exact: [ - 'start', - 'soffset', - 'finish', - 'foffset' - ] - } + { domRange: ['rng'] }, + { + relative: [ + 'startSitu', + 'finishSitu' + ] + }, + { + exact: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + } ]); var exactFromRange = function (simRange) { - return adt$6.exact(simRange.start, simRange.soffset, simRange.finish, simRange.foffset); + return adt$6.exact(simRange.start, simRange.soffset, simRange.finish, simRange.foffset); }; var getStart$1 = function (selection) { - return selection.match({ - domRange: function (rng) { - return SugarElement.fromDom(rng.startContainer); - }, - relative: function (startSitu, _finishSitu) { - return Situ.getStart(startSitu); - }, - exact: function (start, _soffset, _finish, _foffset) { - return start; - } - }); + return selection.match({ + domRange: function (rng) { + return SugarElement.fromDom(rng.startContainer); + }, + relative: function (startSitu, _finishSitu) { + return Situ.getStart(startSitu); + }, + exact: function (start, _soffset, _finish, _foffset) { + return start; + } + }); }; var domRange = adt$6.domRange; var relative$1 = adt$6.relative; var exact = adt$6.exact; var getWin = function (selection) { - var start = getStart$1(selection); - return defaultView(start); + var start = getStart$1(selection); + return defaultView(start); }; var range$1 = SimRange.create; var SimSelection = { - domRange: domRange, - relative: relative$1, - exact: exact, - exactFromRange: exactFromRange, - getWin: getWin, - range: range$1 + domRange: domRange, + relative: relative$1, + exact: exact, + exactFromRange: exactFromRange, + getWin: getWin, + range: range$1 }; var setStart = function (rng, situ) { - situ.fold(function (e) { - rng.setStartBefore(e.dom); - }, function (e, o) { - rng.setStart(e.dom, o); - }, function (e) { - rng.setStartAfter(e.dom); - }); + situ.fold(function (e) { + rng.setStartBefore(e.dom); + }, function (e, o) { + rng.setStart(e.dom, o); + }, function (e) { + rng.setStartAfter(e.dom); + }); }; var setFinish = function (rng, situ) { - situ.fold(function (e) { - rng.setEndBefore(e.dom); - }, function (e, o) { - rng.setEnd(e.dom, o); - }, function (e) { - rng.setEndAfter(e.dom); - }); + situ.fold(function (e) { + rng.setEndBefore(e.dom); + }, function (e, o) { + rng.setEnd(e.dom, o); + }, function (e) { + rng.setEndAfter(e.dom); + }); }; var relativeToNative = function (win, startSitu, finishSitu) { - var range = win.document.createRange(); - setStart(range, startSitu); - setFinish(range, finishSitu); - return range; + var range = win.document.createRange(); + setStart(range, startSitu); + setFinish(range, finishSitu); + return range; }; var exactToNative = function (win, start, soffset, finish, foffset) { - var rng = win.document.createRange(); - rng.setStart(start.dom, soffset); - rng.setEnd(finish.dom, foffset); - return rng; + var rng = win.document.createRange(); + rng.setStart(start.dom, soffset); + rng.setEnd(finish.dom, foffset); + return rng; }; var toRect = function (rect) { - return { - left: rect.left, - top: rect.top, - right: rect.right, - bottom: rect.bottom, - width: rect.width, - height: rect.height - }; + return { + left: rect.left, + top: rect.top, + right: rect.right, + bottom: rect.bottom, + width: rect.width, + height: rect.height + }; }; var getFirstRect = function (rng) { - var rects = rng.getClientRects(); - var rect = rects.length > 0 ? rects[0] : rng.getBoundingClientRect(); - return rect.width > 0 || rect.height > 0 ? Optional.some(rect).map(toRect) : Optional.none(); + var rects = rng.getClientRects(); + var rect = rects.length > 0 ? rects[0] : rng.getBoundingClientRect(); + return rect.width > 0 || rect.height > 0 ? Optional.some(rect).map(toRect) : Optional.none(); }; var adt$7 = Adt.generate([ - { - ltr: [ - 'start', - 'soffset', - 'finish', - 'foffset' - ] - }, - { - rtl: [ - 'start', - 'soffset', - 'finish', - 'foffset' - ] - } + { + ltr: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + }, + { + rtl: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + } ]); var fromRange = function (win, type, range) { - return type(SugarElement.fromDom(range.startContainer), range.startOffset, SugarElement.fromDom(range.endContainer), range.endOffset); + return type(SugarElement.fromDom(range.startContainer), range.startOffset, SugarElement.fromDom(range.endContainer), range.endOffset); }; var getRanges = function (win, selection) { - return selection.match({ - domRange: function (rng) { - return { - ltr: constant(rng), - rtl: Optional.none - }; - }, - relative: function (startSitu, finishSitu) { - return { - ltr: cached(function () { - return relativeToNative(win, startSitu, finishSitu); - }), - rtl: cached(function () { - return Optional.some(relativeToNative(win, finishSitu, startSitu)); - }) - }; - }, - exact: function (start, soffset, finish, foffset) { - return { - ltr: cached(function () { - return exactToNative(win, start, soffset, finish, foffset); - }), - rtl: cached(function () { - return Optional.some(exactToNative(win, finish, foffset, start, soffset)); - }) - }; - } - }); + return selection.match({ + domRange: function (rng) { + return { + ltr: constant(rng), + rtl: Optional.none + }; + }, + relative: function (startSitu, finishSitu) { + return { + ltr: cached(function () { + return relativeToNative(win, startSitu, finishSitu); + }), + rtl: cached(function () { + return Optional.some(relativeToNative(win, finishSitu, startSitu)); + }) + }; + }, + exact: function (start, soffset, finish, foffset) { + return { + ltr: cached(function () { + return exactToNative(win, start, soffset, finish, foffset); + }), + rtl: cached(function () { + return Optional.some(exactToNative(win, finish, foffset, start, soffset)); + }) + }; + } + }); }; var doDiagnose = function (win, ranges) { - var rng = ranges.ltr(); - if (rng.collapsed) { - var reversed = ranges.rtl().filter(function (rev) { - return rev.collapsed === false; - }); - return reversed.map(function (rev) { - return adt$7.rtl(SugarElement.fromDom(rev.endContainer), rev.endOffset, SugarElement.fromDom(rev.startContainer), rev.startOffset); - }).getOrThunk(function () { - return fromRange(win, adt$7.ltr, rng); - }); - } else { - return fromRange(win, adt$7.ltr, rng); - } + var rng = ranges.ltr(); + if (rng.collapsed) { + var reversed = ranges.rtl().filter(function (rev) { + return rev.collapsed === false; + }); + return reversed.map(function (rev) { + return adt$7.rtl(SugarElement.fromDom(rev.endContainer), rev.endOffset, SugarElement.fromDom(rev.startContainer), rev.startOffset); + }).getOrThunk(function () { + return fromRange(win, adt$7.ltr, rng); + }); + } else { + return fromRange(win, adt$7.ltr, rng); + } }; var diagnose = function (win, selection) { - var ranges = getRanges(win, selection); - return doDiagnose(win, ranges); + var ranges = getRanges(win, selection); + return doDiagnose(win, ranges); }; var asLtrRange = function (win, selection) { - var diagnosis = diagnose(win, selection); - return diagnosis.match({ - ltr: function (start, soffset, finish, foffset) { - var rng = win.document.createRange(); - rng.setStart(start.dom, soffset); - rng.setEnd(finish.dom, foffset); - return rng; - }, - rtl: function (start, soffset, finish, foffset) { - var rng = win.document.createRange(); - rng.setStart(finish.dom, foffset); - rng.setEnd(start.dom, soffset); - return rng; - } - }); + var diagnosis = diagnose(win, selection); + return diagnosis.match({ + ltr: function (start, soffset, finish, foffset) { + var rng = win.document.createRange(); + rng.setStart(start.dom, soffset); + rng.setEnd(finish.dom, foffset); + return rng; + }, + rtl: function (start, soffset, finish, foffset) { + var rng = win.document.createRange(); + rng.setStart(finish.dom, foffset); + rng.setEnd(start.dom, soffset); + return rng; + } + }); }; var ltr = adt$7.ltr; var rtl = adt$7.rtl; - function NodeValue(is, name) { - var get = function (element) { - if (!is(element)) { - throw new Error('Can only get ' + name + ' value of a ' + name + ' node'); - } - return getOption(element).getOr(''); - }; - var getOption = function (element) { - return is(element) ? Optional.from(element.dom.nodeValue) : Optional.none(); - }; - var set = function (element, value) { - if (!is(element)) { - throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node'); - } - element.dom.nodeValue = value; - }; - return { - get: get, - getOption: getOption, - set: set - }; + function NodeValue (is, name) { + var get = function (element) { + if (!is(element)) { + throw new Error('Can only get ' + name + ' value of a ' + name + ' node'); + } + return getOption(element).getOr(''); + }; + var getOption = function (element) { + return is(element) ? Optional.from(element.dom.nodeValue) : Optional.none(); + }; + var set = function (element, value) { + if (!is(element)) { + throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node'); + } + element.dom.nodeValue = value; + }; + return { + get: get, + getOption: getOption, + set: set + }; } var api$2 = NodeValue(isText, 'text'); var get$c = function (element) { - return api$2.get(element); + return api$2.get(element); }; var getOption = function (element) { - return api$2.getOption(element); + return api$2.getOption(element); }; var getEnd = function (element) { - return name(element) === 'img' ? 1 : getOption(element).fold(function () { - return children(element).length; - }, function (v) { - return v.length; - }); + return name(element) === 'img' ? 1 : getOption(element).fold(function () { + return children(element).length; + }, function (v) { + return v.length; + }); }; var isTextNodeWithCursorPosition = function (el) { - return getOption(el).filter(function (text) { - return text.trim().length !== 0 || text.indexOf(nbsp) > -1; - }).isSome(); + return getOption(el).filter(function (text) { + return text.trim().length !== 0 || text.indexOf(nbsp) > -1; + }).isSome(); }; var elementsWithCursorPosition = [ - 'img', - 'br' + 'img', + 'br' ]; var isCursorPosition = function (elem) { - var hasCursorPosition = isTextNodeWithCursorPosition(elem); - return hasCursorPosition || contains(elementsWithCursorPosition, name(elem)); + var hasCursorPosition = isTextNodeWithCursorPosition(elem); + return hasCursorPosition || contains(elementsWithCursorPosition, name(elem)); }; var last$1 = function (element) { - return descendantRtl(element, isCursorPosition); + return descendantRtl(element, isCursorPosition); }; var descendantRtl = function (scope, predicate) { - var descend = function (element) { - var children$1 = children(element); - for (var i = children$1.length - 1; i >= 0; i--) { - var child = children$1[i]; - if (predicate(child)) { - return Optional.some(child); - } - var res = descend(child); - if (res.isSome()) { - return res; - } - } - return Optional.none(); - }; - return descend(scope); + var descend = function (element) { + var children$1 = children(element); + for (var i = children$1.length - 1; i >= 0; i--) { + var child = children$1[i]; + if (predicate(child)) { + return Optional.some(child); + } + var res = descend(child); + if (res.isSome()) { + return res; + } + } + return Optional.none(); + }; + return descend(scope); }; var descendants = function (scope, selector) { - return all(selector, scope); + return all(selector, scope); }; var makeRange = function (start, soffset, finish, foffset) { - var doc = owner(start); - var rng = doc.dom.createRange(); - rng.setStart(start.dom, soffset); - rng.setEnd(finish.dom, foffset); - return rng; + var doc = owner(start); + var rng = doc.dom.createRange(); + rng.setStart(start.dom, soffset); + rng.setEnd(finish.dom, foffset); + return rng; }; var after$2 = function (start, soffset, finish, foffset) { - var r = makeRange(start, soffset, finish, foffset); - var same = eq$1(start, finish) && soffset === foffset; - return r.collapsed && !same; + var r = makeRange(start, soffset, finish, foffset); + var same = eq$1(start, finish) && soffset === foffset; + return r.collapsed && !same; }; var getNativeSelection = function (win) { - return Optional.from(win.getSelection()); + return Optional.from(win.getSelection()); }; var readRange = function (selection) { - if (selection.rangeCount > 0) { - var firstRng = selection.getRangeAt(0); - var lastRng = selection.getRangeAt(selection.rangeCount - 1); - return Optional.some(SimRange.create(SugarElement.fromDom(firstRng.startContainer), firstRng.startOffset, SugarElement.fromDom(lastRng.endContainer), lastRng.endOffset)); - } else { - return Optional.none(); - } + if (selection.rangeCount > 0) { + var firstRng = selection.getRangeAt(0); + var lastRng = selection.getRangeAt(selection.rangeCount - 1); + return Optional.some(SimRange.create(SugarElement.fromDom(firstRng.startContainer), firstRng.startOffset, SugarElement.fromDom(lastRng.endContainer), lastRng.endOffset)); + } else { + return Optional.none(); + } }; var doGetExact = function (selection) { - if (selection.anchorNode === null || selection.focusNode === null) { - return readRange(selection); - } else { - var anchor = SugarElement.fromDom(selection.anchorNode); - var focus_1 = SugarElement.fromDom(selection.focusNode); - return after$2(anchor, selection.anchorOffset, focus_1, selection.focusOffset) ? Optional.some(SimRange.create(anchor, selection.anchorOffset, focus_1, selection.focusOffset)) : readRange(selection); - } + if (selection.anchorNode === null || selection.focusNode === null) { + return readRange(selection); + } else { + var anchor = SugarElement.fromDom(selection.anchorNode); + var focus_1 = SugarElement.fromDom(selection.focusNode); + return after$2(anchor, selection.anchorOffset, focus_1, selection.focusOffset) ? Optional.some(SimRange.create(anchor, selection.anchorOffset, focus_1, selection.focusOffset)) : readRange(selection); + } }; var getExact = function (win) { - return getNativeSelection(win).filter(function (sel) { - return sel.rangeCount > 0; - }).bind(doGetExact); + return getNativeSelection(win).filter(function (sel) { + return sel.rangeCount > 0; + }).bind(doGetExact); }; var getFirstRect$1 = function (win, selection) { - var rng = asLtrRange(win, selection); - return getFirstRect(rng); + var rng = asLtrRange(win, selection); + return getFirstRect(rng); }; var point = function (element, offset) { - return { - element: element, - offset: offset - }; + return { + element: element, + offset: offset + }; }; var descendOnce = function (element, offset) { - var children$1 = children(element); - if (children$1.length === 0) { - return point(element, offset); - } else if (offset < children$1.length) { - return point(children$1[offset], 0); - } else { - var last = children$1[children$1.length - 1]; - var len = isText(last) ? get$c(last).length : children(last).length; - return point(last, len); - } + var children$1 = children(element); + if (children$1.length === 0) { + return point(element, offset); + } else if (offset < children$1.length) { + return point(children$1[offset], 0); + } else { + var last = children$1[children$1.length - 1]; + var len = isText(last) ? get$c(last).length : children(last).length; + return point(last, len); + } }; var adt$8 = Adt.generate([ - {screen: ['point']}, - { - absolute: [ - 'point', - 'scrollLeft', - 'scrollTop' - ] - } + { screen: ['point'] }, + { + absolute: [ + 'point', + 'scrollLeft', + 'scrollTop' + ] + } ]); var toFixed = function (pos) { - return pos.fold(identity, function (point, scrollLeft, scrollTop) { - return point.translate(-scrollLeft, -scrollTop); - }); + return pos.fold(identity, function (point, scrollLeft, scrollTop) { + return point.translate(-scrollLeft, -scrollTop); + }); }; var toAbsolute = function (pos) { - return pos.fold(identity, identity); + return pos.fold(identity, identity); }; var sum = function (points) { - return foldl(points, function (b, a) { - return b.translate(a.left, a.top); - }, SugarPosition(0, 0)); + return foldl(points, function (b, a) { + return b.translate(a.left, a.top); + }, SugarPosition(0, 0)); }; var sumAsFixed = function (positions) { - var points = map(positions, toFixed); - return sum(points); + var points = map(positions, toFixed); + return sum(points); }; var sumAsAbsolute = function (positions) { - var points = map(positions, toAbsolute); - return sum(points); + var points = map(positions, toAbsolute); + return sum(points); }; var screen = adt$8.screen; var absolute$2 = adt$8.absolute; var getOffset = function (component, origin, anchorInfo) { - var win = defaultView(anchorInfo.root).dom; - var hasSameOwner = function (frame) { - var frameOwner = owner(frame); - var compOwner = owner(component.element); - return eq$1(frameOwner, compOwner); - }; - return Optional.from(win.frameElement).map(SugarElement.fromDom).filter(hasSameOwner).map(absolute); + var win = defaultView(anchorInfo.root).dom; + var hasSameOwner = function (frame) { + var frameOwner = owner(frame); + var compOwner = owner(component.element); + return eq$1(frameOwner, compOwner); + }; + return Optional.from(win.frameElement).map(SugarElement.fromDom).filter(hasSameOwner).map(absolute); }; var getRootPoint = function (component, origin, anchorInfo) { - var doc = owner(component.element); - var outerScroll = get$9(doc); - var offset = getOffset(component, origin, anchorInfo).getOr(outerScroll); - return absolute$2(offset, outerScroll.left, outerScroll.top); + var doc = owner(component.element); + var outerScroll = get$9(doc); + var offset = getOffset(component, origin, anchorInfo).getOr(outerScroll); + return absolute$2(offset, outerScroll.left, outerScroll.top); }; var capRect = function (left, top, width, height) { - var newLeft = left, newTop = top, newWidth = width, newHeight = height; - if (left < 0) { - newLeft = 0; - newWidth = width + left; - } - if (top < 0) { - newTop = 0; - newHeight = height + top; - } - var point = screen(SugarPosition(newLeft, newTop)); - return Optional.some(pointed(point, newWidth, newHeight)); + var newLeft = left, newTop = top, newWidth = width, newHeight = height; + if (left < 0) { + newLeft = 0; + newWidth = width + left; + } + if (top < 0) { + newTop = 0; + newHeight = height + top; + } + var point = screen(SugarPosition(newLeft, newTop)); + return Optional.some(pointed(point, newWidth, newHeight)); }; var calcNewAnchor = function (optBox, rootPoint, anchorInfo, origin, elem) { - return optBox.map(function (box) { - var points = [ - rootPoint, - box.point - ]; - var topLeft = cata$1(origin, function () { - return sumAsAbsolute(points); - }, function () { - return sumAsAbsolute(points); - }, function () { - return sumAsFixed(points); - }); - var anchorBox = rect(topLeft.left, topLeft.top, box.width, box.height); - var layoutsLtr = anchorInfo.showAbove ? aboveOrBelow() : belowOrAbove(); - var layoutsRtl = anchorInfo.showAbove ? aboveOrBelowRtl() : belowOrAboveRtl(); - var layouts = get$b(elem, anchorInfo, layoutsLtr, layoutsRtl, layoutsLtr, layoutsRtl, Optional.none()); - return nu$9({ - anchorBox: anchorBox, - bubble: anchorInfo.bubble.getOr(fallback()), - overrides: anchorInfo.overrides, - layouts: layouts, - placer: Optional.none() - }); + return optBox.map(function (box) { + var points = [ + rootPoint, + box.point + ]; + var topLeft = cata$1(origin, function () { + return sumAsAbsolute(points); + }, function () { + return sumAsAbsolute(points); + }, function () { + return sumAsFixed(points); + }); + var anchorBox = rect(topLeft.left, topLeft.top, box.width, box.height); + var layoutsLtr = anchorInfo.showAbove ? aboveOrBelow() : belowOrAbove(); + var layoutsRtl = anchorInfo.showAbove ? aboveOrBelowRtl() : belowOrAboveRtl(); + var layouts = get$b(elem, anchorInfo, layoutsLtr, layoutsRtl, layoutsLtr, layoutsRtl, Optional.none()); + return nu$9({ + anchorBox: anchorBox, + bubble: anchorInfo.bubble.getOr(fallback()), + overrides: anchorInfo.overrides, + layouts: layouts, + placer: Optional.none() }); + }); }; var descendOnce$1 = function (element, offset) { - return isText(element) ? point(element, offset) : descendOnce(element, offset); + return isText(element) ? point(element, offset) : descendOnce(element, offset); }; var getAnchorSelection = function (win, anchorInfo) { - var getSelection = anchorInfo.getSelection.getOrThunk(function () { - return function () { - return getExact(win); - }; - }); - return getSelection().map(function (sel) { - var modStart = descendOnce$1(sel.start, sel.soffset); - var modFinish = descendOnce$1(sel.finish, sel.foffset); - return SimSelection.range(modStart.element, modStart.offset, modFinish.element, modFinish.offset); - }); + var getSelection = anchorInfo.getSelection.getOrThunk(function () { + return function () { + return getExact(win); + }; + }); + return getSelection().map(function (sel) { + var modStart = descendOnce$1(sel.start, sel.soffset); + var modFinish = descendOnce$1(sel.finish, sel.foffset); + return SimSelection.range(modStart.element, modStart.offset, modFinish.element, modFinish.offset); + }); }; var placement$2 = function (component, anchorInfo, origin) { - var win = defaultView(anchorInfo.root).dom; - var rootPoint = getRootPoint(component, origin, anchorInfo); - var selectionBox = getAnchorSelection(win, anchorInfo).bind(function (sel) { - var optRect = getFirstRect$1(win, SimSelection.exactFromRange(sel)).orThunk(function () { - var x = SugarElement.fromText(zeroWidth); - before(sel.start, x); - return getFirstRect$1(win, SimSelection.exact(x, 0, x, 1)).map(function (rect) { - remove(x); - return rect; - }); - }); - return optRect.bind(function (rawRect) { - return capRect(rawRect.left, rawRect.top, rawRect.width, rawRect.height); - }); - }); - var targetElement = getAnchorSelection(win, anchorInfo).bind(function (sel) { - return isElement(sel.start) ? Optional.some(sel.start) : parentNode(sel.start); - }); - var elem = targetElement.getOr(component.element); - return calcNewAnchor(selectionBox, rootPoint, anchorInfo, origin, elem); + var win = defaultView(anchorInfo.root).dom; + var rootPoint = getRootPoint(component, origin, anchorInfo); + var selectionBox = getAnchorSelection(win, anchorInfo).bind(function (sel) { + var optRect = getFirstRect$1(win, SimSelection.exactFromRange(sel)).orThunk(function () { + var x = SugarElement.fromText(zeroWidth); + before(sel.start, x); + return getFirstRect$1(win, SimSelection.exact(x, 0, x, 1)).map(function (rect) { + remove(x); + return rect; + }); + }); + return optRect.bind(function (rawRect) { + return capRect(rawRect.left, rawRect.top, rawRect.width, rawRect.height); + }); + }); + var targetElement = getAnchorSelection(win, anchorInfo).bind(function (sel) { + return isElement(sel.start) ? Optional.some(sel.start) : parentNode(sel.start); + }); + var elem = targetElement.getOr(component.element); + return calcNewAnchor(selectionBox, rootPoint, anchorInfo, origin, elem); }; var SelectionAnchor = [ - option('getSelection'), - strict$1('root'), - option('bubble'), - schema$1(), - defaulted$1('overrides', {}), - defaulted$1('showAbove', false), - output('placement', placement$2) + option('getSelection'), + strict$1('root'), + option('bubble'), + schema$1(), + defaulted$1('overrides', {}), + defaulted$1('showAbove', false), + output('placement', placement$2) ]; var placement$3 = function (component, anchorInfo, origin) { - var rootPoint = getRootPoint(component, origin, anchorInfo); - return anchorInfo.node.bind(function (target) { - var rect = target.dom.getBoundingClientRect(); - var nodeBox = capRect(rect.left, rect.top, rect.width, rect.height); - var elem = anchorInfo.node.getOr(component.element); - return calcNewAnchor(nodeBox, rootPoint, anchorInfo, origin, elem); - }); + var rootPoint = getRootPoint(component, origin, anchorInfo); + return anchorInfo.node.bind(function (target) { + var rect = target.dom.getBoundingClientRect(); + var nodeBox = capRect(rect.left, rect.top, rect.width, rect.height); + var elem = anchorInfo.node.getOr(component.element); + return calcNewAnchor(nodeBox, rootPoint, anchorInfo, origin, elem); + }); }; var NodeAnchor = [ - strict$1('node'), - strict$1('root'), - option('bubble'), - schema$1(), - defaulted$1('overrides', {}), - defaulted$1('showAbove', false), - output('placement', placement$3) + strict$1('node'), + strict$1('root'), + option('bubble'), + schema$1(), + defaulted$1('overrides', {}), + defaulted$1('showAbove', false), + output('placement', placement$3) ]; var eastX$1 = function (anchor) { - return anchor.x + anchor.width; + return anchor.x + anchor.width; }; var westX$1 = function (anchor, element) { - return anchor.x - element.width; + return anchor.x - element.width; }; var northY$1 = function (anchor, element) { - return anchor.y - element.height + anchor.height; + return anchor.y - element.height + anchor.height; }; var southY$1 = function (anchor) { - return anchor.y; + return anchor.y; }; var southeast$2 = function (anchor, element, bubbles) { - return nu$7(eastX$1(anchor), southY$1(anchor), bubbles.southeast(), southeast(), boundsRestriction(anchor, { - left: 0, - top: 2 - }), 'link-layout-se'); + return nu$7(eastX$1(anchor), southY$1(anchor), bubbles.southeast(), southeast(), boundsRestriction(anchor, { + left: 0, + top: 2 + }), 'link-layout-se'); }; var southwest$2 = function (anchor, element, bubbles) { - return nu$7(westX$1(anchor, element), southY$1(anchor), bubbles.southwest(), southwest(), boundsRestriction(anchor, { - right: 1, - top: 2 - }), 'link-layout-sw'); + return nu$7(westX$1(anchor, element), southY$1(anchor), bubbles.southwest(), southwest(), boundsRestriction(anchor, { + right: 1, + top: 2 + }), 'link-layout-sw'); }; var northeast$2 = function (anchor, element, bubbles) { - return nu$7(eastX$1(anchor), northY$1(anchor, element), bubbles.northeast(), northeast(), boundsRestriction(anchor, { - left: 0, - bottom: 3 - }), 'link-layout-ne'); + return nu$7(eastX$1(anchor), northY$1(anchor, element), bubbles.northeast(), northeast(), boundsRestriction(anchor, { + left: 0, + bottom: 3 + }), 'link-layout-ne'); }; var northwest$2 = function (anchor, element, bubbles) { - return nu$7(westX$1(anchor, element), northY$1(anchor, element), bubbles.northwest(), northwest(), boundsRestriction(anchor, { - right: 1, - bottom: 3 - }), 'link-layout-nw'); + return nu$7(westX$1(anchor, element), northY$1(anchor, element), bubbles.northwest(), northwest(), boundsRestriction(anchor, { + right: 1, + bottom: 3 + }), 'link-layout-nw'); }; var all$3 = function () { - return [ - southeast$2, - southwest$2, - northeast$2, - northwest$2 - ]; + return [ + southeast$2, + southwest$2, + northeast$2, + northwest$2 + ]; }; var allRtl$1 = function () { - return [ - southwest$2, - southeast$2, - northwest$2, - northeast$2 - ]; + return [ + southwest$2, + southeast$2, + northwest$2, + northeast$2 + ]; }; var placement$4 = function (component, submenuInfo, origin) { - var anchorBox = toBox(origin, submenuInfo.item.element); - var layouts = get$b(component.element, submenuInfo, all$3(), allRtl$1(), all$3(), allRtl$1(), Optional.none()); - return Optional.some(nu$9({ - anchorBox: anchorBox, - bubble: fallback(), - overrides: submenuInfo.overrides, - layouts: layouts, - placer: Optional.none() - })); + var anchorBox = toBox(origin, submenuInfo.item.element); + var layouts = get$b(component.element, submenuInfo, all$3(), allRtl$1(), all$3(), allRtl$1(), Optional.none()); + return Optional.some(nu$9({ + anchorBox: anchorBox, + bubble: fallback(), + overrides: submenuInfo.overrides, + layouts: layouts, + placer: Optional.none() + })); }; var SubmenuAnchor = [ - strict$1('item'), - schema$1(), - defaulted$1('overrides', {}), - output('placement', placement$4) + strict$1('item'), + schema$1(), + defaulted$1('overrides', {}), + output('placement', placement$4) ]; var AnchorSchema = choose$1('anchor', { - selection: SelectionAnchor, - node: NodeAnchor, - hotspot: HotspotAnchor, - submenu: SubmenuAnchor, - makeshift: MakeshiftAnchor + selection: SelectionAnchor, + node: NodeAnchor, + hotspot: HotspotAnchor, + submenu: SubmenuAnchor, + makeshift: MakeshiftAnchor }); var getFixedOrigin = function () { - var html = document.documentElement; - return fixed(0, 0, html.clientWidth, html.clientHeight); + var html = document.documentElement; + return fixed(0, 0, html.clientWidth, html.clientHeight); }; var getRelativeOrigin = function (component) { - var position = absolute(component.element); - var bounds = component.element.dom.getBoundingClientRect(); - return relative(position.left, position.top, bounds.width, bounds.height); + var position = absolute(component.element); + var bounds = component.element.dom.getBoundingClientRect(); + return relative(position.left, position.top, bounds.width, bounds.height); }; var place = function (component, origin, anchoring, getBounds, placee) { - var anchor = box$1(anchoring.anchorBox, origin); - simple(anchor, placee.element, anchoring.bubble, anchoring.layouts, getBounds, anchoring.overrides); + var anchor = box$1(anchoring.anchorBox, origin); + simple(anchor, placee.element, anchoring.bubble, anchoring.layouts, getBounds, anchoring.overrides); }; var position$1 = function (component, posConfig, posState, anchor, placee) { - positionWithin(component, posConfig, posState, anchor, placee, Optional.none()); + positionWithin(component, posConfig, posState, anchor, placee, Optional.none()); }; var positionWithin = function (component, posConfig, posState, anchor, placee, boxElement) { - var boundsBox = boxElement.map(box); - return positionWithinBounds(component, posConfig, posState, anchor, placee, boundsBox); + var boundsBox = boxElement.map(box); + return positionWithinBounds(component, posConfig, posState, anchor, placee, boundsBox); }; var positionWithinBounds = function (component, posConfig, posState, anchor, placee, bounds) { - var anchorage = asRawOrDie('positioning anchor.info', AnchorSchema, anchor); - preserve(function () { - set$2(placee.element, 'position', 'fixed'); - var oldVisibility = getRaw(placee.element, 'visibility'); - set$2(placee.element, 'visibility', 'hidden'); - var origin = posConfig.useFixed() ? getFixedOrigin() : getRelativeOrigin(component); - var placer = anchorage.placement; - var getBounds = bounds.map(constant).or(posConfig.getBounds); - placer(component, anchorage, origin).each(function (anchoring) { - var doPlace = anchoring.placer.getOr(place); - doPlace(component, origin, anchoring, getBounds, placee); - }); - oldVisibility.fold(function () { - remove$6(placee.element, 'visibility'); - }, function (vis) { - set$2(placee.element, 'visibility', vis); - }); - if (getRaw(placee.element, 'left').isNone() && getRaw(placee.element, 'top').isNone() && getRaw(placee.element, 'right').isNone() && getRaw(placee.element, 'bottom').isNone() && getRaw(placee.element, 'position').is('fixed')) { - remove$6(placee.element, 'position'); - } - }, placee.element); + var anchorage = asRawOrDie('positioning anchor.info', AnchorSchema, anchor); + preserve(function () { + set$2(placee.element, 'position', 'fixed'); + var oldVisibility = getRaw(placee.element, 'visibility'); + set$2(placee.element, 'visibility', 'hidden'); + var origin = posConfig.useFixed() ? getFixedOrigin() : getRelativeOrigin(component); + var placer = anchorage.placement; + var getBounds = bounds.map(constant).or(posConfig.getBounds); + placer(component, anchorage, origin).each(function (anchoring) { + var doPlace = anchoring.placer.getOr(place); + doPlace(component, origin, anchoring, getBounds, placee); + }); + oldVisibility.fold(function () { + remove$6(placee.element, 'visibility'); + }, function (vis) { + set$2(placee.element, 'visibility', vis); + }); + if (getRaw(placee.element, 'left').isNone() && getRaw(placee.element, 'top').isNone() && getRaw(placee.element, 'right').isNone() && getRaw(placee.element, 'bottom').isNone() && getRaw(placee.element, 'position').is('fixed')) { + remove$6(placee.element, 'position'); + } + }, placee.element); }; var getMode = function (component, pConfig, _pState) { - return pConfig.useFixed() ? 'fixed' : 'absolute'; + return pConfig.useFixed() ? 'fixed' : 'absolute'; }; var PositionApis = /*#__PURE__*/Object.freeze({ @@ -5438,192 +5432,192 @@ }); var PositionSchema = [ - defaulted$1('useFixed', never), - option('getBounds') + defaulted$1('useFixed', never), + option('getBounds') ]; var Positioning = create$1({ - fields: PositionSchema, - name: 'positioning', - active: ActivePosition, - apis: PositionApis + fields: PositionSchema, + name: 'positioning', + active: ActivePosition, + apis: PositionApis }); var fireDetaching = function (component) { - emit(component, detachedFromDom()); - var children = component.components(); - each(children, fireDetaching); + emit(component, detachedFromDom()); + var children = component.components(); + each(children, fireDetaching); }; var fireAttaching = function (component) { - var children = component.components(); - each(children, fireAttaching); - emit(component, attachedToDom()); + var children = component.components(); + each(children, fireAttaching); + emit(component, attachedToDom()); }; var attach = function (parent, child) { - append(parent.element, child.element); + append(parent.element, child.element); }; var detachChildren = function (component) { - each(component.components(), function (childComp) { - return remove(childComp.element); - }); - empty(component.element); - component.syncComponents(); + each(component.components(), function (childComp) { + return remove(childComp.element); + }); + empty(component.element); + component.syncComponents(); }; var replaceChildren = function (component, newChildren) { - var subs = component.components(); - detachChildren(component); - var deleted = difference(subs, newChildren); - each(deleted, function (comp) { - fireDetaching(comp); - component.getSystem().removeFromWorld(comp); - }); - each(newChildren, function (childComp) { - if (!childComp.getSystem().isConnected()) { - component.getSystem().addToWorld(childComp); - attach(component, childComp); - if (inBody(component.element)) { - fireAttaching(childComp); - } - } else { - attach(component, childComp); - } - component.syncComponents(); - }); + var subs = component.components(); + detachChildren(component); + var deleted = difference(subs, newChildren); + each(deleted, function (comp) { + fireDetaching(comp); + component.getSystem().removeFromWorld(comp); + }); + each(newChildren, function (childComp) { + if (!childComp.getSystem().isConnected()) { + component.getSystem().addToWorld(childComp); + attach(component, childComp); + if (inBody(component.element)) { + fireAttaching(childComp); + } + } else { + attach(component, childComp); + } + component.syncComponents(); + }); }; var attach$1 = function (parent, child) { - attachWith(parent, child, append); + attachWith(parent, child, append); }; var attachWith = function (parent, child, insertion) { - parent.getSystem().addToWorld(child); - insertion(parent.element, child.element); - if (inBody(parent.element)) { - fireAttaching(child); - } - parent.syncComponents(); + parent.getSystem().addToWorld(child); + insertion(parent.element, child.element); + if (inBody(parent.element)) { + fireAttaching(child); + } + parent.syncComponents(); }; var doDetach = function (component) { - fireDetaching(component); - remove(component.element); - component.getSystem().removeFromWorld(component); + fireDetaching(component); + remove(component.element); + component.getSystem().removeFromWorld(component); }; var detach = function (component) { - var parent$1 = parent(component.element).bind(function (p) { - return component.getSystem().getByDom(p).toOptional(); - }); - doDetach(component); - parent$1.each(function (p) { - p.syncComponents(); - }); + var parent$1 = parent(component.element).bind(function (p) { + return component.getSystem().getByDom(p).toOptional(); + }); + doDetach(component); + parent$1.each(function (p) { + p.syncComponents(); + }); }; var detachChildren$1 = function (component) { - var subs = component.components(); - each(subs, doDetach); - empty(component.element); - component.syncComponents(); + var subs = component.components(); + each(subs, doDetach); + empty(component.element); + component.syncComponents(); }; var attachSystem = function (element, guiSystem) { - attachSystemWith(element, guiSystem, append); + attachSystemWith(element, guiSystem, append); }; var attachSystemAfter = function (element, guiSystem) { - attachSystemWith(element, guiSystem, after); + attachSystemWith(element, guiSystem, after); }; var attachSystemWith = function (element, guiSystem, inserter) { - inserter(element, guiSystem.element); - var children$1 = children(guiSystem.element); - each(children$1, function (child) { - guiSystem.getByDom(child).each(fireAttaching); - }); + inserter(element, guiSystem.element); + var children$1 = children(guiSystem.element); + each(children$1, function (child) { + guiSystem.getByDom(child).each(fireAttaching); + }); }; var detachSystem = function (guiSystem) { - var children$1 = children(guiSystem.element); - each(children$1, function (child) { - guiSystem.getByDom(child).each(fireDetaching); - }); - remove(guiSystem.element); + var children$1 = children(guiSystem.element); + each(children$1, function (child) { + guiSystem.getByDom(child).each(fireDetaching); + }); + remove(guiSystem.element); }; var rebuild = function (sandbox, sConfig, sState, data) { - sState.get().each(function (_data) { - detachChildren$1(sandbox); - }); - var point = sConfig.getAttachPoint(sandbox); - attach$1(point, sandbox); - var built = sandbox.getSystem().build(data); - attach$1(sandbox, built); - sState.set(built); - return built; + sState.get().each(function (_data) { + detachChildren$1(sandbox); + }); + var point = sConfig.getAttachPoint(sandbox); + attach$1(point, sandbox); + var built = sandbox.getSystem().build(data); + attach$1(sandbox, built); + sState.set(built); + return built; }; var open = function (sandbox, sConfig, sState, data) { - var newState = rebuild(sandbox, sConfig, sState, data); - sConfig.onOpen(sandbox, newState); - return newState; + var newState = rebuild(sandbox, sConfig, sState, data); + sConfig.onOpen(sandbox, newState); + return newState; }; var setContent = function (sandbox, sConfig, sState, data) { - return sState.get().map(function () { - return rebuild(sandbox, sConfig, sState, data); - }); + return sState.get().map(function () { + return rebuild(sandbox, sConfig, sState, data); + }); }; var openWhileCloaked = function (sandbox, sConfig, sState, data, transaction) { - cloak(sandbox, sConfig); - open(sandbox, sConfig, sState, data); - transaction(); - decloak(sandbox, sConfig); + cloak(sandbox, sConfig); + open(sandbox, sConfig, sState, data); + transaction(); + decloak(sandbox, sConfig); }; var close = function (sandbox, sConfig, sState) { - sState.get().each(function (data) { - detachChildren$1(sandbox); - detach(sandbox); - sConfig.onClose(sandbox, data); - sState.clear(); - }); + sState.get().each(function (data) { + detachChildren$1(sandbox); + detach(sandbox); + sConfig.onClose(sandbox, data); + sState.clear(); + }); }; var isOpen = function (_sandbox, _sConfig, sState) { - return sState.isOpen(); + return sState.isOpen(); }; var isPartOf$1 = function (sandbox, sConfig, sState, queryElem) { - return isOpen(sandbox, sConfig, sState) && sState.get().exists(function (data) { - return sConfig.isPartOf(sandbox, data, queryElem); - }); + return isOpen(sandbox, sConfig, sState) && sState.get().exists(function (data) { + return sConfig.isPartOf(sandbox, data, queryElem); + }); }; var getState = function (_sandbox, _sConfig, sState) { - return sState.get(); + return sState.get(); }; var store = function (sandbox, cssKey, attr, newValue) { - getRaw(sandbox.element, cssKey).fold(function () { - remove$1(sandbox.element, attr); - }, function (v) { - set$1(sandbox.element, attr, v); - }); - set$2(sandbox.element, cssKey, newValue); + getRaw(sandbox.element, cssKey).fold(function () { + remove$1(sandbox.element, attr); + }, function (v) { + set$1(sandbox.element, attr, v); + }); + set$2(sandbox.element, cssKey, newValue); }; var restore = function (sandbox, cssKey, attr) { - getOpt(sandbox.element, attr).fold(function () { - return remove$6(sandbox.element, cssKey); - }, function (oldValue) { - return set$2(sandbox.element, cssKey, oldValue); - }); + getOpt(sandbox.element, attr).fold(function () { + return remove$6(sandbox.element, cssKey); + }, function (oldValue) { + return set$2(sandbox.element, cssKey, oldValue); + }); }; var cloak = function (sandbox, sConfig, _sState) { - var sink = sConfig.getAttachPoint(sandbox); - set$2(sandbox.element, 'position', Positioning.getMode(sink)); - store(sandbox, 'visibility', sConfig.cloakVisibilityAttr, 'hidden'); + var sink = sConfig.getAttachPoint(sandbox); + set$2(sandbox.element, 'position', Positioning.getMode(sink)); + store(sandbox, 'visibility', sConfig.cloakVisibilityAttr, 'hidden'); }; var hasPosition = function (element) { - return exists([ - 'top', - 'left', - 'right', - 'bottom' - ], function (pos) { - return getRaw(element, pos).isSome(); - }); + return exists([ + 'top', + 'left', + 'right', + 'bottom' + ], function (pos) { + return getRaw(element, pos).isSome(); + }); }; var decloak = function (sandbox, sConfig, _sState) { - if (!hasPosition(sandbox.element)) { - remove$6(sandbox.element, 'position'); - } - restore(sandbox, 'visibility', sConfig.cloakVisibilityAttr); + if (!hasPosition(sandbox.element)) { + remove$6(sandbox.element, 'position'); + } + restore(sandbox, 'visibility', sConfig.cloakVisibilityAttr); }; var SandboxApis = /*#__PURE__*/Object.freeze({ @@ -5640,8 +5634,8 @@ }); var events$2 = function (sandboxConfig, sandboxState) { - return derive([run(sandboxClose(), function (sandbox, _simulatedEvent) { - close(sandbox, sandboxConfig, sandboxState); + return derive([run(sandboxClose(), function (sandbox, _simulatedEvent) { + close(sandbox, sandboxConfig, sandboxState); })]); }; @@ -5651,35 +5645,35 @@ }); var SandboxSchema = [ - onHandler('onOpen'), - onHandler('onClose'), - strict$1('isPartOf'), - strict$1('getAttachPoint'), - defaulted$1('cloakVisibilityAttr', 'data-precloak-visibility') + onHandler('onOpen'), + onHandler('onClose'), + strict$1('isPartOf'), + strict$1('getAttachPoint'), + defaulted$1('cloakVisibilityAttr', 'data-precloak-visibility') ]; var init = function () { - var contents = Cell(Optional.none()); - var readState = constant('not-implemented'); - var isOpen = function () { - return contents.get().isSome(); - }; - var set = function (comp) { - contents.set(Optional.some(comp)); - }; - var get = function () { - return contents.get(); - }; - var clear = function () { - contents.set(Optional.none()); - }; - return nu$5({ - readState: readState, - isOpen: isOpen, - clear: clear, - set: set, - get: get - }); + var contents = Cell(Optional.none()); + var readState = constant('not-implemented'); + var isOpen = function () { + return contents.get().isSome(); + }; + var set = function (comp) { + contents.set(Optional.some(comp)); + }; + var get = function () { + return contents.get(); + }; + var clear = function () { + contents.set(Optional.none()); + }; + return nu$5({ + readState: readState, + isOpen: isOpen, + clear: clear, + set: set, + get: get + }); }; var SandboxState = /*#__PURE__*/Object.freeze({ @@ -5688,11 +5682,11 @@ }); var Sandboxing = create$1({ - fields: SandboxSchema, - name: 'sandboxing', - active: ActiveSandbox, - apis: SandboxApis, - state: SandboxState + fields: SandboxSchema, + name: 'sandboxing', + active: ActiveSandbox, + apis: SandboxApis, + state: SandboxState }); var dismissPopups = constant('dismiss.popups'); @@ -5700,63 +5694,63 @@ var mouseReleased = constant('mouse.released'); var schema$2 = objOfOnly([ - defaulted$1('isExtraPart', never), - optionObjOf('fireEventInstead', [defaulted$1('event', dismissRequested())]) + defaulted$1('isExtraPart', never), + optionObjOf('fireEventInstead', [defaulted$1('event', dismissRequested())]) ]); var receivingChannel = function (rawSpec) { - var _a; - var detail = asRawOrDie('Dismissal', schema$2, rawSpec); - return _a = {}, _a[dismissPopups()] = { - schema: objOfOnly([strict$1('target')]), - onReceive: function (sandbox, data) { - if (Sandboxing.isOpen(sandbox)) { - var isPart = Sandboxing.isPartOf(sandbox, data.target) || detail.isExtraPart(sandbox, data.target); - if (!isPart) { - detail.fireEventInstead.fold(function () { - return Sandboxing.close(sandbox); - }, function (fe) { - return emit(sandbox, fe.event); - }); - } - } + var _a; + var detail = asRawOrDie('Dismissal', schema$2, rawSpec); + return _a = {}, _a[dismissPopups()] = { + schema: objOfOnly([strict$1('target')]), + onReceive: function (sandbox, data) { + if (Sandboxing.isOpen(sandbox)) { + var isPart = Sandboxing.isPartOf(sandbox, data.target) || detail.isExtraPart(sandbox, data.target); + if (!isPart) { + detail.fireEventInstead.fold(function () { + return Sandboxing.close(sandbox); + }, function (fe) { + return emit(sandbox, fe.event); + }); } - }, _a; + } + } + }, _a; }; var schema$3 = objOfOnly([ - optionObjOf('fireEventInstead', [defaulted$1('event', repositionRequested())]), - strictFunction('doReposition') + optionObjOf('fireEventInstead', [defaulted$1('event', repositionRequested())]), + strictFunction('doReposition') ]); var receivingChannel$1 = function (rawSpec) { - var _a; - var detail = asRawOrDie('Reposition', schema$3, rawSpec); - return _a = {}, _a[repositionPopups()] = { - onReceive: function (sandbox) { - if (Sandboxing.isOpen(sandbox)) { - detail.fireEventInstead.fold(function () { - return detail.doReposition(sandbox); - }, function (fe) { - return emit(sandbox, fe.event); - }); - } - } - }, _a; + var _a; + var detail = asRawOrDie('Reposition', schema$3, rawSpec); + return _a = {}, _a[repositionPopups()] = { + onReceive: function (sandbox) { + if (Sandboxing.isOpen(sandbox)) { + detail.fireEventInstead.fold(function () { + return detail.doReposition(sandbox); + }, function (fe) { + return emit(sandbox, fe.event); + }); + } + } + }, _a; }; var onLoad = function (component, repConfig, repState) { - repConfig.store.manager.onLoad(component, repConfig, repState); + repConfig.store.manager.onLoad(component, repConfig, repState); }; var onUnload = function (component, repConfig, repState) { - repConfig.store.manager.onUnload(component, repConfig, repState); + repConfig.store.manager.onUnload(component, repConfig, repState); }; var setValue = function (component, repConfig, repState, data) { - repConfig.store.manager.setValue(component, repConfig, repState, data); + repConfig.store.manager.setValue(component, repConfig, repState, data); }; var getValue = function (component, repConfig, repState) { - return repConfig.store.manager.getValue(component, repConfig, repState); + return repConfig.store.manager.getValue(component, repConfig, repState); }; var getState$1 = function (component, repConfig, repState) { - return repState; + return repState; }; var RepresentApis = /*#__PURE__*/Object.freeze({ @@ -5769,15 +5763,15 @@ }); var events$3 = function (repConfig, repState) { - var es = repConfig.resetOnDom ? [ - runOnAttached(function (comp, _se) { - onLoad(comp, repConfig, repState); - }), - runOnDetached(function (comp, _se) { - onUnload(comp, repConfig, repState); - }) - ] : [loadEvent(repConfig, repState, onLoad)]; - return derive(es); + var es = repConfig.resetOnDom ? [ + runOnAttached(function (comp, _se) { + onLoad(comp, repConfig, repState); + }), + runOnDetached(function (comp, _se) { + onUnload(comp, repConfig, repState); + }) + ] : [loadEvent(repConfig, repState, onLoad)]; + return derive(es); }; var ActiveRepresenting = /*#__PURE__*/Object.freeze({ @@ -5786,76 +5780,76 @@ }); var memory = function () { - var data = Cell(null); - var readState = function () { - return { - mode: 'memory', - value: data.get() - }; - }; - var isNotSet = function () { - return data.get() === null; - }; - var clear = function () { - data.set(null); - }; - return nu$5({ - set: data.set, - get: data.get, - isNotSet: isNotSet, - clear: clear, - readState: readState - }); + var data = Cell(null); + var readState = function () { + return { + mode: 'memory', + value: data.get() + }; + }; + var isNotSet = function () { + return data.get() === null; + }; + var clear = function () { + data.set(null); + }; + return nu$5({ + set: data.set, + get: data.get, + isNotSet: isNotSet, + clear: clear, + readState: readState + }); }; var manual = function () { - var readState = function () { - }; - return nu$5({readState: readState}); + var readState = function () { + }; + return nu$5({ readState: readState }); }; var dataset = function () { - var dataByValue = Cell({}); - var dataByText = Cell({}); - var readState = function () { - return { - mode: 'dataset', - dataByValue: dataByValue.get(), - dataByText: dataByText.get() - }; - }; - var clear = function () { - dataByValue.set({}); - dataByText.set({}); - }; - var lookup = function (itemString) { - return get$1(dataByValue.get(), itemString).orThunk(function () { - return get$1(dataByText.get(), itemString); - }); - }; - var update = function (items) { - var currentDataByValue = dataByValue.get(); - var currentDataByText = dataByText.get(); - var newDataByValue = {}; - var newDataByText = {}; - each(items, function (item) { - newDataByValue[item.value] = item; - get$1(item, 'meta').each(function (meta) { - get$1(meta, 'text').each(function (text) { - newDataByText[text] = item; - }); - }); - }); - dataByValue.set(__assign(__assign({}, currentDataByValue), newDataByValue)); - dataByText.set(__assign(__assign({}, currentDataByText), newDataByText)); - }; - return nu$5({ - readState: readState, - lookup: lookup, - update: update, - clear: clear - }); + var dataByValue = Cell({}); + var dataByText = Cell({}); + var readState = function () { + return { + mode: 'dataset', + dataByValue: dataByValue.get(), + dataByText: dataByText.get() + }; + }; + var clear = function () { + dataByValue.set({}); + dataByText.set({}); + }; + var lookup = function (itemString) { + return get$1(dataByValue.get(), itemString).orThunk(function () { + return get$1(dataByText.get(), itemString); + }); + }; + var update = function (items) { + var currentDataByValue = dataByValue.get(); + var currentDataByText = dataByText.get(); + var newDataByValue = {}; + var newDataByText = {}; + each(items, function (item) { + newDataByValue[item.value] = item; + get$1(item, 'meta').each(function (meta) { + get$1(meta, 'text').each(function (text) { + newDataByText[text] = item; + }); + }); + }); + dataByValue.set(__assign(__assign({}, currentDataByValue), newDataByValue)); + dataByText.set(__assign(__assign({}, currentDataByText), newDataByText)); + }; + return nu$5({ + readState: readState, + lookup: lookup, + update: update, + clear: clear + }); }; var init$1 = function (spec) { - return spec.store.manager.state(spec); + return spec.store.manager.state(spec); }; var RepresentState = /*#__PURE__*/Object.freeze({ @@ -5867,306 +5861,306 @@ }); var setValue$1 = function (component, repConfig, repState, data) { - var store = repConfig.store; - repState.update([data]); - store.setValue(component, data); - repConfig.onSetValue(component, data); + var store = repConfig.store; + repState.update([data]); + store.setValue(component, data); + repConfig.onSetValue(component, data); }; var getValue$1 = function (component, repConfig, repState) { - var store = repConfig.store; - var key = store.getDataKey(component); - return repState.lookup(key).fold(function () { - return store.getFallbackEntry(key); - }, function (data) { - return data; - }); + var store = repConfig.store; + var key = store.getDataKey(component); + return repState.lookup(key).fold(function () { + return store.getFallbackEntry(key); + }, function (data) { + return data; + }); }; var onLoad$1 = function (component, repConfig, repState) { - var store = repConfig.store; - store.initialValue.each(function (data) { - setValue$1(component, repConfig, repState, data); - }); + var store = repConfig.store; + store.initialValue.each(function (data) { + setValue$1(component, repConfig, repState, data); + }); }; var onUnload$1 = function (component, repConfig, repState) { - repState.clear(); + repState.clear(); }; var DatasetStore = [ - option('initialValue'), - strict$1('getFallbackEntry'), - strict$1('getDataKey'), - strict$1('setValue'), - output('manager', { - setValue: setValue$1, - getValue: getValue$1, - onLoad: onLoad$1, - onUnload: onUnload$1, - state: dataset - }) + option('initialValue'), + strict$1('getFallbackEntry'), + strict$1('getDataKey'), + strict$1('setValue'), + output('manager', { + setValue: setValue$1, + getValue: getValue$1, + onLoad: onLoad$1, + onUnload: onUnload$1, + state: dataset + }) ]; var getValue$2 = function (component, repConfig, _repState) { - return repConfig.store.getValue(component); + return repConfig.store.getValue(component); }; var setValue$2 = function (component, repConfig, _repState, data) { - repConfig.store.setValue(component, data); - repConfig.onSetValue(component, data); + repConfig.store.setValue(component, data); + repConfig.onSetValue(component, data); }; var onLoad$2 = function (component, repConfig, _repState) { - repConfig.store.initialValue.each(function (data) { - repConfig.store.setValue(component, data); - }); + repConfig.store.initialValue.each(function (data) { + repConfig.store.setValue(component, data); + }); }; var ManualStore = [ - strict$1('getValue'), - defaulted$1('setValue', noop), - option('initialValue'), - output('manager', { - setValue: setValue$2, - getValue: getValue$2, - onLoad: onLoad$2, - onUnload: noop, - state: NoState.init - }) + strict$1('getValue'), + defaulted$1('setValue', noop), + option('initialValue'), + output('manager', { + setValue: setValue$2, + getValue: getValue$2, + onLoad: onLoad$2, + onUnload: noop, + state: NoState.init + }) ]; var setValue$3 = function (component, repConfig, repState, data) { - repState.set(data); - repConfig.onSetValue(component, data); + repState.set(data); + repConfig.onSetValue(component, data); }; var getValue$3 = function (component, repConfig, repState) { - return repState.get(); + return repState.get(); }; var onLoad$3 = function (component, repConfig, repState) { - repConfig.store.initialValue.each(function (initVal) { - if (repState.isNotSet()) { - repState.set(initVal); - } - }); + repConfig.store.initialValue.each(function (initVal) { + if (repState.isNotSet()) { + repState.set(initVal); + } + }); }; var onUnload$2 = function (component, repConfig, repState) { - repState.clear(); + repState.clear(); }; var MemoryStore = [ - option('initialValue'), - output('manager', { - setValue: setValue$3, - getValue: getValue$3, - onLoad: onLoad$3, - onUnload: onUnload$2, - state: memory - }) + option('initialValue'), + output('manager', { + setValue: setValue$3, + getValue: getValue$3, + onLoad: onLoad$3, + onUnload: onUnload$2, + state: memory + }) ]; var RepresentSchema = [ - defaultedOf('store', {mode: 'memory'}, choose$1('mode', { - memory: MemoryStore, - manual: ManualStore, - dataset: DatasetStore - })), - onHandler('onSetValue'), - defaulted$1('resetOnDom', false) + defaultedOf('store', { mode: 'memory' }, choose$1('mode', { + memory: MemoryStore, + manual: ManualStore, + dataset: DatasetStore + })), + onHandler('onSetValue'), + defaulted$1('resetOnDom', false) ]; var Representing = create$1({ - fields: RepresentSchema, - name: 'representing', - active: ActiveRepresenting, - apis: RepresentApis, - extra: { - setValueFrom: function (component, source) { - var value = Representing.getValue(source); - Representing.setValue(component, value); - } - }, - state: RepresentState + fields: RepresentSchema, + name: 'representing', + active: ActiveRepresenting, + apis: RepresentApis, + extra: { + setValueFrom: function (component, source) { + var value = Representing.getValue(source); + Representing.setValue(component, value); + } + }, + state: RepresentState }); var field$1 = function (name, forbidden) { - return defaultedObjOf(name, {}, map(forbidden, function (f) { - return forbid(f.name(), 'Cannot configure ' + f.name() + ' for ' + name); - }).concat([state$1('dump', identity)])); + return defaultedObjOf(name, {}, map(forbidden, function (f) { + return forbid(f.name(), 'Cannot configure ' + f.name() + ' for ' + name); + }).concat([state$1('dump', identity)])); }; var get$d = function (data) { - return data.dump; + return data.dump; }; var augment = function (data, original) { - return __assign(__assign({}, data.dump), derive$1(original)); + return __assign(__assign({}, data.dump), derive$1(original)); }; var SketchBehaviours = { - field: field$1, - augment: augment, - get: get$d + field: field$1, + augment: augment, + get: get$d }; var _placeholder = 'placeholder'; var adt$9 = Adt.generate([ - { - single: [ - 'required', - 'valueThunk' - ] - }, - { - multiple: [ - 'required', - 'valueThunks' - ] - } + { + single: [ + 'required', + 'valueThunk' + ] + }, + { + multiple: [ + 'required', + 'valueThunks' + ] + } ]); var isSubstituted = function (spec) { - return has(spec, 'uiType'); + return has(spec, 'uiType'); }; var subPlaceholder = function (owner, detail, compSpec, placeholders) { - if (owner.exists(function (o) { - return o !== compSpec.owner; + if (owner.exists(function (o) { + return o !== compSpec.owner; })) { - return adt$9.single(true, constant(compSpec)); - } - return get$1(placeholders, compSpec.name).fold(function () { - throw new Error('Unknown placeholder component: ' + compSpec.name + '\nKnown: [' + keys(placeholders) + ']\nNamespace: ' + owner.getOr('none') + '\nSpec: ' + JSON.stringify(compSpec, null, 2)); - }, function (newSpec) { - return newSpec.replace(); - }); + return adt$9.single(true, constant(compSpec)); + } + return get$1(placeholders, compSpec.name).fold(function () { + throw new Error('Unknown placeholder component: ' + compSpec.name + '\nKnown: [' + keys(placeholders) + ']\nNamespace: ' + owner.getOr('none') + '\nSpec: ' + JSON.stringify(compSpec, null, 2)); + }, function (newSpec) { + return newSpec.replace(); + }); }; var scan = function (owner, detail, compSpec, placeholders) { - if (isSubstituted(compSpec) && compSpec.uiType === _placeholder) { - return subPlaceholder(owner, detail, compSpec, placeholders); - } else { - return adt$9.single(false, constant(compSpec)); - } + if (isSubstituted(compSpec) && compSpec.uiType === _placeholder) { + return subPlaceholder(owner, detail, compSpec, placeholders); + } else { + return adt$9.single(false, constant(compSpec)); + } }; var substitute = function (owner, detail, compSpec, placeholders) { - var base = scan(owner, detail, compSpec, placeholders); - return base.fold(function (req, valueThunk) { - var value = isSubstituted(compSpec) ? valueThunk(detail, compSpec.config, compSpec.validated) : valueThunk(detail); - var childSpecs = get$1(value, 'components').getOr([]); - var substituted = bind(childSpecs, function (c) { - return substitute(owner, detail, c, placeholders); - }); - return [__assign(__assign({}, value), {components: substituted})]; - }, function (req, valuesThunk) { - if (isSubstituted(compSpec)) { - var values = valuesThunk(detail, compSpec.config, compSpec.validated); - var preprocessor = compSpec.validated.preprocess.getOr(identity); - return preprocessor(values); - } else { - return valuesThunk(detail); - } - }); + var base = scan(owner, detail, compSpec, placeholders); + return base.fold(function (req, valueThunk) { + var value = isSubstituted(compSpec) ? valueThunk(detail, compSpec.config, compSpec.validated) : valueThunk(detail); + var childSpecs = get$1(value, 'components').getOr([]); + var substituted = bind(childSpecs, function (c) { + return substitute(owner, detail, c, placeholders); + }); + return [__assign(__assign({}, value), { components: substituted })]; + }, function (req, valuesThunk) { + if (isSubstituted(compSpec)) { + var values = valuesThunk(detail, compSpec.config, compSpec.validated); + var preprocessor = compSpec.validated.preprocess.getOr(identity); + return preprocessor(values); + } else { + return valuesThunk(detail); + } + }); }; var substituteAll = function (owner, detail, components, placeholders) { - return bind(components, function (c) { - return substitute(owner, detail, c, placeholders); - }); + return bind(components, function (c) { + return substitute(owner, detail, c, placeholders); + }); }; var oneReplace = function (label, replacements) { - var called = false; - var used = function () { - return called; - }; - var replace = function () { - if (called) { - throw new Error('Trying to use the same placeholder more than once: ' + label); - } - called = true; - return replacements; - }; - var required = function () { - return replacements.fold(function (req, _) { - return req; - }, function (req, _) { - return req; - }); - }; - return { - name: constant(label), - required: required, - used: used, - replace: replace - }; + var called = false; + var used = function () { + return called; + }; + var replace = function () { + if (called) { + throw new Error('Trying to use the same placeholder more than once: ' + label); + } + called = true; + return replacements; + }; + var required = function () { + return replacements.fold(function (req, _) { + return req; + }, function (req, _) { + return req; + }); + }; + return { + name: constant(label), + required: required, + used: used, + replace: replace + }; }; var substitutePlaces = function (owner, detail, components, placeholders) { - var ps = map$2(placeholders, function (ph, name) { - return oneReplace(name, ph); - }); - var outcome = substituteAll(owner, detail, components, ps); - each$1(ps, function (p) { - if (p.used() === false && p.required()) { - throw new Error('Placeholder: ' + p.name() + ' was not found in components list\nNamespace: ' + owner.getOr('none') + '\nComponents: ' + JSON.stringify(detail.components, null, 2)); - } - }); - return outcome; + var ps = map$2(placeholders, function (ph, name) { + return oneReplace(name, ph); + }); + var outcome = substituteAll(owner, detail, components, ps); + each$1(ps, function (p) { + if (p.used() === false && p.required()) { + throw new Error('Placeholder: ' + p.name() + ' was not found in components list\nNamespace: ' + owner.getOr('none') + '\nComponents: ' + JSON.stringify(detail.components, null, 2)); + } + }); + return outcome; }; var single = adt$9.single; var multiple = adt$9.multiple; var placeholder = constant(_placeholder); var adt$a = Adt.generate([ - {required: ['data']}, - {external: ['data']}, - {optional: ['data']}, - {group: ['data']} + { required: ['data'] }, + { external: ['data'] }, + { optional: ['data'] }, + { group: ['data'] } ]); - var fFactory = defaulted$1('factory', {sketch: identity}); + var fFactory = defaulted$1('factory', { sketch: identity }); var fSchema = defaulted$1('schema', []); var fName = strict$1('name'); var fPname = field('pname', 'pname', defaultedThunk(function (typeSpec) { - return ''; + return ''; }), anyValue$1()); var fGroupSchema = state$1('schema', function () { - return [option('preprocess')]; + return [option('preprocess')]; }); var fDefaults = defaulted$1('defaults', constant({})); var fOverrides = defaulted$1('overrides', constant({})); var requiredSpec = objOf([ - fFactory, - fSchema, - fName, - fPname, - fDefaults, - fOverrides + fFactory, + fSchema, + fName, + fPname, + fDefaults, + fOverrides ]); var externalSpec = objOf([ - fFactory, - fSchema, - fName, - fDefaults, - fOverrides + fFactory, + fSchema, + fName, + fDefaults, + fOverrides ]); var optionalSpec = objOf([ - fFactory, - fSchema, - fName, - fPname, - fDefaults, - fOverrides + fFactory, + fSchema, + fName, + fPname, + fDefaults, + fOverrides ]); var groupSpec = objOf([ - fFactory, - fGroupSchema, - fName, - strict$1('unit'), - fPname, - fDefaults, - fOverrides + fFactory, + fGroupSchema, + fName, + strict$1('unit'), + fPname, + fDefaults, + fOverrides ]); var asNamedPart = function (part) { - return part.fold(Optional.some, Optional.none, Optional.some, Optional.some); + return part.fold(Optional.some, Optional.none, Optional.some, Optional.some); }; var name$1 = function (part) { - var get = function (data) { - return data.name; - }; - return part.fold(get, get, get, get); + var get = function (data) { + return data.name; + }; + return part.fold(get, get, get, get); }; var asCommon = function (part) { - return part.fold(identity, identity, identity, identity); + return part.fold(identity, identity, identity, identity); }; var convert = function (adtConstructor, partSchema) { - return function (spec) { - var data = asRawOrDie('Converting part type', partSchema, spec); - return adtConstructor(data); - }; + return function (spec) { + var data = asRawOrDie('Converting part type', partSchema, spec); + return adtConstructor(data); + }; }; var required = convert(adt$a.required, requiredSpec); var external$1 = convert(adt$a.external, externalSpec); @@ -6187,133 +6181,133 @@ }); var combine$2 = function (detail, data, partSpec, partValidated) { - return deepMerge(data.defaults(detail, partSpec, partValidated), partSpec, {uid: detail.partUids[data.name]}, data.overrides(detail, partSpec, partValidated)); + return deepMerge(data.defaults(detail, partSpec, partValidated), partSpec, { uid: detail.partUids[data.name] }, data.overrides(detail, partSpec, partValidated)); }; var subs = function (owner, detail, parts) { - var internals = {}; - var externals = {}; - each(parts, function (part) { - part.fold(function (data) { - internals[data.pname] = single(true, function (detail, partSpec, partValidated) { - return data.factory.sketch(combine$2(detail, data, partSpec, partValidated)); - }); - }, function (data) { - var partSpec = detail.parts[data.name]; - externals[data.name] = constant(data.factory.sketch(combine$2(detail, data, partSpec[original()]), partSpec)); - }, function (data) { - internals[data.pname] = single(false, function (detail, partSpec, partValidated) { - return data.factory.sketch(combine$2(detail, data, partSpec, partValidated)); - }); - }, function (data) { - internals[data.pname] = multiple(true, function (detail, _partSpec, _partValidated) { - var units = detail[data.name]; - return map(units, function (u) { - return data.factory.sketch(deepMerge(data.defaults(detail, u, _partValidated), u, data.overrides(detail, u))); - }); - }); + var internals = {}; + var externals = {}; + each(parts, function (part) { + part.fold(function (data) { + internals[data.pname] = single(true, function (detail, partSpec, partValidated) { + return data.factory.sketch(combine$2(detail, data, partSpec, partValidated)); + }); + }, function (data) { + var partSpec = detail.parts[data.name]; + externals[data.name] = constant(data.factory.sketch(combine$2(detail, data, partSpec[original()]), partSpec)); + }, function (data) { + internals[data.pname] = single(false, function (detail, partSpec, partValidated) { + return data.factory.sketch(combine$2(detail, data, partSpec, partValidated)); + }); + }, function (data) { + internals[data.pname] = multiple(true, function (detail, _partSpec, _partValidated) { + var units = detail[data.name]; + return map(units, function (u) { + return data.factory.sketch(deepMerge(data.defaults(detail, u, _partValidated), u, data.overrides(detail, u))); }); + }); }); - return { - internals: constant(internals), - externals: constant(externals) - }; + }); + return { + internals: constant(internals), + externals: constant(externals) + }; }; var generate$4 = function (owner, parts) { - var r = {}; - each(parts, function (part) { - asNamedPart(part).each(function (np) { - var g = doGenerateOne(owner, np.pname); - r[np.name] = function (config) { - var validated = asRawOrDie('Part: ' + np.name + ' in ' + owner, objOf(np.schema), config); - return __assign(__assign({}, g), { - config: config, - validated: validated - }); - }; + var r = {}; + each(parts, function (part) { + asNamedPart(part).each(function (np) { + var g = doGenerateOne(owner, np.pname); + r[np.name] = function (config) { + var validated = asRawOrDie('Part: ' + np.name + ' in ' + owner, objOf(np.schema), config); + return __assign(__assign({}, g), { + config: config, + validated: validated }); + }; }); - return r; + }); + return r; }; var doGenerateOne = function (owner, pname) { - return { - uiType: placeholder(), - owner: owner, - name: pname - }; + return { + uiType: placeholder(), + owner: owner, + name: pname + }; }; var generateOne = function (owner, pname, config) { - return { - uiType: placeholder(), - owner: owner, - name: pname, - config: config, - validated: {} - }; + return { + uiType: placeholder(), + owner: owner, + name: pname, + config: config, + validated: {} + }; }; var schemas = function (parts) { - return bind(parts, function (part) { - return part.fold(Optional.none, Optional.some, Optional.none, Optional.none).map(function (data) { - return strictObjOf(data.name, data.schema.concat([snapshot(original())])); - }).toArray(); - }); + return bind(parts, function (part) { + return part.fold(Optional.none, Optional.some, Optional.none, Optional.none).map(function (data) { + return strictObjOf(data.name, data.schema.concat([snapshot(original())])); + }).toArray(); + }); }; var names = function (parts) { - return map(parts, name$1); + return map(parts, name$1); }; var substitutes = function (owner, detail, parts) { - return subs(owner, detail, parts); + return subs(owner, detail, parts); }; var components = function (owner, detail, internals) { - return substitutePlaces(Optional.some(owner), detail, detail.components, internals); + return substitutePlaces(Optional.some(owner), detail, detail.components, internals); }; var getPart = function (component, detail, partKey) { - var uid = detail.partUids[partKey]; - return component.getSystem().getByUid(uid).toOptional(); + var uid = detail.partUids[partKey]; + return component.getSystem().getByUid(uid).toOptional(); }; var getPartOrDie = function (component, detail, partKey) { - return getPart(component, detail, partKey).getOrDie('Could not find part: ' + partKey); + return getPart(component, detail, partKey).getOrDie('Could not find part: ' + partKey); }; var getParts = function (component, detail, partKeys) { - var r = {}; - var uids = detail.partUids; - var system = component.getSystem(); - each(partKeys, function (pk) { - r[pk] = constant(system.getByUid(uids[pk])); - }); - return r; + var r = {}; + var uids = detail.partUids; + var system = component.getSystem(); + each(partKeys, function (pk) { + r[pk] = constant(system.getByUid(uids[pk])); + }); + return r; }; var getAllParts = function (component, detail) { - var system = component.getSystem(); - return map$2(detail.partUids, function (pUid, _k) { - return constant(system.getByUid(pUid)); - }); + var system = component.getSystem(); + return map$2(detail.partUids, function (pUid, _k) { + return constant(system.getByUid(pUid)); + }); }; var getAllPartNames = function (detail) { - return keys(detail.partUids); + return keys(detail.partUids); }; var getPartsOrDie = function (component, detail, partKeys) { - var r = {}; - var uids = detail.partUids; - var system = component.getSystem(); - each(partKeys, function (pk) { - r[pk] = constant(system.getByUid(uids[pk]).getOrDie()); - }); - return r; + var r = {}; + var uids = detail.partUids; + var system = component.getSystem(); + each(partKeys, function (pk) { + r[pk] = constant(system.getByUid(uids[pk]).getOrDie()); + }); + return r; }; var defaultUids = function (baseUid, partTypes) { - var partNames = names(partTypes); - return wrapAll$1(map(partNames, function (pn) { - return { - key: pn, - value: baseUid + '-' + pn - }; - })); + var partNames = names(partTypes); + return wrapAll$1(map(partNames, function (pn) { + return { + key: pn, + value: baseUid + '-' + pn + }; + })); }; var defaultUidsSchema = function (partTypes) { - return field('partUids', 'partUids', mergeWithThunk(function (spec) { - return defaultUids(spec.uid, partTypes); - }), anyValue$1()); + return field('partUids', 'partUids', mergeWithThunk(function (spec) { + return defaultUids(spec.uid, partTypes); + }), anyValue$1()); }; var AlloyParts = /*#__PURE__*/Object.freeze({ @@ -6335,135 +6329,134 @@ }); var base = function (partSchemas, partUidsSchemas) { - var ps = partSchemas.length > 0 ? [strictObjOf('parts', partSchemas)] : []; - return ps.concat([ - strict$1('uid'), - defaulted$1('dom', {}), - defaulted$1('components', []), - snapshot('originalSpec'), - defaulted$1('debug.sketcher', {}) - ]).concat(partUidsSchemas); + var ps = partSchemas.length > 0 ? [strictObjOf('parts', partSchemas)] : []; + return ps.concat([ + strict$1('uid'), + defaulted$1('dom', {}), + defaulted$1('components', []), + snapshot('originalSpec'), + defaulted$1('debug.sketcher', {}) + ]).concat(partUidsSchemas); }; var asRawOrDie$1 = function (label, schema, spec, partSchemas, partUidsSchemas) { - var baseS = base(partSchemas, partUidsSchemas); - return asRawOrDie(label + ' [SpecSchema]', objOfOnly(baseS.concat(schema)), spec); + var baseS = base(partSchemas, partUidsSchemas); + return asRawOrDie(label + ' [SpecSchema]', objOfOnly(baseS.concat(schema)), spec); }; var single$1 = function (owner, schema, factory, spec) { - var specWithUid = supplyUid(spec); - var detail = asRawOrDie$1(owner, schema, specWithUid, [], []); - return factory(detail, specWithUid); + var specWithUid = supplyUid(spec); + var detail = asRawOrDie$1(owner, schema, specWithUid, [], []); + return factory(detail, specWithUid); }; var composite = function (owner, schema, partTypes, factory, spec) { - var specWithUid = supplyUid(spec); - var partSchemas = schemas(partTypes); - var partUidsSchema = defaultUidsSchema(partTypes); - var detail = asRawOrDie$1(owner, schema, specWithUid, partSchemas, [partUidsSchema]); - var subs = substitutes(owner, detail, partTypes); - var components$1 = components(owner, detail, subs.internals()); - return factory(detail, components$1, specWithUid, subs.externals()); + var specWithUid = supplyUid(spec); + var partSchemas = schemas(partTypes); + var partUidsSchema = defaultUidsSchema(partTypes); + var detail = asRawOrDie$1(owner, schema, specWithUid, partSchemas, [partUidsSchema]); + var subs = substitutes(owner, detail, partTypes); + var components$1 = components(owner, detail, subs.internals()); + return factory(detail, components$1, specWithUid, subs.externals()); }; var hasUid = function (spec) { - return has(spec, 'uid'); + return has(spec, 'uid'); }; var supplyUid = function (spec) { - return hasUid(spec) ? spec : __assign(__assign({}, spec), {uid: generate$2('uid')}); + return hasUid(spec) ? spec : __assign(__assign({}, spec), { uid: generate$2('uid') }); }; function isSketchSpec(spec) { - return spec.uid !== undefined; + return spec.uid !== undefined; } - var singleSchema = objOfOnly([ - strict$1('name'), - strict$1('factory'), - strict$1('configFields'), - defaulted$1('apis', {}), - defaulted$1('extraApis', {}) + strict$1('name'), + strict$1('factory'), + strict$1('configFields'), + defaulted$1('apis', {}), + defaulted$1('extraApis', {}) ]); var compositeSchema = objOfOnly([ - strict$1('name'), - strict$1('factory'), - strict$1('configFields'), - strict$1('partFields'), - defaulted$1('apis', {}), - defaulted$1('extraApis', {}) + strict$1('name'), + strict$1('factory'), + strict$1('configFields'), + strict$1('partFields'), + defaulted$1('apis', {}), + defaulted$1('extraApis', {}) ]); var single$2 = function (rawConfig) { - var config = asRawOrDie('Sketcher for ' + rawConfig.name, singleSchema, rawConfig); - var sketch = function (spec) { - return single$1(config.name, config.configFields, config.factory, spec); - }; - var apis = map$2(config.apis, makeApi); - var extraApis = map$2(config.extraApis, function (f, k) { - return markAsExtraApi(f, k); - }); - return __assign(__assign({ - name: config.name, - configFields: config.configFields, - sketch: sketch - }, apis), extraApis); + var config = asRawOrDie('Sketcher for ' + rawConfig.name, singleSchema, rawConfig); + var sketch = function (spec) { + return single$1(config.name, config.configFields, config.factory, spec); + }; + var apis = map$2(config.apis, makeApi); + var extraApis = map$2(config.extraApis, function (f, k) { + return markAsExtraApi(f, k); + }); + return __assign(__assign({ + name: config.name, + configFields: config.configFields, + sketch: sketch + }, apis), extraApis); }; var composite$1 = function (rawConfig) { - var config = asRawOrDie('Sketcher for ' + rawConfig.name, compositeSchema, rawConfig); - var sketch = function (spec) { - return composite(config.name, config.configFields, config.partFields, config.factory, spec); - }; - var parts = generate$4(config.name, config.partFields); - var apis = map$2(config.apis, makeApi); - var extraApis = map$2(config.extraApis, function (f, k) { - return markAsExtraApi(f, k); - }); - return __assign(__assign({ - name: config.name, - partFields: config.partFields, - configFields: config.configFields, - sketch: sketch, - parts: parts - }, apis), extraApis); + var config = asRawOrDie('Sketcher for ' + rawConfig.name, compositeSchema, rawConfig); + var sketch = function (spec) { + return composite(config.name, config.configFields, config.partFields, config.factory, spec); + }; + var parts = generate$4(config.name, config.partFields); + var apis = map$2(config.apis, makeApi); + var extraApis = map$2(config.extraApis, function (f, k) { + return markAsExtraApi(f, k); + }); + return __assign(__assign({ + name: config.name, + partFields: config.partFields, + configFields: config.configFields, + sketch: sketch, + parts: parts + }, apis), extraApis); }; var cat = function (arr) { - var r = []; - var push = function (x) { - r.push(x); - }; - for (var i = 0; i < arr.length; i++) { - arr[i].each(push); - } - return r; + var r = []; + var push = function (x) { + r.push(x); + }; + for (var i = 0; i < arr.length; i++) { + arr[i].each(push); + } + return r; }; var sequence = function (arr) { - var r = []; - for (var i = 0; i < arr.length; i++) { - var x = arr[i]; - if (x.isSome()) { - r.push(x.getOrDie()); - } else { - return Optional.none(); - } + var r = []; + for (var i = 0; i < arr.length; i++) { + var x = arr[i]; + if (x.isSome()) { + r.push(x.getOrDie()); + } else { + return Optional.none(); } - return Optional.some(r); + } + return Optional.some(r); }; var lift2 = function (oa, ob, f) { - return oa.isSome() && ob.isSome() ? Optional.some(f(oa.getOrDie(), ob.getOrDie())) : Optional.none(); + return oa.isSome() && ob.isSome() ? Optional.some(f(oa.getOrDie(), ob.getOrDie())) : Optional.none(); }; var lift3 = function (oa, ob, oc, f) { - return oa.isSome() && ob.isSome() && oc.isSome() ? Optional.some(f(oa.getOrDie(), ob.getOrDie(), oc.getOrDie())) : Optional.none(); + return oa.isSome() && ob.isSome() && oc.isSome() ? Optional.some(f(oa.getOrDie(), ob.getOrDie(), oc.getOrDie())) : Optional.none(); }; var mapFrom = function (a, f) { - return a !== undefined && a !== null ? Optional.some(f(a)) : Optional.none(); + return a !== undefined && a !== null ? Optional.some(f(a)) : Optional.none(); }; var someIf = function (b, a) { - return b ? Optional.some(a) : Optional.none(); + return b ? Optional.some(a) : Optional.none(); }; var inside = function (target) { - return name(target) === 'input' && get$3(target, 'type') !== 'radio' || name(target) === 'textarea'; + return name(target) === 'input' && get$3(target, 'type') !== 'radio' || name(target) === 'textarea'; }; var getCurrent = function (component, composeConfig, _composeState) { - return composeConfig.find(component); + return composeConfig.find(component); }; var ComposeApis = /*#__PURE__*/Object.freeze({ @@ -6474,114 +6467,114 @@ var ComposeSchema = [strict$1('find')]; var Composing = create$1({ - fields: ComposeSchema, - name: 'composing', - apis: ComposeApis + fields: ComposeSchema, + name: 'composing', + apis: ComposeApis }); var dehighlightAllExcept = function (component, hConfig, hState, skip) { - var highlighted = descendants(component.element, '.' + hConfig.highlightClass); - each(highlighted, function (h) { - if (!exists(skip, function (skipComp) { - return skipComp.element === h; - })) { - remove$4(h, hConfig.highlightClass); - component.getSystem().getByDom(h).each(function (target) { - hConfig.onDehighlight(component, target); - emit(target, dehighlight()); - }); - } - }); + var highlighted = descendants(component.element, '.' + hConfig.highlightClass); + each(highlighted, function (h) { + if (!exists(skip, function (skipComp) { + return skipComp.element === h; + })) { + remove$4(h, hConfig.highlightClass); + component.getSystem().getByDom(h).each(function (target) { + hConfig.onDehighlight(component, target); + emit(target, dehighlight()); + }); + } + }); }; var dehighlightAll = function (component, hConfig, hState) { - return dehighlightAllExcept(component, hConfig, hState, []); + return dehighlightAllExcept(component, hConfig, hState, []); }; var dehighlight$1 = function (component, hConfig, hState, target) { - if (isHighlighted(component, hConfig, hState, target)) { - remove$4(target.element, hConfig.highlightClass); - hConfig.onDehighlight(component, target); - emit(target, dehighlight()); - } + if (isHighlighted(component, hConfig, hState, target)) { + remove$4(target.element, hConfig.highlightClass); + hConfig.onDehighlight(component, target); + emit(target, dehighlight()); + } }; var highlight$1 = function (component, hConfig, hState, target) { - dehighlightAllExcept(component, hConfig, hState, [target]); - if (!isHighlighted(component, hConfig, hState, target)) { - add$2(target.element, hConfig.highlightClass); - hConfig.onHighlight(component, target); - emit(target, highlight()); - } + dehighlightAllExcept(component, hConfig, hState, [target]); + if (!isHighlighted(component, hConfig, hState, target)) { + add$2(target.element, hConfig.highlightClass); + hConfig.onHighlight(component, target); + emit(target, highlight()); + } }; var highlightFirst = function (component, hConfig, hState) { - getFirst(component, hConfig).each(function (firstComp) { - highlight$1(component, hConfig, hState, firstComp); - }); + getFirst(component, hConfig).each(function (firstComp) { + highlight$1(component, hConfig, hState, firstComp); + }); }; var highlightLast = function (component, hConfig, hState) { - getLast(component, hConfig).each(function (lastComp) { - highlight$1(component, hConfig, hState, lastComp); - }); + getLast(component, hConfig).each(function (lastComp) { + highlight$1(component, hConfig, hState, lastComp); + }); }; var highlightAt = function (component, hConfig, hState, index) { - getByIndex(component, hConfig, hState, index).fold(function (err) { - throw new Error(err); - }, function (firstComp) { - highlight$1(component, hConfig, hState, firstComp); - }); + getByIndex(component, hConfig, hState, index).fold(function (err) { + throw new Error(err); + }, function (firstComp) { + highlight$1(component, hConfig, hState, firstComp); + }); }; var highlightBy = function (component, hConfig, hState, predicate) { - var candidates = getCandidates(component, hConfig); - var targetComp = find(candidates, predicate); - targetComp.each(function (c) { - highlight$1(component, hConfig, hState, c); - }); + var candidates = getCandidates(component, hConfig); + var targetComp = find(candidates, predicate); + targetComp.each(function (c) { + highlight$1(component, hConfig, hState, c); + }); }; var isHighlighted = function (component, hConfig, hState, queryTarget) { - return has$2(queryTarget.element, hConfig.highlightClass); + return has$2(queryTarget.element, hConfig.highlightClass); }; var getHighlighted = function (component, hConfig, _hState) { - return descendant$1(component.element, '.' + hConfig.highlightClass).bind(function (e) { - return component.getSystem().getByDom(e).toOptional(); - }); + return descendant$1(component.element, '.' + hConfig.highlightClass).bind(function (e) { + return component.getSystem().getByDom(e).toOptional(); + }); }; var getByIndex = function (component, hConfig, hState, index) { - var items = descendants(component.element, '.' + hConfig.itemClass); - return Optional.from(items[index]).fold(function () { - return Result.error('No element found with index ' + index); - }, component.getSystem().getByDom); + var items = descendants(component.element, '.' + hConfig.itemClass); + return Optional.from(items[index]).fold(function () { + return Result.error('No element found with index ' + index); + }, component.getSystem().getByDom); }; var getFirst = function (component, hConfig, _hState) { - return descendant$1(component.element, '.' + hConfig.itemClass).bind(function (e) { - return component.getSystem().getByDom(e).toOptional(); - }); + return descendant$1(component.element, '.' + hConfig.itemClass).bind(function (e) { + return component.getSystem().getByDom(e).toOptional(); + }); }; var getLast = function (component, hConfig, _hState) { - var items = descendants(component.element, '.' + hConfig.itemClass); - var last = items.length > 0 ? Optional.some(items[items.length - 1]) : Optional.none(); - return last.bind(function (c) { - return component.getSystem().getByDom(c).toOptional(); - }); + var items = descendants(component.element, '.' + hConfig.itemClass); + var last = items.length > 0 ? Optional.some(items[items.length - 1]) : Optional.none(); + return last.bind(function (c) { + return component.getSystem().getByDom(c).toOptional(); + }); }; var getDelta = function (component, hConfig, hState, delta) { - var items = descendants(component.element, '.' + hConfig.itemClass); - var current = findIndex(items, function (item) { - return has$2(item, hConfig.highlightClass); - }); - return current.bind(function (selected) { - var dest = cycleBy(selected, delta, 0, items.length - 1); - return component.getSystem().getByDom(items[dest]).toOptional(); - }); + var items = descendants(component.element, '.' + hConfig.itemClass); + var current = findIndex(items, function (item) { + return has$2(item, hConfig.highlightClass); + }); + return current.bind(function (selected) { + var dest = cycleBy(selected, delta, 0, items.length - 1); + return component.getSystem().getByDom(items[dest]).toOptional(); + }); }; var getPrevious = function (component, hConfig, hState) { - return getDelta(component, hConfig, hState, -1); + return getDelta(component, hConfig, hState, -1); }; var getNext = function (component, hConfig, hState) { - return getDelta(component, hConfig, hState, +1); + return getDelta(component, hConfig, hState, +1); }; var getCandidates = function (component, hConfig, _hState) { - var items = descendants(component.element, '.' + hConfig.itemClass); - return cat(map(items, function (i) { - return component.getSystem().getByDom(i).toOptional(); - })); + var items = descendants(component.element, '.' + hConfig.itemClass); + return cat(map(items, function (i) { + return component.getSystem().getByDom(i).toOptional(); + })); }; var HighlightApis = /*#__PURE__*/Object.freeze({ @@ -6603,16 +6596,16 @@ }); var HighlightSchema = [ - strict$1('highlightClass'), - strict$1('itemClass'), - onHandler('onHighlight'), - onHandler('onDehighlight') + strict$1('highlightClass'), + strict$1('itemClass'), + onHandler('onHighlight'), + onHandler('onDehighlight') ]; var Highlighting = create$1({ - fields: HighlightSchema, - name: 'highlighting', - apis: HighlightApis + fields: HighlightSchema, + name: 'highlighting', + apis: HighlightApis }); var BACKSPACE = [8]; @@ -6626,267 +6619,267 @@ var DOWN = [40]; var cyclePrev = function (values, index, predicate) { - var before = reverse(values.slice(0, index)); - var after = reverse(values.slice(index + 1)); - return find(before.concat(after), predicate); + var before = reverse(values.slice(0, index)); + var after = reverse(values.slice(index + 1)); + return find(before.concat(after), predicate); }; var tryPrev = function (values, index, predicate) { - var before = reverse(values.slice(0, index)); - return find(before, predicate); + var before = reverse(values.slice(0, index)); + return find(before, predicate); }; var cycleNext = function (values, index, predicate) { - var before = values.slice(0, index); - var after = values.slice(index + 1); - return find(after.concat(before), predicate); + var before = values.slice(0, index); + var after = values.slice(index + 1); + return find(after.concat(before), predicate); }; var tryNext = function (values, index, predicate) { - var after = values.slice(index + 1); - return find(after, predicate); + var after = values.slice(index + 1); + return find(after, predicate); }; var inSet = function (keys) { - return function (event) { - var raw = event.raw; - return contains(keys, raw.which); - }; + return function (event) { + var raw = event.raw; + return contains(keys, raw.which); + }; }; var and = function (preds) { - return function (event) { - return forall(preds, function (pred) { - return pred(event); - }); - }; + return function (event) { + return forall(preds, function (pred) { + return pred(event); + }); + }; }; var isShift = function (event) { - var raw = event.raw; - return raw.shiftKey === true; + var raw = event.raw; + return raw.shiftKey === true; }; var isControl = function (event) { - var raw = event.raw; - return raw.ctrlKey === true; + var raw = event.raw; + return raw.ctrlKey === true; }; var isNotShift = not(isShift); var rule = function (matches, action) { - return { - matches: matches, - classification: action - }; + return { + matches: matches, + classification: action + }; }; var choose$2 = function (transitions, event) { - var transition = find(transitions, function (t) { - return t.matches(event); - }); - return transition.map(function (t) { - return t.classification; - }); + var transition = find(transitions, function (t) { + return t.matches(event); + }); + return transition.map(function (t) { + return t.classification; + }); }; var reportFocusShifting = function (component, prevFocus, newFocus) { - var noChange = prevFocus.exists(function (p) { - return newFocus.exists(function (n) { - return eq$1(n, p); - }); + var noChange = prevFocus.exists(function (p) { + return newFocus.exists(function (n) { + return eq$1(n, p); }); - if (!noChange) { - emitWith(component, focusShifted(), { - prevFocus: prevFocus, - newFocus: newFocus - }); - } + }); + if (!noChange) { + emitWith(component, focusShifted(), { + prevFocus: prevFocus, + newFocus: newFocus + }); + } }; var dom = function () { - var get = function (component) { - return search(component.element); - }; - var set = function (component, focusee) { - var prevFocus = get(component); - component.getSystem().triggerFocus(focusee, component.element); - var newFocus = get(component); - reportFocusShifting(component, prevFocus, newFocus); - }; - return { - get: get, - set: set - }; + var get = function (component) { + return search(component.element); + }; + var set = function (component, focusee) { + var prevFocus = get(component); + component.getSystem().triggerFocus(focusee, component.element); + var newFocus = get(component); + reportFocusShifting(component, prevFocus, newFocus); + }; + return { + get: get, + set: set + }; }; var highlights = function () { - var get = function (component) { - return Highlighting.getHighlighted(component).map(function (item) { - return item.element; - }); - }; - var set = function (component, element) { - var prevFocus = get(component); - component.getSystem().getByDom(element).fold(noop, function (item) { - Highlighting.highlight(component, item); - }); - var newFocus = get(component); - reportFocusShifting(component, prevFocus, newFocus); - }; - return { - get: get, - set: set - }; + var get = function (component) { + return Highlighting.getHighlighted(component).map(function (item) { + return item.element; + }); + }; + var set = function (component, element) { + var prevFocus = get(component); + component.getSystem().getByDom(element).fold(noop, function (item) { + Highlighting.highlight(component, item); + }); + var newFocus = get(component); + reportFocusShifting(component, prevFocus, newFocus); + }; + return { + get: get, + set: set + }; }; var FocusInsideModes; (function (FocusInsideModes) { - FocusInsideModes['OnFocusMode'] = 'onFocus'; - FocusInsideModes['OnEnterOrSpaceMode'] = 'onEnterOrSpace'; - FocusInsideModes['OnApiMode'] = 'onApi'; + FocusInsideModes['OnFocusMode'] = 'onFocus'; + FocusInsideModes['OnEnterOrSpaceMode'] = 'onEnterOrSpace'; + FocusInsideModes['OnApiMode'] = 'onApi'; }(FocusInsideModes || (FocusInsideModes = {}))); var typical = function (infoSchema, stateInit, getKeydownRules, getKeyupRules, optFocusIn) { - var schema = function () { - return infoSchema.concat([ - defaulted$1('focusManager', dom()), - defaultedOf('focusInside', 'onFocus', valueOf(function (val) { - return contains([ - 'onFocus', - 'onEnterOrSpace', - 'onApi' - ], val) ? Result.value(val) : Result.error('Invalid value for focusInside'); - })), - output('handler', me), - output('state', stateInit), - output('sendFocusIn', optFocusIn) - ]); - }; - var processKey = function (component, simulatedEvent, getRules, keyingConfig, keyingState) { - var rules = getRules(component, simulatedEvent, keyingConfig, keyingState); - return choose$2(rules, simulatedEvent.event).bind(function (rule) { - return rule(component, simulatedEvent, keyingConfig, keyingState); - }); - }; - var toEvents = function (keyingConfig, keyingState) { - var onFocusHandler = keyingConfig.focusInside !== FocusInsideModes.OnFocusMode ? Optional.none() : optFocusIn(keyingConfig).map(function (focusIn) { - return run(focus(), function (component, simulatedEvent) { - focusIn(component, keyingConfig, keyingState); - simulatedEvent.stop(); - }); - }); - var tryGoInsideComponent = function (component, simulatedEvent) { - var isEnterOrSpace = inSet(SPACE.concat(ENTER))(simulatedEvent.event); - if (keyingConfig.focusInside === FocusInsideModes.OnEnterOrSpaceMode && isEnterOrSpace && isSource(component, simulatedEvent)) { - optFocusIn(keyingConfig).each(function (focusIn) { - focusIn(component, keyingConfig, keyingState); - simulatedEvent.stop(); - }); - } - }; - var keyboardEvents = [ - run(keydown(), function (component, simulatedEvent) { - processKey(component, simulatedEvent, getKeydownRules, keyingConfig, keyingState).fold(function () { - tryGoInsideComponent(component, simulatedEvent); - }, function (_) { - simulatedEvent.stop(); - }); - }), - run(keyup(), function (component, simulatedEvent) { - processKey(component, simulatedEvent, getKeyupRules, keyingConfig, keyingState).each(function (_) { - simulatedEvent.stop(); - }); - }) - ]; - return derive(onFocusHandler.toArray().concat(keyboardEvents)); - }; - var me = { - schema: schema, - processKey: processKey, - toEvents: toEvents - }; - return me; + var schema = function () { + return infoSchema.concat([ + defaulted$1('focusManager', dom()), + defaultedOf('focusInside', 'onFocus', valueOf(function (val) { + return contains([ + 'onFocus', + 'onEnterOrSpace', + 'onApi' + ], val) ? Result.value(val) : Result.error('Invalid value for focusInside'); + })), + output('handler', me), + output('state', stateInit), + output('sendFocusIn', optFocusIn) + ]); + }; + var processKey = function (component, simulatedEvent, getRules, keyingConfig, keyingState) { + var rules = getRules(component, simulatedEvent, keyingConfig, keyingState); + return choose$2(rules, simulatedEvent.event).bind(function (rule) { + return rule(component, simulatedEvent, keyingConfig, keyingState); + }); + }; + var toEvents = function (keyingConfig, keyingState) { + var onFocusHandler = keyingConfig.focusInside !== FocusInsideModes.OnFocusMode ? Optional.none() : optFocusIn(keyingConfig).map(function (focusIn) { + return run(focus(), function (component, simulatedEvent) { + focusIn(component, keyingConfig, keyingState); + simulatedEvent.stop(); + }); + }); + var tryGoInsideComponent = function (component, simulatedEvent) { + var isEnterOrSpace = inSet(SPACE.concat(ENTER))(simulatedEvent.event); + if (keyingConfig.focusInside === FocusInsideModes.OnEnterOrSpaceMode && isEnterOrSpace && isSource(component, simulatedEvent)) { + optFocusIn(keyingConfig).each(function (focusIn) { + focusIn(component, keyingConfig, keyingState); + simulatedEvent.stop(); + }); + } + }; + var keyboardEvents = [ + run(keydown(), function (component, simulatedEvent) { + processKey(component, simulatedEvent, getKeydownRules, keyingConfig, keyingState).fold(function () { + tryGoInsideComponent(component, simulatedEvent); + }, function (_) { + simulatedEvent.stop(); + }); + }), + run(keyup(), function (component, simulatedEvent) { + processKey(component, simulatedEvent, getKeyupRules, keyingConfig, keyingState).each(function (_) { + simulatedEvent.stop(); + }); + }) + ]; + return derive(onFocusHandler.toArray().concat(keyboardEvents)); + }; + var me = { + schema: schema, + processKey: processKey, + toEvents: toEvents + }; + return me; }; var create$3 = function (cyclicField) { - var schema = [ - option('onEscape'), - option('onEnter'), - defaulted$1('selector', '[data-alloy-tabstop="true"]:not(:disabled)'), - defaulted$1('firstTabstop', 0), - defaulted$1('useTabstopAt', always), - option('visibilitySelector') - ].concat([cyclicField]); - var isVisible = function (tabbingConfig, element) { - var target = tabbingConfig.visibilitySelector.bind(function (sel) { - return closest$3(element, sel); - }).getOr(element); - return get$7(target) > 0; - }; - var findInitial = function (component, tabbingConfig) { - var tabstops = descendants(component.element, tabbingConfig.selector); - var visibles = filter(tabstops, function (elem) { - return isVisible(tabbingConfig, elem); - }); - return Optional.from(visibles[tabbingConfig.firstTabstop]); - }; - var findCurrent = function (component, tabbingConfig) { - return tabbingConfig.focusManager.get(component).bind(function (elem) { - return closest$3(elem, tabbingConfig.selector); - }); - }; - var isTabstop = function (tabbingConfig, element) { - return isVisible(tabbingConfig, element) && tabbingConfig.useTabstopAt(element); - }; - var focusIn = function (component, tabbingConfig, _tabbingState) { - findInitial(component, tabbingConfig).each(function (target) { - tabbingConfig.focusManager.set(component, target); - }); - }; - var goFromTabstop = function (component, tabstops, stopIndex, tabbingConfig, cycle) { - return cycle(tabstops, stopIndex, function (elem) { - return isTabstop(tabbingConfig, elem); - }).fold(function () { - return tabbingConfig.cyclic ? Optional.some(true) : Optional.none(); - }, function (target) { - tabbingConfig.focusManager.set(component, target); - return Optional.some(true); - }); - }; - var go = function (component, _simulatedEvent, tabbingConfig, cycle) { - var tabstops = descendants(component.element, tabbingConfig.selector); - return findCurrent(component, tabbingConfig).bind(function (tabstop) { - var optStopIndex = findIndex(tabstops, curry(eq$1, tabstop)); - return optStopIndex.bind(function (stopIndex) { - return goFromTabstop(component, tabstops, stopIndex, tabbingConfig, cycle); - }); - }); - }; - var goBackwards = function (component, simulatedEvent, tabbingConfig) { - var navigate = tabbingConfig.cyclic ? cyclePrev : tryPrev; - return go(component, simulatedEvent, tabbingConfig, navigate); - }; - var goForwards = function (component, simulatedEvent, tabbingConfig) { - var navigate = tabbingConfig.cyclic ? cycleNext : tryNext; - return go(component, simulatedEvent, tabbingConfig, navigate); - }; - var execute = function (component, simulatedEvent, tabbingConfig) { - return tabbingConfig.onEnter.bind(function (f) { - return f(component, simulatedEvent); - }); - }; - var exit = function (component, simulatedEvent, tabbingConfig) { - return tabbingConfig.onEscape.bind(function (f) { - return f(component, simulatedEvent); - }); - }; - var getKeydownRules = constant([ - rule(and([ - isShift, - inSet(TAB) - ]), goBackwards), - rule(inSet(TAB), goForwards), - rule(inSet(ESCAPE), exit), - rule(and([ - isNotShift, - inSet(ENTER) - ]), execute) - ]); - var getKeyupRules = constant([]); - return typical(schema, NoState.init, getKeydownRules, getKeyupRules, function () { - return Optional.some(focusIn); - }); + var schema = [ + option('onEscape'), + option('onEnter'), + defaulted$1('selector', '[data-alloy-tabstop="true"]:not(:disabled)'), + defaulted$1('firstTabstop', 0), + defaulted$1('useTabstopAt', always), + option('visibilitySelector') + ].concat([cyclicField]); + var isVisible = function (tabbingConfig, element) { + var target = tabbingConfig.visibilitySelector.bind(function (sel) { + return closest$3(element, sel); + }).getOr(element); + return get$7(target) > 0; + }; + var findInitial = function (component, tabbingConfig) { + var tabstops = descendants(component.element, tabbingConfig.selector); + var visibles = filter(tabstops, function (elem) { + return isVisible(tabbingConfig, elem); + }); + return Optional.from(visibles[tabbingConfig.firstTabstop]); + }; + var findCurrent = function (component, tabbingConfig) { + return tabbingConfig.focusManager.get(component).bind(function (elem) { + return closest$3(elem, tabbingConfig.selector); + }); + }; + var isTabstop = function (tabbingConfig, element) { + return isVisible(tabbingConfig, element) && tabbingConfig.useTabstopAt(element); + }; + var focusIn = function (component, tabbingConfig, _tabbingState) { + findInitial(component, tabbingConfig).each(function (target) { + tabbingConfig.focusManager.set(component, target); + }); + }; + var goFromTabstop = function (component, tabstops, stopIndex, tabbingConfig, cycle) { + return cycle(tabstops, stopIndex, function (elem) { + return isTabstop(tabbingConfig, elem); + }).fold(function () { + return tabbingConfig.cyclic ? Optional.some(true) : Optional.none(); + }, function (target) { + tabbingConfig.focusManager.set(component, target); + return Optional.some(true); + }); + }; + var go = function (component, _simulatedEvent, tabbingConfig, cycle) { + var tabstops = descendants(component.element, tabbingConfig.selector); + return findCurrent(component, tabbingConfig).bind(function (tabstop) { + var optStopIndex = findIndex(tabstops, curry(eq$1, tabstop)); + return optStopIndex.bind(function (stopIndex) { + return goFromTabstop(component, tabstops, stopIndex, tabbingConfig, cycle); + }); + }); + }; + var goBackwards = function (component, simulatedEvent, tabbingConfig) { + var navigate = tabbingConfig.cyclic ? cyclePrev : tryPrev; + return go(component, simulatedEvent, tabbingConfig, navigate); + }; + var goForwards = function (component, simulatedEvent, tabbingConfig) { + var navigate = tabbingConfig.cyclic ? cycleNext : tryNext; + return go(component, simulatedEvent, tabbingConfig, navigate); + }; + var execute = function (component, simulatedEvent, tabbingConfig) { + return tabbingConfig.onEnter.bind(function (f) { + return f(component, simulatedEvent); + }); + }; + var exit = function (component, simulatedEvent, tabbingConfig) { + return tabbingConfig.onEscape.bind(function (f) { + return f(component, simulatedEvent); + }); + }; + var getKeydownRules = constant([ + rule(and([ + isShift, + inSet(TAB) + ]), goBackwards), + rule(inSet(TAB), goForwards), + rule(inSet(ESCAPE), exit), + rule(and([ + isNotShift, + inSet(ENTER) + ]), execute) + ]); + var getKeyupRules = constant([]); + return typical(schema, NoState.init, getKeydownRules, getKeyupRules, function () { + return Optional.some(focusIn); + }); }; var AcyclicType = create$3(state$1('cyclic', never)); @@ -6894,81 +6887,81 @@ var CyclicType = create$3(state$1('cyclic', always)); var doDefaultExecute = function (component, _simulatedEvent, focused) { - dispatch(component, focused, execute()); - return Optional.some(true); + dispatch(component, focused, execute()); + return Optional.some(true); }; var defaultExecute = function (component, simulatedEvent, focused) { - var isComplex = inside(focused) && inSet(SPACE)(simulatedEvent.event); - return isComplex ? Optional.none() : doDefaultExecute(component, simulatedEvent, focused); + var isComplex = inside(focused) && inSet(SPACE)(simulatedEvent.event); + return isComplex ? Optional.none() : doDefaultExecute(component, simulatedEvent, focused); }; var stopEventForFirefox = function (_component, _simulatedEvent) { - return Optional.some(true); + return Optional.some(true); }; var schema$4 = [ - defaulted$1('execute', defaultExecute), - defaulted$1('useSpace', false), - defaulted$1('useEnter', true), - defaulted$1('useControlEnter', false), - defaulted$1('useDown', false) + defaulted$1('execute', defaultExecute), + defaulted$1('useSpace', false), + defaulted$1('useEnter', true), + defaulted$1('useControlEnter', false), + defaulted$1('useDown', false) ]; var execute$1 = function (component, simulatedEvent, executeConfig) { - return executeConfig.execute(component, simulatedEvent, component.element); + return executeConfig.execute(component, simulatedEvent, component.element); }; var getKeydownRules = function (component, _simulatedEvent, executeConfig, _executeState) { - var spaceExec = executeConfig.useSpace && !inside(component.element) ? SPACE : []; - var enterExec = executeConfig.useEnter ? ENTER : []; - var downExec = executeConfig.useDown ? DOWN : []; - var execKeys = spaceExec.concat(enterExec).concat(downExec); - return [rule(inSet(execKeys), execute$1)].concat(executeConfig.useControlEnter ? [rule(and([ - isControl, - inSet(ENTER) + var spaceExec = executeConfig.useSpace && !inside(component.element) ? SPACE : []; + var enterExec = executeConfig.useEnter ? ENTER : []; + var downExec = executeConfig.useDown ? DOWN : []; + var execKeys = spaceExec.concat(enterExec).concat(downExec); + return [rule(inSet(execKeys), execute$1)].concat(executeConfig.useControlEnter ? [rule(and([ + isControl, + inSet(ENTER) ]), execute$1)] : []); }; var getKeyupRules = function (component, _simulatedEvent, executeConfig, _executeState) { - return executeConfig.useSpace && !inside(component.element) ? [rule(inSet(SPACE), stopEventForFirefox)] : []; + return executeConfig.useSpace && !inside(component.element) ? [rule(inSet(SPACE), stopEventForFirefox)] : []; }; var ExecutionType = typical(schema$4, NoState.init, getKeydownRules, getKeyupRules, function () { - return Optional.none(); + return Optional.none(); }); var flatgrid = function () { - var dimensions = Cell(Optional.none()); - var setGridSize = function (numRows, numColumns) { - dimensions.set(Optional.some({ - numRows: numRows, - numColumns: numColumns - })); - }; - var getNumRows = function () { - return dimensions.get().map(function (d) { - return d.numRows; - }); - }; - var getNumColumns = function () { - return dimensions.get().map(function (d) { - return d.numColumns; - }); - }; - return nu$5({ - readState: function () { - return dimensions.get().map(function (d) { - return { - numRows: String(d.numRows), - numColumns: String(d.numColumns) - }; - }).getOr({ - numRows: '?', - numColumns: '?' - }); - }, - setGridSize: setGridSize, - getNumRows: getNumRows, - getNumColumns: getNumColumns - }); + var dimensions = Cell(Optional.none()); + var setGridSize = function (numRows, numColumns) { + dimensions.set(Optional.some({ + numRows: numRows, + numColumns: numColumns + })); + }; + var getNumRows = function () { + return dimensions.get().map(function (d) { + return d.numRows; + }); + }; + var getNumColumns = function () { + return dimensions.get().map(function (d) { + return d.numColumns; + }); + }; + return nu$5({ + readState: function () { + return dimensions.get().map(function (d) { + return { + numRows: String(d.numRows), + numColumns: String(d.numColumns) + }; + }).getOr({ + numRows: '?', + numColumns: '?' + }); + }, + setGridSize: setGridSize, + getNumRows: getNumRows, + getNumColumns: getNumColumns + }); }; var init$2 = function (spec) { - return spec.state(spec); + return spec.state(spec); }; var KeyingState = /*#__PURE__*/Object.freeze({ @@ -6978,460 +6971,460 @@ }); var useH = function (movement) { - return function (component, simulatedEvent, config, state) { - var move = movement(component.element); - return use(move, component, simulatedEvent, config, state); - }; + return function (component, simulatedEvent, config, state) { + var move = movement(component.element); + return use(move, component, simulatedEvent, config, state); + }; }; var west$2 = function (moveLeft, moveRight) { - var movement = onDirection(moveLeft, moveRight); - return useH(movement); + var movement = onDirection(moveLeft, moveRight); + return useH(movement); }; var east$2 = function (moveLeft, moveRight) { - var movement = onDirection(moveRight, moveLeft); - return useH(movement); + var movement = onDirection(moveRight, moveLeft); + return useH(movement); }; var useV = function (move) { - return function (component, simulatedEvent, config, state) { - return use(move, component, simulatedEvent, config, state); - }; + return function (component, simulatedEvent, config, state) { + return use(move, component, simulatedEvent, config, state); + }; }; var use = function (move, component, simulatedEvent, config, state) { - var outcome = config.focusManager.get(component).bind(function (focused) { - return move(component.element, focused, config, state); - }); - return outcome.map(function (newFocus) { - config.focusManager.set(component, newFocus); - return true; - }); + var outcome = config.focusManager.get(component).bind(function (focused) { + return move(component.element, focused, config, state); + }); + return outcome.map(function (newFocus) { + config.focusManager.set(component, newFocus); + return true; + }); }; var north$2 = useV; var south$2 = useV; var move = useV; var isHidden = function (dom) { - return dom.offsetWidth <= 0 && dom.offsetHeight <= 0; + return dom.offsetWidth <= 0 && dom.offsetHeight <= 0; }; var isVisible = function (element) { - return !isHidden(element.dom); + return !isHidden(element.dom); }; var locate = function (candidates, predicate) { - return findIndex(candidates, predicate).map(function (index) { - return { - index: index, - candidates: candidates - }; - }); + return findIndex(candidates, predicate).map(function (index) { + return { + index: index, + candidates: candidates + }; + }); }; var locateVisible = function (container, current, selector) { - var predicate = function (x) { - return eq$1(x, current); - }; - var candidates = descendants(container, selector); - var visible = filter(candidates, isVisible); - return locate(visible, predicate); + var predicate = function (x) { + return eq$1(x, current); + }; + var candidates = descendants(container, selector); + var visible = filter(candidates, isVisible); + return locate(visible, predicate); }; var findIndex$1 = function (elements, target) { - return findIndex(elements, function (elem) { - return eq$1(target, elem); - }); + return findIndex(elements, function (elem) { + return eq$1(target, elem); + }); }; var withGrid = function (values, index, numCols, f) { - var oldRow = Math.floor(index / numCols); - var oldColumn = index % numCols; - return f(oldRow, oldColumn).bind(function (address) { - var newIndex = address.row * numCols + address.column; - return newIndex >= 0 && newIndex < values.length ? Optional.some(values[newIndex]) : Optional.none(); - }); + var oldRow = Math.floor(index / numCols); + var oldColumn = index % numCols; + return f(oldRow, oldColumn).bind(function (address) { + var newIndex = address.row * numCols + address.column; + return newIndex >= 0 && newIndex < values.length ? Optional.some(values[newIndex]) : Optional.none(); + }); }; var cycleHorizontal = function (values, index, numRows, numCols, delta) { - return withGrid(values, index, numCols, function (oldRow, oldColumn) { - var onLastRow = oldRow === numRows - 1; - var colsInRow = onLastRow ? values.length - oldRow * numCols : numCols; - var newColumn = cycleBy(oldColumn, delta, 0, colsInRow - 1); - return Optional.some({ - row: oldRow, - column: newColumn - }); + return withGrid(values, index, numCols, function (oldRow, oldColumn) { + var onLastRow = oldRow === numRows - 1; + var colsInRow = onLastRow ? values.length - oldRow * numCols : numCols; + var newColumn = cycleBy(oldColumn, delta, 0, colsInRow - 1); + return Optional.some({ + row: oldRow, + column: newColumn }); + }); }; var cycleVertical = function (values, index, numRows, numCols, delta) { - return withGrid(values, index, numCols, function (oldRow, oldColumn) { - var newRow = cycleBy(oldRow, delta, 0, numRows - 1); - var onLastRow = newRow === numRows - 1; - var colsInRow = onLastRow ? values.length - newRow * numCols : numCols; - var newCol = clamp(oldColumn, 0, colsInRow - 1); - return Optional.some({ - row: newRow, - column: newCol - }); + return withGrid(values, index, numCols, function (oldRow, oldColumn) { + var newRow = cycleBy(oldRow, delta, 0, numRows - 1); + var onLastRow = newRow === numRows - 1; + var colsInRow = onLastRow ? values.length - newRow * numCols : numCols; + var newCol = clamp(oldColumn, 0, colsInRow - 1); + return Optional.some({ + row: newRow, + column: newCol }); + }); }; var cycleRight = function (values, index, numRows, numCols) { - return cycleHorizontal(values, index, numRows, numCols, +1); + return cycleHorizontal(values, index, numRows, numCols, +1); }; var cycleLeft = function (values, index, numRows, numCols) { - return cycleHorizontal(values, index, numRows, numCols, -1); + return cycleHorizontal(values, index, numRows, numCols, -1); }; var cycleUp = function (values, index, numRows, numCols) { - return cycleVertical(values, index, numRows, numCols, -1); + return cycleVertical(values, index, numRows, numCols, -1); }; var cycleDown = function (values, index, numRows, numCols) { - return cycleVertical(values, index, numRows, numCols, +1); + return cycleVertical(values, index, numRows, numCols, +1); }; var schema$5 = [ - strict$1('selector'), - defaulted$1('execute', defaultExecute), - onKeyboardHandler('onEscape'), - defaulted$1('captureTab', false), - initSize() + strict$1('selector'), + defaulted$1('execute', defaultExecute), + onKeyboardHandler('onEscape'), + defaulted$1('captureTab', false), + initSize() ]; var focusIn = function (component, gridConfig, _gridState) { - descendant$1(component.element, gridConfig.selector).each(function (first) { - gridConfig.focusManager.set(component, first); - }); + descendant$1(component.element, gridConfig.selector).each(function (first) { + gridConfig.focusManager.set(component, first); + }); }; var findCurrent = function (component, gridConfig) { - return gridConfig.focusManager.get(component).bind(function (elem) { - return closest$3(elem, gridConfig.selector); - }); + return gridConfig.focusManager.get(component).bind(function (elem) { + return closest$3(elem, gridConfig.selector); + }); }; var execute$2 = function (component, simulatedEvent, gridConfig, _gridState) { - return findCurrent(component, gridConfig).bind(function (focused) { - return gridConfig.execute(component, simulatedEvent, focused); - }); + return findCurrent(component, gridConfig).bind(function (focused) { + return gridConfig.execute(component, simulatedEvent, focused); + }); }; var doMove = function (cycle) { - return function (element, focused, gridConfig, gridState) { - return locateVisible(element, focused, gridConfig.selector).bind(function (identified) { - return cycle(identified.candidates, identified.index, gridState.getNumRows().getOr(gridConfig.initSize.numRows), gridState.getNumColumns().getOr(gridConfig.initSize.numColumns)); - }); - }; + return function (element, focused, gridConfig, gridState) { + return locateVisible(element, focused, gridConfig.selector).bind(function (identified) { + return cycle(identified.candidates, identified.index, gridState.getNumRows().getOr(gridConfig.initSize.numRows), gridState.getNumColumns().getOr(gridConfig.initSize.numColumns)); + }); + }; }; var handleTab = function (_component, _simulatedEvent, gridConfig) { - return gridConfig.captureTab ? Optional.some(true) : Optional.none(); + return gridConfig.captureTab ? Optional.some(true) : Optional.none(); }; var doEscape = function (component, simulatedEvent, gridConfig) { - return gridConfig.onEscape(component, simulatedEvent); + return gridConfig.onEscape(component, simulatedEvent); }; var moveLeft = doMove(cycleLeft); var moveRight = doMove(cycleRight); var moveNorth = doMove(cycleUp); var moveSouth = doMove(cycleDown); var getKeydownRules$1 = constant([ - rule(inSet(LEFT), west$2(moveLeft, moveRight)), - rule(inSet(RIGHT), east$2(moveLeft, moveRight)), - rule(inSet(UP), north$2(moveNorth)), - rule(inSet(DOWN), south$2(moveSouth)), - rule(and([ - isShift, - inSet(TAB) - ]), handleTab), - rule(and([ - isNotShift, - inSet(TAB) - ]), handleTab), - rule(inSet(ESCAPE), doEscape), - rule(inSet(SPACE.concat(ENTER)), execute$2) + rule(inSet(LEFT), west$2(moveLeft, moveRight)), + rule(inSet(RIGHT), east$2(moveLeft, moveRight)), + rule(inSet(UP), north$2(moveNorth)), + rule(inSet(DOWN), south$2(moveSouth)), + rule(and([ + isShift, + inSet(TAB) + ]), handleTab), + rule(and([ + isNotShift, + inSet(TAB) + ]), handleTab), + rule(inSet(ESCAPE), doEscape), + rule(inSet(SPACE.concat(ENTER)), execute$2) ]); var getKeyupRules$1 = constant([rule(inSet(SPACE), stopEventForFirefox)]); var FlatgridType = typical(schema$5, flatgrid, getKeydownRules$1, getKeyupRules$1, function () { - return Optional.some(focusIn); + return Optional.some(focusIn); }); var horizontal = function (container, selector, current, delta) { - var isDisabledButton = function (candidate) { - return name(candidate) === 'button' && get$3(candidate, 'disabled') === 'disabled'; - }; - var tryCycle = function (initial, index, candidates) { - var newIndex = cycleBy(index, delta, 0, candidates.length - 1); - if (newIndex === initial) { - return Optional.none(); - } else { - return isDisabledButton(candidates[newIndex]) ? tryCycle(initial, newIndex, candidates) : Optional.from(candidates[newIndex]); - } - }; - return locateVisible(container, current, selector).bind(function (identified) { - var index = identified.index; - var candidates = identified.candidates; - return tryCycle(index, index, candidates); - }); + var isDisabledButton = function (candidate) { + return name(candidate) === 'button' && get$3(candidate, 'disabled') === 'disabled'; + }; + var tryCycle = function (initial, index, candidates) { + var newIndex = cycleBy(index, delta, 0, candidates.length - 1); + if (newIndex === initial) { + return Optional.none(); + } else { + return isDisabledButton(candidates[newIndex]) ? tryCycle(initial, newIndex, candidates) : Optional.from(candidates[newIndex]); + } + }; + return locateVisible(container, current, selector).bind(function (identified) { + var index = identified.index; + var candidates = identified.candidates; + return tryCycle(index, index, candidates); + }); }; var schema$6 = [ - strict$1('selector'), - defaulted$1('getInitial', Optional.none), - defaulted$1('execute', defaultExecute), - onKeyboardHandler('onEscape'), - defaulted$1('executeOnMove', false), - defaulted$1('allowVertical', true) + strict$1('selector'), + defaulted$1('getInitial', Optional.none), + defaulted$1('execute', defaultExecute), + onKeyboardHandler('onEscape'), + defaulted$1('executeOnMove', false), + defaulted$1('allowVertical', true) ]; var findCurrent$1 = function (component, flowConfig) { - return flowConfig.focusManager.get(component).bind(function (elem) { - return closest$3(elem, flowConfig.selector); - }); + return flowConfig.focusManager.get(component).bind(function (elem) { + return closest$3(elem, flowConfig.selector); + }); }; var execute$3 = function (component, simulatedEvent, flowConfig) { - return findCurrent$1(component, flowConfig).bind(function (focused) { - return flowConfig.execute(component, simulatedEvent, focused); - }); + return findCurrent$1(component, flowConfig).bind(function (focused) { + return flowConfig.execute(component, simulatedEvent, focused); + }); }; var focusIn$1 = function (component, flowConfig, _state) { - flowConfig.getInitial(component).orThunk(function () { - return descendant$1(component.element, flowConfig.selector); - }).each(function (first) { - flowConfig.focusManager.set(component, first); - }); + flowConfig.getInitial(component).orThunk(function () { + return descendant$1(component.element, flowConfig.selector); + }).each(function (first) { + flowConfig.focusManager.set(component, first); + }); }; var moveLeft$1 = function (element, focused, info) { - return horizontal(element, info.selector, focused, -1); + return horizontal(element, info.selector, focused, -1); }; var moveRight$1 = function (element, focused, info) { - return horizontal(element, info.selector, focused, +1); + return horizontal(element, info.selector, focused, +1); }; var doMove$1 = function (movement) { - return function (component, simulatedEvent, flowConfig, flowState) { - return movement(component, simulatedEvent, flowConfig, flowState).bind(function () { - return flowConfig.executeOnMove ? execute$3(component, simulatedEvent, flowConfig) : Optional.some(true); - }); - }; + return function (component, simulatedEvent, flowConfig, flowState) { + return movement(component, simulatedEvent, flowConfig, flowState).bind(function () { + return flowConfig.executeOnMove ? execute$3(component, simulatedEvent, flowConfig) : Optional.some(true); + }); + }; }; var doEscape$1 = function (component, simulatedEvent, flowConfig) { - return flowConfig.onEscape(component, simulatedEvent); + return flowConfig.onEscape(component, simulatedEvent); }; var getKeydownRules$2 = function (_component, _se, flowConfig, _flowState) { - var westMovers = LEFT.concat(flowConfig.allowVertical ? UP : []); - var eastMovers = RIGHT.concat(flowConfig.allowVertical ? DOWN : []); - return [ - rule(inSet(westMovers), doMove$1(west$2(moveLeft$1, moveRight$1))), - rule(inSet(eastMovers), doMove$1(east$2(moveLeft$1, moveRight$1))), - rule(inSet(ENTER), execute$3), - rule(inSet(SPACE), execute$3), - rule(inSet(ESCAPE), doEscape$1) - ]; + var westMovers = LEFT.concat(flowConfig.allowVertical ? UP : []); + var eastMovers = RIGHT.concat(flowConfig.allowVertical ? DOWN : []); + return [ + rule(inSet(westMovers), doMove$1(west$2(moveLeft$1, moveRight$1))), + rule(inSet(eastMovers), doMove$1(east$2(moveLeft$1, moveRight$1))), + rule(inSet(ENTER), execute$3), + rule(inSet(SPACE), execute$3), + rule(inSet(ESCAPE), doEscape$1) + ]; }; var getKeyupRules$2 = constant([rule(inSet(SPACE), stopEventForFirefox)]); var FlowType = typical(schema$6, NoState.init, getKeydownRules$2, getKeyupRules$2, function () { - return Optional.some(focusIn$1); + return Optional.some(focusIn$1); }); var toCell = function (matrix, rowIndex, columnIndex) { - return Optional.from(matrix[rowIndex]).bind(function (row) { - return Optional.from(row[columnIndex]).map(function (cell) { - return { - rowIndex: rowIndex, - columnIndex: columnIndex, - cell: cell - }; - }); + return Optional.from(matrix[rowIndex]).bind(function (row) { + return Optional.from(row[columnIndex]).map(function (cell) { + return { + rowIndex: rowIndex, + columnIndex: columnIndex, + cell: cell + }; }); + }); }; var cycleHorizontal$1 = function (matrix, rowIndex, startCol, deltaCol) { - var row = matrix[rowIndex]; - var colsInRow = row.length; - var newColIndex = cycleBy(startCol, deltaCol, 0, colsInRow - 1); - return toCell(matrix, rowIndex, newColIndex); + var row = matrix[rowIndex]; + var colsInRow = row.length; + var newColIndex = cycleBy(startCol, deltaCol, 0, colsInRow - 1); + return toCell(matrix, rowIndex, newColIndex); }; var cycleVertical$1 = function (matrix, colIndex, startRow, deltaRow) { - var nextRowIndex = cycleBy(startRow, deltaRow, 0, matrix.length - 1); - var colsInNextRow = matrix[nextRowIndex].length; - var nextColIndex = clamp(colIndex, 0, colsInNextRow - 1); - return toCell(matrix, nextRowIndex, nextColIndex); + var nextRowIndex = cycleBy(startRow, deltaRow, 0, matrix.length - 1); + var colsInNextRow = matrix[nextRowIndex].length; + var nextColIndex = clamp(colIndex, 0, colsInNextRow - 1); + return toCell(matrix, nextRowIndex, nextColIndex); }; var moveHorizontal = function (matrix, rowIndex, startCol, deltaCol) { - var row = matrix[rowIndex]; - var colsInRow = row.length; - var newColIndex = clamp(startCol + deltaCol, 0, colsInRow - 1); - return toCell(matrix, rowIndex, newColIndex); + var row = matrix[rowIndex]; + var colsInRow = row.length; + var newColIndex = clamp(startCol + deltaCol, 0, colsInRow - 1); + return toCell(matrix, rowIndex, newColIndex); }; var moveVertical = function (matrix, colIndex, startRow, deltaRow) { - var nextRowIndex = clamp(startRow + deltaRow, 0, matrix.length - 1); - var colsInNextRow = matrix[nextRowIndex].length; - var nextColIndex = clamp(colIndex, 0, colsInNextRow - 1); - return toCell(matrix, nextRowIndex, nextColIndex); + var nextRowIndex = clamp(startRow + deltaRow, 0, matrix.length - 1); + var colsInNextRow = matrix[nextRowIndex].length; + var nextColIndex = clamp(colIndex, 0, colsInNextRow - 1); + return toCell(matrix, nextRowIndex, nextColIndex); }; var cycleRight$1 = function (matrix, startRow, startCol) { - return cycleHorizontal$1(matrix, startRow, startCol, +1); + return cycleHorizontal$1(matrix, startRow, startCol, +1); }; var cycleLeft$1 = function (matrix, startRow, startCol) { - return cycleHorizontal$1(matrix, startRow, startCol, -1); + return cycleHorizontal$1(matrix, startRow, startCol, -1); }; var cycleUp$1 = function (matrix, startRow, startCol) { - return cycleVertical$1(matrix, startCol, startRow, -1); + return cycleVertical$1(matrix, startCol, startRow, -1); }; var cycleDown$1 = function (matrix, startRow, startCol) { - return cycleVertical$1(matrix, startCol, startRow, +1); + return cycleVertical$1(matrix, startCol, startRow, +1); }; var moveLeft$2 = function (matrix, startRow, startCol) { - return moveHorizontal(matrix, startRow, startCol, -1); + return moveHorizontal(matrix, startRow, startCol, -1); }; var moveRight$2 = function (matrix, startRow, startCol) { - return moveHorizontal(matrix, startRow, startCol, +1); + return moveHorizontal(matrix, startRow, startCol, +1); }; var moveUp = function (matrix, startRow, startCol) { - return moveVertical(matrix, startCol, startRow, -1); + return moveVertical(matrix, startCol, startRow, -1); }; var moveDown = function (matrix, startRow, startCol) { - return moveVertical(matrix, startCol, startRow, +1); + return moveVertical(matrix, startCol, startRow, +1); }; var schema$7 = [ - strictObjOf('selectors', [ - strict$1('row'), - strict$1('cell') - ]), - defaulted$1('cycles', true), - defaulted$1('previousSelector', Optional.none), - defaulted$1('execute', defaultExecute) + strictObjOf('selectors', [ + strict$1('row'), + strict$1('cell') + ]), + defaulted$1('cycles', true), + defaulted$1('previousSelector', Optional.none), + defaulted$1('execute', defaultExecute) ]; var focusIn$2 = function (component, matrixConfig, _state) { - var focused = matrixConfig.previousSelector(component).orThunk(function () { - var selectors = matrixConfig.selectors; - return descendant$1(component.element, selectors.cell); - }); - focused.each(function (cell) { - matrixConfig.focusManager.set(component, cell); - }); + var focused = matrixConfig.previousSelector(component).orThunk(function () { + var selectors = matrixConfig.selectors; + return descendant$1(component.element, selectors.cell); + }); + focused.each(function (cell) { + matrixConfig.focusManager.set(component, cell); + }); }; var execute$4 = function (component, simulatedEvent, matrixConfig) { - return search(component.element).bind(function (focused) { - return matrixConfig.execute(component, simulatedEvent, focused); - }); + return search(component.element).bind(function (focused) { + return matrixConfig.execute(component, simulatedEvent, focused); + }); }; var toMatrix = function (rows, matrixConfig) { - return map(rows, function (row) { - return descendants(row, matrixConfig.selectors.cell); - }); + return map(rows, function (row) { + return descendants(row, matrixConfig.selectors.cell); + }); }; var doMove$2 = function (ifCycle, ifMove) { - return function (element, focused, matrixConfig) { - var move = matrixConfig.cycles ? ifCycle : ifMove; - return closest$3(focused, matrixConfig.selectors.row).bind(function (inRow) { - var cellsInRow = descendants(inRow, matrixConfig.selectors.cell); - return findIndex$1(cellsInRow, focused).bind(function (colIndex) { - var allRows = descendants(element, matrixConfig.selectors.row); - return findIndex$1(allRows, inRow).bind(function (rowIndex) { - var matrix = toMatrix(allRows, matrixConfig); - return move(matrix, rowIndex, colIndex).map(function (next) { - return next.cell; - }); - }); - }); - }); - }; + return function (element, focused, matrixConfig) { + var move = matrixConfig.cycles ? ifCycle : ifMove; + return closest$3(focused, matrixConfig.selectors.row).bind(function (inRow) { + var cellsInRow = descendants(inRow, matrixConfig.selectors.cell); + return findIndex$1(cellsInRow, focused).bind(function (colIndex) { + var allRows = descendants(element, matrixConfig.selectors.row); + return findIndex$1(allRows, inRow).bind(function (rowIndex) { + var matrix = toMatrix(allRows, matrixConfig); + return move(matrix, rowIndex, colIndex).map(function (next) { + return next.cell; + }); + }); + }); + }); + }; }; var moveLeft$3 = doMove$2(cycleLeft$1, moveLeft$2); var moveRight$3 = doMove$2(cycleRight$1, moveRight$2); var moveNorth$1 = doMove$2(cycleUp$1, moveUp); var moveSouth$1 = doMove$2(cycleDown$1, moveDown); var getKeydownRules$3 = constant([ - rule(inSet(LEFT), west$2(moveLeft$3, moveRight$3)), - rule(inSet(RIGHT), east$2(moveLeft$3, moveRight$3)), - rule(inSet(UP), north$2(moveNorth$1)), - rule(inSet(DOWN), south$2(moveSouth$1)), - rule(inSet(SPACE.concat(ENTER)), execute$4) + rule(inSet(LEFT), west$2(moveLeft$3, moveRight$3)), + rule(inSet(RIGHT), east$2(moveLeft$3, moveRight$3)), + rule(inSet(UP), north$2(moveNorth$1)), + rule(inSet(DOWN), south$2(moveSouth$1)), + rule(inSet(SPACE.concat(ENTER)), execute$4) ]); var getKeyupRules$3 = constant([rule(inSet(SPACE), stopEventForFirefox)]); var MatrixType = typical(schema$7, NoState.init, getKeydownRules$3, getKeyupRules$3, function () { - return Optional.some(focusIn$2); + return Optional.some(focusIn$2); }); var schema$8 = [ - strict$1('selector'), - defaulted$1('execute', defaultExecute), - defaulted$1('moveOnTab', false) + strict$1('selector'), + defaulted$1('execute', defaultExecute), + defaulted$1('moveOnTab', false) ]; var execute$5 = function (component, simulatedEvent, menuConfig) { - return menuConfig.focusManager.get(component).bind(function (focused) { - return menuConfig.execute(component, simulatedEvent, focused); - }); + return menuConfig.focusManager.get(component).bind(function (focused) { + return menuConfig.execute(component, simulatedEvent, focused); + }); }; var focusIn$3 = function (component, menuConfig, _state) { - descendant$1(component.element, menuConfig.selector).each(function (first) { - menuConfig.focusManager.set(component, first); - }); + descendant$1(component.element, menuConfig.selector).each(function (first) { + menuConfig.focusManager.set(component, first); + }); }; var moveUp$1 = function (element, focused, info) { - return horizontal(element, info.selector, focused, -1); + return horizontal(element, info.selector, focused, -1); }; var moveDown$1 = function (element, focused, info) { - return horizontal(element, info.selector, focused, +1); + return horizontal(element, info.selector, focused, +1); }; var fireShiftTab = function (component, simulatedEvent, menuConfig, menuState) { - return menuConfig.moveOnTab ? move(moveUp$1)(component, simulatedEvent, menuConfig, menuState) : Optional.none(); + return menuConfig.moveOnTab ? move(moveUp$1)(component, simulatedEvent, menuConfig, menuState) : Optional.none(); }; var fireTab = function (component, simulatedEvent, menuConfig, menuState) { - return menuConfig.moveOnTab ? move(moveDown$1)(component, simulatedEvent, menuConfig, menuState) : Optional.none(); + return menuConfig.moveOnTab ? move(moveDown$1)(component, simulatedEvent, menuConfig, menuState) : Optional.none(); }; var getKeydownRules$4 = constant([ - rule(inSet(UP), move(moveUp$1)), - rule(inSet(DOWN), move(moveDown$1)), - rule(and([ - isShift, - inSet(TAB) - ]), fireShiftTab), - rule(and([ - isNotShift, - inSet(TAB) - ]), fireTab), - rule(inSet(ENTER), execute$5), - rule(inSet(SPACE), execute$5) + rule(inSet(UP), move(moveUp$1)), + rule(inSet(DOWN), move(moveDown$1)), + rule(and([ + isShift, + inSet(TAB) + ]), fireShiftTab), + rule(and([ + isNotShift, + inSet(TAB) + ]), fireTab), + rule(inSet(ENTER), execute$5), + rule(inSet(SPACE), execute$5) ]); var getKeyupRules$4 = constant([rule(inSet(SPACE), stopEventForFirefox)]); var MenuType = typical(schema$8, NoState.init, getKeydownRules$4, getKeyupRules$4, function () { - return Optional.some(focusIn$3); + return Optional.some(focusIn$3); }); var schema$9 = [ - onKeyboardHandler('onSpace'), - onKeyboardHandler('onEnter'), - onKeyboardHandler('onShiftEnter'), - onKeyboardHandler('onLeft'), - onKeyboardHandler('onRight'), - onKeyboardHandler('onTab'), - onKeyboardHandler('onShiftTab'), - onKeyboardHandler('onUp'), - onKeyboardHandler('onDown'), - onKeyboardHandler('onEscape'), - defaulted$1('stopSpaceKeyup', false), - option('focusIn') + onKeyboardHandler('onSpace'), + onKeyboardHandler('onEnter'), + onKeyboardHandler('onShiftEnter'), + onKeyboardHandler('onLeft'), + onKeyboardHandler('onRight'), + onKeyboardHandler('onTab'), + onKeyboardHandler('onShiftTab'), + onKeyboardHandler('onUp'), + onKeyboardHandler('onDown'), + onKeyboardHandler('onEscape'), + defaulted$1('stopSpaceKeyup', false), + option('focusIn') ]; var getKeydownRules$5 = function (component, simulatedEvent, specialInfo) { - return [ - rule(inSet(SPACE), specialInfo.onSpace), - rule(and([ - isNotShift, - inSet(ENTER) - ]), specialInfo.onEnter), - rule(and([ - isShift, - inSet(ENTER) - ]), specialInfo.onShiftEnter), - rule(and([ - isShift, - inSet(TAB) - ]), specialInfo.onShiftTab), - rule(and([ - isNotShift, - inSet(TAB) - ]), specialInfo.onTab), - rule(inSet(UP), specialInfo.onUp), - rule(inSet(DOWN), specialInfo.onDown), - rule(inSet(LEFT), specialInfo.onLeft), - rule(inSet(RIGHT), specialInfo.onRight), - rule(inSet(SPACE), specialInfo.onSpace), - rule(inSet(ESCAPE), specialInfo.onEscape) - ]; + return [ + rule(inSet(SPACE), specialInfo.onSpace), + rule(and([ + isNotShift, + inSet(ENTER) + ]), specialInfo.onEnter), + rule(and([ + isShift, + inSet(ENTER) + ]), specialInfo.onShiftEnter), + rule(and([ + isShift, + inSet(TAB) + ]), specialInfo.onShiftTab), + rule(and([ + isNotShift, + inSet(TAB) + ]), specialInfo.onTab), + rule(inSet(UP), specialInfo.onUp), + rule(inSet(DOWN), specialInfo.onDown), + rule(inSet(LEFT), specialInfo.onLeft), + rule(inSet(RIGHT), specialInfo.onRight), + rule(inSet(SPACE), specialInfo.onSpace), + rule(inSet(ESCAPE), specialInfo.onEscape) + ]; }; var getKeyupRules$5 = function (component, simulatedEvent, specialInfo) { - return specialInfo.stopSpaceKeyup ? [rule(inSet(SPACE), stopEventForFirefox)] : []; + return specialInfo.stopSpaceKeyup ? [rule(inSet(SPACE), stopEventForFirefox)] : []; }; var SpecialType = typical(schema$9, NoState.init, getKeydownRules$5, getKeyupRules$5, function (specialInfo) { - return specialInfo.focusIn; + return specialInfo.focusIn; }); var acyclic = AcyclicType.schema(); @@ -7456,80 +7449,80 @@ }); var isFlatgridState = function (keyState) { - return hasNonNullableKey(keyState, 'setGridSize'); + return hasNonNullableKey(keyState, 'setGridSize'); }; var Keying = createModes$1({ - branchKey: 'mode', - branches: KeyboardBranches, - name: 'keying', - active: { - events: function (keyingConfig, keyingState) { - var handler = keyingConfig.handler; - return handler.toEvents(keyingConfig, keyingState); - } - }, - apis: { - focusIn: function (component, keyConfig, keyState) { - keyConfig.sendFocusIn(keyConfig).fold(function () { - component.getSystem().triggerFocus(component.element, component.element); - }, function (sendFocusIn) { - sendFocusIn(component, keyConfig, keyState); - }); - }, - setGridSize: function (component, keyConfig, keyState, numRows, numColumns) { - if (!isFlatgridState(keyState)) { - console.error('Layout does not support setGridSize'); - } else { - keyState.setGridSize(numRows, numColumns); - } - } + branchKey: 'mode', + branches: KeyboardBranches, + name: 'keying', + active: { + events: function (keyingConfig, keyingState) { + var handler = keyingConfig.handler; + return handler.toEvents(keyingConfig, keyingState); + } + }, + apis: { + focusIn: function (component, keyConfig, keyState) { + keyConfig.sendFocusIn(keyConfig).fold(function () { + component.getSystem().triggerFocus(component.element, component.element); + }, function (sendFocusIn) { + sendFocusIn(component, keyConfig, keyState); + }); }, - state: KeyingState + setGridSize: function (component, keyConfig, keyState, numRows, numColumns) { + if (!isFlatgridState(keyState)) { + console.error('Layout does not support setGridSize'); + } else { + keyState.setGridSize(numRows, numColumns); + } + } + }, + state: KeyingState }); var set$5 = function (component, replaceConfig, replaceState, data) { - preserve(function () { - var newChildren = map(data, component.getSystem().build); - replaceChildren(component, newChildren); - }, component.element); + preserve(function () { + var newChildren = map(data, component.getSystem().build); + replaceChildren(component, newChildren); + }, component.element); }; var insert = function (component, replaceConfig, insertion, childSpec) { - var child = component.getSystem().build(childSpec); - attachWith(component, child, insertion); + var child = component.getSystem().build(childSpec); + attachWith(component, child, insertion); }; var append$2 = function (component, replaceConfig, replaceState, appendee) { - insert(component, replaceConfig, append, appendee); + insert(component, replaceConfig, append, appendee); }; var prepend$1 = function (component, replaceConfig, replaceState, prependee) { - insert(component, replaceConfig, prepend, prependee); + insert(component, replaceConfig, prepend, prependee); }; var remove$7 = function (component, replaceConfig, replaceState, removee) { - var children = contents(component); - var foundChild = find(children, function (child) { - return eq$1(removee.element, child.element); - }); - foundChild.each(detach); + var children = contents(component); + var foundChild = find(children, function (child) { + return eq$1(removee.element, child.element); + }); + foundChild.each(detach); }; var contents = function (component, _replaceConfig) { - return component.components(); + return component.components(); }; var replaceAt = function (component, replaceConfig, replaceState, replaceeIndex, replacer) { - var children = contents(component); - return Optional.from(children[replaceeIndex]).map(function (replacee) { - remove$7(component, replaceConfig, replaceState, replacee); - replacer.each(function (r) { - insert(component, replaceConfig, function (p, c) { - appendAt(p, c, replaceeIndex); - }, r); - }); - return replacee; + var children = contents(component); + return Optional.from(children[replaceeIndex]).map(function (replacee) { + remove$7(component, replaceConfig, replaceState, replacee); + replacer.each(function (r) { + insert(component, replaceConfig, function (p, c) { + appendAt(p, c, replaceeIndex); + }, r); }); + return replacee; + }); }; var replaceBy = function (component, replaceConfig, replaceState, replaceePred, replacer) { - var children = contents(component); - return findIndex(children, replaceePred).bind(function (replaceeIndex) { - return replaceAt(component, replaceConfig, replaceState, replaceeIndex, replacer); - }); + var children = contents(component); + return findIndex(children, replaceePred).bind(function (replaceeIndex) { + return replaceAt(component, replaceConfig, replaceState, replaceeIndex, replacer); + }); }; var ReplaceApis = /*#__PURE__*/Object.freeze({ @@ -7544,46 +7537,46 @@ }); var Replacing = create$1({ - fields: [], - name: 'replacing', - apis: ReplaceApis + fields: [], + name: 'replacing', + apis: ReplaceApis }); var events$4 = function (name, eventHandlers) { - var events = derive(eventHandlers); - return create$1({ - fields: [strict$1('enabled')], - name: name, - active: {events: constant(events)} - }); + var events = derive(eventHandlers); + return create$1({ + fields: [strict$1('enabled')], + name: name, + active: { events: constant(events) } + }); }; var config = function (name, eventHandlers) { - var me = events$4(name, eventHandlers); - return { - key: name, - value: { - config: {}, - me: me, - configAsRaw: constant({}), - initialConfig: {}, - state: NoState - } - }; + var me = events$4(name, eventHandlers); + return { + key: name, + value: { + config: {}, + me: me, + configAsRaw: constant({}), + initialConfig: {}, + state: NoState + } + }; }; var focus$2 = function (component, focusConfig) { - if (!focusConfig.ignore) { - focus$1(component.element); - focusConfig.onFocus(component); - } + if (!focusConfig.ignore) { + focus$1(component.element); + focusConfig.onFocus(component); + } }; var blur$1 = function (component, focusConfig) { - if (!focusConfig.ignore) { - blur(component.element); - } + if (!focusConfig.ignore) { + blur(component.element); + } }; var isFocused = function (component) { - return hasFocus(component.element); + return hasFocus(component.element); }; var FocusApis = /*#__PURE__*/Object.freeze({ @@ -7594,15 +7587,15 @@ }); var exhibit$1 = function (base, focusConfig) { - var mod = focusConfig.ignore ? {} : {attributes: {tabindex: '-1'}}; - return nu$6(mod); + var mod = focusConfig.ignore ? {} : { attributes: { tabindex: '-1' } }; + return nu$6(mod); }; var events$5 = function (focusConfig) { - return derive([run(focus(), function (component, simulatedEvent) { - focus$2(component, focusConfig); - simulatedEvent.stop(); + return derive([run(focus(), function (component, simulatedEvent) { + focus$2(component, focusConfig); + simulatedEvent.stop(); })].concat(focusConfig.stopMousedown ? [run(mousedown(), function (_, simulatedEvent) { - simulatedEvent.event.prevent(); + simulatedEvent.event.prevent(); })] : [])); }; @@ -7613,78 +7606,78 @@ }); var FocusSchema = [ - onHandler('onFocus'), - defaulted$1('stopMousedown', false), - defaulted$1('ignore', false) + onHandler('onFocus'), + defaulted$1('stopMousedown', false), + defaulted$1('ignore', false) ]; var Focusing = create$1({ - fields: FocusSchema, - name: 'focusing', - active: ActiveFocus, - apis: FocusApis + fields: FocusSchema, + name: 'focusing', + active: ActiveFocus, + apis: FocusApis }); var SetupBehaviourCellState = function (initialState) { - var init = function () { - var cell = Cell(initialState); - var get = function () { - return cell.get(); - }; - var set = function (newState) { - return cell.set(newState); - }; - var clear = function () { - return cell.set(initialState); - }; - var readState = function () { - return cell.get(); - }; - return { - get: get, - set: set, - clear: clear, - readState: readState - }; + var init = function () { + var cell = Cell(initialState); + var get = function () { + return cell.get(); + }; + var set = function (newState) { + return cell.set(newState); + }; + var clear = function () { + return cell.set(initialState); + }; + var readState = function () { + return cell.get(); }; - return {init: init}; + return { + get: get, + set: set, + clear: clear, + readState: readState + }; + }; + return { init: init }; }; var updateAriaState = function (component, toggleConfig, toggleState) { - var ariaInfo = toggleConfig.aria; - ariaInfo.update(component, ariaInfo, toggleState.get()); + var ariaInfo = toggleConfig.aria; + ariaInfo.update(component, ariaInfo, toggleState.get()); }; var updateClass = function (component, toggleConfig, toggleState) { - toggleConfig.toggleClass.each(function (toggleClass) { - if (toggleState.get()) { - add$2(component.element, toggleClass); - } else { - remove$4(component.element, toggleClass); - } - }); + toggleConfig.toggleClass.each(function (toggleClass) { + if (toggleState.get()) { + add$2(component.element, toggleClass); + } else { + remove$4(component.element, toggleClass); + } + }); }; var toggle = function (component, toggleConfig, toggleState) { - set$6(component, toggleConfig, toggleState, !toggleState.get()); + set$6(component, toggleConfig, toggleState, !toggleState.get()); }; var on$1 = function (component, toggleConfig, toggleState) { - toggleState.set(true); - updateClass(component, toggleConfig, toggleState); - updateAriaState(component, toggleConfig, toggleState); + toggleState.set(true); + updateClass(component, toggleConfig, toggleState); + updateAriaState(component, toggleConfig, toggleState); }; var off = function (component, toggleConfig, toggleState) { - toggleState.set(false); - updateClass(component, toggleConfig, toggleState); - updateAriaState(component, toggleConfig, toggleState); + toggleState.set(false); + updateClass(component, toggleConfig, toggleState); + updateAriaState(component, toggleConfig, toggleState); }; var set$6 = function (component, toggleConfig, toggleState, state) { - var action = state ? on$1 : off; - action(component, toggleConfig, toggleState); + var action = state ? on$1 : off; + action(component, toggleConfig, toggleState); }; var isOn = function (component, toggleConfig, toggleState) { - return toggleState.get(); + return toggleState.get(); }; var onLoad$4 = function (component, toggleConfig, toggleState) { - set$6(component, toggleConfig, toggleState, toggleConfig.selected); + set$6(component, toggleConfig, toggleState, toggleConfig.selected); }; var ToggleApis = /*#__PURE__*/Object.freeze({ @@ -7698,15 +7691,15 @@ }); var exhibit$2 = function () { - return nu$6({}); + return nu$6({}); }; var events$6 = function (toggleConfig, toggleState) { - var execute = executeEvent(toggleConfig, toggleState, toggle); - var load = loadEvent(toggleConfig, toggleState, onLoad$4); - return derive(flatten([ - toggleConfig.toggleOnExecute ? [execute] : [], - [load] - ])); + var execute = executeEvent(toggleConfig, toggleState, toggle); + var load = loadEvent(toggleConfig, toggleState, onLoad$4); + return derive(flatten([ + toggleConfig.toggleOnExecute ? [execute] : [], + [load] + ])); }; var ActiveToggle = /*#__PURE__*/Object.freeze({ @@ -7716,2085 +7709,2085 @@ }); var updatePressed = function (component, ariaInfo, status) { - set$1(component.element, 'aria-pressed', status); - if (ariaInfo.syncWithExpanded) { - updateExpanded(component, ariaInfo, status); - } + set$1(component.element, 'aria-pressed', status); + if (ariaInfo.syncWithExpanded) { + updateExpanded(component, ariaInfo, status); + } }; var updateSelected = function (component, ariaInfo, status) { - set$1(component.element, 'aria-selected', status); + set$1(component.element, 'aria-selected', status); }; var updateChecked = function (component, ariaInfo, status) { - set$1(component.element, 'aria-checked', status); + set$1(component.element, 'aria-checked', status); }; var updateExpanded = function (component, ariaInfo, status) { - set$1(component.element, 'aria-expanded', status); + set$1(component.element, 'aria-expanded', status); }; var ToggleSchema = [ - defaulted$1('selected', false), - option('toggleClass'), - defaulted$1('toggleOnExecute', true), - defaultedOf('aria', {mode: 'none'}, choose$1('mode', { - pressed: [ - defaulted$1('syncWithExpanded', false), - output('update', updatePressed) - ], - checked: [output('update', updateChecked)], - expanded: [output('update', updateExpanded)], - selected: [output('update', updateSelected)], - none: [output('update', noop)] - })) + defaulted$1('selected', false), + option('toggleClass'), + defaulted$1('toggleOnExecute', true), + defaultedOf('aria', { mode: 'none' }, choose$1('mode', { + pressed: [ + defaulted$1('syncWithExpanded', false), + output('update', updatePressed) + ], + checked: [output('update', updateChecked)], + expanded: [output('update', updateExpanded)], + selected: [output('update', updateSelected)], + none: [output('update', noop)] + })) ]; var Toggling = create$1({ - fields: ToggleSchema, - name: 'toggling', - active: ActiveToggle, - apis: ToggleApis, - state: SetupBehaviourCellState(false) + fields: ToggleSchema, + name: 'toggling', + active: ActiveToggle, + apis: ToggleApis, + state: SetupBehaviourCellState(false) }); var pointerEvents = function () { - var onClick = function (component, simulatedEvent) { - simulatedEvent.stop(); - emitExecute(component); - }; - return [ - run(click(), onClick), - run(tap(), onClick), - cutter(touchstart()), - cutter(mousedown()) - ]; + var onClick = function (component, simulatedEvent) { + simulatedEvent.stop(); + emitExecute(component); + }; + return [ + run(click(), onClick), + run(tap(), onClick), + cutter(touchstart()), + cutter(mousedown()) + ]; }; var events$7 = function (optAction) { - var executeHandler = function (action) { - return runOnExecute(function (component, simulatedEvent) { - action(component); - simulatedEvent.stop(); - }); - }; - return derive(flatten([ - optAction.map(executeHandler).toArray(), - pointerEvents() - ])); + var executeHandler = function (action) { + return runOnExecute(function (component, simulatedEvent) { + action(component); + simulatedEvent.stop(); + }); + }; + return derive(flatten([ + optAction.map(executeHandler).toArray(), + pointerEvents() + ])); }; var hoverEvent = 'alloy.item-hover'; var focusEvent = 'alloy.item-focus'; var onHover = function (item) { - if (search(item.element).isNone() || Focusing.isFocused(item)) { - if (!Focusing.isFocused(item)) { - Focusing.focus(item); - } - emitWith(item, hoverEvent, {item: item}); + if (search(item.element).isNone() || Focusing.isFocused(item)) { + if (!Focusing.isFocused(item)) { + Focusing.focus(item); } + emitWith(item, hoverEvent, { item: item }); + } }; var onFocus = function (item) { - emitWith(item, focusEvent, {item: item}); + emitWith(item, focusEvent, { item: item }); }; var hover = constant(hoverEvent); var focus$3 = constant(focusEvent); var builder = function (detail) { - return { - dom: detail.dom, - domModification: __assign(__assign({}, detail.domModification), {attributes: __assign(__assign(__assign({'role': detail.toggling.isSome() ? 'menuitemcheckbox' : 'menuitem'}, detail.domModification.attributes), {'aria-haspopup': detail.hasSubmenu}), detail.hasSubmenu ? {'aria-expanded': false} : {})}), - behaviours: SketchBehaviours.augment(detail.itemBehaviours, [ - detail.toggling.fold(Toggling.revoke, function (tConfig) { - return Toggling.config(__assign({aria: {mode: 'checked'}}, tConfig)); - }), - Focusing.config({ - ignore: detail.ignoreFocus, - stopMousedown: detail.ignoreFocus, - onFocus: function (component) { - onFocus(component); - } - }), - Keying.config({mode: 'execution'}), - Representing.config({ - store: { - mode: 'memory', - initialValue: detail.data - } - }), - config('item-type-events', __spreadArrays(pointerEvents(), [ - run(mouseover(), onHover), - run(focusItem(), Focusing.focus) - ])) - ]), - components: detail.components, - eventOrder: detail.eventOrder - }; + return { + dom: detail.dom, + domModification: __assign(__assign({}, detail.domModification), { attributes: __assign(__assign(__assign({ 'role': detail.toggling.isSome() ? 'menuitemcheckbox' : 'menuitem' }, detail.domModification.attributes), { 'aria-haspopup': detail.hasSubmenu }), detail.hasSubmenu ? { 'aria-expanded': false } : {}) }), + behaviours: SketchBehaviours.augment(detail.itemBehaviours, [ + detail.toggling.fold(Toggling.revoke, function (tConfig) { + return Toggling.config(__assign({ aria: { mode: 'checked' } }, tConfig)); + }), + Focusing.config({ + ignore: detail.ignoreFocus, + stopMousedown: detail.ignoreFocus, + onFocus: function (component) { + onFocus(component); + } + }), + Keying.config({ mode: 'execution' }), + Representing.config({ + store: { + mode: 'memory', + initialValue: detail.data + } + }), + config('item-type-events', __spreadArrays(pointerEvents(), [ + run(mouseover(), onHover), + run(focusItem(), Focusing.focus) + ])) + ]), + components: detail.components, + eventOrder: detail.eventOrder + }; }; var schema$a = [ - strict$1('data'), - strict$1('components'), - strict$1('dom'), - defaulted$1('hasSubmenu', false), - option('toggling'), - SketchBehaviours.field('itemBehaviours', [ - Toggling, - Focusing, - Keying, - Representing - ]), - defaulted$1('ignoreFocus', false), - defaulted$1('domModification', {}), - output('builder', builder), - defaulted$1('eventOrder', {}) + strict$1('data'), + strict$1('components'), + strict$1('dom'), + defaulted$1('hasSubmenu', false), + option('toggling'), + SketchBehaviours.field('itemBehaviours', [ + Toggling, + Focusing, + Keying, + Representing + ]), + defaulted$1('ignoreFocus', false), + defaulted$1('domModification', {}), + output('builder', builder), + defaulted$1('eventOrder', {}) ]; var builder$1 = function (detail) { - return { - dom: detail.dom, - components: detail.components, - events: derive([stopper(focusItem())]) - }; + return { + dom: detail.dom, + components: detail.components, + events: derive([stopper(focusItem())]) + }; }; var schema$b = [ - strict$1('dom'), - strict$1('components'), - output('builder', builder$1) + strict$1('dom'), + strict$1('components'), + output('builder', builder$1) ]; var owner$2 = function () { - return 'item-widget'; + return 'item-widget'; }; var parts = constant([required({ name: 'widget', overrides: function (detail) { - return { - behaviours: derive$1([Representing.config({ - store: { - mode: 'manual', - getValue: function (_component) { - return detail.data; - }, - setValue: function () { - } - } - })]) - }; + return { + behaviours: derive$1([Representing.config({ + store: { + mode: 'manual', + getValue: function (_component) { + return detail.data; + }, + setValue: function () { + } + } + })]) + }; } - })]); + })]); var builder$2 = function (detail) { - var subs = substitutes(owner$2(), detail, parts()); - var components$1 = components(owner$2(), detail, subs.internals()); - var focusWidget = function (component) { - return getPart(component, detail, 'widget').map(function (widget) { - Keying.focusIn(widget); - return widget; - }); - }; - var onHorizontalArrow = function (component, simulatedEvent) { - return inside(simulatedEvent.event.target) ? Optional.none() : function () { - if (detail.autofocus) { - simulatedEvent.setSource(component.element); - return Optional.none(); - } else { - return Optional.none(); - } - }(); - }; - return { - dom: detail.dom, - components: components$1, - domModification: detail.domModification, - events: derive([ - runOnExecute(function (component, simulatedEvent) { - focusWidget(component).each(function (_widget) { - simulatedEvent.stop(); - }); - }), - run(mouseover(), onHover), - run(focusItem(), function (component, _simulatedEvent) { - if (detail.autofocus) { - focusWidget(component); - } else { - Focusing.focus(component); - } - }) - ]), - behaviours: SketchBehaviours.augment(detail.widgetBehaviours, [ - Representing.config({ - store: { - mode: 'memory', - initialValue: detail.data - } - }), - Focusing.config({ - ignore: detail.ignoreFocus, - onFocus: function (component) { - onFocus(component); - } - }), - Keying.config({ - mode: 'special', - focusIn: detail.autofocus ? function (component) { - focusWidget(component); - } : revoke(), - onLeft: onHorizontalArrow, - onRight: onHorizontalArrow, - onEscape: function (component, simulatedEvent) { - if (!Focusing.isFocused(component) && !detail.autofocus) { - Focusing.focus(component); - return Optional.some(true); - } else if (detail.autofocus) { - simulatedEvent.setSource(component.element); - return Optional.none(); - } else { - return Optional.none(); - } - } - }) - ]) - }; + var subs = substitutes(owner$2(), detail, parts()); + var components$1 = components(owner$2(), detail, subs.internals()); + var focusWidget = function (component) { + return getPart(component, detail, 'widget').map(function (widget) { + Keying.focusIn(widget); + return widget; + }); + }; + var onHorizontalArrow = function (component, simulatedEvent) { + return inside(simulatedEvent.event.target) ? Optional.none() : function () { + if (detail.autofocus) { + simulatedEvent.setSource(component.element); + return Optional.none(); + } else { + return Optional.none(); + } + }(); + }; + return { + dom: detail.dom, + components: components$1, + domModification: detail.domModification, + events: derive([ + runOnExecute(function (component, simulatedEvent) { + focusWidget(component).each(function (_widget) { + simulatedEvent.stop(); + }); + }), + run(mouseover(), onHover), + run(focusItem(), function (component, _simulatedEvent) { + if (detail.autofocus) { + focusWidget(component); + } else { + Focusing.focus(component); + } + }) + ]), + behaviours: SketchBehaviours.augment(detail.widgetBehaviours, [ + Representing.config({ + store: { + mode: 'memory', + initialValue: detail.data + } + }), + Focusing.config({ + ignore: detail.ignoreFocus, + onFocus: function (component) { + onFocus(component); + } + }), + Keying.config({ + mode: 'special', + focusIn: detail.autofocus ? function (component) { + focusWidget(component); + } : revoke(), + onLeft: onHorizontalArrow, + onRight: onHorizontalArrow, + onEscape: function (component, simulatedEvent) { + if (!Focusing.isFocused(component) && !detail.autofocus) { + Focusing.focus(component); + return Optional.some(true); + } else if (detail.autofocus) { + simulatedEvent.setSource(component.element); + return Optional.none(); + } else { + return Optional.none(); + } + } + }) + ]) + }; }; var schema$c = [ - strict$1('uid'), - strict$1('data'), - strict$1('components'), - strict$1('dom'), - defaulted$1('autofocus', false), - defaulted$1('ignoreFocus', false), - SketchBehaviours.field('widgetBehaviours', [ - Representing, - Focusing, - Keying - ]), - defaulted$1('domModification', {}), - defaultUidsSchema(parts()), - output('builder', builder$2) + strict$1('uid'), + strict$1('data'), + strict$1('components'), + strict$1('dom'), + defaulted$1('autofocus', false), + defaulted$1('ignoreFocus', false), + SketchBehaviours.field('widgetBehaviours', [ + Representing, + Focusing, + Keying + ]), + defaulted$1('domModification', {}), + defaultUidsSchema(parts()), + output('builder', builder$2) ]; var itemSchema$1 = choose$1('type', { - widget: schema$c, - item: schema$a, - separator: schema$b + widget: schema$c, + item: schema$a, + separator: schema$b }); var configureGrid = function (detail, movementInfo) { - return { - mode: 'flatgrid', - selector: '.' + detail.markers.item, - initSize: { - numColumns: movementInfo.initSize.numColumns, - numRows: movementInfo.initSize.numRows - }, - focusManager: detail.focusManager - }; + return { + mode: 'flatgrid', + selector: '.' + detail.markers.item, + initSize: { + numColumns: movementInfo.initSize.numColumns, + numRows: movementInfo.initSize.numRows + }, + focusManager: detail.focusManager + }; }; var configureMatrix = function (detail, movementInfo) { - return { - mode: 'matrix', - selectors: { - row: movementInfo.rowSelector, - cell: '.' + detail.markers.item - }, - focusManager: detail.focusManager - }; + return { + mode: 'matrix', + selectors: { + row: movementInfo.rowSelector, + cell: '.' + detail.markers.item + }, + focusManager: detail.focusManager + }; }; var configureMenu = function (detail, movementInfo) { - return { - mode: 'menu', - selector: '.' + detail.markers.item, - moveOnTab: movementInfo.moveOnTab, - focusManager: detail.focusManager - }; + return { + mode: 'menu', + selector: '.' + detail.markers.item, + moveOnTab: movementInfo.moveOnTab, + focusManager: detail.focusManager + }; }; var parts$1 = constant([group({ factory: { - sketch: function (spec) { - var itemInfo = asRawOrDie('menu.spec item', itemSchema$1, spec); - return itemInfo.builder(itemInfo); - } + sketch: function (spec) { + var itemInfo = asRawOrDie('menu.spec item', itemSchema$1, spec); + return itemInfo.builder(itemInfo); + } }, name: 'items', unit: 'item', defaults: function (detail, u) { - return u.hasOwnProperty('uid') ? u : __assign(__assign({}, u), {uid: generate$2('item')}); + return u.hasOwnProperty('uid') ? u : __assign(__assign({}, u), { uid: generate$2('item') }); }, overrides: function (detail, u) { - return { - type: u.type, - ignoreFocus: detail.fakeFocus, - domModification: {classes: [detail.markers.item]} - }; + return { + type: u.type, + ignoreFocus: detail.fakeFocus, + domModification: { classes: [detail.markers.item] } + }; } - })]); + })]); var schema$d = constant([ - strict$1('value'), - strict$1('items'), - strict$1('dom'), - strict$1('components'), - defaulted$1('eventOrder', {}), - field$1('menuBehaviours', [ - Highlighting, - Representing, - Composing, - Keying - ]), - defaultedOf('movement', { - mode: 'menu', - moveOnTab: true - }, choose$1('mode', { - grid: [ - initSize(), - output('config', configureGrid) - ], - matrix: [ - output('config', configureMatrix), - strict$1('rowSelector') - ], - menu: [ - defaulted$1('moveOnTab', true), - output('config', configureMenu) - ] - })), - itemMarkers(), - defaulted$1('fakeFocus', false), - defaulted$1('focusManager', dom()), - onHandler('onHighlight') + strict$1('value'), + strict$1('items'), + strict$1('dom'), + strict$1('components'), + defaulted$1('eventOrder', {}), + field$1('menuBehaviours', [ + Highlighting, + Representing, + Composing, + Keying + ]), + defaultedOf('movement', { + mode: 'menu', + moveOnTab: true + }, choose$1('mode', { + grid: [ + initSize(), + output('config', configureGrid) + ], + matrix: [ + output('config', configureMatrix), + strict$1('rowSelector') + ], + menu: [ + defaulted$1('moveOnTab', true), + output('config', configureMenu) + ] + })), + itemMarkers(), + defaulted$1('fakeFocus', false), + defaulted$1('focusManager', dom()), + onHandler('onHighlight') ]); var focus$4 = constant('alloy.menu-focus'); var make$1 = function (detail, components, _spec, _externals) { - return { - uid: detail.uid, - dom: detail.dom, - markers: detail.markers, - behaviours: augment(detail.menuBehaviours, [ - Highlighting.config({ - highlightClass: detail.markers.selectedItem, - itemClass: detail.markers.item, - onHighlight: detail.onHighlight - }), - Representing.config({ - store: { - mode: 'memory', - initialValue: detail.value - } - }), - Composing.config({find: Optional.some}), - Keying.config(detail.movement.config(detail, detail.movement)) - ]), - events: derive([ - run(focus$3(), function (menu, simulatedEvent) { - var event = simulatedEvent.event; - menu.getSystem().getByDom(event.target).each(function (item) { - Highlighting.highlight(menu, item); - simulatedEvent.stop(); - emitWith(menu, focus$4(), { - menu: menu, - item: item - }); - }); - }), - run(hover(), function (menu, simulatedEvent) { - var item = simulatedEvent.event.item; - Highlighting.highlight(menu, item); - }) - ]), - components: components, - eventOrder: detail.eventOrder, - domModification: {attributes: {role: 'menu'}} - }; + return { + uid: detail.uid, + dom: detail.dom, + markers: detail.markers, + behaviours: augment(detail.menuBehaviours, [ + Highlighting.config({ + highlightClass: detail.markers.selectedItem, + itemClass: detail.markers.item, + onHighlight: detail.onHighlight + }), + Representing.config({ + store: { + mode: 'memory', + initialValue: detail.value + } + }), + Composing.config({ find: Optional.some }), + Keying.config(detail.movement.config(detail, detail.movement)) + ]), + events: derive([ + run(focus$3(), function (menu, simulatedEvent) { + var event = simulatedEvent.event; + menu.getSystem().getByDom(event.target).each(function (item) { + Highlighting.highlight(menu, item); + simulatedEvent.stop(); + emitWith(menu, focus$4(), { + menu: menu, + item: item + }); + }); + }), + run(hover(), function (menu, simulatedEvent) { + var item = simulatedEvent.event.item; + Highlighting.highlight(menu, item); + }) + ]), + components: components, + eventOrder: detail.eventOrder, + domModification: { attributes: { role: 'menu' } } + }; }; var Menu = composite$1({ - name: 'Menu', - configFields: schema$d(), - partFields: parts$1(), - factory: make$1 + name: 'Menu', + configFields: schema$d(), + partFields: parts$1(), + factory: make$1 }); var transpose = function (obj) { - return tupleMap(obj, function (v, k) { - return { - k: v, - v: k - }; - }); + return tupleMap(obj, function (v, k) { + return { + k: v, + v: k + }; + }); }; var trace = function (items, byItem, byMenu, finish) { - return get$1(byMenu, finish).bind(function (triggerItem) { - return get$1(items, triggerItem).bind(function (triggerMenu) { - var rest = trace(items, byItem, byMenu, triggerMenu); - return Optional.some([triggerMenu].concat(rest)); - }); - }).getOr([]); + return get$1(byMenu, finish).bind(function (triggerItem) { + return get$1(items, triggerItem).bind(function (triggerMenu) { + var rest = trace(items, byItem, byMenu, triggerMenu); + return Optional.some([triggerMenu].concat(rest)); + }); + }).getOr([]); }; var generate$5 = function (menus, expansions) { - var items = {}; - each$1(menus, function (menuItems, menu) { - each(menuItems, function (item) { - items[item] = menu; - }); - }); - var byItem = expansions; - var byMenu = transpose(expansions); - var menuPaths = map$2(byMenu, function (_triggerItem, submenu) { - return [submenu].concat(trace(items, byItem, byMenu, submenu)); - }); - return map$2(items, function (menu) { - return get$1(menuPaths, menu).getOr([menu]); - }); + var items = {}; + each$1(menus, function (menuItems, menu) { + each(menuItems, function (item) { + items[item] = menu; + }); + }); + var byItem = expansions; + var byMenu = transpose(expansions); + var menuPaths = map$2(byMenu, function (_triggerItem, submenu) { + return [submenu].concat(trace(items, byItem, byMenu, submenu)); + }); + return map$2(items, function (menu) { + return get$1(menuPaths, menu).getOr([menu]); + }); }; var init$3 = function () { - var expansions = Cell({}); - var menus = Cell({}); - var paths = Cell({}); - var primary = Cell(Optional.none()); - var directory = Cell({}); - var clear = function () { - expansions.set({}); - menus.set({}); - paths.set({}); - primary.set(Optional.none()); - }; - var isClear = function () { - return primary.get().isNone(); - }; - var setMenuBuilt = function (menuName, built) { - var _a; - menus.set(__assign(__assign({}, menus.get()), (_a = {}, _a[menuName] = { - type: 'prepared', - menu: built - }, _a))); - }; - var setContents = function (sPrimary, sMenus, sExpansions, dir) { - primary.set(Optional.some(sPrimary)); - expansions.set(sExpansions); - menus.set(sMenus); - directory.set(dir); - var sPaths = generate$5(dir, sExpansions); - paths.set(sPaths); - }; - var getTriggeringItem = function (menuValue) { - return find$1(expansions.get(), function (v, _k) { - return v === menuValue; - }); - }; - var getTriggerData = function (menuValue, getItemByValue, path) { - return getPreparedMenu(menuValue).bind(function (menu) { - return getTriggeringItem(menuValue).bind(function (triggeringItemValue) { - return getItemByValue(triggeringItemValue).map(function (triggeredItem) { - return { - triggeredMenu: menu, - triggeringItem: triggeredItem, - triggeringPath: path - }; - }); - }); - }); - }; - var getTriggeringPath = function (itemValue, getItemByValue) { - var extraPath = filter(lookupItem(itemValue).toArray(), function (menuValue) { - return getPreparedMenu(menuValue).isSome(); - }); - return get$1(paths.get(), itemValue).bind(function (path) { - var revPath = reverse(extraPath.concat(path)); - var triggers = bind(revPath, function (menuValue, menuIndex) { - return getTriggerData(menuValue, getItemByValue, revPath.slice(0, menuIndex + 1)).fold(function () { - return primary.get().is(menuValue) ? [] : [Optional.none()]; - }, function (data) { - return [Optional.some(data)]; - }); - }); - return sequence(triggers); - }); - }; - var expand = function (itemValue) { - return get$1(expansions.get(), itemValue).map(function (menu) { - var current = get$1(paths.get(), itemValue).getOr([]); - return [menu].concat(current); - }); - }; - var collapse = function (itemValue) { - return get$1(paths.get(), itemValue).bind(function (path) { - return path.length > 1 ? Optional.some(path.slice(1)) : Optional.none(); - }); - }; - var refresh = function (itemValue) { - return get$1(paths.get(), itemValue); - }; - var getPreparedMenu = function (menuValue) { - return lookupMenu(menuValue).bind(extractPreparedMenu); - }; - var lookupMenu = function (menuValue) { - return get$1(menus.get(), menuValue); - }; - var lookupItem = function (itemValue) { - return get$1(expansions.get(), itemValue); - }; - var otherMenus = function (path) { - var menuValues = directory.get(); - return difference(keys(menuValues), path); - }; - var getPrimary = function () { - return primary.get().bind(getPreparedMenu); - }; - var getMenus = function () { - return menus.get(); - }; - return { - setMenuBuilt: setMenuBuilt, - setContents: setContents, - expand: expand, - refresh: refresh, - collapse: collapse, - lookupMenu: lookupMenu, - lookupItem: lookupItem, - otherMenus: otherMenus, - getPrimary: getPrimary, - getMenus: getMenus, - clear: clear, - isClear: isClear, - getTriggeringPath: getTriggeringPath - }; + var expansions = Cell({}); + var menus = Cell({}); + var paths = Cell({}); + var primary = Cell(Optional.none()); + var directory = Cell({}); + var clear = function () { + expansions.set({}); + menus.set({}); + paths.set({}); + primary.set(Optional.none()); + }; + var isClear = function () { + return primary.get().isNone(); + }; + var setMenuBuilt = function (menuName, built) { + var _a; + menus.set(__assign(__assign({}, menus.get()), (_a = {}, _a[menuName] = { + type: 'prepared', + menu: built + }, _a))); + }; + var setContents = function (sPrimary, sMenus, sExpansions, dir) { + primary.set(Optional.some(sPrimary)); + expansions.set(sExpansions); + menus.set(sMenus); + directory.set(dir); + var sPaths = generate$5(dir, sExpansions); + paths.set(sPaths); + }; + var getTriggeringItem = function (menuValue) { + return find$1(expansions.get(), function (v, _k) { + return v === menuValue; + }); + }; + var getTriggerData = function (menuValue, getItemByValue, path) { + return getPreparedMenu(menuValue).bind(function (menu) { + return getTriggeringItem(menuValue).bind(function (triggeringItemValue) { + return getItemByValue(triggeringItemValue).map(function (triggeredItem) { + return { + triggeredMenu: menu, + triggeringItem: triggeredItem, + triggeringPath: path + }; + }); + }); + }); + }; + var getTriggeringPath = function (itemValue, getItemByValue) { + var extraPath = filter(lookupItem(itemValue).toArray(), function (menuValue) { + return getPreparedMenu(menuValue).isSome(); + }); + return get$1(paths.get(), itemValue).bind(function (path) { + var revPath = reverse(extraPath.concat(path)); + var triggers = bind(revPath, function (menuValue, menuIndex) { + return getTriggerData(menuValue, getItemByValue, revPath.slice(0, menuIndex + 1)).fold(function () { + return primary.get().is(menuValue) ? [] : [Optional.none()]; + }, function (data) { + return [Optional.some(data)]; + }); + }); + return sequence(triggers); + }); + }; + var expand = function (itemValue) { + return get$1(expansions.get(), itemValue).map(function (menu) { + var current = get$1(paths.get(), itemValue).getOr([]); + return [menu].concat(current); + }); + }; + var collapse = function (itemValue) { + return get$1(paths.get(), itemValue).bind(function (path) { + return path.length > 1 ? Optional.some(path.slice(1)) : Optional.none(); + }); + }; + var refresh = function (itemValue) { + return get$1(paths.get(), itemValue); + }; + var getPreparedMenu = function (menuValue) { + return lookupMenu(menuValue).bind(extractPreparedMenu); + }; + var lookupMenu = function (menuValue) { + return get$1(menus.get(), menuValue); + }; + var lookupItem = function (itemValue) { + return get$1(expansions.get(), itemValue); + }; + var otherMenus = function (path) { + var menuValues = directory.get(); + return difference(keys(menuValues), path); + }; + var getPrimary = function () { + return primary.get().bind(getPreparedMenu); + }; + var getMenus = function () { + return menus.get(); + }; + return { + setMenuBuilt: setMenuBuilt, + setContents: setContents, + expand: expand, + refresh: refresh, + collapse: collapse, + lookupMenu: lookupMenu, + lookupItem: lookupItem, + otherMenus: otherMenus, + getPrimary: getPrimary, + getMenus: getMenus, + clear: clear, + isClear: isClear, + getTriggeringPath: getTriggeringPath + }; }; var extractPreparedMenu = function (prep) { - return prep.type === 'prepared' ? Optional.some(prep.menu) : Optional.none(); + return prep.type === 'prepared' ? Optional.some(prep.menu) : Optional.none(); }; var LayeredState = { - init: init$3, - extractPreparedMenu: extractPreparedMenu + init: init$3, + extractPreparedMenu: extractPreparedMenu }; var make$2 = function (detail, _rawUiSpec) { - var submenuParentItems = Cell(Optional.none()); - var buildMenus = function (container, primaryName, menus) { - return map$2(menus, function (spec, name) { - var makeSketch = function () { - return Menu.sketch(__assign(__assign({}, spec), { - value: name, - markers: detail.markers, - fakeFocus: detail.fakeFocus, - onHighlight: detail.onHighlight, - focusManager: detail.fakeFocus ? highlights() : dom() - })); - }; - return name === primaryName ? { - type: 'prepared', - menu: container.getSystem().build(makeSketch()) - } : { - type: 'notbuilt', - nbMenu: makeSketch - }; - }); - }; - var layeredState = LayeredState.init(); - var setup = function (container) { - var componentMap = buildMenus(container, detail.data.primary, detail.data.menus); - var directory = toDirectory(); - layeredState.setContents(detail.data.primary, componentMap, detail.data.expansions, directory); - return layeredState.getPrimary(); - }; - var getItemValue = function (item) { - return Representing.getValue(item).value; - }; - var getItemByValue = function (_container, menus, itemValue) { - return findMap(menus, function (menu) { - if (!menu.getSystem().isConnected()) { - return Optional.none(); - } - var candidates = Highlighting.getCandidates(menu); - return find(candidates, function (c) { - return getItemValue(c) === itemValue; - }); - }); - }; - var toDirectory = function (_container) { - return map$2(detail.data.menus, function (data, _menuName) { - return bind(data.items, function (item) { - return item.type === 'separator' ? [] : [item.data.value]; - }); - }); - }; - var setActiveMenu = function (container, menu) { - Highlighting.highlight(container, menu); - Highlighting.getHighlighted(menu).orThunk(function () { - return Highlighting.getFirst(menu); - }).each(function (item) { - dispatch(container, item.element, focusItem()); - }); - }; - var getMenus = function (state, menuValues) { - return cat(map(menuValues, function (mv) { - return state.lookupMenu(mv).bind(function (prep) { - return prep.type === 'prepared' ? Optional.some(prep.menu) : Optional.none(); - }); + var submenuParentItems = Cell(Optional.none()); + var buildMenus = function (container, primaryName, menus) { + return map$2(menus, function (spec, name) { + var makeSketch = function () { + return Menu.sketch(__assign(__assign({}, spec), { + value: name, + markers: detail.markers, + fakeFocus: detail.fakeFocus, + onHighlight: detail.onHighlight, + focusManager: detail.fakeFocus ? highlights() : dom() })); - }; - var closeOthers = function (container, state, path) { - var others = getMenus(state, state.otherMenus(path)); - each(others, function (o) { - remove$5(o.element, [detail.markers.backgroundMenu]); - if (!detail.stayInDom) { - Replacing.remove(container, o); - } - }); - }; - var getSubmenuParents = function (container) { - return submenuParentItems.get().getOrThunk(function () { - var r = {}; - var items = descendants(container.element, '.' + detail.markers.item); - var parentItems = filter(items, function (i) { - return get$3(i, 'aria-haspopup') === 'true'; - }); - each(parentItems, function (i) { - container.getSystem().getByDom(i).each(function (itemComp) { - var key = getItemValue(itemComp); - r[key] = itemComp; - }); - }); - submenuParentItems.set(Optional.some(r)); - return r; - }); - }; - var updateAriaExpansions = function (container, path) { - var parentItems = getSubmenuParents(container); - each$1(parentItems, function (v, k) { - var expanded = contains(path, k); - set$1(v.element, 'aria-expanded', expanded); - }); - }; - var updateMenuPath = function (container, state, path) { - return Optional.from(path[0]).bind(function (latestMenuName) { - return state.lookupMenu(latestMenuName).bind(function (menuPrep) { - if (menuPrep.type === 'notbuilt') { - return Optional.none(); - } else { - var activeMenu = menuPrep.menu; - var rest = getMenus(state, path.slice(1)); - each(rest, function (r) { - add$2(r.element, detail.markers.backgroundMenu); - }); - if (!inBody(activeMenu.element)) { - Replacing.append(container, premade$1(activeMenu)); - } - remove$5(activeMenu.element, [detail.markers.backgroundMenu]); - setActiveMenu(container, activeMenu); - closeOthers(container, state, path); - return Optional.some(activeMenu); - } - }); - }); - }; - var ExpandHighlightDecision; - (function (ExpandHighlightDecision) { - ExpandHighlightDecision[ExpandHighlightDecision['HighlightSubmenu'] = 0] = 'HighlightSubmenu'; - ExpandHighlightDecision[ExpandHighlightDecision['HighlightParent'] = 1] = 'HighlightParent'; - }(ExpandHighlightDecision || (ExpandHighlightDecision = {}))); - var buildIfRequired = function (container, menuName, menuPrep) { + }; + return name === primaryName ? { + type: 'prepared', + menu: container.getSystem().build(makeSketch()) + } : { + type: 'notbuilt', + nbMenu: makeSketch + }; + }); + }; + var layeredState = LayeredState.init(); + var setup = function (container) { + var componentMap = buildMenus(container, detail.data.primary, detail.data.menus); + var directory = toDirectory(); + layeredState.setContents(detail.data.primary, componentMap, detail.data.expansions, directory); + return layeredState.getPrimary(); + }; + var getItemValue = function (item) { + return Representing.getValue(item).value; + }; + var getItemByValue = function (_container, menus, itemValue) { + return findMap(menus, function (menu) { + if (!menu.getSystem().isConnected()) { + return Optional.none(); + } + var candidates = Highlighting.getCandidates(menu); + return find(candidates, function (c) { + return getItemValue(c) === itemValue; + }); + }); + }; + var toDirectory = function (_container) { + return map$2(detail.data.menus, function (data, _menuName) { + return bind(data.items, function (item) { + return item.type === 'separator' ? [] : [item.data.value]; + }); + }); + }; + var setActiveMenu = function (container, menu) { + Highlighting.highlight(container, menu); + Highlighting.getHighlighted(menu).orThunk(function () { + return Highlighting.getFirst(menu); + }).each(function (item) { + dispatch(container, item.element, focusItem()); + }); + }; + var getMenus = function (state, menuValues) { + return cat(map(menuValues, function (mv) { + return state.lookupMenu(mv).bind(function (prep) { + return prep.type === 'prepared' ? Optional.some(prep.menu) : Optional.none(); + }); + })); + }; + var closeOthers = function (container, state, path) { + var others = getMenus(state, state.otherMenus(path)); + each(others, function (o) { + remove$5(o.element, [detail.markers.backgroundMenu]); + if (!detail.stayInDom) { + Replacing.remove(container, o); + } + }); + }; + var getSubmenuParents = function (container) { + return submenuParentItems.get().getOrThunk(function () { + var r = {}; + var items = descendants(container.element, '.' + detail.markers.item); + var parentItems = filter(items, function (i) { + return get$3(i, 'aria-haspopup') === 'true'; + }); + each(parentItems, function (i) { + container.getSystem().getByDom(i).each(function (itemComp) { + var key = getItemValue(itemComp); + r[key] = itemComp; + }); + }); + submenuParentItems.set(Optional.some(r)); + return r; + }); + }; + var updateAriaExpansions = function (container, path) { + var parentItems = getSubmenuParents(container); + each$1(parentItems, function (v, k) { + var expanded = contains(path, k); + set$1(v.element, 'aria-expanded', expanded); + }); + }; + var updateMenuPath = function (container, state, path) { + return Optional.from(path[0]).bind(function (latestMenuName) { + return state.lookupMenu(latestMenuName).bind(function (menuPrep) { if (menuPrep.type === 'notbuilt') { - var menu = container.getSystem().build(menuPrep.nbMenu()); - layeredState.setMenuBuilt(menuName, menu); - return menu; + return Optional.none(); } else { - return menuPrep.menu; - } - }; - var expandRight = function (container, item, decision) { - if (decision === void 0) { - decision = ExpandHighlightDecision.HighlightSubmenu; - } - var value = getItemValue(item); - return layeredState.expand(value).bind(function (path) { - updateAriaExpansions(container, path); - return Optional.from(path[0]).bind(function (menuName) { - return layeredState.lookupMenu(menuName).bind(function (activeMenuPrep) { - var activeMenu = buildIfRequired(container, menuName, activeMenuPrep); - if (!inBody(activeMenu.element)) { - Replacing.append(container, premade$1(activeMenu)); - } - detail.onOpenSubmenu(container, item, activeMenu, reverse(path)); - if (decision === ExpandHighlightDecision.HighlightSubmenu) { - Highlighting.highlightFirst(activeMenu); - return updateMenuPath(container, layeredState, path); - } else { - Highlighting.dehighlightAll(activeMenu); - return Optional.some(item); - } - }); - }); - }); - }; - var collapseLeft = function (container, item) { - var value = getItemValue(item); - return layeredState.collapse(value).bind(function (path) { - updateAriaExpansions(container, path); - return updateMenuPath(container, layeredState, path).map(function (activeMenu) { - detail.onCollapseMenu(container, item, activeMenu); - return activeMenu; - }); - }); - }; - var updateView = function (container, item) { - var value = getItemValue(item); - return layeredState.refresh(value).bind(function (path) { - updateAriaExpansions(container, path); + var activeMenu = menuPrep.menu; + var rest = getMenus(state, path.slice(1)); + each(rest, function (r) { + add$2(r.element, detail.markers.backgroundMenu); + }); + if (!inBody(activeMenu.element)) { + Replacing.append(container, premade$1(activeMenu)); + } + remove$5(activeMenu.element, [detail.markers.backgroundMenu]); + setActiveMenu(container, activeMenu); + closeOthers(container, state, path); + return Optional.some(activeMenu); + } + }); + }); + }; + var ExpandHighlightDecision; + (function (ExpandHighlightDecision) { + ExpandHighlightDecision[ExpandHighlightDecision['HighlightSubmenu'] = 0] = 'HighlightSubmenu'; + ExpandHighlightDecision[ExpandHighlightDecision['HighlightParent'] = 1] = 'HighlightParent'; + }(ExpandHighlightDecision || (ExpandHighlightDecision = {}))); + var buildIfRequired = function (container, menuName, menuPrep) { + if (menuPrep.type === 'notbuilt') { + var menu = container.getSystem().build(menuPrep.nbMenu()); + layeredState.setMenuBuilt(menuName, menu); + return menu; + } else { + return menuPrep.menu; + } + }; + var expandRight = function (container, item, decision) { + if (decision === void 0) { + decision = ExpandHighlightDecision.HighlightSubmenu; + } + var value = getItemValue(item); + return layeredState.expand(value).bind(function (path) { + updateAriaExpansions(container, path); + return Optional.from(path[0]).bind(function (menuName) { + return layeredState.lookupMenu(menuName).bind(function (activeMenuPrep) { + var activeMenu = buildIfRequired(container, menuName, activeMenuPrep); + if (!inBody(activeMenu.element)) { + Replacing.append(container, premade$1(activeMenu)); + } + detail.onOpenSubmenu(container, item, activeMenu, reverse(path)); + if (decision === ExpandHighlightDecision.HighlightSubmenu) { + Highlighting.highlightFirst(activeMenu); return updateMenuPath(container, layeredState, path); + } else { + Highlighting.dehighlightAll(activeMenu); + return Optional.some(item); + } + }); + }); + }); + }; + var collapseLeft = function (container, item) { + var value = getItemValue(item); + return layeredState.collapse(value).bind(function (path) { + updateAriaExpansions(container, path); + return updateMenuPath(container, layeredState, path).map(function (activeMenu) { + detail.onCollapseMenu(container, item, activeMenu); + return activeMenu; + }); + }); + }; + var updateView = function (container, item) { + var value = getItemValue(item); + return layeredState.refresh(value).bind(function (path) { + updateAriaExpansions(container, path); + return updateMenuPath(container, layeredState, path); + }); + }; + var onRight = function (container, item) { + return inside(item.element) ? Optional.none() : expandRight(container, item, ExpandHighlightDecision.HighlightSubmenu); + }; + var onLeft = function (container, item) { + return inside(item.element) ? Optional.none() : collapseLeft(container, item); + }; + var onEscape = function (container, item) { + return collapseLeft(container, item).orThunk(function () { + return detail.onEscape(container, item).map(function () { + return container; + }); + }); + }; + var keyOnItem = function (f) { + return function (container, simulatedEvent) { + return closest$3(simulatedEvent.getSource(), '.' + detail.markers.item).bind(function (target) { + return container.getSystem().getByDom(target).toOptional().bind(function (item) { + return f(container, item).map(function () { + return true; + }); + }); + }); + }; + }; + var events = derive([ + run(focus$4(), function (sandbox, simulatedEvent) { + var item = simulatedEvent.event.item; + layeredState.lookupItem(getItemValue(item)).each(function () { + var menu = simulatedEvent.event.menu; + Highlighting.highlight(sandbox, menu); + var value = getItemValue(simulatedEvent.event.item); + layeredState.refresh(value).each(function (path) { + return closeOthers(sandbox, layeredState, path); + }); + }); + }), + runOnExecute(function (component, simulatedEvent) { + var target = simulatedEvent.event.target; + component.getSystem().getByDom(target).each(function (item) { + var itemValue = getItemValue(item); + if (itemValue.indexOf('collapse-item') === 0) { + collapseLeft(component, item); + } + expandRight(component, item, ExpandHighlightDecision.HighlightSubmenu).fold(function () { + detail.onExecute(component, item); + }, function () { }); - }; - var onRight = function (container, item) { - return inside(item.element) ? Optional.none() : expandRight(container, item, ExpandHighlightDecision.HighlightSubmenu); - }; - var onLeft = function (container, item) { - return inside(item.element) ? Optional.none() : collapseLeft(container, item); - }; - var onEscape = function (container, item) { - return collapseLeft(container, item).orThunk(function () { - return detail.onEscape(container, item).map(function () { - return container; - }); - }); - }; - var keyOnItem = function (f) { - return function (container, simulatedEvent) { - return closest$3(simulatedEvent.getSource(), '.' + detail.markers.item).bind(function (target) { - return container.getSystem().getByDom(target).toOptional().bind(function (item) { - return f(container, item).map(function () { - return true; - }); - }); - }); - }; - }; - var events = derive([ - run(focus$4(), function (sandbox, simulatedEvent) { - var item = simulatedEvent.event.item; - layeredState.lookupItem(getItemValue(item)).each(function () { - var menu = simulatedEvent.event.menu; - Highlighting.highlight(sandbox, menu); - var value = getItemValue(simulatedEvent.event.item); - layeredState.refresh(value).each(function (path) { - return closeOthers(sandbox, layeredState, path); - }); - }); - }), - runOnExecute(function (component, simulatedEvent) { - var target = simulatedEvent.event.target; - component.getSystem().getByDom(target).each(function (item) { - var itemValue = getItemValue(item); - if (itemValue.indexOf('collapse-item') === 0) { - collapseLeft(component, item); - } - expandRight(component, item, ExpandHighlightDecision.HighlightSubmenu).fold(function () { - detail.onExecute(component, item); - }, function () { - }); - }); - }), - runOnAttached(function (container, _simulatedEvent) { - setup(container).each(function (primary) { - Replacing.append(container, premade$1(primary)); - detail.onOpenMenu(container, primary); - if (detail.highlightImmediately) { - setActiveMenu(container, primary); - } - }); - }) - ].concat(detail.navigateOnHover ? [run(hover(), function (sandbox, simulatedEvent) { - var item = simulatedEvent.event.item; - updateView(sandbox, item); - expandRight(sandbox, item, ExpandHighlightDecision.HighlightParent); - detail.onHover(sandbox, item); + }); + }), + runOnAttached(function (container, _simulatedEvent) { + setup(container).each(function (primary) { + Replacing.append(container, premade$1(primary)); + detail.onOpenMenu(container, primary); + if (detail.highlightImmediately) { + setActiveMenu(container, primary); + } + }); + }) + ].concat(detail.navigateOnHover ? [run(hover(), function (sandbox, simulatedEvent) { + var item = simulatedEvent.event.item; + updateView(sandbox, item); + expandRight(sandbox, item, ExpandHighlightDecision.HighlightParent); + detail.onHover(sandbox, item); })] : [])); - var getActiveItem = function (container) { - return Highlighting.getHighlighted(container).bind(Highlighting.getHighlighted); - }; - var collapseMenuApi = function (container) { - getActiveItem(container).each(function (currentItem) { - collapseLeft(container, currentItem); - }); - }; - var highlightPrimary = function (container) { - layeredState.getPrimary().each(function (primary) { - setActiveMenu(container, primary); - }); - }; - var extractMenuFromContainer = function (container) { - return Optional.from(container.components()[0]).filter(function (comp) { - return get$3(comp.element, 'role') === 'menu'; - }); - }; - var repositionMenus = function (container) { - var maybeActivePrimary = layeredState.getPrimary().bind(function (primary) { - return getActiveItem(container).bind(function (currentItem) { - var itemValue = getItemValue(currentItem); - var allMenus = values(layeredState.getMenus()); - var preparedMenus = cat(map(allMenus, LayeredState.extractPreparedMenu)); - return layeredState.getTriggeringPath(itemValue, function (v) { - return getItemByValue(container, preparedMenus, v); - }); - }).map(function (triggeringPath) { - return { - primary: primary, - triggeringPath: triggeringPath - }; - }); - }); - maybeActivePrimary.fold(function () { - extractMenuFromContainer(container).each(function (primaryMenu) { - detail.onRepositionMenu(container, primaryMenu, []); - }); - }, function (_a) { - var primary = _a.primary, triggeringPath = _a.triggeringPath; - detail.onRepositionMenu(container, primary, triggeringPath); - }); - }; - var apis = { - collapseMenu: collapseMenuApi, - highlightPrimary: highlightPrimary, - repositionMenus: repositionMenus - }; - return { - uid: detail.uid, - dom: detail.dom, - markers: detail.markers, - behaviours: augment(detail.tmenuBehaviours, [ - Keying.config({ - mode: 'special', - onRight: keyOnItem(onRight), - onLeft: keyOnItem(onLeft), - onEscape: keyOnItem(onEscape), - focusIn: function (container, _keyInfo) { - layeredState.getPrimary().each(function (primary) { - dispatch(container, primary.element, focusItem()); - }); - } - }), - Highlighting.config({ - highlightClass: detail.markers.selectedMenu, - itemClass: detail.markers.menu - }), - Composing.config({ - find: function (container) { - return Highlighting.getHighlighted(container); - } - }), - Replacing.config({}) - ]), - eventOrder: detail.eventOrder, - apis: apis, - events: events - }; + var getActiveItem = function (container) { + return Highlighting.getHighlighted(container).bind(Highlighting.getHighlighted); + }; + var collapseMenuApi = function (container) { + getActiveItem(container).each(function (currentItem) { + collapseLeft(container, currentItem); + }); + }; + var highlightPrimary = function (container) { + layeredState.getPrimary().each(function (primary) { + setActiveMenu(container, primary); + }); + }; + var extractMenuFromContainer = function (container) { + return Optional.from(container.components()[0]).filter(function (comp) { + return get$3(comp.element, 'role') === 'menu'; + }); + }; + var repositionMenus = function (container) { + var maybeActivePrimary = layeredState.getPrimary().bind(function (primary) { + return getActiveItem(container).bind(function (currentItem) { + var itemValue = getItemValue(currentItem); + var allMenus = values(layeredState.getMenus()); + var preparedMenus = cat(map(allMenus, LayeredState.extractPreparedMenu)); + return layeredState.getTriggeringPath(itemValue, function (v) { + return getItemByValue(container, preparedMenus, v); + }); + }).map(function (triggeringPath) { + return { + primary: primary, + triggeringPath: triggeringPath + }; + }); + }); + maybeActivePrimary.fold(function () { + extractMenuFromContainer(container).each(function (primaryMenu) { + detail.onRepositionMenu(container, primaryMenu, []); + }); + }, function (_a) { + var primary = _a.primary, triggeringPath = _a.triggeringPath; + detail.onRepositionMenu(container, primary, triggeringPath); + }); + }; + var apis = { + collapseMenu: collapseMenuApi, + highlightPrimary: highlightPrimary, + repositionMenus: repositionMenus + }; + return { + uid: detail.uid, + dom: detail.dom, + markers: detail.markers, + behaviours: augment(detail.tmenuBehaviours, [ + Keying.config({ + mode: 'special', + onRight: keyOnItem(onRight), + onLeft: keyOnItem(onLeft), + onEscape: keyOnItem(onEscape), + focusIn: function (container, _keyInfo) { + layeredState.getPrimary().each(function (primary) { + dispatch(container, primary.element, focusItem()); + }); + } + }), + Highlighting.config({ + highlightClass: detail.markers.selectedMenu, + itemClass: detail.markers.menu + }), + Composing.config({ + find: function (container) { + return Highlighting.getHighlighted(container); + } + }), + Replacing.config({}) + ]), + eventOrder: detail.eventOrder, + apis: apis, + events: events + }; }; var collapseItem = constant('collapse-item'); var tieredData = function (primary, menus, expansions) { - return { - primary: primary, - menus: menus, - expansions: expansions - }; + return { + primary: primary, + menus: menus, + expansions: expansions + }; }; var singleData = function (name, menu) { - return { - primary: name, - menus: wrap$1(name, menu), - expansions: {} - }; + return { + primary: name, + menus: wrap$1(name, menu), + expansions: {} + }; }; var collapseItem$1 = function (text) { - return { - value: generate$1(collapseItem()), - meta: {text: text} - }; + return { + value: generate$1(collapseItem()), + meta: { text: text } + }; }; var tieredMenu = single$2({ - name: 'TieredMenu', - configFields: [ - onStrictKeyboardHandler('onExecute'), - onStrictKeyboardHandler('onEscape'), - onStrictHandler('onOpenMenu'), - onStrictHandler('onOpenSubmenu'), - onHandler('onRepositionMenu'), - onHandler('onCollapseMenu'), - defaulted$1('highlightImmediately', true), - strictObjOf('data', [ - strict$1('primary'), - strict$1('menus'), - strict$1('expansions') - ]), - defaulted$1('fakeFocus', false), - onHandler('onHighlight'), - onHandler('onHover'), - tieredMenuMarkers(), - strict$1('dom'), - defaulted$1('navigateOnHover', true), - defaulted$1('stayInDom', false), - field$1('tmenuBehaviours', [ - Keying, - Highlighting, - Composing, - Replacing - ]), - defaulted$1('eventOrder', {}) - ], - apis: { - collapseMenu: function (apis, tmenu) { - apis.collapseMenu(tmenu); - }, - highlightPrimary: function (apis, tmenu) { - apis.highlightPrimary(tmenu); - }, - repositionMenus: function (apis, tmenu) { - apis.repositionMenus(tmenu); - } + name: 'TieredMenu', + configFields: [ + onStrictKeyboardHandler('onExecute'), + onStrictKeyboardHandler('onEscape'), + onStrictHandler('onOpenMenu'), + onStrictHandler('onOpenSubmenu'), + onHandler('onRepositionMenu'), + onHandler('onCollapseMenu'), + defaulted$1('highlightImmediately', true), + strictObjOf('data', [ + strict$1('primary'), + strict$1('menus'), + strict$1('expansions') + ]), + defaulted$1('fakeFocus', false), + onHandler('onHighlight'), + onHandler('onHover'), + tieredMenuMarkers(), + strict$1('dom'), + defaulted$1('navigateOnHover', true), + defaulted$1('stayInDom', false), + field$1('tmenuBehaviours', [ + Keying, + Highlighting, + Composing, + Replacing + ]), + defaulted$1('eventOrder', {}) + ], + apis: { + collapseMenu: function (apis, tmenu) { + apis.collapseMenu(tmenu); }, - factory: make$2, - extraApis: { - tieredData: tieredData, - singleData: singleData, - collapseItem: collapseItem$1 - } + highlightPrimary: function (apis, tmenu) { + apis.highlightPrimary(tmenu); + }, + repositionMenus: function (apis, tmenu) { + apis.repositionMenus(tmenu); + } + }, + factory: make$2, + extraApis: { + tieredData: tieredData, + singleData: singleData, + collapseItem: collapseItem$1 + } }); var makeMenu = function (detail, menuSandbox, anchor, menuSpec, getBounds) { - var lazySink = function () { - return detail.lazySink(menuSandbox); - }; - var layouts = menuSpec.type === 'horizontal' ? { - layouts: { - onLtr: function () { - return belowOrAbove(); - }, - onRtl: function () { - return belowOrAboveRtl(); - } - } - } : {}; - var isFirstTierSubmenu = function (triggeringPaths) { - return triggeringPaths.length === 2; - }; - var getSubmenuLayouts = function (triggeringPaths) { - return isFirstTierSubmenu(triggeringPaths) ? layouts : {}; - }; - return tieredMenu.sketch({ - dom: {tag: 'div'}, - data: menuSpec.data, - markers: menuSpec.menu.markers, - highlightImmediately: menuSpec.menu.highlightImmediately, - onEscape: function () { - Sandboxing.close(menuSandbox); - detail.onEscape.map(function (handler) { - return handler(menuSandbox); - }); - return Optional.some(true); - }, - onExecute: function () { - return Optional.some(true); - }, - onOpenMenu: function (tmenu, menu) { - Positioning.positionWithinBounds(lazySink().getOrDie(), anchor, menu, getBounds()); - }, - onOpenSubmenu: function (tmenu, item, submenu, triggeringPaths) { - var sink = lazySink().getOrDie(); - Positioning.position(sink, __assign({ - anchor: 'submenu', - item: item - }, getSubmenuLayouts(triggeringPaths)), submenu); - }, - onRepositionMenu: function (tmenu, primaryMenu, submenuTriggers) { - var sink = lazySink().getOrDie(); - Positioning.positionWithinBounds(sink, anchor, primaryMenu, getBounds()); - each(submenuTriggers, function (st) { - var submenuLayouts = getSubmenuLayouts(st.triggeringPath); - Positioning.position(sink, __assign({ - anchor: 'submenu', - item: st.triggeringItem - }, submenuLayouts), st.triggeredMenu); - }); - } - }); + var lazySink = function () { + return detail.lazySink(menuSandbox); + }; + var layouts = menuSpec.type === 'horizontal' ? { + layouts: { + onLtr: function () { + return belowOrAbove(); + }, + onRtl: function () { + return belowOrAboveRtl(); + } + } + } : {}; + var isFirstTierSubmenu = function (triggeringPaths) { + return triggeringPaths.length === 2; + }; + var getSubmenuLayouts = function (triggeringPaths) { + return isFirstTierSubmenu(triggeringPaths) ? layouts : {}; + }; + return tieredMenu.sketch({ + dom: { tag: 'div' }, + data: menuSpec.data, + markers: menuSpec.menu.markers, + highlightImmediately: menuSpec.menu.highlightImmediately, + onEscape: function () { + Sandboxing.close(menuSandbox); + detail.onEscape.map(function (handler) { + return handler(menuSandbox); + }); + return Optional.some(true); + }, + onExecute: function () { + return Optional.some(true); + }, + onOpenMenu: function (tmenu, menu) { + Positioning.positionWithinBounds(lazySink().getOrDie(), anchor, menu, getBounds()); + }, + onOpenSubmenu: function (tmenu, item, submenu, triggeringPaths) { + var sink = lazySink().getOrDie(); + Positioning.position(sink, __assign({ + anchor: 'submenu', + item: item + }, getSubmenuLayouts(triggeringPaths)), submenu); + }, + onRepositionMenu: function (tmenu, primaryMenu, submenuTriggers) { + var sink = lazySink().getOrDie(); + Positioning.positionWithinBounds(sink, anchor, primaryMenu, getBounds()); + each(submenuTriggers, function (st) { + var submenuLayouts = getSubmenuLayouts(st.triggeringPath); + Positioning.position(sink, __assign({ + anchor: 'submenu', + item: st.triggeringItem + }, submenuLayouts), st.triggeredMenu); + }); + } + }); }; var factory = function (detail, spec) { - var isPartOfRelated = function (sandbox, queryElem) { - var related = detail.getRelated(sandbox); - return related.exists(function (rel) { - return isPartOf(rel, queryElem); - }); - }; - var setContent = function (sandbox, thing) { - Sandboxing.setContent(sandbox, thing); - }; - var showAt = function (sandbox, anchor, thing) { - showWithin(sandbox, anchor, thing, Optional.none()); - }; - var showWithin = function (sandbox, anchor, thing, boxElement) { - showWithinBounds(sandbox, anchor, thing, function () { - return boxElement.map(function (elem) { - return box(elem); - }); - }); - }; - var showWithinBounds = function (sandbox, anchor, thing, getBounds) { - var sink = detail.lazySink(sandbox).getOrDie(); - Sandboxing.openWhileCloaked(sandbox, thing, function () { - return Positioning.positionWithinBounds(sink, anchor, sandbox, getBounds()); - }); - Representing.setValue(sandbox, Optional.some({ - mode: 'position', - anchor: anchor, - getBounds: getBounds - })); - }; - var showMenuAt = function (sandbox, anchor, menuSpec) { - showMenuWithinBounds(sandbox, anchor, menuSpec, function () { - return Optional.none(); - }); - }; - var showMenuWithinBounds = function (sandbox, anchor, menuSpec, getBounds) { - var menu = makeMenu(detail, sandbox, anchor, menuSpec, getBounds); - Sandboxing.open(sandbox, menu); - Representing.setValue(sandbox, Optional.some({ - mode: 'menu', - menu: menu - })); - }; - var hide = function (sandbox) { - if (Sandboxing.isOpen(sandbox)) { - Representing.setValue(sandbox, Optional.none()); - Sandboxing.close(sandbox); - } - }; - var getContent = function (sandbox) { - return Sandboxing.getState(sandbox); - }; - var reposition = function (sandbox) { - if (Sandboxing.isOpen(sandbox)) { - Representing.getValue(sandbox).each(function (state) { - switch (state.mode) { - case 'menu': - Sandboxing.getState(sandbox).each(function (tmenu) { - tieredMenu.repositionMenus(tmenu); - }); - break; - case 'position': - var sink = detail.lazySink(sandbox).getOrDie(); - Positioning.positionWithinBounds(sink, state.anchor, sandbox, state.getBounds()); - break; - } - }); - } - }; - var apis = { - setContent: setContent, - showAt: showAt, - showWithin: showWithin, - showWithinBounds: showWithinBounds, - showMenuAt: showMenuAt, - showMenuWithinBounds: showMenuWithinBounds, - hide: hide, - getContent: getContent, - reposition: reposition, - isOpen: Sandboxing.isOpen - }; - return { - uid: detail.uid, - dom: detail.dom, - behaviours: augment(detail.inlineBehaviours, [ - Sandboxing.config({ - isPartOf: function (sandbox, data, queryElem) { - return isPartOf(data, queryElem) || isPartOfRelated(sandbox, queryElem); - }, - getAttachPoint: function (sandbox) { - return detail.lazySink(sandbox).getOrDie(); - }, - onOpen: function (sandbox) { - detail.onShow(sandbox); - }, - onClose: function (sandbox) { - detail.onHide(sandbox); - } - }), - Representing.config({ - store: { - mode: 'memory', - initialValue: Optional.none() - } - }), - Receiving.config({ - channels: __assign(__assign({}, receivingChannel(__assign({isExtraPart: spec.isExtraPart}, detail.fireDismissalEventInstead.map(function (fe) { - return {fireEventInstead: {event: fe.event}}; - }).getOr({})))), receivingChannel$1(__assign(__assign({}, detail.fireRepositionEventInstead.map(function (fe) { - return {fireEventInstead: {event: fe.event}}; - }).getOr({})), {doReposition: reposition}))) - }) - ]), - eventOrder: detail.eventOrder, - apis: apis - }; + var isPartOfRelated = function (sandbox, queryElem) { + var related = detail.getRelated(sandbox); + return related.exists(function (rel) { + return isPartOf(rel, queryElem); + }); + }; + var setContent = function (sandbox, thing) { + Sandboxing.setContent(sandbox, thing); + }; + var showAt = function (sandbox, anchor, thing) { + showWithin(sandbox, anchor, thing, Optional.none()); + }; + var showWithin = function (sandbox, anchor, thing, boxElement) { + showWithinBounds(sandbox, anchor, thing, function () { + return boxElement.map(function (elem) { + return box(elem); + }); + }); + }; + var showWithinBounds = function (sandbox, anchor, thing, getBounds) { + var sink = detail.lazySink(sandbox).getOrDie(); + Sandboxing.openWhileCloaked(sandbox, thing, function () { + return Positioning.positionWithinBounds(sink, anchor, sandbox, getBounds()); + }); + Representing.setValue(sandbox, Optional.some({ + mode: 'position', + anchor: anchor, + getBounds: getBounds + })); + }; + var showMenuAt = function (sandbox, anchor, menuSpec) { + showMenuWithinBounds(sandbox, anchor, menuSpec, function () { + return Optional.none(); + }); + }; + var showMenuWithinBounds = function (sandbox, anchor, menuSpec, getBounds) { + var menu = makeMenu(detail, sandbox, anchor, menuSpec, getBounds); + Sandboxing.open(sandbox, menu); + Representing.setValue(sandbox, Optional.some({ + mode: 'menu', + menu: menu + })); + }; + var hide = function (sandbox) { + if (Sandboxing.isOpen(sandbox)) { + Representing.setValue(sandbox, Optional.none()); + Sandboxing.close(sandbox); + } + }; + var getContent = function (sandbox) { + return Sandboxing.getState(sandbox); + }; + var reposition = function (sandbox) { + if (Sandboxing.isOpen(sandbox)) { + Representing.getValue(sandbox).each(function (state) { + switch (state.mode) { + case 'menu': + Sandboxing.getState(sandbox).each(function (tmenu) { + tieredMenu.repositionMenus(tmenu); + }); + break; + case 'position': + var sink = detail.lazySink(sandbox).getOrDie(); + Positioning.positionWithinBounds(sink, state.anchor, sandbox, state.getBounds()); + break; + } + }); + } + }; + var apis = { + setContent: setContent, + showAt: showAt, + showWithin: showWithin, + showWithinBounds: showWithinBounds, + showMenuAt: showMenuAt, + showMenuWithinBounds: showMenuWithinBounds, + hide: hide, + getContent: getContent, + reposition: reposition, + isOpen: Sandboxing.isOpen + }; + return { + uid: detail.uid, + dom: detail.dom, + behaviours: augment(detail.inlineBehaviours, [ + Sandboxing.config({ + isPartOf: function (sandbox, data, queryElem) { + return isPartOf(data, queryElem) || isPartOfRelated(sandbox, queryElem); + }, + getAttachPoint: function (sandbox) { + return detail.lazySink(sandbox).getOrDie(); + }, + onOpen: function (sandbox) { + detail.onShow(sandbox); + }, + onClose: function (sandbox) { + detail.onHide(sandbox); + } + }), + Representing.config({ + store: { + mode: 'memory', + initialValue: Optional.none() + } + }), + Receiving.config({ + channels: __assign(__assign({}, receivingChannel(__assign({ isExtraPart: spec.isExtraPart }, detail.fireDismissalEventInstead.map(function (fe) { + return { fireEventInstead: { event: fe.event } }; + }).getOr({})))), receivingChannel$1(__assign(__assign({}, detail.fireRepositionEventInstead.map(function (fe) { + return { fireEventInstead: { event: fe.event } }; + }).getOr({})), { doReposition: reposition }))) + }) + ]), + eventOrder: detail.eventOrder, + apis: apis + }; }; var InlineView = single$2({ - name: 'InlineView', - configFields: [ - strict$1('lazySink'), - onHandler('onShow'), - onHandler('onHide'), - optionFunction('onEscape'), - field$1('inlineBehaviours', [ - Sandboxing, - Representing, - Receiving - ]), - optionObjOf('fireDismissalEventInstead', [defaulted$1('event', dismissRequested())]), - optionObjOf('fireRepositionEventInstead', [defaulted$1('event', repositionRequested())]), - defaulted$1('getRelated', Optional.none), - defaulted$1('isExtraPart', never), - defaulted$1('eventOrder', Optional.none) - ], - factory: factory, - apis: { - showAt: function (apis, component, anchor, thing) { - apis.showAt(component, anchor, thing); - }, - showWithin: function (apis, component, anchor, thing, boxElement) { - apis.showWithin(component, anchor, thing, boxElement); - }, - showWithinBounds: function (apis, component, anchor, thing, bounds) { - apis.showWithinBounds(component, anchor, thing, bounds); - }, - showMenuAt: function (apis, component, anchor, menuSpec) { - apis.showMenuAt(component, anchor, menuSpec); - }, - showMenuWithinBounds: function (apis, component, anchor, menuSpec, bounds) { - apis.showMenuWithinBounds(component, anchor, menuSpec, bounds); - }, - hide: function (apis, component) { - apis.hide(component); - }, - isOpen: function (apis, component) { - return apis.isOpen(component); - }, - getContent: function (apis, component) { - return apis.getContent(component); - }, - setContent: function (apis, component, thing) { - apis.setContent(component, thing); - }, - reposition: function (apis, component) { - apis.reposition(component); - } + name: 'InlineView', + configFields: [ + strict$1('lazySink'), + onHandler('onShow'), + onHandler('onHide'), + optionFunction('onEscape'), + field$1('inlineBehaviours', [ + Sandboxing, + Representing, + Receiving + ]), + optionObjOf('fireDismissalEventInstead', [defaulted$1('event', dismissRequested())]), + optionObjOf('fireRepositionEventInstead', [defaulted$1('event', repositionRequested())]), + defaulted$1('getRelated', Optional.none), + defaulted$1('isExtraPart', never), + defaulted$1('eventOrder', Optional.none) + ], + factory: factory, + apis: { + showAt: function (apis, component, anchor, thing) { + apis.showAt(component, anchor, thing); + }, + showWithin: function (apis, component, anchor, thing, boxElement) { + apis.showWithin(component, anchor, thing, boxElement); + }, + showWithinBounds: function (apis, component, anchor, thing, bounds) { + apis.showWithinBounds(component, anchor, thing, bounds); + }, + showMenuAt: function (apis, component, anchor, menuSpec) { + apis.showMenuAt(component, anchor, menuSpec); + }, + showMenuWithinBounds: function (apis, component, anchor, menuSpec, bounds) { + apis.showMenuWithinBounds(component, anchor, menuSpec, bounds); + }, + hide: function (apis, component) { + apis.hide(component); + }, + isOpen: function (apis, component) { + return apis.isOpen(component); + }, + getContent: function (apis, component) { + return apis.getContent(component); + }, + setContent: function (apis, component, thing) { + apis.setContent(component, thing); + }, + reposition: function (apis, component) { + apis.reposition(component); } + } }); var westEdgeX$1 = function (anchor) { - return anchor.x; + return anchor.x; }; var middleX$1 = function (anchor, element) { - return anchor.x + anchor.width / 2 - element.width / 2; + return anchor.x + anchor.width / 2 - element.width / 2; }; var eastEdgeX$1 = function (anchor, element) { - return anchor.x + anchor.width - element.width; + return anchor.x + anchor.width - element.width; }; var northY$2 = function (anchor) { - return anchor.y; + return anchor.y; }; var southY$2 = function (anchor, element) { - return anchor.y + anchor.height - element.height; + return anchor.y + anchor.height - element.height; }; var southeast$3 = function (anchor, element, bubbles) { - return nu$7(eastEdgeX$1(anchor, element), southY$2(anchor, element), bubbles.innerSoutheast(), northwest(), boundsRestriction(anchor, { - right: 0, - bottom: 3 - }), 'layout-inner-se'); + return nu$7(eastEdgeX$1(anchor, element), southY$2(anchor, element), bubbles.innerSoutheast(), northwest(), boundsRestriction(anchor, { + right: 0, + bottom: 3 + }), 'layout-inner-se'); }; var southwest$3 = function (anchor, element, bubbles) { - return nu$7(westEdgeX$1(anchor), southY$2(anchor, element), bubbles.innerSouthwest(), northeast(), boundsRestriction(anchor, { - left: 1, - bottom: 3 - }), 'layout-inner-sw'); + return nu$7(westEdgeX$1(anchor), southY$2(anchor, element), bubbles.innerSouthwest(), northeast(), boundsRestriction(anchor, { + left: 1, + bottom: 3 + }), 'layout-inner-sw'); }; var northeast$3 = function (anchor, element, bubbles) { - return nu$7(eastEdgeX$1(anchor, element), northY$2(anchor), bubbles.innerNortheast(), southwest(), boundsRestriction(anchor, { - right: 0, - top: 2 - }), 'layout-inner-ne'); + return nu$7(eastEdgeX$1(anchor, element), northY$2(anchor), bubbles.innerNortheast(), southwest(), boundsRestriction(anchor, { + right: 0, + top: 2 + }), 'layout-inner-ne'); }; var northwest$3 = function (anchor, element, bubbles) { - return nu$7(westEdgeX$1(anchor), northY$2(anchor), bubbles.innerNorthwest(), southeast(), boundsRestriction(anchor, { - left: 1, - top: 2 - }), 'layout-inner-nw'); + return nu$7(westEdgeX$1(anchor), northY$2(anchor), bubbles.innerNorthwest(), southeast(), boundsRestriction(anchor, { + left: 1, + top: 2 + }), 'layout-inner-nw'); }; var north$3 = function (anchor, element, bubbles) { - return nu$7(middleX$1(anchor, element), northY$2(anchor), bubbles.innerNorth(), south(), boundsRestriction(anchor, {top: 2}), 'layout-inner-n'); + return nu$7(middleX$1(anchor, element), northY$2(anchor), bubbles.innerNorth(), south(), boundsRestriction(anchor, { top: 2 }), 'layout-inner-n'); }; var south$3 = function (anchor, element, bubbles) { - return nu$7(middleX$1(anchor, element), southY$2(anchor, element), bubbles.innerSouth(), north(), boundsRestriction(anchor, {bottom: 3}), 'layout-inner-s'); + return nu$7(middleX$1(anchor, element), southY$2(anchor, element), bubbles.innerSouth(), north(), boundsRestriction(anchor, { bottom: 3 }), 'layout-inner-s'); }; var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay'); var factory$1 = function (detail) { - var events = events$7(detail.action); - var tag = detail.dom.tag; - var lookupAttr = function (attr) { - return get$1(detail.dom, 'attributes').bind(function (attrs) { - return get$1(attrs, attr); - }); - }; - var getModAttributes = function () { - if (tag === 'button') { - var type = lookupAttr('type').getOr('button'); - var roleAttrs = lookupAttr('role').map(function (role) { - return {role: role}; - }).getOr({}); - return __assign({type: type}, roleAttrs); - } else { - var role = lookupAttr('role').getOr('button'); - return {role: role}; - } - }; - return { - uid: detail.uid, - dom: detail.dom, - components: detail.components, - events: events, - behaviours: SketchBehaviours.augment(detail.buttonBehaviours, [ - Focusing.config({}), - Keying.config({ - mode: 'execution', - useSpace: true, - useEnter: true - }) - ]), - domModification: {attributes: getModAttributes()}, - eventOrder: detail.eventOrder - }; + var events = events$7(detail.action); + var tag = detail.dom.tag; + var lookupAttr = function (attr) { + return get$1(detail.dom, 'attributes').bind(function (attrs) { + return get$1(attrs, attr); + }); + }; + var getModAttributes = function () { + if (tag === 'button') { + var type = lookupAttr('type').getOr('button'); + var roleAttrs = lookupAttr('role').map(function (role) { + return { role: role }; + }).getOr({}); + return __assign({ type: type }, roleAttrs); + } else { + var role = lookupAttr('role').getOr('button'); + return { role: role }; + } + }; + return { + uid: detail.uid, + dom: detail.dom, + components: detail.components, + events: events, + behaviours: SketchBehaviours.augment(detail.buttonBehaviours, [ + Focusing.config({}), + Keying.config({ + mode: 'execution', + useSpace: true, + useEnter: true + }) + ]), + domModification: { attributes: getModAttributes() }, + eventOrder: detail.eventOrder + }; }; var Button = single$2({ - name: 'Button', - factory: factory$1, - configFields: [ - defaulted$1('uid', undefined), - strict$1('dom'), - defaulted$1('components', []), - SketchBehaviours.field('buttonBehaviours', [ - Focusing, - Keying - ]), - option('action'), - option('role'), - defaulted$1('eventOrder', {}) - ] + name: 'Button', + factory: factory$1, + configFields: [ + defaulted$1('uid', undefined), + strict$1('dom'), + defaulted$1('components', []), + SketchBehaviours.field('buttonBehaviours', [ + Focusing, + Keying + ]), + option('action'), + option('role'), + defaulted$1('eventOrder', {}) + ] }); var record = function (spec) { - var uid = isSketchSpec(spec) && hasNonNullableKey(spec, 'uid') ? spec.uid : generate$2('memento'); - var get = function (anyInSystem) { - return anyInSystem.getSystem().getByUid(uid).getOrDie(); - }; - var getOpt = function (anyInSystem) { - return anyInSystem.getSystem().getByUid(uid).toOptional(); - }; - var asSpec = function () { - return __assign(__assign({}, spec), {uid: uid}); - }; - return { - get: get, - getOpt: getOpt, - asSpec: asSpec - }; + var uid = isSketchSpec(spec) && hasNonNullableKey(spec, 'uid') ? spec.uid : generate$2('memento'); + var get = function (anyInSystem) { + return anyInSystem.getSystem().getByUid(uid).getOrDie(); + }; + var getOpt = function (anyInSystem) { + return anyInSystem.getSystem().getByUid(uid).toOptional(); + }; + var asSpec = function () { + return __assign(__assign({}, spec), { uid: uid }); + }; + return { + get: get, + getOpt: getOpt, + asSpec: asSpec + }; }; var defaultIcon = function (icons) { - return Optional.from(icons()['temporary-placeholder']).getOr('!not found!'); + return Optional.from(icons()['temporary-placeholder']).getOr('!not found!'); }; var get$e = function (name, icons) { - return Optional.from(icons()[name.toLowerCase()]).getOrThunk(function () { - return defaultIcon(icons); - }); + return Optional.from(icons()[name.toLowerCase()]).getOrThunk(function () { + return defaultIcon(icons); + }); }; var getOr = function (name, icons, fallback) { - return Optional.from(icons()[name.toLowerCase()]).or(fallback).getOrThunk(function () { - return defaultIcon(icons); - }); + return Optional.from(icons()[name.toLowerCase()]).or(fallback).getOrThunk(function () { + return defaultIcon(icons); + }); }; var getFirst$1 = function (names, icons) { - return findMap(names, function (name) { - return Optional.from(icons()[name.toLowerCase()]); - }).getOrThunk(function () { - return defaultIcon(icons); - }); + return findMap(names, function (name) { + return Optional.from(icons()[name.toLowerCase()]); + }).getOrThunk(function () { + return defaultIcon(icons); + }); }; var notificationIconMap = { - success: 'checkmark', - error: 'warning', - err: 'error', - warning: 'warning', - warn: 'warning', - info: 'info' + success: 'checkmark', + error: 'warning', + err: 'error', + warning: 'warning', + warn: 'warning', + info: 'info' }; var factory$2 = function (detail) { - var memBannerText = record({ - dom: { - tag: 'p', - innerHtml: detail.translationProvider(detail.text) - }, - behaviours: derive$1([Replacing.config({})]) - }); - var renderPercentBar = function (percent) { - return { - dom: { - tag: 'div', - classes: ['tox-bar'], - attributes: {style: 'width: ' + percent + '%'} - } - }; - }; - var renderPercentText = function (percent) { - return { - dom: { - tag: 'div', - classes: ['tox-text'], - innerHtml: percent + '%' - } - }; - }; - var memBannerProgress = record({ - dom: { - tag: 'div', - classes: detail.progress ? [ - 'tox-progress-bar', - 'tox-progress-indicator' - ] : ['tox-progress-bar'] - }, - components: [ - { - dom: { - tag: 'div', - classes: ['tox-bar-container'] - }, - components: [renderPercentBar(0)] - }, - renderPercentText(0) - ], - behaviours: derive$1([Replacing.config({})]) - }); - var updateProgress = function (comp, percent) { - if (comp.getSystem().isConnected()) { - memBannerProgress.getOpt(comp).each(function (progress) { - Replacing.set(progress, [ - { - dom: { - tag: 'div', - classes: ['tox-bar-container'] - }, - components: [renderPercentBar(percent)] - }, - renderPercentText(percent) - ]); - }); - } - }; - var updateText = function (comp, text$1) { - if (comp.getSystem().isConnected()) { - var banner = memBannerText.get(comp); - Replacing.set(banner, [text(text$1)]); - } - }; - var apis = { - updateProgress: updateProgress, - updateText: updateText + var memBannerText = record({ + dom: { + tag: 'p', + innerHtml: detail.translationProvider(detail.text) + }, + behaviours: derive$1([Replacing.config({})]) + }); + var renderPercentBar = function (percent) { + return { + dom: { + tag: 'div', + classes: ['tox-bar'], + attributes: { style: 'width: ' + percent + '%' } + } }; - var iconChoices = flatten([ - detail.icon.toArray(), - detail.level.toArray(), - detail.level.bind(function (level) { - return Optional.from(notificationIconMap[level]); - }).toArray() - ]); - var memButton = record(Button.sketch({ + }; + var renderPercentText = function (percent) { + return { + dom: { + tag: 'div', + classes: ['tox-text'], + innerHtml: percent + '%' + } + }; + }; + var memBannerProgress = record({ + dom: { + tag: 'div', + classes: detail.progress ? [ + 'tox-progress-bar', + 'tox-progress-indicator' + ] : ['tox-progress-bar'] + }, + components: [ + { dom: { - tag: 'button', - classes: [ - 'tox-notification__dismiss', - 'tox-button', - 'tox-button--naked', - 'tox-button--icon' - ] - }, - components: [{ - dom: { - tag: 'div', - classes: ['tox-icon'], - innerHtml: get$e('close', detail.iconProvider), - attributes: {'aria-label': detail.translationProvider('Close')} - } - }], - action: function (comp) { - detail.onAction(comp); - } - })); - var components = [ - { - dom: { - tag: 'div', - classes: ['tox-notification__icon'], - innerHtml: getFirst$1(iconChoices, detail.iconProvider) - } + tag: 'div', + classes: ['tox-bar-container'] }, - { + components: [renderPercentBar(0)] + }, + renderPercentText(0) + ], + behaviours: derive$1([Replacing.config({})]) + }); + var updateProgress = function (comp, percent) { + if (comp.getSystem().isConnected()) { + memBannerProgress.getOpt(comp).each(function (progress) { + Replacing.set(progress, [ + { dom: { - tag: 'div', - classes: ['tox-notification__body'] + tag: 'div', + classes: ['tox-bar-container'] }, - components: [memBannerText.asSpec()], - behaviours: derive$1([Replacing.config({})]) - } - ]; - return { - uid: detail.uid, + components: [renderPercentBar(percent)] + }, + renderPercentText(percent) + ]); + }); + } + }; + var updateText = function (comp, text$1) { + if (comp.getSystem().isConnected()) { + var banner = memBannerText.get(comp); + Replacing.set(banner, [text(text$1)]); + } + }; + var apis = { + updateProgress: updateProgress, + updateText: updateText + }; + var iconChoices = flatten([ + detail.icon.toArray(), + detail.level.toArray(), + detail.level.bind(function (level) { + return Optional.from(notificationIconMap[level]); + }).toArray() + ]); + var memButton = record(Button.sketch({ + dom: { + tag: 'button', + classes: [ + 'tox-notification__dismiss', + 'tox-button', + 'tox-button--naked', + 'tox-button--icon' + ] + }, + components: [{ dom: { - tag: 'div', - attributes: {role: 'alert'}, - classes: detail.level.map(function (level) { - return [ - 'tox-notification', - 'tox-notification--in', - 'tox-notification--' + level - ]; - }).getOr([ - 'tox-notification', - 'tox-notification--in' - ]) - }, - behaviours: derive$1([ - Focusing.config({}), - config('notification-events', [run(focusin(), function (comp) { - memButton.getOpt(comp).each(Focusing.focus); - })]) - ]), - components: components.concat(detail.progress ? [memBannerProgress.asSpec()] : []).concat(!detail.closeButton ? [] : [memButton.asSpec()]), - apis: apis - }; + tag: 'div', + classes: ['tox-icon'], + innerHtml: get$e('close', detail.iconProvider), + attributes: { 'aria-label': detail.translationProvider('Close') } + } + }], + action: function (comp) { + detail.onAction(comp); + } + })); + var components = [ + { + dom: { + tag: 'div', + classes: ['tox-notification__icon'], + innerHtml: getFirst$1(iconChoices, detail.iconProvider) + } + }, + { + dom: { + tag: 'div', + classes: ['tox-notification__body'] + }, + components: [memBannerText.asSpec()], + behaviours: derive$1([Replacing.config({})]) + } + ]; + return { + uid: detail.uid, + dom: { + tag: 'div', + attributes: { role: 'alert' }, + classes: detail.level.map(function (level) { + return [ + 'tox-notification', + 'tox-notification--in', + 'tox-notification--' + level + ]; + }).getOr([ + 'tox-notification', + 'tox-notification--in' + ]) + }, + behaviours: derive$1([ + Focusing.config({}), + config('notification-events', [run(focusin(), function (comp) { + memButton.getOpt(comp).each(Focusing.focus); + })]) + ]), + components: components.concat(detail.progress ? [memBannerProgress.asSpec()] : []).concat(!detail.closeButton ? [] : [memButton.asSpec()]), + apis: apis + }; }; var Notification = single$2({ - name: 'Notification', - factory: factory$2, - configFields: [ - option('level'), - strict$1('progress'), - strict$1('icon'), - strict$1('onAction'), - strict$1('text'), - strict$1('iconProvider'), - strict$1('translationProvider'), - defaultedBoolean('closeButton', true) - ], - apis: { - updateProgress: function (apis, comp, percent) { - apis.updateProgress(comp, percent); - }, - updateText: function (apis, comp, text) { - apis.updateText(comp, text); - } + name: 'Notification', + factory: factory$2, + configFields: [ + option('level'), + strict$1('progress'), + strict$1('icon'), + strict$1('onAction'), + strict$1('text'), + strict$1('iconProvider'), + strict$1('translationProvider'), + defaultedBoolean('closeButton', true) + ], + apis: { + updateProgress: function (apis, comp, percent) { + apis.updateProgress(comp, percent); + }, + updateText: function (apis, comp, text) { + apis.updateText(comp, text); } + } }); - function NotificationManagerImpl(editor, extras, uiMothership) { - var backstage = extras.backstage; - var getLayoutDirection = function (rel) { - switch (rel) { - case 'bc-bc': - return south$3; - case 'tc-tc': - return north$3; - case 'tc-bc': - return north$1; - case 'bc-tc': - default: - return south$1; - } - }; - var prePositionNotifications = function (notifications) { - each(notifications, function (notification) { - return notification.moveTo(0, 0); - }); - }; - var positionNotifications = function (notifications) { - if (notifications.length > 0) { - head(notifications).each(function (firstItem) { - return firstItem.moveRel(null, 'banner'); - }); - each(notifications, function (notification, index) { - if (index > 0) { - notification.moveRel(notifications[index - 1].getEl(), 'bc-tc'); - } - }); - } - }; - var reposition = function (notifications) { - prePositionNotifications(notifications); - positionNotifications(notifications); - }; - var open = function (settings, closeCallback) { - var hideCloseButton = !settings.closeButton && settings.timeout && (settings.timeout > 0 || settings.timeout < 0); - var close = function () { - closeCallback(); - InlineView.hide(notificationWrapper); - }; - var notification = build$1(Notification.sketch({ - text: settings.text, - level: contains([ - 'success', - 'error', - 'warning', - 'warn', - 'info' - ], settings.type) ? settings.type : undefined, - progress: settings.progressBar === true, - icon: Optional.from(settings.icon), - closeButton: !hideCloseButton, - onAction: close, - iconProvider: backstage.shared.providers.icons, - translationProvider: backstage.shared.providers.translate - })); - var notificationWrapper = build$1(InlineView.sketch(__assign({ - dom: { - tag: 'div', - classes: ['tox-notifications-container'] - }, - lazySink: extras.backstage.shared.getSink, - fireDismissalEventInstead: {} - }, backstage.shared.header.isPositionedAtTop() ? {} : {fireRepositionEventInstead: {}}))); - uiMothership.add(notificationWrapper); - if (settings.timeout > 0) { - global$2.setTimeout(function () { - close(); - }, settings.timeout); - } - return { - close: close, - moveTo: function (x, y) { - InlineView.showAt(notificationWrapper, { - anchor: 'makeshift', - x: x, - y: y - }, premade$1(notification)); - }, - moveRel: function (element, rel) { - if (rel !== 'banner') { - var layoutDirection_1 = getLayoutDirection(rel); - var nodeAnchor = { - anchor: 'node', - root: body(), - node: Optional.some(SugarElement.fromDom(element)), - layouts: { - onRtl: function () { - return [layoutDirection_1]; - }, - onLtr: function () { - return [layoutDirection_1]; - } - } - }; - InlineView.showAt(notificationWrapper, nodeAnchor, premade$1(notification)); - } else { - InlineView.showAt(notificationWrapper, extras.backstage.shared.anchors.banner(), premade$1(notification)); - } - }, - text: function (nuText) { - Notification.updateText(notification, nuText); - }, - settings: settings, - getEl: function () { - return notification.element.dom; - }, - progressBar: { - value: function (percent) { - Notification.updateProgress(notification, percent); - } - } - }; - }; - var close = function (notification) { - notification.close(); - }; - var getArgs = function (notification) { - return notification.settings; + function NotificationManagerImpl (editor, extras, uiMothership) { + var backstage = extras.backstage; + var getLayoutDirection = function (rel) { + switch (rel) { + case 'bc-bc': + return south$3; + case 'tc-tc': + return north$3; + case 'tc-bc': + return north$1; + case 'bc-tc': + default: + return south$1; + } + }; + var prePositionNotifications = function (notifications) { + each(notifications, function (notification) { + return notification.moveTo(0, 0); + }); + }; + var positionNotifications = function (notifications) { + if (notifications.length > 0) { + head(notifications).each(function (firstItem) { + return firstItem.moveRel(null, 'banner'); + }); + each(notifications, function (notification, index) { + if (index > 0) { + notification.moveRel(notifications[index - 1].getEl(), 'bc-tc'); + } + }); + } + }; + var reposition = function (notifications) { + prePositionNotifications(notifications); + positionNotifications(notifications); + }; + var open = function (settings, closeCallback) { + var hideCloseButton = !settings.closeButton && settings.timeout && (settings.timeout > 0 || settings.timeout < 0); + var close = function () { + closeCallback(); + InlineView.hide(notificationWrapper); }; + var notification = build$1(Notification.sketch({ + text: settings.text, + level: contains([ + 'success', + 'error', + 'warning', + 'warn', + 'info' + ], settings.type) ? settings.type : undefined, + progress: settings.progressBar === true, + icon: Optional.from(settings.icon), + closeButton: !hideCloseButton, + onAction: close, + iconProvider: backstage.shared.providers.icons, + translationProvider: backstage.shared.providers.translate + })); + var notificationWrapper = build$1(InlineView.sketch(__assign({ + dom: { + tag: 'div', + classes: ['tox-notifications-container'] + }, + lazySink: extras.backstage.shared.getSink, + fireDismissalEventInstead: {} + }, backstage.shared.header.isPositionedAtTop() ? {} : { fireRepositionEventInstead: {} }))); + uiMothership.add(notificationWrapper); + if (settings.timeout > 0) { + global$2.setTimeout(function () { + close(); + }, settings.timeout); + } return { - open: open, - close: close, - reposition: reposition, - getArgs: getArgs - }; + close: close, + moveTo: function (x, y) { + InlineView.showAt(notificationWrapper, { + anchor: 'makeshift', + x: x, + y: y + }, premade$1(notification)); + }, + moveRel: function (element, rel) { + if (rel !== 'banner') { + var layoutDirection_1 = getLayoutDirection(rel); + var nodeAnchor = { + anchor: 'node', + root: body(), + node: Optional.some(SugarElement.fromDom(element)), + layouts: { + onRtl: function () { + return [layoutDirection_1]; + }, + onLtr: function () { + return [layoutDirection_1]; + } + } + }; + InlineView.showAt(notificationWrapper, nodeAnchor, premade$1(notification)); + } else { + InlineView.showAt(notificationWrapper, extras.backstage.shared.anchors.banner(), premade$1(notification)); + } + }, + text: function (nuText) { + Notification.updateText(notification, nuText); + }, + settings: settings, + getEl: function () { + return notification.element.dom; + }, + progressBar: { + value: function (percent) { + Notification.updateProgress(notification, percent); + } + } + }; + }; + var close = function (notification) { + notification.close(); + }; + var getArgs = function (notification) { + return notification.settings; + }; + return { + open: open, + close: close, + reposition: reposition, + getArgs: getArgs + }; } var first = function (fn, rate) { - var timer = null; - var cancel = function () { - if (timer !== null) { - clearTimeout(timer); - timer = null; - } - }; - var throttle = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (timer === null) { - timer = setTimeout(function () { - fn.apply(null, args); - timer = null; - }, rate); - } - }; - return { - cancel: cancel, - throttle: throttle - }; + var timer = null; + var cancel = function () { + if (timer !== null) { + clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer === null) { + timer = setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + } + }; + return { + cancel: cancel, + throttle: throttle + }; }; var last$2 = function (fn, rate) { - var timer = null; - var cancel = function () { - if (timer !== null) { - clearTimeout(timer); - timer = null; - } - }; - var throttle = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (timer !== null) { - clearTimeout(timer); - } - timer = setTimeout(function () { - fn.apply(null, args); - timer = null; - }, rate); - }; - return { - cancel: cancel, - throttle: throttle - }; + var timer = null; + var cancel = function () { + if (timer !== null) { + clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer !== null) { + clearTimeout(timer); + } + timer = setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + }; + return { + cancel: cancel, + throttle: throttle + }; }; var global$3 = tinymce.util.Tools.resolve('tinymce.dom.TextSeeker'); var isBoundary = function (dom, node) { - return dom.isBlock(node) || contains([ - 'BR', - 'IMG', - 'HR', - 'INPUT' - ], node.nodeName) || dom.getContentEditable(node) === 'false'; + return dom.isBlock(node) || contains([ + 'BR', + 'IMG', + 'HR', + 'INPUT' + ], node.nodeName) || dom.getContentEditable(node) === 'false'; }; var repeatLeft = function (dom, node, offset, process, rootNode) { - var search = global$3(dom, function (node) { - return isBoundary(dom, node); - }); - return Optional.from(search.backwards(node, offset, process, rootNode)); + var search = global$3(dom, function (node) { + return isBoundary(dom, node); + }); + return Optional.from(search.backwards(node, offset, process, rootNode)); }; var autocompleteSelector = '[data-mce-autocompleter]'; var create$4 = function (editor, range) { - return detect$4(SugarElement.fromDom(editor.selection.getNode())).getOrThunk(function () { - var wrapper = SugarElement.fromHtml('', editor.getDoc()); - append(wrapper, SugarElement.fromDom(range.extractContents())); - range.insertNode(wrapper.dom); - parent(wrapper).each(function (elm) { - return elm.dom.normalize(); - }); - last$1(wrapper).map(function (last) { - editor.selection.setCursorLocation(last.dom, getEnd(last)); - }); - return wrapper; + return detect$4(SugarElement.fromDom(editor.selection.getNode())).getOrThunk(function () { + var wrapper = SugarElement.fromHtml('', editor.getDoc()); + append(wrapper, SugarElement.fromDom(range.extractContents())); + range.insertNode(wrapper.dom); + parent(wrapper).each(function (elm) { + return elm.dom.normalize(); }); + last$1(wrapper).map(function (last) { + editor.selection.setCursorLocation(last.dom, getEnd(last)); + }); + return wrapper; + }); }; var detect$4 = function (elm) { - return closest$3(elm, autocompleteSelector); + return closest$3(elm, autocompleteSelector); }; var isValidTextRange = function (rng) { - return rng.collapsed && rng.startContainer.nodeType === 3; + return rng.collapsed && rng.startContainer.nodeType === 3; }; var getText = function (rng) { - return rng.toString().replace(/\u00A0/g, ' ').replace(/\uFEFF/g, ''); + return rng.toString().replace(/\u00A0/g, ' ').replace(/\uFEFF/g, ''); }; var isWhitespace = function (chr) { - return chr !== '' && ' \xA0\f\n\r\t\x0B'.indexOf(chr) !== -1; + return chr !== '' && ' \xA0\f\n\r\t\x0B'.indexOf(chr) !== -1; }; var stripTriggerChar = function (text, triggerCh) { - return text.substring(triggerCh.length); + return text.substring(triggerCh.length); }; var findChar = function (text, index, ch) { - var i; - for (i = index - 1; i >= 0; i--) { - var char = text.charAt(i); - if (isWhitespace(char)) { - return Optional.none(); - } - if (char === ch) { - break; - } + var i; + for (i = index - 1; i >= 0; i--) { + var char = text.charAt(i); + if (isWhitespace(char)) { + return Optional.none(); } - return Optional.some(i); + if (char === ch) { + break; + } + } + return Optional.some(i); }; var findStart = function (dom, initRange, ch, minChars) { - if (minChars === void 0) { - minChars = 0; - } - if (!isValidTextRange(initRange)) { - return Optional.none(); + if (minChars === void 0) { + minChars = 0; + } + if (!isValidTextRange(initRange)) { + return Optional.none(); + } + var findTriggerChIndex = function (element, offset, text) { + return findChar(text, offset, ch).getOr(offset); + }; + var root = dom.getParent(initRange.startContainer, dom.isBlock) || dom.getRoot(); + return repeatLeft(dom, initRange.startContainer, initRange.startOffset, findTriggerChIndex, root).bind(function (spot) { + var range = initRange.cloneRange(); + range.setStart(spot.container, spot.offset); + range.setEnd(initRange.endContainer, initRange.endOffset); + if (range.collapsed) { + return Optional.none(); + } + var text = getText(range); + var triggerCharIndex = text.lastIndexOf(ch); + if (triggerCharIndex !== 0 || stripTriggerChar(text, ch).length < minChars) { + return Optional.none(); + } else { + return Optional.some({ + text: stripTriggerChar(text, ch), + range: range, + triggerChar: ch + }); } - var findTriggerChIndex = function (element, offset, text) { - return findChar(text, offset, ch).getOr(offset); - }; - var root = dom.getParent(initRange.startContainer, dom.isBlock) || dom.getRoot(); - return repeatLeft(dom, initRange.startContainer, initRange.startOffset, findTriggerChIndex, root).bind(function (spot) { - var range = initRange.cloneRange(); - range.setStart(spot.container, spot.offset); - range.setEnd(initRange.endContainer, initRange.endOffset); - if (range.collapsed) { - return Optional.none(); - } - var text = getText(range); - var triggerCharIndex = text.lastIndexOf(ch); - if (triggerCharIndex !== 0 || stripTriggerChar(text, ch).length < minChars) { - return Optional.none(); - } else { - return Optional.some({ - text: stripTriggerChar(text, ch), - range: range, - triggerChar: ch - }); - } - }); + }); }; var getContext = function (dom, initRange, ch, minChars) { - if (minChars === void 0) { - minChars = 0; - } - return detect$4(SugarElement.fromDom(initRange.startContainer)).fold(function () { - return findStart(dom, initRange, ch, minChars); - }, function (elm) { - var range = dom.createRng(); - range.selectNode(elm.dom); - var text = getText(range); - return Optional.some({ - range: range, - text: stripTriggerChar(text, ch), - triggerChar: ch - }); + if (minChars === void 0) { + minChars = 0; + } + return detect$4(SugarElement.fromDom(initRange.startContainer)).fold(function () { + return findStart(dom, initRange, ch, minChars); + }, function (elm) { + var range = dom.createRng(); + range.selectNode(elm.dom); + var text = getText(range); + return Optional.some({ + range: range, + text: stripTriggerChar(text, ch), + triggerChar: ch }); + }); }; var setup = function (api, editor) { - editor.on('keypress compositionend', api.onKeypress.throttle); - editor.on('remove', api.onKeypress.cancel); - var redirectKeyToItem = function (item, e) { - emitWith(item, keydown(), {raw: e}); - }; - editor.on('keydown', function (e) { - var getItem = function () { - return api.getView().bind(Highlighting.getHighlighted); - }; - if (e.which === 8) { - api.onKeypress.throttle(e); - } - if (api.isActive()) { - if (e.which === 27) { - api.cancelIfNecessary(); - } - if (api.isMenuOpen()) { - if (e.which === 13) { - getItem().each(emitExecute); - e.preventDefault(); - } else if (e.which === 40) { - getItem().fold(function () { - api.getView().each(Highlighting.highlightFirst); - }, function (item) { - redirectKeyToItem(item, e); - }); - e.preventDefault(); - e.stopImmediatePropagation(); - } else if (e.which === 37 || e.which === 38 || e.which === 39) { - getItem().each(function (item) { - redirectKeyToItem(item, e); - e.preventDefault(); - e.stopImmediatePropagation(); - }); - } - } else { - if (e.which === 13 || e.which === 38 || e.which === 40) { - api.cancelIfNecessary(); - } - } + editor.on('keypress compositionend', api.onKeypress.throttle); + editor.on('remove', api.onKeypress.cancel); + var redirectKeyToItem = function (item, e) { + emitWith(item, keydown(), { raw: e }); + }; + editor.on('keydown', function (e) { + var getItem = function () { + return api.getView().bind(Highlighting.getHighlighted); + }; + if (e.which === 8) { + api.onKeypress.throttle(e); + } + if (api.isActive()) { + if (e.which === 27) { + api.cancelIfNecessary(); + } + if (api.isMenuOpen()) { + if (e.which === 13) { + getItem().each(emitExecute); + e.preventDefault(); + } else if (e.which === 40) { + getItem().fold(function () { + api.getView().each(Highlighting.highlightFirst); + }, function (item) { + redirectKeyToItem(item, e); + }); + e.preventDefault(); + e.stopImmediatePropagation(); + } else if (e.which === 37 || e.which === 38 || e.which === 39) { + getItem().each(function (item) { + redirectKeyToItem(item, e); + e.preventDefault(); + e.stopImmediatePropagation(); + }); } - }); - editor.on('NodeChange', function (e) { - if (api.isActive() && !api.isProcessingAction() && detect$4(SugarElement.fromDom(e.element)).isNone()) { - api.cancelIfNecessary(); + } else { + if (e.which === 13 || e.which === 38 || e.which === 40) { + api.cancelIfNecessary(); } - }); + } + } + }); + editor.on('NodeChange', function (e) { + if (api.isActive() && !api.isProcessingAction() && detect$4(SugarElement.fromDom(e.element)).isNone()) { + api.cancelIfNecessary(); + } + }); }; - var AutocompleterEditorEvents = {setup: setup}; + var AutocompleterEditorEvents = { setup: setup }; var global$4 = tinymce.util.Tools.resolve('tinymce.util.Promise'); var point$1 = function (container, offset) { - return { - container: container, - offset: offset - }; + return { + container: container, + offset: offset + }; }; var isText$1 = function (node) { - return node.nodeType === TEXT; + return node.nodeType === TEXT; }; var isElement$1 = function (node) { - return node.nodeType === ELEMENT; + return node.nodeType === ELEMENT; }; var toLast = function (node) { - if (isText$1(node)) { - return point$1(node, node.data.length); - } else { - var children = node.childNodes; - return children.length > 0 ? toLast(children[children.length - 1]) : point$1(node, children.length); - } + if (isText$1(node)) { + return point$1(node, node.data.length); + } else { + var children = node.childNodes; + return children.length > 0 ? toLast(children[children.length - 1]) : point$1(node, children.length); + } }; var toLeaf = function (node, offset) { - var children = node.childNodes; - if (children.length > 0 && offset < children.length) { - return toLeaf(children[offset], 0); - } else if (children.length > 0 && isElement$1(node) && children.length === offset) { - return toLast(children[children.length - 1]); - } else { - return point$1(node, offset); - } + var children = node.childNodes; + if (children.length > 0 && offset < children.length) { + return toLeaf(children[offset], 0); + } else if (children.length > 0 && isElement$1(node) && children.length === offset) { + return toLast(children[children.length - 1]); + } else { + return point$1(node, offset); + } }; var isPreviousCharContent = function (dom, leaf) { - return repeatLeft(dom, leaf.container, leaf.offset, function (element, offset) { - return offset === 0 ? -1 : offset; - }, dom.getRoot()).filter(function (spot) { - var char = spot.container.data.charAt(spot.offset - 1); - return !isWhitespace(char); - }).isSome(); + return repeatLeft(dom, leaf.container, leaf.offset, function (element, offset) { + return offset === 0 ? -1 : offset; + }, dom.getRoot()).filter(function (spot) { + var char = spot.container.data.charAt(spot.offset - 1); + return !isWhitespace(char); + }).isSome(); }; var isStartOfWord = function (dom) { - return function (rng) { - var leaf = toLeaf(rng.startContainer, rng.startOffset); - return !isPreviousCharContent(dom, leaf); - }; + return function (rng) { + var leaf = toLeaf(rng.startContainer, rng.startOffset); + return !isPreviousCharContent(dom, leaf); + }; }; var getTriggerContext = function (dom, initRange, database) { - return findMap(database.triggerChars, function (ch) { - return getContext(dom, initRange, ch); - }); + return findMap(database.triggerChars, function (ch) { + return getContext(dom, initRange, ch); + }); }; var lookup = function (editor, getDatabase) { - var database = getDatabase(); - var rng = editor.selection.getRng(); - return getTriggerContext(editor.dom, rng, database).bind(function (context) { - return lookupWithContext(editor, getDatabase, context); - }); + var database = getDatabase(); + var rng = editor.selection.getRng(); + return getTriggerContext(editor.dom, rng, database).bind(function (context) { + return lookupWithContext(editor, getDatabase, context); + }); }; var lookupWithContext = function (editor, getDatabase, context, fetchOptions) { - if (fetchOptions === void 0) { - fetchOptions = {}; - } - var database = getDatabase(); - var rng = editor.selection.getRng(); - var startText = rng.startContainer.nodeValue; - var autocompleters = filter(database.lookupByChar(context.triggerChar), function (autocompleter) { - return context.text.length >= autocompleter.minChars && autocompleter.matches.getOrThunk(function () { - return isStartOfWord(editor.dom); - })(context.range, startText, context.text); - }); - if (autocompleters.length === 0) { - return Optional.none(); - } - var lookupData = global$4.all(map(autocompleters, function (ac) { - var fetchResult = ac.fetch(context.text, ac.maxResults, fetchOptions); - return fetchResult.then(function (results) { - return { - matchText: context.text, - items: results, - columns: ac.columns, - onAction: ac.onAction, - highlightOn: ac.highlightOn - }; - }); - })); - return Optional.some({ - lookupData: lookupData, - context: context - }); + if (fetchOptions === void 0) { + fetchOptions = {}; + } + var database = getDatabase(); + var rng = editor.selection.getRng(); + var startText = rng.startContainer.nodeValue; + var autocompleters = filter(database.lookupByChar(context.triggerChar), function (autocompleter) { + return context.text.length >= autocompleter.minChars && autocompleter.matches.getOrThunk(function () { + return isStartOfWord(editor.dom); + })(context.range, startText, context.text); + }); + if (autocompleters.length === 0) { + return Optional.none(); + } + var lookupData = global$4.all(map(autocompleters, function (ac) { + var fetchResult = ac.fetch(context.text, ac.maxResults, fetchOptions); + return fetchResult.then(function (results) { + return { + matchText: context.text, + items: results, + columns: ac.columns, + onAction: ac.onAction, + highlightOn: ac.highlightOn + }; + }); + })); + return Optional.some({ + lookupData: lookupData, + context: context + }); }; var separatorMenuItemSchema = objOf([ - strictString('type'), - optionString('text') + strictString('type'), + optionString('text') ]); var createSeparatorMenuItem = function (spec) { - return asRaw('separatormenuitem', separatorMenuItemSchema, spec); + return asRaw('separatormenuitem', separatorMenuItemSchema, spec); }; var autocompleterItemSchema = objOf([ - defaulted$1('type', 'autocompleteitem'), - defaulted$1('active', false), - defaulted$1('disabled', false), - defaulted$1('meta', {}), - strictString('value'), - optionString('text'), - optionString('icon') + defaulted$1('type', 'autocompleteitem'), + defaulted$1('active', false), + defaulted$1('disabled', false), + defaulted$1('meta', {}), + strictString('value'), + optionString('text'), + optionString('icon') ]); var autocompleterSchema = objOf([ - strictString('type'), - strictString('ch'), - defaultedNumber('minChars', 1), - defaulted$1('columns', 1), - defaultedNumber('maxResults', 10), - optionFunction('matches'), - strictFunction('fetch'), - strictFunction('onAction'), - defaultedArrayOf('highlightOn', [], string) + strictString('type'), + strictString('ch'), + defaultedNumber('minChars', 1), + defaulted$1('columns', 1), + defaultedNumber('maxResults', 10), + optionFunction('matches'), + strictFunction('fetch'), + strictFunction('onAction'), + defaultedArrayOf('highlightOn', [], string) ]); var createSeparatorItem = function (spec) { - return asRaw('Autocompleter.Separator', separatorMenuItemSchema, spec); + return asRaw('Autocompleter.Separator', separatorMenuItemSchema, spec); }; var createAutocompleterItem = function (spec) { - return asRaw('Autocompleter.Item', autocompleterItemSchema, spec); + return asRaw('Autocompleter.Item', autocompleterItemSchema, spec); }; var createAutocompleter = function (spec) { - return asRaw('Autocompleter', autocompleterSchema, spec); + return asRaw('Autocompleter', autocompleterSchema, spec); }; var baseToolbarButtonFields = [ - defaultedBoolean('disabled', false), - optionString('tooltip'), - optionString('icon'), - optionString('text'), - defaultedFunction('onSetup', function () { - return noop; - }) + defaultedBoolean('disabled', false), + optionString('tooltip'), + optionString('icon'), + optionString('text'), + defaultedFunction('onSetup', function () { + return noop; + }) ]; var toolbarButtonSchema = objOf([ - strictString('type'), - strictFunction('onAction') + strictString('type'), + strictFunction('onAction') ].concat(baseToolbarButtonFields)); var createToolbarButton = function (spec) { - return asRaw('toolbarbutton', toolbarButtonSchema, spec); + return asRaw('toolbarbutton', toolbarButtonSchema, spec); }; var baseToolbarToggleButtonFields = [defaultedBoolean('active', false)].concat(baseToolbarButtonFields); var toggleButtonSchema = objOf(baseToolbarToggleButtonFields.concat([ - strictString('type'), - strictFunction('onAction') + strictString('type'), + strictFunction('onAction') ])); var createToggleButton = function (spec) { - return asRaw('ToggleButton', toggleButtonSchema, spec); + return asRaw('ToggleButton', toggleButtonSchema, spec); }; var contextBarFields = [ - defaultedFunction('predicate', function () { - return false; - }), - defaultedStringEnum('scope', 'node', [ - 'node', - 'editor' - ]), - defaultedStringEnum('position', 'selection', [ - 'node', - 'selection', - 'line' - ]) + defaultedFunction('predicate', function () { + return false; + }), + defaultedStringEnum('scope', 'node', [ + 'node', + 'editor' + ]), + defaultedStringEnum('position', 'selection', [ + 'node', + 'selection', + 'line' + ]) ]; var contextButtonFields = baseToolbarButtonFields.concat([ - defaulted$1('type', 'contextformbutton'), - defaulted$1('primary', false), - strictFunction('onAction'), - state$1('original', identity) + defaulted$1('type', 'contextformbutton'), + defaulted$1('primary', false), + strictFunction('onAction'), + state$1('original', identity) ]); var contextToggleButtonFields = baseToolbarToggleButtonFields.concat([ - defaulted$1('type', 'contextformbutton'), - defaulted$1('primary', false), - strictFunction('onAction'), - state$1('original', identity) + defaulted$1('type', 'contextformbutton'), + defaulted$1('primary', false), + strictFunction('onAction'), + state$1('original', identity) ]); var launchButtonFields = baseToolbarButtonFields.concat([defaulted$1('type', 'contextformbutton')]); var launchToggleButtonFields = baseToolbarToggleButtonFields.concat([defaulted$1('type', 'contextformtogglebutton')]); var toggleOrNormal = choose$1('type', { - contextformbutton: contextButtonFields, - contextformtogglebutton: contextToggleButtonFields + contextformbutton: contextButtonFields, + contextformtogglebutton: contextToggleButtonFields }); var contextFormSchema = objOf([ - defaulted$1('type', 'contextform'), - defaultedFunction('initValue', function () { - return ''; - }), - optionString('label'), - strictArrayOf('commands', toggleOrNormal), - optionOf('launch', choose$1('type', { - contextformbutton: launchButtonFields, - contextformtogglebutton: launchToggleButtonFields - })) + defaulted$1('type', 'contextform'), + defaultedFunction('initValue', function () { + return ''; + }), + optionString('label'), + strictArrayOf('commands', toggleOrNormal), + optionOf('launch', choose$1('type', { + contextformbutton: launchButtonFields, + contextformtogglebutton: launchToggleButtonFields + })) ].concat(contextBarFields)); var createContextForm = function (spec) { - return asRaw('ContextForm', contextFormSchema, spec); + return asRaw('ContextForm', contextFormSchema, spec); }; var contextToolbarSchema = objOf([ - defaulted$1('type', 'contexttoolbar'), - strictString('items') + defaulted$1('type', 'contexttoolbar'), + strictString('items') ].concat(contextBarFields)); var createContextToolbar = function (spec) { - return asRaw('ContextToolbar', contextToolbarSchema, spec); + return asRaw('ContextToolbar', contextToolbarSchema, spec); }; var stringArray = function (a) { - var all = {}; - each(a, function (key) { - all[key] = {}; - }); - return keys(all); + var all = {}; + each(a, function (key) { + all[key] = {}; + }); + return keys(all); }; var register = function (editor) { - var popups = editor.ui.registry.getAll().popups; - var dataset = map$2(popups, function (popup) { - return createAutocompleter(popup).fold(function (err) { - throw new Error(formatError(err)); - }, function (x) { - return x; - }); - }); - var triggerChars = stringArray(mapToArray(dataset, function (v) { - return v.ch; - })); - var datasetValues = values(dataset); - var lookupByChar = function (ch) { - return filter(datasetValues, function (dv) { - return dv.ch === ch; - }); - }; - return { - dataset: dataset, - triggerChars: triggerChars, - lookupByChar: lookupByChar - }; + var popups = editor.ui.registry.getAll().popups; + var dataset = map$2(popups, function (popup) { + return createAutocompleter(popup).fold(function (err) { + throw new Error(formatError(err)); + }, function (x) { + return x; + }); + }); + var triggerChars = stringArray(mapToArray(dataset, function (v) { + return v.ch; + })); + var datasetValues = values(dataset); + var lookupByChar = function (ch) { + return filter(datasetValues, function (dv) { + return dv.ch === ch; + }); + }; + return { + dataset: dataset, + triggerChars: triggerChars, + lookupByChar: lookupByChar + }; }; var ItemResponse; (function (ItemResponse) { - ItemResponse[ItemResponse['CLOSE_ON_EXECUTE'] = 0] = 'CLOSE_ON_EXECUTE'; - ItemResponse[ItemResponse['BUBBLE_TO_SANDBOX'] = 1] = 'BUBBLE_TO_SANDBOX'; + ItemResponse[ItemResponse['CLOSE_ON_EXECUTE'] = 0] = 'CLOSE_ON_EXECUTE'; + ItemResponse[ItemResponse['BUBBLE_TO_SANDBOX'] = 1] = 'BUBBLE_TO_SANDBOX'; }(ItemResponse || (ItemResponse = {}))); var ItemResponse$1 = ItemResponse; @@ -9802,8 +9795,8 @@ var selectableClass = 'tox-collection__item'; var colorClass = 'tox-swatch'; var presetClasses = { - normal: navClass, - color: colorClass + normal: navClass, + color: colorClass }; var tickedClass = 'tox-collection__item--enabled'; var groupHeadingClass = 'tox-collection__group-heading'; @@ -9823,477 +9816,477 @@ var containerValignMiddleClass = 'tox-collection__item-container--valign-middle'; var containerValignBottomClass = 'tox-collection__item-container--valign-bottom'; var classForPreset = function (presets) { - return get$1(presetClasses, presets).getOr(navClass); + return get$1(presetClasses, presets).getOr(navClass); }; var forMenu = function (presets) { - if (presets === 'color') { - return 'tox-swatches'; - } else { - return 'tox-menu'; - } + if (presets === 'color') { + return 'tox-swatches'; + } else { + return 'tox-menu'; + } }; var classes = function (presets) { - return { - backgroundMenu: 'tox-background-menu', - selectedMenu: 'tox-selected-menu', - selectedItem: 'tox-collection__item--active', - hasIcons: 'tox-menu--has-icons', - menu: forMenu(presets), - tieredMenu: 'tox-tiered-menu' - }; + return { + backgroundMenu: 'tox-background-menu', + selectedMenu: 'tox-selected-menu', + selectedItem: 'tox-collection__item--active', + hasIcons: 'tox-menu--has-icons', + menu: forMenu(presets), + tieredMenu: 'tox-tiered-menu' + }; }; var markers$1 = function (presets) { - var menuClasses = classes(presets); - return { - backgroundMenu: menuClasses.backgroundMenu, - selectedMenu: menuClasses.selectedMenu, - menu: menuClasses.menu, - selectedItem: menuClasses.selectedItem, - item: classForPreset(presets) - }; + var menuClasses = classes(presets); + return { + backgroundMenu: menuClasses.backgroundMenu, + selectedMenu: menuClasses.selectedMenu, + menu: menuClasses.menu, + selectedItem: menuClasses.selectedItem, + item: classForPreset(presets) + }; }; var dom$1 = function (hasIcons, columns, presets) { - var menuClasses = classes(presets); - return { - tag: 'div', - classes: flatten([ - [ - menuClasses.menu, - 'tox-menu-' + columns + '-column' - ], - hasIcons ? [menuClasses.hasIcons] : [] - ]) - }; + var menuClasses = classes(presets); + return { + tag: 'div', + classes: flatten([ + [ + menuClasses.menu, + 'tox-menu-' + columns + '-column' + ], + hasIcons ? [menuClasses.hasIcons] : [] + ]) + }; }; var components$1 = [Menu.parts.items({})]; var part = function (hasIcons, columns, presets) { - var menuClasses = classes(presets); - var d = { - tag: 'div', - classes: flatten([[menuClasses.tieredMenu]]) - }; - return { - dom: d, - markers: markers$1(presets) - }; + var menuClasses = classes(presets); + var d = { + tag: 'div', + classes: flatten([[menuClasses.tieredMenu]]) + }; + return { + dom: d, + markers: markers$1(presets) + }; }; var chunk$1 = function (rowDom, numColumns) { - return function (items) { - var chunks = chunk(items, numColumns); - return map(chunks, function (c) { - return { - dom: rowDom, - components: c - }; - }); - }; + return function (items) { + var chunks = chunk(items, numColumns); + return map(chunks, function (c) { + return { + dom: rowDom, + components: c + }; + }); + }; }; var forSwatch = function (columns) { - return { + return { + dom: { + tag: 'div', + classes: [ + 'tox-menu', + 'tox-swatches-menu' + ] + }, + components: [{ dom: { - tag: 'div', - classes: [ - 'tox-menu', - 'tox-swatches-menu' - ] + tag: 'div', + classes: ['tox-swatches'] }, - components: [{ - dom: { - tag: 'div', - classes: ['tox-swatches'] - }, - components: [Menu.parts.items({ - preprocess: columns !== 'auto' ? chunk$1({ - tag: 'div', - classes: ['tox-swatches__row'] - }, columns) : identity - })] - }] - }; + components: [Menu.parts.items({ + preprocess: columns !== 'auto' ? chunk$1({ + tag: 'div', + classes: ['tox-swatches__row'] + }, columns) : identity + })] + }] + }; }; var forToolbar = function (columns) { - return { - dom: { - tag: 'div', - classes: [ - 'tox-menu', - 'tox-collection', - 'tox-collection--toolbar', - 'tox-collection--toolbar-lg' - ] - }, - components: [Menu.parts.items({ - preprocess: chunk$1({ - tag: 'div', - classes: ['tox-collection__group'] - }, columns) - })] - }; + return { + dom: { + tag: 'div', + classes: [ + 'tox-menu', + 'tox-collection', + 'tox-collection--toolbar', + 'tox-collection--toolbar-lg' + ] + }, + components: [Menu.parts.items({ + preprocess: chunk$1({ + tag: 'div', + classes: ['tox-collection__group'] + }, columns) + })] + }; }; var preprocessCollection = function (items, isSeparator) { - var allSplits = []; - var currentSplit = []; - each(items, function (item, i) { - if (isSeparator(item, i)) { - if (currentSplit.length > 0) { - allSplits.push(currentSplit); - } - currentSplit = []; - if (has(item.dom, 'innerHtml')) { - currentSplit.push(item); - } - } else { - currentSplit.push(item); - } - }); - if (currentSplit.length > 0) { + var allSplits = []; + var currentSplit = []; + each(items, function (item, i) { + if (isSeparator(item, i)) { + if (currentSplit.length > 0) { allSplits.push(currentSplit); + } + currentSplit = []; + if (has(item.dom, 'innerHtml')) { + currentSplit.push(item); + } + } else { + currentSplit.push(item); } - return map(allSplits, function (s) { - return { - dom: { - tag: 'div', - classes: ['tox-collection__group'] - }, - components: s - }; - }); - }; - var forCollection = function (columns, initItems, _hasIcons) { + }); + if (currentSplit.length > 0) { + allSplits.push(currentSplit); + } + return map(allSplits, function (s) { return { - dom: { - tag: 'div', - classes: [ - 'tox-menu', - 'tox-collection' - ].concat(columns === 1 ? ['tox-collection--list'] : ['tox-collection--grid']) - }, - components: [Menu.parts.items({ - preprocess: function (items) { - if (columns !== 'auto' && columns > 1) { - return chunk$1({ - tag: 'div', - classes: ['tox-collection__group'] - }, columns)(items); - } else { - return preprocessCollection(items, function (_item, i) { - return initItems[i].type === 'separator'; - }); - } - } - })] + dom: { + tag: 'div', + classes: ['tox-collection__group'] + }, + components: s }; + }); + }; + var forCollection = function (columns, initItems, _hasIcons) { + return { + dom: { + tag: 'div', + classes: [ + 'tox-menu', + 'tox-collection' + ].concat(columns === 1 ? ['tox-collection--list'] : ['tox-collection--grid']) + }, + components: [Menu.parts.items({ + preprocess: function (items) { + if (columns !== 'auto' && columns > 1) { + return chunk$1({ + tag: 'div', + classes: ['tox-collection__group'] + }, columns)(items); + } else { + return preprocessCollection(items, function (_item, i) { + return initItems[i].type === 'separator'; + }); + } + } + })] + }; }; var forHorizontalCollection = function (initItems, _hasIcons) { - return { - dom: { - tag: 'div', - classes: [ - 'tox-collection', - 'tox-collection--horizontal' - ] - }, - components: [Menu.parts.items({ - preprocess: function (items) { - return preprocessCollection(items, function (_item, i) { - return initItems[i].type === 'separator'; - }); - } - })] - }; + return { + dom: { + tag: 'div', + classes: [ + 'tox-collection', + 'tox-collection--horizontal' + ] + }, + components: [Menu.parts.items({ + preprocess: function (items) { + return preprocessCollection(items, function (_item, i) { + return initItems[i].type === 'separator'; + }); + } + })] + }; }; var menuHasIcons = function (xs) { - return exists(xs, function (item) { - return 'icon' in item && item.icon !== undefined; - }); + return exists(xs, function (item) { + return 'icon' in item && item.icon !== undefined; + }); }; var handleError = function (error) { - console.error(formatError(error)); - console.log(error); - return Optional.none(); + console.error(formatError(error)); + console.log(error); + return Optional.none(); }; var createHorizontalPartialMenuWithAlloyItems = function (value, _hasIcons, items, _columns, _presets) { - var structure = forHorizontalCollection(items); - return { - value: value, - dom: structure.dom, - components: structure.components, - items: items - }; + var structure = forHorizontalCollection(items); + return { + value: value, + dom: structure.dom, + components: structure.components, + items: items + }; }; var createPartialMenuWithAlloyItems = function (value, hasIcons, items, columns, presets) { - if (presets === 'color') { - var structure = forSwatch(columns); - return { - value: value, - dom: structure.dom, - components: structure.components, - items: items - }; - } - if (presets === 'normal' && columns === 'auto') { - var structure = forCollection(columns, items); - return { - value: value, - dom: structure.dom, - components: structure.components, - items: items - }; - } - if (presets === 'normal' && columns === 1) { - var structure = forCollection(1, items); - return { - value: value, - dom: structure.dom, - components: structure.components, - items: items - }; - } - if (presets === 'normal') { - var structure = forCollection(columns, items); - return { - value: value, - dom: structure.dom, - components: structure.components, - items: items - }; - } - if (presets === 'listpreview' && columns !== 'auto') { - var structure = forToolbar(columns); - return { - value: value, - dom: structure.dom, - components: structure.components, - items: items - }; - } + if (presets === 'color') { + var structure = forSwatch(columns); return { - value: value, - dom: dom$1(hasIcons, columns, presets), - components: components$1, - items: items + value: value, + dom: structure.dom, + components: structure.components, + items: items + }; + } + if (presets === 'normal' && columns === 'auto') { + var structure = forCollection(columns, items); + return { + value: value, + dom: structure.dom, + components: structure.components, + items: items + }; + } + if (presets === 'normal' && columns === 1) { + var structure = forCollection(1, items); + return { + value: value, + dom: structure.dom, + components: structure.components, + items: items + }; + } + if (presets === 'normal') { + var structure = forCollection(columns, items); + return { + value: value, + dom: structure.dom, + components: structure.components, + items: items + }; + } + if (presets === 'listpreview' && columns !== 'auto') { + var structure = forToolbar(columns); + return { + value: value, + dom: structure.dom, + components: structure.components, + items: items }; + } + return { + value: value, + dom: dom$1(hasIcons, columns, presets), + components: components$1, + items: items + }; }; var cardImageFields = [ - strictString('type'), - strictString('src'), - optionString('alt'), - defaultedArrayOf('classes', [], string) + strictString('type'), + strictString('src'), + optionString('alt'), + defaultedArrayOf('classes', [], string) ]; var cardImageSchema = objOf(cardImageFields); var cardTextFields = [ - strictString('type'), - strictString('text'), - optionString('name'), - defaultedArrayOf('classes', ['tox-collection__item-label'], string) + strictString('type'), + strictString('text'), + optionString('name'), + defaultedArrayOf('classes', ['tox-collection__item-label'], string) ]; var cardTextSchema = objOf(cardTextFields); var itemSchema$2 = valueThunkOf(function () { - return chooseProcessor('type', { - cardimage: cardImageSchema, - cardtext: cardTextSchema, - cardcontainer: cardContainerSchema - }); + return chooseProcessor('type', { + cardimage: cardImageSchema, + cardtext: cardTextSchema, + cardcontainer: cardContainerSchema + }); }); var cardContainerSchema = objOf([ - strictString('type'), - defaultedString('direction', 'horizontal'), - defaultedString('align', 'left'), - defaultedString('valign', 'middle'), - strictArrayOf('items', itemSchema$2) + strictString('type'), + defaultedString('direction', 'horizontal'), + defaultedString('align', 'left'), + defaultedString('valign', 'middle'), + strictArrayOf('items', itemSchema$2) ]); var commonMenuItemFields = [ - defaultedBoolean('disabled', false), - optionString('text'), - optionString('shortcut'), - field('value', 'value', defaultedThunk(function () { - return generate$1('menuitem-value'); - }), anyValue$1()), - defaulted$1('meta', {}) + defaultedBoolean('disabled', false), + optionString('text'), + optionString('shortcut'), + field('value', 'value', defaultedThunk(function () { + return generate$1('menuitem-value'); + }), anyValue$1()), + defaulted$1('meta', {}) ]; var cardMenuItemSchema = objOf([ - strictString('type'), - optionString('label'), - strictArrayOf('items', itemSchema$2), - defaultedFunction('onSetup', function () { - return noop; - }), - defaultedFunction('onAction', noop) + strictString('type'), + optionString('label'), + strictArrayOf('items', itemSchema$2), + defaultedFunction('onSetup', function () { + return noop; + }), + defaultedFunction('onAction', noop) ].concat(commonMenuItemFields)); var createCardMenuItem = function (spec) { - return asRaw('cardmenuitem', cardMenuItemSchema, spec); + return asRaw('cardmenuitem', cardMenuItemSchema, spec); }; var choiceMenuItemSchema = objOf([ - strictString('type'), - defaultedBoolean('active', false), - optionString('icon') + strictString('type'), + defaultedBoolean('active', false), + optionString('icon') ].concat(commonMenuItemFields)); var createChoiceMenuItem = function (spec) { - return asRaw('choicemenuitem', choiceMenuItemSchema, spec); + return asRaw('choicemenuitem', choiceMenuItemSchema, spec); }; var fancyTypes = [ - 'inserttable', - 'colorswatch' + 'inserttable', + 'colorswatch' ]; var fancyMenuItemSchema = objOf([ - strictString('type'), - strictStringEnum('fancytype', fancyTypes), - defaultedFunction('onAction', noop) + strictString('type'), + strictStringEnum('fancytype', fancyTypes), + defaultedFunction('onAction', noop) ]); var createFancyMenuItem = function (spec) { - return asRaw('fancymenuitem', fancyMenuItemSchema, spec); + return asRaw('fancymenuitem', fancyMenuItemSchema, spec); }; var menuItemSchema = objOf([ - strictString('type'), - defaultedFunction('onSetup', function () { - return noop; - }), - defaultedFunction('onAction', noop), - optionString('icon') + strictString('type'), + defaultedFunction('onSetup', function () { + return noop; + }), + defaultedFunction('onAction', noop), + optionString('icon') ].concat(commonMenuItemFields)); var createMenuItem = function (spec) { - return asRaw('menuitem', menuItemSchema, spec); + return asRaw('menuitem', menuItemSchema, spec); }; var nestedMenuItemSchema = objOf([ - strictString('type'), - strictFunction('getSubmenuItems'), - defaultedFunction('onSetup', function () { - return noop; - }), - optionString('icon') + strictString('type'), + strictFunction('getSubmenuItems'), + defaultedFunction('onSetup', function () { + return noop; + }), + optionString('icon') ].concat(commonMenuItemFields)); var createNestedMenuItem = function (spec) { - return asRaw('nestedmenuitem', nestedMenuItemSchema, spec); + return asRaw('nestedmenuitem', nestedMenuItemSchema, spec); }; var toggleMenuItemSchema = objOf([ - strictString('type'), - optionString('icon'), - defaultedBoolean('active', false), - defaultedFunction('onSetup', function () { - return noop; - }), - strictFunction('onAction') + strictString('type'), + optionString('icon'), + defaultedBoolean('active', false), + defaultedFunction('onSetup', function () { + return noop; + }), + strictFunction('onAction') ].concat(commonMenuItemFields)); var createToggleMenuItem = function (spec) { - return asRaw('togglemenuitem', toggleMenuItemSchema, spec); + return asRaw('togglemenuitem', toggleMenuItemSchema, spec); }; var detectSize = function (comp, margin, selectorClass) { - var descendants$1 = descendants(comp.element, '.' + selectorClass); - if (descendants$1.length > 0) { - var columnLength = findIndex(descendants$1, function (c) { - var thisTop = c.dom.getBoundingClientRect().top; - var cTop = descendants$1[0].dom.getBoundingClientRect().top; - return Math.abs(thisTop - cTop) > margin; - }).getOr(descendants$1.length); - return Optional.some({ - numColumns: columnLength, - numRows: Math.ceil(descendants$1.length / columnLength) - }); - } else { - return Optional.none(); - } + var descendants$1 = descendants(comp.element, '.' + selectorClass); + if (descendants$1.length > 0) { + var columnLength = findIndex(descendants$1, function (c) { + var thisTop = c.dom.getBoundingClientRect().top; + var cTop = descendants$1[0].dom.getBoundingClientRect().top; + return Math.abs(thisTop - cTop) > margin; + }).getOr(descendants$1.length); + return Optional.some({ + numColumns: columnLength, + numRows: Math.ceil(descendants$1.length / columnLength) + }); + } else { + return Optional.none(); + } }; var namedEvents = function (name, handlers) { - return derive$1([config(name, handlers)]); + return derive$1([config(name, handlers)]); }; var unnamedEvents = function (handlers) { - return namedEvents(generate$1('unnamed-events'), handlers); + return namedEvents(generate$1('unnamed-events'), handlers); }; var SimpleBehaviours = { - namedEvents: namedEvents, - unnamedEvents: unnamedEvents + namedEvents: namedEvents, + unnamedEvents: unnamedEvents }; var TooltippingSchema = [ - strict$1('lazySink'), - strict$1('tooltipDom'), - defaulted$1('exclusive', true), - defaulted$1('tooltipComponents', []), - defaulted$1('delay', 300), - defaultedStringEnum('mode', 'normal', [ - 'normal', - 'follow-highlight' - ]), - defaulted$1('anchor', function (comp) { - return { - anchor: 'hotspot', - hotspot: comp, - layouts: { - onLtr: constant([ - south$1, - north$1, - southeast$1, - northeast$1, - southwest$1, - northwest$1 - ]), - onRtl: constant([ - south$1, - north$1, - southeast$1, - northeast$1, - southwest$1, - northwest$1 - ]) - } - }; - }), - onHandler('onHide'), - onHandler('onShow') + strict$1('lazySink'), + strict$1('tooltipDom'), + defaulted$1('exclusive', true), + defaulted$1('tooltipComponents', []), + defaulted$1('delay', 300), + defaultedStringEnum('mode', 'normal', [ + 'normal', + 'follow-highlight' + ]), + defaulted$1('anchor', function (comp) { + return { + anchor: 'hotspot', + hotspot: comp, + layouts: { + onLtr: constant([ + south$1, + north$1, + southeast$1, + northeast$1, + southwest$1, + northwest$1 + ]), + onRtl: constant([ + south$1, + north$1, + southeast$1, + northeast$1, + southwest$1, + northwest$1 + ]) + } + }; + }), + onHandler('onHide'), + onHandler('onShow') ]; var init$4 = function () { - var timer = Cell(Optional.none()); - var popup = Cell(Optional.none()); - var getTooltip = function () { - return popup.get(); - }; - var setTooltip = function (comp) { - popup.set(Optional.some(comp)); - }; - var clearTooltip = function () { - popup.set(Optional.none()); - }; - var clearTimer = function () { - timer.get().each(function (t) { - clearTimeout(t); - }); - }; - var resetTimer = function (f, delay) { - clearTimer(); - timer.set(Optional.some(setTimeout(function () { - f(); - }, delay))); - }; - var isShowing = function () { - return popup.get().isSome(); - }; - var readState = constant('not-implemented'); - return nu$5({ - getTooltip: getTooltip, - isShowing: isShowing, - setTooltip: setTooltip, - clearTooltip: clearTooltip, - clearTimer: clearTimer, - resetTimer: resetTimer, - readState: readState - }); + var timer = Cell(Optional.none()); + var popup = Cell(Optional.none()); + var getTooltip = function () { + return popup.get(); + }; + var setTooltip = function (comp) { + popup.set(Optional.some(comp)); + }; + var clearTooltip = function () { + popup.set(Optional.none()); + }; + var clearTimer = function () { + timer.get().each(function (t) { + clearTimeout(t); + }); + }; + var resetTimer = function (f, delay) { + clearTimer(); + timer.set(Optional.some(setTimeout(function () { + f(); + }, delay))); + }; + var isShowing = function () { + return popup.get().isSome(); + }; + var readState = constant('not-implemented'); + return nu$5({ + getTooltip: getTooltip, + isShowing: isShowing, + setTooltip: setTooltip, + clearTooltip: clearTooltip, + clearTimer: clearTimer, + resetTimer: resetTimer, + readState: readState + }); }; var TooltippingState = /*#__PURE__*/Object.freeze({ @@ -10306,14 +10299,14 @@ var HideTooltipEvent = generate$1('tooltip.hide'); var hideAllExclusive = function (component, _tConfig, _tState) { - component.getSystem().broadcastOn([ExclusivityChannel], {}); + component.getSystem().broadcastOn([ExclusivityChannel], {}); }; var setComponents = function (component, tConfig, tState, specs) { - tState.getTooltip().each(function (tooltip) { - if (tooltip.getSystem().isConnected()) { - Replacing.set(tooltip, specs); - } - }); + tState.getTooltip().each(function (tooltip) { + if (tooltip.getSystem().isConnected()) { + Replacing.set(tooltip, specs); + } + }); }; var TooltippingApis = /*#__PURE__*/Object.freeze({ @@ -10323,83 +10316,83 @@ }); var events$8 = function (tooltipConfig, state) { - var hide = function (comp) { - state.getTooltip().each(function (p) { - detach(p); - tooltipConfig.onHide(comp, p); - state.clearTooltip(); - }); - state.clearTimer(); - }; - var show = function (comp) { - if (!state.isShowing()) { - hideAllExclusive(comp); - var sink = tooltipConfig.lazySink(comp).getOrDie(); - var popup = comp.getSystem().build({ - dom: tooltipConfig.tooltipDom, - components: tooltipConfig.tooltipComponents, - events: derive(tooltipConfig.mode === 'normal' ? [ - run(mouseover(), function (_) { - emit(comp, ShowTooltipEvent); - }), - run(mouseout(), function (_) { - emit(comp, HideTooltipEvent); - }) - ] : []), - behaviours: derive$1([Replacing.config({})]) - }); - state.setTooltip(popup); - attach$1(sink, popup); - tooltipConfig.onShow(comp, popup); - Positioning.position(sink, tooltipConfig.anchor(comp), popup); - } - }; - return derive(flatten([ - [ - run(ShowTooltipEvent, function (comp) { - state.resetTimer(function () { - show(comp); - }, tooltipConfig.delay); - }), - run(HideTooltipEvent, function (comp) { - state.resetTimer(function () { - hide(comp); - }, tooltipConfig.delay); - }), - run(receive(), function (comp, message) { - var receivingData = message; - if (!receivingData.universal) { - if (contains(receivingData.channels, ExclusivityChannel)) { - hide(comp); - } - } - }), - runOnDetached(function (comp) { - hide(comp); - }) - ], - tooltipConfig.mode === 'normal' ? [ - run(focusin(), function (comp) { - emit(comp, ShowTooltipEvent); - }), - run(postBlur(), function (comp) { - emit(comp, HideTooltipEvent); - }), - run(mouseover(), function (comp) { - emit(comp, ShowTooltipEvent); - }), - run(mouseout(), function (comp) { - emit(comp, HideTooltipEvent); - }) - ] : [ - run(highlight(), function (comp, _se) { - emit(comp, ShowTooltipEvent); - }), - run(dehighlight(), function (comp) { - emit(comp, HideTooltipEvent); - }) - ] - ])); + var hide = function (comp) { + state.getTooltip().each(function (p) { + detach(p); + tooltipConfig.onHide(comp, p); + state.clearTooltip(); + }); + state.clearTimer(); + }; + var show = function (comp) { + if (!state.isShowing()) { + hideAllExclusive(comp); + var sink = tooltipConfig.lazySink(comp).getOrDie(); + var popup = comp.getSystem().build({ + dom: tooltipConfig.tooltipDom, + components: tooltipConfig.tooltipComponents, + events: derive(tooltipConfig.mode === 'normal' ? [ + run(mouseover(), function (_) { + emit(comp, ShowTooltipEvent); + }), + run(mouseout(), function (_) { + emit(comp, HideTooltipEvent); + }) + ] : []), + behaviours: derive$1([Replacing.config({})]) + }); + state.setTooltip(popup); + attach$1(sink, popup); + tooltipConfig.onShow(comp, popup); + Positioning.position(sink, tooltipConfig.anchor(comp), popup); + } + }; + return derive(flatten([ + [ + run(ShowTooltipEvent, function (comp) { + state.resetTimer(function () { + show(comp); + }, tooltipConfig.delay); + }), + run(HideTooltipEvent, function (comp) { + state.resetTimer(function () { + hide(comp); + }, tooltipConfig.delay); + }), + run(receive(), function (comp, message) { + var receivingData = message; + if (!receivingData.universal) { + if (contains(receivingData.channels, ExclusivityChannel)) { + hide(comp); + } + } + }), + runOnDetached(function (comp) { + hide(comp); + }) + ], + tooltipConfig.mode === 'normal' ? [ + run(focusin(), function (comp) { + emit(comp, ShowTooltipEvent); + }), + run(postBlur(), function (comp) { + emit(comp, HideTooltipEvent); + }), + run(mouseover(), function (comp) { + emit(comp, ShowTooltipEvent); + }), + run(mouseout(), function (comp) { + emit(comp, HideTooltipEvent); + }) + ] : [ + run(highlight(), function (comp, _se) { + emit(comp, ShowTooltipEvent); + }), + run(dehighlight(), function (comp) { + emit(comp, HideTooltipEvent); + }) + ] + ])); }; var ActiveTooltipping = /*#__PURE__*/Object.freeze({ @@ -10408,11 +10401,11 @@ }); var Tooltipping = create$1({ - fields: TooltippingSchema, - name: 'tooltipping', - active: ActiveTooltipping, - state: TooltippingState, - apis: TooltippingApis + fields: TooltippingSchema, + name: 'tooltipping', + active: ActiveTooltipping, + state: TooltippingState, + apis: TooltippingApis }); var global$5 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); @@ -10420,58 +10413,58 @@ var global$6 = tinymce.util.Tools.resolve('tinymce.util.I18n'); var nativeDisabled = [ - 'input', - 'button', - 'textarea', - 'select' + 'input', + 'button', + 'textarea', + 'select' ]; var onLoad$5 = function (component, disableConfig, disableState) { - var f = disableConfig.disabled() ? disable : enable; - f(component, disableConfig); + var f = disableConfig.disabled() ? disable : enable; + f(component, disableConfig); }; var hasNative = function (component, config) { - return config.useNative === true && contains(nativeDisabled, name(component.element)); + return config.useNative === true && contains(nativeDisabled, name(component.element)); }; var nativeIsDisabled = function (component) { - return has$1(component.element, 'disabled'); + return has$1(component.element, 'disabled'); }; var nativeDisable = function (component) { - set$1(component.element, 'disabled', 'disabled'); + set$1(component.element, 'disabled', 'disabled'); }; var nativeEnable = function (component) { - remove$1(component.element, 'disabled'); + remove$1(component.element, 'disabled'); }; var ariaIsDisabled = function (component) { - return get$3(component.element, 'aria-disabled') === 'true'; + return get$3(component.element, 'aria-disabled') === 'true'; }; var ariaDisable = function (component) { - set$1(component.element, 'aria-disabled', 'true'); + set$1(component.element, 'aria-disabled', 'true'); }; var ariaEnable = function (component) { - set$1(component.element, 'aria-disabled', 'false'); + set$1(component.element, 'aria-disabled', 'false'); }; var disable = function (component, disableConfig, _disableState) { - disableConfig.disableClass.each(function (disableClass) { - add$2(component.element, disableClass); - }); - var f = hasNative(component, disableConfig) ? nativeDisable : ariaDisable; - f(component); - disableConfig.onDisabled(component); + disableConfig.disableClass.each(function (disableClass) { + add$2(component.element, disableClass); + }); + var f = hasNative(component, disableConfig) ? nativeDisable : ariaDisable; + f(component); + disableConfig.onDisabled(component); }; var enable = function (component, disableConfig, _disableState) { - disableConfig.disableClass.each(function (disableClass) { - remove$4(component.element, disableClass); - }); - var f = hasNative(component, disableConfig) ? nativeEnable : ariaEnable; - f(component); - disableConfig.onEnabled(component); + disableConfig.disableClass.each(function (disableClass) { + remove$4(component.element, disableClass); + }); + var f = hasNative(component, disableConfig) ? nativeEnable : ariaEnable; + f(component); + disableConfig.onEnabled(component); }; var isDisabled = function (component, disableConfig) { - return hasNative(component, disableConfig) ? nativeIsDisabled(component) : ariaIsDisabled(component); + return hasNative(component, disableConfig) ? nativeIsDisabled(component) : ariaIsDisabled(component); }; var set$7 = function (component, disableConfig, disableState, disabled) { - var f = disabled ? disable : enable; - f(component, disableConfig); + var f = disabled ? disable : enable; + f(component, disableConfig); }; var DisableApis = /*#__PURE__*/Object.freeze({ @@ -10484,15 +10477,15 @@ }); var exhibit$3 = function (base, disableConfig) { - return nu$6({classes: disableConfig.disabled() ? disableConfig.disableClass.toArray() : []}); + return nu$6({ classes: disableConfig.disabled() ? disableConfig.disableClass.toArray() : [] }); }; var events$9 = function (disableConfig, disableState) { - return derive([ - abort(execute(), function (component, _simulatedEvent) { - return isDisabled(component, disableConfig); - }), - loadEvent(disableConfig, disableState, onLoad$5) - ]); + return derive([ + abort(execute(), function (component, _simulatedEvent) { + return isDisabled(component, disableConfig); + }), + loadEvent(disableConfig, disableState, onLoad$5) + ]); }; var ActiveDisable = /*#__PURE__*/Object.freeze({ @@ -10502,750 +10495,750 @@ }); var DisableSchema = [ - defaultedFunction('disabled', never), - defaulted$1('useNative', true), - option('disableClass'), - onHandler('onDisabled'), - onHandler('onEnabled') + defaultedFunction('disabled', never), + defaulted$1('useNative', true), + option('disableClass'), + onHandler('onDisabled'), + onHandler('onEnabled') ]; var Disabling = create$1({ - fields: DisableSchema, - name: 'disabling', - active: ActiveDisable, - apis: DisableApis + fields: DisableSchema, + name: 'disabling', + active: ActiveDisable, + apis: DisableApis }); var global$7 = tinymce.util.Tools.resolve('tinymce.EditorManager'); var getSkinUrl = function (editor) { - var skin = editor.getParam('skin'); - var skinUrl = editor.getParam('skin_url'); - if (skin !== false) { - var skinName = skin ? skin : 'oxide'; - if (skinUrl) { - skinUrl = editor.documentBaseURI.toAbsolute(skinUrl); - } else { - skinUrl = global$7.baseURL + '/skins/ui/' + skinName; - } + var skin = editor.getParam('skin'); + var skinUrl = editor.getParam('skin_url'); + if (skin !== false) { + var skinName = skin ? skin : 'oxide'; + if (skinUrl) { + skinUrl = editor.documentBaseURI.toAbsolute(skinUrl); + } else { + skinUrl = global$7.baseURL + '/skins/ui/' + skinName; } - return skinUrl; + } + return skinUrl; }; var isReadOnly = function (editor) { - return editor.getParam('readonly', false, 'boolean'); + return editor.getParam('readonly', false, 'boolean'); }; var isSkinDisabled = function (editor) { - return editor.getParam('skin') === false; + return editor.getParam('skin') === false; }; var getHeightSetting = function (editor) { - return editor.getParam('height', Math.max(editor.getElement().offsetHeight, 200)); + return editor.getParam('height', Math.max(editor.getElement().offsetHeight, 200)); }; var getWidthSetting = function (editor) { - return editor.getParam('width', global$5.DOM.getStyle(editor.getElement(), 'width')); + return editor.getParam('width', global$5.DOM.getStyle(editor.getElement(), 'width')); }; var getMinWidthSetting = function (editor) { - return Optional.from(editor.getParam('min_width')).filter(isNumber); + return Optional.from(editor.getParam('min_width')).filter(isNumber); }; var getMinHeightSetting = function (editor) { - return Optional.from(editor.getParam('min_height')).filter(isNumber); + return Optional.from(editor.getParam('min_height')).filter(isNumber); }; var getMaxWidthSetting = function (editor) { - return Optional.from(editor.getParam('max_width')).filter(isNumber); + return Optional.from(editor.getParam('max_width')).filter(isNumber); }; var getMaxHeightSetting = function (editor) { - return Optional.from(editor.getParam('max_height')).filter(isNumber); + return Optional.from(editor.getParam('max_height')).filter(isNumber); }; var getUserStyleFormats = function (editor) { - return Optional.from(editor.getParam('style_formats')).filter(isArray); + return Optional.from(editor.getParam('style_formats')).filter(isArray); }; var isMergeStyleFormats = function (editor) { - return editor.getParam('style_formats_merge', false, 'boolean'); + return editor.getParam('style_formats_merge', false, 'boolean'); }; var getLineHeightFormats = function (editor) { - return editor.getParam('lineheight_formats', '1 1.1 1.2 1.3 1.4 1.5 2', 'string').split(' '); + return editor.getParam('lineheight_formats', '1 1.1 1.2 1.3 1.4 1.5 2', 'string').split(' '); }; var getRemovedMenuItems = function (editor) { - return editor.getParam('removed_menuitems', ''); + return editor.getParam('removed_menuitems', ''); }; var isMenubarEnabled = function (editor) { - return editor.getParam('menubar', true, 'boolean') !== false; + return editor.getParam('menubar', true, 'boolean') !== false; }; var isToolbarEnabled = function (editor) { - var toolbar = editor.getParam('toolbar', true); - var isToolbarTrue = toolbar === true; - var isToolbarString = isString(toolbar); - var isToolbarObjectArray = isArray(toolbar) && toolbar.length > 0; - return !isMultipleToolbars(editor) && (isToolbarObjectArray || isToolbarString || isToolbarTrue); + var toolbar = editor.getParam('toolbar', true); + var isToolbarTrue = toolbar === true; + var isToolbarString = isString(toolbar); + var isToolbarObjectArray = isArray(toolbar) && toolbar.length > 0; + return !isMultipleToolbars(editor) && (isToolbarObjectArray || isToolbarString || isToolbarTrue); }; var getMultipleToolbarsSetting = function (editor) { - var toolbars = range(9, function (num) { - return editor.getParam('toolbar' + (num + 1), false, 'string'); - }); - var toolbarArray = filter(toolbars, function (toolbar) { - return typeof toolbar === 'string'; - }); - return toolbarArray.length > 0 ? Optional.some(toolbarArray) : Optional.none(); + var toolbars = range(9, function (num) { + return editor.getParam('toolbar' + (num + 1), false, 'string'); + }); + var toolbarArray = filter(toolbars, function (toolbar) { + return typeof toolbar === 'string'; + }); + return toolbarArray.length > 0 ? Optional.some(toolbarArray) : Optional.none(); }; var isMultipleToolbars = function (editor) { - return getMultipleToolbarsSetting(editor).fold(function () { - var toolbar = editor.getParam('toolbar', [], 'string[]'); - return toolbar.length > 0; - }, function () { - return true; - }); + return getMultipleToolbarsSetting(editor).fold(function () { + var toolbar = editor.getParam('toolbar', [], 'string[]'); + return toolbar.length > 0; + }, function () { + return true; + }); }; var ToolbarMode; (function (ToolbarMode) { - ToolbarMode['default'] = 'wrap'; - ToolbarMode['floating'] = 'floating'; - ToolbarMode['sliding'] = 'sliding'; - ToolbarMode['scrolling'] = 'scrolling'; + ToolbarMode['default'] = 'wrap'; + ToolbarMode['floating'] = 'floating'; + ToolbarMode['sliding'] = 'sliding'; + ToolbarMode['scrolling'] = 'scrolling'; }(ToolbarMode || (ToolbarMode = {}))); var getToolbarMode = function (editor) { - return editor.getParam('toolbar_mode', '', 'string'); + return editor.getParam('toolbar_mode', '', 'string'); }; var ToolbarLocation; (function (ToolbarLocation) { - ToolbarLocation['auto'] = 'auto'; - ToolbarLocation['top'] = 'top'; - ToolbarLocation['bottom'] = 'bottom'; + ToolbarLocation['auto'] = 'auto'; + ToolbarLocation['top'] = 'top'; + ToolbarLocation['bottom'] = 'bottom'; }(ToolbarLocation || (ToolbarLocation = {}))); var getToolbarGroups = function (editor) { - return editor.getParam('toolbar_groups', {}, 'object'); + return editor.getParam('toolbar_groups', {}, 'object'); }; var getToolbarLocation = function (editor) { - return editor.getParam('toolbar_location', ToolbarLocation.auto, 'string'); + return editor.getParam('toolbar_location', ToolbarLocation.auto, 'string'); }; var isToolbarLocationBottom = function (editor) { - return getToolbarLocation(editor) === ToolbarLocation.bottom; + return getToolbarLocation(editor) === ToolbarLocation.bottom; }; var fixedContainerSelector = function (editor) { - return editor.getParam('fixed_toolbar_container', '', 'string'); + return editor.getParam('fixed_toolbar_container', '', 'string'); }; var isToolbarPersist = function (editor) { - return editor.getParam('toolbar_persist', false, 'boolean'); + return editor.getParam('toolbar_persist', false, 'boolean'); }; var fixedContainerElement = function (editor) { - var selector = fixedContainerSelector(editor); - return selector.length > 0 && editor.inline ? descendant$1(body(), selector) : Optional.none(); + var selector = fixedContainerSelector(editor); + return selector.length > 0 && editor.inline ? descendant$1(body(), selector) : Optional.none(); }; var useFixedContainer = function (editor) { - return editor.inline && fixedContainerElement(editor).isSome(); + return editor.inline && fixedContainerElement(editor).isSome(); }; var getUiContainer = function (editor) { - var fixedContainer = fixedContainerElement(editor); - return fixedContainer.getOrThunk(function () { - return getContentContainer(getRootNode(SugarElement.fromDom(editor.getElement()))); - }); + var fixedContainer = fixedContainerElement(editor); + return fixedContainer.getOrThunk(function () { + return getContentContainer(getRootNode(SugarElement.fromDom(editor.getElement()))); + }); }; var isDistractionFree = function (editor) { - return editor.inline && !isMenubarEnabled(editor) && !isToolbarEnabled(editor) && !isMultipleToolbars(editor); + return editor.inline && !isMenubarEnabled(editor) && !isToolbarEnabled(editor) && !isMultipleToolbars(editor); }; var isStickyToolbar = function (editor) { - var isStickyToolbar = editor.getParam('toolbar_sticky', false, 'boolean'); - return (isStickyToolbar || editor.inline) && !useFixedContainer(editor) && !isDistractionFree(editor); + var isStickyToolbar = editor.getParam('toolbar_sticky', false, 'boolean'); + return (isStickyToolbar || editor.inline) && !useFixedContainer(editor) && !isDistractionFree(editor); }; var isDraggableModal = function (editor) { - return editor.getParam('draggable_modal', false, 'boolean'); + return editor.getParam('draggable_modal', false, 'boolean'); }; var getMenus = function (editor) { - var menu = editor.getParam('menu'); - if (menu) { - return map$2(menu, function (menu) { - return __assign(__assign({}, menu), {items: menu.items}); - }); - } else { - return {}; - } + var menu = editor.getParam('menu'); + if (menu) { + return map$2(menu, function (menu) { + return __assign(__assign({}, menu), { items: menu.items }); + }); + } else { + return {}; + } }; var getMenubar = function (editor) { - return editor.getParam('menubar'); + return editor.getParam('menubar'); }; var getToolbar = function (editor) { - return editor.getParam('toolbar', true); + return editor.getParam('toolbar', true); }; var getFilePickerCallback = function (editor) { - return editor.getParam('file_picker_callback'); + return editor.getParam('file_picker_callback'); }; var getFilePickerTypes = function (editor) { - return editor.getParam('file_picker_types'); + return editor.getParam('file_picker_types'); }; var getFileBrowserCallbackTypes = function (editor) { - return editor.getParam('file_browser_callback_types'); + return editor.getParam('file_browser_callback_types'); }; var noTypeaheadUrls = function (editor) { - return editor.getParam('typeahead_urls') === false; + return editor.getParam('typeahead_urls') === false; }; var getAnchorTop = function (editor) { - return editor.getParam('anchor_top', '#top'); + return editor.getParam('anchor_top', '#top'); }; var getAnchorBottom = function (editor) { - return editor.getParam('anchor_bottom', '#bottom'); + return editor.getParam('anchor_bottom', '#bottom'); }; var getFilePickerValidatorHandler = function (editor) { - var handler = editor.getParam('file_picker_validator_handler', undefined, 'function'); - if (handler === undefined) { - return editor.getParam('filepicker_validator_handler', undefined, 'function'); - } else { - return handler; - } + var handler = editor.getParam('file_picker_validator_handler', undefined, 'function'); + if (handler === undefined) { + return editor.getParam('filepicker_validator_handler', undefined, 'function'); + } else { + return handler; + } }; var ReadOnlyChannel = 'silver.readonly'; var ReadOnlyDataSchema = objOf([strictBoolean('readonly')]); var broadcastReadonly = function (uiComponents, readonly) { - var outerContainer = uiComponents.outerContainer; - var target = outerContainer.element; - if (readonly) { - uiComponents.mothership.broadcastOn([dismissPopups()], {target: target}); - uiComponents.uiMothership.broadcastOn([dismissPopups()], {target: target}); - } - uiComponents.mothership.broadcastOn([ReadOnlyChannel], {readonly: readonly}); - uiComponents.uiMothership.broadcastOn([ReadOnlyChannel], {readonly: readonly}); + var outerContainer = uiComponents.outerContainer; + var target = outerContainer.element; + if (readonly) { + uiComponents.mothership.broadcastOn([dismissPopups()], { target: target }); + uiComponents.uiMothership.broadcastOn([dismissPopups()], { target: target }); + } + uiComponents.mothership.broadcastOn([ReadOnlyChannel], { readonly: readonly }); + uiComponents.uiMothership.broadcastOn([ReadOnlyChannel], { readonly: readonly }); }; var setupReadonlyModeSwitch = function (editor, uiComponents) { - editor.on('init', function () { - if (editor.mode.isReadOnly()) { - broadcastReadonly(uiComponents, true); - } - }); - editor.on('SwitchMode', function () { - return broadcastReadonly(uiComponents, editor.mode.isReadOnly()); - }); - if (isReadOnly(editor)) { - editor.setMode('readonly'); - } + editor.on('init', function () { + if (editor.mode.isReadOnly()) { + broadcastReadonly(uiComponents, true); + } + }); + editor.on('SwitchMode', function () { + return broadcastReadonly(uiComponents, editor.mode.isReadOnly()); + }); + if (isReadOnly(editor)) { + editor.setMode('readonly'); + } }; var receivingConfig = function () { - var _a; - return Receiving.config({ - channels: (_a = {}, _a[ReadOnlyChannel] = { - schema: ReadOnlyDataSchema, - onReceive: function (comp, data) { - Disabling.set(comp, data.readonly); - } - }, _a) - }); + var _a; + return Receiving.config({ + channels: (_a = {}, _a[ReadOnlyChannel] = { + schema: ReadOnlyDataSchema, + onReceive: function (comp, data) { + Disabling.set(comp, data.readonly); + } + }, _a) + }); }; var item = function (disabled) { - return Disabling.config({ - disabled: disabled, - disableClass: 'tox-collection__item--state-disabled' - }); + return Disabling.config({ + disabled: disabled, + disableClass: 'tox-collection__item--state-disabled' + }); }; var button = function (disabled) { - return Disabling.config({disabled: disabled}); + return Disabling.config({ disabled: disabled }); }; var splitButton = function (disabled) { - return Disabling.config({ - disabled: disabled, - disableClass: 'tox-tbtn--disabled' - }); + return Disabling.config({ + disabled: disabled, + disableClass: 'tox-tbtn--disabled' + }); }; var toolbarButton = function (disabled) { - return Disabling.config({ - disabled: disabled, - disableClass: 'tox-tbtn--disabled', - useNative: false - }); + return Disabling.config({ + disabled: disabled, + disableClass: 'tox-tbtn--disabled', + useNative: false + }); }; var DisablingConfigs = { - item: item, - button: button, - splitButton: splitButton, - toolbarButton: toolbarButton + item: item, + button: button, + splitButton: splitButton, + toolbarButton: toolbarButton }; var runWithApi = function (info, comp) { - var api = info.getApi(comp); - return function (f) { - f(api); - }; + var api = info.getApi(comp); + return function (f) { + f(api); + }; }; var onControlAttached = function (info, editorOffCell) { - return runOnAttached(function (comp) { - var run = runWithApi(info, comp); - run(function (api) { - var onDestroy = info.onSetup(api); - if (onDestroy !== null && onDestroy !== undefined) { - editorOffCell.set(onDestroy); - } - }); + return runOnAttached(function (comp) { + var run = runWithApi(info, comp); + run(function (api) { + var onDestroy = info.onSetup(api); + if (onDestroy !== null && onDestroy !== undefined) { + editorOffCell.set(onDestroy); + } }); + }); }; var onControlDetached = function (getApi, editorOffCell) { - return runOnDetached(function (comp) { - return runWithApi(getApi, comp)(editorOffCell.get()); - }); + return runOnDetached(function (comp) { + return runWithApi(getApi, comp)(editorOffCell.get()); + }); }; var _a; var onMenuItemExecute = function (info, itemResponse) { - return runOnExecute(function (comp, simulatedEvent) { - runWithApi(info, comp)(info.onAction); - if (!info.triggersSubmenu && itemResponse === ItemResponse$1.CLOSE_ON_EXECUTE) { - emit(comp, sandboxClose()); - simulatedEvent.stop(); - } - }); + return runOnExecute(function (comp, simulatedEvent) { + runWithApi(info, comp)(info.onAction); + if (!info.triggersSubmenu && itemResponse === ItemResponse$1.CLOSE_ON_EXECUTE) { + emit(comp, sandboxClose()); + simulatedEvent.stop(); + } + }); }; var menuItemEventOrder = (_a = {}, _a[execute()] = [ - 'disabling', - 'alloy.base.behaviour', - 'toggling', - 'item-events' + 'disabling', + 'alloy.base.behaviour', + 'toggling', + 'item-events' ], _a); var componentRenderPipeline = function (xs) { - return bind(xs, function (o) { - return o.toArray(); - }); + return bind(xs, function (o) { + return o.toArray(); + }); }; var renderCommonItem = function (spec, structure, itemResponse, providersbackstage) { - var editorOffCell = Cell(noop); - return { - type: 'item', - dom: structure.dom, - components: componentRenderPipeline(structure.optComponents), - data: spec.data, - eventOrder: menuItemEventOrder, - hasSubmenu: spec.triggersSubmenu, - itemBehaviours: derive$1([ - config('item-events', [ - onMenuItemExecute(spec, itemResponse), - onControlAttached(spec, editorOffCell), - onControlDetached(spec, editorOffCell) - ]), - DisablingConfigs.item(function () { - return spec.disabled || providersbackstage.isDisabled(); - }), - receivingConfig(), - Replacing.config({}) - ].concat(spec.itemBehaviours)) - }; + var editorOffCell = Cell(noop); + return { + type: 'item', + dom: structure.dom, + components: componentRenderPipeline(structure.optComponents), + data: spec.data, + eventOrder: menuItemEventOrder, + hasSubmenu: spec.triggersSubmenu, + itemBehaviours: derive$1([ + config('item-events', [ + onMenuItemExecute(spec, itemResponse), + onControlAttached(spec, editorOffCell), + onControlDetached(spec, editorOffCell) + ]), + DisablingConfigs.item(function () { + return spec.disabled || providersbackstage.isDisabled(); + }), + receivingConfig(), + Replacing.config({}) + ].concat(spec.itemBehaviours)) + }; }; var buildData = function (source) { - return { - value: source.value, - meta: __assign({text: source.text.getOr('')}, source.meta) - }; + return { + value: source.value, + meta: __assign({ text: source.text.getOr('') }, source.meta) + }; }; var global$8 = tinymce.util.Tools.resolve('tinymce.Env'); var convertText = function (source) { - var mac = { - alt: '⌥', - ctrl: '⌃', - shift: '⇧', - meta: '⌘', - access: '⌃⌥' - }; - var other = { - meta: 'Ctrl', - access: 'Shift+Alt' - }; - var replace = global$8.mac ? mac : other; - var shortcut = source.split('+'); - var updated = map(shortcut, function (segment) { - var search = segment.toLowerCase().trim(); - return has(replace, search) ? replace[search] : segment; - }); - return global$8.mac ? updated.join('') : updated.join('+'); + var mac = { + alt: '⌥', + ctrl: '⌃', + shift: '⇧', + meta: '⌘', + access: '⌃⌥' + }; + var other = { + meta: 'Ctrl', + access: 'Shift+Alt' + }; + var replace = global$8.mac ? mac : other; + var shortcut = source.split('+'); + var updated = map(shortcut, function (segment) { + var search = segment.toLowerCase().trim(); + return has(replace, search) ? replace[search] : segment; + }); + return global$8.mac ? updated.join('') : updated.join('+'); }; var renderIcon = function (iconHtml) { - return { - dom: { - tag: 'div', - classes: [iconClass], - innerHtml: iconHtml - } - }; + return { + dom: { + tag: 'div', + classes: [iconClass], + innerHtml: iconHtml + } + }; }; var renderText = function (text$1) { - return { - dom: { - tag: 'div', - classes: [textClass] - }, - components: [text(global$6.translate(text$1))] - }; + return { + dom: { + tag: 'div', + classes: [textClass] + }, + components: [text(global$6.translate(text$1))] + }; }; var renderHtml = function (html, classes) { - return { - dom: { - tag: 'div', - classes: classes, - innerHtml: html - } - }; + return { + dom: { + tag: 'div', + classes: classes, + innerHtml: html + } + }; }; var renderStyledText = function (style, text$1) { - return { + return { + dom: { + tag: 'div', + classes: [textClass] + }, + components: [{ dom: { - tag: 'div', - classes: [textClass] + tag: style.tag, + styles: style.styles }, - components: [{ - dom: { - tag: style.tag, - styles: style.styles - }, - components: [text(global$6.translate(text$1))] - }] - }; + components: [text(global$6.translate(text$1))] + }] + }; }; var renderShortcut = function (shortcut) { - return { - dom: { - tag: 'div', - classes: [accessoryClass], - innerHtml: convertText(shortcut) - } - }; + return { + dom: { + tag: 'div', + classes: [accessoryClass], + innerHtml: convertText(shortcut) + } + }; }; var renderCheckmark = function (icons) { - return { - dom: { - tag: 'div', - classes: [checkmarkClass], - innerHtml: get$e('checkmark', icons) - } - }; + return { + dom: { + tag: 'div', + classes: [checkmarkClass], + innerHtml: get$e('checkmark', icons) + } + }; }; var renderSubmenuCaret = function (icons) { - return { - dom: { - tag: 'div', - classes: [caretClass], - innerHtml: get$e('chevron-right', icons) - } - }; + return { + dom: { + tag: 'div', + classes: [caretClass], + innerHtml: get$e('chevron-right', icons) + } + }; }; var renderDownwardsCaret = function (icons) { - return { - dom: { - tag: 'div', - classes: [caretClass], - innerHtml: get$e('chevron-down', icons) - } - }; + return { + dom: { + tag: 'div', + classes: [caretClass], + innerHtml: get$e('chevron-down', icons) + } + }; }; var renderContainer = function (container, components) { - var directionClass = container.direction === 'vertical' ? containerColumnClass : containerRowClass; - var alignClass = container.align === 'left' ? containerAlignLeftClass : containerAlignRightClass; - var getValignClass = function () { - switch (container.valign) { - case 'top': - return containerValignTopClass; - case 'middle': - return containerValignMiddleClass; - case 'bottom': - return containerValignBottomClass; - } - }; - return { - dom: { - tag: 'div', - classes: [ - containerClass, - directionClass, - alignClass, - getValignClass() - ] - }, - components: components - }; + var directionClass = container.direction === 'vertical' ? containerColumnClass : containerRowClass; + var alignClass = container.align === 'left' ? containerAlignLeftClass : containerAlignRightClass; + var getValignClass = function () { + switch (container.valign) { + case 'top': + return containerValignTopClass; + case 'middle': + return containerValignMiddleClass; + case 'bottom': + return containerValignBottomClass; + } + }; + return { + dom: { + tag: 'div', + classes: [ + containerClass, + directionClass, + alignClass, + getValignClass() + ] + }, + components: components + }; }; var renderImage = function (src, classes, alt) { - return { - dom: { - tag: 'img', - classes: classes, - attributes: { - src: src, - alt: alt.getOr('') - } - } - }; + return { + dom: { + tag: 'img', + classes: classes, + attributes: { + src: src, + alt: alt.getOr('') + } + } + }; }; var renderColorStructure = function (itemText, itemValue, iconSvg, providerBackstage) { - var colorPickerCommand = 'custom'; - var removeColorCommand = 'remove'; - var getDom = function () { - var common = colorClass; - var icon = iconSvg.getOr(''); - var attributes = itemText.map(function (text) { - return {title: providerBackstage.translate(text)}; - }).getOr({}); - var baseDom = { - tag: 'div', - attributes: attributes, - classes: [common] - }; - if (itemValue === colorPickerCommand) { - return __assign(__assign({}, baseDom), { - tag: 'button', - classes: __spreadArrays(baseDom.classes, ['tox-swatches__picker-btn']), - innerHtml: icon - }); - } else if (itemValue === removeColorCommand) { - return __assign(__assign({}, baseDom), { - classes: __spreadArrays(baseDom.classes, ['tox-swatch--remove']), - innerHtml: icon - }); - } else { - return __assign(__assign({}, baseDom), { - attributes: __assign(__assign({}, baseDom.attributes), {'data-mce-color': itemValue}), - styles: {'background-color': itemValue} - }); - } - }; - return { - dom: getDom(), - optComponents: [] + var colorPickerCommand = 'custom'; + var removeColorCommand = 'remove'; + var getDom = function () { + var common = colorClass; + var icon = iconSvg.getOr(''); + var attributes = itemText.map(function (text) { + return { title: providerBackstage.translate(text) }; + }).getOr({}); + var baseDom = { + tag: 'div', + attributes: attributes, + classes: [common] }; + if (itemValue === colorPickerCommand) { + return __assign(__assign({}, baseDom), { + tag: 'button', + classes: __spreadArrays(baseDom.classes, ['tox-swatches__picker-btn']), + innerHtml: icon + }); + } else if (itemValue === removeColorCommand) { + return __assign(__assign({}, baseDom), { + classes: __spreadArrays(baseDom.classes, ['tox-swatch--remove']), + innerHtml: icon + }); + } else { + return __assign(__assign({}, baseDom), { + attributes: __assign(__assign({}, baseDom.attributes), { 'data-mce-color': itemValue }), + styles: { 'background-color': itemValue } + }); + } + }; + return { + dom: getDom(), + optComponents: [] + }; }; var renderItemDomStructure = function (rtlClass, ariaLabel) { - var domTitle = ariaLabel.map(function (label) { - return {attributes: {title: global$6.translate(label)}}; - }).getOr({}); - return __assign({ - tag: 'div', - classes: [ - navClass, - selectableClass - ].concat(rtlClass ? [iconClassRtl] : []) - }, domTitle); + var domTitle = ariaLabel.map(function (label) { + return { attributes: { title: global$6.translate(label) } }; + }).getOr({}); + return __assign({ + tag: 'div', + classes: [ + navClass, + selectableClass + ].concat(rtlClass ? [iconClassRtl] : []) + }, domTitle); }; var renderNormalItemStructure = function (info, icon, renderIcons, textRender, rtlClass) { - var leftIcon = renderIcons ? icon.or(Optional.some('')).map(renderIcon) : Optional.none(); - var checkmark = info.checkMark; - var content = info.htmlContent.fold(function () { - return info.textContent.map(textRender); - }, function (html) { - return Optional.some(renderHtml(html, [textClass])); - }); - var menuItem = { - dom: renderItemDomStructure(rtlClass, info.ariaLabel), - optComponents: [ - leftIcon, - content, - info.shortcutContent.map(renderShortcut), - checkmark, - info.caret - ] - }; - return menuItem; + var leftIcon = renderIcons ? icon.or(Optional.some('')).map(renderIcon) : Optional.none(); + var checkmark = info.checkMark; + var content = info.htmlContent.fold(function () { + return info.textContent.map(textRender); + }, function (html) { + return Optional.some(renderHtml(html, [textClass])); + }); + var menuItem = { + dom: renderItemDomStructure(rtlClass, info.ariaLabel), + optComponents: [ + leftIcon, + content, + info.shortcutContent.map(renderShortcut), + checkmark, + info.caret + ] + }; + return menuItem; }; var rtlIcon = [ - 'list-num-default', - 'list-num-lower-alpha', - 'list-num-lower-greek', - 'list-num-lower-roman', - 'list-num-upper-alpha', - 'list-num-upper-roman' + 'list-num-default', + 'list-num-lower-alpha', + 'list-num-lower-greek', + 'list-num-lower-roman', + 'list-num-upper-alpha', + 'list-num-upper-roman' ]; var rtlTransform = [ - 'list-bull-circle', - 'list-bull-default', - 'list-bull-square' + 'list-bull-circle', + 'list-bull-default', + 'list-bull-square' ]; var renderItemStructure = function (info, providersBackstage, renderIcons, fallbackIcon) { - if (fallbackIcon === void 0) { - fallbackIcon = Optional.none(); - } - var getIconName = function (iconName) { - return iconName.map(function (name) { - return global$6.isRtl() && contains(rtlIcon, name) ? name + '-rtl' : name; - }); - }; - var needRtlClass = global$6.isRtl() && info.iconContent.exists(function (name) { - return contains(rtlTransform, name); - }); - var icon = getIconName(info.iconContent).map(function (iconName) { - return getOr(iconName, providersBackstage.icons, fallbackIcon); - }); - var textRender = Optional.from(info.meta).fold(function () { - return renderText; - }, function (meta) { - return has(meta, 'style') ? curry(renderStyledText, meta.style) : renderText; - }); - if (info.presets === 'color') { - return renderColorStructure(info.ariaLabel, info.value, icon, providersBackstage); - } else { - return renderNormalItemStructure(info, icon, renderIcons, textRender, needRtlClass); - } + if (fallbackIcon === void 0) { + fallbackIcon = Optional.none(); + } + var getIconName = function (iconName) { + return iconName.map(function (name) { + return global$6.isRtl() && contains(rtlIcon, name) ? name + '-rtl' : name; + }); + }; + var needRtlClass = global$6.isRtl() && info.iconContent.exists(function (name) { + return contains(rtlTransform, name); + }); + var icon = getIconName(info.iconContent).map(function (iconName) { + return getOr(iconName, providersBackstage.icons, fallbackIcon); + }); + var textRender = Optional.from(info.meta).fold(function () { + return renderText; + }, function (meta) { + return has(meta, 'style') ? curry(renderStyledText, meta.style) : renderText; + }); + if (info.presets === 'color') { + return renderColorStructure(info.ariaLabel, info.value, icon, providersBackstage); + } else { + return renderNormalItemStructure(info, icon, renderIcons, textRender, needRtlClass); + } }; var tooltipBehaviour = function (meta, sharedBackstage) { - return get$1(meta, 'tooltipWorker').map(function (tooltipWorker) { - return [Tooltipping.config({ - lazySink: sharedBackstage.getSink, - tooltipDom: { - tag: 'div', - classes: ['tox-tooltip-worker-container'] - }, - tooltipComponents: [], - anchor: function (comp) { - return { - anchor: 'submenu', - item: comp, - overrides: {maxHeightFunction: expandable} - }; - }, - mode: 'follow-highlight', - onShow: function (component, _tooltip) { - tooltipWorker(function (elm) { - Tooltipping.setComponents(component, [external({element: SugarElement.fromDom(elm)})]); - }); - } - })]; - }).getOr([]); + return get$1(meta, 'tooltipWorker').map(function (tooltipWorker) { + return [Tooltipping.config({ + lazySink: sharedBackstage.getSink, + tooltipDom: { + tag: 'div', + classes: ['tox-tooltip-worker-container'] + }, + tooltipComponents: [], + anchor: function (comp) { + return { + anchor: 'submenu', + item: comp, + overrides: { maxHeightFunction: expandable } + }; + }, + mode: 'follow-highlight', + onShow: function (component, _tooltip) { + tooltipWorker(function (elm) { + Tooltipping.setComponents(component, [external({ element: SugarElement.fromDom(elm) })]); + }); + } + })]; + }).getOr([]); }; var escapeRegExp = function (text) { - return text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + return text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); }; var encodeText = function (text) { - return global$5.DOM.encode(text); + return global$5.DOM.encode(text); }; var replaceText = function (text, matchText) { - var translated = global$6.translate(text); - var encoded = encodeText(translated); - if (matchText.length > 0) { - var escapedMatchRegex = new RegExp(escapeRegExp(matchText), 'gi'); - return encoded.replace(escapedMatchRegex, function (match) { - return '' + match + ''; - }); - } else { - return encoded; - } + var translated = global$6.translate(text); + var encoded = encodeText(translated); + if (matchText.length > 0) { + var escapedMatchRegex = new RegExp(escapeRegExp(matchText), 'gi'); + return encoded.replace(escapedMatchRegex, function (match) { + return '' + match + ''; + }); + } else { + return encoded; + } }; var renderAutocompleteItem = function (spec, matchText, useText, presets, onItemValueHandler, itemResponse, sharedBackstage, renderIcons) { - if (renderIcons === void 0) { - renderIcons = true; - } - var structure = renderItemStructure({ - presets: presets, - textContent: Optional.none(), - htmlContent: useText ? spec.text.map(function (text) { - return replaceText(text, matchText); - }) : Optional.none(), - ariaLabel: spec.text, - iconContent: spec.icon, - shortcutContent: Optional.none(), - checkMark: Optional.none(), - caret: Optional.none(), - value: spec.value - }, sharedBackstage.providers, renderIcons, spec.icon); - return renderCommonItem({ - data: buildData(spec), - disabled: spec.disabled, - getApi: function () { - return {}; - }, - onAction: function (_api) { - return onItemValueHandler(spec.value, spec.meta); - }, - onSetup: function () { - return function () { - }; - }, - triggersSubmenu: false, - itemBehaviours: tooltipBehaviour(spec.meta, sharedBackstage) - }, structure, itemResponse, sharedBackstage.providers); + if (renderIcons === void 0) { + renderIcons = true; + } + var structure = renderItemStructure({ + presets: presets, + textContent: Optional.none(), + htmlContent: useText ? spec.text.map(function (text) { + return replaceText(text, matchText); + }) : Optional.none(), + ariaLabel: spec.text, + iconContent: spec.icon, + shortcutContent: Optional.none(), + checkMark: Optional.none(), + caret: Optional.none(), + value: spec.value + }, sharedBackstage.providers, renderIcons, spec.icon); + return renderCommonItem({ + data: buildData(spec), + disabled: spec.disabled, + getApi: function () { + return {}; + }, + onAction: function (_api) { + return onItemValueHandler(spec.value, spec.meta); + }, + onSetup: function () { + return function () { + }; + }, + triggersSubmenu: false, + itemBehaviours: tooltipBehaviour(spec.meta, sharedBackstage) + }, structure, itemResponse, sharedBackstage.providers); }; var renderChoiceItem = function (spec, useText, presets, onItemValueHandler, isSelected, itemResponse, providersBackstage, renderIcons) { - if (renderIcons === void 0) { - renderIcons = true; + if (renderIcons === void 0) { + renderIcons = true; + } + var getApi = function (component) { + return { + setActive: function (state) { + Toggling.set(component, state); + }, + isActive: function () { + return Toggling.isOn(component); + }, + isDisabled: function () { + return Disabling.isDisabled(component); + }, + setDisabled: function (state) { + return Disabling.set(component, state); + } + }; + }; + var structure = renderItemStructure({ + presets: presets, + textContent: useText ? spec.text : Optional.none(), + htmlContent: Optional.none(), + ariaLabel: spec.text, + iconContent: spec.icon, + shortcutContent: useText ? spec.shortcut : Optional.none(), + checkMark: useText ? Optional.some(renderCheckmark(providersBackstage.icons)) : Optional.none(), + caret: Optional.none(), + value: spec.value + }, providersBackstage, renderIcons); + return deepMerge(renderCommonItem({ + data: buildData(spec), + disabled: spec.disabled, + getApi: getApi, + onAction: function (_api) { + return onItemValueHandler(spec.value); + }, + onSetup: function (api) { + api.setActive(isSelected); + return function () { + }; + }, + triggersSubmenu: false, + itemBehaviours: [] + }, structure, itemResponse, providersBackstage), { + toggling: { + toggleClass: tickedClass, + toggleOnExecute: false, + selected: spec.active } - var getApi = function (component) { - return { - setActive: function (state) { - Toggling.set(component, state); - }, - isActive: function () { - return Toggling.isOn(component); - }, - isDisabled: function () { - return Disabling.isDisabled(component); - }, - setDisabled: function (state) { - return Disabling.set(component, state); - } - }; - }; - var structure = renderItemStructure({ - presets: presets, - textContent: useText ? spec.text : Optional.none(), - htmlContent: Optional.none(), - ariaLabel: spec.text, - iconContent: spec.icon, - shortcutContent: useText ? spec.shortcut : Optional.none(), - checkMark: useText ? Optional.some(renderCheckmark(providersBackstage.icons)) : Optional.none(), - caret: Optional.none(), - value: spec.value - }, providersBackstage, renderIcons); - return deepMerge(renderCommonItem({ - data: buildData(spec), - disabled: spec.disabled, - getApi: getApi, - onAction: function (_api) { - return onItemValueHandler(spec.value); - }, - onSetup: function (api) { - api.setActive(isSelected); - return function () { - }; - }, - triggersSubmenu: false, - itemBehaviours: [] - }, structure, itemResponse, providersBackstage), { - toggling: { - toggleClass: tickedClass, - toggleOnExecute: false, - selected: spec.active - } - }); + }); }; var parts$2 = generate$4(owner$2(), parts()); var hexColour = function (value) { - return {value: value}; + return { value: value }; }; var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; var longformRegex = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i; var isHexString = function (hex) { - return shorthandRegex.test(hex) || longformRegex.test(hex); + return shorthandRegex.test(hex) || longformRegex.test(hex); }; var getLongForm = function (hex) { - var hexString = hex.value.replace(shorthandRegex, function (m, r, g, b) { - return r + r + g + g + b + b; - }); - return {value: hexString}; + var hexString = hex.value.replace(shorthandRegex, function (m, r, g, b) { + return r + r + g + g + b + b; + }); + return { value: hexString }; }; var extractValues = function (hex) { - var longForm = getLongForm(hex); - var splitForm = longformRegex.exec(longForm.value); - return splitForm === null ? [ - 'FFFFFF', - 'FF', - 'FF', - 'FF' - ] : splitForm; + var longForm = getLongForm(hex); + var splitForm = longformRegex.exec(longForm.value); + return splitForm === null ? [ + 'FFFFFF', + 'FF', + 'FF', + 'FF' + ] : splitForm; }; var toHex = function (component) { - var hex = component.toString(16); - return hex.length === 1 ? '0' + hex : hex; + var hex = component.toString(16); + return hex.length === 1 ? '0' + hex : hex; }; var fromRgba = function (rgbaColour) { - var value = toHex(rgbaColour.red) + toHex(rgbaColour.green) + toHex(rgbaColour.blue); - return hexColour(value); + var value = toHex(rgbaColour.red) + toHex(rgbaColour.green) + toHex(rgbaColour.blue); + return hexColour(value); }; var min = Math.min; @@ -11254,980 +11247,979 @@ var rgbRegex = /^rgb\((\d+),\s*(\d+),\s*(\d+)\)/; var rgbaRegex = /^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/; var rgbaColour = function (red, green, blue, alpha) { - return { - red: red, - green: green, - blue: blue, - alpha: alpha - }; + return { + red: red, + green: green, + blue: blue, + alpha: alpha + }; }; var isRgbaComponent = function (value) { - var num = parseInt(value, 10); - return num.toString() === value && num >= 0 && num <= 255; + var num = parseInt(value, 10); + return num.toString() === value && num >= 0 && num <= 255; }; var fromHsv = function (hsv) { - var r; - var g; - var b; - var hue = (hsv.hue || 0) % 360; - var saturation = hsv.saturation / 100; - var brightness = hsv.value / 100; - saturation = max(0, min(saturation, 1)); - brightness = max(0, min(brightness, 1)); - if (saturation === 0) { - r = g = b = round(255 * brightness); - return rgbaColour(r, g, b, 1); - } - var side = hue / 60; - var chroma = brightness * saturation; - var x = chroma * (1 - Math.abs(side % 2 - 1)); - var match = brightness - chroma; - switch (Math.floor(side)) { - case 0: - r = chroma; - g = x; - b = 0; - break; - case 1: - r = x; - g = chroma; - b = 0; - break; - case 2: - r = 0; - g = chroma; - b = x; - break; - case 3: - r = 0; - g = x; - b = chroma; - break; - case 4: - r = x; - g = 0; - b = chroma; - break; - case 5: - r = chroma; - g = 0; - b = x; - break; - default: - r = g = b = 0; - } - r = round(255 * (r + match)); - g = round(255 * (g + match)); - b = round(255 * (b + match)); + var r; + var g; + var b; + var hue = (hsv.hue || 0) % 360; + var saturation = hsv.saturation / 100; + var brightness = hsv.value / 100; + saturation = max(0, min(saturation, 1)); + brightness = max(0, min(brightness, 1)); + if (saturation === 0) { + r = g = b = round(255 * brightness); return rgbaColour(r, g, b, 1); + } + var side = hue / 60; + var chroma = brightness * saturation; + var x = chroma * (1 - Math.abs(side % 2 - 1)); + var match = brightness - chroma; + switch (Math.floor(side)) { + case 0: + r = chroma; + g = x; + b = 0; + break; + case 1: + r = x; + g = chroma; + b = 0; + break; + case 2: + r = 0; + g = chroma; + b = x; + break; + case 3: + r = 0; + g = x; + b = chroma; + break; + case 4: + r = x; + g = 0; + b = chroma; + break; + case 5: + r = chroma; + g = 0; + b = x; + break; + default: + r = g = b = 0; + } + r = round(255 * (r + match)); + g = round(255 * (g + match)); + b = round(255 * (b + match)); + return rgbaColour(r, g, b, 1); }; var fromHex = function (hexColour) { - var result = extractValues(hexColour); - var red = parseInt(result[1], 16); - var green = parseInt(result[2], 16); - var blue = parseInt(result[3], 16); - return rgbaColour(red, green, blue, 1); + var result = extractValues(hexColour); + var red = parseInt(result[1], 16); + var green = parseInt(result[2], 16); + var blue = parseInt(result[3], 16); + return rgbaColour(red, green, blue, 1); }; var fromStringValues = function (red, green, blue, alpha) { - var r = parseInt(red, 10); - var g = parseInt(green, 10); - var b = parseInt(blue, 10); - var a = parseFloat(alpha); - return rgbaColour(r, g, b, a); + var r = parseInt(red, 10); + var g = parseInt(green, 10); + var b = parseInt(blue, 10); + var a = parseFloat(alpha); + return rgbaColour(r, g, b, a); }; var fromString = function (rgbaString) { - if (rgbaString === 'transparent') { - return Optional.some(rgbaColour(0, 0, 0, 0)); - } - var rgbMatch = rgbRegex.exec(rgbaString); - if (rgbMatch !== null) { - return Optional.some(fromStringValues(rgbMatch[1], rgbMatch[2], rgbMatch[3], '1')); - } - var rgbaMatch = rgbaRegex.exec(rgbaString); - if (rgbaMatch !== null) { - return Optional.some(fromStringValues(rgbaMatch[1], rgbaMatch[2], rgbaMatch[3], rgbaMatch[4])); - } - return Optional.none(); + if (rgbaString === 'transparent') { + return Optional.some(rgbaColour(0, 0, 0, 0)); + } + var rgbMatch = rgbRegex.exec(rgbaString); + if (rgbMatch !== null) { + return Optional.some(fromStringValues(rgbMatch[1], rgbMatch[2], rgbMatch[3], '1')); + } + var rgbaMatch = rgbaRegex.exec(rgbaString); + if (rgbaMatch !== null) { + return Optional.some(fromStringValues(rgbaMatch[1], rgbaMatch[2], rgbaMatch[3], rgbaMatch[4])); + } + return Optional.none(); }; var toString = function (rgba) { - return 'rgba(' + rgba.red + ',' + rgba.green + ',' + rgba.blue + ',' + rgba.alpha + ')'; + return 'rgba(' + rgba.red + ',' + rgba.green + ',' + rgba.blue + ',' + rgba.alpha + ')'; }; var red = rgbaColour(255, 0, 0, 1); var fireSkinLoaded = function (editor) { - return editor.fire('SkinLoaded'); + return editor.fire('SkinLoaded'); }; var fireSkinLoadError = function (editor, error) { - return editor.fire('SkinLoadError', error); + return editor.fire('SkinLoadError', error); }; var fireResizeEditor = function (editor) { - return editor.fire('ResizeEditor'); + return editor.fire('ResizeEditor'); }; var fireResizeContent = function (editor, e) { - return editor.fire('ResizeContent', e); + return editor.fire('ResizeContent', e); }; var fireScrollContent = function (editor, e) { - return editor.fire('ScrollContent', e); + return editor.fire('ScrollContent', e); }; var fireTextColorChange = function (editor, data) { - return editor.fire('TextColorChange', data); + return editor.fire('TextColorChange', data); }; var global$9 = tinymce.util.Tools.resolve('tinymce.util.LocalStorage'); var storageName = 'tinymce-custom-colors'; - - function ColorCache(max) { - if (max === void 0) { - max = 10; - } - var storageString = global$9.getItem(storageName); - var localstorage = isString(storageString) ? JSON.parse(storageString) : []; - var prune = function (list) { - var diff = max - list.length; - return diff < 0 ? list.slice(0, max) : list; - }; - var cache = prune(localstorage); - var add = function (key) { - indexOf(cache, key).each(remove); - cache.unshift(key); - if (cache.length > max) { - cache.pop(); - } - global$9.setItem(storageName, JSON.stringify(cache)); - }; - var remove = function (idx) { - cache.splice(idx, 1); - }; - var state = function () { - return cache.slice(0); - }; - return { - add: add, - state: state - }; + function ColorCache (max) { + if (max === void 0) { + max = 10; + } + var storageString = global$9.getItem(storageName); + var localstorage = isString(storageString) ? JSON.parse(storageString) : []; + var prune = function (list) { + var diff = max - list.length; + return diff < 0 ? list.slice(0, max) : list; + }; + var cache = prune(localstorage); + var add = function (key) { + indexOf(cache, key).each(remove); + cache.unshift(key); + if (cache.length > max) { + cache.pop(); + } + global$9.setItem(storageName, JSON.stringify(cache)); + }; + var remove = function (idx) { + cache.splice(idx, 1); + }; + var state = function () { + return cache.slice(0); + }; + return { + add: add, + state: state + }; } var choiceItem = 'choiceitem'; var defaultColors = [ - { - type: choiceItem, - text: 'Light Green', - value: '#BFEDD2' - }, - { - type: choiceItem, - text: 'Light Yellow', - value: '#FBEEB8' - }, - { - type: choiceItem, - text: 'Light Red', - value: '#F8CAC6' - }, - { - type: choiceItem, - text: 'Light Purple', - value: '#ECCAFA' - }, - { - type: choiceItem, - text: 'Light Blue', - value: '#C2E0F4' - }, - { - type: choiceItem, - text: 'Green', - value: '#2DC26B' - }, - { - type: choiceItem, - text: 'Yellow', - value: '#F1C40F' - }, - { - type: choiceItem, - text: 'Red', - value: '#E03E2D' - }, - { - type: choiceItem, - text: 'Purple', - value: '#B96AD9' - }, - { - type: choiceItem, - text: 'Blue', - value: '#3598DB' - }, - { - type: choiceItem, - text: 'Dark Turquoise', - value: '#169179' - }, - { - type: choiceItem, - text: 'Orange', - value: '#E67E23' - }, - { - type: choiceItem, - text: 'Dark Red', - value: '#BA372A' - }, - { - type: choiceItem, - text: 'Dark Purple', - value: '#843FA1' - }, - { - type: choiceItem, - text: 'Dark Blue', - value: '#236FA1' - }, - { - type: choiceItem, - text: 'Light Gray', - value: '#ECF0F1' - }, - { - type: choiceItem, - text: 'Medium Gray', - value: '#CED4D9' - }, - { - type: choiceItem, - text: 'Gray', - value: '#95A5A6' - }, - { - type: choiceItem, - text: 'Dark Gray', - value: '#7E8C8D' - }, - { - type: choiceItem, - text: 'Navy Blue', - value: '#34495E' - }, - { - type: choiceItem, - text: 'Black', - value: '#000000' - }, - { - type: choiceItem, - text: 'White', - value: '#ffffff' - } + { + type: choiceItem, + text: 'Light Green', + value: '#BFEDD2' + }, + { + type: choiceItem, + text: 'Light Yellow', + value: '#FBEEB8' + }, + { + type: choiceItem, + text: 'Light Red', + value: '#F8CAC6' + }, + { + type: choiceItem, + text: 'Light Purple', + value: '#ECCAFA' + }, + { + type: choiceItem, + text: 'Light Blue', + value: '#C2E0F4' + }, + { + type: choiceItem, + text: 'Green', + value: '#2DC26B' + }, + { + type: choiceItem, + text: 'Yellow', + value: '#F1C40F' + }, + { + type: choiceItem, + text: 'Red', + value: '#E03E2D' + }, + { + type: choiceItem, + text: 'Purple', + value: '#B96AD9' + }, + { + type: choiceItem, + text: 'Blue', + value: '#3598DB' + }, + { + type: choiceItem, + text: 'Dark Turquoise', + value: '#169179' + }, + { + type: choiceItem, + text: 'Orange', + value: '#E67E23' + }, + { + type: choiceItem, + text: 'Dark Red', + value: '#BA372A' + }, + { + type: choiceItem, + text: 'Dark Purple', + value: '#843FA1' + }, + { + type: choiceItem, + text: 'Dark Blue', + value: '#236FA1' + }, + { + type: choiceItem, + text: 'Light Gray', + value: '#ECF0F1' + }, + { + type: choiceItem, + text: 'Medium Gray', + value: '#CED4D9' + }, + { + type: choiceItem, + text: 'Gray', + value: '#95A5A6' + }, + { + type: choiceItem, + text: 'Dark Gray', + value: '#7E8C8D' + }, + { + type: choiceItem, + text: 'Navy Blue', + value: '#34495E' + }, + { + type: choiceItem, + text: 'Black', + value: '#000000' + }, + { + type: choiceItem, + text: 'White', + value: '#ffffff' + } ]; var colorCache = ColorCache(10); var mapColors = function (colorMap) { - var colors = []; - var canvas = document.createElement('canvas'); - canvas.height = 1; - canvas.width = 1; - var ctx = canvas.getContext('2d'); - var byteAsHex = function (colorByte, alphaByte) { - var bg = 255; - var alpha = alphaByte / 255; - var colorByteWithWhiteBg = Math.round(colorByte * alpha + bg * (1 - alpha)); - return ('0' + colorByteWithWhiteBg.toString(16)).slice(-2).toUpperCase(); - }; - var asHexColor = function (color) { - if (/^[0-9A-Fa-f]{6}$/.test(color)) { - return '#' + color.toUpperCase(); - } - ctx.clearRect(0, 0, canvas.width, canvas.height); - ctx.fillStyle = '#FFFFFF'; - ctx.fillStyle = color; - ctx.fillRect(0, 0, 1, 1); - var rgba = ctx.getImageData(0, 0, 1, 1).data; - var r = rgba[0], g = rgba[1], b = rgba[2], a = rgba[3]; - return '#' + byteAsHex(r, a) + byteAsHex(g, a) + byteAsHex(b, a); - }; - for (var i = 0; i < colorMap.length; i += 2) { - colors.push({ - text: colorMap[i + 1], - value: asHexColor(colorMap[i]), - type: 'choiceitem' - }); - } - return colors; + var colors = []; + var canvas = document.createElement('canvas'); + canvas.height = 1; + canvas.width = 1; + var ctx = canvas.getContext('2d'); + var byteAsHex = function (colorByte, alphaByte) { + var bg = 255; + var alpha = alphaByte / 255; + var colorByteWithWhiteBg = Math.round(colorByte * alpha + bg * (1 - alpha)); + return ('0' + colorByteWithWhiteBg.toString(16)).slice(-2).toUpperCase(); + }; + var asHexColor = function (color) { + if (/^[0-9A-Fa-f]{6}$/.test(color)) { + return '#' + color.toUpperCase(); + } + ctx.clearRect(0, 0, canvas.width, canvas.height); + ctx.fillStyle = '#FFFFFF'; + ctx.fillStyle = color; + ctx.fillRect(0, 0, 1, 1); + var rgba = ctx.getImageData(0, 0, 1, 1).data; + var r = rgba[0], g = rgba[1], b = rgba[2], a = rgba[3]; + return '#' + byteAsHex(r, a) + byteAsHex(g, a) + byteAsHex(b, a); + }; + for (var i = 0; i < colorMap.length; i += 2) { + colors.push({ + text: colorMap[i + 1], + value: asHexColor(colorMap[i]), + type: 'choiceitem' + }); + } + return colors; }; var getColorCols = function (editor, defaultCols) { - return editor.getParam('color_cols', defaultCols, 'number'); + return editor.getParam('color_cols', defaultCols, 'number'); }; var hasCustomColors = function (editor) { - return editor.getParam('custom_colors') !== false; + return editor.getParam('custom_colors') !== false; }; var getColorMap = function (editor) { - return editor.getParam('color_map'); + return editor.getParam('color_map'); }; var getColors = function (editor) { - var unmapped = getColorMap(editor); - return unmapped !== undefined ? mapColors(unmapped) : defaultColors; + var unmapped = getColorMap(editor); + return unmapped !== undefined ? mapColors(unmapped) : defaultColors; }; var getCurrentColors = function () { - return map(colorCache.state(), function (color) { - return { - type: choiceItem, - text: color, - value: color - }; - }); + return map(colorCache.state(), function (color) { + return { + type: choiceItem, + text: color, + value: color + }; + }); }; var addColor = function (color) { - colorCache.add(color); + colorCache.add(color); }; var getCurrentColor = function (editor, format) { - var color; - editor.dom.getParents(editor.selection.getStart(), function (elm) { - var value; - if (value = elm.style[format === 'forecolor' ? 'color' : 'background-color']) { - color = color ? color : value; - } - }); - return color; + var color; + editor.dom.getParents(editor.selection.getStart(), function (elm) { + var value; + if (value = elm.style[format === 'forecolor' ? 'color' : 'background-color']) { + color = color ? color : value; + } + }); + return color; }; var applyFormat = function (editor, format, value) { - editor.undoManager.transact(function () { - editor.focus(); - editor.formatter.apply(format, {value: value}); - editor.nodeChanged(); - }); + editor.undoManager.transact(function () { + editor.focus(); + editor.formatter.apply(format, { value: value }); + editor.nodeChanged(); + }); }; var removeFormat = function (editor, format) { - editor.undoManager.transact(function () { - editor.focus(); - editor.formatter.remove(format, {value: null}, null, true); - editor.nodeChanged(); - }); + editor.undoManager.transact(function () { + editor.focus(); + editor.formatter.remove(format, { value: null }, null, true); + editor.nodeChanged(); + }); }; var registerCommands = function (editor) { - editor.addCommand('mceApplyTextcolor', function (format, value) { - applyFormat(editor, format, value); - }); - editor.addCommand('mceRemoveTextcolor', function (format) { - removeFormat(editor, format); - }); + editor.addCommand('mceApplyTextcolor', function (format, value) { + applyFormat(editor, format, value); + }); + editor.addCommand('mceRemoveTextcolor', function (format) { + removeFormat(editor, format); + }); }; var calcCols = function (colors) { - return Math.max(5, Math.ceil(Math.sqrt(colors))); + return Math.max(5, Math.ceil(Math.sqrt(colors))); }; var getColorCols$1 = function (editor) { - var colors = getColors(editor); - var defaultCols = calcCols(colors.length); - return getColorCols(editor, defaultCols); + var colors = getColors(editor); + var defaultCols = calcCols(colors.length); + return getColorCols(editor, defaultCols); }; var getAdditionalColors = function (hasCustom) { - var type = 'choiceitem'; - var remove = { - type: type, - text: 'Remove color', - icon: 'color-swatch-remove-color', - value: 'remove' - }; - var custom = { - type: type, - text: 'Custom color', - icon: 'color-picker', - value: 'custom' - }; - return hasCustom ? [ - remove, - custom - ] : [remove]; + var type = 'choiceitem'; + var remove = { + type: type, + text: 'Remove color', + icon: 'color-swatch-remove-color', + value: 'remove' + }; + var custom = { + type: type, + text: 'Custom color', + icon: 'color-picker', + value: 'custom' + }; + return hasCustom ? [ + remove, + custom + ] : [remove]; }; var applyColor = function (editor, format, value, onChoice) { - if (value === 'custom') { - var dialog = colorPickerDialog(editor); - dialog(function (colorOpt) { - colorOpt.each(function (color) { - addColor(color); - editor.execCommand('mceApplyTextcolor', format, color); - onChoice(color); - }); - }, '#000000'); - } else if (value === 'remove') { - onChoice(''); - editor.execCommand('mceRemoveTextcolor', format); - } else { - onChoice(value); - editor.execCommand('mceApplyTextcolor', format, value); - } + if (value === 'custom') { + var dialog = colorPickerDialog(editor); + dialog(function (colorOpt) { + colorOpt.each(function (color) { + addColor(color); + editor.execCommand('mceApplyTextcolor', format, color); + onChoice(color); + }); + }, '#000000'); + } else if (value === 'remove') { + onChoice(''); + editor.execCommand('mceRemoveTextcolor', format); + } else { + onChoice(value); + editor.execCommand('mceApplyTextcolor', format, value); + } }; var getColors$1 = function (colors, hasCustom) { - return colors.concat(getCurrentColors().concat(getAdditionalColors(hasCustom))); + return colors.concat(getCurrentColors().concat(getAdditionalColors(hasCustom))); }; var getFetch = function (colors, hasCustom) { - return function (callback) { - callback(getColors$1(colors, hasCustom)); - }; + return function (callback) { + callback(getColors$1(colors, hasCustom)); + }; }; var setIconColor = function (splitButtonApi, name, newColor) { - var setIconFillAndStroke = function (pathId, color) { - splitButtonApi.setIconFill(pathId, color); - splitButtonApi.setIconStroke(pathId, color); - }; - var id = name === 'forecolor' ? 'tox-icon-text-color__color' : 'tox-icon-highlight-bg-color__color'; - setIconFillAndStroke(id, newColor); + var setIconFillAndStroke = function (pathId, color) { + splitButtonApi.setIconFill(pathId, color); + splitButtonApi.setIconStroke(pathId, color); + }; + var id = name === 'forecolor' ? 'tox-icon-text-color__color' : 'tox-icon-highlight-bg-color__color'; + setIconFillAndStroke(id, newColor); }; var registerTextColorButton = function (editor, name, format, tooltip, lastColor) { - editor.ui.registry.addSplitButton(name, { - tooltip: tooltip, - presets: 'color', - icon: name === 'forecolor' ? 'text-color' : 'highlight-bg-color', - select: function (value) { - var optCurrentRgb = Optional.from(getCurrentColor(editor, format)); - return optCurrentRgb.bind(function (currentRgb) { - return fromString(currentRgb).map(function (rgba) { - var currentHex = fromRgba(rgba).value; - return contains$1(value.toLowerCase(), currentHex); - }); - }).getOr(false); - }, - columns: getColorCols$1(editor), - fetch: getFetch(getColors(editor), hasCustomColors(editor)), - onAction: function (_splitButtonApi) { - if (lastColor.get() !== null) { - applyColor(editor, format, lastColor.get(), function () { - }); - } - }, - onItemAction: function (_splitButtonApi, value) { - applyColor(editor, format, value, function (newColor) { - lastColor.set(newColor); - fireTextColorChange(editor, { - name: name, - color: newColor - }); - }); - }, - onSetup: function (splitButtonApi) { - if (lastColor.get() !== null) { - setIconColor(splitButtonApi, name, lastColor.get()); - } - var handler = function (e) { - if (e.name === name) { - setIconColor(splitButtonApi, e.name, e.color); - } - }; - editor.on('TextColorChange', handler); - return function () { - editor.off('TextColorChange', handler); - }; - } - }); + editor.ui.registry.addSplitButton(name, { + tooltip: tooltip, + presets: 'color', + icon: name === 'forecolor' ? 'text-color' : 'highlight-bg-color', + select: function (value) { + var optCurrentRgb = Optional.from(getCurrentColor(editor, format)); + return optCurrentRgb.bind(function (currentRgb) { + return fromString(currentRgb).map(function (rgba) { + var currentHex = fromRgba(rgba).value; + return contains$1(value.toLowerCase(), currentHex); + }); + }).getOr(false); + }, + columns: getColorCols$1(editor), + fetch: getFetch(getColors(editor), hasCustomColors(editor)), + onAction: function (_splitButtonApi) { + if (lastColor.get() !== null) { + applyColor(editor, format, lastColor.get(), function () { + }); + } + }, + onItemAction: function (_splitButtonApi, value) { + applyColor(editor, format, value, function (newColor) { + lastColor.set(newColor); + fireTextColorChange(editor, { + name: name, + color: newColor + }); + }); + }, + onSetup: function (splitButtonApi) { + if (lastColor.get() !== null) { + setIconColor(splitButtonApi, name, lastColor.get()); + } + var handler = function (e) { + if (e.name === name) { + setIconColor(splitButtonApi, e.name, e.color); + } + }; + editor.on('TextColorChange', handler); + return function () { + editor.off('TextColorChange', handler); + }; + } + }); }; var registerTextColorMenuItem = function (editor, name, format, text) { - editor.ui.registry.addNestedMenuItem(name, { - text: text, - icon: name === 'forecolor' ? 'text-color' : 'highlight-bg-color', - getSubmenuItems: function () { - return [{ - type: 'fancymenuitem', - fancytype: 'colorswatch', - onAction: function (data) { - applyColor(editor, format, data.value, noop); - } - }]; - } - }); + editor.ui.registry.addNestedMenuItem(name, { + text: text, + icon: name === 'forecolor' ? 'text-color' : 'highlight-bg-color', + getSubmenuItems: function () { + return [{ + type: 'fancymenuitem', + fancytype: 'colorswatch', + onAction: function (data) { + applyColor(editor, format, data.value, noop); + } + }]; + } + }); }; var colorPickerDialog = function (editor) { - return function (callback, value) { - var getOnSubmit = function (callback) { - return function (api) { - var data = api.getData(); - callback(Optional.from(data.colorpicker)); - api.close(); - }; - }; - var onAction = function (api, details) { - if (details.name === 'hex-valid') { - if (details.value) { - api.enable('ok'); - } else { - api.disable('ok'); - } - } - }; - var initialData = {colorpicker: value}; - var submit = getOnSubmit(callback); - editor.windowManager.open({ - title: 'Color Picker', - size: 'normal', - body: { - type: 'panel', - items: [{ - type: 'colorpicker', - name: 'colorpicker', - label: 'Color' - }] - }, - buttons: [ - { - type: 'cancel', - name: 'cancel', - text: 'Cancel' - }, - { - type: 'submit', - name: 'save', - text: 'Save', - primary: true - } - ], - initialData: initialData, - onAction: onAction, - onSubmit: submit, - onClose: function () { - }, - onCancel: function () { - callback(Optional.none()); - } - }); - }; + return function (callback, value) { + var getOnSubmit = function (callback) { + return function (api) { + var data = api.getData(); + callback(Optional.from(data.colorpicker)); + api.close(); + }; + }; + var onAction = function (api, details) { + if (details.name === 'hex-valid') { + if (details.value) { + api.enable('ok'); + } else { + api.disable('ok'); + } + } + }; + var initialData = { colorpicker: value }; + var submit = getOnSubmit(callback); + editor.windowManager.open({ + title: 'Color Picker', + size: 'normal', + body: { + type: 'panel', + items: [{ + type: 'colorpicker', + name: 'colorpicker', + label: 'Color' + }] + }, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: initialData, + onAction: onAction, + onSubmit: submit, + onClose: function () { + }, + onCancel: function () { + callback(Optional.none()); + } + }); + }; }; var register$1 = function (editor) { - registerCommands(editor); - var lastForeColor = Cell(null); - var lastBackColor = Cell(null); - registerTextColorButton(editor, 'forecolor', 'forecolor', 'Text color', lastForeColor); - registerTextColorButton(editor, 'backcolor', 'hilitecolor', 'Background color', lastBackColor); - registerTextColorMenuItem(editor, 'forecolor', 'forecolor', 'Text color'); - registerTextColorMenuItem(editor, 'backcolor', 'hilitecolor', 'Background color'); + registerCommands(editor); + var lastForeColor = Cell(null); + var lastBackColor = Cell(null); + registerTextColorButton(editor, 'forecolor', 'forecolor', 'Text color', lastForeColor); + registerTextColorButton(editor, 'backcolor', 'hilitecolor', 'Background color', lastBackColor); + registerTextColorMenuItem(editor, 'forecolor', 'forecolor', 'Text color'); + registerTextColorMenuItem(editor, 'backcolor', 'hilitecolor', 'Background color'); }; var createPartialChoiceMenu = function (value, items, onItemValueHandler, columns, presets, itemResponse, select, providersBackstage) { - var hasIcons = menuHasIcons(items); - var presetItemTypes = presets !== 'color' ? 'normal' : 'color'; - var alloyItems = createChoiceItems(items, onItemValueHandler, columns, presetItemTypes, itemResponse, select, providersBackstage); - return createPartialMenuWithAlloyItems(value, hasIcons, alloyItems, columns, presets); + var hasIcons = menuHasIcons(items); + var presetItemTypes = presets !== 'color' ? 'normal' : 'color'; + var alloyItems = createChoiceItems(items, onItemValueHandler, columns, presetItemTypes, itemResponse, select, providersBackstage); + return createPartialMenuWithAlloyItems(value, hasIcons, alloyItems, columns, presets); }; var createChoiceItems = function (items, onItemValueHandler, columns, itemPresets, itemResponse, select, providersBackstage) { - return cat(map(items, function (item) { - if (item.type === 'choiceitem') { - return createChoiceMenuItem(item).fold(handleError, function (d) { - return Optional.some(renderChoiceItem(d, columns === 1, itemPresets, onItemValueHandler, select(item.value), itemResponse, providersBackstage, menuHasIcons(items))); - }); - } else { - return Optional.none(); - } - })); + return cat(map(items, function (item) { + if (item.type === 'choiceitem') { + return createChoiceMenuItem(item).fold(handleError, function (d) { + return Optional.some(renderChoiceItem(d, columns === 1, itemPresets, onItemValueHandler, select(item.value), itemResponse, providersBackstage, menuHasIcons(items))); + }); + } else { + return Optional.none(); + } + })); }; var deriveMenuMovement = function (columns, presets) { - var menuMarkers = markers$1(presets); - if (columns === 1) { - return { - mode: 'menu', - moveOnTab: true - }; - } else if (columns === 'auto') { - return { - mode: 'grid', - selector: '.' + menuMarkers.item, - initSize: { - numColumns: 1, - numRows: 1 - } - }; - } else { - var rowClass = presets === 'color' ? 'tox-swatches__row' : 'tox-collection__group'; - return { - mode: 'matrix', - rowSelector: '.' + rowClass - }; - } + var menuMarkers = markers$1(presets); + if (columns === 1) { + return { + mode: 'menu', + moveOnTab: true + }; + } else if (columns === 'auto') { + return { + mode: 'grid', + selector: '.' + menuMarkers.item, + initSize: { + numColumns: 1, + numRows: 1 + } + }; + } else { + var rowClass = presets === 'color' ? 'tox-swatches__row' : 'tox-collection__group'; + return { + mode: 'matrix', + rowSelector: '.' + rowClass + }; + } }; var deriveCollectionMovement = function (columns, presets) { - if (columns === 1) { - return { - mode: 'menu', - moveOnTab: false, - selector: '.tox-collection__item' - }; - } else if (columns === 'auto') { - return { - mode: 'flatgrid', - selector: '.' + 'tox-collection__item', - initSize: { - numColumns: 1, - numRows: 1 - } - }; - } else { - return { - mode: 'matrix', - selectors: { - row: presets === 'color' ? '.tox-swatches__row' : '.tox-collection__group', - cell: presets === 'color' ? '.' + colorClass : '.' + selectableClass - } - }; - } + if (columns === 1) { + return { + mode: 'menu', + moveOnTab: false, + selector: '.tox-collection__item' + }; + } else if (columns === 'auto') { + return { + mode: 'flatgrid', + selector: '.' + 'tox-collection__item', + initSize: { + numColumns: 1, + numRows: 1 + } + }; + } else { + return { + mode: 'matrix', + selectors: { + row: presets === 'color' ? '.tox-swatches__row' : '.tox-collection__group', + cell: presets === 'color' ? '.' + colorClass : '.' + selectableClass + } + }; + } }; function renderColorSwatchItem(spec, backstage) { - var items = getColors$1(backstage.colorinput.getColors(), backstage.colorinput.hasCustomColors()); - var columns = backstage.colorinput.getColorCols(); - var presets = 'color'; - var menuSpec = createPartialChoiceMenu(generate$1('menu-value'), items, function (value) { - spec.onAction({value: value}); - }, columns, presets, ItemResponse$1.CLOSE_ON_EXECUTE, function () { - return false; - }, backstage.shared.providers); - var widgetSpec = __assign(__assign({}, menuSpec), { - markers: markers$1(presets), - movement: deriveMenuMovement(columns, presets) - }); - return { - type: 'widget', - data: {value: generate$1('widget-id')}, - dom: { - tag: 'div', - classes: ['tox-fancymenuitem'] - }, - autofocus: true, - components: [parts$2.widget(Menu.sketch(widgetSpec))] - }; + var items = getColors$1(backstage.colorinput.getColors(), backstage.colorinput.hasCustomColors()); + var columns = backstage.colorinput.getColorCols(); + var presets = 'color'; + var menuSpec = createPartialChoiceMenu(generate$1('menu-value'), items, function (value) { + spec.onAction({ value: value }); + }, columns, presets, ItemResponse$1.CLOSE_ON_EXECUTE, function () { + return false; + }, backstage.shared.providers); + var widgetSpec = __assign(__assign({}, menuSpec), { + markers: markers$1(presets), + movement: deriveMenuMovement(columns, presets) + }); + return { + type: 'widget', + data: { value: generate$1('widget-id') }, + dom: { + tag: 'div', + classes: ['tox-fancymenuitem'] + }, + autofocus: true, + components: [parts$2.widget(Menu.sketch(widgetSpec))] + }; } var cellOverEvent = generate$1('cell-over'); var cellExecuteEvent = generate$1('cell-execute'); var makeCell = function (row, col, labelId) { - var _a; - var emitCellOver = function (c) { - return emitWith(c, cellOverEvent, { - row: row, - col: col - }); - }; - var emitExecute = function (c) { - return emitWith(c, cellExecuteEvent, { - row: row, - col: col - }); - }; - var onClick = function (c, se) { - se.stop(); - emitExecute(c); - }; - return build$1({ - dom: { - tag: 'div', - attributes: (_a = {role: 'button'}, _a['aria-labelledby'] = labelId, _a) - }, - behaviours: derive$1([ - config('insert-table-picker-cell', [ - run(mouseover(), Focusing.focus), - run(execute(), emitExecute), - run(click(), onClick), - run(tap(), onClick) - ]), - Toggling.config({ - toggleClass: 'tox-insert-table-picker__selected', - toggleOnExecute: false - }), - Focusing.config({onFocus: emitCellOver}) - ]) - }); + var _a; + var emitCellOver = function (c) { + return emitWith(c, cellOverEvent, { + row: row, + col: col + }); + }; + var emitExecute = function (c) { + return emitWith(c, cellExecuteEvent, { + row: row, + col: col + }); + }; + var onClick = function (c, se) { + se.stop(); + emitExecute(c); + }; + return build$1({ + dom: { + tag: 'div', + attributes: (_a = { role: 'button' }, _a['aria-labelledby'] = labelId, _a) + }, + behaviours: derive$1([ + config('insert-table-picker-cell', [ + run(mouseover(), Focusing.focus), + run(execute(), emitExecute), + run(click(), onClick), + run(tap(), onClick) + ]), + Toggling.config({ + toggleClass: 'tox-insert-table-picker__selected', + toggleOnExecute: false + }), + Focusing.config({ onFocus: emitCellOver }) + ]) + }); }; var makeCells = function (labelId, numRows, numCols) { - var cells = []; - for (var i = 0; i < numRows; i++) { - var row = []; - for (var j = 0; j < numCols; j++) { - row.push(makeCell(i, j, labelId)); - } - cells.push(row); + var cells = []; + for (var i = 0; i < numRows; i++) { + var row = []; + for (var j = 0; j < numCols; j++) { + row.push(makeCell(i, j, labelId)); } - return cells; + cells.push(row); + } + return cells; }; var selectCells = function (cells, selectedRow, selectedColumn, numRows, numColumns) { - for (var i = 0; i < numRows; i++) { - for (var j = 0; j < numColumns; j++) { - Toggling.set(cells[i][j], i <= selectedRow && j <= selectedColumn); - } + for (var i = 0; i < numRows; i++) { + for (var j = 0; j < numColumns; j++) { + Toggling.set(cells[i][j], i <= selectedRow && j <= selectedColumn); } + } }; var makeComponents = function (cells) { - return bind(cells, function (cellRow) { - return map(cellRow, premade$1); - }); + return bind(cells, function (cellRow) { + return map(cellRow, premade$1); + }); }; var makeLabelText = function (row, col) { - return text(col + 1 + 'x' + (row + 1)); + return text(col + 1 + 'x' + (row + 1)); }; var renderInsertTableMenuItem = function (spec) { - var numRows = 10; - var numColumns = 10; - var sizeLabelId = generate$1('size-label'); - var cells = makeCells(sizeLabelId, numRows, numColumns); - var memLabel = record({ - dom: { - tag: 'span', - classes: ['tox-insert-table-picker__label'], - attributes: {id: sizeLabelId} - }, - components: [text('0x0')], - behaviours: derive$1([Replacing.config({})]) - }); - return { - type: 'widget', - data: {value: generate$1('widget-id')}, + var numRows = 10; + var numColumns = 10; + var sizeLabelId = generate$1('size-label'); + var cells = makeCells(sizeLabelId, numRows, numColumns); + var memLabel = record({ + dom: { + tag: 'span', + classes: ['tox-insert-table-picker__label'], + attributes: { id: sizeLabelId } + }, + components: [text('0x0')], + behaviours: derive$1([Replacing.config({})]) + }); + return { + type: 'widget', + data: { value: generate$1('widget-id') }, + dom: { + tag: 'div', + classes: ['tox-fancymenuitem'] + }, + autofocus: true, + components: [parts$2.widget({ dom: { - tag: 'div', - classes: ['tox-fancymenuitem'] + tag: 'div', + classes: ['tox-insert-table-picker'] }, - autofocus: true, - components: [parts$2.widget({ - dom: { - tag: 'div', - classes: ['tox-insert-table-picker'] + components: makeComponents(cells).concat(memLabel.asSpec()), + behaviours: derive$1([ + config('insert-table-picker', [ + runWithTarget(cellOverEvent, function (c, t, e) { + var row = e.event.row; + var col = e.event.col; + selectCells(cells, row, col, numRows, numColumns); + Replacing.set(memLabel.get(c), [makeLabelText(row, col)]); + }), + runWithTarget(cellExecuteEvent, function (c, _, e) { + spec.onAction({ + numRows: e.event.row + 1, + numColumns: e.event.col + 1 + }); + emit(c, sandboxClose()); + }) + ]), + Keying.config({ + initSize: { + numRows: numRows, + numColumns: numColumns }, - components: makeComponents(cells).concat(memLabel.asSpec()), - behaviours: derive$1([ - config('insert-table-picker', [ - runWithTarget(cellOverEvent, function (c, t, e) { - var row = e.event.row; - var col = e.event.col; - selectCells(cells, row, col, numRows, numColumns); - Replacing.set(memLabel.get(c), [makeLabelText(row, col)]); - }), - runWithTarget(cellExecuteEvent, function (c, _, e) { - spec.onAction({ - numRows: e.event.row + 1, - numColumns: e.event.col + 1 - }); - emit(c, sandboxClose()); - }) - ]), - Keying.config({ - initSize: { - numRows: numRows, - numColumns: numColumns - }, - mode: 'flatgrid', - selector: '[role="button"]' - }) - ]) - })] - }; + mode: 'flatgrid', + selector: '[role="button"]' + }) + ]) + })] + }; }; var fancyMenuItems = { - inserttable: renderInsertTableMenuItem, - colorswatch: renderColorSwatchItem + inserttable: renderInsertTableMenuItem, + colorswatch: renderColorSwatchItem }; var valueOpt = function (obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key) ? Optional.some(obj[key]) : Optional.none(); + return Object.prototype.hasOwnProperty.call(obj, key) ? Optional.some(obj[key]) : Optional.none(); }; var renderFancyMenuItem = function (spec, backstage) { - return valueOpt(fancyMenuItems, spec.fancytype).map(function (render) { - return render(spec, backstage); - }); + return valueOpt(fancyMenuItems, spec.fancytype).map(function (render) { + return render(spec, backstage); + }); }; var renderNestedItem = function (spec, itemResponse, providersBackstage, renderIcons, downwardsCaret) { - if (renderIcons === void 0) { - renderIcons = true; - } - if (downwardsCaret === void 0) { - downwardsCaret = false; - } - var caret = downwardsCaret ? renderDownwardsCaret(providersBackstage.icons) : renderSubmenuCaret(providersBackstage.icons); - var getApi = function (component) { - return { - isDisabled: function () { - return Disabling.isDisabled(component); - }, - setDisabled: function (state) { - return Disabling.set(component, state); - } - }; - }; - var structure = renderItemStructure({ - presets: 'normal', - iconContent: spec.icon, - textContent: spec.text, - htmlContent: Optional.none(), - ariaLabel: spec.text, - caret: Optional.some(caret), - checkMark: Optional.none(), - shortcutContent: spec.shortcut - }, providersBackstage, renderIcons); - return renderCommonItem({ - data: buildData(spec), - getApi: getApi, - disabled: spec.disabled, - onAction: noop, - onSetup: spec.onSetup, - triggersSubmenu: true, - itemBehaviours: [] - }, structure, itemResponse, providersBackstage); + if (renderIcons === void 0) { + renderIcons = true; + } + if (downwardsCaret === void 0) { + downwardsCaret = false; + } + var caret = downwardsCaret ? renderDownwardsCaret(providersBackstage.icons) : renderSubmenuCaret(providersBackstage.icons); + var getApi = function (component) { + return { + isDisabled: function () { + return Disabling.isDisabled(component); + }, + setDisabled: function (state) { + return Disabling.set(component, state); + } + }; + }; + var structure = renderItemStructure({ + presets: 'normal', + iconContent: spec.icon, + textContent: spec.text, + htmlContent: Optional.none(), + ariaLabel: spec.text, + caret: Optional.some(caret), + checkMark: Optional.none(), + shortcutContent: spec.shortcut + }, providersBackstage, renderIcons); + return renderCommonItem({ + data: buildData(spec), + getApi: getApi, + disabled: spec.disabled, + onAction: noop, + onSetup: spec.onSetup, + triggersSubmenu: true, + itemBehaviours: [] + }, structure, itemResponse, providersBackstage); }; var renderNormalItem = function (spec, itemResponse, providersBackstage, renderIcons) { - if (renderIcons === void 0) { - renderIcons = true; - } - var getApi = function (component) { - return { - isDisabled: function () { - return Disabling.isDisabled(component); - }, - setDisabled: function (state) { - return Disabling.set(component, state); - } - }; - }; - var structure = renderItemStructure({ - presets: 'normal', - iconContent: spec.icon, - textContent: spec.text, - htmlContent: Optional.none(), - ariaLabel: spec.text, - caret: Optional.none(), - checkMark: Optional.none(), - shortcutContent: spec.shortcut - }, providersBackstage, renderIcons); - return renderCommonItem({ - data: buildData(spec), - getApi: getApi, - disabled: spec.disabled, - onAction: spec.onAction, - onSetup: spec.onSetup, - triggersSubmenu: false, - itemBehaviours: [] - }, structure, itemResponse, providersBackstage); + if (renderIcons === void 0) { + renderIcons = true; + } + var getApi = function (component) { + return { + isDisabled: function () { + return Disabling.isDisabled(component); + }, + setDisabled: function (state) { + return Disabling.set(component, state); + } + }; + }; + var structure = renderItemStructure({ + presets: 'normal', + iconContent: spec.icon, + textContent: spec.text, + htmlContent: Optional.none(), + ariaLabel: spec.text, + caret: Optional.none(), + checkMark: Optional.none(), + shortcutContent: spec.shortcut + }, providersBackstage, renderIcons); + return renderCommonItem({ + data: buildData(spec), + getApi: getApi, + disabled: spec.disabled, + onAction: spec.onAction, + onSetup: spec.onSetup, + triggersSubmenu: false, + itemBehaviours: [] + }, structure, itemResponse, providersBackstage); }; var renderSeparatorItem = function (spec) { - var innerHtml = spec.text.fold(function () { - return {}; - }, function (text) { - return {innerHtml: text}; - }); - return { - type: 'separator', - dom: __assign({ - tag: 'div', - classes: [ - selectableClass, - groupHeadingClass - ] - }, innerHtml), - components: [] - }; + var innerHtml = spec.text.fold(function () { + return {}; + }, function (text) { + return { innerHtml: text }; + }); + return { + type: 'separator', + dom: __assign({ + tag: 'div', + classes: [ + selectableClass, + groupHeadingClass + ] + }, innerHtml), + components: [] + }; }; var renderToggleMenuItem = function (spec, itemResponse, providersBackstage, renderIcons) { - if (renderIcons === void 0) { - renderIcons = true; - } - var getApi = function (component) { - return { - setActive: function (state) { - Toggling.set(component, state); - }, - isActive: function () { - return Toggling.isOn(component); - }, - isDisabled: function () { - return Disabling.isDisabled(component); - }, - setDisabled: function (state) { - return Disabling.set(component, state); - } - }; - }; - var structure = renderItemStructure({ - iconContent: spec.icon, - textContent: spec.text, - htmlContent: Optional.none(), - ariaLabel: spec.text, - checkMark: Optional.some(renderCheckmark(providersBackstage.icons)), - caret: Optional.none(), - shortcutContent: spec.shortcut, - presets: 'normal', - meta: spec.meta - }, providersBackstage, renderIcons); - return deepMerge(renderCommonItem({ - data: buildData(spec), - disabled: spec.disabled, - getApi: getApi, - onAction: spec.onAction, - onSetup: spec.onSetup, - triggersSubmenu: false, - itemBehaviours: [] - }, structure, itemResponse, providersBackstage), { - toggling: { - toggleClass: tickedClass, - toggleOnExecute: false, - selected: spec.active - } - }); + if (renderIcons === void 0) { + renderIcons = true; + } + var getApi = function (component) { + return { + setActive: function (state) { + Toggling.set(component, state); + }, + isActive: function () { + return Toggling.isOn(component); + }, + isDisabled: function () { + return Disabling.isDisabled(component); + }, + setDisabled: function (state) { + return Disabling.set(component, state); + } + }; + }; + var structure = renderItemStructure({ + iconContent: spec.icon, + textContent: spec.text, + htmlContent: Optional.none(), + ariaLabel: spec.text, + checkMark: Optional.some(renderCheckmark(providersBackstage.icons)), + caret: Optional.none(), + shortcutContent: spec.shortcut, + presets: 'normal', + meta: spec.meta + }, providersBackstage, renderIcons); + return deepMerge(renderCommonItem({ + data: buildData(spec), + disabled: spec.disabled, + getApi: getApi, + onAction: spec.onAction, + onSetup: spec.onSetup, + triggersSubmenu: false, + itemBehaviours: [] + }, structure, itemResponse, providersBackstage), { + toggling: { + toggleClass: tickedClass, + toggleOnExecute: false, + selected: spec.active + } + }); }; var render = function (items, extras) { - return map(items, function (item) { - switch (item.type) { - case 'cardcontainer': - return renderContainer(item, render(item.items, extras)); - case 'cardimage': - return renderImage(item.src, item.classes, item.alt); - case 'cardtext': - var shouldHighlight = item.name.exists(function (name) { - return contains(extras.cardText.highlightOn, name); - }); - var matchText = shouldHighlight ? Optional.from(extras.cardText.matchText).getOr('') : ''; - return renderHtml(replaceText(item.text, matchText), item.classes); - } - }); + return map(items, function (item) { + switch (item.type) { + case 'cardcontainer': + return renderContainer(item, render(item.items, extras)); + case 'cardimage': + return renderImage(item.src, item.classes, item.alt); + case 'cardtext': + var shouldHighlight = item.name.exists(function (name) { + return contains(extras.cardText.highlightOn, name); + }); + var matchText = shouldHighlight ? Optional.from(extras.cardText.matchText).getOr('') : ''; + return renderHtml(replaceText(item.text, matchText), item.classes); + } + }); }; var renderCardMenuItem = function (spec, itemResponse, sharedBackstage, extras) { - var getApi = function (component) { - return { - isDisabled: function () { - return Disabling.isDisabled(component); - }, - setDisabled: function (state) { - Disabling.set(component, state); - each(descendants(component.element, '*'), function (elm) { - component.getSystem().getByDom(elm).each(function (comp) { - if (comp.hasConfigured(Disabling)) { - Disabling.set(comp, state); - } - }); - }); + var getApi = function (component) { + return { + isDisabled: function () { + return Disabling.isDisabled(component); + }, + setDisabled: function (state) { + Disabling.set(component, state); + each(descendants(component.element, '*'), function (elm) { + component.getSystem().getByDom(elm).each(function (comp) { + if (comp.hasConfigured(Disabling)) { + Disabling.set(comp, state); } - }; - }; - var structure = { - dom: renderItemDomStructure(false, spec.label), - optComponents: [Optional.some({ - dom: { - tag: 'div', - classes: [ - containerClass, - containerRowClass - ] - }, - components: render(spec.items, extras) - })] + }); + }); + } }; - return renderCommonItem({ - data: buildData(__assign({text: Optional.none()}, spec)), - disabled: spec.disabled, - getApi: getApi, - onAction: spec.onAction, - onSetup: spec.onSetup, - triggersSubmenu: false, - itemBehaviours: Optional.from(extras.itemBehaviours).getOr([]) - }, structure, itemResponse, sharedBackstage.providers); + }; + var structure = { + dom: renderItemDomStructure(false, spec.label), + optComponents: [Optional.some({ + dom: { + tag: 'div', + classes: [ + containerClass, + containerRowClass + ] + }, + components: render(spec.items, extras) + })] + }; + return renderCommonItem({ + data: buildData(__assign({ text: Optional.none() }, spec)), + disabled: spec.disabled, + getApi: getApi, + onAction: spec.onAction, + onSetup: spec.onSetup, + triggersSubmenu: false, + itemBehaviours: Optional.from(extras.itemBehaviours).getOr([]) + }, structure, itemResponse, sharedBackstage.providers); }; var autocomplete = renderAutocompleteItem; @@ -12240,1032 +12232,1031 @@ var FocusMode; (function (FocusMode) { - FocusMode[FocusMode['ContentFocus'] = 0] = 'ContentFocus'; - FocusMode[FocusMode['UiFocus'] = 1] = 'UiFocus'; + FocusMode[FocusMode['ContentFocus'] = 0] = 'ContentFocus'; + FocusMode[FocusMode['UiFocus'] = 1] = 'UiFocus'; }(FocusMode || (FocusMode = {}))); var createMenuItemFromBridge = function (item, itemResponse, backstage, menuHasIcons, isHorizontalMenu) { - var providersBackstage = backstage.shared.providers; - var parseForHorizontalMenu = function (menuitem) { - return !isHorizontalMenu ? menuitem : __assign(__assign({}, menuitem), { - shortcut: Optional.none(), - icon: menuitem.text.isSome() ? Optional.none() : menuitem.icon - }); - }; + var providersBackstage = backstage.shared.providers; + var parseForHorizontalMenu = function (menuitem) { + return !isHorizontalMenu ? menuitem : __assign(__assign({}, menuitem), { + shortcut: Optional.none(), + icon: menuitem.text.isSome() ? Optional.none() : menuitem.icon + }); + }; + switch (item.type) { + case 'menuitem': + return createMenuItem(item).fold(handleError, function (d) { + return Optional.some(normal(parseForHorizontalMenu(d), itemResponse, providersBackstage, menuHasIcons)); + }); + case 'nestedmenuitem': + return createNestedMenuItem(item).fold(handleError, function (d) { + return Optional.some(nested(parseForHorizontalMenu(d), itemResponse, providersBackstage, menuHasIcons, isHorizontalMenu)); + }); + case 'togglemenuitem': + return createToggleMenuItem(item).fold(handleError, function (d) { + return Optional.some(toggle$1(parseForHorizontalMenu(d), itemResponse, providersBackstage, menuHasIcons)); + }); + case 'separator': + return createSeparatorMenuItem(item).fold(handleError, function (d) { + return Optional.some(separator(d)); + }); + case 'fancymenuitem': + return createFancyMenuItem(item).fold(handleError, function (d) { + return fancy(parseForHorizontalMenu(d), backstage); + }); + default: { + console.error('Unknown item in general menu', item); + return Optional.none(); + } + } + }; + var createAutocompleteItems = function (items, matchText, onItemValueHandler, columns, itemResponse, sharedBackstage, highlightOn) { + var renderText = columns === 1; + var renderIcons = !renderText || menuHasIcons(items); + return cat(map(items, function (item) { switch (item.type) { - case 'menuitem': - return createMenuItem(item).fold(handleError, function (d) { - return Optional.some(normal(parseForHorizontalMenu(d), itemResponse, providersBackstage, menuHasIcons)); - }); - case 'nestedmenuitem': - return createNestedMenuItem(item).fold(handleError, function (d) { - return Optional.some(nested(parseForHorizontalMenu(d), itemResponse, providersBackstage, menuHasIcons, isHorizontalMenu)); - }); - case 'togglemenuitem': - return createToggleMenuItem(item).fold(handleError, function (d) { - return Optional.some(toggle$1(parseForHorizontalMenu(d), itemResponse, providersBackstage, menuHasIcons)); - }); - case 'separator': - return createSeparatorMenuItem(item).fold(handleError, function (d) { - return Optional.some(separator(d)); - }); - case 'fancymenuitem': - return createFancyMenuItem(item).fold(handleError, function (d) { - return fancy(parseForHorizontalMenu(d), backstage); - }); - default: { - console.error('Unknown item in general menu', item); - return Optional.none(); - } + case 'separator': + return createSeparatorItem(item).fold(handleError, function (d) { + return Optional.some(separator(d)); + }); + case 'cardmenuitem': + return createCardMenuItem(item).fold(handleError, function (d) { + return Optional.some(card(__assign(__assign({}, d), { + onAction: function (api) { + d.onAction(api); + onItemValueHandler(d.value, d.meta); + } + }), itemResponse, sharedBackstage, { + itemBehaviours: tooltipBehaviour(d.meta, sharedBackstage), + cardText: { + matchText: matchText, + highlightOn: highlightOn + } + })); + }); + case 'autocompleteitem': + default: + return createAutocompleterItem(item).fold(handleError, function (d) { + return Optional.some(autocomplete(d, matchText, renderText, 'normal', onItemValueHandler, itemResponse, sharedBackstage, renderIcons)); + }); } - }; - var createAutocompleteItems = function (items, matchText, onItemValueHandler, columns, itemResponse, sharedBackstage, highlightOn) { - var renderText = columns === 1; - var renderIcons = !renderText || menuHasIcons(items); - return cat(map(items, function (item) { - switch (item.type) { - case 'separator': - return createSeparatorItem(item).fold(handleError, function (d) { - return Optional.some(separator(d)); - }); - case 'cardmenuitem': - return createCardMenuItem(item).fold(handleError, function (d) { - return Optional.some(card(__assign(__assign({}, d), { - onAction: function (api) { - d.onAction(api); - onItemValueHandler(d.value, d.meta); - } - }), itemResponse, sharedBackstage, { - itemBehaviours: tooltipBehaviour(d.meta, sharedBackstage), - cardText: { - matchText: matchText, - highlightOn: highlightOn - } - })); - }); - case 'autocompleteitem': - default: - return createAutocompleterItem(item).fold(handleError, function (d) { - return Optional.some(autocomplete(d, matchText, renderText, 'normal', onItemValueHandler, itemResponse, sharedBackstage, renderIcons)); - }); - } - })); + })); }; var createPartialMenu = function (value, items, itemResponse, backstage, isHorizontalMenu) { - var hasIcons = menuHasIcons(items); - var alloyItems = cat(map(items, function (item) { - var itemHasIcon = function (i) { - return isHorizontalMenu ? !i.hasOwnProperty('text') : hasIcons; - }; - var createItem = function (i) { - return createMenuItemFromBridge(i, itemResponse, backstage, itemHasIcon(i), isHorizontalMenu); - }; - if (item.type === 'nestedmenuitem' && item.getSubmenuItems().length <= 0) { - return createItem(__assign(__assign({}, item), {disabled: true})); - } else { - return createItem(item); - } - })); - var createPartial = isHorizontalMenu ? createHorizontalPartialMenuWithAlloyItems : createPartialMenuWithAlloyItems; - return createPartial(value, hasIcons, alloyItems, 1, 'normal'); + var hasIcons = menuHasIcons(items); + var alloyItems = cat(map(items, function (item) { + var itemHasIcon = function (i) { + return isHorizontalMenu ? !i.hasOwnProperty('text') : hasIcons; + }; + var createItem = function (i) { + return createMenuItemFromBridge(i, itemResponse, backstage, itemHasIcon(i), isHorizontalMenu); + }; + if (item.type === 'nestedmenuitem' && item.getSubmenuItems().length <= 0) { + return createItem(__assign(__assign({}, item), { disabled: true })); + } else { + return createItem(item); + } + })); + var createPartial = isHorizontalMenu ? createHorizontalPartialMenuWithAlloyItems : createPartialMenuWithAlloyItems; + return createPartial(value, hasIcons, alloyItems, 1, 'normal'); }; var createTieredDataFrom = function (partialMenu) { - return tieredMenu.singleData(partialMenu.value, partialMenu); + return tieredMenu.singleData(partialMenu.value, partialMenu); }; var createMenuFrom = function (partialMenu, columns, focusMode, presets) { - var focusManager = focusMode === FocusMode.ContentFocus ? highlights() : dom(); - var movement = deriveMenuMovement(columns, presets); - var menuMarkers = markers$1(presets); - return { - dom: partialMenu.dom, - components: partialMenu.components, - items: partialMenu.items, - value: partialMenu.value, - markers: { - selectedItem: menuMarkers.selectedItem, - item: menuMarkers.item - }, - movement: movement, - fakeFocus: focusMode === FocusMode.ContentFocus, - focusManager: focusManager, - menuBehaviours: SimpleBehaviours.unnamedEvents(columns !== 'auto' ? [] : [runOnAttached(function (comp, _se) { - detectSize(comp, 4, menuMarkers.item).each(function (_a) { - var numColumns = _a.numColumns, numRows = _a.numRows; - Keying.setGridSize(comp, numRows, numColumns); - }); - })]) - }; + var focusManager = focusMode === FocusMode.ContentFocus ? highlights() : dom(); + var movement = deriveMenuMovement(columns, presets); + var menuMarkers = markers$1(presets); + return { + dom: partialMenu.dom, + components: partialMenu.components, + items: partialMenu.items, + value: partialMenu.value, + markers: { + selectedItem: menuMarkers.selectedItem, + item: menuMarkers.item + }, + movement: movement, + fakeFocus: focusMode === FocusMode.ContentFocus, + focusManager: focusManager, + menuBehaviours: SimpleBehaviours.unnamedEvents(columns !== 'auto' ? [] : [runOnAttached(function (comp, _se) { + detectSize(comp, 4, menuMarkers.item).each(function (_a) { + var numColumns = _a.numColumns, numRows = _a.numRows; + Keying.setGridSize(comp, numRows, numColumns); + }); + })]) + }; }; var register$2 = function (editor, sharedBackstage) { - var activeAutocompleter = Cell(Optional.none()); - var processingAction = Cell(false); - var autocompleter = build$1(InlineView.sketch({ - dom: { - tag: 'div', - classes: ['tox-autocompleter'] - }, - components: [], - fireDismissalEventInstead: {}, - inlineBehaviours: derive$1([config('dismissAutocompleter', [run(dismissRequested(), function () { - return cancelIfNecessary(); + var activeAutocompleter = Cell(Optional.none()); + var processingAction = Cell(false); + var autocompleter = build$1(InlineView.sketch({ + dom: { + tag: 'div', + classes: ['tox-autocompleter'] + }, + components: [], + fireDismissalEventInstead: {}, + inlineBehaviours: derive$1([config('dismissAutocompleter', [run(dismissRequested(), function () { + return cancelIfNecessary(); })])]), - lazySink: sharedBackstage.getSink - })); - var isMenuOpen = function () { - return InlineView.isOpen(autocompleter); - }; - var isActive = function () { - return activeAutocompleter.get().isSome(); - }; - var hideIfNecessary = function () { - if (isActive()) { - InlineView.hide(autocompleter); - } - }; - var cancelIfNecessary = function () { - if (isActive()) { - var lastElement = activeAutocompleter.get().map(function (ac) { - return ac.element; - }); - detect$4(lastElement.getOr(SugarElement.fromDom(editor.selection.getNode()))).each(unwrap); - hideIfNecessary(); - activeAutocompleter.set(Optional.none()); - processingAction.set(false); - } - }; - var getAutocompleters = cached(function () { - return register(editor); - }); - var getCombinedItems = function (triggerChar, matches) { - var columns = findMap(matches, function (m) { - return Optional.from(m.columns); - }).getOr(1); - return bind(matches, function (match) { - var choices = match.items; - return createAutocompleteItems(choices, match.matchText, function (itemValue, itemMeta) { - var nr = editor.selection.getRng(); - getContext(editor.dom, nr, triggerChar).fold(function () { - return console.error('Lost context. Cursor probably moved'); - }, function (_a) { - var range = _a.range; - var autocompleterApi = { - hide: function () { - cancelIfNecessary(); - }, - reload: function (fetchOptions) { - hideIfNecessary(); - load(fetchOptions); - } - }; - processingAction.set(true); - match.onAction(autocompleterApi, range, itemValue, itemMeta); - processingAction.set(false); - }); - }, columns, ItemResponse$1.BUBBLE_TO_SANDBOX, sharedBackstage, match.highlightOn); - }); - }; - var commenceIfNecessary = function (context) { - if (!isActive()) { - var wrapper = create$4(editor, context.range); - activeAutocompleter.set(Optional.some({ - triggerChar: context.triggerChar, - element: wrapper, - matchLength: context.text.length - })); - processingAction.set(false); - } - }; - var display = function (ac, context, lookupData, items) { - ac.matchLength = context.text.length; - var columns = findMap(lookupData, function (ld) { - return Optional.from(ld.columns); - }).getOr(1); - InlineView.showAt(autocompleter, { - anchor: 'node', - root: SugarElement.fromDom(editor.getBody()), - node: Optional.from(ac.element) - }, Menu.sketch(createMenuFrom(createPartialMenuWithAlloyItems('autocompleter-value', true, items, columns, 'normal'), columns, FocusMode.ContentFocus, 'normal'))); - InlineView.getContent(autocompleter).each(Highlighting.highlightFirst); - }; - var doLookup = function (fetchOptions) { - return activeAutocompleter.get().map(function (ac) { - return getContext(editor.dom, editor.selection.getRng(), ac.triggerChar).bind(function (newContext) { - return lookupWithContext(editor, getAutocompleters, newContext, fetchOptions); - }); - }).getOrThunk(function () { - return lookup(editor, getAutocompleters); - }); - }; - var load = function (fetchOptions) { - doLookup(fetchOptions).fold(cancelIfNecessary, function (lookupInfo) { - commenceIfNecessary(lookupInfo.context); - lookupInfo.lookupData.then(function (lookupData) { - activeAutocompleter.get().map(function (ac) { - var context = lookupInfo.context; - if (ac.triggerChar === context.triggerChar) { - var combinedItems = getCombinedItems(context.triggerChar, lookupData); - if (combinedItems.length > 0) { - display(ac, context, lookupData, combinedItems); - } else if (context.text.length - ac.matchLength >= 10) { - cancelIfNecessary(); - } else { - hideIfNecessary(); - } - } - }); - }); + lazySink: sharedBackstage.getSink + })); + var isMenuOpen = function () { + return InlineView.isOpen(autocompleter); + }; + var isActive = function () { + return activeAutocompleter.get().isSome(); + }; + var hideIfNecessary = function () { + if (isActive()) { + InlineView.hide(autocompleter); + } + }; + var cancelIfNecessary = function () { + if (isActive()) { + var lastElement = activeAutocompleter.get().map(function (ac) { + return ac.element; + }); + detect$4(lastElement.getOr(SugarElement.fromDom(editor.selection.getNode()))).each(unwrap); + hideIfNecessary(); + activeAutocompleter.set(Optional.none()); + processingAction.set(false); + } + }; + var getAutocompleters = cached(function () { + return register(editor); + }); + var getCombinedItems = function (triggerChar, matches) { + var columns = findMap(matches, function (m) { + return Optional.from(m.columns); + }).getOr(1); + return bind(matches, function (match) { + var choices = match.items; + return createAutocompleteItems(choices, match.matchText, function (itemValue, itemMeta) { + var nr = editor.selection.getRng(); + getContext(editor.dom, nr, triggerChar).fold(function () { + return console.error('Lost context. Cursor probably moved'); + }, function (_a) { + var range = _a.range; + var autocompleterApi = { + hide: function () { + cancelIfNecessary(); + }, + reload: function (fetchOptions) { + hideIfNecessary(); + load(fetchOptions); + } + }; + processingAction.set(true); + match.onAction(autocompleterApi, range, itemValue, itemMeta); + processingAction.set(false); + }); + }, columns, ItemResponse$1.BUBBLE_TO_SANDBOX, sharedBackstage, match.highlightOn); + }); + }; + var commenceIfNecessary = function (context) { + if (!isActive()) { + var wrapper = create$4(editor, context.range); + activeAutocompleter.set(Optional.some({ + triggerChar: context.triggerChar, + element: wrapper, + matchLength: context.text.length + })); + processingAction.set(false); + } + }; + var display = function (ac, context, lookupData, items) { + ac.matchLength = context.text.length; + var columns = findMap(lookupData, function (ld) { + return Optional.from(ld.columns); + }).getOr(1); + InlineView.showAt(autocompleter, { + anchor: 'node', + root: SugarElement.fromDom(editor.getBody()), + node: Optional.from(ac.element) + }, Menu.sketch(createMenuFrom(createPartialMenuWithAlloyItems('autocompleter-value', true, items, columns, 'normal'), columns, FocusMode.ContentFocus, 'normal'))); + InlineView.getContent(autocompleter).each(Highlighting.highlightFirst); + }; + var doLookup = function (fetchOptions) { + return activeAutocompleter.get().map(function (ac) { + return getContext(editor.dom, editor.selection.getRng(), ac.triggerChar).bind(function (newContext) { + return lookupWithContext(editor, getAutocompleters, newContext, fetchOptions); + }); + }).getOrThunk(function () { + return lookup(editor, getAutocompleters); + }); + }; + var load = function (fetchOptions) { + doLookup(fetchOptions).fold(cancelIfNecessary, function (lookupInfo) { + commenceIfNecessary(lookupInfo.context); + lookupInfo.lookupData.then(function (lookupData) { + activeAutocompleter.get().map(function (ac) { + var context = lookupInfo.context; + if (ac.triggerChar === context.triggerChar) { + var combinedItems = getCombinedItems(context.triggerChar, lookupData); + if (combinedItems.length > 0) { + display(ac, context, lookupData, combinedItems); + } else if (context.text.length - ac.matchLength >= 10) { + cancelIfNecessary(); + } else { + hideIfNecessary(); + } + } }); - }; - var onKeypress = last$2(function (e) { - if (e.which === 27) { - return; - } - load(); - }, 50); - var autocompleterUiApi = { - onKeypress: onKeypress, - cancelIfNecessary: cancelIfNecessary, - isMenuOpen: isMenuOpen, - isActive: isActive, - isProcessingAction: processingAction.get, - getView: function () { - return InlineView.getContent(autocompleter); - } - }; - if (editor.hasPlugin('rtc') === false) { - AutocompleterEditorEvents.setup(autocompleterUiApi, editor); + }); + }); + }; + var onKeypress = last$2(function (e) { + if (e.which === 27) { + return; + } + load(); + }, 50); + var autocompleterUiApi = { + onKeypress: onKeypress, + cancelIfNecessary: cancelIfNecessary, + isMenuOpen: isMenuOpen, + isActive: isActive, + isProcessingAction: processingAction.get, + getView: function () { + return InlineView.getContent(autocompleter); } + }; + if (editor.hasPlugin('rtc') === false) { + AutocompleterEditorEvents.setup(autocompleterUiApi, editor); + } }; - var Autocompleter = {register: register$2}; + var Autocompleter = { register: register$2 }; var filter$2 = always; var bind$3 = function (element, event, handler) { - return bind$2(element, event, filter$2, handler); + return bind$2(element, event, filter$2, handler); }; var capture$1 = function (element, event, handler) { - return capture(element, event, filter$2, handler); + return capture(element, event, filter$2, handler); }; var fromRawEvent$1 = fromRawEvent; var closest$4 = function (scope, selector, isRoot) { - return closest$3(scope, selector, isRoot).isSome(); - }; - - function DelayedFunction(fun, delay) { - var ref = null; - var schedule = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - ref = setTimeout(function () { - fun.apply(null, args); - ref = null; - }, delay); - }; - var cancel = function () { - if (ref !== null) { - clearTimeout(ref); - ref = null; - } - }; - return { - cancel: cancel, - schedule: schedule - }; + return closest$3(scope, selector, isRoot).isSome(); + }; + + function DelayedFunction (fun, delay) { + var ref = null; + var schedule = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + ref = setTimeout(function () { + fun.apply(null, args); + ref = null; + }, delay); + }; + var cancel = function () { + if (ref !== null) { + clearTimeout(ref); + ref = null; + } + }; + return { + cancel: cancel, + schedule: schedule + }; } var SIGNIFICANT_MOVE = 5; var LONGPRESS_DELAY = 400; var getTouch = function (event) { - var raw = event.raw; - if (raw.touches === undefined || raw.touches.length !== 1) { - return Optional.none(); - } - return Optional.some(raw.touches[0]); + var raw = event.raw; + if (raw.touches === undefined || raw.touches.length !== 1) { + return Optional.none(); + } + return Optional.some(raw.touches[0]); }; var isFarEnough = function (touch, data) { - var distX = Math.abs(touch.clientX - data.x); - var distY = Math.abs(touch.clientY - data.y); - return distX > SIGNIFICANT_MOVE || distY > SIGNIFICANT_MOVE; + var distX = Math.abs(touch.clientX - data.x); + var distY = Math.abs(touch.clientY - data.y); + return distX > SIGNIFICANT_MOVE || distY > SIGNIFICANT_MOVE; }; var monitor = function (settings) { - var startData = Cell(Optional.none()); - var longpressFired = Cell(false); - var longpress$1 = DelayedFunction(function (event) { - settings.triggerEvent(longpress(), event); - longpressFired.set(true); - }, LONGPRESS_DELAY); - var handleTouchstart = function (event) { - getTouch(event).each(function (touch) { - longpress$1.cancel(); - var data = { - x: touch.clientX, - y: touch.clientY, - target: event.target - }; - longpress$1.schedule(event); - longpressFired.set(false); - startData.set(Optional.some(data)); - }); - return Optional.none(); - }; - var handleTouchmove = function (event) { - longpress$1.cancel(); - getTouch(event).each(function (touch) { - startData.get().each(function (data) { - if (isFarEnough(touch, data)) { - startData.set(Optional.none()); - } - }); - }); - return Optional.none(); - }; - var handleTouchend = function (event) { - longpress$1.cancel(); - var isSame = function (data) { - return eq$1(data.target, event.target); - }; - return startData.get().filter(isSame).map(function (_data) { - if (longpressFired.get()) { - event.prevent(); - return false; - } else { - return settings.triggerEvent(tap(), event); - } - }); - }; - var handlers = wrapAll$1([ - { - key: touchstart(), - value: handleTouchstart - }, - { - key: touchmove(), - value: handleTouchmove - }, - { - key: touchend(), - value: handleTouchend + var startData = Cell(Optional.none()); + var longpressFired = Cell(false); + var longpress$1 = DelayedFunction(function (event) { + settings.triggerEvent(longpress(), event); + longpressFired.set(true); + }, LONGPRESS_DELAY); + var handleTouchstart = function (event) { + getTouch(event).each(function (touch) { + longpress$1.cancel(); + var data = { + x: touch.clientX, + y: touch.clientY, + target: event.target + }; + longpress$1.schedule(event); + longpressFired.set(false); + startData.set(Optional.some(data)); + }); + return Optional.none(); + }; + var handleTouchmove = function (event) { + longpress$1.cancel(); + getTouch(event).each(function (touch) { + startData.get().each(function (data) { + if (isFarEnough(touch, data)) { + startData.set(Optional.none()); } - ]); - var fireIfReady = function (event, type) { - return get$1(handlers, type).bind(function (handler) { - return handler(event); - }); - }; - return {fireIfReady: fireIfReady}; + }); + }); + return Optional.none(); + }; + var handleTouchend = function (event) { + longpress$1.cancel(); + var isSame = function (data) { + return eq$1(data.target, event.target); + }; + return startData.get().filter(isSame).map(function (_data) { + if (longpressFired.get()) { + event.prevent(); + return false; + } else { + return settings.triggerEvent(tap(), event); + } + }); + }; + var handlers = wrapAll$1([ + { + key: touchstart(), + value: handleTouchstart + }, + { + key: touchmove(), + value: handleTouchmove + }, + { + key: touchend(), + value: handleTouchend + } + ]); + var fireIfReady = function (event, type) { + return get$1(handlers, type).bind(function (handler) { + return handler(event); + }); + }; + return { fireIfReady: fireIfReady }; }; var isDangerous = function (event) { - var keyEv = event.raw; - return keyEv.which === BACKSPACE[0] && !contains([ - 'input', - 'textarea' - ], name(event.target)) && !closest$4(event.target, '[contenteditable="true"]'); + var keyEv = event.raw; + return keyEv.which === BACKSPACE[0] && !contains([ + 'input', + 'textarea' + ], name(event.target)) && !closest$4(event.target, '[contenteditable="true"]'); }; var isFirefox = function () { - return detect$3().browser.isFirefox(); + return detect$3().browser.isFirefox(); }; var settingsSchema = objOfOnly([ - strictFunction('triggerEvent'), - defaulted$1('stopBackspace', true) + strictFunction('triggerEvent'), + defaulted$1('stopBackspace', true) ]); var bindFocus = function (container, handler) { - if (isFirefox()) { - return capture$1(container, 'focus', handler); - } else { - return bind$3(container, 'focusin', handler); - } + if (isFirefox()) { + return capture$1(container, 'focus', handler); + } else { + return bind$3(container, 'focusin', handler); + } }; var bindBlur = function (container, handler) { - if (isFirefox()) { - return capture$1(container, 'blur', handler); - } else { - return bind$3(container, 'focusout', handler); - } + if (isFirefox()) { + return capture$1(container, 'blur', handler); + } else { + return bind$3(container, 'focusout', handler); + } }; var setup$1 = function (container, rawSettings) { - var settings = asRawOrDie('Getting GUI events settings', settingsSchema, rawSettings); - var pointerEvents = [ - 'touchstart', - 'touchmove', - 'touchend', - 'touchcancel', - 'gesturestart', - 'mousedown', - 'mouseup', - 'mouseover', - 'mousemove', - 'mouseout', - 'click' - ]; - var tapEvent = monitor(settings); - var simpleEvents = map(pointerEvents.concat([ - 'selectstart', - 'input', - 'contextmenu', - 'change', - 'transitionend', - 'drag', - 'dragstart', - 'dragend', - 'dragenter', - 'dragleave', - 'dragover', - 'drop', - 'keyup' - ]), function (type) { - return bind$3(container, type, function (event) { - tapEvent.fireIfReady(event, type).each(function (tapStopped) { - if (tapStopped) { - event.kill(); - } - }); - var stopped = settings.triggerEvent(type, event); - if (stopped) { - event.kill(); - } - }); - }); - var pasteTimeout = Cell(Optional.none()); - var onPaste = bind$3(container, 'paste', function (event) { - tapEvent.fireIfReady(event, 'paste').each(function (tapStopped) { - if (tapStopped) { - event.kill(); - } - }); - var stopped = settings.triggerEvent('paste', event); - if (stopped) { - event.kill(); - } - pasteTimeout.set(Optional.some(setTimeout(function () { - settings.triggerEvent(postPaste(), event); - }, 0))); - }); - var onKeydown = bind$3(container, 'keydown', function (event) { - var stopped = settings.triggerEvent('keydown', event); - if (stopped) { - event.kill(); - } else if (settings.stopBackspace === true && isDangerous(event)) { - event.prevent(); - } - }); - var onFocusIn = bindFocus(container, function (event) { - var stopped = settings.triggerEvent('focusin', event); - if (stopped) { - event.kill(); - } - }); - var focusoutTimeout = Cell(Optional.none()); - var onFocusOut = bindBlur(container, function (event) { - var stopped = settings.triggerEvent('focusout', event); - if (stopped) { - event.kill(); - } - focusoutTimeout.set(Optional.some(setTimeout(function () { - settings.triggerEvent(postBlur(), event); - }, 0))); - }); - var unbind = function () { - each(simpleEvents, function (e) { - e.unbind(); - }); - onKeydown.unbind(); - onFocusIn.unbind(); - onFocusOut.unbind(); - onPaste.unbind(); - pasteTimeout.get().each(clearTimeout); - focusoutTimeout.get().each(clearTimeout); - }; - return {unbind: unbind}; + var settings = asRawOrDie('Getting GUI events settings', settingsSchema, rawSettings); + var pointerEvents = [ + 'touchstart', + 'touchmove', + 'touchend', + 'touchcancel', + 'gesturestart', + 'mousedown', + 'mouseup', + 'mouseover', + 'mousemove', + 'mouseout', + 'click' + ]; + var tapEvent = monitor(settings); + var simpleEvents = map(pointerEvents.concat([ + 'selectstart', + 'input', + 'contextmenu', + 'change', + 'transitionend', + 'drag', + 'dragstart', + 'dragend', + 'dragenter', + 'dragleave', + 'dragover', + 'drop', + 'keyup' + ]), function (type) { + return bind$3(container, type, function (event) { + tapEvent.fireIfReady(event, type).each(function (tapStopped) { + if (tapStopped) { + event.kill(); + } + }); + var stopped = settings.triggerEvent(type, event); + if (stopped) { + event.kill(); + } + }); + }); + var pasteTimeout = Cell(Optional.none()); + var onPaste = bind$3(container, 'paste', function (event) { + tapEvent.fireIfReady(event, 'paste').each(function (tapStopped) { + if (tapStopped) { + event.kill(); + } + }); + var stopped = settings.triggerEvent('paste', event); + if (stopped) { + event.kill(); + } + pasteTimeout.set(Optional.some(setTimeout(function () { + settings.triggerEvent(postPaste(), event); + }, 0))); + }); + var onKeydown = bind$3(container, 'keydown', function (event) { + var stopped = settings.triggerEvent('keydown', event); + if (stopped) { + event.kill(); + } else if (settings.stopBackspace === true && isDangerous(event)) { + event.prevent(); + } + }); + var onFocusIn = bindFocus(container, function (event) { + var stopped = settings.triggerEvent('focusin', event); + if (stopped) { + event.kill(); + } + }); + var focusoutTimeout = Cell(Optional.none()); + var onFocusOut = bindBlur(container, function (event) { + var stopped = settings.triggerEvent('focusout', event); + if (stopped) { + event.kill(); + } + focusoutTimeout.set(Optional.some(setTimeout(function () { + settings.triggerEvent(postBlur(), event); + }, 0))); + }); + var unbind = function () { + each(simpleEvents, function (e) { + e.unbind(); + }); + onKeydown.unbind(); + onFocusIn.unbind(); + onFocusOut.unbind(); + onPaste.unbind(); + pasteTimeout.get().each(clearTimeout); + focusoutTimeout.get().each(clearTimeout); + }; + return { unbind: unbind }; }; var derive$2 = function (rawEvent, rawTarget) { - var source = get$1(rawEvent, 'target').getOr(rawTarget); - return Cell(source); + var source = get$1(rawEvent, 'target').getOr(rawTarget); + return Cell(source); }; var fromSource = function (event, source) { - var stopper = Cell(false); - var cutter = Cell(false); - var stop = function () { - stopper.set(true); - }; - var cut = function () { - cutter.set(true); - }; - return { - stop: stop, - cut: cut, - isStopped: stopper.get, - isCut: cutter.get, - event: event, - setSource: source.set, - getSource: source.get - }; + var stopper = Cell(false); + var cutter = Cell(false); + var stop = function () { + stopper.set(true); + }; + var cut = function () { + cutter.set(true); + }; + return { + stop: stop, + cut: cut, + isStopped: stopper.get, + isCut: cutter.get, + event: event, + setSource: source.set, + getSource: source.get + }; }; var fromExternal = function (event) { - var stopper = Cell(false); - var stop = function () { - stopper.set(true); - }; - return { - stop: stop, - cut: noop, - isStopped: stopper.get, - isCut: never, - event: event, - setSource: die('Cannot set source of a broadcasted event'), - getSource: die('Cannot get source of a broadcasted event') - }; + var stopper = Cell(false); + var stop = function () { + stopper.set(true); + }; + return { + stop: stop, + cut: noop, + isStopped: stopper.get, + isCut: never, + event: event, + setSource: die('Cannot set source of a broadcasted event'), + getSource: die('Cannot get source of a broadcasted event') + }; }; var adt$b = Adt.generate([ - {stopped: []}, - {resume: ['element']}, - {complete: []} + { stopped: [] }, + { resume: ['element'] }, + { complete: [] } ]); var doTriggerHandler = function (lookup, eventType, rawEvent, target, source, logger) { - var handler = lookup(eventType, target); - var simulatedEvent = fromSource(rawEvent, source); - return handler.fold(function () { - logger.logEventNoHandlers(eventType, target); + var handler = lookup(eventType, target); + var simulatedEvent = fromSource(rawEvent, source); + return handler.fold(function () { + logger.logEventNoHandlers(eventType, target); + return adt$b.complete(); + }, function (handlerInfo) { + var descHandler = handlerInfo.descHandler; + var eventHandler = getCurried(descHandler); + eventHandler(simulatedEvent); + if (simulatedEvent.isStopped()) { + logger.logEventStopped(eventType, handlerInfo.element, descHandler.purpose); + return adt$b.stopped(); + } else if (simulatedEvent.isCut()) { + logger.logEventCut(eventType, handlerInfo.element, descHandler.purpose); + return adt$b.complete(); + } else { + return parent(handlerInfo.element).fold(function () { + logger.logNoParent(eventType, handlerInfo.element, descHandler.purpose); return adt$b.complete(); - }, function (handlerInfo) { - var descHandler = handlerInfo.descHandler; - var eventHandler = getCurried(descHandler); - eventHandler(simulatedEvent); - if (simulatedEvent.isStopped()) { - logger.logEventStopped(eventType, handlerInfo.element, descHandler.purpose); - return adt$b.stopped(); - } else if (simulatedEvent.isCut()) { - logger.logEventCut(eventType, handlerInfo.element, descHandler.purpose); - return adt$b.complete(); - } else { - return parent(handlerInfo.element).fold(function () { - logger.logNoParent(eventType, handlerInfo.element, descHandler.purpose); - return adt$b.complete(); - }, function (parent) { - logger.logEventResponse(eventType, handlerInfo.element, descHandler.purpose); - return adt$b.resume(parent); - }); - } - }); + }, function (parent) { + logger.logEventResponse(eventType, handlerInfo.element, descHandler.purpose); + return adt$b.resume(parent); + }); + } + }); }; var doTriggerOnUntilStopped = function (lookup, eventType, rawEvent, rawTarget, source, logger) { - return doTriggerHandler(lookup, eventType, rawEvent, rawTarget, source, logger).fold(function () { - return true; - }, function (parent) { - return doTriggerOnUntilStopped(lookup, eventType, rawEvent, parent, source, logger); - }, function () { - return false; - }); + return doTriggerHandler(lookup, eventType, rawEvent, rawTarget, source, logger).fold(function () { + return true; + }, function (parent) { + return doTriggerOnUntilStopped(lookup, eventType, rawEvent, parent, source, logger); + }, function () { + return false; + }); }; var triggerHandler = function (lookup, eventType, rawEvent, target, logger) { - var source = derive$2(rawEvent, target); - return doTriggerHandler(lookup, eventType, rawEvent, target, source, logger); + var source = derive$2(rawEvent, target); + return doTriggerHandler(lookup, eventType, rawEvent, target, source, logger); }; var broadcast = function (listeners, rawEvent, _logger) { - var simulatedEvent = fromExternal(rawEvent); - each(listeners, function (listener) { - var descHandler = listener.descHandler; - var handler = getCurried(descHandler); - handler(simulatedEvent); - }); - return simulatedEvent.isStopped(); + var simulatedEvent = fromExternal(rawEvent); + each(listeners, function (listener) { + var descHandler = listener.descHandler; + var handler = getCurried(descHandler); + handler(simulatedEvent); + }); + return simulatedEvent.isStopped(); }; var triggerUntilStopped = function (lookup, eventType, rawEvent, logger) { - return triggerOnUntilStopped(lookup, eventType, rawEvent, rawEvent.target, logger); + return triggerOnUntilStopped(lookup, eventType, rawEvent, rawEvent.target, logger); }; var triggerOnUntilStopped = function (lookup, eventType, rawEvent, rawTarget, logger) { - var source = derive$2(rawEvent, rawTarget); - return doTriggerOnUntilStopped(lookup, eventType, rawEvent, rawTarget, source, logger); + var source = derive$2(rawEvent, rawTarget); + return doTriggerOnUntilStopped(lookup, eventType, rawEvent, rawTarget, source, logger); }; var eventHandler = function (element, descHandler) { - return { - element: element, - descHandler: descHandler - }; + return { + element: element, + descHandler: descHandler + }; }; var broadcastHandler = function (id, handler) { - return { - id: id, - descHandler: handler - }; - }; - - function EventRegistry() { - var registry = {}; - var registerId = function (extraArgs, id, events) { - each$1(events, function (v, k) { - var handlers = registry[k] !== undefined ? registry[k] : {}; - handlers[id] = curryArgs(v, extraArgs); - registry[k] = handlers; - }); - }; - var findHandler = function (handlers, elem) { - return read$1(elem).fold(function () { - return Optional.none(); - }, function (id) { - return handlers.bind(function (h) { - return get$1(h, id); - }).map(function (descHandler) { - return eventHandler(elem, descHandler); - }); - }); - }; - var filterByType = function (type) { - return get$1(registry, type).map(function (handlers) { - return mapToArray(handlers, function (f, id) { - return broadcastHandler(id, f); - }); - }).getOr([]); - }; - var find = function (isAboveRoot, type, target) { - var handlers = get$1(registry, type); - return closest(target, function (elem) { - return findHandler(handlers, elem); - }, isAboveRoot); - }; - var unregisterId = function (id) { - each$1(registry, function (handlersById, _eventName) { - if (handlersById.hasOwnProperty(id)) { - delete handlersById[id]; - } - }); - }; - return { - registerId: registerId, - unregisterId: unregisterId, - filterByType: filterByType, - find: find - }; + return { + id: id, + descHandler: handler + }; + }; + function EventRegistry () { + var registry = {}; + var registerId = function (extraArgs, id, events) { + each$1(events, function (v, k) { + var handlers = registry[k] !== undefined ? registry[k] : {}; + handlers[id] = curryArgs(v, extraArgs); + registry[k] = handlers; + }); + }; + var findHandler = function (handlers, elem) { + return read$1(elem).fold(function () { + return Optional.none(); + }, function (id) { + return handlers.bind(function (h) { + return get$1(h, id); + }).map(function (descHandler) { + return eventHandler(elem, descHandler); + }); + }); + }; + var filterByType = function (type) { + return get$1(registry, type).map(function (handlers) { + return mapToArray(handlers, function (f, id) { + return broadcastHandler(id, f); + }); + }).getOr([]); + }; + var find = function (isAboveRoot, type, target) { + var handlers = get$1(registry, type); + return closest(target, function (elem) { + return findHandler(handlers, elem); + }, isAboveRoot); + }; + var unregisterId = function (id) { + each$1(registry, function (handlersById, _eventName) { + if (handlersById.hasOwnProperty(id)) { + delete handlersById[id]; + } + }); + }; + return { + registerId: registerId, + unregisterId: unregisterId, + filterByType: filterByType, + find: find + }; } - function Registry() { - var events = EventRegistry(); - var components = {}; - var readOrTag = function (component) { - var elem = component.element; - return read$1(elem).fold(function () { - return write('uid-', component.element); - }, function (uid) { - return uid; - }); - }; - var failOnDuplicate = function (component, tagId) { - var conflict = components[tagId]; - if (conflict === component) { - unregister(component); - } else { - throw new Error('The tagId "' + tagId + '" is already used by: ' + element(conflict.element) + '\nCannot use it for: ' + element(component.element) + '\n' + 'The conflicting element is' + (inBody(conflict.element) ? ' ' : ' not ') + 'already in the DOM'); - } - }; - var register = function (component) { - var tagId = readOrTag(component); - if (hasNonNullableKey(components, tagId)) { - failOnDuplicate(component, tagId); - } - var extraArgs = [component]; - events.registerId(extraArgs, tagId, component.events); - components[tagId] = component; - }; - var unregister = function (component) { - read$1(component.element).each(function (tagId) { - delete components[tagId]; - events.unregisterId(tagId); - }); - }; - var filter = function (type) { - return events.filterByType(type); - }; - var find = function (isAboveRoot, type, target) { - return events.find(isAboveRoot, type, target); - }; - var getById = function (id) { - return get$1(components, id); - }; - return { - find: find, - filter: filter, - register: register, - unregister: unregister, - getById: getById - }; + function Registry () { + var events = EventRegistry(); + var components = {}; + var readOrTag = function (component) { + var elem = component.element; + return read$1(elem).fold(function () { + return write('uid-', component.element); + }, function (uid) { + return uid; + }); + }; + var failOnDuplicate = function (component, tagId) { + var conflict = components[tagId]; + if (conflict === component) { + unregister(component); + } else { + throw new Error('The tagId "' + tagId + '" is already used by: ' + element(conflict.element) + '\nCannot use it for: ' + element(component.element) + '\n' + 'The conflicting element is' + (inBody(conflict.element) ? ' ' : ' not ') + 'already in the DOM'); + } + }; + var register = function (component) { + var tagId = readOrTag(component); + if (hasNonNullableKey(components, tagId)) { + failOnDuplicate(component, tagId); + } + var extraArgs = [component]; + events.registerId(extraArgs, tagId, component.events); + components[tagId] = component; + }; + var unregister = function (component) { + read$1(component.element).each(function (tagId) { + delete components[tagId]; + events.unregisterId(tagId); + }); + }; + var filter = function (type) { + return events.filterByType(type); + }; + var find = function (isAboveRoot, type, target) { + return events.find(isAboveRoot, type, target); + }; + var getById = function (id) { + return get$1(components, id); + }; + return { + find: find, + filter: filter, + register: register, + unregister: unregister, + getById: getById + }; } var factory$3 = function (detail) { - var _a = detail.dom, attributes = _a.attributes, domWithoutAttributes = __rest(_a, ['attributes']); - return { - uid: detail.uid, - dom: __assign({ - tag: 'div', - attributes: __assign({role: 'presentation'}, attributes) - }, domWithoutAttributes), - components: detail.components, - behaviours: get$d(detail.containerBehaviours), - events: detail.events, - domModification: detail.domModification, - eventOrder: detail.eventOrder - }; + var _a = detail.dom, attributes = _a.attributes, domWithoutAttributes = __rest(_a, ['attributes']); + return { + uid: detail.uid, + dom: __assign({ + tag: 'div', + attributes: __assign({ role: 'presentation' }, attributes) + }, domWithoutAttributes), + components: detail.components, + behaviours: get$d(detail.containerBehaviours), + events: detail.events, + domModification: detail.domModification, + eventOrder: detail.eventOrder + }; }; var Container = single$2({ - name: 'Container', - factory: factory$3, - configFields: [ - defaulted$1('components', []), - field$1('containerBehaviours', []), - defaulted$1('events', {}), - defaulted$1('domModification', {}), - defaulted$1('eventOrder', {}) - ] + name: 'Container', + factory: factory$3, + configFields: [ + defaulted$1('components', []), + field$1('containerBehaviours', []), + defaulted$1('events', {}), + defaulted$1('domModification', {}), + defaulted$1('eventOrder', {}) + ] }); var takeover = function (root) { - var isAboveRoot = function (el) { - return parent(root.element).fold(function () { - return true; - }, function (parent) { - return eq$1(el, parent); - }); - }; - var registry = Registry(); - var lookup = function (eventName, target) { - return registry.find(isAboveRoot, eventName, target); - }; - var domEvents = setup$1(root.element, { - triggerEvent: function (eventName, event) { - return monitorEvent(eventName, event.target, function (logger) { - return triggerUntilStopped(lookup, eventName, event, logger); - }); - } - }); - var systemApi = { - debugInfo: constant('real'), - triggerEvent: function (eventName, target, data) { - monitorEvent(eventName, target, function (logger) { - return triggerOnUntilStopped(lookup, eventName, data, target, logger); - }); - }, - triggerFocus: function (target, originator) { - read$1(target).fold(function () { - focus$1(target); - }, function (_alloyId) { - monitorEvent(focus(), target, function (logger) { - triggerHandler(lookup, focus(), { - originator: originator, - kill: noop, - prevent: noop, - target: target - }, target, logger); - return false; - }); - }); - }, - triggerEscape: function (comp, simulatedEvent) { - systemApi.triggerEvent('keydown', comp.element, simulatedEvent.event); - }, - getByUid: function (uid) { - return getByUid(uid); - }, - getByDom: function (elem) { - return getByDom(elem); - }, - build: build$1, - addToGui: function (c) { - add(c); - }, - removeFromGui: function (c) { - remove$1(c); - }, - addToWorld: function (c) { - addToWorld(c); - }, - removeFromWorld: function (c) { - removeFromWorld(c); - }, - broadcast: function (message) { - broadcast$1(message); - }, - broadcastOn: function (channels, message) { - broadcastOn(channels, message); - }, - broadcastEvent: function (eventName, event) { - broadcastEvent(eventName, event); - }, - isConnected: always - }; - var addToWorld = function (component) { - component.connect(systemApi); - if (!isText(component.element)) { - registry.register(component); - each(component.components(), addToWorld); - systemApi.triggerEvent(systemInit(), component.element, {target: component.element}); - } - }; - var removeFromWorld = function (component) { - if (!isText(component.element)) { - each(component.components(), removeFromWorld); - registry.unregister(component); - } - component.disconnect(); - }; - var add = function (component) { - attach$1(root, component); - }; - var remove$1 = function (component) { - detach(component); - }; - var destroy = function () { - domEvents.unbind(); - remove(root.element); - }; - var broadcastData = function (data) { - var receivers = registry.filter(receive()); - each(receivers, function (receiver) { - var descHandler = receiver.descHandler; - var handler = getCurried(descHandler); - handler(data); - }); - }; - var broadcast$1 = function (message) { - broadcastData({ - universal: true, - data: message - }); - }; - var broadcastOn = function (channels, message) { - broadcastData({ - universal: false, - channels: channels, - data: message - }); - }; - var broadcastEvent = function (eventName, event) { - var listeners = registry.filter(eventName); - return broadcast(listeners, event); - }; - var getByUid = function (uid) { - return registry.getById(uid).fold(function () { - return Result.error(new Error('Could not find component with uid: "' + uid + '" in system.')); - }, Result.value); - }; - var getByDom = function (elem) { - var uid = read$1(elem).getOr('not found'); - return getByUid(uid); - }; - addToWorld(root); - return { - root: root, - element: root.element, - destroy: destroy, - add: add, - remove: remove$1, - getByUid: getByUid, - getByDom: getByDom, - addToWorld: addToWorld, - removeFromWorld: removeFromWorld, - broadcast: broadcast$1, - broadcastOn: broadcastOn, - broadcastEvent: broadcastEvent - }; - }; + var isAboveRoot = function (el) { + return parent(root.element).fold(function () { + return true; + }, function (parent) { + return eq$1(el, parent); + }); + }; + var registry = Registry(); + var lookup = function (eventName, target) { + return registry.find(isAboveRoot, eventName, target); + }; + var domEvents = setup$1(root.element, { + triggerEvent: function (eventName, event) { + return monitorEvent(eventName, event.target, function (logger) { + return triggerUntilStopped(lookup, eventName, event, logger); + }); + } + }); + var systemApi = { + debugInfo: constant('real'), + triggerEvent: function (eventName, target, data) { + monitorEvent(eventName, target, function (logger) { + return triggerOnUntilStopped(lookup, eventName, data, target, logger); + }); + }, + triggerFocus: function (target, originator) { + read$1(target).fold(function () { + focus$1(target); + }, function (_alloyId) { + monitorEvent(focus(), target, function (logger) { + triggerHandler(lookup, focus(), { + originator: originator, + kill: noop, + prevent: noop, + target: target + }, target, logger); + return false; + }); + }); + }, + triggerEscape: function (comp, simulatedEvent) { + systemApi.triggerEvent('keydown', comp.element, simulatedEvent.event); + }, + getByUid: function (uid) { + return getByUid(uid); + }, + getByDom: function (elem) { + return getByDom(elem); + }, + build: build$1, + addToGui: function (c) { + add(c); + }, + removeFromGui: function (c) { + remove$1(c); + }, + addToWorld: function (c) { + addToWorld(c); + }, + removeFromWorld: function (c) { + removeFromWorld(c); + }, + broadcast: function (message) { + broadcast$1(message); + }, + broadcastOn: function (channels, message) { + broadcastOn(channels, message); + }, + broadcastEvent: function (eventName, event) { + broadcastEvent(eventName, event); + }, + isConnected: always + }; + var addToWorld = function (component) { + component.connect(systemApi); + if (!isText(component.element)) { + registry.register(component); + each(component.components(), addToWorld); + systemApi.triggerEvent(systemInit(), component.element, { target: component.element }); + } + }; + var removeFromWorld = function (component) { + if (!isText(component.element)) { + each(component.components(), removeFromWorld); + registry.unregister(component); + } + component.disconnect(); + }; + var add = function (component) { + attach$1(root, component); + }; + var remove$1 = function (component) { + detach(component); + }; + var destroy = function () { + domEvents.unbind(); + remove(root.element); + }; + var broadcastData = function (data) { + var receivers = registry.filter(receive()); + each(receivers, function (receiver) { + var descHandler = receiver.descHandler; + var handler = getCurried(descHandler); + handler(data); + }); + }; + var broadcast$1 = function (message) { + broadcastData({ + universal: true, + data: message + }); + }; + var broadcastOn = function (channels, message) { + broadcastData({ + universal: false, + channels: channels, + data: message + }); + }; + var broadcastEvent = function (eventName, event) { + var listeners = registry.filter(eventName); + return broadcast(listeners, event); + }; + var getByUid = function (uid) { + return registry.getById(uid).fold(function () { + return Result.error(new Error('Could not find component with uid: "' + uid + '" in system.')); + }, Result.value); + }; + var getByDom = function (elem) { + var uid = read$1(elem).getOr('not found'); + return getByUid(uid); + }; + addToWorld(root); + return { + root: root, + element: root.element, + destroy: destroy, + add: add, + remove: remove$1, + getByUid: getByUid, + getByDom: getByDom, + addToWorld: addToWorld, + removeFromWorld: removeFromWorld, + broadcast: broadcast$1, + broadcastOn: broadcastOn, + broadcastEvent: broadcastEvent + }; + }; var renderBar = function (spec, backstage) { - return { - dom: { - tag: 'div', - classes: [ - 'tox-bar', - 'tox-form__controls-h-stack' - ] - }, - components: map(spec.items, backstage.interpreter) - }; + return { + dom: { + tag: 'div', + classes: [ + 'tox-bar', + 'tox-form__controls-h-stack' + ] + }, + components: map(spec.items, backstage.interpreter) + }; }; var schema$e = constant([ - defaulted$1('prefix', 'form-field'), - field$1('fieldBehaviours', [ - Composing, - Representing - ]) + defaulted$1('prefix', 'form-field'), + field$1('fieldBehaviours', [ + Composing, + Representing + ]) ]); var parts$3 = constant([ - optional({ - schema: [strict$1('dom')], - name: 'label' - }), - optional({ - factory: { - sketch: function (spec) { - return { - uid: spec.uid, - dom: { - tag: 'span', - styles: {display: 'none'}, - attributes: {'aria-hidden': 'true'}, - innerHtml: spec.text - } - }; - } - }, - schema: [strict$1('text')], - name: 'aria-descriptor' - }), - required({ - factory: { - sketch: function (spec) { - var excludeFactory = exclude$1(spec, ['factory']); - return spec.factory.sketch(excludeFactory); - } - }, - schema: [strict$1('factory')], - name: 'field' - }) + optional({ + schema: [strict$1('dom')], + name: 'label' + }), + optional({ + factory: { + sketch: function (spec) { + return { + uid: spec.uid, + dom: { + tag: 'span', + styles: { display: 'none' }, + attributes: { 'aria-hidden': 'true' }, + innerHtml: spec.text + } + }; + } + }, + schema: [strict$1('text')], + name: 'aria-descriptor' + }), + required({ + factory: { + sketch: function (spec) { + var excludeFactory = exclude$1(spec, ['factory']); + return spec.factory.sketch(excludeFactory); + } + }, + schema: [strict$1('factory')], + name: 'field' + }) ]); var factory$4 = function (detail, components, _spec, _externals) { - var behaviours = augment(detail.fieldBehaviours, [ - Composing.config({ - find: function (container) { - return getPart(container, detail, 'field'); - } - }), - Representing.config({ - store: { - mode: 'manual', - getValue: function (field) { - return Composing.getCurrent(field).bind(Representing.getValue); - }, - setValue: function (field, value) { - Composing.getCurrent(field).each(function (current) { - Representing.setValue(current, value); - }); - } - } - }) - ]); - var events = derive([runOnAttached(function (component, _simulatedEvent) { - var ps = getParts(component, detail, [ - 'label', - 'field', - 'aria-descriptor' - ]); - ps.field().each(function (field) { - var id = generate$1(detail.prefix); - ps.label().each(function (label) { - set$1(label.element, 'for', id); - set$1(field.element, 'id', id); - }); - ps['aria-descriptor']().each(function (descriptor) { - var descriptorId = generate$1(detail.prefix); - set$1(descriptor.element, 'id', descriptorId); - set$1(field.element, 'aria-describedby', descriptorId); - }); - }); + var behaviours = augment(detail.fieldBehaviours, [ + Composing.config({ + find: function (container) { + return getPart(container, detail, 'field'); + } + }), + Representing.config({ + store: { + mode: 'manual', + getValue: function (field) { + return Composing.getCurrent(field).bind(Representing.getValue); + }, + setValue: function (field, value) { + Composing.getCurrent(field).each(function (current) { + Representing.setValue(current, value); + }); + } + } + }) + ]); + var events = derive([runOnAttached(function (component, _simulatedEvent) { + var ps = getParts(component, detail, [ + 'label', + 'field', + 'aria-descriptor' + ]); + ps.field().each(function (field) { + var id = generate$1(detail.prefix); + ps.label().each(function (label) { + set$1(label.element, 'for', id); + set$1(field.element, 'id', id); + }); + ps['aria-descriptor']().each(function (descriptor) { + var descriptorId = generate$1(detail.prefix); + set$1(descriptor.element, 'id', descriptorId); + set$1(field.element, 'aria-describedby', descriptorId); + }); + }); })]); - var apis = { - getField: function (container) { - return getPart(container, detail, 'field'); - }, - getLabel: function (container) { - return getPart(container, detail, 'label'); - } - }; - return { - uid: detail.uid, - dom: detail.dom, - components: components, - behaviours: behaviours, - events: events, - apis: apis - }; + var apis = { + getField: function (container) { + return getPart(container, detail, 'field'); + }, + getLabel: function (container) { + return getPart(container, detail, 'label'); + } + }; + return { + uid: detail.uid, + dom: detail.dom, + components: components, + behaviours: behaviours, + events: events, + apis: apis + }; }; var FormField = composite$1({ - name: 'FormField', - configFields: schema$e(), - partFields: parts$3(), - factory: factory$4, - apis: { - getField: function (apis, comp) { - return apis.getField(comp); - }, - getLabel: function (apis, comp) { - return apis.getLabel(comp); - } + name: 'FormField', + configFields: schema$e(), + partFields: parts$3(), + factory: factory$4, + apis: { + getField: function (apis, comp) { + return apis.getField(comp); + }, + getLabel: function (apis, comp) { + return apis.getLabel(comp); } + } }); var exhibit$4 = function (base, tabConfig) { - return nu$6({ - attributes: wrapAll$1([{ - key: tabConfig.tabAttr, - value: 'true' - }]) - }); + return nu$6({ + attributes: wrapAll$1([{ + key: tabConfig.tabAttr, + value: 'true' + }]) + }); }; var ActiveTabstopping = /*#__PURE__*/Object.freeze({ @@ -13276,44 +13267,44 @@ var TabstopSchema = [defaulted$1('tabAttr', 'data-alloy-tabstop')]; var Tabstopping = create$1({ - fields: TabstopSchema, - name: 'tabstopping', - active: ActiveTabstopping + fields: TabstopSchema, + name: 'tabstopping', + active: ActiveTabstopping }); var global$a = tinymce.util.Tools.resolve('tinymce.html.Entities'); var renderFormFieldWith = function (pLabel, pField, extraClasses, extraBehaviours) { - var spec = renderFormFieldSpecWith(pLabel, pField, extraClasses, extraBehaviours); - return FormField.sketch(spec); + var spec = renderFormFieldSpecWith(pLabel, pField, extraClasses, extraBehaviours); + return FormField.sketch(spec); }; var renderFormField = function (pLabel, pField) { - return renderFormFieldWith(pLabel, pField, [], []); + return renderFormFieldWith(pLabel, pField, [], []); }; var renderFormFieldSpecWith = function (pLabel, pField, extraClasses, extraBehaviours) { - return { - dom: renderFormFieldDomWith(extraClasses), - components: pLabel.toArray().concat([pField]), - fieldBehaviours: derive$1(extraBehaviours) - }; + return { + dom: renderFormFieldDomWith(extraClasses), + components: pLabel.toArray().concat([pField]), + fieldBehaviours: derive$1(extraBehaviours) + }; }; var renderFormFieldDom = function () { - return renderFormFieldDomWith([]); + return renderFormFieldDomWith([]); }; var renderFormFieldDomWith = function (extraClasses) { - return { - tag: 'div', - classes: ['tox-form__group'].concat(extraClasses) - }; + return { + tag: 'div', + classes: ['tox-form__group'].concat(extraClasses) + }; }; var renderLabel = function (label, providersBackstage) { - return FormField.parts.label({ - dom: { - tag: 'label', - classes: ['tox-label'], - innerHtml: providersBackstage.translate(label) - } - }); + return FormField.parts.label({ + dom: { + tag: 'label', + classes: ['tox-label'], + innerHtml: providersBackstage.translate(label) + } + }); }; var formChangeEvent = generate$1('form-component-change'); @@ -13327,904 +13318,875 @@ var formResizeEvent = generate$1('form-resize'); var renderCollection = function (spec, providersBackstage) { - var _a; - var pLabel = spec.label.map(function (label) { - return renderLabel(label, providersBackstage); - }); - var runOnItem = function (f) { - return function (comp, se) { - closest$3(se.event.target, '[data-collection-item-value]').each(function (target) { - f(comp, se, target, get$3(target, 'data-collection-item-value')); - }); - }; - }; - var setContents = function (comp, items) { - var htmlLines = map(items, function (item) { - var itemText = global$6.translate(item.text); - var textContent = spec.columns === 1 ? '
              ' + itemText + '
              ' : ''; - var iconContent = '
              ' + item.icon + '
              '; - var mapItemName = { - '_': ' ', - ' - ': ' ', - '-': ' ' - }; - var ariaLabel = itemText.replace(/\_| \- |\-/g, function (match) { - return mapItemName[match]; - }); - var disabledClass = providersBackstage.isDisabled() ? ' tox-collection__item--state-disabled' : ''; - return '
              ' + iconContent + textContent + '
              '; - }); - var chunks = spec.columns !== 'auto' && spec.columns > 1 ? chunk(htmlLines, spec.columns) : [htmlLines]; - var html = map(chunks, function (ch) { - return '
              ' + ch.join('') + '
              '; - }); - set(comp.element, html.join('')); - }; - var onClick = runOnItem(function (comp, se, tgt, itemValue) { - se.stop(); - if (!providersBackstage.isDisabled()) { - emitWith(comp, formActionEvent, { - name: spec.name, - value: itemValue + var _a; + var pLabel = spec.label.map(function (label) { + return renderLabel(label, providersBackstage); + }); + var runOnItem = function (f) { + return function (comp, se) { + closest$3(se.event.target, '[data-collection-item-value]').each(function (target) { + f(comp, se, target, get$3(target, 'data-collection-item-value')); + }); + }; + }; + var setContents = function (comp, items) { + var htmlLines = map(items, function (item) { + var itemText = global$6.translate(item.text); + var textContent = spec.columns === 1 ? '
              ' + itemText + '
              ' : ''; + var iconContent = '
              ' + item.icon + '
              '; + var mapItemName = { + '_': ' ', + ' - ': ' ', + '-': ' ' + }; + var ariaLabel = itemText.replace(/\_| \- |\-/g, function (match) { + return mapItemName[match]; + }); + var disabledClass = providersBackstage.isDisabled() ? ' tox-collection__item--state-disabled' : ''; + return '
              ' + iconContent + textContent + '
              '; + }); + var chunks = spec.columns !== 'auto' && spec.columns > 1 ? chunk(htmlLines, spec.columns) : [htmlLines]; + var html = map(chunks, function (ch) { + return '
              ' + ch.join('') + '
              '; + }); + set(comp.element, html.join('')); + }; + var onClick = runOnItem(function (comp, se, tgt, itemValue) { + se.stop(); + if (!providersBackstage.isDisabled()) { + emitWith(comp, formActionEvent, { + name: spec.name, + value: itemValue + }); + } + }); + var collectionEvents = [ + run(mouseover(), runOnItem(function (comp, se, tgt) { + focus$1(tgt); + })), + run(click(), onClick), + run(tap(), onClick), + run(focusin(), runOnItem(function (comp, se, tgt) { + descendant$1(comp.element, '.' + activeClass).each(function (currentActive) { + remove$4(currentActive, activeClass); + }); + add$2(tgt, activeClass); + })), + run(focusout(), runOnItem(function (comp) { + descendant$1(comp.element, '.' + activeClass).each(function (currentActive) { + remove$4(currentActive, activeClass); + }); + })), + runOnExecute(runOnItem(function (comp, se, tgt, itemValue) { + emitWith(comp, formActionEvent, { + name: spec.name, + value: itemValue + }); + })) + ]; + var iterCollectionItems = function (comp, applyAttributes) { + return map(descendants(comp.element, '.tox-collection__item'), applyAttributes); + }; + var pField = FormField.parts.field({ + dom: { + tag: 'div', + classes: ['tox-collection'].concat(spec.columns !== 1 ? ['tox-collection--grid'] : ['tox-collection--list']) + }, + components: [], + factory: { sketch: identity }, + behaviours: derive$1([ + Disabling.config({ + disabled: providersBackstage.isDisabled, + onDisabled: function (comp) { + iterCollectionItems(comp, function (childElm) { + add$2(childElm, 'tox-collection__item--state-disabled'); + set$1(childElm, 'aria-disabled', true); + }); + }, + onEnabled: function (comp) { + iterCollectionItems(comp, function (childElm) { + remove$4(childElm, 'tox-collection__item--state-disabled'); + remove$1(childElm, 'aria-disabled'); + }); + } + }), + receivingConfig(), + Replacing.config({}), + Representing.config({ + store: { + mode: 'memory', + initialValue: [] + }, + onSetValue: function (comp, items) { + setContents(comp, items); + if (spec.columns === 'auto') { + detectSize(comp, 5, 'tox-collection__item').each(function (_a) { + var numRows = _a.numRows, numColumns = _a.numColumns; + Keying.setGridSize(comp, numRows, numColumns); }); + } + emit(comp, formResizeEvent); } - }); - var collectionEvents = [ - run(mouseover(), runOnItem(function (comp, se, tgt) { - focus$1(tgt); - })), - run(click(), onClick), - run(tap(), onClick), - run(focusin(), runOnItem(function (comp, se, tgt) { - descendant$1(comp.element, '.' + activeClass).each(function (currentActive) { - remove$4(currentActive, activeClass); - }); - add$2(tgt, activeClass); - })), - run(focusout(), runOnItem(function (comp) { - descendant$1(comp.element, '.' + activeClass).each(function (currentActive) { - remove$4(currentActive, activeClass); - }); - })), - runOnExecute(runOnItem(function (comp, se, tgt, itemValue) { - emitWith(comp, formActionEvent, { - name: spec.name, - value: itemValue - }); - })) - ]; - var iterCollectionItems = function (comp, applyAttributes) { - return map(descendants(comp.element, '.tox-collection__item'), applyAttributes); - }; - var pField = FormField.parts.field({ - dom: { - tag: 'div', - classes: ['tox-collection'].concat(spec.columns !== 1 ? ['tox-collection--grid'] : ['tox-collection--list']) - }, - components: [], - factory: {sketch: identity}, - behaviours: derive$1([ - Disabling.config({ - disabled: providersBackstage.isDisabled, - onDisabled: function (comp) { - iterCollectionItems(comp, function (childElm) { - add$2(childElm, 'tox-collection__item--state-disabled'); - set$1(childElm, 'aria-disabled', true); - }); - }, - onEnabled: function (comp) { - iterCollectionItems(comp, function (childElm) { - remove$4(childElm, 'tox-collection__item--state-disabled'); - remove$1(childElm, 'aria-disabled'); - }); - } - }), - receivingConfig(), - Replacing.config({}), - Representing.config({ - store: { - mode: 'memory', - initialValue: [] - }, - onSetValue: function (comp, items) { - setContents(comp, items); - if (spec.columns === 'auto') { - detectSize(comp, 5, 'tox-collection__item').each(function (_a) { - var numRows = _a.numRows, numColumns = _a.numColumns; - Keying.setGridSize(comp, numRows, numColumns); - }); - } - emit(comp, formResizeEvent); - } - }), - Tabstopping.config({}), - Keying.config(deriveCollectionMovement(spec.columns, 'normal')), - config('collection-events', collectionEvents) - ]), - eventOrder: (_a = {}, _a[execute()] = [ - 'disabling', - 'alloy.base.behaviour', - 'collection-events' - ], _a) - }); - var extraClasses = ['tox-form__group--collection']; - return renderFormFieldWith(pLabel, pField, extraClasses, []); + }), + Tabstopping.config({}), + Keying.config(deriveCollectionMovement(spec.columns, 'normal')), + config('collection-events', collectionEvents) + ]), + eventOrder: (_a = {}, _a[execute()] = [ + 'disabling', + 'alloy.base.behaviour', + 'collection-events' + ], _a) + }); + var extraClasses = ['tox-form__group--collection']; + return renderFormFieldWith(pLabel, pField, extraClasses, []); }; var schema$f = constant([ - option('data'), - defaulted$1('inputAttributes', {}), - defaulted$1('inputStyles', {}), - defaulted$1('tag', 'input'), - defaulted$1('inputClasses', []), - onHandler('onSetValue'), - defaulted$1('styles', {}), - defaulted$1('eventOrder', {}), - field$1('inputBehaviours', [ - Representing, - Focusing - ]), - defaulted$1('selectOnFocus', true) + option('data'), + defaulted$1('inputAttributes', {}), + defaulted$1('inputStyles', {}), + defaulted$1('tag', 'input'), + defaulted$1('inputClasses', []), + onHandler('onSetValue'), + defaulted$1('styles', {}), + defaulted$1('eventOrder', {}), + field$1('inputBehaviours', [ + Representing, + Focusing + ]), + defaulted$1('selectOnFocus', true) ]); var focusBehaviours = function (detail) { - return derive$1([Focusing.config({ - onFocus: !detail.selectOnFocus ? noop : function (component) { - var input = component.element; - var value = get$6(input); - input.dom.setSelectionRange(0, value.length); - } + return derive$1([Focusing.config({ + onFocus: !detail.selectOnFocus ? noop : function (component) { + var input = component.element; + var value = get$6(input); + input.dom.setSelectionRange(0, value.length); + } })]); }; var behaviours = function (detail) { - return __assign(__assign({}, focusBehaviours(detail)), augment(detail.inputBehaviours, [Representing.config({ - store: __assign(__assign({mode: 'manual'}, detail.data.map(function (data) { - return {initialValue: data}; - }).getOr({})), { - getValue: function (input) { - return get$6(input.element); - }, - setValue: function (input, data) { - var current = get$6(input.element); - if (current !== data) { - set$3(input.element, data); - } - } - }), - onSetValue: detail.onSetValue + return __assign(__assign({}, focusBehaviours(detail)), augment(detail.inputBehaviours, [Representing.config({ + store: __assign(__assign({ mode: 'manual' }, detail.data.map(function (data) { + return { initialValue: data }; + }).getOr({})), { + getValue: function (input) { + return get$6(input.element); + }, + setValue: function (input, data) { + var current = get$6(input.element); + if (current !== data) { + set$3(input.element, data); + } + } + }), + onSetValue: detail.onSetValue })])); }; var dom$2 = function (detail) { - return { - tag: detail.tag, - attributes: __assign({type: 'text'}, detail.inputAttributes), - styles: detail.inputStyles, - classes: detail.inputClasses - }; + return { + tag: detail.tag, + attributes: __assign({ type: 'text' }, detail.inputAttributes), + styles: detail.inputStyles, + classes: detail.inputClasses + }; }; var factory$5 = function (detail, _spec) { - return { - uid: detail.uid, - dom: dom$2(detail), - components: [], - behaviours: behaviours(detail), - eventOrder: detail.eventOrder - }; + return { + uid: detail.uid, + dom: dom$2(detail), + components: [], + behaviours: behaviours(detail), + eventOrder: detail.eventOrder + }; }; var Input = single$2({ - name: 'Input', - configFields: schema$f(), - factory: factory$5 + name: 'Input', + configFields: schema$f(), + factory: factory$5 }); - var exports$1 = {}, module = {exports: exports$1}; + var exports$1 = {}, module = { exports: exports$1 }; (function (define, exports, module, require) { - (function (f) { - if (typeof exports === 'object' && typeof module !== 'undefined') { - module.exports = f(); - } else if (typeof define === 'function' && define.amd) { - define([], f); - } else { - var g; - if (typeof window !== 'undefined') { - g = window; - } else if (typeof global !== 'undefined') { - g = global; - } else if (typeof self !== 'undefined') { - g = self; + (function (f) { + if (typeof exports === 'object' && typeof module !== 'undefined') { + module.exports = f(); + } else if (typeof define === 'function' && define.amd) { + define([], f); + } else { + var g; + if (typeof window !== 'undefined') { + g = window; + } else if (typeof global !== 'undefined') { + g = global; + } else if (typeof self !== 'undefined') { + g = self; + } else { + g = this; + } + g.EphoxContactWrapper = f(); + } + }(function () { + return function () { + function r(e, n, t) { + function o(i, f) { + if (!n[i]) { + if (!e[i]) { + var c = 'function' == typeof require && require; + if (!f && c) + return c(i, !0); + if (u) + return u(i, !0); + var a = new Error('Cannot find module \'' + i + '\''); + throw a.code = 'MODULE_NOT_FOUND', a; + } + var p = n[i] = { exports: {} }; + e[i][0].call(p.exports, function (r) { + var n = e[i][1][r]; + return o(n || r); + }, p, p.exports, r, e, n, t); + } + return n[i].exports; + } + for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++) + o(t[i]); + return o; + } + return r; + }()({ + 1: [ + function (require, module, exports) { + var process = module.exports = {}; + var cachedSetTimeout; + var cachedClearTimeout; + function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); + } + function defaultClearTimeout() { + throw new Error('clearTimeout has not been defined'); + } + (function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } + }()); + function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + return setTimeout(fun, 0); + } + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + return cachedSetTimeout(fun, 0); + } catch (e) { + try { + return cachedSetTimeout.call(null, fun, 0); + } catch (e) { + return cachedSetTimeout.call(this, fun, 0); + } + } + } + function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + return clearTimeout(marker); + } + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + return cachedClearTimeout(marker); + } catch (e) { + try { + return cachedClearTimeout.call(null, marker); + } catch (e) { + return cachedClearTimeout.call(this, marker); + } + } + } + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); } else { - g = this; + queueIndex = -1; } - g.EphoxContactWrapper = f(); - } - }(function () { - return function () { - function r(e, n, t) { - function o(i, f) { - if (!n[i]) { - if (!e[i]) { - var c = 'function' == typeof require && require; - if (!f && c) - return c(i, !0); - if (u) - return u(i, !0); - var a = new Error('Cannot find module \'' + i + '\''); - throw a.code = 'MODULE_NOT_FOUND', a; - } - var p = n[i] = {exports: {}}; - e[i][0].call(p.exports, function (r) { - var n = e[i][1][r]; - return o(n || r); - }, p, p.exports, r, e, n, t); - } - return n[i].exports; + if (queue.length) { + drainQueue(); + } + } + function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + var len = queue.length; + while (len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); } - - for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++) - o(t[i]); - return o; + } + queueIndex = -1; + len = queue.length; } - - return r; - }()({ - 1: [ - function (require, module, exports) { - var process = module.exports = {}; - var cachedSetTimeout; - var cachedClearTimeout; - - function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); - } - - function defaultClearTimeout() { - throw new Error('clearTimeout has not been defined'); - } - - (function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } - }()); - - function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - return setTimeout(fun, 0); - } - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - return cachedSetTimeout(fun, 0); - } catch (e) { - try { - return cachedSetTimeout.call(null, fun, 0); - } catch (e) { - return cachedSetTimeout.call(this, fun, 0); - } - } - } - - function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - return clearTimeout(marker); - } - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - return cachedClearTimeout(marker); - } catch (e) { - try { - return cachedClearTimeout.call(null, marker); - } catch (e) { - return cachedClearTimeout.call(this, marker); - } - } - } - - var queue = []; - var draining = false; - var currentQueue; - var queueIndex = -1; - - function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } + currentQueue = null; + draining = false; + runClearTimeout(timeout); + } + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } + }; + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; + process.versions = {}; + function noop() { + } + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + process.prependListener = noop; + process.prependOnceListener = noop; + process.listeners = function (name) { + return []; + }; + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + process.cwd = function () { + return '/'; + }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function () { + return 0; + }; + }, + {} + ], + 2: [ + function (require, module, exports) { + (function (setImmediate) { + (function (root) { + var setTimeoutFunc = setTimeout; + function noop() { + } + function bind(fn, thisArg) { + return function () { + fn.apply(thisArg, arguments); + }; + } + function Promise(fn) { + if (typeof this !== 'object') + throw new TypeError('Promises must be constructed via new'); + if (typeof fn !== 'function') + throw new TypeError('not a function'); + this._state = 0; + this._handled = false; + this._value = undefined; + this._deferreds = []; + doResolve(fn, this); + } + function handle(self, deferred) { + while (self._state === 3) { + self = self._value; + } + if (self._state === 0) { + self._deferreds.push(deferred); + return; + } + self._handled = true; + Promise._immediateFn(function () { + var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (self._state === 1 ? resolve : reject)(deferred.promise, self._value); + return; + } + var ret; + try { + ret = cb(self._value); + } catch (e) { + reject(deferred.promise, e); + return; + } + resolve(deferred.promise, ret); + }); + } + function resolve(self, newValue) { + try { + if (newValue === self) + throw new TypeError('A promise cannot be resolved with itself.'); + if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { + var then = newValue.then; + if (newValue instanceof Promise) { + self._state = 3; + self._value = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(bind(then, newValue), self); + return; } - - function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - var len = queue.length; - while (len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); + } + self._state = 1; + self._value = newValue; + finale(self); + } catch (e) { + reject(self, e); + } + } + function reject(self, newValue) { + self._state = 2; + self._value = newValue; + finale(self); + } + function finale(self) { + if (self._state === 2 && self._deferreds.length === 0) { + Promise._immediateFn(function () { + if (!self._handled) { + Promise._unhandledRejectionFn(self._value); } - - process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); + }); + } + for (var i = 0, len = self._deferreds.length; i < len; i++) { + handle(self, self._deferreds[i]); + } + self._deferreds = null; + } + function Handler(onFulfilled, onRejected, promise) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; + } + function doResolve(fn, self) { + var done = false; + try { + fn(function (value) { + if (done) + return; + done = true; + resolve(self, value); + }, function (reason) { + if (done) + return; + done = true; + reject(self, reason); + }); + } catch (ex) { + if (done) + return; + done = true; + reject(self, ex); + } + } + Promise.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); + }; + Promise.prototype.then = function (onFulfilled, onRejected) { + var prom = new this.constructor(noop); + handle(this, new Handler(onFulfilled, onRejected, prom)); + return prom; + }; + Promise.all = function (arr) { + var args = Array.prototype.slice.call(arr); + return new Promise(function (resolve, reject) { + if (args.length === 0) + return resolve([]); + var remaining = args.length; + function res(i, val) { + try { + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call(val, function (val) { + res(i, val); + }, reject); + return; } - }; - - function Item(fun, array) { - this.fun = fun; - this.array = array; - } - - Item.prototype.run = function () { - this.fun.apply(null, this.array); - }; - process.title = 'browser'; - process.browser = true; - process.env = {}; - process.argv = []; - process.version = ''; - process.versions = {}; - - function noop() { + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); } - - process.on = noop; - process.addListener = noop; - process.once = noop; - process.off = noop; - process.removeListener = noop; - process.removeAllListeners = noop; - process.emit = noop; - process.prependListener = noop; - process.prependOnceListener = noop; - process.listeners = function (name) { - return []; - }; - process.binding = function (name) { - throw new Error('process.binding is not supported'); - }; - process.cwd = function () { - return '/'; - }; - process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); - }; - process.umask = function () { - return 0; - }; - }, - {} - ], - 2: [ - function (require, module, exports) { - (function (setImmediate) { - (function (root) { - var setTimeoutFunc = setTimeout; - - function noop() { - } - - function bind(fn, thisArg) { - return function () { - fn.apply(thisArg, arguments); - }; - } - - function Promise(fn) { - if (typeof this !== 'object') - throw new TypeError('Promises must be constructed via new'); - if (typeof fn !== 'function') - throw new TypeError('not a function'); - this._state = 0; - this._handled = false; - this._value = undefined; - this._deferreds = []; - doResolve(fn, this); - } - - function handle(self, deferred) { - while (self._state === 3) { - self = self._value; - } - if (self._state === 0) { - self._deferreds.push(deferred); - return; - } - self._handled = true; - Promise._immediateFn(function () { - var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; - if (cb === null) { - (self._state === 1 ? resolve : reject)(deferred.promise, self._value); - return; - } - var ret; - try { - ret = cb(self._value); - } catch (e) { - reject(deferred.promise, e); - return; - } - resolve(deferred.promise, ret); - }); - } - - function resolve(self, newValue) { - try { - if (newValue === self) - throw new TypeError('A promise cannot be resolved with itself.'); - if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { - var then = newValue.then; - if (newValue instanceof Promise) { - self._state = 3; - self._value = newValue; - finale(self); - return; - } else if (typeof then === 'function') { - doResolve(bind(then, newValue), self); - return; - } - } - self._state = 1; - self._value = newValue; - finale(self); - } catch (e) { - reject(self, e); - } - } - - function reject(self, newValue) { - self._state = 2; - self._value = newValue; - finale(self); - } - - function finale(self) { - if (self._state === 2 && self._deferreds.length === 0) { - Promise._immediateFn(function () { - if (!self._handled) { - Promise._unhandledRejectionFn(self._value); - } - }); - } - for (var i = 0, len = self._deferreds.length; i < len; i++) { - handle(self, self._deferreds[i]); - } - self._deferreds = null; - } - - function Handler(onFulfilled, onRejected, promise) { - this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; - this.onRejected = typeof onRejected === 'function' ? onRejected : null; - this.promise = promise; - } - - function doResolve(fn, self) { - var done = false; - try { - fn(function (value) { - if (done) - return; - done = true; - resolve(self, value); - }, function (reason) { - if (done) - return; - done = true; - reject(self, reason); - }); - } catch (ex) { - if (done) - return; - done = true; - reject(self, ex); - } - } - - Promise.prototype['catch'] = function (onRejected) { - return this.then(null, onRejected); - }; - Promise.prototype.then = function (onFulfilled, onRejected) { - var prom = new this.constructor(noop); - handle(this, new Handler(onFulfilled, onRejected, prom)); - return prom; - }; - Promise.all = function (arr) { - var args = Array.prototype.slice.call(arr); - return new Promise(function (resolve, reject) { - if (args.length === 0) - return resolve([]); - var remaining = args.length; - - function res(i, val) { - try { - if (val && (typeof val === 'object' || typeof val === 'function')) { - var then = val.then; - if (typeof then === 'function') { - then.call(val, function (val) { - res(i, val); - }, reject); - return; - } - } - args[i] = val; - if (--remaining === 0) { - resolve(args); - } - } catch (ex) { - reject(ex); - } - } - - for (var i = 0; i < args.length; i++) { - res(i, args[i]); - } - }); - }; - Promise.resolve = function (value) { - if (value && typeof value === 'object' && value.constructor === Promise) { - return value; - } - return new Promise(function (resolve) { - resolve(value); - }); - }; - Promise.reject = function (value) { - return new Promise(function (resolve, reject) { - reject(value); - }); - }; - Promise.race = function (values) { - return new Promise(function (resolve, reject) { - for (var i = 0, len = values.length; i < len; i++) { - values[i].then(resolve, reject); - } - }); - }; - Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) { - setImmediate(fn); - } : function (fn) { - setTimeoutFunc(fn, 0); - }; - Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { - if (typeof console !== 'undefined' && console) { - console.warn('Possible Unhandled Promise Rejection:', err); - } - }; - Promise._setImmediateFn = function _setImmediateFn(fn) { - Promise._immediateFn = fn; - }; - Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) { - Promise._unhandledRejectionFn = fn; - }; - if (typeof module !== 'undefined' && module.exports) { - module.exports = Promise; - } else if (!root.Promise) { - root.Promise = Promise; - } - }(this)); - }.call(this, require('timers').setImmediate)); - }, - {'timers': 3} - ], - 3: [ - function (require, module, exports) { - (function (setImmediate, clearImmediate) { - var nextTick = require('process/browser.js').nextTick; - var apply = Function.prototype.apply; - var slice = Array.prototype.slice; - var immediateIds = {}; - var nextImmediateId = 0; - exports.setTimeout = function () { - return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); - }; - exports.setInterval = function () { - return new Timeout(apply.call(setInterval, window, arguments), clearInterval); - }; - exports.clearTimeout = exports.clearInterval = function (timeout) { - timeout.close(); - }; - - function Timeout(id, clearFn) { - this._id = id; - this._clearFn = clearFn; - } - - Timeout.prototype.unref = Timeout.prototype.ref = function () { - }; - Timeout.prototype.close = function () { - this._clearFn.call(window, this._id); - }; - exports.enroll = function (item, msecs) { - clearTimeout(item._idleTimeoutId); - item._idleTimeout = msecs; - }; - exports.unenroll = function (item) { - clearTimeout(item._idleTimeoutId); - item._idleTimeout = -1; - }; - exports._unrefActive = exports.active = function (item) { - clearTimeout(item._idleTimeoutId); - var msecs = item._idleTimeout; - if (msecs >= 0) { - item._idleTimeoutId = setTimeout(function onTimeout() { - if (item._onTimeout) - item._onTimeout(); - }, msecs); - } - }; - exports.setImmediate = typeof setImmediate === 'function' ? setImmediate : function (fn) { - var id = nextImmediateId++; - var args = arguments.length < 2 ? false : slice.call(arguments, 1); - immediateIds[id] = true; - nextTick(function onNextTick() { - if (immediateIds[id]) { - if (args) { - fn.apply(null, args); - } else { - fn.call(null); - } - exports.clearImmediate(id); - } - }); - return id; - }; - exports.clearImmediate = typeof clearImmediate === 'function' ? clearImmediate : function (id) { - delete immediateIds[id]; - }; - }.call(this, require('timers').setImmediate, require('timers').clearImmediate)); - }, - { - 'process/browser.js': 1, - 'timers': 3 + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; } - ], - 4: [ - function (require, module, exports) { - var promisePolyfill = require('promise-polyfill'); - var Global = function () { - if (typeof window !== 'undefined') { - return window; - } else { - return Function('return this;')(); - } - }(); - module.exports = {boltExport: Global.Promise || promisePolyfill}; - }, - {'promise-polyfill': 2} - ] - }, {}, [4])(4); - })); + return new Promise(function (resolve) { + resolve(value); + }); + }; + Promise.reject = function (value) { + return new Promise(function (resolve, reject) { + reject(value); + }); + }; + Promise.race = function (values) { + return new Promise(function (resolve, reject) { + for (var i = 0, len = values.length; i < len; i++) { + values[i].then(resolve, reject); + } + }); + }; + Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) { + setImmediate(fn); + } : function (fn) { + setTimeoutFunc(fn, 0); + }; + Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { + if (typeof console !== 'undefined' && console) { + console.warn('Possible Unhandled Promise Rejection:', err); + } + }; + Promise._setImmediateFn = function _setImmediateFn(fn) { + Promise._immediateFn = fn; + }; + Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) { + Promise._unhandledRejectionFn = fn; + }; + if (typeof module !== 'undefined' && module.exports) { + module.exports = Promise; + } else if (!root.Promise) { + root.Promise = Promise; + } + }(this)); + }.call(this, require('timers').setImmediate)); + }, + { 'timers': 3 } + ], + 3: [ + function (require, module, exports) { + (function (setImmediate, clearImmediate) { + var nextTick = require('process/browser.js').nextTick; + var apply = Function.prototype.apply; + var slice = Array.prototype.slice; + var immediateIds = {}; + var nextImmediateId = 0; + exports.setTimeout = function () { + return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); + }; + exports.setInterval = function () { + return new Timeout(apply.call(setInterval, window, arguments), clearInterval); + }; + exports.clearTimeout = exports.clearInterval = function (timeout) { + timeout.close(); + }; + function Timeout(id, clearFn) { + this._id = id; + this._clearFn = clearFn; + } + Timeout.prototype.unref = Timeout.prototype.ref = function () { + }; + Timeout.prototype.close = function () { + this._clearFn.call(window, this._id); + }; + exports.enroll = function (item, msecs) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = msecs; + }; + exports.unenroll = function (item) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = -1; + }; + exports._unrefActive = exports.active = function (item) { + clearTimeout(item._idleTimeoutId); + var msecs = item._idleTimeout; + if (msecs >= 0) { + item._idleTimeoutId = setTimeout(function onTimeout() { + if (item._onTimeout) + item._onTimeout(); + }, msecs); + } + }; + exports.setImmediate = typeof setImmediate === 'function' ? setImmediate : function (fn) { + var id = nextImmediateId++; + var args = arguments.length < 2 ? false : slice.call(arguments, 1); + immediateIds[id] = true; + nextTick(function onNextTick() { + if (immediateIds[id]) { + if (args) { + fn.apply(null, args); + } else { + fn.call(null); + } + exports.clearImmediate(id); + } + }); + return id; + }; + exports.clearImmediate = typeof clearImmediate === 'function' ? clearImmediate : function (id) { + delete immediateIds[id]; + }; + }.call(this, require('timers').setImmediate, require('timers').clearImmediate)); + }, + { + 'process/browser.js': 1, + 'timers': 3 + } + ], + 4: [ + function (require, module, exports) { + var promisePolyfill = require('promise-polyfill'); + var Global = function () { + if (typeof window !== 'undefined') { + return window; + } else { + return Function('return this;')(); + } + }(); + module.exports = { boltExport: Global.Promise || promisePolyfill }; + }, + { 'promise-polyfill': 2 } + ] + }, {}, [4])(4); + })); }(undefined, exports$1, module, undefined)); var Promise = module.exports.boltExport; var nu$a = function (baseFn) { - var data = Optional.none(); - var callbacks = []; - var map = function (f) { - return nu$a(function (nCallback) { - get(function (data) { - nCallback(f(data)); - }); - }); - }; - var get = function (nCallback) { - if (isReady()) { - call(nCallback); - } else { - callbacks.push(nCallback); - } - }; - var set = function (x) { - if (!isReady()) { - data = Optional.some(x); - run(callbacks); - callbacks = []; - } - }; - var isReady = function () { - return data.isSome(); - }; - var run = function (cbs) { - each(cbs, call); - }; - var call = function (cb) { - data.each(function (x) { - setTimeout(function () { - cb(x); - }, 0); - }); - }; - baseFn(set); - return { - get: get, - map: map, - isReady: isReady - }; + var data = Optional.none(); + var callbacks = []; + var map = function (f) { + return nu$a(function (nCallback) { + get(function (data) { + nCallback(f(data)); + }); + }); + }; + var get = function (nCallback) { + if (isReady()) { + call(nCallback); + } else { + callbacks.push(nCallback); + } + }; + var set = function (x) { + if (!isReady()) { + data = Optional.some(x); + run(callbacks); + callbacks = []; + } + }; + var isReady = function () { + return data.isSome(); + }; + var run = function (cbs) { + each(cbs, call); + }; + var call = function (cb) { + data.each(function (x) { + setTimeout(function () { + cb(x); + }, 0); + }); + }; + baseFn(set); + return { + get: get, + map: map, + isReady: isReady + }; }; var pure = function (a) { - return nu$a(function (callback) { - callback(a); - }); + return nu$a(function (callback) { + callback(a); + }); }; var LazyValue = { - nu: nu$a, - pure: pure + nu: nu$a, + pure: pure }; var errorReporter = function (err) { - setTimeout(function () { - throw err; - }, 0); + setTimeout(function () { + throw err; + }, 0); }; var make$3 = function (run) { - var get = function (callback) { - run().then(callback, errorReporter); - }; - var map = function (fab) { - return make$3(function () { - return run().then(fab); - }); - }; - var bind = function (aFutureB) { - return make$3(function () { - return run().then(function (v) { - return aFutureB(v).toPromise(); - }); - }); - }; - var anonBind = function (futureB) { - return make$3(function () { - return run().then(function () { - return futureB.toPromise(); - }); - }); - }; - var toLazy = function () { - return LazyValue.nu(get); - }; - var toCached = function () { - var cache = null; - return make$3(function () { - if (cache === null) { - cache = run(); - } - return cache; - }); - }; - var toPromise = run; - return { - map: map, - bind: bind, - anonBind: anonBind, - toLazy: toLazy, - toCached: toCached, - toPromise: toPromise, - get: get - }; - }; - var nu$b = function (baseFn) { + var get = function (callback) { + run().then(callback, errorReporter); + }; + var map = function (fab) { return make$3(function () { - return new Promise(baseFn); + return run().then(fab); }); - }; - var pure$1 = function (a) { + }; + var bind = function (aFutureB) { return make$3(function () { - return Promise.resolve(a); + return run().then(function (v) { + return aFutureB(v).toPromise(); + }); }); + }; + var anonBind = function (futureB) { + return make$3(function () { + return run().then(function () { + return futureB.toPromise(); + }); + }); + }; + var toLazy = function () { + return LazyValue.nu(get); + }; + var toCached = function () { + var cache = null; + return make$3(function () { + if (cache === null) { + cache = run(); + } + return cache; + }); + }; + var toPromise = run; + return { + map: map, + bind: bind, + anonBind: anonBind, + toLazy: toLazy, + toCached: toCached, + toPromise: toPromise, + get: get + }; + }; + var nu$b = function (baseFn) { + return make$3(function () { + return new Promise(baseFn); + }); + }; + var pure$1 = function (a) { + return make$3(function () { + return Promise.resolve(a); + }); }; var Future = { - nu: nu$b, - pure: pure$1 + nu: nu$b, + pure: pure$1 }; var ariaElements = [ - 'input', - 'textarea' + 'input', + 'textarea' ]; var isAriaElement = function (elem) { - var name$1 = name(elem); - return contains(ariaElements, name$1); + var name$1 = name(elem); + return contains(ariaElements, name$1); }; var markValid = function (component, invalidConfig) { - var elem = invalidConfig.getRoot(component).getOr(component.element); - remove$4(elem, invalidConfig.invalidClass); - invalidConfig.notify.each(function (notifyInfo) { - if (isAriaElement(component.element)) { - set$1(component.element, 'aria-invalid', false); - } - notifyInfo.getContainer(component).each(function (container) { - set(container, notifyInfo.validHtml); - }); - notifyInfo.onValid(component); + var elem = invalidConfig.getRoot(component).getOr(component.element); + remove$4(elem, invalidConfig.invalidClass); + invalidConfig.notify.each(function (notifyInfo) { + if (isAriaElement(component.element)) { + set$1(component.element, 'aria-invalid', false); + } + notifyInfo.getContainer(component).each(function (container) { + set(container, notifyInfo.validHtml); }); + notifyInfo.onValid(component); + }); }; var markInvalid = function (component, invalidConfig, invalidState, text) { - var elem = invalidConfig.getRoot(component).getOr(component.element); - add$2(elem, invalidConfig.invalidClass); - invalidConfig.notify.each(function (notifyInfo) { - if (isAriaElement(component.element)) { - set$1(component.element, 'aria-invalid', true); - } - notifyInfo.getContainer(component).each(function (container) { - set(container, text); - }); - notifyInfo.onInvalid(component, text); + var elem = invalidConfig.getRoot(component).getOr(component.element); + add$2(elem, invalidConfig.invalidClass); + invalidConfig.notify.each(function (notifyInfo) { + if (isAriaElement(component.element)) { + set$1(component.element, 'aria-invalid', true); + } + notifyInfo.getContainer(component).each(function (container) { + set(container, text); }); + notifyInfo.onInvalid(component, text); + }); }; var query = function (component, invalidConfig, _invalidState) { - return invalidConfig.validator.fold(function () { - return Future.pure(Result.value(true)); - }, function (validatorInfo) { - return validatorInfo.validate(component); - }); + return invalidConfig.validator.fold(function () { + return Future.pure(Result.value(true)); + }, function (validatorInfo) { + return validatorInfo.validate(component); + }); }; var run$1 = function (component, invalidConfig, invalidState) { - invalidConfig.notify.each(function (notifyInfo) { - notifyInfo.onValidate(component); - }); - return query(component, invalidConfig).map(function (valid) { - if (component.getSystem().isConnected()) { - return valid.fold(function (err) { - markInvalid(component, invalidConfig, invalidState, err); - return Result.error(err); - }, function (v) { - markValid(component, invalidConfig); - return Result.value(v); - }); - } else { - return Result.error('No longer in system'); - } - }); + invalidConfig.notify.each(function (notifyInfo) { + notifyInfo.onValidate(component); + }); + return query(component, invalidConfig).map(function (valid) { + if (component.getSystem().isConnected()) { + return valid.fold(function (err) { + markInvalid(component, invalidConfig, invalidState, err); + return Result.error(err); + }, function (v) { + markValid(component, invalidConfig); + return Result.value(v); + }); + } else { + return Result.error('No longer in system'); + } + }); }; var isInvalid = function (component, invalidConfig) { - var elem = invalidConfig.getRoot(component).getOr(component.element); - return has$2(elem, invalidConfig.invalidClass); + var elem = invalidConfig.getRoot(component).getOr(component.element); + return has$2(elem, invalidConfig.invalidClass); }; var InvalidateApis = /*#__PURE__*/Object.freeze({ @@ -14237,13 +14199,13 @@ }); var events$a = function (invalidConfig, invalidState) { - return invalidConfig.validator.map(function (validatorInfo) { - return derive([run(validatorInfo.onEvent, function (component) { - run$1(component, invalidConfig, invalidState).get(identity); - })].concat(validatorInfo.validateOnLoad ? [runOnAttached(function (component) { - run$1(component, invalidConfig, invalidState).get(noop); - })] : [])); - }).getOr({}); + return invalidConfig.validator.map(function (validatorInfo) { + return derive([run(validatorInfo.onEvent, function (component) { + run$1(component, invalidConfig, invalidState).get(identity); + })].concat(validatorInfo.validateOnLoad ? [runOnAttached(function (component) { + run$1(component, invalidConfig, invalidState).get(noop); + })] : [])); + }).getOr({}); }; var ActiveInvalidate = /*#__PURE__*/Object.freeze({ @@ -14252,40 +14214,40 @@ }); var InvalidateSchema = [ - strict$1('invalidClass'), - defaulted$1('getRoot', Optional.none), - optionObjOf('notify', [ - defaulted$1('aria', 'alert'), - defaulted$1('getContainer', Optional.none), - defaulted$1('validHtml', ''), - onHandler('onValid'), - onHandler('onInvalid'), - onHandler('onValidate') - ]), - optionObjOf('validator', [ - strict$1('validate'), - defaulted$1('onEvent', 'input'), - defaulted$1('validateOnLoad', true) - ]) + strict$1('invalidClass'), + defaulted$1('getRoot', Optional.none), + optionObjOf('notify', [ + defaulted$1('aria', 'alert'), + defaulted$1('getContainer', Optional.none), + defaulted$1('validHtml', ''), + onHandler('onValid'), + onHandler('onInvalid'), + onHandler('onValidate') + ]), + optionObjOf('validator', [ + strict$1('validate'), + defaulted$1('onEvent', 'input'), + defaulted$1('validateOnLoad', true) + ]) ]; var Invalidating = create$1({ - fields: InvalidateSchema, - name: 'invalidating', - active: ActiveInvalidate, - apis: InvalidateApis, - extra: { - validation: function (validator) { - return function (component) { - var v = Representing.getValue(component); - return Future.pure(validator(v)); - }; - } - } + fields: InvalidateSchema, + name: 'invalidating', + active: ActiveInvalidate, + apis: InvalidateApis, + extra: { + validation: function (validator) { + return function (component) { + var v = Representing.getValue(component); + return Future.pure(validator(v)); + }; + } + } }); var getCoupled = function (component, coupleConfig, coupleState, name) { - return coupleState.getOrCreate(component, coupleConfig, name); + return coupleState.getOrCreate(component, coupleConfig, name); }; var CouplingApis = /*#__PURE__*/Object.freeze({ @@ -14296,26 +14258,26 @@ var CouplingSchema = [strictOf('others', setOf$1(Result.value, anyValue$1()))]; var init$5 = function () { - var coupled = {}; - var getOrCreate = function (component, coupleConfig, name) { - var available = keys(coupleConfig.others); - if (!available) { - throw new Error('Cannot find coupled component: ' + name + '. Known coupled components: ' + JSON.stringify(available, null, 2)); - } else { - return get$1(coupled, name).getOrThunk(function () { - var builder = get$1(coupleConfig.others, name).getOrDie('No information found for coupled component: ' + name); - var spec = builder(component); - var built = component.getSystem().build(spec); - coupled[name] = built; - return built; - }); - } - }; - var readState = constant({}); - return nu$5({ - readState: readState, - getOrCreate: getOrCreate - }); + var coupled = {}; + var getOrCreate = function (component, coupleConfig, name) { + var available = keys(coupleConfig.others); + if (!available) { + throw new Error('Cannot find coupled component: ' + name + '. Known coupled components: ' + JSON.stringify(available, null, 2)); + } else { + return get$1(coupled, name).getOrThunk(function () { + var builder = get$1(coupleConfig.others, name).getOrDie('No information found for coupled component: ' + name); + var spec = builder(component); + var built = component.getSystem().build(spec); + coupled[name] = built; + return built; + }); + } + }; + var readState = constant({}); + return nu$5({ + readState: readState, + getOrCreate: getOrCreate + }); }; var CouplingState = /*#__PURE__*/Object.freeze({ @@ -14324,409 +14286,409 @@ }); var Coupling = create$1({ - fields: CouplingSchema, - name: 'coupling', - apis: CouplingApis, - state: CouplingState + fields: CouplingSchema, + name: 'coupling', + apis: CouplingApis, + state: CouplingState }); var suffix = constant('sink'); var partType = constant(optional({ - name: suffix(), - overrides: constant({ - dom: {tag: 'div'}, - behaviours: derive$1([Positioning.config({useFixed: always})]), - events: derive([ - cutter(keydown()), - cutter(mousedown()), - cutter(click()) - ]) - }) + name: suffix(), + overrides: constant({ + dom: { tag: 'div' }, + behaviours: derive$1([Positioning.config({ useFixed: always })]), + events: derive([ + cutter(keydown()), + cutter(mousedown()), + cutter(click()) + ]) + }) })); var HighlightOnOpen; (function (HighlightOnOpen) { - HighlightOnOpen[HighlightOnOpen['HighlightFirst'] = 0] = 'HighlightFirst'; - HighlightOnOpen[HighlightOnOpen['HighlightNone'] = 1] = 'HighlightNone'; + HighlightOnOpen[HighlightOnOpen['HighlightFirst'] = 0] = 'HighlightFirst'; + HighlightOnOpen[HighlightOnOpen['HighlightNone'] = 1] = 'HighlightNone'; }(HighlightOnOpen || (HighlightOnOpen = {}))); var getAnchor = function (detail, component) { - var hotspot = detail.getHotspot(component).getOr(component); - var anchor = 'hotspot'; - var overrides = detail.getAnchorOverrides(); - return detail.layouts.fold(function () { - return { - anchor: anchor, - hotspot: hotspot, - overrides: overrides - }; - }, function (layouts) { - return { - anchor: anchor, - hotspot: hotspot, - overrides: overrides, - layouts: layouts - }; - }); + var hotspot = detail.getHotspot(component).getOr(component); + var anchor = 'hotspot'; + var overrides = detail.getAnchorOverrides(); + return detail.layouts.fold(function () { + return { + anchor: anchor, + hotspot: hotspot, + overrides: overrides + }; + }, function (layouts) { + return { + anchor: anchor, + hotspot: hotspot, + overrides: overrides, + layouts: layouts + }; + }); }; var fetch = function (detail, mapFetch, component) { - var fetcher = detail.fetch; - return fetcher(component).map(mapFetch); + var fetcher = detail.fetch; + return fetcher(component).map(mapFetch); }; var openF = function (detail, mapFetch, anchor, component, sandbox, externals, highlightOnOpen) { - var futureData = fetch(detail, mapFetch, component); - var getLazySink = getSink(component, detail); - return futureData.map(function (tdata) { - return tdata.bind(function (data) { - return Optional.from(tieredMenu.sketch(__assign(__assign({}, externals.menu()), { - uid: generate$2(''), - data: data, - highlightImmediately: highlightOnOpen === HighlightOnOpen.HighlightFirst, - onOpenMenu: function (tmenu, menu) { - var sink = getLazySink().getOrDie(); - Positioning.position(sink, anchor, menu); - Sandboxing.decloak(sandbox); - }, - onOpenSubmenu: function (tmenu, item, submenu) { - var sink = getLazySink().getOrDie(); - Positioning.position(sink, { - anchor: 'submenu', - item: item - }, submenu); - Sandboxing.decloak(sandbox); - }, - onRepositionMenu: function (tmenu, primaryMenu, submenuTriggers) { - var sink = getLazySink().getOrDie(); - Positioning.position(sink, anchor, primaryMenu); - each(submenuTriggers, function (st) { - Positioning.position(sink, { - anchor: 'submenu', - item: st.triggeringItem - }, st.triggeredMenu); - }); - }, - onEscape: function () { - Focusing.focus(component); - Sandboxing.close(sandbox); - return Optional.some(true); - } - }))); - }); + var futureData = fetch(detail, mapFetch, component); + var getLazySink = getSink(component, detail); + return futureData.map(function (tdata) { + return tdata.bind(function (data) { + return Optional.from(tieredMenu.sketch(__assign(__assign({}, externals.menu()), { + uid: generate$2(''), + data: data, + highlightImmediately: highlightOnOpen === HighlightOnOpen.HighlightFirst, + onOpenMenu: function (tmenu, menu) { + var sink = getLazySink().getOrDie(); + Positioning.position(sink, anchor, menu); + Sandboxing.decloak(sandbox); + }, + onOpenSubmenu: function (tmenu, item, submenu) { + var sink = getLazySink().getOrDie(); + Positioning.position(sink, { + anchor: 'submenu', + item: item + }, submenu); + Sandboxing.decloak(sandbox); + }, + onRepositionMenu: function (tmenu, primaryMenu, submenuTriggers) { + var sink = getLazySink().getOrDie(); + Positioning.position(sink, anchor, primaryMenu); + each(submenuTriggers, function (st) { + Positioning.position(sink, { + anchor: 'submenu', + item: st.triggeringItem + }, st.triggeredMenu); + }); + }, + onEscape: function () { + Focusing.focus(component); + Sandboxing.close(sandbox); + return Optional.some(true); + } + }))); }); + }); }; var open$1 = function (detail, mapFetch, hotspot, sandbox, externals, onOpenSync, highlightOnOpen) { - var anchor = getAnchor(detail, hotspot); - var processed = openF(detail, mapFetch, anchor, hotspot, sandbox, externals, highlightOnOpen); - return processed.map(function (tdata) { - tdata.fold(function () { - if (Sandboxing.isOpen(sandbox)) { - Sandboxing.close(sandbox); - } - }, function (data) { - Sandboxing.cloak(sandbox); - Sandboxing.open(sandbox, data); - onOpenSync(sandbox); - }); - return sandbox; + var anchor = getAnchor(detail, hotspot); + var processed = openF(detail, mapFetch, anchor, hotspot, sandbox, externals, highlightOnOpen); + return processed.map(function (tdata) { + tdata.fold(function () { + if (Sandboxing.isOpen(sandbox)) { + Sandboxing.close(sandbox); + } + }, function (data) { + Sandboxing.cloak(sandbox); + Sandboxing.open(sandbox, data); + onOpenSync(sandbox); }); + return sandbox; + }); }; var close$1 = function (detail, mapFetch, component, sandbox, _externals, _onOpenSync, _highlightOnOpen) { - Sandboxing.close(sandbox); - return Future.pure(sandbox); + Sandboxing.close(sandbox); + return Future.pure(sandbox); }; var togglePopup = function (detail, mapFetch, hotspot, externals, onOpenSync, highlightOnOpen) { - var sandbox = Coupling.getCoupled(hotspot, 'sandbox'); - var showing = Sandboxing.isOpen(sandbox); - var action = showing ? close$1 : open$1; - return action(detail, mapFetch, hotspot, sandbox, externals, onOpenSync, highlightOnOpen); + var sandbox = Coupling.getCoupled(hotspot, 'sandbox'); + var showing = Sandboxing.isOpen(sandbox); + var action = showing ? close$1 : open$1; + return action(detail, mapFetch, hotspot, sandbox, externals, onOpenSync, highlightOnOpen); }; var matchWidth = function (hotspot, container, useMinWidth) { - var menu = Composing.getCurrent(container).getOr(container); - var buttonWidth = get$8(hotspot.element); - if (useMinWidth) { - set$2(menu.element, 'min-width', buttonWidth + 'px'); - } else { - set$4(menu.element, buttonWidth); - } + var menu = Composing.getCurrent(container).getOr(container); + var buttonWidth = get$8(hotspot.element); + if (useMinWidth) { + set$2(menu.element, 'min-width', buttonWidth + 'px'); + } else { + set$4(menu.element, buttonWidth); + } }; var getSink = function (anyInSystem, sinkDetail) { - return anyInSystem.getSystem().getByUid(sinkDetail.uid + '-' + suffix()).map(function (internalSink) { - return function () { - return Result.value(internalSink); - }; - }).getOrThunk(function () { - return sinkDetail.lazySink.fold(function () { - return function () { - return Result.error(new Error('No internal sink is specified, nor could an external sink be found')); - }; - }, function (lazySinkFn) { - return function () { - return lazySinkFn(anyInSystem); - }; - }); + return anyInSystem.getSystem().getByUid(sinkDetail.uid + '-' + suffix()).map(function (internalSink) { + return function () { + return Result.value(internalSink); + }; + }).getOrThunk(function () { + return sinkDetail.lazySink.fold(function () { + return function () { + return Result.error(new Error('No internal sink is specified, nor could an external sink be found')); + }; + }, function (lazySinkFn) { + return function () { + return lazySinkFn(anyInSystem); + }; }); + }); }; var doRepositionMenus = function (sandbox) { - Sandboxing.getState(sandbox).each(function (tmenu) { - tieredMenu.repositionMenus(tmenu); - }); + Sandboxing.getState(sandbox).each(function (tmenu) { + tieredMenu.repositionMenus(tmenu); + }); }; var makeSandbox = function (detail, hotspot, extras) { - var ariaOwner = manager(); - var onOpen = function (component, menu) { - var anchor = getAnchor(detail, hotspot); - ariaOwner.link(hotspot.element); - if (detail.matchWidth) { - matchWidth(anchor.hotspot, menu, detail.useMinWidth); - } - detail.onOpen(anchor, component, menu); - if (extras !== undefined && extras.onOpen !== undefined) { - extras.onOpen(component, menu); - } - }; - var onClose = function (component, menu) { - ariaOwner.unlink(hotspot.element); - if (extras !== undefined && extras.onClose !== undefined) { - extras.onClose(component, menu); - } - }; - var lazySink = getSink(hotspot, detail); - return { - dom: { - tag: 'div', - classes: detail.sandboxClasses, - attributes: { - id: ariaOwner.id, - role: 'listbox' - } - }, - behaviours: SketchBehaviours.augment(detail.sandboxBehaviours, [ - Representing.config({ - store: { - mode: 'memory', - initialValue: hotspot - } - }), - Sandboxing.config({ - onOpen: onOpen, - onClose: onClose, - isPartOf: function (container, data, queryElem) { - return isPartOf(data, queryElem) || isPartOf(hotspot, queryElem); - }, - getAttachPoint: function () { - return lazySink().getOrDie(); - } - }), - Composing.config({ - find: function (sandbox) { - return Sandboxing.getState(sandbox).bind(function (menu) { - return Composing.getCurrent(menu); - }); - } - }), - Receiving.config({channels: __assign(__assign({}, receivingChannel({isExtraPart: never})), receivingChannel$1({doReposition: doRepositionMenus}))}) - ]) - }; + var ariaOwner = manager(); + var onOpen = function (component, menu) { + var anchor = getAnchor(detail, hotspot); + ariaOwner.link(hotspot.element); + if (detail.matchWidth) { + matchWidth(anchor.hotspot, menu, detail.useMinWidth); + } + detail.onOpen(anchor, component, menu); + if (extras !== undefined && extras.onOpen !== undefined) { + extras.onOpen(component, menu); + } + }; + var onClose = function (component, menu) { + ariaOwner.unlink(hotspot.element); + if (extras !== undefined && extras.onClose !== undefined) { + extras.onClose(component, menu); + } + }; + var lazySink = getSink(hotspot, detail); + return { + dom: { + tag: 'div', + classes: detail.sandboxClasses, + attributes: { + id: ariaOwner.id, + role: 'listbox' + } + }, + behaviours: SketchBehaviours.augment(detail.sandboxBehaviours, [ + Representing.config({ + store: { + mode: 'memory', + initialValue: hotspot + } + }), + Sandboxing.config({ + onOpen: onOpen, + onClose: onClose, + isPartOf: function (container, data, queryElem) { + return isPartOf(data, queryElem) || isPartOf(hotspot, queryElem); + }, + getAttachPoint: function () { + return lazySink().getOrDie(); + } + }), + Composing.config({ + find: function (sandbox) { + return Sandboxing.getState(sandbox).bind(function (menu) { + return Composing.getCurrent(menu); + }); + } + }), + Receiving.config({ channels: __assign(__assign({}, receivingChannel({ isExtraPart: never })), receivingChannel$1({ doReposition: doRepositionMenus })) }) + ]) + }; }; var repositionMenus = function (comp) { - var sandbox = Coupling.getCoupled(comp, 'sandbox'); - doRepositionMenus(sandbox); + var sandbox = Coupling.getCoupled(comp, 'sandbox'); + doRepositionMenus(sandbox); }; var sandboxFields = function () { - return [ - defaulted$1('sandboxClasses', []), - SketchBehaviours.field('sandboxBehaviours', [ - Composing, - Receiving, - Sandboxing, - Representing - ]) - ]; + return [ + defaulted$1('sandboxClasses', []), + SketchBehaviours.field('sandboxBehaviours', [ + Composing, + Receiving, + Sandboxing, + Representing + ]) + ]; }; var schema$g = constant([ - strict$1('dom'), - strict$1('fetch'), - onHandler('onOpen'), - onKeyboardHandler('onExecute'), - defaulted$1('getHotspot', Optional.some), - defaulted$1('getAnchorOverrides', constant({})), - schema$1(), - field$1('dropdownBehaviours', [ - Toggling, - Coupling, - Keying, - Focusing - ]), - strict$1('toggleClass'), - defaulted$1('eventOrder', {}), - option('lazySink'), - defaulted$1('matchWidth', false), - defaulted$1('useMinWidth', false), - option('role') + strict$1('dom'), + strict$1('fetch'), + onHandler('onOpen'), + onKeyboardHandler('onExecute'), + defaulted$1('getHotspot', Optional.some), + defaulted$1('getAnchorOverrides', constant({})), + schema$1(), + field$1('dropdownBehaviours', [ + Toggling, + Coupling, + Keying, + Focusing + ]), + strict$1('toggleClass'), + defaulted$1('eventOrder', {}), + option('lazySink'), + defaulted$1('matchWidth', false), + defaulted$1('useMinWidth', false), + option('role') ].concat(sandboxFields())); var parts$4 = constant([ - external$1({ - schema: [tieredMenuMarkers()], - name: 'menu', - defaults: function (detail) { - return {onExecute: detail.onExecute}; - } - }), - partType() + external$1({ + schema: [tieredMenuMarkers()], + name: 'menu', + defaults: function (detail) { + return { onExecute: detail.onExecute }; + } + }), + partType() ]); var factory$6 = function (detail, components, _spec, externals) { - var _a; - var lookupAttr = function (attr) { - return get$1(detail.dom, 'attributes').bind(function (attrs) { - return get$1(attrs, attr); - }); - }; - var switchToMenu = function (sandbox) { - Sandboxing.getState(sandbox).each(function (tmenu) { - tieredMenu.highlightPrimary(tmenu); - }); - }; - var action = function (component) { - var onOpenSync = switchToMenu; + var _a; + var lookupAttr = function (attr) { + return get$1(detail.dom, 'attributes').bind(function (attrs) { + return get$1(attrs, attr); + }); + }; + var switchToMenu = function (sandbox) { + Sandboxing.getState(sandbox).each(function (tmenu) { + tieredMenu.highlightPrimary(tmenu); + }); + }; + var action = function (component) { + var onOpenSync = switchToMenu; + togglePopup(detail, function (x) { + return x; + }, component, externals, onOpenSync, HighlightOnOpen.HighlightFirst).get(noop); + }; + var apis = { + expand: function (comp) { + if (!Toggling.isOn(comp)) { togglePopup(detail, function (x) { - return x; - }, component, externals, onOpenSync, HighlightOnOpen.HighlightFirst).get(noop); - }; - var apis = { - expand: function (comp) { - if (!Toggling.isOn(comp)) { - togglePopup(detail, function (x) { - return x; - }, comp, externals, noop, HighlightOnOpen.HighlightNone).get(noop); - } - }, - open: function (comp) { - if (!Toggling.isOn(comp)) { - togglePopup(detail, function (x) { - return x; - }, comp, externals, noop, HighlightOnOpen.HighlightFirst).get(noop); - } - }, - isOpen: Toggling.isOn, - close: function (comp) { - if (Toggling.isOn(comp)) { - togglePopup(detail, function (x) { - return x; - }, comp, externals, noop, HighlightOnOpen.HighlightFirst).get(noop); - } - }, - repositionMenus: function (comp) { - if (Toggling.isOn(comp)) { - repositionMenus(comp); - } - } - }; - var triggerExecute = function (comp, _se) { - emitExecute(comp); - return Optional.some(true); - }; - return { - uid: detail.uid, - dom: detail.dom, - components: components, - behaviours: augment(detail.dropdownBehaviours, [ - Toggling.config({ - toggleClass: detail.toggleClass, - aria: {mode: 'expanded'} - }), - Coupling.config({ - others: { - sandbox: function (hotspot) { - return makeSandbox(detail, hotspot, { - onOpen: function () { - Toggling.on(hotspot); - }, - onClose: function () { - Toggling.off(hotspot); - } - }); - } - } - }), - Keying.config({ - mode: 'special', - onSpace: triggerExecute, - onEnter: triggerExecute, - onDown: function (comp, _se) { - if (Dropdown.isOpen(comp)) { - var sandbox = Coupling.getCoupled(comp, 'sandbox'); - switchToMenu(sandbox); - } else { - Dropdown.open(comp); - } - return Optional.some(true); - }, - onEscape: function (comp, _se) { - if (Dropdown.isOpen(comp)) { - Dropdown.close(comp); - return Optional.some(true); - } else { - return Optional.none(); - } - } - }), - Focusing.config({}) - ]), - events: events$7(Optional.some(action)), - eventOrder: __assign(__assign({}, detail.eventOrder), (_a = {}, _a[execute()] = [ - 'disabling', - 'toggling', - 'alloy.base.behaviour' - ], _a)), - apis: apis, - domModification: { - attributes: __assign(__assign({'aria-haspopup': 'true'}, detail.role.fold(function () { - return {}; - }, function (role) { - return {role: role}; - })), detail.dom.tag === 'button' ? {type: lookupAttr('type').getOr('button')} : {}) + return x; + }, comp, externals, noop, HighlightOnOpen.HighlightNone).get(noop); + } + }, + open: function (comp) { + if (!Toggling.isOn(comp)) { + togglePopup(detail, function (x) { + return x; + }, comp, externals, noop, HighlightOnOpen.HighlightFirst).get(noop); + } + }, + isOpen: Toggling.isOn, + close: function (comp) { + if (Toggling.isOn(comp)) { + togglePopup(detail, function (x) { + return x; + }, comp, externals, noop, HighlightOnOpen.HighlightFirst).get(noop); + } + }, + repositionMenus: function (comp) { + if (Toggling.isOn(comp)) { + repositionMenus(comp); + } + } + }; + var triggerExecute = function (comp, _se) { + emitExecute(comp); + return Optional.some(true); + }; + return { + uid: detail.uid, + dom: detail.dom, + components: components, + behaviours: augment(detail.dropdownBehaviours, [ + Toggling.config({ + toggleClass: detail.toggleClass, + aria: { mode: 'expanded' } + }), + Coupling.config({ + others: { + sandbox: function (hotspot) { + return makeSandbox(detail, hotspot, { + onOpen: function () { + Toggling.on(hotspot); + }, + onClose: function () { + Toggling.off(hotspot); + } + }); + } + } + }), + Keying.config({ + mode: 'special', + onSpace: triggerExecute, + onEnter: triggerExecute, + onDown: function (comp, _se) { + if (Dropdown.isOpen(comp)) { + var sandbox = Coupling.getCoupled(comp, 'sandbox'); + switchToMenu(sandbox); + } else { + Dropdown.open(comp); + } + return Optional.some(true); + }, + onEscape: function (comp, _se) { + if (Dropdown.isOpen(comp)) { + Dropdown.close(comp); + return Optional.some(true); + } else { + return Optional.none(); + } } - }; + }), + Focusing.config({}) + ]), + events: events$7(Optional.some(action)), + eventOrder: __assign(__assign({}, detail.eventOrder), (_a = {}, _a[execute()] = [ + 'disabling', + 'toggling', + 'alloy.base.behaviour' + ], _a)), + apis: apis, + domModification: { + attributes: __assign(__assign({ 'aria-haspopup': 'true' }, detail.role.fold(function () { + return {}; + }, function (role) { + return { role: role }; + })), detail.dom.tag === 'button' ? { type: lookupAttr('type').getOr('button') } : {}) + } + }; }; var Dropdown = composite$1({ - name: 'Dropdown', - configFields: schema$g(), - partFields: parts$4(), - factory: factory$6, - apis: { - open: function (apis, comp) { - return apis.open(comp); - }, - expand: function (apis, comp) { - return apis.expand(comp); - }, - close: function (apis, comp) { - return apis.close(comp); - }, - isOpen: function (apis, comp) { - return apis.isOpen(comp); - }, - repositionMenus: function (apis, comp) { - return apis.repositionMenus(comp); - } + name: 'Dropdown', + configFields: schema$g(), + partFields: parts$4(), + factory: factory$6, + apis: { + open: function (apis, comp) { + return apis.open(comp); + }, + expand: function (apis, comp) { + return apis.expand(comp); + }, + close: function (apis, comp) { + return apis.close(comp); + }, + isOpen: function (apis, comp) { + return apis.isOpen(comp); + }, + repositionMenus: function (apis, comp) { + return apis.repositionMenus(comp); } + } }); var exhibit$5 = function () { - return nu$6({ - styles: { - '-webkit-user-select': 'none', - 'user-select': 'none', - '-ms-user-select': 'none', - '-moz-user-select': '-moz-none' - }, - attributes: {unselectable: 'on'} - }); + return nu$6({ + styles: { + '-webkit-user-select': 'none', + 'user-select': 'none', + '-ms-user-select': 'none', + '-moz-user-select': '-moz-none' + }, + attributes: { unselectable: 'on' } + }); }; var events$b = function () { - return derive([abort(selectstart(), always)]); + return derive([abort(selectstart(), always)]); }; var ActiveUnselecting = /*#__PURE__*/Object.freeze({ @@ -14736,209 +14698,209 @@ }); var Unselecting = create$1({ - fields: [], - name: 'unselecting', - active: ActiveUnselecting + fields: [], + name: 'unselecting', + active: ActiveUnselecting }); var renderPanelButton = function (spec, sharedBackstage) { - return Dropdown.sketch({ - dom: spec.dom, - components: spec.components, - toggleClass: 'mce-active', - dropdownBehaviours: derive$1([ - DisablingConfigs.button(sharedBackstage.providers.isDisabled), - receivingConfig(), - Unselecting.config({}), - Tabstopping.config({}) - ]), - layouts: spec.layouts, - sandboxClasses: ['tox-dialog__popups'], - lazySink: sharedBackstage.getSink, - fetch: function (comp) { - return Future.nu(function (callback) { - return spec.fetch(callback); - }).map(function (items) { - return Optional.from(createTieredDataFrom(deepMerge(createPartialChoiceMenu(generate$1('menu-value'), items, function (value) { - spec.onItemAction(comp, value); - }, spec.columns, spec.presets, ItemResponse$1.CLOSE_ON_EXECUTE, function () { - return false; - }, sharedBackstage.providers), {movement: deriveMenuMovement(spec.columns, spec.presets)}))); - }); - }, - parts: {menu: part(false, 1, spec.presets)} - }); + return Dropdown.sketch({ + dom: spec.dom, + components: spec.components, + toggleClass: 'mce-active', + dropdownBehaviours: derive$1([ + DisablingConfigs.button(sharedBackstage.providers.isDisabled), + receivingConfig(), + Unselecting.config({}), + Tabstopping.config({}) + ]), + layouts: spec.layouts, + sandboxClasses: ['tox-dialog__popups'], + lazySink: sharedBackstage.getSink, + fetch: function (comp) { + return Future.nu(function (callback) { + return spec.fetch(callback); + }).map(function (items) { + return Optional.from(createTieredDataFrom(deepMerge(createPartialChoiceMenu(generate$1('menu-value'), items, function (value) { + spec.onItemAction(comp, value); + }, spec.columns, spec.presets, ItemResponse$1.CLOSE_ON_EXECUTE, function () { + return false; + }, sharedBackstage.providers), { movement: deriveMenuMovement(spec.columns, spec.presets) }))); + }); + }, + parts: { menu: part(false, 1, spec.presets) } + }); }; var colorInputChangeEvent = generate$1('color-input-change'); var colorSwatchChangeEvent = generate$1('color-swatch-change'); var colorPickerCancelEvent = generate$1('color-picker-cancel'); var renderColorInput = function (spec, sharedBackstage, colorInputBackstage) { - var pField = FormField.parts.field({ - factory: Input, - inputClasses: ['tox-textfield'], - onSetValue: function (c) { - return Invalidating.run(c).get(function () { - }); - }, - inputBehaviours: derive$1([ - Disabling.config({disabled: sharedBackstage.providers.isDisabled}), - receivingConfig(), - Tabstopping.config({}), - Invalidating.config({ - invalidClass: 'tox-textbox-field-invalid', - getRoot: function (comp) { - return parent(comp.element); - }, - notify: { - onValid: function (comp) { - var val = Representing.getValue(comp); - emitWith(comp, colorInputChangeEvent, {color: val}); - } - }, - validator: { - validateOnLoad: false, - validate: function (input) { - var inputValue = Representing.getValue(input); - if (inputValue.length === 0) { - return Future.pure(Result.value(true)); - } else { - var span = SugarElement.fromTag('span'); - set$2(span, 'background-color', inputValue); - var res = getRaw(span, 'background-color').fold(function () { - return Result.error('blah'); - }, function (_) { - return Result.value(inputValue); - }); - return Future.pure(res); - } - } - } - }) - ]), - selectOnFocus: false - }); - var pLabel = spec.label.map(function (label) { - return renderLabel(label, sharedBackstage.providers); - }); - var emitSwatchChange = function (colorBit, value) { - emitWith(colorBit, colorSwatchChangeEvent, {value: value}); - }; - var onItemAction = function (comp, value) { - memColorButton.getOpt(comp).each(function (colorBit) { - if (value === 'custom') { - colorInputBackstage.colorPicker(function (valueOpt) { - valueOpt.fold(function () { - return emit(colorBit, colorPickerCancelEvent); - }, function (value) { - emitSwatchChange(colorBit, value); - addColor(value); - }); - }, '#ffffff'); - } else if (value === 'remove') { - emitSwatchChange(colorBit, ''); + var pField = FormField.parts.field({ + factory: Input, + inputClasses: ['tox-textfield'], + onSetValue: function (c) { + return Invalidating.run(c).get(function () { + }); + }, + inputBehaviours: derive$1([ + Disabling.config({ disabled: sharedBackstage.providers.isDisabled }), + receivingConfig(), + Tabstopping.config({}), + Invalidating.config({ + invalidClass: 'tox-textbox-field-invalid', + getRoot: function (comp) { + return parent(comp.element); + }, + notify: { + onValid: function (comp) { + var val = Representing.getValue(comp); + emitWith(comp, colorInputChangeEvent, { color: val }); + } + }, + validator: { + validateOnLoad: false, + validate: function (input) { + var inputValue = Representing.getValue(input); + if (inputValue.length === 0) { + return Future.pure(Result.value(true)); } else { - emitSwatchChange(colorBit, value); - } - }); - }; - var memColorButton = record(renderPanelButton({ - dom: { - tag: 'span', - attributes: {'aria-label': sharedBackstage.providers.translate('Color swatch')} - }, - layouts: { - onRtl: function () { - return [ - southwest$1, - southeast$1, - south$1 - ]; - }, - onLtr: function () { - return [ - southeast$1, - southwest$1, - south$1 - ]; + var span = SugarElement.fromTag('span'); + set$2(span, 'background-color', inputValue); + var res = getRaw(span, 'background-color').fold(function () { + return Result.error('blah'); + }, function (_) { + return Result.value(inputValue); + }); + return Future.pure(res); } - }, - components: [], - fetch: getFetch(colorInputBackstage.getColors(), colorInputBackstage.hasCustomColors()), - columns: colorInputBackstage.getColorCols(), - presets: 'color', - onItemAction: onItemAction - }, sharedBackstage)); - return FormField.sketch({ + } + } + }) + ]), + selectOnFocus: false + }); + var pLabel = spec.label.map(function (label) { + return renderLabel(label, sharedBackstage.providers); + }); + var emitSwatchChange = function (colorBit, value) { + emitWith(colorBit, colorSwatchChangeEvent, { value: value }); + }; + var onItemAction = function (comp, value) { + memColorButton.getOpt(comp).each(function (colorBit) { + if (value === 'custom') { + colorInputBackstage.colorPicker(function (valueOpt) { + valueOpt.fold(function () { + return emit(colorBit, colorPickerCancelEvent); + }, function (value) { + emitSwatchChange(colorBit, value); + addColor(value); + }); + }, '#ffffff'); + } else if (value === 'remove') { + emitSwatchChange(colorBit, ''); + } else { + emitSwatchChange(colorBit, value); + } + }); + }; + var memColorButton = record(renderPanelButton({ + dom: { + tag: 'span', + attributes: { 'aria-label': sharedBackstage.providers.translate('Color swatch') } + }, + layouts: { + onRtl: function () { + return [ + southwest$1, + southeast$1, + south$1 + ]; + }, + onLtr: function () { + return [ + southeast$1, + southwest$1, + south$1 + ]; + } + }, + components: [], + fetch: getFetch(colorInputBackstage.getColors(), colorInputBackstage.hasCustomColors()), + columns: colorInputBackstage.getColorCols(), + presets: 'color', + onItemAction: onItemAction + }, sharedBackstage)); + return FormField.sketch({ + dom: { + tag: 'div', + classes: ['tox-form__group'] + }, + components: pLabel.toArray().concat([{ dom: { - tag: 'div', - classes: ['tox-form__group'] + tag: 'div', + classes: ['tox-color-input'] }, - components: pLabel.toArray().concat([{ - dom: { - tag: 'div', - classes: ['tox-color-input'] - }, - components: [ - pField, - memColorButton.asSpec() - ] - }]), - fieldBehaviours: derive$1([config('form-field-events', [ - run(colorInputChangeEvent, function (comp, se) { - memColorButton.getOpt(comp).each(function (colorButton) { - set$2(colorButton.element, 'background-color', se.event.color); - }); - emitWith(comp, formChangeEvent, {name: spec.name}); - }), - run(colorSwatchChangeEvent, function (comp, se) { - FormField.getField(comp).each(function (field) { - Representing.setValue(field, se.event.value); - Composing.getCurrent(comp).each(Focusing.focus); - }); - }), - run(colorPickerCancelEvent, function (comp, _se) { - FormField.getField(comp).each(function (_field) { - Composing.getCurrent(comp).each(Focusing.focus); - }); - }) - ])]) - }); - }; - - var hsvColour = function (hue, saturation, value) { - return { - hue: hue, - saturation: saturation, - value: value - }; + components: [ + pField, + memColorButton.asSpec() + ] + }]), + fieldBehaviours: derive$1([config('form-field-events', [ + run(colorInputChangeEvent, function (comp, se) { + memColorButton.getOpt(comp).each(function (colorButton) { + set$2(colorButton.element, 'background-color', se.event.color); + }); + emitWith(comp, formChangeEvent, { name: spec.name }); + }), + run(colorSwatchChangeEvent, function (comp, se) { + FormField.getField(comp).each(function (field) { + Representing.setValue(field, se.event.value); + Composing.getCurrent(comp).each(Focusing.focus); + }); + }), + run(colorPickerCancelEvent, function (comp, _se) { + FormField.getField(comp).each(function (_field) { + Composing.getCurrent(comp).each(Focusing.focus); + }); + }) + ])]) + }); + }; + + var hsvColour = function (hue, saturation, value) { + return { + hue: hue, + saturation: saturation, + value: value + }; }; var fromRgb = function (rgbaColour) { - var h = 0; - var s = 0; - var v = 0; - var r = rgbaColour.red / 255; - var g = rgbaColour.green / 255; - var b = rgbaColour.blue / 255; - var minRGB = Math.min(r, Math.min(g, b)); - var maxRGB = Math.max(r, Math.max(g, b)); - if (minRGB === maxRGB) { - v = minRGB; - return hsvColour(0, 0, v * 100); - } - var d = r === minRGB ? g - b : b === minRGB ? r - g : b - r; - h = r === minRGB ? 3 : b === minRGB ? 1 : 5; - h = 60 * (h - d / (maxRGB - minRGB)); - s = (maxRGB - minRGB) / maxRGB; - v = maxRGB; - return hsvColour(Math.round(h), Math.round(s * 100), Math.round(v * 100)); + var h = 0; + var s = 0; + var v = 0; + var r = rgbaColour.red / 255; + var g = rgbaColour.green / 255; + var b = rgbaColour.blue / 255; + var minRGB = Math.min(r, Math.min(g, b)); + var maxRGB = Math.max(r, Math.max(g, b)); + if (minRGB === maxRGB) { + v = minRGB; + return hsvColour(0, 0, v * 100); + } + var d = r === minRGB ? g - b : b === minRGB ? r - g : b - r; + h = r === minRGB ? 3 : b === minRGB ? 1 : 5; + h = 60 * (h - d / (maxRGB - minRGB)); + s = (maxRGB - minRGB) / maxRGB; + v = maxRGB; + return hsvColour(Math.round(h), Math.round(s * 100), Math.round(v * 100)); }; var calcHex = function (value) { - var hue = (100 - value) / 100 * 360; - var hsv = hsvColour(hue, 100, 100); - var rgb = fromHsv(hsv); - return fromRgba(rgb); + var hue = (100 - value) / 100 * 360; + var hsv = hsvColour(hue, 100, 100); + var rgb = fromHsv(hsv); + return fromRgba(rgb); }; var fieldsUpdate = generate$1('rgb-hex-update'); @@ -14946,35 +14908,35 @@ var paletteUpdate = generate$1('palette-update'); var labelPart = optional({ - schema: [strict$1('dom')], - name: 'label' + schema: [strict$1('dom')], + name: 'label' }); var edgePart = function (name) { - return optional({ - name: '' + name + '-edge', - overrides: function (detail) { - var action = detail.model.manager.edgeActions[name]; - return action.fold(function () { - return {}; - }, function (a) { - return { - events: derive([ - runActionExtra(touchstart(), function (comp, se, d) { - return a(comp, d); - }, [detail]), - runActionExtra(mousedown(), function (comp, se, d) { - return a(comp, d); - }, [detail]), - runActionExtra(mousemove(), function (comp, se, det) { - if (det.mouseIsDown.get()) { - a(comp, det); - } - }, [detail]) - ]) - }; - }); - } - }); + return optional({ + name: '' + name + '-edge', + overrides: function (detail) { + var action = detail.model.manager.edgeActions[name]; + return action.fold(function () { + return {}; + }, function (a) { + return { + events: derive([ + runActionExtra(touchstart(), function (comp, se, d) { + return a(comp, d); + }, [detail]), + runActionExtra(mousedown(), function (comp, se, d) { + return a(comp, d); + }, [detail]), + runActionExtra(mousemove(), function (comp, se, det) { + if (det.mouseIsDown.get()) { + a(comp, det); + } + }, [detail]) + ]) + }; + }); + } + }); }; var tlEdgePart = edgePart('top-left'); var tedgePart = edgePart('top'); @@ -14985,458 +14947,453 @@ var blEdgePart = edgePart('bottom-left'); var ledgePart = edgePart('left'); var thumbPart = required({ - name: 'thumb', - defaults: constant({dom: {styles: {position: 'absolute'}}}), - overrides: function (detail) { - return { - events: derive([ - redirectToPart(touchstart(), detail, 'spectrum'), - redirectToPart(touchmove(), detail, 'spectrum'), - redirectToPart(touchend(), detail, 'spectrum'), - redirectToPart(mousedown(), detail, 'spectrum'), - redirectToPart(mousemove(), detail, 'spectrum'), - redirectToPart(mouseup(), detail, 'spectrum') - ]) - }; - } + name: 'thumb', + defaults: constant({ dom: { styles: { position: 'absolute' } } }), + overrides: function (detail) { + return { + events: derive([ + redirectToPart(touchstart(), detail, 'spectrum'), + redirectToPart(touchmove(), detail, 'spectrum'), + redirectToPart(touchend(), detail, 'spectrum'), + redirectToPart(mousedown(), detail, 'spectrum'), + redirectToPart(mousemove(), detail, 'spectrum'), + redirectToPart(mouseup(), detail, 'spectrum') + ]) + }; + } }); var spectrumPart = required({ - schema: [state$1('mouseIsDown', function () { - return Cell(false); + schema: [state$1('mouseIsDown', function () { + return Cell(false); })], - name: 'spectrum', - overrides: function (detail) { - var modelDetail = detail.model; - var model = modelDetail.manager; - var setValueFrom = function (component, simulatedEvent) { - return model.getValueFromEvent(simulatedEvent).map(function (value) { - return model.setValueFrom(component, detail, value); - }); - }; - return { - behaviours: derive$1([ - Keying.config({ - mode: 'special', - onLeft: function (spectrum) { - return model.onLeft(spectrum, detail); - }, - onRight: function (spectrum) { - return model.onRight(spectrum, detail); - }, - onUp: function (spectrum) { - return model.onUp(spectrum, detail); - }, - onDown: function (spectrum) { - return model.onDown(spectrum, detail); - } - }), - Focusing.config({}) - ]), - events: derive([ - run(touchstart(), setValueFrom), - run(touchmove(), setValueFrom), - run(mousedown(), setValueFrom), - run(mousemove(), function (spectrum, se) { - if (detail.mouseIsDown.get()) { - setValueFrom(spectrum, se); - } - }) - ]) - }; - } + name: 'spectrum', + overrides: function (detail) { + var modelDetail = detail.model; + var model = modelDetail.manager; + var setValueFrom = function (component, simulatedEvent) { + return model.getValueFromEvent(simulatedEvent).map(function (value) { + return model.setValueFrom(component, detail, value); + }); + }; + return { + behaviours: derive$1([ + Keying.config({ + mode: 'special', + onLeft: function (spectrum) { + return model.onLeft(spectrum, detail); + }, + onRight: function (spectrum) { + return model.onRight(spectrum, detail); + }, + onUp: function (spectrum) { + return model.onUp(spectrum, detail); + }, + onDown: function (spectrum) { + return model.onDown(spectrum, detail); + } + }), + Focusing.config({}) + ]), + events: derive([ + run(touchstart(), setValueFrom), + run(touchmove(), setValueFrom), + run(mousedown(), setValueFrom), + run(mousemove(), function (spectrum, se) { + if (detail.mouseIsDown.get()) { + setValueFrom(spectrum, se); + } + }) + ]) + }; + } }); var SliderParts = [ - labelPart, - ledgePart, - redgePart, - tedgePart, - bedgePart, - tlEdgePart, - trEdgePart, - blEdgePart, - brEdgePart, - thumbPart, - spectrumPart + labelPart, + ledgePart, + redgePart, + tedgePart, + bedgePart, + tlEdgePart, + trEdgePart, + blEdgePart, + brEdgePart, + thumbPart, + spectrumPart ]; var _sliderChangeEvent = 'slider.change.value'; var sliderChangeEvent = constant(_sliderChangeEvent); var isTouchEvent = function (evt) { - return evt.type.indexOf('touch') !== -1; + return evt.type.indexOf('touch') !== -1; }; var getEventSource = function (simulatedEvent) { - var evt = simulatedEvent.event.raw; - if (isTouchEvent(evt)) { - var touchEvent = evt; - return touchEvent.touches !== undefined && touchEvent.touches.length === 1 ? Optional.some(touchEvent.touches[0]).map(function (t) { - return SugarPosition(t.clientX, t.clientY); - }) : Optional.none(); - } else { - var mouseEvent = evt; - return mouseEvent.clientX !== undefined ? Optional.some(mouseEvent).map(function (me) { - return SugarPosition(me.clientX, me.clientY); - }) : Optional.none(); - } + var evt = simulatedEvent.event.raw; + if (isTouchEvent(evt)) { + var touchEvent = evt; + return touchEvent.touches !== undefined && touchEvent.touches.length === 1 ? Optional.some(touchEvent.touches[0]).map(function (t) { + return SugarPosition(t.clientX, t.clientY); + }) : Optional.none(); + } else { + var mouseEvent = evt; + return mouseEvent.clientX !== undefined ? Optional.some(mouseEvent).map(function (me) { + return SugarPosition(me.clientX, me.clientY); + }) : Optional.none(); + } }; var t = 'top', r$1 = 'right', b = 'bottom', l = 'left'; var minX = function (detail) { - return detail.model.minX; + return detail.model.minX; }; var minY = function (detail) { - return detail.model.minY; + return detail.model.minY; }; var min1X = function (detail) { - return detail.model.minX - 1; + return detail.model.minX - 1; }; var min1Y = function (detail) { - return detail.model.minY - 1; + return detail.model.minY - 1; }; var maxX = function (detail) { - return detail.model.maxX; + return detail.model.maxX; }; var maxY = function (detail) { - return detail.model.maxY; + return detail.model.maxY; }; var max1X = function (detail) { - return detail.model.maxX + 1; + return detail.model.maxX + 1; }; var max1Y = function (detail) { - return detail.model.maxY + 1; + return detail.model.maxY + 1; }; var range$2 = function (detail, max, min) { - return max(detail) - min(detail); + return max(detail) - min(detail); }; var xRange = function (detail) { - return range$2(detail, maxX, minX); + return range$2(detail, maxX, minX); }; var yRange = function (detail) { - return range$2(detail, maxY, minY); + return range$2(detail, maxY, minY); }; var halfX = function (detail) { - return xRange(detail) / 2; + return xRange(detail) / 2; }; var halfY = function (detail) { - return yRange(detail) / 2; + return yRange(detail) / 2; }; var step = function (detail) { - return detail.stepSize; + return detail.stepSize; }; var snap = function (detail) { - return detail.snapToGrid; + return detail.snapToGrid; }; var snapStart = function (detail) { - return detail.snapStart; + return detail.snapStart; }; var rounded = function (detail) { - return detail.rounded; + return detail.rounded; }; var hasEdge = function (detail, edgeName) { - return detail[edgeName + '-edge'] !== undefined; + return detail[edgeName + '-edge'] !== undefined; }; var hasLEdge = function (detail) { - return hasEdge(detail, l); + return hasEdge(detail, l); }; var hasREdge = function (detail) { - return hasEdge(detail, r$1); + return hasEdge(detail, r$1); }; var hasTEdge = function (detail) { - return hasEdge(detail, t); + return hasEdge(detail, t); }; var hasBEdge = function (detail) { - return hasEdge(detail, b); + return hasEdge(detail, b); }; var currentValue = function (detail) { - return detail.model.value.get(); + return detail.model.value.get(); }; var xValue = function (x) { - return {x: x}; + return { x: x }; }; var yValue = function (y) { - return {y: y}; + return { y: y }; }; var xyValue = function (x, y) { - return { - x: x, - y: y - }; + return { + x: x, + y: y + }; }; var fireSliderChange = function (component, value) { - emitWith(component, sliderChangeEvent(), {value: value}); + emitWith(component, sliderChangeEvent(), { value: value }); }; var setToTLEdgeXY = function (edge, detail) { - fireSliderChange(edge, xyValue(min1X(detail), min1Y(detail))); + fireSliderChange(edge, xyValue(min1X(detail), min1Y(detail))); }; var setToTEdge = function (edge, detail) { - fireSliderChange(edge, yValue(min1Y(detail))); + fireSliderChange(edge, yValue(min1Y(detail))); }; var setToTEdgeXY = function (edge, detail) { - fireSliderChange(edge, xyValue(halfX(detail), min1Y(detail))); + fireSliderChange(edge, xyValue(halfX(detail), min1Y(detail))); }; var setToTREdgeXY = function (edge, detail) { - fireSliderChange(edge, xyValue(max1X(detail), min1Y(detail))); + fireSliderChange(edge, xyValue(max1X(detail), min1Y(detail))); }; var setToREdge = function (edge, detail) { - fireSliderChange(edge, xValue(max1X(detail))); + fireSliderChange(edge, xValue(max1X(detail))); }; var setToREdgeXY = function (edge, detail) { - fireSliderChange(edge, xyValue(max1X(detail), halfY(detail))); + fireSliderChange(edge, xyValue(max1X(detail), halfY(detail))); }; var setToBREdgeXY = function (edge, detail) { - fireSliderChange(edge, xyValue(max1X(detail), max1Y(detail))); + fireSliderChange(edge, xyValue(max1X(detail), max1Y(detail))); }; var setToBEdge = function (edge, detail) { - fireSliderChange(edge, yValue(max1Y(detail))); + fireSliderChange(edge, yValue(max1Y(detail))); }; var setToBEdgeXY = function (edge, detail) { - fireSliderChange(edge, xyValue(halfX(detail), max1Y(detail))); + fireSliderChange(edge, xyValue(halfX(detail), max1Y(detail))); }; var setToBLEdgeXY = function (edge, detail) { - fireSliderChange(edge, xyValue(min1X(detail), max1Y(detail))); + fireSliderChange(edge, xyValue(min1X(detail), max1Y(detail))); }; var setToLEdge = function (edge, detail) { - fireSliderChange(edge, xValue(min1X(detail))); + fireSliderChange(edge, xValue(min1X(detail))); }; var setToLEdgeXY = function (edge, detail) { - fireSliderChange(edge, xyValue(min1X(detail), halfY(detail))); + fireSliderChange(edge, xyValue(min1X(detail), halfY(detail))); }; var reduceBy = function (value, min, max, step) { - if (value < min) { - return value; - } else if (value > max) { - return max; - } else if (value === min) { - return min - 1; - } else { - return Math.max(min, value - step); - } + if (value < min) { + return value; + } else if (value > max) { + return max; + } else if (value === min) { + return min - 1; + } else { + return Math.max(min, value - step); + } }; var increaseBy = function (value, min, max, step) { - if (value > max) { - return value; - } else if (value < min) { - return min; - } else if (value === max) { - return max + 1; - } else { - return Math.min(max, value + step); - } + if (value > max) { + return value; + } else if (value < min) { + return min; + } else if (value === max) { + return max + 1; + } else { + return Math.min(max, value + step); + } }; var capValue = function (value, min, max) { - return Math.max(min, Math.min(max, value)); + return Math.max(min, Math.min(max, value)); }; var snapValueOf = function (value, min, max, step, snapStart) { - return snapStart.fold(function () { - var initValue = value - min; - var extraValue = Math.round(initValue / step) * step; - return capValue(min + extraValue, min - 1, max + 1); - }, function (start) { - var remainder = (value - start) % step; - var adjustment = Math.round(remainder / step); - var rawSteps = Math.floor((value - start) / step); - var maxSteps = Math.floor((max - start) / step); - var numSteps = Math.min(maxSteps, rawSteps + adjustment); - var r = start + numSteps * step; - return Math.max(start, r); - }); + return snapStart.fold(function () { + var initValue = value - min; + var extraValue = Math.round(initValue / step) * step; + return capValue(min + extraValue, min - 1, max + 1); + }, function (start) { + var remainder = (value - start) % step; + var adjustment = Math.round(remainder / step); + var rawSteps = Math.floor((value - start) / step); + var maxSteps = Math.floor((max - start) / step); + var numSteps = Math.min(maxSteps, rawSteps + adjustment); + var r = start + numSteps * step; + return Math.max(start, r); + }); }; var findOffsetOf = function (value, min, max) { - return Math.min(max, Math.max(value, min)) - min; + return Math.min(max, Math.max(value, min)) - min; }; var findValueOf = function (args) { - var min = args.min, max = args.max, range = args.range, value = args.value, step = args.step, snap = args.snap, - snapStart = args.snapStart, rounded = args.rounded, hasMinEdge = args.hasMinEdge, - hasMaxEdge = args.hasMaxEdge, minBound = args.minBound, maxBound = args.maxBound, - screenRange = args.screenRange; - var capMin = hasMinEdge ? min - 1 : min; - var capMax = hasMaxEdge ? max + 1 : max; - if (value < minBound) { - return capMin; - } else if (value > maxBound) { - return capMax; + var min = args.min, max = args.max, range = args.range, value = args.value, step = args.step, snap = args.snap, snapStart = args.snapStart, rounded = args.rounded, hasMinEdge = args.hasMinEdge, hasMaxEdge = args.hasMaxEdge, minBound = args.minBound, maxBound = args.maxBound, screenRange = args.screenRange; + var capMin = hasMinEdge ? min - 1 : min; + var capMax = hasMaxEdge ? max + 1 : max; + if (value < minBound) { + return capMin; + } else if (value > maxBound) { + return capMax; + } else { + var offset = findOffsetOf(value, minBound, maxBound); + var newValue = capValue(offset / screenRange * range + min, capMin, capMax); + if (snap && newValue >= min && newValue <= max) { + return snapValueOf(newValue, min, max, step, snapStart); + } else if (rounded) { + return Math.round(newValue); } else { - var offset = findOffsetOf(value, minBound, maxBound); - var newValue = capValue(offset / screenRange * range + min, capMin, capMax); - if (snap && newValue >= min && newValue <= max) { - return snapValueOf(newValue, min, max, step, snapStart); - } else if (rounded) { - return Math.round(newValue); - } else { - return newValue; - } + return newValue; } + } }; var findOffsetOfValue = function (args) { - var min = args.min, max = args.max, range = args.range, value = args.value, hasMinEdge = args.hasMinEdge, - hasMaxEdge = args.hasMaxEdge, maxBound = args.maxBound, maxOffset = args.maxOffset, - centerMinEdge = args.centerMinEdge, centerMaxEdge = args.centerMaxEdge; - if (value < min) { - return hasMinEdge ? 0 : centerMinEdge; - } else if (value > max) { - return hasMaxEdge ? maxBound : centerMaxEdge; - } else { - return (value - min) / range * maxOffset; - } + var min = args.min, max = args.max, range = args.range, value = args.value, hasMinEdge = args.hasMinEdge, hasMaxEdge = args.hasMaxEdge, maxBound = args.maxBound, maxOffset = args.maxOffset, centerMinEdge = args.centerMinEdge, centerMaxEdge = args.centerMaxEdge; + if (value < min) { + return hasMinEdge ? 0 : centerMinEdge; + } else if (value > max) { + return hasMaxEdge ? maxBound : centerMaxEdge; + } else { + return (value - min) / range * maxOffset; + } }; var top = 'top', right = 'right', bottom = 'bottom', left = 'left', width = 'width', height = 'height'; var getBounds$1 = function (component) { - return component.element.dom.getBoundingClientRect(); + return component.element.dom.getBoundingClientRect(); }; var getBoundsProperty = function (bounds, property) { - return bounds[property]; + return bounds[property]; }; var getMinXBounds = function (component) { - var bounds = getBounds$1(component); - return getBoundsProperty(bounds, left); + var bounds = getBounds$1(component); + return getBoundsProperty(bounds, left); }; var getMaxXBounds = function (component) { - var bounds = getBounds$1(component); - return getBoundsProperty(bounds, right); + var bounds = getBounds$1(component); + return getBoundsProperty(bounds, right); }; var getMinYBounds = function (component) { - var bounds = getBounds$1(component); - return getBoundsProperty(bounds, top); + var bounds = getBounds$1(component); + return getBoundsProperty(bounds, top); }; var getMaxYBounds = function (component) { - var bounds = getBounds$1(component); - return getBoundsProperty(bounds, bottom); + var bounds = getBounds$1(component); + return getBoundsProperty(bounds, bottom); }; var getXScreenRange = function (component) { - var bounds = getBounds$1(component); - return getBoundsProperty(bounds, width); + var bounds = getBounds$1(component); + return getBoundsProperty(bounds, width); }; var getYScreenRange = function (component) { - var bounds = getBounds$1(component); - return getBoundsProperty(bounds, height); + var bounds = getBounds$1(component); + return getBoundsProperty(bounds, height); }; var getCenterOffsetOf = function (componentMinEdge, componentMaxEdge, spectrumMinEdge) { - return (componentMinEdge + componentMaxEdge) / 2 - spectrumMinEdge; + return (componentMinEdge + componentMaxEdge) / 2 - spectrumMinEdge; }; var getXCenterOffSetOf = function (component, spectrum) { - var componentBounds = getBounds$1(component); - var spectrumBounds = getBounds$1(spectrum); - var componentMinEdge = getBoundsProperty(componentBounds, left); - var componentMaxEdge = getBoundsProperty(componentBounds, right); - var spectrumMinEdge = getBoundsProperty(spectrumBounds, left); - return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge); + var componentBounds = getBounds$1(component); + var spectrumBounds = getBounds$1(spectrum); + var componentMinEdge = getBoundsProperty(componentBounds, left); + var componentMaxEdge = getBoundsProperty(componentBounds, right); + var spectrumMinEdge = getBoundsProperty(spectrumBounds, left); + return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge); }; var getYCenterOffSetOf = function (component, spectrum) { - var componentBounds = getBounds$1(component); - var spectrumBounds = getBounds$1(spectrum); - var componentMinEdge = getBoundsProperty(componentBounds, top); - var componentMaxEdge = getBoundsProperty(componentBounds, bottom); - var spectrumMinEdge = getBoundsProperty(spectrumBounds, top); - return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge); + var componentBounds = getBounds$1(component); + var spectrumBounds = getBounds$1(spectrum); + var componentMinEdge = getBoundsProperty(componentBounds, top); + var componentMaxEdge = getBoundsProperty(componentBounds, bottom); + var spectrumMinEdge = getBoundsProperty(spectrumBounds, top); + return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge); }; var fireSliderChange$1 = function (spectrum, value) { - emitWith(spectrum, sliderChangeEvent(), {value: value}); + emitWith(spectrum, sliderChangeEvent(), { value: value }); }; var sliderValue = function (x) { - return {x: x}; + return { x: x }; }; var findValueOfOffset = function (spectrum, detail, left) { - var args = { - min: minX(detail), - max: maxX(detail), - range: xRange(detail), - value: left, - step: step(detail), - snap: snap(detail), - snapStart: snapStart(detail), - rounded: rounded(detail), - hasMinEdge: hasLEdge(detail), - hasMaxEdge: hasREdge(detail), - minBound: getMinXBounds(spectrum), - maxBound: getMaxXBounds(spectrum), - screenRange: getXScreenRange(spectrum) - }; - return findValueOf(args); + var args = { + min: minX(detail), + max: maxX(detail), + range: xRange(detail), + value: left, + step: step(detail), + snap: snap(detail), + snapStart: snapStart(detail), + rounded: rounded(detail), + hasMinEdge: hasLEdge(detail), + hasMaxEdge: hasREdge(detail), + minBound: getMinXBounds(spectrum), + maxBound: getMaxXBounds(spectrum), + screenRange: getXScreenRange(spectrum) + }; + return findValueOf(args); }; var setValueFrom = function (spectrum, detail, value) { - var xValue = findValueOfOffset(spectrum, detail, value); - var sliderVal = sliderValue(xValue); - fireSliderChange$1(spectrum, sliderVal); - return xValue; + var xValue = findValueOfOffset(spectrum, detail, value); + var sliderVal = sliderValue(xValue); + fireSliderChange$1(spectrum, sliderVal); + return xValue; }; var setToMin = function (spectrum, detail) { - var min = minX(detail); - fireSliderChange$1(spectrum, sliderValue(min)); + var min = minX(detail); + fireSliderChange$1(spectrum, sliderValue(min)); }; var setToMax = function (spectrum, detail) { - var max = maxX(detail); - fireSliderChange$1(spectrum, sliderValue(max)); + var max = maxX(detail); + fireSliderChange$1(spectrum, sliderValue(max)); }; var moveBy = function (direction, spectrum, detail) { - var f = direction > 0 ? increaseBy : reduceBy; - var xValue = f(currentValue(detail).x, minX(detail), maxX(detail), step(detail)); - fireSliderChange$1(spectrum, sliderValue(xValue)); - return Optional.some(xValue); + var f = direction > 0 ? increaseBy : reduceBy; + var xValue = f(currentValue(detail).x, minX(detail), maxX(detail), step(detail)); + fireSliderChange$1(spectrum, sliderValue(xValue)); + return Optional.some(xValue); }; var handleMovement = function (direction) { - return function (spectrum, detail) { - return moveBy(direction, spectrum, detail).map(function () { - return true; - }); - }; + return function (spectrum, detail) { + return moveBy(direction, spectrum, detail).map(function () { + return true; + }); + }; }; var getValueFromEvent = function (simulatedEvent) { - var pos = getEventSource(simulatedEvent); - return pos.map(function (p) { - return p.left; - }); + var pos = getEventSource(simulatedEvent); + return pos.map(function (p) { + return p.left; + }); }; var findOffsetOfValue$1 = function (spectrum, detail, value, minEdge, maxEdge) { - var minOffset = 0; - var maxOffset = getXScreenRange(spectrum); - var centerMinEdge = minEdge.bind(function (edge) { - return Optional.some(getXCenterOffSetOf(edge, spectrum)); - }).getOr(minOffset); - var centerMaxEdge = maxEdge.bind(function (edge) { - return Optional.some(getXCenterOffSetOf(edge, spectrum)); - }).getOr(maxOffset); - var args = { - min: minX(detail), - max: maxX(detail), - range: xRange(detail), - value: value, - hasMinEdge: hasLEdge(detail), - hasMaxEdge: hasREdge(detail), - minBound: getMinXBounds(spectrum), - minOffset: minOffset, - maxBound: getMaxXBounds(spectrum), - maxOffset: maxOffset, - centerMinEdge: centerMinEdge, - centerMaxEdge: centerMaxEdge - }; - return findOffsetOfValue(args); + var minOffset = 0; + var maxOffset = getXScreenRange(spectrum); + var centerMinEdge = minEdge.bind(function (edge) { + return Optional.some(getXCenterOffSetOf(edge, spectrum)); + }).getOr(minOffset); + var centerMaxEdge = maxEdge.bind(function (edge) { + return Optional.some(getXCenterOffSetOf(edge, spectrum)); + }).getOr(maxOffset); + var args = { + min: minX(detail), + max: maxX(detail), + range: xRange(detail), + value: value, + hasMinEdge: hasLEdge(detail), + hasMaxEdge: hasREdge(detail), + minBound: getMinXBounds(spectrum), + minOffset: minOffset, + maxBound: getMaxXBounds(spectrum), + maxOffset: maxOffset, + centerMinEdge: centerMinEdge, + centerMaxEdge: centerMaxEdge + }; + return findOffsetOfValue(args); }; var findPositionOfValue = function (slider, spectrum, value, minEdge, maxEdge, detail) { - var offset = findOffsetOfValue$1(spectrum, detail, value, minEdge, maxEdge); - return getMinXBounds(spectrum) - getMinXBounds(slider) + offset; + var offset = findOffsetOfValue$1(spectrum, detail, value, minEdge, maxEdge); + return getMinXBounds(spectrum) - getMinXBounds(slider) + offset; }; var setPositionFromValue = function (slider, thumb, detail, edges) { - var value = currentValue(detail); - var pos = findPositionOfValue(slider, edges.getSpectrum(slider), value.x, edges.getLeftEdge(slider), edges.getRightEdge(slider), detail); - var thumbRadius = get$8(thumb.element) / 2; - set$2(thumb.element, 'left', pos - thumbRadius + 'px'); + var value = currentValue(detail); + var pos = findPositionOfValue(slider, edges.getSpectrum(slider), value.x, edges.getLeftEdge(slider), edges.getRightEdge(slider), detail); + var thumbRadius = get$8(thumb.element) / 2; + set$2(thumb.element, 'left', pos - thumbRadius + 'px'); }; var onLeft = handleMovement(-1); var onRight = handleMovement(1); var onUp = Optional.none; var onDown = Optional.none; var edgeActions = { - 'top-left': Optional.none(), - 'top': Optional.none(), - 'top-right': Optional.none(), - 'right': Optional.some(setToREdge), - 'bottom-right': Optional.none(), - 'bottom': Optional.none(), - 'bottom-left': Optional.none(), - 'left': Optional.some(setToLEdge) + 'top-left': Optional.none(), + 'top': Optional.none(), + 'top-right': Optional.none(), + 'right': Optional.some(setToREdge), + 'bottom-right': Optional.none(), + 'bottom': Optional.none(), + 'bottom-left': Optional.none(), + 'left': Optional.some(setToLEdge) }; var HorizontalModel = /*#__PURE__*/Object.freeze({ @@ -15456,110 +15413,110 @@ }); var fireSliderChange$2 = function (spectrum, value) { - emitWith(spectrum, sliderChangeEvent(), {value: value}); + emitWith(spectrum, sliderChangeEvent(), { value: value }); }; var sliderValue$1 = function (y) { - return {y: y}; + return { y: y }; }; var findValueOfOffset$1 = function (spectrum, detail, top) { - var args = { - min: minY(detail), - max: maxY(detail), - range: yRange(detail), - value: top, - step: step(detail), - snap: snap(detail), - snapStart: snapStart(detail), - rounded: rounded(detail), - hasMinEdge: hasTEdge(detail), - hasMaxEdge: hasBEdge(detail), - minBound: getMinYBounds(spectrum), - maxBound: getMaxYBounds(spectrum), - screenRange: getYScreenRange(spectrum) - }; - return findValueOf(args); + var args = { + min: minY(detail), + max: maxY(detail), + range: yRange(detail), + value: top, + step: step(detail), + snap: snap(detail), + snapStart: snapStart(detail), + rounded: rounded(detail), + hasMinEdge: hasTEdge(detail), + hasMaxEdge: hasBEdge(detail), + minBound: getMinYBounds(spectrum), + maxBound: getMaxYBounds(spectrum), + screenRange: getYScreenRange(spectrum) + }; + return findValueOf(args); }; var setValueFrom$1 = function (spectrum, detail, value) { - var yValue = findValueOfOffset$1(spectrum, detail, value); - var sliderVal = sliderValue$1(yValue); - fireSliderChange$2(spectrum, sliderVal); - return yValue; + var yValue = findValueOfOffset$1(spectrum, detail, value); + var sliderVal = sliderValue$1(yValue); + fireSliderChange$2(spectrum, sliderVal); + return yValue; }; var setToMin$1 = function (spectrum, detail) { - var min = minY(detail); - fireSliderChange$2(spectrum, sliderValue$1(min)); + var min = minY(detail); + fireSliderChange$2(spectrum, sliderValue$1(min)); }; var setToMax$1 = function (spectrum, detail) { - var max = maxY(detail); - fireSliderChange$2(spectrum, sliderValue$1(max)); + var max = maxY(detail); + fireSliderChange$2(spectrum, sliderValue$1(max)); }; var moveBy$1 = function (direction, spectrum, detail) { - var f = direction > 0 ? increaseBy : reduceBy; - var yValue = f(currentValue(detail).y, minY(detail), maxY(detail), step(detail)); - fireSliderChange$2(spectrum, sliderValue$1(yValue)); - return Optional.some(yValue); + var f = direction > 0 ? increaseBy : reduceBy; + var yValue = f(currentValue(detail).y, minY(detail), maxY(detail), step(detail)); + fireSliderChange$2(spectrum, sliderValue$1(yValue)); + return Optional.some(yValue); }; var handleMovement$1 = function (direction) { - return function (spectrum, detail) { - return moveBy$1(direction, spectrum, detail).map(function () { - return true; - }); - }; + return function (spectrum, detail) { + return moveBy$1(direction, spectrum, detail).map(function () { + return true; + }); + }; }; var getValueFromEvent$1 = function (simulatedEvent) { - var pos = getEventSource(simulatedEvent); - return pos.map(function (p) { - return p.top; - }); + var pos = getEventSource(simulatedEvent); + return pos.map(function (p) { + return p.top; + }); }; var findOffsetOfValue$2 = function (spectrum, detail, value, minEdge, maxEdge) { - var minOffset = 0; - var maxOffset = getYScreenRange(spectrum); - var centerMinEdge = minEdge.bind(function (edge) { - return Optional.some(getYCenterOffSetOf(edge, spectrum)); - }).getOr(minOffset); - var centerMaxEdge = maxEdge.bind(function (edge) { - return Optional.some(getYCenterOffSetOf(edge, spectrum)); - }).getOr(maxOffset); - var args = { - min: minY(detail), - max: maxY(detail), - range: yRange(detail), - value: value, - hasMinEdge: hasTEdge(detail), - hasMaxEdge: hasBEdge(detail), - minBound: getMinYBounds(spectrum), - minOffset: minOffset, - maxBound: getMaxYBounds(spectrum), - maxOffset: maxOffset, - centerMinEdge: centerMinEdge, - centerMaxEdge: centerMaxEdge - }; - return findOffsetOfValue(args); + var minOffset = 0; + var maxOffset = getYScreenRange(spectrum); + var centerMinEdge = minEdge.bind(function (edge) { + return Optional.some(getYCenterOffSetOf(edge, spectrum)); + }).getOr(minOffset); + var centerMaxEdge = maxEdge.bind(function (edge) { + return Optional.some(getYCenterOffSetOf(edge, spectrum)); + }).getOr(maxOffset); + var args = { + min: minY(detail), + max: maxY(detail), + range: yRange(detail), + value: value, + hasMinEdge: hasTEdge(detail), + hasMaxEdge: hasBEdge(detail), + minBound: getMinYBounds(spectrum), + minOffset: minOffset, + maxBound: getMaxYBounds(spectrum), + maxOffset: maxOffset, + centerMinEdge: centerMinEdge, + centerMaxEdge: centerMaxEdge + }; + return findOffsetOfValue(args); }; var findPositionOfValue$1 = function (slider, spectrum, value, minEdge, maxEdge, detail) { - var offset = findOffsetOfValue$2(spectrum, detail, value, minEdge, maxEdge); - return getMinYBounds(spectrum) - getMinYBounds(slider) + offset; + var offset = findOffsetOfValue$2(spectrum, detail, value, minEdge, maxEdge); + return getMinYBounds(spectrum) - getMinYBounds(slider) + offset; }; var setPositionFromValue$1 = function (slider, thumb, detail, edges) { - var value = currentValue(detail); - var pos = findPositionOfValue$1(slider, edges.getSpectrum(slider), value.y, edges.getTopEdge(slider), edges.getBottomEdge(slider), detail); - var thumbRadius = get$7(thumb.element) / 2; - set$2(thumb.element, 'top', pos - thumbRadius + 'px'); + var value = currentValue(detail); + var pos = findPositionOfValue$1(slider, edges.getSpectrum(slider), value.y, edges.getTopEdge(slider), edges.getBottomEdge(slider), detail); + var thumbRadius = get$7(thumb.element) / 2; + set$2(thumb.element, 'top', pos - thumbRadius + 'px'); }; var onLeft$1 = Optional.none; var onRight$1 = Optional.none; var onUp$1 = handleMovement$1(-1); var onDown$1 = handleMovement$1(1); var edgeActions$1 = { - 'top-left': Optional.none(), - 'top': Optional.some(setToTEdge), - 'top-right': Optional.none(), - 'right': Optional.none(), - 'bottom-right': Optional.none(), - 'bottom': Optional.some(setToBEdge), - 'bottom-left': Optional.none(), - 'left': Optional.none() + 'top-left': Optional.none(), + 'top': Optional.some(setToTEdge), + 'top-right': Optional.none(), + 'right': Optional.none(), + 'bottom-right': Optional.none(), + 'bottom': Optional.some(setToBEdge), + 'bottom-left': Optional.none(), + 'left': Optional.none() }; var VerticalModel = /*#__PURE__*/Object.freeze({ @@ -15579,70 +15536,70 @@ }); var fireSliderChange$3 = function (spectrum, value) { - emitWith(spectrum, sliderChangeEvent(), {value: value}); + emitWith(spectrum, sliderChangeEvent(), { value: value }); }; var sliderValue$2 = function (x, y) { - return { - x: x, - y: y - }; + return { + x: x, + y: y + }; }; var setValueFrom$2 = function (spectrum, detail, value) { - var xValue = findValueOfOffset(spectrum, detail, value.left); - var yValue = findValueOfOffset$1(spectrum, detail, value.top); - var val = sliderValue$2(xValue, yValue); - fireSliderChange$3(spectrum, val); - return val; + var xValue = findValueOfOffset(spectrum, detail, value.left); + var yValue = findValueOfOffset$1(spectrum, detail, value.top); + var val = sliderValue$2(xValue, yValue); + fireSliderChange$3(spectrum, val); + return val; }; var moveBy$2 = function (direction, isVerticalMovement, spectrum, detail) { - var f = direction > 0 ? increaseBy : reduceBy; - var xValue = isVerticalMovement ? currentValue(detail).x : f(currentValue(detail).x, minX(detail), maxX(detail), step(detail)); - var yValue = !isVerticalMovement ? currentValue(detail).y : f(currentValue(detail).y, minY(detail), maxY(detail), step(detail)); - fireSliderChange$3(spectrum, sliderValue$2(xValue, yValue)); - return Optional.some(xValue); + var f = direction > 0 ? increaseBy : reduceBy; + var xValue = isVerticalMovement ? currentValue(detail).x : f(currentValue(detail).x, minX(detail), maxX(detail), step(detail)); + var yValue = !isVerticalMovement ? currentValue(detail).y : f(currentValue(detail).y, minY(detail), maxY(detail), step(detail)); + fireSliderChange$3(spectrum, sliderValue$2(xValue, yValue)); + return Optional.some(xValue); }; var handleMovement$2 = function (direction, isVerticalMovement) { - return function (spectrum, detail) { - return moveBy$2(direction, isVerticalMovement, spectrum, detail).map(function () { - return true; - }); - }; + return function (spectrum, detail) { + return moveBy$2(direction, isVerticalMovement, spectrum, detail).map(function () { + return true; + }); + }; }; var setToMin$2 = function (spectrum, detail) { - var mX = minX(detail); - var mY = minY(detail); - fireSliderChange$3(spectrum, sliderValue$2(mX, mY)); + var mX = minX(detail); + var mY = minY(detail); + fireSliderChange$3(spectrum, sliderValue$2(mX, mY)); }; var setToMax$2 = function (spectrum, detail) { - var mX = maxX(detail); - var mY = maxY(detail); - fireSliderChange$3(spectrum, sliderValue$2(mX, mY)); + var mX = maxX(detail); + var mY = maxY(detail); + fireSliderChange$3(spectrum, sliderValue$2(mX, mY)); }; var getValueFromEvent$2 = function (simulatedEvent) { - return getEventSource(simulatedEvent); + return getEventSource(simulatedEvent); }; var setPositionFromValue$2 = function (slider, thumb, detail, edges) { - var value = currentValue(detail); - var xPos = findPositionOfValue(slider, edges.getSpectrum(slider), value.x, edges.getLeftEdge(slider), edges.getRightEdge(slider), detail); - var yPos = findPositionOfValue$1(slider, edges.getSpectrum(slider), value.y, edges.getTopEdge(slider), edges.getBottomEdge(slider), detail); - var thumbXRadius = get$8(thumb.element) / 2; - var thumbYRadius = get$7(thumb.element) / 2; - set$2(thumb.element, 'left', xPos - thumbXRadius + 'px'); - set$2(thumb.element, 'top', yPos - thumbYRadius + 'px'); + var value = currentValue(detail); + var xPos = findPositionOfValue(slider, edges.getSpectrum(slider), value.x, edges.getLeftEdge(slider), edges.getRightEdge(slider), detail); + var yPos = findPositionOfValue$1(slider, edges.getSpectrum(slider), value.y, edges.getTopEdge(slider), edges.getBottomEdge(slider), detail); + var thumbXRadius = get$8(thumb.element) / 2; + var thumbYRadius = get$7(thumb.element) / 2; + set$2(thumb.element, 'left', xPos - thumbXRadius + 'px'); + set$2(thumb.element, 'top', yPos - thumbYRadius + 'px'); }; var onLeft$2 = handleMovement$2(-1, false); var onRight$2 = handleMovement$2(1, false); var onUp$2 = handleMovement$2(-1, true); var onDown$2 = handleMovement$2(1, true); var edgeActions$2 = { - 'top-left': Optional.some(setToTLEdgeXY), - 'top': Optional.some(setToTEdgeXY), - 'top-right': Optional.some(setToTREdgeXY), - 'right': Optional.some(setToREdgeXY), - 'bottom-right': Optional.some(setToBREdgeXY), - 'bottom': Optional.some(setToBEdgeXY), - 'bottom-left': Optional.some(setToBLEdgeXY), - 'left': Optional.some(setToLEdgeXY) + 'top-left': Optional.some(setToTLEdgeXY), + 'top': Optional.some(setToTEdgeXY), + 'top-right': Optional.some(setToTREdgeXY), + 'right': Optional.some(setToREdgeXY), + 'bottom-right': Optional.some(setToBREdgeXY), + 'bottom': Optional.some(setToBEdgeXY), + 'bottom-left': Optional.some(setToBLEdgeXY), + 'left': Optional.some(setToLEdgeXY) }; var TwoDModel = /*#__PURE__*/Object.freeze({ @@ -15660,302 +15617,302 @@ }); var SliderSchema = [ - defaulted$1('stepSize', 1), - defaulted$1('onChange', noop), - defaulted$1('onChoose', noop), - defaulted$1('onInit', noop), - defaulted$1('onDragStart', noop), - defaulted$1('onDragEnd', noop), - defaulted$1('snapToGrid', false), - defaulted$1('rounded', true), - option('snapStart'), - strictOf('model', choose$1('mode', { - x: [ - defaulted$1('minX', 0), - defaulted$1('maxX', 100), - state$1('value', function (spec) { - return Cell(spec.mode.minX); - }), - strict$1('getInitialValue'), - output('manager', HorizontalModel) - ], - y: [ - defaulted$1('minY', 0), - defaulted$1('maxY', 100), - state$1('value', function (spec) { - return Cell(spec.mode.minY); - }), - strict$1('getInitialValue'), - output('manager', VerticalModel) - ], - xy: [ - defaulted$1('minX', 0), - defaulted$1('maxX', 100), - defaulted$1('minY', 0), - defaulted$1('maxY', 100), - state$1('value', function (spec) { - return Cell({ - x: spec.mode.minX, - y: spec.mode.minY - }); - }), - strict$1('getInitialValue'), - output('manager', TwoDModel) - ] - })), - field$1('sliderBehaviours', [ - Keying, - Representing - ]), - state$1('mouseIsDown', function () { - return Cell(false); - }) + defaulted$1('stepSize', 1), + defaulted$1('onChange', noop), + defaulted$1('onChoose', noop), + defaulted$1('onInit', noop), + defaulted$1('onDragStart', noop), + defaulted$1('onDragEnd', noop), + defaulted$1('snapToGrid', false), + defaulted$1('rounded', true), + option('snapStart'), + strictOf('model', choose$1('mode', { + x: [ + defaulted$1('minX', 0), + defaulted$1('maxX', 100), + state$1('value', function (spec) { + return Cell(spec.mode.minX); + }), + strict$1('getInitialValue'), + output('manager', HorizontalModel) + ], + y: [ + defaulted$1('minY', 0), + defaulted$1('maxY', 100), + state$1('value', function (spec) { + return Cell(spec.mode.minY); + }), + strict$1('getInitialValue'), + output('manager', VerticalModel) + ], + xy: [ + defaulted$1('minX', 0), + defaulted$1('maxX', 100), + defaulted$1('minY', 0), + defaulted$1('maxY', 100), + state$1('value', function (spec) { + return Cell({ + x: spec.mode.minX, + y: spec.mode.minY + }); + }), + strict$1('getInitialValue'), + output('manager', TwoDModel) + ] + })), + field$1('sliderBehaviours', [ + Keying, + Representing + ]), + state$1('mouseIsDown', function () { + return Cell(false); + }) ]; var sketch = function (detail, components, _spec, _externals) { - var _a; - var getThumb = function (component) { - return getPartOrDie(component, detail, 'thumb'); - }; - var getSpectrum = function (component) { - return getPartOrDie(component, detail, 'spectrum'); - }; - var getLeftEdge = function (component) { - return getPart(component, detail, 'left-edge'); - }; - var getRightEdge = function (component) { - return getPart(component, detail, 'right-edge'); - }; - var getTopEdge = function (component) { - return getPart(component, detail, 'top-edge'); - }; - var getBottomEdge = function (component) { - return getPart(component, detail, 'bottom-edge'); - }; - var modelDetail = detail.model; - var model = modelDetail.manager; - var refresh = function (slider, thumb) { - model.setPositionFromValue(slider, thumb, detail, { - getLeftEdge: getLeftEdge, - getRightEdge: getRightEdge, - getTopEdge: getTopEdge, - getBottomEdge: getBottomEdge, - getSpectrum: getSpectrum - }); - }; - var changeValue = function (slider, newValue) { - modelDetail.value.set(newValue); + var _a; + var getThumb = function (component) { + return getPartOrDie(component, detail, 'thumb'); + }; + var getSpectrum = function (component) { + return getPartOrDie(component, detail, 'spectrum'); + }; + var getLeftEdge = function (component) { + return getPart(component, detail, 'left-edge'); + }; + var getRightEdge = function (component) { + return getPart(component, detail, 'right-edge'); + }; + var getTopEdge = function (component) { + return getPart(component, detail, 'top-edge'); + }; + var getBottomEdge = function (component) { + return getPart(component, detail, 'bottom-edge'); + }; + var modelDetail = detail.model; + var model = modelDetail.manager; + var refresh = function (slider, thumb) { + model.setPositionFromValue(slider, thumb, detail, { + getLeftEdge: getLeftEdge, + getRightEdge: getRightEdge, + getTopEdge: getTopEdge, + getBottomEdge: getBottomEdge, + getSpectrum: getSpectrum + }); + }; + var changeValue = function (slider, newValue) { + modelDetail.value.set(newValue); + var thumb = getThumb(slider); + refresh(slider, thumb); + detail.onChange(slider, thumb, newValue); + return Optional.some(true); + }; + var resetToMin = function (slider) { + model.setToMin(slider, detail); + }; + var resetToMax = function (slider) { + model.setToMax(slider, detail); + }; + var choose = function (slider) { + var fireOnChoose = function () { + getPart(slider, detail, 'thumb').each(function (thumb) { + var value = modelDetail.value.get(); + detail.onChoose(slider, thumb, value); + }); + }; + var wasDown = detail.mouseIsDown.get(); + detail.mouseIsDown.set(false); + if (wasDown) { + fireOnChoose(); + } + }; + var onDragStart = function (slider, simulatedEvent) { + simulatedEvent.stop(); + detail.mouseIsDown.set(true); + detail.onDragStart(slider, getThumb(slider)); + }; + var onDragEnd = function (slider, simulatedEvent) { + simulatedEvent.stop(); + detail.onDragEnd(slider, getThumb(slider)); + choose(slider); + }; + return { + uid: detail.uid, + dom: detail.dom, + components: components, + behaviours: augment(detail.sliderBehaviours, [ + Keying.config({ + mode: 'special', + focusIn: function (slider) { + return getPart(slider, detail, 'spectrum').map(Keying.focusIn).map(always); + } + }), + Representing.config({ + store: { + mode: 'manual', + getValue: function (_) { + return modelDetail.value.get(); + } + } + }), + Receiving.config({ channels: (_a = {}, _a[mouseReleased()] = { onReceive: choose }, _a) }) + ]), + events: derive([ + run(sliderChangeEvent(), function (slider, simulatedEvent) { + changeValue(slider, simulatedEvent.event.value); + }), + runOnAttached(function (slider, _simulatedEvent) { + var getInitial = modelDetail.getInitialValue(); + modelDetail.value.set(getInitial); var thumb = getThumb(slider); refresh(slider, thumb); - detail.onChange(slider, thumb, newValue); - return Optional.some(true); - }; - var resetToMin = function (slider) { - model.setToMin(slider, detail); - }; - var resetToMax = function (slider) { - model.setToMax(slider, detail); - }; - var choose = function (slider) { - var fireOnChoose = function () { - getPart(slider, detail, 'thumb').each(function (thumb) { - var value = modelDetail.value.get(); - detail.onChoose(slider, thumb, value); - }); - }; - var wasDown = detail.mouseIsDown.get(); - detail.mouseIsDown.set(false); - if (wasDown) { - fireOnChoose(); - } - }; - var onDragStart = function (slider, simulatedEvent) { - simulatedEvent.stop(); - detail.mouseIsDown.set(true); - detail.onDragStart(slider, getThumb(slider)); - }; - var onDragEnd = function (slider, simulatedEvent) { - simulatedEvent.stop(); - detail.onDragEnd(slider, getThumb(slider)); - choose(slider); - }; - return { - uid: detail.uid, - dom: detail.dom, - components: components, - behaviours: augment(detail.sliderBehaviours, [ - Keying.config({ - mode: 'special', - focusIn: function (slider) { - return getPart(slider, detail, 'spectrum').map(Keying.focusIn).map(always); - } - }), - Representing.config({ - store: { - mode: 'manual', - getValue: function (_) { - return modelDetail.value.get(); - } - } - }), - Receiving.config({channels: (_a = {}, _a[mouseReleased()] = {onReceive: choose}, _a)}) - ]), - events: derive([ - run(sliderChangeEvent(), function (slider, simulatedEvent) { - changeValue(slider, simulatedEvent.event.value); - }), - runOnAttached(function (slider, _simulatedEvent) { - var getInitial = modelDetail.getInitialValue(); - modelDetail.value.set(getInitial); - var thumb = getThumb(slider); - refresh(slider, thumb); - var spectrum = getSpectrum(slider); - detail.onInit(slider, thumb, spectrum, modelDetail.value.get()); - }), - run(touchstart(), onDragStart), - run(touchend(), onDragEnd), - run(mousedown(), onDragStart), - run(mouseup(), onDragEnd) - ]), - apis: { - resetToMin: resetToMin, - resetToMax: resetToMax, - changeValue: changeValue, - refresh: refresh - }, - domModification: {styles: {position: 'relative'}} - }; + var spectrum = getSpectrum(slider); + detail.onInit(slider, thumb, spectrum, modelDetail.value.get()); + }), + run(touchstart(), onDragStart), + run(touchend(), onDragEnd), + run(mousedown(), onDragStart), + run(mouseup(), onDragEnd) + ]), + apis: { + resetToMin: resetToMin, + resetToMax: resetToMax, + changeValue: changeValue, + refresh: refresh + }, + domModification: { styles: { position: 'relative' } } + }; }; var Slider = composite$1({ - name: 'Slider', - configFields: SliderSchema, - partFields: SliderParts, - factory: sketch, - apis: { - resetToMin: function (apis, slider) { - apis.resetToMin(slider); - }, - resetToMax: function (apis, slider) { - apis.resetToMax(slider); - }, - refresh: function (apis, slider) { - apis.refresh(slider); - } + name: 'Slider', + configFields: SliderSchema, + partFields: SliderParts, + factory: sketch, + apis: { + resetToMin: function (apis, slider) { + apis.resetToMin(slider); + }, + resetToMax: function (apis, slider) { + apis.resetToMax(slider); + }, + refresh: function (apis, slider) { + apis.refresh(slider); } + } }); var sliderFactory = function (translate, getClass) { - var spectrum = Slider.parts.spectrum({ - dom: { - tag: 'div', - classes: [getClass('hue-slider-spectrum')], - attributes: {role: 'presentation'} - } - }); - var thumb = Slider.parts.thumb({ - dom: { - tag: 'div', - classes: [getClass('hue-slider-thumb')], - attributes: {role: 'presentation'} - } - }); - return Slider.sketch({ - dom: { - tag: 'div', - classes: [getClass('hue-slider')], - attributes: {role: 'presentation'} - }, - rounded: false, - model: { - mode: 'y', - getInitialValue: constant({y: 0}) - }, - components: [ - spectrum, - thumb - ], - sliderBehaviours: derive$1([Focusing.config({})]), - onChange: function (slider, _thumb, value) { - emitWith(slider, sliderUpdate, {value: value}); - } - }); + var spectrum = Slider.parts.spectrum({ + dom: { + tag: 'div', + classes: [getClass('hue-slider-spectrum')], + attributes: { role: 'presentation' } + } + }); + var thumb = Slider.parts.thumb({ + dom: { + tag: 'div', + classes: [getClass('hue-slider-thumb')], + attributes: { role: 'presentation' } + } + }); + return Slider.sketch({ + dom: { + tag: 'div', + classes: [getClass('hue-slider')], + attributes: { role: 'presentation' } + }, + rounded: false, + model: { + mode: 'y', + getInitialValue: constant({ y: 0 }) + }, + components: [ + spectrum, + thumb + ], + sliderBehaviours: derive$1([Focusing.config({})]), + onChange: function (slider, _thumb, value) { + emitWith(slider, sliderUpdate, { value: value }); + } + }); }; var owner$3 = 'form'; var schema$h = [field$1('formBehaviours', [Representing])]; var getPartName = function (name) { - return ''; + return ''; }; var sketch$1 = function (fSpec) { - var parts = function () { - var record = []; - var field = function (name, config) { - record.push(name); - return generateOne(owner$3, getPartName(name), config); - }; - return { - field: field, - record: function () { - return record; - } - }; - }(); - var spec = fSpec(parts); - var partNames = parts.record(); - var fieldParts = map(partNames, function (n) { - return required({ - name: n, - pname: getPartName(n) - }); + var parts = function () { + var record = []; + var field = function (name, config) { + record.push(name); + return generateOne(owner$3, getPartName(name), config); + }; + return { + field: field, + record: function () { + return record; + } + }; + }(); + var spec = fSpec(parts); + var partNames = parts.record(); + var fieldParts = map(partNames, function (n) { + return required({ + name: n, + pname: getPartName(n) }); - return composite(owner$3, schema$h, fieldParts, make$4, spec); + }); + return composite(owner$3, schema$h, fieldParts, make$4, spec); }; var toResult$1 = function (o, e) { - return o.fold(function () { - return Result.error(e); - }, Result.value); + return o.fold(function () { + return Result.error(e); + }, Result.value); }; var make$4 = function (detail, components) { - return { - uid: detail.uid, - dom: detail.dom, - components: components, - behaviours: augment(detail.formBehaviours, [Representing.config({ - store: { - mode: 'manual', - getValue: function (form) { - var resPs = getAllParts(form, detail); - return map$2(resPs, function (resPThunk, pName) { - return resPThunk().bind(function (v) { - var opt = Composing.getCurrent(v); - return toResult$1(opt, new Error('Cannot find a current component to extract the value from for form part \'' + pName + '\': ' + element(v.element))); - }).map(Representing.getValue); - }); - }, - setValue: function (form, values) { - each$1(values, function (newValue, key) { - getPart(form, detail, key).each(function (wrapper) { - Composing.getCurrent(wrapper).each(function (field) { - Representing.setValue(field, newValue); - }); - }); - }); - } - } - })]), - apis: { - getField: function (form, key) { - return getPart(form, detail, key).bind(Composing.getCurrent); - } + return { + uid: detail.uid, + dom: detail.dom, + components: components, + behaviours: augment(detail.formBehaviours, [Representing.config({ + store: { + mode: 'manual', + getValue: function (form) { + var resPs = getAllParts(form, detail); + return map$2(resPs, function (resPThunk, pName) { + return resPThunk().bind(function (v) { + var opt = Composing.getCurrent(v); + return toResult$1(opt, new Error('Cannot find a current component to extract the value from for form part \'' + pName + '\': ' + element(v.element))); + }).map(Representing.getValue); + }); + }, + setValue: function (form, values) { + each$1(values, function (newValue, key) { + getPart(form, detail, key).each(function (wrapper) { + Composing.getCurrent(wrapper).each(function (field) { + Representing.setValue(field, newValue); + }); + }); + }); + } } - }; + })]), + apis: { + getField: function (form, key) { + return getPart(form, detail, key).bind(Composing.getCurrent); + } + } + }; }; var Form = { - getField: makeApi(function (apis, component, key) { - return apis.getField(component, key); - }), - sketch: sketch$1 + getField: makeApi(function (apis, component, key) { + return apis.getField(component, key); + }), + sketch: sketch$1 }; var validInput = generate$1('valid-input'); @@ -15963,1692 +15920,1424 @@ var validatingInput = generate$1('validating-input'); var translatePrefix = 'colorcustom.rgb.'; var rgbFormFactory = function (translate, getClass, onValidHexx, onInvalidHexx) { - var invalidation = function (label, isValid) { - return Invalidating.config({ - invalidClass: getClass('invalid'), - notify: { - onValidate: function (comp) { - emitWith(comp, validatingInput, {type: label}); - }, - onValid: function (comp) { - emitWith(comp, validInput, { - type: label, - value: Representing.getValue(comp) - }); - }, - onInvalid: function (comp) { - emitWith(comp, invalidInput, { - type: label, - value: Representing.getValue(comp) - }); - } - }, - validator: { - validate: function (comp) { - var value = Representing.getValue(comp); - var res = isValid(value) ? Result.value(true) : Result.error(translate('aria.input.invalid')); - return Future.pure(res); - }, - validateOnLoad: false - } - }); - }; - var renderTextField = function (isValid, name, label, description, data) { - var helptext = translate(translatePrefix + 'range'); - var pLabel = FormField.parts.label({ - dom: { - tag: 'label', - innerHtml: label, - attributes: {'aria-label': description} - } - }); - var pField = FormField.parts.field({ - data: data, - factory: Input, - inputAttributes: __assign({type: 'text'}, name === 'hex' ? {'aria-live': 'polite'} : {}), - inputClasses: [getClass('textfield')], - inputBehaviours: derive$1([ - invalidation(name, isValid), - Tabstopping.config({}) - ]), - onSetValue: function (input) { - if (Invalidating.isInvalid(input)) { - var run = Invalidating.run(input); - run.get(noop); - } - } - }); - var comps = [ - pLabel, - pField - ]; - var concats = name !== 'hex' ? [FormField.parts['aria-descriptor']({text: helptext})] : []; - var components = comps.concat(concats); - return { - dom: { - tag: 'div', - attributes: {role: 'presentation'} - }, - components: components - }; - }; - var copyRgbToHex = function (form, rgba) { - var hex = fromRgba(rgba); - Form.getField(form, 'hex').each(function (hexField) { - if (!Focusing.isFocused(hexField)) { - Representing.setValue(form, {hex: hex.value}); - } - }); - return hex; - }; - var copyRgbToForm = function (form, rgb) { - var red = rgb.red; - var green = rgb.green; - var blue = rgb.blue; - Representing.setValue(form, { - red: red, - green: green, - blue: blue - }); - }; - var memPreview = record({ - dom: { - tag: 'div', - classes: [getClass('rgba-preview')], - styles: {'background-color': 'white'}, - attributes: {role: 'presentation'} + var invalidation = function (label, isValid) { + return Invalidating.config({ + invalidClass: getClass('invalid'), + notify: { + onValidate: function (comp) { + emitWith(comp, validatingInput, { type: label }); + }, + onValid: function (comp) { + emitWith(comp, validInput, { + type: label, + value: Representing.getValue(comp) + }); + }, + onInvalid: function (comp) { + emitWith(comp, invalidInput, { + type: label, + value: Representing.getValue(comp) + }); + } + }, + validator: { + validate: function (comp) { + var value = Representing.getValue(comp); + var res = isValid(value) ? Result.value(true) : Result.error(translate('aria.input.invalid')); + return Future.pure(res); + }, + validateOnLoad: false + } + }); + }; + var renderTextField = function (isValid, name, label, description, data) { + var helptext = translate(translatePrefix + 'range'); + var pLabel = FormField.parts.label({ + dom: { + tag: 'label', + innerHtml: label, + attributes: { 'aria-label': description } + } + }); + var pField = FormField.parts.field({ + data: data, + factory: Input, + inputAttributes: __assign({ type: 'text' }, name === 'hex' ? { 'aria-live': 'polite' } : {}), + inputClasses: [getClass('textfield')], + inputBehaviours: derive$1([ + invalidation(name, isValid), + Tabstopping.config({}) + ]), + onSetValue: function (input) { + if (Invalidating.isInvalid(input)) { + var run = Invalidating.run(input); + run.get(noop); } + } }); - var updatePreview = function (anyInSystem, hex) { - memPreview.getOpt(anyInSystem).each(function (preview) { - set$2(preview.element, 'background-color', '#' + hex.value); - }); - }; - var factory = function () { - var state = { - red: Cell(Optional.some(255)), - green: Cell(Optional.some(255)), - blue: Cell(Optional.some(255)), - hex: Cell(Optional.some('ffffff')) - }; - var copyHexToRgb = function (form, hex) { - var rgb = fromHex(hex); - copyRgbToForm(form, rgb); - setValueRgb(rgb); - }; - var get = function (prop) { - return state[prop].get(); - }; - var set = function (prop, value) { - state[prop].set(value); - }; - var getValueRgb = function () { - return get('red').bind(function (red) { - return get('green').bind(function (green) { - return get('blue').map(function (blue) { - return rgbaColour(red, green, blue, 1); - }); - }); - }); - }; - var setValueRgb = function (rgb) { - var red = rgb.red; - var green = rgb.green; - var blue = rgb.blue; - set('red', Optional.some(red)); - set('green', Optional.some(green)); - set('blue', Optional.some(blue)); - }; - var onInvalidInput = function (form, simulatedEvent) { - var data = simulatedEvent.event; - if (data.type !== 'hex') { - set(data.type, Optional.none()); - } else { - onInvalidHexx(form); - } - }; - var onValidHex = function (form, value) { - onValidHexx(form); - var hex = hexColour(value); - set('hex', Optional.some(value)); - var rgb = fromHex(hex); - copyRgbToForm(form, rgb); - setValueRgb(rgb); - emitWith(form, fieldsUpdate, {hex: hex}); - updatePreview(form, hex); - }; - var onValidRgb = function (form, prop, value) { - var val = parseInt(value, 10); - set(prop, Optional.some(val)); - getValueRgb().each(function (rgb) { - var hex = copyRgbToHex(form, rgb); - updatePreview(form, hex); - }); - }; - var isHexInputEvent = function (data) { - return data.type === 'hex'; - }; - var onValidInput = function (form, simulatedEvent) { - var data = simulatedEvent.event; - if (isHexInputEvent(data)) { - onValidHex(form, data.value); - } else { - onValidRgb(form, data.type, data.value); - } - }; - var formPartStrings = function (key) { - return { - label: translate(translatePrefix + key + '.label'), - description: translate(translatePrefix + key + '.description') - }; - }; - var redStrings = formPartStrings('red'); - var greenStrings = formPartStrings('green'); - var blueStrings = formPartStrings('blue'); - var hexStrings = formPartStrings('hex'); - return deepMerge(Form.sketch(function (parts) { - return { - dom: { - tag: 'form', - classes: [getClass('rgb-form')], - attributes: {'aria-label': translate('aria.color.picker')} - }, - components: [ - parts.field('red', FormField.sketch(renderTextField(isRgbaComponent, 'red', redStrings.label, redStrings.description, 255))), - parts.field('green', FormField.sketch(renderTextField(isRgbaComponent, 'green', greenStrings.label, greenStrings.description, 255))), - parts.field('blue', FormField.sketch(renderTextField(isRgbaComponent, 'blue', blueStrings.label, blueStrings.description, 255))), - parts.field('hex', FormField.sketch(renderTextField(isHexString, 'hex', hexStrings.label, hexStrings.description, 'ffffff'))), - memPreview.asSpec() - ], - formBehaviours: derive$1([ - Invalidating.config({invalidClass: getClass('form-invalid')}), - config('rgb-form-events', [ - run(validInput, onValidInput), - run(invalidInput, onInvalidInput), - run(validatingInput, onInvalidInput) - ]) - ]) - }; - }), { - apis: { - updateHex: function (form, hex) { - Representing.setValue(form, {hex: hex.value}); - copyHexToRgb(form, hex); - updatePreview(form, hex); - } - } - }); - }; - var rgbFormSketcher = single$2({ - factory: factory, - name: 'RgbForm', - configFields: [], - apis: { - updateHex: function (apis, form, hex) { - apis.updateHex(form, hex); - } + var comps = [ + pLabel, + pField + ]; + var concats = name !== 'hex' ? [FormField.parts['aria-descriptor']({ text: helptext })] : []; + var components = comps.concat(concats); + return { + dom: { + tag: 'div', + attributes: { role: 'presentation' } + }, + components: components + }; + }; + var copyRgbToHex = function (form, rgba) { + var hex = fromRgba(rgba); + Form.getField(form, 'hex').each(function (hexField) { + if (!Focusing.isFocused(hexField)) { + Representing.setValue(form, { hex: hex.value }); + } + }); + return hex; + }; + var copyRgbToForm = function (form, rgb) { + var red = rgb.red; + var green = rgb.green; + var blue = rgb.blue; + Representing.setValue(form, { + red: red, + green: green, + blue: blue + }); + }; + var memPreview = record({ + dom: { + tag: 'div', + classes: [getClass('rgba-preview')], + styles: { 'background-color': 'white' }, + attributes: { role: 'presentation' } + } + }); + var updatePreview = function (anyInSystem, hex) { + memPreview.getOpt(anyInSystem).each(function (preview) { + set$2(preview.element, 'background-color', '#' + hex.value); + }); + }; + var factory = function () { + var state = { + red: Cell(Optional.some(255)), + green: Cell(Optional.some(255)), + blue: Cell(Optional.some(255)), + hex: Cell(Optional.some('ffffff')) + }; + var copyHexToRgb = function (form, hex) { + var rgb = fromHex(hex); + copyRgbToForm(form, rgb); + setValueRgb(rgb); + }; + var get = function (prop) { + return state[prop].get(); + }; + var set = function (prop, value) { + state[prop].set(value); + }; + var getValueRgb = function () { + return get('red').bind(function (red) { + return get('green').bind(function (green) { + return get('blue').map(function (blue) { + return rgbaColour(red, green, blue, 1); + }); + }); + }); + }; + var setValueRgb = function (rgb) { + var red = rgb.red; + var green = rgb.green; + var blue = rgb.blue; + set('red', Optional.some(red)); + set('green', Optional.some(green)); + set('blue', Optional.some(blue)); + }; + var onInvalidInput = function (form, simulatedEvent) { + var data = simulatedEvent.event; + if (data.type !== 'hex') { + set(data.type, Optional.none()); + } else { + onInvalidHexx(form); + } + }; + var onValidHex = function (form, value) { + onValidHexx(form); + var hex = hexColour(value); + set('hex', Optional.some(value)); + var rgb = fromHex(hex); + copyRgbToForm(form, rgb); + setValueRgb(rgb); + emitWith(form, fieldsUpdate, { hex: hex }); + updatePreview(form, hex); + }; + var onValidRgb = function (form, prop, value) { + var val = parseInt(value, 10); + set(prop, Optional.some(val)); + getValueRgb().each(function (rgb) { + var hex = copyRgbToHex(form, rgb); + updatePreview(form, hex); + }); + }; + var isHexInputEvent = function (data) { + return data.type === 'hex'; + }; + var onValidInput = function (form, simulatedEvent) { + var data = simulatedEvent.event; + if (isHexInputEvent(data)) { + onValidHex(form, data.value); + } else { + onValidRgb(form, data.type, data.value); + } + }; + var formPartStrings = function (key) { + return { + label: translate(translatePrefix + key + '.label'), + description: translate(translatePrefix + key + '.description') + }; + }; + var redStrings = formPartStrings('red'); + var greenStrings = formPartStrings('green'); + var blueStrings = formPartStrings('blue'); + var hexStrings = formPartStrings('hex'); + return deepMerge(Form.sketch(function (parts) { + return { + dom: { + tag: 'form', + classes: [getClass('rgb-form')], + attributes: { 'aria-label': translate('aria.color.picker') } }, - extraApis: {} - }); - return rgbFormSketcher; + components: [ + parts.field('red', FormField.sketch(renderTextField(isRgbaComponent, 'red', redStrings.label, redStrings.description, 255))), + parts.field('green', FormField.sketch(renderTextField(isRgbaComponent, 'green', greenStrings.label, greenStrings.description, 255))), + parts.field('blue', FormField.sketch(renderTextField(isRgbaComponent, 'blue', blueStrings.label, blueStrings.description, 255))), + parts.field('hex', FormField.sketch(renderTextField(isHexString, 'hex', hexStrings.label, hexStrings.description, 'ffffff'))), + memPreview.asSpec() + ], + formBehaviours: derive$1([ + Invalidating.config({ invalidClass: getClass('form-invalid') }), + config('rgb-form-events', [ + run(validInput, onValidInput), + run(invalidInput, onInvalidInput), + run(validatingInput, onInvalidInput) + ]) + ]) + }; + }), { + apis: { + updateHex: function (form, hex) { + Representing.setValue(form, { hex: hex.value }); + copyHexToRgb(form, hex); + updatePreview(form, hex); + } + } + }); + }; + var rgbFormSketcher = single$2({ + factory: factory, + name: 'RgbForm', + configFields: [], + apis: { + updateHex: function (apis, form, hex) { + apis.updateHex(form, hex); + } + }, + extraApis: {} + }); + return rgbFormSketcher; }; var paletteFactory = function (_translate, getClass) { - var spectrumPart = Slider.parts.spectrum({ - dom: { - tag: 'canvas', - attributes: {role: 'presentation'}, - classes: [getClass('sv-palette-spectrum')] - } - }); - var thumbPart = Slider.parts.thumb({ - dom: { - tag: 'div', - attributes: {role: 'presentation'}, - classes: [getClass('sv-palette-thumb')], - innerHtml: '' - } - }); - var setColour = function (canvas, rgba) { - var width = canvas.width, height = canvas.height; - var ctx = canvas.getContext('2d'); - if (ctx === null) { - return; - } - ctx.fillStyle = rgba; - ctx.fillRect(0, 0, width, height); - var grdWhite = ctx.createLinearGradient(0, 0, width, 0); - grdWhite.addColorStop(0, 'rgba(255,255,255,1)'); - grdWhite.addColorStop(1, 'rgba(255,255,255,0)'); - ctx.fillStyle = grdWhite; - ctx.fillRect(0, 0, width, height); - var grdBlack = ctx.createLinearGradient(0, 0, 0, height); - grdBlack.addColorStop(0, 'rgba(0,0,0,0)'); - grdBlack.addColorStop(1, 'rgba(0,0,0,1)'); - ctx.fillStyle = grdBlack; - ctx.fillRect(0, 0, width, height); - }; - var setSliderColour = function (slider, rgba) { - var canvas = slider.components()[0].element.dom; - setColour(canvas, toString(rgba)); - }; - var factory = function (_detail) { - var getInitialValue = constant({ - x: 0, - y: 0 - }); - var onChange = function (slider, _thumb, value) { - emitWith(slider, paletteUpdate, {value: value}); - }; - var onInit = function (_slider, _thumb, spectrum, _value) { - setColour(spectrum.element.dom, toString(red)); - }; - var sliderBehaviours = derive$1([ - Composing.config({find: Optional.some}), - Focusing.config({}) - ]); - return Slider.sketch({ - dom: { - tag: 'div', - attributes: {role: 'presentation'}, - classes: [getClass('sv-palette')] - }, - model: { - mode: 'xy', - getInitialValue: getInitialValue - }, - rounded: false, - components: [ - spectrumPart, - thumbPart - ], - onChange: onChange, - onInit: onInit, - sliderBehaviours: sliderBehaviours - }); - }; - var saturationBrightnessPaletteSketcher = single$2({ - factory: factory, - name: 'SaturationBrightnessPalette', - configFields: [], - apis: { - setRgba: function (_apis, slider, rgba) { - setSliderColour(slider, rgba); - } - }, - extraApis: {} - }); - return saturationBrightnessPaletteSketcher; + var spectrumPart = Slider.parts.spectrum({ + dom: { + tag: 'canvas', + attributes: { role: 'presentation' }, + classes: [getClass('sv-palette-spectrum')] + } + }); + var thumbPart = Slider.parts.thumb({ + dom: { + tag: 'div', + attributes: { role: 'presentation' }, + classes: [getClass('sv-palette-thumb')], + innerHtml: '' + } + }); + var setColour = function (canvas, rgba) { + var width = canvas.width, height = canvas.height; + var ctx = canvas.getContext('2d'); + if (ctx === null) { + return; + } + ctx.fillStyle = rgba; + ctx.fillRect(0, 0, width, height); + var grdWhite = ctx.createLinearGradient(0, 0, width, 0); + grdWhite.addColorStop(0, 'rgba(255,255,255,1)'); + grdWhite.addColorStop(1, 'rgba(255,255,255,0)'); + ctx.fillStyle = grdWhite; + ctx.fillRect(0, 0, width, height); + var grdBlack = ctx.createLinearGradient(0, 0, 0, height); + grdBlack.addColorStop(0, 'rgba(0,0,0,0)'); + grdBlack.addColorStop(1, 'rgba(0,0,0,1)'); + ctx.fillStyle = grdBlack; + ctx.fillRect(0, 0, width, height); + }; + var setSliderColour = function (slider, rgba) { + var canvas = slider.components()[0].element.dom; + setColour(canvas, toString(rgba)); + }; + var factory = function (_detail) { + var getInitialValue = constant({ + x: 0, + y: 0 + }); + var onChange = function (slider, _thumb, value) { + emitWith(slider, paletteUpdate, { value: value }); + }; + var onInit = function (_slider, _thumb, spectrum, _value) { + setColour(spectrum.element.dom, toString(red)); + }; + var sliderBehaviours = derive$1([ + Composing.config({ find: Optional.some }), + Focusing.config({}) + ]); + return Slider.sketch({ + dom: { + tag: 'div', + attributes: { role: 'presentation' }, + classes: [getClass('sv-palette')] + }, + model: { + mode: 'xy', + getInitialValue: getInitialValue + }, + rounded: false, + components: [ + spectrumPart, + thumbPart + ], + onChange: onChange, + onInit: onInit, + sliderBehaviours: sliderBehaviours + }); + }; + var saturationBrightnessPaletteSketcher = single$2({ + factory: factory, + name: 'SaturationBrightnessPalette', + configFields: [], + apis: { + setRgba: function (_apis, slider, rgba) { + setSliderColour(slider, rgba); + } + }, + extraApis: {} + }); + return saturationBrightnessPaletteSketcher; }; var makeFactory = function (translate, getClass) { - var factory = function (detail) { - var rgbForm = rgbFormFactory(translate, getClass, detail.onValidHex, detail.onInvalidHex); - var sbPalette = paletteFactory(translate, getClass); - var state = {paletteRgba: Cell(red)}; - var memPalette = record(sbPalette.sketch({})); - var memRgb = record(rgbForm.sketch({})); - var updatePalette = function (anyInSystem, hex) { - memPalette.getOpt(anyInSystem).each(function (palette) { - var rgba = fromHex(hex); - state.paletteRgba.set(rgba); - sbPalette.setRgba(palette, rgba); - }); - }; - var updateFields = function (anyInSystem, hex) { - memRgb.getOpt(anyInSystem).each(function (form) { - rgbForm.updateHex(form, hex); - }); - }; - var runUpdates = function (anyInSystem, hex, updates) { - each(updates, function (update) { - update(anyInSystem, hex); - }); - }; - var paletteUpdates = function () { - var updates = [updateFields]; - return function (form, simulatedEvent) { - var value = simulatedEvent.event.value; - var oldRgb = state.paletteRgba.get(); - var hsvColour$1 = fromRgb(oldRgb); - var newHsvColour = hsvColour(hsvColour$1.hue, value.x, 100 - value.y); - var rgb = fromHsv(newHsvColour); - var nuHex = fromRgba(rgb); - runUpdates(form, nuHex, updates); - }; - }; - var sliderUpdates = function () { - var updates = [ - updatePalette, - updateFields - ]; - return function (form, simulatedEvent) { - var value = simulatedEvent.event.value; - var hex = calcHex(value.y); - runUpdates(form, hex, updates); - }; - }; - return { - uid: detail.uid, - dom: detail.dom, - components: [ - memPalette.asSpec(), - sliderFactory(translate, getClass), - memRgb.asSpec() - ], - behaviours: derive$1([ - config('colour-picker-events', [ - run(paletteUpdate, paletteUpdates()), - run(sliderUpdate, sliderUpdates()) - ]), - Composing.config({ - find: function (comp) { - return memRgb.getOpt(comp); - } - }), - Keying.config({mode: 'acyclic'}) - ]) - }; + var factory = function (detail) { + var rgbForm = rgbFormFactory(translate, getClass, detail.onValidHex, detail.onInvalidHex); + var sbPalette = paletteFactory(translate, getClass); + var state = { paletteRgba: Cell(red) }; + var memPalette = record(sbPalette.sketch({})); + var memRgb = record(rgbForm.sketch({})); + var updatePalette = function (anyInSystem, hex) { + memPalette.getOpt(anyInSystem).each(function (palette) { + var rgba = fromHex(hex); + state.paletteRgba.set(rgba); + sbPalette.setRgba(palette, rgba); + }); + }; + var updateFields = function (anyInSystem, hex) { + memRgb.getOpt(anyInSystem).each(function (form) { + rgbForm.updateHex(form, hex); + }); + }; + var runUpdates = function (anyInSystem, hex, updates) { + each(updates, function (update) { + update(anyInSystem, hex); + }); + }; + var paletteUpdates = function () { + var updates = [updateFields]; + return function (form, simulatedEvent) { + var value = simulatedEvent.event.value; + var oldRgb = state.paletteRgba.get(); + var hsvColour$1 = fromRgb(oldRgb); + var newHsvColour = hsvColour(hsvColour$1.hue, value.x, 100 - value.y); + var rgb = fromHsv(newHsvColour); + var nuHex = fromRgba(rgb); + runUpdates(form, nuHex, updates); + }; + }; + var sliderUpdates = function () { + var updates = [ + updatePalette, + updateFields + ]; + return function (form, simulatedEvent) { + var value = simulatedEvent.event.value; + var hex = calcHex(value.y); + runUpdates(form, hex, updates); + }; }; - var colourPickerSketcher = single$2({ - name: 'ColourPicker', - configFields: [ - strict$1('dom'), - defaulted$1('onValidHex', noop), - defaulted$1('onInvalidHex', noop) - ], - factory: factory - }); - return colourPickerSketcher; + return { + uid: detail.uid, + dom: detail.dom, + components: [ + memPalette.asSpec(), + sliderFactory(translate, getClass), + memRgb.asSpec() + ], + behaviours: derive$1([ + config('colour-picker-events', [ + run(paletteUpdate, paletteUpdates()), + run(sliderUpdate, sliderUpdates()) + ]), + Composing.config({ + find: function (comp) { + return memRgb.getOpt(comp); + } + }), + Keying.config({ mode: 'acyclic' }) + ]) + }; + }; + var colourPickerSketcher = single$2({ + name: 'ColourPicker', + configFields: [ + strict$1('dom'), + defaulted$1('onValidHex', noop), + defaulted$1('onInvalidHex', noop) + ], + factory: factory + }); + return colourPickerSketcher; }; var self$1 = function () { - return Composing.config({find: Optional.some}); + return Composing.config({ find: Optional.some }); }; var memento = function (mem) { - return Composing.config({find: mem.getOpt}); + return Composing.config({ find: mem.getOpt }); }; var childAt = function (index) { - return Composing.config({ - find: function (comp) { - return child(comp.element, index).bind(function (element) { - return comp.getSystem().getByDom(element).toOptional(); - }); - } - }); + return Composing.config({ + find: function (comp) { + return child(comp.element, index).bind(function (element) { + return comp.getSystem().getByDom(element).toOptional(); + }); + } + }); }; var ComposingConfigs = { - self: self$1, - memento: memento, - childAt: childAt + self: self$1, + memento: memento, + childAt: childAt }; var english = { - 'colorcustom.rgb.red.label': 'R', - 'colorcustom.rgb.red.description': 'Red component', - 'colorcustom.rgb.green.label': 'G', - 'colorcustom.rgb.green.description': 'Green component', - 'colorcustom.rgb.blue.label': 'B', - 'colorcustom.rgb.blue.description': 'Blue component', - 'colorcustom.rgb.hex.label': '#', - 'colorcustom.rgb.hex.description': 'Hex color code', - 'colorcustom.rgb.range': 'Range 0 to 255', - 'colorcustom.sb.saturation': 'Saturation', - 'colorcustom.sb.brightness': 'Brightness', - 'colorcustom.sb.picker': 'Saturation and Brightness Picker', - 'colorcustom.sb.palette': 'Saturation and Brightness Palette', - 'colorcustom.sb.instructions': 'Use arrow keys to select saturation and brightness, on x and y axes', - 'colorcustom.hue.hue': 'Hue', - 'colorcustom.hue.slider': 'Hue Slider', - 'colorcustom.hue.palette': 'Hue Palette', - 'colorcustom.hue.instructions': 'Use arrow keys to select a hue', - 'aria.color.picker': 'Color Picker', - 'aria.input.invalid': 'Invalid input' + 'colorcustom.rgb.red.label': 'R', + 'colorcustom.rgb.red.description': 'Red component', + 'colorcustom.rgb.green.label': 'G', + 'colorcustom.rgb.green.description': 'Green component', + 'colorcustom.rgb.blue.label': 'B', + 'colorcustom.rgb.blue.description': 'Blue component', + 'colorcustom.rgb.hex.label': '#', + 'colorcustom.rgb.hex.description': 'Hex color code', + 'colorcustom.rgb.range': 'Range 0 to 255', + 'colorcustom.sb.saturation': 'Saturation', + 'colorcustom.sb.brightness': 'Brightness', + 'colorcustom.sb.picker': 'Saturation and Brightness Picker', + 'colorcustom.sb.palette': 'Saturation and Brightness Palette', + 'colorcustom.sb.instructions': 'Use arrow keys to select saturation and brightness, on x and y axes', + 'colorcustom.hue.hue': 'Hue', + 'colorcustom.hue.slider': 'Hue Slider', + 'colorcustom.hue.palette': 'Hue Palette', + 'colorcustom.hue.instructions': 'Use arrow keys to select a hue', + 'aria.color.picker': 'Color Picker', + 'aria.input.invalid': 'Invalid input' }; var getEnglishText = function (key) { - return english[key]; + return english[key]; }; var translate$1 = function (key) { - return getEnglishText(key); + return getEnglishText(key); }; var renderColorPicker = function (_spec) { - var getClass = function (key) { - return 'tox-' + key; - }; - var colourPickerFactory = makeFactory(translate$1, getClass); - var onValidHex = function (form) { - emitWith(form, formActionEvent, { - name: 'hex-valid', - value: true - }); - }; - var onInvalidHex = function (form) { - emitWith(form, formActionEvent, { - name: 'hex-valid', - value: false - }); - }; - var memPicker = record(colourPickerFactory.sketch({ - dom: { - tag: 'div', - classes: [getClass('color-picker-container')], - attributes: {role: 'presentation'} - }, - onValidHex: onValidHex, - onInvalidHex: onInvalidHex - })); - return { - dom: {tag: 'div'}, - components: [memPicker.asSpec()], - behaviours: derive$1([ - Representing.config({ - store: { - mode: 'manual', - getValue: function (comp) { - var picker = memPicker.get(comp); - var optRgbForm = Composing.getCurrent(picker); - var optHex = optRgbForm.bind(function (rgbForm) { - var formValues = Representing.getValue(rgbForm); - return formValues.hex; - }); - return optHex.map(function (hex) { - return '#' + hex; - }).getOr(''); - }, - setValue: function (comp, newValue) { - var pattern = /^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/; - var m = pattern.exec(newValue); - var picker = memPicker.get(comp); - var optRgbForm = Composing.getCurrent(picker); - optRgbForm.fold(function () { - console.log('Can not find form'); - }, function (rgbForm) { - Representing.setValue(rgbForm, {hex: Optional.from(m[1]).getOr('')}); - Form.getField(rgbForm, 'hex').each(function (hexField) { - emit(hexField, input()); - }); - }); - } - } - }), - ComposingConfigs.self() - ]) - }; + var getClass = function (key) { + return 'tox-' + key; + }; + var colourPickerFactory = makeFactory(translate$1, getClass); + var onValidHex = function (form) { + emitWith(form, formActionEvent, { + name: 'hex-valid', + value: true + }); + }; + var onInvalidHex = function (form) { + emitWith(form, formActionEvent, { + name: 'hex-valid', + value: false + }); + }; + var memPicker = record(colourPickerFactory.sketch({ + dom: { + tag: 'div', + classes: [getClass('color-picker-container')], + attributes: { role: 'presentation' } + }, + onValidHex: onValidHex, + onInvalidHex: onInvalidHex + })); + return { + dom: { tag: 'div' }, + components: [memPicker.asSpec()], + behaviours: derive$1([ + Representing.config({ + store: { + mode: 'manual', + getValue: function (comp) { + var picker = memPicker.get(comp); + var optRgbForm = Composing.getCurrent(picker); + var optHex = optRgbForm.bind(function (rgbForm) { + var formValues = Representing.getValue(rgbForm); + return formValues.hex; + }); + return optHex.map(function (hex) { + return '#' + hex; + }).getOr(''); + }, + setValue: function (comp, newValue) { + var pattern = /^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/; + var m = pattern.exec(newValue); + var picker = memPicker.get(comp); + var optRgbForm = Composing.getCurrent(picker); + optRgbForm.fold(function () { + console.log('Can not find form'); + }, function (rgbForm) { + Representing.setValue(rgbForm, { hex: Optional.from(m[1]).getOr('') }); + Form.getField(rgbForm, 'hex').each(function (hexField) { + emit(hexField, input()); + }); + }); + } + } + }), + ComposingConfigs.self() + ]) + }; }; var global$b = tinymce.util.Tools.resolve('tinymce.Resource'); var isOldCustomEditor = function (spec) { - return Object.prototype.hasOwnProperty.call(spec, 'init'); + return Object.prototype.hasOwnProperty.call(spec, 'init'); }; var renderCustomEditor = function (spec) { - var editorApi = Cell(Optional.none()); - var memReplaced = record({dom: {tag: spec.tag}}); - var initialValue = Cell(Optional.none()); - return { - dom: { - tag: 'div', - classes: ['tox-custom-editor'] - }, - behaviours: derive$1([ - config('custom-editor-events', [runOnAttached(function (component) { - memReplaced.getOpt(component).each(function (ta) { - (isOldCustomEditor(spec) ? spec.init(ta.element.dom) : global$b.load(spec.scriptId, spec.scriptUrl).then(function (init) { - return init(ta.element.dom, spec.settings); - })).then(function (ea) { - initialValue.get().each(function (cvalue) { - ea.setValue(cvalue); - }); - initialValue.set(Optional.none()); - editorApi.set(Optional.some(ea)); - }); - }); - })]), - Representing.config({ - store: { - mode: 'manual', - getValue: function () { - return editorApi.get().fold(function () { - return initialValue.get().getOr(''); - }, function (ed) { - return ed.getValue(); - }); - }, - setValue: function (component, value) { - editorApi.get().fold(function () { - initialValue.set(Optional.some(value)); - }, function (ed) { - return ed.setValue(value); - }); - } - } - }), - ComposingConfigs.self() - ]), - components: [memReplaced.asSpec()] - }; + var editorApi = Cell(Optional.none()); + var memReplaced = record({ dom: { tag: spec.tag } }); + var initialValue = Cell(Optional.none()); + return { + dom: { + tag: 'div', + classes: ['tox-custom-editor'] + }, + behaviours: derive$1([ + config('custom-editor-events', [runOnAttached(function (component) { + memReplaced.getOpt(component).each(function (ta) { + (isOldCustomEditor(spec) ? spec.init(ta.element.dom) : global$b.load(spec.scriptId, spec.scriptUrl).then(function (init) { + return init(ta.element.dom, spec.settings); + })).then(function (ea) { + initialValue.get().each(function (cvalue) { + ea.setValue(cvalue); + }); + initialValue.set(Optional.none()); + editorApi.set(Optional.some(ea)); + }); + }); + })]), + Representing.config({ + store: { + mode: 'manual', + getValue: function () { + return editorApi.get().fold(function () { + return initialValue.get().getOr(''); + }, function (ed) { + return ed.getValue(); + }); + }, + setValue: function (component, value) { + editorApi.get().fold(function () { + initialValue.set(Optional.some(value)); + }, function (ed) { + return ed.setValue(value); + }); + } + } + }), + ComposingConfigs.self() + ]), + components: [memReplaced.asSpec()] + }; }; var global$c = tinymce.util.Tools.resolve('tinymce.util.Tools'); var processors = objOf([ - defaulted$1('preprocess', identity), - defaulted$1('postprocess', identity) + defaulted$1('preprocess', identity), + defaulted$1('postprocess', identity) ]); var memento$1 = function (mem, rawProcessors) { - var ps = asRawOrDie('RepresentingConfigs.memento processors', processors, rawProcessors); - return Representing.config({ - store: { - mode: 'manual', - getValue: function (comp) { - var other = mem.get(comp); - var rawValue = Representing.getValue(other); - return ps.postprocess(rawValue); - }, - setValue: function (comp, rawValue) { - var newValue = ps.preprocess(rawValue); - var other = mem.get(comp); - Representing.setValue(other, newValue); - } - } - }); + var ps = asRawOrDie('RepresentingConfigs.memento processors', processors, rawProcessors); + return Representing.config({ + store: { + mode: 'manual', + getValue: function (comp) { + var other = mem.get(comp); + var rawValue = Representing.getValue(other); + return ps.postprocess(rawValue); + }, + setValue: function (comp, rawValue) { + var newValue = ps.preprocess(rawValue); + var other = mem.get(comp); + Representing.setValue(other, newValue); + } + } + }); }; var withComp = function (optInitialValue, getter, setter) { - return Representing.config(deepMerge({ - store: { - mode: 'manual', - getValue: getter, - setValue: setter - } - }, optInitialValue.map(function (initialValue) { - return {store: {initialValue: initialValue}}; - }).getOr({}))); + return Representing.config(deepMerge({ + store: { + mode: 'manual', + getValue: getter, + setValue: setter + } + }, optInitialValue.map(function (initialValue) { + return { store: { initialValue: initialValue } }; + }).getOr({}))); }; var withElement = function (initialValue, getter, setter) { - return withComp(initialValue, function (c) { - return getter(c.element); - }, function (c, v) { - return setter(c.element, v); - }); + return withComp(initialValue, function (c) { + return getter(c.element); + }, function (c, v) { + return setter(c.element, v); + }); }; var domValue = function (optInitialValue) { - return withElement(optInitialValue, get$6, set$3); + return withElement(optInitialValue, get$6, set$3); }; var domHtml = function (optInitialValue) { - return withElement(optInitialValue, get$2, set); + return withElement(optInitialValue, get$2, set); }; var memory$1 = function (initialValue) { - return Representing.config({ - store: { - mode: 'memory', - initialValue: initialValue - } - }); + return Representing.config({ + store: { + mode: 'memory', + initialValue: initialValue + } + }); }; var RepresentingConfigs = { - memento: memento$1, - withElement: withElement, - withComp: withComp, - domValue: domValue, - domHtml: domHtml, - memory: memory$1 + memento: memento$1, + withElement: withElement, + withComp: withComp, + domValue: domValue, + domHtml: domHtml, + memory: memory$1 }; var defaultImageFileTypes = 'jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp'; var filterByExtension = function (files, providersBackstage) { - var allowedImageFileTypes = global$c.explode(providersBackstage.getSetting('images_file_types', defaultImageFileTypes, 'string')); - var isFileInAllowedTypes = function (file) { - return exists(allowedImageFileTypes, function (type) { - return endsWith(file.name, '.' + type); - }); - }; - return filter(from$1(files), isFileInAllowedTypes); + var allowedImageFileTypes = global$c.explode(providersBackstage.getSetting('images_file_types', defaultImageFileTypes, 'string')); + var isFileInAllowedTypes = function (file) { + return exists(allowedImageFileTypes, function (type) { + return endsWith(file.name, '.' + type); + }); + }; + return filter(from$1(files), isFileInAllowedTypes); }; var renderDropZone = function (spec, providersBackstage) { - var stopper = function (_, se) { - se.stop(); - }; - var sequence = function (actions) { - return function (comp, se) { - each(actions, function (a) { - a(comp, se); - }); - }; - }; - var onDrop = function (comp, se) { - if (!Disabling.isDisabled(comp)) { - var transferEvent = se.event.raw; - handleFiles(comp, transferEvent.dataTransfer.files); - } - }; - var onSelect = function (component, simulatedEvent) { - var input = simulatedEvent.event.raw.target; - handleFiles(component, input.files); - }; - var handleFiles = function (component, files) { - Representing.setValue(component, filterByExtension(files, providersBackstage)); - emitWith(component, formChangeEvent, {name: spec.name}); - }; - var memInput = record({ - dom: { - tag: 'input', - attributes: { - type: 'file', - accept: 'image/*' - }, - styles: {display: 'none'} - }, - behaviours: derive$1([config('input-file-events', [ - cutter(click()), - cutter(tap()) - ])]) - }); - var renderField = function (s) { - return { - uid: s.uid, - dom: { - tag: 'div', - classes: ['tox-dropzone-container'] + var stopper = function (_, se) { + se.stop(); + }; + var sequence = function (actions) { + return function (comp, se) { + each(actions, function (a) { + a(comp, se); + }); + }; + }; + var onDrop = function (comp, se) { + if (!Disabling.isDisabled(comp)) { + var transferEvent = se.event.raw; + handleFiles(comp, transferEvent.dataTransfer.files); + } + }; + var onSelect = function (component, simulatedEvent) { + var input = simulatedEvent.event.raw.target; + handleFiles(component, input.files); + }; + var handleFiles = function (component, files) { + Representing.setValue(component, filterByExtension(files, providersBackstage)); + emitWith(component, formChangeEvent, { name: spec.name }); + }; + var memInput = record({ + dom: { + tag: 'input', + attributes: { + type: 'file', + accept: 'image/*' + }, + styles: { display: 'none' } + }, + behaviours: derive$1([config('input-file-events', [ + cutter(click()), + cutter(tap()) + ])]) + }); + var renderField = function (s) { + return { + uid: s.uid, + dom: { + tag: 'div', + classes: ['tox-dropzone-container'] + }, + behaviours: derive$1([ + RepresentingConfigs.memory([]), + ComposingConfigs.self(), + Disabling.config({}), + Toggling.config({ + toggleClass: 'dragenter', + toggleOnExecute: false + }), + config('dropzone-events', [ + run('dragenter', sequence([ + stopper, + Toggling.toggle + ])), + run('dragleave', sequence([ + stopper, + Toggling.toggle + ])), + run('dragover', stopper), + run('drop', sequence([ + stopper, + onDrop + ])), + run(change(), onSelect) + ]) + ]), + components: [{ + dom: { + tag: 'div', + classes: ['tox-dropzone'], + styles: {} + }, + components: [ + { + dom: { + tag: 'p', + innerHtml: providersBackstage.translate('Drop an image here') + } }, - behaviours: derive$1([ - RepresentingConfigs.memory([]), - ComposingConfigs.self(), - Disabling.config({}), - Toggling.config({ - toggleClass: 'dragenter', - toggleOnExecute: false - }), - config('dropzone-events', [ - run('dragenter', sequence([ - stopper, - Toggling.toggle - ])), - run('dragleave', sequence([ - stopper, - Toggling.toggle - ])), - run('dragover', stopper), - run('drop', sequence([ - stopper, - onDrop - ])), - run(change(), onSelect) - ]) - ]), - components: [{ - dom: { - tag: 'div', - classes: ['tox-dropzone'], - styles: {} - }, - components: [ - { - dom: { - tag: 'p', - innerHtml: providersBackstage.translate('Drop an image here') - } - }, - Button.sketch({ - dom: { - tag: 'button', - innerHtml: providersBackstage.translate('Browse for an image'), - styles: {position: 'relative'}, - classes: [ - 'tox-button', - 'tox-button--secondary' - ] - }, - components: [memInput.asSpec()], - action: function (comp) { - var inputComp = memInput.get(comp); - inputComp.element.dom.click(); - }, - buttonBehaviours: derive$1([ - Tabstopping.config({}), - DisablingConfigs.button(providersBackstage.isDisabled), - receivingConfig() - ]) - }) + Button.sketch({ + dom: { + tag: 'button', + innerHtml: providersBackstage.translate('Browse for an image'), + styles: { position: 'relative' }, + classes: [ + 'tox-button', + 'tox-button--secondary' ] - }] - }; + }, + components: [memInput.asSpec()], + action: function (comp) { + var inputComp = memInput.get(comp); + inputComp.element.dom.click(); + }, + buttonBehaviours: derive$1([ + Tabstopping.config({}), + DisablingConfigs.button(providersBackstage.isDisabled), + receivingConfig() + ]) + }) + ] + }] }; - var pLabel = spec.label.map(function (label) { - return renderLabel(label, providersBackstage); - }); - var pField = FormField.parts.field({factory: {sketch: renderField}}); - return renderFormFieldWith(pLabel, pField, ['tox-form__group--stretched'], []); + }; + var pLabel = spec.label.map(function (label) { + return renderLabel(label, providersBackstage); + }); + var pField = FormField.parts.field({ factory: { sketch: renderField } }); + return renderFormFieldWith(pLabel, pField, ['tox-form__group--stretched'], []); }; var renderGrid = function (spec, backstage) { - return { - dom: { - tag: 'div', - classes: [ - 'tox-form__grid', - 'tox-form__grid--' + spec.columns + 'col' - ] - }, - components: map(spec.items, backstage.interpreter) - }; + return { + dom: { + tag: 'div', + classes: [ + 'tox-form__grid', + 'tox-form__grid--' + spec.columns + 'col' + ] + }, + components: map(spec.items, backstage.interpreter) + }; }; var beforeObject = generate$1('alloy-fake-before-tabstop'); var afterObject = generate$1('alloy-fake-after-tabstop'); var craftWithClasses = function (classes) { - return { - dom: { - tag: 'div', - styles: { - width: '1px', - height: '1px', - outline: 'none' - }, - attributes: {tabindex: '0'}, - classes: classes - }, - behaviours: derive$1([ - Focusing.config({ignore: true}), - Tabstopping.config({}) - ]) - }; + return { + dom: { + tag: 'div', + styles: { + width: '1px', + height: '1px', + outline: 'none' + }, + attributes: { tabindex: '0' }, + classes: classes + }, + behaviours: derive$1([ + Focusing.config({ ignore: true }), + Tabstopping.config({}) + ]) + }; }; var craft = function (spec) { - return { - dom: { - tag: 'div', - classes: ['tox-navobj'] - }, - components: [ - craftWithClasses([beforeObject]), - spec, - craftWithClasses([afterObject]) - ], - behaviours: derive$1([ComposingConfigs.childAt(1)]) - }; + return { + dom: { + tag: 'div', + classes: ['tox-navobj'] + }, + components: [ + craftWithClasses([beforeObject]), + spec, + craftWithClasses([afterObject]) + ], + behaviours: derive$1([ComposingConfigs.childAt(1)]) + }; }; var triggerTab = function (placeholder, shiftKey) { - emitWith(placeholder, keydown(), { - raw: { - which: 9, - shiftKey: shiftKey - } - }); + emitWith(placeholder, keydown(), { + raw: { + which: 9, + shiftKey: shiftKey + } + }); }; var onFocus$1 = function (container, targetComp) { - var target = targetComp.element; - if (has$2(target, beforeObject)) { - triggerTab(container, true); - } else if (has$2(target, afterObject)) { - triggerTab(container, false); - } + var target = targetComp.element; + if (has$2(target, beforeObject)) { + triggerTab(container, true); + } else if (has$2(target, afterObject)) { + triggerTab(container, false); + } }; var isPseudoStop = function (element) { - return closest$4(element, [ - '.' + beforeObject, - '.' + afterObject - ].join(','), never); + return closest$4(element, [ + '.' + beforeObject, + '.' + afterObject + ].join(','), never); }; var platformNeedsSandboxing = !(detect$3().browser.isIE() || detect$3().browser.isEdge()); var getDynamicSource = function (isSandbox) { - var cachedValue = Cell(''); - return { - getValue: function (_frameComponent) { - return cachedValue.get(); - }, - setValue: function (frameComponent, html) { - if (!isSandbox) { - set$1(frameComponent.element, 'src', 'javascript:\'\''); - var doc = frameComponent.element.dom.contentWindow.document; - doc.open(); - doc.write(html); - doc.close(); - } else { - set$1(frameComponent.element, 'srcdoc', html); - } - cachedValue.set(html); - } - }; + var cachedValue = Cell(''); + return { + getValue: function (_frameComponent) { + return cachedValue.get(); + }, + setValue: function (frameComponent, html) { + if (!isSandbox) { + set$1(frameComponent.element, 'src', 'javascript:\'\''); + var doc = frameComponent.element.dom.contentWindow.document; + doc.open(); + doc.write(html); + doc.close(); + } else { + set$1(frameComponent.element, 'srcdoc', html); + } + cachedValue.set(html); + } + }; }; var renderIFrame = function (spec, providersBackstage) { - var isSandbox = platformNeedsSandboxing && spec.sandboxed; - var attributes = __assign(__assign({}, spec.label.map(function (title) { - return {title: title}; - }).getOr({})), isSandbox ? {sandbox: 'allow-scripts allow-same-origin'} : {}); - var sourcing = getDynamicSource(isSandbox); - var pLabel = spec.label.map(function (label) { - return renderLabel(label, providersBackstage); - }); - var factory = function (newSpec) { - return craft({ - uid: newSpec.uid, - dom: { - tag: 'iframe', - attributes: attributes - }, - behaviours: derive$1([ - Tabstopping.config({}), - Focusing.config({}), - RepresentingConfigs.withComp(Optional.none(), sourcing.getValue, sourcing.setValue) - ]) - }); - }; - var pField = FormField.parts.field({factory: {sketch: factory}}); - return renderFormFieldWith(pLabel, pField, ['tox-form__group--stretched'], []); + var isSandbox = platformNeedsSandboxing && spec.sandboxed; + var attributes = __assign(__assign({}, spec.label.map(function (title) { + return { title: title }; + }).getOr({})), isSandbox ? { sandbox: 'allow-scripts allow-same-origin' } : {}); + var sourcing = getDynamicSource(isSandbox); + var pLabel = spec.label.map(function (label) { + return renderLabel(label, providersBackstage); + }); + var factory = function (newSpec) { + return craft({ + uid: newSpec.uid, + dom: { + tag: 'iframe', + attributes: attributes + }, + behaviours: derive$1([ + Tabstopping.config({}), + Focusing.config({}), + RepresentingConfigs.withComp(Optional.none(), sourcing.getValue, sourcing.setValue) + ]) + }); + }; + var pField = FormField.parts.field({ factory: { sketch: factory } }); + return renderFormFieldWith(pLabel, pField, ['tox-form__group--stretched'], []); }; function create$5(width, height) { - return resize(document.createElement('canvas'), width, height); + return resize(document.createElement('canvas'), width, height); } - function clone$1(canvas) { - var tCanvas = create$5(canvas.width, canvas.height); - var ctx = get2dContext(tCanvas); - ctx.drawImage(canvas, 0, 0); - return tCanvas; + var tCanvas = create$5(canvas.width, canvas.height); + var ctx = get2dContext(tCanvas); + ctx.drawImage(canvas, 0, 0); + return tCanvas; } - function get2dContext(canvas) { - return canvas.getContext('2d'); + return canvas.getContext('2d'); } - function resize(canvas, width, height) { - canvas.width = width; - canvas.height = height; - return canvas; + canvas.width = width; + canvas.height = height; + return canvas; } function getWidth(image) { - return image.naturalWidth || image.width; + return image.naturalWidth || image.width; } - function getHeight(image) { - return image.naturalHeight || image.height; + return image.naturalHeight || image.height; } var promise = function () { - var Promise = function (fn) { - if (typeof this !== 'object') { - throw new TypeError('Promises must be constructed via new'); - } - if (typeof fn !== 'function') { - throw new TypeError('not a function'); + var Promise = function (fn) { + if (typeof this !== 'object') { + throw new TypeError('Promises must be constructed via new'); + } + if (typeof fn !== 'function') { + throw new TypeError('not a function'); + } + this._state = null; + this._value = null; + this._deferreds = []; + doResolve(fn, bind(resolve, this), bind(reject, this)); + }; + var anyWindow = window; + var asap = Promise.immediateFn || typeof anyWindow.setImmediate === 'function' && anyWindow.setImmediate || function (fn) { + setTimeout(fn, 1); + }; + function bind(fn, thisArg) { + return function () { + return fn.apply(thisArg, arguments); + }; + } + var isArray = Array.isArray || function (value) { + return Object.prototype.toString.call(value) === '[object Array]'; + }; + function handle(deferred) { + var me = this; + if (this._state === null) { + this._deferreds.push(deferred); + return; + } + asap(function () { + var cb = me._state ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (me._state ? deferred.resolve : deferred.reject)(me._value); + return; + } + var ret; + try { + ret = cb(me._value); + } catch (e) { + deferred.reject(e); + return; + } + deferred.resolve(ret); + }); + } + function resolve(newValue) { + try { + if (newValue === this) { + throw new TypeError('A promise cannot be resolved with itself.'); + } + if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { + var then = newValue.then; + if (typeof then === 'function') { + doResolve(bind(then, newValue), bind(resolve, this), bind(reject, this)); + return; + } + } + this._state = true; + this._value = newValue; + finale.call(this); + } catch (e) { + reject.call(this, e); + } + } + function reject(newValue) { + this._state = false; + this._value = newValue; + finale.call(this); + } + function finale() { + for (var _i = 0, _a = this._deferreds; _i < _a.length; _i++) { + var deferred = _a[_i]; + handle.call(this, deferred); + } + this._deferreds = []; + } + function Handler(onFulfilled, onRejected, resolve, reject) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.resolve = resolve; + this.reject = reject; + } + function doResolve(fn, onFulfilled, onRejected) { + var done = false; + try { + fn(function (value) { + if (done) { + return; + } + done = true; + onFulfilled(value); + }, function (reason) { + if (done) { + return; + } + done = true; + onRejected(reason); + }); + } catch (ex) { + if (done) { + return; + } + done = true; + onRejected(ex); + } + } + Promise.prototype.catch = function (onRejected) { + return this.then(null, onRejected); + }; + Promise.prototype.then = function (onFulfilled, onRejected) { + var me = this; + return new Promise(function (resolve, reject) { + handle.call(me, new Handler(onFulfilled, onRejected, resolve, reject)); + }); + }; + Promise.all = function () { + var values = []; + for (var _i = 0; _i < arguments.length; _i++) { + values[_i] = arguments[_i]; + } + var args = Array.prototype.slice.call(values.length === 1 && isArray(values[0]) ? values[0] : values); + return new Promise(function (resolve, reject) { + if (args.length === 0) { + return resolve([]); + } + var remaining = args.length; + function res(i, val) { + try { + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call(val, function (val) { + res(i, val); + }, reject); + return; + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); } - this._state = null; - this._value = null; - this._deferreds = []; - doResolve(fn, bind(resolve, this), bind(reject, this)); - }; - var anyWindow = window; - var asap = Promise.immediateFn || typeof anyWindow.setImmediate === 'function' && anyWindow.setImmediate || function (fn) { - setTimeout(fn, 1); - }; - - function bind(fn, thisArg) { - return function () { - return fn.apply(thisArg, arguments); - }; + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; } - - var isArray = Array.isArray || function (value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - - function handle(deferred) { - var me = this; - if (this._state === null) { - this._deferreds.push(deferred); - return; - } - asap(function () { - var cb = me._state ? deferred.onFulfilled : deferred.onRejected; - if (cb === null) { - (me._state ? deferred.resolve : deferred.reject)(me._value); - return; - } - var ret; - try { - ret = cb(me._value); - } catch (e) { - deferred.reject(e); - return; - } - deferred.resolve(ret); - }); - } - - function resolve(newValue) { - try { - if (newValue === this) { - throw new TypeError('A promise cannot be resolved with itself.'); - } - if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { - var then = newValue.then; - if (typeof then === 'function') { - doResolve(bind(then, newValue), bind(resolve, this), bind(reject, this)); - return; - } - } - this._state = true; - this._value = newValue; - finale.call(this); - } catch (e) { - reject.call(this, e); - } - } - - function reject(newValue) { - this._state = false; - this._value = newValue; - finale.call(this); - } - - function finale() { - for (var _i = 0, _a = this._deferreds; _i < _a.length; _i++) { - var deferred = _a[_i]; - handle.call(this, deferred); - } - this._deferreds = []; - } - - function Handler(onFulfilled, onRejected, resolve, reject) { - this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; - this.onRejected = typeof onRejected === 'function' ? onRejected : null; - this.resolve = resolve; - this.reject = reject; - } - - function doResolve(fn, onFulfilled, onRejected) { - var done = false; - try { - fn(function (value) { - if (done) { - return; - } - done = true; - onFulfilled(value); - }, function (reason) { - if (done) { - return; - } - done = true; - onRejected(reason); - }); - } catch (ex) { - if (done) { - return; - } - done = true; - onRejected(ex); - } - } - - Promise.prototype.catch = function (onRejected) { - return this.then(null, onRejected); - }; - Promise.prototype.then = function (onFulfilled, onRejected) { - var me = this; - return new Promise(function (resolve, reject) { - handle.call(me, new Handler(onFulfilled, onRejected, resolve, reject)); - }); - }; - Promise.all = function () { - var values = []; - for (var _i = 0; _i < arguments.length; _i++) { - values[_i] = arguments[_i]; - } - var args = Array.prototype.slice.call(values.length === 1 && isArray(values[0]) ? values[0] : values); - return new Promise(function (resolve, reject) { - if (args.length === 0) { - return resolve([]); - } - var remaining = args.length; - - function res(i, val) { - try { - if (val && (typeof val === 'object' || typeof val === 'function')) { - var then = val.then; - if (typeof then === 'function') { - then.call(val, function (val) { - res(i, val); - }, reject); - return; - } - } - args[i] = val; - if (--remaining === 0) { - resolve(args); - } - } catch (ex) { - reject(ex); - } - } - - for (var i = 0; i < args.length; i++) { - res(i, args[i]); - } - }); - }; - Promise.resolve = function (value) { - if (value && typeof value === 'object' && value.constructor === Promise) { - return value; - } - return new Promise(function (resolve) { - resolve(value); - }); - }; - Promise.reject = function (reason) { - return new Promise(function (resolve, reject) { - reject(reason); - }); - }; - Promise.race = function (values) { - return new Promise(function (resolve, reject) { - for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { - var value = values_1[_i]; - value.then(resolve, reject); - } - }); - }; - return Promise; + return new Promise(function (resolve) { + resolve(value); + }); + }; + Promise.reject = function (reason) { + return new Promise(function (resolve, reject) { + reject(reason); + }); + }; + Promise.race = function (values) { + return new Promise(function (resolve, reject) { + for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { + var value = values_1[_i]; + value.then(resolve, reject); + } + }); + }; + return Promise; }; var Promise$1 = window.Promise ? window.Promise : promise(); function blobToImage(blob) { - return new Promise$1(function (resolve, reject) { - var blobUrl = URL.createObjectURL(blob); - var image = new Image(); - var removeListeners = function () { - image.removeEventListener('load', loaded); - image.removeEventListener('error', error); - }; - - function loaded() { - removeListeners(); - resolve(image); - } - - function error() { - removeListeners(); - reject('Unable to load data of type ' + blob.type + ': ' + blobUrl); - } - - image.addEventListener('load', loaded); - image.addEventListener('error', error); - image.src = blobUrl; - if (image.complete) { - loaded(); - } - }); + return new Promise$1(function (resolve, reject) { + var blobUrl = URL.createObjectURL(blob); + var image = new Image(); + var removeListeners = function () { + image.removeEventListener('load', loaded); + image.removeEventListener('error', error); + }; + function loaded() { + removeListeners(); + resolve(image); + } + function error() { + removeListeners(); + reject('Unable to load data of type ' + blob.type + ': ' + blobUrl); + } + image.addEventListener('load', loaded); + image.addEventListener('error', error); + image.src = blobUrl; + if (image.complete) { + loaded(); + } + }); } - function dataUriToBlobSync(uri) { - var data = uri.split(','); - var matches = /data:([^;]+)/.exec(data[0]); - if (!matches) { - return Optional.none(); - } - var mimetype = matches[1]; - var base64 = data[1]; - var sliceSize = 1024; - var byteCharacters = atob(base64); - var bytesLength = byteCharacters.length; - var slicesCount = Math.ceil(bytesLength / sliceSize); - var byteArrays = new Array(slicesCount); - for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) { - var begin = sliceIndex * sliceSize; - var end = Math.min(begin + sliceSize, bytesLength); - var bytes = new Array(end - begin); - for (var offset = begin, i = 0; offset < end; ++i, ++offset) { - bytes[i] = byteCharacters[offset].charCodeAt(0); - } - byteArrays[sliceIndex] = new Uint8Array(bytes); - } - return Optional.some(new Blob(byteArrays, {type: mimetype})); + var data = uri.split(','); + var matches = /data:([^;]+)/.exec(data[0]); + if (!matches) { + return Optional.none(); + } + var mimetype = matches[1]; + var base64 = data[1]; + var sliceSize = 1024; + var byteCharacters = atob(base64); + var bytesLength = byteCharacters.length; + var slicesCount = Math.ceil(bytesLength / sliceSize); + var byteArrays = new Array(slicesCount); + for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) { + var begin = sliceIndex * sliceSize; + var end = Math.min(begin + sliceSize, bytesLength); + var bytes = new Array(end - begin); + for (var offset = begin, i = 0; offset < end; ++i, ++offset) { + bytes[i] = byteCharacters[offset].charCodeAt(0); + } + byteArrays[sliceIndex] = new Uint8Array(bytes); + } + return Optional.some(new Blob(byteArrays, { type: mimetype })); } - function dataUriToBlob(uri) { - return new Promise$1(function (resolve, reject) { - dataUriToBlobSync(uri).fold(function () { - reject('uri is not base64: ' + uri); - }, resolve); - }); + return new Promise$1(function (resolve, reject) { + dataUriToBlobSync(uri).fold(function () { + reject('uri is not base64: ' + uri); + }, resolve); + }); } - function canvasToBlob(canvas, type, quality) { - type = type || 'image/png'; - if (isFunction(HTMLCanvasElement.prototype.toBlob)) { - return new Promise$1(function (resolve, reject) { - canvas.toBlob(function (blob) { - if (blob) { - resolve(blob); - } else { - reject(); - } - }, type, quality); - }); - } else { - return dataUriToBlob(canvas.toDataURL(type, quality)); - } + type = type || 'image/png'; + if (isFunction(HTMLCanvasElement.prototype.toBlob)) { + return new Promise$1(function (resolve, reject) { + canvas.toBlob(function (blob) { + if (blob) { + resolve(blob); + } else { + reject(); + } + }, type, quality); + }); + } else { + return dataUriToBlob(canvas.toDataURL(type, quality)); + } } - function canvasToDataURL(canvas, type, quality) { - type = type || 'image/png'; - return canvas.toDataURL(type, quality); + type = type || 'image/png'; + return canvas.toDataURL(type, quality); } - function blobToCanvas(blob) { - return blobToImage(blob).then(function (image) { - revokeImageUrl(image); - var canvas = create$5(getWidth(image), getHeight(image)); - var context = get2dContext(canvas); - context.drawImage(image, 0, 0); - return canvas; - }); + return blobToImage(blob).then(function (image) { + revokeImageUrl(image); + var canvas = create$5(getWidth(image), getHeight(image)); + var context = get2dContext(canvas); + context.drawImage(image, 0, 0); + return canvas; + }); } - function blobToDataUri(blob) { - return new Promise$1(function (resolve) { - var reader = new FileReader(); - reader.onloadend = function () { - resolve(reader.result); - }; - reader.readAsDataURL(blob); - }); + return new Promise$1(function (resolve) { + var reader = new FileReader(); + reader.onloadend = function () { + resolve(reader.result); + }; + reader.readAsDataURL(blob); + }); } - function revokeImageUrl(image) { - URL.revokeObjectURL(image.src); + URL.revokeObjectURL(image.src); } function create$6(getCanvas, blob, uri) { - var initialType = blob.type; - var getType = constant(initialType); - - function toBlob() { - return Promise$1.resolve(blob); - } - - var toDataURL = constant(uri); - - function toBase64() { - return uri.split(',')[1]; - } - - function toAdjustedBlob(type, quality) { - return getCanvas.then(function (canvas) { - return canvasToBlob(canvas, type, quality); - }); - } - - function toAdjustedDataURL(type, quality) { - return getCanvas.then(function (canvas) { - return canvasToDataURL(canvas, type, quality); - }); - } - - function toAdjustedBase64(type, quality) { - return toAdjustedDataURL(type, quality).then(function (dataurl) { - return dataurl.split(',')[1]; - }); - } - - function toCanvas() { - return getCanvas.then(clone$1); - } - - return { - getType: getType, - toBlob: toBlob, - toDataURL: toDataURL, - toBase64: toBase64, - toAdjustedBlob: toAdjustedBlob, - toAdjustedDataURL: toAdjustedDataURL, - toAdjustedBase64: toAdjustedBase64, - toCanvas: toCanvas - }; + var initialType = blob.type; + var getType = constant(initialType); + function toBlob() { + return Promise$1.resolve(blob); + } + var toDataURL = constant(uri); + function toBase64() { + return uri.split(',')[1]; + } + function toAdjustedBlob(type, quality) { + return getCanvas.then(function (canvas) { + return canvasToBlob(canvas, type, quality); + }); + } + function toAdjustedDataURL(type, quality) { + return getCanvas.then(function (canvas) { + return canvasToDataURL(canvas, type, quality); + }); + } + function toAdjustedBase64(type, quality) { + return toAdjustedDataURL(type, quality).then(function (dataurl) { + return dataurl.split(',')[1]; + }); + } + function toCanvas() { + return getCanvas.then(clone$1); + } + return { + getType: getType, + toBlob: toBlob, + toDataURL: toDataURL, + toBase64: toBase64, + toAdjustedBlob: toAdjustedBlob, + toAdjustedDataURL: toAdjustedDataURL, + toAdjustedBase64: toAdjustedBase64, + toCanvas: toCanvas + }; } - function fromBlob(blob) { - return blobToDataUri(blob).then(function (uri) { - return create$6(blobToCanvas(blob), blob, uri); - }); + return blobToDataUri(blob).then(function (uri) { + return create$6(blobToCanvas(blob), blob, uri); + }); } - function fromCanvas(canvas, type) { - return canvasToBlob(canvas, type).then(function (blob) { - return create$6(Promise$1.resolve(canvas), blob, canvas.toDataURL()); - }); + return canvasToBlob(canvas, type).then(function (blob) { + return create$6(Promise$1.resolve(canvas), blob, canvas.toDataURL()); + }); } var blobToImageResult = function (blob) { - return fromBlob(blob); + return fromBlob(blob); }; function clamp$1(value, min, max) { - var parsedValue = typeof value === 'string' ? parseFloat(value) : value; - if (parsedValue > max) { - parsedValue = max; - } else if (parsedValue < min) { - parsedValue = min; - } - return parsedValue; + var parsedValue = typeof value === 'string' ? parseFloat(value) : value; + if (parsedValue > max) { + parsedValue = max; + } else if (parsedValue < min) { + parsedValue = min; + } + return parsedValue; } - function identity$1() { - return [ - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 1 - ]; - } - - var DELTA_INDEX = [ + return [ + 1, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, 0, - 0.01, - 0.02, - 0.04, - 0.05, - 0.06, - 0.07, - 0.08, - 0.1, - 0.11, - 0.12, - 0.14, - 0.15, - 0.16, - 0.17, - 0.18, - 0.2, - 0.21, - 0.22, - 0.24, - 0.25, - 0.27, - 0.28, - 0.3, - 0.32, - 0.34, - 0.36, - 0.38, - 0.4, - 0.42, - 0.44, - 0.46, - 0.48, - 0.5, - 0.53, - 0.56, - 0.59, - 0.62, - 0.65, - 0.68, - 0.71, - 0.74, - 0.77, - 0.8, - 0.83, - 0.86, - 0.89, - 0.92, - 0.95, - 0.98, 1, - 1.06, - 1.12, - 1.18, - 1.24, - 1.3, - 1.36, - 1.42, - 1.48, - 1.54, - 1.6, - 1.66, - 1.72, - 1.78, - 1.84, - 1.9, - 1.96, - 2, - 2.12, - 2.25, - 2.37, - 2.5, - 2.62, - 2.75, - 2.87, - 3, - 3.2, - 3.4, - 3.6, - 3.8, - 4, - 4.3, - 4.7, - 4.9, - 5, - 5.5, - 6, - 6.5, - 6.8, - 7, - 7.3, - 7.5, - 7.8, - 8, - 8.4, - 8.7, - 9, - 9.4, - 9.6, - 9.8, - 10 + 0, + 0, + 0, + 0, + 0, + 1 + ]; + } + var DELTA_INDEX = [ + 0, + 0.01, + 0.02, + 0.04, + 0.05, + 0.06, + 0.07, + 0.08, + 0.1, + 0.11, + 0.12, + 0.14, + 0.15, + 0.16, + 0.17, + 0.18, + 0.2, + 0.21, + 0.22, + 0.24, + 0.25, + 0.27, + 0.28, + 0.3, + 0.32, + 0.34, + 0.36, + 0.38, + 0.4, + 0.42, + 0.44, + 0.46, + 0.48, + 0.5, + 0.53, + 0.56, + 0.59, + 0.62, + 0.65, + 0.68, + 0.71, + 0.74, + 0.77, + 0.8, + 0.83, + 0.86, + 0.89, + 0.92, + 0.95, + 0.98, + 1, + 1.06, + 1.12, + 1.18, + 1.24, + 1.3, + 1.36, + 1.42, + 1.48, + 1.54, + 1.6, + 1.66, + 1.72, + 1.78, + 1.84, + 1.9, + 1.96, + 2, + 2.12, + 2.25, + 2.37, + 2.5, + 2.62, + 2.75, + 2.87, + 3, + 3.2, + 3.4, + 3.6, + 3.8, + 4, + 4.3, + 4.7, + 4.9, + 5, + 5.5, + 6, + 6.5, + 6.8, + 7, + 7.3, + 7.5, + 7.8, + 8, + 8.4, + 8.7, + 9, + 9.4, + 9.6, + 9.8, + 10 ]; - function multiply(matrix1, matrix2) { - var col = []; - var out = new Array(25); - var val; - for (var i = 0; i < 5; i++) { - for (var j = 0; j < 5; j++) { - col[j] = matrix2[j + i * 5]; - } - for (var j = 0; j < 5; j++) { - val = 0; - for (var k = 0; k < 5; k++) { - val += matrix1[j + k * 5] * col[k]; - } - out[j + i * 5] = val; - } - } - return out; + var col = []; + var out = new Array(25); + var val; + for (var i = 0; i < 5; i++) { + for (var j = 0; j < 5; j++) { + col[j] = matrix2[j + i * 5]; + } + for (var j = 0; j < 5; j++) { + val = 0; + for (var k = 0; k < 5; k++) { + val += matrix1[j + k * 5] * col[k]; + } + out[j + i * 5] = val; + } + } + return out; } - function adjustContrast(matrix, value) { - var x; - value = clamp$1(value, -1, 1); - value *= 100; - if (value < 0) { - x = 127 + value / 100 * 127; + var x; + value = clamp$1(value, -1, 1); + value *= 100; + if (value < 0) { + x = 127 + value / 100 * 127; + } else { + x = value % 1; + if (x === 0) { + x = DELTA_INDEX[value]; } else { - x = value % 1; - if (x === 0) { - x = DELTA_INDEX[value]; - } else { - x = DELTA_INDEX[Math.floor(value)] * (1 - x) + DELTA_INDEX[Math.floor(value) + 1] * x; - } - x = x * 127 + 127; - } - return multiply(matrix, [ - x / 127, - 0, - 0, - 0, - 0.5 * (127 - x), - 0, - x / 127, - 0, - 0, - 0.5 * (127 - x), - 0, - 0, - x / 127, - 0, - 0.5 * (127 - x), - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 1 - ]); - } - - function adjustBrightness(matrix, value) { - value = clamp$1(255 * value, -255, 255); - return multiply(matrix, [ - 1, - 0, - 0, - 0, - value, - 0, - 1, - 0, - 0, - value, - 0, - 0, - 1, - 0, - value, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 1 - ]); - } - - function adjustColors(matrix, adjustR, adjustG, adjustB) { - adjustR = clamp$1(adjustR, 0, 2); - adjustG = clamp$1(adjustG, 0, 2); - adjustB = clamp$1(adjustB, 0, 2); - return multiply(matrix, [ - adjustR, - 0, - 0, - 0, - 0, - 0, - adjustG, - 0, - 0, - 0, - 0, - 0, - adjustB, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 1 - ]); - } - - function colorFilter(ir, matrix) { - return ir.toCanvas().then(function (canvas) { - return applyColorFilter(canvas, ir.getType(), matrix); - }); - } - - function applyColorFilter(canvas, type, matrix) { - var context = get2dContext(canvas); - - function applyMatrix(pixelsData, m) { - var r, g, b, a; - var data = pixelsData.data, m0 = m[0], m1 = m[1], m2 = m[2], m3 = m[3], m4 = m[4], m5 = m[5], m6 = m[6], - m7 = m[7], m8 = m[8], m9 = m[9], m10 = m[10], m11 = m[11], m12 = m[12], m13 = m[13], m14 = m[14], - m15 = m[15], m16 = m[16], m17 = m[17], m18 = m[18], m19 = m[19]; - for (var i = 0; i < data.length; i += 4) { - r = data[i]; - g = data[i + 1]; - b = data[i + 2]; - a = data[i + 3]; - data[i] = r * m0 + g * m1 + b * m2 + a * m3 + m4; - data[i + 1] = r * m5 + g * m6 + b * m7 + a * m8 + m9; - data[i + 2] = r * m10 + g * m11 + b * m12 + a * m13 + m14; - data[i + 3] = r * m15 + g * m16 + b * m17 + a * m18 + m19; - } - return pixelsData; - } - - var pixels = applyMatrix(context.getImageData(0, 0, canvas.width, canvas.height), matrix); - context.putImageData(pixels, 0, 0); - return fromCanvas(canvas, type); - } - - function convoluteFilter(ir, matrix) { - return ir.toCanvas().then(function (canvas) { - return applyConvoluteFilter(canvas, ir.getType(), matrix); - }); - } - - function applyConvoluteFilter(canvas, type, matrix) { - var context = get2dContext(canvas); - - function applyMatrix(pIn, pOut, aMatrix) { - function clamp(value, min, max) { - if (value > max) { - value = max; - } else if (value < min) { - value = min; - } - return value; - } - - var side = Math.round(Math.sqrt(aMatrix.length)); - var halfSide = Math.floor(side / 2); - var rgba = pIn.data; - var drgba = pOut.data; - var w = pIn.width; - var h = pIn.height; - for (var y = 0; y < h; y++) { - for (var x = 0; x < w; x++) { - var r = 0; - var g = 0; - var b = 0; - for (var cy = 0; cy < side; cy++) { - for (var cx = 0; cx < side; cx++) { - var scx = clamp(x + cx - halfSide, 0, w - 1); - var scy = clamp(y + cy - halfSide, 0, h - 1); - var innerOffset = (scy * w + scx) * 4; - var wt = aMatrix[cy * side + cx]; - r += rgba[innerOffset] * wt; - g += rgba[innerOffset + 1] * wt; - b += rgba[innerOffset + 2] * wt; - } - } - var offset = (y * w + x) * 4; - drgba[offset] = clamp(r, 0, 255); - drgba[offset + 1] = clamp(g, 0, 255); - drgba[offset + 2] = clamp(b, 0, 255); - } - } - return pOut; + x = DELTA_INDEX[Math.floor(value)] * (1 - x) + DELTA_INDEX[Math.floor(value) + 1] * x; } - - var pixelsIn = context.getImageData(0, 0, canvas.width, canvas.height); - var pixelsOut = context.getImageData(0, 0, canvas.width, canvas.height); - pixelsOut = applyMatrix(pixelsIn, pixelsOut, matrix); - context.putImageData(pixelsOut, 0, 0); - return fromCanvas(canvas, type); - } - - function functionColorFilter(colorFn) { - var filterImpl = function (canvas, type, value) { - var context = get2dContext(canvas); - var lookup = new Array(256); - - function applyLookup(pixelsData, lookupData) { - var data = pixelsData.data; - for (var i = 0; i < data.length; i += 4) { - data[i] = lookupData[data[i]]; - data[i + 1] = lookupData[data[i + 1]]; - data[i + 2] = lookupData[data[i + 2]]; - } - return pixelsData; - } - - for (var i = 0; i < lookup.length; i++) { - lookup[i] = colorFn(i, value); - } - var pixels = applyLookup(context.getImageData(0, 0, canvas.width, canvas.height), lookup); - context.putImageData(pixels, 0, 0); - return fromCanvas(canvas, type); - }; - return function (ir, value) { - return ir.toCanvas().then(function (canvas) { - return filterImpl(canvas, ir.getType(), value); - }); - }; - } - - function complexAdjustableColorFilter(matrixAdjustFn) { - return function (ir, adjust) { - return colorFilter(ir, matrixAdjustFn(identity$1(), adjust)); - }; - } - - function basicColorFilter(matrix) { - return function (ir) { - return colorFilter(ir, matrix); - }; - } - - function basicConvolutionFilter(kernel) { - return function (ir) { - return convoluteFilter(ir, kernel); - }; - } - - var invert = basicColorFilter([ - -1, + x = x * 127 + 127; + } + return multiply(matrix, [ + x / 127, 0, 0, 0, - 255, + 0.5 * (127 - x), 0, - -1, + x / 127, 0, 0, - 255, + 0.5 * (127 - x), 0, 0, - -1, + x / 127, 0, - 255, + 0.5 * (127 - x), 0, 0, 0, @@ -17659,992 +17348,1195 @@ 0, 0, 1 - ]); - var brightness = complexAdjustableColorFilter(adjustBrightness); - var contrast = complexAdjustableColorFilter(adjustContrast); - var colorize = function (ir, adjustR, adjustG, adjustB) { - return colorFilter(ir, adjustColors(identity$1(), adjustR, adjustG, adjustB)); - }; - var sharpen = basicConvolutionFilter([ + ]); + } + function adjustBrightness(matrix, value) { + value = clamp$1(255 * value, -255, 255); + return multiply(matrix, [ + 1, 0, - -1, 0, - -1, - 5, - -1, 0, - -1, - 0 - ]); - var gamma = functionColorFilter(function (color, value) { - return Math.pow(color / 255, 1 - value) * 255; - }); - - function scale(image, dW, dH) { - var sW = getWidth(image); - var sH = getHeight(image); - var wRatio = dW / sW; - var hRatio = dH / sH; - var scaleCapped = false; - if (wRatio < 0.5 || wRatio > 2) { - wRatio = wRatio < 0.5 ? 0.5 : 2; - scaleCapped = true; - } - if (hRatio < 0.5 || hRatio > 2) { - hRatio = hRatio < 0.5 ? 0.5 : 2; - scaleCapped = true; - } - var scaled = _scale(image, wRatio, hRatio); - return !scaleCapped ? scaled : scaled.then(function (tCanvas) { - return scale(tCanvas, dW, dH); - }); + value, + 0, + 1, + 0, + 0, + value, + 0, + 0, + 1, + 0, + value, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 1 + ]); } - - function _scale(image, wRatio, hRatio) { - return new Promise$1(function (resolve) { - var sW = getWidth(image); - var sH = getHeight(image); - var dW = Math.floor(sW * wRatio); - var dH = Math.floor(sH * hRatio); - var canvas = create$5(dW, dH); - var context = get2dContext(canvas); - context.drawImage(image, 0, 0, sW, sH, 0, 0, dW, dH); - resolve(canvas); - }); + function adjustColors(matrix, adjustR, adjustG, adjustB) { + adjustR = clamp$1(adjustR, 0, 2); + adjustG = clamp$1(adjustG, 0, 2); + adjustB = clamp$1(adjustB, 0, 2); + return multiply(matrix, [ + adjustR, + 0, + 0, + 0, + 0, + 0, + adjustG, + 0, + 0, + 0, + 0, + 0, + adjustB, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 1 + ]); } - function rotate(ir, angle) { + function colorFilter(ir, matrix) { + return ir.toCanvas().then(function (canvas) { + return applyColorFilter(canvas, ir.getType(), matrix); + }); + } + function applyColorFilter(canvas, type, matrix) { + var context = get2dContext(canvas); + function applyMatrix(pixelsData, m) { + var r, g, b, a; + var data = pixelsData.data, m0 = m[0], m1 = m[1], m2 = m[2], m3 = m[3], m4 = m[4], m5 = m[5], m6 = m[6], m7 = m[7], m8 = m[8], m9 = m[9], m10 = m[10], m11 = m[11], m12 = m[12], m13 = m[13], m14 = m[14], m15 = m[15], m16 = m[16], m17 = m[17], m18 = m[18], m19 = m[19]; + for (var i = 0; i < data.length; i += 4) { + r = data[i]; + g = data[i + 1]; + b = data[i + 2]; + a = data[i + 3]; + data[i] = r * m0 + g * m1 + b * m2 + a * m3 + m4; + data[i + 1] = r * m5 + g * m6 + b * m7 + a * m8 + m9; + data[i + 2] = r * m10 + g * m11 + b * m12 + a * m13 + m14; + data[i + 3] = r * m15 + g * m16 + b * m17 + a * m18 + m19; + } + return pixelsData; + } + var pixels = applyMatrix(context.getImageData(0, 0, canvas.width, canvas.height), matrix); + context.putImageData(pixels, 0, 0); + return fromCanvas(canvas, type); + } + function convoluteFilter(ir, matrix) { + return ir.toCanvas().then(function (canvas) { + return applyConvoluteFilter(canvas, ir.getType(), matrix); + }); + } + function applyConvoluteFilter(canvas, type, matrix) { + var context = get2dContext(canvas); + function applyMatrix(pIn, pOut, aMatrix) { + function clamp(value, min, max) { + if (value > max) { + value = max; + } else if (value < min) { + value = min; + } + return value; + } + var side = Math.round(Math.sqrt(aMatrix.length)); + var halfSide = Math.floor(side / 2); + var rgba = pIn.data; + var drgba = pOut.data; + var w = pIn.width; + var h = pIn.height; + for (var y = 0; y < h; y++) { + for (var x = 0; x < w; x++) { + var r = 0; + var g = 0; + var b = 0; + for (var cy = 0; cy < side; cy++) { + for (var cx = 0; cx < side; cx++) { + var scx = clamp(x + cx - halfSide, 0, w - 1); + var scy = clamp(y + cy - halfSide, 0, h - 1); + var innerOffset = (scy * w + scx) * 4; + var wt = aMatrix[cy * side + cx]; + r += rgba[innerOffset] * wt; + g += rgba[innerOffset + 1] * wt; + b += rgba[innerOffset + 2] * wt; + } + } + var offset = (y * w + x) * 4; + drgba[offset] = clamp(r, 0, 255); + drgba[offset + 1] = clamp(g, 0, 255); + drgba[offset + 2] = clamp(b, 0, 255); + } + } + return pOut; + } + var pixelsIn = context.getImageData(0, 0, canvas.width, canvas.height); + var pixelsOut = context.getImageData(0, 0, canvas.width, canvas.height); + pixelsOut = applyMatrix(pixelsIn, pixelsOut, matrix); + context.putImageData(pixelsOut, 0, 0); + return fromCanvas(canvas, type); + } + function functionColorFilter(colorFn) { + var filterImpl = function (canvas, type, value) { + var context = get2dContext(canvas); + var lookup = new Array(256); + function applyLookup(pixelsData, lookupData) { + var data = pixelsData.data; + for (var i = 0; i < data.length; i += 4) { + data[i] = lookupData[data[i]]; + data[i + 1] = lookupData[data[i + 1]]; + data[i + 2] = lookupData[data[i + 2]]; + } + return pixelsData; + } + for (var i = 0; i < lookup.length; i++) { + lookup[i] = colorFn(i, value); + } + var pixels = applyLookup(context.getImageData(0, 0, canvas.width, canvas.height), lookup); + context.putImageData(pixels, 0, 0); + return fromCanvas(canvas, type); + }; + return function (ir, value) { return ir.toCanvas().then(function (canvas) { - return applyRotate(canvas, ir.getType(), angle); + return filterImpl(canvas, ir.getType(), value); }); + }; + } + function complexAdjustableColorFilter(matrixAdjustFn) { + return function (ir, adjust) { + return colorFilter(ir, matrixAdjustFn(identity$1(), adjust)); + }; + } + function basicColorFilter(matrix) { + return function (ir) { + return colorFilter(ir, matrix); + }; + } + function basicConvolutionFilter(kernel) { + return function (ir) { + return convoluteFilter(ir, kernel); + }; } + var invert = basicColorFilter([ + -1, + 0, + 0, + 0, + 255, + 0, + -1, + 0, + 0, + 255, + 0, + 0, + -1, + 0, + 255, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 1 + ]); + var brightness = complexAdjustableColorFilter(adjustBrightness); + var contrast = complexAdjustableColorFilter(adjustContrast); + var colorize = function (ir, adjustR, adjustG, adjustB) { + return colorFilter(ir, adjustColors(identity$1(), adjustR, adjustG, adjustB)); + }; + var sharpen = basicConvolutionFilter([ + 0, + -1, + 0, + -1, + 5, + -1, + 0, + -1, + 0 + ]); + var gamma = functionColorFilter(function (color, value) { + return Math.pow(color / 255, 1 - value) * 255; + }); - function applyRotate(image, type, angle) { - var canvas = create$5(image.width, image.height); + function scale(image, dW, dH) { + var sW = getWidth(image); + var sH = getHeight(image); + var wRatio = dW / sW; + var hRatio = dH / sH; + var scaleCapped = false; + if (wRatio < 0.5 || wRatio > 2) { + wRatio = wRatio < 0.5 ? 0.5 : 2; + scaleCapped = true; + } + if (hRatio < 0.5 || hRatio > 2) { + hRatio = hRatio < 0.5 ? 0.5 : 2; + scaleCapped = true; + } + var scaled = _scale(image, wRatio, hRatio); + return !scaleCapped ? scaled : scaled.then(function (tCanvas) { + return scale(tCanvas, dW, dH); + }); + } + function _scale(image, wRatio, hRatio) { + return new Promise$1(function (resolve) { + var sW = getWidth(image); + var sH = getHeight(image); + var dW = Math.floor(sW * wRatio); + var dH = Math.floor(sH * hRatio); + var canvas = create$5(dW, dH); var context = get2dContext(canvas); - var translateX = 0; - var translateY = 0; - angle = angle < 0 ? 360 + angle : angle; - if (angle === 90 || angle === 270) { - resize(canvas, canvas.height, canvas.width); - } - if (angle === 90 || angle === 180) { - translateX = canvas.width; - } - if (angle === 270 || angle === 180) { - translateY = canvas.height; - } - context.translate(translateX, translateY); - context.rotate(angle * Math.PI / 180); - context.drawImage(image, 0, 0); - return fromCanvas(canvas, type); + context.drawImage(image, 0, 0, sW, sH, 0, 0, dW, dH); + resolve(canvas); + }); } + function rotate(ir, angle) { + return ir.toCanvas().then(function (canvas) { + return applyRotate(canvas, ir.getType(), angle); + }); + } + function applyRotate(image, type, angle) { + var canvas = create$5(image.width, image.height); + var context = get2dContext(canvas); + var translateX = 0; + var translateY = 0; + angle = angle < 0 ? 360 + angle : angle; + if (angle === 90 || angle === 270) { + resize(canvas, canvas.height, canvas.width); + } + if (angle === 90 || angle === 180) { + translateX = canvas.width; + } + if (angle === 270 || angle === 180) { + translateY = canvas.height; + } + context.translate(translateX, translateY); + context.rotate(angle * Math.PI / 180); + context.drawImage(image, 0, 0); + return fromCanvas(canvas, type); + } function flip(ir, axis) { - return ir.toCanvas().then(function (canvas) { - return applyFlip(canvas, ir.getType(), axis); - }); + return ir.toCanvas().then(function (canvas) { + return applyFlip(canvas, ir.getType(), axis); + }); } - function applyFlip(image, type, axis) { - var canvas = create$5(image.width, image.height); - var context = get2dContext(canvas); - if (axis === 'v') { - context.scale(1, -1); - context.drawImage(image, 0, -canvas.height); - } else { - context.scale(-1, 1); - context.drawImage(image, -canvas.width, 0); - } - return fromCanvas(canvas, type); + var canvas = create$5(image.width, image.height); + var context = get2dContext(canvas); + if (axis === 'v') { + context.scale(1, -1); + context.drawImage(image, 0, -canvas.height); + } else { + context.scale(-1, 1); + context.drawImage(image, -canvas.width, 0); + } + return fromCanvas(canvas, type); } - function crop(ir, x, y, w, h) { - return ir.toCanvas().then(function (canvas) { - return applyCrop(canvas, ir.getType(), x, y, w, h); - }); + return ir.toCanvas().then(function (canvas) { + return applyCrop(canvas, ir.getType(), x, y, w, h); + }); } - function applyCrop(image, type, x, y, w, h) { - var canvas = create$5(w, h); - var context = get2dContext(canvas); - context.drawImage(image, -x, -y); - return fromCanvas(canvas, type); + var canvas = create$5(w, h); + var context = get2dContext(canvas); + context.drawImage(image, -x, -y); + return fromCanvas(canvas, type); } - function resize$1(ir, w, h) { - return ir.toCanvas().then(function (canvas) { - return scale(canvas, w, h).then(function (newCanvas) { - return fromCanvas(newCanvas, ir.getType()); - }); + return ir.toCanvas().then(function (canvas) { + return scale(canvas, w, h).then(function (newCanvas) { + return fromCanvas(newCanvas, ir.getType()); }); + }); } var invert$1 = function (ir) { - return invert(ir); + return invert(ir); }; var sharpen$1 = function (ir) { - return sharpen(ir); + return sharpen(ir); }; var gamma$1 = function (ir, value) { - return gamma(ir, value); + return gamma(ir, value); }; var colorize$1 = function (ir, adjustR, adjustG, adjustB) { - return colorize(ir, adjustR, adjustG, adjustB); + return colorize(ir, adjustR, adjustG, adjustB); }; var brightness$1 = function (ir, adjust) { - return brightness(ir, adjust); + return brightness(ir, adjust); }; var contrast$1 = function (ir, adjust) { - return contrast(ir, adjust); + return contrast(ir, adjust); }; var flip$1 = function (ir, axis) { - return flip(ir, axis); + return flip(ir, axis); }; var crop$1 = function (ir, x, y, w, h) { - return crop(ir, x, y, w, h); + return crop(ir, x, y, w, h); }; var resize$2 = function (ir, w, h) { - return resize$1(ir, w, h); + return resize$1(ir, w, h); }; var rotate$1 = function (ir, angle) { - return rotate(ir, angle); + return rotate(ir, angle); }; var renderIcon$1 = function (iconHtml, behaviours) { - return __assign({ - dom: { - tag: 'span', - innerHtml: iconHtml, - classes: [ - 'tox-icon', - 'tox-tbtn__icon-wrap' - ] - } - }, behaviours); + return __assign({ + dom: { + tag: 'span', + innerHtml: iconHtml, + classes: [ + 'tox-icon', + 'tox-tbtn__icon-wrap' + ] + } + }, behaviours); }; var renderIconFromPack = function (iconName, iconsProvider) { - return renderIcon$1(get$e(iconName, iconsProvider), {}); + return renderIcon$1(get$e(iconName, iconsProvider), {}); }; var renderReplacableIconFromPack = function (iconName, iconsProvider) { - return renderIcon$1(get$e(iconName, iconsProvider), {behaviours: derive$1([Replacing.config({})])}); + return renderIcon$1(get$e(iconName, iconsProvider), { behaviours: derive$1([Replacing.config({})]) }); }; var renderLabel$1 = function (text, prefix, providersBackstage) { - return { - dom: { - tag: 'span', - innerHtml: providersBackstage.translate(text), - classes: [prefix + '__select-label'] - }, - behaviours: derive$1([Replacing.config({})]) - }; + return { + dom: { + tag: 'span', + innerHtml: providersBackstage.translate(text), + classes: [prefix + '__select-label'] + }, + behaviours: derive$1([Replacing.config({})]) + }; }; var _a$1; var internalToolbarButtonExecute = generate$1('toolbar.button.execute'); var onToolbarButtonExecute = function (info) { - return runOnExecute(function (comp, _simulatedEvent) { - runWithApi(info, comp)(function (itemApi) { - emitWith(comp, internalToolbarButtonExecute, {buttonApi: itemApi}); - info.onAction(itemApi); - }); + return runOnExecute(function (comp, _simulatedEvent) { + runWithApi(info, comp)(function (itemApi) { + emitWith(comp, internalToolbarButtonExecute, { buttonApi: itemApi }); + info.onAction(itemApi); }); + }); }; var toolbarButtonEventOrder = (_a$1 = {}, _a$1[execute()] = [ - 'disabling', - 'alloy.base.behaviour', - 'toggling', - 'toolbar-button-events' + 'disabling', + 'alloy.base.behaviour', + 'toggling', + 'toolbar-button-events' ], _a$1); var updateMenuText = generate$1('update-menu-text'); var updateMenuIcon = generate$1('update-menu-icon'); var renderCommonDropdown = function (spec, prefix, sharedBackstage) { - var editorOffCell = Cell(noop); - var optMemDisplayText = spec.text.map(function (text) { - return record(renderLabel$1(text, prefix, sharedBackstage.providers)); - }); - var optMemDisplayIcon = spec.icon.map(function (iconName) { - return record(renderReplacableIconFromPack(iconName, sharedBackstage.providers.icons)); - }); - var onLeftOrRightInMenu = function (comp, se) { - var dropdown = Representing.getValue(comp); - Focusing.focus(dropdown); - emitWith(dropdown, 'keydown', {raw: se.event.raw}); - Dropdown.close(dropdown); - return Optional.some(true); - }; - var role = spec.role.fold(function () { - return {}; - }, function (role) { - return {role: role}; - }); - var tooltipAttributes = spec.tooltip.fold(function () { - return {}; - }, function (tooltip) { - var translatedTooltip = sharedBackstage.providers.translate(tooltip); - return { - 'title': translatedTooltip, - 'aria-label': translatedTooltip - }; - }); - var memDropdown = record(Dropdown.sketch(__assign(__assign(__assign({}, spec.uid ? {uid: spec.uid} : {}), role), { + var editorOffCell = Cell(noop); + var optMemDisplayText = spec.text.map(function (text) { + return record(renderLabel$1(text, prefix, sharedBackstage.providers)); + }); + var optMemDisplayIcon = spec.icon.map(function (iconName) { + return record(renderReplacableIconFromPack(iconName, sharedBackstage.providers.icons)); + }); + var onLeftOrRightInMenu = function (comp, se) { + var dropdown = Representing.getValue(comp); + Focusing.focus(dropdown); + emitWith(dropdown, 'keydown', { raw: se.event.raw }); + Dropdown.close(dropdown); + return Optional.some(true); + }; + var role = spec.role.fold(function () { + return {}; + }, function (role) { + return { role: role }; + }); + var tooltipAttributes = spec.tooltip.fold(function () { + return {}; + }, function (tooltip) { + var translatedTooltip = sharedBackstage.providers.translate(tooltip); + return { + 'title': translatedTooltip, + 'aria-label': translatedTooltip + }; + }); + var memDropdown = record(Dropdown.sketch(__assign(__assign(__assign({}, spec.uid ? { uid: spec.uid } : {}), role), { + dom: { + tag: 'button', + classes: [ + prefix, + prefix + '--select' + ].concat(map(spec.classes, function (c) { + return prefix + '--' + c; + })), + attributes: __assign({}, tooltipAttributes) + }, + components: componentRenderPipeline([ + optMemDisplayIcon.map(function (mem) { + return mem.asSpec(); + }), + optMemDisplayText.map(function (mem) { + return mem.asSpec(); + }), + Optional.some({ dom: { - tag: 'button', - classes: [ - prefix, - prefix + '--select' - ].concat(map(spec.classes, function (c) { - return prefix + '--' + c; - })), - attributes: __assign({}, tooltipAttributes) - }, - components: componentRenderPipeline([ - optMemDisplayIcon.map(function (mem) { - return mem.asSpec(); - }), - optMemDisplayText.map(function (mem) { - return mem.asSpec(); - }), - Optional.some({ - dom: { - tag: 'div', - classes: [prefix + '__select-chevron'], - innerHtml: get$e('chevron-down', sharedBackstage.providers.icons) - } - }) - ]), - matchWidth: true, - useMinWidth: true, - dropdownBehaviours: derive$1(__spreadArrays(spec.dropdownBehaviours, [ - DisablingConfigs.button(function () { - return spec.disabled || sharedBackstage.providers.isDisabled(); - }), - receivingConfig(), - Unselecting.config({}), - Replacing.config({}), - config('dropdown-events', [ - onControlAttached(spec, editorOffCell), - onControlDetached(spec, editorOffCell) - ]), - config('menubutton-update-display-text', [ - run(updateMenuText, function (comp, se) { - optMemDisplayText.bind(function (mem) { - return mem.getOpt(comp); - }).each(function (displayText) { - Replacing.set(displayText, [text(sharedBackstage.providers.translate(se.event.text))]); - }); - }), - run(updateMenuIcon, function (comp, se) { - optMemDisplayIcon.bind(function (mem) { - return mem.getOpt(comp); - }).each(function (displayIcon) { - Replacing.set(displayIcon, [renderReplacableIconFromPack(se.event.icon, sharedBackstage.providers.icons)]); - }); - }) - ]) - ])), - eventOrder: deepMerge(toolbarButtonEventOrder, { - mousedown: [ - 'focusing', - 'alloy.base.behaviour', - 'item-type-events', - 'normal-dropdown-events' - ] - }), - sandboxBehaviours: derive$1([Keying.config({ - mode: 'special', - onLeft: onLeftOrRightInMenu, - onRight: onLeftOrRightInMenu - })]), - lazySink: sharedBackstage.getSink, - toggleClass: prefix + '--active', - parts: {menu: part(false, spec.columns, spec.presets)}, - fetch: function (comp) { - return Future.nu(curry(spec.fetch, comp)); + tag: 'div', + classes: [prefix + '__select-chevron'], + innerHtml: get$e('chevron-down', sharedBackstage.providers.icons) } - }))); - return memDropdown.asSpec(); + }) + ]), + matchWidth: true, + useMinWidth: true, + dropdownBehaviours: derive$1(__spreadArrays(spec.dropdownBehaviours, [ + DisablingConfigs.button(function () { + return spec.disabled || sharedBackstage.providers.isDisabled(); + }), + receivingConfig(), + Unselecting.config({}), + Replacing.config({}), + config('dropdown-events', [ + onControlAttached(spec, editorOffCell), + onControlDetached(spec, editorOffCell) + ]), + config('menubutton-update-display-text', [ + run(updateMenuText, function (comp, se) { + optMemDisplayText.bind(function (mem) { + return mem.getOpt(comp); + }).each(function (displayText) { + Replacing.set(displayText, [text(sharedBackstage.providers.translate(se.event.text))]); + }); + }), + run(updateMenuIcon, function (comp, se) { + optMemDisplayIcon.bind(function (mem) { + return mem.getOpt(comp); + }).each(function (displayIcon) { + Replacing.set(displayIcon, [renderReplacableIconFromPack(se.event.icon, sharedBackstage.providers.icons)]); + }); + }) + ]) + ])), + eventOrder: deepMerge(toolbarButtonEventOrder, { + mousedown: [ + 'focusing', + 'alloy.base.behaviour', + 'item-type-events', + 'normal-dropdown-events' + ] + }), + sandboxBehaviours: derive$1([Keying.config({ + mode: 'special', + onLeft: onLeftOrRightInMenu, + onRight: onLeftOrRightInMenu + })]), + lazySink: sharedBackstage.getSink, + toggleClass: prefix + '--active', + parts: { menu: part(false, spec.columns, spec.presets) }, + fetch: function (comp) { + return Future.nu(curry(spec.fetch, comp)); + } + }))); + return memDropdown.asSpec(); }; var isMenuItemReference = function (item) { - return isString(item); + return isString(item); }; var isSeparator = function (item) { - return item.type === 'separator'; + return item.type === 'separator'; }; var isExpandingMenuItem = function (item) { - return has(item, 'getSubmenuItems'); + return has(item, 'getSubmenuItems'); }; - var separator$1 = {type: 'separator'}; + var separator$1 = { type: 'separator' }; var unwrapReferences = function (items, menuItems) { - var realItems = foldl(items, function (acc, item) { - if (isMenuItemReference(item)) { - if (item === '') { - return acc; - } else if (item === '|') { - return acc.length > 0 && !isSeparator(acc[acc.length - 1]) ? acc.concat([separator$1]) : acc; - } else if (has(menuItems, item.toLowerCase())) { - return acc.concat([menuItems[item.toLowerCase()]]); - } else { - return acc; - } - } else { - return acc.concat([item]); - } - }, []); - if (realItems.length > 0 && isSeparator(realItems[realItems.length - 1])) { - realItems.pop(); + var realItems = foldl(items, function (acc, item) { + if (isMenuItemReference(item)) { + if (item === '') { + return acc; + } else if (item === '|') { + return acc.length > 0 && !isSeparator(acc[acc.length - 1]) ? acc.concat([separator$1]) : acc; + } else if (has(menuItems, item.toLowerCase())) { + return acc.concat([menuItems[item.toLowerCase()]]); + } else { + return acc; + } + } else { + return acc.concat([item]); } - return realItems; + }, []); + if (realItems.length > 0 && isSeparator(realItems[realItems.length - 1])) { + realItems.pop(); + } + return realItems; }; var getFromExpandingItem = function (item, menuItems) { - var submenuItems = item.getSubmenuItems(); - var rest = expand(submenuItems, menuItems); - var newMenus = deepMerge(rest.menus, wrap$1(item.value, rest.items)); - var newExpansions = deepMerge(rest.expansions, wrap$1(item.value, item.value)); - return { - item: item, - menus: newMenus, - expansions: newExpansions - }; + var submenuItems = item.getSubmenuItems(); + var rest = expand(submenuItems, menuItems); + var newMenus = deepMerge(rest.menus, wrap$1(item.value, rest.items)); + var newExpansions = deepMerge(rest.expansions, wrap$1(item.value, item.value)); + return { + item: item, + menus: newMenus, + expansions: newExpansions + }; }; var getFromItem = function (item, menuItems) { - return isExpandingMenuItem(item) ? getFromExpandingItem(item, menuItems) : { - item: item, - menus: {}, - expansions: {} - }; + return isExpandingMenuItem(item) ? getFromExpandingItem(item, menuItems) : { + item: item, + menus: {}, + expansions: {} + }; }; var generateValueIfRequired = function (item) { - if (isSeparator(item)) { - return item; - } else { - var itemValue = get$1(item, 'value').getOrThunk(function () { - return generate$1('generated-menu-item'); - }); - return deepMerge({value: itemValue}, item); - } + if (isSeparator(item)) { + return item; + } else { + var itemValue = get$1(item, 'value').getOrThunk(function () { + return generate$1('generated-menu-item'); + }); + return deepMerge({ value: itemValue }, item); + } }; var expand = function (items, menuItems) { - var realItems = unwrapReferences(isString(items) ? items.split(' ') : items, menuItems); - return foldr(realItems, function (acc, item) { - var itemWithValue = generateValueIfRequired(item); - var newData = getFromItem(itemWithValue, menuItems); - return { - menus: deepMerge(acc.menus, newData.menus), - items: [newData.item].concat(acc.items), - expansions: deepMerge(acc.expansions, newData.expansions) - }; - }, { - menus: {}, - expansions: {}, - items: [] - }); + var realItems = unwrapReferences(isString(items) ? items.split(' ') : items, menuItems); + return foldr(realItems, function (acc, item) { + var itemWithValue = generateValueIfRequired(item); + var newData = getFromItem(itemWithValue, menuItems); + return { + menus: deepMerge(acc.menus, newData.menus), + items: [newData.item].concat(acc.items), + expansions: deepMerge(acc.expansions, newData.expansions) + }; + }, { + menus: {}, + expansions: {}, + items: [] + }); }; var build$2 = function (items, itemResponse, backstage, isHorizontalMenu) { - var primary = generate$1('primary-menu'); - var data = expand(items, backstage.shared.providers.menuItems()); - if (data.items.length === 0) { - return Optional.none(); - } - var mainMenu = createPartialMenu(primary, data.items, itemResponse, backstage, isHorizontalMenu); - var submenus = map$2(data.menus, function (menuItems, menuName) { - return createPartialMenu(menuName, menuItems, itemResponse, backstage, false); - }); - var menus = deepMerge(submenus, wrap$1(primary, mainMenu)); - return Optional.from(tieredMenu.tieredData(primary, menus, data.expansions)); + var primary = generate$1('primary-menu'); + var data = expand(items, backstage.shared.providers.menuItems()); + if (data.items.length === 0) { + return Optional.none(); + } + var mainMenu = createPartialMenu(primary, data.items, itemResponse, backstage, isHorizontalMenu); + var submenus = map$2(data.menus, function (menuItems, menuName) { + return createPartialMenu(menuName, menuItems, itemResponse, backstage, false); + }); + var menus = deepMerge(submenus, wrap$1(primary, mainMenu)); + return Optional.from(tieredMenu.tieredData(primary, menus, data.expansions)); }; var getMenuButtonApi = function (component) { - return { - isDisabled: function () { - return Disabling.isDisabled(component); - }, - setDisabled: function (state) { - return Disabling.set(component, state); - }, - setActive: function (state) { - var elm = component.element; - if (state) { - add$2(elm, 'tox-tbtn--enabled'); - set$1(elm, 'aria-pressed', true); - } else { - remove$4(elm, 'tox-tbtn--enabled'); - remove$1(elm, 'aria-pressed'); - } - }, - isActive: function () { - return has$2(component.element, 'tox-tbtn--enabled'); - } - }; + return { + isDisabled: function () { + return Disabling.isDisabled(component); + }, + setDisabled: function (state) { + return Disabling.set(component, state); + }, + setActive: function (state) { + var elm = component.element; + if (state) { + add$2(elm, 'tox-tbtn--enabled'); + set$1(elm, 'aria-pressed', true); + } else { + remove$4(elm, 'tox-tbtn--enabled'); + remove$1(elm, 'aria-pressed'); + } + }, + isActive: function () { + return has$2(component.element, 'tox-tbtn--enabled'); + } + }; }; var renderMenuButton = function (spec, prefix, backstage, role) { - return renderCommonDropdown({ - text: spec.text, - icon: spec.icon, - tooltip: spec.tooltip, - role: role, - fetch: function (_comp, callback) { - spec.fetch(function (items) { - callback(build$2(items, ItemResponse$1.CLOSE_ON_EXECUTE, backstage, false)); - }); - }, - onSetup: spec.onSetup, - getApi: getMenuButtonApi, - columns: 1, - presets: 'normal', - classes: [], - dropdownBehaviours: [Tabstopping.config({})] - }, prefix, backstage.shared); + return renderCommonDropdown({ + text: spec.text, + icon: spec.icon, + tooltip: spec.tooltip, + role: role, + fetch: function (_comp, callback) { + spec.fetch(function (items) { + callback(build$2(items, ItemResponse$1.CLOSE_ON_EXECUTE, backstage, false)); + }); + }, + onSetup: spec.onSetup, + getApi: getMenuButtonApi, + columns: 1, + presets: 'normal', + classes: [], + dropdownBehaviours: [Tabstopping.config({})] + }, prefix, backstage.shared); }; var getFetch$1 = function (items, getButton, backstage) { - var getMenuItemAction = function (item) { - return function (api) { - var newValue = !api.isActive(); - api.setActive(newValue); - item.storage.set(newValue); - backstage.shared.getSink().each(function (sink) { - getButton().getOpt(sink).each(function (orig) { - focus$1(orig.element); - emitWith(orig, formActionEvent, { - name: item.name, - value: item.storage.get() - }); - }); - }); - }; - }; - var getMenuItemSetup = function (item) { - return function (api) { - api.setActive(item.storage.get()); - }; - }; - return function (success) { - success(map(items, function (item) { - var text = item.text.fold(function () { - return {}; - }, function (text) { - return {text: text}; - }); - return __assign(__assign({ - type: item.type, - active: false - }, text), { - onAction: getMenuItemAction(item), - onSetup: getMenuItemSetup(item) - }); - })); + var getMenuItemAction = function (item) { + return function (api) { + var newValue = !api.isActive(); + api.setActive(newValue); + item.storage.set(newValue); + backstage.shared.getSink().each(function (sink) { + getButton().getOpt(sink).each(function (orig) { + focus$1(orig.element); + emitWith(orig, formActionEvent, { + name: item.name, + value: item.storage.get() + }); + }); + }); + }; + }; + var getMenuItemSetup = function (item) { + return function (api) { + api.setActive(item.storage.get()); }; + }; + return function (success) { + success(map(items, function (item) { + var text = item.text.fold(function () { + return {}; + }, function (text) { + return { text: text }; + }); + return __assign(__assign({ + type: item.type, + active: false + }, text), { + onAction: getMenuItemAction(item), + onSetup: getMenuItemSetup(item) + }); + })); + }; }; var renderCommonSpec = function (spec, actionOpt, extraBehaviours, dom, components, providersBackstage) { - if (extraBehaviours === void 0) { - extraBehaviours = []; - } - var action = actionOpt.fold(function () { - return {}; - }, function (action) { - return {action: action}; - }); - var common = __assign({ - buttonBehaviours: derive$1([ - DisablingConfigs.button(function () { - return spec.disabled || providersBackstage.isDisabled(); - }), - receivingConfig(), - Tabstopping.config({}), - config('button press', [ - preventDefault('click'), - preventDefault('mousedown') - ]) - ].concat(extraBehaviours)), - eventOrder: { - click: [ - 'button press', - 'alloy.base.behaviour' - ], - mousedown: [ - 'button press', - 'alloy.base.behaviour' - ] - } - }, action); - var domFinal = deepMerge(common, {dom: dom}); - return deepMerge(domFinal, {components: components}); + if (extraBehaviours === void 0) { + extraBehaviours = []; + } + var action = actionOpt.fold(function () { + return {}; + }, function (action) { + return { action: action }; + }); + var common = __assign({ + buttonBehaviours: derive$1([ + DisablingConfigs.button(function () { + return spec.disabled || providersBackstage.isDisabled(); + }), + receivingConfig(), + Tabstopping.config({}), + config('button press', [ + preventDefault('click'), + preventDefault('mousedown') + ]) + ].concat(extraBehaviours)), + eventOrder: { + click: [ + 'button press', + 'alloy.base.behaviour' + ], + mousedown: [ + 'button press', + 'alloy.base.behaviour' + ] + } + }, action); + var domFinal = deepMerge(common, { dom: dom }); + return deepMerge(domFinal, { components: components }); }; var renderIconButtonSpec = function (spec, action, providersBackstage, extraBehaviours) { - if (extraBehaviours === void 0) { - extraBehaviours = []; - } - var tooltipAttributes = spec.tooltip.map(function (tooltip) { - return { - 'aria-label': providersBackstage.translate(tooltip), - 'title': providersBackstage.translate(tooltip) - }; - }).getOr({}); - var dom = { - tag: 'button', - classes: ['tox-tbtn'], - attributes: tooltipAttributes - }; - var icon = spec.icon.map(function (iconName) { - return renderIconFromPack(iconName, providersBackstage.icons); - }); - var components = componentRenderPipeline([icon]); - return renderCommonSpec(spec, action, extraBehaviours, dom, components, providersBackstage); + if (extraBehaviours === void 0) { + extraBehaviours = []; + } + var tooltipAttributes = spec.tooltip.map(function (tooltip) { + return { + 'aria-label': providersBackstage.translate(tooltip), + 'title': providersBackstage.translate(tooltip) + }; + }).getOr({}); + var dom = { + tag: 'button', + classes: ['tox-tbtn'], + attributes: tooltipAttributes + }; + var icon = spec.icon.map(function (iconName) { + return renderIconFromPack(iconName, providersBackstage.icons); + }); + var components = componentRenderPipeline([icon]); + return renderCommonSpec(spec, action, extraBehaviours, dom, components, providersBackstage); }; var renderIconButton = function (spec, action, providersBackstage, extraBehaviours) { - if (extraBehaviours === void 0) { - extraBehaviours = []; - } - var iconButtonSpec = renderIconButtonSpec(spec, Optional.some(action), providersBackstage, extraBehaviours); - return Button.sketch(iconButtonSpec); + if (extraBehaviours === void 0) { + extraBehaviours = []; + } + var iconButtonSpec = renderIconButtonSpec(spec, Optional.some(action), providersBackstage, extraBehaviours); + return Button.sketch(iconButtonSpec); }; var renderButtonSpec = function (spec, action, providersBackstage, extraBehaviours, extraClasses) { - if (extraBehaviours === void 0) { - extraBehaviours = []; - } - if (extraClasses === void 0) { - extraClasses = []; - } - var translatedText = providersBackstage.translate(spec.text); - var icon = spec.icon ? spec.icon.map(function (iconName) { - return renderIconFromPack(iconName, providersBackstage.icons); - }) : Optional.none(); - var components = icon.isSome() ? componentRenderPipeline([icon]) : []; - var innerHtml = icon.isSome() ? {} : {innerHtml: translatedText}; - var classes = __spreadArrays(!spec.primary && !spec.borderless ? [ - 'tox-button', - 'tox-button--secondary' - ] : ['tox-button'], icon.isSome() ? ['tox-button--icon'] : [], spec.borderless ? ['tox-button--naked'] : [], extraClasses); - var dom = __assign(__assign({ - tag: 'button', - classes: classes - }, innerHtml), {attributes: {title: translatedText}}); - return renderCommonSpec(spec, action, extraBehaviours, dom, components, providersBackstage); + if (extraBehaviours === void 0) { + extraBehaviours = []; + } + if (extraClasses === void 0) { + extraClasses = []; + } + var translatedText = providersBackstage.translate(spec.text); + var icon = spec.icon ? spec.icon.map(function (iconName) { + return renderIconFromPack(iconName, providersBackstage.icons); + }) : Optional.none(); + var components = icon.isSome() ? componentRenderPipeline([icon]) : []; + var innerHtml = icon.isSome() ? {} : { innerHtml: translatedText }; + var classes = __spreadArrays(!spec.primary && !spec.borderless ? [ + 'tox-button', + 'tox-button--secondary' + ] : ['tox-button'], icon.isSome() ? ['tox-button--icon'] : [], spec.borderless ? ['tox-button--naked'] : [], extraClasses); + var dom = __assign(__assign({ + tag: 'button', + classes: classes + }, innerHtml), { attributes: { title: translatedText } }); + return renderCommonSpec(spec, action, extraBehaviours, dom, components, providersBackstage); }; var renderButton = function (spec, action, providersBackstage, extraBehaviours, extraClasses) { - if (extraBehaviours === void 0) { - extraBehaviours = []; - } - if (extraClasses === void 0) { - extraClasses = []; - } - var buttonSpec = renderButtonSpec(spec, Optional.some(action), providersBackstage, extraBehaviours, extraClasses); - return Button.sketch(buttonSpec); + if (extraBehaviours === void 0) { + extraBehaviours = []; + } + if (extraClasses === void 0) { + extraClasses = []; + } + var buttonSpec = renderButtonSpec(spec, Optional.some(action), providersBackstage, extraBehaviours, extraClasses); + return Button.sketch(buttonSpec); }; var getAction = function (name, buttonType) { - return function (comp) { - if (buttonType === 'custom') { - emitWith(comp, formActionEvent, { - name: name, - value: {} - }); - } else if (buttonType === 'submit') { - emit(comp, formSubmitEvent); - } else if (buttonType === 'cancel') { - emit(comp, formCancelEvent); - } else { - console.error('Unknown button type: ', buttonType); - } - }; + return function (comp) { + if (buttonType === 'custom') { + emitWith(comp, formActionEvent, { + name: name, + value: {} + }); + } else if (buttonType === 'submit') { + emit(comp, formSubmitEvent); + } else if (buttonType === 'cancel') { + emit(comp, formCancelEvent); + } else { + console.error('Unknown button type: ', buttonType); + } + }; }; var isMenuFooterButtonSpec = function (spec, buttonType) { - return buttonType === 'menu'; + return buttonType === 'menu'; }; var isNormalFooterButtonSpec = function (spec, buttonType) { - return buttonType === 'custom' || buttonType === 'cancel' || buttonType === 'submit'; + return buttonType === 'custom' || buttonType === 'cancel' || buttonType === 'submit'; }; var renderFooterButton = function (spec, buttonType, backstage) { - if (isMenuFooterButtonSpec(spec, buttonType)) { - var getButton = function () { - return memButton_1; - }; - var menuButtonSpec = spec; - var fixedSpec = __assign(__assign({}, spec), { - onSetup: function (api) { - api.setDisabled(spec.disabled); - return noop; - }, - fetch: getFetch$1(menuButtonSpec.items, getButton, backstage) - }); - var memButton_1 = record(renderMenuButton(fixedSpec, 'tox-tbtn', backstage, Optional.none())); - return memButton_1.asSpec(); - } else if (isNormalFooterButtonSpec(spec, buttonType)) { - var action = getAction(spec.name, buttonType); - var buttonSpec = __assign(__assign({}, spec), {borderless: false}); - return renderButton(buttonSpec, action, backstage.shared.providers, []); - } else { - console.error('Unknown footer button type: ', buttonType); - } + if (isMenuFooterButtonSpec(spec, buttonType)) { + var getButton = function () { + return memButton_1; + }; + var menuButtonSpec = spec; + var fixedSpec = __assign(__assign({}, spec), { + onSetup: function (api) { + api.setDisabled(spec.disabled); + return noop; + }, + fetch: getFetch$1(menuButtonSpec.items, getButton, backstage) + }); + var memButton_1 = record(renderMenuButton(fixedSpec, 'tox-tbtn', backstage, Optional.none())); + return memButton_1.asSpec(); + } else if (isNormalFooterButtonSpec(spec, buttonType)) { + var action = getAction(spec.name, buttonType); + var buttonSpec = __assign(__assign({}, spec), { borderless: false }); + return renderButton(buttonSpec, action, backstage.shared.providers, []); + } else { + console.error('Unknown footer button type: ', buttonType); + } }; var renderDialogButton = function (spec, providersBackstage) { - var action = getAction(spec.name, 'custom'); - return renderFormField(Optional.none(), FormField.parts.field(__assign({factory: Button}, renderButtonSpec(spec, Optional.some(action), providersBackstage, [ - RepresentingConfigs.memory(''), - ComposingConfigs.self() - ])))); + var action = getAction(spec.name, 'custom'); + return renderFormField(Optional.none(), FormField.parts.field(__assign({ factory: Button }, renderButtonSpec(spec, Optional.some(action), providersBackstage, [ + RepresentingConfigs.memory(''), + ComposingConfigs.self() + ])))); }; var schema$i = constant([ - defaulted$1('field1Name', 'field1'), - defaulted$1('field2Name', 'field2'), - onStrictHandler('onLockedChange'), - markers(['lockClass']), - defaulted$1('locked', false), - SketchBehaviours.field('coupledFieldBehaviours', [ - Composing, - Representing - ]) + defaulted$1('field1Name', 'field1'), + defaulted$1('field2Name', 'field2'), + onStrictHandler('onLockedChange'), + markers(['lockClass']), + defaulted$1('locked', false), + SketchBehaviours.field('coupledFieldBehaviours', [ + Composing, + Representing + ]) ]); var getField = function (comp, detail, partName) { - return getPart(comp, detail, partName).bind(Composing.getCurrent); + return getPart(comp, detail, partName).bind(Composing.getCurrent); }; var coupledPart = function (selfName, otherName) { - return required({ - factory: FormField, - name: selfName, - overrides: function (detail) { - return { - fieldBehaviours: derive$1([config('coupled-input-behaviour', [run(input(), function (me) { - getField(me, detail, otherName).each(function (other) { - getPart(me, detail, 'lock').each(function (lock) { - if (Toggling.isOn(lock)) { - detail.onLockedChange(me, other, lock); - } - }); - }); - })])]) - }; - } - }); + return required({ + factory: FormField, + name: selfName, + overrides: function (detail) { + return { + fieldBehaviours: derive$1([config('coupled-input-behaviour', [run(input(), function (me) { + getField(me, detail, otherName).each(function (other) { + getPart(me, detail, 'lock').each(function (lock) { + if (Toggling.isOn(lock)) { + detail.onLockedChange(me, other, lock); + } + }); + }); + })])]) + }; + } + }); }; var parts$5 = constant([ - coupledPart('field1', 'field2'), - coupledPart('field2', 'field1'), - required({ - factory: Button, - schema: [strict$1('dom')], - name: 'lock', - overrides: function (detail) { - return { - buttonBehaviours: derive$1([Toggling.config({ - selected: detail.locked, - toggleClass: detail.markers.lockClass, - aria: {mode: 'pressed'} - })]) - }; - } - }) - ]); + coupledPart('field1', 'field2'), + coupledPart('field2', 'field1'), + required({ + factory: Button, + schema: [strict$1('dom')], + name: 'lock', + overrides: function (detail) { + return { + buttonBehaviours: derive$1([Toggling.config({ + selected: detail.locked, + toggleClass: detail.markers.lockClass, + aria: { mode: 'pressed' } + })]) + }; + } + }) + ]); var factory$7 = function (detail, components, _spec, _externals) { - return { - uid: detail.uid, - dom: detail.dom, - components: components, - behaviours: SketchBehaviours.augment(detail.coupledFieldBehaviours, [ - Composing.config({find: Optional.some}), - Representing.config({ - store: { - mode: 'manual', - getValue: function (comp) { - var _a; - var parts = getPartsOrDie(comp, detail, [ - 'field1', - 'field2' - ]); - return _a = {}, _a[detail.field1Name] = Representing.getValue(parts.field1()), _a[detail.field2Name] = Representing.getValue(parts.field2()), _a; - }, - setValue: function (comp, value) { - var parts = getPartsOrDie(comp, detail, [ - 'field1', - 'field2' - ]); - if (hasNonNullableKey(value, detail.field1Name)) { - Representing.setValue(parts.field1(), value[detail.field1Name]); - } - if (hasNonNullableKey(value, detail.field2Name)) { - Representing.setValue(parts.field2(), value[detail.field2Name]); - } - } - } - }) - ]), - apis: { - getField1: function (component) { - return getPart(component, detail, 'field1'); - }, - getField2: function (component) { - return getPart(component, detail, 'field2'); - }, - getLock: function (component) { - return getPart(component, detail, 'lock'); + return { + uid: detail.uid, + dom: detail.dom, + components: components, + behaviours: SketchBehaviours.augment(detail.coupledFieldBehaviours, [ + Composing.config({ find: Optional.some }), + Representing.config({ + store: { + mode: 'manual', + getValue: function (comp) { + var _a; + var parts = getPartsOrDie(comp, detail, [ + 'field1', + 'field2' + ]); + return _a = {}, _a[detail.field1Name] = Representing.getValue(parts.field1()), _a[detail.field2Name] = Representing.getValue(parts.field2()), _a; + }, + setValue: function (comp, value) { + var parts = getPartsOrDie(comp, detail, [ + 'field1', + 'field2' + ]); + if (hasNonNullableKey(value, detail.field1Name)) { + Representing.setValue(parts.field1(), value[detail.field1Name]); + } + if (hasNonNullableKey(value, detail.field2Name)) { + Representing.setValue(parts.field2(), value[detail.field2Name]); } + } } - }; + }) + ]), + apis: { + getField1: function (component) { + return getPart(component, detail, 'field1'); + }, + getField2: function (component) { + return getPart(component, detail, 'field2'); + }, + getLock: function (component) { + return getPart(component, detail, 'lock'); + } + } + }; }; var FormCoupledInputs = composite$1({ - name: 'FormCoupledInputs', - configFields: schema$i(), - partFields: parts$5(), - factory: factory$7, - apis: { - getField1: function (apis, component) { - return apis.getField1(component); - }, - getField2: function (apis, component) { - return apis.getField2(component); - }, - getLock: function (apis, component) { - return apis.getLock(component); - } + name: 'FormCoupledInputs', + configFields: schema$i(), + partFields: parts$5(), + factory: factory$7, + apis: { + getField1: function (apis, component) { + return apis.getField1(component); + }, + getField2: function (apis, component) { + return apis.getField2(component); + }, + getLock: function (apis, component) { + return apis.getLock(component); } + } }); var formatSize = function (size) { - var unitDec = { - '': 0, - 'px': 0, - 'pt': 1, - 'mm': 1, - 'pc': 2, - 'ex': 2, - 'em': 2, - 'ch': 2, - 'rem': 2, - 'cm': 3, - 'in': 4, - '%': 4 - }; - var maxDecimal = function (unit) { - return unit in unitDec ? unitDec[unit] : 1; - }; - var numText = size.value.toFixed(maxDecimal(size.unit)); - if (numText.indexOf('.') !== -1) { - numText = numText.replace(/\.?0*$/, ''); - } - return numText + size.unit; + var unitDec = { + '': 0, + 'px': 0, + 'pt': 1, + 'mm': 1, + 'pc': 2, + 'ex': 2, + 'em': 2, + 'ch': 2, + 'rem': 2, + 'cm': 3, + 'in': 4, + '%': 4 + }; + var maxDecimal = function (unit) { + return unit in unitDec ? unitDec[unit] : 1; + }; + var numText = size.value.toFixed(maxDecimal(size.unit)); + if (numText.indexOf('.') !== -1) { + numText = numText.replace(/\.?0*$/, ''); + } + return numText + size.unit; }; var parseSize = function (sizeText) { - var numPattern = /^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/; - var match = numPattern.exec(sizeText); - if (match !== null) { - var value = parseFloat(match[1]); - var unit = match[2]; - return Result.value({ - value: value, - unit: unit - }); - } else { - return Result.error(sizeText); - } + var numPattern = /^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/; + var match = numPattern.exec(sizeText); + if (match !== null) { + var value = parseFloat(match[1]); + var unit = match[2]; + return Result.value({ + value: value, + unit: unit + }); + } else { + return Result.error(sizeText); + } }; var convertUnit = function (size, unit) { - var inInch = { - '': 96, - 'px': 96, - 'pt': 72, - 'cm': 2.54, - 'pc': 12, - 'mm': 25.4, - 'in': 1 - }; - var supported = function (u) { - return Object.prototype.hasOwnProperty.call(inInch, u); - }; - if (size.unit === unit) { - return Optional.some(size.value); - } else if (supported(size.unit) && supported(unit)) { - if (inInch[size.unit] === inInch[unit]) { - return Optional.some(size.value); - } else { - return Optional.some(size.value / inInch[size.unit] * inInch[unit]); - } + var inInch = { + '': 96, + 'px': 96, + 'pt': 72, + 'cm': 2.54, + 'pc': 12, + 'mm': 25.4, + 'in': 1 + }; + var supported = function (u) { + return Object.prototype.hasOwnProperty.call(inInch, u); + }; + if (size.unit === unit) { + return Optional.some(size.value); + } else if (supported(size.unit) && supported(unit)) { + if (inInch[size.unit] === inInch[unit]) { + return Optional.some(size.value); } else { - return Optional.none(); + return Optional.some(size.value / inInch[size.unit] * inInch[unit]); } + } else { + return Optional.none(); + } }; var noSizeConversion = function (_input) { - return Optional.none(); + return Optional.none(); }; var ratioSizeConversion = function (scale, unit) { - return function (size) { - return convertUnit(size, unit).map(function (value) { - return { - value: value * scale, - unit: unit - }; - }); - }; + return function (size) { + return convertUnit(size, unit).map(function (value) { + return { + value: value * scale, + unit: unit + }; + }); + }; }; var makeRatioConverter = function (currentFieldText, otherFieldText) { - var cValue = parseSize(currentFieldText).toOptional(); - var oValue = parseSize(otherFieldText).toOptional(); - return lift2(cValue, oValue, function (cSize, oSize) { - return convertUnit(cSize, oSize.unit).map(function (val) { - return oSize.value / val; - }).map(function (r) { - return ratioSizeConversion(r, oSize.unit); - }).getOr(noSizeConversion); + var cValue = parseSize(currentFieldText).toOptional(); + var oValue = parseSize(otherFieldText).toOptional(); + return lift2(cValue, oValue, function (cSize, oSize) { + return convertUnit(cSize, oSize.unit).map(function (val) { + return oSize.value / val; + }).map(function (r) { + return ratioSizeConversion(r, oSize.unit); }).getOr(noSizeConversion); + }).getOr(noSizeConversion); }; var renderSizeInput = function (spec, providersBackstage) { - var converter = noSizeConversion; - var ratioEvent = generate$1('ratio-event'); - var pLock = FormCoupledInputs.parts.lock({ + var converter = noSizeConversion; + var ratioEvent = generate$1('ratio-event'); + var pLock = FormCoupledInputs.parts.lock({ + dom: { + tag: 'button', + classes: [ + 'tox-lock', + 'tox-button', + 'tox-button--naked', + 'tox-button--icon' + ], + attributes: { title: providersBackstage.translate(spec.label.getOr('Constrain proportions')) } + }, + components: [ + { dom: { - tag: 'button', - classes: [ - 'tox-lock', - 'tox-button', - 'tox-button--naked', - 'tox-button--icon' - ], - attributes: {title: providersBackstage.translate(spec.label.getOr('Constrain proportions'))} - }, - components: [ - { - dom: { - tag: 'span', - classes: [ - 'tox-icon', - 'tox-lock-icon__lock' - ], - innerHtml: get$e('lock', providersBackstage.icons) - } - }, - { - dom: { - tag: 'span', - classes: [ - 'tox-icon', - 'tox-lock-icon__unlock' - ], - innerHtml: get$e('unlock', providersBackstage.icons) - } - } - ], - buttonBehaviours: derive$1([ - Disabling.config({ - disabled: function () { - return spec.disabled || providersBackstage.isDisabled(); - } - }), - receivingConfig(), - Tabstopping.config({}) + tag: 'span', + classes: [ + 'tox-icon', + 'tox-lock-icon__lock' + ], + innerHtml: get$e('lock', providersBackstage.icons) + } + }, + { + dom: { + tag: 'span', + classes: [ + 'tox-icon', + 'tox-lock-icon__unlock' + ], + innerHtml: get$e('unlock', providersBackstage.icons) + } + } + ], + buttonBehaviours: derive$1([ + Disabling.config({ + disabled: function () { + return spec.disabled || providersBackstage.isDisabled(); + } + }), + receivingConfig(), + Tabstopping.config({}) + ]) + }); + var formGroup = function (components) { + return { + dom: { + tag: 'div', + classes: ['tox-form__group'] + }, + components: components + }; + }; + var getFieldPart = function (isField1) { + return FormField.parts.field({ + factory: Input, + inputClasses: ['tox-textfield'], + inputBehaviours: derive$1([ + Disabling.config({ + disabled: function () { + return spec.disabled || providersBackstage.isDisabled(); + } + }), + receivingConfig(), + Tabstopping.config({}), + config('size-input-events', [ + run(focusin(), function (component, _simulatedEvent) { + emitWith(component, ratioEvent, { isField1: isField1 }); + }), + run(change(), function (component, _simulatedEvent) { + emitWith(component, formChangeEvent, { name: spec.name }); + }) ]) + ]), + selectOnFocus: false }); - var formGroup = function (components) { - return { - dom: { - tag: 'div', - classes: ['tox-form__group'] - }, - components: components - }; - }; - var getFieldPart = function (isField1) { - return FormField.parts.field({ - factory: Input, - inputClasses: ['tox-textfield'], - inputBehaviours: derive$1([ - Disabling.config({ - disabled: function () { - return spec.disabled || providersBackstage.isDisabled(); - } - }), - receivingConfig(), - Tabstopping.config({}), - config('size-input-events', [ - run(focusin(), function (component, _simulatedEvent) { - emitWith(component, ratioEvent, {isField1: isField1}); - }), - run(change(), function (component, _simulatedEvent) { - emitWith(component, formChangeEvent, {name: spec.name}); - }) - ]) - ]), - selectOnFocus: false - }); - }; - var getLabel = function (label) { - return { - dom: { - tag: 'label', - classes: ['tox-label'], - innerHtml: providersBackstage.translate(label) - } - }; - }; - var widthField = FormCoupledInputs.parts.field1(formGroup([ - FormField.parts.label(getLabel('Width')), - getFieldPart(true) - ])); - var heightField = FormCoupledInputs.parts.field2(formGroup([ - FormField.parts.label(getLabel('Height')), - getFieldPart(false) - ])); - return FormCoupledInputs.sketch({ + }; + var getLabel = function (label) { + return { + dom: { + tag: 'label', + classes: ['tox-label'], + innerHtml: providersBackstage.translate(label) + } + }; + }; + var widthField = FormCoupledInputs.parts.field1(formGroup([ + FormField.parts.label(getLabel('Width')), + getFieldPart(true) + ])); + var heightField = FormCoupledInputs.parts.field2(formGroup([ + FormField.parts.label(getLabel('Height')), + getFieldPart(false) + ])); + return FormCoupledInputs.sketch({ + dom: { + tag: 'div', + classes: ['tox-form__group'] + }, + components: [{ dom: { - tag: 'div', - classes: ['tox-form__group'] - }, - components: [{ - dom: { - tag: 'div', - classes: ['tox-form__controls-h-stack'] - }, - components: [ - widthField, - heightField, - formGroup([ - getLabel(' '), - pLock - ]) - ] - }], - field1Name: 'width', - field2Name: 'height', - locked: true, - markers: {lockClass: 'tox-locked'}, - onLockedChange: function (current, other, _lock) { - parseSize(Representing.getValue(current)).each(function (size) { - converter(size).each(function (newSize) { - Representing.setValue(other, formatSize(newSize)); - }); - }); + tag: 'div', + classes: ['tox-form__controls-h-stack'] }, - coupledFieldBehaviours: derive$1([ - Disabling.config({ - disabled: function () { - return spec.disabled || providersBackstage.isDisabled(); - }, - onDisabled: function (comp) { - FormCoupledInputs.getField1(comp).bind(FormField.getField).each(Disabling.disable); - FormCoupledInputs.getField2(comp).bind(FormField.getField).each(Disabling.disable); - FormCoupledInputs.getLock(comp).each(Disabling.disable); - }, - onEnabled: function (comp) { - FormCoupledInputs.getField1(comp).bind(FormField.getField).each(Disabling.enable); - FormCoupledInputs.getField2(comp).bind(FormField.getField).each(Disabling.enable); - FormCoupledInputs.getLock(comp).each(Disabling.enable); - } - }), - receivingConfig(), - config('size-input-events2', [run(ratioEvent, function (component, simulatedEvent) { - var isField1 = simulatedEvent.event.isField1; - var optCurrent = isField1 ? FormCoupledInputs.getField1(component) : FormCoupledInputs.getField2(component); - var optOther = isField1 ? FormCoupledInputs.getField2(component) : FormCoupledInputs.getField1(component); - var value1 = optCurrent.map(Representing.getValue).getOr(''); - var value2 = optOther.map(Representing.getValue).getOr(''); - converter = makeRatioConverter(value1, value2); - })]) - ]) - }); + components: [ + widthField, + heightField, + formGroup([ + getLabel(' '), + pLock + ]) + ] + }], + field1Name: 'width', + field2Name: 'height', + locked: true, + markers: { lockClass: 'tox-locked' }, + onLockedChange: function (current, other, _lock) { + parseSize(Representing.getValue(current)).each(function (size) { + converter(size).each(function (newSize) { + Representing.setValue(other, formatSize(newSize)); + }); + }); + }, + coupledFieldBehaviours: derive$1([ + Disabling.config({ + disabled: function () { + return spec.disabled || providersBackstage.isDisabled(); + }, + onDisabled: function (comp) { + FormCoupledInputs.getField1(comp).bind(FormField.getField).each(Disabling.disable); + FormCoupledInputs.getField2(comp).bind(FormField.getField).each(Disabling.disable); + FormCoupledInputs.getLock(comp).each(Disabling.disable); + }, + onEnabled: function (comp) { + FormCoupledInputs.getField1(comp).bind(FormField.getField).each(Disabling.enable); + FormCoupledInputs.getField2(comp).bind(FormField.getField).each(Disabling.enable); + FormCoupledInputs.getLock(comp).each(Disabling.enable); + } + }), + receivingConfig(), + config('size-input-events2', [run(ratioEvent, function (component, simulatedEvent) { + var isField1 = simulatedEvent.event.isField1; + var optCurrent = isField1 ? FormCoupledInputs.getField1(component) : FormCoupledInputs.getField2(component); + var optOther = isField1 ? FormCoupledInputs.getField2(component) : FormCoupledInputs.getField1(component); + var value1 = optCurrent.map(Representing.getValue).getOr(''); + var value2 = optOther.map(Representing.getValue).getOr(''); + converter = makeRatioConverter(value1, value2); + })]) + ]) + }); }; var undo = constant(generate$1('undo')); @@ -18657,428 +18549,428 @@ var tempTransform = constant(generate$1('temp-transform')); var transformApply = constant(generate$1('transform-apply')); var internal = { - undo: undo, - redo: redo, - zoom: zoom, - back: back, - apply: apply, - swap: swap, - transform: transform, - tempTransform: tempTransform, - transformApply: transformApply + undo: undo, + redo: redo, + zoom: zoom, + back: back, + apply: apply, + swap: swap, + transform: transform, + tempTransform: tempTransform, + transformApply: transformApply }; var saveState = constant('save-state'); var disable$1 = constant('disable'); var enable$1 = constant('enable'); var external$2 = { - formActionEvent: formActionEvent, - saveState: saveState, - disable: disable$1, - enable: enable$1 + formActionEvent: formActionEvent, + saveState: saveState, + disable: disable$1, + enable: enable$1 }; var renderEditPanel = function (imagePanel, providersBackstage) { - var createButton = function (text, action, disabled, primary) { - return record(renderButton({ - name: text, - text: text, - disabled: disabled, - primary: primary, - icon: Optional.none(), - borderless: false - }, action, providersBackstage)); - }; - var createIconButton = function (icon, tooltip, action, disabled) { - return record(renderIconButton({ - name: icon, - icon: Optional.some(icon), - tooltip: Optional.some(tooltip), - disabled: disabled, - primary: false, - borderless: false - }, action, providersBackstage)); - }; - var disableAllComponents = function (comps, eventcomp) { - comps.map(function (mem) { - var component = mem.get(eventcomp); - if (component.hasConfigured(Disabling)) { - Disabling.disable(component); - } - }); - }; - var enableAllComponents = function (comps, eventcomp) { - comps.map(function (mem) { - var component = mem.get(eventcomp); - if (component.hasConfigured(Disabling)) { - Disabling.enable(component); - } - }); - }; - var panelDom = { + var createButton = function (text, action, disabled, primary) { + return record(renderButton({ + name: text, + text: text, + disabled: disabled, + primary: primary, + icon: Optional.none(), + borderless: false + }, action, providersBackstage)); + }; + var createIconButton = function (icon, tooltip, action, disabled) { + return record(renderIconButton({ + name: icon, + icon: Optional.some(icon), + tooltip: Optional.some(tooltip), + disabled: disabled, + primary: false, + borderless: false + }, action, providersBackstage)); + }; + var disableAllComponents = function (comps, eventcomp) { + comps.map(function (mem) { + var component = mem.get(eventcomp); + if (component.hasConfigured(Disabling)) { + Disabling.disable(component); + } + }); + }; + var enableAllComponents = function (comps, eventcomp) { + comps.map(function (mem) { + var component = mem.get(eventcomp); + if (component.hasConfigured(Disabling)) { + Disabling.enable(component); + } + }); + }; + var panelDom = { + tag: 'div', + classes: [ + 'tox-image-tools__toolbar', + 'tox-image-tools-edit-panel' + ] + }; + var noop$1 = noop; + var emit$1 = function (comp, event, data) { + emitWith(comp, event, data); + }; + var emitDisable = function (component) { + return emit(component, external$2.disable()); + }; + var emitEnable = function (component) { + return emit(component, external$2.enable()); + }; + var emitTransform = function (comp, transform) { + emitDisable(comp); + emit$1(comp, internal.transform(), { transform: transform }); + emitEnable(comp); + }; + var emitTempTransform = function (comp, transform) { + emitDisable(comp); + emit$1(comp, internal.tempTransform(), { transform: transform }); + emitEnable(comp); + }; + var getBackSwap = function (anyInSystem) { + return function () { + memContainer.getOpt(anyInSystem).each(function (container) { + Replacing.set(container, [ButtonPanel]); + }); + }; + }; + var emitTransformApply = function (comp, transform) { + emitDisable(comp); + emit$1(comp, internal.transformApply(), { + transform: transform, + swap: getBackSwap(comp) + }); + emitEnable(comp); + }; + var createBackButton = function () { + return createButton('Back', function (button) { + return emit$1(button, internal.back(), { swap: getBackSwap(button) }); + }, false, false); + }; + var createSpacer = function () { + return record({ + dom: { tag: 'div', - classes: [ - 'tox-image-tools__toolbar', - 'tox-image-tools-edit-panel' - ] - }; - var noop$1 = noop; - var emit$1 = function (comp, event, data) { - emitWith(comp, event, data); - }; - var emitDisable = function (component) { - return emit(component, external$2.disable()); - }; - var emitEnable = function (component) { - return emit(component, external$2.enable()); - }; - var emitTransform = function (comp, transform) { - emitDisable(comp); - emit$1(comp, internal.transform(), {transform: transform}); - emitEnable(comp); - }; - var emitTempTransform = function (comp, transform) { - emitDisable(comp); - emit$1(comp, internal.tempTransform(), {transform: transform}); - emitEnable(comp); - }; - var getBackSwap = function (anyInSystem) { - return function () { - memContainer.getOpt(anyInSystem).each(function (container) { - Replacing.set(container, [ButtonPanel]); - }); - }; - }; - var emitTransformApply = function (comp, transform) { - emitDisable(comp); - emit$1(comp, internal.transformApply(), { - transform: transform, - swap: getBackSwap(comp) - }); - emitEnable(comp); - }; - var createBackButton = function () { - return createButton('Back', function (button) { - return emit$1(button, internal.back(), {swap: getBackSwap(button)}); - }, false, false); - }; - var createSpacer = function () { - return record({ - dom: { - tag: 'div', - classes: ['tox-spacer'] - }, - behaviours: derive$1([Disabling.config({})]) - }); - }; - var createApplyButton = function () { - return createButton('Apply', function (button) { - return emit$1(button, internal.apply(), {swap: getBackSwap(button)}); - }, true, true); - }; - var makeCropTransform = function () { - return function (ir) { - var rect = imagePanel.getRect(); - return crop$1(ir, rect.x, rect.y, rect.w, rect.h); - }; - }; - var cropPanelComponents = [ - createBackButton(), - createSpacer(), - createButton('Apply', function (button) { - var transform = makeCropTransform(); - emitTransformApply(button, transform); - imagePanel.hideCrop(); - }, false, true) - ]; - var CropPanel = Container.sketch({ - dom: panelDom, - components: cropPanelComponents.map(function (mem) { - return mem.asSpec(); + classes: ['tox-spacer'] + }, + behaviours: derive$1([Disabling.config({})]) + }); + }; + var createApplyButton = function () { + return createButton('Apply', function (button) { + return emit$1(button, internal.apply(), { swap: getBackSwap(button) }); + }, true, true); + }; + var makeCropTransform = function () { + return function (ir) { + var rect = imagePanel.getRect(); + return crop$1(ir, rect.x, rect.y, rect.w, rect.h); + }; + }; + var cropPanelComponents = [ + createBackButton(), + createSpacer(), + createButton('Apply', function (button) { + var transform = makeCropTransform(); + emitTransformApply(button, transform); + imagePanel.hideCrop(); + }, false, true) + ]; + var CropPanel = Container.sketch({ + dom: panelDom, + components: cropPanelComponents.map(function (mem) { + return mem.asSpec(); + }), + containerBehaviours: derive$1([config('image-tools-crop-buttons-events', [ + run(external$2.disable(), function (comp, _se) { + disableAllComponents(cropPanelComponents, comp); }), - containerBehaviours: derive$1([config('image-tools-crop-buttons-events', [ - run(external$2.disable(), function (comp, _se) { - disableAllComponents(cropPanelComponents, comp); - }), - run(external$2.enable(), function (comp, _se) { - enableAllComponents(cropPanelComponents, comp); - }) - ])]) - }); - var memSize = record(renderSizeInput({ - name: 'size', - label: Optional.none(), - constrain: true, - disabled: false - }, providersBackstage)); - var makeResizeTransform = function (width, height) { - return function (ir) { - return resize$2(ir, width, height); - }; - }; - var resizePanelComponents = [ - createBackButton(), - createSpacer(), - memSize, - createSpacer(), - createButton('Apply', function (button) { - memSize.getOpt(button).each(function (sizeInput) { - var value = Representing.getValue(sizeInput); - var width = parseInt(value.width, 10); - var height = parseInt(value.height, 10); - var transform = makeResizeTransform(width, height); - emitTransformApply(button, transform); - }); - }, false, true) - ]; - var ResizePanel = Container.sketch({ - dom: panelDom, - components: resizePanelComponents.map(function (mem) { - return mem.asSpec(); + run(external$2.enable(), function (comp, _se) { + enableAllComponents(cropPanelComponents, comp); + }) + ])]) + }); + var memSize = record(renderSizeInput({ + name: 'size', + label: Optional.none(), + constrain: true, + disabled: false + }, providersBackstage)); + var makeResizeTransform = function (width, height) { + return function (ir) { + return resize$2(ir, width, height); + }; + }; + var resizePanelComponents = [ + createBackButton(), + createSpacer(), + memSize, + createSpacer(), + createButton('Apply', function (button) { + memSize.getOpt(button).each(function (sizeInput) { + var value = Representing.getValue(sizeInput); + var width = parseInt(value.width, 10); + var height = parseInt(value.height, 10); + var transform = makeResizeTransform(width, height); + emitTransformApply(button, transform); + }); + }, false, true) + ]; + var ResizePanel = Container.sketch({ + dom: panelDom, + components: resizePanelComponents.map(function (mem) { + return mem.asSpec(); + }), + containerBehaviours: derive$1([config('image-tools-resize-buttons-events', [ + run(external$2.disable(), function (comp, _se) { + disableAllComponents(resizePanelComponents, comp); }), - containerBehaviours: derive$1([config('image-tools-resize-buttons-events', [ - run(external$2.disable(), function (comp, _se) { - disableAllComponents(resizePanelComponents, comp); - }), - run(external$2.enable(), function (comp, _se) { - enableAllComponents(resizePanelComponents, comp); - }) - ])]) - }); - var makeValueTransform = function (transform, value) { - return function (ir) { - return transform(ir, value); - }; - }; - var horizontalFlip = makeValueTransform(flip$1, 'h'); - var verticalFlip = makeValueTransform(flip$1, 'v'); - var counterclockwiseRotate = makeValueTransform(rotate$1, -90); - var clockwiseRotate = makeValueTransform(rotate$1, 90); - var flipRotateOnAction = function (comp, operation) { - emitTempTransform(comp, operation); - }; - var flipRotateComponents = [ - createBackButton(), - createSpacer(), - createIconButton('flip-horizontally', 'Flip horizontally', function (button) { - flipRotateOnAction(button, horizontalFlip); - }, false), - createIconButton('flip-vertically', 'Flip vertically', function (button) { - flipRotateOnAction(button, verticalFlip); - }, false), - createIconButton('rotate-left', 'Rotate counterclockwise', function (button) { - flipRotateOnAction(button, counterclockwiseRotate); - }, false), - createIconButton('rotate-right', 'Rotate clockwise', function (button) { - flipRotateOnAction(button, clockwiseRotate); - }, false), - createSpacer(), - createApplyButton() - ]; - var FlipRotatePanel = Container.sketch({ - dom: panelDom, - components: flipRotateComponents.map(function (mem) { - return mem.asSpec(); + run(external$2.enable(), function (comp, _se) { + enableAllComponents(resizePanelComponents, comp); + }) + ])]) + }); + var makeValueTransform = function (transform, value) { + return function (ir) { + return transform(ir, value); + }; + }; + var horizontalFlip = makeValueTransform(flip$1, 'h'); + var verticalFlip = makeValueTransform(flip$1, 'v'); + var counterclockwiseRotate = makeValueTransform(rotate$1, -90); + var clockwiseRotate = makeValueTransform(rotate$1, 90); + var flipRotateOnAction = function (comp, operation) { + emitTempTransform(comp, operation); + }; + var flipRotateComponents = [ + createBackButton(), + createSpacer(), + createIconButton('flip-horizontally', 'Flip horizontally', function (button) { + flipRotateOnAction(button, horizontalFlip); + }, false), + createIconButton('flip-vertically', 'Flip vertically', function (button) { + flipRotateOnAction(button, verticalFlip); + }, false), + createIconButton('rotate-left', 'Rotate counterclockwise', function (button) { + flipRotateOnAction(button, counterclockwiseRotate); + }, false), + createIconButton('rotate-right', 'Rotate clockwise', function (button) { + flipRotateOnAction(button, clockwiseRotate); + }, false), + createSpacer(), + createApplyButton() + ]; + var FlipRotatePanel = Container.sketch({ + dom: panelDom, + components: flipRotateComponents.map(function (mem) { + return mem.asSpec(); + }), + containerBehaviours: derive$1([config('image-tools-fliprotate-buttons-events', [ + run(external$2.disable(), function (comp, _se) { + disableAllComponents(flipRotateComponents, comp); }), - containerBehaviours: derive$1([config('image-tools-fliprotate-buttons-events', [ - run(external$2.disable(), function (comp, _se) { - disableAllComponents(flipRotateComponents, comp); - }), - run(external$2.enable(), function (comp, _se) { - enableAllComponents(flipRotateComponents, comp); - }) - ])]) - }); - var makeSlider = function (label, onChoose, min, value, max) { - var labelPart = Slider.parts.label({ - dom: { - tag: 'label', - classes: ['tox-label'], - innerHtml: providersBackstage.translate(label) - } - }); - var spectrum = Slider.parts.spectrum({ - dom: { - tag: 'div', - classes: ['tox-slider__rail'], - attributes: {role: 'presentation'} - } - }); - var thumb = Slider.parts.thumb({ - dom: { - tag: 'div', - classes: ['tox-slider__handle'], - attributes: {role: 'presentation'} - } - }); - return record(Slider.sketch({ - dom: { - tag: 'div', - classes: ['tox-slider'], - attributes: {role: 'presentation'} - }, - model: { - mode: 'x', - minX: min, - maxX: max, - getInitialValue: constant({x: value}) - }, - components: [ - labelPart, - spectrum, - thumb - ], - sliderBehaviours: derive$1([Focusing.config({})]), - onChoose: onChoose - })); - }; - var makeVariableSlider = function (label, transform, min, value, max) { - var onChoose = function (slider, _thumb, value) { - var valTransform = makeValueTransform(transform, value.x / 100); - emitTransform(slider, valTransform); - }; - return makeSlider(label, onChoose, min, value, max); - }; - var variableFilterPanelComponents = function (label, transform, min, value, max) { - return [ - createBackButton(), - makeVariableSlider(label, transform, min, value, max), - createApplyButton() - ]; - }; - var createVariableFilterPanel = function (label, transform, min, value, max) { - var filterPanelComponents = variableFilterPanelComponents(label, transform, min, value, max); - return Container.sketch({ - dom: panelDom, - components: filterPanelComponents.map(function (mem) { - return mem.asSpec(); - }), - containerBehaviours: derive$1([config('image-tools-filter-panel-buttons-events', [ - run(external$2.disable(), function (comp, _se) { - disableAllComponents(filterPanelComponents, comp); - }), - run(external$2.enable(), function (comp, _se) { - enableAllComponents(filterPanelComponents, comp); - }) - ])]) - }); - }; - var filterPanelComponents = [ - createBackButton(), - createSpacer(), - createApplyButton() - ]; - var FilterPanel = Container.sketch({ - dom: panelDom, - components: filterPanelComponents.map(function (mem) { - return mem.asSpec(); + run(external$2.enable(), function (comp, _se) { + enableAllComponents(flipRotateComponents, comp); }) + ])]) + }); + var makeSlider = function (label, onChoose, min, value, max) { + var labelPart = Slider.parts.label({ + dom: { + tag: 'label', + classes: ['tox-label'], + innerHtml: providersBackstage.translate(label) + } }); - var BrightnessPanel = createVariableFilterPanel('Brightness', brightness$1, -100, 0, 100); - var ContrastPanel = createVariableFilterPanel('Contrast', contrast$1, -100, 0, 100); - var GammaPanel = createVariableFilterPanel('Gamma', gamma$1, -100, 0, 100); - var makeColorTransform = function (red, green, blue) { - return function (ir) { - return colorize$1(ir, red, green, blue); - }; - }; - var makeColorSlider = function (label) { - var onChoose = function (slider, _thumb, _value) { - var redOpt = memRed.getOpt(slider); - var blueOpt = memBlue.getOpt(slider); - var greenOpt = memGreen.getOpt(slider); - redOpt.each(function (red) { - blueOpt.each(function (blue) { - greenOpt.each(function (green) { - var r = Representing.getValue(red).x / 100; - var g = Representing.getValue(green).x / 100; - var b = Representing.getValue(blue).x / 100; - var transform = makeColorTransform(r, g, b); - emitTransform(slider, transform); - }); - }); - }); - }; - return makeSlider(label, onChoose, 0, 100, 200); - }; - var memRed = makeColorSlider('R'); - var memGreen = makeColorSlider('G'); - var memBlue = makeColorSlider('B'); - var colorizePanelComponents = [ - createBackButton(), - memRed, - memGreen, - memBlue, - createApplyButton() - ]; - var ColorizePanel = Container.sketch({ - dom: panelDom, - components: colorizePanelComponents.map(function (mem) { - return mem.asSpec(); - }) + var spectrum = Slider.parts.spectrum({ + dom: { + tag: 'div', + classes: ['tox-slider__rail'], + attributes: { role: 'presentation' } + } }); - var getTransformPanelEvent = function (panel, transform, update) { - return function (button) { - var swap = function () { - memContainer.getOpt(button).each(function (container) { - Replacing.set(container, [panel]); - update(container); - }); - }; - emit$1(button, internal.swap(), { - transform: transform, - swap: swap - }); - }; - }; - var cropPanelUpdate = function (_anyInSystem) { - imagePanel.showCrop(); - }; - var resizePanelUpdate = function (anyInSystem) { - memSize.getOpt(anyInSystem).each(function (sizeInput) { - var measurements = imagePanel.getMeasurements(); - var width = measurements.width; - var height = measurements.height; - Representing.setValue(sizeInput, { - width: width, - height: height - }); - }); - }; - var sharpenTransform = Optional.some(sharpen$1); - var invertTransform = Optional.some(invert$1); - var buttonPanelComponents = [ - createIconButton('crop', 'Crop', getTransformPanelEvent(CropPanel, Optional.none(), cropPanelUpdate), false), - createIconButton('resize', 'Resize', getTransformPanelEvent(ResizePanel, Optional.none(), resizePanelUpdate), false), - createIconButton('orientation', 'Orientation', getTransformPanelEvent(FlipRotatePanel, Optional.none(), noop$1), false), - createIconButton('brightness', 'Brightness', getTransformPanelEvent(BrightnessPanel, Optional.none(), noop$1), false), - createIconButton('sharpen', 'Sharpen', getTransformPanelEvent(FilterPanel, sharpenTransform, noop$1), false), - createIconButton('contrast', 'Contrast', getTransformPanelEvent(ContrastPanel, Optional.none(), noop$1), false), - createIconButton('color-levels', 'Color levels', getTransformPanelEvent(ColorizePanel, Optional.none(), noop$1), false), - createIconButton('gamma', 'Gamma', getTransformPanelEvent(GammaPanel, Optional.none(), noop$1), false), - createIconButton('invert', 'Invert', getTransformPanelEvent(FilterPanel, invertTransform, noop$1), false) - ]; - var ButtonPanel = Container.sketch({ - dom: panelDom, - components: buttonPanelComponents.map(function (mem) { - return mem.asSpec(); - }) + var thumb = Slider.parts.thumb({ + dom: { + tag: 'div', + classes: ['tox-slider__handle'], + attributes: { role: 'presentation' } + } }); - var container = Container.sketch({ - dom: {tag: 'div'}, - components: [ButtonPanel], - containerBehaviours: derive$1([Replacing.config({})]) + return record(Slider.sketch({ + dom: { + tag: 'div', + classes: ['tox-slider'], + attributes: { role: 'presentation' } + }, + model: { + mode: 'x', + minX: min, + maxX: max, + getInitialValue: constant({ x: value }) + }, + components: [ + labelPart, + spectrum, + thumb + ], + sliderBehaviours: derive$1([Focusing.config({})]), + onChoose: onChoose + })); + }; + var makeVariableSlider = function (label, transform, min, value, max) { + var onChoose = function (slider, _thumb, value) { + var valTransform = makeValueTransform(transform, value.x / 100); + emitTransform(slider, valTransform); + }; + return makeSlider(label, onChoose, min, value, max); + }; + var variableFilterPanelComponents = function (label, transform, min, value, max) { + return [ + createBackButton(), + makeVariableSlider(label, transform, min, value, max), + createApplyButton() + ]; + }; + var createVariableFilterPanel = function (label, transform, min, value, max) { + var filterPanelComponents = variableFilterPanelComponents(label, transform, min, value, max); + return Container.sketch({ + dom: panelDom, + components: filterPanelComponents.map(function (mem) { + return mem.asSpec(); + }), + containerBehaviours: derive$1([config('image-tools-filter-panel-buttons-events', [ + run(external$2.disable(), function (comp, _se) { + disableAllComponents(filterPanelComponents, comp); + }), + run(external$2.enable(), function (comp, _se) { + enableAllComponents(filterPanelComponents, comp); + }) + ])]) }); - var memContainer = record(container); - var getApplyButton = function (anyInSystem) { - return memContainer.getOpt(anyInSystem).map(function (container) { - var panel = container.components()[0]; - return panel.components()[panel.components().length - 1]; - }); - }; - return { - memContainer: memContainer, - getApplyButton: getApplyButton - }; + }; + var filterPanelComponents = [ + createBackButton(), + createSpacer(), + createApplyButton() + ]; + var FilterPanel = Container.sketch({ + dom: panelDom, + components: filterPanelComponents.map(function (mem) { + return mem.asSpec(); + }) + }); + var BrightnessPanel = createVariableFilterPanel('Brightness', brightness$1, -100, 0, 100); + var ContrastPanel = createVariableFilterPanel('Contrast', contrast$1, -100, 0, 100); + var GammaPanel = createVariableFilterPanel('Gamma', gamma$1, -100, 0, 100); + var makeColorTransform = function (red, green, blue) { + return function (ir) { + return colorize$1(ir, red, green, blue); + }; + }; + var makeColorSlider = function (label) { + var onChoose = function (slider, _thumb, _value) { + var redOpt = memRed.getOpt(slider); + var blueOpt = memBlue.getOpt(slider); + var greenOpt = memGreen.getOpt(slider); + redOpt.each(function (red) { + blueOpt.each(function (blue) { + greenOpt.each(function (green) { + var r = Representing.getValue(red).x / 100; + var g = Representing.getValue(green).x / 100; + var b = Representing.getValue(blue).x / 100; + var transform = makeColorTransform(r, g, b); + emitTransform(slider, transform); + }); + }); + }); + }; + return makeSlider(label, onChoose, 0, 100, 200); + }; + var memRed = makeColorSlider('R'); + var memGreen = makeColorSlider('G'); + var memBlue = makeColorSlider('B'); + var colorizePanelComponents = [ + createBackButton(), + memRed, + memGreen, + memBlue, + createApplyButton() + ]; + var ColorizePanel = Container.sketch({ + dom: panelDom, + components: colorizePanelComponents.map(function (mem) { + return mem.asSpec(); + }) + }); + var getTransformPanelEvent = function (panel, transform, update) { + return function (button) { + var swap = function () { + memContainer.getOpt(button).each(function (container) { + Replacing.set(container, [panel]); + update(container); + }); + }; + emit$1(button, internal.swap(), { + transform: transform, + swap: swap + }); + }; + }; + var cropPanelUpdate = function (_anyInSystem) { + imagePanel.showCrop(); + }; + var resizePanelUpdate = function (anyInSystem) { + memSize.getOpt(anyInSystem).each(function (sizeInput) { + var measurements = imagePanel.getMeasurements(); + var width = measurements.width; + var height = measurements.height; + Representing.setValue(sizeInput, { + width: width, + height: height + }); + }); + }; + var sharpenTransform = Optional.some(sharpen$1); + var invertTransform = Optional.some(invert$1); + var buttonPanelComponents = [ + createIconButton('crop', 'Crop', getTransformPanelEvent(CropPanel, Optional.none(), cropPanelUpdate), false), + createIconButton('resize', 'Resize', getTransformPanelEvent(ResizePanel, Optional.none(), resizePanelUpdate), false), + createIconButton('orientation', 'Orientation', getTransformPanelEvent(FlipRotatePanel, Optional.none(), noop$1), false), + createIconButton('brightness', 'Brightness', getTransformPanelEvent(BrightnessPanel, Optional.none(), noop$1), false), + createIconButton('sharpen', 'Sharpen', getTransformPanelEvent(FilterPanel, sharpenTransform, noop$1), false), + createIconButton('contrast', 'Contrast', getTransformPanelEvent(ContrastPanel, Optional.none(), noop$1), false), + createIconButton('color-levels', 'Color levels', getTransformPanelEvent(ColorizePanel, Optional.none(), noop$1), false), + createIconButton('gamma', 'Gamma', getTransformPanelEvent(GammaPanel, Optional.none(), noop$1), false), + createIconButton('invert', 'Invert', getTransformPanelEvent(FilterPanel, invertTransform, noop$1), false) + ]; + var ButtonPanel = Container.sketch({ + dom: panelDom, + components: buttonPanelComponents.map(function (mem) { + return mem.asSpec(); + }) + }); + var container = Container.sketch({ + dom: { tag: 'div' }, + components: [ButtonPanel], + containerBehaviours: derive$1([Replacing.config({})]) + }); + var memContainer = record(container); + var getApplyButton = function (anyInSystem) { + return memContainer.getOpt(anyInSystem).map(function (container) { + var panel = container.components()[0]; + return panel.components()[panel.components().length - 1]; + }); + }; + return { + memContainer: memContainer, + getApplyButton: getApplyButton + }; }; var global$d = tinymce.util.Tools.resolve('tinymce.geom.Rect'); @@ -19090,1403 +18982,1381 @@ var global$g = tinymce.util.Tools.resolve('tinymce.util.VK'); function getDocumentSize(doc) { - var max = Math.max; - var documentElement = doc.documentElement; - var body = doc.body; - var scrollWidth = max(documentElement.scrollWidth, body.scrollWidth); - var clientWidth = max(documentElement.clientWidth, body.clientWidth); - var offsetWidth = max(documentElement.offsetWidth, body.offsetWidth); - var scrollHeight = max(documentElement.scrollHeight, body.scrollHeight); - var clientHeight = max(documentElement.clientHeight, body.clientHeight); - var offsetHeight = max(documentElement.offsetHeight, body.offsetHeight); - return { - width: scrollWidth < offsetWidth ? clientWidth : scrollWidth, - height: scrollHeight < offsetHeight ? clientHeight : scrollHeight - }; + var max = Math.max; + var documentElement = doc.documentElement; + var body = doc.body; + var scrollWidth = max(documentElement.scrollWidth, body.scrollWidth); + var clientWidth = max(documentElement.clientWidth, body.clientWidth); + var offsetWidth = max(documentElement.offsetWidth, body.offsetWidth); + var scrollHeight = max(documentElement.scrollHeight, body.scrollHeight); + var clientHeight = max(documentElement.clientHeight, body.clientHeight); + var offsetHeight = max(documentElement.offsetHeight, body.offsetHeight); + return { + width: scrollWidth < offsetWidth ? clientWidth : scrollWidth, + height: scrollHeight < offsetHeight ? clientHeight : scrollHeight + }; } - function updateWithTouchData(e) { - var keys, i; - if (e.changedTouches) { - keys = 'screenX screenY pageX pageY clientX clientY'.split(' '); - for (i = 0; i < keys.length; i++) { - e[keys[i]] = e.changedTouches[0][keys[i]]; - } + var keys, i; + if (e.changedTouches) { + keys = 'screenX screenY pageX pageY clientX clientY'.split(' '); + for (i = 0; i < keys.length; i++) { + e[keys[i]] = e.changedTouches[0][keys[i]]; } - } - - function DragHelper(id, settings) { - var $eventOverlay; - var doc = settings.document || document; - var downButton; - var startX, startY; - var handleElement = doc.getElementById(settings.handle || id); - var start = function (e) { - var docSize = getDocumentSize(doc); - var cursor; - updateWithTouchData(e); - e.preventDefault(); - downButton = e.button; - var handleElm = handleElement; - startX = e.screenX; - startY = e.screenY; - if (window.getComputedStyle) { - cursor = window.getComputedStyle(handleElm, null).getPropertyValue('cursor'); - } else { - cursor = handleElm.runtimeStyle.cursor; - } - $eventOverlay = global$e('
              ').css({ - position: 'absolute', - top: 0, - left: 0, - width: docSize.width, - height: docSize.height, - zIndex: 2147483647, - opacity: 0.0001, - cursor: cursor - }).appendTo(doc.body); - global$e(doc).on('mousemove touchmove', drag).on('mouseup touchend', stop); - settings.start(e); - }; - var drag = function (e) { - updateWithTouchData(e); - if (e.button !== downButton) { - return stop(e); - } - e.deltaX = e.screenX - startX; - e.deltaY = e.screenY - startY; - e.preventDefault(); - settings.drag(e); - }; - var stop = function (e) { - updateWithTouchData(e); - global$e(doc).off('mousemove touchmove', drag).off('mouseup touchend', stop); - $eventOverlay.remove(); - if (settings.stop) { - settings.stop(e); - } - }; - this.destroy = function () { - global$e(handleElement).off(); - }; - global$e(handleElement).on('mousedown touchstart', start); + } + } + function DragHelper (id, settings) { + var $eventOverlay; + var doc = settings.document || document; + var downButton; + var startX, startY; + var handleElement = doc.getElementById(settings.handle || id); + var start = function (e) { + var docSize = getDocumentSize(doc); + var cursor; + updateWithTouchData(e); + e.preventDefault(); + downButton = e.button; + var handleElm = handleElement; + startX = e.screenX; + startY = e.screenY; + if (window.getComputedStyle) { + cursor = window.getComputedStyle(handleElm, null).getPropertyValue('cursor'); + } else { + cursor = handleElm.runtimeStyle.cursor; + } + $eventOverlay = global$e('
              ').css({ + position: 'absolute', + top: 0, + left: 0, + width: docSize.width, + height: docSize.height, + zIndex: 2147483647, + opacity: 0.0001, + cursor: cursor + }).appendTo(doc.body); + global$e(doc).on('mousemove touchmove', drag).on('mouseup touchend', stop); + settings.start(e); + }; + var drag = function (e) { + updateWithTouchData(e); + if (e.button !== downButton) { + return stop(e); + } + e.deltaX = e.screenX - startX; + e.deltaY = e.screenY - startY; + e.preventDefault(); + settings.drag(e); + }; + var stop = function (e) { + updateWithTouchData(e); + global$e(doc).off('mousemove touchmove', drag).off('mouseup touchend', stop); + $eventOverlay.remove(); + if (settings.stop) { + settings.stop(e); + } + }; + this.destroy = function () { + global$e(handleElement).off(); + }; + global$e(handleElement).on('mousedown touchstart', start); } var count = 0; var create$7 = function (currentRect, viewPortRect, clampRect, containerElm, action) { - var dragHelpers; - var prefix = 'tox-'; - var id = prefix + 'crid-' + count++; - var handles = [ - { - name: 'move', - xMul: 0, - yMul: 0, - deltaX: 1, - deltaY: 1, - deltaW: 0, - deltaH: 0, - label: 'Crop Mask' - }, - { - name: 'nw', - xMul: 0, - yMul: 0, - deltaX: 1, - deltaY: 1, - deltaW: -1, - deltaH: -1, - label: 'Top Left Crop Handle' - }, - { - name: 'ne', - xMul: 1, - yMul: 0, - deltaX: 0, - deltaY: 1, - deltaW: 1, - deltaH: -1, - label: 'Top Right Crop Handle' - }, - { - name: 'sw', - xMul: 0, - yMul: 1, - deltaX: 1, - deltaY: 0, - deltaW: -1, - deltaH: 1, - label: 'Bottom Left Crop Handle' - }, - { - name: 'se', - xMul: 1, - yMul: 1, - deltaX: 0, - deltaY: 0, - deltaW: 1, - deltaH: 1, - label: 'Bottom Right Crop Handle' - } - ]; - var blockers = [ - 'top', - 'right', - 'bottom', - 'left' - ]; - var getAbsoluteRect = function (outerRect, relativeRect) { - return { - x: relativeRect.x + outerRect.x, - y: relativeRect.y + outerRect.y, - w: relativeRect.w, - h: relativeRect.h - }; - }; - var getRelativeRect = function (outerRect, innerRect) { - return { - x: innerRect.x - outerRect.x, - y: innerRect.y - outerRect.y, - w: innerRect.w, - h: innerRect.h - }; - }; - var getInnerRect = function () { - return getRelativeRect(clampRect, currentRect); + var dragHelpers; + var prefix = 'tox-'; + var id = prefix + 'crid-' + count++; + var handles = [ + { + name: 'move', + xMul: 0, + yMul: 0, + deltaX: 1, + deltaY: 1, + deltaW: 0, + deltaH: 0, + label: 'Crop Mask' + }, + { + name: 'nw', + xMul: 0, + yMul: 0, + deltaX: 1, + deltaY: 1, + deltaW: -1, + deltaH: -1, + label: 'Top Left Crop Handle' + }, + { + name: 'ne', + xMul: 1, + yMul: 0, + deltaX: 0, + deltaY: 1, + deltaW: 1, + deltaH: -1, + label: 'Top Right Crop Handle' + }, + { + name: 'sw', + xMul: 0, + yMul: 1, + deltaX: 1, + deltaY: 0, + deltaW: -1, + deltaH: 1, + label: 'Bottom Left Crop Handle' + }, + { + name: 'se', + xMul: 1, + yMul: 1, + deltaX: 0, + deltaY: 0, + deltaW: 1, + deltaH: 1, + label: 'Bottom Right Crop Handle' + } + ]; + var blockers = [ + 'top', + 'right', + 'bottom', + 'left' + ]; + var getAbsoluteRect = function (outerRect, relativeRect) { + return { + x: relativeRect.x + outerRect.x, + y: relativeRect.y + outerRect.y, + w: relativeRect.w, + h: relativeRect.h }; - - function moveRect(handle, startRect, deltaX, deltaY) { - var x, y, w, h, rect; - x = startRect.x; - y = startRect.y; - w = startRect.w; - h = startRect.h; - x += deltaX * handle.deltaX; - y += deltaY * handle.deltaY; - w += deltaX * handle.deltaW; - h += deltaY * handle.deltaH; - if (w < 20) { - w = 20; - } - if (h < 20) { - h = 20; - } - rect = currentRect = global$d.clamp({ - x: x, - y: y, - w: w, - h: h - }, clampRect, handle.name === 'move'); - rect = getRelativeRect(clampRect, rect); - instance.fire('updateRect', {rect: rect}); - setInnerRect(rect); - } - - function render() { - function createDragHelper(handle) { - var startRect; - return new DragHelper(id, { - document: containerElm.ownerDocument, - handle: id + '-' + handle.name, - start: function () { - startRect = currentRect; - }, - drag: function (e) { - moveRect(handle, startRect, e.deltaX, e.deltaY); - } - }); - } - - global$e('
              ').appendTo(containerElm); - global$c.each(blockers, function (blocker) { - global$e('#' + id, containerElm).append('
            • ' + padd + '
            • '; - } - forcedRootBlockName = getForcedRootBlock(editor); - if (forcedRootBlockName && editor.schema.isValidChild(body.nodeName.toLowerCase(), forcedRootBlockName.toLowerCase())) { - content = padd; - content = editor.dom.createHTML(forcedRootBlockName, getForcedRootBlockAttrs(editor), content); - } else if (!content) { - content = '
              '; - } - setEditorHtml(editor, content); - editor.fire('SetContent', args); - } else { - if (args.format !== 'raw') { - content = HtmlSerializer({validate: editor.validate}, editor.schema).serialize(editor.parser.parse(content, { - isRootContent: true, - insert: true - })); - } - args.content = isWsPreserveElement(SugarElement.fromDom(body)) ? content : Tools.trim(content); - setEditorHtml(editor, args.content); - if (!args.no_events) { - editor.fire('SetContent', args); - } + var forcedRootBlockName, padd; + if (content.length === 0 || /^\s+$/.test(content)) { + padd = '
              '; + if (body.nodeName === 'TABLE') { + content = '' + padd + ''; + } else if (/^(UL|OL)$/.test(body.nodeName)) { + content = '
            • ' + padd + '
            • '; + } + forcedRootBlockName = getForcedRootBlock(editor); + if (forcedRootBlockName && editor.schema.isValidChild(body.nodeName.toLowerCase(), forcedRootBlockName.toLowerCase())) { + content = padd; + content = editor.dom.createHTML(forcedRootBlockName, getForcedRootBlockAttrs(editor), content); + } else if (!content) { + content = '
              '; + } + setEditorHtml(editor, content); + editor.fire('SetContent', args); + } else { + if (args.format !== 'raw') { + content = HtmlSerializer({ validate: editor.validate }, editor.schema).serialize(editor.parser.parse(content, { + isRootContent: true, + insert: true + })); } - return args.content; - }; - var setContentTree = function (editor, body, content, args) { - filter$3(editor.parser.getNodeFilters(), editor.parser.getAttributeFilters(), content); - var html = HtmlSerializer({validate: editor.validate}, editor.schema).serialize(content); - args.content = isWsPreserveElement(SugarElement.fromDom(body)) ? html : Tools.trim(html); + args.content = isWsPreserveElement(SugarElement.fromDom(body)) ? content : Tools.trim(content); setEditorHtml(editor, args.content); if (!args.no_events) { - editor.fire('SetContent', args); + editor.fire('SetContent', args); } - return content; + } + return args.content; + }; + var setContentTree = function (editor, body, content, args) { + filter$3(editor.parser.getNodeFilters(), editor.parser.getAttributeFilters(), content); + var html = HtmlSerializer({ validate: editor.validate }, editor.schema).serialize(content); + args.content = isWsPreserveElement(SugarElement.fromDom(body)) ? html : Tools.trim(html); + setEditorHtml(editor, args.content); + if (!args.no_events) { + editor.fire('SetContent', args); + } + return content; }; var setContentInternal = function (editor, content, args) { - args.format = args.format ? args.format : defaultFormat; - args.set = true; - args.content = isTreeNode(content) ? '' : content; - if (!args.no_events) { - editor.fire('BeforeSetContent', args); - } - if (!isTreeNode(content)) { - content = args.content; - } - return Optional.from(editor.getBody()).fold(constant(content), function (body) { - return isTreeNode(content) ? setContentTree(editor, body, content, args) : setContentString(editor, body, content, args); - }); + args.format = args.format ? args.format : defaultFormat; + args.set = true; + args.content = isTreeNode(content) ? '' : content; + if (!args.no_events) { + editor.fire('BeforeSetContent', args); + } + if (!isTreeNode(content)) { + content = args.content; + } + return Optional.from(editor.getBody()).fold(constant(content), function (body) { + return isTreeNode(content) ? setContentTree(editor, body, content, args) : setContentString(editor, body, content, args); + }); }; var addVisualInternal = function (editor, elm) { - var dom = editor.dom; - var scope = isNonNullable(elm) ? elm : editor.getBody(); - if (isUndefined(editor.hasVisual)) { - editor.hasVisual = isVisualAidsEnabled(editor); - } - each(dom.select('table,a', scope), function (matchedElm) { - switch (matchedElm.nodeName) { - case 'TABLE': - var cls = getVisualAidsTableClass(editor); - var value = dom.getAttrib(matchedElm, 'border'); - if ((!value || value === '0') && editor.hasVisual) { - dom.addClass(matchedElm, cls); - } else { - dom.removeClass(matchedElm, cls); - } - break; - case 'A': - if (!dom.getAttrib(matchedElm, 'href')) { - var value_1 = dom.getAttrib(matchedElm, 'name') || matchedElm.id; - var cls_1 = getVisualAidsAnchorClass(editor); - if (value_1 && editor.hasVisual) { - dom.addClass(matchedElm, cls_1); - } else { - dom.removeClass(matchedElm, cls_1); - } - } - break; + var dom = editor.dom; + var scope = isNonNullable(elm) ? elm : editor.getBody(); + if (isUndefined(editor.hasVisual)) { + editor.hasVisual = isVisualAidsEnabled(editor); + } + each(dom.select('table,a', scope), function (matchedElm) { + switch (matchedElm.nodeName) { + case 'TABLE': + var cls = getVisualAidsTableClass(editor); + var value = dom.getAttrib(matchedElm, 'border'); + if ((!value || value === '0') && editor.hasVisual) { + dom.addClass(matchedElm, cls); + } else { + dom.removeClass(matchedElm, cls); + } + break; + case 'A': + if (!dom.getAttrib(matchedElm, 'href')) { + var value_1 = dom.getAttrib(matchedElm, 'name') || matchedElm.id; + var cls_1 = getVisualAidsAnchorClass(editor); + if (value_1 && editor.hasVisual) { + dom.addClass(matchedElm, cls_1); + } else { + dom.removeClass(matchedElm, cls_1); } - }); - editor.fire('VisualAid', { - element: elm, - hasVisual: editor.hasVisual - }); + } + break; + } + }); + editor.fire('VisualAid', { + element: elm, + hasVisual: editor.hasVisual + }); }; var sibling$2 = function (scope, predicate) { - return sibling(scope, predicate).isSome(); + return sibling(scope, predicate).isSome(); }; var ZWSP$1 = ZWSP, CARET_ID$1 = '_mce_caret'; var importNode = function (ownerDocument, node) { - return ownerDocument.importNode(node, true); + return ownerDocument.importNode(node, true); }; var getEmptyCaretContainers = function (node) { - var nodes = []; - while (node) { - if (node.nodeType === 3 && node.nodeValue !== ZWSP$1 || node.childNodes.length > 1) { - return []; - } - if (node.nodeType === 1) { - nodes.push(node); - } - node = node.firstChild; + var nodes = []; + while (node) { + if (node.nodeType === 3 && node.nodeValue !== ZWSP$1 || node.childNodes.length > 1) { + return []; } - return nodes; + if (node.nodeType === 1) { + nodes.push(node); + } + node = node.firstChild; + } + return nodes; }; var isCaretContainerEmpty = function (node) { - return getEmptyCaretContainers(node).length > 0; + return getEmptyCaretContainers(node).length > 0; }; var findFirstTextNode = function (node) { - if (node) { - var walker = new DomTreeWalker(node, node); - for (node = walker.current(); node; node = walker.next()) { - if (isText$1(node)) { - return node; - } - } + if (node) { + var walker = new DomTreeWalker(node, node); + for (node = walker.current(); node; node = walker.next()) { + if (isText$1(node)) { + return node; + } } - return null; + } + return null; }; var createCaretContainer = function (fill) { - var caretContainer = SugarElement.fromTag('span'); - setAll(caretContainer, { - 'id': CARET_ID$1, - 'data-mce-bogus': '1', - 'data-mce-type': 'format-caret' - }); - if (fill) { - append(caretContainer, SugarElement.fromText(ZWSP$1)); - } - return caretContainer; + var caretContainer = SugarElement.fromTag('span'); + setAll(caretContainer, { + 'id': CARET_ID$1, + 'data-mce-bogus': '1', + 'data-mce-type': 'format-caret' + }); + if (fill) { + append(caretContainer, SugarElement.fromText(ZWSP$1)); + } + return caretContainer; }; var trimZwspFromCaretContainer = function (caretContainerNode) { - var textNode = findFirstTextNode(caretContainerNode); - if (textNode && textNode.nodeValue.charAt(0) === ZWSP$1) { - textNode.deleteData(0, 1); - } - return textNode; + var textNode = findFirstTextNode(caretContainerNode); + if (textNode && textNode.nodeValue.charAt(0) === ZWSP$1) { + textNode.deleteData(0, 1); + } + return textNode; }; var removeCaretContainerNode = function (editor, node, moveCaret) { - if (moveCaret === void 0) { - moveCaret = true; + if (moveCaret === void 0) { + moveCaret = true; + } + var dom = editor.dom, selection = editor.selection; + if (isCaretContainerEmpty(node)) { + deleteElement(editor, false, SugarElement.fromDom(node), moveCaret); + } else { + var rng = selection.getRng(); + var block = dom.getParent(node, dom.isBlock); + var startContainer = rng.startContainer; + var startOffset = rng.startOffset; + var endContainer = rng.endContainer; + var endOffset = rng.endOffset; + var textNode = trimZwspFromCaretContainer(node); + dom.remove(node, true); + if (startContainer === textNode && startOffset > 0) { + rng.setStart(textNode, startOffset - 1); } - var dom = editor.dom, selection = editor.selection; - if (isCaretContainerEmpty(node)) { - deleteElement(editor, false, SugarElement.fromDom(node), moveCaret); - } else { - var rng = selection.getRng(); - var block = dom.getParent(node, dom.isBlock); - var startContainer = rng.startContainer; - var startOffset = rng.startOffset; - var endContainer = rng.endContainer; - var endOffset = rng.endOffset; - var textNode = trimZwspFromCaretContainer(node); - dom.remove(node, true); - if (startContainer === textNode && startOffset > 0) { - rng.setStart(textNode, startOffset - 1); - } - if (endContainer === textNode && endOffset > 0) { - rng.setEnd(textNode, endOffset - 1); - } - if (block && dom.isEmpty(block)) { - fillWithPaddingBr(SugarElement.fromDom(block)); - } - selection.setRng(rng); + if (endContainer === textNode && endOffset > 0) { + rng.setEnd(textNode, endOffset - 1); + } + if (block && dom.isEmpty(block)) { + fillWithPaddingBr(SugarElement.fromDom(block)); } + selection.setRng(rng); + } }; var removeCaretContainer = function (editor, node, moveCaret) { - if (moveCaret === void 0) { - moveCaret = true; - } - var dom = editor.dom, selection = editor.selection; + if (moveCaret === void 0) { + moveCaret = true; + } + var dom = editor.dom, selection = editor.selection; + if (!node) { + node = getParentCaretContainer(editor.getBody(), selection.getStart()); if (!node) { - node = getParentCaretContainer(editor.getBody(), selection.getStart()); - if (!node) { - while (node = dom.get(CARET_ID$1)) { - removeCaretContainerNode(editor, node, false); - } - } - } else { - removeCaretContainerNode(editor, node, moveCaret); + while (node = dom.get(CARET_ID$1)) { + removeCaretContainerNode(editor, node, false); + } } + } else { + removeCaretContainerNode(editor, node, moveCaret); + } }; var insertCaretContainerNode = function (editor, caretContainer, formatNode) { - var dom = editor.dom, block = dom.getParent(formatNode, curry(isTextBlock$1, editor)); - if (block && dom.isEmpty(block)) { - formatNode.parentNode.replaceChild(caretContainer, formatNode); + var dom = editor.dom, block = dom.getParent(formatNode, curry(isTextBlock$1, editor)); + if (block && dom.isEmpty(block)) { + formatNode.parentNode.replaceChild(caretContainer, formatNode); + } else { + removeTrailingBr(SugarElement.fromDom(formatNode)); + if (dom.isEmpty(formatNode)) { + formatNode.parentNode.replaceChild(caretContainer, formatNode); } else { - removeTrailingBr(SugarElement.fromDom(formatNode)); - if (dom.isEmpty(formatNode)) { - formatNode.parentNode.replaceChild(caretContainer, formatNode); - } else { - dom.insertAfter(caretContainer, formatNode); - } + dom.insertAfter(caretContainer, formatNode); } + } }; var appendNode = function (parentNode, node) { - parentNode.appendChild(node); - return node; + parentNode.appendChild(node); + return node; }; var insertFormatNodesIntoCaretContainer = function (formatNodes, caretContainer) { - var innerMostFormatNode = foldr(formatNodes, function (parentNode, formatNode) { - return appendNode(parentNode, formatNode.cloneNode(false)); - }, caretContainer); - return appendNode(innerMostFormatNode, innerMostFormatNode.ownerDocument.createTextNode(ZWSP$1)); + var innerMostFormatNode = foldr(formatNodes, function (parentNode, formatNode) { + return appendNode(parentNode, formatNode.cloneNode(false)); + }, caretContainer); + return appendNode(innerMostFormatNode, innerMostFormatNode.ownerDocument.createTextNode(ZWSP$1)); }; var cleanFormatNode = function (editor, caretContainer, formatNode, name, vars, similar) { - var formatter = editor.formatter; - var dom = editor.dom; - var validFormats = filter(keys(formatter.get()), function (formatName) { - return formatName !== name && !contains$1(formatName, 'removeformat'); - }); - var matchedFormats = matchAllOnNode(editor, formatNode, validFormats); - var uniqueFormats = filter(matchedFormats, function (fmtName) { - return !areSimilarFormats(editor, fmtName, name); - }); - if (uniqueFormats.length > 0) { - var clonedFormatNode = formatNode.cloneNode(false); - dom.add(caretContainer, clonedFormatNode); - formatter.remove(name, vars, clonedFormatNode, similar); - dom.remove(clonedFormatNode); - return Optional.some(clonedFormatNode); - } else { - return Optional.none(); - } + var formatter = editor.formatter; + var dom = editor.dom; + var validFormats = filter(keys(formatter.get()), function (formatName) { + return formatName !== name && !contains$1(formatName, 'removeformat'); + }); + var matchedFormats = matchAllOnNode(editor, formatNode, validFormats); + var uniqueFormats = filter(matchedFormats, function (fmtName) { + return !areSimilarFormats(editor, fmtName, name); + }); + if (uniqueFormats.length > 0) { + var clonedFormatNode = formatNode.cloneNode(false); + dom.add(caretContainer, clonedFormatNode); + formatter.remove(name, vars, clonedFormatNode, similar); + dom.remove(clonedFormatNode); + return Optional.some(clonedFormatNode); + } else { + return Optional.none(); + } }; var applyCaretFormat = function (editor, name, vars) { - var caretContainer, textNode; - var selection = editor.selection; - var selectionRng = selection.getRng(); - var offset = selectionRng.startOffset; - var container = selectionRng.startContainer; - var text = container.nodeValue; - caretContainer = getParentCaretContainer(editor.getBody(), selection.getStart()); - if (caretContainer) { - textNode = findFirstTextNode(caretContainer); - } - var wordcharRegex = /[^\s\u00a0\u00ad\u200b\ufeff]/; - if (text && offset > 0 && offset < text.length && wordcharRegex.test(text.charAt(offset)) && wordcharRegex.test(text.charAt(offset - 1))) { - var bookmark = selection.getBookmark(); - selectionRng.collapse(true); - var rng = expandRng(editor, selectionRng, editor.formatter.get(name)); - rng = split$1(rng); - editor.formatter.apply(name, vars, rng); - selection.moveToBookmark(bookmark); + var caretContainer, textNode; + var selection = editor.selection; + var selectionRng = selection.getRng(); + var offset = selectionRng.startOffset; + var container = selectionRng.startContainer; + var text = container.nodeValue; + caretContainer = getParentCaretContainer(editor.getBody(), selection.getStart()); + if (caretContainer) { + textNode = findFirstTextNode(caretContainer); + } + var wordcharRegex = /[^\s\u00a0\u00ad\u200b\ufeff]/; + if (text && offset > 0 && offset < text.length && wordcharRegex.test(text.charAt(offset)) && wordcharRegex.test(text.charAt(offset - 1))) { + var bookmark = selection.getBookmark(); + selectionRng.collapse(true); + var rng = expandRng(editor, selectionRng, editor.formatter.get(name)); + rng = split$1(rng); + editor.formatter.apply(name, vars, rng); + selection.moveToBookmark(bookmark); + } else { + if (!caretContainer || textNode.nodeValue !== ZWSP$1) { + caretContainer = importNode(editor.getDoc(), createCaretContainer(true).dom); + textNode = caretContainer.firstChild; + selectionRng.insertNode(caretContainer); + offset = 1; + editor.formatter.apply(name, vars, caretContainer); } else { - if (!caretContainer || textNode.nodeValue !== ZWSP$1) { - caretContainer = importNode(editor.getDoc(), createCaretContainer(true).dom); - textNode = caretContainer.firstChild; - selectionRng.insertNode(caretContainer); - offset = 1; - editor.formatter.apply(name, vars, caretContainer); - } else { - editor.formatter.apply(name, vars, caretContainer); - } - selection.setCursorLocation(textNode, offset); + editor.formatter.apply(name, vars, caretContainer); } + selection.setCursorLocation(textNode, offset); + } }; var removeCaretFormat = function (editor, name, vars, similar) { - var dom = editor.dom; - var selection = editor.selection; - var hasContentAfter, node, formatNode; - var parents = []; - var rng = selection.getRng(); - var container = rng.startContainer; - var offset = rng.startOffset; - node = container; - if (container.nodeType === 3) { - if (offset !== container.nodeValue.length) { - hasContentAfter = true; - } - node = node.parentNode; - } - while (node) { - if (matchNode(editor, node, name, vars, similar)) { - formatNode = node; - break; - } - if (node.nextSibling) { - hasContentAfter = true; - } - parents.push(node); - node = node.parentNode; - } - if (!formatNode) { - return; - } - if (hasContentAfter) { - var bookmark = selection.getBookmark(); - rng.collapse(true); - var expandedRng = expandRng(editor, rng, editor.formatter.get(name), true); - expandedRng = split$1(expandedRng); - editor.formatter.remove(name, vars, expandedRng, similar); - selection.moveToBookmark(bookmark); - } else { - var caretContainer = getParentCaretContainer(editor.getBody(), formatNode); - var newCaretContainer = createCaretContainer(false).dom; - insertCaretContainerNode(editor, newCaretContainer, caretContainer !== null ? caretContainer : formatNode); - var cleanedFormatNode = cleanFormatNode(editor, newCaretContainer, formatNode, name, vars, similar); - var caretTextNode = insertFormatNodesIntoCaretContainer(parents.concat(cleanedFormatNode.toArray()), newCaretContainer); - removeCaretContainerNode(editor, caretContainer, false); - selection.setCursorLocation(caretTextNode, 1); - if (dom.isEmpty(formatNode)) { - dom.remove(formatNode); - } - } + var dom = editor.dom; + var selection = editor.selection; + var hasContentAfter, node, formatNode; + var parents = []; + var rng = selection.getRng(); + var container = rng.startContainer; + var offset = rng.startOffset; + node = container; + if (container.nodeType === 3) { + if (offset !== container.nodeValue.length) { + hasContentAfter = true; + } + node = node.parentNode; + } + while (node) { + if (matchNode(editor, node, name, vars, similar)) { + formatNode = node; + break; + } + if (node.nextSibling) { + hasContentAfter = true; + } + parents.push(node); + node = node.parentNode; + } + if (!formatNode) { + return; + } + if (hasContentAfter) { + var bookmark = selection.getBookmark(); + rng.collapse(true); + var expandedRng = expandRng(editor, rng, editor.formatter.get(name), true); + expandedRng = split$1(expandedRng); + editor.formatter.remove(name, vars, expandedRng, similar); + selection.moveToBookmark(bookmark); + } else { + var caretContainer = getParentCaretContainer(editor.getBody(), formatNode); + var newCaretContainer = createCaretContainer(false).dom; + insertCaretContainerNode(editor, newCaretContainer, caretContainer !== null ? caretContainer : formatNode); + var cleanedFormatNode = cleanFormatNode(editor, newCaretContainer, formatNode, name, vars, similar); + var caretTextNode = insertFormatNodesIntoCaretContainer(parents.concat(cleanedFormatNode.toArray()), newCaretContainer); + removeCaretContainerNode(editor, caretContainer, false); + selection.setCursorLocation(caretTextNode, 1); + if (dom.isEmpty(formatNode)) { + dom.remove(formatNode); + } + } }; var disableCaretContainer = function (editor, keyCode) { - var selection = editor.selection, body = editor.getBody(); - removeCaretContainer(editor, null, false); - if ((keyCode === 8 || keyCode === 46) && selection.isCollapsed() && selection.getStart().innerHTML === ZWSP$1) { - removeCaretContainer(editor, getParentCaretContainer(body, selection.getStart())); - } - if (keyCode === 37 || keyCode === 39) { - removeCaretContainer(editor, getParentCaretContainer(body, selection.getStart())); - } + var selection = editor.selection, body = editor.getBody(); + removeCaretContainer(editor, null, false); + if ((keyCode === 8 || keyCode === 46) && selection.isCollapsed() && selection.getStart().innerHTML === ZWSP$1) { + removeCaretContainer(editor, getParentCaretContainer(body, selection.getStart())); + } + if (keyCode === 37 || keyCode === 39) { + removeCaretContainer(editor, getParentCaretContainer(body, selection.getStart())); + } }; var setup$3 = function (editor) { - editor.on('mouseup keydown', function (e) { - disableCaretContainer(editor, e.keyCode); - }); + editor.on('mouseup keydown', function (e) { + disableCaretContainer(editor, e.keyCode); + }); }; var replaceWithCaretFormat = function (targetNode, formatNodes) { - var caretContainer = createCaretContainer(false); - var innerMost = insertFormatNodesIntoCaretContainer(formatNodes, caretContainer.dom); - before(SugarElement.fromDom(targetNode), caretContainer); - remove(SugarElement.fromDom(targetNode)); - return CaretPosition$1(innerMost, 0); + var caretContainer = createCaretContainer(false); + var innerMost = insertFormatNodesIntoCaretContainer(formatNodes, caretContainer.dom); + before(SugarElement.fromDom(targetNode), caretContainer); + remove(SugarElement.fromDom(targetNode)); + return CaretPosition$1(innerMost, 0); }; var isFormatElement = function (editor, element) { - var inlineElements = editor.schema.getTextInlineElements(); - return inlineElements.hasOwnProperty(name(element)) && !isCaretNode(element.dom) && !isBogus(element.dom); + var inlineElements = editor.schema.getTextInlineElements(); + return inlineElements.hasOwnProperty(name(element)) && !isCaretNode(element.dom) && !isBogus(element.dom); }; var isEmptyCaretFormatElement = function (element) { - return isCaretNode(element.dom) && isCaretContainerEmpty(element.dom); + return isCaretNode(element.dom) && isCaretContainerEmpty(element.dom); }; var postProcessHooks = {}; var filter$4 = filter$2; var each$8 = each$2; var addPostProcessHook = function (name, hook) { - var hooks = postProcessHooks[name]; - if (!hooks) { - postProcessHooks[name] = []; - } - postProcessHooks[name].push(hook); + var hooks = postProcessHooks[name]; + if (!hooks) { + postProcessHooks[name] = []; + } + postProcessHooks[name].push(hook); }; var postProcess = function (name, editor) { - each$8(postProcessHooks[name], function (hook) { - hook(editor); - }); + each$8(postProcessHooks[name], function (hook) { + hook(editor); + }); }; addPostProcessHook('pre', function (editor) { - var rng = editor.selection.getRng(); - var blocks; - var hasPreSibling = function (pre) { - return isPre(pre.previousSibling) && indexOf$1(blocks, pre.previousSibling) !== -1; - }; - var joinPre = function (pre1, pre2) { - DomQuery(pre2).remove(); - DomQuery(pre1).append('

              ').append(pre2.childNodes); - }; - var isPre = matchNodeNames(['pre']); - if (!rng.collapsed) { - blocks = editor.selection.getSelectedBlocks(); - each$8(filter$4(filter$4(blocks, isPre), hasPreSibling), function (pre) { - joinPre(pre.previousSibling, pre); - }); - } + var rng = editor.selection.getRng(); + var blocks; + var hasPreSibling = function (pre) { + return isPre(pre.previousSibling) && indexOf$1(blocks, pre.previousSibling) !== -1; + }; + var joinPre = function (pre1, pre2) { + DomQuery(pre2).remove(); + DomQuery(pre1).append('

              ').append(pre2.childNodes); + }; + var isPre = matchNodeNames(['pre']); + if (!rng.collapsed) { + blocks = editor.selection.getSelectedBlocks(); + each$8(filter$4(filter$4(blocks, isPre), hasPreSibling), function (pre) { + joinPre(pre.previousSibling, pre); + }); + } }); var each$9 = Tools.each; var isElementNode = function (node) { - return isElement$1(node) && !isBookmarkNode$1(node) && !isCaretNode(node) && !isBogus(node); + return isElement$1(node) && !isBookmarkNode$1(node) && !isCaretNode(node) && !isBogus(node); }; var findElementSibling = function (node, siblingName) { - var sibling; - for (sibling = node; sibling; sibling = sibling[siblingName]) { - if (isText$1(sibling) && sibling.nodeValue.length !== 0) { - return node; - } - if (isElement$1(sibling) && !isBookmarkNode$1(sibling)) { - return sibling; - } + var sibling; + for (sibling = node; sibling; sibling = sibling[siblingName]) { + if (isText$1(sibling) && sibling.nodeValue.length !== 0) { + return node; } - return node; + if (isElement$1(sibling) && !isBookmarkNode$1(sibling)) { + return sibling; + } + } + return node; }; var mergeSiblingsNodes = function (dom, prev, next) { - var sibling, tmpSibling; - var elementUtils = new ElementUtils(dom); - if (prev && next) { - prev = findElementSibling(prev, 'previousSibling'); - next = findElementSibling(next, 'nextSibling'); - if (elementUtils.compare(prev, next)) { - for (sibling = prev.nextSibling; sibling && sibling !== next;) { - tmpSibling = sibling; - sibling = sibling.nextSibling; - prev.appendChild(tmpSibling); - } - dom.remove(next); - Tools.each(Tools.grep(next.childNodes), function (node) { - prev.appendChild(node); - }); - return prev; - } - } - return next; + var sibling, tmpSibling; + var elementUtils = new ElementUtils(dom); + if (prev && next) { + prev = findElementSibling(prev, 'previousSibling'); + next = findElementSibling(next, 'nextSibling'); + if (elementUtils.compare(prev, next)) { + for (sibling = prev.nextSibling; sibling && sibling !== next;) { + tmpSibling = sibling; + sibling = sibling.nextSibling; + prev.appendChild(tmpSibling); + } + dom.remove(next); + Tools.each(Tools.grep(next.childNodes), function (node) { + prev.appendChild(node); + }); + return prev; + } + } + return next; }; var mergeSiblings = function (dom, format, vars, node) { - if (node && format.merge_siblings !== false) { - var newNode = mergeSiblingsNodes(dom, getNonWhiteSpaceSibling(node), node); - mergeSiblingsNodes(dom, newNode, getNonWhiteSpaceSibling(newNode, true)); - } + if (node && format.merge_siblings !== false) { + var newNode = mergeSiblingsNodes(dom, getNonWhiteSpaceSibling(node), node); + mergeSiblingsNodes(dom, newNode, getNonWhiteSpaceSibling(newNode, true)); + } }; var clearChildStyles = function (dom, format, node) { - if (format.clear_child_styles) { - var selector = format.links ? '*:not(a)' : '*'; - each$9(dom.select(selector, node), function (node) { - if (isElementNode(node)) { - each$9(format.styles, function (value, name) { - dom.setStyle(node, name, ''); - }); - } + if (format.clear_child_styles) { + var selector = format.links ? '*:not(a)' : '*'; + each$9(dom.select(selector, node), function (node) { + if (isElementNode(node)) { + each$9(format.styles, function (value, name) { + dom.setStyle(node, name, ''); }); - } + } + }); + } }; var processChildElements = function (node, filter, process) { - each$9(node.childNodes, function (node) { - if (isElementNode(node)) { - if (filter(node)) { - process(node); - } - if (node.hasChildNodes()) { - processChildElements(node, filter, process); - } - } - }); + each$9(node.childNodes, function (node) { + if (isElementNode(node)) { + if (filter(node)) { + process(node); + } + if (node.hasChildNodes()) { + processChildElements(node, filter, process); + } + } + }); }; var unwrapEmptySpan = function (dom, node) { - if (node.nodeName === 'SPAN' && dom.getAttribs(node).length === 0) { - dom.remove(node, true); - } + if (node.nodeName === 'SPAN' && dom.getAttribs(node).length === 0) { + dom.remove(node, true); + } }; var hasStyle = function (dom, name) { - return function (node) { - return !!(node && getStyle(dom, node, name)); - }; + return function (node) { + return !!(node && getStyle(dom, node, name)); + }; }; var applyStyle = function (dom, name, value) { - return function (node) { - dom.setStyle(node, name, value); - if (node.getAttribute('style') === '') { - node.removeAttribute('style'); - } - unwrapEmptySpan(dom, node); - }; + return function (node) { + dom.setStyle(node, name, value); + if (node.getAttribute('style') === '') { + node.removeAttribute('style'); + } + unwrapEmptySpan(dom, node); + }; }; var removeResult = Adt.generate([ - {keep: []}, - {rename: ['name']}, - {removed: []} + { keep: [] }, + { rename: ['name'] }, + { removed: [] } ]); var MCE_ATTR_RE = /^(src|href|style)$/; var each$a = Tools.each; var isEq$3 = isEq; var isTableCellOrRow = function (node) { - return /^(TR|TH|TD)$/.test(node.nodeName); + return /^(TR|TH|TD)$/.test(node.nodeName); }; var isChildOfInlineParent = function (dom, node, parent) { - return dom.isChildOf(node, parent) && node !== parent && !dom.isBlock(parent); + return dom.isChildOf(node, parent) && node !== parent && !dom.isBlock(parent); }; var getContainer = function (ed, rng, start) { - var container, offset; - container = rng[start ? 'startContainer' : 'endContainer']; - offset = rng[start ? 'startOffset' : 'endOffset']; - if (isElement$1(container)) { - var lastIdx = container.childNodes.length - 1; - if (!start && offset) { - offset--; - } - container = container.childNodes[offset > lastIdx ? lastIdx : offset]; - } - if (isText$1(container) && start && offset >= container.nodeValue.length) { - container = new DomTreeWalker(container, ed.getBody()).next() || container; - } - if (isText$1(container) && !start && offset === 0) { - container = new DomTreeWalker(container, ed.getBody()).prev() || container; - } - return container; + var container, offset; + container = rng[start ? 'startContainer' : 'endContainer']; + offset = rng[start ? 'startOffset' : 'endOffset']; + if (isElement$1(container)) { + var lastIdx = container.childNodes.length - 1; + if (!start && offset) { + offset--; + } + container = container.childNodes[offset > lastIdx ? lastIdx : offset]; + } + if (isText$1(container) && start && offset >= container.nodeValue.length) { + container = new DomTreeWalker(container, ed.getBody()).next() || container; + } + if (isText$1(container) && !start && offset === 0) { + container = new DomTreeWalker(container, ed.getBody()).prev() || container; + } + return container; }; var normalizeTableSelection = function (node, start) { - var prop = start ? 'firstChild' : 'lastChild'; - if (isTableCellOrRow(node) && node[prop]) { - var childNode = node[prop]; - if (node.nodeName === 'TR') { - return childNode[prop] || childNode; - } else { - return childNode; - } + var prop = start ? 'firstChild' : 'lastChild'; + if (isTableCellOrRow(node) && node[prop]) { + var childNode = node[prop]; + if (node.nodeName === 'TR') { + return childNode[prop] || childNode; + } else { + return childNode; } - return node; + } + return node; }; var wrap$2 = function (dom, node, name, attrs) { - var wrapper = dom.create(name, attrs); - node.parentNode.insertBefore(wrapper, node); - wrapper.appendChild(node); - return wrapper; + var wrapper = dom.create(name, attrs); + node.parentNode.insertBefore(wrapper, node); + wrapper.appendChild(node); + return wrapper; }; var wrapWithSiblings = function (dom, node, next, name, attrs) { - var start = SugarElement.fromDom(node); - var wrapper = SugarElement.fromDom(dom.create(name, attrs)); - var siblings = next ? nextSiblings(start) : prevSiblings(start); - append$1(wrapper, siblings); - if (next) { - before(start, wrapper); - prepend(wrapper, start); - } else { - after(start, wrapper); - append(wrapper, start); - } - return wrapper.dom; + var start = SugarElement.fromDom(node); + var wrapper = SugarElement.fromDom(dom.create(name, attrs)); + var siblings = next ? nextSiblings(start) : prevSiblings(start); + append$1(wrapper, siblings); + if (next) { + before(start, wrapper); + prepend(wrapper, start); + } else { + after(start, wrapper); + append(wrapper, start); + } + return wrapper.dom; }; var matchName$1 = function (dom, node, format) { - if (isEq$3(node, format.inline)) { - return true; - } - if (isEq$3(node, format.block)) { - return true; - } - if (format.selector) { - return isElement$1(node) && dom.is(node, format.selector); - } + if (isEq$3(node, format.inline)) { + return true; + } + if (isEq$3(node, format.block)) { + return true; + } + if (format.selector) { + return isElement$1(node) && dom.is(node, format.selector); + } }; var isColorFormatAndAnchor = function (node, format) { - return format.links && node.nodeName === 'A'; + return format.links && node.nodeName === 'A'; }; var find$3 = function (dom, node, next, inc) { - node = getNonWhiteSpaceSibling(node, next, inc); - return !node || (node.nodeName === 'BR' || dom.isBlock(node)); + node = getNonWhiteSpaceSibling(node, next, inc); + return !node || (node.nodeName === 'BR' || dom.isBlock(node)); }; var removeNode$1 = function (ed, node, format) { - var parentNode = node.parentNode; - var rootBlockElm; - var dom = ed.dom, forcedRootBlock = getForcedRootBlock(ed); - if (format.block) { - if (!forcedRootBlock) { - if (dom.isBlock(node) && !dom.isBlock(parentNode)) { - if (!find$3(dom, node, false) && !find$3(dom, node.firstChild, true, true)) { - node.insertBefore(dom.create('br'), node.firstChild); - } - if (!find$3(dom, node, true) && !find$3(dom, node.lastChild, false, true)) { - node.appendChild(dom.create('br')); - } - } - } else { - if (parentNode === dom.getRoot()) { - if (!format.list_block || !isEq$3(node, format.list_block)) { - each(from$1(node.childNodes), function (node) { - if (isValid(ed, forcedRootBlock, node.nodeName.toLowerCase())) { - if (!rootBlockElm) { - rootBlockElm = wrap$2(dom, node, forcedRootBlock); - dom.setAttribs(rootBlockElm, ed.settings.forced_root_block_attrs); - } else { - rootBlockElm.appendChild(node); - } - } else { - rootBlockElm = 0; - } - }); - } + var parentNode = node.parentNode; + var rootBlockElm; + var dom = ed.dom, forcedRootBlock = getForcedRootBlock(ed); + if (format.block) { + if (!forcedRootBlock) { + if (dom.isBlock(node) && !dom.isBlock(parentNode)) { + if (!find$3(dom, node, false) && !find$3(dom, node.firstChild, true, true)) { + node.insertBefore(dom.create('br'), node.firstChild); + } + if (!find$3(dom, node, true) && !find$3(dom, node.lastChild, false, true)) { + node.appendChild(dom.create('br')); + } + } + } else { + if (parentNode === dom.getRoot()) { + if (!format.list_block || !isEq$3(node, format.list_block)) { + each(from$1(node.childNodes), function (node) { + if (isValid(ed, forcedRootBlock, node.nodeName.toLowerCase())) { + if (!rootBlockElm) { + rootBlockElm = wrap$2(dom, node, forcedRootBlock); + dom.setAttribs(rootBlockElm, ed.settings.forced_root_block_attrs); + } else { + rootBlockElm.appendChild(node); + } + } else { + rootBlockElm = 0; } + }); } + } } - if (format.selector && format.inline && !isEq$3(format.inline, node)) { - return; - } - dom.remove(node, true); + } + if (format.selector && format.inline && !isEq$3(format.inline, node)) { + return; + } + dom.remove(node, true); }; var removeFormatInternal = function (ed, format, vars, node, compareNode) { - var stylesModified; - var dom = ed.dom; - if (!matchName$1(dom, node, format) && !isColorFormatAndAnchor(node, format)) { - return removeResult.keep(); - } - var elm = node; - if (format.inline && format.remove === 'all' && isArray(format.preserve_attributes)) { - var attrsToPreserve = filter(dom.getAttribs(elm), function (attr) { - return contains(format.preserve_attributes, attr.name.toLowerCase()); - }); - dom.removeAllAttribs(elm); - each(attrsToPreserve, function (attr) { - return dom.setAttrib(elm, attr.name, attr.value); - }); - if (attrsToPreserve.length > 0) { - return removeResult.rename('span'); - } - } - if (format.remove !== 'all') { - each$a(format.styles, function (value, name) { - value = normalizeStyleValue(dom, replaceVars(value, vars), name + ''); - if (isNumber(name)) { - name = value; - compareNode = null; - } - if (format.remove_similar || (!compareNode || isEq$3(getStyle(dom, compareNode, name), value))) { - dom.setStyle(elm, name, ''); - } - stylesModified = true; - }); - if (stylesModified && dom.getAttrib(elm, 'style') === '') { - elm.removeAttribute('style'); - elm.removeAttribute('data-mce-style'); - } - each$a(format.attributes, function (value, name) { - var valueOut; - value = replaceVars(value, vars); - if (isNumber(name)) { - name = value; - compareNode = null; - } - if (format.remove_similar || (!compareNode || isEq$3(dom.getAttrib(compareNode, name), value))) { - if (name === 'class') { - value = dom.getAttrib(elm, name); - if (value) { - valueOut = ''; - each(value.split(/\s+/), function (cls) { - if (/mce\-\w+/.test(cls)) { - valueOut += (valueOut ? ' ' : '') + cls; - } - }); - if (valueOut) { - dom.setAttrib(elm, name, valueOut); - return; - } - } - } - if (name === 'class') { - elm.removeAttribute('className'); - } - if (MCE_ATTR_RE.test(name)) { - elm.removeAttribute('data-mce-' + name); - } - elm.removeAttribute(name); - } - }); - each$a(format.classes, function (value) { - value = replaceVars(value, vars); - if (!compareNode || dom.hasClass(compareNode, value)) { - dom.removeClass(elm, value); - } - }); - var attrs = dom.getAttribs(elm); - for (var i = 0; i < attrs.length; i++) { - var attrName = attrs[i].nodeName; - if (attrName.indexOf('_') !== 0 && attrName.indexOf('data-') !== 0) { - return removeResult.keep(); + var stylesModified; + var dom = ed.dom; + if (!matchName$1(dom, node, format) && !isColorFormatAndAnchor(node, format)) { + return removeResult.keep(); + } + var elm = node; + if (format.inline && format.remove === 'all' && isArray(format.preserve_attributes)) { + var attrsToPreserve = filter(dom.getAttribs(elm), function (attr) { + return contains(format.preserve_attributes, attr.name.toLowerCase()); + }); + dom.removeAllAttribs(elm); + each(attrsToPreserve, function (attr) { + return dom.setAttrib(elm, attr.name, attr.value); + }); + if (attrsToPreserve.length > 0) { + return removeResult.rename('span'); + } + } + if (format.remove !== 'all') { + each$a(format.styles, function (value, name) { + value = normalizeStyleValue(dom, replaceVars(value, vars), name + ''); + if (isNumber(name)) { + name = value; + compareNode = null; + } + if (format.remove_similar || (!compareNode || isEq$3(getStyle(dom, compareNode, name), value))) { + dom.setStyle(elm, name, ''); + } + stylesModified = true; + }); + if (stylesModified && dom.getAttrib(elm, 'style') === '') { + elm.removeAttribute('style'); + elm.removeAttribute('data-mce-style'); + } + each$a(format.attributes, function (value, name) { + var valueOut; + value = replaceVars(value, vars); + if (isNumber(name)) { + name = value; + compareNode = null; + } + if (format.remove_similar || (!compareNode || isEq$3(dom.getAttrib(compareNode, name), value))) { + if (name === 'class') { + value = dom.getAttrib(elm, name); + if (value) { + valueOut = ''; + each(value.split(/\s+/), function (cls) { + if (/mce\-\w+/.test(cls)) { + valueOut += (valueOut ? ' ' : '') + cls; + } + }); + if (valueOut) { + dom.setAttrib(elm, name, valueOut); + return; } + } } + if (name === 'class') { + elm.removeAttribute('className'); + } + if (MCE_ATTR_RE.test(name)) { + elm.removeAttribute('data-mce-' + name); + } + elm.removeAttribute(name); + } + }); + each$a(format.classes, function (value) { + value = replaceVars(value, vars); + if (!compareNode || dom.hasClass(compareNode, value)) { + dom.removeClass(elm, value); + } + }); + var attrs = dom.getAttribs(elm); + for (var i = 0; i < attrs.length; i++) { + var attrName = attrs[i].nodeName; + if (attrName.indexOf('_') !== 0 && attrName.indexOf('data-') !== 0) { + return removeResult.keep(); + } } - if (format.remove !== 'none') { - removeNode$1(ed, elm, format); - return removeResult.removed(); - } - return removeResult.keep(); + } + if (format.remove !== 'none') { + removeNode$1(ed, elm, format); + return removeResult.removed(); + } + return removeResult.keep(); }; var removeFormat = function (ed, format, vars, node, compareNode) { - return removeFormatInternal(ed, format, vars, node, compareNode).fold(never, function (newName) { - ed.dom.rename(node, newName); - return true; - }, always); + return removeFormatInternal(ed, format, vars, node, compareNode).fold(never, function (newName) { + ed.dom.rename(node, newName); + return true; + }, always); }; var findFormatRoot = function (editor, container, name, vars, similar) { - var formatRoot; - each(getParents$1(editor.dom, container.parentNode).reverse(), function (parent) { - if (!formatRoot && parent.id !== '_start' && parent.id !== '_end') { - var format = matchNode(editor, parent, name, vars, similar); - if (format && format.split !== false) { - formatRoot = parent; - } - } - }); - return formatRoot; + var formatRoot; + each(getParents$1(editor.dom, container.parentNode).reverse(), function (parent) { + if (!formatRoot && parent.id !== '_start' && parent.id !== '_end') { + var format = matchNode(editor, parent, name, vars, similar); + if (format && format.split !== false) { + formatRoot = parent; + } + } + }); + return formatRoot; }; var removeFormatFromClone = function (editor, format, vars, clone) { - return removeFormatInternal(editor, format, vars, clone, clone).fold(constant(clone), function (newName) { - var fragment = editor.dom.createFragment(); - fragment.appendChild(clone); - return editor.dom.rename(clone, newName); - }, constant(null)); + return removeFormatInternal(editor, format, vars, clone, clone).fold(constant(clone), function (newName) { + var fragment = editor.dom.createFragment(); + fragment.appendChild(clone); + return editor.dom.rename(clone, newName); + }, constant(null)); }; var wrapAndSplit = function (editor, formatList, formatRoot, container, target, split, format, vars) { - var clone, lastClone, firstClone; - var dom = editor.dom; - if (formatRoot) { - var formatRootParent = formatRoot.parentNode; - for (var parent_1 = container.parentNode; parent_1 && parent_1 !== formatRootParent; parent_1 = parent_1.parentNode) { - clone = dom.clone(parent_1, false); - for (var i = 0; i < formatList.length; i++) { - clone = removeFormatFromClone(editor, formatList[i], vars, clone); - if (clone === null) { - break; - } - } - if (clone) { - if (lastClone) { - clone.appendChild(lastClone); - } - if (!firstClone) { - firstClone = clone; - } - lastClone = clone; - } - } - if (split && (!format.mixed || !dom.isBlock(formatRoot))) { - container = dom.split(formatRoot, container); - } + var clone, lastClone, firstClone; + var dom = editor.dom; + if (formatRoot) { + var formatRootParent = formatRoot.parentNode; + for (var parent_1 = container.parentNode; parent_1 && parent_1 !== formatRootParent; parent_1 = parent_1.parentNode) { + clone = dom.clone(parent_1, false); + for (var i = 0; i < formatList.length; i++) { + clone = removeFormatFromClone(editor, formatList[i], vars, clone); + if (clone === null) { + break; + } + } + if (clone) { if (lastClone) { - target.parentNode.insertBefore(lastClone, target); - firstClone.appendChild(target); - if (format.inline) { - mergeSiblings(dom, format, vars, lastClone); - } + clone.appendChild(lastClone); } + if (!firstClone) { + firstClone = clone; + } + lastClone = clone; + } + } + if (split && (!format.mixed || !dom.isBlock(formatRoot))) { + container = dom.split(formatRoot, container); } - return container; + if (lastClone) { + target.parentNode.insertBefore(lastClone, target); + firstClone.appendChild(target); + if (format.inline) { + mergeSiblings(dom, format, vars, lastClone); + } + } + } + return container; }; var remove$6 = function (ed, name, vars, node, similar) { - var formatList = ed.formatter.get(name); - var format = formatList[0]; - var contentEditable = true; - var dom = ed.dom; - var selection = ed.selection; - var splitToFormatRoot = function (container) { - var formatRoot = findFormatRoot(ed, container, name, vars, similar); - return wrapAndSplit(ed, formatList, formatRoot, container, container, true, format, vars); - }; - var isRemoveBookmarkNode = function (node) { - return isBookmarkNode$1(node) && isElement$1(node) && (node.id === '_start' || node.id === '_end'); - }; - var process = function (node) { - var lastContentEditable, hasContentEditableState; - if (isElement$1(node) && dom.getContentEditable(node)) { - lastContentEditable = contentEditable; - contentEditable = dom.getContentEditable(node) === 'true'; - hasContentEditableState = true; - } - var children = from$1(node.childNodes); - if (contentEditable && !hasContentEditableState) { - for (var i = 0; i < formatList.length; i++) { - if (removeFormat(ed, formatList[i], vars, node, node)) { - break; - } - } - } - if (format.deep) { - if (children.length) { - for (var i = 0; i < children.length; i++) { - process(children[i]); - } - if (hasContentEditableState) { - contentEditable = lastContentEditable; - } - } - } - }; - var unwrap = function (start) { - var node = dom.get(start ? '_start' : '_end'); - var out = node[start ? 'firstChild' : 'lastChild']; - if (isRemoveBookmarkNode(out)) { - out = out[start ? 'firstChild' : 'lastChild']; - } - if (isText$1(out) && out.data.length === 0) { - out = start ? node.previousSibling || node.nextSibling : node.nextSibling || node.previousSibling; - } - dom.remove(node, true); - return out; - }; - var removeRngStyle = function (rng) { - var startContainer, endContainer; - var expandedRng = expandRng(ed, rng, formatList, rng.collapsed); - if (format.split) { - expandedRng = split$1(expandedRng); - startContainer = getContainer(ed, expandedRng, true); - endContainer = getContainer(ed, expandedRng); - if (startContainer !== endContainer) { - startContainer = normalizeTableSelection(startContainer, true); - endContainer = normalizeTableSelection(endContainer, false); - if (isChildOfInlineParent(dom, startContainer, endContainer)) { - var marker = Optional.from(startContainer.firstChild).getOr(startContainer); - splitToFormatRoot(wrapWithSiblings(dom, marker, true, 'span', { - 'id': '_start', - 'data-mce-type': 'bookmark' - })); - unwrap(true); - return; - } - if (isChildOfInlineParent(dom, endContainer, startContainer)) { - var marker = Optional.from(endContainer.lastChild).getOr(endContainer); - splitToFormatRoot(wrapWithSiblings(dom, marker, false, 'span', { - 'id': '_end', - 'data-mce-type': 'bookmark' - })); - unwrap(false); - return; - } - startContainer = wrap$2(dom, startContainer, 'span', { - 'id': '_start', - 'data-mce-type': 'bookmark' - }); - endContainer = wrap$2(dom, endContainer, 'span', { - 'id': '_end', - 'data-mce-type': 'bookmark' - }); - var newRng = dom.createRng(); - newRng.setStartAfter(startContainer); - newRng.setEndBefore(endContainer); - walk$1(dom, newRng, function (nodes) { - each(nodes, function (n) { - if (!isBookmarkNode$1(n) && !isBookmarkNode$1(n.parentNode)) { - splitToFormatRoot(n); - } - }); - }); - splitToFormatRoot(startContainer); - splitToFormatRoot(endContainer); - startContainer = unwrap(true); - endContainer = unwrap(); - } else { - startContainer = endContainer = splitToFormatRoot(startContainer); - } - expandedRng.startContainer = startContainer.parentNode ? startContainer.parentNode : startContainer; - expandedRng.startOffset = dom.nodeIndex(startContainer); - expandedRng.endContainer = endContainer.parentNode ? endContainer.parentNode : endContainer; - expandedRng.endOffset = dom.nodeIndex(endContainer) + 1; - } - walk$1(dom, expandedRng, function (nodes) { - each(nodes, function (node) { - process(node); - var textDecorations = [ - 'underline', - 'line-through', - 'overline' - ]; - each(textDecorations, function (decoration) { - if (isElement$1(node) && ed.dom.getStyle(node, 'text-decoration') === decoration && node.parentNode && getTextDecoration(dom, node.parentNode) === decoration) { - removeFormat(ed, { - deep: false, - exact: true, - inline: 'span', - styles: {textDecoration: decoration} - }, null, node); - } - }); - }); + var formatList = ed.formatter.get(name); + var format = formatList[0]; + var contentEditable = true; + var dom = ed.dom; + var selection = ed.selection; + var splitToFormatRoot = function (container) { + var formatRoot = findFormatRoot(ed, container, name, vars, similar); + return wrapAndSplit(ed, formatList, formatRoot, container, container, true, format, vars); + }; + var isRemoveBookmarkNode = function (node) { + return isBookmarkNode$1(node) && isElement$1(node) && (node.id === '_start' || node.id === '_end'); + }; + var process = function (node) { + var lastContentEditable, hasContentEditableState; + if (isElement$1(node) && dom.getContentEditable(node)) { + lastContentEditable = contentEditable; + contentEditable = dom.getContentEditable(node) === 'true'; + hasContentEditableState = true; + } + var children = from$1(node.childNodes); + if (contentEditable && !hasContentEditableState) { + for (var i = 0; i < formatList.length; i++) { + if (removeFormat(ed, formatList[i], vars, node, node)) { + break; + } + } + } + if (format.deep) { + if (children.length) { + for (var i = 0; i < children.length; i++) { + process(children[i]); + } + if (hasContentEditableState) { + contentEditable = lastContentEditable; + } + } + } + }; + var unwrap = function (start) { + var node = dom.get(start ? '_start' : '_end'); + var out = node[start ? 'firstChild' : 'lastChild']; + if (isRemoveBookmarkNode(out)) { + out = out[start ? 'firstChild' : 'lastChild']; + } + if (isText$1(out) && out.data.length === 0) { + out = start ? node.previousSibling || node.nextSibling : node.nextSibling || node.previousSibling; + } + dom.remove(node, true); + return out; + }; + var removeRngStyle = function (rng) { + var startContainer, endContainer; + var expandedRng = expandRng(ed, rng, formatList, rng.collapsed); + if (format.split) { + expandedRng = split$1(expandedRng); + startContainer = getContainer(ed, expandedRng, true); + endContainer = getContainer(ed, expandedRng); + if (startContainer !== endContainer) { + startContainer = normalizeTableSelection(startContainer, true); + endContainer = normalizeTableSelection(endContainer, false); + if (isChildOfInlineParent(dom, startContainer, endContainer)) { + var marker = Optional.from(startContainer.firstChild).getOr(startContainer); + splitToFormatRoot(wrapWithSiblings(dom, marker, true, 'span', { + 'id': '_start', + 'data-mce-type': 'bookmark' + })); + unwrap(true); + return; + } + if (isChildOfInlineParent(dom, endContainer, startContainer)) { + var marker = Optional.from(endContainer.lastChild).getOr(endContainer); + splitToFormatRoot(wrapWithSiblings(dom, marker, false, 'span', { + 'id': '_end', + 'data-mce-type': 'bookmark' + })); + unwrap(false); + return; + } + startContainer = wrap$2(dom, startContainer, 'span', { + 'id': '_start', + 'data-mce-type': 'bookmark' + }); + endContainer = wrap$2(dom, endContainer, 'span', { + 'id': '_end', + 'data-mce-type': 'bookmark' }); - }; - if (node) { - if (isNode(node)) { - var rng = dom.createRng(); - rng.setStartBefore(node); - rng.setEndAfter(node); - removeRngStyle(rng); - } else { - removeRngStyle(node); - } - return; + var newRng = dom.createRng(); + newRng.setStartAfter(startContainer); + newRng.setEndBefore(endContainer); + walk$1(dom, newRng, function (nodes) { + each(nodes, function (n) { + if (!isBookmarkNode$1(n) && !isBookmarkNode$1(n.parentNode)) { + splitToFormatRoot(n); + } + }); + }); + splitToFormatRoot(startContainer); + splitToFormatRoot(endContainer); + startContainer = unwrap(true); + endContainer = unwrap(); + } else { + startContainer = endContainer = splitToFormatRoot(startContainer); + } + expandedRng.startContainer = startContainer.parentNode ? startContainer.parentNode : startContainer; + expandedRng.startOffset = dom.nodeIndex(startContainer); + expandedRng.endContainer = endContainer.parentNode ? endContainer.parentNode : endContainer; + expandedRng.endOffset = dom.nodeIndex(endContainer) + 1; + } + walk$1(dom, expandedRng, function (nodes) { + each(nodes, function (node) { + process(node); + var textDecorations = [ + 'underline', + 'line-through', + 'overline' + ]; + each(textDecorations, function (decoration) { + if (isElement$1(node) && ed.dom.getStyle(node, 'text-decoration') === decoration && node.parentNode && getTextDecoration(dom, node.parentNode) === decoration) { + removeFormat(ed, { + deep: false, + exact: true, + inline: 'span', + styles: { textDecoration: decoration } + }, null, node); + } + }); + }); + }); + }; + if (node) { + if (isNode(node)) { + var rng = dom.createRng(); + rng.setStartBefore(node); + rng.setEndAfter(node); + removeRngStyle(rng); + } else { + removeRngStyle(node); } - if (dom.getContentEditable(selection.getNode()) === 'false') { - node = selection.getNode(); - for (var i = 0; i < formatList.length; i++) { - if (formatList[i].ceFalseOverride) { - if (removeFormat(ed, formatList[i], vars, node, node)) { - break; - } - } + return; + } + if (dom.getContentEditable(selection.getNode()) === 'false') { + node = selection.getNode(); + for (var i = 0; i < formatList.length; i++) { + if (formatList[i].ceFalseOverride) { + if (removeFormat(ed, formatList[i], vars, node, node)) { + break; } - return; + } } - if (!selection.isCollapsed() || !format.inline || getCellsFromEditor(ed).length) { - preserve(selection, true, function () { - runOnRanges(ed, removeRngStyle); - }); - if (format.inline && match(ed, name, vars, selection.getStart())) { - moveStart(dom, selection, selection.getRng()); - } - ed.nodeChanged(); - } else { - removeCaretFormat(ed, name, vars, similar); + return; + } + if (!selection.isCollapsed() || !format.inline || getCellsFromEditor(ed).length) { + preserve(selection, true, function () { + runOnRanges(ed, removeRngStyle); + }); + if (format.inline && match(ed, name, vars, selection.getStart())) { + moveStart(dom, selection, selection.getRng()); } + ed.nodeChanged(); + } else { + removeCaretFormat(ed, name, vars, similar); + } }; var each$b = Tools.each; var mergeTextDecorationsAndColor = function (dom, format, vars, node) { - var processTextDecorationsAndColor = function (n) { - if (n.nodeType === 1 && n.parentNode && n.parentNode.nodeType === 1) { - var textDecoration = getTextDecoration(dom, n.parentNode); - if (dom.getStyle(n, 'color') && textDecoration) { - dom.setStyle(n, 'text-decoration', textDecoration); - } else if (dom.getStyle(n, 'text-decoration') === textDecoration) { - dom.setStyle(n, 'text-decoration', null); - } - } - }; - if (format.styles && (format.styles.color || format.styles.textDecoration)) { - Tools.walk(node, processTextDecorationsAndColor, 'childNodes'); - processTextDecorationsAndColor(node); - } + var processTextDecorationsAndColor = function (n) { + if (n.nodeType === 1 && n.parentNode && n.parentNode.nodeType === 1) { + var textDecoration = getTextDecoration(dom, n.parentNode); + if (dom.getStyle(n, 'color') && textDecoration) { + dom.setStyle(n, 'text-decoration', textDecoration); + } else if (dom.getStyle(n, 'text-decoration') === textDecoration) { + dom.setStyle(n, 'text-decoration', null); + } + } + }; + if (format.styles && (format.styles.color || format.styles.textDecoration)) { + Tools.walk(node, processTextDecorationsAndColor, 'childNodes'); + processTextDecorationsAndColor(node); + } }; var mergeBackgroundColorAndFontSize = function (dom, format, vars, node) { - if (format.styles && format.styles.backgroundColor) { - processChildElements(node, hasStyle(dom, 'fontSize'), applyStyle(dom, 'backgroundColor', replaceVars(format.styles.backgroundColor, vars))); - } + if (format.styles && format.styles.backgroundColor) { + processChildElements(node, hasStyle(dom, 'fontSize'), applyStyle(dom, 'backgroundColor', replaceVars(format.styles.backgroundColor, vars))); + } }; var mergeSubSup = function (dom, format, vars, node) { - if (format.inline === 'sub' || format.inline === 'sup') { - processChildElements(node, hasStyle(dom, 'fontSize'), applyStyle(dom, 'fontSize', '')); - dom.remove(dom.select(format.inline === 'sup' ? 'sub' : 'sup', node), true); - } + if (format.inline === 'sub' || format.inline === 'sup') { + processChildElements(node, hasStyle(dom, 'fontSize'), applyStyle(dom, 'fontSize', '')); + dom.remove(dom.select(format.inline === 'sup' ? 'sub' : 'sup', node), true); + } }; var mergeWithChildren = function (editor, formatList, vars, node) { - each$b(formatList, function (format) { - each$b(editor.dom.select(format.inline, node), function (child) { - if (!isElementNode(child)) { - return; - } - removeFormat(editor, format, vars, child, format.exact ? child : null); - }); - clearChildStyles(editor.dom, format, node); + each$b(formatList, function (format) { + each$b(editor.dom.select(format.inline, node), function (child) { + if (!isElementNode(child)) { + return; + } + removeFormat(editor, format, vars, child, format.exact ? child : null); }); + clearChildStyles(editor.dom, format, node); + }); }; var mergeWithParents = function (editor, format, name, vars, node) { - if (matchNode(editor, node.parentNode, name, vars)) { - if (removeFormat(editor, format, vars, node)) { - return; - } - } - if (format.merge_with_parents) { - editor.dom.getParent(node.parentNode, function (parent) { - if (matchNode(editor, parent, name, vars)) { - removeFormat(editor, format, vars, node); - return true; - } - }); - } + if (matchNode(editor, node.parentNode, name, vars)) { + if (removeFormat(editor, format, vars, node)) { + return; + } + } + if (format.merge_with_parents) { + editor.dom.getParent(node.parentNode, function (parent) { + if (matchNode(editor, parent, name, vars)) { + removeFormat(editor, format, vars, node); + return true; + } + }); + } }; var each$c = Tools.each; var hasFormatProperty = function (format, prop) { - return hasNonNullableKey(format, prop); + return hasNonNullableKey(format, prop); }; var isElementNode$1 = function (node) { - return node && node.nodeType === 1 && !isBookmarkNode$1(node) && !isCaretNode(node) && !isBogus(node); + return node && node.nodeType === 1 && !isBookmarkNode$1(node) && !isCaretNode(node) && !isBogus(node); }; var canFormatBR = function (editor, format, node, parentName) { - if (canFormatEmptyLines(editor) && isInlineFormat(format)) { - var validBRParentElements = __assign(__assign({}, editor.schema.getTextBlockElements()), { - td: {}, - th: {}, - li: {}, - dt: {}, - dd: {}, - figcaption: {}, - caption: {}, - details: {}, - summary: {} - }); - var hasCaretNodeSibling = sibling$2(SugarElement.fromDom(node), function (sibling) { - return isCaretNode(sibling.dom); - }); - return hasNonNullableKey(validBRParentElements, parentName) && isEmpty(SugarElement.fromDom(node.parentNode), false) && !hasCaretNodeSibling; - } else { - return false; - } + if (canFormatEmptyLines(editor) && isInlineFormat(format)) { + var validBRParentElements = __assign(__assign({}, editor.schema.getTextBlockElements()), { + td: {}, + th: {}, + li: {}, + dt: {}, + dd: {}, + figcaption: {}, + caption: {}, + details: {}, + summary: {} + }); + var hasCaretNodeSibling = sibling$2(SugarElement.fromDom(node), function (sibling) { + return isCaretNode(sibling.dom); + }); + return hasNonNullableKey(validBRParentElements, parentName) && isEmpty(SugarElement.fromDom(node.parentNode), false) && !hasCaretNodeSibling; + } else { + return false; + } }; var applyFormat = function (ed, name, vars, node) { - var formatList = ed.formatter.get(name); - var format = formatList[0]; - var isCollapsed = !node && ed.selection.isCollapsed(); - var dom = ed.dom; - var selection = ed.selection; - var setElementFormat = function (elm, fmt) { - fmt = fmt || format; - if (elm) { - if (fmt.onformat) { - fmt.onformat(elm, fmt, vars, node); - } - each$c(fmt.styles, function (value, name) { - dom.setStyle(elm, name, replaceVars(value, vars)); - }); - if (fmt.styles) { - var styleVal = dom.getAttrib(elm, 'style'); - if (styleVal) { - dom.setAttrib(elm, 'data-mce-style', styleVal); - } - } - each$c(fmt.attributes, function (value, name) { - dom.setAttrib(elm, name, replaceVars(value, vars)); - }); - each$c(fmt.classes, function (value) { - value = replaceVars(value, vars); - if (!dom.hasClass(elm, value)) { - dom.addClass(elm, value); - } - }); + var formatList = ed.formatter.get(name); + var format = formatList[0]; + var isCollapsed = !node && ed.selection.isCollapsed(); + var dom = ed.dom; + var selection = ed.selection; + var setElementFormat = function (elm, fmt) { + fmt = fmt || format; + if (elm) { + if (fmt.onformat) { + fmt.onformat(elm, fmt, vars, node); + } + each$c(fmt.styles, function (value, name) { + dom.setStyle(elm, name, replaceVars(value, vars)); + }); + if (fmt.styles) { + var styleVal = dom.getAttrib(elm, 'style'); + if (styleVal) { + dom.setAttrib(elm, 'data-mce-style', styleVal); + } + } + each$c(fmt.attributes, function (value, name) { + dom.setAttrib(elm, name, replaceVars(value, vars)); + }); + each$c(fmt.classes, function (value) { + value = replaceVars(value, vars); + if (!dom.hasClass(elm, value)) { + dom.addClass(elm, value); + } + }); + } + }; + var applyNodeStyle = function (formatList, node) { + var found = false; + if (!isSelectorFormat(format)) { + return false; + } + each$c(formatList, function (format) { + if ('collapsed' in format && format.collapsed !== isCollapsed) { + return; + } + if (dom.is(node, format.selector) && !isCaretNode(node)) { + setElementFormat(node, format); + found = true; + return false; + } + }); + return found; + }; + var applyRngStyle = function (dom, rng, bookmark, nodeSpecific) { + var newWrappers = []; + var contentEditable = true; + var wrapName = format.inline || format.block; + var wrapElm = dom.create(wrapName); + setElementFormat(wrapElm); + walk$1(dom, rng, function (nodes) { + var currentWrapElm; + var process = function (node) { + var hasContentEditableState = false; + var lastContentEditable = contentEditable; + var nodeName = node.nodeName.toLowerCase(); + var parentName = node.parentNode.nodeName.toLowerCase(); + if (isElement$1(node) && dom.getContentEditable(node)) { + lastContentEditable = contentEditable; + contentEditable = dom.getContentEditable(node) === 'true'; + hasContentEditableState = true; } - }; - var applyNodeStyle = function (formatList, node) { - var found = false; - if (!isSelectorFormat(format)) { + if (isBr(node) && !canFormatBR(ed, format, node, parentName)) { + currentWrapElm = null; + if (isBlockFormat(format)) { + dom.remove(node); + } + return; + } + if (format.wrapper && matchNode(ed, node, name, vars)) { + currentWrapElm = null; + return; + } + if (contentEditable && !hasContentEditableState && isBlockFormat(format) && !format.wrapper && isTextBlock$1(ed, nodeName) && isValid(ed, parentName, wrapName)) { + var elm = dom.rename(node, wrapName); + setElementFormat(elm); + newWrappers.push(elm); + currentWrapElm = null; + return; + } + if (isSelectorFormat(format)) { + var found = applyNodeStyle(formatList, node); + if (!hasFormatProperty(format, 'inline') || found) { + currentWrapElm = null; + return; + } + } + if (contentEditable && !hasContentEditableState && isValid(ed, wrapName, nodeName) && isValid(ed, parentName, wrapName) && !(!nodeSpecific && node.nodeType === 3 && node.nodeValue.length === 1 && node.nodeValue.charCodeAt(0) === 65279) && !isCaretNode(node) && (!hasFormatProperty(format, 'inline') || !dom.isBlock(node))) { + if (!currentWrapElm) { + currentWrapElm = dom.clone(wrapElm, false); + node.parentNode.insertBefore(currentWrapElm, node); + newWrappers.push(currentWrapElm); + } + currentWrapElm.appendChild(node); + } else { + currentWrapElm = null; + each$c(Tools.grep(node.childNodes), process); + if (hasContentEditableState) { + contentEditable = lastContentEditable; + } + currentWrapElm = null; + } + }; + each$c(nodes, process); + }); + if (format.links === true) { + each$c(newWrappers, function (node) { + var process = function (node) { + if (node.nodeName === 'A') { + setElementFormat(node, format); + } + each$c(Tools.grep(node.childNodes), process); + }; + process(node); + }); + } + each$c(newWrappers, function (node) { + var getChildCount = function (node) { + var count = 0; + each$c(node.childNodes, function (node) { + if (!isEmptyTextNode(node) && !isBookmarkNode$1(node)) { + count++; + } + }); + return count; + }; + var getChildElementNode = function (root) { + var child = false; + each$c(root.childNodes, function (node) { + if (isElementNode$1(node)) { + child = node; return false; - } - each$c(formatList, function (format) { - if ('collapsed' in format && format.collapsed !== isCollapsed) { - return; - } - if (dom.is(node, format.selector) && !isCaretNode(node)) { - setElementFormat(node, format); - found = true; - return false; - } - }); - return found; - }; - var applyRngStyle = function (dom, rng, bookmark, nodeSpecific) { - var newWrappers = []; - var contentEditable = true; - var wrapName = format.inline || format.block; - var wrapElm = dom.create(wrapName); - setElementFormat(wrapElm); - walk$1(dom, rng, function (nodes) { - var currentWrapElm; - var process = function (node) { - var hasContentEditableState = false; - var lastContentEditable = contentEditable; - var nodeName = node.nodeName.toLowerCase(); - var parentName = node.parentNode.nodeName.toLowerCase(); - if (isElement$1(node) && dom.getContentEditable(node)) { - lastContentEditable = contentEditable; - contentEditable = dom.getContentEditable(node) === 'true'; - hasContentEditableState = true; - } - if (isBr(node) && !canFormatBR(ed, format, node, parentName)) { - currentWrapElm = null; - if (isBlockFormat(format)) { - dom.remove(node); - } - return; - } - if (format.wrapper && matchNode(ed, node, name, vars)) { - currentWrapElm = null; - return; - } - if (contentEditable && !hasContentEditableState && isBlockFormat(format) && !format.wrapper && isTextBlock$1(ed, nodeName) && isValid(ed, parentName, wrapName)) { - var elm = dom.rename(node, wrapName); - setElementFormat(elm); - newWrappers.push(elm); - currentWrapElm = null; - return; - } - if (isSelectorFormat(format)) { - var found = applyNodeStyle(formatList, node); - if (!hasFormatProperty(format, 'inline') || found) { - currentWrapElm = null; - return; - } - } - if (contentEditable && !hasContentEditableState && isValid(ed, wrapName, nodeName) && isValid(ed, parentName, wrapName) && !(!nodeSpecific && node.nodeType === 3 && node.nodeValue.length === 1 && node.nodeValue.charCodeAt(0) === 65279) && !isCaretNode(node) && (!hasFormatProperty(format, 'inline') || !dom.isBlock(node))) { - if (!currentWrapElm) { - currentWrapElm = dom.clone(wrapElm, false); - node.parentNode.insertBefore(currentWrapElm, node); - newWrappers.push(currentWrapElm); - } - currentWrapElm.appendChild(node); - } else { - currentWrapElm = null; - each$c(Tools.grep(node.childNodes), process); - if (hasContentEditableState) { - contentEditable = lastContentEditable; - } - currentWrapElm = null; - } - }; - each$c(nodes, process); - }); - if (format.links === true) { - each$c(newWrappers, function (node) { - var process = function (node) { - if (node.nodeName === 'A') { - setElementFormat(node, format); - } - each$c(Tools.grep(node.childNodes), process); - }; - process(node); - }); - } - each$c(newWrappers, function (node) { - var getChildCount = function (node) { - var count = 0; - each$c(node.childNodes, function (node) { - if (!isEmptyTextNode(node) && !isBookmarkNode$1(node)) { - count++; - } - }); - return count; - }; - var getChildElementNode = function (root) { - var child = false; - each$c(root.childNodes, function (node) { - if (isElementNode$1(node)) { - child = node; - return false; - } - }); - return child; - }; - var mergeStyles = function (node) { - var clone; - var child = getChildElementNode(node); - if (child && !isBookmarkNode$1(child) && matchName(dom, child, format)) { - clone = dom.clone(child, false); - setElementFormat(clone); - dom.replace(clone, node, true); - dom.remove(child, true); - } - return clone || node; - }; - var childCount = getChildCount(node); - if ((newWrappers.length > 1 || !dom.isBlock(node)) && childCount === 0) { - dom.remove(node, true); - return; - } - if (isInlineFormat(format) || format.wrapper) { - if (!format.exact && childCount === 1) { - node = mergeStyles(node); - } - mergeWithChildren(ed, formatList, vars, node); - mergeWithParents(ed, format, name, vars, node); - mergeBackgroundColorAndFontSize(dom, format, vars, node); - mergeTextDecorationsAndColor(dom, format, vars, node); - mergeSubSup(dom, format, vars, node); - mergeSiblings(dom, format, vars, node); - } - }); - }; - if (dom.getContentEditable(selection.getNode()) === 'false') { - node = selection.getNode(); - for (var i = 0, l = formatList.length; i < l; i++) { - var formatItem = formatList[i]; - if (formatItem.ceFalseOverride && isSelectorFormat(formatItem) && dom.is(node, formatItem.selector)) { - setElementFormat(node, formatItem); - return; - } - } + } + }); + return child; + }; + var mergeStyles = function (node) { + var clone; + var child = getChildElementNode(node); + if (child && !isBookmarkNode$1(child) && matchName(dom, child, format)) { + clone = dom.clone(child, false); + setElementFormat(clone); + dom.replace(clone, node, true); + dom.remove(child, true); + } + return clone || node; + }; + var childCount = getChildCount(node); + if ((newWrappers.length > 1 || !dom.isBlock(node)) && childCount === 0) { + dom.remove(node, true); + return; + } + if (isInlineFormat(format) || format.wrapper) { + if (!format.exact && childCount === 1) { + node = mergeStyles(node); + } + mergeWithChildren(ed, formatList, vars, node); + mergeWithParents(ed, format, name, vars, node); + mergeBackgroundColorAndFontSize(dom, format, vars, node); + mergeTextDecorationsAndColor(dom, format, vars, node); + mergeSubSup(dom, format, vars, node); + mergeSiblings(dom, format, vars, node); + } + }); + }; + if (dom.getContentEditable(selection.getNode()) === 'false') { + node = selection.getNode(); + for (var i = 0, l = formatList.length; i < l; i++) { + var formatItem = formatList[i]; + if (formatItem.ceFalseOverride && isSelectorFormat(formatItem) && dom.is(node, formatItem.selector)) { + setElementFormat(node, formatItem); return; + } } - if (format) { - if (node) { - if (isNode(node)) { - if (!applyNodeStyle(formatList, node)) { - var rng = dom.createRng(); - rng.setStartBefore(node); - rng.setEndAfter(node); - applyRngStyle(dom, expandRng(ed, rng, formatList), null, true); - } - } else { - applyRngStyle(dom, node, null, true); - } - } else { - if (!isCollapsed || !isInlineFormat(format) || getCellsFromEditor(ed).length) { - var curSelNode = selection.getNode(); - var firstFormat = formatList[0]; - if (!ed.settings.forced_root_block && firstFormat.defaultBlock && !dom.getParent(curSelNode, dom.isBlock)) { - applyFormat(ed, firstFormat.defaultBlock); - } - selection.setRng(normalize$2(selection.getRng())); - preserve(selection, true, function (bookmark) { - runOnRanges(ed, function (selectionRng, fake) { - var expandedRng = fake ? selectionRng : expandRng(ed, selectionRng, formatList); - applyRngStyle(dom, expandedRng); - }); - }); - moveStart(dom, selection, selection.getRng()); - ed.nodeChanged(); - } else { - applyCaretFormat(ed, name, vars); - } - } - postProcess(name, ed); + return; + } + if (format) { + if (node) { + if (isNode(node)) { + if (!applyNodeStyle(formatList, node)) { + var rng = dom.createRng(); + rng.setStartBefore(node); + rng.setEndAfter(node); + applyRngStyle(dom, expandRng(ed, rng, formatList), null, true); + } + } else { + applyRngStyle(dom, node, null, true); + } + } else { + if (!isCollapsed || !isInlineFormat(format) || getCellsFromEditor(ed).length) { + var curSelNode = selection.getNode(); + var firstFormat = formatList[0]; + if (!ed.settings.forced_root_block && firstFormat.defaultBlock && !dom.getParent(curSelNode, dom.isBlock)) { + applyFormat(ed, firstFormat.defaultBlock); + } + selection.setRng(normalize$2(selection.getRng())); + preserve(selection, true, function (bookmark) { + runOnRanges(ed, function (selectionRng, fake) { + var expandedRng = fake ? selectionRng : expandRng(ed, selectionRng, formatList); + applyRngStyle(dom, expandedRng); + }); + }); + moveStart(dom, selection, selection.getRng()); + ed.nodeChanged(); + } else { + applyCaretFormat(ed, name, vars); + } } + postProcess(name, ed); + } }; var setup$4 = function (registeredFormatListeners, editor) { - var currentFormats = Cell({}); - registeredFormatListeners.set({}); - editor.on('NodeChange', function (e) { - updateAndFireChangeCallbacks(editor, e.element, currentFormats, registeredFormatListeners.get()); - }); + var currentFormats = Cell({}); + registeredFormatListeners.set({}); + editor.on('NodeChange', function (e) { + updateAndFireChangeCallbacks(editor, e.element, currentFormats, registeredFormatListeners.get()); + }); }; var updateAndFireChangeCallbacks = function (editor, elm, currentFormats, formatChangeData) { - var formatsList = keys(currentFormats.get()); - var newFormats = {}; - var matchedFormats = {}; - var parents = filter(getParents$1(editor.dom, elm), function (node) { - return node.nodeType === 1 && !node.getAttribute('data-mce-bogus'); - }); - each$1(formatChangeData, function (data, format) { - Tools.each(parents, function (node) { - if (editor.formatter.matchNode(node, format, {}, data.similar)) { - if (formatsList.indexOf(format) === -1) { - each(data.callbacks, function (callback) { - callback(true, { - node: node, - format: format, - parents: parents - }); - }); - newFormats[format] = data.callbacks; - } - matchedFormats[format] = data.callbacks; - return false; - } - if (matchesUnInheritedFormatSelector(editor, node, format)) { - return false; - } - }); + var formatsList = keys(currentFormats.get()); + var newFormats = {}; + var matchedFormats = {}; + var parents = filter(getParents$1(editor.dom, elm), function (node) { + return node.nodeType === 1 && !node.getAttribute('data-mce-bogus'); + }); + each$1(formatChangeData, function (data, format) { + Tools.each(parents, function (node) { + if (editor.formatter.matchNode(node, format, {}, data.similar)) { + if (formatsList.indexOf(format) === -1) { + each(data.callbacks, function (callback) { + callback(true, { + node: node, + format: format, + parents: parents + }); + }); + newFormats[format] = data.callbacks; + } + matchedFormats[format] = data.callbacks; + return false; + } + if (matchesUnInheritedFormatSelector(editor, node, format)) { + return false; + } }); - var remainingFormats = filterRemainingFormats(currentFormats.get(), matchedFormats, elm, parents); - currentFormats.set(__assign(__assign({}, newFormats), remainingFormats)); + }); + var remainingFormats = filterRemainingFormats(currentFormats.get(), matchedFormats, elm, parents); + currentFormats.set(__assign(__assign({}, newFormats), remainingFormats)); }; var filterRemainingFormats = function (currentFormats, matchedFormats, elm, parents) { - return bifilter(currentFormats, function (callbacks, format) { - if (!has(matchedFormats, format)) { - each(callbacks, function (callback) { - callback(false, { - node: elm, - format: format, - parents: parents - }); - }); - return false; - } else { - return true; - } - }).t; + return bifilter(currentFormats, function (callbacks, format) { + if (!has(matchedFormats, format)) { + each(callbacks, function (callback) { + callback(false, { + node: elm, + format: format, + parents: parents + }); + }); + return false; + } else { + return true; + } + }).t; }; var addListeners = function (registeredFormatListeners, formats, callback, similar) { - var formatChangeItems = registeredFormatListeners.get(); - each(formats.split(','), function (format) { - if (!formatChangeItems[format]) { - formatChangeItems[format] = { - similar: similar, - callbacks: [] - }; - } - formatChangeItems[format].callbacks.push(callback); - }); - registeredFormatListeners.set(formatChangeItems); + var formatChangeItems = registeredFormatListeners.get(); + each(formats.split(','), function (format) { + if (!formatChangeItems[format]) { + formatChangeItems[format] = { + similar: similar, + callbacks: [] + }; + } + formatChangeItems[format].callbacks.push(callback); + }); + registeredFormatListeners.set(formatChangeItems); }; var removeListeners = function (registeredFormatListeners, formats, callback) { - var formatChangeItems = registeredFormatListeners.get(); - each(formats.split(','), function (format) { - formatChangeItems[format].callbacks = filter(formatChangeItems[format].callbacks, function (c) { - return c !== callback; - }); - if (formatChangeItems[format].callbacks.length === 0) { - delete formatChangeItems[format]; - } + var formatChangeItems = registeredFormatListeners.get(); + each(formats.split(','), function (format) { + formatChangeItems[format].callbacks = filter(formatChangeItems[format].callbacks, function (c) { + return c !== callback; }); - registeredFormatListeners.set(formatChangeItems); + if (formatChangeItems[format].callbacks.length === 0) { + delete formatChangeItems[format]; + } + }); + registeredFormatListeners.set(formatChangeItems); }; var formatChangedInternal = function (editor, registeredFormatListeners, formats, callback, similar) { - if (registeredFormatListeners.get() === null) { - setup$4(registeredFormatListeners, editor); + if (registeredFormatListeners.get() === null) { + setup$4(registeredFormatListeners, editor); + } + addListeners(registeredFormatListeners, formats, callback, similar); + return { + unbind: function () { + return removeListeners(registeredFormatListeners, formats, callback); } - addListeners(registeredFormatListeners, formats, callback, similar); - return { - unbind: function () { - return removeListeners(registeredFormatListeners, formats, callback); - } - }; + }; }; var toggle = function (editor, name, vars, node) { - var fmt = editor.formatter.get(name); - if (match(editor, name, vars, node) && (!('toggle' in fmt[0]) || fmt[0].toggle)) { - remove$6(editor, name, vars, node); - } else { - applyFormat(editor, name, vars, node); - } + var fmt = editor.formatter.get(name); + if (match(editor, name, vars, node) && (!('toggle' in fmt[0]) || fmt[0].toggle)) { + remove$6(editor, name, vars, node); + } else { + applyFormat(editor, name, vars, node); + } }; var fromElements = function (elements, scope) { - var doc = scope || document; - var fragment = doc.createDocumentFragment(); - each(elements, function (element) { - fragment.appendChild(element.dom); - }); - return SugarElement.fromDom(fragment); + var doc = scope || document; + var fragment = doc.createDocumentFragment(); + each(elements, function (element) { + fragment.appendChild(element.dom); + }); + return SugarElement.fromDom(fragment); }; var tableModel = function (element, width, rows) { - return { - element: element, - width: width, - rows: rows - }; + return { + element: element, + width: width, + rows: rows + }; }; var tableRow = function (element, cells) { - return { - element: element, - cells: cells - }; + return { + element: element, + cells: cells + }; }; var cellPosition = function (x, y) { - return { - x: x, - y: y - }; + return { + x: x, + y: y + }; }; var getSpan = function (td, key) { - var value = parseInt(get$4(td, key), 10); - return isNaN(value) ? 1 : value; + var value = parseInt(get$4(td, key), 10); + return isNaN(value) ? 1 : value; }; var fillout = function (table, x, y, tr, td) { - var rowspan = getSpan(td, 'rowspan'); - var colspan = getSpan(td, 'colspan'); - var rows = table.rows; - for (var y2 = y; y2 < y + rowspan; y2++) { - if (!rows[y2]) { - rows[y2] = tableRow(deep(tr), []); - } - for (var x2 = x; x2 < x + colspan; x2++) { - var cells = rows[y2].cells; - cells[x2] = y2 === y && x2 === x ? td : shallow(td); - } + var rowspan = getSpan(td, 'rowspan'); + var colspan = getSpan(td, 'colspan'); + var rows = table.rows; + for (var y2 = y; y2 < y + rowspan; y2++) { + if (!rows[y2]) { + rows[y2] = tableRow(deep(tr), []); } + for (var x2 = x; x2 < x + colspan; x2++) { + var cells = rows[y2].cells; + cells[x2] = y2 === y && x2 === x ? td : shallow(td); + } + } }; var cellExists = function (table, x, y) { - var rows = table.rows; - var cells = rows[y] ? rows[y].cells : []; - return !!cells[x]; + var rows = table.rows; + var cells = rows[y] ? rows[y].cells : []; + return !!cells[x]; }; var skipCellsX = function (table, x, y) { - while (cellExists(table, x, y)) { - x++; - } - return x; + while (cellExists(table, x, y)) { + x++; + } + return x; }; var getWidth = function (rows) { - return foldl(rows, function (acc, row) { - return row.cells.length > acc ? row.cells.length : acc; - }, 0); + return foldl(rows, function (acc, row) { + return row.cells.length > acc ? row.cells.length : acc; + }, 0); }; var findElementPos = function (table, element) { - var rows = table.rows; - for (var y = 0; y < rows.length; y++) { - var cells = rows[y].cells; - for (var x = 0; x < cells.length; x++) { - if (eq$2(cells[x], element)) { - return Optional.some(cellPosition(x, y)); - } - } + var rows = table.rows; + for (var y = 0; y < rows.length; y++) { + var cells = rows[y].cells; + for (var x = 0; x < cells.length; x++) { + if (eq$2(cells[x], element)) { + return Optional.some(cellPosition(x, y)); + } } - return Optional.none(); + } + return Optional.none(); }; var extractRows = function (table, sx, sy, ex, ey) { - var newRows = []; - var rows = table.rows; - for (var y = sy; y <= ey; y++) { - var cells = rows[y].cells; - var slice = sx < ex ? cells.slice(sx, ex + 1) : cells.slice(ex, sx + 1); - newRows.push(tableRow(rows[y].element, slice)); - } - return newRows; + var newRows = []; + var rows = table.rows; + for (var y = sy; y <= ey; y++) { + var cells = rows[y].cells; + var slice = sx < ex ? cells.slice(sx, ex + 1) : cells.slice(ex, sx + 1); + newRows.push(tableRow(rows[y].element, slice)); + } + return newRows; }; var subTable = function (table, startPos, endPos) { - var sx = startPos.x, sy = startPos.y; - var ex = endPos.x, ey = endPos.y; - var newRows = sy < ey ? extractRows(table, sx, sy, ex, ey) : extractRows(table, sx, ey, ex, sy); - return tableModel(table.element, getWidth(newRows), newRows); + var sx = startPos.x, sy = startPos.y; + var ex = endPos.x, ey = endPos.y; + var newRows = sy < ey ? extractRows(table, sx, sy, ex, ey) : extractRows(table, sx, ey, ex, sy); + return tableModel(table.element, getWidth(newRows), newRows); }; var createDomTable = function (table, rows) { - var tableElement = shallow(table.element); - var tableBody = SugarElement.fromTag('tbody'); - append$1(tableBody, rows); - append(tableElement, tableBody); - return tableElement; + var tableElement = shallow(table.element); + var tableBody = SugarElement.fromTag('tbody'); + append$1(tableBody, rows); + append(tableElement, tableBody); + return tableElement; }; var modelRowsToDomRows = function (table) { - return map(table.rows, function (row) { - var cells = map(row.cells, function (cell) { - var td = deep(cell); - remove$1(td, 'colspan'); - remove$1(td, 'rowspan'); - return td; - }); - var tr = shallow(row.element); - append$1(tr, cells); - return tr; - }); + return map(table.rows, function (row) { + var cells = map(row.cells, function (cell) { + var td = deep(cell); + remove$1(td, 'colspan'); + remove$1(td, 'rowspan'); + return td; + }); + var tr = shallow(row.element); + append$1(tr, cells); + return tr; + }); }; var fromDom$1 = function (tableElm) { - var table = tableModel(shallow(tableElm), 0, []); - each(descendants$1(tableElm, 'tr'), function (tr, y) { - each(descendants$1(tr, 'td,th'), function (td, x) { - fillout(table, skipCellsX(table, x, y), y, tr, td); - }); + var table = tableModel(shallow(tableElm), 0, []); + each(descendants$1(tableElm, 'tr'), function (tr, y) { + each(descendants$1(tr, 'td,th'), function (td, x) { + fillout(table, skipCellsX(table, x, y), y, tr, td); }); - return tableModel(table.element, getWidth(table.rows), table.rows); + }); + return tableModel(table.element, getWidth(table.rows), table.rows); }; var toDom = function (table) { - return createDomTable(table, modelRowsToDomRows(table)); + return createDomTable(table, modelRowsToDomRows(table)); }; var subsection = function (table, startElement, endElement) { - return findElementPos(table, startElement).bind(function (startPos) { - return findElementPos(table, endElement).map(function (endPos) { - return subTable(table, startPos, endPos); - }); + return findElementPos(table, startElement).bind(function (startPos) { + return findElementPos(table, endElement).map(function (endPos) { + return subTable(table, startPos, endPos); }); + }); }; var findParentListContainer = function (parents) { - return find(parents, function (elm) { - return name(elm) === 'ul' || name(elm) === 'ol'; - }); + return find(parents, function (elm) { + return name(elm) === 'ul' || name(elm) === 'ol'; + }); }; var getFullySelectedListWrappers = function (parents, rng) { - return find(parents, function (elm) { - return name(elm) === 'li' && hasAllContentsSelected(elm, rng); - }).fold(constant([]), function (_li) { - return findParentListContainer(parents).map(function (listCont) { - var listElm = SugarElement.fromTag(name(listCont)); - var listStyles = filter$1(getAllRaw(listCont), function (_style, name) { - return startsWith(name, 'list-style'); - }); - setAll$1(listElm, listStyles); - return [ - SugarElement.fromTag('li'), - listElm - ]; - }).getOr([]); - }); + return find(parents, function (elm) { + return name(elm) === 'li' && hasAllContentsSelected(elm, rng); + }).fold(constant([]), function (_li) { + return findParentListContainer(parents).map(function (listCont) { + var listElm = SugarElement.fromTag(name(listCont)); + var listStyles = filter$1(getAllRaw(listCont), function (_style, name) { + return startsWith(name, 'list-style'); + }); + setAll$1(listElm, listStyles); + return [ + SugarElement.fromTag('li'), + listElm + ]; + }).getOr([]); + }); }; var wrap$3 = function (innerElm, elms) { - var wrapped = foldl(elms, function (acc, elm) { - append(elm, acc); - return elm; - }, innerElm); - return elms.length > 0 ? fromElements([wrapped]) : wrapped; + var wrapped = foldl(elms, function (acc, elm) { + append(elm, acc); + return elm; + }, innerElm); + return elms.length > 0 ? fromElements([wrapped]) : wrapped; }; var directListWrappers = function (commonAnchorContainer) { - if (isListItem(commonAnchorContainer)) { - return parent(commonAnchorContainer).filter(isList).fold(constant([]), function (listElm) { - return [ - commonAnchorContainer, - listElm - ]; - }); - } else { - return isList(commonAnchorContainer) ? [commonAnchorContainer] : []; - } + if (isListItem(commonAnchorContainer)) { + return parent(commonAnchorContainer).filter(isList).fold(constant([]), function (listElm) { + return [ + commonAnchorContainer, + listElm + ]; + }); + } else { + return isList(commonAnchorContainer) ? [commonAnchorContainer] : []; + } }; var getWrapElements = function (rootNode, rng) { - var commonAnchorContainer = SugarElement.fromDom(rng.commonAncestorContainer); - var parents = parentsAndSelf(commonAnchorContainer, rootNode); - var wrapElements = filter(parents, function (elm) { - return isInline(elm) || isHeading(elm); - }); - var listWrappers = getFullySelectedListWrappers(parents, rng); - var allWrappers = wrapElements.concat(listWrappers.length ? listWrappers : directListWrappers(commonAnchorContainer)); - return map(allWrappers, shallow); + var commonAnchorContainer = SugarElement.fromDom(rng.commonAncestorContainer); + var parents = parentsAndSelf(commonAnchorContainer, rootNode); + var wrapElements = filter(parents, function (elm) { + return isInline(elm) || isHeading(elm); + }); + var listWrappers = getFullySelectedListWrappers(parents, rng); + var allWrappers = wrapElements.concat(listWrappers.length ? listWrappers : directListWrappers(commonAnchorContainer)); + return map(allWrappers, shallow); }; var emptyFragment = function () { - return fromElements([]); + return fromElements([]); }; var getFragmentFromRange = function (rootNode, rng) { - return wrap$3(SugarElement.fromDom(rng.cloneContents()), getWrapElements(rootNode, rng)); + return wrap$3(SugarElement.fromDom(rng.cloneContents()), getWrapElements(rootNode, rng)); }; var getParentTable = function (rootElm, cell) { - return ancestor$1(cell, 'table', curry(eq$2, rootElm)); + return ancestor$1(cell, 'table', curry(eq$2, rootElm)); }; var getTableFragment = function (rootNode, selectedTableCells) { - return getParentTable(rootNode, selectedTableCells[0]).bind(function (tableElm) { - var firstCell = selectedTableCells[0]; - var lastCell = selectedTableCells[selectedTableCells.length - 1]; - var fullTableModel = fromDom$1(tableElm); - return subsection(fullTableModel, firstCell, lastCell).map(function (sectionedTableModel) { - return fromElements([toDom(sectionedTableModel)]); - }); - }).getOrThunk(emptyFragment); + return getParentTable(rootNode, selectedTableCells[0]).bind(function (tableElm) { + var firstCell = selectedTableCells[0]; + var lastCell = selectedTableCells[selectedTableCells.length - 1]; + var fullTableModel = fromDom$1(tableElm); + return subsection(fullTableModel, firstCell, lastCell).map(function (sectionedTableModel) { + return fromElements([toDom(sectionedTableModel)]); + }); + }).getOrThunk(emptyFragment); }; var getSelectionFragment = function (rootNode, ranges) { - return ranges.length > 0 && ranges[0].collapsed ? emptyFragment() : getFragmentFromRange(rootNode, ranges[0]); + return ranges.length > 0 && ranges[0].collapsed ? emptyFragment() : getFragmentFromRange(rootNode, ranges[0]); }; var read$1 = function (rootNode, ranges) { - var selectedCells = getCellsFromElementOrRanges(ranges, rootNode); - return selectedCells.length > 0 ? getTableFragment(rootNode, selectedCells) : getSelectionFragment(rootNode, ranges); + var selectedCells = getCellsFromElementOrRanges(ranges, rootNode); + return selectedCells.length > 0 ? getTableFragment(rootNode, selectedCells) : getSelectionFragment(rootNode, ranges); }; var trimLeadingCollapsibleText = function (text) { - return text.replace(/^[ \f\n\r\t\v]+/, ''); + return text.replace(/^[ \f\n\r\t\v]+/, ''); }; var isCollapsibleWhitespace = function (text, index) { - return index >= 0 && index < text.length && isWhiteSpace$1(text.charAt(index)); + return index >= 0 && index < text.length && isWhiteSpace$1(text.charAt(index)); }; var getInnerText = function (bin, shouldTrim) { - var text = trim$2(bin.innerText); - return shouldTrim ? trimLeadingCollapsibleText(text) : text; + var text = trim$2(bin.innerText); + return shouldTrim ? trimLeadingCollapsibleText(text) : text; }; var getContextNodeName = function (parentBlockOpt) { - return parentBlockOpt.map(function (block) { - return block.nodeName; - }).getOr('div').toLowerCase(); + return parentBlockOpt.map(function (block) { + return block.nodeName; + }).getOr('div').toLowerCase(); }; var getTextContent = function (editor) { - return Optional.from(editor.selection.getRng()).map(function (rng) { - var parentBlockOpt = Optional.from(editor.dom.getParent(rng.commonAncestorContainer, editor.dom.isBlock)); - var body = editor.getBody(); - var contextNodeName = getContextNodeName(parentBlockOpt); - var shouldTrimSpaces = Env.browser.isIE() && contextNodeName !== 'pre'; - var bin = editor.dom.add(body, contextNodeName, { - 'data-mce-bogus': 'all', - 'style': 'overflow: hidden; opacity: 0;' - }, rng.cloneContents()); - var text = getInnerText(bin, shouldTrimSpaces); - var nonRenderedText = trim$2(bin.textContent); - editor.dom.remove(bin); - if (isCollapsibleWhitespace(nonRenderedText, 0) || isCollapsibleWhitespace(nonRenderedText, nonRenderedText.length - 1)) { - var parentBlock = parentBlockOpt.getOr(body); - var parentBlockText = getInnerText(parentBlock, shouldTrimSpaces); - var textIndex = parentBlockText.indexOf(text); - if (textIndex === -1) { - return text; - } else { - var hasProceedingSpace = isCollapsibleWhitespace(parentBlockText, textIndex - 1); - var hasTrailingSpace = isCollapsibleWhitespace(parentBlockText, textIndex + text.length); - return (hasProceedingSpace ? ' ' : '') + text + (hasTrailingSpace ? ' ' : ''); - } - } else { - return text; - } - }).getOr(''); + return Optional.from(editor.selection.getRng()).map(function (rng) { + var parentBlockOpt = Optional.from(editor.dom.getParent(rng.commonAncestorContainer, editor.dom.isBlock)); + var body = editor.getBody(); + var contextNodeName = getContextNodeName(parentBlockOpt); + var shouldTrimSpaces = Env.browser.isIE() && contextNodeName !== 'pre'; + var bin = editor.dom.add(body, contextNodeName, { + 'data-mce-bogus': 'all', + 'style': 'overflow: hidden; opacity: 0;' + }, rng.cloneContents()); + var text = getInnerText(bin, shouldTrimSpaces); + var nonRenderedText = trim$2(bin.textContent); + editor.dom.remove(bin); + if (isCollapsibleWhitespace(nonRenderedText, 0) || isCollapsibleWhitespace(nonRenderedText, nonRenderedText.length - 1)) { + var parentBlock = parentBlockOpt.getOr(body); + var parentBlockText = getInnerText(parentBlock, shouldTrimSpaces); + var textIndex = parentBlockText.indexOf(text); + if (textIndex === -1) { + return text; + } else { + var hasProceedingSpace = isCollapsibleWhitespace(parentBlockText, textIndex - 1); + var hasTrailingSpace = isCollapsibleWhitespace(parentBlockText, textIndex + text.length); + return (hasProceedingSpace ? ' ' : '') + text + (hasTrailingSpace ? ' ' : ''); + } + } else { + return text; + } + }).getOr(''); }; var getSerializedContent = function (editor, args) { - var rng = editor.selection.getRng(), tmpElm = editor.dom.create('body'); - var sel = editor.selection.getSel(); - var ranges = processRanges(editor, getRanges(sel)); - var fragment = args.contextual ? read$1(SugarElement.fromDom(editor.getBody()), ranges).dom : rng.cloneContents(); - if (fragment) { - tmpElm.appendChild(fragment); - } - return editor.selection.serializer.serialize(tmpElm, args); + var rng = editor.selection.getRng(), tmpElm = editor.dom.create('body'); + var sel = editor.selection.getSel(); + var ranges = processRanges(editor, getRanges(sel)); + var fragment = args.contextual ? read$1(SugarElement.fromDom(editor.getBody()), ranges).dom : rng.cloneContents(); + if (fragment) { + tmpElm.appendChild(fragment); + } + return editor.selection.serializer.serialize(tmpElm, args); }; var getSelectedContentInternal = function (editor, format, args) { - if (args === void 0) { - args = {}; - } - args.get = true; - args.format = format; - args.selection = true; - args = editor.fire('BeforeGetContent', args); - if (args.isDefaultPrevented()) { - editor.fire('GetContent', args); - return args.content; - } - if (args.format === 'text') { - return getTextContent(editor); + if (args === void 0) { + args = {}; + } + args.get = true; + args.format = format; + args.selection = true; + args = editor.fire('BeforeGetContent', args); + if (args.isDefaultPrevented()) { + editor.fire('GetContent', args); + return args.content; + } + if (args.format === 'text') { + return getTextContent(editor); + } else { + args.getInner = true; + var content = getSerializedContent(editor, args); + if (args.format === 'tree') { + return content; } else { - args.getInner = true; - var content = getSerializedContent(editor, args); - if (args.format === 'tree') { - return content; - } else { - args.content = editor.selection.isCollapsed() ? '' : content; - editor.fire('GetContent', args); - return args.content; - } + args.content = editor.selection.isCollapsed() ? '' : content; + editor.fire('GetContent', args); + return args.content; } + } }; var KEEP = 0, INSERT = 1, DELETE = 2; var diff = function (left, right) { - var size = left.length + right.length + 2; - var vDown = new Array(size); - var vUp = new Array(size); - var snake = function (start, end, diag) { - return { - start: start, - end: end, - diag: diag - }; - }; - var buildScript = function (start1, end1, start2, end2, script) { - var middle = getMiddleSnake(start1, end1, start2, end2); - if (middle === null || middle.start === end1 && middle.diag === end1 - end2 || middle.end === start1 && middle.diag === start1 - start2) { - var i = start1; - var j = start2; - while (i < end1 || j < end2) { - if (i < end1 && j < end2 && left[i] === right[j]) { - script.push([ - KEEP, - left[i] - ]); - ++i; - ++j; - } else { - if (end1 - start1 > end2 - start2) { - script.push([ - DELETE, - left[i] - ]); - ++i; - } else { - script.push([ - INSERT, - right[j] - ]); - ++j; - } - } - } + var size = left.length + right.length + 2; + var vDown = new Array(size); + var vUp = new Array(size); + var snake = function (start, end, diag) { + return { + start: start, + end: end, + diag: diag + }; + }; + var buildScript = function (start1, end1, start2, end2, script) { + var middle = getMiddleSnake(start1, end1, start2, end2); + if (middle === null || middle.start === end1 && middle.diag === end1 - end2 || middle.end === start1 && middle.diag === start1 - start2) { + var i = start1; + var j = start2; + while (i < end1 || j < end2) { + if (i < end1 && j < end2 && left[i] === right[j]) { + script.push([ + KEEP, + left[i] + ]); + ++i; + ++j; } else { - buildScript(start1, middle.start, start2, middle.start - middle.diag, script); - for (var i2 = middle.start; i2 < middle.end; ++i2) { - script.push([ - KEEP, - left[i2] - ]); - } - buildScript(middle.end, end1, middle.end - middle.diag, end2, script); + if (end1 - start1 > end2 - start2) { + script.push([ + DELETE, + left[i] + ]); + ++i; + } else { + script.push([ + INSERT, + right[j] + ]); + ++j; + } } - }; - var buildSnake = function (start, diag, end1, end2) { - var end = start; - while (end - diag < end2 && end < end1 && left[end] === right[end - diag]) { - ++end; + } + } else { + buildScript(start1, middle.start, start2, middle.start - middle.diag, script); + for (var i2 = middle.start; i2 < middle.end; ++i2) { + script.push([ + KEEP, + left[i2] + ]); + } + buildScript(middle.end, end1, middle.end - middle.diag, end2, script); + } + }; + var buildSnake = function (start, diag, end1, end2) { + var end = start; + while (end - diag < end2 && end < end1 && left[end] === right[end - diag]) { + ++end; + } + return snake(start, end, diag); + }; + var getMiddleSnake = function (start1, end1, start2, end2) { + var m = end1 - start1; + var n = end2 - start2; + if (m === 0 || n === 0) { + return null; + } + var delta = m - n; + var sum = n + m; + var offset = (sum % 2 === 0 ? sum : sum + 1) / 2; + vDown[1 + offset] = start1; + vUp[1 + offset] = end1 + 1; + var d, k, i, x, y; + for (d = 0; d <= offset; ++d) { + for (k = -d; k <= d; k += 2) { + i = k + offset; + if (k === -d || k !== d && vDown[i - 1] < vDown[i + 1]) { + vDown[i] = vDown[i + 1]; + } else { + vDown[i] = vDown[i - 1] + 1; + } + x = vDown[i]; + y = x - start1 + start2 - k; + while (x < end1 && y < end2 && left[x] === right[y]) { + vDown[i] = ++x; + ++y; + } + if (delta % 2 !== 0 && delta - d <= k && k <= delta + d) { + if (vUp[i - delta] <= vDown[i]) { + return buildSnake(vUp[i - delta], k + start1 - start2, end1, end2); + } + } + } + for (k = delta - d; k <= delta + d; k += 2) { + i = k + offset - delta; + if (k === delta - d || k !== delta + d && vUp[i + 1] <= vUp[i - 1]) { + vUp[i] = vUp[i + 1] - 1; + } else { + vUp[i] = vUp[i - 1]; } - return snake(start, end, diag); - }; - var getMiddleSnake = function (start1, end1, start2, end2) { - var m = end1 - start1; - var n = end2 - start2; - if (m === 0 || n === 0) { - return null; - } - var delta = m - n; - var sum = n + m; - var offset = (sum % 2 === 0 ? sum : sum + 1) / 2; - vDown[1 + offset] = start1; - vUp[1 + offset] = end1 + 1; - var d, k, i, x, y; - for (d = 0; d <= offset; ++d) { - for (k = -d; k <= d; k += 2) { - i = k + offset; - if (k === -d || k !== d && vDown[i - 1] < vDown[i + 1]) { - vDown[i] = vDown[i + 1]; - } else { - vDown[i] = vDown[i - 1] + 1; - } - x = vDown[i]; - y = x - start1 + start2 - k; - while (x < end1 && y < end2 && left[x] === right[y]) { - vDown[i] = ++x; - ++y; - } - if (delta % 2 !== 0 && delta - d <= k && k <= delta + d) { - if (vUp[i - delta] <= vDown[i]) { - return buildSnake(vUp[i - delta], k + start1 - start2, end1, end2); - } - } - } - for (k = delta - d; k <= delta + d; k += 2) { - i = k + offset - delta; - if (k === delta - d || k !== delta + d && vUp[i + 1] <= vUp[i - 1]) { - vUp[i] = vUp[i + 1] - 1; - } else { - vUp[i] = vUp[i - 1]; - } - x = vUp[i] - 1; - y = x - start1 + start2 - k; - while (x >= start1 && y >= start2 && left[x] === right[y]) { - vUp[i] = x--; - y--; - } - if (delta % 2 === 0 && -d <= k && k <= d) { - if (vUp[i] <= vDown[i + delta]) { - return buildSnake(vUp[i], k + start1 - start2, end1, end2); - } - } - } + x = vUp[i] - 1; + y = x - start1 + start2 - k; + while (x >= start1 && y >= start2 && left[x] === right[y]) { + vUp[i] = x--; + y--; } - }; - var script = []; - buildScript(0, left.length, 0, right.length, script); - return script; + if (delta % 2 === 0 && -d <= k && k <= d) { + if (vUp[i] <= vDown[i + delta]) { + return buildSnake(vUp[i], k + start1 - start2, end1, end2); + } + } + } + } + }; + var script = []; + buildScript(0, left.length, 0, right.length, script); + return script; }; var getOuterHtml = function (elm) { - if (isElement$1(elm)) { - return elm.outerHTML; - } else if (isText$1(elm)) { - return Entities.encodeRaw(elm.data, false); - } else if (isComment$1(elm)) { - return ''; - } - return ''; + if (isElement$1(elm)) { + return elm.outerHTML; + } else if (isText$1(elm)) { + return Entities.encodeRaw(elm.data, false); + } else if (isComment$1(elm)) { + return ''; + } + return ''; }; var createFragment$1 = function (html) { - var node; - var container = document.createElement('div'); - var frag = document.createDocumentFragment(); - if (html) { - container.innerHTML = html; - } - while (node = container.firstChild) { - frag.appendChild(node); - } - return frag; + var node; + var container = document.createElement('div'); + var frag = document.createDocumentFragment(); + if (html) { + container.innerHTML = html; + } + while (node = container.firstChild) { + frag.appendChild(node); + } + return frag; }; var insertAt = function (elm, html, index) { - var fragment = createFragment$1(html); - if (elm.hasChildNodes() && index < elm.childNodes.length) { - var target = elm.childNodes[index]; - target.parentNode.insertBefore(fragment, target); - } else { - elm.appendChild(fragment); - } + var fragment = createFragment$1(html); + if (elm.hasChildNodes() && index < elm.childNodes.length) { + var target = elm.childNodes[index]; + target.parentNode.insertBefore(fragment, target); + } else { + elm.appendChild(fragment); + } }; var removeAt = function (elm, index) { - if (elm.hasChildNodes() && index < elm.childNodes.length) { - var target = elm.childNodes[index]; - target.parentNode.removeChild(target); - } + if (elm.hasChildNodes() && index < elm.childNodes.length) { + var target = elm.childNodes[index]; + target.parentNode.removeChild(target); + } }; var applyDiff = function (diff, elm) { - var index = 0; - each(diff, function (action) { - if (action[0] === KEEP) { - index++; - } else if (action[0] === INSERT) { - insertAt(elm, action[1], index); - index++; - } else if (action[0] === DELETE) { - removeAt(elm, index); - } - }); + var index = 0; + each(diff, function (action) { + if (action[0] === KEEP) { + index++; + } else if (action[0] === INSERT) { + insertAt(elm, action[1], index); + index++; + } else if (action[0] === DELETE) { + removeAt(elm, index); + } + }); }; var read$2 = function (elm) { - return filter(map(from$1(elm.childNodes), getOuterHtml), function (item) { - return item.length > 0; - }); + return filter(map(from$1(elm.childNodes), getOuterHtml), function (item) { + return item.length > 0; + }); }; var write = function (fragments, elm) { - var currentFragments = map(from$1(elm.childNodes), getOuterHtml); - applyDiff(diff(currentFragments, fragments), elm); - return elm; + var currentFragments = map(from$1(elm.childNodes), getOuterHtml); + applyDiff(diff(currentFragments, fragments), elm); + return elm; }; var undoLevelDocument = Cell(Optional.none()); var lazyTempDocument = function () { - return undoLevelDocument.get().getOrThunk(function () { - var doc = document.implementation.createHTMLDocument('undo'); - undoLevelDocument.set(Optional.some(doc)); - return doc; - }); + return undoLevelDocument.get().getOrThunk(function () { + var doc = document.implementation.createHTMLDocument('undo'); + undoLevelDocument.set(Optional.some(doc)); + return doc; + }); }; var hasIframes = function (html) { - return html.indexOf('') !== -1; + return html.indexOf('') !== -1; }; var createFragmentedLevel = function (fragments) { - return { - type: 'fragmented', - fragments: fragments, - content: '', - bookmark: null, - beforeBookmark: null - }; + return { + type: 'fragmented', + fragments: fragments, + content: '', + bookmark: null, + beforeBookmark: null + }; }; var createCompleteLevel = function (content) { - return { - type: 'complete', - fragments: null, - content: content, - bookmark: null, - beforeBookmark: null - }; + return { + type: 'complete', + fragments: null, + content: content, + bookmark: null, + beforeBookmark: null + }; }; var createFromEditor = function (editor) { - var fragments = read$2(editor.getBody()); - var trimmedFragments = bind(fragments, function (html) { - var trimmed = trimInternal(editor.serializer, html); - return trimmed.length > 0 ? [trimmed] : []; - }); - var content = trimmedFragments.join(''); - return hasIframes(content) ? createFragmentedLevel(trimmedFragments) : createCompleteLevel(content); + var fragments = read$2(editor.getBody()); + var trimmedFragments = bind(fragments, function (html) { + var trimmed = trimInternal(editor.serializer, html); + return trimmed.length > 0 ? [trimmed] : []; + }); + var content = trimmedFragments.join(''); + return hasIframes(content) ? createFragmentedLevel(trimmedFragments) : createCompleteLevel(content); }; var applyToEditor = function (editor, level, before) { - if (level.type === 'fragmented') { - write(level.fragments, editor.getBody()); - } else { - editor.setContent(level.content, {format: 'raw'}); - } - editor.selection.moveToBookmark(before ? level.beforeBookmark : level.bookmark); + if (level.type === 'fragmented') { + write(level.fragments, editor.getBody()); + } else { + editor.setContent(level.content, { format: 'raw' }); + } + editor.selection.moveToBookmark(before ? level.beforeBookmark : level.bookmark); }; var getLevelContent = function (level) { - return level.type === 'fragmented' ? level.fragments.join('') : level.content; + return level.type === 'fragmented' ? level.fragments.join('') : level.content; }; var getCleanLevelContent = function (level) { - var elm = SugarElement.fromTag('body', lazyTempDocument()); - set$1(elm, getLevelContent(level)); - each(descendants$1(elm, '*[data-mce-bogus]'), unwrap); - return get$7(elm); + var elm = SugarElement.fromTag('body', lazyTempDocument()); + set$1(elm, getLevelContent(level)); + each(descendants$1(elm, '*[data-mce-bogus]'), unwrap); + return get$7(elm); }; var hasEqualContent = function (level1, level2) { - return getLevelContent(level1) === getLevelContent(level2); + return getLevelContent(level1) === getLevelContent(level2); }; var hasEqualCleanedContent = function (level1, level2) { - return getCleanLevelContent(level1) === getCleanLevelContent(level2); + return getCleanLevelContent(level1) === getCleanLevelContent(level2); }; var isEq$4 = function (level1, level2) { - if (!level1 || !level2) { - return false; - } else if (hasEqualContent(level1, level2)) { - return true; - } else { - return hasEqualCleanedContent(level1, level2); - } + if (!level1 || !level2) { + return false; + } else if (hasEqualContent(level1, level2)) { + return true; + } else { + return hasEqualCleanedContent(level1, level2); + } }; var isUnlocked = function (locks) { - return locks.get() === 0; + return locks.get() === 0; }; var setTyping = function (undoManager, typing, locks) { - if (isUnlocked(locks)) { - undoManager.typing = typing; - } + if (isUnlocked(locks)) { + undoManager.typing = typing; + } }; var endTyping = function (undoManager, locks) { - if (undoManager.typing) { - setTyping(undoManager, false, locks); - undoManager.add(); - } + if (undoManager.typing) { + setTyping(undoManager, false, locks); + undoManager.add(); + } }; var endTypingLevelIgnoreLocks = function (undoManager) { - if (undoManager.typing) { - undoManager.typing = false; - undoManager.add(); - } + if (undoManager.typing) { + undoManager.typing = false; + undoManager.add(); + } }; var beforeChange = function (editor, locks, beforeBookmark) { - if (isUnlocked(locks)) { - beforeBookmark.set(Optional.some(getUndoBookmark(editor.selection))); - } + if (isUnlocked(locks)) { + beforeBookmark.set(Optional.some(getUndoBookmark(editor.selection))); + } }; var addUndoLevel = function (editor, undoManager, index, locks, beforeBookmark, level, event) { - var currentLevel = createFromEditor(editor); - level = level || {}; - level = Tools.extend(level, currentLevel); - if (isUnlocked(locks) === false || editor.removed) { - return null; - } - var lastLevel = undoManager.data[index.get()]; - if (editor.fire('BeforeAddUndo', { - level: level, - lastLevel: lastLevel, - originalEvent: event + var currentLevel = createFromEditor(editor); + level = level || {}; + level = Tools.extend(level, currentLevel); + if (isUnlocked(locks) === false || editor.removed) { + return null; + } + var lastLevel = undoManager.data[index.get()]; + if (editor.fire('BeforeAddUndo', { + level: level, + lastLevel: lastLevel, + originalEvent: event }).isDefaultPrevented()) { - return null; - } - if (lastLevel && isEq$4(lastLevel, level)) { - return null; - } - if (undoManager.data[index.get()]) { - beforeBookmark.get().each(function (bm) { - undoManager.data[index.get()].beforeBookmark = bm; - }); - } - var customUndoRedoLevels = getCustomUndoRedoLevels(editor); - if (customUndoRedoLevels) { - if (undoManager.data.length > customUndoRedoLevels) { - for (var i = 0; i < undoManager.data.length - 1; i++) { - undoManager.data[i] = undoManager.data[i + 1]; - } - undoManager.data.length--; - index.set(undoManager.data.length); - } - } - level.bookmark = getUndoBookmark(editor.selection); - if (index.get() < undoManager.data.length - 1) { - undoManager.data.length = index.get() + 1; - } - undoManager.data.push(level); - index.set(undoManager.data.length - 1); - var args = { - level: level, - lastLevel: lastLevel, - originalEvent: event - }; - if (index.get() > 0) { - editor.setDirty(true); - editor.fire('AddUndo', args); - editor.fire('change', args); - } else { - editor.fire('AddUndo', args); - } - return level; + return null; + } + if (lastLevel && isEq$4(lastLevel, level)) { + return null; + } + if (undoManager.data[index.get()]) { + beforeBookmark.get().each(function (bm) { + undoManager.data[index.get()].beforeBookmark = bm; + }); + } + var customUndoRedoLevels = getCustomUndoRedoLevels(editor); + if (customUndoRedoLevels) { + if (undoManager.data.length > customUndoRedoLevels) { + for (var i = 0; i < undoManager.data.length - 1; i++) { + undoManager.data[i] = undoManager.data[i + 1]; + } + undoManager.data.length--; + index.set(undoManager.data.length); + } + } + level.bookmark = getUndoBookmark(editor.selection); + if (index.get() < undoManager.data.length - 1) { + undoManager.data.length = index.get() + 1; + } + undoManager.data.push(level); + index.set(undoManager.data.length - 1); + var args = { + level: level, + lastLevel: lastLevel, + originalEvent: event + }; + if (index.get() > 0) { + editor.setDirty(true); + editor.fire('AddUndo', args); + editor.fire('change', args); + } else { + editor.fire('AddUndo', args); + } + return level; }; var clear = function (editor, undoManager, index) { - undoManager.data = []; - index.set(0); - undoManager.typing = false; - editor.fire('ClearUndos'); + undoManager.data = []; + index.set(0); + undoManager.typing = false; + editor.fire('ClearUndos'); }; var extra = function (editor, undoManager, index, callback1, callback2) { - if (undoManager.transact(callback1)) { - var bookmark = undoManager.data[index.get()].bookmark; - var lastLevel = undoManager.data[index.get() - 1]; - applyToEditor(editor, lastLevel, true); - if (undoManager.transact(callback2)) { - undoManager.data[index.get() - 1].beforeBookmark = bookmark; - } + if (undoManager.transact(callback1)) { + var bookmark = undoManager.data[index.get()].bookmark; + var lastLevel = undoManager.data[index.get() - 1]; + applyToEditor(editor, lastLevel, true); + if (undoManager.transact(callback2)) { + undoManager.data[index.get() - 1].beforeBookmark = bookmark; } + } }; var redo = function (editor, index, data) { - var level; - if (index.get() < data.length - 1) { - index.set(index.get() + 1); - level = data[index.get()]; - applyToEditor(editor, level, false); - editor.setDirty(true); - editor.fire('Redo', {level: level}); - } - return level; + var level; + if (index.get() < data.length - 1) { + index.set(index.get() + 1); + level = data[index.get()]; + applyToEditor(editor, level, false); + editor.setDirty(true); + editor.fire('Redo', { level: level }); + } + return level; }; var undo = function (editor, undoManager, locks, index) { - var level; - if (undoManager.typing) { - undoManager.add(); - undoManager.typing = false; - setTyping(undoManager, false, locks); - } - if (index.get() > 0) { - index.set(index.get() - 1); - level = undoManager.data[index.get()]; - applyToEditor(editor, level, true); - editor.setDirty(true); - editor.fire('Undo', {level: level}); - } - return level; + var level; + if (undoManager.typing) { + undoManager.add(); + undoManager.typing = false; + setTyping(undoManager, false, locks); + } + if (index.get() > 0) { + index.set(index.get() - 1); + level = undoManager.data[index.get()]; + applyToEditor(editor, level, true); + editor.setDirty(true); + editor.fire('Undo', { level: level }); + } + return level; }; var reset = function (undoManager) { - undoManager.clear(); - undoManager.add(); + undoManager.clear(); + undoManager.add(); }; var hasUndo = function (editor, undoManager, index) { - return index.get() > 0 || undoManager.typing && undoManager.data[0] && !isEq$4(createFromEditor(editor), undoManager.data[0]); + return index.get() > 0 || undoManager.typing && undoManager.data[0] && !isEq$4(createFromEditor(editor), undoManager.data[0]); }; var hasRedo = function (undoManager, index) { - return index.get() < undoManager.data.length - 1 && !undoManager.typing; + return index.get() < undoManager.data.length - 1 && !undoManager.typing; }; var transact = function (undoManager, locks, callback) { - endTyping(undoManager, locks); - undoManager.beforeChange(); - undoManager.ignore(callback); - return undoManager.add(); + endTyping(undoManager, locks); + undoManager.beforeChange(); + undoManager.ignore(callback); + return undoManager.add(); }; var ignore = function (locks, callback) { - try { - locks.set(locks.get() + 1); - callback(); - } finally { - locks.set(locks.get() - 1); - } + try { + locks.set(locks.get() + 1); + callback(); + } finally { + locks.set(locks.get() - 1); + } }; var isTreeNode$1 = function (content) { - return content instanceof AstNode; + return content instanceof AstNode; }; var runSerializerFiltersOnFragment = function (editor, fragment) { - filter$3(editor.serializer.getNodeFilters(), editor.serializer.getAttributeFilters(), fragment); + filter$3(editor.serializer.getNodeFilters(), editor.serializer.getAttributeFilters(), fragment); }; var getInsertContext = function (editor) { - return Optional.from(editor.selection.getStart(true)).map(function (elm) { - return elm.nodeName.toLowerCase(); - }); + return Optional.from(editor.selection.getStart(true)).map(function (elm) { + return elm.nodeName.toLowerCase(); + }); }; var createDummyUndoLevel = function () { - return { - type: 'complete', - fragments: [], - content: '', - bookmark: null, - beforeBookmark: null - }; + return { + type: 'complete', + fragments: [], + content: '', + bookmark: null, + beforeBookmark: null + }; }; var makePlainAdaptor = function (editor) { - return { - undoManager: { - beforeChange: function (locks, beforeBookmark) { - return beforeChange(editor, locks, beforeBookmark); - }, - addUndoLevel: function (undoManager, index, locks, beforeBookmark, level, event) { - return addUndoLevel(editor, undoManager, index, locks, beforeBookmark, level, event); - }, - undo: function (undoManager, locks, index) { - return undo(editor, undoManager, locks, index); - }, - redo: function (index, data) { - return redo(editor, index, data); - }, - clear: function (undoManager, index) { - return clear(editor, undoManager, index); - }, - reset: function (undoManager) { - return reset(undoManager); - }, - hasUndo: function (undoManager, index) { - return hasUndo(editor, undoManager, index); - }, - hasRedo: function (undoManager, index) { - return hasRedo(undoManager, index); - }, - transact: function (undoManager, locks, callback) { - return transact(undoManager, locks, callback); - }, - ignore: function (locks, callback) { - return ignore(locks, callback); - }, - extra: function (undoManager, index, callback1, callback2) { - return extra(editor, undoManager, index, callback1, callback2); - } - }, - formatter: { - match: function (name, vars, node) { - return match(editor, name, vars, node); - }, - matchAll: function (names, vars) { - return matchAll(editor, names, vars); - }, - matchNode: function (node, name, vars, similar) { - return matchNode(editor, node, name, vars, similar); - }, - canApply: function (name) { - return canApply(editor, name); - }, - closest: function (names) { - return closest$3(editor, names); - }, - apply: function (name, vars, node) { - return applyFormat(editor, name, vars, node); - }, - remove: function (name, vars, node, similar) { - return remove$6(editor, name, vars, node, similar); - }, - toggle: function (name, vars, node) { - return toggle(editor, name, vars, node); - }, - formatChanged: function (registeredFormatListeners, formats, callback, similar) { - return formatChangedInternal(editor, registeredFormatListeners, formats, callback, similar); - } - }, - editor: { - getContent: function (args, format) { - return getContentInternal(editor, args, format); - }, - setContent: function (content, args) { - return setContentInternal(editor, content, args); - }, - insertContent: function (value, details) { - return insertHtmlAtCaret(editor, value, details); - }, - addVisual: function (elm) { - return addVisualInternal(editor, elm); - } - }, - selection: { - getContent: function (format, args) { - return getSelectedContentInternal(editor, format, args); - } - }, - raw: { - getModel: function () { - return Optional.none(); - } - } - }; + return { + undoManager: { + beforeChange: function (locks, beforeBookmark) { + return beforeChange(editor, locks, beforeBookmark); + }, + addUndoLevel: function (undoManager, index, locks, beforeBookmark, level, event) { + return addUndoLevel(editor, undoManager, index, locks, beforeBookmark, level, event); + }, + undo: function (undoManager, locks, index) { + return undo(editor, undoManager, locks, index); + }, + redo: function (index, data) { + return redo(editor, index, data); + }, + clear: function (undoManager, index) { + return clear(editor, undoManager, index); + }, + reset: function (undoManager) { + return reset(undoManager); + }, + hasUndo: function (undoManager, index) { + return hasUndo(editor, undoManager, index); + }, + hasRedo: function (undoManager, index) { + return hasRedo(undoManager, index); + }, + transact: function (undoManager, locks, callback) { + return transact(undoManager, locks, callback); + }, + ignore: function (locks, callback) { + return ignore(locks, callback); + }, + extra: function (undoManager, index, callback1, callback2) { + return extra(editor, undoManager, index, callback1, callback2); + } + }, + formatter: { + match: function (name, vars, node) { + return match(editor, name, vars, node); + }, + matchAll: function (names, vars) { + return matchAll(editor, names, vars); + }, + matchNode: function (node, name, vars, similar) { + return matchNode(editor, node, name, vars, similar); + }, + canApply: function (name) { + return canApply(editor, name); + }, + closest: function (names) { + return closest$3(editor, names); + }, + apply: function (name, vars, node) { + return applyFormat(editor, name, vars, node); + }, + remove: function (name, vars, node, similar) { + return remove$6(editor, name, vars, node, similar); + }, + toggle: function (name, vars, node) { + return toggle(editor, name, vars, node); + }, + formatChanged: function (registeredFormatListeners, formats, callback, similar) { + return formatChangedInternal(editor, registeredFormatListeners, formats, callback, similar); + } + }, + editor: { + getContent: function (args, format) { + return getContentInternal(editor, args, format); + }, + setContent: function (content, args) { + return setContentInternal(editor, content, args); + }, + insertContent: function (value, details) { + return insertHtmlAtCaret(editor, value, details); + }, + addVisual: function (elm) { + return addVisualInternal(editor, elm); + } + }, + selection: { + getContent: function (format, args) { + return getSelectedContentInternal(editor, format, args); + } + }, + raw: { + getModel: function () { + return Optional.none(); + } + } + }; }; var makeRtcAdaptor = function (tinymceEditor, rtcEditor) { - var defaultVars = function (vars) { - return isObject(vars) ? vars : {}; - }; - var unsupported = die('Unimplemented feature for rtc'); - var ignore = noop; - return { - undoManager: { - beforeChange: ignore, - addUndoLevel: unsupported, - undo: function () { - rtcEditor.undo(); - return createDummyUndoLevel(); - }, - redo: function () { - rtcEditor.redo(); - return createDummyUndoLevel(); - }, - clear: unsupported, - reset: unsupported, - hasUndo: function () { - return rtcEditor.hasUndo(); - }, - hasRedo: function () { - return rtcEditor.hasRedo(); - }, - transact: function (_undoManager, _locks, fn) { - rtcEditor.transact(fn); - return createDummyUndoLevel(); - }, - ignore: unsupported, - extra: unsupported - }, - formatter: { - match: function (name, vars, _node) { - return rtcEditor.matchFormat(name, defaultVars(vars)); - }, - matchAll: unsupported, - matchNode: unsupported, - canApply: function (name) { - return rtcEditor.canApplyFormat(name); - }, - closest: function (names) { - return rtcEditor.closestFormat(names); - }, - apply: function (name, vars, _node) { - return rtcEditor.applyFormat(name, defaultVars(vars)); - }, - remove: function (name, vars, _node, _similar) { - return rtcEditor.removeFormat(name, defaultVars(vars)); - }, - toggle: function (name, vars, _node) { - return rtcEditor.toggleFormat(name, defaultVars(vars)); - }, - formatChanged: function (_rfl, formats, callback, similar) { - return rtcEditor.formatChanged(formats, callback, similar); - } - }, - editor: { - getContent: function (args, format) { - if (format === 'html' || format === 'tree') { - var fragment = rtcEditor.getContent(); - var serializer = HtmlSerializer({inner: true}); - runSerializerFiltersOnFragment(tinymceEditor, fragment); - return format === 'tree' ? fragment : serializer.serialize(fragment); - } else { - return makePlainAdaptor(tinymceEditor).editor.getContent(args, format); - } - }, - setContent: function (content, _args) { - var fragment = isTreeNode$1(content) ? content : tinymceEditor.parser.parse(content, { - isRootContent: true, - insert: true - }); - rtcEditor.setContent(fragment); - return content; - }, - insertContent: function (value, _details) { - var contextArgs = getInsertContext(tinymceEditor).fold(function () { - return {}; - }, function (context) { - return {context: context}; - }); - var fragment = isTreeNode$1(value) ? value : tinymceEditor.parser.parse(value, __assign(__assign({}, contextArgs), {insert: true})); - rtcEditor.insertContent(fragment); - }, - addVisual: function (_elm) { - } - }, - selection: { - getContent: function (format, args) { - if (format === 'html' || format === 'tree') { - var fragment = rtcEditor.getSelectedContent(); - var serializer = HtmlSerializer({}); - runSerializerFiltersOnFragment(tinymceEditor, fragment); - return format === 'tree' ? fragment : serializer.serialize(fragment); - } else { - return makePlainAdaptor(tinymceEditor).selection.getContent(format, args); - } - } - }, - raw: { - getModel: function () { - return Optional.some(rtcEditor.getRawModel()); - } + var defaultVars = function (vars) { + return isObject(vars) ? vars : {}; + }; + var unsupported = die('Unimplemented feature for rtc'); + var ignore = noop; + return { + undoManager: { + beforeChange: ignore, + addUndoLevel: unsupported, + undo: function () { + rtcEditor.undo(); + return createDummyUndoLevel(); + }, + redo: function () { + rtcEditor.redo(); + return createDummyUndoLevel(); + }, + clear: unsupported, + reset: unsupported, + hasUndo: function () { + return rtcEditor.hasUndo(); + }, + hasRedo: function () { + return rtcEditor.hasRedo(); + }, + transact: function (_undoManager, _locks, fn) { + rtcEditor.transact(fn); + return createDummyUndoLevel(); + }, + ignore: unsupported, + extra: unsupported + }, + formatter: { + match: function (name, vars, _node) { + return rtcEditor.matchFormat(name, defaultVars(vars)); + }, + matchAll: unsupported, + matchNode: unsupported, + canApply: function (name) { + return rtcEditor.canApplyFormat(name); + }, + closest: function (names) { + return rtcEditor.closestFormat(names); + }, + apply: function (name, vars, _node) { + return rtcEditor.applyFormat(name, defaultVars(vars)); + }, + remove: function (name, vars, _node, _similar) { + return rtcEditor.removeFormat(name, defaultVars(vars)); + }, + toggle: function (name, vars, _node) { + return rtcEditor.toggleFormat(name, defaultVars(vars)); + }, + formatChanged: function (_rfl, formats, callback, similar) { + return rtcEditor.formatChanged(formats, callback, similar); + } + }, + editor: { + getContent: function (args, format) { + if (format === 'html' || format === 'tree') { + var fragment = rtcEditor.getContent(); + var serializer = HtmlSerializer({ inner: true }); + runSerializerFiltersOnFragment(tinymceEditor, fragment); + return format === 'tree' ? fragment : serializer.serialize(fragment); + } else { + return makePlainAdaptor(tinymceEditor).editor.getContent(args, format); } - }; + }, + setContent: function (content, _args) { + var fragment = isTreeNode$1(content) ? content : tinymceEditor.parser.parse(content, { + isRootContent: true, + insert: true + }); + rtcEditor.setContent(fragment); + return content; + }, + insertContent: function (value, _details) { + var contextArgs = getInsertContext(tinymceEditor).fold(function () { + return {}; + }, function (context) { + return { context: context }; + }); + var fragment = isTreeNode$1(value) ? value : tinymceEditor.parser.parse(value, __assign(__assign({}, contextArgs), { insert: true })); + rtcEditor.insertContent(fragment); + }, + addVisual: function (_elm) { + } + }, + selection: { + getContent: function (format, args) { + if (format === 'html' || format === 'tree') { + var fragment = rtcEditor.getSelectedContent(); + var serializer = HtmlSerializer({}); + runSerializerFiltersOnFragment(tinymceEditor, fragment); + return format === 'tree' ? fragment : serializer.serialize(fragment); + } else { + return makePlainAdaptor(tinymceEditor).selection.getContent(format, args); + } + } + }, + raw: { + getModel: function () { + return Optional.some(rtcEditor.getRawModel()); + } + } + }; }; var isRtc = function (editor) { - return has(editor.plugins, 'rtc'); + return has(editor.plugins, 'rtc'); }; var setup$5 = function (editor) { - var editorCast = editor; - return get$1(editor.plugins, 'rtc').fold(function () { - editorCast.rtcInstance = makePlainAdaptor(editor); - return Optional.none(); - }, function (rtc) { - return Optional.some(rtc.setup().then(function (rtcEditor) { - editorCast.rtcInstance = makeRtcAdaptor(editor, rtcEditor); - return rtcEditor.isRemote; - })); - }); + var editorCast = editor; + return get$1(editor.plugins, 'rtc').fold(function () { + editorCast.rtcInstance = makePlainAdaptor(editor); + return Optional.none(); + }, function (rtc) { + return Optional.some(rtc.setup().then(function (rtcEditor) { + editorCast.rtcInstance = makeRtcAdaptor(editor, rtcEditor); + return rtcEditor.isRemote; + })); + }); }; var getRtcInstanceWithFallback = function (editor) { - return editor.rtcInstance ? editor.rtcInstance : makePlainAdaptor(editor); + return editor.rtcInstance ? editor.rtcInstance : makePlainAdaptor(editor); }; var getRtcInstanceWithError = function (editor) { - var rtcInstance = editor.rtcInstance; - if (!rtcInstance) { - throw new Error('Failed to get RTC instance not yet initialized.'); - } else { - return rtcInstance; - } + var rtcInstance = editor.rtcInstance; + if (!rtcInstance) { + throw new Error('Failed to get RTC instance not yet initialized.'); + } else { + return rtcInstance; + } }; var beforeChange$1 = function (editor, locks, beforeBookmark) { - getRtcInstanceWithError(editor).undoManager.beforeChange(locks, beforeBookmark); + getRtcInstanceWithError(editor).undoManager.beforeChange(locks, beforeBookmark); }; var addUndoLevel$1 = function (editor, undoManager, index, locks, beforeBookmark, level, event) { - return getRtcInstanceWithError(editor).undoManager.addUndoLevel(undoManager, index, locks, beforeBookmark, level, event); + return getRtcInstanceWithError(editor).undoManager.addUndoLevel(undoManager, index, locks, beforeBookmark, level, event); }; var undo$1 = function (editor, undoManager, locks, index) { - return getRtcInstanceWithError(editor).undoManager.undo(undoManager, locks, index); + return getRtcInstanceWithError(editor).undoManager.undo(undoManager, locks, index); }; var redo$1 = function (editor, index, data) { - return getRtcInstanceWithError(editor).undoManager.redo(index, data); + return getRtcInstanceWithError(editor).undoManager.redo(index, data); }; var clear$1 = function (editor, undoManager, index) { - getRtcInstanceWithError(editor).undoManager.clear(undoManager, index); + getRtcInstanceWithError(editor).undoManager.clear(undoManager, index); }; var reset$1 = function (editor, undoManager) { - getRtcInstanceWithError(editor).undoManager.reset(undoManager); + getRtcInstanceWithError(editor).undoManager.reset(undoManager); }; var hasUndo$1 = function (editor, undoManager, index) { - return getRtcInstanceWithError(editor).undoManager.hasUndo(undoManager, index); + return getRtcInstanceWithError(editor).undoManager.hasUndo(undoManager, index); }; var hasRedo$1 = function (editor, undoManager, index) { - return getRtcInstanceWithError(editor).undoManager.hasRedo(undoManager, index); + return getRtcInstanceWithError(editor).undoManager.hasRedo(undoManager, index); }; var transact$1 = function (editor, undoManager, locks, callback) { - return getRtcInstanceWithError(editor).undoManager.transact(undoManager, locks, callback); + return getRtcInstanceWithError(editor).undoManager.transact(undoManager, locks, callback); }; var ignore$1 = function (editor, locks, callback) { - getRtcInstanceWithError(editor).undoManager.ignore(locks, callback); + getRtcInstanceWithError(editor).undoManager.ignore(locks, callback); }; var extra$1 = function (editor, undoManager, index, callback1, callback2) { - getRtcInstanceWithError(editor).undoManager.extra(undoManager, index, callback1, callback2); + getRtcInstanceWithError(editor).undoManager.extra(undoManager, index, callback1, callback2); }; var matchFormat = function (editor, name, vars, node) { - return getRtcInstanceWithError(editor).formatter.match(name, vars, node); + return getRtcInstanceWithError(editor).formatter.match(name, vars, node); }; var matchAllFormats = function (editor, names, vars) { - return getRtcInstanceWithError(editor).formatter.matchAll(names, vars); + return getRtcInstanceWithError(editor).formatter.matchAll(names, vars); }; var matchNodeFormat = function (editor, node, name, vars, similar) { - return getRtcInstanceWithError(editor).formatter.matchNode(node, name, vars, similar); + return getRtcInstanceWithError(editor).formatter.matchNode(node, name, vars, similar); }; var canApplyFormat = function (editor, name) { - return getRtcInstanceWithError(editor).formatter.canApply(name); + return getRtcInstanceWithError(editor).formatter.canApply(name); }; var closestFormat = function (editor, names) { - return getRtcInstanceWithError(editor).formatter.closest(names); + return getRtcInstanceWithError(editor).formatter.closest(names); }; var applyFormat$1 = function (editor, name, vars, node) { - getRtcInstanceWithError(editor).formatter.apply(name, vars, node); + getRtcInstanceWithError(editor).formatter.apply(name, vars, node); }; var removeFormat$1 = function (editor, name, vars, node, similar) { - getRtcInstanceWithError(editor).formatter.remove(name, vars, node, similar); + getRtcInstanceWithError(editor).formatter.remove(name, vars, node, similar); }; var toggleFormat = function (editor, name, vars, node) { - getRtcInstanceWithError(editor).formatter.toggle(name, vars, node); + getRtcInstanceWithError(editor).formatter.toggle(name, vars, node); }; var formatChanged = function (editor, registeredFormatListeners, formats, callback, similar) { - if (similar === void 0) { - similar = false; - } - return getRtcInstanceWithError(editor).formatter.formatChanged(registeredFormatListeners, formats, callback, similar); + if (similar === void 0) { + similar = false; + } + return getRtcInstanceWithError(editor).formatter.formatChanged(registeredFormatListeners, formats, callback, similar); }; var getContent = function (editor, args, format) { - return getRtcInstanceWithFallback(editor).editor.getContent(args, format); + return getRtcInstanceWithFallback(editor).editor.getContent(args, format); }; var setContent = function (editor, content, args) { - return getRtcInstanceWithFallback(editor).editor.setContent(content, args); + return getRtcInstanceWithFallback(editor).editor.setContent(content, args); }; var insertContent = function (editor, value, details) { - return getRtcInstanceWithFallback(editor).editor.insertContent(value, details); + return getRtcInstanceWithFallback(editor).editor.insertContent(value, details); }; var getSelectedContent = function (editor, format, args) { - return getRtcInstanceWithError(editor).selection.getContent(format, args); + return getRtcInstanceWithError(editor).selection.getContent(format, args); }; var addVisual = function (editor, elm) { - return getRtcInstanceWithError(editor).editor.addVisual(elm); + return getRtcInstanceWithError(editor).editor.addVisual(elm); }; var getContent$1 = function (editor, args) { - if (args === void 0) { - args = {}; - } - var format = args.format ? args.format : 'html'; - return getSelectedContent(editor, format, args); + if (args === void 0) { + args = {}; + } + var format = args.format ? args.format : 'html'; + return getSelectedContent(editor, format, args); }; var removeEmpty = function (text) { - if (text.dom.length === 0) { - remove(text); - return Optional.none(); - } else { - return Optional.some(text); - } + if (text.dom.length === 0) { + remove(text); + return Optional.none(); + } else { + return Optional.some(text); + } }; var walkPastBookmark = function (node, start) { - return node.filter(function (elm) { - return BookmarkManager$1.isBookmarkNode(elm.dom); - }).bind(start ? nextSibling : prevSibling); + return node.filter(function (elm) { + return BookmarkManager$1.isBookmarkNode(elm.dom); + }).bind(start ? nextSibling : prevSibling); }; var merge = function (outer, inner, rng, start) { - var outerElm = outer.dom; - var innerElm = inner.dom; - var oldLength = start ? outerElm.length : innerElm.length; - if (start) { - mergeTextNodes(outerElm, innerElm, false, !start); - rng.setStart(innerElm, oldLength); - } else { - mergeTextNodes(innerElm, outerElm, false, !start); - rng.setEnd(innerElm, oldLength); - } + var outerElm = outer.dom; + var innerElm = inner.dom; + var oldLength = start ? outerElm.length : innerElm.length; + if (start) { + mergeTextNodes(outerElm, innerElm, false, !start); + rng.setStart(innerElm, oldLength); + } else { + mergeTextNodes(innerElm, outerElm, false, !start); + rng.setEnd(innerElm, oldLength); + } }; var normalizeTextIfRequired = function (inner, start) { - parent(inner).each(function (root) { - var text = inner.dom; - if (start && needsToBeNbspLeft(root, CaretPosition$1(text, 0))) { - normalizeWhitespaceAfter(text, 0); - } else if (!start && needsToBeNbspRight(root, CaretPosition$1(text, text.length))) { - normalizeWhitespaceBefore(text, text.length); - } - }); + parent(inner).each(function (root) { + var text = inner.dom; + if (start && needsToBeNbspLeft(root, CaretPosition$1(text, 0))) { + normalizeWhitespaceAfter(text, 0); + } else if (!start && needsToBeNbspRight(root, CaretPosition$1(text, text.length))) { + normalizeWhitespaceBefore(text, text.length); + } + }); }; var mergeAndNormalizeText = function (outerNode, innerNode, rng, start) { - outerNode.bind(function (outer) { - var normalizer = start ? normalizeWhitespaceBefore : normalizeWhitespaceAfter; - normalizer(outer.dom, start ? outer.dom.length : 0); - return innerNode.filter(isText).map(function (inner) { - return merge(outer, inner, rng, start); - }); - }).orThunk(function () { - var innerTextNode = walkPastBookmark(innerNode, start).or(innerNode).filter(isText); - return innerTextNode.map(function (inner) { - return normalizeTextIfRequired(inner, start); - }); + outerNode.bind(function (outer) { + var normalizer = start ? normalizeWhitespaceBefore : normalizeWhitespaceAfter; + normalizer(outer.dom, start ? outer.dom.length : 0); + return innerNode.filter(isText).map(function (inner) { + return merge(outer, inner, rng, start); }); + }).orThunk(function () { + var innerTextNode = walkPastBookmark(innerNode, start).or(innerNode).filter(isText); + return innerTextNode.map(function (inner) { + return normalizeTextIfRequired(inner, start); + }); + }); }; var rngSetContent = function (rng, fragment) { - var firstChild = Optional.from(fragment.firstChild).map(SugarElement.fromDom); - var lastChild = Optional.from(fragment.lastChild).map(SugarElement.fromDom); - rng.deleteContents(); - rng.insertNode(fragment); - var prevText = firstChild.bind(prevSibling).filter(isText).bind(removeEmpty); - var nextText = lastChild.bind(nextSibling).filter(isText).bind(removeEmpty); - mergeAndNormalizeText(prevText, firstChild, rng, true); - mergeAndNormalizeText(nextText, lastChild, rng, false); - rng.collapse(false); + var firstChild = Optional.from(fragment.firstChild).map(SugarElement.fromDom); + var lastChild = Optional.from(fragment.lastChild).map(SugarElement.fromDom); + rng.deleteContents(); + rng.insertNode(fragment); + var prevText = firstChild.bind(prevSibling).filter(isText).bind(removeEmpty); + var nextText = lastChild.bind(nextSibling).filter(isText).bind(removeEmpty); + mergeAndNormalizeText(prevText, firstChild, rng, true); + mergeAndNormalizeText(nextText, lastChild, rng, false); + rng.collapse(false); }; var setupArgs = function (args, content) { - return __assign(__assign({format: 'html'}, args), { - set: true, - selection: true, - content: content - }); + return __assign(__assign({ format: 'html' }, args), { + set: true, + selection: true, + content: content + }); }; var cleanContent = function (editor, args) { - if (args.format !== 'raw') { - var rng = editor.selection.getRng(); - var contextBlock = editor.dom.getParent(rng.commonAncestorContainer, editor.dom.isBlock); - var contextArgs = contextBlock ? {context: contextBlock.nodeName.toLowerCase()} : {}; - var node = editor.parser.parse(args.content, __assign(__assign({ - isRootContent: true, - forced_root_block: false - }, contextArgs), args)); - return HtmlSerializer({validate: editor.validate}, editor.schema).serialize(node); - } else { - return args.content; - } + if (args.format !== 'raw') { + var rng = editor.selection.getRng(); + var contextBlock = editor.dom.getParent(rng.commonAncestorContainer, editor.dom.isBlock); + var contextArgs = contextBlock ? { context: contextBlock.nodeName.toLowerCase() } : {}; + var node = editor.parser.parse(args.content, __assign(__assign({ + isRootContent: true, + forced_root_block: false + }, contextArgs), args)); + return HtmlSerializer({ validate: editor.validate }, editor.schema).serialize(node); + } else { + return args.content; + } }; var setContent$1 = function (editor, content, args) { - if (args === void 0) { - args = {}; - } - var contentArgs = setupArgs(args, content); - if (!contentArgs.no_events) { - contentArgs = editor.fire('BeforeSetContent', contentArgs); - if (contentArgs.isDefaultPrevented()) { - editor.fire('SetContent', contentArgs); - return; - } - } - args.content = cleanContent(editor, contentArgs); - var rng = editor.selection.getRng(); - rngSetContent(rng, rng.createContextualFragment(args.content)); - editor.selection.setRng(rng); - scrollRangeIntoView(editor, rng); - if (!contentArgs.no_events) { - editor.fire('SetContent', contentArgs); - } + if (args === void 0) { + args = {}; + } + var contentArgs = setupArgs(args, content); + if (!contentArgs.no_events) { + contentArgs = editor.fire('BeforeSetContent', contentArgs); + if (contentArgs.isDefaultPrevented()) { + editor.fire('SetContent', contentArgs); + return; + } + } + args.content = cleanContent(editor, contentArgs); + var rng = editor.selection.getRng(); + rngSetContent(rng, rng.createContextualFragment(args.content)); + editor.selection.setRng(rng); + scrollRangeIntoView(editor, rng); + if (!contentArgs.no_events) { + editor.fire('SetContent', contentArgs); + } }; var deleteFromCallbackMap = function (callbackMap, selector, callback) { - if (callbackMap && callbackMap.hasOwnProperty(selector)) { - var newCallbacks = filter(callbackMap[selector], function (cb) { - return cb !== callback; - }); - if (newCallbacks.length === 0) { - delete callbackMap[selector]; - } else { - callbackMap[selector] = newCallbacks; - } - } - }; - - function SelectorChanged(dom, editor) { - var selectorChangedData; - var currentSelectors; - return { - selectorChangedWithUnbind: function (selector, callback) { - if (!selectorChangedData) { - selectorChangedData = {}; - currentSelectors = {}; - editor.on('NodeChange', function (e) { - var node = e.element, parents = dom.getParents(node, null, dom.getRoot()), - matchedSelectors = {}; - Tools.each(selectorChangedData, function (callbacks, selector) { - Tools.each(parents, function (node) { - if (dom.is(node, selector)) { - if (!currentSelectors[selector]) { - Tools.each(callbacks, function (callback) { - callback(true, { - node: node, - selector: selector, - parents: parents - }); - }); - currentSelectors[selector] = callbacks; - } - matchedSelectors[selector] = callbacks; - return false; - } - }); - }); - Tools.each(currentSelectors, function (callbacks, selector) { - if (!matchedSelectors[selector]) { - delete currentSelectors[selector]; - Tools.each(callbacks, function (callback) { - callback(false, { - node: node, - selector: selector, - parents: parents - }); - }); - } + if (callbackMap && callbackMap.hasOwnProperty(selector)) { + var newCallbacks = filter(callbackMap[selector], function (cb) { + return cb !== callback; + }); + if (newCallbacks.length === 0) { + delete callbackMap[selector]; + } else { + callbackMap[selector] = newCallbacks; + } + } + }; + function SelectorChanged (dom, editor) { + var selectorChangedData; + var currentSelectors; + return { + selectorChangedWithUnbind: function (selector, callback) { + if (!selectorChangedData) { + selectorChangedData = {}; + currentSelectors = {}; + editor.on('NodeChange', function (e) { + var node = e.element, parents = dom.getParents(node, null, dom.getRoot()), matchedSelectors = {}; + Tools.each(selectorChangedData, function (callbacks, selector) { + Tools.each(parents, function (node) { + if (dom.is(node, selector)) { + if (!currentSelectors[selector]) { + Tools.each(callbacks, function (callback) { + callback(true, { + node: node, + selector: selector, + parents: parents }); + }); + currentSelectors[selector] = callbacks; + } + matchedSelectors[selector] = callbacks; + return false; + } + }); + }); + Tools.each(currentSelectors, function (callbacks, selector) { + if (!matchedSelectors[selector]) { + delete currentSelectors[selector]; + Tools.each(callbacks, function (callback) { + callback(false, { + node: node, + selector: selector, + parents: parents }); + }); } - if (!selectorChangedData[selector]) { - selectorChangedData[selector] = []; - } - selectorChangedData[selector].push(callback); - return { - unbind: function () { - deleteFromCallbackMap(selectorChangedData, selector, callback); - deleteFromCallbackMap(currentSelectors, selector, callback); - } - }; + }); + }); + } + if (!selectorChangedData[selector]) { + selectorChangedData[selector] = []; + } + selectorChangedData[selector].push(callback); + return { + unbind: function () { + deleteFromCallbackMap(selectorChangedData, selector, callback); + deleteFromCallbackMap(currentSelectors, selector, callback); } - }; + }; + } + }; } var isNativeIeSelection = function (rng) { - return !!rng.select; + return !!rng.select; }; var isAttachedToDom = function (node) { - return !!(node && node.ownerDocument) && contains$2(SugarElement.fromDom(node.ownerDocument), SugarElement.fromDom(node)); + return !!(node && node.ownerDocument) && contains$2(SugarElement.fromDom(node.ownerDocument), SugarElement.fromDom(node)); }; var isValidRange = function (rng) { - if (!rng) { - return false; - } else if (isNativeIeSelection(rng)) { - return true; - } else { - return isAttachedToDom(rng.startContainer) && isAttachedToDom(rng.endContainer); - } + if (!rng) { + return false; + } else if (isNativeIeSelection(rng)) { + return true; + } else { + return isAttachedToDom(rng.startContainer) && isAttachedToDom(rng.endContainer); + } }; var EditorSelection = function (dom, win, serializer, editor) { - var selectedRange; - var explicitRange; - var selectorChangedWithUnbind = SelectorChanged(dom, editor).selectorChangedWithUnbind; - var setCursorLocation = function (node, offset) { - var rng = dom.createRng(); - if (!node) { - moveEndPoint$1(dom, rng, editor.getBody(), true); - setRng(rng); - } else { - rng.setStart(node, offset); - rng.setEnd(node, offset); - setRng(rng); - collapse(false); - } - }; - var getContent = function (args) { - return getContent$1(editor, args); - }; - var setContent = function (content, args) { - return setContent$1(editor, content, args); - }; - var getStart = function (real) { - return getStart$2(editor.getBody(), getRng$1(), real); - }; - var getEnd$1 = function (real) { - return getEnd(editor.getBody(), getRng$1(), real); - }; - var getBookmark = function (type, normalized) { - return bookmarkManager.getBookmark(type, normalized); - }; - var moveToBookmark = function (bookmark) { - return bookmarkManager.moveToBookmark(bookmark); - }; - var select = function (node, content) { - select$1(dom, node, content).each(setRng); - return node; + var selectedRange; + var explicitRange; + var selectorChangedWithUnbind = SelectorChanged(dom, editor).selectorChangedWithUnbind; + var setCursorLocation = function (node, offset) { + var rng = dom.createRng(); + if (!node) { + moveEndPoint$1(dom, rng, editor.getBody(), true); + setRng(rng); + } else { + rng.setStart(node, offset); + rng.setEnd(node, offset); + setRng(rng); + collapse(false); + } + }; + var getContent = function (args) { + return getContent$1(editor, args); + }; + var setContent = function (content, args) { + return setContent$1(editor, content, args); + }; + var getStart = function (real) { + return getStart$2(editor.getBody(), getRng$1(), real); + }; + var getEnd$1 = function (real) { + return getEnd(editor.getBody(), getRng$1(), real); + }; + var getBookmark = function (type, normalized) { + return bookmarkManager.getBookmark(type, normalized); + }; + var moveToBookmark = function (bookmark) { + return bookmarkManager.moveToBookmark(bookmark); + }; + var select = function (node, content) { + select$1(dom, node, content).each(setRng); + return node; + }; + var isCollapsed = function () { + var rng = getRng$1(), sel = getSel(); + if (!rng || rng.item) { + return false; + } + if (rng.compareEndPoints) { + return rng.compareEndPoints('StartToEnd', rng) === 0; + } + return !sel || rng.collapsed; + }; + var collapse = function (toStart) { + var rng = getRng$1(); + rng.collapse(!!toStart); + setRng(rng); + }; + var getSel = function () { + return win.getSelection ? win.getSelection() : win.document.selection; + }; + var getRng$1 = function () { + var selection, rng, elm; + var tryCompareBoundaryPoints = function (how, sourceRange, destinationRange) { + try { + return sourceRange.compareBoundaryPoints(how, destinationRange); + } catch (ex) { + return -1; + } }; - var isCollapsed = function () { - var rng = getRng$1(), sel = getSel(); - if (!rng || rng.item) { - return false; - } - if (rng.compareEndPoints) { - return rng.compareEndPoints('StartToEnd', rng) === 0; + if (!win) { + return null; + } + var doc = win.document; + if (typeof doc === 'undefined' || doc === null) { + return null; + } + if (editor.bookmark !== undefined && hasFocus$1(editor) === false) { + var bookmark = getRng(editor); + if (bookmark.isSome()) { + return bookmark.map(function (r) { + return processRanges(editor, [r])[0]; + }).getOr(doc.createRange()); + } + } + try { + if ((selection = getSel()) && !isRestrictedNode(selection.anchorNode)) { + if (selection.rangeCount > 0) { + rng = selection.getRangeAt(0); + } else { + rng = selection.createRange ? selection.createRange() : doc.createRange(); } - return !sel || rng.collapsed; - }; - var collapse = function (toStart) { - var rng = getRng$1(); - rng.collapse(!!toStart); - setRng(rng); - }; - var getSel = function () { - return win.getSelection ? win.getSelection() : win.document.selection; + rng = processRanges(editor, [rng])[0]; + } + } catch (ex) { + } + if (!rng) { + rng = doc.createRange ? doc.createRange() : doc.body.createTextRange(); + } + if (rng.setStart && rng.startContainer.nodeType === 9 && rng.collapsed) { + elm = dom.getRoot(); + rng.setStart(elm, 0); + rng.setEnd(elm, 0); + } + if (selectedRange && explicitRange) { + if (tryCompareBoundaryPoints(rng.START_TO_START, rng, selectedRange) === 0 && tryCompareBoundaryPoints(rng.END_TO_END, rng, selectedRange) === 0) { + rng = explicitRange; + } else { + selectedRange = null; + explicitRange = null; + } + } + return rng; + }; + var setRng = function (rng, forward) { + var node; + if (!isValidRange(rng)) { + return; + } + var ieRange = isNativeIeSelection(rng) ? rng : null; + if (ieRange) { + explicitRange = null; + try { + ieRange.select(); + } catch (ex) { + } + return; + } + var sel = getSel(); + var evt = editor.fire('SetSelectionRange', { + range: rng, + forward: forward + }); + rng = evt.range; + if (sel) { + explicitRange = rng; + try { + sel.removeAllRanges(); + sel.addRange(rng); + } catch (ex) { + } + if (forward === false && sel.extend) { + sel.collapse(rng.endContainer, rng.endOffset); + sel.extend(rng.startContainer, rng.startOffset); + } + selectedRange = sel.rangeCount > 0 ? sel.getRangeAt(0) : null; + } + if (!rng.collapsed && rng.startContainer === rng.endContainer && sel.setBaseAndExtent && !Env.ie) { + if (rng.endOffset - rng.startOffset < 2) { + if (rng.startContainer.hasChildNodes()) { + node = rng.startContainer.childNodes[rng.startOffset]; + if (node && node.tagName === 'IMG') { + sel.setBaseAndExtent(rng.startContainer, rng.startOffset, rng.endContainer, rng.endOffset); + if (sel.anchorNode !== rng.startContainer || sel.focusNode !== rng.endContainer) { + sel.setBaseAndExtent(node, 0, node, 1); + } + } + } + } + } + editor.fire('AfterSetSelectionRange', { + range: rng, + forward: forward + }); + }; + var setNode = function (elm) { + setContent(dom.getOuterHTML(elm)); + return elm; + }; + var getNode = function () { + return getNode$1(editor.getBody(), getRng$1()); + }; + var getSelectedBlocks$1 = function (startElm, endElm) { + return getSelectedBlocks(dom, getRng$1(), startElm, endElm); + }; + var isForward = function () { + var sel = getSel(); + var anchorNode = sel === null || sel === void 0 ? void 0 : sel.anchorNode; + var focusNode = sel === null || sel === void 0 ? void 0 : sel.focusNode; + if (!sel || !anchorNode || !focusNode || isRestrictedNode(anchorNode) || isRestrictedNode(focusNode)) { + return true; + } + var anchorRange = dom.createRng(); + anchorRange.setStart(anchorNode, sel.anchorOffset); + anchorRange.collapse(true); + var focusRange = dom.createRng(); + focusRange.setStart(focusNode, sel.focusOffset); + focusRange.collapse(true); + return anchorRange.compareBoundaryPoints(anchorRange.START_TO_START, focusRange) <= 0; + }; + var normalize$1 = function () { + var rng = getRng$1(); + var sel = getSel(); + if (!hasMultipleRanges(sel) && hasAnyRanges(editor)) { + var normRng = normalize(dom, rng); + normRng.each(function (normRng) { + setRng(normRng, isForward()); + }); + return normRng.getOr(rng); + } + return rng; + }; + var selectorChanged = function (selector, callback) { + selectorChangedWithUnbind(selector, callback); + return exports; + }; + var getScrollContainer = function () { + var scrollContainer; + var node = dom.getRoot(); + while (node && node.nodeName !== 'BODY') { + if (node.scrollHeight > node.clientHeight) { + scrollContainer = node; + break; + } + node = node.parentNode; + } + return scrollContainer; + }; + var scrollIntoView = function (elm, alignToTop) { + return scrollElementIntoView(editor, elm, alignToTop); + }; + var placeCaretAt = function (clientX, clientY) { + return setRng(fromPoint$1(clientX, clientY, editor.getDoc())); + }; + var getBoundingClientRect = function () { + var rng = getRng$1(); + return rng.collapsed ? CaretPosition$1.fromRangeStart(rng).getClientRects()[0] : rng.getBoundingClientRect(); + }; + var destroy = function () { + win = selectedRange = explicitRange = null; + controlSelection.destroy(); + }; + var exports = { + bookmarkManager: null, + controlSelection: null, + dom: dom, + win: win, + serializer: serializer, + editor: editor, + collapse: collapse, + setCursorLocation: setCursorLocation, + getContent: getContent, + setContent: setContent, + getBookmark: getBookmark, + moveToBookmark: moveToBookmark, + select: select, + isCollapsed: isCollapsed, + isForward: isForward, + setNode: setNode, + getNode: getNode, + getSel: getSel, + setRng: setRng, + getRng: getRng$1, + getStart: getStart, + getEnd: getEnd$1, + getSelectedBlocks: getSelectedBlocks$1, + normalize: normalize$1, + selectorChanged: selectorChanged, + selectorChangedWithUnbind: selectorChangedWithUnbind, + getScrollContainer: getScrollContainer, + scrollIntoView: scrollIntoView, + placeCaretAt: placeCaretAt, + getBoundingClientRect: getBoundingClientRect, + destroy: destroy + }; + var bookmarkManager = BookmarkManager$1(exports); + var controlSelection = ControlSelection(exports, editor); + exports.bookmarkManager = bookmarkManager; + exports.controlSelection = controlSelection; + return exports; + }; + + var removeAttrs = function (node, names) { + each(names, function (name) { + node.attr(name, null); + }); + }; + var addFontToSpansFilter = function (domParser, styles, fontSizes) { + domParser.addNodeFilter('font', function (nodes) { + each(nodes, function (node) { + var props = styles.parse(node.attr('style')); + var color = node.attr('color'); + var face = node.attr('face'); + var size = node.attr('size'); + if (color) { + props.color = color; + } + if (face) { + props['font-family'] = face; + } + if (size) { + props['font-size'] = fontSizes[parseInt(node.attr('size'), 10) - 1]; + } + node.name = 'span'; + node.attr('style', styles.serialize(props)); + removeAttrs(node, [ + 'color', + 'face', + 'size' + ]); + }); + }); + }; + var addStrikeToSpanFilter = function (domParser, styles) { + domParser.addNodeFilter('strike', function (nodes) { + each(nodes, function (node) { + var props = styles.parse(node.attr('style')); + props['text-decoration'] = 'line-through'; + node.name = 'span'; + node.attr('style', styles.serialize(props)); + }); + }); + }; + var addFilters = function (domParser, settings) { + var styles = Styles(); + if (settings.convert_fonts_to_spans) { + addFontToSpansFilter(domParser, styles, Tools.explode(settings.font_size_legacy_values)); + } + addStrikeToSpanFilter(domParser, styles); + }; + var register$1 = function (domParser, settings) { + if (settings.inline_styles) { + addFilters(domParser, settings); + } + }; + + var blobUriToBlob = function (url) { + return new promiseObj(function (resolve, reject) { + var rejectWithError = function () { + reject('Cannot convert ' + url + ' to Blob. Resource might not exist or is inaccessible.'); }; - var getRng$1 = function () { - var selection, rng, elm; - var tryCompareBoundaryPoints = function (how, sourceRange, destinationRange) { - try { - return sourceRange.compareBoundaryPoints(how, destinationRange); - } catch (ex) { - return -1; - } - }; - if (!win) { - return null; - } - var doc = win.document; - if (typeof doc === 'undefined' || doc === null) { - return null; - } - if (editor.bookmark !== undefined && hasFocus$1(editor) === false) { - var bookmark = getRng(editor); - if (bookmark.isSome()) { - return bookmark.map(function (r) { - return processRanges(editor, [r])[0]; - }).getOr(doc.createRange()); - } + try { + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.responseType = 'blob'; + xhr.onload = function () { + if (this.status === 200) { + resolve(this.response); + } else { + rejectWithError(); } - try { - if ((selection = getSel()) && !isRestrictedNode(selection.anchorNode)) { - if (selection.rangeCount > 0) { - rng = selection.getRangeAt(0); - } else { - rng = selection.createRange ? selection.createRange() : doc.createRange(); - } - rng = processRanges(editor, [rng])[0]; - } - } catch (ex) { - } - if (!rng) { - rng = doc.createRange ? doc.createRange() : doc.body.createTextRange(); - } - if (rng.setStart && rng.startContainer.nodeType === 9 && rng.collapsed) { - elm = dom.getRoot(); - rng.setStart(elm, 0); - rng.setEnd(elm, 0); - } - if (selectedRange && explicitRange) { - if (tryCompareBoundaryPoints(rng.START_TO_START, rng, selectedRange) === 0 && tryCompareBoundaryPoints(rng.END_TO_END, rng, selectedRange) === 0) { - rng = explicitRange; - } else { - selectedRange = null; - explicitRange = null; - } - } - return rng; - }; - var setRng = function (rng, forward) { - var node; - if (!isValidRange(rng)) { - return; - } - var ieRange = isNativeIeSelection(rng) ? rng : null; - if (ieRange) { - explicitRange = null; - try { - ieRange.select(); - } catch (ex) { - } - return; - } - var sel = getSel(); - var evt = editor.fire('SetSelectionRange', { - range: rng, - forward: forward - }); - rng = evt.range; - if (sel) { - explicitRange = rng; - try { - sel.removeAllRanges(); - sel.addRange(rng); - } catch (ex) { - } - if (forward === false && sel.extend) { - sel.collapse(rng.endContainer, rng.endOffset); - sel.extend(rng.startContainer, rng.startOffset); - } - selectedRange = sel.rangeCount > 0 ? sel.getRangeAt(0) : null; - } - if (!rng.collapsed && rng.startContainer === rng.endContainer && sel.setBaseAndExtent && !Env.ie) { - if (rng.endOffset - rng.startOffset < 2) { - if (rng.startContainer.hasChildNodes()) { - node = rng.startContainer.childNodes[rng.startOffset]; - if (node && node.tagName === 'IMG') { - sel.setBaseAndExtent(rng.startContainer, rng.startOffset, rng.endContainer, rng.endOffset); - if (sel.anchorNode !== rng.startContainer || sel.focusNode !== rng.endContainer) { - sel.setBaseAndExtent(node, 0, node, 1); - } - } - } - } - } - editor.fire('AfterSetSelectionRange', { - range: rng, - forward: forward - }); - }; - var setNode = function (elm) { - setContent(dom.getOuterHTML(elm)); - return elm; - }; - var getNode = function () { - return getNode$1(editor.getBody(), getRng$1()); - }; - var getSelectedBlocks$1 = function (startElm, endElm) { - return getSelectedBlocks(dom, getRng$1(), startElm, endElm); - }; - var isForward = function () { - var sel = getSel(); - var anchorNode = sel === null || sel === void 0 ? void 0 : sel.anchorNode; - var focusNode = sel === null || sel === void 0 ? void 0 : sel.focusNode; - if (!sel || !anchorNode || !focusNode || isRestrictedNode(anchorNode) || isRestrictedNode(focusNode)) { - return true; - } - var anchorRange = dom.createRng(); - anchorRange.setStart(anchorNode, sel.anchorOffset); - anchorRange.collapse(true); - var focusRange = dom.createRng(); - focusRange.setStart(focusNode, sel.focusOffset); - focusRange.collapse(true); - return anchorRange.compareBoundaryPoints(anchorRange.START_TO_START, focusRange) <= 0; - }; - var normalize$1 = function () { - var rng = getRng$1(); - var sel = getSel(); - if (!hasMultipleRanges(sel) && hasAnyRanges(editor)) { - var normRng = normalize(dom, rng); - normRng.each(function (normRng) { - setRng(normRng, isForward()); - }); - return normRng.getOr(rng); - } - return rng; - }; - var selectorChanged = function (selector, callback) { - selectorChangedWithUnbind(selector, callback); - return exports; - }; - var getScrollContainer = function () { - var scrollContainer; - var node = dom.getRoot(); - while (node && node.nodeName !== 'BODY') { - if (node.scrollHeight > node.clientHeight) { - scrollContainer = node; - break; - } - node = node.parentNode; - } - return scrollContainer; - }; - var scrollIntoView = function (elm, alignToTop) { - return scrollElementIntoView(editor, elm, alignToTop); - }; - var placeCaretAt = function (clientX, clientY) { - return setRng(fromPoint$1(clientX, clientY, editor.getDoc())); - }; - var getBoundingClientRect = function () { - var rng = getRng$1(); - return rng.collapsed ? CaretPosition$1.fromRangeStart(rng).getClientRects()[0] : rng.getBoundingClientRect(); - }; - var destroy = function () { - win = selectedRange = explicitRange = null; - controlSelection.destroy(); - }; - var exports = { - bookmarkManager: null, - controlSelection: null, - dom: dom, - win: win, - serializer: serializer, - editor: editor, - collapse: collapse, - setCursorLocation: setCursorLocation, - getContent: getContent, - setContent: setContent, - getBookmark: getBookmark, - moveToBookmark: moveToBookmark, - select: select, - isCollapsed: isCollapsed, - isForward: isForward, - setNode: setNode, - getNode: getNode, - getSel: getSel, - setRng: setRng, - getRng: getRng$1, - getStart: getStart, - getEnd: getEnd$1, - getSelectedBlocks: getSelectedBlocks$1, - normalize: normalize$1, - selectorChanged: selectorChanged, - selectorChangedWithUnbind: selectorChangedWithUnbind, - getScrollContainer: getScrollContainer, - scrollIntoView: scrollIntoView, - placeCaretAt: placeCaretAt, - getBoundingClientRect: getBoundingClientRect, - destroy: destroy - }; - var bookmarkManager = BookmarkManager$1(exports); - var controlSelection = ControlSelection(exports, editor); - exports.bookmarkManager = bookmarkManager; - exports.controlSelection = controlSelection; - return exports; - }; - - var removeAttrs = function (node, names) { - each(names, function (name) { - node.attr(name, null); - }); - }; - var addFontToSpansFilter = function (domParser, styles, fontSizes) { - domParser.addNodeFilter('font', function (nodes) { - each(nodes, function (node) { - var props = styles.parse(node.attr('style')); - var color = node.attr('color'); - var face = node.attr('face'); - var size = node.attr('size'); - if (color) { - props.color = color; - } - if (face) { - props['font-family'] = face; - } - if (size) { - props['font-size'] = fontSizes[parseInt(node.attr('size'), 10) - 1]; - } - node.name = 'span'; - node.attr('style', styles.serialize(props)); - removeAttrs(node, [ - 'color', - 'face', - 'size' - ]); - }); - }); - }; - var addStrikeToSpanFilter = function (domParser, styles) { - domParser.addNodeFilter('strike', function (nodes) { - each(nodes, function (node) { - var props = styles.parse(node.attr('style')); - props['text-decoration'] = 'line-through'; - node.name = 'span'; - node.attr('style', styles.serialize(props)); - }); - }); - }; - var addFilters = function (domParser, settings) { - var styles = Styles(); - if (settings.convert_fonts_to_spans) { - addFontToSpansFilter(domParser, styles, Tools.explode(settings.font_size_legacy_values)); - } - addStrikeToSpanFilter(domParser, styles); - }; - var register$1 = function (domParser, settings) { - if (settings.inline_styles) { - addFilters(domParser, settings); + }; + xhr.onerror = rejectWithError; + xhr.send(); + } catch (ex) { + rejectWithError(); } - }; - - var blobUriToBlob = function (url) { - return new promiseObj(function (resolve, reject) { - var rejectWithError = function () { - reject('Cannot convert ' + url + ' to Blob. Resource might not exist or is inaccessible.'); - }; - try { - var xhr = new XMLHttpRequest(); - xhr.open('GET', url, true); - xhr.responseType = 'blob'; - xhr.onload = function () { - if (this.status === 200) { - resolve(this.response); - } else { - rejectWithError(); - } - }; - xhr.onerror = rejectWithError; - xhr.send(); - } catch (ex) { - rejectWithError(); - } - }); + }); }; var parseDataUri$1 = function (uri) { - var type; - var uriParts = decodeURIComponent(uri).split(','); - var matches = /data:([^;]+)/.exec(uriParts[0]); - if (matches) { - type = matches[1]; - } - return { - type: type, - data: uriParts[1] - }; + var type; + var uriParts = decodeURIComponent(uri).split(','); + var matches = /data:([^;]+)/.exec(uriParts[0]); + if (matches) { + type = matches[1]; + } + return { + type: type, + data: uriParts[1] + }; }; var buildBlob = function (type, data) { - var str; - try { - str = atob(data); - } catch (e) { - return Optional.none(); - } - var arr = new Uint8Array(str.length); - for (var i = 0; i < arr.length; i++) { - arr[i] = str.charCodeAt(i); - } - return Optional.some(new Blob([arr], {type: type})); + var str; + try { + str = atob(data); + } catch (e) { + return Optional.none(); + } + var arr = new Uint8Array(str.length); + for (var i = 0; i < arr.length; i++) { + arr[i] = str.charCodeAt(i); + } + return Optional.some(new Blob([arr], { type: type })); }; var dataUriToBlob = function (uri) { - return new promiseObj(function (resolve) { - var _a = parseDataUri$1(uri), type = _a.type, data = _a.data; - buildBlob(type, data).fold(function () { - return resolve(new Blob([])); - }, resolve); - }); + return new promiseObj(function (resolve) { + var _a = parseDataUri$1(uri), type = _a.type, data = _a.data; + buildBlob(type, data).fold(function () { + return resolve(new Blob([])); + }, resolve); + }); }; var uriToBlob = function (url) { - if (url.indexOf('blob:') === 0) { - return blobUriToBlob(url); - } - if (url.indexOf('data:') === 0) { - return dataUriToBlob(url); - } - return null; + if (url.indexOf('blob:') === 0) { + return blobUriToBlob(url); + } + if (url.indexOf('data:') === 0) { + return dataUriToBlob(url); + } + return null; }; var blobToDataUri = function (blob) { - return new promiseObj(function (resolve) { - var reader = new FileReader(); - reader.onloadend = function () { - resolve(reader.result); - }; - reader.readAsDataURL(blob); - }); + return new promiseObj(function (resolve) { + var reader = new FileReader(); + reader.onloadend = function () { + resolve(reader.result); + }; + reader.readAsDataURL(blob); + }); }; var count = 0; var uniqueId = function (prefix) { - return (prefix || 'blobid') + count++; + return (prefix || 'blobid') + count++; }; var imageToBlobInfo = function (blobCache, img, resolve, reject) { - var base64, blobInfo; - if (img.src.indexOf('blob:') === 0) { - blobInfo = blobCache.getByUri(img.src); - if (blobInfo) { - resolve({ - image: img, - blobInfo: blobInfo - }); - } else { - uriToBlob(img.src).then(function (blob) { - blobToDataUri(blob).then(function (dataUri) { - base64 = parseDataUri$1(dataUri).data; - blobInfo = blobCache.create(uniqueId(), blob, base64); - blobCache.add(blobInfo); - resolve({ - image: img, - blobInfo: blobInfo - }); - }); - }, function (err) { - reject(err); - }); - } - return; - } - var _a = parseDataUri$1(img.src), data = _a.data, type = _a.type; - base64 = data; - blobInfo = blobCache.getByData(base64, type); + var base64, blobInfo; + if (img.src.indexOf('blob:') === 0) { + blobInfo = blobCache.getByUri(img.src); if (blobInfo) { - resolve({ + resolve({ + image: img, + blobInfo: blobInfo + }); + } else { + uriToBlob(img.src).then(function (blob) { + blobToDataUri(blob).then(function (dataUri) { + base64 = parseDataUri$1(dataUri).data; + blobInfo = blobCache.create(uniqueId(), blob, base64); + blobCache.add(blobInfo); + resolve({ image: img, blobInfo: blobInfo - }); - } else { - uriToBlob(img.src).then(function (blob) { - blobInfo = blobCache.create(uniqueId(), blob, base64); - blobCache.add(blobInfo); - resolve({ - image: img, - blobInfo: blobInfo - }); - }, function (err) { - reject(err); - }); - } + }); + }); + }, function (err) { + reject(err); + }); + } + return; + } + var _a = parseDataUri$1(img.src), data = _a.data, type = _a.type; + base64 = data; + blobInfo = blobCache.getByData(base64, type); + if (blobInfo) { + resolve({ + image: img, + blobInfo: blobInfo + }); + } else { + uriToBlob(img.src).then(function (blob) { + blobInfo = blobCache.create(uniqueId(), blob, base64); + blobCache.add(blobInfo); + resolve({ + image: img, + blobInfo: blobInfo + }); + }, function (err) { + reject(err); + }); + } }; var getAllImages = function (elm) { - return elm ? from$1(elm.getElementsByTagName('img')) : []; + return elm ? from$1(elm.getElementsByTagName('img')) : []; }; - function ImageScanner(uploadStatus, blobCache) { - var cachedPromises = {}; - var findAll = function (elm, predicate) { - if (!predicate) { - predicate = always; - } - var images = filter(getAllImages(elm), function (img) { - var src = img.src; - if (!Env.fileApi) { - return false; - } - if (img.hasAttribute('data-mce-bogus')) { - return false; - } - if (img.hasAttribute('data-mce-placeholder')) { - return false; - } - if (!src || src === Env.transparentSrc) { - return false; - } - if (src.indexOf('blob:') === 0) { - return !uploadStatus.isUploaded(src) && predicate(img); - } - if (src.indexOf('data:') === 0) { - return predicate(img); - } - return false; - }); - var promises = map(images, function (img) { - if (cachedPromises[img.src] !== undefined) { - return new promiseObj(function (resolve) { - cachedPromises[img.src].then(function (imageInfo) { - if (typeof imageInfo === 'string') { - return imageInfo; - } - resolve({ - image: img, - blobInfo: imageInfo.blobInfo - }); - }); - }); + var cachedPromises = {}; + var findAll = function (elm, predicate) { + if (!predicate) { + predicate = always; + } + var images = filter(getAllImages(elm), function (img) { + var src = img.src; + if (!Env.fileApi) { + return false; + } + if (img.hasAttribute('data-mce-bogus')) { + return false; + } + if (img.hasAttribute('data-mce-placeholder')) { + return false; + } + if (!src || src === Env.transparentSrc) { + return false; + } + if (src.indexOf('blob:') === 0) { + return !uploadStatus.isUploaded(src) && predicate(img); + } + if (src.indexOf('data:') === 0) { + return predicate(img); + } + return false; + }); + var promises = map(images, function (img) { + if (cachedPromises[img.src] !== undefined) { + return new promiseObj(function (resolve) { + cachedPromises[img.src].then(function (imageInfo) { + if (typeof imageInfo === 'string') { + return imageInfo; } - var newPromise = new promiseObj(function (resolve, reject) { - imageToBlobInfo(blobCache, img, resolve, reject); - }).then(function (result) { - delete cachedPromises[result.image.src]; - return result; - }).catch(function (error) { - delete cachedPromises[img.src]; - return error; + resolve({ + image: img, + blobInfo: imageInfo.blobInfo }); - cachedPromises[img.src] = newPromise; - return newPromise; + }); }); - return promiseObj.all(promises); - }; - return {findAll: findAll}; + } + var newPromise = new promiseObj(function (resolve, reject) { + imageToBlobInfo(blobCache, img, resolve, reject); + }).then(function (result) { + delete cachedPromises[result.image.src]; + return result; + }).catch(function (error) { + delete cachedPromises[img.src]; + return error; + }); + cachedPromises[img.src] = newPromise; + return newPromise; + }); + return promiseObj.all(promises); + }; + return { findAll: findAll }; } var paddEmptyNode = function (settings, args, blockElements, node) { - var brPreferred = settings.padd_empty_with_br || args.insert; - if (brPreferred && blockElements[node.name]) { - node.empty().append(new AstNode('br', 1)).shortEnded = true; - } else { - node.empty().append(new AstNode('#text', 3)).value = nbsp; - } + var brPreferred = settings.padd_empty_with_br || args.insert; + if (brPreferred && blockElements[node.name]) { + node.empty().append(new AstNode('br', 1)).shortEnded = true; + } else { + node.empty().append(new AstNode('#text', 3)).value = nbsp; + } }; var isPaddedWithNbsp = function (node) { - return hasOnlyChild(node, '#text') && node.firstChild.value === nbsp; + return hasOnlyChild(node, '#text') && node.firstChild.value === nbsp; }; var hasOnlyChild = function (node, name) { - return node && node.firstChild && node.firstChild === node.lastChild && node.firstChild.name === name; + return node && node.firstChild && node.firstChild === node.lastChild && node.firstChild.name === name; }; var isPadded = function (schema, node) { - var rule = schema.getElementRule(node.name); - return rule && rule.paddEmpty; + var rule = schema.getElementRule(node.name); + return rule && rule.paddEmpty; }; var isEmpty$2 = function (schema, nonEmptyElements, whitespaceElements, node) { - return node.isEmpty(nonEmptyElements, whitespaceElements, function (node) { - return isPadded(schema, node); - }); + return node.isEmpty(nonEmptyElements, whitespaceElements, function (node) { + return isPadded(schema, node); + }); }; var isLineBreakNode = function (node, blockElements) { - return node && (blockElements[node.name] || node.name === 'br'); + return node && (blockElements[node.name] || node.name === 'br'); }; var isBogusImage = function (img) { - return img.attr('data-mce-bogus'); + return img.attr('data-mce-bogus'); }; var isInternalImageSource = function (img) { - return img.attr('src') === Env.transparentSrc || img.attr('data-mce-placeholder'); + return img.attr('src') === Env.transparentSrc || img.attr('data-mce-placeholder'); }; var isValidDataImg = function (img, settings) { - if (settings.images_dataimg_filter) { - var imgElem_1 = new Image(); - imgElem_1.src = img.attr('src'); - each$1(img.attributes.map, function (value, key) { - imgElem_1.setAttribute(key, value); - }); - return settings.images_dataimg_filter(imgElem_1); - } else { - return true; - } + if (settings.images_dataimg_filter) { + var imgElem_1 = new Image(); + imgElem_1.src = img.attr('src'); + each$1(img.attributes.map, function (value, key) { + imgElem_1.setAttribute(key, value); + }); + return settings.images_dataimg_filter(imgElem_1); + } else { + return true; + } }; var registerBase64ImageFilter = function (parser, settings) { - var blobCache = settings.blob_cache; - var processImage = function (img) { - var inputSrc = img.attr('src'); - if (isInternalImageSource(img) || isBogusImage(img)) { - return; - } - parseDataUri(inputSrc).filter(function () { - return isValidDataImg(img, settings); - }).bind(function (_a) { - var type = _a.type, data = _a.data; - return Optional.from(blobCache.getByData(data, type)).orThunk(function () { - return buildBlob(type, data).map(function (blob) { - var blobInfo = blobCache.create(uniqueId(), blob, data); - blobCache.add(blobInfo); - return blobInfo; - }); - }); - }).each(function (blobInfo) { - img.attr('src', blobInfo.blobUri()); - }); - }; - if (blobCache) { - parser.addAttributeFilter('src', function (nodes) { - return each(nodes, processImage); - }); - } + var blobCache = settings.blob_cache; + var processImage = function (img) { + var inputSrc = img.attr('src'); + if (isInternalImageSource(img) || isBogusImage(img)) { + return; + } + parseDataUri(inputSrc).filter(function () { + return isValidDataImg(img, settings); + }).bind(function (_a) { + var type = _a.type, data = _a.data; + return Optional.from(blobCache.getByData(data, type)).orThunk(function () { + return buildBlob(type, data).map(function (blob) { + var blobInfo = blobCache.create(uniqueId(), blob, data); + blobCache.add(blobInfo); + return blobInfo; + }); + }); + }).each(function (blobInfo) { + img.attr('src', blobInfo.blobUri()); + }); + }; + if (blobCache) { + parser.addAttributeFilter('src', function (nodes) { + return each(nodes, processImage); + }); + } }; var register$2 = function (parser, settings) { - var schema = parser.schema; - if (settings.remove_trailing_brs) { - parser.addNodeFilter('br', function (nodes, _, args) { - var i; - var l = nodes.length; - var node; - var blockElements = Tools.extend({}, schema.getBlockElements()); - var nonEmptyElements = schema.getNonEmptyElements(); - var parent, lastParent, prev, prevName; - var whiteSpaceElements = schema.getWhiteSpaceElements(); - var elementRule, textNode; - blockElements.body = 1; - for (i = 0; i < l; i++) { - node = nodes[i]; - parent = node.parent; - if (blockElements[node.parent.name] && node === parent.lastChild) { - prev = node.prev; - while (prev) { - prevName = prev.name; - if (prevName !== 'span' || prev.attr('data-mce-type') !== 'bookmark') { - if (prevName === 'br') { - node = null; - } - break; - } - prev = prev.prev; - } - if (node) { - node.remove(); - if (isEmpty$2(schema, nonEmptyElements, whiteSpaceElements, parent)) { - elementRule = schema.getElementRule(parent.name); - if (elementRule) { - if (elementRule.removeEmpty) { - parent.remove(); - } else if (elementRule.paddEmpty) { - paddEmptyNode(settings, args, blockElements, parent); - } - } - } - } - } else { - lastParent = node; - while (parent && parent.firstChild === lastParent && parent.lastChild === lastParent) { - lastParent = parent; - if (blockElements[parent.name]) { - break; - } - parent = parent.parent; - } - if (lastParent === parent && settings.padd_empty_with_br !== true) { - textNode = new AstNode('#text', 3); - textNode.value = nbsp; - node.replace(textNode); - } - } - } - }); - } - parser.addAttributeFilter('href', function (nodes) { - var i = nodes.length; - var appendRel = function (rel) { - var parts = rel.split(' ').filter(function (p) { - return p.length > 0; - }); - return parts.concat(['noopener']).sort().join(' '); - }; - var addNoOpener = function (rel) { - var newRel = rel ? Tools.trim(rel) : ''; - if (!/\b(noopener)\b/g.test(newRel)) { - return appendRel(newRel); - } else { - return newRel; - } - }; - if (!settings.allow_unsafe_link_target) { - while (i--) { - var node = nodes[i]; - if (node.name === 'a' && node.attr('target') === '_blank') { - node.attr('rel', addNoOpener(node.attr('rel'))); + var schema = parser.schema; + if (settings.remove_trailing_brs) { + parser.addNodeFilter('br', function (nodes, _, args) { + var i; + var l = nodes.length; + var node; + var blockElements = Tools.extend({}, schema.getBlockElements()); + var nonEmptyElements = schema.getNonEmptyElements(); + var parent, lastParent, prev, prevName; + var whiteSpaceElements = schema.getWhiteSpaceElements(); + var elementRule, textNode; + blockElements.body = 1; + for (i = 0; i < l; i++) { + node = nodes[i]; + parent = node.parent; + if (blockElements[node.parent.name] && node === parent.lastChild) { + prev = node.prev; + while (prev) { + prevName = prev.name; + if (prevName !== 'span' || prev.attr('data-mce-type') !== 'bookmark') { + if (prevName === 'br') { + node = null; + } + break; + } + prev = prev.prev; + } + if (node) { + node.remove(); + if (isEmpty$2(schema, nonEmptyElements, whiteSpaceElements, parent)) { + elementRule = schema.getElementRule(parent.name); + if (elementRule) { + if (elementRule.removeEmpty) { + parent.remove(); + } else if (elementRule.paddEmpty) { + paddEmptyNode(settings, args, blockElements, parent); } + } } + } + } else { + lastParent = node; + while (parent && parent.firstChild === lastParent && parent.lastChild === lastParent) { + lastParent = parent; + if (blockElements[parent.name]) { + break; + } + parent = parent.parent; + } + if (lastParent === parent && settings.padd_empty_with_br !== true) { + textNode = new AstNode('#text', 3); + textNode.value = nbsp; + node.replace(textNode); + } + } + } + }); + } + parser.addAttributeFilter('href', function (nodes) { + var i = nodes.length; + var appendRel = function (rel) { + var parts = rel.split(' ').filter(function (p) { + return p.length > 0; + }); + return parts.concat(['noopener']).sort().join(' '); + }; + var addNoOpener = function (rel) { + var newRel = rel ? Tools.trim(rel) : ''; + if (!/\b(noopener)\b/g.test(newRel)) { + return appendRel(newRel); + } else { + return newRel; + } + }; + if (!settings.allow_unsafe_link_target) { + while (i--) { + var node = nodes[i]; + if (node.name === 'a' && node.attr('target') === '_blank') { + node.attr('rel', addNoOpener(node.attr('rel'))); + } + } + } + }); + if (!settings.allow_html_in_named_anchor) { + parser.addAttributeFilter('id,name', function (nodes) { + var i = nodes.length, sibling, prevSibling, parent, node; + while (i--) { + node = nodes[i]; + if (node.name === 'a' && node.firstChild && !node.attr('href')) { + parent = node.parent; + sibling = node.lastChild; + do { + prevSibling = sibling.prev; + parent.insert(sibling, node); + sibling = prevSibling; + } while (sibling); + } + } + }); + } + if (settings.fix_list_elements) { + parser.addNodeFilter('ul,ol', function (nodes) { + var i = nodes.length, node, parentNode; + while (i--) { + node = nodes[i]; + parentNode = node.parent; + if (parentNode.name === 'ul' || parentNode.name === 'ol') { + if (node.prev && node.prev.name === 'li') { + node.prev.append(node); + } else { + var li = new AstNode('li', 1); + li.attr('style', 'list-style-type: none'); + node.wrap(li); + } + } + } + }); + } + if (settings.validate && schema.getValidClasses()) { + parser.addAttributeFilter('class', function (nodes) { + var i = nodes.length, node, classList, ci, className, classValue; + var validClasses = schema.getValidClasses(); + var validClassesMap, valid; + while (i--) { + node = nodes[i]; + classList = node.attr('class').split(' '); + classValue = ''; + for (ci = 0; ci < classList.length; ci++) { + className = classList[ci]; + valid = false; + validClassesMap = validClasses['*']; + if (validClassesMap && validClassesMap[className]) { + valid = true; + } + validClassesMap = validClasses[node.name]; + if (!valid && validClassesMap && validClassesMap[className]) { + valid = true; + } + if (valid) { + if (classValue) { + classValue += ' '; + } + classValue += className; + } + } + if (!classValue.length) { + classValue = null; + } + node.attr('class', classValue); + } + }); + } + registerBase64ImageFilter(parser, settings); + }; + + var makeMap$4 = Tools.makeMap, each$d = Tools.each, explode$2 = Tools.explode, extend$2 = Tools.extend; + var DomParser = function (settings, schema) { + if (schema === void 0) { + schema = Schema(); + } + var nodeFilters = {}; + var attributeFilters = []; + var matchedNodes = {}; + var matchedAttributes = {}; + settings = settings || {}; + settings.validate = 'validate' in settings ? settings.validate : true; + settings.root_name = settings.root_name || 'body'; + var fixInvalidChildren = function (nodes) { + var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i; + var sibling, nextNode; + var nonSplitableElements = makeMap$4('tr,td,th,tbody,thead,tfoot,table'); + var nonEmptyElements = schema.getNonEmptyElements(); + var whitespaceElements = schema.getWhiteSpaceElements(); + var textBlockElements = schema.getTextBlockElements(); + var specialElements = schema.getSpecialElements(); + for (ni = 0; ni < nodes.length; ni++) { + node = nodes[ni]; + if (!node.parent || node.fixed) { + continue; + } + if (textBlockElements[node.name] && node.parent.name === 'li') { + sibling = node.next; + while (sibling) { + if (textBlockElements[sibling.name]) { + sibling.name = 'li'; + sibling.fixed = true; + node.parent.insert(sibling, node.parent); + } else { + break; + } + sibling = sibling.next; + } + node.unwrap(node); + continue; + } + parents = [node]; + for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) && !nonSplitableElements[parent.name]; parent = parent.parent) { + parents.push(parent); + } + if (parent && parents.length > 1) { + parents.reverse(); + newParent = currentNode = filterNode(parents[0].clone()); + for (i = 0; i < parents.length - 1; i++) { + if (schema.isValidChild(currentNode.name, parents[i].name)) { + tempNode = filterNode(parents[i].clone()); + currentNode.append(tempNode); + } else { + tempNode = currentNode; + } + for (childNode = parents[i].firstChild; childNode && childNode !== parents[i + 1];) { + nextNode = childNode.next; + tempNode.append(childNode); + childNode = nextNode; + } + currentNode = tempNode; + } + if (!isEmpty$2(schema, nonEmptyElements, whitespaceElements, newParent)) { + parent.insert(newParent, parents[0], true); + parent.insert(node, newParent); + } else { + parent.insert(node, parents[0], true); } - }); - if (!settings.allow_html_in_named_anchor) { - parser.addAttributeFilter('id,name', function (nodes) { - var i = nodes.length, sibling, prevSibling, parent, node; - while (i--) { - node = nodes[i]; - if (node.name === 'a' && node.firstChild && !node.attr('href')) { - parent = node.parent; - sibling = node.lastChild; - do { - prevSibling = sibling.prev; - parent.insert(sibling, node); - sibling = prevSibling; - } while (sibling); - } - } - }); + parent = parents[0]; + if (isEmpty$2(schema, nonEmptyElements, whitespaceElements, parent) || hasOnlyChild(parent, 'br')) { + parent.empty().remove(); + } + } else if (node.parent) { + if (node.name === 'li') { + sibling = node.prev; + if (sibling && (sibling.name === 'ul' || sibling.name === 'ol')) { + sibling.append(node); + continue; + } + sibling = node.next; + if (sibling && (sibling.name === 'ul' || sibling.name === 'ol')) { + sibling.insert(node, sibling.firstChild, true); + continue; + } + node.wrap(filterNode(new AstNode('ul', 1))); + continue; + } + if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) { + node.wrap(filterNode(new AstNode('div', 1))); + } else { + if (specialElements[node.name]) { + node.empty().remove(); + } else { + node.unwrap(); + } + } + } + } + }; + var filterNode = function (node) { + var i, name, list; + name = node.name; + if (name in nodeFilters) { + list = matchedNodes[name]; + if (list) { + list.push(node); + } else { + matchedNodes[name] = [node]; + } + } + i = attributeFilters.length; + while (i--) { + name = attributeFilters[i].name; + if (name in node.attributes.map) { + list = matchedAttributes[name]; + if (list) { + list.push(node); + } else { + matchedAttributes[name] = [node]; + } + } } - if (settings.fix_list_elements) { - parser.addNodeFilter('ul,ol', function (nodes) { - var i = nodes.length, node, parentNode; - while (i--) { - node = nodes[i]; - parentNode = node.parent; - if (parentNode.name === 'ul' || parentNode.name === 'ol') { - if (node.prev && node.prev.name === 'li') { - node.prev.append(node); - } else { - var li = new AstNode('li', 1); - li.attr('style', 'list-style-type: none'); - node.wrap(li); - } - } - } + return node; + }; + var addNodeFilter = function (name, callback) { + each$d(explode$2(name), function (name) { + var list = nodeFilters[name]; + if (!list) { + nodeFilters[name] = list = []; + } + list.push(callback); + }); + }; + var getNodeFilters = function () { + var out = []; + for (var name_1 in nodeFilters) { + if (nodeFilters.hasOwnProperty(name_1)) { + out.push({ + name: name_1, + callbacks: nodeFilters[name_1] }); + } } - if (settings.validate && schema.getValidClasses()) { - parser.addAttributeFilter('class', function (nodes) { - var i = nodes.length, node, classList, ci, className, classValue; - var validClasses = schema.getValidClasses(); - var validClassesMap, valid; - while (i--) { - node = nodes[i]; - classList = node.attr('class').split(' '); - classValue = ''; - for (ci = 0; ci < classList.length; ci++) { - className = classList[ci]; - valid = false; - validClassesMap = validClasses['*']; - if (validClassesMap && validClassesMap[className]) { - valid = true; - } - validClassesMap = validClasses[node.name]; - if (!valid && validClassesMap && validClassesMap[className]) { - valid = true; + return out; + }; + var addAttributeFilter = function (name, callback) { + each$d(explode$2(name), function (name) { + var i; + for (i = 0; i < attributeFilters.length; i++) { + if (attributeFilters[i].name === name) { + attributeFilters[i].callbacks.push(callback); + return; + } + } + attributeFilters.push({ + name: name, + callbacks: [callback] + }); + }); + }; + var getAttributeFilters = function () { + return [].concat(attributeFilters); + }; + var parse = function (html, args) { + var nodes, i, l, fi, fl, list, name; + var invalidChildren = []; + var isInWhiteSpacePreservedElement; + var node; + var getRootBlockName = function (name) { + if (name === false) { + return ''; + } else if (name === true) { + return 'p'; + } else { + return name; + } + }; + args = args || {}; + matchedNodes = {}; + matchedAttributes = {}; + var blockElements = extend$2(makeMap$4('script,style,head,html,body,title,meta,param'), schema.getBlockElements()); + var nonEmptyElements = schema.getNonEmptyElements(); + var children = schema.children; + var validate = settings.validate; + var forcedRootBlockName = 'forced_root_block' in args ? args.forced_root_block : settings.forced_root_block; + var rootBlockName = getRootBlockName(forcedRootBlockName); + var whiteSpaceElements = schema.getWhiteSpaceElements(); + var startWhiteSpaceRegExp = /^[ \t\r\n]+/; + var endWhiteSpaceRegExp = /[ \t\r\n]+$/; + var allWhiteSpaceRegExp = /[ \t\r\n]+/g; + var isAllWhiteSpaceRegExp = /^[ \t\r\n]+$/; + isInWhiteSpacePreservedElement = whiteSpaceElements.hasOwnProperty(args.context) || whiteSpaceElements.hasOwnProperty(settings.root_name); + var addRootBlocks = function () { + var node = rootNode.firstChild, next, rootBlockNode; + var trim = function (rootBlockNode) { + if (rootBlockNode) { + node = rootBlockNode.firstChild; + if (node && node.type === 3) { + node.value = node.value.replace(startWhiteSpaceRegExp, ''); + } + node = rootBlockNode.lastChild; + if (node && node.type === 3) { + node.value = node.value.replace(endWhiteSpaceRegExp, ''); + } + } + }; + if (!schema.isValidChild(rootNode.name, rootBlockName.toLowerCase())) { + return; + } + while (node) { + next = node.next; + if (node.type === 3 || node.type === 1 && node.name !== 'p' && !blockElements[node.name] && !node.attr('data-mce-type')) { + if (!rootBlockNode) { + rootBlockNode = createNode(rootBlockName, 1); + rootBlockNode.attr(settings.forced_root_block_attrs); + rootNode.insert(rootBlockNode, node); + rootBlockNode.append(node); + } else { + rootBlockNode.append(node); + } + } else { + trim(rootBlockNode); + rootBlockNode = null; + } + node = next; + } + trim(rootBlockNode); + }; + var createNode = function (name, type) { + var node = new AstNode(name, type); + var list; + if (name in nodeFilters) { + list = matchedNodes[name]; + if (list) { + list.push(node); + } else { + matchedNodes[name] = [node]; + } + } + return node; + }; + var removeWhitespaceBefore = function (node) { + var textNode, textNodeNext, textVal, sibling; + var blockElements = schema.getBlockElements(); + for (textNode = node.prev; textNode && textNode.type === 3;) { + textVal = textNode.value.replace(endWhiteSpaceRegExp, ''); + if (textVal.length > 0) { + textNode.value = textVal; + return; + } + textNodeNext = textNode.next; + if (textNodeNext) { + if (textNodeNext.type === 3 && textNodeNext.value.length) { + textNode = textNode.prev; + continue; + } + if (!blockElements[textNodeNext.name] && textNodeNext.name !== 'script' && textNodeNext.name !== 'style') { + textNode = textNode.prev; + continue; + } + } + sibling = textNode.prev; + textNode.remove(); + textNode = sibling; + } + }; + var cloneAndExcludeBlocks = function (input) { + var name; + var output = {}; + for (name in input) { + if (name !== 'li' && name !== 'p') { + output[name] = input[name]; + } + } + return output; + }; + var parser = SaxParser$1({ + validate: validate, + allow_html_data_urls: settings.allow_html_data_urls, + allow_svg_data_urls: settings.allow_svg_data_urls, + allow_script_urls: settings.allow_script_urls, + allow_conditional_comments: settings.allow_conditional_comments, + preserve_cdata: settings.preserve_cdata, + self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()), + cdata: function (text) { + node.append(createNode('#cdata', 4)).value = text; + }, + text: function (text, raw) { + var textNode; + if (!isInWhiteSpacePreservedElement) { + text = text.replace(allWhiteSpaceRegExp, ' '); + if (isLineBreakNode(node.lastChild, blockElements)) { + text = text.replace(startWhiteSpaceRegExp, ''); + } + } + if (text.length !== 0) { + textNode = createNode('#text', 3); + textNode.raw = !!raw; + node.append(textNode).value = text; + } + }, + comment: function (text) { + node.append(createNode('#comment', 8)).value = text; + }, + pi: function (name, text) { + node.append(createNode(name, 7)).value = text; + removeWhitespaceBefore(node); + }, + doctype: function (text) { + var newNode = node.append(createNode('#doctype', 10)); + newNode.value = text; + removeWhitespaceBefore(node); + }, + start: function (name, attrs, empty) { + var newNode, attrFiltersLen, attrName, parent; + var elementRule = validate ? schema.getElementRule(name) : {}; + if (elementRule) { + newNode = createNode(elementRule.outputName || name, 1); + newNode.attributes = attrs; + newNode.shortEnded = empty; + node.append(newNode); + parent = children[node.name]; + if (parent && children[newNode.name] && !parent[newNode.name]) { + invalidChildren.push(newNode); + } + attrFiltersLen = attributeFilters.length; + while (attrFiltersLen--) { + attrName = attributeFilters[attrFiltersLen].name; + if (attrName in attrs.map) { + list = matchedAttributes[attrName]; + if (list) { + list.push(newNode); + } else { + matchedAttributes[attrName] = [newNode]; + } + } + } + if (blockElements[name]) { + removeWhitespaceBefore(newNode); + } + if (!empty) { + node = newNode; + } + if (!isInWhiteSpacePreservedElement && whiteSpaceElements[name]) { + isInWhiteSpacePreservedElement = true; + } + } + }, + end: function (name) { + var textNode, text, sibling, tempNode; + var elementRule = validate ? schema.getElementRule(name) : {}; + if (elementRule) { + if (blockElements[name]) { + if (!isInWhiteSpacePreservedElement) { + textNode = node.firstChild; + if (textNode && textNode.type === 3) { + text = textNode.value.replace(startWhiteSpaceRegExp, ''); + if (text.length > 0) { + textNode.value = text; + textNode = textNode.next; + } else { + sibling = textNode.next; + textNode.remove(); + textNode = sibling; + while (textNode && textNode.type === 3) { + text = textNode.value; + sibling = textNode.next; + if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) { + textNode.remove(); + textNode = sibling; } - if (valid) { - if (classValue) { - classValue += ' '; - } - classValue += className; + textNode = sibling; + } + } + } + textNode = node.lastChild; + if (textNode && textNode.type === 3) { + text = textNode.value.replace(endWhiteSpaceRegExp, ''); + if (text.length > 0) { + textNode.value = text; + textNode = textNode.prev; + } else { + sibling = textNode.prev; + textNode.remove(); + textNode = sibling; + while (textNode && textNode.type === 3) { + text = textNode.value; + sibling = textNode.prev; + if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) { + textNode.remove(); + textNode = sibling; } - } - if (!classValue.length) { - classValue = null; - } - node.attr('class', classValue); + textNode = sibling; + } + } + } + } + } + if (isInWhiteSpacePreservedElement && whiteSpaceElements[name]) { + isInWhiteSpacePreservedElement = false; + } + if (elementRule.removeEmpty && isEmpty$2(schema, nonEmptyElements, whiteSpaceElements, node)) { + tempNode = node.parent; + if (blockElements[node.name]) { + node.empty().remove(); + } else { + node.unwrap(); } - }); + node = tempNode; + return; + } + if (elementRule.paddEmpty && (isPaddedWithNbsp(node) || isEmpty$2(schema, nonEmptyElements, whiteSpaceElements, node))) { + paddEmptyNode(settings, args, blockElements, node); + } + node = node.parent; + } + } + }, schema); + var rootNode = node = new AstNode(args.context || settings.root_name, 11); + parser.parse(html, args.format); + if (validate && invalidChildren.length) { + if (!args.context) { + fixInvalidChildren(invalidChildren); + } else { + args.invalid = true; + } + } + if (rootBlockName && (rootNode.name === 'body' || args.isRootContent)) { + addRootBlocks(); + } + if (!args.invalid) { + for (name in matchedNodes) { + if (!matchedNodes.hasOwnProperty(name)) { + continue; + } + list = nodeFilters[name]; + nodes = matchedNodes[name]; + fi = nodes.length; + while (fi--) { + if (!nodes[fi].parent) { + nodes.splice(fi, 1); + } + } + for (i = 0, l = list.length; i < l; i++) { + list[i](nodes, name, args); + } + } + for (i = 0, l = attributeFilters.length; i < l; i++) { + list = attributeFilters[i]; + if (list.name in matchedAttributes) { + nodes = matchedAttributes[list.name]; + fi = nodes.length; + while (fi--) { + if (!nodes[fi].parent) { + nodes.splice(fi, 1); + } + } + for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) { + list.callbacks[fi](nodes, list.name, args); + } + } + } } - registerBase64ImageFilter(parser, settings); + return rootNode; + }; + var exports = { + schema: schema, + addAttributeFilter: addAttributeFilter, + getAttributeFilters: getAttributeFilters, + addNodeFilter: addNodeFilter, + getNodeFilters: getNodeFilters, + filterNode: filterNode, + parse: parse + }; + register$2(exports, settings); + register$1(exports, settings); + return exports; }; - var makeMap$4 = Tools.makeMap, each$d = Tools.each, explode$2 = Tools.explode, extend$2 = Tools.extend; - var DomParser = function (settings, schema) { - if (schema === void 0) { - schema = Schema(); - } - var nodeFilters = {}; - var attributeFilters = []; - var matchedNodes = {}; - var matchedAttributes = {}; - settings = settings || {}; - settings.validate = 'validate' in settings ? settings.validate : true; - settings.root_name = settings.root_name || 'body'; - var fixInvalidChildren = function (nodes) { - var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i; - var sibling, nextNode; - var nonSplitableElements = makeMap$4('tr,td,th,tbody,thead,tfoot,table'); - var nonEmptyElements = schema.getNonEmptyElements(); - var whitespaceElements = schema.getWhiteSpaceElements(); - var textBlockElements = schema.getTextBlockElements(); - var specialElements = schema.getSpecialElements(); - for (ni = 0; ni < nodes.length; ni++) { - node = nodes[ni]; - if (!node.parent || node.fixed) { - continue; - } - if (textBlockElements[node.name] && node.parent.name === 'li') { - sibling = node.next; - while (sibling) { - if (textBlockElements[sibling.name]) { - sibling.name = 'li'; - sibling.fixed = true; - node.parent.insert(sibling, node.parent); - } else { - break; - } - sibling = sibling.next; - } - node.unwrap(node); - continue; - } - parents = [node]; - for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) && !nonSplitableElements[parent.name]; parent = parent.parent) { - parents.push(parent); - } - if (parent && parents.length > 1) { - parents.reverse(); - newParent = currentNode = filterNode(parents[0].clone()); - for (i = 0; i < parents.length - 1; i++) { - if (schema.isValidChild(currentNode.name, parents[i].name)) { - tempNode = filterNode(parents[i].clone()); - currentNode.append(tempNode); - } else { - tempNode = currentNode; - } - for (childNode = parents[i].firstChild; childNode && childNode !== parents[i + 1];) { - nextNode = childNode.next; - tempNode.append(childNode); - childNode = nextNode; - } - currentNode = tempNode; - } - if (!isEmpty$2(schema, nonEmptyElements, whitespaceElements, newParent)) { - parent.insert(newParent, parents[0], true); - parent.insert(node, newParent); - } else { - parent.insert(node, parents[0], true); - } - parent = parents[0]; - if (isEmpty$2(schema, nonEmptyElements, whitespaceElements, parent) || hasOnlyChild(parent, 'br')) { - parent.empty().remove(); - } - } else if (node.parent) { - if (node.name === 'li') { - sibling = node.prev; - if (sibling && (sibling.name === 'ul' || sibling.name === 'ol')) { - sibling.append(node); - continue; - } - sibling = node.next; - if (sibling && (sibling.name === 'ul' || sibling.name === 'ol')) { - sibling.insert(node, sibling.firstChild, true); - continue; - } - node.wrap(filterNode(new AstNode('ul', 1))); - continue; - } - if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) { - node.wrap(filterNode(new AstNode('div', 1))); - } else { - if (specialElements[node.name]) { - node.empty().remove(); - } else { - node.unwrap(); - } - } - } + var register$3 = function (htmlParser, settings, dom) { + htmlParser.addAttributeFilter('data-mce-tabindex', function (nodes, name) { + var i = nodes.length, node; + while (i--) { + node = nodes[i]; + node.attr('tabindex', node.attr('data-mce-tabindex')); + node.attr(name, null); + } + }); + htmlParser.addAttributeFilter('src,href,style', function (nodes, name) { + var i = nodes.length, node, value; + var internalName = 'data-mce-' + name; + var urlConverter = settings.url_converter; + var urlConverterScope = settings.url_converter_scope; + while (i--) { + node = nodes[i]; + value = node.attr(internalName); + if (value !== undefined) { + node.attr(name, value.length > 0 ? value : null); + node.attr(internalName, null); + } else { + value = node.attr(name); + if (name === 'style') { + value = dom.serializeStyle(dom.parseStyle(value), node.name); + } else if (urlConverter) { + value = urlConverter.call(urlConverterScope, value, name, node.name); + } + node.attr(name, value.length > 0 ? value : null); + } + } + }); + htmlParser.addAttributeFilter('class', function (nodes) { + var i = nodes.length, node, value; + while (i--) { + node = nodes[i]; + value = node.attr('class'); + if (value) { + value = node.attr('class').replace(/(?:^|\s)mce-item-\w+(?!\S)/g, ''); + node.attr('class', value.length > 0 ? value : null); + } + } + }); + htmlParser.addAttributeFilter('data-mce-type', function (nodes, name, args) { + var i = nodes.length, node; + while (i--) { + node = nodes[i]; + if (node.attr('data-mce-type') === 'bookmark' && !args.cleanup) { + var hasChildren = Optional.from(node.firstChild).exists(function (firstChild) { + return !isZwsp$1(firstChild.value); + }); + if (hasChildren) { + node.unwrap(); + } else { + node.remove(); } + } + } + }); + htmlParser.addNodeFilter('noscript', function (nodes) { + var i = nodes.length, node; + while (i--) { + node = nodes[i].firstChild; + if (node) { + node.value = Entities.decode(node.value); + } + } + }); + htmlParser.addNodeFilter('script,style', function (nodes, name) { + var i = nodes.length, node, value, type; + var trim = function (value) { + return value.replace(/()/g, '\n').replace(/^[\r\n]*|[\r\n]*$/g, '').replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g, ''); }; - var filterNode = function (node) { - var i, name, list; - name = node.name; - if (name in nodeFilters) { - list = matchedNodes[name]; - if (list) { - list.push(node); - } else { - matchedNodes[name] = [node]; - } - } - i = attributeFilters.length; - while (i--) { - name = attributeFilters[i].name; - if (name in node.attributes.map) { - list = matchedAttributes[name]; - if (list) { - list.push(node); - } else { - matchedAttributes[name] = [node]; - } - } - } - return node; - }; - var addNodeFilter = function (name, callback) { - each$d(explode$2(name), function (name) { - var list = nodeFilters[name]; - if (!list) { - nodeFilters[name] = list = []; - } - list.push(callback); - }); - }; - var getNodeFilters = function () { - var out = []; - for (var name_1 in nodeFilters) { - if (nodeFilters.hasOwnProperty(name_1)) { - out.push({ - name: name_1, - callbacks: nodeFilters[name_1] - }); - } - } - return out; - }; - var addAttributeFilter = function (name, callback) { - each$d(explode$2(name), function (name) { - var i; - for (i = 0; i < attributeFilters.length; i++) { - if (attributeFilters[i].name === name) { - attributeFilters[i].callbacks.push(callback); - return; - } - } - attributeFilters.push({ - name: name, - callbacks: [callback] - }); - }); - }; - var getAttributeFilters = function () { - return [].concat(attributeFilters); - }; - var parse = function (html, args) { - var nodes, i, l, fi, fl, list, name; - var invalidChildren = []; - var isInWhiteSpacePreservedElement; - var node; - var getRootBlockName = function (name) { - if (name === false) { - return ''; - } else if (name === true) { - return 'p'; - } else { - return name; - } - }; - args = args || {}; - matchedNodes = {}; - matchedAttributes = {}; - var blockElements = extend$2(makeMap$4('script,style,head,html,body,title,meta,param'), schema.getBlockElements()); - var nonEmptyElements = schema.getNonEmptyElements(); - var children = schema.children; - var validate = settings.validate; - var forcedRootBlockName = 'forced_root_block' in args ? args.forced_root_block : settings.forced_root_block; - var rootBlockName = getRootBlockName(forcedRootBlockName); - var whiteSpaceElements = schema.getWhiteSpaceElements(); - var startWhiteSpaceRegExp = /^[ \t\r\n]+/; - var endWhiteSpaceRegExp = /[ \t\r\n]+$/; - var allWhiteSpaceRegExp = /[ \t\r\n]+/g; - var isAllWhiteSpaceRegExp = /^[ \t\r\n]+$/; - isInWhiteSpacePreservedElement = whiteSpaceElements.hasOwnProperty(args.context) || whiteSpaceElements.hasOwnProperty(settings.root_name); - var addRootBlocks = function () { - var node = rootNode.firstChild, next, rootBlockNode; - var trim = function (rootBlockNode) { - if (rootBlockNode) { - node = rootBlockNode.firstChild; - if (node && node.type === 3) { - node.value = node.value.replace(startWhiteSpaceRegExp, ''); - } - node = rootBlockNode.lastChild; - if (node && node.type === 3) { - node.value = node.value.replace(endWhiteSpaceRegExp, ''); - } - } - }; - if (!schema.isValidChild(rootNode.name, rootBlockName.toLowerCase())) { - return; - } - while (node) { - next = node.next; - if (node.type === 3 || node.type === 1 && node.name !== 'p' && !blockElements[node.name] && !node.attr('data-mce-type')) { - if (!rootBlockNode) { - rootBlockNode = createNode(rootBlockName, 1); - rootBlockNode.attr(settings.forced_root_block_attrs); - rootNode.insert(rootBlockNode, node); - rootBlockNode.append(node); - } else { - rootBlockNode.append(node); - } - } else { - trim(rootBlockNode); - rootBlockNode = null; - } - node = next; - } - trim(rootBlockNode); - }; - var createNode = function (name, type) { - var node = new AstNode(name, type); - var list; - if (name in nodeFilters) { - list = matchedNodes[name]; - if (list) { - list.push(node); - } else { - matchedNodes[name] = [node]; - } - } - return node; - }; - var removeWhitespaceBefore = function (node) { - var textNode, textNodeNext, textVal, sibling; - var blockElements = schema.getBlockElements(); - for (textNode = node.prev; textNode && textNode.type === 3;) { - textVal = textNode.value.replace(endWhiteSpaceRegExp, ''); - if (textVal.length > 0) { - textNode.value = textVal; - return; - } - textNodeNext = textNode.next; - if (textNodeNext) { - if (textNodeNext.type === 3 && textNodeNext.value.length) { - textNode = textNode.prev; - continue; - } - if (!blockElements[textNodeNext.name] && textNodeNext.name !== 'script' && textNodeNext.name !== 'style') { - textNode = textNode.prev; - continue; - } - } - sibling = textNode.prev; - textNode.remove(); - textNode = sibling; - } - }; - var cloneAndExcludeBlocks = function (input) { - var name; - var output = {}; - for (name in input) { - if (name !== 'li' && name !== 'p') { - output[name] = input[name]; - } - } - return output; - }; - var parser = SaxParser$1({ - validate: validate, - allow_html_data_urls: settings.allow_html_data_urls, - allow_svg_data_urls: settings.allow_svg_data_urls, - allow_script_urls: settings.allow_script_urls, - allow_conditional_comments: settings.allow_conditional_comments, - preserve_cdata: settings.preserve_cdata, - self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()), - cdata: function (text) { - node.append(createNode('#cdata', 4)).value = text; - }, - text: function (text, raw) { - var textNode; - if (!isInWhiteSpacePreservedElement) { - text = text.replace(allWhiteSpaceRegExp, ' '); - if (isLineBreakNode(node.lastChild, blockElements)) { - text = text.replace(startWhiteSpaceRegExp, ''); - } - } - if (text.length !== 0) { - textNode = createNode('#text', 3); - textNode.raw = !!raw; - node.append(textNode).value = text; - } - }, - comment: function (text) { - node.append(createNode('#comment', 8)).value = text; - }, - pi: function (name, text) { - node.append(createNode(name, 7)).value = text; - removeWhitespaceBefore(node); - }, - doctype: function (text) { - var newNode = node.append(createNode('#doctype', 10)); - newNode.value = text; - removeWhitespaceBefore(node); - }, - start: function (name, attrs, empty) { - var newNode, attrFiltersLen, attrName, parent; - var elementRule = validate ? schema.getElementRule(name) : {}; - if (elementRule) { - newNode = createNode(elementRule.outputName || name, 1); - newNode.attributes = attrs; - newNode.shortEnded = empty; - node.append(newNode); - parent = children[node.name]; - if (parent && children[newNode.name] && !parent[newNode.name]) { - invalidChildren.push(newNode); - } - attrFiltersLen = attributeFilters.length; - while (attrFiltersLen--) { - attrName = attributeFilters[attrFiltersLen].name; - if (attrName in attrs.map) { - list = matchedAttributes[attrName]; - if (list) { - list.push(newNode); - } else { - matchedAttributes[attrName] = [newNode]; - } - } - } - if (blockElements[name]) { - removeWhitespaceBefore(newNode); - } - if (!empty) { - node = newNode; - } - if (!isInWhiteSpacePreservedElement && whiteSpaceElements[name]) { - isInWhiteSpacePreservedElement = true; - } - } - }, - end: function (name) { - var textNode, text, sibling, tempNode; - var elementRule = validate ? schema.getElementRule(name) : {}; - if (elementRule) { - if (blockElements[name]) { - if (!isInWhiteSpacePreservedElement) { - textNode = node.firstChild; - if (textNode && textNode.type === 3) { - text = textNode.value.replace(startWhiteSpaceRegExp, ''); - if (text.length > 0) { - textNode.value = text; - textNode = textNode.next; - } else { - sibling = textNode.next; - textNode.remove(); - textNode = sibling; - while (textNode && textNode.type === 3) { - text = textNode.value; - sibling = textNode.next; - if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) { - textNode.remove(); - textNode = sibling; - } - textNode = sibling; - } - } - } - textNode = node.lastChild; - if (textNode && textNode.type === 3) { - text = textNode.value.replace(endWhiteSpaceRegExp, ''); - if (text.length > 0) { - textNode.value = text; - textNode = textNode.prev; - } else { - sibling = textNode.prev; - textNode.remove(); - textNode = sibling; - while (textNode && textNode.type === 3) { - text = textNode.value; - sibling = textNode.prev; - if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) { - textNode.remove(); - textNode = sibling; - } - textNode = sibling; - } - } - } - } - } - if (isInWhiteSpacePreservedElement && whiteSpaceElements[name]) { - isInWhiteSpacePreservedElement = false; - } - if (elementRule.removeEmpty && isEmpty$2(schema, nonEmptyElements, whiteSpaceElements, node)) { - tempNode = node.parent; - if (blockElements[node.name]) { - node.empty().remove(); - } else { - node.unwrap(); - } - node = tempNode; - return; - } - if (elementRule.paddEmpty && (isPaddedWithNbsp(node) || isEmpty$2(schema, nonEmptyElements, whiteSpaceElements, node))) { - paddEmptyNode(settings, args, blockElements, node); - } - node = node.parent; - } - } - }, schema); - var rootNode = node = new AstNode(args.context || settings.root_name, 11); - parser.parse(html, args.format); - if (validate && invalidChildren.length) { - if (!args.context) { - fixInvalidChildren(invalidChildren); - } else { - args.invalid = true; - } - } - if (rootBlockName && (rootNode.name === 'body' || args.isRootContent)) { - addRootBlocks(); - } - if (!args.invalid) { - for (name in matchedNodes) { - if (!matchedNodes.hasOwnProperty(name)) { - continue; - } - list = nodeFilters[name]; - nodes = matchedNodes[name]; - fi = nodes.length; - while (fi--) { - if (!nodes[fi].parent) { - nodes.splice(fi, 1); - } - } - for (i = 0, l = list.length; i < l; i++) { - list[i](nodes, name, args); - } - } - for (i = 0, l = attributeFilters.length; i < l; i++) { - list = attributeFilters[i]; - if (list.name in matchedAttributes) { - nodes = matchedAttributes[list.name]; - fi = nodes.length; - while (fi--) { - if (!nodes[fi].parent) { - nodes.splice(fi, 1); - } - } - for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) { - list.callbacks[fi](nodes, list.name, args); - } - } - } - } - return rootNode; - }; - var exports = { - schema: schema, - addAttributeFilter: addAttributeFilter, - getAttributeFilters: getAttributeFilters, - addNodeFilter: addNodeFilter, - getNodeFilters: getNodeFilters, - filterNode: filterNode, - parse: parse - }; - register$2(exports, settings); - register$1(exports, settings); - return exports; - }; - - var register$3 = function (htmlParser, settings, dom) { - htmlParser.addAttributeFilter('data-mce-tabindex', function (nodes, name) { - var i = nodes.length, node; - while (i--) { - node = nodes[i]; - node.attr('tabindex', node.attr('data-mce-tabindex')); - node.attr(name, null); - } - }); - htmlParser.addAttributeFilter('src,href,style', function (nodes, name) { - var i = nodes.length, node, value; - var internalName = 'data-mce-' + name; - var urlConverter = settings.url_converter; - var urlConverterScope = settings.url_converter_scope; - while (i--) { - node = nodes[i]; - value = node.attr(internalName); - if (value !== undefined) { - node.attr(name, value.length > 0 ? value : null); - node.attr(internalName, null); - } else { - value = node.attr(name); - if (name === 'style') { - value = dom.serializeStyle(dom.parseStyle(value), node.name); - } else if (urlConverter) { - value = urlConverter.call(urlConverterScope, value, name, node.name); - } - node.attr(name, value.length > 0 ? value : null); - } - } - }); - htmlParser.addAttributeFilter('class', function (nodes) { - var i = nodes.length, node, value; - while (i--) { - node = nodes[i]; - value = node.attr('class'); - if (value) { - value = node.attr('class').replace(/(?:^|\s)mce-item-\w+(?!\S)/g, ''); - node.attr('class', value.length > 0 ? value : null); - } - } - }); - htmlParser.addAttributeFilter('data-mce-type', function (nodes, name, args) { - var i = nodes.length, node; - while (i--) { - node = nodes[i]; - if (node.attr('data-mce-type') === 'bookmark' && !args.cleanup) { - var hasChildren = Optional.from(node.firstChild).exists(function (firstChild) { - return !isZwsp$1(firstChild.value); - }); - if (hasChildren) { - node.unwrap(); - } else { - node.remove(); - } - } - } - }); - htmlParser.addNodeFilter('noscript', function (nodes) { - var i = nodes.length, node; - while (i--) { - node = nodes[i].firstChild; - if (node) { - node.value = Entities.decode(node.value); - } - } - }); - htmlParser.addNodeFilter('script,style', function (nodes, name) { - var i = nodes.length, node, value, type; - var trim = function (value) { - return value.replace(/()/g, '\n').replace(/^[\r\n]*|[\r\n]*$/g, '').replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g, ''); - }; - while (i--) { - node = nodes[i]; - value = node.firstChild ? node.firstChild.value : ''; - if (name === 'script') { - type = node.attr('type'); - if (type) { - node.attr('type', type === 'mce-no/type' ? null : type.replace(/^mce\-/, '')); - } - if (settings.element_format === 'xhtml' && value.length > 0) { - node.firstChild.value = '// '; - } - } else { - if (settings.element_format === 'xhtml' && value.length > 0) { - node.firstChild.value = ''; - } - } + while (i--) { + node = nodes[i]; + value = node.firstChild ? node.firstChild.value : ''; + if (name === 'script') { + type = node.attr('type'); + if (type) { + node.attr('type', type === 'mce-no/type' ? null : type.replace(/^mce\-/, '')); } - }); - htmlParser.addNodeFilter('#comment', function (nodes) { - var i = nodes.length, node; - while (i--) { - node = nodes[i]; - if (settings.preserve_cdata && node.value.indexOf('[CDATA[') === 0) { - node.name = '#cdata'; - node.type = 4; - node.value = dom.decode(node.value.replace(/^\[CDATA\[|\]\]$/g, '')); - } else if (node.value.indexOf('mce:protected ') === 0) { - node.name = '#text'; - node.type = 3; - node.raw = true; - node.value = unescape(node.value).substr(14); - } + if (settings.element_format === 'xhtml' && value.length > 0) { + node.firstChild.value = '// '; } - }); - htmlParser.addNodeFilter('xml:namespace,input', function (nodes, name) { - var i = nodes.length, node; - while (i--) { - node = nodes[i]; - if (node.type === 7) { - node.remove(); - } else if (node.type === 1) { - if (name === 'input' && !node.attr('type')) { - node.attr('type', 'text'); - } - } + } else { + if (settings.element_format === 'xhtml' && value.length > 0) { + node.firstChild.value = ''; } - }); - htmlParser.addAttributeFilter('data-mce-type', function (nodes) { - each(nodes, function (node) { - if (node.attr('data-mce-type') === 'format-caret') { - if (node.isEmpty(htmlParser.schema.getNonEmptyElements())) { - node.remove(); - } else { - node.unwrap(); - } - } - }); - }); - htmlParser.addAttributeFilter('data-mce-src,data-mce-href,data-mce-style,' + 'data-mce-selected,data-mce-expando,' + 'data-mce-type,data-mce-resize,data-mce-placeholder', function (nodes, name) { - var i = nodes.length; - while (i--) { - nodes[i].attr(name, null); + } + } + }); + htmlParser.addNodeFilter('#comment', function (nodes) { + var i = nodes.length, node; + while (i--) { + node = nodes[i]; + if (settings.preserve_cdata && node.value.indexOf('[CDATA[') === 0) { + node.name = '#cdata'; + node.type = 4; + node.value = dom.decode(node.value.replace(/^\[CDATA\[|\]\]$/g, '')); + } else if (node.value.indexOf('mce:protected ') === 0) { + node.name = '#text'; + node.type = 3; + node.raw = true; + node.value = unescape(node.value).substr(14); + } + } + }); + htmlParser.addNodeFilter('xml:namespace,input', function (nodes, name) { + var i = nodes.length, node; + while (i--) { + node = nodes[i]; + if (node.type === 7) { + node.remove(); + } else if (node.type === 1) { + if (name === 'input' && !node.attr('type')) { + node.attr('type', 'text'); + } + } + } + }); + htmlParser.addAttributeFilter('data-mce-type', function (nodes) { + each(nodes, function (node) { + if (node.attr('data-mce-type') === 'format-caret') { + if (node.isEmpty(htmlParser.schema.getNonEmptyElements())) { + node.remove(); + } else { + node.unwrap(); } + } }); + }); + htmlParser.addAttributeFilter('data-mce-src,data-mce-href,data-mce-style,' + 'data-mce-selected,data-mce-expando,' + 'data-mce-type,data-mce-resize,data-mce-placeholder', function (nodes, name) { + var i = nodes.length; + while (i--) { + nodes[i].attr(name, null); + } + }); }; var trimTrailingBr = function (rootNode) { - var isBr = function (node) { - return node && node.name === 'br'; - }; - var brNode1 = rootNode.lastChild; - if (isBr(brNode1)) { - var brNode2 = brNode1.prev; - if (isBr(brNode2)) { - brNode1.remove(); - brNode2.remove(); - } + var isBr = function (node) { + return node && node.name === 'br'; + }; + var brNode1 = rootNode.lastChild; + if (isBr(brNode1)) { + var brNode2 = brNode1.prev; + if (isBr(brNode2)) { + brNode1.remove(); + brNode2.remove(); } + } }; var preProcess = function (editor, node, args) { - var doc, oldDoc; - var dom = editor.dom; - node = node.cloneNode(true); - var impl = document.implementation; - if (impl.createHTMLDocument) { - doc = impl.createHTMLDocument(''); - Tools.each(node.nodeName === 'BODY' ? node.childNodes : [node], function (node) { - doc.body.appendChild(doc.importNode(node, true)); - }); - if (node.nodeName !== 'BODY') { - node = doc.body.firstChild; - } else { - node = doc.body; - } - oldDoc = dom.doc; - dom.doc = doc; - } - firePreProcess(editor, __assign(__assign({}, args), {node: node})); - if (oldDoc) { - dom.doc = oldDoc; + var doc, oldDoc; + var dom = editor.dom; + node = node.cloneNode(true); + var impl = document.implementation; + if (impl.createHTMLDocument) { + doc = impl.createHTMLDocument(''); + Tools.each(node.nodeName === 'BODY' ? node.childNodes : [node], function (node) { + doc.body.appendChild(doc.importNode(node, true)); + }); + if (node.nodeName !== 'BODY') { + node = doc.body.firstChild; + } else { + node = doc.body; } - return node; + oldDoc = dom.doc; + dom.doc = doc; + } + firePreProcess(editor, __assign(__assign({}, args), { node: node })); + if (oldDoc) { + dom.doc = oldDoc; + } + return node; }; var shouldFireEvent = function (editor, args) { - return editor && editor.hasEventListeners('PreProcess') && !args.no_events; + return editor && editor.hasEventListeners('PreProcess') && !args.no_events; }; var process = function (editor, node, args) { - return shouldFireEvent(editor, args) ? preProcess(editor, node, args) : node; + return shouldFireEvent(editor, args) ? preProcess(editor, node, args) : node; }; var addTempAttr = function (htmlParser, tempAttrs, name) { - if (Tools.inArray(tempAttrs, name) === -1) { - htmlParser.addAttributeFilter(name, function (nodes, name) { - var i = nodes.length; - while (i--) { - nodes[i].attr(name, null); - } - }); - tempAttrs.push(name); - } + if (Tools.inArray(tempAttrs, name) === -1) { + htmlParser.addAttributeFilter(name, function (nodes, name) { + var i = nodes.length; + while (i--) { + nodes[i].attr(name, null); + } + }); + tempAttrs.push(name); + } }; var postProcess$1 = function (editor, args, content) { - if (!args.no_events && editor) { - var outArgs = firePostProcess(editor, __assign(__assign({}, args), {content: content})); - return outArgs.content; - } else { - return content; - } + if (!args.no_events && editor) { + var outArgs = firePostProcess(editor, __assign(__assign({}, args), { content: content })); + return outArgs.content; + } else { + return content; + } }; var getHtmlFromNode = function (dom, node, args) { - var html = trim$2(args.getInner ? node.innerHTML : dom.getOuterHTML(node)); - return args.selection || isWsPreserveElement(SugarElement.fromDom(node)) ? html : Tools.trim(html); + var html = trim$2(args.getInner ? node.innerHTML : dom.getOuterHTML(node)); + return args.selection || isWsPreserveElement(SugarElement.fromDom(node)) ? html : Tools.trim(html); }; var parseHtml = function (htmlParser, html, args) { - var parserArgs = args.selection ? __assign({forced_root_block: false}, args) : args; - var rootNode = htmlParser.parse(html, parserArgs); - trimTrailingBr(rootNode); - return rootNode; + var parserArgs = args.selection ? __assign({ forced_root_block: false }, args) : args; + var rootNode = htmlParser.parse(html, parserArgs); + trimTrailingBr(rootNode); + return rootNode; }; var serializeNode = function (settings, schema, node) { - var htmlSerializer = HtmlSerializer(settings, schema); - return htmlSerializer.serialize(node); + var htmlSerializer = HtmlSerializer(settings, schema); + return htmlSerializer.serialize(node); }; var toHtml = function (editor, settings, schema, rootNode, args) { - var content = serializeNode(settings, schema, rootNode); - return postProcess$1(editor, args, content); + var content = serializeNode(settings, schema, rootNode); + return postProcess$1(editor, args, content); }; var DomSerializerImpl = function (settings, editor) { - var tempAttrs = ['data-mce-selected']; - var dom = editor && editor.dom ? editor.dom : DOMUtils$1.DOM; - var schema = editor && editor.schema ? editor.schema : Schema(settings); - settings.entity_encoding = settings.entity_encoding || 'named'; - settings.remove_trailing_brs = 'remove_trailing_brs' in settings ? settings.remove_trailing_brs : true; - var htmlParser = DomParser(settings, schema); - register$3(htmlParser, settings, dom); - var serialize = function (node, parserArgs) { - if (parserArgs === void 0) { - parserArgs = {}; - } - var args = __assign({format: 'html'}, parserArgs); - var targetNode = process(editor, node, args); - var html = getHtmlFromNode(dom, targetNode, args); - var rootNode = parseHtml(htmlParser, html, args); - return args.format === 'tree' ? rootNode : toHtml(editor, settings, schema, rootNode, args); - }; - return { - schema: schema, - addNodeFilter: htmlParser.addNodeFilter, - addAttributeFilter: htmlParser.addAttributeFilter, - serialize: serialize, - addRules: function (rules) { - schema.addValidElements(rules); - }, - setRules: function (rules) { - schema.setValidElements(rules); - }, - addTempAttr: curry(addTempAttr, htmlParser, tempAttrs), - getTempAttrs: function () { - return tempAttrs; - }, - getNodeFilters: htmlParser.getNodeFilters, - getAttributeFilters: htmlParser.getAttributeFilters - }; + var tempAttrs = ['data-mce-selected']; + var dom = editor && editor.dom ? editor.dom : DOMUtils$1.DOM; + var schema = editor && editor.schema ? editor.schema : Schema(settings); + settings.entity_encoding = settings.entity_encoding || 'named'; + settings.remove_trailing_brs = 'remove_trailing_brs' in settings ? settings.remove_trailing_brs : true; + var htmlParser = DomParser(settings, schema); + register$3(htmlParser, settings, dom); + var serialize = function (node, parserArgs) { + if (parserArgs === void 0) { + parserArgs = {}; + } + var args = __assign({ format: 'html' }, parserArgs); + var targetNode = process(editor, node, args); + var html = getHtmlFromNode(dom, targetNode, args); + var rootNode = parseHtml(htmlParser, html, args); + return args.format === 'tree' ? rootNode : toHtml(editor, settings, schema, rootNode, args); + }; + return { + schema: schema, + addNodeFilter: htmlParser.addNodeFilter, + addAttributeFilter: htmlParser.addAttributeFilter, + serialize: serialize, + addRules: function (rules) { + schema.addValidElements(rules); + }, + setRules: function (rules) { + schema.setValidElements(rules); + }, + addTempAttr: curry(addTempAttr, htmlParser, tempAttrs), + getTempAttrs: function () { + return tempAttrs; + }, + getNodeFilters: htmlParser.getNodeFilters, + getAttributeFilters: htmlParser.getAttributeFilters + }; }; var DomSerializer = function (settings, editor) { - var domSerializer = DomSerializerImpl(settings, editor); - return { - schema: domSerializer.schema, - addNodeFilter: domSerializer.addNodeFilter, - addAttributeFilter: domSerializer.addAttributeFilter, - serialize: domSerializer.serialize, - addRules: domSerializer.addRules, - setRules: domSerializer.setRules, - addTempAttr: domSerializer.addTempAttr, - getTempAttrs: domSerializer.getTempAttrs, - getNodeFilters: domSerializer.getNodeFilters, - getAttributeFilters: domSerializer.getAttributeFilters - }; + var domSerializer = DomSerializerImpl(settings, editor); + return { + schema: domSerializer.schema, + addNodeFilter: domSerializer.addNodeFilter, + addAttributeFilter: domSerializer.addAttributeFilter, + serialize: domSerializer.serialize, + addRules: domSerializer.addRules, + setRules: domSerializer.setRules, + addTempAttr: domSerializer.addTempAttr, + getTempAttrs: domSerializer.getTempAttrs, + getNodeFilters: domSerializer.getNodeFilters, + getAttributeFilters: domSerializer.getAttributeFilters + }; }; var defaultFormat$1 = 'html'; var getContent$2 = function (editor, args) { - if (args === void 0) { - args = {}; - } - var format = args.format ? args.format : defaultFormat$1; - return getContent(editor, args, format); + if (args === void 0) { + args = {}; + } + var format = args.format ? args.format : defaultFormat$1; + return getContent(editor, args, format); }; var setContent$2 = function (editor, content, args) { - if (args === void 0) { - args = {}; - } - return setContent(editor, content, args); + if (args === void 0) { + args = {}; + } + return setContent(editor, content, args); }; var DOM$3 = DOMUtils$1.DOM; var restoreOriginalStyles = function (editor) { - DOM$3.setStyle(editor.id, 'display', editor.orgDisplay); + DOM$3.setStyle(editor.id, 'display', editor.orgDisplay); }; var safeDestroy = function (x) { - return Optional.from(x).each(function (x) { - return x.destroy(); - }); + return Optional.from(x).each(function (x) { + return x.destroy(); + }); }; var clearDomReferences = function (editor) { - editor.contentAreaContainer = editor.formElement = editor.container = editor.editorContainer = null; - editor.bodyElement = editor.contentDocument = editor.contentWindow = null; - editor.iframeElement = editor.targetElm = null; - if (editor.selection) { - editor.selection = editor.selection.win = editor.selection.dom = editor.selection.dom.doc = null; - } + editor.contentAreaContainer = editor.formElement = editor.container = editor.editorContainer = null; + editor.bodyElement = editor.contentDocument = editor.contentWindow = null; + editor.iframeElement = editor.targetElm = null; + if (editor.selection) { + editor.selection = editor.selection.win = editor.selection.dom = editor.selection.dom.doc = null; + } }; var restoreForm = function (editor) { - var form = editor.formElement; - if (form) { - if (form._mceOldSubmit) { - form.submit = form._mceOldSubmit; - form._mceOldSubmit = null; - } - DOM$3.unbind(form, 'submit reset', editor.formEventDelegate); + var form = editor.formElement; + if (form) { + if (form._mceOldSubmit) { + form.submit = form._mceOldSubmit; + form._mceOldSubmit = null; } + DOM$3.unbind(form, 'submit reset', editor.formEventDelegate); + } }; var remove$7 = function (editor) { - if (!editor.removed) { - var _selectionOverrides = editor._selectionOverrides, editorUpload = editor.editorUpload; - var body = editor.getBody(); - var element = editor.getElement(); - if (body) { - editor.save({is_removing: true}); - } - editor.removed = true; - editor.unbindAllNativeEvents(); - if (editor.hasHiddenInput && element) { - DOM$3.remove(element.nextSibling); - } - fireRemove(editor); - editor.editorManager.remove(editor); - if (!editor.inline && body) { - restoreOriginalStyles(editor); - } - fireDetach(editor); - DOM$3.remove(editor.getContainer()); - safeDestroy(_selectionOverrides); - safeDestroy(editorUpload); - editor.destroy(); - } + if (!editor.removed) { + var _selectionOverrides = editor._selectionOverrides, editorUpload = editor.editorUpload; + var body = editor.getBody(); + var element = editor.getElement(); + if (body) { + editor.save({ is_removing: true }); + } + editor.removed = true; + editor.unbindAllNativeEvents(); + if (editor.hasHiddenInput && element) { + DOM$3.remove(element.nextSibling); + } + fireRemove(editor); + editor.editorManager.remove(editor); + if (!editor.inline && body) { + restoreOriginalStyles(editor); + } + fireDetach(editor); + DOM$3.remove(editor.getContainer()); + safeDestroy(_selectionOverrides); + safeDestroy(editorUpload); + editor.destroy(); + } }; var destroy = function (editor, automatic) { - var selection = editor.selection, dom = editor.dom; - if (editor.destroyed) { - return; - } - if (!automatic && !editor.removed) { - editor.remove(); - return; - } - if (!automatic) { - editor.editorManager.off('beforeunload', editor._beforeUnload); - if (editor.theme && editor.theme.destroy) { - editor.theme.destroy(); - } - safeDestroy(selection); - safeDestroy(dom); - } - restoreForm(editor); - clearDomReferences(editor); - editor.destroyed = true; + var selection = editor.selection, dom = editor.dom; + if (editor.destroyed) { + return; + } + if (!automatic && !editor.removed) { + editor.remove(); + return; + } + if (!automatic) { + editor.editorManager.off('beforeunload', editor._beforeUnload); + if (editor.theme && editor.theme.destroy) { + editor.theme.destroy(); + } + safeDestroy(selection); + safeDestroy(dom); + } + restoreForm(editor); + clearDomReferences(editor); + editor.destroyed = true; }; var hasOwnProperty$2 = Object.prototype.hasOwnProperty; var deep$1 = function (old, nu) { - var bothObjects = isObject(old) && isObject(nu); - return bothObjects ? deepMerge(old, nu) : nu; + var bothObjects = isObject(old) && isObject(nu); + return bothObjects ? deepMerge(old, nu) : nu; }; var baseMerge = function (merger) { - return function () { - var objects = new Array(arguments.length); - for (var i = 0; i < objects.length; i++) { - objects[i] = arguments[i]; - } - if (objects.length === 0) { - throw new Error('Can\'t merge zero objects'); - } - var ret = {}; - for (var j = 0; j < objects.length; j++) { - var curObject = objects[j]; - for (var key in curObject) { - if (hasOwnProperty$2.call(curObject, key)) { - ret[key] = merger(ret[key], curObject[key]); - } - } + return function () { + var objects = new Array(arguments.length); + for (var i = 0; i < objects.length; i++) { + objects[i] = arguments[i]; + } + if (objects.length === 0) { + throw new Error('Can\'t merge zero objects'); + } + var ret = {}; + for (var j = 0; j < objects.length; j++) { + var curObject = objects[j]; + for (var key in curObject) { + if (hasOwnProperty$2.call(curObject, key)) { + ret[key] = merger(ret[key], curObject[key]); } - return ret; - }; + } + } + return ret; + }; }; var deepMerge = baseMerge(deep$1); var sectionResult = function (sections, settings) { - return { - sections: constant(sections), - settings: constant(settings) - }; + return { + sections: constant(sections), + settings: constant(settings) + }; }; var deviceDetection = detect$3().deviceType; var isTouch = deviceDetection.isTouch(); var isPhone = deviceDetection.isPhone(); var isTablet = deviceDetection.isTablet(); var legacyMobilePlugins = [ - 'lists', - 'autolink', - 'autosave' + 'lists', + 'autolink', + 'autosave' ]; var defaultTouchSettings = { - table_grid: false, - object_resizing: false, - resize: false + table_grid: false, + object_resizing: false, + resize: false }; var normalizePlugins = function (plugins) { - var pluginNames = isArray(plugins) ? plugins.join(' ') : plugins; - var trimmedPlugins = map(isString(pluginNames) ? pluginNames.split(' ') : [], trim); - return filter(trimmedPlugins, function (item) { - return item.length > 0; - }); + var pluginNames = isArray(plugins) ? plugins.join(' ') : plugins; + var trimmedPlugins = map(isString(pluginNames) ? pluginNames.split(' ') : [], trim); + return filter(trimmedPlugins, function (item) { + return item.length > 0; + }); }; var filterLegacyMobilePlugins = function (plugins) { - return filter(plugins, curry(contains, legacyMobilePlugins)); + return filter(plugins, curry(contains, legacyMobilePlugins)); }; var extractSections = function (keys, settings) { - var result = bifilter(settings, function (value, key) { - return contains(keys, key); - }); - return sectionResult(result.t, result.f); + var result = bifilter(settings, function (value, key) { + return contains(keys, key); + }); + return sectionResult(result.t, result.f); }; var getSection = function (sectionResult, name, defaults) { - if (defaults === void 0) { - defaults = {}; - } - var sections = sectionResult.sections(); - var sectionSettings = sections.hasOwnProperty(name) ? sections[name] : {}; - return Tools.extend({}, defaults, sectionSettings); + if (defaults === void 0) { + defaults = {}; + } + var sections = sectionResult.sections(); + var sectionSettings = sections.hasOwnProperty(name) ? sections[name] : {}; + return Tools.extend({}, defaults, sectionSettings); }; var hasSection = function (sectionResult, name) { - return sectionResult.sections().hasOwnProperty(name); + return sectionResult.sections().hasOwnProperty(name); }; var isSectionTheme = function (sectionResult, name, theme) { - var section = sectionResult.sections(); - return hasSection(sectionResult, name) && section[name].theme === theme; + var section = sectionResult.sections(); + return hasSection(sectionResult, name) && section[name].theme === theme; }; var getSectionConfig = function (sectionResult, name) { - return hasSection(sectionResult, name) ? sectionResult.sections()[name] : {}; + return hasSection(sectionResult, name) ? sectionResult.sections()[name] : {}; }; var getToolbarMode = function (settings, defaultVal) { - return get$1(settings, 'toolbar_mode').orThunk(function () { - return get$1(settings, 'toolbar_drawer').map(function (val) { - return val === false ? 'wrap' : val; - }); - }).getOr(defaultVal); + return get$1(settings, 'toolbar_mode').orThunk(function () { + return get$1(settings, 'toolbar_drawer').map(function (val) { + return val === false ? 'wrap' : val; + }); + }).getOr(defaultVal); }; var getDefaultSettings = function (settings, id, documentBaseUrl, isTouch, editor) { - var baseDefaults = { - id: id, - theme: 'silver', - toolbar_mode: getToolbarMode(settings, 'floating'), - plugins: '', - document_base_url: documentBaseUrl, - add_form_submit_trigger: true, - submit_patch: true, - add_unload_trigger: true, - convert_urls: true, - relative_urls: true, - remove_script_host: true, - object_resizing: true, - doctype: '', - visual: true, - font_size_legacy_values: 'xx-small,small,medium,large,x-large,xx-large,300%', - forced_root_block: 'p', - hidden_input: true, - inline_styles: true, - convert_fonts_to_spans: true, - indent: true, - indent_before: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' + 'tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist', - indent_after: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' + 'tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist', - entity_encoding: 'named', - url_converter: editor.convertURL, - url_converter_scope: editor - }; - return __assign(__assign({}, baseDefaults), isTouch ? defaultTouchSettings : {}); + var baseDefaults = { + id: id, + theme: 'silver', + toolbar_mode: getToolbarMode(settings, 'floating'), + plugins: '', + document_base_url: documentBaseUrl, + add_form_submit_trigger: true, + submit_patch: true, + add_unload_trigger: true, + convert_urls: true, + relative_urls: true, + remove_script_host: true, + object_resizing: true, + doctype: '', + visual: true, + font_size_legacy_values: 'xx-small,small,medium,large,x-large,xx-large,300%', + forced_root_block: 'p', + hidden_input: true, + inline_styles: true, + convert_fonts_to_spans: true, + indent: true, + indent_before: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' + 'tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist', + indent_after: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' + 'tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist', + entity_encoding: 'named', + url_converter: editor.convertURL, + url_converter_scope: editor + }; + return __assign(__assign({}, baseDefaults), isTouch ? defaultTouchSettings : {}); }; var getDefaultMobileSettings = function (mobileSettings, isPhone) { - var defaultMobileSettings = { - resize: false, - toolbar_mode: getToolbarMode(mobileSettings, 'scrolling'), - toolbar_sticky: false - }; - var defaultPhoneSettings = {menubar: false}; - return __assign(__assign(__assign({}, defaultTouchSettings), defaultMobileSettings), isPhone ? defaultPhoneSettings : {}); + var defaultMobileSettings = { + resize: false, + toolbar_mode: getToolbarMode(mobileSettings, 'scrolling'), + toolbar_sticky: false + }; + var defaultPhoneSettings = { menubar: false }; + return __assign(__assign(__assign({}, defaultTouchSettings), defaultMobileSettings), isPhone ? defaultPhoneSettings : {}); }; var getExternalPlugins$1 = function (overrideSettings, settings) { - var userDefinedExternalPlugins = settings.external_plugins ? settings.external_plugins : {}; - if (overrideSettings && overrideSettings.external_plugins) { - return Tools.extend({}, overrideSettings.external_plugins, userDefinedExternalPlugins); - } else { - return userDefinedExternalPlugins; - } + var userDefinedExternalPlugins = settings.external_plugins ? settings.external_plugins : {}; + if (overrideSettings && overrideSettings.external_plugins) { + return Tools.extend({}, overrideSettings.external_plugins, userDefinedExternalPlugins); + } else { + return userDefinedExternalPlugins; + } }; var combinePlugins = function (forcedPlugins, plugins) { - return [].concat(normalizePlugins(forcedPlugins)).concat(normalizePlugins(plugins)); + return [].concat(normalizePlugins(forcedPlugins)).concat(normalizePlugins(plugins)); }; var getPlatformPlugins = function (isMobileDevice, sectionResult, desktopPlugins, mobilePlugins) { - if (isMobileDevice && isSectionTheme(sectionResult, 'mobile', 'mobile')) { - return filterLegacyMobilePlugins(mobilePlugins); - } else if (isMobileDevice && hasSection(sectionResult, 'mobile')) { - return mobilePlugins; - } else { - return desktopPlugins; - } + if (isMobileDevice && isSectionTheme(sectionResult, 'mobile', 'mobile')) { + return filterLegacyMobilePlugins(mobilePlugins); + } else if (isMobileDevice && hasSection(sectionResult, 'mobile')) { + return mobilePlugins; + } else { + return desktopPlugins; + } }; var processPlugins = function (isMobileDevice, sectionResult, defaultOverrideSettings, settings) { - var forcedPlugins = normalizePlugins(defaultOverrideSettings.forced_plugins); - var desktopPlugins = normalizePlugins(settings.plugins); - var mobileConfig = getSectionConfig(sectionResult, 'mobile'); - var mobilePlugins = mobileConfig.plugins ? normalizePlugins(mobileConfig.plugins) : desktopPlugins; - var platformPlugins = getPlatformPlugins(isMobileDevice, sectionResult, desktopPlugins, mobilePlugins); - var combinedPlugins = combinePlugins(forcedPlugins, platformPlugins); - if (Env.browser.isIE() && contains(combinedPlugins, 'rtc')) { - throw new Error('RTC plugin is not supported on IE 11.'); - } - return Tools.extend(settings, {plugins: combinedPlugins.join(' ')}); + var forcedPlugins = normalizePlugins(defaultOverrideSettings.forced_plugins); + var desktopPlugins = normalizePlugins(settings.plugins); + var mobileConfig = getSectionConfig(sectionResult, 'mobile'); + var mobilePlugins = mobileConfig.plugins ? normalizePlugins(mobileConfig.plugins) : desktopPlugins; + var platformPlugins = getPlatformPlugins(isMobileDevice, sectionResult, desktopPlugins, mobilePlugins); + var combinedPlugins = combinePlugins(forcedPlugins, platformPlugins); + if (Env.browser.isIE() && contains(combinedPlugins, 'rtc')) { + throw new Error('RTC plugin is not supported on IE 11.'); + } + return Tools.extend(settings, { plugins: combinedPlugins.join(' ') }); }; var isOnMobile = function (isMobileDevice, sectionResult) { - return isMobileDevice && hasSection(sectionResult, 'mobile'); + return isMobileDevice && hasSection(sectionResult, 'mobile'); }; var combineSettings = function (isMobileDevice, isPhone, defaultSettings, defaultOverrideSettings, settings) { - var defaultDeviceSettings = isMobileDevice ? {mobile: getDefaultMobileSettings(settings.mobile || {}, isPhone)} : {}; - var sectionResult = extractSections(['mobile'], deepMerge(defaultDeviceSettings, settings)); - var extendedSettings = Tools.extend(defaultSettings, defaultOverrideSettings, sectionResult.settings(), isOnMobile(isMobileDevice, sectionResult) ? getSection(sectionResult, 'mobile') : {}, { - validate: true, - external_plugins: getExternalPlugins$1(defaultOverrideSettings, sectionResult.settings()) - }); - return processPlugins(isMobileDevice, sectionResult, defaultOverrideSettings, extendedSettings); + var defaultDeviceSettings = isMobileDevice ? { mobile: getDefaultMobileSettings(settings.mobile || {}, isPhone) } : {}; + var sectionResult = extractSections(['mobile'], deepMerge(defaultDeviceSettings, settings)); + var extendedSettings = Tools.extend(defaultSettings, defaultOverrideSettings, sectionResult.settings(), isOnMobile(isMobileDevice, sectionResult) ? getSection(sectionResult, 'mobile') : {}, { + validate: true, + external_plugins: getExternalPlugins$1(defaultOverrideSettings, sectionResult.settings()) + }); + return processPlugins(isMobileDevice, sectionResult, defaultOverrideSettings, extendedSettings); }; var getEditorSettings = function (editor, id, documentBaseUrl, defaultOverrideSettings, settings) { - var defaultSettings = getDefaultSettings(settings, id, documentBaseUrl, isTouch, editor); - return combineSettings(isPhone || isTablet, isPhone, defaultSettings, defaultOverrideSettings, settings); + var defaultSettings = getDefaultSettings(settings, id, documentBaseUrl, isTouch, editor); + return combineSettings(isPhone || isTablet, isPhone, defaultSettings, defaultOverrideSettings, settings); }; var getFiltered = function (predicate, editor, name) { - return Optional.from(editor.settings[name]).filter(predicate); + return Optional.from(editor.settings[name]).filter(predicate); }; var getParamObject = function (value) { - var output = {}; - if (typeof value === 'string') { - each(value.indexOf('=') > 0 ? value.split(/[;,](?![^=;,]*(?:[;,]|$))/) : value.split(','), function (val) { - var arr = val.split('='); - if (arr.length > 1) { - output[Tools.trim(arr[0])] = Tools.trim(arr[1]); - } else { - output[Tools.trim(arr[0])] = Tools.trim(arr[0]); - } - }); - } else { - output = value; - } - return output; + var output = {}; + if (typeof value === 'string') { + each(value.indexOf('=') > 0 ? value.split(/[;,](?![^=;,]*(?:[;,]|$))/) : value.split(','), function (val) { + var arr = val.split('='); + if (arr.length > 1) { + output[Tools.trim(arr[0])] = Tools.trim(arr[1]); + } else { + output[Tools.trim(arr[0])] = Tools.trim(arr[0]); + } + }); + } else { + output = value; + } + return output; }; var isArrayOf = function (p) { - return function (a) { - return isArray(a) && forall(a, p); - }; + return function (a) { + return isArray(a) && forall(a, p); + }; }; var getParam = function (editor, name, defaultVal, type) { - var value = name in editor.settings ? editor.settings[name] : defaultVal; - if (type === 'hash') { - return getParamObject(value); - } else if (type === 'string') { - return getFiltered(isString, editor, name).getOr(defaultVal); - } else if (type === 'number') { - return getFiltered(isNumber, editor, name).getOr(defaultVal); - } else if (type === 'boolean') { - return getFiltered(isBoolean, editor, name).getOr(defaultVal); - } else if (type === 'object') { - return getFiltered(isObject, editor, name).getOr(defaultVal); - } else if (type === 'array') { - return getFiltered(isArray, editor, name).getOr(defaultVal); - } else if (type === 'string[]') { - return getFiltered(isArrayOf(isString), editor, name).getOr(defaultVal); - } else if (type === 'function') { - return getFiltered(isFunction, editor, name).getOr(defaultVal); - } else { - return value; - } + var value = name in editor.settings ? editor.settings[name] : defaultVal; + if (type === 'hash') { + return getParamObject(value); + } else if (type === 'string') { + return getFiltered(isString, editor, name).getOr(defaultVal); + } else if (type === 'number') { + return getFiltered(isNumber, editor, name).getOr(defaultVal); + } else if (type === 'boolean') { + return getFiltered(isBoolean, editor, name).getOr(defaultVal); + } else if (type === 'object') { + return getFiltered(isObject, editor, name).getOr(defaultVal); + } else if (type === 'array') { + return getFiltered(isArray, editor, name).getOr(defaultVal); + } else if (type === 'string[]') { + return getFiltered(isArrayOf(isString), editor, name).getOr(defaultVal); + } else if (type === 'function') { + return getFiltered(isFunction, editor, name).getOr(defaultVal); + } else { + return value; + } }; var CreateIconManager = function () { - var lookup = {}; - var add = function (id, iconPack) { - lookup[id] = iconPack; - }; - var get = function (id) { - if (lookup[id]) { - return lookup[id]; - } - return {icons: {}}; - }; - var has$1 = function (id) { - return has(lookup, id); - }; - return { - add: add, - get: get, - has: has$1 - }; + var lookup = {}; + var add = function (id, iconPack) { + lookup[id] = iconPack; + }; + var get = function (id) { + if (lookup[id]) { + return lookup[id]; + } + return { icons: {} }; + }; + var has$1 = function (id) { + return has(lookup, id); + }; + return { + add: add, + get: get, + has: has$1 + }; }; var IconManager = CreateIconManager(); var getProp = function (propName, elm) { - var rawElm = elm.dom; - return rawElm[propName]; + var rawElm = elm.dom; + return rawElm[propName]; }; var getComputedSizeProp = function (propName, elm) { - return parseInt(get$5(elm, propName), 10); + return parseInt(get$5(elm, propName), 10); }; var getClientWidth = curry(getProp, 'clientWidth'); var getClientHeight = curry(getProp, 'clientHeight'); var getMarginTop = curry(getComputedSizeProp, 'margin-top'); var getMarginLeft = curry(getComputedSizeProp, 'margin-left'); var getBoundingClientRect$1 = function (elm) { - return elm.dom.getBoundingClientRect(); + return elm.dom.getBoundingClientRect(); }; var isInsideElementContentArea = function (bodyElm, clientX, clientY) { - var clientWidth = getClientWidth(bodyElm); - var clientHeight = getClientHeight(bodyElm); - return clientX >= 0 && clientY >= 0 && clientX <= clientWidth && clientY <= clientHeight; + var clientWidth = getClientWidth(bodyElm); + var clientHeight = getClientHeight(bodyElm); + return clientX >= 0 && clientY >= 0 && clientX <= clientWidth && clientY <= clientHeight; }; var transpose = function (inline, elm, clientX, clientY) { - var clientRect = getBoundingClientRect$1(elm); - var deltaX = inline ? clientRect.left + elm.dom.clientLeft + getMarginLeft(elm) : 0; - var deltaY = inline ? clientRect.top + elm.dom.clientTop + getMarginTop(elm) : 0; - var x = clientX - deltaX; - var y = clientY - deltaY; - return { - x: x, - y: y - }; + var clientRect = getBoundingClientRect$1(elm); + var deltaX = inline ? clientRect.left + elm.dom.clientLeft + getMarginLeft(elm) : 0; + var deltaY = inline ? clientRect.top + elm.dom.clientTop + getMarginTop(elm) : 0; + var x = clientX - deltaX; + var y = clientY - deltaY; + return { + x: x, + y: y + }; }; var isXYInContentArea = function (editor, clientX, clientY) { - var bodyElm = SugarElement.fromDom(editor.getBody()); - var targetElm = editor.inline ? bodyElm : documentElement(bodyElm); - var transposedPoint = transpose(editor.inline, targetElm, clientX, clientY); - return isInsideElementContentArea(targetElm, transposedPoint.x, transposedPoint.y); + var bodyElm = SugarElement.fromDom(editor.getBody()); + var targetElm = editor.inline ? bodyElm : documentElement(bodyElm); + var transposedPoint = transpose(editor.inline, targetElm, clientX, clientY); + return isInsideElementContentArea(targetElm, transposedPoint.x, transposedPoint.y); }; var fromDomSafe = function (node) { - return Optional.from(node).map(SugarElement.fromDom); + return Optional.from(node).map(SugarElement.fromDom); }; var isEditorAttachedToDom = function (editor) { - var rawContainer = editor.inline ? editor.getBody() : editor.getContentAreaContainer(); - return fromDomSafe(rawContainer).map(inBody).getOr(false); + var rawContainer = editor.inline ? editor.getBody() : editor.getContentAreaContainer(); + return fromDomSafe(rawContainer).map(inBody).getOr(false); }; function NotificationManagerImpl() { - var unimplemented = function () { - throw new Error('Theme did not provide a NotificationManager implementation.'); - }; - return { - open: unimplemented, - close: unimplemented, - reposition: unimplemented, - getArgs: unimplemented - }; + var unimplemented = function () { + throw new Error('Theme did not provide a NotificationManager implementation.'); + }; + return { + open: unimplemented, + close: unimplemented, + reposition: unimplemented, + getArgs: unimplemented + }; } function NotificationManager(editor) { - var notifications = []; - var getImplementation = function () { - var theme = editor.theme; - return theme && theme.getNotificationManagerImpl ? theme.getNotificationManagerImpl() : NotificationManagerImpl(); - }; - var getTopNotification = function () { - return Optional.from(notifications[0]); - }; - var isEqual = function (a, b) { - return a.type === b.type && a.text === b.text && !a.progressBar && !a.timeout && !b.progressBar && !b.timeout; - }; - var reposition = function () { - if (notifications.length > 0) { - getImplementation().reposition(notifications); - } - }; - var addNotification = function (notification) { - notifications.push(notification); - }; - var closeNotification = function (notification) { - findIndex(notifications, function (otherNotification) { - return otherNotification === notification; - }).each(function (index) { - notifications.splice(index, 1); - }); - }; - var open = function (spec, fireEvent) { - if (fireEvent === void 0) { - fireEvent = true; - } - if (editor.removed || !isEditorAttachedToDom(editor)) { - return; - } - if (fireEvent) { - editor.fire('BeforeOpenNotification', {notification: spec}); - } - return find(notifications, function (notification) { - return isEqual(getImplementation().getArgs(notification), spec); - }).getOrThunk(function () { - editor.editorManager.setActive(editor); - var notification = getImplementation().open(spec, function () { - closeNotification(notification); - reposition(); - getTopNotification().fold(function () { - return editor.focus(); - }, function (top) { - return focus(SugarElement.fromDom(top.getEl())); - }); - }); - addNotification(notification); - reposition(); - editor.fire('OpenNotification', __assign({}, notification)); - return notification; - }); - }; - var close = function () { - getTopNotification().each(function (notification) { - getImplementation().close(notification); - closeNotification(notification); - reposition(); - }); - }; - var getNotifications = function () { - return notifications; - }; - var registerEvents = function (editor) { - editor.on('SkinLoaded', function () { - var serviceMessage = getServiceMessage(editor); - if (serviceMessage) { - open({ - text: serviceMessage, - type: 'warning', - timeout: 0 - }, false); - } - }); - editor.on('ResizeEditor ResizeWindow NodeChange', function () { - Delay.requestAnimationFrame(reposition); - }); - editor.on('remove', function () { - each(notifications.slice(), function (notification) { - getImplementation().close(notification); - }); - }); - }; - registerEvents(editor); - return { - open: open, - close: close, - getNotifications: getNotifications - }; + var notifications = []; + var getImplementation = function () { + var theme = editor.theme; + return theme && theme.getNotificationManagerImpl ? theme.getNotificationManagerImpl() : NotificationManagerImpl(); + }; + var getTopNotification = function () { + return Optional.from(notifications[0]); + }; + var isEqual = function (a, b) { + return a.type === b.type && a.text === b.text && !a.progressBar && !a.timeout && !b.progressBar && !b.timeout; + }; + var reposition = function () { + if (notifications.length > 0) { + getImplementation().reposition(notifications); + } + }; + var addNotification = function (notification) { + notifications.push(notification); + }; + var closeNotification = function (notification) { + findIndex(notifications, function (otherNotification) { + return otherNotification === notification; + }).each(function (index) { + notifications.splice(index, 1); + }); + }; + var open = function (spec, fireEvent) { + if (fireEvent === void 0) { + fireEvent = true; + } + if (editor.removed || !isEditorAttachedToDom(editor)) { + return; + } + if (fireEvent) { + editor.fire('BeforeOpenNotification', { notification: spec }); + } + return find(notifications, function (notification) { + return isEqual(getImplementation().getArgs(notification), spec); + }).getOrThunk(function () { + editor.editorManager.setActive(editor); + var notification = getImplementation().open(spec, function () { + closeNotification(notification); + reposition(); + getTopNotification().fold(function () { + return editor.focus(); + }, function (top) { + return focus(SugarElement.fromDom(top.getEl())); + }); + }); + addNotification(notification); + reposition(); + editor.fire('OpenNotification', __assign({}, notification)); + return notification; + }); + }; + var close = function () { + getTopNotification().each(function (notification) { + getImplementation().close(notification); + closeNotification(notification); + reposition(); + }); + }; + var getNotifications = function () { + return notifications; + }; + var registerEvents = function (editor) { + editor.on('SkinLoaded', function () { + var serviceMessage = getServiceMessage(editor); + if (serviceMessage) { + open({ + text: serviceMessage, + type: 'warning', + timeout: 0 + }, false); + } + }); + editor.on('ResizeEditor ResizeWindow NodeChange', function () { + Delay.requestAnimationFrame(reposition); + }); + editor.on('remove', function () { + each(notifications.slice(), function (notification) { + getImplementation().close(notification); + }); + }); + }; + registerEvents(editor); + return { + open: open, + close: close, + getNotifications: getNotifications + }; } var PluginManager = AddOnManager$1.PluginManager; var ThemeManager = AddOnManager$1.ThemeManager; - function WindowManagerImpl() { - var unimplemented = function () { - throw new Error('Theme did not provide a WindowManager implementation.'); - }; - return { - open: unimplemented, - openUrl: unimplemented, - alert: unimplemented, - confirm: unimplemented, - close: unimplemented, - getParams: unimplemented, - setParams: unimplemented - }; + function WindowManagerImpl () { + var unimplemented = function () { + throw new Error('Theme did not provide a WindowManager implementation.'); + }; + return { + open: unimplemented, + openUrl: unimplemented, + alert: unimplemented, + confirm: unimplemented, + close: unimplemented, + getParams: unimplemented, + setParams: unimplemented + }; } var WindowManager = function (editor) { - var dialogs = []; - var getImplementation = function () { - var theme = editor.theme; - return theme && theme.getWindowManagerImpl ? theme.getWindowManagerImpl() : WindowManagerImpl(); - }; - var funcBind = function (scope, f) { - return function () { - return f ? f.apply(scope, arguments) : undefined; - }; - }; - var fireOpenEvent = function (dialog) { - editor.fire('OpenWindow', {dialog: dialog}); - }; - var fireCloseEvent = function (dialog) { - editor.fire('CloseWindow', {dialog: dialog}); - }; - var addDialog = function (dialog) { - dialogs.push(dialog); - fireOpenEvent(dialog); - }; - var closeDialog = function (dialog) { - fireCloseEvent(dialog); - dialogs = filter(dialogs, function (otherDialog) { - return otherDialog !== dialog; - }); - if (dialogs.length === 0) { - editor.focus(); - } - }; - var getTopDialog = function () { - return Optional.from(dialogs[dialogs.length - 1]); - }; - var storeSelectionAndOpenDialog = function (openDialog) { - editor.editorManager.setActive(editor); - store(editor); - var dialog = openDialog(); - addDialog(dialog); - return dialog; - }; - var open = function (args, params) { - return storeSelectionAndOpenDialog(function () { - return getImplementation().open(args, params, closeDialog); - }); - }; - var openUrl = function (args) { - return storeSelectionAndOpenDialog(function () { - return getImplementation().openUrl(args, closeDialog); - }); - }; - var alert = function (message, callback, scope) { - getImplementation().alert(message, funcBind(scope ? scope : this, callback)); - }; - var confirm = function (message, callback, scope) { - getImplementation().confirm(message, funcBind(scope ? scope : this, callback)); - }; - var close = function () { - getTopDialog().each(function (dialog) { - getImplementation().close(dialog); - closeDialog(dialog); - }); - }; - editor.on('remove', function () { - each(dialogs, function (dialog) { - getImplementation().close(dialog); - }); - }); - return { - open: open, - openUrl: openUrl, - alert: alert, - confirm: confirm, - close: close - }; + var dialogs = []; + var getImplementation = function () { + var theme = editor.theme; + return theme && theme.getWindowManagerImpl ? theme.getWindowManagerImpl() : WindowManagerImpl(); + }; + var funcBind = function (scope, f) { + return function () { + return f ? f.apply(scope, arguments) : undefined; + }; + }; + var fireOpenEvent = function (dialog) { + editor.fire('OpenWindow', { dialog: dialog }); + }; + var fireCloseEvent = function (dialog) { + editor.fire('CloseWindow', { dialog: dialog }); + }; + var addDialog = function (dialog) { + dialogs.push(dialog); + fireOpenEvent(dialog); + }; + var closeDialog = function (dialog) { + fireCloseEvent(dialog); + dialogs = filter(dialogs, function (otherDialog) { + return otherDialog !== dialog; + }); + if (dialogs.length === 0) { + editor.focus(); + } + }; + var getTopDialog = function () { + return Optional.from(dialogs[dialogs.length - 1]); + }; + var storeSelectionAndOpenDialog = function (openDialog) { + editor.editorManager.setActive(editor); + store(editor); + var dialog = openDialog(); + addDialog(dialog); + return dialog; + }; + var open = function (args, params) { + return storeSelectionAndOpenDialog(function () { + return getImplementation().open(args, params, closeDialog); + }); + }; + var openUrl = function (args) { + return storeSelectionAndOpenDialog(function () { + return getImplementation().openUrl(args, closeDialog); + }); + }; + var alert = function (message, callback, scope) { + getImplementation().alert(message, funcBind(scope ? scope : this, callback)); + }; + var confirm = function (message, callback, scope) { + getImplementation().confirm(message, funcBind(scope ? scope : this, callback)); + }; + var close = function () { + getTopDialog().each(function (dialog) { + getImplementation().close(dialog); + closeDialog(dialog); + }); + }; + editor.on('remove', function () { + each(dialogs, function (dialog) { + getImplementation().close(dialog); + }); + }); + return { + open: open, + openUrl: openUrl, + alert: alert, + confirm: confirm, + close: close + }; }; var displayNotification = function (editor, message) { - editor.notificationManager.open({ - type: 'error', - text: message - }); + editor.notificationManager.open({ + type: 'error', + text: message + }); }; var displayError = function (editor, message) { - if (editor._skinLoaded) { - displayNotification(editor, message); - } else { - editor.on('SkinLoaded', function () { - displayNotification(editor, message); - }); - } + if (editor._skinLoaded) { + displayNotification(editor, message); + } else { + editor.on('SkinLoaded', function () { + displayNotification(editor, message); + }); + } }; var uploadError = function (editor, message) { - displayError(editor, I18n.translate([ - 'Failed to upload image: {0}', - message - ])); + displayError(editor, I18n.translate([ + 'Failed to upload image: {0}', + message + ])); }; var logError = function (editor, errorType, msg) { - fireError(editor, errorType, {message: msg}); - console.error(msg); + fireError(editor, errorType, { message: msg }); + console.error(msg); }; var createLoadError = function (type, url, name) { - return name ? 'Failed to load ' + type + ': ' + name + ' from url ' + url : 'Failed to load ' + type + ' url: ' + url; + return name ? 'Failed to load ' + type + ': ' + name + ' from url ' + url : 'Failed to load ' + type + ' url: ' + url; }; var pluginLoadError = function (editor, url, name) { - logError(editor, 'PluginLoadError', createLoadError('plugin', url, name)); + logError(editor, 'PluginLoadError', createLoadError('plugin', url, name)); }; var iconsLoadError = function (editor, url, name) { - logError(editor, 'IconsLoadError', createLoadError('icons', url, name)); + logError(editor, 'IconsLoadError', createLoadError('icons', url, name)); }; var languageLoadError = function (editor, url, name) { - logError(editor, 'LanguageLoadError', createLoadError('language', url, name)); + logError(editor, 'LanguageLoadError', createLoadError('language', url, name)); }; var pluginInitError = function (editor, name, err) { - var message = I18n.translate([ - 'Failed to initialize plugin: {0}', - name - ]); - initError(message, err); - displayError(editor, message); + var message = I18n.translate([ + 'Failed to initialize plugin: {0}', + name + ]); + initError(message, err); + displayError(editor, message); }; var initError = function (message) { - var x = []; - for (var _i = 1; _i < arguments.length; _i++) { - x[_i - 1] = arguments[_i]; - } - var console = window.console; - if (console) { - if (console.error) { - console.error.apply(console, __spreadArrays([message], x)); - } else { - console.log.apply(console, __spreadArrays([message], x)); - } + var x = []; + for (var _i = 1; _i < arguments.length; _i++) { + x[_i - 1] = arguments[_i]; + } + var console = window.console; + if (console) { + if (console.error) { + console.error.apply(console, __spreadArrays([message], x)); + } else { + console.log.apply(console, __spreadArrays([message], x)); } + } }; var isContentCssSkinName = function (url) { - return /^[a-z0-9\-]+$/i.test(url); + return /^[a-z0-9\-]+$/i.test(url); }; var getContentCssUrls = function (editor) { - var contentCss = getContentCss(editor); - var skinUrl = editor.editorManager.baseURL + '/skins/content'; - var suffix = editor.editorManager.suffix; - var contentCssFile = 'content' + suffix + '.css'; - var inline = editor.inline === true; - return map(contentCss, function (url) { - if (isContentCssSkinName(url) && !inline) { - return skinUrl + '/' + url + '/' + contentCssFile; - } else { - return editor.documentBaseURI.toAbsolute(url); - } - }); + var contentCss = getContentCss(editor); + var skinUrl = editor.editorManager.baseURL + '/skins/content'; + var suffix = editor.editorManager.suffix; + var contentCssFile = 'content' + suffix + '.css'; + var inline = editor.inline === true; + return map(contentCss, function (url) { + if (isContentCssSkinName(url) && !inline) { + return skinUrl + '/' + url + '/' + contentCssFile; + } else { + return editor.documentBaseURI.toAbsolute(url); + } + }); }; var appendContentCssFromSettings = function (editor) { - editor.contentCSS = editor.contentCSS.concat(getContentCssUrls(editor)); + editor.contentCSS = editor.contentCSS.concat(getContentCssUrls(editor)); }; function Uploader(uploadStatus, settings) { - var pendingPromises = {}; - var pathJoin = function (path1, path2) { - if (path1) { - return path1.replace(/\/$/, '') + '/' + path2.replace(/^\//, ''); - } - return path2; + var pendingPromises = {}; + var pathJoin = function (path1, path2) { + if (path1) { + return path1.replace(/\/$/, '') + '/' + path2.replace(/^\//, ''); + } + return path2; + }; + var defaultHandler = function (blobInfo, success, failure, progress) { + var xhr = new XMLHttpRequest(); + xhr.open('POST', settings.url); + xhr.withCredentials = settings.credentials; + xhr.upload.onprogress = function (e) { + progress(e.loaded / e.total * 100); + }; + xhr.onerror = function () { + failure('Image upload failed due to a XHR Transport error. Code: ' + xhr.status); + }; + xhr.onload = function () { + if (xhr.status < 200 || xhr.status >= 300) { + failure('HTTP Error: ' + xhr.status); + return; + } + var json = JSON.parse(xhr.responseText); + if (!json || typeof json.location !== 'string') { + failure('Invalid JSON: ' + xhr.responseText); + return; + } + success(pathJoin(settings.basePath, json.location)); + }; + var formData = new FormData(); + formData.append('file', blobInfo.blob(), blobInfo.filename()); + xhr.send(formData); + }; + var noUpload = function () { + return new promiseObj(function (resolve) { + resolve([]); + }); + }; + var handlerSuccess = function (blobInfo, url) { + return { + url: url, + blobInfo: blobInfo, + status: true }; - var defaultHandler = function (blobInfo, success, failure, progress) { - var xhr = new XMLHttpRequest(); - xhr.open('POST', settings.url); - xhr.withCredentials = settings.credentials; - xhr.upload.onprogress = function (e) { - progress(e.loaded / e.total * 100); - }; - xhr.onerror = function () { - failure('Image upload failed due to a XHR Transport error. Code: ' + xhr.status); + }; + var handlerFailure = function (blobInfo, message, options) { + return { + url: '', + blobInfo: blobInfo, + status: false, + error: { + message: message, + options: options + } + }; + }; + var resolvePending = function (blobUri, result) { + Tools.each(pendingPromises[blobUri], function (resolve) { + resolve(result); + }); + delete pendingPromises[blobUri]; + }; + var uploadBlobInfo = function (blobInfo, handler, openNotification) { + uploadStatus.markPending(blobInfo.blobUri()); + return new promiseObj(function (resolve) { + var notification, progress; + var noop = function () { + }; + try { + var closeNotification_1 = function () { + if (notification) { + notification.close(); + progress = noop; + } }; - xhr.onload = function () { - if (xhr.status < 200 || xhr.status >= 300) { - failure('HTTP Error: ' + xhr.status); - return; - } - var json = JSON.parse(xhr.responseText); - if (!json || typeof json.location !== 'string') { - failure('Invalid JSON: ' + xhr.responseText); - return; - } - success(pathJoin(settings.basePath, json.location)); + var success = function (url) { + closeNotification_1(); + uploadStatus.markUploaded(blobInfo.blobUri(), url); + resolvePending(blobInfo.blobUri(), handlerSuccess(blobInfo, url)); + resolve(handlerSuccess(blobInfo, url)); }; - var formData = new FormData(); - formData.append('file', blobInfo.blob(), blobInfo.filename()); - xhr.send(formData); - }; - var noUpload = function () { - return new promiseObj(function (resolve) { - resolve([]); - }); - }; - var handlerSuccess = function (blobInfo, url) { - return { - url: url, - blobInfo: blobInfo, - status: true + var failure = function (error, options) { + var failureOptions = options ? options : {}; + closeNotification_1(); + uploadStatus.removeFailed(blobInfo.blobUri()); + resolvePending(blobInfo.blobUri(), handlerFailure(blobInfo, error, failureOptions)); + resolve(handlerFailure(blobInfo, error, failureOptions)); }; - }; - var handlerFailure = function (blobInfo, message, options) { - return { - url: '', - blobInfo: blobInfo, - status: false, - error: { - message: message, - options: options - } + progress = function (percent) { + if (percent < 0 || percent > 100) { + return; + } + if (!notification) { + notification = openNotification(); + } + notification.progressBar.value(percent); }; - }; - var resolvePending = function (blobUri, result) { - Tools.each(pendingPromises[blobUri], function (resolve) { - resolve(result); - }); - delete pendingPromises[blobUri]; - }; - var uploadBlobInfo = function (blobInfo, handler, openNotification) { - uploadStatus.markPending(blobInfo.blobUri()); - return new promiseObj(function (resolve) { - var notification, progress; - var noop = function () { - }; - try { - var closeNotification_1 = function () { - if (notification) { - notification.close(); - progress = noop; - } - }; - var success = function (url) { - closeNotification_1(); - uploadStatus.markUploaded(blobInfo.blobUri(), url); - resolvePending(blobInfo.blobUri(), handlerSuccess(blobInfo, url)); - resolve(handlerSuccess(blobInfo, url)); - }; - var failure = function (error, options) { - var failureOptions = options ? options : {}; - closeNotification_1(); - uploadStatus.removeFailed(blobInfo.blobUri()); - resolvePending(blobInfo.blobUri(), handlerFailure(blobInfo, error, failureOptions)); - resolve(handlerFailure(blobInfo, error, failureOptions)); - }; - progress = function (percent) { - if (percent < 0 || percent > 100) { - return; - } - if (!notification) { - notification = openNotification(); - } - notification.progressBar.value(percent); - }; - handler(blobInfo, success, failure, progress); - } catch (ex) { - resolve(handlerFailure(blobInfo, ex.message, {})); - } - }); - }; - var isDefaultHandler = function (handler) { - return handler === defaultHandler; - }; - var pendingUploadBlobInfo = function (blobInfo) { - var blobUri = blobInfo.blobUri(); - return new promiseObj(function (resolve) { - pendingPromises[blobUri] = pendingPromises[blobUri] || []; - pendingPromises[blobUri].push(resolve); - }); - }; - var uploadBlobs = function (blobInfos, openNotification) { - blobInfos = Tools.grep(blobInfos, function (blobInfo) { - return !uploadStatus.isUploaded(blobInfo.blobUri()); - }); - return promiseObj.all(Tools.map(blobInfos, function (blobInfo) { - return uploadStatus.isPending(blobInfo.blobUri()) ? pendingUploadBlobInfo(blobInfo) : uploadBlobInfo(blobInfo, settings.handler, openNotification); - })); - }; - var upload = function (blobInfos, openNotification) { - return !settings.url && isDefaultHandler(settings.handler) ? noUpload() : uploadBlobs(blobInfos, openNotification); - }; - if (isFunction(settings.handler) === false) { - settings.handler = defaultHandler; - } - return {upload: upload}; + handler(blobInfo, success, failure, progress); + } catch (ex) { + resolve(handlerFailure(blobInfo, ex.message, {})); + } + }); + }; + var isDefaultHandler = function (handler) { + return handler === defaultHandler; + }; + var pendingUploadBlobInfo = function (blobInfo) { + var blobUri = blobInfo.blobUri(); + return new promiseObj(function (resolve) { + pendingPromises[blobUri] = pendingPromises[blobUri] || []; + pendingPromises[blobUri].push(resolve); + }); + }; + var uploadBlobs = function (blobInfos, openNotification) { + blobInfos = Tools.grep(blobInfos, function (blobInfo) { + return !uploadStatus.isUploaded(blobInfo.blobUri()); + }); + return promiseObj.all(Tools.map(blobInfos, function (blobInfo) { + return uploadStatus.isPending(blobInfo.blobUri()) ? pendingUploadBlobInfo(blobInfo) : uploadBlobInfo(blobInfo, settings.handler, openNotification); + })); + }; + var upload = function (blobInfos, openNotification) { + return !settings.url && isDefaultHandler(settings.handler) ? noUpload() : uploadBlobs(blobInfos, openNotification); + }; + if (isFunction(settings.handler) === false) { + settings.handler = defaultHandler; + } + return { upload: upload }; } - function UploadStatus() { - var PENDING = 1, UPLOADED = 2; - var blobUriStatuses = {}; - var createStatus = function (status, resultUri) { - return { - status: status, - resultUri: resultUri - }; - }; - var hasBlobUri = function (blobUri) { - return blobUri in blobUriStatuses; - }; - var getResultUri = function (blobUri) { - var result = blobUriStatuses[blobUri]; - return result ? result.resultUri : null; - }; - var isPending = function (blobUri) { - return hasBlobUri(blobUri) ? blobUriStatuses[blobUri].status === PENDING : false; - }; - var isUploaded = function (blobUri) { - return hasBlobUri(blobUri) ? blobUriStatuses[blobUri].status === UPLOADED : false; - }; - var markPending = function (blobUri) { - blobUriStatuses[blobUri] = createStatus(PENDING, null); - }; - var markUploaded = function (blobUri, resultUri) { - blobUriStatuses[blobUri] = createStatus(UPLOADED, resultUri); - }; - var removeFailed = function (blobUri) { - delete blobUriStatuses[blobUri]; - }; - var destroy = function () { - blobUriStatuses = {}; - }; + function UploadStatus () { + var PENDING = 1, UPLOADED = 2; + var blobUriStatuses = {}; + var createStatus = function (status, resultUri) { return { - hasBlobUri: hasBlobUri, - getResultUri: getResultUri, - isPending: isPending, - isUploaded: isUploaded, - markPending: markPending, - markUploaded: markUploaded, - removeFailed: removeFailed, - destroy: destroy - }; + status: status, + resultUri: resultUri + }; + }; + var hasBlobUri = function (blobUri) { + return blobUri in blobUriStatuses; + }; + var getResultUri = function (blobUri) { + var result = blobUriStatuses[blobUri]; + return result ? result.resultUri : null; + }; + var isPending = function (blobUri) { + return hasBlobUri(blobUri) ? blobUriStatuses[blobUri].status === PENDING : false; + }; + var isUploaded = function (blobUri) { + return hasBlobUri(blobUri) ? blobUriStatuses[blobUri].status === UPLOADED : false; + }; + var markPending = function (blobUri) { + blobUriStatuses[blobUri] = createStatus(PENDING, null); + }; + var markUploaded = function (blobUri, resultUri) { + blobUriStatuses[blobUri] = createStatus(UPLOADED, resultUri); + }; + var removeFailed = function (blobUri) { + delete blobUriStatuses[blobUri]; + }; + var destroy = function () { + blobUriStatuses = {}; + }; + return { + hasBlobUri: hasBlobUri, + getResultUri: getResultUri, + isPending: isPending, + isUploaded: isUploaded, + markPending: markPending, + markUploaded: markUploaded, + removeFailed: removeFailed, + destroy: destroy + }; } var count$1 = 0; var seed = function () { - var rnd = function () { - return Math.round(Math.random() * 4294967295).toString(36); - }; - var now = new Date().getTime(); - return 's' + now.toString(36) + rnd() + rnd() + rnd(); + var rnd = function () { + return Math.round(Math.random() * 4294967295).toString(36); + }; + var now = new Date().getTime(); + return 's' + now.toString(36) + rnd() + rnd() + rnd(); }; var uuid = function (prefix) { - return prefix + count$1++ + seed(); + return prefix + count$1++ + seed(); }; var BlobCache = function () { - var cache = []; - var mimeToExt = function (mime) { - var mimes = { - 'image/jpeg': 'jpg', - 'image/jpg': 'jpg', - 'image/gif': 'gif', - 'image/png': 'png', - 'image/apng': 'apng', - 'image/avif': 'avif', - 'image/svg+xml': 'svg', - 'image/webp': 'webp', - 'image/bmp': 'bmp', - 'image/tiff': 'tiff' - }; - return mimes[mime.toLowerCase()] || 'dat'; - }; - var create = function (o, blob, base64, name, filename) { - if (isString(o)) { - var id = o; - return toBlobInfo({ - id: id, - name: name, - filename: filename, - blob: blob, - base64: base64 - }); - } else if (isObject(o)) { - return toBlobInfo(o); - } else { - throw new Error('Unknown input type'); - } - }; - var toBlobInfo = function (o) { - if (!o.blob || !o.base64) { - throw new Error('blob and base64 representations of the image are required for BlobInfo to be created'); - } - var id = o.id || uuid('blobid'); - var name = o.name || id; - var blob = o.blob; - return { - id: constant(id), - name: constant(name), - filename: constant(o.filename || name + '.' + mimeToExt(blob.type)), - blob: constant(blob), - base64: constant(o.base64), - blobUri: constant(o.blobUri || URL.createObjectURL(blob)), - uri: constant(o.uri) - }; - }; - var add = function (blobInfo) { - if (!get(blobInfo.id())) { - cache.push(blobInfo); - } - }; - var findFirst = function (predicate) { - return find(cache, predicate).getOrUndefined(); - }; - var get = function (id) { - return findFirst(function (cachedBlobInfo) { - return cachedBlobInfo.id() === id; - }); - }; - var getByUri = function (blobUri) { - return findFirst(function (blobInfo) { - return blobInfo.blobUri() === blobUri; - }); - }; - var getByData = function (base64, type) { - return findFirst(function (blobInfo) { - return blobInfo.base64() === base64 && blobInfo.blob().type === type; - }); - }; - var removeByUri = function (blobUri) { - cache = filter(cache, function (blobInfo) { - if (blobInfo.blobUri() === blobUri) { - URL.revokeObjectURL(blobInfo.blobUri()); - return false; - } - return true; - }); - }; - var destroy = function () { - each(cache, function (cachedBlobInfo) { - URL.revokeObjectURL(cachedBlobInfo.blobUri()); - }); - cache = []; - }; + var cache = []; + var mimeToExt = function (mime) { + var mimes = { + 'image/jpeg': 'jpg', + 'image/jpg': 'jpg', + 'image/gif': 'gif', + 'image/png': 'png', + 'image/apng': 'apng', + 'image/avif': 'avif', + 'image/svg+xml': 'svg', + 'image/webp': 'webp', + 'image/bmp': 'bmp', + 'image/tiff': 'tiff' + }; + return mimes[mime.toLowerCase()] || 'dat'; + }; + var create = function (o, blob, base64, name, filename) { + if (isString(o)) { + var id = o; + return toBlobInfo({ + id: id, + name: name, + filename: filename, + blob: blob, + base64: base64 + }); + } else if (isObject(o)) { + return toBlobInfo(o); + } else { + throw new Error('Unknown input type'); + } + }; + var toBlobInfo = function (o) { + if (!o.blob || !o.base64) { + throw new Error('blob and base64 representations of the image are required for BlobInfo to be created'); + } + var id = o.id || uuid('blobid'); + var name = o.name || id; + var blob = o.blob; return { - create: create, - add: add, - get: get, - getByUri: getByUri, - getByData: getByData, - findFirst: findFirst, - removeByUri: removeByUri, - destroy: destroy - }; + id: constant(id), + name: constant(name), + filename: constant(o.filename || name + '.' + mimeToExt(blob.type)), + blob: constant(blob), + base64: constant(o.base64), + blobUri: constant(o.blobUri || URL.createObjectURL(blob)), + uri: constant(o.uri) + }; + }; + var add = function (blobInfo) { + if (!get(blobInfo.id())) { + cache.push(blobInfo); + } + }; + var findFirst = function (predicate) { + return find(cache, predicate).getOrUndefined(); + }; + var get = function (id) { + return findFirst(function (cachedBlobInfo) { + return cachedBlobInfo.id() === id; + }); + }; + var getByUri = function (blobUri) { + return findFirst(function (blobInfo) { + return blobInfo.blobUri() === blobUri; + }); + }; + var getByData = function (base64, type) { + return findFirst(function (blobInfo) { + return blobInfo.base64() === base64 && blobInfo.blob().type === type; + }); + }; + var removeByUri = function (blobUri) { + cache = filter(cache, function (blobInfo) { + if (blobInfo.blobUri() === blobUri) { + URL.revokeObjectURL(blobInfo.blobUri()); + return false; + } + return true; + }); + }; + var destroy = function () { + each(cache, function (cachedBlobInfo) { + URL.revokeObjectURL(cachedBlobInfo.blobUri()); + }); + cache = []; + }; + return { + create: create, + add: add, + get: get, + getByUri: getByUri, + getByData: getByData, + findFirst: findFirst, + removeByUri: removeByUri, + destroy: destroy + }; }; var UploadChangeHandler = function (editor) { - var lastChangedLevel = Cell(null); - editor.on('change AddUndo', function (e) { - lastChangedLevel.set(__assign({}, e.level)); - }); - var fireIfChanged = function () { - var data = editor.undoManager.data; - last(data).filter(function (level) { - return !isEq$4(lastChangedLevel.get(), level); - }).each(function (level) { - editor.setDirty(true); - editor.fire('change', { - level: level, - lastLevel: get(data, data.length - 2).getOrNull() - }); - }); - }; - return {fireIfChanged: fireIfChanged}; + var lastChangedLevel = Cell(null); + editor.on('change AddUndo', function (e) { + lastChangedLevel.set(__assign({}, e.level)); + }); + var fireIfChanged = function () { + var data = editor.undoManager.data; + last(data).filter(function (level) { + return !isEq$4(lastChangedLevel.get(), level); + }).each(function (level) { + editor.setDirty(true); + editor.fire('change', { + level: level, + lastLevel: get(data, data.length - 2).getOrNull() + }); + }); + }; + return { fireIfChanged: fireIfChanged }; }; var EditorUpload = function (editor) { - var blobCache = BlobCache(); - var uploader, imageScanner; - var uploadStatus = UploadStatus(); - var urlFilters = []; - var changeHandler = UploadChangeHandler(editor); - var aliveGuard = function (callback) { - return function (result) { - if (editor.selection) { - return callback(result); - } - return []; - }; - }; - var cacheInvalidator = function (url) { - return url + (url.indexOf('?') === -1 ? '?' : '&') + new Date().getTime(); - }; - var replaceString = function (content, search, replace) { - var index = 0; - do { - index = content.indexOf(search, index); - if (index !== -1) { - content = content.substring(0, index) + replace + content.substr(index + search.length); - index += replace.length - search.length + 1; - } - } while (index !== -1); - return content; - }; - var replaceImageUrl = function (content, targetUrl, replacementUrl) { - var replacementString = 'src="' + replacementUrl + '"' + (replacementUrl === Env.transparentSrc ? ' data-mce-placeholder="1"' : ''); - content = replaceString(content, 'src="' + targetUrl + '"', replacementString); - content = replaceString(content, 'data-mce-src="' + targetUrl + '"', 'data-mce-src="' + replacementUrl + '"'); - return content; - }; - var replaceUrlInUndoStack = function (targetUrl, replacementUrl) { - each(editor.undoManager.data, function (level) { - if (level.type === 'fragmented') { - level.fragments = map(level.fragments, function (fragment) { - return replaceImageUrl(fragment, targetUrl, replacementUrl); - }); - } else { - level.content = replaceImageUrl(level.content, targetUrl, replacementUrl); - } - }); - }; - var openNotification = function () { - return editor.notificationManager.open({ - text: editor.translate('Image uploading...'), - type: 'info', - timeout: -1, - progressBar: true - }); - }; - var replaceImageUriInView = function (image, resultUri) { - var src = editor.convertURL(resultUri, 'src'); - replaceUrlInUndoStack(image.src, resultUri); - editor.$(image).attr({ - 'src': shouldReuseFileName(editor) ? cacheInvalidator(resultUri) : resultUri, - 'data-mce-src': src - }); - }; - var uploadImages = function (callback) { - if (!uploader) { - uploader = Uploader(uploadStatus, { - url: getImageUploadUrl(editor), - basePath: getImageUploadBasePath(editor), - credentials: getImagesUploadCredentials(editor), - handler: getImagesUploadHandler(editor) - }); - } - return scanForImages().then(aliveGuard(function (imageInfos) { - var blobInfos = map(imageInfos, function (imageInfo) { - return imageInfo.blobInfo; + var blobCache = BlobCache(); + var uploader, imageScanner; + var uploadStatus = UploadStatus(); + var urlFilters = []; + var changeHandler = UploadChangeHandler(editor); + var aliveGuard = function (callback) { + return function (result) { + if (editor.selection) { + return callback(result); + } + return []; + }; + }; + var cacheInvalidator = function (url) { + return url + (url.indexOf('?') === -1 ? '?' : '&') + new Date().getTime(); + }; + var replaceString = function (content, search, replace) { + var index = 0; + do { + index = content.indexOf(search, index); + if (index !== -1) { + content = content.substring(0, index) + replace + content.substr(index + search.length); + index += replace.length - search.length + 1; + } + } while (index !== -1); + return content; + }; + var replaceImageUrl = function (content, targetUrl, replacementUrl) { + var replacementString = 'src="' + replacementUrl + '"' + (replacementUrl === Env.transparentSrc ? ' data-mce-placeholder="1"' : ''); + content = replaceString(content, 'src="' + targetUrl + '"', replacementString); + content = replaceString(content, 'data-mce-src="' + targetUrl + '"', 'data-mce-src="' + replacementUrl + '"'); + return content; + }; + var replaceUrlInUndoStack = function (targetUrl, replacementUrl) { + each(editor.undoManager.data, function (level) { + if (level.type === 'fragmented') { + level.fragments = map(level.fragments, function (fragment) { + return replaceImageUrl(fragment, targetUrl, replacementUrl); + }); + } else { + level.content = replaceImageUrl(level.content, targetUrl, replacementUrl); + } + }); + }; + var openNotification = function () { + return editor.notificationManager.open({ + text: editor.translate('Image uploading...'), + type: 'info', + timeout: -1, + progressBar: true + }); + }; + var replaceImageUriInView = function (image, resultUri) { + var src = editor.convertURL(resultUri, 'src'); + replaceUrlInUndoStack(image.src, resultUri); + editor.$(image).attr({ + 'src': shouldReuseFileName(editor) ? cacheInvalidator(resultUri) : resultUri, + 'data-mce-src': src + }); + }; + var uploadImages = function (callback) { + if (!uploader) { + uploader = Uploader(uploadStatus, { + url: getImageUploadUrl(editor), + basePath: getImageUploadBasePath(editor), + credentials: getImagesUploadCredentials(editor), + handler: getImagesUploadHandler(editor) + }); + } + return scanForImages().then(aliveGuard(function (imageInfos) { + var blobInfos = map(imageInfos, function (imageInfo) { + return imageInfo.blobInfo; + }); + return uploader.upload(blobInfos, openNotification).then(aliveGuard(function (result) { + var imagesToRemove = []; + var filteredResult = map(result, function (uploadInfo, index) { + var blobInfo = imageInfos[index].blobInfo; + var image = imageInfos[index].image; + if (uploadInfo.status && shouldReplaceBlobUris(editor)) { + blobCache.removeByUri(image.src); + replaceImageUriInView(image, uploadInfo.url); + } else if (uploadInfo.error) { + if (uploadInfo.error.options.remove) { + replaceUrlInUndoStack(image.getAttribute('src'), Env.transparentSrc); + imagesToRemove.push(image); + } + uploadError(editor, uploadInfo.error.message); + } + return { + element: image, + status: uploadInfo.status, + uploadUri: uploadInfo.url, + blobInfo: blobInfo + }; + }); + if (filteredResult.length > 0) { + changeHandler.fireIfChanged(); + } + if (imagesToRemove.length > 0) { + if (isRtc(editor)) { + console.error('Removing images on failed uploads is currently unsupported for RTC'); + } else { + editor.undoManager.transact(function () { + each(imagesToRemove, function (element) { + editor.dom.remove(element); + blobCache.removeByUri(element.src); + }); }); - return uploader.upload(blobInfos, openNotification).then(aliveGuard(function (result) { - var imagesToRemove = []; - var filteredResult = map(result, function (uploadInfo, index) { - var blobInfo = imageInfos[index].blobInfo; - var image = imageInfos[index].image; - if (uploadInfo.status && shouldReplaceBlobUris(editor)) { - blobCache.removeByUri(image.src); - replaceImageUriInView(image, uploadInfo.url); - } else if (uploadInfo.error) { - if (uploadInfo.error.options.remove) { - replaceUrlInUndoStack(image.getAttribute('src'), Env.transparentSrc); - imagesToRemove.push(image); - } - uploadError(editor, uploadInfo.error.message); - } - return { - element: image, - status: uploadInfo.status, - uploadUri: uploadInfo.url, - blobInfo: blobInfo - }; - }); - if (filteredResult.length > 0) { - changeHandler.fireIfChanged(); - } - if (imagesToRemove.length > 0) { - if (isRtc(editor)) { - console.error('Removing images on failed uploads is currently unsupported for RTC'); - } else { - editor.undoManager.transact(function () { - each(imagesToRemove, function (element) { - editor.dom.remove(element); - blobCache.removeByUri(element.src); - }); - }); - } - } - if (callback) { - callback(filteredResult); - } - return filteredResult; - })); - })); - }; - var uploadImagesAuto = function (callback) { - if (isAutomaticUploadsEnabled(editor)) { - return uploadImages(callback); + } } - }; - var isValidDataUriImage = function (imgElm) { - if (forall(urlFilters, function (filter) { - return filter(imgElm); - }) === false) { - return false; + if (callback) { + callback(filteredResult); } - if (imgElm.getAttribute('src').indexOf('data:') === 0) { - var dataImgFilter = getImagesDataImgFilter(editor); - return dataImgFilter(imgElm); + return filteredResult; + })); + })); + }; + var uploadImagesAuto = function (callback) { + if (isAutomaticUploadsEnabled(editor)) { + return uploadImages(callback); + } + }; + var isValidDataUriImage = function (imgElm) { + if (forall(urlFilters, function (filter) { + return filter(imgElm); + }) === false) { + return false; + } + if (imgElm.getAttribute('src').indexOf('data:') === 0) { + var dataImgFilter = getImagesDataImgFilter(editor); + return dataImgFilter(imgElm); + } + return true; + }; + var addFilter = function (filter) { + urlFilters.push(filter); + }; + var scanForImages = function () { + if (!imageScanner) { + imageScanner = ImageScanner(uploadStatus, blobCache); + } + return imageScanner.findAll(editor.getBody(), isValidDataUriImage).then(aliveGuard(function (result) { + result = filter(result, function (resultItem) { + if (typeof resultItem === 'string') { + displayError(editor, resultItem); + return false; } return true; - }; - var addFilter = function (filter) { - urlFilters.push(filter); - }; - var scanForImages = function () { - if (!imageScanner) { - imageScanner = ImageScanner(uploadStatus, blobCache); - } - return imageScanner.findAll(editor.getBody(), isValidDataUriImage).then(aliveGuard(function (result) { - result = filter(result, function (resultItem) { - if (typeof resultItem === 'string') { - displayError(editor, resultItem); - return false; - } - return true; - }); - each(result, function (resultItem) { - replaceUrlInUndoStack(resultItem.image.src, resultItem.blobInfo.blobUri()); - resultItem.image.src = resultItem.blobInfo.blobUri(); - resultItem.image.removeAttribute('data-mce-src'); - }); - return result; - })); - }; - var destroy = function () { - blobCache.destroy(); - uploadStatus.destroy(); - imageScanner = uploader = null; - }; - var replaceBlobUris = function (content) { - return content.replace(/src="(blob:[^"]+)"/g, function (match, blobUri) { - var resultUri = uploadStatus.getResultUri(blobUri); - if (resultUri) { - return 'src="' + resultUri + '"'; - } - var blobInfo = blobCache.getByUri(blobUri); - if (!blobInfo) { - blobInfo = foldl(editor.editorManager.get(), function (result, editor) { - return result || editor.editorUpload && editor.editorUpload.blobCache.getByUri(blobUri); - }, null); - } - if (blobInfo) { - var blob = blobInfo.blob(); - return 'src="data:' + blob.type + ';base64,' + blobInfo.base64() + '"'; - } - return match; - }); - }; - editor.on('SetContent', function () { - if (isAutomaticUploadsEnabled(editor)) { - uploadImagesAuto(); - } else { - scanForImages(); - } - }); - editor.on('RawSaveContent', function (e) { - e.content = replaceBlobUris(e.content); - }); - editor.on('GetContent', function (e) { - if (e.source_view || e.format === 'raw' || e.format === 'tree') { - return; - } - e.content = replaceBlobUris(e.content); - }); - editor.on('PostRender', function () { - editor.parser.addNodeFilter('img', function (images) { - each(images, function (img) { - var src = img.attr('src'); - if (blobCache.getByUri(src)) { - return; - } - var resultUri = uploadStatus.getResultUri(src); - if (resultUri) { - img.attr('src', resultUri); - } - }); - }); - }); - return { - blobCache: blobCache, - addFilter: addFilter, - uploadImages: uploadImages, - uploadImagesAuto: uploadImagesAuto, - scanForImages: scanForImages, - destroy: destroy - }; + }); + each(result, function (resultItem) { + replaceUrlInUndoStack(resultItem.image.src, resultItem.blobInfo.blobUri()); + resultItem.image.src = resultItem.blobInfo.blobUri(); + resultItem.image.removeAttribute('data-mce-src'); + }); + return result; + })); + }; + var destroy = function () { + blobCache.destroy(); + uploadStatus.destroy(); + imageScanner = uploader = null; + }; + var replaceBlobUris = function (content) { + return content.replace(/src="(blob:[^"]+)"/g, function (match, blobUri) { + var resultUri = uploadStatus.getResultUri(blobUri); + if (resultUri) { + return 'src="' + resultUri + '"'; + } + var blobInfo = blobCache.getByUri(blobUri); + if (!blobInfo) { + blobInfo = foldl(editor.editorManager.get(), function (result, editor) { + return result || editor.editorUpload && editor.editorUpload.blobCache.getByUri(blobUri); + }, null); + } + if (blobInfo) { + var blob = blobInfo.blob(); + return 'src="data:' + blob.type + ';base64,' + blobInfo.base64() + '"'; + } + return match; + }); + }; + editor.on('SetContent', function () { + if (isAutomaticUploadsEnabled(editor)) { + uploadImagesAuto(); + } else { + scanForImages(); + } + }); + editor.on('RawSaveContent', function (e) { + e.content = replaceBlobUris(e.content); + }); + editor.on('GetContent', function (e) { + if (e.source_view || e.format === 'raw' || e.format === 'tree') { + return; + } + e.content = replaceBlobUris(e.content); + }); + editor.on('PostRender', function () { + editor.parser.addNodeFilter('img', function (images) { + each(images, function (img) { + var src = img.attr('src'); + if (blobCache.getByUri(src)) { + return; + } + var resultUri = uploadStatus.getResultUri(src); + if (resultUri) { + img.attr('src', resultUri); + } + }); + }); + }); + return { + blobCache: blobCache, + addFilter: addFilter, + uploadImages: uploadImages, + uploadImagesAuto: uploadImagesAuto, + scanForImages: scanForImages, + destroy: destroy + }; }; var get$a = function (dom) { - var formats = { - valigntop: [{ - selector: 'td,th', - styles: {verticalAlign: 'top'} - }], - valignmiddle: [{ - selector: 'td,th', - styles: {verticalAlign: 'middle'} - }], - valignbottom: [{ - selector: 'td,th', - styles: {verticalAlign: 'bottom'} - }], - alignleft: [ - { - selector: 'figure.image', - collapsed: false, - classes: 'align-left', - ceFalseOverride: true, - preview: 'font-family font-size' - }, - { - selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', - styles: {textAlign: 'left'}, - inherit: false, - preview: false, - defaultBlock: 'div' - }, - { - selector: 'img,table', - collapsed: false, - styles: {float: 'left'}, - preview: 'font-family font-size' - } - ], - aligncenter: [ - { - selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', - styles: {textAlign: 'center'}, - inherit: false, - preview: 'font-family font-size', - defaultBlock: 'div' - }, - { - selector: 'figure.image', - collapsed: false, - classes: 'align-center', - ceFalseOverride: true, - preview: 'font-family font-size' - }, - { - selector: 'img', - collapsed: false, - styles: { - display: 'block', - marginLeft: 'auto', - marginRight: 'auto' - }, - preview: false - }, - { - selector: 'table', - collapsed: false, - styles: { - marginLeft: 'auto', - marginRight: 'auto' - }, - preview: 'font-family font-size' - } - ], - alignright: [ - { - selector: 'figure.image', - collapsed: false, - classes: 'align-right', - ceFalseOverride: true, - preview: 'font-family font-size' - }, - { - selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', - styles: {textAlign: 'right'}, - inherit: false, - preview: 'font-family font-size', - defaultBlock: 'div' - }, - { - selector: 'img,table', - collapsed: false, - styles: {float: 'right'}, - preview: 'font-family font-size' - } - ], - alignjustify: [{ - selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', - styles: {textAlign: 'justify'}, - inherit: false, - defaultBlock: 'div', - preview: 'font-family font-size' - }], - bold: [ - { - inline: 'strong', - remove: 'all', - preserve_attributes: [ - 'class', - 'style' - ] - }, - { - inline: 'span', - styles: {fontWeight: 'bold'} - }, - { - inline: 'b', - remove: 'all', - preserve_attributes: [ - 'class', - 'style' - ] - } - ], - italic: [ - { - inline: 'em', - remove: 'all', - preserve_attributes: [ - 'class', - 'style' - ] - }, - { - inline: 'span', - styles: {fontStyle: 'italic'} - }, - { - inline: 'i', - remove: 'all', - preserve_attributes: [ - 'class', - 'style' - ] - } - ], - underline: [ - { - inline: 'span', - styles: {textDecoration: 'underline'}, - exact: true - }, - { - inline: 'u', - remove: 'all', - preserve_attributes: [ - 'class', - 'style' - ] - } - ], - strikethrough: [ - { - inline: 'span', - styles: {textDecoration: 'line-through'}, - exact: true - }, - { - inline: 'strike', - remove: 'all', - preserve_attributes: [ - 'class', - 'style' - ] - }, - { - inline: 's', - remove: 'all', - preserve_attributes: [ - 'class', - 'style' - ] - } - ], - forecolor: { - inline: 'span', - styles: {color: '%value'}, - links: true, - remove_similar: true, - clear_child_styles: true - }, - hilitecolor: { - inline: 'span', - styles: {backgroundColor: '%value'}, - links: true, - remove_similar: true, - clear_child_styles: true + var formats = { + valigntop: [{ + selector: 'td,th', + styles: { verticalAlign: 'top' } + }], + valignmiddle: [{ + selector: 'td,th', + styles: { verticalAlign: 'middle' } + }], + valignbottom: [{ + selector: 'td,th', + styles: { verticalAlign: 'bottom' } + }], + alignleft: [ + { + selector: 'figure.image', + collapsed: false, + classes: 'align-left', + ceFalseOverride: true, + preview: 'font-family font-size' + }, + { + selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', + styles: { textAlign: 'left' }, + inherit: false, + preview: false, + defaultBlock: 'div' + }, + { + selector: 'img,table', + collapsed: false, + styles: { float: 'left' }, + preview: 'font-family font-size' + } + ], + aligncenter: [ + { + selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', + styles: { textAlign: 'center' }, + inherit: false, + preview: 'font-family font-size', + defaultBlock: 'div' + }, + { + selector: 'figure.image', + collapsed: false, + classes: 'align-center', + ceFalseOverride: true, + preview: 'font-family font-size' + }, + { + selector: 'img', + collapsed: false, + styles: { + display: 'block', + marginLeft: 'auto', + marginRight: 'auto' }, - fontname: { - inline: 'span', - toggle: false, - styles: {fontFamily: '%value'}, - clear_child_styles: true + preview: false + }, + { + selector: 'table', + collapsed: false, + styles: { + marginLeft: 'auto', + marginRight: 'auto' }, - fontsize: { - inline: 'span', - toggle: false, - styles: {fontSize: '%value'}, - clear_child_styles: true - }, - lineheight: { - selector: 'h1,h2,h3,h4,h5,h6,p,li,td,th,div', - defaultBlock: 'p', - styles: {lineHeight: '%value'} - }, - fontsize_class: { - inline: 'span', - attributes: {class: '%value'} - }, - blockquote: { - block: 'blockquote', - wrapper: true, - remove: 'all' - }, - subscript: {inline: 'sub'}, - superscript: {inline: 'sup'}, - code: {inline: 'code'}, - link: { - inline: 'a', - selector: 'a', - remove: 'all', - split: true, - deep: true, - onmatch: function (node, _fmt, _itemName) { - return isElement$1(node) && node.hasAttribute('href'); - }, - onformat: function (elm, _fmt, vars) { - Tools.each(vars, function (value, key) { - dom.setAttrib(elm, key, value); - }); - } - }, - removeformat: [ - { - selector: 'b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins', - remove: 'all', - split: true, - expand: false, - block_expand: true, - deep: true - }, - { - selector: 'span', - attributes: [ - 'style', - 'class' - ], - remove: 'empty', - split: true, - expand: false, - deep: true - }, - { - selector: '*', - attributes: [ - 'style', - 'class' - ], - split: false, - expand: false, - deep: true - } + preview: 'font-family font-size' + } + ], + alignright: [ + { + selector: 'figure.image', + collapsed: false, + classes: 'align-right', + ceFalseOverride: true, + preview: 'font-family font-size' + }, + { + selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', + styles: { textAlign: 'right' }, + inherit: false, + preview: 'font-family font-size', + defaultBlock: 'div' + }, + { + selector: 'img,table', + collapsed: false, + styles: { float: 'right' }, + preview: 'font-family font-size' + } + ], + alignjustify: [{ + selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', + styles: { textAlign: 'justify' }, + inherit: false, + defaultBlock: 'div', + preview: 'font-family font-size' + }], + bold: [ + { + inline: 'strong', + remove: 'all', + preserve_attributes: [ + 'class', + 'style' ] + }, + { + inline: 'span', + styles: { fontWeight: 'bold' } + }, + { + inline: 'b', + remove: 'all', + preserve_attributes: [ + 'class', + 'style' + ] + } + ], + italic: [ + { + inline: 'em', + remove: 'all', + preserve_attributes: [ + 'class', + 'style' + ] + }, + { + inline: 'span', + styles: { fontStyle: 'italic' } + }, + { + inline: 'i', + remove: 'all', + preserve_attributes: [ + 'class', + 'style' + ] + } + ], + underline: [ + { + inline: 'span', + styles: { textDecoration: 'underline' }, + exact: true + }, + { + inline: 'u', + remove: 'all', + preserve_attributes: [ + 'class', + 'style' + ] + } + ], + strikethrough: [ + { + inline: 'span', + styles: { textDecoration: 'line-through' }, + exact: true + }, + { + inline: 'strike', + remove: 'all', + preserve_attributes: [ + 'class', + 'style' + ] + }, + { + inline: 's', + remove: 'all', + preserve_attributes: [ + 'class', + 'style' + ] + } + ], + forecolor: { + inline: 'span', + styles: { color: '%value' }, + links: true, + remove_similar: true, + clear_child_styles: true + }, + hilitecolor: { + inline: 'span', + styles: { backgroundColor: '%value' }, + links: true, + remove_similar: true, + clear_child_styles: true + }, + fontname: { + inline: 'span', + toggle: false, + styles: { fontFamily: '%value' }, + clear_child_styles: true + }, + fontsize: { + inline: 'span', + toggle: false, + styles: { fontSize: '%value' }, + clear_child_styles: true + }, + lineheight: { + selector: 'h1,h2,h3,h4,h5,h6,p,li,td,th,div', + defaultBlock: 'p', + styles: { lineHeight: '%value' } + }, + fontsize_class: { + inline: 'span', + attributes: { class: '%value' } + }, + blockquote: { + block: 'blockquote', + wrapper: true, + remove: 'all' + }, + subscript: { inline: 'sub' }, + superscript: { inline: 'sup' }, + code: { inline: 'code' }, + link: { + inline: 'a', + selector: 'a', + remove: 'all', + split: true, + deep: true, + onmatch: function (node, _fmt, _itemName) { + return isElement$1(node) && node.hasAttribute('href'); + }, + onformat: function (elm, _fmt, vars) { + Tools.each(vars, function (value, key) { + dom.setAttrib(elm, key, value); + }); + } + }, + removeformat: [ + { + selector: 'b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins', + remove: 'all', + split: true, + expand: false, + block_expand: true, + deep: true + }, + { + selector: 'span', + attributes: [ + 'style', + 'class' + ], + remove: 'empty', + split: true, + expand: false, + deep: true + }, + { + selector: '*', + attributes: [ + 'style', + 'class' + ], + split: false, + expand: false, + deep: true + } + ] + }; + Tools.each('p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp'.split(/\s/), function (name) { + formats[name] = { + block: name, + remove: 'all' }; - Tools.each('p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp'.split(/\s/), function (name) { - formats[name] = { - block: name, - remove: 'all' - }; - }); - return formats; + }); + return formats; }; function FormatRegistry(editor) { - var formats = {}; - var get = function (name) { - return name ? formats[name] : formats; - }; - var has$1 = function (name) { - return has(formats, name); - }; - var register = function (name, format) { - if (name) { - if (typeof name !== 'string') { - Tools.each(name, function (format, name) { - register(name, format); - }); - } else { - if (!isArray(format)) { - format = [format]; - } - Tools.each(format, function (format) { - if (typeof format.deep === 'undefined') { - format.deep = !format.selector; - } - if (typeof format.split === 'undefined') { - format.split = !format.selector || format.inline; - } - if (typeof format.remove === 'undefined' && format.selector && !format.inline) { - format.remove = 'none'; - } - if (format.selector && format.inline) { - format.mixed = true; - format.block_expand = true; - } - if (typeof format.classes === 'string') { - format.classes = format.classes.split(/\s+/); - } - }); - formats[name] = format; - } - } - }; - var unregister = function (name) { - if (name && formats[name]) { - delete formats[name]; - } - return formats; - }; - register(get$a(editor.dom)); - register(getFormats(editor)); - return { - get: get, - has: has$1, - register: register, - unregister: unregister - }; + var formats = {}; + var get = function (name) { + return name ? formats[name] : formats; + }; + var has$1 = function (name) { + return has(formats, name); + }; + var register = function (name, format) { + if (name) { + if (typeof name !== 'string') { + Tools.each(name, function (format, name) { + register(name, format); + }); + } else { + if (!isArray(format)) { + format = [format]; + } + Tools.each(format, function (format) { + if (typeof format.deep === 'undefined') { + format.deep = !format.selector; + } + if (typeof format.split === 'undefined') { + format.split = !format.selector || format.inline; + } + if (typeof format.remove === 'undefined' && format.selector && !format.inline) { + format.remove = 'none'; + } + if (format.selector && format.inline) { + format.mixed = true; + format.block_expand = true; + } + if (typeof format.classes === 'string') { + format.classes = format.classes.split(/\s+/); + } + }); + formats[name] = format; + } + } + }; + var unregister = function (name) { + if (name && formats[name]) { + delete formats[name]; + } + return formats; + }; + register(get$a(editor.dom)); + register(getFormats(editor)); + return { + get: get, + has: has$1, + register: register, + unregister: unregister + }; } var each$e = Tools.each; var dom = DOMUtils$1.DOM; var parsedSelectorToHtml = function (ancestry, editor) { - var elm, item, fragment; - var schema = editor && editor.schema || Schema({}); - var decorate = function (elm, item) { - if (item.classes.length) { - dom.addClass(elm, item.classes.join(' ')); - } - dom.setAttribs(elm, item.attrs); - }; - var createElement = function (sItem) { - item = typeof sItem === 'string' ? { - name: sItem, - classes: [], - attrs: {} - } : sItem; - var elm = dom.create(item.name); - decorate(elm, item); - return elm; - }; - var getRequiredParent = function (elm, candidate) { - var name = typeof elm !== 'string' ? elm.nodeName.toLowerCase() : elm; - var elmRule = schema.getElementRule(name); - var parentsRequired = elmRule && elmRule.parentsRequired; - if (parentsRequired && parentsRequired.length) { - return candidate && Tools.inArray(parentsRequired, candidate) !== -1 ? candidate : parentsRequired[0]; - } else { - return false; - } - }; - var wrapInHtml = function (elm, ancestry, siblings) { - var parent, parentCandidate; - var ancestor = ancestry.length > 0 && ancestry[0]; - var ancestorName = ancestor && ancestor.name; - var parentRequired = getRequiredParent(elm, ancestorName); - if (parentRequired) { - if (ancestorName === parentRequired) { - parentCandidate = ancestry[0]; - ancestry = ancestry.slice(1); - } else { - parentCandidate = parentRequired; - } - } else if (ancestor) { - parentCandidate = ancestry[0]; - ancestry = ancestry.slice(1); - } else if (!siblings) { - return elm; - } - if (parentCandidate) { - parent = createElement(parentCandidate); - parent.appendChild(elm); - } - if (siblings) { - if (!parent) { - parent = dom.create('div'); - parent.appendChild(elm); - } - Tools.each(siblings, function (sibling) { - var siblingElm = createElement(sibling); - parent.insertBefore(siblingElm, elm); - }); - } - return wrapInHtml(parent, ancestry, parentCandidate && parentCandidate.siblings); - }; - if (ancestry && ancestry.length) { - item = ancestry[0]; - elm = createElement(item); - fragment = dom.create('div'); - fragment.appendChild(wrapInHtml(elm, ancestry.slice(1), item.siblings)); - return fragment; + var elm, item, fragment; + var schema = editor && editor.schema || Schema({}); + var decorate = function (elm, item) { + if (item.classes.length) { + dom.addClass(elm, item.classes.join(' ')); + } + dom.setAttribs(elm, item.attrs); + }; + var createElement = function (sItem) { + item = typeof sItem === 'string' ? { + name: sItem, + classes: [], + attrs: {} + } : sItem; + var elm = dom.create(item.name); + decorate(elm, item); + return elm; + }; + var getRequiredParent = function (elm, candidate) { + var name = typeof elm !== 'string' ? elm.nodeName.toLowerCase() : elm; + var elmRule = schema.getElementRule(name); + var parentsRequired = elmRule && elmRule.parentsRequired; + if (parentsRequired && parentsRequired.length) { + return candidate && Tools.inArray(parentsRequired, candidate) !== -1 ? candidate : parentsRequired[0]; } else { - return ''; - } + return false; + } + }; + var wrapInHtml = function (elm, ancestry, siblings) { + var parent, parentCandidate; + var ancestor = ancestry.length > 0 && ancestry[0]; + var ancestorName = ancestor && ancestor.name; + var parentRequired = getRequiredParent(elm, ancestorName); + if (parentRequired) { + if (ancestorName === parentRequired) { + parentCandidate = ancestry[0]; + ancestry = ancestry.slice(1); + } else { + parentCandidate = parentRequired; + } + } else if (ancestor) { + parentCandidate = ancestry[0]; + ancestry = ancestry.slice(1); + } else if (!siblings) { + return elm; + } + if (parentCandidate) { + parent = createElement(parentCandidate); + parent.appendChild(elm); + } + if (siblings) { + if (!parent) { + parent = dom.create('div'); + parent.appendChild(elm); + } + Tools.each(siblings, function (sibling) { + var siblingElm = createElement(sibling); + parent.insertBefore(siblingElm, elm); + }); + } + return wrapInHtml(parent, ancestry, parentCandidate && parentCandidate.siblings); + }; + if (ancestry && ancestry.length) { + item = ancestry[0]; + elm = createElement(item); + fragment = dom.create('div'); + fragment.appendChild(wrapInHtml(elm, ancestry.slice(1), item.siblings)); + return fragment; + } else { + return ''; + } }; var parseSelectorItem = function (item) { - var tagName; - var obj = { - classes: [], - attrs: {} - }; - item = obj.selector = Tools.trim(item); - if (item !== '*') { - tagName = item.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g, function ($0, $1, $2, $3, $4) { - switch ($1) { - case '#': - obj.attrs.id = $2; - break; - case '.': - obj.classes.push($2); - break; - case ':': - if (Tools.inArray('checked disabled enabled read-only required'.split(' '), $2) !== -1) { - obj.attrs[$2] = $2; - } - break; - } - if ($3 === '[') { - var m = $4.match(/([\w\-]+)(?:\=\"([^\"]+))?/); - if (m) { - obj.attrs[m[1]] = m[2]; - } - } - return ''; - }); - } - obj.name = tagName || 'div'; - return obj; + var tagName; + var obj = { + classes: [], + attrs: {} + }; + item = obj.selector = Tools.trim(item); + if (item !== '*') { + tagName = item.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g, function ($0, $1, $2, $3, $4) { + switch ($1) { + case '#': + obj.attrs.id = $2; + break; + case '.': + obj.classes.push($2); + break; + case ':': + if (Tools.inArray('checked disabled enabled read-only required'.split(' '), $2) !== -1) { + obj.attrs[$2] = $2; + } + break; + } + if ($3 === '[') { + var m = $4.match(/([\w\-]+)(?:\=\"([^\"]+))?/); + if (m) { + obj.attrs[m[1]] = m[2]; + } + } + return ''; + }); + } + obj.name = tagName || 'div'; + return obj; }; var parseSelector = function (selector) { - if (!selector || typeof selector !== 'string') { - return []; + if (!selector || typeof selector !== 'string') { + return []; + } + selector = selector.split(/\s*,\s*/)[0]; + selector = selector.replace(/\s*(~\+|~|\+|>)\s*/g, '$1'); + return Tools.map(selector.split(/(?:>|\s+(?![^\[\]]+\]))/), function (item) { + var siblings = Tools.map(item.split(/(?:~\+|~|\+)/), parseSelectorItem); + var obj = siblings.pop(); + if (siblings.length) { + obj.siblings = siblings; } - selector = selector.split(/\s*,\s*/)[0]; - selector = selector.replace(/\s*(~\+|~|\+|>)\s*/g, '$1'); - return Tools.map(selector.split(/(?:>|\s+(?![^\[\]]+\]))/), function (item) { - var siblings = Tools.map(item.split(/(?:~\+|~|\+)/), parseSelectorItem); - var obj = siblings.pop(); - if (siblings.length) { - obj.siblings = siblings; - } - return obj; - }).reverse(); + return obj; + }).reverse(); }; var getCssText = function (editor, format) { - var name, previewFrag; - var previewCss = '', parentFontSize; - var previewStyles = getPreviewStyles(editor); - if (previewStyles === '') { - return ''; + var name, previewFrag; + var previewCss = '', parentFontSize; + var previewStyles = getPreviewStyles(editor); + if (previewStyles === '') { + return ''; + } + var removeVars = function (val) { + return val.replace(/%(\w+)/g, ''); + }; + if (typeof format === 'string') { + format = editor.formatter.get(format); + if (!format) { + return; + } + format = format[0]; + } + if ('preview' in format) { + var previewOpt = get$1(format, 'preview'); + if (previewOpt.is(false)) { + return ''; + } else { + previewStyles = previewOpt.getOr(previewStyles); + } + } + name = format.block || format.inline || 'span'; + var items = parseSelector(format.selector); + if (items.length) { + if (!items[0].name) { + items[0].name = name; + } + name = format.selector; + previewFrag = parsedSelectorToHtml(items, editor); + } else { + previewFrag = parsedSelectorToHtml([name], editor); + } + var previewElm = dom.select(name, previewFrag)[0] || previewFrag.firstChild; + each$e(format.styles, function (value, name) { + var newValue = removeVars(value); + if (newValue) { + dom.setStyle(previewElm, name, newValue); + } + }); + each$e(format.attributes, function (value, name) { + var newValue = removeVars(value); + if (newValue) { + dom.setAttrib(previewElm, name, newValue); + } + }); + each$e(format.classes, function (value) { + var newValue = removeVars(value); + if (!dom.hasClass(previewElm, newValue)) { + dom.addClass(previewElm, newValue); + } + }); + editor.fire('PreviewFormats'); + dom.setStyles(previewFrag, { + position: 'absolute', + left: -65535 + }); + editor.getBody().appendChild(previewFrag); + parentFontSize = dom.getStyle(editor.getBody(), 'fontSize', true); + parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0; + each$e(previewStyles.split(' '), function (name) { + var value = dom.getStyle(previewElm, name, true); + if (name === 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) { + value = dom.getStyle(editor.getBody(), name, true); + if (dom.toHex(value).toLowerCase() === '#ffffff') { + return; + } } - var removeVars = function (val) { - return val.replace(/%(\w+)/g, ''); - }; - if (typeof format === 'string') { - format = editor.formatter.get(format); - if (!format) { - return; - } - format = format[0]; + if (name === 'color') { + if (dom.toHex(value).toLowerCase() === '#000000') { + return; + } } - if ('preview' in format) { - var previewOpt = get$1(format, 'preview'); - if (previewOpt.is(false)) { - return ''; - } else { - previewStyles = previewOpt.getOr(previewStyles); + if (name === 'font-size') { + if (/em|%$/.test(value)) { + if (parentFontSize === 0) { + return; } + var numValue = parseFloat(value) / (/%$/.test(value) ? 100 : 1); + value = numValue * parentFontSize + 'px'; + } } - name = format.block || format.inline || 'span'; - var items = parseSelector(format.selector); - if (items.length) { - if (!items[0].name) { - items[0].name = name; - } - name = format.selector; - previewFrag = parsedSelectorToHtml(items, editor); - } else { - previewFrag = parsedSelectorToHtml([name], editor); + if (name === 'border' && value) { + previewCss += 'padding:0 2px;'; } - var previewElm = dom.select(name, previewFrag)[0] || previewFrag.firstChild; - each$e(format.styles, function (value, name) { - var newValue = removeVars(value); - if (newValue) { - dom.setStyle(previewElm, name, newValue); - } - }); - each$e(format.attributes, function (value, name) { - var newValue = removeVars(value); - if (newValue) { - dom.setAttrib(previewElm, name, newValue); - } - }); - each$e(format.classes, function (value) { - var newValue = removeVars(value); - if (!dom.hasClass(previewElm, newValue)) { - dom.addClass(previewElm, newValue); - } - }); - editor.fire('PreviewFormats'); - dom.setStyles(previewFrag, { - position: 'absolute', - left: -65535 - }); - editor.getBody().appendChild(previewFrag); - parentFontSize = dom.getStyle(editor.getBody(), 'fontSize', true); - parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0; - each$e(previewStyles.split(' '), function (name) { - var value = dom.getStyle(previewElm, name, true); - if (name === 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) { - value = dom.getStyle(editor.getBody(), name, true); - if (dom.toHex(value).toLowerCase() === '#ffffff') { - return; - } - } - if (name === 'color') { - if (dom.toHex(value).toLowerCase() === '#000000') { - return; - } - } - if (name === 'font-size') { - if (/em|%$/.test(value)) { - if (parentFontSize === 0) { - return; - } - var numValue = parseFloat(value) / (/%$/.test(value) ? 100 : 1); - value = numValue * parentFontSize + 'px'; - } - } - if (name === 'border' && value) { - previewCss += 'padding:0 2px;'; - } - previewCss += name + ':' + value + ';'; - }); - editor.fire('AfterPreviewFormats'); - dom.remove(previewFrag); - return previewCss; + previewCss += name + ':' + value + ';'; + }); + editor.fire('AfterPreviewFormats'); + dom.remove(previewFrag); + return previewCss; }; var setup$6 = function (editor) { - editor.addShortcut('meta+b', '', 'Bold'); - editor.addShortcut('meta+i', '', 'Italic'); - editor.addShortcut('meta+u', '', 'Underline'); - for (var i = 1; i <= 6; i++) { - editor.addShortcut('access+' + i, '', [ - 'FormatBlock', - false, - 'h' + i - ]); - } - editor.addShortcut('access+7', '', [ - 'FormatBlock', - false, - 'p' - ]); - editor.addShortcut('access+8', '', [ - 'FormatBlock', - false, - 'div' - ]); - editor.addShortcut('access+9', '', [ - 'FormatBlock', - false, - 'address' + editor.addShortcut('meta+b', '', 'Bold'); + editor.addShortcut('meta+i', '', 'Italic'); + editor.addShortcut('meta+u', '', 'Underline'); + for (var i = 1; i <= 6; i++) { + editor.addShortcut('access+' + i, '', [ + 'FormatBlock', + false, + 'h' + i ]); + } + editor.addShortcut('access+7', '', [ + 'FormatBlock', + false, + 'p' + ]); + editor.addShortcut('access+8', '', [ + 'FormatBlock', + false, + 'div' + ]); + editor.addShortcut('access+9', '', [ + 'FormatBlock', + false, + 'address' + ]); }; var Formatter = function (editor) { - var formats = FormatRegistry(editor); - var formatChangeState = Cell(null); - setup$6(editor); - setup$3(editor); - return { - get: formats.get, - has: formats.has, - register: formats.register, - unregister: formats.unregister, - apply: function (name, vars, node) { - applyFormat$1(editor, name, vars, node); - }, - remove: function (name, vars, node, similar) { - removeFormat$1(editor, name, vars, node, similar); - }, - toggle: function (name, vars, node) { - toggleFormat(editor, name, vars, node); - }, - match: function (name, vars, node) { - return matchFormat(editor, name, vars, node); - }, - closest: function (names) { - return closestFormat(editor, names); - }, - matchAll: function (names, vars) { - return matchAllFormats(editor, names, vars); - }, - matchNode: function (node, names, vars, similar) { - return matchNodeFormat(editor, node, names, vars, similar); - }, - canApply: function (name) { - return canApplyFormat(editor, name); - }, - formatChanged: function (formats, callback, similar) { - return formatChanged(editor, formatChangeState, formats, callback, similar); - }, - getCssText: curry(getCssText, editor) - }; + var formats = FormatRegistry(editor); + var formatChangeState = Cell(null); + setup$6(editor); + setup$3(editor); + return { + get: formats.get, + has: formats.has, + register: formats.register, + unregister: formats.unregister, + apply: function (name, vars, node) { + applyFormat$1(editor, name, vars, node); + }, + remove: function (name, vars, node, similar) { + removeFormat$1(editor, name, vars, node, similar); + }, + toggle: function (name, vars, node) { + toggleFormat(editor, name, vars, node); + }, + match: function (name, vars, node) { + return matchFormat(editor, name, vars, node); + }, + closest: function (names) { + return closestFormat(editor, names); + }, + matchAll: function (names, vars) { + return matchAllFormats(editor, names, vars); + }, + matchNode: function (node, names, vars, similar) { + return matchNodeFormat(editor, node, names, vars, similar); + }, + canApply: function (name) { + return canApplyFormat(editor, name); + }, + formatChanged: function (formats, callback, similar) { + return formatChanged(editor, formatChangeState, formats, callback, similar); + }, + getCssText: curry(getCssText, editor) + }; }; var registerEvents$1 = function (editor, undoManager, locks) { - var isFirstTypedCharacter = Cell(false); - var addNonTypingUndoLevel = function (e) { - setTyping(undoManager, false, locks); - undoManager.add({}, e); - }; - editor.on('init', function () { - undoManager.add(); - }); - editor.on('BeforeExecCommand', function (e) { - var cmd = e.command.toLowerCase(); - if (cmd !== 'undo' && cmd !== 'redo' && cmd !== 'mcerepaint') { - endTyping(undoManager, locks); - undoManager.beforeChange(); - } - }); - editor.on('ExecCommand', function (e) { - var cmd = e.command.toLowerCase(); - if (cmd !== 'undo' && cmd !== 'redo' && cmd !== 'mcerepaint') { - addNonTypingUndoLevel(e); - } - }); - editor.on('ObjectResizeStart cut', function () { - undoManager.beforeChange(); - }); - editor.on('SaveContent ObjectResized blur', addNonTypingUndoLevel); - editor.on('dragend', addNonTypingUndoLevel); - editor.on('keyup', function (e) { - var keyCode = e.keyCode; - if (e.isDefaultPrevented()) { - return; - } - if (keyCode >= 33 && keyCode <= 36 || keyCode >= 37 && keyCode <= 40 || keyCode === 45 || e.ctrlKey) { - addNonTypingUndoLevel(); - editor.nodeChanged(); - } - if (keyCode === 46 || keyCode === 8) { - editor.nodeChanged(); - } - if (isFirstTypedCharacter.get() && undoManager.typing && isEq$4(createFromEditor(editor), undoManager.data[0]) === false) { - if (editor.isDirty() === false) { - editor.setDirty(true); - editor.fire('change', { - level: undoManager.data[0], - lastLevel: null - }); - } - editor.fire('TypingUndo'); - isFirstTypedCharacter.set(false); - editor.nodeChanged(); - } - }); - editor.on('keydown', function (e) { - var keyCode = e.keyCode; - if (e.isDefaultPrevented()) { - return; - } - if (keyCode >= 33 && keyCode <= 36 || keyCode >= 37 && keyCode <= 40 || keyCode === 45) { - if (undoManager.typing) { - addNonTypingUndoLevel(e); - } - return; - } - var modKey = e.ctrlKey && !e.altKey || e.metaKey; - if ((keyCode < 16 || keyCode > 20) && keyCode !== 224 && keyCode !== 91 && !undoManager.typing && !modKey) { - undoManager.beforeChange(); - setTyping(undoManager, true, locks); - undoManager.add({}, e); - isFirstTypedCharacter.set(true); - } - }); - editor.on('mousedown', function (e) { - if (undoManager.typing) { - addNonTypingUndoLevel(e); - } - }); - var isInsertReplacementText = function (event) { - return event.inputType === 'insertReplacementText'; - }; - var isInsertTextDataNull = function (event) { - return event.inputType === 'insertText' && event.data === null; - }; - var isInsertFromPasteOrDrop = function (event) { - return event.inputType === 'insertFromPaste' || event.inputType === 'insertFromDrop'; - }; - editor.on('input', function (e) { - if (e.inputType && (isInsertReplacementText(e) || isInsertTextDataNull(e) || isInsertFromPasteOrDrop(e))) { - addNonTypingUndoLevel(e); - } - }); - editor.on('AddUndo Undo Redo ClearUndos', function (e) { - if (!e.isDefaultPrevented()) { - editor.nodeChanged(); - } - }); + var isFirstTypedCharacter = Cell(false); + var addNonTypingUndoLevel = function (e) { + setTyping(undoManager, false, locks); + undoManager.add({}, e); + }; + editor.on('init', function () { + undoManager.add(); + }); + editor.on('BeforeExecCommand', function (e) { + var cmd = e.command.toLowerCase(); + if (cmd !== 'undo' && cmd !== 'redo' && cmd !== 'mcerepaint') { + endTyping(undoManager, locks); + undoManager.beforeChange(); + } + }); + editor.on('ExecCommand', function (e) { + var cmd = e.command.toLowerCase(); + if (cmd !== 'undo' && cmd !== 'redo' && cmd !== 'mcerepaint') { + addNonTypingUndoLevel(e); + } + }); + editor.on('ObjectResizeStart cut', function () { + undoManager.beforeChange(); + }); + editor.on('SaveContent ObjectResized blur', addNonTypingUndoLevel); + editor.on('dragend', addNonTypingUndoLevel); + editor.on('keyup', function (e) { + var keyCode = e.keyCode; + if (e.isDefaultPrevented()) { + return; + } + if (keyCode >= 33 && keyCode <= 36 || keyCode >= 37 && keyCode <= 40 || keyCode === 45 || e.ctrlKey) { + addNonTypingUndoLevel(); + editor.nodeChanged(); + } + if (keyCode === 46 || keyCode === 8) { + editor.nodeChanged(); + } + if (isFirstTypedCharacter.get() && undoManager.typing && isEq$4(createFromEditor(editor), undoManager.data[0]) === false) { + if (editor.isDirty() === false) { + editor.setDirty(true); + editor.fire('change', { + level: undoManager.data[0], + lastLevel: null + }); + } + editor.fire('TypingUndo'); + isFirstTypedCharacter.set(false); + editor.nodeChanged(); + } + }); + editor.on('keydown', function (e) { + var keyCode = e.keyCode; + if (e.isDefaultPrevented()) { + return; + } + if (keyCode >= 33 && keyCode <= 36 || keyCode >= 37 && keyCode <= 40 || keyCode === 45) { + if (undoManager.typing) { + addNonTypingUndoLevel(e); + } + return; + } + var modKey = e.ctrlKey && !e.altKey || e.metaKey; + if ((keyCode < 16 || keyCode > 20) && keyCode !== 224 && keyCode !== 91 && !undoManager.typing && !modKey) { + undoManager.beforeChange(); + setTyping(undoManager, true, locks); + undoManager.add({}, e); + isFirstTypedCharacter.set(true); + } + }); + editor.on('mousedown', function (e) { + if (undoManager.typing) { + addNonTypingUndoLevel(e); + } + }); + var isInsertReplacementText = function (event) { + return event.inputType === 'insertReplacementText'; + }; + var isInsertTextDataNull = function (event) { + return event.inputType === 'insertText' && event.data === null; + }; + var isInsertFromPasteOrDrop = function (event) { + return event.inputType === 'insertFromPaste' || event.inputType === 'insertFromDrop'; + }; + editor.on('input', function (e) { + if (e.inputType && (isInsertReplacementText(e) || isInsertTextDataNull(e) || isInsertFromPasteOrDrop(e))) { + addNonTypingUndoLevel(e); + } + }); + editor.on('AddUndo Undo Redo ClearUndos', function (e) { + if (!e.isDefaultPrevented()) { + editor.nodeChanged(); + } + }); }; var addKeyboardShortcuts = function (editor) { - editor.addShortcut('meta+z', '', 'Undo'); - editor.addShortcut('meta+y,meta+shift+z', '', 'Redo'); + editor.addShortcut('meta+z', '', 'Undo'); + editor.addShortcut('meta+y,meta+shift+z', '', 'Redo'); }; var UndoManager = function (editor) { - var beforeBookmark = Cell(Optional.none()); - var locks = Cell(0); - var index = Cell(0); - var undoManager = { - data: [], - typing: false, - beforeChange: function () { - beforeChange$1(editor, locks, beforeBookmark); - }, - add: function (level, event) { - return addUndoLevel$1(editor, undoManager, index, locks, beforeBookmark, level, event); - }, - undo: function () { - return undo$1(editor, undoManager, locks, index); - }, - redo: function () { - return redo$1(editor, index, undoManager.data); - }, - clear: function () { - clear$1(editor, undoManager, index); - }, - reset: function () { - reset$1(editor, undoManager); - }, - hasUndo: function () { - return hasUndo$1(editor, undoManager, index); - }, - hasRedo: function () { - return hasRedo$1(editor, undoManager, index); - }, - transact: function (callback) { - return transact$1(editor, undoManager, locks, callback); - }, - ignore: function (callback) { - ignore$1(editor, locks, callback); - }, - extra: function (callback1, callback2) { - extra$1(editor, undoManager, index, callback1, callback2); - } - }; - if (!isRtc(editor)) { - registerEvents$1(editor, undoManager, locks); + var beforeBookmark = Cell(Optional.none()); + var locks = Cell(0); + var index = Cell(0); + var undoManager = { + data: [], + typing: false, + beforeChange: function () { + beforeChange$1(editor, locks, beforeBookmark); + }, + add: function (level, event) { + return addUndoLevel$1(editor, undoManager, index, locks, beforeBookmark, level, event); + }, + undo: function () { + return undo$1(editor, undoManager, locks, index); + }, + redo: function () { + return redo$1(editor, index, undoManager.data); + }, + clear: function () { + clear$1(editor, undoManager, index); + }, + reset: function () { + reset$1(editor, undoManager); + }, + hasUndo: function () { + return hasUndo$1(editor, undoManager, index); + }, + hasRedo: function () { + return hasRedo$1(editor, undoManager, index); + }, + transact: function (callback) { + return transact$1(editor, undoManager, locks, callback); + }, + ignore: function (callback) { + ignore$1(editor, locks, callback); + }, + extra: function (callback1, callback2) { + extra$1(editor, undoManager, index, callback1, callback2); } - addKeyboardShortcuts(editor); - return undoManager; + }; + if (!isRtc(editor)) { + registerEvents$1(editor, undoManager, locks); + } + addKeyboardShortcuts(editor); + return undoManager; }; var nonTypingKeycodes = [ - 9, - 27, - VK.HOME, - VK.END, - 19, - 20, - 44, - 144, - 145, - 33, - 34, - 45, - 16, - 17, - 18, - 91, - 92, - 93, - VK.DOWN, - VK.UP, - VK.LEFT, - VK.RIGHT + 9, + 27, + VK.HOME, + VK.END, + 19, + 20, + 44, + 144, + 145, + 33, + 34, + 45, + 16, + 17, + 18, + 91, + 92, + 93, + VK.DOWN, + VK.UP, + VK.LEFT, + VK.RIGHT ].concat(Env.browser.isFirefox() ? [224] : []); var placeholderAttr = 'data-mce-placeholder'; var isKeyboardEvent = function (e) { - return e.type === 'keydown' || e.type === 'keyup'; + return e.type === 'keydown' || e.type === 'keyup'; }; var isDeleteEvent = function (e) { - var keyCode = e.keyCode; - return keyCode === VK.BACKSPACE || keyCode === VK.DELETE; + var keyCode = e.keyCode; + return keyCode === VK.BACKSPACE || keyCode === VK.DELETE; }; var isNonTypingKeyboardEvent = function (e) { - if (isKeyboardEvent(e)) { - var keyCode = e.keyCode; - return !isDeleteEvent(e) && (VK.metaKeyPressed(e) || e.altKey || keyCode >= 112 && keyCode <= 123 || contains(nonTypingKeycodes, keyCode)); - } else { - return false; - } + if (isKeyboardEvent(e)) { + var keyCode = e.keyCode; + return !isDeleteEvent(e) && (VK.metaKeyPressed(e) || e.altKey || keyCode >= 112 && keyCode <= 123 || contains(nonTypingKeycodes, keyCode)); + } else { + return false; + } }; var isTypingKeyboardEvent = function (e) { - return isKeyboardEvent(e) && !(isDeleteEvent(e) || e.type === 'keyup' && e.keyCode === 229); + return isKeyboardEvent(e) && !(isDeleteEvent(e) || e.type === 'keyup' && e.keyCode === 229); }; var isVisuallyEmpty = function (dom, rootElm, forcedRootBlock) { - if (isEmpty(SugarElement.fromDom(rootElm), false)) { - var isForcedRootBlockFalse = forcedRootBlock === ''; - var firstElement = rootElm.firstElementChild; - if (!firstElement) { - return true; - } else if (dom.getStyle(rootElm.firstElementChild, 'padding-left') || dom.getStyle(rootElm.firstElementChild, 'padding-right')) { - return false; - } else { - return isForcedRootBlockFalse ? !dom.isBlock(firstElement) : forcedRootBlock === firstElement.nodeName.toLowerCase(); - } + if (isEmpty(SugarElement.fromDom(rootElm), false)) { + var isForcedRootBlockFalse = forcedRootBlock === ''; + var firstElement = rootElm.firstElementChild; + if (!firstElement) { + return true; + } else if (dom.getStyle(rootElm.firstElementChild, 'padding-left') || dom.getStyle(rootElm.firstElementChild, 'padding-right')) { + return false; } else { - return false; + return isForcedRootBlockFalse ? !dom.isBlock(firstElement) : forcedRootBlock === firstElement.nodeName.toLowerCase(); } + } else { + return false; + } }; var setup$7 = function (editor) { - var dom = editor.dom; - var rootBlock = getForcedRootBlock(editor); - var placeholder = getPlaceholder(editor); - var updatePlaceholder = function (e, initial) { - if (isNonTypingKeyboardEvent(e)) { - return; - } - var body = editor.getBody(); - var showPlaceholder = isTypingKeyboardEvent(e) ? false : isVisuallyEmpty(dom, body, rootBlock); - var isPlaceholderShown = dom.getAttrib(body, placeholderAttr) !== ''; - if (isPlaceholderShown !== showPlaceholder || initial) { - dom.setAttrib(body, placeholderAttr, showPlaceholder ? placeholder : null); - dom.setAttrib(body, 'aria-placeholder', showPlaceholder ? placeholder : null); - firePlaceholderToggle(editor, showPlaceholder); - editor.on(showPlaceholder ? 'keydown' : 'keyup', updatePlaceholder); - editor.off(showPlaceholder ? 'keyup' : 'keydown', updatePlaceholder); - } - }; - if (placeholder) { - editor.on('init', function (e) { - updatePlaceholder(e, true); - editor.on('change SetContent ExecCommand', updatePlaceholder); - editor.on('paste', function (e) { - return Delay.setEditorTimeout(editor, function () { - return updatePlaceholder(e); - }); - }); - }); + var dom = editor.dom; + var rootBlock = getForcedRootBlock(editor); + var placeholder = getPlaceholder(editor); + var updatePlaceholder = function (e, initial) { + if (isNonTypingKeyboardEvent(e)) { + return; + } + var body = editor.getBody(); + var showPlaceholder = isTypingKeyboardEvent(e) ? false : isVisuallyEmpty(dom, body, rootBlock); + var isPlaceholderShown = dom.getAttrib(body, placeholderAttr) !== ''; + if (isPlaceholderShown !== showPlaceholder || initial) { + dom.setAttrib(body, placeholderAttr, showPlaceholder ? placeholder : null); + dom.setAttrib(body, 'aria-placeholder', showPlaceholder ? placeholder : null); + firePlaceholderToggle(editor, showPlaceholder); + editor.on(showPlaceholder ? 'keydown' : 'keyup', updatePlaceholder); + editor.off(showPlaceholder ? 'keyup' : 'keydown', updatePlaceholder); } + }; + if (placeholder) { + editor.on('init', function (e) { + updatePlaceholder(e, true); + editor.on('change SetContent ExecCommand', updatePlaceholder); + editor.on('paste', function (e) { + return Delay.setEditorTimeout(editor, function () { + return updatePlaceholder(e); + }); + }); + }); + } }; var strongRtl = /[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/; var hasStrongRtl = function (text) { - return strongRtl.test(text); + return strongRtl.test(text); }; var isInlineTarget = function (editor, elm) { - return is$1(SugarElement.fromDom(elm), getInlineBoundarySelector(editor)); + return is$1(SugarElement.fromDom(elm), getInlineBoundarySelector(editor)); }; var isRtl$1 = function (element) { - return DOMUtils$1.DOM.getStyle(element, 'direction', true) === 'rtl' || hasStrongRtl(element.textContent); + return DOMUtils$1.DOM.getStyle(element, 'direction', true) === 'rtl' || hasStrongRtl(element.textContent); }; var findInlineParents = function (isInlineTarget, rootNode, pos) { - return filter(DOMUtils$1.DOM.getParents(pos.container(), '*', rootNode), isInlineTarget); + return filter(DOMUtils$1.DOM.getParents(pos.container(), '*', rootNode), isInlineTarget); }; var findRootInline = function (isInlineTarget, rootNode, pos) { - var parents = findInlineParents(isInlineTarget, rootNode, pos); - return Optional.from(parents[parents.length - 1]); + var parents = findInlineParents(isInlineTarget, rootNode, pos); + return Optional.from(parents[parents.length - 1]); }; var hasSameParentBlock = function (rootNode, node1, node2) { - var block1 = getParentBlock(node1, rootNode); - var block2 = getParentBlock(node2, rootNode); - return block1 && block1 === block2; + var block1 = getParentBlock(node1, rootNode); + var block2 = getParentBlock(node2, rootNode); + return block1 && block1 === block2; }; var isAtZwsp = function (pos) { - return isBeforeInline(pos) || isAfterInline(pos); + return isBeforeInline(pos) || isAfterInline(pos); }; var normalizePosition = function (forward, pos) { - if (!pos) { - return pos; - } - var container = pos.container(), offset = pos.offset(); - if (forward) { - if (isCaretContainerInline(container)) { - if (isText$1(container.nextSibling)) { - return CaretPosition$1(container.nextSibling, 0); - } else { - return CaretPosition$1.after(container); - } - } else { - return isBeforeInline(pos) ? CaretPosition$1(container, offset + 1) : pos; - } + if (!pos) { + return pos; + } + var container = pos.container(), offset = pos.offset(); + if (forward) { + if (isCaretContainerInline(container)) { + if (isText$1(container.nextSibling)) { + return CaretPosition$1(container.nextSibling, 0); + } else { + return CaretPosition$1.after(container); + } } else { - if (isCaretContainerInline(container)) { - if (isText$1(container.previousSibling)) { - return CaretPosition$1(container.previousSibling, container.previousSibling.data.length); - } else { - return CaretPosition$1.before(container); - } - } else { - return isAfterInline(pos) ? CaretPosition$1(container, offset - 1) : pos; - } + return isBeforeInline(pos) ? CaretPosition$1(container, offset + 1) : pos; + } + } else { + if (isCaretContainerInline(container)) { + if (isText$1(container.previousSibling)) { + return CaretPosition$1(container.previousSibling, container.previousSibling.data.length); + } else { + return CaretPosition$1.before(container); + } + } else { + return isAfterInline(pos) ? CaretPosition$1(container, offset - 1) : pos; } + } }; var normalizeForwards = curry(normalizePosition, true); var normalizeBackwards = curry(normalizePosition, false); var isBeforeRoot = function (rootNode) { - return function (elm) { - return eq$2(rootNode, SugarElement.fromDom(elm.dom.parentNode)); - }; + return function (elm) { + return eq$2(rootNode, SugarElement.fromDom(elm.dom.parentNode)); + }; }; var getParentBlock$1 = function (rootNode, elm) { - return contains$2(rootNode, elm) ? closest(elm, function (element) { - return isTextBlock(element) || isListItem(element); - }, isBeforeRoot(rootNode)) : Optional.none(); + return contains$2(rootNode, elm) ? closest(elm, function (element) { + return isTextBlock(element) || isListItem(element); + }, isBeforeRoot(rootNode)) : Optional.none(); }; var placeCaretInEmptyBody = function (editor) { - var body = editor.getBody(); - var node = body.firstChild && editor.dom.isBlock(body.firstChild) ? body.firstChild : body; - editor.selection.setCursorLocation(node, 0); + var body = editor.getBody(); + var node = body.firstChild && editor.dom.isBlock(body.firstChild) ? body.firstChild : body; + editor.selection.setCursorLocation(node, 0); }; var paddEmptyBody = function (editor) { - if (editor.dom.isEmpty(editor.getBody())) { - editor.setContent(''); - placeCaretInEmptyBody(editor); - } + if (editor.dom.isEmpty(editor.getBody())) { + editor.setContent(''); + placeCaretInEmptyBody(editor); + } }; var willDeleteLastPositionInElement = function (forward, fromPos, elm) { - return lift2(firstPositionIn(elm), lastPositionIn(elm), function (firstPos, lastPos) { - var normalizedFirstPos = normalizePosition(true, firstPos); - var normalizedLastPos = normalizePosition(false, lastPos); - var normalizedFromPos = normalizePosition(false, fromPos); - if (forward) { - return nextPosition(elm, normalizedFromPos).exists(function (nextPos) { - return nextPos.isEqual(normalizedLastPos) && fromPos.isEqual(normalizedFirstPos); - }); - } else { - return prevPosition(elm, normalizedFromPos).exists(function (prevPos) { - return prevPos.isEqual(normalizedFirstPos) && fromPos.isEqual(normalizedLastPos); - }); - } - }).getOr(true); + return lift2(firstPositionIn(elm), lastPositionIn(elm), function (firstPos, lastPos) { + var normalizedFirstPos = normalizePosition(true, firstPos); + var normalizedLastPos = normalizePosition(false, lastPos); + var normalizedFromPos = normalizePosition(false, fromPos); + if (forward) { + return nextPosition(elm, normalizedFromPos).exists(function (nextPos) { + return nextPos.isEqual(normalizedLastPos) && fromPos.isEqual(normalizedFirstPos); + }); + } else { + return prevPosition(elm, normalizedFromPos).exists(function (prevPos) { + return prevPos.isEqual(normalizedFirstPos) && fromPos.isEqual(normalizedLastPos); + }); + } + }).getOr(true); }; var blockPosition = function (block, position) { - return { - block: block, - position: position - }; + return { + block: block, + position: position + }; }; var blockBoundary = function (from, to) { - return { - from: from, - to: to - }; + return { + from: from, + to: to + }; }; var getBlockPosition = function (rootNode, pos) { - var rootElm = SugarElement.fromDom(rootNode); - var containerElm = SugarElement.fromDom(pos.container()); - return getParentBlock$1(rootElm, containerElm).map(function (block) { - return blockPosition(block, pos); - }); + var rootElm = SugarElement.fromDom(rootNode); + var containerElm = SugarElement.fromDom(pos.container()); + return getParentBlock$1(rootElm, containerElm).map(function (block) { + return blockPosition(block, pos); + }); }; var isDifferentBlocks = function (blockBoundary) { - return eq$2(blockBoundary.from.block, blockBoundary.to.block) === false; + return eq$2(blockBoundary.from.block, blockBoundary.to.block) === false; }; var hasSameParent = function (blockBoundary) { - return parent(blockBoundary.from.block).bind(function (parent1) { - return parent(blockBoundary.to.block).filter(function (parent2) { - return eq$2(parent1, parent2); - }); - }).isSome(); + return parent(blockBoundary.from.block).bind(function (parent1) { + return parent(blockBoundary.to.block).filter(function (parent2) { + return eq$2(parent1, parent2); + }); + }).isSome(); }; var isEditable = function (blockBoundary) { - return isContentEditableFalse(blockBoundary.from.block.dom) === false && isContentEditableFalse(blockBoundary.to.block.dom) === false; + return isContentEditableFalse(blockBoundary.from.block.dom) === false && isContentEditableFalse(blockBoundary.to.block.dom) === false; }; var skipLastBr = function (rootNode, forward, blockPosition) { - if (isBr(blockPosition.position.getNode()) && isEmpty(blockPosition.block) === false) { - return positionIn(false, blockPosition.block.dom).bind(function (lastPositionInBlock) { - if (lastPositionInBlock.isEqual(blockPosition.position)) { - return fromPosition(forward, rootNode, lastPositionInBlock).bind(function (to) { - return getBlockPosition(rootNode, to); - }); - } else { - return Optional.some(blockPosition); - } - }).getOr(blockPosition); - } else { - return blockPosition; - } + if (isBr(blockPosition.position.getNode()) && isEmpty(blockPosition.block) === false) { + return positionIn(false, blockPosition.block.dom).bind(function (lastPositionInBlock) { + if (lastPositionInBlock.isEqual(blockPosition.position)) { + return fromPosition(forward, rootNode, lastPositionInBlock).bind(function (to) { + return getBlockPosition(rootNode, to); + }); + } else { + return Optional.some(blockPosition); + } + }).getOr(blockPosition); + } else { + return blockPosition; + } }; var readFromRange = function (rootNode, forward, rng) { - var fromBlockPos = getBlockPosition(rootNode, CaretPosition$1.fromRangeStart(rng)); - var toBlockPos = fromBlockPos.bind(function (blockPos) { - return fromPosition(forward, rootNode, blockPos.position).bind(function (to) { - return getBlockPosition(rootNode, to).map(function (blockPos) { - return skipLastBr(rootNode, forward, blockPos); - }); - }); - }); - return lift2(fromBlockPos, toBlockPos, blockBoundary).filter(function (blockBoundary) { - return isDifferentBlocks(blockBoundary) && hasSameParent(blockBoundary) && isEditable(blockBoundary); - }); + var fromBlockPos = getBlockPosition(rootNode, CaretPosition$1.fromRangeStart(rng)); + var toBlockPos = fromBlockPos.bind(function (blockPos) { + return fromPosition(forward, rootNode, blockPos.position).bind(function (to) { + return getBlockPosition(rootNode, to).map(function (blockPos) { + return skipLastBr(rootNode, forward, blockPos); + }); + }); + }); + return lift2(fromBlockPos, toBlockPos, blockBoundary).filter(function (blockBoundary) { + return isDifferentBlocks(blockBoundary) && hasSameParent(blockBoundary) && isEditable(blockBoundary); + }); }; var read$3 = function (rootNode, forward, rng) { - return rng.collapsed ? readFromRange(rootNode, forward, rng) : Optional.none(); + return rng.collapsed ? readFromRange(rootNode, forward, rng) : Optional.none(); }; var getChildrenUntilBlockBoundary = function (block) { - var children$1 = children(block); - return findIndex(children$1, isBlock).fold(function () { - return children$1; - }, function (index) { - return children$1.slice(0, index); - }); + var children$1 = children(block); + return findIndex(children$1, isBlock).fold(function () { + return children$1; + }, function (index) { + return children$1.slice(0, index); + }); }; var extractChildren = function (block) { - var children = getChildrenUntilBlockBoundary(block); - each(children, remove); - return children; + var children = getChildrenUntilBlockBoundary(block); + each(children, remove); + return children; }; var removeEmptyRoot = function (rootNode, block) { - var parents = parentsAndSelf(block, rootNode); - return find(parents.reverse(), function (element) { - return isEmpty(element); - }).each(remove); + var parents = parentsAndSelf(block, rootNode); + return find(parents.reverse(), function (element) { + return isEmpty(element); + }).each(remove); }; var isEmptyBefore = function (el) { - return filter(prevSiblings(el), function (el) { - return !isEmpty(el); - }).length === 0; + return filter(prevSiblings(el), function (el) { + return !isEmpty(el); + }).length === 0; }; var nestedBlockMerge = function (rootNode, fromBlock, toBlock, insertionPoint) { - if (isEmpty(toBlock)) { - fillWithPaddingBr(toBlock); - return firstPositionIn(toBlock.dom); - } - if (isEmptyBefore(insertionPoint) && isEmpty(fromBlock)) { - before(insertionPoint, SugarElement.fromTag('br')); - } - var position = prevPosition(toBlock.dom, CaretPosition$1.before(insertionPoint.dom)); - each(extractChildren(fromBlock), function (child) { - before(insertionPoint, child); - }); - removeEmptyRoot(rootNode, fromBlock); - return position; + if (isEmpty(toBlock)) { + fillWithPaddingBr(toBlock); + return firstPositionIn(toBlock.dom); + } + if (isEmptyBefore(insertionPoint) && isEmpty(fromBlock)) { + before(insertionPoint, SugarElement.fromTag('br')); + } + var position = prevPosition(toBlock.dom, CaretPosition$1.before(insertionPoint.dom)); + each(extractChildren(fromBlock), function (child) { + before(insertionPoint, child); + }); + removeEmptyRoot(rootNode, fromBlock); + return position; }; var sidelongBlockMerge = function (rootNode, fromBlock, toBlock) { - if (isEmpty(toBlock)) { - remove(toBlock); - if (isEmpty(fromBlock)) { - fillWithPaddingBr(fromBlock); - } - return firstPositionIn(fromBlock.dom); - } - var position = lastPositionIn(toBlock.dom); - each(extractChildren(fromBlock), function (child) { - append(toBlock, child); - }); - removeEmptyRoot(rootNode, fromBlock); - return position; + if (isEmpty(toBlock)) { + remove(toBlock); + if (isEmpty(fromBlock)) { + fillWithPaddingBr(fromBlock); + } + return firstPositionIn(fromBlock.dom); + } + var position = lastPositionIn(toBlock.dom); + each(extractChildren(fromBlock), function (child) { + append(toBlock, child); + }); + removeEmptyRoot(rootNode, fromBlock); + return position; }; var findInsertionPoint = function (toBlock, block) { - var parentsAndSelf$1 = parentsAndSelf(block, toBlock); - return Optional.from(parentsAndSelf$1[parentsAndSelf$1.length - 1]); + var parentsAndSelf$1 = parentsAndSelf(block, toBlock); + return Optional.from(parentsAndSelf$1[parentsAndSelf$1.length - 1]); }; var getInsertionPoint = function (fromBlock, toBlock) { - return contains$2(toBlock, fromBlock) ? findInsertionPoint(toBlock, fromBlock) : Optional.none(); + return contains$2(toBlock, fromBlock) ? findInsertionPoint(toBlock, fromBlock) : Optional.none(); }; var trimBr = function (first, block) { - positionIn(first, block.dom).map(function (position) { - return position.getNode(); - }).map(SugarElement.fromDom).filter(isBr$1).each(remove); + positionIn(first, block.dom).map(function (position) { + return position.getNode(); + }).map(SugarElement.fromDom).filter(isBr$1).each(remove); }; var mergeBlockInto = function (rootNode, fromBlock, toBlock) { - trimBr(true, fromBlock); - trimBr(false, toBlock); - return getInsertionPoint(fromBlock, toBlock).fold(curry(sidelongBlockMerge, rootNode, fromBlock, toBlock), curry(nestedBlockMerge, rootNode, fromBlock, toBlock)); + trimBr(true, fromBlock); + trimBr(false, toBlock); + return getInsertionPoint(fromBlock, toBlock).fold(curry(sidelongBlockMerge, rootNode, fromBlock, toBlock), curry(nestedBlockMerge, rootNode, fromBlock, toBlock)); }; var mergeBlocks = function (rootNode, forward, block1, block2) { - return forward ? mergeBlockInto(rootNode, block2, block1) : mergeBlockInto(rootNode, block1, block2); + return forward ? mergeBlockInto(rootNode, block2, block1) : mergeBlockInto(rootNode, block1, block2); }; var backspaceDelete$1 = function (editor, forward) { - var rootNode = SugarElement.fromDom(editor.getBody()); - var position = read$3(rootNode.dom, forward, editor.selection.getRng()).bind(function (blockBoundary) { - return mergeBlocks(rootNode, forward, blockBoundary.from.block, blockBoundary.to.block); - }); - position.each(function (pos) { - editor.selection.setRng(pos.toRange()); - }); - return position.isSome(); + var rootNode = SugarElement.fromDom(editor.getBody()); + var position = read$3(rootNode.dom, forward, editor.selection.getRng()).bind(function (blockBoundary) { + return mergeBlocks(rootNode, forward, blockBoundary.from.block, blockBoundary.to.block); + }); + position.each(function (pos) { + editor.selection.setRng(pos.toRange()); + }); + return position.isSome(); }; var deleteRangeMergeBlocks = function (rootNode, selection) { - var rng = selection.getRng(); - return lift2(getParentBlock$1(rootNode, SugarElement.fromDom(rng.startContainer)), getParentBlock$1(rootNode, SugarElement.fromDom(rng.endContainer)), function (block1, block2) { - if (eq$2(block1, block2) === false) { - rng.deleteContents(); - mergeBlocks(rootNode, true, block1, block2).each(function (pos) { - selection.setRng(pos.toRange()); - }); - return true; - } else { - return false; - } - }).getOr(false); + var rng = selection.getRng(); + return lift2(getParentBlock$1(rootNode, SugarElement.fromDom(rng.startContainer)), getParentBlock$1(rootNode, SugarElement.fromDom(rng.endContainer)), function (block1, block2) { + if (eq$2(block1, block2) === false) { + rng.deleteContents(); + mergeBlocks(rootNode, true, block1, block2).each(function (pos) { + selection.setRng(pos.toRange()); + }); + return true; + } else { + return false; + } + }).getOr(false); }; var isRawNodeInTable = function (root, rawNode) { - var node = SugarElement.fromDom(rawNode); - var isRoot = curry(eq$2, root); - return ancestor(node, isTableCell$1, isRoot).isSome(); + var node = SugarElement.fromDom(rawNode); + var isRoot = curry(eq$2, root); + return ancestor(node, isTableCell$1, isRoot).isSome(); }; var isSelectionInTable = function (root, rng) { - return isRawNodeInTable(root, rng.startContainer) || isRawNodeInTable(root, rng.endContainer); + return isRawNodeInTable(root, rng.startContainer) || isRawNodeInTable(root, rng.endContainer); }; var isEverythingSelected = function (root, rng) { - var noPrevious = prevPosition(root.dom, CaretPosition$1.fromRangeStart(rng)).isNone(); - var noNext = nextPosition(root.dom, CaretPosition$1.fromRangeEnd(rng)).isNone(); - return !isSelectionInTable(root, rng) && noPrevious && noNext; + var noPrevious = prevPosition(root.dom, CaretPosition$1.fromRangeStart(rng)).isNone(); + var noNext = nextPosition(root.dom, CaretPosition$1.fromRangeEnd(rng)).isNone(); + return !isSelectionInTable(root, rng) && noPrevious && noNext; }; var emptyEditor = function (editor) { - editor.setContent(''); - editor.selection.setCursorLocation(); - return true; + editor.setContent(''); + editor.selection.setCursorLocation(); + return true; }; var deleteRange$1 = function (editor) { - var rootNode = SugarElement.fromDom(editor.getBody()); - var rng = editor.selection.getRng(); - return isEverythingSelected(rootNode, rng) ? emptyEditor(editor) : deleteRangeMergeBlocks(rootNode, editor.selection); + var rootNode = SugarElement.fromDom(editor.getBody()); + var rng = editor.selection.getRng(); + return isEverythingSelected(rootNode, rng) ? emptyEditor(editor) : deleteRangeMergeBlocks(rootNode, editor.selection); }; var backspaceDelete$2 = function (editor, _forward) { - return editor.selection.isCollapsed() ? false : deleteRange$1(editor); + return editor.selection.isCollapsed() ? false : deleteRange$1(editor); }; var isContentEditableTrue$2 = isContentEditableTrue; var isContentEditableFalse$7 = isContentEditableFalse; var showCaret = function (direction, editor, node, before, scrollIntoView) { - return Optional.from(editor._selectionOverrides.showCaret(direction, node, before, scrollIntoView)); + return Optional.from(editor._selectionOverrides.showCaret(direction, node, before, scrollIntoView)); }; var getNodeRange = function (node) { - var rng = node.ownerDocument.createRange(); - rng.selectNode(node); - return rng; + var rng = node.ownerDocument.createRange(); + rng.selectNode(node); + return rng; }; var selectNode = function (editor, node) { - var e = editor.fire('BeforeObjectSelected', {target: node}); - if (e.isDefaultPrevented()) { - return Optional.none(); - } - return Optional.some(getNodeRange(node)); + var e = editor.fire('BeforeObjectSelected', { target: node }); + if (e.isDefaultPrevented()) { + return Optional.none(); + } + return Optional.some(getNodeRange(node)); }; var renderCaretAtRange = function (editor, range, scrollIntoView) { - var normalizedRange = normalizeRange(1, editor.getBody(), range); - var caretPosition = CaretPosition$1.fromRangeStart(normalizedRange); - var caretPositionNode = caretPosition.getNode(); - if (isInlineFakeCaretTarget(caretPositionNode)) { - return showCaret(1, editor, caretPositionNode, !caretPosition.isAtEnd(), false); - } - var caretPositionBeforeNode = caretPosition.getNode(true); - if (isInlineFakeCaretTarget(caretPositionBeforeNode)) { - return showCaret(1, editor, caretPositionBeforeNode, false, false); - } - var ceRoot = editor.dom.getParent(caretPosition.getNode(), function (node) { - return isContentEditableFalse$7(node) || isContentEditableTrue$2(node); - }); - if (isInlineFakeCaretTarget(ceRoot)) { - return showCaret(1, editor, ceRoot, false, scrollIntoView); - } - return Optional.none(); + var normalizedRange = normalizeRange(1, editor.getBody(), range); + var caretPosition = CaretPosition$1.fromRangeStart(normalizedRange); + var caretPositionNode = caretPosition.getNode(); + if (isInlineFakeCaretTarget(caretPositionNode)) { + return showCaret(1, editor, caretPositionNode, !caretPosition.isAtEnd(), false); + } + var caretPositionBeforeNode = caretPosition.getNode(true); + if (isInlineFakeCaretTarget(caretPositionBeforeNode)) { + return showCaret(1, editor, caretPositionBeforeNode, false, false); + } + var ceRoot = editor.dom.getParent(caretPosition.getNode(), function (node) { + return isContentEditableFalse$7(node) || isContentEditableTrue$2(node); + }); + if (isInlineFakeCaretTarget(ceRoot)) { + return showCaret(1, editor, ceRoot, false, scrollIntoView); + } + return Optional.none(); }; var renderRangeCaret = function (editor, range, scrollIntoView) { - return range.collapsed ? renderCaretAtRange(editor, range, scrollIntoView).getOr(range) : range; + return range.collapsed ? renderCaretAtRange(editor, range, scrollIntoView).getOr(range) : range; }; var isBeforeBoundary = function (pos) { - return isBeforeContentEditableFalse(pos) || isBeforeMedia(pos); + return isBeforeContentEditableFalse(pos) || isBeforeMedia(pos); }; var isAfterBoundary = function (pos) { - return isAfterContentEditableFalse(pos) || isAfterMedia(pos); + return isAfterContentEditableFalse(pos) || isAfterMedia(pos); }; var trimEmptyTextNode$1 = function (dom, node) { - if (isText$1(node) && node.data.length === 0) { - dom.remove(node); - } + if (isText$1(node) && node.data.length === 0) { + dom.remove(node); + } }; var deleteContentAndShowCaret = function (editor, range, node, direction, forward, peekCaretPosition) { - showCaret(direction, editor, peekCaretPosition.getNode(!forward), forward, true).each(function (caretRange) { - if (range.collapsed) { - var deleteRange = range.cloneRange(); - if (forward) { - deleteRange.setEnd(caretRange.startContainer, caretRange.startOffset); - } else { - deleteRange.setStart(caretRange.endContainer, caretRange.endOffset); - } - deleteRange.deleteContents(); - } else { - range.deleteContents(); - } - editor.selection.setRng(caretRange); - }); - trimEmptyTextNode$1(editor.dom, node); - return true; + showCaret(direction, editor, peekCaretPosition.getNode(!forward), forward, true).each(function (caretRange) { + if (range.collapsed) { + var deleteRange = range.cloneRange(); + if (forward) { + deleteRange.setEnd(caretRange.startContainer, caretRange.startOffset); + } else { + deleteRange.setStart(caretRange.endContainer, caretRange.endOffset); + } + deleteRange.deleteContents(); + } else { + range.deleteContents(); + } + editor.selection.setRng(caretRange); + }); + trimEmptyTextNode$1(editor.dom, node); + return true; }; var deleteBoundaryText = function (editor, forward) { - var range = editor.selection.getRng(); - if (!isText$1(range.commonAncestorContainer)) { - return false; - } - var direction = forward ? HDirection.Forwards : HDirection.Backwards; - var caretWalker = CaretWalker(editor.getBody()); - var getNextPosFn = curry(getVisualCaretPosition, forward ? caretWalker.next : caretWalker.prev); - var isBeforeFn = forward ? isBeforeBoundary : isAfterBoundary; - var caretPosition = getNormalizedRangeEndPoint(direction, editor.getBody(), range); - var nextCaretPosition = normalizePosition(forward, getNextPosFn(caretPosition)); - if (!nextCaretPosition || !isMoveInsideSameBlock(caretPosition, nextCaretPosition)) { - return false; - } else if (isBeforeFn(nextCaretPosition)) { - return deleteContentAndShowCaret(editor, range, caretPosition.getNode(), direction, forward, nextCaretPosition); - } - var peekCaretPosition = getNextPosFn(nextCaretPosition); - if (peekCaretPosition && isBeforeFn(peekCaretPosition)) { - if (isMoveInsideSameBlock(nextCaretPosition, peekCaretPosition)) { - return deleteContentAndShowCaret(editor, range, caretPosition.getNode(), direction, forward, peekCaretPosition); - } - } + var range = editor.selection.getRng(); + if (!isText$1(range.commonAncestorContainer)) { + return false; + } + var direction = forward ? HDirection.Forwards : HDirection.Backwards; + var caretWalker = CaretWalker(editor.getBody()); + var getNextPosFn = curry(getVisualCaretPosition, forward ? caretWalker.next : caretWalker.prev); + var isBeforeFn = forward ? isBeforeBoundary : isAfterBoundary; + var caretPosition = getNormalizedRangeEndPoint(direction, editor.getBody(), range); + var nextCaretPosition = normalizePosition(forward, getNextPosFn(caretPosition)); + if (!nextCaretPosition || !isMoveInsideSameBlock(caretPosition, nextCaretPosition)) { return false; + } else if (isBeforeFn(nextCaretPosition)) { + return deleteContentAndShowCaret(editor, range, caretPosition.getNode(), direction, forward, nextCaretPosition); + } + var peekCaretPosition = getNextPosFn(nextCaretPosition); + if (peekCaretPosition && isBeforeFn(peekCaretPosition)) { + if (isMoveInsideSameBlock(nextCaretPosition, peekCaretPosition)) { + return deleteContentAndShowCaret(editor, range, caretPosition.getNode(), direction, forward, peekCaretPosition); + } + } + return false; }; var backspaceDelete$3 = function (editor, forward) { - return deleteBoundaryText(editor, forward); + return deleteBoundaryText(editor, forward); }; var isCompoundElement = function (node) { - return isTableCell$1(SugarElement.fromDom(node)) || isListItem(SugarElement.fromDom(node)); + return isTableCell$1(SugarElement.fromDom(node)) || isListItem(SugarElement.fromDom(node)); }; var DeleteAction = Adt.generate([ - {remove: ['element']}, - {moveToElement: ['element']}, - {moveToPosition: ['position']} + { remove: ['element'] }, + { moveToElement: ['element'] }, + { moveToPosition: ['position'] } ]); var isAtContentEditableBlockCaret = function (forward, from) { - var elm = from.getNode(forward === false); - var caretLocation = forward ? 'after' : 'before'; - return isElement$1(elm) && elm.getAttribute('data-mce-caret') === caretLocation; + var elm = from.getNode(forward === false); + var caretLocation = forward ? 'after' : 'before'; + return isElement$1(elm) && elm.getAttribute('data-mce-caret') === caretLocation; }; var isDeleteFromCefDifferentBlocks = function (root, forward, from, to) { - var inSameBlock = function (elm) { - return isInline(SugarElement.fromDom(elm)) && !isInSameBlock(from, to, root); - }; - return getRelativeCefElm(!forward, from).fold(function () { - return getRelativeCefElm(forward, to).fold(never, inSameBlock); - }, inSameBlock); + var inSameBlock = function (elm) { + return isInline(SugarElement.fromDom(elm)) && !isInSameBlock(from, to, root); + }; + return getRelativeCefElm(!forward, from).fold(function () { + return getRelativeCefElm(forward, to).fold(never, inSameBlock); + }, inSameBlock); }; var deleteEmptyBlockOrMoveToCef = function (root, forward, from, to) { - var toCefElm = to.getNode(forward === false); - return getParentBlock$1(SugarElement.fromDom(root), SugarElement.fromDom(from.getNode())).map(function (blockElm) { - return isEmpty(blockElm) ? DeleteAction.remove(blockElm.dom) : DeleteAction.moveToElement(toCefElm); - }).orThunk(function () { - return Optional.some(DeleteAction.moveToElement(toCefElm)); - }); + var toCefElm = to.getNode(forward === false); + return getParentBlock$1(SugarElement.fromDom(root), SugarElement.fromDom(from.getNode())).map(function (blockElm) { + return isEmpty(blockElm) ? DeleteAction.remove(blockElm.dom) : DeleteAction.moveToElement(toCefElm); + }).orThunk(function () { + return Optional.some(DeleteAction.moveToElement(toCefElm)); + }); }; var findCefPosition = function (root, forward, from) { - return fromPosition(forward, root, from).bind(function (to) { - if (isCompoundElement(to.getNode())) { - return Optional.none(); - } else if (isDeleteFromCefDifferentBlocks(root, forward, from, to)) { - return Optional.none(); - } else if (forward && isContentEditableFalse(to.getNode())) { - return deleteEmptyBlockOrMoveToCef(root, forward, from, to); - } else if (forward === false && isContentEditableFalse(to.getNode(true))) { - return deleteEmptyBlockOrMoveToCef(root, forward, from, to); - } else if (forward && isAfterContentEditableFalse(from)) { - return Optional.some(DeleteAction.moveToPosition(to)); - } else if (forward === false && isBeforeContentEditableFalse(from)) { - return Optional.some(DeleteAction.moveToPosition(to)); - } else { - return Optional.none(); - } - }); - }; - var getContentEditableBlockAction = function (forward, elm) { - if (forward && isContentEditableFalse(elm.nextSibling)) { - return Optional.some(DeleteAction.moveToElement(elm.nextSibling)); - } else if (forward === false && isContentEditableFalse(elm.previousSibling)) { - return Optional.some(DeleteAction.moveToElement(elm.previousSibling)); + return fromPosition(forward, root, from).bind(function (to) { + if (isCompoundElement(to.getNode())) { + return Optional.none(); + } else if (isDeleteFromCefDifferentBlocks(root, forward, from, to)) { + return Optional.none(); + } else if (forward && isContentEditableFalse(to.getNode())) { + return deleteEmptyBlockOrMoveToCef(root, forward, from, to); + } else if (forward === false && isContentEditableFalse(to.getNode(true))) { + return deleteEmptyBlockOrMoveToCef(root, forward, from, to); + } else if (forward && isAfterContentEditableFalse(from)) { + return Optional.some(DeleteAction.moveToPosition(to)); + } else if (forward === false && isBeforeContentEditableFalse(from)) { + return Optional.some(DeleteAction.moveToPosition(to)); } else { - return Optional.none(); + return Optional.none(); } + }); }; - var skipMoveToActionFromInlineCefToContent = function (root, from, deleteAction) { - return deleteAction.fold(function (elm) { - return Optional.some(DeleteAction.remove(elm)); - }, function (elm) { - return Optional.some(DeleteAction.moveToElement(elm)); - }, function (to) { - if (isInSameBlock(from, to, root)) { - return Optional.none(); - } else { - return Optional.some(DeleteAction.moveToPosition(to)); - } - }); + var getContentEditableBlockAction = function (forward, elm) { + if (forward && isContentEditableFalse(elm.nextSibling)) { + return Optional.some(DeleteAction.moveToElement(elm.nextSibling)); + } else if (forward === false && isContentEditableFalse(elm.previousSibling)) { + return Optional.some(DeleteAction.moveToElement(elm.previousSibling)); + } else { + return Optional.none(); + } }; - var getContentEditableAction = function (root, forward, from) { - if (isAtContentEditableBlockCaret(forward, from)) { - return getContentEditableBlockAction(forward, from.getNode(forward === false)).fold(function () { - return findCefPosition(root, forward, from); - }, Optional.some); + var skipMoveToActionFromInlineCefToContent = function (root, from, deleteAction) { + return deleteAction.fold(function (elm) { + return Optional.some(DeleteAction.remove(elm)); + }, function (elm) { + return Optional.some(DeleteAction.moveToElement(elm)); + }, function (to) { + if (isInSameBlock(from, to, root)) { + return Optional.none(); } else { - return findCefPosition(root, forward, from).bind(function (deleteAction) { - return skipMoveToActionFromInlineCefToContent(root, from, deleteAction); - }); + return Optional.some(DeleteAction.moveToPosition(to)); } + }); + }; + var getContentEditableAction = function (root, forward, from) { + if (isAtContentEditableBlockCaret(forward, from)) { + return getContentEditableBlockAction(forward, from.getNode(forward === false)).fold(function () { + return findCefPosition(root, forward, from); + }, Optional.some); + } else { + return findCefPosition(root, forward, from).bind(function (deleteAction) { + return skipMoveToActionFromInlineCefToContent(root, from, deleteAction); + }); + } }; var read$4 = function (root, forward, rng) { - var normalizedRange = normalizeRange(forward ? 1 : -1, root, rng); - var from = CaretPosition$1.fromRangeStart(normalizedRange); - var rootElement = SugarElement.fromDom(root); - if (forward === false && isAfterContentEditableFalse(from)) { - return Optional.some(DeleteAction.remove(from.getNode(true))); - } else if (forward && isBeforeContentEditableFalse(from)) { - return Optional.some(DeleteAction.remove(from.getNode())); - } else if (forward === false && isBeforeContentEditableFalse(from) && isAfterBr(rootElement, from)) { - return findPreviousBr(rootElement, from).map(function (br) { - return DeleteAction.remove(br.getNode()); - }); - } else if (forward && isAfterContentEditableFalse(from) && isBeforeBr(rootElement, from)) { - return findNextBr(rootElement, from).map(function (br) { - return DeleteAction.remove(br.getNode()); - }); - } else { - return getContentEditableAction(root, forward, from); - } + var normalizedRange = normalizeRange(forward ? 1 : -1, root, rng); + var from = CaretPosition$1.fromRangeStart(normalizedRange); + var rootElement = SugarElement.fromDom(root); + if (forward === false && isAfterContentEditableFalse(from)) { + return Optional.some(DeleteAction.remove(from.getNode(true))); + } else if (forward && isBeforeContentEditableFalse(from)) { + return Optional.some(DeleteAction.remove(from.getNode())); + } else if (forward === false && isBeforeContentEditableFalse(from) && isAfterBr(rootElement, from)) { + return findPreviousBr(rootElement, from).map(function (br) { + return DeleteAction.remove(br.getNode()); + }); + } else if (forward && isAfterContentEditableFalse(from) && isBeforeBr(rootElement, from)) { + return findNextBr(rootElement, from).map(function (br) { + return DeleteAction.remove(br.getNode()); + }); + } else { + return getContentEditableAction(root, forward, from); + } }; var deleteElement$1 = function (editor, forward) { - return function (element) { - editor._selectionOverrides.hideFakeCaret(); - deleteElement(editor, forward, SugarElement.fromDom(element)); - return true; - }; + return function (element) { + editor._selectionOverrides.hideFakeCaret(); + deleteElement(editor, forward, SugarElement.fromDom(element)); + return true; + }; }; var moveToElement = function (editor, forward) { - return function (element) { - var pos = forward ? CaretPosition$1.before(element) : CaretPosition$1.after(element); - editor.selection.setRng(pos.toRange()); - return true; - }; + return function (element) { + var pos = forward ? CaretPosition$1.before(element) : CaretPosition$1.after(element); + editor.selection.setRng(pos.toRange()); + return true; + }; }; var moveToPosition = function (editor) { - return function (pos) { - editor.selection.setRng(pos.toRange()); - return true; - }; + return function (pos) { + editor.selection.setRng(pos.toRange()); + return true; + }; }; var getAncestorCe = function (editor, node) { - return Optional.from(getContentEditableRoot(editor.getBody(), node)); + return Optional.from(getContentEditableRoot(editor.getBody(), node)); }; var backspaceDeleteCaret = function (editor, forward) { - var selectedNode = editor.selection.getNode(); - return getAncestorCe(editor, selectedNode).filter(isContentEditableFalse).fold(function () { - return read$4(editor.getBody(), forward, editor.selection.getRng()).exists(function (deleteAction) { - return deleteAction.fold(deleteElement$1(editor, forward), moveToElement(editor, forward), moveToPosition(editor)); - }); - }, always); + var selectedNode = editor.selection.getNode(); + return getAncestorCe(editor, selectedNode).filter(isContentEditableFalse).fold(function () { + return read$4(editor.getBody(), forward, editor.selection.getRng()).exists(function (deleteAction) { + return deleteAction.fold(deleteElement$1(editor, forward), moveToElement(editor, forward), moveToPosition(editor)); + }); + }, always); }; var deleteOffscreenSelection = function (rootElement) { - each(descendants$1(rootElement, '.mce-offscreen-selection'), remove); + each(descendants$1(rootElement, '.mce-offscreen-selection'), remove); }; var backspaceDeleteRange = function (editor, forward) { - var selectedNode = editor.selection.getNode(); - if (isContentEditableFalse(selectedNode)) { - var hasCefAncestor = getAncestorCe(editor, selectedNode.parentNode).filter(isContentEditableFalse); - return hasCefAncestor.fold(function () { - deleteOffscreenSelection(SugarElement.fromDom(editor.getBody())); - deleteElement(editor, forward, SugarElement.fromDom(editor.selection.getNode())); - paddEmptyBody(editor); - return true; - }, function () { - return true; - }); - } - return false; + var selectedNode = editor.selection.getNode(); + if (isContentEditableFalse(selectedNode)) { + var hasCefAncestor = getAncestorCe(editor, selectedNode.parentNode).filter(isContentEditableFalse); + return hasCefAncestor.fold(function () { + deleteOffscreenSelection(SugarElement.fromDom(editor.getBody())); + deleteElement(editor, forward, SugarElement.fromDom(editor.selection.getNode())); + paddEmptyBody(editor); + return true; + }, function () { + return true; + }); + } + return false; }; var paddEmptyElement = function (editor) { - var dom = editor.dom, selection = editor.selection; - var ceRoot = getContentEditableRoot(editor.getBody(), selection.getNode()); - if (isContentEditableTrue(ceRoot) && dom.isBlock(ceRoot) && dom.isEmpty(ceRoot)) { - var br = dom.create('br', {'data-mce-bogus': '1'}); - dom.setHTML(ceRoot, ''); - ceRoot.appendChild(br); - selection.setRng(CaretPosition$1.before(br).toRange()); - } - return true; + var dom = editor.dom, selection = editor.selection; + var ceRoot = getContentEditableRoot(editor.getBody(), selection.getNode()); + if (isContentEditableTrue(ceRoot) && dom.isBlock(ceRoot) && dom.isEmpty(ceRoot)) { + var br = dom.create('br', { 'data-mce-bogus': '1' }); + dom.setHTML(ceRoot, ''); + ceRoot.appendChild(br); + selection.setRng(CaretPosition$1.before(br).toRange()); + } + return true; }; var backspaceDelete$4 = function (editor, forward) { - if (editor.selection.isCollapsed()) { - return backspaceDeleteCaret(editor, forward); - } else { - return backspaceDeleteRange(editor, forward); - } + if (editor.selection.isCollapsed()) { + return backspaceDeleteCaret(editor, forward); + } else { + return backspaceDeleteRange(editor, forward); + } }; var deleteCaret$1 = function (editor, forward) { - var fromPos = CaretPosition$1.fromRangeStart(editor.selection.getRng()); - return fromPosition(forward, editor.getBody(), fromPos).filter(function (pos) { - return forward ? isBeforeImageBlock(pos) : isAfterImageBlock(pos); - }).bind(function (pos) { - return Optional.from(getChildNodeAtRelativeOffset(forward ? 0 : -1, pos)); - }).exists(function (elm) { - editor.selection.select(elm); - return true; - }); + var fromPos = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + return fromPosition(forward, editor.getBody(), fromPos).filter(function (pos) { + return forward ? isBeforeImageBlock(pos) : isAfterImageBlock(pos); + }).bind(function (pos) { + return Optional.from(getChildNodeAtRelativeOffset(forward ? 0 : -1, pos)); + }).exists(function (elm) { + editor.selection.select(elm); + return true; + }); }; var backspaceDelete$5 = function (editor, forward) { - return editor.selection.isCollapsed() ? deleteCaret$1(editor, forward) : false; + return editor.selection.isCollapsed() ? deleteCaret$1(editor, forward) : false; }; var isText$8 = isText$1; var startsWithCaretContainer$1 = function (node) { - return isText$8(node) && node.data[0] === ZWSP; + return isText$8(node) && node.data[0] === ZWSP; }; var endsWithCaretContainer$1 = function (node) { - return isText$8(node) && node.data[node.data.length - 1] === ZWSP; + return isText$8(node) && node.data[node.data.length - 1] === ZWSP; }; var createZwsp = function (node) { - return node.ownerDocument.createTextNode(ZWSP); + return node.ownerDocument.createTextNode(ZWSP); }; var insertBefore$1 = function (node) { - if (isText$8(node.previousSibling)) { - if (endsWithCaretContainer$1(node.previousSibling)) { - return node.previousSibling; - } else { - node.previousSibling.appendData(ZWSP); - return node.previousSibling; - } - } else if (isText$8(node)) { - if (startsWithCaretContainer$1(node)) { - return node; - } else { - node.insertData(0, ZWSP); - return node; - } + if (isText$8(node.previousSibling)) { + if (endsWithCaretContainer$1(node.previousSibling)) { + return node.previousSibling; + } else { + node.previousSibling.appendData(ZWSP); + return node.previousSibling; + } + } else if (isText$8(node)) { + if (startsWithCaretContainer$1(node)) { + return node; } else { - var newNode = createZwsp(node); - node.parentNode.insertBefore(newNode, node); - return newNode; + node.insertData(0, ZWSP); + return node; } + } else { + var newNode = createZwsp(node); + node.parentNode.insertBefore(newNode, node); + return newNode; + } }; var insertAfter$1 = function (node) { - if (isText$8(node.nextSibling)) { - if (startsWithCaretContainer$1(node.nextSibling)) { - return node.nextSibling; - } else { - node.nextSibling.insertData(0, ZWSP); - return node.nextSibling; - } - } else if (isText$8(node)) { - if (endsWithCaretContainer$1(node)) { - return node; - } else { - node.appendData(ZWSP); - return node; - } + if (isText$8(node.nextSibling)) { + if (startsWithCaretContainer$1(node.nextSibling)) { + return node.nextSibling; } else { - var newNode = createZwsp(node); - if (node.nextSibling) { - node.parentNode.insertBefore(newNode, node.nextSibling); - } else { - node.parentNode.appendChild(newNode); - } - return newNode; + node.nextSibling.insertData(0, ZWSP); + return node.nextSibling; + } + } else if (isText$8(node)) { + if (endsWithCaretContainer$1(node)) { + return node; + } else { + node.appendData(ZWSP); + return node; } + } else { + var newNode = createZwsp(node); + if (node.nextSibling) { + node.parentNode.insertBefore(newNode, node.nextSibling); + } else { + node.parentNode.appendChild(newNode); + } + return newNode; + } }; var insertInline$1 = function (before, node) { - return before ? insertBefore$1(node) : insertAfter$1(node); + return before ? insertBefore$1(node) : insertAfter$1(node); }; var insertInlineBefore = curry(insertInline$1, true); var insertInlineAfter = curry(insertInline$1, false); var insertInlinePos = function (pos, before) { - if (isText$1(pos.container())) { - return insertInline$1(before, pos.container()); - } else { - return insertInline$1(before, pos.getNode()); - } + if (isText$1(pos.container())) { + return insertInline$1(before, pos.container()); + } else { + return insertInline$1(before, pos.getNode()); + } }; var isPosCaretContainer = function (pos, caret) { - var caretNode = caret.get(); - return caretNode && pos.container() === caretNode && isCaretContainerInline(caretNode); + var caretNode = caret.get(); + return caretNode && pos.container() === caretNode && isCaretContainerInline(caretNode); }; var renderCaret = function (caret, location) { - return location.fold(function (element) { + return location.fold(function (element) { + remove$5(caret.get()); + var text = insertInlineBefore(element); + caret.set(text); + return Optional.some(CaretPosition$1(text, text.length - 1)); + }, function (element) { + return firstPositionIn(element).map(function (pos) { + if (!isPosCaretContainer(pos, caret)) { remove$5(caret.get()); - var text = insertInlineBefore(element); + var text = insertInlinePos(pos, true); caret.set(text); - return Optional.some(CaretPosition$1(text, text.length - 1)); - }, function (element) { - return firstPositionIn(element).map(function (pos) { - if (!isPosCaretContainer(pos, caret)) { - remove$5(caret.get()); - var text = insertInlinePos(pos, true); - caret.set(text); - return CaretPosition$1(text, 1); - } else { - return CaretPosition$1(caret.get(), 1); - } - }); - }, function (element) { - return lastPositionIn(element).map(function (pos) { - if (!isPosCaretContainer(pos, caret)) { - remove$5(caret.get()); - var text = insertInlinePos(pos, false); - caret.set(text); - return CaretPosition$1(text, text.length - 1); - } else { - return CaretPosition$1(caret.get(), caret.get().length - 1); - } - }); - }, function (element) { + return CaretPosition$1(text, 1); + } else { + return CaretPosition$1(caret.get(), 1); + } + }); + }, function (element) { + return lastPositionIn(element).map(function (pos) { + if (!isPosCaretContainer(pos, caret)) { remove$5(caret.get()); - var text = insertInlineAfter(element); + var text = insertInlinePos(pos, false); caret.set(text); - return Optional.some(CaretPosition$1(text, 1)); + return CaretPosition$1(text, text.length - 1); + } else { + return CaretPosition$1(caret.get(), caret.get().length - 1); + } }); + }, function (element) { + remove$5(caret.get()); + var text = insertInlineAfter(element); + caret.set(text); + return Optional.some(CaretPosition$1(text, 1)); + }); }; var evaluateUntil = function (fns, args) { - for (var i = 0; i < fns.length; i++) { - var result = fns[i].apply(null, args); - if (result.isSome()) { - return result; - } + for (var i = 0; i < fns.length; i++) { + var result = fns[i].apply(null, args); + if (result.isSome()) { + return result; } - return Optional.none(); + } + return Optional.none(); }; var Location = Adt.generate([ - {before: ['element']}, - {start: ['element']}, - {end: ['element']}, - {after: ['element']} + { before: ['element'] }, + { start: ['element'] }, + { end: ['element'] }, + { after: ['element'] } ]); var rescope = function (rootNode, node) { - var parentBlock = getParentBlock(node, rootNode); - return parentBlock ? parentBlock : rootNode; + var parentBlock = getParentBlock(node, rootNode); + return parentBlock ? parentBlock : rootNode; }; var before$4 = function (isInlineTarget, rootNode, pos) { - var nPos = normalizeForwards(pos); - var scope = rescope(rootNode, nPos.container()); - return findRootInline(isInlineTarget, scope, nPos).fold(function () { - return nextPosition(scope, nPos).bind(curry(findRootInline, isInlineTarget, scope)).map(function (inline) { - return Location.before(inline); - }); - }, Optional.none); + var nPos = normalizeForwards(pos); + var scope = rescope(rootNode, nPos.container()); + return findRootInline(isInlineTarget, scope, nPos).fold(function () { + return nextPosition(scope, nPos).bind(curry(findRootInline, isInlineTarget, scope)).map(function (inline) { + return Location.before(inline); + }); + }, Optional.none); }; var isNotInsideFormatCaretContainer = function (rootNode, elm) { - return getParentCaretContainer(rootNode, elm) === null; + return getParentCaretContainer(rootNode, elm) === null; }; var findInsideRootInline = function (isInlineTarget, rootNode, pos) { - return findRootInline(isInlineTarget, rootNode, pos).filter(curry(isNotInsideFormatCaretContainer, rootNode)); + return findRootInline(isInlineTarget, rootNode, pos).filter(curry(isNotInsideFormatCaretContainer, rootNode)); }; var start = function (isInlineTarget, rootNode, pos) { - var nPos = normalizeBackwards(pos); - return findInsideRootInline(isInlineTarget, rootNode, nPos).bind(function (inline) { - var prevPos = prevPosition(inline, nPos); - return prevPos.isNone() ? Optional.some(Location.start(inline)) : Optional.none(); - }); + var nPos = normalizeBackwards(pos); + return findInsideRootInline(isInlineTarget, rootNode, nPos).bind(function (inline) { + var prevPos = prevPosition(inline, nPos); + return prevPos.isNone() ? Optional.some(Location.start(inline)) : Optional.none(); + }); }; var end = function (isInlineTarget, rootNode, pos) { - var nPos = normalizeForwards(pos); - return findInsideRootInline(isInlineTarget, rootNode, nPos).bind(function (inline) { - var nextPos = nextPosition(inline, nPos); - return nextPos.isNone() ? Optional.some(Location.end(inline)) : Optional.none(); - }); + var nPos = normalizeForwards(pos); + return findInsideRootInline(isInlineTarget, rootNode, nPos).bind(function (inline) { + var nextPos = nextPosition(inline, nPos); + return nextPos.isNone() ? Optional.some(Location.end(inline)) : Optional.none(); + }); }; var after$3 = function (isInlineTarget, rootNode, pos) { - var nPos = normalizeBackwards(pos); - var scope = rescope(rootNode, nPos.container()); - return findRootInline(isInlineTarget, scope, nPos).fold(function () { - return prevPosition(scope, nPos).bind(curry(findRootInline, isInlineTarget, scope)).map(function (inline) { - return Location.after(inline); - }); - }, Optional.none); + var nPos = normalizeBackwards(pos); + var scope = rescope(rootNode, nPos.container()); + return findRootInline(isInlineTarget, scope, nPos).fold(function () { + return prevPosition(scope, nPos).bind(curry(findRootInline, isInlineTarget, scope)).map(function (inline) { + return Location.after(inline); + }); + }, Optional.none); }; var isValidLocation = function (location) { - return isRtl$1(getElement(location)) === false; + return isRtl$1(getElement(location)) === false; }; var readLocation = function (isInlineTarget, rootNode, pos) { - var location = evaluateUntil([ - before$4, - start, - end, - after$3 - ], [ - isInlineTarget, - rootNode, - pos - ]); - return location.filter(isValidLocation); + var location = evaluateUntil([ + before$4, + start, + end, + after$3 + ], [ + isInlineTarget, + rootNode, + pos + ]); + return location.filter(isValidLocation); }; var getElement = function (location) { - return location.fold(identity, identity, identity, identity); + return location.fold(identity, identity, identity, identity); }; var getName = function (location) { - return location.fold(constant('before'), constant('start'), constant('end'), constant('after')); + return location.fold(constant('before'), constant('start'), constant('end'), constant('after')); }; var outside = function (location) { - return location.fold(Location.before, Location.before, Location.after, Location.after); + return location.fold(Location.before, Location.before, Location.after, Location.after); }; var inside = function (location) { - return location.fold(Location.start, Location.start, Location.end, Location.end); + return location.fold(Location.start, Location.start, Location.end, Location.end); }; var isEq$5 = function (location1, location2) { - return getName(location1) === getName(location2) && getElement(location1) === getElement(location2); + return getName(location1) === getName(location2) && getElement(location1) === getElement(location2); }; var betweenInlines = function (forward, isInlineTarget, rootNode, from, to, location) { - return lift2(findRootInline(isInlineTarget, rootNode, from), findRootInline(isInlineTarget, rootNode, to), function (fromInline, toInline) { - if (fromInline !== toInline && hasSameParentBlock(rootNode, fromInline, toInline)) { - return Location.after(forward ? fromInline : toInline); - } else { - return location; - } - }).getOr(location); + return lift2(findRootInline(isInlineTarget, rootNode, from), findRootInline(isInlineTarget, rootNode, to), function (fromInline, toInline) { + if (fromInline !== toInline && hasSameParentBlock(rootNode, fromInline, toInline)) { + return Location.after(forward ? fromInline : toInline); + } else { + return location; + } + }).getOr(location); }; var skipNoMovement = function (fromLocation, toLocation) { - return fromLocation.fold(always, function (fromLocation) { - return !isEq$5(fromLocation, toLocation); - }); + return fromLocation.fold(always, function (fromLocation) { + return !isEq$5(fromLocation, toLocation); + }); }; var findLocationTraverse = function (forward, isInlineTarget, rootNode, fromLocation, pos) { - var from = normalizePosition(forward, pos); - var to = fromPosition(forward, rootNode, from).map(curry(normalizePosition, forward)); - var location = to.fold(function () { - return fromLocation.map(outside); - }, function (to) { - return readLocation(isInlineTarget, rootNode, to).map(curry(betweenInlines, forward, isInlineTarget, rootNode, from, to)).filter(curry(skipNoMovement, fromLocation)); - }); - return location.filter(isValidLocation); + var from = normalizePosition(forward, pos); + var to = fromPosition(forward, rootNode, from).map(curry(normalizePosition, forward)); + var location = to.fold(function () { + return fromLocation.map(outside); + }, function (to) { + return readLocation(isInlineTarget, rootNode, to).map(curry(betweenInlines, forward, isInlineTarget, rootNode, from, to)).filter(curry(skipNoMovement, fromLocation)); + }); + return location.filter(isValidLocation); }; var findLocationSimple = function (forward, location) { - if (forward) { - return location.fold(compose(Optional.some, Location.start), Optional.none, compose(Optional.some, Location.after), Optional.none); - } else { - return location.fold(Optional.none, compose(Optional.some, Location.before), Optional.none, compose(Optional.some, Location.end)); - } + if (forward) { + return location.fold(compose(Optional.some, Location.start), Optional.none, compose(Optional.some, Location.after), Optional.none); + } else { + return location.fold(Optional.none, compose(Optional.some, Location.before), Optional.none, compose(Optional.some, Location.end)); + } }; var findLocation = function (forward, isInlineTarget, rootNode, pos) { - var from = normalizePosition(forward, pos); - var fromLocation = readLocation(isInlineTarget, rootNode, from); - return readLocation(isInlineTarget, rootNode, from).bind(curry(findLocationSimple, forward)).orThunk(function () { - return findLocationTraverse(forward, isInlineTarget, rootNode, fromLocation, pos); - }); + var from = normalizePosition(forward, pos); + var fromLocation = readLocation(isInlineTarget, rootNode, from); + return readLocation(isInlineTarget, rootNode, from).bind(curry(findLocationSimple, forward)).orThunk(function () { + return findLocationTraverse(forward, isInlineTarget, rootNode, fromLocation, pos); + }); }; var prevLocation = curry(findLocation, false); var nextLocation = curry(findLocation, true); var hasSelectionModifyApi = function (editor) { - return isFunction(editor.selection.getSel().modify); + return isFunction(editor.selection.getSel().modify); }; var moveRel = function (forward, selection, pos) { - var delta = forward ? 1 : -1; - selection.setRng(CaretPosition$1(pos.container(), pos.offset() + delta).toRange()); - selection.getSel().modify('move', forward ? 'forward' : 'backward', 'word'); - return true; + var delta = forward ? 1 : -1; + selection.setRng(CaretPosition$1(pos.container(), pos.offset() + delta).toRange()); + selection.getSel().modify('move', forward ? 'forward' : 'backward', 'word'); + return true; }; var moveByWord = function (forward, editor) { - var rng = editor.selection.getRng(); - var pos = forward ? CaretPosition$1.fromRangeEnd(rng) : CaretPosition$1.fromRangeStart(rng); - if (!hasSelectionModifyApi(editor)) { - return false; - } else if (forward && isBeforeInline(pos)) { - return moveRel(true, editor.selection, pos); - } else if (!forward && isAfterInline(pos)) { - return moveRel(false, editor.selection, pos); - } else { - return false; - } + var rng = editor.selection.getRng(); + var pos = forward ? CaretPosition$1.fromRangeEnd(rng) : CaretPosition$1.fromRangeStart(rng); + if (!hasSelectionModifyApi(editor)) { + return false; + } else if (forward && isBeforeInline(pos)) { + return moveRel(true, editor.selection, pos); + } else if (!forward && isAfterInline(pos)) { + return moveRel(false, editor.selection, pos); + } else { + return false; + } }; var setCaretPosition = function (editor, pos) { - var rng = editor.dom.createRng(); - rng.setStart(pos.container(), pos.offset()); - rng.setEnd(pos.container(), pos.offset()); - editor.selection.setRng(rng); + var rng = editor.dom.createRng(); + rng.setStart(pos.container(), pos.offset()); + rng.setEnd(pos.container(), pos.offset()); + editor.selection.setRng(rng); }; var setSelected = function (state, elm) { - if (state) { - elm.setAttribute('data-mce-selected', 'inline-boundary'); - } else { - elm.removeAttribute('data-mce-selected'); - } + if (state) { + elm.setAttribute('data-mce-selected', 'inline-boundary'); + } else { + elm.removeAttribute('data-mce-selected'); + } }; var renderCaretLocation = function (editor, caret, location) { - return renderCaret(caret, location).map(function (pos) { - setCaretPosition(editor, pos); - return location; - }); + return renderCaret(caret, location).map(function (pos) { + setCaretPosition(editor, pos); + return location; + }); }; var findLocation$1 = function (editor, caret, forward) { - var rootNode = editor.getBody(); - var from = CaretPosition$1.fromRangeStart(editor.selection.getRng()); - var isInlineTarget$1 = curry(isInlineTarget, editor); - var location = findLocation(forward, isInlineTarget$1, rootNode, from); - return location.bind(function (location) { - return renderCaretLocation(editor, caret, location); - }); + var rootNode = editor.getBody(); + var from = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + var isInlineTarget$1 = curry(isInlineTarget, editor); + var location = findLocation(forward, isInlineTarget$1, rootNode, from); + return location.bind(function (location) { + return renderCaretLocation(editor, caret, location); + }); }; var toggleInlines = function (isInlineTarget, dom, elms) { - var inlineBoundaries = map(descendants$1(SugarElement.fromDom(dom.getRoot()), '*[data-mce-selected="inline-boundary"]'), function (e) { - return e.dom; - }); - var selectedInlines = filter(inlineBoundaries, isInlineTarget); - var targetInlines = filter(elms, isInlineTarget); - each(difference(selectedInlines, targetInlines), curry(setSelected, false)); - each(difference(targetInlines, selectedInlines), curry(setSelected, true)); + var inlineBoundaries = map(descendants$1(SugarElement.fromDom(dom.getRoot()), '*[data-mce-selected="inline-boundary"]'), function (e) { + return e.dom; + }); + var selectedInlines = filter(inlineBoundaries, isInlineTarget); + var targetInlines = filter(elms, isInlineTarget); + each(difference(selectedInlines, targetInlines), curry(setSelected, false)); + each(difference(targetInlines, selectedInlines), curry(setSelected, true)); }; var safeRemoveCaretContainer = function (editor, caret) { - if (editor.selection.isCollapsed() && editor.composing !== true && caret.get()) { - var pos = CaretPosition$1.fromRangeStart(editor.selection.getRng()); - if (CaretPosition$1.isTextPosition(pos) && isAtZwsp(pos) === false) { - setCaretPosition(editor, removeAndReposition(caret.get(), pos)); - caret.set(null); - } + if (editor.selection.isCollapsed() && editor.composing !== true && caret.get()) { + var pos = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + if (CaretPosition$1.isTextPosition(pos) && isAtZwsp(pos) === false) { + setCaretPosition(editor, removeAndReposition(caret.get(), pos)); + caret.set(null); } + } }; var renderInsideInlineCaret = function (isInlineTarget, editor, caret, elms) { - if (editor.selection.isCollapsed()) { - var inlines = filter(elms, isInlineTarget); - each(inlines, function (_inline) { - var pos = CaretPosition$1.fromRangeStart(editor.selection.getRng()); - readLocation(isInlineTarget, editor.getBody(), pos).bind(function (location) { - return renderCaretLocation(editor, caret, location); - }); - }); - } + if (editor.selection.isCollapsed()) { + var inlines = filter(elms, isInlineTarget); + each(inlines, function (_inline) { + var pos = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + readLocation(isInlineTarget, editor.getBody(), pos).bind(function (location) { + return renderCaretLocation(editor, caret, location); + }); + }); + } }; var move = function (editor, caret, forward) { - return isInlineBoundariesEnabled(editor) ? findLocation$1(editor, caret, forward).isSome() : false; + return isInlineBoundariesEnabled(editor) ? findLocation$1(editor, caret, forward).isSome() : false; }; var moveWord = function (forward, editor, _caret) { - return isInlineBoundariesEnabled(editor) ? moveByWord(forward, editor) : false; + return isInlineBoundariesEnabled(editor) ? moveByWord(forward, editor) : false; }; var setupSelectedState = function (editor) { - var caret = Cell(null); - var isInlineTarget$1 = curry(isInlineTarget, editor); - editor.on('NodeChange', function (e) { - if (isInlineBoundariesEnabled(editor) && !(Env.browser.isIE() && e.initial)) { - toggleInlines(isInlineTarget$1, editor.dom, e.parents); - safeRemoveCaretContainer(editor, caret); - renderInsideInlineCaret(isInlineTarget$1, editor, caret, e.parents); - } - }); - return caret; + var caret = Cell(null); + var isInlineTarget$1 = curry(isInlineTarget, editor); + editor.on('NodeChange', function (e) { + if (isInlineBoundariesEnabled(editor) && !(Env.browser.isIE() && e.initial)) { + toggleInlines(isInlineTarget$1, editor.dom, e.parents); + safeRemoveCaretContainer(editor, caret); + renderInsideInlineCaret(isInlineTarget$1, editor, caret, e.parents); + } + }); + return caret; }; var moveNextWord = curry(moveWord, true); var movePrevWord = curry(moveWord, false); var rangeFromPositions = function (from, to) { - var range = document.createRange(); - range.setStart(from.container(), from.offset()); - range.setEnd(to.container(), to.offset()); - return range; + var range = document.createRange(); + range.setStart(from.container(), from.offset()); + range.setEnd(to.container(), to.offset()); + return range; }; var hasOnlyTwoOrLessPositionsLeft = function (elm) { - return lift2(firstPositionIn(elm), lastPositionIn(elm), function (firstPos, lastPos) { - var normalizedFirstPos = normalizePosition(true, firstPos); - var normalizedLastPos = normalizePosition(false, lastPos); - return nextPosition(elm, normalizedFirstPos).forall(function (pos) { - return pos.isEqual(normalizedLastPos); - }); - }).getOr(true); + return lift2(firstPositionIn(elm), lastPositionIn(elm), function (firstPos, lastPos) { + var normalizedFirstPos = normalizePosition(true, firstPos); + var normalizedLastPos = normalizePosition(false, lastPos); + return nextPosition(elm, normalizedFirstPos).forall(function (pos) { + return pos.isEqual(normalizedLastPos); + }); + }).getOr(true); }; var setCaretLocation = function (editor, caret) { - return function (location) { - return renderCaret(caret, location).exists(function (pos) { - setCaretPosition(editor, pos); - return true; - }); - }; + return function (location) { + return renderCaret(caret, location).exists(function (pos) { + setCaretPosition(editor, pos); + return true; + }); + }; }; var deleteFromTo = function (editor, caret, from, to) { - var rootNode = editor.getBody(); - var isInlineTarget$1 = curry(isInlineTarget, editor); - editor.undoManager.ignore(function () { - editor.selection.setRng(rangeFromPositions(from, to)); - editor.execCommand('Delete'); - readLocation(isInlineTarget$1, rootNode, CaretPosition$1.fromRangeStart(editor.selection.getRng())).map(inside).map(setCaretLocation(editor, caret)); - }); - editor.nodeChanged(); + var rootNode = editor.getBody(); + var isInlineTarget$1 = curry(isInlineTarget, editor); + editor.undoManager.ignore(function () { + editor.selection.setRng(rangeFromPositions(from, to)); + editor.execCommand('Delete'); + readLocation(isInlineTarget$1, rootNode, CaretPosition$1.fromRangeStart(editor.selection.getRng())).map(inside).map(setCaretLocation(editor, caret)); + }); + editor.nodeChanged(); }; var rescope$1 = function (rootNode, node) { - var parentBlock = getParentBlock(node, rootNode); - return parentBlock ? parentBlock : rootNode; + var parentBlock = getParentBlock(node, rootNode); + return parentBlock ? parentBlock : rootNode; }; var backspaceDeleteCollapsed = function (editor, caret, forward, from) { - var rootNode = rescope$1(editor.getBody(), from.container()); - var isInlineTarget$1 = curry(isInlineTarget, editor); - var fromLocation = readLocation(isInlineTarget$1, rootNode, from); - return fromLocation.bind(function (location) { - if (forward) { - return location.fold(constant(Optional.some(inside(location))), Optional.none, constant(Optional.some(outside(location))), Optional.none); + var rootNode = rescope$1(editor.getBody(), from.container()); + var isInlineTarget$1 = curry(isInlineTarget, editor); + var fromLocation = readLocation(isInlineTarget$1, rootNode, from); + return fromLocation.bind(function (location) { + if (forward) { + return location.fold(constant(Optional.some(inside(location))), Optional.none, constant(Optional.some(outside(location))), Optional.none); + } else { + return location.fold(Optional.none, constant(Optional.some(outside(location))), Optional.none, constant(Optional.some(inside(location)))); + } + }).map(setCaretLocation(editor, caret)).getOrThunk(function () { + var toPosition = navigate(forward, rootNode, from); + var toLocation = toPosition.bind(function (pos) { + return readLocation(isInlineTarget$1, rootNode, pos); + }); + return lift2(fromLocation, toLocation, function () { + return findRootInline(isInlineTarget$1, rootNode, from).exists(function (elm) { + if (hasOnlyTwoOrLessPositionsLeft(elm)) { + deleteElement(editor, forward, SugarElement.fromDom(elm)); + return true; } else { - return location.fold(Optional.none, constant(Optional.some(outside(location))), Optional.none, constant(Optional.some(inside(location)))); + return false; } - }).map(setCaretLocation(editor, caret)).getOrThunk(function () { - var toPosition = navigate(forward, rootNode, from); - var toLocation = toPosition.bind(function (pos) { - return readLocation(isInlineTarget$1, rootNode, pos); - }); - return lift2(fromLocation, toLocation, function () { - return findRootInline(isInlineTarget$1, rootNode, from).exists(function (elm) { - if (hasOnlyTwoOrLessPositionsLeft(elm)) { - deleteElement(editor, forward, SugarElement.fromDom(elm)); - return true; - } else { - return false; - } - }); - }).orThunk(function () { - return toLocation.bind(function (_) { - return toPosition.map(function (to) { - if (forward) { - deleteFromTo(editor, caret, from, to); - } else { - deleteFromTo(editor, caret, to, from); - } - return true; - }); - }); - }).getOr(false); - }); + }); + }).orThunk(function () { + return toLocation.bind(function (_) { + return toPosition.map(function (to) { + if (forward) { + deleteFromTo(editor, caret, from, to); + } else { + deleteFromTo(editor, caret, to, from); + } + return true; + }); + }); + }).getOr(false); + }); }; var backspaceDelete$6 = function (editor, caret, forward) { - if (editor.selection.isCollapsed() && isInlineBoundariesEnabled(editor)) { - var from = CaretPosition$1.fromRangeStart(editor.selection.getRng()); - return backspaceDeleteCollapsed(editor, caret, forward, from); - } - return false; + if (editor.selection.isCollapsed() && isInlineBoundariesEnabled(editor)) { + var from = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + return backspaceDeleteCollapsed(editor, caret, forward, from); + } + return false; }; var getParentInlines = function (rootElm, startElm) { - var parents = parentsAndSelf(startElm, rootElm); - return findIndex(parents, isBlock).fold(constant(parents), function (index) { - return parents.slice(0, index); - }); + var parents = parentsAndSelf(startElm, rootElm); + return findIndex(parents, isBlock).fold(constant(parents), function (index) { + return parents.slice(0, index); + }); }; var hasOnlyOneChild$1 = function (elm) { - return children(elm).length === 1; + return children(elm).length === 1; }; var deleteLastPosition = function (forward, editor, target, parentInlines) { - var isFormatElement$1 = curry(isFormatElement, editor); - var formatNodes = map(filter(parentInlines, isFormatElement$1), function (elm) { - return elm.dom; - }); - if (formatNodes.length === 0) { - deleteElement(editor, forward, target); - } else { - var pos = replaceWithCaretFormat(target.dom, formatNodes); - editor.selection.setRng(pos.toRange()); - } + var isFormatElement$1 = curry(isFormatElement, editor); + var formatNodes = map(filter(parentInlines, isFormatElement$1), function (elm) { + return elm.dom; + }); + if (formatNodes.length === 0) { + deleteElement(editor, forward, target); + } else { + var pos = replaceWithCaretFormat(target.dom, formatNodes); + editor.selection.setRng(pos.toRange()); + } }; var deleteCaret$2 = function (editor, forward) { - var rootElm = SugarElement.fromDom(editor.getBody()); - var startElm = SugarElement.fromDom(editor.selection.getStart()); - var parentInlines = filter(getParentInlines(rootElm, startElm), hasOnlyOneChild$1); - return last(parentInlines).exists(function (target) { - var fromPos = CaretPosition$1.fromRangeStart(editor.selection.getRng()); - if (willDeleteLastPositionInElement(forward, fromPos, target.dom) && !isEmptyCaretFormatElement(target)) { - deleteLastPosition(forward, editor, target, parentInlines); - return true; - } else { - return false; - } - }); + var rootElm = SugarElement.fromDom(editor.getBody()); + var startElm = SugarElement.fromDom(editor.selection.getStart()); + var parentInlines = filter(getParentInlines(rootElm, startElm), hasOnlyOneChild$1); + return last(parentInlines).exists(function (target) { + var fromPos = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + if (willDeleteLastPositionInElement(forward, fromPos, target.dom) && !isEmptyCaretFormatElement(target)) { + deleteLastPosition(forward, editor, target, parentInlines); + return true; + } else { + return false; + } + }); }; var backspaceDelete$7 = function (editor, forward) { - return editor.selection.isCollapsed() ? deleteCaret$2(editor, forward) : false; + return editor.selection.isCollapsed() ? deleteCaret$2(editor, forward) : false; }; var deleteElement$2 = function (editor, forward, element) { - editor._selectionOverrides.hideFakeCaret(); - deleteElement(editor, forward, SugarElement.fromDom(element)); - return true; + editor._selectionOverrides.hideFakeCaret(); + deleteElement(editor, forward, SugarElement.fromDom(element)); + return true; }; var deleteCaret$3 = function (editor, forward) { - var isNearMedia = forward ? isBeforeMedia : isAfterMedia; - var direction = forward ? HDirection.Forwards : HDirection.Backwards; - var fromPos = getNormalizedRangeEndPoint(direction, editor.getBody(), editor.selection.getRng()); - if (isNearMedia(fromPos)) { - return deleteElement$2(editor, forward, fromPos.getNode(!forward)); - } else { - return Optional.from(normalizePosition(forward, fromPos)).filter(function (pos) { - return isNearMedia(pos) && isMoveInsideSameBlock(fromPos, pos); - }).exists(function (pos) { - return deleteElement$2(editor, forward, pos.getNode(!forward)); - }); - } + var isNearMedia = forward ? isBeforeMedia : isAfterMedia; + var direction = forward ? HDirection.Forwards : HDirection.Backwards; + var fromPos = getNormalizedRangeEndPoint(direction, editor.getBody(), editor.selection.getRng()); + if (isNearMedia(fromPos)) { + return deleteElement$2(editor, forward, fromPos.getNode(!forward)); + } else { + return Optional.from(normalizePosition(forward, fromPos)).filter(function (pos) { + return isNearMedia(pos) && isMoveInsideSameBlock(fromPos, pos); + }).exists(function (pos) { + return deleteElement$2(editor, forward, pos.getNode(!forward)); + }); + } }; var deleteRange$2 = function (editor, forward) { - var selectedNode = editor.selection.getNode(); - return isMedia(selectedNode) ? deleteElement$2(editor, forward, selectedNode) : false; + var selectedNode = editor.selection.getNode(); + return isMedia(selectedNode) ? deleteElement$2(editor, forward, selectedNode) : false; }; var backspaceDelete$8 = function (editor, forward) { - return editor.selection.isCollapsed() ? deleteCaret$3(editor, forward) : deleteRange$2(editor, forward); + return editor.selection.isCollapsed() ? deleteCaret$3(editor, forward) : deleteRange$2(editor, forward); }; var isEditable$1 = function (target) { - return closest(target, function (elm) { - return isContentEditableTrue(elm.dom) || isContentEditableFalse(elm.dom); - }).exists(function (elm) { - return isContentEditableTrue(elm.dom); - }); + return closest(target, function (elm) { + return isContentEditableTrue(elm.dom) || isContentEditableFalse(elm.dom); + }).exists(function (elm) { + return isContentEditableTrue(elm.dom); + }); }; var parseIndentValue = function (value) { - var number = parseInt(value, 10); - return isNaN(number) ? 0 : number; + var number = parseInt(value, 10); + return isNaN(number) ? 0 : number; }; var getIndentStyleName = function (useMargin, element) { - var indentStyleName = useMargin || isTable$1(element) ? 'margin' : 'padding'; - var suffix = get$5(element, 'direction') === 'rtl' ? '-right' : '-left'; - return indentStyleName + suffix; + var indentStyleName = useMargin || isTable$1(element) ? 'margin' : 'padding'; + var suffix = get$5(element, 'direction') === 'rtl' ? '-right' : '-left'; + return indentStyleName + suffix; }; var indentElement = function (dom, command, useMargin, value, unit, element) { - var indentStyleName = getIndentStyleName(useMargin, SugarElement.fromDom(element)); - if (command === 'outdent') { - var styleValue = Math.max(0, parseIndentValue(element.style[indentStyleName]) - value); - dom.setStyle(element, indentStyleName, styleValue ? styleValue + unit : ''); - } else { - var styleValue = parseIndentValue(element.style[indentStyleName]) + value + unit; - dom.setStyle(element, indentStyleName, styleValue); - } + var indentStyleName = getIndentStyleName(useMargin, SugarElement.fromDom(element)); + if (command === 'outdent') { + var styleValue = Math.max(0, parseIndentValue(element.style[indentStyleName]) - value); + dom.setStyle(element, indentStyleName, styleValue ? styleValue + unit : ''); + } else { + var styleValue = parseIndentValue(element.style[indentStyleName]) + value + unit; + dom.setStyle(element, indentStyleName, styleValue); + } }; var validateBlocks = function (editor, blocks) { - return forall(blocks, function (block) { - var indentStyleName = getIndentStyleName(shouldIndentUseMargin(editor), block); - var intentValue = getRaw(block, indentStyleName).map(parseIndentValue).getOr(0); - var contentEditable = editor.dom.getContentEditable(block.dom); - return contentEditable !== 'false' && intentValue > 0; - }); + return forall(blocks, function (block) { + var indentStyleName = getIndentStyleName(shouldIndentUseMargin(editor), block); + var intentValue = getRaw(block, indentStyleName).map(parseIndentValue).getOr(0); + var contentEditable = editor.dom.getContentEditable(block.dom); + return contentEditable !== 'false' && intentValue > 0; + }); }; var canOutdent = function (editor) { - var blocks = getBlocksToIndent(editor); - return !editor.mode.isReadOnly() && (blocks.length > 1 || validateBlocks(editor, blocks)); + var blocks = getBlocksToIndent(editor); + return !editor.mode.isReadOnly() && (blocks.length > 1 || validateBlocks(editor, blocks)); }; var isListComponent = function (el) { - return isList(el) || isListItem(el); + return isList(el) || isListItem(el); }; var parentIsListComponent = function (el) { - return parent(el).map(isListComponent).getOr(false); + return parent(el).map(isListComponent).getOr(false); }; var getBlocksToIndent = function (editor) { - return filter(map(editor.selection.getSelectedBlocks(), SugarElement.fromDom), function (el) { - return !isListComponent(el) && !parentIsListComponent(el) && isEditable$1(el); - }); + return filter(map(editor.selection.getSelectedBlocks(), SugarElement.fromDom), function (el) { + return !isListComponent(el) && !parentIsListComponent(el) && isEditable$1(el); + }); }; var handle = function (editor, command) { - var dom = editor.dom, selection = editor.selection, formatter = editor.formatter; - var indentation = getIndentation(editor); - var indentUnit = /[a-z%]+$/i.exec(indentation)[0]; - var indentValue = parseInt(indentation, 10); - var useMargin = shouldIndentUseMargin(editor); - var forcedRootBlock = getForcedRootBlock(editor); - if (!editor.queryCommandState('InsertUnorderedList') && !editor.queryCommandState('InsertOrderedList')) { - if (forcedRootBlock === '' && !dom.getParent(selection.getNode(), dom.isBlock)) { - formatter.apply('div'); - } - } - each(getBlocksToIndent(editor), function (block) { - indentElement(dom, command, useMargin, indentValue, indentUnit, block.dom); - }); + var dom = editor.dom, selection = editor.selection, formatter = editor.formatter; + var indentation = getIndentation(editor); + var indentUnit = /[a-z%]+$/i.exec(indentation)[0]; + var indentValue = parseInt(indentation, 10); + var useMargin = shouldIndentUseMargin(editor); + var forcedRootBlock = getForcedRootBlock(editor); + if (!editor.queryCommandState('InsertUnorderedList') && !editor.queryCommandState('InsertOrderedList')) { + if (forcedRootBlock === '' && !dom.getParent(selection.getNode(), dom.isBlock)) { + formatter.apply('div'); + } + } + each(getBlocksToIndent(editor), function (block) { + indentElement(dom, command, useMargin, indentValue, indentUnit, block.dom); + }); }; var backspaceDelete$9 = function (editor, _forward) { - if (editor.selection.isCollapsed() && canOutdent(editor)) { - var dom = editor.dom; - var rng = editor.selection.getRng(); - var pos = CaretPosition$1.fromRangeStart(rng); - var block = dom.getParent(rng.startContainer, dom.isBlock); - if (block !== null && isAtStartOfBlock(SugarElement.fromDom(block), pos)) { - handle(editor, 'outdent'); - return true; - } + if (editor.selection.isCollapsed() && canOutdent(editor)) { + var dom = editor.dom; + var rng = editor.selection.getRng(); + var pos = CaretPosition$1.fromRangeStart(rng); + var block = dom.getParent(rng.startContainer, dom.isBlock); + if (block !== null && isAtStartOfBlock(SugarElement.fromDom(block), pos)) { + handle(editor, 'outdent'); + return true; } - return false; + } + return false; }; var nativeCommand = function (editor, command) { - editor.getDoc().execCommand(command, false, null); + editor.getDoc().execCommand(command, false, null); }; var deleteCommand = function (editor, caret) { - if (backspaceDelete$9(editor)) { - return; - } else if (backspaceDelete$4(editor, false)) { - return; - } else if (backspaceDelete$3(editor, false)) { - return; - } else if (backspaceDelete$6(editor, caret, false)) { - return; - } else if (backspaceDelete$1(editor, false)) { - return; - } else if (backspaceDelete(editor)) { - return; - } else if (backspaceDelete$5(editor, false)) { - return; - } else if (backspaceDelete$8(editor, false)) { - return; - } else if (backspaceDelete$2(editor)) { - return; - } else if (backspaceDelete$7(editor, false)) { - return; - } else { - nativeCommand(editor, 'Delete'); - paddEmptyBody(editor); - } + if (backspaceDelete$9(editor)) { + return; + } else if (backspaceDelete$4(editor, false)) { + return; + } else if (backspaceDelete$3(editor, false)) { + return; + } else if (backspaceDelete$6(editor, caret, false)) { + return; + } else if (backspaceDelete$1(editor, false)) { + return; + } else if (backspaceDelete(editor)) { + return; + } else if (backspaceDelete$5(editor, false)) { + return; + } else if (backspaceDelete$8(editor, false)) { + return; + } else if (backspaceDelete$2(editor)) { + return; + } else if (backspaceDelete$7(editor, false)) { + return; + } else { + nativeCommand(editor, 'Delete'); + paddEmptyBody(editor); + } }; var forwardDeleteCommand = function (editor, caret) { - if (backspaceDelete$4(editor, true)) { - return; - } else if (backspaceDelete$3(editor, true)) { - return; - } else if (backspaceDelete$6(editor, caret, true)) { - return; - } else if (backspaceDelete$1(editor, true)) { - return; - } else if (backspaceDelete(editor)) { - return; - } else if (backspaceDelete$5(editor, true)) { - return; - } else if (backspaceDelete$8(editor, true)) { - return; - } else if (backspaceDelete$2(editor)) { - return; - } else if (backspaceDelete$7(editor, true)) { - return; - } else { - nativeCommand(editor, 'ForwardDelete'); - } + if (backspaceDelete$4(editor, true)) { + return; + } else if (backspaceDelete$3(editor, true)) { + return; + } else if (backspaceDelete$6(editor, caret, true)) { + return; + } else if (backspaceDelete$1(editor, true)) { + return; + } else if (backspaceDelete(editor)) { + return; + } else if (backspaceDelete$5(editor, true)) { + return; + } else if (backspaceDelete$8(editor, true)) { + return; + } else if (backspaceDelete$2(editor)) { + return; + } else if (backspaceDelete$7(editor, true)) { + return; + } else { + nativeCommand(editor, 'ForwardDelete'); + } }; var setup$8 = function (editor, caret) { - editor.addCommand('delete', function () { - deleteCommand(editor, caret); - }); - editor.addCommand('forwardDelete', function () { - forwardDeleteCommand(editor, caret); - }); + editor.addCommand('delete', function () { + deleteCommand(editor, caret); + }); + editor.addCommand('forwardDelete', function () { + forwardDeleteCommand(editor, caret); + }); }; var SIGNIFICANT_MOVE = 5; var LONGPRESS_DELAY = 400; var getTouch = function (event) { - if (event.touches === undefined || event.touches.length !== 1) { - return Optional.none(); - } - return Optional.some(event.touches[0]); + if (event.touches === undefined || event.touches.length !== 1) { + return Optional.none(); + } + return Optional.some(event.touches[0]); }; var isFarEnough = function (touch, data) { - var distX = Math.abs(touch.clientX - data.x); - var distY = Math.abs(touch.clientY - data.y); - return distX > SIGNIFICANT_MOVE || distY > SIGNIFICANT_MOVE; + var distX = Math.abs(touch.clientX - data.x); + var distY = Math.abs(touch.clientY - data.y); + return distX > SIGNIFICANT_MOVE || distY > SIGNIFICANT_MOVE; }; var setup$9 = function (editor) { - var startData = Cell(Optional.none()); - var longpressFired = Cell(false); - var debounceLongpress = last$2(function (e) { - editor.fire('longpress', __assign(__assign({}, e), {type: 'longpress'})); - longpressFired.set(true); - }, LONGPRESS_DELAY); - editor.on('touchstart', function (e) { - getTouch(e).each(function (touch) { - debounceLongpress.cancel(); - var data = { - x: touch.clientX, - y: touch.clientY, - target: e.target - }; - debounceLongpress.throttle(e); - longpressFired.set(false); - startData.set(Optional.some(data)); - }); - }, true); - editor.on('touchmove', function (e) { - debounceLongpress.cancel(); - getTouch(e).each(function (touch) { - startData.get().each(function (data) { - if (isFarEnough(touch, data)) { - startData.set(Optional.none()); - longpressFired.set(false); - editor.fire('longpresscancel'); - } - }); - }); - }, true); - editor.on('touchend touchcancel', function (e) { - debounceLongpress.cancel(); - if (e.type === 'touchcancel') { - return; - } - startData.get().filter(function (data) { - return data.target.isEqualNode(e.target); - }).each(function () { - if (longpressFired.get()) { - e.preventDefault(); - } else { - editor.fire('tap', __assign(__assign({}, e), {type: 'tap'})); - } - }); - }, true); + var startData = Cell(Optional.none()); + var longpressFired = Cell(false); + var debounceLongpress = last$2(function (e) { + editor.fire('longpress', __assign(__assign({}, e), { type: 'longpress' })); + longpressFired.set(true); + }, LONGPRESS_DELAY); + editor.on('touchstart', function (e) { + getTouch(e).each(function (touch) { + debounceLongpress.cancel(); + var data = { + x: touch.clientX, + y: touch.clientY, + target: e.target + }; + debounceLongpress.throttle(e); + longpressFired.set(false); + startData.set(Optional.some(data)); + }); + }, true); + editor.on('touchmove', function (e) { + debounceLongpress.cancel(); + getTouch(e).each(function (touch) { + startData.get().each(function (data) { + if (isFarEnough(touch, data)) { + startData.set(Optional.none()); + longpressFired.set(false); + editor.fire('longpresscancel'); + } + }); + }); + }, true); + editor.on('touchend touchcancel', function (e) { + debounceLongpress.cancel(); + if (e.type === 'touchcancel') { + return; + } + startData.get().filter(function (data) { + return data.target.isEqualNode(e.target); + }).each(function () { + if (longpressFired.get()) { + e.preventDefault(); + } else { + editor.fire('tap', __assign(__assign({}, e), { type: 'tap' })); + } + }); + }, true); }; var isBlockElement = function (blockElements, node) { - return blockElements.hasOwnProperty(node.nodeName); + return blockElements.hasOwnProperty(node.nodeName); }; var isValidTarget = function (blockElements, node) { - if (isText$1(node)) { - return true; - } else if (isElement$1(node)) { - return !isBlockElement(blockElements, node) && !isBookmarkNode$1(node); - } else { - return false; - } + if (isText$1(node)) { + return true; + } else if (isElement$1(node)) { + return !isBlockElement(blockElements, node) && !isBookmarkNode$1(node); + } else { + return false; + } }; var hasBlockParent = function (blockElements, root, node) { - return exists(parents$1(SugarElement.fromDom(node), SugarElement.fromDom(root)), function (elm) { - return isBlockElement(blockElements, elm.dom); - }); + return exists(parents$1(SugarElement.fromDom(node), SugarElement.fromDom(root)), function (elm) { + return isBlockElement(blockElements, elm.dom); + }); }; var shouldRemoveTextNode = function (blockElements, node) { - if (isText$1(node)) { - if (node.nodeValue.length === 0) { - return true; - } else if (/^\s+$/.test(node.nodeValue) && (!node.nextSibling || isBlockElement(blockElements, node.nextSibling))) { - return true; - } + if (isText$1(node)) { + if (node.nodeValue.length === 0) { + return true; + } else if (/^\s+$/.test(node.nodeValue) && (!node.nextSibling || isBlockElement(blockElements, node.nextSibling))) { + return true; } - return false; + } + return false; }; var addRootBlocks = function (editor) { - var dom = editor.dom, selection = editor.selection; - var schema = editor.schema, blockElements = schema.getBlockElements(); - var node = selection.getStart(); - var rootNode = editor.getBody(); - var rootBlockNode, tempNode, wrapped; - var forcedRootBlock = getForcedRootBlock(editor); - if (!node || !isElement$1(node) || !forcedRootBlock) { - return; - } - var rootNodeName = rootNode.nodeName.toLowerCase(); - if (!schema.isValidChild(rootNodeName, forcedRootBlock.toLowerCase()) || hasBlockParent(blockElements, rootNode, node)) { - return; - } - var rng = selection.getRng(); - var startContainer = rng.startContainer; - var startOffset = rng.startOffset; - var endContainer = rng.endContainer; - var endOffset = rng.endOffset; - var restoreSelection = hasFocus$1(editor); - node = rootNode.firstChild; - while (node) { - if (isValidTarget(blockElements, node)) { - if (shouldRemoveTextNode(blockElements, node)) { - tempNode = node; - node = node.nextSibling; - dom.remove(tempNode); - continue; - } - if (!rootBlockNode) { - rootBlockNode = dom.create(forcedRootBlock, getForcedRootBlockAttrs(editor)); - node.parentNode.insertBefore(rootBlockNode, node); - wrapped = true; - } - tempNode = node; - node = node.nextSibling; - rootBlockNode.appendChild(tempNode); - } else { - rootBlockNode = null; - node = node.nextSibling; - } - } - if (wrapped && restoreSelection) { - rng.setStart(startContainer, startOffset); - rng.setEnd(endContainer, endOffset); - selection.setRng(rng); - editor.nodeChanged(); + var dom = editor.dom, selection = editor.selection; + var schema = editor.schema, blockElements = schema.getBlockElements(); + var node = selection.getStart(); + var rootNode = editor.getBody(); + var rootBlockNode, tempNode, wrapped; + var forcedRootBlock = getForcedRootBlock(editor); + if (!node || !isElement$1(node) || !forcedRootBlock) { + return; + } + var rootNodeName = rootNode.nodeName.toLowerCase(); + if (!schema.isValidChild(rootNodeName, forcedRootBlock.toLowerCase()) || hasBlockParent(blockElements, rootNode, node)) { + return; + } + var rng = selection.getRng(); + var startContainer = rng.startContainer; + var startOffset = rng.startOffset; + var endContainer = rng.endContainer; + var endOffset = rng.endOffset; + var restoreSelection = hasFocus$1(editor); + node = rootNode.firstChild; + while (node) { + if (isValidTarget(blockElements, node)) { + if (shouldRemoveTextNode(blockElements, node)) { + tempNode = node; + node = node.nextSibling; + dom.remove(tempNode); + continue; + } + if (!rootBlockNode) { + rootBlockNode = dom.create(forcedRootBlock, getForcedRootBlockAttrs(editor)); + node.parentNode.insertBefore(rootBlockNode, node); + wrapped = true; + } + tempNode = node; + node = node.nextSibling; + rootBlockNode.appendChild(tempNode); + } else { + rootBlockNode = null; + node = node.nextSibling; } + } + if (wrapped && restoreSelection) { + rng.setStart(startContainer, startOffset); + rng.setEnd(endContainer, endOffset); + selection.setRng(rng); + editor.nodeChanged(); + } }; var setup$a = function (editor) { - if (getForcedRootBlock(editor)) { - editor.on('NodeChange', curry(addRootBlocks, editor)); - } + if (getForcedRootBlock(editor)) { + editor.on('NodeChange', curry(addRootBlocks, editor)); + } }; var findBlockCaretContainer = function (editor) { - return descendant(SugarElement.fromDom(editor.getBody()), '*[data-mce-caret]').fold(constant(null), function (elm) { - return elm.dom; - }); + return descendant(SugarElement.fromDom(editor.getBody()), '*[data-mce-caret]').fold(constant(null), function (elm) { + return elm.dom; + }); }; var removeIeControlRect = function (editor) { - editor.selection.setRng(editor.selection.getRng()); + editor.selection.setRng(editor.selection.getRng()); }; var showBlockCaretContainer = function (editor, blockCaretContainer) { - if (blockCaretContainer.hasAttribute('data-mce-caret')) { - showCaretContainerBlock(blockCaretContainer); - removeIeControlRect(editor); - editor.selection.scrollIntoView(blockCaretContainer); - } + if (blockCaretContainer.hasAttribute('data-mce-caret')) { + showCaretContainerBlock(blockCaretContainer); + removeIeControlRect(editor); + editor.selection.scrollIntoView(blockCaretContainer); + } }; var handleBlockContainer = function (editor, e) { - var blockCaretContainer = findBlockCaretContainer(editor); - if (!blockCaretContainer) { - return; - } - if (e.type === 'compositionstart') { - e.preventDefault(); - e.stopPropagation(); - showBlockCaretContainer(editor, blockCaretContainer); - return; - } - if (hasContent(blockCaretContainer)) { - showBlockCaretContainer(editor, blockCaretContainer); - editor.undoManager.add(); - } + var blockCaretContainer = findBlockCaretContainer(editor); + if (!blockCaretContainer) { + return; + } + if (e.type === 'compositionstart') { + e.preventDefault(); + e.stopPropagation(); + showBlockCaretContainer(editor, blockCaretContainer); + return; + } + if (hasContent(blockCaretContainer)) { + showBlockCaretContainer(editor, blockCaretContainer); + editor.undoManager.add(); + } }; var setup$b = function (editor) { - editor.on('keyup compositionstart', curry(handleBlockContainer, editor)); + editor.on('keyup compositionstart', curry(handleBlockContainer, editor)); }; var BreakType; (function (BreakType) { - BreakType[BreakType['Br'] = 0] = 'Br'; - BreakType[BreakType['Block'] = 1] = 'Block'; - BreakType[BreakType['Wrap'] = 2] = 'Wrap'; - BreakType[BreakType['Eol'] = 3] = 'Eol'; + BreakType[BreakType['Br'] = 0] = 'Br'; + BreakType[BreakType['Block'] = 1] = 'Block'; + BreakType[BreakType['Wrap'] = 2] = 'Wrap'; + BreakType[BreakType['Eol'] = 3] = 'Eol'; }(BreakType || (BreakType = {}))); var flip = function (direction, positions) { - return direction === HDirection.Backwards ? reverse(positions) : positions; + return direction === HDirection.Backwards ? reverse(positions) : positions; }; var walk$3 = function (direction, caretWalker, pos) { - return direction === HDirection.Forwards ? caretWalker.next(pos) : caretWalker.prev(pos); + return direction === HDirection.Forwards ? caretWalker.next(pos) : caretWalker.prev(pos); }; var getBreakType = function (scope, direction, currentPos, nextPos) { - if (isBr(nextPos.getNode(direction === HDirection.Forwards))) { - return BreakType.Br; - } else if (isInSameBlock(currentPos, nextPos) === false) { - return BreakType.Block; - } else { - return BreakType.Wrap; - } + if (isBr(nextPos.getNode(direction === HDirection.Forwards))) { + return BreakType.Br; + } else if (isInSameBlock(currentPos, nextPos) === false) { + return BreakType.Block; + } else { + return BreakType.Wrap; + } }; var getPositionsUntil = function (predicate, direction, scope, start) { - var caretWalker = CaretWalker(scope); - var currentPos = start, nextPos; - var positions = []; - while (currentPos) { - nextPos = walk$3(direction, caretWalker, currentPos); - if (!nextPos) { - break; - } - if (isBr(nextPos.getNode(false))) { - if (direction === HDirection.Forwards) { - return { - positions: flip(direction, positions).concat([nextPos]), - breakType: BreakType.Br, - breakAt: Optional.some(nextPos) - }; - } else { - return { - positions: flip(direction, positions), - breakType: BreakType.Br, - breakAt: Optional.some(nextPos) - }; - } - } - if (!nextPos.isVisible()) { - currentPos = nextPos; - continue; - } - if (predicate(currentPos, nextPos)) { - var breakType = getBreakType(scope, direction, currentPos, nextPos); - return { - positions: flip(direction, positions), - breakType: breakType, - breakAt: Optional.some(nextPos) - }; - } - positions.push(nextPos); - currentPos = nextPos; + var caretWalker = CaretWalker(scope); + var currentPos = start, nextPos; + var positions = []; + while (currentPos) { + nextPos = walk$3(direction, caretWalker, currentPos); + if (!nextPos) { + break; + } + if (isBr(nextPos.getNode(false))) { + if (direction === HDirection.Forwards) { + return { + positions: flip(direction, positions).concat([nextPos]), + breakType: BreakType.Br, + breakAt: Optional.some(nextPos) + }; + } else { + return { + positions: flip(direction, positions), + breakType: BreakType.Br, + breakAt: Optional.some(nextPos) + }; + } } - return { + if (!nextPos.isVisible()) { + currentPos = nextPos; + continue; + } + if (predicate(currentPos, nextPos)) { + var breakType = getBreakType(scope, direction, currentPos, nextPos); + return { positions: flip(direction, positions), - breakType: BreakType.Eol, - breakAt: Optional.none() - }; + breakType: breakType, + breakAt: Optional.some(nextPos) + }; + } + positions.push(nextPos); + currentPos = nextPos; + } + return { + positions: flip(direction, positions), + breakType: BreakType.Eol, + breakAt: Optional.none() + }; }; var getAdjacentLinePositions = function (direction, getPositionsUntilBreak, scope, start) { - return getPositionsUntilBreak(scope, start).breakAt.map(function (pos) { - var positions = getPositionsUntilBreak(scope, pos).positions; - return direction === HDirection.Backwards ? positions.concat(pos) : [pos].concat(positions); - }).getOr([]); + return getPositionsUntilBreak(scope, start).breakAt.map(function (pos) { + var positions = getPositionsUntilBreak(scope, pos).positions; + return direction === HDirection.Backwards ? positions.concat(pos) : [pos].concat(positions); + }).getOr([]); }; var findClosestHorizontalPositionFromPoint = function (positions, x) { - return foldl(positions, function (acc, newPos) { - return acc.fold(function () { - return Optional.some(newPos); - }, function (lastPos) { - return lift2(head(lastPos.getClientRects()), head(newPos.getClientRects()), function (lastRect, newRect) { - var lastDist = Math.abs(x - lastRect.left); - var newDist = Math.abs(x - newRect.left); - return newDist <= lastDist ? newPos : lastPos; - }).or(acc); - }); - }, Optional.none()); + return foldl(positions, function (acc, newPos) { + return acc.fold(function () { + return Optional.some(newPos); + }, function (lastPos) { + return lift2(head(lastPos.getClientRects()), head(newPos.getClientRects()), function (lastRect, newRect) { + var lastDist = Math.abs(x - lastRect.left); + var newDist = Math.abs(x - newRect.left); + return newDist <= lastDist ? newPos : lastPos; + }).or(acc); + }); + }, Optional.none()); }; var findClosestHorizontalPosition = function (positions, pos) { - return head(pos.getClientRects()).bind(function (targetRect) { - return findClosestHorizontalPositionFromPoint(positions, targetRect.left); - }); + return head(pos.getClientRects()).bind(function (targetRect) { + return findClosestHorizontalPositionFromPoint(positions, targetRect.left); + }); }; var getPositionsUntilPreviousLine = curry(getPositionsUntil, CaretPosition.isAbove, -1); var getPositionsUntilNextLine = curry(getPositionsUntil, CaretPosition.isBelow, 1); var isAtFirstLine = function (scope, pos) { - return getPositionsUntilPreviousLine(scope, pos).breakAt.isNone(); + return getPositionsUntilPreviousLine(scope, pos).breakAt.isNone(); }; var isAtLastLine = function (scope, pos) { - return getPositionsUntilNextLine(scope, pos).breakAt.isNone(); + return getPositionsUntilNextLine(scope, pos).breakAt.isNone(); }; var getPositionsAbove = curry(getAdjacentLinePositions, -1, getPositionsUntilPreviousLine); var getPositionsBelow = curry(getAdjacentLinePositions, 1, getPositionsUntilNextLine); var getFirstLinePositions = function (scope) { - return firstPositionIn(scope).map(function (pos) { - return [pos].concat(getPositionsUntilNextLine(scope, pos).positions); - }).getOr([]); + return firstPositionIn(scope).map(function (pos) { + return [pos].concat(getPositionsUntilNextLine(scope, pos).positions); + }).getOr([]); }; var getLastLinePositions = function (scope) { - return lastPositionIn(scope).map(function (pos) { - return getPositionsUntilPreviousLine(scope, pos).positions.concat(pos); - }).getOr([]); + return lastPositionIn(scope).map(function (pos) { + return getPositionsUntilPreviousLine(scope, pos).positions.concat(pos); + }).getOr([]); }; var getNodeClientRects = function (node) { - var toArrayWithNode = function (clientRects) { - return map(clientRects, function (clientRect) { - clientRect = clone$2(clientRect); - clientRect.node = node; - return clientRect; - }); - }; - if (isElement$1(node)) { - return toArrayWithNode(node.getClientRects()); - } - if (isText$1(node)) { - var rng = node.ownerDocument.createRange(); - rng.setStart(node, 0); - rng.setEnd(node, node.data.length); - return toArrayWithNode(rng.getClientRects()); - } + var toArrayWithNode = function (clientRects) { + return map(clientRects, function (clientRect) { + clientRect = clone$2(clientRect); + clientRect.node = node; + return clientRect; + }); + }; + if (isElement$1(node)) { + return toArrayWithNode(node.getClientRects()); + } + if (isText$1(node)) { + var rng = node.ownerDocument.createRange(); + rng.setStart(node, 0); + rng.setEnd(node, node.data.length); + return toArrayWithNode(rng.getClientRects()); + } }; var getClientRects = function (nodes) { - return bind(nodes, getNodeClientRects); + return bind(nodes, getNodeClientRects); }; var VDirection; (function (VDirection) { - VDirection[VDirection['Up'] = -1] = 'Up'; - VDirection[VDirection['Down'] = 1] = 'Down'; + VDirection[VDirection['Up'] = -1] = 'Up'; + VDirection[VDirection['Down'] = 1] = 'Down'; }(VDirection || (VDirection = {}))); var findUntil$1 = function (direction, root, predicateFn, node) { - while (node = findNode(node, direction, isEditableCaretCandidate, root)) { - if (predicateFn(node)) { - return; - } + while (node = findNode(node, direction, isEditableCaretCandidate, root)) { + if (predicateFn(node)) { + return; } + } }; var walkUntil = function (direction, isAboveFn, isBeflowFn, root, predicateFn, caretPosition) { - var line = 0; - var result = []; - var add = function (node) { - var i, clientRect, clientRects; - clientRects = getClientRects([node]); - if (direction === -1) { - clientRects = clientRects.reverse(); - } - for (i = 0; i < clientRects.length; i++) { - clientRect = clientRects[i]; - if (isBeflowFn(clientRect, targetClientRect)) { - continue; - } - if (result.length > 0 && isAboveFn(clientRect, last$1(result))) { - line++; - } - clientRect.line = line; - if (predicateFn(clientRect)) { - return true; - } - result.push(clientRect); - } - }; - var targetClientRect = last$1(caretPosition.getClientRects()); - if (!targetClientRect) { - return result; + var line = 0; + var result = []; + var add = function (node) { + var i, clientRect, clientRects; + clientRects = getClientRects([node]); + if (direction === -1) { + clientRects = clientRects.reverse(); + } + for (i = 0; i < clientRects.length; i++) { + clientRect = clientRects[i]; + if (isBeflowFn(clientRect, targetClientRect)) { + continue; + } + if (result.length > 0 && isAboveFn(clientRect, last$1(result))) { + line++; + } + clientRect.line = line; + if (predicateFn(clientRect)) { + return true; + } + result.push(clientRect); } - var node = caretPosition.getNode(); - add(node); - findUntil$1(direction, root, add, node); + }; + var targetClientRect = last$1(caretPosition.getClientRects()); + if (!targetClientRect) { return result; + } + var node = caretPosition.getNode(); + add(node); + findUntil$1(direction, root, add, node); + return result; }; var aboveLineNumber = function (lineNumber, clientRect) { - return clientRect.line > lineNumber; + return clientRect.line > lineNumber; }; var isLineNumber = function (lineNumber, clientRect) { - return clientRect.line === lineNumber; + return clientRect.line === lineNumber; }; var upUntil = curry(walkUntil, VDirection.Up, isAbove, isBelow); var downUntil = curry(walkUntil, VDirection.Down, isBelow, isAbove); var positionsUntil = function (direction, root, predicateFn, node) { - var caretWalker = CaretWalker(root); - var walkFn, isBelowFn, isAboveFn, caretPosition; - var result = []; - var line = 0, clientRect; - var getClientRect = function (caretPosition) { - if (direction === 1) { - return last$1(caretPosition.getClientRects()); - } - return last$1(caretPosition.getClientRects()); - }; + var caretWalker = CaretWalker(root); + var walkFn, isBelowFn, isAboveFn, caretPosition; + var result = []; + var line = 0, clientRect; + var getClientRect = function (caretPosition) { if (direction === 1) { - walkFn = caretWalker.next; - isBelowFn = isBelow; - isAboveFn = isAbove; - caretPosition = CaretPosition$1.after(node); - } else { - walkFn = caretWalker.prev; - isBelowFn = isAbove; - isAboveFn = isBelow; - caretPosition = CaretPosition$1.before(node); - } - var targetClientRect = getClientRect(caretPosition); - do { - if (!caretPosition.isVisible()) { - continue; - } - clientRect = getClientRect(caretPosition); - if (isAboveFn(clientRect, targetClientRect)) { - continue; - } - if (result.length > 0 && isBelowFn(clientRect, last$1(result))) { - line++; - } - clientRect = clone$2(clientRect); - clientRect.position = caretPosition; - clientRect.line = line; - if (predicateFn(clientRect)) { - return result; - } - result.push(clientRect); - } while (caretPosition = walkFn(caretPosition)); - return result; + return last$1(caretPosition.getClientRects()); + } + return last$1(caretPosition.getClientRects()); + }; + if (direction === 1) { + walkFn = caretWalker.next; + isBelowFn = isBelow; + isAboveFn = isAbove; + caretPosition = CaretPosition$1.after(node); + } else { + walkFn = caretWalker.prev; + isBelowFn = isAbove; + isAboveFn = isBelow; + caretPosition = CaretPosition$1.before(node); + } + var targetClientRect = getClientRect(caretPosition); + do { + if (!caretPosition.isVisible()) { + continue; + } + clientRect = getClientRect(caretPosition); + if (isAboveFn(clientRect, targetClientRect)) { + continue; + } + if (result.length > 0 && isBelowFn(clientRect, last$1(result))) { + line++; + } + clientRect = clone$2(clientRect); + clientRect.position = caretPosition; + clientRect.line = line; + if (predicateFn(clientRect)) { + return result; + } + result.push(clientRect); + } while (caretPosition = walkFn(caretPosition)); + return result; }; var isAboveLine = function (lineNumber) { - return function (clientRect) { - return aboveLineNumber(lineNumber, clientRect); - }; + return function (clientRect) { + return aboveLineNumber(lineNumber, clientRect); + }; }; var isLine = function (lineNumber) { - return function (clientRect) { - return isLineNumber(lineNumber, clientRect); - }; + return function (clientRect) { + return isLineNumber(lineNumber, clientRect); + }; }; var isContentEditableFalse$8 = isContentEditableFalse; var findNode$1 = findNode; var distanceToRectLeft = function (clientRect, clientX) { - return Math.abs(clientRect.left - clientX); + return Math.abs(clientRect.left - clientX); }; var distanceToRectRight = function (clientRect, clientX) { - return Math.abs(clientRect.right - clientX); + return Math.abs(clientRect.right - clientX); }; var isInsideX = function (clientX, clientRect) { - return clientX >= clientRect.left && clientX <= clientRect.right; + return clientX >= clientRect.left && clientX <= clientRect.right; }; var isInsideY = function (clientY, clientRect) { - return clientY >= clientRect.top && clientY <= clientRect.bottom; + return clientY >= clientRect.top && clientY <= clientRect.bottom; }; var findClosestClientRect = function (clientRects, clientX) { - return reduce(clientRects, function (oldClientRect, clientRect) { - var oldDistance = Math.min(distanceToRectLeft(oldClientRect, clientX), distanceToRectRight(oldClientRect, clientX)); - var newDistance = Math.min(distanceToRectLeft(clientRect, clientX), distanceToRectRight(clientRect, clientX)); - if (isInsideX(clientX, clientRect)) { - return clientRect; - } - if (isInsideX(clientX, oldClientRect)) { - return oldClientRect; - } - if (newDistance === oldDistance && isContentEditableFalse$8(clientRect.node)) { - return clientRect; - } - if (newDistance < oldDistance) { - return clientRect; - } - return oldClientRect; - }); + return reduce(clientRects, function (oldClientRect, clientRect) { + var oldDistance = Math.min(distanceToRectLeft(oldClientRect, clientX), distanceToRectRight(oldClientRect, clientX)); + var newDistance = Math.min(distanceToRectLeft(clientRect, clientX), distanceToRectRight(clientRect, clientX)); + if (isInsideX(clientX, clientRect)) { + return clientRect; + } + if (isInsideX(clientX, oldClientRect)) { + return oldClientRect; + } + if (newDistance === oldDistance && isContentEditableFalse$8(clientRect.node)) { + return clientRect; + } + if (newDistance < oldDistance) { + return clientRect; + } + return oldClientRect; + }); }; var walkUntil$1 = function (direction, root, predicateFn, startNode, includeChildren) { - var node = findNode$1(startNode, direction, isEditableCaretCandidate, root, !includeChildren); - do { - if (!node || predicateFn(node)) { - return; - } - } while (node = findNode$1(node, direction, isEditableCaretCandidate, root)); + var node = findNode$1(startNode, direction, isEditableCaretCandidate, root, !includeChildren); + do { + if (!node || predicateFn(node)) { + return; + } + } while (node = findNode$1(node, direction, isEditableCaretCandidate, root)); }; var findLineNodeRects = function (root, targetNodeRect, includeChildren) { - if (includeChildren === void 0) { - includeChildren = true; - } - var clientRects = []; - var collect = function (checkPosFn, node) { - var lineRects = filter(getClientRects([node]), function (clientRect) { - return !checkPosFn(clientRect, targetNodeRect); - }); - clientRects = clientRects.concat(lineRects); - return lineRects.length === 0; - }; - clientRects.push(targetNodeRect); - walkUntil$1(VDirection.Up, root, curry(collect, isAbove), targetNodeRect.node, includeChildren); - walkUntil$1(VDirection.Down, root, curry(collect, isBelow), targetNodeRect.node, includeChildren); - return clientRects; + if (includeChildren === void 0) { + includeChildren = true; + } + var clientRects = []; + var collect = function (checkPosFn, node) { + var lineRects = filter(getClientRects([node]), function (clientRect) { + return !checkPosFn(clientRect, targetNodeRect); + }); + clientRects = clientRects.concat(lineRects); + return lineRects.length === 0; + }; + clientRects.push(targetNodeRect); + walkUntil$1(VDirection.Up, root, curry(collect, isAbove), targetNodeRect.node, includeChildren); + walkUntil$1(VDirection.Down, root, curry(collect, isBelow), targetNodeRect.node, includeChildren); + return clientRects; }; var getFakeCaretTargets = function (root) { - return filter(from$1(root.getElementsByTagName('*')), isFakeCaretTarget); + return filter(from$1(root.getElementsByTagName('*')), isFakeCaretTarget); }; var caretInfo = function (clientRect, clientX) { - return { - node: clientRect.node, - before: distanceToRectLeft(clientRect, clientX) < distanceToRectRight(clientRect, clientX) - }; + return { + node: clientRect.node, + before: distanceToRectLeft(clientRect, clientX) < distanceToRectRight(clientRect, clientX) + }; }; var closestFakeCaret = function (root, clientX, clientY) { - var fakeTargetNodeRects = getClientRects(getFakeCaretTargets(root)); - var targetNodeRects = filter(fakeTargetNodeRects, curry(isInsideY, clientY)); - var closestNodeRect = findClosestClientRect(targetNodeRects, clientX); - if (closestNodeRect) { - var includeChildren = !isTable(closestNodeRect.node) && !isMedia(closestNodeRect.node); - closestNodeRect = findClosestClientRect(findLineNodeRects(root, closestNodeRect, includeChildren), clientX); - if (closestNodeRect && isFakeCaretTarget(closestNodeRect.node)) { - return caretInfo(closestNodeRect, clientX); - } + var fakeTargetNodeRects = getClientRects(getFakeCaretTargets(root)); + var targetNodeRects = filter(fakeTargetNodeRects, curry(isInsideY, clientY)); + var closestNodeRect = findClosestClientRect(targetNodeRects, clientX); + if (closestNodeRect) { + var includeChildren = !isTable(closestNodeRect.node) && !isMedia(closestNodeRect.node); + closestNodeRect = findClosestClientRect(findLineNodeRects(root, closestNodeRect, includeChildren), clientX); + if (closestNodeRect && isFakeCaretTarget(closestNodeRect.node)) { + return caretInfo(closestNodeRect, clientX); } - return null; + } + return null; }; var moveToRange = function (editor, rng) { - editor.selection.setRng(rng); - scrollRangeIntoView(editor, editor.selection.getRng()); + editor.selection.setRng(rng); + scrollRangeIntoView(editor, editor.selection.getRng()); }; var renderRangeCaretOpt = function (editor, range, scrollIntoView) { - return Optional.some(renderRangeCaret(editor, range, scrollIntoView)); + return Optional.some(renderRangeCaret(editor, range, scrollIntoView)); }; var moveHorizontally = function (editor, direction, range, isBefore, isAfter, isElement) { - var forwards = direction === HDirection.Forwards; - var caretWalker = CaretWalker(editor.getBody()); - var getNextPosFn = curry(getVisualCaretPosition, forwards ? caretWalker.next : caretWalker.prev); - var isBeforeFn = forwards ? isBefore : isAfter; - if (!range.collapsed) { - var node = getSelectedNode(range); - if (isElement(node)) { - return showCaret(direction, editor, node, direction === HDirection.Backwards, false); - } - } - var caretPosition = getNormalizedRangeEndPoint(direction, editor.getBody(), range); - if (isBeforeFn(caretPosition)) { - return selectNode(editor, caretPosition.getNode(!forwards)); - } - var nextCaretPosition = normalizePosition(forwards, getNextPosFn(caretPosition)); - var rangeIsInContainerBlock = isRangeInCaretContainerBlock(range); - if (!nextCaretPosition) { - return rangeIsInContainerBlock ? Optional.some(range) : Optional.none(); - } - if (isBeforeFn(nextCaretPosition)) { - return showCaret(direction, editor, nextCaretPosition.getNode(!forwards), forwards, false); - } - var peekCaretPosition = getNextPosFn(nextCaretPosition); - if (peekCaretPosition && isBeforeFn(peekCaretPosition)) { - if (isMoveInsideSameBlock(nextCaretPosition, peekCaretPosition)) { - return showCaret(direction, editor, peekCaretPosition.getNode(!forwards), forwards, false); - } - } - if (rangeIsInContainerBlock) { - return renderRangeCaretOpt(editor, nextCaretPosition.toRange(), false); - } - return Optional.none(); + var forwards = direction === HDirection.Forwards; + var caretWalker = CaretWalker(editor.getBody()); + var getNextPosFn = curry(getVisualCaretPosition, forwards ? caretWalker.next : caretWalker.prev); + var isBeforeFn = forwards ? isBefore : isAfter; + if (!range.collapsed) { + var node = getSelectedNode(range); + if (isElement(node)) { + return showCaret(direction, editor, node, direction === HDirection.Backwards, false); + } + } + var caretPosition = getNormalizedRangeEndPoint(direction, editor.getBody(), range); + if (isBeforeFn(caretPosition)) { + return selectNode(editor, caretPosition.getNode(!forwards)); + } + var nextCaretPosition = normalizePosition(forwards, getNextPosFn(caretPosition)); + var rangeIsInContainerBlock = isRangeInCaretContainerBlock(range); + if (!nextCaretPosition) { + return rangeIsInContainerBlock ? Optional.some(range) : Optional.none(); + } + if (isBeforeFn(nextCaretPosition)) { + return showCaret(direction, editor, nextCaretPosition.getNode(!forwards), forwards, false); + } + var peekCaretPosition = getNextPosFn(nextCaretPosition); + if (peekCaretPosition && isBeforeFn(peekCaretPosition)) { + if (isMoveInsideSameBlock(nextCaretPosition, peekCaretPosition)) { + return showCaret(direction, editor, peekCaretPosition.getNode(!forwards), forwards, false); + } + } + if (rangeIsInContainerBlock) { + return renderRangeCaretOpt(editor, nextCaretPosition.toRange(), false); + } + return Optional.none(); }; var moveVertically = function (editor, direction, range, isBefore, isAfter, isElement) { - var caretPosition = getNormalizedRangeEndPoint(direction, editor.getBody(), range); - var caretClientRect = last$1(caretPosition.getClientRects()); - var forwards = direction === VDirection.Down; - if (!caretClientRect) { - return Optional.none(); - } - var walkerFn = forwards ? downUntil : upUntil; - var linePositions = walkerFn(editor.getBody(), isAboveLine(1), caretPosition); - var nextLinePositions = filter(linePositions, isLine(1)); - var clientX = caretClientRect.left; - var nextLineRect = findClosestClientRect(nextLinePositions, clientX); - if (nextLineRect && isElement(nextLineRect.node)) { - var dist1 = Math.abs(clientX - nextLineRect.left); - var dist2 = Math.abs(clientX - nextLineRect.right); - return showCaret(direction, editor, nextLineRect.node, dist1 < dist2, false); - } - var currentNode; - if (isBefore(caretPosition)) { - currentNode = caretPosition.getNode(); - } else if (isAfter(caretPosition)) { - currentNode = caretPosition.getNode(true); - } else { - currentNode = getSelectedNode(range); - } - if (currentNode) { - var caretPositions = positionsUntil(direction, editor.getBody(), isAboveLine(1), currentNode); - var closestNextLineRect = findClosestClientRect(filter(caretPositions, isLine(1)), clientX); - if (closestNextLineRect) { - return renderRangeCaretOpt(editor, closestNextLineRect.position.toRange(), false); - } - closestNextLineRect = last$1(filter(caretPositions, isLine(0))); - if (closestNextLineRect) { - return renderRangeCaretOpt(editor, closestNextLineRect.position.toRange(), false); - } - } - if (nextLinePositions.length === 0) { - return getLineEndPoint(editor, forwards).filter(forwards ? isAfter : isBefore).map(function (pos) { - return renderRangeCaret(editor, pos.toRange(), false); - }); - } + var caretPosition = getNormalizedRangeEndPoint(direction, editor.getBody(), range); + var caretClientRect = last$1(caretPosition.getClientRects()); + var forwards = direction === VDirection.Down; + if (!caretClientRect) { return Optional.none(); + } + var walkerFn = forwards ? downUntil : upUntil; + var linePositions = walkerFn(editor.getBody(), isAboveLine(1), caretPosition); + var nextLinePositions = filter(linePositions, isLine(1)); + var clientX = caretClientRect.left; + var nextLineRect = findClosestClientRect(nextLinePositions, clientX); + if (nextLineRect && isElement(nextLineRect.node)) { + var dist1 = Math.abs(clientX - nextLineRect.left); + var dist2 = Math.abs(clientX - nextLineRect.right); + return showCaret(direction, editor, nextLineRect.node, dist1 < dist2, false); + } + var currentNode; + if (isBefore(caretPosition)) { + currentNode = caretPosition.getNode(); + } else if (isAfter(caretPosition)) { + currentNode = caretPosition.getNode(true); + } else { + currentNode = getSelectedNode(range); + } + if (currentNode) { + var caretPositions = positionsUntil(direction, editor.getBody(), isAboveLine(1), currentNode); + var closestNextLineRect = findClosestClientRect(filter(caretPositions, isLine(1)), clientX); + if (closestNextLineRect) { + return renderRangeCaretOpt(editor, closestNextLineRect.position.toRange(), false); + } + closestNextLineRect = last$1(filter(caretPositions, isLine(0))); + if (closestNextLineRect) { + return renderRangeCaretOpt(editor, closestNextLineRect.position.toRange(), false); + } + } + if (nextLinePositions.length === 0) { + return getLineEndPoint(editor, forwards).filter(forwards ? isAfter : isBefore).map(function (pos) { + return renderRangeCaret(editor, pos.toRange(), false); + }); + } + return Optional.none(); }; var getLineEndPoint = function (editor, forward) { - var rng = editor.selection.getRng(); - var body = editor.getBody(); - if (forward) { - var from = CaretPosition$1.fromRangeEnd(rng); - var result = getPositionsUntilNextLine(body, from); - return last(result.positions); - } else { - var from = CaretPosition$1.fromRangeStart(rng); - var result = getPositionsUntilPreviousLine(body, from); - return head(result.positions); - } + var rng = editor.selection.getRng(); + var body = editor.getBody(); + if (forward) { + var from = CaretPosition$1.fromRangeEnd(rng); + var result = getPositionsUntilNextLine(body, from); + return last(result.positions); + } else { + var from = CaretPosition$1.fromRangeStart(rng); + var result = getPositionsUntilPreviousLine(body, from); + return head(result.positions); + } }; var moveToLineEndPoint = function (editor, forward, isElementPosition) { - return getLineEndPoint(editor, forward).filter(isElementPosition).exists(function (pos) { - editor.selection.setRng(pos.toRange()); - return true; - }); + return getLineEndPoint(editor, forward).filter(isElementPosition).exists(function (pos) { + editor.selection.setRng(pos.toRange()); + return true; + }); }; var isContentEditableFalse$9 = isContentEditableFalse; var moveToCeFalseHorizontally = function (direction, editor, range) { - return moveHorizontally(editor, direction, range, isBeforeContentEditableFalse, isAfterContentEditableFalse, isContentEditableFalse$9); + return moveHorizontally(editor, direction, range, isBeforeContentEditableFalse, isAfterContentEditableFalse, isContentEditableFalse$9); }; var moveToCeFalseVertically = function (direction, editor, range) { - var isBefore = function (caretPosition) { - return isBeforeContentEditableFalse(caretPosition) || isBeforeTable(caretPosition); - }; - var isAfter = function (caretPosition) { - return isAfterContentEditableFalse(caretPosition) || isAfterTable(caretPosition); - }; - return moveVertically(editor, direction, range, isBefore, isAfter, isContentEditableFalse$9); + var isBefore = function (caretPosition) { + return isBeforeContentEditableFalse(caretPosition) || isBeforeTable(caretPosition); + }; + var isAfter = function (caretPosition) { + return isAfterContentEditableFalse(caretPosition) || isAfterTable(caretPosition); + }; + return moveVertically(editor, direction, range, isBefore, isAfter, isContentEditableFalse$9); }; var createTextBlock = function (editor) { - var textBlock = editor.dom.create(getForcedRootBlock(editor)); - if (!Env.ie || Env.ie >= 11) { - textBlock.innerHTML = '
              '; - } - return textBlock; + var textBlock = editor.dom.create(getForcedRootBlock(editor)); + if (!Env.ie || Env.ie >= 11) { + textBlock.innerHTML = '
              '; + } + return textBlock; }; var exitPreBlock = function (editor, direction, range) { - var caretWalker = CaretWalker(editor.getBody()); - var getVisualCaretPosition$1 = curry(getVisualCaretPosition, direction === 1 ? caretWalker.next : caretWalker.prev); - if (range.collapsed && hasForcedRootBlock(editor)) { - var pre = editor.dom.getParent(range.startContainer, 'PRE'); - if (!pre) { - return; - } - var caretPos = getVisualCaretPosition$1(CaretPosition$1.fromRangeStart(range)); - if (!caretPos) { - var newBlock = createTextBlock(editor); - if (direction === 1) { - editor.$(pre).after(newBlock); - } else { - editor.$(pre).before(newBlock); - } - editor.selection.select(newBlock, true); - editor.selection.collapse(); - } - } + var caretWalker = CaretWalker(editor.getBody()); + var getVisualCaretPosition$1 = curry(getVisualCaretPosition, direction === 1 ? caretWalker.next : caretWalker.prev); + if (range.collapsed && hasForcedRootBlock(editor)) { + var pre = editor.dom.getParent(range.startContainer, 'PRE'); + if (!pre) { + return; + } + var caretPos = getVisualCaretPosition$1(CaretPosition$1.fromRangeStart(range)); + if (!caretPos) { + var newBlock = createTextBlock(editor); + if (direction === 1) { + editor.$(pre).after(newBlock); + } else { + editor.$(pre).before(newBlock); + } + editor.selection.select(newBlock, true); + editor.selection.collapse(); + } + } }; var getHorizontalRange = function (editor, forward) { - var direction = forward ? HDirection.Forwards : HDirection.Backwards; - var range = editor.selection.getRng(); - return moveToCeFalseHorizontally(direction, editor, range).orThunk(function () { - exitPreBlock(editor, direction, range); - return Optional.none(); - }); + var direction = forward ? HDirection.Forwards : HDirection.Backwards; + var range = editor.selection.getRng(); + return moveToCeFalseHorizontally(direction, editor, range).orThunk(function () { + exitPreBlock(editor, direction, range); + return Optional.none(); + }); }; var getVerticalRange = function (editor, down) { - var direction = down ? 1 : -1; - var range = editor.selection.getRng(); - return moveToCeFalseVertically(direction, editor, range).orThunk(function () { - exitPreBlock(editor, direction, range); - return Optional.none(); - }); + var direction = down ? 1 : -1; + var range = editor.selection.getRng(); + return moveToCeFalseVertically(direction, editor, range).orThunk(function () { + exitPreBlock(editor, direction, range); + return Optional.none(); + }); }; var moveH = function (editor, forward) { - return getHorizontalRange(editor, forward).exists(function (newRange) { - moveToRange(editor, newRange); - return true; - }); + return getHorizontalRange(editor, forward).exists(function (newRange) { + moveToRange(editor, newRange); + return true; + }); }; var moveV = function (editor, down) { - return getVerticalRange(editor, down).exists(function (newRange) { - moveToRange(editor, newRange); - return true; - }); + return getVerticalRange(editor, down).exists(function (newRange) { + moveToRange(editor, newRange); + return true; + }); }; var moveToLineEndPoint$1 = function (editor, forward) { - var isCefPosition = forward ? isAfterContentEditableFalse : isBeforeContentEditableFalse; - return moveToLineEndPoint(editor, forward, isCefPosition); + var isCefPosition = forward ? isAfterContentEditableFalse : isBeforeContentEditableFalse; + return moveToLineEndPoint(editor, forward, isCefPosition); }; var isTarget = function (node) { - return contains(['figcaption'], name(node)); + return contains(['figcaption'], name(node)); }; var rangeBefore = function (target) { - var rng = document.createRange(); - rng.setStartBefore(target.dom); - rng.setEndBefore(target.dom); - return rng; + var rng = document.createRange(); + rng.setStartBefore(target.dom); + rng.setEndBefore(target.dom); + return rng; }; var insertElement = function (root, elm, forward) { - if (forward) { - append(root, elm); - } else { - prepend(root, elm); - } + if (forward) { + append(root, elm); + } else { + prepend(root, elm); + } }; var insertBr = function (root, forward) { - var br = SugarElement.fromTag('br'); - insertElement(root, br, forward); - return rangeBefore(br); + var br = SugarElement.fromTag('br'); + insertElement(root, br, forward); + return rangeBefore(br); }; var insertBlock$1 = function (root, forward, blockName, attrs) { - var block = SugarElement.fromTag(blockName); - var br = SugarElement.fromTag('br'); - setAll(block, attrs); - append(block, br); - insertElement(root, block, forward); - return rangeBefore(br); + var block = SugarElement.fromTag(blockName); + var br = SugarElement.fromTag('br'); + setAll(block, attrs); + append(block, br); + insertElement(root, block, forward); + return rangeBefore(br); }; var insertEmptyLine = function (root, rootBlockName, attrs, forward) { - if (rootBlockName === '') { - return insertBr(root, forward); - } else { - return insertBlock$1(root, forward, rootBlockName, attrs); - } + if (rootBlockName === '') { + return insertBr(root, forward); + } else { + return insertBlock$1(root, forward, rootBlockName, attrs); + } }; var getClosestTargetBlock = function (pos, root) { - var isRoot = curry(eq$2, root); - return closest(SugarElement.fromDom(pos.container()), isBlock, isRoot).filter(isTarget); + var isRoot = curry(eq$2, root); + return closest(SugarElement.fromDom(pos.container()), isBlock, isRoot).filter(isTarget); }; var isAtFirstOrLastLine = function (root, forward, pos) { - return forward ? isAtLastLine(root.dom, pos) : isAtFirstLine(root.dom, pos); + return forward ? isAtLastLine(root.dom, pos) : isAtFirstLine(root.dom, pos); }; var moveCaretToNewEmptyLine = function (editor, forward) { - var root = SugarElement.fromDom(editor.getBody()); - var pos = CaretPosition$1.fromRangeStart(editor.selection.getRng()); - var rootBlock = getForcedRootBlock(editor); - var rootBlockAttrs = getForcedRootBlockAttrs(editor); - return getClosestTargetBlock(pos, root).exists(function () { - if (isAtFirstOrLastLine(root, forward, pos)) { - var rng = insertEmptyLine(root, rootBlock, rootBlockAttrs, forward); - editor.selection.setRng(rng); - return true; - } else { - return false; - } - }); - }; - var moveV$1 = function (editor, forward) { - if (editor.selection.isCollapsed()) { - return moveCaretToNewEmptyLine(editor, forward); + var root = SugarElement.fromDom(editor.getBody()); + var pos = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + var rootBlock = getForcedRootBlock(editor); + var rootBlockAttrs = getForcedRootBlockAttrs(editor); + return getClosestTargetBlock(pos, root).exists(function () { + if (isAtFirstOrLastLine(root, forward, pos)) { + var rng = insertEmptyLine(root, rootBlock, rootBlockAttrs, forward); + editor.selection.setRng(rng); + return true; } else { - return false; + return false; } + }); + }; + var moveV$1 = function (editor, forward) { + if (editor.selection.isCollapsed()) { + return moveCaretToNewEmptyLine(editor, forward); + } else { + return false; + } }; var defaultPatterns = function (patterns) { - return map(patterns, function (pattern) { - return __assign({ - shiftKey: false, - altKey: false, - ctrlKey: false, - metaKey: false, - keyCode: 0, - action: noop - }, pattern); - }); + return map(patterns, function (pattern) { + return __assign({ + shiftKey: false, + altKey: false, + ctrlKey: false, + metaKey: false, + keyCode: 0, + action: noop + }, pattern); + }); }; var matchesEvent = function (pattern, evt) { - return evt.keyCode === pattern.keyCode && evt.shiftKey === pattern.shiftKey && evt.altKey === pattern.altKey && evt.ctrlKey === pattern.ctrlKey && evt.metaKey === pattern.metaKey; + return evt.keyCode === pattern.keyCode && evt.shiftKey === pattern.shiftKey && evt.altKey === pattern.altKey && evt.ctrlKey === pattern.ctrlKey && evt.metaKey === pattern.metaKey; }; var match$1 = function (patterns, evt) { - return bind(defaultPatterns(patterns), function (pattern) { - return matchesEvent(pattern, evt) ? [pattern] : []; - }); + return bind(defaultPatterns(patterns), function (pattern) { + return matchesEvent(pattern, evt) ? [pattern] : []; + }); }; var action = function (f) { - var x = []; - for (var _i = 1; _i < arguments.length; _i++) { - x[_i - 1] = arguments[_i]; - } - return function () { - return f.apply(null, x); - }; + var x = []; + for (var _i = 1; _i < arguments.length; _i++) { + x[_i - 1] = arguments[_i]; + } + return function () { + return f.apply(null, x); + }; }; var execute = function (patterns, evt) { - return find(match$1(patterns, evt), function (pattern) { - return pattern.action(); - }); + return find(match$1(patterns, evt), function (pattern) { + return pattern.action(); + }); }; var moveH$1 = function (editor, forward) { - var direction = forward ? HDirection.Forwards : HDirection.Backwards; - var range = editor.selection.getRng(); - return moveHorizontally(editor, direction, range, isBeforeMedia, isAfterMedia, isMedia).exists(function (newRange) { - moveToRange(editor, newRange); - return true; - }); + var direction = forward ? HDirection.Forwards : HDirection.Backwards; + var range = editor.selection.getRng(); + return moveHorizontally(editor, direction, range, isBeforeMedia, isAfterMedia, isMedia).exists(function (newRange) { + moveToRange(editor, newRange); + return true; + }); }; var moveV$2 = function (editor, down) { - var direction = down ? 1 : -1; - var range = editor.selection.getRng(); - return moveVertically(editor, direction, range, isBeforeMedia, isAfterMedia, isMedia).exists(function (newRange) { - moveToRange(editor, newRange); - return true; - }); + var direction = down ? 1 : -1; + var range = editor.selection.getRng(); + return moveVertically(editor, direction, range, isBeforeMedia, isAfterMedia, isMedia).exists(function (newRange) { + moveToRange(editor, newRange); + return true; + }); }; var moveToLineEndPoint$2 = function (editor, forward) { - var isNearMedia = forward ? isAfterMedia : isBeforeMedia; - return moveToLineEndPoint(editor, forward, isNearMedia); + var isNearMedia = forward ? isAfterMedia : isBeforeMedia; + return moveToLineEndPoint(editor, forward, isNearMedia); }; var deflate = function (rect, delta) { - return { - left: rect.left - delta, - top: rect.top - delta, - right: rect.right + delta * 2, - bottom: rect.bottom + delta * 2, - width: rect.width + delta, - height: rect.height + delta - }; + return { + left: rect.left - delta, + top: rect.top - delta, + right: rect.right + delta * 2, + bottom: rect.bottom + delta * 2, + width: rect.width + delta, + height: rect.height + delta + }; }; var getCorners = function (getYAxisValue, tds) { - return bind(tds, function (td) { - var rect = deflate(clone$2(td.getBoundingClientRect()), -1); - return [ - { - x: rect.left, - y: getYAxisValue(rect), - cell: td - }, - { - x: rect.right, - y: getYAxisValue(rect), - cell: td - } - ]; - }); - }; + return bind(tds, function (td) { + var rect = deflate(clone$2(td.getBoundingClientRect()), -1); + return [ + { + x: rect.left, + y: getYAxisValue(rect), + cell: td + }, + { + x: rect.right, + y: getYAxisValue(rect), + cell: td + } + ]; + }); + }; var findClosestCorner = function (corners, x, y) { - return foldl(corners, function (acc, newCorner) { - return acc.fold(function () { - return Optional.some(newCorner); - }, function (oldCorner) { - var oldDist = Math.sqrt(Math.abs(oldCorner.x - x) + Math.abs(oldCorner.y - y)); - var newDist = Math.sqrt(Math.abs(newCorner.x - x) + Math.abs(newCorner.y - y)); - return Optional.some(newDist < oldDist ? newCorner : oldCorner); - }); - }, Optional.none()); + return foldl(corners, function (acc, newCorner) { + return acc.fold(function () { + return Optional.some(newCorner); + }, function (oldCorner) { + var oldDist = Math.sqrt(Math.abs(oldCorner.x - x) + Math.abs(oldCorner.y - y)); + var newDist = Math.sqrt(Math.abs(newCorner.x - x) + Math.abs(newCorner.y - y)); + return Optional.some(newDist < oldDist ? newCorner : oldCorner); + }); + }, Optional.none()); }; var getClosestCell$1 = function (getYAxisValue, isTargetCorner, table, x, y) { - var cells = descendants$1(SugarElement.fromDom(table), 'td,th,caption').map(function (e) { - return e.dom; - }); - var corners = filter(getCorners(getYAxisValue, cells), function (corner) { - return isTargetCorner(corner, y); - }); - return findClosestCorner(corners, x, y).map(function (corner) { - return corner.cell; - }); + var cells = descendants$1(SugarElement.fromDom(table), 'td,th,caption').map(function (e) { + return e.dom; + }); + var corners = filter(getCorners(getYAxisValue, cells), function (corner) { + return isTargetCorner(corner, y); + }); + return findClosestCorner(corners, x, y).map(function (corner) { + return corner.cell; + }); }; var getBottomValue = function (rect) { - return rect.bottom; + return rect.bottom; }; var getTopValue = function (rect) { - return rect.top; + return rect.top; }; var isAbove$1 = function (corner, y) { - return corner.y < y; + return corner.y < y; }; var isBelow$1 = function (corner, y) { - return corner.y > y; + return corner.y > y; }; var getClosestCellAbove = curry(getClosestCell$1, getBottomValue, isAbove$1); var getClosestCellBelow = curry(getClosestCell$1, getTopValue, isBelow$1); var findClosestPositionInAboveCell = function (table, pos) { - return head(pos.getClientRects()).bind(function (rect) { - return getClosestCellAbove(table, rect.left, rect.top); - }).bind(function (cell) { - return findClosestHorizontalPosition(getLastLinePositions(cell), pos); - }); + return head(pos.getClientRects()).bind(function (rect) { + return getClosestCellAbove(table, rect.left, rect.top); + }).bind(function (cell) { + return findClosestHorizontalPosition(getLastLinePositions(cell), pos); + }); }; var findClosestPositionInBelowCell = function (table, pos) { - return last(pos.getClientRects()).bind(function (rect) { - return getClosestCellBelow(table, rect.left, rect.top); - }).bind(function (cell) { - return findClosestHorizontalPosition(getFirstLinePositions(cell), pos); - }); + return last(pos.getClientRects()).bind(function (rect) { + return getClosestCellBelow(table, rect.left, rect.top); + }).bind(function (cell) { + return findClosestHorizontalPosition(getFirstLinePositions(cell), pos); + }); }; var hasNextBreak = function (getPositionsUntil, scope, lineInfo) { - return lineInfo.breakAt.exists(function (breakPos) { - return getPositionsUntil(scope, breakPos).breakAt.isSome(); - }); + return lineInfo.breakAt.exists(function (breakPos) { + return getPositionsUntil(scope, breakPos).breakAt.isSome(); + }); }; var startsWithWrapBreak = function (lineInfo) { - return lineInfo.breakType === BreakType.Wrap && lineInfo.positions.length === 0; + return lineInfo.breakType === BreakType.Wrap && lineInfo.positions.length === 0; }; var startsWithBrBreak = function (lineInfo) { - return lineInfo.breakType === BreakType.Br && lineInfo.positions.length === 1; + return lineInfo.breakType === BreakType.Br && lineInfo.positions.length === 1; }; var isAtTableCellLine = function (getPositionsUntil, scope, pos) { - var lineInfo = getPositionsUntil(scope, pos); - if (startsWithWrapBreak(lineInfo) || !isBr(pos.getNode()) && startsWithBrBreak(lineInfo)) { - return !hasNextBreak(getPositionsUntil, scope, lineInfo); - } else { - return lineInfo.breakAt.isNone(); - } + var lineInfo = getPositionsUntil(scope, pos); + if (startsWithWrapBreak(lineInfo) || !isBr(pos.getNode()) && startsWithBrBreak(lineInfo)) { + return !hasNextBreak(getPositionsUntil, scope, lineInfo); + } else { + return lineInfo.breakAt.isNone(); + } }; var isAtFirstTableCellLine = curry(isAtTableCellLine, getPositionsUntilPreviousLine); var isAtLastTableCellLine = curry(isAtTableCellLine, getPositionsUntilNextLine); var isCaretAtStartOrEndOfTable = function (forward, rng, table) { - var caretPos = CaretPosition$1.fromRangeStart(rng); - return positionIn(!forward, table).exists(function (pos) { - return pos.isEqual(caretPos); - }); + var caretPos = CaretPosition$1.fromRangeStart(rng); + return positionIn(!forward, table).exists(function (pos) { + return pos.isEqual(caretPos); + }); }; var navigateHorizontally = function (editor, forward, table, _td) { - var rng = editor.selection.getRng(); - var direction = forward ? 1 : -1; - if (isFakeCaretTableBrowser() && isCaretAtStartOrEndOfTable(forward, rng, table)) { - showCaret(direction, editor, table, !forward, false).each(function (newRng) { - moveToRange(editor, newRng); - }); - return true; - } - return false; + var rng = editor.selection.getRng(); + var direction = forward ? 1 : -1; + if (isFakeCaretTableBrowser() && isCaretAtStartOrEndOfTable(forward, rng, table)) { + showCaret(direction, editor, table, !forward, false).each(function (newRng) { + moveToRange(editor, newRng); + }); + return true; + } + return false; }; var getClosestAbovePosition = function (root, table, start) { - return findClosestPositionInAboveCell(table, start).orThunk(function () { - return head(start.getClientRects()).bind(function (rect) { - return findClosestHorizontalPositionFromPoint(getPositionsAbove(root, CaretPosition$1.before(table)), rect.left); - }); - }).getOr(CaretPosition$1.before(table)); + return findClosestPositionInAboveCell(table, start).orThunk(function () { + return head(start.getClientRects()).bind(function (rect) { + return findClosestHorizontalPositionFromPoint(getPositionsAbove(root, CaretPosition$1.before(table)), rect.left); + }); + }).getOr(CaretPosition$1.before(table)); }; var getClosestBelowPosition = function (root, table, start) { - return findClosestPositionInBelowCell(table, start).orThunk(function () { - return head(start.getClientRects()).bind(function (rect) { - return findClosestHorizontalPositionFromPoint(getPositionsBelow(root, CaretPosition$1.after(table)), rect.left); - }); - }).getOr(CaretPosition$1.after(table)); + return findClosestPositionInBelowCell(table, start).orThunk(function () { + return head(start.getClientRects()).bind(function (rect) { + return findClosestHorizontalPositionFromPoint(getPositionsBelow(root, CaretPosition$1.after(table)), rect.left); + }); + }).getOr(CaretPosition$1.after(table)); }; var getTable = function (previous, pos) { - var node = pos.getNode(previous); - return isElement$1(node) && node.nodeName === 'TABLE' ? Optional.some(node) : Optional.none(); + var node = pos.getNode(previous); + return isElement$1(node) && node.nodeName === 'TABLE' ? Optional.some(node) : Optional.none(); }; var renderBlock = function (down, editor, table, pos) { - var forcedRootBlock = getForcedRootBlock(editor); - if (forcedRootBlock) { - editor.undoManager.transact(function () { - var element = SugarElement.fromTag(forcedRootBlock); - setAll(element, getForcedRootBlockAttrs(editor)); - append(element, SugarElement.fromTag('br')); - if (down) { - after(SugarElement.fromDom(table), element); - } else { - before(SugarElement.fromDom(table), element); - } - var rng = editor.dom.createRng(); - rng.setStart(element.dom, 0); - rng.setEnd(element.dom, 0); - moveToRange(editor, rng); - }); - } else { - moveToRange(editor, pos.toRange()); - } + var forcedRootBlock = getForcedRootBlock(editor); + if (forcedRootBlock) { + editor.undoManager.transact(function () { + var element = SugarElement.fromTag(forcedRootBlock); + setAll(element, getForcedRootBlockAttrs(editor)); + append(element, SugarElement.fromTag('br')); + if (down) { + after(SugarElement.fromDom(table), element); + } else { + before(SugarElement.fromDom(table), element); + } + var rng = editor.dom.createRng(); + rng.setStart(element.dom, 0); + rng.setEnd(element.dom, 0); + moveToRange(editor, rng); + }); + } else { + moveToRange(editor, pos.toRange()); + } }; var moveCaret = function (editor, down, pos) { - var table = down ? getTable(true, pos) : getTable(false, pos); - var last = down === false; - table.fold(function () { - return moveToRange(editor, pos.toRange()); - }, function (table) { - return positionIn(last, editor.getBody()).filter(function (lastPos) { - return lastPos.isEqual(pos); - }).fold(function () { - return moveToRange(editor, pos.toRange()); - }, function (_) { - return renderBlock(down, editor, table, pos); - }); + var table = down ? getTable(true, pos) : getTable(false, pos); + var last = down === false; + table.fold(function () { + return moveToRange(editor, pos.toRange()); + }, function (table) { + return positionIn(last, editor.getBody()).filter(function (lastPos) { + return lastPos.isEqual(pos); + }).fold(function () { + return moveToRange(editor, pos.toRange()); + }, function (_) { + return renderBlock(down, editor, table, pos); }); + }); }; var navigateVertically = function (editor, down, table, td) { - var rng = editor.selection.getRng(); - var pos = CaretPosition$1.fromRangeStart(rng); - var root = editor.getBody(); - if (!down && isAtFirstTableCellLine(td, pos)) { - var newPos = getClosestAbovePosition(root, table, pos); - moveCaret(editor, down, newPos); - return true; - } else if (down && isAtLastTableCellLine(td, pos)) { - var newPos = getClosestBelowPosition(root, table, pos); - moveCaret(editor, down, newPos); - return true; - } else { - return false; - } + var rng = editor.selection.getRng(); + var pos = CaretPosition$1.fromRangeStart(rng); + var root = editor.getBody(); + if (!down && isAtFirstTableCellLine(td, pos)) { + var newPos = getClosestAbovePosition(root, table, pos); + moveCaret(editor, down, newPos); + return true; + } else if (down && isAtLastTableCellLine(td, pos)) { + var newPos = getClosestBelowPosition(root, table, pos); + moveCaret(editor, down, newPos); + return true; + } else { + return false; + } }; var move$1 = function (editor, forward, mover) { - return Optional.from(editor.dom.getParent(editor.selection.getNode(), 'td,th')).bind(function (td) { - return Optional.from(editor.dom.getParent(td, 'table')).map(function (table) { - return mover(editor, forward, table, td); - }); - }).getOr(false); + return Optional.from(editor.dom.getParent(editor.selection.getNode(), 'td,th')).bind(function (td) { + return Optional.from(editor.dom.getParent(td, 'table')).map(function (table) { + return mover(editor, forward, table, td); + }); + }).getOr(false); }; var moveH$2 = function (editor, forward) { - return move$1(editor, forward, navigateHorizontally); + return move$1(editor, forward, navigateHorizontally); }; var moveV$3 = function (editor, forward) { - return move$1(editor, forward, navigateVertically); + return move$1(editor, forward, navigateVertically); }; var executeKeydownOverride = function (editor, caret, evt) { - var os = detect$3().os; - execute([ - { - keyCode: VK.RIGHT, - action: action(moveH, editor, true) - }, - { - keyCode: VK.LEFT, - action: action(moveH, editor, false) - }, - { - keyCode: VK.UP, - action: action(moveV, editor, false) - }, - { - keyCode: VK.DOWN, - action: action(moveV, editor, true) - }, - { - keyCode: VK.RIGHT, - action: action(moveH$2, editor, true) - }, - { - keyCode: VK.LEFT, - action: action(moveH$2, editor, false) - }, - { - keyCode: VK.UP, - action: action(moveV$3, editor, false) - }, - { - keyCode: VK.DOWN, - action: action(moveV$3, editor, true) - }, - { - keyCode: VK.RIGHT, - action: action(moveH$1, editor, true) - }, - { - keyCode: VK.LEFT, - action: action(moveH$1, editor, false) - }, - { - keyCode: VK.UP, - action: action(moveV$2, editor, false) - }, - { - keyCode: VK.DOWN, - action: action(moveV$2, editor, true) - }, - { - keyCode: VK.RIGHT, - action: action(move, editor, caret, true) - }, - { - keyCode: VK.LEFT, - action: action(move, editor, caret, false) - }, - { - keyCode: VK.RIGHT, - ctrlKey: !os.isOSX(), - altKey: os.isOSX(), - action: action(moveNextWord, editor, caret) - }, - { - keyCode: VK.LEFT, - ctrlKey: !os.isOSX(), - altKey: os.isOSX(), - action: action(movePrevWord, editor, caret) - }, - { - keyCode: VK.UP, - action: action(moveV$1, editor, false) - }, - { - keyCode: VK.DOWN, - action: action(moveV$1, editor, true) - } - ], evt).each(function (_) { - evt.preventDefault(); - }); + var os = detect$3().os; + execute([ + { + keyCode: VK.RIGHT, + action: action(moveH, editor, true) + }, + { + keyCode: VK.LEFT, + action: action(moveH, editor, false) + }, + { + keyCode: VK.UP, + action: action(moveV, editor, false) + }, + { + keyCode: VK.DOWN, + action: action(moveV, editor, true) + }, + { + keyCode: VK.RIGHT, + action: action(moveH$2, editor, true) + }, + { + keyCode: VK.LEFT, + action: action(moveH$2, editor, false) + }, + { + keyCode: VK.UP, + action: action(moveV$3, editor, false) + }, + { + keyCode: VK.DOWN, + action: action(moveV$3, editor, true) + }, + { + keyCode: VK.RIGHT, + action: action(moveH$1, editor, true) + }, + { + keyCode: VK.LEFT, + action: action(moveH$1, editor, false) + }, + { + keyCode: VK.UP, + action: action(moveV$2, editor, false) + }, + { + keyCode: VK.DOWN, + action: action(moveV$2, editor, true) + }, + { + keyCode: VK.RIGHT, + action: action(move, editor, caret, true) + }, + { + keyCode: VK.LEFT, + action: action(move, editor, caret, false) + }, + { + keyCode: VK.RIGHT, + ctrlKey: !os.isOSX(), + altKey: os.isOSX(), + action: action(moveNextWord, editor, caret) + }, + { + keyCode: VK.LEFT, + ctrlKey: !os.isOSX(), + altKey: os.isOSX(), + action: action(movePrevWord, editor, caret) + }, + { + keyCode: VK.UP, + action: action(moveV$1, editor, false) + }, + { + keyCode: VK.DOWN, + action: action(moveV$1, editor, true) + } + ], evt).each(function (_) { + evt.preventDefault(); + }); }; var setup$c = function (editor, caret) { - editor.on('keydown', function (evt) { - if (evt.isDefaultPrevented() === false) { - executeKeydownOverride(editor, caret, evt); - } - }); + editor.on('keydown', function (evt) { + if (evt.isDefaultPrevented() === false) { + executeKeydownOverride(editor, caret, evt); + } + }); }; var executeKeydownOverride$1 = function (editor, caret, evt) { - execute([ - { - keyCode: VK.BACKSPACE, - action: action(backspaceDelete$9, editor, false) - }, - { - keyCode: VK.BACKSPACE, - action: action(backspaceDelete$4, editor, false) - }, - { - keyCode: VK.DELETE, - action: action(backspaceDelete$4, editor, true) - }, - { - keyCode: VK.BACKSPACE, - action: action(backspaceDelete$3, editor, false) - }, - { - keyCode: VK.DELETE, - action: action(backspaceDelete$3, editor, true) - }, - { - keyCode: VK.BACKSPACE, - action: action(backspaceDelete$6, editor, caret, false) - }, - { - keyCode: VK.DELETE, - action: action(backspaceDelete$6, editor, caret, true) - }, - { - keyCode: VK.BACKSPACE, - action: action(backspaceDelete, editor, false) - }, - { - keyCode: VK.DELETE, - action: action(backspaceDelete, editor, true) - }, - { - keyCode: VK.BACKSPACE, - action: action(backspaceDelete$5, editor, false) - }, - { - keyCode: VK.DELETE, - action: action(backspaceDelete$5, editor, true) - }, - { - keyCode: VK.BACKSPACE, - action: action(backspaceDelete$8, editor, false) - }, - { - keyCode: VK.DELETE, - action: action(backspaceDelete$8, editor, true) - }, - { - keyCode: VK.BACKSPACE, - action: action(backspaceDelete$2, editor, false) - }, - { - keyCode: VK.DELETE, - action: action(backspaceDelete$2, editor, true) - }, - { - keyCode: VK.BACKSPACE, - action: action(backspaceDelete$1, editor, false) - }, - { - keyCode: VK.DELETE, - action: action(backspaceDelete$1, editor, true) - }, - { - keyCode: VK.BACKSPACE, - action: action(backspaceDelete$7, editor, false) - }, - { - keyCode: VK.DELETE, - action: action(backspaceDelete$7, editor, true) - } - ], evt).each(function (_) { - evt.preventDefault(); - }); + execute([ + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete$9, editor, false) + }, + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete$4, editor, false) + }, + { + keyCode: VK.DELETE, + action: action(backspaceDelete$4, editor, true) + }, + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete$3, editor, false) + }, + { + keyCode: VK.DELETE, + action: action(backspaceDelete$3, editor, true) + }, + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete$6, editor, caret, false) + }, + { + keyCode: VK.DELETE, + action: action(backspaceDelete$6, editor, caret, true) + }, + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete, editor, false) + }, + { + keyCode: VK.DELETE, + action: action(backspaceDelete, editor, true) + }, + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete$5, editor, false) + }, + { + keyCode: VK.DELETE, + action: action(backspaceDelete$5, editor, true) + }, + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete$8, editor, false) + }, + { + keyCode: VK.DELETE, + action: action(backspaceDelete$8, editor, true) + }, + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete$2, editor, false) + }, + { + keyCode: VK.DELETE, + action: action(backspaceDelete$2, editor, true) + }, + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete$1, editor, false) + }, + { + keyCode: VK.DELETE, + action: action(backspaceDelete$1, editor, true) + }, + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete$7, editor, false) + }, + { + keyCode: VK.DELETE, + action: action(backspaceDelete$7, editor, true) + } + ], evt).each(function (_) { + evt.preventDefault(); + }); }; var executeKeyupOverride = function (editor, evt) { - execute([ - { - keyCode: VK.BACKSPACE, - action: action(paddEmptyElement, editor) - }, - { - keyCode: VK.DELETE, - action: action(paddEmptyElement, editor) - } - ], evt); + execute([ + { + keyCode: VK.BACKSPACE, + action: action(paddEmptyElement, editor) + }, + { + keyCode: VK.DELETE, + action: action(paddEmptyElement, editor) + } + ], evt); }; var setup$d = function (editor, caret) { - editor.on('keydown', function (evt) { - if (evt.isDefaultPrevented() === false) { - executeKeydownOverride$1(editor, caret, evt); - } - }); - editor.on('keyup', function (evt) { - if (evt.isDefaultPrevented() === false) { - executeKeyupOverride(editor, evt); - } - }); + editor.on('keydown', function (evt) { + if (evt.isDefaultPrevented() === false) { + executeKeydownOverride$1(editor, caret, evt); + } + }); + editor.on('keyup', function (evt) { + if (evt.isDefaultPrevented() === false) { + executeKeyupOverride(editor, evt); + } + }); }; var firstNonWhiteSpaceNodeSibling = function (node) { - while (node) { - if (node.nodeType === 1 || node.nodeType === 3 && node.data && /[\r\n\s]/.test(node.data)) { - return node; - } - node = node.nextSibling; + while (node) { + if (node.nodeType === 1 || node.nodeType === 3 && node.data && /[\r\n\s]/.test(node.data)) { + return node; } + node = node.nextSibling; + } }; var moveToCaretPosition = function (editor, root) { - var node, lastNode = root; - var dom = editor.dom; - var moveCaretBeforeOnEnterElementsMap = editor.schema.getMoveCaretBeforeOnEnterElements(); - if (!root) { - return; - } - if (/^(LI|DT|DD)$/.test(root.nodeName)) { - var firstChild = firstNonWhiteSpaceNodeSibling(root.firstChild); - if (firstChild && /^(UL|OL|DL)$/.test(firstChild.nodeName)) { - root.insertBefore(dom.doc.createTextNode(nbsp), root.firstChild); - } + var node, lastNode = root; + var dom = editor.dom; + var moveCaretBeforeOnEnterElementsMap = editor.schema.getMoveCaretBeforeOnEnterElements(); + if (!root) { + return; + } + if (/^(LI|DT|DD)$/.test(root.nodeName)) { + var firstChild = firstNonWhiteSpaceNodeSibling(root.firstChild); + if (firstChild && /^(UL|OL|DL)$/.test(firstChild.nodeName)) { + root.insertBefore(dom.doc.createTextNode(nbsp), root.firstChild); + } + } + var rng = dom.createRng(); + root.normalize(); + if (root.hasChildNodes()) { + var walker = new DomTreeWalker(root, root); + while (node = walker.current()) { + if (isText$1(node)) { + rng.setStart(node, 0); + rng.setEnd(node, 0); + break; + } + if (moveCaretBeforeOnEnterElementsMap[node.nodeName.toLowerCase()]) { + rng.setStartBefore(node); + rng.setEndBefore(node); + break; + } + lastNode = node; + node = walker.next(); } - var rng = dom.createRng(); - root.normalize(); - if (root.hasChildNodes()) { - var walker = new DomTreeWalker(root, root); - while (node = walker.current()) { - if (isText$1(node)) { - rng.setStart(node, 0); - rng.setEnd(node, 0); - break; - } - if (moveCaretBeforeOnEnterElementsMap[node.nodeName.toLowerCase()]) { - rng.setStartBefore(node); - rng.setEndBefore(node); - break; - } - lastNode = node; - node = walker.next(); - } - if (!node) { - rng.setStart(lastNode, 0); - rng.setEnd(lastNode, 0); - } + if (!node) { + rng.setStart(lastNode, 0); + rng.setEnd(lastNode, 0); + } + } else { + if (isBr(root)) { + if (root.nextSibling && dom.isBlock(root.nextSibling)) { + rng.setStartBefore(root); + rng.setEndBefore(root); + } else { + rng.setStartAfter(root); + rng.setEndAfter(root); + } } else { - if (isBr(root)) { - if (root.nextSibling && dom.isBlock(root.nextSibling)) { - rng.setStartBefore(root); - rng.setEndBefore(root); - } else { - rng.setStartAfter(root); - rng.setEndAfter(root); - } - } else { - rng.setStart(root, 0); - rng.setEnd(root, 0); - } + rng.setStart(root, 0); + rng.setEnd(root, 0); } - editor.selection.setRng(rng); - scrollRangeIntoView(editor, rng); + } + editor.selection.setRng(rng); + scrollRangeIntoView(editor, rng); }; var getEditableRoot = function (dom, node) { - var root = dom.getRoot(); - var parent, editableRoot; - parent = node; - while (parent !== root && dom.getContentEditable(parent) !== 'false') { - if (dom.getContentEditable(parent) === 'true') { - editableRoot = parent; - } - parent = parent.parentNode; + var root = dom.getRoot(); + var parent, editableRoot; + parent = node; + while (parent !== root && dom.getContentEditable(parent) !== 'false') { + if (dom.getContentEditable(parent) === 'true') { + editableRoot = parent; } - return parent !== root ? editableRoot : root; + parent = parent.parentNode; + } + return parent !== root ? editableRoot : root; }; var getParentBlock$2 = function (editor) { - return Optional.from(editor.dom.getParent(editor.selection.getStart(true), editor.dom.isBlock)); + return Optional.from(editor.dom.getParent(editor.selection.getStart(true), editor.dom.isBlock)); }; var getParentBlockName = function (editor) { - return getParentBlock$2(editor).fold(constant(''), function (parentBlock) { - return parentBlock.nodeName.toUpperCase(); - }); + return getParentBlock$2(editor).fold(constant(''), function (parentBlock) { + return parentBlock.nodeName.toUpperCase(); + }); }; var isListItemParentBlock = function (editor) { - return getParentBlock$2(editor).filter(function (elm) { - return isListItem(SugarElement.fromDom(elm)); - }).isSome(); + return getParentBlock$2(editor).filter(function (elm) { + return isListItem(SugarElement.fromDom(elm)); + }).isSome(); }; var hasFirstChild = function (elm, name) { - return elm.firstChild && elm.firstChild.nodeName === name; + return elm.firstChild && elm.firstChild.nodeName === name; }; var hasParent$1 = function (elm, parentName) { - return elm && elm.parentNode && elm.parentNode.nodeName === parentName; + return elm && elm.parentNode && elm.parentNode.nodeName === parentName; }; var isListBlock = function (elm) { - return elm && /^(OL|UL|LI)$/.test(elm.nodeName); + return elm && /^(OL|UL|LI)$/.test(elm.nodeName); }; var isNestedList = function (elm) { - return isListBlock(elm) && isListBlock(elm.parentNode); + return isListBlock(elm) && isListBlock(elm.parentNode); }; var getContainerBlock = function (containerBlock) { - var containerBlockParent = containerBlock.parentNode; - if (/^(LI|DT|DD)$/.test(containerBlockParent.nodeName)) { - return containerBlockParent; - } - return containerBlock; + var containerBlockParent = containerBlock.parentNode; + if (/^(LI|DT|DD)$/.test(containerBlockParent.nodeName)) { + return containerBlockParent; + } + return containerBlock; }; var isFirstOrLastLi = function (containerBlock, parentBlock, first) { - var node = containerBlock[first ? 'firstChild' : 'lastChild']; - while (node) { - if (isElement$1(node)) { - break; - } - node = node[first ? 'nextSibling' : 'previousSibling']; + var node = containerBlock[first ? 'firstChild' : 'lastChild']; + while (node) { + if (isElement$1(node)) { + break; } - return node === parentBlock; + node = node[first ? 'nextSibling' : 'previousSibling']; + } + return node === parentBlock; }; var insert = function (editor, createNewBlock, containerBlock, parentBlock, newBlockName) { - var dom = editor.dom; - var rng = editor.selection.getRng(); - if (containerBlock === editor.getBody()) { - return; - } - if (isNestedList(containerBlock)) { - newBlockName = 'LI'; + var dom = editor.dom; + var rng = editor.selection.getRng(); + if (containerBlock === editor.getBody()) { + return; + } + if (isNestedList(containerBlock)) { + newBlockName = 'LI'; + } + var newBlock = newBlockName ? createNewBlock(newBlockName) : dom.create('BR'); + if (isFirstOrLastLi(containerBlock, parentBlock, true) && isFirstOrLastLi(containerBlock, parentBlock, false)) { + if (hasParent$1(containerBlock, 'LI')) { + dom.insertAfter(newBlock, getContainerBlock(containerBlock)); + } else { + dom.replace(newBlock, containerBlock); } - var newBlock = newBlockName ? createNewBlock(newBlockName) : dom.create('BR'); - if (isFirstOrLastLi(containerBlock, parentBlock, true) && isFirstOrLastLi(containerBlock, parentBlock, false)) { - if (hasParent$1(containerBlock, 'LI')) { - dom.insertAfter(newBlock, getContainerBlock(containerBlock)); - } else { - dom.replace(newBlock, containerBlock); - } - } else if (isFirstOrLastLi(containerBlock, parentBlock, true)) { - if (hasParent$1(containerBlock, 'LI')) { - dom.insertAfter(newBlock, getContainerBlock(containerBlock)); - newBlock.appendChild(dom.doc.createTextNode(' ')); - newBlock.appendChild(containerBlock); - } else { - containerBlock.parentNode.insertBefore(newBlock, containerBlock); - } - } else if (isFirstOrLastLi(containerBlock, parentBlock, false)) { - dom.insertAfter(newBlock, getContainerBlock(containerBlock)); + } else if (isFirstOrLastLi(containerBlock, parentBlock, true)) { + if (hasParent$1(containerBlock, 'LI')) { + dom.insertAfter(newBlock, getContainerBlock(containerBlock)); + newBlock.appendChild(dom.doc.createTextNode(' ')); + newBlock.appendChild(containerBlock); } else { - containerBlock = getContainerBlock(containerBlock); - var tmpRng = rng.cloneRange(); - tmpRng.setStartAfter(parentBlock); - tmpRng.setEndAfter(containerBlock); - var fragment = tmpRng.extractContents(); - if (newBlockName === 'LI' && hasFirstChild(fragment, 'LI')) { - newBlock = fragment.firstChild; - dom.insertAfter(fragment, containerBlock); - } else { - dom.insertAfter(fragment, containerBlock); - dom.insertAfter(newBlock, containerBlock); - } + containerBlock.parentNode.insertBefore(newBlock, containerBlock); + } + } else if (isFirstOrLastLi(containerBlock, parentBlock, false)) { + dom.insertAfter(newBlock, getContainerBlock(containerBlock)); + } else { + containerBlock = getContainerBlock(containerBlock); + var tmpRng = rng.cloneRange(); + tmpRng.setStartAfter(parentBlock); + tmpRng.setEndAfter(containerBlock); + var fragment = tmpRng.extractContents(); + if (newBlockName === 'LI' && hasFirstChild(fragment, 'LI')) { + newBlock = fragment.firstChild; + dom.insertAfter(fragment, containerBlock); + } else { + dom.insertAfter(fragment, containerBlock); + dom.insertAfter(newBlock, containerBlock); } - dom.remove(parentBlock); - moveToCaretPosition(editor, newBlock); + } + dom.remove(parentBlock); + moveToCaretPosition(editor, newBlock); }; var trimZwsp = function (fragment) { - each(descendants(SugarElement.fromDom(fragment), isText), function (text) { - var rawNode = text.dom; - rawNode.nodeValue = trim$2(rawNode.nodeValue); - }); + each(descendants(SugarElement.fromDom(fragment), isText), function (text) { + var rawNode = text.dom; + rawNode.nodeValue = trim$2(rawNode.nodeValue); + }); }; var isEmptyAnchor = function (dom, elm) { - return elm && elm.nodeName === 'A' && dom.isEmpty(elm); + return elm && elm.nodeName === 'A' && dom.isEmpty(elm); }; var isTableCell$5 = function (node) { - return node && /^(TD|TH|CAPTION)$/.test(node.nodeName); + return node && /^(TD|TH|CAPTION)$/.test(node.nodeName); }; var emptyBlock = function (elm) { - elm.innerHTML = '
              '; + elm.innerHTML = '
              '; }; var containerAndSiblingName = function (container, nodeName) { - return container.nodeName === nodeName || container.previousSibling && container.previousSibling.nodeName === nodeName; + return container.nodeName === nodeName || container.previousSibling && container.previousSibling.nodeName === nodeName; }; var canSplitBlock = function (dom, node) { - return node && dom.isBlock(node) && !/^(TD|TH|CAPTION|FORM)$/.test(node.nodeName) && !/^(fixed|absolute)/i.test(node.style.position) && dom.getContentEditable(node) !== 'true'; + return node && dom.isBlock(node) && !/^(TD|TH|CAPTION|FORM)$/.test(node.nodeName) && !/^(fixed|absolute)/i.test(node.style.position) && dom.getContentEditable(node) !== 'true'; }; var trimInlineElementsOnLeftSideOfBlock = function (dom, nonEmptyElementsMap, block) { - var node = block; - var firstChilds = []; - var i; - if (!node) { - return; - } - while (node = node.firstChild) { - if (dom.isBlock(node)) { - return; - } - if (isElement$1(node) && !nonEmptyElementsMap[node.nodeName.toLowerCase()]) { - firstChilds.push(node); - } - } - i = firstChilds.length; - while (i--) { - node = firstChilds[i]; - if (!node.hasChildNodes() || node.firstChild === node.lastChild && node.firstChild.nodeValue === '') { - dom.remove(node); - } else { - if (isEmptyAnchor(dom, node)) { - dom.remove(node); - } - } + var node = block; + var firstChilds = []; + var i; + if (!node) { + return; + } + while (node = node.firstChild) { + if (dom.isBlock(node)) { + return; + } + if (isElement$1(node) && !nonEmptyElementsMap[node.nodeName.toLowerCase()]) { + firstChilds.push(node); + } + } + i = firstChilds.length; + while (i--) { + node = firstChilds[i]; + if (!node.hasChildNodes() || node.firstChild === node.lastChild && node.firstChild.nodeValue === '') { + dom.remove(node); + } else { + if (isEmptyAnchor(dom, node)) { + dom.remove(node); + } } + } }; var normalizeZwspOffset = function (start, container, offset) { - if (isText$1(container) === false) { - return offset; - } else if (start) { - return offset === 1 && container.data.charAt(offset - 1) === ZWSP ? 0 : offset; - } else { - return offset === container.data.length - 1 && container.data.charAt(offset) === ZWSP ? container.data.length : offset; - } + if (isText$1(container) === false) { + return offset; + } else if (start) { + return offset === 1 && container.data.charAt(offset - 1) === ZWSP ? 0 : offset; + } else { + return offset === container.data.length - 1 && container.data.charAt(offset) === ZWSP ? container.data.length : offset; + } }; var includeZwspInRange = function (rng) { - var newRng = rng.cloneRange(); - newRng.setStart(rng.startContainer, normalizeZwspOffset(true, rng.startContainer, rng.startOffset)); - newRng.setEnd(rng.endContainer, normalizeZwspOffset(false, rng.endContainer, rng.endOffset)); - return newRng; + var newRng = rng.cloneRange(); + newRng.setStart(rng.startContainer, normalizeZwspOffset(true, rng.startContainer, rng.startOffset)); + newRng.setEnd(rng.endContainer, normalizeZwspOffset(false, rng.endContainer, rng.endOffset)); + return newRng; }; var trimLeadingLineBreaks = function (node) { - do { - if (isText$1(node)) { - node.nodeValue = node.nodeValue.replace(/^[\r\n]+/, ''); - } - node = node.firstChild; - } while (node); + do { + if (isText$1(node)) { + node.nodeValue = node.nodeValue.replace(/^[\r\n]+/, ''); + } + node = node.firstChild; + } while (node); }; var getEditableRoot$1 = function (dom, node) { - var root = dom.getRoot(); - var parent, editableRoot; - parent = node; - while (parent !== root && dom.getContentEditable(parent) !== 'false') { - if (dom.getContentEditable(parent) === 'true') { - editableRoot = parent; - } - parent = parent.parentNode; + var root = dom.getRoot(); + var parent, editableRoot; + parent = node; + while (parent !== root && dom.getContentEditable(parent) !== 'false') { + if (dom.getContentEditable(parent) === 'true') { + editableRoot = parent; } - return parent !== root ? editableRoot : root; + parent = parent.parentNode; + } + return parent !== root ? editableRoot : root; }; var applyAttributes = function (editor, node, forcedRootBlockAttrs) { - var dom = editor.dom; - Optional.from(forcedRootBlockAttrs.style).map(dom.parseStyle).each(function (attrStyles) { - var currentStyles = getAllRaw(SugarElement.fromDom(node)); - var newStyles = __assign(__assign({}, currentStyles), attrStyles); - dom.setStyles(node, newStyles); - }); - var attrClassesOpt = Optional.from(forcedRootBlockAttrs.class).map(function (attrClasses) { - return attrClasses.split(/\s+/); - }); - var currentClassesOpt = Optional.from(node.className).map(function (currentClasses) { - return filter(currentClasses.split(/\s+/), function (clazz) { - return clazz !== ''; - }); - }); - lift2(attrClassesOpt, currentClassesOpt, function (attrClasses, currentClasses) { - var filteredClasses = filter(currentClasses, function (clazz) { - return !contains(attrClasses, clazz); - }); - var newClasses = __spreadArrays(attrClasses, filteredClasses); - dom.setAttrib(node, 'class', newClasses.join(' ')); - }); - var appliedAttrs = [ - 'style', - 'class' - ]; - var remainingAttrs = filter$1(forcedRootBlockAttrs, function (_, attrs) { - return !contains(appliedAttrs, attrs); - }); - dom.setAttribs(node, remainingAttrs); + var dom = editor.dom; + Optional.from(forcedRootBlockAttrs.style).map(dom.parseStyle).each(function (attrStyles) { + var currentStyles = getAllRaw(SugarElement.fromDom(node)); + var newStyles = __assign(__assign({}, currentStyles), attrStyles); + dom.setStyles(node, newStyles); + }); + var attrClassesOpt = Optional.from(forcedRootBlockAttrs.class).map(function (attrClasses) { + return attrClasses.split(/\s+/); + }); + var currentClassesOpt = Optional.from(node.className).map(function (currentClasses) { + return filter(currentClasses.split(/\s+/), function (clazz) { + return clazz !== ''; + }); + }); + lift2(attrClassesOpt, currentClassesOpt, function (attrClasses, currentClasses) { + var filteredClasses = filter(currentClasses, function (clazz) { + return !contains(attrClasses, clazz); + }); + var newClasses = __spreadArrays(attrClasses, filteredClasses); + dom.setAttrib(node, 'class', newClasses.join(' ')); + }); + var appliedAttrs = [ + 'style', + 'class' + ]; + var remainingAttrs = filter$1(forcedRootBlockAttrs, function (_, attrs) { + return !contains(appliedAttrs, attrs); + }); + dom.setAttribs(node, remainingAttrs); }; var setForcedBlockAttrs = function (editor, node) { - var forcedRootBlockName = getForcedRootBlock(editor); - if (forcedRootBlockName && forcedRootBlockName.toLowerCase() === node.tagName.toLowerCase()) { - var forcedRootBlockAttrs = getForcedRootBlockAttrs(editor); - applyAttributes(editor, node, forcedRootBlockAttrs); - } + var forcedRootBlockName = getForcedRootBlock(editor); + if (forcedRootBlockName && forcedRootBlockName.toLowerCase() === node.tagName.toLowerCase()) { + var forcedRootBlockAttrs = getForcedRootBlockAttrs(editor); + applyAttributes(editor, node, forcedRootBlockAttrs); + } }; var wrapSelfAndSiblingsInDefaultBlock = function (editor, newBlockName, rng, container, offset) { - var newBlock, parentBlock, startNode, node, next, rootBlockName; - var blockName = newBlockName || 'P'; - var dom = editor.dom, editableRoot = getEditableRoot$1(dom, container); - parentBlock = dom.getParent(container, dom.isBlock); - if (!parentBlock || !canSplitBlock(dom, parentBlock)) { - parentBlock = parentBlock || editableRoot; - if (parentBlock === editor.getBody() || isTableCell$5(parentBlock)) { - rootBlockName = parentBlock.nodeName.toLowerCase(); - } else { - rootBlockName = parentBlock.parentNode.nodeName.toLowerCase(); - } - if (!parentBlock.hasChildNodes()) { - newBlock = dom.create(blockName); - setForcedBlockAttrs(editor, newBlock); - parentBlock.appendChild(newBlock); - rng.setStart(newBlock, 0); - rng.setEnd(newBlock, 0); - return newBlock; - } - node = container; - while (node.parentNode !== parentBlock) { - node = node.parentNode; - } - while (node && !dom.isBlock(node)) { - startNode = node; - node = node.previousSibling; - } - if (startNode && editor.schema.isValidChild(rootBlockName, blockName.toLowerCase())) { - newBlock = dom.create(blockName); - setForcedBlockAttrs(editor, newBlock); - startNode.parentNode.insertBefore(newBlock, startNode); - node = startNode; - while (node && !dom.isBlock(node)) { - next = node.nextSibling; - newBlock.appendChild(node); - node = next; - } - rng.setStart(container, offset); - rng.setEnd(container, offset); - } + var newBlock, parentBlock, startNode, node, next, rootBlockName; + var blockName = newBlockName || 'P'; + var dom = editor.dom, editableRoot = getEditableRoot$1(dom, container); + parentBlock = dom.getParent(container, dom.isBlock); + if (!parentBlock || !canSplitBlock(dom, parentBlock)) { + parentBlock = parentBlock || editableRoot; + if (parentBlock === editor.getBody() || isTableCell$5(parentBlock)) { + rootBlockName = parentBlock.nodeName.toLowerCase(); + } else { + rootBlockName = parentBlock.parentNode.nodeName.toLowerCase(); } - return container; + if (!parentBlock.hasChildNodes()) { + newBlock = dom.create(blockName); + setForcedBlockAttrs(editor, newBlock); + parentBlock.appendChild(newBlock); + rng.setStart(newBlock, 0); + rng.setEnd(newBlock, 0); + return newBlock; + } + node = container; + while (node.parentNode !== parentBlock) { + node = node.parentNode; + } + while (node && !dom.isBlock(node)) { + startNode = node; + node = node.previousSibling; + } + if (startNode && editor.schema.isValidChild(rootBlockName, blockName.toLowerCase())) { + newBlock = dom.create(blockName); + setForcedBlockAttrs(editor, newBlock); + startNode.parentNode.insertBefore(newBlock, startNode); + node = startNode; + while (node && !dom.isBlock(node)) { + next = node.nextSibling; + newBlock.appendChild(node); + node = next; + } + rng.setStart(container, offset); + rng.setEnd(container, offset); + } + } + return container; }; var addBrToBlockIfNeeded = function (dom, block) { - block.normalize(); - var lastChild = block.lastChild; - if (!lastChild || /^(left|right)$/gi.test(dom.getStyle(lastChild, 'float', true))) { - dom.add(block, 'br'); - } + block.normalize(); + var lastChild = block.lastChild; + if (!lastChild || /^(left|right)$/gi.test(dom.getStyle(lastChild, 'float', true))) { + dom.add(block, 'br'); + } }; var insert$1 = function (editor, evt) { - var tmpRng, container, offset, parentBlock; - var newBlock, fragment, containerBlock, parentBlockName, newBlockName, isAfterLastNodeInContainer; - var dom = editor.dom; - var schema = editor.schema, nonEmptyElementsMap = schema.getNonEmptyElements(); - var rng = editor.selection.getRng(); - var createNewBlock = function (name) { - var node = container, block, clonedNode, caretNode; - var textInlineElements = schema.getTextInlineElements(); - if (name || parentBlockName === 'TABLE' || parentBlockName === 'HR') { - block = dom.create(name || newBlockName); - } else { - block = parentBlock.cloneNode(false); - } - caretNode = block; - if (shouldKeepStyles(editor) === false) { - dom.setAttrib(block, 'style', null); - dom.setAttrib(block, 'class', null); - } else { - do { - if (textInlineElements[node.nodeName]) { - if (isCaretNode(node) || isBookmarkNode$1(node)) { - continue; - } - clonedNode = node.cloneNode(false); - dom.setAttrib(clonedNode, 'id', ''); - if (block.hasChildNodes()) { - clonedNode.appendChild(block.firstChild); - block.appendChild(clonedNode); - } else { - caretNode = clonedNode; - block.appendChild(clonedNode); - } - } - } while ((node = node.parentNode) && node !== editableRoot); - } - setForcedBlockAttrs(editor, block); - emptyBlock(caretNode); - return block; - }; - var isCaretAtStartOrEndOfBlock = function (start) { - var node, name; - var normalizedOffset = normalizeZwspOffset(start, container, offset); - if (isText$1(container) && (start ? normalizedOffset > 0 : normalizedOffset < container.nodeValue.length)) { - return false; - } - if (container.parentNode === parentBlock && isAfterLastNodeInContainer && !start) { - return true; - } - if (start && isElement$1(container) && container === parentBlock.firstChild) { - return true; - } - if (containerAndSiblingName(container, 'TABLE') || containerAndSiblingName(container, 'HR')) { - return isAfterLastNodeInContainer && !start || !isAfterLastNodeInContainer && start; - } - var walker = new DomTreeWalker(container, parentBlock); - if (isText$1(container)) { - if (start && normalizedOffset === 0) { - walker.prev(); - } else if (!start && normalizedOffset === container.nodeValue.length) { - walker.next(); - } - } - while (node = walker.current()) { - if (isElement$1(node)) { - if (!node.getAttribute('data-mce-bogus')) { - name = node.nodeName.toLowerCase(); - if (nonEmptyElementsMap[name] && name !== 'br') { - return false; - } - } - } else if (isText$1(node) && !isWhitespaceText(node.nodeValue)) { - return false; - } - if (start) { - walker.prev(); - } else { - walker.next(); - } - } - return true; - }; - var insertNewBlockAfter = function () { - if (/^(H[1-6]|PRE|FIGURE)$/.test(parentBlockName) && containerBlockName !== 'HGROUP') { - newBlock = createNewBlock(newBlockName); - } else { - newBlock = createNewBlock(); - } - if (shouldEndContainerOnEmptyBlock(editor) && canSplitBlock(dom, containerBlock) && dom.isEmpty(parentBlock)) { - newBlock = dom.split(containerBlock, parentBlock); - } else { - dom.insertAfter(newBlock, parentBlock); - } - moveToCaretPosition(editor, newBlock); - }; - normalize(dom, rng).each(function (normRng) { - rng.setStart(normRng.startContainer, normRng.startOffset); - rng.setEnd(normRng.endContainer, normRng.endOffset); - }); - container = rng.startContainer; - offset = rng.startOffset; - newBlockName = getForcedRootBlock(editor); - var shiftKey = !!(evt && evt.shiftKey); - var ctrlKey = !!(evt && evt.ctrlKey); - if (isElement$1(container) && container.hasChildNodes()) { - isAfterLastNodeInContainer = offset > container.childNodes.length - 1; - container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container; - if (isAfterLastNodeInContainer && isText$1(container)) { - offset = container.nodeValue.length; - } else { - offset = 0; - } + var tmpRng, container, offset, parentBlock; + var newBlock, fragment, containerBlock, parentBlockName, newBlockName, isAfterLastNodeInContainer; + var dom = editor.dom; + var schema = editor.schema, nonEmptyElementsMap = schema.getNonEmptyElements(); + var rng = editor.selection.getRng(); + var createNewBlock = function (name) { + var node = container, block, clonedNode, caretNode; + var textInlineElements = schema.getTextInlineElements(); + if (name || parentBlockName === 'TABLE' || parentBlockName === 'HR') { + block = dom.create(name || newBlockName); + } else { + block = parentBlock.cloneNode(false); } - var editableRoot = getEditableRoot$1(dom, container); - if (!editableRoot) { - return; + caretNode = block; + if (shouldKeepStyles(editor) === false) { + dom.setAttrib(block, 'style', null); + dom.setAttrib(block, 'class', null); + } else { + do { + if (textInlineElements[node.nodeName]) { + if (isCaretNode(node) || isBookmarkNode$1(node)) { + continue; + } + clonedNode = node.cloneNode(false); + dom.setAttrib(clonedNode, 'id', ''); + if (block.hasChildNodes()) { + clonedNode.appendChild(block.firstChild); + block.appendChild(clonedNode); + } else { + caretNode = clonedNode; + block.appendChild(clonedNode); + } + } + } while ((node = node.parentNode) && node !== editableRoot); + } + setForcedBlockAttrs(editor, block); + emptyBlock(caretNode); + return block; + }; + var isCaretAtStartOrEndOfBlock = function (start) { + var node, name; + var normalizedOffset = normalizeZwspOffset(start, container, offset); + if (isText$1(container) && (start ? normalizedOffset > 0 : normalizedOffset < container.nodeValue.length)) { + return false; + } + if (container.parentNode === parentBlock && isAfterLastNodeInContainer && !start) { + return true; + } + if (start && isElement$1(container) && container === parentBlock.firstChild) { + return true; + } + if (containerAndSiblingName(container, 'TABLE') || containerAndSiblingName(container, 'HR')) { + return isAfterLastNodeInContainer && !start || !isAfterLastNodeInContainer && start; } - if (newBlockName && !shiftKey || !newBlockName && shiftKey) { - container = wrapSelfAndSiblingsInDefaultBlock(editor, newBlockName, rng, container, offset); - } - parentBlock = dom.getParent(container, dom.isBlock); - containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null; - parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : ''; - var containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; - if (containerBlockName === 'LI' && !ctrlKey) { - parentBlock = containerBlock; - containerBlock = containerBlock.parentNode; - parentBlockName = containerBlockName; - } - if (/^(LI|DT|DD)$/.test(parentBlockName)) { - if (dom.isEmpty(parentBlock)) { - insert(editor, createNewBlock, containerBlock, parentBlock, newBlockName); - return; + var walker = new DomTreeWalker(container, parentBlock); + if (isText$1(container)) { + if (start && normalizedOffset === 0) { + walker.prev(); + } else if (!start && normalizedOffset === container.nodeValue.length) { + walker.next(); + } + } + while (node = walker.current()) { + if (isElement$1(node)) { + if (!node.getAttribute('data-mce-bogus')) { + name = node.nodeName.toLowerCase(); + if (nonEmptyElementsMap[name] && name !== 'br') { + return false; + } } + } else if (isText$1(node) && !isWhitespaceText(node.nodeValue)) { + return false; + } + if (start) { + walker.prev(); + } else { + walker.next(); + } } - if (newBlockName && parentBlock === editor.getBody()) { - return; + return true; + }; + var insertNewBlockAfter = function () { + if (/^(H[1-6]|PRE|FIGURE)$/.test(parentBlockName) && containerBlockName !== 'HGROUP') { + newBlock = createNewBlock(newBlockName); + } else { + newBlock = createNewBlock(); } - newBlockName = newBlockName || 'P'; - if (isCaretContainerBlock(parentBlock)) { - newBlock = showCaretContainerBlock(parentBlock); - if (dom.isEmpty(parentBlock)) { - emptyBlock(parentBlock); - } - setForcedBlockAttrs(editor, newBlock); - moveToCaretPosition(editor, newBlock); - } else if (isCaretAtStartOrEndOfBlock()) { - insertNewBlockAfter(); - } else if (isCaretAtStartOrEndOfBlock(true)) { - newBlock = parentBlock.parentNode.insertBefore(createNewBlock(), parentBlock); - moveToCaretPosition(editor, containerAndSiblingName(parentBlock, 'HR') ? newBlock : parentBlock); + if (shouldEndContainerOnEmptyBlock(editor) && canSplitBlock(dom, containerBlock) && dom.isEmpty(parentBlock)) { + newBlock = dom.split(containerBlock, parentBlock); } else { - tmpRng = includeZwspInRange(rng).cloneRange(); - tmpRng.setEndAfter(parentBlock); - fragment = tmpRng.extractContents(); - trimZwsp(fragment); - trimLeadingLineBreaks(fragment); - newBlock = fragment.firstChild; - dom.insertAfter(fragment, parentBlock); - trimInlineElementsOnLeftSideOfBlock(dom, nonEmptyElementsMap, newBlock); - addBrToBlockIfNeeded(dom, parentBlock); - if (dom.isEmpty(parentBlock)) { - emptyBlock(parentBlock); - } - newBlock.normalize(); - if (dom.isEmpty(newBlock)) { - dom.remove(newBlock); - insertNewBlockAfter(); - } else { - setForcedBlockAttrs(editor, newBlock); - moveToCaretPosition(editor, newBlock); - } + dom.insertAfter(newBlock, parentBlock); + } + moveToCaretPosition(editor, newBlock); + }; + normalize(dom, rng).each(function (normRng) { + rng.setStart(normRng.startContainer, normRng.startOffset); + rng.setEnd(normRng.endContainer, normRng.endOffset); + }); + container = rng.startContainer; + offset = rng.startOffset; + newBlockName = getForcedRootBlock(editor); + var shiftKey = !!(evt && evt.shiftKey); + var ctrlKey = !!(evt && evt.ctrlKey); + if (isElement$1(container) && container.hasChildNodes()) { + isAfterLastNodeInContainer = offset > container.childNodes.length - 1; + container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container; + if (isAfterLastNodeInContainer && isText$1(container)) { + offset = container.nodeValue.length; + } else { + offset = 0; + } + } + var editableRoot = getEditableRoot$1(dom, container); + if (!editableRoot) { + return; + } + if (newBlockName && !shiftKey || !newBlockName && shiftKey) { + container = wrapSelfAndSiblingsInDefaultBlock(editor, newBlockName, rng, container, offset); + } + parentBlock = dom.getParent(container, dom.isBlock); + containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null; + parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : ''; + var containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; + if (containerBlockName === 'LI' && !ctrlKey) { + parentBlock = containerBlock; + containerBlock = containerBlock.parentNode; + parentBlockName = containerBlockName; + } + if (/^(LI|DT|DD)$/.test(parentBlockName)) { + if (dom.isEmpty(parentBlock)) { + insert(editor, createNewBlock, containerBlock, parentBlock, newBlockName); + return; + } + } + if (newBlockName && parentBlock === editor.getBody()) { + return; + } + newBlockName = newBlockName || 'P'; + if (isCaretContainerBlock(parentBlock)) { + newBlock = showCaretContainerBlock(parentBlock); + if (dom.isEmpty(parentBlock)) { + emptyBlock(parentBlock); + } + setForcedBlockAttrs(editor, newBlock); + moveToCaretPosition(editor, newBlock); + } else if (isCaretAtStartOrEndOfBlock()) { + insertNewBlockAfter(); + } else if (isCaretAtStartOrEndOfBlock(true)) { + newBlock = parentBlock.parentNode.insertBefore(createNewBlock(), parentBlock); + moveToCaretPosition(editor, containerAndSiblingName(parentBlock, 'HR') ? newBlock : parentBlock); + } else { + tmpRng = includeZwspInRange(rng).cloneRange(); + tmpRng.setEndAfter(parentBlock); + fragment = tmpRng.extractContents(); + trimZwsp(fragment); + trimLeadingLineBreaks(fragment); + newBlock = fragment.firstChild; + dom.insertAfter(fragment, parentBlock); + trimInlineElementsOnLeftSideOfBlock(dom, nonEmptyElementsMap, newBlock); + addBrToBlockIfNeeded(dom, parentBlock); + if (dom.isEmpty(parentBlock)) { + emptyBlock(parentBlock); + } + newBlock.normalize(); + if (dom.isEmpty(newBlock)) { + dom.remove(newBlock); + insertNewBlockAfter(); + } else { + setForcedBlockAttrs(editor, newBlock); + moveToCaretPosition(editor, newBlock); } - dom.setAttrib(newBlock, 'id', ''); - editor.fire('NewBlock', {newBlock: newBlock}); + } + dom.setAttrib(newBlock, 'id', ''); + editor.fire('NewBlock', { newBlock: newBlock }); }; var hasRightSideContent = function (schema, container, parentBlock) { - var walker = new DomTreeWalker(container, parentBlock); - var node; - var nonEmptyElementsMap = schema.getNonEmptyElements(); - while (node = walker.next()) { - if (nonEmptyElementsMap[node.nodeName.toLowerCase()] || node.length > 0) { - return true; - } + var walker = new DomTreeWalker(container, parentBlock); + var node; + var nonEmptyElementsMap = schema.getNonEmptyElements(); + while (node = walker.next()) { + if (nonEmptyElementsMap[node.nodeName.toLowerCase()] || node.length > 0) { + return true; } + } }; var scrollToBr = function (dom, selection, brElm) { - var marker = dom.create('span', {}, ' '); - brElm.parentNode.insertBefore(marker, brElm); - selection.scrollIntoView(marker); - dom.remove(marker); + var marker = dom.create('span', {}, ' '); + brElm.parentNode.insertBefore(marker, brElm); + selection.scrollIntoView(marker); + dom.remove(marker); }; var moveSelectionToBr = function (dom, selection, brElm, extraBr) { - var rng = dom.createRng(); - if (!extraBr) { - rng.setStartAfter(brElm); - rng.setEndAfter(brElm); - } else { - rng.setStartBefore(brElm); - rng.setEndBefore(brElm); - } - selection.setRng(rng); + var rng = dom.createRng(); + if (!extraBr) { + rng.setStartAfter(brElm); + rng.setEndAfter(brElm); + } else { + rng.setStartBefore(brElm); + rng.setEndBefore(brElm); + } + selection.setRng(rng); }; var insertBrAtCaret = function (editor, evt) { - var selection = editor.selection; - var dom = editor.dom; - var rng = selection.getRng(); - var brElm; - var extraBr; - normalize(dom, rng).each(function (normRng) { - rng.setStart(normRng.startContainer, normRng.startOffset); - rng.setEnd(normRng.endContainer, normRng.endOffset); - }); - var offset = rng.startOffset; - var container = rng.startContainer; - if (container.nodeType === 1 && container.hasChildNodes()) { - var isAfterLastNodeInContainer = offset > container.childNodes.length - 1; - container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container; - if (isAfterLastNodeInContainer && container.nodeType === 3) { - offset = container.nodeValue.length; - } else { - offset = 0; - } - } - var parentBlock = dom.getParent(container, dom.isBlock); - var containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null; - var containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; - var isControlKey = !!(evt && evt.ctrlKey); - if (containerBlockName === 'LI' && !isControlKey) { - parentBlock = containerBlock; - } - if (container && container.nodeType === 3 && offset >= container.nodeValue.length) { - if (!hasRightSideContent(editor.schema, container, parentBlock)) { - brElm = dom.create('br'); - rng.insertNode(brElm); - rng.setStartAfter(brElm); - rng.setEndAfter(brElm); - extraBr = true; - } - } - brElm = dom.create('br'); - rangeInsertNode(dom, rng, brElm); - scrollToBr(dom, selection, brElm); - moveSelectionToBr(dom, selection, brElm, extraBr); - editor.undoManager.add(); + var selection = editor.selection; + var dom = editor.dom; + var rng = selection.getRng(); + var brElm; + var extraBr; + normalize(dom, rng).each(function (normRng) { + rng.setStart(normRng.startContainer, normRng.startOffset); + rng.setEnd(normRng.endContainer, normRng.endOffset); + }); + var offset = rng.startOffset; + var container = rng.startContainer; + if (container.nodeType === 1 && container.hasChildNodes()) { + var isAfterLastNodeInContainer = offset > container.childNodes.length - 1; + container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container; + if (isAfterLastNodeInContainer && container.nodeType === 3) { + offset = container.nodeValue.length; + } else { + offset = 0; + } + } + var parentBlock = dom.getParent(container, dom.isBlock); + var containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null; + var containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; + var isControlKey = !!(evt && evt.ctrlKey); + if (containerBlockName === 'LI' && !isControlKey) { + parentBlock = containerBlock; + } + if (container && container.nodeType === 3 && offset >= container.nodeValue.length) { + if (!hasRightSideContent(editor.schema, container, parentBlock)) { + brElm = dom.create('br'); + rng.insertNode(brElm); + rng.setStartAfter(brElm); + rng.setEndAfter(brElm); + extraBr = true; + } + } + brElm = dom.create('br'); + rangeInsertNode(dom, rng, brElm); + scrollToBr(dom, selection, brElm); + moveSelectionToBr(dom, selection, brElm, extraBr); + editor.undoManager.add(); }; var insertBrBefore = function (editor, inline) { - var br = SugarElement.fromTag('br'); - before(SugarElement.fromDom(inline), br); - editor.undoManager.add(); + var br = SugarElement.fromTag('br'); + before(SugarElement.fromDom(inline), br); + editor.undoManager.add(); }; var insertBrAfter = function (editor, inline) { - if (!hasBrAfter(editor.getBody(), inline)) { - after(SugarElement.fromDom(inline), SugarElement.fromTag('br')); - } - var br = SugarElement.fromTag('br'); - after(SugarElement.fromDom(inline), br); - scrollToBr(editor.dom, editor.selection, br.dom); - moveSelectionToBr(editor.dom, editor.selection, br.dom, false); - editor.undoManager.add(); + if (!hasBrAfter(editor.getBody(), inline)) { + after(SugarElement.fromDom(inline), SugarElement.fromTag('br')); + } + var br = SugarElement.fromTag('br'); + after(SugarElement.fromDom(inline), br); + scrollToBr(editor.dom, editor.selection, br.dom); + moveSelectionToBr(editor.dom, editor.selection, br.dom, false); + editor.undoManager.add(); }; var isBeforeBr$1 = function (pos) { - return isBr(pos.getNode()); + return isBr(pos.getNode()); }; var hasBrAfter = function (rootNode, startNode) { - if (isBeforeBr$1(CaretPosition$1.after(startNode))) { - return true; - } else { - return nextPosition(rootNode, CaretPosition$1.after(startNode)).map(function (pos) { - return isBr(pos.getNode()); - }).getOr(false); - } + if (isBeforeBr$1(CaretPosition$1.after(startNode))) { + return true; + } else { + return nextPosition(rootNode, CaretPosition$1.after(startNode)).map(function (pos) { + return isBr(pos.getNode()); + }).getOr(false); + } }; var isAnchorLink = function (elm) { - return elm && elm.nodeName === 'A' && 'href' in elm; + return elm && elm.nodeName === 'A' && 'href' in elm; }; var isInsideAnchor = function (location) { - return location.fold(never, isAnchorLink, isAnchorLink, never); + return location.fold(never, isAnchorLink, isAnchorLink, never); }; var readInlineAnchorLocation = function (editor) { - var isInlineTarget$1 = curry(isInlineTarget, editor); - var position = CaretPosition$1.fromRangeStart(editor.selection.getRng()); - return readLocation(isInlineTarget$1, editor.getBody(), position).filter(isInsideAnchor); + var isInlineTarget$1 = curry(isInlineTarget, editor); + var position = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + return readLocation(isInlineTarget$1, editor.getBody(), position).filter(isInsideAnchor); }; var insertBrOutsideAnchor = function (editor, location) { - location.fold(noop, curry(insertBrBefore, editor), curry(insertBrAfter, editor), noop); + location.fold(noop, curry(insertBrBefore, editor), curry(insertBrAfter, editor), noop); }; var insert$2 = function (editor, evt) { - var anchorLocation = readInlineAnchorLocation(editor); - if (anchorLocation.isSome()) { - anchorLocation.each(curry(insertBrOutsideAnchor, editor)); - } else { - insertBrAtCaret(editor, evt); - } + var anchorLocation = readInlineAnchorLocation(editor); + if (anchorLocation.isSome()) { + anchorLocation.each(curry(insertBrOutsideAnchor, editor)); + } else { + insertBrAtCaret(editor, evt); + } }; var matchesSelector = function (editor, selector) { - return getParentBlock$2(editor).filter(function (parentBlock) { - return selector.length > 0 && is$1(SugarElement.fromDom(parentBlock), selector); - }).isSome(); + return getParentBlock$2(editor).filter(function (parentBlock) { + return selector.length > 0 && is$1(SugarElement.fromDom(parentBlock), selector); + }).isSome(); }; var shouldInsertBr = function (editor) { - return matchesSelector(editor, getBrNewLineSelector(editor)); + return matchesSelector(editor, getBrNewLineSelector(editor)); }; var shouldBlockNewLine = function (editor) { - return matchesSelector(editor, getNoNewLineSelector(editor)); + return matchesSelector(editor, getNoNewLineSelector(editor)); }; var newLineAction = Adt.generate([ - {br: []}, - {block: []}, - {none: []} + { br: [] }, + { block: [] }, + { none: [] } ]); var shouldBlockNewLine$1 = function (editor, _shiftKey) { - return shouldBlockNewLine(editor); + return shouldBlockNewLine(editor); }; var isBrMode = function (requiredState) { - return function (editor, _shiftKey) { - var brMode = getForcedRootBlock(editor) === ''; - return brMode === requiredState; - }; + return function (editor, _shiftKey) { + var brMode = getForcedRootBlock(editor) === ''; + return brMode === requiredState; + }; }; var inListBlock = function (requiredState) { - return function (editor, _shiftKey) { - return isListItemParentBlock(editor) === requiredState; - }; + return function (editor, _shiftKey) { + return isListItemParentBlock(editor) === requiredState; + }; }; var inBlock = function (blockName, requiredState) { - return function (editor, _shiftKey) { - var state = getParentBlockName(editor) === blockName.toUpperCase(); - return state === requiredState; - }; + return function (editor, _shiftKey) { + var state = getParentBlockName(editor) === blockName.toUpperCase(); + return state === requiredState; + }; }; var inPreBlock = function (requiredState) { - return inBlock('pre', requiredState); + return inBlock('pre', requiredState); }; var inSummaryBlock = function () { - return inBlock('summary', true); + return inBlock('summary', true); }; var shouldPutBrInPre$1 = function (requiredState) { - return function (editor, _shiftKey) { - return shouldPutBrInPre(editor) === requiredState; - }; + return function (editor, _shiftKey) { + return shouldPutBrInPre(editor) === requiredState; + }; }; var inBrContext = function (editor, _shiftKey) { - return shouldInsertBr(editor); + return shouldInsertBr(editor); }; var hasShiftKey = function (_editor, shiftKey) { - return shiftKey; + return shiftKey; }; var canInsertIntoEditableRoot = function (editor) { - var forcedRootBlock = getForcedRootBlock(editor); - var rootEditable = getEditableRoot(editor.dom, editor.selection.getStart()); - return rootEditable && editor.schema.isValidChild(rootEditable.nodeName, forcedRootBlock ? forcedRootBlock : 'P'); + var forcedRootBlock = getForcedRootBlock(editor); + var rootEditable = getEditableRoot(editor.dom, editor.selection.getStart()); + return rootEditable && editor.schema.isValidChild(rootEditable.nodeName, forcedRootBlock ? forcedRootBlock : 'P'); }; var match$2 = function (predicates, action) { - return function (editor, shiftKey) { - var isMatch = foldl(predicates, function (res, p) { - return res && p(editor, shiftKey); - }, true); - return isMatch ? Optional.some(action) : Optional.none(); - }; + return function (editor, shiftKey) { + var isMatch = foldl(predicates, function (res, p) { + return res && p(editor, shiftKey); + }, true); + return isMatch ? Optional.some(action) : Optional.none(); + }; }; var getAction$1 = function (editor, evt) { - return evaluateUntil([ - match$2([shouldBlockNewLine$1], newLineAction.none()), - match$2([inSummaryBlock()], newLineAction.br()), - match$2([ - inPreBlock(true), - shouldPutBrInPre$1(false), - hasShiftKey - ], newLineAction.br()), - match$2([ - inPreBlock(true), - shouldPutBrInPre$1(false) - ], newLineAction.block()), - match$2([ - inPreBlock(true), - shouldPutBrInPre$1(true), - hasShiftKey - ], newLineAction.block()), - match$2([ - inPreBlock(true), - shouldPutBrInPre$1(true) - ], newLineAction.br()), - match$2([ - inListBlock(true), - hasShiftKey - ], newLineAction.br()), - match$2([inListBlock(true)], newLineAction.block()), - match$2([ - isBrMode(true), - hasShiftKey, - canInsertIntoEditableRoot - ], newLineAction.block()), - match$2([isBrMode(true)], newLineAction.br()), - match$2([inBrContext], newLineAction.br()), - match$2([ - isBrMode(false), - hasShiftKey - ], newLineAction.br()), - match$2([canInsertIntoEditableRoot], newLineAction.block()) - ], [ - editor, - !!(evt && evt.shiftKey) - ]).getOr(newLineAction.none()); + return evaluateUntil([ + match$2([shouldBlockNewLine$1], newLineAction.none()), + match$2([inSummaryBlock()], newLineAction.br()), + match$2([ + inPreBlock(true), + shouldPutBrInPre$1(false), + hasShiftKey + ], newLineAction.br()), + match$2([ + inPreBlock(true), + shouldPutBrInPre$1(false) + ], newLineAction.block()), + match$2([ + inPreBlock(true), + shouldPutBrInPre$1(true), + hasShiftKey + ], newLineAction.block()), + match$2([ + inPreBlock(true), + shouldPutBrInPre$1(true) + ], newLineAction.br()), + match$2([ + inListBlock(true), + hasShiftKey + ], newLineAction.br()), + match$2([inListBlock(true)], newLineAction.block()), + match$2([ + isBrMode(true), + hasShiftKey, + canInsertIntoEditableRoot + ], newLineAction.block()), + match$2([isBrMode(true)], newLineAction.br()), + match$2([inBrContext], newLineAction.br()), + match$2([ + isBrMode(false), + hasShiftKey + ], newLineAction.br()), + match$2([canInsertIntoEditableRoot], newLineAction.block()) + ], [ + editor, + !!(evt && evt.shiftKey) + ]).getOr(newLineAction.none()); }; var insert$3 = function (editor, evt) { - getAction$1(editor, evt).fold(function () { - insert$2(editor, evt); - }, function () { - insert$1(editor, evt); - }, noop); + getAction$1(editor, evt).fold(function () { + insert$2(editor, evt); + }, function () { + insert$1(editor, evt); + }, noop); }; var handleEnterKeyEvent = function (editor, event) { - if (event.isDefaultPrevented()) { - return; - } - event.preventDefault(); - endTypingLevelIgnoreLocks(editor.undoManager); - editor.undoManager.transact(function () { - if (editor.selection.isCollapsed() === false) { - editor.execCommand('Delete'); - } - insert$3(editor, event); - }); + if (event.isDefaultPrevented()) { + return; + } + event.preventDefault(); + endTypingLevelIgnoreLocks(editor.undoManager); + editor.undoManager.transact(function () { + if (editor.selection.isCollapsed() === false) { + editor.execCommand('Delete'); + } + insert$3(editor, event); + }); }; var setup$e = function (editor) { - editor.on('keydown', function (event) { - if (event.keyCode === VK.ENTER) { - handleEnterKeyEvent(editor, event); - } - }); + editor.on('keydown', function (event) { + if (event.keyCode === VK.ENTER) { + handleEnterKeyEvent(editor, event); + } + }); }; var executeKeydownOverride$2 = function (editor, evt) { - execute([ - { - keyCode: VK.END, - action: action(moveToLineEndPoint$1, editor, true) - }, - { - keyCode: VK.HOME, - action: action(moveToLineEndPoint$1, editor, false) - }, - { - keyCode: VK.END, - action: action(moveToLineEndPoint$2, editor, true) - }, - { - keyCode: VK.HOME, - action: action(moveToLineEndPoint$2, editor, false) - } - ], evt).each(function (_) { - evt.preventDefault(); - }); + execute([ + { + keyCode: VK.END, + action: action(moveToLineEndPoint$1, editor, true) + }, + { + keyCode: VK.HOME, + action: action(moveToLineEndPoint$1, editor, false) + }, + { + keyCode: VK.END, + action: action(moveToLineEndPoint$2, editor, true) + }, + { + keyCode: VK.HOME, + action: action(moveToLineEndPoint$2, editor, false) + } + ], evt).each(function (_) { + evt.preventDefault(); + }); }; var setup$f = function (editor) { - editor.on('keydown', function (evt) { - if (evt.isDefaultPrevented() === false) { - executeKeydownOverride$2(editor, evt); - } - }); + editor.on('keydown', function (evt) { + if (evt.isDefaultPrevented() === false) { + executeKeydownOverride$2(editor, evt); + } + }); }; var browser$4 = detect$3().browser; var setupIeInput = function (editor) { - var keypressThrotter = first(function () { - if (!editor.composing) { - normalizeNbspsInEditor(editor); - } - }, 0); - if (browser$4.isIE()) { - editor.on('keypress', function (_e) { - keypressThrotter.throttle(); - }); - editor.on('remove', function (_e) { - keypressThrotter.cancel(); - }); + var keypressThrotter = first(function () { + if (!editor.composing) { + normalizeNbspsInEditor(editor); } + }, 0); + if (browser$4.isIE()) { + editor.on('keypress', function (_e) { + keypressThrotter.throttle(); + }); + editor.on('remove', function (_e) { + keypressThrotter.cancel(); + }); + } }; var setup$g = function (editor) { - setupIeInput(editor); - editor.on('input', function (e) { - if (e.isComposing === false) { - normalizeNbspsInEditor(editor); - } - }); + setupIeInput(editor); + editor.on('input', function (e) { + if (e.isComposing === false) { + normalizeNbspsInEditor(editor); + } + }); }; var insertTextAtPosition = function (text, pos) { - var container = pos.container(); - var offset = pos.offset(); - if (isText$1(container)) { - container.insertData(offset, text); - return Optional.some(CaretPosition(container, offset + text.length)); - } else { - return getElementFromPosition(pos).map(function (elm) { - var textNode = SugarElement.fromText(text); - if (pos.isAtEnd()) { - after(elm, textNode); - } else { - before(elm, textNode); - } - return CaretPosition(textNode.dom, text.length); - }); - } + var container = pos.container(); + var offset = pos.offset(); + if (isText$1(container)) { + container.insertData(offset, text); + return Optional.some(CaretPosition(container, offset + text.length)); + } else { + return getElementFromPosition(pos).map(function (elm) { + var textNode = SugarElement.fromText(text); + if (pos.isAtEnd()) { + after(elm, textNode); + } else { + before(elm, textNode); + } + return CaretPosition(textNode.dom, text.length); + }); + } }; var insertNbspAtPosition = curry(insertTextAtPosition, nbsp); var insertSpaceAtPosition = curry(insertTextAtPosition, ' '); var locationToCaretPosition = function (root) { - return function (location) { - return location.fold(function (element) { - return prevPosition(root.dom, CaretPosition$1.before(element)); - }, function (element) { - return firstPositionIn(element); - }, function (element) { - return lastPositionIn(element); - }, function (element) { - return nextPosition(root.dom, CaretPosition$1.after(element)); - }); - }; + return function (location) { + return location.fold(function (element) { + return prevPosition(root.dom, CaretPosition$1.before(element)); + }, function (element) { + return firstPositionIn(element); + }, function (element) { + return lastPositionIn(element); + }, function (element) { + return nextPosition(root.dom, CaretPosition$1.after(element)); + }); + }; }; var insertInlineBoundarySpaceOrNbsp = function (root, pos) { - return function (checkPos) { - return needsToHaveNbsp(root, checkPos) ? insertNbspAtPosition(pos) : insertSpaceAtPosition(pos); - }; + return function (checkPos) { + return needsToHaveNbsp(root, checkPos) ? insertNbspAtPosition(pos) : insertSpaceAtPosition(pos); + }; }; var setSelection$1 = function (editor) { - return function (pos) { - editor.selection.setRng(pos.toRange()); - editor.nodeChanged(); - return true; - }; + return function (pos) { + editor.selection.setRng(pos.toRange()); + editor.nodeChanged(); + return true; + }; }; var insertSpaceOrNbspAtSelection = function (editor) { - var pos = CaretPosition$1.fromRangeStart(editor.selection.getRng()); - var root = SugarElement.fromDom(editor.getBody()); - if (editor.selection.isCollapsed()) { - var isInlineTarget$1 = curry(isInlineTarget, editor); - var caretPosition = CaretPosition$1.fromRangeStart(editor.selection.getRng()); - return readLocation(isInlineTarget$1, editor.getBody(), caretPosition).bind(locationToCaretPosition(root)).bind(insertInlineBoundarySpaceOrNbsp(root, pos)).exists(setSelection$1(editor)); - } else { - return false; - } + var pos = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + var root = SugarElement.fromDom(editor.getBody()); + if (editor.selection.isCollapsed()) { + var isInlineTarget$1 = curry(isInlineTarget, editor); + var caretPosition = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + return readLocation(isInlineTarget$1, editor.getBody(), caretPosition).bind(locationToCaretPosition(root)).bind(insertInlineBoundarySpaceOrNbsp(root, pos)).exists(setSelection$1(editor)); + } else { + return false; + } }; var executeKeydownOverride$3 = function (editor, evt) { - execute([{ - keyCode: VK.SPACEBAR, - action: action(insertSpaceOrNbspAtSelection, editor) + execute([{ + keyCode: VK.SPACEBAR, + action: action(insertSpaceOrNbspAtSelection, editor) }], evt).each(function (_) { - evt.preventDefault(); - }); + evt.preventDefault(); + }); }; var setup$h = function (editor) { - editor.on('keydown', function (evt) { - if (evt.isDefaultPrevented() === false) { - executeKeydownOverride$3(editor, evt); - } - }); + editor.on('keydown', function (evt) { + if (evt.isDefaultPrevented() === false) { + executeKeydownOverride$3(editor, evt); + } + }); }; var registerKeyboardOverrides = function (editor) { - var caret = setupSelectedState(editor); - setup$b(editor); - setup$c(editor, caret); - setup$d(editor, caret); - setup$e(editor); - setup$h(editor); - setup$g(editor); - setup$f(editor); - return caret; + var caret = setupSelectedState(editor); + setup$b(editor); + setup$c(editor, caret); + setup$d(editor, caret); + setup$e(editor); + setup$h(editor); + setup$g(editor); + setup$f(editor); + return caret; }; var setup$i = function (editor) { - if (!isRtc(editor)) { - return registerKeyboardOverrides(editor); - } else { - return Cell(null); - } + if (!isRtc(editor)) { + return registerKeyboardOverrides(editor); + } else { + return Cell(null); + } }; var NodeChange = function () { - function NodeChange(editor) { - this.lastPath = []; - this.editor = editor; - var lastRng; - var self = this; - if (!('onselectionchange' in editor.getDoc())) { - editor.on('NodeChange click mouseup keyup focus', function (e) { - var nativeRng = editor.selection.getRng(); - var fakeRng = { - startContainer: nativeRng.startContainer, - startOffset: nativeRng.startOffset, - endContainer: nativeRng.endContainer, - endOffset: nativeRng.endOffset - }; - if (e.type === 'nodechange' || !isEq$1(fakeRng, lastRng)) { - editor.fire('SelectionChange'); - } - lastRng = fakeRng; - }); + function NodeChange(editor) { + this.lastPath = []; + this.editor = editor; + var lastRng; + var self = this; + if (!('onselectionchange' in editor.getDoc())) { + editor.on('NodeChange click mouseup keyup focus', function (e) { + var nativeRng = editor.selection.getRng(); + var fakeRng = { + startContainer: nativeRng.startContainer, + startOffset: nativeRng.startOffset, + endContainer: nativeRng.endContainer, + endOffset: nativeRng.endOffset + }; + if (e.type === 'nodechange' || !isEq$1(fakeRng, lastRng)) { + editor.fire('SelectionChange'); } - editor.on('contextmenu', function () { - editor.fire('SelectionChange'); - }); - editor.on('SelectionChange', function () { - var startElm = editor.selection.getStart(true); - if (!startElm || !Env.range && editor.selection.isCollapsed()) { - return; - } - if (hasAnyRanges(editor) && !self.isSameElementPath(startElm) && editor.dom.isChildOf(startElm, editor.getBody())) { - editor.nodeChanged({selectionChange: true}); - } - }); - editor.on('mouseup', function (e) { - if (!e.isDefaultPrevented() && hasAnyRanges(editor)) { - if (editor.selection.getNode().nodeName === 'IMG') { - Delay.setEditorTimeout(editor, function () { - editor.nodeChanged(); - }); - } else { - editor.nodeChanged(); - } - } - }); + lastRng = fakeRng; + }); } - - NodeChange.prototype.nodeChanged = function (args) { - var selection = this.editor.selection; - var node, parents, root; - if (this.editor.initialized && selection && !shouldDisableNodeChange(this.editor) && !this.editor.mode.isReadOnly()) { - root = this.editor.getBody(); - node = selection.getStart(true) || root; - if (node.ownerDocument !== this.editor.getDoc() || !this.editor.dom.isChildOf(node, root)) { - node = root; - } - parents = []; - this.editor.dom.getParent(node, function (node) { - if (node === root) { - return true; - } - parents.push(node); - }); - args = args || {}; - args.element = node; - args.parents = parents; - this.editor.fire('NodeChange', args); - } - }; - NodeChange.prototype.isSameElementPath = function (startElm) { - var i; - var currentPath = this.editor.$(startElm).parentsUntil(this.editor.getBody()).add(startElm); - if (currentPath.length === this.lastPath.length) { - for (i = currentPath.length; i >= 0; i--) { - if (currentPath[i] !== this.lastPath[i]) { - break; - } - } - if (i === -1) { - this.lastPath = currentPath; - return true; - } + editor.on('contextmenu', function () { + editor.fire('SelectionChange'); + }); + editor.on('SelectionChange', function () { + var startElm = editor.selection.getStart(true); + if (!startElm || !Env.range && editor.selection.isCollapsed()) { + return; + } + if (hasAnyRanges(editor) && !self.isSameElementPath(startElm) && editor.dom.isChildOf(startElm, editor.getBody())) { + editor.nodeChanged({ selectionChange: true }); + } + }); + editor.on('mouseup', function (e) { + if (!e.isDefaultPrevented() && hasAnyRanges(editor)) { + if (editor.selection.getNode().nodeName === 'IMG') { + Delay.setEditorTimeout(editor, function () { + editor.nodeChanged(); + }); + } else { + editor.nodeChanged(); + } + } + }); + } + NodeChange.prototype.nodeChanged = function (args) { + var selection = this.editor.selection; + var node, parents, root; + if (this.editor.initialized && selection && !shouldDisableNodeChange(this.editor) && !this.editor.mode.isReadOnly()) { + root = this.editor.getBody(); + node = selection.getStart(true) || root; + if (node.ownerDocument !== this.editor.getDoc() || !this.editor.dom.isChildOf(node, root)) { + node = root; + } + parents = []; + this.editor.dom.getParent(node, function (node) { + if (node === root) { + return true; } + parents.push(node); + }); + args = args || {}; + args.element = node; + args.parents = parents; + this.editor.fire('NodeChange', args); + } + }; + NodeChange.prototype.isSameElementPath = function (startElm) { + var i; + var currentPath = this.editor.$(startElm).parentsUntil(this.editor.getBody()).add(startElm); + if (currentPath.length === this.lastPath.length) { + for (i = currentPath.length; i >= 0; i--) { + if (currentPath[i] !== this.lastPath[i]) { + break; + } + } + if (i === -1) { this.lastPath = currentPath; - return false; - }; - return NodeChange; + return true; + } + } + this.lastPath = currentPath; + return false; + }; + return NodeChange; }(); var preventSummaryToggle = function (editor) { - editor.on('click', function (e) { - if (editor.dom.getParent(e.target, 'details')) { - e.preventDefault(); - } - }); + editor.on('click', function (e) { + if (editor.dom.getParent(e.target, 'details')) { + e.preventDefault(); + } + }); }; var filterDetails = function (editor) { - editor.parser.addNodeFilter('details', function (elms) { - each(elms, function (details) { - details.attr('data-mce-open', details.attr('open')); - details.attr('open', 'open'); - }); + editor.parser.addNodeFilter('details', function (elms) { + each(elms, function (details) { + details.attr('data-mce-open', details.attr('open')); + details.attr('open', 'open'); }); - editor.serializer.addNodeFilter('details', function (elms) { - each(elms, function (details) { - var open = details.attr('data-mce-open'); - details.attr('open', isString(open) ? open : null); - details.attr('data-mce-open', null); - }); + }); + editor.serializer.addNodeFilter('details', function (elms) { + each(elms, function (details) { + var open = details.attr('data-mce-open'); + details.attr('open', isString(open) ? open : null); + details.attr('data-mce-open', null); }); + }); }; var setup$j = function (editor) { - preventSummaryToggle(editor); - filterDetails(editor); + preventSummaryToggle(editor); + filterDetails(editor); }; var isTextBlockNode = function (node) { - return isElement$1(node) && isTextBlock(SugarElement.fromDom(node)); + return isElement$1(node) && isTextBlock(SugarElement.fromDom(node)); }; var normalizeSelection$1 = function (editor) { - var rng = editor.selection.getRng(); - var startPos = CaretPosition.fromRangeStart(rng); - var endPos = CaretPosition.fromRangeEnd(rng); - if (CaretPosition.isElementPosition(startPos)) { - var container = startPos.container(); - if (isTextBlockNode(container)) { - firstPositionIn(container).each(function (pos) { - return rng.setStart(pos.container(), pos.offset()); - }); - } - } - if (CaretPosition.isElementPosition(endPos)) { - var container = startPos.container(); - if (isTextBlockNode(container)) { - lastPositionIn(container).each(function (pos) { - return rng.setEnd(pos.container(), pos.offset()); - }); - } - } - editor.selection.setRng(normalize$2(rng)); + var rng = editor.selection.getRng(); + var startPos = CaretPosition.fromRangeStart(rng); + var endPos = CaretPosition.fromRangeEnd(rng); + if (CaretPosition.isElementPosition(startPos)) { + var container = startPos.container(); + if (isTextBlockNode(container)) { + firstPositionIn(container).each(function (pos) { + return rng.setStart(pos.container(), pos.offset()); + }); + } + } + if (CaretPosition.isElementPosition(endPos)) { + var container = startPos.container(); + if (isTextBlockNode(container)) { + lastPositionIn(container).each(function (pos) { + return rng.setEnd(pos.container(), pos.offset()); + }); + } + } + editor.selection.setRng(normalize$2(rng)); }; var setup$k = function (editor) { - editor.on('click', function (e) { - if (e.detail >= 3) { - normalizeSelection$1(editor); - } - }); + editor.on('click', function (e) { + if (e.detail >= 3) { + normalizeSelection$1(editor); + } + }); }; var value$1 = function () { - var subject = Cell(Optional.none()); - var clear = function () { - return subject.set(Optional.none()); - }; - var set = function (s) { - return subject.set(Optional.some(s)); - }; - var isSet = function () { - return subject.get().isSome(); - }; - var on = function (f) { - return subject.get().each(f); - }; - return { - clear: clear, - set: set, - isSet: isSet, - on: on - }; + var subject = Cell(Optional.none()); + var clear = function () { + return subject.set(Optional.none()); + }; + var set = function (s) { + return subject.set(Optional.some(s)); + }; + var isSet = function () { + return subject.get().isSome(); + }; + var on = function (f) { + return subject.get().each(f); + }; + return { + clear: clear, + set: set, + isSet: isSet, + on: on + }; }; var getAbsolutePosition = function (elm) { - var clientRect = elm.getBoundingClientRect(); - var doc = elm.ownerDocument; - var docElem = doc.documentElement; - var win = doc.defaultView; - return { - top: clientRect.top + win.pageYOffset - docElem.clientTop, - left: clientRect.left + win.pageXOffset - docElem.clientLeft - }; + var clientRect = elm.getBoundingClientRect(); + var doc = elm.ownerDocument; + var docElem = doc.documentElement; + var win = doc.defaultView; + return { + top: clientRect.top + win.pageYOffset - docElem.clientTop, + left: clientRect.left + win.pageXOffset - docElem.clientLeft + }; }; var getBodyPosition = function (editor) { - return editor.inline ? getAbsolutePosition(editor.getBody()) : { - left: 0, - top: 0 - }; + return editor.inline ? getAbsolutePosition(editor.getBody()) : { + left: 0, + top: 0 + }; }; var getScrollPosition = function (editor) { - var body = editor.getBody(); - return editor.inline ? { - left: body.scrollLeft, - top: body.scrollTop - } : { - left: 0, - top: 0 - }; + var body = editor.getBody(); + return editor.inline ? { + left: body.scrollLeft, + top: body.scrollTop + } : { + left: 0, + top: 0 + }; }; var getBodyScroll = function (editor) { - var body = editor.getBody(), docElm = editor.getDoc().documentElement; - var inlineScroll = { - left: body.scrollLeft, - top: body.scrollTop - }; - var iframeScroll = { - left: body.scrollLeft || docElm.scrollLeft, - top: body.scrollTop || docElm.scrollTop - }; - return editor.inline ? inlineScroll : iframeScroll; + var body = editor.getBody(), docElm = editor.getDoc().documentElement; + var inlineScroll = { + left: body.scrollLeft, + top: body.scrollTop + }; + var iframeScroll = { + left: body.scrollLeft || docElm.scrollLeft, + top: body.scrollTop || docElm.scrollTop + }; + return editor.inline ? inlineScroll : iframeScroll; }; var getMousePosition = function (editor, event) { - if (event.target.ownerDocument !== editor.getDoc()) { - var iframePosition = getAbsolutePosition(editor.getContentAreaContainer()); - var scrollPosition = getBodyScroll(editor); - return { - left: event.pageX - iframePosition.left + scrollPosition.left, - top: event.pageY - iframePosition.top + scrollPosition.top - }; - } + if (event.target.ownerDocument !== editor.getDoc()) { + var iframePosition = getAbsolutePosition(editor.getContentAreaContainer()); + var scrollPosition = getBodyScroll(editor); return { - left: event.pageX, - top: event.pageY + left: event.pageX - iframePosition.left + scrollPosition.left, + top: event.pageY - iframePosition.top + scrollPosition.top }; + } + return { + left: event.pageX, + top: event.pageY + }; }; var calculatePosition = function (bodyPosition, scrollPosition, mousePosition) { - return { - pageX: mousePosition.left - bodyPosition.left + scrollPosition.left, - pageY: mousePosition.top - bodyPosition.top + scrollPosition.top - }; + return { + pageX: mousePosition.left - bodyPosition.left + scrollPosition.left, + pageY: mousePosition.top - bodyPosition.top + scrollPosition.top + }; }; var calc = function (editor, event) { - return calculatePosition(getBodyPosition(editor), getScrollPosition(editor), getMousePosition(editor, event)); + return calculatePosition(getBodyPosition(editor), getScrollPosition(editor), getMousePosition(editor, event)); }; var isContentEditableFalse$a = isContentEditableFalse, isContentEditableTrue$3 = isContentEditableTrue; var isDraggable = function (rootElm, elm) { - return isContentEditableFalse$a(elm) && elm !== rootElm; + return isContentEditableFalse$a(elm) && elm !== rootElm; }; var isValidDropTarget = function (editor, targetElement, dragElement) { - if (targetElement === dragElement || editor.dom.isChildOf(targetElement, dragElement)) { - return false; - } - return !isContentEditableFalse$a(targetElement); + if (targetElement === dragElement || editor.dom.isChildOf(targetElement, dragElement)) { + return false; + } + return !isContentEditableFalse$a(targetElement); }; var cloneElement = function (elm) { - var cloneElm = elm.cloneNode(true); - cloneElm.removeAttribute('data-mce-selected'); - return cloneElm; + var cloneElm = elm.cloneNode(true); + cloneElm.removeAttribute('data-mce-selected'); + return cloneElm; }; var createGhost = function (editor, elm, width, height) { - var dom = editor.dom; - var clonedElm = elm.cloneNode(true); - dom.setStyles(clonedElm, { - width: width, - height: height - }); - dom.setAttrib(clonedElm, 'data-mce-selected', null); - var ghostElm = dom.create('div', { - 'class': 'mce-drag-container', - 'data-mce-bogus': 'all', - 'unselectable': 'on', - 'contenteditable': 'false' - }); - dom.setStyles(ghostElm, { - position: 'absolute', - opacity: 0.5, - overflow: 'hidden', - border: 0, - padding: 0, - margin: 0, - width: width, - height: height - }); - dom.setStyles(clonedElm, { - margin: 0, - boxSizing: 'border-box' - }); - ghostElm.appendChild(clonedElm); - return ghostElm; + var dom = editor.dom; + var clonedElm = elm.cloneNode(true); + dom.setStyles(clonedElm, { + width: width, + height: height + }); + dom.setAttrib(clonedElm, 'data-mce-selected', null); + var ghostElm = dom.create('div', { + 'class': 'mce-drag-container', + 'data-mce-bogus': 'all', + 'unselectable': 'on', + 'contenteditable': 'false' + }); + dom.setStyles(ghostElm, { + position: 'absolute', + opacity: 0.5, + overflow: 'hidden', + border: 0, + padding: 0, + margin: 0, + width: width, + height: height + }); + dom.setStyles(clonedElm, { + margin: 0, + boxSizing: 'border-box' + }); + ghostElm.appendChild(clonedElm); + return ghostElm; }; var appendGhostToBody = function (ghostElm, bodyElm) { - if (ghostElm.parentNode !== bodyElm) { - bodyElm.appendChild(ghostElm); - } + if (ghostElm.parentNode !== bodyElm) { + bodyElm.appendChild(ghostElm); + } }; var moveGhost = function (ghostElm, position, width, height, maxX, maxY) { - var overflowX = 0, overflowY = 0; - ghostElm.style.left = position.pageX + 'px'; - ghostElm.style.top = position.pageY + 'px'; - if (position.pageX + width > maxX) { - overflowX = position.pageX + width - maxX; - } - if (position.pageY + height > maxY) { - overflowY = position.pageY + height - maxY; - } - ghostElm.style.width = width - overflowX + 'px'; - ghostElm.style.height = height - overflowY + 'px'; + var overflowX = 0, overflowY = 0; + ghostElm.style.left = position.pageX + 'px'; + ghostElm.style.top = position.pageY + 'px'; + if (position.pageX + width > maxX) { + overflowX = position.pageX + width - maxX; + } + if (position.pageY + height > maxY) { + overflowY = position.pageY + height - maxY; + } + ghostElm.style.width = width - overflowX + 'px'; + ghostElm.style.height = height - overflowY + 'px'; }; var removeElement = function (elm) { - if (elm && elm.parentNode) { - elm.parentNode.removeChild(elm); - } + if (elm && elm.parentNode) { + elm.parentNode.removeChild(elm); + } }; var isLeftMouseButtonPressed = function (e) { - return e.button === 0; + return e.button === 0; }; var applyRelPos = function (state, position) { - return { - pageX: position.pageX - state.relX, - pageY: position.pageY + 5 - }; + return { + pageX: position.pageX - state.relX, + pageY: position.pageY + 5 + }; }; var start$1 = function (state, editor) { - return function (e) { - if (isLeftMouseButtonPressed(e)) { - var ceElm = find(editor.dom.getParents(e.target), or(isContentEditableFalse$a, isContentEditableTrue$3)).getOr(null); - if (isDraggable(editor.getBody(), ceElm)) { - var elmPos = editor.dom.getPos(ceElm); - var bodyElm = editor.getBody(); - var docElm = editor.getDoc().documentElement; - state.set({ - element: ceElm, - dragging: false, - screenX: e.screenX, - screenY: e.screenY, - maxX: (editor.inline ? bodyElm.scrollWidth : docElm.offsetWidth) - 2, - maxY: (editor.inline ? bodyElm.scrollHeight : docElm.offsetHeight) - 2, - relX: e.pageX - elmPos.x, - relY: e.pageY - elmPos.y, - width: ceElm.offsetWidth, - height: ceElm.offsetHeight, - ghost: createGhost(editor, ceElm, ceElm.offsetWidth, ceElm.offsetHeight) - }); - } - } - }; + return function (e) { + if (isLeftMouseButtonPressed(e)) { + var ceElm = find(editor.dom.getParents(e.target), or(isContentEditableFalse$a, isContentEditableTrue$3)).getOr(null); + if (isDraggable(editor.getBody(), ceElm)) { + var elmPos = editor.dom.getPos(ceElm); + var bodyElm = editor.getBody(); + var docElm = editor.getDoc().documentElement; + state.set({ + element: ceElm, + dragging: false, + screenX: e.screenX, + screenY: e.screenY, + maxX: (editor.inline ? bodyElm.scrollWidth : docElm.offsetWidth) - 2, + maxY: (editor.inline ? bodyElm.scrollHeight : docElm.offsetHeight) - 2, + relX: e.pageX - elmPos.x, + relY: e.pageY - elmPos.y, + width: ceElm.offsetWidth, + height: ceElm.offsetHeight, + ghost: createGhost(editor, ceElm, ceElm.offsetWidth, ceElm.offsetHeight) + }); + } + } + }; }; var move$2 = function (state, editor) { - var throttledPlaceCaretAt = Delay.throttle(function (clientX, clientY) { - editor._selectionOverrides.hideFakeCaret(); - editor.selection.placeCaretAt(clientX, clientY); - }, 0); - editor.on('remove', throttledPlaceCaretAt.stop); - return function (e) { - return state.on(function (state) { - var movement = Math.max(Math.abs(e.screenX - state.screenX), Math.abs(e.screenY - state.screenY)); - if (!state.dragging && movement > 10) { - var args = editor.fire('dragstart', {target: state.element}); - if (args.isDefaultPrevented()) { - return; - } - state.dragging = true; - editor.focus(); - } - if (state.dragging) { - var targetPos = applyRelPos(state, calc(editor, e)); - appendGhostToBody(state.ghost, editor.getBody()); - moveGhost(state.ghost, targetPos, state.width, state.height, state.maxX, state.maxY); - throttledPlaceCaretAt(e.clientX, e.clientY); - } - }); - }; + var throttledPlaceCaretAt = Delay.throttle(function (clientX, clientY) { + editor._selectionOverrides.hideFakeCaret(); + editor.selection.placeCaretAt(clientX, clientY); + }, 0); + editor.on('remove', throttledPlaceCaretAt.stop); + return function (e) { + return state.on(function (state) { + var movement = Math.max(Math.abs(e.screenX - state.screenX), Math.abs(e.screenY - state.screenY)); + if (!state.dragging && movement > 10) { + var args = editor.fire('dragstart', { target: state.element }); + if (args.isDefaultPrevented()) { + return; + } + state.dragging = true; + editor.focus(); + } + if (state.dragging) { + var targetPos = applyRelPos(state, calc(editor, e)); + appendGhostToBody(state.ghost, editor.getBody()); + moveGhost(state.ghost, targetPos, state.width, state.height, state.maxX, state.maxY); + throttledPlaceCaretAt(e.clientX, e.clientY); + } + }); + }; }; var getRawTarget = function (selection) { - var rng = selection.getSel().getRangeAt(0); - var startContainer = rng.startContainer; - return startContainer.nodeType === 3 ? startContainer.parentNode : startContainer; + var rng = selection.getSel().getRangeAt(0); + var startContainer = rng.startContainer; + return startContainer.nodeType === 3 ? startContainer.parentNode : startContainer; }; var drop = function (state, editor) { - return function (e) { - state.on(function (state) { - if (state.dragging) { - if (isValidDropTarget(editor, getRawTarget(editor.selection), state.element)) { - var targetClone_1 = cloneElement(state.element); - var args = editor.fire('drop', { - clientX: e.clientX, - clientY: e.clientY - }); - if (!args.isDefaultPrevented()) { - editor.undoManager.transact(function () { - removeElement(state.element); - editor.insertContent(editor.dom.getOuterHTML(targetClone_1)); - editor._selectionOverrides.hideFakeCaret(); - }); - } - } - } - }); - removeDragState(state); - }; + return function (e) { + state.on(function (state) { + if (state.dragging) { + if (isValidDropTarget(editor, getRawTarget(editor.selection), state.element)) { + var targetClone_1 = cloneElement(state.element); + var args = editor.fire('drop', { + clientX: e.clientX, + clientY: e.clientY + }); + if (!args.isDefaultPrevented()) { + editor.undoManager.transact(function () { + removeElement(state.element); + editor.insertContent(editor.dom.getOuterHTML(targetClone_1)); + editor._selectionOverrides.hideFakeCaret(); + }); + } + } + } + }); + removeDragState(state); + }; }; var stop = function (state, editor) { - return function () { - state.on(function (state) { - if (state.dragging) { - editor.fire('dragend'); - } - }); - removeDragState(state); - }; - }; - var removeDragState = function (state) { + return function () { state.on(function (state) { - removeElement(state.ghost); + if (state.dragging) { + editor.fire('dragend'); + } }); - state.clear(); + removeDragState(state); + }; + }; + var removeDragState = function (state) { + state.on(function (state) { + removeElement(state.ghost); + }); + state.clear(); }; var bindFakeDragEvents = function (editor) { - var state = value$1(); - var pageDom = DOMUtils$1.DOM; - var rootDocument = document; - var dragStartHandler = start$1(state, editor); - var dragHandler = move$2(state, editor); - var dropHandler = drop(state, editor); - var dragEndHandler = stop(state, editor); - editor.on('mousedown', dragStartHandler); - editor.on('mousemove', dragHandler); - editor.on('mouseup', dropHandler); - pageDom.bind(rootDocument, 'mousemove', dragHandler); - pageDom.bind(rootDocument, 'mouseup', dragEndHandler); - editor.on('remove', function () { - pageDom.unbind(rootDocument, 'mousemove', dragHandler); - pageDom.unbind(rootDocument, 'mouseup', dragEndHandler); - }); + var state = value$1(); + var pageDom = DOMUtils$1.DOM; + var rootDocument = document; + var dragStartHandler = start$1(state, editor); + var dragHandler = move$2(state, editor); + var dropHandler = drop(state, editor); + var dragEndHandler = stop(state, editor); + editor.on('mousedown', dragStartHandler); + editor.on('mousemove', dragHandler); + editor.on('mouseup', dropHandler); + pageDom.bind(rootDocument, 'mousemove', dragHandler); + pageDom.bind(rootDocument, 'mouseup', dragEndHandler); + editor.on('remove', function () { + pageDom.unbind(rootDocument, 'mousemove', dragHandler); + pageDom.unbind(rootDocument, 'mouseup', dragEndHandler); + }); }; var blockIeDrop = function (editor) { - editor.on('drop', function (e) { - var realTarget = typeof e.clientX !== 'undefined' ? editor.getDoc().elementFromPoint(e.clientX, e.clientY) : null; - if (isContentEditableFalse$a(realTarget) || editor.dom.getContentEditableParent(realTarget) === 'false') { - e.preventDefault(); - } - }); + editor.on('drop', function (e) { + var realTarget = typeof e.clientX !== 'undefined' ? editor.getDoc().elementFromPoint(e.clientX, e.clientY) : null; + if (isContentEditableFalse$a(realTarget) || editor.dom.getContentEditableParent(realTarget) === 'false') { + e.preventDefault(); + } + }); }; var blockUnsupportedFileDrop = function (editor) { - var preventFileDrop = function (e) { - if (!e.defaultPrevented) { - var dataTransfer = e.dataTransfer; - if (dataTransfer && (contains(dataTransfer.types, 'Files') || dataTransfer.files.length > 0)) { - e.preventDefault(); - if (e.type === 'drop') { - displayError(editor, 'Dropped file type is not supported'); - } - } - } - }; - var preventFileDropIfUIElement = function (e) { - if (isUIElement(editor, e.target)) { - preventFileDrop(e); + var preventFileDrop = function (e) { + if (!e.defaultPrevented) { + var dataTransfer = e.dataTransfer; + if (dataTransfer && (contains(dataTransfer.types, 'Files') || dataTransfer.files.length > 0)) { + e.preventDefault(); + if (e.type === 'drop') { + displayError(editor, 'Dropped file type is not supported'); } - }; - var setup = function () { - var pageDom = DOMUtils$1.DOM; - var dom = editor.dom; - var doc = document; - var editorRoot = editor.inline ? editor.getBody() : editor.getDoc(); - var eventNames = [ - 'drop', - 'dragover' - ]; - each(eventNames, function (name) { - pageDom.bind(doc, name, preventFileDropIfUIElement); - dom.bind(editorRoot, name, preventFileDrop); - }); - editor.on('remove', function () { - each(eventNames, function (name) { - pageDom.unbind(doc, name, preventFileDropIfUIElement); - dom.unbind(editorRoot, name, preventFileDrop); - }); - }); - }; - editor.on('init', function () { - Delay.setEditorTimeout(editor, setup, 0); + } + } + }; + var preventFileDropIfUIElement = function (e) { + if (isUIElement(editor, e.target)) { + preventFileDrop(e); + } + }; + var setup = function () { + var pageDom = DOMUtils$1.DOM; + var dom = editor.dom; + var doc = document; + var editorRoot = editor.inline ? editor.getBody() : editor.getDoc(); + var eventNames = [ + 'drop', + 'dragover' + ]; + each(eventNames, function (name) { + pageDom.bind(doc, name, preventFileDropIfUIElement); + dom.bind(editorRoot, name, preventFileDrop); }); + editor.on('remove', function () { + each(eventNames, function (name) { + pageDom.unbind(doc, name, preventFileDropIfUIElement); + dom.unbind(editorRoot, name, preventFileDrop); + }); + }); + }; + editor.on('init', function () { + Delay.setEditorTimeout(editor, setup, 0); + }); }; var init = function (editor) { - bindFakeDragEvents(editor); - blockIeDrop(editor); - if (shouldBlockUnsupportedDrop(editor)) { - blockUnsupportedFileDrop(editor); - } + bindFakeDragEvents(editor); + blockIeDrop(editor); + if (shouldBlockUnsupportedDrop(editor)) { + blockUnsupportedFileDrop(editor); + } }; var setup$l = function (editor) { - var renderFocusCaret = first(function () { - if (!editor.removed && editor.getBody().contains(document.activeElement)) { - var rng = editor.selection.getRng(); - if (rng.collapsed) { - var caretRange = renderRangeCaret(editor, rng, false); - editor.selection.setRng(caretRange); - } - } - }, 0); - editor.on('focus', function () { - renderFocusCaret.throttle(); - }); - editor.on('blur', function () { - renderFocusCaret.cancel(); - }); + var renderFocusCaret = first(function () { + if (!editor.removed && editor.getBody().contains(document.activeElement)) { + var rng = editor.selection.getRng(); + if (rng.collapsed) { + var caretRange = renderRangeCaret(editor, rng, false); + editor.selection.setRng(caretRange); + } + } + }, 0); + editor.on('focus', function () { + renderFocusCaret.throttle(); + }); + editor.on('blur', function () { + renderFocusCaret.cancel(); + }); }; var setup$m = function (editor) { - editor.on('init', function () { - editor.on('focusin', function (e) { - var target = e.target; - if (isMedia(target)) { - var ceRoot = getContentEditableRoot(editor.getBody(), target); - var node = isContentEditableFalse(ceRoot) ? ceRoot : target; - if (editor.selection.getNode() !== node) { - selectNode(editor, node).each(function (rng) { - return editor.selection.setRng(rng); - }); - } - } - }); + editor.on('init', function () { + editor.on('focusin', function (e) { + var target = e.target; + if (isMedia(target)) { + var ceRoot = getContentEditableRoot(editor.getBody(), target); + var node = isContentEditableFalse(ceRoot) ? ceRoot : target; + if (editor.selection.getNode() !== node) { + selectNode(editor, node).each(function (rng) { + return editor.selection.setRng(rng); + }); + } + } }); + }); }; var isContentEditableTrue$4 = isContentEditableTrue; var isContentEditableFalse$b = isContentEditableFalse; var getContentEditableRoot$1 = function (editor, node) { - return getContentEditableRoot(editor.getBody(), node); + return getContentEditableRoot(editor.getBody(), node); }; var SelectionOverrides = function (editor) { - var selection = editor.selection, dom = editor.dom; - var isBlock = dom.isBlock; - var rootNode = editor.getBody(); - var fakeCaret = FakeCaret(editor, rootNode, isBlock, function () { - return hasFocus$1(editor); - }); - var realSelectionId = 'sel-' + dom.uniqueId(); - var elementSelectionAttr = 'data-mce-selected'; - var selectedElement; - var isFakeSelectionElement = function (node) { - return dom.hasClass(node, 'mce-offscreen-selection'); - }; - var isFakeSelectionTargetElement = function (node) { - return node !== rootNode && (isContentEditableFalse$b(node) || isMedia(node)) && dom.isChildOf(node, rootNode); - }; - var isNearFakeSelectionElement = function (pos) { - return isBeforeContentEditableFalse(pos) || isAfterContentEditableFalse(pos) || isBeforeMedia(pos) || isAfterMedia(pos); - }; - var getRealSelectionElement = function () { - var container = dom.get(realSelectionId); - return container ? container.getElementsByTagName('*')[0] : container; - }; - var setRange = function (range) { - if (range) { - selection.setRng(range); - } - }; - var getRange = selection.getRng; - var showCaret = function (direction, node, before, scrollIntoView) { - if (scrollIntoView === void 0) { - scrollIntoView = true; - } - var e = editor.fire('ShowCaret', { - target: node, - direction: direction, - before: before - }); - if (e.isDefaultPrevented()) { - return null; - } - if (scrollIntoView) { - selection.scrollIntoView(node, direction === -1); - } - return fakeCaret.show(before, node); + var selection = editor.selection, dom = editor.dom; + var isBlock = dom.isBlock; + var rootNode = editor.getBody(); + var fakeCaret = FakeCaret(editor, rootNode, isBlock, function () { + return hasFocus$1(editor); + }); + var realSelectionId = 'sel-' + dom.uniqueId(); + var elementSelectionAttr = 'data-mce-selected'; + var selectedElement; + var isFakeSelectionElement = function (node) { + return dom.hasClass(node, 'mce-offscreen-selection'); + }; + var isFakeSelectionTargetElement = function (node) { + return node !== rootNode && (isContentEditableFalse$b(node) || isMedia(node)) && dom.isChildOf(node, rootNode); + }; + var isNearFakeSelectionElement = function (pos) { + return isBeforeContentEditableFalse(pos) || isAfterContentEditableFalse(pos) || isBeforeMedia(pos) || isAfterMedia(pos); + }; + var getRealSelectionElement = function () { + var container = dom.get(realSelectionId); + return container ? container.getElementsByTagName('*')[0] : container; + }; + var setRange = function (range) { + if (range) { + selection.setRng(range); + } + }; + var getRange = selection.getRng; + var showCaret = function (direction, node, before, scrollIntoView) { + if (scrollIntoView === void 0) { + scrollIntoView = true; + } + var e = editor.fire('ShowCaret', { + target: node, + direction: direction, + before: before + }); + if (e.isDefaultPrevented()) { + return null; + } + if (scrollIntoView) { + selection.scrollIntoView(node, direction === -1); + } + return fakeCaret.show(before, node); + }; + var showBlockCaretContainer = function (blockCaretContainer) { + if (blockCaretContainer.hasAttribute('data-mce-caret')) { + showCaretContainerBlock(blockCaretContainer); + setRange(getRange()); + selection.scrollIntoView(blockCaretContainer); + } + }; + var registerEvents = function () { + editor.on('mouseup', function (e) { + var range = getRange(); + if (range.collapsed && isXYInContentArea(editor, e.clientX, e.clientY)) { + renderCaretAtRange(editor, range, false).each(setRange); + } + }); + editor.on('click', function (e) { + var contentEditableRoot = getContentEditableRoot$1(editor, e.target); + if (contentEditableRoot) { + if (isContentEditableFalse$b(contentEditableRoot)) { + e.preventDefault(); + editor.focus(); + } + if (isContentEditableTrue$4(contentEditableRoot)) { + if (dom.isChildOf(contentEditableRoot, selection.getNode())) { + removeElementSelection(); + } + } + } + }); + editor.on('blur NewBlock', removeElementSelection); + editor.on('ResizeWindow FullscreenStateChanged', fakeCaret.reposition); + var hasNormalCaretPosition = function (elm) { + var caretWalker = CaretWalker(elm); + if (!elm.firstChild) { + return false; + } + var startPos = CaretPosition$1.before(elm.firstChild); + var newPos = caretWalker.next(startPos); + return newPos && !isNearFakeSelectionElement(newPos); + }; + var isInSameBlock = function (node1, node2) { + var block1 = dom.getParent(node1, isBlock); + var block2 = dom.getParent(node2, isBlock); + return block1 === block2; + }; + var hasBetterMouseTarget = function (targetNode, caretNode) { + var targetBlock = dom.getParent(targetNode, isBlock); + var caretBlock = dom.getParent(caretNode, isBlock); + if (targetBlock && targetNode !== caretBlock && dom.isChildOf(targetBlock, caretBlock) && isContentEditableFalse$b(getContentEditableRoot$1(editor, targetBlock)) === false) { + return true; + } + return targetBlock && !isInSameBlock(targetBlock, caretBlock) && hasNormalCaretPosition(targetBlock); }; - var showBlockCaretContainer = function (blockCaretContainer) { - if (blockCaretContainer.hasAttribute('data-mce-caret')) { - showCaretContainerBlock(blockCaretContainer); - setRange(getRange()); - selection.scrollIntoView(blockCaretContainer); + editor.on('tap', function (e) { + var targetElm = e.target; + var contentEditableRoot = getContentEditableRoot$1(editor, targetElm); + if (isContentEditableFalse$b(contentEditableRoot)) { + e.preventDefault(); + selectNode(editor, contentEditableRoot).each(setElementSelection); + } else if (isFakeSelectionTargetElement(targetElm)) { + selectNode(editor, targetElm).each(setElementSelection); + } + }, true); + editor.on('mousedown', function (e) { + var targetElm = e.target; + if (targetElm !== rootNode && targetElm.nodeName !== 'HTML' && !dom.isChildOf(targetElm, rootNode)) { + return; + } + if (isXYInContentArea(editor, e.clientX, e.clientY) === false) { + return; + } + var contentEditableRoot = getContentEditableRoot$1(editor, targetElm); + if (contentEditableRoot) { + if (isContentEditableFalse$b(contentEditableRoot)) { + e.preventDefault(); + selectNode(editor, contentEditableRoot).each(setElementSelection); + } else { + removeElementSelection(); + if (!(isContentEditableTrue$4(contentEditableRoot) && e.shiftKey) && !isXYWithinRange(e.clientX, e.clientY, selection.getRng())) { + hideFakeCaret(); + selection.placeCaretAt(e.clientX, e.clientY); + } + } + } else if (isFakeSelectionTargetElement(targetElm)) { + selectNode(editor, targetElm).each(setElementSelection); + } else if (isFakeCaretTarget(targetElm) === false) { + removeElementSelection(); + hideFakeCaret(); + var fakeCaretInfo = closestFakeCaret(rootNode, e.clientX, e.clientY); + if (fakeCaretInfo) { + if (!hasBetterMouseTarget(targetElm, fakeCaretInfo.node)) { + e.preventDefault(); + var range = showCaret(1, fakeCaretInfo.node, fakeCaretInfo.before, false); + editor.getBody().focus(); + setRange(range); + } } - }; - var registerEvents = function () { - editor.on('mouseup', function (e) { - var range = getRange(); - if (range.collapsed && isXYInContentArea(editor, e.clientX, e.clientY)) { - renderCaretAtRange(editor, range, false).each(setRange); - } - }); - editor.on('click', function (e) { - var contentEditableRoot = getContentEditableRoot$1(editor, e.target); - if (contentEditableRoot) { - if (isContentEditableFalse$b(contentEditableRoot)) { - e.preventDefault(); - editor.focus(); - } - if (isContentEditableTrue$4(contentEditableRoot)) { - if (dom.isChildOf(contentEditableRoot, selection.getNode())) { - removeElementSelection(); - } - } - } - }); - editor.on('blur NewBlock', removeElementSelection); - editor.on('ResizeWindow FullscreenStateChanged', fakeCaret.reposition); - var hasNormalCaretPosition = function (elm) { - var caretWalker = CaretWalker(elm); - if (!elm.firstChild) { - return false; - } - var startPos = CaretPosition$1.before(elm.firstChild); - var newPos = caretWalker.next(startPos); - return newPos && !isNearFakeSelectionElement(newPos); - }; - var isInSameBlock = function (node1, node2) { - var block1 = dom.getParent(node1, isBlock); - var block2 = dom.getParent(node2, isBlock); - return block1 === block2; - }; - var hasBetterMouseTarget = function (targetNode, caretNode) { - var targetBlock = dom.getParent(targetNode, isBlock); - var caretBlock = dom.getParent(caretNode, isBlock); - if (targetBlock && targetNode !== caretBlock && dom.isChildOf(targetBlock, caretBlock) && isContentEditableFalse$b(getContentEditableRoot$1(editor, targetBlock)) === false) { - return true; - } - return targetBlock && !isInSameBlock(targetBlock, caretBlock) && hasNormalCaretPosition(targetBlock); - }; - editor.on('tap', function (e) { - var targetElm = e.target; - var contentEditableRoot = getContentEditableRoot$1(editor, targetElm); - if (isContentEditableFalse$b(contentEditableRoot)) { - e.preventDefault(); - selectNode(editor, contentEditableRoot).each(setElementSelection); - } else if (isFakeSelectionTargetElement(targetElm)) { - selectNode(editor, targetElm).each(setElementSelection); - } - }, true); - editor.on('mousedown', function (e) { - var targetElm = e.target; - if (targetElm !== rootNode && targetElm.nodeName !== 'HTML' && !dom.isChildOf(targetElm, rootNode)) { - return; - } - if (isXYInContentArea(editor, e.clientX, e.clientY) === false) { - return; - } - var contentEditableRoot = getContentEditableRoot$1(editor, targetElm); - if (contentEditableRoot) { - if (isContentEditableFalse$b(contentEditableRoot)) { - e.preventDefault(); - selectNode(editor, contentEditableRoot).each(setElementSelection); - } else { - removeElementSelection(); - if (!(isContentEditableTrue$4(contentEditableRoot) && e.shiftKey) && !isXYWithinRange(e.clientX, e.clientY, selection.getRng())) { - hideFakeCaret(); - selection.placeCaretAt(e.clientX, e.clientY); - } - } - } else if (isFakeSelectionTargetElement(targetElm)) { - selectNode(editor, targetElm).each(setElementSelection); - } else if (isFakeCaretTarget(targetElm) === false) { - removeElementSelection(); - hideFakeCaret(); - var fakeCaretInfo = closestFakeCaret(rootNode, e.clientX, e.clientY); - if (fakeCaretInfo) { - if (!hasBetterMouseTarget(targetElm, fakeCaretInfo.node)) { - e.preventDefault(); - var range = showCaret(1, fakeCaretInfo.node, fakeCaretInfo.before, false); - editor.getBody().focus(); - setRange(range); - } - } - } - }); - editor.on('keypress', function (e) { - if (VK.modifierPressed(e)) { - return; - } - if (isContentEditableFalse$b(selection.getNode())) { - e.preventDefault(); - } - }); - editor.on('GetSelectionRange', function (e) { - var rng = e.range; - if (selectedElement) { - if (!selectedElement.parentNode) { - selectedElement = null; - return; - } - rng = rng.cloneRange(); - rng.selectNode(selectedElement); - e.range = rng; - } - }); - editor.on('SetSelectionRange', function (e) { - e.range = normalizeShortEndedElementSelection(e.range); - var rng = setElementSelection(e.range, e.forward); - if (rng) { - e.range = rng; - } - }); - var isPasteBin = function (node) { - return node.id === 'mcepastebin'; + } + }); + editor.on('keypress', function (e) { + if (VK.modifierPressed(e)) { + return; + } + if (isContentEditableFalse$b(selection.getNode())) { + e.preventDefault(); + } + }); + editor.on('GetSelectionRange', function (e) { + var rng = e.range; + if (selectedElement) { + if (!selectedElement.parentNode) { + selectedElement = null; + return; + } + rng = rng.cloneRange(); + rng.selectNode(selectedElement); + e.range = rng; + } + }); + editor.on('SetSelectionRange', function (e) { + e.range = normalizeShortEndedElementSelection(e.range); + var rng = setElementSelection(e.range, e.forward); + if (rng) { + e.range = rng; + } + }); + var isPasteBin = function (node) { + return node.id === 'mcepastebin'; + }; + editor.on('AfterSetSelectionRange', function (e) { + var rng = e.range; + var parentNode = rng.startContainer.parentNode; + if (!isRangeInCaretContainer(rng) && !isPasteBin(parentNode)) { + hideFakeCaret(); + } + if (!isFakeSelectionElement(parentNode)) { + removeElementSelection(); + } + }); + editor.on('copy', function (e) { + var clipboardData = e.clipboardData; + if (!e.isDefaultPrevented() && e.clipboardData && !Env.ie) { + var realSelectionElement = getRealSelectionElement(); + if (realSelectionElement) { + e.preventDefault(); + clipboardData.clearData(); + clipboardData.setData('text/html', realSelectionElement.outerHTML); + clipboardData.setData('text/plain', realSelectionElement.outerText || realSelectionElement.innerText); + } + } + }); + init(editor); + setup$l(editor); + setup$m(editor); + }; + var isWithinCaretContainer = function (node) { + return isCaretContainer(node) || startsWithCaretContainer(node) || endsWithCaretContainer(node); + }; + var isRangeInCaretContainer = function (rng) { + return isWithinCaretContainer(rng.startContainer) || isWithinCaretContainer(rng.endContainer); + }; + var normalizeShortEndedElementSelection = function (rng) { + var shortEndedElements = editor.schema.getShortEndedElements(); + var newRng = dom.createRng(); + var startContainer = rng.startContainer; + var startOffset = rng.startOffset; + var endContainer = rng.endContainer; + var endOffset = rng.endOffset; + if (has(shortEndedElements, startContainer.nodeName.toLowerCase())) { + if (startOffset === 0) { + newRng.setStartBefore(startContainer); + } else { + newRng.setStartAfter(startContainer); + } + } else { + newRng.setStart(startContainer, startOffset); + } + if (has(shortEndedElements, endContainer.nodeName.toLowerCase())) { + if (endOffset === 0) { + newRng.setEndBefore(endContainer); + } else { + newRng.setEndAfter(endContainer); + } + } else { + newRng.setEnd(endContainer, endOffset); + } + return newRng; + }; + var setupOffscreenSelection = function (node, targetClone, origTargetClone) { + var $ = editor.$; + var $realSelectionContainer = descendant(SugarElement.fromDom(editor.getBody()), '#' + realSelectionId).fold(function () { + return $([]); + }, function (elm) { + return $([elm.dom]); + }); + if ($realSelectionContainer.length === 0) { + $realSelectionContainer = $('
              ').attr('id', realSelectionId); + $realSelectionContainer.appendTo(editor.getBody()); + } + var newRange = dom.createRng(); + if (targetClone === origTargetClone && Env.ie) { + $realSelectionContainer.empty().append('

              \xA0

              ').append(targetClone); + newRange.setStartAfter($realSelectionContainer[0].firstChild.firstChild); + newRange.setEndAfter(targetClone); + } else { + $realSelectionContainer.empty().append(nbsp).append(targetClone).append(nbsp); + newRange.setStart($realSelectionContainer[0].firstChild, 1); + newRange.setEnd($realSelectionContainer[0].lastChild, 0); + } + $realSelectionContainer.css({ top: dom.getPos(node, editor.getBody()).y }); + $realSelectionContainer[0].focus(); + var sel = selection.getSel(); + sel.removeAllRanges(); + sel.addRange(newRange); + return newRange; + }; + var selectElement = function (elm) { + var targetClone = elm.cloneNode(true); + var e = editor.fire('ObjectSelected', { + target: elm, + targetClone: targetClone + }); + if (e.isDefaultPrevented()) { + return null; + } + var range = setupOffscreenSelection(elm, e.targetClone, targetClone); + var nodeElm = SugarElement.fromDom(elm); + each(descendants$1(SugarElement.fromDom(editor.getBody()), '*[data-mce-selected]'), function (elm) { + if (!eq$2(nodeElm, elm)) { + remove$1(elm, elementSelectionAttr); + } + }); + if (!dom.getAttrib(elm, elementSelectionAttr)) { + elm.setAttribute(elementSelectionAttr, '1'); + } + selectedElement = elm; + hideFakeCaret(); + return range; + }; + var setElementSelection = function (range, forward) { + if (!range) { + return null; + } + if (range.collapsed) { + if (!isRangeInCaretContainer(range)) { + var dir = forward ? 1 : -1; + var caretPosition = getNormalizedRangeEndPoint(dir, rootNode, range); + var beforeNode = caretPosition.getNode(!forward); + if (isFakeCaretTarget(beforeNode)) { + return showCaret(dir, beforeNode, forward ? !caretPosition.isAtEnd() : false, false); + } + var afterNode = caretPosition.getNode(forward); + if (isFakeCaretTarget(afterNode)) { + return showCaret(dir, afterNode, forward ? false : !caretPosition.isAtEnd(), false); + } + } + return null; + } + var startContainer = range.startContainer; + var startOffset = range.startOffset; + var endOffset = range.endOffset; + if (startContainer.nodeType === 3 && startOffset === 0 && isContentEditableFalse$b(startContainer.parentNode)) { + startContainer = startContainer.parentNode; + startOffset = dom.nodeIndex(startContainer); + startContainer = startContainer.parentNode; + } + if (startContainer.nodeType !== 1) { + return null; + } + if (endOffset === startOffset + 1 && startContainer === range.endContainer) { + var node = startContainer.childNodes[startOffset]; + if (isFakeSelectionTargetElement(node)) { + return selectElement(node); + } + } + return null; + }; + var removeElementSelection = function () { + if (selectedElement) { + selectedElement.removeAttribute(elementSelectionAttr); + } + descendant(SugarElement.fromDom(editor.getBody()), '#' + realSelectionId).each(remove); + selectedElement = null; + }; + var destroy = function () { + fakeCaret.destroy(); + selectedElement = null; + }; + var hideFakeCaret = function () { + fakeCaret.hide(); + }; + if (Env.ceFalse) { + registerEvents(); + } + return { + showCaret: showCaret, + showBlockCaretContainer: showBlockCaretContainer, + hideFakeCaret: hideFakeCaret, + destroy: destroy + }; + }; + + var Quirks = function (editor) { + var each = Tools.each; + var BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection, parser = editor.parser; + var isGecko = Env.gecko, isIE = Env.ie, isWebKit = Env.webkit; + var mceInternalUrlPrefix = 'data:text/mce-internal,'; + var mceInternalDataType = isIE ? 'Text' : 'URL'; + var setEditorCommandState = function (cmd, state) { + try { + editor.getDoc().execCommand(cmd, false, state); + } catch (ex) { + } + }; + var isDefaultPrevented = function (e) { + return e.isDefaultPrevented(); + }; + var setMceInternalContent = function (e) { + var selectionHtml, internalContent; + if (e.dataTransfer) { + if (editor.selection.isCollapsed() && e.target.tagName === 'IMG') { + selection.select(e.target); + } + selectionHtml = editor.selection.getContent(); + if (selectionHtml.length > 0) { + internalContent = mceInternalUrlPrefix + escape(editor.id) + ',' + escape(selectionHtml); + e.dataTransfer.setData(mceInternalDataType, internalContent); + } + } + }; + var getMceInternalContent = function (e) { + var internalContent; + if (e.dataTransfer) { + internalContent = e.dataTransfer.getData(mceInternalDataType); + if (internalContent && internalContent.indexOf(mceInternalUrlPrefix) >= 0) { + internalContent = internalContent.substr(mceInternalUrlPrefix.length).split(','); + return { + id: unescape(internalContent[0]), + html: unescape(internalContent[1]) }; - editor.on('AfterSetSelectionRange', function (e) { - var rng = e.range; - var parentNode = rng.startContainer.parentNode; - if (!isRangeInCaretContainer(rng) && !isPasteBin(parentNode)) { - hideFakeCaret(); - } - if (!isFakeSelectionElement(parentNode)) { - removeElementSelection(); - } - }); - editor.on('copy', function (e) { - var clipboardData = e.clipboardData; - if (!e.isDefaultPrevented() && e.clipboardData && !Env.ie) { - var realSelectionElement = getRealSelectionElement(); - if (realSelectionElement) { - e.preventDefault(); - clipboardData.clearData(); - clipboardData.setData('text/html', realSelectionElement.outerHTML); - clipboardData.setData('text/plain', realSelectionElement.outerText || realSelectionElement.innerText); - } - } - }); - init(editor); - setup$l(editor); - setup$m(editor); - }; - var isWithinCaretContainer = function (node) { - return isCaretContainer(node) || startsWithCaretContainer(node) || endsWithCaretContainer(node); - }; - var isRangeInCaretContainer = function (rng) { - return isWithinCaretContainer(rng.startContainer) || isWithinCaretContainer(rng.endContainer); + } + } + return null; + }; + var insertClipboardContents = function (content, internal) { + if (editor.queryCommandSupported('mceInsertClipboardContent')) { + editor.execCommand('mceInsertClipboardContent', false, { + content: content, + internal: internal + }); + } else { + editor.execCommand('mceInsertContent', false, content); + } + }; + var emptyEditorWhenDeleting = function () { + var serializeRng = function (rng) { + var body = dom.create('body'); + var contents = rng.cloneContents(); + body.appendChild(contents); + return selection.serializer.serialize(body, { format: 'html' }); + }; + var allContentsSelected = function (rng) { + var selection = serializeRng(rng); + var allRng = dom.createRng(); + allRng.selectNode(editor.getBody()); + var allSelection = serializeRng(allRng); + return selection === allSelection; }; - var normalizeShortEndedElementSelection = function (rng) { - var shortEndedElements = editor.schema.getShortEndedElements(); - var newRng = dom.createRng(); - var startContainer = rng.startContainer; - var startOffset = rng.startOffset; - var endContainer = rng.endContainer; - var endOffset = rng.endOffset; - if (has(shortEndedElements, startContainer.nodeName.toLowerCase())) { - if (startOffset === 0) { - newRng.setStartBefore(startContainer); - } else { - newRng.setStartAfter(startContainer); - } - } else { - newRng.setStart(startContainer, startOffset); + editor.on('keydown', function (e) { + var keyCode = e.keyCode; + var isCollapsed, body; + if (!isDefaultPrevented(e) && (keyCode === DELETE || keyCode === BACKSPACE)) { + isCollapsed = editor.selection.isCollapsed(); + body = editor.getBody(); + if (isCollapsed && !dom.isEmpty(body)) { + return; } - if (has(shortEndedElements, endContainer.nodeName.toLowerCase())) { - if (endOffset === 0) { - newRng.setEndBefore(endContainer); - } else { - newRng.setEndAfter(endContainer); - } - } else { - newRng.setEnd(endContainer, endOffset); + if (!isCollapsed && !allContentsSelected(editor.selection.getRng())) { + return; } - return newRng; - }; - var setupOffscreenSelection = function (node, targetClone, origTargetClone) { - var $ = editor.$; - var $realSelectionContainer = descendant(SugarElement.fromDom(editor.getBody()), '#' + realSelectionId).fold(function () { - return $([]); - }, function (elm) { - return $([elm.dom]); - }); - if ($realSelectionContainer.length === 0) { - $realSelectionContainer = $('
              ').attr('id', realSelectionId); - $realSelectionContainer.appendTo(editor.getBody()); - } - var newRange = dom.createRng(); - if (targetClone === origTargetClone && Env.ie) { - $realSelectionContainer.empty().append('

              \xA0

              ').append(targetClone); - newRange.setStartAfter($realSelectionContainer[0].firstChild.firstChild); - newRange.setEndAfter(targetClone); + e.preventDefault(); + editor.setContent(''); + if (body.firstChild && dom.isBlock(body.firstChild)) { + editor.selection.setCursorLocation(body.firstChild, 0); } else { - $realSelectionContainer.empty().append(nbsp).append(targetClone).append(nbsp); - newRange.setStart($realSelectionContainer[0].firstChild, 1); - newRange.setEnd($realSelectionContainer[0].lastChild, 0); + editor.selection.setCursorLocation(body, 0); } - $realSelectionContainer.css({top: dom.getPos(node, editor.getBody()).y}); - $realSelectionContainer[0].focus(); - var sel = selection.getSel(); - sel.removeAllRanges(); - sel.addRange(newRange); - return newRange; - }; - var selectElement = function (elm) { - var targetClone = elm.cloneNode(true); - var e = editor.fire('ObjectSelected', { - target: elm, - targetClone: targetClone - }); - if (e.isDefaultPrevented()) { - return null; - } - var range = setupOffscreenSelection(elm, e.targetClone, targetClone); - var nodeElm = SugarElement.fromDom(elm); - each(descendants$1(SugarElement.fromDom(editor.getBody()), '*[data-mce-selected]'), function (elm) { - if (!eq$2(nodeElm, elm)) { - remove$1(elm, elementSelectionAttr); - } - }); - if (!dom.getAttrib(elm, elementSelectionAttr)) { - elm.setAttribute(elementSelectionAttr, '1'); + editor.nodeChanged(); + } + }); + }; + var selectAll = function () { + editor.shortcuts.add('meta+a', null, 'SelectAll'); + }; + var inputMethodFocus = function () { + if (!editor.inline) { + dom.bind(editor.getDoc(), 'mousedown mouseup', function (e) { + var rng; + if (e.target === editor.getDoc().documentElement) { + rng = selection.getRng(); + editor.getBody().focus(); + if (e.type === 'mousedown') { + if (isCaretContainer(rng.startContainer)) { + return; + } + selection.placeCaretAt(e.clientX, e.clientY); + } else { + selection.setRng(rng); + } } - selectedElement = elm; - hideFakeCaret(); - return range; - }; - var setElementSelection = function (range, forward) { - if (!range) { - return null; - } - if (range.collapsed) { - if (!isRangeInCaretContainer(range)) { - var dir = forward ? 1 : -1; - var caretPosition = getNormalizedRangeEndPoint(dir, rootNode, range); - var beforeNode = caretPosition.getNode(!forward); - if (isFakeCaretTarget(beforeNode)) { - return showCaret(dir, beforeNode, forward ? !caretPosition.isAtEnd() : false, false); - } - var afterNode = caretPosition.getNode(forward); - if (isFakeCaretTarget(afterNode)) { - return showCaret(dir, afterNode, forward ? false : !caretPosition.isAtEnd(), false); - } - } - return null; - } - var startContainer = range.startContainer; - var startOffset = range.startOffset; - var endOffset = range.endOffset; - if (startContainer.nodeType === 3 && startOffset === 0 && isContentEditableFalse$b(startContainer.parentNode)) { - startContainer = startContainer.parentNode; - startOffset = dom.nodeIndex(startContainer); - startContainer = startContainer.parentNode; - } - if (startContainer.nodeType !== 1) { - return null; - } - if (endOffset === startOffset + 1 && startContainer === range.endContainer) { - var node = startContainer.childNodes[startOffset]; - if (isFakeSelectionTargetElement(node)) { - return selectElement(node); - } + }); + } + }; + var removeHrOnBackspace = function () { + editor.on('keydown', function (e) { + if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) { + if (!editor.getBody().getElementsByTagName('hr').length) { + return; + } + if (selection.isCollapsed() && selection.getRng().startOffset === 0) { + var node = selection.getNode(); + var previousSibling = node.previousSibling; + if (node.nodeName === 'HR') { + dom.remove(node); + e.preventDefault(); + return; + } + if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === 'hr') { + dom.remove(previousSibling); + e.preventDefault(); + } } - return null; - }; - var removeElementSelection = function () { - if (selectedElement) { - selectedElement.removeAttribute(elementSelectionAttr); + } + }); + }; + var focusBody = function () { + if (!Range.prototype.getClientRects) { + editor.on('mousedown', function (e) { + if (!isDefaultPrevented(e) && e.target.nodeName === 'HTML') { + var body_1 = editor.getBody(); + body_1.blur(); + Delay.setEditorTimeout(editor, function () { + body_1.focus(); + }); } - descendant(SugarElement.fromDom(editor.getBody()), '#' + realSelectionId).each(remove); - selectedElement = null; - }; - var destroy = function () { - fakeCaret.destroy(); - selectedElement = null; - }; - var hideFakeCaret = function () { - fakeCaret.hide(); - }; - if (Env.ceFalse) { - registerEvents(); + }); } - return { - showCaret: showCaret, - showBlockCaretContainer: showBlockCaretContainer, - hideFakeCaret: hideFakeCaret, - destroy: destroy - }; - }; - - var Quirks = function (editor) { - var each = Tools.each; - var BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection, - parser = editor.parser; - var isGecko = Env.gecko, isIE = Env.ie, isWebKit = Env.webkit; - var mceInternalUrlPrefix = 'data:text/mce-internal,'; - var mceInternalDataType = isIE ? 'Text' : 'URL'; - var setEditorCommandState = function (cmd, state) { - try { - editor.getDoc().execCommand(cmd, false, state); - } catch (ex) { - } - }; - var isDefaultPrevented = function (e) { - return e.isDefaultPrevented(); - }; - var setMceInternalContent = function (e) { - var selectionHtml, internalContent; - if (e.dataTransfer) { - if (editor.selection.isCollapsed() && e.target.tagName === 'IMG') { - selection.select(e.target); - } - selectionHtml = editor.selection.getContent(); - if (selectionHtml.length > 0) { - internalContent = mceInternalUrlPrefix + escape(editor.id) + ',' + escape(selectionHtml); - e.dataTransfer.setData(mceInternalDataType, internalContent); - } - } - }; - var getMceInternalContent = function (e) { - var internalContent; - if (e.dataTransfer) { - internalContent = e.dataTransfer.getData(mceInternalDataType); - if (internalContent && internalContent.indexOf(mceInternalUrlPrefix) >= 0) { - internalContent = internalContent.substr(mceInternalUrlPrefix.length).split(','); - return { - id: unescape(internalContent[0]), - html: unescape(internalContent[1]) - }; - } - } - return null; - }; - var insertClipboardContents = function (content, internal) { - if (editor.queryCommandSupported('mceInsertClipboardContent')) { - editor.execCommand('mceInsertClipboardContent', false, { - content: content, - internal: internal - }); - } else { - editor.execCommand('mceInsertContent', false, content); - } - }; - var emptyEditorWhenDeleting = function () { - var serializeRng = function (rng) { - var body = dom.create('body'); - var contents = rng.cloneContents(); - body.appendChild(contents); - return selection.serializer.serialize(body, {format: 'html'}); - }; - var allContentsSelected = function (rng) { - var selection = serializeRng(rng); - var allRng = dom.createRng(); - allRng.selectNode(editor.getBody()); - var allSelection = serializeRng(allRng); - return selection === allSelection; - }; - editor.on('keydown', function (e) { - var keyCode = e.keyCode; - var isCollapsed, body; - if (!isDefaultPrevented(e) && (keyCode === DELETE || keyCode === BACKSPACE)) { - isCollapsed = editor.selection.isCollapsed(); - body = editor.getBody(); - if (isCollapsed && !dom.isEmpty(body)) { - return; - } - if (!isCollapsed && !allContentsSelected(editor.selection.getRng())) { - return; - } - e.preventDefault(); - editor.setContent(''); - if (body.firstChild && dom.isBlock(body.firstChild)) { - editor.selection.setCursorLocation(body.firstChild, 0); - } else { - editor.selection.setCursorLocation(body, 0); - } - editor.nodeChanged(); - } - }); - }; - var selectAll = function () { - editor.shortcuts.add('meta+a', null, 'SelectAll'); - }; - var inputMethodFocus = function () { - if (!editor.inline) { - dom.bind(editor.getDoc(), 'mousedown mouseup', function (e) { - var rng; - if (e.target === editor.getDoc().documentElement) { - rng = selection.getRng(); - editor.getBody().focus(); - if (e.type === 'mousedown') { - if (isCaretContainer(rng.startContainer)) { - return; - } - selection.placeCaretAt(e.clientX, e.clientY); - } else { - selection.setRng(rng); - } - } - }); - } - }; - var removeHrOnBackspace = function () { - editor.on('keydown', function (e) { - if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) { - if (!editor.getBody().getElementsByTagName('hr').length) { - return; - } - if (selection.isCollapsed() && selection.getRng().startOffset === 0) { - var node = selection.getNode(); - var previousSibling = node.previousSibling; - if (node.nodeName === 'HR') { - dom.remove(node); - e.preventDefault(); - return; - } - if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === 'hr') { - dom.remove(previousSibling); - e.preventDefault(); - } - } - } - }); - }; - var focusBody = function () { - if (!Range.prototype.getClientRects) { - editor.on('mousedown', function (e) { - if (!isDefaultPrevented(e) && e.target.nodeName === 'HTML') { - var body_1 = editor.getBody(); - body_1.blur(); - Delay.setEditorTimeout(editor, function () { - body_1.focus(); - }); - } - }); - } - }; - var selectControlElements = function () { - editor.on('click', function (e) { - var target = e.target; - if (/^(IMG|HR)$/.test(target.nodeName) && dom.getContentEditableParent(target) !== 'false') { - e.preventDefault(); - editor.selection.select(target); - editor.nodeChanged(); - } - if (target.nodeName === 'A' && dom.hasClass(target, 'mce-item-anchor')) { - e.preventDefault(); - selection.select(target); - } - }); - }; - var removeStylesWhenDeletingAcrossBlockElements = function () { - var getAttributeApplyFunction = function () { - var template = dom.getAttribs(selection.getStart().cloneNode(false)); - return function () { - var target = selection.getStart(); - if (target !== editor.getBody()) { - dom.setAttrib(target, 'style', null); - each(template, function (attr) { - target.setAttributeNode(attr.cloneNode(true)); - }); - } - }; - }; - var isSelectionAcrossElements = function () { - return !selection.isCollapsed() && dom.getParent(selection.getStart(), dom.isBlock) !== dom.getParent(selection.getEnd(), dom.isBlock); - }; - editor.on('keypress', function (e) { - var applyAttributes; - if (!isDefaultPrevented(e) && (e.keyCode === 8 || e.keyCode === 46) && isSelectionAcrossElements()) { - applyAttributes = getAttributeApplyFunction(); - editor.getDoc().execCommand('delete', false, null); - applyAttributes(); - e.preventDefault(); - return false; - } - }); - dom.bind(editor.getDoc(), 'cut', function (e) { - var applyAttributes; - if (!isDefaultPrevented(e) && isSelectionAcrossElements()) { - applyAttributes = getAttributeApplyFunction(); - Delay.setEditorTimeout(editor, function () { - applyAttributes(); - }); - } - }); - }; - var disableBackspaceIntoATable = function () { - editor.on('keydown', function (e) { - if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) { - if (selection.isCollapsed() && selection.getRng().startOffset === 0) { - var previousSibling = selection.getNode().previousSibling; - if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === 'table') { - e.preventDefault(); - return false; - } - } - } - }); - }; - var removeBlockQuoteOnBackSpace = function () { - editor.on('keydown', function (e) { - var rng, parent; - if (isDefaultPrevented(e) || e.keyCode !== VK.BACKSPACE) { - return; - } - rng = selection.getRng(); - var container = rng.startContainer; - var offset = rng.startOffset; - var root = dom.getRoot(); - parent = container; - if (!rng.collapsed || offset !== 0) { - return; - } - while (parent && parent.parentNode && parent.parentNode.firstChild === parent && parent.parentNode !== root) { - parent = parent.parentNode; - } - if (parent.tagName === 'BLOCKQUOTE') { - editor.formatter.toggle('blockquote', null, parent); - rng = dom.createRng(); - rng.setStart(container, 0); - rng.setEnd(container, 0); - selection.setRng(rng); - } - }); - }; - var setGeckoEditingOptions = function () { - var setOpts = function () { - setEditorCommandState('StyleWithCSS', false); - setEditorCommandState('enableInlineTableEditing', false); - if (!getObjectResizing(editor)) { - setEditorCommandState('enableObjectResizing', false); - } - }; - if (!isReadOnly(editor)) { - editor.on('BeforeExecCommand mousedown', setOpts); - } - }; - var addBrAfterLastLinks = function () { - var fixLinks = function () { - each(dom.select('a'), function (node) { - var parentNode = node.parentNode; - var root = dom.getRoot(); - if (parentNode.lastChild === node) { - while (parentNode && !dom.isBlock(parentNode)) { - if (parentNode.parentNode.lastChild !== parentNode || parentNode === root) { - return; - } - parentNode = parentNode.parentNode; - } - dom.add(parentNode, 'br', {'data-mce-bogus': 1}); - } - }); - }; - editor.on('SetContent ExecCommand', function (e) { - if (e.type === 'setcontent' || e.command === 'mceInsertLink') { - fixLinks(); - } - }); - }; - var setDefaultBlockType = function () { - if (getForcedRootBlock(editor)) { - editor.on('init', function () { - setEditorCommandState('DefaultParagraphSeparator', getForcedRootBlock(editor)); - }); - } - }; - var normalizeSelection = function () { - editor.on('keyup focusin mouseup', function (e) { - if (!VK.modifierPressed(e)) { - selection.normalize(); - } - }, true); - }; - var showBrokenImageIcon = function () { - editor.contentStyles.push('img:-moz-broken {' + '-moz-force-broken-image-icon:1;' + 'min-width:24px;' + 'min-height:24px' + '}'); - }; - var restoreFocusOnKeyDown = function () { - if (!editor.inline) { - editor.on('keydown', function () { - if (document.activeElement === document.body) { - editor.getWin().focus(); - } - }); - } - }; - var bodyHeight = function () { - if (!editor.inline) { - editor.contentStyles.push('body {min-height: 150px}'); - editor.on('click', function (e) { - var rng; - if (e.target.nodeName === 'HTML') { - if (Env.ie > 11) { - editor.getBody().focus(); - return; - } - rng = editor.selection.getRng(); - editor.getBody().focus(); - editor.selection.setRng(rng); - editor.selection.normalize(); - editor.nodeChanged(); - } - }); - } - }; - var blockCmdArrowNavigation = function () { - if (Env.mac) { - editor.on('keydown', function (e) { - if (VK.metaKeyPressed(e) && !e.shiftKey && (e.keyCode === 37 || e.keyCode === 39)) { - e.preventDefault(); - var selection_1 = editor.selection.getSel(); - selection_1.modify('move', e.keyCode === 37 ? 'backward' : 'forward', 'lineboundary'); - } - }); - } - }; - var disableAutoUrlDetect = function () { - setEditorCommandState('AutoUrlDetect', false); - }; - var tapLinksAndImages = function () { - editor.on('click', function (e) { - var elm = e.target; - do { - if (elm.tagName === 'A') { - e.preventDefault(); - return; - } - } while (elm = elm.parentNode); - }); - editor.contentStyles.push('.mce-content-body {-webkit-touch-callout: none}'); - }; - var blockFormSubmitInsideEditor = function () { - editor.on('init', function () { - editor.dom.bind(editor.getBody(), 'submit', function (e) { - e.preventDefault(); - }); - }); - }; - var removeAppleInterchangeBrs = function () { - parser.addNodeFilter('br', function (nodes) { - var i = nodes.length; - while (i--) { - if (nodes[i].attr('class') === 'Apple-interchange-newline') { - nodes[i].remove(); - } - } - }); - }; - var ieInternalDragAndDrop = function () { - editor.on('dragstart', function (e) { - setMceInternalContent(e); - }); - editor.on('drop', function (e) { - if (!isDefaultPrevented(e)) { - var internalContent = getMceInternalContent(e); - if (internalContent && internalContent.id !== editor.id) { - e.preventDefault(); - var rng = fromPoint$1(e.x, e.y, editor.getDoc()); - selection.setRng(rng); - insertClipboardContents(internalContent.html, true); - } - } + }; + var selectControlElements = function () { + editor.on('click', function (e) { + var target = e.target; + if (/^(IMG|HR)$/.test(target.nodeName) && dom.getContentEditableParent(target) !== 'false') { + e.preventDefault(); + editor.selection.select(target); + editor.nodeChanged(); + } + if (target.nodeName === 'A' && dom.hasClass(target, 'mce-item-anchor')) { + e.preventDefault(); + selection.select(target); + } + }); + }; + var removeStylesWhenDeletingAcrossBlockElements = function () { + var getAttributeApplyFunction = function () { + var template = dom.getAttribs(selection.getStart().cloneNode(false)); + return function () { + var target = selection.getStart(); + if (target !== editor.getBody()) { + dom.setAttrib(target, 'style', null); + each(template, function (attr) { + target.setAttributeNode(attr.cloneNode(true)); + }); + } + }; + }; + var isSelectionAcrossElements = function () { + return !selection.isCollapsed() && dom.getParent(selection.getStart(), dom.isBlock) !== dom.getParent(selection.getEnd(), dom.isBlock); + }; + editor.on('keypress', function (e) { + var applyAttributes; + if (!isDefaultPrevented(e) && (e.keyCode === 8 || e.keyCode === 46) && isSelectionAcrossElements()) { + applyAttributes = getAttributeApplyFunction(); + editor.getDoc().execCommand('delete', false, null); + applyAttributes(); + e.preventDefault(); + return false; + } + }); + dom.bind(editor.getDoc(), 'cut', function (e) { + var applyAttributes; + if (!isDefaultPrevented(e) && isSelectionAcrossElements()) { + applyAttributes = getAttributeApplyFunction(); + Delay.setEditorTimeout(editor, function () { + applyAttributes(); }); - }; - var refreshContentEditable = function () { - }; - var isHidden = function () { - if (!isGecko || editor.removed) { + } + }); + }; + var disableBackspaceIntoATable = function () { + editor.on('keydown', function (e) { + if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) { + if (selection.isCollapsed() && selection.getRng().startOffset === 0) { + var previousSibling = selection.getNode().previousSibling; + if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === 'table') { + e.preventDefault(); return false; + } } - var sel = editor.selection.getSel(); - return !sel || !sel.rangeCount || sel.rangeCount === 0; - }; - removeBlockQuoteOnBackSpace(); - emptyEditorWhenDeleting(); - if (!Env.windowsPhone) { - normalizeSelection(); - } - if (isWebKit) { - inputMethodFocus(); - selectControlElements(); - setDefaultBlockType(); - blockFormSubmitInsideEditor(); - disableBackspaceIntoATable(); - removeAppleInterchangeBrs(); - if (Env.iOS) { - restoreFocusOnKeyDown(); - bodyHeight(); - tapLinksAndImages(); - } else { - selectAll(); + } + }); + }; + var removeBlockQuoteOnBackSpace = function () { + editor.on('keydown', function (e) { + var rng, parent; + if (isDefaultPrevented(e) || e.keyCode !== VK.BACKSPACE) { + return; + } + rng = selection.getRng(); + var container = rng.startContainer; + var offset = rng.startOffset; + var root = dom.getRoot(); + parent = container; + if (!rng.collapsed || offset !== 0) { + return; + } + while (parent && parent.parentNode && parent.parentNode.firstChild === parent && parent.parentNode !== root) { + parent = parent.parentNode; + } + if (parent.tagName === 'BLOCKQUOTE') { + editor.formatter.toggle('blockquote', null, parent); + rng = dom.createRng(); + rng.setStart(container, 0); + rng.setEnd(container, 0); + selection.setRng(rng); + } + }); + }; + var setGeckoEditingOptions = function () { + var setOpts = function () { + setEditorCommandState('StyleWithCSS', false); + setEditorCommandState('enableInlineTableEditing', false); + if (!getObjectResizing(editor)) { + setEditorCommandState('enableObjectResizing', false); + } + }; + if (!isReadOnly(editor)) { + editor.on('BeforeExecCommand mousedown', setOpts); + } + }; + var addBrAfterLastLinks = function () { + var fixLinks = function () { + each(dom.select('a'), function (node) { + var parentNode = node.parentNode; + var root = dom.getRoot(); + if (parentNode.lastChild === node) { + while (parentNode && !dom.isBlock(parentNode)) { + if (parentNode.parentNode.lastChild !== parentNode || parentNode === root) { + return; + } + parentNode = parentNode.parentNode; + } + dom.add(parentNode, 'br', { 'data-mce-bogus': 1 }); + } + }); + }; + editor.on('SetContent ExecCommand', function (e) { + if (e.type === 'setcontent' || e.command === 'mceInsertLink') { + fixLinks(); + } + }); + }; + var setDefaultBlockType = function () { + if (getForcedRootBlock(editor)) { + editor.on('init', function () { + setEditorCommandState('DefaultParagraphSeparator', getForcedRootBlock(editor)); + }); + } + }; + var normalizeSelection = function () { + editor.on('keyup focusin mouseup', function (e) { + if (!VK.modifierPressed(e)) { + selection.normalize(); + } + }, true); + }; + var showBrokenImageIcon = function () { + editor.contentStyles.push('img:-moz-broken {' + '-moz-force-broken-image-icon:1;' + 'min-width:24px;' + 'min-height:24px' + '}'); + }; + var restoreFocusOnKeyDown = function () { + if (!editor.inline) { + editor.on('keydown', function () { + if (document.activeElement === document.body) { + editor.getWin().focus(); } + }); } - if (Env.ie >= 11) { - bodyHeight(); - disableBackspaceIntoATable(); - } - if (Env.ie) { - selectAll(); - disableAutoUrlDetect(); - ieInternalDragAndDrop(); - } - if (isGecko) { - removeHrOnBackspace(); - focusBody(); - removeStylesWhenDeletingAcrossBlockElements(); - setGeckoEditingOptions(); - addBrAfterLastLinks(); - showBrokenImageIcon(); - blockCmdArrowNavigation(); - disableBackspaceIntoATable(); + }; + var bodyHeight = function () { + if (!editor.inline) { + editor.contentStyles.push('body {min-height: 150px}'); + editor.on('click', function (e) { + var rng; + if (e.target.nodeName === 'HTML') { + if (Env.ie > 11) { + editor.getBody().focus(); + return; + } + rng = editor.selection.getRng(); + editor.getBody().focus(); + editor.selection.setRng(rng); + editor.selection.normalize(); + editor.nodeChanged(); + } + }); + } + }; + var blockCmdArrowNavigation = function () { + if (Env.mac) { + editor.on('keydown', function (e) { + if (VK.metaKeyPressed(e) && !e.shiftKey && (e.keyCode === 37 || e.keyCode === 39)) { + e.preventDefault(); + var selection_1 = editor.selection.getSel(); + selection_1.modify('move', e.keyCode === 37 ? 'backward' : 'forward', 'lineboundary'); + } + }); + } + }; + var disableAutoUrlDetect = function () { + setEditorCommandState('AutoUrlDetect', false); + }; + var tapLinksAndImages = function () { + editor.on('click', function (e) { + var elm = e.target; + do { + if (elm.tagName === 'A') { + e.preventDefault(); + return; + } + } while (elm = elm.parentNode); + }); + editor.contentStyles.push('.mce-content-body {-webkit-touch-callout: none}'); + }; + var blockFormSubmitInsideEditor = function () { + editor.on('init', function () { + editor.dom.bind(editor.getBody(), 'submit', function (e) { + e.preventDefault(); + }); + }); + }; + var removeAppleInterchangeBrs = function () { + parser.addNodeFilter('br', function (nodes) { + var i = nodes.length; + while (i--) { + if (nodes[i].attr('class') === 'Apple-interchange-newline') { + nodes[i].remove(); + } + } + }); + }; + var ieInternalDragAndDrop = function () { + editor.on('dragstart', function (e) { + setMceInternalContent(e); + }); + editor.on('drop', function (e) { + if (!isDefaultPrevented(e)) { + var internalContent = getMceInternalContent(e); + if (internalContent && internalContent.id !== editor.id) { + e.preventDefault(); + var rng = fromPoint$1(e.x, e.y, editor.getDoc()); + selection.setRng(rng); + insertClipboardContents(internalContent.html, true); + } + } + }); + }; + var refreshContentEditable = function () { + }; + var isHidden = function () { + if (!isGecko || editor.removed) { + return false; } - return { - refreshContentEditable: refreshContentEditable, - isHidden: isHidden - }; + var sel = editor.selection.getSel(); + return !sel || !sel.rangeCount || sel.rangeCount === 0; + }; + removeBlockQuoteOnBackSpace(); + emptyEditorWhenDeleting(); + if (!Env.windowsPhone) { + normalizeSelection(); + } + if (isWebKit) { + inputMethodFocus(); + selectControlElements(); + setDefaultBlockType(); + blockFormSubmitInsideEditor(); + disableBackspaceIntoATable(); + removeAppleInterchangeBrs(); + if (Env.iOS) { + restoreFocusOnKeyDown(); + bodyHeight(); + tapLinksAndImages(); + } else { + selectAll(); + } + } + if (Env.ie >= 11) { + bodyHeight(); + disableBackspaceIntoATable(); + } + if (Env.ie) { + selectAll(); + disableAutoUrlDetect(); + ieInternalDragAndDrop(); + } + if (isGecko) { + removeHrOnBackspace(); + focusBody(); + removeStylesWhenDeletingAcrossBlockElements(); + setGeckoEditingOptions(); + addBrAfterLastLinks(); + showBrokenImageIcon(); + blockCmdArrowNavigation(); + disableBackspaceIntoATable(); + } + return { + refreshContentEditable: refreshContentEditable, + isHidden: isHidden + }; }; var DOM$4 = DOMUtils$1.DOM; var appendStyle = function (editor, text) { - var body = SugarElement.fromDom(editor.getBody()); - var container = getStyleContainer(getRootNode(body)); - var style = SugarElement.fromTag('style'); - set(style, 'type', 'text/css'); - append(style, SugarElement.fromText(text)); - append(container, style); - editor.on('remove', function () { - remove(style); - }); + var body = SugarElement.fromDom(editor.getBody()); + var container = getStyleContainer(getRootNode(body)); + var style = SugarElement.fromTag('style'); + set(style, 'type', 'text/css'); + append(style, SugarElement.fromText(text)); + append(container, style); + editor.on('remove', function () { + remove(style); + }); }; var getRootName = function (editor) { - return editor.inline ? editor.getElement().nodeName.toLowerCase() : undefined; + return editor.inline ? editor.getElement().nodeName.toLowerCase() : undefined; }; var removeUndefined = function (obj) { - return filter$1(obj, function (v) { - return isUndefined(v) === false; - }); + return filter$1(obj, function (v) { + return isUndefined(v) === false; + }); }; var mkParserSettings = function (editor) { - var settings = editor.settings; - var blobCache = editor.editorUpload.blobCache; - return removeUndefined({ - allow_conditional_comments: settings.allow_conditional_comments, - allow_html_data_urls: settings.allow_html_data_urls, - allow_svg_data_urls: settings.allow_svg_data_urls, - allow_html_in_named_anchor: settings.allow_html_in_named_anchor, - allow_script_urls: settings.allow_script_urls, - allow_unsafe_link_target: settings.allow_unsafe_link_target, - convert_fonts_to_spans: settings.convert_fonts_to_spans, - fix_list_elements: settings.fix_list_elements, - font_size_legacy_values: settings.font_size_legacy_values, - forced_root_block: settings.forced_root_block, - forced_root_block_attrs: settings.forced_root_block_attrs, - padd_empty_with_br: settings.padd_empty_with_br, - preserve_cdata: settings.preserve_cdata, - remove_trailing_brs: settings.remove_trailing_brs, - inline_styles: settings.inline_styles, - root_name: getRootName(editor), - validate: true, - blob_cache: blobCache, - images_dataimg_filter: settings.images_dataimg_filter - }); + var settings = editor.settings; + var blobCache = editor.editorUpload.blobCache; + return removeUndefined({ + allow_conditional_comments: settings.allow_conditional_comments, + allow_html_data_urls: settings.allow_html_data_urls, + allow_svg_data_urls: settings.allow_svg_data_urls, + allow_html_in_named_anchor: settings.allow_html_in_named_anchor, + allow_script_urls: settings.allow_script_urls, + allow_unsafe_link_target: settings.allow_unsafe_link_target, + convert_fonts_to_spans: settings.convert_fonts_to_spans, + fix_list_elements: settings.fix_list_elements, + font_size_legacy_values: settings.font_size_legacy_values, + forced_root_block: settings.forced_root_block, + forced_root_block_attrs: settings.forced_root_block_attrs, + padd_empty_with_br: settings.padd_empty_with_br, + preserve_cdata: settings.preserve_cdata, + remove_trailing_brs: settings.remove_trailing_brs, + inline_styles: settings.inline_styles, + root_name: getRootName(editor), + validate: true, + blob_cache: blobCache, + images_dataimg_filter: settings.images_dataimg_filter + }); }; var mkSerializerSettings = function (editor) { - var settings = editor.settings; - return __assign(__assign({}, mkParserSettings(editor)), removeUndefined({ - url_converter: settings.url_converter, - url_converter_scope: settings.url_converter_scope, - element_format: settings.element_format, - entities: settings.entities, - entity_encoding: settings.entity_encoding, - indent: settings.indent, - indent_after: settings.indent_after, - indent_before: settings.indent_before, - block_elements: settings.block_elements, - boolean_attributes: settings.boolean_attributes, - custom_elements: settings.custom_elements, - extended_valid_elements: settings.extended_valid_elements, - invalid_elements: settings.invalid_elements, - invalid_styles: settings.invalid_styles, - move_caret_before_on_enter_elements: settings.move_caret_before_on_enter_elements, - non_empty_elements: settings.non_empty_elements, - schema: settings.schema, - self_closing_elements: settings.self_closing_elements, - short_ended_elements: settings.short_ended_elements, - special: settings.special, - text_block_elements: settings.text_block_elements, - text_inline_elements: settings.text_inline_elements, - valid_children: settings.valid_children, - valid_classes: settings.valid_classes, - valid_elements: settings.valid_elements, - valid_styles: settings.valid_styles, - verify_html: settings.verify_html, - whitespace_elements: settings.whitespace_elements - })); + var settings = editor.settings; + return __assign(__assign({}, mkParserSettings(editor)), removeUndefined({ + url_converter: settings.url_converter, + url_converter_scope: settings.url_converter_scope, + element_format: settings.element_format, + entities: settings.entities, + entity_encoding: settings.entity_encoding, + indent: settings.indent, + indent_after: settings.indent_after, + indent_before: settings.indent_before, + block_elements: settings.block_elements, + boolean_attributes: settings.boolean_attributes, + custom_elements: settings.custom_elements, + extended_valid_elements: settings.extended_valid_elements, + invalid_elements: settings.invalid_elements, + invalid_styles: settings.invalid_styles, + move_caret_before_on_enter_elements: settings.move_caret_before_on_enter_elements, + non_empty_elements: settings.non_empty_elements, + schema: settings.schema, + self_closing_elements: settings.self_closing_elements, + short_ended_elements: settings.short_ended_elements, + special: settings.special, + text_block_elements: settings.text_block_elements, + text_inline_elements: settings.text_inline_elements, + valid_children: settings.valid_children, + valid_classes: settings.valid_classes, + valid_elements: settings.valid_elements, + valid_styles: settings.valid_styles, + verify_html: settings.verify_html, + whitespace_elements: settings.whitespace_elements + })); }; var createParser = function (editor) { - var parser = DomParser(mkParserSettings(editor), editor.schema); - parser.addAttributeFilter('src,href,style,tabindex', function (nodes, name) { - var i = nodes.length, node, value; - var dom = editor.dom; - var internalName = 'data-mce-' + name; - while (i--) { - node = nodes[i]; - value = node.attr(name); - if (value && !node.attr(internalName)) { - if (value.indexOf('data:') === 0 || value.indexOf('blob:') === 0) { - continue; - } - if (name === 'style') { - value = dom.serializeStyle(dom.parseStyle(value), node.name); - if (!value.length) { - value = null; - } - node.attr(internalName, value); - node.attr(name, value); - } else if (name === 'tabindex') { - node.attr(internalName, value); - node.attr(name, null); - } else { - node.attr(internalName, editor.convertURL(value, name, node.name)); - } - } - } - }); - parser.addNodeFilter('script', function (nodes) { - var i = nodes.length; - while (i--) { - var node = nodes[i]; - var type = node.attr('type') || 'no/type'; - if (type.indexOf('mce-') !== 0) { - node.attr('type', 'mce-' + type); - } + var parser = DomParser(mkParserSettings(editor), editor.schema); + parser.addAttributeFilter('src,href,style,tabindex', function (nodes, name) { + var i = nodes.length, node, value; + var dom = editor.dom; + var internalName = 'data-mce-' + name; + while (i--) { + node = nodes[i]; + value = node.attr(name); + if (value && !node.attr(internalName)) { + if (value.indexOf('data:') === 0 || value.indexOf('blob:') === 0) { + continue; + } + if (name === 'style') { + value = dom.serializeStyle(dom.parseStyle(value), node.name); + if (!value.length) { + value = null; + } + node.attr(internalName, value); + node.attr(name, value); + } else if (name === 'tabindex') { + node.attr(internalName, value); + node.attr(name, null); + } else { + node.attr(internalName, editor.convertURL(value, name, node.name)); } - }); - if (editor.settings.preserve_cdata) { - parser.addNodeFilter('#cdata', function (nodes) { - var i = nodes.length; - while (i--) { - var node = nodes[i]; - node.type = 8; - node.name = '#comment'; - node.value = '[CDATA[' + editor.dom.encode(node.value) + ']]'; - } - }); + } } - parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function (nodes) { - var i = nodes.length; - var nonEmptyElements = editor.schema.getNonEmptyElements(); - while (i--) { - var node = nodes[i]; - if (node.isEmpty(nonEmptyElements) && node.getAll('br').length === 0) { - node.append(new AstNode('br', 1)).shortEnded = true; - } - } - }); - return parser; + }); + parser.addNodeFilter('script', function (nodes) { + var i = nodes.length; + while (i--) { + var node = nodes[i]; + var type = node.attr('type') || 'no/type'; + if (type.indexOf('mce-') !== 0) { + node.attr('type', 'mce-' + type); + } + } + }); + if (editor.settings.preserve_cdata) { + parser.addNodeFilter('#cdata', function (nodes) { + var i = nodes.length; + while (i--) { + var node = nodes[i]; + node.type = 8; + node.name = '#comment'; + node.value = '[CDATA[' + editor.dom.encode(node.value) + ']]'; + } + }); + } + parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function (nodes) { + var i = nodes.length; + var nonEmptyElements = editor.schema.getNonEmptyElements(); + while (i--) { + var node = nodes[i]; + if (node.isEmpty(nonEmptyElements) && node.getAll('br').length === 0) { + node.append(new AstNode('br', 1)).shortEnded = true; + } + } + }); + return parser; }; var autoFocus = function (editor) { - if (editor.settings.auto_focus) { - Delay.setEditorTimeout(editor, function () { - var focusEditor; - if (editor.settings.auto_focus === true) { - focusEditor = editor; - } else { - focusEditor = editor.editorManager.get(editor.settings.auto_focus); - } - if (!focusEditor.destroyed) { - focusEditor.focus(); - } - }, 100); - } + if (editor.settings.auto_focus) { + Delay.setEditorTimeout(editor, function () { + var focusEditor; + if (editor.settings.auto_focus === true) { + focusEditor = editor; + } else { + focusEditor = editor.editorManager.get(editor.settings.auto_focus); + } + if (!focusEditor.destroyed) { + focusEditor.focus(); + } + }, 100); + } }; var moveSelectionToFirstCaretPosition = function (editor) { - var root = editor.dom.getRoot(); - if (!editor.inline && (!hasAnyRanges(editor) || editor.selection.getStart(true) === root)) { - firstPositionIn(root).each(function (pos) { - var node = pos.getNode(); - var caretPos = isTable(node) ? firstPositionIn(node).getOr(pos) : pos; - if (Env.browser.isIE()) { - storeNative(editor, caretPos.toRange()); - } else { - editor.selection.setRng(caretPos.toRange()); - } - }); - } + var root = editor.dom.getRoot(); + if (!editor.inline && (!hasAnyRanges(editor) || editor.selection.getStart(true) === root)) { + firstPositionIn(root).each(function (pos) { + var node = pos.getNode(); + var caretPos = isTable(node) ? firstPositionIn(node).getOr(pos) : pos; + if (Env.browser.isIE()) { + storeNative(editor, caretPos.toRange()); + } else { + editor.selection.setRng(caretPos.toRange()); + } + }); + } }; var initEditor = function (editor) { - editor.bindPendingEventDelegates(); - editor.initialized = true; - fireInit(editor); - editor.focus(true); - moveSelectionToFirstCaretPosition(editor); - editor.nodeChanged({initial: true}); - editor.execCallback('init_instance_callback', editor); - autoFocus(editor); + editor.bindPendingEventDelegates(); + editor.initialized = true; + fireInit(editor); + editor.focus(true); + moveSelectionToFirstCaretPosition(editor); + editor.nodeChanged({ initial: true }); + editor.execCallback('init_instance_callback', editor); + autoFocus(editor); }; var getStyleSheetLoader = function (editor) { - return editor.inline ? editor.ui.styleSheetLoader : editor.dom.styleSheetLoader; + return editor.inline ? editor.ui.styleSheetLoader : editor.dom.styleSheetLoader; }; var loadContentCss = function (editor, css) { - var styleSheetLoader = getStyleSheetLoader(editor); - var loaded = function () { - editor.on('remove', function () { - return styleSheetLoader.unloadAll(css); - }); - initEditor(editor); - }; - styleSheetLoader.loadAll(css, loaded, loaded); + var styleSheetLoader = getStyleSheetLoader(editor); + var loaded = function () { + editor.on('remove', function () { + return styleSheetLoader.unloadAll(css); + }); + initEditor(editor); + }; + styleSheetLoader.loadAll(css, loaded, loaded); }; var preInit = function (editor, rtcMode) { - var settings = editor.settings, doc = editor.getDoc(), body = editor.getBody(); - if (!settings.browser_spellcheck && !settings.gecko_spellcheck) { - doc.body.spellcheck = false; - DOM$4.setAttrib(body, 'spellcheck', 'false'); - } - editor.quirks = Quirks(editor); - firePostRender(editor); - var directionality = getDirectionality(editor); - if (directionality !== undefined) { - body.dir = directionality; - } - if (settings.protect) { - editor.on('BeforeSetContent', function (e) { - Tools.each(settings.protect, function (pattern) { - e.content = e.content.replace(pattern, function (str) { - return ''; - }); - }); - }); - } - editor.on('SetContent', function () { - editor.addVisual(editor.getBody()); - }); - if (rtcMode === false) { - editor.load({ - initial: true, - format: 'html' - }); - } - editor.startContent = editor.getContent({format: 'raw'}); - editor.on('compositionstart compositionend', function (e) { - editor.composing = e.type === 'compositionstart'; - }); - if (editor.contentStyles.length > 0) { - var contentCssText_1 = ''; - Tools.each(editor.contentStyles, function (style) { - contentCssText_1 += style + '\r\n'; - }); - editor.dom.addStyle(contentCssText_1); - } - loadContentCss(editor, editor.contentCSS); - if (settings.content_style) { - appendStyle(editor, settings.content_style); - } + var settings = editor.settings, doc = editor.getDoc(), body = editor.getBody(); + if (!settings.browser_spellcheck && !settings.gecko_spellcheck) { + doc.body.spellcheck = false; + DOM$4.setAttrib(body, 'spellcheck', 'false'); + } + editor.quirks = Quirks(editor); + firePostRender(editor); + var directionality = getDirectionality(editor); + if (directionality !== undefined) { + body.dir = directionality; + } + if (settings.protect) { + editor.on('BeforeSetContent', function (e) { + Tools.each(settings.protect, function (pattern) { + e.content = e.content.replace(pattern, function (str) { + return ''; + }); + }); + }); + } + editor.on('SetContent', function () { + editor.addVisual(editor.getBody()); + }); + if (rtcMode === false) { + editor.load({ + initial: true, + format: 'html' + }); + } + editor.startContent = editor.getContent({ format: 'raw' }); + editor.on('compositionstart compositionend', function (e) { + editor.composing = e.type === 'compositionstart'; + }); + if (editor.contentStyles.length > 0) { + var contentCssText_1 = ''; + Tools.each(editor.contentStyles, function (style) { + contentCssText_1 += style + '\r\n'; + }); + editor.dom.addStyle(contentCssText_1); + } + loadContentCss(editor, editor.contentCSS); + if (settings.content_style) { + appendStyle(editor, settings.content_style); + } }; var initContentBody = function (editor, skipWrite) { - var settings = editor.settings; - var targetElm = editor.getElement(); - var doc = editor.getDoc(); - if (!settings.inline) { - editor.getElement().style.visibility = editor.orgVisibility; - } - if (!skipWrite && !editor.inline) { - doc.open(); - doc.write(editor.iframeHTML); - doc.close(); - } - if (editor.inline) { - DOM$4.addClass(targetElm, 'mce-content-body'); - editor.contentDocument = doc = document; - editor.contentWindow = window; - editor.bodyElement = targetElm; - editor.contentAreaContainer = targetElm; - } - var body = editor.getBody(); - body.disabled = true; - editor.readonly = !!settings.readonly; - if (!editor.readonly) { - if (editor.inline && DOM$4.getStyle(body, 'position', true) === 'static') { - body.style.position = 'relative'; - } - body.contentEditable = editor.getParam('content_editable_state', true); - } - body.disabled = false; - editor.editorUpload = EditorUpload(editor); - editor.schema = Schema(settings); - editor.dom = DOMUtils$1(doc, { - keep_values: true, - url_converter: editor.convertURL, - url_converter_scope: editor, - hex_colors: settings.force_hex_style_colors, - update_styles: true, - root_element: editor.inline ? editor.getBody() : null, - collect: function () { - return editor.inline; - }, - schema: editor.schema, - contentCssCors: shouldUseContentCssCors(editor), - referrerPolicy: getReferrerPolicy(editor), - onSetAttrib: function (e) { - editor.fire('SetAttrib', e); - } - }); - editor.parser = createParser(editor); - editor.serializer = DomSerializer(mkSerializerSettings(editor), editor); - editor.selection = EditorSelection(editor.dom, editor.getWin(), editor.serializer, editor); - editor.annotator = Annotator(editor); - editor.formatter = Formatter(editor); - editor.undoManager = UndoManager(editor); - editor._nodeChangeDispatcher = new NodeChange(editor); - editor._selectionOverrides = SelectionOverrides(editor); - setup$9(editor); - setup$j(editor); - if (!isRtc(editor)) { - setup$k(editor); - } - var caret = setup$i(editor); - setup$8(editor, caret); - setup$a(editor); - setup$7(editor); - firePreInit(editor); - setup$5(editor).fold(function () { - preInit(editor, false); - }, function (loadingRtc) { - editor.setProgressState(true); - loadingRtc.then(function (rtcMode) { - editor.setProgressState(false); - preInit(editor, rtcMode); - }); - }); + var settings = editor.settings; + var targetElm = editor.getElement(); + var doc = editor.getDoc(); + if (!settings.inline) { + editor.getElement().style.visibility = editor.orgVisibility; + } + if (!skipWrite && !editor.inline) { + doc.open(); + doc.write(editor.iframeHTML); + doc.close(); + } + if (editor.inline) { + DOM$4.addClass(targetElm, 'mce-content-body'); + editor.contentDocument = doc = document; + editor.contentWindow = window; + editor.bodyElement = targetElm; + editor.contentAreaContainer = targetElm; + } + var body = editor.getBody(); + body.disabled = true; + editor.readonly = !!settings.readonly; + if (!editor.readonly) { + if (editor.inline && DOM$4.getStyle(body, 'position', true) === 'static') { + body.style.position = 'relative'; + } + body.contentEditable = editor.getParam('content_editable_state', true); + } + body.disabled = false; + editor.editorUpload = EditorUpload(editor); + editor.schema = Schema(settings); + editor.dom = DOMUtils$1(doc, { + keep_values: true, + url_converter: editor.convertURL, + url_converter_scope: editor, + hex_colors: settings.force_hex_style_colors, + update_styles: true, + root_element: editor.inline ? editor.getBody() : null, + collect: function () { + return editor.inline; + }, + schema: editor.schema, + contentCssCors: shouldUseContentCssCors(editor), + referrerPolicy: getReferrerPolicy(editor), + onSetAttrib: function (e) { + editor.fire('SetAttrib', e); + } + }); + editor.parser = createParser(editor); + editor.serializer = DomSerializer(mkSerializerSettings(editor), editor); + editor.selection = EditorSelection(editor.dom, editor.getWin(), editor.serializer, editor); + editor.annotator = Annotator(editor); + editor.formatter = Formatter(editor); + editor.undoManager = UndoManager(editor); + editor._nodeChangeDispatcher = new NodeChange(editor); + editor._selectionOverrides = SelectionOverrides(editor); + setup$9(editor); + setup$j(editor); + if (!isRtc(editor)) { + setup$k(editor); + } + var caret = setup$i(editor); + setup$8(editor, caret); + setup$a(editor); + setup$7(editor); + firePreInit(editor); + setup$5(editor).fold(function () { + preInit(editor, false); + }, function (loadingRtc) { + editor.setProgressState(true); + loadingRtc.then(function (rtcMode) { + editor.setProgressState(false); + preInit(editor, rtcMode); + }); + }); }; var DOM$5 = DOMUtils$1.DOM; var relaxDomain = function (editor, ifr) { - if (document.domain !== window.location.hostname && Env.browser.isIE()) { - var bodyUuid = uuid('mce'); - editor[bodyUuid] = function () { - initContentBody(editor); - }; - var domainRelaxUrl = 'javascript:(function(){' + 'document.open();document.domain="' + document.domain + '";' + 'var ed = window.parent.tinymce.get("' + editor.id + '");document.write(ed.iframeHTML);' + 'document.close();ed.' + bodyUuid + '(true);})()'; - DOM$5.setAttrib(ifr, 'src', domainRelaxUrl); - return true; - } - return false; + if (document.domain !== window.location.hostname && Env.browser.isIE()) { + var bodyUuid = uuid('mce'); + editor[bodyUuid] = function () { + initContentBody(editor); + }; + var domainRelaxUrl = 'javascript:(function(){' + 'document.open();document.domain="' + document.domain + '";' + 'var ed = window.parent.tinymce.get("' + editor.id + '");document.write(ed.iframeHTML);' + 'document.close();ed.' + bodyUuid + '(true);})()'; + DOM$5.setAttrib(ifr, 'src', domainRelaxUrl); + return true; + } + return false; }; var createIframeElement = function (id, title, height, customAttrs) { - var iframe = SugarElement.fromTag('iframe'); - setAll(iframe, customAttrs); - setAll(iframe, { - id: id + '_ifr', - frameBorder: '0', - allowTransparency: 'true', - title: title - }); - add$3(iframe, 'tox-edit-area__iframe'); - return iframe; + var iframe = SugarElement.fromTag('iframe'); + setAll(iframe, customAttrs); + setAll(iframe, { + id: id + '_ifr', + frameBorder: '0', + allowTransparency: 'true', + title: title + }); + add$3(iframe, 'tox-edit-area__iframe'); + return iframe; }; var getIframeHtml = function (editor) { - var iframeHTML = getDocType(editor) + ''; - if (getDocumentBaseUrl(editor) !== editor.documentBaseUrl) { - iframeHTML += ''; - } - iframeHTML += ''; - var bodyId = getBodyId(editor); - var bodyClass = getBodyClass(editor); - if (getContentSecurityPolicy(editor)) { - iframeHTML += ''; - } - iframeHTML += '
              '; - return iframeHTML; + var iframeHTML = getDocType(editor) + ''; + if (getDocumentBaseUrl(editor) !== editor.documentBaseUrl) { + iframeHTML += ''; + } + iframeHTML += ''; + var bodyId = getBodyId(editor); + var bodyClass = getBodyClass(editor); + if (getContentSecurityPolicy(editor)) { + iframeHTML += ''; + } + iframeHTML += '
              '; + return iframeHTML; }; var createIframe = function (editor, o) { - var title = editor.editorManager.translate('Rich Text Area. Press ALT-0 for help.'); - var ifr = createIframeElement(editor.id, title, o.height, getIframeAttrs(editor)).dom; - ifr.onload = function () { - ifr.onload = null; - editor.fire('load'); - }; - var isDomainRelaxed = relaxDomain(editor, ifr); - editor.contentAreaContainer = o.iframeContainer; - editor.iframeElement = ifr; - editor.iframeHTML = getIframeHtml(editor); - DOM$5.add(o.iframeContainer, ifr); - return isDomainRelaxed; + var title = editor.editorManager.translate('Rich Text Area. Press ALT-0 for help.'); + var ifr = createIframeElement(editor.id, title, o.height, getIframeAttrs(editor)).dom; + ifr.onload = function () { + ifr.onload = null; + editor.fire('load'); + }; + var isDomainRelaxed = relaxDomain(editor, ifr); + editor.contentAreaContainer = o.iframeContainer; + editor.iframeElement = ifr; + editor.iframeHTML = getIframeHtml(editor); + DOM$5.add(o.iframeContainer, ifr); + return isDomainRelaxed; }; var init$1 = function (editor, boxInfo) { - var isDomainRelaxed = createIframe(editor, boxInfo); - if (boxInfo.editorContainer) { - DOM$5.get(boxInfo.editorContainer).style.display = editor.orgDisplay; - editor.hidden = DOM$5.isHidden(boxInfo.editorContainer); - } - editor.getElement().style.display = 'none'; - DOM$5.setAttrib(editor.id, 'aria-hidden', 'true'); - if (!isDomainRelaxed) { - initContentBody(editor); - } + var isDomainRelaxed = createIframe(editor, boxInfo); + if (boxInfo.editorContainer) { + DOM$5.get(boxInfo.editorContainer).style.display = editor.orgDisplay; + editor.hidden = DOM$5.isHidden(boxInfo.editorContainer); + } + editor.getElement().style.display = 'none'; + DOM$5.setAttrib(editor.id, 'aria-hidden', 'true'); + if (!isDomainRelaxed) { + initContentBody(editor); + } }; var DOM$6 = DOMUtils$1.DOM; var initPlugin = function (editor, initializedPlugins, plugin) { - var Plugin = PluginManager.get(plugin); - var pluginUrl = PluginManager.urls[plugin] || editor.documentBaseUrl.replace(/\/$/, ''); - plugin = Tools.trim(plugin); - if (Plugin && Tools.inArray(initializedPlugins, plugin) === -1) { - Tools.each(PluginManager.dependencies(plugin), function (dep) { - initPlugin(editor, initializedPlugins, dep); - }); - if (editor.plugins[plugin]) { - return; - } - try { - var pluginInstance = new Plugin(editor, pluginUrl, editor.$); - editor.plugins[plugin] = pluginInstance; - if (pluginInstance.init) { - pluginInstance.init(editor, pluginUrl); - initializedPlugins.push(plugin); - } - } catch (e) { - pluginInitError(editor, plugin, e); - } + var Plugin = PluginManager.get(plugin); + var pluginUrl = PluginManager.urls[plugin] || editor.documentBaseUrl.replace(/\/$/, ''); + plugin = Tools.trim(plugin); + if (Plugin && Tools.inArray(initializedPlugins, plugin) === -1) { + Tools.each(PluginManager.dependencies(plugin), function (dep) { + initPlugin(editor, initializedPlugins, dep); + }); + if (editor.plugins[plugin]) { + return; + } + try { + var pluginInstance = new Plugin(editor, pluginUrl, editor.$); + editor.plugins[plugin] = pluginInstance; + if (pluginInstance.init) { + pluginInstance.init(editor, pluginUrl); + initializedPlugins.push(plugin); + } + } catch (e) { + pluginInitError(editor, plugin, e); } + } }; var trimLegacyPrefix = function (name) { - return name.replace(/^\-/, ''); + return name.replace(/^\-/, ''); }; var initPlugins = function (editor) { - var initializedPlugins = []; - Tools.each(getPlugins(editor).split(/[ ,]/), function (name) { - initPlugin(editor, initializedPlugins, trimLegacyPrefix(name)); - }); + var initializedPlugins = []; + Tools.each(getPlugins(editor).split(/[ ,]/), function (name) { + initPlugin(editor, initializedPlugins, trimLegacyPrefix(name)); + }); }; var initIcons = function (editor) { - var iconPackName = Tools.trim(getIconPackName(editor)); - var currentIcons = editor.ui.registry.getAll().icons; - var loadIcons = __assign(__assign({}, IconManager.get('default').icons), IconManager.get(iconPackName).icons); - each$1(loadIcons, function (svgData, icon) { - if (!has(currentIcons, icon)) { - editor.ui.registry.addIcon(icon, svgData); - } - }); + var iconPackName = Tools.trim(getIconPackName(editor)); + var currentIcons = editor.ui.registry.getAll().icons; + var loadIcons = __assign(__assign({}, IconManager.get('default').icons), IconManager.get(iconPackName).icons); + each$1(loadIcons, function (svgData, icon) { + if (!has(currentIcons, icon)) { + editor.ui.registry.addIcon(icon, svgData); + } + }); }; var initTheme = function (editor) { - var theme = getTheme(editor); - if (isString(theme)) { - editor.settings.theme = trimLegacyPrefix(theme); - var Theme = ThemeManager.get(theme); - editor.theme = new Theme(editor, ThemeManager.urls[theme]); - if (editor.theme.init) { - editor.theme.init(editor, ThemeManager.urls[theme] || editor.documentBaseUrl.replace(/\/$/, ''), editor.$); - } - } else { - editor.theme = {}; - } + var theme = getTheme(editor); + if (isString(theme)) { + editor.settings.theme = trimLegacyPrefix(theme); + var Theme = ThemeManager.get(theme); + editor.theme = new Theme(editor, ThemeManager.urls[theme]); + if (editor.theme.init) { + editor.theme.init(editor, ThemeManager.urls[theme] || editor.documentBaseUrl.replace(/\/$/, ''), editor.$); + } + } else { + editor.theme = {}; + } }; var renderFromLoadedTheme = function (editor) { - return editor.theme.renderUI(); + return editor.theme.renderUI(); }; var renderFromThemeFunc = function (editor) { - var elm = editor.getElement(); - var theme = getTheme(editor); - var info = theme(editor, elm); - if (info.editorContainer.nodeType) { - info.editorContainer.id = info.editorContainer.id || editor.id + '_parent'; - } - if (info.iframeContainer && info.iframeContainer.nodeType) { - info.iframeContainer.id = info.iframeContainer.id || editor.id + '_iframecontainer'; - } - info.height = info.iframeHeight ? info.iframeHeight : elm.offsetHeight; - return info; + var elm = editor.getElement(); + var theme = getTheme(editor); + var info = theme(editor, elm); + if (info.editorContainer.nodeType) { + info.editorContainer.id = info.editorContainer.id || editor.id + '_parent'; + } + if (info.iframeContainer && info.iframeContainer.nodeType) { + info.iframeContainer.id = info.iframeContainer.id || editor.id + '_iframecontainer'; + } + info.height = info.iframeHeight ? info.iframeHeight : elm.offsetHeight; + return info; }; var createThemeFalseResult = function (element) { - return { - editorContainer: element, - iframeContainer: element, - api: {} - }; + return { + editorContainer: element, + iframeContainer: element, + api: {} + }; }; var renderThemeFalseIframe = function (targetElement) { - var iframeContainer = DOM$6.create('div'); - DOM$6.insertAfter(iframeContainer, targetElement); - return createThemeFalseResult(iframeContainer); + var iframeContainer = DOM$6.create('div'); + DOM$6.insertAfter(iframeContainer, targetElement); + return createThemeFalseResult(iframeContainer); }; var renderThemeFalse = function (editor) { - var targetElement = editor.getElement(); - return editor.inline ? createThemeFalseResult(null) : renderThemeFalseIframe(targetElement); + var targetElement = editor.getElement(); + return editor.inline ? createThemeFalseResult(null) : renderThemeFalseIframe(targetElement); }; var renderThemeUi = function (editor) { - var elm = editor.getElement(); - editor.orgDisplay = elm.style.display; - if (isString(getTheme(editor))) { - return renderFromLoadedTheme(editor); - } else if (isFunction(getTheme(editor))) { - return renderFromThemeFunc(editor); - } else { - return renderThemeFalse(editor); - } + var elm = editor.getElement(); + editor.orgDisplay = elm.style.display; + if (isString(getTheme(editor))) { + return renderFromLoadedTheme(editor); + } else if (isFunction(getTheme(editor))) { + return renderFromThemeFunc(editor); + } else { + return renderThemeFalse(editor); + } }; var augmentEditorUiApi = function (editor, api) { - var uiApiFacade = { - show: Optional.from(api.show).getOr(noop), - hide: Optional.from(api.hide).getOr(noop), - disable: Optional.from(api.disable).getOr(noop), - isDisabled: Optional.from(api.isDisabled).getOr(never), - enable: function () { - if (!editor.mode.isReadOnly()) { - Optional.from(api.enable).map(call); - } - } - }; - editor.ui = __assign(__assign({}, editor.ui), uiApiFacade); + var uiApiFacade = { + show: Optional.from(api.show).getOr(noop), + hide: Optional.from(api.hide).getOr(noop), + disable: Optional.from(api.disable).getOr(noop), + isDisabled: Optional.from(api.isDisabled).getOr(never), + enable: function () { + if (!editor.mode.isReadOnly()) { + Optional.from(api.enable).map(call); + } + } + }; + editor.ui = __assign(__assign({}, editor.ui), uiApiFacade); }; var init$2 = function (editor) { - editor.fire('ScriptsLoaded'); - initIcons(editor); - initTheme(editor); - initPlugins(editor); - var renderInfo = renderThemeUi(editor); - augmentEditorUiApi(editor, Optional.from(renderInfo.api).getOr({})); - var boxInfo = { - editorContainer: renderInfo.editorContainer, - iframeContainer: renderInfo.iframeContainer - }; - editor.editorContainer = boxInfo.editorContainer ? boxInfo.editorContainer : null; - appendContentCssFromSettings(editor); - if (editor.inline) { - return initContentBody(editor); - } else { - return init$1(editor, boxInfo); - } + editor.fire('ScriptsLoaded'); + initIcons(editor); + initTheme(editor); + initPlugins(editor); + var renderInfo = renderThemeUi(editor); + augmentEditorUiApi(editor, Optional.from(renderInfo.api).getOr({})); + var boxInfo = { + editorContainer: renderInfo.editorContainer, + iframeContainer: renderInfo.iframeContainer + }; + editor.editorContainer = boxInfo.editorContainer ? boxInfo.editorContainer : null; + appendContentCssFromSettings(editor); + if (editor.inline) { + return initContentBody(editor); + } else { + return init$1(editor, boxInfo); + } }; var DOM$7 = DOMUtils$1.DOM; var hasSkipLoadPrefix = function (name) { - return name.charAt(0) === '-'; + return name.charAt(0) === '-'; }; var loadLanguage = function (scriptLoader, editor) { - var languageCode = getLanguageCode(editor); - var languageUrl = getLanguageUrl(editor); - if (I18n.hasCode(languageCode) === false && languageCode !== 'en') { - var url_1 = languageUrl !== '' ? languageUrl : editor.editorManager.baseURL + '/langs/' + languageCode + '.js'; - scriptLoader.add(url_1, noop, undefined, function () { - languageLoadError(editor, url_1, languageCode); - }); - } + var languageCode = getLanguageCode(editor); + var languageUrl = getLanguageUrl(editor); + if (I18n.hasCode(languageCode) === false && languageCode !== 'en') { + var url_1 = languageUrl !== '' ? languageUrl : editor.editorManager.baseURL + '/langs/' + languageCode + '.js'; + scriptLoader.add(url_1, noop, undefined, function () { + languageLoadError(editor, url_1, languageCode); + }); + } }; var loadTheme = function (scriptLoader, editor, suffix, callback) { - var theme = getTheme(editor); - if (isString(theme)) { - if (!hasSkipLoadPrefix(theme) && !ThemeManager.urls.hasOwnProperty(theme)) { - var themeUrl = getThemeUrl(editor); - if (themeUrl) { - ThemeManager.load(theme, editor.documentBaseURI.toAbsolute(themeUrl)); - } else { - ThemeManager.load(theme, 'themes/' + theme + '/theme' + suffix + '.js'); - } - } - scriptLoader.loadQueue(function () { - ThemeManager.waitFor(theme, callback); - }); - } else { - callback(); - } + var theme = getTheme(editor); + if (isString(theme)) { + if (!hasSkipLoadPrefix(theme) && !ThemeManager.urls.hasOwnProperty(theme)) { + var themeUrl = getThemeUrl(editor); + if (themeUrl) { + ThemeManager.load(theme, editor.documentBaseURI.toAbsolute(themeUrl)); + } else { + ThemeManager.load(theme, 'themes/' + theme + '/theme' + suffix + '.js'); + } + } + scriptLoader.loadQueue(function () { + ThemeManager.waitFor(theme, callback); + }); + } else { + callback(); + } }; var getIconsUrlMetaFromUrl = function (editor) { - return Optional.from(getIconsUrl(editor)).filter(function (url) { - return url.length > 0; - }).map(function (url) { - return { - url: url, - name: Optional.none() - }; - }); + return Optional.from(getIconsUrl(editor)).filter(function (url) { + return url.length > 0; + }).map(function (url) { + return { + url: url, + name: Optional.none() + }; + }); }; var getIconsUrlMetaFromName = function (editor, name, suffix) { - return Optional.from(name).filter(function (name) { - return name.length > 0 && !IconManager.has(name); - }).map(function (name) { - return { - url: editor.editorManager.baseURL + '/icons/' + name + '/icons' + suffix + '.js', - name: Optional.some(name) - }; - }); + return Optional.from(name).filter(function (name) { + return name.length > 0 && !IconManager.has(name); + }).map(function (name) { + return { + url: editor.editorManager.baseURL + '/icons/' + name + '/icons' + suffix + '.js', + name: Optional.some(name) + }; + }); }; var loadIcons = function (scriptLoader, editor, suffix) { - var defaultIconsUrl = getIconsUrlMetaFromName(editor, 'default', suffix); - var customIconsUrl = getIconsUrlMetaFromUrl(editor).orThunk(function () { - return getIconsUrlMetaFromName(editor, getIconPackName(editor), ''); - }); - each(cat([ - defaultIconsUrl, - customIconsUrl - ]), function (urlMeta) { - scriptLoader.add(urlMeta.url, noop, undefined, function () { - iconsLoadError(editor, urlMeta.url, urlMeta.name.getOrUndefined()); - }); - }); + var defaultIconsUrl = getIconsUrlMetaFromName(editor, 'default', suffix); + var customIconsUrl = getIconsUrlMetaFromUrl(editor).orThunk(function () { + return getIconsUrlMetaFromName(editor, getIconPackName(editor), ''); + }); + each(cat([ + defaultIconsUrl, + customIconsUrl + ]), function (urlMeta) { + scriptLoader.add(urlMeta.url, noop, undefined, function () { + iconsLoadError(editor, urlMeta.url, urlMeta.name.getOrUndefined()); + }); + }); }; var loadPlugins = function (editor, suffix) { - Tools.each(getExternalPlugins(editor), function (url, name) { - PluginManager.load(name, url, noop, undefined, function () { - pluginLoadError(editor, url, name); - }); - editor.settings.plugins += ' ' + name; - }); - Tools.each(getPlugins(editor).split(/[ ,]/), function (plugin) { - plugin = Tools.trim(plugin); - if (plugin && !PluginManager.urls[plugin]) { - if (hasSkipLoadPrefix(plugin)) { - plugin = plugin.substr(1, plugin.length); - var dependencies = PluginManager.dependencies(plugin); - Tools.each(dependencies, function (depPlugin) { - var defaultSettings = { - prefix: 'plugins/', - resource: depPlugin, - suffix: '/plugin' + suffix + '.js' - }; - var dep = PluginManager.createUrl(defaultSettings, depPlugin); - PluginManager.load(dep.resource, dep, noop, undefined, function () { - pluginLoadError(editor, dep.prefix + dep.resource + dep.suffix, dep.resource); - }); - }); - } else { - var url_2 = { - prefix: 'plugins/', - resource: plugin, - suffix: '/plugin' + suffix + '.js' - }; - PluginManager.load(plugin, url_2, noop, undefined, function () { - pluginLoadError(editor, url_2.prefix + url_2.resource + url_2.suffix, plugin); - }); - } - } + Tools.each(getExternalPlugins(editor), function (url, name) { + PluginManager.load(name, url, noop, undefined, function () { + pluginLoadError(editor, url, name); }); + editor.settings.plugins += ' ' + name; + }); + Tools.each(getPlugins(editor).split(/[ ,]/), function (plugin) { + plugin = Tools.trim(plugin); + if (plugin && !PluginManager.urls[plugin]) { + if (hasSkipLoadPrefix(plugin)) { + plugin = plugin.substr(1, plugin.length); + var dependencies = PluginManager.dependencies(plugin); + Tools.each(dependencies, function (depPlugin) { + var defaultSettings = { + prefix: 'plugins/', + resource: depPlugin, + suffix: '/plugin' + suffix + '.js' + }; + var dep = PluginManager.createUrl(defaultSettings, depPlugin); + PluginManager.load(dep.resource, dep, noop, undefined, function () { + pluginLoadError(editor, dep.prefix + dep.resource + dep.suffix, dep.resource); + }); + }); + } else { + var url_2 = { + prefix: 'plugins/', + resource: plugin, + suffix: '/plugin' + suffix + '.js' + }; + PluginManager.load(plugin, url_2, noop, undefined, function () { + pluginLoadError(editor, url_2.prefix + url_2.resource + url_2.suffix, plugin); + }); + } + } + }); }; var loadScripts = function (editor, suffix) { - var scriptLoader = ScriptLoader.ScriptLoader; - loadTheme(scriptLoader, editor, suffix, function () { - loadLanguage(scriptLoader, editor); - loadIcons(scriptLoader, editor, suffix); - loadPlugins(editor, suffix); - scriptLoader.loadQueue(function () { - if (!editor.removed) { - init$2(editor); - } - }, editor, function () { - if (!editor.removed) { - init$2(editor); - } - }); - }); + var scriptLoader = ScriptLoader.ScriptLoader; + loadTheme(scriptLoader, editor, suffix, function () { + loadLanguage(scriptLoader, editor); + loadIcons(scriptLoader, editor, suffix); + loadPlugins(editor, suffix); + scriptLoader.loadQueue(function () { + if (!editor.removed) { + init$2(editor); + } + }, editor, function () { + if (!editor.removed) { + init$2(editor); + } + }); + }); }; var getStyleSheetLoader$1 = function (element, editor) { - return instance.forElement(element, { - contentCssCors: hasContentCssCors(editor), - referrerPolicy: getReferrerPolicy(editor) - }); + return instance.forElement(element, { + contentCssCors: hasContentCssCors(editor), + referrerPolicy: getReferrerPolicy(editor) + }); }; var render = function (editor) { - var id = editor.id; - I18n.setCode(getLanguageCode(editor)); - var readyHandler = function () { - DOM$7.unbind(window, 'ready', readyHandler); - editor.render(); - }; - if (!EventUtils.Event.domLoaded) { - DOM$7.bind(window, 'ready', readyHandler); - return; - } - if (!editor.getElement()) { - return; - } - if (!Env.contentEditable) { - return; - } - var element = SugarElement.fromDom(editor.getElement()); - var snapshot = clone(element); - editor.on('remove', function () { - eachr(element.dom.attributes, function (attr) { - return remove$1(element, attr.name); - }); - setAll(element, snapshot); - }); - editor.ui.styleSheetLoader = getStyleSheetLoader$1(element, editor); - if (!isInline$1(editor)) { - editor.orgVisibility = editor.getElement().style.visibility; - editor.getElement().style.visibility = 'hidden'; - } else { - editor.inline = true; - } - var form = editor.getElement().form || DOM$7.getParent(id, 'form'); - if (form) { - editor.formElement = form; - if (hasHiddenInput(editor) && !isTextareaOrInput(editor.getElement())) { - DOM$7.insertAfter(DOM$7.create('input', { - type: 'hidden', - name: id - }), id); - editor.hasHiddenInput = true; - } - editor.formEventDelegate = function (e) { - editor.fire(e.type, e); - }; - DOM$7.bind(form, 'submit reset', editor.formEventDelegate); - editor.on('reset', function () { - editor.resetContent(); - }); - if (shouldPatchSubmit(editor) && !form.submit.nodeType && !form.submit.length && !form._mceOldSubmit) { - form._mceOldSubmit = form.submit; - form.submit = function () { - editor.editorManager.triggerSave(); - editor.setDirty(false); - return form._mceOldSubmit(form); - }; - } - } - editor.windowManager = WindowManager(editor); - editor.notificationManager = NotificationManager(editor); - if (isEncodingXml(editor)) { - editor.on('GetContent', function (e) { - if (e.save) { - e.content = DOM$7.encode(e.content); - } - }); - } - if (shouldAddFormSubmitTrigger(editor)) { - editor.on('submit', function () { - if (editor.initialized) { - editor.save(); - } - }); - } - if (shouldAddUnloadTrigger(editor)) { - editor._beforeUnload = function () { - if (editor.initialized && !editor.destroyed && !editor.isHidden()) { - editor.save({ - format: 'raw', - no_events: true, - set_dirty: false - }); - } - }; - editor.editorManager.on('BeforeUnload', editor._beforeUnload); - } - editor.editorManager.add(editor); - loadScripts(editor, editor.suffix); + var id = editor.id; + I18n.setCode(getLanguageCode(editor)); + var readyHandler = function () { + DOM$7.unbind(window, 'ready', readyHandler); + editor.render(); + }; + if (!EventUtils.Event.domLoaded) { + DOM$7.bind(window, 'ready', readyHandler); + return; + } + if (!editor.getElement()) { + return; + } + if (!Env.contentEditable) { + return; + } + var element = SugarElement.fromDom(editor.getElement()); + var snapshot = clone(element); + editor.on('remove', function () { + eachr(element.dom.attributes, function (attr) { + return remove$1(element, attr.name); + }); + setAll(element, snapshot); + }); + editor.ui.styleSheetLoader = getStyleSheetLoader$1(element, editor); + if (!isInline$1(editor)) { + editor.orgVisibility = editor.getElement().style.visibility; + editor.getElement().style.visibility = 'hidden'; + } else { + editor.inline = true; + } + var form = editor.getElement().form || DOM$7.getParent(id, 'form'); + if (form) { + editor.formElement = form; + if (hasHiddenInput(editor) && !isTextareaOrInput(editor.getElement())) { + DOM$7.insertAfter(DOM$7.create('input', { + type: 'hidden', + name: id + }), id); + editor.hasHiddenInput = true; + } + editor.formEventDelegate = function (e) { + editor.fire(e.type, e); + }; + DOM$7.bind(form, 'submit reset', editor.formEventDelegate); + editor.on('reset', function () { + editor.resetContent(); + }); + if (shouldPatchSubmit(editor) && !form.submit.nodeType && !form.submit.length && !form._mceOldSubmit) { + form._mceOldSubmit = form.submit; + form.submit = function () { + editor.editorManager.triggerSave(); + editor.setDirty(false); + return form._mceOldSubmit(form); + }; + } + } + editor.windowManager = WindowManager(editor); + editor.notificationManager = NotificationManager(editor); + if (isEncodingXml(editor)) { + editor.on('GetContent', function (e) { + if (e.save) { + e.content = DOM$7.encode(e.content); + } + }); + } + if (shouldAddFormSubmitTrigger(editor)) { + editor.on('submit', function () { + if (editor.initialized) { + editor.save(); + } + }); + } + if (shouldAddUnloadTrigger(editor)) { + editor._beforeUnload = function () { + if (editor.initialized && !editor.destroyed && !editor.isHidden()) { + editor.save({ + format: 'raw', + no_events: true, + set_dirty: false + }); + } + }; + editor.editorManager.on('BeforeUnload', editor._beforeUnload); + } + editor.editorManager.add(editor); + loadScripts(editor, editor.suffix); }; var addVisual$1 = function (editor, elm) { - return addVisual(editor, elm); + return addVisual(editor, elm); }; var legacyPropNames = { - 'font-size': 'size', - 'font-family': 'face' + 'font-size': 'size', + 'font-family': 'face' }; var getSpecifiedFontProp = function (propName, rootElm, elm) { - var getProperty = function (elm) { - return getRaw(elm, propName).orThunk(function () { - if (name(elm) === 'font') { - return get$1(legacyPropNames, propName).bind(function (legacyPropName) { - return getOpt(elm, legacyPropName); - }); - } else { - return Optional.none(); - } + var getProperty = function (elm) { + return getRaw(elm, propName).orThunk(function () { + if (name(elm) === 'font') { + return get$1(legacyPropNames, propName).bind(function (legacyPropName) { + return getOpt(elm, legacyPropName); }); - }; - var isRoot = function (elm) { - return eq$2(SugarElement.fromDom(rootElm), elm); - }; - return closest$2(SugarElement.fromDom(elm), function (elm) { - return getProperty(elm); - }, isRoot); + } else { + return Optional.none(); + } + }); + }; + var isRoot = function (elm) { + return eq$2(SugarElement.fromDom(rootElm), elm); + }; + return closest$2(SugarElement.fromDom(elm), function (elm) { + return getProperty(elm); + }, isRoot); }; var normalizeFontFamily = function (fontFamily) { - return fontFamily.replace(/[\'\"\\]/g, '').replace(/,\s+/g, ','); + return fontFamily.replace(/[\'\"\\]/g, '').replace(/,\s+/g, ','); }; var getComputedFontProp = function (propName, elm) { - return Optional.from(DOMUtils$1.DOM.getStyle(elm, propName, true)); + return Optional.from(DOMUtils$1.DOM.getStyle(elm, propName, true)); }; var getFontProp = function (propName) { - return function (rootElm, elm) { - return Optional.from(elm).map(SugarElement.fromDom).filter(isElement).bind(function (element) { - return getSpecifiedFontProp(propName, rootElm, element.dom).or(getComputedFontProp(propName, element.dom)); - }).getOr(''); - }; + return function (rootElm, elm) { + return Optional.from(elm).map(SugarElement.fromDom).filter(isElement).bind(function (element) { + return getSpecifiedFontProp(propName, rootElm, element.dom).or(getComputedFontProp(propName, element.dom)); + }).getOr(''); + }; }; var getFontSize = getFontProp('font-size'); var getFontFamily = compose(normalizeFontFamily, getFontProp('font-family')); var findFirstCaretElement = function (editor) { - return firstPositionIn(editor.getBody()).map(function (caret) { - var container = caret.container(); - return isText$1(container) ? container.parentNode : container; - }); + return firstPositionIn(editor.getBody()).map(function (caret) { + var container = caret.container(); + return isText$1(container) ? container.parentNode : container; + }); }; var getCaretElement = function (editor) { - return Optional.from(editor.selection.getRng()).bind(function (rng) { - var root = editor.getBody(); - var atStartOfNode = rng.startContainer === root && rng.startOffset === 0; - return atStartOfNode ? Optional.none() : Optional.from(editor.selection.getStart(true)); - }); + return Optional.from(editor.selection.getRng()).bind(function (rng) { + var root = editor.getBody(); + var atStartOfNode = rng.startContainer === root && rng.startOffset === 0; + return atStartOfNode ? Optional.none() : Optional.from(editor.selection.getStart(true)); + }); }; var mapRange = function (editor, mapper) { - return getCaretElement(editor).orThunk(curry(findFirstCaretElement, editor)).map(SugarElement.fromDom).filter(isElement).map(mapper); + return getCaretElement(editor).orThunk(curry(findFirstCaretElement, editor)).map(SugarElement.fromDom).filter(isElement).map(mapper); }; var fromFontSizeNumber = function (editor, value) { - if (/^[0-9.]+$/.test(value)) { - var fontSizeNumber = parseInt(value, 10); - if (fontSizeNumber >= 1 && fontSizeNumber <= 7) { - var fontSizes = getFontStyleValues(editor); - var fontClasses = getFontSizeClasses(editor); - if (fontClasses) { - return fontClasses[fontSizeNumber - 1] || value; - } else { - return fontSizes[fontSizeNumber - 1] || value; - } - } else { - return value; - } + if (/^[0-9.]+$/.test(value)) { + var fontSizeNumber = parseInt(value, 10); + if (fontSizeNumber >= 1 && fontSizeNumber <= 7) { + var fontSizes = getFontStyleValues(editor); + var fontClasses = getFontSizeClasses(editor); + if (fontClasses) { + return fontClasses[fontSizeNumber - 1] || value; + } else { + return fontSizes[fontSizeNumber - 1] || value; + } } else { - return value; + return value; } + } else { + return value; + } }; var normalizeFontNames = function (font) { - var fonts = font.split(/\s*,\s*/); - return map(fonts, function (font) { - if (font.indexOf(' ') !== -1 && !(startsWith(font, '"') || startsWith(font, '\''))) { - return '\'' + font + '\''; - } else { - return font; - } - }).join(','); + var fonts = font.split(/\s*,\s*/); + return map(fonts, function (font) { + if (font.indexOf(' ') !== -1 && !(startsWith(font, '"') || startsWith(font, '\''))) { + return '\'' + font + '\''; + } else { + return font; + } + }).join(','); }; var fontNameAction = function (editor, value) { - var font = fromFontSizeNumber(editor, value); - editor.formatter.toggle('fontname', {value: normalizeFontNames(font)}); - editor.nodeChanged(); + var font = fromFontSizeNumber(editor, value); + editor.formatter.toggle('fontname', { value: normalizeFontNames(font) }); + editor.nodeChanged(); }; var fontNameQuery = function (editor) { - return mapRange(editor, function (elm) { - return getFontFamily(editor.getBody(), elm.dom); - }).getOr(''); + return mapRange(editor, function (elm) { + return getFontFamily(editor.getBody(), elm.dom); + }).getOr(''); }; var fontSizeAction = function (editor, value) { - editor.formatter.toggle('fontsize', {value: fromFontSizeNumber(editor, value)}); - editor.nodeChanged(); + editor.formatter.toggle('fontsize', { value: fromFontSizeNumber(editor, value) }); + editor.nodeChanged(); }; var fontSizeQuery = function (editor) { - return mapRange(editor, function (elm) { - return getFontSize(editor.getBody(), elm.dom); - }).getOr(''); + return mapRange(editor, function (elm) { + return getFontSize(editor.getBody(), elm.dom); + }).getOr(''); }; var lineHeightQuery = function (editor) { - return mapRange(editor, function (elm) { - var root = SugarElement.fromDom(editor.getBody()); - var specifiedStyle = closest$2(elm, function (elm) { - return getRaw(elm, 'line-height'); - }, curry(eq$2, root)); - var computedStyle = function () { - var lineHeight = parseFloat(get$5(elm, 'line-height')); - var fontSize = parseFloat(get$5(elm, 'font-size')); - return String(lineHeight / fontSize); - }; - return specifiedStyle.getOrThunk(computedStyle); - }).getOr(''); + return mapRange(editor, function (elm) { + var root = SugarElement.fromDom(editor.getBody()); + var specifiedStyle = closest$2(elm, function (elm) { + return getRaw(elm, 'line-height'); + }, curry(eq$2, root)); + var computedStyle = function () { + var lineHeight = parseFloat(get$5(elm, 'line-height')); + var fontSize = parseFloat(get$5(elm, 'font-size')); + return String(lineHeight / fontSize); + }; + return specifiedStyle.getOrThunk(computedStyle); + }).getOr(''); }; var lineHeightAction = function (editor, lineHeight) { - editor.undoManager.transact(function () { - editor.formatter.toggle('lineheight', {value: String(lineHeight)}); - editor.nodeChanged(); - }); + editor.undoManager.transact(function () { + editor.formatter.toggle('lineheight', { value: String(lineHeight) }); + editor.nodeChanged(); + }); }; var processValue = function (value) { - var details; - if (typeof value !== 'string') { - details = Tools.extend({ - paste: value.paste, - data: {paste: value.paste} - }, value); - return { - content: value.content, - details: details - }; - } + var details; + if (typeof value !== 'string') { + details = Tools.extend({ + paste: value.paste, + data: { paste: value.paste } + }, value); return { - content: value, - details: {} + content: value.content, + details: details }; + } + return { + content: value, + details: {} + }; }; var insertAtCaret$1 = function (editor, value) { - var result = processValue(value); - insertContent(editor, result.content, result.details); + var result = processValue(value); + insertContent(editor, result.content, result.details); }; var each$f = Tools.each; var map$3 = Tools.map, inArray$2 = Tools.inArray; var EditorCommands = function () { - function EditorCommands(editor) { - this.commands = { - state: {}, - exec: {}, - value: {} - }; - this.editor = editor; - this.setupCommands(editor); - } - - EditorCommands.prototype.execCommand = function (command, ui, value, args) { - var func, state = false; - var self = this; - if (self.editor.removed) { - return; - } - if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(command) && (!args || !args.skip_focus)) { - self.editor.focus(); - } else { - restore(self.editor); - } - args = self.editor.fire('BeforeExecCommand', { - command: command, - ui: ui, - value: value - }); - if (args.isDefaultPrevented()) { - return false; - } - var customCommand = command.toLowerCase(); - if (func = self.commands.exec[customCommand]) { - func(customCommand, ui, value); - self.editor.fire('ExecCommand', { - command: command, - ui: ui, - value: value - }); - return true; - } - each$f(this.editor.plugins, function (p) { - if (p.execCommand && p.execCommand(command, ui, value)) { - self.editor.fire('ExecCommand', { - command: command, - ui: ui, - value: value - }); - state = true; - return false; - } - }); - if (state) { - return state; - } - if (self.editor.theme && self.editor.theme.execCommand && self.editor.theme.execCommand(command, ui, value)) { - self.editor.fire('ExecCommand', { - command: command, - ui: ui, - value: value - }); - return true; - } - try { - state = self.editor.getDoc().execCommand(command, ui, value); - } catch (ex) { - } - if (state) { - self.editor.fire('ExecCommand', { - command: command, - ui: ui, - value: value - }); - return true; - } - return false; - }; - EditorCommands.prototype.queryCommandState = function (command) { - var func; - if (this.editor.quirks.isHidden() || this.editor.removed) { - return; - } - command = command.toLowerCase(); - if (func = this.commands.state[command]) { - return func(command); - } - try { - return this.editor.getDoc().queryCommandState(command); - } catch (ex) { - } - return false; - }; - EditorCommands.prototype.queryCommandValue = function (command) { - var func; - if (this.editor.quirks.isHidden() || this.editor.removed) { - return; - } - command = command.toLowerCase(); - if (func = this.commands.value[command]) { - return func(command); - } - try { - return this.editor.getDoc().queryCommandValue(command); - } catch (ex) { - } - }; - EditorCommands.prototype.addCommands = function (commandList, type) { - if (type === void 0) { - type = 'exec'; - } - var self = this; - each$f(commandList, function (callback, command) { - each$f(command.toLowerCase().split(','), function (command) { - self.commands[type][command] = callback; - }); - }); - }; - EditorCommands.prototype.addCommand = function (command, callback, scope) { - var _this = this; - command = command.toLowerCase(); - this.commands.exec[command] = function (command, ui, value, args) { - return callback.call(scope || _this.editor, ui, value, args); - }; - }; - EditorCommands.prototype.queryCommandSupported = function (command) { - command = command.toLowerCase(); - if (this.commands.exec[command]) { - return true; - } - try { - return this.editor.getDoc().queryCommandSupported(command); - } catch (ex) { - } - return false; - }; - EditorCommands.prototype.addQueryStateHandler = function (command, callback, scope) { - var _this = this; - command = command.toLowerCase(); - this.commands.state[command] = function () { - return callback.call(scope || _this.editor); - }; - }; - EditorCommands.prototype.addQueryValueHandler = function (command, callback, scope) { - var _this = this; - command = command.toLowerCase(); - this.commands.value[command] = function () { - return callback.call(scope || _this.editor); - }; - }; - EditorCommands.prototype.hasCustomCommand = function (command) { - command = command.toLowerCase(); - return !!this.commands.exec[command]; - }; - EditorCommands.prototype.execNativeCommand = function (command, ui, value) { - if (ui === undefined) { - ui = false; - } - if (value === undefined) { - value = null; - } - return this.editor.getDoc().execCommand(command, ui, value); - }; - EditorCommands.prototype.isFormatMatch = function (name) { - return this.editor.formatter.match(name); - }; - EditorCommands.prototype.toggleFormat = function (name, value) { - this.editor.formatter.toggle(name, value ? {value: value} : undefined); - this.editor.nodeChanged(); - }; - EditorCommands.prototype.storeSelection = function (type) { - this.selectionBookmark = this.editor.selection.getBookmark(type); - }; - EditorCommands.prototype.restoreSelection = function () { - this.editor.selection.moveToBookmark(this.selectionBookmark); - }; - EditorCommands.prototype.setupCommands = function (editor) { - var self = this; - this.addCommands({ - 'mceResetDesignMode,mceBeginUndoLevel': function () { - }, - 'mceEndUndoLevel,mceAddUndoLevel': function () { - editor.undoManager.add(); - }, - 'Cut,Copy,Paste': function (command) { - var doc = editor.getDoc(); - var failed; - try { - self.execNativeCommand(command); - } catch (ex) { - failed = true; - } - if (command === 'paste' && !doc.queryCommandEnabled(command)) { - failed = true; - } - if (failed || !doc.queryCommandSupported(command)) { - var msg = editor.translate('Your browser doesn\'t support direct access to the clipboard. ' + 'Please use the Ctrl+X/C/V keyboard shortcuts instead.'); - if (Env.mac) { - msg = msg.replace(/Ctrl\+/g, '\u2318+'); - } - editor.notificationManager.open({ - text: msg, - type: 'error' - }); - } - }, - 'unlink': function () { - if (editor.selection.isCollapsed()) { - var elm = editor.dom.getParent(editor.selection.getStart(), 'a'); - if (elm) { - editor.dom.remove(elm, true); - } - return; - } - editor.formatter.remove('link'); - }, - 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone': function (command) { - var align = command.substring(7); - if (align === 'full') { - align = 'justify'; - } - each$f('left,center,right,justify'.split(','), function (name) { - if (align !== name) { - editor.formatter.remove('align' + name); - } - }); - if (align !== 'none') { - self.toggleFormat('align' + align); - } - }, - 'InsertUnorderedList,InsertOrderedList': function (command) { - var listParent; - self.execNativeCommand(command); - var listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul'); - if (listElm) { - listParent = listElm.parentNode; - if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) { - self.storeSelection(); - editor.dom.split(listParent, listElm); - self.restoreSelection(); - } - } - }, - 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function (command) { - self.toggleFormat(command); - }, - 'ForeColor,HiliteColor': function (command, ui, value) { - self.toggleFormat(command, value); - }, - 'FontName': function (command, ui, value) { - fontNameAction(editor, value); - }, - 'FontSize': function (command, ui, value) { - fontSizeAction(editor, value); - }, - 'LineHeight': function (command, ui, value) { - lineHeightAction(editor, value); - }, - 'RemoveFormat': function (command) { - editor.formatter.remove(command); - }, - 'mceBlockQuote': function () { - self.toggleFormat('blockquote'); - }, - 'FormatBlock': function (command, ui, value) { - return self.toggleFormat(value || 'p'); - }, - 'mceCleanup': function () { - var bookmark = editor.selection.getBookmark(); - editor.setContent(editor.getContent()); - editor.selection.moveToBookmark(bookmark); - }, - 'mceRemoveNode': function (command, ui, value) { - var node = value || editor.selection.getNode(); - if (node !== editor.getBody()) { - self.storeSelection(); - editor.dom.remove(node, true); - self.restoreSelection(); - } - }, - 'mceSelectNodeDepth': function (command, ui, value) { - var counter = 0; - editor.dom.getParent(editor.selection.getNode(), function (node) { - if (node.nodeType === 1 && counter++ === value) { - editor.selection.select(node); - return false; - } - }, editor.getBody()); - }, - 'mceSelectNode': function (command, ui, value) { - editor.selection.select(value); - }, - 'mceInsertContent': function (command, ui, value) { - insertAtCaret$1(editor, value); - }, - 'mceInsertRawHTML': function (command, ui, value) { - editor.selection.setContent('tiny_mce_marker'); - var content = editor.getContent(); - editor.setContent(content.replace(/tiny_mce_marker/g, function () { - return value; - })); - }, - 'mceInsertNewLine': function (command, ui, value) { - insert$3(editor, value); - }, - 'mceToggleFormat': function (command, ui, value) { - self.toggleFormat(value); - }, - 'mceSetContent': function (command, ui, value) { - editor.setContent(value); - }, - 'Indent,Outdent': function (command) { - handle(editor, command); - }, - 'mceRepaint': function () { - }, - 'InsertHorizontalRule': function () { - editor.execCommand('mceInsertContent', false, '
              '); - }, - 'mceToggleVisualAid': function () { - editor.hasVisual = !editor.hasVisual; - editor.addVisual(); - }, - 'mceReplaceContent': function (command, ui, value) { - editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, editor.selection.getContent({format: 'text'}))); - }, - 'mceInsertLink': function (command, ui, value) { - if (typeof value === 'string') { - value = {href: value}; - } - var anchor = editor.dom.getParent(editor.selection.getNode(), 'a'); - value.href = value.href.replace(/ /g, '%20'); - if (!anchor || !value.href) { - editor.formatter.remove('link'); - } - if (value.href) { - editor.formatter.apply('link', value, anchor); - } - }, - 'selectAll': function () { - var editingHost = editor.dom.getParent(editor.selection.getStart(), isContentEditableTrue); - if (editingHost) { - var rng = editor.dom.createRng(); - rng.selectNodeContents(editingHost); - editor.selection.setRng(rng); - } - }, - 'mceNewDocument': function () { - editor.setContent(''); - }, - 'InsertLineBreak': function (command, ui, value) { - insert$2(editor, value); - return true; - } - }); - var alignStates = function (name) { - return function () { - var selection = editor.selection; - var nodes = selection.isCollapsed() ? [editor.dom.getParent(selection.getNode(), editor.dom.isBlock)] : selection.getSelectedBlocks(); - var matches = map$3(nodes, function (node) { - return !!editor.formatter.matchNode(node, name); - }); - return inArray$2(matches, true) !== -1; - }; - }; - self.addCommands({ - 'JustifyLeft': alignStates('alignleft'), - 'JustifyCenter': alignStates('aligncenter'), - 'JustifyRight': alignStates('alignright'), - 'JustifyFull': alignStates('alignjustify'), - 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function (command) { - return self.isFormatMatch(command); - }, - 'mceBlockQuote': function () { - return self.isFormatMatch('blockquote'); - }, - 'Outdent': function () { - return canOutdent(editor); - }, - 'InsertUnorderedList,InsertOrderedList': function (command) { - var list = editor.dom.getParent(editor.selection.getNode(), 'ul,ol'); - return list && (command === 'insertunorderedlist' && list.tagName === 'UL' || command === 'insertorderedlist' && list.tagName === 'OL'); - } - }, 'state'); - self.addCommands({ - Undo: function () { - editor.undoManager.undo(); - }, - Redo: function () { - editor.undoManager.redo(); - } - }); - self.addQueryValueHandler('FontName', function () { - return fontNameQuery(editor); - }, this); - self.addQueryValueHandler('FontSize', function () { - return fontSizeQuery(editor); - }, this); - self.addQueryValueHandler('LineHeight', function () { - return lineHeightQuery(editor); - }, this); - }; - return EditorCommands; - }(); - - var internalContentEditableAttr = 'data-mce-contenteditable'; - var toggleClass = function (elm, cls, state) { - if (has$2(elm, cls) && state === false) { - remove$4(elm, cls); - } else if (state) { - add$3(elm, cls); + function EditorCommands(editor) { + this.commands = { + state: {}, + exec: {}, + value: {} + }; + this.editor = editor; + this.setupCommands(editor); + } + EditorCommands.prototype.execCommand = function (command, ui, value, args) { + var func, state = false; + var self = this; + if (self.editor.removed) { + return; } - }; - var setEditorCommandState = function (editor, cmd, state) { - try { - editor.getDoc().execCommand(cmd, false, String(state)); - } catch (ex) { + if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(command) && (!args || !args.skip_focus)) { + self.editor.focus(); + } else { + restore(self.editor); } - }; - var setContentEditable = function (elm, state) { - elm.dom.contentEditable = state ? 'true' : 'false'; - }; - var switchOffContentEditableTrue = function (elm) { - each(descendants$1(elm, '*[contenteditable="true"]'), function (elm) { - set(elm, internalContentEditableAttr, 'true'); - setContentEditable(elm, false); + args = self.editor.fire('BeforeExecCommand', { + command: command, + ui: ui, + value: value }); - }; - var switchOnContentEditableTrue = function (elm) { - each(descendants$1(elm, '*[' + internalContentEditableAttr + '="true"]'), function (elm) { - remove$1(elm, internalContentEditableAttr); - setContentEditable(elm, true); + if (args.isDefaultPrevented()) { + return false; + } + var customCommand = command.toLowerCase(); + if (func = self.commands.exec[customCommand]) { + func(customCommand, ui, value); + self.editor.fire('ExecCommand', { + command: command, + ui: ui, + value: value + }); + return true; + } + each$f(this.editor.plugins, function (p) { + if (p.execCommand && p.execCommand(command, ui, value)) { + self.editor.fire('ExecCommand', { + command: command, + ui: ui, + value: value + }); + state = true; + return false; + } }); - }; - var removeFakeSelection = function (editor) { - Optional.from(editor.selection.getNode()).each(function (elm) { - elm.removeAttribute('data-mce-selected'); - }); - }; - var restoreFakeSelection = function (editor) { - editor.selection.setRng(editor.selection.getRng()); - }; - var toggleReadOnly = function (editor, state) { - var body = SugarElement.fromDom(editor.getBody()); - toggleClass(body, 'mce-content-readonly', state); if (state) { - editor.selection.controlSelection.hideResizeRect(); - editor._selectionOverrides.hideFakeCaret(); - removeFakeSelection(editor); - editor.readonly = true; - setContentEditable(body, false); - switchOffContentEditableTrue(body); - } else { - editor.readonly = false; - setContentEditable(body, true); - switchOnContentEditableTrue(body); - setEditorCommandState(editor, 'StyleWithCSS', false); - setEditorCommandState(editor, 'enableInlineTableEditing', false); - setEditorCommandState(editor, 'enableObjectResizing', false); - if (hasEditorOrUiFocus(editor)) { - editor.focus(); - } - restoreFakeSelection(editor); - editor.nodeChanged(); - } - }; - var isReadOnly$1 = function (editor) { - return editor.readonly; - }; - var registerFilters = function (editor) { - editor.parser.addAttributeFilter('contenteditable', function (nodes) { - if (isReadOnly$1(editor)) { - each(nodes, function (node) { - node.attr(internalContentEditableAttr, node.attr('contenteditable')); - node.attr('contenteditable', 'false'); - }); - } - }); - editor.serializer.addAttributeFilter(internalContentEditableAttr, function (nodes) { - if (isReadOnly$1(editor)) { - each(nodes, function (node) { - node.attr('contenteditable', node.attr(internalContentEditableAttr)); - }); - } - }); - editor.serializer.addTempAttr(internalContentEditableAttr); - }; - var registerReadOnlyContentFilters = function (editor) { - if (editor.serializer) { - registerFilters(editor); - } else { - editor.on('PreInit', function () { - registerFilters(editor); - }); - } - }; - var isClickEvent = function (e) { - return e.type === 'click'; - }; - var getAnchorHrefOpt = function (editor, elm) { - var isRoot = function (elm) { - return eq$2(elm, SugarElement.fromDom(editor.getBody())); - }; - return closest$1(elm, 'a', isRoot).bind(function (a) { - return getOpt(a, 'href'); - }); - }; - var processReadonlyEvents = function (editor, e) { - if (isClickEvent(e) && !VK.metaKeyPressed(e)) { - var elm = SugarElement.fromDom(e.target); - getAnchorHrefOpt(editor, elm).each(function (href) { - e.preventDefault(); - if (/^#/.test(href)) { - var targetEl = editor.dom.select(href + ',[name="' + removeLeading(href, '#') + '"]'); - if (targetEl.length) { - editor.selection.scrollIntoView(targetEl[0], true); - } - } else { - window.open(href, '_blank', 'rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes'); - } - }); - } - }; - var registerReadOnlySelectionBlockers = function (editor) { - editor.on('ShowCaret', function (e) { - if (isReadOnly$1(editor)) { - e.preventDefault(); - } - }); - editor.on('ObjectSelected', function (e) { - if (isReadOnly$1(editor)) { - e.preventDefault(); - } - }); - }; - - var nativeEvents = Tools.makeMap('focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange ' + 'mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover ' + 'draggesture dragdrop drop drag submit ' + 'compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel', ' '); - var EventDispatcher = function () { - function EventDispatcher(settings) { - this.bindings = {}; - this.settings = settings || {}; - this.scope = this.settings.scope || this; - this.toggleEvent = this.settings.toggleEvent || never; - } - - EventDispatcher.isNative = function (name) { - return !!nativeEvents[name.toLowerCase()]; - }; - EventDispatcher.prototype.fire = function (nameIn, argsIn) { - var name = nameIn.toLowerCase(); - var args = argsIn || {}; - args.type = name; - if (!args.target) { - args.target = this.scope; - } - if (!args.preventDefault) { - args.preventDefault = function () { - args.isDefaultPrevented = always; - }; - args.stopPropagation = function () { - args.isPropagationStopped = always; - }; - args.stopImmediatePropagation = function () { - args.isImmediatePropagationStopped = always; - }; - args.isDefaultPrevented = never; - args.isPropagationStopped = never; - args.isImmediatePropagationStopped = never; - } - if (this.settings.beforeFire) { - this.settings.beforeFire(args); - } - var handlers = this.bindings[name]; - if (handlers) { - for (var i = 0, l = handlers.length; i < l; i++) { - var callback = handlers[i]; - if (callback.once) { - this.off(name, callback.func); - } - if (args.isImmediatePropagationStopped()) { - args.stopPropagation(); - return args; - } - if (callback.func.call(this.scope, args) === false) { - args.preventDefault(); - return args; - } - } - } - return args; - }; - EventDispatcher.prototype.on = function (name, callback, prepend, extra) { - if (callback === false) { - callback = never; - } - if (callback) { - var wrappedCallback = {func: callback}; - if (extra) { - Tools.extend(wrappedCallback, extra); - } - var names = name.toLowerCase().split(' '); - var i = names.length; - while (i--) { - var currentName = names[i]; - var handlers = this.bindings[currentName]; - if (!handlers) { - handlers = this.bindings[currentName] = []; - this.toggleEvent(currentName, true); - } - if (prepend) { - handlers.unshift(wrappedCallback); - } else { - handlers.push(wrappedCallback); - } - } - } - return this; - }; - EventDispatcher.prototype.off = function (name, callback) { - var _this = this; - if (name) { - var names = name.toLowerCase().split(' '); - var i = names.length; - while (i--) { - var currentName = names[i]; - var handlers = this.bindings[currentName]; - if (!currentName) { - each$1(this.bindings, function (_value, bindingName) { - _this.toggleEvent(bindingName, false); - delete _this.bindings[bindingName]; - }); - return this; - } - if (handlers) { - if (!callback) { - handlers.length = 0; - } else { - var hi = handlers.length; - while (hi--) { - if (handlers[hi].func === callback) { - handlers = handlers.slice(0, hi).concat(handlers.slice(hi + 1)); - this.bindings[currentName] = handlers; - } - } - } - if (!handlers.length) { - this.toggleEvent(name, false); - delete this.bindings[currentName]; - } - } - } - } else { - each$1(this.bindings, function (_value, name) { - _this.toggleEvent(name, false); - }); - this.bindings = {}; - } - return this; - }; - EventDispatcher.prototype.once = function (name, callback, prepend) { - return this.on(name, callback, prepend, {once: true}); - }; - EventDispatcher.prototype.has = function (name) { - name = name.toLowerCase(); - return !(!this.bindings[name] || this.bindings[name].length === 0); - }; - return EventDispatcher; - }(); - - var getEventDispatcher = function (obj) { - if (!obj._eventDispatcher) { - obj._eventDispatcher = new EventDispatcher({ - scope: obj, - toggleEvent: function (name, state) { - if (EventDispatcher.isNative(name) && obj.toggleNativeEvent) { - obj.toggleNativeEvent(name, state); - } - } - }); - } - return obj._eventDispatcher; - }; - var Observable = { - fire: function (name, args, bubble) { - var self = this; - if (self.removed && name !== 'remove' && name !== 'detach') { - return args; - } - var dispatcherArgs = getEventDispatcher(self).fire(name, args); - if (bubble !== false && self.parent) { - var parent_1 = self.parent(); - while (parent_1 && !dispatcherArgs.isPropagationStopped()) { - parent_1.fire(name, dispatcherArgs, false); - parent_1 = parent_1.parent(); - } - } - return dispatcherArgs; - }, - on: function (name, callback, prepend) { - return getEventDispatcher(this).on(name, callback, prepend); - }, - off: function (name, callback) { - return getEventDispatcher(this).off(name, callback); - }, - once: function (name, callback) { - return getEventDispatcher(this).once(name, callback); - }, - hasEventListeners: function (name) { - return getEventDispatcher(this).has(name); - } - }; - - var DOM$8 = DOMUtils$1.DOM; - var customEventRootDelegates; - var getEventTarget = function (editor, eventName) { - if (eventName === 'selectionchange') { - return editor.getDoc(); - } - if (!editor.inline && /^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(eventName)) { - return editor.getDoc().documentElement; - } - var eventRoot = getEventRoot(editor); - if (eventRoot) { - if (!editor.eventRoot) { - editor.eventRoot = DOM$8.select(eventRoot)[0]; - } - return editor.eventRoot; - } - return editor.getBody(); - }; - var isListening = function (editor) { - return !editor.hidden && !isReadOnly$1(editor); - }; - var fireEvent = function (editor, eventName, e) { - if (isListening(editor)) { - editor.fire(eventName, e); - } else if (isReadOnly$1(editor)) { - processReadonlyEvents(editor, e); - } - }; - var bindEventDelegate = function (editor, eventName) { - var delegate; - if (!editor.delegates) { - editor.delegates = {}; - } - if (editor.delegates[eventName] || editor.removed) { - return; - } - var eventRootElm = getEventTarget(editor, eventName); - if (getEventRoot(editor)) { - if (!customEventRootDelegates) { - customEventRootDelegates = {}; - editor.editorManager.on('removeEditor', function () { - if (!editor.editorManager.activeEditor) { - if (customEventRootDelegates) { - each$1(customEventRootDelegates, function (_value, name) { - editor.dom.unbind(getEventTarget(editor, name)); - }); - customEventRootDelegates = null; - } - } - }); - } - if (customEventRootDelegates[eventName]) { - return; - } - delegate = function (e) { - var target = e.target; - var editors = editor.editorManager.get(); - var i = editors.length; - while (i--) { - var body = editors[i].getBody(); - if (body === target || DOM$8.isChildOf(target, body)) { - fireEvent(editors[i], eventName, e); - } - } - }; - customEventRootDelegates[eventName] = delegate; - DOM$8.bind(eventRootElm, eventName, delegate); - } else { - delegate = function (e) { - fireEvent(editor, eventName, e); - }; - DOM$8.bind(eventRootElm, eventName, delegate); - editor.delegates[eventName] = delegate; - } - }; - var EditorObservable = __assign(__assign({}, Observable), { - bindPendingEventDelegates: function () { - var self = this; - Tools.each(self._pendingNativeEvents, function (name) { - bindEventDelegate(self, name); - }); - }, - toggleNativeEvent: function (name, state) { - var self = this; - if (name === 'focus' || name === 'blur') { - return; - } - if (state) { - if (self.initialized) { - bindEventDelegate(self, name); - } else { - if (!self._pendingNativeEvents) { - self._pendingNativeEvents = [name]; - } else { - self._pendingNativeEvents.push(name); - } - } - } else if (self.initialized) { - self.dom.unbind(getEventTarget(self, name), name, self.delegates[name]); - delete self.delegates[name]; - } - }, - unbindAllNativeEvents: function () { - var self = this; - var body = self.getBody(); - var dom = self.dom; - if (self.delegates) { - each$1(self.delegates, function (value, name) { - self.dom.unbind(getEventTarget(self, name), name, value); - }); - delete self.delegates; - } - if (!self.inline && body && dom) { - body.onload = null; - dom.unbind(self.getWin()); - dom.unbind(self.getDoc()); - } - if (dom) { - dom.unbind(body); - dom.unbind(self.getContainer()); - } - } - }); - - var defaultModes = [ - 'design', - 'readonly' - ]; - var switchToMode = function (editor, activeMode, availableModes, mode) { - var oldMode = availableModes[activeMode.get()]; - var newMode = availableModes[mode]; - try { - newMode.activate(); - } catch (e) { - console.error('problem while activating editor mode ' + mode + ':', e); - return; - } - oldMode.deactivate(); - if (oldMode.editorReadOnly !== newMode.editorReadOnly) { - toggleReadOnly(editor, newMode.editorReadOnly); - } - activeMode.set(mode); - fireSwitchMode(editor, mode); - }; - var setMode = function (editor, availableModes, activeMode, mode) { - if (mode === activeMode.get()) { - return; - } else if (!has(availableModes, mode)) { - throw new Error('Editor mode \'' + mode + '\' is invalid'); - } - if (editor.initialized) { - switchToMode(editor, activeMode, availableModes, mode); - } else { - editor.on('init', function () { - return switchToMode(editor, activeMode, availableModes, mode); - }); - } - }; - var registerMode = function (availableModes, mode, api) { - var _a; - if (contains(defaultModes, mode)) { - throw new Error('Cannot override default mode ' + mode); - } - return __assign(__assign({}, availableModes), (_a = {}, _a[mode] = __assign(__assign({}, api), { - deactivate: function () { - try { - api.deactivate(); - } catch (e) { - console.error('problem while deactivating editor mode ' + mode + ':', e); - } - } - }), _a)); - }; - - var create$5 = function (editor) { - var activeMode = Cell('design'); - var availableModes = Cell({ - design: { - activate: noop, - deactivate: noop, - editorReadOnly: false - }, - readonly: { - activate: noop, - deactivate: noop, - editorReadOnly: true - } - }); - registerReadOnlyContentFilters(editor); - registerReadOnlySelectionBlockers(editor); - return { - isReadOnly: function () { - return isReadOnly$1(editor); - }, - set: function (mode) { - return setMode(editor, availableModes.get(), activeMode, mode); - }, - get: function () { - return activeMode.get(); - }, - register: function (mode, api) { - availableModes.set(registerMode(availableModes.get(), mode, api)); - } - }; - }; - - var each$g = Tools.each, explode$3 = Tools.explode; - var keyCodeLookup = { - f1: 112, - f2: 113, - f3: 114, - f4: 115, - f5: 116, - f6: 117, - f7: 118, - f8: 119, - f9: 120, - f10: 121, - f11: 122, - f12: 123 - }; - var modifierNames = Tools.makeMap('alt,ctrl,shift,meta,access'); - var Shortcuts = function () { - function Shortcuts(editor) { - this.shortcuts = {}; - this.pendingPatterns = []; - this.editor = editor; - var self = this; - editor.on('keyup keypress keydown', function (e) { - if ((self.hasModifier(e) || self.isFunctionKey(e)) && !e.isDefaultPrevented()) { - each$g(self.shortcuts, function (shortcut) { - if (self.matchShortcut(e, shortcut)) { - self.pendingPatterns = shortcut.subpatterns.slice(0); - if (e.type === 'keydown') { - self.executeShortcutAction(shortcut); - } - return true; - } - }); - if (self.matchShortcut(e, self.pendingPatterns[0])) { - if (self.pendingPatterns.length === 1) { - if (e.type === 'keydown') { - self.executeShortcutAction(self.pendingPatterns[0]); - } - } - self.pendingPatterns.shift(); - } - } - }); - } - - Shortcuts.prototype.add = function (pattern, desc, cmdFunc, scope) { - var self = this; - var func = self.normalizeCommandFunc(cmdFunc); - each$g(explode$3(Tools.trim(pattern)), function (pattern) { - var shortcut = self.createShortcut(pattern, desc, func, scope); - self.shortcuts[shortcut.id] = shortcut; - }); - return true; - }; - Shortcuts.prototype.remove = function (pattern) { - var shortcut = this.createShortcut(pattern); - if (this.shortcuts[shortcut.id]) { - delete this.shortcuts[shortcut.id]; - return true; - } - return false; - }; - Shortcuts.prototype.normalizeCommandFunc = function (cmdFunc) { - var self = this; - var cmd = cmdFunc; - if (typeof cmd === 'string') { - return function () { - self.editor.execCommand(cmd, false, null); - }; - } else if (Tools.isArray(cmd)) { - return function () { - self.editor.execCommand(cmd[0], cmd[1], cmd[2]); - }; - } else { - return cmd; - } - }; - Shortcuts.prototype.parseShortcut = function (pattern) { - var key; - var shortcut = {}; - each$g(explode$3(pattern.toLowerCase(), '+'), function (value) { - if (value in modifierNames) { - shortcut[value] = true; - } else { - if (/^[0-9]{2,}$/.test(value)) { - shortcut.keyCode = parseInt(value, 10); - } else { - shortcut.charCode = value.charCodeAt(0); - shortcut.keyCode = keyCodeLookup[value] || value.toUpperCase().charCodeAt(0); - } - } - }); - var id = [shortcut.keyCode]; - for (key in modifierNames) { - if (shortcut[key]) { - id.push(key); - } else { - shortcut[key] = false; - } - } - shortcut.id = id.join(','); - if (shortcut.access) { - shortcut.alt = true; - if (Env.mac) { - shortcut.ctrl = true; - } else { - shortcut.shift = true; - } - } - if (shortcut.meta) { - if (Env.mac) { - shortcut.meta = true; - } else { - shortcut.ctrl = true; - shortcut.meta = false; - } - } - return shortcut; - }; - Shortcuts.prototype.createShortcut = function (pattern, desc, cmdFunc, scope) { - var shortcuts = Tools.map(explode$3(pattern, '>'), this.parseShortcut); - shortcuts[shortcuts.length - 1] = Tools.extend(shortcuts[shortcuts.length - 1], { - func: cmdFunc, - scope: scope || this.editor - }); - return Tools.extend(shortcuts[0], { - desc: this.editor.translate(desc), - subpatterns: shortcuts.slice(1) - }); - }; - Shortcuts.prototype.hasModifier = function (e) { - return e.altKey || e.ctrlKey || e.metaKey; - }; - Shortcuts.prototype.isFunctionKey = function (e) { - return e.type === 'keydown' && e.keyCode >= 112 && e.keyCode <= 123; - }; - Shortcuts.prototype.matchShortcut = function (e, shortcut) { - if (!shortcut) { - return false; - } - if (shortcut.ctrl !== e.ctrlKey || shortcut.meta !== e.metaKey) { - return false; - } - if (shortcut.alt !== e.altKey || shortcut.shift !== e.shiftKey) { - return false; - } - if (e.keyCode === shortcut.keyCode || e.charCode && e.charCode === shortcut.charCode) { - e.preventDefault(); - return true; - } - return false; - }; - Shortcuts.prototype.executeShortcutAction = function (shortcut) { - return shortcut.func ? shortcut.func.call(shortcut.scope) : null; - }; - return Shortcuts; - }(); - - var create$6 = function () { - var buttons = {}; - var menuItems = {}; - var popups = {}; - var icons = {}; - var contextMenus = {}; - var contextToolbars = {}; - var sidebars = {}; - var add = function (collection, type) { - return function (name, spec) { - return collection[name.toLowerCase()] = __assign(__assign({}, spec), {type: type}); - }; - }; - var addIcon = function (name, svgData) { - return icons[name.toLowerCase()] = svgData; - }; - return { - addButton: add(buttons, 'button'), - addGroupToolbarButton: add(buttons, 'grouptoolbarbutton'), - addToggleButton: add(buttons, 'togglebutton'), - addMenuButton: add(buttons, 'menubutton'), - addSplitButton: add(buttons, 'splitbutton'), - addMenuItem: add(menuItems, 'menuitem'), - addNestedMenuItem: add(menuItems, 'nestedmenuitem'), - addToggleMenuItem: add(menuItems, 'togglemenuitem'), - addAutocompleter: add(popups, 'autocompleter'), - addContextMenu: add(contextMenus, 'contextmenu'), - addContextToolbar: add(contextToolbars, 'contexttoolbar'), - addContextForm: add(contextToolbars, 'contextform'), - addSidebar: add(sidebars, 'sidebar'), - addIcon: addIcon, - getAll: function () { - return { - buttons: buttons, - menuItems: menuItems, - icons: icons, - popups: popups, - contextMenus: contextMenus, - contextToolbars: contextToolbars, - sidebars: sidebars - }; - } - }; - }; - - var registry = function () { - var bridge = create$6(); - return { - addAutocompleter: bridge.addAutocompleter, - addButton: bridge.addButton, - addContextForm: bridge.addContextForm, - addContextMenu: bridge.addContextMenu, - addContextToolbar: bridge.addContextToolbar, - addIcon: bridge.addIcon, - addMenuButton: bridge.addMenuButton, - addMenuItem: bridge.addMenuItem, - addNestedMenuItem: bridge.addNestedMenuItem, - addSidebar: bridge.addSidebar, - addSplitButton: bridge.addSplitButton, - addToggleButton: bridge.addToggleButton, - addGroupToolbarButton: bridge.addGroupToolbarButton, - addToggleMenuItem: bridge.addToggleMenuItem, - getAll: bridge.getAll - }; - }; - - var each$h = Tools.each, trim$4 = Tools.trim; - var queryParts = 'source protocol authority userInfo user password host port relative path directory file query anchor'.split(' '); - var DEFAULT_PORTS = { - ftp: 21, - http: 80, - https: 443, - mailto: 25 - }; - var URI = function () { - function URI(url, settings) { - url = trim$4(url); - this.settings = settings || {}; - var baseUri = this.settings.base_uri; - var self = this; - if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) { - self.source = url; - return; - } - var isProtocolRelative = url.indexOf('//') === 0; - if (url.indexOf('/') === 0 && !isProtocolRelative) { - url = (baseUri ? baseUri.protocol || 'http' : 'http') + '://mce_host' + url; - } - if (!/^[\w\-]*:?\/\//.test(url)) { - var baseUrl = this.settings.base_uri ? this.settings.base_uri.path : new URI(document.location.href).directory; - if (this.settings.base_uri && this.settings.base_uri.protocol == '') { - url = '//mce_host' + self.toAbsPath(baseUrl, url); - } else { - var match = /([^#?]*)([#?]?.*)/.exec(url); - url = (baseUri && baseUri.protocol || 'http') + '://mce_host' + self.toAbsPath(baseUrl, match[1]) + match[2]; - } - } - url = url.replace(/@@/g, '(mce_at)'); - var urlMatch = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url); - each$h(queryParts, function (v, i) { - var part = urlMatch[i]; - if (part) { - part = part.replace(/\(mce_at\)/g, '@@'); - } - self[v] = part; - }); - if (baseUri) { - if (!self.protocol) { - self.protocol = baseUri.protocol; - } - if (!self.userInfo) { - self.userInfo = baseUri.userInfo; - } - if (!self.port && self.host === 'mce_host') { - self.port = baseUri.port; - } - if (!self.host || self.host === 'mce_host') { - self.host = baseUri.host; - } - self.source = ''; - } - if (isProtocolRelative) { - self.protocol = ''; - } + return state; } - - URI.parseDataUri = function (uri) { - var type; - var uriComponents = decodeURIComponent(uri).split(','); - var matches = /data:([^;]+)/.exec(uriComponents[0]); - if (matches) { - type = matches[1]; - } - return { - type: type, - data: uriComponents[1] - }; - }; - URI.getDocumentBaseUrl = function (loc) { - var baseUrl; - if (loc.protocol.indexOf('http') !== 0 && loc.protocol !== 'file:') { - baseUrl = loc.href; - } else { - baseUrl = loc.protocol + '//' + loc.host + loc.pathname; - } - if (/^[^:]+:\/\/\/?[^\/]+\//.test(baseUrl)) { - baseUrl = baseUrl.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, ''); - if (!/[\/\\]$/.test(baseUrl)) { - baseUrl += '/'; - } - } - return baseUrl; - }; - URI.prototype.setPath = function (path) { - var pathMatch = /^(.*?)\/?(\w+)?$/.exec(path); - this.path = pathMatch[0]; - this.directory = pathMatch[1]; - this.file = pathMatch[2]; - this.source = ''; - this.getURI(); - }; - URI.prototype.toRelative = function (uri) { - var output; - if (uri === './') { - return uri; - } - var relativeUri = new URI(uri, {base_uri: this}); - if (relativeUri.host !== 'mce_host' && this.host !== relativeUri.host && relativeUri.host || this.port !== relativeUri.port || this.protocol !== relativeUri.protocol && relativeUri.protocol !== '') { - return relativeUri.getURI(); - } - var tu = this.getURI(), uu = relativeUri.getURI(); - if (tu === uu || tu.charAt(tu.length - 1) === '/' && tu.substr(0, tu.length - 1) === uu) { - return tu; - } - output = this.toRelPath(this.path, relativeUri.path); - if (relativeUri.query) { - output += '?' + relativeUri.query; - } - if (relativeUri.anchor) { - output += '#' + relativeUri.anchor; - } - return output; - }; - URI.prototype.toAbsolute = function (uri, noHost) { - var absoluteUri = new URI(uri, {base_uri: this}); - return absoluteUri.getURI(noHost && this.isSameOrigin(absoluteUri)); - }; - URI.prototype.isSameOrigin = function (uri) { - if (this.host == uri.host && this.protocol == uri.protocol) { - if (this.port == uri.port) { - return true; - } - var defaultPort = DEFAULT_PORTS[this.protocol]; - if (defaultPort && (this.port || defaultPort) == (uri.port || defaultPort)) { - return true; - } - } - return false; - }; - URI.prototype.toRelPath = function (base, path) { - var breakPoint = 0, out = '', i, l; - var normalizedBase = base.substring(0, base.lastIndexOf('/')).split('/'); - var items = path.split('/'); - if (normalizedBase.length >= items.length) { - for (i = 0, l = normalizedBase.length; i < l; i++) { - if (i >= items.length || normalizedBase[i] !== items[i]) { - breakPoint = i + 1; - break; - } - } - } - if (normalizedBase.length < items.length) { - for (i = 0, l = items.length; i < l; i++) { - if (i >= normalizedBase.length || normalizedBase[i] !== items[i]) { - breakPoint = i + 1; - break; - } - } - } - if (breakPoint === 1) { - return path; - } - for (i = 0, l = normalizedBase.length - (breakPoint - 1); i < l; i++) { - out += '../'; - } - for (i = breakPoint - 1, l = items.length; i < l; i++) { - if (i !== breakPoint - 1) { - out += '/' + items[i]; - } else { - out += items[i]; - } - } - return out; - }; - URI.prototype.toAbsPath = function (base, path) { - var i, nb = 0, o = [], outPath; - var tr = /\/$/.test(path) ? '/' : ''; - var normalizedBase = base.split('/'); - var normalizedPath = path.split('/'); - each$h(normalizedBase, function (k) { - if (k) { - o.push(k); - } - }); - normalizedBase = o; - for (i = normalizedPath.length - 1, o = []; i >= 0; i--) { - if (normalizedPath[i].length === 0 || normalizedPath[i] === '.') { - continue; - } - if (normalizedPath[i] === '..') { - nb++; - continue; - } - if (nb > 0) { - nb--; - continue; - } - o.push(normalizedPath[i]); - } - i = normalizedBase.length - nb; - if (i <= 0) { - outPath = reverse(o).join('/'); - } else { - outPath = normalizedBase.slice(0, i).join('/') + '/' + reverse(o).join('/'); - } - if (outPath.indexOf('/') !== 0) { - outPath = '/' + outPath; - } - if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) { - outPath += tr; - } - return outPath; - }; - URI.prototype.getURI = function (noProtoHost) { - if (noProtoHost === void 0) { - noProtoHost = false; - } - var s; - if (!this.source || noProtoHost) { - s = ''; - if (!noProtoHost) { - if (this.protocol) { - s += this.protocol + '://'; - } else { - s += '//'; - } - if (this.userInfo) { - s += this.userInfo + '@'; - } - if (this.host) { - s += this.host; - } - if (this.port) { - s += ':' + this.port; - } - } - if (this.path) { - s += this.path; - } - if (this.query) { - s += '?' + this.query; - } - if (this.anchor) { - s += '#' + this.anchor; - } - this.source = s; - } - return this.source; - }; - return URI; - }(); - - var DOM$9 = DOMUtils$1.DOM; - var extend$3 = Tools.extend, each$i = Tools.each; - var resolve$3 = Tools.resolve; - var ie$1 = Env.ie; - var Editor = function () { - function Editor(id, settings, editorManager) { - var _this = this; - this.plugins = {}; - this.contentCSS = []; - this.contentStyles = []; - this.loadedCSS = {}; - this.isNotDirty = false; - this.editorManager = editorManager; - this.documentBaseUrl = editorManager.documentBaseURL; - extend$3(this, EditorObservable); - this.settings = getEditorSettings(this, id, this.documentBaseUrl, editorManager.defaultSettings, settings); - if (this.settings.suffix) { - editorManager.suffix = this.settings.suffix; - } - this.suffix = editorManager.suffix; - if (this.settings.base_url) { - editorManager._setBaseUrl(this.settings.base_url); - } - this.baseUri = editorManager.baseURI; - if (this.settings.referrer_policy) { - ScriptLoader.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy); - DOMUtils$1.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy); - } - AddOnManager$1.languageLoad = this.settings.language_load; - AddOnManager$1.baseURL = editorManager.baseURL; - this.id = id; - this.setDirty(false); - this.documentBaseURI = new URI(this.settings.document_base_url, {base_uri: this.baseUri}); - this.baseURI = this.baseUri; - this.inline = !!this.settings.inline; - this.shortcuts = new Shortcuts(this); - this.editorCommands = new EditorCommands(this); - if (this.settings.cache_suffix) { - Env.cacheSuffix = this.settings.cache_suffix.replace(/^[\?\&]+/, ''); - } - this.ui = { - registry: registry(), - styleSheetLoader: undefined, - show: noop, - hide: noop, - enable: noop, - disable: noop, - isDisabled: never - }; - var self = this; - var modeInstance = create$5(self); - this.mode = modeInstance; - this.setMode = modeInstance.set; - editorManager.fire('SetupEditor', {editor: this}); - this.execCallback('setup', this); - this.$ = DomQuery.overrideDefaults(function () { - return { - context: _this.inline ? _this.getBody() : _this.getDoc(), - element: _this.getBody() - }; - }); + if (self.editor.theme && self.editor.theme.execCommand && self.editor.theme.execCommand(command, ui, value)) { + self.editor.fire('ExecCommand', { + command: command, + ui: ui, + value: value + }); + return true; } - - Editor.prototype.render = function () { - render(this); - }; - Editor.prototype.focus = function (skipFocus) { - focus$1(this, skipFocus); - }; - Editor.prototype.hasFocus = function () { - return hasFocus$1(this); - }; - Editor.prototype.execCallback = function (name) { - var x = []; - for (var _i = 1; _i < arguments.length; _i++) { - x[_i - 1] = arguments[_i]; - } - var self = this; - var callback = self.settings[name], scope; - if (!callback) { - return; - } - if (self.callbackLookup && (scope = self.callbackLookup[name])) { - callback = scope.func; - scope = scope.scope; - } - if (typeof callback === 'string') { - scope = callback.replace(/\.\w+$/, ''); - scope = scope ? resolve$3(scope) : 0; - callback = resolve$3(callback); - self.callbackLookup = self.callbackLookup || {}; - self.callbackLookup[name] = { - func: callback, - scope: scope - }; - } - return callback.apply(scope || self, x); - }; - Editor.prototype.translate = function (text) { - return I18n.translate(text); - }; - Editor.prototype.getParam = function (name, defaultVal, type) { - return getParam(this, name, defaultVal, type); - }; - Editor.prototype.hasPlugin = function (name, loaded) { - var hasPlugin = contains(getPlugins(this).split(/[ ,]/), name); - if (hasPlugin) { - return loaded ? PluginManager.get(name) !== undefined : true; - } else { - return false; - } - }; - Editor.prototype.nodeChanged = function (args) { - this._nodeChangeDispatcher.nodeChanged(args); - }; - Editor.prototype.addCommand = function (name, callback, scope) { - this.editorCommands.addCommand(name, callback, scope); - }; - Editor.prototype.addQueryStateHandler = function (name, callback, scope) { - this.editorCommands.addQueryStateHandler(name, callback, scope); - }; - Editor.prototype.addQueryValueHandler = function (name, callback, scope) { - this.editorCommands.addQueryValueHandler(name, callback, scope); - }; - Editor.prototype.addShortcut = function (pattern, desc, cmdFunc, scope) { - this.shortcuts.add(pattern, desc, cmdFunc, scope); - }; - Editor.prototype.execCommand = function (cmd, ui, value, args) { - return this.editorCommands.execCommand(cmd, ui, value, args); - }; - Editor.prototype.queryCommandState = function (cmd) { - return this.editorCommands.queryCommandState(cmd); - }; - Editor.prototype.queryCommandValue = function (cmd) { - return this.editorCommands.queryCommandValue(cmd); - }; - Editor.prototype.queryCommandSupported = function (cmd) { - return this.editorCommands.queryCommandSupported(cmd); - }; - Editor.prototype.show = function () { - var self = this; - if (self.hidden) { - self.hidden = false; - if (self.inline) { - self.getBody().contentEditable = 'true'; - } else { - DOM$9.show(self.getContainer()); - DOM$9.hide(self.id); - } - self.load(); - self.fire('show'); - } - }; - Editor.prototype.hide = function () { - var self = this, doc = self.getDoc(); - if (!self.hidden) { - if (ie$1 && doc && !self.inline) { - doc.execCommand('SelectAll'); - } - self.save(); - if (self.inline) { - self.getBody().contentEditable = 'false'; - if (self === self.editorManager.focusedEditor) { - self.editorManager.focusedEditor = null; - } - } else { - DOM$9.hide(self.getContainer()); - DOM$9.setStyle(self.id, 'display', self.orgDisplay); - } - self.hidden = true; - self.fire('hide'); - } - }; - Editor.prototype.isHidden = function () { - return !!this.hidden; - }; - Editor.prototype.setProgressState = function (state, time) { - this.fire('ProgressState', { - state: state, - time: time - }); - }; - Editor.prototype.load = function (args) { - var self = this; - var elm = self.getElement(), html; - if (self.removed) { - return ''; - } - if (elm) { - args = args || {}; - args.load = true; - var value = isTextareaOrInput(elm) ? elm.value : elm.innerHTML; - html = self.setContent(value, args); - args.element = elm; - if (!args.no_events) { - self.fire('LoadContent', args); - } - args.element = elm = null; - return html; - } - }; - Editor.prototype.save = function (args) { - var self = this; - var elm = self.getElement(), html, form; - if (!elm || !self.initialized || self.removed) { - return; - } - args = args || {}; - args.save = true; - args.element = elm; - html = args.content = self.getContent(args); - if (!args.no_events) { - self.fire('SaveContent', args); - } - if (args.format === 'raw') { - self.fire('RawSaveContent', args); - } - html = args.content; - if (!isTextareaOrInput(elm)) { - if (args.is_removing || !self.inline) { - elm.innerHTML = html; - } - if (form = DOM$9.getParent(self.id, 'form')) { - each$i(form.elements, function (elm) { - if (elm.name === self.id) { - elm.value = html; - return false; - } - }); - } - } else { - elm.value = html; - } - args.element = elm = null; - if (args.set_dirty !== false) { - self.setDirty(false); - } - return html; - }; - Editor.prototype.setContent = function (content, args) { - return setContent$2(this, content, args); - }; - Editor.prototype.getContent = function (args) { - return getContent$2(this, args); - }; - Editor.prototype.insertContent = function (content, args) { - if (args) { - content = extend$3({content: content}, args); - } - this.execCommand('mceInsertContent', false, content); - }; - Editor.prototype.resetContent = function (initialContent) { - if (initialContent === undefined) { - setContent$2(this, this.startContent, {format: 'raw'}); - } else { - setContent$2(this, initialContent); - } - this.undoManager.reset(); - this.setDirty(false); - this.nodeChanged(); - }; - Editor.prototype.isDirty = function () { - return !this.isNotDirty; - }; - Editor.prototype.setDirty = function (state) { - var oldState = !this.isNotDirty; - this.isNotDirty = !state; - if (state && state !== oldState) { - this.fire('dirty'); - } - }; - Editor.prototype.getContainer = function () { - var self = this; - if (!self.container) { - self.container = DOM$9.get(self.editorContainer || self.id + '_parent'); - } - return self.container; - }; - Editor.prototype.getContentAreaContainer = function () { - return this.contentAreaContainer; - }; - Editor.prototype.getElement = function () { - if (!this.targetElm) { - this.targetElm = DOM$9.get(this.id); - } - return this.targetElm; - }; - Editor.prototype.getWin = function () { - var self = this; - var elm; - if (!self.contentWindow) { - elm = self.iframeElement; - if (elm) { - self.contentWindow = elm.contentWindow; - } - } - return self.contentWindow; - }; - Editor.prototype.getDoc = function () { - var self = this; - var win; - if (!self.contentDocument) { - win = self.getWin(); - if (win) { - self.contentDocument = win.document; - } - } - return self.contentDocument; - }; - Editor.prototype.getBody = function () { - var doc = this.getDoc(); - return this.bodyElement || (doc ? doc.body : null); - }; - Editor.prototype.convertURL = function (url, name, elm) { - var self = this, settings = self.settings; - if (settings.urlconverter_callback) { - return self.execCallback('urlconverter_callback', url, elm, true, name); - } - if (!settings.convert_urls || elm && elm.nodeName === 'LINK' || url.indexOf('file:') === 0 || url.length === 0) { - return url; - } - if (settings.relative_urls) { - return self.documentBaseURI.toRelative(url); - } - url = self.documentBaseURI.toAbsolute(url, settings.remove_script_host); - return url; - }; - Editor.prototype.addVisual = function (elm) { - addVisual$1(this, elm); - }; - Editor.prototype.remove = function () { - remove$7(this); - }; - Editor.prototype.destroy = function (automatic) { - destroy(this, automatic); - }; - Editor.prototype.uploadImages = function (callback) { - return this.editorUpload.uploadImages(callback); - }; - Editor.prototype._scanForImages = function () { - return this.editorUpload.scanForImages(); - }; - Editor.prototype.addButton = function () { - throw new Error('editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead'); - }; - Editor.prototype.addSidebar = function () { - throw new Error('editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead'); - }; - Editor.prototype.addMenuItem = function () { - throw new Error('editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead'); + try { + state = self.editor.getDoc().execCommand(command, ui, value); + } catch (ex) { + } + if (state) { + self.editor.fire('ExecCommand', { + command: command, + ui: ui, + value: value + }); + return true; + } + return false; + }; + EditorCommands.prototype.queryCommandState = function (command) { + var func; + if (this.editor.quirks.isHidden() || this.editor.removed) { + return; + } + command = command.toLowerCase(); + if (func = this.commands.state[command]) { + return func(command); + } + try { + return this.editor.getDoc().queryCommandState(command); + } catch (ex) { + } + return false; + }; + EditorCommands.prototype.queryCommandValue = function (command) { + var func; + if (this.editor.quirks.isHidden() || this.editor.removed) { + return; + } + command = command.toLowerCase(); + if (func = this.commands.value[command]) { + return func(command); + } + try { + return this.editor.getDoc().queryCommandValue(command); + } catch (ex) { + } + }; + EditorCommands.prototype.addCommands = function (commandList, type) { + if (type === void 0) { + type = 'exec'; + } + var self = this; + each$f(commandList, function (callback, command) { + each$f(command.toLowerCase().split(','), function (command) { + self.commands[type][command] = callback; + }); + }); + }; + EditorCommands.prototype.addCommand = function (command, callback, scope) { + var _this = this; + command = command.toLowerCase(); + this.commands.exec[command] = function (command, ui, value, args) { + return callback.call(scope || _this.editor, ui, value, args); }; - Editor.prototype.addContextToolbar = function () { - throw new Error('editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead'); + }; + EditorCommands.prototype.queryCommandSupported = function (command) { + command = command.toLowerCase(); + if (this.commands.exec[command]) { + return true; + } + try { + return this.editor.getDoc().queryCommandSupported(command); + } catch (ex) { + } + return false; + }; + EditorCommands.prototype.addQueryStateHandler = function (command, callback, scope) { + var _this = this; + command = command.toLowerCase(); + this.commands.state[command] = function () { + return callback.call(scope || _this.editor); }; - return Editor; + }; + EditorCommands.prototype.addQueryValueHandler = function (command, callback, scope) { + var _this = this; + command = command.toLowerCase(); + this.commands.value[command] = function () { + return callback.call(scope || _this.editor); + }; + }; + EditorCommands.prototype.hasCustomCommand = function (command) { + command = command.toLowerCase(); + return !!this.commands.exec[command]; + }; + EditorCommands.prototype.execNativeCommand = function (command, ui, value) { + if (ui === undefined) { + ui = false; + } + if (value === undefined) { + value = null; + } + return this.editor.getDoc().execCommand(command, ui, value); + }; + EditorCommands.prototype.isFormatMatch = function (name) { + return this.editor.formatter.match(name); + }; + EditorCommands.prototype.toggleFormat = function (name, value) { + this.editor.formatter.toggle(name, value ? { value: value } : undefined); + this.editor.nodeChanged(); + }; + EditorCommands.prototype.storeSelection = function (type) { + this.selectionBookmark = this.editor.selection.getBookmark(type); + }; + EditorCommands.prototype.restoreSelection = function () { + this.editor.selection.moveToBookmark(this.selectionBookmark); + }; + EditorCommands.prototype.setupCommands = function (editor) { + var self = this; + this.addCommands({ + 'mceResetDesignMode,mceBeginUndoLevel': function () { + }, + 'mceEndUndoLevel,mceAddUndoLevel': function () { + editor.undoManager.add(); + }, + 'Cut,Copy,Paste': function (command) { + var doc = editor.getDoc(); + var failed; + try { + self.execNativeCommand(command); + } catch (ex) { + failed = true; + } + if (command === 'paste' && !doc.queryCommandEnabled(command)) { + failed = true; + } + if (failed || !doc.queryCommandSupported(command)) { + var msg = editor.translate('Your browser doesn\'t support direct access to the clipboard. ' + 'Please use the Ctrl+X/C/V keyboard shortcuts instead.'); + if (Env.mac) { + msg = msg.replace(/Ctrl\+/g, '\u2318+'); + } + editor.notificationManager.open({ + text: msg, + type: 'error' + }); + } + }, + 'unlink': function () { + if (editor.selection.isCollapsed()) { + var elm = editor.dom.getParent(editor.selection.getStart(), 'a'); + if (elm) { + editor.dom.remove(elm, true); + } + return; + } + editor.formatter.remove('link'); + }, + 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone': function (command) { + var align = command.substring(7); + if (align === 'full') { + align = 'justify'; + } + each$f('left,center,right,justify'.split(','), function (name) { + if (align !== name) { + editor.formatter.remove('align' + name); + } + }); + if (align !== 'none') { + self.toggleFormat('align' + align); + } + }, + 'InsertUnorderedList,InsertOrderedList': function (command) { + var listParent; + self.execNativeCommand(command); + var listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul'); + if (listElm) { + listParent = listElm.parentNode; + if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) { + self.storeSelection(); + editor.dom.split(listParent, listElm); + self.restoreSelection(); + } + } + }, + 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function (command) { + self.toggleFormat(command); + }, + 'ForeColor,HiliteColor': function (command, ui, value) { + self.toggleFormat(command, value); + }, + 'FontName': function (command, ui, value) { + fontNameAction(editor, value); + }, + 'FontSize': function (command, ui, value) { + fontSizeAction(editor, value); + }, + 'LineHeight': function (command, ui, value) { + lineHeightAction(editor, value); + }, + 'RemoveFormat': function (command) { + editor.formatter.remove(command); + }, + 'mceBlockQuote': function () { + self.toggleFormat('blockquote'); + }, + 'FormatBlock': function (command, ui, value) { + return self.toggleFormat(value || 'p'); + }, + 'mceCleanup': function () { + var bookmark = editor.selection.getBookmark(); + editor.setContent(editor.getContent()); + editor.selection.moveToBookmark(bookmark); + }, + 'mceRemoveNode': function (command, ui, value) { + var node = value || editor.selection.getNode(); + if (node !== editor.getBody()) { + self.storeSelection(); + editor.dom.remove(node, true); + self.restoreSelection(); + } + }, + 'mceSelectNodeDepth': function (command, ui, value) { + var counter = 0; + editor.dom.getParent(editor.selection.getNode(), function (node) { + if (node.nodeType === 1 && counter++ === value) { + editor.selection.select(node); + return false; + } + }, editor.getBody()); + }, + 'mceSelectNode': function (command, ui, value) { + editor.selection.select(value); + }, + 'mceInsertContent': function (command, ui, value) { + insertAtCaret$1(editor, value); + }, + 'mceInsertRawHTML': function (command, ui, value) { + editor.selection.setContent('tiny_mce_marker'); + var content = editor.getContent(); + editor.setContent(content.replace(/tiny_mce_marker/g, function () { + return value; + })); + }, + 'mceInsertNewLine': function (command, ui, value) { + insert$3(editor, value); + }, + 'mceToggleFormat': function (command, ui, value) { + self.toggleFormat(value); + }, + 'mceSetContent': function (command, ui, value) { + editor.setContent(value); + }, + 'Indent,Outdent': function (command) { + handle(editor, command); + }, + 'mceRepaint': function () { + }, + 'InsertHorizontalRule': function () { + editor.execCommand('mceInsertContent', false, '
              '); + }, + 'mceToggleVisualAid': function () { + editor.hasVisual = !editor.hasVisual; + editor.addVisual(); + }, + 'mceReplaceContent': function (command, ui, value) { + editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, editor.selection.getContent({ format: 'text' }))); + }, + 'mceInsertLink': function (command, ui, value) { + if (typeof value === 'string') { + value = { href: value }; + } + var anchor = editor.dom.getParent(editor.selection.getNode(), 'a'); + value.href = value.href.replace(/ /g, '%20'); + if (!anchor || !value.href) { + editor.formatter.remove('link'); + } + if (value.href) { + editor.formatter.apply('link', value, anchor); + } + }, + 'selectAll': function () { + var editingHost = editor.dom.getParent(editor.selection.getStart(), isContentEditableTrue); + if (editingHost) { + var rng = editor.dom.createRng(); + rng.selectNodeContents(editingHost); + editor.selection.setRng(rng); + } + }, + 'mceNewDocument': function () { + editor.setContent(''); + }, + 'InsertLineBreak': function (command, ui, value) { + insert$2(editor, value); + return true; + } + }); + var alignStates = function (name) { + return function () { + var selection = editor.selection; + var nodes = selection.isCollapsed() ? [editor.dom.getParent(selection.getNode(), editor.dom.isBlock)] : selection.getSelectedBlocks(); + var matches = map$3(nodes, function (node) { + return !!editor.formatter.matchNode(node, name); + }); + return inArray$2(matches, true) !== -1; + }; + }; + self.addCommands({ + 'JustifyLeft': alignStates('alignleft'), + 'JustifyCenter': alignStates('aligncenter'), + 'JustifyRight': alignStates('alignright'), + 'JustifyFull': alignStates('alignjustify'), + 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function (command) { + return self.isFormatMatch(command); + }, + 'mceBlockQuote': function () { + return self.isFormatMatch('blockquote'); + }, + 'Outdent': function () { + return canOutdent(editor); + }, + 'InsertUnorderedList,InsertOrderedList': function (command) { + var list = editor.dom.getParent(editor.selection.getNode(), 'ul,ol'); + return list && (command === 'insertunorderedlist' && list.tagName === 'UL' || command === 'insertorderedlist' && list.tagName === 'OL'); + } + }, 'state'); + self.addCommands({ + Undo: function () { + editor.undoManager.undo(); + }, + Redo: function () { + editor.undoManager.redo(); + } + }); + self.addQueryValueHandler('FontName', function () { + return fontNameQuery(editor); + }, this); + self.addQueryValueHandler('FontSize', function () { + return fontSizeQuery(editor); + }, this); + self.addQueryValueHandler('LineHeight', function () { + return lineHeightQuery(editor); + }, this); + }; + return EditorCommands; }(); - var DOM$a = DOMUtils$1.DOM; - var explode$4 = Tools.explode, each$j = Tools.each, extend$4 = Tools.extend; - var instanceCounter = 0, boundGlobalEvents = false; - var beforeUnloadDelegate; - var legacyEditors = []; - var editors = []; - var isValidLegacyKey = function (id) { - return id !== 'length'; + var internalContentEditableAttr = 'data-mce-contenteditable'; + var toggleClass = function (elm, cls, state) { + if (has$2(elm, cls) && state === false) { + remove$4(elm, cls); + } else if (state) { + add$3(elm, cls); + } }; - var globalEventDelegate = function (e) { - var type = e.type; - each$j(EditorManager.get(), function (editor) { - switch (type) { - case 'scroll': - editor.fire('ScrollWindow', e); - break; - case 'resize': - editor.fire('ResizeWindow', e); - break; + var setEditorCommandState = function (editor, cmd, state) { + try { + editor.getDoc().execCommand(cmd, false, String(state)); + } catch (ex) { + } + }; + var setContentEditable = function (elm, state) { + elm.dom.contentEditable = state ? 'true' : 'false'; + }; + var switchOffContentEditableTrue = function (elm) { + each(descendants$1(elm, '*[contenteditable="true"]'), function (elm) { + set(elm, internalContentEditableAttr, 'true'); + setContentEditable(elm, false); + }); + }; + var switchOnContentEditableTrue = function (elm) { + each(descendants$1(elm, '*[' + internalContentEditableAttr + '="true"]'), function (elm) { + remove$1(elm, internalContentEditableAttr); + setContentEditable(elm, true); + }); + }; + var removeFakeSelection = function (editor) { + Optional.from(editor.selection.getNode()).each(function (elm) { + elm.removeAttribute('data-mce-selected'); + }); + }; + var restoreFakeSelection = function (editor) { + editor.selection.setRng(editor.selection.getRng()); + }; + var toggleReadOnly = function (editor, state) { + var body = SugarElement.fromDom(editor.getBody()); + toggleClass(body, 'mce-content-readonly', state); + if (state) { + editor.selection.controlSelection.hideResizeRect(); + editor._selectionOverrides.hideFakeCaret(); + removeFakeSelection(editor); + editor.readonly = true; + setContentEditable(body, false); + switchOffContentEditableTrue(body); + } else { + editor.readonly = false; + setContentEditable(body, true); + switchOnContentEditableTrue(body); + setEditorCommandState(editor, 'StyleWithCSS', false); + setEditorCommandState(editor, 'enableInlineTableEditing', false); + setEditorCommandState(editor, 'enableObjectResizing', false); + if (hasEditorOrUiFocus(editor)) { + editor.focus(); + } + restoreFakeSelection(editor); + editor.nodeChanged(); + } + }; + var isReadOnly$1 = function (editor) { + return editor.readonly; + }; + var registerFilters = function (editor) { + editor.parser.addAttributeFilter('contenteditable', function (nodes) { + if (isReadOnly$1(editor)) { + each(nodes, function (node) { + node.attr(internalContentEditableAttr, node.attr('contenteditable')); + node.attr('contenteditable', 'false'); + }); + } + }); + editor.serializer.addAttributeFilter(internalContentEditableAttr, function (nodes) { + if (isReadOnly$1(editor)) { + each(nodes, function (node) { + node.attr('contenteditable', node.attr(internalContentEditableAttr)); + }); + } + }); + editor.serializer.addTempAttr(internalContentEditableAttr); + }; + var registerReadOnlyContentFilters = function (editor) { + if (editor.serializer) { + registerFilters(editor); + } else { + editor.on('PreInit', function () { + registerFilters(editor); + }); + } + }; + var isClickEvent = function (e) { + return e.type === 'click'; + }; + var getAnchorHrefOpt = function (editor, elm) { + var isRoot = function (elm) { + return eq$2(elm, SugarElement.fromDom(editor.getBody())); + }; + return closest$1(elm, 'a', isRoot).bind(function (a) { + return getOpt(a, 'href'); + }); + }; + var processReadonlyEvents = function (editor, e) { + if (isClickEvent(e) && !VK.metaKeyPressed(e)) { + var elm = SugarElement.fromDom(e.target); + getAnchorHrefOpt(editor, elm).each(function (href) { + e.preventDefault(); + if (/^#/.test(href)) { + var targetEl = editor.dom.select(href + ',[name="' + removeLeading(href, '#') + '"]'); + if (targetEl.length) { + editor.selection.scrollIntoView(targetEl[0], true); } + } else { + window.open(href, '_blank', 'rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes'); + } }); + } }; - var toggleGlobalEvents = function (state) { - if (state !== boundGlobalEvents) { - if (state) { - DomQuery(window).on('resize scroll', globalEventDelegate); + var registerReadOnlySelectionBlockers = function (editor) { + editor.on('ShowCaret', function (e) { + if (isReadOnly$1(editor)) { + e.preventDefault(); + } + }); + editor.on('ObjectSelected', function (e) { + if (isReadOnly$1(editor)) { + e.preventDefault(); + } + }); + }; + + var nativeEvents = Tools.makeMap('focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange ' + 'mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover ' + 'draggesture dragdrop drop drag submit ' + 'compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel', ' '); + var EventDispatcher = function () { + function EventDispatcher(settings) { + this.bindings = {}; + this.settings = settings || {}; + this.scope = this.settings.scope || this; + this.toggleEvent = this.settings.toggleEvent || never; + } + EventDispatcher.isNative = function (name) { + return !!nativeEvents[name.toLowerCase()]; + }; + EventDispatcher.prototype.fire = function (nameIn, argsIn) { + var name = nameIn.toLowerCase(); + var args = argsIn || {}; + args.type = name; + if (!args.target) { + args.target = this.scope; + } + if (!args.preventDefault) { + args.preventDefault = function () { + args.isDefaultPrevented = always; + }; + args.stopPropagation = function () { + args.isPropagationStopped = always; + }; + args.stopImmediatePropagation = function () { + args.isImmediatePropagationStopped = always; + }; + args.isDefaultPrevented = never; + args.isPropagationStopped = never; + args.isImmediatePropagationStopped = never; + } + if (this.settings.beforeFire) { + this.settings.beforeFire(args); + } + var handlers = this.bindings[name]; + if (handlers) { + for (var i = 0, l = handlers.length; i < l; i++) { + var callback = handlers[i]; + if (callback.once) { + this.off(name, callback.func); + } + if (args.isImmediatePropagationStopped()) { + args.stopPropagation(); + return args; + } + if (callback.func.call(this.scope, args) === false) { + args.preventDefault(); + return args; + } + } + } + return args; + }; + EventDispatcher.prototype.on = function (name, callback, prepend, extra) { + if (callback === false) { + callback = never; + } + if (callback) { + var wrappedCallback = { func: callback }; + if (extra) { + Tools.extend(wrappedCallback, extra); + } + var names = name.toLowerCase().split(' '); + var i = names.length; + while (i--) { + var currentName = names[i]; + var handlers = this.bindings[currentName]; + if (!handlers) { + handlers = this.bindings[currentName] = []; + this.toggleEvent(currentName, true); + } + if (prepend) { + handlers.unshift(wrappedCallback); } else { - DomQuery(window).off('resize scroll', globalEventDelegate); + handlers.push(wrappedCallback); } - boundGlobalEvents = state; + } } + return this; + }; + EventDispatcher.prototype.off = function (name, callback) { + var _this = this; + if (name) { + var names = name.toLowerCase().split(' '); + var i = names.length; + while (i--) { + var currentName = names[i]; + var handlers = this.bindings[currentName]; + if (!currentName) { + each$1(this.bindings, function (_value, bindingName) { + _this.toggleEvent(bindingName, false); + delete _this.bindings[bindingName]; + }); + return this; + } + if (handlers) { + if (!callback) { + handlers.length = 0; + } else { + var hi = handlers.length; + while (hi--) { + if (handlers[hi].func === callback) { + handlers = handlers.slice(0, hi).concat(handlers.slice(hi + 1)); + this.bindings[currentName] = handlers; + } + } + } + if (!handlers.length) { + this.toggleEvent(name, false); + delete this.bindings[currentName]; + } + } + } + } else { + each$1(this.bindings, function (_value, name) { + _this.toggleEvent(name, false); + }); + this.bindings = {}; + } + return this; + }; + EventDispatcher.prototype.once = function (name, callback, prepend) { + return this.on(name, callback, prepend, { once: true }); + }; + EventDispatcher.prototype.has = function (name) { + name = name.toLowerCase(); + return !(!this.bindings[name] || this.bindings[name].length === 0); + }; + return EventDispatcher; + }(); + + var getEventDispatcher = function (obj) { + if (!obj._eventDispatcher) { + obj._eventDispatcher = new EventDispatcher({ + scope: obj, + toggleEvent: function (name, state) { + if (EventDispatcher.isNative(name) && obj.toggleNativeEvent) { + obj.toggleNativeEvent(name, state); + } + } + }); + } + return obj._eventDispatcher; }; - var removeEditorFromList = function (targetEditor) { - var oldEditors = editors; - delete legacyEditors[targetEditor.id]; - for (var i = 0; i < legacyEditors.length; i++) { - if (legacyEditors[i] === targetEditor) { - legacyEditors.splice(i, 1); - break; + var Observable = { + fire: function (name, args, bubble) { + var self = this; + if (self.removed && name !== 'remove' && name !== 'detach') { + return args; + } + var dispatcherArgs = getEventDispatcher(self).fire(name, args); + if (bubble !== false && self.parent) { + var parent_1 = self.parent(); + while (parent_1 && !dispatcherArgs.isPropagationStopped()) { + parent_1.fire(name, dispatcherArgs, false); + parent_1 = parent_1.parent(); + } + } + return dispatcherArgs; + }, + on: function (name, callback, prepend) { + return getEventDispatcher(this).on(name, callback, prepend); + }, + off: function (name, callback) { + return getEventDispatcher(this).off(name, callback); + }, + once: function (name, callback) { + return getEventDispatcher(this).once(name, callback); + }, + hasEventListeners: function (name) { + return getEventDispatcher(this).has(name); + } + }; + + var DOM$8 = DOMUtils$1.DOM; + var customEventRootDelegates; + var getEventTarget = function (editor, eventName) { + if (eventName === 'selectionchange') { + return editor.getDoc(); + } + if (!editor.inline && /^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(eventName)) { + return editor.getDoc().documentElement; + } + var eventRoot = getEventRoot(editor); + if (eventRoot) { + if (!editor.eventRoot) { + editor.eventRoot = DOM$8.select(eventRoot)[0]; + } + return editor.eventRoot; + } + return editor.getBody(); + }; + var isListening = function (editor) { + return !editor.hidden && !isReadOnly$1(editor); + }; + var fireEvent = function (editor, eventName, e) { + if (isListening(editor)) { + editor.fire(eventName, e); + } else if (isReadOnly$1(editor)) { + processReadonlyEvents(editor, e); + } + }; + var bindEventDelegate = function (editor, eventName) { + var delegate; + if (!editor.delegates) { + editor.delegates = {}; + } + if (editor.delegates[eventName] || editor.removed) { + return; + } + var eventRootElm = getEventTarget(editor, eventName); + if (getEventRoot(editor)) { + if (!customEventRootDelegates) { + customEventRootDelegates = {}; + editor.editorManager.on('removeEditor', function () { + if (!editor.editorManager.activeEditor) { + if (customEventRootDelegates) { + each$1(customEventRootDelegates, function (_value, name) { + editor.dom.unbind(getEventTarget(editor, name)); + }); + customEventRootDelegates = null; + } } + }); } - editors = filter(editors, function (editor) { - return targetEditor !== editor; + if (customEventRootDelegates[eventName]) { + return; + } + delegate = function (e) { + var target = e.target; + var editors = editor.editorManager.get(); + var i = editors.length; + while (i--) { + var body = editors[i].getBody(); + if (body === target || DOM$8.isChildOf(target, body)) { + fireEvent(editors[i], eventName, e); + } + } + }; + customEventRootDelegates[eventName] = delegate; + DOM$8.bind(eventRootElm, eventName, delegate); + } else { + delegate = function (e) { + fireEvent(editor, eventName, e); + }; + DOM$8.bind(eventRootElm, eventName, delegate); + editor.delegates[eventName] = delegate; + } + }; + var EditorObservable = __assign(__assign({}, Observable), { + bindPendingEventDelegates: function () { + var self = this; + Tools.each(self._pendingNativeEvents, function (name) { + bindEventDelegate(self, name); }); - if (EditorManager.activeEditor === targetEditor) { - EditorManager.activeEditor = editors.length > 0 ? editors[0] : null; + }, + toggleNativeEvent: function (name, state) { + var self = this; + if (name === 'focus' || name === 'blur') { + return; } - if (EditorManager.focusedEditor === targetEditor) { - EditorManager.focusedEditor = null; + if (state) { + if (self.initialized) { + bindEventDelegate(self, name); + } else { + if (!self._pendingNativeEvents) { + self._pendingNativeEvents = [name]; + } else { + self._pendingNativeEvents.push(name); + } + } + } else if (self.initialized) { + self.dom.unbind(getEventTarget(self, name), name, self.delegates[name]); + delete self.delegates[name]; } - return oldEditors.length !== editors.length; + }, + unbindAllNativeEvents: function () { + var self = this; + var body = self.getBody(); + var dom = self.dom; + if (self.delegates) { + each$1(self.delegates, function (value, name) { + self.dom.unbind(getEventTarget(self, name), name, value); + }); + delete self.delegates; + } + if (!self.inline && body && dom) { + body.onload = null; + dom.unbind(self.getWin()); + dom.unbind(self.getDoc()); + } + if (dom) { + dom.unbind(body); + dom.unbind(self.getContainer()); + } + } + }); + + var defaultModes = [ + 'design', + 'readonly' + ]; + var switchToMode = function (editor, activeMode, availableModes, mode) { + var oldMode = availableModes[activeMode.get()]; + var newMode = availableModes[mode]; + try { + newMode.activate(); + } catch (e) { + console.error('problem while activating editor mode ' + mode + ':', e); + return; + } + oldMode.deactivate(); + if (oldMode.editorReadOnly !== newMode.editorReadOnly) { + toggleReadOnly(editor, newMode.editorReadOnly); + } + activeMode.set(mode); + fireSwitchMode(editor, mode); }; - var purgeDestroyedEditor = function (editor) { - if (editor && editor.initialized && !(editor.getContainer() || editor.getBody()).parentNode) { - removeEditorFromList(editor); - editor.unbindAllNativeEvents(); - editor.destroy(true); - editor.removed = true; - editor = null; + var setMode = function (editor, availableModes, activeMode, mode) { + if (mode === activeMode.get()) { + return; + } else if (!has(availableModes, mode)) { + throw new Error('Editor mode \'' + mode + '\' is invalid'); + } + if (editor.initialized) { + switchToMode(editor, activeMode, availableModes, mode); + } else { + editor.on('init', function () { + return switchToMode(editor, activeMode, availableModes, mode); + }); + } + }; + var registerMode = function (availableModes, mode, api) { + var _a; + if (contains(defaultModes, mode)) { + throw new Error('Cannot override default mode ' + mode); + } + return __assign(__assign({}, availableModes), (_a = {}, _a[mode] = __assign(__assign({}, api), { + deactivate: function () { + try { + api.deactivate(); + } catch (e) { + console.error('problem while deactivating editor mode ' + mode + ':', e); + } } - return editor; + }), _a)); }; - var isQuirksMode = document.compatMode !== 'CSS1Compat'; - var EditorManager = __assign(__assign({}, Observable), { - baseURI: null, - baseURL: null, - defaultSettings: {}, - documentBaseURL: null, - suffix: null, - $: DomQuery, - majorVersion: '5', - minorVersion: '6.2', - releaseDate: '2020-12-08', - editors: legacyEditors, - i18n: I18n, - activeEditor: null, - focusedEditor: null, - settings: {}, - setup: function () { - var self = this; - var baseURL, documentBaseURL, suffix = ''; - documentBaseURL = URI.getDocumentBaseUrl(document.location); - if (/^[^:]+:\/\/\/?[^\/]+\//.test(documentBaseURL)) { - documentBaseURL = documentBaseURL.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, ''); - if (!/[\/\\]$/.test(documentBaseURL)) { - documentBaseURL += '/'; - } - } - var preInit = window.tinymce || window.tinyMCEPreInit; - if (preInit) { - baseURL = preInit.base || preInit.baseURL; - suffix = preInit.suffix; - } else { - var scripts = document.getElementsByTagName('script'); - for (var i = 0; i < scripts.length; i++) { - var src = scripts[i].src || ''; - if (src === '') { - continue; - } - var srcScript = src.substring(src.lastIndexOf('/')); - if (/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(src)) { - if (srcScript.indexOf('.min') !== -1) { - suffix = '.min'; - } - baseURL = src.substring(0, src.lastIndexOf('/')); - break; - } - } - if (!baseURL && document.currentScript) { - var src = document.currentScript.src; - if (src.indexOf('.min') !== -1) { - suffix = '.min'; - } - baseURL = src.substring(0, src.lastIndexOf('/')); - } - } - self.baseURL = new URI(documentBaseURL).toAbsolute(baseURL); - self.documentBaseURL = documentBaseURL; - self.baseURI = new URI(self.baseURL); - self.suffix = suffix; - setup$2(self); + + var create$5 = function (editor) { + var activeMode = Cell('design'); + var availableModes = Cell({ + design: { + activate: noop, + deactivate: noop, + editorReadOnly: false }, - overrideDefaults: function (defaultSettings) { - var baseUrl = defaultSettings.base_url; - if (baseUrl) { - this._setBaseUrl(baseUrl); - } - var suffix = defaultSettings.suffix; - if (defaultSettings.suffix) { - this.suffix = suffix; - } - this.defaultSettings = defaultSettings; - var pluginBaseUrls = defaultSettings.plugin_base_urls; - if (pluginBaseUrls !== undefined) { - each$1(pluginBaseUrls, function (pluginBaseUrl, pluginName) { - AddOnManager$1.PluginManager.urls[pluginName] = pluginBaseUrl; - }); - } + readonly: { + activate: noop, + deactivate: noop, + editorReadOnly: true + } + }); + registerReadOnlyContentFilters(editor); + registerReadOnlySelectionBlockers(editor); + return { + isReadOnly: function () { + return isReadOnly$1(editor); }, - init: function (settings) { - var self = this; - var result; - var invalidInlineTargets = Tools.makeMap('area base basefont br col frame hr img input isindex link meta param embed source wbr track ' + 'colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu', ' '); - var isInvalidInlineTarget = function (settings, elm) { - return settings.inline && elm.tagName.toLowerCase() in invalidInlineTargets; - }; - var createId = function (elm) { - var id = elm.id; - if (!id) { - id = get$1(elm, 'name').filter(function (name) { - return !DOM$a.get(name); - }).getOrThunk(DOM$a.uniqueId); - elm.setAttribute('id', id); - } - return id; - }; - var execCallback = function (name) { - var callback = settings[name]; - if (!callback) { - return; - } - return callback.apply(self, Array.prototype.slice.call(arguments, 2)); - }; - var hasClass = function (elm, className) { - return className.constructor === RegExp ? className.test(elm.className) : DOM$a.hasClass(elm, className); - }; - var findTargets = function (settings) { - var targets = []; - if (Env.browser.isIE() && Env.browser.version.major < 11) { - initError('TinyMCE does not support the browser you are using. For a list of supported' + ' browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/'); - return []; - } else if (isQuirksMode) { - initError('Failed to initialize the editor as the document is not in standards mode. ' + 'TinyMCE requires standards mode.'); - return []; - } - if (settings.types) { - each$j(settings.types, function (type) { - targets = targets.concat(DOM$a.select(type.selector)); - }); - return targets; - } else if (settings.selector) { - return DOM$a.select(settings.selector); - } else if (settings.target) { - return [settings.target]; - } - switch (settings.mode) { - case 'exact': - var l = settings.elements || ''; - if (l.length > 0) { - each$j(explode$4(l), function (id) { - var elm = DOM$a.get(id); - if (elm) { - targets.push(elm); - } else { - each$j(document.forms, function (f) { - each$j(f.elements, function (e) { - if (e.name === id) { - id = 'mce_editor_' + instanceCounter++; - DOM$a.setAttrib(e, 'id', id); - targets.push(e); - } - }); - }); - } - }); - } - break; - case 'textareas': - case 'specific_textareas': - each$j(DOM$a.select('textarea'), function (elm) { - if (settings.editor_deselector && hasClass(elm, settings.editor_deselector)) { - return; - } - if (!settings.editor_selector || hasClass(elm, settings.editor_selector)) { - targets.push(elm); - } - }); - break; + set: function (mode) { + return setMode(editor, availableModes.get(), activeMode, mode); + }, + get: function () { + return activeMode.get(); + }, + register: function (mode, api) { + availableModes.set(registerMode(availableModes.get(), mode, api)); + } + }; + }; + + var each$g = Tools.each, explode$3 = Tools.explode; + var keyCodeLookup = { + f1: 112, + f2: 113, + f3: 114, + f4: 115, + f5: 116, + f6: 117, + f7: 118, + f8: 119, + f9: 120, + f10: 121, + f11: 122, + f12: 123 + }; + var modifierNames = Tools.makeMap('alt,ctrl,shift,meta,access'); + var Shortcuts = function () { + function Shortcuts(editor) { + this.shortcuts = {}; + this.pendingPatterns = []; + this.editor = editor; + var self = this; + editor.on('keyup keypress keydown', function (e) { + if ((self.hasModifier(e) || self.isFunctionKey(e)) && !e.isDefaultPrevented()) { + each$g(self.shortcuts, function (shortcut) { + if (self.matchShortcut(e, shortcut)) { + self.pendingPatterns = shortcut.subpatterns.slice(0); + if (e.type === 'keydown') { + self.executeShortcutAction(shortcut); } - return targets; - }; - var provideResults = function (editors) { - result = editors; - }; - var initEditors = function () { - var initCount = 0; - var editors = []; - var targets; - var createEditor = function (id, settings, targetElm) { - var editor = new Editor(id, settings, self); - editors.push(editor); - editor.on('init', function () { - if (++initCount === targets.length) { - provideResults(editors); - } - }); - editor.targetElm = editor.targetElm || targetElm; - editor.render(); - }; - DOM$a.unbind(window, 'ready', initEditors); - execCallback('onpageload'); - targets = DomQuery.unique(findTargets(settings)); - if (settings.types) { - each$j(settings.types, function (type) { - Tools.each(targets, function (elm) { - if (DOM$a.is(elm, type.selector)) { - createEditor(createId(elm), extend$4({}, settings, type), elm); - return false; - } - return true; - }); - }); - return; + return true; + } + }); + if (self.matchShortcut(e, self.pendingPatterns[0])) { + if (self.pendingPatterns.length === 1) { + if (e.type === 'keydown') { + self.executeShortcutAction(self.pendingPatterns[0]); } - Tools.each(targets, function (elm) { - purgeDestroyedEditor(self.get(elm.id)); - }); - targets = Tools.grep(targets, function (elm) { - return !self.get(elm.id); - }); - if (targets.length === 0) { - provideResults([]); + } + self.pendingPatterns.shift(); + } + } + }); + } + Shortcuts.prototype.add = function (pattern, desc, cmdFunc, scope) { + var self = this; + var func = self.normalizeCommandFunc(cmdFunc); + each$g(explode$3(Tools.trim(pattern)), function (pattern) { + var shortcut = self.createShortcut(pattern, desc, func, scope); + self.shortcuts[shortcut.id] = shortcut; + }); + return true; + }; + Shortcuts.prototype.remove = function (pattern) { + var shortcut = this.createShortcut(pattern); + if (this.shortcuts[shortcut.id]) { + delete this.shortcuts[shortcut.id]; + return true; + } + return false; + }; + Shortcuts.prototype.normalizeCommandFunc = function (cmdFunc) { + var self = this; + var cmd = cmdFunc; + if (typeof cmd === 'string') { + return function () { + self.editor.execCommand(cmd, false, null); + }; + } else if (Tools.isArray(cmd)) { + return function () { + self.editor.execCommand(cmd[0], cmd[1], cmd[2]); + }; + } else { + return cmd; + } + }; + Shortcuts.prototype.parseShortcut = function (pattern) { + var key; + var shortcut = {}; + each$g(explode$3(pattern.toLowerCase(), '+'), function (value) { + if (value in modifierNames) { + shortcut[value] = true; + } else { + if (/^[0-9]{2,}$/.test(value)) { + shortcut.keyCode = parseInt(value, 10); + } else { + shortcut.charCode = value.charCodeAt(0); + shortcut.keyCode = keyCodeLookup[value] || value.toUpperCase().charCodeAt(0); + } + } + }); + var id = [shortcut.keyCode]; + for (key in modifierNames) { + if (shortcut[key]) { + id.push(key); + } else { + shortcut[key] = false; + } + } + shortcut.id = id.join(','); + if (shortcut.access) { + shortcut.alt = true; + if (Env.mac) { + shortcut.ctrl = true; + } else { + shortcut.shift = true; + } + } + if (shortcut.meta) { + if (Env.mac) { + shortcut.meta = true; + } else { + shortcut.ctrl = true; + shortcut.meta = false; + } + } + return shortcut; + }; + Shortcuts.prototype.createShortcut = function (pattern, desc, cmdFunc, scope) { + var shortcuts = Tools.map(explode$3(pattern, '>'), this.parseShortcut); + shortcuts[shortcuts.length - 1] = Tools.extend(shortcuts[shortcuts.length - 1], { + func: cmdFunc, + scope: scope || this.editor + }); + return Tools.extend(shortcuts[0], { + desc: this.editor.translate(desc), + subpatterns: shortcuts.slice(1) + }); + }; + Shortcuts.prototype.hasModifier = function (e) { + return e.altKey || e.ctrlKey || e.metaKey; + }; + Shortcuts.prototype.isFunctionKey = function (e) { + return e.type === 'keydown' && e.keyCode >= 112 && e.keyCode <= 123; + }; + Shortcuts.prototype.matchShortcut = function (e, shortcut) { + if (!shortcut) { + return false; + } + if (shortcut.ctrl !== e.ctrlKey || shortcut.meta !== e.metaKey) { + return false; + } + if (shortcut.alt !== e.altKey || shortcut.shift !== e.shiftKey) { + return false; + } + if (e.keyCode === shortcut.keyCode || e.charCode && e.charCode === shortcut.charCode) { + e.preventDefault(); + return true; + } + return false; + }; + Shortcuts.prototype.executeShortcutAction = function (shortcut) { + return shortcut.func ? shortcut.func.call(shortcut.scope) : null; + }; + return Shortcuts; + }(); + + var create$6 = function () { + var buttons = {}; + var menuItems = {}; + var popups = {}; + var icons = {}; + var contextMenus = {}; + var contextToolbars = {}; + var sidebars = {}; + var add = function (collection, type) { + return function (name, spec) { + return collection[name.toLowerCase()] = __assign(__assign({}, spec), { type: type }); + }; + }; + var addIcon = function (name, svgData) { + return icons[name.toLowerCase()] = svgData; + }; + return { + addButton: add(buttons, 'button'), + addGroupToolbarButton: add(buttons, 'grouptoolbarbutton'), + addToggleButton: add(buttons, 'togglebutton'), + addMenuButton: add(buttons, 'menubutton'), + addSplitButton: add(buttons, 'splitbutton'), + addMenuItem: add(menuItems, 'menuitem'), + addNestedMenuItem: add(menuItems, 'nestedmenuitem'), + addToggleMenuItem: add(menuItems, 'togglemenuitem'), + addAutocompleter: add(popups, 'autocompleter'), + addContextMenu: add(contextMenus, 'contextmenu'), + addContextToolbar: add(contextToolbars, 'contexttoolbar'), + addContextForm: add(contextToolbars, 'contextform'), + addSidebar: add(sidebars, 'sidebar'), + addIcon: addIcon, + getAll: function () { + return { + buttons: buttons, + menuItems: menuItems, + icons: icons, + popups: popups, + contextMenus: contextMenus, + contextToolbars: contextToolbars, + sidebars: sidebars + }; + } + }; + }; + + var registry = function () { + var bridge = create$6(); + return { + addAutocompleter: bridge.addAutocompleter, + addButton: bridge.addButton, + addContextForm: bridge.addContextForm, + addContextMenu: bridge.addContextMenu, + addContextToolbar: bridge.addContextToolbar, + addIcon: bridge.addIcon, + addMenuButton: bridge.addMenuButton, + addMenuItem: bridge.addMenuItem, + addNestedMenuItem: bridge.addNestedMenuItem, + addSidebar: bridge.addSidebar, + addSplitButton: bridge.addSplitButton, + addToggleButton: bridge.addToggleButton, + addGroupToolbarButton: bridge.addGroupToolbarButton, + addToggleMenuItem: bridge.addToggleMenuItem, + getAll: bridge.getAll + }; + }; + + var each$h = Tools.each, trim$4 = Tools.trim; + var queryParts = 'source protocol authority userInfo user password host port relative path directory file query anchor'.split(' '); + var DEFAULT_PORTS = { + ftp: 21, + http: 80, + https: 443, + mailto: 25 + }; + var URI = function () { + function URI(url, settings) { + url = trim$4(url); + this.settings = settings || {}; + var baseUri = this.settings.base_uri; + var self = this; + if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) { + self.source = url; + return; + } + var isProtocolRelative = url.indexOf('//') === 0; + if (url.indexOf('/') === 0 && !isProtocolRelative) { + url = (baseUri ? baseUri.protocol || 'http' : 'http') + '://mce_host' + url; + } + if (!/^[\w\-]*:?\/\//.test(url)) { + var baseUrl = this.settings.base_uri ? this.settings.base_uri.path : new URI(document.location.href).directory; + if (this.settings.base_uri && this.settings.base_uri.protocol == '') { + url = '//mce_host' + self.toAbsPath(baseUrl, url); + } else { + var match = /([^#?]*)([#?]?.*)/.exec(url); + url = (baseUri && baseUri.protocol || 'http') + '://mce_host' + self.toAbsPath(baseUrl, match[1]) + match[2]; + } + } + url = url.replace(/@@/g, '(mce_at)'); + var urlMatch = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url); + each$h(queryParts, function (v, i) { + var part = urlMatch[i]; + if (part) { + part = part.replace(/\(mce_at\)/g, '@@'); + } + self[v] = part; + }); + if (baseUri) { + if (!self.protocol) { + self.protocol = baseUri.protocol; + } + if (!self.userInfo) { + self.userInfo = baseUri.userInfo; + } + if (!self.port && self.host === 'mce_host') { + self.port = baseUri.port; + } + if (!self.host || self.host === 'mce_host') { + self.host = baseUri.host; + } + self.source = ''; + } + if (isProtocolRelative) { + self.protocol = ''; + } + } + URI.parseDataUri = function (uri) { + var type; + var uriComponents = decodeURIComponent(uri).split(','); + var matches = /data:([^;]+)/.exec(uriComponents[0]); + if (matches) { + type = matches[1]; + } + return { + type: type, + data: uriComponents[1] + }; + }; + URI.getDocumentBaseUrl = function (loc) { + var baseUrl; + if (loc.protocol.indexOf('http') !== 0 && loc.protocol !== 'file:') { + baseUrl = loc.href; + } else { + baseUrl = loc.protocol + '//' + loc.host + loc.pathname; + } + if (/^[^:]+:\/\/\/?[^\/]+\//.test(baseUrl)) { + baseUrl = baseUrl.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, ''); + if (!/[\/\\]$/.test(baseUrl)) { + baseUrl += '/'; + } + } + return baseUrl; + }; + URI.prototype.setPath = function (path) { + var pathMatch = /^(.*?)\/?(\w+)?$/.exec(path); + this.path = pathMatch[0]; + this.directory = pathMatch[1]; + this.file = pathMatch[2]; + this.source = ''; + this.getURI(); + }; + URI.prototype.toRelative = function (uri) { + var output; + if (uri === './') { + return uri; + } + var relativeUri = new URI(uri, { base_uri: this }); + if (relativeUri.host !== 'mce_host' && this.host !== relativeUri.host && relativeUri.host || this.port !== relativeUri.port || this.protocol !== relativeUri.protocol && relativeUri.protocol !== '') { + return relativeUri.getURI(); + } + var tu = this.getURI(), uu = relativeUri.getURI(); + if (tu === uu || tu.charAt(tu.length - 1) === '/' && tu.substr(0, tu.length - 1) === uu) { + return tu; + } + output = this.toRelPath(this.path, relativeUri.path); + if (relativeUri.query) { + output += '?' + relativeUri.query; + } + if (relativeUri.anchor) { + output += '#' + relativeUri.anchor; + } + return output; + }; + URI.prototype.toAbsolute = function (uri, noHost) { + var absoluteUri = new URI(uri, { base_uri: this }); + return absoluteUri.getURI(noHost && this.isSameOrigin(absoluteUri)); + }; + URI.prototype.isSameOrigin = function (uri) { + if (this.host == uri.host && this.protocol == uri.protocol) { + if (this.port == uri.port) { + return true; + } + var defaultPort = DEFAULT_PORTS[this.protocol]; + if (defaultPort && (this.port || defaultPort) == (uri.port || defaultPort)) { + return true; + } + } + return false; + }; + URI.prototype.toRelPath = function (base, path) { + var breakPoint = 0, out = '', i, l; + var normalizedBase = base.substring(0, base.lastIndexOf('/')).split('/'); + var items = path.split('/'); + if (normalizedBase.length >= items.length) { + for (i = 0, l = normalizedBase.length; i < l; i++) { + if (i >= items.length || normalizedBase[i] !== items[i]) { + breakPoint = i + 1; + break; + } + } + } + if (normalizedBase.length < items.length) { + for (i = 0, l = items.length; i < l; i++) { + if (i >= normalizedBase.length || normalizedBase[i] !== items[i]) { + breakPoint = i + 1; + break; + } + } + } + if (breakPoint === 1) { + return path; + } + for (i = 0, l = normalizedBase.length - (breakPoint - 1); i < l; i++) { + out += '../'; + } + for (i = breakPoint - 1, l = items.length; i < l; i++) { + if (i !== breakPoint - 1) { + out += '/' + items[i]; + } else { + out += items[i]; + } + } + return out; + }; + URI.prototype.toAbsPath = function (base, path) { + var i, nb = 0, o = [], outPath; + var tr = /\/$/.test(path) ? '/' : ''; + var normalizedBase = base.split('/'); + var normalizedPath = path.split('/'); + each$h(normalizedBase, function (k) { + if (k) { + o.push(k); + } + }); + normalizedBase = o; + for (i = normalizedPath.length - 1, o = []; i >= 0; i--) { + if (normalizedPath[i].length === 0 || normalizedPath[i] === '.') { + continue; + } + if (normalizedPath[i] === '..') { + nb++; + continue; + } + if (nb > 0) { + nb--; + continue; + } + o.push(normalizedPath[i]); + } + i = normalizedBase.length - nb; + if (i <= 0) { + outPath = reverse(o).join('/'); + } else { + outPath = normalizedBase.slice(0, i).join('/') + '/' + reverse(o).join('/'); + } + if (outPath.indexOf('/') !== 0) { + outPath = '/' + outPath; + } + if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) { + outPath += tr; + } + return outPath; + }; + URI.prototype.getURI = function (noProtoHost) { + if (noProtoHost === void 0) { + noProtoHost = false; + } + var s; + if (!this.source || noProtoHost) { + s = ''; + if (!noProtoHost) { + if (this.protocol) { + s += this.protocol + '://'; + } else { + s += '//'; + } + if (this.userInfo) { + s += this.userInfo + '@'; + } + if (this.host) { + s += this.host; + } + if (this.port) { + s += ':' + this.port; + } + } + if (this.path) { + s += this.path; + } + if (this.query) { + s += '?' + this.query; + } + if (this.anchor) { + s += '#' + this.anchor; + } + this.source = s; + } + return this.source; + }; + return URI; + }(); + + var DOM$9 = DOMUtils$1.DOM; + var extend$3 = Tools.extend, each$i = Tools.each; + var resolve$3 = Tools.resolve; + var ie$1 = Env.ie; + var Editor = function () { + function Editor(id, settings, editorManager) { + var _this = this; + this.plugins = {}; + this.contentCSS = []; + this.contentStyles = []; + this.loadedCSS = {}; + this.isNotDirty = false; + this.editorManager = editorManager; + this.documentBaseUrl = editorManager.documentBaseURL; + extend$3(this, EditorObservable); + this.settings = getEditorSettings(this, id, this.documentBaseUrl, editorManager.defaultSettings, settings); + if (this.settings.suffix) { + editorManager.suffix = this.settings.suffix; + } + this.suffix = editorManager.suffix; + if (this.settings.base_url) { + editorManager._setBaseUrl(this.settings.base_url); + } + this.baseUri = editorManager.baseURI; + if (this.settings.referrer_policy) { + ScriptLoader.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy); + DOMUtils$1.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy); + } + AddOnManager$1.languageLoad = this.settings.language_load; + AddOnManager$1.baseURL = editorManager.baseURL; + this.id = id; + this.setDirty(false); + this.documentBaseURI = new URI(this.settings.document_base_url, { base_uri: this.baseUri }); + this.baseURI = this.baseUri; + this.inline = !!this.settings.inline; + this.shortcuts = new Shortcuts(this); + this.editorCommands = new EditorCommands(this); + if (this.settings.cache_suffix) { + Env.cacheSuffix = this.settings.cache_suffix.replace(/^[\?\&]+/, ''); + } + this.ui = { + registry: registry(), + styleSheetLoader: undefined, + show: noop, + hide: noop, + enable: noop, + disable: noop, + isDisabled: never + }; + var self = this; + var modeInstance = create$5(self); + this.mode = modeInstance; + this.setMode = modeInstance.set; + editorManager.fire('SetupEditor', { editor: this }); + this.execCallback('setup', this); + this.$ = DomQuery.overrideDefaults(function () { + return { + context: _this.inline ? _this.getBody() : _this.getDoc(), + element: _this.getBody() + }; + }); + } + Editor.prototype.render = function () { + render(this); + }; + Editor.prototype.focus = function (skipFocus) { + focus$1(this, skipFocus); + }; + Editor.prototype.hasFocus = function () { + return hasFocus$1(this); + }; + Editor.prototype.execCallback = function (name) { + var x = []; + for (var _i = 1; _i < arguments.length; _i++) { + x[_i - 1] = arguments[_i]; + } + var self = this; + var callback = self.settings[name], scope; + if (!callback) { + return; + } + if (self.callbackLookup && (scope = self.callbackLookup[name])) { + callback = scope.func; + scope = scope.scope; + } + if (typeof callback === 'string') { + scope = callback.replace(/\.\w+$/, ''); + scope = scope ? resolve$3(scope) : 0; + callback = resolve$3(callback); + self.callbackLookup = self.callbackLookup || {}; + self.callbackLookup[name] = { + func: callback, + scope: scope + }; + } + return callback.apply(scope || self, x); + }; + Editor.prototype.translate = function (text) { + return I18n.translate(text); + }; + Editor.prototype.getParam = function (name, defaultVal, type) { + return getParam(this, name, defaultVal, type); + }; + Editor.prototype.hasPlugin = function (name, loaded) { + var hasPlugin = contains(getPlugins(this).split(/[ ,]/), name); + if (hasPlugin) { + return loaded ? PluginManager.get(name) !== undefined : true; + } else { + return false; + } + }; + Editor.prototype.nodeChanged = function (args) { + this._nodeChangeDispatcher.nodeChanged(args); + }; + Editor.prototype.addCommand = function (name, callback, scope) { + this.editorCommands.addCommand(name, callback, scope); + }; + Editor.prototype.addQueryStateHandler = function (name, callback, scope) { + this.editorCommands.addQueryStateHandler(name, callback, scope); + }; + Editor.prototype.addQueryValueHandler = function (name, callback, scope) { + this.editorCommands.addQueryValueHandler(name, callback, scope); + }; + Editor.prototype.addShortcut = function (pattern, desc, cmdFunc, scope) { + this.shortcuts.add(pattern, desc, cmdFunc, scope); + }; + Editor.prototype.execCommand = function (cmd, ui, value, args) { + return this.editorCommands.execCommand(cmd, ui, value, args); + }; + Editor.prototype.queryCommandState = function (cmd) { + return this.editorCommands.queryCommandState(cmd); + }; + Editor.prototype.queryCommandValue = function (cmd) { + return this.editorCommands.queryCommandValue(cmd); + }; + Editor.prototype.queryCommandSupported = function (cmd) { + return this.editorCommands.queryCommandSupported(cmd); + }; + Editor.prototype.show = function () { + var self = this; + if (self.hidden) { + self.hidden = false; + if (self.inline) { + self.getBody().contentEditable = 'true'; + } else { + DOM$9.show(self.getContainer()); + DOM$9.hide(self.id); + } + self.load(); + self.fire('show'); + } + }; + Editor.prototype.hide = function () { + var self = this, doc = self.getDoc(); + if (!self.hidden) { + if (ie$1 && doc && !self.inline) { + doc.execCommand('SelectAll'); + } + self.save(); + if (self.inline) { + self.getBody().contentEditable = 'false'; + if (self === self.editorManager.focusedEditor) { + self.editorManager.focusedEditor = null; + } + } else { + DOM$9.hide(self.getContainer()); + DOM$9.setStyle(self.id, 'display', self.orgDisplay); + } + self.hidden = true; + self.fire('hide'); + } + }; + Editor.prototype.isHidden = function () { + return !!this.hidden; + }; + Editor.prototype.setProgressState = function (state, time) { + this.fire('ProgressState', { + state: state, + time: time + }); + }; + Editor.prototype.load = function (args) { + var self = this; + var elm = self.getElement(), html; + if (self.removed) { + return ''; + } + if (elm) { + args = args || {}; + args.load = true; + var value = isTextareaOrInput(elm) ? elm.value : elm.innerHTML; + html = self.setContent(value, args); + args.element = elm; + if (!args.no_events) { + self.fire('LoadContent', args); + } + args.element = elm = null; + return html; + } + }; + Editor.prototype.save = function (args) { + var self = this; + var elm = self.getElement(), html, form; + if (!elm || !self.initialized || self.removed) { + return; + } + args = args || {}; + args.save = true; + args.element = elm; + html = args.content = self.getContent(args); + if (!args.no_events) { + self.fire('SaveContent', args); + } + if (args.format === 'raw') { + self.fire('RawSaveContent', args); + } + html = args.content; + if (!isTextareaOrInput(elm)) { + if (args.is_removing || !self.inline) { + elm.innerHTML = html; + } + if (form = DOM$9.getParent(self.id, 'form')) { + each$i(form.elements, function (elm) { + if (elm.name === self.id) { + elm.value = html; + return false; + } + }); + } + } else { + elm.value = html; + } + args.element = elm = null; + if (args.set_dirty !== false) { + self.setDirty(false); + } + return html; + }; + Editor.prototype.setContent = function (content, args) { + return setContent$2(this, content, args); + }; + Editor.prototype.getContent = function (args) { + return getContent$2(this, args); + }; + Editor.prototype.insertContent = function (content, args) { + if (args) { + content = extend$3({ content: content }, args); + } + this.execCommand('mceInsertContent', false, content); + }; + Editor.prototype.resetContent = function (initialContent) { + if (initialContent === undefined) { + setContent$2(this, this.startContent, { format: 'raw' }); + } else { + setContent$2(this, initialContent); + } + this.undoManager.reset(); + this.setDirty(false); + this.nodeChanged(); + }; + Editor.prototype.isDirty = function () { + return !this.isNotDirty; + }; + Editor.prototype.setDirty = function (state) { + var oldState = !this.isNotDirty; + this.isNotDirty = !state; + if (state && state !== oldState) { + this.fire('dirty'); + } + }; + Editor.prototype.getContainer = function () { + var self = this; + if (!self.container) { + self.container = DOM$9.get(self.editorContainer || self.id + '_parent'); + } + return self.container; + }; + Editor.prototype.getContentAreaContainer = function () { + return this.contentAreaContainer; + }; + Editor.prototype.getElement = function () { + if (!this.targetElm) { + this.targetElm = DOM$9.get(this.id); + } + return this.targetElm; + }; + Editor.prototype.getWin = function () { + var self = this; + var elm; + if (!self.contentWindow) { + elm = self.iframeElement; + if (elm) { + self.contentWindow = elm.contentWindow; + } + } + return self.contentWindow; + }; + Editor.prototype.getDoc = function () { + var self = this; + var win; + if (!self.contentDocument) { + win = self.getWin(); + if (win) { + self.contentDocument = win.document; + } + } + return self.contentDocument; + }; + Editor.prototype.getBody = function () { + var doc = this.getDoc(); + return this.bodyElement || (doc ? doc.body : null); + }; + Editor.prototype.convertURL = function (url, name, elm) { + var self = this, settings = self.settings; + if (settings.urlconverter_callback) { + return self.execCallback('urlconverter_callback', url, elm, true, name); + } + if (!settings.convert_urls || elm && elm.nodeName === 'LINK' || url.indexOf('file:') === 0 || url.length === 0) { + return url; + } + if (settings.relative_urls) { + return self.documentBaseURI.toRelative(url); + } + url = self.documentBaseURI.toAbsolute(url, settings.remove_script_host); + return url; + }; + Editor.prototype.addVisual = function (elm) { + addVisual$1(this, elm); + }; + Editor.prototype.remove = function () { + remove$7(this); + }; + Editor.prototype.destroy = function (automatic) { + destroy(this, automatic); + }; + Editor.prototype.uploadImages = function (callback) { + return this.editorUpload.uploadImages(callback); + }; + Editor.prototype._scanForImages = function () { + return this.editorUpload.scanForImages(); + }; + Editor.prototype.addButton = function () { + throw new Error('editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead'); + }; + Editor.prototype.addSidebar = function () { + throw new Error('editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead'); + }; + Editor.prototype.addMenuItem = function () { + throw new Error('editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead'); + }; + Editor.prototype.addContextToolbar = function () { + throw new Error('editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead'); + }; + return Editor; + }(); + + var DOM$a = DOMUtils$1.DOM; + var explode$4 = Tools.explode, each$j = Tools.each, extend$4 = Tools.extend; + var instanceCounter = 0, boundGlobalEvents = false; + var beforeUnloadDelegate; + var legacyEditors = []; + var editors = []; + var isValidLegacyKey = function (id) { + return id !== 'length'; + }; + var globalEventDelegate = function (e) { + var type = e.type; + each$j(EditorManager.get(), function (editor) { + switch (type) { + case 'scroll': + editor.fire('ScrollWindow', e); + break; + case 'resize': + editor.fire('ResizeWindow', e); + break; + } + }); + }; + var toggleGlobalEvents = function (state) { + if (state !== boundGlobalEvents) { + if (state) { + DomQuery(window).on('resize scroll', globalEventDelegate); + } else { + DomQuery(window).off('resize scroll', globalEventDelegate); + } + boundGlobalEvents = state; + } + }; + var removeEditorFromList = function (targetEditor) { + var oldEditors = editors; + delete legacyEditors[targetEditor.id]; + for (var i = 0; i < legacyEditors.length; i++) { + if (legacyEditors[i] === targetEditor) { + legacyEditors.splice(i, 1); + break; + } + } + editors = filter(editors, function (editor) { + return targetEditor !== editor; + }); + if (EditorManager.activeEditor === targetEditor) { + EditorManager.activeEditor = editors.length > 0 ? editors[0] : null; + } + if (EditorManager.focusedEditor === targetEditor) { + EditorManager.focusedEditor = null; + } + return oldEditors.length !== editors.length; + }; + var purgeDestroyedEditor = function (editor) { + if (editor && editor.initialized && !(editor.getContainer() || editor.getBody()).parentNode) { + removeEditorFromList(editor); + editor.unbindAllNativeEvents(); + editor.destroy(true); + editor.removed = true; + editor = null; + } + return editor; + }; + var isQuirksMode = document.compatMode !== 'CSS1Compat'; + var EditorManager = __assign(__assign({}, Observable), { + baseURI: null, + baseURL: null, + defaultSettings: {}, + documentBaseURL: null, + suffix: null, + $: DomQuery, + majorVersion: '5', + minorVersion: '6.2', + releaseDate: '2020-12-08', + editors: legacyEditors, + i18n: I18n, + activeEditor: null, + focusedEditor: null, + settings: {}, + setup: function () { + var self = this; + var baseURL, documentBaseURL, suffix = ''; + documentBaseURL = URI.getDocumentBaseUrl(document.location); + if (/^[^:]+:\/\/\/?[^\/]+\//.test(documentBaseURL)) { + documentBaseURL = documentBaseURL.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, ''); + if (!/[\/\\]$/.test(documentBaseURL)) { + documentBaseURL += '/'; + } + } + var preInit = window.tinymce || window.tinyMCEPreInit; + if (preInit) { + baseURL = preInit.base || preInit.baseURL; + suffix = preInit.suffix; + } else { + var scripts = document.getElementsByTagName('script'); + for (var i = 0; i < scripts.length; i++) { + var src = scripts[i].src || ''; + if (src === '') { + continue; + } + var srcScript = src.substring(src.lastIndexOf('/')); + if (/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(src)) { + if (srcScript.indexOf('.min') !== -1) { + suffix = '.min'; + } + baseURL = src.substring(0, src.lastIndexOf('/')); + break; + } + } + if (!baseURL && document.currentScript) { + var src = document.currentScript.src; + if (src.indexOf('.min') !== -1) { + suffix = '.min'; + } + baseURL = src.substring(0, src.lastIndexOf('/')); + } + } + self.baseURL = new URI(documentBaseURL).toAbsolute(baseURL); + self.documentBaseURL = documentBaseURL; + self.baseURI = new URI(self.baseURL); + self.suffix = suffix; + setup$2(self); + }, + overrideDefaults: function (defaultSettings) { + var baseUrl = defaultSettings.base_url; + if (baseUrl) { + this._setBaseUrl(baseUrl); + } + var suffix = defaultSettings.suffix; + if (defaultSettings.suffix) { + this.suffix = suffix; + } + this.defaultSettings = defaultSettings; + var pluginBaseUrls = defaultSettings.plugin_base_urls; + if (pluginBaseUrls !== undefined) { + each$1(pluginBaseUrls, function (pluginBaseUrl, pluginName) { + AddOnManager$1.PluginManager.urls[pluginName] = pluginBaseUrl; + }); + } + }, + init: function (settings) { + var self = this; + var result; + var invalidInlineTargets = Tools.makeMap('area base basefont br col frame hr img input isindex link meta param embed source wbr track ' + 'colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu', ' '); + var isInvalidInlineTarget = function (settings, elm) { + return settings.inline && elm.tagName.toLowerCase() in invalidInlineTargets; + }; + var createId = function (elm) { + var id = elm.id; + if (!id) { + id = get$1(elm, 'name').filter(function (name) { + return !DOM$a.get(name); + }).getOrThunk(DOM$a.uniqueId); + elm.setAttribute('id', id); + } + return id; + }; + var execCallback = function (name) { + var callback = settings[name]; + if (!callback) { + return; + } + return callback.apply(self, Array.prototype.slice.call(arguments, 2)); + }; + var hasClass = function (elm, className) { + return className.constructor === RegExp ? className.test(elm.className) : DOM$a.hasClass(elm, className); + }; + var findTargets = function (settings) { + var targets = []; + if (Env.browser.isIE() && Env.browser.version.major < 11) { + initError('TinyMCE does not support the browser you are using. For a list of supported' + ' browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/'); + return []; + } else if (isQuirksMode) { + initError('Failed to initialize the editor as the document is not in standards mode. ' + 'TinyMCE requires standards mode.'); + return []; + } + if (settings.types) { + each$j(settings.types, function (type) { + targets = targets.concat(DOM$a.select(type.selector)); + }); + return targets; + } else if (settings.selector) { + return DOM$a.select(settings.selector); + } else if (settings.target) { + return [settings.target]; + } + switch (settings.mode) { + case 'exact': + var l = settings.elements || ''; + if (l.length > 0) { + each$j(explode$4(l), function (id) { + var elm = DOM$a.get(id); + if (elm) { + targets.push(elm); } else { - each$j(targets, function (elm) { - if (isInvalidInlineTarget(settings, elm)) { - initError('Could not initialize inline editor on invalid inline target element', elm); - } else { - createEditor(createId(elm), settings, elm); - } + each$j(document.forms, function (f) { + each$j(f.elements, function (e) { + if (e.name === id) { + id = 'mce_editor_' + instanceCounter++; + DOM$a.setAttrib(e, 'id', id); + targets.push(e); + } }); + }); } - }; - self.settings = settings; - DOM$a.bind(window, 'ready', initEditors); - return new promiseObj(function (resolve) { - if (result) { - resolve(result); - } else { - provideResults = function (editors) { - resolve(editors); - }; - } - }); - }, - get: function (id) { - if (arguments.length === 0) { - return editors.slice(0); - } else if (isString(id)) { - return find(editors, function (editor) { - return editor.id === id; - }).getOr(null); - } else if (isNumber(id)) { - return editors[id] ? editors[id] : null; - } else { - return null; - } - }, - add: function (editor) { - var self = this; - var existingEditor = legacyEditors[editor.id]; - if (existingEditor === editor) { - return editor; - } - if (self.get(editor.id) === null) { - if (isValidLegacyKey(editor.id)) { - legacyEditors[editor.id] = editor; - } - legacyEditors.push(editor); - editors.push(editor); - } - toggleGlobalEvents(true); - self.activeEditor = editor; - self.fire('AddEditor', {editor: editor}); - if (!beforeUnloadDelegate) { - beforeUnloadDelegate = function (e) { - var event = self.fire('BeforeUnload'); - if (event.returnValue) { - e.preventDefault(); - e.returnValue = event.returnValue; - return event.returnValue; - } - }; - window.addEventListener('beforeunload', beforeUnloadDelegate); - } - return editor; - }, - createEditor: function (id, settings) { - return this.add(new Editor(id, settings, this)); - }, - remove: function (selector) { - var self = this; - var i, editor; - if (!selector) { - for (i = editors.length - 1; i >= 0; i--) { - self.remove(editors[i]); - } - return; + }); } - if (isString(selector)) { - each$j(DOM$a.select(selector), function (elm) { - editor = self.get(elm.id); - if (editor) { - self.remove(editor); - } - }); + break; + case 'textareas': + case 'specific_textareas': + each$j(DOM$a.select('textarea'), function (elm) { + if (settings.editor_deselector && hasClass(elm, settings.editor_deselector)) { return; - } - editor = selector; - if (isNull(self.get(editor.id))) { - return null; - } - if (removeEditorFromList(editor)) { - self.fire('RemoveEditor', {editor: editor}); - } - if (editors.length === 0) { - window.removeEventListener('beforeunload', beforeUnloadDelegate); - } - editor.remove(); - toggleGlobalEvents(editors.length > 0); - return editor; - }, - execCommand: function (cmd, ui, value) { - var self = this, editor = self.get(value); - switch (cmd) { - case 'mceAddEditor': - if (!self.get(value)) { - new Editor(value, self.settings, self).render(); - } - return true; - case 'mceRemoveEditor': - if (editor) { - editor.remove(); - } - return true; - case 'mceToggleEditor': - if (!editor) { - self.execCommand('mceAddEditor', 0, value); - return true; - } - if (editor.isHidden()) { - editor.show(); - } else { - editor.hide(); - } - return true; - } - if (self.activeEditor) { - return self.activeEditor.execCommand(cmd, ui, value); - } - return false; - }, - triggerSave: function () { - each$j(editors, function (editor) { - editor.save(); + } + if (!settings.editor_selector || hasClass(elm, settings.editor_selector)) { + targets.push(elm); + } + }); + break; + } + return targets; + }; + var provideResults = function (editors) { + result = editors; + }; + var initEditors = function () { + var initCount = 0; + var editors = []; + var targets; + var createEditor = function (id, settings, targetElm) { + var editor = new Editor(id, settings, self); + editors.push(editor); + editor.on('init', function () { + if (++initCount === targets.length) { + provideResults(editors); + } }); - }, - addI18n: function (code, items) { - I18n.add(code, items); - }, - translate: function (text) { - return I18n.translate(text); - }, - setActive: function (editor) { - var activeEditor = this.activeEditor; - if (this.activeEditor !== editor) { - if (activeEditor) { - activeEditor.fire('deactivate', {relatedTarget: editor}); + editor.targetElm = editor.targetElm || targetElm; + editor.render(); + }; + DOM$a.unbind(window, 'ready', initEditors); + execCallback('onpageload'); + targets = DomQuery.unique(findTargets(settings)); + if (settings.types) { + each$j(settings.types, function (type) { + Tools.each(targets, function (elm) { + if (DOM$a.is(elm, type.selector)) { + createEditor(createId(elm), extend$4({}, settings, type), elm); + return false; } - editor.fire('activate', {relatedTarget: activeEditor}); - } - this.activeEditor = editor; - }, - _setBaseUrl: function (baseUrl) { - this.baseURL = new URI(this.documentBaseURL).toAbsolute(baseUrl.replace(/\/+$/, '')); - this.baseURI = new URI(this.baseURL); + return true; + }); + }); + return; + } + Tools.each(targets, function (elm) { + purgeDestroyedEditor(self.get(elm.id)); + }); + targets = Tools.grep(targets, function (elm) { + return !self.get(elm.id); + }); + if (targets.length === 0) { + provideResults([]); + } else { + each$j(targets, function (elm) { + if (isInvalidInlineTarget(settings, elm)) { + initError('Could not initialize inline editor on invalid inline target element', elm); + } else { + createEditor(createId(elm), settings, elm); + } + }); + } + }; + self.settings = settings; + DOM$a.bind(window, 'ready', initEditors); + return new promiseObj(function (resolve) { + if (result) { + resolve(result); + } else { + provideResults = function (editors) { + resolve(editors); + }; + } + }); + }, + get: function (id) { + if (arguments.length === 0) { + return editors.slice(0); + } else if (isString(id)) { + return find(editors, function (editor) { + return editor.id === id; + }).getOr(null); + } else if (isNumber(id)) { + return editors[id] ? editors[id] : null; + } else { + return null; + } + }, + add: function (editor) { + var self = this; + var existingEditor = legacyEditors[editor.id]; + if (existingEditor === editor) { + return editor; + } + if (self.get(editor.id) === null) { + if (isValidLegacyKey(editor.id)) { + legacyEditors[editor.id] = editor; + } + legacyEditors.push(editor); + editors.push(editor); + } + toggleGlobalEvents(true); + self.activeEditor = editor; + self.fire('AddEditor', { editor: editor }); + if (!beforeUnloadDelegate) { + beforeUnloadDelegate = function (e) { + var event = self.fire('BeforeUnload'); + if (event.returnValue) { + e.preventDefault(); + e.returnValue = event.returnValue; + return event.returnValue; + } + }; + window.addEventListener('beforeunload', beforeUnloadDelegate); } + return editor; + }, + createEditor: function (id, settings) { + return this.add(new Editor(id, settings, this)); + }, + remove: function (selector) { + var self = this; + var i, editor; + if (!selector) { + for (i = editors.length - 1; i >= 0; i--) { + self.remove(editors[i]); + } + return; + } + if (isString(selector)) { + each$j(DOM$a.select(selector), function (elm) { + editor = self.get(elm.id); + if (editor) { + self.remove(editor); + } + }); + return; + } + editor = selector; + if (isNull(self.get(editor.id))) { + return null; + } + if (removeEditorFromList(editor)) { + self.fire('RemoveEditor', { editor: editor }); + } + if (editors.length === 0) { + window.removeEventListener('beforeunload', beforeUnloadDelegate); + } + editor.remove(); + toggleGlobalEvents(editors.length > 0); + return editor; + }, + execCommand: function (cmd, ui, value) { + var self = this, editor = self.get(value); + switch (cmd) { + case 'mceAddEditor': + if (!self.get(value)) { + new Editor(value, self.settings, self).render(); + } + return true; + case 'mceRemoveEditor': + if (editor) { + editor.remove(); + } + return true; + case 'mceToggleEditor': + if (!editor) { + self.execCommand('mceAddEditor', 0, value); + return true; + } + if (editor.isHidden()) { + editor.show(); + } else { + editor.hide(); + } + return true; + } + if (self.activeEditor) { + return self.activeEditor.execCommand(cmd, ui, value); + } + return false; + }, + triggerSave: function () { + each$j(editors, function (editor) { + editor.save(); + }); + }, + addI18n: function (code, items) { + I18n.add(code, items); + }, + translate: function (text) { + return I18n.translate(text); + }, + setActive: function (editor) { + var activeEditor = this.activeEditor; + if (this.activeEditor !== editor) { + if (activeEditor) { + activeEditor.fire('deactivate', { relatedTarget: editor }); + } + editor.fire('activate', { relatedTarget: activeEditor }); + } + this.activeEditor = editor; + }, + _setBaseUrl: function (baseUrl) { + this.baseURL = new URI(this.documentBaseURL).toAbsolute(baseUrl.replace(/\/+$/, '')); + this.baseURI = new URI(this.baseURL); + } }); EditorManager.setup(); var min = Math.min, max = Math.max, round$1 = Math.round; var relativePosition = function (rect, targetRect, rel) { - var x = targetRect.x; - var y = targetRect.y; - var w = rect.w; - var h = rect.h; - var targetW = targetRect.w; - var targetH = targetRect.h; - var relChars = (rel || '').split(''); - if (relChars[0] === 'b') { - y += targetH; - } - if (relChars[1] === 'r') { - x += targetW; - } - if (relChars[0] === 'c') { - y += round$1(targetH / 2); - } - if (relChars[1] === 'c') { - x += round$1(targetW / 2); - } - if (relChars[3] === 'b') { - y -= h; - } - if (relChars[4] === 'r') { - x -= w; - } - if (relChars[3] === 'c') { - y -= round$1(h / 2); - } - if (relChars[4] === 'c') { - x -= round$1(w / 2); - } - return create$7(x, y, w, h); + var x = targetRect.x; + var y = targetRect.y; + var w = rect.w; + var h = rect.h; + var targetW = targetRect.w; + var targetH = targetRect.h; + var relChars = (rel || '').split(''); + if (relChars[0] === 'b') { + y += targetH; + } + if (relChars[1] === 'r') { + x += targetW; + } + if (relChars[0] === 'c') { + y += round$1(targetH / 2); + } + if (relChars[1] === 'c') { + x += round$1(targetW / 2); + } + if (relChars[3] === 'b') { + y -= h; + } + if (relChars[4] === 'r') { + x -= w; + } + if (relChars[3] === 'c') { + y -= round$1(h / 2); + } + if (relChars[4] === 'c') { + x -= round$1(w / 2); + } + return create$7(x, y, w, h); }; var findBestRelativePosition = function (rect, targetRect, constrainRect, rels) { - var pos, i; - for (i = 0; i < rels.length; i++) { - pos = relativePosition(rect, targetRect, rels[i]); - if (pos.x >= constrainRect.x && pos.x + pos.w <= constrainRect.w + constrainRect.x && pos.y >= constrainRect.y && pos.y + pos.h <= constrainRect.h + constrainRect.y) { - return rels[i]; - } + var pos, i; + for (i = 0; i < rels.length; i++) { + pos = relativePosition(rect, targetRect, rels[i]); + if (pos.x >= constrainRect.x && pos.x + pos.w <= constrainRect.w + constrainRect.x && pos.y >= constrainRect.y && pos.y + pos.h <= constrainRect.h + constrainRect.y) { + return rels[i]; } - return null; + } + return null; }; var inflate = function (rect, w, h) { - return create$7(rect.x - w, rect.y - h, rect.w + w * 2, rect.h + h * 2); + return create$7(rect.x - w, rect.y - h, rect.w + w * 2, rect.h + h * 2); }; var intersect = function (rect, cropRect) { - var x1 = max(rect.x, cropRect.x); - var y1 = max(rect.y, cropRect.y); - var x2 = min(rect.x + rect.w, cropRect.x + cropRect.w); - var y2 = min(rect.y + rect.h, cropRect.y + cropRect.h); - if (x2 - x1 < 0 || y2 - y1 < 0) { - return null; - } - return create$7(x1, y1, x2 - x1, y2 - y1); + var x1 = max(rect.x, cropRect.x); + var y1 = max(rect.y, cropRect.y); + var x2 = min(rect.x + rect.w, cropRect.x + cropRect.w); + var y2 = min(rect.y + rect.h, cropRect.y + cropRect.h); + if (x2 - x1 < 0 || y2 - y1 < 0) { + return null; + } + return create$7(x1, y1, x2 - x1, y2 - y1); }; var clamp$1 = function (rect, clampRect, fixedSize) { - var x1 = rect.x; - var y1 = rect.y; - var x2 = rect.x + rect.w; - var y2 = rect.y + rect.h; - var cx2 = clampRect.x + clampRect.w; - var cy2 = clampRect.y + clampRect.h; - var underflowX1 = max(0, clampRect.x - x1); - var underflowY1 = max(0, clampRect.y - y1); - var overflowX2 = max(0, x2 - cx2); - var overflowY2 = max(0, y2 - cy2); - x1 += underflowX1; - y1 += underflowY1; - if (fixedSize) { - x2 += underflowX1; - y2 += underflowY1; - x1 -= overflowX2; - y1 -= overflowY2; - } - x2 -= overflowX2; - y2 -= overflowY2; - return create$7(x1, y1, x2 - x1, y2 - y1); + var x1 = rect.x; + var y1 = rect.y; + var x2 = rect.x + rect.w; + var y2 = rect.y + rect.h; + var cx2 = clampRect.x + clampRect.w; + var cy2 = clampRect.y + clampRect.h; + var underflowX1 = max(0, clampRect.x - x1); + var underflowY1 = max(0, clampRect.y - y1); + var overflowX2 = max(0, x2 - cx2); + var overflowY2 = max(0, y2 - cy2); + x1 += underflowX1; + y1 += underflowY1; + if (fixedSize) { + x2 += underflowX1; + y2 += underflowY1; + x1 -= overflowX2; + y1 -= overflowY2; + } + x2 -= overflowX2; + y2 -= overflowY2; + return create$7(x1, y1, x2 - x1, y2 - y1); }; var create$7 = function (x, y, w, h) { - return { - x: x, - y: y, - w: w, - h: h - }; + return { + x: x, + y: y, + w: w, + h: h + }; }; var fromClientRect = function (clientRect) { - return create$7(clientRect.left, clientRect.top, clientRect.width, clientRect.height); + return create$7(clientRect.left, clientRect.top, clientRect.width, clientRect.height); }; var Rect = { - inflate: inflate, - relativePosition: relativePosition, - findBestRelativePosition: findBestRelativePosition, - intersect: intersect, - clamp: clamp$1, - create: create$7, - fromClientRect: fromClientRect + inflate: inflate, + relativePosition: relativePosition, + findBestRelativePosition: findBestRelativePosition, + intersect: intersect, + clamp: clamp$1, + create: create$7, + fromClientRect: fromClientRect }; var awaiter = function (resolveCb, rejectCb, timeout) { - if (timeout === void 0) { - timeout = 1000; - } - var done = false; - var timer = null; - var complete = function (completer) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (!done) { - done = true; - if (timer !== null) { - clearTimeout(timer); - timer = null; - } - completer.apply(null, args); - } - }; - }; - var resolve = complete(resolveCb); - var reject = complete(rejectCb); - var start = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (!done && timer === null) { - timer = setTimeout(function () { - return reject.apply(null, args); - }, timeout); + if (timeout === void 0) { + timeout = 1000; + } + var done = false; + var timer = null; + var complete = function (completer) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!done) { + done = true; + if (timer !== null) { + clearTimeout(timer); + timer = null; } + completer.apply(null, args); + } }; - return { - start: start, - resolve: resolve, - reject: reject - }; + }; + var resolve = complete(resolveCb); + var reject = complete(rejectCb); + var start = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!done && timer === null) { + timer = setTimeout(function () { + return reject.apply(null, args); + }, timeout); + } + }; + return { + start: start, + resolve: resolve, + reject: reject + }; }; var create$8 = function () { - var tasks = {}; - var resultFns = {}; - var load = function (id, url) { - var loadErrMsg = 'Script at URL "' + url + '" failed to load'; - var runErrMsg = 'Script at URL "' + url + '" did not call `tinymce.Resource.add(\'' + id + '\', data)` within 1 second'; - if (tasks[id] !== undefined) { - return tasks[id]; - } else { - var task = new promiseObj(function (resolve, reject) { - var waiter = awaiter(resolve, reject); - resultFns[id] = waiter.resolve; - ScriptLoader.ScriptLoader.loadScript(url, function () { - return waiter.start(runErrMsg); - }, function () { - return waiter.reject(loadErrMsg); - }); - }); - tasks[id] = task; - return task; - } - }; - var add = function (id, data) { - if (resultFns[id] !== undefined) { - resultFns[id](data); - delete resultFns[id]; - } - tasks[id] = promiseObj.resolve(data); - }; - return { - load: load, - add: add - }; + var tasks = {}; + var resultFns = {}; + var load = function (id, url) { + var loadErrMsg = 'Script at URL "' + url + '" failed to load'; + var runErrMsg = 'Script at URL "' + url + '" did not call `tinymce.Resource.add(\'' + id + '\', data)` within 1 second'; + if (tasks[id] !== undefined) { + return tasks[id]; + } else { + var task = new promiseObj(function (resolve, reject) { + var waiter = awaiter(resolve, reject); + resultFns[id] = waiter.resolve; + ScriptLoader.ScriptLoader.loadScript(url, function () { + return waiter.start(runErrMsg); + }, function () { + return waiter.reject(loadErrMsg); + }); + }); + tasks[id] = task; + return task; + } + }; + var add = function (id, data) { + if (resultFns[id] !== undefined) { + resultFns[id](data); + delete resultFns[id]; + } + tasks[id] = promiseObj.resolve(data); + }; + return { + load: load, + add: add + }; }; var Resource = create$8(); @@ -29400,515 +29271,514 @@ var Class = function () { }; Class.extend = extendClass = function (props) { + var self = this; + var _super = self.prototype; + var Class = function () { + var i, mixins, mixin; var self = this; - var _super = self.prototype; - var Class = function () { - var i, mixins, mixin; + if (!initializing) { + if (self.init) { + self.init.apply(self, arguments); + } + mixins = self.Mixins; + if (mixins) { + i = mixins.length; + while (i--) { + mixin = mixins[i]; + if (mixin.init) { + mixin.init.apply(self, arguments); + } + } + } + } + }; + var dummy = function () { + return this; + }; + var createMethod = function (name, fn) { + return function () { + var self = this; + var tmp = self._super; + self._super = _super[name]; + var ret = fn.apply(self, arguments); + self._super = tmp; + return ret; + }; + }; + initializing = true; + var prototype = new self(); + initializing = false; + if (props.Mixins) { + each$k(props.Mixins, function (mixin) { + for (var name_1 in mixin) { + if (name_1 !== 'init') { + props[name_1] = mixin[name_1]; + } + } + }); + if (_super.Mixins) { + props.Mixins = _super.Mixins.concat(props.Mixins); + } + } + if (props.Methods) { + each$k(props.Methods.split(','), function (name) { + props[name] = dummy; + }); + } + if (props.Properties) { + each$k(props.Properties.split(','), function (name) { + var fieldName = '_' + name; + props[name] = function (value) { var self = this; - if (!initializing) { - if (self.init) { - self.init.apply(self, arguments); - } - mixins = self.Mixins; - if (mixins) { - i = mixins.length; - while (i--) { - mixin = mixins[i]; - if (mixin.init) { - mixin.init.apply(self, arguments); - } - } - } - } - }; - var dummy = function () { - return this; - }; - var createMethod = function (name, fn) { - return function () { - var self = this; - var tmp = self._super; - self._super = _super[name]; - var ret = fn.apply(self, arguments); - self._super = tmp; - return ret; - }; - }; - initializing = true; - var prototype = new self(); - initializing = false; - if (props.Mixins) { - each$k(props.Mixins, function (mixin) { - for (var name_1 in mixin) { - if (name_1 !== 'init') { - props[name_1] = mixin[name_1]; - } - } - }); - if (_super.Mixins) { - props.Mixins = _super.Mixins.concat(props.Mixins); - } - } - if (props.Methods) { - each$k(props.Methods.split(','), function (name) { - props[name] = dummy; - }); - } - if (props.Properties) { - each$k(props.Properties.split(','), function (name) { - var fieldName = '_' + name; - props[name] = function (value) { - var self = this; - if (value !== undefined) { - self[fieldName] = value; - return self; - } - return self[fieldName]; - }; - }); - } - if (props.Statics) { - each$k(props.Statics, function (func, name) { - Class[name] = func; - }); - } - if (props.Defaults && _super.Defaults) { - props.Defaults = extend$5({}, _super.Defaults, props.Defaults); + if (value !== undefined) { + self[fieldName] = value; + return self; + } + return self[fieldName]; + }; + }); + } + if (props.Statics) { + each$k(props.Statics, function (func, name) { + Class[name] = func; + }); + } + if (props.Defaults && _super.Defaults) { + props.Defaults = extend$5({}, _super.Defaults, props.Defaults); + } + each$1(props, function (member, name) { + if (typeof member === 'function' && _super[name]) { + prototype[name] = createMethod(name, member); + } else { + prototype[name] = member; } - each$1(props, function (member, name) { - if (typeof member === 'function' && _super[name]) { - prototype[name] = createMethod(name, member); - } else { - prototype[name] = member; - } - }); - Class.prototype = prototype; - Class.constructor = Class; - Class.extend = extendClass; - return Class; + }); + Class.prototype = prototype; + Class.constructor = Class; + Class.extend = extendClass; + return Class; }; var min$1 = Math.min, max$1 = Math.max, round$2 = Math.round; var Color = function (value) { - var self = {}; - var r = 0, g = 0, b = 0; - var rgb2hsv = function (r, g, b) { - var h, s, v; - h = 0; - s = 0; - v = 0; - r = r / 255; - g = g / 255; - b = b / 255; - var minRGB = min$1(r, min$1(g, b)); - var maxRGB = max$1(r, max$1(g, b)); - if (minRGB === maxRGB) { - v = minRGB; - return { - h: 0, - s: 0, - v: v * 100 - }; - } - var d = r === minRGB ? g - b : b === minRGB ? r - g : b - r; - h = r === minRGB ? 3 : b === minRGB ? 1 : 5; - h = 60 * (h - d / (maxRGB - minRGB)); - s = (maxRGB - minRGB) / maxRGB; - v = maxRGB; - return { - h: round$2(h), - s: round$2(s * 100), - v: round$2(v * 100) - }; - }; - var hsvToRgb = function (hue, saturation, brightness) { - hue = (parseInt(hue, 10) || 0) % 360; - saturation = parseInt(saturation, 10) / 100; - brightness = parseInt(brightness, 10) / 100; - saturation = max$1(0, min$1(saturation, 1)); - brightness = max$1(0, min$1(brightness, 1)); - if (saturation === 0) { - r = g = b = round$2(255 * brightness); - return; - } - var side = hue / 60; - var chroma = brightness * saturation; - var x = chroma * (1 - Math.abs(side % 2 - 1)); - var match = brightness - chroma; - switch (Math.floor(side)) { - case 0: - r = chroma; - g = x; - b = 0; - break; - case 1: - r = x; - g = chroma; - b = 0; - break; - case 2: - r = 0; - g = chroma; - b = x; - break; - case 3: - r = 0; - g = x; - b = chroma; - break; - case 4: - r = x; - g = 0; - b = chroma; - break; - case 5: - r = chroma; - g = 0; - b = x; - break; - default: - r = g = b = 0; - } - r = round$2(255 * (r + match)); - g = round$2(255 * (g + match)); - b = round$2(255 * (b + match)); - }; - var toHex = function () { - var hex = function (val) { - val = parseInt(val, 10).toString(16); - return val.length > 1 ? val : '0' + val; - }; - return '#' + hex(r) + hex(g) + hex(b); - }; - var toRgb = function () { - return { - r: r, - g: g, - b: b - }; - }; - var toHsv = function () { - return rgb2hsv(r, g, b); - }; - var parse = function (value) { - var matches; - if (typeof value === 'object') { - if ('r' in value) { - r = value.r; - g = value.g; - b = value.b; - } else if ('v' in value) { - hsvToRgb(value.h, value.s, value.v); - } - } else { - if (matches = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(value)) { - r = parseInt(matches[1], 10); - g = parseInt(matches[2], 10); - b = parseInt(matches[3], 10); - } else if (matches = /#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(value)) { - r = parseInt(matches[1], 16); - g = parseInt(matches[2], 16); - b = parseInt(matches[3], 16); - } else if (matches = /#([0-F])([0-F])([0-F])/gi.exec(value)) { - r = parseInt(matches[1] + matches[1], 16); - g = parseInt(matches[2] + matches[2], 16); - b = parseInt(matches[3] + matches[3], 16); - } - } - r = r < 0 ? 0 : r > 255 ? 255 : r; - g = g < 0 ? 0 : g > 255 ? 255 : g; - b = b < 0 ? 0 : b > 255 ? 255 : b; - return self; + var self = {}; + var r = 0, g = 0, b = 0; + var rgb2hsv = function (r, g, b) { + var h, s, v; + h = 0; + s = 0; + v = 0; + r = r / 255; + g = g / 255; + b = b / 255; + var minRGB = min$1(r, min$1(g, b)); + var maxRGB = max$1(r, max$1(g, b)); + if (minRGB === maxRGB) { + v = minRGB; + return { + h: 0, + s: 0, + v: v * 100 + }; + } + var d = r === minRGB ? g - b : b === minRGB ? r - g : b - r; + h = r === minRGB ? 3 : b === minRGB ? 1 : 5; + h = 60 * (h - d / (maxRGB - minRGB)); + s = (maxRGB - minRGB) / maxRGB; + v = maxRGB; + return { + h: round$2(h), + s: round$2(s * 100), + v: round$2(v * 100) + }; + }; + var hsvToRgb = function (hue, saturation, brightness) { + hue = (parseInt(hue, 10) || 0) % 360; + saturation = parseInt(saturation, 10) / 100; + brightness = parseInt(brightness, 10) / 100; + saturation = max$1(0, min$1(saturation, 1)); + brightness = max$1(0, min$1(brightness, 1)); + if (saturation === 0) { + r = g = b = round$2(255 * brightness); + return; + } + var side = hue / 60; + var chroma = brightness * saturation; + var x = chroma * (1 - Math.abs(side % 2 - 1)); + var match = brightness - chroma; + switch (Math.floor(side)) { + case 0: + r = chroma; + g = x; + b = 0; + break; + case 1: + r = x; + g = chroma; + b = 0; + break; + case 2: + r = 0; + g = chroma; + b = x; + break; + case 3: + r = 0; + g = x; + b = chroma; + break; + case 4: + r = x; + g = 0; + b = chroma; + break; + case 5: + r = chroma; + g = 0; + b = x; + break; + default: + r = g = b = 0; + } + r = round$2(255 * (r + match)); + g = round$2(255 * (g + match)); + b = round$2(255 * (b + match)); + }; + var toHex = function () { + var hex = function (val) { + val = parseInt(val, 10).toString(16); + return val.length > 1 ? val : '0' + val; }; - if (value) { - parse(value); - } - self.toRgb = toRgb; - self.toHsv = toHsv; - self.toHex = toHex; - self.parse = parse; + return '#' + hex(r) + hex(g) + hex(b); + }; + var toRgb = function () { + return { + r: r, + g: g, + b: b + }; + }; + var toHsv = function () { + return rgb2hsv(r, g, b); + }; + var parse = function (value) { + var matches; + if (typeof value === 'object') { + if ('r' in value) { + r = value.r; + g = value.g; + b = value.b; + } else if ('v' in value) { + hsvToRgb(value.h, value.s, value.v); + } + } else { + if (matches = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(value)) { + r = parseInt(matches[1], 10); + g = parseInt(matches[2], 10); + b = parseInt(matches[3], 10); + } else if (matches = /#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(value)) { + r = parseInt(matches[1], 16); + g = parseInt(matches[2], 16); + b = parseInt(matches[3], 16); + } else if (matches = /#([0-F])([0-F])([0-F])/gi.exec(value)) { + r = parseInt(matches[1] + matches[1], 16); + g = parseInt(matches[2] + matches[2], 16); + b = parseInt(matches[3] + matches[3], 16); + } + } + r = r < 0 ? 0 : r > 255 ? 255 : r; + g = g < 0 ? 0 : g > 255 ? 255 : g; + b = b < 0 ? 0 : b > 255 ? 255 : b; return self; + }; + if (value) { + parse(value); + } + self.toRgb = toRgb; + self.toHsv = toHsv; + self.toHex = toHex; + self.parse = parse; + return self; }; var serialize = function (obj) { - var data = JSON.stringify(obj); - if (!isString(data)) { - return data; - } - return data.replace(/[\u0080-\uFFFF]/g, function (match) { - var hexCode = match.charCodeAt(0).toString(16); - return '\\u' + '0000'.substring(hexCode.length) + hexCode; - }); + var data = JSON.stringify(obj); + if (!isString(data)) { + return data; + } + return data.replace(/[\u0080-\uFFFF]/g, function (match) { + var hexCode = match.charCodeAt(0).toString(16); + return '\\u' + '0000'.substring(hexCode.length) + hexCode; + }); }; var JSONUtils = { - serialize: serialize, - parse: function (text) { - try { - return JSON.parse(text); - } catch (ex) { - } + serialize: serialize, + parse: function (text) { + try { + return JSON.parse(text); + } catch (ex) { } + } }; var JSONP = { - callbacks: {}, - count: 0, - send: function (settings) { - var self = this, dom = DOMUtils$1.DOM, count = settings.count !== undefined ? settings.count : self.count; - var id = 'tinymce_jsonp_' + count; - self.callbacks[count] = function (json) { - dom.remove(id); - delete self.callbacks[count]; - settings.callback(json); - }; - dom.add(dom.doc.body, 'script', { - id: id, - src: settings.url, - type: 'text/javascript' - }); - self.count++; - } + callbacks: {}, + count: 0, + send: function (settings) { + var self = this, dom = DOMUtils$1.DOM, count = settings.count !== undefined ? settings.count : self.count; + var id = 'tinymce_jsonp_' + count; + self.callbacks[count] = function (json) { + dom.remove(id); + delete self.callbacks[count]; + settings.callback(json); + }; + dom.add(dom.doc.body, 'script', { + id: id, + src: settings.url, + type: 'text/javascript' + }); + self.count++; + } }; var XHR = __assign(__assign({}, Observable), { - send: function (settings) { - var xhr, count = 0; - var ready = function () { - if (!settings.async || xhr.readyState === 4 || count++ > 10000) { - if (settings.success && count < 10000 && xhr.status === 200) { - settings.success.call(settings.success_scope, '' + xhr.responseText, xhr, settings); - } else if (settings.error) { - settings.error.call(settings.error_scope, count > 10000 ? 'TIMED_OUT' : 'GENERAL', xhr, settings); - } - xhr = null; - } else { - Delay.setTimeout(ready, 10); - } - }; - settings.scope = settings.scope || this; - settings.success_scope = settings.success_scope || settings.scope; - settings.error_scope = settings.error_scope || settings.scope; - settings.async = settings.async !== false; - settings.data = settings.data || ''; - XHR.fire('beforeInitialize', {settings: settings}); - xhr = new XMLHttpRequest(); - if (xhr.overrideMimeType) { - xhr.overrideMimeType(settings.content_type); - } - xhr.open(settings.type || (settings.data ? 'POST' : 'GET'), settings.url, settings.async); - if (settings.crossDomain) { - xhr.withCredentials = true; - } - if (settings.content_type) { - xhr.setRequestHeader('Content-Type', settings.content_type); - } - if (settings.requestheaders) { - Tools.each(settings.requestheaders, function (header) { - xhr.setRequestHeader(header.key, header.value); - }); - } - xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - xhr = XHR.fire('beforeSend', { - xhr: xhr, - settings: settings - }).xhr; - xhr.send(settings.data); - if (!settings.async) { - return ready(); - } + send: function (settings) { + var xhr, count = 0; + var ready = function () { + if (!settings.async || xhr.readyState === 4 || count++ > 10000) { + if (settings.success && count < 10000 && xhr.status === 200) { + settings.success.call(settings.success_scope, '' + xhr.responseText, xhr, settings); + } else if (settings.error) { + settings.error.call(settings.error_scope, count > 10000 ? 'TIMED_OUT' : 'GENERAL', xhr, settings); + } + xhr = null; + } else { Delay.setTimeout(ready, 10); - } + } + }; + settings.scope = settings.scope || this; + settings.success_scope = settings.success_scope || settings.scope; + settings.error_scope = settings.error_scope || settings.scope; + settings.async = settings.async !== false; + settings.data = settings.data || ''; + XHR.fire('beforeInitialize', { settings: settings }); + xhr = new XMLHttpRequest(); + if (xhr.overrideMimeType) { + xhr.overrideMimeType(settings.content_type); + } + xhr.open(settings.type || (settings.data ? 'POST' : 'GET'), settings.url, settings.async); + if (settings.crossDomain) { + xhr.withCredentials = true; + } + if (settings.content_type) { + xhr.setRequestHeader('Content-Type', settings.content_type); + } + if (settings.requestheaders) { + Tools.each(settings.requestheaders, function (header) { + xhr.setRequestHeader(header.key, header.value); + }); + } + xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + xhr = XHR.fire('beforeSend', { + xhr: xhr, + settings: settings + }).xhr; + xhr.send(settings.data); + if (!settings.async) { + return ready(); + } + Delay.setTimeout(ready, 10); + } }); var extend$6 = Tools.extend; var JSONRequest = function () { - function JSONRequest(settings) { - this.settings = extend$6({}, settings); - this.count = 0; - } - - JSONRequest.sendRPC = function (o) { - return new JSONRequest().send(o); - }; - JSONRequest.prototype.send = function (args) { - var ecb = args.error, scb = args.success; - var xhrArgs = extend$6(this.settings, args); - xhrArgs.success = function (c, x) { - c = JSONUtils.parse(c); - if (typeof c === 'undefined') { - c = {error: 'JSON Parse error.'}; - } - if (c.error) { - ecb.call(xhrArgs.error_scope || xhrArgs.scope, c.error, x); - } else { - scb.call(xhrArgs.success_scope || xhrArgs.scope, c.result); - } - }; - xhrArgs.error = function (ty, x) { - if (ecb) { - ecb.call(xhrArgs.error_scope || xhrArgs.scope, ty, x); - } - }; - xhrArgs.data = JSONUtils.serialize({ - id: args.id || 'c' + this.count++, - method: args.method, - params: args.params - }); - xhrArgs.content_type = 'application/json'; - XHR.send(xhrArgs); - }; - return JSONRequest; + function JSONRequest(settings) { + this.settings = extend$6({}, settings); + this.count = 0; + } + JSONRequest.sendRPC = function (o) { + return new JSONRequest().send(o); + }; + JSONRequest.prototype.send = function (args) { + var ecb = args.error, scb = args.success; + var xhrArgs = extend$6(this.settings, args); + xhrArgs.success = function (c, x) { + c = JSONUtils.parse(c); + if (typeof c === 'undefined') { + c = { error: 'JSON Parse error.' }; + } + if (c.error) { + ecb.call(xhrArgs.error_scope || xhrArgs.scope, c.error, x); + } else { + scb.call(xhrArgs.success_scope || xhrArgs.scope, c.result); + } + }; + xhrArgs.error = function (ty, x) { + if (ecb) { + ecb.call(xhrArgs.error_scope || xhrArgs.scope, ty, x); + } + }; + xhrArgs.data = JSONUtils.serialize({ + id: args.id || 'c' + this.count++, + method: args.method, + params: args.params + }); + xhrArgs.content_type = 'application/json'; + XHR.send(xhrArgs); + }; + return JSONRequest; }(); var create$9 = function () { - return function () { - var data = {}; - var keys = []; - var storage = { - getItem: function (key) { - var item = data[key]; - return item ? item : null; - }, - setItem: function (key, value) { - keys.push(key); - data[key] = String(value); - }, - key: function (index) { - return keys[index]; - }, - removeItem: function (key) { - keys = keys.filter(function (k) { - return k === key; - }); - delete data[key]; - }, - clear: function () { - keys = []; - data = {}; - }, - length: 0 - }; - Object.defineProperty(storage, 'length', { - get: function () { - return keys.length; - }, - configurable: false, - enumerable: false - }); - return storage; - }(); + return function () { + var data = {}; + var keys = []; + var storage = { + getItem: function (key) { + var item = data[key]; + return item ? item : null; + }, + setItem: function (key, value) { + keys.push(key); + data[key] = String(value); + }, + key: function (index) { + return keys[index]; + }, + removeItem: function (key) { + keys = keys.filter(function (k) { + return k === key; + }); + delete data[key]; + }, + clear: function () { + keys = []; + data = {}; + }, + length: 0 + }; + Object.defineProperty(storage, 'length', { + get: function () { + return keys.length; + }, + configurable: false, + enumerable: false + }); + return storage; + }(); }; var localStorage; try { - var test = '__storage_test__'; - localStorage = window.localStorage; - localStorage.setItem(test, test); - localStorage.removeItem(test); + var test = '__storage_test__'; + localStorage = window.localStorage; + localStorage.setItem(test, test); + localStorage.removeItem(test); } catch (e) { - localStorage = create$9(); + localStorage = create$9(); } var LocalStorage = localStorage; var publicApi = { - geom: {Rect: Rect}, - util: { - Promise: promiseObj, - Delay: Delay, - Tools: Tools, - VK: VK, - URI: URI, - Class: Class, - EventDispatcher: EventDispatcher, - Observable: Observable, - I18n: I18n, - XHR: XHR, - JSON: JSONUtils, - JSONRequest: JSONRequest, - JSONP: JSONP, - LocalStorage: LocalStorage, - Color: Color - }, - dom: { - EventUtils: EventUtils, - Sizzle: Sizzle, - DomQuery: DomQuery, - TreeWalker: DomTreeWalker, - TextSeeker: TextSeeker, - DOMUtils: DOMUtils$1, - ScriptLoader: ScriptLoader, - RangeUtils: RangeUtils$1, - Serializer: DomSerializer, - StyleSheetLoader: StyleSheetLoader, - ControlSelection: ControlSelection, - BookmarkManager: BookmarkManager$1, - Selection: EditorSelection, - Event: EventUtils.Event - }, - html: { - Styles: Styles, - Entities: Entities, - Node: AstNode, - Schema: Schema, - SaxParser: SaxParser$1, - DomParser: DomParser, - Writer: Writer, - Serializer: HtmlSerializer - }, - Env: Env, - AddOnManager: AddOnManager$1, - Annotator: Annotator, - Formatter: Formatter, - UndoManager: UndoManager, - EditorCommands: EditorCommands, - WindowManager: WindowManager, - NotificationManager: NotificationManager, - EditorObservable: EditorObservable, - Shortcuts: Shortcuts, - Editor: Editor, - FocusManager: FocusManager, - EditorManager: EditorManager, - DOM: DOMUtils$1.DOM, - ScriptLoader: ScriptLoader.ScriptLoader, - PluginManager: PluginManager, - ThemeManager: ThemeManager, - IconManager: IconManager, - Resource: Resource, - trim: Tools.trim, - isArray: Tools.isArray, - is: Tools.is, - toArray: Tools.toArray, - makeMap: Tools.makeMap, - each: Tools.each, - map: Tools.map, - grep: Tools.grep, - inArray: Tools.inArray, - extend: Tools.extend, - create: Tools.create, - walk: Tools.walk, - createNS: Tools.createNS, - resolve: Tools.resolve, - explode: Tools.explode, - _addCacheSuffix: Tools._addCacheSuffix, - isOpera: Env.opera, - isWebKit: Env.webkit, - isIE: Env.ie, - isGecko: Env.gecko, - isMac: Env.mac + geom: { Rect: Rect }, + util: { + Promise: promiseObj, + Delay: Delay, + Tools: Tools, + VK: VK, + URI: URI, + Class: Class, + EventDispatcher: EventDispatcher, + Observable: Observable, + I18n: I18n, + XHR: XHR, + JSON: JSONUtils, + JSONRequest: JSONRequest, + JSONP: JSONP, + LocalStorage: LocalStorage, + Color: Color + }, + dom: { + EventUtils: EventUtils, + Sizzle: Sizzle, + DomQuery: DomQuery, + TreeWalker: DomTreeWalker, + TextSeeker: TextSeeker, + DOMUtils: DOMUtils$1, + ScriptLoader: ScriptLoader, + RangeUtils: RangeUtils$1, + Serializer: DomSerializer, + StyleSheetLoader: StyleSheetLoader, + ControlSelection: ControlSelection, + BookmarkManager: BookmarkManager$1, + Selection: EditorSelection, + Event: EventUtils.Event + }, + html: { + Styles: Styles, + Entities: Entities, + Node: AstNode, + Schema: Schema, + SaxParser: SaxParser$1, + DomParser: DomParser, + Writer: Writer, + Serializer: HtmlSerializer + }, + Env: Env, + AddOnManager: AddOnManager$1, + Annotator: Annotator, + Formatter: Formatter, + UndoManager: UndoManager, + EditorCommands: EditorCommands, + WindowManager: WindowManager, + NotificationManager: NotificationManager, + EditorObservable: EditorObservable, + Shortcuts: Shortcuts, + Editor: Editor, + FocusManager: FocusManager, + EditorManager: EditorManager, + DOM: DOMUtils$1.DOM, + ScriptLoader: ScriptLoader.ScriptLoader, + PluginManager: PluginManager, + ThemeManager: ThemeManager, + IconManager: IconManager, + Resource: Resource, + trim: Tools.trim, + isArray: Tools.isArray, + is: Tools.is, + toArray: Tools.toArray, + makeMap: Tools.makeMap, + each: Tools.each, + map: Tools.map, + grep: Tools.grep, + inArray: Tools.inArray, + extend: Tools.extend, + create: Tools.create, + walk: Tools.walk, + createNS: Tools.createNS, + resolve: Tools.resolve, + explode: Tools.explode, + _addCacheSuffix: Tools._addCacheSuffix, + isOpera: Env.opera, + isWebKit: Env.webkit, + isIE: Env.ie, + isGecko: Env.gecko, + isMac: Env.mac }; var tinymce = Tools.extend(EditorManager, publicApi); var exportToModuleLoaders = function (tinymce) { - if (typeof module === 'object') { - try { - module.exports = tinymce; - } catch (_) { - } + if (typeof module === 'object') { + try { + module.exports = tinymce; + } catch (_) { } + } }; var exportToWindowGlobal = function (tinymce) { - window.tinymce = tinymce; - window.tinyMCE = tinymce; + window.tinymce = tinymce; + window.tinyMCE = tinymce; }; exportToWindowGlobal(tinymce); exportToModuleLoaders(tinymce); diff --git a/src/main/resources/static/component/pear/module/toast.js b/src/main/resources/static/component/pear/module/toast.js index 62bd5eb1..57c8ca5c 100644 --- a/src/main/resources/static/component/pear/module/toast.js +++ b/src/main/resources/static/component/pear/module/toast.js @@ -1,118 +1,118 @@ (function (root, factory) { - if(typeof define === 'function' && define.amd) { - define([], factory(root)); - } else if(typeof exports === 'object') { - module.exports = factory(root); - } else if (window.layui && layui.define) { - layui.define(function(exports){ + if(typeof define === 'function' && define.amd) { + define([], factory(root)); + } else if(typeof exports === 'object') { + module.exports = factory(root); + } else if (window.layui && layui.define) { + layui.define(function(exports){ exports('toast',factory(root)) - }) - }else { - root.iziToast = factory(root); - } + }) + }else { + root.iziToast = factory(root); + } })(typeof global !== 'undefined' ? global : window || this.window || this.global, function (root) { - 'use strict'; - - var $iziToast = {}, - PLUGIN_NAME = 'iziToast', - BODY = document.querySelector('body'), - ISMOBILE = (/Mobi/.test(navigator.userAgent)) ? true : false, - ISCHROME = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor), - ISFIREFOX = typeof InstallTrigger !== 'undefined', - ACCEPTSTOUCH = 'ontouchstart' in document.documentElement, - POSITIONS = ['bottomRight','bottomLeft','bottomCenter','topRight','topLeft','topCenter','center'], - THEMES = { - info: { - color: 'blue', - icon: 'ico-info' - }, - success: { - color: 'green', - icon: 'ico-success' - }, - warning: { - color: 'orange', - icon: 'ico-warning' - }, - error: { - color: 'red', - icon: 'ico-error' - }, - question: { - color: 'yellow', - icon: 'ico-question' - } - }, - MOBILEWIDTH = 568, - CONFIG = {}; - - $iziToast.children = {}; - - // Default settings - var defaults = { - id: null, - class: '', - title: '', - titleColor: '', - titleSize: '', - titleLineHeight: '', - message: '', - messageColor: '', - messageSize: '', - messageLineHeight: '', - backgroundColor: '', - theme: 'light', // dark - color: '', // blue, red, green, yellow - icon: '', - iconText: '', - iconColor: '', - iconUrl: null, - image: '', - imageWidth: 50, - maxWidth: null, - zindex: null, - layout: 2, - balloon: false, - close: true, - closeOnEscape: false, - closeOnClick: false, - displayMode: 0, - position: 'topCenter', // bottomRight, bottomLeft, topRight, topLeft, topCenter, bottomCenter, center - target: '', - targetFirst: true, - timeout: 3000, // 默认3秒 - rtl: false, - animateInside: false, // 动画效果 - drag: true, - pauseOnHover: true, - resetOnHover: false, - progressBar: false, - progressBarColor: '', - progressBarEasing: 'linear', - overlay: false, - overlayClose: false, - overlayColor: 'rgba(0, 0, 0, 0.6)', + 'use strict'; + + var $iziToast = {}, + PLUGIN_NAME = 'iziToast', + BODY = document.querySelector('body'), + ISMOBILE = (/Mobi/.test(navigator.userAgent)) ? true : false, + ISCHROME = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor), + ISFIREFOX = typeof InstallTrigger !== 'undefined', + ACCEPTSTOUCH = 'ontouchstart' in document.documentElement, + POSITIONS = ['bottomRight','bottomLeft','bottomCenter','topRight','topLeft','topCenter','center'], + THEMES = { + info: { + color: 'blue', + icon: 'ico-info' + }, + success: { + color: 'green', + icon: 'ico-success' + }, + warning: { + color: 'orange', + icon: 'ico-warning' + }, + error: { + color: 'red', + icon: 'ico-error' + }, + question: { + color: 'yellow', + icon: 'ico-question' + } + }, + MOBILEWIDTH = 568, + CONFIG = {}; + + $iziToast.children = {}; + + // Default settings + var defaults = { + id: null, + class: '', + title: '', + titleColor: '', + titleSize: '', + titleLineHeight: '', + message: '', + messageColor: '', + messageSize: '', + messageLineHeight: '', + backgroundColor: '', + theme: 'light', // dark + color: '', // blue, red, green, yellow + icon: '', + iconText: '', + iconColor: '', + iconUrl: null, + image: '', + imageWidth: 50, + maxWidth: null, + zindex: null, + layout: 2, + balloon: false, + close: true, + closeOnEscape: false, + closeOnClick: false, + displayMode: 0, + position: 'topCenter', // bottomRight, bottomLeft, topRight, topLeft, topCenter, bottomCenter, center + target: '', + targetFirst: true, + timeout: 3000, // 默认3秒 + rtl: false, + animateInside: false, // 动画效果 + drag: true, + pauseOnHover: true, + resetOnHover: false, + progressBar: false, + progressBarColor: '', + progressBarEasing: 'linear', + overlay: false, + overlayClose: false, + overlayColor: 'rgba(0, 0, 0, 0.6)', transitionIn: 'fadeInDown', // bounceInLeft, bounceInRight, bounceInUp, bounceInDown, fadeIn, fadeInDown, fadeInUp, fadeInLeft, fadeInRight, flipInX transitionOut: 'fadeOut', // fadeOut, fadeOutUp, fadeOutDown, fadeOutLeft, fadeOutRight, flipOutX - transitionInMobile: 'bounceInDown', - transitionOutMobile: 'fadeOutUp', - buttons: {}, - inputs: {}, - onOpening: function () {}, - onOpened: function () {}, - onClosing: function () {}, - onClosed: function () {} - }; - - if(!('remove' in Element.prototype)) { - Element.prototype.remove = function() { - if(this.parentNode) { - this.parentNode.removeChild(this); - } - }; - } - + transitionInMobile: 'bounceInDown', + transitionOutMobile: 'fadeOutUp', + buttons: {}, + inputs: {}, + onOpening: function () {}, + onOpened: function () {}, + onClosing: function () {}, + onClosed: function () {} + }; + + if(!('remove' in Element.prototype)) { + Element.prototype.remove = function() { + if(this.parentNode) { + this.parentNode.removeChild(this); + } + }; + } + if(typeof window.CustomEvent !== 'function') { var CustomEventPolyfill = function (event, params) { params = params || { bubbles: false, cancelable: false, detail: undefined }; @@ -126,1100 +126,1100 @@ window.CustomEvent = CustomEventPolyfill; } - var forEach = function (collection, callback, scope) { - if(Object.prototype.toString.call(collection) === '[object Object]') { - for (var prop in collection) { - if(Object.prototype.hasOwnProperty.call(collection, prop)) { - callback.call(scope, collection[prop], prop, collection); - } - } - } else { - if(collection){ - for (var i = 0, len = collection.length; i < len; i++) { - callback.call(scope, collection[i], i, collection); - } - } - } - }; - - var extend = function (defaults, options) { - var extended = {}; - forEach(defaults, function (value, prop) { - extended[prop] = defaults[prop]; - }); - forEach(options, function (value, prop) { - extended[prop] = options[prop]; - }); - return extended; - }; - - var createFragElem = function(htmlStr) { - var frag = document.createDocumentFragment(), - temp = document.createElement('div'); - temp.innerHTML = htmlStr; - while (temp.firstChild) { - frag.appendChild(temp.firstChild); - } - return frag; - }; - - var generateId = function(params) { - var newId = btoa(encodeURIComponent(params)); - return newId.replace(/=/g, ""); - }; - - var isColor = function(color){ - if( color.substring(0,1) == '#' || color.substring(0,3) == 'rgb' || color.substring(0,3) == 'hsl' ){ - return true; - } else { - return false; - } - }; - - var isBase64 = function(str) { - try { - return btoa(atob(str)) == str; - } catch (err) { - return false; - } - }; - - var drag = function() { - - return { - move: function(toast, instance, settings, xpos) { - - var opacity, - opacityRange = 0.3, - distance = 180; - - if(xpos !== 0){ - - toast.classList.add(PLUGIN_NAME+'-dragged'); - - toast.style.transform = 'translateX('+xpos + 'px)'; - - if(xpos > 0){ - opacity = (distance-xpos) / distance; - if(opacity < opacityRange){ - instance.hide(extend(settings, { transitionOut: 'fadeOutRight', transitionOutMobile: 'fadeOutRight' }), toast, 'drag'); - } - } else { - opacity = (distance+xpos) / distance; - if(opacity < opacityRange){ - instance.hide(extend(settings, { transitionOut: 'fadeOutLeft', transitionOutMobile: 'fadeOutLeft' }), toast, 'drag'); - } - } - toast.style.opacity = opacity; - - if(opacity < opacityRange){ - - if(ISCHROME || ISFIREFOX) - toast.style.left = xpos+'px'; - - toast.parentNode.style.opacity = opacityRange; - - this.stopMoving(toast, null); - } - } - - - }, - startMoving: function(toast, instance, settings, e) { - - e = e || window.event; - var posX = ((ACCEPTSTOUCH) ? e.touches[0].clientX : e.clientX), - toastLeft = toast.style.transform.replace('px)', ''); - toastLeft = toastLeft.replace('translateX(', ''); - var offsetX = posX - toastLeft; - - if(settings.transitionIn){ - toast.classList.remove(settings.transitionIn); - } - if(settings.transitionInMobile){ - toast.classList.remove(settings.transitionInMobile); - } - toast.style.transition = ''; - - if(ACCEPTSTOUCH) { - document.ontouchmove = function(e) { - e.preventDefault(); - e = e || window.event; - var posX = e.touches[0].clientX, - finalX = posX - offsetX; + var forEach = function (collection, callback, scope) { + if(Object.prototype.toString.call(collection) === '[object Object]') { + for (var prop in collection) { + if(Object.prototype.hasOwnProperty.call(collection, prop)) { + callback.call(scope, collection[prop], prop, collection); + } + } + } else { + if(collection){ + for (var i = 0, len = collection.length; i < len; i++) { + callback.call(scope, collection[i], i, collection); + } + } + } + }; + + var extend = function (defaults, options) { + var extended = {}; + forEach(defaults, function (value, prop) { + extended[prop] = defaults[prop]; + }); + forEach(options, function (value, prop) { + extended[prop] = options[prop]; + }); + return extended; + }; + + var createFragElem = function(htmlStr) { + var frag = document.createDocumentFragment(), + temp = document.createElement('div'); + temp.innerHTML = htmlStr; + while (temp.firstChild) { + frag.appendChild(temp.firstChild); + } + return frag; + }; + + var generateId = function(params) { + var newId = btoa(encodeURIComponent(params)); + return newId.replace(/=/g, ""); + }; + + var isColor = function(color){ + if( color.substring(0,1) == '#' || color.substring(0,3) == 'rgb' || color.substring(0,3) == 'hsl' ){ + return true; + } else { + return false; + } + }; + + var isBase64 = function(str) { + try { + return btoa(atob(str)) == str; + } catch (err) { + return false; + } + }; + + var drag = function() { + + return { + move: function(toast, instance, settings, xpos) { + + var opacity, + opacityRange = 0.3, + distance = 180; + + if(xpos !== 0){ + + toast.classList.add(PLUGIN_NAME+'-dragged'); + + toast.style.transform = 'translateX('+xpos + 'px)'; + + if(xpos > 0){ + opacity = (distance-xpos) / distance; + if(opacity < opacityRange){ + instance.hide(extend(settings, { transitionOut: 'fadeOutRight', transitionOutMobile: 'fadeOutRight' }), toast, 'drag'); + } + } else { + opacity = (distance+xpos) / distance; + if(opacity < opacityRange){ + instance.hide(extend(settings, { transitionOut: 'fadeOutLeft', transitionOutMobile: 'fadeOutLeft' }), toast, 'drag'); + } + } + toast.style.opacity = opacity; + + if(opacity < opacityRange){ + + if(ISCHROME || ISFIREFOX) + toast.style.left = xpos+'px'; + + toast.parentNode.style.opacity = opacityRange; + + this.stopMoving(toast, null); + } + } + + + }, + startMoving: function(toast, instance, settings, e) { + + e = e || window.event; + var posX = ((ACCEPTSTOUCH) ? e.touches[0].clientX : e.clientX), + toastLeft = toast.style.transform.replace('px)', ''); + toastLeft = toastLeft.replace('translateX(', ''); + var offsetX = posX - toastLeft; + + if(settings.transitionIn){ + toast.classList.remove(settings.transitionIn); + } + if(settings.transitionInMobile){ + toast.classList.remove(settings.transitionInMobile); + } + toast.style.transition = ''; + + if(ACCEPTSTOUCH) { + document.ontouchmove = function(e) { + e.preventDefault(); + e = e || window.event; + var posX = e.touches[0].clientX, + finalX = posX - offsetX; drag.move(toast, instance, settings, finalX); - }; - } else { - document.onmousemove = function(e) { - e.preventDefault(); - e = e || window.event; - var posX = e.clientX, - finalX = posX - offsetX; + }; + } else { + document.onmousemove = function(e) { + e.preventDefault(); + e = e || window.event; + var posX = e.clientX, + finalX = posX - offsetX; drag.move(toast, instance, settings, finalX); - }; - } - - }, - stopMoving: function(toast, e) { + }; + } - if(ACCEPTSTOUCH) { - document.ontouchmove = function() {}; - } else { - document.onmousemove = function() {}; - } + }, + stopMoving: function(toast, e) { - toast.style.opacity = ''; - toast.style.transform = ''; + if(ACCEPTSTOUCH) { + document.ontouchmove = function() {}; + } else { + document.onmousemove = function() {}; + } - if(toast.classList.contains(PLUGIN_NAME+'-dragged')){ + toast.style.opacity = ''; + toast.style.transform = ''; - toast.classList.remove(PLUGIN_NAME+'-dragged'); + if(toast.classList.contains(PLUGIN_NAME+'-dragged')){ + + toast.classList.remove(PLUGIN_NAME+'-dragged'); - toast.style.transition = 'transform 0.4s ease, opacity 0.4s ease'; - setTimeout(function() { - toast.style.transition = ''; - }, 400); - } + toast.style.transition = 'transform 0.4s ease, opacity 0.4s ease'; + setTimeout(function() { + toast.style.transition = ''; + }, 400); + } - } - }; + } + }; - }(); + }(); - $iziToast.setSetting = function (ref, option, value) { + $iziToast.setSetting = function (ref, option, value) { - $iziToast.children[ref][option] = value; + $iziToast.children[ref][option] = value; - }; + }; - $iziToast.getSetting = function (ref, option) { + $iziToast.getSetting = function (ref, option) { - return $iziToast.children[ref][option]; + return $iziToast.children[ref][option]; - }; + }; - $iziToast.destroy = function () { + $iziToast.destroy = function () { - forEach(document.querySelectorAll('.'+PLUGIN_NAME+'-overlay'), function(element, index) { - element.remove(); - }); + forEach(document.querySelectorAll('.'+PLUGIN_NAME+'-overlay'), function(element, index) { + element.remove(); + }); - forEach(document.querySelectorAll('.'+PLUGIN_NAME+'-wrapper'), function(element, index) { - element.remove(); - }); + forEach(document.querySelectorAll('.'+PLUGIN_NAME+'-wrapper'), function(element, index) { + element.remove(); + }); - forEach(document.querySelectorAll('.'+PLUGIN_NAME), function(element, index) { - element.remove(); - }); + forEach(document.querySelectorAll('.'+PLUGIN_NAME), function(element, index) { + element.remove(); + }); - this.children = {}; + this.children = {}; - // Remove event listeners - document.removeEventListener(PLUGIN_NAME+'-opened', {}, false); - document.removeEventListener(PLUGIN_NAME+'-opening', {}, false); - document.removeEventListener(PLUGIN_NAME+'-closing', {}, false); - document.removeEventListener(PLUGIN_NAME+'-closed', {}, false); - document.removeEventListener('keyup', {}, false); + // Remove event listeners + document.removeEventListener(PLUGIN_NAME+'-opened', {}, false); + document.removeEventListener(PLUGIN_NAME+'-opening', {}, false); + document.removeEventListener(PLUGIN_NAME+'-closing', {}, false); + document.removeEventListener(PLUGIN_NAME+'-closed', {}, false); + document.removeEventListener('keyup', {}, false); - // Reset variables - CONFIG = {}; - }; + // Reset variables + CONFIG = {}; + }; - /** - * Initialize Plugin - * @public - * @param {Object} options User settings - */ - $iziToast.settings = function (options) { + /** + * Initialize Plugin + * @public + * @param {Object} options User settings + */ + $iziToast.settings = function (options) { - // Destroy any existing initializations - $iziToast.destroy(); + // Destroy any existing initializations + $iziToast.destroy(); - CONFIG = options; - defaults = extend(defaults, options || {}); - }; + CONFIG = options; + defaults = extend(defaults, options || {}); + }; - /** - * Building themes functions. - * @public - * @param {Object} options User settings - */ - forEach(THEMES, function (theme, name) { + /** + * Building themes functions. + * @public + * @param {Object} options User settings + */ + forEach(THEMES, function (theme, name) { - $iziToast[name] = function (options) { + $iziToast[name] = function (options) { - var settings = extend(CONFIG, options || {}); - settings = extend(theme, settings || {}); + var settings = extend(CONFIG, options || {}); + settings = extend(theme, settings || {}); - this.show(settings); - }; + this.show(settings); + }; - }); + }); - /** - * Do the calculation to move the progress bar - * @private - */ - $iziToast.progress = function (options, $toast, callback) { + /** + * Do the calculation to move the progress bar + * @private + */ + $iziToast.progress = function (options, $toast, callback) { - var that = this, - ref = $toast.getAttribute('data-iziToast-ref'), - settings = extend(this.children[ref], options || {}), - $elem = $toast.querySelector('.'+PLUGIN_NAME+'-progressbar div'); + var that = this, + ref = $toast.getAttribute('data-iziToast-ref'), + settings = extend(this.children[ref], options || {}), + $elem = $toast.querySelector('.'+PLUGIN_NAME+'-progressbar div'); - return { - start: function() { + return { + start: function() { - if(typeof settings.time.REMAINING == 'undefined'){ + if(typeof settings.time.REMAINING == 'undefined'){ - $toast.classList.remove(PLUGIN_NAME+'-reseted'); + $toast.classList.remove(PLUGIN_NAME+'-reseted'); - if($elem !== null){ - $elem.style.transition = 'width '+ settings.timeout +'ms '+settings.progressBarEasing; - $elem.style.width = '0%'; - } + if($elem !== null){ + $elem.style.transition = 'width '+ settings.timeout +'ms '+settings.progressBarEasing; + $elem.style.width = '0%'; + } - settings.time.START = new Date().getTime(); - settings.time.END = settings.time.START + settings.timeout; - settings.time.TIMER = setTimeout(function() { + settings.time.START = new Date().getTime(); + settings.time.END = settings.time.START + settings.timeout; + settings.time.TIMER = setTimeout(function() { - clearTimeout(settings.time.TIMER); + clearTimeout(settings.time.TIMER); - if(!$toast.classList.contains(PLUGIN_NAME+'-closing')){ + if(!$toast.classList.contains(PLUGIN_NAME+'-closing')){ - that.hide(settings, $toast, 'timeout'); + that.hide(settings, $toast, 'timeout'); - if(typeof callback === 'function'){ - callback.apply(that); - } - } + if(typeof callback === 'function'){ + callback.apply(that); + } + } - }, settings.timeout); - that.setSetting(ref, 'time', settings.time); - } - }, - pause: function() { + }, settings.timeout); + that.setSetting(ref, 'time', settings.time); + } + }, + pause: function() { - if(typeof settings.time.START !== 'undefined' && !$toast.classList.contains(PLUGIN_NAME+'-paused') && !$toast.classList.contains(PLUGIN_NAME+'-reseted')){ + if(typeof settings.time.START !== 'undefined' && !$toast.classList.contains(PLUGIN_NAME+'-paused') && !$toast.classList.contains(PLUGIN_NAME+'-reseted')){ - $toast.classList.add(PLUGIN_NAME+'-paused'); + $toast.classList.add(PLUGIN_NAME+'-paused'); - settings.time.REMAINING = settings.time.END - new Date().getTime(); + settings.time.REMAINING = settings.time.END - new Date().getTime(); - clearTimeout(settings.time.TIMER); + clearTimeout(settings.time.TIMER); - that.setSetting(ref, 'time', settings.time); + that.setSetting(ref, 'time', settings.time); - if($elem !== null){ - var computedStyle = window.getComputedStyle($elem), - propertyWidth = computedStyle.getPropertyValue('width'); + if($elem !== null){ + var computedStyle = window.getComputedStyle($elem), + propertyWidth = computedStyle.getPropertyValue('width'); - $elem.style.transition = 'none'; - $elem.style.width = propertyWidth; - } + $elem.style.transition = 'none'; + $elem.style.width = propertyWidth; + } - if(typeof callback === 'function'){ - setTimeout(function() { - callback.apply(that); - }, 10); - } - } - }, - resume: function() { + if(typeof callback === 'function'){ + setTimeout(function() { + callback.apply(that); + }, 10); + } + } + }, + resume: function() { - if(typeof settings.time.REMAINING !== 'undefined'){ + if(typeof settings.time.REMAINING !== 'undefined'){ - $toast.classList.remove(PLUGIN_NAME+'-paused'); + $toast.classList.remove(PLUGIN_NAME+'-paused'); - if($elem !== null){ - $elem.style.transition = 'width '+ settings.time.REMAINING +'ms '+settings.progressBarEasing; - $elem.style.width = '0%'; - } + if($elem !== null){ + $elem.style.transition = 'width '+ settings.time.REMAINING +'ms '+settings.progressBarEasing; + $elem.style.width = '0%'; + } - settings.time.END = new Date().getTime() + settings.time.REMAINING; - settings.time.TIMER = setTimeout(function() { + settings.time.END = new Date().getTime() + settings.time.REMAINING; + settings.time.TIMER = setTimeout(function() { - clearTimeout(settings.time.TIMER); + clearTimeout(settings.time.TIMER); - if(!$toast.classList.contains(PLUGIN_NAME+'-closing')){ + if(!$toast.classList.contains(PLUGIN_NAME+'-closing')){ - that.hide(settings, $toast, 'timeout'); + that.hide(settings, $toast, 'timeout'); - if(typeof callback === 'function'){ - callback.apply(that); - } - } + if(typeof callback === 'function'){ + callback.apply(that); + } + } - }, settings.time.REMAINING); + }, settings.time.REMAINING); - that.setSetting(ref, 'time', settings.time); - } else { - this.start(); - } - }, - reset: function(){ + that.setSetting(ref, 'time', settings.time); + } else { + this.start(); + } + }, + reset: function(){ - clearTimeout(settings.time.TIMER); + clearTimeout(settings.time.TIMER); - delete settings.time.REMAINING; + delete settings.time.REMAINING; - that.setSetting(ref, 'time', settings.time); + that.setSetting(ref, 'time', settings.time); - $toast.classList.add(PLUGIN_NAME+'-reseted'); + $toast.classList.add(PLUGIN_NAME+'-reseted'); - $toast.classList.remove(PLUGIN_NAME+'-paused'); + $toast.classList.remove(PLUGIN_NAME+'-paused'); - if($elem !== null){ - $elem.style.transition = 'none'; - $elem.style.width = '100%'; - } + if($elem !== null){ + $elem.style.transition = 'none'; + $elem.style.width = '100%'; + } - if(typeof callback === 'function'){ - setTimeout(function() { - callback.apply(that); - }, 10); - } - } - }; + if(typeof callback === 'function'){ + setTimeout(function() { + callback.apply(that); + }, 10); + } + } + }; - }; + }; - /** - * Close the specific Toast - * @public - * @param {Object} options User settings - */ - $iziToast.hide = function (options, $toast, closedBy) { + /** + * Close the specific Toast + * @public + * @param {Object} options User settings + */ + $iziToast.hide = function (options, $toast, closedBy) { - if(typeof $toast != 'object'){ - $toast = document.querySelector($toast); - } + if(typeof $toast != 'object'){ + $toast = document.querySelector($toast); + } - var that = this, - settings = extend(this.children[$toast.getAttribute('data-iziToast-ref')], options || {}); - settings.closedBy = closedBy || null; + var that = this, + settings = extend(this.children[$toast.getAttribute('data-iziToast-ref')], options || {}); + settings.closedBy = closedBy || null; - delete settings.time.REMAINING; + delete settings.time.REMAINING; - $toast.classList.add(PLUGIN_NAME+'-closing'); + $toast.classList.add(PLUGIN_NAME+'-closing'); - // Overlay - (function(){ - - var $overlay = document.querySelector('.'+PLUGIN_NAME+'-overlay'); - if($overlay !== null){ - var refs = $overlay.getAttribute('data-iziToast-ref'); - refs = refs.split(','); - var index = refs.indexOf(String(settings.ref)); - - if(index !== -1){ - refs.splice(index, 1); - } - $overlay.setAttribute('data-iziToast-ref', refs.join()); - - if(refs.length === 0){ - $overlay.classList.remove('fadeIn'); - $overlay.classList.add('fadeOut'); - setTimeout(function() { - $overlay.remove(); - }, 700); - } - } - - })(); - - if(settings.transitionIn){ - $toast.classList.remove(settings.transitionIn); - } - - if(settings.transitionInMobile){ - $toast.classList.remove(settings.transitionInMobile); - } - - if(ISMOBILE || window.innerWidth <= MOBILEWIDTH){ - if(settings.transitionOutMobile) - $toast.classList.add(settings.transitionOutMobile); - } else { - if(settings.transitionOut) - $toast.classList.add(settings.transitionOut); - } - var H = $toast.parentNode.offsetHeight; - $toast.parentNode.style.height = H+'px'; - $toast.style.pointerEvents = 'none'; - - if(!ISMOBILE || window.innerWidth > MOBILEWIDTH){ - $toast.parentNode.style.transitionDelay = '0.2s'; - } - - try { - var event = new CustomEvent(PLUGIN_NAME+'-closing', {detail: settings, bubbles: true, cancelable: true}); - document.dispatchEvent(event); - } catch(ex){ - console.warn(ex); - } - - setTimeout(function() { - - $toast.parentNode.style.height = '0px'; - $toast.parentNode.style.overflow = ''; - - setTimeout(function(){ - - delete that.children[settings.ref]; - - $toast.parentNode.remove(); - - try { - var event = new CustomEvent(PLUGIN_NAME+'-closed', {detail: settings, bubbles: true, cancelable: true}); - document.dispatchEvent(event); - } catch(ex){ - console.warn(ex); - } - - if(typeof settings.onClosed !== 'undefined'){ - settings.onClosed.apply(null, [settings, $toast, closedBy]); - } - - }, 1000); - }, 200); - - - if(typeof settings.onClosing !== 'undefined'){ - settings.onClosing.apply(null, [settings, $toast, closedBy]); - } - }; - - /** - * Create and show the Toast - * @public - * @param {Object} options User settings - */ - $iziToast.show = function (options) { - - var that = this; - - // Merge user options with defaults - var settings = extend(CONFIG, options || {}); - settings = extend(defaults, settings); - settings.time = {}; - - if(settings.id === null){ - settings.id = generateId(settings.title+settings.message+settings.color); - } - - if(settings.displayMode === 1 || settings.displayMode == 'once'){ - try { - if(document.querySelectorAll('.'+PLUGIN_NAME+'#'+settings.id).length > 0){ - return false; - } - } catch (exc) { - console.warn('['+PLUGIN_NAME+'] Could not find an element with this selector: '+'#'+settings.id+'. Try to set an valid id.'); - } - } - - if(settings.displayMode === 2 || settings.displayMode == 'replace'){ - try { - forEach(document.querySelectorAll('.'+PLUGIN_NAME+'#'+settings.id), function(element, index) { - that.hide(settings, element, 'replaced'); - }); - } catch (exc) { - console.warn('['+PLUGIN_NAME+'] Could not find an element with this selector: '+'#'+settings.id+'. Try to set an valid id.'); - } - } - - settings.ref = new Date().getTime() + Math.floor((Math.random() * 10000000) + 1); - - $iziToast.children[settings.ref] = settings; - - var $DOM = { - body: document.querySelector('body'), - overlay: document.createElement('div'), - toast: document.createElement('div'), - toastBody: document.createElement('div'), - toastTexts: document.createElement('div'), - toastCapsule: document.createElement('div'), - cover: document.createElement('div'), - buttons: document.createElement('div'), - inputs: document.createElement('div'), - icon: !settings.iconUrl ? document.createElement('i') : document.createElement('img'), - wrapper: null - }; + // Overlay + (function(){ - $DOM.toast.setAttribute('data-iziToast-ref', settings.ref); - $DOM.toast.appendChild($DOM.toastBody); - $DOM.toastCapsule.appendChild($DOM.toast); - - // CSS Settings - (function(){ - - $DOM.toast.classList.add(PLUGIN_NAME); - $DOM.toast.classList.add(PLUGIN_NAME+'-opening'); - $DOM.toastCapsule.classList.add(PLUGIN_NAME+'-capsule'); - $DOM.toastBody.classList.add(PLUGIN_NAME + '-body'); - $DOM.toastTexts.classList.add(PLUGIN_NAME + '-texts'); - - if(ISMOBILE || window.innerWidth <= MOBILEWIDTH){ - if(settings.transitionInMobile) - $DOM.toast.classList.add(settings.transitionInMobile); - } else { - if(settings.transitionIn) - $DOM.toast.classList.add(settings.transitionIn); - } - - if(settings.class){ - var classes = settings.class.split(' '); - forEach(classes, function (value, index) { - $DOM.toast.classList.add(value); - }); - } - - if(settings.id){ $DOM.toast.id = settings.id; } - - if(settings.rtl){ - $DOM.toast.classList.add(PLUGIN_NAME + '-rtl'); - $DOM.toast.setAttribute('dir', 'rtl'); - } - - if(settings.layout > 1){ $DOM.toast.classList.add(PLUGIN_NAME+'-layout'+settings.layout); } - - if(settings.balloon){ $DOM.toast.classList.add(PLUGIN_NAME+'-balloon'); } - - if(settings.maxWidth){ - if( !isNaN(settings.maxWidth) ){ - $DOM.toast.style.maxWidth = settings.maxWidth+'px'; - } else { - $DOM.toast.style.maxWidth = settings.maxWidth; - } - } - - if(settings.theme !== '' || settings.theme !== 'light') { - - $DOM.toast.classList.add(PLUGIN_NAME+'-theme-'+settings.theme); - } - - if(settings.color) { //#, rgb, rgba, hsl - - if( isColor(settings.color) ){ - $DOM.toast.style.background = settings.color; - } else { - $DOM.toast.classList.add(PLUGIN_NAME+'-color-'+settings.color); - } - } - - if(settings.backgroundColor) { - $DOM.toast.style.background = settings.backgroundColor; - if(settings.balloon){ - $DOM.toast.style.borderColor = settings.backgroundColor; - } - } - })(); - - // Cover image - (function(){ - if(settings.image) { - $DOM.cover.classList.add(PLUGIN_NAME + '-cover'); - $DOM.cover.style.width = settings.imageWidth + 'px'; - - if(isBase64(settings.image.replace(/ /g,''))){ - $DOM.cover.style.backgroundImage = 'url(data:image/png;base64,' + settings.image.replace(/ /g,'') + ')'; - } else { - $DOM.cover.style.backgroundImage = 'url(' + settings.image + ')'; - } - - if(settings.rtl){ - $DOM.toastBody.style.marginRight = (settings.imageWidth + 10) + 'px'; - } else { - $DOM.toastBody.style.marginLeft = (settings.imageWidth + 10) + 'px'; - } - $DOM.toast.appendChild($DOM.cover); - } - })(); - - // Button close - (function(){ - if(settings.close){ - - $DOM.buttonClose = document.createElement('button'); - $DOM.buttonClose.type = 'button'; - $DOM.buttonClose.classList.add(PLUGIN_NAME + '-close'); - $DOM.buttonClose.addEventListener('click', function (e) { - var button = e.target; - that.hide(settings, $DOM.toast, 'button'); - }); - $DOM.toast.appendChild($DOM.buttonClose); - } else { - if(settings.rtl){ - $DOM.toast.style.paddingLeft = '18px'; - } else { - $DOM.toast.style.paddingRight = '18px'; - } - } - })(); - - // Progress Bar & Timeout - (function(){ - - if(settings.progressBar){ - $DOM.progressBar = document.createElement('div'); - $DOM.progressBarDiv = document.createElement('div'); - $DOM.progressBar.classList.add(PLUGIN_NAME + '-progressbar'); - $DOM.progressBarDiv.style.background = settings.progressBarColor; - $DOM.progressBar.appendChild($DOM.progressBarDiv); - $DOM.toast.appendChild($DOM.progressBar); - } - - if(settings.timeout) { - - if(settings.pauseOnHover && !settings.resetOnHover){ - - $DOM.toast.addEventListener('mouseenter', function (e) { - that.progress(settings, $DOM.toast).pause(); - }); - $DOM.toast.addEventListener('mouseleave', function (e) { - that.progress(settings, $DOM.toast).resume(); - }); - } - - if(settings.resetOnHover){ - - $DOM.toast.addEventListener('mouseenter', function (e) { - that.progress(settings, $DOM.toast).reset(); - }); - $DOM.toast.addEventListener('mouseleave', function (e) { - that.progress(settings, $DOM.toast).start(); - }); - } - } - })(); - - // Icon - (function(){ - - if(settings.iconUrl) { - - $DOM.icon.setAttribute('class', PLUGIN_NAME + '-icon'); - $DOM.icon.setAttribute('src', settings.iconUrl); - - } else if(settings.icon) { - $DOM.icon.setAttribute('class', PLUGIN_NAME + '-icon ' + settings.icon); - - if(settings.iconText){ - $DOM.icon.appendChild(document.createTextNode(settings.iconText)); - } - - if(settings.iconColor){ - $DOM.icon.style.color = settings.iconColor; - } - } - - if(settings.icon || settings.iconUrl) { - - if(settings.rtl){ - $DOM.toastBody.style.paddingRight = '33px'; - } else { - $DOM.toastBody.style.paddingLeft = '33px'; - } - - $DOM.toastBody.appendChild($DOM.icon); - } - - })(); - - // Title & Message - (function(){ - if(settings.title.length > 0) { - - $DOM.strong = document.createElement('strong'); - $DOM.strong.classList.add(PLUGIN_NAME + '-title'); - $DOM.strong.appendChild(createFragElem(settings.title)); - $DOM.toastTexts.appendChild($DOM.strong); - - if(settings.titleColor) { - $DOM.strong.style.color = settings.titleColor; - } - if(settings.titleSize) { - if( !isNaN(settings.titleSize) ){ - $DOM.strong.style.fontSize = settings.titleSize+'px'; - } else { - $DOM.strong.style.fontSize = settings.titleSize; - } - } - if(settings.titleLineHeight) { - if( !isNaN(settings.titleSize) ){ - $DOM.strong.style.lineHeight = settings.titleLineHeight+'px'; - } else { - $DOM.strong.style.lineHeight = settings.titleLineHeight; - } - } - } - - if(settings.message.length > 0) { - - $DOM.p = document.createElement('p'); - $DOM.p.classList.add(PLUGIN_NAME + '-message'); - $DOM.p.appendChild(createFragElem(settings.message)); - $DOM.toastTexts.appendChild($DOM.p); - - if(settings.messageColor) { - $DOM.p.style.color = settings.messageColor; - } - if(settings.messageSize) { - if( !isNaN(settings.titleSize) ){ - $DOM.p.style.fontSize = settings.messageSize+'px'; - } else { - $DOM.p.style.fontSize = settings.messageSize; - } - } - if(settings.messageLineHeight) { - - if( !isNaN(settings.titleSize) ){ - $DOM.p.style.lineHeight = settings.messageLineHeight+'px'; - } else { - $DOM.p.style.lineHeight = settings.messageLineHeight; - } - } - } - - if(settings.title.length > 0 && settings.message.length > 0) { - if(settings.rtl){ - $DOM.strong.style.marginLeft = '10px'; - } else if(settings.layout !== 2 && !settings.rtl) { - $DOM.strong.style.marginRight = '10px'; - } - } - })(); - - $DOM.toastBody.appendChild($DOM.toastTexts); - - // Inputs - var $inputs; - (function(){ - if(settings.inputs.length > 0) { - - $DOM.inputs.classList.add(PLUGIN_NAME + '-inputs'); - - forEach(settings.inputs, function (value, index) { - $DOM.inputs.appendChild(createFragElem(value[0])); - - $inputs = $DOM.inputs.childNodes; - - $inputs[index].classList.add(PLUGIN_NAME + '-inputs-child'); - - if(value[3]){ - setTimeout(function() { - $inputs[index].focus(); - }, 300); - } - - $inputs[index].addEventListener(value[1], function (e) { - var ts = value[2]; - return ts(that, $DOM.toast, this, e); - }); - }); - $DOM.toastBody.appendChild($DOM.inputs); - } - })(); - - // Buttons - (function(){ - if(settings.buttons.length > 0) { - - $DOM.buttons.classList.add(PLUGIN_NAME + '-buttons'); - - forEach(settings.buttons, function (value, index) { - $DOM.buttons.appendChild(createFragElem(value[0])); - - var $btns = $DOM.buttons.childNodes; - - $btns[index].classList.add(PLUGIN_NAME + '-buttons-child'); - - if(value[2]){ - setTimeout(function() { - $btns[index].focus(); - }, 300); - } - - $btns[index].addEventListener('click', function (e) { - e.preventDefault(); - var ts = value[1]; - return ts(that, $DOM.toast, this, e, $inputs); - }); - }); - } - $DOM.toastBody.appendChild($DOM.buttons); - })(); - - if(settings.message.length > 0 && (settings.inputs.length > 0 || settings.buttons.length > 0)) { - $DOM.p.style.marginBottom = '0'; - } - - if(settings.inputs.length > 0 || settings.buttons.length > 0){ - if(settings.rtl){ - $DOM.toastTexts.style.marginLeft = '10px'; - } else { - $DOM.toastTexts.style.marginRight = '10px'; - } - if(settings.inputs.length > 0 && settings.buttons.length > 0){ - if(settings.rtl){ - $DOM.inputs.style.marginLeft = '8px'; - } else { - $DOM.inputs.style.marginRight = '8px'; - } - } - } - - // Wrap - (function(){ - $DOM.toastCapsule.style.visibility = 'hidden'; - setTimeout(function() { - var H = $DOM.toast.offsetHeight; - var style = $DOM.toast.currentStyle || window.getComputedStyle($DOM.toast); - var marginTop = style.marginTop; - marginTop = marginTop.split('px'); - marginTop = parseInt(marginTop[0]); - var marginBottom = style.marginBottom; - marginBottom = marginBottom.split('px'); - marginBottom = parseInt(marginBottom[0]); - - $DOM.toastCapsule.style.visibility = ''; - $DOM.toastCapsule.style.height = (H+marginBottom+marginTop)+'px'; - - setTimeout(function() { - $DOM.toastCapsule.style.height = 'auto'; - if(settings.target){ - $DOM.toastCapsule.style.overflow = 'visible'; - } - }, 500); - - if(settings.timeout) { - that.progress(settings, $DOM.toast).start(); - } - }, 100); - })(); - - // Target - (function(){ - var position = settings.position; - - if(settings.target){ - - $DOM.wrapper = document.querySelector(settings.target); - $DOM.wrapper.classList.add(PLUGIN_NAME + '-target'); - - if(settings.targetFirst) { - $DOM.wrapper.insertBefore($DOM.toastCapsule, $DOM.wrapper.firstChild); - } else { - $DOM.wrapper.appendChild($DOM.toastCapsule); - } - - } else { - - if( POSITIONS.indexOf(settings.position) == -1 ){ - console.warn('['+PLUGIN_NAME+'] Incorrect position.\nIt can be › ' + POSITIONS); - return; - } - - if(ISMOBILE || window.innerWidth <= MOBILEWIDTH){ - if(settings.position == 'bottomLeft' || settings.position == 'bottomRight' || settings.position == 'bottomCenter'){ - position = PLUGIN_NAME+'-wrapper-bottomCenter'; - } - else if(settings.position == 'topLeft' || settings.position == 'topRight' || settings.position == 'topCenter'){ - position = PLUGIN_NAME+'-wrapper-topCenter'; - } - else { - position = PLUGIN_NAME+'-wrapper-center'; - } - } else { - position = PLUGIN_NAME+'-wrapper-'+position; - } - $DOM.wrapper = document.querySelector('.' + PLUGIN_NAME + '-wrapper.'+position); - - if(!$DOM.wrapper) { - $DOM.wrapper = document.createElement('div'); - $DOM.wrapper.classList.add(PLUGIN_NAME + '-wrapper'); - $DOM.wrapper.classList.add(position); - document.body.appendChild($DOM.wrapper); - } - if(settings.position == 'topLeft' || settings.position == 'topCenter' || settings.position == 'topRight'){ - $DOM.wrapper.insertBefore($DOM.toastCapsule, $DOM.wrapper.firstChild); - } else { - $DOM.wrapper.appendChild($DOM.toastCapsule); - } - } - - if(!isNaN(settings.zindex)) { - $DOM.wrapper.style.zIndex = settings.zindex; - } else { - console.warn('['+PLUGIN_NAME+'] Invalid zIndex.'); - } - })(); - - // Overlay - (function(){ - - if(settings.overlay) { - - if( document.querySelector('.'+PLUGIN_NAME+'-overlay.fadeIn') !== null ){ - - $DOM.overlay = document.querySelector('.'+PLUGIN_NAME+'-overlay'); - $DOM.overlay.setAttribute('data-iziToast-ref', $DOM.overlay.getAttribute('data-iziToast-ref') + ',' + settings.ref); - - if(!isNaN(settings.zindex) && settings.zindex !== null) { - $DOM.overlay.style.zIndex = settings.zindex-1; - } - - } else { - - $DOM.overlay.classList.add(PLUGIN_NAME+'-overlay'); - $DOM.overlay.classList.add('fadeIn'); - $DOM.overlay.style.background = settings.overlayColor; - $DOM.overlay.setAttribute('data-iziToast-ref', settings.ref); - if(!isNaN(settings.zindex) && settings.zindex !== null) { - $DOM.overlay.style.zIndex = settings.zindex-1; - } - document.querySelector('body').appendChild($DOM.overlay); - } - - if(settings.overlayClose) { - - $DOM.overlay.removeEventListener('click', {}); - $DOM.overlay.addEventListener('click', function (e) { - that.hide(settings, $DOM.toast, 'overlay'); - }); - } else { - $DOM.overlay.removeEventListener('click', {}); - } - } - })(); - - // Inside animations - (function(){ - if(settings.animateInside){ - $DOM.toast.classList.add(PLUGIN_NAME+'-animateInside'); - - var animationTimes = [200, 100, 300]; - if(settings.transitionIn == 'bounceInLeft' || settings.transitionIn == 'bounceInRight'){ - animationTimes = [400, 200, 400]; - } - - if(settings.title.length > 0) { - setTimeout(function(){ - $DOM.strong.classList.add('slideIn'); - }, animationTimes[0]); - } - - if(settings.message.length > 0) { - setTimeout(function(){ - $DOM.p.classList.add('slideIn'); - }, animationTimes[1]); - } - - if(settings.icon || settings.iconUrl) { - setTimeout(function(){ - $DOM.icon.classList.add('revealIn'); - }, animationTimes[2]); - } - - var counter = 150; - if(settings.buttons.length > 0 && $DOM.buttons) { - - setTimeout(function(){ - - forEach($DOM.buttons.childNodes, function(element, index) { - - setTimeout(function(){ - element.classList.add('revealIn'); - }, counter); - counter = counter + 150; - }); - - }, settings.inputs.length > 0 ? 150 : 0); - } - - if(settings.inputs.length > 0 && $DOM.inputs) { - counter = 150; - forEach($DOM.inputs.childNodes, function(element, index) { - - setTimeout(function(){ - element.classList.add('revealIn'); - }, counter); - counter = counter + 150; - }); - } - } - })(); - - settings.onOpening.apply(null, [settings, $DOM.toast]); - - try { - var event = new CustomEvent(PLUGIN_NAME + '-opening', {detail: settings, bubbles: true, cancelable: true}); - document.dispatchEvent(event); - } catch(ex){ - console.warn(ex); - } - - setTimeout(function() { - - $DOM.toast.classList.remove(PLUGIN_NAME+'-opening'); - $DOM.toast.classList.add(PLUGIN_NAME+'-opened'); - - try { - var event = new CustomEvent(PLUGIN_NAME + '-opened', {detail: settings, bubbles: true, cancelable: true}); - document.dispatchEvent(event); - } catch(ex){ - console.warn(ex); - } - - settings.onOpened.apply(null, [settings, $DOM.toast]); - }, 1000); - - if(settings.drag){ - - if(ACCEPTSTOUCH) { - - $DOM.toast.addEventListener('touchstart', function(e) { - drag.startMoving(this, that, settings, e); - }, false); - - $DOM.toast.addEventListener('touchend', function(e) { - drag.stopMoving(this, e); - }, false); - } else { - - $DOM.toast.addEventListener('mousedown', function(e) { - e.preventDefault(); - drag.startMoving(this, that, settings, e); - }, false); - - $DOM.toast.addEventListener('mouseup', function(e) { - e.preventDefault(); - drag.stopMoving(this, e); - }, false); - } - } - - if(settings.closeOnEscape) { - - document.addEventListener('keyup', function (evt) { - evt = evt || window.event; - if(evt.keyCode == 27) { - that.hide(settings, $DOM.toast, 'esc'); - } - }); - } - - if(settings.closeOnClick) { - $DOM.toast.addEventListener('click', function (evt) { - that.hide(settings, $DOM.toast, 'toast'); - }); - } - - that.toast = $DOM.toast; - }; - return $iziToast; + var $overlay = document.querySelector('.'+PLUGIN_NAME+'-overlay'); + if($overlay !== null){ + var refs = $overlay.getAttribute('data-iziToast-ref'); + refs = refs.split(','); + var index = refs.indexOf(String(settings.ref)); + + if(index !== -1){ + refs.splice(index, 1); + } + $overlay.setAttribute('data-iziToast-ref', refs.join()); + + if(refs.length === 0){ + $overlay.classList.remove('fadeIn'); + $overlay.classList.add('fadeOut'); + setTimeout(function() { + $overlay.remove(); + }, 700); + } + } + + })(); + + if(settings.transitionIn){ + $toast.classList.remove(settings.transitionIn); + } + + if(settings.transitionInMobile){ + $toast.classList.remove(settings.transitionInMobile); + } + + if(ISMOBILE || window.innerWidth <= MOBILEWIDTH){ + if(settings.transitionOutMobile) + $toast.classList.add(settings.transitionOutMobile); + } else { + if(settings.transitionOut) + $toast.classList.add(settings.transitionOut); + } + var H = $toast.parentNode.offsetHeight; + $toast.parentNode.style.height = H+'px'; + $toast.style.pointerEvents = 'none'; + + if(!ISMOBILE || window.innerWidth > MOBILEWIDTH){ + $toast.parentNode.style.transitionDelay = '0.2s'; + } + + try { + var event = new CustomEvent(PLUGIN_NAME+'-closing', {detail: settings, bubbles: true, cancelable: true}); + document.dispatchEvent(event); + } catch(ex){ + console.warn(ex); + } + + setTimeout(function() { + + $toast.parentNode.style.height = '0px'; + $toast.parentNode.style.overflow = ''; + + setTimeout(function(){ + + delete that.children[settings.ref]; + + $toast.parentNode.remove(); + + try { + var event = new CustomEvent(PLUGIN_NAME+'-closed', {detail: settings, bubbles: true, cancelable: true}); + document.dispatchEvent(event); + } catch(ex){ + console.warn(ex); + } + + if(typeof settings.onClosed !== 'undefined'){ + settings.onClosed.apply(null, [settings, $toast, closedBy]); + } + + }, 1000); + }, 200); + + + if(typeof settings.onClosing !== 'undefined'){ + settings.onClosing.apply(null, [settings, $toast, closedBy]); + } + }; + + /** + * Create and show the Toast + * @public + * @param {Object} options User settings + */ + $iziToast.show = function (options) { + + var that = this; + + // Merge user options with defaults + var settings = extend(CONFIG, options || {}); + settings = extend(defaults, settings); + settings.time = {}; + + if(settings.id === null){ + settings.id = generateId(settings.title+settings.message+settings.color); + } + + if(settings.displayMode === 1 || settings.displayMode == 'once'){ + try { + if(document.querySelectorAll('.'+PLUGIN_NAME+'#'+settings.id).length > 0){ + return false; + } + } catch (exc) { + console.warn('['+PLUGIN_NAME+'] Could not find an element with this selector: '+'#'+settings.id+'. Try to set an valid id.'); + } + } + + if(settings.displayMode === 2 || settings.displayMode == 'replace'){ + try { + forEach(document.querySelectorAll('.'+PLUGIN_NAME+'#'+settings.id), function(element, index) { + that.hide(settings, element, 'replaced'); + }); + } catch (exc) { + console.warn('['+PLUGIN_NAME+'] Could not find an element with this selector: '+'#'+settings.id+'. Try to set an valid id.'); + } + } + + settings.ref = new Date().getTime() + Math.floor((Math.random() * 10000000) + 1); + + $iziToast.children[settings.ref] = settings; + + var $DOM = { + body: document.querySelector('body'), + overlay: document.createElement('div'), + toast: document.createElement('div'), + toastBody: document.createElement('div'), + toastTexts: document.createElement('div'), + toastCapsule: document.createElement('div'), + cover: document.createElement('div'), + buttons: document.createElement('div'), + inputs: document.createElement('div'), + icon: !settings.iconUrl ? document.createElement('i') : document.createElement('img'), + wrapper: null + }; + + $DOM.toast.setAttribute('data-iziToast-ref', settings.ref); + $DOM.toast.appendChild($DOM.toastBody); + $DOM.toastCapsule.appendChild($DOM.toast); + + // CSS Settings + (function(){ + + $DOM.toast.classList.add(PLUGIN_NAME); + $DOM.toast.classList.add(PLUGIN_NAME+'-opening'); + $DOM.toastCapsule.classList.add(PLUGIN_NAME+'-capsule'); + $DOM.toastBody.classList.add(PLUGIN_NAME + '-body'); + $DOM.toastTexts.classList.add(PLUGIN_NAME + '-texts'); + + if(ISMOBILE || window.innerWidth <= MOBILEWIDTH){ + if(settings.transitionInMobile) + $DOM.toast.classList.add(settings.transitionInMobile); + } else { + if(settings.transitionIn) + $DOM.toast.classList.add(settings.transitionIn); + } + + if(settings.class){ + var classes = settings.class.split(' '); + forEach(classes, function (value, index) { + $DOM.toast.classList.add(value); + }); + } + + if(settings.id){ $DOM.toast.id = settings.id; } + + if(settings.rtl){ + $DOM.toast.classList.add(PLUGIN_NAME + '-rtl'); + $DOM.toast.setAttribute('dir', 'rtl'); + } + + if(settings.layout > 1){ $DOM.toast.classList.add(PLUGIN_NAME+'-layout'+settings.layout); } + + if(settings.balloon){ $DOM.toast.classList.add(PLUGIN_NAME+'-balloon'); } + + if(settings.maxWidth){ + if( !isNaN(settings.maxWidth) ){ + $DOM.toast.style.maxWidth = settings.maxWidth+'px'; + } else { + $DOM.toast.style.maxWidth = settings.maxWidth; + } + } + + if(settings.theme !== '' || settings.theme !== 'light') { + + $DOM.toast.classList.add(PLUGIN_NAME+'-theme-'+settings.theme); + } + + if(settings.color) { //#, rgb, rgba, hsl + + if( isColor(settings.color) ){ + $DOM.toast.style.background = settings.color; + } else { + $DOM.toast.classList.add(PLUGIN_NAME+'-color-'+settings.color); + } + } + + if(settings.backgroundColor) { + $DOM.toast.style.background = settings.backgroundColor; + if(settings.balloon){ + $DOM.toast.style.borderColor = settings.backgroundColor; + } + } + })(); + + // Cover image + (function(){ + if(settings.image) { + $DOM.cover.classList.add(PLUGIN_NAME + '-cover'); + $DOM.cover.style.width = settings.imageWidth + 'px'; + + if(isBase64(settings.image.replace(/ /g,''))){ + $DOM.cover.style.backgroundImage = 'url(data:image/png;base64,' + settings.image.replace(/ /g,'') + ')'; + } else { + $DOM.cover.style.backgroundImage = 'url(' + settings.image + ')'; + } + + if(settings.rtl){ + $DOM.toastBody.style.marginRight = (settings.imageWidth + 10) + 'px'; + } else { + $DOM.toastBody.style.marginLeft = (settings.imageWidth + 10) + 'px'; + } + $DOM.toast.appendChild($DOM.cover); + } + })(); + + // Button close + (function(){ + if(settings.close){ + + $DOM.buttonClose = document.createElement('button'); + $DOM.buttonClose.type = 'button'; + $DOM.buttonClose.classList.add(PLUGIN_NAME + '-close'); + $DOM.buttonClose.addEventListener('click', function (e) { + var button = e.target; + that.hide(settings, $DOM.toast, 'button'); + }); + $DOM.toast.appendChild($DOM.buttonClose); + } else { + if(settings.rtl){ + $DOM.toast.style.paddingLeft = '18px'; + } else { + $DOM.toast.style.paddingRight = '18px'; + } + } + })(); + + // Progress Bar & Timeout + (function(){ + + if(settings.progressBar){ + $DOM.progressBar = document.createElement('div'); + $DOM.progressBarDiv = document.createElement('div'); + $DOM.progressBar.classList.add(PLUGIN_NAME + '-progressbar'); + $DOM.progressBarDiv.style.background = settings.progressBarColor; + $DOM.progressBar.appendChild($DOM.progressBarDiv); + $DOM.toast.appendChild($DOM.progressBar); + } + + if(settings.timeout) { + + if(settings.pauseOnHover && !settings.resetOnHover){ + + $DOM.toast.addEventListener('mouseenter', function (e) { + that.progress(settings, $DOM.toast).pause(); + }); + $DOM.toast.addEventListener('mouseleave', function (e) { + that.progress(settings, $DOM.toast).resume(); + }); + } + + if(settings.resetOnHover){ + + $DOM.toast.addEventListener('mouseenter', function (e) { + that.progress(settings, $DOM.toast).reset(); + }); + $DOM.toast.addEventListener('mouseleave', function (e) { + that.progress(settings, $DOM.toast).start(); + }); + } + } + })(); + + // Icon + (function(){ + + if(settings.iconUrl) { + + $DOM.icon.setAttribute('class', PLUGIN_NAME + '-icon'); + $DOM.icon.setAttribute('src', settings.iconUrl); + + } else if(settings.icon) { + $DOM.icon.setAttribute('class', PLUGIN_NAME + '-icon ' + settings.icon); + + if(settings.iconText){ + $DOM.icon.appendChild(document.createTextNode(settings.iconText)); + } + + if(settings.iconColor){ + $DOM.icon.style.color = settings.iconColor; + } + } + + if(settings.icon || settings.iconUrl) { + + if(settings.rtl){ + $DOM.toastBody.style.paddingRight = '33px'; + } else { + $DOM.toastBody.style.paddingLeft = '33px'; + } + + $DOM.toastBody.appendChild($DOM.icon); + } + + })(); + + // Title & Message + (function(){ + if(settings.title.length > 0) { + + $DOM.strong = document.createElement('strong'); + $DOM.strong.classList.add(PLUGIN_NAME + '-title'); + $DOM.strong.appendChild(createFragElem(settings.title)); + $DOM.toastTexts.appendChild($DOM.strong); + + if(settings.titleColor) { + $DOM.strong.style.color = settings.titleColor; + } + if(settings.titleSize) { + if( !isNaN(settings.titleSize) ){ + $DOM.strong.style.fontSize = settings.titleSize+'px'; + } else { + $DOM.strong.style.fontSize = settings.titleSize; + } + } + if(settings.titleLineHeight) { + if( !isNaN(settings.titleSize) ){ + $DOM.strong.style.lineHeight = settings.titleLineHeight+'px'; + } else { + $DOM.strong.style.lineHeight = settings.titleLineHeight; + } + } + } + + if(settings.message.length > 0) { + + $DOM.p = document.createElement('p'); + $DOM.p.classList.add(PLUGIN_NAME + '-message'); + $DOM.p.appendChild(createFragElem(settings.message)); + $DOM.toastTexts.appendChild($DOM.p); + + if(settings.messageColor) { + $DOM.p.style.color = settings.messageColor; + } + if(settings.messageSize) { + if( !isNaN(settings.titleSize) ){ + $DOM.p.style.fontSize = settings.messageSize+'px'; + } else { + $DOM.p.style.fontSize = settings.messageSize; + } + } + if(settings.messageLineHeight) { + + if( !isNaN(settings.titleSize) ){ + $DOM.p.style.lineHeight = settings.messageLineHeight+'px'; + } else { + $DOM.p.style.lineHeight = settings.messageLineHeight; + } + } + } + + if(settings.title.length > 0 && settings.message.length > 0) { + if(settings.rtl){ + $DOM.strong.style.marginLeft = '10px'; + } else if(settings.layout !== 2 && !settings.rtl) { + $DOM.strong.style.marginRight = '10px'; + } + } + })(); + + $DOM.toastBody.appendChild($DOM.toastTexts); + + // Inputs + var $inputs; + (function(){ + if(settings.inputs.length > 0) { + + $DOM.inputs.classList.add(PLUGIN_NAME + '-inputs'); + + forEach(settings.inputs, function (value, index) { + $DOM.inputs.appendChild(createFragElem(value[0])); + + $inputs = $DOM.inputs.childNodes; + + $inputs[index].classList.add(PLUGIN_NAME + '-inputs-child'); + + if(value[3]){ + setTimeout(function() { + $inputs[index].focus(); + }, 300); + } + + $inputs[index].addEventListener(value[1], function (e) { + var ts = value[2]; + return ts(that, $DOM.toast, this, e); + }); + }); + $DOM.toastBody.appendChild($DOM.inputs); + } + })(); + + // Buttons + (function(){ + if(settings.buttons.length > 0) { + + $DOM.buttons.classList.add(PLUGIN_NAME + '-buttons'); + + forEach(settings.buttons, function (value, index) { + $DOM.buttons.appendChild(createFragElem(value[0])); + + var $btns = $DOM.buttons.childNodes; + + $btns[index].classList.add(PLUGIN_NAME + '-buttons-child'); + + if(value[2]){ + setTimeout(function() { + $btns[index].focus(); + }, 300); + } + + $btns[index].addEventListener('click', function (e) { + e.preventDefault(); + var ts = value[1]; + return ts(that, $DOM.toast, this, e, $inputs); + }); + }); + } + $DOM.toastBody.appendChild($DOM.buttons); + })(); + + if(settings.message.length > 0 && (settings.inputs.length > 0 || settings.buttons.length > 0)) { + $DOM.p.style.marginBottom = '0'; + } + + if(settings.inputs.length > 0 || settings.buttons.length > 0){ + if(settings.rtl){ + $DOM.toastTexts.style.marginLeft = '10px'; + } else { + $DOM.toastTexts.style.marginRight = '10px'; + } + if(settings.inputs.length > 0 && settings.buttons.length > 0){ + if(settings.rtl){ + $DOM.inputs.style.marginLeft = '8px'; + } else { + $DOM.inputs.style.marginRight = '8px'; + } + } + } + + // Wrap + (function(){ + $DOM.toastCapsule.style.visibility = 'hidden'; + setTimeout(function() { + var H = $DOM.toast.offsetHeight; + var style = $DOM.toast.currentStyle || window.getComputedStyle($DOM.toast); + var marginTop = style.marginTop; + marginTop = marginTop.split('px'); + marginTop = parseInt(marginTop[0]); + var marginBottom = style.marginBottom; + marginBottom = marginBottom.split('px'); + marginBottom = parseInt(marginBottom[0]); + + $DOM.toastCapsule.style.visibility = ''; + $DOM.toastCapsule.style.height = (H+marginBottom+marginTop)+'px'; + + setTimeout(function() { + $DOM.toastCapsule.style.height = 'auto'; + if(settings.target){ + $DOM.toastCapsule.style.overflow = 'visible'; + } + }, 500); + + if(settings.timeout) { + that.progress(settings, $DOM.toast).start(); + } + }, 100); + })(); + + // Target + (function(){ + var position = settings.position; + + if(settings.target){ + + $DOM.wrapper = document.querySelector(settings.target); + $DOM.wrapper.classList.add(PLUGIN_NAME + '-target'); + + if(settings.targetFirst) { + $DOM.wrapper.insertBefore($DOM.toastCapsule, $DOM.wrapper.firstChild); + } else { + $DOM.wrapper.appendChild($DOM.toastCapsule); + } + + } else { + + if( POSITIONS.indexOf(settings.position) == -1 ){ + console.warn('['+PLUGIN_NAME+'] Incorrect position.\nIt can be › ' + POSITIONS); + return; + } + + if(ISMOBILE || window.innerWidth <= MOBILEWIDTH){ + if(settings.position == 'bottomLeft' || settings.position == 'bottomRight' || settings.position == 'bottomCenter'){ + position = PLUGIN_NAME+'-wrapper-bottomCenter'; + } + else if(settings.position == 'topLeft' || settings.position == 'topRight' || settings.position == 'topCenter'){ + position = PLUGIN_NAME+'-wrapper-topCenter'; + } + else { + position = PLUGIN_NAME+'-wrapper-center'; + } + } else { + position = PLUGIN_NAME+'-wrapper-'+position; + } + $DOM.wrapper = document.querySelector('.' + PLUGIN_NAME + '-wrapper.'+position); + + if(!$DOM.wrapper) { + $DOM.wrapper = document.createElement('div'); + $DOM.wrapper.classList.add(PLUGIN_NAME + '-wrapper'); + $DOM.wrapper.classList.add(position); + document.body.appendChild($DOM.wrapper); + } + if(settings.position == 'topLeft' || settings.position == 'topCenter' || settings.position == 'topRight'){ + $DOM.wrapper.insertBefore($DOM.toastCapsule, $DOM.wrapper.firstChild); + } else { + $DOM.wrapper.appendChild($DOM.toastCapsule); + } + } + + if(!isNaN(settings.zindex)) { + $DOM.wrapper.style.zIndex = settings.zindex; + } else { + console.warn('['+PLUGIN_NAME+'] Invalid zIndex.'); + } + })(); + + // Overlay + (function(){ + + if(settings.overlay) { + + if( document.querySelector('.'+PLUGIN_NAME+'-overlay.fadeIn') !== null ){ + + $DOM.overlay = document.querySelector('.'+PLUGIN_NAME+'-overlay'); + $DOM.overlay.setAttribute('data-iziToast-ref', $DOM.overlay.getAttribute('data-iziToast-ref') + ',' + settings.ref); + + if(!isNaN(settings.zindex) && settings.zindex !== null) { + $DOM.overlay.style.zIndex = settings.zindex-1; + } + + } else { + + $DOM.overlay.classList.add(PLUGIN_NAME+'-overlay'); + $DOM.overlay.classList.add('fadeIn'); + $DOM.overlay.style.background = settings.overlayColor; + $DOM.overlay.setAttribute('data-iziToast-ref', settings.ref); + if(!isNaN(settings.zindex) && settings.zindex !== null) { + $DOM.overlay.style.zIndex = settings.zindex-1; + } + document.querySelector('body').appendChild($DOM.overlay); + } + + if(settings.overlayClose) { + + $DOM.overlay.removeEventListener('click', {}); + $DOM.overlay.addEventListener('click', function (e) { + that.hide(settings, $DOM.toast, 'overlay'); + }); + } else { + $DOM.overlay.removeEventListener('click', {}); + } + } + })(); + + // Inside animations + (function(){ + if(settings.animateInside){ + $DOM.toast.classList.add(PLUGIN_NAME+'-animateInside'); + + var animationTimes = [200, 100, 300]; + if(settings.transitionIn == 'bounceInLeft' || settings.transitionIn == 'bounceInRight'){ + animationTimes = [400, 200, 400]; + } + + if(settings.title.length > 0) { + setTimeout(function(){ + $DOM.strong.classList.add('slideIn'); + }, animationTimes[0]); + } + + if(settings.message.length > 0) { + setTimeout(function(){ + $DOM.p.classList.add('slideIn'); + }, animationTimes[1]); + } + + if(settings.icon || settings.iconUrl) { + setTimeout(function(){ + $DOM.icon.classList.add('revealIn'); + }, animationTimes[2]); + } + + var counter = 150; + if(settings.buttons.length > 0 && $DOM.buttons) { + + setTimeout(function(){ + + forEach($DOM.buttons.childNodes, function(element, index) { + + setTimeout(function(){ + element.classList.add('revealIn'); + }, counter); + counter = counter + 150; + }); + + }, settings.inputs.length > 0 ? 150 : 0); + } + + if(settings.inputs.length > 0 && $DOM.inputs) { + counter = 150; + forEach($DOM.inputs.childNodes, function(element, index) { + + setTimeout(function(){ + element.classList.add('revealIn'); + }, counter); + counter = counter + 150; + }); + } + } + })(); + + settings.onOpening.apply(null, [settings, $DOM.toast]); + + try { + var event = new CustomEvent(PLUGIN_NAME + '-opening', {detail: settings, bubbles: true, cancelable: true}); + document.dispatchEvent(event); + } catch(ex){ + console.warn(ex); + } + + setTimeout(function() { + + $DOM.toast.classList.remove(PLUGIN_NAME+'-opening'); + $DOM.toast.classList.add(PLUGIN_NAME+'-opened'); + + try { + var event = new CustomEvent(PLUGIN_NAME + '-opened', {detail: settings, bubbles: true, cancelable: true}); + document.dispatchEvent(event); + } catch(ex){ + console.warn(ex); + } + + settings.onOpened.apply(null, [settings, $DOM.toast]); + }, 1000); + + if(settings.drag){ + + if(ACCEPTSTOUCH) { + + $DOM.toast.addEventListener('touchstart', function(e) { + drag.startMoving(this, that, settings, e); + }, false); + + $DOM.toast.addEventListener('touchend', function(e) { + drag.stopMoving(this, e); + }, false); + } else { + + $DOM.toast.addEventListener('mousedown', function(e) { + e.preventDefault(); + drag.startMoving(this, that, settings, e); + }, false); + + $DOM.toast.addEventListener('mouseup', function(e) { + e.preventDefault(); + drag.stopMoving(this, e); + }, false); + } + } + + if(settings.closeOnEscape) { + + document.addEventListener('keyup', function (evt) { + evt = evt || window.event; + if(evt.keyCode == 27) { + that.hide(settings, $DOM.toast, 'esc'); + } + }); + } + + if(settings.closeOnClick) { + $DOM.toast.addEventListener('click', function (evt) { + that.hide(settings, $DOM.toast, 'toast'); + }); + } + + that.toast = $DOM.toast; + }; + return $iziToast; }); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/topBar.js b/src/main/resources/static/component/pear/module/topBar.js index a12653ee..e71c586f 100644 --- a/src/main/resources/static/component/pear/module/topBar.js +++ b/src/main/resources/static/component/pear/module/topBar.js @@ -1,14 +1,13 @@ -layui.define(['jquery', 'element', 'util'], function (exports) { - "use strict"; +layui.define(['jquery', 'element','util'], function(exports) { + "use strict"; - var MOD_NAME = 'topBar', - $ = layui.jquery, - util = layui.util, - element = layui.element; - - var topBar = new function () { - - util.fixbar({}); - } - exports(MOD_NAME, topBar); + var MOD_NAME = 'topBar', + $ = layui.jquery, + util = layui.util, + element = layui.element; + + var topBar = new function() { + util.fixbar({}); + } + exports(MOD_NAME,topBar); }); \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/treetable.js b/src/main/resources/static/component/pear/module/treetable.js index f0149e37..ab0d7a91 100644 --- a/src/main/resources/static/component/pear/module/treetable.js +++ b/src/main/resources/static/component/pear/module/treetable.js @@ -42,17 +42,9 @@ layui.define(['layer', 'table'], function (exports) { for (var i = 0; i < tNodes.length; i++) { var tt = tNodes[i]; if (!tt.id) { - if (!param.treeIdName) { - layer.msg('参数treeIdName不能为空', {icon: 5}); - return; - } tt.id = tt[param.treeIdName]; } if (!tt.pid) { - if (!param.treePidName) { - layer.msg('参数treePidName不能为空', {icon: 5}); - return; - } tt.pid = tt[param.treePidName]; } } @@ -127,31 +119,31 @@ layui.define(['layer', 'table'], function (exports) { } }) }, - search: function(elem,keyword) { - var $tds = $(elem).next('.treeTable').find('.layui-table-body tbody tr td'); - if (!keyword) { - $tds.css('background-color', 'transparent'); - layer.msg("请输入关键字", {icon: 5}); - return; - } - var searchCount = 0; - $tds.each(function () { - $(this).css('background-color', 'transparent'); - if ($(this).text().indexOf(keyword) >= 0) { - $(this).css('background-color', 'rgba(250,230,160,0.5)'); - if (searchCount == 0) { - $('body,html').stop(true); - $('body,html').animate({scrollTop: $(this).offset().top - 150}, 500); - } - searchCount++; - } - }); - if (searchCount == 0) { - layer.msg("没有匹配结果", {icon: 5}); - } else { - treetable.expandAll(elem); - } - }, + search: function(elem,keyword) { + var $tds = $(elem).next('.treeTable').find('.layui-table-body tbody tr td'); + if (!keyword) { + $tds.css('background-color', 'transparent'); + layer.msg("请输入关键字", {icon: 5}); + return; + } + var searchCount = 0; + $tds.each(function () { + $(this).css('background-color', 'transparent'); + if ($(this).text().indexOf(keyword) >= 0) { + $(this).css('background-color', 'rgba(250,230,160,0.5)'); + if (searchCount == 0) { + $('body,html').stop(true); + $('body,html').animate({scrollTop: $(this).offset().top - 150}, 500); + } + searchCount++; + } + }); + if (searchCount == 0) { + layer.msg("没有匹配结果", {icon: 5}); + } else { + treetable.expandAll(elem); + } + }, getEmptyNum: function (pid, data) { var num = 0; if (!pid) { @@ -207,6 +199,16 @@ layui.define(['layer', 'table'], function (exports) { return false; } + if (!param.treeIdName) { + layer.msg('参数treeIdName不能为空', {icon: 5}); + return false; + } + + if (!param.treePidName) { + layer.msg('参数treePidName不能为空', {icon: 5}); + return false; + } + if (!param.treeColIndex && param.treeColIndex != 0) { layer.msg('参数treeColIndex不能为空', {icon: 5}); return false; diff --git a/src/main/resources/static/component/pear/module/watermark/watermark.js b/src/main/resources/static/component/pear/module/watermark/watermark.js new file mode 100644 index 00000000..6c23455e --- /dev/null +++ b/src/main/resources/static/component/pear/module/watermark/watermark.js @@ -0,0 +1,224 @@ +/* global Watermark */ +layui.define(['jquery', 'element'], function(exports) { + var $=layui.$; + var _parentEle; + var _wmContainer; + var _wmObserver; + var _wmParentObserver; + var _resizeHandler; + var _windowsWidth = window.outerWidth; + var _windowsHeight = window.outerHeight; + + var _left = 0; + var _top = 0; + + /** + * Create DOM of watermark's container + * @param {Watermark} watermark + */ + var _createContainer = function (watermark) { + watermark._container = document.createElement('div'); + watermark._container.classList.add('cell-watermark-container'); + watermark._container.style.cssText = 'display: block; pointer-events: none;'; + watermark._container.setAttribute('aria-hidden', true); + _parentEle = document.querySelector(watermark.options.appendTo) || document.body; + //获取页面最大宽度 + _windowsWidth = Math.min(_parentEle.scrollWidth, _parentEle.clientWidth); + //获取页面最大高度 + _windowsHeight = Math.min(_parentEle.scrollHeight, _parentEle.clientHeight); + _parentEle.appendChild(watermark._container); + }; + + /** + * Create watermark's DOM + * @param {Watermark} watermark + * @param {Object} options + */ + var _createWatermark = function (watermark, options) { + options.rowSpacing = options.rowSpacing || 60; + options.colSpacing = options.colSpacing || 30; + options.width = options.width || 150; + options.height = options.height || 20; + + let rows = parseInt(_windowsHeight / (options.height + options.rowSpacing)); + let cols = parseInt(_windowsWidth / (options.width + options.colSpacing)); + let offsetLeft =_left+ (_windowsWidth - options.width * cols - options.colSpacing * (cols - 1)) / 2; + let offsetTop = _top+(_windowsHeight - options.height * rows - options.rowSpacing * (rows - 1)) / 2; + let watermarkBase = document.createElement('div'); + watermarkBase.classList.add('cell-watermark'); + watermarkBase.style.cssText = + 'transform: rotate(15deg); opacity: 0.1; font-size: 0.85rem; text-align: center;' + + 'position: absolute; user-select: none; word-break: break-all; overflow: hidden; z-index: 999999;'; + for (let row = 0; row < rows; row++) { + let top = offsetTop + (options.rowSpacing + options.height) * row; + let tempCols = cols; + row % 2 !== 0 && tempCols++; + for (let col = 0; col < tempCols; col++) { + let left = offsetLeft + (options.colSpacing + options.width) * col; + tempCols !== cols && (left -= (options.colSpacing + options.width) / 2); + let watermarkEle = watermarkBase.cloneNode(); + watermarkEle.style.cssText += `left: ${left}px; top: ${top}px; width: ${options.width}px; height: ${options.height}px`; + watermarkEle.style.transform = `rotate(${options.rotate}deg)`; + watermarkEle.style.opacity = options.opacity; + watermarkEle.style.fontSize = `${options.fontSize}rem`; + watermarkEle.style.fontFamily = options.fontFamily; + watermarkEle.innerHTML = options.content; + watermark._container.appendChild(watermarkEle); + } + } + //Backup for recover the watermark's container when the its DOM is removed + _wmContainer = watermark._container; + }; + + /** + * Rerender watermark + * @param {Watermark} watermark + * @param {Object} options + */ + var _render = function (watermark, options) { + _wmObserver.disconnect(); + watermark._container.innerHTML = ''; + _createWatermark(watermark, options); + _wmObserver.observe(watermark._container, { + attributes: true, + childList: true, + characterData: true, + subtree: true + }); + }; + + /** + * Observe watermark and watermark's parentNode mutations + * @param {Watermark} watermark + */ + var _addObserve = function (watermark) { + //Observe watermark element and its child element + _wmObserver = new MutationObserver(function (mutations, observer) { + _render(watermark, watermark.options); + }); + _wmObserver.observe(watermark._container, { + attributes: true, + childList: true, + characterData: true, + subtree: true + }); + //Observe parent element, recreate if the element is deleted + _wmParentObserver = new MutationObserver(function (mutations) { + for (let m of mutations) { + if ( + m.type === 'childList' && + m.removedNodes.length > 0 && + document.querySelectorAll('.cell-watermark-container').length === 0 + ) { + _parentEle.appendChild(_wmContainer); + } + } + }); + _wmParentObserver.observe(watermark._container.parentNode, { + childList: true, + subtree: true + }); + }; + + /** + * Window's resize listener + * @param {Watermark} watermark + */ + var _addResizeListener = function (watermark) { + _resizeHandler = function () { + + //获取页面最大宽度 + var _windowsWidth_n = Math.max(_parentEle.scrollWidth, _parentEle.clientWidth); + //获取页面最大高度 + var _windowsHeight_n = Math.max(_parentEle.scrollHeight, _parentEle.clientHeight); + + + /*if (window.outerHeight !== _windowsHeight || window.outerWidth !== _windowsWidth) { + _windowsHeight = window.outerHeight; + _windowsWidth = window.outerWidth; + _render(watermark, watermark.options); + }*/ + if (_windowsHeight_n !== _windowsHeight || _windowsWidth_n !== _windowsWidth) { + _windowsHeight = _windowsHeight_n; + _windowsWidth = _windowsWidth_n; + _render(watermark, watermark.options); + } + + + }; + window.addEventListener('resize', _resizeHandler); + }; + + /** + * Watermark. + * Create watermark for webpage and automatic adjust when windows resize. + * @param {Object} options + * @param {String} [options.content] watermark's text + * @param {String} [options.appendTo='body'] parent of watermark's container + * @param {Number} [options.width=150] watermark's width. unit: px + * @param {Number} [options.height=20] watermark's height. unit: px + * @param {Number} [options.rowSpacing=60] row spacing of watermarks. unit: px + * @param {Number} [options.colSpacing=30] col spacing of watermarks. unit: px + * @param {Number} [options.rotate=15] watermark's tangent angle. unit: deg + * @param {Number} [options.opacity=0.1] watermark's transparency + * @param {Number} [options.fontSize=0.85] watermark's fontSize. unit: rem + * @param {Number} [options.fontFamily='inherit'] watermark's fontFamily. + * @namespace Watermark + * @class Watermark + * @version 1.0.3 + * @author @Lruihao https://lruihao.cn + */ + function Watermark(options = {}) { + var _proto = Watermark.prototype; + this.options = options; + _createContainer(this); + _createWatermark(this, this.options); + _addObserve(this); + _addResizeListener(this); + + /** + * Upload watermark's text content + * @param {String} content watermark's text + */ + _proto.upload = function (content) { + if (!content) { + return; + } + _wmParentObserver.disconnect(); + _wmObserver.disconnect(); + this.options.content = content; + for (const watermark of this._container.querySelectorAll('.cell-watermark')) { + watermark.innerHTML = content; + } + _wmParentObserver.observe(this._container.parentNode, { + childList: true, + subtree: true + }); + _wmObserver.observe(this._container, { + attributes: true, + childList: true, + characterData: true, + subtree: true + }); + }; + + /** + * Rerender watermark + * @param {Object} options + */ + _proto.render = function (options = {}) { + _render(this, Object.assign(this.options, options)); + }; + + /** + * Force destroy watermark + */ + _proto.destroy = function () { + _wmObserver.disconnect(); + _wmParentObserver.disconnect(); + window.removeEventListener('resize', _resizeHandler); + this._container.parentNode.removeChild(this._container); + }; + } + exports("watermark",Watermark); +}) \ No newline at end of file diff --git a/src/main/resources/static/component/pear/module/yaml.js b/src/main/resources/static/component/pear/module/yaml.js index 33598663..bb448bc5 100644 --- a/src/main/resources/static/component/pear/module/yaml.js +++ b/src/main/resources/static/component/pear/module/yaml.js @@ -1,2074 +1,2059 @@ -layui.define(['jquery', 'element'], function (exports) { - "use strict"; - - var MOD_NAME = 'yaml', - $ = layui.jquery, - element = layui.element; - - var yaml = new function () { - this.parse = function (str) { - return YAML.parse(yamlString); - } - this.load = function (path) { - return YAML.load(path); - } - } - exports(MOD_NAME, yaml); +layui.define(['jquery', 'element'], function(exports) { + "use strict"; + + var MOD_NAME = 'yaml', + $ = layui.jquery, + element = layui.element; + + var yaml = new function() { + this.parse = function(str){ + return YAML.parse(yamlString); + } + this.load = function(path){ + return YAML.load(path); + } + } + exports(MOD_NAME, yaml); }); -(function () { - function r(e, n, t) { - function o(i, f) { - if (!n[i]) { - if (!e[i]) { - var c = "function" == typeof require && require; - if (!f && c) return c(i, !0); - if (u) return u(i, !0); - var a = new Error("Cannot find module '" + i + "'"); - throw a.code = "MODULE_NOT_FOUND", a - } - var p = n[i] = { - exports: {} - }; - e[i][0].call(p.exports, function (r) { - var n = e[i][1][r]; - return o(n || r) - }, p, p.exports, r, e, n, t) - } - return n[i].exports - } - - for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) o(t[i]); - return o - } - - return r +(function() { + function r(e, n, t) { + function o(i, f) { + if (!n[i]) { + if (!e[i]) { + var c = "function" == typeof require && require; + if (!f && c) return c(i, !0); + if (u) return u(i, !0); + var a = new Error("Cannot find module '" + i + "'"); + throw a.code = "MODULE_NOT_FOUND", a + } + var p = n[i] = { + exports: {} + }; + e[i][0].call(p.exports, function(r) { + var n = e[i][1][r]; + return o(n || r) + }, p, p.exports, r, e, n, t) + } + return n[i].exports + } + for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) o(t[i]); + return o + } + return r })()({ - 1: [function (require, module, exports) { - var Dumper, Inline, Utils; - - Utils = require('./Utils'); - - Inline = require('./Inline'); - - Dumper = (function () { - function Dumper() { - } - - Dumper.indentation = 4; - - Dumper.prototype.dump = function (input, inline, indent, exceptionOnInvalidType, objectEncoder) { - var i, key, len, output, prefix, value, willBeInlined; - if (inline == null) { - inline = 0; - } - if (indent == null) { - indent = 0; - } - if (exceptionOnInvalidType == null) { - exceptionOnInvalidType = false; - } - if (objectEncoder == null) { - objectEncoder = null; - } - output = ''; - if (typeof input === 'function') { - return output; - } - prefix = (indent ? Utils.strRepeat(' ', indent) : ''); - if (inline <= 0 || typeof input !== 'object' || input instanceof Date || Utils.isEmpty(input)) { - output += prefix + Inline.dump(input, exceptionOnInvalidType, objectEncoder); - } else { - if (input instanceof Array) { - for (i = 0, len = input.length; i < len; i++) { - value = input[i]; - willBeInlined = inline - 1 <= 0 || typeof value !== 'object' || Utils.isEmpty(value); - output += prefix + '-' + (willBeInlined ? ' ' : "\n") + this.dump(value, inline - 1, (willBeInlined ? 0 : - indent + this.indentation), exceptionOnInvalidType, objectEncoder) + (willBeInlined ? "\n" : ''); - } - } else { - for (key in input) { - value = input[key]; - willBeInlined = inline - 1 <= 0 || typeof value !== 'object' || Utils.isEmpty(value); - output += prefix + Inline.dump(key, exceptionOnInvalidType, objectEncoder) + ':' + (willBeInlined ? ' ' : - "\n") + this.dump(value, inline - 1, (willBeInlined ? 0 : indent + this.indentation), - exceptionOnInvalidType, objectEncoder) + (willBeInlined ? "\n" : ''); - } - } - } - return output; - }; - - return Dumper; - - })(); - - module.exports = Dumper; - - - }, { - "./Inline": 6, - "./Utils": 10 - }], - 2: [function (require, module, exports) { - var Escaper, Pattern; - - Pattern = require('./Pattern'); - - Escaper = (function () { - var ch; - - function Escaper() { - } - - Escaper.LIST_ESCAPEES = ['\\', '\\\\', '\\"', '"', "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", - "\x07", "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", "\x10", "\x11", "\x12", "\x13", - "\x14", "\x15", "\x16", "\x17", "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", (ch = String.fromCharCode) - (0x0085), ch(0x00A0), ch(0x2028), ch(0x2029) - ]; - - Escaper.LIST_ESCAPED = ['\\\\', '\\"', '\\"', '\\"', "\\0", "\\x01", "\\x02", "\\x03", "\\x04", "\\x05", - "\\x06", "\\a", "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\x0e", "\\x0f", "\\x10", "\\x11", "\\x12", - "\\x13", "\\x14", "\\x15", "\\x16", "\\x17", "\\x18", "\\x19", "\\x1a", "\\e", "\\x1c", "\\x1d", "\\x1e", - "\\x1f", "\\N", "\\_", "\\L", "\\P" - ]; - - Escaper.MAPPING_ESCAPEES_TO_ESCAPED = (function () { - var i, j, mapping, ref; - mapping = {}; - for (i = j = 0, ref = Escaper.LIST_ESCAPEES.length; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) { - mapping[Escaper.LIST_ESCAPEES[i]] = Escaper.LIST_ESCAPED[i]; - } - return mapping; - })(); - - Escaper.PATTERN_CHARACTERS_TO_ESCAPE = new Pattern('[\\x00-\\x1f]|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9'); - - Escaper.PATTERN_MAPPING_ESCAPEES = new Pattern(Escaper.LIST_ESCAPEES.join('|').split('\\').join('\\\\')); - - Escaper.PATTERN_SINGLE_QUOTING = new Pattern('[\\s\'":{}[\\],&*#?]|^[-?|<>=!%@`]'); - - Escaper.requiresDoubleQuoting = function (value) { - return this.PATTERN_CHARACTERS_TO_ESCAPE.test(value); - }; - - Escaper.escapeWithDoubleQuotes = function (value) { - var result; - result = this.PATTERN_MAPPING_ESCAPEES.replace(value, (function (_this) { - return function (str) { - return _this.MAPPING_ESCAPEES_TO_ESCAPED[str]; - }; - })(this)); - return '"' + result + '"'; - }; - - Escaper.requiresSingleQuoting = function (value) { - return this.PATTERN_SINGLE_QUOTING.test(value); - }; - - Escaper.escapeWithSingleQuotes = function (value) { - return "'" + value.replace(/'/g, "''") + "'"; - }; - - return Escaper; - - })(); - - module.exports = Escaper; - - - }, { - "./Pattern": 8 - }], - 3: [function (require, module, exports) { - var DumpException, - extend = function (child, parent) { - for (var key in parent) { - if (hasProp.call(parent, key)) child[key] = parent[key]; - } - - function ctor() { - this.constructor = child; - } - - ctor.prototype = parent.prototype; - child.prototype = new ctor(); - child.__super__ = parent.prototype; - return child; - }, - hasProp = {}.hasOwnProperty; - - DumpException = (function (superClass) { - extend(DumpException, superClass); - - function DumpException(message, parsedLine, snippet) { - DumpException.__super__.constructor.call(this, message); - this.message = message; - this.parsedLine = parsedLine; - this.snippet = snippet; - } - - DumpException.prototype.toString = function () { - if ((this.parsedLine != null) && (this.snippet != null)) { - return ' ' + this.message + ' (line ' + this.parsedLine + ': \'' + this.snippet + '\')'; - } else { - return ' ' + this.message; - } - }; - - return DumpException; - - })(Error); - - module.exports = DumpException; - - - }, {}], - 4: [function (require, module, exports) { - var ParseException, - extend = function (child, parent) { - for (var key in parent) { - if (hasProp.call(parent, key)) child[key] = parent[key]; - } - - function ctor() { - this.constructor = child; - } + 1: [function(require, module, exports) { + var Dumper, Inline, Utils; + + Utils = require('./Utils'); + + Inline = require('./Inline'); + + Dumper = (function() { + function Dumper() {} + + Dumper.indentation = 4; + + Dumper.prototype.dump = function(input, inline, indent, exceptionOnInvalidType, objectEncoder) { + var i, key, len, output, prefix, value, willBeInlined; + if (inline == null) { + inline = 0; + } + if (indent == null) { + indent = 0; + } + if (exceptionOnInvalidType == null) { + exceptionOnInvalidType = false; + } + if (objectEncoder == null) { + objectEncoder = null; + } + output = ''; + if (typeof input === 'function') { + return output; + } + prefix = (indent ? Utils.strRepeat(' ', indent) : ''); + if (inline <= 0 || typeof input !== 'object' || input instanceof Date || Utils.isEmpty(input)) { + output += prefix + Inline.dump(input, exceptionOnInvalidType, objectEncoder); + } else { + if (input instanceof Array) { + for (i = 0, len = input.length; i < len; i++) { + value = input[i]; + willBeInlined = inline - 1 <= 0 || typeof value !== 'object' || Utils.isEmpty(value); + output += prefix + '-' + (willBeInlined ? ' ' : "\n") + this.dump(value, inline - 1, (willBeInlined ? 0 : + indent + this.indentation), exceptionOnInvalidType, objectEncoder) + (willBeInlined ? "\n" : ''); + } + } else { + for (key in input) { + value = input[key]; + willBeInlined = inline - 1 <= 0 || typeof value !== 'object' || Utils.isEmpty(value); + output += prefix + Inline.dump(key, exceptionOnInvalidType, objectEncoder) + ':' + (willBeInlined ? ' ' : + "\n") + this.dump(value, inline - 1, (willBeInlined ? 0 : indent + this.indentation), + exceptionOnInvalidType, objectEncoder) + (willBeInlined ? "\n" : ''); + } + } + } + return output; + }; + + return Dumper; + + })(); + + module.exports = Dumper; + + + }, { + "./Inline": 6, + "./Utils": 10 + }], + 2: [function(require, module, exports) { + var Escaper, Pattern; + + Pattern = require('./Pattern'); + + Escaper = (function() { + var ch; + + function Escaper() {} + + Escaper.LIST_ESCAPEES = ['\\', '\\\\', '\\"', '"', "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", + "\x07", "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", "\x10", "\x11", "\x12", "\x13", + "\x14", "\x15", "\x16", "\x17", "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", (ch = String.fromCharCode) + (0x0085), ch(0x00A0), ch(0x2028), ch(0x2029) + ]; + + Escaper.LIST_ESCAPED = ['\\\\', '\\"', '\\"', '\\"', "\\0", "\\x01", "\\x02", "\\x03", "\\x04", "\\x05", + "\\x06", "\\a", "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\x0e", "\\x0f", "\\x10", "\\x11", "\\x12", + "\\x13", "\\x14", "\\x15", "\\x16", "\\x17", "\\x18", "\\x19", "\\x1a", "\\e", "\\x1c", "\\x1d", "\\x1e", + "\\x1f", "\\N", "\\_", "\\L", "\\P" + ]; + + Escaper.MAPPING_ESCAPEES_TO_ESCAPED = (function() { + var i, j, mapping, ref; + mapping = {}; + for (i = j = 0, ref = Escaper.LIST_ESCAPEES.length; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) { + mapping[Escaper.LIST_ESCAPEES[i]] = Escaper.LIST_ESCAPED[i]; + } + return mapping; + })(); + + Escaper.PATTERN_CHARACTERS_TO_ESCAPE = new Pattern('[\\x00-\\x1f]|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9'); + + Escaper.PATTERN_MAPPING_ESCAPEES = new Pattern(Escaper.LIST_ESCAPEES.join('|').split('\\').join('\\\\')); + + Escaper.PATTERN_SINGLE_QUOTING = new Pattern('[\\s\'":{}[\\],&*#?]|^[-?|<>=!%@`]'); + + Escaper.requiresDoubleQuoting = function(value) { + return this.PATTERN_CHARACTERS_TO_ESCAPE.test(value); + }; + + Escaper.escapeWithDoubleQuotes = function(value) { + var result; + result = this.PATTERN_MAPPING_ESCAPEES.replace(value, (function(_this) { + return function(str) { + return _this.MAPPING_ESCAPEES_TO_ESCAPED[str]; + }; + })(this)); + return '"' + result + '"'; + }; + + Escaper.requiresSingleQuoting = function(value) { + return this.PATTERN_SINGLE_QUOTING.test(value); + }; + + Escaper.escapeWithSingleQuotes = function(value) { + return "'" + value.replace(/'/g, "''") + "'"; + }; + + return Escaper; + + })(); + + module.exports = Escaper; + + + }, { + "./Pattern": 8 + }], + 3: [function(require, module, exports) { + var DumpException, + extend = function(child, parent) { + for (var key in parent) { + if (hasProp.call(parent, key)) child[key] = parent[key]; + } + + function ctor() { + this.constructor = child; + } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + child.__super__ = parent.prototype; + return child; + }, + hasProp = {}.hasOwnProperty; + + DumpException = (function(superClass) { + extend(DumpException, superClass); + + function DumpException(message, parsedLine, snippet) { + DumpException.__super__.constructor.call(this, message); + this.message = message; + this.parsedLine = parsedLine; + this.snippet = snippet; + } + + DumpException.prototype.toString = function() { + if ((this.parsedLine != null) && (this.snippet != null)) { + return ' ' + this.message + ' (line ' + this.parsedLine + ': \'' + this.snippet + '\')'; + } else { + return ' ' + this.message; + } + }; + + return DumpException; + + })(Error); + + module.exports = DumpException; + + + }, {}], + 4: [function(require, module, exports) { + var ParseException, + extend = function(child, parent) { + for (var key in parent) { + if (hasProp.call(parent, key)) child[key] = parent[key]; + } + + function ctor() { + this.constructor = child; + } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + child.__super__ = parent.prototype; + return child; + }, + hasProp = {}.hasOwnProperty; - ctor.prototype = parent.prototype; - child.prototype = new ctor(); - child.__super__ = parent.prototype; - return child; - }, - hasProp = {}.hasOwnProperty; + ParseException = (function(superClass) { + extend(ParseException, superClass); - ParseException = (function (superClass) { - extend(ParseException, superClass); + function ParseException(message, parsedLine, snippet) { + ParseException.__super__.constructor.call(this, message); + this.message = message; + this.parsedLine = parsedLine; + this.snippet = snippet; + } - function ParseException(message, parsedLine, snippet) { - ParseException.__super__.constructor.call(this, message); - this.message = message; - this.parsedLine = parsedLine; - this.snippet = snippet; - } + ParseException.prototype.toString = function() { + if ((this.parsedLine != null) && (this.snippet != null)) { + return ' ' + this.message + ' (line ' + this.parsedLine + ': \'' + this.snippet + '\')'; + } else { + return ' ' + this.message; + } + }; - ParseException.prototype.toString = function () { - if ((this.parsedLine != null) && (this.snippet != null)) { - return ' ' + this.message + ' (line ' + this.parsedLine + ': \'' + this.snippet + '\')'; - } else { - return ' ' + this.message; - } - }; + return ParseException; - return ParseException; + })(Error); - })(Error); - - module.exports = ParseException; - - - }, {}], - 5: [function (require, module, exports) { - var ParseMore, - extend = function (child, parent) { - for (var key in parent) { - if (hasProp.call(parent, key)) child[key] = parent[key]; - } - - function ctor() { - this.constructor = child; - } - - ctor.prototype = parent.prototype; - child.prototype = new ctor(); - child.__super__ = parent.prototype; - return child; - }, - hasProp = {}.hasOwnProperty; - - ParseMore = (function (superClass) { - extend(ParseMore, superClass); - - function ParseMore(message, parsedLine, snippet) { - ParseMore.__super__.constructor.call(this, message); - this.message = message; - this.parsedLine = parsedLine; - this.snippet = snippet; - } - - ParseMore.prototype.toString = function () { - if ((this.parsedLine != null) && (this.snippet != null)) { - return ' ' + this.message + ' (line ' + this.parsedLine + ': \'' + this.snippet + '\')'; - } else { - return ' ' + this.message; - } - }; - - return ParseMore; - - })(Error); - - module.exports = ParseMore; - - - }, {}], - 6: [function (require, module, exports) { - var DumpException, Escaper, Inline, ParseException, ParseMore, Pattern, Unescaper, Utils, - indexOf = [].indexOf || function (item) { - for (var i = 0, l = this.length; i < l; i++) { - if (i in this && this[i] === item) return i; - } - return -1; - }; - - Pattern = require('./Pattern'); - - Unescaper = require('./Unescaper'); - - Escaper = require('./Escaper'); - - Utils = require('./Utils'); - - ParseException = require('./Exception/ParseException'); - - ParseMore = require('./Exception/ParseMore'); - - DumpException = require('./Exception/DumpException'); - - Inline = (function () { - function Inline() { - } - - Inline.REGEX_QUOTED_STRING = '(?:"(?:[^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'(?:[^\']*(?:\'\'[^\']*)*)\')'; - - Inline.PATTERN_TRAILING_COMMENTS = new Pattern('^\\s*#.*$'); - - Inline.PATTERN_QUOTED_SCALAR = new Pattern('^' + Inline.REGEX_QUOTED_STRING); - - Inline.PATTERN_THOUSAND_NUMERIC_SCALAR = new Pattern('^(-|\\+)?[0-9,]+(\\.[0-9]+)?$'); - - Inline.PATTERN_SCALAR_BY_DELIMITERS = {}; - - Inline.settings = {}; - - Inline.configure = function (exceptionOnInvalidType, objectDecoder) { - if (exceptionOnInvalidType == null) { - exceptionOnInvalidType = null; - } - if (objectDecoder == null) { - objectDecoder = null; - } - this.settings.exceptionOnInvalidType = exceptionOnInvalidType; - this.settings.objectDecoder = objectDecoder; - }; - - Inline.parse = function (value, exceptionOnInvalidType, objectDecoder) { - var context, result; - if (exceptionOnInvalidType == null) { - exceptionOnInvalidType = false; - } - if (objectDecoder == null) { - objectDecoder = null; - } - this.settings.exceptionOnInvalidType = exceptionOnInvalidType; - this.settings.objectDecoder = objectDecoder; - if (value == null) { - return ''; - } - value = Utils.trim(value); - if (0 === value.length) { - return ''; - } - context = { - exceptionOnInvalidType: exceptionOnInvalidType, - objectDecoder: objectDecoder, - i: 0 - }; - switch (value.charAt(0)) { - case '[': - result = this.parseSequence(value, context); - ++context.i; - break; - case '{': - result = this.parseMapping(value, context); - ++context.i; - break; - default: - result = this.parseScalar(value, null, ['"', "'"], context); - } - if (this.PATTERN_TRAILING_COMMENTS.replace(value.slice(context.i), '') !== '') { - throw new ParseException('Unexpected characters near "' + value.slice(context.i) + '".'); - } - return result; - }; - - Inline.dump = function (value, exceptionOnInvalidType, objectEncoder) { - var ref, result, type; - if (exceptionOnInvalidType == null) { - exceptionOnInvalidType = false; - } - if (objectEncoder == null) { - objectEncoder = null; - } - if (value == null) { - return 'null'; - } - type = typeof value; - if (type === 'object') { - if (value instanceof Date) { - return value.toISOString(); - } else if (objectEncoder != null) { - result = objectEncoder(value); - if (typeof result === 'string' || (result != null)) { - return result; - } - } - return this.dumpObject(value); - } - if (type === 'boolean') { - return (value ? 'true' : 'false'); - } - if (Utils.isDigits(value)) { - return (type === 'string' ? "'" + value + "'" : String(parseInt(value))); - } - if (Utils.isNumeric(value)) { - return (type === 'string' ? "'" + value + "'" : String(parseFloat(value))); - } - if (type === 'number') { - return (value === Infinity ? '.Inf' : (value === -Infinity ? '-.Inf' : (isNaN(value) ? '.NaN' : value))); - } - if (Escaper.requiresDoubleQuoting(value)) { - return Escaper.escapeWithDoubleQuotes(value); - } - if (Escaper.requiresSingleQuoting(value)) { - return Escaper.escapeWithSingleQuotes(value); - } - if ('' === value) { - return '""'; - } - if (Utils.PATTERN_DATE.test(value)) { - return "'" + value + "'"; - } - if ((ref = value.toLowerCase()) === 'null' || ref === '~' || ref === 'true' || ref === 'false') { - return "'" + value + "'"; - } - return value; - }; - - Inline.dumpObject = function (value, exceptionOnInvalidType, objectSupport) { - var j, key, len1, output, val; - if (objectSupport == null) { - objectSupport = null; - } - if (value instanceof Array) { - output = []; - for (j = 0, len1 = value.length; j < len1; j++) { - val = value[j]; - output.push(this.dump(val)); - } - return '[' + output.join(', ') + ']'; - } else { - output = []; - for (key in value) { - val = value[key]; - output.push(this.dump(key) + ': ' + this.dump(val)); - } - return '{' + output.join(', ') + '}'; - } - }; - - Inline.parseScalar = function (scalar, delimiters, stringDelimiters, context, evaluate) { - var i, joinedDelimiters, match, output, pattern, ref, ref1, strpos, tmp; - if (delimiters == null) { - delimiters = null; - } - if (stringDelimiters == null) { - stringDelimiters = ['"', "'"]; - } - if (context == null) { - context = null; - } - if (evaluate == null) { - evaluate = true; - } - if (context == null) { - context = { - exceptionOnInvalidType: this.settings.exceptionOnInvalidType, - objectDecoder: this.settings.objectDecoder, - i: 0 - }; - } - i = context.i; - if (ref = scalar.charAt(i), indexOf.call(stringDelimiters, ref) >= 0) { - output = this.parseQuotedScalar(scalar, context); - i = context.i; - if (delimiters != null) { - tmp = Utils.ltrim(scalar.slice(i), ' '); - if (!(ref1 = tmp.charAt(0), indexOf.call(delimiters, ref1) >= 0)) { - throw new ParseException('Unexpected characters (' + scalar.slice(i) + ').'); - } - } - } else { - if (!delimiters) { - output = scalar.slice(i); - i += output.length; - strpos = output.indexOf(' #'); - if (strpos !== -1) { - output = Utils.rtrim(output.slice(0, strpos)); - } - } else { - joinedDelimiters = delimiters.join('|'); - pattern = this.PATTERN_SCALAR_BY_DELIMITERS[joinedDelimiters]; - if (pattern == null) { - pattern = new Pattern('^(.+?)(' + joinedDelimiters + ')'); - this.PATTERN_SCALAR_BY_DELIMITERS[joinedDelimiters] = pattern; - } - if (match = pattern.exec(scalar.slice(i))) { - output = match[1]; - i += output.length; - } else { - throw new ParseException('Malformed inline YAML string (' + scalar + ').'); - } - } - if (evaluate) { - output = this.evaluateScalar(output, context); - } - } - context.i = i; - return output; - }; - - Inline.parseQuotedScalar = function (scalar, context) { - var i, match, output; - i = context.i; - if (!(match = this.PATTERN_QUOTED_SCALAR.exec(scalar.slice(i)))) { - throw new ParseMore('Malformed inline YAML string (' + scalar.slice(i) + ').'); - } - output = match[0].substr(1, match[0].length - 2); - if ('"' === scalar.charAt(i)) { - output = Unescaper.unescapeDoubleQuotedString(output); - } else { - output = Unescaper.unescapeSingleQuotedString(output); - } - i += match[0].length; - context.i = i; - return output; - }; - - Inline.parseSequence = function (sequence, context) { - var e, error, i, isQuoted, len, output, ref, value; - output = []; - len = sequence.length; - i = context.i; - i += 1; - while (i < len) { - context.i = i; - switch (sequence.charAt(i)) { - case '[': - output.push(this.parseSequence(sequence, context)); - i = context.i; - break; - case '{': - output.push(this.parseMapping(sequence, context)); - i = context.i; - break; - case ']': - return output; - case ',': - case ' ': - case "\n": - break; - default: - isQuoted = ((ref = sequence.charAt(i)) === '"' || ref === "'"); - value = this.parseScalar(sequence, [',', ']'], ['"', "'"], context); - i = context.i; - if (!isQuoted && typeof value === 'string' && (value.indexOf(': ') !== -1 || value.indexOf(":\n") !== -1)) { - try { - value = this.parseMapping('{' + value + '}'); - } catch (error) { - e = error; - } - } - output.push(value); - --i; - } - ++i; - } - throw new ParseMore('Malformed inline YAML string ' + sequence); - }; - - Inline.parseMapping = function (mapping, context) { - var done, i, key, len, output, shouldContinueWhileLoop, value; - output = {}; - len = mapping.length; - i = context.i; - i += 1; - shouldContinueWhileLoop = false; - while (i < len) { - context.i = i; - switch (mapping.charAt(i)) { - case ' ': - case ',': - case "\n": - ++i; - context.i = i; - shouldContinueWhileLoop = true; - break; - case '}': - return output; - } - if (shouldContinueWhileLoop) { - shouldContinueWhileLoop = false; - continue; - } - key = this.parseScalar(mapping, [':', ' ', "\n"], ['"', "'"], context, false); - i = context.i; - done = false; - while (i < len) { - context.i = i; - switch (mapping.charAt(i)) { - case '[': - value = this.parseSequence(mapping, context); - i = context.i; - if (output[key] === void 0) { - output[key] = value; - } - done = true; - break; - case '{': - value = this.parseMapping(mapping, context); - i = context.i; - if (output[key] === void 0) { - output[key] = value; - } - done = true; - break; - case ':': - case ' ': - case "\n": - break; - default: - value = this.parseScalar(mapping, [',', '}'], ['"', "'"], context); - i = context.i; - if (output[key] === void 0) { - output[key] = value; - } - done = true; - --i; - } - ++i; - if (done) { - break; - } - } - } - throw new ParseMore('Malformed inline YAML string ' + mapping); - }; - - Inline.evaluateScalar = function (scalar, context) { - var cast, date, exceptionOnInvalidType, firstChar, firstSpace, firstWord, objectDecoder, raw, - scalarLower, - subValue, trimmedScalar; - scalar = Utils.trim(scalar); - scalarLower = scalar.toLowerCase(); - switch (scalarLower) { - case 'null': - case '': - case '~': - return null; - case 'true': - return true; - case 'false': - return false; - case '.inf': - return Infinity; - case '.nan': - return NaN; - case '-.inf': - return Infinity; - default: - firstChar = scalarLower.charAt(0); - switch (firstChar) { - case '!': - firstSpace = scalar.indexOf(' '); - if (firstSpace === -1) { - firstWord = scalarLower; - } else { - firstWord = scalarLower.slice(0, firstSpace); - } - switch (firstWord) { - case '!': - if (firstSpace !== -1) { - return parseInt(this.parseScalar(scalar.slice(2))); - } - return null; - case '!str': - return Utils.ltrim(scalar.slice(4)); - case '!!str': - return Utils.ltrim(scalar.slice(5)); - case '!!int': - return parseInt(this.parseScalar(scalar.slice(5))); - case '!!bool': - return Utils.parseBoolean(this.parseScalar(scalar.slice(6)), false); - case '!!float': - return parseFloat(this.parseScalar(scalar.slice(7))); - case '!!timestamp': - return Utils.stringToDate(Utils.ltrim(scalar.slice(11))); - default: - if (context == null) { - context = { - exceptionOnInvalidType: this.settings.exceptionOnInvalidType, - objectDecoder: this.settings.objectDecoder, - i: 0 - }; - } - objectDecoder = context.objectDecoder, exceptionOnInvalidType = context.exceptionOnInvalidType; - if (objectDecoder) { - trimmedScalar = Utils.rtrim(scalar); - firstSpace = trimmedScalar.indexOf(' '); - if (firstSpace === -1) { - return objectDecoder(trimmedScalar, null); - } else { - subValue = Utils.ltrim(trimmedScalar.slice(firstSpace + 1)); - if (!(subValue.length > 0)) { - subValue = null; - } - return objectDecoder(trimmedScalar.slice(0, firstSpace), subValue); - } - } - if (exceptionOnInvalidType) { - throw new ParseException('Custom object support when parsing a YAML file has been disabled.'); - } - return null; - } - break; - case '0': - if ('0x' === scalar.slice(0, 2)) { - return Utils.hexDec(scalar); - } else if (Utils.isDigits(scalar)) { - return Utils.octDec(scalar); - } else if (Utils.isNumeric(scalar)) { - return parseFloat(scalar); - } else { - return scalar; - } - break; - case '+': - if (Utils.isDigits(scalar)) { - raw = scalar; - cast = parseInt(raw); - if (raw === String(cast)) { - return cast; - } else { - return raw; - } - } else if (Utils.isNumeric(scalar)) { - return parseFloat(scalar); - } else if (this.PATTERN_THOUSAND_NUMERIC_SCALAR.test(scalar)) { - return parseFloat(scalar.replace(',', '')); - } - return scalar; - case '-': - if (Utils.isDigits(scalar.slice(1))) { - if ('0' === scalar.charAt(1)) { - return -Utils.octDec(scalar.slice(1)); - } else { - raw = scalar.slice(1); - cast = parseInt(raw); - if (raw === String(cast)) { - return -cast; - } else { - return -raw; - } - } - } else if (Utils.isNumeric(scalar)) { - return parseFloat(scalar); - } else if (this.PATTERN_THOUSAND_NUMERIC_SCALAR.test(scalar)) { - return parseFloat(scalar.replace(',', '')); - } - return scalar; - default: - if (date = Utils.stringToDate(scalar)) { - return date; - } else if (Utils.isNumeric(scalar)) { - return parseFloat(scalar); - } else if (this.PATTERN_THOUSAND_NUMERIC_SCALAR.test(scalar)) { - return parseFloat(scalar.replace(',', '')); - } - return scalar; - } - } - }; - - return Inline; - - })(); - - module.exports = Inline; - - - }, { - "./Escaper": 2, - "./Exception/DumpException": 3, - "./Exception/ParseException": 4, - "./Exception/ParseMore": 5, - "./Pattern": 8, - "./Unescaper": 9, - "./Utils": 10 - }], - 7: [function (require, module, exports) { - var Inline, ParseException, ParseMore, Parser, Pattern, Utils; - - Inline = require('./Inline'); - - Pattern = require('./Pattern'); - - Utils = require('./Utils'); - - ParseException = require('./Exception/ParseException'); - - ParseMore = require('./Exception/ParseMore'); - - Parser = (function () { - Parser.prototype.PATTERN_FOLDED_SCALAR_ALL = new Pattern( - '^(?:(?![^\\|>]*)\\s+)?(?\\||>)(?\\+|\\-|\\d+|\\+\\d+|\\-\\d+|\\d+\\+|\\d+\\-)?(? +#.*)?$' - ); - - Parser.prototype.PATTERN_FOLDED_SCALAR_END = new Pattern( - '(?\\||>)(?\\+|\\-|\\d+|\\+\\d+|\\-\\d+|\\d+\\+|\\d+\\-)?(? +#.*)?$'); - - Parser.prototype.PATTERN_SEQUENCE_ITEM = new Pattern('^\\-((?\\s+)(?.+?))?\\s*$'); - - Parser.prototype.PATTERN_ANCHOR_VALUE = new Pattern('^&(?[^ ]+) *(?.*)'); - - Parser.prototype.PATTERN_COMPACT_NOTATION = new Pattern('^(?' + Inline.REGEX_QUOTED_STRING + - '|[^ \'"\\{\\[].*?) *\\:(\\s+(?.+?))?\\s*$'); - - Parser.prototype.PATTERN_MAPPING_ITEM = new Pattern('^(?' + Inline.REGEX_QUOTED_STRING + - '|[^ \'"\\[\\{].*?) *\\:(\\s+(?.+?))?\\s*$'); - - Parser.prototype.PATTERN_DECIMAL = new Pattern('\\d+'); - - Parser.prototype.PATTERN_INDENT_SPACES = new Pattern('^ +'); - - Parser.prototype.PATTERN_TRAILING_LINES = new Pattern('(\n*)$'); - - Parser.prototype.PATTERN_YAML_HEADER = new Pattern('^\\%YAML[: ][\\d\\.]+.*\n', 'm'); - - Parser.prototype.PATTERN_LEADING_COMMENTS = new Pattern('^(\\#.*?\n)+', 'm'); - - Parser.prototype.PATTERN_DOCUMENT_MARKER_START = new Pattern('^\\-\\-\\-.*?\n', 'm'); - - Parser.prototype.PATTERN_DOCUMENT_MARKER_END = new Pattern('^\\.\\.\\.\\s*$', 'm'); - - Parser.prototype.PATTERN_FOLDED_SCALAR_BY_INDENTATION = {}; - - Parser.prototype.CONTEXT_NONE = 0; - - Parser.prototype.CONTEXT_SEQUENCE = 1; - - Parser.prototype.CONTEXT_MAPPING = 2; - - function Parser(offset) { - this.offset = offset != null ? offset : 0; - this.lines = []; - this.currentLineNb = -1; - this.currentLine = ''; - this.refs = {}; - } - - Parser.prototype.parse = function (value, exceptionOnInvalidType, objectDecoder) { - var alias, allowOverwrite, block, c, context, data, e, error, error1, error2, first, i, indent, isRef, - j, k, - key, l, lastKey, len, len1, len2, len3, lineCount, m, matches, mergeNode, n, name, parsed, - parsedItem, - parser, ref, ref1, ref2, refName, refValue, val, values; - if (exceptionOnInvalidType == null) { - exceptionOnInvalidType = false; - } - if (objectDecoder == null) { - objectDecoder = null; - } - this.currentLineNb = -1; - this.currentLine = ''; - this.lines = this.cleanup(value).split("\n"); - data = null; - context = this.CONTEXT_NONE; - allowOverwrite = false; - while (this.moveToNextLine()) { - if (this.isCurrentLineEmpty()) { - continue; - } - if ("\t" === this.currentLine[0]) { - throw new ParseException('A YAML file cannot contain tabs as indentation.', this.getRealCurrentLineNb() + 1, - this.currentLine); - } - isRef = mergeNode = false; - if (values = this.PATTERN_SEQUENCE_ITEM.exec(this.currentLine)) { - if (this.CONTEXT_MAPPING === context) { - throw new ParseException('You cannot define a sequence item when in a mapping'); - } - context = this.CONTEXT_SEQUENCE; - if (data == null) { - data = []; - } - if ((values.value != null) && (matches = this.PATTERN_ANCHOR_VALUE.exec(values.value))) { - isRef = matches.ref; - values.value = matches.value; - } - if (!(values.value != null) || '' === Utils.trim(values.value, ' ') || Utils.ltrim(values.value, ' ').indexOf( - '#') === 0) { - if (this.currentLineNb < this.lines.length - 1 && !this.isNextLineUnIndentedCollection()) { - c = this.getRealCurrentLineNb() + 1; - parser = new Parser(c); - parser.refs = this.refs; - data.push(parser.parse(this.getNextEmbedBlock(null, true), exceptionOnInvalidType, objectDecoder)); - } else { - data.push(null); - } - } else { - if (((ref = values.leadspaces) != null ? ref.length : void 0) && (matches = this.PATTERN_COMPACT_NOTATION.exec( - values.value))) { - c = this.getRealCurrentLineNb(); - parser = new Parser(c); - parser.refs = this.refs; - block = values.value; - indent = this.getCurrentLineIndentation(); - if (this.isNextLineIndented(false)) { - block += "\n" + this.getNextEmbedBlock(indent + values.leadspaces.length + 1, true); - } - data.push(parser.parse(block, exceptionOnInvalidType, objectDecoder)); - } else { - data.push(this.parseValue(values.value, exceptionOnInvalidType, objectDecoder)); - } - } - } else if ((values = this.PATTERN_MAPPING_ITEM.exec(this.currentLine)) && values.key.indexOf(' #') === -1) { - if (this.CONTEXT_SEQUENCE === context) { - throw new ParseException('You cannot define a mapping item when in a sequence'); - } - context = this.CONTEXT_MAPPING; - if (data == null) { - data = {}; - } - Inline.configure(exceptionOnInvalidType, objectDecoder); - try { - key = Inline.parseScalar(values.key); - } catch (error) { - e = error; - e.parsedLine = this.getRealCurrentLineNb() + 1; - e.snippet = this.currentLine; - throw e; - } - if ('<<' === key) { - mergeNode = true; - allowOverwrite = true; - if (((ref1 = values.value) != null ? ref1.indexOf('*') : void 0) === 0) { - refName = values.value.slice(1); - if (this.refs[refName] == null) { - throw new ParseException('Reference "' + refName + '" does not exist.', this.getRealCurrentLineNb() + 1, - this.currentLine); - } - refValue = this.refs[refName]; - if (typeof refValue !== 'object') { - throw new ParseException('YAML merge keys used with a scalar value instead of an object.', this.getRealCurrentLineNb() + - 1, this.currentLine); - } - if (refValue instanceof Array) { - for (i = j = 0, len = refValue.length; j < len; i = ++j) { - value = refValue[i]; - if (data[name = String(i)] == null) { - data[name] = value; - } - } - } else { - for (key in refValue) { - value = refValue[key]; - if (data[key] == null) { - data[key] = value; - } - } - } - } else { - if ((values.value != null) && values.value !== '') { - value = values.value; - } else { - value = this.getNextEmbedBlock(); - } - c = this.getRealCurrentLineNb() + 1; - parser = new Parser(c); - parser.refs = this.refs; - parsed = parser.parse(value, exceptionOnInvalidType); - if (typeof parsed !== 'object') { - throw new ParseException('YAML merge keys used with a scalar value instead of an object.', this.getRealCurrentLineNb() + - 1, this.currentLine); - } - if (parsed instanceof Array) { - for (l = 0, len1 = parsed.length; l < len1; l++) { - parsedItem = parsed[l]; - if (typeof parsedItem !== 'object') { - throw new ParseException('Merge items must be objects.', this.getRealCurrentLineNb() + 1, parsedItem); - } - if (parsedItem instanceof Array) { - for (i = m = 0, len2 = parsedItem.length; m < len2; i = ++m) { - value = parsedItem[i]; - k = String(i); - if (!data.hasOwnProperty(k)) { - data[k] = value; - } - } - } else { - for (key in parsedItem) { - value = parsedItem[key]; - if (!data.hasOwnProperty(key)) { - data[key] = value; - } - } - } - } - } else { - for (key in parsed) { - value = parsed[key]; - if (!data.hasOwnProperty(key)) { - data[key] = value; - } - } - } - } - } else if ((values.value != null) && (matches = this.PATTERN_ANCHOR_VALUE.exec(values.value))) { - isRef = matches.ref; - values.value = matches.value; - } - if (mergeNode) { - - } else if (!(values.value != null) || '' === Utils.trim(values.value, ' ') || Utils.ltrim(values.value, ' ') - .indexOf('#') === 0) { - if (!(this.isNextLineIndented()) && !(this.isNextLineUnIndentedCollection())) { - if (allowOverwrite || data[key] === void 0) { - data[key] = null; - } - } else { - c = this.getRealCurrentLineNb() + 1; - parser = new Parser(c); - parser.refs = this.refs; - val = parser.parse(this.getNextEmbedBlock(), exceptionOnInvalidType, objectDecoder); - if (allowOverwrite || data[key] === void 0) { - data[key] = val; - } - } - } else { - val = this.parseValue(values.value, exceptionOnInvalidType, objectDecoder); - if (allowOverwrite || data[key] === void 0) { - data[key] = val; - } - } - } else { - lineCount = this.lines.length; - if (1 === lineCount || (2 === lineCount && Utils.isEmpty(this.lines[1]))) { - try { - value = Inline.parse(this.lines[0], exceptionOnInvalidType, objectDecoder); - } catch (error1) { - e = error1; - e.parsedLine = this.getRealCurrentLineNb() + 1; - e.snippet = this.currentLine; - throw e; - } - if (typeof value === 'object') { - if (value instanceof Array) { - first = value[0]; - } else { - for (key in value) { - first = value[key]; - break; - } - } - if (typeof first === 'string' && first.indexOf('*') === 0) { - data = []; - for (n = 0, len3 = value.length; n < len3; n++) { - alias = value[n]; - data.push(this.refs[alias.slice(1)]); - } - value = data; - } - } - return value; - } else if ((ref2 = Utils.ltrim(value).charAt(0)) === '[' || ref2 === '{') { - try { - return Inline.parse(value, exceptionOnInvalidType, objectDecoder); - } catch (error2) { - e = error2; - e.parsedLine = this.getRealCurrentLineNb() + 1; - e.snippet = this.currentLine; - throw e; - } - } - throw new ParseException('Unable to parse.', this.getRealCurrentLineNb() + 1, this.currentLine); - } - if (isRef) { - if (data instanceof Array) { - this.refs[isRef] = data[data.length - 1]; - } else { - lastKey = null; - for (key in data) { - lastKey = key; - } - this.refs[isRef] = data[lastKey]; - } - } - } - if (Utils.isEmpty(data)) { - return null; - } else { - return data; - } - }; - - Parser.prototype.getRealCurrentLineNb = function () { - return this.currentLineNb + this.offset; - }; - - Parser.prototype.getCurrentLineIndentation = function () { - return this.currentLine.length - Utils.ltrim(this.currentLine, ' ').length; - }; - - Parser.prototype.getNextEmbedBlock = function (indentation, includeUnindentedCollection) { - var data, indent, isItUnindentedCollection, newIndent, removeComments, removeCommentsPattern, - unindentedEmbedBlock; - if (indentation == null) { - indentation = null; - } - if (includeUnindentedCollection == null) { - includeUnindentedCollection = false; - } - this.moveToNextLine(); - if (indentation == null) { - newIndent = this.getCurrentLineIndentation(); - unindentedEmbedBlock = this.isStringUnIndentedCollectionItem(this.currentLine); - if (!(this.isCurrentLineEmpty()) && 0 === newIndent && !unindentedEmbedBlock) { - throw new ParseException('Indentation problem.', this.getRealCurrentLineNb() + 1, this.currentLine); - } - } else { - newIndent = indentation; - } - data = [this.currentLine.slice(newIndent)]; - if (!includeUnindentedCollection) { - isItUnindentedCollection = this.isStringUnIndentedCollectionItem(this.currentLine); - } - removeCommentsPattern = this.PATTERN_FOLDED_SCALAR_END; - removeComments = !removeCommentsPattern.test(this.currentLine); - while (this.moveToNextLine()) { - indent = this.getCurrentLineIndentation(); - if (indent === newIndent) { - removeComments = !removeCommentsPattern.test(this.currentLine); - } - if (removeComments && this.isCurrentLineComment()) { - continue; - } - if (this.isCurrentLineBlank()) { - data.push(this.currentLine.slice(newIndent)); - continue; - } - if (isItUnindentedCollection && !this.isStringUnIndentedCollectionItem(this.currentLine) && indent === - newIndent) { - this.moveToPreviousLine(); - break; - } - if (indent >= newIndent) { - data.push(this.currentLine.slice(newIndent)); - } else if (Utils.ltrim(this.currentLine).charAt(0) === '#') { - - } else if (0 === indent) { - this.moveToPreviousLine(); - break; - } else { - throw new ParseException('Indentation problem.', this.getRealCurrentLineNb() + 1, this.currentLine); - } - } - return data.join("\n"); - }; - - Parser.prototype.moveToNextLine = function () { - if (this.currentLineNb >= this.lines.length - 1) { - return false; - } - this.currentLine = this.lines[++this.currentLineNb]; - return true; - }; - - Parser.prototype.moveToPreviousLine = function () { - this.currentLine = this.lines[--this.currentLineNb]; - }; - - Parser.prototype.parseValue = function (value, exceptionOnInvalidType, objectDecoder) { - var e, error, foldedIndent, matches, modifiers, pos, ref, ref1, val; - if (0 === value.indexOf('*')) { - pos = value.indexOf('#'); - if (pos !== -1) { - value = value.substr(1, pos - 2); - } else { - value = value.slice(1); - } - if (this.refs[value] === void 0) { - throw new ParseException('Reference "' + value + '" does not exist.', this.currentLine); - } - return this.refs[value]; - } - if (matches = this.PATTERN_FOLDED_SCALAR_ALL.exec(value)) { - modifiers = (ref = matches.modifiers) != null ? ref : ''; - foldedIndent = Math.abs(parseInt(modifiers)); - if (isNaN(foldedIndent)) { - foldedIndent = 0; - } - val = this.parseFoldedScalar(matches.separator, this.PATTERN_DECIMAL.replace(modifiers, ''), foldedIndent); - if (matches.type != null) { - Inline.configure(exceptionOnInvalidType, objectDecoder); - return Inline.parseScalar(matches.type + ' ' + val); - } else { - return val; - } - } - if ((ref1 = value.charAt(0)) === '[' || ref1 === '{' || ref1 === '"' || ref1 === "'") { - while (true) { - try { - return Inline.parse(value, exceptionOnInvalidType, objectDecoder); - } catch (error) { - e = error; - if (e instanceof ParseMore && this.moveToNextLine()) { - value += "\n" + Utils.trim(this.currentLine, ' '); - } else { - e.parsedLine = this.getRealCurrentLineNb() + 1; - e.snippet = this.currentLine; - throw e; - } - } - } - } else { - if (this.isNextLineIndented()) { - value += "\n" + this.getNextEmbedBlock(); - } - return Inline.parse(value, exceptionOnInvalidType, objectDecoder); - } - }; - - Parser.prototype.parseFoldedScalar = function (separator, indicator, indentation) { - var isCurrentLineBlank, j, len, line, matches, newText, notEOF, pattern, ref, text; - if (indicator == null) { - indicator = ''; - } - if (indentation == null) { - indentation = 0; - } - notEOF = this.moveToNextLine(); - if (!notEOF) { - return ''; - } - isCurrentLineBlank = this.isCurrentLineBlank(); - text = ''; - while (notEOF && isCurrentLineBlank) { - if (notEOF = this.moveToNextLine()) { - text += "\n"; - isCurrentLineBlank = this.isCurrentLineBlank(); - } - } - if (0 === indentation) { - if (matches = this.PATTERN_INDENT_SPACES.exec(this.currentLine)) { - indentation = matches[0].length; - } - } - if (indentation > 0) { - pattern = this.PATTERN_FOLDED_SCALAR_BY_INDENTATION[indentation]; - if (pattern == null) { - pattern = new Pattern('^ {' + indentation + '}(.*)$'); - Parser.prototype.PATTERN_FOLDED_SCALAR_BY_INDENTATION[indentation] = pattern; - } - while (notEOF && (isCurrentLineBlank || (matches = pattern.exec(this.currentLine)))) { - if (isCurrentLineBlank) { - text += this.currentLine.slice(indentation); - } else { - text += matches[1]; - } - if (notEOF = this.moveToNextLine()) { - text += "\n"; - isCurrentLineBlank = this.isCurrentLineBlank(); - } - } - } else if (notEOF) { - text += "\n"; - } - if (notEOF) { - this.moveToPreviousLine(); - } - if ('>' === separator) { - newText = ''; - ref = text.split("\n"); - for (j = 0, len = ref.length; j < len; j++) { - line = ref[j]; - if (line.length === 0 || line.charAt(0) === ' ') { - newText = Utils.rtrim(newText, ' ') + line + "\n"; - } else { - newText += line + ' '; - } - } - text = newText; - } - if ('+' !== indicator) { - text = Utils.rtrim(text); - } - if ('' === indicator) { - text = this.PATTERN_TRAILING_LINES.replace(text, "\n"); - } else if ('-' === indicator) { - text = this.PATTERN_TRAILING_LINES.replace(text, ''); - } - return text; - }; - - Parser.prototype.isNextLineIndented = function (ignoreComments) { - var EOF, currentIndentation, ret; - if (ignoreComments == null) { - ignoreComments = true; - } - currentIndentation = this.getCurrentLineIndentation(); - EOF = !this.moveToNextLine(); - if (ignoreComments) { - while (!EOF && this.isCurrentLineEmpty()) { - EOF = !this.moveToNextLine(); - } - } else { - while (!EOF && this.isCurrentLineBlank()) { - EOF = !this.moveToNextLine(); - } - } - if (EOF) { - return false; - } - ret = false; - if (this.getCurrentLineIndentation() > currentIndentation) { - ret = true; - } - this.moveToPreviousLine(); - return ret; - }; - - Parser.prototype.isCurrentLineEmpty = function () { - var trimmedLine; - trimmedLine = Utils.trim(this.currentLine, ' '); - return trimmedLine.length === 0 || trimmedLine.charAt(0) === '#'; - }; - - Parser.prototype.isCurrentLineBlank = function () { - return '' === Utils.trim(this.currentLine, ' '); - }; - - Parser.prototype.isCurrentLineComment = function () { - var ltrimmedLine; - ltrimmedLine = Utils.ltrim(this.currentLine, ' '); - return ltrimmedLine.charAt(0) === '#'; - }; - - Parser.prototype.cleanup = function (value) { - var count, i, indent, j, l, len, len1, line, lines, ref, ref1, ref2, smallestIndent, trimmedValue; - if (value.indexOf("\r") !== -1) { - value = value.split("\r\n").join("\n").split("\r").join("\n"); - } - count = 0; - ref = this.PATTERN_YAML_HEADER.replaceAll(value, ''), value = ref[0], count = ref[1]; - this.offset += count; - ref1 = this.PATTERN_LEADING_COMMENTS.replaceAll(value, '', 1), trimmedValue = ref1[0], count = ref1[1]; - if (count === 1) { - this.offset += Utils.subStrCount(value, "\n") - Utils.subStrCount(trimmedValue, "\n"); - value = trimmedValue; - } - ref2 = this.PATTERN_DOCUMENT_MARKER_START.replaceAll(value, '', 1), trimmedValue = ref2[0], count = ref2[1]; - if (count === 1) { - this.offset += Utils.subStrCount(value, "\n") - Utils.subStrCount(trimmedValue, "\n"); - value = trimmedValue; - value = this.PATTERN_DOCUMENT_MARKER_END.replace(value, ''); - } - lines = value.split("\n"); - smallestIndent = -1; - for (j = 0, len = lines.length; j < len; j++) { - line = lines[j]; - if (Utils.trim(line, ' ').length === 0) { - continue; - } - indent = line.length - Utils.ltrim(line).length; - if (smallestIndent === -1 || indent < smallestIndent) { - smallestIndent = indent; - } - } - if (smallestIndent > 0) { - for (i = l = 0, len1 = lines.length; l < len1; i = ++l) { - line = lines[i]; - lines[i] = line.slice(smallestIndent); - } - value = lines.join("\n"); - } - return value; - }; - - Parser.prototype.isNextLineUnIndentedCollection = function (currentIndentation) { - var notEOF, ret; - if (currentIndentation == null) { - currentIndentation = null; - } - if (currentIndentation == null) { - currentIndentation = this.getCurrentLineIndentation(); - } - notEOF = this.moveToNextLine(); - while (notEOF && this.isCurrentLineEmpty()) { - notEOF = this.moveToNextLine(); - } - if (false === notEOF) { - return false; - } - ret = false; - if (this.getCurrentLineIndentation() === currentIndentation && this.isStringUnIndentedCollectionItem(this.currentLine)) { - ret = true; - } - this.moveToPreviousLine(); - return ret; - }; - - Parser.prototype.isStringUnIndentedCollectionItem = function () { - return this.currentLine === '-' || this.currentLine.slice(0, 2) === '- '; - }; - - return Parser; - - })(); - - module.exports = Parser; - - - }, { - "./Exception/ParseException": 4, - "./Exception/ParseMore": 5, - "./Inline": 6, - "./Pattern": 8, - "./Utils": 10 - }], - 8: [function (require, module, exports) { - var Pattern; - - Pattern = (function () { - Pattern.prototype.regex = null; - - Pattern.prototype.rawRegex = null; - - Pattern.prototype.cleanedRegex = null; - - Pattern.prototype.mapping = null; - - function Pattern(rawRegex, modifiers) { - var _char, capturingBracketNumber, cleanedRegex, i, len, mapping, name, part, subChar; - if (modifiers == null) { - modifiers = ''; - } - cleanedRegex = ''; - len = rawRegex.length; - mapping = null; - capturingBracketNumber = 0; - i = 0; - while (i < len) { - _char = rawRegex.charAt(i); - if (_char === '\\') { - cleanedRegex += rawRegex.slice(i, +(i + 1) + 1 || 9e9); - i++; - } else if (_char === '(') { - if (i < len - 2) { - part = rawRegex.slice(i, +(i + 2) + 1 || 9e9); - if (part === '(?:') { - i += 2; - cleanedRegex += part; - } else if (part === '(?<') { - capturingBracketNumber++; - i += 2; - name = ''; - while (i + 1 < len) { - subChar = rawRegex.charAt(i + 1); - if (subChar === '>') { - cleanedRegex += '('; - i++; - if (name.length > 0) { - if (mapping == null) { - mapping = {}; - } - mapping[name] = capturingBracketNumber; - } - break; - } else { - name += subChar; - } - i++; - } - } else { - cleanedRegex += _char; - capturingBracketNumber++; - } - } else { - cleanedRegex += _char; - } - } else { - cleanedRegex += _char; - } - i++; - } - this.rawRegex = rawRegex; - this.cleanedRegex = cleanedRegex; - this.regex = new RegExp(this.cleanedRegex, 'g' + modifiers.replace('g', '')); - this.mapping = mapping; - } - - Pattern.prototype.exec = function (str) { - var index, matches, name, ref; - this.regex.lastIndex = 0; - matches = this.regex.exec(str); - if (matches == null) { - return null; - } - if (this.mapping != null) { - ref = this.mapping; - for (name in ref) { - index = ref[name]; - matches[name] = matches[index]; - } - } - return matches; - }; - - Pattern.prototype.test = function (str) { - this.regex.lastIndex = 0; - return this.regex.test(str); - }; - - Pattern.prototype.replace = function (str, replacement) { - this.regex.lastIndex = 0; - return str.replace(this.regex, replacement); - }; - - Pattern.prototype.replaceAll = function (str, replacement, limit) { - var count; - if (limit == null) { - limit = 0; - } - this.regex.lastIndex = 0; - count = 0; - while (this.regex.test(str) && (limit === 0 || count < limit)) { - this.regex.lastIndex = 0; - str = str.replace(this.regex, replacement); - count++; - } - return [str, count]; - }; - - return Pattern; - - })(); - - module.exports = Pattern; - - - }, {}], - 9: [function (require, module, exports) { - var Pattern, Unescaper, Utils; - - Utils = require('./Utils'); - - Pattern = require('./Pattern'); - - Unescaper = (function () { - function Unescaper() { - } - - Unescaper.PATTERN_ESCAPED_CHARACTER = new Pattern( - '\\\\([0abt\tnvfre "\\/\\\\N_LP]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})'); - - Unescaper.unescapeSingleQuotedString = function (value) { - return value.replace(/\'\'/g, '\''); - }; - - Unescaper.unescapeDoubleQuotedString = function (value) { - if (this._unescapeCallback == null) { - this._unescapeCallback = (function (_this) { - return function (str) { - return _this.unescapeCharacter(str); - }; - })(this); - } - return this.PATTERN_ESCAPED_CHARACTER.replace(value, this._unescapeCallback); - }; - - Unescaper.unescapeCharacter = function (value) { - var ch; - ch = String.fromCharCode; - switch (value.charAt(1)) { - case '0': - return ch(0); - case 'a': - return ch(7); - case 'b': - return ch(8); - case 't': - return "\t"; - case "\t": - return "\t"; - case 'n': - return "\n"; - case 'v': - return ch(11); - case 'f': - return ch(12); - case 'r': - return ch(13); - case 'e': - return ch(27); - case ' ': - return ' '; - case '"': - return '"'; - case '/': - return '/'; - case '\\': - return '\\'; - case 'N': - return ch(0x0085); - case '_': - return ch(0x00A0); - case 'L': - return ch(0x2028); - case 'P': - return ch(0x2029); - case 'x': - return Utils.utf8chr(Utils.hexDec(value.substr(2, 2))); - case 'u': - return Utils.utf8chr(Utils.hexDec(value.substr(2, 4))); - case 'U': - return Utils.utf8chr(Utils.hexDec(value.substr(2, 8))); - default: - return ''; - } - }; - - return Unescaper; - - })(); - - module.exports = Unescaper; - - - }, { - "./Pattern": 8, - "./Utils": 10 - }], - 10: [function (require, module, exports) { - var Pattern, Utils, - hasProp = {}.hasOwnProperty; - - Pattern = require('./Pattern'); - - Utils = (function () { - function Utils() { - } - - Utils.REGEX_LEFT_TRIM_BY_CHAR = {}; - - Utils.REGEX_RIGHT_TRIM_BY_CHAR = {}; - - Utils.REGEX_SPACES = /\s+/g; - - Utils.REGEX_DIGITS = /^\d+$/; - - Utils.REGEX_OCTAL = /[^0-7]/gi; - - Utils.REGEX_HEXADECIMAL = /[^a-f0-9]/gi; - - Utils.PATTERN_DATE = new Pattern('^' + '(?[0-9][0-9][0-9][0-9])' + '-(?[0-9][0-9]?)' + - '-(?[0-9][0-9]?)' + '(?:(?:[Tt]|[ \t]+)' + '(?[0-9][0-9]?)' + ':(?[0-9][0-9])' + - ':(?[0-9][0-9])' + '(?:\.(?[0-9]*))?' + - '(?:[ \t]*(?Z|(?[-+])(?[0-9][0-9]?)' + '(?::(?[0-9][0-9]))?))?)?' + '$', 'i' - ); - - Utils.LOCAL_TIMEZONE_OFFSET = new Date().getTimezoneOffset() * 60 * 1000; - - Utils.trim = function (str, _char) { - var regexLeft, regexRight; - if (_char == null) { - _char = '\\s'; - } - regexLeft = this.REGEX_LEFT_TRIM_BY_CHAR[_char]; - if (regexLeft == null) { - this.REGEX_LEFT_TRIM_BY_CHAR[_char] = regexLeft = new RegExp('^' + _char + '' + _char + '*'); - } - regexLeft.lastIndex = 0; - regexRight = this.REGEX_RIGHT_TRIM_BY_CHAR[_char]; - if (regexRight == null) { - this.REGEX_RIGHT_TRIM_BY_CHAR[_char] = regexRight = new RegExp(_char + '' + _char + '*$'); - } - regexRight.lastIndex = 0; - return str.replace(regexLeft, '').replace(regexRight, ''); - }; - - Utils.ltrim = function (str, _char) { - var regexLeft; - if (_char == null) { - _char = '\\s'; - } - regexLeft = this.REGEX_LEFT_TRIM_BY_CHAR[_char]; - if (regexLeft == null) { - this.REGEX_LEFT_TRIM_BY_CHAR[_char] = regexLeft = new RegExp('^' + _char + '' + _char + '*'); - } - regexLeft.lastIndex = 0; - return str.replace(regexLeft, ''); - }; - - Utils.rtrim = function (str, _char) { - var regexRight; - if (_char == null) { - _char = '\\s'; - } - regexRight = this.REGEX_RIGHT_TRIM_BY_CHAR[_char]; - if (regexRight == null) { - this.REGEX_RIGHT_TRIM_BY_CHAR[_char] = regexRight = new RegExp(_char + '' + _char + '*$'); - } - regexRight.lastIndex = 0; - return str.replace(regexRight, ''); - }; - - Utils.isEmpty = function (value) { - return !value || value === '' || value === '0' || (value instanceof Array && value.length === 0) || this.isEmptyObject( - value); - }; - - Utils.isEmptyObject = function (value) { - var k; - return value instanceof Object && ((function () { - var results; - results = []; - for (k in value) { - if (!hasProp.call(value, k)) continue; - results.push(k); - } - return results; - })()).length === 0; - }; - - Utils.subStrCount = function (string, subString, start, length) { - var c, i, j, len, ref, sublen; - c = 0; - string = '' + string; - subString = '' + subString; - if (start != null) { - string = string.slice(start); - } - if (length != null) { - string = string.slice(0, length); - } - len = string.length; - sublen = subString.length; - for (i = j = 0, ref = len; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) { - if (subString === string.slice(i, sublen)) { - c++; - i += sublen - 1; - } - } - return c; - }; - - Utils.isDigits = function (input) { - this.REGEX_DIGITS.lastIndex = 0; - return this.REGEX_DIGITS.test(input); - }; - - Utils.octDec = function (input) { - this.REGEX_OCTAL.lastIndex = 0; - return parseInt((input + '').replace(this.REGEX_OCTAL, ''), 8); - }; - - Utils.hexDec = function (input) { - this.REGEX_HEXADECIMAL.lastIndex = 0; - input = this.trim(input); - if ((input + '').slice(0, 2) === '0x') { - input = (input + '').slice(2); - } - return parseInt((input + '').replace(this.REGEX_HEXADECIMAL, ''), 16); - }; - - Utils.utf8chr = function (c) { - var ch; - ch = String.fromCharCode; - if (0x80 > (c %= 0x200000)) { - return ch(c); - } - if (0x800 > c) { - return ch(0xC0 | c >> 6) + ch(0x80 | c & 0x3F); - } - if (0x10000 > c) { - return ch(0xE0 | c >> 12) + ch(0x80 | c >> 6 & 0x3F) + ch(0x80 | c & 0x3F); - } - return ch(0xF0 | c >> 18) + ch(0x80 | c >> 12 & 0x3F) + ch(0x80 | c >> 6 & 0x3F) + ch(0x80 | c & 0x3F); - }; - - Utils.parseBoolean = function (input, strict) { - var lowerInput; - if (strict == null) { - strict = true; - } - if (typeof input === 'string') { - lowerInput = input.toLowerCase(); - if (!strict) { - if (lowerInput === 'no') { - return false; - } - } - if (lowerInput === '0') { - return false; - } - if (lowerInput === 'false') { - return false; - } - if (lowerInput === '') { - return false; - } - return true; - } - return !!input; - }; - - Utils.isNumeric = function (input) { - this.REGEX_SPACES.lastIndex = 0; - return typeof input === 'number' || typeof input === 'string' && !isNaN(input) && input.replace(this.REGEX_SPACES, - '') !== ''; - }; - - Utils.stringToDate = function (str) { - var date, day, fraction, hour, info, minute, month, second, tz_hour, tz_minute, tz_offset, year; - if (!(str != null ? str.length : void 0)) { - return null; - } - info = this.PATTERN_DATE.exec(str); - if (!info) { - return null; - } - year = parseInt(info.year, 10); - month = parseInt(info.month, 10) - 1; - day = parseInt(info.day, 10); - if (info.hour == null) { - date = new Date(Date.UTC(year, month, day)); - return date; - } - hour = parseInt(info.hour, 10); - minute = parseInt(info.minute, 10); - second = parseInt(info.second, 10); - if (info.fraction != null) { - fraction = info.fraction.slice(0, 3); - while (fraction.length < 3) { - fraction += '0'; - } - fraction = parseInt(fraction, 10); - } else { - fraction = 0; - } - if (info.tz != null) { - tz_hour = parseInt(info.tz_hour, 10); - if (info.tz_minute != null) { - tz_minute = parseInt(info.tz_minute, 10); - } else { - tz_minute = 0; - } - tz_offset = (tz_hour * 60 + tz_minute) * 60000; - if ('-' === info.tz_sign) { - tz_offset *= -1; - } - } - date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); - if (tz_offset) { - date.setTime(date.getTime() - tz_offset); - } - return date; - }; - - Utils.strRepeat = function (str, number) { - var i, res; - res = ''; - i = 0; - while (i < number) { - res += str; - i++; - } - return res; - }; - - Utils.getStringFromFile = function (path, callback) { - var data, fs, j, len1, name, ref, req, xhr; - if (callback == null) { - callback = null; - } - xhr = null; - if (typeof window !== "undefined" && window !== null) { - if (window.XMLHttpRequest) { - xhr = new XMLHttpRequest(); - } else if (window.ActiveXObject) { - ref = ["Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.3.0", "Msxml2.XMLHTTP", "Microsoft.XMLHTTP"]; - for (j = 0, len1 = ref.length; j < len1; j++) { - name = ref[j]; - try { - xhr = new ActiveXObject(name); - } catch (undefined) { - } - } - } - } - if (xhr != null) { - if (callback != null) { - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - if (xhr.status === 200 || xhr.status === 0) { - return callback(xhr.responseText); - } else { - return callback(null); - } - } - }; - xhr.open('GET', path, true); - return xhr.send(null); - } else { - xhr.open('GET', path, false); - xhr.send(null); - if (xhr.status === 200 || xhr.status === 0) { - return xhr.responseText; - } - return null; - } - } else { - req = require; - fs = req('fs'); - if (callback != null) { - return fs.readFile(path, function (err, data) { - if (err) { - return callback(null); - } else { - return callback(String(data)); - } - }); - } else { - data = fs.readFileSync(path); - if (data != null) { - return String(data); - } - return null; - } - } - }; - - return Utils; - - })(); - - module.exports = Utils; - - - }, { - "./Pattern": 8 - }], - 11: [function (require, module, exports) { - var Dumper, Parser, Utils, Yaml; - - Parser = require('./Parser'); - - Dumper = require('./Dumper'); - - Utils = require('./Utils'); - - Yaml = (function () { - function Yaml() { - } - - Yaml.parse = function (input, exceptionOnInvalidType, objectDecoder) { - if (exceptionOnInvalidType == null) { - exceptionOnInvalidType = false; - } - if (objectDecoder == null) { - objectDecoder = null; - } - return new Parser().parse(input, exceptionOnInvalidType, objectDecoder); - }; - - Yaml.parseFile = function (path, callback, exceptionOnInvalidType, objectDecoder) { - var input; - if (callback == null) { - callback = null; - } - if (exceptionOnInvalidType == null) { - exceptionOnInvalidType = false; - } - if (objectDecoder == null) { - objectDecoder = null; - } - if (callback != null) { - return Utils.getStringFromFile(path, (function (_this) { - return function (input) { - var result; - result = null; - if (input != null) { - result = _this.parse(input, exceptionOnInvalidType, objectDecoder); - } - callback(result); - }; - })(this)); - } else { - input = Utils.getStringFromFile(path); - if (input != null) { - return this.parse(input, exceptionOnInvalidType, objectDecoder); - } - return null; - } - }; - - Yaml.dump = function (input, inline, indent, exceptionOnInvalidType, objectEncoder) { - var yaml; - if (inline == null) { - inline = 2; - } - if (indent == null) { - indent = 4; - } - if (exceptionOnInvalidType == null) { - exceptionOnInvalidType = false; - } - if (objectEncoder == null) { - objectEncoder = null; - } - yaml = new Dumper(); - yaml.indentation = indent; - return yaml.dump(input, inline, 0, exceptionOnInvalidType, objectEncoder); - }; - - Yaml.stringify = function (input, inline, indent, exceptionOnInvalidType, objectEncoder) { - return this.dump(input, inline, indent, exceptionOnInvalidType, objectEncoder); - }; - - Yaml.load = function (path, callback, exceptionOnInvalidType, objectDecoder) { - return this.parseFile(path, callback, exceptionOnInvalidType, objectDecoder); - }; - - return Yaml; - - })(); - - if (typeof window !== "undefined" && window !== null) { - window.YAML = Yaml; - } - - if (typeof window === "undefined" || window === null) { - this.YAML = Yaml; - } - - module.exports = Yaml; - - - }, { - "./Dumper": 1, - "./Parser": 7, - "./Utils": 10 - }] + module.exports = ParseException; + + + }, {}], + 5: [function(require, module, exports) { + var ParseMore, + extend = function(child, parent) { + for (var key in parent) { + if (hasProp.call(parent, key)) child[key] = parent[key]; + } + + function ctor() { + this.constructor = child; + } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + child.__super__ = parent.prototype; + return child; + }, + hasProp = {}.hasOwnProperty; + + ParseMore = (function(superClass) { + extend(ParseMore, superClass); + + function ParseMore(message, parsedLine, snippet) { + ParseMore.__super__.constructor.call(this, message); + this.message = message; + this.parsedLine = parsedLine; + this.snippet = snippet; + } + + ParseMore.prototype.toString = function() { + if ((this.parsedLine != null) && (this.snippet != null)) { + return ' ' + this.message + ' (line ' + this.parsedLine + ': \'' + this.snippet + '\')'; + } else { + return ' ' + this.message; + } + }; + + return ParseMore; + + })(Error); + + module.exports = ParseMore; + + + }, {}], + 6: [function(require, module, exports) { + var DumpException, Escaper, Inline, ParseException, ParseMore, Pattern, Unescaper, Utils, + indexOf = [].indexOf || function(item) { + for (var i = 0, l = this.length; i < l; i++) { + if (i in this && this[i] === item) return i; + } + return -1; + }; + + Pattern = require('./Pattern'); + + Unescaper = require('./Unescaper'); + + Escaper = require('./Escaper'); + + Utils = require('./Utils'); + + ParseException = require('./Exception/ParseException'); + + ParseMore = require('./Exception/ParseMore'); + + DumpException = require('./Exception/DumpException'); + + Inline = (function() { + function Inline() {} + + Inline.REGEX_QUOTED_STRING = '(?:"(?:[^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'(?:[^\']*(?:\'\'[^\']*)*)\')'; + + Inline.PATTERN_TRAILING_COMMENTS = new Pattern('^\\s*#.*$'); + + Inline.PATTERN_QUOTED_SCALAR = new Pattern('^' + Inline.REGEX_QUOTED_STRING); + + Inline.PATTERN_THOUSAND_NUMERIC_SCALAR = new Pattern('^(-|\\+)?[0-9,]+(\\.[0-9]+)?$'); + + Inline.PATTERN_SCALAR_BY_DELIMITERS = {}; + + Inline.settings = {}; + + Inline.configure = function(exceptionOnInvalidType, objectDecoder) { + if (exceptionOnInvalidType == null) { + exceptionOnInvalidType = null; + } + if (objectDecoder == null) { + objectDecoder = null; + } + this.settings.exceptionOnInvalidType = exceptionOnInvalidType; + this.settings.objectDecoder = objectDecoder; + }; + + Inline.parse = function(value, exceptionOnInvalidType, objectDecoder) { + var context, result; + if (exceptionOnInvalidType == null) { + exceptionOnInvalidType = false; + } + if (objectDecoder == null) { + objectDecoder = null; + } + this.settings.exceptionOnInvalidType = exceptionOnInvalidType; + this.settings.objectDecoder = objectDecoder; + if (value == null) { + return ''; + } + value = Utils.trim(value); + if (0 === value.length) { + return ''; + } + context = { + exceptionOnInvalidType: exceptionOnInvalidType, + objectDecoder: objectDecoder, + i: 0 + }; + switch (value.charAt(0)) { + case '[': + result = this.parseSequence(value, context); + ++context.i; + break; + case '{': + result = this.parseMapping(value, context); + ++context.i; + break; + default: + result = this.parseScalar(value, null, ['"', "'"], context); + } + if (this.PATTERN_TRAILING_COMMENTS.replace(value.slice(context.i), '') !== '') { + throw new ParseException('Unexpected characters near "' + value.slice(context.i) + '".'); + } + return result; + }; + + Inline.dump = function(value, exceptionOnInvalidType, objectEncoder) { + var ref, result, type; + if (exceptionOnInvalidType == null) { + exceptionOnInvalidType = false; + } + if (objectEncoder == null) { + objectEncoder = null; + } + if (value == null) { + return 'null'; + } + type = typeof value; + if (type === 'object') { + if (value instanceof Date) { + return value.toISOString(); + } else if (objectEncoder != null) { + result = objectEncoder(value); + if (typeof result === 'string' || (result != null)) { + return result; + } + } + return this.dumpObject(value); + } + if (type === 'boolean') { + return (value ? 'true' : 'false'); + } + if (Utils.isDigits(value)) { + return (type === 'string' ? "'" + value + "'" : String(parseInt(value))); + } + if (Utils.isNumeric(value)) { + return (type === 'string' ? "'" + value + "'" : String(parseFloat(value))); + } + if (type === 'number') { + return (value === Infinity ? '.Inf' : (value === -Infinity ? '-.Inf' : (isNaN(value) ? '.NaN' : value))); + } + if (Escaper.requiresDoubleQuoting(value)) { + return Escaper.escapeWithDoubleQuotes(value); + } + if (Escaper.requiresSingleQuoting(value)) { + return Escaper.escapeWithSingleQuotes(value); + } + if ('' === value) { + return '""'; + } + if (Utils.PATTERN_DATE.test(value)) { + return "'" + value + "'"; + } + if ((ref = value.toLowerCase()) === 'null' || ref === '~' || ref === 'true' || ref === 'false') { + return "'" + value + "'"; + } + return value; + }; + + Inline.dumpObject = function(value, exceptionOnInvalidType, objectSupport) { + var j, key, len1, output, val; + if (objectSupport == null) { + objectSupport = null; + } + if (value instanceof Array) { + output = []; + for (j = 0, len1 = value.length; j < len1; j++) { + val = value[j]; + output.push(this.dump(val)); + } + return '[' + output.join(', ') + ']'; + } else { + output = []; + for (key in value) { + val = value[key]; + output.push(this.dump(key) + ': ' + this.dump(val)); + } + return '{' + output.join(', ') + '}'; + } + }; + + Inline.parseScalar = function(scalar, delimiters, stringDelimiters, context, evaluate) { + var i, joinedDelimiters, match, output, pattern, ref, ref1, strpos, tmp; + if (delimiters == null) { + delimiters = null; + } + if (stringDelimiters == null) { + stringDelimiters = ['"', "'"]; + } + if (context == null) { + context = null; + } + if (evaluate == null) { + evaluate = true; + } + if (context == null) { + context = { + exceptionOnInvalidType: this.settings.exceptionOnInvalidType, + objectDecoder: this.settings.objectDecoder, + i: 0 + }; + } + i = context.i; + if (ref = scalar.charAt(i), indexOf.call(stringDelimiters, ref) >= 0) { + output = this.parseQuotedScalar(scalar, context); + i = context.i; + if (delimiters != null) { + tmp = Utils.ltrim(scalar.slice(i), ' '); + if (!(ref1 = tmp.charAt(0), indexOf.call(delimiters, ref1) >= 0)) { + throw new ParseException('Unexpected characters (' + scalar.slice(i) + ').'); + } + } + } else { + if (!delimiters) { + output = scalar.slice(i); + i += output.length; + strpos = output.indexOf(' #'); + if (strpos !== -1) { + output = Utils.rtrim(output.slice(0, strpos)); + } + } else { + joinedDelimiters = delimiters.join('|'); + pattern = this.PATTERN_SCALAR_BY_DELIMITERS[joinedDelimiters]; + if (pattern == null) { + pattern = new Pattern('^(.+?)(' + joinedDelimiters + ')'); + this.PATTERN_SCALAR_BY_DELIMITERS[joinedDelimiters] = pattern; + } + if (match = pattern.exec(scalar.slice(i))) { + output = match[1]; + i += output.length; + } else { + throw new ParseException('Malformed inline YAML string (' + scalar + ').'); + } + } + if (evaluate) { + output = this.evaluateScalar(output, context); + } + } + context.i = i; + return output; + }; + + Inline.parseQuotedScalar = function(scalar, context) { + var i, match, output; + i = context.i; + if (!(match = this.PATTERN_QUOTED_SCALAR.exec(scalar.slice(i)))) { + throw new ParseMore('Malformed inline YAML string (' + scalar.slice(i) + ').'); + } + output = match[0].substr(1, match[0].length - 2); + if ('"' === scalar.charAt(i)) { + output = Unescaper.unescapeDoubleQuotedString(output); + } else { + output = Unescaper.unescapeSingleQuotedString(output); + } + i += match[0].length; + context.i = i; + return output; + }; + + Inline.parseSequence = function(sequence, context) { + var e, error, i, isQuoted, len, output, ref, value; + output = []; + len = sequence.length; + i = context.i; + i += 1; + while (i < len) { + context.i = i; + switch (sequence.charAt(i)) { + case '[': + output.push(this.parseSequence(sequence, context)); + i = context.i; + break; + case '{': + output.push(this.parseMapping(sequence, context)); + i = context.i; + break; + case ']': + return output; + case ',': + case ' ': + case "\n": + break; + default: + isQuoted = ((ref = sequence.charAt(i)) === '"' || ref === "'"); + value = this.parseScalar(sequence, [',', ']'], ['"', "'"], context); + i = context.i; + if (!isQuoted && typeof value === 'string' && (value.indexOf(': ') !== -1 || value.indexOf(":\n") !== -1)) { + try { + value = this.parseMapping('{' + value + '}'); + } catch (error) { + e = error; + } + } + output.push(value); + --i; + } + ++i; + } + throw new ParseMore('Malformed inline YAML string ' + sequence); + }; + + Inline.parseMapping = function(mapping, context) { + var done, i, key, len, output, shouldContinueWhileLoop, value; + output = {}; + len = mapping.length; + i = context.i; + i += 1; + shouldContinueWhileLoop = false; + while (i < len) { + context.i = i; + switch (mapping.charAt(i)) { + case ' ': + case ',': + case "\n": + ++i; + context.i = i; + shouldContinueWhileLoop = true; + break; + case '}': + return output; + } + if (shouldContinueWhileLoop) { + shouldContinueWhileLoop = false; + continue; + } + key = this.parseScalar(mapping, [':', ' ', "\n"], ['"', "'"], context, false); + i = context.i; + done = false; + while (i < len) { + context.i = i; + switch (mapping.charAt(i)) { + case '[': + value = this.parseSequence(mapping, context); + i = context.i; + if (output[key] === void 0) { + output[key] = value; + } + done = true; + break; + case '{': + value = this.parseMapping(mapping, context); + i = context.i; + if (output[key] === void 0) { + output[key] = value; + } + done = true; + break; + case ':': + case ' ': + case "\n": + break; + default: + value = this.parseScalar(mapping, [',', '}'], ['"', "'"], context); + i = context.i; + if (output[key] === void 0) { + output[key] = value; + } + done = true; + --i; + } + ++i; + if (done) { + break; + } + } + } + throw new ParseMore('Malformed inline YAML string ' + mapping); + }; + + Inline.evaluateScalar = function(scalar, context) { + var cast, date, exceptionOnInvalidType, firstChar, firstSpace, firstWord, objectDecoder, raw, scalarLower, + subValue, trimmedScalar; + scalar = Utils.trim(scalar); + scalarLower = scalar.toLowerCase(); + switch (scalarLower) { + case 'null': + case '': + case '~': + return null; + case 'true': + return true; + case 'false': + return false; + case '.inf': + return Infinity; + case '.nan': + return NaN; + case '-.inf': + return Infinity; + default: + firstChar = scalarLower.charAt(0); + switch (firstChar) { + case '!': + firstSpace = scalar.indexOf(' '); + if (firstSpace === -1) { + firstWord = scalarLower; + } else { + firstWord = scalarLower.slice(0, firstSpace); + } + switch (firstWord) { + case '!': + if (firstSpace !== -1) { + return parseInt(this.parseScalar(scalar.slice(2))); + } + return null; + case '!str': + return Utils.ltrim(scalar.slice(4)); + case '!!str': + return Utils.ltrim(scalar.slice(5)); + case '!!int': + return parseInt(this.parseScalar(scalar.slice(5))); + case '!!bool': + return Utils.parseBoolean(this.parseScalar(scalar.slice(6)), false); + case '!!float': + return parseFloat(this.parseScalar(scalar.slice(7))); + case '!!timestamp': + return Utils.stringToDate(Utils.ltrim(scalar.slice(11))); + default: + if (context == null) { + context = { + exceptionOnInvalidType: this.settings.exceptionOnInvalidType, + objectDecoder: this.settings.objectDecoder, + i: 0 + }; + } + objectDecoder = context.objectDecoder, exceptionOnInvalidType = context.exceptionOnInvalidType; + if (objectDecoder) { + trimmedScalar = Utils.rtrim(scalar); + firstSpace = trimmedScalar.indexOf(' '); + if (firstSpace === -1) { + return objectDecoder(trimmedScalar, null); + } else { + subValue = Utils.ltrim(trimmedScalar.slice(firstSpace + 1)); + if (!(subValue.length > 0)) { + subValue = null; + } + return objectDecoder(trimmedScalar.slice(0, firstSpace), subValue); + } + } + if (exceptionOnInvalidType) { + throw new ParseException('Custom object support when parsing a YAML file has been disabled.'); + } + return null; + } + break; + case '0': + if ('0x' === scalar.slice(0, 2)) { + return Utils.hexDec(scalar); + } else if (Utils.isDigits(scalar)) { + return Utils.octDec(scalar); + } else if (Utils.isNumeric(scalar)) { + return parseFloat(scalar); + } else { + return scalar; + } + break; + case '+': + if (Utils.isDigits(scalar)) { + raw = scalar; + cast = parseInt(raw); + if (raw === String(cast)) { + return cast; + } else { + return raw; + } + } else if (Utils.isNumeric(scalar)) { + return parseFloat(scalar); + } else if (this.PATTERN_THOUSAND_NUMERIC_SCALAR.test(scalar)) { + return parseFloat(scalar.replace(',', '')); + } + return scalar; + case '-': + if (Utils.isDigits(scalar.slice(1))) { + if ('0' === scalar.charAt(1)) { + return -Utils.octDec(scalar.slice(1)); + } else { + raw = scalar.slice(1); + cast = parseInt(raw); + if (raw === String(cast)) { + return -cast; + } else { + return -raw; + } + } + } else if (Utils.isNumeric(scalar)) { + return parseFloat(scalar); + } else if (this.PATTERN_THOUSAND_NUMERIC_SCALAR.test(scalar)) { + return parseFloat(scalar.replace(',', '')); + } + return scalar; + default: + if (date = Utils.stringToDate(scalar)) { + return date; + } else if (Utils.isNumeric(scalar)) { + return parseFloat(scalar); + } else if (this.PATTERN_THOUSAND_NUMERIC_SCALAR.test(scalar)) { + return parseFloat(scalar.replace(',', '')); + } + return scalar; + } + } + }; + + return Inline; + + })(); + + module.exports = Inline; + + + }, { + "./Escaper": 2, + "./Exception/DumpException": 3, + "./Exception/ParseException": 4, + "./Exception/ParseMore": 5, + "./Pattern": 8, + "./Unescaper": 9, + "./Utils": 10 + }], + 7: [function(require, module, exports) { + var Inline, ParseException, ParseMore, Parser, Pattern, Utils; + + Inline = require('./Inline'); + + Pattern = require('./Pattern'); + + Utils = require('./Utils'); + + ParseException = require('./Exception/ParseException'); + + ParseMore = require('./Exception/ParseMore'); + + Parser = (function() { + Parser.prototype.PATTERN_FOLDED_SCALAR_ALL = new Pattern( + '^(?:(?![^\\|>]*)\\s+)?(?\\||>)(?\\+|\\-|\\d+|\\+\\d+|\\-\\d+|\\d+\\+|\\d+\\-)?(? +#.*)?$' + ); + + Parser.prototype.PATTERN_FOLDED_SCALAR_END = new Pattern( + '(?\\||>)(?\\+|\\-|\\d+|\\+\\d+|\\-\\d+|\\d+\\+|\\d+\\-)?(? +#.*)?$'); + + Parser.prototype.PATTERN_SEQUENCE_ITEM = new Pattern('^\\-((?\\s+)(?.+?))?\\s*$'); + + Parser.prototype.PATTERN_ANCHOR_VALUE = new Pattern('^&(?[^ ]+) *(?.*)'); + + Parser.prototype.PATTERN_COMPACT_NOTATION = new Pattern('^(?' + Inline.REGEX_QUOTED_STRING + + '|[^ \'"\\{\\[].*?) *\\:(\\s+(?.+?))?\\s*$'); + + Parser.prototype.PATTERN_MAPPING_ITEM = new Pattern('^(?' + Inline.REGEX_QUOTED_STRING + + '|[^ \'"\\[\\{].*?) *\\:(\\s+(?.+?))?\\s*$'); + + Parser.prototype.PATTERN_DECIMAL = new Pattern('\\d+'); + + Parser.prototype.PATTERN_INDENT_SPACES = new Pattern('^ +'); + + Parser.prototype.PATTERN_TRAILING_LINES = new Pattern('(\n*)$'); + + Parser.prototype.PATTERN_YAML_HEADER = new Pattern('^\\%YAML[: ][\\d\\.]+.*\n', 'm'); + + Parser.prototype.PATTERN_LEADING_COMMENTS = new Pattern('^(\\#.*?\n)+', 'm'); + + Parser.prototype.PATTERN_DOCUMENT_MARKER_START = new Pattern('^\\-\\-\\-.*?\n', 'm'); + + Parser.prototype.PATTERN_DOCUMENT_MARKER_END = new Pattern('^\\.\\.\\.\\s*$', 'm'); + + Parser.prototype.PATTERN_FOLDED_SCALAR_BY_INDENTATION = {}; + + Parser.prototype.CONTEXT_NONE = 0; + + Parser.prototype.CONTEXT_SEQUENCE = 1; + + Parser.prototype.CONTEXT_MAPPING = 2; + + function Parser(offset) { + this.offset = offset != null ? offset : 0; + this.lines = []; + this.currentLineNb = -1; + this.currentLine = ''; + this.refs = {}; + } + + Parser.prototype.parse = function(value, exceptionOnInvalidType, objectDecoder) { + var alias, allowOverwrite, block, c, context, data, e, error, error1, error2, first, i, indent, isRef, j, k, + key, l, lastKey, len, len1, len2, len3, lineCount, m, matches, mergeNode, n, name, parsed, parsedItem, + parser, ref, ref1, ref2, refName, refValue, val, values; + if (exceptionOnInvalidType == null) { + exceptionOnInvalidType = false; + } + if (objectDecoder == null) { + objectDecoder = null; + } + this.currentLineNb = -1; + this.currentLine = ''; + this.lines = this.cleanup(value).split("\n"); + data = null; + context = this.CONTEXT_NONE; + allowOverwrite = false; + while (this.moveToNextLine()) { + if (this.isCurrentLineEmpty()) { + continue; + } + if ("\t" === this.currentLine[0]) { + throw new ParseException('A YAML file cannot contain tabs as indentation.', this.getRealCurrentLineNb() + 1, + this.currentLine); + } + isRef = mergeNode = false; + if (values = this.PATTERN_SEQUENCE_ITEM.exec(this.currentLine)) { + if (this.CONTEXT_MAPPING === context) { + throw new ParseException('You cannot define a sequence item when in a mapping'); + } + context = this.CONTEXT_SEQUENCE; + if (data == null) { + data = []; + } + if ((values.value != null) && (matches = this.PATTERN_ANCHOR_VALUE.exec(values.value))) { + isRef = matches.ref; + values.value = matches.value; + } + if (!(values.value != null) || '' === Utils.trim(values.value, ' ') || Utils.ltrim(values.value, ' ').indexOf( + '#') === 0) { + if (this.currentLineNb < this.lines.length - 1 && !this.isNextLineUnIndentedCollection()) { + c = this.getRealCurrentLineNb() + 1; + parser = new Parser(c); + parser.refs = this.refs; + data.push(parser.parse(this.getNextEmbedBlock(null, true), exceptionOnInvalidType, objectDecoder)); + } else { + data.push(null); + } + } else { + if (((ref = values.leadspaces) != null ? ref.length : void 0) && (matches = this.PATTERN_COMPACT_NOTATION.exec( + values.value))) { + c = this.getRealCurrentLineNb(); + parser = new Parser(c); + parser.refs = this.refs; + block = values.value; + indent = this.getCurrentLineIndentation(); + if (this.isNextLineIndented(false)) { + block += "\n" + this.getNextEmbedBlock(indent + values.leadspaces.length + 1, true); + } + data.push(parser.parse(block, exceptionOnInvalidType, objectDecoder)); + } else { + data.push(this.parseValue(values.value, exceptionOnInvalidType, objectDecoder)); + } + } + } else if ((values = this.PATTERN_MAPPING_ITEM.exec(this.currentLine)) && values.key.indexOf(' #') === -1) { + if (this.CONTEXT_SEQUENCE === context) { + throw new ParseException('You cannot define a mapping item when in a sequence'); + } + context = this.CONTEXT_MAPPING; + if (data == null) { + data = {}; + } + Inline.configure(exceptionOnInvalidType, objectDecoder); + try { + key = Inline.parseScalar(values.key); + } catch (error) { + e = error; + e.parsedLine = this.getRealCurrentLineNb() + 1; + e.snippet = this.currentLine; + throw e; + } + if ('<<' === key) { + mergeNode = true; + allowOverwrite = true; + if (((ref1 = values.value) != null ? ref1.indexOf('*') : void 0) === 0) { + refName = values.value.slice(1); + if (this.refs[refName] == null) { + throw new ParseException('Reference "' + refName + '" does not exist.', this.getRealCurrentLineNb() + 1, + this.currentLine); + } + refValue = this.refs[refName]; + if (typeof refValue !== 'object') { + throw new ParseException('YAML merge keys used with a scalar value instead of an object.', this.getRealCurrentLineNb() + + 1, this.currentLine); + } + if (refValue instanceof Array) { + for (i = j = 0, len = refValue.length; j < len; i = ++j) { + value = refValue[i]; + if (data[name = String(i)] == null) { + data[name] = value; + } + } + } else { + for (key in refValue) { + value = refValue[key]; + if (data[key] == null) { + data[key] = value; + } + } + } + } else { + if ((values.value != null) && values.value !== '') { + value = values.value; + } else { + value = this.getNextEmbedBlock(); + } + c = this.getRealCurrentLineNb() + 1; + parser = new Parser(c); + parser.refs = this.refs; + parsed = parser.parse(value, exceptionOnInvalidType); + if (typeof parsed !== 'object') { + throw new ParseException('YAML merge keys used with a scalar value instead of an object.', this.getRealCurrentLineNb() + + 1, this.currentLine); + } + if (parsed instanceof Array) { + for (l = 0, len1 = parsed.length; l < len1; l++) { + parsedItem = parsed[l]; + if (typeof parsedItem !== 'object') { + throw new ParseException('Merge items must be objects.', this.getRealCurrentLineNb() + 1, parsedItem); + } + if (parsedItem instanceof Array) { + for (i = m = 0, len2 = parsedItem.length; m < len2; i = ++m) { + value = parsedItem[i]; + k = String(i); + if (!data.hasOwnProperty(k)) { + data[k] = value; + } + } + } else { + for (key in parsedItem) { + value = parsedItem[key]; + if (!data.hasOwnProperty(key)) { + data[key] = value; + } + } + } + } + } else { + for (key in parsed) { + value = parsed[key]; + if (!data.hasOwnProperty(key)) { + data[key] = value; + } + } + } + } + } else if ((values.value != null) && (matches = this.PATTERN_ANCHOR_VALUE.exec(values.value))) { + isRef = matches.ref; + values.value = matches.value; + } + if (mergeNode) { + + } else if (!(values.value != null) || '' === Utils.trim(values.value, ' ') || Utils.ltrim(values.value, ' ') + .indexOf('#') === 0) { + if (!(this.isNextLineIndented()) && !(this.isNextLineUnIndentedCollection())) { + if (allowOverwrite || data[key] === void 0) { + data[key] = null; + } + } else { + c = this.getRealCurrentLineNb() + 1; + parser = new Parser(c); + parser.refs = this.refs; + val = parser.parse(this.getNextEmbedBlock(), exceptionOnInvalidType, objectDecoder); + if (allowOverwrite || data[key] === void 0) { + data[key] = val; + } + } + } else { + val = this.parseValue(values.value, exceptionOnInvalidType, objectDecoder); + if (allowOverwrite || data[key] === void 0) { + data[key] = val; + } + } + } else { + lineCount = this.lines.length; + if (1 === lineCount || (2 === lineCount && Utils.isEmpty(this.lines[1]))) { + try { + value = Inline.parse(this.lines[0], exceptionOnInvalidType, objectDecoder); + } catch (error1) { + e = error1; + e.parsedLine = this.getRealCurrentLineNb() + 1; + e.snippet = this.currentLine; + throw e; + } + if (typeof value === 'object') { + if (value instanceof Array) { + first = value[0]; + } else { + for (key in value) { + first = value[key]; + break; + } + } + if (typeof first === 'string' && first.indexOf('*') === 0) { + data = []; + for (n = 0, len3 = value.length; n < len3; n++) { + alias = value[n]; + data.push(this.refs[alias.slice(1)]); + } + value = data; + } + } + return value; + } else if ((ref2 = Utils.ltrim(value).charAt(0)) === '[' || ref2 === '{') { + try { + return Inline.parse(value, exceptionOnInvalidType, objectDecoder); + } catch (error2) { + e = error2; + e.parsedLine = this.getRealCurrentLineNb() + 1; + e.snippet = this.currentLine; + throw e; + } + } + throw new ParseException('Unable to parse.', this.getRealCurrentLineNb() + 1, this.currentLine); + } + if (isRef) { + if (data instanceof Array) { + this.refs[isRef] = data[data.length - 1]; + } else { + lastKey = null; + for (key in data) { + lastKey = key; + } + this.refs[isRef] = data[lastKey]; + } + } + } + if (Utils.isEmpty(data)) { + return null; + } else { + return data; + } + }; + + Parser.prototype.getRealCurrentLineNb = function() { + return this.currentLineNb + this.offset; + }; + + Parser.prototype.getCurrentLineIndentation = function() { + return this.currentLine.length - Utils.ltrim(this.currentLine, ' ').length; + }; + + Parser.prototype.getNextEmbedBlock = function(indentation, includeUnindentedCollection) { + var data, indent, isItUnindentedCollection, newIndent, removeComments, removeCommentsPattern, + unindentedEmbedBlock; + if (indentation == null) { + indentation = null; + } + if (includeUnindentedCollection == null) { + includeUnindentedCollection = false; + } + this.moveToNextLine(); + if (indentation == null) { + newIndent = this.getCurrentLineIndentation(); + unindentedEmbedBlock = this.isStringUnIndentedCollectionItem(this.currentLine); + if (!(this.isCurrentLineEmpty()) && 0 === newIndent && !unindentedEmbedBlock) { + throw new ParseException('Indentation problem.', this.getRealCurrentLineNb() + 1, this.currentLine); + } + } else { + newIndent = indentation; + } + data = [this.currentLine.slice(newIndent)]; + if (!includeUnindentedCollection) { + isItUnindentedCollection = this.isStringUnIndentedCollectionItem(this.currentLine); + } + removeCommentsPattern = this.PATTERN_FOLDED_SCALAR_END; + removeComments = !removeCommentsPattern.test(this.currentLine); + while (this.moveToNextLine()) { + indent = this.getCurrentLineIndentation(); + if (indent === newIndent) { + removeComments = !removeCommentsPattern.test(this.currentLine); + } + if (removeComments && this.isCurrentLineComment()) { + continue; + } + if (this.isCurrentLineBlank()) { + data.push(this.currentLine.slice(newIndent)); + continue; + } + if (isItUnindentedCollection && !this.isStringUnIndentedCollectionItem(this.currentLine) && indent === + newIndent) { + this.moveToPreviousLine(); + break; + } + if (indent >= newIndent) { + data.push(this.currentLine.slice(newIndent)); + } else if (Utils.ltrim(this.currentLine).charAt(0) === '#') { + + } else if (0 === indent) { + this.moveToPreviousLine(); + break; + } else { + throw new ParseException('Indentation problem.', this.getRealCurrentLineNb() + 1, this.currentLine); + } + } + return data.join("\n"); + }; + + Parser.prototype.moveToNextLine = function() { + if (this.currentLineNb >= this.lines.length - 1) { + return false; + } + this.currentLine = this.lines[++this.currentLineNb]; + return true; + }; + + Parser.prototype.moveToPreviousLine = function() { + this.currentLine = this.lines[--this.currentLineNb]; + }; + + Parser.prototype.parseValue = function(value, exceptionOnInvalidType, objectDecoder) { + var e, error, foldedIndent, matches, modifiers, pos, ref, ref1, val; + if (0 === value.indexOf('*')) { + pos = value.indexOf('#'); + if (pos !== -1) { + value = value.substr(1, pos - 2); + } else { + value = value.slice(1); + } + if (this.refs[value] === void 0) { + throw new ParseException('Reference "' + value + '" does not exist.', this.currentLine); + } + return this.refs[value]; + } + if (matches = this.PATTERN_FOLDED_SCALAR_ALL.exec(value)) { + modifiers = (ref = matches.modifiers) != null ? ref : ''; + foldedIndent = Math.abs(parseInt(modifiers)); + if (isNaN(foldedIndent)) { + foldedIndent = 0; + } + val = this.parseFoldedScalar(matches.separator, this.PATTERN_DECIMAL.replace(modifiers, ''), foldedIndent); + if (matches.type != null) { + Inline.configure(exceptionOnInvalidType, objectDecoder); + return Inline.parseScalar(matches.type + ' ' + val); + } else { + return val; + } + } + if ((ref1 = value.charAt(0)) === '[' || ref1 === '{' || ref1 === '"' || ref1 === "'") { + while (true) { + try { + return Inline.parse(value, exceptionOnInvalidType, objectDecoder); + } catch (error) { + e = error; + if (e instanceof ParseMore && this.moveToNextLine()) { + value += "\n" + Utils.trim(this.currentLine, ' '); + } else { + e.parsedLine = this.getRealCurrentLineNb() + 1; + e.snippet = this.currentLine; + throw e; + } + } + } + } else { + if (this.isNextLineIndented()) { + value += "\n" + this.getNextEmbedBlock(); + } + return Inline.parse(value, exceptionOnInvalidType, objectDecoder); + } + }; + + Parser.prototype.parseFoldedScalar = function(separator, indicator, indentation) { + var isCurrentLineBlank, j, len, line, matches, newText, notEOF, pattern, ref, text; + if (indicator == null) { + indicator = ''; + } + if (indentation == null) { + indentation = 0; + } + notEOF = this.moveToNextLine(); + if (!notEOF) { + return ''; + } + isCurrentLineBlank = this.isCurrentLineBlank(); + text = ''; + while (notEOF && isCurrentLineBlank) { + if (notEOF = this.moveToNextLine()) { + text += "\n"; + isCurrentLineBlank = this.isCurrentLineBlank(); + } + } + if (0 === indentation) { + if (matches = this.PATTERN_INDENT_SPACES.exec(this.currentLine)) { + indentation = matches[0].length; + } + } + if (indentation > 0) { + pattern = this.PATTERN_FOLDED_SCALAR_BY_INDENTATION[indentation]; + if (pattern == null) { + pattern = new Pattern('^ {' + indentation + '}(.*)$'); + Parser.prototype.PATTERN_FOLDED_SCALAR_BY_INDENTATION[indentation] = pattern; + } + while (notEOF && (isCurrentLineBlank || (matches = pattern.exec(this.currentLine)))) { + if (isCurrentLineBlank) { + text += this.currentLine.slice(indentation); + } else { + text += matches[1]; + } + if (notEOF = this.moveToNextLine()) { + text += "\n"; + isCurrentLineBlank = this.isCurrentLineBlank(); + } + } + } else if (notEOF) { + text += "\n"; + } + if (notEOF) { + this.moveToPreviousLine(); + } + if ('>' === separator) { + newText = ''; + ref = text.split("\n"); + for (j = 0, len = ref.length; j < len; j++) { + line = ref[j]; + if (line.length === 0 || line.charAt(0) === ' ') { + newText = Utils.rtrim(newText, ' ') + line + "\n"; + } else { + newText += line + ' '; + } + } + text = newText; + } + if ('+' !== indicator) { + text = Utils.rtrim(text); + } + if ('' === indicator) { + text = this.PATTERN_TRAILING_LINES.replace(text, "\n"); + } else if ('-' === indicator) { + text = this.PATTERN_TRAILING_LINES.replace(text, ''); + } + return text; + }; + + Parser.prototype.isNextLineIndented = function(ignoreComments) { + var EOF, currentIndentation, ret; + if (ignoreComments == null) { + ignoreComments = true; + } + currentIndentation = this.getCurrentLineIndentation(); + EOF = !this.moveToNextLine(); + if (ignoreComments) { + while (!EOF && this.isCurrentLineEmpty()) { + EOF = !this.moveToNextLine(); + } + } else { + while (!EOF && this.isCurrentLineBlank()) { + EOF = !this.moveToNextLine(); + } + } + if (EOF) { + return false; + } + ret = false; + if (this.getCurrentLineIndentation() > currentIndentation) { + ret = true; + } + this.moveToPreviousLine(); + return ret; + }; + + Parser.prototype.isCurrentLineEmpty = function() { + var trimmedLine; + trimmedLine = Utils.trim(this.currentLine, ' '); + return trimmedLine.length === 0 || trimmedLine.charAt(0) === '#'; + }; + + Parser.prototype.isCurrentLineBlank = function() { + return '' === Utils.trim(this.currentLine, ' '); + }; + + Parser.prototype.isCurrentLineComment = function() { + var ltrimmedLine; + ltrimmedLine = Utils.ltrim(this.currentLine, ' '); + return ltrimmedLine.charAt(0) === '#'; + }; + + Parser.prototype.cleanup = function(value) { + var count, i, indent, j, l, len, len1, line, lines, ref, ref1, ref2, smallestIndent, trimmedValue; + if (value.indexOf("\r") !== -1) { + value = value.split("\r\n").join("\n").split("\r").join("\n"); + } + count = 0; + ref = this.PATTERN_YAML_HEADER.replaceAll(value, ''), value = ref[0], count = ref[1]; + this.offset += count; + ref1 = this.PATTERN_LEADING_COMMENTS.replaceAll(value, '', 1), trimmedValue = ref1[0], count = ref1[1]; + if (count === 1) { + this.offset += Utils.subStrCount(value, "\n") - Utils.subStrCount(trimmedValue, "\n"); + value = trimmedValue; + } + ref2 = this.PATTERN_DOCUMENT_MARKER_START.replaceAll(value, '', 1), trimmedValue = ref2[0], count = ref2[1]; + if (count === 1) { + this.offset += Utils.subStrCount(value, "\n") - Utils.subStrCount(trimmedValue, "\n"); + value = trimmedValue; + value = this.PATTERN_DOCUMENT_MARKER_END.replace(value, ''); + } + lines = value.split("\n"); + smallestIndent = -1; + for (j = 0, len = lines.length; j < len; j++) { + line = lines[j]; + if (Utils.trim(line, ' ').length === 0) { + continue; + } + indent = line.length - Utils.ltrim(line).length; + if (smallestIndent === -1 || indent < smallestIndent) { + smallestIndent = indent; + } + } + if (smallestIndent > 0) { + for (i = l = 0, len1 = lines.length; l < len1; i = ++l) { + line = lines[i]; + lines[i] = line.slice(smallestIndent); + } + value = lines.join("\n"); + } + return value; + }; + + Parser.prototype.isNextLineUnIndentedCollection = function(currentIndentation) { + var notEOF, ret; + if (currentIndentation == null) { + currentIndentation = null; + } + if (currentIndentation == null) { + currentIndentation = this.getCurrentLineIndentation(); + } + notEOF = this.moveToNextLine(); + while (notEOF && this.isCurrentLineEmpty()) { + notEOF = this.moveToNextLine(); + } + if (false === notEOF) { + return false; + } + ret = false; + if (this.getCurrentLineIndentation() === currentIndentation && this.isStringUnIndentedCollectionItem(this.currentLine)) { + ret = true; + } + this.moveToPreviousLine(); + return ret; + }; + + Parser.prototype.isStringUnIndentedCollectionItem = function() { + return this.currentLine === '-' || this.currentLine.slice(0, 2) === '- '; + }; + + return Parser; + + })(); + + module.exports = Parser; + + + }, { + "./Exception/ParseException": 4, + "./Exception/ParseMore": 5, + "./Inline": 6, + "./Pattern": 8, + "./Utils": 10 + }], + 8: [function(require, module, exports) { + var Pattern; + + Pattern = (function() { + Pattern.prototype.regex = null; + + Pattern.prototype.rawRegex = null; + + Pattern.prototype.cleanedRegex = null; + + Pattern.prototype.mapping = null; + + function Pattern(rawRegex, modifiers) { + var _char, capturingBracketNumber, cleanedRegex, i, len, mapping, name, part, subChar; + if (modifiers == null) { + modifiers = ''; + } + cleanedRegex = ''; + len = rawRegex.length; + mapping = null; + capturingBracketNumber = 0; + i = 0; + while (i < len) { + _char = rawRegex.charAt(i); + if (_char === '\\') { + cleanedRegex += rawRegex.slice(i, +(i + 1) + 1 || 9e9); + i++; + } else if (_char === '(') { + if (i < len - 2) { + part = rawRegex.slice(i, +(i + 2) + 1 || 9e9); + if (part === '(?:') { + i += 2; + cleanedRegex += part; + } else if (part === '(?<') { + capturingBracketNumber++; + i += 2; + name = ''; + while (i + 1 < len) { + subChar = rawRegex.charAt(i + 1); + if (subChar === '>') { + cleanedRegex += '('; + i++; + if (name.length > 0) { + if (mapping == null) { + mapping = {}; + } + mapping[name] = capturingBracketNumber; + } + break; + } else { + name += subChar; + } + i++; + } + } else { + cleanedRegex += _char; + capturingBracketNumber++; + } + } else { + cleanedRegex += _char; + } + } else { + cleanedRegex += _char; + } + i++; + } + this.rawRegex = rawRegex; + this.cleanedRegex = cleanedRegex; + this.regex = new RegExp(this.cleanedRegex, 'g' + modifiers.replace('g', '')); + this.mapping = mapping; + } + + Pattern.prototype.exec = function(str) { + var index, matches, name, ref; + this.regex.lastIndex = 0; + matches = this.regex.exec(str); + if (matches == null) { + return null; + } + if (this.mapping != null) { + ref = this.mapping; + for (name in ref) { + index = ref[name]; + matches[name] = matches[index]; + } + } + return matches; + }; + + Pattern.prototype.test = function(str) { + this.regex.lastIndex = 0; + return this.regex.test(str); + }; + + Pattern.prototype.replace = function(str, replacement) { + this.regex.lastIndex = 0; + return str.replace(this.regex, replacement); + }; + + Pattern.prototype.replaceAll = function(str, replacement, limit) { + var count; + if (limit == null) { + limit = 0; + } + this.regex.lastIndex = 0; + count = 0; + while (this.regex.test(str) && (limit === 0 || count < limit)) { + this.regex.lastIndex = 0; + str = str.replace(this.regex, replacement); + count++; + } + return [str, count]; + }; + + return Pattern; + + })(); + + module.exports = Pattern; + + + }, {}], + 9: [function(require, module, exports) { + var Pattern, Unescaper, Utils; + + Utils = require('./Utils'); + + Pattern = require('./Pattern'); + + Unescaper = (function() { + function Unescaper() {} + + Unescaper.PATTERN_ESCAPED_CHARACTER = new Pattern( + '\\\\([0abt\tnvfre "\\/\\\\N_LP]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})'); + + Unescaper.unescapeSingleQuotedString = function(value) { + return value.replace(/\'\'/g, '\''); + }; + + Unescaper.unescapeDoubleQuotedString = function(value) { + if (this._unescapeCallback == null) { + this._unescapeCallback = (function(_this) { + return function(str) { + return _this.unescapeCharacter(str); + }; + })(this); + } + return this.PATTERN_ESCAPED_CHARACTER.replace(value, this._unescapeCallback); + }; + + Unescaper.unescapeCharacter = function(value) { + var ch; + ch = String.fromCharCode; + switch (value.charAt(1)) { + case '0': + return ch(0); + case 'a': + return ch(7); + case 'b': + return ch(8); + case 't': + return "\t"; + case "\t": + return "\t"; + case 'n': + return "\n"; + case 'v': + return ch(11); + case 'f': + return ch(12); + case 'r': + return ch(13); + case 'e': + return ch(27); + case ' ': + return ' '; + case '"': + return '"'; + case '/': + return '/'; + case '\\': + return '\\'; + case 'N': + return ch(0x0085); + case '_': + return ch(0x00A0); + case 'L': + return ch(0x2028); + case 'P': + return ch(0x2029); + case 'x': + return Utils.utf8chr(Utils.hexDec(value.substr(2, 2))); + case 'u': + return Utils.utf8chr(Utils.hexDec(value.substr(2, 4))); + case 'U': + return Utils.utf8chr(Utils.hexDec(value.substr(2, 8))); + default: + return ''; + } + }; + + return Unescaper; + + })(); + + module.exports = Unescaper; + + + }, { + "./Pattern": 8, + "./Utils": 10 + }], + 10: [function(require, module, exports) { + var Pattern, Utils, + hasProp = {}.hasOwnProperty; + + Pattern = require('./Pattern'); + + Utils = (function() { + function Utils() {} + + Utils.REGEX_LEFT_TRIM_BY_CHAR = {}; + + Utils.REGEX_RIGHT_TRIM_BY_CHAR = {}; + + Utils.REGEX_SPACES = /\s+/g; + + Utils.REGEX_DIGITS = /^\d+$/; + + Utils.REGEX_OCTAL = /[^0-7]/gi; + + Utils.REGEX_HEXADECIMAL = /[^a-f0-9]/gi; + + Utils.PATTERN_DATE = new Pattern('^' + '(?[0-9][0-9][0-9][0-9])' + '-(?[0-9][0-9]?)' + + '-(?[0-9][0-9]?)' + '(?:(?:[Tt]|[ \t]+)' + '(?[0-9][0-9]?)' + ':(?[0-9][0-9])' + + ':(?[0-9][0-9])' + '(?:\.(?[0-9]*))?' + + '(?:[ \t]*(?Z|(?[-+])(?[0-9][0-9]?)' + '(?::(?[0-9][0-9]))?))?)?' + '$', 'i' + ); + + Utils.LOCAL_TIMEZONE_OFFSET = new Date().getTimezoneOffset() * 60 * 1000; + + Utils.trim = function(str, _char) { + var regexLeft, regexRight; + if (_char == null) { + _char = '\\s'; + } + regexLeft = this.REGEX_LEFT_TRIM_BY_CHAR[_char]; + if (regexLeft == null) { + this.REGEX_LEFT_TRIM_BY_CHAR[_char] = regexLeft = new RegExp('^' + _char + '' + _char + '*'); + } + regexLeft.lastIndex = 0; + regexRight = this.REGEX_RIGHT_TRIM_BY_CHAR[_char]; + if (regexRight == null) { + this.REGEX_RIGHT_TRIM_BY_CHAR[_char] = regexRight = new RegExp(_char + '' + _char + '*$'); + } + regexRight.lastIndex = 0; + return str.replace(regexLeft, '').replace(regexRight, ''); + }; + + Utils.ltrim = function(str, _char) { + var regexLeft; + if (_char == null) { + _char = '\\s'; + } + regexLeft = this.REGEX_LEFT_TRIM_BY_CHAR[_char]; + if (regexLeft == null) { + this.REGEX_LEFT_TRIM_BY_CHAR[_char] = regexLeft = new RegExp('^' + _char + '' + _char + '*'); + } + regexLeft.lastIndex = 0; + return str.replace(regexLeft, ''); + }; + + Utils.rtrim = function(str, _char) { + var regexRight; + if (_char == null) { + _char = '\\s'; + } + regexRight = this.REGEX_RIGHT_TRIM_BY_CHAR[_char]; + if (regexRight == null) { + this.REGEX_RIGHT_TRIM_BY_CHAR[_char] = regexRight = new RegExp(_char + '' + _char + '*$'); + } + regexRight.lastIndex = 0; + return str.replace(regexRight, ''); + }; + + Utils.isEmpty = function(value) { + return !value || value === '' || value === '0' || (value instanceof Array && value.length === 0) || this.isEmptyObject( + value); + }; + + Utils.isEmptyObject = function(value) { + var k; + return value instanceof Object && ((function() { + var results; + results = []; + for (k in value) { + if (!hasProp.call(value, k)) continue; + results.push(k); + } + return results; + })()).length === 0; + }; + + Utils.subStrCount = function(string, subString, start, length) { + var c, i, j, len, ref, sublen; + c = 0; + string = '' + string; + subString = '' + subString; + if (start != null) { + string = string.slice(start); + } + if (length != null) { + string = string.slice(0, length); + } + len = string.length; + sublen = subString.length; + for (i = j = 0, ref = len; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) { + if (subString === string.slice(i, sublen)) { + c++; + i += sublen - 1; + } + } + return c; + }; + + Utils.isDigits = function(input) { + this.REGEX_DIGITS.lastIndex = 0; + return this.REGEX_DIGITS.test(input); + }; + + Utils.octDec = function(input) { + this.REGEX_OCTAL.lastIndex = 0; + return parseInt((input + '').replace(this.REGEX_OCTAL, ''), 8); + }; + + Utils.hexDec = function(input) { + this.REGEX_HEXADECIMAL.lastIndex = 0; + input = this.trim(input); + if ((input + '').slice(0, 2) === '0x') { + input = (input + '').slice(2); + } + return parseInt((input + '').replace(this.REGEX_HEXADECIMAL, ''), 16); + }; + + Utils.utf8chr = function(c) { + var ch; + ch = String.fromCharCode; + if (0x80 > (c %= 0x200000)) { + return ch(c); + } + if (0x800 > c) { + return ch(0xC0 | c >> 6) + ch(0x80 | c & 0x3F); + } + if (0x10000 > c) { + return ch(0xE0 | c >> 12) + ch(0x80 | c >> 6 & 0x3F) + ch(0x80 | c & 0x3F); + } + return ch(0xF0 | c >> 18) + ch(0x80 | c >> 12 & 0x3F) + ch(0x80 | c >> 6 & 0x3F) + ch(0x80 | c & 0x3F); + }; + + Utils.parseBoolean = function(input, strict) { + var lowerInput; + if (strict == null) { + strict = true; + } + if (typeof input === 'string') { + lowerInput = input.toLowerCase(); + if (!strict) { + if (lowerInput === 'no') { + return false; + } + } + if (lowerInput === '0') { + return false; + } + if (lowerInput === 'false') { + return false; + } + if (lowerInput === '') { + return false; + } + return true; + } + return !!input; + }; + + Utils.isNumeric = function(input) { + this.REGEX_SPACES.lastIndex = 0; + return typeof input === 'number' || typeof input === 'string' && !isNaN(input) && input.replace(this.REGEX_SPACES, + '') !== ''; + }; + + Utils.stringToDate = function(str) { + var date, day, fraction, hour, info, minute, month, second, tz_hour, tz_minute, tz_offset, year; + if (!(str != null ? str.length : void 0)) { + return null; + } + info = this.PATTERN_DATE.exec(str); + if (!info) { + return null; + } + year = parseInt(info.year, 10); + month = parseInt(info.month, 10) - 1; + day = parseInt(info.day, 10); + if (info.hour == null) { + date = new Date(Date.UTC(year, month, day)); + return date; + } + hour = parseInt(info.hour, 10); + minute = parseInt(info.minute, 10); + second = parseInt(info.second, 10); + if (info.fraction != null) { + fraction = info.fraction.slice(0, 3); + while (fraction.length < 3) { + fraction += '0'; + } + fraction = parseInt(fraction, 10); + } else { + fraction = 0; + } + if (info.tz != null) { + tz_hour = parseInt(info.tz_hour, 10); + if (info.tz_minute != null) { + tz_minute = parseInt(info.tz_minute, 10); + } else { + tz_minute = 0; + } + tz_offset = (tz_hour * 60 + tz_minute) * 60000; + if ('-' === info.tz_sign) { + tz_offset *= -1; + } + } + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + if (tz_offset) { + date.setTime(date.getTime() - tz_offset); + } + return date; + }; + + Utils.strRepeat = function(str, number) { + var i, res; + res = ''; + i = 0; + while (i < number) { + res += str; + i++; + } + return res; + }; + + Utils.getStringFromFile = function(path, callback) { + var data, fs, j, len1, name, ref, req, xhr; + if (callback == null) { + callback = null; + } + xhr = null; + if (typeof window !== "undefined" && window !== null) { + if (window.XMLHttpRequest) { + xhr = new XMLHttpRequest(); + } else if (window.ActiveXObject) { + ref = ["Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.3.0", "Msxml2.XMLHTTP", "Microsoft.XMLHTTP"]; + for (j = 0, len1 = ref.length; j < len1; j++) { + name = ref[j]; + try { + xhr = new ActiveXObject(name); + } catch (undefined) {} + } + } + } + if (xhr != null) { + if (callback != null) { + xhr.onreadystatechange = function() { + if (xhr.readyState === 4) { + if (xhr.status === 200 || xhr.status === 0) { + return callback(xhr.responseText); + } else { + return callback(null); + } + } + }; + xhr.open('GET', path, true); + return xhr.send(null); + } else { + xhr.open('GET', path, false); + xhr.send(null); + if (xhr.status === 200 || xhr.status === 0) { + return xhr.responseText; + } + return null; + } + } else { + req = require; + fs = req('fs'); + if (callback != null) { + return fs.readFile(path, function(err, data) { + if (err) { + return callback(null); + } else { + return callback(String(data)); + } + }); + } else { + data = fs.readFileSync(path); + if (data != null) { + return String(data); + } + return null; + } + } + }; + + return Utils; + + })(); + + module.exports = Utils; + + + }, { + "./Pattern": 8 + }], + 11: [function(require, module, exports) { + var Dumper, Parser, Utils, Yaml; + + Parser = require('./Parser'); + + Dumper = require('./Dumper'); + + Utils = require('./Utils'); + + Yaml = (function() { + function Yaml() {} + + Yaml.parse = function(input, exceptionOnInvalidType, objectDecoder) { + if (exceptionOnInvalidType == null) { + exceptionOnInvalidType = false; + } + if (objectDecoder == null) { + objectDecoder = null; + } + return new Parser().parse(input, exceptionOnInvalidType, objectDecoder); + }; + + Yaml.parseFile = function(path, callback, exceptionOnInvalidType, objectDecoder) { + var input; + if (callback == null) { + callback = null; + } + if (exceptionOnInvalidType == null) { + exceptionOnInvalidType = false; + } + if (objectDecoder == null) { + objectDecoder = null; + } + if (callback != null) { + return Utils.getStringFromFile(path, (function(_this) { + return function(input) { + var result; + result = null; + if (input != null) { + result = _this.parse(input, exceptionOnInvalidType, objectDecoder); + } + callback(result); + }; + })(this)); + } else { + input = Utils.getStringFromFile(path); + if (input != null) { + return this.parse(input, exceptionOnInvalidType, objectDecoder); + } + return null; + } + }; + + Yaml.dump = function(input, inline, indent, exceptionOnInvalidType, objectEncoder) { + var yaml; + if (inline == null) { + inline = 2; + } + if (indent == null) { + indent = 4; + } + if (exceptionOnInvalidType == null) { + exceptionOnInvalidType = false; + } + if (objectEncoder == null) { + objectEncoder = null; + } + yaml = new Dumper(); + yaml.indentation = indent; + return yaml.dump(input, inline, 0, exceptionOnInvalidType, objectEncoder); + }; + + Yaml.stringify = function(input, inline, indent, exceptionOnInvalidType, objectEncoder) { + return this.dump(input, inline, indent, exceptionOnInvalidType, objectEncoder); + }; + + Yaml.load = function(path, callback, exceptionOnInvalidType, objectDecoder) { + return this.parseFile(path, callback, exceptionOnInvalidType, objectDecoder); + }; + + return Yaml; + + })(); + + if (typeof window !== "undefined" && window !== null) { + window.YAML = Yaml; + } + + if (typeof window === "undefined" || window === null) { + this.YAML = Yaml; + } + + module.exports = Yaml; + + + }, { + "./Dumper": 1, + "./Parser": 7, + "./Utils": 10 + }] }, {}, [11]); diff --git a/src/main/resources/static/component/pear/pear.js b/src/main/resources/static/component/pear/pear.js index d2bcaa8e..236631ce 100644 --- a/src/main/resources/static/component/pear/pear.js +++ b/src/main/resources/static/component/pear/pear.js @@ -1,46 +1,51 @@ window.rootPath = (function (src) { - src = document.scripts[document.scripts.length - 1].src; - return src.substring(0, src.lastIndexOf("/") + 1); + src = document.currentScript + ? document.currentScript.src + : document.scripts[document.scripts.length - 1].src; + return src.substring(0, src.lastIndexOf("/") + 1); })(); layui.config({ - base: rootPath + "module/", - version: "3.9.7" + base: rootPath + "module/", + version: "3.40.0" }).extend({ - admin: "admin", - menu: "menu", - frame: "frame", - tab: "tab", - card: "card", - convert: "convert", - tinymce: "tinymce/tinymce", - echarts: "echarts", - encrypt: "encrypt", - echartsTheme: "echartsTheme", - document: "document", - select: "select", - drawer: "drawer", - notice: "notice", - step: "step", - tag: "tag", - popup: "popup", - treetable: "treetable", - dtree: "dtree", - area: "area", - count: "count", - topBar: "topBar", - button: "button", - design: "design", - common: "common", - eleTree: "eleTree", - dictionary: 'dictionary', - json: 'json', - cropper: "cropper", - yaml: "yaml", - theme: "theme", - message: "message", - toast: "toast", - iconPicker: "iconPicker" + admin: "admin", // 框架布局组件 + common: "common", // 公共方法封装 + menu: "menu", // 数据菜单组件 + frame: "frame", // 内容页面组件 + tab: "tab", // 多选项卡组件 + echarts: "echarts", // 数据图表组件 + echartsTheme: "echartsTheme",// 数据图表主题 + encrypt: "encrypt", // 数据加密组件 + select: "select", // 下拉多选组件 + drawer: "drawer", // 抽屉弹层组件 + notice: "notice", // 消息提示组件 + step:"step", // 分布表单组件 + tag:"tag", // 多标签页组件 + popup:"popup", // 弹层封装 + treetable:"treetable", // 树状表格 + dtree:"dtree", // 树结构 + tinymce:"tinymce/tinymce", // 编辑器 + area:"area", // 省市级联 + count:"count", // 数字滚动 + topBar: "topBar", // 置顶组件 + button: "button", // 加载按钮 + design: "design", // 表单设计 + card: "card", // 数据卡片组件 + loading: "loading", // 加载组件 + cropper:"cropper", // 裁剪组件 + convert:"convert", // 数据转换 + yaml:"yaml", // yaml 解析组件 + context: "context", // 上下文组件 + http: "http", // 网络请求组件 + theme: "theme", // 主题转换 + message: "message", // 通知组件 + toast: "toast", // 消息通知 + iconPicker: "iconPicker", // 图标选择 + nprogress: "nprogress", // 进度过渡 + watermark:"watermark/watermark", //水印组件 + fullscreen:"fullscreen", //全屏组件 + popover:"popover/popover" //汽泡组件 }).use(['layer', 'theme'], function () { - layui.theme.changeTheme(window, false); -}); + layui.theme.changeTheme(window, false); +}); \ No newline at end of file diff --git a/src/main/resources/static/pear.config.json b/src/main/resources/static/pear.config.json index c16ae006..2a1994d9 100644 --- a/src/main/resources/static/pear.config.json +++ b/src/main/resources/static/pear.config.json @@ -22,29 +22,36 @@ "theme": { "defaultColor": "2", "defaultMenu": "dark-theme", - "allowCustom": true + "defaultHeader": "light-theme", + "allowCustom": true, + "banner": false }, "colors": [ { - "id": "1", - "color": "#FF5722" - }, - { - "id": "2", - "color": "#5FB878" - }, - { - "id": "3", - "color": "#1E9FFF" - }, - { - "id": "4", - "color": "#FFB800" - }, - { - "id": "5", - "color": "darkgray" - } + "id": "1", + "color": "#2d8cf0", + "second": "#ecf5ff" + }, + { + "id": "2", + "color": "#36b368", + "second": "#f0f9eb" + }, + { + "id": "3", + "color": "#f6ad55", + "second": "#fdf6ec" + }, + { + "id": "4", + "color": "#f56c6c", + "second": "#fef0f0" + }, + { + "id": "5", + "color": "#3963bc", + "second": "#ecf5ff" + } ], "links": [ { @@ -69,7 +76,8 @@ } ], "other": { + "keepLoad": "1200", "autoHead": false, - "keepLoad": 1200 + "footer": false } } diff --git a/src/main/resources/static/pear.config.yml b/src/main/resources/static/pear.config.yml index b84242f5..bfdb5493 100644 --- a/src/main/resources/static/pear.config.yml +++ b/src/main/resources/static/pear.config.yml @@ -16,8 +16,6 @@ menu: collaspe: false ## 是否开启多系统菜单模式 control: false - ## 顶部菜单宽度 PX - controlWidth: 500 ## 默认选中的菜单项 select: "10" ## 是否开启异步菜单,false 时 data 属性设置为静态数据,true 时为后端接口 @@ -30,6 +28,7 @@ tab: keepState: true ## 开启选项卡记忆 session: true + ## 最大可打开的选项卡数量 max: "30" ## 首页 @@ -72,6 +71,8 @@ other: keepLoad: "1200" ## 布局顶部主题 autoHead: false + ## 页脚 + footer: false ## 头部配置 header: ## 站内消息,通过 false 设置关闭 diff --git a/src/main/resources/templates/system/role/power.html b/src/main/resources/templates/system/role/power.html index 322fba4d..1f114224 100644 --- a/src/main/resources/templates/system/role/power.html +++ b/src/main/resources/templates/system/role/power.html @@ -40,7 +40,7 @@ checkbar: true, skin: "layui", initLevel: "1", - checkbarType: "self", + checkbarType: "all", response: {treeId: "powerId", parentId: "parentId", title: "powerName"}, }); -- Gitee From 664a57129a4e463c2057463cca8a8d1196316f86 Mon Sep 17 00:00:00 2001 From: luzhengwang Date: Fri, 19 Jan 2024 15:18:28 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=A1=A5=E5=85=85common.js=E7=BC=BA?= =?UTF-8?q?=E5=A4=B1=E6=96=B9=E6=B3=95=EF=BC=8C=E5=90=8C=E6=97=B6=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E9=87=8D=E5=A4=8D=E6=8F=90=E4=BA=A4=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E7=94=9F=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pearadmin/common/aop/RepeatAspect.java | 4 +- .../sys/controller/SysConfigController.java | 2 + .../controller/SysDataSourceController.java | 2 + .../sys/controller/SysDeptController.java | 2 + .../sys/controller/SysDictController.java | 2 + .../sys/controller/SysDictDataController.java | 2 + .../sys/controller/SysMailController.java | 2 + .../sys/controller/SysNoticeController.java | 2 + .../sys/controller/SysPowerController.java | 2 + .../sys/controller/SysRoleController.java | 2 + .../sys/controller/SysSetupController.java | 3 + .../static/component/pear/module/common.js | 212 +++++++++++++++++- 12 files changed, 234 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/pearadmin/common/aop/RepeatAspect.java b/src/main/java/com/pearadmin/common/aop/RepeatAspect.java index bc8bf85d..52d2cde0 100644 --- a/src/main/java/com/pearadmin/common/aop/RepeatAspect.java +++ b/src/main/java/com/pearadmin/common/aop/RepeatAspect.java @@ -29,7 +29,7 @@ import java.util.concurrent.TimeUnit; */ @Aspect @Component -public abstract class RepeatAspect { +public class RepeatAspect { /** * Redis 模板 @@ -68,7 +68,7 @@ public abstract class RepeatAspect { /** * 切 面 编 程 * */ - @Pointcut("@annotation(com.pearadmin.common.aop.annotation.Repeat) || @within(com.pearadmin.pro.common.aop.annotation.Repeat)") + @Pointcut("@annotation(com.pearadmin.common.aop.annotation.Repeat) || @within(com.pearadmin.common.aop.annotation.Repeat)") public void dsPointCut() { } /** diff --git a/src/main/java/com/pearadmin/modules/sys/controller/SysConfigController.java b/src/main/java/com/pearadmin/modules/sys/controller/SysConfigController.java index bf1432a6..be9d403a 100644 --- a/src/main/java/com/pearadmin/modules/sys/controller/SysConfigController.java +++ b/src/main/java/com/pearadmin/modules/sys/controller/SysConfigController.java @@ -1,6 +1,7 @@ package com.pearadmin.modules.sys.controller; import com.github.pagehelper.PageInfo; +import com.pearadmin.common.aop.annotation.Repeat; import com.pearadmin.common.constant.ControllerConstant; import com.pearadmin.common.tools.SequenceUtil; import com.pearadmin.common.web.base.BaseController; @@ -80,6 +81,7 @@ public class SysConfigController extends BaseController { * Param: sysConfig * Return: ResultBean */ + @Repeat @PostMapping("save") @PreAuthorize("hasPermission('/system/config/add','sys:config:add')") public Result save(@RequestBody SysConfig sysConfig) { diff --git a/src/main/java/com/pearadmin/modules/sys/controller/SysDataSourceController.java b/src/main/java/com/pearadmin/modules/sys/controller/SysDataSourceController.java index 83742a1f..ba7790e7 100644 --- a/src/main/java/com/pearadmin/modules/sys/controller/SysDataSourceController.java +++ b/src/main/java/com/pearadmin/modules/sys/controller/SysDataSourceController.java @@ -2,6 +2,7 @@ package com.pearadmin.modules.sys.controller; import com.github.pagehelper.PageInfo; import com.pearadmin.common.aop.annotation.Log; +import com.pearadmin.common.aop.annotation.Repeat; import com.pearadmin.common.constant.ControllerConstant; import com.pearadmin.common.web.base.BaseController; import com.pearadmin.common.web.domain.request.PageDomain; @@ -80,6 +81,7 @@ public class SysDataSourceController extends BaseController { * * @param sysDataSource 多库实体 */ + @Repeat @PostMapping("save") @Log(title = "新增多库") @ApiOperation(value = "新增多库") diff --git a/src/main/java/com/pearadmin/modules/sys/controller/SysDeptController.java b/src/main/java/com/pearadmin/modules/sys/controller/SysDeptController.java index 414facc5..4e8f83d3 100644 --- a/src/main/java/com/pearadmin/modules/sys/controller/SysDeptController.java +++ b/src/main/java/com/pearadmin/modules/sys/controller/SysDeptController.java @@ -1,5 +1,6 @@ package com.pearadmin.modules.sys.controller; +import com.pearadmin.common.aop.annotation.Repeat; import com.pearadmin.common.constant.ControllerConstant; import com.pearadmin.common.tools.SequenceUtil; import com.pearadmin.common.web.base.BaseController; @@ -88,6 +89,7 @@ public class SysDeptController extends BaseController { * Param SysDept * Return 执行结果 */ + @Repeat @PostMapping("save") @ApiOperation(value = "保存部门数据") @PreAuthorize("hasPermission('/system/dept/add','sys:dept:add')") diff --git a/src/main/java/com/pearadmin/modules/sys/controller/SysDictController.java b/src/main/java/com/pearadmin/modules/sys/controller/SysDictController.java index 9b6c2b58..b178d572 100644 --- a/src/main/java/com/pearadmin/modules/sys/controller/SysDictController.java +++ b/src/main/java/com/pearadmin/modules/sys/controller/SysDictController.java @@ -1,6 +1,7 @@ package com.pearadmin.modules.sys.controller; import com.github.pagehelper.PageInfo; +import com.pearadmin.common.aop.annotation.Repeat; import com.pearadmin.common.constant.ControllerConstant; import com.pearadmin.common.tools.SequenceUtil; import com.pearadmin.common.web.base.BaseController; @@ -79,6 +80,7 @@ public class SysDictController extends BaseController { * Param: sysDictType * Return: ResuBean */ + @Repeat @PostMapping("save") @PreAuthorize("hasPermission('/system/dictType/add','sys:dictType:add')") public Result save(@RequestBody SysDict sysDict) { diff --git a/src/main/java/com/pearadmin/modules/sys/controller/SysDictDataController.java b/src/main/java/com/pearadmin/modules/sys/controller/SysDictDataController.java index 64b090f4..0a6a9fe7 100644 --- a/src/main/java/com/pearadmin/modules/sys/controller/SysDictDataController.java +++ b/src/main/java/com/pearadmin/modules/sys/controller/SysDictDataController.java @@ -1,6 +1,7 @@ package com.pearadmin.modules.sys.controller; import com.github.pagehelper.PageInfo; +import com.pearadmin.common.aop.annotation.Repeat; import com.pearadmin.common.constant.CommonConstant; import com.pearadmin.common.constant.ControllerConstant; import com.pearadmin.modules.sys.domain.SysDictData; @@ -152,6 +153,7 @@ public class SysDictDataController extends BaseController { * Param: sysDictType * Return: Result */ + @Repeat @PostMapping("save") @PreAuthorize("hasPermission('/system/dictData/add','sys:dictData:add')") public Result save(@RequestBody SysDictData sysDictData) { diff --git a/src/main/java/com/pearadmin/modules/sys/controller/SysMailController.java b/src/main/java/com/pearadmin/modules/sys/controller/SysMailController.java index 2f432779..04b07bf7 100644 --- a/src/main/java/com/pearadmin/modules/sys/controller/SysMailController.java +++ b/src/main/java/com/pearadmin/modules/sys/controller/SysMailController.java @@ -2,6 +2,7 @@ package com.pearadmin.modules.sys.controller; import cn.hutool.core.collection.CollectionUtil; import com.github.pagehelper.PageInfo; +import com.pearadmin.common.aop.annotation.Repeat; import com.pearadmin.common.constant.ControllerConstant; import com.pearadmin.common.tools.string.StringUtil; import com.pearadmin.common.web.base.BaseController; @@ -77,6 +78,7 @@ public class SysMailController extends BaseController { * Param: SysMail * Return: 操作结果 */ + @Repeat @PostMapping("/save") @ApiOperation(value = "邮件保存和发送") @PreAuthorize("hasPermission('/system/mail/save','sys:mail:save')") diff --git a/src/main/java/com/pearadmin/modules/sys/controller/SysNoticeController.java b/src/main/java/com/pearadmin/modules/sys/controller/SysNoticeController.java index 3c5dc7c8..a02f5595 100644 --- a/src/main/java/com/pearadmin/modules/sys/controller/SysNoticeController.java +++ b/src/main/java/com/pearadmin/modules/sys/controller/SysNoticeController.java @@ -1,6 +1,7 @@ package com.pearadmin.modules.sys.controller; import com.github.pagehelper.PageInfo; +import com.pearadmin.common.aop.annotation.Repeat; import com.pearadmin.common.context.UserContext; import com.pearadmin.common.tools.SequenceUtil; import com.pearadmin.common.tools.string.Convert; @@ -113,6 +114,7 @@ public class SysNoticeController extends BaseController { /** * 新增保存notice */ + @Repeat @ResponseBody @PostMapping("/save") @PreAuthorize("hasPermission('/system/notice/add','system:notice:add')") diff --git a/src/main/java/com/pearadmin/modules/sys/controller/SysPowerController.java b/src/main/java/com/pearadmin/modules/sys/controller/SysPowerController.java index 6d348b54..b0fb75f3 100644 --- a/src/main/java/com/pearadmin/modules/sys/controller/SysPowerController.java +++ b/src/main/java/com/pearadmin/modules/sys/controller/SysPowerController.java @@ -1,5 +1,6 @@ package com.pearadmin.modules.sys.controller; +import com.pearadmin.common.aop.annotation.Repeat; import com.pearadmin.common.constant.ControllerConstant; import com.pearadmin.common.context.UserContext; import com.pearadmin.common.tools.SequenceUtil; @@ -92,6 +93,7 @@ public class SysPowerController extends BaseController { * Param: SysPower * Return: ResuBean */ + @Repeat @PostMapping("save") @PreAuthorize("hasPermission('/system/power/add','sys:power:add')") public Result save(@RequestBody SysPower sysPower) { diff --git a/src/main/java/com/pearadmin/modules/sys/controller/SysRoleController.java b/src/main/java/com/pearadmin/modules/sys/controller/SysRoleController.java index 45500c6d..ac984080 100644 --- a/src/main/java/com/pearadmin/modules/sys/controller/SysRoleController.java +++ b/src/main/java/com/pearadmin/modules/sys/controller/SysRoleController.java @@ -1,6 +1,7 @@ package com.pearadmin.modules.sys.controller; import com.github.pagehelper.PageInfo; +import com.pearadmin.common.aop.annotation.Repeat; import com.pearadmin.common.constant.ControllerConstant; import com.pearadmin.common.web.base.BaseController; import com.pearadmin.common.web.domain.request.PageDomain; @@ -84,6 +85,7 @@ public class SysRoleController extends BaseController { * Param SysRole * Return 执行结果 */ + @Repeat @PostMapping("save") @ApiOperation(value = "保存角色数据") @PreAuthorize("hasPermission('/system/role/add','sys:role:add')") diff --git a/src/main/java/com/pearadmin/modules/sys/controller/SysSetupController.java b/src/main/java/com/pearadmin/modules/sys/controller/SysSetupController.java index 9c32615c..c80f06df 100644 --- a/src/main/java/com/pearadmin/modules/sys/controller/SysSetupController.java +++ b/src/main/java/com/pearadmin/modules/sys/controller/SysSetupController.java @@ -1,6 +1,8 @@ package com.pearadmin.modules.sys.controller; import cn.hutool.core.map.MapUtil; + +import com.pearadmin.common.aop.annotation.Repeat; import com.pearadmin.common.constant.ConfigurationConstant; import com.pearadmin.common.constant.ControllerConstant; import com.pearadmin.common.web.listener.event.SetupEvent; @@ -65,6 +67,7 @@ public class SysSetupController extends BaseController implements ApplicationEve return jumpPage(MODULE_PATH + "main"); } + @Repeat @Transactional(rollbackFor = Exception.class) @PutMapping("save") @PreAuthorize("hasPermission('/system/setup/add','sys:setup:add')") diff --git a/src/main/resources/static/component/pear/module/common.js b/src/main/resources/static/component/pear/module/common.js index 50f2f15d..a593f54a 100644 --- a/src/main/resources/static/component/pear/module/common.js +++ b/src/main/resources/static/component/pear/module/common.js @@ -28,7 +28,217 @@ layui.define(['jquery', 'element', 'table'], function (exports) { ids = ids.substring(0, ids.length - 1); return ids; } - + + this.resizeTable = function (tableId) { + layui.table.resize(tableId); + } + + this.sprintf = function (str) { + var args = arguments, flag = true, i = 1; + str = str.replace(/%s/g, function () { + var arg = args[i++]; + if (typeof arg === 'undefined') { + flag = false; + return ''; + } + return arg; + }); + return flag ? str : ''; + } + + this.equals = function (str, that) { + return str == that; + } + + this.equalsIgnoreCase = function (str, that) { + return String(str).toUpperCase() === String(that).toUpperCase(); + } + + this.isEmpty = function (value) { + if (typeof (value) === "undefined" || value == null || this.trim(value) == "") { + return true; + } + return false; + } + + this.formatNullStr = function (o) { + if (this.isEmpty(o)) { + return ""; + } else { + return o; + } + } + + this.getJsonArrayValue = function (array, key, keyChecked, keyId) { + var aa = []; + for (var a in array) { + var _item = array[a]; + if (_item[keyChecked]) { + aa.push(_item[keyId]); + } + if (typeof (_item[key]) != "undefined" && _item[key].length > 0) { + var _aa = this.getJsonArrayValue(_item[key], key, keyChecked, keyId); + if (_aa != null && _aa.length > 0) { + for (var _a in _aa) { + aa.push(_aa[_a]); + } + } + } + } + return aa; + } + + this.trim = function (value) { + if (value == null) { + return ""; + } + return value.toString().replace(/(^\s*)|(\s*$)|\r|\n/g, ""); + } + + this.random = function (min, max) { + return Math.floor((Math.random() * max) + min); + } + + this.getCheckValues = function (name) { + var _items = $('input:checkbox[name*="' + name + '"]:checked'); + var _itemsStr = ""; + layui.each(_items, function (i, n) { + _itemsStr += "," + $(n).val(); + }); + if (_itemsStr.length > 0) { + return _itemsStr.substr(1, _itemsStr.length); + } + return ""; + } + + this.joinArray = function (array, key) { + var _itemsStr = ""; + layui.each(array, function (i, n) { + _itemsStr += "," + n[key]; + }); + if (_itemsStr.length > 0) { + return _itemsStr.substr(1, _itemsStr.length); + } + return ""; + } + + this.getDictLabel = function (array, value) { + var actions = []; + layui.each(array, function (i, n) { + if (n.dictValue === value) { + actions.push(n.dictLabel); + } + }); + return actions.join(''); + } + + this.ajaxRemove = function (removeUrl, id, cb) { + if (id == '' || id == undefined) { + layui.layer.alert('请选择删除数据!'); + return; + } + var url = this.isEmpty(id) ? removeUrl : removeUrl.replace("{id}", id); + var msg = (id.length > 0 && id.indexOf(",") > 0) ? "是否确认删除这些项?" : "是否确认删除该项?"; + layer.confirm(msg, function (index) { + $.ajax({ + type: "POST", + url: url, + async: true, + cache: false, + dataType: "json", + data: {"ids": id}, + success: function (res) { + if (typeof (cb) === "function") { + cb(res); + } + layer.close(index); + } + }); + }); + } + + this.ajax = new function() { + this.submit = function (url, type, dataType, data, cb) { + var config = { + url: url, + type: type, + dataType: dataType, + data: data, + beforeSend: function () { + //layer.loading("正在处理中,请稍后..."); + layer.load(2); + }, + success: function (result) { + layer.closeAll('loading'); + if (typeof (cb) === "function") { + cb(result); + } + } + }; + $.ajax(config) + } + + this.post = function (url, data, cb) { + obj.ajax.submit(url, "post", "json", data, cb); + }, + this.get = function (url, cb) { + obj.ajax.submit(url, "get", "json", "", cb); + } + } + + this.verify = new function() { + this.roleKey = function (value, item) { + var msg; + if (!new RegExp("^[a-zA-Z0-9_\u4e00-\u9fa5\\s·]+$").test(value)) { + msg = 'roleKey不能有特殊字符'; + } + $.ajax({ + type: "POST", + url: "/system/role/checkRoleKeyUnique", + async: false, + cache: false, + dataType: "json", + data: { + roleKey: $("[name='roleKey']").val() + }, + success: function (res) { + if (res != "0") { + msg = "roleKey已存在,请修改!"; + } + }, + error: function () { + msg = "验证roleKey出错!"; + } + }); + return msg; + } + this.roleName = function (value, item) { + var msg; + if (!new RegExp("^[a-zA-Z0-9_\u4e00-\u9fa5\\s·]+$").test(value)) { + msg = 'roleName不能有特殊字符'; + } + $.ajax({ + type: "POST", + url: "/system/role/checkRoleNameUnique", + async: false, + cache: false, + dataType: "json", + data: { + roleName: $("[name='roleName']").val() + }, + success: function (res) { + if (res != "0") { + msg = "roleName已存在,请修改!"; + } + }, + error: function () { + msg = "验证roleName出错!"; + } + }); + return msg; + } + } + /** * 当前是否为与移动端 * */ -- Gitee